/**
* @license
* video.js 7.10.2
* copyright brightcove, inc.
* available under apache license version 2.0
*
*
* includes vtt.js
* available under apache license version 2.0
*
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("global/window"),require("global/document")):"function"==typeof define&&define.amd?define(["global/window","global/document"],t):(e=e||self).videojs=t(e.window,e.document)}(this,function(t,d){"use strict";t=t&&object.prototype.hasownproperty.call(t,"default")?t.default:t,d=d&&object.prototype.hasownproperty.call(d,"default")?d.default:d;var h="7.10.2",l=[],e=function(o,u){return function(e,t,i){var n=u.levels[t],r=new regexp("^("+n+")$");if("log"!==e&&i.unshift(e.touppercase()+":"),i.unshift(o+":"),l){l.push([].concat(i));var a=l.length-1e3;l.splice(0,0',i=n.firstchild,n.setattribute("style","display:none; position:absolute;"),d.body.appendchild(n));for(var a={},s=0;sx',e=t.firstchild.href}return e}function vt(e){if("string"==typeof e){var t=/^(\/?)([\s\s]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(t)return t.pop().tolowercase()}return""}function qt(e,t){void 0===t&&(t=t.location);var i=bt(e);return(":"===i.protocol?t.protocol:i.protocol)+i.host!==t.protocol+t.host}var ht=function(n){function e(e){var t;void 0===e&&(e=[]);for(var i=e.length-1;0<=i;i--)if(e[i].enabled){ut(e,e[i]);break}return(t=n.call(this,e)||this).changing_=!1,t}ge(e,n);var t=e.prototype;return t.addtrack=function(e){var t=this;e.enabled&&ut(this,e),n.prototype.addtrack.call(this,e),e.addeventlistener&&(e.enabledchange_=function(){t.changing_||(t.changing_=!0,ut(t,e),t.changing_=!1,t.trigger("change"))},e.addeventlistener("enabledchange",e.enabledchange_))},t.removetrack=function(e){n.prototype.removetrack.call(this,e),e.removeeventlistener&&e.enabledchange_&&(e.removeeventlistener("enabledchange",e.enabledchange_),e.enabledchange_=null)},e}(rt),wt=function(n){function e(e){var t;void 0===e&&(e=[]);for(var i=e.length-1;0<=i;i--)if(e[i].selected){ft(e,e[i]);break}return(t=n.call(this,e)||this).changing_=!1,object.defineproperty(ve(t),"selectedindex",{get:function(){for(var e=0;e
* copyright (c) 2014 david björklund
* available under the mit license
*
*/,ti=object.prototype.tostring;var ii=function(e){var r={};return e&&e.trim().split("\n").foreach(function(e){var t=e.indexof(":"),i=e.slice(0,t).trim().tolowercase(),n=e.slice(t+1).trim();"undefined"==typeof r[i]?r[i]=n:array.isarray(r[i])?r[i].push(n):r[i]=[r[i],n]}),r},ni=si,ri=si;function ai(e,t,i){var n=e;return ei(t)?(i=t,"string"==typeof e&&(n={uri:e})):n=m({},t,{uri:e}),n.callback=i,n}function si(e,t,i){return oi(t=ai(e,t,i))}function oi(n){if("undefined"==typeof n.callback)throw new error("callback argument missing");var r=!1,a=function(e,t,i){r||(r=!0,n.callback(e,t,i))};function t(e){return cleartimeout(o),e instanceof error||(e=new error(""+(e||"unknown xmlhttprequest error"))),e.statuscode=0,a(e,m)}function e(){if(!s){var e;cleartimeout(o),e=n.usexdr&&void 0===u.status?200:1223===u.status?204:u.status;var t=m,i=null;return 0!==e?(t={body:function(){var e=void 0;if(e=u.response?u.response:u.responsetext||function(e){try{if("document"===e.responsetype)return e.responsexml;var t=e.responsexml&&"parsererror"===e.responsexml.documentelement.nodename;if(""===e.responsetype&&!t)return e.responsexml}catch(e){}return null}(u),f)try{e=json.parse(e)}catch(e){}return e}(),statuscode:e,method:c,headers:{},url:l,rawrequest:u},u.getallresponseheaders&&(t.headers=ii(u.getallresponseheaders()))):i=new error("internal xmlhttprequest error"),a(i,t,t.body)}}var i,s,o,u=n.xhr||null,l=(u=u||(n.cors||n.usexdr?new si.xdomainrequest:new si.xmlhttprequest)).url=n.uri||n.url,c=u.method=n.method||"get",d=n.body||n.data,h=u.headers=n.headers||{},p=!!n.sync,f=!1,m={body:void 0,headers:{},statuscode:0,method:c,url:l,rawrequest:u};if("json"in n&&!1!==n.json&&(f=!0,h.accept||h.accept||(h.accept="application/json"),"get"!==c&&"head"!==c&&(h["content-type"]||h["content-type"]||(h["content-type"]="application/json"),d=json.stringify(!0===n.json?d:n.json))),u.onreadystatechange=function(){4===u.readystate&&settimeout(e,0)},u.onload=e,u.onerror=t,u.onprogress=function(){},u.onabort=function(){s=!0},u.ontimeout=t,u.open(c,l,!p,n.username,n.password),p||(u.withcredentials=!!n.withcredentials),!p&&0=e?t.push(r):r.starttime===r.endtime&&r.starttime<=e&&r.starttime+.5>=e&&t.push(r)}if(o=!1,t.length!==this.activecues_.length)o=!0;else for(var a=0;a]*>?)?/);return e=t[1]?t[1]:t[2],i=i.substr(e.length),e}function t(e,t){var i=ei[e];if(!i)return null;var n=a.document.createelement(i),r=ii[e];return r&&t&&(n[r]=t.trim()),n}for(var n,r,s,o,u=a.document.createelement("div"),l=u,c=[];null!==(n=e());)if("<"!==n[0])l.appendchild(a.document.createtextnode((r=n,ci.innerhtml=r,r=ci.textcontent,ci.textcontent="",r)));else{if("/"===n[1]){c.length&&c[c.length-1]===n.substr(2).replace(">","")&&(c.pop(),l=l.parentnode);continue}var d,h=bi(n.substr(1,n.length-2));if(h){d=a.document.createprocessinginstruction("timestamp",h),l.appendchild(d);continue}var p=n.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!p)continue;if(!(d=t(p[1],p[3])))continue;if(s=l,ai[(o=d).localname]&&ai[o.localname]!==s.localname)continue;if(p[2]){var f=p[2].split(".");f.foreach(function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(wi.hasownproperty(i)){var n=t?"background-color":"color",r=wi[i];d.style[n]=r}}),d.classname=f.join(" ")}c.push(p[1]),l.appendchild(d),l=d}return u}var pi=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function li(e){for(var t=0;t=i[0]&&e<=i[1])return!0}return!1}function oi(){}function di(e,t,i){oi.call(this),this.cue=t,this.cuediv=xi(e,t.text);var n={color:"rgba(255, 255, 255, 1)",backgroundcolor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingmode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodebidi:"plaintext"};this.applystyles(n,this.cuediv),this.div=e.document.createelement("div"),n={direction:function(e){var t=[],i="";if(!e||!e.childnodes)return"ltr";function r(e,t){for(var i=t.childnodes.length-1;0<=i;i--)e.push(t.childnodes[i])}function a(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textcontent||t.innertext;if(i){var n=i.match(/^.*(\n|\r)/);return n?n[e.length=0]:i}return"ruby"===t.tagname?a(e):t.childnodes?(r(e,t),a(e)):void 0}for(r(t,e);i=a(t);)for(var n=0;nd&&(c=c<0?-1:1,c*=math.ceil(d/l)*l),r<0&&(c+=""===n.vertical?o.height:o.width,a=a.reverse()),i.move(h,c)}else{var p=i.lineheight/o.height*100;switch(n.linealign){case"center":r-=p/2;break;case"end":r-=p}switch(n.vertical){case"":t.applystyles({top:t.formatstyle(r,"%")});break;case"rl":t.applystyles({left:t.formatstyle(r,"%")});break;case"lr":t.applystyles({right:t.formatstyle(r,"%")})}a=["+y","-x","+x","-y"],i=new mi(t)}var f=function(e,t){for(var i,n=new mi(e),r=1,a=0;ae.left&&this.tope.top},mi.prototype.overlapsany=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},mi.prototype.overlapsoppositeaxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},mi.prototype.intersectpercentage=function(e){return math.max(0,math.min(this.right,e.right)-math.max(this.left,e.left))*math.max(0,math.min(this.bottom,e.bottom)-math.max(this.top,e.top))/(this.height*this.width)},mi.prototype.tocsscompatvalues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},mi.getsimpleboxposition=function(e){var t=e.div?e.div.offsetheight:e.tagname?e.offsetheight:0,i=e.div?e.div.offsetwidth:e.tagname?e.offsetwidth:0,n=e.div?e.div.offsettop:e.tagname?e.offsettop:0;return{left:(e=e.div?e.div.getboundingclientrect():e.tagname?e.getboundingclientrect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},ni.stringdecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new error("error - expected string data.");return decodeuricomponent(encodeuricomponent(e))}}},ni.convertcuetodomtree=function(e,t){return e&&t?xi(e,t):null};ni.processcues=function(n,r,e){if(!n||!r||!e)return null;for(;e.firstchild;)e.removechild(e.firstchild);var a=n.document.createelement("div");if(a.style.position="absolute",a.style.left="0",a.style.right="0",a.style.top="0",a.style.bottom="0",a.style.margin="1.5%",e.appendchild(a),function(e){for(var t=0;t',classname:this.buildcssclass(),tabindex:0},t),"button"===e&&p.error("creating a clickablecomponent with an html element of "+e+" is not supported; use a button instead."),i=g({role:"button"},i),this.tabindex_=t.tabindex;var n=r.prototype.createel.call(this,e,t,i);return this.createcontroltextel(n),n},t.dispose=function(){this.controltextel_=null,r.prototype.dispose.call(this)},t.createcontroltextel=function(e){return this.controltextel_=k("span",{classname:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendchild(this.controltextel_),this.controltext(this.controltext_,e),this.controltextel_},t.controltext=function(e,t){if(void 0===t&&(t=this.el()),void 0===e)return this.controltext_||"need text";var i=this.localize(e);this.controltext_=e,c(this.controltextel_,i),this.noniconcontrol||t.setattribute("title",i)},t.buildcssclass=function(){return"vjs-control vjs-button "+r.prototype.buildcssclass.call(this)},t.enable=function(){this.enabled_||(this.enabled_=!0,this.removeclass("vjs-disabled"),this.el_.setattribute("aria-disabled","false"),"undefined"!=typeof this.tabindex_&&this.el_.setattribute("tabindex",this.tabindex_),this.on(["tap","click"],this.handleclick),this.on("keydown",this.handlekeydown))},t.disable=function(){this.enabled_=!1,this.addclass("vjs-disabled"),this.el_.setattribute("aria-disabled","true"),"undefined"!=typeof this.tabindex_&&this.el_.removeattribute("tabindex"),this.off("mouseover",this.handlemouseover),this.off("mouseout",this.handlemouseout),this.off(["tap","click"],this.handleclick),this.off("keydown",this.handlekeydown)},t.handleclick=function(e){this.options_.clickhandler&&this.options_.clickhandler.call(this,arguments)},t.handlekeydown=function(e){ot.iseventkey(e,"space")||ot.iseventkey(e,"enter")?(e.preventdefault(),e.stoppropagation(),this.trigger("click")):r.prototype.handlekeydown.call(this,e)},e}(je);je.registercomponent("clickablecomponent",ln);var cn=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).update(),e.on("posterchange",ve(ve(i),i.update)),i}ge(e,n);var t=e.prototype;return t.dispose=function(){this.player().off("posterchange",this.update),n.prototype.dispose.call(this)},t.createel=function(){return k("div",{classname:"vjs-poster",tabindex:-1})},t.update=function(e){var t=this.player().poster();this.setsrc(t),t?this.show():this.hide()},t.setsrc=function(e){var t="";e&&(t='url("'+e+'")'),this.el_.style.backgroundimage=t},t.handleclick=function(e){if(this.player_.controls()){var t=this.player_.usingplugin("eme")&&this.player_.eme.sessions&&0',classname:this.buildcssclass()},t),i=g({type:"button"},i);var n=je.prototype.createel.call(this,"button",t,i);return this.createcontroltextel(n),n},i.addchild=function(e,t){void 0===t&&(t={});var i=this.constructor.name;return p.warn("adding an actionable (user controllable) child to a button ("+i+") is not supported; use a clickablecomponent instead."),je.prototype.addchild.call(this,e,t)},i.enable=function(){t.prototype.enable.call(this),this.el_.removeattribute("disabled")},i.disable=function(){t.prototype.disable.call(this),this.el_.setattribute("disabled","disabled")},i.handlekeydown=function(e){ot.iseventkey(e,"space")||ot.iseventkey(e,"enter")?e.stoppropagation():t.prototype.handlekeydown.call(this,e)},e}(ln);je.registercomponent("button",vn);var yn=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).mouseused_=!1,i.on("mousedown",i.handlemousedown),i}ge(e,n);var t=e.prototype;return t.buildcssclass=function(){return"vjs-big-play-button"},t.handleclick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientx&&e.clienty){var i=this.player_.usingplugin("eme")&&this.player_.eme.sessions&&0'+this.localize(this.labeltext_)+" "});return this.contentel_=k("span",{classname:e+"-display"},{"aria-live":"off",role:"presentation"}),t.appendchild(this.contentel_),t},t.dispose=function(){this.contentel_=null,this.textnode_=null,n.prototype.dispose.call(this)},t.updatetextnode_=function(e){var t=this;void 0===e&&(e=0),e=kn(e),this.formattedtime_!==e&&(this.formattedtime_=e,this.requestnamedanimationframe("timedisplay#updatetextnode_",function(){if(t.contentel_){var e=t.textnode_;t.textnode_=d.createtextnode(t.formattedtime_),t.textnode_&&(e?t.contentel_.replacechild(t.textnode_,e):t.contentel_.appendchild(t.textnode_))}}))},t.updatecontent=function(e){},e}(je);cn.prototype.labeltext_="time",cn.prototype.controltext_="time",je.registercomponent("timedisplay",cn);var en=function(e){function t(){return e.apply(this,arguments)||this}ge(t,e);var i=t.prototype;return i.buildcssclass=function(){return"vjs-current-time"},i.updatecontent=function(e){var t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getcache().currenttime:this.player_.currenttime(),this.updatetextnode_(t)},t}(cn);en.prototype.labeltext_="current time",en.prototype.controltext_="current time",je.registercomponent("currenttimedisplay",en);var wn=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).on(e,"durationchange",i.updatecontent),i.on(e,"loadstart",i.updatecontent),i.on(e,"loadedmetadata",i.updatecontent),i}ge(e,n);var t=e.prototype;return t.buildcssclass=function(){return"vjs-duration"},t.updatecontent=function(e){var t=this.player_.duration();this.updatetextnode_(t)},e}(cn);wn.prototype.labeltext_="duration",wn.prototype.controltext_="duration",je.registercomponent("durationdisplay",wn);var in=function(e){function t(){return e.apply(this,arguments)||this}return ge(t,e),t.prototype.createel=function(){return e.prototype.createel.call(this,"div",{classname:"vjs-time-control vjs-time-divider",innerhtml:"/
"},{"aria-hidden":!0})},t}(je);je.registercomponent("timedivider",in);var an=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).on(e,"durationchange",i.updatecontent),i}ge(e,n);var t=e.prototype;return t.buildcssclass=function(){return"vjs-remaining-time"},t.createel=function(){var e=n.prototype.createel.call(this);return e.insertbefore(k("span",{},{"aria-hidden":!0},"-"),this.contentel_),e},t.updatecontent=function(e){var t;"number"==typeof this.player_.duration()&&(t=this.player_.ended()?0:this.player_.remainingtimedisplay?this.player_.remainingtimedisplay():this.player_.remainingtime(),this.updatetextnode_(t))},e}(cn);an.prototype.labeltext_="remaining time",an.prototype.controltext_="remaining time",je.registercomponent("remainingtimedisplay",an);var xn=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).updateshowing(),i.on(i.player(),"durationchange",i.updateshowing),i}ge(e,n);var t=e.prototype;return t.createel=function(){var e=n.prototype.createel.call(this,"div",{classname:"vjs-live-control vjs-control"});return this.contentel_=k("div",{classname:"vjs-live-display",innerhtml:''+this.localize("stream type")+" "+this.localize("live")},{"aria-live":"off"}),e.appendchild(this.contentel_),e},t.dispose=function(){this.contentel_=null,n.prototype.dispose.call(this)},t.updateshowing=function(e){this.player().duration()===1/0?this.show():this.hide()},e}(je);je.registercomponent("livedisplay",xn);var pn=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).updateliveedgestatus(),i.player_.livetracker&&i.on(i.player_.livetracker,"liveedgechange",i.updateliveedgestatus),i}ge(e,n);var t=e.prototype;return t.createel=function(){var e=n.prototype.createel.call(this,"button",{classname:"vjs-seek-to-live-control vjs-control"});return this.textel_=k("span",{classname:"vjs-seek-to-live-text",innerhtml:this.localize("live")},{"aria-hidden":"true"}),e.appendchild(this.textel_),e},t.updateliveedgestatus=function(){!this.player_.livetracker||this.player_.livetracker.atliveedge()?(this.setattribute("aria-disabled",!0),this.addclass("vjs-at-live-edge"),this.controltext("seek to live, currently playing live")):(this.setattribute("aria-disabled",!1),this.removeclass("vjs-at-live-edge"),this.controltext("seek to live, currently behind live"))},t.handleclick=function(){this.player_.livetracker.seektoliveedge()},t.dispose=function(){this.player_.livetracker&&this.off(this.player_.livetracker,"liveedgechange",this.updateliveedgestatus),this.textel_=null,n.prototype.dispose.call(this)},e}(vn);pn.prototype.controltext_="seek to live, currently playing live",je.registercomponent("seektolive",pn);function ln(e,t,i){return e=number(e),math.min(i,math.max(t,isnan(e)?t:e))}var on=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).bar=i.getchild(i.options_.barname),i.vertical(!!i.options_.vertical),i.enable(),i}ge(e,n);var t=e.prototype;return t.enabled=function(){return this.enabled_},t.enable=function(){this.enabled()||(this.on("mousedown",this.handlemousedown),this.on("touchstart",this.handlemousedown),this.on("keydown",this.handlekeydown),this.on("click",this.handleclick),this.on(this.player_,"controlsvisible",this.update),this.playerevent&&this.on(this.player_,this.playerevent,this.update),this.removeclass("disabled"),this.setattribute("tabindex",0),this.enabled_=!0)},t.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerdocument;this.off("mousedown",this.handlemousedown),this.off("touchstart",this.handlemousedown),this.off("keydown",this.handlekeydown),this.off("click",this.handleclick),this.off(this.player_,"controlsvisible",this.update),this.off(e,"mousemove",this.handlemousemove),this.off(e,"mouseup",this.handlemouseup),this.off(e,"touchmove",this.handlemousemove),this.off(e,"touchend",this.handlemouseup),this.removeattribute("tabindex"),this.addclass("disabled"),this.playerevent&&this.off(this.player_,this.playerevent,this.update),this.enabled_=!1}},t.createel=function(e,t,i){return void 0===t&&(t={}),void 0===i&&(i={}),t.classname=t.classname+" vjs-slider",t=g({tabindex:0},t),i=g({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabindex:0},i),n.prototype.createel.call(this,e,t,i)},t.handlemousedown=function(e){var t=this.bar.el_.ownerdocument;"mousedown"===e.type&&e.preventdefault(),"touchstart"!==e.type||nt||e.preventdefault(),r(),this.addclass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handlemousemove),this.on(t,"mouseup",this.handlemouseup),this.on(t,"touchmove",this.handlemousemove),this.on(t,"touchend",this.handlemouseup),this.handlemousemove(e)},t.handlemousemove=function(e){},t.handlemouseup=function(){var e=this.bar.el_.ownerdocument;n(),this.removeclass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handlemousemove),this.off(e,"mouseup",this.handlemouseup),this.off(e,"touchmove",this.handlemousemove),this.off(e,"touchend",this.handlemouseup),this.update()},t.update=function(){var t=this;if(this.el_&&this.bar){var i=this.getprogress();return i===this.progress_||(this.progress_=i,this.requestnamedanimationframe("slider#update",function(){var e=t.vertical()?"height":"width";t.bar.el().style[e]=(100*i).tofixed(2)+"%"})),i}},t.getprogress=function(){return number(ln(this.getpercent(),0,1).tofixed(4))},t.calculatedistance=function(e){var t=b(this.el_,e);return this.vertical()?t.y:t.x},t.handlekeydown=function(e){ot.iseventkey(e,"left")||ot.iseventkey(e,"down")?(e.preventdefault(),e.stoppropagation(),this.stepback()):ot.iseventkey(e,"right")||ot.iseventkey(e,"up")?(e.preventdefault(),e.stoppropagation(),this.stepforward()):n.prototype.handlekeydown.call(this,e)},t.handleclick=function(e){e.stoppropagation(),e.preventdefault()},t.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addclass("vjs-slider-vertical"):this.addclass("vjs-slider-horizontal")},e}(je);je.registercomponent("slider",on);function dn(e,t){return ln(e/t*100,0,100).tofixed(2)+"%"}var mn=function(r){function e(e,t){var i;return(i=r.call(this,e,t)||this).partels_=[],i.on(e,"progress",i.update),i}ge(e,r);var t=e.prototype;return t.createel=function(){var e=r.prototype.createel.call(this,"div",{classname:"vjs-load-progress"}),t=k("span",{classname:"vjs-control-text"}),i=k("span",{textcontent:this.localize("loaded")}),n=d.createtextnode(": ");return this.percentageel_=k("span",{classname:"vjs-control-text-loaded-percentage",textcontent:"0%"}),e.appendchild(t),t.appendchild(i),t.appendchild(n),t.appendchild(this.percentageel_),e},t.dispose=function(){this.partels_=null,this.percentageel_=null,r.prototype.dispose.call(this)},t.update=function(e){var d=this;this.requestnamedanimationframe("loadprogressbar#update",function(){var e=d.player_.livetracker,t=d.player_.buffered(),i=e&&e.islive()?e.seekableend():d.player_.duration(),n=d.player_.bufferedend(),r=d.partels_,a=dn(n,i);d.percent_!==a&&(d.el_.style.width=a,c(d.percentageel_,a),d.percent_=a);for(var s=0;st.length;c--)d.el_.removechild(r[c-1]);r.length=t.length})},e}(je);je.registercomponent("loadprogressbar",mn);var rn=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).update=ye(ve(ve(i),i.update),30),i}ge(e,n);var t=e.prototype;return t.createel=function(){return n.prototype.createel.call(this,"div",{classname:"vjs-time-tooltip"},{"aria-hidden":"true"})},t.update=function(e,t,i){var n=f(this.el_),r=u(this.player_.el()),a=e.width*t;if(r&&n){var s=e.left-r.left+a,o=e.width-a+(r.right-e.right),u=n.width/2;sn.width&&(u=n.width),this.el_.style.right="-"+u+"px",this.write(i)}},t.write=function(e){c(this.el_,e)},t.updatetime=function(r,a,s,o){var u=this;this.requestnamedanimationframe("timetooltip#updatetime",function(){var e,t=u.player_.duration();if(u.player_.livetracker&&u.player_.livetracker.islive()){var i=u.player_.livetracker.livewindow(),n=i-a*i;e=(n<1?"":"-")+kn(n,i)}else e=kn(s,t);u.update(r,a,e),o&&o()})},e}(je);je.registercomponent("timetooltip",rn);var nn=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).update=ye(ve(ve(i),i.update),30),i}ge(e,n);var t=e.prototype;return t.createel=function(){return n.prototype.createel.call(this,"div",{classname:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},t.update=function(e,t){var i=this.getchild("timetooltip");if(i){var n=this.player_.scrubbing()?this.player_.getcache().currenttime:this.player_.currenttime();i.updatetime(e,t,n)}},e}(je);nn.prototype.options_={children:[]},dt||je||nn.prototype.options_.children.push("timetooltip"),je.registercomponent("playprogressbar",nn);var un=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).update=ye(ve(ve(i),i.update),30),i}ge(e,n);var t=e.prototype;return t.createel=function(){return n.prototype.createel.call(this,"div",{classname:"vjs-mouse-display"})},t.update=function(e,t){var i=this,n=t*this.player_.duration();this.getchild("timetooltip").updatetime(e,t,n,function(){i.el_.style.left=e.width*t+"px"})},e}(je);un.prototype.options_={children:["timetooltip"]},je.registercomponent("mousetimedisplay",un);var fn=function(a){function e(e,t){var i;return(i=a.call(this,e,t)||this).seteventhandlers_(),i}ge(e,a);var t=e.prototype;return t.seteventhandlers_=function(){this.update_=ve(this,this.update),this.update=ye(this.update_,30),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.livetracker&&this.on(this.player_.livetracker,"liveedgechange",this.update),this.updateinterval=null,this.on(this.player_,["playing"],this.enableinterval_),this.on(this.player_,["ended","pause","waiting"],this.disableinterval_),"hidden"in d&&"visibilitystate"in d&&this.on(d,"visibilitychange",this.togglevisibility_)},t.togglevisibility_=function(e){d.hidden?this.disableinterval_(e):(this.enableinterval_(),this.update())},t.enableinterval_=function(){this.updateinterval||(this.updateinterval=this.setinterval(this.update,30))},t.disableinterval_=function(e){this.player_.livetracker&&this.player_.livetracker.islive()&&e&&"ended"!==e.type||this.updateinterval&&(this.clearinterval(this.updateinterval),this.updateinterval=null)},t.createel=function(){return a.prototype.createel.call(this,"div",{classname:"vjs-progress-holder"},{"aria-label":this.localize("progress bar")})},t.update=function(e){var n=this,r=a.prototype.update.call(this);return this.requestnamedanimationframe("seekbar#update",function(){var e=n.player_.ended()?n.player_.duration():n.getcurrenttime_(),t=n.player_.livetracker,i=n.player_.duration();t&&t.islive()&&(i=n.player_.livetracker.livecurrenttime()),n.percent_!==r&&(n.el_.setattribute("aria-valuenow",(100*r).tofixed(2)),n.percent_=r),n.currenttime_===e&&n.duration_===i||(n.el_.setattribute("aria-valuetext",n.localize("progress bar timing: currenttime={1} duration={2}",[kn(e,i),kn(i,i)],"{1} of {2}")),n.currenttime_=e,n.duration_=i),n.bar&&n.bar.update(u(n.el()),n.getprogress())}),r},t.getcurrenttime_=function(){return this.player_.scrubbing()?this.player_.getcache().currenttime:this.player_.currenttime()},t.getpercent=function(){var e,t=this.getcurrenttime_(),i=this.player_.livetracker;return i&&i.islive()?(e=(t-i.seekablestart())/i.livewindow(),i.atliveedge()&&(e=1)):e=t/this.player_.duration(),e},t.handlemousedown=function(e){z(e)&&(e.stoppropagation(),this.player_.scrubbing(!0),this.videowasplaying=!this.player_.paused(),this.player_.pause(),a.prototype.handlemousedown.call(this,e))},t.handlemousemove=function(e){if(z(e)){var t,i=this.calculatedistance(e),n=this.player_.livetracker;if(n&&n.islive()){if(.99<=i)return void n.seektoliveedge();var r=n.seekablestart(),a=n.livecurrenttime();if(a<=(t=r+i*n.livewindow())&&(t=a),t<=r&&(t=r+.1),t===1/0)return}else(t=i*this.player_.duration())===this.player_.duration()&&(t-=.1);this.player_.currenttime(t)}},t.enable=function(){a.prototype.enable.call(this);var e=this.getchild("mousetimedisplay");e&&e.show()},t.disable=function(){a.prototype.disable.call(this);var e=this.getchild("mousetimedisplay");e&&e.hide()},t.handlemouseup=function(e){a.prototype.handlemouseup.call(this,e),e&&e.stoppropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallytriggered:!0}),this.videowasplaying?at(this.player_.play()):this.update_()},t.stepforward=function(){this.player_.currenttime(this.player_.currenttime()+5)},t.stepback=function(){this.player_.currenttime(this.player_.currenttime()-5)},t.handleaction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.handlekeydown=function(e){if(ot.iseventkey(e,"space")||ot.iseventkey(e,"enter"))e.preventdefault(),e.stoppropagation(),this.handleaction(e);else if(ot.iseventkey(e,"home"))e.preventdefault(),e.stoppropagation(),this.player_.currenttime(0);else if(ot.iseventkey(e,"end"))e.preventdefault(),e.stoppropagation(),this.player_.currenttime(this.player_.duration());else if(/^[0-9]$/.test(ot(e))){e.preventdefault(),e.stoppropagation();var t=10*(ot.codes[ot(e)]-ot.codes[0])/100;this.player_.currenttime(this.player_.duration()*t)}else ot.iseventkey(e,"pgdn")?(e.preventdefault(),e.stoppropagation(),this.player_.currenttime(this.player_.currenttime()-60)):ot.iseventkey(e,"pgup")?(e.preventdefault(),e.stoppropagation(),this.player_.currenttime(this.player_.currenttime()+60)):a.prototype.handlekeydown.call(this,e)},t.dispose=function(){this.disableinterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.livetracker&&this.on(this.player_.livetracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableinterval_),this.off(this.player_,["ended","pause","waiting"],this.disableinterval_),"hidden"in d&&"visibilitystate"in d&&this.off(d,"visibilitychange",this.togglevisibility_),a.prototype.dispose.call(this)},e}(on);fn.prototype.options_={children:["loadprogressbar","playprogressbar"],barname:"playprogressbar"},dt||je||fn.prototype.options_.children.splice(1,0,"mousetimedisplay"),je.registercomponent("seekbar",fn);var bn=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).handlemousemove=ye(ve(ve(i),i.handlemousemove),30),i.throttledhandlemouseseek=ye(ve(ve(i),i.handlemouseseek),30),i.enable(),i}ge(e,n);var t=e.prototype;return t.createel=function(){return n.prototype.createel.call(this,"div",{classname:"vjs-progress-control vjs-control"})},t.handlemousemove=function(e){var t=this.getchild("seekbar");if(t){var i=t.getchild("playprogressbar"),n=t.getchild("mousetimedisplay");if(i||n){var r=t.el(),a=f(r),s=b(r,e).x;s=ln(s,0,1),n&&n.update(a,s),i&&i.update(a,t.getprogress())}}},t.handlemouseseek=function(e){var t=this.getchild("seekbar");t&&t.handlemousemove(e)},t.enabled=function(){return this.enabled_},t.disable=function(){this.children().foreach(function(e){return e.disable&&e.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handlemousedown),this.off(this.el_,"mousemove",this.handlemousemove),this.handlemouseup(),this.addclass("disabled"),this.enabled_=!1)},t.enable=function(){this.children().foreach(function(e){return e.enable&&e.enable()}),this.enabled()||(this.on(["mousedown","touchstart"],this.handlemousedown),this.on(this.el_,"mousemove",this.handlemousemove),this.removeclass("disabled"),this.enabled_=!0)},t.handlemousedown=function(e){var t=this.el_.ownerdocument,i=this.getchild("seekbar");i&&i.handlemousedown(e),this.on(t,"mousemove",this.throttledhandlemouseseek),this.on(t,"touchmove",this.throttledhandlemouseseek),this.on(t,"mouseup",this.handlemouseup),this.on(t,"touchend",this.handlemouseup)},t.handlemouseup=function(e){var t=this.el_.ownerdocument,i=this.getchild("seekbar");i&&i.handlemouseup(e),this.off(t,"mousemove",this.throttledhandlemouseseek),this.off(t,"touchmove",this.throttledhandlemouseseek),this.off(t,"mouseup",this.handlemouseup),this.off(t,"touchend",this.handlemouseup)},e}(je);bn.prototype.options_={children:["seekbar"]},je.registercomponent("progresscontrol",bn);var jn=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).on(e,["enterpictureinpicture","leavepictureinpicture"],i.handlepictureinpicturechange),i.on(e,["disablepictureinpicturechanged","loadedmetadata"],i.handlepictureinpictureenabledchange),i.disable(),i}ge(e,n);var t=e.prototype;return t.buildcssclass=function(){return"vjs-picture-in-picture-control "+n.prototype.buildcssclass.call(this)},t.handlepictureinpictureenabledchange=function(){d.pictureinpictureenabled&&!1===this.player_.disablepictureinpicture()?this.enable():this.disable()},t.handlepictureinpicturechange=function(e){this.player_.isinpictureinpicture()?this.controltext("exit picture-in-picture"):this.controltext("picture-in-picture"),this.handlepictureinpictureenabledchange()},t.handleclick=function(e){this.player_.isinpictureinpicture()?this.player_.exitpictureinpicture():this.player_.requestpictureinpicture()},e}(vn);jn.prototype.controltext_="picture-in-picture",je.registercomponent("pictureinpicturetoggle",jn);var vn=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).on(e,"fullscreenchange",i.handlefullscreenchange),!1===d[e.fsapi_.fullscreenenabled]&&i.disable(),i}ge(e,n);var t=e.prototype;return t.buildcssclass=function(){return"vjs-fullscreen-control "+n.prototype.buildcssclass.call(this)},t.handlefullscreenchange=function(e){this.player_.isfullscreen()?this.controltext("non-fullscreen"):this.controltext("fullscreen")},t.handleclick=function(e){this.player_.isfullscreen()?this.player_.exitfullscreen():this.player_.requestfullscreen()},e}(vn);vn.prototype.controltext_="fullscreen",je.registercomponent("fullscreentoggle",vn);var qn=function(e){function t(){return e.apply(this,arguments)||this}return ge(t,e),t.prototype.createel=function(){return e.prototype.createel.call(this,"div",{classname:"vjs-volume-level",innerhtml:''})},t}(je);je.registercomponent("volumelevel",qn);var hn=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).on("slideractive",i.updatelastvolume_),i.on(e,"volumechange",i.updateariaattributes),e.ready(function(){return i.updateariaattributes()}),i}ge(e,n);var t=e.prototype;return t.createel=function(){return n.prototype.createel.call(this,"div",{classname:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("volume level"),"aria-live":"polite"})},t.handlemousedown=function(e){z(e)&&n.prototype.handlemousedown.call(this,e)},t.handlemousemove=function(e){z(e)&&(this.checkmuted(),this.player_.volume(this.calculatedistance(e)))},t.checkmuted=function(){this.player_.muted()&&this.player_.muted(!1)},t.getpercent=function(){return this.player_.muted()?0:this.player_.volume()},t.stepforward=function(){this.checkmuted(),this.player_.volume(this.player_.volume()+.1)},t.stepback=function(){this.checkmuted(),this.player_.volume(this.player_.volume()-.1)},t.updateariaattributes=function(e){var t=this.player_.muted()?0:this.volumeaspercentage_();this.el_.setattribute("aria-valuenow",t),this.el_.setattribute("aria-valuetext",t+"%")},t.volumeaspercentage_=function(){return math.round(100*this.player_.volume())},t.updatelastvolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",function(){0===e.player_.volume()&&e.player_.lastvolume_(t)})},e}(on);hn.prototype.options_={children:["volumelevel"],barname:"volumelevel"},hn.prototype.playerevent="volumechange",je.registercomponent("volumebar",hn);var wn=function(n){function e(e,t){var i;return void 0===t&&(t={}),t.vertical=t.vertical||!1,"undefined"!=typeof t.volumebar&&!o(t.volumebar)||(t.volumebar=t.volumebar||{},t.volumebar.vertical=t.vertical),i=n.call(this,e,t)||this,function(e,t){t.tech_&&!t.tech_.featuresvolumecontrol&&e.addclass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresvolumecontrol?e.removeclass("vjs-hidden"):e.addclass("vjs-hidden")})}(ve(i),e),i.throttledhandlemousemove=ye(ve(ve(i),i.handlemousemove),30),i.on("mousedown",i.handlemousedown),i.on("touchstart",i.handlemousedown),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}ge(e,n);var t=e.prototype;return t.createel=function(){var e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),n.prototype.createel.call(this,"div",{classname:"vjs-volume-control vjs-control "+e})},t.handlemousedown=function(e){var t=this.el_.ownerdocument;this.on(t,"mousemove",this.throttledhandlemousemove),this.on(t,"touchmove",this.throttledhandlemousemove),this.on(t,"mouseup",this.handlemouseup),this.on(t,"touchend",this.handlemouseup)},t.handlemouseup=function(e){var t=this.el_.ownerdocument;this.off(t,"mousemove",this.throttledhandlemousemove),this.off(t,"touchmove",this.throttledhandlemousemove),this.off(t,"mouseup",this.handlemouseup),this.off(t,"touchend",this.handlemouseup)},t.handlemousemove=function(e){this.volumebar.handlemousemove(e)},e}(je);wn.prototype.options_={children:["volumebar"]},je.registercomponent("volumecontrol",wn);var zn=function(n){function e(e,t){var i;return i=n.call(this,e,t)||this,function(e,t){t.tech_&&!t.tech_.featuresmutecontrol&&e.addclass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresmutecontrol?e.removeclass("vjs-hidden"):e.addclass("vjs-hidden")})}(ve(i),e),i.on(e,["loadstart","volumechange"],i.update),i}ge(e,n);var t=e.prototype;return t.buildcssclass=function(){return"vjs-mute-control "+n.prototype.buildcssclass.call(this)},t.handleclick=function(e){var t=this.player_.volume(),i=this.player_.lastvolume_();if(0===t){var n=i<.1?.1:i;this.player_.volume(n),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},t.update=function(e){this.updateicon_(),this.updatecontroltext_()},t.updateicon_=function(){var e=this.player_.volume(),t=3;dt&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var i=0;i<4;i++)a(this.el_,"vjs-vol-"+i);i(this.el_,"vjs-vol-"+t)},t.updatecontroltext_=function(){var e=this.player_.muted()||0===this.player_.volume()?"unmute":"mute";this.controltext()!==e&&this.controltext(e)},e}(vn);zn.prototype.controltext_="mute",je.registercomponent("mutetoggle",zn);var gn=function(n){function e(e,t){var i;return void 0===t&&(t={}),"undefined"!=typeof t.inline?t.inline=t.inline:t.inline=!0,"undefined"!=typeof t.volumecontrol&&!o(t.volumecontrol)||(t.volumecontrol=t.volumecontrol||{},t.volumecontrol.vertical=!t.inline),(i=n.call(this,e,t)||this).on(e,["loadstart"],i.volumepanelstate_),i.on(i.mutetoggle,"keyup",i.handlekeypress),i.on(i.volumecontrol,"keyup",i.handlevolumecontrolkeyup),i.on("keydown",i.handlekeypress),i.on("mouseover",i.handlemouseover),i.on("mouseout",i.handlemouseout),i.on(i.volumecontrol,["slideractive"],i.slideractive_),i.on(i.volumecontrol,["sliderinactive"],i.sliderinactive_),i}ge(e,n);var t=e.prototype;return t.slideractive_=function(){this.addclass("vjs-slider-active")},t.sliderinactive_=function(){this.removeclass("vjs-slider-active")},t.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")},t.createel=function(){var e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),n.prototype.createel.call(this,"div",{classname:"vjs-volume-panel vjs-control "+e})},t.dispose=function(){this.handlemouseout(),n.prototype.dispose.call(this)},t.handlevolumecontrolkeyup=function(e){ot.iseventkey(e,"esc")&&this.mutetoggle.focus()},t.handlemouseover=function(e){this.addclass("vjs-hover"),he(d,"keyup",ve(this,this.handlekeypress))},t.handlemouseout=function(e){this.removeclass("vjs-hover"),pe(d,"keyup",ve(this,this.handlekeypress))},t.handlekeypress=function(e){ot.iseventkey(e,"esc")&&this.handlemouseout()},e}(je);gn.prototype.options_={children:["mutetoggle","volumecontrol"]},je.registercomponent("volumepanel",gn);var xn=function(n){function e(e,t){var i;return i=n.call(this,e,t)||this,t&&(i.menubutton_=t.menubutton),i.focusedchild_=-1,i.on("keydown",i.handlekeydown),i.boundhandleblur_=ve(ve(i),i.handleblur),i.boundhandletapclick_=ve(ve(i),i.handletapclick),i}ge(e,n);var t=e.prototype;return t.addeventlistenerforitem=function(e){e instanceof je&&(this.on(e,"blur",this.boundhandleblur_),this.on(e,["tap","click"],this.boundhandletapclick_))},t.removeeventlistenerforitem=function(e){e instanceof je&&(this.off(e,"blur",this.boundhandleblur_),this.off(e,["tap","click"],this.boundhandletapclick_))},t.removechild=function(e){"string"==typeof e&&(e=this.getchild(e)),this.removeeventlistenerforitem(e),n.prototype.removechild.call(this,e)},t.additem=function(e){var t=this.addchild(e);t&&this.addeventlistenerforitem(t)},t.createel=function(){var e=this.options_.contenteltype||"ul";this.contentel_=k(e,{classname:"vjs-menu-content"}),this.contentel_.setattribute("role","menu");var t=n.prototype.createel.call(this,"div",{append:this.contentel_,classname:"vjs-menu"});return t.appendchild(this.contentel_),he(t,"click",function(e){e.preventdefault(),e.stopimmediatepropagation()}),t},t.dispose=function(){this.contentel_=null,this.boundhandleblur_=null,this.boundhandletapclick_=null,n.prototype.dispose.call(this)},t.handleblur=function(e){var t=e.relatedtarget||d.activeelement;if(!this.children().some(function(e){return e.el()===t})){var i=this.menubutton_;i&&i.buttonpressed_&&t!==i.el().firstchild&&i.unpressbutton()}},t.handletapclick=function(t){if(this.menubutton_){this.menubutton_.unpressbutton();var e=this.children();if(!array.isarray(e))return;var i=e.filter(function(e){return e.el()===t.target})[0];if(!i)return;"captionsettingsmenuitem"!==i.name()&&this.menubutton_.focus()}},t.handlekeydown=function(e){ot.iseventkey(e,"left")||ot.iseventkey(e,"down")?(e.preventdefault(),e.stoppropagation(),this.stepforward()):(ot.iseventkey(e,"right")||ot.iseventkey(e,"up"))&&(e.preventdefault(),e.stoppropagation(),this.stepback())},t.stepforward=function(){var e=0;void 0!==this.focusedchild_&&(e=this.focusedchild_+1),this.focus(e)},t.stepback=function(){var e=0;void 0!==this.focusedchild_&&(e=this.focusedchild_-1),this.focus(e)},t.focus=function(e){void 0===e&&(e=0);var t=this.children().slice();t.length&&t[0].classname&&/vjs-menu-title/.test(t[0].classname)&&t.shift(),0=t.length&&(e=t.length-1),t[this.focusedchild_=e].el_.focus())},e}(je);je.registercomponent("menu",xn);var kn=function(r){function e(e,t){var i;void 0===t&&(t={}),(i=r.call(this,e,t)||this).menubutton_=new vn(e,t),i.menubutton_.controltext(i.controltext_),i.menubutton_.el_.setattribute("aria-haspopup","true");var n=vn.prototype.buildcssclass();return i.menubutton_.el_.classname=i.buildcssclass()+" "+n,i.menubutton_.removeclass("vjs-control"),i.addchild(i.menubutton_),i.update(),i.enabled_=!0,i.on(i.menubutton_,"tap",i.handleclick),i.on(i.menubutton_,"click",i.handleclick),i.on(i.menubutton_,"keydown",i.handlekeydown),i.on(i.menubutton_,"mouseenter",function(){i.addclass("vjs-hover"),i.menu.show(),he(d,"keyup",ve(ve(i),i.handlemenukeyup))}),i.on("mouseleave",i.handlemouseleave),i.on("keydown",i.handlesubmenukeydown),i}ge(e,r);var t=e.prototype;return t.update=function(){var e=this.createmenu();this.menu&&(this.menu.dispose(),this.removechild(this.menu)),this.menu=e,this.addchild(e),this.buttonpressed_=!1,this.menubutton_.el_.setattribute("aria-expanded","false"),this.items&&this.items.length<=this.hidethreshold_?this.hide():this.show()},t.createmenu=function(){var e=new xn(this.player_,{menubutton:this});if(this.hidethreshold_=0,this.options_.title){var t=k("li",{classname:"vjs-menu-title",innerhtml:me(this.options_.title),tabindex:-1});this.hidethreshold_+=1;var i=new je(this.player_,{el:t});e.additem(i)}if(this.items=this.createitems(),this.items)for(var n=0;n