!function(c,d){"use strict";var e=!1,i=!1;function t(){if(!i){i=!0;for(var e,t,r,a=-1!==navigator.appVersion.indexOf("MSIE 10"),s=!!navigator.userAgent.match(/Trident.*rv:11\./),n=d.querySelectorAll("iframe.wp-embedded-content"),o=0;o<n.length;o++)(r=(t=n[o]).getAttribute("data-secret"))||(r=Math.random().toString(36).substr(2,10),t.src+="#?secret="+r,t.setAttribute("data-secret",r)),(a||s)&&((e=t.cloneNode(!0)).removeAttribute("security"),t.parentNode.replaceChild(e,t)),t.contentWindow.postMessage({message:"ready",secret:r},"*")}}d.querySelector&&c.addEventListener&&(e=!0),c.wp=c.wp||{},c.wp.receiveEmbedMessage||(c.wp.receiveEmbedMessage=function(e){var t=e.data;if(t)if(t.secret||t.message||t.value){if(!/[^a-zA-Z0-9]/.test(t.secret)){for(var r,a,s,n=d.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),o=d.querySelectorAll('blockquote[data-secret="'+t.secret+'"]'),i=0;i<o.length;i++)o[i].style.display="none";for(i=0;i<n.length;i++)r=n[i],e.source!==r.contentWindow||(r.removeAttribute("style"),"height"===t.message&&(1e3<(a=parseInt(t.value,10))?a=1e3:~~a<200&&(a=200),r.height=a),"link"===t.message&&(a=d.createElement("a"),s=d.createElement("a"),a.href=r.getAttribute("src"),s.href=t.value,s.host!==a.host||d.activeElement===r&&(c.top.location.href=t.value)))}}else;else;},e&&(c.addEventListener("message",c.wp.receiveEmbedMessage,!1),d.addEventListener("DOMContentLoaded",t,!1),c.addEventListener("load",t,!1)))}(window,document);
!function(e){var n,o;"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e():(n=window.Cookies,(o=window.Cookies=e()).noConflict=function(){return window.Cookies=n,o})}(function(){function u(){for(var e=0,n={};e<arguments.length;e++){var o,t=arguments[e];for(o in t)n[o]=t[o]}return n}return function e(d){function f(e,n,o){var t,i;if(1<arguments.length){"number"==typeof(o=u({path:"/"},f.defaults,o)).expires&&((i=new Date).setMilliseconds(i.getMilliseconds()+864e5*o.expires),o.expires=i);try{t=JSON.stringify(n),/^[\{\[]/.test(t)&&(n=t)}catch(e){}return n=(n=encodeURIComponent(String(n))).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=(e=(e=encodeURIComponent(String(e))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape),document.cookie=[e,"=",n,o.expires&&"; expires="+o.expires.toUTCString(),o.path&&"; path="+o.path,o.domain&&"; domain="+o.domain,o.secure?"; secure":""].join("")}e||(t={});for(var r=document.cookie?document.cookie.split("; "):[],c=/(%[0-9A-Z]{2})+/g,s=0;s<r.length;s++){var p=r[s].split("="),a=p[0].replace(c,decodeURIComponent);'"'===(p=p.slice(1).join("=")).charAt(0)&&(p=p.slice(1,-1));try{if(p=d&&d(p,a)||p.replace(c,decodeURIComponent),this.json)try{p=JSON.parse(p)}catch(e){}if(e===a){t=p;break}e||(t[a]=p)}catch(e){}}return t}return(f.get=f.set=f).getJSON=function(){return f.apply({json:!0},[].slice.call(arguments))},f.defaults={},f.remove=function(e,n){f(e,"",u(n,{expires:-1}))},f.withConverter=e,f}()});
!function(c,s,h){"use strict";function n(t,e){var n,o,i,a=[],s=0;t&&t.isDefaultPrevented()||(t.preventDefault(),e=e||{},n=(e=t&&t.data?u(t.data.options,e):e).$target||h(t.currentTarget).trigger("blur"),(i=h.fancybox.getInstance())&&i.$trigger&&i.$trigger.is(n)||(a=e.selector?h(e.selector):(o=n.attr("data-fancybox")||"")?(a=t.data?t.data.items:[]).length?a.filter('[data-fancybox="'+o+'"]'):h('[data-fancybox="'+o+'"]'):[n],s=h(a).index(n),(i=h.fancybox.open(a,e,s=s<0?0:s)).$trigger=n))}if(c.console=c.console||{info:function(t){}},h){if(h.fn.fancybox)return console.info("fancyBox already initialized");var t={closeExisting:!1,loop:!1,gutter:50,keyboard:!0,preventCaptionOverlap:!0,arrows:!0,infobar:!0,smallBtn:"auto",toolbar:"auto",buttons:["zoom","slideShow","thumbs","close"],idleTime:3,protect:!1,modal:!1,image:{preload:!1},ajax:{settings:{data:{fancybox:!0}}},iframe:{tpl:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" allowfullscreen="allowfullscreen" allow="autoplay; fullscreen" src=""></iframe>',preload:!0,css:{},attr:{scrolling:"auto"}},video:{tpl:'<video class="fancybox-video" controls controlsList="nodownload" poster="{{poster}}"><source src="{{src}}" type="{{format}}" />Sorry, your browser doesn\'t support embedded videos, <a href="{{src}}">download</a> and watch with your favorite video player!</video>',format:"",autoStart:!0},defaultType:"image",animationEffect:"zoom",animationDuration:366,zoomOpacity:"auto",transitionEffect:"fade",transitionDuration:366,slideClass:"",baseClass:"",baseTpl:'<div class="fancybox-container" role="dialog" tabindex="-1"><div class="fancybox-bg"></div><div class="fancybox-inner"><div class="fancybox-infobar"><span data-fancybox-index></span>&nbsp;/&nbsp;<span data-fancybox-count></span></div><div class="fancybox-toolbar">{{buttons}}</div><div class="fancybox-navigation">{{arrows}}</div><div class="fancybox-stage"></div><div class="fancybox-caption"><div class="fancybox-caption__body"></div></div></div></div>',spinnerTpl:'<div class="fancybox-loading"></div>',errorTpl:'<div class="fancybox-error"><p>{{ERROR}}</p></div>',btnTpl:{download:'<a download data-fancybox-download class="fancybox-button fancybox-button--download" title="{{DOWNLOAD}}" href="javascript:;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.62 17.09V19H5.38v-1.91zm-2.97-6.96L17 11.45l-5 4.87-5-4.87 1.36-1.32 2.68 2.64V5h1.92v7.77z"/></svg></a>',zoom:'<button data-fancybox-zoom class="fancybox-button fancybox-button--zoom" title="{{ZOOM}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.7 17.3l-3-3a5.9 5.9 0 0 0-.6-7.6 5.9 5.9 0 0 0-8.4 0 5.9 5.9 0 0 0 0 8.4 5.9 5.9 0 0 0 7.7.7l3 3a1 1 0 0 0 1.3 0c.4-.5.4-1 0-1.5zM8.1 13.8a4 4 0 0 1 0-5.7 4 4 0 0 1 5.7 0 4 4 0 0 1 0 5.7 4 4 0 0 1-5.7 0z"/></svg></button>',close:'<button data-fancybox-close class="fancybox-button fancybox-button--close" title="{{CLOSE}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 10.6L6.6 5.2 5.2 6.6l5.4 5.4-5.4 5.4 1.4 1.4 5.4-5.4 5.4 5.4 1.4-1.4-5.4-5.4 5.4-5.4-1.4-1.4-5.4 5.4z"/></svg></button>',arrowLeft:'<button data-fancybox-prev class="fancybox-button fancybox-button--arrow_left" title="{{PREV}}"><div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.28 15.7l-1.34 1.37L5 12l4.94-5.07 1.34 1.38-2.68 2.72H19v1.94H8.6z"/></svg></div></button>',arrowRight:'<button data-fancybox-next class="fancybox-button fancybox-button--arrow_right" title="{{NEXT}}"><div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.4 12.97l-2.68 2.72 1.34 1.38L19 12l-4.94-5.07-1.34 1.38 2.68 2.72H5v1.94z"/></svg></div></button>',smallBtn:'<button type="button" data-fancybox-close class="fancybox-button fancybox-close-small" title="{{CLOSE}}"><svg xmlns="http://www.w3.org/2000/svg" version="1" viewBox="0 0 24 24"><path d="M13 12l5-5-1-1-5 5-5-5-1 1 5 5-5 5 1 1 5-5 5 5 1-1z"/></svg></button>'},parentEl:"body",hideScrollbar:!0,autoFocus:!0,backFocus:!0,trapFocus:!0,fullScreen:{autoStart:!1},touch:{vertical:!0,momentum:!0},hash:null,media:{},slideShow:{autoStart:!1,speed:3e3},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"},wheel:"auto",onInit:h.noop,beforeLoad:h.noop,afterLoad:h.noop,beforeShow:h.noop,afterShow:h.noop,beforeClose:h.noop,afterClose:h.noop,onActivate:h.noop,onDeactivate:h.noop,clickContent:function(t,e){return"image"===t.type&&"zoom"},clickSlide:"close",clickOutside:"close",dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1,mobile:{preventCaptionOverlap:!1,idleTime:!1,clickContent:function(t,e){return"image"===t.type&&"toggleControls"},clickSlide:function(t,e){return"image"===t.type?"toggleControls":"close"},dblclickContent:function(t,e){return"image"===t.type&&"zoom"},dblclickSlide:function(t,e){return"image"===t.type&&"zoom"}},lang:"en",i18n:{en:{CLOSE:"Close",NEXT:"Next",PREV:"Previous",ERROR:"The requested content cannot be loaded. <br/> Please try again later.",PLAY_START:"Start slideshow",PLAY_STOP:"Pause slideshow",FULL_SCREEN:"Full screen",THUMBS:"Thumbnails",DOWNLOAD:"Download",SHARE:"Share",ZOOM:"Zoom"},de:{CLOSE:"Schlie&szlig;en",NEXT:"Weiter",PREV:"Zur&uuml;ck",ERROR:"Die angeforderten Daten konnten nicht geladen werden. <br/> Bitte versuchen Sie es sp&auml;ter nochmal.",PLAY_START:"Diaschau starten",PLAY_STOP:"Diaschau beenden",FULL_SCREEN:"Vollbild",THUMBS:"Vorschaubilder",DOWNLOAD:"Herunterladen",SHARE:"Teilen",ZOOM:"Vergr&ouml;&szlig;ern"}}},i=h(c),a=h(s),r=0,d=c.requestAnimationFrame||c.webkitRequestAnimationFrame||c.mozRequestAnimationFrame||c.oRequestAnimationFrame||function(t){return c.setTimeout(t,1e3/60)},e=c.cancelAnimationFrame||c.webkitCancelAnimationFrame||c.mozCancelAnimationFrame||c.oCancelAnimationFrame||function(t){c.clearTimeout(t)},l=function(){var t,e=s.createElement("fakeelement"),n={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(t in n)if(void 0!==e.style[t])return n[t];return"transitionend"}(),f=function(t){return t&&t.length&&t[0].offsetHeight},u=function(t,e){var n=h.extend(!0,{},t,e);return h.each(e,function(t,e){h.isArray(e)&&(n[t]=e)}),n},o=function(t,e,n){var o=this;o.opts=u({index:n},h.fancybox.defaults),h.isPlainObject(e)&&(o.opts=u(o.opts,e)),h.fancybox.isMobile&&(o.opts=u(o.opts,o.opts.mobile)),o.id=o.opts.id||++r,o.currIndex=parseInt(o.opts.index,10)||0,o.prevIndex=null,o.prevPos=null,o.currPos=0,o.firstRun=!0,o.group=[],o.slides={},o.addContent(t),o.group.length&&o.init()};h.extend(o.prototype,{init:function(){var e,n,o=this,i=o.group[o.currIndex].opts;i.closeExisting&&h.fancybox.close(!0),h("body").addClass("fancybox-active"),!h.fancybox.getInstance()&&!1!==i.hideScrollbar&&!h.fancybox.isMobile&&s.body.scrollHeight>c.innerHeight&&(h("head").append('<style id="fancybox-style-noscroll" type="text/css">.compensate-for-scrollbar{margin-right:'+(c.innerWidth-s.documentElement.clientWidth)+"px;}</style>"),h("body").addClass("compensate-for-scrollbar")),n="",h.each(i.buttons,function(t,e){n+=i.btnTpl[e]||""}),e=h(o.translate(o,i.baseTpl.replace("{{buttons}}",n).replace("{{arrows}}",i.btnTpl.arrowLeft+i.btnTpl.arrowRight))).attr("id","fancybox-container-"+o.id).addClass(i.baseClass).data("FancyBox",o).appendTo(i.parentEl),o.$refs={container:e},["bg","inner","infobar","toolbar","stage","caption","navigation"].forEach(function(t){o.$refs[t]=e.find(".fancybox-"+t)}),o.trigger("onInit"),o.activate(),o.jumpTo(o.currIndex)},translate:function(t,e){var n=t.opts.i18n[t.opts.lang]||t.opts.i18n.en;return e.replace(/\{\{(\w+)\}\}/g,function(t,e){return void 0===n[e]?t:n[e]})},addContent:function(t){var s=this,t=h.makeArray(t);h.each(t,function(t,e){var n,o,i={},a={};h.isPlainObject(e)?a=(i=e).opts||e:"object"===h.type(e)&&h(e).length?(a=(o=h(e)).data()||{},(a=h.extend(!0,{},a,a.options)).$orig=o,i.src=s.opts.src||a.src||o.attr("href"),i.type||i.src||(i.type="inline",i.src=e)):i={type:"html",src:e+""},i.opts=h.extend(!0,{},s.opts,a),h.isArray(a.buttons)&&(i.opts.buttons=a.buttons),h.fancybox.isMobile&&i.opts.mobile&&(i.opts=u(i.opts,i.opts.mobile)),n=i.type||i.opts.type,o=i.src||"",!n&&o&&((a=o.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))?(n="video",i.opts.video.format||(i.opts.video.format="video/"+("ogv"===a[1]?"ogg":a[1]))):o.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)?n="image":o.match(/\.(pdf)((\?|#).*)?$/i)?i=h.extend(!0,i,{contentType:"pdf",opts:{iframe:{preload:!(n="iframe")}}}):"#"===o.charAt(0)&&(n="inline")),n?i.type=n:s.trigger("objectNeedsType",i),i.contentType||(i.contentType=-1<h.inArray(i.type,["html","inline","ajax"])?"html":i.type),i.index=s.group.length,"auto"==i.opts.smallBtn&&(i.opts.smallBtn=-1<h.inArray(i.type,["html","inline","ajax"])),"auto"===i.opts.toolbar&&(i.opts.toolbar=!i.opts.smallBtn),i.$thumb=i.opts.$thumb||null,i.opts.$trigger&&i.index===s.opts.index&&(i.$thumb=i.opts.$trigger.find("img:first"),i.$thumb.length&&(i.opts.$orig=i.opts.$trigger)),i.$thumb&&i.$thumb.length||!i.opts.$orig||(i.$thumb=i.opts.$orig.find("img:first")),i.$thumb&&!i.$thumb.length&&(i.$thumb=null),i.thumb=i.opts.thumb||(i.$thumb?i.$thumb[0].src:null),"function"===h.type(i.opts.caption)&&(i.opts.caption=i.opts.caption.apply(e,[s,i])),"function"===h.type(s.opts.caption)&&(i.opts.caption=s.opts.caption.apply(e,[s,i])),i.opts.caption instanceof h||(i.opts.caption=void 0===i.opts.caption?"":i.opts.caption+""),"ajax"!==i.type||1<(o=o.split(/\s+/,2)).length&&(i.src=o.shift(),i.opts.filter=o.shift()),i.opts.modal&&(i.opts=h.extend(!0,i.opts,{trapFocus:!0,infobar:0,toolbar:0,smallBtn:0,keyboard:0,slideShow:0,fullScreen:0,thumbs:0,touch:0,clickContent:!1,clickSlide:!1,clickOutside:!1,dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1})),s.group.push(i)}),Object.keys(s.slides).length&&(s.updateControls(),(t=s.Thumbs)&&t.isActive&&(t.create(),t.focus()))},addEvents:function(){var o=this;o.removeEvents(),o.$refs.container.on("click.fb-close","[data-fancybox-close]",function(t){t.stopPropagation(),t.preventDefault(),o.close(t)}).on("touchstart.fb-prev click.fb-prev","[data-fancybox-prev]",function(t){t.stopPropagation(),t.preventDefault(),o.previous()}).on("touchstart.fb-next click.fb-next","[data-fancybox-next]",function(t){t.stopPropagation(),t.preventDefault(),o.next()}).on("click.fb","[data-fancybox-zoom]",function(t){o[o.isScaledDown()?"scaleToActual":"scaleToFit"]()}),i.on("orientationchange.fb resize.fb",function(t){t&&t.originalEvent&&"resize"===t.originalEvent.type?(o.requestId&&e(o.requestId),o.requestId=d(function(){o.update(t)})):(o.current&&"iframe"===o.current.type&&o.$refs.stage.hide(),setTimeout(function(){o.$refs.stage.show(),o.update(t)},h.fancybox.isMobile?600:250))}),a.on("keydown.fb",function(t){var e=(h.fancybox?h.fancybox.getInstance():null).current,n=t.keyCode||t.which;if(9!=n)return!e.opts.keyboard||t.ctrlKey||t.altKey||t.shiftKey||h(t.target).is("input,textarea,video,audio")?void 0:8===n||27===n?(t.preventDefault(),void o.close(t)):37===n||38===n?(t.preventDefault(),void o.previous()):39===n||40===n?(t.preventDefault(),void o.next()):void o.trigger("afterKeydown",t,n);e.opts.trapFocus&&o.focus(t)}),o.group[o.currIndex].opts.idleTime&&(o.idleSecondsCounter=0,a.on("mousemove.fb-idle mouseleave.fb-idle mousedown.fb-idle touchstart.fb-idle touchmove.fb-idle scroll.fb-idle keydown.fb-idle",function(t){o.idleSecondsCounter=0,o.isIdle&&o.showControls(),o.isIdle=!1}),o.idleInterval=c.setInterval(function(){++o.idleSecondsCounter>=o.group[o.currIndex].opts.idleTime&&!o.isDragging&&(o.isIdle=!0,o.idleSecondsCounter=0,o.hideControls())},1e3))},removeEvents:function(){i.off("orientationchange.fb resize.fb"),a.off("keydown.fb .fb-idle"),this.$refs.container.off(".fb-close .fb-prev .fb-next"),this.idleInterval&&(c.clearInterval(this.idleInterval),this.idleInterval=null)},previous:function(t){return this.jumpTo(this.currPos-1,t)},next:function(t){return this.jumpTo(this.currPos+1,t)},jumpTo:function(t,o){var e,n,i,a,s,r,c,l,d=this,u=d.group.length;if(!(d.isDragging||d.isClosing||d.isAnimating&&d.firstRun))return t=parseInt(t,10),!(!(n=(d.current||d).opts.loop)&&(t<0||u<=t))&&(e=d.firstRun=!Object.keys(d.slides).length,a=d.current,d.prevIndex=d.currIndex,d.prevPos=d.currPos,i=d.createSlide(t),1<u&&((n||i.index<u-1)&&d.createSlide(t+1),(n||0<i.index)&&d.createSlide(t-1)),d.current=i,d.currIndex=i.index,d.currPos=i.pos,d.trigger("beforeShow",e),d.updateControls(),i.forcedDuration=void 0,h.isNumeric(o)?i.forcedDuration=o:o=i.opts[e?"animationDuration":"transitionDuration"],o=parseInt(o,10),t=d.isMoved(i),i.$slide.addClass("fancybox-slide--current"),e?(i.opts.animationEffect&&o&&d.$refs.container.css("transition-duration",o+"ms"),d.$refs.container.addClass("fancybox-is-open").trigger("focus"),d.loadSlide(i)):(s=h.fancybox.getTranslate(a.$slide),r=h.fancybox.getTranslate(d.$refs.stage),h.each(d.slides,function(t,e){h.fancybox.stop(e.$slide,!0)}),a.pos!==i.pos&&(a.isComplete=!1),a.$slide.removeClass("fancybox-slide--complete fancybox-slide--current"),t?(l=s.left-(a.pos*s.width+a.pos*a.opts.gutter),h.each(d.slides,function(t,e){e.$slide.removeClass("fancybox-animated").removeClass(function(t,e){return(e.match(/(^|\s)fancybox-fx-\S+/g)||[]).join(" ")});var n=e.pos*s.width+e.pos*e.opts.gutter;h.fancybox.setTranslate(e.$slide,{top:0,left:n-r.left+l}),e.pos!==i.pos&&e.$slide.addClass("fancybox-slide--"+(e.pos>i.pos?"next":"previous")),f(e.$slide),h.fancybox.animate(e.$slide,{top:0,left:(e.pos-i.pos)*s.width+(e.pos-i.pos)*e.opts.gutter},o,function(){e.$slide.css({transform:"",opacity:""}).removeClass("fancybox-slide--next fancybox-slide--previous"),e.pos===d.currPos&&d.complete()})})):o&&i.opts.transitionEffect&&(c="fancybox-animated fancybox-fx-"+i.opts.transitionEffect,a.$slide.addClass("fancybox-slide--"+(a.pos>i.pos?"next":"previous")),h.fancybox.animate(a.$slide,c,o,function(){a.$slide.removeClass(c).removeClass("fancybox-slide--next fancybox-slide--previous")},!1)),i.isLoaded?d.revealContent(i):d.loadSlide(i)),void d.preload("image"))},createSlide:function(t){var e,n=this,o=t%n.group.length;return o=o<0?n.group.length+o:o,!n.slides[t]&&n.group[o]&&(e=h('<div class="fancybox-slide"></div>').appendTo(n.$refs.stage),n.slides[t]=h.extend(!0,{},n.group[o],{pos:t,$slide:e,isLoaded:!1}),n.updateSlide(n.slides[t])),n.slides[t]},scaleToActual:function(t,e,n){var o,i,a,s,r=this,c=r.current,l=c.$content,d=h.fancybox.getTranslate(c.$slide).width,u=h.fancybox.getTranslate(c.$slide).height,f=c.width,p=c.height;r.isAnimating||r.isMoved()||!l||"image"!=c.type||!c.isLoaded||c.hasError||(r.isAnimating=!0,h.fancybox.stop(l),t=void 0===t?.5*d:t,e=void 0===e?.5*u:e,(o=h.fancybox.getTranslate(l)).top-=h.fancybox.getTranslate(c.$slide).top,o.left-=h.fancybox.getTranslate(c.$slide).left,a=f/o.width,s=p/o.height,i=.5*d-.5*f,c=.5*u-.5*p,d<f&&((i=0<(i=o.left*a-(t*a-t))?0:i)<d-f&&(i=d-f)),u<p&&((c=0<(c=o.top*s-(e*s-e))?0:c)<u-p&&(c=u-p)),r.updateCursor(f,p),h.fancybox.animate(l,{top:c,left:i,scaleX:a,scaleY:s},n||366,function(){r.isAnimating=!1}),r.SlideShow&&r.SlideShow.isActive&&r.SlideShow.stop())},scaleToFit:function(t){var e=this,n=e.current,o=n.$content;e.isAnimating||e.isMoved()||!o||"image"!=n.type||!n.isLoaded||n.hasError||(e.isAnimating=!0,h.fancybox.stop(o),n=e.getFitPos(n),e.updateCursor(n.width,n.height),h.fancybox.animate(o,{top:n.top,left:n.left,scaleX:n.width/o.width(),scaleY:n.height/o.height()},t||366,function(){e.isAnimating=!1}))},getFitPos:function(t){var e,n,o=t.$content,i=t.$slide,a=t.width||t.opts.width,s=t.height||t.opts.height,r={};return!!(t.isLoaded&&o&&o.length)&&(e=h.fancybox.getTranslate(this.$refs.stage).width,n=h.fancybox.getTranslate(this.$refs.stage).height,e-=parseFloat(i.css("paddingLeft"))+parseFloat(i.css("paddingRight"))+parseFloat(o.css("marginLeft"))+parseFloat(o.css("marginRight")),n-=parseFloat(i.css("paddingTop"))+parseFloat(i.css("paddingBottom"))+parseFloat(o.css("marginTop"))+parseFloat(o.css("marginBottom")),a&&s||(a=e,s=n),e-.5<(a*=o=Math.min(1,e/a,n/s))&&(a=e),n-.5<(s*=o)&&(s=n),"image"===t.type?(r.top=Math.floor(.5*(n-s))+parseFloat(i.css("paddingTop")),r.left=Math.floor(.5*(e-a))+parseFloat(i.css("paddingLeft"))):"video"===t.contentType&&(a/(t=t.opts.width&&t.opts.height?a/s:t.opts.ratio||16/9)<s?s=a/t:s*t<a&&(a=s*t)),r.width=a,r.height=s,r)},update:function(n){var o=this;h.each(o.slides,function(t,e){o.updateSlide(e,n)})},updateSlide:function(t,e){var n=this,o=t&&t.$content,i=t.width||t.opts.width,a=t.height||t.opts.height,s=t.$slide;n.adjustCaption(t),o&&(i||a||"video"===t.contentType)&&!t.hasError&&(h.fancybox.stop(o),h.fancybox.setTranslate(o,n.getFitPos(t)),t.pos===n.currPos&&(n.isAnimating=!1,n.updateCursor())),n.adjustLayout(t),s.length&&(s.trigger("refresh"),t.pos===n.currPos&&n.$refs.toolbar.add(n.$refs.navigation.find(".fancybox-button--arrow_right")).toggleClass("compensate-for-scrollbar",s.get(0).scrollHeight>s.get(0).clientHeight)),n.trigger("onUpdate",t,e)},centerSlide:function(t){var e=this,n=e.current,o=n.$slide;!e.isClosing&&n&&(o.siblings().css({transform:"",opacity:""}),o.parent().children().removeClass("fancybox-slide--previous fancybox-slide--next"),h.fancybox.animate(o,{top:0,left:0,opacity:1},void 0===t?0:t,function(){o.css({transform:"",opacity:""}),n.isComplete||e.complete()},!1))},isMoved:function(t){var e,n=t||this.current;return!!n&&(e=h.fancybox.getTranslate(this.$refs.stage),t=h.fancybox.getTranslate(n.$slide),!n.$slide.hasClass("fancybox-animated")&&(.5<Math.abs(t.top-e.top)||.5<Math.abs(t.left-e.left)))},updateCursor:function(t,e){var n=this,o=n.current,i=n.$refs.container;o&&!n.isClosing&&n.Guestures&&(i.removeClass("fancybox-is-zoomable fancybox-can-zoomIn fancybox-can-zoomOut fancybox-can-swipe fancybox-can-pan"),e=!!(t=n.canPan(t,e))||n.isZoomable(),i.toggleClass("fancybox-is-zoomable",e),h("[data-fancybox-zoom]").prop("disabled",!e),t?i.addClass("fancybox-can-pan"):e&&("zoom"===o.opts.clickContent||h.isFunction(o.opts.clickContent)&&"zoom"==o.opts.clickContent(o))?i.addClass("fancybox-can-zoomIn"):o.opts.touch&&(o.opts.touch.vertical||1<n.group.length)&&"video"!==o.contentType&&i.addClass("fancybox-can-swipe"))},isZoomable:function(){var t,e=this.current;if(e&&!this.isClosing&&"image"===e.type&&!e.hasError){if(!e.isLoaded)return!0;if((t=this.getFitPos(e))&&(e.width>t.width||e.height>t.height))return!0}return!1},isScaledDown:function(t,e){var n=!1,o=this.current,i=o.$content;return void 0!==t&&void 0!==e?n=t<o.width&&e<o.height:i&&(n=(n=h.fancybox.getTranslate(i)).width<o.width&&n.height<o.height),n},canPan:function(t,e){var n=this.current,o=null,i=!1;return"image"===n.type&&(n.isComplete||t&&e)&&!n.hasError&&(i=this.getFitPos(n),void 0!==t&&void 0!==e?o={width:t,height:e}:n.isComplete&&(o=h.fancybox.getTranslate(n.$content)),o&&i&&(i=1.5<Math.abs(o.width-i.width)||1.5<Math.abs(o.height-i.height))),i},loadSlide:function(n){var t,e,o,i=this;if(!n.isLoading&&!n.isLoaded){if(!(n.isLoading=!0)===i.trigger("beforeLoad",n))return n.isLoading=!1;switch(t=n.type,(e=n.$slide).off("refresh").trigger("onReset").addClass(n.opts.slideClass),t){case"image":i.setImage(n);break;case"iframe":i.setIframe(n);break;case"html":i.setContent(n,n.src||n.content);break;case"video":i.setContent(n,n.opts.video.tpl.replace(/\{\{src\}\}/gi,n.src).replace("{{format}}",n.opts.videoFormat||n.opts.video.format||"").replace("{{poster}}",n.thumb||""));break;case"inline":h(n.src).length?i.setContent(n,h(n.src)):i.setError(n);break;case"ajax":i.showLoading(n),o=h.ajax(h.extend({},n.opts.ajax.settings,{url:n.src,success:function(t,e){"success"===e&&i.setContent(n,t)},error:function(t,e){t&&"abort"!==e&&i.setError(n)}})),e.one("onReset",function(){o.abort()});break;default:i.setError(n)}return!0}},setImage:function(e){var t,n=this;setTimeout(function(){var t=e.$image;n.isClosing||!e.isLoading||t&&t.length&&t[0].complete||e.hasError||n.showLoading(e)},50),n.checkSrcset(e),e.$content=h('<div class="fancybox-content"></div>').addClass("fancybox-is-hidden").appendTo(e.$slide.addClass("fancybox-slide--image")),!1!==e.opts.preload&&e.opts.width&&e.opts.height&&e.thumb&&(e.width=e.opts.width,e.height=e.opts.height,(t=s.createElement("img")).onerror=function(){h(this).remove(),e.$ghost=null},t.onload=function(){n.afterLoad(e)},e.$ghost=h(t).addClass("fancybox-image").appendTo(e.$content).attr("src",e.thumb)),n.setBigImage(e)},checkSrcset:function(t){var e,n,o,i,a=t.opts.srcset||t.opts.image.srcset;if(a){o=c.devicePixelRatio||1,i=c.innerWidth*o,(n=a.split(",").map(function(t){var o={};return t.trim().split(/\s+/).forEach(function(t,e){var n=parseInt(t.substring(0,t.length-1),10);if(0===e)return o.url=t;n&&(o.value=n,o.postfix=t[t.length-1])}),o})).sort(function(t,e){return t.value-e.value});for(var s=0;s<n.length;s++){var r=n[s];if("w"===r.postfix&&r.value>=i||"x"===r.postfix&&r.value>=o){e=r;break}}(e=!e&&n.length?n[n.length-1]:e)&&(t.src=e.url,t.width&&t.height&&"w"==e.postfix&&(t.height=t.width/t.height*e.value,t.width=e.value),t.opts.srcset=a)}},setBigImage:function(e){var n=this,t=s.createElement("img"),o=h(t);e.$image=o.one("error",function(){n.setError(e)}).one("load",function(){var t;e.$ghost||(n.resolveImageSlideSize(e,this.naturalWidth,this.naturalHeight),n.afterLoad(e)),n.isClosing||(e.opts.srcset&&((t=e.opts.sizes)&&"auto"!==t||(t=(1<e.width/e.height&&1<i.width()/i.height()?"100":Math.round(e.width/e.height*100))+"vw"),o.attr("sizes",t).attr("srcset",e.opts.srcset)),e.$ghost&&setTimeout(function(){e.$ghost&&!n.isClosing&&e.$ghost.hide()},Math.min(300,Math.max(1e3,e.height/1600))),n.hideLoading(e))}).addClass("fancybox-image").attr("src",e.src).appendTo(e.$content),(t.complete||"complete"==t.readyState)&&o.naturalWidth&&o.naturalHeight?o.trigger("load"):t.error&&o.trigger("error")},resolveImageSlideSize:function(t,e,n){var o=parseInt(t.opts.width,10),i=parseInt(t.opts.height,10);t.width=e,t.height=n,0<o&&(t.width=o,t.height=Math.floor(o*n/e)),0<i&&(t.width=Math.floor(i*e/n),t.height=i)},setIframe:function(i){var a,e=this,s=i.opts.iframe,r=i.$slide;i.$content=h('<div class="fancybox-content'+(s.preload?" fancybox-is-hidden":"")+'"></div>').css(s.css).appendTo(r),r.addClass("fancybox-slide--"+i.contentType),i.$iframe=a=h(s.tpl.replace(/\{rnd\}/g,(new Date).getTime())).attr(s.attr).appendTo(i.$content),s.preload?(e.showLoading(i),a.on("load.fb error.fb",function(t){this.isReady=1,i.$slide.trigger("refresh"),e.afterLoad(i)}),r.on("refresh.fb",function(){var t,e=i.$content,n=s.css.width,o=s.css.height;if(1===a[0].isReady){try{t=a.contents().find("body")}catch(t){}t&&t.length&&t.children().length&&(r.css("overflow","visible"),e.css({width:"100%","max-width":"100%",height:"9999px"}),void 0===n&&(n=Math.ceil(Math.max(t[0].clientWidth,t.outerWidth(!0)))),e.css("width",n||"").css("max-width",""),void 0===o&&(o=Math.ceil(Math.max(t[0].clientHeight,t.outerHeight(!0)))),e.css("height",o||""),r.css("overflow","auto")),e.removeClass("fancybox-is-hidden")}})):e.afterLoad(i),a.attr("src",i.src),r.one("onReset",function(){try{h(this).find("iframe").hide().unbind().attr("src","//about:blank")}catch(t){}h(this).off("refresh.fb").empty(),i.isLoaded=!1,i.isRevealed=!1})},setContent:function(t,e){var n;this.isClosing||(this.hideLoading(t),t.$content&&h.fancybox.stop(t.$content),t.$slide.empty(),(n=e)&&n.hasOwnProperty&&n instanceof h&&e.parent().length?((e.hasClass("fancybox-content")||e.parent().hasClass("fancybox-content"))&&e.parents(".fancybox-slide").trigger("onReset"),t.$placeholder=h("<div>").hide().insertAfter(e),e.css("display","inline-block")):t.hasError||("string"===h.type(e)&&(e=h("<div>").append(h.trim(e)).contents()),t.opts.filter&&(e=h("<div>").html(e).find(t.opts.filter))),t.$slide.one("onReset",function(){h(this).find("video,audio").trigger("pause"),t.$placeholder&&(t.$placeholder.after(e.removeClass("fancybox-content").hide()).remove(),t.$placeholder=null),t.$smallBtn&&(t.$smallBtn.remove(),t.$smallBtn=null),t.hasError||(h(this).empty(),t.isLoaded=!1,t.isRevealed=!1)}),h(e).appendTo(t.$slide),h(e).is("video,audio")&&(h(e).addClass("fancybox-video"),h(e).wrap("<div></div>"),t.contentType="video",t.opts.width=t.opts.width||h(e).attr("width"),t.opts.height=t.opts.height||h(e).attr("height")),t.$content=t.$slide.children().filter("div,form,main,video,audio,article,.fancybox-content").first(),t.$content.siblings().hide(),t.$content.length||(t.$content=t.$slide.wrapInner("<div></div>").children().first()),t.$content.addClass("fancybox-content"),t.$slide.addClass("fancybox-slide--"+t.contentType),this.afterLoad(t))},setError:function(t){t.hasError=!0,t.$slide.trigger("onReset").removeClass("fancybox-slide--"+t.contentType).addClass("fancybox-slide--error"),t.contentType="html",this.setContent(t,this.translate(t,t.opts.errorTpl)),t.pos===this.currPos&&(this.isAnimating=!1)},showLoading:function(t){(t=t||this.current)&&!t.$spinner&&(t.$spinner=h(this.translate(this,this.opts.spinnerTpl)).appendTo(t.$slide).hide().fadeIn("fast"))},hideLoading:function(t){(t=t||this.current)&&t.$spinner&&(t.$spinner.stop().remove(),delete t.$spinner)},afterLoad:function(t){var e=this;e.isClosing||(t.isLoading=!1,t.isLoaded=!0,e.trigger("afterLoad",t),e.hideLoading(t),!t.opts.smallBtn||t.$smallBtn&&t.$smallBtn.length||(t.$smallBtn=h(e.translate(t,t.opts.btnTpl.smallBtn)).appendTo(t.$content)),t.opts.protect&&t.$content&&!t.hasError&&(t.$content.on("contextmenu.fb",function(t){return 2==t.button&&t.preventDefault(),!0}),"image"===t.type&&h('<div class="fancybox-spaceball"></div>').appendTo(t.$content)),e.adjustCaption(t),e.adjustLayout(t),t.pos===e.currPos&&e.updateCursor(),e.revealContent(t))},adjustCaption:function(t){var e=this,n=t||e.current,o=n.opts.caption,i=n.opts.preventCaptionOverlap,a=e.$refs.caption,t=!1;a.toggleClass("fancybox-caption--separate",i),i&&o&&o.length&&(n.pos!==e.currPos?((a=a.clone().appendTo(a.parent())).children().eq(0).empty().html(o),t=a.outerHeight(!0),a.empty().remove()):e.$caption&&(t=e.$caption.outerHeight(!0)),n.$slide.css("padding-bottom",t||""))},adjustLayout:function(t){var e,n,o,i=t||this.current;i.isLoaded&&!0!==i.opts.disableLayoutFix&&(i.$content.css("margin-bottom",""),i.$content.outerHeight()>i.$slide.height()+.5&&(n=i.$slide[0].style["padding-bottom"],o=i.$slide.css("padding-bottom"),0<parseFloat(o)&&(t=i.$slide[0].scrollHeight,i.$slide.css("padding-bottom",0),Math.abs(t-i.$slide[0].scrollHeight)<1&&(e=o),i.$slide.css("padding-bottom",n))),i.$content.css("margin-bottom",e))},revealContent:function(t){var e,n,o,i,a=this,s=t.$slide,r=!1,c=!1,l=a.isMoved(t),d=t.isRevealed;return t.isRevealed=!0,e=t.opts[a.firstRun?"animationEffect":"transitionEffect"],o=t.opts[a.firstRun?"animationDuration":"transitionDuration"],o=parseInt(void 0===t.forcedDuration?o:t.forcedDuration,10),"zoom"===(e=l||t.pos!==a.currPos||!o?!1:e)&&(t.pos===a.currPos&&o&&"image"===t.type&&!t.hasError&&(c=a.getThumbPos(t))?r=a.getFitPos(t):e="fade"),"zoom"===e?(a.isAnimating=!0,r.scaleX=r.width/c.width,r.scaleY=r.height/c.height,(i="auto"==(i=t.opts.zoomOpacity)?.1<Math.abs(t.width/t.height-c.width/c.height):i)&&(c.opacity=.1,r.opacity=1),h.fancybox.setTranslate(t.$content.removeClass("fancybox-is-hidden"),c),f(t.$content),void h.fancybox.animate(t.$content,r,o,function(){a.isAnimating=!1,a.complete()})):(a.updateSlide(t),e?(h.fancybox.stop(s),n="fancybox-slide--"+(t.pos>=a.prevPos?"next":"previous")+" fancybox-animated fancybox-fx-"+e,s.addClass(n).removeClass("fancybox-slide--current"),t.$content.removeClass("fancybox-is-hidden"),f(s),"image"!==t.type&&t.$content.hide().show(0),void h.fancybox.animate(s,"fancybox-slide--current",o,function(){s.removeClass(n).css({transform:"",opacity:""}),t.pos===a.currPos&&a.complete()},!0)):(t.$content.removeClass("fancybox-is-hidden"),d||!l||"image"!==t.type||t.hasError||t.$content.hide().fadeIn("fast"),void(t.pos===a.currPos&&a.complete())))},getThumbPos:function(t){var e,n,o,i,a=t.$thumb;return!(!a||(!(o=a[0])||o.ownerDocument!==s||(h(".fancybox-container").css("pointer-events","none"),i={x:o.getBoundingClientRect().left+o.offsetWidth/2,y:o.getBoundingClientRect().top+o.offsetHeight/2},o=s.elementFromPoint(i.x,i.y)===o,h(".fancybox-container").css("pointer-events",""),!o)))&&(e=h.fancybox.getTranslate(a),t=parseFloat(a.css("border-top-width")||0),i=parseFloat(a.css("border-right-width")||0),o=parseFloat(a.css("border-bottom-width")||0),a=parseFloat(a.css("border-left-width")||0),n={top:e.top+t,left:e.left+a,width:e.width-i-a,height:e.height-t-o,scaleX:1,scaleY:1},0<e.width&&0<e.height&&n)},complete:function(){var t,n=this,e=n.current,o={};!n.isMoved()&&e.isLoaded&&(e.isComplete||(e.isComplete=!0,e.$slide.siblings().trigger("onReset"),n.preload("inline"),f(e.$slide),e.$slide.addClass("fancybox-slide--complete"),h.each(n.slides,function(t,e){e.pos>=n.currPos-1&&e.pos<=n.currPos+1?o[e.pos]=e:e&&(h.fancybox.stop(e.$slide),e.$slide.off().remove())}),n.slides=o),n.isAnimating=!1,n.updateCursor(),n.trigger("afterShow"),e.opts.video.autoStart&&e.$slide.find("video,audio").filter(":visible:first").trigger("play").one("ended",function(){this.webkitExitFullscreen&&this.webkitExitFullscreen(),n.next()}),e.opts.autoFocus&&"html"===e.contentType&&((t=e.$content.find("input[autofocus]:enabled:visible:first")).length?t.trigger("focus"):n.focus(null,!0)),e.$slide.scrollTop(0).scrollLeft(0))},preload:function(t){var e,n,o=this;o.group.length<2||(n=o.slides[o.currPos+1],(e=o.slides[o.currPos-1])&&e.type===t&&o.loadSlide(e),n&&n.type===t&&o.loadSlide(n))},focus:function(t,e){var n=this,o=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","video","audio","[contenteditable]",'[tabindex]:not([tabindex^="-"])'].join(",");n.isClosing||((e=(e=!t&&n.current&&n.current.isComplete?n.current.$slide.find("*:visible"+(e?":not(.fancybox-close-small)":"")):n.$refs.container.find("*:visible")).filter(o).filter(function(){return"hidden"!==h(this).css("visibility")&&!h(this).hasClass("disabled")})).length?(o=e.index(s.activeElement),t&&t.shiftKey?(o<0||0==o)&&(t.preventDefault(),e.eq(e.length-1).trigger("focus")):(o<0||o==e.length-1)&&(t&&t.preventDefault(),e.eq(0).trigger("focus"))):n.$refs.container.trigger("focus"))},activate:function(){var e=this;h(".fancybox-container").each(function(){var t=h(this).data("FancyBox");t&&t.id!==e.id&&!t.isClosing&&(t.trigger("onDeactivate"),t.removeEvents(),t.isVisible=!1)}),e.isVisible=!0,(e.current||e.isIdle)&&(e.update(),e.updateControls()),e.trigger("onActivate"),e.addEvents()},close:function(t,e){function n(){c.cleanUp(t)}var o,i,a,s,r,c=this,l=c.current;return!c.isClosing&&(!(c.isClosing=!0)===c.trigger("beforeClose",t)?(c.isClosing=!1,d(function(){c.update()}),!1):(c.removeEvents(),a=l.$content,o=l.opts.animationEffect,i=h.isNumeric(e)?e:o?l.opts.animationDuration:0,l.$slide.removeClass("fancybox-slide--complete fancybox-slide--next fancybox-slide--previous fancybox-animated"),!0!==t?h.fancybox.stop(l.$slide):o=!1,l.$slide.siblings().trigger("onReset").remove(),i&&c.$refs.container.removeClass("fancybox-is-open").addClass("fancybox-is-closing").css("transition-duration",i+"ms"),c.hideLoading(l),c.hideControls(!0),c.updateCursor(),"zoom"===(o=!("zoom"!==o||a&&i&&"image"===l.type&&!c.isMoved()&&!l.hasError&&(r=c.getThumbPos(l)))?"fade":o)?(h.fancybox.stop(a),e={top:(s=h.fancybox.getTranslate(a)).top,left:s.left,scaleX:s.width/r.width,scaleY:s.height/r.height,width:r.width,height:r.height},(s="auto"==(s=l.opts.zoomOpacity)?.1<Math.abs(l.width/l.height-r.width/r.height):s)&&(r.opacity=0),h.fancybox.setTranslate(a,e),f(a),h.fancybox.animate(a,r,i,n)):o&&i?h.fancybox.animate(l.$slide.addClass("fancybox-slide--previous").removeClass("fancybox-slide--current"),"fancybox-animated fancybox-fx-"+o,i,n):!0===t?setTimeout(n,i):n(),!0))},cleanUp:function(t){var e,n=this,o=n.current.opts.$orig;n.current.$slide.trigger("onReset"),n.$refs.container.empty().remove(),n.trigger("afterClose",t),!n.current.opts.backFocus||(o=!(o&&o.length&&o.is(":visible"))?n.$trigger:o)&&o.length&&(e=c.scrollX,t=c.scrollY,o.trigger("focus"),h("html, body").scrollTop(t).scrollLeft(e)),n.current=null,(n=h.fancybox.getInstance())?n.activate():(h("body").removeClass("fancybox-active compensate-for-scrollbar"),h("#fancybox-style-noscroll").remove())},trigger:function(t,e){var n,o=Array.prototype.slice.call(arguments,1),i=this,e=e&&e.opts?e:i.current;if(e?o.unshift(e):e=i,o.unshift(i),!1===(n=h.isFunction(e.opts[t])?e.opts[t].apply(e,o):n))return n;("afterClose"!==t&&i.$refs?i.$refs.container:a).trigger(t+".fb",o)},updateControls:function(){var t=this,e=t.current,n=e.index,o=t.$refs.container,i=t.$refs.caption,a=e.opts.caption;e.$slide.trigger("refresh"),a&&a.length?(t.$caption=i).children().eq(0).html(a):t.$caption=null,t.hasHiddenControls||t.isIdle||t.showControls(),o.find("[data-fancybox-count]").html(t.group.length),o.find("[data-fancybox-index]").html(n+1),o.find("[data-fancybox-prev]").prop("disabled",!e.opts.loop&&n<=0),o.find("[data-fancybox-next]").prop("disabled",!e.opts.loop&&n>=t.group.length-1),"image"===e.type?o.find("[data-fancybox-zoom]").show().end().find("[data-fancybox-download]").attr("href",e.opts.image.src||e.src).show():e.opts.toolbar&&o.find("[data-fancybox-download],[data-fancybox-zoom]").hide(),h(s.activeElement).is(":hidden,[disabled]")&&t.$refs.container.trigger("focus")},hideControls:function(t){var e=["infobar","toolbar","nav"];!t&&this.current.opts.preventCaptionOverlap||e.push("caption"),this.$refs.container.removeClass(e.map(function(t){return"fancybox-show-"+t}).join(" ")),this.hasHiddenControls=!0},showControls:function(){var t=this,e=(t.current||t).opts,n=t.$refs.container;t.hasHiddenControls=!1,t.idleSecondsCounter=0,n.toggleClass("fancybox-show-toolbar",!(!e.toolbar||!e.buttons)).toggleClass("fancybox-show-infobar",!!(e.infobar&&1<t.group.length)).toggleClass("fancybox-show-caption",!!t.$caption).toggleClass("fancybox-show-nav",!!(e.arrows&&1<t.group.length)).toggleClass("fancybox-is-modal",!!e.modal)},toggleControls:function(){this.hasHiddenControls?this.showControls():this.hideControls()}}),h.fancybox={version:"3.5.6",defaults:t,getInstance:function(t){var e=h('.fancybox-container:not(".fancybox-is-closing"):last').data("FancyBox"),n=Array.prototype.slice.call(arguments,1);return e instanceof o&&("string"===h.type(t)?e[t].apply(e,n):"function"===h.type(t)&&t.apply(e,n),e)},open:function(t,e,n){return new o(t,e,n)},close:function(t){var e=this.getInstance();e&&(e.close(),!0===t&&this.close(t))},destroy:function(){this.close(!0),a.add("body").off("click.fb-start","**")},isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),use3d:(t=s.createElement("div"),c.getComputedStyle&&c.getComputedStyle(t)&&c.getComputedStyle(t).getPropertyValue("transform")&&!(s.documentMode&&s.documentMode<11)),getTranslate:function(t){var e;return!(!t||!t.length)&&{top:(e=t[0].getBoundingClientRect()).top||0,left:e.left||0,width:e.width,height:e.height,opacity:parseFloat(t.css("opacity"))}},setTranslate:function(t,e){var n="",o={};if(t&&e)return void 0===e.left&&void 0===e.top||(n=(void 0===e.left?t.position():e).left+"px, "+(void 0===e.top?t.position():e).top+"px",n=this.use3d?"translate3d("+n+", 0px)":"translate("+n+")"),void 0!==e.scaleX&&void 0!==e.scaleY?n+=" scale("+e.scaleX+", "+e.scaleY+")":void 0!==e.scaleX&&(n+=" scaleX("+e.scaleX+")"),n.length&&(o.transform=n),void 0!==e.opacity&&(o.opacity=e.opacity),void 0!==e.width&&(o.width=e.width),void 0!==e.height&&(o.height=e.height),t.css(o)},animate:function(e,n,o,i,a){var s,r=this;h.isFunction(o)&&(i=o,o=null),r.stop(e),s=r.getTranslate(e),e.on(l,function(t){t&&t.originalEvent&&(!e.is(t.originalEvent.target)||"z-index"==t.originalEvent.propertyName)||(r.stop(e),h.isNumeric(o)&&e.css("transition-duration",""),h.isPlainObject(n)?void 0!==n.scaleX&&void 0!==n.scaleY&&r.setTranslate(e,{top:n.top,left:n.left,width:s.width*n.scaleX,height:s.height*n.scaleY,scaleX:1,scaleY:1}):!0!==a&&e.removeClass(n),h.isFunction(i)&&i(t))}),h.isNumeric(o)&&e.css("transition-duration",o+"ms"),h.isPlainObject(n)?(void 0!==n.scaleX&&void 0!==n.scaleY&&(delete n.width,delete n.height,e.parent().hasClass("fancybox-slide--image")&&e.parent().addClass("fancybox-is-scaling")),h.fancybox.setTranslate(e,n)):e.addClass(n),e.data("timer",setTimeout(function(){e.trigger(l)},o+33))},stop:function(t,e){t&&t.length&&(clearTimeout(t.data("timer")),e&&t.trigger(l),t.off(l).css("transition-duration",""),t.parent().removeClass("fancybox-is-scaling"))}},h.fn.fancybox=function(t){var e;return(e=(t=t||{}).selector||!1)?h("body").off("click.fb-start",e).on("click.fb-start",e,{options:t},n):this.off("click.fb-start").on("click.fb-start",{items:this,options:t},n),this},a.on("click.fb-start","[data-fancybox]",n),a.on("click.fb-start","[data-fancybox-trigger]",function(t){h('[data-fancybox="'+h(this).attr("data-fancybox-trigger")+'"]').eq(h(this).attr("data-fancybox-index")||0).trigger("click.fb-start",{$trigger:h(this)})}),p=null,a.on("mousedown mouseup focus blur",".fancybox-button",function(t){switch(t.type){case"mousedown":p=h(this);break;case"mouseup":p=null;break;case"focusin":h(".fancybox-button").removeClass("fancybox-focus"),h(this).is(p)||h(this).is("[disabled]")||h(this).addClass("fancybox-focus");break;case"focusout":h(".fancybox-button").removeClass("fancybox-focus")}})}var p}(window,document,jQuery),function(p){"use strict";function h(n,t,e){if(n)return"object"===p.type(e=e||"")&&(e=p.param(e,!0)),p.each(t,function(t,e){n=n.replace("$"+t,e||"")}),e.length&&(n+=(0<n.indexOf("?")?"&":"?")+e),n}var o={youtube:{matcher:/(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(watch\?(.*&)?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*))(.*)/i,params:{autoplay:1,autohide:1,fs:1,rel:0,hd:1,wmode:"transparent",enablejsapi:1,html5:1},paramPlace:8,type:"iframe",url:"https://www.youtube-nocookie.com/embed/$4",thumb:"https://img.youtube.com/vi/$4/hqdefault.jpg"},vimeo:{matcher:/^.+vimeo.com\/(.*\/)?([\d]+)(.*)?/,params:{autoplay:1,hd:1,show_title:1,show_byline:1,show_portrait:0,fullscreen:1},paramPlace:3,type:"iframe",url:"//player.vimeo.com/video/$2"},instagram:{matcher:/(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,type:"image",url:"//$1/p/$2/media/?size=l"},gmap_place:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(((maps\/(place\/(.*)\/)?\@(.*),(\d+.?\d+?)z))|(\?ll=))(.*)?/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/?ll="+(t[9]?t[9]+"&z="+Math.floor(t[10])+(t[12]?t[12].replace(/^\//,"&"):""):t[12]+"").replace(/\?/,"&")+"&output="+(t[12]&&0<t[12].indexOf("layer=c")?"svembed":"embed")}},gmap_search:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(maps\/search\/)(.*)/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/maps?q="+t[5].replace("query=","q=").replace("api=1","")+"&output=embed"}}};p(document).on("objectNeedsType.fb",function(t,e,i){var a,s,r,c,l,d,u=i.src||"",f=!1,n=p.extend(!0,{},o,i.opts.media);p.each(n,function(t,e){if(s=u.match(e.matcher)){if(f=e.type,d=t,l={},e.paramPlace&&s[e.paramPlace]){c=(c="?"==(c=s[e.paramPlace])[0]?c.substring(1):c).split("&");for(var n=0;n<c.length;++n){var o=c[n].split("=",2);2==o.length&&(l[o[0]]=decodeURIComponent(o[1].replace(/\+/g," ")))}}return r=p.extend(!0,{},e.params,i.opts[t],l),u="function"===p.type(e.url)?e.url.call(this,s,r,i):h(e.url,s,r),a="function"===p.type(e.thumb)?e.thumb.call(this,s,r,i):h(e.thumb,s),"youtube"===t?u=u.replace(/&t=((\d+)m)?(\d+)s/,function(t,e,n,o){return"&start="+((n?60*parseInt(n,10):0)+parseInt(o,10))}):"vimeo"===t&&(u=u.replace("&%23","#")),!1}}),f?(i.opts.thumb||i.opts.$thumb&&i.opts.$thumb.length||(i.opts.thumb=a),"iframe"===f&&(i.opts=p.extend(!0,i.opts,{iframe:{preload:!1,attr:{scrolling:"no"}}})),p.extend(i,{type:f,src:u,origSrc:i.src,contentSource:d,contentType:"image"===f?"image":"gmap_place"==d||"gmap_search"==d?"map":"video"})):u&&(i.type=i.opts.defaultType)});var i={youtube:{src:"https://www.youtube.com/iframe_api",class:"YT",loading:!1,loaded:!1},vimeo:{src:"https://player.vimeo.com/api/player.js",class:"Vimeo",loading:!1,loaded:!1},load:function(t){var e,n=this;this[t].loaded?setTimeout(function(){n.done(t)}):this[t].loading||(this[t].loading=!0,(e=document.createElement("script")).type="text/javascript",e.src=this[t].src,"youtube"===t?window.onYouTubeIframeAPIReady=function(){n[t].loaded=!0,n.done(t)}:e.onload=function(){n[t].loaded=!0,n.done(t)},document.body.appendChild(e))},done:function(t){var e,n;"youtube"===t&&delete window.onYouTubeIframeAPIReady,(e=p.fancybox.getInstance())&&(n=e.current.$content.find("iframe"),"youtube"===t&&void 0!==YT&&YT?new YT.Player(n.attr("id"),{events:{onStateChange:function(t){0==t.data&&e.next()}}}):"vimeo"===t&&void 0!==Vimeo&&Vimeo&&new Vimeo.Player(n).on("ended",function(){e.next()}))}};p(document).on({"afterShow.fb":function(t,e,n){1<e.group.length&&("youtube"===n.contentSource||"vimeo"===n.contentSource)&&i.load(n.contentSource)}})}(jQuery),function(d,c,u){"use strict";function f(t){var e,n=[];for(e in t=(t=t.originalEvent||t||d.e).touches&&t.touches.length?t.touches:t.changedTouches&&t.changedTouches.length?t.changedTouches:[t])t[e].pageX?n.push({x:t[e].pageX,y:t[e].pageY}):t[e].clientX&&n.push({x:t[e].clientX,y:t[e].clientY});return n}function p(t,e,n){return e&&t?"x"===n?t.x-e.x:"y"===n?t.y-e.y:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)):0}function l(t){if(t.is('a,area,button,[role="button"],input,label,select,summary,textarea,video,audio,iframe')||u.isFunction(t.get(0).onclick)||t.data("selectable"))return 1;for(var e=0,n=t[0].attributes,o=n.length;e<o;e++)if("data-fancybox-"===n[e].nodeName.substr(0,14))return 1}function h(t){for(var e,n,o,i=!1;(e=t.get(0),n=o=n=void 0,n=d.getComputedStyle(e)["overflow-y"],o=d.getComputedStyle(e)["overflow-x"],n=("scroll"===n||"auto"===n)&&e.scrollHeight>e.clientHeight,e=("scroll"===o||"auto"===o)&&e.scrollWidth>e.clientWidth,!(i=n||e))&&((t=t.parent()).length&&!t.hasClass("fancybox-stage")&&!t.is("body")););return i}function n(t){var e=this;e.instance=t,e.$bg=t.$refs.bg,e.$stage=t.$refs.stage,e.$container=t.$refs.container,e.destroy(),e.$container.on("touchstart.fb.touch mousedown.fb.touch",u.proxy(e,"ontouchstart"))}var g=d.requestAnimationFrame||d.webkitRequestAnimationFrame||d.mozRequestAnimationFrame||d.oRequestAnimationFrame||function(t){return d.setTimeout(t,1e3/60)},b=d.cancelAnimationFrame||d.webkitCancelAnimationFrame||d.mozCancelAnimationFrame||d.oCancelAnimationFrame||function(t){d.clearTimeout(t)};n.prototype.destroy=function(){var t=this;t.$container.off(".fb.touch"),u(c).off(".fb.touch"),t.requestId&&(b(t.requestId),t.requestId=null),t.tapped&&(clearTimeout(t.tapped),t.tapped=null)},n.prototype.ontouchstart=function(t){var e=this,n=u(t.target),o=e.instance,i=o.current,a=i.$slide,s=i.$content,r="touchstart"==t.type;if(r&&e.$container.off("mousedown.fb.touch"),(!t.originalEvent||2!=t.originalEvent.button)&&a.length&&n.length&&!l(n)&&!l(n.parent())&&(n.is("img")||!(t.originalEvent.clientX>n[0].clientWidth+n.offset().left))){if(!i||o.isAnimating||i.$slide.hasClass("fancybox-animated"))return t.stopPropagation(),void t.preventDefault();e.realPoints=e.startPoints=f(t),e.startPoints.length&&(i.touch&&t.stopPropagation(),e.startEvent=t,e.canTap=!0,e.$target=n,e.$content=s,e.opts=i.opts.touch,e.isPanning=!1,e.isSwiping=!1,e.isZooming=!1,e.isScrolling=!1,e.canPan=o.canPan(),e.startTime=(new Date).getTime(),e.distanceX=e.distanceY=e.distance=0,e.canvasWidth=Math.round(a[0].clientWidth),e.canvasHeight=Math.round(a[0].clientHeight),e.contentLastPos=null,e.contentStartPos=u.fancybox.getTranslate(e.$content)||{top:0,left:0},e.sliderStartPos=u.fancybox.getTranslate(a),e.stagePos=u.fancybox.getTranslate(o.$refs.stage),e.sliderStartPos.top-=e.stagePos.top,e.sliderStartPos.left-=e.stagePos.left,e.contentStartPos.top-=e.stagePos.top,e.contentStartPos.left-=e.stagePos.left,u(c).off(".fb.touch").on(r?"touchend.fb.touch touchcancel.fb.touch":"mouseup.fb.touch mouseleave.fb.touch",u.proxy(e,"ontouchend")).on(r?"touchmove.fb.touch":"mousemove.fb.touch",u.proxy(e,"ontouchmove")),u.fancybox.isMobile&&c.addEventListener("scroll",e.onscroll,!0),((e.opts||e.canPan)&&(n.is(e.$stage)||e.$stage.find(n).length)||(n.is(".fancybox-image")&&t.preventDefault(),u.fancybox.isMobile&&n.parents(".fancybox-caption").length))&&(e.isScrollable=h(n)||h(n.parent()),u.fancybox.isMobile&&e.isScrollable||t.preventDefault(),1!==e.startPoints.length&&!i.hasError||(e.canPan?(u.fancybox.stop(e.$content),e.isPanning=!0):e.isSwiping=!0,e.$container.addClass("fancybox-is-grabbing")),2===e.startPoints.length&&"image"===i.type&&(i.isLoaded||i.$ghost)&&(e.canTap=!1,e.isSwiping=!1,e.isPanning=!1,e.isZooming=!0,u.fancybox.stop(e.$content),e.centerPointStartX=.5*(e.startPoints[0].x+e.startPoints[1].x)-u(d).scrollLeft(),e.centerPointStartY=.5*(e.startPoints[0].y+e.startPoints[1].y)-u(d).scrollTop(),e.percentageOfImageAtPinchPointX=(e.centerPointStartX-e.contentStartPos.left)/e.contentStartPos.width,e.percentageOfImageAtPinchPointY=(e.centerPointStartY-e.contentStartPos.top)/e.contentStartPos.height,e.startDistanceBetweenFingers=p(e.startPoints[0],e.startPoints[1]))))}},n.prototype.onscroll=function(t){this.isScrolling=!0,c.removeEventListener("scroll",this.onscroll,!0)},n.prototype.ontouchmove=function(t){var e=this;return void 0!==t.originalEvent.buttons&&0===t.originalEvent.buttons?void e.ontouchend(t):e.isScrolling?void(e.canTap=!1):(e.newPoints=f(t),void((e.opts||e.canPan)&&e.newPoints.length&&e.newPoints.length&&(e.isSwiping&&!0===e.isSwiping||t.preventDefault(),e.distanceX=p(e.newPoints[0],e.startPoints[0],"x"),e.distanceY=p(e.newPoints[0],e.startPoints[0],"y"),e.distance=p(e.newPoints[0],e.startPoints[0]),0<e.distance&&(e.isSwiping?e.onSwipe(t):e.isPanning?e.onPan():e.isZooming&&e.onZoom()))))},n.prototype.onSwipe=function(t){var i=this,a=i.instance,e=i.isSwiping,n=i.sliderStartPos.left||0;!0!==e?("x"==e&&(0<i.distanceX&&(i.instance.group.length<2||0===i.instance.current.index&&!i.instance.current.opts.loop)?n+=Math.pow(i.distanceX,.8):i.distanceX<0&&(i.instance.group.length<2||i.instance.current.index===i.instance.group.length-1&&!i.instance.current.opts.loop)?n-=Math.pow(-i.distanceX,.8):n+=i.distanceX),i.sliderLastPos={top:"x"==e?0:i.sliderStartPos.top+i.distanceY,left:n},i.requestId&&(b(i.requestId),i.requestId=null),i.requestId=g(function(){i.sliderLastPos&&(u.each(i.instance.slides,function(t,e){var n=e.pos-i.instance.currPos;u.fancybox.setTranslate(e.$slide,{top:i.sliderLastPos.top,left:i.sliderLastPos.left+n*i.canvasWidth+n*e.opts.gutter})}),i.$container.addClass("fancybox-is-sliding"))})):10<Math.abs(i.distance)&&(i.canTap=!1,a.group.length<2&&i.opts.vertical?i.isSwiping="y":a.isDragging||!1===i.opts.vertical||"auto"===i.opts.vertical&&800<u(d).width()?i.isSwiping="x":(n=Math.abs(180*Math.atan2(i.distanceY,i.distanceX)/Math.PI),i.isSwiping=45<n&&n<135?"y":"x"),"y"===i.isSwiping&&u.fancybox.isMobile&&i.isScrollable?i.isScrolling=!0:(a.isDragging=i.isSwiping,i.startPoints=i.newPoints,u.each(a.slides,function(t,e){var n,o;u.fancybox.stop(e.$slide),n=u.fancybox.getTranslate(e.$slide),o=u.fancybox.getTranslate(a.$refs.stage),e.$slide.css({transform:"",opacity:"","transition-duration":""}).removeClass("fancybox-animated").removeClass(function(t,e){return(e.match(/(^|\s)fancybox-fx-\S+/g)||[]).join(" ")}),e.pos===a.current.pos&&(i.sliderStartPos.top=n.top-o.top,i.sliderStartPos.left=n.left-o.left),u.fancybox.setTranslate(e.$slide,{top:n.top-o.top,left:n.left-o.left})}),a.SlideShow&&a.SlideShow.isActive&&a.SlideShow.stop()))},n.prototype.onPan=function(){var t=this;p(t.newPoints[0],t.realPoints[0])<(u.fancybox.isMobile?10:5)?t.startPoints=t.newPoints:(t.canTap=!1,t.contentLastPos=t.limitMovement(),t.requestId&&b(t.requestId),t.requestId=g(function(){u.fancybox.setTranslate(t.$content,t.contentLastPos)}))},n.prototype.limitMovement=function(){var t=this,e=t.canvasWidth,n=t.canvasHeight,o=t.distanceX,i=t.distanceY,a=t.contentStartPos,s=a.left,r=a.top,c=a.width,l=a.height,d=e<c?s+o:s,u=r+i,t=Math.max(0,.5*e-.5*c),a=Math.max(0,.5*n-.5*l),c=Math.min(e-c,.5*e-.5*c),l=Math.min(n-l,.5*n-.5*l);return 0<o&&t<d&&(d=t-1+Math.pow(-t+s+o,.8)||0),o<0&&d<c&&(d=c+1-Math.pow(c-s-o,.8)||0),0<i&&a<u&&(u=a-1+Math.pow(-a+r+i,.8)||0),{top:u=i<0&&u<l?l+1-Math.pow(l-r-i,.8)||0:u,left:d}},n.prototype.limitPosition=function(t,e,n,o){var i=this.canvasWidth,a=this.canvasHeight;return t=i<n?(t=0<t?0:t)<i-n?i-n:t:Math.max(0,i/2-n/2),{top:e=a<o?(e=0<e?0:e)<a-o?a-o:e:Math.max(0,a/2-o/2),left:t}},n.prototype.onZoom=function(){var t=this,e=t.contentStartPos,n=e.width,o=e.height,i=e.left,a=e.top,s=p(t.newPoints[0],t.newPoints[1])/t.startDistanceBetweenFingers,r=Math.floor(n*s),c=Math.floor(o*s),l=(n-r)*t.percentageOfImageAtPinchPointX,e=(o-c)*t.percentageOfImageAtPinchPointY,n=(t.newPoints[0].x+t.newPoints[1].x)/2-u(d).scrollLeft(),o=(t.newPoints[0].y+t.newPoints[1].y)/2-u(d).scrollTop(),n=n-t.centerPointStartX,s={top:a+(e+(o-t.centerPointStartY)),left:i+(l+n),scaleX:s,scaleY:s};t.canTap=!1,t.newWidth=r,t.newHeight=c,t.contentLastPos=s,t.requestId&&b(t.requestId),t.requestId=g(function(){u.fancybox.setTranslate(t.$content,t.contentLastPos)})},n.prototype.ontouchend=function(t){var e=this,n=e.isSwiping,o=e.isPanning,i=e.isZooming,a=e.isScrolling;if(e.endPoints=f(t),e.dMs=Math.max((new Date).getTime()-e.startTime,1),e.$container.removeClass("fancybox-is-grabbing"),u(c).off(".fb.touch"),c.removeEventListener("scroll",e.onscroll,!0),e.requestId&&(b(e.requestId),e.requestId=null),e.isSwiping=!1,e.isPanning=!1,e.isZooming=!1,e.isScrolling=!1,e.instance.isDragging=!1,e.canTap)return e.onTap(t);e.speed=100,e.velocityX=e.distanceX/e.dMs*.5,e.velocityY=e.distanceY/e.dMs*.5,o?e.endPanning():i?e.endZooming():e.endSwiping(n,a)},n.prototype.endSwiping=function(t,e){var n=this,o=!1,i=n.instance.group.length,a=Math.abs(n.distanceX),a="x"==t&&1<i&&(130<n.dMs&&10<a||50<a);n.sliderLastPos=null,"y"==t&&!e&&50<Math.abs(n.distanceY)?(u.fancybox.animate(n.instance.current.$slide,{top:n.sliderStartPos.top+n.distanceY+150*n.velocityY,opacity:0},200),o=n.instance.close(!0,250)):a&&0<n.distanceX?o=n.instance.previous(300):a&&n.distanceX<0&&(o=n.instance.next(300)),!1!==o||"x"!=t&&"y"!=t||n.instance.centerSlide(200),n.$container.removeClass("fancybox-is-sliding")},n.prototype.endPanning=function(){var t,e,n=this;n.contentLastPos&&(e=!1===n.opts.momentum||350<n.dMs?(t=n.contentLastPos.left,n.contentLastPos.top):(t=n.contentLastPos.left+500*n.velocityX,n.contentLastPos.top+500*n.velocityY),(e=n.limitPosition(t,e,n.contentStartPos.width,n.contentStartPos.height)).width=n.contentStartPos.width,e.height=n.contentStartPos.height,u.fancybox.animate(n.$content,e,366))},n.prototype.endZooming=function(){var t,e,n=this,o=n.instance.current,i=n.newWidth,a=n.newHeight;n.contentLastPos&&(t=n.contentLastPos.left,e=n.contentLastPos.top,u.fancybox.setTranslate(n.$content,{top:e,left:t,width:i,height:a,scaleX:1,scaleY:1}),i<n.canvasWidth&&a<n.canvasHeight?n.instance.scaleToFit(150):i>o.width||a>o.height?n.instance.scaleToActual(n.centerPointStartX,n.centerPointStartY,150):(a=n.limitPosition(t,e,i,a),u.fancybox.animate(n.$content,a,150)))},n.prototype.onTap=function(e){function t(t){if(t=s.opts[t],t=u.isFunction(t)?t.apply(a,[s,e]):t)switch(t){case"close":a.close(o.startEvent);break;case"toggleControls":a.toggleControls();break;case"next":a.next();break;case"nextOrClose":1<a.group.length?a.next():a.close(o.startEvent);break;case"zoom":"image"==s.type&&(s.isLoaded||s.$ghost)&&(a.canPan()?a.scaleToFit():a.isScaledDown()?a.scaleToActual(c,l):a.group.length<2&&a.close(o.startEvent))}}var n,o=this,i=u(e.target),a=o.instance,s=a.current,r=e&&f(e)||o.startPoints,c=r[0]?r[0].x-u(d).scrollLeft()-o.stagePos.left:0,l=r[0]?r[0].y-u(d).scrollTop()-o.stagePos.top:0;if((!e.originalEvent||2!=e.originalEvent.button)&&(i.is("img")||!(c>i[0].clientWidth+i.offset().left))){if(i.is(".fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-container"))n="Outside";else if(i.is(".fancybox-slide"))n="Slide";else{if(!a.current.$content||!a.current.$content.find(i).addBack().filter(i).length)return;n="Content"}if(o.tapped){if(clearTimeout(o.tapped),o.tapped=null,50<Math.abs(c-o.tapX)||50<Math.abs(l-o.tapY))return this;t("dblclick"+n)}else o.tapX=c,o.tapY=l,s.opts["dblclick"+n]&&s.opts["dblclick"+n]!==s.opts["click"+n]?o.tapped=setTimeout(function(){o.tapped=null,a.isAnimating||t("click"+n)},500):t("click"+n);return this}},u(c).on("onActivate.fb",function(t,e){e&&!e.Guestures&&(e.Guestures=new n(e))}).on("beforeClose.fb",function(t,e){e&&e.Guestures&&e.Guestures.destroy()})}(window,document,jQuery),function(a,s){"use strict";s.extend(!0,s.fancybox.defaults,{btnTpl:{slideShow:'<button data-fancybox-play class="fancybox-button fancybox-button--play" title="{{PLAY_START}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.5 5.4v13.2l11-6.6z"/></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.33 5.75h2.2v12.5h-2.2V5.75zm5.15 0h2.2v12.5h-2.2V5.75z"/></svg></button>'},slideShow:{autoStart:!1,speed:3e3,progress:!0}});function n(t){this.instance=t,this.init()}s.extend(n.prototype,{timer:null,isActive:!1,$button:null,init:function(){var t=this,e=t.instance,n=e.group[e.currIndex].opts.slideShow;t.$button=e.$refs.toolbar.find("[data-fancybox-play]").on("click",function(){t.toggle()}),e.group.length<2||!n?t.$button.hide():n.progress&&(t.$progress=s('<div class="fancybox-progress"></div>').appendTo(e.$refs.inner))},set:function(t){var e=this,n=e.instance,o=n.current;o&&(!0===t||o.opts.loop||n.currIndex<n.group.length-1)?e.isActive&&"video"!==o.contentType&&(e.$progress&&s.fancybox.animate(e.$progress.show(),{scaleX:1},o.opts.slideShow.speed),e.timer=setTimeout(function(){n.current.opts.loop||n.current.index!=n.group.length-1?n.next():n.jumpTo(0)},o.opts.slideShow.speed)):(e.stop(),n.idleSecondsCounter=0,n.showControls())},clear:function(){clearTimeout(this.timer),this.timer=null,this.$progress&&this.$progress.removeAttr("style").hide()},start:function(){var t=this,e=t.instance.current;e&&(t.$button.attr("title",(e.opts.i18n[e.opts.lang]||e.opts.i18n.en).PLAY_STOP).removeClass("fancybox-button--play").addClass("fancybox-button--pause"),t.isActive=!0,e.isComplete&&t.set(!0),t.instance.trigger("onSlideShowChange",!0))},stop:function(){var t=this,e=t.instance.current;t.clear(),t.$button.attr("title",(e.opts.i18n[e.opts.lang]||e.opts.i18n.en).PLAY_START).removeClass("fancybox-button--pause").addClass("fancybox-button--play"),t.isActive=!1,t.instance.trigger("onSlideShowChange",!1),t.$progress&&t.$progress.removeAttr("style").hide()},toggle:function(){this.isActive?this.stop():this.start()}}),s(a).on({"onInit.fb":function(t,e){e&&!e.SlideShow&&(e.SlideShow=new n(e))},"beforeShow.fb":function(t,e,n,o){e=e&&e.SlideShow;o?e&&n.opts.slideShow.autoStart&&e.start():e&&e.isActive&&e.clear()},"afterShow.fb":function(t,e,n){e=e&&e.SlideShow;e&&e.isActive&&e.set()},"afterKeydown.fb":function(t,e,n,o,i){e=e&&e.SlideShow;!e||!n.opts.slideShow||80!==i&&32!==i||s(a.activeElement).is("button,a,input")||(o.preventDefault(),e.toggle())},"beforeClose.fb onDeactivate.fb":function(t,e){e=e&&e.SlideShow;e&&e.stop()}}),s(a).on("visibilitychange",function(){var t=s.fancybox.getInstance(),t=t&&t.SlideShow;t&&t.isActive&&(a.hidden?t.clear():t.set())})}(document,jQuery),function(a,n){"use strict";var o,i=function(){for(var t=[["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"]],e={},n=0;n<t.length;n++){var o=t[n];if(o&&o[1]in a){for(var i=0;i<o.length;i++)e[t[0][i]]=o[i];return e}}return!1}();i&&(o={request:function(t){(t=t||a.documentElement)[i.requestFullscreen](t.ALLOW_KEYBOARD_INPUT)},exit:function(){a[i.exitFullscreen]()},toggle:function(t){t=t||a.documentElement,this.isFullscreen()?this.exit():this.request(t)},isFullscreen:function(){return Boolean(a[i.fullscreenElement])},enabled:function(){return Boolean(a[i.fullscreenEnabled])}},n.extend(!0,n.fancybox.defaults,{btnTpl:{fullScreen:'<button data-fancybox-fullscreen class="fancybox-button fancybox-button--fsenter" title="{{FULL_SCREEN}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z"/></svg></button>'},fullScreen:{autoStart:!1}}),n(a).on(i.fullscreenchange,function(){var t=o.isFullscreen(),e=n.fancybox.getInstance();e&&(e.current&&"image"===e.current.type&&e.isAnimating&&(e.isAnimating=!1,e.update(!0,!0,0),e.isComplete||e.complete()),e.trigger("onFullscreenChange",t),e.$refs.container.toggleClass("fancybox-is-fullscreen",t),e.$refs.toolbar.find("[data-fancybox-fullscreen]").toggleClass("fancybox-button--fsenter",!t).toggleClass("fancybox-button--fsexit",t))})),n(a).on({"onInit.fb":function(t,e){i?e&&e.group[e.currIndex].opts.fullScreen?(e.$refs.container.on("click.fb-fullscreen","[data-fancybox-fullscreen]",function(t){t.stopPropagation(),t.preventDefault(),o.toggle()}),e.opts.fullScreen&&!0===e.opts.fullScreen.autoStart&&o.request(),e.FullScreen=o):e&&e.$refs.toolbar.find("[data-fancybox-fullscreen]").hide():e.$refs.toolbar.find("[data-fancybox-fullscreen]").remove()},"afterKeydown.fb":function(t,e,n,o,i){e&&e.FullScreen&&70===i&&(o.preventDefault(),e.FullScreen.toggle())},"beforeClose.fb":function(t,e){e&&e.FullScreen&&e.$refs.container.hasClass("fancybox-is-fullscreen")&&o.exit()}})}(document,jQuery),function(t,a){"use strict";var s="fancybox-thumbs";a.fancybox.defaults=a.extend(!0,{btnTpl:{thumbs:'<button data-fancybox-thumbs class="fancybox-button fancybox-button--thumbs" title="{{THUMBS}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.59 14.59h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76H5.65V5.65z"/></svg></button>'},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"}},a.fancybox.defaults);function n(t){this.init(t)}a.extend(n.prototype,{$button:null,$grid:null,$list:null,isVisible:!1,isActive:!1,init:function(t){var e=this,n=t.group,o=0;e.instance=t,e.opts=n[t.currIndex].opts.thumbs,(t.Thumbs=e).$button=t.$refs.toolbar.find("[data-fancybox-thumbs]");for(var i=0,a=n.length;i<a&&(n[i].thumb&&o++,!(1<o));i++);1<o&&e.opts?(e.$button.removeAttr("style").on("click",function(){e.toggle()}),e.isActive=!0):e.$button.hide()},create:function(){var n,t=this,e=t.instance,o=t.opts.parentEl,i=[];t.$grid||(t.$grid=a('<div class="'+s+" "+s+"-"+t.opts.axis+'"></div>').appendTo(e.$refs.container.find(o).addBack().filter(o)),t.$grid.on("click","a",function(){e.jumpTo(a(this).attr("data-index"))})),t.$list||(t.$list=a('<div class="'+s+'__list">').appendTo(t.$grid)),a.each(e.group,function(t,e){(n=e.thumb)||"image"!==e.type||(n=e.src),i.push('<a href="javascript:;" tabindex="0" data-index="'+t+'"'+(n&&n.length?' style="background-image:url('+n+')"':'class="fancybox-thumbs-missing"')+"></a>")}),t.$list[0].innerHTML=i.join(""),"x"===t.opts.axis&&t.$list.width(parseInt(t.$grid.css("padding-right"),10)+e.group.length*t.$list.children().eq(0).outerWidth(!0))},focus:function(t){var e,n,o=this,i=o.$list,a=o.$grid;o.instance.current&&(n=(e=i.children().removeClass("fancybox-thumbs-active").filter('[data-index="'+o.instance.current.index+'"]').addClass("fancybox-thumbs-active")).position(),"y"===o.opts.axis&&(n.top<0||n.top>i.height()-e.outerHeight())?i.stop().animate({scrollTop:i.scrollTop()+n.top},t):"x"===o.opts.axis&&(n.left<a.scrollLeft()||n.left>a.scrollLeft()+(a.width()-e.outerWidth()))&&i.parent().stop().animate({scrollLeft:n.left},t))},update:function(){var t=this;t.instance.$refs.container.toggleClass("fancybox-show-thumbs",this.isVisible),t.isVisible?(t.$grid||t.create(),t.instance.trigger("onThumbsShow"),t.focus(0)):t.$grid&&t.instance.trigger("onThumbsHide"),t.instance.update()},hide:function(){this.isVisible=!1,this.update()},show:function(){this.isVisible=!0,this.update()},toggle:function(){this.isVisible=!this.isVisible,this.update()}}),a(t).on({"onInit.fb":function(t,e){!e||e.Thumbs||(e=new n(e)).isActive&&!0===e.opts.autoStart&&e.show()},"beforeShow.fb":function(t,e,n,o){e=e&&e.Thumbs;e&&e.isVisible&&e.focus(o?0:250)},"afterKeydown.fb":function(t,e,n,o,i){e=e&&e.Thumbs;e&&e.isActive&&71===i&&(o.preventDefault(),e.toggle())},"beforeClose.fb":function(t,e){e=e&&e.Thumbs;e&&e.isVisible&&!1!==e.opts.hideOnClose&&e.$grid.hide()}})}(document,jQuery),function(t,i){"use strict";i.extend(!0,i.fancybox.defaults,{btnTpl:{share:'<button data-fancybox-share class="fancybox-button fancybox-button--share" title="{{SHARE}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2.55 19c1.4-8.4 9.1-9.8 11.9-9.8V5l7 7-7 6.3v-3.5c-2.8 0-10.5 2.1-11.9 4.2z"/></svg></button>'},share:{url:function(t,e){return!t.currentHash&&"inline"!==e.type&&"html"!==e.type&&(e.origSrc||e.src)||window.location},tpl:'<div class="fancybox-share"><h1>{{SHARE}}</h1><p><a class="fancybox-share__button fancybox-share__button--fb" href="https://www.facebook.com/sharer/sharer.php?u={{url}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m287 456v-299c0-21 6-35 35-35h38v-63c-7-1-29-3-55-3-54 0-91 33-91 94v306m143-254h-205v72h196" /></svg><span>Facebook</span></a><a class="fancybox-share__button fancybox-share__button--tw" href="https://twitter.com/intent/tweet?url={{url}}&text={{descr}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m456 133c-14 7-31 11-47 13 17-10 30-27 37-46-15 10-34 16-52 20-61-62-157-7-141 75-68-3-129-35-169-85-22 37-11 86 26 109-13 0-26-4-37-9 0 39 28 72 65 80-12 3-25 4-37 2 10 33 41 57 77 57-42 30-77 38-122 34 170 111 378-32 359-208 16-11 30-25 41-42z" /></svg><span>Twitter</span></a><a class="fancybox-share__button fancybox-share__button--pt" href="https://www.pinterest.com/pin/create/button/?url={{url}}&description={{descr}}&media={{media}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m265 56c-109 0-164 78-164 144 0 39 15 74 47 87 5 2 10 0 12-5l4-19c2-6 1-8-3-13-9-11-15-25-15-45 0-58 43-110 113-110 62 0 96 38 96 88 0 67-30 122-73 122-24 0-42-19-36-44 6-29 20-60 20-81 0-19-10-35-31-35-25 0-44 26-44 60 0 21 7 36 7 36l-30 125c-8 37-1 83 0 87 0 3 4 4 5 2 2-3 32-39 42-75l16-64c8 16 31 29 56 29 74 0 124-67 124-157 0-69-58-132-146-132z" fill="#fff"/></svg><span>Pinterest</span></a></p><p><input class="fancybox-share__input" type="text" value="{{url_raw}}" onclick="select()" /></p></div>'}}),i(t).on("click","[data-fancybox-share]",function(){var t,e,n=i.fancybox.getInstance(),o=n.current||null;o&&("function"===i.type(o.opts.share.url)&&(t=o.opts.share.url.apply(o,[n,o])),t=o.opts.share.tpl.replace(/\{\{media\}\}/g,"image"===o.type?encodeURIComponent(o.src):"").replace(/\{\{url\}\}/g,encodeURIComponent(t)).replace(/\{\{url_raw\}\}/g,(e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"},String(t).replace(/[&<>"'`=\/]/g,function(t){return e[t]}))).replace(/\{\{descr\}\}/g,n.$caption?encodeURIComponent(n.$caption.text()):""),i.fancybox.open({src:n.translate(n,t),type:"html",opts:{touch:!1,animationEffect:!1,afterLoad:function(t,e){n.$refs.container.one("beforeClose.fb",function(){t.close(null,0)}),e.$content.find(".fancybox-share__button").click(function(){return window.open(this.href,"Share","width=550, height=450"),!1})},mobile:{autoFocus:!1}}}))})}(document,jQuery),function(a,s,o){"use strict";function i(){var t=a.location.hash.substr(1),e=t.split("-"),n=1<e.length&&/^\+?\d+$/.test(e[e.length-1])&&parseInt(e.pop(-1),10)||1;return{hash:t,index:n<1?1:n,gallery:e.join("-")}}function e(t){""!==t.gallery&&o("[data-fancybox='"+o.escapeSelector(t.gallery)+"']").eq(t.index-1).focus().trigger("click.fb-start")}function r(t){return!!t&&(""!==(t=(t=(t.current||t).opts).hash||(t.$orig?t.$orig.data("fancybox")||t.$orig.data("fancybox-trigger"):""))&&t)}o.escapeSelector||(o.escapeSelector=function(t){return(t+"").replace(/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t})}),o(function(){!1!==o.fancybox.defaults.hash&&(o(s).on({"onInit.fb":function(t,e){var n,o;!1!==e.group[e.currIndex].opts.hash&&(n=i(),(o=r(e))&&n.gallery&&o==n.gallery&&(e.currIndex=n.index-1))},"beforeShow.fb":function(t,e,n,o){var i;n&&!1!==n.opts.hash&&(i=r(e))&&(e.currentHash=i+(1<e.group.length?"-"+(n.index+1):""),a.location.hash!=="#"+e.currentHash&&(o&&!e.origHash&&(e.origHash=a.location.hash),e.hashTimer&&clearTimeout(e.hashTimer),e.hashTimer=setTimeout(function(){"replaceState"in a.history?(a.history[o?"pushState":"replaceState"]({},s.title,a.location.pathname+a.location.search+"#"+e.currentHash),o&&(e.hasCreatedHistory=!0)):a.location.hash=e.currentHash,e.hashTimer=null},300)))},"beforeClose.fb":function(t,e,n){n&&!1!==n.opts.hash&&(clearTimeout(e.hashTimer),e.currentHash&&e.hasCreatedHistory?a.history.back():e.currentHash&&("replaceState"in a.history?a.history.replaceState({},s.title,a.location.pathname+a.location.search+(e.origHash||"")):a.location.hash=e.origHash),e.currentHash=null)}}),o(a).on("hashchange.fb",function(){var t=i(),n=null;o.each(o(".fancybox-container").get().reverse(),function(t,e){e=o(e).data("FancyBox");if(e&&e.currentHash)return n=e,!1}),n?n.currentHash===t.gallery+"-"+t.index||1===t.index&&n.currentHash==t.gallery||(n.currentHash=null,n.close()):""!==t.gallery&&e(t)}),setTimeout(function(){o.fancybox.getInstance()||e(i())},50))})}(window,document,jQuery),function(t,e){"use strict";var i=(new Date).getTime();e(t).on({"onInit.fb":function(t,o,e){o.$refs.stage.on("mousewheel DOMMouseScroll wheel MozMousePixelScroll",function(t){var e=o.current,n=(new Date).getTime();o.group.length<2||!1===e.opts.wheel||"auto"===e.opts.wheel&&"image"!==e.type||(t.preventDefault(),t.stopPropagation(),e.$slide.hasClass("fancybox-animated")||(t=t.originalEvent||t,n-i<250||(i=n,o[(-t.deltaY||-t.deltaX||t.wheelDelta||-t.detail)<0?"next":"previous"]())))})}})}(document,jQuery);
jQuery.easing.jswing=jQuery.easing.swing,jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(n,t,e,u,a){return jQuery.easing[jQuery.easing.def](n,t,e,u,a)},easeInQuad:function(n,t,e,u,a){return u*(t/=a)*t+e},easeOutQuad:function(n,t,e,u,a){return-u*(t/=a)*(t-2)+e},easeInOutQuad:function(n,t,e,u,a){return(t/=a/2)<1?u/2*t*t+e:-u/2*(--t*(t-2)-1)+e},easeInCubic:function(n,t,e,u,a){return u*(t/=a)*t*t+e},easeOutCubic:function(n,t,e,u,a){return u*((t=t/a-1)*t*t+1)+e},easeInOutCubic:function(n,t,e,u,a){return(t/=a/2)<1?u/2*t*t*t+e:u/2*((t-=2)*t*t+2)+e},easeInQuart:function(n,t,e,u,a){return u*(t/=a)*t*t*t+e},easeOutQuart:function(n,t,e,u,a){return-u*((t=t/a-1)*t*t*t-1)+e},easeInOutQuart:function(n,t,e,u,a){return(t/=a/2)<1?u/2*t*t*t*t+e:-u/2*((t-=2)*t*t*t-2)+e},easeInQuint:function(n,t,e,u,a){return u*(t/=a)*t*t*t*t+e},easeOutQuint:function(n,t,e,u,a){return u*((t=t/a-1)*t*t*t*t+1)+e},easeInOutQuint:function(n,t,e,u,a){return(t/=a/2)<1?u/2*t*t*t*t*t+e:u/2*((t-=2)*t*t*t*t+2)+e},easeInSine:function(n,t,e,u,a){return-u*Math.cos(t/a*(Math.PI/2))+u+e},easeOutSine:function(n,t,e,u,a){return u*Math.sin(t/a*(Math.PI/2))+e},easeInOutSine:function(n,t,e,u,a){return-u/2*(Math.cos(Math.PI*t/a)-1)+e},easeInExpo:function(n,t,e,u,a){return 0==t?e:u*Math.pow(2,10*(t/a-1))+e},easeOutExpo:function(n,t,e,u,a){return t==a?e+u:u*(1-Math.pow(2,-10*t/a))+e},easeInOutExpo:function(n,t,e,u,a){return 0==t?e:t==a?e+u:(t/=a/2)<1?u/2*Math.pow(2,10*(t-1))+e:u/2*(2-Math.pow(2,-10*--t))+e},easeInCirc:function(n,t,e,u,a){return-u*(Math.sqrt(1-(t/=a)*t)-1)+e},easeOutCirc:function(n,t,e,u,a){return u*Math.sqrt(1-(t=t/a-1)*t)+e},easeInOutCirc:function(n,t,e,u,a){return(t/=a/2)<1?-u/2*(Math.sqrt(1-t*t)-1)+e:u/2*(Math.sqrt(1-(t-=2)*t)+1)+e},easeInElastic:function(n,t,e,u,a){var r=1.70158,i=0,s=u;return 0==t?e:1==(t/=a)?e+u:(i=i||.3*a,r=s<Math.abs(u)?(s=u,i/4):i/(2*Math.PI)*Math.asin(u/s),-(s*Math.pow(2,10*--t)*Math.sin(2*(t*a-r)*Math.PI/i))+e)},easeOutElastic:function(n,t,e,u,a){var r=1.70158,i=0,s=u;return 0==t?e:1==(t/=a)?e+u:(i=i||.3*a,r=s<Math.abs(u)?(s=u,i/4):i/(2*Math.PI)*Math.asin(u/s),s*Math.pow(2,-10*t)*Math.sin(2*(t*a-r)*Math.PI/i)+u+e)},easeInOutElastic:function(n,t,e,u,a){var r=1.70158,i=0,s=u;return 0==t?e:2==(t/=a/2)?e+u:(i=i||.3*a*1.5,r=s<Math.abs(u)?(s=u,i/4):i/(2*Math.PI)*Math.asin(u/s),t<1?-.5*s*Math.pow(2,10*--t)*Math.sin(2*(t*a-r)*Math.PI/i)+e:s*Math.pow(2,-10*--t)*Math.sin(2*(t*a-r)*Math.PI/i)*.5+u+e)},easeInBack:function(n,t,e,u,a,r){return u*(t/=a)*t*(((r=null==r?1.70158:r)+1)*t-r)+e},easeOutBack:function(n,t,e,u,a,r){return u*((t=t/a-1)*t*(((r=null==r?1.70158:r)+1)*t+r)+1)+e},easeInOutBack:function(n,t,e,u,a,r){return null==r&&(r=1.70158),(t/=a/2)<1?u/2*t*t*((1+(r*=1.525))*t-r)+e:u/2*((t-=2)*t*((1+(r*=1.525))*t+r)+2)+e},easeInBounce:function(n,t,e,u,a){return u-jQuery.easing.easeOutBounce(n,a-t,0,u,a)+e},easeOutBounce:function(n,t,e,u,a){return(t/=a)<1/2.75?7.5625*u*t*t+e:t<2/2.75?u*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?u*(7.5625*(t-=2.25/2.75)*t+.9375)+e:u*(7.5625*(t-=2.625/2.75)*t+.984375)+e},easeInOutBounce:function(n,t,e,u,a){return t<a/2?.5*jQuery.easing.easeInBounce(n,2*t,0,u,a)+e:.5*jQuery.easing.easeOutBounce(n,2*t-a,0,u,a)+.5*u+e}});
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(r){"use strict";function i(e){return!e.nodeName||-1!==r.inArray(e.nodeName.toLowerCase(),["iframe","#document","html","body"])}function t(e){return r.isFunction(e)||r.isPlainObject(e)?e:{top:e,left:e}}var v=r.scrollTo=function(e,t,o){return r(window).scrollTo(e,t,o)};return v.defaults={axis:"xy",duration:0,limit:!0},r.fn.scrollTo=function(e,o,h){"object"==typeof o&&(h=o,o=0),"function"==typeof h&&(h={onAfter:h}),"max"===e&&(e=9e9),h=r.extend({},v.defaults,h),o=o||h.duration;var x=h.queue&&1<h.axis.length;return x&&(o/=2),h.offset=t(h.offset),h.over=t(h.over),this.each(function(){function a(e){var t=r.extend({},h,{queue:!0,duration:o,complete:e&&function(){e.call(c,d,h)}});l.animate(m,t)}if(null!==e){var u,f=i(this),c=f?this.contentWindow||window:this,l=r(c),d=e,m={};switch(typeof d){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(d)){d=t(d);break}d=f?r(d):r(d,c);case"object":if(0===d.length)return;(d.is||d.style)&&(u=(d=r(d)).offset())}var p=r.isFunction(h.offset)&&h.offset(c,d)||h.offset;r.each(h.axis.split(""),function(e,t){var o="x"===t?"Left":"Top",n=o.toLowerCase(),r="scroll"+o,i=l[r](),s=v.max(c,t);u?(m[r]=u[n]+(f?0:i-l.offset()[n]),h.margin&&(m[r]-=parseInt(d.css("margin"+o),10)||0,m[r]-=parseInt(d.css("border"+o+"Width"),10)||0),m[r]+=p[n]||0,h.over[n]&&(m[r]+=d["x"===t?"width":"height"]()*h.over[n])):(o=d[n],m[r]=o.slice&&"%"===o.slice(-1)?parseFloat(o)/100*s:o),h.limit&&/^\d+$/.test(m[r])&&(m[r]=m[r]<=0?0:Math.min(m[r],s)),!e&&1<h.axis.length&&(i===m[r]?m={}:x&&(a(h.onAfterFirst),m={}))}),a(h.onAfter)}})},v.max=function(e,t){var o="scroll"+(n="x"===t?"Width":"Height");if(!i(e))return e[o]-r(e)[n.toLowerCase()]();var n="client"+n,e=(t=e.ownerDocument||e.document).documentElement,t=t.body;return Math.max(e[o],t[o])-Math.min(e[n],t[n])},r.Tween.propHooks.scrollLeft=r.Tween.propHooks.scrollTop={get:function(e){return r(e.elem)[e.prop]()},set:function(e){var t=this.get(e);if(e.options.interrupt&&e._last&&e._last!==t)return r(e.elem).stop();var o=Math.round(e.now);t!==o&&(r(e.elem)[e.prop](o),e._last=this.get(e))}},v});
!function(h,i,s,o){function l(t,e){this.settings=null,this.options=h.extend({},l.Defaults,e),this.$element=h(t),this._handlers={},this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._widths=[],this._invalidated={},this._pipe=[],this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null},this._states={current:{},tags:{initializing:["busy"],animating:["busy"],dragging:["interacting"]}},h.each(["onResize","onThrottledResize"],h.proxy(function(t,e){this._handlers[e]=h.proxy(this[e],this)},this)),h.each(l.Plugins,h.proxy(function(t,e){this._plugins[t.charAt(0).toLowerCase()+t.slice(1)]=new e(this)},this)),h.each(l.Workers,h.proxy(function(t,e){this._pipe.push({filter:e.filter,run:h.proxy(e.run,this)})},this)),this.setup(),this.initialize()}l.Defaults={items:3,loop:!1,center:!1,rewind:!1,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:i,fallbackEasing:"swing",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",refreshClass:"owl-refresh",loadedClass:"owl-loaded",loadingClass:"owl-loading",rtlClass:"owl-rtl",responsiveClass:"owl-responsive",dragClass:"owl-drag",itemClass:"owl-item",stageClass:"owl-stage",stageOuterClass:"owl-stage-outer",grabClass:"owl-grab"},l.Width={Default:"default",Inner:"inner",Outer:"outer"},l.Type={Event:"event",State:"state"},l.Plugins={},l.Workers=[{filter:["width","settings"],run:function(){this._width=this.$element.width()}},{filter:["width","items","settings"],run:function(t){t.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){this.$stage.children(".cloned").remove()}},{filter:["width","items","settings"],run:function(t){var e=this.settings.margin||"",i=!this.settings.autoWidth,s=this.settings.rtl,e={width:"auto","margin-left":s?e:"","margin-right":s?"":e};i||this.$stage.children().css(e),t.css=e}},{filter:["width","items","settings"],run:function(t){var e=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,i=null,s=this._items.length,n=!this.settings.autoWidth,o=[];for(t.items={merge:!1,width:e};s--;)i=this._mergers[s],i=this.settings.mergeFit&&Math.min(i,this.settings.items)||i,t.items.merge=1<i||t.items.merge,o[s]=n?e*i:this._items[s].width();this._widths=o}},{filter:["items","settings"],run:function(){var t=[],e=this._items,i=this.settings,s=Math.max(2*i.items,4),n=2*Math.ceil(e.length/2),o=i.loop&&e.length?i.rewind?s:Math.max(s,n):0,r="",a="";for(o/=2;o--;)t.push(this.normalize(t.length/2,!0)),r+=e[t[t.length-1]][0].outerHTML,t.push(this.normalize(e.length-1-(t.length-1)/2,!0)),a=e[t[t.length-1]][0].outerHTML+a;this._clones=t,h(r).addClass("cloned").appendTo(this.$stage),h(a).addClass("cloned").prependTo(this.$stage)}},{filter:["width","items","settings"],run:function(){for(var t,e,i=this.settings.rtl?1:-1,s=this._clones.length+this._items.length,n=-1,o=[];++n<s;)t=o[n-1]||0,e=this._widths[this.relative(n)]+this.settings.margin,o.push(t+e*i);this._coordinates=o}},{filter:["width","items","settings"],run:function(){var t=this.settings.stagePadding,e=this._coordinates,t={width:Math.ceil(Math.abs(e[e.length-1]))+2*t,"padding-left":t||"","padding-right":t||""};this.$stage.css(t)}},{filter:["width","items","settings"],run:function(t){var e=this._coordinates.length,i=!this.settings.autoWidth,s=this.$stage.children();if(i&&t.items.merge)for(;e--;)t.css.width=this._widths[this.relative(e)],s.eq(e).css(t.css);else i&&(t.css.width=t.items.width,s.css(t.css))}},{filter:["items"],run:function(){this._coordinates.length<1&&this.$stage.removeAttr("style")}},{filter:["width","items","settings"],run:function(t){t.current=t.current?this.$stage.children().index(t.current):0,t.current=Math.max(this.minimum(),Math.min(this.maximum(),t.current)),this.reset(t.current)}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){for(var t,e,i=this.settings.rtl?1:-1,s=2*this.settings.stagePadding,n=this.coordinates(this.current())+s,o=n+this.width()*i,r=[],a=0,h=this._coordinates.length;a<h;a++)t=this._coordinates[a-1]||0,e=Math.abs(this._coordinates[a])+s*i,(this.op(t,"<=",n)&&this.op(t,">",o)||this.op(e,"<",n)&&this.op(e,">",o))&&r.push(a);this.$stage.children(".active").removeClass("active"),this.$stage.children(":eq("+r.join("), :eq(")+")").addClass("active"),this.settings.center&&(this.$stage.children(".center").removeClass("center"),this.$stage.children().eq(this.current()).addClass("center"))}}],l.prototype.initialize=function(){var t,e;this.enter("initializing"),this.trigger("initialize"),this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl),this.settings.autoWidth&&!this.is("pre-loading")&&(t=this.$element.find("img"),e=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:o,e=this.$element.children(e).width(),t.length&&e<=0&&this.preloadAutoWidthImages(t)),this.$element.addClass(this.options.loadingClass),this.$stage=h("<"+this.settings.stageElement+' class="'+this.settings.stageClass+'"/>').wrap('<div class="'+this.settings.stageOuterClass+'"/>'),this.$element.append(this.$stage.parent()),this.replace(this.$element.children().not(this.$stage.parent())),this.$element.is(":visible")?this.refresh():this.invalidate("width"),this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass),this.registerEventHandlers(),this.leave("initializing"),this.trigger("initialized")},l.prototype.setup=function(){var e=this.viewport(),t=this.options.responsive,i=-1,s=null;t?(h.each(t,function(t){t<=e&&i<t&&(i=Number(t))}),delete(s=h.extend({},this.options,t[i])).responsive,s.responsiveClass&&this.$element.attr("class",this.$element.attr("class").replace(new RegExp("("+this.options.responsiveClass+"-)\\S+\\s","g"),"$1"+i))):s=h.extend({},this.options),null!==this.settings&&this._breakpoint===i||(this.trigger("change",{property:{name:"settings",value:s}}),this._breakpoint=i,this.settings=s,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}}))},l.prototype.optionsLogic=function(){this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},l.prototype.prepare=function(t){var e=this.trigger("prepare",{content:t});return e.data||(e.data=h("<"+this.settings.itemElement+"/>").addClass(this.options.itemClass).append(t)),this.trigger("prepared",{content:e.data}),e.data},l.prototype.update=function(){for(var t=0,e=this._pipe.length,i=h.proxy(function(t){return this[t]},this._invalidated),s={};t<e;)(this._invalidated.all||0<h.grep(this._pipe[t].filter,i).length)&&this._pipe[t].run(s),t++;this._invalidated={},this.is("valid")||this.enter("valid")},l.prototype.width=function(t){switch(t=t||l.Width.Default){case l.Width.Inner:case l.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},l.prototype.refresh=function(){this.enter("refreshing"),this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$element.addClass(this.options.refreshClass),this.update(),this.$element.removeClass(this.options.refreshClass),this.leave("refreshing"),this.trigger("refreshed")},l.prototype.onThrottledResize=function(){i.clearTimeout(this.resizeTimer),this.resizeTimer=i.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate)},l.prototype.onResize=function(){return!!this._items.length&&(this._width!==this.$element.width()&&(!!this.$element.is(":visible")&&(this.enter("resizing"),this.trigger("resize").isDefaultPrevented()?(this.leave("resizing"),!1):(this.invalidate("width"),this.refresh(),this.leave("resizing"),void this.trigger("resized")))))},l.prototype.registerEventHandlers=function(){h.support.transition&&this.$stage.on(h.support.transition.end+".owl.core",h.proxy(this.onTransitionEnd,this)),!1!==this.settings.responsive&&this.on(i,"resize",this._handlers.onThrottledResize),this.settings.mouseDrag&&(this.$element.addClass(this.options.dragClass),this.$stage.on("mousedown.owl.core",h.proxy(this.onDragStart,this)),this.$stage.on("dragstart.owl.core selectstart.owl.core",function(){return!1})),this.settings.touchDrag&&(this.$stage.on("touchstart.owl.core",h.proxy(this.onDragStart,this)),this.$stage.on("touchcancel.owl.core",h.proxy(this.onDragEnd,this)))},l.prototype.onDragStart=function(t){var e=null;3!==t.which&&(e=h.support.transform?{x:(e=this.$stage.css("transform").replace(/.*\(|\)| /g,"").split(","))[16===e.length?12:4],y:e[16===e.length?13:5]}:(e=this.$stage.position(),{x:this.settings.rtl?e.left+this.$stage.width()-this.width()+this.settings.margin:e.left,y:e.top}),this.is("animating")&&(h.support.transform?this.animate(e.x):this.$stage.stop(),this.invalidate("position")),this.$element.toggleClass(this.options.grabClass,"mousedown"===t.type),this.speed(0),this._drag.time=(new Date).getTime(),this._drag.target=h(t.target),this._drag.stage.start=e,this._drag.stage.current=e,this._drag.pointer=this.pointer(t),h(s).on("mouseup.owl.core touchend.owl.core",h.proxy(this.onDragEnd,this)),h(s).one("mousemove.owl.core touchmove.owl.core",h.proxy(function(t){var e=this.difference(this._drag.pointer,this.pointer(t));h(s).on("mousemove.owl.core touchmove.owl.core",h.proxy(this.onDragMove,this)),Math.abs(e.x)<Math.abs(e.y)&&this.is("valid")||(t.preventDefault(),this.enter("dragging"),this.trigger("drag"))},this)))},l.prototype.onDragMove=function(t){var e,i=null,s=null,n=this.difference(this._drag.pointer,this.pointer(t)),o=this.difference(this._drag.stage.start,n);this.is("dragging")&&(t.preventDefault(),this.settings.loop?(i=this.coordinates(this.minimum()),s=this.coordinates(this.maximum()+1)-i,o.x=((o.x-i)%s+s)%s+i):(i=this.coordinates(this.settings.rtl?this.maximum():this.minimum()),s=this.coordinates(this.settings.rtl?this.minimum():this.maximum()),e=this.settings.pullDrag?-1*n.x/5:0,o.x=Math.max(Math.min(o.x,i+e),s+e)),this._drag.stage.current=o,this.animate(o.x))},l.prototype.onDragEnd=function(t){var e=this.difference(this._drag.pointer,this.pointer(t)),i=this._drag.stage.current,t=0<e.x^this.settings.rtl?"left":"right";h(s).off(".owl.core"),this.$element.removeClass(this.options.grabClass),(0!==e.x&&this.is("dragging")||!this.is("valid"))&&(this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(this.closest(i.x,0!==e.x?t:this._drag.direction)),this.invalidate("position"),this.update(),this._drag.direction=t,(3<Math.abs(e.x)||300<(new Date).getTime()-this._drag.time)&&this._drag.target.one("click.owl.core",function(){return!1})),this.is("dragging")&&(this.leave("dragging"),this.trigger("dragged"))},l.prototype.closest=function(i,s){var n=-1,o=this.width(),r=this.coordinates();return this.settings.freeDrag||h.each(r,h.proxy(function(t,e){return e-30<i&&i<e+30?n=t:this.op(i,"<",e)&&this.op(i,">",r[t+1]||e-o)&&(n="left"===s?t+1:t),-1===n},this)),this.settings.loop||(this.op(i,">",r[this.minimum()])?n=i=this.minimum():this.op(i,"<",r[this.maximum()])&&(n=i=this.maximum())),n},l.prototype.animate=function(t){var e=0<this.speed();this.is("animating")&&this.onTransitionEnd(),e&&(this.enter("animating"),this.trigger("translate")),h.support.transform3d&&h.support.transition?this.$stage.css({transform:"translate3d("+t+"px,0px,0px)",transition:this.speed()/1e3+"s"}):e?this.$stage.animate({left:t+"px"},this.speed(),this.settings.fallbackEasing,h.proxy(this.onTransitionEnd,this)):this.$stage.css({left:t+"px"})},l.prototype.is=function(t){return this._states.current[t]&&0<this._states.current[t]},l.prototype.current=function(t){return t===o?this._current:0===this._items.length?o:(t=this.normalize(t),this._current!==t&&((e=this.trigger("change",{property:{name:"position",value:t}})).data!==o&&(t=this.normalize(e.data)),this._current=t,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})),this._current);var e},l.prototype.invalidate=function(t){return"string"===h.type(t)&&(this._invalidated[t]=!0,this.is("valid")&&this.leave("valid")),h.map(this._invalidated,function(t,e){return e})},l.prototype.reset=function(t){(t=this.normalize(t))!==o&&(this._speed=0,this._current=t,this.suppress(["translate","translated"]),this.animate(this.coordinates(t)),this.release(["translate","translated"]))},l.prototype.normalize=function(t,e){var i=this._items.length,e=e?0:this._clones.length;return!h.isNumeric(t)||i<1?t=o:(t<0||i+e<=t)&&(t=((t-e/2)%i+i)%i+e/2),t},l.prototype.relative=function(t){return t-=this._clones.length/2,this.normalize(t,!0)},l.prototype.maximum=function(t){var e,i=this.settings,s=this._coordinates.length,n=Math.abs(this._coordinates[s-1])-this._width,o=-1;if(i.loop)s=this._clones.length/2+this._items.length-1;else if(i.autoWidth||i.merge)for(;1<s-o;)Math.abs(this._coordinates[e=s+o>>1])<n?o=e:s=e;else s=i.center?this._items.length-1:this._items.length-i.items;return t&&(s-=this._clones.length/2),Math.max(s,0)},l.prototype.minimum=function(t){return t?0:this._clones.length/2},l.prototype.items=function(t){return t===o?this._items.slice():(t=this.normalize(t,!0),this._items[t])},l.prototype.mergers=function(t){return t===o?this._mergers.slice():(t=this.normalize(t,!0),this._mergers[t])},l.prototype.clones=function(i){function s(t){return t%2==0?n+t/2:e-(t+1)/2}var e=this._clones.length/2,n=e+this._items.length;return i===o?h.map(this._clones,function(t,e){return s(e)}):h.map(this._clones,function(t,e){return t===i?s(e):null})},l.prototype.speed=function(t){return t!==o&&(this._speed=t),this._speed},l.prototype.coordinates=function(t){var e=null;return t===o?h.map(this._coordinates,h.proxy(function(t,e){return this.coordinates(e)},this)):(this.settings.center?(e=this._coordinates[t],e+=(this.width()-e+(this._coordinates[t-1]||0))/2*(this.settings.rtl?-1:1)):e=this._coordinates[t-1]||0,e)},l.prototype.duration=function(t,e,i){return Math.min(Math.max(Math.abs(e-t),1),6)*Math.abs(i||this.settings.smartSpeed)},l.prototype.to=function(t,e){var i,s=this.current(),n=t-this.relative(s),o=(0<n)-(n<0),r=this._items.length,a=this.minimum(),h=this.maximum();this.settings.loop?(!this.settings.rewind&&Math.abs(n)>r/2&&(n+=-1*o*r),(i=(((t=s+n)-a)%r+r)%r+a)!==t&&i-n<=h&&0<i-n&&this.reset(s=(t=i)-n)):t=this.settings.rewind?(t%(h+=1)+h)%h:Math.max(a,Math.min(h,t)),this.speed(this.duration(s,t,e)),this.current(t),this.$element.is(":visible")&&this.update()},l.prototype.next=function(t){t=t||!1,this.to(this.relative(this.current())+1,t)},l.prototype.prev=function(t){t=t||!1,this.to(this.relative(this.current())-1,t)},l.prototype.onTransitionEnd=function(t){return(t===o||(t.stopPropagation(),(t.target||t.srcElement||t.originalTarget)===this.$stage.get(0)))&&(this.leave("animating"),void this.trigger("translated"))},l.prototype.viewport=function(){var t;if(this.options.responsiveBaseElement!==i)t=h(this.options.responsiveBaseElement).width();else if(i.innerWidth)t=i.innerWidth;else{if(!s.documentElement||!s.documentElement.clientWidth)throw"Can not detect viewport width.";t=s.documentElement.clientWidth}return t},l.prototype.replace=function(t){this.$stage.empty(),this._items=[],t=t&&(t instanceof jQuery?t:h(t)),(t=this.settings.nestedItemSelector?t.find("."+this.settings.nestedItemSelector):t).filter(function(){return 1===this.nodeType}).each(h.proxy(function(t,e){e=this.prepare(e),this.$stage.append(e),this._items.push(e),this._mergers.push(+e.find("[data-merge]").andSelf("[data-merge]").attr("data-merge")||1)},this)),this.reset(h.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},l.prototype.add=function(t,e){var i=this.relative(this._current);e=e===o?this._items.length:this.normalize(e,!0),t=t instanceof jQuery?t:h(t),this.trigger("add",{content:t,position:e}),t=this.prepare(t),0===this._items.length||e===this._items.length?(0===this._items.length&&this.$stage.append(t),0!==this._items.length&&this._items[e-1].after(t),this._items.push(t),this._mergers.push(+t.find("[data-merge]").andSelf("[data-merge]").attr("data-merge")||1)):(this._items[e].before(t),this._items.splice(e,0,t),this._mergers.splice(e,0,+t.find("[data-merge]").andSelf("[data-merge]").attr("data-merge")||1)),this._items[i]&&this.reset(this._items[i].index()),this.invalidate("items"),this.trigger("added",{content:t,position:e})},l.prototype.remove=function(t){(t=this.normalize(t,!0))!==o&&(this.trigger("remove",{content:this._items[t],position:t}),this._items[t].remove(),this._items.splice(t,1),this._mergers.splice(t,1),this.invalidate("items"),this.trigger("removed",{content:null,position:t}))},l.prototype.preloadAutoWidthImages=function(t){t.each(h.proxy(function(t,e){this.enter("pre-loading"),e=h(e),h(new Image).one("load",h.proxy(function(t){e.attr("src",t.target.src),e.css("opacity",1),this.leave("pre-loading"),this.is("pre-loading")||this.is("initializing")||this.refresh()},this)).attr("src",e.attr("src")||e.attr("data-src")||e.attr("data-src-retina"))},this))},l.prototype.destroy=function(){for(var t in this.$element.off(".owl.core"),this.$stage.off(".owl.core"),h(s).off(".owl.core"),!1!==this.settings.responsive&&(i.clearTimeout(this.resizeTimer),this.off(i,"resize",this._handlers.onThrottledResize)),this._plugins)this._plugins[t].destroy();this.$stage.children(".cloned").remove(),this.$stage.unwrap(),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class",this.$element.attr("class").replace(new RegExp(this.options.responsiveClass+"-\\S+\\s","g"),"")).removeData("owl.carousel")},l.prototype.op=function(t,e,i){var s=this.settings.rtl;switch(e){case"<":return s?i<t:t<i;case">":return s?t<i:i<t;case">=":return s?t<=i:i<=t;case"<=":return s?i<=t:t<=i}},l.prototype.on=function(t,e,i,s){t.addEventListener?t.addEventListener(e,i,s):t.attachEvent&&t.attachEvent("on"+e,i)},l.prototype.off=function(t,e,i,s){t.removeEventListener?t.removeEventListener(e,i,s):t.detachEvent&&t.detachEvent("on"+e,i)},l.prototype.trigger=function(t,e,i,s,n){var o={item:{count:this._items.length,index:this.current()}},r=h.camelCase(h.grep(["on",t,i],function(t){return t}).join("-").toLowerCase()),a=h.Event([t,"owl",i||"carousel"].join(".").toLowerCase(),h.extend({relatedTarget:this},o,e));return this._supress[t]||(h.each(this._plugins,function(t,e){e.onTrigger&&e.onTrigger(a)}),this.register({type:l.Type.Event,name:t}),this.$element.trigger(a),this.settings&&"function"==typeof this.settings[r]&&this.settings[r].call(this,a)),a},l.prototype.enter=function(t){h.each([t].concat(this._states.tags[t]||[]),h.proxy(function(t,e){this._states.current[e]===o&&(this._states.current[e]=0),this._states.current[e]++},this))},l.prototype.leave=function(t){h.each([t].concat(this._states.tags[t]||[]),h.proxy(function(t,e){this._states.current[e]--},this))},l.prototype.register=function(i){var e;i.type===l.Type.Event?(h.event.special[i.name]||(h.event.special[i.name]={}),h.event.special[i.name].owl||(e=h.event.special[i.name]._default,h.event.special[i.name]._default=function(t){return!e||!e.apply||t.namespace&&-1!==t.namespace.indexOf("owl")?t.namespace&&-1<t.namespace.indexOf("owl"):e.apply(this,arguments)},h.event.special[i.name].owl=!0)):i.type===l.Type.State&&(this._states.tags[i.name]?this._states.tags[i.name]=this._states.tags[i.name].concat(i.tags):this._states.tags[i.name]=i.tags,this._states.tags[i.name]=h.grep(this._states.tags[i.name],h.proxy(function(t,e){return h.inArray(t,this._states.tags[i.name])===e},this)))},l.prototype.suppress=function(t){h.each(t,h.proxy(function(t,e){this._supress[e]=!0},this))},l.prototype.release=function(t){h.each(t,h.proxy(function(t,e){delete this._supress[e]},this))},l.prototype.pointer=function(t){var e={x:null,y:null};return(t=(t=t.originalEvent||t||i.event).touches&&t.touches.length?t.touches[0]:t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t).pageX?(e.x=t.pageX,e.y=t.pageY):(e.x=t.clientX,e.y=t.clientY),e},l.prototype.difference=function(t,e){return{x:t.x-e.x,y:t.y-e.y}},h.fn.owlCarousel=function(e){var s=Array.prototype.slice.call(arguments,1);return this.each(function(){var t=h(this),i=t.data("owl.carousel");i||(i=new l(this,"object"==typeof e&&e),t.data("owl.carousel",i),h.each(["next","prev","to","destroy","refresh","replace","add","remove"],function(t,e){i.register({type:l.Type.Event,name:e}),i.$element.on(e+".owl.carousel.core",h.proxy(function(t){t.namespace&&t.relatedTarget!==this&&(this.suppress([e]),i[e].apply(this,[].slice.call(arguments,1)),this.release([e]))},i))})),"string"==typeof e&&"_"!==e.charAt(0)&&i[e].apply(i,s)})},h.fn.owlCarousel.Constructor=l}(window.Zepto||window.jQuery,window,document),function(e,i){function s(t){this._core=t,this._interval=null,this._visible=null,this._handlers={"initialized.owl.carousel":e.proxy(function(t){t.namespace&&this._core.settings.autoRefresh&&this.watch()},this)},this._core.options=e.extend({},s.Defaults,this._core.options),this._core.$element.on(this._handlers)}s.Defaults={autoRefresh:!0,autoRefreshInterval:500},s.prototype.watch=function(){this._interval||(this._visible=this._core.$element.is(":visible"),this._interval=i.setInterval(e.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},s.prototype.refresh=function(){this._core.$element.is(":visible")!==this._visible&&(this._visible=!this._visible,this._core.$element.toggleClass("owl-hidden",!this._visible),this._visible&&this._core.invalidate("width")&&this._core.refresh())},s.prototype.destroy=function(){var t,e;for(t in i.clearInterval(this._interval),this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},e.fn.owlCarousel.Constructor.Plugins.AutoRefresh=s}(window.Zepto||window.jQuery,window,document),function(a,n){function e(t){this._core=t,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel":a.proxy(function(t){if(t.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(t.property&&"position"==t.property.name||"initialized"==t.type))for(var e=this._core.settings,i=e.center&&Math.ceil(e.items/2)||e.items,s=e.center&&-1*i||0,n=(t.property&&t.property.value||this._core.current())+s,o=this._core.clones().length,r=a.proxy(function(t,e){this.load(e)},this);s++<i;)this.load(o/2+this._core.relative(n)),o&&a.each(this._core.clones(this._core.relative(n)),r),n++},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)}e.Defaults={lazyLoad:!1},e.prototype.load=function(t){var e=this._core.$stage.children().eq(t),t=e&&e.find(".owl-lazy");!t||-1<a.inArray(e.get(0),this._loaded)||(t.each(a.proxy(function(t,e){var i=a(e),s=1<n.devicePixelRatio&&i.attr("data-src-retina")||i.attr("data-src");this._core.trigger("load",{element:i,url:s},"lazy"),i.is("img")?i.one("load.owl.lazy",a.proxy(function(){i.css("opacity",1),this._core.trigger("loaded",{element:i,url:s},"lazy")},this)).attr("src",s):((e=new Image).onload=a.proxy(function(){i.css({"background-image":"url("+s+")",opacity:"1"}),this._core.trigger("loaded",{element:i,url:s},"lazy")},this),e.src=s)},this)),this._loaded.push(e.get(0)))},e.prototype.destroy=function(){var t,e;for(t in this.handlers)this._core.$element.off(t,this.handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},a.fn.owlCarousel.Constructor.Plugins.Lazy=e}(window.Zepto||window.jQuery,window,document),function(i){function e(t){this._core=t,this._handlers={"initialized.owl.carousel refreshed.owl.carousel":i.proxy(function(t){t.namespace&&this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":i.proxy(function(t){t.namespace&&this._core.settings.autoHeight&&"position"==t.property.name&&this.update()},this),"loaded.owl.lazy":i.proxy(function(t){t.namespace&&this._core.settings.autoHeight&&t.element.closest("."+this._core.settings.itemClass).index()===this._core.current()&&this.update()},this)},this._core.options=i.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)}e.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},e.prototype.update=function(){var t=this._core._current,e=t+this._core.settings.items,e=this._core.$stage.children().toArray().slice(t,e);heights=[],maxheight=0,i.each(e,function(t,e){heights.push(i(e).height())}),maxheight=Math.max.apply(null,heights),this._core.$stage.parent().height(maxheight).addClass(this._core.settings.autoHeightClass)},e.prototype.destroy=function(){var t,e;for(t in this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},i.fn.owlCarousel.Constructor.Plugins.AutoHeight=e}(window.Zepto||window.jQuery,(window,document)),function(c,e){function i(t){this._core=t,this._videos={},this._playing=null,this._handlers={"initialized.owl.carousel":c.proxy(function(t){t.namespace&&this._core.register({type:"state",name:"playing",tags:["interacting"]})},this),"resize.owl.carousel":c.proxy(function(t){t.namespace&&this._core.settings.video&&this.isInFullScreen()&&t.preventDefault()},this),"refreshed.owl.carousel":c.proxy(function(t){t.namespace&&this._core.is("resizing")&&this._core.$stage.find(".cloned .owl-video-frame").remove()},this),"changed.owl.carousel":c.proxy(function(t){t.namespace&&"position"===t.property.name&&this._playing&&this.stop()},this),"prepared.owl.carousel":c.proxy(function(t){var e;!t.namespace||(e=c(t.content).find(".owl-video")).length&&(e.css("display","none"),this.fetch(e,c(t.content)))},this)},this._core.options=c.extend({},i.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",c.proxy(function(t){this.play(t)},this))}i.Defaults={video:!1,videoHeight:!1,videoWidth:!1},i.prototype.fetch=function(t,e){var i=t.attr("data-vimeo-id")?"vimeo":"youtube",s=t.attr("data-vimeo-id")||t.attr("data-youtube-id"),n=t.attr("data-width")||this._core.settings.videoWidth,o=t.attr("data-height")||this._core.settings.videoHeight,r=t.attr("href");if(!r)throw new Error("Missing video URL.");if(-1<(s=r.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/))[3].indexOf("youtu"))i="youtube";else{if(!(-1<s[3].indexOf("vimeo")))throw new Error("Video URL not supported.");i="vimeo"}s=s[6],this._videos[r]={type:i,id:s,width:n,height:o},e.attr("data-video",r),this.thumbnail(t,this._videos[r])},i.prototype.thumbnail=function(e,t){function i(t){s=l.lazyLoad?'<div class="owl-video-tn '+h+'" '+a+'="'+t+'"></div>':'<div class="owl-video-tn" style="opacity:1;background-image:url('+t+')"></div>',e.after(s),e.after('<div class="owl-video-play-icon"></div>')}var s,n,o=t.width&&t.height?'style="width:'+t.width+"px;height:"+t.height+'px;"':"",r=e.find("img"),a="src",h="",l=this._core.settings;return e.wrap('<div class="owl-video-wrapper"'+o+"></div>"),this._core.settings.lazyLoad&&(a="data-src",h="owl-lazy"),r.length?(i(r.attr(a)),r.remove(),!1):void("youtube"===t.type?(n="http://img.youtube.com/vi/"+t.id+"/hqdefault.jpg",i(n)):"vimeo"===t.type&&c.ajax({type:"GET",url:"http://vimeo.com/api/v2/video/"+t.id+".json",jsonp:"callback",dataType:"jsonp",success:function(t){n=t[0].thumbnail_large,i(n)}}))},i.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null,this._core.leave("playing"),this._core.trigger("stopped",null,"video")},i.prototype.play=function(t){var e,i=c(t.target).closest("."+this._core.settings.itemClass),s=this._videos[i.attr("data-video")],n=s.width||"100%",t=s.height||this._core.$stage.height();this._playing||(this._core.enter("playing"),this._core.trigger("play",null,"video"),i=this._core.items(this._core.relative(i.index())),this._core.reset(i.index()),"youtube"===s.type?e='<iframe width="'+n+'" height="'+t+'" src="http://www.youtube.com/embed/'+s.id+"?autoplay=1&v="+s.id+'" frameborder="0" allowfullscreen></iframe>':"vimeo"===s.type&&(e='<iframe src="http://player.vimeo.com/video/'+s.id+'?autoplay=1" width="'+n+'" height="'+t+'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>'),c('<div class="owl-video-frame">'+e+"</div>").insertAfter(i.find(".owl-video")),this._playing=i.addClass("owl-video-playing"))},i.prototype.isInFullScreen=function(){var t=e.fullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement;return t&&c(t).parent().hasClass("owl-video-frame")},i.prototype.destroy=function(){var t,e;for(t in this._core.$element.off("click.owl.video"),this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},c.fn.owlCarousel.Constructor.Plugins.Video=i}(window.Zepto||window.jQuery,(window,document)),function(r){function e(t){this.core=t,this.core.options=r.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=void 0,this.next=void 0,this.handlers={"change.owl.carousel":r.proxy(function(t){t.namespace&&"position"==t.property.name&&(this.previous=this.core.current(),this.next=t.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":r.proxy(function(t){t.namespace&&(this.swapping="translated"==t.type)},this),"translate.owl.carousel":r.proxy(function(t){t.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)}e.Defaults={animateOut:!1,animateIn:!1},e.prototype.swap=function(){var t,e,i,s,n,o;1===this.core.settings.items&&r.support.animation&&r.support.transition&&(this.core.speed(0),e=r.proxy(this.clear,this),i=this.core.$stage.children().eq(this.previous),s=this.core.$stage.children().eq(this.next),n=this.core.settings.animateIn,o=this.core.settings.animateOut,this.core.current()!==this.previous&&(o&&(t=this.core.coordinates(this.previous)-this.core.coordinates(this.next),i.one(r.support.animation.end,e).css({left:t+"px"}).addClass("animated owl-animated-out").addClass(o)),n&&s.one(r.support.animation.end,e).addClass("animated owl-animated-in").addClass(n)))},e.prototype.clear=function(t){r(t.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},e.prototype.destroy=function(){var t,e;for(t in this.handlers)this.core.$element.off(t,this.handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},r.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,(window,document)),function(i,s,n){function e(t){this._core=t,this._interval=null,this._paused=!1,this._handlers={"changed.owl.carousel":i.proxy(function(t){t.namespace&&"settings"===t.property.name&&(this._core.settings.autoplay?this.play():this.stop())},this),"initialized.owl.carousel":i.proxy(function(t){t.namespace&&this._core.settings.autoplay&&this.play()},this),"play.owl.autoplay":i.proxy(function(t,e,i){t.namespace&&this.play(e,i)},this),"stop.owl.autoplay":i.proxy(function(t){t.namespace&&this.stop()},this),"mouseover.owl.autoplay":i.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"mouseleave.owl.autoplay":i.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()},this)},this._core.$element.on(this._handlers),this._core.options=i.extend({},e.Defaults,this._core.options)}e.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},e.prototype.play=function(t,e){this._paused=!1,this._core.is("rotating")||(this._core.enter("rotating"),this._interval=s.setInterval(i.proxy(function(){this._paused||this._core.is("busy")||this._core.is("interacting")||n.hidden||this._core.next(e||this._core.settings.autoplaySpeed)},this),t||this._core.settings.autoplayTimeout))},e.prototype.stop=function(){this._core.is("rotating")&&(s.clearInterval(this._interval),this._core.leave("rotating"))},e.prototype.pause=function(){this._core.is("rotating")&&(this._paused=!0)},e.prototype.destroy=function(){var t,e;for(t in this.stop(),this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},i.fn.owlCarousel.Constructor.Plugins.autoplay=e}(window.Zepto||window.jQuery,window,document),function(n){"use strict";function e(t){this._core=t,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":n.proxy(function(t){t.namespace&&this._core.settings.dotsData&&this._templates.push('<div class="'+this._core.settings.dotClass+'">'+n(t.content).find("[data-dot]").andSelf("[data-dot]").attr("data-dot")+"</div>")},this),"added.owl.carousel":n.proxy(function(t){t.namespace&&this._core.settings.dotsData&&this._templates.splice(t.position,0,this._templates.pop())},this),"remove.owl.carousel":n.proxy(function(t){t.namespace&&this._core.settings.dotsData&&this._templates.splice(t.position,1)},this),"changed.owl.carousel":n.proxy(function(t){t.namespace&&"position"==t.property.name&&this.draw()},this),"initialized.owl.carousel":n.proxy(function(t){t.namespace&&!this._initialized&&(this._core.trigger("initialize",null,"navigation"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger("initialized",null,"navigation"))},this),"refreshed.owl.carousel":n.proxy(function(t){t.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation"))},this)},this._core.options=n.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers)}e.Defaults={nav:!1,navText:["prev","next"],navSpeed:!1,navElement:"div",navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1},e.prototype.initialize=function(){var t,i=this._core.settings;for(t in this._controls.$relative=(i.navContainer?n(i.navContainer):n("<div>").addClass(i.navContainerClass).appendTo(this.$element)).addClass("disabled"),this._controls.$previous=n("<"+i.navElement+">").addClass(i.navClass[0]).html(i.navText[0]).prependTo(this._controls.$relative).on("click",n.proxy(function(t){this.prev(i.navSpeed)},this)),this._controls.$next=n("<"+i.navElement+">").addClass(i.navClass[1]).html(i.navText[1]).appendTo(this._controls.$relative).on("click",n.proxy(function(t){this.next(i.navSpeed)},this)),i.dotsData||(this._templates=[n("<div>").addClass(i.dotClass).append(n("<span>")).prop("outerHTML")]),this._controls.$absolute=(i.dotsContainer?n(i.dotsContainer):n("<div>").addClass(i.dotsClass).appendTo(this.$element)).addClass("disabled"),this._controls.$absolute.on("click","div",n.proxy(function(t){var e=(n(t.target).parent().is(this._controls.$absolute)?n(t.target):n(t.target).parent()).index();t.preventDefault(),this.to(e,i.dotsSpeed)},this)),this._overrides)this._core[t]=n.proxy(this[t],this)},e.prototype.destroy=function(){var t,e,i,s;for(t in this._handlers)this.$element.off(t,this._handlers[t]);for(e in this._controls)this._controls[e].remove();for(s in this.overides)this._core[s]=this._overrides[s];for(i in Object.getOwnPropertyNames(this))"function"!=typeof this[i]&&(this[i]=null)},e.prototype.update=function(){var t,e,i=this._core.clones().length/2,s=i+this._core.items().length,n=this._core.maximum(!0),o=this._core.settings,r=o.center||o.autoWidth||o.dotsData?1:o.dotsEach||o.items;if("page"!==o.slideBy&&(o.slideBy=Math.min(o.slideBy,o.items)),o.dots||"page"==o.slideBy)for(this._pages=[],t=i,e=0;t<s;t++){if(r<=e||0===e){if(this._pages.push({start:Math.min(n,t-i),end:t-i+r-1}),Math.min(n,t-i)===n)break;e=0,0}e+=this._core.mergers(this._core.relative(t))}},e.prototype.draw=function(){var t=this._core.settings,e=this._core.items().length<=t.items,i=this._core.relative(this._core.current()),s=t.loop||t.rewind;this._controls.$relative.toggleClass("disabled",!t.nav||e),t.nav&&(this._controls.$previous.toggleClass("disabled",!s&&i<=this._core.minimum(!0)),this._controls.$next.toggleClass("disabled",!s&&i>=this._core.maximum(!0))),this._controls.$absolute.toggleClass("disabled",!t.dots||e),t.dots&&(e=this._pages.length-this._controls.$absolute.children().length,t.dotsData&&0!=e?this._controls.$absolute.html(this._templates.join("")):0<e?this._controls.$absolute.append(new Array(1+e).join(this._templates[0])):e<0&&this._controls.$absolute.children().slice(e).remove(),this._controls.$absolute.find(".active").removeClass("active"),this._controls.$absolute.children().eq(n.inArray(this.current(),this._pages)).addClass("active"))},e.prototype.onTrigger=function(t){var e=this._core.settings;t.page={index:n.inArray(this.current(),this._pages),count:this._pages.length,size:e&&(e.center||e.autoWidth||e.dotsData?1:e.dotsEach||e.items)}},e.prototype.current=function(){var i=this._core.relative(this._core.current());return n.grep(this._pages,n.proxy(function(t,e){return t.start<=i&&t.end>=i},this)).pop()},e.prototype.getPosition=function(t){var e,i,s=this._core.settings;return"page"==s.slideBy?(e=n.inArray(this.current(),this._pages),i=this._pages.length,t?++e:--e,e=this._pages[(e%i+i)%i].start):(e=this._core.relative(this._core.current()),i=this._core.items().length,t?e+=s.slideBy:e-=s.slideBy),e},e.prototype.next=function(t){n.proxy(this._overrides.to,this._core)(this.getPosition(!0),t)},e.prototype.prev=function(t){n.proxy(this._overrides.to,this._core)(this.getPosition(!1),t)},e.prototype.to=function(t,e,i){i?n.proxy(this._overrides.to,this._core)(t,e):(i=this._pages.length,n.proxy(this._overrides.to,this._core)(this._pages[(t%i+i)%i].start,e))},n.fn.owlCarousel.Constructor.Plugins.Navigation=e}(window.Zepto||window.jQuery,(window,document)),function(s,n){"use strict";function e(t){this._core=t,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":s.proxy(function(t){t.namespace&&"URLHash"===this._core.settings.startPosition&&s(n).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":s.proxy(function(t){var e;!t.namespace||(e=s(t.content).find("[data-hash]").andSelf("[data-hash]").attr("data-hash"))&&(this._hashes[e]=t.content)},this),"changed.owl.carousel":s.proxy(function(t){var i;t.namespace&&"position"===t.property.name&&(i=this._core.items(this._core.relative(this._core.current())),(t=s.map(this._hashes,function(t,e){return t===i?e:null}).join())&&n.location.hash.slice(1)!==t&&(n.location.hash=t))},this)},this._core.options=s.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers),s(n).on("hashchange.owl.navigation",s.proxy(function(t){var e=n.location.hash.substring(1),i=this._core.$stage.children(),e=this._hashes[e]&&i.index(this._hashes[e]);void 0!==e&&e!==this._core.current()&&this._core.to(this._core.relative(e),!1,!0)},this))}e.Defaults={URLhashListener:!1},e.prototype.destroy=function(){var t,e;for(t in s(n).off("hashchange.owl.navigation"),this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},s.fn.owlCarousel.Constructor.Plugins.Hash=e}(window.Zepto||window.jQuery,window,document),function(n){function e(t,i){var s=!1,e=t.charAt(0).toUpperCase()+t.slice(1);return n.each((t+" "+r.join(e+" ")+e).split(" "),function(t,e){return void 0!==o[e]?(s=!i||e,!1):void 0}),s}function t(t){return e(t,!0)}var o=n("<support>").get(0).style,r="Webkit Moz O ms".split(" "),i={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},s=function(){return!!e("transform")},a=function(){return!!e("perspective")},h=function(){return!!e("animation")};!function(){return!!e("transition")}()||(n.support.transition=new String(t("transition")),n.support.transition.end=i.transition.end[n.support.transition]),h()&&(n.support.animation=new String(t("animation")),n.support.animation.end=i.animation.end[n.support.animation]),s()&&(n.support.transform=new String(t("transform")),n.support.transform3d=a())}(window.Zepto||window.jQuery,(window,document));
var tns=function(){Object.keys||(Object.keys=function(t){var e,n=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push(e);return n}),"remove"in Element.prototype||(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)});var t=window,wi=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.msRequestAnimationFrame||function(t){return setTimeout(t,16)},t=window,Mi=t.cancelAnimationFrame||t.mozCancelAnimationFrame||function(t){clearTimeout(t)};function Ti(t){for(var e,n,i,o=t||{},a=1,r=arguments.length;a<r;a++)if(null!==(e=arguments[a]))for(n in e)o!==(i=e[n])&&void 0!==i&&(o[n]=i);return o}function Ei(t){return 0<=["true","false"].indexOf(t)?JSON.parse(t):t}function Ai(t,e,n,i){if(i)try{t.setItem(e,n)}catch(t){}return n}function Ni(){var t=document,e=t.body;return e||((e=t.createElement("body")).fake=!0),e}var n=document.documentElement;function Li(t){var e="";return t.fake&&(e=n.style.overflow,t.style.background="",t.style.overflow=n.style.overflow="hidden",n.appendChild(t)),e}function Bi(t,e){t.fake&&(t.remove(),n.style.overflow=e,n.offsetHeight)}function Si(t,e,n,i){"insertRule"in t?t.insertRule(e+"{"+n+"}",i):t.addRule(e,n,i)}function Oi(t){return("insertRule"in t?t.cssRules:t.rules).length}function Di(t,e,n){for(var i=0,o=t.length;i<o;i++)e.call(n,t[i],i)}var t="classList"in document.createElement("_"),Hi=t?function(t,e){return t.classList.contains(e)}:function(t,e){return 0<=t.className.indexOf(e)},ki=t?function(t,e){Hi(t,e)||t.classList.add(e)}:function(t,e){Hi(t,e)||(t.className+=" "+e)},Ri=t?function(t,e){Hi(t,e)&&t.classList.remove(e)}:function(t,e){Hi(t,e)&&(t.className=t.className.replace(e,""))};function Ii(t,e){return t.hasAttribute(e)}function Pi(t,e){return t.getAttribute(e)}function a(t){return void 0!==t.item}function zi(t,e){if(t=a(t)||t instanceof Array?t:[t],"[object Object]"===Object.prototype.toString.call(e))for(var n=t.length;n--;)for(var i in e)t[n].setAttribute(i,e[i])}function Wi(t,e){t=a(t)||t instanceof Array?t:[t];for(var n=(e=e instanceof Array?e:[e]).length,i=t.length;i--;)for(var o=n;o--;)t[i].removeAttribute(e[o])}function Fi(t){for(var e=[],n=0,i=t.length;n<i;n++)e.push(t[n]);return e}function qi(t,e){"none"!==t.style.display&&(t.style.display="none")}function ji(t,e){"none"===t.style.display&&(t.style.display="")}function Vi(t){return"none"!==window.getComputedStyle(t).display}function Gi(e){var n,i;"string"==typeof e&&(n=[e],i=e.charAt(0).toUpperCase()+e.substr(1),["Webkit","Moz","ms","O"].forEach(function(t){"ms"===t&&"transform"!==e||n.push(t+i)}),e=n);for(var t=document.createElement("fakeelement"),o=(e.length,0);o<e.length;o++){var a=e[o];if(void 0!==t.style[a])return a}return!1}function Qi(t,e){var n=!1;return/^Webkit/.test(t)?n="webkit"+e+"End":/^O/.test(t)?n="o"+e+"End":t&&(n=e.toLowerCase()+"end"),n}var e=!1;try{var i=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",null,i)}catch(t){}var r=!!e&&{passive:!0};function Xi(t,e,n){for(var i in e){var o=0<=["touchstart","touchmove"].indexOf(i)&&!n&&r;t.addEventListener(i,e[i],o)}}function Yi(t,e){for(var n in e){var i=0<=["touchstart","touchmove"].indexOf(n)&&r;t.removeEventListener(n,e[n],i)}}function Ki(){return{topics:{},on:function(t,e){this.topics[t]=this.topics[t]||[],this.topics[t].push(e)},off:function(t,e){if(this.topics[t])for(var n=0;n<this.topics[t].length;n++)if(this.topics[t][n]===e){this.topics[t].splice(n,1);break}},emit:function(e,n){n.type=e,this.topics[e]&&this.topics[e].forEach(function(t){t(n,e)})}}}function Ji(M){M=Ti({container:".slider",mode:"carousel",axis:"horizontal",items:1,gutter:0,edgePadding:0,fixedWidth:!1,autoWidth:!1,viewportMax:!1,slideBy:1,center:!1,controls:!0,controlsPosition:"top",controlsText:["prev","next"],controlsContainer:!1,prevButton:!1,nextButton:!1,nav:!0,navPosition:"top",navContainer:!1,navAsThumbnails:!1,arrowKeys:!1,speed:300,autoplay:!1,autoplayPosition:"top",autoplayTimeout:5e3,autoplayDirection:"forward",autoplayText:["start","stop"],autoplayHoverPause:!1,autoplayButton:!1,autoplayButtonOutput:!0,autoplayResetOnVisibility:!0,animateIn:"tns-fadeIn",animateOut:"tns-fadeOut",animateNormal:"tns-normal",animateDelay:!1,loop:!0,rewind:!1,autoHeight:!1,responsive:!1,lazyload:!1,lazyloadSelector:".tns-lazy-img",touch:!0,mouseDrag:!1,swipeAngle:15,nested:!1,preventActionWhenRunning:!1,preventScrollOnTouch:!1,freezable:!0,onInit:!1,useLocalStorage:!0},M||{});var T=document,m=window,i={ENTER:13,SPACE:32,LEFT:37,RIGHT:39},e={},n=M.useLocalStorage;if(n){var t=navigator.userAgent,o=new Date;try{(e=m.localStorage)?(e.setItem(o,o),n=e.getItem(o)==o,e.removeItem(o)):n=!1,n||(e={})}catch(t){n=!1}n&&(e.tnsApp&&e.tnsApp!==t&&["tC","tPL","tMQ","tTf","t3D","tTDu","tTDe","tADu","tADe","tTE","tAE"].forEach(function(t){e.removeItem(t)}),localStorage.tnsApp=t)}var a,r,u,y=e.tC?Ei(e.tC):Ai(e,"tC",function(){var t=document,e=Ni(),n=Li(e),i=t.createElement("div"),o=!1;e.appendChild(i);try{for(var a,r="(10px * 10)",u=["calc"+r,"-moz-calc"+r,"-webkit-calc"+r],l=0;l<3;l++)if(a=u[l],i.style.width=a,100===i.offsetWidth){o=a.replace(r,"");break}}catch(t){}return e.fake?Bi(e,n):i.remove(),o}(),n),g=e.tPL?Ei(e.tPL):Ai(e,"tPL",function(){var t=document,e=Ni(),n=Li(e),i=t.createElement("div"),o=t.createElement("div"),a="",t=!1;i.className="tns-t-subp2",o.className="tns-t-ct";for(var r=0;r<70;r++)a+="<div></div>";return o.innerHTML=a,i.appendChild(o),e.appendChild(i),t=Math.abs(i.getBoundingClientRect().left-o.children[67].getBoundingClientRect().left)<2,e.fake?Bi(e,n):i.remove(),t}(),n),E=e.tMQ?Ei(e.tMQ):Ai(e,"tMQ",(a=document,r=Ni(),u=Li(r),o=a.createElement("div"),t=a.createElement("style"),s="@media all and (min-width:1px){.tns-mq-test{position:absolute}}",t.type="text/css",o.className="tns-mq-test",r.appendChild(t),r.appendChild(o),t.styleSheet?t.styleSheet.cssText=s:t.appendChild(a.createTextNode(s)),s=(window.getComputedStyle?window.getComputedStyle(o):o.currentStyle).position,r.fake?Bi(r,u):o.remove(),"absolute"===s),n),l=e.tTf?Ei(e.tTf):Ai(e,"tTf",Gi("transform"),n),s=e.t3D?Ei(e.t3D):Ai(e,"t3D",function(t){if(!t)return!1;if(!window.getComputedStyle)return!1;var e=document,n=Ni(),i=Li(n),o=e.createElement("p"),e=9<t.length?"-"+t.slice(0,-9).toLowerCase()+"-":"";return e+="transform",n.insertBefore(o,null),o.style[t]="translate3d(1px,1px,1px)",e=window.getComputedStyle(o).getPropertyValue(e),n.fake?Bi(n,i):o.remove(),void 0!==e&&0<e.length&&"none"!==e}(l),n),x=e.tTDu?Ei(e.tTDu):Ai(e,"tTDu",Gi("transitionDuration"),n),c=e.tTDe?Ei(e.tTDe):Ai(e,"tTDe",Gi("transitionDelay"),n),b=e.tADu?Ei(e.tADu):Ai(e,"tADu",Gi("animationDuration"),n),d=e.tADe?Ei(e.tADe):Ai(e,"tADe",Gi("animationDelay"),n),f=e.tTE?Ei(e.tTE):Ai(e,"tTE",Qi(x,"Transition"),n),p=e.tAE?Ei(e.tAE):Ai(e,"tAE",Qi(b,"Animation"),n),v=m.console&&"function"==typeof m.console.warn,h=["container","controlsContainer","prevButton","nextButton","navContainer","autoplayButton"],C={};if(h.forEach(function(t){var e,n;"string"==typeof M[t]&&(e=M[t],n=T.querySelector(e),C[t]=e,n&&n.nodeName?M[t]=n:v&&console.warn("Can't find",M[t]))}),!(M.container.children.length<1)){var A,N,w,L,B=M.responsive,S=M.nested,O="carousel"===M.mode;if(B){0 in B&&(M=Ti(M,B[0]),delete B[0]);var D,H={};for(D in B){var k="number"==typeof(k=B[D])?{items:k}:k;H[D]=k}B=H,H=null}O||!function t(e){for(var n in e)O||("slideBy"===n&&(e[n]="page"),"edgePadding"===n&&(e[n]=!1),"autoHeight"===n&&(e[n]=!1)),"responsive"===n&&t(e[n])}(M),O||(M.axis="horizontal",M.slideBy="page",M.edgePadding=!1,A=M.animateIn,N=M.animateOut,w=M.animateDelay,L=M.animateNormal);var R,I,P="horizontal"===M.axis,z=T.createElement("div"),W=T.createElement("div"),F=M.container,q=F.parentNode,j=F.outerHTML,V=F.children,G=V.length,Q=$e(),X=!1;B&&bn(),O&&(F.className+=" tns-vpfix");var Y,K,J,U,_,Z,$,tt,et,nt,it,ot,at,rt,ut,lt,st,ct,dt,ft,pt,vt,ht,mt,yt,gt,xt,bt,Ct,wt,Mt,Tt,Et,At,Nt,Lt,Bt,St,Ot=M.autoWidth,Dt=on("fixedWidth"),Ht=on("edgePadding"),kt=on("gutter"),Rt=en(),It=on("center"),Pt=Ot?1:Math.floor(on("items")),zt=on("slideBy"),Wt=M.viewportMax||M.fixedWidthViewportWidth,Ft=on("arrowKeys"),qt=on("speed"),jt=M.rewind,Vt=!jt&&M.loop,Gt=on("autoHeight"),Qt=on("controls"),Xt=on("controlsText"),Yt=on("nav"),Kt=on("touch"),Jt=on("mouseDrag"),Ut=on("autoplay"),_t=on("autoplayTimeout"),Zt=on("autoplayText"),$t=on("autoplayHoverPause"),te=on("autoplayResetOnVisibility"),ee=(n=document.createElement("style"),U&&n.setAttribute("media",U),document.querySelector("head").appendChild(n),n.sheet||n.styleSheet),ne=M.lazyload,ie=(M.lazyloadSelector,[]),oe=Vt?(o=function(){{if(Ot||Dt&&!Wt)return G-1;var t=Dt?"fixedWidth":"items",e=[];if((Dt||M[t]<G)&&e.push(M[t]),B)for(var n in B){n=B[n][t];n&&(Dt||n<G)&&e.push(n)}return e.length||e.push(0),Math.ceil(Dt?Wt/Math.min.apply(null,e):Math.max.apply(null,e))}}(),U=O?Math.ceil((5*o-G)/2):4*o-G,U=Math.max(o,U),nn("edgePadding")?U+1:U):0,ae=O?G+2*oe:G+oe,re=!(!Dt&&!Ot||Vt),ue=Dt?Yn():null,le=!O||!Vt,se=P?"left":"top",ce="",de="",fe=Dt?function(){return It&&!Vt?G-1:Math.ceil(-ue/(Dt+kt))}:Ot?function(){for(var t=ae;t--;)if(Y[t]>=-ue)return t}:function(){return It&&O&&!Vt?G-1:Vt||O?Math.max(0,ae-Math.ceil(Pt)):ae-1},pe=Ue(on("startIndex")),ve=pe,he=(Je(),0),me=Ot?null:fe(),ye=M.preventActionWhenRunning,ge=M.swipeAngle,xe=!ge||"?",be=!1,Ce=M.onInit,we=new Ki,Me=" tns-slider tns-"+M.mode,Te=F.id||(n=window.tnsId,window.tnsId=n?n+1:1,"tns"+window.tnsId),Ee=on("disable"),Ae=!1,Ne=M.freezable,Le=!(!Ne||Ot)&&xn(),Be=!1,Se={click:ni,keydown:function(t){t=ci(t);var e=[i.LEFT,i.RIGHT].indexOf(t.keyCode);0<=e&&(0===e?$.disabled||ni(t,-1):tt.disabled||ni(t,1))}},Oe={click:function(t){if(be){if(ye)return;ti()}var e=di(t=ci(t));for(;e!==at&&!Ii(e,"data-nav");)e=e.parentNode;{var n,i;Ii(e,"data-nav")&&(n=ct=Number(Pi(e,"data-nav")),i=Dt||Ot?n*G/lt:n*Pt,ei(We?n:Math.min(Math.ceil(i),G-1),t),dt===n&&(Ct&&ui(),ct=-1))}},keydown:function(t){t=ci(t);var e,n=T.activeElement;Ii(n,"data-nav")&&(e=[i.LEFT,i.RIGHT,i.ENTER,i.SPACE].indexOf(t.keyCode),n=Number(Pi(n,"data-nav")),0<=e&&(0===e?0<n&&si(ut[n-1]):1===e?n<lt-1&&si(ut[n+1]):ei(ct=n,t)))}},De={mouseover:function(){Ct&&(oi(),wt=!0)},mouseout:function(){wt&&(ii(),wt=!1)}},He={visibilitychange:function(){T.hidden?Ct&&(oi(),Tt=!0):Tt&&(ii(),Tt=!1)}},ke={keydown:function(t){t=ci(t);var e=[i.LEFT,i.RIGHT].indexOf(t.keyCode);0<=e&&ni(t,0===e?-1:1)}},Re={touchstart:hi,touchmove:mi,touchend:yi,touchcancel:yi},Ie={mousedown:hi,mousemove:mi,mouseup:yi,mouseleave:yi},Pe=nn("controls"),ze=nn("nav"),We=!!Ot||M.navAsThumbnails,Fe=nn("autoplay"),n=nn("touch"),qe=nn("mouseDrag"),je="tns-slide-active",Ve="tns-complete",Ge={load:function(t){Bn(di(t))},error:function(t){!function(t){ki(t,"failed"),Sn(t)}(di(t))}},Qe="force"===M.preventScrollOnTouch;Pe&&(_=M.controlsContainer,Z=M.controlsContainer?M.controlsContainer.outerHTML:"",$=M.prevButton,tt=M.nextButton,et=M.prevButton?M.prevButton.outerHTML:"",nt=M.nextButton?M.nextButton.outerHTML:""),ze&&(at=M.navContainer,rt=M.navContainer?M.navContainer.outerHTML:"",lt=Ot?G:xi(),st=0,ct=-1,dt=Ze(),ft=dt,pt="tns-nav-active",vt="Carousel Page ",ht=" (Current Slide)"),Fe&&(mt="forward"===M.autoplayDirection?1:-1,yt=M.autoplayButton,gt=M.autoplayButton?M.autoplayButton.outerHTML:"",xt=["<span class='tns-visually-hidden'>"," animation</span>"]),(n||qe)&&(Et={},Lt=!(At={}),St=P?function(t,e){return t.x-e.x}:function(t,e){return t.y-e.y}),Ot||Ke(Ee||Le),l&&(se=l,ce="translate",de=s?(ce+=P?"3d(":"3d(0px, ",P?", 0px, 0px)":", 0px)"):(ce+=P?"X(":"Y(",")")),O&&(F.className=F.className.replace("tns-vpfix","")),function(){nn("gutter");z.className="tns-outer",W.className="tns-inner",z.id=Te+"-ow",W.id=Te+"-iw",""===F.id&&(F.id=Te);Me+=g||Ot?" tns-subpixel":" tns-no-subpixel",Me+=y?" tns-calc":" tns-no-calc",Ot&&(Me+=" tns-autowidth");Me+=" tns-"+M.axis,F.className+=Me,O?((R=T.createElement("div")).id=Te+"-mw",R.className="tns-ovh",z.appendChild(R),R.appendChild(W)):z.appendChild(W);Gt&&((R||W).className+=" tns-ah");if(q.insertBefore(z,F),W.appendChild(F),Di(V,function(t,e){ki(t,"tns-item"),t.id||(t.id=Te+"-item"+e),!O&&L&&ki(t,L),zi(t,{"aria-hidden":"true",tabindex:"-1"})}),oe){for(var t=T.createDocumentFragment(),e=T.createDocumentFragment(),n=oe;n--;){var i=n%G,o=V[i].cloneNode(!0);Wi(o,"id"),e.insertBefore(o,e.firstChild),O&&(Wi(i=V[G-1-i].cloneNode(!0),"id"),t.appendChild(i))}F.insertBefore(t,F.firstChild),F.appendChild(e),V=F.children}}(),function(){if(!O)for(var t=pe,e=pe+Math.min(G,Pt);t<e;t++){var n=V[t];n.style.left=100*(t-pe)/Pt+"%",ki(n,A),Ri(n,L)}P&&(g||Ot?(Si(ee,"#"+Te+" > .tns-item","font-size:"+m.getComputedStyle(V[0]).fontSize+";",Oi(ee)),Si(ee,"#"+Te,"font-size:0;",Oi(ee))):O&&Di(V,function(t,e){t.style.marginLeft=(e=e,y?y+"("+100*e+"% / "+ae+")":100*e/ae+"%")}));E?(x&&(a=R&&M.autoHeight?cn(M.speed):"",Si(ee,"#"+Te+"-mw",a,Oi(ee))),a=an(M.edgePadding,M.gutter,M.fixedWidth,M.speed,M.autoHeight),Si(ee,"#"+Te+"-iw",a,Oi(ee)),O&&(a=P&&!Ot?"width:"+rn(M.fixedWidth,M.gutter,M.items)+";":"",x&&(a+=cn(qt)),Si(ee,"#"+Te,a,Oi(ee))),a=P&&!Ot?un(M.fixedWidth,M.gutter,M.items):"",M.gutter&&(a+=ln(M.gutter)),O||(x&&(a+=cn(qt)),b&&(a+=dn(qt)))):(Rn(),W.style.cssText=an(Ht,kt,Dt,Gt),O&&P&&!Ot&&(F.style.width=rn(Dt,kt,Pt)),a=P&&!Ot?un(Dt,kt,Pt):"",kt&&(a+=ln(kt))),a&&Si(ee,"#"+Te+" > .tns-item",a,Oi(ee));if(B&&E)for(var i in B){i=parseInt(i);var o=B[i],a="",r="",u="",l="",s="",c=Ot?null:on("items",i),d=on("fixedWidth",i),f=on("speed",i),p=on("edgePadding",i),v=on("autoHeight",i),h=on("gutter",i);x&&R&&on("autoHeight",i)&&"speed"in o&&(r="#"+Te+"-mw{"+cn(f)+"}"),("edgePadding"in o||"gutter"in o)&&(u="#"+Te+"-iw{"+an(p,h,d,f,v)+"}"),O&&P&&!Ot&&("fixedWidth"in o||"items"in o||Dt&&"gutter"in o)&&(l="width:"+rn(d,h,c)+";"),x&&"speed"in o&&(l+=cn(f)),l=l&&"#"+Te+"{"+l+"}",("fixedWidth"in o||Dt&&"gutter"in o||!O&&"items"in o)&&(s+=un(d,h,c)),"gutter"in o&&(s+=ln(h)),!O&&"speed"in o&&(x&&(s+=cn(f)),b&&(s+=dn(f))),(a=r+u+l+(s=s&&"#"+Te+" > .tns-item{"+s+"}"))&&ee.insertRule("@media (min-width: "+i/16+"em) {"+a+"}",ee.cssRules.length)}}(),fn();var Xe=Vt?O?function(){var t=he,e=me;t+=zt,e-=zt,Ht?(t+=1,--e):Dt&&(Rt+kt)%(Dt+kt)&&--e,oe&&(e<pe?pe-=G:pe<t&&(pe+=G))}:function(){if(me<pe)for(;he+G<=pe;)pe-=G;else if(pe<he)for(;pe<=me-G;)pe+=G}:function(){pe=Math.max(he,Math.min(me,pe))},Ye=O?function(){var e,n,i,o,t,a,r,u,l,s,c;Qn(F,""),x||!qt?(Un(),qt&&Vi(F)||ti()):(e=F,n=se,i=ce,o=de,t=Kn(),a=qt,r=ti,u=Math.min(a,10),l=0<=t.indexOf("%")?"%":"px",t=t.replace(l,""),s=Number(e.style[n].replace(i,"").replace(o,"").replace(l,"")),c=(t-s)/a*u,setTimeout(function t(){a-=u;s+=c;e.style[n]=i+s+l+o;0<a?setTimeout(t,u):r()},u)),P||gi()}:function(){ie=[];var t={};t[f]=t[p]=ti,Yi(V[ve],t),Xi(V[pe],t),_n(ve,A,N,!0),_n(pe,L,A),f&&p&&qt&&Vi(F)||ti()};return{version:"2.9.2",getInfo:Ci,events:we,goTo:ei,play:function(){Ut&&!Ct&&(ri(),Mt=!1)},pause:function(){Ct&&(ui(),Mt=!0)},isOn:X,updateSliderHeight:Pn,refresh:fn,destroy:function(){var t;ee.disabled=!0,ee.ownerNode&&ee.ownerNode.remove(),Yi(m,{resize:yn}),Ft&&Yi(T,ke),_&&Yi(_,Se),at&&Yi(at,Oe),Yi(F,De),Yi(F,He),yt&&Yi(yt,{click:li}),Ut&&clearInterval(bt),O&&f&&((t={})[f]=ti,Yi(F,t)),Kt&&Yi(F,Re),Jt&&Yi(F,Ie);var e,a=[j,Z,et,nt,rt,gt];for(e in h.forEach(function(t,e){var n,i,o="container"===t?z:M[t];"object"==typeof o&&(n=o.previousElementSibling||!1,i=o.parentNode,o.outerHTML=a[e],M[t]=n?n.nextElementSibling:i.firstElementChild)}),h=A=N=w=L=P=z=W=F=q=j=V=G=I=Q=Ot=Dt=Ht=kt=Rt=Pt=zt=Wt=Ft=qt=jt=Vt=Gt=ee=ne=Y=ie=oe=ae=re=ue=le=se=ce=de=fe=pe=ve=he=me=ge=xe=be=Ce=we=Me=Te=Ee=Ae=Ne=Le=Be=Se=Oe=De=He=ke=Re=Ie=Pe=ze=We=Fe=qe=je=Ve=Ge=K=Qt=Xt=_=Z=$=tt=it=ot=Yt=at=rt=ut=lt=st=ct=dt=ft=pt=vt=ht=Ut=_t=mt=Zt=$t=yt=gt=te=xt=bt=Ct=wt=Mt=Tt=Et=At=Nt=Lt=Bt=St=Kt=Jt=null,this)"rebuild"!==e&&(this[e]=null);X=!1},rebuild:function(){return Ji(Ti(M,C))}}}function Ke(t){t&&(Qt=Yt=Kt=Jt=Ft=Ut=$t=te=!1)}function Je(){for(var t=O?pe-oe:pe;t<0;)t+=G;return t%G+1}function Ue(t){return t=t?Math.max(0,Math.min(Vt?G-1:G-Pt,t)):0,O?t+oe:t}function _e(t){for(null==t&&(t=pe),O&&(t-=oe);t<0;)t+=G;return Math.floor(t%G)}function Ze(){var t=_e(),t=We?t:Dt||Ot?Math.ceil((t+1)*lt/G-1):Math.floor(t/Pt);return t=!Vt&&O&&pe===me?lt-1:t}function $e(){return m.innerWidth||T.documentElement.clientWidth||T.body.clientWidth}function tn(t){return"top"===t?"afterbegin":"beforeend"}function en(){var t=Ht?2*Ht-kt:0;return function t(e){var n,i=T.createElement("div");return e.appendChild(i),n=(n=i.getBoundingClientRect()).right-n.left,i.remove(),n||t(e.parentNode)}(q)-t}function nn(t){if(M[t])return!0;if(B)for(var e in B)if(B[e][t])return!0;return!1}function on(t,e){if(null==e&&(e=Q),"items"===t&&Dt)return Math.floor((Rt+kt)/(Dt+kt))||1;var n=M[t];if(B)for(var i in B)e>=parseInt(i)&&t in B[i]&&(n=B[i][t]);return"slideBy"===t&&"page"===n&&(n=on("items")),n=!(O||"slideBy"!==t&&"items"!==t)?Math.floor(n):n}function an(t,e,n,i,o){var a,r="";return void 0!==t?(a=t,e&&(a-=e),r=P?"margin: 0 "+a+"px 0 "+t+"px;":"margin: "+t+"px 0 "+a+"px 0;"):e&&!n&&(e="-"+e+"px",r="margin: 0 "+(P?e+" 0 0":"0 "+e+" 0")+";"),!O&&o&&x&&i&&(r+=cn(i)),r}function rn(t,e,n){return t?(t+e)*ae+"px":y?y+"("+100*ae+"% / "+n+")":100*ae/n+"%"}function un(t,e,n){var i;return i="width:"+(i=t?t+e+"px":(O||(n=Math.floor(n)),i=O?ae:n,y?y+"(100% / "+i+")":100/i+"%")),"inner"!==S?i+";":i+" !important;"}function ln(t){return!1!==t?(P?"padding-":"margin-")+(P?"right":"bottom")+": "+t+"px;":""}function sn(t,e){e=t.substring(0,t.length-e).toLowerCase();return e=e&&"-"+e+"-"}function cn(t){return sn(x,18)+"transition-duration:"+t/1e3+"s;"}function dn(t){return sn(b,17)+"animation-duration:"+t/1e3+"s;"}function fn(){var t;nn("autoHeight")||Ot||!P?(Di(t=F.querySelectorAll("img"),function(t){var e=t.src;e&&e.indexOf("data:image")<0?(Xi(t,Ge),t.src="",t.src=e,ki(t,"loading")):ne||Bn(t)}),wi(function(){Hn(Fi(t),function(){K=!0})}),!Ot&&P&&(t=On(pe,Math.min(pe+Pt-1,ae-1))),ne?pn():wi(function(){Hn(Fi(t),pn)})):(O&&Jn(),hn(),mn())}function pn(){var e;Ot?(e=Vt?pe:G-1,function t(){V[e-1].getBoundingClientRect().right.toFixed(2)===V[e].getBoundingClientRect().left.toFixed(2)?vn():setTimeout(function(){t()},16)}()):vn()}function vn(){P&&!Ot||(zn(),Ot?(ue=Yn(),Ne&&(Le=xn()),me=fe(),Ke(Ee||Le)):gi()),O&&Jn(),hn(),mn()}function hn(){if(Wn(),z.insertAdjacentHTML("afterbegin",'<div class="tns-liveregion tns-visually-hidden" aria-live="polite" aria-atomic="true">slide <span class="current">'+An()+"</span>  of "+G+"</div>"),J=z.querySelector(".tns-liveregion .current"),Fe&&(e=Ut?"stop":"start",yt?zi(yt,{"data-action":e}):M.autoplayButtonOutput&&(z.insertAdjacentHTML(tn(M.autoplayPosition),'<button data-action="'+e+'">'+xt[0]+e+xt[1]+Zt[0]+"</button>"),yt=z.querySelector("[data-action]")),yt&&Xi(yt,{click:li}),Ut&&(ri(),$t&&Xi(F,De),te&&Xi(F,He))),ze){var t,e;if(at)zi(at,{"aria-label":"Carousel Pagination"}),Di(ut=at.children,function(t,e){zi(t,{"data-nav":e,tabindex:"-1","aria-label":vt+(e+1),"aria-controls":Te})});else{for(var n="",i=We?"":'style="display:none"',o=0;o<G;o++)n+='<button data-nav="'+o+'" tabindex="-1" aria-controls="'+Te+'" '+i+' aria-label="'+vt+(o+1)+'"></button>';z.insertAdjacentHTML(tn(M.navPosition),n='<div class="tns-nav" aria-label="Carousel Pagination">'+n+"</div>"),at=z.querySelector(".tns-nav"),ut=at.children}bi(),x&&(t=x.substring(0,x.length-18).toLowerCase(),e="transition: all "+qt/1e3+"s",Si(ee,"[aria-controls^="+Te+"-item]",e=t?"-"+t+"-"+e:e,Oi(ee))),zi(ut[dt],{"aria-label":vt+(dt+1)+ht}),Wi(ut[dt],"tabindex"),ki(ut[dt],pt),Xi(at,Oe)}Pe&&(_||$&&tt||(z.insertAdjacentHTML(tn(M.controlsPosition),'<div class="tns-controls" aria-label="Carousel Navigation" tabindex="0"><button data-controls="prev" tabindex="-1" aria-controls="'+Te+'">'+Xt[0]+'</button><button data-controls="next" tabindex="-1" aria-controls="'+Te+'">'+Xt[1]+"</button></div>"),_=z.querySelector(".tns-controls")),$&&tt||($=_.children[0],tt=_.children[1]),M.controlsContainer&&zi(_,{"aria-label":"Carousel Navigation",tabindex:"0"}),(M.controlsContainer||M.prevButton&&M.nextButton)&&zi([$,tt],{"aria-controls":Te,tabindex:"-1"}),(M.controlsContainer||M.prevButton&&M.nextButton)&&(zi($,{"data-controls":"prev"}),zi(tt,{"data-controls":"next"})),it=qn($),ot=qn(tt),Gn(),_?Xi(_,Se):(Xi($,Se),Xi(tt,Se))),Cn()}function mn(){var t;O&&f&&((t={})[f]=ti,Xi(F,t)),Kt&&Xi(F,Re,M.preventScrollOnTouch),Jt&&Xi(F,Ie),Ft&&Xi(T,ke),"inner"===S?we.on("outerResized",function(){gn(),we.emit("innerLoaded",Ci())}):(B||Dt||Ot||Gt||!P)&&Xi(m,{resize:yn}),Gt&&("outer"===S?we.on("innerLoaded",Dn):Ee||Dn()),Ln(),Ee?Tn():Le&&Mn(),we.on("indexChanged",kn),"inner"===S&&we.emit("innerLoaded",Ci()),"function"==typeof Ce&&Ce(Ci()),X=!0}function yn(t){wi(function(){gn(ci(t))})}function gn(t){var e,n,i,o,a,r,u,l,s,c,d,f,p,v,h,m,y,g,x,b,C,w;X&&("outer"===S&&we.emit("outerResized",Ci(t)),Q=$e(),v=I,n=!1,B&&(bn(),(e=v!==I)&&we.emit("newBreakpointStart",Ci(t))),i=Pt,o=Ee,a=Le,r=Ft,u=Qt,l=Yt,s=Kt,c=Jt,d=Ut,f=$t,p=te,v=pe,e&&(h=Dt,g=Gt,x=Xt,y=It,m=Zt,E||(w=kt,C=Ht)),Ft=on("arrowKeys"),Qt=on("controls"),Yt=on("nav"),Kt=on("touch"),It=on("center"),Jt=on("mouseDrag"),Ut=on("autoplay"),$t=on("autoplayHoverPause"),te=on("autoplayResetOnVisibility"),e&&(Ee=on("disable"),Dt=on("fixedWidth"),qt=on("speed"),Gt=on("autoHeight"),Xt=on("controlsText"),Zt=on("autoplayText"),_t=on("autoplayTimeout"),E||(Ht=on("edgePadding"),kt=on("gutter"))),Ke(Ee),Rt=en(),P&&!Ot||Ee||(zn(),P||(gi(),n=!0)),(Dt||Ot)&&(ue=Yn(),me=fe()),(e||Dt)&&(Pt=on("items"),zt=on("slideBy"),(b=Pt!==i)&&(Dt||Ot||(me=fe()),Xe())),e&&Ee!==o&&(Ee?Tn:function(){if(Ae){if(ee.disabled=!1,F.className+=Me,Jn(),Vt)for(var t=oe;t--;)O&&ji(V[t]),ji(V[ae-t-1]);if(!O)for(var e=pe,n=pe+G;e<n;e++){var i=V[e],o=e<pe+Pt?A:L;i.style.left=100*(e-pe)/Pt+"%",ki(i,o)}wn(),Ae=!1}})(),Ne&&(e||Dt||Ot)&&(Le=xn())!==a&&(Le?(Un(Kn(Ue(0))),Mn()):(function(){if(Be){if(Ht&&E&&(W.style.margin=""),oe)for(var t="tns-transparent",e=oe;e--;)O&&Ri(V[e],t),Ri(V[ae-e-1],t);wn(),Be=!1}}(),n=!0)),Ke(Ee||Le),Ut||($t=te=!1),Ft!==r&&(Ft?Xi:Yi)(T,ke),Qt!==u&&(Qt?_?ji(_):($&&ji($),tt&&ji(tt)):_?qi(_):($&&qi($),tt&&qi(tt))),Yt!==l&&(Yt?ji:qi)(at),Kt!==s&&(Kt?Xi(F,Re,M.preventScrollOnTouch):Yi(F,Re)),Jt!==c&&(Jt?Xi:Yi)(F,Ie),Ut!==d&&(Ut?(yt&&ji(yt),Ct||Mt||ri()):(yt&&qi(yt),Ct&&ui())),$t!==f&&($t?Xi:Yi)(F,De),te!==p&&(te?Xi:Yi)(T,He),e?(Dt===h&&It===y||(n=!0),Gt!==g&&(Gt||(W.style.height="")),Qt&&Xt!==x&&($.innerHTML=Xt[0],tt.innerHTML=Xt[1]),yt&&Zt!==m&&(y=Ut?1:0,x=(g=yt.innerHTML).length-m[y].length,g.substring(x)===m[y]&&(yt.innerHTML=g.substring(0,x)+Zt[y]))):It&&(Dt||Ot)&&(n=!0),(b||Dt&&!Ot)&&(lt=xi(),bi()),(v=pe!==v)?(we.emit("indexChanged",Ci()),n=!0):b?v||kn():(Dt||Ot)&&(Ln(),Wn(),En()),b&&!O&&function(){for(var t=pe+Math.min(G,Pt),e=ae;e--;){var n=V[e];pe<=e&&e<t?(ki(n,"tns-moving"),n.style.left=100*(e-pe)/Pt+"%",ki(n,A),Ri(n,L)):n.style.left&&(n.style.left="",ki(n,L),Ri(n,A)),Ri(n,N)}setTimeout(function(){Di(V,function(t){Ri(t,"tns-moving")})},300)}(),Ee||Le||(e&&!E&&(Gt===autoheightTem&&qt===speedTem||Rn(),Ht===C&&kt===w||(W.style.cssText=an(Ht,kt,Dt,qt,Gt)),P&&(O&&(F.style.width=rn(Dt,kt,Pt)),b=un(Dt,kt,Pt)+ln(kt),w=Oi(C=ee)-1,"deleteRule"in C?C.deleteRule(w):C.removeRule(w),Si(ee,"#"+Te+" > .tns-item",b,Oi(ee)))),Gt&&Dn(),n&&(Jn(),ve=pe)),e&&we.emit("newBreakpointEnd",Ci(t)))}function xn(){if(!Dt&&!Ot)return G<=(It?Pt-(Pt-1)/2:Pt);var t=Dt?(Dt+kt)*G:Y[G],e=Ht?Rt+2*Ht:Rt+kt;return It&&(e-=Dt?(Rt-Dt)/2:(Rt-(Y[pe+1]-Y[pe]-kt))/2),t<=e}function bn(){for(var t in I=0,B)(t=parseInt(t))<=Q&&(I=t)}function Cn(){!Ut&&yt&&qi(yt),!Yt&&at&&qi(at),Qt||(_?qi(_):($&&qi($),tt&&qi(tt)))}function wn(){Ut&&yt&&ji(yt),Yt&&at&&ji(at),Qt&&(_?ji(_):($&&ji($),tt&&ji(tt)))}function Mn(){if(!Be){if(Ht&&(W.style.margin="0px"),oe)for(var t="tns-transparent",e=oe;e--;)O&&ki(V[e],t),ki(V[ae-e-1],t);Cn(),Be=!0}}function Tn(){if(!Ae){if(ee.disabled=!0,F.className=F.className.replace(Me.substring(1),""),Wi(F,["style"]),Vt)for(var t=oe;t--;)O&&qi(V[t]),qi(V[ae-t-1]);if(P&&O||Wi(W,["style"]),!O)for(var e=pe,n=pe+G;e<n;e++){var i=V[e];Wi(i,["style"]),Ri(i,A),Ri(i,L)}Cn(),Ae=!0}}function En(){var t=An();J.innerHTML!==t&&(J.innerHTML=t)}function An(){var t=Nn(),e=t[0]+1,t=t[1]+1;return e===t?e+"":e+" to "+t}function Nn(t){null==t&&(t=Kn());var n,i,o,e,a=pe;return It||Ht?(Ot||Dt)&&(n=-(parseFloat(t)+Ht),i=n+Rt+2*Ht):Ot&&(n=Y[pe],i=n+Rt),Ot?Y.forEach(function(t,e){e<ae&&((It||Ht)&&t<=n+.5&&(a=e),.5<=i-t&&(o=e))}):(o=Dt?(e=Dt+kt,It||Ht?(a=Math.floor(n/e),Math.ceil(i/e-1)):a+Math.ceil(Rt/e)-1):It||Ht?(e=Pt-1,o=It?(a-=e/2,pe+e/2):pe+e,Ht&&(a-=e=Ht*Pt/Rt,o+=e),a=Math.floor(a),Math.ceil(o)):a+Pt-1,a=Math.max(a,0),o=Math.min(o,ae-1)),[a,o]}function Ln(){ne&&!Ee&&On.apply(null,Nn()).forEach(function(t){var e;Hi(t,Ve)||((e={})[f]=function(t){t.stopPropagation()},Xi(t,e),Xi(t,Ge),t.src=Pi(t,"data-src"),(e=Pi(t,"data-srcset"))&&(t.srcset=e),ki(t,"loading"))})}function Bn(t){ki(t,"loaded"),Sn(t)}function Sn(t){ki(t,"tns-complete"),Ri(t,"loading"),Yi(t,Ge)}function On(t,e){for(var n=[];t<=e;)Di(V[t].querySelectorAll("img"),function(t){n.push(t)}),t++;return n}function Dn(){var t=On.apply(null,Nn());wi(function(){Hn(t,Pn)})}function Hn(n,t){return K?t():(n.forEach(function(t,e){Hi(t,Ve)&&n.splice(e,1)}),n.length?void wi(function(){Hn(n,t)}):t())}function kn(){Ln(),Wn(),En(),Gn(),function(){{var t,e;Yt&&(dt=0<=ct?ct:Ze(),ct=-1,dt!==ft&&(t=ut[ft],e=ut[dt],zi(t,{tabindex:"-1","aria-label":vt+(ft+1)}),Ri(t,pt),zi(e,{"aria-label":vt+(dt+1)+ht}),Wi(e,"tabindex"),ki(e,pt),ft=dt))}}()}function Rn(){O&&Gt&&(R.style[x]=qt/1e3+"s")}function In(t,e){for(var n=[],i=t,o=Math.min(t+e,ae);i<o;i++)n.push(V[i].offsetHeight);return Math.max.apply(null,n)}function Pn(){var t=Gt?In(pe,Pt):In(oe,G),e=R||W;e.style.height!==t&&(e.style.height=t+"px")}function zn(){Y=[0];var n=P?"left":"top",i=P?"right":"bottom",o=V[0].getBoundingClientRect()[n];Di(V,function(t,e){e&&Y.push(t.getBoundingClientRect()[n]-o),e===ae-1&&Y.push(t.getBoundingClientRect()[i]-o)})}function Wn(){var t=Nn(),n=t[0],i=t[1];Di(V,function(t,e){n<=e&&e<=i?Ii(t,"aria-hidden")&&(Wi(t,["aria-hidden","tabindex"]),ki(t,je)):Ii(t,"aria-hidden")||(zi(t,{"aria-hidden":"true",tabindex:"-1"}),Ri(t,je))})}function Fn(t){return t.nodeName.toLowerCase()}function qn(t){return"button"===Fn(t)}function jn(t){return"true"===t.getAttribute("aria-disabled")}function Vn(t,e,n){t?e.disabled=n:e.setAttribute("aria-disabled",n.toString())}function Gn(){var t,e,n,i;!Qt||jt||Vt||(t=it?$.disabled:jn($),e=ot?tt.disabled:jn(tt),i=!jt&&me<=pe,(n=pe<=he)&&!t&&Vn(it,$,!0),!n&&t&&Vn(it,$,!1),i&&!e&&Vn(ot,tt,!0),!i&&e&&Vn(ot,tt,!1))}function Qn(t,e){x&&(t.style[x]=e)}function Xn(t){return null==t&&(t=pe),Ot?(Rt-(Ht?kt:0)-(Y[t+1]-Y[t]-kt))/2:Dt?(Rt-Dt)/2:(Pt-1)/2}function Yn(){var t=Rt+(Ht?kt:0)-(Dt?(Dt+kt)*ae:Y[ae]);return t=0<(t=It&&!Vt?Dt?-(Dt+kt)*(ae-1)-Xn():Xn(ae-1)-Y[ae-1]:t)?0:t}function Kn(t){var e,n;return null==t&&(t=pe),P&&!Ot?Dt?(e=-(Dt+kt)*t,It&&(e+=Xn())):(n=l?ae:Pt,It&&(t-=Xn()),e=100*-t/n):(e=-Y[t],It&&Ot&&(e+=Xn())),re&&(e=Math.max(e,ue)),e+=!P||Ot||Dt?"px":"%"}function Jn(t){Qn(F,"0s"),Un(t)}function Un(t){null==t&&(t=Kn()),F.style[se]=ce+t+de}function _n(t,e,n,i){var o=t+Pt;Vt||(o=Math.min(o,ae));for(var a=t;a<o;a++){var r=V[a];i||(r.style.left=100*(a-pe)/Pt+"%"),w&&c&&(r.style[c]=r.style[d]=w*(a-t)/1e3+"s"),Ri(r,e),ki(r,n),i&&ie.push(r)}}function Zn(t,e){le&&Xe(),pe===ve&&!e||(we.emit("indexChanged",Ci()),we.emit("transitionStart",Ci()),Gt&&Dn(),Ct&&t&&0<=["click","keydown"].indexOf(t.type)&&ui(),be=!0,Ye())}function $n(t){return t.toLowerCase().replace(/-/g,"")}function ti(t){if(O||be){if(we.emit("transitionEnd",Ci(t)),!O&&0<ie.length)for(var e=0;e<ie.length;e++){var n=ie[e];n.style.left="",d&&c&&(n.style[d]="",n.style[c]=""),Ri(n,N),ki(n,L)}(!t||!O&&t.target.parentNode===F||t.target===F&&$n(t.propertyName)===$n(se))&&(le||(t=pe,Xe(),pe!==t&&(we.emit("indexChanged",Ci()),Jn())),"inner"===S&&we.emit("innerLoaded",Ci()),be=!1,ve=pe)}}function ei(t,e){if(!Le)if("prev"===t)ni(e,-1);else if("next"===t)ni(e,1);else{if(be){if(ye)return;ti()}var n=_e(),i=0;"first"===t?i=-n:"last"===t?i=O?G-Pt-n:G-1-n:("number"!=typeof t&&(t=parseInt(t)),isNaN(t)||(i=(t=!e?Math.max(0,Math.min(G-1,t)):t)-n)),!O&&i&&Math.abs(i)<Pt&&(n=0<i?1:-1,i+=he<=pe+i-G?G*n:2*G*n*-1),pe+=i,O&&Vt&&(pe<he&&(pe+=G),me<pe&&(pe-=G)),_e(pe)!==_e(ve)&&Zn(e)}}function ni(t,e){if(be){if(ye)return;ti()}var n;if(!e){for(var i=di(t=ci(t));i!==_&&[$,tt].indexOf(i)<0;)i=i.parentNode;var o=[$,tt].indexOf(i);0<=o&&(n=!0,e=0===o?-1:1)}if(jt){if(pe===he&&-1===e)return void ei("last",t);if(pe===me&&1===e)return void ei("first",t)}e&&(pe+=zt*e,Ot&&(pe=Math.floor(pe)),Zn(n||t&&"keydown"===t.type?t:null))}function ii(){bt=setInterval(function(){ni(null,mt)},_t),Ct=!0}function oi(){clearInterval(bt),Ct=!1}function ai(t,e){zi(yt,{"data-action":t}),yt.innerHTML=xt[0]+t+xt[1]+e}function ri(){ii(),yt&&ai("stop",Zt[1])}function ui(){oi(),yt&&ai("start",Zt[0])}function li(){Mt=Ct?(ui(),!0):(ri(),!1)}function si(t){t.focus()}function ci(t){return fi(t=t||m.event)?t.changedTouches[0]:t}function di(t){return t.target||m.event.srcElement}function fi(t){return 0<=t.type.indexOf("touch")}function pi(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function vi(){return e=At.y-Et.y,n=At.x-Et.x,t=Math.atan2(e,n)*(180/Math.PI),e=ge,n=!1,t=Math.abs(90-Math.abs(t)),90-e<=t?n="horizontal":t<=e&&(n="vertical"),n===M.axis;var t,e,n}function hi(t){if(be){if(ye)return;ti()}Ut&&Ct&&oi(),Lt=!0,Bt&&(Mi(Bt),Bt=null);var e=ci(t);we.emit(fi(t)?"touchStart":"dragStart",Ci(t)),!fi(t)&&0<=["img","a"].indexOf(Fn(di(t)))&&pi(t),At.x=Et.x=e.clientX,At.y=Et.y=e.clientY,O&&(Nt=parseFloat(F.style[se].replace(ce,"")),Qn(F,"0s"))}function mi(t){var e;Lt&&(e=ci(t),At.x=e.clientX,At.y=e.clientY,O?Bt=Bt||wi(function(){!function t(e){if(!xe)return void(Lt=!1);Mi(Bt);Lt&&(Bt=wi(function(){t(e)}));"?"===xe&&(xe=vi());if(xe){!Qe&&fi(e)&&(Qe=!0);try{e.type&&we.emit(fi(e)?"touchMove":"dragMove",Ci(e))}catch(t){}var n=Nt,i=St(At,Et);!P||Dt||Ot?(n+=i,n+="px"):(n+=l?i*Pt*100/((Rt+kt)*ae):100*i/(Rt+kt),n+="%"),F.style[se]=ce+n+de}}(t)}):(xe="?"===xe?vi():xe)&&(Qe=!0),Qe&&t.preventDefault())}function yi(i){var t,o,n;Lt&&(Bt&&(Mi(Bt),Bt=null),O&&Qn(F,""),Lt=!1,t=ci(i),At.x=t.clientX,At.y=t.clientY,o=St(At,Et),Math.abs(o)&&(fi(i)||Xi(n=di(i),{click:function t(e){pi(e),Yi(n,{click:t})}}),O?Bt=wi(function(){if(P&&!Ot){var t=-o*Pt/(Rt+kt),t=0<o?Math.floor(t):Math.ceil(t);pe+=t}else{var e=-(Nt+o);if(e<=0)pe=he;else if(e>=Y[ae-1])pe=me;else for(var n=0;n<ae&&e>=Y[n];)e>Y[pe=n]&&o<0&&(pe+=1),n++}Zn(i,o),we.emit(fi(i)?"touchEnd":"dragEnd",Ci(i))}):xe&&ni(i,0<o?-1:1))),"auto"===M.preventScrollOnTouch&&(Qe=!1),ge&&(xe="?"),Ut&&!Ct&&ii()}function gi(){(R||W).style.height=Y[pe+Pt]-Y[pe]+"px"}function xi(){var t=Dt?(Dt+kt)*G/Rt:G/Pt;return Math.min(Math.ceil(t),G)}function bi(){if(Yt&&!We&&lt!==st){var t=st,e=lt,n=ji;for(lt<st&&(t=lt,e=st,n=qi);t<e;)n(ut[t]),t++;st=lt}}function Ci(t){return{container:F,slideItems:V,navContainer:at,navItems:ut,controlsContainer:_,hasControls:Pe,prevButton:$,nextButton:tt,items:Pt,slideBy:zt,cloneCount:oe,slideCount:G,slideCountNew:ae,index:pe,indexCached:ve,displayIndex:Je(),navCurrentIndex:dt,navCurrentIndexCached:ft,pages:lt,pagesCached:st,sheet:ee,isOn:X,event:t||{}}}v&&console.warn("No slides found in",M.container)}return Ji}();
!function(){"use strict";function e(t){if(!t)throw new Error("No options passed to Waypoint constructor");if(!t.element)throw new Error("No element option passed to Waypoint constructor");if(!t.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+i,this.options=e.Adapter.extend({},e.defaults,t),this.element=this.options.element,this.adapter=new e.Adapter(this.element),this.callback=t.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=e.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=e.Context.findOrCreateByElement(this.options.context),e.offsetAliases[this.options.offset]&&(this.options.offset=e.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),r[this.key]=this,i+=1}var i=0,r={};e.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},e.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},e.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete r[this.key]},e.prototype.disable=function(){return this.enabled=!1,this},e.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},e.prototype.next=function(){return this.group.next(this)},e.prototype.previous=function(){return this.group.previous(this)},e.invokeAll=function(t){var e,i=[];for(e in r)i.push(r[e]);for(var o=0,n=i.length;o<n;o++)i[o][t]()},e.destroyAll=function(){e.invokeAll("destroy")},e.disableAll=function(){e.invokeAll("disable")},e.enableAll=function(){e.invokeAll("enable")},e.refreshAll=function(){e.Context.refreshAll()},e.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},e.viewportWidth=function(){return document.documentElement.clientWidth},e.adapters=[],e.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},e.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=e}(),function(){"use strict";function e(t){window.setTimeout(t,1e3/60)}function i(t){this.element=t,this.Adapter=d.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+o,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,n[t.waypointContextKey]=this,o+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var o=0,n={},d=window.Waypoint,t=window.onload;i.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},i.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete n[this.key])},i.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,d.requestAnimationFrame(t))})},i.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){e.didScroll&&!d.isTouch||(e.didScroll=!0,d.requestAnimationFrame(t))})},i.prototype.handleResize=function(){d.Context.refreshAll()},i.prototype.handleScroll=function(){var t,e,i={},o={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(t in o){var n,r=o[t],s=r.newScroll>r.oldScroll?r.forward:r.backward;for(n in this.waypoints[t]){var a=this.waypoints[t][n],l=r.oldScroll<a.triggerPoint,h=r.newScroll>=a.triggerPoint;(l&&h||!l&&!h)&&(a.queueTrigger(s),i[a.group.id]=a.group)}}for(e in i)i[e].flushTriggers();this.oldScroll={x:o.horizontal.newScroll,y:o.vertical.newScroll}},i.prototype.innerHeight=function(){return this.element==this.element.window?d.viewportHeight():this.adapter.innerHeight()},i.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},i.prototype.innerWidth=function(){return this.element==this.element.window?d.viewportWidth():this.adapter.innerWidth()},i.prototype.destroy=function(){var t,e=[];for(t in this.waypoints)for(var i in this.waypoints[t])e.push(this.waypoints[t][i]);for(var o=0,n=e.length;o<n;o++)e[o].destroy()},i.prototype.refresh=function(){var t,e,i=this.element==this.element.window,o=i?void 0:this.adapter.offset(),n={};for(e in this.handleScroll(),t={horizontal:{contextOffset:i?0:o.left,contextScroll:i?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:i?0:o.top,contextScroll:i?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}}){var r,s=t[e];for(r in this.waypoints[e]){var a,l=this.waypoints[e][r],h=l.options.offset,p=l.triggerPoint,c=0,u=null==p;l.element!==l.element.window&&(c=l.adapter.offset()[s.offsetProp]),"function"==typeof h?h=h.apply(l):"string"==typeof h&&(h=parseFloat(h),-1<l.options.offset.indexOf("%")&&(h=Math.ceil(s.contextDimension*h/100))),a=s.contextScroll-s.contextOffset,l.triggerPoint=c+a-h,a=p<s.oldScroll,h=l.triggerPoint>=s.oldScroll,p=!a&&!h,!u&&(a&&h)?(l.queueTrigger(s.backward),n[l.group.id]=l.group):(!u&&p||u&&s.oldScroll>=l.triggerPoint)&&(l.queueTrigger(s.forward),n[l.group.id]=l.group)}}return d.requestAnimationFrame(function(){for(var t in n)n[t].flushTriggers()}),this},i.findOrCreateByElement=function(t){return i.findByElement(t)||new i(t)},i.refreshAll=function(){for(var t in n)n[t].refresh()},i.findByElement=function(t){return n[t.waypointContextKey]},window.onload=function(){t&&t(),i.refreshAll()},d.requestAnimationFrame=function(t){(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||e).call(window,t)},d.Context=i}(),function(){"use strict";function r(t,e){return t.triggerPoint-e.triggerPoint}function s(t,e){return e.triggerPoint-t.triggerPoint}function e(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),i[this.axis][this.name]=this}var i={vertical:{},horizontal:{}},o=window.Waypoint;e.prototype.add=function(t){this.waypoints.push(t)},e.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},e.prototype.flushTriggers=function(){for(var t in this.triggerQueues){var e=this.triggerQueues[t];e.sort("up"===t||"left"===t?s:r);for(var i=0,o=e.length;i<o;i+=1){var n=e[i];!n.options.continuous&&i!==e.length-1||n.trigger([t])}}this.clearTriggerQueues()},e.prototype.next=function(t){this.waypoints.sort(r);t=o.Adapter.inArray(t,this.waypoints);return t===this.waypoints.length-1?null:this.waypoints[t+1]},e.prototype.previous=function(t){this.waypoints.sort(r);t=o.Adapter.inArray(t,this.waypoints);return t?this.waypoints[t-1]:null},e.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},e.prototype.remove=function(t){t=o.Adapter.inArray(t,this.waypoints);-1<t&&this.waypoints.splice(t,1)},e.prototype.first=function(){return this.waypoints[0]},e.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},e.findOrCreate=function(t){return i[t.axis][t.name]||new e(t)},o.Group=e}(),function(){"use strict";function i(t){this.$element=o(t)}var o=window.jQuery,t=window.Waypoint;o.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(t,e){i.prototype[e]=function(){var t=Array.prototype.slice.call(arguments);return this.$element[e].apply(this.$element,t)}}),o.each(["extend","inArray","isEmptyObject"],function(t,e){i[e]=o[e]}),t.adapters.push({name:"jquery",Adapter:i}),t.Adapter=i}(),function(){"use strict";function t(o){return function(){var e=[],i=arguments[0];return o.isFunction(arguments[0])&&((i=o.extend({},arguments[1])).handler=arguments[0]),this.each(function(){var t=o.extend({},i,{element:this});"string"==typeof t.context&&(t.context=o(this).closest(t.context)[0]),e.push(new n(t))}),e}}var n=window.Waypoint;window.jQuery&&(window.jQuery.fn.waypoint=t(window.jQuery)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}();
!function(){"use strict";function e(t){this.options=i.extend({},n.defaults,e.defaults,t),this.element=this.options.element,this.$element=i(this.element),this.createWrapper(),this.createWaypoint()}var i=window.jQuery,n=window.Waypoint;e.prototype.createWaypoint=function(){var s=this.options.handler;this.waypoint=new n(i.extend({},this.options,{element:this.wrapper,handler:i.proxy(function(t){var e=-1<this.options.direction.indexOf(t),i=e?this.$element.outerHeight(!0):"";this.$wrapper.height(i),this.$element.toggleClass(this.options.stuckClass,e),s&&s.call(this,t)},this)}))},e.prototype.createWrapper=function(){this.options.wrapper&&this.$element.wrap(this.options.wrapper),this.$wrapper=this.$element.parent(),this.wrapper=this.$wrapper[0]},e.prototype.destroy=function(){this.$element.parent()[0]===this.wrapper&&(this.waypoint.destroy(),this.$element.removeClass(this.options.stuckClass),this.options.wrapper&&this.$element.unwrap())},e.defaults={wrapper:'<div class="sticky-wrapper" />',stuckClass:"stuck",direction:"down right"},n.Sticky=e}();
!function(t){function e(){}function i(a){if(a){var h="undefined"==typeof console?e:function(t){console.error(t)};return a.bridget=function(t,e){var r,s,i;(i=e).prototype.option||(i.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),r=t,s=e,a.fn[r]=function(e){if("string"!=typeof e)return this.each(function(){var t=a.data(this,r);t?(t.option(e),t._init()):(t=new s(this,e),a.data(this,r,t))});for(var t=p.call(arguments,1),i=0,n=this.length;i<n;i++){var o=this[i],o=a.data(o,r);if(o)if(a.isFunction(o[e])&&"_"!==e.charAt(0)){o=o[e].apply(o,t);if(void 0!==o)return o}else h("no such method '"+e+"' for "+r+" instance");else h("cannot call methods on "+r+" prior to initialization; attempted to call '"+e+"'")}return this}},a.bridget}}var p=Array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],i):i("object"==typeof exports?require("jquery"):t.jQuery)}(window),function(t){function i(t){return new RegExp("(^|\\s+)"+t+"(\\s+|$)")}function e(t,e){(n(t,e)?r:o)(t,e)}var n,o,r="classList"in document.documentElement?(n=function(t,e){return t.classList.contains(e)},o=function(t,e){t.classList.add(e)},function(t,e){t.classList.remove(e)}):(n=function(t,e){return i(e).test(t.className)},o=function(t,e){n(t,e)||(t.className=t.className+" "+e)},function(t,e){t.className=t.className.replace(i(e)," ")}),s={hasClass:n,addClass:o,removeClass:r,toggleClass:e,has:n,add:o,remove:r,toggle:e};"function"==typeof define&&define.amd?define("classie/classie",s):"object"==typeof exports?module.exports=s:t.classie=s}(window),function(t){function e(t){if(t){if("string"==typeof r[t])return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e,i=0,n=o.length;i<n;i++)if(e=o[i]+t,"string"==typeof r[e])return e}}var o="Webkit Moz ms Ms O".split(" "),r=document.documentElement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return e}):"object"==typeof exports?module.exports=e:t.getStyleProperty=e}(window),function(w){function _(t){var e=parseFloat(t);return-1===t.indexOf("%")&&!isNaN(e)&&e}function t(g){var v,x,E,b=!1;return function(t){if(b||(b=!0,y=w.getComputedStyle,m=y?function(t){return y(t,null)}:function(t){return t.currentStyle},v=function(t){t=m(t);return t||T("Style returned "+t+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),t},(x=g("boxSizing"))&&((f=document.createElement("div")).style.width="200px",f.style.padding="1px 2px 3px 4px",f.style.borderStyle="solid",f.style.borderWidth="1px 2px 3px 4px",f.style[x]="border-box",(l=document.body||document.documentElement).appendChild(f),d=v(f),E=200===_(d.width),l.removeChild(f))),(t="string"==typeof t?document.querySelector(t):t)&&"object"==typeof t&&t.nodeType){var e=v(t);if("none"===e.display)return function(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0,i=z.length;e<i;e++)t[z[e]]=0;return t}();var i={};i.width=t.offsetWidth,i.height=t.offsetHeight;for(var n=i.isBorderBox=!(!x||!e[x]||"border-box"!==e[x]),o=0,r=z.length;o<r;o++){var s=z[o],a=function(t,e){if(w.getComputedStyle||-1===e.indexOf("%"))return e;var i=t.style,n=i.left,o=t.runtimeStyle,r=o&&o.left;return r&&(o.left=t.currentStyle.left),i.left=e,e=i.pixelLeft,i.left=n,r&&(o.left=r),e}(t,a=e[s]),a=parseFloat(a);i[s]=isNaN(a)?0:a}var h=i.paddingLeft+i.paddingRight,p=i.paddingTop+i.paddingBottom,u=i.marginLeft+i.marginRight,c=i.marginTop+i.marginBottom,d=i.borderLeftWidth+i.borderRightWidth,l=i.borderTopWidth+i.borderBottomWidth,f=n&&E,n=_(e.width);!1!==n&&(i.width=n+(f?0:h+d));n=_(e.height);return!1!==n&&(i.height=n+(f?0:p+l)),i.innerWidth=i.width-(h+d),i.innerHeight=i.height-(p+l),i.outerWidth=i.width+u,i.outerHeight=i.height+c,i}var y,f,l,d,m}}var T="undefined"==typeof console?function(){}:function(t){console.error(t)},z=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],t):"object"==typeof exports?module.exports=t(require("desandro-get-style-property")):w.getSize=t(w.getStyleProperty)}(window),function(i){function n(t){var e=i.event;return e.target=e.target||e.srcElement||t,e}var t=document.documentElement,e=function(){};t.addEventListener?e=function(t,e,i){t.addEventListener(e,i,!1)}:t.attachEvent&&(e=function(e,t,i){e[t+i]=i.handleEvent?function(){var t=n(e);i.handleEvent.call(i,t)}:function(){var t=n(e);i.call(e,t)},e.attachEvent("on"+t,e[t+i])});var o=function(){};t.removeEventListener?o=function(t,e,i){t.removeEventListener(e,i,!1)}:t.detachEvent&&(o=function(e,i,n){e.detachEvent("on"+i,e[i+n]);try{delete e[i+n]}catch(t){e[i+n]=void 0}});o={bind:e,unbind:o};"function"==typeof define&&define.amd?define("eventie/eventie",o):"object"==typeof exports?module.exports=o:i.eventie=o}(window),function(){function t(){}function r(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function e(t){return function(){return this[t].apply(this,arguments)}}var i=t.prototype,n=this,o=n.EventEmitter;i.getListeners=function(t){var e,i,n=this._getEvents();if(t instanceof RegExp)for(i in e={},n)n.hasOwnProperty(i)&&t.test(i)&&(e[i]=n[i]);else e=n[t]||(n[t]=[]);return e},i.flattenListeners=function(t){for(var e=[],i=0;i<t.length;i+=1)e.push(t[i].listener);return e},i.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&((e={})[t]=i),e||i},i.addListener=function(t,e){var i,n=this.getListenersAsObject(t),o="object"==typeof e;for(i in n)n.hasOwnProperty(i)&&-1===r(n[i],e)&&n[i].push(o?e:{listener:e,once:!1});return this},i.on=e("addListener"),i.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},i.once=e("addOnceListener"),i.defineEvent=function(t){return this.getListeners(t),this},i.defineEvents=function(t){for(var e=0;e<t.length;e+=1)this.defineEvent(t[e]);return this},i.removeListener=function(t,e){var i,n,o=this.getListenersAsObject(t);for(n in o)o.hasOwnProperty(n)&&(i=r(o[n],e),-1!==i&&o[n].splice(i,1));return this},i.off=e("removeListener"),i.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},i.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},i.manipulateListeners=function(t,e,i){var n,o,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(n=i.length;n--;)r.call(this,e,i[n]);else for(n in e)e.hasOwnProperty(n)&&(o=e[n])&&("function"==typeof o?r:s).call(this,n,o);return this},i.removeEvent=function(t){var e,i=typeof t,n=this._getEvents();if("string"==i)delete n[t];else if(t instanceof RegExp)for(e in n)n.hasOwnProperty(e)&&t.test(e)&&delete n[e];else delete this._events;return this},i.removeAllListeners=e("removeEvent"),i.emitEvent=function(t,e){var i,n,o,r,s=this.getListenersAsObject(t);for(o in s)if(s.hasOwnProperty(o))for(n=s[o].length;n--;)i=s[o][n],!0===i.once&&this.removeListener(t,i.listener),r=i.listener.apply(this,e||[]),r===this._getOnceReturnValue()&&this.removeListener(t,i.listener);return this},i.trigger=e("emitEvent"),i.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},i.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},i._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},i._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return n.EventEmitter=o,t},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return t}):"object"==typeof module&&module.exports?module.exports=t:n.EventEmitter=t}.call(this),function(e){function i(t){"function"==typeof t&&(i.isReady?t():s.push(t))}function n(t){t="readystatechange"===t.type&&"complete"!==r.readyState;i.isReady||t||o()}function o(){i.isReady=!0;for(var t=0,e=s.length;t<e;t++)(0,s[t])()}function t(t){return"complete"===r.readyState?o():(t.bind(r,"DOMContentLoaded",n),t.bind(r,"readystatechange",n),t.bind(e,"load",n)),i}var r=e.document,s=[];i.isReady=!1,"function"==typeof define&&define.amd?define("doc-ready/doc-ready",["eventie/eventie"],t):"object"==typeof exports?module.exports=t(require("eventie")):e.docReady=t(e.eventie)}(window),function(o){function i(t,e){return t[n](e)}function r(t){t.parentNode||document.createDocumentFragment().appendChild(t)}var t,n=function(){if(o.matches)return"matches";if(o.matchesSelector)return"matchesSelector";for(var t=["webkit","moz","ms","o"],e=0,i=t.length;e<i;e++){var n=t[e]+"MatchesSelector";if(o[n])return n}}();t=n?i(document.createElement("div"),"div")?i:function(t,e){return r(t),i(t,e)}:function(t,e){r(t);for(var i=t.parentNode.querySelectorAll(e),n=0,o=i.length;n<o;n++)if(i[n]===t)return!0;return!1},"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return t}):"object"==typeof exports?module.exports=t:window.matchesSelector=t}(Element.prototype),function(i,n){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["doc-ready/doc-ready","matches-selector/matches-selector"],function(t,e){return n(i,t,e)}):"object"==typeof exports?module.exports=n(i,require("doc-ready"),require("desandro-matches-selector")):i.fizzyUIUtils=n(i,i.docReady,i.matchesSelector)}(window,function(c,t,p){var i,d={extend:function(t,e){for(var i in e)t[i]=e[i];return t},modulo:function(t,e){return(t%e+e)%e}},e=Object.prototype.toString;d.isArray=function(t){return"[object Array]"==e.call(t)},d.makeArray=function(t){var e=[];if(d.isArray(t))e=t;else if(t&&"number"==typeof t.length)for(var i=0,n=t.length;i<n;i++)e.push(t[i]);else e.push(t);return e},d.indexOf=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1},d.removeFrom=function(t,e){e=d.indexOf(t,e);-1!=e&&t.splice(e,1)},d.isElement="function"==typeof HTMLElement||"object"==typeof HTMLElement?function(t){return t instanceof HTMLElement}:function(t){return t&&"object"==typeof t&&1==t.nodeType&&"string"==typeof t.nodeName},d.setText=function(t,e){t[i=i||(void 0!==document.documentElement.textContent?"textContent":"innerText")]=e},d.getParent=function(t,e){for(;t!=document.body;)if(t=t.parentNode,p(t,e))return t},d.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},d.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},d.filterFindElements=function(t,e){for(var i=[],n=0,o=(t=d.makeArray(t)).length;n<o;n++){var r=t[n];if(d.isElement(r))if(e){p(r,e)&&i.push(r);for(var s=r.querySelectorAll(e),a=0,h=s.length;a<h;a++)i.push(s[a])}else i.push(r)}return i},d.debounceMethod=function(t,e,n){var o=t.prototype[e],r=e+"Timeout";t.prototype[e]=function(){var t=this[r];t&&clearTimeout(t);var e=arguments,i=this;this[r]=setTimeout(function(){o.apply(i,e),delete i[r]},n||100)}},d.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var l=c.console;return d.htmlInit=function(p,u){t(function(){for(var t=d.toDashed(u),e=document.querySelectorAll(".js-"+t),i="data-"+t+"-options",n=0,o=e.length;n<o;n++){var r,s=e[n],a=s.getAttribute(i);try{r=a&&JSON.parse(a)}catch(t){l&&l.error("Error parsing "+i+" on "+s.nodeName.toLowerCase()+(s.id?"#"+s.id:"")+": "+t);continue}var h=new p(s,r),a=c.jQuery;a&&a.data(s,u,h)}})},d}),function(o,r){"function"==typeof define&&define.amd?define("outlayer/item",["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property","fizzy-ui-utils/utils"],function(t,e,i,n){return r(o,t,e,i,n)}):"object"==typeof exports?module.exports=r(o,require("wolfy87-eventemitter"),require("get-size"),require("desandro-get-style-property"),require("fizzy-ui-utils")):(o.Outlayer={},o.Outlayer.Item=r(o,o.EventEmitter,o.getSize,o.getStyleProperty,o.fizzyUIUtils))}(window,function(t,e,i,r,n){function o(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}var s=t.getComputedStyle,a=s?function(t){return s(t,null)}:function(t){return t.currentStyle},h=r("transition"),t=r("transform"),t=h&&t,p=!!r("perspective"),u={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[h],c=["transform","transition","transitionDuration","transitionProperty"],d=function(){for(var t={},e=0,i=c.length;e<i;e++){var n=c[e],o=r(n);o&&o!==n&&(t[n]=o)}return t}();n.extend(o.prototype,e.prototype),o.prototype._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},o.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},o.prototype.getSize=function(){this.size=i(this.element)},o.prototype.css=function(t){var e,i=this.element.style;for(e in t)i[d[e]||e]=t[e]},o.prototype.getPosition=function(){var t=a(this.element),e=this.layout.options,i=e.isOriginLeft,n=e.isOriginTop,o=t[i?"left":"right"],e=t[n?"top":"bottom"],t=this.layout.size,o=-1!=o.indexOf("%")?parseFloat(o)/100*t.width:parseInt(o,10),e=-1!=e.indexOf("%")?parseFloat(e)/100*t.height:parseInt(e,10),o=isNaN(o)?0:o,e=isNaN(e)?0:e;o-=i?t.paddingLeft:t.paddingRight,e-=n?t.paddingTop:t.paddingBottom,this.position.x=o,this.position.y=e},o.prototype.layoutPosition=function(){var t=this.layout.size,e=this.layout.options,i={},n=e.isOriginLeft?"paddingLeft":"paddingRight",o=e.isOriginLeft?"left":"right",r=e.isOriginLeft?"right":"left",n=this.position.x+t[n];i[o]=this.getXValue(n),i[r]="";n=e.isOriginTop?"paddingTop":"paddingBottom",r=e.isOriginTop?"top":"bottom",e=e.isOriginTop?"bottom":"top",n=this.position.y+t[n];i[r]=this.getYValue(n),i[e]="",this.css(i),this.emitEvent("layout",[this])},o.prototype.getXValue=function(t){var e=this.layout.options;return e.percentPosition&&!e.isHorizontal?t/this.layout.size.width*100+"%":t+"px"},o.prototype.getYValue=function(t){var e=this.layout.options;return e.percentPosition&&e.isHorizontal?t/this.layout.size.height*100+"%":t+"px"},o.prototype._transitionTo=function(t,e){this.getPosition();var i=this.position.x,n=this.position.y,o=parseInt(t,10),r=parseInt(e,10),r=o===this.position.x&&r===this.position.y;this.setPosition(t,e),!r||this.isTransitioning?((r={}).transform=this.getTranslate(t-i,e-n),this.transition({to:r,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})):this.layoutPosition()},o.prototype.getTranslate=function(t,e){var i=this.layout.options;return t=i.isOriginLeft?t:-t,e=i.isOriginTop?e:-e,p?"translate3d("+t+"px, "+e+"px, 0)":"translate("+t+"px, "+e+"px)"},o.prototype.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},o.prototype.moveTo=t?o.prototype._transitionTo:o.prototype.goTo,o.prototype.setPosition=function(t,e){this.position.x=parseInt(t,10),this.position.y=parseInt(e,10)},o.prototype._nonTransition=function(t){for(var e in this.css(t.to),t.isCleaning&&this._removeStyles(t.to),t.onTransitionEnd)t.onTransitionEnd[e].call(this)},o.prototype._transition=function(t){if(parseFloat(this.layout.options.transitionDuration)){var e,i=this._transn;for(e in t.onTransitionEnd)i.onEnd[e]=t.onTransitionEnd[e];for(e in t.to)i.ingProperties[e]=!0,t.isCleaning&&(i.clean[e]=!0);t.from&&(this.css(t.from),this.element.offsetHeight,0),this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0}else this._nonTransition(t)};var l="opacity,"+(d.transform||"transform").replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()});o.prototype.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:l,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(u,this,!1))},o.prototype.transition=o.prototype[h?"_transition":"_nonTransition"],o.prototype.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},o.prototype.onotransitionend=function(t){this.ontransitionend(t)};var f={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};o.prototype.ontransitionend=function(t){var e,i;t.target===this.element&&(e=this._transn,i=f[t.propertyName]||t.propertyName,delete e.ingProperties[i],function(t){for(var e in t)return;return 1}(e.ingProperties)&&this.disableTransition(),i in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[i]),i in e.onEnd&&(e.onEnd[i].call(this),delete e.onEnd[i]),this.emitEvent("transitionEnd",[this]))},o.prototype.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(u,this,!1),this.isTransitioning=!1},o.prototype._removeStyles=function(t){var e,i={};for(e in t)i[e]="";this.css(i)};var y={transitionProperty:"",transitionDuration:""};return o.prototype.removeTransitionStyles=function(){this.css(y)},o.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},o.prototype.remove=function(){var t;h&&parseFloat(this.layout.options.transitionDuration)?((t=this).once("transitionEnd",function(){t.removeElem()}),this.hide()):this.removeElem()},o.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={};e[this.getHideRevealTransitionEndProperty("visibleStyle")]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},o.prototype.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},o.prototype.getHideRevealTransitionEndProperty=function(t){var e,t=this.layout.options[t];if(t.opacity)return"opacity";for(e in t)return e},o.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={};e[this.getHideRevealTransitionEndProperty("hiddenStyle")]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},o.prototype.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},o.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},o}),function(r,s){"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","eventEmitter/EventEmitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(t,e,i,n,o){return s(r,t,e,i,n,o)}):"object"==typeof exports?module.exports=s(r,require("eventie"),require("wolfy87-eventemitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):r.Outlayer=s(r,r.eventie,r.EventEmitter,r.getSize,r.fizzyUIUtils,r.Outlayer.Item)}(window,function(t,e,i,o,r,n){function s(t,e){var i=r.getQueryElement(t);i?(this.element=i,p&&(this.$element=p(this.element)),this.options=r.extend({},this.constructor.defaults),this.option(e),e=++u,this.element.outlayerGUID=e,(c[e]=this)._create(),this.options.isInitLayout&&this.layout()):h&&h.error("Bad element for "+this.constructor.namespace+": "+(i||t))}function a(){}var h=t.console,p=t.jQuery,u=0,c={};return s.namespace="outlayer",s.Item=n,s.defaults={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,isResizingContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},r.extend(s.prototype,i.prototype),s.prototype.option=function(t){r.extend(this.options,t)},s.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),r.extend(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},s.prototype.reloadItems=function(){this.items=this._itemize(this.element.children)},s.prototype._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,n=[],o=0,r=e.length;o<r;o++){var s=new i(e[o],this);n.push(s)}return n},s.prototype._filterFindItemElements=function(t){return r.filterFindElements(t,this.options.itemSelector)},s.prototype.getItemElements=function(){for(var t=[],e=0,i=this.items.length;e<i;e++)t.push(this.items[e].element);return t},s.prototype._init=s.prototype.layout=function(){this._resetLayout(),this._manageStamps();var t=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,t),this._isLayoutInited=!0},s.prototype._resetLayout=function(){this.getSize()},s.prototype.getSize=function(){this.size=o(this.element)},s.prototype._getMeasurement=function(t,e){var i,n=this.options[t];n?("string"==typeof n?i=this.element.querySelector(n):r.isElement(n)&&(i=n),this[t]=i?o(i)[e]:n):this[t]=0},s.prototype.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},s.prototype._getItemsForLayout=function(t){for(var e=[],i=0,n=t.length;i<n;i++){var o=t[i];o.isIgnored||e.push(o)}return e},s.prototype._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){for(var i=[],n=0,o=t.length;n<o;n++){var r=t[n],s=this._getItemLayoutPosition(r);s.item=r,s.isInstant=e||r.isLayoutInstant,i.push(s)}this._processLayoutQueue(i)}},s.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},s.prototype._processLayoutQueue=function(t){for(var e=0,i=t.length;e<i;e++){var n=t[e];this._positionItem(n.item,n.x,n.y,n.isInstant)}},s.prototype._positionItem=function(t,e,i,n){n?t.goTo(e,i):t.moveTo(e,i)},s.prototype._postLayout=function(){this.resizeContainer()},s.prototype.resizeContainer=function(){var t;!this.options.isResizingContainer||(t=this._getContainerSize())&&(this._setContainerMeasure(t.width,!0),this._setContainerMeasure(t.height,!1))},s.prototype._getContainerSize=a,s.prototype._setContainerMeasure=function(t,e){var i;void 0!==t&&((i=this.size).isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px")},s.prototype._emitCompleteOnItems=function(t,e){function i(){o.dispatchEvent(t+"Complete",null,[e])}function n(){++s===r&&i()}var o=this,r=e.length;if(e&&r)for(var s=0,a=0,h=e.length;a<h;a++)e[a].once(t,n);else i()},s.prototype.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;this.emitEvent(t,n),p&&(this.$element=this.$element||p(this.element),e?((e=p.Event(e)).type=t,this.$element.trigger(e,i)):this.$element.trigger(t,i))},s.prototype.ignore=function(t){t=this.getItem(t);t&&(t.isIgnored=!0)},s.prototype.unignore=function(t){t=this.getItem(t);t&&delete t.isIgnored},s.prototype.stamp=function(t){if(t=this._find(t)){this.stamps=this.stamps.concat(t);for(var e=0,i=t.length;e<i;e++){var n=t[e];this.ignore(n)}}},s.prototype.unstamp=function(t){if(t=this._find(t))for(var e=0,i=t.length;e<i;e++){var n=t[e];r.removeFrom(this.stamps,n),this.unignore(n)}},s.prototype._find=function(t){return t?("string"==typeof t&&(t=this.element.querySelectorAll(t)),r.makeArray(t)):void 0},s.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var t=0,e=this.stamps.length;t<e;t++){var i=this.stamps[t];this._manageStamp(i)}}},s.prototype._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},s.prototype._manageStamp=a,s.prototype._getElementOffset=function(t){var e=t.getBoundingClientRect(),i=this._boundingRect,t=o(t);return{left:e.left-i.left-t.marginLeft,top:e.top-i.top-t.marginTop,right:i.right-e.right-t.marginRight,bottom:i.bottom-e.bottom-t.marginBottom}},s.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},s.prototype.bindResize=function(){this.isResizeBound||(e.bind(t,"resize",this),this.isResizeBound=!0)},s.prototype.unbindResize=function(){this.isResizeBound&&e.unbind(t,"resize",this),this.isResizeBound=!1},s.prototype.onresize=function(){this.resizeTimeout&&clearTimeout(this.resizeTimeout);var t=this;this.resizeTimeout=setTimeout(function(){t.resize(),delete t.resizeTimeout},100)},s.prototype.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},s.prototype.needsResizeLayout=function(){var t=o(this.element);return this.size&&t&&t.innerWidth!==this.size.innerWidth},s.prototype.addItems=function(t){t=this._itemize(t);return t.length&&(this.items=this.items.concat(t)),t},s.prototype.appended=function(t){t=this.addItems(t);t.length&&(this.layoutItems(t,!0),this.reveal(t))},s.prototype.prepended=function(t){var e=this._itemize(t);e.length&&(t=this.items.slice(0),this.items=e.concat(t),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(t))},s.prototype.reveal=function(t){this._emitCompleteOnItems("reveal",t);for(var e=t&&t.length,i=0;e&&i<e;i++)t[i].reveal()},s.prototype.hide=function(t){this._emitCompleteOnItems("hide",t);for(var e=t&&t.length,i=0;e&&i<e;i++)t[i].hide()},s.prototype.revealItemElements=function(t){t=this.getItems(t);this.reveal(t)},s.prototype.hideItemElements=function(t){t=this.getItems(t);this.hide(t)},s.prototype.getItem=function(t){for(var e=0,i=this.items.length;e<i;e++){var n=this.items[e];if(n.element===t)return n}},s.prototype.getItems=function(t){for(var e=[],i=0,n=(t=r.makeArray(t)).length;i<n;i++){var o=t[i],o=this.getItem(o);o&&e.push(o)}return e},s.prototype.remove=function(t){var e=this.getItems(t);if(this._emitCompleteOnItems("remove",e),e&&e.length)for(var i=0,n=e.length;i<n;i++){var o=e[i];o.remove(),r.removeFrom(this.items,o)}},s.prototype.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="";for(var e=0,i=this.items.length;e<i;e++)this.items[e].destroy();this.unbindResize();t=this.element.outlayerGUID;delete c[t],delete this.element.outlayerGUID,p&&p.removeData(this.element,this.constructor.namespace)},s.data=function(t){t=(t=r.getQueryElement(t))&&t.outlayerGUID;return t&&c[t]},s.create=function(t,e){function i(){s.apply(this,arguments)}return Object.create?i.prototype=Object.create(s.prototype):r.extend(i.prototype,s.prototype),(i.prototype.constructor=i).defaults=r.extend({},s.defaults),r.extend(i.defaults,e),i.prototype.settings={},i.namespace=t,i.data=s.data,(i.Item=function(){n.apply(this,arguments)}).prototype=new n,r.htmlInit(i,t),p&&p.bridget&&p.bridget(t,i),i},s.Item=n,s}),function(t,e){"function"==typeof define&&define.amd?define("packery/js/rect",e):"object"==typeof exports?module.exports=e():(t.Packery=t.Packery||{},t.Packery.Rect=e())}(window,function(){function a(t){for(var e in a.defaults)this[e]=a.defaults[e];for(e in t)this[e]=t[e]}return((window.Packery=function(){}).Rect=a).defaults={x:0,y:0,width:0,height:0},a.prototype.contains=function(t){var e=t.width||0,i=t.height||0;return this.x<=t.x&&this.y<=t.y&&this.x+this.width>=t.x+e&&this.y+this.height>=t.y+i},a.prototype.overlaps=function(t){var e=this.x+this.width,i=this.y+this.height,n=t.x+t.width,o=t.y+t.height;return this.x<n&&e>t.x&&this.y<o&&i>t.y},a.prototype.getMaximalFreeRects=function(t){if(!this.overlaps(t))return!1;var e,i=[],n=this.x+this.width,o=this.y+this.height,r=t.x+t.width,s=t.y+t.height;return this.y<t.y&&(e=new a({x:this.x,y:this.y,width:this.width,height:t.y-this.y}),i.push(e)),r<n&&(e=new a({x:r,y:this.y,width:n-r,height:this.height}),i.push(e)),s<o&&(e=new a({x:this.x,y:s,width:this.width,height:o-s}),i.push(e)),this.x<t.x&&(e=new a({x:this.x,y:this.y,width:t.x-this.x,height:this.height}),i.push(e)),i},a.prototype.canFit=function(t){return this.width>=t.width&&this.height>=t.height},a}),function(t,e){"function"==typeof define&&define.amd?define("packery/js/packer",["./rect"],e):"object"==typeof exports?module.exports=e(require("./rect")):(t=t.Packery=t.Packery||{}).Packer=e(t.Rect)}(window,function(e){function t(t,e,i){this.width=t||0,this.height=e||0,this.sortDirection=i||"downwardLeftToRight",this.reset()}t.prototype.reset=function(){this.spaces=[],this.newSpaces=[];var t=new e({x:0,y:0,width:this.width,height:this.height});this.spaces.push(t),this.sorter=i[this.sortDirection]||i.downwardLeftToRight},t.prototype.pack=function(t){for(var e=0,i=this.spaces.length;e<i;e++){var n=this.spaces[e];if(n.canFit(t)){this.placeInSpace(t,n);break}}},t.prototype.placeInSpace=function(t,e){t.x=e.x,t.y=e.y,this.placed(t)},t.prototype.placed=function(t){for(var e=[],i=0,n=this.spaces.length;i<n;i++){var o=this.spaces[i],r=o.getMaximalFreeRects(t);r?e.push.apply(e,r):e.push(o)}this.spaces=e,this.mergeSortSpaces()},t.prototype.mergeSortSpaces=function(){t.mergeRects(this.spaces),this.spaces.sort(this.sorter)},t.prototype.addSpace=function(t){this.spaces.push(t),this.mergeSortSpaces()},t.mergeRects=function(t){for(var e=0,i=t.length;e<i;e++){var n=t[e];if(n){var o=t.slice(0);o.splice(e,1);for(var r=0,s=0,a=o.length;s<a;s++){var h=o[s],p=s<e?0:1;n.contains(h)&&(t.splice(s+p-r,1),r++)}}}return t};var i={downwardLeftToRight:function(t,e){return t.y-e.y||t.x-e.x},rightwardTopToBottom:function(t,e){return t.x-e.x||t.y-e.y}};return t}),function(t,e){"function"==typeof define&&define.amd?define("packery/js/item",["get-style-property/get-style-property","outlayer/outlayer","./rect"],e):"object"==typeof exports?module.exports=e(require("desandro-get-style-property"),require("outlayer"),require("./rect")):t.Packery.Item=e(t.getStyleProperty,t.Outlayer,t.Packery.Rect)}(window,function(t,e,i){var n=t("transform"),t=function(){e.Item.apply(this,arguments)},o=(t.prototype=new e.Item)._create;return t.prototype._create=function(){o.call(this),this.rect=new i,this.placeRect=new i},t.prototype.dragStart=function(){this.getPosition(),this.removeTransitionStyles(),this.isTransitioning&&n&&(this.element.style[n]="none"),this.getSize(),this.isPlacing=!0,this.needsPositioning=!1,this.positionPlaceRect(this.position.x,this.position.y),this.isTransitioning=!1,this.didDrag=!1},t.prototype.dragMove=function(t,e){this.didDrag=!0;var i=this.layout.size;t-=i.paddingLeft,e-=i.paddingTop,this.positionPlaceRect(t,e)},t.prototype.dragStop=function(){this.getPosition();var t=this.position.x!=this.placeRect.x,e=this.position.y!=this.placeRect.y;this.needsPositioning=t||e,this.didDrag=!1},t.prototype.positionPlaceRect=function(t,e,i){this.placeRect.x=this.getPlaceRectCoord(t,!0),this.placeRect.y=this.getPlaceRectCoord(e,!1,i)},t.prototype.getPlaceRectCoord=function(t,e,i){var n=e?"Width":"Height",o=this.size["outer"+n],r=this.layout[e?"columnWidth":"rowHeight"],n=this.layout.size["inner"+n];return e||(n=Math.max(n,this.layout.maxY),this.layout.rowHeight||(n-=this.layout.gutter)),o=r?(r+=this.layout.gutter,n+=e?this.layout.gutter:0,t=Math.round(t/r),e=this.layout.options.isHorizontal?e?"ceil":"floor":e?"floor":"ceil",e=Math[e](n/r),e-=Math.ceil(o/r)):n-o,t=i?t:Math.min(t,o),t*=r||1,Math.max(0,t)},t.prototype.copyPlaceRectPosition=function(){this.rect.x=this.placeRect.x,this.rect.y=this.placeRect.y},t.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.layout.packer.addSpace(this.rect),this.emitEvent("remove",[this])},t}),function(t,e){"function"==typeof define&&define.amd?define(["classie/classie","get-size/get-size","outlayer/outlayer","packery/js/rect","packery/js/packer","packery/js/item"],e):"object"==typeof exports?module.exports=e(require("desandro-classie"),require("get-size"),require("outlayer"),require("./rect"),require("./packer"),require("./item")):t.Packery=e(t.classie,t.getSize,t.Outlayer,t.Packery.Rect,t.Packery.Packer,t.Packery.Item)}(window,function(s,n,t,o,e,i){function r(t,e){return t.position.y-e.position.y||t.position.x-e.position.x}function a(t,e){return t.position.x-e.position.x||t.position.y-e.position.y}o.prototype.canFit=function(t){return this.width>=t.width-1&&this.height>=t.height-1};var h=t.create("packery");return h.Item=i,h.prototype._create=function(){t.prototype._create.call(this),this.packer=new e,this.stamp(this.options.stamped);var i=this;this.handleDraggabilly={dragStart:function(){i.itemDragStart(this.element)},dragMove:function(){i.itemDragMove(this.element,this.position.x,this.position.y)},dragEnd:function(){i.itemDragEnd(this.element)}},this.handleUIDraggable={start:function(t,e){e&&i.itemDragStart(t.currentTarget)},drag:function(t,e){e&&i.itemDragMove(t.currentTarget,e.position.left,e.position.top)},stop:function(t,e){e&&i.itemDragEnd(t.currentTarget)}}},h.prototype._resetLayout=function(){this.getSize(),this._getMeasurements();var t=this.packer;this.options.isHorizontal?(t.width=Number.POSITIVE_INFINITY,t.height=this.size.innerHeight+this.gutter,t.sortDirection="rightwardTopToBottom"):(t.width=this.size.innerWidth+this.gutter,t.height=Number.POSITIVE_INFINITY,t.sortDirection="downwardLeftToRight"),t.reset(),this.maxY=0,this.maxX=0},h.prototype._getMeasurements=function(){this._getMeasurement("columnWidth","width"),this._getMeasurement("rowHeight","height"),this._getMeasurement("gutter","width")},h.prototype._getItemLayoutPosition=function(t){return this._packItem(t),t.rect},h.prototype._packItem=function(t){this._setRectSize(t.element,t.rect),this.packer.pack(t.rect),this._setMaxXY(t.rect)},h.prototype._setMaxXY=function(t){this.maxX=Math.max(t.x+t.width,this.maxX),this.maxY=Math.max(t.y+t.height,this.maxY)},h.prototype._setRectSize=function(t,e){var i=n(t),t=i.outerWidth,i=i.outerHeight;(t||i)&&(t=this._applyGridGutter(t,this.columnWidth),i=this._applyGridGutter(i,this.rowHeight)),e.width=Math.min(t,this.packer.width),e.height=Math.min(i,this.packer.height)},h.prototype._applyGridGutter=function(t,e){if(!e)return t+this.gutter;var i=t%(e+=this.gutter);return Math[i&&i<1?"round":"ceil"](t/e)*e},h.prototype._getContainerSize=function(){return this.options.isHorizontal?{width:this.maxX-this.gutter}:{height:this.maxY-this.gutter}},h.prototype._manageStamp=function(t){var e,i=this.getItem(t);e=i&&i.isPlacing?i.placeRect:(e=this._getElementOffset(t),new o({x:this.options.isOriginLeft?e.left:e.right,y:this.options.isOriginTop?e.top:e.bottom})),this._setRectSize(t,e),this.packer.placed(e),this._setMaxXY(e)},h.prototype.sortItemsByPosition=function(){var t=this.options.isHorizontal?a:r;this.items.sort(t)},h.prototype.fit=function(t,e,i){t=this.getItem(t);t&&(this._getMeasurements(),this.stamp(t.element),t.getSize(),t.isPlacing=!0,e=void 0===e?t.rect.x:e,i=void 0===i?t.rect.y:i,t.positionPlaceRect(e,i,!0),this._bindFitEvents(t),t.moveTo(t.placeRect.x,t.placeRect.y),this.layout(),this.unstamp(t.element),this.sortItemsByPosition(),t.isPlacing=!1,t.copyPlaceRectPosition())},h.prototype._bindFitEvents=function(t){function e(){2==++n&&i.dispatchEvent("fitComplete",null,[t])}var i=this,n=0;t.on("layout",function(){return e(),!0}),this.on("layoutComplete",function(){return e(),!0})},h.prototype.resize=function(){var t=n(this.element),e=this.size&&t,i=this.options.isHorizontal?"innerHeight":"innerWidth";e&&t[i]==this.size[i]||this.layout()},h.prototype.itemDragStart=function(t){this.stamp(t);t=this.getItem(t);t&&t.dragStart()},h.prototype.itemDragMove=function(t,e,i){t=this.getItem(t);t&&t.dragMove(e,i);var n=this;this.clearDragTimeout(),this.dragTimeout=setTimeout(function(){n.layout(),delete n.dragTimeout},40)},h.prototype.clearDragTimeout=function(){this.dragTimeout&&clearTimeout(this.dragTimeout)},h.prototype.itemDragEnd=function(t){var e,i=this.getItem(t);i&&(e=i.didDrag,i.dragStop()),i&&(e||i.needsPositioning)?(s.add(i.element,"is-positioning-post-drag"),e=this._getDragEndLayoutComplete(t,i),i.needsPositioning?(i.on("layout",e),i.moveTo(i.placeRect.x,i.placeRect.y)):i&&i.copyPlaceRectPosition(),this.clearDragTimeout(),this.on("layoutComplete",e),this.layout()):this.unstamp(t)},h.prototype._getDragEndLayoutComplete=function(t,e){var i=e&&e.needsPositioning,n=0,o=i?2:1,r=this;return function(){return++n!=o||(e&&(s.remove(e.element,"is-positioning-post-drag"),e.isPlacing=!1,e.copyPlaceRectPosition()),r.unstamp(t),r.sortItemsByPosition(),i&&r.dispatchEvent("dragItemPositioned",null,[e])),!0}},h.prototype.bindDraggabillyEvents=function(t){t.on("dragStart",this.handleDraggabilly.dragStart),t.on("dragMove",this.handleDraggabilly.dragMove),t.on("dragEnd",this.handleDraggabilly.dragEnd)},h.prototype.bindUIDraggableEvents=function(t){t.on("dragstart",this.handleUIDraggable.start).on("drag",this.handleUIDraggable.drag).on("dragstop",this.handleUIDraggable.stop)},h.Rect=o,h.Packer=e,h});
(function(){function e(){}function o(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function t(e){return function(){return this[e].apply(this,arguments)}}var n=e.prototype,i=this,r=i.EventEmitter;n.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e)for(n in t={},i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n]);else t=i[e]||(i[e]=[]);return t},n.flattenListeners=function(e){for(var t=[],n=0;e.length>n;n+=1)t.push(e[n].listener);return t},n.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&((t={})[e]=n),t||n},n.addListener=function(e,t){var n,i=this.getListenersAsObject(e),r="object"==typeof t;for(n in i)i.hasOwnProperty(n)&&-1===o(i[n],t)&&i[n].push(r?t:{listener:t,once:!1});return this},n.on=t("addListener"),n.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},n.once=t("addOnceListener"),n.defineEvent=function(e){return this.getListeners(e),this},n.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},n.removeListener=function(e,t){var n,i,r=this.getListenersAsObject(e);for(i in r)r.hasOwnProperty(i)&&(n=o(r[i],t),-1!==n&&r[i].splice(n,1));return this},n.off=t("removeListener"),n.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},n.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},n.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o:s).call(this,i,r);return this},n.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"==n)delete i[e];else if("object"==n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},n.removeAllListeners=t("removeEvent"),n.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],!0===n.once&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},n.trigger=t("emitEvent"),n.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},n.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},n._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},n._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return i.EventEmitter=r,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(n){function i(e){var t=n.event;return t.target=t.target||t.srcElement||e,t}var e=document.documentElement,t=function(){};e.addEventListener?t=function(e,t,n){e.addEventListener(t,n,!1)}:e.attachEvent&&(t=function(t,e,n){t[e+n]=n.handleEvent?function(){var e=i(t);n.handleEvent.call(n,e)}:function(){var e=i(t);n.call(t,e)},t.attachEvent("on"+e,t[e+n])});var r=function(){};e.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:e.detachEvent&&(r=function(t,n,i){t.detachEvent("on"+n,t[n+i]);try{delete t[n+i]}catch(e){t[n+i]=void 0}});r={bind:t,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",r):n.eventie=r}(this),function(n,i){"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(e,t){return i(n,e,t)}):"object"==typeof exports?module.exports=i(n,require("wolfy87-eventemitter"),require("eventie")):n.imagesLoaded=i(n,n.EventEmitter,n.eventie)}(window,function(e,t,n){function r(e,t){for(var n in t)e[n]=t[n];return e}function o(e){var t=[];if("[object Array]"===u.call(e))t=e;else if("number"==typeof e.length)for(var n=0,i=e.length;n<i;n++)t.push(e[n]);else t.push(e);return t}function s(e,t,n){if(!(this instanceof s))return new s(e,t);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=o(e),this.options=r({},this.options),"function"==typeof t?n=t:r(this.options,t),n&&this.on("always",n),this.getImages(),f&&(this.jqDeferred=new f.Deferred);var i=this;setTimeout(function(){i.check()})}function i(e){this.img=e}function c(e){this.src=e,d[e]=this}var f=e.jQuery,h=e.console,a=void 0!==h,u=Object.prototype.toString;(s.prototype=new t).options={},s.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;e<t;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);var i=n.nodeType;if(i&&(1===i||9===i||11===i))for(var r=n.querySelectorAll("img"),o=0,s=r.length;o<s;o++){var c=r[o];this.addImage(c)}}},s.prototype.addImage=function(e){e=new i(e);this.images.push(e)},s.prototype.check=function(){function e(e,t){return n.options.debug&&a&&h.log("confirm",e,t),n.progress(e),++i===r&&n.complete(),!0}var n=this,i=0,r=this.images.length;if(this.hasAnyBroken=!1,r)for(var t=0;t<r;t++){var o=this.images[t];o.on("confirm",e),o.check()}else this.complete()},s.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify&&t.jqDeferred.notify(t,e)})},s.prototype.complete=function(){var t=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var n=this;setTimeout(function(){var e;n.emit(t,n),n.emit("always",n),n.jqDeferred&&(e=n.hasAnyBroken?"reject":"resolve",n.jqDeferred[e](n))})},f&&(f.fn.imagesLoaded=function(e,t){return new s(this,e,t).jqDeferred.promise(f(this))}),(i.prototype=new t).check=function(){var n,e=d[this.img.src]||new c(this.img.src);e.isConfirmed?this.confirm(e.isLoaded,"cached was confirmed"):this.img.complete&&void 0!==this.img.naturalWidth?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(n=this,e.on("confirm",function(e,t){return n.confirm(e.isLoaded,t),!0}),e.check())},i.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};var d={};return(c.prototype=new t).check=function(){var e;this.isChecked||(e=new Image,n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0)},c.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},c.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},c.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},c.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit("confirm",this,t)},c.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},s});
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(r){function s(t){return parseFloat(t)||0}function l(t){var t=r(t),n=null,i=[];return t.each(function(){var t=r(this),e=t.offset().top-s(t.css("margin-top")),o=0<i.length?i[i.length-1]:null;null!==o&&Math.floor(Math.abs(n-e))<=1?i[i.length-1]=o.add(t):i.push(t),n=e}),i}function c(t){var e={byRow:!0,property:"height",target:null,remove:!1};return"object"==typeof t?r.extend(e,t):("boolean"==typeof t?e.byRow=t:"remove"===t&&(e.remove=!0),e)}var n=-1,i=-1,h=r.fn.matchHeight=function(t){t=c(t);if(t.remove){var o=this;return this.css(t.property,""),r.each(h._groups,function(t,e){e.elements=e.elements.not(o)}),this}return this.length<=1&&!t.target||(h._groups.push({elements:this,options:t}),h._apply(this,t)),this};h.version="0.7.2",h._groups=[],h._throttle=80,h._maintainScroll=!1,h._beforeUpdate=null,h._afterUpdate=null,h._rows=l,h._parse=s,h._parseOptions=c,h._apply=function(t,e){var i=c(e),o=r(t),n=[o],a=r(window).scrollTop(),e=r("html").outerHeight(!0),t=o.parents().filter(":hidden");return t.each(function(){var t=r(this);t.data("style-cache",t.attr("style"))}),t.css("display","block"),i.byRow&&!i.target&&(o.each(function(){var t=r(this),e=t.css("display");"inline-block"!==e&&"flex"!==e&&"inline-flex"!==e&&(e="block"),t.data("style-cache",t.attr("style")),t.css({display:e,"padding-top":"0","padding-bottom":"0","margin-top":"0","margin-bottom":"0","border-top-width":"0","border-bottom-width":"0",height:"100px",overflow:"hidden"})}),n=l(o),o.each(function(){var t=r(this);t.attr("style",t.data("style-cache")||"")})),r.each(n,function(t,e){var e=r(e),n=0;if(i.target)n=i.target.outerHeight(!1);else{if(i.byRow&&e.length<=1)return void e.css(i.property,"");e.each(function(){var t=r(this),e=t.attr("style"),o=t.css("display"),o={display:o="inline-block"!==o&&"flex"!==o&&"inline-flex"!==o?"block":o};o[i.property]="",t.css(o),t.outerHeight(!1)>n&&(n=t.outerHeight(!1)),e?t.attr("style",e):t.css("display","")})}e.each(function(){var t=r(this),e=0;i.target&&t.is(i.target)||("border-box"!==t.css("box-sizing")&&(e+=s(t.css("border-top-width"))+s(t.css("border-bottom-width")),e+=s(t.css("padding-top"))+s(t.css("padding-bottom"))),t.css(i.property,n-e+"px"))})}),t.each(function(){var t=r(this);t.attr("style",t.data("style-cache")||null)}),h._maintainScroll&&r(window).scrollTop(a/e*r("html").outerHeight(!0)),this},h._applyDataApi=function(){var o={};r("[data-match-height], [data-mh]").each(function(){var t=r(this),e=t.attr("data-mh")||t.attr("data-match-height");e in o?o[e]=o[e].add(t):o[e]=t}),r.each(o,function(){this.matchHeight(!0)})};function a(t){h._beforeUpdate&&h._beforeUpdate(t,h._groups),r.each(h._groups,function(){h._apply(this.elements,this.options)}),h._afterUpdate&&h._afterUpdate(t,h._groups)}h._update=function(t,e){if(e&&"resize"===e.type){var o=r(window).width();if(o===n)return;n=o}t?-1===i&&(i=setTimeout(function(){a(e),i=-1},h._throttle)):a(e)},r(h._applyDataApi);var t=r.fn.on?"on":"bind";r(window)[t]("load",function(t){h._update(!1,t)}),r(window)[t]("resize orientationchange",function(t){h._update(!0,t)})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("global/window"),require("global/document")):"function"==typeof define&&define.amd?define(["global/window","global/document"],t):(e=e||self).videojs=t(e.window,e.document)}(this,function(d,h){"use strict";d=d&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d,h=h&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h;var u="7.9.5",l=[];var p=function t(i){function n(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];r("log",o,t)}var r,s,a,o="info";return s=i,r=function(e,t,i){var n,r=a.levels[t],t=new RegExp("^("+r+")$");"log"!==e&&i.unshift(e.toUpperCase()+":"),i.unshift(s+":"),l&&(l.push([].concat(i)),n=l.length-1e3,l.splice(0,0<n?n:0)),!d.console||(n=(n=d.console[e])||"debug"!==e?n:d.console.info||d.console.log)&&r&&t.test(e)&&n[Array.isArray(i)?"apply":"call"](d.console,i)},(a=n).createLogger=function(e){return t(i+": "+e)},n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:o},n.level=function(e){if("string"==typeof e){if(!n.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');o=e}return o},(n.history=function(){return l?[].concat(l):[]}).filter=function(t){return(l||[]).filter(function(e){return new RegExp(".*"+t+".*").test(e[0])})},n.history.clear=function(){l&&(l.length=0)},n.history.disable=function(){null!==l&&(l.length=0,l=null)},n.history.enable=function(){null===l&&(l=[])},n.error=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return r("error",o,t)},n.warn=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return r("warn",o,t)},n.debug=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return r("debug",o,t)},n}("VIDEOJS"),f=p.createLogger;function e(e,t){return e(t={exports:{}},t.exports),t.exports}function s(e){return o(e)?Object.keys(e):[]}var r=e(function(e){function t(){return e.exports=t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i,n=arguments[t];for(i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},t.apply(this,arguments)}e.exports=t}),t=Object.prototype.toString;function a(t,i){s(t).forEach(function(e){return i(t[e],e)})}function m(i){for(var e=arguments.length,t=new Array(1<e?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return Object.assign?r.apply(void 0,[i].concat(t)):(t.forEach(function(e){e&&a(e,function(e,t){i[t]=e})}),i)}function o(e){return!!e&&"object"==typeof e}function c(e){return o(e)&&"[object Object]"===t.call(e)&&e.constructor===Object}function n(e,t){if(!e||!t)return"";if("function"!=typeof d.getComputedStyle)return"";e=d.getComputedStyle(e);return e?e.getPropertyValue(t)||e[t]:""}function g(e){return"string"==typeof e&&Boolean(e.trim())}function i(e){if(0<=e.indexOf(" "))throw new Error("class has illegal whitespace characters")}function y(){return h===d.document}function v(e){return o(e)&&1===e.nodeType}function _(){try{return d.parent!==d.self}catch(e){return!0}}function b(i){return function(e,t){if(!g(e))return h[i](null);t=v(t=g(t)?h.querySelector(t):t)?t:h;return t[i]&&t[i](e)}}function T(e,i,t,n){void 0===i&&(i={}),void 0===t&&(t={});var r=h.createElement(e=void 0===e?"div":e);return Object.getOwnPropertyNames(i).forEach(function(e){var t=i[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(p.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+e+" to "+t+"."),r.setAttribute(e,t)):"textContent"===e?S(r,t):r[e]!==t&&(r[e]=t)}),Object.getOwnPropertyNames(t).forEach(function(e){r.setAttribute(e,t[e])}),n&&H(r,n),r}function S(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function k(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function C(e,t){return i(t),e.classList?e.classList.contains(t):new RegExp("(^|\\s)"+t+"($|\\s)").test(e.className)}function E(e,t){return e.classList?e.classList.add(t):C(e,t)||(e.className=(e.className+" "+t).trim()),e}function w(e,t){return e.classList?e.classList.remove(t):(i(t),e.className=e.className.split(/\s+/).filter(function(e){return e!==t}).join(" ")),e}function A(e,t,i){var n=C(e,t);if((i="boolean"!=typeof(i="function"==typeof i?i(e,t):i)?!n:i)!==n)return(i?E:w)(e,t),e}function I(i,n){Object.getOwnPropertyNames(n).forEach(function(e){var t=n[e];null==t||!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})}function P(e){var t={},i=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&0<e.attributes.length)for(var n=e.attributes,r=n.length-1;0<=r;r--){var s=n[r].name,a=n[r].value;"boolean"!=typeof e[s]&&-1===i.indexOf(","+s+",")||(a=null!==a),t[s]=a}return t}function x(e,t){return e.getAttribute(t)}function L(e,t,i){e.setAttribute(t,i)}function O(e,t){e.removeAttribute(t)}function D(){h.body.focus(),h.onselectstart=function(){return!1}}function N(){h.onselectstart=function(){return!0}}function R(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach(function(e){void 0!==t[e]&&(i[e]=t[e])}),i.height||(i.height=parseFloat(n(e,"height"))),i.width||(i.width=parseFloat(n(e,"width"))),i}}function U(e){if(!e||!e.offsetParent)return{left:0,top:0,width:0,height:0};for(var t=e.offsetWidth,i=e.offsetHeight,n=0,r=0;n+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;);return{left:n,top:r,width:t,height:i}}function M(e,t){var i={},n=U(t.target),r=U(e),s=r.width,a=r.height,e=t.offsetY-(r.top-n.top),n=t.offsetX-(r.left-n.left);return t.changedTouches&&(n=t.changedTouches[0].pageX-r.left,e=t.changedTouches[0].pageY+r.top),i.y=Math.max(0,Math.min(1,(e+a)/a)),i.x=Math.max(0,Math.min(1,n/s)),i}function B(e){return o(e)&&3===e.nodeType}function j(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function F(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(function(e){return v(e="function"==typeof e?e():e)||B(e)?e:"string"==typeof e&&/\S/.test(e)?h.createTextNode(e):void 0}).filter(function(e){return e})}function H(t,e){return F(e).forEach(function(e){return t.appendChild(e)}),t}function V(e,t){return H(j(e),t)}function q(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||("mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons))}function W(){if(y()&&!1!==z.options.autoSetup){var e=Array.prototype.slice.call(h.getElementsByTagName("video")),t=Array.prototype.slice.call(h.getElementsByTagName("audio")),i=Array.prototype.slice.call(h.getElementsByTagName("video-js")),n=e.concat(t,i);if(n&&0<n.length)for(var r=0,s=n.length;r<s;r++){var a=n[r];if(!a||!a.getAttribute){$(1);break}void 0===a.player&&null!==a.getAttribute("data-setup")&&z(a)}else Y||$(1)}}var z,G=b("querySelector"),X=b("querySelectorAll"),K=Object.freeze({__proto__:null,isReal:y,isEl:v,isInFrame:_,createEl:T,textContent:S,prependTo:k,hasClass:C,addClass:E,removeClass:w,toggleClass:A,setAttributes:I,getAttributes:P,getAttribute:x,setAttribute:L,removeAttribute:O,blockTextSelection:D,unblockTextSelection:N,getBoundingClientRect:R,findPosition:U,getPointerPosition:M,isTextNode:B,emptyEl:j,normalizeContent:F,appendContent:H,insertContent:V,isSingleLeftClick:q,$:G,$$:X}),Y=!1;function $(e,t){t&&(z=t),d.setTimeout(W,e)}function Q(){Y=!0,d.removeEventListener("load",Q)}y()&&("complete"===h.readyState?Q():d.addEventListener("load",Q));function J(e){var t=h.createElement("style");return t.className=e,t}function Z(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t}var ee=3;d.WeakMap||(Rt=function(){function e(){this.vdata="vdata"+Math.floor(d.performance&&d.performance.now()||Date.now()),this.data={}}var t=e.prototype;return t.set=function(e,t){var i=e[this.vdata]||ee++;return e[this.vdata]||(e[this.vdata]=i),this.data[i]=t,this},t.get=function(e){var t=e[this.vdata];if(t)return this.data[t];p("We have no data for this element",e)},t.has=function(e){return e[this.vdata]in this.data},t.delete=function(e){var t=e[this.vdata];t&&(delete this.data[t],delete e[this.vdata])},e}());var te,ie=new(d.WeakMap?WeakMap:Rt);function ne(e,t){var i;ie.has(e)&&(0===(i=ie.get(e)).handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&ie.delete(e))}function re(t,i,e,n){e.forEach(function(e){t(i,e,n)})}function se(e){if(e.fixed_)return e;function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped){var n,r,s,a=e||d.event;for(n in e={},a)"layerX"!==n&&"layerY"!==n&&"keyLocation"!==n&&"webkitMovementX"!==n&&"webkitMovementY"!==n&&("returnValue"===n&&a.preventDefault||(e[n]=a[n]));e.target||(e.target=e.srcElement||h),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){a.preventDefault&&a.preventDefault(),e.returnValue=!1,a.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){a.stopPropagation&&a.stopPropagation(),e.cancelBubble=!0,a.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){a.stopImmediatePropagation&&a.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX&&(r=h.documentElement,s=h.body,e.pageX=e.clientX+(r&&r.scrollLeft||s&&s.scrollLeft||0)-(r&&r.clientLeft||s&&s.clientLeft||0),e.pageY=e.clientY+(r&&r.scrollTop||s&&s.scrollTop||0)-(r&&r.clientTop||s&&s.clientTop||0)),e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e.fixed_=!0,e}var ae=["touchstart","touchmove"];function oe(a,e,t){if(Array.isArray(e))return re(oe,a,e,t);ie.has(a)||ie.set(a,{});var o=ie.get(a);o.handlers||(o.handlers={}),o.handlers[e]||(o.handlers[e]=[]),t.guid||(t.guid=ee++),o.handlers[e].push(t),o.dispatcher||(o.disabled=!1,o.dispatcher=function(e,t){if(!o.disabled){e=se(e);var i=o.handlers[e.type];if(i)for(var n=i.slice(0),r=0,s=n.length;r<s&&!e.isImmediatePropagationStopped();r++)try{n[r].call(a,e,t)}catch(e){p.error(e)}}}),1===o.handlers[e].length&&(a.addEventListener?(t=!1,function(){if("boolean"!=typeof te){te=!1;try{var e=Object.defineProperty({},"passive",{get:function(){te=!0}});d.addEventListener("test",null,e),d.removeEventListener("test",null,e)}catch(e){}}return te}()&&-1<ae.indexOf(e)&&(t={passive:!0}),a.addEventListener(e,o.dispatcher,t)):a.attachEvent&&a.attachEvent("on"+e,o.dispatcher))}function ue(e,t,i){if(ie.has(e)){var n=ie.get(e);if(n.handlers){if(Array.isArray(t))return re(ue,e,t,i);var r=function(e,t){n.handlers[t]=[],ne(e,t)};if(void 0!==t){var s=n.handlers[t];if(s)if(i){if(i.guid)for(var a=0;a<s.length;a++)s[a].guid===i.guid&&s.splice(a--,1);ne(e,t)}else r(e,t)}else for(var o in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},o)&&r(e,o)}}}function le(e,t,i){var n=ie.has(e)?ie.get(e):{},r=e.parentNode||e.ownerDocument;return"string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=se(t),n.dispatcher&&n.dispatcher.call(e,t,i),r&&!t.isPropagationStopped()&&!0===t.bubbles?le.call(null,r,t,i):!r&&!t.defaultPrevented&&t.target&&t.target[t.type]&&(ie.has(t.target)||ie.set(t.target,{}),r=ie.get(t.target),t.target[t.type]&&(r.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),r.disabled=!1)),!t.defaultPrevented}function ce(e,t,i){if(Array.isArray(t))return re(ce,e,t,i);function n(){ue(e,t,n),i.apply(this,arguments)}n.guid=i.guid=i.guid||ee++,oe(e,t,n)}function he(e,t,i){function n(){ue(e,t,n),i.apply(this,arguments)}n.guid=i.guid=i.guid||ee++,oe(e,t,n)}function de(t,i){var n=d.performance.now();return function(){var e=d.performance.now();i<=e-n&&(t.apply(void 0,arguments),n=e)}}function pe(n,r,s,a){var o;function e(){var e=this,t=arguments,i=function(){i=o=null,s||n.apply(e,t)};!o&&s&&n.apply(e,t),a.clearTimeout(o),o=a.setTimeout(i,r)}return void 0===a&&(a=d),e.cancel=function(){a.clearTimeout(o),o=null},e}function fe(){}var me,ge=Object.freeze({__proto__:null,fixEvent:se,on:oe,off:ue,trigger:le,one:ce,any:he}),ye=function(e,t,i){t.guid||(t.guid=ee++);e=t.bind(e);return e.guid=i?i+"_"+t.guid:t.guid,e};fe.prototype.allowedEvents_={},fe.prototype.addEventListener=fe.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},oe(this,e,t),this.addEventListener=i},fe.prototype.removeEventListener=fe.prototype.off=function(e,t){ue(this,e,t)},fe.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},ce(this,e,t),this.addEventListener=i},fe.prototype.any=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},he(this,e,t),this.addEventListener=i},fe.prototype.trigger=function(e){var t=e.type||e;e=se(e="string"==typeof e?{type:t}:e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),le(this,e)},fe.prototype.dispatchEvent=fe.prototype.trigger,fe.prototype.queueTrigger=function(e){var t=this;me=me||new Map;var i=e.type||e,n=me.get(this);n||(n=new Map,me.set(this,n));var r=n.get(i);n.delete(i),d.clearTimeout(r);r=d.setTimeout(function(){0===n.size&&(n=null,me.delete(t)),t.trigger(e)},0);n.set(i,r)};function ve(e){if(!e.nodeName&&!ke(e))throw new Error("Invalid target; must be a DOM node or evented object.")}function _e(e){if(!Ce(e))throw new Error("Invalid event type; must be a non-empty string or array.")}function be(e){if("function"!=typeof e)throw new Error("Invalid listener; must be a function.")}function Te(e,t){var i,n,r=t.length<3||t[0]===e||t[0]===e.eventBusEl_,t=r?(i=e.eventBusEl_,3<=t.length&&t.shift(),n=t[0],t[1]):(i=t[0],n=t[1],t[2]);return ve(i),_e(n),be(t),{isTargetingSelf:r,target:i,type:n,listener:t=ye(e,t)}}function Se(e,t,i,n){ve(e),e.nodeName?ge[t](e,i,n):e[t](i,n)}var ke=function(t){return t instanceof fe||!!t.eventBusEl_&&["on","one","off","trigger"].every(function(e){return"function"==typeof t[e]})},Ce=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},Ee={on:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];var r,s=Te(this,i),a=s.isTargetingSelf,o=s.target,u=s.type,l=s.listener;Se(o,"on",u,l),a||((r=function(){return e.off(o,u,l)}).guid=l.guid,(a=function(){return e.off("dispose",r)}).guid=l.guid,Se(this,"on","dispose",r),Se(o,"on","dispose",a))},one:function(){for(var r=this,e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var n=Te(this,t),s=n.isTargetingSelf,a=n.target,o=n.type,u=n.listener;s?Se(a,"one",o,u):((s=function e(){r.off(a,o,e);for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];u.apply(null,i)}).guid=u.guid,Se(a,"one",o,s))},any:function(){for(var r=this,e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var n=Te(this,t),s=n.isTargetingSelf,a=n.target,o=n.type,u=n.listener;s?Se(a,"any",o,u):((s=function e(){r.off(a,o,e);for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];u.apply(null,i)}).guid=u.guid,Se(a,"any",o,s))},off:function(e,t,i){!e||Ce(e)?ue(this.eventBusEl_,e,t):(t=t,ve(e=e),_e(t),be(i),i=ye(this,i),this.off("dispose",i),e.nodeName?(ue(e,t,i),ue(e,"dispose",i)):ke(e)&&(e.off(t,i),e.off("dispose",i)))},trigger:function(e,t){return le(this.eventBusEl_,e,t)}};function we(e,t){t=(t=void 0===t?{}:t).eventBusKey;if(t){if(!e[t].nodeName)throw new Error('The eventBusKey "'+t+'" does not refer to an element.');e.eventBusEl_=e[t]}else e.eventBusEl_=T("span",{className:"vjs-event-bus"});return m(e,Ee),e.eventedCallbacks&&e.eventedCallbacks.forEach(function(e){e()}),e.on("dispose",function(){e.off(),d.setTimeout(function(){e.eventBusEl_=null},0)}),e}var Ae={state:{},setState:function(e){var i,n=this;return a(e="function"==typeof e?e():e,function(e,t){n.state[t]!==e&&((i=i||{})[t]={from:n.state[t],to:e}),n.state[t]=e}),i&&ke(this)&&this.trigger({changes:i,type:"statechanged"}),i}};function Ie(e,t){return m(e,Ae),e.state=m({},e.state,t),"function"==typeof e.handleStateChanged&&ke(e)&&e.on("statechanged",e.handleStateChanged),e}function Pe(e){return"string"!=typeof e?e:e.replace(/./,function(e){return e.toLowerCase()})}function xe(e){return"string"!=typeof e?e:e.replace(/./,function(e){return e.toUpperCase()})}function Le(){for(var i={},e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.forEach(function(e){e&&a(e,function(e,t){c(e)?(c(i[t])||(i[t]={}),i[t]=Le(i[t],e)):i[t]=e})}),i}var Oe=function(){function e(){this.map_={}}var t=e.prototype;return t.has=function(e){return e in this.map_},t.delete=function(e){var t=this.has(e);return delete this.map_[e],t},t.set=function(e,t){return this.set_[e]=t,this},t.forEach=function(e,t){for(var i in this.map_)e.call(t,this.map_[i],i,this)},e}(),De=d.Map||Oe,Ne=function(){function e(){this.set_={}}var t=e.prototype;return t.has=function(e){return e in this.set_},t.delete=function(e){var t=this.has(e);return delete this.set_[e],t},t.add=function(e){return this.set_[e]=1,this},t.forEach=function(e,t){for(var i in this.set_)e.call(t,i,i,this)},e}(),Re=d.Set||Ne,Ue=function(){function a(e,t,i){!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Le({},this.options_),t=this.options_=Le(this.options_,t),this.id_=t.id||t.el&&t.el.id,this.id_||(e=e&&e.id&&e.id()||"no_player",this.id_=e+"_component_"+ee++),this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),!1!==t.evented&&we(this,{eventBusKey:this.el_?"el_":null}),Ie(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Re,this.setIntervalIds_=new Re,this.rafIds_=new Re,this.namedRafs_=new De,(this.clearingTimersOnDispose_=!1)!==t.initChildren&&this.initChildren(),this.ready(i),!1!==t.reportTouchActivity&&this.enableTouchActivity()}var e=a.prototype;return e.dispose=function(){if(!this.isDisposed_){if(this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(var e=this.children_.length-1;0<=e;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),ie.has(this.el_)&&ie.delete(this.el_),this.el_=null),this.player_=null}},e.isDisposed=function(){return Boolean(this.isDisposed_)},e.player=function(){return this.player_},e.options=function(e){return e&&(this.options_=Le(this.options_,e)),this.options_},e.el=function(){return this.el_},e.createEl=function(e,t,i){return T(e,t,i)},e.localize=function(e,i,t){void 0===t&&(t=e);var n=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),s=r&&r[n],n=n&&n.split("-")[0],n=r&&r[n],t=t;return s&&s[e]?t=s[e]:n&&n[e]&&(t=n[e]),t=i?t.replace(/\{(\d+)\}/g,function(e,t){t=i[t-1];return void 0===t?e:t}):t},e.contentEl=function(){return this.contentEl_||this.el_},e.id=function(){return this.id_},e.name=function(){return this.name_},e.children=function(){return this.children_},e.getChildById=function(e){return this.childIndex_[e]},e.getChild=function(e){if(e)return this.childNameIndex_[e]},e.getDescendant=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];for(var t=t.reduce(function(e,t){return e.concat(t)},[]),n=this,r=0;r<t.length;r++)if(!(n=n.getChild(t[r]))||!n.getChild)return;return n},e.addChild=function(e,t,i){if(void 0===t&&(t={}),void 0===i&&(i=this.children_.length),"string"==typeof e){var n=xe(e),r=t.componentClass||n;t.name=n;var s=a.getComponent(r);if(!s)throw new Error("Component "+r+" does not exist");if("function"!=typeof s)return null;s=new s(this.player_||this,t)}else s=e;return s.parentComponent_&&s.parentComponent_.removeChild(s),this.children_.splice(i,0,s),s.parentComponent_=this,"function"==typeof s.id&&(this.childIndex_[s.id()]=s),(n=n||s.name&&xe(s.name()))&&(this.childNameIndex_[n]=s,this.childNameIndex_[Pe(n)]=s),"function"==typeof s.el&&s.el()&&(n=null,this.children_[i+1]&&(this.children_[i+1].el_?n=this.children_[i+1].el_:v(this.children_[i+1])&&(n=this.children_[i+1])),this.contentEl().insertBefore(s.el(),n)),s},e.removeChild=function(e){if((e="string"==typeof e?this.getChild(e):e)&&this.children_){for(var t,i=!1,n=this.children_.length-1;0<=n;n--)if(this.children_[n]===e){i=!0,this.children_.splice(n,1);break}i&&(e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[xe(e.name())]=null,this.childNameIndex_[Pe(e.name())]=null,(t=e.el())&&t.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el()))}},e.initChildren=function(){var i,t,e,n=this,r=this.options_.children;r&&(i=this.options_,t=a.getComponent("Tech"),(e=Array.isArray(r)?r:Object.keys(r)).concat(Object.keys(this.options_).filter(function(t){return!e.some(function(e){return"string"==typeof e?t===e:t===e.name})})).map(function(e){var t,e="string"==typeof e?r[t=e]||n.options_[t]||{}:(t=e.name,e);return{name:t,opts:e}}).filter(function(e){e=a.getComponent(e.opts.componentClass||xe(e.name));return e&&!t.isTech(e)}).forEach(function(e){var t=e.name,e=e.opts;!1!==(e=void 0!==i[t]?i[t]:e)&&((e=!0===e?{}:e).playerOptions=n.options_.playerOptions,(e=n.addChild(t,e))&&(n[t]=e))}))},e.buildCSSClass=function(){return""},e.ready=function(e,t){if(void 0===t&&(t=!1),e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},e.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var e=this.readyQueue_;this.readyQueue_=[],e&&0<e.length&&e.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},e.$=function(e,t){return G(e,t||this.contentEl())},e.$$=function(e,t){return X(e,t||this.contentEl())},e.hasClass=function(e){return C(this.el_,e)},e.addClass=function(e){E(this.el_,e)},e.removeClass=function(e){w(this.el_,e)},e.toggleClass=function(e,t){A(this.el_,e,t)},e.show=function(){this.removeClass("vjs-hidden")},e.hide=function(){this.addClass("vjs-hidden")},e.lockShowing=function(){this.addClass("vjs-lock-showing")},e.unlockShowing=function(){this.removeClass("vjs-lock-showing")},e.getAttribute=function(e){return x(this.el_,e)},e.setAttribute=function(e,t){L(this.el_,e,t)},e.removeAttribute=function(e){O(this.el_,e)},e.width=function(e,t){return this.dimension("width",e,t)},e.height=function(e,t){return this.dimension("height",e,t)},e.dimensions=function(e,t){this.width(e,!0),this.height(t)},e.dimension=function(e,t,i){if(void 0!==t)return-1!==(""+(t=null===t||t!=t?0:t)).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;t=this.el_.style[e],i=t.indexOf("px");return-1!==i?parseInt(t.slice(0,i),10):parseInt(this.el_["offset"+xe(e)],10)},e.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");return t=n(this.el_,e),0!==(t=parseFloat(t))&&!isNaN(t)||(e="offset"+xe(e),t=this.el_[e]),t},e.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},e.currentWidth=function(){return this.currentDimension("width")},e.currentHeight=function(){return this.currentDimension("height")},e.focus=function(){this.el_.focus()},e.blur=function(){this.el_.blur()},e.handleKeyDown=function(e){this.player_&&(e.stopPropagation(),this.player_.handleKeyDown(e))},e.handleKeyPress=function(e){this.handleKeyDown(e)},e.emitTapEvents=function(){var i,t=0,n=null;this.on("touchstart",function(e){1===e.touches.length&&(n={pageX:e.touches[0].pageX,pageY:e.touches[0].pageY},t=d.performance.now(),i=!0)}),this.on("touchmove",function(e){var t;1<e.touches.length?i=!1:n&&(t=e.touches[0].pageX-n.pageX,e=e.touches[0].pageY-n.pageY,10<Math.sqrt(t*t+e*e)&&(i=!1))});function e(){i=!1}this.on("touchleave",e),this.on("touchcancel",e),this.on("touchend",function(e){!(n=null)===i&&d.performance.now()-t<200&&(e.preventDefault(),this.trigger("tap"))})},e.enableTouchActivity=function(){var t,i,e;this.player()&&this.player().reportUserActivity&&(t=ye(this.player(),this.player().reportUserActivity),this.on("touchstart",function(){t(),this.clearInterval(i),i=this.setInterval(t,250)}),e=function(e){t(),this.clearInterval(i)},this.on("touchmove",t),this.on("touchend",e),this.on("touchcancel",e))},e.setTimeout=function(e,t){var i,n=this;return e=ye(this,e),this.clearTimersOnDispose_(),i=d.setTimeout(function(){n.setTimeoutIds_.has(i)&&n.setTimeoutIds_.delete(i),e()},t),this.setTimeoutIds_.add(i),i},e.clearTimeout=function(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),d.clearTimeout(e)),e},e.setInterval=function(e,t){e=ye(this,e),this.clearTimersOnDispose_();t=d.setInterval(e,t);return this.setIntervalIds_.add(t),t},e.clearInterval=function(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),d.clearInterval(e)),e},e.requestAnimationFrame=function(e){var t,i=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),e=ye(this,e),t=d.requestAnimationFrame(function(){i.rafIds_.has(t)&&i.rafIds_.delete(t),e()}),this.rafIds_.add(t),t):this.setTimeout(e,1e3/60)},e.requestNamedAnimationFrame=function(e,t){var i=this;if(!this.namedRafs_.has(e)){this.clearTimersOnDispose_(),t=ye(this,t);var n=this.requestAnimationFrame(function(){t(),i.namedRafs_.has(e)&&i.namedRafs_.delete(e)});return this.namedRafs_.set(e,n),e}},e.cancelNamedAnimationFrame=function(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))},e.cancelAnimationFrame=function(e){return this.supportsRaf_?(this.rafIds_.has(e)&&(this.rafIds_.delete(e),d.cancelAnimationFrame(e)),e):this.clearTimeout(e)},e.clearTimersOnDispose_=function(){var n=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(e){var t=e[0],i=e[1];n[t].forEach(function(e,t){return n[i](t)})}),n.clearingTimersOnDispose_=!1}))},a.registerComponent=function(e,t){if("string"!=typeof e||!e)throw new Error('Illegal component name, "'+e+'"; must be a non-empty string.');var i=a.getComponent("Tech"),n=i&&i.isTech(t),i=a===t||a.prototype.isPrototypeOf(t.prototype);if(n||!i){var r=n?"techs must be registered using Tech.registerTech()":"must be a Component subclass";throw new Error('Illegal component, "'+e+'"; '+r+".")}e=xe(e),a.components_||(a.components_={});r=a.getComponent("Player");if("Player"===e&&r&&r.players){var s=r.players,r=Object.keys(s);if(s&&0<r.length&&r.map(function(e){return s[e]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return a.components_[e]=t,a.components_[Pe(e)]=t},a.getComponent=function(e){if(e&&a.components_)return a.components_[e]},a}();Ue.prototype.supportsRaf_="function"==typeof d.requestAnimationFrame&&"function"==typeof d.cancelAnimationFrame,Ue.registerComponent("Component",Ue);var Me=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e};e(function(t){function i(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=i=function(e){return typeof e}:t.exports=i=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}t.exports=i}),e(function(t){function i(e){return t.exports=i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}t.exports=i});var Be=function(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t},je=d.navigator&&d.navigator.userAgent||"",Fe=/AppleWebKit\/([\d.]+)/i.exec(je),He=Fe?parseFloat(Fe.pop()):null,Ve=/iPod/i.test(je),qe=(Xt=je.match(/OS (\d+)_/i))&&Xt[1]?Xt[1]:null,We=/Android/i.test(je),ze=function(){var e=je.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}(),Ge=We&&ze<5&&He<537,Xe=/Firefox/i.test(je),Ke=/Edg/i.test(je),Ye=!Ke&&(/Chrome/i.test(je)||/CriOS/i.test(je)),$e=(ei=je.match(/(Chrome|CriOS)\/(\d+)/))&&ei[2]?parseFloat(ei[2]):null,Qe=ti=!(ti=(ti=/MSIE\s(\d+)\.\d/.exec(je))&&parseFloat(ti[1]))&&/Trident\/7.0/i.test(je)&&/rv:11.0/.test(je)?11:ti,Je=/Safari/i.test(je)&&!Ye&&!We&&!Ke,Ze=/Windows/i.test(je),et=y()&&("ontouchstart"in d||d.navigator.maxTouchPoints||d.DocumentTouch&&d.document instanceof d.DocumentTouch),tt=/iPad/i.test(je)||Je&&et&&!/iPhone/i.test(je),it=/iPhone/i.test(je)&&!tt,nt=it||tt||Ve,rt=(Je||nt)&&!Ye,st=Object.freeze({__proto__:null,IS_IPOD:Ve,IOS_VERSION:qe,IS_ANDROID:We,ANDROID_VERSION:ze,IS_NATIVE_ANDROID:Ge,IS_FIREFOX:Xe,IS_EDGE:Ke,IS_CHROME:Ye,CHROME_VERSION:$e,IE_VERSION:Qe,IS_SAFARI:Je,IS_WINDOWS:Ze,TOUCH_ENABLED:et,IS_IPAD:tt,IS_IPHONE:it,IS_IOS:nt,IS_ANY_SAFARI:rt});function at(e,t,i,n){return function(e,t,i){if("number"!=typeof t||t<0||i<t)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").")}(e,n,i.length-1),i[n][t]}function ot(e){return void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:at.bind(null,"start",0,e),end:at.bind(null,"end",1,e)}}function ut(e,t){return Array.isArray(e)?ot(e):void 0===e||void 0===t?ot():ot([[e,t]])}function lt(e,t){var i,n,r=0;if(!t)return 0;e&&e.length||(e=ut(0,0));for(var s=0;s<e.length;s++)i=e.start(s),r+=(n=t<(n=e.end(s))?t:n)-i;return r/t}for(var ct,ht={prefixed:!0},dt=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],pt=dt[0],ft=0;ft<dt.length;ft++)if(dt[ft][1]in h){ct=dt[ft];break}if(ct){for(var mt=0;mt<ct.length;mt++)ht[pt[mt]]=ct[mt];ht.prefixed=ct[0]!==pt[0]}function gt(e){if(e instanceof gt)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:o(e)&&("number"==typeof e.code&&(this.code=e.code),m(this,e)),this.message||(this.message=gt.defaultMessages[this.code]||"")}gt.prototype.code=0,gt.prototype.message="",gt.prototype.status=null,gt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],gt.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var yt=0;yt<gt.errorTypes.length;yt++)gt[gt.errorTypes[yt]]=yt,gt.prototype[gt.errorTypes[yt]]=yt;var vt=function(e,t){var i,n=null;try{i=JSON.parse(e,t)}catch(e){n=e}return[n,i]};function _t(e){return null!=e&&"function"==typeof e.then}function bt(e){_t(e)&&e.then(null,function(e){})}function Tt(n){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(e,t,i){return n[t]&&(e[t]=n[t]),e},{cues:n.cues&&Array.prototype.map.call(n.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})})}var St=function(e){var t=e.$$("track"),i=Array.prototype.map.call(t,function(e){return e.track});return Array.prototype.map.call(t,function(e){var t=Tt(e.track);return e.src&&(t.src=e.src),t}).concat(Array.prototype.filter.call(e.textTracks(),function(e){return-1===i.indexOf(e)}).map(Tt))},kt=function(e,i){return e.forEach(function(e){var t=i.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach(function(e){return t.addCue(e)})}),i.textTracks()},Ct=e(function(e,t){function i(e){if(!e||"object"!=typeof e||(t=e.which||e.keyCode||e.charCode)&&(e=t),"number"==typeof e)return o[e];var t=String(e),e=n[t.toLowerCase()];return e||((e=r[t.toLowerCase()])?e:1===t.length?t.charCodeAt(0):void 0)}i.isEventKey=function(e,t){if(e&&"object"==typeof e){var i=e.which||e.keyCode||e.charCode;if(null==i)return!1;if("string"==typeof t){e=n[t.toLowerCase()];if(e)return e===i;if(e=r[t.toLowerCase()])return e===i}else if("number"==typeof t)return t===i;return!1}};for(var n=(t=e.exports=i).code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},r=t.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91},s=97;s<123;s++)n[String.fromCharCode(s)]=s-32;for(var s=48;s<58;s++)n[s-48]=s;for(s=1;s<13;s++)n["f"+s]=s+111;for(s=0;s<10;s++)n["numpad "+s]=s+96;var a,o=t.names=t.title={};for(s in n)o[n[s]]=s;for(a in r)n[a]=r[a]}),Et=(Ct.code,Ct.codes,Ct.aliases,Ct.names,Ct.title,"vjs-modal-dialog"),wt=function(i){function e(e,t){t=i.call(this,e,t)||this;return t.opened_=t.hasBeenOpened_=t.hasBeenFilled_=!1,t.closeable(!t.options_.uncloseable),t.content(t.options_.content),t.contentEl_=T("div",{className:Et+"-content"},{role:"document"}),t.descEl_=T("p",{className:Et+"-description vjs-control-text",id:t.el().getAttribute("aria-describedby")}),S(t.descEl_,t.description()),t.el_.appendChild(t.descEl_),t.el_.appendChild(t.contentEl_),t}Be(e,i);var t=e.prototype;return t.createEl=function(){return i.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},t.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,i.prototype.dispose.call(this)},t.buildCSSClass=function(){return Et+" vjs-hidden "+i.prototype.buildCSSClass.call(this)},t.label=function(){return this.localize(this.options_.label||"Modal Window")},t.description=function(){var e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e},t.open=function(){var e;this.opened_||(e=this.player(),this.trigger("beforemodalopen"),this.opened_=!0,!this.options_.fillAlways&&(this.hasBeenOpened_||this.hasBeenFilled_)||this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0)},t.opened=function(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_},t.close=function(){var e;this.opened_&&(e=this.player(),this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose())},t.closeable=function(e){var t,i;return"boolean"==typeof e&&(t=this.closeable_=!!e,i=this.getChild("closeButton"),t&&!i&&(e=this.contentEl_,this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=e,this.on(i,"close",this.close)),!t&&i&&(this.off(i,"close",this.close),this.removeChild(i),i.dispose())),this.closeable_},t.fill=function(){this.fillWith(this.content())},t.fillWith=function(e){var t=this.contentEl(),i=t.parentNode,n=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),V(t,e),this.trigger("modalfill"),n?i.insertBefore(t,n):i.appendChild(t);t=this.getChild("closeButton");t&&i.appendChild(t.el_)},t.empty=function(){this.trigger("beforemodalempty"),j(this.contentEl()),this.trigger("modalempty")},t.content=function(e){return void 0!==e&&(this.content_=e),this.content_},t.conditionalFocus_=function(){var e=h.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,!t.contains(e)&&t!==e||(this.previouslyActiveEl_=e,this.focus())},t.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)},t.handleKeyDown=function(e){if(e.stopPropagation(),Ct.isEventKey(e,"Escape")&&this.closeable())return e.preventDefault(),void this.close();if(Ct.isEventKey(e,"Tab")){for(var t,i=this.focusableEls_(),n=this.el_.querySelector(":focus"),r=0;r<i.length;r++)if(n===i[r]){t=r;break}h.activeElement===this.el_&&(t=0),e.shiftKey&&0===t?(i[i.length-1].focus(),e.preventDefault()):e.shiftKey||t!==i.length-1||(i[0].focus(),e.preventDefault())}},t.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,function(e){return(e instanceof d.HTMLAnchorElement||e instanceof d.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof d.HTMLInputElement||e instanceof d.HTMLSelectElement||e instanceof d.HTMLTextAreaElement||e instanceof d.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof d.HTMLIFrameElement||e instanceof d.HTMLObjectElement||e instanceof d.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")})},e}(Ue);wt.prototype.options_={pauseOnOpen:!0,temporary:!0},Ue.registerComponent("ModalDialog",wt);var At,It=function(n){function e(e){var t;void 0===e&&(e=[]),(t=n.call(this)||this).tracks_=[],Object.defineProperty(Me(t),"length",{get:function(){return this.tracks_.length}});for(var i=0;i<e.length;i++)t.addTrack(e[i]);return t}Be(e,n);var t=e.prototype;return t.addTrack=function(e){var t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this}))},t.removeTrack=function(e){for(var t,i=0,n=this.length;i<n;i++)if(this[i]===e){(t=this[i]).off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})},t.getTrackById=function(e){for(var t=null,i=0,n=this.length;i<n;i++){var r=this[i];if(r.id===e){t=r;break}}return t},e}(fe);for(At in It.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack"},It.prototype.allowedEvents_)It.prototype["on"+At]=null;function Pt(e,t){for(var i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1)}function xt(e,t){for(var i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1)}function Lt(e){var t=["protocol","hostname","port","pathname","search","hash","host"],i=h.createElement("a");i.href=e;var n,r=""===i.host&&"file:"!==i.protocol;r&&((n=h.createElement("div")).innerHTML='<a href="'+e+'"></a>',i=n.firstChild,n.setAttribute("style","display:none; position:absolute;"),h.body.appendChild(n));for(var s={},a=0;a<t.length;a++)s[t[a]]=i[t[a]];return"http:"===s.protocol&&(s.host=s.host.replace(/:80$/,"")),"https:"===s.protocol&&(s.host=s.host.replace(/:443$/,"")),s.protocol||(s.protocol=d.location.protocol),r&&h.body.removeChild(n),s}function Ot(e){var t;return e.match(/^https?:\/\//)||((t=h.createElement("div")).innerHTML='<a href="'+e+'">x</a>',e=t.firstChild.href),e}var Dt=function(n){function e(e){for(var t,i=(e=void 0===e?[]:e).length-1;0<=i;i--)if(e[i].enabled){Pt(e,e[i]);break}return(t=n.call(this,e)||this).changing_=!1,t}Be(e,n);var t=e.prototype;return t.addTrack=function(e){var t=this;e.enabled&&Pt(this,e),n.prototype.addTrack.call(this,e),e.addEventListener&&(e.enabledChange_=function(){t.changing_||(t.changing_=!0,Pt(t,e),t.changing_=!1,t.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))},t.removeTrack=function(e){n.prototype.removeTrack.call(this,e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)},e}(It),Nt=function(n){function e(e){for(var t,i=(e=void 0===e?[]:e).length-1;0<=i;i--)if(e[i].selected){xt(e,e[i]);break}return(t=n.call(this,e)||this).changing_=!1,Object.defineProperty(Me(t),"selectedIndex",{get:function(){for(var e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set:function(){}}),t}Be(e,n);var t=e.prototype;return t.addTrack=function(e){var t=this;e.selected&&xt(this,e),n.prototype.addTrack.call(this,e),e.addEventListener&&(e.selectedChange_=function(){t.changing_||(t.changing_=!0,xt(t,e),t.changing_=!1,t.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))},t.removeTrack=function(e){n.prototype.removeTrack.call(this,e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)},e}(It),Rt=function(i){function e(){return i.apply(this,arguments)||this}Be(e,i);var t=e.prototype;return t.addTrack=function(e){var t=this;i.prototype.addTrack.call(this,e),this.queueChange_||(this.queueChange_=function(){return t.queueTrigger("change")}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return t.trigger("selectedlanguagechange")}),e.addEventListener("modechange",this.queueChange_);-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)},t.removeTrack=function(e){i.prototype.removeTrack.call(this,e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))},e}(It),Oe=function(){function e(e){void 0===e&&(e=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var t=0,i=e.length;t<i;t++)this.addTrackElement_(e[t])}var t=e.prototype;return t.addTrackElement_=function(e){var t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)},t.getTrackElementByTrack_=function(e){for(var t,i=0,n=this.trackElements_.length;i<n;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t},t.removeTrackElement_=function(e){for(var t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&"function"==typeof this.trackElements_[t].track.off&&this.trackElements_[t].track.off(),"function"==typeof this.trackElements_[t].off&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}},e}(),Ut=function(){function t(e){t.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var e=t.prototype;return e.setCues_=function(e){var t=this.length||0,i=0,n=e.length;this.cues_=e,this.length_=e.length;function r(e){""+e in this||Object.defineProperty(this,""+e,{get:function(){return this.cues_[e]}})}if(t<n)for(i=t;i<n;i++)r.call(this,i)},e.getCueById=function(e){for(var t=null,i=0,n=this.length;i<n;i++){var r=this[i];if(r.id===e){t=r;break}}return t},t}(),Mt={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Bt={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},jt={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Ft={disabled:"disabled",hidden:"hidden",showing:"showing"},Ne=function(r){function e(e){void 0===e&&(e={});var t,i=r.call(this)||this,n={id:e.id||"vjs_track_"+ee++,kind:e.kind||"",label:e.label||"",language:e.language||""};for(t in n)!function(e){Object.defineProperty(Me(i),e,{get:function(){return n[e]},set:function(){}})}(t);return i}return Be(e,r),e}(fe),Ht=function(e){if("string"==typeof e){e=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(e)return e.pop().toLowerCase()}return""},Vt=function(e,t){void 0===t&&(t=d.location);e=Lt(e);return(":"===e.protocol?t:e).protocol+e.host!==t.protocol+t.host},Fe=Object.freeze({__proto__:null,parseUrl:Lt,getAbsoluteURL:Ot,getFileExtension:Ht,isCrossOrigin:Vt}),qt=function(e){var t=Wt.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},Wt=Object.prototype.toString;var zt=function(e){var n={};return e&&e.trim().split("\n").forEach(function(e){var t=e.indexOf(":"),i=e.slice(0,t).trim().toLowerCase(),t=e.slice(t+1).trim();void 0===n[i]?n[i]=t:Array.isArray(n[i])?n[i].push(t):n[i]=[n[i],t]}),n},Gt=Yt,Xt=Yt;function Kt(e,t,i){var n=e;return qt(t)?(i=t,"string"==typeof e&&(n={uri:e})):n=r({},t,{uri:e}),n.callback=i,n}function Yt(e,t,i){return $t(t=Kt(e,t,i))}function $t(n){if(void 0===n.callback)throw new Error("callback argument missing");var r=!1,s=function(e,t,i){r||(r=!0,n.callback(e,t,i))};function a(){var e=void 0,e=l.response||l.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(l);if(m)try{e=JSON.parse(e)}catch(e){}return e}function t(e){return clearTimeout(u),(e=!(e instanceof Error)?new Error(""+(e||"Unknown XMLHttpRequest Error")):e).statusCode=0,s(e,g)}function e(){if(!o){clearTimeout(u);var e=n.useXDR&&void 0===l.status?200:1223===l.status?204:l.status,t=g,i=null;return 0!==e?(t={body:a(),statusCode:e,method:h,headers:{},url:c,rawRequest:l},l.getAllResponseHeaders&&(t.headers=zt(l.getAllResponseHeaders()))):i=new Error("Internal XMLHttpRequest Error"),s(i,t,t.body)}}var i,o,u,l=n.xhr||null,c=(l=l||new(n.cors||n.useXDR?Yt.XDomainRequest:Yt.XMLHttpRequest)).url=n.uri||n.url,h=l.method=n.method||"GET",d=n.body||n.data,p=l.headers=n.headers||{},f=!!n.sync,m=!1,g={body:void 0,headers:{},statusCode:0,method:h,url:c,rawRequest:l};if("json"in n&&!1!==n.json&&(m=!0,p.accept||p.Accept||(p.Accept="application/json"),"GET"!==h&&"HEAD"!==h&&(p["content-type"]||p["Content-Type"]||(p["Content-Type"]="application/json"),d=JSON.stringify(!0===n.json?d:n.json))),l.onreadystatechange=function(){4===l.readyState&&setTimeout(e,0)},l.onload=e,l.onerror=t,l.onprogress=function(){},l.onabort=function(){o=!0},l.ontimeout=t,l.open(h,c,!f,n.username,n.password),f||(l.withCredentials=!!n.withCredentials),!f&&0<n.timeout&&(u=setTimeout(function(){var e;o||(o=!0,l.abort("timeout"),(e=new Error("XMLHttpRequest timeout")).code="ETIMEDOUT",t(e))},n.timeout)),l.setRequestHeader)for(i in p)p.hasOwnProperty(i)&&l.setRequestHeader(i,p[i]);else if(n.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return;return 1}(n.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in n&&(l.responseType=n.responseType),"beforeSend"in n&&"function"==typeof n.beforeSend&&n.beforeSend(l),l.send(d||null),l}Yt.XMLHttpRequest=d.XMLHttpRequest||function(){},Yt.XDomainRequest="withCredentials"in new Yt.XMLHttpRequest?Yt.XMLHttpRequest:d.XDomainRequest,function(e,t){for(var i=0;i<e.length;i++)t(e[i])}(["get","put","post","patch","head","delete"],function(n){Yt["delete"===n?"del":n]=function(e,t,i){return(t=Kt(e,t,i)).method=n.toUpperCase(),$t(t)}}),Gt.default=Xt;function Qt(e,n){var t={uri:e};(e=Vt(e))&&(t.cors=e),(e="use-credentials"===n.tech_.crossOrigin())&&(t.withCredentials=e),Gt(t,ye(this,function(e,t,i){return e?p.error(e,t):(n.loaded_=!0,void("function"!=typeof d.WebVTT?n.tech_&&n.tech_.any(["vttjsloaded","vttjserror"],function(e){return"vttjserror"!==e.type?Jt(i,n):void p.error("vttjs failed to load, stopping trying to process "+n.src)}):Jt(i,n)))}))}var Jt=function(e,t){var i=new d.WebVTT.Parser(d,d.vttjs,d.WebVTT.StringDecoder()),n=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){n.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),0<n.length&&(d.console&&d.console.groupCollapsed&&d.console.groupCollapsed("Text Track parsing errors for "+t.src),n.forEach(function(e){return p.error(e)}),d.console&&d.console.groupEnd&&d.console.groupEnd()),i.flush()},Zt=function(u){function e(e){var t;if(!(e=void 0===e?{}:e).tech)throw new Error("A tech was not provided.");var e=Le(e,{kind:jt[e.kind]||"subtitles",language:e.language||e.srclang||""}),i=Ft[e.mode]||"disabled",n=e.default;"metadata"!==e.kind&&"chapters"!==e.kind||(i="hidden"),(t=u.call(this,e)||this).tech_=e.tech,t.cues_=[],t.activeCues_=[],t.preload_=!1!==t.tech_.preloadTextTracks;var r=new Ut(t.cues_),a=new Ut(t.activeCues_),o=!1,s=ye(Me(t),function(){this.activeCues=this.activeCues,o&&(this.trigger("cuechange"),o=!1)});return"disabled"!==i&&t.tech_.ready(function(){t.tech_.on("timeupdate",s)},!0),Object.defineProperties(Me(t),{default:{get:function(){return n},set:function(){}},mode:{get:function(){return i},set:function(e){var t=this;Ft[e]&&(i=e,this.preload_||"disabled"===i||0!==this.cues.length||Qt(this.src,this),"disabled"!==i?this.tech_.ready(function(){t.tech_.on("timeupdate",s)},!0):this.tech_.off("timeupdate",s),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?r:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return a;for(var e=this.tech_.currentTime(),t=[],i=0,n=this.cues.length;i<n;i++){var r=this.cues[i];(r.startTime<=e&&r.endTime>=e||r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e)&&t.push(r)}if(o=!1,t.length!==this.activeCues_.length)o=!0;else for(var s=0;s<t.length;s++)-1===this.activeCues_.indexOf(t[s])&&(o=!0);return this.activeCues_=t,a.setCues_(this.activeCues_),a},set:function(){}}}),e.src?(t.src=e.src,t.preload_||(t.loaded_=!0),(t.preload_||n||"subtitles"!==e.kind&&"captions"!==e.kind)&&Qt(t.src,Me(t))):t.loaded_=!0,t}Be(e,u);var t=e.prototype;return t.addCue=function(e){var t=e;if(d.vttjs&&!(e instanceof d.vttjs.VTTCue)){for(var i in t=new d.vttjs.VTTCue(e.startTime,e.endTime,e.text),e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e}for(var n=this.tech_.textTracks(),r=0;r<n.length;r++)n[r]!==this&&n[r].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)},t.removeCue=function(e){for(var t=this.cues_.length;t--;){var i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}},e}(Ne);Zt.prototype.allowedEvents_={cuechange:"cuechange"};var He=function(n){function e(e){var t=Le(e=void 0===e?{}:e,{kind:Bt[e.kind]||""}),e=n.call(this,t)||this,i=!1;return Object.defineProperty(Me(e),"enabled",{get:function(){return i},set:function(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("enabledchange"))}}),t.enabled&&(e.enabled=t.enabled),e.loaded_=!0,e}return Be(e,n),e}(Ne),ei=function(n){function e(e){var t=Le(e=void 0===e?{}:e,{kind:Mt[e.kind]||""}),e=n.call(this,t)||this,i=!1;return Object.defineProperty(Me(e),"selected",{get:function(){return i},set:function(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("selectedchange"))}}),t.selected&&(e.selected=t.selected),e}return Be(e,n),e}(Ne),ti=function(r){function e(e){var t;void 0===e&&(e={});var i=r.call(this)||this,n=new Zt(e);return i.kind=n.kind,i.src=n.src,i.srclang=n.language,i.label=n.label,i.default=n.default,Object.defineProperties(Me(i),{readyState:{get:function(){return t}},track:{get:function(){return n}}}),t=0,n.addEventListener("loadeddata",function(){t=2,i.trigger({type:"load",target:Me(i)})}),i}return Be(e,r),e}(fe);ti.prototype.allowedEvents_={load:"load"},ti.NONE=0,ti.LOADING=1,ti.LOADED=2,ti.ERROR=3;var ii={audio:{ListClass:Dt,TrackClass:He,capitalName:"Audio"},video:{ListClass:Nt,TrackClass:ei,capitalName:"Video"},text:{ListClass:Rt,TrackClass:Zt,capitalName:"Text"}};Object.keys(ii).forEach(function(e){ii[e].getterName=e+"Tracks",ii[e].privateName=e+"Tracks_"});var ni={remoteText:{ListClass:Rt,TrackClass:Zt,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Oe,TrackClass:ti,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},ri=r({},ii,ni);ni.names=Object.keys(ni),ii.names=Object.keys(ii),ri.names=[].concat(ni.names).concat(ii.names);var si=Object.create||function(e){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return ai.prototype=e,new ai};function ai(){}function oi(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function ui(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3}e=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return e?e[3]?t(e[1],e[2],e[3].replace(":",""),e[4]):59<e[1]?t(e[1],e[2],0,e[4]):t(0,e[1],e[2],e[4]):null}function li(){this.values=si(null)}function ci(e,t,i,n){var r,s,a=n?e.split(n):[e];for(r in a)"string"==typeof a[r]&&(2===(s=a[r].split(i)).length&&t(s[0],s[1]))}function hi(t,e,a){var i=t;function n(){var e=ui(t);if(null===e)throw new oi(oi.Errors.BadTimeStamp,"Malformed timestamp: "+i);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function r(){t=t.replace(/^\s+/,"")}if(r(),e.startTime=n(),r(),"--\x3e"!==t.substr(0,3))throw new oi(oi.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+i);t=t.substr(3),r(),e.endTime=n(),r(),function(e,t){var s=new li;ci(e,function(e,t){switch(e){case"region":for(var i=a.length-1;0<=i;i--)if(a[i].id===t){s.set(e,a[i].region);break}break;case"vertical":s.alt(e,t,["rl","lr"]);break;case"line":var n=t.split(","),r=n[0];s.integer(e,r),s.percent(e,r)&&s.set("snapToLines",!1),s.alt(e,r,["auto"]),2===n.length&&s.alt("lineAlign",n[1],["start","center","end"]);break;case"position":n=t.split(","),s.percent(e,n[0]),2===n.length&&s.alt("positionAlign",n[1],["start","center","end"]);break;case"size":s.percent(e,t);break;case"align":s.alt(e,t,["start","center","end","left","right"])}},/:/,/\s/),t.region=s.get("region",null),t.vertical=s.get("vertical","");try{t.line=s.get("line","auto")}catch(e){}t.lineAlign=s.get("lineAlign","start"),t.snapToLines=s.get("snapToLines",!0),t.size=s.get("size",100);try{t.align=s.get("align","center")}catch(e){t.align=s.get("align","middle")}try{t.position=s.get("position","auto")}catch(e){t.position=s.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=s.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(t,e)}((oi.prototype=si(Error.prototype)).constructor=oi).Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},li.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n<i.length;++n)if(t===i[n]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&0<=(t=parseFloat(t))&&t<=100)&&(this.set(e,t),!0)}};var di=h.createElement("textarea"),pi={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},fi={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},mi={v:"title",lang:"lang"},gi={rt:"ruby"};function yi(e,t){for(var i,n,r,s,a,o,u,l,c,h,d=e.document.createElement("div"),p=d,f=[];null!==(i=function(){if(!t)return null;var e=t.match(/^([^<]*)(<[^>]*>?)?/);return e=e[1]||e[2],t=t.substr(e.length),e}());)"<"!==i[0]?p.appendChild(e.document.createTextNode((a=i,di.innerHTML=a,a=di.textContent,di.textContent="",a))):"/"!==i[1]?(s=ui(i.substr(1,i.length-2)))?(n=e.document.createProcessingInstruction("timestamp",s),p.appendChild(n)):(r=i.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/))&&(l=r[1],c=r[3],h=void 0,h=pi[l],(n=h?(h=e.document.createElement(h),(l=mi[l])&&c&&(h[l]=c.trim()),h):null)&&(o=p,gi[(u=n).localName]&&gi[u.localName]!==o.localName||(r[2]&&((s=r[2].split(".")).forEach(function(e){var t=/^bg_/.test(e),e=t?e.slice(3):e;fi.hasOwnProperty(e)&&(e=fi[e],n.style[t?"background-color":"color"]=e)}),n.className=s.join(" ")),f.push(r[1]),p.appendChild(n),p=n))):f.length&&f[f.length-1]===i.substr(2).replace(">","")&&(f.pop(),p=p.parentNode);return d}var vi=[[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 _i(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function s(e,t){for(var i=t.childNodes.length-1;0<=i;i--)e.push(t.childNodes[i])}for(s(t,e);i=function e(t){if(!t||!t.length)return null;var i=t.pop(),n=i.textContent||i.innerText;if(n){var r=n.match(/^.*(\n|\r)/);return r?r[t.length=0]:n}return"ruby"===i.tagName?e(t):i.childNodes?(s(t,i),e(t)):void 0}(t);)for(var n=0;n<i.length;n++)if(function(e){for(var t=0;t<vi.length;t++){var i=vi[t];if(e>=i[0]&&e<=i[1])return 1}}(i.charCodeAt(n)))return"rtl";return"ltr"}function bi(){}function Ti(e,t,i){bi.call(this),this.cue=t,this.cueDiv=yi(e,t.text);var n={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(n,this.cueDiv),this.div=e.document.createElement("div"),n={direction:_i(this.cueDiv),writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===t.align?"center":t.align,font:i.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(n),this.div.appendChild(this.cueDiv);var r=0;switch(t.positionAlign){case"start":r=t.position;break;case"center":r=t.position-t.size/2;break;case"end":r=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(r,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(r,"%"),height:this.formatStyle(t.size,"%")}),this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,"px"),bottom:this.formatStyle(e.bottom,"px"),left:this.formatStyle(e.left,"px"),right:this.formatStyle(e.right,"px"),height:this.formatStyle(e.height,"px"),width:this.formatStyle(e.width,"px")})}}function Si(e){var t,i,n,r;e.div&&(t=e.div.offsetHeight,i=e.div.offsetWidth,n=e.div.offsetTop,r=(r=e.div.childNodes)&&(r=r[0])&&r.getClientRects&&r.getClientRects(),e=e.div.getBoundingClientRect(),r=r?Math.max(r[0]&&r[0].height||0,e.height/r.length):0),this.left=e.left,this.right=e.right,this.top=e.top||n,this.height=e.height||t,this.bottom=e.bottom||n+(e.height||t),this.width=e.width||i,this.lineHeight=void 0!==r?r:e.lineHeight}function ki(e,t,o,u){var i,n=new Si(t),r=t.cue,s=function(e){if("number"==typeof e.line&&(e.snapToLines||0<=e.line&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;r<i.length&&i[r]!==t;r++)"showing"===i[r].mode&&n++;return-1*++n}(r),a=[];if(r.snapToLines){switch(r.vertical){case"":a=["+y","-y"],i="height";break;case"rl":a=["+x","-x"],i="width";break;case"lr":a=["-x","+x"],i="width"}var l=n.lineHeight,c=l*Math.round(s),h=o[i]+l,d=a[0];Math.abs(c)>h&&(c=c<0?-1:1,c*=Math.ceil(h/l)*l),s<0&&(c+=""===r.vertical?o.height:o.width,a=a.reverse()),n.move(d,c)}else{var p=n.lineHeight/o.height*100;switch(r.lineAlign){case"center":s-=p/2;break;case"end":s-=p}switch(r.vertical){case"":t.applyStyles({top:t.formatStyle(s,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(s,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(s,"%")})}a=["+y","-x","+x","-y"],n=new Si(t)}n=function(e,t){for(var i,n=new Si(e),r=1,s=0;s<t.length;s++){for(;e.overlapsOppositeAxis(o,t[s])||e.within(o)&&e.overlapsAny(u);)e.move(t[s]);if(e.within(o))return e;var a=e.intersectPercentage(o);a<r&&(i=new Si(e),r=a),e=new Si(n)}return i||n}(n,a);t.move(n.toCSSCompatValues(o))}function Ci(){}bi.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},bi.prototype.formatStyle=function(e,t){return 0===e?0:e+t},(Ti.prototype=si(bi.prototype)).constructor=Ti,Si.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},Si.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},Si.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},Si.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},Si.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}},Si.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},Si.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},Si.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},Ci.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},Ci.convertCueToDOMTree=function(e,t){return e&&t?yi(e,t):null};Ci.processCues=function(n,r,e){if(!n||!r||!e)return null;for(;e.firstChild;)e.removeChild(e.firstChild);var s=n.document.createElement("div");if(s.style.position="absolute",s.style.left="0",s.style.right="0",s.style.top="0",s.style.bottom="0",s.style.margin="1.5%",e.appendChild(s),function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return 1}(r)){var a=[],o=Si.getSimpleBoxPosition(s),u={font:Math.round(.05*o.height*100)/100+"px sans-serif"};!function(){for(var e,t,i=0;i<r.length;i++)t=r[i],e=new Ti(n,t,u),s.appendChild(e.div),ki(0,e,o,a),t.displayState=e.div,a.push(Si.getSimpleBoxPosition(e))}()}else for(var t=0;t<r.length;t++)s.appendChild(r[t].displayState)},(Ci.Parser=function(e,t,i){i||(i=t,t={}),t=t||{},this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=i||new TextDecoder("utf8"),this.regionList=[]}).prototype={reportOrThrowError:function(e){if(!(e instanceof oi))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){var n=this;function t(){for(var e=n.buffer,t=0;t<e.length&&"\r"!==e[t]&&"\n"!==e[t];)++t;var i=e.substr(0,t);return"\r"===e[t]&&++t,"\n"===e[t]&&++t,n.buffer=e.substr(t),i}function i(e){e.match(/X-TIMESTAMP-MAP/)?ci(e,function(e,t){var i;"X-TIMESTAMP-MAP"===e&&(t=t,i=new li,ci(t,function(e,t){switch(e){case"MPEGT":i.integer(e+"S",t);break;case"LOCA":i.set(e+"L",ui(t))}},/[^\d]:/,/,/),n.ontimestampmap&&n.ontimestampmap({MPEGTS:i.get("MPEGTS"),LOCAL:i.get("LOCAL")}))},/=/):ci(e,function(e,t){var r;"Region"===e&&(t=t,r=new li,ci(t,function(e,t){switch(e){case"id":r.set(e,t);break;case"width":r.percent(e,t);break;case"lines":r.integer(e,t);break;case"regionanchor":case"viewportanchor":var i=t.split(",");if(2!==i.length)break;var n=new li;if(n.percent("x",i[0]),n.percent("y",i[1]),!n.has("x")||!n.has("y"))break;r.set(e+"X",n.get("x")),r.set(e+"Y",n.get("y"));break;case"scroll":r.alt(e,t,["up"])}},/=/,/\s/),r.has("id")&&((t=new(n.vttjs.VTTRegion||n.window.VTTRegion)).width=r.get("width",100),t.lines=r.get("lines",3),t.regionAnchorX=r.get("regionanchorX",0),t.regionAnchorY=r.get("regionanchorY",100),t.viewportAnchorX=r.get("viewportanchorX",0),t.viewportAnchorY=r.get("viewportanchorY",100),t.scroll=r.get("scroll",""),n.onregion&&n.onregion(t),n.regionList.push({id:r.get("id"),region:t})))},/:/)}e&&(n.buffer+=n.decoder.decode(e,{stream:!0}));try{if("INITIAL"===n.state){if(!/\r\n|\n/.test(n.buffer))return this;var r,s=(r=t()).match(/^WEBVTT([ \t].*)?$/);if(!s||!s[0])throw new oi(oi.Errors.BadSignature);n.state="HEADER"}for(var a=!1;n.buffer;){if(!/\r\n|\n/.test(n.buffer))return this;switch(a?a=!1:r=t(),n.state){case"HEADER":/:/.test(r)?i(r):r||(n.state="ID");continue;case"NOTE":r||(n.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){n.state="NOTE";break}if(!r)continue;n.cue=new(n.vttjs.VTTCue||n.window.VTTCue)(0,0,"");try{n.cue.align="center"}catch(e){n.cue.align="middle"}if(n.state="CUE",-1===r.indexOf("--\x3e")){n.cue.id=r;continue}case"CUE":try{hi(r,n.cue,n.regionList)}catch(e){n.reportOrThrowError(e),n.cue=null,n.state="BADCUE";continue}n.state="CUETEXT";continue;case"CUETEXT":var o=-1!==r.indexOf("--\x3e");if(!r||o&&(a=!0)){n.oncue&&n.oncue(n.cue),n.cue=null,n.state="ID";continue}n.cue.text&&(n.cue.text+="\n"),n.cue.text+=r.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":r||(n.state="ID");continue}}}catch(e){n.reportOrThrowError(e),"CUETEXT"===n.state&&n.cue&&n.oncue&&n.oncue(n.cue),n.cue=null,n.state="INITIAL"===n.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var t=this;try{if(t.buffer+=t.decoder.decode(),!t.cue&&"HEADER"!==t.state||(t.buffer+="\n\n",t.parse()),"INITIAL"===t.state)throw new oi(oi.Errors.BadSignature)}catch(e){t.reportOrThrowError(e)}return t.onflush&&t.onflush(),this}};var Ei=Ci,wi={"":1,lr:1,rl:1},Ai={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function Ii(e){return"string"==typeof e&&(!!Ai[e.toLowerCase()]&&e.toLowerCase())}function Pi(e,t,i){this.hasBeenReset=!1;var n="",r=!1,s=e,a=t,o=i,u=null,l="",c=!0,h="auto",d="start",p="auto",f="auto",m=100,g="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return n},set:function(e){n=""+e}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(e){r=!!e}},startTime:{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");s=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");a=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(e){o=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(e){u=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return l},set:function(e){e="string"==typeof(e=e)&&(!!wi[e.toLowerCase()]&&e.toLowerCase());if(!1===e)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");l=e,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return c},set:function(e){c=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return h},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("Line: an invalid number or illegal string was specified.");h=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return d},set:function(e){e=Ii(e);e?(d=e,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return p},set:function(e){if(e<0||100<e)throw new Error("Position must be between 0 and 100.");p=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return f},set:function(e){e=Ii(e);e?(f=e,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return m},set:function(e){if(e<0||100<e)throw new Error("Size must be between 0 and 100.");m=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return g},set:function(e){e=Ii(e);if(!e)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");g=e,this.hasBeenReset=!0}}}),this.displayState=void 0}Pi.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var xi=Pi,Li={"":!0,up:!0};function Oi(e){return"number"==typeof e&&0<=e&&e<=100}function Di(){var t=100,i=3,n=0,r=100,s=0,a=100,o="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return t},set:function(e){if(!Oi(e))throw new Error("Width must be between 0 and 100.");t=e}},lines:{enumerable:!0,get:function(){return i},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");i=e}},regionAnchorY:{enumerable:!0,get:function(){return r},set:function(e){if(!Oi(e))throw new Error("RegionAnchorX must be between 0 and 100.");r=e}},regionAnchorX:{enumerable:!0,get:function(){return n},set:function(e){if(!Oi(e))throw new Error("RegionAnchorY must be between 0 and 100.");n=e}},viewportAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!Oi(e))throw new Error("ViewportAnchorY must be between 0 and 100.");a=e}},viewportAnchorX:{enumerable:!0,get:function(){return s},set:function(e){if(!Oi(e))throw new Error("ViewportAnchorX must be between 0 and 100.");s=e}},scroll:{enumerable:!0,get:function(){return o},set:function(e){e="string"==typeof(e=e)&&(!!Li[e.toLowerCase()]&&e.toLowerCase());!1===e?console.warn("Scroll: an invalid or illegal string was specified."):o=e}}})}var Ni=e(function(e){e=e.exports={WebVTT:Ei,VTTCue:xi,VTTRegion:Di};d.vttjs=e,d.WebVTT=e.WebVTT;var t=e.VTTCue,i=e.VTTRegion,n=d.VTTCue,r=d.VTTRegion;e.shim=function(){d.VTTCue=t,d.VTTRegion=i},e.restore=function(){d.VTTCue=n,d.VTTRegion=r},d.VTTCue||e.shim()});Ni.WebVTT,Ni.VTTCue,Ni.VTTRegion;var Ri=function(n){function i(t,e){var i;return void 0===e&&(e=function(){}),(t=void 0===t?{}:t).reportTouchActivity=!1,(i=n.call(this,null,t,e)||this).hasStarted_=!1,i.on("playing",function(){this.hasStarted_=!0}),i.on("loadstart",function(){this.hasStarted_=!1}),ri.names.forEach(function(e){e=ri[e];t&&t[e.getterName]&&(i[e.privateName]=t[e.getterName])}),i.featuresProgressEvents||i.manualProgressOn(),i.featuresTimeupdateEvents||i.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(e){!1===t["native"+e+"Tracks"]&&(i["featuresNative"+e+"Tracks"]=!1)}),!1===t.nativeCaptions||!1===t.nativeTextTracks?i.featuresNativeTextTracks=!1:!0!==t.nativeCaptions&&!0!==t.nativeTextTracks||(i.featuresNativeTextTracks=!0),i.featuresNativeTextTracks||i.emulateTextTracks(),i.preloadTextTracks=!1!==t.preloadTextTracks,i.autoRemoteTextTracks_=new ri.text.ListClass,i.initTrackListeners(),t.nativeControlsForTouch||i.emitTapEvents(),i.constructor&&(i.name_=i.constructor.name||"Unknown Tech"),i}Be(i,n);var e=i.prototype;return e.triggerSourceset=function(e){var t=this;this.isReady_||this.one("ready",function(){return t.setTimeout(function(){return t.triggerSourceset(e)},1)}),this.trigger({src:e,type:"sourceset"})},e.manualProgressOn=function(){this.on("durationchange",this.onDurationChange),this.manualProgress=!0,this.one("ready",this.trackProgress)},e.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange)},e.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(ye(this,function(){var e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),1===(this.bufferedPercent_=e)&&this.stopTrackingProgress()}),500)},e.onDurationChange=function(e){this.duration_=this.duration()},e.buffered=function(){return ut(0,0)},e.bufferedPercent=function(){return lt(this.buffered(),this.duration_)},e.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},e.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime),this.on("pause",this.stopTrackingCurrentTime)},e.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime),this.off("pause",this.stopTrackingCurrentTime)},e.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},e.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},e.dispose=function(){this.clearTracks(ii.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),n.prototype.dispose.call(this)},e.clearTracks=function(e){var r=this;(e=[].concat(e)).forEach(function(e){for(var t=r[e+"Tracks"]()||[],i=t.length;i--;){var n=t[i];"text"===e&&r.removeRemoteTextTrack(n),t.removeTrack(n)}})},e.cleanupAutoTextTracks=function(){for(var e=this.autoRemoteTextTracks_||[],t=e.length;t--;){var i=e[t];this.removeRemoteTextTrack(i)}},e.reset=function(){},e.crossOrigin=function(){},e.setCrossOrigin=function(){},e.error=function(e){return void 0!==e&&(this.error_=new gt(e),this.trigger("error")),this.error_},e.played=function(){return this.hasStarted_?ut(0,0):ut()},e.setScrubbing=function(){},e.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},e.initTrackListeners=function(){var r=this;ii.names.forEach(function(e){function t(){r.trigger(e+"trackchange")}var i=ii[e],n=r[i.getterName]();n.addEventListener("removetrack",t),n.addEventListener("addtrack",t),r.on("dispose",function(){n.removeEventListener("removetrack",t),n.removeEventListener("addtrack",t)})})},e.addWebVttScript_=function(){var e,t=this;d.WebVTT||(h.body.contains(this.el())?!this.options_["vtt.js"]&&c(Ni)&&0<Object.keys(Ni).length?this.trigger("vttjsloaded"):((e=h.createElement("script")).src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=function(){t.trigger("vttjsloaded")},e.onerror=function(){t.trigger("vttjserror")},this.on("dispose",function(){e.onload=null,e.onerror=null}),d.WebVTT=!0,this.el().parentNode.appendChild(e)):this.ready(this.addWebVttScript_))},e.emulateTextTracks=function(){function t(e){return n.addTrack(e.track)}function i(e){return n.removeTrack(e.track)}var e=this,n=this.textTracks(),r=this.remoteTextTracks();r.on("addtrack",t),r.on("removetrack",i),this.addWebVttScript_();function s(){a();for(var e=0;e<n.length;e++){var t=n[e];t.removeEventListener("cuechange",a),"showing"===t.mode&&t.addEventListener("cuechange",a)}}var a=function(){return e.trigger("texttrackchange")};s(),n.addEventListener("change",s),n.addEventListener("addtrack",s),n.addEventListener("removetrack",s),this.on("dispose",function(){r.off("addtrack",t),r.off("removetrack",i),n.removeEventListener("change",s),n.removeEventListener("addtrack",s),n.removeEventListener("removetrack",s);for(var e=0;e<n.length;e++)n[e].removeEventListener("cuechange",a)})},e.addTextTrack=function(e,t,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return function(e,t,i,n,r){void 0===r&&(r={});var s=e.textTracks();return r.kind=t,i&&(r.label=i),n&&(r.language=n),r.tech=e,r=new ri.text.TrackClass(r),s.addTrack(r),r}(this,e,t,i)},e.createRemoteTextTrack=function(e){e=Le(e,{tech:this});return new ni.remoteTextEl.TrackClass(e)},e.addRemoteTextTrack=function(e,t){var i=this,n=this.createRemoteTextTrack(e=void 0===e?{}:e);return!0!==t&&!1!==t&&(p.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),t=!0),this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),!0!==t&&this.ready(function(){return i.autoRemoteTextTracks_.addTrack(n.track)}),n},e.removeRemoteTextTrack=function(e){var t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},e.getVideoPlaybackQuality=function(){return{}},e.requestPictureInPicture=function(){var e=this.options_.Promise||d.Promise;if(e)return e.reject()},e.disablePictureInPicture=function(){return!0},e.setDisablePictureInPicture=function(){},e.setPoster=function(){},e.playsinline=function(){},e.setPlaysinline=function(){},e.overrideNativeAudioTracks=function(){},e.overrideNativeVideoTracks=function(){},e.canPlayType=function(){return""},i.canPlayType=function(){return""},i.canPlaySource=function(e,t){return i.canPlayType(e.type)},i.isTech=function(e){return e.prototype instanceof i||e instanceof i||e===i},i.registerTech=function(e,t){if(i.techs_||(i.techs_={}),!i.isTech(t))throw new Error("Tech "+e+" must be a Tech");if(!i.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!i.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=xe(e),i.techs_[e]=t,i.techs_[Pe(e)]=t,"Tech"!==e&&i.defaultTechOrder_.push(e),t},i.getTech=function(e){if(e)return i.techs_&&i.techs_[e]?i.techs_[e]:(e=xe(e),d&&d.videojs&&d.videojs[e]?(p.warn("The "+e+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),d.videojs[e]):void 0)},i}(Ue);ri.names.forEach(function(e){var t=ri[e];Ri.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}}),Ri.prototype.featuresVolumeControl=!0,Ri.prototype.featuresMuteControl=!0,Ri.prototype.featuresFullscreenResize=!1,Ri.prototype.featuresPlaybackRate=!1,Ri.prototype.featuresProgressEvents=!1,Ri.prototype.featuresSourceset=!1,Ri.prototype.featuresTimeupdateEvents=!1,Ri.prototype.featuresNativeTextTracks=!1,Ri.withSourceHandlers=function(r){r.registerSourceHandler=function(e,t){var i=(i=r.sourceHandlers)||(r.sourceHandlers=[]);void 0===t&&(t=i.length),i.splice(t,0,e)},r.canPlayType=function(e){for(var t,i=r.sourceHandlers||[],n=0;n<i.length;n++)if(t=i[n].canPlayType(e))return t;return""},r.selectSourceHandler=function(e,t){for(var i=r.sourceHandlers||[],n=0;n<i.length;n++)if(i[n].canHandleSource(e,t))return i[n];return null},r.canPlaySource=function(e,t){var i=r.selectSourceHandler(e,t);return i?i.canHandleSource(e,t):""};["seekable","seeking","duration"].forEach(function(e){var t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})},r.prototype),r.prototype.setSource=function(e){var t=r.selectSourceHandler(e,this.options_);t||(r.nativeSourceHandler?t=r.nativeSourceHandler:p.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler),t!==r.nativeSourceHandler&&(this.currentSource_=e),this.sourceHandler_=t.handleSource(e,this,this.options_),this.one("dispose",this.disposeSourceHandler)},r.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},Ue.registerComponent("Tech",Ri),Ri.registerTech("Tech",Ri),Ri.defaultTechOrder_=[];var Ui={},Mi={},Bi={};function ji(e,t,i){e.setTimeout(function(){return function i(n,e,r,s,a,o){void 0===n&&(n={});void 0===e&&(e=[]);void 0===a&&(a=[]);void 0===o&&(o=!1);var t=e,e=t[0],u=t.slice(1);if("string"==typeof e)i(n,Ui[e],r,s,a,o);else if(e){var l=zi(s,e);if(!l.setSource)return a.push(l),i(n,u,r,s,a,o);l.setSource(m({},n),function(e,t){return e?i(n,u,r,s,a,o):(a.push(l),void i(t,n.type===t.type?u:Ui[t.type],r,s,a,o))})}else u.length?i(n,u,r,s,a,o):o?r(n,a):i(n,Ui["*"],r,s,a,!0)}(t,Ui[t.type],i,e)},1)}function Fi(e,t,i,n){void 0===n&&(n=null);var r="call"+xe(i),r=e.reduce(Wi(r),n),n=r===Bi,r=n?null:t[i](r);return function(e,t,i,n){for(var r=e.length-1;0<=r;r--){var s=e[r];s[t]&&s[t](n,i)}}(e,i,r,n),r}var Hi={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1},Vi={setCurrentTime:1,setMuted:1,setVolume:1},qi={play:1,pause:1};function Wi(i){return function(e,t){return e===Bi?Bi:t[i]?t[i](e):e}}function zi(e,t){var i=Mi[e.id()],n=null;if(null==i)return n=t(e),Mi[e.id()]=[[t,n]],n;for(var r=0;r<i.length;r++){var s=i[r],a=s[0],s=s[1];a===t&&(n=s)}return null===n&&(n=t(e),i.push([t,n])),n}function Gi(e){var t;return e=Array.isArray(e)?(t=[],e.forEach(function(e){e=Gi(e),Array.isArray(e)?t=t.concat(e):o(e)&&t.push(e)}),t):"string"==typeof e&&e.trim()?[Yi({src:e})]:o(e)&&"string"==typeof e.src&&e.src&&e.src.trim()?[Yi(e)]:[]}var Xi={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},Ki=function(e){e=Ht(e=void 0===e?"":e);return Xi[e.toLowerCase()]||""};function Yi(e){var t;return e.type||(t=Ki(e.src))&&(e.type=t),e}Ve=function(u){function e(e,t,i){var n=Le({createEl:!1},t),i=u.call(this,e,n,i)||this;if(t.playerOptions.sources&&0!==t.playerOptions.sources.length)e.src(t.playerOptions.sources);else for(var r=0,s=t.playerOptions.techOrder;r<s.length;r++){var a=xe(s[r]),o=Ri.getTech(a);if((o=!a?Ue.getComponent(a):o)&&o.isSupported()){e.loadTech_(a);break}}return i}return Be(e,u),e}(Ue);Ue.registerComponent("MediaLoader",Ve);qe=function(n){function e(e,t){t=n.call(this,e,t)||this;return t.emitTapEvents(),t.enable(),t}Be(e,n);var t=e.prototype;return t.createEl=function(e,t,i){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===i&&(i={}),t=m({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&p.error("Creating a ClickableComponent with an HTML element of "+e+" is not supported; use a Button instead."),i=m({role:"button"},i),this.tabIndex_=t.tabIndex;i=n.prototype.createEl.call(this,e,t,i);return this.createControlTextEl(i),i},t.dispose=function(){this.controlTextEl_=null,n.prototype.dispose.call(this)},t.createControlTextEl=function(e){return this.controlTextEl_=T("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},t.controlText=function(e,t){if(void 0===t&&(t=this.el()),void 0===e)return this.controlText_||"Need Text";var i=this.localize(e);this.controlText_=e,S(this.controlTextEl_,i),this.nonIconControl||t.setAttribute("title",i)},t.buildCSSClass=function(){return"vjs-control vjs-button "+n.prototype.buildCSSClass.call(this)},t.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick),this.on("keydown",this.handleKeyDown))},t.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver),this.off("mouseout",this.handleMouseOut),this.off(["tap","click"],this.handleClick),this.off("keydown",this.handleKeyDown)},t.handleClick=function(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)},t.handleKeyDown=function(e){Ct.isEventKey(e,"Space")||Ct.isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):n.prototype.handleKeyDown.call(this,e)},e}(Ue);Ue.registerComponent("ClickableComponent",qe);Je=function(i){function e(e,t){t=i.call(this,e,t)||this;return t.update(),e.on("posterchange",ye(Me(t),t.update)),t}Be(e,i);var t=e.prototype;return t.dispose=function(){this.player().off("posterchange",this.update),i.prototype.dispose.call(this)},t.createEl=function(){return T("div",{className:"vjs-poster",tabIndex:-1})},t.update=function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()},t.setSrc=function(e){e=e?'url("'+e+'")':"";this.el_.style.backgroundImage=e},t.handleClick=function(e){var t;this.player_.controls()&&(t=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&0<this.player_.eme.sessions.length,!this.player_.tech(!0)||(Qe||Ke)&&t||this.player_.tech(!0).focus(),this.player_.paused()?bt(this.player_.play()):this.player_.pause())},e}(qe);Ue.registerComponent("PosterImage",Je);var $i="#222",Qi={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 Ji(e,t){var i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function Zi(e,t,i){try{e.style[t]=i}catch(e){return}}tt=function(r){function e(i,e,t){var t=r.call(this,i,e,t)||this,n=ye(Me(t),t.updateDisplay);return i.on("loadstart",ye(Me(t),t.toggleDisplay)),i.on("texttrackchange",n),i.on("loadedmetadata",ye(Me(t),t.preselectTrack)),i.ready(ye(Me(t),function(){if(i.tech_&&i.tech_.featuresNativeTextTracks)this.hide();else{i.on("fullscreenchange",n),i.on("playerresize",n),d.addEventListener("orientationchange",n),i.on("dispose",function(){return d.removeEventListener("orientationchange",n)});for(var e=this.options_.playerOptions.tracks||[],t=0;t<e.length;t++)this.player_.addRemoteTextTrack(e[t],!0);this.preselectTrack()}})),t}Be(e,r);var t=e.prototype;return t.preselectTrack=function(){for(var e,t,i,n={captions:1,subtitles:1},r=this.player_.textTracks(),s=this.player_.cache_.selectedLanguage,a=0;a<r.length;a++){var o=r[a];s&&s.enabled&&s.language&&s.language===o.language&&o.kind in n?i=o.kind!==s.kind&&i||o:s&&!s.enabled?t=e=i=null:o.default&&("descriptions"!==o.kind||e?o.kind in n&&!t&&(t=o):e=o)}i?i.mode="showing":t?t.mode="showing":e&&(e.mode="showing")},t.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},t.createEl=function(){return r.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{"aria-live":"off","aria-atomic":"true"})},t.clearDisplay=function(){"function"==typeof d.WebVTT&&d.WebVTT.processCues(d,[],this.el_)},t.updateDisplay=function(){var e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){for(var i=[],n=0;n<e.length;++n){var r=e[n];"showing"===r.mode&&i.push(r)}this.updateForTrack(i)}else{for(var s=null,a=null,o=e.length;o--;){var u=e[o];"showing"===u.mode&&("descriptions"===u.kind?s=u:a=u)}a?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(a)):s&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(s))}},t.updateDisplayState=function(e){for(var t=this.player_.textTrackSettings.getValues(),i=e.activeCues,n=i.length;n--;){var r,s=i[n];s&&(r=s.displayState,t.color&&(r.firstChild.style.color=t.color),t.textOpacity&&Zi(r.firstChild,"color",Ji(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(r.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&Zi(r.firstChild,"backgroundColor",Ji(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?Zi(r,"backgroundColor",Ji(t.windowColor,t.windowOpacity)):r.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?r.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px "+$i:"raised"===t.edgeStyle?r.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px "+$i:"depressed"===t.edgeStyle?r.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px "+$i:"uniform"===t.edgeStyle&&(r.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px "+$i)),t.fontPercent&&1!==t.fontPercent&&(s=d.parseFloat(r.style.fontSize),r.style.fontSize=s*t.fontPercent+"px",r.style.height="auto",r.style.top="auto",r.style.bottom="2px"),t.fontFamily&&"default"!==t.fontFamily&&("small-caps"===t.fontFamily?r.firstChild.style.fontVariant="small-caps":r.firstChild.style.fontFamily=Qi[t.fontFamily]))}},t.updateForTrack=function(e){if(Array.isArray(e)||(e=[e]),"function"==typeof d.WebVTT&&!e.every(function(e){return!e.activeCues})){for(var t=[],i=0;i<e.length;++i)for(var n=e[i],r=0;r<n.activeCues.length;++r)t.push(n.activeCues[r]);d.WebVTT.processCues(d,t,this.el_);for(var s=0;s<e.length;++s){for(var a=e[s],o=0;o<a.activeCues.length;++o){var u=a.activeCues[o].displayState;E(u,"vjs-text-track-cue"),E(u,"vjs-text-track-cue-"+(a.language||s))}this.player_.textTrackSettings&&this.updateDisplayState(a)}}},e}(Ue);Ue.registerComponent("TextTrackDisplay",tt),Ue.registerComponent("LoadingSpinner",function(i){function e(){return i.apply(this,arguments)||this}return Be(e,i),e.prototype.createEl=function(){var e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),e=T("span",{className:"vjs-control-text",innerHTML:this.localize("{1} is loading.",[t])}),t=i.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return t.appendChild(e),t},e}(Ue));var en=function(t){function e(){return t.apply(this,arguments)||this}Be(e,t);var i=e.prototype;return i.createEl=function(e,t,i){void 0===t&&(t={}),void 0===i&&(i={}),t=m({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass()},t),i=m({type:"button"},i);i=Ue.prototype.createEl.call(this,"button",t,i);return this.createControlTextEl(i),i},i.addChild=function(e,t){void 0===t&&(t={});var i=this.constructor.name;return p.warn("Adding an actionable (user controllable) child to a Button ("+i+") is not supported; use a ClickableComponent instead."),Ue.prototype.addChild.call(this,e,t)},i.enable=function(){t.prototype.enable.call(this),this.el_.removeAttribute("disabled")},i.disable=function(){t.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},i.handleKeyDown=function(e){Ct.isEventKey(e,"Space")||Ct.isEventKey(e,"Enter")?e.stopPropagation():t.prototype.handleKeyDown.call(this,e)},e}(qe);Ue.registerComponent("Button",en);Xt=function(i){function e(e,t){t=i.call(this,e,t)||this;return t.mouseused_=!1,t.on("mousedown",t.handleMouseDown),t}Be(e,i);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-big-play-button"},t.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY){var i=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&0<this.player_.eme.sessions.length;return bt(t),void(!this.player_.tech(!0)||(Qe||Ke)&&i||this.player_.tech(!0).focus())}var i=this.player_.getChild("controlBar"),n=i&&i.getChild("playToggle");n?(i=function(){return n.focus()},_t(t)?t.then(i,function(){}):this.setTimeout(i,1)):this.player_.tech(!0).focus()},t.handleKeyDown=function(e){this.mouseused_=!1,i.prototype.handleKeyDown.call(this,e)},t.handleMouseDown=function(e){this.mouseused_=!0},e}(en);Xt.prototype.controlText_="Play Video",Ue.registerComponent("BigPlayButton",Xt);Ne=function(i){function e(e,t){e=i.call(this,e,t)||this;return e.controlText(t&&t.controlText||e.localize("Close")),e}Be(e,i);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-close-button "+i.prototype.buildCSSClass.call(this)},t.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},t.handleKeyDown=function(e){Ct.isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):i.prototype.handleKeyDown.call(this,e)},e}(en);Ue.registerComponent("CloseButton",Ne);Dt=function(n){function e(e,t){var i=n.call(this,e,t=void 0===t?{}:t)||this;return t.replay=void 0===t.replay||t.replay,i.on(e,"play",i.handlePlay),i.on(e,"pause",i.handlePause),t.replay&&i.on(e,"ended",i.handleEnded),i}Be(e,n);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-play-control "+n.prototype.buildCSSClass.call(this)},t.handleClick=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},t.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},t.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},t.handleEnded=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",this.handleSeeked)},e}(en);Dt.prototype.controlText_="Play",Ue.registerComponent("PlayToggle",Dt);function tn(e,t){e=e<0?0:e;var i=Math.floor(e%60),n=Math.floor(e/60%60),r=Math.floor(e/3600),s=Math.floor(t/60%60),t=Math.floor(t/3600);return(r=0<(r=isNaN(e)||e===1/0?n=i="-":r)||0<t?r+":":"")+(n=((r||10<=s)&&n<10?"0"+n:n)+":")+(i=i<10?"0"+i:i)}var nn=tn;function rn(e,t){return nn(e,t=void 0===t?e:t)}Nt=function(i){function e(e,t){t=i.call(this,e,t)||this;return t.on(e,["timeupdate","ended"],t.updateContent),t.updateTextNode_(),t}Be(e,i);var t=e.prototype;return t.createEl=function(){var e=this.buildCSSClass(),t=i.prototype.createEl.call(this,"div",{className:e+" vjs-time-control vjs-control",innerHTML:'<span class="vjs-control-text" role="presentation">'+this.localize(this.labelText_)+" </span>"});return this.contentEl_=T("span",{className:e+"-display"},{"aria-live":"off",role:"presentation"}),t.appendChild(this.contentEl_),t},t.dispose=function(){this.contentEl_=null,this.textNode_=null,i.prototype.dispose.call(this)},t.updateTextNode_=function(e){var t=this;e=rn(e=void 0===e?0:e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){var e;t.contentEl_&&(e=t.textNode_,t.textNode_=h.createTextNode(t.formattedTime_),t.textNode_&&(e?t.contentEl_.replaceChild(t.textNode_,e):t.contentEl_.appendChild(t.textNode_)))}))},t.updateContent=function(e){},e}(Ue);Nt.prototype.labelText_="Time",Nt.prototype.controlText_="Time",Ue.registerComponent("TimeDisplay",Nt);Rt=function(e){function t(){return e.apply(this,arguments)||this}Be(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-current-time"},i.updateContent=function(e){var t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateTextNode_(t)},t}(Nt);Rt.prototype.labelText_="Current Time",Rt.prototype.controlText_="Current Time",Ue.registerComponent("CurrentTimeDisplay",Rt);Oe=function(i){function e(e,t){t=i.call(this,e,t)||this;return t.on(e,"durationchange",t.updateContent),t.on(e,"loadstart",t.updateContent),t.on(e,"loadedmetadata",t.updateContent),t}Be(e,i);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-duration"},t.updateContent=function(e){var t=this.player_.duration();this.updateTextNode_(t)},e}(Nt);Oe.prototype.labelText_="Duration",Oe.prototype.controlText_="Duration",Ue.registerComponent("DurationDisplay",Oe),Ue.registerComponent("TimeDivider",function(e){function t(){return e.apply(this,arguments)||this}return Be(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"<div><span>/</span></div>"},{"aria-hidden":!0})},t}(Ue));ti=function(i){function e(e,t){t=i.call(this,e,t)||this;return t.on(e,"durationchange",t.updateContent),t}Be(e,i);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-remaining-time"},t.createEl=function(){var e=i.prototype.createEl.call(this);return e.insertBefore(T("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e},t.updateContent=function(e){var t;"number"==typeof this.player_.duration()&&(t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t))},e}(Nt);ti.prototype.labelText_="Remaining Time",ti.prototype.controlText_="Remaining Time",Ue.registerComponent("RemainingTimeDisplay",ti);Ve=function(i){function e(e,t){t=i.call(this,e,t)||this;return t.updateShowing(),t.on(t.player(),"durationchange",t.updateShowing),t}Be(e,i);var t=e.prototype;return t.createEl=function(){var e=i.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=T("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Stream Type")+" </span>"+this.localize("LIVE")},{"aria-live":"off"}),e.appendChild(this.contentEl_),e},t.dispose=function(){this.contentEl_=null,i.prototype.dispose.call(this)},t.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},e}(Ue);Ue.registerComponent("LiveDisplay",Ve);Je=function(i){function e(e,t){t=i.call(this,e,t)||this;return t.updateLiveEdgeStatus(),t.player_.liveTracker&&t.on(t.player_.liveTracker,"liveedgechange",t.updateLiveEdgeStatus),t}Be(e,i);var t=e.prototype;return t.createEl=function(){var e=i.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=T("span",{className:"vjs-seek-to-live-text",innerHTML:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e},t.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},t.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},t.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatus),this.textEl_=null,i.prototype.dispose.call(this)},e}(en);Je.prototype.controlText_="Seek to live, currently playing live",Ue.registerComponent("SeekToLive",Je);function sn(e,t,i){return e=Number(e),Math.min(i,Math.max(t,isNaN(e)?t:e))}tt=function(n){function e(e,t){t=n.call(this,e,t)||this;return t.bar=t.getChild(t.options_.barName),t.vertical(!!t.options_.vertical),t.enable(),t}Be(e,n);var t=e.prototype;return t.enabled=function(){return this.enabled_},t.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown),this.on("touchstart",this.handleMouseDown),this.on("keydown",this.handleKeyDown),this.on("click",this.handleClick),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},t.disable=function(){var e;this.enabled()&&(e=this.bar.el_.ownerDocument,this.off("mousedown",this.handleMouseDown),this.off("touchstart",this.handleMouseDown),this.off("keydown",this.handleKeyDown),this.off("click",this.handleClick),this.off(this.player_,"controlsvisible",this.update),this.off(e,"mousemove",this.handleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchmove",this.handleMouseMove),this.off(e,"touchend",this.handleMouseUp),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1)},t.createEl=function(e,t,i){return void 0===i&&(i={}),(t=void 0===t?{}:t).className=t.className+" vjs-slider",t=m({tabIndex:0},t),i=m({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},i),n.prototype.createEl.call(this,e,t,i)},t.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||Ye||e.preventDefault(),D(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchmove",this.handleMouseMove),this.on(t,"touchend",this.handleMouseUp),this.handleMouseMove(e)},t.handleMouseMove=function(e){},t.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;N(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchmove",this.handleMouseMove),this.off(e,"touchend",this.handleMouseUp),this.update()},t.update=function(){var t=this;if(this.el_&&this.bar){var i=this.getProgress();return i===this.progress_?i:(this.progress_=i,this.requestNamedAnimationFrame("Slider#update",function(){var e=t.vertical()?"height":"width";t.bar.el().style[e]=(100*i).toFixed(2)+"%"}),i)}},t.getProgress=function(){return Number(sn(this.getPercent(),0,1).toFixed(4))},t.calculateDistance=function(e){e=M(this.el_,e);return this.vertical()?e.y:e.x},t.handleKeyDown=function(e){Ct.isEventKey(e,"Left")||Ct.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):Ct.isEventKey(e,"Right")||Ct.isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):n.prototype.handleKeyDown.call(this,e)},t.handleClick=function(e){e.stopPropagation(),e.preventDefault()},t.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},e}(Ue);Ue.registerComponent("Slider",tt);function an(e,t){return sn(e/t*100,0,100).toFixed(2)+"%"}Xt=function(r){function e(e,t){t=r.call(this,e,t)||this;return t.partEls_=[],t.on(e,"progress",t.update),t}Be(e,r);var t=e.prototype;return t.createEl=function(){var e=r.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),t=T("span",{className:"vjs-control-text"}),i=T("span",{textContent:this.localize("Loaded")}),n=h.createTextNode(": ");return this.percentageEl_=T("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(n),t.appendChild(this.percentageEl_),e},t.dispose=function(){this.partEls_=null,this.percentageEl_=null,r.prototype.dispose.call(this)},t.update=function(e){var l=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var e=l.player_.liveTracker,t=l.player_.buffered(),e=e&&e.isLive()?e.seekableEnd():l.player_.duration(),i=l.player_.bufferedEnd(),n=l.partEls_,e=an(i,e);l.percent_!==e&&(l.el_.style.width=e,S(l.percentageEl_,e),l.percent_=e);for(var r=0;r<t.length;r++){var s=t.start(r),a=t.end(r),o=n[r];o||(o=l.el_.appendChild(T()),n[r]=o),o.dataset.start===s&&o.dataset.end===a||(o.dataset.start=s,o.dataset.end=a,o.style.left=an(s,i),o.style.width=an(a-s,i))}for(var u=n.length;u>t.length;u--)l.el_.removeChild(n[u-1]);n.length=t.length})},e}(Ue);Ue.registerComponent("LoadProgressBar",Xt);Ne=function(i){function e(e,t){t=i.call(this,e,t)||this;return t.update=de(ye(Me(t),t.update),30),t}Be(e,i);var t=e.prototype;return t.createEl=function(){return i.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},t.update=function(e,t,i){var n=U(this.el_),r=R(this.player_.el()),s=e.width*t;r&&n&&(t=e.left-r.left+s,r=e.width-s+(r.right-e.right),t<(e=n.width/2)?e+=e-t:r<e&&(e=r),e<0?e=0:e>n.width&&(e=n.width),this.el_.style.right="-"+e+"px",this.write(i))},t.write=function(e){S(this.el_,e)},t.updateTime=function(n,r,s,a){var o=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var e,t,i=o.player_.duration();i=o.player_.liveTracker&&o.player_.liveTracker.isLive()?((t=(e=o.player_.liveTracker.liveWindow())-r*e)<1?"":"-")+rn(t,e):rn(s,i),o.update(n,r,i),a&&a()})},e}(Ue);Ue.registerComponent("TimeTooltip",Ne);Dt=function(i){function e(e,t){t=i.call(this,e,t)||this;return t.update=de(ye(Me(t),t.update),30),t}Be(e,i);var t=e.prototype;return t.createEl=function(){return i.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},t.update=function(e,t){var i,n=this.getChild("timeTooltip");n&&(i=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),n.updateTime(e,t,i))},e}(Ue);Dt.prototype.options_={children:[]},nt||We||Dt.prototype.options_.children.push("timeTooltip"),Ue.registerComponent("PlayProgressBar",Dt);Rt=function(i){function e(e,t){t=i.call(this,e,t)||this;return t.update=de(ye(Me(t),t.update),30),t}Be(e,i);var t=e.prototype;return t.createEl=function(){return i.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.update=function(e,t){var i=this,n=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,n,function(){i.el_.style.left=e.width*t+"px"})},e}(Ue);Rt.prototype.options_={children:["timeTooltip"]},Ue.registerComponent("MouseTimeDisplay",Rt);Oe=function(i){function e(e,t){t=i.call(this,e,t)||this;return t.setEventHandlers_(),t}Be(e,i);var t=e.prototype;return t.setEventHandlers_=function(){this.update_=ye(this,this.update),this.update=de(this.update_,30),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.on(this.player_,["playing"],this.enableInterval_),this.on(this.player_,["ended","pause","waiting"],this.disableInterval_),"hidden"in h&&"visibilityState"in h&&this.on(h,"visibilitychange",this.toggleVisibility_)},t.toggleVisibility_=function(e){h.hidden?this.disableInterval_(e):(this.enableInterval_(),this.update())},t.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,30))},t.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},t.createEl=function(){return i.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},t.update=function(e){var n=this,r=i.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var e=n.player_.ended()?n.player_.duration():n.getCurrentTime_(),t=n.player_.liveTracker,i=n.player_.duration();t&&t.isLive()&&(i=n.player_.liveTracker.liveCurrentTime()),n.percent_!==r&&(n.el_.setAttribute("aria-valuenow",(100*r).toFixed(2)),n.percent_=r),n.currentTime_===e&&n.duration_===i||(n.el_.setAttribute("aria-valuetext",n.localize("progress bar timing: currentTime={1} duration={2}",[rn(e,i),rn(i,i)],"{1} of {2}")),n.currentTime_=e,n.duration_=i),n.bar&&n.bar.update(R(n.el()),n.getProgress())}),r},t.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},t.getPercent=function(){var e,t=this.getCurrentTime_(),i=this.player_.liveTracker;return i&&i.isLive()?(e=(t-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e},t.handleMouseDown=function(e){q(e)&&(e.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),i.prototype.handleMouseDown.call(this,e))},t.handleMouseMove=function(e){if(q(e)){var t=this.calculateDistance(e),i=this.player_.liveTracker;if(i&&i.isLive()){if(.99<=t)return void i.seekToLiveEdge();var n,r=i.seekableStart(),e=i.liveCurrentTime();if((n=(n=e<=(n=r+t*i.liveWindow())?e:n)<=r?r+.1:n)===1/0)return}else(n=t*this.player_.duration())===this.player_.duration()&&(n-=.1);this.player_.currentTime(n)}},t.enable=function(){i.prototype.enable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.show()},t.disable=function(){i.prototype.disable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.hide()},t.handleMouseUp=function(e){i.prototype.handleMouseUp.call(this,e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?bt(this.player_.play()):this.update_()},t.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+5)},t.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-5)},t.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.handleKeyDown=function(e){var t;Ct.isEventKey(e,"Space")||Ct.isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.handleAction(e)):Ct.isEventKey(e,"Home")?(e.preventDefault(),e.stopPropagation(),this.player_.currentTime(0)):Ct.isEventKey(e,"End")?(e.preventDefault(),e.stopPropagation(),this.player_.currentTime(this.player_.duration())):/^[0-9]$/.test(Ct(e))?(e.preventDefault(),e.stopPropagation(),t=10*(Ct.codes[Ct(e)]-Ct.codes[0])/100,this.player_.currentTime(this.player_.duration()*t)):Ct.isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.player_.currentTime(this.player_.currentTime()-60)):Ct.isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.player_.currentTime(this.player_.currentTime()+60)):i.prototype.handleKeyDown.call(this,e)},t.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableInterval_),this.off(this.player_,["ended","pause","waiting"],this.disableInterval_),"hidden"in h&&"visibilityState"in h&&this.off(h,"visibilitychange",this.toggleVisibility_),i.prototype.dispose.call(this)},e}(tt);Oe.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},nt||We||Oe.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),Ue.registerComponent("SeekBar",Oe);Nt=function(i){function e(e,t){t=i.call(this,e,t)||this;return t.handleMouseMove=de(ye(Me(t),t.handleMouseMove),30),t.throttledHandleMouseSeek=de(ye(Me(t),t.handleMouseSeek),30),t.enable(),t}Be(e,i);var t=e.prototype;return t.createEl=function(){return i.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},t.handleMouseMove=function(e){var t,i,n,r,s=this.getChild("seekBar");s&&(t=s.getChild("playProgressBar"),i=s.getChild("mouseTimeDisplay"),(t||i)&&(r=U(n=s.el()),e=M(n,e).x,e=sn(e,0,1),i&&i.update(r,e),t&&t.update(r,s.getProgress())))},t.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},t.enabled=function(){return this.enabled_},t.disable=function(){this.children().forEach(function(e){return e.disable&&e.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDown),this.off(this.el_,"mousemove",this.handleMouseMove),this.handleMouseUp(),this.addClass("disabled"),this.enabled_=!1)},t.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable()}),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDown),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},t.handleMouseDown=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},t.handleMouseUp=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseUp(e),this.off(t,"mousemove",this.throttledHandleMouseSeek),this.off(t,"touchmove",this.throttledHandleMouseSeek),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},e}(Ue);Nt.prototype.options_={children:["seekBar"]},Ue.registerComponent("ProgressControl",Nt);ti=function(i){function e(e,t){t=i.call(this,e,t)||this;return t.on(e,["enterpictureinpicture","leavepictureinpicture"],t.handlePictureInPictureChange),t.on(e,["disablepictureinpicturechanged","loadedmetadata"],t.handlePictureInPictureEnabledChange),t.disable(),t}Be(e,i);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-picture-in-picture-control "+i.prototype.buildCSSClass.call(this)},t.handlePictureInPictureEnabledChange=function(){h.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable()},t.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},t.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},e}(en);ti.prototype.controlText_="Picture-in-Picture",Ue.registerComponent("PictureInPictureToggle",ti);Ve=function(i){function e(e,t){t=i.call(this,e,t)||this;return t.on(e,"fullscreenchange",t.handleFullscreenChange),!1===h[e.fsApi_.fullscreenEnabled]&&t.disable(),t}Be(e,i);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-fullscreen-control "+i.prototype.buildCSSClass.call(this)},t.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},t.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},e}(en);Ve.prototype.controlText_="Fullscreen",Ue.registerComponent("FullscreenToggle",Ve);Ue.registerComponent("VolumeLevel",function(e){function t(){return e.apply(this,arguments)||this}return Be(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})},t}(Ue));Je=function(n){function e(e,t){var i=n.call(this,e,t)||this;return i.on("slideractive",i.updateLastVolume_),i.on(e,"volumechange",i.updateARIAAttributes),e.ready(function(){return i.updateARIAAttributes()}),i}Be(e,n);var t=e.prototype;return t.createEl=function(){return n.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},t.handleMouseDown=function(e){q(e)&&n.prototype.handleMouseDown.call(this,e)},t.handleMouseMove=function(e){q(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},t.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},t.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},t.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},t.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},t.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},t.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},t.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",function(){0===e.player_.volume()&&e.player_.lastVolume_(t)})},e}(tt);Je.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},Je.prototype.playerEvent="volumechange",Ue.registerComponent("VolumeBar",Je);Xt=function(s){function e(e,t){var i,n,r;return(t=void 0===t?{}:t).vertical=t.vertical||!1,void 0!==t.volumeBar&&!c(t.volumeBar)||(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),i=s.call(this,e,t)||this,n=Me(i),(r=e).tech_&&!r.tech_.featuresVolumeControl&&n.addClass("vjs-hidden"),n.on(r,"loadstart",function(){r.tech_.featuresVolumeControl?n.removeClass("vjs-hidden"):n.addClass("vjs-hidden")}),i.throttledHandleMouseMove=de(ye(Me(i),i.handleMouseMove),30),i.on("mousedown",i.handleMouseDown),i.on("touchstart",i.handleMouseDown),i.on(i.volumeBar,["focus","slideractive"],function(){i.volumeBar.addClass("vjs-slider-active"),i.addClass("vjs-slider-active"),i.trigger("slideractive")}),i.on(i.volumeBar,["blur","sliderinactive"],function(){i.volumeBar.removeClass("vjs-slider-active"),i.removeClass("vjs-slider-active"),i.trigger("sliderinactive")}),i}Be(e,s);var t=e.prototype;return t.createEl=function(){var e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),s.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+e})},t.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},t.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},t.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},e}(Ue);Xt.prototype.options_={children:["volumeBar"]},Ue.registerComponent("VolumeControl",Xt);Ne=function(r){function e(e,t){var i,n,t=r.call(this,e,t)||this;return i=Me(t),(n=e).tech_&&!n.tech_.featuresMuteControl&&i.addClass("vjs-hidden"),i.on(n,"loadstart",function(){n.tech_.featuresMuteControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")}),t.on(e,["loadstart","volumechange"],t.update),t}Be(e,r);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-mute-control "+r.prototype.buildCSSClass.call(this)},t.handleClick=function(e){var t=this.player_.volume(),i=this.player_.lastVolume_();0===t?(this.player_.volume(i<.1?.1:i),this.player_.muted(!1)):this.player_.muted(!this.player_.muted())},t.update=function(e){this.updateIcon_(),this.updateControlText_()},t.updateIcon_=function(){var e=this.player_.volume(),t=3;nt&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var i=0;i<4;i++)w(this.el_,"vjs-vol-"+i);E(this.el_,"vjs-vol-"+t)},t.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},e}(en);Ne.prototype.controlText_="Mute",Ue.registerComponent("MuteToggle",Ne);Dt=function(i){function e(e,t){return void 0!==(t=void 0===t?{}:t).inline?t.inline=t.inline:t.inline=!0,void 0!==t.volumeControl&&!c(t.volumeControl)||(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),(t=i.call(this,e,t)||this).on(e,["loadstart"],t.volumePanelState_),t.on(t.muteToggle,"keyup",t.handleKeyPress),t.on(t.volumeControl,"keyup",t.handleVolumeControlKeyUp),t.on("keydown",t.handleKeyPress),t.on("mouseover",t.handleMouseOver),t.on("mouseout",t.handleMouseOut),t.on(t.volumeControl,["slideractive"],t.sliderActive_),t.on(t.volumeControl,["sliderinactive"],t.sliderInactive_),t}Be(e,i);var t=e.prototype;return t.sliderActive_=function(){this.addClass("vjs-slider-active")},t.sliderInactive_=function(){this.removeClass("vjs-slider-active")},t.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},t.createEl=function(){var e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),i.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+e})},t.dispose=function(){this.handleMouseOut(),i.prototype.dispose.call(this)},t.handleVolumeControlKeyUp=function(e){Ct.isEventKey(e,"Esc")&&this.muteToggle.focus()},t.handleMouseOver=function(e){this.addClass("vjs-hover"),oe(h,"keyup",ye(this,this.handleKeyPress))},t.handleMouseOut=function(e){this.removeClass("vjs-hover"),ue(h,"keyup",ye(this,this.handleKeyPress))},t.handleKeyPress=function(e){Ct.isEventKey(e,"Esc")&&this.handleMouseOut()},e}(Ue);Dt.prototype.options_={children:["muteToggle","volumeControl"]},Ue.registerComponent("VolumePanel",Dt);var on=function(i){function e(e,t){e=i.call(this,e,t)||this;return t&&(e.menuButton_=t.menuButton),e.focusedChild_=-1,e.on("keydown",e.handleKeyDown),e.boundHandleBlur_=ye(Me(e),e.handleBlur),e.boundHandleTapClick_=ye(Me(e),e.handleTapClick),e}Be(e,i);var t=e.prototype;return t.addEventListenerForItem=function(e){e instanceof Ue&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},t.removeEventListenerForItem=function(e){e instanceof Ue&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},t.removeChild=function(e){"string"==typeof e&&(e=this.getChild(e)),this.removeEventListenerForItem(e),i.prototype.removeChild.call(this,e)},t.addItem=function(e){e=this.addChild(e);e&&this.addEventListenerForItem(e)},t.createEl=function(){var e=this.options_.contentElType||"ul";this.contentEl_=T(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");e=i.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return e.appendChild(this.contentEl_),oe(e,"click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),e},t.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,i.prototype.dispose.call(this)},t.handleBlur=function(e){var t=e.relatedTarget||h.activeElement;this.children().some(function(e){return e.el()===t})||(e=this.menuButton_)&&e.buttonPressed_&&t!==e.el().firstChild&&e.unpressButton()},t.handleTapClick=function(t){var e;this.menuButton_&&(this.menuButton_.unpressButton(),e=this.children(),!Array.isArray(e)||(e=e.filter(function(e){return e.el()===t.target})[0])&&"CaptionSettingsMenuItem"!==e.name()&&this.menuButton_.focus())},t.handleKeyDown=function(e){Ct.isEventKey(e,"Left")||Ct.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(Ct.isEventKey(e,"Right")||Ct.isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},t.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},t.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},t.focus=function(e){void 0===e&&(e=0);var t=this.children().slice();t.length&&t[0].className&&/vjs-menu-title/.test(t[0].className)&&t.shift(),0<t.length&&(e<0?e=0:e>=t.length&&(e=t.length-1),t[this.focusedChild_=e].el_.focus())},e}(Ue);Ue.registerComponent("Menu",on);Rt=function(n){function e(e,t){var i;(i=n.call(this,e,t=void 0===t?{}:t)||this).menuButton_=new en(e,t),i.menuButton_.controlText(i.controlText_),i.menuButton_.el_.setAttribute("aria-haspopup","true");t=en.prototype.buildCSSClass();return i.menuButton_.el_.className=i.buildCSSClass()+" "+t,i.menuButton_.removeClass("vjs-control"),i.addChild(i.menuButton_),i.update(),i.enabled_=!0,i.on(i.menuButton_,"tap",i.handleClick),i.on(i.menuButton_,"click",i.handleClick),i.on(i.menuButton_,"keydown",i.handleKeyDown),i.on(i.menuButton_,"mouseenter",function(){i.addClass("vjs-hover"),i.menu.show(),oe(h,"keyup",ye(Me(i),i.handleMenuKeyUp))}),i.on("mouseleave",i.handleMouseLeave),i.on("keydown",i.handleSubmenuKeyDown),i}Be(e,n);var t=e.prototype;return t.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},t.createMenu=function(){var e,t=new on(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title&&(e=T("li",{className:"vjs-menu-title",innerHTML:xe(this.options_.title),tabIndex:-1}),this.hideThreshold_+=1,e=new Ue(this.player_,{el:e}),t.addItem(e)),this.items=this.createItems(),this.items)for(var i=0;i<this.items.length;i++)t.addItem(this.items[i]);return t},t.createItems=function(){},t.createEl=function(){return n.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},t.buildWrapperCSSClass=function(){var e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup","vjs-menu-button "+e+" "+en.prototype.buildCSSClass()+" "+n.prototype.buildCSSClass.call(this)},t.buildCSSClass=function(){var e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup","vjs-menu-button "+e+" "+n.prototype.buildCSSClass.call(this)},t.controlText=function(e,t){return void 0===t&&(t=this.menuButton_.el()),this.menuButton_.controlText(e,t)},t.dispose=function(){this.handleMouseLeave(),n.prototype.dispose.call(this)},t.handleClick=function(e){this.buttonPressed_?this.unpressButton():this.pressButton()},t.handleMouseLeave=function(e){this.removeClass("vjs-hover"),ue(h,"keyup",ye(this,this.handleMenuKeyUp))},t.focus=function(){this.menuButton_.focus()},t.blur=function(){this.menuButton_.blur()},t.handleKeyDown=function(e){Ct.isEventKey(e,"Esc")||Ct.isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),Ct.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(Ct.isEventKey(e,"Up")||Ct.isEventKey(e,"Down"))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))},t.handleMenuKeyUp=function(e){(Ct.isEventKey(e,"Esc")||Ct.isEventKey(e,"Tab"))&&this.removeClass("vjs-hover")},t.handleSubmenuKeyPress=function(e){this.handleSubmenuKeyDown(e)},t.handleSubmenuKeyDown=function(e){(Ct.isEventKey(e,"Esc")||Ct.isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),Ct.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus()))},t.pressButton=function(){this.enabled_&&(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),nt&&_()||this.menu.focus())},t.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},t.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},t.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},e}(Ue);Ue.registerComponent("MenuButton",Rt);Oe=function(r){function e(e,t){var i=t.tracks,t=r.call(this,e,t)||this;if(t.items.length<=1&&t.hide(),!i)return Me(t);var n=ye(Me(t),t.update);return i.addEventListener("removetrack",n),i.addEventListener("addtrack",n),t.player_.on("ready",n),t.player_.on("dispose",function(){i.removeEventListener("removetrack",n),i.removeEventListener("addtrack",n)}),t}return Be(e,r),e}(Rt);Ue.registerComponent("TrackButton",Oe);var un=["Tab","Esc","Up","Down","Right","Left"],Nt=function(n){function e(e,t){e=n.call(this,e,t)||this;return e.selectable=t.selectable,e.isSelected_=t.selected||!1,e.multiSelectable=t.multiSelectable,e.selected(e.isSelected_),e.selectable?e.multiSelectable?e.el_.setAttribute("role","menuitemcheckbox"):e.el_.setAttribute("role","menuitemradio"):e.el_.setAttribute("role","menuitem"),e}Be(e,n);var t=e.prototype;return t.createEl=function(e,t,i){return this.nonIconControl=!0,n.prototype.createEl.call(this,"li",m({className:"vjs-menu-item",innerHTML:'<span class="vjs-menu-item-text">'+this.localize(this.options_.label)+"</span>",tabIndex:-1},t),i)},t.handleKeyDown=function(t){un.some(function(e){return Ct.isEventKey(t,e)})||n.prototype.handleKeyDown.call(this,t)},t.handleClick=function(e){this.selected(!0)},t.selected=function(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))},e}(qe);Ue.registerComponent("MenuItem",Nt);var ln=function(u){function e(e,t){var n,i=t.track,r=e.textTracks();t.label=i.label||i.language||"Unknown",t.selected="showing"===i.mode,(n=u.call(this,e,t)||this).track=i,n.kinds=(t.kinds||[t.kind||n.track.kind]).filter(Boolean);function s(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n.handleTracksChange.apply(Me(n),t)}function a(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n.handleSelectedLanguageChange.apply(Me(n),t)}var o;return e.on(["loadstart","texttrackchange"],s),r.addEventListener("change",s),r.addEventListener("selectedlanguagechange",a),n.on("dispose",function(){e.off(["loadstart","texttrackchange"],s),r.removeEventListener("change",s),r.removeEventListener("selectedlanguagechange",a)}),void 0===r.onchange&&n.on(["tap","click"],function(){if("object"!=typeof d.Event)try{o=new d.Event("change")}catch(e){}o||(o=h.createEvent("Event")).initEvent("change",!0,!0),r.dispatchEvent(o)}),n.handleTracksChange(),n}Be(e,u);var t=e.prototype;return t.handleClick=function(e){var t=this.track,i=this.player_.textTracks();if(u.prototype.handleClick.call(this,e),i)for(var n=0;n<i.length;n++){var r=i[n];-1!==this.kinds.indexOf(r.kind)&&(r===t?"showing"!==r.mode&&(r.mode="showing"):"disabled"!==r.mode&&(r.mode="disabled"))}},t.handleTracksChange=function(e){var t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)},t.handleSelectedLanguageChange=function(e){var t;"showing"===this.track.mode&&((t=this.player_.cache_.selectedLanguage)&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind||(this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}))},t.dispose=function(){this.track=null,u.prototype.dispose.call(this)},e}(Nt);Ue.registerComponent("TextTrackMenuItem",ln);var cn=function(i){function e(e,t){return t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,i.call(this,e,t)||this}Be(e,i);var t=e.prototype;return t.handleTracksChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n<r;n++){var s=t[n];if(-1<this.options_.kinds.indexOf(s.kind)&&"showing"===s.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)},t.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n<r;n++){var s=t[n];if(-1<["captions","descriptions","subtitles"].indexOf(s.kind)&&"showing"===s.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})},e}(ln);Ue.registerComponent("OffTextTrackMenuItem",cn);ti=function(i){function e(e,t){return(t=void 0===t?{}:t).tracks=e.textTracks(),i.call(this,e,t)||this}return Be(e,i),e.prototype.createItems=function(e,t){var i;void 0===t&&(t=ln),this.label_&&(i=this.label_+" off"),(e=void 0===e?[]:e).push(new cn(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;var n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var r=0;r<n.length;r++){var s,a=n[r];-1<this.kinds_.indexOf(a.kind)&&((s=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1})).addClass("vjs-"+a.kind+"-menu-item"),e.push(s))}return e},e}(Oe);Ue.registerComponent("TextTrackButton",ti);var hn=function(s){function e(e,t){var i=t.track,n=t.cue,r=e.currentTime();return t.selectable=!0,t.multiSelectable=!1,t.label=n.text,t.selected=n.startTime<=r&&r<n.endTime,(t=s.call(this,e,t)||this).track=i,t.cue=n,i.addEventListener("cuechange",ye(Me(t),t.update)),t}Be(e,s);var t=e.prototype;return t.handleClick=function(e){s.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},t.update=function(e){var t=this.cue,i=this.player_.currentTime();this.selected(t.startTime<=i&&i<t.endTime)},e}(Nt);Ue.registerComponent("ChaptersTrackMenuItem",hn);Ve=function(n){function e(e,t,i){return n.call(this,e,t,i)||this}Be(e,n);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-chapters-button "+n.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-chapters-button "+n.prototype.buildWrapperCSSClass.call(this)},t.update=function(e){this.track_&&(!e||"addtrack"!==e.type&&"removetrack"!==e.type)||this.setTrack(this.findChaptersTrack()),n.prototype.update.call(this)},t.setTrack=function(e){var t;this.track_!==e&&(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_&&((t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_))&&t.removeEventListener("load",this.updateHandler_),this.track_=null),this.track_=e,this.track_&&(this.track_.mode="hidden",(e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_))&&e.addEventListener("load",this.updateHandler_)))},t.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],t=e.length-1;0<=t;t--){var i=e[t];if(i.kind===this.kind_)return i}},t.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(xe(this.kind_))},t.createMenu=function(){return this.options_.title=this.getMenuCaption(),n.prototype.createMenu.call(this)},t.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var i=0,n=t.length;i<n;i++){var r=t[i],r=new hn(this.player_,{track:this.track_,cue:r});e.push(r)}return e},e}(ti);Ve.prototype.kind_="chapters",Ve.prototype.controlText_="Chapters",Ue.registerComponent("ChaptersButton",Ve);tt=function(s){function e(e,t,i){var i=s.call(this,e,t,i)||this,n=e.textTracks(),r=ye(Me(i),i.handleTracksChange);return n.addEventListener("change",r),i.on("dispose",function(){n.removeEventListener("change",r)}),i}Be(e,s);var t=e.prototype;return t.handleTracksChange=function(e){for(var t=this.player().textTracks(),i=!1,n=0,r=t.length;n<r;n++){var s=t[n];if(s.kind!==this.kind_&&"showing"===s.mode){i=!0;break}}i?this.disable():this.enable()},t.buildCSSClass=function(){return"vjs-descriptions-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+s.prototype.buildWrapperCSSClass.call(this)},e}(ti);tt.prototype.kind_="descriptions",tt.prototype.controlText_="Descriptions",Ue.registerComponent("DescriptionsButton",tt);Je=function(n){function e(e,t,i){return n.call(this,e,t,i)||this}Be(e,n);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-subtitles-button "+n.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+n.prototype.buildWrapperCSSClass.call(this)},e}(ti);Je.prototype.kind_="subtitles",Je.prototype.controlText_="Subtitles",Ue.registerComponent("SubtitlesButton",Je);var dn=function(i){function e(e,t){return t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",(e=i.call(this,e,t)||this).addClass("vjs-texttrack-settings"),e.controlText(", opens "+t.kind+" settings dialog"),e}return Be(e,i),e.prototype.handleClick=function(e){this.player().getChild("textTrackSettings").open()},e}(ln);Ue.registerComponent("CaptionSettingsMenuItem",dn);Xt=function(n){function e(e,t,i){return n.call(this,e,t,i)||this}Be(e,n);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-captions-button "+n.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-captions-button "+n.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(){var e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new dn(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),n.prototype.createItems.call(this,e)},e}(ti);Xt.prototype.kind_="captions",Xt.prototype.controlText_="Captions",Ue.registerComponent("CaptionsButton",Xt);var pn=function(r){function e(){return r.apply(this,arguments)||this}return Be(e,r),e.prototype.createEl=function(e,t,i){var n='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"captions"===this.options_.track.kind&&(n+='\n        <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n        <span class="vjs-control-text"> '+this.localize("Captions")+"</span>\n      "),r.prototype.createEl.call(this,e,m({innerHTML:n+="</span>"},t),i)},e}(ln);Ue.registerComponent("SubsCapsMenuItem",pn);Ne=function(i){function e(e,t){return(t=i.call(this,e,t=void 0===t?{}:t)||this).label_="subtitles",-1<["en","en-us","en-ca","fr-ca"].indexOf(t.player_.language_)&&(t.label_="captions"),t.menuButton_.controlText(xe(t.label_)),t}Be(e,i);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-subs-caps-button "+i.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+i.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(){var e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new dn(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=i.prototype.createItems.call(this,e,pn)},e}(ti);Ne.prototype.kinds_=["captions","subtitles"],Ne.prototype.controlText_="Subtitles",Ue.registerComponent("SubsCapsButton",Ne);var fn=function(a){function e(e,t){var n,i=t.track,r=e.audioTracks();t.label=i.label||i.language||"Unknown",t.selected=i.enabled,(n=a.call(this,e,t)||this).track=i,n.addClass("vjs-"+i.kind+"-menu-item");function s(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n.handleTracksChange.apply(Me(n),t)}return r.addEventListener("change",s),n.on("dispose",function(){r.removeEventListener("change",s)}),n}Be(e,a);var t=e.prototype;return t.createEl=function(e,t,i){var n='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"main-desc"===this.options_.track.kind&&(n+='\n        <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n        <span class="vjs-control-text"> '+this.localize("Descriptions")+"</span>\n      "),a.prototype.createEl.call(this,e,m({innerHTML:n+="</span>"},t),i)},t.handleClick=function(e){var t=this.player_.audioTracks();a.prototype.handleClick.call(this,e);for(var i=0;i<t.length;i++){var n=t[i];n.enabled=n===this.track}},t.handleTracksChange=function(e){this.selected(this.track.enabled)},e}(Nt);Ue.registerComponent("AudioTrackMenuItem",fn);Dt=function(i){function e(e,t){return(t=void 0===t?{}:t).tracks=e.audioTracks(),i.call(this,e,t)||this}Be(e,i);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-audio-button "+i.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-audio-button "+i.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(e){void 0===e&&(e=[]),this.hideThreshold_=1;for(var t=this.player_.audioTracks(),i=0;i<t.length;i++){var n=t[i];e.push(new fn(this.player_,{track:n,selectable:!0,multiSelectable:!1}))}return e},e}(Oe);Dt.prototype.controlText_="Audio Track",Ue.registerComponent("AudioTrackButton",Dt);var mn=function(r){function e(e,t){var i=t.rate,n=parseFloat(i,10);return t.label=i,t.selected=1===n,t.selectable=!0,t.multiSelectable=!1,(t=r.call(this,e,t)||this).label=i,t.rate=n,t.on(e,"ratechange",t.update),t}Be(e,r);var t=e.prototype;return t.handleClick=function(e){r.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},t.update=function(e){this.selected(this.player().playbackRate()===this.rate)},e}(Nt);mn.prototype.contentElType="button",Ue.registerComponent("PlaybackRateMenuItem",mn);qe=function(i){function e(e,t){t=i.call(this,e,t)||this;return t.updateVisibility(),t.updateLabel(),t.on(e,"loadstart",t.updateVisibility),t.on(e,"ratechange",t.updateLabel),t}Be(e,i);var t=e.prototype;return t.createEl=function(){var e=i.prototype.createEl.call(this);return this.labelEl_=T("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),e.appendChild(this.labelEl_),e},t.dispose=function(){this.labelEl_=null,i.prototype.dispose.call(this)},t.buildCSSClass=function(){return"vjs-playback-rate "+i.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-playback-rate "+i.prototype.buildWrapperCSSClass.call(this)},t.createMenu=function(){var e=new on(this.player()),t=this.playbackRates();if(t)for(var i=t.length-1;0<=i;i--)e.addChild(new mn(this.player(),{rate:t[i]+"x"}));return e},t.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},t.handleClick=function(e){for(var t=this.player().playbackRate(),i=this.playbackRates(),n=i[0],r=0;r<i.length;r++)if(i[r]>t){n=i[r];break}this.player().playbackRate(n)},t.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates},t.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&0<this.playbackRates().length},t.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},t.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},e}(Rt);qe.prototype.controlText_="Playback Rate",Ue.registerComponent("PlaybackRateMenuButton",qe);Ve=function(e){function t(){return e.apply(this,arguments)||this}Be(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},t}(Ue);Ue.registerComponent("Spacer",Ve),Ue.registerComponent("CustomControlSpacer",function(t){function e(){return t.apply(this,arguments)||this}Be(e,t);var i=e.prototype;return i.buildCSSClass=function(){return"vjs-custom-control-spacer "+t.prototype.buildCSSClass.call(this)},i.createEl=function(){var e=t.prototype.createEl.call(this,{className:this.buildCSSClass()});return e.innerHTML=" ",e},e}(Ve));tt=function(e){function t(){return e.apply(this,arguments)||this}return Be(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(Ue);tt.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in h&&tt.prototype.options_.children.splice(tt.prototype.options_.children.length-1,0,"pictureInPictureToggle"),Ue.registerComponent("ControlBar",tt);Je=function(i){function e(e,t){t=i.call(this,e,t)||this;return t.on(e,"error",t.open),t}Be(e,i);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-error-display "+i.prototype.buildCSSClass.call(this)},t.content=function(){var e=this.player().error();return e?this.localize(e.message):""},e}(wt);Je.prototype.options_=r({},wt.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Ue.registerComponent("ErrorDisplay",Je);var gn="vjs-text-track-settings",Xt=["#000","Black"],ti=["#00F","Blue"],Ne=["#0FF","Cyan"],Oe=["#0F0","Green"],Dt=["#F0F","Magenta"],Nt=["#F00","Red"],Rt=["#FFF","White"],qe=["#FF0","Yellow"],Ve=["1","Opaque"],tt=["0.5","Semi-Transparent"],Je=["0","Transparent"],yn={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Xt,Rt,Nt,Oe,ti,qe,Dt,Ne]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[Ve,tt,Je]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Rt,Xt,Nt,Oe,ti,qe,Dt,Ne]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(e){return"1.00"===e?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[Ve,tt]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[Je,tt,Ve]}};function vn(e,t){if((e=t?t(e):e)&&"none"!==e)return e}yn.windowColor.options=yn.backgroundColor.options;Ve=function(n){function e(e,t){var i;return t.temporary=!1,(i=n.call(this,e,t)||this).updateDisplay=ye(Me(i),i.updateDisplay),i.fill(),i.hasBeenOpened_=i.hasBeenFilled_=!0,i.endDialog=T("p",{className:"vjs-control-text",textContent:i.localize("End of dialog window.")}),i.el().appendChild(i.endDialog),i.setDefaults(),void 0===t.persistTextTrackSettings&&(i.options_.persistTextTrackSettings=i.options_.playerOptions.persistTextTrackSettings),i.on(i.$(".vjs-done-button"),"click",function(){i.saveSettings(),i.close()}),i.on(i.$(".vjs-default-button"),"click",function(){i.setDefaults(),i.updateDisplay()}),a(yn,function(e){i.on(i.$(e.selector),"change",i.updateDisplay)}),i.options_.persistTextTrackSettings&&i.restoreSettings(),i}Be(e,n);var t=e.prototype;return t.dispose=function(){this.endDialog=null,n.prototype.dispose.call(this)},t.createElSelect_=function(e,t,i){var n=this;void 0===t&&(t=""),void 0===i&&(i="label");var e=yn[e],r=e.id.replace("%s",this.id_),s=[t,r].join(" ").trim();return["<"+i+' id="'+r+'" class="'+("label"===i?"vjs-label":"")+'">',this.localize(e.label),"</"+i+">",'<select aria-labelledby="'+s+'">'].concat(e.options.map(function(e){var t=r+"-"+e[1].replace(/\W+/g,"");return['<option id="'+t+'" value="'+e[0]+'" ','aria-labelledby="'+s+" "+t+'">',n.localize(e[1]),"</option>"].join("")})).concat("</select>").join("")},t.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",e),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")},t.createElBgColor_=function(){var e="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",e),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")},t.createElWinColor_=function(){var e="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",e),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")},t.createElColors_=function(){return T("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},t.createElFont_=function(){return T("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},t.createElControls_=function(){var e=this.localize("restore all settings to the default values");return T("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+e+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+e+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},t.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},t.label=function(){return this.localize("Caption Settings Dialog")},t.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},t.buildCSSClass=function(){return n.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},t.getValues=function(){var i,n,e,r=this;return n=function(e,t,i){var n,t=(n=r.$(t.selector),t=t.parser,vn(n.options[n.options.selectedIndex].value,t));return void 0!==t&&(e[i]=t),e},void 0===(e={})&&(e=0),s(i=yn).reduce(function(e,t){return n(e,i[t],t)},e)},t.setValues=function(i){var n=this;a(yn,function(e,t){!function(e,t,i){if(t)for(var n=0;n<e.options.length;n++)if(vn(e.options[n].value,i)===t){e.selectedIndex=n;break}}(n.$(e.selector),i[t],e.parser)})},t.setDefaults=function(){var i=this;a(yn,function(e){var t=e.hasOwnProperty("default")?e.default:0;i.$(e.selector).selectedIndex=t})},t.restoreSettings=function(){var e;try{e=JSON.parse(d.localStorage.getItem(gn))}catch(e){p.warn(e)}e&&this.setValues(e)},t.saveSettings=function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?d.localStorage.setItem(gn,JSON.stringify(e)):d.localStorage.removeItem(gn)}catch(e){p.warn(e)}}},t.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},t.conditionalBlur_=function(){this.previouslyActiveEl_=null;var e=this.player_.controlBar,t=e&&e.subsCapsButton,e=e&&e.captionsButton;t?t.focus():e&&e.focus()},e}(wt);Ue.registerComponent("TextTrackSettings",Ve);Ve=function(s){function e(e,t){var i,n=t.ResizeObserver||d.ResizeObserver,r=Le({createEl:!(n=null===t.ResizeObserver?!1:n),reportTouchActivity:!1},t);return(i=s.call(this,e,r)||this).ResizeObserver=t.ResizeObserver||d.ResizeObserver,i.loadListener_=null,i.resizeObserver_=null,i.debouncedHandler_=pe(function(){i.resizeHandler()},100,!1,Me(i)),n?(i.resizeObserver_=new i.ResizeObserver(i.debouncedHandler_),i.resizeObserver_.observe(e.el())):(i.loadListener_=function(){var e,t;i.el_&&i.el_.contentWindow&&(e=i.debouncedHandler_,t=i.unloadListener_=function(){ue(this,"resize",e),ue(this,"unload",t),t=null},oe(i.el_.contentWindow,"unload",t),oe(i.el_.contentWindow,"resize",e))},i.one("load",i.loadListener_)),i}Be(e,s);var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1},{"aria-hidden":"true"})},t.resizeHandler=function(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")},t.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,s.prototype.dispose.call(this)},e}(Ue);Ue.registerComponent("ResizeManager",Ve);var _n={trackingThreshold:30,liveTolerance:15},Ve=function(i){function e(e,t){var t=Le(_n,t,{createEl:!1}),t=i.call(this,e,t)||this;return t.reset_(),t.on(t.player_,"durationchange",t.handleDurationchange),Qe&&"hidden"in h&&"visibilityState"in h&&t.on(h,"visibilitychange",t.handleVisibilityChange),t}Be(e,i);var t=e.prototype;return t.handleVisibilityChange=function(){this.player_.duration()===1/0&&(h.hidden?this.stopTracking():this.startTracking())},t.trackLive_=function(){var e,t=this.player_.seekable();t&&t.length&&(e=Number(d.performance.now().toFixed(4)),t=-1===this.lastTime_?0:(e-this.lastTime_)/1e3,this.lastTime_=e,this.pastSeekEnd_=this.pastSeekEnd()+t,e=this.liveCurrentTime(),t=this.player_.currentTime(),t=this.player_.paused()||this.seekedBehindLive_||Math.abs(e-t)>this.options_.liveTolerance,(t=!this.timeupdateSeen_||e===1/0?!1:t)!==this.behindLiveEdge_&&(this.behindLiveEdge_=t,this.trigger("liveedgechange")))},t.handleDurationchange=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},t.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLive_,30),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLive_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked):(this.one(this.player_,"play",this.handlePlay),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate)))},t.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked)},t.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=!this.skipNextSeeked_&&2<e,this.skipNextSeeked_=!1,this.trackLive_()},t.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge)},t.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.skipNextSeeked_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLive_),this.off(this.player_,"seeked",this.handleSeeked),this.off(this.player_,"play",this.handlePlay),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate),this.off(this.player_,"timeupdate",this.seekToLiveEdge)},t.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},t.seekableEnd=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0},t.seekableStart=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0},t.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?1/0:e-this.seekableStart()},t.isLive=function(){return this.isTracking()},t.atLiveEdge=function(){return!this.behindLiveEdge()},t.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},t.pastSeekEnd=function(){var e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_},t.behindLiveEdge=function(){return this.behindLiveEdge_},t.isTracking=function(){return"number"==typeof this.trackingInterval_},t.seekToLiveEdge=function(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.skipNextSeeked_=!0,this.player_.currentTime(this.liveCurrentTime()))},t.dispose=function(){this.off(h,"visibilitychange",this.handleVisibilityChange),this.stopTracking(),i.prototype.dispose.call(this)},e}(Ue);Ue.registerComponent("LiveTracker",Ve);function bn(s){var t,e,i,a=s.el();a.resetSourceWatch_||(t={},e=An(s),i=function(r){return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var n=r.apply(a,t);return Cn(s),n}},["append","appendChild","insertAdjacentHTML"].forEach(function(e){a[e]&&(t[e]=a[e],a[e]=i(t[e]))}),Object.defineProperty(a,"innerHTML",Le(e,{set:i(e.set)})),a.resetSourceWatch_=function(){a.resetSourceWatch_=null,Object.keys(t).forEach(function(e){a[e]=t[e]}),Object.defineProperty(a,"innerHTML",e)},s.one("sourceset",a.resetSourceWatch_))}function Tn(i){var n,t,r,s;i.featuresSourceset&&((n=i.el()).resetSourceset_||(t=wn([i.el(),d.HTMLMediaElement.prototype,In],"src"),r=n.setAttribute,s=n.load,Object.defineProperty(n,"src",Le(t,{set:function(e){e=t.set.call(n,e);return i.triggerSourceset(n.src),e}})),n.setAttribute=function(e,t){t=r.call(n,e,t);return/src/i.test(e)&&i.triggerSourceset(n.src),t},n.load=function(){var e=s.call(n);return Cn(i)||(i.triggerSourceset(""),bn(i)),e},n.currentSrc?i.triggerSourceset(n.currentSrc):Cn(i)||bn(i),n.resetSourceset_=function(){n.resetSourceset_=null,n.load=s,n.setAttribute=r,Object.defineProperty(n,"src",t),n.resetSourceWatch_&&n.resetSourceWatch_()}))}function Sn(t,i,n,e){function r(e){return Object.defineProperty(t,i,{value:e,enumerable:!0,writable:!0})}var s={configurable:!0,enumerable:!0,get:function(){var e=n();return r(e),e}};return(e=void 0===e?!0:e)&&(s.set=r),Object.defineProperty(t,i,s)}var kn,Cn=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var i=e.$$("source"),n=[],t="";if(!i.length)return!1;for(var r=0;r<i.length;r++){var s=i[r].src;s&&-1===n.indexOf(s)&&n.push(s)}return!!n.length&&(1===n.length&&(t=n[0]),e.triggerSourceset(t),!0)},En=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(e){var t=h.createElement(this.nodeName.toLowerCase());t.innerHTML=e;for(var i=h.createDocumentFragment();t.childNodes.length;)i.appendChild(t.childNodes[0]);return this.innerText="",d.Element.prototype.appendChild.call(this,i),this.innerHTML}}),wn=function(e,t){for(var i={},n=0;n<e.length&&!((i=Object.getOwnPropertyDescriptor(e[n],t))&&i.set&&i.get);n++);return i.enumerable=!0,i.configurable=!0,i},An=function(e){return wn([e.el(),d.HTMLMediaElement.prototype,d.Element.prototype,En],"innerHTML")},In=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?Ot(d.Element.prototype.getAttribute.call(this,"src")):""},set:function(e){return d.Element.prototype.setAttribute.call(this,"src",e),e}}),Pn=function(l){function a(e,t){var i=l.call(this,e,t)||this,t=e.source,n=!1;if(t&&(i.el_.currentSrc!==t.src||e.tag&&3===e.tag.initNetworkState_)?i.setSource(t):i.handleLateInit_(i.el_),e.enableSourceset&&i.setupSourcesetHandling_(),i.el_.hasChildNodes()){for(var r=i.el_.childNodes,s=r.length,a=[];s--;){var o=r[s];"track"===o.nodeName.toLowerCase()&&(i.featuresNativeTextTracks?(i.remoteTextTrackEls().addTrackElement_(o),i.remoteTextTracks().addTrack(o.track),i.textTracks().addTrack(o.track),n||i.el_.hasAttribute("crossorigin")||!Vt(o.src)||(n=!0)):a.push(o))}for(var u=0;u<a.length;u++)i.el_.removeChild(a[u])}return i.proxyNativeTracks_(),i.featuresNativeTextTracks&&n&&p.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),i.restoreMetadataTracksInIOSNativePlayer_(),(et||it||Ge)&&!0===e.nativeControlsForTouch&&i.setControls(!0),i.proxyWebkitFullscreen_(),i.triggerReady(),i}Be(a,l);var e=a.prototype;return e.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),a.disposeMediaElement(this.el_),this.options_=null,l.prototype.dispose.call(this)},e.setupSourcesetHandling_=function(){Tn(this)},e.restoreMetadataTracksInIOSNativePlayer_=function(){function e(){i=[];for(var e=0;e<n.length;e++){var t=n[e];"metadata"===t.kind&&i.push({track:t,storedMode:t.mode})}}var i,n=this.textTracks();e(),n.addEventListener("change",e),this.on("dispose",function(){return n.removeEventListener("change",e)});function r(){for(var e=0;e<i.length;e++){var t=i[e];"disabled"===t.track.mode&&t.track.mode!==t.storedMode&&(t.track.mode=t.storedMode)}n.removeEventListener("change",r)}this.on("webkitbeginfullscreen",function(){n.removeEventListener("change",e),n.removeEventListener("change",r),n.addEventListener("change",r)}),this.on("webkitendfullscreen",function(){n.removeEventListener("change",e),n.addEventListener("change",e),n.removeEventListener("change",r)})},e.overrideNative_=function(e,t){var i,n=this;t===this["featuresNative"+e+"Tracks"]&&(this[(i=e.toLowerCase())+"TracksListeners_"]&&Object.keys(this[i+"TracksListeners_"]).forEach(function(e){n.el()[i+"Tracks"].removeEventListener(e,n[i+"TracksListeners_"][e])}),this["featuresNative"+e+"Tracks"]=!t,this[i+"TracksListeners_"]=null,this.proxyNativeTracksForType_(i))},e.overrideNativeAudioTracks=function(e){this.overrideNative_("Audio",e)},e.overrideNativeVideoTracks=function(e){this.overrideNative_("Video",e)},e.proxyNativeTracksForType_=function(i){var e,t,n=this,r=ii[i],s=this.el()[r.getterName],a=this[r.getterName]();this["featuresNative"+r.capitalName+"Tracks"]&&s&&s.addEventListener&&(e={change:function(e){var t={type:"change",target:a,currentTarget:a,srcElement:a};a.trigger(t),"text"===i&&n[ni.remoteText.getterName]().trigger(t)},addtrack:function(e){a.addTrack(e.track)},removetrack:function(e){a.removeTrack(e.track)}},t=function(){for(var e=[],t=0;t<a.length;t++){for(var i=!1,n=0;n<s.length;n++)if(s[n]===a[t]){i=!0;break}i||e.push(a[t])}for(;e.length;)a.removeTrack(e.shift())},this[r.getterName+"Listeners_"]=e,Object.keys(e).forEach(function(t){var i=e[t];s.addEventListener(t,i),n.on("dispose",function(e){return s.removeEventListener(t,i)})}),this.on("loadstart",t),this.on("dispose",function(e){return n.off("loadstart",t)}))},e.proxyNativeTracks_=function(){var t=this;ii.names.forEach(function(e){t.proxyNativeTracksForType_(e)})},e.createEl=function(){var e,t=this.options_.tag;t&&(this.options_.playerElIngest||this.movingMediaElementInDOM)||(t?(e=t.cloneNode(!0),t.parentNode&&t.parentNode.insertBefore(e,t),a.disposeMediaElement(t),t=e):(t=h.createElement("video"),e=Le({},this.options_.tag&&P(this.options_.tag)),et&&!0===this.options_.nativeControlsForTouch||delete e.controls,I(t,m(e,{id:this.options_.techId,class:"vjs-tech"}))),t.playerId=this.options_.playerId),void 0!==this.options_.preload&&L(t,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(t.disablePictureInPicture=this.options_.disablePictureInPicture);for(var i=["loop","muted","playsinline","autoplay"],n=0;n<i.length;n++){var r=i[n],s=this.options_[r];void 0!==s&&(s?L(t,r,r):O(t,r),t[r]=s)}return t},e.handleLateInit_=function(e){if(0!==e.networkState&&3!==e.networkState){if(0===e.readyState){var t=!1,i=function(){t=!0};this.on("loadstart",i);var n=function(){t||this.trigger("loadstart")};return this.on("loadedmetadata",n),void this.ready(function(){this.off("loadstart",i),this.off("loadedmetadata",n),t||this.trigger("loadstart")})}var r=["loadstart"];r.push("loadedmetadata"),2<=e.readyState&&r.push("loadeddata"),3<=e.readyState&&r.push("canplay"),4<=e.readyState&&r.push("canplaythrough"),this.ready(function(){r.forEach(function(e){this.trigger(e)},this)})}},e.setScrubbing=function(e){this.isScrubbing_=e},e.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&rt?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){p(e,"Video is not ready. (Video.js)")}},e.duration=function(){var t=this;return this.el_.duration===1/0&&We&&Ye&&0===this.el_.currentTime?(this.on("timeupdate",function e(){0<t.el_.currentTime&&(t.el_.duration===1/0&&t.trigger("durationchange"),t.off("timeupdate",e))}),NaN):this.el_.duration||NaN},e.width=function(){return this.el_.offsetWidth},e.height=function(){return this.el_.offsetHeight},e.proxyWebkitFullscreen_=function(){var e,t,i=this;"webkitDisplayingFullscreen"in this.el_&&(e=function(){this.trigger("fullscreenchange",{isFullscreen:!1})},t=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))},this.on("webkitbeginfullscreen",t),this.on("dispose",function(){i.off("webkitbeginfullscreen",t),i.off("webkitendfullscreen",e)}))},e.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=d.navigator&&d.navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},e.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)bt(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}},0);else try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}},e.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))},e.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},e.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},e.reset=function(){a.resetMediaElement(this.el_)},e.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},e.setControls=function(e){this.el_.controls=!!e},e.addTextTrack=function(e,t,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,i):l.prototype.addTextTrack.call(this,e,t,i)},e.createRemoteTextTrack=function(e){if(!this.featuresNativeTextTracks)return l.prototype.createRemoteTextTrack.call(this,e);var t=h.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t},e.addRemoteTextTrack=function(e,t){t=l.prototype.addRemoteTextTrack.call(this,e,t);return this.featuresNativeTextTracks&&this.el().appendChild(t),t},e.removeRemoteTextTrack=function(e){if(l.prototype.removeRemoteTextTrack.call(this,e),this.featuresNativeTextTracks)for(var t=this.$$("track"),i=t.length;i--;)e!==t[i]&&e!==t[i].track||this.el().removeChild(t[i])},e.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),d.performance&&"function"==typeof d.performance.now?e.creationTime=d.performance.now():d.performance&&d.performance.timing&&"number"==typeof d.performance.timing.navigationStart&&(e.creationTime=d.Date.now()-d.performance.timing.navigationStart),e},a}(Ri);Sn(Pn,"TEST_VID",function(){if(y()){var e=h.createElement("video"),t=h.createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e}}),Pn.isSupported=function(){try{Pn.TEST_VID.volume=.5}catch(e){return!1}return!(!Pn.TEST_VID||!Pn.TEST_VID.canPlayType)},Pn.canPlayType=function(e){return Pn.TEST_VID.canPlayType(e)},Pn.canPlaySource=function(e,t){return Pn.canPlayType(e.type)},Pn.canControlVolume=function(){try{var e=Pn.TEST_VID.volume;return Pn.TEST_VID.volume=e/2+.1,e!==Pn.TEST_VID.volume}catch(e){return!1}},Pn.canMuteVolume=function(){try{var e=Pn.TEST_VID.muted;return Pn.TEST_VID.muted=!e,Pn.TEST_VID.muted?L(Pn.TEST_VID,"muted","muted"):O(Pn.TEST_VID,"muted"),e!==Pn.TEST_VID.muted}catch(e){return!1}},Pn.canControlPlaybackRate=function(){if(We&&Ye&&$e<58)return!1;try{var e=Pn.TEST_VID.playbackRate;return Pn.TEST_VID.playbackRate=e/2+.1,e!==Pn.TEST_VID.playbackRate}catch(e){return!1}},Pn.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(h.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(h.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(h.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(h.createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},Pn.supportsNativeTextTracks=function(){return rt||nt&&Ye},Pn.supportsNativeVideoTracks=function(){return!(!Pn.TEST_VID||!Pn.TEST_VID.videoTracks)},Pn.supportsNativeAudioTracks=function(){return!(!Pn.TEST_VID||!Pn.TEST_VID.audioTracks)},Pn.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresVolumeControl","canControlVolume"],["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function(e){var t=e[0],i=e[1];Sn(Pn.prototype,t,function(){return Pn[i]()},!0)}),Pn.prototype.movingMediaElementInDOM=!nt,Pn.prototype.featuresFullscreenResize=!0,Pn.prototype.featuresProgressEvents=!0,Pn.prototype.featuresTimeupdateEvents=!0,Pn.patchCanPlayType=function(){4<=ze&&!Xe&&!Ye&&(kn=Pn.TEST_VID&&Pn.TEST_VID.constructor.prototype.canPlayType,Pn.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e)?"maybe":kn.call(this,e)})},Pn.unpatchCanPlayType=function(){var e=Pn.TEST_VID.constructor.prototype.canPlayType;return kn&&(Pn.TEST_VID.constructor.prototype.canPlayType=kn),e},Pn.patchCanPlayType(),Pn.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},Pn.resetMediaElement=function(e){if(e){for(var t=e.querySelectorAll("source"),i=t.length;i--;)e.removeChild(t[i]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){Pn.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(t){Pn.prototype["set"+xe(t)]=function(e){(this.el_[t]=e)?this.el_.setAttribute(t,t):this.el_.removeAttribute(t)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(e){Pn.prototype[e]=function(){return this.el_[e]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(t){Pn.prototype["set"+xe(t)]=function(e){this.el_[t]=e}}),["pause","load","play"].forEach(function(e){Pn.prototype[e]=function(){return this.el_[e]()}}),Ri.withSourceHandlers(Pn),Pn.nativeSourceHandler={},Pn.nativeSourceHandler.canPlayType=function(e){try{return Pn.TEST_VID.canPlayType(e)}catch(e){return""}},Pn.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return Pn.nativeSourceHandler.canPlayType(e.type);if(e.src){e=Ht(e.src);return Pn.nativeSourceHandler.canPlayType("video/"+e)}return""},Pn.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},Pn.nativeSourceHandler.dispose=function(){},Pn.registerSourceHandler(Pn.nativeSourceHandler),Ri.registerTech("Html5",Pn);var xn=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Ln={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},On=["tiny","xsmall","small","medium","large","xlarge","huge"],Dn={};On.forEach(function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;Dn[e]="vjs-layout-"+t});var Nn={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Rn=function(c){function o(e,t,i){var n,r;if(e.id=e.id||t.id||"vjs_video_"+ee++,(t=m(o.getTagSettings(e),t)).initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language)if("function"==typeof e.closest){var s=e.closest("[lang]");s&&s.getAttribute&&(t.language=s.getAttribute("lang"))}else for(var a=e;a&&1===a.nodeType;){if(P(a).hasOwnProperty("lang")){t.language=a.getAttribute("lang");break}a=a.parentNode}if((n=c.call(this,null,t,i)||this).boundDocumentFullscreenChange_=ye(Me(n),n.documentFullscreenChange_),n.boundFullWindowOnEscKey_=ye(Me(n),n.fullWindowOnEscKey),n.isFullscreen_=!1,n.log=f(n.id_),n.fsApi_=ht,n.isPosterFromTech_=!1,n.queuedCallbacks_=[],n.isReady_=!1,n.hasStarted_=!1,n.userActive_=!1,n.debugEnabled_=!1,!n.options_||!n.options_.techOrder||!n.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");n.tag=e,n.tagAttributes=e&&P(e),n.language(n.options_.language),t.languages?(r={},Object.getOwnPropertyNames(t.languages).forEach(function(e){r[e.toLowerCase()]=t.languages[e]}),n.languages_=r):n.languages_=o.prototype.options_.languages,n.resetCache_(),n.poster_=t.poster||"",n.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),n.changingSrc_=!1,n.playCallbacks_=[],n.playTerminatedQueue_=[],e.hasAttribute("autoplay")?n.autoplay(!0):n.autoplay(n.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(function(e){if("function"!=typeof n[e])throw new Error('plugin "'+e+'" does not exist')}),n.scrubbing_=!1,n.el_=n.createEl(),we(Me(n),{eventBusKey:"el_"}),n.fsApi_.requestFullscreen&&(oe(h,n.fsApi_.fullscreenchange,n.boundDocumentFullscreenChange_),n.on(n.fsApi_.fullscreenchange,n.boundDocumentFullscreenChange_)),n.fluid_&&n.on("playerreset",n.updateStyleEl_);i=Le(n.options_);t.plugins&&Object.keys(t.plugins).forEach(function(e){n[e](t.plugins[e])}),t.debug&&n.debug(!0),n.options_.playerOptions=i,n.middleware_=[],n.initChildren(),n.isAudio("audio"===e.nodeName.toLowerCase()),n.controls()?n.addClass("vjs-controls-enabled"):n.addClass("vjs-controls-disabled"),n.el_.setAttribute("role","region"),n.isAudio()?n.el_.setAttribute("aria-label",n.localize("Audio Player")):n.el_.setAttribute("aria-label",n.localize("Video Player")),n.isAudio()&&n.addClass("vjs-audio"),n.flexNotSupported_()&&n.addClass("vjs-no-flex"),et&&n.addClass("vjs-touch-enabled"),nt||n.addClass("vjs-workinghover"),o.players[n.id_]=Me(n);e=u.split(".")[0];return n.addClass("vjs-v"+e),n.userActive(!0),n.reportUserActivity(),n.one("play",n.listenForUserActivity_),n.on("stageclick",n.handleStageClick_),n.on("keydown",n.handleKeyDown),n.breakpoints(n.options_.breakpoints),n.responsive(n.options_.responsive),n}Be(o,c);var e=o.prototype;return e.dispose=function(){var t=this;this.trigger("dispose"),this.off("dispose"),ue(h,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),ue(h,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),o.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),Mi[this.id()]=null,ri.names.forEach(function(e){e=ri[e],e=t[e.getterName]();e&&e.off&&e.off()}),c.prototype.dispose.call(this)},e.createEl=function(){var t,i=this.tag,e=this.playerElIngest_=i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute("data-vjs-player"),n="video-js"===this.tag.tagName.toLowerCase();e?t=this.el_=i.parentNode:n||(t=this.el_=c.prototype.createEl.call(this,"div"));var r,s,a=P(i);if(n){for(t=this.el_=i,i=this.tag=h.createElement("video");t.children.length;)i.appendChild(t.firstChild);C(t,"video-js")||E(t,"video-js"),t.appendChild(i),e=this.playerElIngest_=t,Object.keys(t).forEach(function(e){try{i[e]=t[e]}catch(e){}})}i.setAttribute("tabindex","-1"),a.tabindex="-1",(Qe||Ye&&Ze)&&(i.setAttribute("role","application"),a.role="application"),i.removeAttribute("width"),i.removeAttribute("height"),"width"in a&&delete a.width,"height"in a&&delete a.height,Object.getOwnPropertyNames(a).forEach(function(e){n&&"class"===e||t.setAttribute(e,a[e]),n&&i.setAttribute(e,a[e])}),i.playerId=i.id,i.id+="_html5_api",i.className="vjs-tech",(i.player=t.player=this).addClass("vjs-paused"),!0!==d.VIDEOJS_NO_DYNAMIC_STYLE&&(this.styleEl_=J("vjs-styles-dimensions"),r=G(".vjs-styles-defaults"),(s=G("head")).insertBefore(this.styleEl_,r?r.nextSibling:s.firstChild)),this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var o=i.getElementsByTagName("a"),u=0;u<o.length;u++){var l=o.item(u);E(l,"vjs-hidden"),l.setAttribute("hidden","hidden")}return i.initNetworkState_=i.networkState,i.parentNode&&!e&&i.parentNode.insertBefore(t,i),k(i,t),this.children_.unshift(i),this.el_.setAttribute("lang",this.language_),this.el_=t},e.crossOrigin=function(e){if(!e)return this.techGet_("crossOrigin");"anonymous"===e||"use-credentials"===e?this.techCall_("setCrossOrigin",e):p.warn('crossOrigin must be "anonymous" or "use-credentials", given "'+e+'"')},e.width=function(e){return this.dimension("width",e)},e.height=function(e){return this.dimension("height",e)},e.dimension=function(e,t){var i=e+"_";if(void 0===t)return this[i]||0;if(""===t||"auto"===t)return this[i]=void 0,void this.updateStyleEl_();var n=parseFloat(t);isNaN(n)?p.error('Improper value "'+t+'" supplied for for '+e):(this[i]=n,this.updateStyleEl_())},e.fluid=function(e){if(void 0===e)return!!this.fluid_;var t;this.fluid_=!!e,ke(this)&&this.off("playerreset",this.updateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),ke(e=function(){this.on("playerreset",this.updateStyleEl_)})?t():(e.eventedCallbacks||(e.eventedCallbacks=[]),e.eventedCallbacks.push(t))):this.removeClass("vjs-fluid"),this.updateStyleEl_()},e.fill=function(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},e.aspectRatio=function(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()},e.updateStyleEl_=function(){var e,t,i,n;!0!==d.VIDEOJS_NO_DYNAMIC_STYLE?(n=(i=(void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:0<this.videoWidth()?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"))[1]/i[0],e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/n:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*n,i=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(i),Z(this.styleEl_,"\n      ."+i+" {\n        width: "+e+"px;\n        height: "+t+"px;\n      }\n\n      ."+i+".vjs-fluid {\n        padding-top: "+100*n+"%;\n      }\n    ")):(t="number"==typeof this.width_?this.width_:this.options_.width,i="number"==typeof this.height_?this.height_:this.options_.height,(n=this.tech_&&this.tech_.el())&&(0<=t&&(n.width=t),0<=i&&(n.height=i)))},e.loadTech_=function(e,t){var i=this;this.tech_&&this.unloadTech_();var n=xe(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==n&&this.tag&&(Ri.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;var s={source:t,autoplay:"string"!=typeof this.autoplay()&&this.autoplay(),nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+r+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};ri.names.forEach(function(e){e=ri[e];s[e.getterName]=i[e.privateName]}),m(s,this.options_[n]),m(s,this.options_[r]),m(s,this.options_[e.toLowerCase()]),this.tag&&(s.tag=this.tag),t&&t.src===this.cache_.src&&0<this.cache_.currentTime&&(s.startTime=this.cache_.currentTime);e=Ri.getTech(e);if(!e)throw new Error("No Tech named '"+n+"' exists! '"+n+"' should be registered using videojs.registerTech()'");this.tech_=new e(s),this.tech_.ready(ye(this,this.handleTechReady_),!0),kt(this.textTracksJson_||[],this.tech_),xn.forEach(function(e){i.on(i.tech_,e,i["handleTech"+xe(e)+"_"])}),Object.keys(Ln).forEach(function(t){i.on(i.tech_,t,function(e){0===i.tech_.playbackRate()&&i.tech_.seeking()?i.queuedCallbacks_.push({callback:i["handleTech"+Ln[t]+"_"].bind(i),event:e}):i["handleTech"+Ln[t]+"_"](e)})}),this.on(this.tech_,"loadstart",this.handleTechLoadStart_),this.on(this.tech_,"sourceset",this.handleTechSourceset_),this.on(this.tech_,"waiting",this.handleTechWaiting_),this.on(this.tech_,"ended",this.handleTechEnded_),this.on(this.tech_,"seeking",this.handleTechSeeking_),this.on(this.tech_,"play",this.handleTechPlay_),this.on(this.tech_,"firstplay",this.handleTechFirstPlay_),this.on(this.tech_,"pause",this.handleTechPause_),this.on(this.tech_,"durationchange",this.handleTechDurationChange_),this.on(this.tech_,"fullscreenchange",this.handleTechFullscreenChange_),this.on(this.tech_,"fullscreenerror",this.handleTechFullscreenError_),this.on(this.tech_,"enterpictureinpicture",this.handleTechEnterPictureInPicture_),this.on(this.tech_,"leavepictureinpicture",this.handleTechLeavePictureInPicture_),this.on(this.tech_,"error",this.handleTechError_),this.on(this.tech_,"loadedmetadata",this.updateStyleEl_),this.on(this.tech_,"posterchange",this.handleTechPosterChange_),this.on(this.tech_,"textdata",this.handleTechTextData_),this.on(this.tech_,"ratechange",this.handleTechRateChange_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===n&&this.tag||k(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},e.unloadTech_=function(){var t=this;ri.names.forEach(function(e){e=ri[e];t[e.privateName]=t[e.getterName]()}),this.textTracksJson_=St(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},e.tech=function(e){return void 0===e&&p.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_},e.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"mouseup",this.handleTechClick_),this.on(this.tech_,"dblclick",this.handleTechDoubleClick_),this.on(this.tech_,"touchstart",this.handleTechTouchStart_),this.on(this.tech_,"touchmove",this.handleTechTouchMove_),this.on(this.tech_,"touchend",this.handleTechTouchEnd_),this.on(this.tech_,"tap",this.handleTechTap_)},e.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.handleTechTap_),this.off(this.tech_,"touchstart",this.handleTechTouchStart_),this.off(this.tech_,"touchmove",this.handleTechTouchMove_),this.off(this.tech_,"touchend",this.handleTechTouchEnd_),this.off(this.tech_,"mouseup",this.handleTechClick_),this.off(this.tech_,"dblclick",this.handleTechDoubleClick_)},e.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},e.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay())},e.manualAutoplay_=function(t){var n=this;if(this.tech_&&"string"==typeof t){var e,i=function(){var e=n.muted();n.muted(!0);function t(){n.muted(e)}n.playTerminatedQueue_.push(t);var i=n.play();if(_t(i))return i.catch(t)};if("any"===t&&!0!==this.muted()?_t(e=this.play())&&(e=e.catch(i)):e="muted"===t&&!0!==this.muted()?i():this.play(),_t(e))return e.then(function(){n.trigger({type:"autoplay-success",autoplay:t})}).catch(function(e){n.trigger({type:"autoplay-failure",autoplay:t})})}},e.updateSourceCaches_=function(e){var t=e=void 0===e?"":e,i="";"string"!=typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var i=e.cache_.sources.filter(function(e){return e.src===t});if(i.length)return i[0].type;for(var n=e.$$("source"),r=0;r<n.length;r++){var s=n[r];if(s.type&&s.src&&s.src===t)return s.type}return Ki(t)}(this,t)),this.cache_.source=Le({},e,{src:t,type:i});for(var i=this.cache_.sources.filter(function(e){return e.src&&e.src===t}),n=[],r=this.$$("source"),s=[],a=0;a<r.length;a++){var o=P(r[a]);n.push(o),o.src&&o.src===t&&s.push(o.src)}s.length&&!i.length?this.cache_.sources=n:i.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t},e.handleTechSourceset_=function(e){var t,i,n,r=this;this.changingSrc_||(t=function(e){return r.updateSourceCaches_(e)},i=this.currentSource().src,n=e.src,i&&!/^blob:/.test(i)&&/^blob:/.test(n)&&(this.lastSource_&&(this.lastSource_.tech===n||this.lastSource_.player===i)||(t=function(){})),t(n),e.src||this.tech_.any(["sourceset","loadstart"],function(e){"sourceset"!==e.type&&(e=r.techGet("currentSrc"),r.lastSource_.tech=e,r.updateSourceCaches_(e))})),this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})},e.hasStarted=function(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},e.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},e.handleTechRateChange_=function(){0<this.tech_.playbackRate()&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(function(e){return e.callback(e.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},e.handleTechWaiting_=function(){var t=this;this.addClass("vjs-waiting"),this.trigger("waiting");var i=this.currentTime();this.on("timeupdate",function e(){i!==t.currentTime()&&(t.removeClass("vjs-waiting"),t.off("timeupdate",e))})},e.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},e.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},e.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},e.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},e.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},e.handleTechFirstPlay_=function(){this.options_.starttime&&(p.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},e.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},e.handleTechEnded_=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},e.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},e.handleTechClick_=function(e){q(e)&&this.controls_&&(this.paused()?bt(this.play()):this.pause())},e.handleTechDoubleClick_=function(t){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(e){return e.contains(t.target)})||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,t):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},e.handleTechTap_=function(){this.userActive(!this.userActive())},e.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},e.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},e.handleTechTouchEnd_=function(e){e.preventDefault()},e.handleStageClick_=function(){this.reportUserActivity()},e.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},e.documentFullscreenChange_=function(e){var t=e.target.player;t&&t!==this||(e=this.el(),!(t=h[this.fsApi_.fullscreenElement]===e)&&e.matches?t=e.matches(":"+this.fsApi_.fullscreen):!t&&e.msMatchesSelector&&(t=e.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(t))},e.handleTechFullscreenChange_=function(e,t){t&&(t.nativeIOSFullscreen&&this.toggleClass("vjs-ios-native-fs"),this.isFullscreen(t.isFullscreen))},e.handleTechFullscreenError_=function(e,t){this.trigger("fullscreenerror",t)},e.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},e.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},e.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},e.handleTechError_=function(){var e=this.tech_.error();this.error(e)},e.handleTechTextData_=function(){var e=1<arguments.length?arguments[1]:null;this.trigger("textdata",e)},e.getCache=function(){return this.cache_},e.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],volume:1}},e.techCall_=function(t,i){this.ready(function(){if(t in Vi)return e=this.middleware_,this.tech_[t](e.reduce(Wi(t),i));if(t in qi)return Fi(this.middleware_,this.tech_,t,i);var e;try{this.tech_&&this.tech_[t](i)}catch(e){throw p(e),e}},!0)},e.techGet_=function(t){if(this.tech_&&this.tech_.isReady_){if(t in Hi)return e=this.middleware_,i=this.tech_,e.reduceRight(Wi(t),i[t]());if(t in qi)return Fi(this.middleware_,this.tech_,t);var e,i;try{return this.tech_[t]()}catch(e){if(void 0===this.tech_[t])throw p("Video.js: "+t+" method not defined for "+this.techName_+" playback technology.",e),e;if("TypeError"===e.name)throw p("Video.js: "+t+" unavailable on "+this.techName_+" playback technology element.",e),this.tech_.isReady_=!1,e;throw p(e),e}}},e.play=function(){var t=this,e=this.options_.Promise||d.Promise;return e?new e(function(e){t.play_(e)}):this.play_()},e.play_=function(e){var t=this;this.playCallbacks_.push(e=void 0===e?bt:e);e=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!e)return this.waitToPlay_=function(e){t.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(e||!rt&&!nt||this.load());e=this.techGet_("play");null===e?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(e)},e.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(e){e()})},e.runPlayCallbacks_=function(t){var e=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],e.forEach(function(e){e(t)})},e.pause=function(){this.techCall_("pause")},e.paused=function(){return!1!==this.techGet_("paused")},e.played=function(){return this.techGet_("played")||ut(0,0)},e.scrubbing=function(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},e.currentTime=function(e){return void 0!==e?(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),void(this.cache_.initTime=0)):(this.cache_.initTime=e,this.off("canplay",this.applyInitTime_),void this.one("canplay",this.applyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},e.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},e.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=(e=parseFloat(e))<0?1/0:e)!==this.cache_.duration&&((this.cache_.duration=e)===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))},e.remainingTime=function(){return this.duration()-this.currentTime()},e.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},e.buffered=function(){var e;return e=!(e=this.techGet_("buffered"))||!e.length?ut(0,0):e},e.bufferedPercent=function(){return lt(this.buffered(),this.duration())},e.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),e=e.end(e.length-1);return e=t<e?t:e},e.volume=function(e){var t;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(0<t&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)},e.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},e.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},e.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e},e.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},e.isFullscreen=function(e){if(void 0===e)return this.isFullscreen_;var t=this.isFullscreen_;this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_()},e.requestFullscreen=function(a){var e=this.options_.Promise||d.Promise;if(e){var o=this;return new e(function(e,i){function n(){o.off("fullscreenerror",r),o.off("fullscreenchange",t)}function t(){n(),e()}function r(e,t){n(),i(t)}o.one("fullscreenchange",t),o.one("fullscreenerror",r);var s=o.requestFullscreenHelper_(a);if(s)return s.then(n,n),s})}return this.requestFullscreenHelper_()},e.requestFullscreenHelper_=function(e){var t=this;if(this.fsApi_.prefixed||(i=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(i=e)),this.fsApi_.requestFullscreen){var i=this.el_[this.fsApi_.requestFullscreen](i);return i&&i.then(function(){return t.isFullscreen(!0)},function(){return t.isFullscreen(!1)}),i}this.tech_.supportsFullScreen()?this.techCall_("enterFullScreen"):this.enterFullWindow()},e.exitFullscreen=function(){var e=this.options_.Promise||d.Promise;if(e){var a=this;return new e(function(e,i){function n(){a.off("fullscreenerror",r),a.off("fullscreenchange",t)}function t(){n(),e()}function r(e,t){n(),i(t)}a.one("fullscreenchange",t),a.one("fullscreenerror",r);var s=a.exitFullscreenHelper_();if(s)return s.then(n,n),s})}return this.exitFullscreenHelper_()},e.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var t=h[this.fsApi_.exitFullscreen]();return t&&t.then(function(){return e.isFullscreen(!1)}),t}this.tech_.supportsFullScreen()?this.techCall_("exitFullScreen"):this.exitFullWindow()},e.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=h.documentElement.style.overflow,oe(h,"keydown",this.boundFullWindowOnEscKey_),h.documentElement.style.overflow="hidden",E(h.body,"vjs-full-window"),this.trigger("enterFullWindow")},e.fullWindowOnEscKey=function(e){Ct.isEventKey(e,"Esc")&&(!0===this.isFullscreen()?this.exitFullscreen():this.exitFullWindow())},e.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,ue(h,"keydown",this.boundFullWindowOnEscKey_),h.documentElement.style.overflow=this.docOrigOverflow,w(h.body,"vjs-full-window"),this.trigger("exitFullWindow")},e.disablePictureInPicture=function(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")},e.isInPictureInPicture=function(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},e.requestPictureInPicture=function(){if("pictureInPictureEnabled"in h&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")},e.exitPictureInPicture=function(){if("pictureInPictureEnabled"in h)return h.exitPictureInPicture()},e.handleKeyDown=function(e){var t=this.options_.userActions;t&&t.hotkeys&&(function(e){var t=e.tagName.toLowerCase();if(e.isContentEditable)return!0;if("input"===t)return-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type);return-1!==["textarea"].indexOf(t)}(this.el_.ownerDocument.activeElement)||("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e)))},e.handleHotkeys=function(e){var t=this.options_.userActions?this.options_.userActions.hotkeys:{},i=t.fullscreenKey,n=void 0===i?function(e){return Ct.isEventKey(e,"f")}:i,i=t.muteKey,i=void 0===i?function(e){return Ct.isEventKey(e,"m")}:i,t=t.playPauseKey,t=void 0===t?function(e){return Ct.isEventKey(e,"k")||Ct.isEventKey(e,"Space")}:t;n.call(this,e)?(e.preventDefault(),e.stopPropagation(),n=Ue.getComponent("FullscreenToggle"),!1!==h[this.fsApi_.fullscreenEnabled]&&n.prototype.handleClick.call(this,e)):i.call(this,e)?(e.preventDefault(),e.stopPropagation(),Ue.getComponent("MuteToggle").prototype.handleClick.call(this,e)):t.call(this,e)&&(e.preventDefault(),e.stopPropagation(),Ue.getComponent("PlayToggle").prototype.handleClick.call(this,e))},e.canPlayType=function(e){for(var t,i=0,n=this.options_.techOrder;i<n.length;i++){var r=n[i],s=Ri.getTech(r);if(s=s||Ue.getComponent(r)){if(s.isSupported()&&(t=s.canPlayType(e)))return t}else p.error('The "'+r+'" tech is undefined. Skipped browser support check for that tech.')}return""},e.selectSource=function(e){function t(e,i,n){var r;return e.some(function(t){return i.some(function(e){if(r=n(t,e))return!0})}),r}var i,n=this,r=this.options_.techOrder.map(function(e){return[e,Ri.getTech(e)]}).filter(function(e){var t=e[0],e=e[1];return e?e.isSupported():(p.error('The "'+t+'" tech is undefined. Skipped browser support check for that tech.'),!1)}),s=function(e,t){var i=e[0];if(e[1].canPlaySource(t,n.options_[i.toLowerCase()]))return{source:t,tech:i}},s=this.options_.sourceOrder?t(e,r,(i=s,function(e,t){return i(t,e)})):t(r,e,s);return s||!1},e.src=function(e){var n=this;if(void 0===e)return this.cache_.src||"";var r=Gi(e);r.length?(this.changingSrc_=!0,this.cache_.sources=r,this.updateSourceCaches_(r[0]),ji(this,r[0],function(e,t){var i;return n.middleware_=t,n.cache_.sources=r,n.updateSourceCaches_(e),n.src_(e)?1<r.length?n.src(r.slice(1)):(n.changingSrc_=!1,n.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0),void n.triggerReady()):(i=n.tech_,void t.forEach(function(e){return e.setTech&&e.setTech(i)}))})):this.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0)},e.src_=function(e){var t,i,n=this,r=this.selectSource([e]);return!r||(t=r.tech,i=this.techName_,xe(t)!==xe(i)?(this.changingSrc_=!0,this.loadTech_(r.tech,r.source),this.tech_.ready(function(){n.changingSrc_=!1})):this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1)},e.load=function(){this.techCall_("load")},e.reset=function(){var e=this,t=this.options_.Promise||d.Promise;this.paused()||!t?this.doReset_():bt(this.play().then(function(){return e.doReset_()}))},e.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),ke(this)&&this.trigger("playerreset")},e.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},e.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar,t=e.durationDisplay,e=e.remainingTimeDisplay;t&&t.updateContent(),e&&e.updateContent()},e.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},e.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},e.currentSources=function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t},e.currentSource=function(){return this.cache_.source||{}},e.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},e.currentType=function(){return this.currentSource()&&this.currentSource().type||""},e.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},e.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var t;"string"==typeof e&&/(any|play|muted)/.test(e)?(this.options_.autoplay=e,this.manualAutoplay_(e),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)},e.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},e.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},e.poster=function(e){if(void 0===e)return this.poster_;(e=e||"")!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},e.handleTechPosterChange_=function(){var e;this.poster_&&!this.options_.techCanOverridePoster||!this.tech_||!this.tech_.poster||(e=this.tech_.poster()||"")!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))},e.controls=function(e){if(void 0===e)return!!this.controls_;this.controls_!==(e=!!e)&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},e.usingNativeControls=function(e){if(void 0===e)return!!this.usingNativeControls_;this.usingNativeControls_!==(e=!!e)&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},e.error=function(e){if(void 0===e)return this.error_||null;if(this.options_.suppressNotSupportedError&&e&&4===e.code){var t=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),void this.one("loadstart",function(){this.off(["click","touchstart"],t)})}if(null===e)return this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new gt(e),this.addClass("vjs-error"),p.error("(CODE:"+this.error_.code+" "+gt.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error")},e.reportUserActivity=function(e){this.userActivity_=!0},e.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(e){e.stopPropagation(),e.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},e.listenForUserActivity_=function(){var t,i,n,r=ye(this,this.reportUserActivity),e=function(e){r(),this.clearInterval(t)};this.on("mousedown",function(){r(),this.clearInterval(t),t=this.setInterval(r,250)}),this.on("mousemove",function(e){e.screenX===i&&e.screenY===n||(i=e.screenX,n=e.screenY,r())}),this.on("mouseup",e),this.on("mouseleave",e);var s,e=this.getChild("controlBar");!e||nt||We||(e.on("mouseenter",function(e){this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout,this.player().options_.inactivityTimeout=0}),e.on("mouseleave",function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r),this.setInterval(function(){var e;this.userActivity_&&(this.userActivity_=!1,this.userActive(!0),this.clearTimeout(s),(e=this.options_.inactivityTimeout)<=0||(s=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},e)))},250)},e.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},e.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},e.isAudio=function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e},e.addTextTrack=function(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)},e.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)},e.removeRemoteTextTrack=function(e){var t=(t=(e=void 0===e?{}:e).track)||e;if(this.tech_)return this.tech_.removeRemoteTextTrack(t)},e.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},e.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},e.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},e.language=function(e){if(void 0===e)return this.language_;this.language_=String(e).toLowerCase()},e.languages=function(){return Le(o.prototype.options_.languages,this.languages_)},e.toJSON=function(){var e=Le(this.options_),t=e.tracks;e.tracks=[];for(var i=0;i<t.length;i++){var n=t[i];(n=Le(n)).player=void 0,e.tracks[i]=n}return e},e.createModal=function(e,t){var i=this;(t=t||{}).content=e||"";var n=new wt(this,t);return this.addChild(n),n.on("dispose",function(){i.removeChild(n)}),n.open(),n},e.updateCurrentBreakpoint_=function(){if(this.responsive())for(var e=this.currentBreakpoint(),t=this.currentWidth(),i=0;i<On.length;i++){var n=On[i];if(t<=this.breakpoints_[n]){if(e===n)return;e&&this.removeClass(Dn[e]),this.addClass(Dn[n]),this.breakpoint_=n;break}}},e.removeCurrentBreakpoint_=function(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)},e.breakpoints=function(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=m({},Nn,e),this.updateCurrentBreakpoint_()),m(this.breakpoints_)},e.responsive=function(e){return void 0===e?this.responsive_:(e=Boolean(e))!==this.responsive_?((this.responsive_=e)?(this.on("playerresize",this.updateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.updateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0},e.currentBreakpoint=function(){return this.breakpoint_},e.currentBreakpointClass=function(){return Dn[this.breakpoint_]||""},e.loadMedia=function(e,t){var i,n,r,s=this;e&&"object"==typeof e&&(this.reset(),this.cache_.media=Le(e),i=(r=this.cache_.media).artwork,n=r.poster,e=r.src,r=r.textTracks,!i&&n&&(this.cache_.media.artwork=[{src:n,type:Ki(n)}]),e&&this.src(e),n&&this.poster(n),Array.isArray(r)&&r.forEach(function(e){return s.addRemoteTextTrack(e,!1)}),this.ready(t))},e.getMedia=function(){if(this.cache_.media)return Le(this.cache_.media);var e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),function(e){return{kind:e.kind,label:e.label,language:e.language,src:e.src}})};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:Ki(t.poster)}]),t},o.getTagSettings=function(e){var t,i={sources:[],tracks:[]},n=P(e),r=n["data-setup"];if(C(e,"vjs-fill")&&(n.fill=!0),C(e,"vjs-fluid")&&(n.fluid=!0),null!==r&&(r=(t=vt(r||"{}"))[0],t=t[1],r&&p.error(r),m(n,t)),m(i,n),e.hasChildNodes())for(var s=e.childNodes,a=0,o=s.length;a<o;a++){var u=s[a],l=u.nodeName.toLowerCase();"source"===l?i.sources.push(P(u)):"track"===l&&i.tracks.push(P(u))}return i},e.flexNotSupported_=function(){var e=h.createElement("i");return!("flexBasis"in e.style||"webkitFlexBasis"in e.style||"mozFlexBasis"in e.style||"msFlexBasis"in e.style||"msFlexOrder"in e.style)},e.debug=function(e){if(void 0===e)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)},o}(Ue);ri.names.forEach(function(e){var t=ri[e];Rn.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}}),Rn.prototype.crossorigin=Rn.prototype.crossOrigin,Rn.players={};Ve=d.navigator;Rn.prototype.options_={techOrder:Ri.defaultTechOrder_,html5:{},flash:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Ve&&(Ve.languages&&Ve.languages[0]||Ve.userLanguage||Ve.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1},["ended","seeking","seekable","networkState","readyState"].forEach(function(e){Rn.prototype[e]=function(){return this.techGet_(e)}}),xn.forEach(function(e){Rn.prototype["handleTech"+xe(e)+"_"]=function(){return this.trigger(e)}}),Ue.registerComponent("Player",Rn);var Un=e(function(i){function n(e,t){return i.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(e,t)}i.exports=n});function Mn(e){return Xn.hasOwnProperty(e)}function Bn(e){return Mn(e)?Xn[e]:void 0}function jn(e,t){e[Gn]=e[Gn]||{},e[Gn][t]=!0}function Fn(e,t,i){i=(i?"before":"")+"pluginsetup",e.trigger(i,t),e.trigger(i+":"+t.name,t)}function Hn(t,i){function n(){Fn(this,{name:t,plugin:i,instance:null},!0);var e=i.apply(this,arguments);return jn(this,t),Fn(this,{name:t,plugin:i,instance:e}),e}return Object.keys(i).forEach(function(e){n[e]=i[e]}),n}function Vn(r,s){return s.prototype.name=r,function(){Fn(this,{name:r,plugin:s,instance:null},!0);for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var n=Wn(s,[this].concat(t));return this[r]=function(){return n},Fn(this,n.getEventHash()),n}}var qn=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}},Wn=e(function(n){function r(e,t,i){return qn()?n.exports=r=Reflect.construct:n.exports=r=function(e,t,i){var n=[null];n.push.apply(n,t);n=new(Function.bind.apply(e,n));return i&&Un(n,i.prototype),n},r.apply(null,arguments)}n.exports=r}),zn="plugin",Gn="activePlugins_",Xn={},Kn=function(){function i(e){if(this.constructor===i)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),we(this),delete this.trigger,Ie(this,this.constructor.defaultState),jn(e,this.name),this.dispose=ye(this,this.dispose),e.on("dispose",this.dispose)}var e=i.prototype;return e.version=function(){return this.constructor.VERSION},e.getEventHash=function(e){return(e=void 0===e?{}:e).name=this.name,e.plugin=this.constructor,e.instance=this,e},e.trigger=function(e,t){return le(this.eventBusEl_,e,this.getEventHash(t=void 0===t?{}:t))},e.handleStateChanged=function(e){},e.dispose=function(){var e=this.name,t=this.player;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[Gn][e]=!1,this.player=this.state=null,t[e]=Vn(e,Xn[e])},i.isBasic=function(e){e="string"==typeof e?Bn(e):e;return"function"==typeof e&&!i.prototype.isPrototypeOf(e.prototype)},i.registerPlugin=function(e,t){if("string"!=typeof e)throw new Error('Illegal plugin name, "'+e+'", must be a string, was '+typeof e+".");if(Mn(e))p.warn('A plugin named "'+e+'" already exists. You may want to avoid re-registering plugins!');else if(Rn.prototype.hasOwnProperty(e))throw new Error('Illegal plugin name, "'+e+'", cannot share a name with an existing player method!');if("function"!=typeof t)throw new Error('Illegal plugin for "'+e+'", must be a function, was '+typeof t+".");return Xn[e]=t,e!==zn&&(i.isBasic(t)?Rn.prototype[e]=Hn(e,t):Rn.prototype[e]=Vn(e,t)),t},i.deregisterPlugin=function(e){if(e===zn)throw new Error("Cannot de-register base plugin.");Mn(e)&&(delete Xn[e],delete Rn.prototype[e])},i.getPlugins=function(e){var i;return(e=void 0===e?Object.keys(Xn):e).forEach(function(e){var t=Bn(e);t&&((i=i||{})[e]=t)}),i},i.getPluginVersion=function(e){e=Bn(e);return e&&e.VERSION||""},i}();Kn.getPlugin=Bn,Kn.BASE_PLUGIN_NAME=zn,Kn.registerPlugin(zn,Kn),Rn.prototype.usingPlugin=function(e){return!!this[Gn]&&!0===this[Gn][e]},Rn.prototype.hasPlugin=function(e){return!!Mn(e)};function Yn(e){return 0===e.indexOf("#")?e.slice(1):e}var $n=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Un(e,t)};function Qn(e,t,i){if(r=Qn.getPlayer(e))return t&&p.warn('Player "'+e+'" is already initialised. Options will not be applied.'),i&&r.ready(i),r;var n="string"==typeof e?G("#"+Yn(e)):e;if(!v(n))throw new TypeError("The element or ID supplied is not valid. (videojs)");n.ownerDocument.defaultView&&n.ownerDocument.body.contains(n)||p.warn("The element supplied is not included in the DOM"),t=t||{},Qn.hooks("beforesetup").forEach(function(e){e=e(n,Le(t));o(e)&&!Array.isArray(e)?t=Le(t,e):p.error("please return an object in beforesetup hooks")});var r=new(Ue.getComponent("Player"))(n,t,i);return Qn.hooks("setup").forEach(function(e){return e(r)}),r}Qn.hooks_={},Qn.hooks=function(e,t){return Qn.hooks_[e]=Qn.hooks_[e]||[],t&&(Qn.hooks_[e]=Qn.hooks_[e].concat(t)),Qn.hooks_[e]},Qn.hook=function(e,t){Qn.hooks(e,t)},Qn.hookOnce=function(i,e){Qn.hooks(i,[].concat(e).map(function(t){return function e(){return Qn.removeHook(i,e),t.apply(void 0,arguments)}}))},Qn.removeHook=function(e,t){t=Qn.hooks(e).indexOf(t);return!(t<=-1)&&(Qn.hooks_[e]=Qn.hooks_[e].slice(),Qn.hooks_[e].splice(t,1),!0)},!0!==d.VIDEOJS_NO_DYNAMIC_STYLE&&y()&&((pr=G(".vjs-styles-defaults"))||(pr=J("vjs-styles-defaults"),(ir=G("head"))&&ir.insertBefore(pr,ir.firstChild),Z(pr,"\n      .video-js {\n        width: 300px;\n        height: 150px;\n      }\n\n      .vjs-fluid {\n        padding-top: 56.25%\n      }\n    "))),$(1,Qn),Qn.VERSION=u,Qn.options=Rn.prototype.options_,Qn.getPlayers=function(){return Rn.players},Qn.getPlayer=function(e){var t=Rn.players;if("string"==typeof e){var i=Yn(e),n=t[i];if(n)return n;i=G("#"+i)}else i=e;if(v(i)){e=i,i=e.player,e=e.playerId;if(i||t[e])return i||t[e]}},Qn.getAllPlayers=function(){return Object.keys(Rn.players).map(function(e){return Rn.players[e]}).filter(Boolean)},Qn.players=Rn.players,Qn.getComponent=Ue.getComponent,Qn.registerComponent=function(e,t){Ri.isTech(t)&&p.warn("The "+e+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),Ue.registerComponent.call(Ue,e,t)},Qn.getTech=Ri.getTech,Qn.registerTech=Ri.registerTech,Qn.use=function(e,t){Ui[e]=Ui[e]||[],Ui[e].push(t)},Object.defineProperty(Qn,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(Qn.middleware,"TERMINATOR",{value:Bi,writeable:!1,enumerable:!0}),Qn.browser=st,Qn.TOUCH_ENABLED=et,Qn.extend=function(e,t){var i,n=function(){e.apply(this,arguments)},r={};for(i in"object"==typeof(t=void 0===t?{}:t)?(t.constructor!==Object.prototype.constructor&&(n=t.constructor),r=t):"function"==typeof t&&(n=t),$n(n,e),e&&(n.super_=e),r)r.hasOwnProperty(i)&&(n.prototype[i]=r[i]);return n},Qn.mergeOptions=Le,Qn.bind=ye,Qn.registerPlugin=Kn.registerPlugin,Qn.deregisterPlugin=Kn.deregisterPlugin,Qn.plugin=function(e,t){return p.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Kn.registerPlugin(e,t)},Qn.getPlugins=Kn.getPlugins,Qn.getPlugin=Kn.getPlugin,Qn.getPluginVersion=Kn.getPluginVersion,Qn.addLanguage=function(e,t){var i;return e=(""+e).toLowerCase(),Qn.options.languages=Le(Qn.options.languages,((i={})[e]=t,i)),Qn.options.languages[e]},Qn.log=p,Qn.createLogger=f,Qn.createTimeRange=Qn.createTimeRanges=ut,Qn.formatTime=rn,Qn.setFormatTime=function(e){nn=e},Qn.resetFormatTime=function(){nn=tn},Qn.parseUrl=Lt,Qn.isCrossOrigin=Vt,Qn.EventTarget=fe,Qn.on=oe,Qn.one=ce,Qn.off=ue,Qn.trigger=le,Qn.xhr=Gt,Qn.TextTrack=Zt,Qn.AudioTrack=He,Qn.VideoTrack=ei,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(e){Qn[e]=function(){return p.warn("videojs."+e+"() is deprecated; use videojs.dom."+e+"() instead"),K[e].apply(null,arguments)}}),Qn.computedStyle=n,Qn.dom=K,Qn.url=Fe,Qn.defineLazyProperty=Sn;var Jn=e(function(e,t){var i,s,n,r,a;i=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,s=/^([^\/?#]*)(.*)$/,n=/(?:\/|^)\.(?=\/)/g,r=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,a={buildAbsoluteURL:function(e,t,i){if(i=i||{},e=e.trim(),!(t=t.trim())){if(!i.alwaysNormalize)return e;var n=a.parseURL(e);if(!n)throw new Error("Error trying to parse base URL.");return n.path=a.normalizePath(n.path),a.buildURLFromParts(n)}n=a.parseURL(t);if(!n)throw new Error("Error trying to parse relative URL.");if(n.scheme)return i.alwaysNormalize?(n.path=a.normalizePath(n.path),a.buildURLFromParts(n)):t;t=a.parseURL(e);if(!t)throw new Error("Error trying to parse base URL.");!t.netLoc&&t.path&&"/"!==t.path[0]&&(r=s.exec(t.path),t.netLoc=r[1],t.path=r[2]),t.netLoc&&!t.path&&(t.path="/");var r,e={scheme:t.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};return n.netLoc||(e.netLoc=t.netLoc,"/"!==n.path[0]&&(n.path?(r=(r=t.path).substring(0,r.lastIndexOf("/")+1)+n.path,e.path=a.normalizePath(r)):(e.path=t.path,n.params||(e.params=t.params,n.query||(e.query=t.query))))),null===e.path&&(e.path=i.alwaysNormalize?a.normalizePath(n.path):n.path),a.buildURLFromParts(e)},parseURL:function(e){e=i.exec(e);return e?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(n,"");e.length!==(e=e.replace(r,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=a});function Zn(){return(Zn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i,n=arguments[t];for(i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function er(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}function tr(e){for(var t,i=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),n={},r=i.length;r--;)""!==i[r]&&((t=/([^=]*)=(.*)/.exec(i[r]).slice(1))[0]=t[0].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^['"](.*)['"]$/g,"$1"),n[t[0]]=t[1]);return n}var ir=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;t=this.listeners[e].indexOf(t);return this.listeners[e].splice(t,1),-1<t},t.trigger=function(e){var t,i,n,r=this.listeners[e];if(r)if(2===arguments.length)for(i=r.length,t=0;t<i;++t)r[t].call(this,arguments[1]);else for(n=Array.prototype.slice.call(arguments,1),i=r.length,t=0;t<i;++t)r[t].apply(this,n)},t.dispose=function(){this.listeners={}},t.pipe=function(t){this.on("data",function(e){t.push(e)})},e}(),nr=function(t){function e(){var e=t.call(this)||this;return e.buffer="",e}return er(e,t),e.prototype.push=function(e){var t;for(this.buffer+=e,t=this.buffer.indexOf("\n");-1<t;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},e}(ir),rr=function(t){function e(){var e=t.call(this)||this;return e.customParsers=[],e.tagMappers=[],e}er(e,t);var i=e.prototype;return i.push=function(i){var s,a,o=this;0!==(i=i.trim()).length&&("#"===i[0]?this.tagMappers.reduce(function(e,t){t=t(i);return t===i?e:e.concat([t])},[i]).forEach(function(e){for(var t,i,n,r=0;r<o.customParsers.length;r++)if(o.customParsers[r].call(o,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),s=/^#EXTM3U/.exec(e))o.trigger("data",{type:"tag",tagType:"m3u"});else{if(s=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e))return a={type:"tag",tagType:"inf"},s[1]&&(a.duration=parseFloat(s[1])),s[2]&&(a.title=s[2]),void o.trigger("data",a);if(s=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e))return a={type:"tag",tagType:"targetduration"},s[1]&&(a.duration=parseInt(s[1],10)),void o.trigger("data",a);if(s=/^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(e))return a={type:"tag",tagType:"totalduration"},s[1]&&(a.duration=parseInt(s[1],10)),void o.trigger("data",a);if(s=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(e))return a={type:"tag",tagType:"version"},s[1]&&(a.version=parseInt(s[1],10)),void o.trigger("data",a);if(s=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return a={type:"tag",tagType:"media-sequence"},s[1]&&(a.number=parseInt(s[1],10)),void o.trigger("data",a);if(s=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return a={type:"tag",tagType:"discontinuity-sequence"},s[1]&&(a.number=parseInt(s[1],10)),void o.trigger("data",a);if(s=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e))return a={type:"tag",tagType:"playlist-type"},s[1]&&(a.playlistType=s[1]),void o.trigger("data",a);if(s=/^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(e))return a={type:"tag",tagType:"byterange"},s[1]&&(a.length=parseInt(s[1],10)),s[2]&&(a.offset=parseInt(s[2],10)),void o.trigger("data",a);if(s=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e))return a={type:"tag",tagType:"allow-cache"},s[1]&&(a.allowed=!/NO/.test(s[1])),void o.trigger("data",a);if(s=/^#EXT-X-MAP:?(.*)$/.exec(e))return a={type:"tag",tagType:"map"},s[1]&&((t=tr(s[1])).URI&&(a.uri=t.URI),t.BYTERANGE&&(n=(i=t.BYTERANGE.split("@"))[0],i=i[1],a.byterange={},n&&(a.byterange.length=parseInt(n,10)),i&&(a.byterange.offset=parseInt(i,10)))),void o.trigger("data",a);if(s=/^#EXT-X-STREAM-INF:?(.*)$/.exec(e))return a={type:"tag",tagType:"stream-inf"},s[1]&&(a.attributes=tr(s[1]),a.attributes.RESOLUTION&&(n={},(i=a.attributes.RESOLUTION.split("x"))[0]&&(n.width=parseInt(i[0],10)),i[1]&&(n.height=parseInt(i[1],10)),a.attributes.RESOLUTION=n),a.attributes.BANDWIDTH&&(a.attributes.BANDWIDTH=parseInt(a.attributes.BANDWIDTH,10)),a.attributes["PROGRAM-ID"]&&(a.attributes["PROGRAM-ID"]=parseInt(a.attributes["PROGRAM-ID"],10))),void o.trigger("data",a);if(s=/^#EXT-X-MEDIA:?(.*)$/.exec(e))return a={type:"tag",tagType:"media"},s[1]&&(a.attributes=tr(s[1])),void o.trigger("data",a);if(s=/^#EXT-X-ENDLIST/.exec(e))o.trigger("data",{type:"tag",tagType:"endlist"});else{if(!(s=/^#EXT-X-DISCONTINUITY/.exec(e)))return(s=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e))?(a={type:"tag",tagType:"program-date-time"},s[1]&&(a.dateTimeString=s[1],a.dateTimeObject=new Date(s[1])),void o.trigger("data",a)):(s=/^#EXT-X-KEY:?(.*)$/.exec(e))?(a={type:"tag",tagType:"key"},s[1]&&(a.attributes=tr(s[1]),a.attributes.IV&&("0x"===a.attributes.IV.substring(0,2).toLowerCase()&&(a.attributes.IV=a.attributes.IV.substring(2)),a.attributes.IV=a.attributes.IV.match(/.{8}/g),a.attributes.IV[0]=parseInt(a.attributes.IV[0],16),a.attributes.IV[1]=parseInt(a.attributes.IV[1],16),a.attributes.IV[2]=parseInt(a.attributes.IV[2],16),a.attributes.IV[3]=parseInt(a.attributes.IV[3],16),a.attributes.IV=new Uint32Array(a.attributes.IV))),void o.trigger("data",a)):(s=/^#EXT-X-START:?(.*)$/.exec(e))?(a={type:"tag",tagType:"start"},s[1]&&(a.attributes=tr(s[1]),a.attributes["TIME-OFFSET"]=parseFloat(a.attributes["TIME-OFFSET"]),a.attributes.PRECISE=/YES/.test(a.attributes.PRECISE)),void o.trigger("data",a)):(s=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e))?(a={type:"tag",tagType:"cue-out-cont"},s[1]?a.data=s[1]:a.data="",void o.trigger("data",a)):(s=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(e))?(a={type:"tag",tagType:"cue-out"},s[1]?a.data=s[1]:a.data="",void o.trigger("data",a)):(s=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e))?(a={type:"tag",tagType:"cue-in"},s[1]?a.data=s[1]:a.data="",void o.trigger("data",a)):void o.trigger("data",{type:"tag",data:e.slice(4)});o.trigger("data",{type:"tag",tagType:"discontinuity"})}}else o.trigger("data",{type:"comment",text:e.slice(1)})}):this.trigger("data",{type:"uri",uri:i}))},i.addParser=function(e){var t=this,i=e.expression,n=e.customType,r=e.dataParser,s=e.segment;"function"!=typeof r&&(r=function(e){return e}),this.customParsers.push(function(e){if(i.exec(e))return t.trigger("data",{type:"custom",data:r(e),customType:n,segment:s}),!0})},i.addTagMapper=function(e){var t=e.expression,i=e.map;this.tagMappers.push(function(e){return t.test(e)?i(e):e})},e}(ir);var sr=function(t){function e(){var e=t.call(this)||this;e.lineStream=new nr,e.parseStream=new rr,e.lineStream.pipe(e.parseStream);var r,s,a=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e),o=[],u={},l={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},c=0;return e.manifest={allowCache:!0,discontinuityStarts:[],segments:[]},e.parseStream.on("data",function(t){var i,n;({tag:function(){({"allow-cache":function(){this.manifest.allowCache=t.allowed,"allowed"in t||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var e={};"length"in t&&((u.byterange=e).length=t.length,"offset"in t||(this.trigger("info",{message:"defaulting offset to zero"}),t.offset=0)),"offset"in t&&((u.byterange=e).offset=t.offset)},endlist:function(){this.manifest.endList=!0},inf:function(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),0<t.duration&&(u.duration=t.duration),0===t.duration&&(u.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=o},key:function(){if(t.attributes)if("NONE"!==t.attributes.METHOD)if(t.attributes.URI){if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===t.attributes.KEYFORMAT)return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(t.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===t.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==t.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):t.attributes.KEYID&&"0x"===t.attributes.KEYID.substring(0,2)?void(this.manifest.contentProtection={"com.widevine.alpha":{attributes:{schemeIdUri:t.attributes.KEYFORMAT,keyId:t.attributes.KEYID.substring(2)},pssh:function(e){for(var t=d.atob(e||""),i=new Uint8Array(t.length),n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return i}(t.attributes.URI.split(",")[1])}}):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));t.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),s={method:t.attributes.METHOD||"AES-128",uri:t.attributes.URI},void 0!==t.attributes.IV&&(s.iv=t.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else s=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(t.number)?this.manifest.mediaSequence=t.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+t.number})},"discontinuity-sequence":function(){isFinite(t.number)?(this.manifest.discontinuitySequence=t.number,c=t.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+t.number})},"playlist-type":function(){/VOD|EVENT/.test(t.playlistType)?this.manifest.playlistType=t.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+t.playlist})},map:function(){r={},t.uri&&(r.uri=t.uri),t.byterange&&(r.byterange=t.byterange)},"stream-inf":function(){this.manifest.playlists=o,this.manifest.mediaGroups=this.manifest.mediaGroups||l,t.attributes?(u.attributes||(u.attributes={}),Zn(u.attributes,t.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){var e;this.manifest.mediaGroups=this.manifest.mediaGroups||l,t.attributes&&t.attributes.TYPE&&t.attributes["GROUP-ID"]&&t.attributes.NAME?((e=this.manifest.mediaGroups[t.attributes.TYPE])[t.attributes["GROUP-ID"]]=e[t.attributes["GROUP-ID"]]||{},i=e[t.attributes["GROUP-ID"]],(n={default:/yes/i.test(t.attributes.DEFAULT)}).default?n.autoselect=!0:n.autoselect=/yes/i.test(t.attributes.AUTOSELECT),t.attributes.LANGUAGE&&(n.language=t.attributes.LANGUAGE),t.attributes.URI&&(n.uri=t.attributes.URI),t.attributes["INSTREAM-ID"]&&(n.instreamId=t.attributes["INSTREAM-ID"]),t.attributes.CHARACTERISTICS&&(n.characteristics=t.attributes.CHARACTERISTICS),t.attributes.FORCED&&(n.forced=/yes/i.test(t.attributes.FORCED)),i[t.attributes.NAME]=n):this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){c+=1,u.discontinuity=!0,this.manifest.discontinuityStarts.push(o.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=t.dateTimeString,this.manifest.dateTimeObject=t.dateTimeObject),u.dateTimeString=t.dateTimeString,u.dateTimeObject=t.dateTimeObject},targetduration:function(){!isFinite(t.duration)||t.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+t.duration}):this.manifest.targetDuration=t.duration},totalduration:function(){!isFinite(t.duration)||t.duration<0?this.trigger("warn",{message:"ignoring invalid total duration: "+t.duration}):this.manifest.totalDuration=t.duration},start:function(){t.attributes&&!isNaN(t.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:t.attributes["TIME-OFFSET"],precise:t.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){u.cueOut=t.data},"cue-out-cont":function(){u.cueOutCont=t.data},"cue-in":function(){u.cueIn=t.data}}[t.tagType]||function(){}).call(a)},uri:function(){u.uri=t.uri,o.push(u),!this.manifest.targetDuration||"duration"in u||(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),u.duration=this.manifest.targetDuration),s&&(u.key=s),u.timeline=c,r&&(u.map=r),u={}},comment:function(){},custom:function(){t.segment?(u.custom=u.custom||{},u.custom[t.customType]=t.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[t.customType]=t.data)}})[t.type].call(a)}),e}er(e,t);var i=e.prototype;return i.push=function(e){this.lineStream.push(e)},i.end=function(){this.lineStream.push("\n")},i.addParser=function(e){this.parseStream.addParser(e)},i.addTagMapper=function(e){this.parseStream.addTagMapper(e)},e}(ir);function ar(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var or=ar(Jn),ur=ar(d),lr=function(e,t){return/^[a-z]+:/i.test(t)?t:(/\/\//i.test(e)||(e=or.buildAbsoluteURL(ur.location&&ur.location.href||"",e)),or.buildAbsoluteURL(e,t))};var cr,hr=(cr=d)&&"object"==typeof cr&&"default"in cr?cr.default:cr;var dr=function(e){for(var t=(e=e,hr.atob?hr.atob(e):Buffer.from(e,"base64").toString("binary")),i=new Uint8Array(t.length),n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return i},pr=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,st=new RegExp("[\\-\\.0-9"+pr.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),fr=new RegExp("^"+pr.source+st.source+"*(?::"+pr.source+st.source+"*)?$"),mr=0,gr=1,yr=2,vr=3,_r=4,br=5,Tr=6,Sr=7;function kr(){}function Cr(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function Er(e,t,i){for(var n=e.tagName,r=null,s=e.length;s--;){var a=e[s],o=a.qName,u=a.value,o=0<(c=o.indexOf(":"))?(l=a.prefix=o.slice(0,c),h=o.slice(c+1),"xmlns"===l&&h):(l=null,"xmlns"===(h=o)&&"");a.localName=h,!1!==o&&(null==r&&(r={},wr(i,i={})),i[o]=r[o]=u,a.uri="http://www.w3.org/2000/xmlns/",t.startPrefixMapping(o,u))}for(var l,s=e.length;s--;)(l=(a=e[s]).prefix)&&("xml"===l&&(a.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==l&&(a.uri=i[l||""]));var c,h=0<(c=n.indexOf(":"))?(l=e.prefix=n.slice(0,c),e.localName=n.slice(c+1)):(l=null,e.localName=n),d=e.uri=i[l||""];if(t.startElement(d,h,n,e),!e.closed)return e.currentNSMap=i,e.localNSMap=r,1;if(t.endElement(d,h,n),r)for(l in r)t.endPrefixMapping(l)}function wr(e,t){for(var i in e)t[i]=e[i]}function Ar(e){}function Ir(e,t){return e.__proto__=t,e}kr.prototype={parse:function(e,t,i){var n=this.domBuilder;n.startDocument(),wr(t,t={}),function(i,e,n,r,s){function a(e){var t=e.slice(1,-1);return t in n?n[t]:"#"===t.charAt(0)?65535<(t=parseInt(t.substr(1).replace("x","0x")))?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):String.fromCharCode(t):(s.error("entity not found:"+e),e)}function t(e){var t;f<e&&(t=i.substring(f,e).replace(/&#?\w+;/g,a),h&&o(f),r.characters(t,0,e-f),f=e)}function o(e,t){for(;l<=e&&(t=c.exec(i));)u=t.index,l=u+t[0].length,h.lineNumber++;h.columnNumber=e-u+1}var u=0,l=0,c=/.*(?:\r\n?|\n)|.*$/g,h=r.locator,d=[{currentNSMap:e}],p={},f=0;for(;;){try{var m,g,y=i.indexOf("<",f);if(y<0)return i.substr(f).match(/^\s*$/)||(m=r.doc,g=m.createTextNode(i.substr(f)),m.appendChild(g),r.currentElement=g);switch(f<y&&t(y),i.charAt(y+1)){case"/":var v=i.indexOf(">",y+3),_=i.substring(y+2,v),b=d.pop();v<0?(_=i.substring(y+2).replace(/[\s<].*/,""),s.error("end tag name: "+_+" is not complete:"+b.tagName),v=y+1+_.length):_.match(/\s</)&&(_=_.replace(/[\s<].*/,""),s.error("end tag name: "+_+" maybe not complete"),v=y+1+_.length);var T=b.localNSMap,S=b.tagName==_;if(S||b.tagName&&b.tagName.toLowerCase()==_.toLowerCase()){if(r.endElement(b.uri,b.localName,_),T)for(var k in T)r.endPrefixMapping(k);S||s.fatalError("end tag name: "+_+" is not match the current start tagName:"+b.tagName)}else d.push(b);v++;break;case"?":h&&o(y),v=function(e,t,i){var n=e.indexOf("?>",t);if(n){t=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(t){t[0].length;return i.processingInstruction(t[1],t[2]),n+2}return-1}return-1}(i,y,r);break;case"!":h&&o(y),v=function(e,t,i,n){{if("-"===e.charAt(t+2)){if("-"!==e.charAt(t+3))return-1;var r=e.indexOf("--\x3e",t+4);return t<r?(i.comment(e,t+4,r-t-4),r+3):(n.error("Unclosed comment"),-1)}if("CDATA["==e.substr(t+3,6)){r=e.indexOf("]]>",t+9);return i.startCDATA(),i.characters(e,t+9,r-t-9),i.endCDATA(),r+3}var s=function(e,t){var i,n=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;r.lastIndex=t,r.exec(e);for(;i=r.exec(e);)if(n.push(i),i[1])return n}(e,t),n=s.length;if(1<n&&/!doctype/i.test(s[0][0])){r=s[1][0],e=3<n&&/^public$/i.test(s[2][0])&&s[3][0],t=4<n&&s[4][0],n=s[n-1];return i.startDTD(r,e&&e.replace(/^(['"])(.*?)\1$/,"$2"),t&&t.replace(/^(['"])(.*?)\1$/,"$2")),i.endDTD(),n.index+n[0].length}}return-1}(i,y,r,s);break;default:h&&o(y);var C=new Ar,E=d[d.length-1].currentNSMap,v=function(e,t,i,n,r,s){var a,o=++t,u=mr;for(;;){var l=e.charAt(o);switch(l){case"=":if(u===gr)a=e.slice(t,o),u=vr;else{if(u!==yr)throw new Error("attribute equal must after attrName");u=vr}break;case"'":case'"':if(u===vr||u===gr){if(u===gr&&(s.warning('attribute value must after "="'),a=e.slice(t,o)),t=o+1,!(0<(o=e.indexOf(l,t))))throw new Error("attribute value no end '"+l+"' match");c=e.slice(t,o).replace(/&#?\w+;/g,r),i.add(a,c,t-1),u=br}else{if(u!=_r)throw new Error('attribute value must after "="');c=e.slice(t,o).replace(/&#?\w+;/g,r),i.add(a,c,t),s.warning('attribute "'+a+'" missed start quot('+l+")!!"),t=o+1,u=br}break;case"/":switch(u){case mr:i.setTagName(e.slice(t,o));case br:case Tr:case Sr:u=Sr,i.closed=!0;case _r:case gr:case yr:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),u==mr&&i.setTagName(e.slice(t,o)),o;case">":switch(u){case mr:i.setTagName(e.slice(t,o));case br:case Tr:case Sr:break;case _r:case gr:"/"===(c=e.slice(t,o)).slice(-1)&&(i.closed=!0,c=c.slice(0,-1));case yr:u===yr&&(c=a),u==_r?(s.warning('attribute "'+c+'" missed quot(")!!'),i.add(a,c.replace(/&#?\w+;/g,r),t)):("http://www.w3.org/1999/xhtml"===n[""]&&c.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+c+'" missed value!! "'+c+'" instead!!'),i.add(c,c,t));break;case vr:throw new Error("attribute value missed!!")}return o;case"":l=" ";default:if(l<=" ")switch(u){case mr:i.setTagName(e.slice(t,o)),u=Tr;break;case gr:a=e.slice(t,o),u=yr;break;case _r:var c=e.slice(t,o).replace(/&#?\w+;/g,r);s.warning('attribute "'+c+'" missed quot(")!!'),i.add(a,c,t);case br:u=Tr}else switch(u){case yr:i.tagName;"http://www.w3.org/1999/xhtml"===n[""]&&a.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!'),i.add(a,a,t),t=o,u=gr;break;case br:s.warning('attribute space is required"'+a+'"!!');case Tr:u=gr,t=o;break;case vr:u=_r,t=o;break;case Sr:throw new Error("elements closed character '/' and '>' must be connected to")}}o++}}(i,y,C,E,a,s),w=C.length;if(!C.closed&&function(e,t,i,n){var r=n[i];null==r&&((r=e.lastIndexOf("</"+i+">"))<t&&(r=e.lastIndexOf("</"+i)),n[i]=r);return r<t}(i,v,C.tagName,p)&&(C.closed=!0,n.nbsp||s.warning("unclosed xml attribute")),h&&w){for(var A=Cr(h,{}),I=0;I<w;I++){var P=C[I];o(P.offset),P.locator=Cr(h,{})}r.locator=A,Er(C,r,E)&&d.push(C),r.locator=h}else Er(C,r,E)&&d.push(C);"http://www.w3.org/1999/xhtml"!==C.uri||C.closed?v++:v=function(e,t,i,n,r){if(/^(?:script|textarea)$/i.test(i)){var s=e.indexOf("</"+i+">",t),e=e.substring(t+1,s);if(/[&<]/.test(e))return/^script$/i.test(i)||(e=e.replace(/&#?\w+;/g,n)),r.characters(e,0,e.length),s}return t+1}(i,v,C.tagName,a,r)}}catch(e){s.error("element parse error: "+e),v=-1}f<v?f=v:t(Math.max(y,f)+1)}}(e,t,i,n,this.errorHandler),n.endDocument()}},Ar.prototype={setTagName:function(e){if(!fr.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},add:function(e,t,i){if(!fr.test(e))throw new Error("invalid attribute:"+e);this[this.length++]={qName:e,value:t,offset:i}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},Ir({},Ir.prototype);var Pr={XMLReader:kr};function xr(e,t){for(var i in e)t[i]=e[i]}function Lr(e,t){var i,n=e.prototype;Object.create&&(i=Object.create(t.prototype),n.__proto__=i),n instanceof t||((i=function(){}).prototype=t.prototype,xr(n,i=new i),e.prototype=n=i),n.constructor!=e&&("function"!=typeof e&&console.error("unknow Class:"+e),n.constructor=e)}var Or,He={},ei=(He.ELEMENT_NODE=1,He.ATTRIBUTE_NODE=2,He.TEXT_NODE=3,He.CDATA_SECTION_NODE=4,He.ENTITY_REFERENCE_NODE=5,He.ENTITY_NODE=6,He.PROCESSING_INSTRUCTION_NODE=7,He.COMMENT_NODE=8,He.DOCUMENT_NODE=9,He.DOCUMENT_TYPE_NODE=10,He.DOCUMENT_FRAGMENT_NODE=11,He.NOTATION_NODE=12,{}),Dr={};ei.INDEX_SIZE_ERR=(Dr[1]="Index size error",1),ei.DOMSTRING_SIZE_ERR=(Dr[2]="DOMString size error",2),ei.HIERARCHY_REQUEST_ERR=(Dr[3]="Hierarchy request error",3),ei.WRONG_DOCUMENT_ERR=(Dr[4]="Wrong document",4),ei.INVALID_CHARACTER_ERR=(Dr[5]="Invalid character",5),ei.NO_DATA_ALLOWED_ERR=(Dr[6]="No data allowed",6),ei.NO_MODIFICATION_ALLOWED_ERR=(Dr[7]="No modification allowed",7),ei.NOT_FOUND_ERR=(Dr[8]="Not found",8),ei.NOT_SUPPORTED_ERR=(Dr[9]="Not supported",9),ei.INUSE_ATTRIBUTE_ERR=(Dr[10]="Attribute in use",10),ei.INVALID_STATE_ERR=(Dr[11]="Invalid state",11),ei.SYNTAX_ERR=(Dr[12]="Syntax error",12),ei.INVALID_MODIFICATION_ERR=(Dr[13]="Invalid modification",13),ei.NAMESPACE_ERR=(Dr[14]="Invalid namespace",14),ei.INVALID_ACCESS_ERR=(Dr[15]="Invalid access",15);function Nr(e,t){var i;return t instanceof Error?i=t:(i=this,Error.call(this,Dr[e]),this.message=Dr[e],Error.captureStackTrace&&Error.captureStackTrace(this,Nr)),i.code=e,t&&(this.message=this.message+": "+t),i}function Rr(){}function Ur(e,t){this._node=e,this._refresh=t,Mr(this)}function Mr(e){var t,i=e._node._inc||e._node.ownerDocument._inc;e._inc!=i&&(t=e._refresh(e._node),ps(e,"length",t.length),xr(t,e),e._inc=i)}function Br(){}function jr(e,t){for(var i=e.length;i--;)if(e[i]===t)return i}function Fr(e,t,i,n){n?t[jr(t,n)]=i:t[t.length++]=i,!e||(t=(i.ownerElement=e).ownerDocument)&&(n&&Xr(t,e,n),e=e,i=i,(t=t)&&t._inc++,"http://www.w3.org/2000/xmlns/"==i.namespaceURI&&(e._nsMap[i.prefix?i.localName:""]=i.value))}function Hr(e,t,i){var n=jr(t,i);if(!(0<=n))throw Nr(8,new Error(e.tagName+"@"+i));for(var r,s=t.length-1;n<s;)t[n]=t[++n];t.length=s,!e||(r=e.ownerDocument)&&(Xr(r,e,i),i.ownerElement=null)}function Vr(e){if(this._features={},e)for(var t in e)this._features=e[t]}function qr(){}function Wr(e){return("<"==e?"&lt;":">"==e&&"&gt;")||"&"==e&&"&amp;"||'"'==e&&"&quot;"||"&#"+e.charCodeAt()+";"}function zr(e,t){if(t(e))return 1;if(e=e.firstChild)do{if(zr(e,t))return 1}while(e=e.nextSibling)}function Gr(){}function Xr(e,t,i){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==i.namespaceURI&&delete t._nsMap[i.prefix?i.localName:""]}function Kr(e,t,i){if(e&&e._inc){e._inc++;var n=t.childNodes;if(i)n[n.length++]=i;else{for(var r=t.firstChild,s=0;r;)r=(n[s++]=r).nextSibling;n.length=s}}}function Yr(e,t){var i=t.previousSibling,n=t.nextSibling;return i?i.nextSibling=n:e.firstChild=n,n?n.previousSibling=i:e.lastChild=i,Kr(e.ownerDocument,e),t}function $r(e,t,i){var n=t.parentNode;if(n&&n.removeChild(t),11===t.nodeType){var r=t.firstChild;if(null==r)return t;var s=t.lastChild}else r=s=t;n=i?i.previousSibling:e.lastChild;for(r.previousSibling=n,s.nextSibling=i,n?n.nextSibling=r:e.firstChild=r,null==i?e.lastChild=s:i.previousSibling=s;r.parentNode=e,r!==s&&(r=r.nextSibling););return Kr(e.ownerDocument||e,e),11==t.nodeType&&(t.firstChild=t.lastChild=null),t}function Qr(){this._nsMap={}}function Jr(){}function Zr(){}function es(){}function ts(){}function is(){}function ns(){}function rs(){}function ss(){}function as(){}function os(){}function us(){}function ls(){}function cs(e,t){var i,n=[],r=9==this.nodeType?this.documentElement:this,s=r.prefix,a=r.namespaceURI;return ds(this,n,e,t,i=a&&null==s&&null==(s=r.lookupPrefix(a))?[{namespace:a,prefix:null}]:i),n.join("")}function hs(e,t,i){var n=e.prefix||"",r=e.namespaceURI;if((n||r)&&("xml"!==n||"http://www.w3.org/XML/1998/namespace"!==r)&&"http://www.w3.org/2000/xmlns/"!=r){for(var s=i.length;s--;){var a=i[s];if(a.prefix==n)return a.namespace!=r}return 1}}function ds(e,t,i,n,r){if(n){if(!(e=n(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case 1:r=r||[];var s=e.attributes,a=s.length,o=e.firstChild,u=e.tagName;i="http://www.w3.org/1999/xhtml"===e.namespaceURI||i,t.push("<",u);for(var l=0;l<a;l++)"xmlns"==(c=s.item(l)).prefix?r.push({prefix:c.localName,namespace:c.value}):"xmlns"==c.nodeName&&r.push({prefix:"",namespace:c.value});for(var c,h,d,l=0;l<a;l++)hs(c=s.item(l),0,r)&&(h=c.prefix||"",d=c.namespaceURI,t.push(h?" xmlns:"+h:" xmlns",'="',d,'"'),r.push({prefix:h,namespace:d})),ds(c,t,i,n,r);if(hs(e,0,r)&&(h=e.prefix||"",d=e.namespaceURI,t.push(h?" xmlns:"+h:" xmlns",'="',d,'"'),r.push({prefix:h,namespace:d})),o||i&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(t.push(">"),i&&/^script$/i.test(u))for(;o;)o.data?t.push(o.data):ds(o,t,i,n,r),o=o.nextSibling;else for(;o;)ds(o,t,i,n,r),o=o.nextSibling;t.push("</",u,">")}else t.push("/>");return;case 9:case 11:for(o=e.firstChild;o;)ds(o,t,i,n,r),o=o.nextSibling;return;case 2:return t.push(" ",e.name,'="',e.value.replace(/[<&"]/g,Wr),'"');case 3:return t.push(e.data.replace(/[<&]/g,Wr));case 4:return t.push("<![CDATA[",e.data,"]]>");case 8:return t.push("\x3c!--",e.data,"--\x3e");case 10:var p=e.publicId,u=e.systemId;return t.push("<!DOCTYPE ",e.name),void(p?(t.push(' PUBLIC "',p),u&&"."!=u&&t.push('" "',u),t.push('">')):u&&"."!=u?t.push(' SYSTEM "',u,'">'):((u=e.internalSubset)&&t.push(" [",u,"]"),t.push(">")));case 7:return t.push("<?",e.target," ",e.data,"?>");case 5:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function ps(e,t,i){e[t]=i}Nr.prototype=Error.prototype,xr(ei,Nr),Rr.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var i=[],n=0;n<this.length;n++)ds(this[n],i,e,t);return i.join("")}},Ur.prototype.item=function(e){return Mr(this),this[e]},Lr(Ur,Rr),Br.prototype={length:0,item:Rr.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var i=this[t];if(i.nodeName==e)return i}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new Nr(10);t=this.getNamedItem(e.nodeName);return Fr(this._ownerElement,this,e,t),t},setNamedItemNS:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new Nr(10);return t=this.getNamedItemNS(e.namespaceURI,e.localName),Fr(this._ownerElement,this,e,t),t},removeNamedItem:function(e){e=this.getNamedItem(e);return Hr(this._ownerElement,this,e),e},removeNamedItemNS:function(e,t){t=this.getNamedItemNS(e,t);return Hr(this._ownerElement,this,t),t},getNamedItemNS:function(e,t){for(var i=this.length;i--;){var n=this[i];if(n.localName==t&&n.namespaceURI==e)return n}return null}},Vr.prototype={hasFeature:function(e,t){e=this._features[e.toLowerCase()];return!(!e||t&&!(t in e))},createDocument:function(e,t,i){var n=new Gr;return n.implementation=this,n.childNodes=new Rr,(n.doctype=i)&&n.appendChild(i),t&&(t=n.createElementNS(e,t),n.appendChild(t)),n},createDocumentType:function(e,t,i){var n=new ns;return n.name=e,n.nodeName=e,n.publicId=t,n.systemId=i,n}},qr.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return $r(this,e,t)},replaceChild:function(e,t){this.insertBefore(e,t),t&&this.removeChild(t)},removeChild:function(e){return Yr(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return function e(t,i,n){var r=new i.constructor;for(var s in i){var a=i[s];"object"!=typeof a&&a!=r[s]&&(r[s]=a)}i.childNodes&&(r.childNodes=new Rr);r.ownerDocument=t;switch(r.nodeType){case 1:var o=i.attributes,u=r.attributes=new Br,l=o.length;u._ownerElement=r;for(var c=0;c<l;c++)r.setAttributeNode(e(t,o.item(c),!0));break;case 2:n=!0}if(n)for(var h=i.firstChild;h;)r.appendChild(e(t,h,n)),h=h.nextSibling;return r}(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&3==t.nodeType&&3==e.nodeType?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return 0<this.attributes.length},lookupPrefix:function(e){for(var t=this;t;){var i=t._nsMap;if(i)for(var n in i)if(i[n]==e)return n;t=2==t.nodeType?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var i=t._nsMap;if(i&&e in i)return i[e];t=2==t.nodeType?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},xr(He,qr),xr(He,qr.prototype),Gr.prototype={nodeName:"#document",nodeType:9,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(11!=e.nodeType)return null==this.documentElement&&1==e.nodeType&&(this.documentElement=e),$r(this,e,t),e.ownerDocument=this,e;for(var i=e.firstChild;i;){var n=i.nextSibling;this.insertBefore(i,t),i=n}return e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),Yr(this,e)},importNode:function(e,t){return function e(t,i,n){var r;switch(i.nodeType){case 1:(r=i.cloneNode(!1)).ownerDocument=t;case 11:break;case 2:n=!0}r=r||i.cloneNode(!1);r.ownerDocument=t;r.parentNode=null;if(n)for(var s=i.firstChild;s;)r.appendChild(e(t,s,n)),s=s.nextSibling;return r}(this,e,t)},getElementById:function(t){var i=null;return zr(this.documentElement,function(e){if(1==e.nodeType&&e.getAttribute("id")==t)return i=e,!0}),i},createElement:function(e){var t=new Qr;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new Rr,(t.attributes=new Br)._ownerElement=t},createDocumentFragment:function(){var e=new os;return e.ownerDocument=this,e.childNodes=new Rr,e},createTextNode:function(e){var t=new es;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new ts;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new is;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var i=new us;return i.ownerDocument=this,i.tagName=i.target=e,i.nodeValue=i.data=t,i},createAttribute:function(e){var t=new Jr;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new as;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var i=new Qr,n=t.split(":"),r=i.attributes=new Br;return i.childNodes=new Rr,i.ownerDocument=this,i.nodeName=t,i.tagName=t,i.namespaceURI=e,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,r._ownerElement=i},createAttributeNS:function(e,t){var i=new Jr,n=t.split(":");return i.ownerDocument=this,i.nodeName=t,i.name=t,i.namespaceURI=e,i.specified=!0,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,i}},Lr(Gr,qr),Gr.prototype.getElementsByTagName=(Qr.prototype={nodeType:1,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){e=this.getAttributeNode(e);return e&&e.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){e=this.ownerDocument.createAttribute(e);e.value=e.nodeValue=""+t,this.setAttributeNode(e)},removeAttribute:function(e){e=this.getAttributeNode(e);e&&this.removeAttributeNode(e)},appendChild:function(e){return 11===e.nodeType?this.insertBefore(e,null):function(e,t){var i=t.parentNode;i&&(n=e.lastChild,i.removeChild(t),n=e.lastChild);var n=e.lastChild;return t.parentNode=e,t.previousSibling=n,t.nextSibling=null,n?n.nextSibling=t:e.firstChild=t,e.lastChild=t,Kr(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){t=this.getAttributeNodeNS(e,t);t&&this.removeAttributeNode(t)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){t=this.getAttributeNodeNS(e,t);return t&&t.value||""},setAttributeNS:function(e,t,i){t=this.ownerDocument.createAttributeNS(e,t);t.value=t.nodeValue=""+i,this.setAttributeNode(t)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(n){return new Ur(this,function(t){var i=[];return zr(t,function(e){e===t||1!=e.nodeType||"*"!==n&&e.tagName!=n||i.push(e)}),i})},getElementsByTagNameNS:function(n,r){return new Ur(this,function(t){var i=[];return zr(t,function(e){e===t||1!==e.nodeType||"*"!==n&&e.namespaceURI!==n||"*"!==r&&e.localName!=r||i.push(e)}),i})}}).getElementsByTagName,Gr.prototype.getElementsByTagNameNS=Qr.prototype.getElementsByTagNameNS,Lr(Qr,qr),Jr.prototype.nodeType=2,Lr(Jr,qr),Zr.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(Dr[3])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){var n=this.data.substring(0,e),t=this.data.substring(e+t);this.nodeValue=this.data=i=n+i+t,this.length=i.length}},Lr(Zr,qr),es.prototype={nodeName:"#text",nodeType:3,splitText:function(e){var t=(i=this.data).substring(e),i=i.substring(0,e);this.data=this.nodeValue=i,this.length=i.length;t=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling),t}},Lr(es,Zr),ts.prototype={nodeName:"#comment",nodeType:8},Lr(ts,Zr),is.prototype={nodeName:"#cdata-section",nodeType:4},Lr(is,Zr),ns.prototype.nodeType=10,Lr(ns,qr),rs.prototype.nodeType=12,Lr(rs,qr),ss.prototype.nodeType=6,Lr(ss,qr),as.prototype.nodeType=5,Lr(as,qr),os.prototype.nodeName="#document-fragment",os.prototype.nodeType=11,Lr(os,qr),us.prototype.nodeType=7,Lr(us,qr),ls.prototype.serializeToString=function(e,t,i){return cs.call(e,t,i)},qr.prototype.toString=cs;try{Object.defineProperty&&(Or=function e(t){switch(t.nodeType){case 1:case 11:var i=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&i.push(e(t)),t=t.nextSibling;return i.join("");default:return t.nodeValue}},Object.defineProperty(Ur.prototype,"length",{get:function(){return Mr(this),this.$$length}}),Object.defineProperty(qr.prototype,"textContent",{get:function(){return Or(this)},set:function(e){switch(this.nodeType){case 1:case 11:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),ps=function(e,t,i){e["$$"+t]=i})}catch(e){}function fs(e){return!!e&&"object"==typeof e}function ms(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return t.reduce(function(t,i){return Object.keys(i).forEach(function(e){Array.isArray(t[e])&&Array.isArray(i[e])?t[e]=t[e].concat(i[e]):fs(t[e])&&fs(i[e])?t[e]=ms(t[e],i[e]):t[e]=i[e]}),t},{})}function gs(e){if(!e.length)return[];for(var t=[],i=0;i<e.length;i++)t.push(e[i]);return t}function ys(e){var t=e.baseUrl,i=void 0===(n=e.source)?"":n,n=void 0===(n=e.range)?"":n,e=void 0===(e=e.indexRange)?"":e,i={uri:i,resolvedUri:lr((void 0===t?"":t)||"",i)};return(n||e)&&(n=(n||e).split("-"),e=parseInt(n[0],10),n=parseInt(n[1],10),i.byterange={length:n-e+1,offset:e}),i}function vs(e){var a,t=void 0===(s=e.type)?"static":s,i=e.duration,n=e.timescale,r=void 0===n?1:n,s=e.sourceDuration,e=function(e,t){for(var i=[],n=e;n<t;n++)i.push(n);return i}((n=Bs[t](e)).start,n.end).map((a=e,function(e,t){var i=a.duration,n=a.timescale,r=a.periodIndex,s=a.startNumber;return{number:(void 0===s?1:s)+e,duration:i/(void 0===n?1:n),timeline:r,time:t*i}}));return"static"===t&&(e[t=e.length-1].duration=s-i/r*t),e}function _s(e){var t=e.baseUrl,i=void 0===(a=e.initialization)?{}:a,n=e.sourceDuration,r=void 0===(s=e.timescale)?1:s,s=void 0===(a=e.indexRange)?"":a,a=e.duration;if(!t)throw new Error(Ms.NO_BASE_URL);return i=ys({baseUrl:t,source:i.sourceURL,range:i.range}),(s=ys({baseUrl:t,source:t,indexRange:s})).map=i,a?(e=vs(e)).length&&(s.duration=e[0].duration,s.timeline=e[0].timeline):n&&(s.duration=n/r,s.timeline=0),s.number=0,[s]}function bs(e,t){for(var i,n,r,s,a,o=e.type,u=void 0===o?"static":o,l=void 0===(o=e.minimumUpdatePeriod)?0:o,c=void 0===(o=e.media)?"":o,h=e.sourceDuration,d=void 0===(o=e.timescale)?1:o,p=void 0===(o=e.startNumber)?1:o,f=e.periodIndex,m=[],g=-1,y=0;y<t.length;y++){var v=t[y],_=v.d,b=v.r||0,T=v.t||0;g<0&&(g=T),T&&g<T&&(g=T);var S,k=void 0;k=b<0?(S=y+1)===t.length?"dynamic"===u&&0<l&&0<c.indexOf("$Number$")?(i=g,v=a=s=r=n=void 0,n=(T=e).NOW,r=T.clientOffset,s=T.availabilityStartTime,a=T.timescale,v=T.start,T=T.minimumUpdatePeriod,Math.ceil((((n+r)/1e3+(void 0===T?0:T)-(s+(void 0===v?0:v)))*(void 0===a?1:a)-i)/_)):(h*d-g)/_:(t[S].t-g)/_:b+1;for(var C=p+m.length+k,E=p+m.length;E<C;)m.push({number:E,duration:_/d,time:g,timeline:f}),g+=_,E++}return m}function Ts(e,t){return e.replace(Ws,(r=t,function(e,t,i,n){if("$$"===e)return"$";if(void 0===r[t])return e;e=""+r[t];return"RepresentationID"===t||(n=i?parseInt(n,10):1)<=e.length?e:new Array(n-e.length+1).join("0")+e}));var r}function Ss(i,e){var n={RepresentationID:i.id,Bandwidth:i.bandwidth||0},t=void 0===(t=i.initialization)?{sourceURL:"",range:""}:t,r=ys({baseUrl:i.baseUrl,source:Ts(t.sourceURL,n),range:t.range});return(t=e,(e=i).duration||t?e.duration?vs(e):bs(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodIndex}]).map(function(e){n.Number=e.number,n.Time=e.time;var t=Ts(i.media||"",n);return{uri:t,timeline:e.timeline,duration:e.duration,resolvedUri:lr(i.baseUrl||"",t),map:r,number:e.number}})}function ks(n,e){var t=n.duration,i=void 0===(i=n.segmentUrls)?[]:i;if(!t&&!e||t&&e)throw new Error(Ms.SEGMENT_TIME_UNSPECIFIED);var r,s=i.map(function(e){return i=e,e=(t=n).baseUrl,t=t.initialization,t=ys({baseUrl:e,source:(t=void 0===t?{}:t).sourceURL,range:t.range}),(i=ys({baseUrl:e,source:i.media,range:i.mediaRange})).map=t,i;var t,i});return t&&(r=vs(n)),(r=e?bs(n,e):r).map(function(e,t){if(s[t]){t=s[t];return t.timeline=e.timeline,t.duration=e.duration,t.number=e.number,t}}).filter(function(e){return e})}function Cs(e){return e.textContent.trim()}function Es(e){if(!(r=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e)))return 0;var t=(s=r.slice(1))[0],i=s[1],n=s[2],e=s[3],r=s[4],s=s[5];return 31536e3*parseFloat(t||0)+2592e3*parseFloat(i||0)+86400*parseFloat(n||0)+3600*parseFloat(e||0)+60*parseFloat(r||0)+parseFloat(s||0)}function ws(e){var t=Gs(e,"SegmentTemplate")[0],i=Gs(e,"SegmentList")[0],n=i&&Gs(i,"SegmentURL").map(function(e){return ms({tag:"SegmentURL"},Ks(e))}),r=Gs(e,"SegmentBase")[0],e=(s=i||t)&&Gs(s,"SegmentTimeline")[0],s=(s=i||r||t)&&Gs(s,"Initialization")[0];(t=t&&Ks(t))&&s?t.initialization=s&&Ks(s):t&&t.initialization&&(t.initialization={sourceURL:t.initialization});var a={template:t,timeline:e&&Gs(e,"S").map(function(e){return Ks(e)}),list:i&&ms(Ks(i),{segmentUrls:n,initialization:Ks(s)}),base:r&&ms(Ks(r),{initialization:Ks(s)})};return Object.keys(a).forEach(function(e){a[e]||delete a[e]}),a}function As(o,u,l){return function(e){var t=Ks(e),i=$s(u,Gs(e,"BaseURL")),n=Gs(e,"Role")[0],n={role:Ks(n)},t=ms(o,t,n),n=Gs(e,"ContentProtection").reduce(function(e,t){var i=Ks(t),n=Ys[i.schemeIdUri];return n&&(e[n]={attributes:i},(t=Gs(t,"cenc:pssh")[0])&&(t=(t=Cs(t))&&dr(t),e[n].pssh=t)),e},{});Object.keys(n).length&&(t=ms(t,{contentProtection:n}));var r,s,a,n=ws(e),e=Gs(e,"Representation"),n=ms(l,n);return Us(e.map((r=t,s=i,a=n,function(e){var t=Gs(e,"BaseURL"),t=$s(s,t),i=ms(r,Ks(e)),n=ws(e);return t.map(function(e){return{segmentInfo:ms(a,n),attributes:ms(i,{baseUrl:e})}})})))}}function Is(e){if(""===e)throw new Error(Ms.DASH_EMPTY_MANIFEST);if(!(e=(e=(new Rs).parseFromString(e,"application/xml"))&&"MPD"===e.documentElement.tagName?e.documentElement:null)||0<e.getElementsByTagName("parsererror").length)throw new Error(Ms.DASH_INVALID_XML);return e}function Ps(e,t){return void 0===t&&(t={}),function(e,t){if(void 0===t&&(t={}),!e.length)return{};var i=e[0].attributes,n=i.sourceDuration,r=i.type,s=void 0===r?"static":r,a=i.suggestedPresentationDelay,o=i.minimumUpdatePeriod,u=void 0===o?0:o,r=js(e.filter(function(e){e=e.attributes;return"video/mp4"===e.mimeType||"video"===e.contentType})).map(qs),i=js(e.filter(function(e){e=e.attributes;return"audio/mp4"===e.mimeType||"audio"===e.contentType})),o=e.filter(function(e){e=e.attributes;return"text/vtt"===e.mimeType||"text"===e.contentType}),u={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:((e={AUDIO:{},VIDEO:{}})["CLOSED-CAPTIONS"]={},e.SUBTITLES={},e),uri:"",duration:n,playlists:Fs(r,t),minimumUpdatePeriod:1e3*u};return"dynamic"===s&&(u.suggestedPresentationDelay=a),i.length&&(u.mediaGroups.AUDIO.audio=Hs(i,t)),o.length&&(u.mediaGroups.SUBTITLES.subs=Vs(o,t)),u}(function(e,t){var i=t=void 0===t?{}:t,n=i.manifestUri,r=void 0===n?"":n,s=i.NOW,t=void 0===s?Date.now():s,n=i.clientOffset,s=void 0===n?0:n,i=Gs(e,"Period");if(!i.length)throw new Error(Ms.INVALID_NUMBER_OF_PERIOD);n=Ks(e),e=$s([r],Gs(e,"BaseURL"));return n.sourceDuration=n.mediaPresentationDuration||0,n.NOW=t,n.clientOffset=s,Us(i.map(Qs(n,e)))}(Is(e),t).map(zs),t.sidxMapping)}function xs(e){return function(e){e=Gs(e,"UTCTiming")[0];if(!e)return null;var t=Ks(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;default:throw new Error(Ms.UNSUPPORTED_UTC_TIMING_SCHEME)}return t}(Is(e))}function Ls(e){return new Date(1e3*e-20828448e5)}function Os(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}}function Ds(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3])}var Ns={DOMImplementation:Vr,XMLSerializer:ls},Fe=e(function(e,t){function i(e){this.options=e||{locator:{}}}function l(){this.cdata=!1}function c(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function h(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function r(e,t,i){return"string"==typeof e?e.substr(t,i):e.length>=t+i||t?new java.lang.String(e,t,i)+"":e}function d(e,t){(e.currentElement||e.doc).appendChild(t)}i.prototype.parseFromString=function(e,t){var i=this.options,n=new p,r=i.domBuilder||new l,s=i.errorHandler,a=i.locator,o=i.xmlns||{},u={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return a&&r.setDocumentLocator(a),n.errorHandler=function(n,e,r){if(!n){if(e instanceof l)return e;n=e}var s={},a=n instanceof Function;function t(t){var i=n[t];!i&&a&&(i=2==n.length?function(e){n(t,e)}:n),s[t]=i?function(e){i("[xmldom "+t+"]\t"+e+h(r))}:function(){}}return r=r||{},t("warning"),t("error"),t("fatalError"),s}(s,r,a),n.domBuilder=i.domBuilder||r,/\/x?html?$/.test(t)&&(u.nbsp=" ",u.copy="©",o[""]="http://www.w3.org/1999/xhtml"),o.xml=o.xml||"http://www.w3.org/XML/1998/namespace",e?n.parse(e,o,u):n.errorHandler.error("invalid doc source"),r.doc},l.prototype={startDocument:function(){this.doc=(new n).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,i,n){var r=this.doc,s=r.createElementNS(e,i||t),a=n.length;d(this,s),this.currentElement=s,this.locator&&c(this.locator,s);for(var o=0;o<a;o++){var e=n.getURI(o),u=n.getValue(o),i=n.getQName(o),l=r.createAttributeNS(e,i);this.locator&&c(n.getLocator(o),l),l.value=l.nodeValue=u,s.setAttributeNode(l)}},endElement:function(e,t,i){var n=this.currentElement;n.tagName;this.currentElement=n.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){t=this.doc.createProcessingInstruction(e,t);this.locator&&c(this.locator,t),d(this,t)},ignorableWhitespace:function(e,t,i){},characters:function(e,t,i){var n;(e=r.apply(this,arguments))&&(n=this.cdata?this.doc.createCDATASection(e):this.doc.createTextNode(e),this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(e)&&this.doc.appendChild(n),this.locator&&c(this.locator,n))},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,i){e=r.apply(this,arguments);e=this.doc.createComment(e);this.locator&&c(this.locator,e),d(this,e)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,i){var n=this.doc.implementation;n&&n.createDocumentType&&(i=n.createDocumentType(e,t,i),this.locator&&c(this.locator,i),d(this,i))},warning:function(e){console.warn("[xmldom warning]\t"+e,h(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,h(this.locator))},fatalError:function(e){throw console.error("[xmldom fatalError]\t"+e,h(this.locator)),e}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){l.prototype[e]=function(){return null}});var p=Pr.XMLReader,n=t.DOMImplementation=Ns.DOMImplementation;t.XMLSerializer=Ns.XMLSerializer,t.DOMParser=i}),Rs=(Fe.DOMImplementation,Fe.XMLSerializer,Fe.DOMParser),Us=function(e){return e.reduce(function(e,t){return e.concat(t)},[])},Ms={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"},Bs={static:function(e){var t=e.duration,i=e.timescale,e=e.sourceDuration;return{start:0,end:Math.ceil(e/(t/(void 0===i?1:i)))}},dynamic:function(e){var t=e.NOW,i=e.clientOffset,n=e.availabilityStartTime,r=e.timescale,s=void 0===r?1:r,a=e.duration,o=e.start,r=e.minimumUpdatePeriod,e=e.timeShiftBufferDepth,e=void 0===e?1/0:e,i=(t+i)/1e3,o=n+(void 0===o?0:o),r=Math.ceil((i+(void 0===r?0:r)-o)*s/a),e=Math.floor((i-o-e)*s/a),a=Math.floor((i-o)*s/a);return{start:Math.max(0,e),end:Math.min(r,a)}}},js=function(e){var t;return(t=e.reduce(function(e,t){var i,n=t.attributes.id+(t.attributes.lang||"");return e[n]?(t.segments[0]&&(t.segments[0].discontinuity=!0),(i=e[n].segments).push.apply(i,t.segments),t.attributes.contentProtection&&(e[n].attributes.contentProtection=t.attributes.contentProtection)):e[n]=t,e},{}),Object.keys(t).map(function(e){return t[e]})).map(function(e){var t,n;return e.discontinuityStarts=(t=e.segments,n="discontinuity",t.reduce(function(e,t,i){return t[n]&&e.push(i),e},[])),e})},Fs=function(e,t){if(void 0===t&&(t={}),!Object.keys(t).length)return e;for(var i in e){var n=e[i];n.sidx&&(i=t[i=n.sidx.uri+"-"+(r=n.sidx.byterange,i=void 0,i=r.offset+r.length-1,r.offset+"-"+i)]&&t[i].sidx,n.sidx&&i&&function(e,t,i){for(var n=e.sidx.map||null,r=e.sidx.duration,s=e.timeline||0,a=e.sidx.byterange,a=a.offset+a.length,o=t.timescale,u=t.references.filter(function(e){return 1!==e.referenceType}),l=[],c=a+t.firstOffset,h=0;h<u.length;h++){var d=t.references[h],p=d.referencedSize,d=d.subsegmentDuration,d=_s({baseUrl:i,timescale:o,timeline:s,periodIndex:s,duration:d,sourceDuration:r,indexRange:c+"-"+(c+p-1)})[0];n&&(d.map=n),l.push(d),c+=p}e.segments=l}(n,i,n.sidx.resolvedUri))}var r;return e},Hs=function(e,o){var u;void 0===o&&(o={});e=e.reduce(function(e,t){var i,n,r=t.attributes.role&&t.attributes.role.value||"",s=t.attributes.lang||"",a="main";return e[a=s?t.attributes.lang+(r?" ("+r+")":""):a]&&e[a].playlists[0].attributes.BANDWIDTH>t.attributes.bandwidth||(e[a]={language:s,autoselect:!0,default:"main"===r,playlists:Fs([(n=(i=t).attributes,a=i.segments,s=i.sidx,a={attributes:((i={NAME:n.id,BANDWIDTH:n.bandwidth,CODECS:n.codecs})["PROGRAM-ID"]=1,i),uri:"",endList:"static"===(n.type||"static"),timeline:n.periodIndex,resolvedUri:"",targetDuration:n.duration,segments:a,mediaSequence:a.length?a[0].number:1},n.contentProtection&&(a.contentProtection=n.contentProtection),s&&(a.sidx=s),a)],o),uri:""},void 0===u&&"main"===r&&((u=t).default=!0)),e},{});return u||(e[Object.keys(e)[0]].default=!0),e},Vs=function(e,r){return void 0===r&&(r={}),e.reduce(function(e,t){var i,n=t.attributes.lang||"text";return e[n]||(e[n]={language:n,default:!1,autoselect:!1,playlists:Fs([(n=(i=t).attributes,void 0===(t=i.segments)&&(t=[{uri:n.baseUrl,timeline:n.periodIndex,resolvedUri:n.baseUrl||"",duration:n.sourceDuration,number:0}],n.duration=n.sourceDuration),{attributes:((i={NAME:n.id,BANDWIDTH:n.bandwidth})["PROGRAM-ID"]=1,i),uri:"",endList:"static"===(n.type||"static"),timeline:n.periodIndex,resolvedUri:n.baseUrl||"",targetDuration:n.duration,segments:t,mediaSequence:t.length?t[0].number:1})],r),uri:""}),e},{})},qs=function(e){var t=e.attributes,i=e.segments,n=e.sidx,i={attributes:((e={NAME:t.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:t.width,height:t.height},CODECS:t.codecs,BANDWIDTH:t.bandwidth})["PROGRAM-ID"]=1,e),uri:"",endList:"static"===(t.type||"static"),timeline:t.periodIndex,resolvedUri:"",targetDuration:t.duration,segments:i,mediaSequence:i.length?i[0].number:1};return t.contentProtection&&(i.contentProtection=t.contentProtection),n&&(i.sidx=n),i},Ws=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,zs=function(e){var t,i=e.attributes,n=e.segmentInfo;n.template?(s=Ss,t=ms(i,n.template)):n.base?(s=_s,t=ms(i,n.base)):n.list&&(s=ks,t=ms(i,n.list));var r={attributes:i};if(!s)return r;var s,e=s(t,n.timeline);return t.duration?(s=(i=t).duration,i=i.timescale,t.duration=s/(void 0===i?1:i)):e.length?t.duration=e.reduce(function(e,t){return Math.max(e,Math.ceil(t.duration))},0):t.duration=0,r.attributes=t,r.segments=e,n.base&&t.indexRange&&(r.sidx=e[0],r.segments=[]),r},Gs=function(e,t){return gs(e.childNodes).filter(function(e){return e.tagName===t})},Xs={mediaPresentationDuration:Es,availabilityStartTime:function(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e=e)&&(e+="Z"),Date.parse(e)/1e3},minimumUpdatePeriod:Es,suggestedPresentationDelay:Es,type:function(e){return e},timeShiftBufferDepth:Es,start:Es,width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?Es(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},Ks=function(e){return e&&e.attributes?gs(e.attributes).reduce(function(e,t){var i=Xs[t.name]||Xs.DEFAULT;return e[t.name]=i(t.value),e},{}):{}},Ys={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},$s=function(e,i){return i.length?Us(e.map(function(t){return i.map(function(e){return lr(t,Cs(e))})})):e},Qs=function(r,s){return function(e,t){var i=$s(s,Gs(e,"BaseURL")),n=Ks(e),n=parseInt(n.id,10),t=d.isNaN(n)?t:n,n=ms(r,{periodIndex:t}),t=Gs(e,"AdaptationSet"),e=ws(e);return Us(t.map(As(n,i,e)))}},ir=function(e){return e>>>0},pr=function(e){return("00"+e.toString(16)).slice(-2)},Js=ir,Zs={avc1:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{dataReferenceIndex:t.getUint16(6),width:t.getUint16(24),height:t.getUint16(26),horizresolution:t.getUint16(28)+t.getUint16(30)/16,vertresolution:t.getUint16(32)+t.getUint16(34)/16,frameCount:t.getUint16(40),depth:t.getUint16(74),config:ea(e.subarray(78,e.byteLength))}},avcC:function(e){for(var t,i,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r={configurationVersion:e[0],avcProfileIndication:e[1],profileCompatibility:e[2],avcLevelIndication:e[3],lengthSizeMinusOne:3&e[4],sps:[],pps:[]},s=31&e[5],a=6,o=0;o<s;o++)i=n.getUint16(a),a+=2,r.sps.push(new Uint8Array(e.subarray(a,a+i))),a+=i;for(t=e[a],a++,o=0;o<t;o++)i=n.getUint16(a),a+=2,r.pps.push(new Uint8Array(e.subarray(a,a+i))),a+=i;return r},btrt:function(e){e=new DataView(e.buffer,e.byteOffset,e.byteLength);return{bufferSizeDB:e.getUint32(0),maxBitrate:e.getUint32(4),avgBitrate:e.getUint32(8)}},esds:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),esId:e[6]<<8|e[7],streamPriority:31&e[8],decoderConfig:{objectProfileIndication:e[11],streamType:e[12]>>>2&63,bufferSize:e[13]<<16|e[14]<<8|e[15],maxBitrate:e[16]<<24|e[17]<<16|e[18]<<8|e[19],avgBitrate:e[20]<<24|e[21]<<16|e[22]<<8|e[23],decoderConfigDescriptor:{tag:e[24],length:e[25],audioObjectType:e[26]>>>3&31,samplingFrequencyIndex:(7&e[26])<<1|e[27]>>>7&1,channelConfiguration:e[27]>>>3&15}}}},ftyp:function(e){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={majorBrand:Ds(e.subarray(0,4)),minorVersion:t.getUint32(4),compatibleBrands:[]},n=8;n<e.byteLength;)i.compatibleBrands.push(Ds(e.subarray(n,n+4))),n+=4;return i},dinf:function(e){return{boxes:ea(e)}},dref:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),dataReferences:ea(e.subarray(8))}},hdlr:function(e){for(var t={version:new DataView(e.buffer,e.byteOffset,e.byteLength).getUint8(0),flags:new Uint8Array(e.subarray(1,4)),handlerType:Ds(e.subarray(8,12)),name:""},i=8,i=24;i<e.byteLength;i++){if(0===e[i]){i++;break}t.name+=String.fromCharCode(e[i])}return t.name=decodeURIComponent(escape(t.name)),t},mdat:function(e){return{byteLength:e.byteLength,nals:function(e){for(var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n=[],r=0;r+4<e.length;r+=t)if(t=i.getUint32(r),r+=4,t<=0)n.push("<span style='color:red;'>MALFORMED DATA</span>");else switch(31&e[r]){case 1:n.push("slice_layer_without_partitioning_rbsp");break;case 5:n.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:n.push("sei_rbsp");break;case 7:n.push("seq_parameter_set_rbsp");break;case 8:n.push("pic_parameter_set_rbsp");break;case 9:n.push("access_unit_delimiter_rbsp");break;default:n.push("UNKNOWN NAL - "+e[r]&31)}return n}(e)}},mdhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,e={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),language:""};return 1===e.version?(e.creationTime=Ls(t.getUint32(i+=4)),e.modificationTime=Ls(t.getUint32(i+=8)),e.timescale=t.getUint32(i+=4),e.duration=t.getUint32(i+=8)):(e.creationTime=Ls(t.getUint32(i)),e.modificationTime=Ls(t.getUint32(i+=4)),e.timescale=t.getUint32(i+=4),e.duration=t.getUint32(i+=4)),i=t.getUint16(i+=4),e.language+=String.fromCharCode(96+(i>>10)),e.language+=String.fromCharCode(96+((992&i)>>5)),e.language+=String.fromCharCode(96+(31&i)),e},mdia:function(e){return{boxes:ea(e)}},mfhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sequenceNumber:e[4]<<24|e[5]<<16|e[6]<<8|e[7]}},minf:function(e){return{boxes:ea(e)}},mp4a:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),t={dataReferenceIndex:t.getUint16(6),channelcount:t.getUint16(16),samplesize:t.getUint16(18),samplerate:t.getUint16(24)+t.getUint16(26)/65536};return 28<e.byteLength&&(t.streamDescriptor=ea(e.subarray(28))[0]),t},moof:function(e){return{boxes:ea(e)}},moov:function(e){return{boxes:ea(e)}},mvex:function(e){return{boxes:ea(e)}},mvhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,n={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===n.version?(n.creationTime=Ls(t.getUint32(i+=4)),n.modificationTime=Ls(t.getUint32(i+=8)),n.timescale=t.getUint32(i+=4),n.duration=t.getUint32(i+=8)):(n.creationTime=Ls(t.getUint32(i)),n.modificationTime=Ls(t.getUint32(i+=4)),n.timescale=t.getUint32(i+=4),n.duration=t.getUint32(i+=4)),n.rate=t.getUint16(i+=4)+t.getUint16(i+2)/16,n.volume=t.getUint8(i+=4)+t.getUint8(i+1)/8,i+=2,i+=2,i+=8,n.matrix=new Uint32Array(e.subarray(i,i+36)),i+=36,n.nextTrackId=t.getUint32(i+=24),n},pdin:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),rate:t.getUint32(4),initialDelay:t.getUint32(8)}},sdtp:function(e){for(var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},i=4;i<e.byteLength;i++)t.samples.push({dependsOn:(48&e[i])>>4,isDependedOn:(12&e[i])>>2,hasRedundancy:3&e[i]});return t},sidx:function(e){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8),earliestPresentationTime:t.getUint32(12),firstOffset:t.getUint32(16)},n=t.getUint16(22),r=24;n;r+=12,n--)i.references.push({referenceType:(128&e[r])>>>7,referencedSize:2147483647&t.getUint32(r),subsegmentDuration:t.getUint32(r+4),startsWithSap:!!(128&e[r+8]),sapType:(112&e[r+8])>>>4,sapDeltaTime:268435455&t.getUint32(r+8)});return i},smhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),balance:e[4]+e[5]/256}},stbl:function(e){return{boxes:ea(e)}},stco:function(e){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),chunkOffsets:[]},n=t.getUint32(4),r=8;n;r+=4,n--)i.chunkOffsets.push(t.getUint32(r));return i},stsc:function(e){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=t.getUint32(4),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleToChunks:[]},r=8;i;r+=12,i--)n.sampleToChunks.push({firstChunk:t.getUint32(r),samplesPerChunk:t.getUint32(r+4),sampleDescriptionIndex:t.getUint32(r+8)});return n},stsd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleDescriptions:ea(e.subarray(8))}},stsz:function(e){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleSize:t.getUint32(4),entries:[]},n=12;n<e.byteLength;n+=4)i.entries.push(t.getUint32(n));return i},stts:function(e){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),timeToSamples:[]},n=t.getUint32(4),r=8;n;r+=8,n--)i.timeToSamples.push({sampleCount:t.getUint32(r),sampleDelta:t.getUint32(r+4)});return i},styp:function(e){return Zs.ftyp(e)},tfdt:function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),baseMediaDecodeTime:Js(e[4]<<24|e[5]<<16|e[6]<<8|e[7])};return 1===t.version&&(t.baseMediaDecodeTime*=Math.pow(2,32),t.baseMediaDecodeTime+=Js(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),t},tfhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4)},n=1&i.flags[2],r=2&i.flags[2],s=8&i.flags[2],a=16&i.flags[2],o=32&i.flags[2],u=65536&i.flags[0],l=131072&i.flags[0],e=8;return n&&(e+=4,i.baseDataOffset=t.getUint32(12),e+=4),r&&(i.sampleDescriptionIndex=t.getUint32(e),e+=4),s&&(i.defaultSampleDuration=t.getUint32(e),e+=4),a&&(i.defaultSampleSize=t.getUint32(e),e+=4),o&&(i.defaultSampleFlags=t.getUint32(e)),u&&(i.durationIsEmpty=!0),!n&&l&&(i.baseDataOffsetIsMoof=!0),i},tkhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,n={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===n.version?(n.creationTime=Ls(t.getUint32(i+=4)),n.modificationTime=Ls(t.getUint32(i+=8)),n.trackId=t.getUint32(i+=4),i+=4,n.duration=t.getUint32(i+=8)):(n.creationTime=Ls(t.getUint32(i)),n.modificationTime=Ls(t.getUint32(i+=4)),n.trackId=t.getUint32(i+=4),i+=4,n.duration=t.getUint32(i+=4)),i+=4,n.layer=t.getUint16(i+=8),n.alternateGroup=t.getUint16(i+=2),n.volume=t.getUint8(i+=2)+t.getUint8(i+1)/8,i+=2,i+=2,n.matrix=new Uint32Array(e.subarray(i,i+36)),n.width=t.getUint16(i+=36)+t.getUint16(i+2)/65536,n.height=t.getUint16(i+=4)+t.getUint16(i+2)/65536,n},traf:function(e){return{boxes:ea(e)}},trak:function(e){return{boxes:ea(e)}},trex:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4),defaultSampleDescriptionIndex:t.getUint32(8),defaultSampleDuration:t.getUint32(12),defaultSampleSize:t.getUint32(16),sampleDependsOn:3&e[20],sampleIsDependedOn:(192&e[21])>>6,sampleHasRedundancy:(48&e[21])>>4,samplePaddingValue:(14&e[21])>>1,sampleIsDifferenceSample:!!(1&e[21]),sampleDegradationPriority:t.getUint16(22)}},trun:function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],s=4&i.flags[2],a=1&i.flags[1],o=2&i.flags[1],u=4&i.flags[1],l=8&i.flags[1],c=n.getUint32(4),h=8;for(r&&(i.dataOffset=n.getInt32(h),h+=4),s&&c&&(t={flags:Os(e.subarray(h,h+4))},h+=4,a&&(t.duration=n.getUint32(h),h+=4),o&&(t.size=n.getUint32(h),h+=4),l&&(t.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(t),c--);c--;)t={},a&&(t.duration=n.getUint32(h),h+=4),o&&(t.size=n.getUint32(h),h+=4),u&&(t.flags=Os(e.subarray(h,h+4)),h+=4),l&&(t.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(t);return i},"url ":function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4))}},vmhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),graphicsmode:t.getUint16(4),opcolor:new Uint16Array([t.getUint16(6),t.getUint16(8),t.getUint16(10)])}}},ea=function(e){for(var t,i,n,r,s,a=0,o=[],u=new ArrayBuffer(e.length),l=new Uint8Array(u),c=0;c<e.length;++c)l[c]=e[c];for(t=new DataView(u);a<e.byteLength;)i=t.getUint32(a),n=Ds(e.subarray(a+4,a+8)),r=1<i?a+i:e.byteLength,(s=(Zs[n]||function(e){return{data:e}})(e.subarray(a+8,r))).size=i,s.type=n,o.push(s),a=r;return o},ta=function(e,t){var r;return t=t||0,r=new Array(2*t+1).join(" "),e.map(function(n,e){return r+n.type+"\n"+Object.keys(n).filter(function(e){return"type"!==e&&"boxes"!==e}).map(function(e){var t=r+"  "+e+": ",i=n[e];if(i instanceof Uint8Array||i instanceof Uint32Array){e=Array.prototype.slice.call(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)).map(function(e){return" "+("00"+e.toString(16)).slice(-2)}).join("").match(/.{1,24}/g);return e?1===e.length?t+"<"+e.join("").slice(1)+">":t+"<\n"+e.map(function(e){return r+"  "+e}).join("\n")+"\n"+r+"  >":t+"<>"}return t+JSON.stringify(i,null,2).split("\n").map(function(e,t){return 0===t?e:r+"  "+e}).join("\n")}).join("\n")+(n.boxes?"\n"+ta(n.boxes,t+1):"")}).join("\n")},ia={inspect:ea,textify:ta,parseType:Ds,findBox:function e(t,i){var n,r,s,a=[];if(!i.length)return null;for(n=0;n<t.byteLength;)r=Js(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3]),s=Ds(t.subarray(n+4,n+8)),r=1<r?n+r:t.byteLength,s===i[0]&&(1===i.length?a.push(t.subarray(n+8,r)):(s=e(t.subarray(n+8,r),i.slice(1))).length&&(a=a.concat(s))),n=r;return a},parseTraf:Zs.traf,parseTfdt:Zs.tfdt,parseHdlr:Zs.hdlr,parseTfhd:Zs.tfhd,parseTrun:Zs.trun,parseSidx:Zs.sidx},na=ir,ra=pr,st=function(e){return ia.findBox(e,["moov","trak"]).reduce(function(e,t){var i,n,r=ia.findBox(t,["tkhd"])[0];return r?(i=r[0],r=na(r[n=0===i?12:20]<<24|r[1+n]<<16|r[2+n]<<8|r[3+n]),(t=ia.findBox(t,["mdia","mdhd"])[0])?(i=t[0],e[r]=na(t[n=0===i?12:20]<<24|t[1+n]<<16|t[2+n]<<8|t[3+n]),e):null):null},{})},ei=function(n,e){var e=ia.findBox(e,["moof","traf"]),e=[].concat.apply([],e.map(function(i){return ia.findBox(i,["tfhd"]).map(function(e){var t=na(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),e=n[t]||9e4,t=ia.findBox(i,["tfdt"]).map(function(e){var t=e[0],i=na(e[4]<<24|e[5]<<16|e[6]<<8|e[7]);return 1===t&&(i*=Math.pow(2,32),i+=na(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),i})[0];return(t||1/0)/e})})),e=Math.min.apply(null,e);return isFinite(e)?e:0},He=function(e,t){var i,t=ia.findBox(t,["moof","traf"]),n=0,r=0;if(t&&t.length)for(var s=ia.parseTraf(t[0]),a=0;a<s.boxes.length;a++)"tfhd"===s.boxes[a].type?i=s.boxes[a].trackId:"tfdt"===s.boxes[a].type?n=s.boxes[a].baseMediaDecodeTime:"trun"===s.boxes[a].type&&s.boxes[a].samples.length&&(r=s.boxes[a].samples[0].compositionTimeOffset||0);return(n+r)/(e[i]||9e4)},Fe=function(e){var e=ia.findBox(e,["moov","trak"]),n=[];return e.forEach(function(e){var t=ia.findBox(e,["mdia","hdlr"]),i=ia.findBox(e,["tkhd"]);t.forEach(function(e,t){e=ia.parseType(e.subarray(8,12)),t=i[t];"vide"===e&&(t=0===(t=new DataView(t.buffer,t.byteOffset,t.byteLength)).getUint8(0)?t.getUint32(12):t.getUint32(20),n.push(t))})}),n},ir=function(e){var e=ia.findBox(e,["moov","trak"]),o=[];return e.forEach(function(e){var t={},i=ia.findBox(e,["tkhd"])[0];i&&(a=(n=new DataView(i.buffer,i.byteOffset,i.byteLength)).getUint8(0),t.id=0===a?n.getUint32(12):n.getUint32(20));var n=ia.findBox(e,["mdia","hdlr"])[0];n&&(s=ia.parseType(n.subarray(8,12)),t.type="vide"===s?"video":"soun"===s?"audio":s);var r,s=ia.findBox(e,["mdia","minf","stbl","stsd"])[0];s&&(s=s.subarray(8),t.codec=ia.parseType(s.subarray(4,8)),(s=ia.findBox(s,[t.codec])[0])&&(/^[a-z]vc[1-9]$/i.test(t.codec)?(r=s.subarray(78),"avcC"===ia.parseType(r.subarray(4,8))&&11<r.length?(t.codec+=".",t.codec+=ra(r[9]),t.codec+=ra(r[10]),t.codec+=ra(r[11])):t.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(t.codec)&&(r=s.subarray(28),"esds"===ia.parseType(r.subarray(4,8))&&20<r.length&&0!==r[19]?(t.codec+="."+ra(r[19]),t.codec+="."+ra(r[20]>>>2&63).replace(/^0/,"")):t.codec="mp4a.40.2")));var a,e=ia.findBox(e,["mdia","mdhd"])[0];e&&i&&(t.timescale=na(e[a=0===a?12:20]<<24|e[1+a]<<16|e[2+a]<<8|e[3+a])),o.push(t)}),o},sa={findBox:ia.findBox,parseType:ia.parseType,timescale:st,startTime:ei,compositionStartTime:He,videoTrackIds:Fe,tracks:ir},aa=function(e){for(var t=0,i={payloadType:-1,payloadSize:0},n=0,r=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)n+=255,t++;for(n+=e[t++];255===e[t];)r+=255,t++;if(r+=e[t++],!i.payload&&4===n){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){i.payloadType=n,i.payloadSize=r,i.payload=e.subarray(t,t+r);break}i.payload=void 0}t+=r,r=n=0}return i},oa=function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},ua=function(e,t){var i,n,r,s,a=[];if(!(64&t[0]))return a;for(n=31&t[0],i=0;i<n;i++)s={type:3&t[2+(r=3*i)],pts:e},4&t[2+r]&&(s.ccData=t[3+r]<<8|t[4+r],a.push(s));return a},pr=function(e){for(var t=e.byteLength,i=[],n=1;n<t-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(i.push(n+2),n+=2):n++;if(0===i.length)return e;for(var r=t-i.length,s=new Uint8Array(r),a=0,n=0;n<r;a++,n++)a===i[0]&&(a++,i.shift()),s[n]=e[a];return s},la=4,st=function(){this.init=function(){var s={};this.on=function(e,t){s[e]||(s[e]=[]),s[e]=s[e].concat(t)},this.off=function(e,t){return!!s[e]&&(t=s[e].indexOf(t),s[e]=s[e].slice(),s[e].splice(t,1),-1<t)},this.trigger=function(e){var t,i,n,r=s[e];if(r)if(2===arguments.length)for(i=r.length,t=0;t<i;++t)r[t].call(this,arguments[1]);else{for(n=[],t=arguments.length,t=1;t<arguments.length;++t)n.push(arguments[t]);for(i=r.length,t=0;t<i;++t)r[t].apply(this,n)}},this.dispose=function(){s={}}}};st.prototype.pipe=function(t){return this.on("data",function(e){t.push(e)}),this.on("done",function(e){t.flush(e)}),this.on("partialdone",function(e){t.partialFlush(e)}),this.on("endedtimeline",function(e){t.endTimeline(e)}),this.on("reset",function(e){t.reset(e)}),t},st.prototype.push=function(e){this.trigger("data",e)},st.prototype.flush=function(e){this.trigger("done",e)},st.prototype.partialFlush=function(e){this.trigger("partialdone",e)},st.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)},st.prototype.reset=function(e){this.trigger("reset",e)};ei=st,He=function e(){e.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new ma(0,0),new ma(0,1),new ma(1,0),new ma(1,1)],this.reset(),this.ccStreams_.forEach(function(e){e.on("data",this.trigger.bind(this,"data")),e.on("partialdone",this.trigger.bind(this,"partialdone")),e.on("done",this.trigger.bind(this,"done"))},this)};(He.prototype=new ei).push=function(e){var t,i;if("sei_rbsp"===e.nalUnitType&&(t=aa(e.escapedRBSP)).payloadType===la&&(i=oa(t)))if(e.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));i=ua(e.pts,i),this.captionPackets_=this.captionPackets_.concat(i),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},He.prototype.flushCCStreams=function(t){this.ccStreams_.forEach(function(e){return"flush"===t?e.flush():e.partialFlush()},this)},He.prototype.flushStream=function(e){this.captionPackets_.length&&(this.captionPackets_.forEach(function(e,t){e.presortIndex=t}),this.captionPackets_.sort(function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts}),this.captionPackets_.forEach(function(e){e.type<2&&this.dispatchCea608Packet(e)},this),this.captionPackets_.length=0),this.flushCCStreams(e)},He.prototype.flush=function(){return this.flushStream("flush")},He.prototype.partialFlush=function(){return this.flushStream("partialFlush")},He.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(e){e.reset()})},He.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},He.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},He.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},He.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)};function ca(e){return null===e?"":(e=da[e]||e,String.fromCharCode(e))}function ha(){for(var e=[],t=pa+1;t--;)e.push("");return e}var da={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},pa=14,fa=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],ma=function e(t,i){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=i||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,r,s=32639&e.ccData;s!==this.lastControlCode_?(4096==(61440&s)?this.lastControlCode_=s:s!==this.PADDING_&&(this.lastControlCode_=null),t=s>>>8,i=255&s,s===this.PADDING_||(s===this.RESUME_CAPTION_LOADING_?this.mode_="popOn":s===this.END_OF_CAPTION_?(this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),r=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=r,this.startPts_=e.pts):s===this.ROLL_UP_2_ROWS_?(this.rollUpRows_=2,this.setRollUp(e.pts)):s===this.ROLL_UP_3_ROWS_?(this.rollUpRows_=3,this.setRollUp(e.pts)):s===this.ROLL_UP_4_ROWS_?(this.rollUpRows_=4,this.setRollUp(e.pts)):s===this.CARRIAGE_RETURN_?(this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts):s===this.BACKSPACE_?"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1):s===this.ERASE_DISPLAYED_MEMORY_?(this.flushDisplayed(e.pts),this.displayed_=ha()):s===this.ERASE_NON_DISPLAYED_MEMORY_?this.nonDisplayed_=ha():s===this.RESUME_DIRECT_CAPTIONING_?("paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=ha()),this.mode_="paintOn",this.startPts_=e.pts):this.isSpecialCharacter(t,i)?(n=ca((t=(3&t)<<8)|i),this[this.mode_](e.pts,n),this.column_++):this.isExtCharacter(t,i)?("popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),n=ca((t=(3&t)<<8)|i),this[this.mode_](e.pts,n),this.column_++):this.isMidRowCode(t,i)?(this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&i)&&this.addFormatting(e.pts,["i"]),1==(1&i)&&this.addFormatting(e.pts,["u"])):this.isOffsetControlCode(t,i)?this.column_+=3&i:this.isPAC(t,i)?(r=fa.indexOf(7968&s),"rollUp"===this.mode_&&(r-this.rollUpRows_+1<0&&(r=this.rollUpRows_-1),this.setRollUp(e.pts,r)),r!==this.row_&&(this.clearFormatting(e.pts),this.row_=r),1&i&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&s)&&(this.column_=4*((14&s)>>1)),this.isColorPAC(i)&&14==(14&i)&&this.addFormatting(e.pts,["i"])):this.isNormalChar(t)&&(0===i&&(i=null),n=ca(t),n+=ca(i),this[this.mode_](e.pts,n),this.column_+=n.length))):this.lastControlCode_=null}};ma.prototype=new ei,ma.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e){try{return e.trim()}catch(e){return console.error("Skipping malformed caption."),""}}).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},ma.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=ha(),this.nonDisplayed_=ha(),this.lastControlCode_=null,this.column_=0,this.row_=pa,this.rollUpRows_=2,this.formatting_=[]},ma.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},ma.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&48<=t&&t<=63},ma.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&32<=t&&t<=63},ma.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&32<=t&&t<=47},ma.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&33<=t&&t<=35},ma.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&64<=t&&t<=127},ma.prototype.isColorPAC=function(e){return 64<=e&&e<=79||96<=e&&e<=127},ma.prototype.isNormalChar=function(e){return 32<=e&&e<=127},ma.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=pa,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=ha(),this.displayed_=ha()),void 0!==t&&t!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},ma.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);t=t.reduce(function(e,t){return e+"<"+t+">"},"");this[this.mode_](e,t)},ma.prototype.clearFormatting=function(e){var t;this.formatting_.length&&(t=this.formatting_.reverse().reduce(function(e,t){return e+"</"+t+">"},""),this.formatting_=[],this[this.mode_](e,t))},ma.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];this.nonDisplayed_[this.row_]=i+=t},ma.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];this.displayed_[this.row_]=i+=t},ma.prototype.shiftRowsUp_=function(){for(var e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<pa+1;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]=""},ma.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_];this.displayed_[this.row_]=i+=t};function ga(e,t){var i=1;for(t<e&&(i=-1);Math.abs(t-e)>ka;)e+=i*Sa;return e}var ya=pr,va=He,_a=function(e,c){var i=sa.findBox(e,["moof","traf"]),e=sa.findBox(e,["mdat"]),h={},n=[];return e.forEach(function(e,t){t=i[t];n.push({mdat:e,traf:t})}),n.forEach(function(e){var t,i,n,r,s,a=e.mdat,o=e.traf,u=sa.findBox(o,["tfhd"]),l=ia.parseTfhd(u[0]),e=l.trackId,u=sa.findBox(o,["tfdt"]),u=0<u.length?ia.parseTfdt(u[0]).baseMediaDecodeTime:0,o=sa.findBox(o,["trun"]);c===e&&0<o.length&&(t=u,i=l.defaultSampleDuration||0,n=l.defaultSampleSize||0,r=l.trackId,s=[],o.forEach(function(e){e=ia.parseTrun(e).samples;e.forEach(function(e){void 0===e.duration&&(e.duration=i),void 0===e.size&&(e.size=n),e.trackId=r,e.dts=t,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),e.pts=t+e.compositionTimeOffset,t+=e.duration}),s=s.concat(e)}),a=function(e,t,i){for(var n,r,s=new DataView(e.buffer,e.byteOffset,e.byteLength),a=[],o=0;o+4<e.length;o+=n)if(n=s.getUint32(o),o+=4,!(n<=0))switch(31&e[o]){case 6:var u=e.subarray(o+1,o+1+n),l=function(e,t){for(var i=e,n=0;n<t.length;n++){var r=t[n];if(i<r.size)return r;i-=r.size}return null}(o,t),u={nalUnitType:"sei_rbsp",size:n,data:u,escapedRBSP:ya(u),trackId:i};if(l)u.pts=l.pts,u.dts=l.dts,r=l;else{if(!r){console.log("We've encountered a nal unit without data. See mux.js#233.");break}u.pts=r.pts,u.dts=r.dts}a.push(u)}return a}(a,s,e),h[e]||(h[e]=[]),h[e]=h[e].concat(a))}),h},ba=function(){var t,a,o,u,l,i,n=!1;this.isInitialized=function(){return n},this.init=function(e){t=new va,n=!0,i=!!e&&e.isPartial,t.on("data",function(e){e.startTime=e.startPts/u,e.endTime=e.endPts/u,l.captions.push(e),l.captionStreams[e.stream]=!0})},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length)&&(o!==e[0]||u!==t[o])},this.parse=function(e,t,i){var n,r;if(!this.isInitialized())return null;if(!t||!i)return null;if(this.isNewInit(t,i))o=t[0],u=i[o];else if(null===o||!u)return a.push(e),null;for(;0<a.length;){var s=a.shift();this.parse(s,t,i)}return n=e,r=u,null!==(r=null===(e=o)?null:{seiNals:_a(n,e)[e],timescale:r})&&r.seiNals?(this.pushNals(r.seiNals),this.flushStream(),l):null},this.pushNals=function(e){if(!this.isInitialized()||!e||0===e.length)return null;e.forEach(function(e){t.push(e)})},this.flushStream=function(){if(!this.isInitialized())return null;i?t.partialFlush():t.flush()},this.clearParsedCaptions=function(){l.captions=[],l.captionStreams={}},this.resetCaptionStream=function(){if(!this.isInitialized())return null;t.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){a=[],u=o=null,l?this.clearParsedCaptions():l={captions:[],captionStreams:{}},this.resetCaptionStream()},this.reset()},Ta={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Sa=8589934592,ka=4294967296,Fe=function e(t){var i,n;e.prototype.init.call(this),this.type_=t||"shared",this.push=function(e){"shared"!==this.type_&&e.type!==this.type_||(void 0===n&&(n=e.dts),e.dts=ga(e.dts,n),e.pts=ga(e.pts,n),i=e.dts,this.trigger("data",e))},this.flush=function(){n=i,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){i=n=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Fe.prototype=new ei;function Ca(e){var t=31&e[1];return t<<=8,t|=e[2]}function Ea(e){return!!(64&e[1])}function wa(e){var t=0;return 1<(48&e[3])>>>4&&(t+=e[4]+1),t}function Aa(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}}function Ia(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]}var ir={parseType:function(e,t){e=Ca(e);return 0===e?"pat":e===t?"pmt":t?"pes":null},parsePat:function(e){var t=Ea(e),i=4+wa(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t={},i=Ea(e),n=4+wa(e);if(i&&(n+=e[n]+1),1&e[n+5]){for(var r=3+((15&e[n+1])<<8|e[n+2])-4,s=12+((15&e[n+10])<<8|e[n+11]);s<r;){var a=n+s;t[(31&e[a+1])<<8|e[a+2]]=e[a],s+=5+((15&e[a+3])<<8|e[a+4])}return t}},parsePayloadUnitStartIndicator:Ea,parsePesType:function(e,t){switch(t[Ca(e)]){case Ta.H264_STREAM_TYPE:return"video";case Ta.ADTS_STREAM_TYPE:return"audio";case Ta.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!Ea(e))return null;var t=4+wa(e);if(t>=e.byteLength)return null;var i=null,n=e[t+7];return 192&n&&((i={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,i.pts*=4,i.pts+=(6&e[t+13])>>>1,i.dts=i.pts,64&n&&(i.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,i.dts*=4,i.dts+=(6&e[t+18])>>>1)),i},videoPacketContainsKeyFrame:function(e){for(var t=4+wa(e),i=e.subarray(t),n=0,r=0,s=!1;r<i.byteLength-3;r++)if(1===i[r+2]){n=r+5;break}for(;n<i.byteLength;)switch(i[n]){case 0:if(0!==i[n-1]){n+=2;break}if(0!==i[n-2]){n++;break}for(r+3!==n-2&&"slice_layer_without_partitioning_rbsp_idr"===Aa(31&i[r+3])&&(s=!0);1!==i[++n]&&n<i.length;);r=n-2,n+=3;break;case 1:if(0!==i[n-1]||0!==i[n-2]){n+=3;break}"slice_layer_without_partitioning_rbsp_idr"===Aa(31&i[r+3])&&(s=!0),r=n-2,n+=3;break;default:n+=3}return i=i.subarray(r),n-=r,r=0,s=i&&3<i.byteLength&&"slice_layer_without_partitioning_rbsp_idr"===Aa(31&i[r+3])?!0:s}},Pa=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],xa=function(e,t,i){for(var n="",r=t;r<i;r++)n+="%"+("00"+e[r].toString(16)).slice(-2);return n},st={isLikelyAacData:function(e){return e[0]==="I".charCodeAt(0)&&e[1]==="D".charCodeAt(0)&&e[2]==="3".charCodeAt(0)},parseId3TagSize:function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&e[t+5])>>4?20+i:10+i},parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i},parseType:function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240==(240&e[t+1])?"audio":null},parseSampleRate:function(e){for(var t=0;t+5<e.length;){if(255===e[t]&&240==(246&e[t+1]))return Pa[(60&e[t+2])>>>2];t++}return null},parseAacTimestamp:function(e){var t,i=10;64&e[5]&&(i+=4,i+=Ia(e.subarray(10,14)));do{if((t=Ia(e.subarray(i+4,i+8)))<1)return null;if("PRIV"===String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3]))for(var n=e.subarray(i+10,i+t+10),r=0;r<n.byteLength;r++)if(0===n[r]){if("com.apple.streaming.transportStreamTimestamp"!==unescape(xa(n,0,r)))break;var s=n.subarray(r+1),a=(1&s[3])<<30|s[4]<<22|s[5]<<14|s[6]<<6|s[7]>>>2;return a*=4,a+=3&s[7]}}while(i+=10,(i+=t)<e.byteLength);return null}},pr=9e4,La=ga,Oa={};Oa.ts=ir,Oa.aac=st;var Da=pr,Na=188,Ra=function(e,t){for(var i,n=0,r=Na;r<e.byteLength;)if(71!==e[n]||71!==e[r])n++,r++;else{switch(i=e.subarray(n,r),Oa.ts.parseType(i,t.pid)){case"pat":t.pid||(t.pid=Oa.ts.parsePat(i));break;case"pmt":t.table||(t.table=Oa.ts.parsePmt(i))}if(t.pid&&t.table)return;n+=Na,r+=Na}},Ua=function(e,t,i){for(var n,r,s,a,o=0,u=Na,l=!1;u<=e.byteLength;)if(71!==e[o]||71!==e[u]&&u!==e.byteLength)o++,u++;else{if(n=e.subarray(o,u),"pes"===Oa.ts.parseType(n,t.pid)&&(r=Oa.ts.parsePesType(n,t.table),s=Oa.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&s&&(a=Oa.ts.parsePesTime(n))&&(a.type="audio",i.audio.push(a),l=!0)),l)break;o+=Na,u+=Na}for(o=(u=e.byteLength)-Na,l=!1;0<=o;)if(71!==e[o]||71!==e[u]&&u!==e.byteLength)o--,u--;else{if(n=e.subarray(o,u),"pes"===Oa.ts.parseType(n,t.pid)&&(r=Oa.ts.parsePesType(n,t.table),s=Oa.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&s&&(a=Oa.ts.parsePesTime(n))&&(a.type="audio",i.audio.push(a),l=!0)),l)break;o-=Na,u-=Na}},Ma=function(e,t,i){for(var n,r,s,a,o,u,l,c,h=0,d=Na,p=!1,f={data:[],size:0};d<e.byteLength;)if(71!==e[h]||71!==e[d])h++,d++;else{if(n=e.subarray(h,d),"pes"===Oa.ts.parseType(n,t.pid))if(r=Oa.ts.parsePesType(n,t.table),s=Oa.ts.parsePayloadUnitStartIndicator(n),"video"===r&&(s&&!p&&(a=Oa.ts.parsePesTime(n))&&(a.type="video",i.video.push(a),p=!0),!i.firstKeyFrame)){if(s&&0!==f.size){for(o=new Uint8Array(f.size),u=0;f.data.length;)l=f.data.shift(),o.set(l,u),u+=l.byteLength;Oa.ts.videoPacketContainsKeyFrame(o)&&((c=Oa.ts.parsePesTime(o))?(i.firstKeyFrame=c,i.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")),f.size=0}f.data.push(n),f.size+=n.byteLength}if(p&&i.firstKeyFrame)break;h+=Na,d+=Na}for(h=(d=e.byteLength)-Na,p=!1;0<=h;)if(71!==e[h]||71!==e[d])h--,d--;else{if(n=e.subarray(h,d),"pes"===Oa.ts.parseType(n,t.pid)&&(r=Oa.ts.parsePesType(n,t.table),s=Oa.ts.parsePayloadUnitStartIndicator(n),"video"===r&&s&&(a=Oa.ts.parsePesTime(n))&&(a.type="video",i.video.push(a),p=!0)),p)break;h-=Na,d-=Na}},He=function(e,t){var i,n,r=(Oa.aac.isLikelyAacData(e)?function(e){for(var t,i=!1,n=0,r=null,s=null,a=0,o=0;3<=e.length-o;){switch(Oa.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){i=!0;break}if((a=Oa.aac.parseId3TagSize(e,o))>e.length){i=!0;break}null===s&&(t=e.subarray(o,o+a),s=Oa.aac.parseAacTimestamp(t)),o+=a;break;case"audio":if(e.length-o<7){i=!0;break}if((a=Oa.aac.parseAdtsSize(e,o))>e.length){i=!0;break}null===r&&(t=e.subarray(o,o+a),r=Oa.aac.parseSampleRate(t)),n++,o+=a;break;default:o++}if(i)return null}if(null===r||null===s)return null;var u=Da/r;return{audio:[{type:"audio",dts:s,pts:s},{type:"audio",dts:s+1024*n*u,pts:s+1024*n*u}]}}:function(e){var t,i={pid:null,table:null},n={};for(t in Ra(e,i),i.table)if(i.table.hasOwnProperty(t))switch(i.table[t]){case Ta.H264_STREAM_TYPE:n.video=[],Ma(e,i,n),0===n.video.length&&delete n.video;break;case Ta.ADTS_STREAM_TYPE:n.audio=[],Ua(e,i,n),0===n.audio.length&&delete n.audio}return n})(e);return r&&(r.audio||r.video)?(e=t,(t=r).audio&&t.audio.length&&(void 0===(i=e)&&(i=t.audio[0].dts),t.audio.forEach(function(e){e.dts=La(e.dts,i),e.pts=La(e.pts,i),e.dtsTime=e.dts/Da,e.ptsTime=e.pts/Da})),t.video&&t.video.length&&(void 0===(n=e)&&(n=t.video[0].dts),t.video.forEach(function(e){e.dts=La(e.dts,n),e.pts=La(e.pts,n),e.dtsTime=e.dts/Da,e.ptsTime=e.pts/Da}),t.firstKeyFrame&&((t=t.firstKeyFrame).dts=La(t.dts,n),t.pts=La(t.pts,n),t.dtsTime=t.dts/Da,t.ptsTime=t.dts/Da)),r):null};function Ba(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var ja=function(e,t,i){return t&&Ba(e.prototype,t),i&&Ba(e,i),e},Fa=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;t=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(t,1),-1<t},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),s=t.length,a=0;a<s;++a)t[a].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(t){this.on("data",function(e){t.push(e)})},e}();function Ha(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24}function Va(e,t,i){for(var n,r,s,a,o=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),u=new za(Array.prototype.slice.call(t)),e=new Uint8Array(e.byteLength),l=new Int32Array(e.buffer),c=i[0],h=i[1],d=i[2],p=i[3],f=0;f<o.length;f+=4)n=Ha(o[f]),r=Ha(o[f+1]),s=Ha(o[f+2]),a=Ha(o[f+3]),u.decrypt(n,r,s,a,l,f),l[f]=Ha(l[f]^c),l[f+1]=Ha(l[f+1]^h),l[f+2]=Ha(l[f+2]^d),l[f+3]=Ha(l[f+3]^p),c=n,h=r,d=s,p=a;return e}function qa(e,t,i){return e&&i.responseURL&&t!==i.responseURL?i.responseURL:t}var Wa=null,za=function(){function e(e){var t,i,n;Wa=Wa||function(){for(var e,t,i,n,r,s,a,o=[[[],[],[],[],[]],[[],[],[],[],[]]],u=o[0],l=o[1],c=u[4],h=l[4],d=[],p=[],f=0;f<256;f++)p[(d[f]=f<<1^283*(f>>7))^f]=f;for(e=t=0;!c[e];e^=i||1,t=p[t]||1)for(a=16843009*d[n=d[i=d[h[c[e]=r=(r=t^t<<1^t<<2^t<<3^t<<4)>>8^255&r^99]=e]]]^65537*n^257*i^16843008*e,s=257*d[r]^16843008*r,f=0;f<4;f++)u[f][e]=s=s<<24^s>>>8,l[f][r]=a=a<<24^a>>>8;for(f=0;f<5;f++)u[f]=u[f].slice(0),l[f]=l[f].slice(0);return o}(),this._tables=[[Wa[0][0].slice(),Wa[0][1].slice(),Wa[0][2].slice(),Wa[0][3].slice(),Wa[0][4].slice()],[Wa[1][0].slice(),Wa[1][1].slice(),Wa[1][2].slice(),Wa[1][3].slice(),Wa[1][4].slice()]];var r=this._tables[0][4],s=this._tables[1],a=e.length,o=1;if(4!==a&&6!==a&&8!==a)throw new Error("Invalid aes key size");var u=e.slice(0),l=[];for(this._key=[u,l],t=a;t<4*a+28;t++)n=u[t-1],(t%a==0||8===a&&t%a==4)&&(n=r[n>>>24]<<24^r[n>>16&255]<<16^r[n>>8&255]<<8^r[255&n],t%a==0&&(n=n<<8^n>>>24^o<<24,o=o<<1^283*(o>>7))),u[t]=u[t-a]^n;for(i=0;t;i++,t--)n=u[3&i?t:t-4],l[i]=t<=4||i<4?n:s[0][r[n>>>24]]^s[1][r[n>>16&255]]^s[2][r[n>>8&255]]^s[3][r[255&n]]}return e.prototype.decrypt=function(e,t,i,n,r,s){for(var a,o,u,l=this._key[1],c=e^l[0],h=n^l[1],d=i^l[2],p=t^l[3],f=l.length/4-2,m=4,t=this._tables[1],g=t[0],y=t[1],v=t[2],_=t[3],b=t[4],T=0;T<f;T++)a=g[c>>>24]^y[h>>16&255]^v[d>>8&255]^_[255&p]^l[m],o=g[h>>>24]^y[d>>16&255]^v[p>>8&255]^_[255&c]^l[m+1],u=g[d>>>24]^y[p>>16&255]^v[c>>8&255]^_[255&h]^l[m+2],p=g[p>>>24]^y[c>>16&255]^v[h>>8&255]^_[255&d]^l[m+3],m+=4,c=a,h=o,d=u;for(T=0;T<4;T++)r[(3&-T)+s]=b[c>>>24]<<24^b[h>>16&255]<<16^b[d>>8&255]<<8^b[255&p]^l[m++],a=c,c=h,h=d,d=p,p=a},e}(),Ga=function(t){function e(){var e=t.call(this,Fa)||this;return e.jobs=[],e.delay=1,e.timeout_=null,e}Be(e,t);var i=e.prototype;return i.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},i.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},e}(Fa),ei=function(){function u(e,t,i,n){var r=u.STEP,s=new Int32Array(e.buffer),a=new Uint8Array(e.byteLength),o=0;for(this.asyncStream_=new Ga,this.asyncStream_.push(this.decryptChunk_(s.subarray(o,o+r),t,i,a)),o=r;o<s.length;o+=r)i=new Uint32Array([Ha(s[o-4]),Ha(s[o-3]),Ha(s[o-2]),Ha(s[o-1])]),this.asyncStream_.push(this.decryptChunk_(s.subarray(o,o+r),t,i,a));this.asyncStream_.push(function(){n(null,a.subarray(0,a.byteLength-a[a.byteLength-1]))})}return u.prototype.decryptChunk_=function(t,i,n,r){return function(){var e=Va(t,i,n);r.set(e,t.byteOffset)}},ja(u,null,[{key:"STEP",get:function(){return 32e3}}]),u}(),Xa=function(e,t){return/^[a-z]+:/i.test(t)?t:(/\/\//i.test(e)||(e=Jn.buildAbsoluteURL(d.location.href,e)),Jn.buildAbsoluteURL(e,t))},Ka=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Fe=function(e,t,i){return t&&Ya(e.prototype,t),i&&Ya(e,i),e};function Ya(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function $a(e,t,i){null===e&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,t);if(void 0!==n){if("value"in n)return n.value;n=n.get;return void 0!==n?n.call(i):void 0}if(null!==(e=Object.getPrototypeOf(e)))return $a(e,t,i)}function Qa(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function Ja(r,s){["AUDIO","SUBTITLES"].forEach(function(e){for(var t in r.mediaGroups[e])for(var i in r.mediaGroups[e][t]){var n=r.mediaGroups[e][t][i];s(n,e,t,i)}})}function Za(e,t){var i=so(e,{});if(!(e=i.playlists[t.id]))return null;if(e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence)return null;var n=so(e,t);e.segments&&(n.segments=function(e,t,i){var n=t.slice();i=i||0;for(var r=Math.min(e.length,t.length+i),s=i;s<r;s++)n[s-i]=so(e[s],n[s-i]);return n}(e.segments,t.segments,t.mediaSequence-e.mediaSequence)),n.segments.forEach(function(e){var t;t=e,e=n.resolvedUri,t.resolvedUri||(t.resolvedUri=Xa(e,t.uri)),t.key&&!t.key.resolvedUri&&(t.key.resolvedUri=Xa(e,t.key.uri)),t.map&&!t.map.resolvedUri&&(t.map.resolvedUri=Xa(e,t.map.uri))});for(var r=0;r<i.playlists.length;r++)i.playlists[r].id===t.id&&(i.playlists[r]=n);return i.playlists[t.id]=n,i.playlists[t.uri]=n,i}function eo(e,t){return e+"-"+t}function to(e){for(var t=e.playlists.length;t--;){var i=e.playlists[t];i.resolvedUri=Xa(e.uri,i.uri),i.id=eo(t,i.uri),e.playlists[i.id]=i,(e.playlists[i.uri]=i).attributes||(i.attributes={},ao.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute."))}}function io(t){Ja(t,function(e){e.uri&&(e.resolvedUri=Xa(t.uri,e.uri))})}function no(e,t){var i=e.segments[e.segments.length-1];return t&&i&&i.duration?1e3*i.duration:500*(e.targetDuration||10)}var ir=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},ro=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],n=!0,r=!1,s=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);n=!0);}catch(e){r=!0,s=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw s}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},so=Qn.mergeOptions,st=Qn.EventTarget,ao=Qn.log,oo=(ir(uo,st),Fe(uo,[{key:"playlistRequestError",value:function(e,t,i){var n=t.uri,t=t.id;this.request=null,i&&(this.state=i),this.error={playlist:this.master.playlists[t],status:e.status,message:"HLS playlist request error at URL: "+n+".",responseText:e.responseText,code:500<=e.status?4:2},this.trigger("error")}},{key:"haveMetadata",value:function(e,t,i){var n=this;this.request=null,this.state="HAVE_METADATA";var r=new sr;this.customTagParsers.forEach(function(e){return r.addParser(e)}),this.customTagMappers.forEach(function(e){return r.addTagMapper(e)}),r.push(e.responseText),r.end(),r.manifest.uri=t,r.manifest.id=i,r.manifest.attributes=r.manifest.attributes||{};t=Za(this.master,r.manifest);this.targetDuration=r.manifest.targetDuration,t?(this.master=t,this.media_=this.master.playlists[i]):this.trigger("playlistunchanged"),this.media().endList||(d.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=d.setTimeout(function(){n.trigger("mediaupdatetimeout")},no(this.media(),!!t))),this.trigger("loadedplaylist")}},{key:"dispose",value:function(){this.trigger("dispose"),this.stopRequest(),d.clearTimeout(this.mediaUpdateTimeout),d.clearTimeout(this.finalRenditionTimeout),this.off()}},{key:"stopRequest",value:function(){var e;this.request&&(e=this.request,this.request=null,e.onreadystatechange=null,e.abort())}},{key:"media",value:function(i,e){var n=this;if(!i)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof i){if(!this.master.playlists[i])throw new Error("Unknown playlist URI: "+i);i=this.master.playlists[i]}if(d.clearTimeout(this.finalRenditionTimeout),e){var t=i.targetDuration/2*1e3||5e3;this.finalRenditionTimeout=d.setTimeout(this.media.bind(this,i,!1),t)}else{var r=this.state,t=!this.media_||i.id!==this.media_.id;if(this.master.playlists[i.id].endList)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=i,void(t&&(this.trigger("mediachanging"),this.trigger("mediachange")));if(t){if(this.state="SWITCHING_MEDIA",this.request){if(i.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.request=this.hls_.xhr({uri:i.resolvedUri,withCredentials:this.withCredentials},function(e,t){if(n.request){if(i.resolvedUri=qa(n.handleManifestRedirects,i.resolvedUri,t),e)return n.playlistRequestError(n.request,i,r);n.haveMetadata(t,i.uri,i.id),"HAVE_MASTER"===r?n.trigger("loadedmetadata"):n.trigger("mediachange")}})}}}},{key:"pause",value:function(){this.stopRequest(),d.clearTimeout(this.mediaUpdateTimeout),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}},{key:"load",value:function(e){var t=this;d.clearTimeout(this.mediaUpdateTimeout);var i=this.media();e?(e=i?i.targetDuration/2*1e3:5e3,this.mediaUpdateTimeout=d.setTimeout(function(){return t.load()},e)):this.started?i&&!i.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}},{key:"start",value:function(){var n=this;this.started=!0,this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},function(e,t){if(n.request){if(n.request=null,e)return n.error={status:t.status,message:"HLS playlist request error at URL: "+n.srcUrl+".",responseText:t.responseText,code:2},"HAVE_NOTHING"===n.state&&(n.started=!1),n.trigger("error");var i=new sr;if(n.customTagParsers.forEach(function(e){return i.addParser(e)}),n.customTagMappers.forEach(function(e){return i.addTagMapper(e)}),i.push(t.responseText),i.end(),n.state="HAVE_MASTER",n.srcUrl=qa(n.handleManifestRedirects,n.srcUrl,t),i.manifest.uri=n.srcUrl,i.manifest.playlists)return n.master=i.manifest,to(n.master),io(n.master),n.trigger("loadedplaylist"),void(n.request||n.media(i.manifest.playlists[0]));e=eo(0,n.srcUrl);return n.master={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:d.location.href,playlists:[{uri:n.srcUrl,id:e,resolvedUri:n.srcUrl,attributes:{}}]},n.master.playlists[e]=n.master.playlists[0],n.master.playlists[n.srcUrl]=n.master.playlists[0],n.haveMetadata(t,n.srcUrl,e),n.trigger("loadedmetadata")}})}}]),uo);function uo(e,t){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};Ka(this,uo);var n=Qa(this,(uo.__proto__||Object.getPrototypeOf(uo)).call(this)),r=i.withCredentials,r=void 0!==r&&r,i=i.handleManifestRedirects,i=void 0!==i&&i;n.srcUrl=e,n.hls_=t,n.withCredentials=r,n.handleManifestRedirects=i;t=t.options_;if(n.customTagParsers=t&&t.customTagParsers||[],n.customTagMappers=t&&t.customTagMappers||[],!n.srcUrl)throw new Error("A non-empty playlist URL is required");return n.state="HAVE_NOTHING",n.on("mediaupdatetimeout",function(){"HAVE_METADATA"===n.state&&(n.state="HAVE_CURRENT_METADATA",n.request=n.hls_.xhr({uri:Xa(n.master.uri,n.media().uri),withCredentials:n.withCredentials},function(e,t){if(n.request)return e?n.playlistRequestError(n.request,n.media(),"HAVE_METADATA"):void n.haveMetadata(n.request,n.media().uri,n.media().id)}))}),n}function lo(e,t,i){var n,r=0;if(i<t&&(t=(n=[i,t])[0],i=n[1]),t<0){for(var s=t;s<Math.min(0,i);s++)r+=e.targetDuration;t=0}for(var a=t;a<i;a++)r+=e.segments[a].duration;return r}function co(e,t,i,n){return e&&e.segments?e.endList?Fo(e):null===t?null:(t=t||0,n=i?Ho(e,n):e.segments.length,jo(e,e.mediaSequence+n,t)):null}function ho(e){return e-Math.floor(e)==0}function po(e){return e.excludeUntil&&e.excludeUntil>Date.now()}function fo(e){return e.excludeUntil&&e.excludeUntil===1/0}function mo(e){var t=po(e);return!e.disabled&&!t}function go(e,t){return t.attributes&&t.attributes[e]}function yo(e,t){if(1===e.playlists.length)return!0;var i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter(function(e){return!!mo(e)&&(e.attributes.BANDWIDTH||0)<i}).length}function vo(){return function e(t,n){t=Go({timeout:45e3},t);var i=e.beforeRequest||Qn.Hls.xhr.beforeRequest;!i||"function"!=typeof i||(i=i(t))&&(t=i);var r=zo(t,function(e,t){var i=r.response;!e&&i&&(r.responseTime=Date.now(),r.roundTripTime=r.responseTime-r.requestTime,r.bytesReceived=i.byteLength||i.length,r.bandwidth||(r.bandwidth=Math.floor(r.bytesReceived/r.roundTripTime*8*1e3))),t.headers&&(r.responseHeaders=t.headers),e&&"ETIMEDOUT"===e.code&&(r.timedout=!0),e||r.aborted||200===t.statusCode||206===t.statusCode||0===t.statusCode||(e=new Error("XHR Failed with a response of: "+(r&&(i||r.responseText)))),n(e,r)}),s=r.abort;return r.abort=function(){return r.aborted=!0,s.apply(r,arguments)},r.uri=t.uri,r.requestTime=Date.now(),r}}function _o(e){var t={};return e.byterange&&(t.Range=Xo(e.byterange)),t}function bo(e,t){return e=e.toString(16),"00".substring(0,2-e.length)+e+(t%2?" ":"")}function To(e){return 32<=e&&e<126?String.fromCharCode(e):"."}function So(i){var n={};return Object.keys(i).forEach(function(e){var t=i[e];ArrayBuffer.isView(t)?n[e]={bytes:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}:n[e]=t}),n}function ko(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")}function Co(e){return e.resolvedUri}function Eo(e){for(var t=Array.prototype.slice.call(e),i="",n=0;n<t.length/16;n++)i+=t.slice(16*n,16*n+16).map(bo).join("")+" "+t.slice(16*n,16*n+16).map(To).join("")+"\n";return i}function wo(e){var t=e.playlist,i=e.time,n=void 0===i?void 0:i;if(!(i=e.callback))throw new Error("getProgramTime: callback must be provided");return t&&void 0!==n?(e=function(e,t){if(!t||!t.segments||0===t.segments.length)return null;for(var i=0,n=void 0,r=0;r<t.segments.length&&!(e<=(i=(n=t.segments[r]).videoTimingInfo?n.videoTimingInfo.transmuxedPresentationEnd:i+n.duration));r++);var s=t.segments[t.segments.length-1];if(s.videoTimingInfo&&s.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(i<e){if(e>i+s.duration*Ko)return null;n=s}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:i-n.duration,type:n.videoTimingInfo?"accurate":"estimate"}}(n,t))?"estimate"===e.type?i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:e.estimatedStart}):(t={mediaSeconds:n},(e=function(e,t){if(!t.dateTimeObject)return null;var i=t.videoTimingInfo.transmuxerPrependedSeconds,i=e-(t.videoTimingInfo.transmuxedPresentationStart+i);return new Date(t.dateTimeObject.getTime()+1e3*i)}(n,e.segment))&&(t.programDateTime=e.toISOString()),i(null,t)):i({message:"valid programTime was not found"}):i({message:"getProgramTime: playlist and time must be provided"})}function Ao(e){var t=e.programTime,i=e.playlist,n=e.retryCount,r=void 0===n?2:n,s=e.seekTo,a=e.pauseAfterSeek,o=void 0===a||a,u=e.tech,l=e.callback;if(!l)throw new Error("seekToProgramTime: callback must be provided");return void 0!==t&&i&&s?i.endList||u.hasStarted_?function(e){if(!e.segments||0===e.segments.length)return!1;for(var t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0}(i)?(n=function(e,t){var i=void 0;try{i=new Date(e)}catch(e){return null}if(!t||!t.segments||0===t.segments.length)return null;if(i<(r=t.segments[0]).dateTimeObject)return null;for(var n=0;n<t.segments.length-1;n++){var r=t.segments[n];if(i<t.segments[n+1].dateTimeObject)break}var s=t.segments[t.segments.length-1],a=s.dateTimeObject,e=s.videoTimingInfo?Yo(s.videoTimingInfo):s.duration+s.duration*Ko;return new Date(a.getTime()+1e3*e)<i?null:{segment:r=a<i?s:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:Wo.duration(t,t.mediaSequence+t.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"}}(t,i))?(a=n.segment,e=function(e,t){var i=void 0,n=void 0;try{i=new Date(e),n=new Date(t)}catch(e){}i=i.getTime();return(n.getTime()-i)/1e3}(a.dateTimeObject,t),"estimate"===n.type?0===r?l({message:t+" is not buffered yet. Try again"}):(s(n.estimatedStart+e),void u.one("seeked",function(){Ao({programTime:t,playlist:i,retryCount:r-1,seekTo:s,pauseAfterSeek:o,tech:u,callback:l})})):(e=a.start+e,u.one("seeked",function(){return l(null,u.currentTime())}),o&&u.pause(),void s(e))):l({message:t+" was not found in the stream"}):l({message:"programDateTime tags must be provided in the manifest "+i.resolvedUri}):l({message:"player must be playing a live stream to start buffering"}):l({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"})}function Io(e,t){var i=[],n=void 0;if(e&&e.length)for(n=0;n<e.length;n++)t(e.start(n),e.end(n))&&i.push([e.start(n),e.end(n)]);return Qn.createTimeRanges(i)}function Po(e,i){return Io(e,function(e,t){return e-.1<=i&&i<=t+.1})}function xo(e,t){return Io(e,function(e){return t<=e-1/30})}function Lo(e){var t=[];if(!e||!e.length)return"";for(var i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")}function Oo(e){for(var t=[],i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t}function Do(e,t,i){var n,r=void 0;if(i&&i.cues)for(r=i.cues.length;r--;)(n=i.cues[r]).startTime<=t&&n.endTime>=e&&i.removeCue(n)}function No(e){return isNaN(e)||Math.abs(e)===1/0?Number.MAX_VALUE:e}function Ro(e,t,i){var r=d.WebKitDataCue||d.VTTCue;if(t&&t.forEach(function(e){var t=e.stream;this.inbandTextTracks_[t].addCue(new r(e.startTime+this.timestampOffset,e.endTime+this.timestampOffset,e.text))},e),i){var n=No(e.mediaSource_.duration);if(i.forEach(function(e){var n=e.cueTime+this.timestampOffset;!("number"!=typeof n||d.isNaN(n)||n<0)&&n<1/0&&e.frames.forEach(function(e){var t,i=new r(n,n,e.value||e.url||e.data||"");i.frame=e,i.value=e,t=i,Object.defineProperties(t.frame,{id:{get:function(){return Qn.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),t.value.key}},value:{get:function(){return Qn.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),t.value.data}},privateData:{get:function(){return Qn.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),t.value.data}}}),this.metadataTrack_.addCue(i)},this)},e),e.metadataTrack_&&e.metadataTrack_.cues&&e.metadataTrack_.cues.length){for(var s=e.metadataTrack_.cues,a=[],o=0;o<s.length;o++)s[o]&&a.push(s[o]);var u=a.reduce(function(e,t){var i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e},{}),l=Object.keys(u).sort(function(e,t){return Number(e)-Number(t)});l.forEach(function(e,t){var e=u[e],i=Number(l[t+1])||n;e.forEach(function(e){e.endTime=i})})}}}var Uo=Qn.createTimeRange,Mo=function(e,t){var i=0,n=t-e.mediaSequence,r=e.segments[n];if(r){if(void 0!==r.start)return{result:r.start,precise:!0};if(void 0!==r.end)return{result:r.end-r.duration,precise:!0}}for(;n--;){if(void 0!==(r=e.segments[n]).end)return{result:i+r.end,precise:!0};if(i+=r.duration,void 0!==r.start)return{result:i+r.start,precise:!0}}return{result:i,precise:!1}},Bo=function(e,t){for(var i,n=0,r=t-e.mediaSequence;r<e.segments.length;r++){if(void 0!==(i=e.segments[r]).start)return{result:i.start-n,precise:!0};if(n+=i.duration,void 0!==i.end)return{result:i.end-n,precise:!0}}return{result:-1,precise:!1}},jo=function(e,t,i){var n,r;return(t=void 0===t?e.mediaSequence+e.segments.length:t)<e.mediaSequence?0:(n=Mo(e,t)).precise?n.result:(r=Bo(e,t)).precise?r.result:n.result+i},Fo=function(e,t,i){if(!e)return 0;if(void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return d.Infinity}return jo(e,t,i="number"!=typeof i?0:i)},Ho=function(e,t){if(!e.segments.length)return 0;var i=e.segments.length,n=e.segments[i-1].duration||e.targetDuration,r="number"==typeof t?t:n+2*e.targetDuration;if(0===r)return i;for(var s=0;i--&&!(r<=(s+=e.segments[i].duration)););return Math.max(0,i)},pr=function(e,t){if(ho(t))return t+.1*e;for(var i=t.toString().split(".")[1].length,n=1;n<=i;n++){var r=Math.pow(10,n),s=t*r;if(ho(s)||n===i)return(s+e)/r}},Vo=pr.bind(null,1),qo=pr.bind(null,-1),Wo={duration:Fo,seekable:function(e,t,i){var n=t||0,i=co(e,t,!0,i);return null===i?Uo():Uo(n,i)},safeLiveIndex:Ho,getMediaInfoForTime:function(e,t,i,n){var r=void 0,s=void 0,a=e.segments.length,o=t-n;if(o<0){if(0<i)for(r=i-1;0<=r;r--)if(s=e.segments[r],0<(o+=qo(s.duration)))return{mediaIndex:r,startTime:n-lo(e,i,r)};return{mediaIndex:0,startTime:t}}if(i<0){for(r=i;r<0;r++)if((o-=e.targetDuration)<0)return{mediaIndex:0,startTime:t};i=0}for(r=i;r<a;r++)if(s=e.segments[r],(o-=Vo(s.duration))<0)return{mediaIndex:r,startTime:n+lo(e,i,r)};return{mediaIndex:a-1,startTime:t}},isEnabled:mo,isDisabled:function(e){return e.disabled},isBlacklisted:po,isIncompatible:fo,playlistEnd:co,isAes:function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},isFmp4:function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].map)return!0;return!1},hasAttribute:go,estimateSegmentRequestTime:function(e,t,i){return go("BANDWIDTH",i)?(e*i.attributes.BANDWIDTH-8*(3<arguments.length&&void 0!==arguments[3]?arguments[3]:0))/t:NaN},isLowestEnabledRendition:yo},zo=Qn.xhr,Go=Qn.mergeOptions,Xo=function(e){var t=e.offset+e.length-1;return"bytes="+e.offset+"-"+t},st=Object.freeze({createTransferableMessage:So,initSegmentId:ko,segmentKeyId:Co,hexDump:Eo,tagDump:function(e){e=e.bytes;return Eo(e)},textRanges:function(e){for(var t,i,n="",r=void 0,r=0;r<e.length;r++)n+=(i=r,(t=e).start(i)+"-"+t.end(i)+" ");return n}}),Ko=.25,Yo=function(e){return e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds},pr="undefined"!=typeof window?window:{},$o="undefined"==typeof Symbol?"__target":Symbol(),Qo=pr.BlobBuilder||pr.WebKitBlobBuilder||pr.MozBlobBuilder||pr.MSBlobBuilder,Jo=pr.URL||pr.webkitURL||Jo&&Jo.msURL,Zo=pr.Worker;function eu(s,a){return function(e){var t=this;if(!a)return new Zo(s);if(Zo&&!e){e=nu(a.toString().replace(/^function.+?{/,"").slice(0,-1));return this[$o]=new Zo(e),i=this[$o],e=e,i&&e&&(n=i.terminate,i.objURL=e,i.terminate=function(){i.objURL&&Jo.revokeObjectURL(i.objURL),n.call(i)}),this[$o]}var i,n,r={postMessage:function(e){t.onmessage&&setTimeout(function(){t.onmessage({data:e,target:r})})}};a.call(r),this.postMessage=function(e){setTimeout(function(){r.onmessage({data:e,target:t})})},this.isThisThread=!0}}if(Zo){var tu=nu("self.onmessage = function () {}"),iu=new Uint8Array(1);try{(bu=new Zo(tu)).postMessage(iu,[iu.buffer])}catch(e){Zo=null}finally{Jo.revokeObjectURL(tu),bu&&bu.terminate()}}function nu(t){try{return Jo.createObjectURL(new Blob([t],{type:"application/javascript"}))}catch(e){var i=new Qo;return i.append(t),Jo.createObjectURL(i.getBlob(type))}}function ru(e){return e.map(function(e){return e.replace(/avc1\.(\d+)\.(\d+)/i,function(e,t,i){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(i).toString(16)).slice(-2)})})}function su(e,t,i){return e+"/"+t+'; codecs="'+i.filter(function(e){return!!e}).join(", ")+'"'}function au(e,t){var i=(a=t).segments&&a.segments.length&&a.segments[0].map?"mp4":"mp2t",n=function(e){e=e.attributes||{};return e.CODECS?cu(e.CODECS):lu}(t),r=t.attributes||{},s=!0,a=!1;if(!t)return[];if(e.mediaGroups.AUDIO&&r.AUDIO){var o=e.mediaGroups.AUDIO[r.AUDIO];if(o)for(var u in s=!(a=!0),o)if(!o[u].uri&&!o[u].playlists){s=!0;break}}return a&&!n.audioProfile&&(s||(n.audioProfile=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i,n=e.mediaGroups.AUDIO[t];if(!n)return null;for(i in n){var r=n[i];if(r.default&&r.playlists)return cu(r.playlists[0].attributes.CODECS).audioProfile}return null}(e,r.AUDIO)),n.audioProfile||(Qn.log.warn("Multiple audio tracks present but no audio codec string is specified. Attempting to use the default audio codec (mp4a.40.2)"),n.audioProfile=lu.audioProfile)),e={},n.videoCodec&&(e.video=""+n.videoCodec+n.videoObjectTypeIndicator),n.audioProfile&&(e.audio="mp4a.40."+n.audioProfile),r=su("audio",i,[e.audio]),n=su("video",i,[e.video]),i=su("video",i,[e.video,e.audio]),a?!s&&e.video?[n,r]:s||e.video?[i,r]:[r,r]:e.video?[i]:[r]}function ou(e,t){var i,n=e.addSourceBuffer(t),r=Object.create(null);for(i in r.updating=!1,r.realBuffer_=n)!function(t){"function"==typeof n[t]?r[t]=function(){return n[t].apply(n,arguments)}:void 0===r[t]&&Object.defineProperty(r,t,{get:function(){return n[t]},set:function(e){return n[t]=e}})}(i);return r}var uu=new eu("./transmuxer-worker.worker.js",function(e,t){var _t=this;!function(){var e=function(){this.init=function(){var s={};this.on=function(e,t){s[e]||(s[e]=[]),s[e]=s[e].concat(t)},this.off=function(e,t){return!!s[e]&&(t=s[e].indexOf(t),s[e]=s[e].slice(),s[e].splice(t,1),-1<t)},this.trigger=function(e){var t,i,n,r=s[e];if(r)if(2===arguments.length)for(i=r.length,t=0;t<i;++t)r[t].call(this,arguments[1]);else{for(n=[],t=arguments.length,t=1;t<arguments.length;++t)n.push(arguments[t]);for(i=r.length,t=0;t<i;++t)r[t].apply(this,n)}},this.dispose=function(){s={}}}};e.prototype.pipe=function(t){return this.on("data",function(e){t.push(e)}),this.on("done",function(e){t.flush(e)}),this.on("partialdone",function(e){t.partialFlush(e)}),this.on("endedtimeline",function(e){t.endTimeline(e)}),this.on("reset",function(e){t.reset(e)}),t},e.prototype.push=function(e){this.trigger("data",e)},e.prototype.flush=function(e){this.trigger("done",e)},e.prototype.partialFlush=function(e){this.trigger("partialdone",e)},e.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)},e.prototype.reset=function(e){this.trigger("reset",e)};var u,t,i,n,r,s,a,o,l,c,h,d,p,f,m,g,y,v,_,b,T,S,k,C,E,w,A,I,P,x,L,O,D,N,R,U,M,B,j,F=e,H=Math.pow(2,32)-1;!function(){if(T={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(var e in T)T.hasOwnProperty(e)&&(T[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);S=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),C=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),k=new Uint8Array([0,0,0,1]),E=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),w=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),A={video:E,audio:w},x=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),P=new Uint8Array([0,0,0,0,0,0,0,0]),L=new Uint8Array([0,0,0,0,0,0,0,0]),O=L,D=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),N=L,I=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),u=function(e){for(var t,i=[],n=0,r=1;r<arguments.length;r++)i.push(arguments[r]);for(r=i.length;r--;)n+=i[r].byteLength;for(t=new Uint8Array(n+8),new DataView(t.buffer,t.byteOffset,t.byteLength).setUint32(0,t.byteLength),t.set(e,4),r=0,n=8;r<i.length;r++)t.set(i[r],n),n+=i[r].byteLength;return t},t=function(){return u(T.dinf,u(T.dref,x))},i=function(e){return u(T.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},f=function(e){return u(T.hdlr,A[e])},p=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=255&e.samplerate),u(T.mdhd,t)},d=function(e){return u(T.mdia,p(e),f(e.type),s(e))},r=function(e){return u(T.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},s=function(e){return u(T.minf,"video"===e.type?u(T.vmhd,I):u(T.smhd,P),t(),g(e))},Ne=function(e,t){for(var i=[],n=t.length;n--;)i[n]=v(t[n]);return u.apply(null,[T.moof,r(e)].concat(i))},a=function(e){for(var t=e.length,i=[];t--;)i[t]=c(e[t]);return u.apply(null,[T.moov,l(4294967295)].concat(i).concat(o(e)))},o=function(e){for(var t=e.length,i=[];t--;)i[t]=_(e[t]);return u.apply(null,[T.mvex].concat(i))},l=function(e){e=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return u(T.mvhd,e)},m=function(e){for(var t,i=e.samples||[],n=new Uint8Array(4+i.length),r=0;r<i.length;r++)t=i[r].flags,n[r+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return u(T.sdtp,n)},g=function(e){return u(T.stbl,y(e),u(T.stts,N),u(T.stsc,O),u(T.stsz,D),u(T.stco,L))},y=function(e){return u(T.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),("video"===e.type?R:U)(e))},R=function(e){for(var t,i,n=e.sps||[],r=e.pps||[],s=[],a=[],o=0;o<n.length;o++)s.push((65280&n[o].byteLength)>>>8),s.push(255&n[o].byteLength),s=s.concat(Array.prototype.slice.call(n[o]));for(o=0;o<r.length;o++)a.push((65280&r[o].byteLength)>>>8),a.push(255&r[o].byteLength),a=a.concat(Array.prototype.slice.call(r[o]));return t=[T.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),u(T.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([n.length],s,[r.length],a))),u(T.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio&&(i=e.sarRatio[0],e=e.sarRatio[1],t.push(u(T.pasp,new Uint8Array([(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])))),u.apply(null,t)},U=function(e){return u(T.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),i(e))},h=function(e){e=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return u(T.tkhd,e)},v=function(e){var t,i=u(T.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),n=Math.floor(e.baseMediaDecodeTime/(1+H)),r=Math.floor(e.baseMediaDecodeTime%(1+H)),n=u(T.tfdt,new Uint8Array([1,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,r>>>24&255,r>>>16&255,r>>>8&255,255&r]));return"audio"===e.type?(t=b(e,92),u(T.traf,i,n,t)):(r=m(e),t=b(e,r.length+92),u(T.traf,i,n,t,r))},c=function(e){return e.duration=e.duration||4294967295,u(T.trak,h(e),d(e))},_=function(e){var t=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(t[t.length-1]=0),u(T.trex,t)},M=function(e,t){var i=0,n=0,r=0,s=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(s=8)),[0,0,i|n|r|s,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},B=function(e,t){var i,n,r,s,a=e.samples||[];for(t+=20+16*a.length,t=M(a,t),(n=new Uint8Array(t.length+16*a.length)).set(t),i=t.length,s=0;s<a.length;s++)r=a[s],n[i++]=(4278190080&r.duration)>>>24,n[i++]=(16711680&r.duration)>>>16,n[i++]=(65280&r.duration)>>>8,n[i++]=255&r.duration,n[i++]=(4278190080&r.size)>>>24,n[i++]=(16711680&r.size)>>>16,n[i++]=(65280&r.size)>>>8,n[i++]=255&r.size,n[i++]=r.flags.isLeading<<2|r.flags.dependsOn,n[i++]=r.flags.isDependedOn<<6|r.flags.hasRedundancy<<4|r.flags.paddingValue<<1|r.flags.isNonSyncSample,n[i++]=61440&r.flags.degradationPriority,n[i++]=15&r.flags.degradationPriority,n[i++]=(4278190080&r.compositionTimeOffset)>>>24,n[i++]=(16711680&r.compositionTimeOffset)>>>16,n[i++]=(65280&r.compositionTimeOffset)>>>8,n[i++]=255&r.compositionTimeOffset;return u(T.trun,n)},j=function(e,t){var i,n,r,s,a=e.samples||[];for(t+=20+8*a.length,t=M(a,t),(i=new Uint8Array(t.length+8*a.length)).set(t),n=t.length,s=0;s<a.length;s++)r=a[s],i[n++]=(4278190080&r.duration)>>>24,i[n++]=(16711680&r.duration)>>>16,i[n++]=(65280&r.duration)>>>8,i[n++]=255&r.duration,i[n++]=(4278190080&r.size)>>>24,i[n++]=(16711680&r.size)>>>16,i[n++]=(65280&r.size)>>>8,i[n++]=255&r.size;return u(T.trun,i)},b=function(e,t){return("audio"===e.type?j:B)(e,t)};n=function(){return u(T.ftyp,S,k,S,C)};function V(e,t){var i=X();return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i}var q,W=function(e){return u(T.mdat,e)},z=Ne,G=function(e){var t=n(),i=a(e),e=new Uint8Array(t.byteLength+i.byteLength);return e.set(t),e.set(i,t.byteLength),e},X=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},K=function(e){var t,i,n=[],r=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,t=n.byteLength=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(i=e[t]).nalUnitType?(n.length&&(n.duration=i.dts-n.dts,r.byteLength+=n.byteLength,r.nalCount+=n.length,r.duration+=n.duration,r.push(n)),(n=[i]).byteLength=i.data.byteLength,n.pts=i.pts,n.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(n.keyFrame=!0),n.duration=i.dts-n.dts,n.byteLength+=i.data.byteLength,n.push(i));return r.length&&(!n.duration||n.duration<=0)&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.length,r.duration+=n.duration,r.push(n),r},Y=function(e){var t,i,n=[],r=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,t=0;t<e.length;t++)(i=e[t]).keyFrame?(n.length&&(r.push(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration),(n=[i]).nalCount=i.length,n.byteLength=i.byteLength,n.pts=i.pts,n.dts=i.dts,n.duration=i.duration):(n.duration+=i.duration,n.nalCount+=i.length,n.byteLength+=i.byteLength,n.push(i));return r.length&&n.duration<=0&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration,r.push(n),r},$=function(e){var t;return!e[0][0].keyFrame&&1<e.length&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},Q=function(e,t){for(var i,n,r,s=t||0,a=[],o=0;o<e.length;o++)for(n=e[o],i=0;i<n.length;i++)r=n[i],s+=(r=V(r,s)).size,a.push(r);return a},J=function(e){for(var t,i,n,r,s,a=0,o=e.byteLength,u=e.nalCount,l=new Uint8Array(o+4*u),c=new DataView(l.buffer),h=0;h<e.length;h++)for(n=e[h],t=0;t<n.length;t++)for(r=n[t],i=0;i<r.length;i++)s=r[i],c.setUint32(a,s.data.byteLength),l.set(s.data,a+=4),a+=s.data.byteLength;return l},Z=[33,16,5,32,164,27],ee=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],te=function(e){for(var t=[];e--;)t.push(0);return t},ie=function(i){return Object.keys(i).reduce(function(e,t){return e[t]=new Uint8Array(i[t].reduce(function(e,t){return e.concat(t)},[])),e},{})},ne=function(e){return 9e4*e},re=function(e,t){return e*t},se=function(e){return e/9e4},ae=function(e,t){return e/t},oe=9e4,ue=function(e,t){return ne(ae(e,t))},le=function(e,t){return re(se(e),t)},ce=function(e,t,i){return se(i?e:e-t)},he=function(e,t,i,n){var r,s,a,o,u,l=0,c=0,h=0;if(t.length&&(r=ue(e.baseMediaDecodeTime,e.samplerate),s=Math.ceil(oe/(e.samplerate/1024)),i&&n&&(l=r-Math.max(i,n),h=(c=Math.floor(l/s))*s),!(c<1||oe/2<h))){for(q||(l={96e3:[Z,[227,64],te(154),[56]],88200:[Z,[231],te(170),[56]],64e3:[Z,[248,192],te(240),[56]],48e3:[Z,[255,192],te(268),[55,148,128],te(54),[112]],44100:[Z,[255,192],te(268),[55,163,128],te(84),[112]],32e3:[Z,[255,192],te(268),[55,234],te(226),[112]],24e3:[Z,[255,192],te(268),[55,255,128],te(268),[111,112],te(126),[224]],16e3:[Z,[255,192],te(268),[55,255,128],te(268),[111,255],te(269),[223,108],te(195),[1,192]],12e3:[ee,te(268),[3,127,248],te(268),[6,255,240],te(268),[13,255,224],te(268),[27,253,128],te(259),[56]],11025:[ee,te(268),[3,127,248],te(268),[6,255,240],te(268),[13,255,224],te(268),[27,255,192],te(268),[55,175,128],te(108),[112]],8e3:[ee,te(268),[3,121,16],te(47),[7]]},q=ie(l)),a=(a=q[e.samplerate])||t[0].data,o=0;o<c;o++)u=t[0],t.splice(0,0,{data:a,dts:u.dts-s,pts:u.pts-s});e.baseMediaDecodeTime-=Math.floor(le(h,e.samplerate))}},de=function(e,t,i){return t.minSegmentDts>=i?e:(t.minSegmentDts=1/0,e.filter(function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)}))},pe=function(e){for(var t,i=[],n=0;n<e.length;n++)t=e[n],i.push({size:t.data.byteLength,duration:1024});return i},fe=function(e){for(var t,i=0,n=new Uint8Array(function(e){for(var t=0,i=0;i<e.length;i++)t+=e[i].data.byteLength;return t}(e)),r=0;r<e.length;r++)t=e[r],n.set(t.data,i),i+=t.data.byteLength;return n},me=oe,ge=function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},ye=function(e,t){var i=e.minSegmentDts;return t||(i-=e.timelineStartInfo.dts),t=e.timelineStartInfo.baseMediaDecodeTime,t+=i,t=Math.max(0,t),"audio"===e.type&&(t*=e.samplerate/me,t=Math.floor(t)),t},ve=function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))},_e=function(e){for(var t=0,i={payloadType:-1,payloadSize:0},n=0,r=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)n+=255,t++;for(n+=e[t++];255===e[t];)r+=255,t++;if(r+=e[t++],!i.payload&&4===n){i.payloadType=n,i.payloadSize=r,i.payload=e.subarray(t,t+r);break}t+=r,r=n=0}return i},be=function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},Te=function(e,t){var i,n,r,s,a=[];if(!(64&t[0]))return a;for(n=31&t[0],i=0;i<n;i++)s={type:3&t[2+(r=3*i)],pts:e},4&t[2+r]&&(s.ccData=t[3+r]<<8|t[4+r],a.push(s));return a},Se=4,ke=function e(){e.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new Pe(0,0),new Pe(0,1),new Pe(1,0),new Pe(1,1)],this.reset(),this.ccStreams_.forEach(function(e){e.on("data",this.trigger.bind(this,"data")),e.on("partialdone",this.trigger.bind(this,"partialdone")),e.on("done",this.trigger.bind(this,"done"))},this)};(ke.prototype=new F).push=function(e){var t,i;if("sei_rbsp"===e.nalUnitType&&(t=_e(e.escapedRBSP)).payloadType===Se&&(i=be(t)))if(e.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));i=Te(e.pts,i),this.captionPackets_=this.captionPackets_.concat(i),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},ke.prototype.flushCCStreams=function(t){this.ccStreams_.forEach(function(e){return"flush"===t?e.flush():e.partialFlush()},this)},ke.prototype.flushStream=function(e){this.captionPackets_.length&&(this.captionPackets_.forEach(function(e,t){e.presortIndex=t}),this.captionPackets_.sort(function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts}),this.captionPackets_.forEach(function(e){e.type<2&&this.dispatchCea608Packet(e)},this),this.captionPackets_.length=0),this.flushCCStreams(e)},ke.prototype.flush=function(){return this.flushStream("flush")},ke.prototype.partialFlush=function(){return this.flushStream("partialFlush")},ke.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(e){e.reset()})},ke.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},ke.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},ke.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},ke.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)};function Ce(e){return null===e?"":(e=we[e]||e,String.fromCharCode(e))}function Ee(){for(var e=[],t=Ae+1;t--;)e.push("");return e}var we={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Ae=14,Ie=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Pe=function e(t,i){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=i||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,r,s=32639&e.ccData;s!==this.lastControlCode_?(4096==(61440&s)?this.lastControlCode_=s:s!==this.PADDING_&&(this.lastControlCode_=null),t=s>>>8,i=255&s,s===this.PADDING_||(s===this.RESUME_CAPTION_LOADING_?this.mode_="popOn":s===this.END_OF_CAPTION_?(this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),r=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=r,this.startPts_=e.pts):s===this.ROLL_UP_2_ROWS_?(this.rollUpRows_=2,this.setRollUp(e.pts)):s===this.ROLL_UP_3_ROWS_?(this.rollUpRows_=3,this.setRollUp(e.pts)):s===this.ROLL_UP_4_ROWS_?(this.rollUpRows_=4,this.setRollUp(e.pts)):s===this.CARRIAGE_RETURN_?(this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts):s===this.BACKSPACE_?"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1):s===this.ERASE_DISPLAYED_MEMORY_?(this.flushDisplayed(e.pts),this.displayed_=Ee()):s===this.ERASE_NON_DISPLAYED_MEMORY_?this.nonDisplayed_=Ee():s===this.RESUME_DIRECT_CAPTIONING_?("paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Ee()),this.mode_="paintOn",this.startPts_=e.pts):this.isSpecialCharacter(t,i)?(n=Ce((t=(3&t)<<8)|i),this[this.mode_](e.pts,n),this.column_++):this.isExtCharacter(t,i)?("popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),n=Ce((t=(3&t)<<8)|i),this[this.mode_](e.pts,n),this.column_++):this.isMidRowCode(t,i)?(this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&i)&&this.addFormatting(e.pts,["i"]),1==(1&i)&&this.addFormatting(e.pts,["u"])):this.isOffsetControlCode(t,i)?this.column_+=3&i:this.isPAC(t,i)?(r=Ie.indexOf(7968&s),"rollUp"===this.mode_&&(r-this.rollUpRows_+1<0&&(r=this.rollUpRows_-1),this.setRollUp(e.pts,r)),r!==this.row_&&(this.clearFormatting(e.pts),this.row_=r),1&i&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&s)&&(this.column_=4*((14&s)>>1)),this.isColorPAC(i)&&14==(14&i)&&this.addFormatting(e.pts,["i"])):this.isNormalChar(t)&&(0===i&&(i=null),n=Ce(t),n+=Ce(i),this[this.mode_](e.pts,n),this.column_+=n.length))):this.lastControlCode_=null}};Pe.prototype=new F,Pe.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e){try{return e.trim()}catch(e){return console.error("Skipping malformed caption."),""}}).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},Pe.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Ee(),this.nonDisplayed_=Ee(),this.lastControlCode_=null,this.column_=0,this.row_=Ae,this.rollUpRows_=2,this.formatting_=[]},Pe.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Pe.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&48<=t&&t<=63},Pe.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&32<=t&&t<=63},Pe.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&32<=t&&t<=47},Pe.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&33<=t&&t<=35},Pe.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&64<=t&&t<=127},Pe.prototype.isColorPAC=function(e){return 64<=e&&e<=79||96<=e&&e<=127},Pe.prototype.isNormalChar=function(e){return 32<=e&&e<=127},Pe.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=Ae,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Ee(),this.displayed_=Ee()),void 0!==t&&t!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},Pe.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);t=t.reduce(function(e,t){return e+"<"+t+">"},"");this[this.mode_](e,t)},Pe.prototype.clearFormatting=function(e){var t;this.formatting_.length&&(t=this.formatting_.reverse().reduce(function(e,t){return e+"</"+t+">"},""),this.formatting_=[],this[this.mode_](e,t))},Pe.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];this.nonDisplayed_[this.row_]=i+=t},Pe.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];this.displayed_[this.row_]=i+=t},Pe.prototype.shiftRowsUp_=function(){for(var e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<Ae+1;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]=""},Pe.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_];this.displayed_[this.row_]=i+=t};function xe(e,t){var i=1;for(t<e&&(i=-1);Math.abs(t-e)>De;)e+=i*Oe;return e}var e={CaptionStream:ke,Cea608Stream:Pe},Le={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Oe=8589934592,De=4294967296,Ne=function e(t){var i,n;e.prototype.init.call(this),this.type_=t||"shared",this.push=function(e){"shared"!==this.type_&&e.type!==this.type_||(void 0===n&&(n=e.dts),e.dts=xe(e.dts,n),e.pts=xe(e.pts,n),i=e.dts,this.trigger("data",e))},this.flush=function(){n=i,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){i=n=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Ne.prototype=new F;function Re(e,t,i){for(var n="",r=t;r<i;r++)n+="%"+("00"+e[r].toString(16)).slice(-2);return n}function Ue(e,t,i){return decodeURIComponent(Re(e,t,i))}function Me(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]}var ke=Ne,Be={TXXX:function(e){var t;if(3===e.data[0]){for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=Ue(e.data,1,t),e.value=Ue(e.data,t+1,e.data.length).replace(/\0*$/,"");break}e.data=e.value}},WXXX:function(e){var t;if(3===e.data[0])for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=Ue(e.data,1,t),e.url=Ue(e.data,t+1,e.data.length);break}},PRIV:function(e){for(var t,i=0;i<e.data.length;i++)if(0===e.data[i]){e.owner=(t=e.data,unescape(Re(t,0,i)));break}e.privateData=e.data.subarray(i+1),e.data=e.privateData}},je=function(e){var t,u={debug:!(!e||!e.debug),descriptor:e&&e.descriptor},l=0,c=[],h=0;if(je.prototype.init.call(this),this.dispatchType=Le.METADATA_STREAM_TYPE.toString(16),u.descriptor)for(t=0;t<u.descriptor.length;t++)this.dispatchType+=("00"+u.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,i,n,r,s,a,o;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(h=0,c.length=0),0===c.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))u.debug&&console.log("Skipping unrecognized metadata packet");else if(c.push(e),h+=e.data.byteLength,1===c.length&&(l=Me(e.data.subarray(6,10)),l+=10),!(h<l)){for(t={data:new Uint8Array(l),frames:[],pts:c[0].pts,dts:c[0].dts},r=0;r<l;)t.data.set(c[0].data.subarray(0,l-r),r),r+=c[0].data.byteLength,h-=c[0].data.byteLength,c.shift();i=10,64&t.data[5]&&(i+=4,i+=Me(t.data.subarray(10,14)),l-=Me(t.data.subarray(16,20)));do{if((n=Me(t.data.subarray(i+4,i+8)))<1)return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.")}while((o={id:String.fromCharCode(t.data[i],t.data[i+1],t.data[i+2],t.data[i+3]),data:t.data.subarray(i+10,i+n+10)}).key=o.id,Be[o.id]&&(Be[o.id](o),"com.apple.streaming.transportStreamTimestamp"===o.owner&&(a=(1&(s=o.data)[3])<<30|s[4]<<22|s[5]<<14|s[6]<<6|s[7]>>>2,a*=4,a+=3&s[7],o.timeStamp=a,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o))),t.frames.push(o),i+=10,(i+=n)<l);this.trigger("data",t)}}};je.prototype=new F;var Fe,He,Ne=je,ke=ke,Ve=function(){var r=new Uint8Array(188),s=0;Ve.prototype.init.call(this),this.push=function(e){var t,i=0,n=188;for(s?((t=new Uint8Array(e.byteLength+s)).set(r.subarray(0,s)),t.set(e,s),s=0):t=e;n<t.byteLength;)71!==t[i]||71!==t[n]?(i++,n++):(this.trigger("data",t.subarray(i,n)),i+=188,n+=188);i<t.byteLength&&(r.set(t.subarray(i),0),s=t.byteLength-i)},this.flush=function(){188===s&&71===r[0]&&(this.trigger("data",r),s=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){s=0,this.trigger("reset")}};Ve.prototype=new F,(Fe=function(){var n,r,s,a;Fe.prototype.init.call(this),(a=this).packetsWaitingForPmt=[],this.programMapTable=void 0,n=function(e,t){var i=0;t.payloadUnitStartIndicator&&(i+=e[i]+1),("pat"===t.type?r:s)(e.subarray(i),t)},r=function(e,t){t.section_number=e[7],t.last_section_number=e[8],a.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=a.pmtPid},s=function(e,t){var i,n;if(1&e[5]){for(a.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&e[1])<<8|e[2])-4,n=12+((15&e[10])<<8|e[11]);n<i;){var r=e[n],s=(31&e[n+1])<<8|e[n+2];r===Le.H264_STREAM_TYPE&&null===a.programMapTable.video?a.programMapTable.video=s:r===Le.ADTS_STREAM_TYPE&&null===a.programMapTable.audio?a.programMapTable.audio=s:r===Le.METADATA_STREAM_TYPE&&(a.programMapTable["timed-metadata"][s]=r),n+=5+((15&e[n+3])<<8|e[n+4])}t.programMapTable=a.programMapTable}},this.push=function(e){var t={},i=4;if(t.payloadUnitStartIndicator=!!(64&e[1]),t.pid=31&e[1],t.pid<<=8,t.pid|=e[2],1<(48&e[3])>>>4&&(i+=e[i]+1),0===t.pid)t.type="pat",n(e.subarray(i),t),this.trigger("data",t);else if(t.pid===this.pmtPid)for(t.type="pmt",n(e.subarray(i),t),this.trigger("data",t);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([e,i,t]):this.processPes_(e,i,t)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=Le.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=Le.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}}).prototype=new F,Fe.STREAM_TYPES={h264:27,adts:15},(He=function(){function n(e,t,i){var n,r=new Uint8Array(e.size),s={type:t},a=0,o=0;if(e.data.length&&!(e.size<9)){for(s.trackId=e.data[0].pid,a=0;a<e.data.length;a++)n=e.data[a],r.set(n.data,o),o+=n.data.byteLength;l(r,s),t="video"===t||s.packetLength<=e.size,(i||t)&&(e.size=0,e.data.length=0),t&&u.trigger("data",s)}}var t,u=this,r={data:[],size:0},s={data:[],size:0},a={data:[],size:0},l=function(e,t){var i;t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=0!=(4&e[6]),192&(i=e[7])&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8])};He.prototype.init.call(this),this.push=function(i){({pat:function(){},pes:function(){var e,t;switch(i.streamType){case Le.H264_STREAM_TYPE:e=r,t="video";break;case Le.ADTS_STREAM_TYPE:e=s,t="audio";break;case Le.METADATA_STREAM_TYPE:e=a,t="timed-metadata";break;default:return}i.payloadUnitStartIndicator&&n(e,t,!0),e.data.push(i),e.size+=i.data.byteLength},pmt:function(){var e={type:"metadata",tracks:[]};null!==(t=i.programMapTable).video&&e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.video,codec:"avc",type:"video"}),null!==t.audio&&e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.audio,codec:"adts",type:"audio"}),u.trigger("data",e)}})[i.type]()},this.reset=function(){r.size=0,r.data.length=0,s.size=0,s.data.length=0,this.trigger("reset")},this.flushStreams_=function(){n(r,"video"),n(s,"audio"),n(a,"timed-metadata")},this.flush=function(){this.flushStreams_(),this.trigger("done")}}).prototype=new F;var qe,We={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:Ve,TransportParseStream:Fe,ElementaryStream:He,TimestampRolloverStream:ke,CaptionStream:e.CaptionStream,Cea608Stream:e.Cea608Stream,MetadataStream:Ne};for(qe in Le)Le.hasOwnProperty(qe)&&(We[qe]=Le[qe]);var ze=We,Ge=oe,Xe=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Ke=function(o){var u,l=0;Ke.prototype.init.call(this),this.push=function(e){var t,i,n,r,s,a=0;if(o||(l=0),"audio"===e.type)for(u?(n=u,(u=new Uint8Array(n.byteLength+e.data.byteLength)).set(n),u.set(e.data,n.byteLength)):u=e.data;a+5<u.length;)if(255===u[a]&&240==(246&u[a+1])){if(t=2*(1&~u[a+1]),i=(3&u[a+3])<<11|u[a+4]<<3|(224&u[a+5])>>5,s=(r=1024*(1+(3&u[a+6])))*Ge/Xe[(60&u[a+2])>>>2],u.byteLength<(i=a+i))return;if(this.trigger("data",{pts:e.pts+l*s,dts:e.dts+l*s,sampleCount:r,audioobjecttype:1+(u[a+2]>>>6&3),channelcount:(1&u[a+2])<<2|(192&u[a+3])>>>6,samplerate:Xe[(60&u[a+2])>>>2],samplingfrequencyindex:(60&u[a+2])>>>2,samplesize:16,data:u.subarray(a+7+t,i)}),l++,u.byteLength===i)return void(u=void 0);u=u.subarray(i)}else a++},this.flush=function(){l=0,this.trigger("done")},this.reset=function(){u=void 0,this.trigger("reset")},this.endTimeline=function(){u=void 0,this.trigger("endedtimeline")}};Ke.prototype=new F;var Ye,$e,Qe=Ke,Je=function(n){var r=n.byteLength,s=0,a=0;this.length=function(){return 8*r},this.bitsAvailable=function(){return 8*r+a},this.loadWord=function(){var e=n.byteLength-r,t=new Uint8Array(4),i=Math.min(4,r);if(0===i)throw new Error("no bytes available");t.set(n.subarray(e,e+i)),s=new DataView(t.buffer).getUint32(0),a=8*i,r-=i},this.skipBits=function(e){var t;e<a||(e-=a,e-=8*(t=Math.floor(e/8)),r-=t,this.loadWord()),s<<=e,a-=e},this.readBits=function(e){var t=Math.min(a,e),i=s>>>32-t;return 0<(a-=t)?s<<=t:0<r&&this.loadWord(),0<(t=e-t)?i<<t|this.readBits(t):i},this.skipLeadingZeros=function(){for(var e=0;e<a;++e)if(0!=(s&2147483648>>>e))return s<<=e,a-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()},Ze=function(){var n,r,s=0;Ze.prototype.init.call(this),this.push=function(e){for(var t,i=(r=r?((t=new Uint8Array(r.byteLength+e.data.byteLength)).set(r),t.set(e.data,r.byteLength),t):e.data).byteLength;s<i-3;s++)if(1===r[s+2]){n=s+5;break}for(;n<i;)switch(r[n]){case 0:if(0!==r[n-1]){n+=2;break}if(0!==r[n-2]){n++;break}for(s+3!==n-2&&this.trigger("data",r.subarray(s+3,n-2));1!==r[++n]&&n<i;);s=n-2,n+=3;break;case 1:if(0!==r[n-1]||0!==r[n-2]){n+=3;break}this.trigger("data",r.subarray(s+3,n-2)),s=n-2,n+=3;break;default:n+=3}r=r.subarray(s),n-=s,s=0},this.reset=function(){r=null,s=0,this.trigger("reset")},this.flush=function(){r&&3<r.byteLength&&this.trigger("data",r.subarray(s+3)),r=null,s=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}};Ze.prototype=new F,$e={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(Ye=function(){var i,n,r,s,a,o,g,t=new Ze;Ye.prototype.init.call(this),(i=this).push=function(e){"video"===e.type&&(n=e.trackId,r=e.pts,s=e.dts,t.push(e))},t.on("data",function(e){var t={trackId:n,pts:r,dts:s,data:e};switch(31&e[0]){case 5:t.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:t.nalUnitType="sei_rbsp",t.escapedRBSP=a(e.subarray(1));break;case 7:t.nalUnitType="seq_parameter_set_rbsp",t.escapedRBSP=a(e.subarray(1)),t.config=o(t.escapedRBSP);break;case 8:t.nalUnitType="pic_parameter_set_rbsp";break;case 9:t.nalUnitType="access_unit_delimiter_rbsp"}i.trigger("data",t)}),t.on("done",function(){i.trigger("done")}),t.on("partialdone",function(){i.trigger("partialdone")}),t.on("reset",function(){i.trigger("reset")}),t.on("endedtimeline",function(){i.trigger("endedtimeline")}),this.flush=function(){t.flush()},this.partialFlush=function(){t.partialFlush()},this.reset=function(){t.reset()},this.endTimeline=function(){t.endTimeline()},g=function(e,t){for(var i=8,n=8,r=0;r<e;r++)i=0===(n=0!==n?(i+t.readExpGolomb()+256)%256:n)?i:n},a=function(e){for(var t=e.byteLength,i=[],n=1;n<t-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(i.push(n+2),n+=2):n++;if(0===i.length)return e;for(var r=t-i.length,s=new Uint8Array(r),a=0,n=0;n<r;a++,n++)a===i[0]&&(a++,i.shift()),s[n]=e[a];return s},o=function(e){var t,i,n,r,s,a,o=0,u=0,l=0,c=0,h=1,d=new Je(e),p=d.readUnsignedByte(),f=d.readUnsignedByte(),m=d.readUnsignedByte();if(d.skipUnsignedExpGolomb(),$e[p]&&(3===(i=d.readUnsignedExpGolomb())&&d.skipBits(1),d.skipUnsignedExpGolomb(),d.skipUnsignedExpGolomb(),d.skipBits(1),d.readBoolean()))for(r=3!==i?8:12,a=0;a<r;a++)d.readBoolean()&&g(a<6?16:64,d);if(d.skipUnsignedExpGolomb(),0===(n=d.readUnsignedExpGolomb()))d.readUnsignedExpGolomb();else if(1===n)for(d.skipBits(1),d.skipExpGolomb(),d.skipExpGolomb(),t=d.readUnsignedExpGolomb(),a=0;a<t;a++)d.skipExpGolomb();if(d.skipUnsignedExpGolomb(),d.skipBits(1),e=d.readUnsignedExpGolomb(),i=d.readUnsignedExpGolomb(),0===(n=d.readBits(1))&&d.skipBits(1),d.skipBits(1),d.readBoolean()&&(o=d.readUnsignedExpGolomb(),u=d.readUnsignedExpGolomb(),l=d.readUnsignedExpGolomb(),c=d.readUnsignedExpGolomb()),d.readBoolean()&&d.readBoolean()){switch(d.readUnsignedByte()){case 1:s=[1,1];break;case 2:s=[12,11];break;case 3:s=[10,11];break;case 4:s=[16,11];break;case 5:s=[40,33];break;case 6:s=[24,11];break;case 7:s=[20,11];break;case 8:s=[32,11];break;case 9:s=[80,33];break;case 10:s=[18,11];break;case 11:s=[15,11];break;case 12:s=[64,33];break;case 13:s=[160,99];break;case 14:s=[4,3];break;case 15:s=[3,2];break;case 16:s=[2,1];break;case 255:s=[d.readUnsignedByte()<<8|d.readUnsignedByte(),d.readUnsignedByte()<<8|d.readUnsignedByte()]}s&&(h=s[0]/s[1])}return{profileIdc:p,levelIdc:m,profileCompatibility:f,width:Math.ceil((16*(e+1)-2*o-2*u)*h),height:(2-n)*(i+1)*16-2*l-2*c,sarRatio:s}}}).prototype=new F;var e=Ye,Ne=function(e){return e[0]==="I".charCodeAt(0)&&e[1]==="D".charCodeAt(0)&&e[2]==="3".charCodeAt(0)},et=function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&e[t+5])>>4?20+i:10+i},tt=function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i},it=function(){var s=new Uint8Array,a=0;it.prototype.init.call(this),this.setTimestamp=function(e){a=e},this.push=function(e){var t,i,n=0,r=0;for(s.length?(i=s.length,(s=new Uint8Array(e.byteLength+i)).set(s.subarray(0,i)),s.set(e,i)):s=e;3<=s.length-r;)if(s[r]!=="I".charCodeAt(0)||s[r+1]!=="D".charCodeAt(0)||s[r+2]!=="3".charCodeAt(0))if(255!=(255&s[r])||240!=(240&s[r+1]))r++;else{if(s.length-r<7)break;if(r+(n=tt(s,r))>s.length)break;t={type:"audio",data:s.subarray(r,r+n),pts:a,dts:a},this.trigger("data",t),r+=n}else{if(s.length-r<10)break;if(r+(n=et(s,r))>s.length)break;t={type:"timed-metadata",data:s.subarray(r,r+n)},this.trigger("data",t),r+=n}e=s.length-r,s=0<e?s.subarray(r):new Uint8Array},this.reset=function(){s=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){s=new Uint8Array,this.trigger("endedtimeline")}};it.prototype=new F;function nt(e,t){var i;if(e.length===t.length){for(i=0;i<e.length;i++)if(e[i]!==t[i])return;return 1}}function rt(e,t,i,n,r,s){return{start:{dts:e,pts:e+(i-t)},end:{dts:e+(n-t),pts:e+(r-i)},prependedContentDuration:s,baseMediaDecodeTime:e}}var st,at,ot,ut=it,lt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],ct=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],ht=e,dt=Ne,pt=oe,ft=function(r,s){var a=[],o=0,u=0,l=0,c=1/0;s=s||{},ft.prototype.init.call(this),this.push=function(t){ve(r,t),r&&lt.forEach(function(e){r[e]=t[e]}),a.push(t)},this.setEarliestDts=function(e){u=e},this.setVideoBaseMediaDecodeTime=function(e){c=e},this.setAudioAppendStart=function(e){l=e},this.flush=function(){var e,t,i,n;0!==a.length&&(e=de(a,r,u),r.baseMediaDecodeTime=ye(r,s.keepOriginalTimestamps),he(r,e,l,c),r.samples=pe(e),t=W(fe(e)),a=[],n=z(o,[r]),i=new Uint8Array(n.byteLength+t.byteLength),o++,i.set(n),i.set(t,n.byteLength),ge(r),n=Math.ceil(1024*pt/r.samplerate),e.length&&this.trigger("timingInfo",{start:e[0].pts,end:e[0].pts+e.length*n}),this.trigger("data",{track:r,boxes:i})),this.trigger("done","AudioSegmentStream")},this.reset=function(){ge(r),a=[],this.trigger("reset")}};ft.prototype=new F,(st=function(a,s){var t,i,o=0,u=[],l=[];s=s||{},st.prototype.init.call(this),delete a.minPTS,this.gopCache_=[],this.push=function(e){ve(a,e),"seq_parameter_set_rbsp"!==e.nalUnitType||t||(t=e.config,a.sps=[e.data],ct.forEach(function(e){a[e]=t[e]},this)),"pic_parameter_set_rbsp"!==e.nalUnitType||i||(i=e.data,a.pps=[e.data]),u.push(e)},this.flush=function(){for(var e,t,i,n=0;u.length&&"access_unit_delimiter_rbsp"!==u[0].nalUnitType;)u.shift();if(0===u.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(e=K(u),(t=Y(e))[0][0].keyFrame||((i=this.getGopForFusion_(u[0],a))?(n=i.duration,t.unshift(i),t.byteLength+=i.byteLength,t.nalCount+=i.nalCount,t.pts=i.pts,t.dts=i.dts,t.duration+=i.duration):t=$(t)),l.length){var r=s.alignGopsAtEnd?this.alignGopsAtEnd_(t):this.alignGopsAtStart_(t);if(!r)return this.gopCache_.unshift({gop:t.pop(),pps:a.pps,sps:a.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),u=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");ge(a),t=r}ve(a,t),a.samples=Q(t),e=W(J(t)),a.baseMediaDecodeTime=ye(a,s.keepOriginalTimestamps),this.trigger("processedGopsInfo",t.map(function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}})),i=t[0],r=t[t.length-1],this.trigger("segmentTimingInfo",rt(a.baseMediaDecodeTime,i.dts,i.pts,r.dts+r.duration,r.pts+r.duration,n)),this.trigger("timingInfo",{start:t[0].pts,end:t[t.length-1].pts+t[t.length-1].duration}),this.gopCache_.unshift({gop:t.pop(),pps:a.pps,sps:a.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),u=[],this.trigger("baseMediaDecodeTime",a.baseMediaDecodeTime),this.trigger("timelineStartInfo",a.timelineStartInfo),n=z(o,[a]),t=new Uint8Array(n.byteLength+e.byteLength),o++,t.set(n),t.set(e,n.byteLength),this.trigger("data",{track:a,boxes:t}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),u=[],this.gopCache_.length=0,l.length=0,this.trigger("reset")},this.resetStream_=function(){ge(a),i=t=void 0},this.getGopForFusion_=function(e){for(var t,i,n,r=1/0,s=0;s<this.gopCache_.length;s++)i=(n=this.gopCache_[s]).gop,a.pps&&nt(a.pps[0],n.pps[0])&&a.sps&&nt(a.sps[0],n.sps[0])&&(i.dts<a.timelineStartInfo.dts||-1e4<=(i=e.dts-i.dts-i.duration)&&i<=45e3&&(!t||i<r)&&(t=n,r=i));return t?t.gop:null},this.alignGopsAtStart_=function(e){for(var t,i,n,r,s=e.byteLength,a=e.nalCount,o=e.duration,u=t=0;u<l.length&&t<e.length&&(i=l[u],n=e[t],i.pts!==n.pts);)n.pts>i.pts?u++:(t++,s-=n.byteLength,a-=n.nalCount,o-=n.duration);return 0===t?e:t===e.length?null:((r=e.slice(t)).byteLength=s,r.duration=o,r.nalCount=a,r.pts=r[0].pts,r.dts=r[0].dts,r)},this.alignGopsAtEnd_=function(e){for(var t,i,n=l.length-1,r=e.length-1,s=null,a=!1;0<=n&&0<=r;){if(t=l[n],i=e[r],t.pts===i.pts){a=!0;break}t.pts>i.pts?n--:(n===l.length-1&&(s=r),r--)}if(!a&&null===s)return null;if(0===(u=a?r:s))return e;var o=e.slice(u),u=o.reduce(function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e},{byteLength:0,duration:0,nalCount:0});return o.byteLength=u.byteLength,o.duration=u.duration,o.nalCount=u.nalCount,o.pts=o[0].pts,o.dts=o[0].dts,o},this.alignGopsWith=function(e){l=e}}).prototype=new F,((ot=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,ot.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))}}).prototype=new F).flush=function(e){var t,i,n,r=0,s={captions:[],captionStreams:{},metadata:[],info:{}},a=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(a=this.videoTrack.timelineStartInfo.pts,ct.forEach(function(e){s.info[e]=this.videoTrack[e]},this)):this.audioTrack&&(a=this.audioTrack.timelineStartInfo.pts,lt.forEach(function(e){s.info[e]=this.audioTrack[e]},this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,e=G(this.pendingTracks),s.initSegment=new Uint8Array(e.byteLength),s.initSegment.set(e),s.data=new Uint8Array(this.pendingBytes),n=0;n<this.pendingBoxes.length;n++)s.data.set(this.pendingBoxes[n],r),r+=this.pendingBoxes[n].byteLength;for(n=0;n<this.pendingCaptions.length;n++)(t=this.pendingCaptions[n]).startTime=ce(t.startPts,a,this.keepOriginalTimestamps),t.endTime=ce(t.endPts,a,this.keepOriginalTimestamps),s.captionStreams[t.stream]=!0,s.captions.push(t);for(n=0;n<this.pendingMetadata.length;n++)(i=this.pendingMetadata[n]).cueTime=ce(i.pts,a,this.keepOriginalTimestamps),s.metadata.push(i);for(s.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",s),n=0;n<s.captions.length;n++)t=s.captions[n],this.trigger("caption",t);for(n=0;n<s.metadata.length;n++)i=s.metadata[n],this.trigger("id3Frame",i)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},ot.prototype.setRemux=function(e){this.remuxTracks=e},(at=function(r){var s,a,o=this,i=!0;at.prototype.init.call(this),r=r||{},this.baseMediaDecodeTime=r.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var t={};(this.transmuxPipeline_=t).type="aac",t.metadataStream=new ze.MetadataStream,t.aacStream=new ut,t.audioTimestampRolloverStream=new ze.TimestampRolloverStream("audio"),t.timedMetadataTimestampRolloverStream=new ze.TimestampRolloverStream("timed-metadata"),t.adtsStream=new Qe,t.coalesceStream=new ot(r,t.metadataStream),t.headOfPipeline=t.aacStream,t.aacStream.pipe(t.audioTimestampRolloverStream).pipe(t.adtsStream),t.aacStream.pipe(t.timedMetadataTimestampRolloverStream).pipe(t.metadataStream).pipe(t.coalesceStream),t.metadataStream.on("timestamp",function(e){t.aacStream.setTimestamp(e.timeStamp)}),t.aacStream.on("data",function(e){"timed-metadata"!==e.type||t.audioSegmentStream||(a=a||{timelineStartInfo:{baseMediaDecodeTime:o.baseMediaDecodeTime},codec:"adts",type:"audio"},t.coalesceStream.numberOfTracks++,t.audioSegmentStream=new ft(a,r),t.audioSegmentStream.on("timingInfo",o.trigger.bind(o,"audioTimingInfo")),t.adtsStream.pipe(t.audioSegmentStream).pipe(t.coalesceStream)),o.trigger("trackinfo",{hasAudio:!!a,hasVideo:!!s})}),t.coalesceStream.on("data",this.trigger.bind(this,"data")),t.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var n={};(this.transmuxPipeline_=n).type="ts",n.metadataStream=new ze.MetadataStream,n.packetStream=new ze.TransportPacketStream,n.parseStream=new ze.TransportParseStream,n.elementaryStream=new ze.ElementaryStream,n.timestampRolloverStream=new ze.TimestampRolloverStream,n.adtsStream=new Qe,n.h264Stream=new ht,n.captionStream=new ze.CaptionStream,n.coalesceStream=new ot(r,n.metadataStream),n.headOfPipeline=n.packetStream,n.packetStream.pipe(n.parseStream).pipe(n.elementaryStream).pipe(n.timestampRolloverStream),n.timestampRolloverStream.pipe(n.h264Stream),n.timestampRolloverStream.pipe(n.adtsStream),n.timestampRolloverStream.pipe(n.metadataStream).pipe(n.coalesceStream),n.h264Stream.pipe(n.captionStream).pipe(n.coalesceStream),n.elementaryStream.on("data",function(e){var t,i=r.keepOriginalTimestamps?0:o.baseMediaDecodeTime;if("metadata"===e.type){for(t=e.tracks.length;t--;)s||"video"!==e.tracks[t].type?a||"audio"!==e.tracks[t].type||((a=e.tracks[t]).timelineStartInfo.baseMediaDecodeTime=i):(s=e.tracks[t]).timelineStartInfo.baseMediaDecodeTime=i;s&&!n.videoSegmentStream&&(n.coalesceStream.numberOfTracks++,n.videoSegmentStream=new st(s,r),n.videoSegmentStream.on("timelineStartInfo",function(e){a&&!r.keepOriginalTimestamps&&(a.timelineStartInfo=e,n.audioSegmentStream.setEarliestDts(e.dts-o.baseMediaDecodeTime))}),n.videoSegmentStream.on("processedGopsInfo",o.trigger.bind(o,"gopInfo")),n.videoSegmentStream.on("segmentTimingInfo",o.trigger.bind(o,"videoSegmentTimingInfo")),n.videoSegmentStream.on("baseMediaDecodeTime",function(e){a&&n.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}),n.videoSegmentStream.on("timingInfo",o.trigger.bind(o,"videoTimingInfo")),n.h264Stream.pipe(n.videoSegmentStream).pipe(n.coalesceStream)),a&&!n.audioSegmentStream&&(n.coalesceStream.numberOfTracks++,n.audioSegmentStream=new ft(a,r),n.audioSegmentStream.on("timingInfo",o.trigger.bind(o,"audioTimingInfo")),n.adtsStream.pipe(n.audioSegmentStream).pipe(n.coalesceStream)),o.trigger("trackinfo",{hasAudio:!!a,hasVideo:!!s})}}),n.coalesceStream.on("data",this.trigger.bind(this,"data")),n.coalesceStream.on("id3Frame",function(e){e.dispatchType=n.metadataStream.dispatchType,o.trigger("id3Frame",e)}),n.coalesceStream.on("caption",this.trigger.bind(this,"caption")),n.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(e){var t=this.transmuxPipeline_;this.baseMediaDecodeTime=e,a&&(a.timelineStartInfo.dts=void 0,a.timelineStartInfo.pts=void 0,ge(a),t.audioTimestampRolloverStream&&t.audioTimestampRolloverStream.discontinuity()),s&&(t.videoSegmentStream&&(t.videoSegmentStream.gopCache_=[]),s.timelineStartInfo.dts=void 0,s.timelineStartInfo.pts=void 0,ge(s),t.captionStream.reset()),t.timestampRolloverStream&&t.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){a&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(e){var t=this.transmuxPipeline_;r.remux=e,t&&t.coalesceStream&&t.coalesceStream.setRemux(e)},this.alignGopsWith=function(e){s&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.push=function(e){var t;i&&((t=dt(e))&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),i=!1),this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){i=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new F;var mt=at;function gt(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var yt=(function(e,t,i){return t&&gt(e.prototype,t),i&&gt(e,i),e}(vt,[{key:"init",value:function(){var i,e;this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new mt(this.options),i=this.self,(e=this.transmuxer).on("data",function(e){var t=e.initSegment;e.initSegment={data:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength};t=e.data;e.data=t.buffer,i.postMessage({action:"data",segment:e,byteOffset:t.byteOffset,byteLength:t.byteLength},[e.data])}),e.captionStream&&e.captionStream.on("data",function(e){i.postMessage({action:"caption",data:e})}),e.on("done",function(e){i.postMessage({action:"done"})}),e.on("gopInfo",function(e){i.postMessage({action:"gopInfo",gopInfo:e})}),e.on("videoSegmentTimingInfo",function(e){i.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:e})})}},{key:"push",value:function(e){e=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(e)}},{key:"reset",value:function(){this.init()}},{key:"setTimestampOffset",value:function(e){e=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(9e4*e))}},{key:"setAudioAppendStart",value:function(e){this.transmuxer.setAudioAppendStart(Math.ceil(9e4*e.appendStart))}},{key:"flush",value:function(e){this.transmuxer.flush()}},{key:"resetCaptions",value:function(){this.transmuxer.resetCaptions()}},{key:"alignGopsWith",value:function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}]),vt);function vt(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,vt),this.options=t||{},this.self=e,this.init()}(function(t){t.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new yt(t,e.data.options):(this.messageHandlers||(this.messageHandlers=new yt(t)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}})(_t)}()}),lu={videoCodec:"avc1",videoObjectTypeIndicator:".4d400d",audioProfile:"2"},cu=function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",i={codecCount:0};return i.codecCount=t.split(",").length,i.codecCount=i.codecCount||2,(e=/(^|\s|,)+(avc[13])([^ ,]*)/i.exec(t))&&(i.videoCodec=e[2],i.videoObjectTypeIndicator=e[3]),i.audioProfile=/(^|\s|,)+mp4a.[0-9A-Fa-f]+\.([0-9A-Fa-f]+)/i.exec(t),i.audioProfile=i.audioProfile&&i.audioProfile[2],i},hu=function(e){var i={type:"",parameters:{}},e=e.trim().split(";");return i.type=e.shift().trim(),e.forEach(function(e){var t=e.trim().split("=");1<t.length&&(e=t[0].replace(/"/g,"").trim(),t=t[1].replace(/"/g,"").trim(),i.parameters[e]=t)}),i},du=function(e){return/mp4a\.\d+.\d+/i.test(e)},pu=function(e){return/avc1\.[\da-f]+/i.test(e)},fu=(iu=Qn.EventTarget,ir(mu,iu),Fe(mu,[{key:"data_",value:function(e){var t=e.data.segment;t.data=new Uint8Array(t.data,e.data.byteOffset,e.data.byteLength),t.initSegment=new Uint8Array(t.initSegment.data,t.initSegment.byteOffset,t.initSegment.byteLength),function(e,t,i){var n,r=t.player_;if(i.captions&&i.captions.length)for(var s in e.inbandTextTracks_||(e.inbandTextTracks_={}),i.captionStreams)e.inbandTextTracks_[s]||(r.tech_.trigger({type:"usage",name:"hls-608"}),n=r.textTracks().getTrackById(s),e.inbandTextTracks_[s]=n||r.addRemoteTextTrack({kind:"captions",id:s,label:s},!1).track);i.metadata&&i.metadata.length&&!e.metadataTrack_&&(e.metadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=i.metadata.dispatchType)}(this,this.mediaSource_,t),this.pendingBuffers_.push(t)}},{key:"done_",value:function(e){"closed"!==this.mediaSource_.readyState?this.processPendingSegments_():this.pendingBuffers_.length=0}},{key:"videoSegmentTimingInfo_",value:function(e){var t={start:{decode:e.start.dts/9e4,presentation:e.start.pts/9e4},end:{decode:e.end.dts/9e4,presentation:e.end.pts/9e4},baseMediaDecodeTime:e.baseMediaDecodeTime/9e4};e.prependedContentDuration&&(t.prependedContentDuration=e.prependedContentDuration/9e4),this.trigger({type:"videoSegmentTimingInfo",videoSegmentTimingInfo:t})}},{key:"createRealSourceBuffers_",value:function(){var n=this,r=["audio","video"];r.forEach(function(t){var e,i;n[t+"Codec_"]&&(n[t+"Buffer_"]||(i=null,n.mediaSource_[t+"Buffer_"]?(i=n.mediaSource_[t+"Buffer_"]).updating=!1:(e=t+'/mp4;codecs="'+n[t+"Codec_"]+'"',i=ou(n.mediaSource_.nativeMediaSource_,e),n.mediaSource_[t+"Buffer_"]=i),n[t+"Buffer_"]=i,["update","updatestart","updateend"].forEach(function(e){i.addEventListener(e,function(){if("audio"!==t||!n.audioDisabled_)return"updateend"===e&&(n[t+"Buffer_"].updating=!1),r.every(function(e){return!("audio"!==e||!n.audioDisabled_)||(t===e||!n[e+"Buffer_"]||!n[e+"Buffer_"].updating)})?n.trigger(e):void 0})})))})}},{key:"appendBuffer",value:function(e){var t;this.bufferUpdating_=!0,this.audioBuffer_&&this.audioBuffer_.buffered.length&&(t=this.audioBuffer_.buffered,this.transmuxer_.postMessage({action:"setAudioAppendStart",appendStart:t.end(t.length-1)})),this.videoBuffer_&&this.transmuxer_.postMessage({action:"alignGopsWith",gopsToAlignWith:function(e,t,i){if(null==t||!e.length)return[];for(var n=Math.ceil(9e4*(t-i+3)),r=void 0,r=0;r<e.length&&!(e[r].pts>n);r++);return e.slice(r)}(this.gopBuffer_,this.mediaSource_.player_?this.mediaSource_.player_.currentTime():null,this.timeMapping_)}),this.transmuxer_.postMessage({action:"push",data:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength},[e.buffer]),this.transmuxer_.postMessage({action:"flush"})}},{key:"appendGopInfo_",value:function(e){this.gopBuffer_=function(e,t,i){if(!t.length)return e;if(i)return t.slice();for(var n=t[0].pts,r=0;r<e.length&&!(e[r].pts>=n);r++);return e.slice(0,r).concat(t)}(this.gopBuffer_,e.data.gopInfo,this.safeAppend_)}},{key:"remove",value:function(e,t){if(this.videoBuffer_&&(this.videoBuffer_.updating=!0,this.videoBuffer_.remove(e,t),this.gopBuffer_=function(e,t,i,n){for(var r=Math.ceil(9e4*(t-n)),s=Math.ceil(9e4*(i-n)),n=e.slice(),a=e.length;a--&&!(e[a].pts<=s););if(-1===a)return n;for(var o=a+1;o--&&!(e[o].pts<=r););return o=Math.max(o,0),n.splice(o,a-o+1),n}(this.gopBuffer_,e,t,this.timeMapping_)),!this.audioDisabled_&&this.audioBuffer_&&(this.audioBuffer_.updating=!0,this.audioBuffer_.remove(e,t)),Do(e,t,this.metadataTrack_),this.inbandTextTracks_)for(var i in this.inbandTextTracks_)Do(e,t,this.inbandTextTracks_[i])}},{key:"processPendingSegments_",value:function(){var e={video:{segments:[],bytes:0},audio:{segments:[],bytes:0},captions:[],metadata:[]};if(!this.pendingBuffers_.length)return this.trigger("updateend"),void(this.bufferUpdating_=!1);e=this.pendingBuffers_.reduce(function(e,t){var i=t.type,n=t.data,r=t.initSegment;return e[i].segments.push(n),e[i].bytes+=n.byteLength,e[i].initSegment=r,t.captions&&(e.captions=e.captions.concat(t.captions)),t.info&&(e[i].info=t.info),t.metadata&&(e.metadata=e.metadata.concat(t.metadata)),e},e),this.videoBuffer_||this.audioBuffer_||(0===e.video.bytes&&(this.videoCodec_=null),0===e.audio.bytes&&(this.audioCodec_=null),this.createRealSourceBuffers_()),e.audio.info&&this.mediaSource_.trigger({type:"audioinfo",info:e.audio.info}),e.video.info&&this.mediaSource_.trigger({type:"videoinfo",info:e.video.info}),this.appendAudioInitSegment_&&(!this.audioDisabled_&&this.audioBuffer_&&(e.audio.segments.unshift(e.audio.initSegment),e.audio.bytes+=e.audio.initSegment.byteLength),this.appendAudioInitSegment_=!1);var t=!1;this.videoBuffer_&&e.video.bytes?(e.video.segments.unshift(e.video.initSegment),e.video.bytes+=e.video.initSegment.byteLength,this.concatAndAppendSegments_(e.video,this.videoBuffer_)):!this.videoBuffer_||!this.audioDisabled_&&this.audioBuffer_||(t=!0),Ro(this,e.captions,e.metadata),!this.audioDisabled_&&this.audioBuffer_&&this.concatAndAppendSegments_(e.audio,this.audioBuffer_),this.pendingBuffers_.length=0,t&&this.trigger("updateend"),this.bufferUpdating_=!1}},{key:"concatAndAppendSegments_",value:function(e,t){var i=0,n=void 0;if(e.bytes){n=new Uint8Array(e.bytes),e.segments.forEach(function(e){n.set(e,i),i+=e.byteLength});try{t.updating=!0,t.appendBuffer(n)}catch(e){this.mediaSource_.player_&&this.mediaSource_.player_.error({code:-3,type:"APPEND_BUFFER_ERR",message:e.message,originalError:e})}}}},{key:"abort",value:function(){this.videoBuffer_&&this.videoBuffer_.abort(),!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"reset"}),this.pendingBuffers_.length=0,this.bufferUpdating_=!1}},{key:"dispose",value:function(){this.transmuxer_&&this.transmuxer_.terminate(),this.trigger("dispose"),this.off()}}]),mu);function mu(e,t){Ka(this,mu);var i=Qa(this,(mu.__proto__||Object.getPrototypeOf(mu)).call(this,Qn.EventTarget));i.timestampOffset_=0,i.pendingBuffers_=[],i.bufferUpdating_=!1,i.mediaSource_=e,i.codecs_=t,i.audioCodec_=null,i.videoCodec_=null,i.audioDisabled_=!1,i.appendAudioInitSegment_=!0,i.gopBuffer_=[],i.timeMapping_=0,i.safeAppend_=11<=Qn.browser.IE_VERSION;t={remux:!1,alignGopsAtEnd:i.safeAppend_};return i.codecs_.forEach(function(e){du(e)?i.audioCodec_=e:pu(e)&&(i.videoCodec_=e)}),i.transmuxer_=new uu,i.transmuxer_.postMessage({action:"init",options:t}),i.transmuxer_.onmessage=function(e){return"data"===e.data.action?i.data_(e):"done"===e.data.action?i.done_(e):"gopInfo"===e.data.action?i.appendGopInfo_(e):"videoSegmentTimingInfo"===e.data.action?i.videoSegmentTimingInfo_(e.data.videoSegmentTimingInfo):void 0},Object.defineProperty(i,"timestampOffset",{get:function(){return this.timestampOffset_},set:function(e){"number"==typeof e&&0<=e&&(this.timestampOffset_=e,this.appendAudioInitSegment_=!0,this.gopBuffer_.length=0,this.timeMapping_=0,this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e}))}}),Object.defineProperty(i,"appendWindowStart",{get:function(){return(this.videoBuffer_||this.audioBuffer_).appendWindowStart},set:function(e){this.videoBuffer_&&(this.videoBuffer_.appendWindowStart=e),this.audioBuffer_&&(this.audioBuffer_.appendWindowStart=e)}}),Object.defineProperty(i,"updating",{get:function(){return!!(this.bufferUpdating_||!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.updating||this.videoBuffer_&&this.videoBuffer_.updating)}}),Object.defineProperty(i,"buffered",{get:function(){return function(e,t,i){var n=null,r=null,s=0,a=[],o=[];if(!e&&!t)return Qn.createTimeRange();if(!e)return t.buffered;if(!t)return e.buffered;if(i)return e.buffered;if(0===e.buffered.length&&0===t.buffered.length)return Qn.createTimeRange();for(var u=e.buffered,l=t.buffered,c=u.length;c--;)a.push({time:u.start(c),type:"start"}),a.push({time:u.end(c),type:"end"});for(c=l.length;c--;)a.push({time:l.start(c),type:"start"}),a.push({time:l.end(c),type:"end"});for(a.sort(function(e,t){return e.time-t.time}),c=0;c<a.length;c++)"start"===a[c].type?2===++s&&(n=a[c].time):"end"===a[c].type&&1===--s&&(r=a[c].time),null!==n&&null!==r&&(o.push([n,r]),r=n=null);return Qn.createTimeRanges(o)}(this.videoBuffer_,this.audioBuffer_,this.audioDisabled_)}}),i}var gu=(tu=Qn.EventTarget,ir(yu,tu),Fe(yu,[{key:"addSeekableRange_",value:function(e,t){var i=void 0;if(this.duration!==1/0)throw(i=new Error("MediaSource.addSeekableRange() can only be invoked when the duration is Infinity")).name="InvalidStateError",i.code=11,i;(t>this.nativeMediaSource_.duration||isNaN(this.nativeMediaSource_.duration))&&(this.nativeMediaSource_.duration=t)}},{key:"addSourceBuffer",value:function(e){var t,i=void 0,n=hu(e);return/^(video|audio)\/mp2t$/i.test(n.type)?(t=[],n.parameters&&n.parameters.codecs&&(t=n.parameters.codecs.split(","),t=(t=ru(t)).filter(function(e){return du(e)||pu(e)})),0===t.length&&(t=["avc1.4d400d","mp4a.40.2"]),i=new fu(this,t),0!==this.sourceBuffers.length&&(this.sourceBuffers[0].createRealSourceBuffers_(),i.createRealSourceBuffers_(),this.sourceBuffers[0].audioDisabled_=!0)):i=this.nativeMediaSource_.addSourceBuffer(e),this.sourceBuffers.push(i),i}},{key:"dispose",value:function(){this.trigger("dispose"),this.off(),this.sourceBuffers.forEach(function(e){e.dispose&&e.dispose()}),this.sourceBuffers.length=0}}]),yu);function yu(){Ka(this,yu);var s=Qa(this,(yu.__proto__||Object.getPrototypeOf(yu)).call(this)),e=void 0;for(e in s.nativeMediaSource_=new d.MediaSource,s.nativeMediaSource_)e in yu.prototype||"function"!=typeof s.nativeMediaSource_[e]||(s[e]=s.nativeMediaSource_[e].bind(s.nativeMediaSource_));return s.duration_=NaN,Object.defineProperty(s,"duration",{get:function(){return this.duration_===1/0?this.duration_:this.nativeMediaSource_.duration},set:function(e){(this.duration_=e)!==1/0&&(this.nativeMediaSource_.duration=e)}}),Object.defineProperty(s,"seekable",{get:function(){return this.duration_===1/0?Qn.createTimeRanges([[0,this.nativeMediaSource_.duration]]):this.nativeMediaSource_.seekable}}),Object.defineProperty(s,"readyState",{get:function(){return this.nativeMediaSource_.readyState}}),Object.defineProperty(s,"activeSourceBuffers",{get:function(){return this.activeSourceBuffers_}}),s.sourceBuffers=[],s.activeSourceBuffers_=[],s.updateActiveSourceBuffers_=function(){if(s.activeSourceBuffers_.length=0,1===s.sourceBuffers.length){var e=s.sourceBuffers[0];return e.appendAudioInitSegment_=!0,e.audioDisabled_=!e.audioCodec_,void s.activeSourceBuffers_.push(e)}for(var i=!1,n=!0,t=0;t<s.player_.audioTracks().length;t++){var r=s.player_.audioTracks()[t];if(r.enabled&&"main"!==r.kind){n=!(i=!0);break}}s.sourceBuffers.forEach(function(e,t){if(e.appendAudioInitSegment_=!0,e.videoCodec_&&e.audioCodec_)e.audioDisabled_=i;else if(e.videoCodec_&&!e.audioCodec_)e.audioDisabled_=!0,n=!1;else if(!e.videoCodec_&&e.audioCodec_&&(e.audioDisabled_=t?n:!n,e.audioDisabled_))return;s.activeSourceBuffers_.push(e)})},s.onPlayerMediachange_=function(){s.sourceBuffers.forEach(function(e){e.appendAudioInitSegment_=!0})},s.onHlsReset_=function(){s.sourceBuffers.forEach(function(e){e.transmuxer_&&e.transmuxer_.postMessage({action:"resetCaptions"})})},s.onHlsSegmentTimeMapping_=function(t){s.sourceBuffers.forEach(function(e){return e.timeMapping_=t.mapping})},["sourceopen","sourceclose","sourceended"].forEach(function(e){this.nativeMediaSource_.addEventListener(e,this.trigger.bind(this))},s),s.on("sourceopen",function(e){var t=h.querySelector('[src="'+s.url_+'"]');t&&(s.player_=Qn(t.parentNode),s.player_&&(s.player_.tech_.on("hls-reset",s.onHlsReset_),s.player_.tech_.on("hls-segment-time-mapping",s.onHlsSegmentTimeMapping_),s.player_.audioTracks&&s.player_.audioTracks()&&(s.player_.audioTracks().on("change",s.updateActiveSourceBuffers_),s.player_.audioTracks().on("addtrack",s.updateActiveSourceBuffers_),s.player_.audioTracks().on("removetrack",s.updateActiveSourceBuffers_)),s.player_.on("mediachange",s.onPlayerMediachange_)))}),s.on("sourceended",function(e){for(var t=No(s.duration),i=0;i<s.sourceBuffers.length;i++){var n=s.sourceBuffers[i],n=n.metadataTrack_&&n.metadataTrack_.cues;n&&n.length&&(n[n.length-1].endTime=t)}}),s.on("sourceclose",function(e){this.sourceBuffers.forEach(function(e){e.transmuxer_&&e.transmuxer_.terminate()}),this.sourceBuffers.length=0,this.player_&&(this.player_.audioTracks&&this.player_.audioTracks()&&(this.player_.audioTracks().off("change",this.updateActiveSourceBuffers_),this.player_.audioTracks().off("addtrack",this.updateActiveSourceBuffers_),this.player_.audioTracks().off("removetrack",this.updateActiveSourceBuffers_)),this.player_.el_&&this.player_.off("mediachange",this.onPlayerMediachange_),this.player_.tech_&&this.player_.tech_.el_&&(this.player_.tech_.off("hls-reset",this.onHlsReset_),this.player_.tech_.off("hls-segment-time-mapping",this.onHlsSegmentTimeMapping_)))}),s}Qn.mediaSources={};function vu(e,t){if(!(e=Qn.mediaSources[e]))throw new Error("Media Source not found (Video.js)");e.trigger({type:"sourceopen",swfId:t})}function _u(){return!!d.MediaSource&&!!d.MediaSource.isTypeSupported&&d.MediaSource.isTypeSupported('video/mp4;codecs="avc1.4d400d,mp4a.40.2"')}var bu=function(){if(this.MediaSource={open:vu,supportsNativeMediaSources:_u},_u())return new gu;throw new Error("Cannot use create a virtual MediaSource for this video")};bu.open=vu,bu.supportsNativeMediaSources=_u;iu={createObjectURL:function(e){var t=void 0;return t=e instanceof gu?d.URL.createObjectURL(e.nativeMediaSource_):d.URL.createObjectURL(e),e.url_=t}};Qn.MediaSource=bu,Qn.URL=iu;function Tu(e,t){for(var s=void 0,a=Cu(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod}),i=0;i<t.playlists.length;i++){var n=Za(a,t.playlists[i]);n?a=n:s=!0}return Ja(t,function(e,t,i,n){var r;e.playlists&&e.playlists.length&&(r=e.playlists[0].id,(e=Za(a,e.playlists[0]))&&((a=e).mediaGroups[t][i][n].playlists[0]=a.playlists[r],s=!1))}),s?null:a}function Su(e,t){var i,n={};for(i in e){var r=e[i].sidx;if(r){var s=Eu(r);if(!t[s])break;var a=t[s].sidxInfo;wu(a,r)&&(n[s]=t[s])}}return n}function ku(e,t,i,n,r){return t={uri:qa(n.handleManifestRedirects,e.resolvedUri),byterange:e.byterange,playlist:t},i(Qn.mergeOptions(t,{responseType:"arraybuffer",headers:_o(t)}),r)}var tu=Qn.EventTarget,Cu=Qn.mergeOptions,Eu=function(e){var t=e.byterange.offset+e.byterange.length-1;return e.uri+"-"+e.byterange.offset+"-"+t},wu=function(e,t){return(Boolean(!e.map&&!t.map)||Boolean(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length))&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length},Au=(ir(Iu,tu),Fe(Iu,[{key:"setupChildLoader",value:function(e,t){this.masterPlaylistLoader_=e,this.childPlaylist_=t}},{key:"dispose",value:function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},d.clearTimeout(this.minimumUpdatePeriodTimeout_),d.clearTimeout(this.mediaRequest_),d.clearTimeout(this.mediaUpdateTimeout),this.off()}},{key:"hasPendingRequest",value:function(){return this.request||this.mediaRequest_}},{key:"stopRequest",value:function(){var e;this.request&&(e=this.request,this.request=null,e.onreadystatechange=null,e.abort())}},{key:"sidxRequestFinished_",value:function(i,n,r,s){var a=this;return function(e,t){if(a.request){if(a.request=null,e)return a.error={status:t.status,message:"DASH playlist request error at URL: "+i.uri,response:t.response,code:2},r&&(a.state=r),a.trigger("error"),s(n,null);t=new Uint8Array(t.response),t=ia.parseSidx(t.subarray(8));return s(n,t)}}}},{key:"media",value:function(i){var n=this;if(!i)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var r=this.state;if("string"==typeof i){if(!this.master.playlists[i])throw new Error("Unknown playlist URI: "+i);i=this.master.playlists[i]}var s,a,e=!this.media_||i.id!==this.media_.id;if(e&&this.loadedPlaylists_[i.id]&&this.loadedPlaylists_[i.id].endList)return this.state="HAVE_METADATA",this.media_=i,void(e&&(this.trigger("mediachanging"),this.trigger("mediachange")));e&&(this.media_&&this.trigger("mediachanging"),i.sidx?(s=e=void 0,s=this.masterPlaylistLoader_?(e=this.masterPlaylistLoader_.master,this.masterPlaylistLoader_.sidxMapping_):(e=this.master,this.sidxMapping_),a=Eu(i.sidx),s[a]={sidxInfo:i.sidx},this.request=ku(i.sidx,i,this.hls_.xhr,{handleManifestRedirects:this.handleManifestRedirects},this.sidxRequestFinished_(i,e,r,function(e,t){if(!e||!t)throw new Error("failed to request sidx");s[a].sidx=t,n.haveMetadata({startingState:r,playlist:e.playlists[i.id]})}))):this.mediaRequest_=d.setTimeout(this.haveMetadata.bind(this,{startingState:r,playlist:i}),0))}},{key:"haveMetadata",value:function(e){var t=e.startingState,e=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[e.id]=e,this.mediaRequest_=null,this.refreshMedia_(e.id),"HAVE_MASTER"===t?this.trigger("loadedmetadata"):this.trigger("mediachange")}},{key:"pause",value:function(){this.stopRequest(),d.clearTimeout(this.mediaUpdateTimeout),d.clearTimeout(this.minimumUpdatePeriodTimeout_),"HAVE_NOTHING"===this.state&&(this.started=!1)}},{key:"load",value:function(e){var t=this;d.clearTimeout(this.mediaUpdateTimeout),d.clearTimeout(this.minimumUpdatePeriodTimeout_);var i=this.media();e?(e=i?i.targetDuration/2*1e3:5e3,this.mediaUpdateTimeout=d.setTimeout(function(){return t.load()},e)):this.started?i&&!i.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}},{key:"parseMasterXml",value:function(){var r=Ps(this.masterXml_,{manifestUri:this.srcUrl,clientOffset:this.clientOffset_,sidxMapping:this.sidxMapping_});r.uri=this.srcUrl;for(var e=0;e<r.playlists.length;e++)r.playlists[e].uri="placeholder-uri-"+e;return Ja(r,function(e,t,i,n){e.playlists&&e.playlists.length&&(n=eo(0,i="placeholder-uri-"+t+"-"+i+"-"+n),e.playlists[0].uri=i,e.playlists[0].id=n,r.playlists[n]=e.playlists[0],r.playlists[i]=e.playlists[0])}),to(r),io(r),r}},{key:"start",value:function(){var i=this;this.started=!0,this.masterPlaylistLoader_?this.mediaRequest_=d.setTimeout(this.haveMaster_.bind(this),0):this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},function(e,t){if(i.request){if(i.request=null,e)return i.error={status:t.status,message:"DASH playlist request error at URL: "+i.srcUrl,responseText:t.responseText,code:2},"HAVE_NOTHING"===i.state&&(i.started=!1),i.trigger("error");i.masterXml_=t.responseText,t.responseHeaders&&t.responseHeaders.date?i.masterLoaded_=Date.parse(t.responseHeaders.date):i.masterLoaded_=Date.now(),i.srcUrl=qa(i.handleManifestRedirects,i.srcUrl,t),i.syncClientServerClock_(i.onClientServerClockSync_.bind(i))}})}},{key:"syncClientServerClock_",value:function(i){var n=this,r=xs(this.masterXml_);return null===r?(this.clientOffset_=this.masterLoaded_-Date.now(),i()):"DIRECT"===r.method?(this.clientOffset_=r.value-Date.now(),i()):void(this.request=this.hls_.xhr({uri:Xa(this.srcUrl,r.value),method:r.method,withCredentials:this.withCredentials},function(e,t){if(n.request){if(e)return n.clientOffset_=n.masterLoaded_-Date.now(),i();e=void 0,e="HEAD"===r.method?t.responseHeaders&&t.responseHeaders.date?Date.parse(t.responseHeaders.date):n.masterLoaded_:Date.parse(t.responseText);n.clientOffset_=e-Date.now(),i()}}))}},{key:"haveMaster_",value:function(){this.state="HAVE_MASTER",this.mediaRequest_=null,this.masterPlaylistLoader_?this.media_||this.media(this.childPlaylist_):(this.master=this.parseMasterXml(),this.trigger("loadedplaylist"))}},{key:"onClientServerClockSync_",value:function(){var e=this;this.haveMaster_(),this.hasPendingRequest()||this.media_||this.media(this.master.playlists[0]),this.master&&this.master.minimumUpdatePeriod&&(this.minimumUpdatePeriodTimeout_=d.setTimeout(function(){e.trigger("minimumUpdatePeriod")},this.master.minimumUpdatePeriod))}},{key:"refreshXml_",value:function(){var a=this;this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},function(e,t){if(a.request){if(a.request=null,e)return a.error={status:t.status,message:"DASH playlist request error at URL: "+a.srcUrl,responseText:t.responseText,code:2},"HAVE_NOTHING"===a.state&&(a.started=!1),a.trigger("error");var r,s;a.masterXml_=t.responseText,a.sidxMapping_=(n=a.masterXml_,e=a.srcUrl,t=a.clientOffset_,r=a.sidxMapping_,t=Ps(n,{manifestUri:e,clientOffset:t}),s=Su(t.playlists,r),Ja(t,function(e,t,i,n){e.playlists&&e.playlists.length&&(e=e.playlists,s=Cu(s,Su(e,r)))}),s);var i,n=a.parseMasterXml(),e=Tu(a.master,n),t=a.media().sidx;e&&(t?(i=Eu(t),a.sidxMapping_[i]||(t=a.media(),a.request=ku(t.sidx,t,a.hls_.xhr,{handleManifestRedirects:a.handleManifestRedirects},a.sidxRequestFinished_(t,n,a.state,function(e,t){if(!e||!t)throw new Error("failed to request sidx on minimumUpdatePeriod");a.sidxMapping_[i].sidx=t,a.minimumUpdatePeriodTimeout_=d.setTimeout(function(){a.trigger("minimumUpdatePeriod")},a.master.minimumUpdatePeriod),a.refreshMedia_(a.media().id)})))):a.master=e),a.minimumUpdatePeriodTimeout_=d.setTimeout(function(){a.trigger("minimumUpdatePeriod")},a.master.minimumUpdatePeriod)}})}},{key:"refreshMedia_",value:function(e){var t=this;if(!e)throw new Error("refreshMedia_ must take a media id");var i=void 0,n=void 0,n=this.masterPlaylistLoader_?(i=this.masterPlaylistLoader_.master,this.masterPlaylistLoader_.parseMasterXml()):(i=this.master,this.parseMasterXml()),i=Tu(i,n);i?(this.masterPlaylistLoader_?this.masterPlaylistLoader_.master=i:this.master=i,this.media_=i.playlists[e]):(this.media_=n.playlists[e],this.trigger("playlistunchanged")),this.media().endList||(this.mediaUpdateTimeout=d.setTimeout(function(){t.trigger("mediaupdatetimeout")},no(this.media(),!!i))),this.trigger("loadedplaylist")}}]),Iu);function Iu(e,t){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},n=arguments[3];Ka(this,Iu);var r=Qa(this,(Iu.__proto__||Object.getPrototypeOf(Iu)).call(this)),s=i.withCredentials,s=void 0!==s&&s,i=i.handleManifestRedirects,i=void 0!==i&&i;if(r.hls_=t,r.withCredentials=s,r.handleManifestRedirects=i,!e)throw new Error("A non-empty playlist URL or playlist is required");return r.on("minimumUpdatePeriod",function(){r.refreshXml_()}),r.on("mediaupdatetimeout",function(){r.refreshMedia_(r.media().id)}),r.state="HAVE_NOTHING",r.loadedPlaylists_={},"string"==typeof e?(r.srcUrl=e,r.sidxMapping_={},Qa(r)):(r.setupChildLoader(n,e),r)}function Pu(e){return Qn.log.debug?Qn.log.debug.bind(Qn,"VHS:",e+" >"):function(){}}function xu(){}var Lu=(Fe(Ou,[{key:"createSourceBuffer_",value:function(e,t){var i=this;this.sourceBuffer_=this.mediaSource.addSourceBuffer(e),this.logger_("created SourceBuffer"),t&&(t.trigger("sourcebufferadded"),this.mediaSource.sourceBuffers.length<2)?t.on("sourcebufferadded",function(){i.start_()}):this.start_()}},{key:"start_",value:function(){var t=this;this.started_=!0,this.onUpdateendCallback_=function(){var e=t.pendingCallback_;t.pendingCallback_=null,t.sourceBuffer_.removing=!1,t.logger_("buffered ["+Lo(t.buffered())+"]"),e&&e(),t.runCallback_()},this.sourceBuffer_.addEventListener("updateend",this.onUpdateendCallback_),this.runCallback_()}},{key:"abort",value:function(e){var t=this;this.processedAppend_&&this.queueCallback_(function(){t.sourceBuffer_.abort()},e)}},{key:"appendBuffer",value:function(e,t){var i=this;this.processedAppend_=!0,this.queueCallback_(function(){e.videoSegmentTimingInfoCallback&&i.sourceBuffer_.addEventListener("videoSegmentTimingInfo",e.videoSegmentTimingInfoCallback),i.sourceBuffer_.appendBuffer(e.bytes)},function(){e.videoSegmentTimingInfoCallback&&i.sourceBuffer_.removeEventListener("videoSegmentTimingInfo",e.videoSegmentTimingInfoCallback),t()})}},{key:"buffered",value:function(){return this.sourceBuffer_?this.sourceBuffer_.buffered:Qn.createTimeRanges()}},{key:"remove",value:function(e,t){var i=this;this.processedAppend_&&this.queueCallback_(function(){i.logger_("remove ["+e+" => "+t+"]"),i.sourceBuffer_.removing=!0,i.sourceBuffer_.remove(e,t)},2<arguments.length&&void 0!==arguments[2]?arguments[2]:xu)}},{key:"updating",value:function(){return!this.sourceBuffer_||this.sourceBuffer_.updating||!!this.pendingCallback_&&this.pendingCallback_!==xu}},{key:"timestampOffset",value:function(e){var t=this;return void 0!==e&&(this.queueCallback_(function(){t.sourceBuffer_.timestampOffset=e,t.runCallback_()}),this.timestampOffset_=e),this.timestampOffset_}},{key:"queueCallback_",value:function(e,t){this.callbacks_.push([e.bind(this),t]),this.runCallback_()}},{key:"runCallback_",value:function(){var e=void 0;!this.updating()&&this.callbacks_.length&&this.started_&&(e=this.callbacks_.shift(),this.pendingCallback_=e[1],e[0]())}},{key:"dispose",value:function(){function e(){t.sourceBuffer_&&"open"===t.mediaSource.readyState&&t.sourceBuffer_.abort(),t.sourceBuffer_.removeEventListener("updateend",e)}var t=this;this.sourceBuffer_.removeEventListener("updateend",this.onUpdateendCallback_),this.sourceBuffer_.removing?this.sourceBuffer_.addEventListener("updateend",e):e()}}]),Ou);function Ou(e,t,i,n){Ka(this,Ou),this.callbacks_=[],this.pendingCallback_=null,this.timestampOffset_=0,this.mediaSource=e,this.processedAppend_=!1,this.type_=i,this.mimeType_=t,this.logger_=Pu("SourceUpdater["+i+"]["+t+"]"),"closed"===e.readyState?e.addEventListener("sourceopen",this.createSourceBuffer_.bind(this,t,n)):this.createSourceBuffer_(t,n)}function Du(e,t,i,n,r,s,a){var o,u,l,c,h,d,p,f,m,g,y,v,_,b,T,S,k=[],a=(o=k,u=i,l=a,c=0,h=!1,function(e,t){if(!h)return e?(h=!0,ju(o),l(e,t)):(c+=1)===o.length?(t.endOfAllRequests=Date.now(),t.encryptedBytes?qu(u,t,l):l(null,t)):void 0});return r.key&&!r.key.bytes&&(f=e(Qn.mergeOptions(t,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),(d=r,p=a,function(e,t){var i=t.response,e=Vu(e,t);if(e)return p(e,d);if(16!==i.byteLength)return p({status:t.status,message:"Invalid HLS key at URL: "+t.uri,code:Bu.FAILURE,xhr:t},d);i=new DataView(i);return d.key.bytes=new Uint32Array([i.getUint32(0),i.getUint32(4),i.getUint32(8),i.getUint32(12)]),p(null,d)})),k.push(f)),r.map&&!r.map.bytes&&(f=e(Qn.mergeOptions(t,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:_o(r.map)}),(m=r,g=n,y=a,function(e,t){var i=t.response,e=Vu(e,t);return e?y(e,m):0===i.byteLength?y({status:t.status,message:"Empty HLS segment content at URL: "+t.uri,code:Bu.FAILURE,xhr:t},m):(m.map.bytes=new Uint8Array(t.response),g&&!g.isInitialized()&&g.init(),m.map.timescales=sa.timescale(m.map.bytes),m.map.videoTrackIds=sa.videoTrackIds(m.map.bytes),y(null,m))})),k.push(f)),(a=e(Qn.mergeOptions(t,{uri:r.resolvedUri,responseType:"arraybuffer",headers:_o(r)}),(v=r,_=n,b=a,function(e,t){var i=t.response,n=Vu(e,t),e=void 0;return n?b(n,v):0===i.byteLength?b({status:t.status,message:"Empty HLS segment content at URL: "+t.uri,code:Bu.FAILURE,xhr:t},v):(v.stats=Fu(t),v.key?v.encryptedBytes=new Uint8Array(t.response):v.bytes=new Uint8Array(t.response),_&&v.map&&v.map.bytes&&(_.isInitialized()||_.init(),(e=_.parse(v.bytes,v.map.videoTrackIds,v.map.timescales))&&e.captions&&(v.captionStreams=e.captionStreams,v.fmp4Captions=e.captions)),b(null,v))}))).addEventListener("progress",(T=r,S=s,function(e){return T.stats=Qn.mergeOptions(T.stats,Hu(e)),!T.stats.firstBytesReceivedAt&&T.stats.bytesReceived&&(T.stats.firstBytesReceivedAt=Date.now()),S(e,T)})),k.push(a),function(){return ju(k)}}function Nu(e,t){var i;return e&&(i=d.getComputedStyle(e))?i[t]:""}function Ru(e,t){var i=void 0,n=void 0;return(i=(i=e.attributes.BANDWIDTH?e.attributes.BANDWIDTH:i)||d.Number.MAX_VALUE)-(n=(n=t.attributes.BANDWIDTH?t.attributes.BANDWIDTH:n)||d.Number.MAX_VALUE)}function Uu(e){return"number"==typeof e&&isFinite(e)}var Mu={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,BUFFER_LOW_WATER_LINE_RATE:1},Bu={FAILURE:2,TIMEOUT:-101,ABORTED:-102},ju=function(e){e.forEach(function(e){e.abort()})},Fu=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}},Hu=function(e){var t=e.target,t={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return t.bytesReceived=e.loaded,t.bandwidth=Math.floor(t.bytesReceived/t.roundTripTime*8*1e3),t},Vu=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Bu.TIMEOUT,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Bu.ABORTED,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:Bu.FAILURE,xhr:t}:null},qu=function(i,n,r){var e=function e(t){if(t.data.source===n.requestId){i.removeEventListener("message",e);t=t.data.decrypted;return n.bytes=new Uint8Array(t.bytes,t.byteOffset,t.byteLength),r(null,n)}};i.addEventListener("message",e);e=void 0,e=n.key.bytes.slice?n.key.bytes.slice():new Uint32Array(Array.prototype.slice.call(n.key.bytes));i.postMessage(So({source:n.requestId,encrypted:n.encryptedBytes,key:e,iv:n.key.iv}),[n.encryptedBytes.buffer,e.buffer])},Wu=function(e,n){var r=e.slice();e.sort(function(e,t){var i=n(e,t);return 0===i?r.indexOf(e)-r.indexOf(t):i})},zu=(tu=Qn.EventTarget,ir(Gu,tu),Fe(Gu,[{key:"resetStats_",value:function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0}},{key:"dispose",value:function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.sourceUpdater_&&this.sourceUpdater_.dispose(),this.resetStats_(),this.captionParser_&&this.captionParser_.reset(),this.checkBufferTimeout_&&d.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}},{key:"abort",value:function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)}},{key:"abort_",value:function(){this.pendingSegment_&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null}},{key:"error",value:function(e){return void 0!==e&&(this.error_=e),this.pendingSegment_=null,this.error_}},{key:"endOfStream",value:function(){this.ended_=!0,this.pause(),this.trigger("ended")}},{key:"buffered_",value:function(){return this.sourceUpdater_?this.sourceUpdater_.buffered():Qn.createTimeRanges()}},{key:"initSegment",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1];if(!e)return null;var i=ko(e),n=this.initSegments_[i];return t&&!n&&e.bytes&&(this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,timescales:e.timescales,videoTrackIds:e.videoTrackIds}),n||e}},{key:"segmentKey",value:function(e){if(!e)return null;var t=Co(e),i=this.keyCache_[t];this.cacheEncryptionKeys_&&(1<arguments.length&&void 0!==arguments[1]&&arguments[1])&&!i&&e.bytes&&(this.keyCache_[t]=i={resolvedUri:e.resolvedUri,bytes:e.bytes});e={resolvedUri:(i||e).resolvedUri};return i&&(e.bytes=i.bytes),e}},{key:"couldBeginLoading_",value:function(){return this.playlist_&&(this.sourceUpdater_||this.mimeType_&&"INIT"===this.state)&&!this.paused()}},{key:"load",value:function(){if(this.monitorBuffer_(),this.playlist_){if(this.syncController_.setDateTimeMapping(this.playlist_),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY")}}},{key:"init_",value:function(){return this.state="READY",this.sourceUpdater_=new Lu(this.mediaSource_,this.mimeType_,this.loaderType_,this.sourceBufferEmitter_),this.resetEverything(),this.monitorBuffer_()}},{key:"playlist",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(e){var i=this.playlist_,n=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0});t=null;if(i&&(i.id?t=i.id:i.uri&&(t=i.uri)),this.logger_("playlist update ["+t+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();i&&i.uri===e.uri?(t=e.mediaSequence-i.mediaSequence,this.logger_("live window shift ["+t+"]"),null!==this.mediaIndex&&(this.mediaIndex-=t),n&&(n.mediaIndex-=t,0<=n.mediaIndex&&(n.segment=e.segments[n.mediaIndex])),this.syncController_.saveExpiredSegmentInfo(i,e)):null!==this.mediaIndex&&this.resyncLoader()}}},{key:"pause",value:function(){this.checkBufferTimeout_&&(d.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}},{key:"paused",value:function(){return null===this.checkBufferTimeout_}},{key:"mimeType",value:function(e,t){this.mimeType_||(this.mimeType_=e,this.sourceBufferEmitter_=t,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_())}},{key:"resetEverything",value:function(e){this.ended_=!1,this.resetLoader(),this.remove(0,1/0,e),this.captionParser_&&this.captionParser_.clearAllCaptions(),this.trigger("reseteverything")}},{key:"resetLoader",value:function(){this.fetchAtBuffer_=!1,this.resyncLoader()}},{key:"resyncLoader",value:function(){this.mediaIndex=null,this.syncPoint_=null,this.abort()}},{key:"remove",value:function(e,t,i){if(t===1/0&&(t=this.duration_()),this.sourceUpdater_&&this.sourceUpdater_.remove(e,t,i),Do(e,t,this.segmentMetadataTrack_),this.inbandTextTracks_)for(var n in this.inbandTextTracks_)Do(e,t,this.inbandTextTracks_[n])}},{key:"monitorBuffer_",value:function(){this.checkBufferTimeout_&&d.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=d.setTimeout(this.monitorBufferTick_.bind(this),1)}},{key:"monitorBufferTick_",value:function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&d.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=d.setTimeout(this.monitorBufferTick_.bind(this),500)}},{key:"fillBuffer_",value:function(){var e;this.sourceUpdater_.updating()||(this.syncPoint_||(this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_())),(e=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_))&&(this.isEndOfStream_(e.mediaIndex)?this.endOfStream():e.mediaIndex===this.playlist_.segments.length-1&&"ended"===this.mediaSource_.readyState&&!this.seeking_()||(e.timeline!==this.currentTimeline_&&(this.syncController_.reset(),e.timestampOffset=e.startOfSegment,this.captionParser_&&this.captionParser_.clearAllCaptions()),this.loadSegment_(e))))}},{key:"isEndOfStream_",value:function(e){return function(e,t,i){if(!e||!t)return!1;i=i===e.segments.length;return e.endList&&"open"===t.readyState&&i}(1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.playlist_,this.mediaSource_,e)&&!this.sourceUpdater_.updating()}},{key:"checkBuffer_",value:function(e,t,i,n,r,s){var a=0,o=void 0;e.length&&(a=e.end(e.length-1));e=Math.max(0,a-r);if(!t.segments.length)return null;if(e>=this.goalBufferLength_())return null;if(!n&&1<=e)return null;if(null===s)return i=this.getSyncSegmentCandidate_(t),this.generateSegmentInfo_(t,i,null,!0);if(null===i)return o=this.fetchAtBuffer_?(i=(e=Wo.getMediaInfoForTime(t,a,s.segmentIndex,s.time)).mediaIndex,e.startTime):(i=(s=Wo.getMediaInfoForTime(t,r,s.segmentIndex,s.time)).mediaIndex,s.startTime),this.generateSegmentInfo_(t,i,o,!1);t.segments[i];o=a;return this.generateSegmentInfo_(t,i+1,o,!1)}},{key:"getSyncSegmentCandidate_",value:function(e){var t=this;if(-1===this.currentTimeline_)return 0;var i=e.segments.map(function(e,t){return{timeline:e.timeline,segmentIndex:t}}).filter(function(e){return e.timeline===t.currentTimeline_});return i.length?i[Math.min(i.length-1,1)].segmentIndex:Math.max(e.segments.length-1,0)}},{key:"generateSegmentInfo_",value:function(e,t,i,n){if(t<0||t>=e.segments.length)return null;var r=e.segments[t];return{requestId:"segment-loader-"+Math.random(),uri:r.resolvedUri,mediaIndex:t,isSyncRequest:n,startOfSegment:i,playlist:e,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:r.timeline,duration:r.duration,segment:r}}},{key:"abortRequestEarly_",value:function(e){if(this.hls_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)return!1;if(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return!1;var t=this.currentTime_(),i=e.bandwidth,n=this.pendingSegment_.duration,r=Wo.estimateSegmentRequestTime(n,i,this.playlist_,e.bytesReceived),e=function(e,t){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1;return((e.length?e.end(e.length-1):0)-t)/i}(this.buffered_(),t,this.hls_.tech_.playbackRate())-1;if(r<=e)return!1;var s,a,o,u,l,c,h,i=(i={master:this.hls_.playlists.master,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:n,timeUntilRebuffer:e,currentTimeline:this.currentTimeline_,syncController:this.syncController_},n=i.master,s=i.currentTime,a=i.bandwidth,o=i.duration,u=i.segmentDuration,l=i.timeUntilRebuffer,c=i.currentTimeline,h=i.syncController,n=(i=(n=!(n=(i=n.playlists.filter(function(e){return!Wo.isIncompatible(e)})).filter(Wo.isEnabled)).length?i.filter(function(e){return!Wo.isDisabled(e)}):n).filter(Wo.hasAttribute.bind(null,"BANDWIDTH")).map(function(e){var t=h.getSyncPoint(e,o,c,s)?1:2;return{playlist:e,rebufferingImpact:Wo.estimateSegmentRequestTime(u,a,e)*t-l}})).filter(function(e){return e.rebufferingImpact<=0}),Wu(n,function(e,t){return Ru(t.playlist,e.playlist)}),n.length?n[0]:(Wu(i,function(e,t){return e.rebufferingImpact-t.rebufferingImpact}),i[0]||null));if(i){r=r-e-i.rebufferingImpact,e=e<=1/30?1:.5;return!i.playlist||i.playlist.uri===this.playlist_.uri||r<e?!1:(this.bandwidth=i.playlist.attributes.BANDWIDTH*Mu.BANDWIDTH_VARIANCE+1,this.abort(),this.trigger("earlyabort"),!0)}}},{key:"handleProgress_",value:function(e,t){this.pendingSegment_&&t.requestId===this.pendingSegment_.requestId&&!this.abortRequestEarly_(t.stats)&&this.trigger("progress")}},{key:"loadSegment_",value:function(e){this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),e.abortRequests=Du(this.hls_.xhr,this.xhrOptions_,this.decrypter_,this.captionParser_,this.createSimplifiedSegmentObj_(e),this.handleProgress_.bind(this),this.segmentRequestFinished_.bind(this))}},{key:"trimBackBuffer_",value:function(e){var t,i,n,r,r=(t=this.seekable_(),i=this.currentTime_(),n=this.playlist_.targetDuration||10,r=i-30,t.length&&(r=Math.max(r,t.start(0))),Math.min(i-n,r));0<r&&this.remove(0,r)}},{key:"createSimplifiedSegmentObj_",value:function(e){var t=e.segment,i={resolvedUri:t.resolvedUri,byterange:t.byterange,requestId:e.requestId};return t.key&&(e=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]),i.key=this.segmentKey(t.key),i.key.iv=e),t.map&&(i.map=this.initSegment(t.map)),i}},{key:"segmentRequestFinished_",value:function(e,t){if(this.mediaRequests+=1,t.stats&&(this.mediaBytesTransferred+=t.stats.bytesReceived,this.mediaTransferDuration+=t.stats.roundTripTime),this.pendingSegment_){if(t.requestId===this.pendingSegment_.requestId){if(e)return this.pendingSegment_=null,this.state="READY",e.code===Bu.ABORTED?void(this.mediaRequestsAborted+=1):(this.pause(),e.code===Bu.TIMEOUT?(this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,void this.trigger("bandwidthupdate")):(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error")));this.bandwidth=t.stats.bandwidth,this.roundTrip=t.stats.roundTripTime,t.map&&(t.map=this.initSegment(t.map,!0)),t.key&&this.segmentKey(t.key,!0),this.processSegmentResponse_(t)}}else this.mediaRequestsAborted+=1}},{key:"processSegmentResponse_",value:function(e){var r,s,a,t=this.pendingSegment_;t.bytes=e.bytes,e.map&&(t.segment.map.bytes=e.map.bytes),t.endOfAllRequests=e.endOfAllRequests,e.fmp4Captions&&(function(e,t,i){for(var n in i){var r;e[n]||(t.trigger({type:"usage",name:"hls-608"}),r=t.textTracks().getTrackById(n),e[n]=r||t.addRemoteTextTrack({kind:"captions",id:n,label:n},!1).track)}}(this.inbandTextTracks_,this.hls_.tech_,e.captionStreams),t={inbandTextTracks:this.inbandTextTracks_,captionArray:e.fmp4Captions,timestampOffset:0},s=t.inbandTextTracks,e=t.captionArray,a=t.timestampOffset,e&&(r=window.WebKitDataCue||window.VTTCue,e.forEach(function(e){var t=e.stream,i=e.startTime,n=e.endTime;s[t]&&s[t].addCue(new r(i+=a,n+=a,e.text))})),this.captionParser_&&this.captionParser_.clearParsedCaptions()),this.handleSegment_()}},{key:"handleSegment_",value:function(){var e=this;if(this.pendingSegment_){var t=this.pendingSegment_,i=t.segment,n=this.syncController_.probeSegmentInfo(t);void 0===this.startingMedia_&&n&&(n.containsAudio||n.containsVideo)&&(this.startingMedia_={containsAudio:n.containsAudio,containsVideo:n.containsVideo});var r,s=(r=this.loaderType_,s=this.startingMedia_,c=n,"main"===r&&s&&c?c.containsAudio||c.containsVideo?s.containsVideo&&!c.containsVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!s.containsVideo&&c.containsVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null);if(s)return this.error({message:s,blacklistDuration:1/0}),void this.trigger("error");if(t.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");null!==t.timestampOffset&&t.timestampOffset!==this.sourceUpdater_.timestampOffset()&&(n&&n.segmentTimestampInfo&&(o=n.segmentTimestampInfo[0].ptsTime,u=n.segmentTimestampInfo[0].dtsTime,t.timestampOffset-=o-u),this.sourceUpdater_.timestampOffset(t.timestampOffset),this.trigger("timestampoffset"));var a,s,o,u,l,c=this.syncController_.mappingForTimeline(t.timeline);null!==c&&this.trigger({type:"segmenttimemapping",mapping:c}),this.state="APPENDING",i.map&&(a=ko(i.map),this.activeInitSegmentId_&&this.activeInitSegmentId_===a||(l=this.initSegment(i.map),this.sourceUpdater_.appendBuffer({bytes:l.bytes},function(){e.activeInitSegmentId_=a}))),t.byteLength=t.bytes.byteLength,"number"==typeof i.start&&"number"==typeof i.end?this.mediaSecondsLoaded+=i.end-i.start:this.mediaSecondsLoaded+=i.duration,this.logger_((n=(s=t).segment,o=n.start,u=n.end,c=t.playlist,l=c.mediaSequence,i=c.id,n=c.segments,c=t.mediaIndex,s=t.timeline,["appending ["+c+"] of ["+l+", "+(l+(void 0===n?[]:n).length)+"] from playlist ["+i+"]","["+o+" => "+u+"] in timeline ["+s+"]"].join(" "))),this.sourceUpdater_.appendBuffer({bytes:t.bytes,videoSegmentTimingInfoCallback:this.handleVideoSegmentTimingInfo_.bind(this,t.requestId)},this.handleUpdateEnd_.bind(this))}else this.state="READY"}},{key:"handleVideoSegmentTimingInfo_",value:function(e,t){this.pendingSegment_&&e===this.pendingSegment_.requestId&&((e=this.pendingSegment_.segment).videoTimingInfo||(e.videoTimingInfo={}),e.videoTimingInfo.transmuxerPrependedSeconds=t.videoSegmentTimingInfo.prependedContentDuration||0,e.videoTimingInfo.transmuxedPresentationStart=t.videoSegmentTimingInfo.start.presentation,e.videoTimingInfo.transmuxedPresentationEnd=t.videoSegmentTimingInfo.end.presentation,e.videoTimingInfo.baseMediaDecodeTime=t.videoSegmentTimingInfo.baseMediaDecodeTime)}},{key:"handleUpdateEnd_",value:function(){if(!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_,t=e.segment,i=null!==this.mediaIndex;this.pendingSegment_=null,this.recordThroughput_(e),this.addSegmentMetadataCue_(e),this.state="READY",this.mediaIndex=e.mediaIndex,this.fetchAtBuffer_=!0,this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate"),t.end&&this.currentTime_()-t.end>3*e.playlist.targetDuration?this.resetEverything():(i&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.isEndOfStream_(e.mediaIndex+1,e.playlist)&&this.endOfStream(),this.paused()||this.monitorBuffer_())}},{key:"recordThroughput_",value:function(e){var t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,i=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(i-t)/++this.throughput.count}},{key:"addSegmentMetadataCue_",value:function(e){var t,i,n,r;this.segmentMetadataTrack_&&(i=(t=e.segment).start,r=t.end,Uu(i)&&Uu(r)&&(Do(i,r,this.segmentMetadataTrack_),n=d.WebKitDataCue||d.VTTCue,e={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:i,end:r},(r=new n(i,r,JSON.stringify(e))).value=e,this.segmentMetadataTrack_.addCue(r)))}}]),Gu);function Gu(e){Ka(this,Gu);var t=Qa(this,(Gu.__proto__||Object.getPrototypeOf(Gu)).call(this));if(!e)throw new TypeError("Initialization settings are required");if("function"!=typeof e.currentTime)throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");return t.bandwidth=e.bandwidth,t.throughput={rate:0,count:0},t.roundTrip=NaN,t.resetStats_(),t.mediaIndex=null,t.hasPlayed_=e.hasPlayed,t.currentTime_=e.currentTime,t.seekable_=e.seekable,t.seeking_=e.seeking,t.duration_=e.duration,t.mediaSource_=e.mediaSource,t.hls_=e.hls,t.loaderType_=e.loaderType,t.startingMedia_=void 0,t.segmentMetadataTrack_=e.segmentMetadataTrack,t.goalBufferLength_=e.goalBufferLength,t.sourceType_=e.sourceType,t.inbandTextTracks_=e.inbandTextTracks,t.state_="INIT",t.checkBufferTimeout_=null,t.error_=void 0,t.currentTimeline_=-1,t.pendingSegment_=null,t.mimeType_=null,t.sourceUpdater_=null,t.xhrOptions_=null,t.activeInitSegmentId_=null,t.initSegments_={},t.cacheEncryptionKeys_=e.cacheEncryptionKeys,t.keyCache_={},"main"===t.loaderType_?t.captionParser_=new ba:t.captionParser_=null,t.decrypter_=e.decrypter,t.syncController_=e.syncController,t.syncPoint_={segmentIndex:0,time:0},t.triggerSyncInfoUpdate_=function(){return t.trigger("syncinfoupdate")},t.syncController_.on("syncinfoupdate",t.triggerSyncInfoUpdate_),t.mediaSource_.addEventListener("sourceopen",function(){return t.ended_=!1}),t.fetchAtBuffer_=!1,t.logger_=Pu("SegmentLoader["+t.loaderType_+"]"),Object.defineProperty(t,"state",{get:function(){return this.state_},set:function(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e)}}),t}function Xu(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))}var Ku=new Uint8Array("\n\n".split("").map(function(e){return e.charCodeAt(0)})),Yu=(ir($u,zu),Fe($u,[{key:"buffered_",value:function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues.length)return Qn.createTimeRanges();var e=this.subtitlesTrack_.cues,t=e[0].startTime,e=e[e.length-1].startTime;return Qn.createTimeRanges([[t,e]])}},{key:"initSegment",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1];if(!e)return null;var i=ko(e),n=this.initSegments_[i];return t&&!n&&e.bytes&&(t=Ku.byteLength+e.bytes.byteLength,(t=new Uint8Array(t)).set(e.bytes),t.set(Ku,e.bytes.byteLength),this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:t}),n||e}},{key:"couldBeginLoading_",value:function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}},{key:"init_",value:function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}},{key:"track",value:function(e){return void 0===e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}},{key:"remove",value:function(e,t){Do(e,t,this.subtitlesTrack_)}},{key:"fillBuffer_",value:function(){var e=this;this.syncPoint_||(this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_()));var t=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(t=this.skipEmptySegments_(t)){if(null===this.syncController_.timestampOffsetForTimeline(t.timeline))return this.syncController_.one("timestampoffset",function(){e.state="READY",e.paused()||e.monitorBuffer_()}),void(this.state="WAITING_ON_TIMELINE");this.loadSegment_(t)}}},{key:"skipEmptySegments_",value:function(e){for(;e&&e.segment.empty;)e=this.generateSegmentInfo_(e.playlist,e.mediaIndex+1,e.startOfSegment+e.duration,e.isSyncRequest);return e}},{key:"handleSegment_",value:function(){var t=this;if(this.pendingSegment_&&this.subtitlesTrack_){this.state="APPENDING";var e=this.pendingSegment_,i=e.segment;if("function"!=typeof d.WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var n=void 0,r=function(){t.subtitlesTrack_.tech_.off("vttjsloaded",n),t.error({message:"Error loading vtt.js"}),t.state="READY",t.pause(),t.trigger("error")},n=function(){t.subtitlesTrack_.tech_.off("vttjserror",r),t.handleSegment_()};return this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",n),void this.subtitlesTrack_.tech_.one("vttjserror",r)}i.requested=!0;try{this.parseVTTCues_(e)}catch(e){return this.error({message:e.message}),this.state="READY",this.pause(),this.trigger("error")}if(this.updateTimeMapping_(e,this.syncController_.timelines[e.timeline],this.playlist_),e.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");e.byteLength=e.bytes.byteLength,this.mediaSecondsLoaded+=i.duration,e.cues.length&&this.remove(e.cues[0].endTime,e.cues[e.cues.length-1].endTime),e.cues.forEach(function(e){t.subtitlesTrack_.addCue(t.featuresNativeTextTracks_?new d.VTTCue(e.startTime,e.endTime,e.text):e)}),this.handleUpdateEnd_()}else this.state="READY"}},{key:"parseVTTCues_",value:function(t){var e=void 0,i=!1;"function"==typeof d.TextDecoder?e=new d.TextDecoder("utf8"):(e=d.WebVTT.StringDecoder(),i=!0);e=new d.WebVTT.Parser(d,d.vttjs,e);t.cues=[],t.timestampmap={MPEGTS:0,LOCAL:0},e.oncue=t.cues.push.bind(t.cues),e.ontimestampmap=function(e){return t.timestampmap=e},e.onparsingerror=function(e){Qn.log.warn("Error encountered when parsing cues: "+e.message)},t.segment.map&&(n=t.segment.map.bytes,i&&(n=Xu(n)),e.parse(n));var n=t.bytes;i&&(n=Xu(n)),e.parse(n),e.flush()}},{key:"updateTimeMapping_",value:function(e,t,i){var n,r,s=e.segment;t&&(e.cues.length?(r=e.timestampmap,n=r.MPEGTS/9e4-r.LOCAL+t.mapping,e.cues.forEach(function(e){e.startTime+=n,e.endTime+=n}),i.syncInfo||(r=e.cues[0].startTime,t=e.cues[e.cues.length-1].startTime,i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(r,t-s.duration)})):s.empty=!0)}}]),$u);function $u(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};Ka(this,$u);t=Qa(this,($u.__proto__||Object.getPrototypeOf($u)).call(this,e,t));return t.mediaSource_=null,t.subtitlesTrack_=null,t.featuresNativeTextTracks_=e.featuresNativeTextTracks,t}var Qu=He,Ju=[{name:"VOD",run:function(e,t,i,n,r){if(i===1/0)return null;return{time:0,segmentIndex:0}}},{name:"ProgramDateTime",run:function(e,t,i,n,r){if(!e.datetimeToDisplayTime)return null;var s=t.segments||[],a=null,o=null;r=r||0;for(var u=0;u<s.length;u++){var l=s[u];if(l.dateTimeObject){var c=l.dateTimeObject.getTime()/1e3+e.datetimeToDisplayTime,l=Math.abs(r-c);if(null!==o&&(0===l||o<l))break;o=l,a={time:c,segmentIndex:u}}}return a}},{name:"Segment",run:function(e,t,i,n,r){var s=t.segments||[],a=null,o=null;r=r||0;for(var u=0;u<s.length;u++){var l=s[u];if(l.timeline===n&&void 0!==l.start){var c=Math.abs(r-l.start);if(null!==o&&o<c)break;(!a||null===o||c<=o)&&(o=c,a={time:l.start,segmentIndex:u})}}return a}},{name:"Discontinuity",run:function(e,t,i,n,r){var s=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var a=null,o=0;o<t.discontinuityStarts.length;o++){var u=t.discontinuityStarts[o],l=t.discontinuitySequence+o+1,c=e.discontinuities[l];if(c){l=Math.abs(r-c.time);if(null!==a&&a<l)break;(!s||null===a||l<=a)&&(a=l,s={time:c.time,segmentIndex:u})}}return s}},{name:"Playlist",run:function(e,t,i,n,r){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence}:null}}],Zu=(He=Qn.EventTarget,ir(el,He),Fe(el,[{key:"getSyncPoint",value:function(e,t,i,n){i=this.runStrategies_(e,t,i,n);return i.length?this.selectSyncPoint_(i,{key:"time",value:n}):null}},{key:"getExpiredTime",value:function(e,t){if(!e||!e.segments)return null;t=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!t.length)return null;t=this.selectSyncPoint_(t,{key:"segmentIndex",value:0});return 0<t.segmentIndex&&(t.time*=-1),Math.abs(t.time+lo(e,t.segmentIndex,0))}},{key:"runStrategies_",value:function(e,t,i,n){for(var r=[],s=0;s<Ju.length;s++){var a=Ju[s],o=a.run(this,e,t,i,n);o&&(o.strategy=a.name,r.push({strategy:a.name,syncPoint:o}))}return r}},{key:"selectSyncPoint_",value:function(e,t){for(var i=e[0].syncPoint,n=Math.abs(e[0].syncPoint[t.key]-t.value),r=e[0].strategy,s=1;s<e.length;s++){var a=Math.abs(e[s].syncPoint[t.key]-t.value);a<n&&(n=a,i=e[s].syncPoint,r=e[s].strategy)}return this.logger_("syncPoint for ["+t.key+": "+t.value+"] chosen with strategy ["+r+"]: [time:"+i.time+", segmentIndex:"+i.segmentIndex+"]"),i}},{key:"saveExpiredSegmentInfo",value:function(e,t){for(var i=t.mediaSequence-e.mediaSequence-1;0<=i;i--){var n=e.segments[i];if(n&&void 0!==n.start){t.syncInfo={mediaSequence:e.mediaSequence+i,time:n.start},this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+", mediaSequence: "+t.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}}},{key:"setDateTimeMapping",value:function(e){!this.datetimeToDisplayTime&&e.segments&&e.segments.length&&e.segments[0].dateTimeObject&&(e=e.segments[0].dateTimeObject.getTime()/1e3,this.datetimeToDisplayTime=-e)}},{key:"reset",value:function(){this.inspectCache_=void 0}},{key:"probeSegmentInfo",value:function(e){var t=e.segment,i=e.playlist,n=void 0;return(n=t.map?this.probeMp4Segment_(e):this.probeTsSegment_(e))&&this.calculateSegmentTimeMapping_(e,n)&&(this.saveDiscontinuitySyncInfo_(e),i.syncInfo||(i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:t.start})),n}},{key:"probeMp4Segment_",value:function(e){var t=e.segment,i=sa.timescale(t.map.bytes),i=sa.compositionStartTime(i,e.bytes);return null!==e.timestampOffset&&(e.timestampOffset-=i),{start:i,end:i+t.duration}}},{key:"probeTsSegment_",value:function(e){var t=Qu(e.bytes,this.inspectCache_),i=void 0,n=void 0,e=void 0;return t?(t.video&&2===t.video.length?(this.inspectCache_=t.video[1].dts,i=t.video[0].dtsTime,n=t.video[1].dtsTime,e=t.video):t.audio&&2===t.audio.length&&(this.inspectCache_=t.audio[1].dts,i=t.audio[0].dtsTime,n=t.audio[1].dtsTime,e=t.audio),{segmentTimestampInfo:e,start:i,end:n,containsVideo:t.video&&2===t.video.length,containsAudio:t.audio&&2===t.audio.length}):null}},{key:"timestampOffsetForTimeline",value:function(e){return void 0===this.timelines[e]?null:this.timelines[e].time}},{key:"mappingForTimeline",value:function(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping}},{key:"calculateSegmentTimeMapping_",value:function(e,t){var i=e.segment,n=this.timelines[e.timeline];if(null!==e.timestampOffset)n={time:e.startOfSegment,mapping:e.startOfSegment-t.start},this.timelines[e.timeline]=n,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+n.time+"] [mapping: "+n.mapping+"]"),i.start=e.startOfSegment,i.end=t.end+n.mapping;else{if(!n)return!1;i.start=t.start+n.mapping,i.end=t.end+n.mapping}return!0}},{key:"saveDiscontinuitySyncInfo_",value:function(e){var t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(var n=0;n<t.discontinuityStarts.length;n++){var r,s=t.discontinuityStarts[n],a=t.discontinuitySequence+n+1,o=s-e.mediaIndex,u=Math.abs(o);(!this.discontinuities[a]||this.discontinuities[a].accuracy>u)&&(r=void 0,r=o<0?i.start-lo(t,e.mediaIndex,s):i.end+lo(t,e.mediaIndex+1,s),this.discontinuities[a]={time:r,accuracy:u})}}},{key:"dispose",value:function(){this.trigger("dispose"),this.off()}}]),el);function el(){Ka(this,el);var e=Qa(this,(el.__proto__||Object.getPrototypeOf(el)).call(this));return e.inspectCache_=void 0,e.timelines=[],e.discontinuities=[],e.datetimeToDisplayTime=null,e.logger_=Pu("SyncController"),e}function tl(t){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(e){ol[e](e,t)});var i=t.mediaTypes,e=t.masterPlaylistLoader,n=t.tech,r=t.hls;["AUDIO","SUBTITLES"].forEach(function(e){var r,s,a,o,u,l;i[e].activeGroup=(r=e,s=t,function(t){var e=s.masterPlaylistLoader,i=s.mediaTypes[r].groups,n=e.media();if(!n)return null;e=null,e=(e=n.attributes[r]?i[n.attributes[r]]:e)||i.main;return void 0===t?e:null!==t&&e.filter(function(e){return e.id===t.id})[0]||null}),i[e].activeTrack=ul[e](e,t),i[e].onGroupChanged=(a=e,o=t,function(){var e=o.segmentLoaders,t=e[a],i=e.main,n=o.mediaTypes[a],r=n.activeTrack(),e=n.activeGroup(r),r=n.activePlaylistLoader;nl(t,n),e&&(e.playlistLoader?(t.resyncLoader(),rl(e.playlistLoader,n)):r&&i.resetEverything())}),i[e].onTrackChanged=(u=e,l=t,function(){var e=l.segmentLoaders,t=e[u],i=e.main,n=l.mediaTypes[u],r=n.activeTrack(),s=n.activeGroup(r),e=n.activePlaylistLoader;nl(t,n),s&&(s.playlistLoader?(e!==s.playlistLoader&&(t.track&&t.track(r),t.resetEverything()),rl(s.playlistLoader,n)):i.resetEverything())})});var s,a=((a=i.AUDIO.activeGroup()).filter(function(e){return e.default})[0]||a[0]).id;function o(){i.AUDIO.onTrackChanged(),n.trigger({type:"usage",name:"hls-audio-change"})}for(s in i.AUDIO.tracks[a].enabled=!0,i.AUDIO.onTrackChanged(),e.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(e){return i[e].onGroupChanged()})}),n.audioTracks().addEventListener("change",o),n.remoteTextTracks().addEventListener("change",i.SUBTITLES.onTrackChanged),r.on("dispose",function(){n.audioTracks().removeEventListener("change",o),n.remoteTextTracks().removeEventListener("change",i.SUBTITLES.onTrackChanged)}),n.clearTracks("audio"),i.AUDIO.tracks)n.audioTracks().addTrack(i.AUDIO.tracks[s])}var il=new eu("./decrypter-worker.worker.js",function(e,t){var i,c,m,n,r,u,a,s=this;i=function(e,t,i){return t&&o(e.prototype,t),i&&o(e,i),e},c=null,d.prototype.decrypt=function(e,t,i,n,r,s){for(var a,o,u=this._key[1],l=e^u[0],c=n^u[1],h=i^u[2],d=t^u[3],p=void 0,f=u.length/4-2,m=void 0,g=4,t=this._tables[1],y=t[0],v=t[1],_=t[2],b=t[3],T=t[4],m=0;m<f;m++)p=y[l>>>24]^v[c>>16&255]^_[h>>8&255]^b[255&d]^u[g],a=y[c>>>24]^v[h>>16&255]^_[d>>8&255]^b[255&l]^u[g+1],o=y[h>>>24]^v[d>>16&255]^_[l>>8&255]^b[255&c]^u[g+2],d=y[d>>>24]^v[l>>16&255]^_[c>>8&255]^b[255&h]^u[g+3],g+=4,l=p,c=a,h=o;for(m=0;m<4;m++)r[(3&-m)+s]=T[l>>>24]<<24^T[c>>16&255]<<16^T[h>>8&255]<<8^T[255&d]^u[g++],p=l,l=c,c=h,h=d,d=p},m=d,l.prototype.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},l.prototype.off=function(e,t){if(!this.listeners[e])return!1;t=this.listeners[e].indexOf(t);return this.listeners[e].splice(t,1),-1<t},l.prototype.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),s=t.length,a=0;a<s;++a)t[a].apply(this,r)},l.prototype.dispose=function(){this.listeners={}},l.prototype.pipe=function(t){this.on("data",function(e){t.push(e)})},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(p,r=n=l),p.prototype.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},p.prototype.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},u=p,f.prototype.decryptChunk_=function(t,i,n,r){return function(){var e=function(e,t,i){for(var n,r,s,a,o=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),u=new m(Array.prototype.slice.call(t)),e=new Uint8Array(e.byteLength),l=new Int32Array(e.buffer),c=void 0,h=void 0,d=void 0,p=void 0,f=void 0,c=i[0],h=i[1],d=i[2],p=i[3],f=0;f<o.length;f+=4)n=g(o[f]),r=g(o[f+1]),s=g(o[f+2]),a=g(o[f+3]),u.decrypt(n,r,s,a,l,f),l[f]=g(l[f]^c),l[f+1]=g(l[f+1]^h),l[f+2]=g(l[f+2]^d),l[f+3]=g(l[f+3]^p),c=n,h=r,d=s,p=a;return e}(t,i,n);r.set(e,t.byteOffset)}},i(f,null,[{key:"STEP",get:function(){return 32e3}}]),a=f,function(s){s.onmessage=function(e){var r=e.data,t=new Uint8Array(r.encrypted.bytes,r.encrypted.byteOffset,r.encrypted.byteLength),i=new Uint32Array(r.key.bytes,r.key.byteOffset,r.key.byteLength/4),e=new Uint32Array(r.iv.bytes,r.iv.byteOffset,r.iv.byteLength/4);new a(t,i,e,function(e,t){var i,n;s.postMessage((i={source:r.source,decrypted:t},n={},Object.keys(i).forEach(function(e){var t=i[e];ArrayBuffer.isView(t)?n[e]={bytes:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}:n[e]=t}),n),[t.buffer])})}}(s);function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function d(e){h(this,d),c=c||function(){for(var e,t,i,n=[[[],[],[],[],[]],[[],[],[],[],[]]],r=n[0],s=n[1],a=r[4],o=s[4],u=void 0,l=void 0,c=void 0,h=[],d=[],p=void 0,f=void 0,u=0;u<256;u++)d[(h[u]=u<<1^283*(u>>7))^u]=u;for(l=c=0;!a[l];l^=e||1,c=d[c]||1)for(f=16843009*h[t=h[e=h[o[a[l]=i=(i=c^c<<1^c<<2^c<<3^c<<4)>>8^255&i^99]=l]]]^65537*t^257*e^16843008*l,p=257*h[i]^16843008*i,u=0;u<4;u++)r[u][l]=p=p<<24^p>>>8,s[u][i]=f=f<<24^f>>>8;for(u=0;u<5;u++)r[u]=r[u].slice(0),s[u]=s[u].slice(0);return n}(),this._tables=[[c[0][0].slice(),c[0][1].slice(),c[0][2].slice(),c[0][3].slice(),c[0][4].slice()],[c[1][0].slice(),c[1][1].slice(),c[1][2].slice(),c[1][3].slice(),c[1][4].slice()]];var t=void 0,i=void 0,n=void 0,r=void 0,s=void 0,a=this._tables[0][4],o=this._tables[1],u=e.length,l=1;if(4!==u&&6!==u&&8!==u)throw new Error("Invalid aes key size");for(r=e.slice(0),this._key=[r,s=[]],t=u;t<4*u+28;t++)n=r[t-1],(t%u==0||8===u&&t%u==4)&&(n=a[n>>>24]<<24^a[n>>16&255]<<16^a[n>>8&255]<<8^a[255&n],t%u==0&&(n=n<<8^n>>>24^l<<24,l=l<<1^283*(l>>7))),r[t]=r[t-u]^n;for(i=0;t;i++,t--)n=r[3&i?t:t-4],s[i]=t<=4||i<4?n:o[0][a[n>>>24]]^o[1][a[n>>16&255]]^o[2][a[n>>8&255]]^o[3][a[255&n]]}function l(){h(this,l),this.listeners={}}function p(){h(this,p);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,r.call(this,n));return e.jobs=[],e.delay=1,e.timeout_=null,e}function g(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24}function f(e,t,i,n){h(this,f);var r=f.STEP,s=new Int32Array(e.buffer),a=new Uint8Array(e.byteLength),o=0;for(this.asyncStream_=new u,this.asyncStream_.push(this.decryptChunk_(s.subarray(o,o+r),t,i,a)),o=r;o<s.length;o+=r)i=new Uint32Array([g(s[o-4]),g(s[o-3]),g(s[o-2]),g(s[o-1])]),this.asyncStream_.push(this.decryptChunk_(s.subarray(o,o+r),t,i,a));this.asyncStream_.push(function(){n(null,a.subarray(0,a.byteLength-a[a.byteLength-1]))})}}),nl=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},rl=function(e,t){(t.activePlaylistLoader=e).load()},sl={AUDIO:function(a,o){return function(){var e=o.segmentLoaders[a],t=o.mediaTypes[a],i=o.blacklistCurrentPlaylist;nl(e,t);var n=t.activeTrack(),e=t.activeGroup(),e=(e.filter(function(e){return e.default})[0]||e[0]).id,r=t.tracks[e];if(n!==r){for(var s in Qn.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),t.tracks)t.tracks[s].enabled=t.tracks[s]===r;t.onTrackChanged()}else i({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(i,n){return function(){var e=n.segmentLoaders[i],t=n.mediaTypes[i];Qn.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),nl(e,t);e=t.activeTrack();e&&(e.mode="disabled"),t.onTrackChanged()}}},al={AUDIO:function(e,t,i){var n,r,s;t&&(n=i.tech,r=i.requestOptions,s=i.segmentLoaders[e],t.on("loadedmetadata",function(){var e=t.media();s.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&s.load()}),t.on("loadedplaylist",function(){s.playlist(t.media(),r),n.paused()||s.load()}),t.on("error",sl[e](e,i)))},SUBTITLES:function(e,t,i){var n=i.tech,r=i.requestOptions,s=i.segmentLoaders[e],a=i.mediaTypes[e];t.on("loadedmetadata",function(){var e=t.media();s.playlist(e,r),s.track(a.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&s.load()}),t.on("loadedplaylist",function(){s.playlist(t.media(),r),n.paused()||s.load()}),t.on("error",sl[e](e,i))}},ol={AUDIO:function(e,t){var i,n,r=t.hls,s=t.sourceType,a=t.segmentLoaders[e],o=t.requestOptions,u=t.master.mediaGroups,l=t.mediaTypes[e],c=l.groups,h=l.tracks,d=t.masterPlaylistLoader;for(i in u[e]&&0!==Object.keys(u[e]).length||(u[e]={main:{default:{default:!0}}}),u[e])for(var p in c[i]||(c[i]=[]),u[e][i]){var f=void 0,f=(m=u[e][i][p]).resolvedUri?new oo(m.resolvedUri,r,o):m.playlists&&"dash"===s?new Au(m.playlists[0],r,o,d):null,m=Qn.mergeOptions({id:p,playlistLoader:f},m);al[e](e,m.playlistLoader,t),c[i].push(m),void 0===h[p]&&(m=new Qn.AudioTrack({id:p,kind:(n=void 0,n=(f=m).default?"main":"alternative",n=f.characteristics&&0<=f.characteristics.indexOf("public.accessibility.describes-video")?"main-desc":n),enabled:!1,language:m.language,default:m.default,label:p}),h[p]=m)}a.on("error",sl[e](e,t))},SUBTITLES:function(e,t){var i,n,r,s=t.tech,a=t.hls,o=t.sourceType,u=t.segmentLoaders[e],l=t.requestOptions,c=t.master.mediaGroups,h=t.mediaTypes[e],d=h.groups,p=h.tracks,f=t.masterPlaylistLoader;for(i in c[e])for(var m in d[i]||(d[i]=[]),c[e][i])c[e][i][m].forced||(r=c[e][i][m],n=void 0,"hls"===o?n=new oo(r.resolvedUri,a,l):"dash"===o&&(n=new Au(r.playlists[0],a,l,f)),r=Qn.mergeOptions({id:m,playlistLoader:n},r),al[e](e,r.playlistLoader,t),d[i].push(r),void 0===p[m]&&(r=s.addRemoteTextTrack({id:m,kind:"subtitles",default:r.default&&r.autoselect,language:r.language,label:m},!1).track,p[m]=r));u.on("error",sl[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var i,n=t.tech,r=t.master.mediaGroups,t=t.mediaTypes[e],s=t.groups,a=t.tracks;for(i in r[e])for(var o in s[i]||(s[i]=[]),r[e][i]){var u=r[e][i][o];u.instreamId.match(/CC\d/)&&(s[i].push(Qn.mergeOptions({id:o},u)),void 0===a[o]&&(u=n.addRemoteTextTrack({id:u.instreamId,kind:"captions",default:u.default&&u.autoselect,language:u.language,label:o},!1).track,a[o]=u))}}},ul={AUDIO:function(i,n){return function(){var e,t=n.mediaTypes[i].tracks;for(e in t)if(t[e].enabled)return t[e];return null}},SUBTITLES:function(i,n){return function(){var e,t=n.mediaTypes[i].tracks;for(e in t)if("showing"===t[e].mode||"hidden"===t[e].mode)return t[e];return null}}},ll=void 0,cl=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred"],hl=(He=Qn.EventTarget,ir(dl,He),Fe(dl,[{key:"setupMasterPlaylistLoaderListeners_",value:function(){var n=this;this.masterPlaylistLoader_.on("loadedmetadata",function(){var e=n.masterPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;yo(n.masterPlaylistLoader_.master,n.masterPlaylistLoader_.media())?n.requestOptions_.timeout=0:n.requestOptions_.timeout=t,e.endList&&"none"!==n.tech_.preload()&&(n.mainSegmentLoader_.playlist(e,n.requestOptions_),n.mainSegmentLoader_.load()),tl({sourceType:n.sourceType_,segmentLoaders:{AUDIO:n.audioSegmentLoader_,SUBTITLES:n.subtitleSegmentLoader_,main:n.mainSegmentLoader_},tech:n.tech_,requestOptions:n.requestOptions_,masterPlaylistLoader:n.masterPlaylistLoader_,hls:n.hls_,master:n.master(),mediaTypes:n.mediaTypes_,blacklistCurrentPlaylist:n.blacklistCurrentPlaylist.bind(n)}),n.triggerPresenceUsage_(n.master(),e);try{n.setupSourceBuffers_()}catch(e){return Qn.log.warn("Failed to create SourceBuffers",e),n.mediaSource.endOfStream("decode")}n.setupFirstPlay(),!n.mediaTypes_.AUDIO.activePlaylistLoader||n.mediaTypes_.AUDIO.activePlaylistLoader.media()?n.trigger("selectedinitialmedia"):n.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",function(){n.trigger("selectedinitialmedia")})}),this.masterPlaylistLoader_.on("loadedplaylist",function(){var t,e=n.masterPlaylistLoader_.media();if(!e){n.excludeUnsupportedVariants_();var i=void 0,i=(i=n.enableLowInitialPlaylist?n.selectInitialPlaylist():i)||n.selectPlaylist();return n.initialMedia_=i,void n.masterPlaylistLoader_.media(n.initialMedia_)}n.useCueTags_&&n.updateAdCues_(e),n.mainSegmentLoader_.playlist(e,n.requestOptions_),n.updateDuration(),n.tech_.paused()||(n.mainSegmentLoader_.load(),n.audioSegmentLoader_&&n.audioSegmentLoader_.load()),e.endList||(t=function(){var e=n.seekable();0!==e.length&&n.mediaSource.addSeekableRange_(e.start(0),e.end(0))},n.duration()!==1/0?(e=function e(){n.duration()===1/0?t():n.tech_.one("durationchange",e)},n.tech_.one("durationchange",e)):t())}),this.masterPlaylistLoader_.on("error",function(){n.blacklistCurrentPlaylist(n.masterPlaylistLoader_.error)}),this.masterPlaylistLoader_.on("mediachanging",function(){n.mainSegmentLoader_.abort(),n.mainSegmentLoader_.pause()}),this.masterPlaylistLoader_.on("mediachange",function(){var e=n.masterPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;yo(n.masterPlaylistLoader_.master,n.masterPlaylistLoader_.media())?n.requestOptions_.timeout=0:n.requestOptions_.timeout=t,n.mainSegmentLoader_.playlist(e,n.requestOptions_),n.mainSegmentLoader_.load(),n.tech_.trigger({type:"mediachange",bubbles:!0})}),this.masterPlaylistLoader_.on("playlistunchanged",function(){var e=n.masterPlaylistLoader_.media();n.stuckAtPlaylistEnd_(e)&&(n.blacklistCurrentPlaylist({message:"Playlist no longer updating."}),n.tech_.trigger("playliststuck"))}),this.masterPlaylistLoader_.on("renditiondisabled",function(){n.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})}),this.masterPlaylistLoader_.on("renditionenabled",function(){n.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})})}},{key:"triggerPresenceUsage_",value:function(e,t){var i,n=e.mediaGroups||{},r=!0,e=Object.keys(n.AUDIO);for(i in n.AUDIO)for(var s in n.AUDIO[i])n.AUDIO[i][s].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"hls-demuxed"}),Object.keys(n.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"hls-webvtt"}),ll.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"hls-aes"}),ll.Playlist.isFmp4(t)&&this.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.length&&1<Object.keys(n.AUDIO[e[0]]).length&&this.tech_.trigger({type:"usage",name:"hls-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"})}},{key:"setupSegmentLoaderListeners_",value:function(){var n=this;this.mainSegmentLoader_.on("bandwidthupdate",function(){var e=n.selectPlaylist(),t=n.masterPlaylistLoader_.media(),i=n.tech_.buffered();!function(e){var t=e.currentPlaylist,i=e.nextPlaylist,n=e.forwardBuffer,r=e.bufferLowWaterLine,s=e.duration;e.log;return i?!t.endList||(s<Mu.MAX_BUFFER_LOW_WATER_LINE||(i.attributes.BANDWIDTH<t.attributes.BANDWIDTH||r<=n)):(Qn.log.warn("We received no playlist to switch to. Please check your stream."),!1)}({currentPlaylist:t,nextPlaylist:e,forwardBuffer:i.length?i.end(i.length-1)-n.tech_.currentTime():0,bufferLowWaterLine:n.bufferLowWaterLine(),duration:n.duration(),log:n.logger_})||n.masterPlaylistLoader_.media(e),n.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("progress",function(){n.trigger("progress")}),this.mainSegmentLoader_.on("error",function(){n.blacklistCurrentPlaylist(n.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("syncinfoupdate",function(){n.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){n.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){n.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("ended",function(){n.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(){n.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120)}),this.mainSegmentLoader_.on("reseteverything",function(){n.tech_.trigger("hls-reset")}),this.mainSegmentLoader_.on("segmenttimemapping",function(e){n.tech_.trigger({type:"hls-segment-time-mapping",mapping:e.mapping})}),this.audioSegmentLoader_.on("ended",function(){n.onEndOfStream()})}},{key:"mediaSecondsLoaded_",value:function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}},{key:"load",value:function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}},{key:"smoothQualityChange_",value:function(){var e=this.selectPlaylist();e!==this.masterPlaylistLoader_.media()&&(this.masterPlaylistLoader_.media(e),this.mainSegmentLoader_.resetLoader())}},{key:"fastQualityChange_",value:function(){var e=this,t=this.selectPlaylist();t!==this.masterPlaylistLoader_.media()&&(this.masterPlaylistLoader_.media(t),this.mainSegmentLoader_.resetEverything(function(){Qn.browser.IE_VERSION||Qn.browser.IS_EDGE?e.tech_.setCurrentTime(e.tech_.currentTime()+.04):e.tech_.setCurrentTime(e.tech_.currentTime())}))}},{key:"play",value:function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}}},{key:"setupFirstPlay",value:function(){var e=this,t=this.masterPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_)return!1;if(!t.endList){var i=this.seekable();if(!i.length)return!1;if(Qn.browser.IE_VERSION&&0===this.tech_.readyState())return this.tech_.one("loadedmetadata",function(){e.trigger("firstplay"),e.tech_.setCurrentTime(i.end(0)),e.hasPlayed_=!0}),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(i.end(0))}return this.hasPlayed_=!0,this.load(),!0}},{key:"handleSourceOpen_",value:function(){try{this.setupSourceBuffers_()}catch(e){return Qn.log.warn("Failed to create Source Buffers",e),this.mediaSource.endOfStream("decode")}var e;!this.tech_.autoplay()||void 0!==(e=this.tech_.play())&&"function"==typeof e.then&&e.then(null,function(e){}),this.trigger("sourceopen")}},{key:"onEndOfStream",value:function(){var e=this.mainSegmentLoader_.ended_;if(e=this.mediaTypes_.AUDIO.activePlaylistLoader?(this.mainSegmentLoader_.startingMedia_&&!this.mainSegmentLoader_.startingMedia_.containsVideo||e)&&this.audioSegmentLoader_.ended_:e){this.logger_("calling mediaSource.endOfStream()");try{this.mediaSource.endOfStream()}catch(e){Qn.log.warn("Failed to call media source endOfStream",e)}}}},{key:"stuckAtPlaylistEnd_",value:function(e){if(!this.seekable().length)return!1;var t=this.syncController_.getExpiredTime(e,this.mediaSource.duration);if(null===t)return!1;var i=ll.Playlist.playlistEnd(e,t),e=this.tech_.currentTime(),t=this.tech_.buffered();if(!t.length)return i-e<=.1;t=t.end(t.length-1);return t-e<=.1&&i-t<=.1}},{key:"blacklistCurrentPlaylist",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},i=arguments[1],n=void 0,n=t.playlist||this.masterPlaylistLoader_.media(),i=i||t.blacklistDuration||this.blacklistDuration;if(!n){this.error=t;try{return this.mediaSource.endOfStream("network")}catch(e){return this.trigger("error")}}var r=1===this.masterPlaylistLoader_.master.playlists.filter(mo).length,s=this.masterPlaylistLoader_.master.playlists;return 1===s.length?(Qn.log.warn("Problem encountered with the current HLS playlist. Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(r)):(r&&(Qn.log.warn("Removing all playlists from the blacklist because the last rendition is about to be blacklisted."),s.forEach(function(e){e.excludeUntil!==1/0&&delete e.excludeUntil}),this.tech_.trigger("retryplaylist")),n.excludeUntil=Date.now()+1e3*i,this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"}),e=this.selectPlaylist(),Qn.log.warn("Problem encountered with the current HLS playlist."+(t.message?" "+t.message:"")+" Switching to another playlist."),this.masterPlaylistLoader_.media(e,r))}},{key:"pauseLoading",value:function(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}},{key:"setCurrentTime",value:function(e){var t=Po(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0}},{key:"duration",value:function(){return this.masterPlaylistLoader_?this.mediaSource?this.mediaSource.duration:ll.Playlist.duration(this.masterPlaylistLoader_.media()):0}},{key:"seekable",value:function(){return this.seekable_}},{key:"onSyncInfoUpdate_",value:function(){var e=void 0;if(this.masterPlaylistLoader_){var t=this.masterPlaylistLoader_.media();if(t){var i=this.syncController_.getExpiredTime(t,this.mediaSource.duration);if(null!==i){var n=this.masterPlaylistLoader_.master.suggestedPresentationDelay,r=ll.Playlist.seekable(t,i,n);if(0!==r.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(i=this.syncController_.getExpiredTime(t,this.mediaSource.duration)))return;if(0===(e=ll.Playlist.seekable(t,i,n)).length)return}i=void 0,n=void 0;this.seekable_&&this.seekable_.length&&(i=this.seekable_.end(0),n=this.seekable_.start(0)),!e||e.start(0)>r.end(0)||r.start(0)>e.end(0)?this.seekable_=r:this.seekable_=Qn.createTimeRanges([[(e.start(0)>r.start(0)?e:r).start(0),(e.end(0)<r.end(0)?e:r).end(0)]]),this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===i&&this.seekable_.start(0)===n||(this.logger_("seekable updated ["+Lo(this.seekable_)+"]"),this.tech_.trigger("seekablechanged"))}}}}}},{key:"updateDuration",value:function(){function e(){t.logger_("Setting duration from "+t.mediaSource.duration+" => "+n);try{t.mediaSource.duration=n}catch(e){Qn.log.warn("Failed to set media source duration",e)}t.tech_.trigger("durationchange"),t.mediaSource.removeEventListener("sourceopen",e)}var t=this,i=this.mediaSource.duration,n=ll.Playlist.duration(this.masterPlaylistLoader_.media()),r=this.tech_.buffered();i!==(n=0<r.length?Math.max(n,r.end(r.length-1)):n)&&("open"!==this.mediaSource.readyState?this.mediaSource.addEventListener("sourceopen",e):e())}},{key:"dispose",value:function(){var n=this;this.trigger("dispose"),this.decrypter_&&this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),["AUDIO","SUBTITLES"].forEach(function(e){var t,i=n.mediaTypes_[e].groups;for(t in i)i[t].forEach(function(e){e.playlistLoader&&e.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.off(),this.mediaSource.dispose&&this.mediaSource.dispose()}},{key:"master",value:function(){return this.masterPlaylistLoader_.master}},{key:"media",value:function(){return this.masterPlaylistLoader_.media()||this.initialMedia_}},{key:"setupSourceBuffers_",value:function(){var e,t=this.masterPlaylistLoader_.media();if(t&&"open"===this.mediaSource.readyState){if((e=au(this.masterPlaylistLoader_.master,t)).length<1)return this.error="No compatible SourceBuffer configuration for the variant stream:"+t.resolvedUri,this.mediaSource.endOfStream("decode");this.configureLoaderMimeTypes_(e),this.excludeIncompatibleVariants_(t)}}},{key:"configureLoaderMimeTypes_",value:function(e){var t=1<e.length&&-1===e[0].indexOf(",")&&e[0]!==e[1]?new Qn.EventTarget:null;this.mainSegmentLoader_.mimeType(e[0],t),e[1]&&this.audioSegmentLoader_.mimeType(e[1],t)}},{key:"excludeUnsupportedVariants_",value:function(){this.master().playlists.forEach(function(e){e.attributes.CODECS&&d.MediaSource&&d.MediaSource.isTypeSupported&&!d.MediaSource.isTypeSupported('video/mp4; codecs="'+e.attributes.CODECS.replace(/avc1\.(\d+)\.(\d+)/i,function(e){return ru([e])[0]})+'"')&&(e.excludeUntil=1/0)})}},{key:"excludeIncompatibleVariants_",value:function(e){var t,i=2,n=null;e.attributes.CODECS&&(t=cu(e.attributes.CODECS),n=t.videoCodec,i=t.codecCount),this.master().playlists.forEach(function(e){var t={codecCount:2,videoCodec:null};(t=e.attributes.CODECS?cu(e.attributes.CODECS):t).codecCount!==i&&(e.excludeUntil=1/0),t.videoCodec!==n&&(e.excludeUntil=1/0)})}},{key:"updateAdCues_",value:function(e){var t=0,i=this.seekable();i.length&&(t=i.start(0)),function(e,t){if(e.segments)for(var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,n=void 0,r=0;r<e.segments.length;r++){var s,a,o,u=e.segments[r];if(n=n||function(e,t){for(var i=e.cues,n=0;n<i.length;n++){var r=i[n];if(t>=r.adStartTime&&t<=r.adEndTime)return r}return null}(t,i+u.duration/2)){if("cueIn"in u){n.endTime=i,n.adEndTime=i,i+=u.duration,n=null;continue}if(i<n.endTime){i+=u.duration;continue}n.endTime+=u.duration}else"cueOut"in u&&((n=new d.VTTCue(i,i+u.duration,u.cueOut)).adStartTime=i,n.adEndTime=i+parseFloat(u.cueOut),t.addCue(n)),"cueOutCont"in u&&(o=a=void 0,s=u.cueOutCont.split("/").map(parseFloat),a=(s=ro(s,2))[0],o=s[1],(n=new d.VTTCue(i,i+u.duration,"")).adStartTime=i-a,n.adEndTime=n.adStartTime+o,t.addCue(n));i+=u.duration}}(e,this.cueTagsTrack_,t)}},{key:"goalBufferLength",value:function(){var e=this.tech_.currentTime(),t=Mu.GOAL_BUFFER_LENGTH,i=Mu.GOAL_BUFFER_LENGTH_RATE,n=Math.max(t,Mu.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,n)}},{key:"bufferLowWaterLine",value:function(){var e=this.tech_.currentTime(),t=Mu.BUFFER_LOW_WATER_LINE,i=Mu.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(t,Mu.MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,n)}}]),dl);function dl(e){Ka(this,dl);var t,i=Qa(this,(dl.__proto__||Object.getPrototypeOf(dl)).call(this)),n=e.url,r=e.handleManifestRedirects,s=e.withCredentials,a=e.tech,o=e.bandwidth,u=e.externHls,l=e.useCueTags,c=e.blacklistDuration,h=e.enableLowInitialPlaylist,d=e.cacheEncryptionKeys,p=e.sourceType;if(!n)throw new Error("A non-empty playlist URL is required");ll=u,i.withCredentials=s,i.tech_=a,i.hls_=a.hls,i.sourceType_=p,i.useCueTags_=l,i.blacklistDuration=c,i.enableLowInitialPlaylist=h,i.useCueTags_&&(i.cueTagsTrack_=i.tech_.addTextTrack("metadata","ad-cues"),i.cueTagsTrack_.inBandMetadataTrackDispatchType=""),i.requestOptions_={withCredentials:s,handleManifestRedirects:r,timeout:null},i.mediaTypes_=(t={},["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(e){t[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:xu,activeTrack:xu,onGroupChanged:xu,onTrackChanged:xu}}),t),i.mediaSource=new Qn.MediaSource,i.mediaSource.addEventListener("sourceopen",i.handleSourceOpen_.bind(i)),i.seekable_=Qn.createTimeRanges(),i.hasPlayed_=!1,i.syncController_=new Zu(e),i.segmentMetadataTrack_=a.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,i.decrypter_=new il,i.inbandTextTracks_={};d={hls:i.hls_,mediaSource:i.mediaSource,currentTime:i.tech_.currentTime.bind(i.tech_),seekable:function(){return i.seekable()},seeking:function(){return i.tech_.seeking()},duration:function(){return i.mediaSource.duration},hasPlayed:function(){return i.hasPlayed_},goalBufferLength:function(){return i.goalBufferLength()},bandwidth:o,syncController:i.syncController_,decrypter:i.decrypter_,sourceType:i.sourceType_,inbandTextTracks:i.inbandTextTracks_,cacheEncryptionKeys:d};return i.masterPlaylistLoader_=new("dash"===i.sourceType_?Au:oo)(n,i.hls_,i.requestOptions_),i.setupMasterPlaylistLoaderListeners_(),i.mainSegmentLoader_=new zu(Qn.mergeOptions(d,{segmentMetadataTrack:i.segmentMetadataTrack_,loaderType:"main"}),e),i.audioSegmentLoader_=new zu(Qn.mergeOptions(d,{loaderType:"audio"}),e),i.subtitleSegmentLoader_=new Yu(Qn.mergeOptions(d,{loaderType:"vtt",featuresNativeTextTracks:i.tech_.featuresNativeTextTracks}),e),i.setupSegmentLoaderListeners_(),cl.forEach(function(e){i[e+"_"]=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]}.bind(i,e)}),i.logger_=Pu("MPC"),i.masterPlaylistLoader_.load(),i}function pl(e,t,i){Ka(this,pl);var n=e.masterPlaylistController_,r=n[(e.options_.smoothQualityChange?"smooth":"fast")+"QualityChange_"].bind(n);t.attributes.RESOLUTION&&(n=t.attributes.RESOLUTION,this.width=n.width,this.height=n.height),this.bandwidth=t.attributes.BANDWIDTH,this.id=i,this.enabled=fl(e.playlists,t.id,r)}var fl=function(r,s,a){return function(e){var t=r.master.playlists[s],i=fo(t),n=mo(t);return void 0===e?n:(e?delete t.disabled:t.disabled=!0,e===n||i||(a(),e?r.trigger("renditionenabled"):r.trigger("renditiondisabled")),e)}},ml=["seeking","seeked","pause","playing","error"],gl=(Fe(yl,[{key:"monitorCurrentTime_",value:function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&d.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=d.setTimeout(this.monitorCurrentTime_.bind(this),250)}},{key:"checkCurrentTime_",value:function(){if(this.tech_.seeking()&&this.fixesBadSeeks_())return this.consecutiveUpdates=0,void(this.lastRecordedTime=this.tech_.currentTime());if(!this.tech_.paused()&&!this.tech_.seeking()){var e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+.1>=t.end(t.length-1)))return this.techWaiting_();5<=this.consecutiveUpdates&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}}},{key:"cancelTimer_",value:function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null}},{key:"fixesBadSeeks_",value:function(){if(!this.tech_.seeking())return!1;var e=this.seekable(),t=this.tech_.currentTime(),i=void 0;return this.afterSeekableWindow_(e,t,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(i=e.end(e.length-1)),void 0!==(i=this.beforeSeekableWindow_(e,t)?e.start(0)+.1:i)&&(this.logger_("Trying to seek outside of seekable at time "+t+" with seekable range "+Lo(e)+". Seeking to "+i+"."),this.tech_.setCurrentTime(i),!0)}},{key:"waiting_",value:function(){var e,t;this.techWaiting_()||(e=this.tech_.currentTime(),t=this.tech_.buffered(),(t=Po(t,e)).length&&e+3<=t.end(0)&&(this.cancelTimer_(),this.tech_.setCurrentTime(e),this.logger_("Stopped at "+e+" while inside a buffered region ["+t.start(0)+" -> "+t.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})))}},{key:"techWaiting_",value:function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_())return!0;if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var i=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}e=this.tech_.buffered(),i=xo(e,t);if(this.videoUnderflow_(i,e,t))return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;if(0<i.length){e=i.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+e+", seeking to "+i.start(0)),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*e,t),!0}return!1}},{key:"afterSeekableWindow_",value:function(e,t,i){var n=3<arguments.length&&void 0!==arguments[3]&&arguments[3];if(!e.length)return!1;var r=e.end(e.length-1)+.1;return(r=!i.endList&&n?e.end(e.length-1)+3*i.targetDuration:r)<t}},{key:"beforeSeekableWindow_",value:function(e,t){return!!(e.length&&0<e.start(0)&&t<e.start(0)-.1)}},{key:"videoUnderflow_",value:function(e,t,i){if(0===e.length){t=this.gapFromVideoUnderflow_(t,i);if(t)return this.logger_("Encountered a gap in video from "+t.start+" to "+t.end+". Seeking to current time "+i),!0}return!1}},{key:"skipTheGap_",value:function(e){var t=this.tech_.buffered(),i=this.tech_.currentTime(),t=xo(t,i);this.cancelTimer_(),0!==t.length&&i===e&&(this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",t.start(0)),this.tech_.setCurrentTime(t.start(0)+1/30),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))}},{key:"gapFromVideoUnderflow_",value:function(e,t){for(var i=function(e){if(e.length<2)return Qn.createTimeRanges();for(var t=[],i=1;i<e.length;i++){var n=e.end(i-1),r=e.start(i);t.push([n,r])}return Qn.createTimeRanges(t)}(e),n=0;n<i.length;n++){var r=i.start(n),s=i.end(n);if(t-r<4&&2<t-r)return{start:r,end:s}}return null}}]),yl);function yl(e){var t=this;Ka(this,yl),this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=Pu("PlaybackWatcher"),this.logger_("initialize");function i(){return t.monitorCurrentTime_()}function n(){return t.techWaiting_()}function r(){return t.cancelTimer_()}function s(){return t.fixesBadSeeks_()}this.tech_.on("seekablechanged",s),this.tech_.on("waiting",n),this.tech_.on(ml,r),this.tech_.on("canplay",i),this.dispose=function(){t.logger_("dispose"),t.tech_.off("seekablechanged",s),t.tech_.off("waiting",n),t.tech_.off(ml,r),t.tech_.off("canplay",i),t.checkCurrentTimeTimeout_&&d.clearTimeout(t.checkCurrentTimeTimeout_),t.cancelTimer_()}}function vl(t,e){var i=0,n=0,r=Qn.mergeOptions(_l,e);function s(e){null!=e&&(n=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",u),t.src(e),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())}function a(){if(Date.now()-i<1e3*r.errorInterval)t.trigger({type:"usage",name:"hls-error-reload-canceled"});else{if(r.getSource&&"function"==typeof r.getSource)return i=Date.now(),r.getSource.call(t,s);Qn.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}}function o(){t.off("loadedmetadata",u),t.off("error",a),t.off("dispose",o)}t.ready(function(){t.trigger({type:"usage",name:"hls-error-reload-initialized"})});var u=function(){n&&t.currentTime(n)};t.on("error",a),t.on("dispose",o),t.reloadSourceOnError=function(e){o(),vl(t,e)}}var _l={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_)}},He=function(e){vl(this,e)},bl={PlaylistLoader:oo,Playlist:Wo,Decrypter:ei,AsyncStream:Ga,decrypt:Va,utils:st,STANDARD_PLAYLIST_SELECTOR:function(){var e=this.useDevicePixelRatio&&d.devicePixelRatio||1;return function(e,t,i,n,r){var s=e.playlists.map(function(e){var t=e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,i=e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return{bandwidth:e.attributes.BANDWIDTH||d.Number.MAX_VALUE,width:t,height:i,playlist:e}});Wu(s,function(e,t){return e.bandwidth-t.bandwidth});var a=(s=s.filter(function(e){return!Wo.isIncompatible(e.playlist)})).filter(function(e){return Wo.isEnabled(e.playlist)}),o=(a=!a.length?s.filter(function(e){return!Wo.isDisabled(e.playlist)}):a).filter(function(e){return e.bandwidth*Mu.BANDWIDTH_VARIANCE<t}),u=o[o.length-1],l=o.filter(function(e){return e.bandwidth===u.bandwidth})[0];if(!1===r){var c=l||a[0]||s[0];return c?c.playlist:null}e=o.filter(function(e){return e.width&&e.height});Wu(e,function(e,t){return e.width-t.width});var r=e.filter(function(e){return e.width===i&&e.height===n}),u=r[r.length-1],c=r.filter(function(e){return e.bandwidth===u.bandwidth})[0],h=void 0,o=void 0,r=void 0;c||(o=(h=e.filter(function(e){return e.width>i||e.height>n})).filter(function(e){return e.width===h[0].width&&e.height===h[0].height}),u=o[o.length-1],r=o.filter(function(e){return e.bandwidth===u.bandwidth})[0]);s=r||c||l||a[0]||s[0];return s?s.playlist:null}(this.playlists.master,this.systemBandwidth,parseInt(Nu(this.tech_.el(),"width"),10)*e,parseInt(Nu(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions)},INITIAL_PLAYLIST_SELECTOR:function(){var e=this.playlists.master.playlists.filter(Wo.isEnabled);return Wu(e,Ru),e.filter(function(e){return cu(e.attributes.CODECS).videoCodec})[0]||null},comparePlaylistBandwidth:Ru,comparePlaylistResolution:function(e,t){var i=void 0,n=void 0;return(i=(i=e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width?e.attributes.RESOLUTION.width:i)||d.Number.MAX_VALUE)===(n=(n=t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width?t.attributes.RESOLUTION.width:n)||d.Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:vo()};["GOAL_BUFFER_LENGTH","MAX_GOAL_BUFFER_LENGTH","GOAL_BUFFER_LENGTH_RATE","BUFFER_LOW_WATER_LINE","MAX_BUFFER_LOW_WATER_LINE","BUFFER_LOW_WATER_LINE_RATE","BANDWIDTH_VARIANCE"].forEach(function(t){Object.defineProperty(bl,t,{get:function(){return Qn.log.warn("using Hls."+t+" is UNSAFE be sure you know what you are doing"),Mu[t]},set:function(e){Qn.log.warn("using Hls."+t+" is UNSAFE be sure you know what you are doing"),"number"!=typeof e||e<0?Qn.log.warn("value of Hls."+t+" must be greater than or equal to 0"):Mu[t]=e}})});function Tl(e){return/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i.test(e)?"hls":/^application\/dash\+xml/i.test(e)?"dash":null}function Sl(e,t){for(var i=t.media(),n=-1,r=0;r<e.length;r++)if(e[r].id===i.id){n=r;break}e.selectedIndex_=n,e.trigger({selectedIndex:n,type:"change"})}var kl="videojs-vhs";bl.canPlaySource=function(){return Qn.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};function Cl(e){var t=e.masterPlaylistController_.mainSegmentLoader_,i=e.masterPlaylistController_.audioSegmentLoader_,n=Qn.players[e.tech_.options_.playerId];!n.eme||(i=function(e,t,i){if(!e)return e;var n,r,s,a,o=void 0,u=void 0,u=i.mimeType_?(o=t.mimeType_,i.mimeType_):(i=(n=hu(t.mimeType_)).parameters.codecs.split(","),s=r=void 0,i.forEach(function(e){e=e.trim(),du(e)?r=e:pu(e)&&(s=e)}),o=n.type+'; codecs="'+s+'"',n.type.replace("video","audio")+'; codecs="'+r+'"'),l={},c=t.playlist_;for(a in e)l[a]={audioContentType:u,videoContentType:o},c.contentProtection&&c.contentProtection[a]&&c.contentProtection[a].pssh&&(l[a].pssh=c.contentProtection[a].pssh),"string"==typeof e[a]&&(l[a].url=e[a]);return Qn.mergeOptions(e,l)}(e.source_.keySystems,t,i))&&(n.currentSource().keySystems=i,11!==Qn.browser.IE_VERSION&&n.eme.initializeMediaKeys&&n.eme.initializeMediaKeys())}function El(){if(!window.localStorage)return null;var e=window.localStorage.getItem(kl);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}}bl.supportsNativeHls=function(){var t=h.createElement("video");if(!Qn.getTech("Html5").isSupported())return!1;return["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(e){return/maybe|probably/i.test(t.canPlayType(e))})}(),bl.supportsNativeDash=!!Qn.getTech("Html5").isSupported()&&/maybe|probably/i.test(h.createElement("video").canPlayType("application/dash+xml")),bl.supportsTypeNatively=function(e){return"hls"===e?bl.supportsNativeHls:"dash"===e&&bl.supportsNativeDash},bl.isSupported=function(){return Qn.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var st=Qn.getComponent("Component"),wl=(ir(Al,st),Fe(Al,[{key:"setOptions_",value:function(){var e,t=this;this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=this.options_.handleManifestRedirects||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,"number"!=typeof this.options_.blacklistDuration&&(this.options_.blacklistDuration=300),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage&&((e=El())&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))),"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=Mu.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Mu.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys"].forEach(function(e){void 0!==t.source_[e]&&(t.options_[e]=t.source_[e])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio}},{key:"src",value:function(e,t){var n=this;e&&(this.setOptions_(),this.options_.url=this.source_.src,this.options_.tech=this.tech_,this.options_.externHls=bl,this.options_.sourceType=Tl(t),this.options_.seekTo=function(e){n.tech_.setCurrentTime(e)},this.masterPlaylistController_=new hl(this.options_),this.playbackWatcher_=new gl(Qn.mergeOptions(this.options_,{seekable:function(){return n.seekable()},media:function(){return n.masterPlaylistController_.media()}})),this.masterPlaylistController_.on("error",function(){Qn.players[n.tech_.options_.playerId].error(n.masterPlaylistController_.error)}),this.masterPlaylistController_.selectPlaylist=(this.selectPlaylist||bl.STANDARD_PLAYLIST_SELECTOR).bind(this),this.masterPlaylistController_.selectInitialPlaylist=bl.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(e){this.masterPlaylistController_.selectPlaylist=e.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=e,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.bandwidth},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var e=1/(this.bandwidth||1),t=void 0,t=0<this.throughput?1/this.throughput:0;return Math.floor(1/(e+t))},set:function(){Qn.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return n.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return n.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return n.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return n.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return n.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return n.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return n.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return n.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},buffered:{get:function(){return Oo(n.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return n.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return n.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return n.tech_.name_},enumerable:!0},duration:{get:function(){return n.tech_.duration()},enumerable:!0},master:{get:function(){return n.playlists.master},enumerable:!0},playerDimensions:{get:function(){return n.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return Oo(n.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return n.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){n.options_.useBandwidthFromLocalStorage&&function(e){if(!window.localStorage)return;var t=(t=El())?Qn.mergeOptions(t,e):e;try{window.localStorage.setItem(kl,JSON.stringify(t))}catch(e){return}}({bandwidth:n.bandwidth,throughput:Math.round(n.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){var i,e;e=(i=n).playlists,i.representations=function(){return e&&e.master&&e.master.playlists?e.master.playlists.filter(function(e){return!fo(e)}).map(function(e,t){return new pl(i,e,e.id)}):[]},Cl(n)}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&this.tech_.src(Qn.URL.createObjectURL(this.masterPlaylistController_.mediaSource)))}},{key:"setupQualityLevels_",value:function(){var i=this,e=Qn.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){var t,e;t=i.qualityLevels_,(e=i).representations().forEach(function(e){t.addQualityLevel(e)}),Sl(t,e.playlists)}),this.playlists.on("mediachange",function(){Sl(i.qualityLevels_,i.playlists)}))}},{key:"play",value:function(){this.masterPlaylistController_.play()}},{key:"setCurrentTime",value:function(e){this.masterPlaylistController_.setCurrentTime(e)}},{key:"duration",value:function(){return this.masterPlaylistController_.duration()}},{key:"seekable",value:function(){return this.masterPlaylistController_.seekable()}},{key:"dispose",value:function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.hls&&delete this.tech_.hls,$a(Al.prototype.__proto__||Object.getPrototypeOf(Al.prototype),"dispose",this).call(this)}},{key:"convertToProgramTime",value:function(e,t){return wo({playlist:this.masterPlaylistController_.media(),time:e,callback:t})}},{key:"seekToProgramTime",value:function(e,t){var i=!(2<arguments.length&&void 0!==arguments[2])||arguments[2],n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:2;return Ao({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}}]),Al);function Al(e,t,i){Ka(this,Al);var n=Qa(this,(Al.__proto__||Object.getPrototypeOf(Al)).call(this,t,i.hls));if(t.options_&&t.options_.playerId&&((i=Qn(t.options_.playerId)).hasOwnProperty("hls")||Object.defineProperty(i,"hls",{get:function(){return Qn.log.warn("player.hls is deprecated. Use player.tech().hls instead."),t.trigger({type:"usage",name:"hls-player-access"}),n},configurable:!0}),i.vhs=n,(i.dash=n).player_=i),n.tech_=t,n.source_=e,n.stats={},n.ignoreNextSeekingEvent_=!1,n.setOptions_(),n.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(n.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return n.on(h,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(e){var t=h.fullscreenElement||h.webkitFullscreenElement||h.mozFullScreenElement||h.msFullscreenElement;t&&t.contains(n.tech_.el())&&n.masterPlaylistController_.smoothQualityChange_()}),n.on(n.tech_,"seeking",function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())}),n.on(n.tech_,"error",function(){this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()}),n.on(n.tech_,"play",n.play),n}var Il={name:"videojs-http-streaming",VERSION:"1.13.4",canHandleSource:function(e){var t=Qn.mergeOptions(Qn.options,1<arguments.length&&void 0!==arguments[1]?arguments[1]:{});return Il.canPlayType(e.type,t)},handleSource:function(e,t){var i=Qn.mergeOptions(Qn.options,2<arguments.length&&void 0!==arguments[2]?arguments[2]:{});return t.hls=new wl(e,t,i),t.hls.xhr=vo(),t.hls.src(e.src,e.type),t.hls},canPlayType:function(e){var t=Qn.mergeOptions(Qn.options,1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}).hls.overrideNative,e=Tl(e);return e&&(!bl.supportsTypeNatively(e)||t)?"maybe":""}};return void 0!==Qn.MediaSource&&void 0!==Qn.URL||(Qn.MediaSource=bu,Qn.URL=iu),bu.supportsNativeMediaSources()&&Qn.getTech("Html5").registerSourceHandler(Il,0),Qn.HlsHandler=wl,Qn.HlsSourceHandler=Il,Qn.Hls=bl,Qn.use||Qn.registerComponent("Hls",bl),Qn.options.hls=Qn.options.hls||{},Qn.registerPlugin?Qn.registerPlugin("reloadSourceOnError",He):Qn.plugin("reloadSourceOnError",He),Qn});
!function(l,p){"use strict";var e;function c(t){this.time=t.time,this.target=t.target,this.rootBounds=t.rootBounds,this.boundingClientRect=t.boundingClientRect,this.intersectionRect=t.intersectionRect||i(),this.isIntersecting=!!t.intersectionRect;var e=this.boundingClientRect,t=e.width*e.height,e=this.intersectionRect,e=e.width*e.height;this.intersectionRatio=t?Number((e/t).toFixed(4)):this.isIntersecting?1:0}function t(t,e){var n,o,i,e=e||{};if("function"!=typeof t)throw new Error("callback must be a function");if(e.root&&1!=e.root.nodeType)throw new Error("root must be an Element");this._checkForIntersections=(n=this._checkForIntersections.bind(this),o=this.THROTTLE_TIMEOUT,i=null,function(){i=i||setTimeout(function(){n(),i=null},o)}),this._callback=t,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(e.rootMargin),this.thresholds=this._initThresholds(e.threshold),this.root=e.root||null,this.rootMargin=this._rootMarginValues.map(function(t){return t.value+t.unit}).join(" ")}function n(t,e,n,o){"function"==typeof t.addEventListener?t.addEventListener(e,n,o||!1):"function"==typeof t.attachEvent&&t.attachEvent("on"+e,n)}function o(t,e,n,o){"function"==typeof t.removeEventListener?t.removeEventListener(e,n,o||!1):"function"==typeof t.detatchEvent&&t.detatchEvent("on"+e,n)}function f(t){var e;try{e=t.getBoundingClientRect()}catch(t){}return e?e.width&&e.height?e:{top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.right-e.left,height:e.bottom-e.top}:i()}function i(){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}function r(t,e){for(var n=e;n;){if(n==t)return!0;n=d(n)}return!1}function d(t){t=t.parentNode;return t&&11==t.nodeType&&t.host?t.host:t}"IntersectionObserver"in l&&"IntersectionObserverEntry"in l&&"intersectionRatio"in l.IntersectionObserverEntry.prototype?"isIntersecting"in l.IntersectionObserverEntry.prototype||Object.defineProperty(l.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return 0<this.intersectionRatio}}):(e=[],t.prototype.THROTTLE_TIMEOUT=100,t.prototype.POLL_INTERVAL=null,t.prototype.USE_MUTATION_OBSERVER=!0,t.prototype.observe=function(e){if(!this._observationTargets.some(function(t){return t.element==e})){if(!e||1!=e.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:e,entry:null}),this._monitorIntersections(),this._checkForIntersections()}},t.prototype.unobserve=function(e){this._observationTargets=this._observationTargets.filter(function(t){return t.element!=e}),this._observationTargets.length||(this._unmonitorIntersections(),this._unregisterInstance())},t.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorIntersections(),this._unregisterInstance()},t.prototype.takeRecords=function(){var t=this._queuedEntries.slice();return this._queuedEntries=[],t},t.prototype._initThresholds=function(t){t=t||[0];return(t=!Array.isArray(t)?[t]:t).sort().filter(function(t,e,n){if("number"!=typeof t||isNaN(t)||t<0||1<t)throw new Error("threshold must be a number between 0 and 1 inclusively");return t!==n[e-1]})},t.prototype._parseRootMargin=function(t){t=(t||"0px").split(/\s+/).map(function(t){t=/^(-?\d*\.?\d+)(px|%)$/.exec(t);if(!t)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(t[1]),unit:t[2]}});return t[1]=t[1]||t[0],t[2]=t[2]||t[0],t[3]=t[3]||t[1],t},t.prototype._monitorIntersections=function(){this._monitoringIntersections||(this._monitoringIntersections=!0,this.POLL_INTERVAL?this._monitoringInterval=setInterval(this._checkForIntersections,this.POLL_INTERVAL):(n(l,"resize",this._checkForIntersections,!0),n(p,"scroll",this._checkForIntersections,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in l&&(this._domObserver=new MutationObserver(this._checkForIntersections),this._domObserver.observe(p,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))))},t.prototype._unmonitorIntersections=function(){this._monitoringIntersections&&(this._monitoringIntersections=!1,clearInterval(this._monitoringInterval),this._monitoringInterval=null,o(l,"resize",this._checkForIntersections,!0),o(p,"scroll",this._checkForIntersections,!0),this._domObserver&&(this._domObserver.disconnect(),this._domObserver=null))},t.prototype._checkForIntersections=function(){var s=this._rootIsInDom(),h=s?this._getRootRect():i();this._observationTargets.forEach(function(t){var e=t.element,n=f(e),o=this._rootContainsTarget(e),i=t.entry,r=s&&o&&this._computeTargetAndRootIntersection(e,h),r=t.entry=new c({time:l.performance&&performance.now&&performance.now(),target:e,boundingClientRect:n,rootBounds:h,intersectionRect:r});i?s&&o?this._hasCrossedThreshold(i,r)&&this._queuedEntries.push(r):i&&i.isIntersecting&&this._queuedEntries.push(r):this._queuedEntries.push(r)},this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)},t.prototype._computeTargetAndRootIntersection=function(t,e){if("none"!=l.getComputedStyle(t).display){for(var n,o,i,r,s=f(t),h=d(t),c=!1;!c;){var u=null,a=1==h.nodeType?l.getComputedStyle(h):{};if("none"==a.display)return;if(h==this.root||h==p?(c=!0,u=e):h!=p.body&&h!=p.documentElement&&"visible"!=a.overflow&&(u=f(h)),u&&(n=u,o=s,u=a=r=i=void 0,i=Math.max(n.top,o.top),r=Math.min(n.bottom,o.bottom),a=Math.max(n.left,o.left),u=Math.min(n.right,o.right),o=r-i,!(s=0<=(n=u-a)&&0<=o&&{top:i,bottom:r,left:a,right:u,width:n,height:o})))break;h=d(h)}return s}},t.prototype._getRootRect=function(){var t,e;return e=this.root?f(this.root):(t=p.documentElement,e=p.body,{top:0,left:0,right:t.clientWidth||e.clientWidth,width:t.clientWidth||e.clientWidth,bottom:t.clientHeight||e.clientHeight,height:t.clientHeight||e.clientHeight}),this._expandRectByRootMargin(e)},t.prototype._expandRectByRootMargin=function(n){var t=this._rootMarginValues.map(function(t,e){return"px"==t.unit?t.value:t.value*(e%2?n.width:n.height)/100}),t={top:n.top-t[0],right:n.right+t[1],bottom:n.bottom+t[2],left:n.left-t[3]};return t.width=t.right-t.left,t.height=t.bottom-t.top,t},t.prototype._hasCrossedThreshold=function(t,e){var n=t&&t.isIntersecting?t.intersectionRatio||0:-1,o=e.isIntersecting?e.intersectionRatio||0:-1;if(n!==o)for(var i=0;i<this.thresholds.length;i++){var r=this.thresholds[i];if(r==n||r==o||r<n!=r<o)return!0}},t.prototype._rootIsInDom=function(){return!this.root||r(p,this.root)},t.prototype._rootContainsTarget=function(t){return r(this.root||p,t)},t.prototype._registerInstance=function(){e.indexOf(this)<0&&e.push(this)},t.prototype._unregisterInstance=function(){var t=e.indexOf(this);-1!=t&&e.splice(t,1)},l.IntersectionObserver=t,l.IntersectionObserverEntry=c)}(window,document);
function _extends(){return(_extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n,o=arguments[e];for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t}).apply(this,arguments)}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t,e){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.LazyLoad=e()}(this,function(){"use strict";function r(t,e,n){e="data-"+e,null!==n?t.setAttribute(e,n):t.removeAttribute(e)}function a(t){return"true"===p(t,"was-processed")}function s(t,e){return r(t,"ll-timeout",e),0}function i(t){return p(t,"ll-timeout")}function l(t,e){var n,e=new t(e);try{n=new CustomEvent("LazyLoad::Initialized",{detail:{instance:e}})}catch(t){(n=document.createEvent("CustomEvent")).initCustomEvent("LazyLoad::Initialized",!1,!1,{instance:e})}window.dispatchEvent(n)}function o(t){for(var e,n=[],o=0;e=t.children[o];o+=1)"SOURCE"===e.tagName&&n.push(e);return n}function n(t,e,n){n&&t.setAttribute(e,n)}function c(t,e){n(t,"sizes",p(t,e.data_sizes)),n(t,"srcset",p(t,e.data_srcset)),n(t,"src",p(t,e.data_src))}function u(t,e){m?t.classList.add(e):t.className+=(t.className?" ":"")+e}function d(t,e,n){t.removeEventListener(e,n)}function f(n,o){function r(t){L(t,!1,o),I(n,s,r)}var t,e,a,s=function t(e){L(e,!0,o),I(n,t,r)};a=r,k(t=n,"load",e=s),k(t,"loadeddata",e),k(t,"error",a)}function _(t,e,n){var o=e._settings;!n&&a(t)||(-1<x.indexOf(t.tagName)&&(f(t,e),u(t,o.class_loading)),function(t,e){var n,o,r=e._settings,a=t.tagName,a=w[a];if(a)return a(t,r),E(e,1),e._elements=(o=e._elements,n=t,o.filter(function(t){return t!==n}));r=p(o=t,(t=r).data_src),t=p(o,t.data_bg),r&&(o.style.backgroundImage='url("'.concat(r,'")')),t&&(o.style.backgroundImage=t)}(t,e),r(t,"was-processed","true"),y(o.callback_reveal,t))}function v(r){return!!b&&(r._observer=new IntersectionObserver(function(t){t.forEach(function(t){return t.isIntersecting||0<t.intersectionRatio?(e=t.target,o=(n=r)._settings,y(o.callback_enter,e),void(o.load_delay?O:A)(e,n)):(n=t.target,t=r._settings,y(t.callback_exit,n),void(t.load_delay&&z(n)));var e,n,o})},{root:(t=r._settings).container===document?null:t.container,rootMargin:t.thresholds||t.threshold+"px"}),!0);var t}function t(t,e){this._settings=_extends({},h,t),this._loadingCount=0,v(this),this.update(e)}var e="undefined"!=typeof window,g=e&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),b=e&&"IntersectionObserver"in window,m=e&&"classList"in document.createElement("p"),h={elements_selector:"img",container:g||e?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",class_loading:"loading",class_loaded:"loaded",class_error:"error",load_delay:0,auto_unobserve:!0,callback_enter:null,callback_exit:null,callback_reveal:null,callback_loaded:null,callback_error:null,callback_finish:null},p=function(t,e){return t.getAttribute("data-"+e)},y=function(t,e){t&&t(e)},E=function(t,e){t._loadingCount+=e,0===t._elements.length&&0===t._loadingCount&&y(t._settings.callback_finish)},w={IMG:function(t,e){var n=t.parentNode;n&&"PICTURE"===n.tagName&&o(n).forEach(function(t){c(t,e)}),c(t,e)},IFRAME:function(t,e){n(t,"src",p(t,e.data_src))},VIDEO:function(t,e){o(t).forEach(function(t){n(t,"src",p(t,e.data_src))}),n(t,"src",p(t,e.data_src)),t.load()}},k=function(t,e,n){t.addEventListener(e,n)},I=function(t,e,n){d(t,"load",e),d(t,"loadeddata",e),d(t,"error",n)},L=function(t,e,n){var o=n._settings,r=e?o.class_loaded:o.class_error,a=e?o.callback_loaded:o.callback_error,e=t.target;t=e,o=o.class_loading,m?t.classList.remove(o):t.className=t.className.replace(new RegExp("(^|\\s+)"+o+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,""),u(e,r),y(a,e),E(n,-1)},x=["IMG","IFRAME","VIDEO"],A=function(t,e){var n=e._observer;_(t,e),n&&e._settings.auto_unobserve&&n.unobserve(t)},z=function(t){var e=i(t);e&&(clearTimeout(e),s(t,null))},O=function(t,e){var n,o=e._settings.load_delay;(n=i(t))||(n=setTimeout(function(){A(t,e),z(t)},o),s(t,n))};return t.prototype={update:function(t){var e=this,n=this._settings,n=t||n.container.querySelectorAll(n.elements_selector);this._elements=Array.prototype.slice.call(n).filter(function(t){return!a(t)}),!g&&this._observer?this._elements.forEach(function(t){e._observer.observe(t)}):this.loadAll()},destroy:function(){var e=this;this._observer&&(this._elements.forEach(function(t){e._observer.unobserve(t)}),this._observer=null),this._elements=null,this._settings=null},load:function(t,e){_(t,this,e)},loadAll:function(){var e=this;this._elements.forEach(function(t){A(t,e)})}},e&&function(t,e){if(e)if(e.length)for(var n,o=0;n=e[o];o+=1)l(t,n);else l(t,e)}(t,window.lazyLoadOptions),t});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).window=t.window||{})}(this,function(t){"use strict";function r(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}function C(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function P(t){return"string"==typeof t}function f(t){return"function"==typeof t}function D(t){return"number"==typeof t}function n(t){return void 0===t}function S(t){return"object"==typeof t}function E(t){return!1!==t}function e(){return"undefined"!=typeof window}function z(t){return f(t)||P(t)}function i(t){return(Ot=pt(t,he))&&hr}function R(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")}function F(t,e){return!e&&console.warn(t)}function s(t,e){return t&&(he[t]=e)&&Ot&&(Ot[t]=e)||he}function a(){return 0}function B(t){var e,r,i=t[0];if(S(i)||f(i)||(t=[t]),!(e=(i._gsap||{}).harness)){for(r=me.length;r--&&!me[r].targetTest(i););e=me[r]}for(r=t.length;r--;)t[r]&&(t[r]._gsap||(t[r]._gsap=new Re(t[r],e)))||t.splice(r,1);return t}function I(t){return t._gsap||B(gt(t))[0]._gsap}function o(t,e,r){return(r=t[e])&&f(r)?t[e]():n(r)&&t.getAttribute&&t.getAttribute(e)||r}function c(t,e){return(t=t.split(",")).forEach(e)||t}function L(t){return Math.round(1e5*t)/1e5||0}function Y(t){return Math.round(1e7*t)/1e7||0}function U(){var t,e,r=fe.length,i=fe.slice(0);for(pe={},t=fe.length=0;t<r;t++)(e=i[t])&&e._lazy&&(e.render(e._lazy[0],e._lazy[1],!0)._lazy=0)}function u(t,e,r,i){fe.length&&U(),t.render(e,r,i),fe.length&&U()}function h(t){var e=parseFloat(t);return(e||0===e)&&(t+"").match(oe).length<2?e:P(t)?t.trim():t}function l(t){return t}function X(t,e){for(var r in e)r in t||(t[r]=e[r]);return t}function p(t,e){for(var r in e)"__proto__"!==r&&"constructor"!==r&&"prototype"!==r&&(t[r]=S(e[r])?p(t[r]||(t[r]={}),e[r]):e[r]);return t}function N(t,e){var r,i={};for(r in t)r in e||(i[r]=t[r]);return i}function q(t){var i,e=t.parent||xt,r=t.keyframes?(i=ee(t.keyframes),function(t,e){for(var r in e)r in t||"duration"===r&&i||"ease"===r||(t[r]=e[r])}):X;if(E(t.inherit))for(;e;)r(t,e.vars.defaults),e=e.parent||e._dp;return t}function _(t,e,r,i){void 0===r&&(r="_first"),void 0===i&&(i="_last");var n=e._prev,s=e._next;n?n._next=s:t[r]===e&&(t[r]=s),s?s._prev=n:t[i]===e&&(t[i]=n),e._next=e._prev=e.parent=null}function V(t,e){!t.parent||e&&!t.parent.autoRemoveChildren||t.parent.remove(t),t._act=0}function d(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var r=t;r;)r._dirty=1,r=r.parent;return t}function m(t){return t._repeat?ct(t._tTime,t=t.duration()+t._rDelay)*t:0}function g(t,e){return(t-e._start)*e._ts+(0<=e._ts?0:e._dirty?e.totalDuration():e._tDur)}function x(t){return t._end=Y(t._start+(t._tDur/Math.abs(t._ts||t._rts||Gt)||0))}function v(t,e){var r=t._dp;return r&&r.smoothChildTiming&&t._ts&&(t._start=Y(r._time-(0<t._ts?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),x(t),r._dirty||d(r,t)),t}function y(t,e){var r;if((e._time||e._initted&&!e._dur)&&(r=g(t.rawTime(),e),(!e._dur||mt(0,e.totalDuration(),r)-e._tTime>Gt)&&e.render(r,!0)),d(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(r=t;r._dp;)0<=r.rawTime()&&r.totalTime(r._tTime),r=r._dp;t._zTime=-Gt}}function j(t,e,r,i){return e.parent&&V(e),e._start=Y((D(r)?r:r||t!==xt?dt(t,r,e):t._time)+e._delay),e._end=Y(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),function(t,e,r,i,n){void 0===r&&(r="_first");var s,a=t[i=void 0===i?"_last":i];if(n)for(s=e[n];a&&a[n]>s;)a=a._prev;a?(e._next=a._next,a._next=e):(e._next=t[r],t[r]=e),e._next?e._next._prev=e:t[i]=e,e._prev=a,e.parent=e._dp=t}(t,e,"_first","_last",t._sort?"_start":0),_t(e)||(t._recent=e),i||y(t,e),t}function Q(t,e){return(he.ScrollTrigger||R("scrollTrigger",e))&&he.ScrollTrigger.create(e,t)}function T(t,e,r,i){return Le(t,e),!t._initted||!r&&t._pt&&(t._dur&&!1!==t.vars.lazy||!t._dur&&t.vars.lazy)&&At!==Me.frame&&(fe.push(t),t._lazy=[e,i])}function w(t,e,r,i){var n=t._repeat,s=Y(e)||0,e=t._tTime/t._tDur;return e&&!i&&(t._time*=s/t._dur),t._dur=s,t._tDur=n?n<0?1e10:Y(s*(n+1)+t._rDelay*n):s,0<e&&!i?v(t,t._tTime=t._tDur*e):t.parent&&x(t),r||d(t.parent,t),t}function b(t){return t instanceof Be?d(t):w(t,t._dur)}function M(t,e,r){var i,n,s=D(e[1]),a=(s?2:1)+(t<2?0:1),o=e[a];if(s&&(o.duration=e[1]),o.parent=r,t){for(i=o,n=r;n&&!("immediateRender"in i);)i=n.vars.defaults||{},n=E(n.vars.inherit)&&n.parent;o.immediateRender=E(i.immediateRender),t<2?o.runBackwards=1:o.startAt=e[a-1]}return new Ve(e[0],o,e[1+a])}function O(t,e){return t||0===t?e(t):e}function G(t,e){return P(t)&&(e=ue.exec(t))?t.substr(e.index+e[0].length):""}function k(t,e){return t&&S(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&S(t[0]))&&!t.nodeType&&t!==wt}function A(t){return t.sort(function(){return.5-Math.random()})}function W(t){if(f(t))return t;var c=S(t)?t:{each:t},_=Pe(c.ease),d=c.from||0,m=parseFloat(c.base)||0,g={},t=0<d&&d<1,v=isNaN(d)||t,y=c.axis,T=d,x=d;return P(d)?T=x={center:.5,edges:.5,end:1}[d]||0:!t&&v&&(T=d[0],x=d[1]),function(t,e,r){var i,n,s,a,o,u,h,l,f=(r||c).length,p=g[f];if(!p){if(!(l="auto"===c.grid?0:(c.grid||[1,Qt])[1])){for(u=-Qt;u<(u=r[l++].getBoundingClientRect().left)&&l<f;);l--}for(p=g[f]=[],i=v?Math.min(l,f)*T-.5:d%l,n=l===Qt?0:v?f*x/l-.5:d/l|0,h=Qt,o=u=0;o<f;o++)s=o%l-i,a=n-(o/l|0),p[o]=a=y?Math.abs("y"===y?a:s):$t(s*s+a*a),u<a&&(u=a),a<h&&(h=a);"random"===d&&A(p),p.max=u-h,p.min=h,p.v=f=(parseFloat(c.amount)||parseFloat(c.each)*(f<l?f-1:y?"y"===y?f/l:l:Math.max(l,f/l))||0)*("edges"===d?-1:1),p.b=f<0?m-f:m,p.u=G(c.amount||c.each)||0,_=_&&f<0?De(_):_}return f=(p[t]-p.min)/p.max||0,Y(p.b+(_?_(f):f)*p.v)+p.u}}function H(r){var i=Math.pow(10,((r+"").split(".")[1]||"").length);return function(t){var e=Math.round(parseFloat(t)/r)*r*i;return(e-e%1)/i+(D(t)?0:G(t))}}function Z(u,t){var h,l,e=ee(u);return!e&&S(u)&&(h=e=u.radius||Qt,u.values?(u=gt(u.values),(l=!D(u[0]))&&(h*=h)):u=H(u.increment)),O(t,e?f(u)?function(t){return l=u(t),Math.abs(l-t)<=h?l:t}:function(t){for(var e,r,i=parseFloat(l?t.x:t),n=parseFloat(l?t.y:0),s=Qt,a=0,o=u.length;o--;)(e=l?(e=u[o].x-i)*e+(r=u[o].y-n)*r:Math.abs(u[o]-i))<s&&(s=e,a=o);return a=!h||s<=h?u[a]:t,l||a===t||D(t)?a:a+G(t)}:H(u))}function $(t,e,r,i){return O(ee(t)?!e:!0===r?!!(r=0):!i,function(){return ee(t)?t[~~(Math.random()*t.length)]:(r=r||1e-5)&&(i=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((t-r/2+Math.random()*(e-t+.99*r))/r)*r*i)/i})}function J(e,r,t){return O(t,function(t){return e[~~r(t)]})}function K(t){for(var e,r,i,n,s=0,a="";~(e=t.indexOf("random(",s));)i=t.indexOf(")",e),n="["===t.charAt(e+7),r=t.substr(e+7,i-e-7).match(n?oe:re),a+=t.substr(s,e-s)+$(n?r:+r[0],n?0:+r[1],+r[2]||1e-5),s=i+1;return a+t.substr(s,t.length-s)}function tt(t,e,r){var i,n,s,a=t.labels,o=Qt;for(i in a)(n=a[i]-e)<0==!!r&&n&&o>(n=Math.abs(n))&&(s=i,o=n);return s}function et(t){return V(t),t.scrollTrigger&&t.scrollTrigger.kill(!1),t.progress()<1&&yt(t,"onInterrupt"),t}function rt(t,e,r){return(6*(t+=t<0?1:1<t?-1:0)<1?e+(r-e)*t*6:t<.5?r:3*t<2?e+(r-e)*(2/3-t)*6:e)*Te+.5|0}function it(t,e,r){var i,n,s,a,o,u,h,l=t?D(t)?[t>>16,t>>8&Te,t&Te]:0:xe.black;if(!l){if(","===t.substr(-1)&&(t=t.substr(0,t.length-1)),xe[t])l=xe[t];else if("#"===t.charAt(0)){if(9===(t=t.length<6?"#"+(i=t.charAt(1))+i+(n=t.charAt(2))+n+(s=t.charAt(3))+s+(5===t.length?t.charAt(4)+t.charAt(4):""):t).length)return[(l=parseInt(t.substr(1,6),16))>>16,l>>8&Te,l&Te,parseInt(t.substr(7),16)/255];l=[(t=parseInt(t.substr(1),16))>>16,t>>8&Te,t&Te]}else if("hsl"===t.substr(0,3))if(l=h=t.match(re),e){if(~t.indexOf("="))return l=t.match(ie),r&&l.length<4&&(l[3]=1),l}else a=+l[0]%360/360,o=l[1]/100,i=2*(u=l[2]/100)-(n=u<=.5?u*(o+1):u+o-u*o),3<l.length&&(l[3]*=1),l[0]=rt(a+1/3,i,n),l[1]=rt(a,i,n),l[2]=rt(a-1/3,i,n);else l=t.match(re)||xe.transparent;l=l.map(Number)}return e&&!h&&(i=l[0]/Te,n=l[1]/Te,s=l[2]/Te,u=((t=Math.max(i,n,s))+(e=Math.min(i,n,s)))/2,t===e?a=o=0:(h=t-e,o=.5<u?h/(2-t-e):h/(t+e),a=t===i?(n-s)/h+(n<s?6:0):t===n?(s-i)/h+2:(i-n)/h+4,a*=60),l[0]=~~(a+.5),l[1]=~~(100*o+.5),l[2]=~~(100*u+.5)),r&&l.length<4&&(l[3]=1),l}function nt(t){var e=[],r=[],i=-1;return t.split(we).forEach(function(t){t=t.match(ne)||[];e.push.apply(e,t),r.push(i+=t.length+1)}),e.c=r,e}function st(t,e,r){var i,n,s,a,o="",u=(t+o).match(we),h=e?"hsla(":"rgba(",l=0;if(!u)return t;if(u=u.map(function(t){return(t=it(t,e,1))&&h+(e?t[0]+","+t[1]+"%,"+t[2]+"%,"+t[3]:t.join(","))+")"}),r&&(s=nt(t),(i=r.c).join(o)!==s.c.join(o)))for(a=(n=t.replace(we,"1").split(ne)).length-1;l<a;l++)o+=n[l]+(~i.indexOf(l)?u.shift()||h+"0,0,0,0)":(s.length?s:u.length?u:r).shift());if(!n)for(a=(n=t.split(we)).length-1;l<a;l++)o+=n[l]+u[l];return o+n[a]}function at(t){var e=t.join(" ");if(we.lastIndex=0,we.test(e))return e=be.test(e),t[1]=st(t[1],e),t[0]=st(t[0],e,nt(t[1])),!0}function ot(t,e){for(var r,i=t._first;i;)i instanceof Be?ot(i,e):!i.vars.yoyoEase||i._yoyo&&i._repeat||i._yoyo===e||(i.timeline?ot(i.timeline,e):(r=i._ease,i._ease=i._yEase,i._yEase=r,i._yoyo=e)),i=i._next}function ut(t,e,r,i){void 0===r&&(r=function(t){return 1-e(1-t)}),void 0===i&&(i=function(t){return t<.5?e(2*t)/2:1-e(2*(1-t))/2});var n,s={easeIn:e,easeOut:r,easeInOut:i};return c(t,function(t){for(var e in ke[t]=he[t]=s,ke[n=t.toLowerCase()]=r,s)ke[n+("easeIn"===e?".in":"easeOut"===e?".out":".inOut")]=ke[t+"."+e]=s[e]}),1}function ht(e){return function(t){return t<.5?(1-e(1-2*t))/2:.5+e(2*(t-.5))/2}}function lt(r,t,e){function i(t){return 1===t?1:n*Math.pow(2,-10*t)*Kt((t-s)*a)+1}var n=1<=t?t:1,s=(a=(e||(r?.3:.45))/(t<1?t:1))/Wt*(Math.asin(1/n)||0),t="out"===r?i:"in"===r?function(t){return 1-i(1-t)}:ht(i),a=Wt/a;return t.config=function(t,e){return lt(r,t,e)},t}function ft(e,r){function i(t){return t?--t*t*((r+1)*t+r)+1:0}void 0===r&&(r=1.70158);var t="out"===e?i:"in"===e?function(t){return 1-i(1-t)}:ht(i);return t.config=function(t){return ft(e,t)},t}function pt(t,e){for(var r in e)t[r]=e[r];return t}function ct(t,e){return e=Math.floor(t/=e),t&&e===t?e-1:e}function _t(t){return"isFromStart"===(t=t.data)||"isStart"===t}function dt(t,e,r){var i,n,s,a=t.labels,o=t._recent||ve,u=t.duration()>=Qt?o.endTime(!1):t._dur;return P(e)&&(isNaN(e)||e in a)?(n=e.charAt(0),s="%"===e.substr(-1),i=e.indexOf("="),"<"===n||">"===n?(0<=i&&(e=e.replace(/=/,"")),("<"===n?o._start:o.endTime(0<=o._repeat))+(parseFloat(e.substr(1))||0)*(s?(i<0?o:r).totalDuration()/100:1)):i<0?(e in a||(a[e]=u),a[e]):(n=parseFloat(e.charAt(i-1)+e.substr(i+1)),s&&r&&(n=n/100*(ee(r)?r[0]:r).totalDuration()),1<i?dt(t,e.substr(0,i-1),r)+n:u+n)):null==e?u:+e}function mt(t,e,r){return r<t?t:e<r?e:r}function gt(t,e,r){return!P(t)||r||!bt&&Oe()?ee(t)?(i=r,void 0===n&&(n=[]),t.forEach(function(t){return P(t)&&!i||k(t,1)?n.push.apply(n,gt(t)):n.push(t)})||n):k(t)?ye.call(t,0):t?[t]:[]:ye.call((e||Mt).querySelectorAll(t),0);var i,n}function vt(e,t,r,i,n){var s=t-e,a=i-r;return O(n,function(t){return r+((t-e)/s*a||0)})}function yt(t,e,r){var i=t.vars,n=i[e];return n&&(e=i[e+"Params"],t=i.callbackScope||t,r&&fe.length&&U(),e?n.apply(t,e):n.call(t))}var Tt,xt,wt,bt,Mt,Ot,kt,At,Ct,Dt,Pt,St,zt,Rt,Et,Ft,Bt,It,Lt,Yt,Ut,Xt,Nt,qt,Vt={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},jt={duration:.5,overwrite:!1,delay:0},Qt=1e8,Gt=1/Qt,Wt=2*Math.PI,Ht=Wt/4,Zt=0,$t=Math.sqrt,Jt=Math.cos,Kt=Math.sin,te="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},ee=Array.isArray,re=/(?:-?\.?\d|\.)+/gi,ie=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,ne=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,se=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,ae=/[+-]=-?[.\d]+/,oe=/[^,'"\[\]\s]+/gi,ue=/[\d.+\-=]+(?:e[-+]\d*)*/i,he={},le={},fe=[],pe={},ce={},_e={},de=30,me=[],ge="",ve={_start:0,endTime:a,totalDuration:a},ye=[].slice,Te=255,xe={aqua:[0,Te,Te],lime:[0,Te,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Te],navy:[0,0,128],white:[Te,Te,Te],olive:[128,128,0],yellow:[Te,Te,0],orange:[Te,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Te,0,0],pink:[Te,192,203],cyan:[0,Te,Te],transparent:[Te,Te,Te,0]},we=function(){var t,e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b";for(t in xe)e+="|"+t+"\\b";return new RegExp(e+")","gi")}(),be=/hsl[a]?\(/,Me=(Ft=Date.now,Bt=500,It=33,Lt=Ft(),Yt=Lt,Xt=Ut=1e3/240,zt={time:0,frame:0,tick:function(){Se(!0)},deltaRatio:function(t){return Rt/(1e3/(t||60))},wake:function(){kt&&(!bt&&e()&&(wt=bt=window,Mt=wt.document||{},he.gsap=hr,(wt.gsapVersions||(wt.gsapVersions=[])).push(hr.version),i(Ot||wt.GreenSockGlobals||!wt.gsap&&wt||{}),St=wt.requestAnimationFrame),Dt&&zt.sleep(),Pt=St||function(t){return setTimeout(t,Xt-1e3*zt.time+1|0)},Ct=1,Se(2))},sleep:function(){(St?wt.cancelAnimationFrame:clearTimeout)(Dt),Ct=0,Pt=a},lagSmoothing:function(t,e){Bt=t||1e8,It=Math.min(e,Bt,0)},fps:function(t){Ut=1e3/(t||240),Xt=1e3*zt.time+Ut},add:function(t){Nt.indexOf(t)<0&&Nt.push(t),Oe()},remove:function(t,e){~(e=Nt.indexOf(t))&&Nt.splice(e,1)&&e<=Et&&Et--},_listeners:Nt=[]}),Oe=function(){return!Ct&&Me.wake()},ke={},Ae=/^[\d.\-M][\d.\-,\s]/,Ce=/["']/g,De=function(e){return function(t){return 1-e(1-t)}},Pe=function(t,e){return t&&(f(t)?t:ke[t]||(s=((r=t)+"").split("("),(a=ke[s[0]])&&1<s.length&&a.config?a.config.apply(null,~r.indexOf("{")?[function(t){for(var e,r,i,n={},s=t.substr(1,t.length-3).split(":"),a=s[0],o=1,u=s.length;o<u;o++)r=s[o],e=o!==u-1?r.lastIndexOf(","):r.length,i=r.substr(0,e),n[a]=isNaN(i)?i.replace(Ce,"").trim():+i,a=r.substr(e+1).trim();return n}(s[1])]:(n=(i=r).indexOf("(")+1,t=i.indexOf(")"),s=i.indexOf("(",n),i.substring(n,~s&&s<t?i.indexOf(")",t+1):t).split(",").map(h))):ke._CE&&Ae.test(r)?ke._CE("",r):a))||e;var r,i,n,s,a};function Se(t){var e,r,i,n=Ft()-Yt,s=!0===t;if(Bt<n&&(Lt+=n-It),(0<(n=(r=(Yt+=n)-Lt)-Xt)||s)&&(i=++zt.frame,Rt=r-1e3*zt.time,zt.time=r/=1e3,Xt+=n+(Ut<=n?4:Ut-n),e=1),s||(Dt=Pt(Se)),e)for(Et=0;Et<Nt.length;Et++)Nt[Et](r,Rt,i,t)}function ze(t){return t<1/2.75?qt*t*t:t<.7272727272727273?qt*Math.pow(t-1.5/2.75,2)+.75:t<.9090909090909092?qt*(t-=2.25/2.75)*t+.9375:qt*Math.pow(t-2.625/2.75,2)+.984375}c("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var r=e<5?e+1:e;ut(t+",Power"+(r-1),e?function(t){return Math.pow(t,r)}:function(t){return t},function(t){return 1-Math.pow(1-t,r)},function(t){return t<.5?Math.pow(2*t,r)/2:1-Math.pow(2*(1-t),r)/2})}),ke.Linear.easeNone=ke.none=ke.Linear.easeIn,ut("Elastic",lt("in"),lt("out"),lt()),qt=7.5625,ut("Bounce",function(t){return 1-ze(1-t)},ze),ut("Expo",function(t){return t?Math.pow(2,10*(t-1)):0}),ut("Circ",function(t){return-($t(1-t*t)-1)}),ut("Sine",function(t){return 1===t?1:1-Jt(t*Ht)}),ut("Back",ft("in"),ft("out"),ft()),ke.SteppedEase=ke.steps=he.SteppedEase={config:function(t,e){var r=1/(t=void 0===t?1:t),i=t+(e?0:1),n=e?1:0;return function(t){return((i*mt(0,.99999999,t)|0)+n)*r}}},jt.ease=ke["quad.out"],c("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return ge+=t+","+t+"Params,"});var Re=function(t,e){this.id=Zt++,(t._gsap=this).target=t,this.harness=e,this.get=e?e.get:o,this.set=e?e.getSetter:rr},Ee=((Li=Fe.prototype).delay=function(t){return t||0===t?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay),this._delay=t,this):this._delay},Li.duration=function(t){return arguments.length?this.totalDuration(0<this._repeat?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},Li.totalDuration=function(t){return arguments.length?(this._dirty=0,w(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},Li.totalTime=function(t,e){if(Oe(),!arguments.length)return this._tTime;var r=this._dp;if(r&&r.smoothChildTiming&&this._ts){for(v(this,t),!r._dp||r.parent||y(r,this);r&&r.parent;)r.parent._time!==r._start+(0<=r._ts?r._tTime/r._ts:(r.totalDuration()-r._tTime)/-r._ts)&&r.totalTime(r._tTime,!0),r=r.parent;!this.parent&&this._dp.autoRemoveChildren&&(0<this._ts&&t<this._tDur||this._ts<0&&0<t||!this._tDur&&!t)&&j(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!e||this._initted&&Math.abs(this._zTime)===Gt||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),u(this,t,e)),this},Li.time=function(t,e){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+m(this))%(this._dur+this._rDelay)||(t?this._dur:0),e):this._time},Li.totalProgress=function(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.ratio},Li.progress=function(t,e){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?t:1-t)+m(this),e):this.duration()?Math.min(1,this._time/this._dur):this.ratio},Li.iteration=function(t,e){var r=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*r,e):this._repeat?ct(this._tTime,r)+1:1},Li.timeScale=function(t){if(!arguments.length)return this._rts===-Gt?0:this._rts;if(this._rts===t)return this;var e=this.parent&&this._ts?g(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||t===-Gt?0:this._rts,function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent}(this.totalTime(mt(-this._delay,this._tDur,e),!0)),x(this),this},Li.paused=function(t){return arguments.length?(this._ps!==t&&((this._ps=t)?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Oe(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&Math.abs(this._zTime)!==Gt&&(this._tTime-=Gt)))),this):this._ps},Li.startTime=function(t){if(arguments.length){this._start=t;var e=this.parent||this._dp;return!e||!e._sort&&this.parent||j(e,this,t-this._delay),this}return this._start},Li.endTime=function(t){return this._start+(E(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},Li.rawTime=function(t){var e=this.parent||this._dp;return e?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?g(e.rawTime(t),this):this._tTime:this._tTime},Li.globalTime=function(t){for(var e=this,r=arguments.length?t:e.rawTime();e;)r=e._start+r/(e._ts||1),e=e._dp;return r},Li.repeat=function(t){return arguments.length?(this._repeat=t===1/0?-2:t,b(this)):-2===this._repeat?1/0:this._repeat},Li.repeatDelay=function(t){if(arguments.length){var e=this._time;return this._rDelay=t,b(this),e?this.time(e):this}return this._rDelay},Li.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},Li.seek=function(t,e){return this.totalTime(dt(this,t),E(e))},Li.restart=function(t,e){return this.play().totalTime(t?-this._delay:0,E(e))},Li.play=function(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},Li.reverse=function(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},Li.pause=function(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},Li.resume=function(){return this.paused(!1)},Li.reversed=function(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-Gt:0)),this):this._rts<0},Li.invalidate=function(){return this._initted=this._act=0,this._zTime=-Gt,this},Li.isActive=function(){var t,e=this.parent||this._dp,r=this._start;return!(e&&!(this._ts&&this._initted&&e.isActive()&&(t=e.rawTime(!0))>=r&&t<this.endTime(!0)-Gt))},Li.eventCallback=function(t,e,r){var i=this.vars;return 1<arguments.length?(e?(i[t]=e,r&&(i[t+"Params"]=r),"onUpdate"===t&&(this._onUpdate=e)):delete i[t],this):i[t]},Li.then=function(i){var n=this;return new Promise(function(e){function t(){var t=n.then;n.then=null,f(r)&&(r=r(n))&&(r.then||r===n)&&(n.then=t),e(r),n.then=t}var r=f(i)?i:l;n._initted&&1===n.totalProgress()&&0<=n._ts||!n._tTime&&n._ts<0?t():n._prom=t})},Li.kill=function(){et(this)},Fe);function Fe(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,w(this,+t.duration,1,1),this.data=t.data,Ct||Me.wake()}X(Ee.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Gt,_prom:0,_ps:!1,_rts:1});var Be=function(i){function t(t,e){var r;return(r=i.call(this,t=void 0===t?{}:t)||this).labels={},r.smoothChildTiming=!!t.smoothChildTiming,r.autoRemoveChildren=!!t.autoRemoveChildren,r._sort=E(t.sortChildren),xt&&j(t.parent||xt,C(r),e),t.reversed&&r.reverse(),t.paused&&r.paused(!0),t.scrollTrigger&&Q(C(r),t.scrollTrigger),r}r(t,i);var e=t.prototype;return e.to=function(t,e,r){return M(0,arguments,this),this},e.from=function(t,e,r){return M(1,arguments,this),this},e.fromTo=function(t,e,r,i){return M(2,arguments,this),this},e.set=function(t,e,r){return e.duration=0,e.parent=this,q(e).repeatDelay||(e.repeat=0),e.immediateRender=!!e.immediateRender,new Ve(t,e,dt(this,r),1),this},e.call=function(t,e,r){return j(this,Ve.delayedCall(0,t,e),r)},e.staggerTo=function(t,e,r,i,n,s,a){return r.duration=e,r.stagger=r.stagger||i,r.onComplete=s,r.onCompleteParams=a,r.parent=this,new Ve(t,r,dt(this,n)),this},e.staggerFrom=function(t,e,r,i,n,s,a){return r.runBackwards=1,q(r).immediateRender=E(r.immediateRender),this.staggerTo(t,e,r,i,n,s,a)},e.staggerFromTo=function(t,e,r,i,n,s,a,o){return i.startAt=r,q(i).immediateRender=E(i.immediateRender),this.staggerTo(t,e,i,n,s,a,o)},e.render=function(t,e,r){var i,n,s,a,o,u,h,l,f,p,c=this._time,_=this._dirty?this.totalDuration():this._tDur,d=this._dur,m=t<=0?0:Y(t),g=this._zTime<0!=t<0&&(this._initted||!d);if((m=this!==xt&&_<m&&0<=t?_:m)!==this._tTime||r||g){if(c!==this._time&&d&&(m+=this._time-c,t+=this._time-c),i=m,l=this._start,o=!(h=this._ts),g&&(d||(c=this._zTime),!t&&e||(this._zTime=t)),this._repeat){if(v=this._yoyo,a=d+this._rDelay,this._repeat<-1&&t<0)return this.totalTime(100*a+t,e,r);if(i=Y(m%a),m===_?(s=this._repeat,i=d):((s=~~(m/a))&&s===m/a&&(i=d,s--),d<i&&(i=d)),f=ct(this._tTime,a),v&&1&s&&(i=d-i,p=1),s!==(f=!c&&this._tTime&&f!==s?s:f)&&!this._lock){var g=v&&1&f,v=g===(v&&1&s),c=(g=s<f?!g:g)?0:d;if(this._lock=1,this.render(c||(p?0:Y(s*a)),e,!d)._lock=0,this._tTime=m,!e&&this.parent&&yt(this,"onRepeat"),this.vars.repeatRefresh&&!p&&(this.invalidate()._lock=1),c&&c!==this._time||o!=!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(d=this._dur,_=this._tDur,v&&(this._lock=2,this.render(c=g?d:-1e-4,!0),this.vars.repeatRefresh&&!p&&this.invalidate()),this._lock=0,!this._ts&&!o)return this;ot(this,p)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(u=function(t,e,r){var i;if(e<r)for(i=t._first;i&&i._start<=r;){if("isPause"===i.data&&i._start>e)return i;i=i._next}else for(i=t._last;i&&i._start>=r;){if("isPause"===i.data&&i._start<e)return i;i=i._prev}}(this,Y(c),Y(i)))&&(m-=i-(i=u._start)),this._tTime=m,this._time=i,this._act=!h,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=t,c=0),!c&&i&&!e&&(yt(this,"onStart"),this._tTime!==m))return this;if(c<=i&&0<=t)for(y=this._first;y;){if(n=y._next,(y._act||i>=y._start)&&y._ts&&u!==y){if(y.parent!==this)return this.render(t,e,r);if(y.render(0<y._ts?(i-y._start)*y._ts:(y._dirty?y.totalDuration():y._tDur)+(i-y._start)*y._ts,e,r),i!==this._time||!this._ts&&!o){u=0,n&&(m+=this._zTime=-Gt);break}}y=n}else for(var y=this._last,T=t<0?t:i;y;){if(n=y._prev,(y._act||T<=y._end)&&y._ts&&u!==y){if(y.parent!==this)return this.render(t,e,r);if(y.render(0<y._ts?(T-y._start)*y._ts:(y._dirty?y.totalDuration():y._tDur)+(T-y._start)*y._ts,e,r),i!==this._time||!this._ts&&!o){u=0,n&&(m+=this._zTime=T?-Gt:Gt);break}}y=n}if(u&&!e&&(this.pause(),u.render(c<=i?0:-Gt)._zTime=c<=i?1:-1,this._ts))return this._start=l,x(this),this.render(t,e,r);this._onUpdate&&!e&&yt(this,"onUpdate",!0),(m===_&&_>=this.totalDuration()||!m&&c)&&(l!==this._start&&Math.abs(h)===Math.abs(this._ts)||this._lock||(!t&&d||!(m===_&&0<this._ts||!m&&this._ts<0)||V(this,1),e||t<0&&!c||!m&&!c&&_||(yt(this,m===_&&0<=t?"onComplete":"onReverseComplete",!0),!this._prom||m<_&&0<this.timeScale()||this._prom())))}return this},e.add=function(t,e){var r=this;if(D(e)||(e=dt(this,e,t)),!(t instanceof Ee)){if(ee(t))return t.forEach(function(t){return r.add(t,e)}),this;if(P(t))return this.addLabel(t,e);if(!f(t))return this;t=Ve.delayedCall(0,t)}return this!==t?j(this,t,e):this},e.getChildren=function(t,e,r,i){void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===r&&(r=!0),void 0===i&&(i=-Qt);for(var n=[],s=this._first;s;)s._start>=i&&(s instanceof Ve?e&&n.push(s):(r&&n.push(s),t&&n.push.apply(n,s.getChildren(!0,e,r)))),s=s._next;return n},e.getById=function(t){for(var e=this.getChildren(1,1,1),r=e.length;r--;)if(e[r].vars.id===t)return e[r]},e.remove=function(t){return P(t)?this.removeLabel(t):f(t)?this.killTweensOf(t):(_(this,t),t===this._recent&&(this._recent=this._last),d(this))},e.totalTime=function(t,e){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Y(Me.time-(0<this._ts?t/this._ts:(this.totalDuration()-t)/-this._ts))),i.prototype.totalTime.call(this,t,e),this._forcing=0,this):this._tTime},e.addLabel=function(t,e){return this.labels[t]=dt(this,e),this},e.removeLabel=function(t){return delete this.labels[t],this},e.addPause=function(t,e,r){r=Ve.delayedCall(0,e||a,r);return r.data="isPause",this._hasPause=1,j(this,r,dt(this,t))},e.removePause=function(t){var e=this._first;for(t=dt(this,t);e;)e._start===t&&"isPause"===e.data&&V(e),e=e._next},e.killTweensOf=function(t,e,r){for(var i=this.getTweensOf(t,r),n=i.length;n--;)Ue!==i[n]&&i[n].kill(t,e);return this},e.getTweensOf=function(t,e){for(var r,i=[],n=gt(t),s=this._first,a=D(e);s;)s instanceof Ve?function(t,e){for(var r=e.length,i=0;t.indexOf(e[i])<0&&++i<r;);return i<r}(s._targets,n)&&(a?(!Ue||s._initted&&s._ts)&&s.globalTime(0)<=e&&s.globalTime(s.totalDuration())>e:!e||s.isActive())&&i.push(s):(r=s.getTweensOf(n,e)).length&&i.push.apply(i,r),s=s._next;return i},e.tweenTo=function(t,e){e=e||{};var r,i=this,n=dt(i,t),s=e.startAt,a=e.onStart,o=e.onStartParams,t=e.immediateRender,u=Ve.to(i,X({ease:e.ease||"none",lazy:!1,immediateRender:!1,time:n,overwrite:"auto",duration:e.duration||Math.abs((n-(s&&"time"in s?s.time:i._time))/i.timeScale())||Gt,onStart:function(){var t;i.pause(),r||(t=e.duration||Math.abs((n-(s&&"time"in s?s.time:i._time))/i.timeScale()),u._dur!==t&&w(u,t,0,1).render(u._time,!0,!0),r=1),a&&a.apply(u,o||[])}},e));return t?u.render(0):u},e.tweenFromTo=function(t,e,r){return this.tweenTo(e,X({startAt:{time:dt(this,t)}},r))},e.recent=function(){return this._recent},e.nextLabel=function(t){return void 0===t&&(t=this._time),tt(this,dt(this,t))},e.previousLabel=function(t){return void 0===t&&(t=this._time),tt(this,dt(this,t),1)},e.currentLabel=function(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+Gt)},e.shiftChildren=function(t,e,r){void 0===r&&(r=0);for(var i,n=this._first,s=this.labels;n;)n._start>=r&&(n._start+=t,n._end+=t),n=n._next;if(e)for(i in s)s[i]>=r&&(s[i]+=t);return d(this)},e.invalidate=function(){var t=this._first;for(this._lock=0;t;)t.invalidate(),t=t._next;return i.prototype.invalidate.call(this)},e.clear=function(t){void 0===t&&(t=!0);for(var e,r=this._first;r;)e=r._next,this.remove(r),r=e;return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={}),d(this)},e.totalDuration=function(t){var e,r,i,n=0,s=this,a=s._last,o=Qt;if(arguments.length)return s.timeScale((s._repeat<0?s.duration():s.totalDuration())/(s.reversed()?-t:t));if(s._dirty){for(i=s.parent;a;)e=a._prev,a._dirty&&a.totalDuration(),o<(r=a._start)&&s._sort&&a._ts&&!s._lock?(s._lock=1,j(s,a,r-a._delay,1)._lock=0):o=r,r<0&&a._ts&&(n-=r,(!i&&!s._dp||i&&i.smoothChildTiming)&&(s._start+=r/s._ts,s._time-=r,s._tTime-=r),s.shiftChildren(-r,!1,-1/0),o=0),a._end>n&&a._ts&&(n=a._end),a=e;w(s,s===xt&&s._time>n?s._time:n,1,1),s._dirty=0}return s._tDur},t.updateRoot=function(t){if(xt._ts&&(u(xt,g(t,xt)),At=Me.frame),Me.frame>=de){de+=Vt.autoSleep||120;var e=xt._first;if((!e||!e._ts)&&Vt.autoSleep&&Me._listeners.length<2){for(;e&&!e._ts;)e=e._next;e||Me.sleep()}}},t}(Ee);function Ie(t,e,r,i,n,s){var a,o,u,h;if(ce[t]&&!1!==(a=new ce[t]).init(n,a.rawVars?e[t]:function(t,e,r,i,n){if(!S(t=f(t)?Ye(t,n,e,r,i):t)||t.style&&t.nodeType||ee(t)||te(t))return P(t)?Ye(t,n,e,r,i):t;var s,a={};for(s in t)a[s]=Ye(t[s],n,e,r,i);return a}(e[t],i,n,s,r),r,i,s)&&(r._pt=o=new nr(r._pt,n,t,0,1,a.render,a,0,a.priority),r!==ur))for(u=r._ptLookup[r._targets.indexOf(n)],h=a._props.length;h--;)u[a._props[h]]=o;return a}X(Be.prototype,{_lock:0,_hasPause:0,_forcing:0});function Le(t,e){var r,i,n,s,a,o,u,h,l,f,p,c,_,d=t.vars,m=d.ease,g=d.startAt,v=d.immediateRender,y=d.lazy,T=d.onUpdate,x=d.onUpdateParams,w=d.callbackScope,b=d.runBackwards,M=d.yoyoEase,O=d.keyframes,k=d.autoRevert,A=t._dur,C=t._startAt,D=t._targets,P=t.parent,S=P&&"nested"===P.data?P.parent._targets:D,z="auto"===t._overwrite&&!Tt,R=t.timeline;if(t._ease=Pe(m=!(!R||O&&m)?"none":m,jt.ease),t._yEase=M?De(Pe(!0===M?m:M,jt.ease)):0,M&&t._yoyo&&!t._repeat&&(M=t._yEase,t._yEase=t._ease,t._ease=M),t._from=!R&&!!d.runBackwards,!R||O&&!d.stagger){if(c=(h=D[0]?I(D[0]).harness:0)&&d[h.prop],r=N(d,le),C&&V(C.render(-1,!0)),g)if(V(t._startAt=Ve.set(D,X({data:"isStart",overwrite:!1,parent:P,immediateRender:!0,lazy:E(y),startAt:null,delay:0,onUpdate:T,onUpdateParams:x,callbackScope:w,stagger:0},g))),e<0&&!v&&!k&&t._startAt.render(-1,!0),v){if(0<e&&!k&&(t._startAt=0),A&&e<=0)return void(e&&(t._zTime=e))}else!1===k&&(t._startAt=0);else if(b&&A)if(C)k||(t._startAt=0);else if(n=X({overwrite:!1,data:"isFromStart",lazy:(v=e?!1:v)&&E(y),immediateRender:v,stagger:0,parent:P},r),c&&(n[h.prop]=c),V(t._startAt=Ve.set(D,n)),e<0&&t._startAt.render(-1,!0),t._zTime=e,v){if(!e)return}else Le(t._startAt,Gt);for(t._pt=0,y=A&&E(y)||y&&!A,i=0;i<D.length;i++){if(u=(a=D[i])._gsap||B(D)[i]._gsap,t._ptLookup[i]=f={},pe[u.id]&&fe.length&&U(),p=S===D?i:S.indexOf(a),h&&!1!==(l=new h).init(a,c||r,t,p,S)&&(t._pt=s=new nr(t._pt,a,l.name,0,1,l.render,l,0,l.priority),l._props.forEach(function(t){f[t]=s}),l.priority&&(o=1)),!h||c)for(n in r)ce[n]&&(l=Ie(n,r,t,p,a,S))?l.priority&&(o=1):f[n]=s=Xe.call(t,a,n,"get",r[n],p,S,0,d.stringFilter);t._op&&t._op[i]&&t.kill(a,t._op[i]),z&&t._pt&&(Ue=t,xt.killTweensOf(a,f,t.globalTime(e)),_=!t.parent,Ue=0),t._pt&&y&&(pe[u.id]=1)}o&&ir(t),t._onInit&&t._onInit(t)}t._onUpdate=T,t._initted=(!t._op||t._pt)&&!_,O&&e<=0&&R.render(Qt,!0,!0)}function Ye(t,e,r,i,n){return f(t)?t.call(e,r,i,n):P(t)&&~t.indexOf("random(")?K(t):t}var Ue,Xe=function(t,e,r,i,n,s,a,o,u){f(i)&&(i=i(n||0,t,s));var h,n=t[e],s="get"!==r?r:f(n)?u?t[e.indexOf("set")||!f(t["get"+e.substr(3)])?e:"get"+e.substr(3)](u):t[e]():n,r=f(n)?u?He:We:Ge;if(P(i)&&("="===(i=~i.indexOf("random(")?K(i):i).charAt(1)&&(!(h=parseFloat(s)+parseFloat(i.substr(2))*("-"===i.charAt(0)?-1:1)+(G(s)||0))&&0!==h||(i=h))),s!==i)return isNaN(s*i)||""===i?(n||e in t||R(e,i),function(t,e,r,i,n,s,a){var o,u,h,l,f,p=new nr(this._pt,t,e,0,1,Je,null,n),c=0,_=0;for(p.b=r,p.e=i,r+="",(n=~(i+="").indexOf("random("))&&(i=K(i)),s&&(s(s=[r,i],t,e),r=s[0],i=s[1]),o=r.match(se)||[];f=se.exec(i);)h=f[0],l=i.substring(c,f.index),u?u=(u+1)%5:"rgba("===l.substr(-5)&&(u=1),h!==o[_++]&&(f=parseFloat(o[_-1])||0,p._pt={_next:p._pt,p:l||1===_?l:",",s:f,c:"="===h.charAt(1)?parseFloat(h.substr(2))*("-"===h.charAt(0)?-1:1):parseFloat(h)-f,m:u&&u<4?Math.round:0},c=se.lastIndex);return p.c=c<i.length?i.substring(c,i.length):"",p.fp=a,(ae.test(i)||n)&&(p.e=0),this._pt=p}.call(this,t,e,s,i,r,o||Vt.stringFilter,u)):(h=new nr(this._pt,t,e,+s||0,i-(s||0),"boolean"==typeof n?$e:Ze,0,r),u&&(h.fp=u),a&&h.modifier(a,this,t),this._pt=h)},Ne=ge+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase",qe={};c(Ne+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return qe[t]=1});var Ve=function(A){function n(t,e,r,i){var n;"number"==typeof e&&(r.duration=e,e=r,r=null);var s,a,o,u,h,l,f,p,c=(n=A.call(this,i?e:q(e))||this).vars,_=c.duration,d=c.delay,m=c.immediateRender,g=c.stagger,v=c.overwrite,y=c.keyframes,T=c.defaults,i=c.scrollTrigger,x=c.yoyoEase,c=e.parent||xt,w=(ee(t)||te(t)?D(t[0]):"length"in e)?[t]:gt(t);if(n._targets=w.length?B(w):F("GSAP target "+t+" not found. https://greensock.com",!Vt.nullTargetWarn)||[],n._ptLookup=[],n._overwrite=v,y||g||z(_)||z(d)){if(e=n.vars,(s=n.timeline=new Be({data:"nested",defaults:T||{}})).kill(),s.parent=s._dp=C(n),s._start=0,g||z(_)||z(d)){if(u=w.length,f=g&&W(g),S(g))for(h in g)~Ne.indexOf(h)&&((p=p||{})[h]=g[h]);for(a=0;a<u;a++)(o=N(e,qe)).stagger=0,x&&(o.yoyoEase=x),p&&pt(o,p),l=w[a],o.duration=+Ye(_,C(n),a,l,w),o.delay=(+Ye(d,C(n),a,l,w)||0)-n._delay,!g&&1===u&&o.delay&&(n._delay=d=o.delay,n._start+=d,o.delay=0),s.to(l,o,f?f(a,l,w):0),s._ease=ke.none;s.duration()?_=d=0:n.timeline=0}else if(y){q(X(s.vars.defaults,{ease:"none"})),s._ease=Pe(y.ease||e.ease||"none");var b,M,O,k=0;if(ee(y))y.forEach(function(t){return s.to(w,t,">")});else{for(h in o={},y)"ease"===h||"easeEach"===h||function(t,r,e,i){var n,s,a=r.ease||i||"power1.inOut";if(ee(r))s=e[t]||(e[t]=[]),r.forEach(function(t,e){return s.push({t:e/(r.length-1)*100,v:t,e:a})});else for(n in r)s=e[n]||(e[n]=[]),"ease"===n||s.push({t:parseFloat(t),v:r[n],e:a})}(h,y[h],o,y.easeEach);for(h in o)for(b=o[h].sort(function(t,e){return t.t-e.t}),a=k=0;a<b.length;a++)(O={ease:(M=b[a]).e,duration:(M.t-(a?b[a-1].t:0))/100*_})[h]=M.v,s.to(w,O,k),k+=O.duration;s.duration()<_&&s.to({},{duration:_-s.duration()})}}_||n.duration(_=s.duration())}else n.timeline=0;return!0!==v||Tt||(Ue=C(n),xt.killTweensOf(w),Ue=0),j(c,C(n),r),e.reversed&&n.reverse(),e.paused&&n.paused(!0),(m||!_&&!y&&n._start===Y(c._time)&&E(m)&&function t(e){return!e||e._ts&&t(e.parent)}(C(n))&&"nested"!==c.data)&&(n._tTime=-Gt,n.render(Math.max(0,-d))),i&&Q(C(n),i),n}r(n,A);var t=n.prototype;return t.render=function(t,e,r){var i,n,s,a,o,u,h,l,f,p=this._time,c=this._tDur,_=this._dur,d=c-Gt<t&&0<=t?c:t<Gt?0:t;if(_){if(d!==this._tTime||!t||r||!this._initted&&this._tTime||this._startAt&&this._zTime<0!=t<0){if(i=d,l=this.timeline,this._repeat){if(a=_+this._rDelay,this._repeat<-1&&t<0)return this.totalTime(100*a+t,e,r);if(i=Y(d%a),d===c?(s=this._repeat,i=_):((s=~~(d/a))&&s===d/a&&(i=_,s--),_<i&&(i=_)),(u=this._yoyo&&1&s)&&(f=this._yEase,i=_-i),o=ct(this._tTime,a),i===p&&!r&&this._initted)return this;s!==o&&(l&&this._yEase&&ot(l,u),!this.vars.repeatRefresh||u||this._lock||(this._lock=r=1,this.render(Y(a*s),!0).invalidate()._lock=0))}if(!this._initted){if(T(this,t<0?t:i,r,e))return this._tTime=0,this;if(_!==this._dur)return this.render(t,e,r)}if(this._tTime=d,this._time=i,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=h=(f||this._ease)(i/_),this._from&&(this.ratio=h=1-h),i&&!p&&!e&&(yt(this,"onStart"),this._tTime!==d))return this;for(n=this._pt;n;)n.r(h,n.d),n=n._next;l&&l.render(t<0?t:!i&&u?-Gt:l._dur*l._ease(i/this._dur),e,r)||this._startAt&&(this._zTime=t),this._onUpdate&&!e&&(t<0&&this._startAt&&this._startAt.render(t,!0,r),yt(this,"onUpdate")),this._repeat&&s!==o&&this.vars.onRepeat&&!e&&this.parent&&yt(this,"onRepeat"),d!==this._tDur&&d||this._tTime!==d||(t<0&&this._startAt&&!this._onUpdate&&this._startAt.render(t,!0,!0),!t&&_||!(d===this._tDur&&0<this._ts||!d&&this._ts<0)||V(this,1),e||t<0&&!p||!d&&!p||(yt(this,d===c?"onComplete":"onReverseComplete",!0),!this._prom||d<c&&0<this.timeScale()||this._prom()))}}else!function(t,e,r,i){var n,s,a=t.ratio,o=e<0||!e&&(!t._start&&function t(e){e=e.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||t(e))}(t)&&(t._initted||!_t(t))||(t._ts<0||t._dp._ts<0)&&!_t(t))?0:1,u=t._rDelay,h=0;if(u&&t._repeat&&(h=mt(0,t._tDur,e),s=ct(h,u),t._yoyo&&1&s&&(o=1-o),s!==ct(t._tTime,u)&&(a=1-o,t.vars.repeatRefresh&&t._initted&&t.invalidate())),o!==a||i||t._zTime===Gt||!e&&t._zTime){if(t._initted||!T(t,e,i,r)){for(i=t._zTime,t._zTime=e||(r?Gt:0),r=r||e&&!i,t.ratio=o,t._from&&(o=1-o),t._time=0,t._tTime=h,n=t._pt;n;)n.r(o,n.d),n=n._next;t._startAt&&e<0&&t._startAt.render(e,!0,!0),t._onUpdate&&!r&&yt(t,"onUpdate"),h&&t._repeat&&!r&&t.parent&&yt(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===o&&(o&&V(t,1),r||(yt(t,o?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}}else t._zTime||(t._zTime=e)}(this,t,e,r);return this},t.targets=function(){return this._targets},t.invalidate=function(){return this._pt=this._op=this._startAt=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(),A.prototype.invalidate.call(this)},t.kill=function(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?et(this):this;if(this.timeline){var r=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,Ue&&!0!==Ue.vars.overwrite)._first||et(this),this.parent&&r!==this.timeline.totalDuration()&&w(this,this._dur*this.timeline._tDur/r,0,1),this}var i,n,s,a,o,u,h,l=this._targets,f=t?gt(t):l,p=this._ptLookup,t=this._pt;if((!e||"all"===e)&&function(t,e){for(var r=t.length,i=r===e.length;i&&r--&&t[r]===e[r];);return r<0}(l,f))return"all"===e&&(this._pt=0),et(this);for(i=this._op=this._op||[],"all"!==e&&(P(e)&&(o={},c(e,function(t){return o[t]=1}),e=o),e=function(t,e){var r,i,n,s,t=t[0]?I(t[0]).harness:0,a=t&&t.aliases;if(!a)return e;for(i in r=pt({},e),a)if(i in r)for(n=(s=a[i].split(",")).length;n--;)r[s[n]]=r[i];return r}(l,e)),h=l.length;h--;)if(~f.indexOf(l[h]))for(o in n=p[h],"all"===e?(i[h]=e,a=n,s={}):(s=i[h]=i[h]||{},a=e),a)(u=n&&n[o])&&("kill"in u.d&&!0!==u.d.kill(o)||_(this,u,"_pt"),delete n[o]),"all"!==s&&(s[o]=1);return this._initted&&!this._pt&&t&&et(this),this},n.to=function(t,e,r){return new n(t,e,r)},n.from=function(t,e){return M(1,arguments)},n.delayedCall=function(t,e,r,i){return new n(e,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:e,onReverseComplete:e,onCompleteParams:r,onReverseCompleteParams:r,callbackScope:i})},n.fromTo=function(t,e,r){return M(2,arguments)},n.set=function(t,e){return e.duration=0,e.repeatDelay||(e.repeat=0),new n(t,e)},n.killTweensOf=function(t,e,r){return xt.killTweensOf(t,e,r)},n}(Ee);function je(t,e,r){return t.setAttribute(e,r)}function Qe(t,e,r,i){i.mSet(t,e,i.m.call(i.tween,r,i.mt),i)}X(Ve.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),c("staggerTo,staggerFrom,staggerFromTo",function(r){Ve[r]=function(){var t=new Be,e=ye.call(arguments,0);return e.splice("staggerFromTo"===r?5:4,0,0),t[r].apply(t,e)}});function Ge(t,e,r){return t[e]=r}function We(t,e,r){return t[e](r)}function He(t,e,r,i){return t[e](i.fp,r)}function Ze(t,e){return e.set(e.t,e.p,Math.round(1e6*(e.s+e.c*t))/1e6,e)}function $e(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)}function Je(t,e){var r=e._pt,i="";if(!t&&e.b)i=e.b;else if(1===t&&e.e)i=e.e;else{for(;r;)i=r.p+(r.m?r.m(r.s+r.c*t):Math.round(1e4*(r.s+r.c*t))/1e4)+i,r=r._next;i+=e.c}e.set(e.t,e.p,i,e)}function Ke(t,e){for(var r=e._pt;r;)r.r(t,r.d),r=r._next}function tr(t,e,r,i){for(var n,s=this._pt;s;)n=s._next,s.p===i&&s.modifier(t,e,r),s=n}function er(t){for(var e,r,i=this._pt;i;)r=i._next,i.p===t&&!i.op||i.op===t?_(this,i,"_pt"):i.dep||(e=1),i=r;return!e}var rr=function(t,e){return f(t[e])?We:n(t[e])&&t.setAttribute?je:Ge},ir=function(t){for(var e,r,i,n,s=t._pt;s;){for(e=s._next,r=i;r&&r.pr>s.pr;)r=r._next;(s._prev=r?r._prev:n)?s._prev._next=s:i=s,(s._next=r)?r._prev=s:n=s,s=e}t._pt=i},nr=(sr.prototype.modifier=function(t,e,r){this.mSet=this.mSet||this.set,this.set=Qe,this.m=t,this.mt=r,this.tween=e},sr);function sr(t,e,r,i,n,s,a,o,u){this.t=e,this.s=i,this.c=n,this.p=r,this.r=s||Ze,this.d=a||this,this.set=o||Ge,this.pr=u||0,(this._next=t)&&(t._prev=this)}c(ge+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(t){return le[t]=1}),he.TweenMax=he.TweenLite=Ve,he.TimelineLite=he.TimelineMax=Be,xt=new Be({sortChildren:!1,defaults:jt,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),Vt.stringFilter=at;var ar={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];e.forEach(function(t){var e=(t=!t.name&&t.default||t).name,r=f(t),i=e&&!r&&t.init?function(){this._props=[]}:t,n={init:a,render:Ke,add:Xe,kill:er,modifier:tr,rawVars:0},r={targetTest:0,get:0,getSetter:rr,aliases:{},register:0};if(Oe(),t!==i){if(ce[e])return;X(i,X(N(t,n),r)),pt(i.prototype,pt(n,N(t,r))),ce[i.prop=e]=i,t.targetTest&&(me.push(i),le[e]=1),e=("css"===e?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}s(e,i),t.register&&t.register(hr,i,nr)})},timeline:function(t){return new Be(t)},getTweensOf:function(t,e){return xt.getTweensOf(t,e)},getProperty:function(i,t,e,r){var n=I((i=P(i)?gt(i)[0]:i)||{}).get,s=e?l:h;return"native"===e&&(e=""),i&&(t?s((ce[t]&&ce[t].get||n)(i,t,e,r)):function(t,e,r){return s((ce[t]&&ce[t].get||n)(i,t,e,r))})},quickSetter:function(r,e,i){if(1<(r=gt(r)).length){var n=r.map(function(t){return hr.quickSetter(t,e,i)}),s=n.length;return function(t){for(var e=s;e--;)n[e](t)}}r=r[0]||{};var a=ce[e],o=I(r),u=o.harness&&(o.harness.aliases||{})[e]||e,h=a?function(t){var e=new a;ur._pt=0,e.init(r,i?t+i:t,ur,0,[r]),e.render(1,e),ur._pt&&Ke(1,ur)}:o.set(r,u);return a?h:function(t){return h(r,u,i?t+i:t,o,1)}},isTweening:function(t){return 0<xt.getTweensOf(t,!0).length},defaults:function(t){return t&&t.ease&&(t.ease=Pe(t.ease,jt.ease)),p(jt,t||{})},config:function(t){return p(Vt,t||{})},registerEffect:function(t){var i=t.name,n=t.effect,e=t.plugins,s=t.defaults,t=t.extendTimeline;(e||"").split(",").forEach(function(t){return t&&!ce[t]&&!he[t]&&F(i+" effect requires "+t+" plugin.")}),_e[i]=function(t,e,r){return n(gt(t),X(e||{},s),r)},t&&(Be.prototype[i]=function(t,e,r){return this.add(_e[i](t,S(e)?e:(r=e)&&{},this),r)})},registerEase:function(t,e){ke[t]=Pe(e)},parseEase:function(t,e){return arguments.length?Pe(t,e):ke},getById:function(t){return xt.getById(t)},exportRoot:function(t,e){var r,i,n=new Be(t=void 0===t?{}:t);for(n.smoothChildTiming=E(t.smoothChildTiming),xt.remove(n),n._dp=0,n._time=n._tTime=xt._time,r=xt._first;r;)i=r._next,!e&&!r._dur&&r instanceof Ve&&r.vars.onComplete===r._targets[0]||j(n,r,r._start-r._delay),r=i;return j(xt,n,0),n},utils:{wrap:function t(e,r,i){var n=r-e;return ee(e)?J(e,t(0,e.length),r):O(i,function(t){return(n+(t-e)%n)%n+e})},wrapYoyo:function t(e,r,i){var n=r-e,s=2*n;return ee(e)?J(e,t(0,e.length-1),r):O(i,function(t){return e+(n<(t=(s+(t-e)%s)%s||0)?s-t:t)})},distribute:W,random:$,snap:Z,normalize:function(t,e,r){return vt(t,e,0,1,r)},getUnit:G,clamp:function(e,r,t){return O(t,function(t){return mt(e,r,t)})},splitColor:it,toArray:gt,selector:function(r){return r=gt(r)[0]||F("Invalid scope")||{},function(t){var e=r.current||r.nativeElement||r;return gt(t,e.querySelectorAll?e:e===r?F("Invalid scope")||Mt.createElement("div"):r)}},mapRange:vt,pipe:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(t){return e.reduce(function(t,e){return e(t)},t)}},unitize:function(e,r){return function(t){return e(parseFloat(t))+(r||G(t))}},interpolate:function t(e,r,i,n){var s=isNaN(e+r)?0:function(t){return(1-t)*e+t*r};if(!s){var a,o,u,h,l,f=P(e),p={};if(!0===i&&(n=1)&&(i=null),f)e={p:e},r={p:r};else if(ee(e)&&!ee(r)){for(u=[],h=e.length,l=h-2,o=1;o<h;o++)u.push(t(e[o-1],e[o]));h--,s=function(t){t*=h;var e=Math.min(l,~~t);return u[e](t-e)},i=r}else n||(e=pt(ee(e)?[]:{},e));if(!u){for(a in r)Xe.call(p,e,a,"get",r[a]);s=function(t){return Ke(t,p),f?e.p:e}}}return O(i,s)},shuffle:A},install:i,effects:_e,ticker:Me,updateRoot:Be.updateRoot,plugins:ce,globalTimeline:xt,core:{PropTween:nr,globals:s,Tween:Ve,Timeline:Be,Animation:Ee,getCache:I,_removeLinkedListItem:_,suppressOverwrites:function(t){return Tt=t}}};function or(t,n){return{name:t,rawVars:1,init:function(t,i,e){e._onInit=function(t){var e,r;if(P(i)&&(e={},c(i,function(t){return e[t]=1}),i=e),n){for(r in e={},i)e[r]=n(i[r]);i=e}!function(t,e){var r,i,n,s=t._targets;for(r in e)for(i=s.length;i--;)(n=(n=t._ptLookup[i][r])&&n.d)&&(n._pt&&(n=function(t,e){for(var r=t._pt;r&&r.p!==e&&r.op!==e&&r.fp!==e;)r=r._next;return r}(n,r)),n&&n.modifier&&n.modifier(e[r],t,s[i],r))}(t,i)}}}}c("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return ar[t]=Ve[t]}),Me.add(Be.updateRoot);var ur=ar.to({},{duration:0}),hr=ar.registerPlugin({name:"attr",init:function(t,e,r,i,n){var s,a;for(s in e)(a=this.add(t,"setAttribute",(t.getAttribute(s)||0)+"",e[s],i,n,0,0,s))&&(a.op=s),this._props.push(s)}},{name:"endArray",init:function(t,e){for(var r=e.length;r--;)this.add(t,r,t[r]||0,e[r])}},or("roundProps",H),or("modifiers"),or("snap",Z))||ar;function lr(t,e){return e.set(e.t,e.p,Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)}function fr(t,e){return e.set(e.t,e.p,1===t?e.e:Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)}function pr(t,e){return e.set(e.t,e.p,t?Math.round(1e4*(e.s+e.c*t))/1e4+e.u:e.b,e)}function cr(t,e){t=e.s+e.c*t;e.set(e.t,e.p,~~(t+(t<0?-.5:.5))+e.u,e)}function _r(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)}function dr(t,e){return e.set(e.t,e.p,1!==t?e.b:e.e,e)}function mr(t,e,r){return t.style[e]=r}function gr(t,e,r){return t.style.setProperty(e,r)}function vr(t,e,r){return t._gsap[e]=r}function yr(t,e,r){return t._gsap.scaleX=t._gsap.scaleY=r}function Tr(t,e,r,i,n){t=t._gsap;t.scaleX=t.scaleY=r,t.renderTransform(n,t)}function xr(t,e,r,i,n){t=t._gsap;t[e]=r,t.renderTransform(n,t)}function wr(t,e){e=Xr.createElementNS?Xr.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Xr.createElement(t);return e.style?e:Xr.createElement(t)}function br(t,e,r){var i=getComputedStyle(t);return i[e]||i.getPropertyValue(e.replace(di,"-$1").toLowerCase())||i.getPropertyValue(e)||!r&&br(t,wi(e)||e,1)||""}function Mr(){"undefined"!=typeof window&&window.document&&(Nr=(Xr=window.document).documentElement,Vr=wr("div")||{style:{}},wr("div"),yi=wi(yi),Ti=yi+"Origin",Vr.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Qr=!!wi("perspective"),qr=1)}function Or(t){var e,r=wr("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,n=this.nextSibling,s=this.style.cssText;if(Nr.appendChild(r),r.appendChild(this),this.style.display="block",t)try{e=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=Or}catch(t){}else this._gsapBBox&&(e=this._gsapBBox());return i&&(n?i.insertBefore(this,n):i.appendChild(this)),Nr.removeChild(r),this.style.cssText=s,e}function kr(t,e){for(var r=e.length;r--;)if(t.hasAttribute(e[r]))return t.getAttribute(e[r])}function Ar(e){var r;try{r=e.getBBox()}catch(t){r=Or.call(e,!0)}return!(r=!(r&&(r.width||r.height)||e.getBBox===Or)?Or.call(e,!0):r)||r.width||r.x||r.y?r:{x:+kr(e,["x","cx","x1"])||0,y:+kr(e,["y","cy","y1"])||0,width:0,height:0}}function Cr(t){return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!Ar(t))}function Dr(t,e){e&&(t=t.style,e in fi&&e!==Ti&&(e=yi),t.removeProperty?("ms"!==e.substr(0,2)&&"webkit"!==e.substr(0,6)||(e="-"+e),t.removeProperty(e.replace(di,"-$1").toLowerCase())):t.removeAttribute(e))}function Pr(t,e,r,i,n,s){s=new nr(t._pt,e,r,0,1,s?dr:_r);return(t._pt=s).b=i,s.e=n,t._props.push(r),s}function Sr(t,e,r,i){var n,s=parseFloat(r)||0,a=(r+"").trim().substr((s+"").length)||"px",o=Vr.style,u=mi.test(e),h="svg"===t.tagName.toLowerCase(),l=(h?"client":"offset")+(u?"Width":"Height"),f="px"===i,p="%"===i;return i===a||!s||bi[i]||bi[a]?s:("px"===a||f||(s=Sr(t,e,r,"px")),r=t.getCTM&&Cr(t),!p&&"%"!==a||!fi[e]&&!~e.indexOf("adius")?(o[u?"width":"height"]=100+(f?a:i),i=~e.indexOf("adius")||"em"===i&&t.appendChild&&!h?t:t.parentNode,(h=(i=!(i=r?(t.ownerSVGElement||{}).parentNode:i)||i===Xr||!i.appendChild?Xr.body:i)._gsap)&&p&&h.width&&u&&h.time===Me.time?L(s/h.width*100):(!p&&"%"!==a||(o.position=br(t,"position")),i===t&&(o.position="static"),i.appendChild(Vr),n=Vr[l],i.removeChild(Vr),o.position="absolute",u&&p&&((h=I(i)).time=Me.time,h.width=i[l]),L(f?n*s/100:n&&s?100/n*s:0))):(n=r?t.getBBox()[u?"width":"height"]:t[l],L(p?s/n*100:s/100*n)))}function zr(t,e,r,i){var n;return qr||Mr(),e in vi&&"transform"!==e&&~(e=vi[e]).indexOf(",")&&(e=e.split(",")[0]),fi[e]&&"transform"!==e?(n=Ci(t,i),n="transformOrigin"!==e?n[e]:n.svg?n.origin:Di(br(t,Ti))+" "+n.zOrigin+"px"):(n=t.style[e])&&"auto"!==n&&!i&&!~(n+"").indexOf("calc(")||(n=Oi[e]&&Oi[e](t,e,r)||br(t,e)||o(t,e)||("opacity"===e?1:0)),r&&!~(n+"").trim().indexOf(" ")?Sr(t,e,n,r)+r:n}function Rr(t,e,r,i){var n;r&&"none"!==r||((s=(n=wi(e,t,1))&&br(t,n,1))&&s!==r?(e=n,r=s):"borderColor"===e&&(r=br(t,"borderTopColor")));var s,a,o,u,h,l,f,p,c,_,d=new nr(this._pt,t.style,e,0,1,Je),m=0,g=0;if(d.b=r,d.e=i,r+="","auto"==(i+="")&&(t.style[e]=i,i=br(t,e)||i,t.style[e]=r),at(s=[r,i]),i=s[1],a=(r=s[0]).match(ne)||[],(i.match(ne)||[]).length){for(;l=ne.exec(i);)p=l[0],f=i.substring(m,l.index),u?u=(u+1)%5:"rgba("!==f.substr(-5)&&"hsla("!==f.substr(-5)||(u=1),p!==(h=a[g++]||"")&&(o=parseFloat(h)||0,c=h.substr((o+"").length),(_="="===p.charAt(1)?+(p.charAt(0)+"1"):0)&&(p=p.substr(2)),l=parseFloat(p),p=p.substr((l+"").length),m=ne.lastIndex-p.length,p||(p=p||Vt.units[e]||c,m===i.length&&(i+=p,d.e+=p)),c!==p&&(o=Sr(t,e,h,p)||0),d._pt={_next:d._pt,p:f||1===g?f:",",s:o,c:_?_*l:l-o,m:u&&u<4||"zIndex"===e?Math.round:0});d.c=m<i.length?i.substring(m,i.length):""}else d.r="display"===e&&"none"===i?dr:_r;return ae.test(i)&&(d.e=0),this._pt=d}function Er(t,e){if(e.tween&&e.tween._time===e.tween._dur){var r,i,n,s=e.t,a=s.style,o=e.u,e=s._gsap;if("all"===o||!0===o)a.cssText="",i=1;else for(n=(o=o.split(",")).length;-1<--n;)r=o[n],fi[r]&&(i=1,r="transformOrigin"===r?Ti:yi),Dr(s,r);i&&(Dr(s,yi),e&&(e.svg&&s.removeAttribute("transform"),Ci(s,1),e.uncache=1))}}function Fr(t){return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t}function Br(t){t=br(t,yi);return Fr(t)?ki:t.substr(7).match(ie).map(L)}function Ir(t,e){var r,i,n,s=t._gsap||I(t),a=t.style,o=Br(t);return s.svg&&t.getAttribute("transform")?"1,0,0,1,0,0"===(o=[(i=t.transform.baseVal.consolidate().matrix).a,i.b,i.c,i.d,i.e,i.f]).join(",")?ki:o:(o!==ki||t.offsetParent||t===Nr||s.svg||(i=a.display,a.display="block",(s=t.parentNode)&&t.offsetParent||(n=1,r=t.nextSibling,Nr.appendChild(t)),o=Br(t),i?a.display=i:Dr(t,"display"),n&&(r?s.insertBefore(t,r):s?s.appendChild(t):Nr.removeChild(t))),e&&6<o.length?[o[0],o[1],o[4],o[5],o[12],o[13]]:o)}function Lr(t,e,r,i,n,s){var a,o,u=t._gsap,h=n||Ir(t,!0),l=u.xOrigin||0,f=u.yOrigin||0,p=u.xOffset||0,c=u.yOffset||0,_=h[0],d=h[1],m=h[2],g=h[3],v=h[4],y=h[5],T=e.split(" "),x=parseFloat(T[0])||0,n=parseFloat(T[1])||0;r?h!==ki&&(a=_*g-d*m)&&(o=x*(-d/a)+n*(_/a)-(_*y-d*v)/a,x=x*(g/a)+n*(-m/a)+(m*y-g*v)/a,n=o):(x=(o=Ar(t)).x+(~T[0].indexOf("%")?x/100*o.width:x),n=o.y+(~(T[1]||T[0]).indexOf("%")?n/100*o.height:n)),i||!1!==i&&u.smooth?(u.xOffset=p+((v=x-l)*_+(y=n-f)*m)-v,u.yOffset=c+(v*d+y*g)-y):u.xOffset=u.yOffset=0,u.xOrigin=x,u.yOrigin=n,u.smooth=!!i,u.origin=e,u.originIsAbsolute=!!r,t.style[Ti]="0px 0px",s&&(Pr(s,u,"xOrigin",l,x),Pr(s,u,"yOrigin",f,n),Pr(s,u,"xOffset",p,u.xOffset),Pr(s,u,"yOffset",c,u.yOffset)),t.setAttribute("data-svg-origin",x+" "+n)}function Yr(t,e,r){var i=G(e);return L(parseFloat(e)+parseFloat(Sr(t,"x",r+"px",i)))+i}function Ur(t,e){for(var r in e)t[r]=e[r];return t}Ve.version=Be.version=hr.version="3.9.1",kt=1,e()&&Oe();var Xr,Nr,qr,Vr,jr,Qr,Gr=ke.Power0,Wr=ke.Power1,Hr=ke.Power2,Zr=ke.Power3,$r=ke.Power4,Jr=ke.Linear,Kr=ke.Quad,ti=ke.Cubic,ei=ke.Quart,ri=ke.Quint,ii=ke.Strong,ni=ke.Elastic,si=ke.Back,ai=ke.SteppedEase,oi=ke.Bounce,ui=ke.Sine,hi=ke.Expo,li=ke.Circ,fi={},pi=180/Math.PI,ci=Math.PI/180,_i=Math.atan2,di=/([A-Z])/g,mi=/(?:left|right|width|margin|padding|x)/i,gi=/[\s,\(]\S/,vi={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},yi="transform",Ti=yi+"Origin",xi="O,Moz,ms,Ms,Webkit".split(","),wi=function(t,e,r){var i=(e||Vr).style,n=5;if(t in i&&!r)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);n--&&!(xi[n]+t in i););return n<0?null:(3===n?"ms":0<=n?xi[n]:"")+t},bi={deg:1,rad:1,turn:1},Mi={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Oi={clearProps:function(t,e,r,i,n){if("isFromStart"!==n.data){e=t._pt=new nr(t._pt,e,r,0,0,Er);return e.u=i,e.pr=-10,e.tween=n,t._props.push(r),1}}},ki=[1,0,0,1,0,0],Ai={},Ci=function(t,e){var r=t._gsap||new Re(t);if("x"in r&&!e&&!r.uncache)return r;var i,n,s,a,o,u,h,l,f,p,c,_,d,m,g,v,y,T,x,w,b,M,O,k,A,C=t.style,D=r.scaleX<0,P="deg",S=br(t,Ti)||"0",z=i=n=a=o=u=h=l=0,R=s=1;return r.svg=!(!t.getCTM||!Cr(t)),f=Ir(t,r.svg),r.svg&&(T=(!r.uncache||"0px 0px"===S)&&!e&&t.getAttribute("data-svg-origin"),Lr(t,T||S,!!T||r.originIsAbsolute,!1!==r.smooth,f)),M=r.xOrigin||0,k=r.yOrigin||0,f!==ki&&(_=f[0],d=f[1],m=f[2],g=f[3],z=v=f[4],i=y=f[5],6===f.length?(R=Math.sqrt(_*_+d*d),s=Math.sqrt(g*g+m*m),a=_||d?_i(d,_)*pi:0,(h=m||g?_i(m,g)*pi+a:0)&&(s*=Math.abs(Math.cos(h*ci))),r.svg&&(z-=M-(M*_+k*m),i-=k-(M*d+k*g))):(A=f[6],O=f[7],b=f[8],e=f[9],M=f[10],k=f[11],z=f[12],i=f[13],n=f[14],o=(f=_i(A,M))*pi,f&&(T=v*(p=Math.cos(-f))+b*(c=Math.sin(-f)),x=y*p+e*c,w=A*p+M*c,b=v*-c+b*p,e=y*-c+e*p,M=A*-c+M*p,k=O*-c+k*p,v=T,y=x,A=w),u=(f=_i(-m,M))*pi,f&&(p=Math.cos(-f),k=g*(c=Math.sin(-f))+k*p,_=T=_*p-b*c,d=x=d*p-e*c,m=w=m*p-M*c),a=(f=_i(d,_))*pi,f&&(T=_*(p=Math.cos(f))+d*(c=Math.sin(f)),x=v*p+y*c,d=d*p-_*c,y=y*p-v*c,_=T,v=x),o&&359.9<Math.abs(o)+Math.abs(a)&&(o=a=0,u=180-u),R=L(Math.sqrt(_*_+d*d+m*m)),s=L(Math.sqrt(y*y+A*A)),f=_i(v,y),h=2e-4<Math.abs(f)?f*pi:0,l=k?1/(k<0?-k:k):0),r.svg&&(T=t.getAttribute("transform"),r.forceCSS=t.setAttribute("transform","")||!Fr(br(t,yi)),T&&t.setAttribute("transform",T))),90<Math.abs(h)&&Math.abs(h)<270&&(D?(R*=-1,h+=a<=0?180:-180,a+=a<=0?180:-180):(s*=-1,h+=h<=0?180:-180)),r.x=z-((r.xPercent=z&&(r.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-z)?-50:0)))?t.offsetWidth*r.xPercent/100:0)+"px",r.y=i-((r.yPercent=i&&(r.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-i)?-50:0)))?t.offsetHeight*r.yPercent/100:0)+"px",r.z=n+"px",r.scaleX=L(R),r.scaleY=L(s),r.rotation=L(a)+P,r.rotationX=L(o)+P,r.rotationY=L(u)+P,r.skewX=h+P,r.skewY=0+P,r.transformPerspective=l+"px",(r.zOrigin=parseFloat(S.split(" ")[2])||0)&&(C[Ti]=Di(S)),r.xOffset=r.yOffset=0,r.force3D=Vt.force3D,r.renderTransform=r.svg?Fi:Qr?Ei:Pi,r.uncache=0,r},Di=function(t){return(t=t.split(" "))[0]+" "+t[1]},Pi=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Ei(t,e)},Si="0deg",zi="0px",Ri=") ",Ei=function(t,e){var r=e||this,i=r.xPercent,n=r.yPercent,s=r.x,a=r.y,o=r.z,u=r.rotation,h=r.rotationY,l=r.rotationX,f=r.skewX,p=r.skewY,c=r.scaleX,_=r.scaleY,d=r.transformPerspective,m=r.force3D,g=r.target,v=r.zOrigin,y="",e="auto"===m&&t&&1!==t||!0===m;!v||l===Si&&h===Si||(r=parseFloat(h)*ci,t=Math.sin(r),m=Math.cos(r),r=parseFloat(l)*ci,s=Yr(g,s,t*(t=Math.cos(r))*-v),a=Yr(g,a,-Math.sin(r)*-v),o=Yr(g,o,m*t*-v+v)),d!==zi&&(y+="perspective("+d+Ri),(i||n)&&(y+="translate("+i+"%, "+n+"%) "),!e&&s===zi&&a===zi&&o===zi||(y+=o!==zi||e?"translate3d("+s+", "+a+", "+o+") ":"translate("+s+", "+a+Ri),u!==Si&&(y+="rotate("+u+Ri),h!==Si&&(y+="rotateY("+h+Ri),l!==Si&&(y+="rotateX("+l+Ri),f===Si&&p===Si||(y+="skew("+f+", "+p+Ri),1===c&&1===_||(y+="scale("+c+", "+_+Ri),g.style[yi]=y||"translate(0, 0)"},Fi=function(t,e){var r,i,n,s,a,o=e||this,u=o.xPercent,h=o.yPercent,l=o.x,f=o.y,p=o.rotation,c=o.skewX,_=o.skewY,d=o.scaleX,m=o.scaleY,g=o.target,v=o.xOrigin,y=o.yOrigin,T=o.xOffset,x=o.yOffset,w=o.forceCSS,e=parseFloat(l),o=parseFloat(f),p=parseFloat(p),c=parseFloat(c);(_=parseFloat(_))&&(c+=_=parseFloat(_),p+=_),p||c?(p*=ci,c*=ci,r=Math.cos(p)*d,i=Math.sin(p)*d,n=Math.sin(p-c)*-m,s=Math.cos(p-c)*m,c&&(_*=ci,a=Math.tan(c-_),n*=a=Math.sqrt(1+a*a),s*=a,_&&(a=Math.tan(_),r*=a=Math.sqrt(1+a*a),i*=a)),r=L(r),i=L(i),n=L(n),s=L(s)):(r=d,s=m,i=n=0),(e&&!~(l+"").indexOf("px")||o&&!~(f+"").indexOf("px"))&&(e=Sr(g,"x",l,"px"),o=Sr(g,"y",f,"px")),(v||y||T||x)&&(e=L(e+v-(v*r+y*n)+T),o=L(o+y-(v*i+y*s)+x)),(u||h)&&(e=L(e+u/100*(a=g.getBBox()).width),o=L(o+h/100*a.height)),g.setAttribute("transform",a="matrix("+r+","+i+","+n+","+s+","+e+","+o+")"),w&&(g.style[yi]=a)};c("padding,margin,Width,Radius",function(e,r){var t="Right",i="Bottom",n="Left",o=(r<3?["Top",t,i,n]:["Top"+n,"Top"+t,i+t,i+n]).map(function(t){return r<2?e+t:"border"+t+e});Oi[1<r?"border"+e:e]=function(e,t,r,i,n){var s,a;if(arguments.length<4)return s=o.map(function(t){return zr(e,t,r)}),5===(a=s.join(" ")).split(s[0]).length?s[0]:a;s=(i+"").split(" "),a={},o.forEach(function(t,e){return a[t]=s[e]=s[e]||s[(e-1)/2|0]}),e.init(t,a,n)}});var Bi,Ii={name:"css",register:Mr,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,r,i,n){var s,a,o,u,h,l,f,p,c,_,d,m,g,v,y,T,x,w,b,M,O,k,A=this._props,C=t.style,D=r.vars.startAt;for(h in qr||Mr(),e)if("autoRound"!==h&&(a=e[h],!ce[h]||!Ie(h,e,r,i,t,n)))if(w=typeof a,x=Oi[h],"function"===w&&(w=typeof(a=a.call(r,i,t,n))),"string"===w&&~a.indexOf("random(")&&(a=K(a)),x)x(this,t,h,a,r)&&(g=1);else if("--"===h.substr(0,2))s=(getComputedStyle(t).getPropertyValue(h)+"").trim(),a+="",we.lastIndex=0,we.test(s)||(l=G(s),f=G(a)),f?l!==f&&(s=Sr(t,h,s,f)+f):l&&(a+=l),this.add(C,"setProperty",s,a,i,n,0,0,h),A.push(h);else if("undefined"!==w){if(D&&h in D?(G((s=P(s="function"==typeof D[h]?D[h].call(r,i,t,n):D[h])&&~s.indexOf("random(")?K(s):s)+"")||(s+=Vt.units[h]||G(zr(t,h))||""),"="===(s+"").charAt(1)&&(s=zr(t,h))):s=zr(t,h),u=parseFloat(s),(p="string"===w&&"="===a.charAt(1)?+(a.charAt(0)+"1"):0)&&(a=a.substr(2)),o=parseFloat(a),h in vi&&("autoAlpha"===h&&Pr(this,C,"visibility",(u=1===u&&"hidden"===zr(t,"visibility")&&o?0:u)?"inherit":"hidden",o?"inherit":"hidden",!o),"scale"!==h&&"transform"!==h&&~(h=vi[h]).indexOf(",")&&(h=h.split(",")[0])),c=h in fi)if(_||((d=t._gsap).renderTransform&&!e.parseTransform||Ci(t,e.parseTransform),m=!1!==e.smoothOrigin&&d.smooth,(_=this._pt=new nr(this._pt,C,yi,0,1,d.renderTransform,d,0,-1)).dep=1),"scale"===h)this._pt=new nr(this._pt,d,"scaleY",d.scaleY,(p?p*o:o-d.scaleY)||0),A.push("scaleY",h),h+="X";else{if("transformOrigin"===h){k=O=M=void 0,M=(b=a).split(" "),O=M[0],k=M[1]||"50%","top"!==O&&"bottom"!==O&&"left"!==k&&"right"!==k||(b=O,O=k,k=b),M[0]=Mi[O]||O,M[1]=Mi[k]||k,a=M.join(" "),d.svg?Lr(t,a,0,m,0,this):((f=parseFloat(a.split(" ")[2])||0)!==d.zOrigin&&Pr(this,d,"zOrigin",d.zOrigin,f),Pr(this,C,h,Di(s),Di(a)));continue}if("svgOrigin"===h){Lr(t,a,1,m,0,this);continue}if(h in Ai){v=this,y=d,T=h,x=u,w=p,k=O=b=void 0,b=360,O=P(M=a),k=parseFloat(M)*(O&&~M.indexOf("rad")?pi:1),k=x+(w=w?k*w:k-x)+"deg",O&&("short"===(M=M.split("_")[1])&&(w%=b)!=w%180&&(w+=w<0?b:-b),"cw"===M&&w<0?w=(w+36e9)%b-~~(w/b)*b:"ccw"===M&&0<w&&(w=(w-36e9)%b-~~(w/b)*b)),v._pt=w=new nr(v._pt,y,T,x,w,fr),w.e=k,w.u="deg",v._props.push(T);continue}if("smoothOrigin"===h){Pr(this,d,"smooth",d.smooth,a);continue}if("force3D"===h){d[h]=a;continue}if("transform"===h){!function(t,e,r){var i,n,s,a,o,u,h=Ur({},r._gsap),l=r.style;for(n in h.svg?(s=r.getAttribute("transform"),r.setAttribute("transform",""),l[yi]=e,i=Ci(r,1),Dr(r,yi),r.setAttribute("transform",s)):(s=getComputedStyle(r)[yi],l[yi]=e,i=Ci(r,1),l[yi]=s),fi)(s=h[n])!==(o=i[n])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(n)<0&&(a=G(s)!==(u=G(o))?Sr(r,n,s,u):parseFloat(s),o=parseFloat(o),t._pt=new nr(t._pt,i,n,a,o-a,lr),t._pt.u=u||0,t._props.push(n));Ur(i,h)}(this,a,t);continue}}else h in C||(h=wi(h)||h);if(c||(o||0===o)&&(u||0===u)&&!gi.test(a)&&h in C)o=o||0,(l=(s+"").substr((u+"").length))!==(f=G(a)||(h in Vt.units?Vt.units[h]:l))&&(u=Sr(t,h,s,f)),this._pt=new nr(this._pt,c?d:C,h,u,p?p*o:o-u,c||"px"!==f&&"zIndex"!==h||!1===e.autoRound?lr:cr),this._pt.u=f||0,l!==f&&"%"!==f&&(this._pt.b=s,this._pt.r=pr);else if(h in C)Rr.call(this,t,h,s,a);else{if(!(h in t)){R(h,a);continue}this.add(t,h,s||t[h],a,i,n)}A.push(h)}g&&ir(this)},get:zr,aliases:vi,getSetter:function(t,e,r){var i=vi[e];return(e=i&&i.indexOf(",")<0?i:e)in fi&&e!==Ti&&(t._gsap.x||zr(t,"x"))?r&&jr===r?"scale"===e?yr:vr:(jr=r||{})&&("scale"===e?Tr:xr):t.style&&!n(t.style[e])?mr:~e.indexOf("-")?gr:rr(t,e)},core:{_removeProperty:Dr,_getMatrix:Ir}};hr.utils.checkPrefix=wi,Bi=c("x,y,z,scale,scaleX,scaleY,xPercent,yPercent"+","+(Yi="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",function(t){fi[t]=1}),c(Yi,function(t){Vt.units[t]="deg",Ai[t]=1}),vi[Bi[13]]="x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+Yi,c("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",function(t){t=t.split(":");vi[t[1]]=Bi[t[0]]}),c("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){Vt.units[t]="px"}),hr.registerPlugin(Ii);var Li=hr.registerPlugin(Ii)||hr,Yi=Li.core.Tween;t.Back=si,t.Bounce=oi,t.CSSPlugin=Ii,t.Circ=li,t.Cubic=ti,t.Elastic=ni,t.Expo=hi,t.Linear=Jr,t.Power0=Gr,t.Power1=Wr,t.Power2=Hr,t.Power3=Zr,t.Power4=$r,t.Quad=Kr,t.Quart=ei,t.Quint=ri,t.Sine=ui,t.SteppedEase=ai,t.Strong=ii,t.TimelineLite=Be,t.TimelineMax=Be,t.TweenLite=Ve,t.TweenMax=Yi,t.default=Li,t.gsap=Li,"undefined"==typeof window||window!==t?Object.defineProperty(t,"__esModule",{value:!0}):delete t.default});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).window=e.window||{})}(this,function(e){"use strict";function Pe(e){return e}function _e(e){return ft(e)[0]||(Ot(e)&&!1!==st.config().nullTargetWarn?console.warn("Element not found:",e):null)}function p(e){return Math.round(1e5*e)/1e5||0}function n(){return"undefined"!=typeof window}function i(){return st||n()&&(st=window.gsap)&&st.registerPlugin&&st}function Ae(e){return!!~h.indexOf(e)}function Re(e,t){return~St.indexOf(e)&&St[St.indexOf(e)+1][t]}function Be(t,e){var r=e.s,n=e.sc,i=T.indexOf(t),e=n===Ft.sc?1:2;return~i||(i=T.push(t)-1),T[i+e]||(T[i+e]=Re(t,r)||(Ae(t)?n:function(e){return arguments.length?t[r]=e:t[r]}))}function Ie(e){return Re(e,"getBoundingClientRect")||(Ae(e)?function(){return Ut.width=at.innerWidth,Ut.height=at.innerHeight,Ut}:function(){return it(e)})}function ze(e,t){t.s;var r,n=t.d2,i=t.d,t=t.a;return(r="scroll"+n)&&(t=Re(e,r))?t()-Ie(e)()[i]:Ae(e)?(ut[r]||ct[r])-(at["inner"+n]||ct["client"+n]||ut["client"+n]):e[r]-e["offset"+n]}function o(e,t){for(var r=0;r<w.length;r+=3)t&&!~t.indexOf(w[r+1])||e(w[r],w[r+1],w[r+2])}function Le(e){return"function"==typeof e}function Ne(e){return"number"==typeof e}function De(e){return"object"==typeof e}function s(e){return Le(e)&&e()}function a(r,n){return function(){var e=s(r),t=s(n);return function(){s(e),s(t)}}}function Fe(e,t,r){return e&&e.progress(t?0:1)&&r&&e.pause()}function We(e,t){!e.enabled||(t=t(e))&&t.totalTime&&(e.callbackAnimation=t)}function He(e){return at.getComputedStyle(e)}function Ve(e,t){for(var r in t)r in e||(e[r]=t[r]);return e}function je(e,t){t=t.d2;return e["offset"+t]||e["client"+t]||0}function qe(e){var t,r=[],n=e.labels,i=e.duration();for(t in n)r.push(n[t]/i);return r}function Ue(i){var o=st.utils.snap(i),s=Array.isArray(i)&&i.slice(0).sort(function(e,t){return e-t});return s?function(e,t,r){var n;if(void 0===r&&(r=.001),!t)return o(e);if(0<t){for(e-=r,n=0;n<s.length;n++)if(s[n]>=e)return s[n];return s[n-1]}for(n=s.length,e+=r;n--;)if(s[n]<=e)return s[n];return s[0]}:function(e,t,r){void 0===r&&(r=.001);var n=o(e);return!t||Math.abs(n-e)<r||n-e<0==t<0?n:o(t<0?e-i:e+i)}}function l(t,r,e,n){return e.split(",").forEach(function(e){return t(r,e,n)})}function Xe(e,t,r){return e.addEventListener(t,r,{passive:!0})}function Ye(e,t,r){return e.removeEventListener(t,r)}function Ze(e,t){var r,n;return Ot(e)&&(n=~(r=e.indexOf("="))?(e.charAt(r-1)+1)*parseFloat(e.substr(r+1)):0,~r&&(e.indexOf("%")>r&&(n*=t/100),e=e.substr(0,r-1)),e=n+(e in R?R[e]*t:~e.indexOf("%")?parseFloat(e)*t/100:parseFloat(e)||0)),e}function $e(e,t,r,n,i,o,s,a){var l=i.startColor,c=i.endColor,u=i.fontSize,f=i.indent,d=i.fontWeight,p=lt.createElement("div"),h=Ae(r)||"fixed"===Re(r,"pinType"),g=-1!==e.indexOf("scroller"),i=h?ut:r,r=-1!==e.indexOf("start"),c=r?l:c,d="border-color:"+c+";font-size:"+u+";color:"+c+";font-weight:"+d+";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";return d+="position:"+((g||a)&&h?"fixed;":"absolute;"),!g&&!a&&h||(d+=(n===Ft?_:A)+":"+(o+parseFloat(f))+"px;"),s&&(d+="box-sizing:border-box;text-align:left;width:"+s.offsetWidth+"px;"),p._isStart=r,p.setAttribute("class","gsap-marker-"+e+(t?" marker-"+t:"")),p.style.cssText=d,p.innerText=t||0===t?e+"-"+t:e,i.children[0]?i.insertBefore(p,i.children[0]):i.appendChild(p),p._offset=p["offset"+n.op.d2],x(p,0,n,r),p}function c(){return 34<kt()-Ct&&t()}function Ge(){t(),Ct||L("scrollStart"),Ct=kt()}function Je(){return!ht&&!S&&!lt.fullscreenElement&&g.restart(!0)}function u(e){var t,r=st.ticker.frame,n=[],i=0;if(k!==r||wt){for(F();i<z.length;i+=4)(t=at.matchMedia(z[i]).matches)!==z[i+3]&&((z[i+3]=t)?n.push(i):F(1,z[i])||Le(z[i+2])&&z[i+2]());for(D(),i=0;i<n.length;i++)t=n[i],bt=z[t],z[t+2]=z[t+1](e);bt=0,d&&f(0,1),k=r,L("matchMedia")}}function Ke(){return Ye(U,"scrollEnd",Ke)||f(!0)}function r(){return T.forEach(function(e){return"function"==typeof e&&(e.rec=0)})}function Qe(e,t,r,n){if(e.parentNode!==t){for(var i,o=H.length,s=t.style,a=e.style;o--;)s[i=H[o]]=r[i];s.position="absolute"===r.position?"absolute":"relative","inline"===r.display&&(s.display="inline-block"),a[A]=a[_]=s.flexBasis="auto",s.overflow="visible",s.boxSizing="border-box",s[Mt]=je(e,Dt)+Nt,s[Pt]=je(e,Ft)+Nt,s[It]=a[zt]=a.top=a[P]="0",ot(n),a[Mt]=a.maxWidth=r[Mt],a[Pt]=a.maxHeight=r[Pt],a[It]=r[It],e.parentNode.insertBefore(t,e),t.appendChild(e)}}function et(e){for(var t=V.length,r=e.style,n=[],i=0;i<t;i++)n.push(V[i],r[V[i]]);return n.t=e,n}function tt(e,t,r,n,i,o,s,a,l,c,u,f,d){Le(e)&&(e=e(a)),Ot(e)&&"max"===e.substr(0,3)&&(e=f+("="===e.charAt(4)?Ze("0"+e.substr(3),r):0));var p,h,g,v,m=d?d.time():0;return d&&d.seek(0),Ne(e)?s&&x(s,r,n,!0):(Le(t)&&(t=t(a)),g=e.split(" "),h=_e(t)||ut,(t=it(h)||{})&&(t.left||t.top)||"none"!==He(h).display||(p=h.style.display,h.style.display="block",t=it(h),p?h.style.display=p:h.style.removeProperty("display")),p=Ze(g[0],t[n.d]),g=Ze(g[1]||"0",r),e=t[n.p]-l[n.p]-c+p+i-g,s&&x(s,g,n,r-g<20||s._isStart&&20<g),r-=r-g),o&&(g=o._isStart,v="scroll"+n.d2,x(o,r=e+r,n,g&&20<r||!g&&(u?Math.max(ut[v],ct[v]):o.parentNode[v])<=r+1),u&&(l=it(s),u&&(o.style[n.op.p]=l[n.op.p]-n.op.m-o._offset+Nt))),d&&h&&(v=it(h),d.seek(f),h=it(h),d._caScrollDist=v[n.p]-h[n.p],e=e/d._caScrollDist*f),d&&d.seek(m),d?e:Math.round(e)}function rt(e,t,r,n){if(e.parentNode!==t){var i,o,s=e.style;if(t===ut){for(i in e._stOrig=s.cssText,o=He(e))+i||q.test(i)||!o[i]||"string"!=typeof s[i]||"0"===i||(s[i]=o[i]);s.top=r,s.left=n}else s.cssText=e._stOrig;st.core.getCache(e).uncache=1,t.appendChild(e)}}function nt(a,e){function l(e,t,r,n,i){var o=l.tween,s=t.onComplete;return o&&o.kill(),c=Math.round(r),t[d]=e,(t.modifiers={})[d]=function(e){return(e=p(f()))!==c&&e!==u&&2<Math.abs(e-c)&&2<Math.abs(e-u)?(o.kill(),l.tween=0):e=r+n*o.ratio+i*o.ratio*o.ratio,u=c,c=p(e)},t.onComplete=function(){l.tween=0,s&&s.call(o)},o=l.tween=st.to(a,t)}var c,u,f=Be(a,e),d="_scroll"+e.p2;return a[d]=f,Xe(a,"wheel",function(){return l.tween&&l.tween.kill()&&(l.tween=0)}),l}function it(e,t){return t=t&&"matrix(1, 0, 0, 1, 0, 0)"!==He(e)[m]&&st.to(e,{x:0,y:0,xPercent:0,yPercent:0,rotation:0,rotationX:0,rotationY:0,scale:1,skewX:0,skewY:0}).progress(1),e=e.getBoundingClientRect(),t&&t.progress(0).kill(),e}function x(e,t,r,n){var i={display:"block"},o=r[n?"os2":"p2"],s=r[n?"p2":"os2"];e._isFlipped=n,i[r.a+"Percent"]=n?-100:0,i[r.a]=n?"1px":0,i["border"+o+Lt]=1,i["border"+s+Lt]=0,i[r.p]=t+"px",st.set(e,i)}function f(e,t){!Ct||e?(C=!0,e=L("refreshInit"),mt&&U.sort(),t||F(),Vt.forEach(function(e){return e.refresh()}),Vt.forEach(function(e){return"max"===e.vars.end&&e.setPositions(e.start,ze(e.scroller,e._dir))}),e.forEach(function(e){return e&&e.render&&e.render(-1)}),r(),g.pause(),C=!1,L("refresh")):Xe(U,"scrollEnd",Ke)}function t(){if(!C){var e=Vt.length,t=kt(),r=50<=t-O,n=e&&Vt[0].scroll();if(qt=n<W?-1:1,W=n,r&&(Ct&&!gt&&200<t-Ct&&(Ct=0,L("scrollEnd")),pt=O,O=t),qt<0){for(vt=e;0<vt--;)Vt[vt]&&Vt[vt].update(0,r);qt=1}else for(vt=0;vt<e;vt++)Vt[vt]&&Vt[vt].update(0,r)}}function ot(e){if(e){var t,r,n=e.t.style,i=e.length,o=0;for((e.t._gsap||st.core.getCache(e.t)).uncache=1;o<i;o+=2)r=e[o+1],t=e[o],r?n[t]=r:n[t]&&n.removeProperty(t.replace(j,"-$1").toLowerCase())}}var st,d,at,lt,ct,ut,h,g,ft,dt,pt,v,ht,gt,m,vt,y,b,w,mt,xt,S,yt,bt,k,C,wt=1,St=[],T=[],kt=Date.now,O=kt(),Ct=0,Tt=1,Ot=function(e){return"string"==typeof e},Et=Math.abs,E="scrollLeft",M="scrollTop",P="left",_="right",A="bottom",Mt="width",Pt="height",_t="Right",At="Left",Rt="Top",Bt="Bottom",It="padding",zt="margin",Lt="Width",Nt="px",Dt={s:E,p:P,p2:At,os:_,os2:_t,d:Mt,d2:Lt,a:"x",sc:function(e){return arguments.length?at.scrollTo(e,Ft.sc()):at.pageXOffset||lt[E]||ct[E]||ut[E]||0}},Ft={s:M,p:"top",p2:Rt,os:A,os2:Bt,d:Pt,d2:"Height",a:"y",op:Dt,sc:function(e){return arguments.length?at.scrollTo(Dt.sc(),e):at.pageYOffset||lt[M]||ct[M]||ut[M]||0}},Wt={startColor:"green",endColor:"red",indent:0,fontSize:"16px",fontWeight:"normal"},Ht={toggleActions:"play",anticipatePin:0},R={top:0,left:0,center:.5,bottom:1,right:1},Vt=[],jt={},B={},I=[],z=[],L=function(e){return B[e]&&B[e].map(function(e){return e()})||I},N=[],D=function(e){for(var t=0;t<N.length;t+=5)e&&N[t+4]!==e||(N[t].style.cssText=N[t+1],N[t].getBBox&&N[t].setAttribute("transform",N[t+2]||""),N[t+3].uncache=1)},F=function(e,t){var r;for(vt=0;vt<Vt.length;vt++)r=Vt[vt],t&&r.media!==t||(e?r.kill(1):r.revert());t&&D(t),t||L("revert")},W=0,qt=1,H=[P,"top",A,_,zt+Bt,zt+_t,zt+Rt,zt+At,"display","flexShrink","float","zIndex","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd","gridArea","justifySelf","alignSelf","placeSelf","order"],V=H.concat([Mt,Pt,"boxSizing","max"+Lt,"maxHeight","position",zt,It,It+Rt,It+_t,It+Bt,It+At]),j=/([A-Z])/g,Ut={left:0,top:0},q=/(?:webkit|moz|length|cssText|inset)/i;Dt.op=Ft;var U=(Xt.prototype.init=function(m,x){var d,n,f,y,b,w,S,k,C,T,O,E,M,P,_,A,R,p,B,I,h,z,g,v,L,N,D,e,F,W,H,V,j,q,U,X,i,Y,Z,$,G,J,K,Q,ee,t,te,re,ne,ie,r,oe,se,ae,le,ce,ue,o,fe,de,pe,he,ge,ve,s,me,xe,ye,be,a,l,c,u,we,Se,ke,Ce,Te,Oe,Ee,Me;this.progress=this.start=0,this.vars&&this.kill(1),Tt?(U=(m=Ve(Ot(m)||Ne(m)||m.nodeType?{trigger:m}:m,Ht)).onUpdate,X=m.toggleClass,i=m.id,Y=m.onToggle,Z=m.onRefresh,$=m.scrub,G=m.trigger,J=m.pin,K=m.pinSpacing,Q=m.invalidateOnRefresh,ee=m.anticipatePin,t=m.onScrubComplete,te=m.onSnapComplete,re=m.once,ne=m.snap,ie=m.pinReparent,r=m.pinSpacer,oe=m.containerAnimation,se=m.fastScrollEnd,ae=m.preventOverlaps,le=m.horizontal||m.containerAnimation&&!1!==m.horizontal?Dt:Ft,ce=!$&&0!==$,ue=_e(m.scroller||at),o=st.core.getCache(ue),fe=Ae(ue),de="fixed"===("pinType"in m?m.pinType:Re(ue,"pinType")||fe&&"fixed"),pe=[m.onEnter,m.onLeave,m.onEnterBack,m.onLeaveBack],he=ce&&m.toggleActions.split(" "),u=("markers"in m?m:Ht).markers,ge=!fe&&parseFloat(He(ue)["border"+le.p2+Lt])||0,ve=this,s=m.onRefreshInit&&function(){return m.onRefreshInit(ve)},Ce=ue,Te=fe,Oe=le.d,Ee=le.d2,Me=le.a,me=(Me=Re(Ce,"getBoundingClientRect"))?function(){return Me()[Oe]}:function(){return(Te?at["inner"+Ee]:Ce["client"+Ee])||0},ke=ue,xe=!fe||~St.indexOf(ke)?Ie(ke):function(){return Ut},ye=0,be=Be(ue,le),ve.media=bt,ve._dir=le,ee*=45,ve.scroller=ue,ve.scroll=oe?oe.time.bind(oe):be,y=be(),ve.vars=m,x=x||m.animation,"refreshPriority"in m&&(mt=1),o.tweenScroll=o.tweenScroll||{top:nt(ue,Ft),left:nt(ue,Dt)},ve.tweenTo=d=o.tweenScroll[le.p],x&&(x.vars.lazy=!1,x._initted||!1!==x.vars.immediateRender&&!1!==m.immediateRender&&x.render(0,!0,!0),ve.animation=x.pause(),x.scrollTrigger=ve,(e=Ne($)&&$)&&(D=st.to(x,{ease:"power3",duration:e,onComplete:function(){return t&&t(ve)}})),L=0,i=i||x.vars.id),Vt.push(ve),ne&&(De(ne)&&!ne.push||(ne={snapTo:ne}),"scrollBehavior"in ut.style&&st.set(fe?[ut,ct]:ue,{scrollBehavior:"auto"}),f=Le(ne.snapTo)?ne.snapTo:"labels"===ne.snapTo?(Se=x,function(e){return st.utils.snap(qe(Se),e)}):"labelsDirectional"===ne.snapTo?(we=x,function(e,t){return Ue(qe(we))(e,t.direction)}):!1!==ne.directional?function(e,t){return Ue(ne.snapTo)(e,t.direction)}:st.utils.snap(ne.snapTo),F=De(F=ne.duration||{min:.1,max:2})?dt(F.min,F.max):dt(F,F),W=st.delayedCall(ne.delay||e/2||.1,function(){var e,t,r,n,i,o,s,a,l,c,u;Math.abs(ve.getVelocity())<10&&!gt&&ye!==be()?(t=((e=x&&!ce?x.totalProgress():ve.progress)-N)/(kt()-pt)*1e3||0,r=st.utils.clamp(-ve.progress,1-ve.progress,Et(t/2)*t/.185),n=ve.progress+(!1===ne.inertia?0:r),i=dt(0,1,f(n,ve)),o=be(),s=Math.round(w+i*E),a=ne.onStart,l=ne.onInterrupt,c=ne.onComplete,u=d.tween,o<=S&&w<=o&&s!==o&&(u&&!u._initted&&u.data<=Et(s-o)||(!1===ne.inertia&&(r=i-ve.progress),d(s,{duration:F(Et(.185*Math.max(Et(n-e),Et(i-e))/t/.05||0)),ease:ne.ease||"power3",data:Et(s-o),onInterrupt:function(){return W.restart(!0)&&l&&l(ve)},onComplete:function(){ve.update(),ye=be(),L=N=x&&!ce?x.totalProgress():ve.progress,te&&te(ve),c&&c(ve)}},o,r*E,s-o-r*E),a&&a(ve,d.tween)))):ve.isActive&&W.restart(!0)}).pause()),i&&(jt[i]=ve),G=ve.trigger=_e(G||J),J=!0===J?G:_e(J),Ot(X)&&(X={targets:G,className:X}),J&&(!1===K||K===zt||(K=!(!K&&"flex"===He(J.parentNode).display)&&It),ve.pin=J,!1!==m.force3D&&st.set(J,{force3D:!0}),(n=st.core.getCache(J)).spacer?M=n.pinState:(r&&((r=_e(r))&&!r.nodeType&&(r=r.current||r.nativeElement),n.spacerIsNative=!!r,r&&(n.spacerState=et(r))),n.spacer=A=r||lt.createElement("div"),A.classList.add("pin-spacer"),i&&A.classList.add("pin-spacer-"+i),n.pinState=M=et(J)),ve.spacer=A=n.spacer,c=He(J),h=c[K+le.os2],R=st.getProperty(J),p=st.quickSetter(J,le.a,Nt),Qe(J,A,c),_=et(J)),u&&(c=De(u)?Ve(u,Wt):Wt,T=$e("scroller-start",i,ue,le,c,0),O=$e("scroller-end",i,ue,le,c,0,T),u=T["offset"+le.op.d2],k=$e("start",i,ue,le,c,u,0,oe),C=$e("end",i,ue,le,c,u,0,oe),oe&&(q=st.quickSetter([k,C],le.a,Nt)),de||St.length&&!0===Re(ue,"fixedMarkers")||(u=He(c=fe?ut:ue).position,c.style.position="absolute"===u||"fixed"===u?u:"relative",st.set([T,O],{force3D:!0}),g=st.quickSetter(T,le.a,Nt),v=st.quickSetter(O,le.a,Nt))),oe&&(a=oe.vars.onUpdate,l=oe.vars.onUpdateParams,oe.eventCallback("onUpdate",function(){ve.update(0,0,1),a&&a.apply(l||[])})),ve.previous=function(){return Vt[Vt.indexOf(ve)-1]},ve.next=function(){return Vt[Vt.indexOf(ve)+1]},ve.revert=function(e){var t=!1!==e||!ve.enabled,e=ht;t!==ve.isReverted&&(t&&(ve.scroll.rec||(ve.scroll.rec=be()),V=Math.max(be(),ve.scroll.rec||0),H=ve.progress,j=x&&x.progress()),k&&[k,C,T,O].forEach(function(e){return e.style.display=t?"none":"block"}),t&&(ht=1),ve.update(t),ht=e,J&&(t?function(e,t,r){ot(r);r=e._gsap;r.spacerIsNative?ot(r.spacerState):e.parentNode!==t||(r=t.parentNode)&&(r.insertBefore(e,t),r.removeChild(t))}(J,A,M):ie&&ve.isActive||Qe(J,A,He(J),z)),ve.isReverted=t)},ve.refresh=function(e,t){if(!ht&&ve.enabled||t)if(J&&e&&Ct)Xe(Xt,"scrollEnd",Ke);else{ht=1,D&&D.pause(),Q&&x&&x.time(-.01,!0).invalidate(),ve.isReverted||ve.revert();for(var r,n,i,o,s,a,l=me(),c=xe(),u=oe?oe.duration():ze(ue,le),f=0,d=0,p=m.end,t=m.endTrigger||G,h=m.start||(0!==m.start&&G?J?"0 0":"0 100%":0),g=m.pinnedContainer&&_e(m.pinnedContainer),e=G&&Math.max(0,Vt.indexOf(ve))||0,v=e;v--;)(i=Vt[v]).end||i.refresh(0,1)||(ht=1),!(o=i.pin)||o!==G&&o!==J||i.isReverted||((a=a||[]).unshift(i),i.revert());for(Le(h)&&(h=h(ve)),w=tt(h,G,l,le,be(),k,T,ve,c,ge,de,u,oe)||(J?-.001:0),Le(p)&&(p=p(ve)),Ot(p)&&!p.indexOf("+=")&&(~p.indexOf(" ")?p=(Ot(h)?h.split(" ")[0]:"")+p:(f=Ze(p.substr(2),l),p=Ot(h)?h:w+f,t=G)),S=Math.max(w,tt(p||(t?"100% 0":u),t,l,le,be()+f,C,O,ve,c,ge,de,u,oe))||-.001,E=S-w||(w-=.01)&&.001,f=0,v=e;v--;)(o=(i=Vt[v]).pin)&&i.start-i._pinPush<w&&!oe&&(r=i.end-i.start,o!==G&&o!==g||Ne(h)||(f+=r*(1-i.progress)),o===J&&(d+=r));if(w+=f,S+=f,ve._pinPush=d,k&&f&&((r={})[le.a]="+="+f,g&&(r[le.p]="-="+be()),st.set([k,C],r)),J)r=He(J),c=le===Ft,e=be(),B=parseFloat(R(le.a))+d,!u&&1<S&&((fe?ut:ue).style["overflow-"+le.a]="scroll"),Qe(J,A,r),_=et(J),n=it(J,!0),u=de&&Be(ue,c?Dt:Ft)(),K&&((z=[K+le.os2,E+d+Nt]).t=A,(v=K===It?je(J,le)+E+d:0)&&z.push(le.d,v+Nt),ot(z),de&&be(V)),de&&((s={top:n.top+(c?e-w:u)+Nt,left:n.left+(c?u:e-w)+Nt,boxSizing:"border-box",position:"fixed"})[Mt]=s.maxWidth=Math.ceil(n.width)+Nt,s[Pt]=s.maxHeight=Math.ceil(n.height)+Nt,s[zt]=s[zt+Rt]=s[zt+_t]=s[zt+Bt]=s[zt+At]="0",s[It]=r[It],s[It+Rt]=r[It+Rt],s[It+_t]=r[It+_t],s[It+Bt]=r[It+Bt],s[It+At]=r[It+At],P=function(e,t,r){for(var n,i=[],o=e.length,s=r?8:0;s<o;s+=2)n=e[s],i.push(n,n in t?t[n]:e[s+1]);return i.t=e.t,i}(M,s,ie)),x?(s=x._initted,xt(1),x.render(x.duration(),!0,!0),I=R(le.a)-B+E+d,E!==I&&P.splice(P.length-2,2),x.render(0,!0,!0),s||x.invalidate(),xt(0)):I=E;else if(G&&be()&&!oe)for(n=G.parentNode;n&&n!==ut;)n._pinOffset&&(w-=n._pinOffset,S-=n._pinOffset),n=n.parentNode;a&&a.forEach(function(e){return e.revert(!1)}),ve.start=w,ve.end=S,y=b=be(),oe||(y<V&&be(V),ve.scroll.rec=0),ve.revert(!1),ht=0,x&&ce&&x._initted&&x.progress()!==j&&x.progress(j,!0).render(x.time(),!0,!0),H===ve.progress&&!oe||(x&&!ce&&x.totalProgress(H,!0),ve.progress=H,ve.update(0,0,1)),J&&K&&(A._pinOffset=Math.round(ve.progress*I)),Z&&Z(ve)}},ve.getVelocity=function(){return(be()-b)/(kt()-pt)*1e3||0},ve.endAnimation=function(){Fe(ve.callbackAnimation),x&&(D?D.progress(1):x.paused()?ce||Fe(x,ve.direction<0,1):Fe(x,x.reversed()))},ve.labelToScroll=function(e){return x&&x.labels&&(w||ve.refresh()||w)+x.labels[e]/x.duration()*E||0},ve.getTrailing=function(t){var e=Vt.indexOf(ve),e=0<ve.direction?Vt.slice(0,e).reverse():Vt.slice(e+1);return Ot(t)?e.filter(function(e){return e.vars.preventOverlaps===t}):e},ve.update=function(e,t,r){var n,i,o,s,a,l,c,u,f;oe&&!r&&!e||(l=ve.scroll(),f=(u=e?0:(l-w)/E)<0?0:1<u?1:u||0,c=ve.progress,t&&(b=y,y=oe?be():l,ne&&(N=L,L=x&&!ce?x.totalProgress():f)),(f=ee&&!f&&J&&!ht&&!wt&&Ct&&w<l+(l-b)/(kt()-pt)*ee?1e-4:f)!==c&&ve.enabled&&(r=(s=(n=ve.isActive=!!f&&f<1)!=(!!c&&c<1))||!!f!=!!c,ve.direction=c<f?1:-1,ve.progress=f,r&&!ht&&(i=f&&!c?0:1===f?1:1===c?2:3,ce&&(o=!s&&"none"!==he[i+1]&&he[i+1]||he[i],a=x&&("complete"===o||"reset"===o||o in x))),ae&&s&&(a||$||!x)&&(Le(ae)?ae(ve):ve.getTrailing(ae).forEach(function(e){return e.endAnimation()})),ce||(!D||ht||wt?x&&x.totalProgress(f,!!ht):(D.vars.totalProgress=f,D.invalidate().restart())),J&&(e&&K&&(A.style[K+le.os2]=h),de?r&&(u=!e&&c<f&&l<S+1&&l+1>=ze(ue,le),ie&&(e||!n&&!u?rt(J,A):(t=it(J,!0),c=l-w,rt(J,ut,t.top+(le===Ft?c:0)+Nt,t.left+(le===Ft?0:c)+Nt))),ot(n||u?P:_),I!==E&&f<1&&n||p(B+(1!==f||u?0:I))):p(B+I*f)),!ne||d.tween||ht||wt||W.restart(!0),X&&(s||re&&f&&(f<1||!yt))&&ft(X.targets).forEach(function(e){return e.classList[n||re?"add":"remove"](X.className)}),!U||ce||e||U(ve),r&&!ht?(ce&&(a&&("complete"===o?x.pause().totalProgress(1):"reset"===o?x.restart(!0).pause():"restart"===o?x.restart(!0):x[o]()),U&&U(ve)),!s&&yt||(Y&&s&&We(ve,Y),pe[i]&&We(ve,pe[i]),re&&(1===f?ve.kill(!1,1):pe[i]=0),s||pe[i=1===f?1:3]&&We(ve,pe[i])),se&&!n&&Math.abs(ve.getVelocity())>(Ne(se)?se:2500)&&(Fe(ve.callbackAnimation),D?D.progress(1):Fe(x,!f,1))):ce&&U&&!ht&&U(ve)),v&&(f=oe?l/oe.duration()*(oe._caScrollDist||0):l,g(f+(T._isFlipped?1:0)),v(f)),q&&q(-l/oe.duration()*(oe._caScrollDist||0)))},ve.enable=function(e,t){ve.enabled||(ve.enabled=!0,Xe(ue,"resize",Je),Xe(ue,"scroll",Ge),s&&Xe(Xt,"refreshInit",s),!1!==e&&(ve.progress=H=0,y=b=ye=be()),!1!==t&&ve.refresh())},ve.getTween=function(e){return e&&d?d.tween:D},ve.setPositions=function(e,t){J&&(B+=e-w,I+=t-e-E),ve.start=w=e,ve.end=S=t,E=t-e,ve.update()},ve.disable=function(e,t){if(ve.enabled&&(!1!==e&&ve.revert(),ve.enabled=ve.isActive=!1,t||D&&D.pause(),V=0,n&&(n.uncache=1),s&&Ye(Xt,"refreshInit",s),W&&(W.pause(),d.tween&&d.tween.kill()&&(d.tween=0)),!fe)){for(var r=Vt.length;r--;)if(Vt[r].scroller===ue&&Vt[r]!==ve)return;Ye(ue,"resize",Je),Ye(ue,"scroll",Ge)}},ve.kill=function(e,t){ve.disable(e,t),D&&D.kill(),i&&delete jt[i];var r=Vt.indexOf(ve);0<=r&&Vt.splice(r,1),r===vt&&0<qt&&vt--,r=0,Vt.forEach(function(e){return e.scroller===ve.scroller&&(r=1)}),r||(ve.scroll.rec=0),x&&(x.scrollTrigger=null,e&&x.render(-1),t||x.kill()),k&&[k,C,T,O].forEach(function(e){return e.parentNode&&e.parentNode.removeChild(e)}),J&&(n&&(n.uncache=1),r=0,Vt.forEach(function(e){return e.pin===J&&r++}),r||(n.spacer=0))},ve.enable(!1,!1),x&&x.add&&!E?st.delayedCall(.01,function(){return w||S||ve.refresh()})&&(E=.01)&&(w=S=0):ve.refresh()):this.update=this.refresh=this.kill=Pe},Xt.register=function(e){var t,r;return!d&&(st=e||i(),n()&&window.document&&(at=window,lt=document,ct=lt.documentElement,ut=lt.body),st&&(ft=st.utils.toArray,dt=st.utils.clamp,xt=st.core.suppressOverwrites||Pe,st.core.globals("ScrollTrigger",Xt),ut))&&(Xe(at,"wheel",Ge),h=[at,lt,ct,ut],Xe(lt,"scroll",Ge),r=(t=ut.style).borderTopStyle,t.borderTopStyle="solid",e=it(ut),Ft.m=Math.round(e.top+Ft.sc())||0,Dt.m=Math.round(e.left+Dt.sc())||0,r?t.borderTopStyle=r:t.removeProperty("border-top-style"),v=setInterval(c,200),st.delayedCall(.5,function(){return wt=0}),Xe(lt,"touchcancel",Pe),Xe(ut,"touchstart",Pe),l(Xe,lt,"pointerdown,touchstart,mousedown",function(){return gt=1}),l(Xe,lt,"pointerup,touchend,mouseup",function(){return gt=0}),m=st.utils.checkPrefix("transform"),V.push(m),d=kt(),g=st.delayedCall(.2,f).pause(),w=[lt,"visibilitychange",function(){var e=at.innerWidth,t=at.innerHeight;lt.hidden?(y=e,b=t):y===e&&b===t||Je()},lt,"DOMContentLoaded",f,at,"load",function(){return Ct||f()},at,"resize",Je],o(Xe)),d},Xt.defaults=function(e){if(e)for(var t in e)Ht[t]=e[t];return Ht},Xt.kill=function(){Tt=0,Vt.slice(0).forEach(function(e){return e.kill(1)})},Xt.config=function(e){"limitCallbacks"in e&&(yt=!!e.limitCallbacks);var t=e.syncInterval;t&&clearInterval(v)||(v=t)&&setInterval(c,t),"autoRefreshEvents"in e&&(o(Ye),o(Xe,e.autoRefreshEvents||"none"),S=-1===(e.autoRefreshEvents+"").indexOf("resize"))},Xt.scrollerProxy=function(e,t){var r=_e(e),n=T.indexOf(r),e=Ae(r);~n&&T.splice(n,e?6:2),t&&(e?St.unshift(at,t,ut,t,ct,t):St.unshift(r,t))},Xt.matchMedia=function(e){var t,r,n,i,o;for(r in e)n=z.indexOf(r),i=e[r],"all"===(bt=r)?i():(t=at.matchMedia(r))&&(t.matches&&(o=i()),~n?(z[n+1]=a(z[n+1],i),z[n+2]=a(z[n+2],o)):(n=z.length,z.push(r,i,o),t.addListener?t.addListener(u):t.addEventListener("change",u)),z[n+3]=t.matches),bt=0;return z},Xt.clearMatchMedia=function(e){e||(z.length=0),0<=(e=z.indexOf(e))&&z.splice(e,4)},Xt.isInViewport=function(e,t,r){e=(Ot(e)?_e(e):e).getBoundingClientRect(),t=e[r?Mt:Pt]*t||0;return r?0<e.right-t&&e.left+t<at.innerWidth:0<e.bottom-t&&e.top+t<at.innerHeight},Xt.positionInViewport=function(e,t,r){var n=(e=Ot(e)?_e(e):e).getBoundingClientRect(),e=n[r?Mt:Pt],t=null==t?e/2:t in R?R[t]*e:~t.indexOf("%")?parseFloat(t)*e/100:parseFloat(t)||0;return r?(n.left+t)/at.innerWidth:(n.top+t)/at.innerHeight},Xt);function Xt(e,t){d||Xt.register(st)||console.warn("Please gsap.registerPlugin(ScrollTrigger)"),this.init(e,t)}U.version="3.9.1",U.saveStyles=function(e){return e?ft(e).forEach(function(e){var t;e&&e.style&&(0<=(t=N.indexOf(e))&&N.splice(t,5),N.push(e,e.style.cssText,e.getBBox&&e.getAttribute("transform"),st.core.getCache(e),bt))}):N},U.revert=function(e,t){return F(!e,t)},U.create=function(e,t){return new U(e,t)},U.refresh=function(e){return e?Je():(d||U.register())&&f(!0)},U.update=t,U.clearScrollMemory=r,U.maxScroll=function(e,t){return ze(e,t?Dt:Ft)},U.getScrollFunc=function(e,t){return Be(_e(e),t?Dt:Ft)},U.getById=function(e){return jt[e]},U.getAll=function(){return Vt.slice(0)},U.isScrolling=function(){return!!Ct},U.snapDirectional=Ue,U.addEventListener=function(e,t){e=B[e]||(B[e]=[]);~e.indexOf(t)||e.push(t)},U.removeEventListener=function(e,t){e=B[e],t=e&&e.indexOf(t);0<=t&&e.splice(t,1)},U.batch=function(e,t){var r,n=[],i={},o=t.interval||.016,s=t.batchMax||1e9;for(r in t)i[r]="on"===r.substr(0,2)&&Le(t[r])&&"onRefreshInit"!==r?function(e){var t=[],r=[],n=st.delayedCall(o,function(){e(t,r),t=[],r=[]}).pause();return function(e){t.length||n.restart(!0),t.push(e.trigger),r.push(e),s<=t.length&&n.progress(1)}}(t[r]):t[r];return Le(s)&&(s=s(),Xe(U,"refresh",function(){return s=t.batchMax()})),ft(e).forEach(function(e){var t={};for(r in i)t[r]=i[r];t.trigger=e,n.push(U.create(t))}),n},U.sort=function(e){return Vt.sort(e||function(e,t){return-1e6*(e.vars.refreshPriority||0)+e.start-(t.start+-1e6*(t.vars.refreshPriority||0))})},i()&&st.registerPlugin(U),e.ScrollTrigger=U,e.default=U,"undefined"==typeof window||window!==e?Object.defineProperty(e,"__esModule",{value:!0}):delete e.default});
!function(_){var n;waitForFinalEvent=(n={},function(t,a,e){n[e=e||"Don't call this twice without a uniqueId"]&&clearTimeout(n[e]),n[e]=setTimeout(t,a)}),timeToWaitForLast=100,_(document).ready(function(){function a(t){_.fancybox.open([{src:".contact_cta--"+t+" .contact_cta__container",opts:{}}],{type:"inline",baseClass:"contact_cta__fancybox",infobar:!1,smallBtn:!0,buttons:!1,modal:!1,btnTpl:{smallBtn:'<button type="button" data-fancybox-close class="fancybox-button fancybox-close-small"><svg xmlns="http://www.w3.org/2000/svg" width="33.122" height="31.007" viewBox="0 0 33.122 31.007"><g transform="translate(0.341 0.366)"><line x1="32.44" y2="30.275" fill="none" stroke="currentColor" stroke-width="1"/><line x1="32.44" y1="29.725" transform="translate(0 0.275)" fill="none" stroke="currentColor" stroke-width="1"/></g></svg></button>'},afterClose:function(){_(".contact_cta__container").removeClass("contact_cta__container--complete"),_(".contact_cta__container .contact__form__field").removeClass("contact__form__field--has_value")}})}var t,e;_(".nav__toggle").on("click",function(t){t.preventDefault(),_("body").toggleClass("nav--open"),_(".nav__container").scrollTo(0),_("body").hasClass("nav--open")||_(".nav__primary__menu__item.main-menu-item").removeClass("nav__primary__menu__item--hovering")}),_(".nav__primary__menu__item.main-menu-item.menu-item-has-children > a").on("click",function(t){t.preventDefault(),_(this).parents(".nav__primary__menu__item.main-menu-item").addClass("nav__primary__menu__item--selected")}),_(".nav__primary__menu__item.main-menu-item > a").on("mouseenter",function(t){var a=_(this).parents(".nav__primary__menu__item.main-menu-item");a.hasClass("menu-item-has-children")?a.addClass("nav__primary__menu__item--hovering"):_(".nav__primary__menu__item.main-menu-item").removeClass("nav__primary__menu__item--hovering")}),_(".nav__meganav__parent").on("click",function(t){t.preventDefault();t=_(this).parents(".nav__primary__menu__item.main-menu-item");t.removeClass("nav__primary__menu__item--selected"),t.find(".meganav__container").scrollTo(0)}),_("body").on("click",function(t){_("body").hasClass("nav--open")&&0===_(t.target).closest(".nav__container").length&&0===_(t.target).closest(".fancybox-container").length&&0===_(t.target).closest(".nav__secondary").length&&0===_(t.target).closest(".nav__toggle").length&&_(".nav__toggle").first().trigger("click")}),_('a[href*="#"').on("click",function(t){var a=_(this).attr("href").split("#")[1],a=_('*[data-anchor="'+a+'"]');0<a.length&&(t.preventDefault(),t=-1*_(".site__header").height(),_.scrollTo(a,500,{offset:t}))}),_('a.link--contact, .link--contact a, .contact_cta .btn, .contact_cta .button, a[href*="#contact"], .contact__modal__target .btn, .contact__modal__target .button').on("click",function(t){t.preventDefault(),a("contact")}),_('a.link--demo, .link--demo a, a[href*="#demo"]').on("click",function(t){t.preventDefault(),a("demo")}),_(".wpcf7").each(function(){var o=this;o.addEventListener("wpcf7mailsent",function(t){for(var t=t.target,a=new FormData(t),e=(a=a.entries()).next(),n={};void 0!==e.value;)n[e.value[0]]=e.value[1],e=a.next();_(o).parents(".contact_cta__container").addClass("contact_cta__container--complete"),_.ajax({url:ajax_url,method:"POST",dataType:"JSON",data:{action:"create-intercom-lead",form_data:n},complete:function(t,a,e){}});t=_(o).find(".contact__form__actions").data("submit-event");void 0!==t&&"undefined"!=typeof dataLayer&&dataLayer.push({event:t})},!1)}),_(".contact__text, .contact__textarea").on("focus",function(){var t=_(this).parents(".contact__form__field");t.removeClass("contact__form__field--has_value"),t.addClass("contact__form__field--focused")}),_(".contact__text, .contact__textarea").on("blur",function(){var t=_(this).parents(".contact__form__field");t.removeClass("contact__form__field--focused"),""!==_(this).val()&&t.addClass("contact__form__field--has_value")}),_(".meganav__usecase__icon img").each(function(){var t,a,e,n;a=_(t=this),e=a.attr("id"),n=a.attr("class"),t=a.attr("src"),jQuery.get(t,function(t){t=jQuery(t).find("svg");void 0!==e&&(t=t.attr("id",e)),!(t=(t=void 0!==n?t.attr("class",n+" replaced-svg"):t).removeAttr("xmlns:a")).attr("viewBox")&&t.attr("height")&&t.attr("width")&&t.attr("viewBox","0 0 "+t.attr("height")+" "+t.attr("width")),a.replaceWith(t)},"xml")}),_(".page__content__main > *:nth-child(1)").each(function(){var t=_(".site__header"),a=_(".site__header__background"),t=(t.height(),_(this));gsap.timeline({scrollTrigger:{trigger:t,start:"top top",end:"bottom center",scrub:!0,markers:!1}}).to(a,{opacity:1})}),_(".contact__text, .contact__textarea, .contact__select").each(function(){var t=_(this).parents(".contact__form__field");""!==_(this).val()&&t.addClass("contact__form__field--has_value")}),window.location.hash&&(e=window.location.hash.substring(1),0<(t=_('*[data-anchor="'+e+'"]')).length&&(e=-1*_(".site__header").height(),_.scrollTo(t,500,{offset:e})))})}(jQuery);
!function(r){r(document).ready(function(){var a=[];r(".video_grid__nav__item a").click(function(e){e.preventDefault();e=r(this).parents(".video_grid__nav__item").index();r(".video_grid__nav__item").removeClass("video_grid__nav__item--current"),r(".video_grid__nav__item").eq(e).addClass("video_grid__nav__item--current"),r(".video_grid__pagination").removeClass("video_grid__pagination--end_of_category"),r(".video_grid__more").removeClass("video_grid__more--end"),0===r(".video_grid").find(".video_grid__category--current .video_grid__category__page__slide--current").next().length&&(r(".video_grid__pagination").addClass("video_grid__pagination--end_of_category"),r(".video_grid__more").addClass("video_grid__more--end")),_.goTo(e)}),r(".video_grid__play, .video_grid__thumbnail").click(function(e){e.preventDefault();e=r(this).parents(".video_grid__video").find(".video_grid__play");if(e.hasClass("video_grid__play--download")){var i=e.attr("href");return window.open(i,"_blank"),!0}r(window).width(),r(this).parents(".video_grid__video").find(".study__grid__player");var _,i=r(this).parents(".video_grid__video").find(".study__grid__modal"),d=i,o=i.find(".modal__video__player");0<o.length&&(_=o.data("video-api-id")),r.fancybox.open({type:"inline",src:d,opts:{slideClass:"fancybox__study__video__modal",animationEffect:!1,infobar:!1,video:{autoStart:!1},beforeShow:function(){},afterShow:function(){var e={aspectRatio:o.data("video-width")+":"+o.data("video-height"),preload:"auto"};r('<video id="'+_+'" class="video-js vjs-fill vjs-big-play-centered  modal__video__player" controls="false" preload="auto" poster="'+o.data("poster-url")+'" data-video-width="'+o.data("video-width")+'" data-video-height="'+o.data("video-height")+'" data-setup="{}" ><source src="'+o.data("video-url")+'" type="video/mp4"></source></video>').appendTo(d.find(".modal__video__player")),function(e,i){r(window).width();var _=r(window).height()-88;e.removeAttr("style");var d=e.width(),o=e.height();_<o&&(i.data("video-height"),i.data("video-width"),e.css("width",d*(_/o)))}(o.parents(".study__grid__detail"),o),a[_]=videojs(_,e,function(){var e=this;requestAnimationFrame(function(){e.play()})})},afterClose:function(){void 0!==_&&a[_].dispose()}}})}),r(".video_grid__more").click(function(e){if(e.preventDefault(),r(this).hasClass("video_grid__more--end"))return!1;var i=r(".video_grid").find(".tns-slide-active .video_grid__category__page__slide--current"),e=i.next();0<e.length?(i.removeClass("video_grid__category__page__slide--current"),e.show(),e.addClass("video_grid__category__page__slide--visible  video_grid__category__page__slide--current"),e.packery("layout"),requestAnimationFrame(function(){_.refresh()}),0===e.next().length&&(r(".video_grid__pagination").addClass("video_grid__pagination--end_of_category"),r(".video_grid__more").addClass("video_grid__more--end"))):(r(".video_grid__pagination").removeClass("video_grid__pagination--end_of_category"),r(".video_grid__more").removeClass("video_grid__more--end"))});new LazyLoad({elements_selector:".lazy"}),new LazyLoad({elements_selector:".delayed-lazy",callback_enter:function(e){new LazyLoad({container:e})}});r(".value_props__marquee").owlCarousel({lazyLoad:!0,loop:!0,autoplay:!0,autoplayTimeout:0,smartSpeed:2e3,autoplaySpeed:2e3,margin:0,nav:!1,dots:!1,responsive:{0:{items:3},769:{items:3},961:{items:5}},mouseDrag:!1,touchDrag:!1,pullDrag:!1,freeDrag:!1});var _;(_=tns({container:".video_grid__category__carousel",items:1,autoHeight:!0,lazyload:!0,lazyloadSelector:".tns-lazy",controls:!1,nav:!1,loop:!1,touch:!1,mouseDrag:!1,speed:400})).events.on("indexChanged",function(e,i){e=e.index;null!==e&&0<=e&&(r(".video_grid__category").removeClass("video_grid__category--current"),r(".video_grid").find(".tns-slide-active .video_grid__category").addClass("video_grid__category--current"),0===r(".video_grid").find(".tns-slide-active .video_grid__category__page__slide--current").next().length?(r(".video_grid__pagination").addClass("video_grid__pagination--end_of_category"),r(".video_grid__more").addClass("video_grid__more--end")):(r(".video_grid__pagination").removeClass("video_grid__pagination--end_of_category"),r(".video_grid__more").removeClass("video_grid__more--end")))});var e=r(".video_grid__category__carousel .video_grid__category__page__slide");e.each(function(){var e=r(this);e.hasClass("video_grid__category__page__slide--visible")||e.show(),e.packery({itemSelector:".video_grid__video",gutter:0,columnWidth:".video__grid__sizer",percentPosition:!0,transitionDuration:"1s",initLayout:!1,resize:!1}),e.on("layoutComplete",function(){requestAnimationFrame(function(){_.refresh()})}),e.packery("layout")}),r(".guides__heading").matchHeight(),r(".services__tiers__heading").matchHeight(),r(".services__tiers__description").matchHeight(),r(window).on("resize",function(){waitForFinalEvent(function(){e.each(function(){r(this).packery("layout"),_.refresh()})},500,"resize_packery_slides")})})}(jQuery);