s.length;g--)i.el_.removeChild(c[g-1]);c.length=s.length})},t}(ut);ut.registerComponent("LoadProgressBar",T_e);var w_e=function(e){Tt(t,e);function t(r,a){var i;return i=e.call(this,r,a)||this,i.update=Qo(Hn(Qt(i),i.update),Ai),i}var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},n.update=function(a,i,o){var s=qf(this.el_),l=wc(this.player_.el()),u=a.width*i;if(!(!l||!s)){var c=a.left-l.left+u,d=a.width-u+(l.right-a.right),p=s.width/2;cs.width&&(p=s.width),p=Math.round(p),this.el_.style.right="-"+p+"px",this.write(o)}},n.write=function(a){Ql(this.el_,a)},n.updateTime=function(a,i,o,s){var l=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var u,c=l.player_.duration();if(l.player_.liveTracker&&l.player_.liveTracker.isLive()){var d=l.player_.liveTracker.liveWindow(),p=d-i*d;u=(p<1?"":"-")+Ec(p,d)}else u=Ec(o,c);l.update(a,i,u),s&&s()})},t}(ut);ut.registerComponent("TimeTooltip",w_e);var OT=function(e){Tt(t,e);function t(r,a){var i;return i=e.call(this,r,a)||this,i.update=Qo(Hn(Qt(i),i.update),Ai),i}var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},n.update=function(a,i){var o=this.getChild("timeTooltip");if(o){var s=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();o.updateTime(a,i,s)}},t}(ut);OT.prototype.options_={children:[]};!la&&!os&&OT.prototype.options_.children.push("timeTooltip");ut.registerComponent("PlayProgressBar",OT);var kL=function(e){Tt(t,e);function t(r,a){var i;return i=e.call(this,r,a)||this,i.update=Qo(Hn(Qt(i),i.update),Ai),i}var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},n.update=function(a,i){var o=this,s=i*this.player_.duration();this.getChild("timeTooltip").updateTime(a,i,s,function(){o.el_.style.left=a.width*i+"px"})},t}(ut);kL.prototype.options_={children:["timeTooltip"]};ut.registerComponent("MouseTimeDisplay",kL);var Sh=5,Ak=12,MT=function(e){Tt(t,e);function t(r,a){var i;return i=e.call(this,r,a)||this,i.setEventHandlers_(),i}var n=t.prototype;return n.setEventHandlers_=function(){var a=this;this.update_=Hn(this,this.update),this.update=Qo(this.update_,Ai),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(i){return a.enableInterval_(i)},this.disableIntervalHandler_=function(i){return a.disableInterval_(i)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in vt&&"visibilityState"in vt&&this.on(vt,"visibilitychange",this.toggleVisibility_)},n.toggleVisibility_=function(a){vt.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(a)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())},n.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Ai))},n.disableInterval_=function(a){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&a&&a.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},n.update=function(a){var i=this;if(vt.visibilityState!=="hidden"){var o=e.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var s=i.player_.ended()?i.player_.duration():i.getCurrentTime_(),l=i.player_.liveTracker,u=i.player_.duration();l&&l.isLive()&&(u=i.player_.liveTracker.liveCurrentTime()),i.percent_!==o&&(i.el_.setAttribute("aria-valuenow",(o*100).toFixed(2)),i.percent_=o),(i.currentTime_!==s||i.duration_!==u)&&(i.el_.setAttribute("aria-valuetext",i.localize("progress bar timing: currentTime={1} duration={2}",[Ec(s,u),Ec(u,u)],"{1} of {2}")),i.currentTime_=s,i.duration_=u),i.bar&&i.bar.update(wc(i.el()),i.getProgress())}),o}},n.userSeek_=function(a){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(a)},n.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},n.getPercent=function(){var a=this.getCurrentTime_(),i,o=this.player_.liveTracker;return o&&o.isLive()?(i=(a-o.seekableStart())/o.liveWindow(),o.atLiveEdge()&&(i=1)):i=a/this.player_.duration(),i},n.handleMouseDown=function(a){Gf(a)&&(a.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,a))},n.handleMouseMove=function(a,i){if(i===void 0&&(i=!1),!!Gf(a)){!i&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);var o,s=this.calculateDistance(a),l=this.player_.liveTracker;if(!l||!l.isLive())o=s*this.player_.duration(),o===this.player_.duration()&&(o=o-.1);else{if(s>=.99){l.seekToLiveEdge();return}var u=l.seekableStart(),c=l.liveCurrentTime();if(o=u+s*l.liveWindow(),o>=c&&(o=c),o<=u&&(o=u+.1),o===1/0)return}this.userSeek_(o)}},n.enable=function(){e.prototype.enable.call(this);var a=this.getChild("mouseTimeDisplay");a&&a.show()},n.disable=function(){e.prototype.disable.call(this);var a=this.getChild("mouseTimeDisplay");a&&a.hide()},n.handleMouseUp=function(a){e.prototype.handleMouseUp.call(this,a),a&&a.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?qi(this.player_.play()):this.update_()},n.stepForward=function(){this.userSeek_(this.player_.currentTime()+Sh)},n.stepBack=function(){this.userSeek_(this.player_.currentTime()-Sh)},n.handleAction=function(a){this.player_.paused()?this.player_.play():this.player_.pause()},n.handleKeyDown=function(a){var i=this.player_.liveTracker;if(Jt.isEventKey(a,"Space")||Jt.isEventKey(a,"Enter"))a.preventDefault(),a.stopPropagation(),this.handleAction(a);else if(Jt.isEventKey(a,"Home"))a.preventDefault(),a.stopPropagation(),this.userSeek_(0);else if(Jt.isEventKey(a,"End"))a.preventDefault(),a.stopPropagation(),i&&i.isLive()?this.userSeek_(i.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(Jt(a))){a.preventDefault(),a.stopPropagation();var o=(Jt.codes[Jt(a)]-Jt.codes[0])*10/100;i&&i.isLive()?this.userSeek_(i.seekableStart()+i.liveWindow()*o):this.userSeek_(this.player_.duration()*o)}else Jt.isEventKey(a,"PgDn")?(a.preventDefault(),a.stopPropagation(),this.userSeek_(this.player_.currentTime()-Sh*Ak)):Jt.isEventKey(a,"PgUp")?(a.preventDefault(),a.stopPropagation(),this.userSeek_(this.player_.currentTime()+Sh*Ak)):e.prototype.handleKeyDown.call(this,a)},n.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in vt&&"visibilityState"in vt&&this.off(vt,"visibilitychange",this.toggleVisibility_),e.prototype.dispose.call(this)},t}(PT);MT.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};!la&&!os&&MT.prototype.options_.children.splice(1,0,"mouseTimeDisplay");ut.registerComponent("SeekBar",MT);var AL=function(e){Tt(t,e);function t(r,a){var i;return i=e.call(this,r,a)||this,i.handleMouseMove=Qo(Hn(Qt(i),i.handleMouseMove),Ai),i.throttledHandleMouseSeek=Qo(Hn(Qt(i),i.handleMouseSeek),Ai),i.handleMouseUpHandler_=function(o){return i.handleMouseUp(o)},i.handleMouseDownHandler_=function(o){return i.handleMouseDown(o)},i.enable(),i}var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},n.handleMouseMove=function(a){var i=this.getChild("seekBar");if(i){var o=i.getChild("playProgressBar"),s=i.getChild("mouseTimeDisplay");if(!(!o&&!s)){var l=i.el(),u=qf(l),c=Cg(l,a).x;c=Ig(c,0,1),s&&s.update(u,c),o&&o.update(u,i.getProgress())}}},n.handleMouseSeek=function(a){var i=this.getChild("seekBar");i&&i.handleMouseMove(a)},n.enabled=function(){return this.enabled_},n.disable=function(){if(this.children().forEach(function(i){return i.disable&&i.disable()}),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var a=this.getChild("seekBar");this.player_.scrubbing(!1),a.videoWasPlaying&&qi(this.player_.play())}},n.enable=function(){this.children().forEach(function(a){return a.enable&&a.enable()}),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},n.removeListenersAddedOnMousedownAndTouchstart=function(){var a=this.el_.ownerDocument;this.off(a,"mousemove",this.throttledHandleMouseSeek),this.off(a,"touchmove",this.throttledHandleMouseSeek),this.off(a,"mouseup",this.handleMouseUpHandler_),this.off(a,"touchend",this.handleMouseUpHandler_)},n.handleMouseDown=function(a){var i=this.el_.ownerDocument,o=this.getChild("seekBar");o&&o.handleMouseDown(a),this.on(i,"mousemove",this.throttledHandleMouseSeek),this.on(i,"touchmove",this.throttledHandleMouseSeek),this.on(i,"mouseup",this.handleMouseUpHandler_),this.on(i,"touchend",this.handleMouseUpHandler_)},n.handleMouseUp=function(a){var i=this.getChild("seekBar");i&&i.handleMouseUp(a),this.removeListenersAddedOnMousedownAndTouchstart()},t}(ut);AL.prototype.options_={children:["seekBar"]};ut.registerComponent("ProgressControl",AL);var DL=function(e){Tt(t,e);function t(r,a){var i;return i=e.call(this,r,a)||this,i.on(r,["enterpictureinpicture","leavepictureinpicture"],function(o){return i.handlePictureInPictureChange(o)}),i.on(r,["disablepictureinpicturechanged","loadedmetadata"],function(o){return i.handlePictureInPictureEnabledChange(o)}),i.on(r,["loadedmetadata","audioonlymodechange","audiopostermodechange"],function(){var o=r.currentType().substring(0,5)==="audio";o||r.audioPosterMode()||r.audioOnlyMode()?(r.isInPictureInPicture()&&r.exitPictureInPicture(),i.hide()):i.show()}),i.disable(),i}var n=t.prototype;return n.buildCSSClass=function(){return"vjs-picture-in-picture-control "+e.prototype.buildCSSClass.call(this)},n.handlePictureInPictureEnabledChange=function(){vt.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1?this.enable():this.disable()},n.handlePictureInPictureChange=function(a){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},n.handleClick=function(a){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},t}(Ti);DL.prototype.controlText_="Picture-in-Picture";ut.registerComponent("PictureInPictureToggle",DL);var IL=function(e){Tt(t,e);function t(r,a){var i;return i=e.call(this,r,a)||this,i.on(r,"fullscreenchange",function(o){return i.handleFullscreenChange(o)}),vt[r.fsApi_.fullscreenEnabled]===!1&&i.disable(),i}var n=t.prototype;return n.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},n.handleFullscreenChange=function(a){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},n.handleClick=function(a){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(Ti);IL.prototype.controlText_="Fullscreen";ut.registerComponent("FullscreenToggle",IL);var S_e=function(t,n){n.tech_&&!n.tech_.featuresVolumeControl&&t.addClass("vjs-hidden"),t.on(n,"loadstart",function(){n.tech_.featuresVolumeControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})},C_e=function(e){Tt(t,e);function t(){return e.apply(this,arguments)||this}var n=t.prototype;return n.createEl=function(){var a=e.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return a.appendChild(e.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),a},t}(ut);ut.registerComponent("VolumeLevel",C_e);var E_e=function(e){Tt(t,e);function t(r,a){var i;return i=e.call(this,r,a)||this,i.update=Qo(Hn(Qt(i),i.update),Ai),i}var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},n.update=function(a,i,o,s){if(!o){var l=wc(this.el_),u=wc(this.player_.el()),c=a.width*i;if(!u||!l)return;var d=a.left-u.left+c,p=a.width-c+(u.right-a.right),h=l.width/2;dl.width&&(h=l.width),this.el_.style.right="-"+h+"px"}this.write(s+"%")},n.write=function(a){Ql(this.el_,a)},n.updateVolume=function(a,i,o,s,l){var u=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){u.update(a,i,o,s.toFixed(0)),l&&l()})},t}(ut);ut.registerComponent("VolumeLevelTooltip",E_e);var PL=function(e){Tt(t,e);function t(r,a){var i;return i=e.call(this,r,a)||this,i.update=Qo(Hn(Qt(i),i.update),Ai),i}var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},n.update=function(a,i,o){var s=this,l=100*i;this.getChild("volumeLevelTooltip").updateVolume(a,i,o,l,function(){o?s.el_.style.bottom=a.height*i+"px":s.el_.style.left=a.width*i+"px"})},t}(ut);PL.prototype.options_={children:["volumeLevelTooltip"]};ut.registerComponent("MouseVolumeLevelDisplay",PL);var Pg=function(e){Tt(t,e);function t(r,a){var i;return i=e.call(this,r,a)||this,i.on("slideractive",function(o){return i.updateLastVolume_(o)}),i.on(r,"volumechange",function(o){return i.updateARIAAttributes(o)}),r.ready(function(){return i.updateARIAAttributes()}),i}var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},n.handleMouseDown=function(a){Gf(a)&&e.prototype.handleMouseDown.call(this,a)},n.handleMouseMove=function(a){var i=this.getChild("mouseVolumeLevelDisplay");if(i){var o=this.el(),s=wc(o),l=this.vertical(),u=Cg(o,a);u=l?u.y:u.x,u=Ig(u,0,1),i.update(s,u,l)}Gf(a)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(a)))},n.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},n.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},n.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},n.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},n.updateARIAAttributes=function(a){var i=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",i),this.el_.setAttribute("aria-valuetext",i+"%")},n.volumeAsPercentage_=function(){return Math.round(this.player_.volume()*100)},n.updateLastVolume_=function(){var a=this,i=this.player_.volume();this.one("sliderinactive",function(){a.player_.volume()===0&&a.player_.lastVolume_(i)})},t}(PT);Pg.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!la&&!os&&Pg.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");Pg.prototype.playerEvent="volumechange";ut.registerComponent("VolumeBar",Pg);var OL=function(e){Tt(t,e);function t(r,a){var i;return a===void 0&&(a={}),a.vertical=a.vertical||!1,(typeof a.volumeBar>"u"||Wf(a.volumeBar))&&(a.volumeBar=a.volumeBar||{},a.volumeBar.vertical=a.vertical),i=e.call(this,r,a)||this,S_e(Qt(i),r),i.throttledHandleMouseMove=Qo(Hn(Qt(i),i.handleMouseMove),Ai),i.handleMouseUpHandler_=function(o){return i.handleMouseUp(o)},i.on("mousedown",function(o){return i.handleMouseDown(o)}),i.on("touchstart",function(o){return i.handleMouseDown(o)}),i.on("mousemove",function(o){return i.handleMouseMove(o)}),i.on(i.volumeBar,["focus","slideractive"],function(){i.volumeBar.addClass("vjs-slider-active"),i.addClass("vjs-slider-active"),i.trigger("slideractive")}),i.on(i.volumeBar,["blur","sliderinactive"],function(){i.volumeBar.removeClass("vjs-slider-active"),i.removeClass("vjs-slider-active"),i.trigger("sliderinactive")}),i}var n=t.prototype;return n.createEl=function(){var a="vjs-volume-horizontal";return this.options_.vertical&&(a="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+a})},n.handleMouseDown=function(a){var i=this.el_.ownerDocument;this.on(i,"mousemove",this.throttledHandleMouseMove),this.on(i,"touchmove",this.throttledHandleMouseMove),this.on(i,"mouseup",this.handleMouseUpHandler_),this.on(i,"touchend",this.handleMouseUpHandler_)},n.handleMouseUp=function(a){var i=this.el_.ownerDocument;this.off(i,"mousemove",this.throttledHandleMouseMove),this.off(i,"touchmove",this.throttledHandleMouseMove),this.off(i,"mouseup",this.handleMouseUpHandler_),this.off(i,"touchend",this.handleMouseUpHandler_)},n.handleMouseMove=function(a){this.volumeBar.handleMouseMove(a)},t}(ut);OL.prototype.options_={children:["volumeBar"]};ut.registerComponent("VolumeControl",OL);var x_e=function(t,n){n.tech_&&!n.tech_.featuresMuteControl&&t.addClass("vjs-hidden"),t.on(n,"loadstart",function(){n.tech_.featuresMuteControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})},ML=function(e){Tt(t,e);function t(r,a){var i;return i=e.call(this,r,a)||this,x_e(Qt(i),r),i.on(r,["loadstart","volumechange"],function(o){return i.update(o)}),i}var n=t.prototype;return n.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},n.handleClick=function(a){var i=this.player_.volume(),o=this.player_.lastVolume_();if(i===0){var s=o<.1?.1:o;this.player_.volume(s),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},n.update=function(a){this.updateIcon_(),this.updateControlText_()},n.updateIcon_=function(){var a=this.player_.volume(),i=3;la&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),a===0||this.player_.muted()?i=0:a<.33?i=1:a<.67&&(i=2);for(var o=0;o<4;o++)Ip(this.el_,"vjs-vol-"+o);Vo(this.el_,"vjs-vol-"+i)},n.updateControlText_=function(){var a=this.player_.muted()||this.player_.volume()===0,i=a?"Unmute":"Mute";this.controlText()!==i&&this.controlText(i)},t}(Ti);ML.prototype.controlText_="Mute";ut.registerComponent("MuteToggle",ML);var RL=function(e){Tt(t,e);function t(r,a){var i;return a===void 0&&(a={}),typeof a.inline<"u"?a.inline=a.inline:a.inline=!0,(typeof a.volumeControl>"u"||Wf(a.volumeControl))&&(a.volumeControl=a.volumeControl||{},a.volumeControl.vertical=!a.inline),i=e.call(this,r,a)||this,i.handleKeyPressHandler_=function(o){return i.handleKeyPress(o)},i.on(r,["loadstart"],function(o){return i.volumePanelState_(o)}),i.on(i.muteToggle,"keyup",function(o){return i.handleKeyPress(o)}),i.on(i.volumeControl,"keyup",function(o){return i.handleVolumeControlKeyUp(o)}),i.on("keydown",function(o){return i.handleKeyPress(o)}),i.on("mouseover",function(o){return i.handleMouseOver(o)}),i.on("mouseout",function(o){return i.handleMouseOut(o)}),i.on(i.volumeControl,["slideractive"],i.sliderActive_),i.on(i.volumeControl,["sliderinactive"],i.sliderInactive_),i}var n=t.prototype;return n.sliderActive_=function(){this.addClass("vjs-slider-active")},n.sliderInactive_=function(){this.removeClass("vjs-slider-active")},n.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},n.createEl=function(){var a="vjs-volume-panel-horizontal";return this.options_.inline||(a="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+a})},n.dispose=function(){this.handleMouseOut(),e.prototype.dispose.call(this)},n.handleVolumeControlKeyUp=function(a){Jt.isEventKey(a,"Esc")&&this.muteToggle.focus()},n.handleMouseOver=function(a){this.addClass("vjs-hover"),Ha(vt,"keyup",this.handleKeyPressHandler_)},n.handleMouseOut=function(a){this.removeClass("vjs-hover"),Hr(vt,"keyup",this.handleKeyPressHandler_)},n.handleKeyPress=function(a){Jt.isEventKey(a,"Esc")&&this.handleMouseOut()},t}(ut);RL.prototype.options_={children:["muteToggle","volumeControl"]};ut.registerComponent("VolumePanel",RL);var LL=function(e){Tt(t,e);function t(r,a){var i;return i=e.call(this,r,a)||this,a&&(i.menuButton_=a.menuButton),i.focusedChild_=-1,i.on("keydown",function(o){return i.handleKeyDown(o)}),i.boundHandleBlur_=function(o){return i.handleBlur(o)},i.boundHandleTapClick_=function(o){return i.handleTapClick(o)},i}var n=t.prototype;return n.addEventListenerForItem=function(a){a instanceof ut&&(this.on(a,"blur",this.boundHandleBlur_),this.on(a,["tap","click"],this.boundHandleTapClick_))},n.removeEventListenerForItem=function(a){a instanceof ut&&(this.off(a,"blur",this.boundHandleBlur_),this.off(a,["tap","click"],this.boundHandleTapClick_))},n.removeChild=function(a){typeof a=="string"&&(a=this.getChild(a)),this.removeEventListenerForItem(a),e.prototype.removeChild.call(this,a)},n.addItem=function(a){var i=this.addChild(a);i&&this.addEventListenerForItem(i)},n.createEl=function(){var a=this.options_.contentElType||"ul";this.contentEl_=gn(a,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),Ha(i,"click",function(o){o.preventDefault(),o.stopImmediatePropagation()}),i},n.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,e.prototype.dispose.call(this)},n.handleBlur=function(a){var i=a.relatedTarget||vt.activeElement;if(!this.children().some(function(s){return s.el()===i})){var o=this.menuButton_;o&&o.buttonPressed_&&i!==o.el().firstChild&&o.unpressButton()}},n.handleTapClick=function(a){if(this.menuButton_){this.menuButton_.unpressButton();var i=this.children();if(!Array.isArray(i))return;var o=i.filter(function(s){return s.el()===a.target})[0];if(!o)return;o.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}},n.handleKeyDown=function(a){Jt.isEventKey(a,"Left")||Jt.isEventKey(a,"Down")?(a.preventDefault(),a.stopPropagation(),this.stepForward()):(Jt.isEventKey(a,"Right")||Jt.isEventKey(a,"Up"))&&(a.preventDefault(),a.stopPropagation(),this.stepBack())},n.stepForward=function(){var a=0;this.focusedChild_!==void 0&&(a=this.focusedChild_+1),this.focus(a)},n.stepBack=function(){var a=0;this.focusedChild_!==void 0&&(a=this.focusedChild_-1),this.focus(a)},n.focus=function(a){a===void 0&&(a=0);var i=this.children().slice(),o=i.length&&i[0].hasClass("vjs-menu-title");o&&i.shift(),i.length>0&&(a<0?a=0:a>=i.length&&(a=i.length-1),this.focusedChild_=a,i[a].el_.focus())},t}(ut);ut.registerComponent("Menu",LL);var RT=function(e){Tt(t,e);function t(r,a){var i;a===void 0&&(a={}),i=e.call(this,r,a)||this,i.menuButton_=new Ti(r,a),i.menuButton_.controlText(i.controlText_),i.menuButton_.el_.setAttribute("aria-haspopup","true");var o=Ti.prototype.buildCSSClass();i.menuButton_.el_.className=i.buildCSSClass()+" "+o,i.menuButton_.removeClass("vjs-control"),i.addChild(i.menuButton_),i.update(),i.enabled_=!0;var s=function(u){return i.handleClick(u)};return i.handleMenuKeyUp_=function(l){return i.handleMenuKeyUp(l)},i.on(i.menuButton_,"tap",s),i.on(i.menuButton_,"click",s),i.on(i.menuButton_,"keydown",function(l){return i.handleKeyDown(l)}),i.on(i.menuButton_,"mouseenter",function(){i.addClass("vjs-hover"),i.menu.show(),Ha(vt,"keyup",i.handleMenuKeyUp_)}),i.on("mouseleave",function(l){return i.handleMouseLeave(l)}),i.on("keydown",function(l){return i.handleSubmenuKeyDown(l)}),i}var n=t.prototype;return n.update=function(){var a=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=a,this.addChild(a),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))},n.createMenu=function(){var a=new LL(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var i=gn("li",{className:"vjs-menu-title",textContent:Zn(this.options_.title),tabIndex:-1}),o=new ut(this.player_,{el:i});a.addItem(o)}if(this.items=this.createItems(),this.items)for(var s=0;s-1&&u.mode==="showing"){o=!1;break}}o!==this.isSelected_&&this.selected(o)},n.handleSelectedLanguageChange=function(a){for(var i=this.player().textTracks(),o=!0,s=0,l=i.length;s-1&&u.mode==="showing"){o=!1;break}}o&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(Mp);ut.registerComponent("OffTextTrackMenuItem",NL);var Jc=function(e){Tt(t,e);function t(r,a){return a===void 0&&(a={}),a.tracks=r.textTracks(),e.call(this,r,a)||this}var n=t.prototype;return n.createItems=function(a,i){a===void 0&&(a=[]),i===void 0&&(i=Mp);var o;this.label_&&(o=this.label_+" off"),a.push(new NL(this.player_,{kinds:this.kinds_,kind:this.kind_,label:o})),this.hideThreshold_+=1;var s=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var l=0;l-1){var c=new i(this.player_,{track:u,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});c.addClass("vjs-"+u.kind+"-menu-item"),a.push(c)}}return a},t}(LT);ut.registerComponent("TextTrackButton",Jc);var FL=function(e){Tt(t,e);function t(r,a){var i,o=a.track,s=a.cue,l=r.currentTime();return a.selectable=!0,a.multiSelectable=!1,a.label=s.text,a.selected=s.startTime<=l&&l=0;i--){var o=a[i];if(o.kind===this.kind_)return o}},n.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(Zn(this.kind_))},n.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},n.createItems=function(){var a=[];if(!this.track_)return a;var i=this.track_.cues;if(!i)return a;for(var o=0,s=i.length;o-1&&(i.label_="captions"),i.menuButton_.controlText(Zn(i.label_)),i}var n=t.prototype;return n.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(){var a=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(a.push(new BT(this.player_,{kind:this.label_})),this.hideThreshold_+=1),a=e.prototype.createItems.call(this,a,$L),a},t}(Jc);UT.prototype.kinds_=["captions","subtitles"];UT.prototype.controlText_="Subtitles";ut.registerComponent("SubsCapsButton",UT);var BL=function(e){Tt(t,e);function t(r,a){var i,o=a.track,s=r.audioTracks();a.label=o.label||o.language||"Unknown",a.selected=o.enabled,i=e.call(this,r,a)||this,i.track=o,i.addClass("vjs-"+o.kind+"-menu-item");var l=function(){for(var c=arguments.length,d=new Array(c),p=0;p=0;o--)i.push(new HT(this.player(),{rate:a[o]+"x"}));return i},n.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},n.handleClick=function(a){var i=this.player().playbackRate(),o=this.playbackRates(),s=o.indexOf(i),l=(s+1)%o.length;this.player().playbackRate(o[l])},n.handlePlaybackRateschange=function(a){this.update()},n.playbackRates=function(){var a=this.player();return a.playbackRates&&a.playbackRates()||[]},n.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},n.updateVisibility=function(a){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},n.updateLabel=function(a){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},t}(RT);UL.prototype.controlText_="Playback Rate";ut.registerComponent("PlaybackRateMenuButton",UL);var HL=function(e){Tt(t,e);function t(){return e.apply(this,arguments)||this}var n=t.prototype;return n.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},n.createEl=function(a,i,o){return a===void 0&&(a="div"),i===void 0&&(i={}),o===void 0&&(o={}),i.className||(i.className=this.buildCSSClass()),e.prototype.createEl.call(this,a,i,o)},t}(ut);ut.registerComponent("Spacer",HL);var A_e=function(e){Tt(t,e);function t(){return e.apply(this,arguments)||this}var n=t.prototype;return n.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:" "})},t}(HL);ut.registerComponent("CustomControlSpacer",A_e);var ev=function(e){Tt(t,e);function t(){return e.apply(this,arguments)||this}var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(ut);ev.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]};"exitPictureInPicture"in vt&&ev.prototype.options_.children.splice(ev.prototype.options_.children.length-1,0,"pictureInPictureToggle");ut.registerComponent("ControlBar",ev);var zL=function(e){Tt(t,e);function t(r,a){var i;return i=e.call(this,r,a)||this,i.on(r,"error",function(o){return i.open(o)}),i}var n=t.prototype;return n.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},n.content=function(){var a=this.player().error();return a?this.localize(a.message):""},t}(Yc);zL.prototype.options_=oi({},Yc.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});ut.registerComponent("ErrorDisplay",zL);var J0="vjs-text-track-settings",Dk=["#000","Black"],Ik=["#00F","Blue"],Pk=["#0FF","Cyan"],Ok=["#0F0","Green"],Mk=["#F0F","Magenta"],Rk=["#F00","Red"],Lk=["#FFF","White"],Nk=["#FF0","Yellow"],Z0=["1","Opaque"],ey=["0.5","Semi-Transparent"],Fk=["0","Transparent"],pl={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Dk,Lk,Rk,Ok,Ik,Nk,Mk,Pk]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[Z0,ey,Fk]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Lk,Dk,Rk,Ok,Ik,Nk,Mk,Pk]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(t){return t==="1.00"?null:Number(t)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[Z0,ey]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[Fk,ey,Z0]}};pl.windowColor.options=pl.backgroundColor.options;function jL(e,t){if(t&&(e=t(e)),e&&e!=="none")return e}function D_e(e,t){var n=e.options[e.options.selectedIndex].value;return jL(n,t)}function I_e(e,t,n){if(t){for(var r=0;r',this.localize(l.label),""+o+">",'").join("")},n.createElFgColor_=function(){var a="captions-text-legend-"+this.id_;return['"].join("")},n.createElBgColor_=function(){var a="captions-background-"+this.id_;return['"].join("")},n.createElWinColor_=function(){var a="captions-window-"+this.id_;return['"].join("")},n.createElColors_=function(){return gn("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},n.createElFont_=function(){return gn("div",{className:"vjs-track-settings-font",innerHTML:['",'",'"].join("")})},n.createElControls_=function(){var a=this.localize("restore all settings to the default values");return gn("div",{className:"vjs-track-settings-controls",innerHTML:['",'"].join("")})},n.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},n.label=function(){return this.localize("Caption Settings Dialog")},n.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},n.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},n.getValues=function(){var a=this;return bbe(pl,function(i,o,s){var l=D_e(a.$(o.selector),o.parser);return l!==void 0&&(i[s]=l),i},{})},n.setValues=function(a){var i=this;ju(pl,function(o,s){I_e(i.$(o.selector),a[s],o.parser)})},n.setDefaults=function(){var a=this;ju(pl,function(i){var o=i.hasOwnProperty("default")?i.default:0;a.$(i.selector).selectedIndex=o})},n.restoreSettings=function(){var a;try{a=JSON.parse(Te.localStorage.getItem(J0))}catch(i){on.warn(i)}a&&this.setValues(a)},n.saveSettings=function(){if(this.options_.persistTextTrackSettings){var a=this.getValues();try{Object.keys(a).length?Te.localStorage.setItem(J0,JSON.stringify(a)):Te.localStorage.removeItem(J0)}catch(i){on.warn(i)}}},n.updateDisplay=function(){var a=this.player_.getChild("textTrackDisplay");a&&a.updateDisplay()},n.conditionalBlur_=function(){this.previouslyActiveEl_=null;var a=this.player_.controlBar,i=a&&a.subsCapsButton,o=a&&a.captionsButton;i?i.focus():o&&o.focus()},t}(Yc);ut.registerComponent("TextTrackSettings",P_e);var O_e=function(e){Tt(t,e);function t(r,a){var i,o=a.ResizeObserver||Te.ResizeObserver;a.ResizeObserver===null&&(o=!1);var s=Un({createEl:!o,reportTouchActivity:!1},a);return i=e.call(this,r,s)||this,i.ResizeObserver=a.ResizeObserver||Te.ResizeObserver,i.loadListener_=null,i.resizeObserver_=null,i.debouncedHandler_=Ibe(function(){i.resizeHandler()},100,!1,Qt(i)),o?(i.resizeObserver_=new i.ResizeObserver(i.debouncedHandler_),i.resizeObserver_.observe(r.el())):(i.loadListener_=function(){if(!(!i.el_||!i.el_.contentWindow)){var l=i.debouncedHandler_,u=i.unloadListener_=function(){Hr(this,"resize",l),Hr(this,"unload",u),u=null};Ha(i.el_.contentWindow,"unload",u),Ha(i.el_.contentWindow,"resize",l)}},i.one("load",i.loadListener_)),i}var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})},n.resizeHandler=function(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")},n.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,e.prototype.dispose.call(this)},t}(ut);ut.registerComponent("ResizeManager",O_e);var M_e={trackingThreshold:20,liveTolerance:15},R_e=function(e){Tt(t,e);function t(r,a){var i,o=Un(M_e,a,{createEl:!1});return i=e.call(this,r,o)||this,i.handleVisibilityChange_=function(s){return i.handleVisibilityChange(s)},i.trackLiveHandler_=function(){return i.trackLive_()},i.handlePlay_=function(s){return i.handlePlay(s)},i.handleFirstTimeupdate_=function(s){return i.handleFirstTimeupdate(s)},i.handleSeeked_=function(s){return i.handleSeeked(s)},i.seekToLiveEdge_=function(s){return i.seekToLiveEdge(s)},i.reset_(),i.on(i.player_,"durationchange",function(s){return i.handleDurationchange(s)}),i.on(i.player_,"canplay",function(){return i.toggleTracking()}),Dp&&"hidden"in vt&&"visibilityState"in vt&&i.on(vt,"visibilitychange",i.handleVisibilityChange_),i}var n=t.prototype;return n.handleVisibilityChange=function(){this.player_.duration()===1/0&&(vt.hidden?this.stopTracking():this.startTracking())},n.trackLive_=function(){var a=this.player_.seekable();if(!(!a||!a.length)){var i=Number(Te.performance.now().toFixed(4)),o=this.lastTime_===-1?0:(i-this.lastTime_)/1e3;this.lastTime_=i,this.pastSeekEnd_=this.pastSeekEnd()+o;var s=this.liveCurrentTime(),l=this.player_.currentTime(),u=this.player_.paused()||this.seekedBehindLive_||Math.abs(s-l)>this.options_.liveTolerance;(!this.timeupdateSeen_||s===1/0)&&(u=!1),u!==this.behindLiveEdge_&&(this.behindLiveEdge_=u,this.trigger("liveedgechange"))}},n.handleDurationchange=function(){this.toggleTracking()},n.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},n.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Ai),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))},n.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},n.handleSeeked=function(){var a=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&a>2,this.nextSeekedFromUser_=!1,this.trackLive_()},n.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},n.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},n.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},n.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},n.seekableEnd=function(){for(var a=this.player_.seekable(),i=[],o=a?a.length:0;o--;)i.push(a.end(o));return i.length?i.sort()[i.length-1]:1/0},n.seekableStart=function(){for(var a=this.player_.seekable(),i=[],o=a?a.length:0;o--;)i.push(a.start(o));return i.length?i.sort()[0]:0},n.liveWindow=function(){var a=this.liveCurrentTime();return a===1/0?0:a-this.seekableStart()},n.isLive=function(){return this.isTracking()},n.atLiveEdge=function(){return!this.behindLiveEdge()},n.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},n.pastSeekEnd=function(){var a=this.seekableEnd();return this.lastSeekEnd_!==-1&&a!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=a,this.pastSeekEnd_},n.behindLiveEdge=function(){return this.behindLiveEdge_},n.isTracking=function(){return typeof this.trackingInterval_=="number"},n.seekToLiveEdge=function(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},n.dispose=function(){this.off(vt,"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),e.prototype.dispose.call(this)},t}(ut);ut.registerComponent("LiveTracker",R_e);var a_=function(t){var n=t.el();if(n.hasAttribute("src"))return t.triggerSourceset(n.src),!0;var r=t.$$("source"),a=[],i="";if(!r.length)return!1;for(var o=0;o=2&&l.push("loadeddata"),a.readyState>=3&&l.push("canplay"),a.readyState>=4&&l.push("canplaythrough"),this.ready(function(){l.forEach(function(u){this.trigger(u)},this)})}},n.setScrubbing=function(a){this.isScrubbing_=a},n.scrubbing=function(){return this.isScrubbing_},n.setCurrentTime=function(a){try{this.isScrubbing_&&this.el_.fastSeek&&wg?this.el_.fastSeek(a):this.el_.currentTime=a}catch(i){on(i,"Video is not ready. (Video.js)")}},n.duration=function(){var a=this;if(this.el_.duration===1/0&&os&&ss&&this.el_.currentTime===0){var i=function o(){a.el_.currentTime>0&&(a.el_.duration===1/0&&a.trigger("durationchange"),a.off("timeupdate",o))};return this.on("timeupdate",i),NaN}return this.el_.duration||NaN},n.width=function(){return this.el_.offsetWidth},n.height=function(){return this.el_.offsetHeight},n.proxyWebkitFullscreen_=function(){var a=this;if("webkitDisplayingFullscreen"in this.el_){var i=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},o=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",i),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",o),this.on("dispose",function(){a.off("webkitbeginfullscreen",o),a.off("webkitendfullscreen",i)})}},n.supportsFullScreen=function(){if(typeof this.el_.webkitEnterFullScreen=="function"){var a=Te.navigator&&Te.navigator.userAgent||"";if(/Android/.test(a)||!/Chrome|Mac OS X 10.5/.test(a))return!0}return!1},n.enterFullScreen=function(){var a=this.el_;if(a.paused&&a.networkState<=a.HAVE_METADATA)qi(this.el_.play()),this.setTimeout(function(){a.pause();try{a.webkitEnterFullScreen()}catch(i){this.trigger("fullscreenerror",i)}},0);else try{a.webkitEnterFullScreen()}catch(i){this.trigger("fullscreenerror",i)}},n.exitFullScreen=function(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()},n.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},n.requestVideoFrameCallback=function(a){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(a):e.prototype.requestVideoFrameCallback.call(this,a)},n.cancelVideoFrameCallback=function(a){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(a):e.prototype.cancelVideoFrameCallback.call(this,a)},n.src=function(a){if(a===void 0)return this.el_.src;this.setSrc(a)},n.reset=function(){t.resetMediaElement(this.el_)},n.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},n.setControls=function(a){this.el_.controls=!!a},n.addTextTrack=function(a,i,o){return this.featuresNativeTextTracks?this.el_.addTextTrack(a,i,o):e.prototype.addTextTrack.call(this,a,i,o)},n.createRemoteTextTrack=function(a){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,a);var i=vt.createElement("track");return a.kind&&(i.kind=a.kind),a.label&&(i.label=a.label),(a.language||a.srclang)&&(i.srclang=a.language||a.srclang),a.default&&(i.default=a.default),a.id&&(i.id=a.id),a.src&&(i.src=a.src),i},n.addRemoteTextTrack=function(a,i){var o=e.prototype.addRemoteTextTrack.call(this,a,i);return this.featuresNativeTextTracks&&this.el().appendChild(o),o},n.removeRemoteTextTrack=function(a){if(e.prototype.removeRemoteTextTrack.call(this,a),this.featuresNativeTextTracks)for(var i=this.$$("track"),o=i.length;o--;)(a===i[o]||a===i[o].track)&&this.el().removeChild(i[o])},n.getVideoPlaybackQuality=function(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();var a={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(a.droppedVideoFrames=this.el().webkitDroppedFrameCount,a.totalVideoFrames=this.el().webkitDecodedFrameCount),Te.performance&&typeof Te.performance.now=="function"?a.creationTime=Te.performance.now():Te.performance&&Te.performance.timing&&typeof Te.performance.timing.navigationStart=="number"&&(a.creationTime=Te.Date.now()-Te.performance.timing.navigationStart),a},t}(Rn);zT(At,"TEST_VID",function(){if(Kc()){var e=vt.createElement("video"),t=vt.createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e}});At.isSupported=function(){try{At.TEST_VID.volume=.5}catch{return!1}return!!(At.TEST_VID&&At.TEST_VID.canPlayType)};At.canPlayType=function(e){return At.TEST_VID.canPlayType(e)};At.canPlaySource=function(e,t){return At.canPlayType(e.type)};At.canControlVolume=function(){try{var e=At.TEST_VID.volume;At.TEST_VID.volume=e/2+.1;var t=e!==At.TEST_VID.volume;return t&&la?(Te.setTimeout(function(){At&&At.prototype&&(At.prototype.featuresVolumeControl=e!==At.TEST_VID.volume)}),!1):t}catch{return!1}};At.canMuteVolume=function(){try{var e=At.TEST_VID.muted;return At.TEST_VID.muted=!e,At.TEST_VID.muted?Tc(At.TEST_VID,"muted","muted"):Sg(At.TEST_VID,"muted","muted"),e!==At.TEST_VID.muted}catch{return!1}};At.canControlPlaybackRate=function(){if(os&&ss&&qR<58)return!1;try{var e=At.TEST_VID.playbackRate;return At.TEST_VID.playbackRate=e/2+.1,e!==At.TEST_VID.playbackRate}catch{return!1}};At.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(vt.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(vt.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(vt.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(vt.createElement("audio"),"innerHTML",{get:e,set:e})}catch{return!1}return!0};At.supportsNativeTextTracks=function(){return wg||la&&ss};At.supportsNativeVideoTracks=function(){return!!(At.TEST_VID&&At.TEST_VID.videoTracks)};At.supportsNativeAudioTracks=function(){return!!(At.TEST_VID&&At.TEST_VID.audioTracks)};At.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"];[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function(e){var t=e[0],n=e[1];zT(At.prototype,t,function(){return At[n]()},!0)});At.prototype.featuresVolumeControl=At.canControlVolume();At.prototype.movingMediaElementInDOM=!la;At.prototype.featuresFullscreenResize=!0;At.prototype.featuresProgressEvents=!0;At.prototype.featuresTimeupdateEvents=!0;At.prototype.featuresVideoFrameCallback=!!(At.TEST_VID&&At.TEST_VID.requestVideoFrameCallback);var tv;At.patchCanPlayType=function(){mT>=4&&!KR&&!ss&&(tv=At.TEST_VID&&At.TEST_VID.constructor.prototype.canPlayType,At.TEST_VID.constructor.prototype.canPlayType=function(e){var t=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;return e&&t.test(e)?"maybe":tv.call(this,e)})};At.unpatchCanPlayType=function(){var e=At.TEST_VID.constructor.prototype.canPlayType;return tv&&(At.TEST_VID.constructor.prototype.canPlayType=tv),e};At.patchCanPlayType();At.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),typeof e.load=="function"&&function(){try{e.load()}catch{}}()}};At.resetMediaElement=function(e){if(e){for(var t=e.querySelectorAll("source"),n=t.length;n--;)e.removeChild(t[n]);e.removeAttribute("src"),typeof e.load=="function"&&function(){try{e.load()}catch{}}()}};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){At.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){At.prototype["set"+Zn(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(e){At.prototype[e]=function(){return this.el_[e]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(e){At.prototype["set"+Zn(e)]=function(t){this.el_[e]=t}});["pause","load","play"].forEach(function(e){At.prototype[e]=function(){return this.el_[e]()}});Rn.withSourceHandlers(At);At.nativeSourceHandler={};At.nativeSourceHandler.canPlayType=function(e){try{return At.TEST_VID.canPlayType(e)}catch{return""}};At.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return At.nativeSourceHandler.canPlayType(e.type);if(e.src){var n=ET(e.src);return At.nativeSourceHandler.canPlayType("video/"+n)}return""};At.nativeSourceHandler.handleSource=function(e,t,n){t.setSrc(e.src)};At.nativeSourceHandler.dispose=function(){};At.registerSourceHandler(At.nativeSourceHandler);Rn.registerTech("Html5",At);var KL=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],ty={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},i_=["tiny","xsmall","small","medium","large","xlarge","huge"],am={};i_.forEach(function(e){var t=e.charAt(0)==="x"?"x-"+e.substring(1):e;am[e]="vjs-layout-"+t});var V_e={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},or=function(e){Tt(t,e);function t(r,a,i){var o;if(r.id=r.id||a.id||"vjs_video_"+ls(),a=Yn(t.getTagSettings(r),a),a.initChildren=!1,a.createEl=!1,a.evented=!1,a.reportTouchActivity=!1,!a.language)if(typeof r.closest=="function"){var s=r.closest("[lang]");s&&s.getAttribute&&(a.language=s.getAttribute("lang"))}else for(var l=r;l&&l.nodeType===1;){if(Ao(l).hasOwnProperty("lang")){a.language=l.getAttribute("lang");break}l=l.parentNode}if(o=e.call(this,null,a,i)||this,o.boundDocumentFullscreenChange_=function(p){return o.documentFullscreenChange_(p)},o.boundFullWindowOnEscKey_=function(p){return o.fullWindowOnEscKey(p)},o.boundUpdateStyleEl_=function(p){return o.updateStyleEl_(p)},o.boundApplyInitTime_=function(p){return o.applyInitTime_(p)},o.boundUpdateCurrentBreakpoint_=function(p){return o.updateCurrentBreakpoint_(p)},o.boundHandleTechClick_=function(p){return o.handleTechClick_(p)},o.boundHandleTechDoubleClick_=function(p){return o.handleTechDoubleClick_(p)},o.boundHandleTechTouchStart_=function(p){return o.handleTechTouchStart_(p)},o.boundHandleTechTouchMove_=function(p){return o.handleTechTouchMove_(p)},o.boundHandleTechTouchEnd_=function(p){return o.handleTechTouchEnd_(p)},o.boundHandleTechTap_=function(p){return o.handleTechTap_(p)},o.isFullscreen_=!1,o.log=HR(o.id_),o.fsApi_=Xm,o.isPosterFromTech_=!1,o.queuedCallbacks_=[],o.isReady_=!1,o.hasStarted_=!1,o.userActive_=!1,o.debugEnabled_=!1,o.audioOnlyMode_=!1,o.audioPosterMode_=!1,o.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!o.options_||!o.options_.techOrder||!o.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(o.tag=r,o.tagAttributes=r&&Ao(r),o.language(o.options_.language),a.languages){var u={};Object.getOwnPropertyNames(a.languages).forEach(function(p){u[p.toLowerCase()]=a.languages[p]}),o.languages_=u}else o.languages_=t.prototype.options_.languages;o.resetCache_(),o.poster_=a.poster||"",o.controls_=!!a.controls,r.controls=!1,r.removeAttribute("controls"),o.changingSrc_=!1,o.playCallbacks_=[],o.playTerminatedQueue_=[],r.hasAttribute("autoplay")?o.autoplay(!0):o.autoplay(o.options_.autoplay),a.plugins&&Object.keys(a.plugins).forEach(function(p){if(typeof o[p]!="function")throw new Error('plugin "'+p+'" does not exist')}),o.scrubbing_=!1,o.el_=o.createEl(),wT(Qt(o),{eventBusKey:"el_"}),o.fsApi_.requestFullscreen&&(Ha(vt,o.fsApi_.fullscreenchange,o.boundDocumentFullscreenChange_),o.on(o.fsApi_.fullscreenchange,o.boundDocumentFullscreenChange_)),o.fluid_&&o.on(["playerreset","resize"],o.boundUpdateStyleEl_);var c=Un(o.options_);a.plugins&&Object.keys(a.plugins).forEach(function(p){o[p](a.plugins[p])}),a.debug&&o.debug(!0),o.options_.playerOptions=c,o.middleware_=[],o.playbackRates(a.playbackRates),o.initChildren(),o.isAudio(r.nodeName.toLowerCase()==="audio"),o.controls()?o.addClass("vjs-controls-enabled"):o.addClass("vjs-controls-disabled"),o.el_.setAttribute("role","region"),o.isAudio()?o.el_.setAttribute("aria-label",o.localize("Audio Player")):o.el_.setAttribute("aria-label",o.localize("Video Player")),o.isAudio()&&o.addClass("vjs-audio"),o.flexNotSupported_()&&o.addClass("vjs-no-flex"),_c&&o.addClass("vjs-touch-enabled"),la||o.addClass("vjs-workinghover"),t.players[o.id_]=Qt(o);var d=BR.split(".")[0];return o.addClass("vjs-v"+d),o.userActive(!0),o.reportUserActivity(),o.one("play",function(p){return o.listenForUserActivity_(p)}),o.on("stageclick",function(p){return o.handleStageClick_(p)}),o.on("keydown",function(p){return o.handleKeyDown(p)}),o.on("languagechange",function(p){return o.handleLanguagechange(p)}),o.breakpoints(o.options_.breakpoints),o.responsive(o.options_.responsive),o.on("ready",function(){o.audioPosterMode(o.options_.audioPosterMode),o.audioOnlyMode(o.options_.audioOnlyMode)}),o}var n=t.prototype;return n.dispose=function(){var a=this;this.trigger("dispose"),this.off("dispose"),Hr(vt,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Hr(vt,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),o_e(this),Zr.names.forEach(function(i){var o=Zr[i],s=a[o.getterName]();s&&s.off&&s.off()}),e.prototype.dispose.call(this,{restoreEl:this.options_.restoreEl})},n.createEl=function(){var a=this.tag,i,o=this.playerElIngest_=a.parentNode&&a.parentNode.hasAttribute&&a.parentNode.hasAttribute("data-vjs-player"),s=this.tag.tagName.toLowerCase()==="video-js";o?i=this.el_=a.parentNode:s||(i=this.el_=e.prototype.createEl.call(this,"div"));var l=Ao(a);if(s){for(i=this.el_=a,a=this.tag=vt.createElement("video");i.children.length;)a.appendChild(i.firstChild);kl(i,"video-js")||Vo(i,"video-js"),i.appendChild(a),o=this.playerElIngest_=i,Object.keys(i).forEach(function(v){try{a[v]=i[v]}catch{}})}if(a.setAttribute("tabindex","-1"),l.tabindex="-1",(Dp||ss&&GR)&&(a.setAttribute("role","application"),l.role="application"),a.removeAttribute("width"),a.removeAttribute("height"),"width"in l&&delete l.width,"height"in l&&delete l.height,Object.getOwnPropertyNames(l).forEach(function(v){s&&v==="class"||i.setAttribute(v,l[v]),s&&a.setAttribute(v,l[v])}),a.playerId=a.id,a.id+="_html5_api",a.className="vjs-tech",a.player=i.player=this,this.addClass("vjs-paused"),Te.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=uL("vjs-styles-dimensions");var u=Bs(".vjs-styles-defaults"),c=Bs("head");c.insertBefore(this.styleEl_,u?u.nextSibling:c.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var d=a.getElementsByTagName("a"),p=0;p=0&&(o.width=a),i>=0&&(o.height=i));return}var s,l,u,c;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?u=this.aspectRatio_:this.videoWidth()>0?u=this.videoWidth()+":"+this.videoHeight():u="16:9";var d=u.split(":"),p=d[1]/d[0];this.width_!==void 0?s=this.width_:this.height_!==void 0?s=this.height_/p:s=this.videoWidth()||300,this.height_!==void 0?l=this.height_:l=s*p,/^[^a-zA-Z]/.test(this.id())?c="dimensions-"+this.id():c=this.id()+"-dimensions",this.addClass(c),cL(this.styleEl_,`
- .`+c+` {
- width: `+s+`px;
- height: `+l+`px;
- }
-
- .`+c+`.vjs-fluid:not(.vjs-audio-only-mode) {
- padding-top: `+p*100+`%;
- }
- `)},n.loadTech_=function(a,i){var o=this;this.tech_&&this.unloadTech_();var s=Zn(a),l=a.charAt(0).toLowerCase()+a.slice(1);s!=="Html5"&&this.tag&&(Rn.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=s,this.isReady_=!1;var u=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(u=!1);var c={source:i,autoplay:u,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+l+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};Zr.names.forEach(function(p){var h=Zr[p];c[h.getterName]=o[h.privateName]}),Yn(c,this.options_[s]),Yn(c,this.options_[l]),Yn(c,this.options_[a.toLowerCase()]),this.tag&&(c.tag=this.tag),i&&i.src===this.cache_.src&&this.cache_.currentTime>0&&(c.startTime=this.cache_.currentTime);var d=Rn.getTech(a);if(!d)throw new Error("No Tech named '"+s+"' exists! '"+s+"' should be registered using videojs.registerTech()'");this.tech_=new d(c),this.tech_.ready(Hn(this,this.handleTechReady_),!0),bk.jsonToTextTracks(this.textTracksJson_||[],this.tech_),KL.forEach(function(p){o.on(o.tech_,p,function(h){return o["handleTech"+Zn(p)+"_"](h)})}),Object.keys(ty).forEach(function(p){o.on(o.tech_,p,function(h){if(o.tech_.playbackRate()===0&&o.tech_.seeking()){o.queuedCallbacks_.push({callback:o["handleTech"+ty[p]+"_"].bind(o),event:h});return}o["handleTech"+ty[p]+"_"](h)})}),this.on(this.tech_,"loadstart",function(p){return o.handleTechLoadStart_(p)}),this.on(this.tech_,"sourceset",function(p){return o.handleTechSourceset_(p)}),this.on(this.tech_,"waiting",function(p){return o.handleTechWaiting_(p)}),this.on(this.tech_,"ended",function(p){return o.handleTechEnded_(p)}),this.on(this.tech_,"seeking",function(p){return o.handleTechSeeking_(p)}),this.on(this.tech_,"play",function(p){return o.handleTechPlay_(p)}),this.on(this.tech_,"firstplay",function(p){return o.handleTechFirstPlay_(p)}),this.on(this.tech_,"pause",function(p){return o.handleTechPause_(p)}),this.on(this.tech_,"durationchange",function(p){return o.handleTechDurationChange_(p)}),this.on(this.tech_,"fullscreenchange",function(p,h){return o.handleTechFullscreenChange_(p,h)}),this.on(this.tech_,"fullscreenerror",function(p,h){return o.handleTechFullscreenError_(p,h)}),this.on(this.tech_,"enterpictureinpicture",function(p){return o.handleTechEnterPictureInPicture_(p)}),this.on(this.tech_,"leavepictureinpicture",function(p){return o.handleTechLeavePictureInPicture_(p)}),this.on(this.tech_,"error",function(p){return o.handleTechError_(p)}),this.on(this.tech_,"posterchange",function(p){return o.handleTechPosterChange_(p)}),this.on(this.tech_,"textdata",function(p){return o.handleTechTextData_(p)}),this.on(this.tech_,"ratechange",function(p){return o.handleTechRateChange_(p)}),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(s!=="Html5"||!this.tag)&&Qb(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},n.unloadTech_=function(){var a=this;Zr.names.forEach(function(i){var o=Zr[i];a[o.privateName]=a[o.getterName]()}),this.textTracksJson_=bk.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},n.tech=function(a){return a===void 0&&on.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
-See https://github.com/videojs/video.js/issues/2617 for more info.
-`),this.tech_},n.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},n.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},n.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},n.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())},n.manualAutoplay_=function(a){var i=this;if(!(!this.tech_||typeof a!="string")){var o=function(){var u=i.muted();i.muted(!0);var c=function(){i.muted(u)};i.playTerminatedQueue_.push(c);var d=i.play();if(ef(d))return d.catch(function(p){throw c(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(p||""))})},s;if(a==="any"&&!this.muted()?(s=this.play(),ef(s)&&(s=s.catch(o))):a==="muted"&&!this.muted()?s=o():s=this.play(),!!ef(s))return s.then(function(){i.trigger({type:"autoplay-success",autoplay:a})}).catch(function(){i.trigger({type:"autoplay-failure",autoplay:a})})}},n.updateSourceCaches_=function(a){a===void 0&&(a="");var i=a,o="";typeof i!="string"&&(i=a.src,o=a.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],i&&!o&&(o=u_e(this,i)),this.cache_.source=Un({},a,{src:i,type:o});for(var s=this.cache_.sources.filter(function(h){return h.src&&h.src===i}),l=[],u=this.$$("source"),c=[],d=0;d0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(function(a){return a.callback(a.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},n.handleTechWaiting_=function(){var a=this;this.addClass("vjs-waiting"),this.trigger("waiting");var i=this.currentTime(),o=function s(){i!==a.currentTime()&&(a.removeClass("vjs-waiting"),a.off("timeupdate",s))};this.on("timeupdate",o)},n.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},n.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},n.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},n.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},n.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},n.handleTechFirstPlay_=function(){this.options_.starttime&&(on.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},n.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},n.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},n.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},n.handleTechClick_=function(a){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,a):this.paused()?qi(this.play()):this.pause())},n.handleTechDoubleClick_=function(a){if(this.controls_){var i=Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(o){return o.contains(a.target)});i||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,a):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}},n.handleTechTap_=function(){this.userActive(!this.userActive())},n.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},n.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},n.handleTechTouchEnd_=function(a){a.cancelable&&a.preventDefault()},n.handleStageClick_=function(){this.reportUserActivity()},n.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},n.documentFullscreenChange_=function(a){var i=a.target.player;if(!(i&&i!==this)){var o=this.el(),s=vt[this.fsApi_.fullscreenElement]===o;!s&&o.matches?s=o.matches(":"+this.fsApi_.fullscreen):!s&&o.msMatchesSelector&&(s=o.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(s)}},n.handleTechFullscreenChange_=function(a,i){var o=this;i&&(i.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",function(){o.removeClass("vjs-ios-native-fs")})),this.isFullscreen(i.isFullscreen))},n.handleTechFullscreenError_=function(a,i){this.trigger("fullscreenerror",i)},n.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},n.handleTechEnterPictureInPicture_=function(a){this.isInPictureInPicture(!0)},n.handleTechLeavePictureInPicture_=function(a){this.isInPictureInPicture(!1)},n.handleTechError_=function(){var a=this.tech_.error();this.error(a)},n.handleTechTextData_=function(){var a=null;arguments.length>1&&(a=arguments[1]),this.trigger("textdata",a)},n.getCache=function(){return this.cache_},n.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},n.techCall_=function(a,i){this.ready(function(){if(a in a_e)return n_e(this.middleware_,this.tech_,a,i);if(a in Ek)return Ck(this.middleware_,this.tech_,a,i);try{this.tech_&&this.tech_[a](i)}catch(o){throw on(o),o}},!0)},n.techGet_=function(a){if(!(!this.tech_||!this.tech_.isReady_)){if(a in r_e)return t_e(this.middleware_,this.tech_,a);if(a in Ek)return Ck(this.middleware_,this.tech_,a);try{return this.tech_[a]()}catch(i){throw this.tech_[a]===void 0?(on("Video.js: "+a+" method not defined for "+this.techName_+" playback technology.",i),i):i.name==="TypeError"?(on("Video.js: "+a+" unavailable on "+this.techName_+" playback technology element.",i),this.tech_.isReady_=!1,i):(on(i),i)}}},n.play=function(){var a=this,i=this.options_.Promise||Te.Promise;return i?new i(function(o){a.play_(o)}):this.play_()},n.play_=function(a){var i=this;a===void 0&&(a=qi),this.playCallbacks_.push(a);var o=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),s=!!(wg||la);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!o){this.waitToPlay_=function(c){i.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!o&&s&&this.load();return}var l=this.techGet_("play"),u=s&&this.hasClass("vjs-ended");u&&this.resetProgressBar_(),l===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(l)},n.runPlayTerminatedQueue_=function(){var a=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],a.forEach(function(i){i()})},n.runPlayCallbacks_=function(a){var i=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],i.forEach(function(o){o(a)})},n.pause=function(){this.techCall_("pause")},n.paused=function(){return this.techGet_("paused")!==!1},n.played=function(){return this.techGet_("played")||Al(0,0)},n.scrubbing=function(a){if(typeof a>"u")return this.scrubbing_;this.scrubbing_=!!a,this.techCall_("setScrubbing",this.scrubbing_),a?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},n.currentTime=function(a){if(typeof a<"u"){if(a<0&&(a=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=a,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",a),this.cache_.initTime=0;return}return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime},n.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},n.duration=function(a){if(a===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;a=parseFloat(a),a<0&&(a=1/0),a!==this.cache_.duration&&(this.cache_.duration=a,a===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(a)||this.trigger("durationchange"))},n.remainingTime=function(){return this.duration()-this.currentTime()},n.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},n.buffered=function(){var a=this.techGet_("buffered");return(!a||!a.length)&&(a=Al(0,0)),a},n.bufferedPercent=function(){return vL(this.buffered(),this.duration())},n.bufferedEnd=function(){var a=this.buffered(),i=this.duration(),o=a.end(a.length-1);return o>i&&(o=i),o},n.volume=function(a){var i;if(a!==void 0){i=Math.max(0,Math.min(1,parseFloat(a))),this.cache_.volume=i,this.techCall_("setVolume",i),i>0&&this.lastVolume_(i);return}return i=parseFloat(this.techGet_("volume")),isNaN(i)?1:i},n.muted=function(a){if(a!==void 0){this.techCall_("setMuted",a);return}return this.techGet_("muted")||!1},n.defaultMuted=function(a){return a!==void 0?this.techCall_("setDefaultMuted",a):this.techGet_("defaultMuted")||!1},n.lastVolume_=function(a){if(a!==void 0&&a!==0){this.cache_.lastVolume=a;return}return this.cache_.lastVolume},n.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},n.isFullscreen=function(a){if(a!==void 0){var i=this.isFullscreen_;this.isFullscreen_=!!a,this.isFullscreen_!==i&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_},n.requestFullscreen=function(a){var i=this.options_.Promise||Te.Promise;if(i){var o=this;return new i(function(s,l){function u(){o.off("fullscreenerror",d),o.off("fullscreenchange",c)}function c(){u(),s()}function d(h,v){u(),l(v)}o.one("fullscreenchange",c),o.one("fullscreenerror",d);var p=o.requestFullscreenHelper_(a);p&&(p.then(u,u),p.then(s,l))})}return this.requestFullscreenHelper_()},n.requestFullscreenHelper_=function(a){var i=this,o;if(this.fsApi_.prefixed||(o=this.options_.fullscreen&&this.options_.fullscreen.options||{},a!==void 0&&(o=a)),this.fsApi_.requestFullscreen){var s=this.el_[this.fsApi_.requestFullscreen](o);return s&&s.then(function(){return i.isFullscreen(!0)},function(){return i.isFullscreen(!1)}),s}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},n.exitFullscreen=function(){var a=this.options_.Promise||Te.Promise;if(a){var i=this;return new a(function(o,s){function l(){i.off("fullscreenerror",c),i.off("fullscreenchange",u)}function u(){l(),o()}function c(p,h){l(),s(h)}i.one("fullscreenchange",u),i.one("fullscreenerror",c);var d=i.exitFullscreenHelper_();d&&(d.then(l,l),d.then(o,s))})}return this.exitFullscreenHelper_()},n.exitFullscreenHelper_=function(){var a=this;if(this.fsApi_.requestFullscreen){var i=vt[this.fsApi_.exitFullscreen]();return i&&qi(i.then(function(){return a.isFullscreen(!1)})),i}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},n.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=vt.documentElement.style.overflow,Ha(vt,"keydown",this.boundFullWindowOnEscKey_),vt.documentElement.style.overflow="hidden",Vo(vt.body,"vjs-full-window"),this.trigger("enterFullWindow")},n.fullWindowOnEscKey=function(a){Jt.isEventKey(a,"Esc")&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},n.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,Hr(vt,"keydown",this.boundFullWindowOnEscKey_),vt.documentElement.style.overflow=this.docOrigOverflow,Ip(vt.body,"vjs-full-window"),this.trigger("exitFullWindow")},n.disablePictureInPicture=function(a){if(a===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",a),this.options_.disablePictureInPicture=a,this.trigger("disablepictureinpicturechanged")},n.isInPictureInPicture=function(a){if(a!==void 0){this.isInPictureInPicture_=!!a,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_},n.requestPictureInPicture=function(){if("pictureInPictureEnabled"in vt&&this.disablePictureInPicture()===!1)return this.techGet_("requestPictureInPicture")},n.exitPictureInPicture=function(){if("pictureInPictureEnabled"in vt)return vt.exitPictureInPicture()},n.handleKeyDown=function(a){var i=this.options_.userActions;if(!(!i||!i.hotkeys)){var o=function(l){var u=l.tagName.toLowerCase();if(l.isContentEditable)return!0;var c=["button","checkbox","hidden","radio","reset","submit"];if(u==="input")return c.indexOf(l.type)===-1;var d=["textarea"];return d.indexOf(u)!==-1};o(this.el_.ownerDocument.activeElement)||(typeof i.hotkeys=="function"?i.hotkeys.call(this,a):this.handleHotkeys(a))}},n.handleHotkeys=function(a){var i=this.options_.userActions?this.options_.userActions.hotkeys:{},o=i.fullscreenKey,s=o===void 0?function(m){return Jt.isEventKey(m,"f")}:o,l=i.muteKey,u=l===void 0?function(m){return Jt.isEventKey(m,"m")}:l,c=i.playPauseKey,d=c===void 0?function(m){return Jt.isEventKey(m,"k")||Jt.isEventKey(m,"Space")}:c;if(s.call(this,a)){a.preventDefault(),a.stopPropagation();var p=ut.getComponent("FullscreenToggle");vt[this.fsApi_.fullscreenEnabled]!==!1&&p.prototype.handleClick.call(this,a)}else if(u.call(this,a)){a.preventDefault(),a.stopPropagation();var h=ut.getComponent("MuteToggle");h.prototype.handleClick.call(this,a)}else if(d.call(this,a)){a.preventDefault(),a.stopPropagation();var v=ut.getComponent("PlayToggle");v.prototype.handleClick.call(this,a)}},n.canPlayType=function(a){for(var i,o=0,s=this.options_.techOrder;o"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();var s=c_e(a);if(!s.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,i||(this.cache_.sources=s),this.updateSourceCaches_(s[0]),Zbe(this,s[0],function(c,d){o.middleware_=d,i||(o.cache_.sources=s),o.updateSourceCaches_(c);var p=o.src_(c);if(p){if(s.length>1)return o.handleSrc_(s.slice(1));o.changingSrc_=!1,o.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),o.triggerReady();return}e_e(d,o.tech_)}),this.options_.retryOnError&&s.length>1){var l=function(){o.error(null),o.handleSrc_(s.slice(1),!0)},u=function(){o.off("error",l)};this.one("error",l),this.one("playing",u),this.resetRetryOnError_=function(){o.off("error",l),o.off("playing",u)}}},n.src=function(a){return this.handleSrc_(a,!1)},n.src_=function(a){var i=this,o=this.selectSource([a]);return o?Rbe(o.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",a):this.techCall_("src",a.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(o.tech,o.source),this.tech_.ready(function(){i.changingSrc_=!1}),!1):!0},n.load=function(){this.techCall_("load")},n.reset=function(){var a=this,i=this.options_.Promise||Te.Promise;if(this.paused()||!i)this.doReset_();else{var o=this.play();qi(o.then(function(){return a.doReset_()}))}},n.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),Uo(this)&&this.trigger("playerreset")},n.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},n.resetProgressBar_=function(){this.currentTime(0);var a=this.controlBar||{},i=a.durationDisplay,o=a.remainingTimeDisplay;i&&i.updateContent(),o&&o.updateContent()},n.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},n.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},n.currentSources=function(){var a=this.currentSource(),i=[];return Object.keys(a).length!==0&&i.push(a),this.cache_.sources||i},n.currentSource=function(){return this.cache_.source||{}},n.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},n.currentType=function(){return this.currentSource()&&this.currentSource().type||""},n.preload=function(a){if(a!==void 0){this.techCall_("setPreload",a),this.options_.preload=a;return}return this.techGet_("preload")},n.autoplay=function(a){if(a===void 0)return this.options_.autoplay||!1;var i;typeof a=="string"&&/(any|play|muted)/.test(a)||a===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=a,this.manualAutoplay_(typeof a=="string"?a:"play"),i=!1):a?this.options_.autoplay=!0:this.options_.autoplay=!1,i=typeof i>"u"?this.options_.autoplay:i,this.tech_&&this.techCall_("setAutoplay",i)},n.playsinline=function(a){return a!==void 0?(this.techCall_("setPlaysinline",a),this.options_.playsinline=a,this):this.techGet_("playsinline")},n.loop=function(a){if(a!==void 0){this.techCall_("setLoop",a),this.options_.loop=a;return}return this.techGet_("loop")},n.poster=function(a){if(a===void 0)return this.poster_;a||(a=""),a!==this.poster_&&(this.poster_=a,this.techCall_("setPoster",a),this.isPosterFromTech_=!1,this.trigger("posterchange"))},n.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var a=this.tech_.poster()||"";a!==this.poster_&&(this.poster_=a,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},n.controls=function(a){if(a===void 0)return!!this.controls_;a=!!a,this.controls_!==a&&(this.controls_=a,this.usingNativeControls()&&this.techCall_("setControls",a),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},n.usingNativeControls=function(a){if(a===void 0)return!!this.usingNativeControls_;a=!!a,this.usingNativeControls_!==a&&(this.usingNativeControls_=a,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},n.error=function(a){var i=this;if(a===void 0)return this.error_||null;if($s("beforeerror").forEach(function(s){var l=s(i,a);if(!(Xo(l)&&!Array.isArray(l)||typeof l=="string"||typeof l=="number"||l===null)){i.log.error("please return a value that MediaError expects in beforeerror hooks");return}a=l}),this.options_.suppressNotSupportedError&&a&&a.code===4){var o=function(){this.error(a)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],o),this.one("loadstart",function(){this.off(["click","touchstart"],o)});return}if(a===null){this.error_=a,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new aa(a),this.addClass("vjs-error"),on.error("(CODE:"+this.error_.code+" "+aa.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),$s("error").forEach(function(s){return s(i,i.error_)})},n.reportUserActivity=function(a){this.userActivity_=!0},n.userActive=function(a){if(a===void 0)return this.userActive_;if(a=!!a,a!==this.userActive_){if(this.userActive_=a,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(i){i.stopPropagation(),i.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},n.listenForUserActivity_=function(){var a,i,o,s=Hn(this,this.reportUserActivity),l=function(v){(v.screenX!==i||v.screenY!==o)&&(i=v.screenX,o=v.screenY,s())},u=function(){s(),this.clearInterval(a),a=this.setInterval(s,250)},c=function(v){s(),this.clearInterval(a)};this.on("mousedown",u),this.on("mousemove",l),this.on("mouseup",c),this.on("mouseleave",c);var d=this.getChild("controlBar");d&&!la&&!os&&(d.on("mouseenter",function(h){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),d.on("mouseleave",function(h){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",s),this.on("keyup",s);var p;this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(p);var h=this.options_.inactivityTimeout;h<=0||(p=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},h))}},250)},n.playbackRate=function(a){if(a!==void 0){this.techCall_("setPlaybackRate",a);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1},n.defaultPlaybackRate=function(a){return a!==void 0?this.techCall_("setDefaultPlaybackRate",a):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},n.isAudio=function(a){if(a!==void 0){this.isAudio_=!!a;return}return!!this.isAudio_},n.enableAudioOnlyUI_=function(){var a=this;this.addClass("vjs-audio-only-mode");var i=this.children(),o=this.getChild("ControlBar"),s=o&&o.currentHeight();i.forEach(function(l){l!==o&&l.el_&&!l.hasClass("vjs-hidden")&&(l.hide(),a.audioOnlyCache_.hiddenChildren.push(l))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(s),this.trigger("audioonlymodechange")},n.disableAudioOnlyUI_=function(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach(function(a){return a.show()}),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")},n.audioOnlyMode=function(a){var i=this;if(typeof a!="boolean"||a===this.audioOnlyMode_)return this.audioOnlyMode_;this.audioOnlyMode_=a;var o=this.options_.Promise||Te.Promise;if(o){if(a){var s=[];return this.isInPictureInPicture()&&s.push(this.exitPictureInPicture()),this.isFullscreen()&&s.push(this.exitFullscreen()),this.audioPosterMode()&&s.push(this.audioPosterMode(!1)),o.all(s).then(function(){return i.enableAudioOnlyUI_()})}return o.resolve().then(function(){return i.disableAudioOnlyUI_()})}a?(this.isInPictureInPicture()&&this.exitPictureInPicture(),this.isFullscreen()&&this.exitFullscreen(),this.enableAudioOnlyUI_()):this.disableAudioOnlyUI_()},n.enablePosterModeUI_=function(){var a=this.tech_&&this.tech_;a.hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},n.disablePosterModeUI_=function(){var a=this.tech_&&this.tech_;a.show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},n.audioPosterMode=function(a){var i=this;if(typeof a!="boolean"||a===this.audioPosterMode_)return this.audioPosterMode_;this.audioPosterMode_=a;var o=this.options_.Promise||Te.Promise;if(o){if(a){if(this.audioOnlyMode()){var s=this.audioOnlyMode(!1);return s.then(function(){i.enablePosterModeUI_()})}return o.resolve().then(function(){i.enablePosterModeUI_()})}return o.resolve().then(function(){i.disablePosterModeUI_()})}if(a){this.audioOnlyMode()&&this.audioOnlyMode(!1),this.enablePosterModeUI_();return}this.disablePosterModeUI_()},n.addTextTrack=function(a,i,o){if(this.tech_)return this.tech_.addTextTrack(a,i,o)},n.addRemoteTextTrack=function(a,i){if(this.tech_)return this.tech_.addRemoteTextTrack(a,i)},n.removeRemoteTextTrack=function(a){a===void 0&&(a={});var i=a,o=i.track;if(o||(o=a),this.tech_)return this.tech_.removeRemoteTextTrack(o)},n.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},n.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},n.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},n.language=function(a){if(a===void 0)return this.language_;this.language_!==String(a).toLowerCase()&&(this.language_=String(a).toLowerCase(),Uo(this)&&this.trigger("languagechange"))},n.languages=function(){return Un(t.prototype.options_.languages,this.languages_)},n.toJSON=function(){var a=Un(this.options_),i=a.tracks;a.tracks=[];for(var o=0;o"):function(){}},Vs=1/30,Gi=Vs*3,YL=function(t,n){var r=[],a;if(t&&t.length)for(a=0;a=n})},Eh=function(t,n){return YL(t,function(r){return r-Vs>=n})},z_e=function(t){if(t.length<2)return Ne.createTimeRanges();for(var n=[],r=1;r "+t.end(r));return n.join(", ")},W_e=function(t,n,r){r===void 0&&(r=1);var a=t.length?t.end(t.length-1):0;return(a-n)/r},_l=function(t){for(var n=[],r=0;ro)){if(n>i&&n<=o){r+=o-n;continue}r+=o-i}}return r},Hk=Ne.createTimeRange,WT=function(t,n){if(!n.preload)return n.duration;var r=0;return(n.parts||[]).forEach(function(a){r+=a.duration}),(n.preloadHints||[]).forEach(function(a){a.type==="PART"&&(r+=t.partTargetDuration)}),r},o_=function(t){return(t.segments||[]).reduce(function(n,r,a){return r.parts?r.parts.forEach(function(i,o){n.push({duration:i.duration,segmentIndex:a,partIndex:o,part:i,segment:r})}):n.push({duration:r.duration,segmentIndex:a,partIndex:null,segment:r,part:null}),n},[])},QL=function(t){var n=t.segments&&t.segments.length&&t.segments[t.segments.length-1];return n&&n.parts||[]},JL=function(t){var n=t.preloadSegment;if(n){var r=n.parts,a=n.preloadHints,i=(a||[]).reduce(function(o,s){return o+(s.type==="PART"?1:0)},0);return i+=r&&r.length?r.length:0,i}},ZL=function(t,n){if(n.endList)return 0;if(t&&t.suggestedPresentationDelay)return t.suggestedPresentationDelay;var r=QL(n).length>0;return r&&n.serverControl&&n.serverControl.partHoldBack?n.serverControl.partHoldBack:r&&n.partTargetDuration?n.partTargetDuration*3:n.serverControl&&n.serverControl.holdBack?n.serverControl.holdBack:n.targetDuration?n.targetDuration*3:0},q_e=function(t,n){var r=0,a=n-t.mediaSequence,i=t.segments[a];if(i){if(typeof i.start<"u")return{result:i.start,precise:!0};if(typeof i.end<"u")return{result:i.end-i.duration,precise:!0}}for(;a--;){if(i=t.segments[a],typeof i.end<"u")return{result:r+i.end,precise:!0};if(r+=WT(t,i),typeof i.start<"u")return{result:r+i.start,precise:!0}}return{result:r,precise:!1}},G_e=function(t,n){for(var r=0,a,i=n-t.mediaSequence;i"u"&&(n=t.mediaSequence+t.segments.length),n"u"){if(t.totalDuration)return t.totalDuration;if(!t.endList)return Te.Infinity}return eN(t,n,r)},tf=function(t){var n=t.defaultDuration,r=t.durationList,a=t.startIndex,i=t.endIndex,o=0;if(a>i){var s=[i,a];a=s[0],i=s[1]}if(a<0){for(var l=a;l0)for(var h=c-1;h>=0;h--){var v=u[h];if(l+=v.duration,s){if(l<0)continue}else if(l+Vs<=0)continue;return{partIndex:v.partIndex,segmentIndex:v.segmentIndex,startTime:o-tf({defaultDuration:n.targetDuration,durationList:u,startIndex:c,endIndex:h})}}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:r}}if(c<0){for(var m=c;m<0;m++)if(l-=n.targetDuration,l<0)return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:r};c=0}for(var g=c;g0)continue}else if(l-Vs>=0)continue;return{partIndex:y.partIndex,segmentIndex:y.segmentIndex,startTime:o+tf({defaultDuration:n.targetDuration,durationList:u,startIndex:c,endIndex:g})}}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:r}},rN=function(t){return t.excludeUntil&&t.excludeUntil>Date.now()},KT=function(t){return t.excludeUntil&&t.excludeUntil===1/0},Og=function(t){var n=rN(t);return!t.disabled&&!n},Q_e=function(t){return t.disabled},J_e=function(t){for(var n=0;n-1&&s!==o.length-1&&(r._HLS_part=s),(s>-1||o.length)&&i--}r._HLS_msn=i}if(n.serverControl&&n.serverControl.canSkipUntil&&(r._HLS_skip=n.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(r).length){var l=new Te.URL(t);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(u){r.hasOwnProperty(u)&&l.searchParams.set(u,r[u])}),t=l.toString()}return t},s1e=function(t,n){if(!t)return n;var r=ov(t,n);if(t.preloadHints&&!n.preloadHints&&delete r.preloadHints,t.parts&&!n.parts)delete r.parts;else if(t.parts&&n.parts)for(var a=0;a=500?4:2},this.trigger("error")},n.parseManifest_=function(a){var i=this,o=a.url,s=a.manifestString;return t1e({onwarn:function(u){var c=u.message;return i.logger_("m3u8-parser warn for "+o+": "+c)},oninfo:function(u){var c=u.message;return i.logger_("m3u8-parser info for "+o+": "+c)},manifestString:s,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},n.haveMetadata=function(a){var i=a.playlistString,o=a.playlistObject,s=a.url,l=a.id;this.request=null,this.state="HAVE_METADATA";var u=o||this.parseManifest_({url:s,manifestString:i});u.lastRequest=Date.now(),oN({playlist:u,uri:s,id:l});var c=l_(this.master,u);this.targetDuration=u.partTargetDuration||u.targetDuration,this.pendingMedia_=null,c?(this.master=c,this.media_=this.master.playlists[l]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(u_(this.media(),!!c)),this.trigger("loadedplaylist")},n.dispose=function(){this.trigger("dispose"),this.stopRequest(),Te.clearTimeout(this.mediaUpdateTimeout),Te.clearTimeout(this.finalRenditionTimeout),this.off()},n.stopRequest=function(){if(this.request){var a=this.request;this.request=null,a.onreadystatechange=null,a.abort()}},n.media=function(a,i){var o=this;if(!a)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof a=="string"){if(!this.master.playlists[a])throw new Error("Unknown playlist URI: "+a);a=this.master.playlists[a]}if(Te.clearTimeout(this.finalRenditionTimeout),i){var s=(a.partTargetDuration||a.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=Te.setTimeout(this.media.bind(this,a,!1),s);return}var l=this.state,u=!this.media_||a.id!==this.media_.id,c=this.master.playlists[a.id];if(c&&c.endList||a.endList&&a.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=a,u&&(this.trigger("mediachanging"),l==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(u_(a,!0)),!!u){if(this.state="SWITCHING_MEDIA",this.request){if(a.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=a,this.request=this.vhs_.xhr({uri:a.resolvedUri,withCredentials:this.withCredentials},function(d,p){if(o.request){if(a.lastRequest=Date.now(),a.resolvedUri=iv(o.handleManifestRedirects,a.resolvedUri,p),d)return o.playlistRequestError(o.request,a,l);o.haveMetadata({playlistString:p.responseText,url:a.uri,id:a.id}),l==="HAVE_MASTER"?o.trigger("loadedmetadata"):o.trigger("mediachange")}})}},n.pause=function(){this.mediaUpdateTimeout&&(Te.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")},n.load=function(a){var i=this;this.mediaUpdateTimeout&&(Te.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var o=this.media();if(a){var s=o?(o.partTargetDuration||o.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=Te.setTimeout(function(){i.mediaUpdateTimeout=null,i.load()},s);return}if(!this.started){this.start();return}o&&!o.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")},n.updateMediaUpdateTimeout_=function(a){var i=this;this.mediaUpdateTimeout&&(Te.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=Te.setTimeout(function(){i.mediaUpdateTimeout=null,i.trigger("mediaupdatetimeout"),i.updateMediaUpdateTimeout_(a)},a))},n.start=function(){var a=this;if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=Te.location.href),this.src.resolvedUri=this.src.uri,setTimeout(function(){a.setupInitialPlaylist(a.src)},0);return}this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},function(i,o){if(a.request){if(a.request=null,i)return a.error={status:o.status,message:"HLS playlist request error at URL: "+a.src+".",responseText:o.responseText,code:2},a.state==="HAVE_NOTHING"&&(a.started=!1),a.trigger("error");a.src=iv(a.handleManifestRedirects,a.src,o);var s=a.parseManifest_({manifestString:o.responseText,url:a.src});a.setupInitialPlaylist(s)}})},n.srcUri=function(){return typeof this.src=="string"?this.src:this.src.uri},n.setupInitialPlaylist=function(a){if(this.state="HAVE_MASTER",a.playlists){this.master=a,sN(this.master,this.srcUri()),a.playlists.forEach(function(o){o.segments=uN(o),o.segments.forEach(function(s){lN(s,o.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.master.playlists[0]);return}var i=this.srcUri()||Te.location.href;this.master=a1e(a,i),this.haveMetadata({playlistObject:a,url:i,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},t}(i1e),u1e=Ne.xhr,c1e=Ne.mergeOptions,c_=function(t,n,r,a){var i=t.responseType==="arraybuffer"?t.response:t.responseText;!n&&i&&(t.responseTime=Date.now(),t.roundTripTime=t.responseTime-t.requestTime,t.bytesReceived=i.byteLength||i.length,t.bandwidth||(t.bandwidth=Math.floor(t.bytesReceived/t.roundTripTime*8*1e3))),r.headers&&(t.responseHeaders=r.headers),n&&n.code==="ETIMEDOUT"&&(t.timedout=!0),!n&&!t.aborted&&r.statusCode!==200&&r.statusCode!==206&&r.statusCode!==0&&(n=new Error("XHR Failed with a response of: "+(t&&(i||t.responseText)))),a(n,t)},dN=function(){var t=function n(r,a){r=c1e({timeout:45e3},r);var i=n.beforeRequest||Ne.Vhs.xhr.beforeRequest;if(i&&typeof i=="function"){var o=i(r);o&&(r=o)}var s=Ne.Vhs.xhr.original===!0?u1e:Ne.Vhs.xhr,l=s(r,function(c,d){return c_(l,c,d,a)}),u=l.abort;return l.abort=function(){return l.aborted=!0,u.apply(l,arguments)},l.uri=r.uri,l.requestTime=Date.now(),l};return t.original=!0,t},d1e=function(t){var n,r=t.offset;return typeof t.offset=="bigint"||typeof t.length=="bigint"?n=Te.BigInt(t.offset)+Te.BigInt(t.length)-Te.BigInt(1):n=t.offset+t.length-1,"bytes="+r+"-"+n},d_=function(t){var n={};return t.byterange&&(n.Range=d1e(t.byterange)),n},f1e=function(t,n){return t.start(n)+"-"+t.end(n)},p1e=function(t,n){var r=t.toString(16);return"00".substring(0,2-r.length)+r+(n%2?" ":"")},h1e=function(t){return t>=32&&t<126?String.fromCharCode(t):"."},fN=function(t){var n={};return Object.keys(t).forEach(function(r){var a=t[r];QM(a)?n[r]={bytes:a.buffer,byteOffset:a.byteOffset,byteLength:a.byteLength}:n[r]=a}),n},sv=function(t){var n=t.byterange||{length:1/0,offset:0};return[n.length,n.offset,t.resolvedUri].join(",")},pN=function(t){return t.resolvedUri},hN=function(t){for(var n=Array.prototype.slice.call(t),r=16,a="",i,o,s=0;sc?null:(r>l&&(a=s),{segment:a,estimatedStart:a.videoTimingInfo?a.videoTimingInfo.transmuxedPresentationStart:ya.duration(n,n.mediaSequence+n.segments.indexOf(a)),type:a.videoTimingInfo?"accurate":"estimate"})},T1e=function(t,n){if(!n||!n.segments||n.segments.length===0)return null;for(var r=0,a,i=0;ir){if(t>r+o.duration*mN)return null;a=o}return{segment:a,estimatedStart:a.videoTimingInfo?a.videoTimingInfo.transmuxedPresentationStart:r-a.duration,type:a.videoTimingInfo?"accurate":"estimate"}},w1e=function(t,n){var r,a;try{r=new Date(t),a=new Date(n)}catch{}var i=r.getTime(),o=a.getTime();return(o-i)/1e3},S1e=function(t){if(!t.segments||t.segments.length===0)return!1;for(var n=0;n"u"||!r||!o)return c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!r.endList&&!u.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!S1e(r))return c({message:"programDateTime tags must be provided in the manifest "+r.resolvedUri});var d=_1e(n,r);if(!d)return c({message:n+" was not found in the stream"});var p=d.segment,h=w1e(p.dateTimeObject,n);if(d.type==="estimate"){if(i===0)return c({message:n+" is not buffered yet. Try again"});o(d.estimatedStart+h),u.one("seeked",function(){e({programTime:n,playlist:r,retryCount:i-1,seekTo:o,pauseAfterSeek:l,tech:u,callback:c})});return}var v=p.start+h,m=function(){return c(null,u.currentTime())};u.one("seeked",m),l&&u.pause(),o(v)},ry=function(t,n){if(t.readyState===4)return n()},x1e=function(t,n,r){var a=[],i,o=!1,s=function(p,h,v,m){return h.abort(),o=!0,r(p,h,v,m)},l=function(p,h){if(!o){if(p)return s(p,h,"",a);var v=h.responseText.substring(a&&a.byteLength||0,h.responseText.length);if(a=k0e(a,JM(v,!0)),i=i||Od(a),a.length<10||i&&a.length=y+g)return c(d,{response:v.subarray(g,g+y),status:p.status,uri:p.uri});s.request=s.vhs_.xhr({uri:u,responseType:"arraybuffer",headers:d_({byterange:a.sidx.byterange})},c)})},n.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},Te.clearTimeout(this.minimumUpdatePeriodTimeout_),Te.clearTimeout(this.mediaRequest_),Te.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},n.hasPendingRequest=function(){return this.request||this.mediaRequest_},n.stopRequest=function(){if(this.request){var a=this.request;this.request=null,a.onreadystatechange=null,a.abort()}},n.media=function(a){var i=this;if(!a)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);var o=this.state;if(typeof a=="string"){if(!this.masterPlaylistLoader_.master.playlists[a])throw new Error("Unknown playlist URI: "+a);a=this.masterPlaylistLoader_.master.playlists[a]}var s=!this.media_||a.id!==this.media_.id;if(s&&this.loadedPlaylists_[a.id]&&this.loadedPlaylists_[a.id].endList){this.state="HAVE_METADATA",this.media_=a,s&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}s&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(a,o,function(l){i.haveMetadata({startingState:o,playlist:a})}))},n.haveMetadata=function(a){var i=a.startingState,o=a.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[o.id]=o,this.mediaRequest_=null,this.refreshMedia_(o.id),i==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange")},n.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),Te.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(Te.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)},n.load=function(a){var i=this;Te.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var o=this.media();if(a){var s=o?o.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=Te.setTimeout(function(){return i.load()},s);return}if(!this.started){this.start();return}o&&!o.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")},n.start=function(){var a=this;if(this.started=!0,!this.isMaster_){this.mediaRequest_=Te.setTimeout(function(){return a.haveMaster_()},0);return}this.requestMaster_(function(i,o){a.haveMaster_(),!a.hasPendingRequest()&&!a.media_&&a.media(a.masterPlaylistLoader_.master.playlists[0])})},n.requestMaster_=function(a){var i=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(o,s){if(i.requestErrored_(o,s)){i.state==="HAVE_NOTHING"&&(i.started=!1);return}var l=s.responseText!==i.masterPlaylistLoader_.masterXml_;if(i.masterPlaylistLoader_.masterXml_=s.responseText,s.responseHeaders&&s.responseHeaders.date?i.masterLoaded_=Date.parse(s.responseHeaders.date):i.masterLoaded_=Date.now(),i.masterPlaylistLoader_.srcUrl=iv(i.handleManifestRedirects,i.masterPlaylistLoader_.srcUrl,s),l){i.handleMaster_(),i.syncClientServerClock_(function(){return a(s,l)});return}return a(s,l)})},n.syncClientServerClock_=function(a){var i=this,o=qye(this.masterPlaylistLoader_.masterXml_);if(o===null)return this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),a();if(o.method==="DIRECT")return this.masterPlaylistLoader_.clientOffset_=o.value-Date.now(),a();this.request=this.vhs_.xhr({uri:di(this.masterPlaylistLoader_.srcUrl,o.value),method:o.method,withCredentials:this.withCredentials},function(s,l){if(i.request){if(s)return i.masterPlaylistLoader_.clientOffset_=i.masterLoaded_-Date.now(),a();var u;o.method==="HEAD"?!l.responseHeaders||!l.responseHeaders.date?u=i.masterLoaded_:u=Date.parse(l.responseHeaders.date):u=Date.parse(l.responseText),i.masterPlaylistLoader_.clientOffset_=u-Date.now(),a()}})},n.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},n.handleMaster_=function(){this.mediaRequest_=null;var a=this.masterPlaylistLoader_.master,i=D1e({masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:a});a&&(i=P1e(a,i,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=i||a;var o=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return o&&o!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=o),(!a||i&&i.minimumUpdatePeriod!==a.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),!!i},n.updateMinimumUpdatePeriodTimeout_=function(){var a=this.masterPlaylistLoader_;a.createMupOnMedia_&&(a.off("loadedmetadata",a.createMupOnMedia_),a.createMupOnMedia_=null),a.minimumUpdatePeriodTimeout_&&(Te.clearTimeout(a.minimumUpdatePeriodTimeout_),a.minimumUpdatePeriodTimeout_=null);var i=a.master&&a.master.minimumUpdatePeriod;if(i===0&&(a.media()?i=a.media().targetDuration*1e3:(a.createMupOnMedia_=a.updateMinimumUpdatePeriodTimeout_,a.one("loadedmetadata",a.createMupOnMedia_))),typeof i!="number"||i<=0){i<0&&this.logger_("found invalid minimumUpdatePeriod of "+i+", not setting a timeout");return}this.createMUPTimeout_(i)},n.createMUPTimeout_=function(a){var i=this.masterPlaylistLoader_;i.minimumUpdatePeriodTimeout_=Te.setTimeout(function(){i.minimumUpdatePeriodTimeout_=null,i.trigger("minimumUpdatePeriod"),i.createMUPTimeout_(a)},a)},n.refreshXml_=function(){var a=this;this.requestMaster_(function(i,o){o&&(a.media_&&(a.media_=a.masterPlaylistLoader_.master.playlists[a.media_.id]),a.masterPlaylistLoader_.sidxMapping_=M1e(a.masterPlaylistLoader_.master,a.masterPlaylistLoader_.sidxMapping_),a.addSidxSegments_(a.media(),a.state,function(s){a.refreshMedia_(a.media().id)}))})},n.refreshMedia_=function(a){var i=this;if(!a)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var o=this.masterPlaylistLoader_.master.playlists,s=!this.media_||this.media_!==o[a];if(s?this.media_=o[a]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){var l=function u(){i.media().endList||(i.mediaUpdateTimeout=Te.setTimeout(function(){i.trigger("mediaupdatetimeout"),u()},u_(i.media(),!!s)))};l()}this.trigger("loadedplaylist")},t}(k1e),yr={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30},R1e=function(t){for(var n=new Uint8Array(new ArrayBuffer(t.length)),r=0;r-1):!1},this.trigger=function(L){var R,B,G,Q;if(R=C[L],!!R)if(arguments.length===2)for(G=R.length,B=0;B"u")){for(ee in N)N.hasOwnProperty(ee)&&(N[ee]=[ee.charCodeAt(0),ee.charCodeAt(1),ee.charCodeAt(2),ee.charCodeAt(3)]);K=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),q=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),Y=new Uint8Array([0,0,0,1]),$=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]),j=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]),W={video:$,audio:j},re=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),X=new Uint8Array([0,0,0,0,0,0,0,0]),le=new Uint8Array([0,0,0,0,0,0,0,0]),ne=le,be=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),_e=le,H=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),o=function(C){var L=[],R=0,B,G,Q;for(B=1;B>>1,C.samplingfrequencyindex<<7|C.channelcount<<3,6,1,2]))},u=function(){return o(N.ftyp,K,Y,K,q)},w=function(C){return o(N.hdlr,W[C])},c=function(C){return o(N.mdat,C)},_=function(C){var L=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,C.duration>>>24&255,C.duration>>>16&255,C.duration>>>8&255,C.duration&255,85,196,0,0]);return C.samplerate&&(L[12]=C.samplerate>>>24&255,L[13]=C.samplerate>>>16&255,L[14]=C.samplerate>>>8&255,L[15]=C.samplerate&255),o(N.mdhd,L)},b=function(C){return o(N.mdia,_(C),w(C.type),p(C))},d=function(C){return o(N.mfhd,new Uint8Array([0,0,0,0,(C&4278190080)>>24,(C&16711680)>>16,(C&65280)>>8,C&255]))},p=function(C){return o(N.minf,C.type==="video"?o(N.vmhd,H):o(N.smhd,X),s(),A(C))},h=function(C,L){for(var R=[],B=L.length;B--;)R[B]=D(L[B]);return o.apply(null,[N.moof,d(C)].concat(R))},v=function(C){for(var L=C.length,R=[];L--;)R[L]=y(C[L]);return o.apply(null,[N.moov,g(4294967295)].concat(R).concat(m(C)))},m=function(C){for(var L=C.length,R=[];L--;)R[L]=O(C[L]);return o.apply(null,[N.mvex].concat(R))},g=function(C){var L=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(C&4278190080)>>24,(C&16711680)>>16,(C&65280)>>8,C&255,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 o(N.mvhd,L)},S=function(C){var L=C.samples||[],R=new Uint8Array(4+L.length),B,G;for(G=0;G>>8),Q.push(B[ge].byteLength&255),Q=Q.concat(Array.prototype.slice.call(B[ge]));for(ge=0;ge>>8),se.push(G[ge].byteLength&255),se=se.concat(Array.prototype.slice.call(G[ge]));if(ke=[N.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,(R.width&65280)>>8,R.width&255,(R.height&65280)>>8,R.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o(N.avcC,new Uint8Array([1,R.profileIdc,R.profileCompatibility,R.levelIdc,255].concat([B.length],Q,[G.length],se))),o(N.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],R.sarRatio){var Ee=R.sarRatio[0],Re=R.sarRatio[1];ke.push(o(N.pasp,new Uint8Array([(Ee&4278190080)>>24,(Ee&16711680)>>16,(Ee&65280)>>8,Ee&255,(Re&4278190080)>>24,(Re&16711680)>>16,(Re&65280)>>8,Re&255])))}return o.apply(null,ke)},C=function(R){return o(N.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(R.channelcount&65280)>>8,R.channelcount&255,(R.samplesize&65280)>>8,R.samplesize&255,0,0,0,0,(R.samplerate&65280)>>8,R.samplerate&255,0,0]),l(R))}}(),T=function(C){var L=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(C.id&4278190080)>>24,(C.id&16711680)>>16,(C.id&65280)>>8,C.id&255,0,0,0,0,(C.duration&4278190080)>>24,(C.duration&16711680)>>16,(C.duration&65280)>>8,C.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,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,(C.width&65280)>>8,C.width&255,0,0,(C.height&65280)>>8,C.height&255,0,0]);return o(N.tkhd,L)},D=function(C){var L,R,B,G,Q,se,ge;return L=o(N.tfhd,new Uint8Array([0,0,0,58,(C.id&4278190080)>>24,(C.id&16711680)>>16,(C.id&65280)>>8,C.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),se=Math.floor(C.baseMediaDecodeTime/i),ge=Math.floor(C.baseMediaDecodeTime%i),R=o(N.tfdt,new Uint8Array([1,0,0,0,se>>>24&255,se>>>16&255,se>>>8&255,se&255,ge>>>24&255,ge>>>16&255,ge>>>8&255,ge&255])),Q=32+20+8+16+8+8,C.type==="audio"?(B=V(C,Q),o(N.traf,L,R,B)):(G=S(C),B=V(C,G.length+Q),o(N.traf,L,R,B,G))},y=function(C){return C.duration=C.duration||4294967295,o(N.trak,T(C),b(C))},O=function(C){var L=new Uint8Array([0,0,0,0,(C.id&4278190080)>>24,(C.id&16711680)>>16,(C.id&65280)>>8,C.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return C.type!=="video"&&(L[L.length-1]=0),o(N.trex,L)},function(){var ee,C,L;L=function(B,G){var Q=0,se=0,ge=0,ke=0;return B.length&&(B[0].duration!==void 0&&(Q=1),B[0].size!==void 0&&(se=2),B[0].flags!==void 0&&(ge=4),B[0].compositionTimeOffset!==void 0&&(ke=8)),[0,0,Q|se|ge|ke,1,(B.length&4278190080)>>>24,(B.length&16711680)>>>16,(B.length&65280)>>>8,B.length&255,(G&4278190080)>>>24,(G&16711680)>>>16,(G&65280)>>>8,G&255]},C=function(B,G){var Q,se,ge,ke,Ee,Re;for(ke=B.samples||[],G+=8+12+16*ke.length,ge=L(ke,G),se=new Uint8Array(ge.length+ke.length*16),se.set(ge),Q=ge.length,Re=0;Re>>24,se[Q++]=(Ee.duration&16711680)>>>16,se[Q++]=(Ee.duration&65280)>>>8,se[Q++]=Ee.duration&255,se[Q++]=(Ee.size&4278190080)>>>24,se[Q++]=(Ee.size&16711680)>>>16,se[Q++]=(Ee.size&65280)>>>8,se[Q++]=Ee.size&255,se[Q++]=Ee.flags.isLeading<<2|Ee.flags.dependsOn,se[Q++]=Ee.flags.isDependedOn<<6|Ee.flags.hasRedundancy<<4|Ee.flags.paddingValue<<1|Ee.flags.isNonSyncSample,se[Q++]=Ee.flags.degradationPriority&61440,se[Q++]=Ee.flags.degradationPriority&15,se[Q++]=(Ee.compositionTimeOffset&4278190080)>>>24,se[Q++]=(Ee.compositionTimeOffset&16711680)>>>16,se[Q++]=(Ee.compositionTimeOffset&65280)>>>8,se[Q++]=Ee.compositionTimeOffset&255;return o(N.trun,se)},ee=function(B,G){var Q,se,ge,ke,Ee,Re;for(ke=B.samples||[],G+=8+12+8*ke.length,ge=L(ke,G),Q=new Uint8Array(ge.length+ke.length*8),Q.set(ge),se=ge.length,Re=0;Re>>24,Q[se++]=(Ee.duration&16711680)>>>16,Q[se++]=(Ee.duration&65280)>>>8,Q[se++]=Ee.duration&255,Q[se++]=(Ee.size&4278190080)>>>24,Q[se++]=(Ee.size&16711680)>>>16,Q[se++]=(Ee.size&65280)>>>8,Q[se++]=Ee.size&255;return o(N.trun,Q)},V=function(B,G){return B.type==="audio"?ee(B,G):C(B,G)}}();var ve={ftyp:u,mdat:c,moof:h,moov:v,initSegment:function(C){var L=u(),R=v(C),B;return B=new Uint8Array(L.byteLength+R.byteLength),B.set(L),B.set(R,L.byteLength),B}},te=function(C){var L,R,B=[],G=[];for(G.byteLength=0,G.nalCount=0,G.duration=0,B.byteLength=0,L=0;L1&&(L=C.shift(),C.byteLength-=L.byteLength,C.nalCount-=L.nalCount,C[0][0].dts=L.dts,C[0][0].pts=L.pts,C[0][0].duration+=L.duration),C},Fe=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},Pe=function(C,L){var R=Fe();return R.dataOffset=L,R.compositionTimeOffset=C.pts-C.dts,R.duration=C.duration,R.size=4*C.length,R.size+=C.byteLength,C.keyFrame&&(R.flags.dependsOn=2,R.flags.isNonSyncSample=0),R},ye=function(C,L){var R,B,G,Q,se,ge=L||0,ke=[];for(R=0;RNt.ONE_SECOND_IN_TS/2))){for(Ee=je()[C.samplerate],Ee||(Ee=L[0].data),Re=0;Re=R?C:(L.minSegmentDts=1/0,C.filter(function(B){return B.dts>=R?(L.minSegmentDts=Math.min(L.minSegmentDts,B.dts),L.minSegmentPts=L.minSegmentDts,!0):!1}))},Me=function(C){var L,R,B=[];for(L=0;L=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(ee),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},ka.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},ka.prototype.addText=function(ee){this.rows[this.rowIdx]+=ee},ka.prototype.backspace=function(){if(!this.isEmpty()){var ee=this.rows[this.rowIdx];this.rows[this.rowIdx]=ee.substr(0,ee.length-1)}};var cs=function(C,L,R){this.serviceNum=C,this.text="",this.currentWindow=new ka(-1),this.windows=[],this.stream=R,typeof L=="string"&&this.createTextDecoder(L)};cs.prototype.init=function(ee,C){this.startPts=ee;for(var L=0;L<8;L++)this.windows[L]=new ka(L),typeof C=="function"&&(this.windows[L].beforeRowOverflow=C)},cs.prototype.setCurrentWindow=function(ee){this.currentWindow=this.windows[ee]},cs.prototype.createTextDecoder=function(ee){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(ee)}catch(C){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+ee+" encoding. "+C})}};var Sn=function ee(C){C=C||{},ee.prototype.init.call(this);var L=this,R=C.captionServices||{},B={},G;Object.keys(R).forEach(function(Q){G=R[Q],/^SERVICE/.test(Q)&&(B[Q]=G.encoding)}),this.serviceEncodings=B,this.current708Packet=null,this.services={},this.push=function(Q){Q.type===3?(L.new708Packet(),L.add708Bytes(Q)):(L.current708Packet===null&&L.new708Packet(),L.add708Bytes(Q))}};Sn.prototype=new t,Sn.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Sn.prototype.add708Bytes=function(ee){var C=ee.ccData,L=C>>>8,R=C&255;this.current708Packet.ptsVals.push(ee.pts),this.current708Packet.data.push(L),this.current708Packet.data.push(R)},Sn.prototype.push708Packet=function(){var ee=this.current708Packet,C=ee.data,L=null,R=null,B=0,G=C[B++];for(ee.seq=G>>6,ee.sizeCode=G&63;B>5,R=G&31,L===7&&R>0&&(G=C[B++],L=G),this.pushServiceBlock(L,B,R),R>0&&(B+=R-1)},Sn.prototype.pushServiceBlock=function(ee,C,L){var R,B=C,G=this.current708Packet.data,Q=this.services[ee];for(Q||(Q=this.initService(ee,B));B>5,G.rowLock=(R&16)>>4,G.columnLock=(R&8)>>3,G.priority=R&7,R=L[++ee],G.relativePositioning=(R&128)>>7,G.anchorVertical=R&127,R=L[++ee],G.anchorHorizontal=R,R=L[++ee],G.anchorPoint=(R&240)>>4,G.rowCount=R&15,R=L[++ee],G.columnCount=R&63,R=L[++ee],G.windowStyle=(R&56)>>3,G.penStyle=R&7,G.virtualRowCount=G.rowCount+1,ee},Sn.prototype.setWindowAttributes=function(ee,C){var L=this.current708Packet.data,R=L[ee],B=C.currentWindow.winAttr;return R=L[++ee],B.fillOpacity=(R&192)>>6,B.fillRed=(R&48)>>4,B.fillGreen=(R&12)>>2,B.fillBlue=R&3,R=L[++ee],B.borderType=(R&192)>>6,B.borderRed=(R&48)>>4,B.borderGreen=(R&12)>>2,B.borderBlue=R&3,R=L[++ee],B.borderType+=(R&128)>>5,B.wordWrap=(R&64)>>6,B.printDirection=(R&48)>>4,B.scrollDirection=(R&12)>>2,B.justify=R&3,R=L[++ee],B.effectSpeed=(R&240)>>4,B.effectDirection=(R&12)>>2,B.displayEffect=R&3,ee},Sn.prototype.flushDisplayed=function(ee,C){for(var L=[],R=0;R<8;R++)C.windows[R].visible&&!C.windows[R].isEmpty()&&L.push(C.windows[R].getText());C.endPts=ee,C.text=L.join(`
-
-`),this.pushCaption(C),C.startPts=ee},Sn.prototype.pushCaption=function(ee){ee.text!==""&&(this.trigger("data",{startPts:ee.startPts,endPts:ee.endPts,text:ee.text,stream:"cc708_"+ee.serviceNum}),ee.text="",ee.startPts=ee.endPts)},Sn.prototype.displayWindows=function(ee,C){var L=this.current708Packet.data,R=L[++ee],B=this.getPts(ee);this.flushDisplayed(B,C);for(var G=0;G<8;G++)R&1<>4,B.offset=(R&12)>>2,B.penSize=R&3,R=L[++ee],B.italics=(R&128)>>7,B.underline=(R&64)>>6,B.edgeType=(R&56)>>3,B.fontStyle=R&7,ee},Sn.prototype.setPenColor=function(ee,C){var L=this.current708Packet.data,R=L[ee],B=C.currentWindow.penColor;return R=L[++ee],B.fgOpacity=(R&192)>>6,B.fgRed=(R&48)>>4,B.fgGreen=(R&12)>>2,B.fgBlue=R&3,R=L[++ee],B.bgOpacity=(R&192)>>6,B.bgRed=(R&48)>>4,B.bgGreen=(R&12)>>2,B.bgBlue=R&3,R=L[++ee],B.edgeRed=(R&48)>>4,B.edgeGreen=(R&12)>>2,B.edgeBlue=R&3,ee},Sn.prototype.setPenLocation=function(ee,C){var L=this.current708Packet.data,R=L[ee],B=C.currentWindow.penLoc;return C.currentWindow.pendingNewLine=!0,R=L[++ee],B.row=R&15,R=L[++ee],B.column=R&63,ee},Sn.prototype.reset=function(ee,C){var L=this.getPts(ee);return this.flushDisplayed(L,C),this.initService(C.serviceNum,ee)};var td={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Ke=function(C){return C===null?"":(C=td[C]||C,String.fromCharCode(C))},yt=14,Zt=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],xn=function(){for(var C=[],L=yt+1;L--;)C.push("");return C},an=function ee(C,L){ee.prototype.init.call(this),this.field_=C||0,this.dataChannel_=L||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(R){var B,G,Q,se,ge;if(B=R.ccData&32639,B===this.lastControlCode_){this.lastControlCode_=null;return}if((B&61440)===4096?this.lastControlCode_=B:B!==this.PADDING_&&(this.lastControlCode_=null),Q=B>>>8,se=B&255,B!==this.PADDING_)if(B===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(B===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(R.pts),this.flushDisplayed(R.pts),G=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=G,this.startPts_=R.pts;else if(B===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(R.pts);else if(B===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(R.pts);else if(B===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(R.pts);else if(B===this.CARRIAGE_RETURN_)this.clearFormatting(R.pts),this.flushDisplayed(R.pts),this.shiftRowsUp_(),this.startPts_=R.pts;else if(B===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(B===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(R.pts),this.displayed_=xn();else if(B===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=xn();else if(B===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(R.pts),this.displayed_=xn()),this.mode_="paintOn",this.startPts_=R.pts;else if(this.isSpecialCharacter(Q,se))Q=(Q&3)<<8,ge=Ke(Q|se),this[this.mode_](R.pts,ge),this.column_++;else if(this.isExtCharacter(Q,se))this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),Q=(Q&3)<<8,ge=Ke(Q|se),this[this.mode_](R.pts,ge),this.column_++;else if(this.isMidRowCode(Q,se))this.clearFormatting(R.pts),this[this.mode_](R.pts," "),this.column_++,(se&14)===14&&this.addFormatting(R.pts,["i"]),(se&1)===1&&this.addFormatting(R.pts,["u"]);else if(this.isOffsetControlCode(Q,se))this.column_+=se&3;else if(this.isPAC(Q,se)){var ke=Zt.indexOf(B&7968);this.mode_==="rollUp"&&(ke-this.rollUpRows_+1<0&&(ke=this.rollUpRows_-1),this.setRollUp(R.pts,ke)),ke!==this.row_&&(this.clearFormatting(R.pts),this.row_=ke),se&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(R.pts,["u"]),(B&16)===16&&(this.column_=((B&14)>>1)*4),this.isColorPAC(se)&&(se&14)===14&&this.addFormatting(R.pts,["i"])}else this.isNormalChar(Q)&&(se===0&&(se=null),ge=Ke(Q),ge+=Ke(se),this[this.mode_](R.pts,ge),this.column_+=ge.length)}};an.prototype=new t,an.prototype.flushDisplayed=function(ee){var C=this.displayed_.map(function(L,R){try{return L.trim()}catch{return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+R+"."}),""}},this).join(`
-`).replace(/^\n+|\n+$/g,"");C.length&&this.trigger("data",{startPts:this.startPts_,endPts:ee,text:C,stream:this.name_})},an.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=xn(),this.nonDisplayed_=xn(),this.lastControlCode_=null,this.column_=0,this.row_=yt,this.rollUpRows_=2,this.formatting_=[]},an.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},an.prototype.isSpecialCharacter=function(ee,C){return ee===this.EXT_&&C>=48&&C<=63},an.prototype.isExtCharacter=function(ee,C){return(ee===this.EXT_+1||ee===this.EXT_+2)&&C>=32&&C<=63},an.prototype.isMidRowCode=function(ee,C){return ee===this.EXT_&&C>=32&&C<=47},an.prototype.isOffsetControlCode=function(ee,C){return ee===this.OFFSET_&&C>=33&&C<=35},an.prototype.isPAC=function(ee,C){return ee>=this.BASE_&&ee=64&&C<=127},an.prototype.isColorPAC=function(ee){return ee>=64&&ee<=79||ee>=96&&ee<=127},an.prototype.isNormalChar=function(ee){return ee>=32&&ee<=127},an.prototype.setRollUp=function(ee,C){if(this.mode_!=="rollUp"&&(this.row_=yt,this.mode_="rollUp",this.flushDisplayed(ee),this.nonDisplayed_=xn(),this.displayed_=xn()),C!==void 0&&C!==this.row_)for(var L=0;L