/* _ _ _ _ ___| (_) ___| | __ (_)___ / __| | |/ __| |/ / | / __| \__ \ | | (__| < _ | \__ \ |___/_|_|\___|_|\_(_)/ |___/ |__/ Version: 1.5.9 Author: Ken Wheeler Website: http://kenwheeler.github.io Docs: http://kenwheeler.github.io/slick Repo: http://github.com/kenwheeler/slick Issues: http://github.com/kenwheeler/slick/issues */ !function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"undefined"!=typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){"use strict";var b=window.Slick||{};b=function(){function c(c,d){var f,e=this;e.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:a(c),appendDots:a(c),arrows:!0,asNavFor:null,prevArrow:'',nextArrow:'',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(a,b){return'"},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!1,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},e.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},a.extend(e,e.initials),e.activeBreakpoint=null,e.animType=null,e.animProp=null,e.breakpoints=[],e.breakpointSettings=[],e.cssTransitions=!1,e.hidden="hidden",e.paused=!1,e.positionProp=null,e.respondTo=null,e.rowCount=1,e.shouldClick=!0,e.$slider=a(c),e.$slidesCache=null,e.transformType=null,e.transitionType=null,e.visibilityChange="visibilitychange",e.windowWidth=0,e.windowTimer=null,f=a(c).data("slick")||{},e.options=a.extend({},e.defaults,f,d),e.currentSlide=e.options.initialSlide,e.originalSettings=e.options,"undefined"!=typeof document.mozHidden?(e.hidden="mozHidden",e.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e.autoPlay=a.proxy(e.autoPlay,e),e.autoPlayClear=a.proxy(e.autoPlayClear,e),e.changeSlide=a.proxy(e.changeSlide,e),e.clickHandler=a.proxy(e.clickHandler,e),e.selectHandler=a.proxy(e.selectHandler,e),e.setPosition=a.proxy(e.setPosition,e),e.swipeHandler=a.proxy(e.swipeHandler,e),e.dragHandler=a.proxy(e.dragHandler,e),e.keyHandler=a.proxy(e.keyHandler,e),e.autoPlayIterator=a.proxy(e.autoPlayIterator,e),e.instanceUid=b++,e.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,e.registerBreakpoints(),e.init(!0),e.checkResponsive(!0)}var b=0;return c}(),b.prototype.addSlide=b.prototype.slickAdd=function(b,c,d){var e=this;if("boolean"==typeof c)d=c,c=null;else if(0>c||c>=e.slideCount)return!1;e.unload(),"number"==typeof c?0===c&&0===e.$slides.length?a(b).appendTo(e.$slideTrack):d?a(b).insertBefore(e.$slides.eq(c)):a(b).insertAfter(e.$slides.eq(c)):d===!0?a(b).prependTo(e.$slideTrack):a(b).appendTo(e.$slideTrack),e.$slides=e.$slideTrack.children(this.options.slide),e.$slideTrack.children(this.options.slide).detach(),e.$slideTrack.append(e.$slides),e.$slides.each(function(b,c){a(c).attr("data-slick-index",b)}),e.$slidesCache=e.$slides,e.reinit()},b.prototype.animateHeight=function(){var a=this;if(1===a.options.slidesToShow&&a.options.adaptiveHeight===!0&&a.options.vertical===!1){var b=a.$slides.eq(a.currentSlide).outerHeight(!0);a.$list.animate({height:b},a.options.speed)}},b.prototype.animateSlide=function(b,c){var d={},e=this;e.animateHeight(),e.options.rtl===!0&&e.options.vertical===!1&&(b=-b),e.transformsEnabled===!1?e.options.vertical===!1?e.$slideTrack.animate({left:b},e.options.speed,e.options.easing,c):e.$slideTrack.animate({top:b},e.options.speed,e.options.easing,c):e.cssTransitions===!1?(e.options.rtl===!0&&(e.currentLeft=-e.currentLeft),a({animStart:e.currentLeft}).animate({animStart:b},{duration:e.options.speed,easing:e.options.easing,step:function(a){a=Math.ceil(a),e.options.vertical===!1?(d[e.animType]="translate("+a+"px, 0px)",e.$slideTrack.css(d)):(d[e.animType]="translate(0px,"+a+"px)",e.$slideTrack.css(d))},complete:function(){c&&c.call()}})):(e.applyTransition(),b=Math.ceil(b),e.options.vertical===!1?d[e.animType]="translate3d("+b+"px, 0px, 0px)":d[e.animType]="translate3d(0px,"+b+"px, 0px)",e.$slideTrack.css(d),c&&setTimeout(function(){e.disableTransition(),c.call()},e.options.speed))},b.prototype.asNavFor=function(b){var c=this,d=c.options.asNavFor;d&&null!==d&&(d=a(d).not(c.$slider)),null!==d&&"object"==typeof d&&d.each(function(){var c=a(this).slick("getSlick");c.unslicked||c.slideHandler(b,!0)})},b.prototype.applyTransition=function(a){var b=this,c={};b.options.fade===!1?c[b.transitionType]=b.transformType+" "+b.options.speed+"ms "+b.options.cssEase:c[b.transitionType]="opacity "+b.options.speed+"ms "+b.options.cssEase,b.options.fade===!1?b.$slideTrack.css(c):b.$slides.eq(a).css(c)},b.prototype.autoPlay=function(){var a=this;a.autoPlayTimer&&clearInterval(a.autoPlayTimer),a.slideCount>a.options.slidesToShow&&a.paused!==!0&&(a.autoPlayTimer=setInterval(a.autoPlayIterator,a.options.autoplaySpeed))},b.prototype.autoPlayClear=function(){var a=this;a.autoPlayTimer&&clearInterval(a.autoPlayTimer)},b.prototype.autoPlayIterator=function(){var a=this;a.options.infinite===!1?1===a.direction?(a.currentSlide+1===a.slideCount-1&&(a.direction=0),a.slideHandler(a.currentSlide+a.options.slidesToScroll)):(a.currentSlide-1===0&&(a.direction=1),a.slideHandler(a.currentSlide-a.options.slidesToScroll)):a.slideHandler(a.currentSlide+a.options.slidesToScroll)},b.prototype.buildArrows=function(){var b=this;b.options.arrows===!0&&(b.$prevArrow=a(b.options.prevArrow).addClass("slick-arrow"),b.$nextArrow=a(b.options.nextArrow).addClass("slick-arrow"),b.slideCount>b.options.slidesToShow?(b.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),b.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),b.htmlExpr.test(b.options.prevArrow)&&b.$prevArrow.prependTo(b.options.appendArrows),b.htmlExpr.test(b.options.nextArrow)&&b.$nextArrow.appendTo(b.options.appendArrows),b.options.infinite!==!0&&b.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):b.$prevArrow.add(b.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},b.prototype.buildDots=function(){var c,d,b=this;if(b.options.dots===!0&&b.slideCount>b.options.slidesToShow){for(d='",b.$dots=a(d).appendTo(b.options.appendDots),b.$dots.find("li").first().addClass("slick-active").attr("aria-hidden","false")}},b.prototype.buildOut=function(){var b=this;b.$slides=b.$slider.children(b.options.slide+":not(.slick-cloned)").addClass("slick-slide"),b.slideCount=b.$slides.length,b.$slides.each(function(b,c){a(c).attr("data-slick-index",b).data("originalStyling",a(c).attr("style")||"")}),b.$slider.addClass("slick-slider"),b.$slideTrack=0===b.slideCount?a('
').appendTo(b.$slider):b.$slides.wrapAll('
').parent(),b.$list=b.$slideTrack.wrap('
').parent(),b.$slideTrack.css("opacity",0),(b.options.centerMode===!0||b.options.swipeToSlide===!0)&&(b.options.slidesToScroll=1),a("img[data-lazy]",b.$slider).not("[src]").addClass("slick-loading"),b.setupInfinite(),b.buildArrows(),b.buildDots(),b.updateDots(),b.setSlideClasses("number"==typeof b.currentSlide?b.currentSlide:0),b.options.draggable===!0&&b.$list.addClass("draggable")},b.prototype.buildRows=function(){var b,c,d,e,f,g,h,a=this;if(e=document.createDocumentFragment(),g=a.$slider.children(),a.options.rows>1){for(h=a.options.slidesPerRow*a.options.rows,f=Math.ceil(g.length/h),b=0;f>b;b++){var i=document.createElement("div");for(c=0;cd.breakpoints[e]&&(f=d.breakpoints[e]));null!==f?null!==d.activeBreakpoint?(f!==d.activeBreakpoint||c)&&(d.activeBreakpoint=f,"unslick"===d.breakpointSettings[f]?d.unslick(f):(d.options=a.extend({},d.originalSettings,d.breakpointSettings[f]),b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b)),h=f):(d.activeBreakpoint=f,"unslick"===d.breakpointSettings[f]?d.unslick(f):(d.options=a.extend({},d.originalSettings,d.breakpointSettings[f]),b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b)),h=f):null!==d.activeBreakpoint&&(d.activeBreakpoint=null,d.options=d.originalSettings,b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b),h=f),b||h===!1||d.$slider.trigger("breakpoint",[d,h])}},b.prototype.changeSlide=function(b,c){var f,g,h,d=this,e=a(b.target);switch(e.is("a")&&b.preventDefault(),e.is("li")||(e=e.closest("li")),h=d.slideCount%d.options.slidesToScroll!==0,f=h?0:(d.slideCount-d.currentSlide)%d.options.slidesToScroll,b.data.message){case"previous":g=0===f?d.options.slidesToScroll:d.options.slidesToShow-f,d.slideCount>d.options.slidesToShow&&d.slideHandler(d.currentSlide-g,!1,c);break;case"next":g=0===f?d.options.slidesToScroll:f,d.slideCount>d.options.slidesToShow&&d.slideHandler(d.currentSlide+g,!1,c);break;case"index":var i=0===b.data.index?0:b.data.index||e.index()*d.options.slidesToScroll;d.slideHandler(d.checkNavigable(i),!1,c),e.children().trigger("focus");break;default:return}},b.prototype.checkNavigable=function(a){var c,d,b=this;if(c=b.getNavigableIndexes(),d=0,a>c[c.length-1])a=c[c.length-1];else for(var e in c){if(ab.options.slidesToShow&&(b.$prevArrow&&b.$prevArrow.off("click.slick",b.changeSlide),b.$nextArrow&&b.$nextArrow.off("click.slick",b.changeSlide)),b.$list.off("touchstart.slick mousedown.slick",b.swipeHandler),b.$list.off("touchmove.slick mousemove.slick",b.swipeHandler),b.$list.off("touchend.slick mouseup.slick",b.swipeHandler),b.$list.off("touchcancel.slick mouseleave.slick",b.swipeHandler),b.$list.off("click.slick",b.clickHandler),a(document).off(b.visibilityChange,b.visibility),b.$list.off("mouseenter.slick",a.proxy(b.setPaused,b,!0)),b.$list.off("mouseleave.slick",a.proxy(b.setPaused,b,!1)),b.options.accessibility===!0&&b.$list.off("keydown.slick",b.keyHandler),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().off("click.slick",b.selectHandler),a(window).off("orientationchange.slick.slick-"+b.instanceUid,b.orientationChange),a(window).off("resize.slick.slick-"+b.instanceUid,b.resize),a("[draggable!=true]",b.$slideTrack).off("dragstart",b.preventDefault),a(window).off("load.slick.slick-"+b.instanceUid,b.setPosition),a(document).off("ready.slick.slick-"+b.instanceUid,b.setPosition)},b.prototype.cleanUpRows=function(){var b,a=this;a.options.rows>1&&(b=a.$slides.children().children(),b.removeAttr("style"),a.$slider.html(b))},b.prototype.clickHandler=function(a){var b=this;b.shouldClick===!1&&(a.stopImmediatePropagation(),a.stopPropagation(),a.preventDefault())},b.prototype.destroy=function(b){var c=this;c.autoPlayClear(),c.touchObject={},c.cleanUpEvents(),a(".slick-cloned",c.$slider).detach(),c.$dots&&c.$dots.remove(),c.$prevArrow&&c.$prevArrow.length&&(c.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),c.htmlExpr.test(c.options.prevArrow)&&c.$prevArrow.remove()),c.$nextArrow&&c.$nextArrow.length&&(c.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),c.htmlExpr.test(c.options.nextArrow)&&c.$nextArrow.remove()),c.$slides&&(c.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){a(this).attr("style",a(this).data("originalStyling"))}),c.$slideTrack.children(this.options.slide).detach(),c.$slideTrack.detach(),c.$list.detach(),c.$slider.append(c.$slides)),c.cleanUpRows(),c.$slider.removeClass("slick-slider"),c.$slider.removeClass("slick-initialized"),c.unslicked=!0,b||c.$slider.trigger("destroy",[c])},b.prototype.disableTransition=function(a){var b=this,c={};c[b.transitionType]="",b.options.fade===!1?b.$slideTrack.css(c):b.$slides.eq(a).css(c)},b.prototype.fadeSlide=function(a,b){var c=this;c.cssTransitions===!1?(c.$slides.eq(a).css({zIndex:c.options.zIndex}),c.$slides.eq(a).animate({opacity:1},c.options.speed,c.options.easing,b)):(c.applyTransition(a),c.$slides.eq(a).css({opacity:1,zIndex:c.options.zIndex}),b&&setTimeout(function(){c.disableTransition(a),b.call()},c.options.speed))},b.prototype.fadeSlideOut=function(a){var b=this;b.cssTransitions===!1?b.$slides.eq(a).animate({opacity:0,zIndex:b.options.zIndex-2},b.options.speed,b.options.easing):(b.applyTransition(a),b.$slides.eq(a).css({opacity:0,zIndex:b.options.zIndex-2}))},b.prototype.filterSlides=b.prototype.slickFilter=function(a){var b=this;null!==a&&(b.$slidesCache=b.$slides,b.unload(),b.$slideTrack.children(this.options.slide).detach(),b.$slidesCache.filter(a).appendTo(b.$slideTrack),b.reinit())},b.prototype.getCurrent=b.prototype.slickCurrentSlide=function(){var a=this;return a.currentSlide},b.prototype.getDotCount=function(){var a=this,b=0,c=0,d=0;if(a.options.infinite===!0)for(;bb.options.slidesToShow&&(b.slideOffset=b.slideWidth*b.options.slidesToShow*-1,e=d*b.options.slidesToShow*-1),b.slideCount%b.options.slidesToScroll!==0&&a+b.options.slidesToScroll>b.slideCount&&b.slideCount>b.options.slidesToShow&&(a>b.slideCount?(b.slideOffset=(b.options.slidesToShow-(a-b.slideCount))*b.slideWidth*-1,e=(b.options.slidesToShow-(a-b.slideCount))*d*-1):(b.slideOffset=b.slideCount%b.options.slidesToScroll*b.slideWidth*-1,e=b.slideCount%b.options.slidesToScroll*d*-1))):a+b.options.slidesToShow>b.slideCount&&(b.slideOffset=(a+b.options.slidesToShow-b.slideCount)*b.slideWidth,e=(a+b.options.slidesToShow-b.slideCount)*d),b.slideCount<=b.options.slidesToShow&&(b.slideOffset=0,e=0),b.options.centerMode===!0&&b.options.infinite===!0?b.slideOffset+=b.slideWidth*Math.floor(b.options.slidesToShow/2)-b.slideWidth:b.options.centerMode===!0&&(b.slideOffset=0,b.slideOffset+=b.slideWidth*Math.floor(b.options.slidesToShow/2)),c=b.options.vertical===!1?a*b.slideWidth*-1+b.slideOffset:a*d*-1+e,b.options.variableWidth===!0&&(f=b.slideCount<=b.options.slidesToShow||b.options.infinite===!1?b.$slideTrack.children(".slick-slide").eq(a):b.$slideTrack.children(".slick-slide").eq(a+b.options.slidesToShow),c=b.options.rtl===!0?f[0]?-1*(b.$slideTrack.width()-f[0].offsetLeft-f.width()):0:f[0]?-1*f[0].offsetLeft:0,b.options.centerMode===!0&&(f=b.slideCount<=b.options.slidesToShow||b.options.infinite===!1?b.$slideTrack.children(".slick-slide").eq(a):b.$slideTrack.children(".slick-slide").eq(a+b.options.slidesToShow+1),c=b.options.rtl===!0?f[0]?-1*(b.$slideTrack.width()-f[0].offsetLeft-f.width()):0:f[0]?-1*f[0].offsetLeft:0,c+=(b.$list.width()-f.outerWidth())/2)),c},b.prototype.getOption=b.prototype.slickGetOption=function(a){var b=this;return b.options[a]},b.prototype.getNavigableIndexes=function(){var e,a=this,b=0,c=0,d=[];for(a.options.infinite===!1?e=a.slideCount:(b=-1*a.options.slidesToScroll,c=-1*a.options.slidesToScroll,e=2*a.slideCount);e>b;)d.push(b),b=c+a.options.slidesToScroll,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;return d},b.prototype.getSlick=function(){return this},b.prototype.getSlideCount=function(){var c,d,e,b=this;return e=b.options.centerMode===!0?b.slideWidth*Math.floor(b.options.slidesToShow/2):0,b.options.swipeToSlide===!0?(b.$slideTrack.find(".slick-slide").each(function(c,f){return f.offsetLeft-e+a(f).outerWidth()/2>-1*b.swipeLeft?(d=f,!1):void 0}),c=Math.abs(a(d).attr("data-slick-index")-b.currentSlide)||1):b.options.slidesToScroll},b.prototype.goTo=b.prototype.slickGoTo=function(a,b){var c=this;c.changeSlide({data:{message:"index",index:parseInt(a)}},b)},b.prototype.init=function(b){var c=this;a(c.$slider).hasClass("slick-initialized")||(a(c.$slider).addClass("slick-initialized"),c.buildRows(),c.buildOut(),c.setProps(),c.startLoad(),c.loadSlider(),c.initializeEvents(),c.updateArrows(),c.updateDots()),b&&c.$slider.trigger("init",[c]),c.options.accessibility===!0&&c.initADA()},b.prototype.initArrowEvents=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.on("click.slick",{message:"previous"},a.changeSlide),a.$nextArrow.on("click.slick",{message:"next"},a.changeSlide))},b.prototype.initDotEvents=function(){var b=this;b.options.dots===!0&&b.slideCount>b.options.slidesToShow&&a("li",b.$dots).on("click.slick",{message:"index"},b.changeSlide),b.options.dots===!0&&b.options.pauseOnDotsHover===!0&&b.options.autoplay===!0&&a("li",b.$dots).on("mouseenter.slick",a.proxy(b.setPaused,b,!0)).on("mouseleave.slick",a.proxy(b.setPaused,b,!1))},b.prototype.initializeEvents=function(){var b=this;b.initArrowEvents(),b.initDotEvents(),b.$list.on("touchstart.slick mousedown.slick",{action:"start"},b.swipeHandler),b.$list.on("touchmove.slick mousemove.slick",{action:"move"},b.swipeHandler),b.$list.on("touchend.slick mouseup.slick",{action:"end"},b.swipeHandler),b.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},b.swipeHandler),b.$list.on("click.slick",b.clickHandler),a(document).on(b.visibilityChange,a.proxy(b.visibility,b)),b.$list.on("mouseenter.slick",a.proxy(b.setPaused,b,!0)),b.$list.on("mouseleave.slick",a.proxy(b.setPaused,b,!1)),b.options.accessibility===!0&&b.$list.on("keydown.slick",b.keyHandler),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().on("click.slick",b.selectHandler),a(window).on("orientationchange.slick.slick-"+b.instanceUid,a.proxy(b.orientationChange,b)),a(window).on("resize.slick.slick-"+b.instanceUid,a.proxy(b.resize,b)),a("[draggable!=true]",b.$slideTrack).on("dragstart",b.preventDefault),a(window).on("load.slick.slick-"+b.instanceUid,b.setPosition),a(document).on("ready.slick.slick-"+b.instanceUid,b.setPosition)},b.prototype.initUI=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.show(),a.$nextArrow.show()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.$dots.show(),a.options.autoplay===!0&&a.autoPlay()},b.prototype.keyHandler=function(a){var b=this;a.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===a.keyCode&&b.options.accessibility===!0?b.changeSlide({data:{message:"previous"}}):39===a.keyCode&&b.options.accessibility===!0&&b.changeSlide({data:{message:"next"}}))},b.prototype.lazyLoad=function(){function g(b){a("img[data-lazy]",b).each(function(){var b=a(this),c=a(this).attr("data-lazy"),d=document.createElement("img");d.onload=function(){b.animate({opacity:0},100,function(){b.attr("src",c).animate({opacity:1},200,function(){b.removeAttr("data-lazy").removeClass("slick-loading")})})},d.src=c})}var c,d,e,f,b=this;b.options.centerMode===!0?b.options.infinite===!0?(e=b.currentSlide+(b.options.slidesToShow/2+1),f=e+b.options.slidesToShow+2):(e=Math.max(0,b.currentSlide-(b.options.slidesToShow/2+1)),f=2+(b.options.slidesToShow/2+1)+b.currentSlide):(e=b.options.infinite?b.options.slidesToShow+b.currentSlide:b.currentSlide,f=e+b.options.slidesToShow,b.options.fade===!0&&(e>0&&e--,f<=b.slideCount&&f++)),c=b.$slider.find(".slick-slide").slice(e,f),g(c),b.slideCount<=b.options.slidesToShow?(d=b.$slider.find(".slick-slide"),g(d)):b.currentSlide>=b.slideCount-b.options.slidesToShow?(d=b.$slider.find(".slick-cloned").slice(0,b.options.slidesToShow),g(d)):0===b.currentSlide&&(d=b.$slider.find(".slick-cloned").slice(-1*b.options.slidesToShow),g(d))},b.prototype.loadSlider=function(){var a=this;a.setPosition(),a.$slideTrack.css({opacity:1}),a.$slider.removeClass("slick-loading"),a.initUI(),"progressive"===a.options.lazyLoad&&a.progressiveLazyLoad()},b.prototype.next=b.prototype.slickNext=function(){var a=this;a.changeSlide({data:{message:"next"}})},b.prototype.orientationChange=function(){var a=this;a.checkResponsive(),a.setPosition()},b.prototype.pause=b.prototype.slickPause=function(){var a=this;a.autoPlayClear(),a.paused=!0},b.prototype.play=b.prototype.slickPlay=function(){var a=this;a.paused=!1,a.autoPlay()},b.prototype.postSlide=function(a){var b=this;b.$slider.trigger("afterChange",[b,a]),b.animating=!1,b.setPosition(),b.swipeLeft=null,b.options.autoplay===!0&&b.paused===!1&&b.autoPlay(),b.options.accessibility===!0&&b.initADA()},b.prototype.prev=b.prototype.slickPrev=function(){var a=this;a.changeSlide({data:{message:"previous"}})},b.prototype.preventDefault=function(a){a.preventDefault()},b.prototype.progressiveLazyLoad=function(){var c,d,b=this;c=a("img[data-lazy]",b.$slider).length,c>0&&(d=a("img[data-lazy]",b.$slider).first(),d.attr("src",null),d.attr("src",d.attr("data-lazy")).removeClass("slick-loading").load(function(){d.removeAttr("data-lazy"),b.progressiveLazyLoad(),b.options.adaptiveHeight===!0&&b.setPosition()}).error(function(){d.removeAttr("data-lazy"),b.progressiveLazyLoad()}))},b.prototype.refresh=function(b){var d,e,c=this;e=c.slideCount-c.options.slidesToShow,c.options.infinite||(c.slideCount<=c.options.slidesToShow?c.currentSlide=0:c.currentSlide>e&&(c.currentSlide=e)),d=c.currentSlide,c.destroy(!0),a.extend(c,c.initials,{currentSlide:d}),c.init(),b||c.changeSlide({data:{message:"index",index:d}},!1)},b.prototype.registerBreakpoints=function(){var c,d,e,b=this,f=b.options.responsive||null;if("array"===a.type(f)&&f.length){b.respondTo=b.options.respondTo||"window";for(c in f)if(e=b.breakpoints.length-1,d=f[c].breakpoint,f.hasOwnProperty(c)){for(;e>=0;)b.breakpoints[e]&&b.breakpoints[e]===d&&b.breakpoints.splice(e,1),e--;b.breakpoints.push(d),b.breakpointSettings[d]=f[c].settings}b.breakpoints.sort(function(a,c){return b.options.mobileFirst?a-c:c-a})}},b.prototype.reinit=function(){var b=this;b.$slides=b.$slideTrack.children(b.options.slide).addClass("slick-slide"),b.slideCount=b.$slides.length,b.currentSlide>=b.slideCount&&0!==b.currentSlide&&(b.currentSlide=b.currentSlide-b.options.slidesToScroll),b.slideCount<=b.options.slidesToShow&&(b.currentSlide=0),b.registerBreakpoints(),b.setProps(),b.setupInfinite(),b.buildArrows(),b.updateArrows(),b.initArrowEvents(),b.buildDots(),b.updateDots(),b.initDotEvents(),b.checkResponsive(!1,!0),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().on("click.slick",b.selectHandler),b.setSlideClasses(0),b.setPosition(),b.$slider.trigger("reInit",[b]),b.options.autoplay===!0&&b.focusHandler()},b.prototype.resize=function(){var b=this;a(window).width()!==b.windowWidth&&(clearTimeout(b.windowDelay),b.windowDelay=window.setTimeout(function(){b.windowWidth=a(window).width(),b.checkResponsive(),b.unslicked||b.setPosition()},50))},b.prototype.removeSlide=b.prototype.slickRemove=function(a,b,c){var d=this;return"boolean"==typeof a?(b=a,a=b===!0?0:d.slideCount-1):a=b===!0?--a:a,d.slideCount<1||0>a||a>d.slideCount-1?!1:(d.unload(),c===!0?d.$slideTrack.children().remove():d.$slideTrack.children(this.options.slide).eq(a).remove(),d.$slides=d.$slideTrack.children(this.options.slide),d.$slideTrack.children(this.options.slide).detach(),d.$slideTrack.append(d.$slides),d.$slidesCache=d.$slides,void d.reinit())},b.prototype.setCSS=function(a){var d,e,b=this,c={};b.options.rtl===!0&&(a=-a),d="left"==b.positionProp?Math.ceil(a)+"px":"0px",e="top"==b.positionProp?Math.ceil(a)+"px":"0px",c[b.positionProp]=a,b.transformsEnabled===!1?b.$slideTrack.css(c):(c={},b.cssTransitions===!1?(c[b.animType]="translate("+d+", "+e+")",b.$slideTrack.css(c)):(c[b.animType]="translate3d("+d+", "+e+", 0px)",b.$slideTrack.css(c)))},b.prototype.setDimensions=function(){var a=this;a.options.vertical===!1?a.options.centerMode===!0&&a.$list.css({padding:"0px "+a.options.centerPadding}):(a.$list.height(a.$slides.first().outerHeight(!0)*a.options.slidesToShow),a.options.centerMode===!0&&a.$list.css({padding:a.options.centerPadding+" 0px"})),a.listWidth=a.$list.width(),a.listHeight=a.$list.height(),a.options.vertical===!1&&a.options.variableWidth===!1?(a.slideWidth=Math.ceil(a.listWidth/a.options.slidesToShow),a.$slideTrack.width(Math.ceil(a.slideWidth*a.$slideTrack.children(".slick-slide").length))):a.options.variableWidth===!0?a.$slideTrack.width(5e3*a.slideCount):(a.slideWidth=Math.ceil(a.listWidth),a.$slideTrack.height(Math.ceil(a.$slides.first().outerHeight(!0)*a.$slideTrack.children(".slick-slide").length)));var b=a.$slides.first().outerWidth(!0)-a.$slides.first().width();a.options.variableWidth===!1&&a.$slideTrack.children(".slick-slide").width(a.slideWidth-b)},b.prototype.setFade=function(){var c,b=this;b.$slides.each(function(d,e){c=b.slideWidth*d*-1,b.options.rtl===!0?a(e).css({position:"relative",right:c,top:0,zIndex:b.options.zIndex-2,opacity:0}):a(e).css({position:"relative",left:c,top:0,zIndex:b.options.zIndex-2,opacity:0})}),b.$slides.eq(b.currentSlide).css({zIndex:b.options.zIndex-1,opacity:1})},b.prototype.setHeight=function(){var a=this;if(1===a.options.slidesToShow&&a.options.adaptiveHeight===!0&&a.options.vertical===!1){var b=a.$slides.eq(a.currentSlide).outerHeight(!0);a.$list.css("height",b)}},b.prototype.setOption=b.prototype.slickSetOption=function(b,c,d){var f,g,e=this;if("responsive"===b&&"array"===a.type(c))for(g in c)if("array"!==a.type(e.options.responsive))e.options.responsive=[c[g]];else{for(f=e.options.responsive.length-1;f>=0;)e.options.responsive[f].breakpoint===c[g].breakpoint&&e.options.responsive.splice(f,1),f--;e.options.responsive.push(c[g])}else e.options[b]=c;d===!0&&(e.unload(),e.reinit())},b.prototype.setPosition=function(){var a=this;a.setDimensions(),a.setHeight(),a.options.fade===!1?a.setCSS(a.getLeft(a.currentSlide)):a.setFade(),a.$slider.trigger("setPosition",[a])},b.prototype.setProps=function(){var a=this,b=document.body.style;a.positionProp=a.options.vertical===!0?"top":"left","top"===a.positionProp?a.$slider.addClass("slick-vertical"):a.$slider.removeClass("slick-vertical"),(void 0!==b.WebkitTransition||void 0!==b.MozTransition||void 0!==b.msTransition)&&a.options.useCSS===!0&&(a.cssTransitions=!0),a.options.fade&&("number"==typeof a.options.zIndex?a.options.zIndex<3&&(a.options.zIndex=3):a.options.zIndex=a.defaults.zIndex),void 0!==b.OTransform&&(a.animType="OTransform",a.transformType="-o-transform",a.transitionType="OTransition",void 0===b.perspectiveProperty&&void 0===b.webkitPerspective&&(a.animType=!1)),void 0!==b.MozTransform&&(a.animType="MozTransform",a.transformType="-moz-transform",a.transitionType="MozTransition",void 0===b.perspectiveProperty&&void 0===b.MozPerspective&&(a.animType=!1)),void 0!==b.webkitTransform&&(a.animType="webkitTransform",a.transformType="-webkit-transform",a.transitionType="webkitTransition",void 0===b.perspectiveProperty&&void 0===b.webkitPerspective&&(a.animType=!1)),void 0!==b.msTransform&&(a.animType="msTransform",a.transformType="-ms-transform",a.transitionType="msTransition",void 0===b.msTransform&&(a.animType=!1)),void 0!==b.transform&&a.animType!==!1&&(a.animType="transform",a.transformType="transform",a.transitionType="transition"),a.transformsEnabled=a.options.useTransform&&null!==a.animType&&a.animType!==!1},b.prototype.setSlideClasses=function(a){var c,d,e,f,b=this;d=b.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),b.$slides.eq(a).addClass("slick-current"),b.options.centerMode===!0?(c=Math.floor(b.options.slidesToShow/2),b.options.infinite===!0&&(a>=c&&a<=b.slideCount-1-c?b.$slides.slice(a-c,a+c+1).addClass("slick-active").attr("aria-hidden","false"):(e=b.options.slidesToShow+a,d.slice(e-c+1,e+c+2).addClass("slick-active").attr("aria-hidden","false")),0===a?d.eq(d.length-1-b.options.slidesToShow).addClass("slick-center"):a===b.slideCount-1&&d.eq(b.options.slidesToShow).addClass("slick-center")),b.$slides.eq(a).addClass("slick-center")):a>=0&&a<=b.slideCount-b.options.slidesToShow?b.$slides.slice(a,a+b.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):d.length<=b.options.slidesToShow?d.addClass("slick-active").attr("aria-hidden","false"):(f=b.slideCount%b.options.slidesToShow,e=b.options.infinite===!0?b.options.slidesToShow+a:a,b.options.slidesToShow==b.options.slidesToScroll&&b.slideCount-ab.options.slidesToShow)){for(e=b.options.centerMode===!0?b.options.slidesToShow+1:b.options.slidesToShow,c=b.slideCount;c>b.slideCount-e;c-=1)d=c-1,a(b.$slides[d]).clone(!0).attr("id","").attr("data-slick-index",d-b.slideCount).prependTo(b.$slideTrack).addClass("slick-cloned");for(c=0;e>c;c+=1)d=c,a(b.$slides[d]).clone(!0).attr("id","").attr("data-slick-index",d+b.slideCount).appendTo(b.$slideTrack).addClass("slick-cloned");b.$slideTrack.find(".slick-cloned").find("[id]").each(function(){a(this).attr("id","")})}},b.prototype.setPaused=function(a){var b=this;b.options.autoplay===!0&&b.options.pauseOnHover===!0&&(b.paused=a,a?b.autoPlayClear():b.autoPlay())},b.prototype.selectHandler=function(b){var c=this,d=a(b.target).is(".slick-slide")?a(b.target):a(b.target).parents(".slick-slide"),e=parseInt(d.attr("data-slick-index"));return e||(e=0),c.slideCount<=c.options.slidesToShow?(c.setSlideClasses(e),void c.asNavFor(e)):void c.slideHandler(e)},b.prototype.slideHandler=function(a,b,c){var d,e,f,g,h=null,i=this;return b=b||!1,i.animating===!0&&i.options.waitForAnimate===!0||i.options.fade===!0&&i.currentSlide===a||i.slideCount<=i.options.slidesToShow?void 0:(b===!1&&i.asNavFor(a),d=a,h=i.getLeft(d),g=i.getLeft(i.currentSlide),i.currentLeft=null===i.swipeLeft?g:i.swipeLeft,i.options.infinite===!1&&i.options.centerMode===!1&&(0>a||a>i.getDotCount()*i.options.slidesToScroll)?void(i.options.fade===!1&&(d=i.currentSlide,c!==!0?i.animateSlide(g,function(){i.postSlide(d); }):i.postSlide(d))):i.options.infinite===!1&&i.options.centerMode===!0&&(0>a||a>i.slideCount-i.options.slidesToScroll)?void(i.options.fade===!1&&(d=i.currentSlide,c!==!0?i.animateSlide(g,function(){i.postSlide(d)}):i.postSlide(d))):(i.options.autoplay===!0&&clearInterval(i.autoPlayTimer),e=0>d?i.slideCount%i.options.slidesToScroll!==0?i.slideCount-i.slideCount%i.options.slidesToScroll:i.slideCount+d:d>=i.slideCount?i.slideCount%i.options.slidesToScroll!==0?0:d-i.slideCount:d,i.animating=!0,i.$slider.trigger("beforeChange",[i,i.currentSlide,e]),f=i.currentSlide,i.currentSlide=e,i.setSlideClasses(i.currentSlide),i.updateDots(),i.updateArrows(),i.options.fade===!0?(c!==!0?(i.fadeSlideOut(f),i.fadeSlide(e,function(){i.postSlide(e)})):i.postSlide(e),void i.animateHeight()):void(c!==!0?i.animateSlide(h,function(){i.postSlide(e)}):i.postSlide(e))))},b.prototype.startLoad=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.hide(),a.$nextArrow.hide()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.$dots.hide(),a.$slider.addClass("slick-loading")},b.prototype.swipeDirection=function(){var a,b,c,d,e=this;return a=e.touchObject.startX-e.touchObject.curX,b=e.touchObject.startY-e.touchObject.curY,c=Math.atan2(b,a),d=Math.round(180*c/Math.PI),0>d&&(d=360-Math.abs(d)),45>=d&&d>=0?e.options.rtl===!1?"left":"right":360>=d&&d>=315?e.options.rtl===!1?"left":"right":d>=135&&225>=d?e.options.rtl===!1?"right":"left":e.options.verticalSwiping===!0?d>=35&&135>=d?"left":"right":"vertical"},b.prototype.swipeEnd=function(a){var c,b=this;if(b.dragging=!1,b.shouldClick=b.touchObject.swipeLength>10?!1:!0,void 0===b.touchObject.curX)return!1;if(b.touchObject.edgeHit===!0&&b.$slider.trigger("edge",[b,b.swipeDirection()]),b.touchObject.swipeLength>=b.touchObject.minSwipe)switch(b.swipeDirection()){case"left":c=b.options.swipeToSlide?b.checkNavigable(b.currentSlide+b.getSlideCount()):b.currentSlide+b.getSlideCount(),b.slideHandler(c),b.currentDirection=0,b.touchObject={},b.$slider.trigger("swipe",[b,"left"]);break;case"right":c=b.options.swipeToSlide?b.checkNavigable(b.currentSlide-b.getSlideCount()):b.currentSlide-b.getSlideCount(),b.slideHandler(c),b.currentDirection=1,b.touchObject={},b.$slider.trigger("swipe",[b,"right"])}else b.touchObject.startX!==b.touchObject.curX&&(b.slideHandler(b.currentSlide),b.touchObject={})},b.prototype.swipeHandler=function(a){var b=this;if(!(b.options.swipe===!1||"ontouchend"in document&&b.options.swipe===!1||b.options.draggable===!1&&-1!==a.type.indexOf("mouse")))switch(b.touchObject.fingerCount=a.originalEvent&&void 0!==a.originalEvent.touches?a.originalEvent.touches.length:1,b.touchObject.minSwipe=b.listWidth/b.options.touchThreshold,b.options.verticalSwiping===!0&&(b.touchObject.minSwipe=b.listHeight/b.options.touchThreshold),a.data.action){case"start":b.swipeStart(a);break;case"move":b.swipeMove(a);break;case"end":b.swipeEnd(a)}},b.prototype.swipeMove=function(a){var d,e,f,g,h,b=this;return h=void 0!==a.originalEvent?a.originalEvent.touches:null,!b.dragging||h&&1!==h.length?!1:(d=b.getLeft(b.currentSlide),b.touchObject.curX=void 0!==h?h[0].pageX:a.clientX,b.touchObject.curY=void 0!==h?h[0].pageY:a.clientY,b.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(b.touchObject.curX-b.touchObject.startX,2))),b.options.verticalSwiping===!0&&(b.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(b.touchObject.curY-b.touchObject.startY,2)))),e=b.swipeDirection(),"vertical"!==e?(void 0!==a.originalEvent&&b.touchObject.swipeLength>4&&a.preventDefault(),g=(b.options.rtl===!1?1:-1)*(b.touchObject.curX>b.touchObject.startX?1:-1),b.options.verticalSwiping===!0&&(g=b.touchObject.curY>b.touchObject.startY?1:-1),f=b.touchObject.swipeLength,b.touchObject.edgeHit=!1,b.options.infinite===!1&&(0===b.currentSlide&&"right"===e||b.currentSlide>=b.getDotCount()&&"left"===e)&&(f=b.touchObject.swipeLength*b.options.edgeFriction,b.touchObject.edgeHit=!0),b.options.vertical===!1?b.swipeLeft=d+f*g:b.swipeLeft=d+f*(b.$list.height()/b.listWidth)*g,b.options.verticalSwiping===!0&&(b.swipeLeft=d+f*g),b.options.fade===!0||b.options.touchMove===!1?!1:b.animating===!0?(b.swipeLeft=null,!1):void b.setCSS(b.swipeLeft)):void 0)},b.prototype.swipeStart=function(a){var c,b=this;return 1!==b.touchObject.fingerCount||b.slideCount<=b.options.slidesToShow?(b.touchObject={},!1):(void 0!==a.originalEvent&&void 0!==a.originalEvent.touches&&(c=a.originalEvent.touches[0]),b.touchObject.startX=b.touchObject.curX=void 0!==c?c.pageX:a.clientX,b.touchObject.startY=b.touchObject.curY=void 0!==c?c.pageY:a.clientY,void(b.dragging=!0))},b.prototype.unfilterSlides=b.prototype.slickUnfilter=function(){var a=this;null!==a.$slidesCache&&(a.unload(),a.$slideTrack.children(this.options.slide).detach(),a.$slidesCache.appendTo(a.$slideTrack),a.reinit())},b.prototype.unload=function(){var b=this;a(".slick-cloned",b.$slider).remove(),b.$dots&&b.$dots.remove(),b.$prevArrow&&b.htmlExpr.test(b.options.prevArrow)&&b.$prevArrow.remove(),b.$nextArrow&&b.htmlExpr.test(b.options.nextArrow)&&b.$nextArrow.remove(),b.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},b.prototype.unslick=function(a){var b=this;b.$slider.trigger("unslick",[b,a]),b.destroy()},b.prototype.updateArrows=function(){var b,a=this;b=Math.floor(a.options.slidesToShow/2),a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&!a.options.infinite&&(a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),a.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===a.currentSlide?(a.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):a.currentSlide>=a.slideCount-a.options.slidesToShow&&a.options.centerMode===!1?(a.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):a.currentSlide>=a.slideCount-1&&a.options.centerMode===!0&&(a.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},b.prototype.updateDots=function(){var a=this;null!==a.$dots&&(a.$dots.find("li").removeClass("slick-active").attr("aria-hidden","true"),a.$dots.find("li").eq(Math.floor(a.currentSlide/a.options.slidesToScroll)).addClass("slick-active").attr("aria-hidden","false"))},b.prototype.visibility=function(){var a=this;document[a.hidden]?(a.paused=!0,a.autoPlayClear()):a.options.autoplay===!0&&(a.paused=!1,a.autoPlay())},b.prototype.initADA=function(){var b=this;b.$slides.add(b.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),b.$slideTrack.attr("role","listbox"),b.$slides.not(b.$slideTrack.find(".slick-cloned")).each(function(c){a(this).attr({role:"option","aria-describedby":"slick-slide"+b.instanceUid+c})}),null!==b.$dots&&b.$dots.attr("role","tablist").find("li").each(function(c){a(this).attr({role:"presentation","aria-selected":"false","aria-controls":"navigation"+b.instanceUid+c,id:"slick-slide"+b.instanceUid+c})}).first().attr("aria-selected","true").end().find("button").attr("role","button").end().closest("div").attr("role","toolbar"),b.activateADA()},b.prototype.activateADA=function(){var a=this;a.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},b.prototype.focusHandler=function(){var b=this;b.$slider.on("focus.slick blur.slick","*",function(c){c.stopImmediatePropagation();var d=a(this);setTimeout(function(){b.isPlay&&(d.is(":focus")?(b.autoPlayClear(),b.paused=!0):(b.paused=!1,b.autoPlay()))},0)})},a.fn.slick=function(){var f,g,a=this,c=arguments[0],d=Array.prototype.slice.call(arguments,1),e=a.length;for(f=0;e>f;f++)if("object"==typeof c||"undefined"==typeof c?a[f].slick=new b(a[f],c):g=a[f].slick[c].apply(a[f].slick,d),"undefined"!=typeof g)return g;return a}});; var prodcat=prodcat||{},generic=generic||{};prodcat.ui=prodcat.ui||{},prodcat.data=prodcat.data||{},function(e){Drupal.behaviors.regimenBuilder={attached:!1,isDesktop:!1,nodes:{},selectors:{regimenBuilderBlock:".js-elc-regimen-builder-block-v1",product:".js-product",productCarousel:".js-elc-regimen-product-carousel",productItemHeadline:".js-elc-regimen-product-item-headline",productItemContent:".js-elc-regimen-product-item-content",productCheckbox:".js-elc-regimen-product-checkbox",productImage:".js-elc-regimen-product-image",productTitle:".js-elc-regimen-product-title",productSkuLabel:".js-elc-regimen-product-size-label, .js-elc-regimen-product-shade-label",productSizeDropdown:".js-elc-regimen-product-sizes-dropdown",productShadeDropdown:".js-elc-regimen-product-shades-dropdown",productShadeDropdownSelector:".js-elc-regimen-product-shades-dropdown-selector",productShadeDropdownColor:".js-elc-regimen-product-shades-dropdown-color",productRating:".js-elc-regimen-product-rating",productRatingAverage:".js-elc-regimen-product-rating-average",productRatingStars:".js-elc-regimen-product-rating-stars",productRatingTotal:".js-elc-regimen-product-rating-total",productPrice:".js-formatted-price",productPrice2:".js-formatted-price2",productUnitPrice:".js-formatted-unit-price",productInventoryStatus:".js-elc-regimen-product-inventory-status",totalPrice:".js-elc-regimen-total-price .js-mantle-custom-text",atbCta:".js-elc-regimen-atb-cta .js-elc-button",atbCtaSingular:".js-elc-regimen-atb-cta-singular .js-elc-button",atbCtaNoItems:".js-elc-regimen-atb-cta-no-items .js-elc-button"},productShadeDropdownSelectboxClasses:{classSelector:"js-elc-regimen-product-shades-dropdown-selector",classColorSpan:"elc-regimen-builder-block__product-sku-select-shades-color js-elc-regimen-product-shades-dropdown-color"},attach:function(t){var o=this;o.attached||(o.attached=!0,o.updateIsDesktop(),e(o.selectors.regimenBuilderBlock,t).each((function(){o.setup(e(this))})))},setup:function(e){var t=this;t.getDom(e),t.setEvents(e),t.init(e)},getDom:function(t){var o=this;t.nodes={},t.nodes.$product=e(o.selectors.product,t),t.nodes.$selectedProducts=t.nodes.$product,t.nodes.$productCarousel=e(o.selectors.productCarousel,t),t.nodes.$productItemHeadline=e(o.selectors.productItemHeadline,t),t.nodes.$productItemContent=e(o.selectors.productItemContent,t),t.nodes.$productCheckbox=e(o.selectors.productCheckbox,t),t.nodes.$productImage=e(o.selectors.productImage,t),t.nodes.$productTitle=e(o.selectors.productTitle,t),t.nodes.$productSkuLabel=e(o.selectors.productSkuLabel,t),t.nodes.$productSizeDropdown=e(o.selectors.productSizeDropdown,t),t.nodes.$productShadeDropdown=e(o.selectors.productShadeDropdown,t),t.nodes.$productRating=e(o.selectors.productRating,t),t.nodes.$totalPrice=e(o.selectors.totalPrice,t),t.nodes.$atbCta=e(o.selectors.atbCta,t),t.nodes.$atbCtaSingular=e(o.selectors.atbCtaSingular,t),t.nodes.$atbCtaNoItems=e(o.selectors.atbCtaNoItems,t),t.totalPriceText=t.nodes.$totalPrice.text(),t.atbCtaText=t.nodes.$atbCta.text(),t.atbCtaSingularText=t.nodes.$atbCtaSingular.text(),t.atbCtaNoItemsText=t.nodes.$atbCtaNoItems.text()},setEvents:function(t){var o=this;t.nodes.$productCheckbox.once().on("change",(function(){t.nodes.$selectedProducts=t.nodes.$productCheckbox.filter(":checked").closest(o.selectors.product),o.updateTotalPrice(t),o.updateSelectedProductsCount(t)})),t.nodes.$productImage.once().on("click",(function(t){var r=e(this).closest(o.selectors.product).find(o.selectors.productCheckbox);o.isDesktop||(t.preventDefault(),r.prop("checked",!r.prop("checked")).trigger("change"))})),t.nodes.$productSkuLabel.once().on("click",(function(e){e.preventDefault()})),t.nodes.$atbCta.once().on("click",(function(e){e.preventDefault(),o.addSelectedProductsToBag(t)})),t.nodes.$atbCtaSingular.once().on("click",(function(e){e.preventDefault(),o.addSelectedProductsToBag(t)})),t.nodes.$atbCtaNoItems.once().on("click",(function(e){e.preventDefault()})),e(window).on("resize",_.debounce((function(){o.updateIsDesktop(),o.isDesktop?(o.equalHeights(t.nodes.$productItemHeadline),o.equalHeights(t.nodes.$productItemContent),o.equalHeights(t.nodes.$productTitle),o.equalHeights(t.nodes.$productRating),o.initCarousel(t)):(t.nodes.$productTitle.height("auto"),t.nodes.$productRating.height("auto"),t.nodes.$productCarousel.filter(".slick-initialized").slick("destroy"))}),100))},init:function(t){var o=this;t.nodes.$product.each((function(){var r=e(this);o.updateProductInventoryStatus(r),o.initProductPrices(t,r),o.initProductSelectbox(t,r)})),o.initProductsRating(t),o.updateProductsCount(t),o.updateSelectedProductsCount(t),o.updateTotalPrice(t),o.initCarousel(t),o.isDesktop&&(o.equalHeights(t.nodes.$productItemHeadline),o.equalHeights(t.nodes.$productItemContent),o.equalHeights(t.nodes.$productTitle)),t.nodes.$atbCtaNoItems.addClass("elc-button--disabled"),t.addClass("elc-regimen-block-initialized")},initCarousel:function(t){var o=t.nodes.$product.length,r={rtl:site.direction.isRTL,infinite:!1,slidesToShow:4,slidesToScroll:4};this.isDesktop&&o>4&&t.nodes.$productCarousel.filter(":not(.slick-initialized)").each((function(){e(this).slick(r)}))},initProductPrices:function(e,t){var o=this,r=t.find(o.selectors.productPrice),a=t.find(o.selectors.productPrice2),s=t.find(o.selectors.productUnitPrice),d=r.attr("data-sku-price"),c=a.attr("data-sku-price2");r.text(o.getFormattedPrice(e,d)),a.text(c?o.getFormattedPrice(e,c):""),a.text()&&a.removeClass("hidden"),Drupal.settings&&!Drupal.settings.hide_product_price_per_unit&&s.text()&&s.removeClass("hidden")},initProductsRating:function(t){var o=this;new Promise(((o,r)=>{var a=Drupal.settings.power_reviews.snippet_url,s=Drupal.settings.power_reviews.api_key,d=Drupal.settings.power_reviews.merchant_id,c=Drupal.settings.power_reviews.locale,n=t.nodes.$product.toArray().map((t=>e(t).attr("data-prod-id"))).join(",").replaceAll("PROD","");a=a.replace("MERCHANT_ID",d).replace("PRODUCT_IDS",n).replace("API_KEY",s).replace("LOCALE_LANGUAGE",c),e.ajax(a).done((function(e){o(e)})).fail((function(e){r(e)}))})).then((r=>{t.nodes.$product.each((function(){var t=e(this),a=t.find(o.selectors.productRatingAverage),s=t.find(o.selectors.productRatingStars),d=t.find(o.selectors.productRatingTotal),c=t.attr("data-prod-id").replaceAll("PROD",""),n=r.results.filter((e=>parseInt(e.page_id)===parseInt(c)&&e.rollup)),i=0,u=0;n.length>0&&(i=n[0].rollup.average_rating||0,u=Math.round(i/5*100),s.css("width",`${u}%`),a.attr("data-rating-average",i),d.text(`(${n[0].rollup.review_count})`)),a.attr("data-rating-average")||(a.addClass("hidden"),d.addClass("hidden"))})),o.isDesktop&&o.equalHeights(t.nodes.$productRating)}))},initProductSelectbox:function(t,o){var r=this,a=o.find(r.selectors.productSizeDropdown),s=o.find(r.selectors.productShadeDropdown);a.selectbox({onOpen:function(){t.nodes.$productSizeDropdown.not(a).selectbox("close"),t.nodes.$productShadeDropdown.selectbox("close")},onChange:function(o){var a=e(this).find(`option[value='${o}']`);r.updateProductSku(t,a),r.updateTotalPrice(t)},loopOptions:!0,keepInViewport:!0,effect:"slide"}),s.selectbox({classSelector:`sbSelector ${r.productShadeDropdownSelectboxClasses.classSelector}`,onOpen:function(){var o=e("li a",s.next());o.find(r.selectors.productShadeDropdownColor).length<=0&&o.each((function(){var t=e(this),o=e("").addClass(r.productShadeDropdownSelectboxClasses.classColorSpan),a=s.find(`option[value='${t.attr("rel")}']`).attr("data-sku-color");t.prepend(o.css("background-color",a))})),t.nodes.$productSizeDropdown.selectbox("close"),t.nodes.$productShadeDropdown.not(s).selectbox("close")},onChange:function(o){var a=e(this).find(`option[value='${o}']`);r.updateProductShadeDropdownSelectorColor(s),r.updateProductSku(t,a),r.updateTotalPrice(t)},loopOptions:!0,keepInViewport:!0,effect:"slide"}),r.updateProductShadeDropdownSelectorColor(s)},updateProductInventoryStatus:function(e){var t=e.find(this.selectors.productCheckbox),o=e.find(this.selectors.productInventoryStatus),r=e.attr("data-inventory-status"),a=e.attr("data-is-orderable");switch(0===parseInt(a,10)?t.attr("disabled","disabled").prop("checked",!1).trigger("change"):t.attr("disabled")&&t.removeAttr("disabled").prop("checked",!0).trigger("change"),parseInt(r,10)){case 2:o.removeClass("hidden").text(site.translations.elc_product.item_is_temp_out_of_stock);break;case 3:o.removeClass("hidden").text(site.translations.elc_product.item_is_coming_soon_notify_me);break;case 7:o.removeClass("hidden").text(site.translations.elc_product.item_is_sold_out);break;default:o.addClass("hidden").text("")}},updateProductShadeDropdownSelectorColor:function(t){var o=t.next().find(this.selectors.productShadeDropdownSelector),r=t.find(":selected"),a=e("").addClass(this.productShadeDropdownSelectboxClasses.classColorSpan),s=r.attr("data-sku-color");o.prepend(a.css("background-color",s))},updateProductSku:function(e,t){var o=this,r=t.closest(o.selectors.product),a=r.find(o.selectors.productImage),s=r.find(o.selectors.productPrice),d=r.find(o.selectors.productPrice2),c=r.find(o.selectors.productUnitPrice),n=t.attr("data-sku-base-id"),i=t.attr("data-sku-inventory-status"),u=t.attr("data-sku-is-orderable"),l=t.attr("data-sku-image"),p=t.attr("data-sku-price"),g=t.attr("data-sku-price2"),h=t.attr("data-sku-formatted-price"),m=t.attr("data-sku-formatted-unit-price");r.attr("data-sku-base-id",n).attr("data-inventory-status",i).attr("data-is-orderable",u).attr("data-price",p).attr("data-price2",g).attr("data-formatted-price",h),a.attr("src",l),s.attr("data-sku-price",p).text(o.getFormattedPrice(e,p)),d.attr("data-sku-price2",g).text(g?o.getFormattedPrice(e,g):""),d.text()?d.removeClass("hidden"):d.addClass("hidden"),Drupal.settings&&!Drupal.settings.hide_product_price_per_unit&&(m?c.removeClass("hidden").text(m):c.addClass("hidden").text("")),o.updateProductInventoryStatus(r)},updateTotalPrice:function(t){var o,r=0;t.nodes.$selectedProducts.each((function(){r+=parseFloat(e(this).attr("data-price"))})),o=t.totalPriceText.replace("{total_price}",this.getFormattedPrice(t,r)),t.nodes.$totalPrice.text(o)},updateProductsCount:function(e){var t=e.nodes.$product.length;e.attr("data-products-count",t)},updateSelectedProductsCount:function(e){var t=e.nodes.$selectedProducts.length,o=e.atbCtaText.replace("{selected_count}",t),r=e.atbCtaSingularText.replace("{selected_count}",t),a=e.atbCtaNoItemsText.replace("{selected_count}",t);switch(t){case 0:e.nodes.$atbCtaNoItems.text(a),e.nodes.$atbCtaNoItems.parent().removeClass("hidden"),e.nodes.$atbCtaSingular.parent().addClass("hidden"),e.nodes.$atbCta.parent().addClass("hidden");break;case 1:e.nodes.$atbCtaSingular.text(r),e.nodes.$atbCtaNoItems.parent().addClass("hidden"),e.nodes.$atbCtaSingular.parent().removeClass("hidden"),e.nodes.$atbCta.parent().addClass("hidden");break;default:e.nodes.$atbCta.text(o),e.nodes.$atbCtaNoItems.parent().addClass("hidden"),e.nodes.$atbCta.parent().removeClass("hidden"),e.nodes.$atbCtaSingular.parent().addClass("hidden")}},equalHeights:function(t){var o;t.length<1||(t.height("auto"),(o=e(_.max(t,(function(t){return e(t).height()})))).length>0&&t.css("height",o.height()))},updateIsDesktop:function(){var e=Unison.fetch.all(),t=Unison.fetch.now();this.isDesktop=parseInt(t.width,10)>=parseInt(e["usn-medium-max"],10)},addSelectedProductsToBag:function(t){var o=[];if(t.nodes.$selectedProducts.each((function(){var t=e(this);o.push(t.attr("data-sku-base-id"))})),o.length>0){var r={skus:o,itemType:"cart",INCREMENT:1,CAT_BASE_ID:"",QTY:1};generic.checkout.cart.updateCart({params:r,onSuccess:function(t){var o=t.getMessages(),r="";if(o&&o.forEach((function(e){"offer_criteria_not_met"===e.key&&(r=r.concat(e.text+"
"))})),r)e(document).trigger("addToCart.failure",[o]),generic.overlay.launch({content:r,includeBackground:!0,cssStyle:{width:"324px",padding:"25px"}});else{var a=t.getData();e(document).trigger("addToCart.success",[a])}},onFailure:function(t){var o=t.getMessages(),r=e("
").html(''+o[0].text+"").html();e(document).trigger("addToCart.failure",[o]),generic.overlay.launch({content:r,includeBackground:!0,cssStyle:{width:"324px",padding:"25px"}})}})}},getFormattedPrice:function(e,t){var o=e.nodes.$product.first(),r=o.attr("data-formatted-price").replace(/^[USCA]+/,""),a=r.replace(/[^0-9,.]/gu,""),s=[",","."].includes(a?.substr(-3,1))?{minimumFractionDigits:2,maximumFractionDigits:2}:{},d=parseFloat(o.attr("data-price")).toLocaleString(Drupal.settings.price_locale,s),c=parseFloat(t).toLocaleString(Drupal.settings.price_locale,s);return r.replace(d,c)}}}(jQuery); ; (function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?module.exports=factory():typeof define==="function"&&define.amd?define(factory):global.videojs=factory()})(this,function(){var version="7.0.3";var commonjsGlobal=typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function createCommonjsModule(fn,module){return module={exports:{}},fn(module,module.exports),module.exports}var win;if(typeof window!=="undefined"){win=window}else if(typeof commonjsGlobal!=="undefined"){win=commonjsGlobal}else if(typeof self!=="undefined"){win=self}else{win={}}var window_1=win;var empty={};var empty$1=Object.freeze({default:empty});var minDoc=empty$1&&empty||empty$1;var topLevel=typeof commonjsGlobal!=="undefined"?commonjsGlobal:typeof window!=="undefined"?window:{};var doccy;if(typeof document!=="undefined"){doccy=document}else{doccy=topLevel["__GLOBAL_DOCUMENT_CACHE@4"];if(!doccy){doccy=topLevel["__GLOBAL_DOCUMENT_CACHE@4"]=minDoc}}var document_1=doccy;var log=void 0;var level="info";var history=[];var logByType=function logByType(type,args){var lvl=log.levels[level];var lvlRegExp=new RegExp("^("+lvl+")$");if(type!=="log"){args.unshift(type.toUpperCase()+":")}if(history){history.push([].concat(args))}args.unshift("VIDEOJS:");if(!window_1.console){return}var fn=window_1.console[type];if(!fn&&type==="debug"){fn=window_1.console.info||window_1.console.log}if(!fn||!lvl||!lvlRegExp.test(type)){return}fn[Array.isArray(args)?"apply":"call"](window_1.console,args)};log=function log(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}logByType("log",args)};log.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:level};log.level=function(lvl){if(typeof lvl==="string"){if(!log.levels.hasOwnProperty(lvl)){throw new Error('"'+lvl+'" in not a valid log level')}level=lvl}return level};log.history=function(){return history?[].concat(history):[]};log.history.clear=function(){if(history){history.length=0}};log.history.disable=function(){if(history!==null){history.length=0;history=null}};log.history.enable=function(){if(history===null){history=[]}};log.error=function(){for(var _len2=arguments.length,args=Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2]}return logByType("error",args)};log.warn=function(){for(var _len3=arguments.length,args=Array(_len3),_key3=0;_key3<_len3;_key3++){args[_key3]=arguments[_key3]}return logByType("warn",args)};log.debug=function(){for(var _len4=arguments.length,args=Array(_len4),_key4=0;_key4<_len4;_key4++){args[_key4]=arguments[_key4]}return logByType("debug",args)};var log$1=log;function clean(s){return s.replace(/\n\r?\s*/g,"")}var tsml=function tsml(sa){var s="",i=0;for(;i2&&arguments[2]!==undefined?arguments[2]:0;return keys(object).reduce(function(accum,key){return fn(accum,object[key],key)},initial)}function assign(target){for(var _len=arguments.length,sources=Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){sources[_key-1]=arguments[_key]}if(Object.assign){return Object.assign.apply(Object,[target].concat(sources))}sources.forEach(function(source){if(!source){return}each(source,function(value,key){target[key]=value})});return target}function isObject(value){return!!value&&(typeof value==="undefined"?"undefined":_typeof(value))==="object"}function isPlain(value){return isObject(value)&&toString.call(value)==="[object Object]"&&value.constructor===Object}function computedStyle(el,prop){if(!el||!prop){return""}if(typeof window_1.getComputedStyle==="function"){var cs=window_1.getComputedStyle(el);return cs?cs[prop]:""}return""}var _templateObject=taggedTemplateLiteralLoose(["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set "," to ","."],["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set "," to ","."]);function isNonBlankString(str){return typeof str==="string"&&/\S/.test(str)}function throwIfWhitespace(str){if(/\s/.test(str)){throw new Error("class has illegal whitespace characters")}}function classRegExp(className){return new RegExp("(^|\\s)"+className+"($|\\s)")}function isReal(){return document_1===window_1.document}function isEl(value){return isObject(value)&&value.nodeType===1}function isInFrame(){try{return window_1.parent!==window_1.self}catch(x){return true}}function createQuerier(method){return function(selector,context){if(!isNonBlankString(selector)){return document_1[method](null)}if(isNonBlankString(context)){context=document_1.querySelector(context)}var ctx=isEl(context)?context:document_1;return ctx[method]&&ctx[method](selector)}}function createEl(){var tagName=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"div";var properties=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var attributes=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var content=arguments[3];var el=document_1.createElement(tagName);Object.getOwnPropertyNames(properties).forEach(function(propName){var val=properties[propName];if(propName.indexOf("aria-")!==-1||propName==="role"||propName==="type"){log$1.warn(tsml(_templateObject,propName,val));el.setAttribute(propName,val)}else if(propName==="textContent"){textContent(el,val)}else{el[propName]=val}});Object.getOwnPropertyNames(attributes).forEach(function(attrName){el.setAttribute(attrName,attributes[attrName])});if(content){appendContent(el,content)}return el}function textContent(el,text){if(typeof el.textContent==="undefined"){el.innerText=text}else{el.textContent=text}return el}function prependTo(child,parent){if(parent.firstChild){parent.insertBefore(child,parent.firstChild)}else{parent.appendChild(child)}}function hasClass(element,classToCheck){throwIfWhitespace(classToCheck);if(element.classList){return element.classList.contains(classToCheck)}return classRegExp(classToCheck).test(element.className)}function addClass(element,classToAdd){if(element.classList){element.classList.add(classToAdd)}else if(!hasClass(element,classToAdd)){element.className=(element.className+" "+classToAdd).trim()}return element}function removeClass(element,classToRemove){if(element.classList){element.classList.remove(classToRemove)}else{throwIfWhitespace(classToRemove);element.className=element.className.split(/\s+/).filter(function(c){return c!==classToRemove}).join(" ")}return element}function toggleClass(element,classToToggle,predicate){var has=hasClass(element,classToToggle);if(typeof predicate==="function"){predicate=predicate(element,classToToggle)}if(typeof predicate!=="boolean"){predicate=!has}if(predicate===has){return}if(predicate){addClass(element,classToToggle)}else{removeClass(element,classToToggle)}return element}function setAttributes(el,attributes){Object.getOwnPropertyNames(attributes).forEach(function(attrName){var attrValue=attributes[attrName];if(attrValue===null||typeof attrValue==="undefined"||attrValue===false){el.removeAttribute(attrName)}else{el.setAttribute(attrName,attrValue===true?"":attrValue)}})}function getAttributes(tag){var obj={};var knownBooleans=","+"autoplay,controls,playsinline,loop,muted,default,defaultMuted"+",";if(tag&&tag.attributes&&tag.attributes.length>0){var attrs=tag.attributes;for(var i=attrs.length-1;i>=0;i--){var attrName=attrs[i].name;var attrVal=attrs[i].value;if(typeof tag[attrName]==="boolean"||knownBooleans.indexOf(","+attrName+",")!==-1){attrVal=attrVal!==null?true:false}obj[attrName]=attrVal}}return obj}function getAttribute(el,attribute){return el.getAttribute(attribute)}function setAttribute(el,attribute,value){el.setAttribute(attribute,value)}function removeAttribute(el,attribute){el.removeAttribute(attribute)}function blockTextSelection(){document_1.body.focus();document_1.onselectstart=function(){return false}}function unblockTextSelection(){document_1.onselectstart=function(){return true}}function getBoundingClientRect(el){if(el&&el.getBoundingClientRect&&el.parentNode){var rect=el.getBoundingClientRect();var result={};["bottom","height","left","right","top","width"].forEach(function(k){if(rect[k]!==undefined){result[k]=rect[k]}});if(!result.height){result.height=parseFloat(computedStyle(el,"height"))}if(!result.width){result.width=parseFloat(computedStyle(el,"width"))}return result}}function findPosition(el){var box=void 0;if(el.getBoundingClientRect&&el.parentNode){box=el.getBoundingClientRect()}if(!box){return{left:0,top:0}}var docEl=document_1.documentElement;var body=document_1.body;var clientLeft=docEl.clientLeft||body.clientLeft||0;var scrollLeft=window_1.pageXOffset||body.scrollLeft;var left=box.left+scrollLeft-clientLeft;var clientTop=docEl.clientTop||body.clientTop||0;var scrollTop=window_1.pageYOffset||body.scrollTop;var top=box.top+scrollTop-clientTop;return{left:Math.round(left),top:Math.round(top)}}function getPointerPosition(el,event){var position={};var box=findPosition(el);var boxW=el.offsetWidth;var boxH=el.offsetHeight;var boxY=box.top;var boxX=box.left;var pageY=event.pageY;var pageX=event.pageX;if(event.changedTouches){pageX=event.changedTouches[0].pageX;pageY=event.changedTouches[0].pageY}position.y=Math.max(0,Math.min(1,(boxY-pageY+boxH)/boxH));position.x=Math.max(0,Math.min(1,(pageX-boxX)/boxW));return position}function isTextNode(value){return isObject(value)&&value.nodeType===3}function emptyEl(el){while(el.firstChild){el.removeChild(el.firstChild)}return el}function normalizeContent(content){if(typeof content==="function"){content=content()}return(Array.isArray(content)?content:[content]).map(function(value){if(typeof value==="function"){value=value()}if(isEl(value)||isTextNode(value)){return value}if(typeof value==="string"&&/\S/.test(value)){return document_1.createTextNode(value)}}).filter(function(value){return value})}function appendContent(el,content){normalizeContent(content).forEach(function(node){return el.appendChild(node)});return el}function insertContent(el,content){return appendContent(emptyEl(el),content)}function isSingleLeftClick(event){if(event.button===undefined&&event.buttons===undefined){return true}if(event.button===0&&event.buttons===undefined){return true}if(event.button!==0||event.buttons!==1){return false}return true}var $=createQuerier("querySelector");var $$=createQuerier("querySelectorAll");var Dom=Object.freeze({isReal:isReal,isEl:isEl,isInFrame:isInFrame,createEl:createEl,textContent:textContent,prependTo:prependTo,hasClass:hasClass,addClass:addClass,removeClass:removeClass,toggleClass:toggleClass,setAttributes:setAttributes,getAttributes:getAttributes,getAttribute:getAttribute,setAttribute:setAttribute,removeAttribute:removeAttribute,blockTextSelection:blockTextSelection,unblockTextSelection:unblockTextSelection,getBoundingClientRect:getBoundingClientRect,findPosition:findPosition,getPointerPosition:getPointerPosition,isTextNode:isTextNode,emptyEl:emptyEl,normalizeContent:normalizeContent,appendContent:appendContent,insertContent:insertContent,isSingleLeftClick:isSingleLeftClick,$:$,$$:$$});var _guid=1;function newGUID(){return _guid++}var elData={};var elIdAttr="vdata"+(new Date).getTime();function getData(el){var id=el[elIdAttr];if(!id){id=el[elIdAttr]=newGUID()}if(!elData[id]){elData[id]={}}return elData[id]}function hasData(el){var id=el[elIdAttr];if(!id){return false}return!!Object.getOwnPropertyNames(elData[id]).length}function removeData(el){var id=el[elIdAttr];if(!id){return}delete elData[id];try{delete el[elIdAttr]}catch(e){if(el.removeAttribute){el.removeAttribute(elIdAttr)}else{el[elIdAttr]=null}}}function _cleanUpEvents(elem,type){var data=getData(elem);if(data.handlers[type].length===0){delete data.handlers[type];if(elem.removeEventListener){elem.removeEventListener(type,data.dispatcher,false)}else if(elem.detachEvent){elem.detachEvent("on"+type,data.dispatcher)}}if(Object.getOwnPropertyNames(data.handlers).length<=0){delete data.handlers;delete data.dispatcher;delete data.disabled}if(Object.getOwnPropertyNames(data).length===0){removeData(elem)}}function _handleMultipleEvents(fn,elem,types,callback){types.forEach(function(type){fn(elem,type,callback)})}function fixEvent(event){function returnTrue(){return true}function returnFalse(){return false}if(!event||!event.isPropagationStopped){var old=event||window_1.event;event={};for(var key in old){if(key!=="layerX"&&key!=="layerY"&&key!=="keyLocation"&&key!=="webkitMovementX"&&key!=="webkitMovementY"){if(!(key==="returnValue"&&old.preventDefault)){event[key]=old[key]}}}if(!event.target){event.target=event.srcElement||document_1}if(!event.relatedTarget){event.relatedTarget=event.fromElement===event.target?event.toElement:event.fromElement}event.preventDefault=function(){if(old.preventDefault){old.preventDefault()}event.returnValue=false;old.returnValue=false;event.defaultPrevented=true};event.defaultPrevented=false;event.stopPropagation=function(){if(old.stopPropagation){old.stopPropagation()}event.cancelBubble=true;old.cancelBubble=true;event.isPropagationStopped=returnTrue};event.isPropagationStopped=returnFalse;event.stopImmediatePropagation=function(){if(old.stopImmediatePropagation){old.stopImmediatePropagation()}event.isImmediatePropagationStopped=returnTrue;event.stopPropagation()};event.isImmediatePropagationStopped=returnFalse;if(event.clientX!==null&&event.clientX!==undefined){var doc=document_1.documentElement;var body=document_1.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc&&doc.clientLeft||body&&body.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc&&doc.clientTop||body&&body.clientTop||0)}event.which=event.charCode||event.keyCode;if(event.button!==null&&event.button!==undefined){event.button=event.button&1?0:event.button&4?1:event.button&2?2:0}}return event}var _supportsPassive=false;(function(){try{var opts=Object.defineProperty({},"passive",{get:function get(){_supportsPassive=true}});window_1.addEventListener("test",null,opts);window_1.removeEventListener("test",null,opts)}catch(e){}})();var passiveEvents=["touchstart","touchmove"];function on(elem,type,fn){if(Array.isArray(type)){return _handleMultipleEvents(on,elem,type,fn)}var data=getData(elem);if(!data.handlers){data.handlers={}}if(!data.handlers[type]){data.handlers[type]=[]}if(!fn.guid){fn.guid=newGUID()}data.handlers[type].push(fn);if(!data.dispatcher){data.disabled=false;data.dispatcher=function(event,hash){if(data.disabled){return}event=fixEvent(event);var handlers=data.handlers[event.type];if(handlers){var handlersCopy=handlers.slice(0);for(var m=0,n=handlersCopy.length;m-1){options={passive:true}}elem.addEventListener(type,data.dispatcher,options)}else if(elem.attachEvent){elem.attachEvent("on"+type,data.dispatcher)}}}function off(elem,type,fn){if(!hasData(elem)){return}var data=getData(elem);if(!data.handlers){return}if(Array.isArray(type)){return _handleMultipleEvents(off,elem,type,fn)}var removeType=function removeType(el,t){data.handlers[t]=[];_cleanUpEvents(el,t)};if(type===undefined){for(var t in data.handlers){if(Object.prototype.hasOwnProperty.call(data.handlers||{},t)){removeType(elem,t)}}return}var handlers=data.handlers[type];if(!handlers){return}if(!fn){removeType(elem,type);return}if(fn.guid){for(var n=0;n0){for(var i=0,e=mediaEls.length;i=wait){fn.apply(undefined,arguments);last=now}};return throttled};var debounce=function debounce(func,wait,immediate){var context=arguments.length>3&&arguments[3]!==undefined?arguments[3]:window_1;var timeout=void 0;return function(){var self=this;var args=arguments;var _later=function later(){timeout=null;_later=null;if(!immediate){func.apply(self,args)}};if(!timeout&&immediate){func.apply(self,args)}context.clearTimeout(timeout);timeout=context.setTimeout(_later,wait)}};var EventTarget=function EventTarget(){};EventTarget.prototype.allowedEvents_={};EventTarget.prototype.on=function(type,fn){var ael=this.addEventListener;this.addEventListener=function(){};on(this,type,fn);this.addEventListener=ael};EventTarget.prototype.addEventListener=EventTarget.prototype.on;EventTarget.prototype.off=function(type,fn){off(this,type,fn)};EventTarget.prototype.removeEventListener=EventTarget.prototype.off;EventTarget.prototype.one=function(type,fn){var ael=this.addEventListener;this.addEventListener=function(){};one(this,type,fn);this.addEventListener=ael};EventTarget.prototype.trigger=function(event){var type=event.type||event;if(typeof event==="string"){event={type:type}}event=fixEvent(event);if(this.allowedEvents_[type]&&this["on"+type]){this["on"+type](event)}trigger(this,event)};EventTarget.prototype.dispatchEvent=EventTarget.prototype.trigger;var isEvented=function isEvented(object){return object instanceof EventTarget||!!object.eventBusEl_&&["on","one","off","trigger"].every(function(k){return typeof object[k]==="function"})};var isValidEventType=function isValidEventType(type){return typeof type==="string"&&/\S/.test(type)||Array.isArray(type)&&!!type.length};var validateTarget=function validateTarget(target){if(!target.nodeName&&!isEvented(target)){throw new Error("Invalid target; must be a DOM node or evented object.")}};var validateEventType=function validateEventType(type){if(!isValidEventType(type)){throw new Error("Invalid event type; must be a non-empty string or array.")}};var validateListener=function validateListener(listener){if(typeof listener!=="function"){throw new Error("Invalid listener; must be a function.")}};var normalizeListenArgs=function normalizeListenArgs(self,args){var isTargetingSelf=args.length<3||args[0]===self||args[0]===self.eventBusEl_;var target=void 0;var type=void 0;var listener=void 0;if(isTargetingSelf){target=self.eventBusEl_;if(args.length>=3){args.shift()}type=args[0];listener=args[1]}else{target=args[0];type=args[1];listener=args[2]}validateTarget(target);validateEventType(type);validateListener(listener);listener=bind(self,listener);return{isTargetingSelf:isTargetingSelf,target:target,type:type,listener:listener}};var listen=function listen(target,method,type,listener){validateTarget(target);if(target.nodeName){Events[method](target,type,listener)}else{target[method](type,listener)}};var EventedMixin={on:function on$$1(){var _this=this;for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}var _normalizeListenArgs=normalizeListenArgs(this,args),isTargetingSelf=_normalizeListenArgs.isTargetingSelf,target=_normalizeListenArgs.target,type=_normalizeListenArgs.type,listener=_normalizeListenArgs.listener;listen(target,"on",type,listener);if(!isTargetingSelf){var removeListenerOnDispose=function removeListenerOnDispose(){return _this.off(target,type,listener)};removeListenerOnDispose.guid=listener.guid;var removeRemoverOnTargetDispose=function removeRemoverOnTargetDispose(){return _this.off("dispose",removeListenerOnDispose)};removeRemoverOnTargetDispose.guid=listener.guid;listen(this,"on","dispose",removeListenerOnDispose);listen(target,"on","dispose",removeRemoverOnTargetDispose)}},one:function one$$1(){var _this2=this;for(var _len2=arguments.length,args=Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2]}var _normalizeListenArgs2=normalizeListenArgs(this,args),isTargetingSelf=_normalizeListenArgs2.isTargetingSelf,target=_normalizeListenArgs2.target,type=_normalizeListenArgs2.type,listener=_normalizeListenArgs2.listener;if(isTargetingSelf){listen(target,"one",type,listener)}else{var wrapper=function wrapper(){for(var _len3=arguments.length,largs=Array(_len3),_key3=0;_key3<_len3;_key3++){largs[_key3]=arguments[_key3]}_this2.off(target,type,wrapper);listener.apply(null,largs)};wrapper.guid=listener.guid;listen(target,"one",type,wrapper)}},off:function off$$1(targetOrType,typeOrListener,listener){if(!targetOrType||isValidEventType(targetOrType)){off(this.eventBusEl_,targetOrType,typeOrListener)}else{var target=targetOrType;var type=typeOrListener;validateTarget(target);validateEventType(type);validateListener(listener);listener=bind(this,listener);this.off("dispose",listener);if(target.nodeName){off(target,type,listener);off(target,"dispose",listener)}else if(isEvented(target)){target.off(type,listener);target.off("dispose",listener)}}},trigger:function trigger$$1(event,hash){return trigger(this.eventBusEl_,event,hash)}};function evented(target){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var eventBusKey=options.eventBusKey;if(eventBusKey){if(!target[eventBusKey].nodeName){throw new Error('The eventBusKey "'+eventBusKey+'" does not refer to an element.')}target.eventBusEl_=target[eventBusKey]}else{target.eventBusEl_=createEl("span",{className:"vjs-event-bus"})}assign(target,EventedMixin);target.on("dispose",function(){target.off();window_1.setTimeout(function(){target.eventBusEl_=null},0)});return target}var StatefulMixin={state:{},setState:function setState(stateUpdates){var _this=this;if(typeof stateUpdates==="function"){stateUpdates=stateUpdates()}var changes=void 0;each(stateUpdates,function(value,key){if(_this.state[key]!==value){changes=changes||{};changes[key]={from:_this.state[key],to:value}}_this.state[key]=value});if(changes&&isEvented(this)){this.trigger({changes:changes,type:"statechanged"})}return changes}};function stateful(target,defaultState){assign(target,StatefulMixin);target.state=assign({},target.state,defaultState);if(typeof target.handleStateChanged==="function"&&isEvented(target)){target.on("statechanged",target.handleStateChanged)}return target}function toTitleCase(string){if(typeof string!=="string"){return string}return string.charAt(0).toUpperCase()+string.slice(1)}function titleCaseEquals(str1,str2){return toTitleCase(str1)===toTitleCase(str2)}function mergeOptions(){var result={};for(var _len=arguments.length,sources=Array(_len),_key=0;_key<_len;_key++){sources[_key]=arguments[_key]}sources.forEach(function(source){if(!source){return}each(source,function(value,key){if(!isPlain(value)){result[key]=value;return}if(!isPlain(result[key])){result[key]={}}result[key]=mergeOptions(result[key],value)})});return result}var Component=function(){function Component(player,options,ready){classCallCheck(this,Component);if(!player&&this.play){this.player_=player=this}else{this.player_=player}this.options_=mergeOptions({},this.options_);options=this.options_=mergeOptions(this.options_,options);this.id_=options.id||options.el&&options.el.id;if(!this.id_){var id=player&&player.id&&player.id()||"no_player";this.id_=id+"_component_"+newGUID()}this.name_=options.name||null;if(options.el){this.el_=options.el}else if(options.createEl!==false){this.el_=this.createEl()}if(options.evented!==false){evented(this,{eventBusKey:this.el_?"el_":null})}stateful(this,this.constructor.defaultState);this.children_=[];this.childIndex_={};this.childNameIndex_={};if(options.initChildren!==false){this.initChildren()}this.ready(ready);if(options.reportTouchActivity!==false){this.enableTouchActivity()}}Component.prototype.dispose=function dispose(){this.trigger({type:"dispose",bubbles:false});if(this.children_){for(var i=this.children_.length-1;i>=0;i--){if(this.children_[i].dispose){this.children_[i].dispose()}}}this.children_=null;this.childIndex_=null;this.childNameIndex_=null;if(this.el_){if(this.el_.parentNode){this.el_.parentNode.removeChild(this.el_)}removeData(this.el_);this.el_=null}this.player_=null};Component.prototype.player=function player(){return this.player_};Component.prototype.options=function options(obj){log$1.warn("this.options() has been deprecated and will be moved to the constructor in 6.0");if(!obj){return this.options_}this.options_=mergeOptions(this.options_,obj);return this.options_};Component.prototype.el=function el(){return this.el_};Component.prototype.createEl=function createEl$$1(tagName,properties,attributes){return createEl(tagName,properties,attributes)};Component.prototype.localize=function localize(string,tokens){var defaultValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:string;var code=this.player_.language&&this.player_.language();var languages=this.player_.languages&&this.player_.languages();var language=languages&&languages[code];var primaryCode=code&&code.split("-")[0];var primaryLang=languages&&languages[primaryCode];var localizedString=defaultValue;if(language&&language[string]){localizedString=language[string]}else if(primaryLang&&primaryLang[string]){localizedString=primaryLang[string]}if(tokens){localizedString=localizedString.replace(/\{(\d+)\}/g,function(match,index){var value=tokens[index-1];var ret=value;if(typeof value==="undefined"){ret=match}return ret})}return localizedString};Component.prototype.contentEl=function contentEl(){return this.contentEl_||this.el_};Component.prototype.id=function id(){return this.id_};Component.prototype.name=function name(){return this.name_};Component.prototype.children=function children(){return this.children_};Component.prototype.getChildById=function getChildById(id){return this.childIndex_[id]};Component.prototype.getChild=function getChild(name){if(!name){return}name=toTitleCase(name);return this.childNameIndex_[name]};Component.prototype.addChild=function addChild(child){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var index=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.children_.length;var component=void 0;var componentName=void 0;if(typeof child==="string"){componentName=toTitleCase(child);var componentClassName=options.componentClass||componentName;options.name=componentName;var ComponentClass=Component.getComponent(componentClassName);if(!ComponentClass){throw new Error("Component "+componentClassName+" does not exist")}if(typeof ComponentClass!=="function"){return null}component=new ComponentClass(this.player_||this,options)}else{component=child}this.children_.splice(index,0,component);if(typeof component.id==="function"){this.childIndex_[component.id()]=component}componentName=componentName||component.name&&toTitleCase(component.name());if(componentName){this.childNameIndex_[componentName]=component}if(typeof component.el==="function"&&component.el()){var childNodes=this.contentEl().children;var refNode=childNodes[index]||null;this.contentEl().insertBefore(component.el(),refNode)}return component};Component.prototype.removeChild=function removeChild(component){if(typeof component==="string"){component=this.getChild(component)}if(!component||!this.children_){return}var childFound=false;for(var i=this.children_.length-1;i>=0;i--){if(this.children_[i]===component){childFound=true;this.children_.splice(i,1);break}}if(!childFound){return}this.childIndex_[component.id()]=null;this.childNameIndex_[component.name()]=null;var compEl=component.el();if(compEl&&compEl.parentNode===this.contentEl()){this.contentEl().removeChild(component.el())}};Component.prototype.initChildren=function initChildren(){var _this=this;var children=this.options_.children;if(children){var parentOptions=this.options_;var handleAdd=function handleAdd(child){var name=child.name;var opts=child.opts;if(parentOptions[name]!==undefined){opts=parentOptions[name]}if(opts===false){return}if(opts===true){opts={}}opts.playerOptions=_this.options_.playerOptions;var newChild=_this.addChild(name,opts);if(newChild){_this[name]=newChild}};var workingChildren=void 0;var Tech=Component.getComponent("Tech");if(Array.isArray(children)){workingChildren=children}else{workingChildren=Object.keys(children)}workingChildren.concat(Object.keys(this.options_).filter(function(child){return!workingChildren.some(function(wchild){if(typeof wchild==="string"){return child===wchild}return child===wchild.name})})).map(function(child){var name=void 0;var opts=void 0;if(typeof child==="string"){name=child;opts=children[name]||_this.options_[name]||{}}else{name=child.name;opts=child}return{name:name,opts:opts}}).filter(function(child){var c=Component.getComponent(child.opts.componentClass||toTitleCase(child.name));return c&&!Tech.isTech(c)}).forEach(handleAdd)}};Component.prototype.buildCSSClass=function buildCSSClass(){return""};Component.prototype.ready=function ready(fn){var sync=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!fn){return}if(!this.isReady_){this.readyQueue_=this.readyQueue_||[];this.readyQueue_.push(fn);return}if(sync){fn.call(this)}else{this.setTimeout(fn,1)}};Component.prototype.triggerReady=function triggerReady(){this.isReady_=true;this.setTimeout(function(){var readyQueue=this.readyQueue_;this.readyQueue_=[];if(readyQueue&&readyQueue.length>0){readyQueue.forEach(function(fn){fn.call(this)},this)}this.trigger("ready")},1)};Component.prototype.$=function $$$1(selector,context){return $(selector,context||this.contentEl())};Component.prototype.$$=function $$$$1(selector,context){return $$(selector,context||this.contentEl())};Component.prototype.hasClass=function hasClass$$1(classToCheck){return hasClass(this.el_,classToCheck)};Component.prototype.addClass=function addClass$$1(classToAdd){addClass(this.el_,classToAdd)};Component.prototype.removeClass=function removeClass$$1(classToRemove){removeClass(this.el_,classToRemove)};Component.prototype.toggleClass=function toggleClass$$1(classToToggle,predicate){toggleClass(this.el_,classToToggle,predicate)};Component.prototype.show=function show(){this.removeClass("vjs-hidden")};Component.prototype.hide=function hide(){this.addClass("vjs-hidden")};Component.prototype.lockShowing=function lockShowing(){this.addClass("vjs-lock-showing")};Component.prototype.unlockShowing=function unlockShowing(){this.removeClass("vjs-lock-showing")};Component.prototype.getAttribute=function getAttribute$$1(attribute){return getAttribute(this.el_,attribute)};Component.prototype.setAttribute=function setAttribute$$1(attribute,value){setAttribute(this.el_,attribute,value)};Component.prototype.removeAttribute=function removeAttribute$$1(attribute){removeAttribute(this.el_,attribute)};Component.prototype.width=function width(num,skipListeners){return this.dimension("width",num,skipListeners)};Component.prototype.height=function height(num,skipListeners){return this.dimension("height",num,skipListeners)};Component.prototype.dimensions=function dimensions(width,height){this.width(width,true);this.height(height)};Component.prototype.dimension=function dimension(widthOrHeight,num,skipListeners){if(num!==undefined){if(num===null||num!==num){num=0}if((""+num).indexOf("%")!==-1||(""+num).indexOf("px")!==-1){this.el_.style[widthOrHeight]=num}else if(num==="auto"){this.el_.style[widthOrHeight]=""}else{this.el_.style[widthOrHeight]=num+"px"}if(!skipListeners){this.trigger("componentresize")}return}if(!this.el_){return 0}var val=this.el_.style[widthOrHeight];var pxIndex=val.indexOf("px");if(pxIndex!==-1){return parseInt(val.slice(0,pxIndex),10)}return parseInt(this.el_["offset"+toTitleCase(widthOrHeight)],10)};Component.prototype.currentDimension=function currentDimension(widthOrHeight){var computedWidthOrHeight=0;if(widthOrHeight!=="width"&&widthOrHeight!=="height"){throw new Error("currentDimension only accepts width or height value")}if(typeof window_1.getComputedStyle==="function"){var computedStyle=window_1.getComputedStyle(this.el_);computedWidthOrHeight=computedStyle.getPropertyValue(widthOrHeight)||computedStyle[widthOrHeight]}computedWidthOrHeight=parseFloat(computedWidthOrHeight);if(computedWidthOrHeight===0){var rule="offset"+toTitleCase(widthOrHeight);computedWidthOrHeight=this.el_[rule]}return computedWidthOrHeight};Component.prototype.currentDimensions=function currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}};Component.prototype.currentWidth=function currentWidth(){return this.currentDimension("width")};Component.prototype.currentHeight=function currentHeight(){return this.currentDimension("height")};Component.prototype.focus=function focus(){this.el_.focus()};Component.prototype.blur=function blur(){this.el_.blur()};Component.prototype.emitTapEvents=function emitTapEvents(){var touchStart=0;var firstTouch=null;var tapMovementThreshold=10;var touchTimeThreshold=200;var couldBeTap=void 0;this.on("touchstart",function(event){if(event.touches.length===1){firstTouch={pageX:event.touches[0].pageX,pageY:event.touches[0].pageY};touchStart=(new Date).getTime();couldBeTap=true}});this.on("touchmove",function(event){if(event.touches.length>1){couldBeTap=false}else if(firstTouch){var xdiff=event.touches[0].pageX-firstTouch.pageX;var ydiff=event.touches[0].pageY-firstTouch.pageY;var touchDistance=Math.sqrt(xdiff*xdiff+ydiff*ydiff);if(touchDistance>tapMovementThreshold){couldBeTap=false}}});var noTap=function noTap(){couldBeTap=false};this.on("touchleave",noTap);this.on("touchcancel",noTap);this.on("touchend",function(event){firstTouch=null;if(couldBeTap===true){var touchTime=(new Date).getTime()-touchStart;if(touchTime0&&playerNames.map(function(pname){return players[pname]}).every(Boolean)){throw new Error("Can not register Player component after player has been created.")}}Component.components_[name]=ComponentToRegister;return ComponentToRegister};Component.getComponent=function getComponent(name){if(!name){return}name=toTitleCase(name);if(Component.components_&&Component.components_[name]){return Component.components_[name]}};return Component}();Component.prototype.supportsRaf_=typeof window_1.requestAnimationFrame==="function"&&typeof window_1.cancelAnimationFrame==="function";Component.registerComponent("Component",Component);var USER_AGENT=window_1.navigator&&window_1.navigator.userAgent||"";var webkitVersionMap=/AppleWebKit\/([\d.]+)/i.exec(USER_AGENT);var appleWebkitVersion=webkitVersionMap?parseFloat(webkitVersionMap.pop()):null;var IS_IPAD=/iPad/i.test(USER_AGENT);var IS_IPHONE=/iPhone/i.test(USER_AGENT)&&!IS_IPAD;var IS_IPOD=/iPod/i.test(USER_AGENT);var IS_IOS=IS_IPHONE||IS_IPAD||IS_IPOD;var IOS_VERSION=function(){var match=USER_AGENT.match(/OS (\d+)_/i);if(match&&match[1]){return match[1]}return null}();var IS_ANDROID=/Android/i.test(USER_AGENT);var ANDROID_VERSION=function(){var match=USER_AGENT.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!match){return null}var major=match[1]&&parseFloat(match[1]);var minor=match[2]&&parseFloat(match[2]);if(major&&minor){return parseFloat(match[1]+"."+match[2])}else if(major){return major}return null}();var IS_NATIVE_ANDROID=IS_ANDROID&&ANDROID_VERSION<5&&appleWebkitVersion<537;var IS_FIREFOX=/Firefox/i.test(USER_AGENT);var IS_EDGE=/Edge/i.test(USER_AGENT);var IS_CHROME=!IS_EDGE&&/Chrome/i.test(USER_AGENT);var CHROME_VERSION=function(){var match=USER_AGENT.match(/Chrome\/(\d+)/);if(match&&match[1]){return parseFloat(match[1])}return null}();var IE_VERSION=function(){var result=/MSIE\s(\d+)\.\d/.exec(USER_AGENT);var version=result&&parseFloat(result[1]);if(!version&&/Trident\/7.0/i.test(USER_AGENT)&&/rv:11.0/.test(USER_AGENT)){version=11}return version}();var IS_SAFARI=/Safari/i.test(USER_AGENT)&&!IS_CHROME&&!IS_ANDROID&&!IS_EDGE;var IS_ANY_SAFARI=IS_SAFARI||IS_IOS;var TOUCH_ENABLED=isReal()&&("ontouchstart"in window_1||window_1.DocumentTouch&&window_1.document instanceof window_1.DocumentTouch);var browser=Object.freeze({IS_IPAD:IS_IPAD,IS_IPHONE:IS_IPHONE,IS_IPOD:IS_IPOD,IS_IOS:IS_IOS,IOS_VERSION:IOS_VERSION,IS_ANDROID:IS_ANDROID,ANDROID_VERSION:ANDROID_VERSION,IS_NATIVE_ANDROID:IS_NATIVE_ANDROID,IS_FIREFOX:IS_FIREFOX,IS_EDGE:IS_EDGE,IS_CHROME:IS_CHROME,CHROME_VERSION:CHROME_VERSION,IE_VERSION:IE_VERSION,IS_SAFARI:IS_SAFARI,IS_ANY_SAFARI:IS_ANY_SAFARI,TOUCH_ENABLED:TOUCH_ENABLED});function rangeCheck(fnName,index,maxIndex){if(typeof index!=="number"||index<0||index>maxIndex){throw new Error("Failed to execute '"+fnName+"' on 'TimeRanges': The index provided ("+index+") is non-numeric or out of bounds (0-"+maxIndex+").")}}function getRange(fnName,valueIndex,ranges,rangeIndex){rangeCheck(fnName,rangeIndex,ranges.length-1);return ranges[rangeIndex][valueIndex]}function createTimeRangesObj(ranges){if(ranges===undefined||ranges.length===0){return{length:0,start:function start(){throw new Error("This TimeRanges object is empty")},end:function end(){throw new Error("This TimeRanges object is empty")}}}return{length:ranges.length,start:getRange.bind(null,"start",0,ranges),end:getRange.bind(null,"end",1,ranges)}}function createTimeRanges(start,end){if(Array.isArray(start)){return createTimeRangesObj(start)}else if(start===undefined||end===undefined){return createTimeRangesObj()}return createTimeRangesObj([[start,end]])}function bufferedPercent(buffered,duration){var bufferedDuration=0;var start=void 0;var end=void 0;if(!duration){return 0}if(!buffered||!buffered.length){buffered=createTimeRanges(0,0)}for(var i=0;iduration){end=duration}bufferedDuration+=end-start}return bufferedDuration/duration}var FullscreenApi={};var apiMap=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]];var specApi=apiMap[0];var browserApi=void 0;for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:[];classCallCheck(this,TrackList);var _this=possibleConstructorReturn(this,_EventTarget.call(this));_this.tracks_=[];Object.defineProperty(_this,"length",{get:function get$$1(){return this.tracks_.length}});for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:[];classCallCheck(this,AudioTrackList);for(var i=tracks.length-1;i>=0;i--){if(tracks[i].enabled){disableOthers(tracks,tracks[i]);break}}var _this=possibleConstructorReturn(this,_TrackList.call(this,tracks));_this.changing_=false;return _this}AudioTrackList.prototype.addTrack=function addTrack(track){var _this2=this;if(track.enabled){disableOthers(this,track)}_TrackList.prototype.addTrack.call(this,track);if(!track.addEventListener){return}track.addEventListener("enabledchange",function(){if(_this2.changing_){return}_this2.changing_=true;disableOthers(_this2,track);_this2.changing_=false;_this2.trigger("change")})};return AudioTrackList}(TrackList);var disableOthers$1=function disableOthers(list,track){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:[];classCallCheck(this,VideoTrackList);for(var i=tracks.length-1;i>=0;i--){if(tracks[i].selected){disableOthers$1(tracks,tracks[i]);break}}var _this=possibleConstructorReturn(this,_TrackList.call(this,tracks));_this.changing_=false;Object.defineProperty(_this,"selectedIndex",{get:function get$$1(){for(var _i=0;_i0&&arguments[0]!==undefined?arguments[0]:[];classCallCheck(this,HtmlTrackElementList);this.trackElements_=[];Object.defineProperty(this,"length",{get:function get$$1(){return this.trackElements_.length}});for(var i=0,length=trackElements.length;i0&&arguments[0]!==undefined?arguments[0]:{};classCallCheck(this,Track);var _this=possibleConstructorReturn(this,_EventTarget.call(this));var trackProps={id:options.id||"vjs_track_"+newGUID(),kind:options.kind||"",label:options.label||"",language:options.language||""};var _loop=function _loop(key){Object.defineProperty(_this,key,{get:function get$$1(){return trackProps[key]},set:function set$$1(){}})};for(var key in trackProps){_loop(key)}return _this}return Track}(EventTarget);var parseUrl=function parseUrl(url){var props=["protocol","hostname","port","pathname","search","hash","host"];var a=document_1.createElement("a");a.href=url;var addToBody=a.host===""&&a.protocol!=="file:";var div=void 0;if(addToBody){div=document_1.createElement("div");div.innerHTML='';a=div.firstChild;div.setAttribute("style","display:none; position:absolute;");document_1.body.appendChild(div)}var details={};for(var i=0;ix';url=div.firstChild.href}return url};var getFileExtension=function getFileExtension(path){if(typeof path==="string"){var splitPathRe=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i;var pathParts=splitPathRe.exec(path);if(pathParts){return pathParts.pop().toLowerCase()}}return""};var isCrossOrigin=function isCrossOrigin(url){var winLoc=window_1.location;var urlInfo=parseUrl(url);var srcProtocol=urlInfo.protocol===":"?winLoc.protocol:urlInfo.protocol;var crossOrigin=srcProtocol+urlInfo.host!==winLoc.protocol+winLoc.host;return crossOrigin};var Url=Object.freeze({parseUrl:parseUrl,getAbsoluteURL:getAbsoluteURL,getFileExtension:getFileExtension,isCrossOrigin:isCrossOrigin});var isFunction_1=isFunction;var toString$1=Object.prototype.toString;function isFunction(fn){var string=toString$1.call(fn);return string==="[object Function]"||typeof fn==="function"&&string!=="[object RegExp]"||typeof window!=="undefined"&&(fn===window.setTimeout||fn===window.alert||fn===window.confirm||fn===window.prompt)}var isFunction$1=Object.freeze({default:isFunction_1,__moduleExports:isFunction_1});var trim_1=createCommonjsModule(function(module,exports){exports=module.exports=trim;function trim(str){return str.replace(/^\s*|\s*$/g,"")}exports.left=function(str){return str.replace(/^\s*/,"")};exports.right=function(str){return str.replace(/\s*$/,"")}});var trim_2=trim_1.left;var trim_3=trim_1.right;var trim=Object.freeze({default:trim_1,__moduleExports:trim_1,left:trim_2,right:trim_3});var isFunction$2=isFunction$1&&isFunction_1||isFunction$1;var forEach_1=forEach;var toString$2=Object.prototype.toString;var hasOwnProperty=Object.prototype.hasOwnProperty;function forEach(list,iterator,context){if(!isFunction$2(iterator)){throw new TypeError("iterator must be a function")}if(arguments.length<3){context=this}if(toString$2.call(list)==="[object Array]")forEachArray(list,iterator,context);else if(typeof list==="string")forEachString(list,iterator,context);else forEachObject(list,iterator,context)}function forEachArray(array,iterator,context){for(var i=0,len=array.length;i0){timeoutTimer=setTimeout(function(){if(aborted)return;aborted=true;xhr.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT";errorFunc(e)},options.timeout)}if(xhr.setRequestHeader){for(key in headers){if(headers.hasOwnProperty(key)){xhr.setRequestHeader(key,headers[key])}}}else if(options.headers&&!isEmpty(options.headers)){throw new Error("Headers cannot be set on an XDomainRequest object")}if("responseType"in options){xhr.responseType=options.responseType}if("beforeSend"in options&&typeof options.beforeSend==="function"){options.beforeSend(xhr)}xhr.send(body||null);return xhr}function getXml(xhr){if(xhr.responseType==="document"){return xhr.responseXML}var firefoxBugTakenEffect=xhr.responseXML&&xhr.responseXML.documentElement.nodeName==="parsererror";if(xhr.responseType===""&&!firefoxBugTakenEffect){return xhr.responseXML}return null}function noop(){}var parseCues=function parseCues(srcContent,track){var parser=new window_1.WebVTT.Parser(window_1,window_1.vttjs,window_1.WebVTT.StringDecoder());var errors=[];parser.oncue=function(cue){track.addCue(cue)};parser.onparsingerror=function(error){errors.push(error)};parser.onflush=function(){track.trigger({type:"loadeddata",target:track})};parser.parse(srcContent);if(errors.length>0){if(window_1.console&&window_1.console.groupCollapsed){window_1.console.groupCollapsed("Text Track parsing errors for "+track.src)}errors.forEach(function(error){return log$1.error(error)});if(window_1.console&&window_1.console.groupEnd){window_1.console.groupEnd()}}parser.flush()};var loadTrack=function loadTrack(src,track){var opts={uri:src};var crossOrigin=isCrossOrigin(src);if(crossOrigin){opts.cors=crossOrigin}xhr(opts,bind(this,function(err,response,responseBody){if(err){return log$1.error(err,response)}track.loaded_=true;if(typeof window_1.WebVTT!=="function"){if(track.tech_){var loadHandler=function loadHandler(){return parseCues(responseBody,track)};track.tech_.on("vttjsloaded",loadHandler);track.tech_.on("vttjserror",function(){log$1.error("vttjs failed to load, stopping trying to process "+track.src);track.tech_.off("vttjsloaded",loadHandler)})}}else{parseCues(responseBody,track)}}))};var TextTrack=function(_Track){inherits(TextTrack,_Track);function TextTrack(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};classCallCheck(this,TextTrack);if(!options.tech){throw new Error("A tech was not provided.")}var settings=mergeOptions(options,{kind:TextTrackKind[options.kind]||"subtitles",language:options.language||options.srclang||""});var mode=TextTrackMode[settings.mode]||"disabled";var default_=settings.default;if(settings.kind==="metadata"||settings.kind==="chapters"){mode="hidden"}var _this=possibleConstructorReturn(this,_Track.call(this,settings));_this.tech_=settings.tech;_this.cues_=[];_this.activeCues_=[];var cues=new TextTrackCueList(_this.cues_);var activeCues=new TextTrackCueList(_this.activeCues_);var changed=false;var timeupdateHandler=bind(_this,function(){this.activeCues;if(changed){this.trigger("cuechange");changed=false}});if(mode!=="disabled"){_this.tech_.ready(function(){_this.tech_.on("timeupdate",timeupdateHandler)},true)}Object.defineProperties(_this,{default:{get:function get$$1(){return default_},set:function set$$1(){}},mode:{get:function get$$1(){return mode},set:function set$$1(newMode){var _this2=this;if(!TextTrackMode[newMode]){return}mode=newMode;if(mode==="showing"){this.tech_.ready(function(){_this2.tech_.on("timeupdate",timeupdateHandler)},true)}this.trigger("modechange")}},cues:{get:function get$$1(){if(!this.loaded_){return null}return cues},set:function set$$1(){}},activeCues:{get:function get$$1(){if(!this.loaded_){return null}if(this.cues.length===0){return activeCues}var ct=this.tech_.currentTime();var active=[];for(var i=0,l=this.cues.length;i=ct){active.push(cue)}else if(cue.startTime===cue.endTime&&cue.startTime<=ct&&cue.startTime+.5>=ct){active.push(cue)}}changed=false;if(active.length!==this.activeCues_.length){changed=true}else{for(var _i=0;_i0&&arguments[0]!==undefined?arguments[0]:{};classCallCheck(this,AudioTrack);var settings=mergeOptions(options,{kind:AudioTrackKind[options.kind]||""});var _this=possibleConstructorReturn(this,_Track.call(this,settings));var enabled=false;Object.defineProperty(_this,"enabled",{get:function get$$1(){return enabled},set:function set$$1(newEnabled){if(typeof newEnabled!=="boolean"||newEnabled===enabled){return}enabled=newEnabled;this.trigger("enabledchange")}});if(settings.enabled){_this.enabled=settings.enabled}_this.loaded_=true;return _this}return AudioTrack}(Track);var VideoTrack=function(_Track){inherits(VideoTrack,_Track);function VideoTrack(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};classCallCheck(this,VideoTrack);var settings=mergeOptions(options,{kind:VideoTrackKind[options.kind]||""});var _this=possibleConstructorReturn(this,_Track.call(this,settings));var selected=false;Object.defineProperty(_this,"selected",{get:function get$$1(){return selected},set:function set$$1(newSelected){if(typeof newSelected!=="boolean"||newSelected===selected){return}selected=newSelected;this.trigger("selectedchange")}});if(settings.selected){_this.selected=settings.selected}return _this}return VideoTrack}(Track);var NONE=0;var LOADING=1;var LOADED=2;var ERROR=3;var HTMLTrackElement=function(_EventTarget){inherits(HTMLTrackElement,_EventTarget);function HTMLTrackElement(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};classCallCheck(this,HTMLTrackElement);var _this=possibleConstructorReturn(this,_EventTarget.call(this));var readyState=void 0;var track=new TextTrack(options);_this.kind=track.kind;_this.src=track.src;_this.srclang=track.language;_this.label=track.label;_this.default=track.default;Object.defineProperties(_this,{readyState:{get:function get$$1(){return readyState}},track:{get:function get$$1(){return track}}});readyState=NONE;track.addEventListener("loadeddata",function(){readyState=LOADED;_this.trigger({type:"load",target:_this})});return _this}return HTMLTrackElement}(EventTarget);HTMLTrackElement.prototype.allowedEvents_={load:"load"};HTMLTrackElement.NONE=NONE;HTMLTrackElement.LOADING=LOADING;HTMLTrackElement.LOADED=LOADED;HTMLTrackElement.ERROR=ERROR;var NORMAL={audio:{ListClass:AudioTrackList,TrackClass:AudioTrack,capitalName:"Audio"},video:{ListClass:VideoTrackList,TrackClass:VideoTrack,capitalName:"Video"},text:{ListClass:TextTrackList,TrackClass:TextTrack,capitalName:"Text"}};Object.keys(NORMAL).forEach(function(type){NORMAL[type].getterName=type+"Tracks";NORMAL[type].privateName=type+"Tracks_"});var REMOTE={remoteText:{ListClass:TextTrackList,TrackClass:TextTrack,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:HtmlTrackElementList,TrackClass:HTMLTrackElement,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}};var ALL=mergeOptions(NORMAL,REMOTE);REMOTE.names=Object.keys(REMOTE);NORMAL.names=Object.keys(NORMAL);ALL.names=[].concat(REMOTE.names).concat(NORMAL.names);var _objCreate=Object.create||function(){function F(){}return function(o){if(arguments.length!==1){throw new Error("Object.create shim only accepts one parameter.")}F.prototype=o;return new F}}();function ParsingError(errorData,message){this.name="ParsingError";this.code=errorData.code;this.message=message||errorData.message}ParsingError.prototype=_objCreate(Error.prototype);ParsingError.prototype.constructor=ParsingError;ParsingError.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function parseTimeStamp(input){function computeSeconds(h,m,s,f){return(h|0)*3600+(m|0)*60+(s|0)+(f|0)/1e3}var m=input.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);if(!m){return null}if(m[3]){return computeSeconds(m[1],m[2],m[3].replace(":",""),m[4])}else if(m[1]>59){return computeSeconds(m[1],m[2],0,m[4])}else{return computeSeconds(0,m[1],m[2],m[4])}}function Settings(){this.values=_objCreate(null)}Settings.prototype={set:function set(k,v){if(!this.get(k)&&v!==""){this.values[k]=v}},get:function get(k,dflt,defaultKey){if(defaultKey){return this.has(k)?this.values[k]:dflt[defaultKey]}return this.has(k)?this.values[k]:dflt},has:function has(k){return k in this.values},alt:function alt(k,v,a){for(var n=0;n=0&&v<=100){this.set(k,v);return true}}return false}};function parseOptions(input,callback,keyValueDelim,groupDelim){var groups=groupDelim?input.split(groupDelim):[input];for(var i in groups){if(typeof groups[i]!=="string"){continue}var kv=groups[i].split(keyValueDelim);if(kv.length!==2){continue}var k=kv[0];var v=kv[1];callback(k,v)}}function parseCue(input,cue,regionList){var oInput=input;function consumeTimeStamp(){var ts=parseTimeStamp(input);if(ts===null){throw new ParsingError(ParsingError.Errors.BadTimeStamp,"Malformed timestamp: "+oInput)}input=input.replace(/^[^\sa-zA-Z-]+/,"");return ts}function consumeCueSettings(input,cue){var settings=new Settings;parseOptions(input,function(k,v){switch(k){case"region":for(var i=regionList.length-1;i>=0;i--){if(regionList[i].id===v){settings.set(k,regionList[i].region);break}}break;case"vertical":settings.alt(k,v,["rl","lr"]);break;case"line":var vals=v.split(","),vals0=vals[0];settings.integer(k,vals0);settings.percent(k,vals0)?settings.set("snapToLines",false):null;settings.alt(k,vals0,["auto"]);if(vals.length===2){settings.alt("lineAlign",vals[1],["start","middle","end"])}break;case"position":vals=v.split(",");settings.percent(k,vals[0]);if(vals.length===2){settings.alt("positionAlign",vals[1],["start","middle","end"])}break;case"size":settings.percent(k,v);break;case"align":settings.alt(k,v,["start","middle","end","left","right"]);break}},/:/,/\s/);cue.region=settings.get("region",null);cue.vertical=settings.get("vertical","");cue.line=settings.get("line","auto");cue.lineAlign=settings.get("lineAlign","start");cue.snapToLines=settings.get("snapToLines",true);cue.size=settings.get("size",100);cue.align=settings.get("align","middle");cue.position=settings.get("position",{start:0,left:0,middle:50,end:100,right:100},cue.align);cue.positionAlign=settings.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},cue.align)}function skipWhitespace(){input=input.replace(/^\s+/,"")}skipWhitespace();cue.startTime=consumeTimeStamp();skipWhitespace();if(input.substr(0,3)!=="--\x3e"){throw new ParsingError(ParsingError.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+oInput)}input=input.substr(3);skipWhitespace();cue.endTime=consumeTimeStamp();skipWhitespace();consumeCueSettings(input,cue)}var ESCAPE={"&":"&","<":"<",">":">","‎":"‎","‏":"‏"," ":" "};var TAG_NAME={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"};var TAG_ANNOTATION={v:"title",lang:"lang"};var NEEDS_PARENT={rt:"ruby"};function parseContent(window,input){function nextToken(){if(!input){return null}function consume(result){input=input.substr(result.length);return result}var m=input.match(/^([^<]*)(<[^>]*>?)?/);return consume(m[1]?m[1]:m[2])}function unescape1(e){return ESCAPE[e]}function unescape(s){while(m=s.match(/&(amp|lt|gt|lrm|rlm|nbsp);/)){s=s.replace(m[0],unescape1)}return s}function shouldAdd(current,element){return!NEEDS_PARENT[element.localName]||NEEDS_PARENT[element.localName]===current.localName}function createElement(type,annotation){var tagName=TAG_NAME[type];if(!tagName){return null}var element=window.document.createElement(tagName);element.localName=tagName;var name=TAG_ANNOTATION[type];if(name&&annotation){element[name]=annotation.trim()}return element}var rootDiv=window.document.createElement("div"),current=rootDiv,t,tagStack=[];while((t=nextToken())!==null){if(t[0]==="<"){if(t[1]==="/"){if(tagStack.length&&tagStack[tagStack.length-1]===t.substr(2).replace(">","")){tagStack.pop();current=current.parentNode}continue}var ts=parseTimeStamp(t.substr(1,t.length-2));var node;if(ts){node=window.document.createProcessingInstruction("timestamp",ts);current.appendChild(node);continue}var m=t.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!m){continue}node=createElement(m[1],m[3]);if(!node){continue}if(!shouldAdd(current,node)){continue}if(m[2]){node.className=m[2].substr(1).replace("."," ")}tagStack.push(m[1]);current.appendChild(node);current=node;continue}current.appendChild(window.document.createTextNode(unescape(t)))}return rootDiv}var strongRTLRanges=[[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 isStrongRTLChar(charCode){for(var i=0;i=currentRange[0]&&charCode<=currentRange[1]){return true}}return false}function determineBidi(cueDiv){var nodeStack=[],text="",charCode;if(!cueDiv||!cueDiv.childNodes){return"ltr"}function pushNodes(nodeStack,node){for(var i=node.childNodes.length-1;i>=0;i--){nodeStack.push(node.childNodes[i])}}function nextTextNode(nodeStack){if(!nodeStack||!nodeStack.length){return null}var node=nodeStack.pop(),text=node.textContent||node.innerText;if(text){var m=text.match(/^.*(\n|\r)/);if(m){nodeStack.length=0;return m[0]}return text}if(node.tagName==="ruby"){return nextTextNode(nodeStack)}if(node.childNodes){pushNodes(nodeStack,node);return nextTextNode(nodeStack)}}pushNodes(nodeStack,cueDiv);while(text=nextTextNode(nodeStack)){for(var i=0;i=0&&cue.line<=100)){return cue.line}if(!cue.track||!cue.track.textTrackList||!cue.track.textTrackList.mediaElement){return-1}var track=cue.track,trackList=track.textTrackList,count=0;for(var i=0;ib2.left&&this.topb2.top};BoxPosition.prototype.overlapsAny=function(boxes){for(var i=0;i=container.top&&this.bottom<=container.bottom&&this.left>=container.left&&this.right<=container.right};BoxPosition.prototype.overlapsOppositeAxis=function(container,axis){switch(axis){case"+x":return this.leftcontainer.right;case"+y":return this.topcontainer.bottom}};BoxPosition.prototype.intersectPercentage=function(b2){var x=Math.max(0,Math.min(this.right,b2.right)-Math.max(this.left,b2.left)),y=Math.max(0,Math.min(this.bottom,b2.bottom)-Math.max(this.top,b2.top)),intersectArea=x*y;return intersectArea/(this.height*this.width)};BoxPosition.prototype.toCSSCompatValues=function(reference){return{top:this.top-reference.top,bottom:reference.bottom-this.bottom,left:this.left-reference.left,right:reference.right-this.right,height:this.height,width:this.width}};BoxPosition.getSimpleBoxPosition=function(obj){var height=obj.div?obj.div.offsetHeight:obj.tagName?obj.offsetHeight:0;var width=obj.div?obj.div.offsetWidth:obj.tagName?obj.offsetWidth:0;var top=obj.div?obj.div.offsetTop:obj.tagName?obj.offsetTop:0;obj=obj.div?obj.div.getBoundingClientRect():obj.tagName?obj.getBoundingClientRect():obj;var ret={left:obj.left,right:obj.right,top:obj.top||top,height:obj.height||height,bottom:obj.bottom||top+(obj.height||height),width:obj.width||width};return ret};function moveBoxToLinePosition(window,styleBox,containerBox,boxPositions){function findBestPosition(b,axis){var bestPosition,specifiedPosition=new BoxPosition(b),percentage=1;for(var i=0;ip){bestPosition=new BoxPosition(b);percentage=p}b=new BoxPosition(specifiedPosition)}return bestPosition||specifiedPosition}var boxPosition=new BoxPosition(styleBox),cue=styleBox.cue,linePos=computeLinePos(cue),axis=[];if(cue.snapToLines){var size;switch(cue.vertical){case"":axis=["+y","-y"];size="height";break;case"rl":axis=["+x","-x"];size="width";break;case"lr":axis=["-x","+x"];size="width";break}var step=boxPosition.lineHeight,position=step*Math.round(linePos),maxPosition=containerBox[size]+step,initialAxis=axis[0];if(Math.abs(position)>maxPosition){position=position<0?-1:1;position*=Math.ceil(maxPosition/step)*step}if(linePos<0){position+=cue.vertical===""?containerBox.height:containerBox.width;axis=axis.reverse()}boxPosition.move(initialAxis,position)}else{var calculatedPercentage=boxPosition.lineHeight/containerBox.height*100;switch(cue.lineAlign){case"middle":linePos-=calculatedPercentage/2;break;case"end":linePos-=calculatedPercentage;break}switch(cue.vertical){case"":styleBox.applyStyles({top:styleBox.formatStyle(linePos,"%")});break;case"rl":styleBox.applyStyles({left:styleBox.formatStyle(linePos,"%")});break;case"lr":styleBox.applyStyles({right:styleBox.formatStyle(linePos,"%")});break}axis=["+y","-x","+x","-y"];boxPosition=new BoxPosition(styleBox)}var bestPosition=findBestPosition(boxPosition,axis);styleBox.move(bestPosition.toCSSCompatValues(containerBox))}function WebVTT$1(){}WebVTT$1.StringDecoder=function(){return{decode:function decode(data){if(!data){return""}if(typeof data!=="string"){throw new Error("Error - expected string data.")}return decodeURIComponent(encodeURIComponent(data))}}};WebVTT$1.convertCueToDOMTree=function(window,cuetext){if(!window||!cuetext){return null}return parseContent(window,cuetext)};var FONT_SIZE_PERCENT=.05;var FONT_STYLE="sans-serif";var CUE_BACKGROUND_PADDING="1.5%";WebVTT$1.processCues=function(window,cues,overlay){if(!window||!cues||!overlay){return null}while(overlay.firstChild){overlay.removeChild(overlay.firstChild)}var paddedOverlay=window.document.createElement("div");paddedOverlay.style.position="absolute";paddedOverlay.style.left="0";paddedOverlay.style.right="0";paddedOverlay.style.top="0";paddedOverlay.style.bottom="0";paddedOverlay.style.margin=CUE_BACKGROUND_PADDING;overlay.appendChild(paddedOverlay);function shouldCompute(cues){for(var i=0;i100){throw new Error("Position must be between 0 and 100.")}_position=value;this.hasBeenReset=true}},positionAlign:{enumerable:true,get:function get(){return _positionAlign},set:function set(value){var setting=findAlignSetting(value);if(!setting){throw new SyntaxError("An invalid or illegal string was specified.")}_positionAlign=setting;this.hasBeenReset=true}},size:{enumerable:true,get:function get(){return _size},set:function set(value){if(value<0||value>100){throw new Error("Size must be between 0 and 100.")}_size=value;this.hasBeenReset=true}},align:{enumerable:true,get:function get(){return _align},set:function set(value){var setting=findAlignSetting(value);if(!setting){throw new SyntaxError("An invalid or illegal string was specified.")}_align=setting;this.hasBeenReset=true}}});this.displayState=undefined}VTTCue.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var vttcue=VTTCue;var vttcue$1=Object.freeze({default:vttcue,__moduleExports:vttcue});var scrollSetting={"":true,up:true};function findScrollSetting(value){if(typeof value!=="string"){return false}var scroll=scrollSetting[value.toLowerCase()];return scroll?value.toLowerCase():false}function isValidPercentValue(value){return typeof value==="number"&&value>=0&&value<=100}function VTTRegion(){var _width=100;var _lines=3;var _regionAnchorX=0;var _regionAnchorY=100;var _viewportAnchorX=0;var _viewportAnchorY=100;var _scroll="";Object.defineProperties(this,{width:{enumerable:true,get:function get(){return _width},set:function set(value){if(!isValidPercentValue(value)){throw new Error("Width must be between 0 and 100.")}_width=value}},lines:{enumerable:true,get:function get(){return _lines},set:function set(value){if(typeof value!=="number"){throw new TypeError("Lines must be set to a number.")}_lines=value}},regionAnchorY:{enumerable:true,get:function get(){return _regionAnchorY},set:function set(value){if(!isValidPercentValue(value)){throw new Error("RegionAnchorX must be between 0 and 100.")}_regionAnchorY=value}},regionAnchorX:{enumerable:true,get:function get(){return _regionAnchorX},set:function set(value){if(!isValidPercentValue(value)){throw new Error("RegionAnchorY must be between 0 and 100.")}_regionAnchorX=value}},viewportAnchorY:{enumerable:true,get:function get(){return _viewportAnchorY},set:function set(value){if(!isValidPercentValue(value)){throw new Error("ViewportAnchorY must be between 0 and 100.")}_viewportAnchorY=value}},viewportAnchorX:{enumerable:true,get:function get(){return _viewportAnchorX},set:function set(value){if(!isValidPercentValue(value)){throw new Error("ViewportAnchorX must be between 0 and 100.")}_viewportAnchorX=value}},scroll:{enumerable:true,get:function get(){return _scroll},set:function set(value){var setting=findScrollSetting(value);if(setting===false){throw new SyntaxError("An invalid or illegal string was specified.")}_scroll=setting}}})}var vttregion=VTTRegion;var vttregion$1=Object.freeze({default:vttregion,__moduleExports:vttregion});var require$$0=vtt$1&&vtt||vtt$1;var require$$1=vttcue$1&&vttcue||vttcue$1;var require$$2=vttregion$1&&vttregion||vttregion$1;var browserIndex=createCommonjsModule(function(module){var vttjs=module.exports={WebVTT:require$$0,VTTCue:require$$1,VTTRegion:require$$2};window_1.vttjs=vttjs;window_1.WebVTT=vttjs.WebVTT;var cueShim=vttjs.VTTCue;var regionShim=vttjs.VTTRegion;var nativeVTTCue=window_1.VTTCue;var nativeVTTRegion=window_1.VTTRegion;vttjs.shim=function(){window_1.VTTCue=cueShim;window_1.VTTRegion=regionShim};vttjs.restore=function(){window_1.VTTCue=nativeVTTCue;window_1.VTTRegion=nativeVTTRegion};if(!window_1.VTTCue){vttjs.shim()}});var browserIndex_1=browserIndex.WebVTT;var browserIndex_2=browserIndex.VTTCue;var browserIndex_3=browserIndex.VTTRegion;function createTrackHelper(self,kind,label,language){var options=arguments.length>4&&arguments[4]!==undefined?arguments[4]:{};var tracks=self.textTracks();options.kind=kind;if(label){options.label=label}if(language){options.language=language}options.tech=self;var track=new ALL.text.TrackClass(options);tracks.addTrack(track);return track}var Tech=function(_Component){inherits(Tech,_Component);function Tech(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var ready=arguments.length>1&&arguments[1]!==undefined?arguments[1]:function(){};classCallCheck(this,Tech);options.reportTouchActivity=false;var _this=possibleConstructorReturn(this,_Component.call(this,null,options,ready));_this.hasStarted_=false;_this.on("playing",function(){this.hasStarted_=true});_this.on("loadstart",function(){this.hasStarted_=false});ALL.names.forEach(function(name){var props=ALL[name];if(options&&options[props.getterName]){_this[props.privateName]=options[props.getterName]}});if(!_this.featuresProgressEvents){_this.manualProgressOn()}if(!_this.featuresTimeupdateEvents){_this.manualTimeUpdatesOn()}["Text","Audio","Video"].forEach(function(track){if(options["native"+track+"Tracks"]===false){_this["featuresNative"+track+"Tracks"]=false}});if(options.nativeCaptions===false||options.nativeTextTracks===false){_this.featuresNativeTextTracks=false}else if(options.nativeCaptions===true||options.nativeTextTracks===true){_this.featuresNativeTextTracks=true}if(!_this.featuresNativeTextTracks){_this.emulateTextTracks()}_this.autoRemoteTextTracks_=new ALL.text.ListClass;_this.initTrackListeners();if(!options.nativeControlsForTouch){_this.emitTapEvents()}if(_this.constructor){_this.name_=_this.constructor.name||"Unknown Tech"}return _this}Tech.prototype.triggerSourceset=function triggerSourceset(src){var _this2=this;if(!this.isReady_){this.one("ready",function(){return _this2.setTimeout(function(){return _this2.triggerSourceset(src)},1)})}this.trigger({src:src,type:"sourceset"})};Tech.prototype.manualProgressOn=function manualProgressOn(){this.on("durationchange",this.onDurationChange);this.manualProgress=true;this.one("ready",this.trackProgress)};Tech.prototype.manualProgressOff=function manualProgressOff(){this.manualProgress=false;this.stopTrackingProgress();this.off("durationchange",this.onDurationChange)};Tech.prototype.trackProgress=function trackProgress(event){this.stopTrackingProgress();this.progressInterval=this.setInterval(bind(this,function(){var numBufferedPercent=this.bufferedPercent();if(this.bufferedPercent_!==numBufferedPercent){this.trigger("progress")}this.bufferedPercent_=numBufferedPercent;if(numBufferedPercent===1){this.stopTrackingProgress()}}),500)};Tech.prototype.onDurationChange=function onDurationChange(event){this.duration_=this.duration()};Tech.prototype.buffered=function buffered(){return createTimeRanges(0,0)};Tech.prototype.bufferedPercent=function bufferedPercent$$1(){return bufferedPercent(this.buffered(),this.duration_)};Tech.prototype.stopTrackingProgress=function stopTrackingProgress(){this.clearInterval(this.progressInterval)};Tech.prototype.manualTimeUpdatesOn=function manualTimeUpdatesOn(){this.manualTimeUpdates=true;this.on("play",this.trackCurrentTime);this.on("pause",this.stopTrackingCurrentTime)};Tech.prototype.manualTimeUpdatesOff=function manualTimeUpdatesOff(){this.manualTimeUpdates=false;this.stopTrackingCurrentTime();this.off("play",this.trackCurrentTime);this.off("pause",this.stopTrackingCurrentTime)};Tech.prototype.trackCurrentTime=function trackCurrentTime(){if(this.currentTimeInterval){this.stopTrackingCurrentTime()}this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})},250)};Tech.prototype.stopTrackingCurrentTime=function stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval);this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})};Tech.prototype.dispose=function dispose(){this.clearTracks(NORMAL.names);if(this.manualProgress){this.manualProgressOff()}if(this.manualTimeUpdates){this.manualTimeUpdatesOff()}_Component.prototype.dispose.call(this)};Tech.prototype.clearTracks=function clearTracks(types){var _this3=this;types=[].concat(types);types.forEach(function(type){var list=_this3[type+"Tracks"]()||[];var i=list.length;while(i--){var track=list[i];if(type==="text"){_this3.removeRemoteTextTrack(track)}list.removeTrack(track)}})};Tech.prototype.cleanupAutoTextTracks=function cleanupAutoTextTracks(){var list=this.autoRemoteTextTracks_||[];var i=list.length;while(i--){var track=list[i];this.removeRemoteTextTrack(track)}};Tech.prototype.reset=function reset(){};Tech.prototype.error=function error(err){if(err!==undefined){this.error_=new MediaError(err);this.trigger("error")}return this.error_};Tech.prototype.played=function played(){if(this.hasStarted_){return createTimeRanges(0,0)}return createTimeRanges()};Tech.prototype.setCurrentTime=function setCurrentTime(){if(this.manualTimeUpdates){this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})}};Tech.prototype.initTrackListeners=function initTrackListeners(){var _this4=this;NORMAL.names.forEach(function(name){var props=NORMAL[name];var trackListChanges=function trackListChanges(){_this4.trigger(name+"trackchange")};var tracks=_this4[props.getterName]();tracks.addEventListener("removetrack",trackListChanges);tracks.addEventListener("addtrack",trackListChanges);_this4.on("dispose",function(){tracks.removeEventListener("removetrack",trackListChanges);tracks.removeEventListener("addtrack",trackListChanges)})})};Tech.prototype.addWebVttScript_=function addWebVttScript_(){var _this5=this;if(window_1.WebVTT){return}if(document_1.body.contains(this.el())){if(!this.options_["vtt.js"]&&isPlain(browserIndex)&&Object.keys(browserIndex).length>0){this.trigger("vttjsloaded");return}var script=document_1.createElement("script");script.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js";script.onload=function(){_this5.trigger("vttjsloaded")};script.onerror=function(){_this5.trigger("vttjserror")};this.on("dispose",function(){script.onload=null;script.onerror=null});window_1.WebVTT=true;this.el().parentNode.appendChild(script)}else{this.ready(this.addWebVttScript_)}};Tech.prototype.emulateTextTracks=function emulateTextTracks(){var _this6=this;var tracks=this.textTracks();var remoteTracks=this.remoteTextTracks();var handleAddTrack=function handleAddTrack(e){return tracks.addTrack(e.track)};var handleRemoveTrack=function handleRemoveTrack(e){return tracks.removeTrack(e.track)};remoteTracks.on("addtrack",handleAddTrack);remoteTracks.on("removetrack",handleRemoveTrack);this.addWebVttScript_();var updateDisplay=function updateDisplay(){return _this6.trigger("texttrackchange")};var textTracksChanges=function textTracksChanges(){updateDisplay();for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:{};var manualCleanup=arguments[1];var htmlTrackElement=this.createRemoteTextTrack(options);if(manualCleanup!==true&&manualCleanup!==false){log$1.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js');manualCleanup=true}this.remoteTextTrackEls().addTrackElement_(htmlTrackElement);this.remoteTextTracks().addTrack(htmlTrackElement.track);if(manualCleanup!==true){this.ready(function(){return _this7.autoRemoteTextTracks_.addTrack(htmlTrackElement.track)})}return htmlTrackElement};Tech.prototype.removeRemoteTextTrack=function removeRemoteTextTrack(track){var trackElement=this.remoteTextTrackEls().getTrackElementByTrack_(track);this.remoteTextTrackEls().removeTrackElement_(trackElement);this.remoteTextTracks().removeTrack(track);this.autoRemoteTextTracks_.removeTrack(track)};Tech.prototype.getVideoPlaybackQuality=function getVideoPlaybackQuality(){return{}};Tech.prototype.setPoster=function setPoster(){};Tech.prototype.playsinline=function playsinline(){};Tech.prototype.setPlaysinline=function setPlaysinline(){};Tech.prototype.overrideNativeAudioTracks=function overrideNativeAudioTracks(){};Tech.prototype.overrideNativeVideoTracks=function overrideNativeVideoTracks(){};Tech.prototype.canPlayType=function canPlayType(){return""};Tech.canPlayType=function canPlayType(){return""};Tech.canPlaySource=function canPlaySource(srcObj,options){return Tech.canPlayType(srcObj.type)};Tech.isTech=function isTech(component){return component.prototype instanceof Tech||component instanceof Tech||component===Tech};Tech.registerTech=function registerTech(name,tech){if(!Tech.techs_){Tech.techs_={}}if(!Tech.isTech(tech)){throw new Error("Tech "+name+" must be a Tech")}if(!Tech.canPlayType){throw new Error("Techs must have a static canPlayType method on them")}if(!Tech.canPlaySource){throw new Error("Techs must have a static canPlaySource method on them")}name=toTitleCase(name);Tech.techs_[name]=tech;if(name!=="Tech"){Tech.defaultTechOrder_.push(name)}return tech};Tech.getTech=function getTech(name){if(!name){return}name=toTitleCase(name);if(Tech.techs_&&Tech.techs_[name]){return Tech.techs_[name]}if(window_1&&window_1.videojs&&window_1.videojs[name]){log$1.warn("The "+name+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)");return window_1.videojs[name]}};return Tech}(Component);ALL.names.forEach(function(name){var props=ALL[name];Tech.prototype[props.getterName]=function(){this[props.privateName]=this[props.privateName]||new props.ListClass;return this[props.privateName]}});Tech.prototype.featuresVolumeControl=true;Tech.prototype.featuresFullscreenResize=false;Tech.prototype.featuresPlaybackRate=false;Tech.prototype.featuresProgressEvents=false;Tech.prototype.featuresSourceset=false;Tech.prototype.featuresTimeupdateEvents=false;Tech.prototype.featuresNativeTextTracks=false;Tech.withSourceHandlers=function(_Tech){_Tech.registerSourceHandler=function(handler,index){var handlers=_Tech.sourceHandlers;if(!handlers){handlers=_Tech.sourceHandlers=[]}if(index===undefined){index=handlers.length}handlers.splice(index,0,handler)};_Tech.canPlayType=function(type){var handlers=_Tech.sourceHandlers||[];var can=void 0;for(var i=0;i3&&arguments[3]!==undefined?arguments[3]:null;var callMethod="call"+toTitleCase(method);var middlewareValue=middleware.reduce(middlewareIterator(callMethod),arg);var terminated=middlewareValue===TERMINATOR;var returnValue=terminated?null:tech[method](middlewareValue);executeRight(middleware,method,returnValue,terminated);return returnValue}var allowedGetters={buffered:1,currentTime:1,duration:1,seekable:1,played:1,paused:1};var allowedSetters={setCurrentTime:1};var allowedMediators={play:1,pause:1};function middlewareIterator(method){return function(value,mw){if(value===TERMINATOR){return TERMINATOR}if(mw[method]){return mw[method](value)}return value}}function executeRight(mws,method,value,terminated){for(var i=mws.length-1;i>=0;i--){var mw=mws[i];if(mw[method]){mw[method](terminated,value)}}}function clearCacheForPlayer(player){middlewareInstances[player.id()]=null}function getOrCreateFactory(player,mwFactory){var mws=middlewareInstances[player.id()];var mw=null;if(mws===undefined||mws===null){mw=mwFactory(player);middlewareInstances[player.id()]=[[mwFactory,mw]];return mw}for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:{};var middleware=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var next=arguments[2];var player=arguments[3];var acc=arguments.length>4&&arguments[4]!==undefined?arguments[4]:[];var lastRun=arguments.length>5&&arguments[5]!==undefined?arguments[5]:false;var mwFactory=middleware[0],mwrest=middleware.slice(1);if(typeof mwFactory==="string"){setSourceHelper(src,middlewares[mwFactory],next,player,acc,lastRun)}else if(mwFactory){var mw=getOrCreateFactory(player,mwFactory);mw.setSource(assign({},src),function(err,_src){if(err){return setSourceHelper(src,mwrest,next,player,acc,lastRun)}acc.push(mw);setSourceHelper(_src,src.type===_src.type?mwrest:middlewares[_src.type],next,player,acc,lastRun)})}else if(mwrest.length){setSourceHelper(src,mwrest,next,player,acc,lastRun)}else if(lastRun){next(src,acc)}else{setSourceHelper(src,middlewares["*"],next,player,acc,true)}}var MimetypesKind={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",mp3:"audio/mpeg",aac:"audio/aac",oga:"audio/ogg",m3u8:"application/x-mpegURL"};var getMimetype=function getMimetype(){var src=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";var ext=getFileExtension(src);var mimetype=MimetypesKind[ext.toLowerCase()];return mimetype||""};var findMimetype=function findMimetype(player,src){if(!src){return""}if(player.cache_.source.src===src&&player.cache_.source.type){return player.cache_.source.type}var matchingSources=player.cache_.sources.filter(function(s){return s.src===src});if(matchingSources.length){return matchingSources[0].type}var sources=player.$$("source");for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:"div";var props=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var attributes=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};props=assign({innerHTML:'',className:this.buildCSSClass(),tabIndex:0},props);if(tag==="button"){log$1.error("Creating a ClickableComponent with an HTML element of "+tag+" is not supported; use a Button instead.")}attributes=assign({role:"button"},attributes);this.tabIndex_=props.tabIndex;var el=_Component.prototype.createEl.call(this,tag,props,attributes);this.createControlTextEl(el);return el};ClickableComponent.prototype.dispose=function dispose(){this.controlTextEl_=null;_Component.prototype.dispose.call(this)};ClickableComponent.prototype.createControlTextEl=function createControlTextEl(el){this.controlTextEl_=createEl("span",{className:"vjs-control-text"},{"aria-live":"polite"});if(el){el.appendChild(this.controlTextEl_)}this.controlText(this.controlText_,el);return this.controlTextEl_};ClickableComponent.prototype.controlText=function controlText(text){var el=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.el();if(text===undefined){return this.controlText_||"Need Text"}var localizedText=this.localize(text);this.controlText_=text;textContent(this.controlTextEl_,localizedText);if(!this.nonIconControl){el.setAttribute("title",localizedText)}};ClickableComponent.prototype.buildCSSClass=function buildCSSClass(){return"vjs-control vjs-button "+_Component.prototype.buildCSSClass.call(this)};ClickableComponent.prototype.enable=function enable(){if(!this.enabled_){this.enabled_=true;this.removeClass("vjs-disabled");this.el_.setAttribute("aria-disabled","false");if(typeof this.tabIndex_!=="undefined"){this.el_.setAttribute("tabIndex",this.tabIndex_)}this.on(["tap","click"],this.handleClick);this.on("focus",this.handleFocus);this.on("blur",this.handleBlur)}};ClickableComponent.prototype.disable=function disable(){this.enabled_=false;this.addClass("vjs-disabled");this.el_.setAttribute("aria-disabled","true");if(typeof this.tabIndex_!=="undefined"){this.el_.removeAttribute("tabIndex")}this.off(["tap","click"],this.handleClick);this.off("focus",this.handleFocus);this.off("blur",this.handleBlur)};ClickableComponent.prototype.handleClick=function handleClick(event){};ClickableComponent.prototype.handleFocus=function handleFocus(event){on(document_1,"keydown",bind(this,this.handleKeyPress))};ClickableComponent.prototype.handleKeyPress=function handleKeyPress(event){if(event.which===32||event.which===13){event.preventDefault();this.trigger("click")}else if(_Component.prototype.handleKeyPress){_Component.prototype.handleKeyPress.call(this,event)}};ClickableComponent.prototype.handleBlur=function handleBlur(event){off(document_1,"keydown",bind(this,this.handleKeyPress))};return ClickableComponent}(Component);Component.registerComponent("ClickableComponent",ClickableComponent);var PosterImage=function(_ClickableComponent){inherits(PosterImage,_ClickableComponent);function PosterImage(player,options){classCallCheck(this,PosterImage);var _this=possibleConstructorReturn(this,_ClickableComponent.call(this,player,options));_this.update();player.on("posterchange",bind(_this,_this.update));return _this}PosterImage.prototype.dispose=function dispose(){this.player().off("posterchange",this.update);_ClickableComponent.prototype.dispose.call(this)};PosterImage.prototype.createEl=function createEl$$1(){var el=createEl("div",{className:"vjs-poster",tabIndex:-1});return el};PosterImage.prototype.update=function update(event){var url=this.player().poster();this.setSrc(url);if(url){this.show()}else{this.hide()}};PosterImage.prototype.setSrc=function setSrc(url){var backgroundImage="";if(url){backgroundImage='url("'+url+'")'}this.el_.style.backgroundImage=backgroundImage};PosterImage.prototype.handleClick=function handleClick(event){if(!this.player_.controls()){return}if(this.player_.paused()){this.player_.play()}else{this.player_.pause()}};return PosterImage}(ClickableComponent);Component.registerComponent("PosterImage",PosterImage);var darkGray="#222";var lightGray="#ccc";var fontMap={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function constructColor(color,opacity){return"rgba("+parseInt(color[1]+color[1],16)+","+parseInt(color[2]+color[2],16)+","+parseInt(color[3]+color[3],16)+","+opacity+")"}function tryUpdateStyle(el,style,rule){try{el.style[style]=rule}catch(e){return}}var TextTrackDisplay=function(_Component){inherits(TextTrackDisplay,_Component);function TextTrackDisplay(player,options,ready){classCallCheck(this,TextTrackDisplay);var _this=possibleConstructorReturn(this,_Component.call(this,player,options,ready));player.on("loadstart",bind(_this,_this.toggleDisplay));player.on("texttrackchange",bind(_this,_this.updateDisplay));player.on("loadstart",bind(_this,_this.preselectTrack));player.ready(bind(_this,function(){if(player.tech_&&player.tech_.featuresNativeTextTracks){this.hide();return}player.on("fullscreenchange",bind(this,this.updateDisplay));var tracks=this.options_.playerOptions.tracks||[];for(var i=0;i1&&arguments[1]!==undefined?arguments[1]:{};var attributes=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};tag="button";props=assign({innerHTML:'',className:this.buildCSSClass()},props);attributes=assign({type:"button"},attributes);var el=Component.prototype.createEl.call(this,tag,props,attributes);this.createControlTextEl(el);return el};Button.prototype.addChild=function addChild(child){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var className=this.constructor.name;log$1.warn("Adding an actionable (user controllable) child to a Button ("+className+") is not supported; use a ClickableComponent instead.");return Component.prototype.addChild.call(this,child,options)};Button.prototype.enable=function enable(){_ClickableComponent.prototype.enable.call(this);this.el_.removeAttribute("disabled")};Button.prototype.disable=function disable(){_ClickableComponent.prototype.disable.call(this);this.el_.setAttribute("disabled","disabled")};Button.prototype.handleKeyPress=function handleKeyPress(event){if(event.which===32||event.which===13){return}_ClickableComponent.prototype.handleKeyPress.call(this,event)};return Button}(ClickableComponent);Component.registerComponent("Button",Button);var BigPlayButton=function(_Button){inherits(BigPlayButton,_Button);function BigPlayButton(player,options){classCallCheck(this,BigPlayButton);var _this=possibleConstructorReturn(this,_Button.call(this,player,options));_this.mouseused_=false;_this.on("mousedown",_this.handleMouseDown);return _this}BigPlayButton.prototype.buildCSSClass=function buildCSSClass(){return"vjs-big-play-button"};BigPlayButton.prototype.handleClick=function handleClick(event){var playPromise=this.player_.play();if(this.mouseused_&&event.clientX&&event.clientY){return}var cb=this.player_.getChild("controlBar");var playToggle=cb&&cb.getChild("playToggle");if(!playToggle){this.player_.focus();return}var playFocus=function playFocus(){return playToggle.focus()};if(isPromise(playPromise)){playPromise.then(playFocus,function(){})}else{this.setTimeout(playFocus,1)}};BigPlayButton.prototype.handleKeyPress=function handleKeyPress(event){this.mouseused_=false;_Button.prototype.handleKeyPress.call(this,event)};BigPlayButton.prototype.handleMouseDown=function handleMouseDown(event){this.mouseused_=true};return BigPlayButton}(Button);BigPlayButton.prototype.controlText_="Play Video";Component.registerComponent("BigPlayButton",BigPlayButton);var CloseButton=function(_Button){inherits(CloseButton,_Button);function CloseButton(player,options){classCallCheck(this,CloseButton);var _this=possibleConstructorReturn(this,_Button.call(this,player,options));_this.controlText(options&&options.controlText||_this.localize("Close"));return _this}CloseButton.prototype.buildCSSClass=function buildCSSClass(){return"vjs-close-button "+_Button.prototype.buildCSSClass.call(this)};CloseButton.prototype.handleClick=function handleClick(event){this.trigger({type:"close",bubbles:false})};return CloseButton}(Button);Component.registerComponent("CloseButton",CloseButton);var PlayToggle=function(_Button){inherits(PlayToggle,_Button);function PlayToggle(player,options){classCallCheck(this,PlayToggle);var _this=possibleConstructorReturn(this,_Button.call(this,player,options));_this.on(player,"play",_this.handlePlay);_this.on(player,"pause",_this.handlePause);_this.on(player,"ended",_this.handleEnded);return _this}PlayToggle.prototype.buildCSSClass=function buildCSSClass(){return"vjs-play-control "+_Button.prototype.buildCSSClass.call(this)};PlayToggle.prototype.handleClick=function handleClick(event){if(this.player_.paused()){this.player_.play()}else{this.player_.pause()}};PlayToggle.prototype.handleSeeked=function handleSeeked(event){this.removeClass("vjs-ended");if(this.player_.paused()){this.handlePause(event)}else{this.handlePlay(event)}};PlayToggle.prototype.handlePlay=function handlePlay(event){this.removeClass("vjs-ended");this.removeClass("vjs-paused");this.addClass("vjs-playing");this.controlText("Pause")};PlayToggle.prototype.handlePause=function handlePause(event){this.removeClass("vjs-playing");this.addClass("vjs-paused");this.controlText("Play")};PlayToggle.prototype.handleEnded=function handleEnded(event){this.removeClass("vjs-playing");this.addClass("vjs-ended");this.controlText("Replay");this.one(this.player_,"seeked",this.handleSeeked)};return PlayToggle}(Button);PlayToggle.prototype.controlText_="Play";Component.registerComponent("PlayToggle",PlayToggle);var defaultImplementation=function defaultImplementation(seconds,guide){seconds=seconds<0?0:seconds;var s=Math.floor(seconds%60);var m=Math.floor(seconds/60%60);var h=Math.floor(seconds/3600);var gm=Math.floor(guide/60%60);var gh=Math.floor(guide/3600);if(isNaN(seconds)||seconds===Infinity){h=m=s="-"}h=h>0||gh>0?h+":":"";m=((h||gm>=10)&&m<10?"0"+m:m)+":";s=s<10?"0"+s:s;return h+m+s};var implementation=defaultImplementation;function setFormatTime(customImplementation){implementation=customImplementation}function resetFormatTime(){implementation=defaultImplementation}function formatTime(seconds){var guide=arguments.length>1&&arguments[1]!==undefined?arguments[1]:seconds;return implementation(seconds,guide)}var TimeDisplay=function(_Component){inherits(TimeDisplay,_Component);function TimeDisplay(player,options){classCallCheck(this,TimeDisplay);var _this=possibleConstructorReturn(this,_Component.call(this,player,options));_this.throttledUpdateContent=throttle(bind(_this,_this.updateContent),25);_this.on(player,"timeupdate",_this.throttledUpdateContent);return _this}TimeDisplay.prototype.createEl=function createEl$$1(plainName){var className=this.buildCSSClass();var el=_Component.prototype.createEl.call(this,"div",{className:className+" vjs-time-control vjs-control",innerHTML:''+this.localize(this.labelText_)+" "});this.contentEl_=createEl("span",{className:className+"-display"},{"aria-live":"off"});this.updateTextNode_();el.appendChild(this.contentEl_);return el};TimeDisplay.prototype.dispose=function dispose(){this.contentEl_=null;this.textNode_=null;_Component.prototype.dispose.call(this)};TimeDisplay.prototype.updateTextNode_=function updateTextNode_(){if(!this.contentEl_){return}while(this.contentEl_.firstChild){this.contentEl_.removeChild(this.contentEl_.firstChild)}this.textNode_=document_1.createTextNode(this.formattedTime_||this.formatTime_(0));this.contentEl_.appendChild(this.textNode_)};TimeDisplay.prototype.formatTime_=function formatTime_(time){return formatTime(time)};TimeDisplay.prototype.updateFormattedTime_=function updateFormattedTime_(time){var formattedTime=this.formatTime_(time);if(formattedTime===this.formattedTime_){return}this.formattedTime_=formattedTime;this.requestAnimationFrame(this.updateTextNode_)};TimeDisplay.prototype.updateContent=function updateContent(event){};return TimeDisplay}(Component);TimeDisplay.prototype.labelText_="Time";TimeDisplay.prototype.controlText_="Time";Component.registerComponent("TimeDisplay",TimeDisplay);var CurrentTimeDisplay=function(_TimeDisplay){inherits(CurrentTimeDisplay,_TimeDisplay);function CurrentTimeDisplay(player,options){classCallCheck(this,CurrentTimeDisplay);var _this=possibleConstructorReturn(this,_TimeDisplay.call(this,player,options));_this.on(player,"ended",_this.handleEnded);return _this}CurrentTimeDisplay.prototype.buildCSSClass=function buildCSSClass(){return"vjs-current-time"};CurrentTimeDisplay.prototype.updateContent=function updateContent(event){var time=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(time)};CurrentTimeDisplay.prototype.handleEnded=function handleEnded(event){if(!this.player_.duration()){return}this.updateFormattedTime_(this.player_.duration())};return CurrentTimeDisplay}(TimeDisplay);CurrentTimeDisplay.prototype.labelText_="Current Time";CurrentTimeDisplay.prototype.controlText_="Current Time";Component.registerComponent("CurrentTimeDisplay",CurrentTimeDisplay);var DurationDisplay=function(_TimeDisplay){inherits(DurationDisplay,_TimeDisplay);function DurationDisplay(player,options){classCallCheck(this,DurationDisplay);var _this=possibleConstructorReturn(this,_TimeDisplay.call(this,player,options));_this.on(player,"durationchange",_this.updateContent);_this.on(player,"loadedmetadata",_this.throttledUpdateContent);return _this}DurationDisplay.prototype.buildCSSClass=function buildCSSClass(){return"vjs-duration"};DurationDisplay.prototype.updateContent=function updateContent(event){var duration=this.player_.duration();if(duration&&this.duration_!==duration){this.duration_=duration;this.updateFormattedTime_(duration)}};return DurationDisplay}(TimeDisplay);DurationDisplay.prototype.labelText_="Duration";DurationDisplay.prototype.controlText_="Duration";Component.registerComponent("DurationDisplay",DurationDisplay);var TimeDivider=function(_Component){inherits(TimeDivider,_Component);function TimeDivider(){classCallCheck(this,TimeDivider);return possibleConstructorReturn(this,_Component.apply(this,arguments))}TimeDivider.prototype.createEl=function createEl(){return _Component.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"
/
"})};return TimeDivider}(Component);Component.registerComponent("TimeDivider",TimeDivider);var RemainingTimeDisplay=function(_TimeDisplay){inherits(RemainingTimeDisplay,_TimeDisplay);function RemainingTimeDisplay(player,options){classCallCheck(this,RemainingTimeDisplay);var _this=possibleConstructorReturn(this,_TimeDisplay.call(this,player,options));_this.on(player,"durationchange",_this.throttledUpdateContent);_this.on(player,"ended",_this.handleEnded);return _this}RemainingTimeDisplay.prototype.buildCSSClass=function buildCSSClass(){return"vjs-remaining-time"};RemainingTimeDisplay.prototype.formatTime_=function formatTime_(time){return"-"+_TimeDisplay.prototype.formatTime_.call(this,time)};RemainingTimeDisplay.prototype.updateContent=function updateContent(event){if(!this.player_.duration()){return}if(this.player_.remainingTimeDisplay){this.updateFormattedTime_(this.player_.remainingTimeDisplay())}else{this.updateFormattedTime_(this.player_.remainingTime())}};RemainingTimeDisplay.prototype.handleEnded=function handleEnded(event){if(!this.player_.duration()){return}this.updateFormattedTime_(0)};return RemainingTimeDisplay}(TimeDisplay);RemainingTimeDisplay.prototype.labelText_="Remaining Time";RemainingTimeDisplay.prototype.controlText_="Remaining Time";Component.registerComponent("RemainingTimeDisplay",RemainingTimeDisplay);var LiveDisplay=function(_Component){inherits(LiveDisplay,_Component);function LiveDisplay(player,options){classCallCheck(this,LiveDisplay);var _this=possibleConstructorReturn(this,_Component.call(this,player,options));_this.updateShowing();_this.on(_this.player(),"durationchange",_this.updateShowing);return _this}LiveDisplay.prototype.createEl=function createEl$$1(){var el=_Component.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});this.contentEl_=createEl("div",{className:"vjs-live-display",innerHTML:''+this.localize("Stream Type")+" "+this.localize("LIVE")},{"aria-live":"off"});el.appendChild(this.contentEl_);return el};LiveDisplay.prototype.dispose=function dispose(){this.contentEl_=null;_Component.prototype.dispose.call(this)};LiveDisplay.prototype.updateShowing=function updateShowing(event){if(this.player().duration()===Infinity){this.show()}else{this.hide()}};return LiveDisplay}(Component);Component.registerComponent("LiveDisplay",LiveDisplay);var Slider=function(_Component){inherits(Slider,_Component);function Slider(player,options){classCallCheck(this,Slider);var _this=possibleConstructorReturn(this,_Component.call(this,player,options));_this.bar=_this.getChild(_this.options_.barName);_this.vertical(!!_this.options_.vertical);_this.enable();return _this}Slider.prototype.enabled=function enabled(){return this.enabled_};Slider.prototype.enable=function enable(){if(this.enabled()){return}this.on("mousedown",this.handleMouseDown);this.on("touchstart",this.handleMouseDown);this.on("focus",this.handleFocus);this.on("blur",this.handleBlur);this.on("click",this.handleClick);this.on(this.player_,"controlsvisible",this.update);if(this.playerEvent){this.on(this.player_,this.playerEvent,this.update)}this.removeClass("disabled");this.setAttribute("tabindex",0);this.enabled_=true};Slider.prototype.disable=function disable(){if(!this.enabled()){return}var doc=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown);this.off("touchstart",this.handleMouseDown);this.off("focus",this.handleFocus);this.off("blur",this.handleBlur);this.off("click",this.handleClick);this.off(this.player_,"controlsvisible",this.update);this.off(doc,"mousemove",this.handleMouseMove);this.off(doc,"mouseup",this.handleMouseUp);this.off(doc,"touchmove",this.handleMouseMove);this.off(doc,"touchend",this.handleMouseUp);this.removeAttribute("tabindex");this.addClass("disabled");if(this.playerEvent){this.off(this.player_,this.playerEvent,this.update)}this.enabled_=false};Slider.prototype.createEl=function createEl$$1(type){var props=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var attributes=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};props.className=props.className+" vjs-slider";props=assign({tabIndex:0},props);attributes=assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},attributes);return _Component.prototype.createEl.call(this,type,props,attributes)};Slider.prototype.handleMouseDown=function handleMouseDown(event){var doc=this.bar.el_.ownerDocument;event.preventDefault();blockTextSelection();this.addClass("vjs-sliding");this.trigger("slideractive");this.on(doc,"mousemove",this.handleMouseMove);this.on(doc,"mouseup",this.handleMouseUp);this.on(doc,"touchmove",this.handleMouseMove);this.on(doc,"touchend",this.handleMouseUp);this.handleMouseMove(event)};Slider.prototype.handleMouseMove=function handleMouseMove(event){};Slider.prototype.handleMouseUp=function handleMouseUp(){var doc=this.bar.el_.ownerDocument;unblockTextSelection();this.removeClass("vjs-sliding");this.trigger("sliderinactive");this.off(doc,"mousemove",this.handleMouseMove);this.off(doc,"mouseup",this.handleMouseUp);this.off(doc,"touchmove",this.handleMouseMove);this.off(doc,"touchend",this.handleMouseUp);this.update()};Slider.prototype.update=function update(){if(!this.el_){return}var progress=this.getPercent();var bar=this.bar;if(!bar){return}if(typeof progress!=="number"||progress!==progress||progress<0||progress===Infinity){progress=0}var percentage=(progress*100).toFixed(2)+"%";var style=bar.el().style;if(this.vertical()){style.height=percentage}else{style.width=percentage}return progress};Slider.prototype.calculateDistance=function calculateDistance(event){var position=getPointerPosition(this.el_,event);if(this.vertical()){return position.y}return position.x};Slider.prototype.handleFocus=function handleFocus(){this.on(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)};Slider.prototype.handleKeyPress=function handleKeyPress(event){if(event.which===37||event.which===40){event.preventDefault();this.stepBack()}else if(event.which===38||event.which===39){event.preventDefault();this.stepForward()}};Slider.prototype.handleBlur=function handleBlur(){this.off(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)};Slider.prototype.handleClick=function handleClick(event){event.stopImmediatePropagation();event.preventDefault()};Slider.prototype.vertical=function vertical(bool){if(bool===undefined){return this.vertical_||false}this.vertical_=!!bool;if(this.vertical_){this.addClass("vjs-slider-vertical")}else{this.addClass("vjs-slider-horizontal")}};return Slider}(Component);Component.registerComponent("Slider",Slider);var LoadProgressBar=function(_Component){inherits(LoadProgressBar,_Component);function LoadProgressBar(player,options){classCallCheck(this,LoadProgressBar);var _this=possibleConstructorReturn(this,_Component.call(this,player,options));_this.partEls_=[];_this.on(player,"progress",_this.update);return _this}LoadProgressBar.prototype.createEl=function createEl$$1(){return _Component.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:''+this.localize("Loaded")+": 0%"})};LoadProgressBar.prototype.dispose=function dispose(){this.partEls_=null;_Component.prototype.dispose.call(this)};LoadProgressBar.prototype.update=function update(event){var buffered=this.player_.buffered();var duration=this.player_.duration();var bufferedEnd=this.player_.bufferedEnd();var children=this.partEls_;var percentify=function percentify(time,end){var percent=time/end||0;return(percent>=1?1:percent)*100+"%"};this.el_.style.width=percentify(bufferedEnd,duration);for(var i=0;ibuffered.length;_i--){this.el_.removeChild(children[_i-1])}children.length=buffered.length};return LoadProgressBar}(Component);Component.registerComponent("LoadProgressBar",LoadProgressBar);var TimeTooltip=function(_Component){inherits(TimeTooltip,_Component);function TimeTooltip(){classCallCheck(this,TimeTooltip);return possibleConstructorReturn(this,_Component.apply(this,arguments))}TimeTooltip.prototype.createEl=function createEl$$1(){return _Component.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"})};TimeTooltip.prototype.update=function update(seekBarRect,seekBarPoint,content){var tooltipRect=getBoundingClientRect(this.el_);var playerRect=getBoundingClientRect(this.player_.el());var seekBarPointPx=seekBarRect.width*seekBarPoint;if(!playerRect||!tooltipRect){return}var spaceLeftOfPoint=seekBarRect.left-playerRect.left+seekBarPointPx;var spaceRightOfPoint=seekBarRect.width-seekBarPointPx+(playerRect.right-seekBarRect.right);var pullTooltipBy=tooltipRect.width/2;if(spaceLeftOfPointtooltipRect.width){pullTooltipBy=tooltipRect.width}this.el_.style.right="-"+pullTooltipBy+"px";textContent(this.el_,content)};return TimeTooltip}(Component);Component.registerComponent("TimeTooltip",TimeTooltip);var PlayProgressBar=function(_Component){inherits(PlayProgressBar,_Component);function PlayProgressBar(){classCallCheck(this,PlayProgressBar);return possibleConstructorReturn(this,_Component.apply(this,arguments))}PlayProgressBar.prototype.createEl=function createEl(){return _Component.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar",innerHTML:''+this.localize("Progress")+": 0%"})};PlayProgressBar.prototype.update=function update(seekBarRect,seekBarPoint){var _this2=this;if(this.rafId_){this.cancelAnimationFrame(this.rafId_)}this.rafId_=this.requestAnimationFrame(function(){var time=_this2.player_.scrubbing()?_this2.player_.getCache().currentTime:_this2.player_.currentTime();var content=formatTime(time,_this2.player_.duration());var timeTooltip=_this2.getChild("timeTooltip");if(timeTooltip){timeTooltip.update(seekBarRect,seekBarPoint,content)}})};return PlayProgressBar}(Component);PlayProgressBar.prototype.options_={children:[]};if(!IS_IOS&&!IS_ANDROID){PlayProgressBar.prototype.options_.children.push("timeTooltip")}Component.registerComponent("PlayProgressBar",PlayProgressBar);var MouseTimeDisplay=function(_Component){inherits(MouseTimeDisplay,_Component);function MouseTimeDisplay(player,options){classCallCheck(this,MouseTimeDisplay);var _this=possibleConstructorReturn(this,_Component.call(this,player,options));_this.update=throttle(bind(_this,_this.update),25);return _this}MouseTimeDisplay.prototype.createEl=function createEl(){return _Component.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})};MouseTimeDisplay.prototype.update=function update(seekBarRect,seekBarPoint){var _this2=this;if(this.rafId_){this.cancelAnimationFrame(this.rafId_)}this.rafId_=this.requestAnimationFrame(function(){var duration=_this2.player_.duration();var content=formatTime(seekBarPoint*duration,duration);_this2.el_.style.left=seekBarRect.width*seekBarPoint+"px";_this2.getChild("timeTooltip").update(seekBarRect,seekBarPoint,content)})};return MouseTimeDisplay}(Component);MouseTimeDisplay.prototype.options_={children:["timeTooltip"]};Component.registerComponent("MouseTimeDisplay",MouseTimeDisplay);var STEP_SECONDS=5;var UPDATE_REFRESH_INTERVAL=30;var SeekBar=function(_Slider){inherits(SeekBar,_Slider);function SeekBar(player,options){classCallCheck(this,SeekBar);var _this=possibleConstructorReturn(this,_Slider.call(this,player,options));_this.setEventHandlers_();return _this}SeekBar.prototype.setEventHandlers_=function setEventHandlers_(){var _this2=this;this.update=throttle(bind(this,this.update),UPDATE_REFRESH_INTERVAL);this.on(this.player_,"timeupdate",this.update);this.on(this.player_,"ended",this.handleEnded);this.updateInterval=null;this.on(this.player_,["playing"],function(){_this2.clearInterval(_this2.updateInterval);_this2.updateInterval=_this2.setInterval(function(){_this2.requestAnimationFrame(function(){_this2.update()})},UPDATE_REFRESH_INTERVAL)});this.on(this.player_,["ended","pause","waiting"],function(){_this2.clearInterval(_this2.updateInterval)});this.on(this.player_,["timeupdate","ended"],this.update)};SeekBar.prototype.createEl=function createEl$$1(){return _Slider.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})};SeekBar.prototype.update_=function update_(currentTime,percent){var duration=this.player_.duration();this.el_.setAttribute("aria-valuenow",(percent*100).toFixed(2));this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[formatTime(currentTime,duration),formatTime(duration,duration)],"{1} of {2}"));this.bar.update(getBoundingClientRect(this.el_),percent)};SeekBar.prototype.update=function update(event){var percent=_Slider.prototype.update.call(this);this.update_(this.getCurrentTime_(),percent);return percent};SeekBar.prototype.getCurrentTime_=function getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()};SeekBar.prototype.handleEnded=function handleEnded(event){this.update_(this.player_.duration(),1)};SeekBar.prototype.getPercent=function getPercent(){var percent=this.getCurrentTime_()/this.player_.duration();return percent>=1?1:percent||0};SeekBar.prototype.handleMouseDown=function handleMouseDown(event){if(!isSingleLeftClick(event)){return}event.stopPropagation();this.player_.scrubbing(true);this.videoWasPlaying=!this.player_.paused();this.player_.pause();_Slider.prototype.handleMouseDown.call(this,event)};SeekBar.prototype.handleMouseMove=function handleMouseMove(event){if(!isSingleLeftClick(event)){return}var newTime=this.calculateDistance(event)*this.player_.duration();if(newTime===this.player_.duration()){newTime=newTime-.1}this.player_.currentTime(newTime)};SeekBar.prototype.enable=function enable(){_Slider.prototype.enable.call(this);var mouseTimeDisplay=this.getChild("mouseTimeDisplay");if(!mouseTimeDisplay){return}mouseTimeDisplay.show()};SeekBar.prototype.disable=function disable(){_Slider.prototype.disable.call(this);var mouseTimeDisplay=this.getChild("mouseTimeDisplay");if(!mouseTimeDisplay){return}mouseTimeDisplay.hide()};SeekBar.prototype.handleMouseUp=function handleMouseUp(event){_Slider.prototype.handleMouseUp.call(this,event);if(event){event.stopPropagation()}this.player_.scrubbing(false);this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:true});if(this.videoWasPlaying){silencePromise(this.player_.play())}};SeekBar.prototype.stepForward=function stepForward(){this.player_.currentTime(this.player_.currentTime()+STEP_SECONDS)};SeekBar.prototype.stepBack=function stepBack(){this.player_.currentTime(this.player_.currentTime()-STEP_SECONDS)};SeekBar.prototype.handleAction=function handleAction(event){if(this.player_.paused()){this.player_.play()}else{this.player_.pause()}};SeekBar.prototype.handleKeyPress=function handleKeyPress(event){if(event.which===32||event.which===13){event.preventDefault();this.handleAction(event)}else if(_Slider.prototype.handleKeyPress){_Slider.prototype.handleKeyPress.call(this,event)}};return SeekBar}(Slider);SeekBar.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};if(!IS_IOS&&!IS_ANDROID){SeekBar.prototype.options_.children.splice(1,0,"mouseTimeDisplay")}SeekBar.prototype.playerEvent="timeupdate";Component.registerComponent("SeekBar",SeekBar);var ProgressControl=function(_Component){inherits(ProgressControl,_Component);function ProgressControl(player,options){classCallCheck(this,ProgressControl);var _this=possibleConstructorReturn(this,_Component.call(this,player,options));_this.handleMouseMove=throttle(bind(_this,_this.handleMouseMove),25);_this.throttledHandleMouseSeek=throttle(bind(_this,_this.handleMouseSeek),25);_this.enable();return _this}ProgressControl.prototype.createEl=function createEl$$1(){return _Component.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})};ProgressControl.prototype.handleMouseMove=function handleMouseMove(event){var seekBar=this.getChild("seekBar");if(seekBar){var mouseTimeDisplay=seekBar.getChild("mouseTimeDisplay");var seekBarEl=seekBar.el();var seekBarRect=getBoundingClientRect(seekBarEl);var seekBarPoint=getPointerPosition(seekBarEl,event).x;if(seekBarPoint>1){seekBarPoint=1}else if(seekBarPoint<0){seekBarPoint=0}if(mouseTimeDisplay){mouseTimeDisplay.update(seekBarRect,seekBarPoint)}}};ProgressControl.prototype.handleMouseSeek=function handleMouseSeek(event){var seekBar=this.getChild("seekBar");if(seekBar){seekBar.handleMouseMove(event)}};ProgressControl.prototype.enabled=function enabled(){return this.enabled_};ProgressControl.prototype.disable=function disable(){this.children().forEach(function(child){return child.disable&&child.disable()});if(!this.enabled()){return}this.off(["mousedown","touchstart"],this.handleMouseDown);this.off(this.el_,"mousemove",this.handleMouseMove);this.handleMouseUp();this.addClass("disabled");this.enabled_=false};ProgressControl.prototype.enable=function enable(){this.children().forEach(function(child){return child.enable&&child.enable()});if(this.enabled()){return}this.on(["mousedown","touchstart"],this.handleMouseDown);this.on(this.el_,"mousemove",this.handleMouseMove);this.removeClass("disabled");this.enabled_=true};ProgressControl.prototype.handleMouseDown=function handleMouseDown(event){var doc=this.el_.ownerDocument;var seekBar=this.getChild("seekBar");if(seekBar){seekBar.handleMouseDown(event)}this.on(doc,"mousemove",this.throttledHandleMouseSeek);this.on(doc,"touchmove",this.throttledHandleMouseSeek);this.on(doc,"mouseup",this.handleMouseUp);this.on(doc,"touchend",this.handleMouseUp)};ProgressControl.prototype.handleMouseUp=function handleMouseUp(event){var doc=this.el_.ownerDocument;var seekBar=this.getChild("seekBar");if(seekBar){seekBar.handleMouseUp(event)}this.off(doc,"mousemove",this.throttledHandleMouseSeek);this.off(doc,"touchmove",this.throttledHandleMouseSeek);this.off(doc,"mouseup",this.handleMouseUp);this.off(doc,"touchend",this.handleMouseUp)};return ProgressControl}(Component);ProgressControl.prototype.options_={children:["seekBar"]};Component.registerComponent("ProgressControl",ProgressControl);var FullscreenToggle=function(_Button){inherits(FullscreenToggle,_Button);function FullscreenToggle(player,options){classCallCheck(this,FullscreenToggle);var _this=possibleConstructorReturn(this,_Button.call(this,player,options));_this.on(player,"fullscreenchange",_this.handleFullscreenChange);return _this}FullscreenToggle.prototype.buildCSSClass=function buildCSSClass(){return"vjs-fullscreen-control "+_Button.prototype.buildCSSClass.call(this)};FullscreenToggle.prototype.handleFullscreenChange=function handleFullscreenChange(event){if(this.player_.isFullscreen()){this.controlText("Non-Fullscreen")}else{this.controlText("Fullscreen")}};FullscreenToggle.prototype.handleClick=function handleClick(event){if(!this.player_.isFullscreen()){this.player_.requestFullscreen()}else{this.player_.exitFullscreen()}};return FullscreenToggle}(Button);FullscreenToggle.prototype.controlText_="Fullscreen";Component.registerComponent("FullscreenToggle",FullscreenToggle);var checkVolumeSupport=function checkVolumeSupport(self,player){if(player.tech_&&!player.tech_.featuresVolumeControl){self.addClass("vjs-hidden")}self.on(player,"loadstart",function(){if(!player.tech_.featuresVolumeControl){self.addClass("vjs-hidden")}else{self.removeClass("vjs-hidden")}})};var VolumeLevel=function(_Component){inherits(VolumeLevel,_Component);function VolumeLevel(){classCallCheck(this,VolumeLevel);return possibleConstructorReturn(this,_Component.apply(this,arguments))}VolumeLevel.prototype.createEl=function createEl(){return _Component.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:''})};return VolumeLevel}(Component);Component.registerComponent("VolumeLevel",VolumeLevel);var VolumeBar=function(_Slider){inherits(VolumeBar,_Slider);function VolumeBar(player,options){classCallCheck(this,VolumeBar);var _this=possibleConstructorReturn(this,_Slider.call(this,player,options));_this.on("slideractive",_this.updateLastVolume_);_this.on(player,"volumechange",_this.updateARIAAttributes);player.ready(function(){return _this.updateARIAAttributes()});return _this}VolumeBar.prototype.createEl=function createEl$$1(){return _Slider.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})};VolumeBar.prototype.handleMouseDown=function handleMouseDown(event){if(!isSingleLeftClick(event)){return}_Slider.prototype.handleMouseDown.call(this,event)};VolumeBar.prototype.handleMouseMove=function handleMouseMove(event){if(!isSingleLeftClick(event)){return}this.checkMuted();this.player_.volume(this.calculateDistance(event))};VolumeBar.prototype.checkMuted=function checkMuted(){if(this.player_.muted()){this.player_.muted(false)}};VolumeBar.prototype.getPercent=function getPercent(){if(this.player_.muted()){return 0}return this.player_.volume()};VolumeBar.prototype.stepForward=function stepForward(){this.checkMuted();this.player_.volume(this.player_.volume()+.1)};VolumeBar.prototype.stepBack=function stepBack(){this.checkMuted();this.player_.volume(this.player_.volume()-.1)};VolumeBar.prototype.updateARIAAttributes=function updateARIAAttributes(event){var ariaValue=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",ariaValue);this.el_.setAttribute("aria-valuetext",ariaValue+"%")};VolumeBar.prototype.volumeAsPercentage_=function volumeAsPercentage_(){return Math.round(this.player_.volume()*100)};VolumeBar.prototype.updateLastVolume_=function updateLastVolume_(){var _this2=this;var volumeBeforeDrag=this.player_.volume();this.one("sliderinactive",function(){if(_this2.player_.volume()===0){_this2.player_.lastVolume_(volumeBeforeDrag)}})};return VolumeBar}(Slider);VolumeBar.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};VolumeBar.prototype.playerEvent="volumechange";Component.registerComponent("VolumeBar",VolumeBar);var VolumeControl=function(_Component){inherits(VolumeControl,_Component);function VolumeControl(player){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};classCallCheck(this,VolumeControl);options.vertical=options.vertical||false;if(typeof options.volumeBar==="undefined"||isPlain(options.volumeBar)){options.volumeBar=options.volumeBar||{};options.volumeBar.vertical=options.vertical}var _this=possibleConstructorReturn(this,_Component.call(this,player,options));checkVolumeSupport(_this,player);_this.throttledHandleMouseMove=throttle(bind(_this,_this.handleMouseMove),25);_this.on("mousedown",_this.handleMouseDown);_this.on("touchstart",_this.handleMouseDown);_this.on(_this.volumeBar,["focus","slideractive"],function(){_this.volumeBar.addClass("vjs-slider-active");_this.addClass("vjs-slider-active");_this.trigger("slideractive")});_this.on(_this.volumeBar,["blur","sliderinactive"],function(){_this.volumeBar.removeClass("vjs-slider-active");_this.removeClass("vjs-slider-active");_this.trigger("sliderinactive")});return _this}VolumeControl.prototype.createEl=function createEl(){var orientationClass="vjs-volume-horizontal";if(this.options_.vertical){orientationClass="vjs-volume-vertical"}return _Component.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+orientationClass})};VolumeControl.prototype.handleMouseDown=function handleMouseDown(event){var doc=this.el_.ownerDocument;this.on(doc,"mousemove",this.throttledHandleMouseMove);this.on(doc,"touchmove",this.throttledHandleMouseMove);this.on(doc,"mouseup",this.handleMouseUp);this.on(doc,"touchend",this.handleMouseUp)};VolumeControl.prototype.handleMouseUp=function handleMouseUp(event){var doc=this.el_.ownerDocument;this.off(doc,"mousemove",this.throttledHandleMouseMove);this.off(doc,"touchmove",this.throttledHandleMouseMove);this.off(doc,"mouseup",this.handleMouseUp);this.off(doc,"touchend",this.handleMouseUp)};VolumeControl.prototype.handleMouseMove=function handleMouseMove(event){this.volumeBar.handleMouseMove(event)};return VolumeControl}(Component);VolumeControl.prototype.options_={children:["volumeBar"]};Component.registerComponent("VolumeControl",VolumeControl);var MuteToggle=function(_Button){inherits(MuteToggle,_Button);function MuteToggle(player,options){classCallCheck(this,MuteToggle);var _this=possibleConstructorReturn(this,_Button.call(this,player,options));checkVolumeSupport(_this,player);_this.on(player,["loadstart","volumechange"],_this.update);return _this}MuteToggle.prototype.buildCSSClass=function buildCSSClass(){return"vjs-mute-control "+_Button.prototype.buildCSSClass.call(this)};MuteToggle.prototype.handleClick=function handleClick(event){var vol=this.player_.volume();var lastVolume=this.player_.lastVolume_();if(vol===0){var volumeToSet=lastVolume<.1?.1:lastVolume;this.player_.volume(volumeToSet);this.player_.muted(false)}else{this.player_.muted(this.player_.muted()?false:true)}};MuteToggle.prototype.update=function update(event){this.updateIcon_();this.updateControlText_()};MuteToggle.prototype.updateIcon_=function updateIcon_(){var vol=this.player_.volume();var level=3;if(vol===0||this.player_.muted()){level=0}else if(vol<.33){level=1}else if(vol<.67){level=2}for(var i=0;i<4;i++){removeClass(this.el_,"vjs-vol-"+i)}addClass(this.el_,"vjs-vol-"+level)};MuteToggle.prototype.updateControlText_=function updateControlText_(){var soundOff=this.player_.muted()||this.player_.volume()===0;var text=soundOff?"Unmute":"Mute";if(this.controlText()!==text){this.controlText(text)}};return MuteToggle}(Button);MuteToggle.prototype.controlText_="Mute";Component.registerComponent("MuteToggle",MuteToggle);var VolumePanel=function(_Component){inherits(VolumePanel,_Component);function VolumePanel(player){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};classCallCheck(this,VolumePanel);if(typeof options.inline!=="undefined"){options.inline=options.inline}else{options.inline=true}if(typeof options.volumeControl==="undefined"||isPlain(options.volumeControl)){options.volumeControl=options.volumeControl||{};options.volumeControl.vertical=!options.inline}var _this=possibleConstructorReturn(this,_Component.call(this,player,options));checkVolumeSupport(_this,player);_this.on(_this.volumeControl,["slideractive"],_this.sliderActive_);_this.on(_this.volumeControl,["sliderinactive"],_this.sliderInactive_);return _this}VolumePanel.prototype.sliderActive_=function sliderActive_(){this.addClass("vjs-slider-active")};VolumePanel.prototype.sliderInactive_=function sliderInactive_(){this.removeClass("vjs-slider-active")};VolumePanel.prototype.createEl=function createEl(){var orientationClass="vjs-volume-panel-horizontal";if(!this.options_.inline){orientationClass="vjs-volume-panel-vertical"}return _Component.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+orientationClass})};return VolumePanel}(Component);VolumePanel.prototype.options_={children:["muteToggle","volumeControl"]};Component.registerComponent("VolumePanel",VolumePanel);var Menu=function(_Component){inherits(Menu,_Component);function Menu(player,options){classCallCheck(this,Menu);var _this=possibleConstructorReturn(this,_Component.call(this,player,options));if(options){_this.menuButton_=options.menuButton}_this.focusedChild_=-1;_this.on("keydown",_this.handleKeyPress);return _this}Menu.prototype.addItem=function addItem(component){this.addChild(component);component.on("click",bind(this,function(event){if(this.menuButton_){this.menuButton_.unpressButton();if(component.name()!=="CaptionSettingsMenuItem"){this.menuButton_.focus()}}}))};Menu.prototype.createEl=function createEl$$1(){var contentElType=this.options_.contentElType||"ul";this.contentEl_=createEl(contentElType,{className:"vjs-menu-content"});this.contentEl_.setAttribute("role","menu");var el=_Component.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});el.appendChild(this.contentEl_);on(el,"click",function(event){event.preventDefault();event.stopImmediatePropagation()});return el};Menu.prototype.dispose=function dispose(){this.contentEl_=null;_Component.prototype.dispose.call(this)};Menu.prototype.handleKeyPress=function handleKeyPress(event){if(event.which===37||event.which===40){event.preventDefault();this.stepForward()}else if(event.which===38||event.which===39){event.preventDefault();this.stepBack()}};Menu.prototype.stepForward=function stepForward(){var stepChild=0;if(this.focusedChild_!==undefined){stepChild=this.focusedChild_+1}this.focus(stepChild)};Menu.prototype.stepBack=function stepBack(){var stepChild=0;if(this.focusedChild_!==undefined){stepChild=this.focusedChild_-1}this.focus(stepChild)};Menu.prototype.focus=function focus(){var item=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var children=this.children().slice();var haveTitle=children.length&&children[0].className&&/vjs-menu-title/.test(children[0].className);if(haveTitle){children.shift()}if(children.length>0){if(item<0){item=0}else if(item>=children.length){item=children.length-1}this.focusedChild_=item;children[item].el_.focus()}};return Menu}(Component);Component.registerComponent("Menu",Menu);var MenuButton=function(_Component){inherits(MenuButton,_Component);function MenuButton(player){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};classCallCheck(this,MenuButton);var _this=possibleConstructorReturn(this,_Component.call(this,player,options));_this.menuButton_=new Button(player,options);_this.menuButton_.controlText(_this.controlText_);_this.menuButton_.el_.setAttribute("aria-haspopup","true");var buttonClass=Button.prototype.buildCSSClass();_this.menuButton_.el_.className=_this.buildCSSClass()+" "+buttonClass;_this.menuButton_.removeClass("vjs-control");_this.addChild(_this.menuButton_);_this.update();_this.enabled_=true;_this.on(_this.menuButton_,"tap",_this.handleClick);_this.on(_this.menuButton_,"click",_this.handleClick);_this.on(_this.menuButton_,"focus",_this.handleFocus);_this.on(_this.menuButton_,"blur",_this.handleBlur);_this.on("keydown",_this.handleSubmenuKeyPress);return _this}MenuButton.prototype.update=function update(){var menu=this.createMenu();if(this.menu){this.menu.dispose();this.removeChild(this.menu)}this.menu=menu;this.addChild(menu);this.buttonPressed_=false;this.menuButton_.el_.setAttribute("aria-expanded","false");if(this.items&&this.items.length<=this.hideThreshold_){this.hide()}else{this.show()}};MenuButton.prototype.createMenu=function createMenu(){var menu=new Menu(this.player_,{menuButton:this});this.hideThreshold_=0;if(this.options_.title){var title=createEl("li",{className:"vjs-menu-title",innerHTML:toTitleCase(this.options_.title),tabIndex:-1});this.hideThreshold_+=1;menu.children_.unshift(title);prependTo(title,menu.contentEl())}this.items=this.createItems();if(this.items){for(var i=0;i1&&arguments[1]!==undefined?arguments[1]:this.menuButton_.el();return this.menuButton_.controlText(text,el)};MenuButton.prototype.handleClick=function handleClick(event){this.one(this.menu.contentEl(),"mouseleave",bind(this,function(e){this.unpressButton();this.el_.blur()}));if(this.buttonPressed_){this.unpressButton()}else{this.pressButton()}};MenuButton.prototype.focus=function focus(){this.menuButton_.focus()};MenuButton.prototype.blur=function blur(){this.menuButton_.blur()};MenuButton.prototype.handleFocus=function handleFocus(){on(document_1,"keydown",bind(this,this.handleKeyPress))};MenuButton.prototype.handleBlur=function handleBlur(){off(document_1,"keydown",bind(this,this.handleKeyPress))};MenuButton.prototype.handleKeyPress=function handleKeyPress(event){if(event.which===27||event.which===9){if(this.buttonPressed_){this.unpressButton()}if(event.which!==9){event.preventDefault();this.menuButton_.el_.focus()}}else if(event.which===38||event.which===40){if(!this.buttonPressed_){this.pressButton();event.preventDefault()}}};MenuButton.prototype.handleSubmenuKeyPress=function handleSubmenuKeyPress(event){if(event.which===27||event.which===9){if(this.buttonPressed_){this.unpressButton()}if(event.which!==9){event.preventDefault();this.menuButton_.el_.focus()}}};MenuButton.prototype.pressButton=function pressButton(){if(this.enabled_){this.buttonPressed_=true;this.menu.lockShowing();this.menuButton_.el_.setAttribute("aria-expanded","true");if(IS_IOS&&isInFrame()){return}this.menu.focus()}};MenuButton.prototype.unpressButton=function unpressButton(){if(this.enabled_){this.buttonPressed_=false;this.menu.unlockShowing();this.menuButton_.el_.setAttribute("aria-expanded","false")}};MenuButton.prototype.disable=function disable(){this.unpressButton();this.enabled_=false;this.addClass("vjs-disabled");this.menuButton_.disable()};MenuButton.prototype.enable=function enable(){this.enabled_=true;this.removeClass("vjs-disabled");this.menuButton_.enable()};return MenuButton}(Component);Component.registerComponent("MenuButton",MenuButton);var TrackButton=function(_MenuButton){inherits(TrackButton,_MenuButton);function TrackButton(player,options){classCallCheck(this,TrackButton);var tracks=options.tracks;var _this=possibleConstructorReturn(this,_MenuButton.call(this,player,options));if(_this.items.length<=1){_this.hide()}if(!tracks){return possibleConstructorReturn(_this)}var updateHandler=bind(_this,_this.update);tracks.addEventListener("removetrack",updateHandler);tracks.addEventListener("addtrack",updateHandler);_this.player_.on("ready",updateHandler);_this.player_.on("dispose",function(){tracks.removeEventListener("removetrack",updateHandler);tracks.removeEventListener("addtrack",updateHandler)});return _this}return TrackButton}(MenuButton);Component.registerComponent("TrackButton",TrackButton);var MenuItem=function(_ClickableComponent){inherits(MenuItem,_ClickableComponent);function MenuItem(player,options){classCallCheck(this,MenuItem);var _this=possibleConstructorReturn(this,_ClickableComponent.call(this,player,options));_this.selectable=options.selectable;_this.isSelected_=options.selected||false;_this.selected(_this.isSelected_);if(_this.selectable){_this.el_.setAttribute("role","menuitemcheckbox")}else{_this.el_.setAttribute("role","menuitem")}return _this}MenuItem.prototype.createEl=function createEl(type,props,attrs){this.nonIconControl=true;return _ClickableComponent.prototype.createEl.call(this,"li",assign({className:"vjs-menu-item",innerHTML:''+this.localize(this.options_.label)+"",tabIndex:-1},props),attrs)};MenuItem.prototype.handleClick=function handleClick(event){this.selected(true)};MenuItem.prototype.selected=function selected(_selected){if(this.selectable){if(_selected){this.addClass("vjs-selected");this.el_.setAttribute("aria-checked","true");this.controlText(", selected");this.isSelected_=true}else{this.removeClass("vjs-selected");this.el_.setAttribute("aria-checked","false");this.controlText("");this.isSelected_=false}}};return MenuItem}(ClickableComponent);Component.registerComponent("MenuItem",MenuItem);var TextTrackMenuItem=function(_MenuItem){inherits(TextTrackMenuItem,_MenuItem);function TextTrackMenuItem(player,options){classCallCheck(this,TextTrackMenuItem);var track=options.track;var tracks=player.textTracks();options.label=track.label||track.language||"Unknown";options.selected=track.mode==="showing";var _this=possibleConstructorReturn(this,_MenuItem.call(this,player,options));_this.track=track;var changeHandler=function changeHandler(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}_this.handleTracksChange.apply(_this,args)};var selectedLanguageChangeHandler=function selectedLanguageChangeHandler(){for(var _len2=arguments.length,args=Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2]}_this.handleSelectedLanguageChange.apply(_this,args)};player.on(["loadstart","texttrackchange"],changeHandler);tracks.addEventListener("change",changeHandler);tracks.addEventListener("selectedlanguagechange",selectedLanguageChangeHandler);_this.on("dispose",function(){player.off(["loadstart","texttrackchange"],changeHandler);tracks.removeEventListener("change",changeHandler);tracks.removeEventListener("selectedlanguagechange",selectedLanguageChangeHandler)});if(tracks.onchange===undefined){var event=void 0;_this.on(["tap","click"],function(){if(_typeof(window_1.Event)!=="object"){try{event=new window_1.Event("change")}catch(err){}}if(!event){event=document_1.createEvent("Event");event.initEvent("change",true,true)}tracks.dispatchEvent(event)})}_this.handleTracksChange();return _this}TextTrackMenuItem.prototype.handleClick=function handleClick(event){var kind=this.track.kind;var kinds=this.track.kinds;var tracks=this.player_.textTracks();if(!kinds){kinds=[kind]}_MenuItem.prototype.handleClick.call(this,event);if(!tracks){return}for(var i=0;i-1){if(track.mode!=="showing"){track.mode="showing"}}else if(track.mode!=="disabled"){track.mode="disabled"}}};TextTrackMenuItem.prototype.handleTracksChange=function handleTracksChange(event){var shouldBeSelected=this.track.mode==="showing";if(shouldBeSelected!==this.isSelected_){this.selected(shouldBeSelected)}};TextTrackMenuItem.prototype.handleSelectedLanguageChange=function handleSelectedLanguageChange(event){if(this.track.mode==="showing"){var selectedLanguage=this.player_.cache_.selectedLanguage;if(selectedLanguage&&selectedLanguage.enabled&&selectedLanguage.language===this.track.language&&selectedLanguage.kind!==this.track.kind){return}this.player_.cache_.selectedLanguage={enabled:true,language:this.track.language,kind:this.track.kind}}};TextTrackMenuItem.prototype.dispose=function dispose(){this.track=null;_MenuItem.prototype.dispose.call(this)};return TextTrackMenuItem}(MenuItem);Component.registerComponent("TextTrackMenuItem",TextTrackMenuItem);var OffTextTrackMenuItem=function(_TextTrackMenuItem){inherits(OffTextTrackMenuItem,_TextTrackMenuItem);function OffTextTrackMenuItem(player,options){classCallCheck(this,OffTextTrackMenuItem);options.track={player:player,kind:options.kind,kinds:options.kinds,default:false,mode:"disabled"};if(!options.kinds){options.kinds=[options.kind]}if(options.label){options.track.label=options.label}else{options.track.label=options.kinds.join(" and ")+" off"}options.selectable=true;return possibleConstructorReturn(this,_TextTrackMenuItem.call(this,player,options))}OffTextTrackMenuItem.prototype.handleTracksChange=function handleTracksChange(event){var tracks=this.player().textTracks();var shouldBeSelected=true;for(var i=0,l=tracks.length;i-1&&track.mode==="showing"){shouldBeSelected=false;break}}if(shouldBeSelected!==this.isSelected_){this.selected(shouldBeSelected)}};OffTextTrackMenuItem.prototype.handleSelectedLanguageChange=function handleSelectedLanguageChange(event){var tracks=this.player().textTracks();var allHidden=true;for(var i=0,l=tracks.length;i-1&&track.mode==="showing"){allHidden=false;break}}if(allHidden){this.player_.cache_.selectedLanguage={enabled:false}}};return OffTextTrackMenuItem}(TextTrackMenuItem);Component.registerComponent("OffTextTrackMenuItem",OffTextTrackMenuItem);var TextTrackButton=function(_TrackButton){inherits(TextTrackButton,_TrackButton);function TextTrackButton(player){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};classCallCheck(this,TextTrackButton);options.tracks=player.textTracks();return possibleConstructorReturn(this,_TrackButton.call(this,player,options))}TextTrackButton.prototype.createItems=function createItems(){var items=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var TrackMenuItem=arguments.length>1&&arguments[1]!==undefined?arguments[1]:TextTrackMenuItem;var label=void 0;if(this.label_){label=this.label_+" off"}items.push(new OffTextTrackMenuItem(this.player_,{kinds:this.kinds_,kind:this.kind_,label:label}));this.hideThreshold_+=1;var tracks=this.player_.textTracks();if(!Array.isArray(this.kinds_)){this.kinds_=[this.kind_]}for(var i=0;i-1){var item=new TrackMenuItem(this.player_,{track:track,selectable:true});item.addClass("vjs-"+track.kind+"-menu-item");items.push(item)}}return items};return TextTrackButton}(TrackButton);Component.registerComponent("TextTrackButton",TextTrackButton);var ChaptersTrackMenuItem=function(_MenuItem){inherits(ChaptersTrackMenuItem,_MenuItem);function ChaptersTrackMenuItem(player,options){classCallCheck(this,ChaptersTrackMenuItem);var track=options.track;var cue=options.cue;var currentTime=player.currentTime();options.selectable=true;options.label=cue.text;options.selected=cue.startTime<=currentTime&¤tTime=0;i--){var track=tracks[i];if(track.kind===this.kind_){return track}}};ChaptersButton.prototype.getMenuCaption=function getMenuCaption(){if(this.track_&&this.track_.label){return this.track_.label}return this.localize(toTitleCase(this.kind_))};ChaptersButton.prototype.createMenu=function createMenu(){this.options_.title=this.getMenuCaption();return _TextTrackButton.prototype.createMenu.call(this)};ChaptersButton.prototype.createItems=function createItems(){var items=[];if(!this.track_){return items}var cues=this.track_.cues;if(!cues){return items}for(var i=0,l=cues.length;i