/* Minification failed. Returning unminified contents.
(147,40578-40579): run-time error JS1195: Expected expression: >
(147,40676-40677): run-time error JS1195: Expected expression: )
(147,40812-40813): run-time error JS1195: Expected expression: >
(147,40912-40913): run-time error JS1195: Expected expression: )
(147,40987-40988): run-time error JS1195: Expected expression: )
(147,41011-41012): run-time error JS1004: Expected ';': {
(147,41078-41079): run-time error JS1195: Expected expression: )
 */
/*! jQuery Migrate v1.4.1 | (c) jQuery Foundation and other contributors | jquery.org/license */
"undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(a,b,c){function d(c){var d=b.console;f[c]||(f[c]=!0,a.migrateWarnings.push(c),d&&d.warn&&!a.migrateMute&&(d.warn("JQMIGRATE: "+c),a.migrateTrace&&d.trace&&d.trace()))}function e(b,c,e,f){if(Object.defineProperty)try{return void Object.defineProperty(b,c,{configurable:!0,enumerable:!0,get:function(){return d(f),e},set:function(a){d(f),e=a}})}catch(g){}a._definePropertyBroken=!0,b[c]=e}a.migrateVersion="1.4.1";var f={};a.migrateWarnings=[],b.console&&b.console.log&&b.console.log("JQMIGRATE: Migrate is installed"+(a.migrateMute?"":" with logging active")+", version "+a.migrateVersion),a.migrateTrace===c&&(a.migrateTrace=!0),a.migrateReset=function(){f={},a.migrateWarnings.length=0},"BackCompat"===document.compatMode&&d("jQuery is not compatible with Quirks Mode");var g=a("<input/>",{size:1}).attr("size")&&a.attrFn,h=a.attr,i=a.attrHooks.value&&a.attrHooks.value.get||function(){return null},j=a.attrHooks.value&&a.attrHooks.value.set||function(){return c},k=/^(?:input|button)$/i,l=/^[238]$/,m=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,n=/^(?:checked|selected)$/i;e(a,"attrFn",g||{},"jQuery.attrFn is deprecated"),a.attr=function(b,e,f,i){var j=e.toLowerCase(),o=b&&b.nodeType;return i&&(h.length<4&&d("jQuery.fn.attr( props, pass ) is deprecated"),b&&!l.test(o)&&(g?e in g:a.isFunction(a.fn[e])))?a(b)[e](f):("type"===e&&f!==c&&k.test(b.nodeName)&&b.parentNode&&d("Can't change the 'type' of an input or button in IE 6/7/8"),!a.attrHooks[j]&&m.test(j)&&(a.attrHooks[j]={get:function(b,d){var e,f=a.prop(b,d);return f===!0||"boolean"!=typeof f&&(e=b.getAttributeNode(d))&&e.nodeValue!==!1?d.toLowerCase():c},set:function(b,c,d){var e;return c===!1?a.removeAttr(b,d):(e=a.propFix[d]||d,e in b&&(b[e]=!0),b.setAttribute(d,d.toLowerCase())),d}},n.test(j)&&d("jQuery.fn.attr('"+j+"') might use property instead of attribute")),h.call(a,b,e,f))},a.attrHooks.value={get:function(a,b){var c=(a.nodeName||"").toLowerCase();return"button"===c?i.apply(this,arguments):("input"!==c&&"option"!==c&&d("jQuery.fn.attr('value') no longer gets properties"),b in a?a.value:null)},set:function(a,b){var c=(a.nodeName||"").toLowerCase();return"button"===c?j.apply(this,arguments):("input"!==c&&"option"!==c&&d("jQuery.fn.attr('value', val) no longer sets properties"),void(a.value=b))}};var o,p,q=a.fn.init,r=a.find,s=a.parseJSON,t=/^\s*</,u=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,v=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,w=/^([^<]*)(<[\w\W]+>)([^>]*)$/;a.fn.init=function(b,e,f){var g,h;return b&&"string"==typeof b&&!a.isPlainObject(e)&&(g=w.exec(a.trim(b)))&&g[0]&&(t.test(b)||d("$(html) HTML strings must start with '<' character"),g[3]&&d("$(html) HTML text after last tag is ignored"),"#"===g[0].charAt(0)&&(d("HTML string cannot start with a '#' character"),a.error("JQMIGRATE: Invalid selector string (XSS)")),e&&e.context&&e.context.nodeType&&(e=e.context),a.parseHTML)?q.call(this,a.parseHTML(g[2],e&&e.ownerDocument||e||document,!0),e,f):(h=q.apply(this,arguments),b&&b.selector!==c?(h.selector=b.selector,h.context=b.context):(h.selector="string"==typeof b?b:"",b&&(h.context=b.nodeType?b:e||document)),h)},a.fn.init.prototype=a.fn,a.find=function(a){var b=Array.prototype.slice.call(arguments);if("string"==typeof a&&u.test(a))try{document.querySelector(a)}catch(c){a=a.replace(v,function(a,b,c,d){return"["+b+c+'"'+d+'"]'});try{document.querySelector(a),d("Attribute selector with '#' must be quoted: "+b[0]),b[0]=a}catch(e){d("Attribute selector with '#' was not fixed: "+b[0])}}return r.apply(this,b)};var x;for(x in r)Object.prototype.hasOwnProperty.call(r,x)&&(a.find[x]=r[x]);a.parseJSON=function(a){return a?s.apply(this,arguments):(d("jQuery.parseJSON requires a valid JSON string"),null)},a.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a.browser||(o=a.uaMatch(navigator.userAgent),p={},o.browser&&(p[o.browser]=!0,p.version=o.version),p.chrome?p.webkit=!0:p.webkit&&(p.safari=!0),a.browser=p),e(a,"browser",a.browser,"jQuery.browser is deprecated"),a.boxModel=a.support.boxModel="CSS1Compat"===document.compatMode,e(a,"boxModel",a.boxModel,"jQuery.boxModel is deprecated"),e(a.support,"boxModel",a.support.boxModel,"jQuery.support.boxModel is deprecated"),a.sub=function(){function b(a,c){return new b.fn.init(a,c)}a.extend(!0,b,this),b.superclass=this,b.fn=b.prototype=this(),b.fn.constructor=b,b.sub=this.sub,b.fn.init=function(d,e){var f=a.fn.init.call(this,d,e,c);return f instanceof b?f:b(f)},b.fn.init.prototype=b.fn;var c=b(document);return d("jQuery.sub() is deprecated"),b},a.fn.size=function(){return d("jQuery.fn.size() is deprecated; use the .length property"),this.length};var y=!1;a.swap&&a.each(["height","width","reliableMarginRight"],function(b,c){var d=a.cssHooks[c]&&a.cssHooks[c].get;d&&(a.cssHooks[c].get=function(){var a;return y=!0,a=d.apply(this,arguments),y=!1,a})}),a.swap=function(a,b,c,e){var f,g,h={};y||d("jQuery.swap() is undocumented and deprecated");for(g in b)h[g]=a.style[g],a.style[g]=b[g];f=c.apply(a,e||[]);for(g in b)a.style[g]=h[g];return f},a.ajaxSetup({converters:{"text json":a.parseJSON}});var z=a.fn.data;a.fn.data=function(b){var e,f,g=this[0];return!g||"events"!==b||1!==arguments.length||(e=a.data(g,b),f=a._data(g,b),e!==c&&e!==f||f===c)?z.apply(this,arguments):(d("Use of jQuery.fn.data('events') is deprecated"),f)};var A=/\/(java|ecma)script/i;a.clean||(a.clean=function(b,c,e,f){c=c||document,c=!c.nodeType&&c[0]||c,c=c.ownerDocument||c,d("jQuery.clean() is deprecated");var g,h,i,j,k=[];if(a.merge(k,a.buildFragment(b,c).childNodes),e)for(i=function(a){return!a.type||A.test(a.type)?f?f.push(a.parentNode?a.parentNode.removeChild(a):a):e.appendChild(a):void 0},g=0;null!=(h=k[g]);g++)a.nodeName(h,"script")&&i(h)||(e.appendChild(h),"undefined"!=typeof h.getElementsByTagName&&(j=a.grep(a.merge([],h.getElementsByTagName("script")),i),k.splice.apply(k,[g+1,0].concat(j)),g+=j.length));return k});var B=a.event.add,C=a.event.remove,D=a.event.trigger,E=a.fn.toggle,F=a.fn.live,G=a.fn.die,H=a.fn.load,I="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",J=new RegExp("\\b(?:"+I+")\\b"),K=/(?:^|\s)hover(\.\S+|)\b/,L=function(b){return"string"!=typeof b||a.event.special.hover?b:(K.test(b)&&d("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),b&&b.replace(K,"mouseenter$1 mouseleave$1"))};a.event.props&&"attrChange"!==a.event.props[0]&&a.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),a.event.dispatch&&e(a.event,"handle",a.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),a.event.add=function(a,b,c,e,f){a!==document&&J.test(b)&&d("AJAX events should be attached to document: "+b),B.call(this,a,L(b||""),c,e,f)},a.event.remove=function(a,b,c,d,e){C.call(this,a,L(b)||"",c,d,e)},a.each(["load","unload","error"],function(b,c){a.fn[c]=function(){var a=Array.prototype.slice.call(arguments,0);return"load"===c&&"string"==typeof a[0]?H.apply(this,a):(d("jQuery.fn."+c+"() is deprecated"),a.splice(0,0,c),arguments.length?this.bind.apply(this,a):(this.triggerHandler.apply(this,a),this))}}),a.fn.toggle=function(b,c){if(!a.isFunction(b)||!a.isFunction(c))return E.apply(this,arguments);d("jQuery.fn.toggle(handler, handler...) is deprecated");var e=arguments,f=b.guid||a.guid++,g=0,h=function(c){var d=(a._data(this,"lastToggle"+b.guid)||0)%g;return a._data(this,"lastToggle"+b.guid,d+1),c.preventDefault(),e[d].apply(this,arguments)||!1};for(h.guid=f;g<e.length;)e[g++].guid=f;return this.click(h)},a.fn.live=function(b,c,e){return d("jQuery.fn.live() is deprecated"),F?F.apply(this,arguments):(a(this.context).on(b,this.selector,c,e),this)},a.fn.die=function(b,c){return d("jQuery.fn.die() is deprecated"),G?G.apply(this,arguments):(a(this.context).off(b,this.selector||"**",c),this)},a.event.trigger=function(a,b,c,e){return c||J.test(a)||d("Global events are undocumented and deprecated"),D.call(this,a,b,c||document,e)},a.each(I.split("|"),function(b,c){a.event.special[c]={setup:function(){var b=this;return b!==document&&(a.event.add(document,c+"."+a.guid,function(){a.event.trigger(c,Array.prototype.slice.call(arguments,1),b,!0)}),a._data(this,c,a.guid++)),!1},teardown:function(){return this!==document&&a.event.remove(document,c+"."+a._data(this,c)),!1}}}),a.event.special.ready={setup:function(){this===document&&d("'ready' event is deprecated")}};var M=a.fn.andSelf||a.fn.addBack,N=a.fn.find;if(a.fn.andSelf=function(){return d("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),M.apply(this,arguments)},a.fn.find=function(a){var b=N.apply(this,arguments);return b.context=this.context,b.selector=this.selector?this.selector+" "+a:a,b},a.Callbacks){var O=a.Deferred,P=[["resolve","done",a.Callbacks("once memory"),a.Callbacks("once memory"),"resolved"],["reject","fail",a.Callbacks("once memory"),a.Callbacks("once memory"),"rejected"],["notify","progress",a.Callbacks("memory"),a.Callbacks("memory")]];a.Deferred=function(b){var c=O(),e=c.promise();return c.pipe=e.pipe=function(){var b=arguments;return d("deferred.pipe() is deprecated"),a.Deferred(function(d){a.each(P,function(f,g){var h=a.isFunction(b[f])&&b[f];c[g[1]](function(){var b=h&&h.apply(this,arguments);b&&a.isFunction(b.promise)?b.promise().done(d.resolve).fail(d.reject).progress(d.notify):d[g[0]+"With"](this===e?d.promise():this,h?[b]:arguments)})}),b=null}).promise()},c.isResolved=function(){return d("deferred.isResolved is deprecated"),"resolved"===c.state()},c.isRejected=function(){return d("deferred.isRejected is deprecated"),"rejected"===c.state()},b&&b.call(c,c),c}}}(jQuery,window);;
/*! jQuery UI - v1.12.1 - 2017-04-10
* http://jqueryui.com
* Includes: widget.js, data.js, disable-selection.js, keycode.js, scroll-parent.js, unique-id.js, widgets/sortable.js, widgets/mouse.js, widgets/slider.js, widgets/tabs.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */

(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){t.ui=t.ui||{},t.ui.version="1.12.1";var e=0,i=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{s=t._data(n,"events"),s&&s.remove&&t(n).triggerHandler("remove")}catch(a){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,a,r={},l=e.split(".")[0];e=e.split(".")[1];var h=l+"-"+e;return s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr[":"][h.toLowerCase()]=function(e){return!!t.data(e,h)},t[l]=t[l]||{},n=t[l][e],o=t[l][e]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),void 0):new o(t,e)},t.extend(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),a=new i,a.options=t.widget.extend({},a.options),t.each(s,function(e,s){return t.isFunction(s)?(r[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}(),void 0):(r[e]=s,void 0)}),o.prototype=t.widget.extend(a,{widgetEventPrefix:n?a.widgetEventPrefix||e:e},r,{constructor:o,namespace:l,widgetName:e,widgetFullName:h}),n?(t.each(n._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete n._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var s,n,o=i.call(arguments,1),a=0,r=o.length;r>a;a++)for(s in o[a])n=o[a][s],o[a].hasOwnProperty(s)&&void 0!==n&&(e[s]=t.isPlainObject(n)?t.isPlainObject(e[s])?t.widget.extend({},e[s],n):t.widget.extend({},n):n);return e},t.widget.bridge=function(e,s){var n=s.prototype.widgetFullName||e;t.fn[e]=function(o){var a="string"==typeof o,r=i.call(arguments,1),l=this;return a?this.length||"instance"!==o?this.each(function(){var i,s=t.data(this,n);return"instance"===o?(l=s,!1):s?t.isFunction(s[o])&&"_"!==o.charAt(0)?(i=s[o].apply(s,r),i!==s&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+o+"'")}):l=void 0:(r.length&&(o=t.widget.extend.apply(null,[o].concat(r))),this.each(function(){var e=t.data(this,n);e?(e.option(o||{}),e._init&&e._init()):t.data(this,n,new s(o,this))})),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(i,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=e++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),i),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var l=s.match(/^([\w:-]*)\s*(.*)$/),h=l[1]+o.eventNamespace,c=l[2];c?n.on(h,c,r):i.on(h,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}}),t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var s=!1;t(document).on("mouseup",function(){s=!1}),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!s){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,n=1===e.which,o="string"==typeof this.options.cancel&&e.target.nodeName?t(e.target).closest(this.options.cancel).length:!1;return n&&!o&&this._mouseCapture(e)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(e)!==!1,!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),s=!0,!0)):!0}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,s=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.widget("ui.sortable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return t>=e&&e+i>t},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var e=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),t.each(this.items,function(){e._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):void 0}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-this.document.scrollTop()<a.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-a.scrollSpeed):this.window.height()-(e.pageY-this.document.scrollTop())<a.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+a.scrollSpeed)),e.pageX-this.document.scrollLeft()<a.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-a.scrollSpeed):this.window.width()-(e.pageX-this.document.scrollLeft())<a.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+a.scrollSpeed))),r!==!1&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new t.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,l=r+t.height,h=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+h>r&&l>s+h,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&l>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var e,i,s="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),n="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),o=s&&n;return o?(e=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection(),this.floating?"right"===i||"down"===e?2:1:e&&("down"===e?2:1)):!1},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&e||"up"===s&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],l=[],h=this._connectWith();if(h&&e)for(s=h.length-1;s>=0;s--)for(o=t(h[s],this.document[0]),n=o.length-1;n>=0;n--)a=t.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&l.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(l.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=l.length-1;s>=0;s--)l[s][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,l,h,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i],this.document[0]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,h=r.length;h>s;s++)l=t(r[s]),l.data(this.widgetName+"-item",a),c.push({item:l,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]);return e._addClass(n,"ui-sortable-placeholder",i||e.currentItem[0].className)._removeClass(n,"ui-sortable-helper"),"tbody"===s?e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("<tr>",e.document[0]).appendTo(n)):"tr"===s?e._createTrPlaceholder(e.currentItem,n):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,i){var s=this;e.children().each(function(){t("<td>&#160;</td>",s.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(e){var i,s,n,o,a,r,l,h,c,u,d=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!t.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(d&&t.contains(this.containers[i].element[0],d.element[0]))continue;d=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",e,this._uiHash(this)),this.containers[i].containerCache.over=0);if(d)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,o=null,c=d.floating||this._isFloating(this.currentItem),a=c?"left":"top",r=c?"width":"height",u=c?"pageX":"pageY",s=this.items.length-1;s>=0;s--)t.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(l=this.items[s].item.offset()[a],h=!1,e[u]-l>this.items[s][r]/2&&(h=!0),n>Math.abs(e[u]-l)&&(n=Math.abs(e[u]-l),o=this.items[s],this.direction=h?"up":"down"));if(!o&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;o?this._rearrange(e,o,null,!0):this._rearrange(e,null,this.containers[p].element,!0),this._trigger("change",e,this._uiHash()),this.containers[p]._trigger("change",e,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])
},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():l?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():l?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}}),t.widget("ui.slider",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle"),o="<span tabindex='0'></span>",a=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)a.push(o);this.handles=n.add(t(a.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e).attr("tabIndex",0)})},_createRange:function(){var e=this.options;e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=t("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),("min"===e.range||"max"===e.range)&&this._addClass(this.range,"ui-slider-range-"+e.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,o,a,r,l,h,c=this,u=this.options;return u.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-c.values(e));(n>i||n===i&&(e===c._lastChangedValue||c.values(e)===u.min))&&(n=i,o=t(this),a=e)}),r=this._start(e,a),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=a,this._addClass(o,null,"ui-state-active"),o.trigger("focus"),l=o.offset(),h=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=h?{left:0,top:0}:{left:e.pageX-l.left-o.width()/2,top:e.pageY-l.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,a,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,o;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),o=this._valueMin()+s*n,this._trimAlignValue(o)},_uiHash:function(t,e,i){var s={handle:this.handles[t],handleIndex:t,value:void 0!==e?e:this.value()};return this._hasMultipleValues()&&(s.value=void 0!==e?e:this.values(t),s.values=i||this.values()),s},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(t,e){return this._trigger("start",t,this._uiHash(e))},_slide:function(t,e,i){var s,n,o=this.value(),a=this.values();this._hasMultipleValues()&&(n=this.values(e?0:1),o=this.values(e),2===this.options.values.length&&this.options.range===!0&&(i=0===e?Math.min(n,i):Math.max(n,i)),a[e]=i),i!==o&&(s=this._trigger("slide",t,this._uiHash(e,i,a)),s!==!1&&(this._hasMultipleValues()?this.values(e,i):this.value(i)))},_stop:function(t,e){this._trigger("stop",t,this._uiHash(e))},_change:function(t,e){this._keySliding||this._mouseSliding||(this._lastChangedValue=e,this._trigger("change",t,this._uiHash(e)))},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(e,i){var s,n,o;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),void 0;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this._hasMultipleValues()?this._values(e):this.value();for(s=this.options.values,n=arguments[0],o=0;s.length>o;o+=1)s[o]=this._trimAlignValue(n[o]),this._change(null,o);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),this._super(e,i),e){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(i),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=n-1;s>=0;s--)this._change(null,s);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(t){this._super(t),this._toggleClass(null,"ui-state-disabled",!!t)},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this._hasMultipleValues()){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_calculateNewMax:function(){var t=this.options.max,e=this._valueMin(),i=this.options.step,s=Math.round((t-e)/i)*i;t=s+e,t>this.options.max&&(t-=i),this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(t){"vertical"===t&&this.range.css({width:"",left:""}),"horizontal"===t&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var e,i,s,n,o,a=this.options.range,r=this.options,l=this,h=this._animateOff?!1:r.animate,c={};this._hasMultipleValues()?this.handles.each(function(s){i=100*((l.values(s)-l._valueMin())/(l._valueMax()-l._valueMin())),c["horizontal"===l.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[h?"animate":"css"](c,r.animate),l.options.range===!0&&("horizontal"===l.orientation?(0===s&&l.range.stop(1,1)[h?"animate":"css"]({left:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&l.range.stop(1,1)[h?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),o=this._valueMax(),i=o!==n?100*((s-n)/(o-n)):0,c["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[h?"animate":"css"](c,r.animate),"min"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:i+"%"},r.animate),"max"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:100-i+"%"},r.animate),"min"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:i+"%"},r.animate),"max"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:100-i+"%"},r.animate))},_handleEvents:{keydown:function(e){var i,s,n,o,a=t(e.target).data("ui-slider-handle-index");switch(e.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(e.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(t(e.target),null,"ui-state-active"),i=this._start(e,a),i===!1))return}switch(o=this.options.step,s=n=this._hasMultipleValues()?this.values(a):this.value(),e.keyCode){case t.ui.keyCode.HOME:n=this._valueMin();break;case t.ui.keyCode.END:n=this._valueMax();break;case t.ui.keyCode.PAGE_UP:n=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(s===this._valueMax())return;n=this._trimAlignValue(s+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(s===this._valueMin())return;n=this._trimAlignValue(s-o)}this._slide(e,a,n)},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),this._removeClass(t(e.target),null,"ui-state-active"))}}}),t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}(),t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(i){e=t.body}return e||(e=t.body),e.nodeName||(e=t.body),e},t.widget("ui.tabs",{version:"1.12.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var t=/#.*$/;return function(e){var i,s;i=e.href.replace(t,""),s=location.href.replace(t,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return e.hash.length>1&&i===s}}(),_create:function(){var e=this,i=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,i.collapsible),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var e=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===e&&(s&&this.tabs.each(function(i,n){return t(n).attr("aria-controls")===s?(e=i,!1):void 0}),null===e&&(e=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===e||-1===e)&&(e=this.tabs.length?0:!1)),e!==!1&&(e=this.tabs.index(this.tabs.eq(e)),-1===e&&(e=i?!1:0)),!i&&e===!1&&this.anchors.length&&(e=0),e},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(e){var i=t(t.ui.safeActiveElement(this.document[0])).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(e)){switch(e.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:s++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:n=!1,s--;break;case t.ui.keyCode.END:s=this.anchors.length-1;break;case t.ui.keyCode.HOME:s=0;break;case t.ui.keyCode.SPACE:return e.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case t.ui.keyCode.ENTER:return e.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}e.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),e.ctrlKey||e.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(e){return e.altKey&&e.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):e.altKey&&e.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){return"active"===t?(this._activate(e),void 0):(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e),void 0)},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this,i=this.tabs,s=this.anchors,n=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).attr({role:"presentation",tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=t(),this.anchors.each(function(i,s){var n,o,a,r=t(s).uniqueId().attr("id"),l=t(s).closest("li"),h=l.attr("aria-controls");e._isLocal(s)?(n=s.hash,a=n.substring(1),o=e.element.find(e._sanitizeSelector(n))):(a=l.attr("aria-controls")||t({}).uniqueId()[0].id,n="#"+a,o=e.element.find(n),o.length||(o=e._createPanel(a),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),h&&l.data("ui-tabs-aria-controls",h),l.attr({"aria-controls":a,"aria-labelledby":r}),o.attr("aria-labelledby",r)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),i&&(this._off(i.not(this.tabs)),this._off(s.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(e){var i,s,n;for(t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1),n=0;s=this.tabs[n];n++)i=t(s),e===!0||-1!==t.inArray(n,e)?(i.attr("aria-disabled","true"),this._addClass(i,null,"ui-state-disabled")):(i.removeAttr("aria-disabled"),this._removeClass(i,null,"ui-state-disabled"));this.options.disabled=e,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,e===!0)},_setupEvents:function(e){var i={};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),o=n.closest("li"),a=o[0]===s[0],r=a&&i.collapsible,l=r?t():this._getPanelForTab(o),h=s.length?this._getPanelForTab(s):t(),c={oldTab:s,oldPanel:h,newTab:r?t():o,newPanel:l};e.preventDefault(),o.hasClass("ui-state-disabled")||o.hasClass("ui-tabs-loading")||this.running||a&&!i.collapsible||this._trigger("beforeActivate",e,c)===!1||(i.active=r?!1:this.tabs.index(o),this.active=a?t():o,this.xhr&&this.xhr.abort(),h.length||l.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),l.length&&this.load(this.tabs.index(o),e),this._toggle(e,c))},_toggle:function(e,i){function s(){o.running=!1,o._trigger("activate",e,i)}function n(){o._addClass(i.newTab.closest("li"),"ui-tabs-active","ui-state-active"),a.length&&o.options.show?o._show(a,o.options.show,s):(a.show(),s())}var o=this,a=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){o._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),n()}):(this._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),a.length&&r.length?i.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),a.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+t.ui.escapeSelector(e)+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(e){var i=this.options.disabled;i!==!1&&(void 0===e?i=!1:(e=this._getIndex(e),i=t.isArray(i)?t.map(i,function(t){return t!==e?t:null}):t.map(this.tabs,function(t,i){return i!==e?i:null})),this._setOptionDisabled(i))},disable:function(e){var i=this.options.disabled;if(i!==!0){if(void 0===e)i=!0;else{if(e=this._getIndex(e),-1!==t.inArray(e,i))return;i=t.isArray(i)?t.merge([e],i).sort():[e]}this._setOptionDisabled(i)}},load:function(e,i){e=this._getIndex(e);var s=this,n=this.tabs.eq(e),o=n.find(".ui-tabs-anchor"),a=this._getPanelForTab(n),r={tab:n,panel:a},l=function(t,e){"abort"===e&&s.panels.stop(!1,!0),s._removeClass(n,"ui-tabs-loading"),a.removeAttr("aria-busy"),t===s.xhr&&delete s.xhr};this._isLocal(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(n,"ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.done(function(t,e,n){setTimeout(function(){a.html(t),s._trigger("load",i,r),l(n,e)},1)}).fail(function(t,e){setTimeout(function(){l(t,e)},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href").replace(/#.*$/,""),beforeSend:function(e,o){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:o},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),t.uiBackCompat!==!1&&t.widget("ui.tabs",t.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}}),t.ui.tabs});;
!function(h,v,e,o){var m="lazyLoadXT",p="lazied",y="load error",t="lazy-hidden",C=e.documentElement||e.body,w={autoInit:!0,selector:"img[data-src]",blankImage:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",throttle:99,forceLoad:v.onscroll===o||!!v.operamini||!C.getBoundingClientRect,loadEvent:"pageshow",updateEvent:"load orientationchange resize scroll touchmove focus",forceEvent:"lazyloadall",oninit:{removeClass:"lazy"},onshow:{addClass:t},onload:{removeClass:t,addClass:"lazy-loaded"},onerror:{removeClass:t},checkDuplicates:!0},n={srcAttr:"data-src",edgeX:0,edgeY:0,visibleOnly:!0},a=h(v),z=h.isFunction,c=h.extend,E=h.data||function(e,t){return h(e).data(t)},b=[],I=0,i=0;function d(e,t){return(e[t]===o?w:e)[t]}function T(){var e=v.pageYOffset;return e===o?C.scrollTop:e}function B(e,t){var o=w["on"+e];o&&(z(o)?o.call(t[0]):(o.addClass&&t.addClass(o.addClass),o.removeClass&&t.removeClass(o.removeClass))),t.trigger("lazy"+e,[t]),u()}function L(e){B(e.type,h(this).off(y,L))}function l(e){if(b.length){e=e||w.forceLoad,I=1/0;for(var t=T(),o=v.innerHeight||C.clientHeight,n=v.innerWidth||C.clientWidth,a=0,i=b.length;a<i;a++){var l,r,s,c,d=b[a],u=d[0],f=d[m],A=!1,g=e||E(u,p)<0;h.contains(C,u)?(e||!f.visibleOnly||u.offsetWidth||u.offsetHeight)&&(g||(l=u.getBoundingClientRect(),r=f.edgeX,s=f.edgeY,g=(c=l.top+t-s-o)<=t&&l.bottom>-s&&l.left<=n+r&&l.right>-r),g?(d.on(y,L),B("show",d),f=f.srcAttr,(f=z(f)?f(d):u.getAttribute(f))&&(u.src=f),A=!0):c<I&&(I=c)):A=!0,A&&(E(u,p,0),b.splice(a--,1),i--)}i||B("complete",h(C))}}function r(){1<i?(i=1,l(),setTimeout(r,w.throttle)):i=0}function u(e){b.length&&(e&&"scroll"===e.type&&e.currentTarget===v&&I>=T()||(i||setTimeout(r,0),i=2))}function s(){a.lazyLoadXT()}function f(){l(!0)}h[m]=c(w,n,h[m]),h.fn[m]=function(a){var e,i=d(a=a||{},"blankImage"),l=d(a,"checkDuplicates"),t=d(a,"scrollContainer"),r=d(a,"show"),s={};for(e in h(t).on("scroll",u),n)s[e]=d(a,e);return this.each(function(e,t){var o,n;t===v?h(w.selector).lazyLoadXT(a):(o=l&&E(t,p),n=h(t).data(p,r?-1:1),o||(i&&"IMG"===t.tagName&&!t.src&&(t.src=i),n[m]=c({},s),B("init",n),b.push(n)),u())})},h(e).ready(function(){B("start",a),a.on(w.updateEvent,u).on(w.forceEvent,f),h(e).on(w.updateEvent,u),w.autoInit&&(a.on(w.loadEvent,s),s())})}(window.jQuery||window.Zepto||window.$,window,document);;
/* Lazy Load XT 1.1.0 | MIT License */
!function(a,b,c,d){function e(b,c){return Math[c].apply(null,a.map(b,function(a){return a[i]}))}function f(a){return a[i]>=t[i]||a[i]===j}function g(a){return a[i]===j}function h(d){var h=d.attr(k.srcsetAttr);if(!h)return!1;var l=a.map(h.replace(/(\s[\d.]+[whx]),/g,"$1 @,@ ").split(" @,@ "),function(a){return{url:m.exec(a)[1],w:parseFloat((n.exec(a)||q)[1]),h:parseFloat((o.exec(a)||q)[1]),x:parseFloat((p.exec(a)||r)[1])}});if(!l.length)return!1;var s,u,v=c.documentElement;t={w:b.innerWidth||v.clientWidth,h:b.innerHeight||v.clientHeight,x:b.devicePixelRatio||1};for(s in t)i=s,j=e(l,"max"),l=a.grep(l,f);for(s in t)i=s,j=e(l,"min"),l=a.grep(l,g);return u=l[0].url,k.srcsetExtended&&(u=(d.attr(k.srcsetBaseAttr)||"")+u+(d.attr(k.srcsetExtAttr)||"")),u}var i,j,k=a.lazyLoadXT,l=function(){return"srcset"in new Image}(),m=/^\s*(\S*)/,n=/\S\s+(\d+)w/,o=/\S\s+(\d+)h/,p=/\S\s+([\d\.]+)x/,q=[0,1/0],r=[0,1],s={srcsetAttr:"data-srcset",srcsetExtended:!0,srcsetBaseAttr:"data-srcset-base",srcsetExtAttr:"data-srcset-ext"},t={w:0,h:0,x:0};for(i in s)k[i]===d&&(k[i]=s[i]);k.selector+=",img["+k.srcsetAttr+"]",a(c).on("lazyshow","img",function(a,b){var c=b.attr(k.srcsetAttr);c&&(!k.srcsetExtended&&l?b.attr("srcset",c):b.lazyLoadXT.srcAttr=h)})}(window.jQuery||window.Zepto||window.$,window,document);;
/**
 *  JQuery Idle.
 *  A dead simple jQuery plugin that executes a callback function if the user is idle.
 *  About: Author
 *  Henrique Boaventura (hboaventura@gmail.com).
 *  About: Version
 *  1.2.7
 **/
!function(n){"use strict";n.fn.idle=function(e){var t,i,o={idle:6e4,events:"mousemove keydown mousedown touchstart",onIdle:function(){},onActive:function(){},onHide:function(){},onShow:function(){},keepTracking:!0,startAtIdle:!1,recurIdleCall:!1},c=e.startAtIdle||!1,d=!e.startAtIdle||!0,l=n.extend({},o,e),u=null;return n(this).on("idle:stop",{},function(){n(this).off(l.events),l.keepTracking=!1,t(u,l)}),t=function(n,e){return c&&(c=!1,e.onActive.call()),clearTimeout(n),e.keepTracking?i(e):void 0},i=function(n){var e,t=n.recurIdleCall?setInterval:setTimeout;return e=t(function(){c=!0,n.onIdle.call()},n.idle)},this.each(function(){u=i(l),n(this).on(l.events,function(){u=t(u,l)}),(l.onShow||l.onHide)&&n(document).on("visibilitychange webkitvisibilitychange mozvisibilitychange msvisibilitychange",function(){document.hidden||document.webkitHidden||document.mozHidden||document.msHidden?d&&(d=!1,l.onHide.call()):d||(d=!0,l.onShow.call())})})}}(jQuery);;
/*
Masked Input plugin for jQuery
Copyright (c) 2007-2013 Josh Bush (digitalbush.com)
Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)
Version: 1.3.1
*/
(function (e) { function t() { var e = document.createElement("input"), t = "onpaste"; return e.setAttribute(t, ""), "function" == typeof e[t] ? "paste" : "input" } var n, a = t() + ".mask", r = navigator.userAgent, i = /iphone/i.test(r), o = /android/i.test(r); e.mask = { definitions: { 9: "[0-9]", a: "[A-Za-z]", "*": "[A-Za-z0-9]" }, dataName: "rawMaskFn", placeholder: "_" }, e.fn.extend({ caret: function (e, t) { var n; if (0 !== this.length && !this.is(":hidden")) return "number" == typeof e ? (t = "number" == typeof t ? t : e, this.each(function () { this.setSelectionRange ? this.setSelectionRange(e, t) : this.createTextRange && (n = this.createTextRange(), n.collapse(!0), n.moveEnd("character", t), n.moveStart("character", e), n.select()) })) : (this[0].setSelectionRange ? (e = this[0].selectionStart, t = this[0].selectionEnd) : document.selection && document.selection.createRange && (n = document.selection.createRange(), e = 0 - n.duplicate().moveStart("character", -1e5), t = e + n.text.length), { begin: e, end: t }) }, unmask: function () { return this.trigger("unmask") }, mask: function (t, r) { var c, l, s, u, f, h; return !t && this.length > 0 ? (c = e(this[0]), c.data(e.mask.dataName)()) : (r = e.extend({ placeholder: e.mask.placeholder, completed: null }, r), l = e.mask.definitions, s = [], u = h = t.length, f = null, e.each(t.split(""), function (e, t) { "?" == t ? (h--, u = e) : l[t] ? (s.push(RegExp(l[t])), null === f && (f = s.length - 1)) : s.push(null) }), this.trigger("unmask").each(function () { function c(e) { for (; h > ++e && !s[e]; ); return e } function d(e) { for (; --e >= 0 && !s[e]; ); return e } function m(e, t) { var n, a; if (!(0 > e)) { for (n = e, a = c(t); h > n; n++) if (s[n]) { if (!(h > a && s[n].test(R[a]))) break; R[n] = R[a], R[a] = r.placeholder, a = c(a) } b(), x.caret(Math.max(f, e)) } } function p(e) { var t, n, a, i; for (t = e, n = r.placeholder; h > t; t++) if (s[t]) { if (a = c(t), i = R[t], R[t] = n, !(h > a && s[a].test(i))) break; n = i } } function g(e) { var t, n, a, r = e.which; 8 === r || 46 === r || i && 127 === r ? (t = x.caret(), n = t.begin, a = t.end, 0 === a - n && (n = 46 !== r ? d(n) : a = c(n - 1), a = 46 === r ? c(a) : a), k(n, a), m(n, a - 1), e.preventDefault()) : 27 == r && (x.val(S), x.caret(0, y()), e.preventDefault()) } function v(t) { var n, a, i, l = t.which, u = x.caret(); t.ctrlKey || t.altKey || t.metaKey || 32 > l || l && (0 !== u.end - u.begin && (k(u.begin, u.end), m(u.begin, u.end - 1)), n = c(u.begin - 1), h > n && (a = String.fromCharCode(l), s[n].test(a) && (p(n), R[n] = a, b(), i = c(n), o ? setTimeout(e.proxy(e.fn.caret, x, i), 0) : x.caret(i), r.completed && i >= h && r.completed.call(x))), t.preventDefault()) } function k(e, t) { var n; for (n = e; t > n && h > n; n++) s[n] && (R[n] = r.placeholder) } function b() { x.val(R.join("")) } function y(e) { var t, n, a = x.val(), i = -1; for (t = 0, pos = 0; h > t; t++) if (s[t]) { for (R[t] = r.placeholder; pos++ < a.length; ) if (n = a.charAt(pos - 1), s[t].test(n)) { R[t] = n, i = t; break } if (pos > a.length) break } else R[t] === a.charAt(pos) && t !== u && (pos++, i = t); return e ? b() : u > i + 1 ? (x.val(""), k(0, h)) : (b(), x.val(x.val().substring(0, i + 1))), u ? t : f } var x = e(this), R = e.map(t.split(""), function (e) { return "?" != e ? l[e] ? r.placeholder : e : void 0 }), S = x.val(); x.data(e.mask.dataName, function () { return e.map(R, function (e, t) { return s[t] && e != r.placeholder ? e : null }).join("") }), x.attr("readonly") || x.one("unmask", function () { x.unbind(".mask").removeData(e.mask.dataName) }).bind("focus.mask", function () { clearTimeout(n); var e; S = x.val(), e = y(), n = setTimeout(function () { b(), e == t.length ? x.caret(0, e) : x.caret(e) }, 10) }).bind("blur.mask", function () { y(), x.val() != S && x.change() }).bind("keydown.mask", g).bind("keypress.mask", v).bind(a, function () { setTimeout(function () { var e = y(!0); x.caret(e), r.completed && e == x.val().length && r.completed.call(x) }, 0) }), y() })) } }) })(jQuery);;
/*! modernizr 3.3.1 (Custom Build) | MIT *
 * http://modernizr.com/download/?-flash-flexbox-setclasses !*/
!function(e,n,t){function o(e,n){return typeof e===n}function i(){var e,n,t,i,r,s,a;for(var l in C)if(C.hasOwnProperty(l)){if(e=[],n=C[l],n.name&&(e.push(n.name.toLowerCase()),n.options&&n.options.aliases&&n.options.aliases.length))for(t=0;t<n.options.aliases.length;t++)e.push(n.options.aliases[t].toLowerCase());for(i=o(n.fn,"function")?n.fn():n.fn,r=0;r<e.length;r++)s=e[r],a=s.split("."),1===a.length?Modernizr[a[0]]=i:(!Modernizr[a[0]]||Modernizr[a[0]]instanceof Boolean||(Modernizr[a[0]]=new Boolean(Modernizr[a[0]])),Modernizr[a[0]][a[1]]=i),w.push((i?"":"no-")+a.join("-"))}}function r(e){var n=x.className,t=Modernizr._config.classPrefix||"";if(S&&(n=n.baseVal),Modernizr._config.enableJSClass){var o=new RegExp("(^|\\s)"+t+"no-js(\\s|$)");n=n.replace(o,"$1"+t+"js$2")}Modernizr._config.enableClasses&&(n+=" "+t+e.join(" "+t),S?x.className.baseVal=n:x.className=n)}function s(){return"function"!=typeof n.createElement?n.createElement(arguments[0]):S?n.createElementNS.call(n,"http://www.w3.org/2000/svg",arguments[0]):n.createElement.apply(n,arguments)}function a(){var e=n.body;return e||(e=s(S?"svg":"body"),e.fake=!0),e}function l(e,n){if("object"==typeof e)for(var t in e)b(e,t)&&l(t,e[t]);else{e=e.toLowerCase();var o=e.split("."),i=Modernizr[o[0]];if(2==o.length&&(i=i[o[1]]),"undefined"!=typeof i)return Modernizr;n="function"==typeof n?n():n,1==o.length?Modernizr[o[0]]=n:(!Modernizr[o[0]]||Modernizr[o[0]]instanceof Boolean||(Modernizr[o[0]]=new Boolean(Modernizr[o[0]])),Modernizr[o[0]][o[1]]=n),r([(n&&0!=n?"":"no-")+o.join("-")]),Modernizr._trigger(e,n)}return Modernizr}function f(e){return e.replace(/([a-z])-([a-z])/g,function(e,n,t){return n+t.toUpperCase()}).replace(/^-/,"")}function u(e,n){return!!~(""+e).indexOf(n)}function c(e,n){return function(){return e.apply(n,arguments)}}function d(e,n,t){var i;for(var r in e)if(e[r]in n)return t===!1?e[r]:(i=n[e[r]],o(i,"function")?c(i,t||n):i);return!1}function p(e,t,o,i){var r,l,f,u,c="modernizr",d=s("div"),p=a();if(parseInt(o,10))for(;o--;)f=s("div"),f.id=i?i[o]:c+(o+1),d.appendChild(f);return r=s("style"),r.type="text/css",r.id="s"+c,(p.fake?p:d).appendChild(r),p.appendChild(d),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(n.createTextNode(e)),d.id=c,p.fake&&(p.style.background="",p.style.overflow="hidden",u=x.style.overflow,x.style.overflow="hidden",x.appendChild(p)),l=t(d,e),p.fake?(p.parentNode.removeChild(p),x.style.overflow=u,x.offsetHeight):d.parentNode.removeChild(d),!!l}function h(e){return e.replace(/([A-Z])/g,function(e,n){return"-"+n.toLowerCase()}).replace(/^ms-/,"-ms-")}function v(n,o){var i=n.length;if("CSS"in e&&"supports"in e.CSS){for(;i--;)if(e.CSS.supports(h(n[i]),o))return!0;return!1}if("CSSSupportsRule"in e){for(var r=[];i--;)r.push("("+h(n[i])+":"+o+")");return r=r.join(" or "),p("@supports ("+r+") { #modernizr { position: absolute; } }",function(e){return"absolute"==getComputedStyle(e,null).position})}return t}function m(e,n,i,r){function a(){c&&(delete j.style,delete j.modElem)}if(r=o(r,"undefined")?!1:r,!o(i,"undefined")){var l=v(e,i);if(!o(l,"undefined"))return l}for(var c,d,p,h,m,y=["modernizr","tspan"];!j.style;)c=!0,j.modElem=s(y.shift()),j.style=j.modElem.style;for(p=e.length,d=0;p>d;d++)if(h=e[d],m=j.style[h],u(h,"-")&&(h=f(h)),j.style[h]!==t){if(r||o(i,"undefined"))return a(),"pfx"==n?h:!0;try{j.style[h]=i}catch(g){}if(j.style[h]!=m)return a(),"pfx"==n?h:!0}return a(),!1}function y(e,n,t,i,r){var s=e.charAt(0).toUpperCase()+e.slice(1),a=(e+" "+T.join(s+" ")+s).split(" ");return o(n,"string")||o(n,"undefined")?m(a,n,i,r):(a=(e+" "+P.join(s+" ")+s).split(" "),d(a,n,t))}function g(e,n,o){return y(e,t,t,n,o)}var w=[],C=[],_={_version:"3.3.1",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,n){var t=this;setTimeout(function(){n(t[e])},0)},addTest:function(e,n,t){C.push({name:e,fn:n,options:t})},addAsyncTest:function(e){C.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=_,Modernizr=new Modernizr;var b,x=n.documentElement,S="svg"===x.nodeName.toLowerCase();!function(){var e={}.hasOwnProperty;b=o(e,"undefined")||o(e.call,"undefined")?function(e,n){return n in e&&o(e.constructor.prototype[n],"undefined")}:function(n,t){return e.call(n,t)}}(),_._l={},_.on=function(e,n){this._l[e]||(this._l[e]=[]),this._l[e].push(n),Modernizr.hasOwnProperty(e)&&setTimeout(function(){Modernizr._trigger(e,Modernizr[e])},0)},_._trigger=function(e,n){if(this._l[e]){var t=this._l[e];setTimeout(function(){var e,o;for(e=0;e<t.length;e++)(o=t[e])(n)},0),delete this._l[e]}},Modernizr._q.push(function(){_.addTest=l}),Modernizr.addAsyncTest(function(){var t,o,i=function(e){x.contains(e)||x.appendChild(e)},r=function(e){e.fake&&e.parentNode&&e.parentNode.removeChild(e)},f=function(e,n){var t=!!e;if(t&&(t=new Boolean(t),t.blocked="blocked"===e),l("flash",function(){return t}),n&&h.contains(n)){for(;n.parentNode!==h;)n=n.parentNode;h.removeChild(n)}};try{o="ActiveXObject"in e&&"Pan"in new e.ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(u){}if(t=!("plugins"in navigator&&"Shockwave Flash"in navigator.plugins||o),t||S)f(!1);else{var c,d,p=s("embed"),h=a();if(p.type="application/x-shockwave-flash",h.appendChild(p),!("Pan"in p||o))return i(h),f("blocked",p),void r(h);c=function(){return i(h),x.contains(h)?(x.contains(p)?(d=p.style.cssText,""!==d?f("blocked",p):f(!0,p)):f("blocked"),void r(h)):(h=n.body||h,p=s("embed"),p.type="application/x-shockwave-flash",h.appendChild(p),setTimeout(c,1e3))},setTimeout(c,10)}});var k="Moz O ms Webkit",T=_._config.usePrefixes?k.split(" "):[];_._cssomPrefixes=T;var P=_._config.usePrefixes?k.toLowerCase().split(" "):[];_._domPrefixes=P;var N={elem:s("modernizr")};Modernizr._q.push(function(){delete N.elem});var j={style:N.elem.style};Modernizr._q.unshift(function(){delete j.style}),_.testAllProps=y,_.testAllProps=g,Modernizr.addTest("flexbox",g("flexBasis","1px",!0)),i(),r(w),delete _.addTest,delete _.addAsyncTest;for(var E=0;E<Modernizr._q.length;E++)Modernizr._q[E]();e.Modernizr=Modernizr}(window,document);;
/*
     _ _      _       _
 ___| (_) ___| | __  (_)___
/ __| | |/ __| |/ /  | / __|
\__ \ | | (__|   < _ | \__ \
|___/_|_|\___|_|\_(_)/ |___/
                   |__/

 Version: 1.6.0
  Author: Ken Wheeler
 Website: http://kenwheeler.github.io
    Docs: http://kenwheeler.github.io/slick
    Repo: http://github.com/kenwheeler/slick
  Issues: http://github.com/kenwheeler/slick/issues

 */
!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"undefined"!=typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){"use strict";var b=window.Slick||{};b=function(){function c(c,d){var f,e=this;e.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:a(c),appendDots:a(c),arrows:!0,asNavFor:null,prevArrow:'<button type="button" data-role="none" class="slick-prev" aria-label="Previous" tabindex="0" role="button">Previous</button>',nextArrow:'<button type="button" data-role="none" class="slick-next" aria-label="Next" tabindex="0" role="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(b,c){return a('<button type="button" data-role="none" role="button" tabindex="0" />').text(c+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},e.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},a.extend(e,e.initials),e.activeBreakpoint=null,e.animType=null,e.animProp=null,e.breakpoints=[],e.breakpointSettings=[],e.cssTransitions=!1,e.focussed=!1,e.interrupted=!1,e.hidden="hidden",e.paused=!0,e.positionProp=null,e.respondTo=null,e.rowCount=1,e.shouldClick=!0,e.$slider=a(c),e.$slidesCache=null,e.transformType=null,e.transitionType=null,e.visibilityChange="visibilitychange",e.windowWidth=0,e.windowTimer=null,f=a(c).data("slick")||{},e.options=a.extend({},e.defaults,d,f),e.currentSlide=e.options.initialSlide,e.originalSettings=e.options,"undefined"!=typeof document.mozHidden?(e.hidden="mozHidden",e.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e.autoPlay=a.proxy(e.autoPlay,e),e.autoPlayClear=a.proxy(e.autoPlayClear,e),e.autoPlayIterator=a.proxy(e.autoPlayIterator,e),e.changeSlide=a.proxy(e.changeSlide,e),e.clickHandler=a.proxy(e.clickHandler,e),e.selectHandler=a.proxy(e.selectHandler,e),e.setPosition=a.proxy(e.setPosition,e),e.swipeHandler=a.proxy(e.swipeHandler,e),e.dragHandler=a.proxy(e.dragHandler,e),e.keyHandler=a.proxy(e.keyHandler,e),e.instanceUid=b++,e.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,e.registerBreakpoints(),e.init(!0)}var b=0;return c}(),b.prototype.activateADA=function(){var a=this;a.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},b.prototype.addSlide=b.prototype.slickAdd=function(b,c,d){var e=this;if("boolean"==typeof c)d=c,c=null;else if(0>c||c>=e.slideCount)return!1;e.unload(),"number"==typeof c?0===c&&0===e.$slides.length?a(b).appendTo(e.$slideTrack):d?a(b).insertBefore(e.$slides.eq(c)):a(b).insertAfter(e.$slides.eq(c)):d===!0?a(b).prependTo(e.$slideTrack):a(b).appendTo(e.$slideTrack),e.$slides=e.$slideTrack.children(this.options.slide),e.$slideTrack.children(this.options.slide).detach(),e.$slideTrack.append(e.$slides),e.$slides.each(function(b,c){a(c).attr("data-slick-index",b)}),e.$slidesCache=e.$slides,e.reinit()},b.prototype.animateHeight=function(){var a=this;if(1===a.options.slidesToShow&&a.options.adaptiveHeight===!0&&a.options.vertical===!1){var b=a.$slides.eq(a.currentSlide).outerHeight(!0);a.$list.animate({height:b},a.options.speed)}},b.prototype.animateSlide=function(b,c){var d={},e=this;e.animateHeight(),e.options.rtl===!0&&e.options.vertical===!1&&(b=-b),e.transformsEnabled===!1?e.options.vertical===!1?e.$slideTrack.animate({left:b},e.options.speed,e.options.easing,c):e.$slideTrack.animate({top:b},e.options.speed,e.options.easing,c):e.cssTransitions===!1?(e.options.rtl===!0&&(e.currentLeft=-e.currentLeft),a({animStart:e.currentLeft}).animate({animStart:b},{duration:e.options.speed,easing:e.options.easing,step:function(a){a=Math.ceil(a),e.options.vertical===!1?(d[e.animType]="translate("+a+"px, 0px)",e.$slideTrack.css(d)):(d[e.animType]="translate(0px,"+a+"px)",e.$slideTrack.css(d))},complete:function(){c&&c.call()}})):(e.applyTransition(),b=Math.ceil(b),e.options.vertical===!1?d[e.animType]="translate3d("+b+"px, 0px, 0px)":d[e.animType]="translate3d(0px,"+b+"px, 0px)",e.$slideTrack.css(d),c&&setTimeout(function(){e.disableTransition(),c.call()},e.options.speed))},b.prototype.getNavTarget=function(){var b=this,c=b.options.asNavFor;return c&&null!==c&&(c=a(c).not(b.$slider)),c},b.prototype.asNavFor=function(b){var c=this,d=c.getNavTarget();null!==d&&"object"==typeof d&&d.each(function(){var c=a(this).slick("getSlick");c.unslicked||c.slideHandler(b,!0)})},b.prototype.applyTransition=function(a){var b=this,c={};b.options.fade===!1?c[b.transitionType]=b.transformType+" "+b.options.speed+"ms "+b.options.cssEase:c[b.transitionType]="opacity "+b.options.speed+"ms "+b.options.cssEase,b.options.fade===!1?b.$slideTrack.css(c):b.$slides.eq(a).css(c)},b.prototype.autoPlay=function(){var a=this;a.autoPlayClear(),a.slideCount>a.options.slidesToShow&&(a.autoPlayTimer=setInterval(a.autoPlayIterator,a.options.autoplaySpeed))},b.prototype.autoPlayClear=function(){var a=this;a.autoPlayTimer&&clearInterval(a.autoPlayTimer)},b.prototype.autoPlayIterator=function(){var a=this,b=a.currentSlide+a.options.slidesToScroll;a.paused||a.interrupted||a.focussed||(a.options.infinite===!1&&(1===a.direction&&a.currentSlide+1===a.slideCount-1?a.direction=0:0===a.direction&&(b=a.currentSlide-a.options.slidesToScroll,a.currentSlide-1===0&&(a.direction=1))),a.slideHandler(b))},b.prototype.buildArrows=function(){var b=this;b.options.arrows===!0&&(b.$prevArrow=a(b.options.prevArrow).addClass("slick-arrow"),b.$nextArrow=a(b.options.nextArrow).addClass("slick-arrow"),b.slideCount>b.options.slidesToShow?(b.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),b.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),b.htmlExpr.test(b.options.prevArrow)&&b.$prevArrow.prependTo(b.options.appendArrows),b.htmlExpr.test(b.options.nextArrow)&&b.$nextArrow.appendTo(b.options.appendArrows),b.options.infinite!==!0&&b.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):b.$prevArrow.add(b.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},b.prototype.buildDots=function(){var c,d,b=this;if(b.options.dots===!0&&b.slideCount>b.options.slidesToShow){for(b.$slider.addClass("slick-dotted"),d=a("<ul />").addClass(b.options.dotsClass),c=0;c<=b.getDotCount();c+=1)d.append(a("<li />").append(b.options.customPaging.call(this,b,c)));b.$dots=d.appendTo(b.options.appendDots),b.$dots.find("li").first().addClass("slick-active").attr("aria-hidden","false")}},b.prototype.buildOut=function(){var b=this;b.$slides=b.$slider.children(b.options.slide+":not(.slick-cloned)").addClass("slick-slide"),b.slideCount=b.$slides.length,b.$slides.each(function(b,c){a(c).attr("data-slick-index",b).data("originalStyling",a(c).attr("style")||"")}),b.$slider.addClass("slick-slider"),b.$slideTrack=0===b.slideCount?a('<div class="slick-track"/>').appendTo(b.$slider):b.$slides.wrapAll('<div class="slick-track"/>').parent(),b.$list=b.$slideTrack.wrap('<div aria-live="polite" class="slick-list"/>').parent(),b.$slideTrack.css("opacity",0),(b.options.centerMode===!0||b.options.swipeToSlide===!0)&&(b.options.slidesToScroll=1),a("img[data-lazy]",b.$slider).not("[src]").addClass("slick-loading"),b.setupInfinite(),b.buildArrows(),b.buildDots(),b.updateDots(),b.setSlideClasses("number"==typeof b.currentSlide?b.currentSlide:0),b.options.draggable===!0&&b.$list.addClass("draggable")},b.prototype.buildRows=function(){var b,c,d,e,f,g,h,a=this;if(e=document.createDocumentFragment(),g=a.$slider.children(),a.options.rows>1){for(h=a.options.slidesPerRow*a.options.rows,f=Math.ceil(g.length/h),b=0;f>b;b++){var i=document.createElement("div");for(c=0;c<a.options.rows;c++){var j=document.createElement("div");for(d=0;d<a.options.slidesPerRow;d++){var k=b*h+(c*a.options.slidesPerRow+d);g.get(k)&&j.appendChild(g.get(k))}i.appendChild(j)}e.appendChild(i)}a.$slider.empty().append(e),a.$slider.children().children().children().css({width:100/a.options.slidesPerRow+"%",display:"inline-block"})}},b.prototype.checkResponsive=function(b,c){var e,f,g,d=this,h=!1,i=d.$slider.width(),j=window.innerWidth||a(window).width();if("window"===d.respondTo?g=j:"slider"===d.respondTo?g=i:"min"===d.respondTo&&(g=Math.min(j,i)),d.options.responsive&&d.options.responsive.length&&null!==d.options.responsive){f=null;for(e in d.breakpoints)d.breakpoints.hasOwnProperty(e)&&(d.originalSettings.mobileFirst===!1?g<d.breakpoints[e]&&(f=d.breakpoints[e]):g>d.breakpoints[e]&&(f=d.breakpoints[e]));null!==f?null!==d.activeBreakpoint?(f!==d.activeBreakpoint||c)&&(d.activeBreakpoint=f,"unslick"===d.breakpointSettings[f]?d.unslick(f):(d.options=a.extend({},d.originalSettings,d.breakpointSettings[f]),b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b)),h=f):(d.activeBreakpoint=f,"unslick"===d.breakpointSettings[f]?d.unslick(f):(d.options=a.extend({},d.originalSettings,d.breakpointSettings[f]),b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b)),h=f):null!==d.activeBreakpoint&&(d.activeBreakpoint=null,d.options=d.originalSettings,b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b),h=f),b||h===!1||d.$slider.trigger("breakpoint",[d,h])}},b.prototype.changeSlide=function(b,c){var f,g,h,d=this,e=a(b.currentTarget);switch(e.is("a")&&b.preventDefault(),e.is("li")||(e=e.closest("li")),h=d.slideCount%d.options.slidesToScroll!==0,f=h?0:(d.slideCount-d.currentSlide)%d.options.slidesToScroll,b.data.message){case"previous":g=0===f?d.options.slidesToScroll:d.options.slidesToShow-f,d.slideCount>d.options.slidesToShow&&d.slideHandler(d.currentSlide-g,!1,c);break;case"next":g=0===f?d.options.slidesToScroll:f,d.slideCount>d.options.slidesToShow&&d.slideHandler(d.currentSlide+g,!1,c);break;case"index":var i=0===b.data.index?0:b.data.index||e.index()*d.options.slidesToScroll;d.slideHandler(d.checkNavigable(i),!1,c),e.children().trigger("focus");break;default:return}},b.prototype.checkNavigable=function(a){var c,d,b=this;if(c=b.getNavigableIndexes(),d=0,a>c[c.length-1])a=c[c.length-1];else for(var e in c){if(a<c[e]){a=d;break}d=c[e]}return a},b.prototype.cleanUpEvents=function(){var b=this;b.options.dots&&null!==b.$dots&&a("li",b.$dots).off("click.slick",b.changeSlide).off("mouseenter.slick",a.proxy(b.interrupt,b,!0)).off("mouseleave.slick",a.proxy(b.interrupt,b,!1)),b.$slider.off("focus.slick blur.slick"),b.options.arrows===!0&&b.slideCount>b.options.slidesToShow&&(b.$prevArrow&&b.$prevArrow.off("click.slick",b.changeSlide),b.$nextArrow&&b.$nextArrow.off("click.slick",b.changeSlide)),b.$list.off("touchstart.slick mousedown.slick",b.swipeHandler),b.$list.off("touchmove.slick mousemove.slick",b.swipeHandler),b.$list.off("touchend.slick mouseup.slick",b.swipeHandler),b.$list.off("touchcancel.slick mouseleave.slick",b.swipeHandler),b.$list.off("click.slick",b.clickHandler),a(document).off(b.visibilityChange,b.visibility),b.cleanUpSlideEvents(),b.options.accessibility===!0&&b.$list.off("keydown.slick",b.keyHandler),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().off("click.slick",b.selectHandler),a(window).off("orientationchange.slick.slick-"+b.instanceUid,b.orientationChange),a(window).off("resize.slick.slick-"+b.instanceUid,b.resize),a("[draggable!=true]",b.$slideTrack).off("dragstart",b.preventDefault),a(window).off("load.slick.slick-"+b.instanceUid,b.setPosition),a(document).off("ready.slick.slick-"+b.instanceUid,b.setPosition)},b.prototype.cleanUpSlideEvents=function(){var b=this;b.$list.off("mouseenter.slick",a.proxy(b.interrupt,b,!0)),b.$list.off("mouseleave.slick",a.proxy(b.interrupt,b,!1))},b.prototype.cleanUpRows=function(){var b,a=this;a.options.rows>1&&(b=a.$slides.children().children(),b.removeAttr("style"),a.$slider.empty().append(b))},b.prototype.clickHandler=function(a){var b=this;b.shouldClick===!1&&(a.stopImmediatePropagation(),a.stopPropagation(),a.preventDefault())},b.prototype.destroy=function(b){var c=this;c.autoPlayClear(),c.touchObject={},c.cleanUpEvents(),a(".slick-cloned",c.$slider).detach(),c.$dots&&c.$dots.remove(),c.$prevArrow&&c.$prevArrow.length&&(c.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),c.htmlExpr.test(c.options.prevArrow)&&c.$prevArrow.remove()),c.$nextArrow&&c.$nextArrow.length&&(c.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),c.htmlExpr.test(c.options.nextArrow)&&c.$nextArrow.remove()),c.$slides&&(c.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){a(this).attr("style",a(this).data("originalStyling"))}),c.$slideTrack.children(this.options.slide).detach(),c.$slideTrack.detach(),c.$list.detach(),c.$slider.append(c.$slides)),c.cleanUpRows(),c.$slider.removeClass("slick-slider"),c.$slider.removeClass("slick-initialized"),c.$slider.removeClass("slick-dotted"),c.unslicked=!0,b||c.$slider.trigger("destroy",[c])},b.prototype.disableTransition=function(a){var b=this,c={};c[b.transitionType]="",b.options.fade===!1?b.$slideTrack.css(c):b.$slides.eq(a).css(c)},b.prototype.fadeSlide=function(a,b){var c=this;c.cssTransitions===!1?(c.$slides.eq(a).css({zIndex:c.options.zIndex}),c.$slides.eq(a).animate({opacity:1},c.options.speed,c.options.easing,b)):(c.applyTransition(a),c.$slides.eq(a).css({opacity:1,zIndex:c.options.zIndex}),b&&setTimeout(function(){c.disableTransition(a),b.call()},c.options.speed))},b.prototype.fadeSlideOut=function(a){var b=this;b.cssTransitions===!1?b.$slides.eq(a).animate({opacity:0,zIndex:b.options.zIndex-2},b.options.speed,b.options.easing):(b.applyTransition(a),b.$slides.eq(a).css({opacity:0,zIndex:b.options.zIndex-2}))},b.prototype.filterSlides=b.prototype.slickFilter=function(a){var b=this;null!==a&&(b.$slidesCache=b.$slides,b.unload(),b.$slideTrack.children(this.options.slide).detach(),b.$slidesCache.filter(a).appendTo(b.$slideTrack),b.reinit())},b.prototype.focusHandler=function(){var b=this;b.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick","*:not(.slick-arrow)",function(c){c.stopImmediatePropagation();var d=a(this);setTimeout(function(){b.options.pauseOnFocus&&(b.focussed=d.is(":focus"),b.autoPlay())},0)})},b.prototype.getCurrent=b.prototype.slickCurrentSlide=function(){var a=this;return a.currentSlide},b.prototype.getDotCount=function(){var a=this,b=0,c=0,d=0;if(a.options.infinite===!0)for(;b<a.slideCount;)++d,b=c+a.options.slidesToScroll,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;else if(a.options.centerMode===!0)d=a.slideCount;else if(a.options.asNavFor)for(;b<a.slideCount;)++d,b=c+a.options.slidesToScroll,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;else d=1+Math.ceil((a.slideCount-a.options.slidesToShow)/a.options.slidesToScroll);return d-1},b.prototype.getLeft=function(a){var c,d,f,b=this,e=0;return b.slideOffset=0,d=b.$slides.first().outerHeight(!0),b.options.infinite===!0?(b.slideCount>b.options.slidesToShow&&(b.slideOffset=b.slideWidth*b.options.slidesToShow*-1,e=d*b.options.slidesToShow*-1),b.slideCount%b.options.slidesToScroll!==0&&a+b.options.slidesToScroll>b.slideCount&&b.slideCount>b.options.slidesToShow&&(a>b.slideCount?(b.slideOffset=(b.options.slidesToShow-(a-b.slideCount))*b.slideWidth*-1,e=(b.options.slidesToShow-(a-b.slideCount))*d*-1):(b.slideOffset=b.slideCount%b.options.slidesToScroll*b.slideWidth*-1,e=b.slideCount%b.options.slidesToScroll*d*-1))):a+b.options.slidesToShow>b.slideCount&&(b.slideOffset=(a+b.options.slidesToShow-b.slideCount)*b.slideWidth,e=(a+b.options.slidesToShow-b.slideCount)*d),b.slideCount<=b.options.slidesToShow&&(b.slideOffset=0,e=0),b.options.centerMode===!0&&b.options.infinite===!0?b.slideOffset+=b.slideWidth*Math.floor(b.options.slidesToShow/2)-b.slideWidth:b.options.centerMode===!0&&(b.slideOffset=0,b.slideOffset+=b.slideWidth*Math.floor(b.options.slidesToShow/2)),c=b.options.vertical===!1?a*b.slideWidth*-1+b.slideOffset:a*d*-1+e,b.options.variableWidth===!0&&(f=b.slideCount<=b.options.slidesToShow||b.options.infinite===!1?b.$slideTrack.children(".slick-slide").eq(a):b.$slideTrack.children(".slick-slide").eq(a+b.options.slidesToShow),c=b.options.rtl===!0?f[0]?-1*(b.$slideTrack.width()-f[0].offsetLeft-f.width()):0:f[0]?-1*f[0].offsetLeft:0,b.options.centerMode===!0&&(f=b.slideCount<=b.options.slidesToShow||b.options.infinite===!1?b.$slideTrack.children(".slick-slide").eq(a):b.$slideTrack.children(".slick-slide").eq(a+b.options.slidesToShow+1),c=b.options.rtl===!0?f[0]?-1*(b.$slideTrack.width()-f[0].offsetLeft-f.width()):0:f[0]?-1*f[0].offsetLeft:0,c+=(b.$list.width()-f.outerWidth())/2)),c},b.prototype.getOption=b.prototype.slickGetOption=function(a){var b=this;return b.options[a]},b.prototype.getNavigableIndexes=function(){var e,a=this,b=0,c=0,d=[];for(a.options.infinite===!1?e=a.slideCount:(b=-1*a.options.slidesToScroll,c=-1*a.options.slidesToScroll,e=2*a.slideCount);e>b;)d.push(b),b=c+a.options.slidesToScroll,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;return d},b.prototype.getSlick=function(){return this},b.prototype.getSlideCount=function(){var c,d,e,b=this;return e=b.options.centerMode===!0?b.slideWidth*Math.floor(b.options.slidesToShow/2):0,b.options.swipeToSlide===!0?(b.$slideTrack.find(".slick-slide").each(function(c,f){return f.offsetLeft-e+a(f).outerWidth()/2>-1*b.swipeLeft?(d=f,!1):void 0}),c=Math.abs(a(d).attr("data-slick-index")-b.currentSlide)||1):b.options.slidesToScroll},b.prototype.goTo=b.prototype.slickGoTo=function(a,b){var c=this;c.changeSlide({data:{message:"index",index:parseInt(a)}},b)},b.prototype.init=function(b){var c=this;a(c.$slider).hasClass("slick-initialized")||(a(c.$slider).addClass("slick-initialized"),c.buildRows(),c.buildOut(),c.setProps(),c.startLoad(),c.loadSlider(),c.initializeEvents(),c.updateArrows(),c.updateDots(),c.checkResponsive(!0),c.focusHandler()),b&&c.$slider.trigger("init",[c]),c.options.accessibility===!0&&c.initADA(),c.options.autoplay&&(c.paused=!1,c.autoPlay())},b.prototype.initADA=function(){var b=this;b.$slides.add(b.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),b.$slideTrack.attr("role","listbox"),b.$slides.not(b.$slideTrack.find(".slick-cloned")).each(function(c){a(this).attr({role:"option","aria-describedby":"slick-slide"+b.instanceUid+c})}),null!==b.$dots&&b.$dots.attr("role","tablist").find("li").each(function(c){a(this).attr({role:"presentation","aria-selected":"false","aria-controls":"navigation"+b.instanceUid+c,id:"slick-slide"+b.instanceUid+c})}).first().attr("aria-selected","true").end().find("button").attr("role","button").end().closest("div").attr("role","toolbar"),b.activateADA()},b.prototype.initArrowEvents=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},a.changeSlide),a.$nextArrow.off("click.slick").on("click.slick",{message:"next"},a.changeSlide))},b.prototype.initDotEvents=function(){var b=this;b.options.dots===!0&&b.slideCount>b.options.slidesToShow&&a("li",b.$dots).on("click.slick",{message:"index"},b.changeSlide),b.options.dots===!0&&b.options.pauseOnDotsHover===!0&&a("li",b.$dots).on("mouseenter.slick",a.proxy(b.interrupt,b,!0)).on("mouseleave.slick",a.proxy(b.interrupt,b,!1))},b.prototype.initSlideEvents=function(){var b=this;b.options.pauseOnHover&&(b.$list.on("mouseenter.slick",a.proxy(b.interrupt,b,!0)),b.$list.on("mouseleave.slick",a.proxy(b.interrupt,b,!1)))},b.prototype.initializeEvents=function(){var b=this;b.initArrowEvents(),b.initDotEvents(),b.initSlideEvents(),b.$list.on("touchstart.slick mousedown.slick",{action:"start"},b.swipeHandler),b.$list.on("touchmove.slick mousemove.slick",{action:"move"},b.swipeHandler),b.$list.on("touchend.slick mouseup.slick",{action:"end"},b.swipeHandler),b.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},b.swipeHandler),b.$list.on("click.slick",b.clickHandler),a(document).on(b.visibilityChange,a.proxy(b.visibility,b)),b.options.accessibility===!0&&b.$list.on("keydown.slick",b.keyHandler),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().on("click.slick",b.selectHandler),a(window).on("orientationchange.slick.slick-"+b.instanceUid,a.proxy(b.orientationChange,b)),a(window).on("resize.slick.slick-"+b.instanceUid,a.proxy(b.resize,b)),a("[draggable!=true]",b.$slideTrack).on("dragstart",b.preventDefault),a(window).on("load.slick.slick-"+b.instanceUid,b.setPosition),a(document).on("ready.slick.slick-"+b.instanceUid,b.setPosition)},b.prototype.initUI=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.show(),a.$nextArrow.show()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.$dots.show()},b.prototype.keyHandler=function(a){var b=this;a.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===a.keyCode&&b.options.accessibility===!0?b.changeSlide({data:{message:b.options.rtl===!0?"next":"previous"}}):39===a.keyCode&&b.options.accessibility===!0&&b.changeSlide({data:{message:b.options.rtl===!0?"previous":"next"}}))},b.prototype.lazyLoad=function(){function g(c){a("img[data-lazy]",c).each(function(){var c=a(this),d=a(this).attr("data-lazy"),e=document.createElement("img");e.onload=function(){c.animate({opacity:0},100,function(){c.attr("src",d).animate({opacity:1},200,function(){c.removeAttr("data-lazy").removeClass("slick-loading")}),b.$slider.trigger("lazyLoaded",[b,c,d])})},e.onerror=function(){c.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),b.$slider.trigger("lazyLoadError",[b,c,d])},e.src=d})}var c,d,e,f,b=this;b.options.centerMode===!0?b.options.infinite===!0?(e=b.currentSlide+(b.options.slidesToShow/2+1),f=e+b.options.slidesToShow+2):(e=Math.max(0,b.currentSlide-(b.options.slidesToShow/2+1)),f=2+(b.options.slidesToShow/2+1)+b.currentSlide):(e=b.options.infinite?b.options.slidesToShow+b.currentSlide:b.currentSlide,f=Math.ceil(e+b.options.slidesToShow),b.options.fade===!0&&(e>0&&e--,f<=b.slideCount&&f++)),c=b.$slider.find(".slick-slide").slice(e,f),g(c),b.slideCount<=b.options.slidesToShow?(d=b.$slider.find(".slick-slide"),g(d)):b.currentSlide>=b.slideCount-b.options.slidesToShow?(d=b.$slider.find(".slick-cloned").slice(0,b.options.slidesToShow),g(d)):0===b.currentSlide&&(d=b.$slider.find(".slick-cloned").slice(-1*b.options.slidesToShow),g(d))},b.prototype.loadSlider=function(){var a=this;a.setPosition(),a.$slideTrack.css({opacity:1}),a.$slider.removeClass("slick-loading"),a.initUI(),"progressive"===a.options.lazyLoad&&a.progressiveLazyLoad()},b.prototype.next=b.prototype.slickNext=function(){var a=this;a.changeSlide({data:{message:"next"}})},b.prototype.orientationChange=function(){var a=this;a.checkResponsive(),a.setPosition()},b.prototype.pause=b.prototype.slickPause=function(){var a=this;a.autoPlayClear(),a.paused=!0},b.prototype.play=b.prototype.slickPlay=function(){var a=this;a.autoPlay(),a.options.autoplay=!0,a.paused=!1,a.focussed=!1,a.interrupted=!1},b.prototype.postSlide=function(a){var b=this;b.unslicked||(b.$slider.trigger("afterChange",[b,a]),b.animating=!1,b.setPosition(),b.swipeLeft=null,b.options.autoplay&&b.autoPlay(),b.options.accessibility===!0&&b.initADA())},b.prototype.prev=b.prototype.slickPrev=function(){var a=this;a.changeSlide({data:{message:"previous"}})},b.prototype.preventDefault=function(a){a.preventDefault()},b.prototype.progressiveLazyLoad=function(b){b=b||1;var e,f,g,c=this,d=a("img[data-lazy]",c.$slider);d.length?(e=d.first(),f=e.attr("data-lazy"),g=document.createElement("img"),g.onload=function(){e.attr("src",f).removeAttr("data-lazy").removeClass("slick-loading"),c.options.adaptiveHeight===!0&&c.setPosition(),c.$slider.trigger("lazyLoaded",[c,e,f]),c.progressiveLazyLoad()},g.onerror=function(){3>b?setTimeout(function(){c.progressiveLazyLoad(b+1)},500):(e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),c.$slider.trigger("lazyLoadError",[c,e,f]),c.progressiveLazyLoad())},g.src=f):c.$slider.trigger("allImagesLoaded",[c])},b.prototype.refresh=function(b){var d,e,c=this;e=c.slideCount-c.options.slidesToShow,!c.options.infinite&&c.currentSlide>e&&(c.currentSlide=e),c.slideCount<=c.options.slidesToShow&&(c.currentSlide=0),d=c.currentSlide,c.destroy(!0),a.extend(c,c.initials,{currentSlide:d}),c.init(),b||c.changeSlide({data:{message:"index",index:d}},!1)},b.prototype.registerBreakpoints=function(){var c,d,e,b=this,f=b.options.responsive||null;if("array"===a.type(f)&&f.length){b.respondTo=b.options.respondTo||"window";for(c in f)if(e=b.breakpoints.length-1,d=f[c].breakpoint,f.hasOwnProperty(c)){for(;e>=0;)b.breakpoints[e]&&b.breakpoints[e]===d&&b.breakpoints.splice(e,1),e--;b.breakpoints.push(d),b.breakpointSettings[d]=f[c].settings}b.breakpoints.sort(function(a,c){return b.options.mobileFirst?a-c:c-a})}},b.prototype.reinit=function(){var b=this;b.$slides=b.$slideTrack.children(b.options.slide).addClass("slick-slide"),b.slideCount=b.$slides.length,b.currentSlide>=b.slideCount&&0!==b.currentSlide&&(b.currentSlide=b.currentSlide-b.options.slidesToScroll),b.slideCount<=b.options.slidesToShow&&(b.currentSlide=0),b.registerBreakpoints(),b.setProps(),b.setupInfinite(),b.buildArrows(),b.updateArrows(),b.initArrowEvents(),b.buildDots(),b.updateDots(),b.initDotEvents(),b.cleanUpSlideEvents(),b.initSlideEvents(),b.checkResponsive(!1,!0),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().on("click.slick",b.selectHandler),b.setSlideClasses("number"==typeof b.currentSlide?b.currentSlide:0),b.setPosition(),b.focusHandler(),b.paused=!b.options.autoplay,b.autoPlay(),b.$slider.trigger("reInit",[b])},b.prototype.resize=function(){var b=this;a(window).width()!==b.windowWidth&&(clearTimeout(b.windowDelay),b.windowDelay=window.setTimeout(function(){b.windowWidth=a(window).width(),b.checkResponsive(),b.unslicked||b.setPosition()},50))},b.prototype.removeSlide=b.prototype.slickRemove=function(a,b,c){var d=this;return"boolean"==typeof a?(b=a,a=b===!0?0:d.slideCount-1):a=b===!0?--a:a,d.slideCount<1||0>a||a>d.slideCount-1?!1:(d.unload(),c===!0?d.$slideTrack.children().remove():d.$slideTrack.children(this.options.slide).eq(a).remove(),d.$slides=d.$slideTrack.children(this.options.slide),d.$slideTrack.children(this.options.slide).detach(),d.$slideTrack.append(d.$slides),d.$slidesCache=d.$slides,void d.reinit())},b.prototype.setCSS=function(a){var d,e,b=this,c={};b.options.rtl===!0&&(a=-a),d="left"==b.positionProp?Math.ceil(a)+"px":"0px",e="top"==b.positionProp?Math.ceil(a)+"px":"0px",c[b.positionProp]=a,b.transformsEnabled===!1?b.$slideTrack.css(c):(c={},b.cssTransitions===!1?(c[b.animType]="translate("+d+", "+e+")",b.$slideTrack.css(c)):(c[b.animType]="translate3d("+d+", "+e+", 0px)",b.$slideTrack.css(c)))},b.prototype.setDimensions=function(){var a=this;a.options.vertical===!1?a.options.centerMode===!0&&a.$list.css({padding:"0px "+a.options.centerPadding}):(a.$list.height(a.$slides.first().outerHeight(!0)*a.options.slidesToShow),a.options.centerMode===!0&&a.$list.css({padding:a.options.centerPadding+" 0px"})),a.listWidth=a.$list.width(),a.listHeight=a.$list.height(),a.options.vertical===!1&&a.options.variableWidth===!1?(a.slideWidth=Math.ceil(a.listWidth/a.options.slidesToShow),a.$slideTrack.width(Math.ceil(a.slideWidth*a.$slideTrack.children(".slick-slide").length))):a.options.variableWidth===!0?a.$slideTrack.width(5e3*a.slideCount):(a.slideWidth=Math.ceil(a.listWidth),a.$slideTrack.height(Math.ceil(a.$slides.first().outerHeight(!0)*a.$slideTrack.children(".slick-slide").length)));var b=a.$slides.first().outerWidth(!0)-a.$slides.first().width();a.options.variableWidth===!1&&a.$slideTrack.children(".slick-slide").width(a.slideWidth-b)},b.prototype.setFade=function(){var c,b=this;b.$slides.each(function(d,e){c=b.slideWidth*d*-1,b.options.rtl===!0?a(e).css({position:"relative",right:c,top:0,zIndex:b.options.zIndex-2,opacity:0}):a(e).css({position:"relative",left:c,top:0,zIndex:b.options.zIndex-2,opacity:0})}),b.$slides.eq(b.currentSlide).css({zIndex:b.options.zIndex-1,opacity:1})},b.prototype.setHeight=function(){var a=this;if(1===a.options.slidesToShow&&a.options.adaptiveHeight===!0&&a.options.vertical===!1){var b=a.$slides.eq(a.currentSlide).outerHeight(!0);a.$list.css("height",b)}},b.prototype.setOption=b.prototype.slickSetOption=function(){var c,d,e,f,h,b=this,g=!1;if("object"===a.type(arguments[0])?(e=arguments[0],g=arguments[1],h="multiple"):"string"===a.type(arguments[0])&&(e=arguments[0],f=arguments[1],g=arguments[2],"responsive"===arguments[0]&&"array"===a.type(arguments[1])?h="responsive":"undefined"!=typeof arguments[1]&&(h="single")),"single"===h)b.options[e]=f;else if("multiple"===h)a.each(e,function(a,c){b.options[a]=c});else if("responsive"===h)for(d in f)if("array"!==a.type(b.options.responsive))b.options.responsive=[f[d]];else{for(c=b.options.responsive.length-1;c>=0;)b.options.responsive[c].breakpoint===f[d].breakpoint&&b.options.responsive.splice(c,1),c--;b.options.responsive.push(f[d])}g&&(b.unload(),b.reinit())},b.prototype.setPosition=function(){var a=this;a.setDimensions(),a.setHeight(),a.options.fade===!1?a.setCSS(a.getLeft(a.currentSlide)):a.setFade(),a.$slider.trigger("setPosition",[a])},b.prototype.setProps=function(){var a=this,b=document.body.style;a.positionProp=a.options.vertical===!0?"top":"left","top"===a.positionProp?a.$slider.addClass("slick-vertical"):a.$slider.removeClass("slick-vertical"),(void 0!==b.WebkitTransition||void 0!==b.MozTransition||void 0!==b.msTransition)&&a.options.useCSS===!0&&(a.cssTransitions=!0),a.options.fade&&("number"==typeof a.options.zIndex?a.options.zIndex<3&&(a.options.zIndex=3):a.options.zIndex=a.defaults.zIndex),void 0!==b.OTransform&&(a.animType="OTransform",a.transformType="-o-transform",a.transitionType="OTransition",void 0===b.perspectiveProperty&&void 0===b.webkitPerspective&&(a.animType=!1)),void 0!==b.MozTransform&&(a.animType="MozTransform",a.transformType="-moz-transform",a.transitionType="MozTransition",void 0===b.perspectiveProperty&&void 0===b.MozPerspective&&(a.animType=!1)),void 0!==b.webkitTransform&&(a.animType="webkitTransform",a.transformType="-webkit-transform",a.transitionType="webkitTransition",void 0===b.perspectiveProperty&&void 0===b.webkitPerspective&&(a.animType=!1)),void 0!==b.msTransform&&(a.animType="msTransform",a.transformType="-ms-transform",a.transitionType="msTransition",void 0===b.msTransform&&(a.animType=!1)),void 0!==b.transform&&a.animType!==!1&&(a.animType="transform",a.transformType="transform",a.transitionType="transition"),a.transformsEnabled=a.options.useTransform&&null!==a.animType&&a.animType!==!1},b.prototype.setSlideClasses=function(a){var c,d,e,f,b=this;d=b.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),b.$slides.eq(a).addClass("slick-current"),b.options.centerMode===!0?(c=Math.floor(b.options.slidesToShow/2),b.options.infinite===!0&&(a>=c&&a<=b.slideCount-1-c?b.$slides.slice(a-c,a+c+1).addClass("slick-active").attr("aria-hidden","false"):(e=b.options.slidesToShow+a,
d.slice(e-c+1,e+c+2).addClass("slick-active").attr("aria-hidden","false")),0===a?d.eq(d.length-1-b.options.slidesToShow).addClass("slick-center"):a===b.slideCount-1&&d.eq(b.options.slidesToShow).addClass("slick-center")),b.$slides.eq(a).addClass("slick-center")):a>=0&&a<=b.slideCount-b.options.slidesToShow?b.$slides.slice(a,a+b.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):d.length<=b.options.slidesToShow?d.addClass("slick-active").attr("aria-hidden","false"):(f=b.slideCount%b.options.slidesToShow,e=b.options.infinite===!0?b.options.slidesToShow+a:a,b.options.slidesToShow==b.options.slidesToScroll&&b.slideCount-a<b.options.slidesToShow?d.slice(e-(b.options.slidesToShow-f),e+f).addClass("slick-active").attr("aria-hidden","false"):d.slice(e,e+b.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false")),"ondemand"===b.options.lazyLoad&&b.lazyLoad()},b.prototype.setupInfinite=function(){var c,d,e,b=this;if(b.options.fade===!0&&(b.options.centerMode=!1),b.options.infinite===!0&&b.options.fade===!1&&(d=null,b.slideCount>b.options.slidesToShow)){for(e=b.options.centerMode===!0?b.options.slidesToShow+1:b.options.slidesToShow,c=b.slideCount;c>b.slideCount-e;c-=1)d=c-1,a(b.$slides[d]).clone(!0).attr("id","").attr("data-slick-index",d-b.slideCount).prependTo(b.$slideTrack).addClass("slick-cloned");for(c=0;e>c;c+=1)d=c,a(b.$slides[d]).clone(!0).attr("id","").attr("data-slick-index",d+b.slideCount).appendTo(b.$slideTrack).addClass("slick-cloned");b.$slideTrack.find(".slick-cloned").find("[id]").each(function(){a(this).attr("id","")})}},b.prototype.interrupt=function(a){var b=this;a||b.autoPlay(),b.interrupted=a},b.prototype.selectHandler=function(b){var c=this,d=a(b.target).is(".slick-slide")?a(b.target):a(b.target).parents(".slick-slide"),e=parseInt(d.attr("data-slick-index"));return e||(e=0),c.slideCount<=c.options.slidesToShow?(c.setSlideClasses(e),void c.asNavFor(e)):void c.slideHandler(e)},b.prototype.slideHandler=function(a,b,c){var d,e,f,g,j,h=null,i=this;return b=b||!1,i.animating===!0&&i.options.waitForAnimate===!0||i.options.fade===!0&&i.currentSlide===a||i.slideCount<=i.options.slidesToShow?void 0:(b===!1&&i.asNavFor(a),d=a,h=i.getLeft(d),g=i.getLeft(i.currentSlide),i.currentLeft=null===i.swipeLeft?g:i.swipeLeft,i.options.infinite===!1&&i.options.centerMode===!1&&(0>a||a>i.getDotCount()*i.options.slidesToScroll)?void(i.options.fade===!1&&(d=i.currentSlide,c!==!0?i.animateSlide(g,function(){i.postSlide(d)}):i.postSlide(d))):i.options.infinite===!1&&i.options.centerMode===!0&&(0>a||a>i.slideCount-i.options.slidesToScroll)?void(i.options.fade===!1&&(d=i.currentSlide,c!==!0?i.animateSlide(g,function(){i.postSlide(d)}):i.postSlide(d))):(i.options.autoplay&&clearInterval(i.autoPlayTimer),e=0>d?i.slideCount%i.options.slidesToScroll!==0?i.slideCount-i.slideCount%i.options.slidesToScroll:i.slideCount+d:d>=i.slideCount?i.slideCount%i.options.slidesToScroll!==0?0:d-i.slideCount:d,i.animating=!0,i.$slider.trigger("beforeChange",[i,i.currentSlide,e]),f=i.currentSlide,i.currentSlide=e,i.setSlideClasses(i.currentSlide),i.options.asNavFor&&(j=i.getNavTarget(),j=j.slick("getSlick"),j.slideCount<=j.options.slidesToShow&&j.setSlideClasses(i.currentSlide)),i.updateDots(),i.updateArrows(),i.options.fade===!0?(c!==!0?(i.fadeSlideOut(f),i.fadeSlide(e,function(){i.postSlide(e)})):i.postSlide(e),void i.animateHeight()):void(c!==!0?i.animateSlide(h,function(){i.postSlide(e)}):i.postSlide(e))))},b.prototype.startLoad=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.hide(),a.$nextArrow.hide()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.$dots.hide(),a.$slider.addClass("slick-loading")},b.prototype.swipeDirection=function(){var a,b,c,d,e=this;return a=e.touchObject.startX-e.touchObject.curX,b=e.touchObject.startY-e.touchObject.curY,c=Math.atan2(b,a),d=Math.round(180*c/Math.PI),0>d&&(d=360-Math.abs(d)),45>=d&&d>=0?e.options.rtl===!1?"left":"right":360>=d&&d>=315?e.options.rtl===!1?"left":"right":d>=135&&225>=d?e.options.rtl===!1?"right":"left":e.options.verticalSwiping===!0?d>=35&&135>=d?"down":"up":"vertical"},b.prototype.swipeEnd=function(a){var c,d,b=this;if(b.dragging=!1,b.interrupted=!1,b.shouldClick=b.touchObject.swipeLength>10?!1:!0,void 0===b.touchObject.curX)return!1;if(b.touchObject.edgeHit===!0&&b.$slider.trigger("edge",[b,b.swipeDirection()]),b.touchObject.swipeLength>=b.touchObject.minSwipe){switch(d=b.swipeDirection()){case"left":case"down":c=b.options.swipeToSlide?b.checkNavigable(b.currentSlide+b.getSlideCount()):b.currentSlide+b.getSlideCount(),b.currentDirection=0;break;case"right":case"up":c=b.options.swipeToSlide?b.checkNavigable(b.currentSlide-b.getSlideCount()):b.currentSlide-b.getSlideCount(),b.currentDirection=1}"vertical"!=d&&(b.slideHandler(c),b.touchObject={},b.$slider.trigger("swipe",[b,d]))}else b.touchObject.startX!==b.touchObject.curX&&(b.slideHandler(b.currentSlide),b.touchObject={})},b.prototype.swipeHandler=function(a){var b=this;if(!(b.options.swipe===!1||"ontouchend"in document&&b.options.swipe===!1||b.options.draggable===!1&&-1!==a.type.indexOf("mouse")))switch(b.touchObject.fingerCount=a.originalEvent&&void 0!==a.originalEvent.touches?a.originalEvent.touches.length:1,b.touchObject.minSwipe=b.listWidth/b.options.touchThreshold,b.options.verticalSwiping===!0&&(b.touchObject.minSwipe=b.listHeight/b.options.touchThreshold),a.data.action){case"start":b.swipeStart(a);break;case"move":b.swipeMove(a);break;case"end":b.swipeEnd(a)}},b.prototype.swipeMove=function(a){var d,e,f,g,h,b=this;return h=void 0!==a.originalEvent?a.originalEvent.touches:null,!b.dragging||h&&1!==h.length?!1:(d=b.getLeft(b.currentSlide),b.touchObject.curX=void 0!==h?h[0].pageX:a.clientX,b.touchObject.curY=void 0!==h?h[0].pageY:a.clientY,b.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(b.touchObject.curX-b.touchObject.startX,2))),b.options.verticalSwiping===!0&&(b.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(b.touchObject.curY-b.touchObject.startY,2)))),e=b.swipeDirection(),"vertical"!==e?(void 0!==a.originalEvent&&b.touchObject.swipeLength>4&&a.preventDefault(),g=(b.options.rtl===!1?1:-1)*(b.touchObject.curX>b.touchObject.startX?1:-1),b.options.verticalSwiping===!0&&(g=b.touchObject.curY>b.touchObject.startY?1:-1),f=b.touchObject.swipeLength,b.touchObject.edgeHit=!1,b.options.infinite===!1&&(0===b.currentSlide&&"right"===e||b.currentSlide>=b.getDotCount()&&"left"===e)&&(f=b.touchObject.swipeLength*b.options.edgeFriction,b.touchObject.edgeHit=!0),b.options.vertical===!1?b.swipeLeft=d+f*g:b.swipeLeft=d+f*(b.$list.height()/b.listWidth)*g,b.options.verticalSwiping===!0&&(b.swipeLeft=d+f*g),b.options.fade===!0||b.options.touchMove===!1?!1:b.animating===!0?(b.swipeLeft=null,!1):void b.setCSS(b.swipeLeft)):void 0)},b.prototype.swipeStart=function(a){var c,b=this;return b.interrupted=!0,1!==b.touchObject.fingerCount||b.slideCount<=b.options.slidesToShow?(b.touchObject={},!1):(void 0!==a.originalEvent&&void 0!==a.originalEvent.touches&&(c=a.originalEvent.touches[0]),b.touchObject.startX=b.touchObject.curX=void 0!==c?c.pageX:a.clientX,b.touchObject.startY=b.touchObject.curY=void 0!==c?c.pageY:a.clientY,void(b.dragging=!0))},b.prototype.unfilterSlides=b.prototype.slickUnfilter=function(){var a=this;null!==a.$slidesCache&&(a.unload(),a.$slideTrack.children(this.options.slide).detach(),a.$slidesCache.appendTo(a.$slideTrack),a.reinit())},b.prototype.unload=function(){var b=this;a(".slick-cloned",b.$slider).remove(),b.$dots&&b.$dots.remove(),b.$prevArrow&&b.htmlExpr.test(b.options.prevArrow)&&b.$prevArrow.remove(),b.$nextArrow&&b.htmlExpr.test(b.options.nextArrow)&&b.$nextArrow.remove(),b.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},b.prototype.unslick=function(a){var b=this;b.$slider.trigger("unslick",[b,a]),b.destroy()},b.prototype.updateArrows=function(){var b,a=this;b=Math.floor(a.options.slidesToShow/2),a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&!a.options.infinite&&(a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),a.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===a.currentSlide?(a.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):a.currentSlide>=a.slideCount-a.options.slidesToShow&&a.options.centerMode===!1?(a.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):a.currentSlide>=a.slideCount-1&&a.options.centerMode===!0&&(a.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},b.prototype.updateDots=function(){var a=this;null!==a.$dots&&(a.$dots.find("li").removeClass("slick-active").attr("aria-hidden","true"),a.$dots.find("li").eq(Math.floor(a.currentSlide/a.options.slidesToScroll)).addClass("slick-active").attr("aria-hidden","false"))},b.prototype.visibility=function(){var a=this;a.options.autoplay&&(document[a.hidden]?a.interrupted=!0:a.interrupted=!1)},a.fn.slick=function(){var f,g,a=this,c=arguments[0],d=Array.prototype.slice.call(arguments,1),e=a.length;for(f=0;e>f;f++)if("object"==typeof c||"undefined"==typeof c?a[f].slick=new b(a[f],c):g=a[f].slick[c].apply(a[f].slick,d),"undefined"!=typeof g)return g;return a}});;
/*!
 * Bootstrap v3.3.7 (http://getbootstrap.com)
 * Copyright 2011-2018 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */

/*!
 * Generated using the Bootstrap Customizer (<none>)
 * Config saved to config.json and <none>
 */
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(t){"use strict";var e=t.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||e[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var i=t(this),n=i.data("bs.alert");n||i.data("bs.alert",n=new o(this)),"string"==typeof e&&n[e].call(i)})}var i='[data-dismiss="alert"]',o=function(e){t(e).on("click",i,this.close)};o.VERSION="3.3.7",o.TRANSITION_DURATION=150,o.prototype.close=function(e){function i(){a.detach().trigger("closed.bs.alert").remove()}var n=t(this),s=n.attr("data-target");s||(s=n.attr("href"),s=s&&s.replace(/.*(?=#[^\s]*$)/,""));var a=t("#"===s?[]:s);e&&e.preventDefault(),a.length||(a=n.closest(".alert")),a.trigger(e=t.Event("close.bs.alert")),e.isDefaultPrevented()||(a.removeClass("in"),t.support.transition&&a.hasClass("fade")?a.one("bsTransitionEnd",i).emulateTransitionEnd(o.TRANSITION_DURATION):i())};var n=t.fn.alert;t.fn.alert=e,t.fn.alert.Constructor=o,t.fn.alert.noConflict=function(){return t.fn.alert=n,this},t(document).on("click.bs.alert.data-api",i,o.prototype.close)}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.button"),s="object"==typeof e&&e;n||o.data("bs.button",n=new i(this,s)),"toggle"==e?n.toggle():e&&n.setState(e)})}var i=function(e,o){this.$element=t(e),this.options=t.extend({},i.DEFAULTS,o),this.isLoading=!1};i.VERSION="3.3.7",i.DEFAULTS={loadingText:"loading..."},i.prototype.setState=function(e){var i="disabled",o=this.$element,n=o.is("input")?"val":"html",s=o.data();e+="Text",null==s.resetText&&o.data("resetText",o[n]()),setTimeout(t.proxy(function(){o[n](null==s[e]?this.options[e]:s[e]),"loadingText"==e?(this.isLoading=!0,o.addClass(i).attr(i,i).prop(i,!0)):this.isLoading&&(this.isLoading=!1,o.removeClass(i).removeAttr(i).prop(i,!1))},this),0)},i.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")?(i.prop("checked")&&(t=!1),e.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==i.prop("type")&&(i.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),i.prop("checked",this.$element.hasClass("active")),t&&i.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var o=t.fn.button;t.fn.button=e,t.fn.button.Constructor=i,t.fn.button.noConflict=function(){return t.fn.button=o,this},t(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(i){var o=t(i.target).closest(".btn");e.call(o,"toggle"),t(i.target).is('input[type="radio"], input[type="checkbox"]')||(i.preventDefault(),o.is("input,button")?o.trigger("focus"):o.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(e){t(e.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(e.type))})}(jQuery),+function(t){"use strict";function e(e){var i=e.attr("data-target");i||(i=e.attr("href"),i=i&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var o=i&&t(i);return o&&o.length?o:e.parent()}function i(i){i&&3===i.which||(t(n).remove(),t(s).each(function(){var o=t(this),n=e(o),s={relatedTarget:this};n.hasClass("open")&&(i&&"click"==i.type&&/input|textarea/i.test(i.target.tagName)&&t.contains(n[0],i.target)||(n.trigger(i=t.Event("hide.bs.dropdown",s)),i.isDefaultPrevented()||(o.attr("aria-expanded","false"),n.removeClass("open").trigger(t.Event("hidden.bs.dropdown",s)))))}))}function o(e){return this.each(function(){var i=t(this),o=i.data("bs.dropdown");o||i.data("bs.dropdown",o=new a(this)),"string"==typeof e&&o[e].call(i)})}var n=".dropdown-backdrop",s='[data-toggle="dropdown"]',a=function(e){t(e).on("click.bs.dropdown",this.toggle)};a.VERSION="3.3.7",a.prototype.toggle=function(o){var n=t(this);if(!n.is(".disabled, :disabled")){var s=e(n),a=s.hasClass("open");if(i(),!a){"ontouchstart"in document.documentElement&&!s.closest(".navbar-nav").length&&t(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(t(this)).on("click",i);var r={relatedTarget:this};if(s.trigger(o=t.Event("show.bs.dropdown",r)),o.isDefaultPrevented())return;n.trigger("focus").attr("aria-expanded","true"),s.toggleClass("open").trigger(t.Event("shown.bs.dropdown",r))}return!1}},a.prototype.keydown=function(i){if(/(38|40|27|32)/.test(i.which)&&!/input|textarea/i.test(i.target.tagName)){var o=t(this);if(i.preventDefault(),i.stopPropagation(),!o.is(".disabled, :disabled")){var n=e(o),a=n.hasClass("open");if(!a&&27!=i.which||a&&27==i.which)return 27==i.which&&n.find(s).trigger("focus"),o.trigger("click");var r=" li:not(.disabled):visible a",l=n.find(".dropdown-menu"+r);if(l.length){var d=l.index(i.target);38==i.which&&d>0&&d--,40==i.which&&d<l.length-1&&d++,~d||(d=0),l.eq(d).trigger("focus")}}}};var r=t.fn.dropdown;t.fn.dropdown=o,t.fn.dropdown.Constructor=a,t.fn.dropdown.noConflict=function(){return t.fn.dropdown=r,this},t(document).on("click.bs.dropdown.data-api",i).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.bs.dropdown.data-api",s,a.prototype.toggle).on("keydown.bs.dropdown.data-api",s,a.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",a.prototype.keydown)}(jQuery),+function(t){"use strict";function e(e,o){return this.each(function(){var n=t(this),s=n.data("bs.modal"),a=t.extend({},i.DEFAULTS,n.data(),"object"==typeof e&&e);s||n.data("bs.modal",s=new i(this,a)),"string"==typeof e?s[e](o):a.show&&s.show(o)})}var i=function(e,i){this.options=i,this.$body=t(document.body),this.$element=t(e),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,t.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};i.VERSION="3.3.7",i.TRANSITION_DURATION=300,i.BACKDROP_TRANSITION_DURATION=150,i.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},i.prototype.toggle=function(t){return this.isShown?this.hide():this.show(t)},i.prototype.show=function(e){var o=this,n=t.Event("show.bs.modal",{relatedTarget:e});this.$element.trigger(n),this.isShown||n.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',t.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){o.$element.one("mouseup.dismiss.bs.modal",function(e){t(e.target).is(o.$element)&&(o.ignoreBackdropClick=!0)})}),this.backdrop(function(){var n=t.support.transition&&o.$element.hasClass("fade");o.$element.parent().length||o.$element.appendTo(o.$body),o.$element.show().scrollTop(0),o.adjustDialog(),n&&o.$element[0].offsetWidth,o.$element.addClass("in"),o.enforceFocus();var s=t.Event("shown.bs.modal",{relatedTarget:e});n?o.$dialog.one("bsTransitionEnd",function(){o.$element.trigger("focus").trigger(s)}).emulateTransitionEnd(i.TRANSITION_DURATION):o.$element.trigger("focus").trigger(s)}))},i.prototype.hide=function(e){e&&e.preventDefault(),e=t.Event("hide.bs.modal"),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),t(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),t.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",t.proxy(this.hideModal,this)).emulateTransitionEnd(i.TRANSITION_DURATION):this.hideModal())},i.prototype.enforceFocus=function(){t(document).off("focusin.bs.modal").on("focusin.bs.modal",t.proxy(function(t){document===t.target||this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")},this))},i.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",t.proxy(function(t){27==t.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},i.prototype.resize=function(){this.isShown?t(window).on("resize.bs.modal",t.proxy(this.handleUpdate,this)):t(window).off("resize.bs.modal")},i.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.$body.removeClass("modal-open"),t.resetAdjustments(),t.resetScrollbar(),t.$element.trigger("hidden.bs.modal")})},i.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},i.prototype.backdrop=function(e){var o=this,n=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var s=t.support.transition&&n;if(this.$backdrop=t(document.createElement("div")).addClass("modal-backdrop "+n).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",t.proxy(function(t){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),s&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!e)return;s?this.$backdrop.one("bsTransitionEnd",e).emulateTransitionEnd(i.BACKDROP_TRANSITION_DURATION):e()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var a=function(){o.removeBackdrop(),e&&e()};t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",a).emulateTransitionEnd(i.BACKDROP_TRANSITION_DURATION):a()}else e&&e()},i.prototype.handleUpdate=function(){this.adjustDialog()},i.prototype.adjustDialog=function(){var t=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},i.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},i.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth<t,this.scrollbarWidth=this.measureScrollbar()},i.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",t+this.scrollbarWidth)},i.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},i.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var o=t.fn.modal;t.fn.modal=e,t.fn.modal.Constructor=i,t.fn.modal.noConflict=function(){return t.fn.modal=o,this},t(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(i){var o=t(this),n=o.attr("href"),s=t(o.attr("data-target")||n&&n.replace(/.*(?=#[^\s]+$)/,"")),a=s.data("bs.modal")?"toggle":t.extend({remote:!/#/.test(n)&&n},s.data(),o.data());o.is("a")&&i.preventDefault(),s.one("show.bs.modal",function(t){t.isDefaultPrevented()||s.one("hidden.bs.modal",function(){o.is(":visible")&&o.trigger("focus")})}),e.call(s,a,this)})}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.tooltip"),s="object"==typeof e&&e;!n&&/destroy|hide/.test(e)||(n||o.data("bs.tooltip",n=new i(this,s)),"string"==typeof e&&n[e]())})}var i=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",t,e)};i.VERSION="3.3.7",i.TRANSITION_DURATION=150,i.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},i.prototype.init=function(e,i,o){if(this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(o),this.$viewport=this.options.viewport&&t(t.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var n=this.options.trigger.split(" "),s=n.length;s--;){var a=n[s];if("click"==a)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=a){var r="hover"==a?"mouseenter":"focusin",l="hover"==a?"mouseleave":"focusout";this.$element.on(r+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},i.prototype.getDefaults=function(){return i.DEFAULTS},i.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},i.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,o){i[t]!=o&&(e[t]=o)}),e},i.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),e instanceof t.Event&&(i.inState["focusin"==e.type?"focus":"hover"]=!0),i.tip().hasClass("in")||"in"==i.hoverState?void(i.hoverState="in"):(clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show())},i.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},i.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),e instanceof t.Event&&(i.inState["focusout"==e.type?"focus":"hover"]=!1),i.isInStateTrue()?void 0:(clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide())},i.prototype.show=function(){var e=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var o=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!o)return;var n=this,s=this.tip(),a=this.getUID(this.type);this.setContent(),s.attr("id",a),this.$element.attr("aria-describedby",a),this.options.animation&&s.addClass("fade");var r="function"==typeof this.options.placement?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,l=/\s?auto?\s?/i,d=l.test(r);d&&(r=r.replace(l,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(r).data("bs."+this.type,this),this.options.container?s.appendTo(this.options.container):s.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var h=this.getPosition(),p=s[0].offsetWidth,c=s[0].offsetHeight;if(d){var u=r,f=this.getPosition(this.$viewport);r="bottom"==r&&h.bottom+c>f.bottom?"top":"top"==r&&h.top-c<f.top?"bottom":"right"==r&&h.right+p>f.width?"left":"left"==r&&h.left-p<f.left?"right":r,s.removeClass(u).addClass(r)}var g=this.getCalculatedOffset(r,h,p,c);this.applyPlacement(g,r);var m=function(){var t=n.hoverState;n.$element.trigger("shown.bs."+n.type),n.hoverState=null,"out"==t&&n.leave(n)};t.support.transition&&this.$tip.hasClass("fade")?s.one("bsTransitionEnd",m).emulateTransitionEnd(i.TRANSITION_DURATION):m()}},i.prototype.applyPlacement=function(e,i){var o=this.tip(),n=o[0].offsetWidth,s=o[0].offsetHeight,a=parseInt(o.css("margin-top"),10),r=parseInt(o.css("margin-left"),10);isNaN(a)&&(a=0),isNaN(r)&&(r=0),e.top+=a,e.left+=r,t.offset.setOffset(o[0],t.extend({using:function(t){o.css({top:Math.round(t.top),left:Math.round(t.left)})}},e),0),o.addClass("in");var l=o[0].offsetWidth,d=o[0].offsetHeight;"top"==i&&d!=s&&(e.top=e.top+s-d);var h=this.getViewportAdjustedDelta(i,e,l,d);h.left?e.left+=h.left:e.top+=h.top;var p=/top|bottom/.test(i),c=p?2*h.left-n+l:2*h.top-s+d,u=p?"offsetWidth":"offsetHeight";o.offset(e),this.replaceArrow(c,o[0][u],p)},i.prototype.replaceArrow=function(t,e,i){this.arrow().css(i?"left":"top",50*(1-t/e)+"%").css(i?"top":"left","")},i.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();t.find(".tooltip-inner")[this.options.html?"html":"text"](e),t.removeClass("fade in top bottom left right")},i.prototype.hide=function(e){function o(){"in"!=n.hoverState&&s.detach(),n.$element&&n.$element.removeAttr("aria-describedby").trigger("hidden.bs."+n.type),e&&e()}var n=this,s=t(this.$tip),a=t.Event("hide.bs."+this.type);return this.$element.trigger(a),a.isDefaultPrevented()?void 0:(s.removeClass("in"),t.support.transition&&s.hasClass("fade")?s.one("bsTransitionEnd",o).emulateTransitionEnd(i.TRANSITION_DURATION):o(),this.hoverState=null,this)},i.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},i.prototype.hasContent=function(){return this.getTitle()},i.prototype.getPosition=function(e){e=e||this.$element;var i=e[0],o="BODY"==i.tagName,n=i.getBoundingClientRect();null==n.width&&(n=t.extend({},n,{width:n.right-n.left,height:n.bottom-n.top}));var s=window.SVGElement&&i instanceof window.SVGElement,a=o?{top:0,left:0}:s?null:e.offset(),r={scroll:o?document.documentElement.scrollTop||document.body.scrollTop:e.scrollTop()},l=o?{width:t(window).width(),height:t(window).height()}:null;return t.extend({},n,r,l,a)},i.prototype.getCalculatedOffset=function(t,e,i,o){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-i/2}:"top"==t?{top:e.top-o,left:e.left+e.width/2-i/2}:"left"==t?{top:e.top+e.height/2-o/2,left:e.left-i}:{top:e.top+e.height/2-o/2,left:e.left+e.width}},i.prototype.getViewportAdjustedDelta=function(t,e,i,o){var n={top:0,left:0};if(!this.$viewport)return n;var s=this.options.viewport&&this.options.viewport.padding||0,a=this.getPosition(this.$viewport);if(/right|left/.test(t)){var r=e.top-s-a.scroll,l=e.top+s-a.scroll+o;r<a.top?n.top=a.top-r:l>a.top+a.height&&(n.top=a.top+a.height-l)}else{var d=e.left-s,h=e.left+s+i;d<a.left?n.left=a.left-d:h>a.right&&(n.left=a.left+a.width-h)}return n},i.prototype.getTitle=function(){var t,e=this.$element,i=this.options;return t=e.attr("data-original-title")||("function"==typeof i.title?i.title.call(e[0]):i.title)},i.prototype.getUID=function(t){do t+=~~(1e6*Math.random());while(document.getElementById(t));return t},i.prototype.tip=function(){if(!this.$tip&&(this.$tip=t(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},i.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},i.prototype.enable=function(){this.enabled=!0},i.prototype.disable=function(){this.enabled=!1},i.prototype.toggleEnabled=function(){this.enabled=!this.enabled},i.prototype.toggle=function(e){var i=this;e&&(i=t(e.currentTarget).data("bs."+this.type),i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i))),e?(i.inState.click=!i.inState.click,i.isInStateTrue()?i.enter(i):i.leave(i)):i.tip().hasClass("in")?i.leave(i):i.enter(i)},i.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null,t.$element=null})};var o=t.fn.tooltip;t.fn.tooltip=e,t.fn.tooltip.Constructor=i,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=o,this}}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.popover"),s="object"==typeof e&&e;!n&&/destroy|hide/.test(e)||(n||o.data("bs.popover",n=new i(this,s)),"string"==typeof e&&n[e]())})}var i=function(t,e){this.init("popover",t,e)};if(!t.fn.tooltip)throw new Error("Popover requires tooltip.js");i.VERSION="3.3.7",i.DEFAULTS=t.extend({},t.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),i.prototype=t.extend({},t.fn.tooltip.Constructor.prototype),i.prototype.constructor=i,i.prototype.getDefaults=function(){return i.DEFAULTS},i.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](e),t.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof i?"html":"append":"text"](i),t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},i.prototype.hasContent=function(){return this.getTitle()||this.getContent()},i.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},i.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var o=t.fn.popover;t.fn.popover=e,t.fn.popover.Constructor=i,t.fn.popover.noConflict=function(){return t.fn.popover=o,this}}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.tab");n||o.data("bs.tab",n=new i(this)),"string"==typeof e&&n[e]()})}var i=function(e){this.element=t(e)};i.VERSION="3.3.7",i.TRANSITION_DURATION=150,i.prototype.show=function(){var e=this.element,i=e.closest("ul:not(.dropdown-menu)"),o=e.data("target");if(o||(o=e.attr("href"),o=o&&o.replace(/.*(?=#[^\s]*$)/,"")),!e.parent("li").hasClass("active")){var n=i.find(".active:last a"),s=t.Event("hide.bs.tab",{relatedTarget:e[0]}),a=t.Event("show.bs.tab",{relatedTarget:n[0]});if(n.trigger(s),e.trigger(a),!a.isDefaultPrevented()&&!s.isDefaultPrevented()){var r=t(o);this.activate(e.closest("li"),i),this.activate(r,r.parent(),function(){n.trigger({type:"hidden.bs.tab",relatedTarget:e[0]}),e.trigger({type:"shown.bs.tab",relatedTarget:n[0]})})}}},i.prototype.activate=function(e,o,n){function s(){a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),e.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),r?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu").length&&e.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),n&&n()}var a=o.find("> .active"),r=n&&t.support.transition&&(a.length&&a.hasClass("fade")||!!o.find("> .fade").length);a.length&&r?a.one("bsTransitionEnd",s).emulateTransitionEnd(i.TRANSITION_DURATION):s(),a.removeClass("in")};var o=t.fn.tab;t.fn.tab=e,t.fn.tab.Constructor=i,t.fn.tab.noConflict=function(){return t.fn.tab=o,this};var n=function(i){i.preventDefault(),e.call(t(this),"show")};t(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',n).on("click.bs.tab.data-api",'[data-toggle="pill"]',n)}(jQuery),+function(t){"use strict";function e(e){var i,o=e.attr("data-target")||(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return t(o)}function i(e){return this.each(function(){var i=t(this),n=i.data("bs.collapse"),s=t.extend({},o.DEFAULTS,i.data(),"object"==typeof e&&e);!n&&s.toggle&&/show|hide/.test(e)&&(s.toggle=!1),n||i.data("bs.collapse",n=new o(this,s)),"string"==typeof e&&n[e]()})}var o=function(e,i){this.$element=t(e),this.options=t.extend({},o.DEFAULTS,i),this.$trigger=t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};o.VERSION="3.3.7",o.TRANSITION_DURATION=350,o.DEFAULTS={toggle:!0},o.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},o.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var e,n=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(n&&n.length&&(e=n.data("bs.collapse"),e&&e.transitioning))){var s=t.Event("show.bs.collapse");if(this.$element.trigger(s),!s.isDefaultPrevented()){n&&n.length&&(i.call(n,"hide"),e||n.data("bs.collapse",null));var a=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[a](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var r=function(){this.$element.removeClass("collapsing").addClass("collapse in")[a](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!t.support.transition)return r.call(this);var l=t.camelCase(["scroll",a].join("-"));this.$element.one("bsTransitionEnd",t.proxy(r,this)).emulateTransitionEnd(o.TRANSITION_DURATION)[a](this.$element[0][l])}}}},o.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var e=t.Event("hide.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){var i=this.dimension();this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var n=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return t.support.transition?void this.$element[i](0).one("bsTransitionEnd",t.proxy(n,this)).emulateTransitionEnd(o.TRANSITION_DURATION):n.call(this)}}},o.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},o.prototype.getParent=function(){return t(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(t.proxy(function(i,o){var n=t(o);this.addAriaAndCollapsedClass(e(n),n)},this)).end()},o.prototype.addAriaAndCollapsedClass=function(t,e){var i=t.hasClass("in");t.attr("aria-expanded",i),e.toggleClass("collapsed",!i).attr("aria-expanded",i)};var n=t.fn.collapse;t.fn.collapse=i,t.fn.collapse.Constructor=o,t.fn.collapse.noConflict=function(){return t.fn.collapse=n,this},t(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(o){var n=t(this);n.attr("data-target")||o.preventDefault();var s=e(n),a=s.data("bs.collapse"),r=a?"toggle":n.data();i.call(s,r)})}(jQuery),+function(t){"use strict";function e(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]};return!1}t.fn.emulateTransitionEnd=function(e){var i=!1,o=this;t(this).one("bsTransitionEnd",function(){i=!0});var n=function(){i||t(o).trigger(t.support.transition.end)};return setTimeout(n,e),this},t(function(){t.support.transition=e(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){return t(e.target).is(this)?e.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery);;
"undefined"==typeof Tablesaw&&(Tablesaw={i18n:{modes:["Stack","Swipe","Toggle"],columns:'Col<span class="a11y-sm">umn</span>s',columnBtnText:"Columns",columnsDialogError:"No eligible columns.",sort:"Sort"},mustard:"querySelector"in document&&(!window.blackberry||window.WebKitPoint)&&!window.operamini}),Tablesaw.config||(Tablesaw.config={}),Tablesaw.mustard&&jQuery(document.documentElement).addClass("tablesaw-enhanced"),function(a){function s(t){if(!t)throw new Error("Tablesaw requires an element.");this.table=t,this.$table=a(t),this.mode=this.$table.attr("data-tablesaw-mode")||"stack",this.init()}var i="table",e="tablesaw-bar",l="tablesawcreate",n="tablesawdestroy",t="tablesawrefresh";s.prototype.init=function(){this.$table.attr("id")||this.$table.attr("id",i+"-"+Math.round(1e4*Math.random())),this.createToolbar();var t=this._initCells();this.$table.trigger(l,[this,t])},s.prototype._initCells=function(){var i,l=this.table.querySelectorAll("thead tr"),n=this;return a(l).each(function(){var s=0;a(this).children().each(function(){var t=parseInt(this.getAttribute("colspan"),10),e=":nth-child("+(s+1)+")";if(i=s+1,t)for(var a=0;a<t-1;a++)e+=", :nth-child("+(++s+1)+")";this.cells=n.$table.find("tr").not(l[0]).not(this).children().filter(e),s++})}),i},s.prototype.refresh=function(){this._initCells(),this.$table.trigger(t)},s.prototype.createToolbar=function(){var t=this.$table.prev().filter("."+e);t.length||(t=a("<div>").addClass(e).insertBefore(this.$table)),this.$toolbar=t,this.mode&&this.$toolbar.addClass("mode-"+this.mode)},s.prototype.destroy=function(){this.$table.prev().filter("."+e).each(function(){this.className=this.className.replace(/\bmode\-\w*\b/gi,"")});var t=this.$table.attr("id");a(document).unbind("."+t),a(window).unbind("."+t),this.$table.trigger(n,[this]),this.$table.removeAttr("data-tablesaw-mode"),this.$table.removeData(i)},a.fn[i]=function(){return this.each(function(){var t,e=a(this);e.data(i)||(t=new s(this),e.data(i,t))})},a(document).on("enhance.tablesaw",function(t){Tablesaw.mustard&&a(t.target).find("table[data-tablesaw-mode],table[data-tablesaw-sortable]")[i]()})}(jQuery),function(n){function s(t){this.$table=n(t),this.labelless=this.$table.is("["+h+"]"),this.hideempty=this.$table.is("["+i+"]"),this.labelless||(this.allHeaders=this.$table.find("th")),this.$table.data(a,this)}var e="tablesaw-stack",r="tablesaw-cell-label",o="tablesaw-cell-content",a="tablesaw-stack",h="data-tablesaw-no-labels",i="data-tablesaw-hide-empty";s.prototype.init=function(i){var t,l;this.$table.addClass(e),this.labelless||(t=n(this.allHeaders),l=this.hideempty,t.each(function(){var t=n(this),e=n(this.cells).filter(function(){return!(n(this).parent().is("["+h+"]")||l&&n(this).is(":empty"))}),a=e.not(this).filter("thead th").length&&" tablesaw-cell-label-top",s=t.find(".tablesaw-sortable-btn"),s=(s.length?s:t).html();""!==s&&(a?(t=(t=parseInt(n(this).attr("colspan"),10))?"td:nth-child("+t+"n + "+i+")":"",e.filter(t).prepend("<b class='"+r+a+"'>"+s+"</b>")):(e.wrapInner("<span class='"+o+"'></span>"),e.prepend("<b class='"+r+"'>"+s+"</b>")))}))},s.prototype.destroy=function(){this.$table.removeClass(e),this.$table.find("."+r).remove(),this.$table.find("."+o).each(function(){n(this).replaceWith(this.childNodes)})},n(document).on("tablesawcreate",function(t,e,a){"stack"===e.mode&&new s(e.table).init(a)}),n(document).on("tablesawdestroy",function(t,e){"stack"===e.mode&&n(e.table).data(a).destroy()})}(jQuery);;
jQuery.fn.extend({everyTime:function(c,a,d,b){return this.each(function(){jQuery.timer.add(this,c,a,d,b)})},oneTime:function(c,a,d){return this.each(function(){jQuery.timer.add(this,c,a,d,1)})},stopTime:function(c,a){return this.each(function(){jQuery.timer.remove(this,c,a)})}});
jQuery.extend({timer:{global:[],guid:1,dataKey:"jQuery.timer",regex:/^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,powers:{ms:1,cs:10,ds:100,s:1E3,das:1E4,hs:1E5,ks:1E6},timeParse:function(c){if(c==undefined||c==null)return null;var a=this.regex.exec(jQuery.trim(c.toString()));return a[2]?parseFloat(a[1])*(this.powers[a[2]]||1):c},add:function(c,a,d,b,e){var g=0;if(jQuery.isFunction(d)){e||(e=b);b=d;d=a}a=jQuery.timer.timeParse(a);if(!(typeof a!="number"||isNaN(a)||a<0)){if(typeof e!="number"||isNaN(e)||e<0)e=
0;e=e||0;var f=jQuery.data(c,this.dataKey)||jQuery.data(c,this.dataKey,{});f[d]||(f[d]={});b.timerID=b.timerID||this.guid++;var h=function(){if(++g>e&&e!==0||b.call(c,g)===false)jQuery.timer.remove(c,d,b)};h.timerID=b.timerID;f[d][b.timerID]||(f[d][b.timerID]=window.setInterval(h,a));this.global.push(c)}},remove:function(c,a,d){var b=jQuery.data(c,this.dataKey),e;if(b){if(a){if(b[a]){if(d){if(d.timerID){window.clearInterval(b[a][d.timerID]);delete b[a][d.timerID]}}else for(d in b[a]){window.clearInterval(b[a][d]);
delete b[a][d]}for(e in b[a])break;if(!e){e=null;delete b[a]}}}else for(a in b)this.remove(c,a,d);for(e in b)break;e||jQuery.removeData(c,this.dataKey)}}}});jQuery(window).bind("unload",function(){jQuery.each(jQuery.timer.global,function(c,a){jQuery.timer.remove(a)})});;
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(f){var o=/\+/g;function p(e){return v.raw?e:encodeURIComponent(e)}function m(e,n){e=v.raw?e:function(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{e=decodeURIComponent(e.replace(o," "))}catch(e){return}try{return v.json?JSON.parse(e):e}catch(e){}}(e);return f.isFunction(n)?n(e):e}var v=f.cookie=function(e,n,o){var i,t;if(void 0!==n&&!f.isFunction(n))return"number"==typeof(o=f.extend({},v.defaults,o)).expires&&(t=o.expires,(i=o.expires=new Date).setDate(i.getDate()+t)),document.cookie=[p(e),"=",(t=n,p(v.json?JSON.stringify(t):String(t))),o.expires?"; expires="+o.expires.toUTCString():"",o.path?"; path="+o.path:"",o.domain?"; domain="+o.domain:"",o.secure?"; secure":""].join("");for(var r=e?void 0:{},c=document.cookie?document.cookie.split("; "):[],a=0,u=c.length;a<u;a++){var d=c[a].split("="),s=(s=d.shift(),v.raw?s:decodeURIComponent(s)),d=d.join("=");if(e&&e===s){r=m(d,n);break}e||void 0===(d=m(d))||(r[s]=d)}return r};v.defaults={},f.removeCookie=function(e,n){return void 0!==f.cookie(e)&&(f.cookie(e,"",f.extend({},n,{expires:-1})),!0)}});;
/* money.js 0.1.3, MIT license, josscrowcroft.github.com/money.js */
(function (g, j) { var b = function (a) { return new i(a) }; b.version = "0.1.3"; var c = g.fxSetup || { rates: {}, base: "" }; b.rates = c.rates; b.base = c.base; b.settings = { from: c.from || b.base, to: c.to || b.base }; var h = b.convert = function (a, e) { if ("object" === typeof a && a.length) { for (var d = 0; d < a.length; d++) a[d] = h(a[d], e); return a } e = e || {}; if (!e.from) e.from = b.settings.from; if (!e.to) e.to = b.settings.to; var d = e.to, c = e.from, f = b.rates; f[b.base] = 1; if (!f[d] || !f[c]) throw "fx error"; d = c === b.base ? f[d] : d === b.base ? 1 / f[c] : f[d] * (1 / f[c]); return a * d }, i = function (a) { "string" === typeof a ? (this._v = parseFloat(a.replace(/[^0-9-.]/g, "")), this._fx = a.replace(/([^A-Za-z])/g, "")) : this._v = a }, c = b.prototype = i.prototype; c.convert = function () { var a = Array.prototype.slice.call(arguments); a.unshift(this._v); return h.apply(b, a) }; c.from = function (a) { a = b(h(this._v, { from: a, to: b.base })); a._fx = b.base; return a }; c.to = function (a) { return h(this._v, { from: this._fx ? this._fx : b.settings.from, to: a }) }; if ("undefined" !== typeof exports) { if ("undefined" !== typeof module && module.exports) exports = module.exports = b; exports.fx = fx } else "function" === typeof define && define.amd ? define([], function () { return b }) : (b.noConflict = function (a) { return function () { g.fx = a; b.noConflict = j; return b } } (g.fx), g.fx = b) })(this);;
var GeoDefaultCountryCode="United States";var GeoDefaultCurrency="USD";var GeoDefaultLocale="en-US";var GeoCookieExpiration=7;var GeoCurrentSale=true;var GeoSalePrompt="Independence Day Sale";var GeoCurrencyList={ 'Andorra':'EUR','Austria':'EUR','Belgium':'EUR','Cyprus':'EUR','Estonia':'EUR','Finland':'EUR','France':'EUR','Germany':'EUR','Greece':'EUR','Ireland':'EUR','Italy':'EUR','Latvia':'EUR','Luxembourg':'EUR','Malta':'EUR','Martinique':'EUR','Mayotte':'EUR','Monaco':'EUR','Montenegro':'EUR','Netherlands':'EUR','Portugal':'EUR','Reunion':'EUR','San Marino':'EUR','Saint Bartelemey':'EUR','Slovakia':'EUR','Slovenia':'EUR','Spain':'EUR','Saint Pierre and Miquelon':'EUR','Holy See (Vatican City State)':'EUR','United States':'USD','Japan':'JPY','Bulgaria':'BGN','Czech Republic':'CZK','Denmark':'DKK','Faroe Islands':'DKK','Greenland':'DKK','United Kingdom':'GBP','Isle of Man':'GBP','Jersey':'GBP','South Georgia and the South Sandwich Islands':'GBP','British Indian Ocean Territory':'GBP','Hungary':'HUF','Lithuania':'LTL','Poland':'PLN','Romania':'RON','Sweden':'SEK','Switzerland':'CHF','Liechtenstein':'CHF','Norway':'NOK','Svalbard and Jan Mayen':'NOK','Croatia':'HRK','Russian Federation':'RUB','Turkey':'TRY','Australia':'AUD','Brazil':'BRL','Canada':'CAD','China':'CNY','Hong Kong':'HKD','Macao':'HKD','Indonesia':'IDR','Israel':'ILS','Palestinian Territory' : 'ILS','India':'INR','Korea, Republic of':'KRW','Mexico':'MXN','Malaysia':'MYR','New Zealand':'NZD','Cook Islands':'NZD','Niue':'NZD','Pitcairn':'NZD','Tokelau':'NZD','Philippines':'PHP','Singapore':'SGD','Brunei Darussalam':'SGD','Thailand':'THB','South Africa':'ZAR' };var GeoLocaleList={ 'Andorra':'ca','Austria':'de-at','Belgium':'nl-be','Cyprus':'el','Estonia':'et','Finland':'sv-fl','France':'fr-fr','Germany':'de-de','Greece':'el','Ireland':'en-ie','Italy':'it-it','Latvia':'iv','Luxembourg':'fr-lu','Malta':'mt','Martinique':'fr','Mayotte':'fr','Monaco':'fr','Montenegro':'sr-ME','Netherlands':'nl-nl','Portugal':'pt-pt','Reunion':'fr','San Marino':'it','Saint Bartelemey':'fr','Slovakia':'sk','Slovenia':'sl','Spain':'es-es','Saint Pierre and Miquelon':'fr','Holy See (Vatican City State)':'it','United States':'en-us','Japan':'ja','Bulgaria':'bg','Czech Republic':'cs','Denmark':'da','Faroe Islands':'fo','Greenland':'da','United Kingdom':'en-gb','Isle of Man':'en-gb','Jersey':'en-gb','South Georgia and the South Sandwich Islands':'en-gb','British Indian Ocean Territory':'en-gb','Hungary':'hu','Lithuania':'lt','Poland':'pl','Romania':'ro','Sweden':'sv-se','Switzerland':'fr','Liechtenstein':'de-li','Norway':'no','Svalbard and Jan Mayen':'no','Croatia':'hr','Russian Federation':'ru','Turkey':'tr','Australia':'en-au','Brazil':'pt-br','Canada':'en-ca','China':'zh-cn','Hong Kong':'zh-hk','Macao':'zh-mo','Indonesia':'id','Israel':'he','Palestinian Territory':'ar','India':'hi','Korea, Republic of':'ko','Mexico':'es-mx','Malaysia':'ms-my','New Zealand':'en-nz','Cook Islands':'en','Niue':'en','Pitcairn':'en','Philippines':'en-ph','Singapore':'zh-sg','Brunei Darussalam':'ms-bn','Thailand':'th','South Africa':'en-za' };fx.base='EUR';fx.rates={'EUR':'1.0000','USD':'1.0866','JPY':'157.16','BGN':'1.9558','CZK':'23.742','DKK':'7.4474','GBP':'0.85828','HUF':'371.93','PLN':'4.4388','RON':'4.9635','SEK':'11.8055','CHF':'0.9788','ISK':'148.70','NOK':'11.7040','TRY':'28.3193','AUD':'1.6398','BRL':'5.2788','CAD':'1.4415','CNY':'7.8983','HKD':'8.5157','IDR':'16384.54','ILS':'4.0486','INR':'89.2065','KRW':'1435.88','MXN':'18.5614','MYR':'5.0717','NZD':'1.7858','PHP':'60.082','SGD':'1.4732','THB':'38.482','ZAR':'20.5785'};;
var GeoTargetlyUID_Live="-LAIrI0xDoQ3LsJvdLd7",GeoTargetlyUID_Staging="-LB2AQvg0rlRWdAC-Ft4",GeoTargetlyUID_Development="-LB27xHCnqjE3Y-OavKS",GeoDefaultCountryCode=GeoDefaultCountryCode||"United States",GeoDefaultCurrency=GeoDefaultCurrency||"USD",GeoDefaultLocale=GeoDefaultLocale||"en-US",GeoCookieExpiration=GeoCookieExpiration||7,GeoCurrentSale=GeoCurrentSale||!1,GeoSalePrompt=GeoSalePrompt||"Holiday Sale",GeoCurrencyList=GeoCurrencyList||[],GeoCurrencyExcludeList={India:"INR"},GeoLocaleList=GeoLocaleList||[],GeoCurrentCountry=GeoCurrentCountry||"United States",GeoContent={phone_number:{"United States":'<span class="svg svg-flag svg-flag-us"><img src="/app_templates/skin_1/src/svg/optimized/flag-us.svg"></span>1-888-228-7167',Canada:'<span class="svg svg-flag svg-flag-ca"><img src="/app_templates/skin_1/src/svg/optimized/flag-ca.svg"></span>+1-888-228-7167',Australia:'<span class="svg svg-flag svg-flag-au"><img src="/app_templates/skin_1/src/svg/optimized/flag-au.svg"></span>2-9037-2986',"United Kingdom":'<span class="svg svg-flag svg-flag-gb"><img src="/app_templates/skin_1/src/svg/optimized/flag-gb.svg"></span>0207-099-3786',Other:'<span class="svg svg-flag svg-flag-us"><img src="/app_templates/skin_1/src/svg/optimized/flag-us.svg"></span>+1-212-869-1165'},phone_number_plain:{"United States":"1-888-228-7167",Canada:"+1-888-228-7167",Australia:"2-9037-2986","United Kingdom":"0207-099-3786",Other:"+1-212-869-1165"},phone_number_us_plain:{"United States":"1-888-228-7167",Canada:"+1-888-228-7167",Other:"+1-212-869-1165"},german_additional_links:{Germany:'<a href="/t-hinter_den_kulissen/">Hinter den Kulissen</a>'},video_tag:{Germany:"Entdecken Sie Wie Wir Schmuck Kreieren"},video_url:{Germany:'<iframe width="640" height="360" src="https://www.youtube.com/embed/P_CYpeXffew?feature=player_embedded&fs=1&modestbranding=1&rel=0&showinfo=0&autohide=1&color=white&iv_load_policy=3&theme=light" frameborder="0" allowfullscreen></iframe>'}};if(getParameterByName("forcecountry").length>0){RemoveCountryCookie(),"reset"!=getParameterByName("forcecountry")&&SetCountryCookie(getParameterByName("forcecountry"));try{$.removeCookie("IntBannerStatus",{path:"/"})}catch(e){}try{$.removeCookie("IntSaleBannerStatus",{path:"/"})}catch(e){}}function loadGeoTargetly(e,t,o){var a=e.getElementsByTagName(t)[0],r=e.createElement(t);r.async=!0,r.src="https://g1386590345.co/gl?id="+o+"&refurl="+e.referrer+"&winurl="+encodeURIComponent(window.location),a.parentNode.insertBefore(r,a)}function loadGeoTargetlyV1(e,t,o,a,r,n,i,c,l){i=0,l=[],n=[],(c=function(){i<10&&(r=Math.round((new Date).getTime()/864e6)-1837+i,n[i]="g"+198084335*r+".co",a=e.getElementsByTagName(t)[0],l[i]=e.createElement(t),l[i].async=!0,l[i].src="//"+n[i]+"/gl?id="+o+"&refurl="+e.referrer+"&winurl="+encodeURIComponent(window.location),a.parentNode.insertBefore(l[i],a),l[i].onerror=function(){l[i].remove(),i++,c()})})()}function geotargetly_loaded(){var e=geotargetly_country_name();GeoIsEmpty(e)&&(e=GeoDefaultCountryCode),SetCountryCookie(e),GeoCurrentCountry=ReadCountryCookie(),console.log("Geotargetly Lookup :: "+e),$(document).ready((function(){DisplayGeoContent(GeoCurrentCountry)}))}function DisplayGeoContent(e){GeoIsEmpty(e)||($.each(GeoContent,(function(t,o){ReplaceGeoContent(t,o,e)})),$(".geolify[data-display='foreign']").hide().each((function(){$(this).html($(this).html().replace("{COUNTRY}",e))})),$(".geolify[data-display='local']").show().each((function(){$(this).html($(this).html().replace("{COUNTRY}",e))})),e==GeoDefaultCountryCode||GeoCurrentSale||($(".geolify[data-display='foreign']").show(),$(".geolify[data-display='local']").hide()),e!=GeoDefaultCountryCode&&($(".geolify[data-display='foreign-only']").show(),$(".geolify[data-display='local-only']").hide()),ConvertGeoCurrency(e))}function ReplaceGeoContent(e,t,o){try{o in t?t[o].length&&($(".geolify[data-id='"+e+"']").html(t[o].replace("{COUNTRY}",o)),$(".geolify-attr-href[data-id='"+e+"']").prop("href",t[o].replace("{COUNTRY}",o))):"Other"in t&&($(".geolify[data-id='"+e+"']").html(t.Other.replace("{COUNTRY}",o)),$(".geolify-attr-href[data-id='"+e+"']").prop("href",t.Other.replace("{COUNTRY}",o)))}catch(e){}}function ConvertGeoCurrency(e,t){if(void 0===t&&(t=""),e!=GeoDefaultCountryCode&&$(t+" .geolify-currency").length&&e in GeoCurrencyList&&!(e in GeoCurrencyExcludeList)){var o=toLocaleStringSupportsLocales(),a=GeoDefaultLocale;e in GeoLocaleList&&(a=GeoLocaleList[e]),$(t+" .geolify-currency").each((function(){var t=Number($(this).text().replace(/[^0-9.]/g,"")),r=GeoDefaultCurrency,n=GeoCurrencyList[e],i=t;i=Math.ceil(fx.convert(t,{from:r,to:n})),o?"yes"==$(this).attr("data-currency-convert-only")?$(this).html(i.toLocaleString(a,{style:"currency",currency:n})+" "+n):$(this).html($(this).text()+" "+r+"<br /><small>"+i.toLocaleString(a,{style:"currency",currency:n})+" "+n+'&nbsp;&nbsp;<a href="javascript:void(0);" data-toggle="popover" data-container="body" data-placement="top" data-original-title="Currency Converted to '+n+'" data-content="We detected that you are visiting our website from '+e+". As a courtesy, we have made a close approximation of this item's price after converting from "+r+" to "+n+'. Please note that we process all charges in USD, and final prices may vary due to associated credit card fees and exchange rate fluctuations."><i class="fa fa-question-circle" style="font-size: 14px;"></i></a></small>'):"yes"==$(this).attr("data-currency-convert-only")?$(this).html(i.toLocaleString()+" "+n):$(this).html(i.toLocaleString()+" "+n+'</small> B<a href="javascript:void(0);" data-toggle="popover" data-container="body" data-placement="top" data-original-title="Currency Converted to '+n+'" data-content="We detected that you are visiting our website from '+e+". As a courtesy, we have made a close approximation of this item's price after converting from "+r+" to "+n+'. Please note that we process all charges in USD, and final prices may vary due to associated credit card fees and exchange rate fluctuations."><i class="fa fa-question-circle" style="font-size: 14px;"></i></a><br /><small>'+$(this).text()+" "+r+"</small>")}))}if(e!=GeoDefaultCountryCode&&$(t+" .geolify-currency-nobreak").length&&e in GeoCurrencyList&&!(e in GeoCurrencyExcludeList)){o=toLocaleStringSupportsLocales(),a=GeoDefaultLocale;e in GeoLocaleList&&(a=GeoLocaleList[e]),$(t+" .geolify-currency-nobreak").each((function(){var t=Number($(this).text().replace(/[^0-9.]/g,"")),r=GeoDefaultCurrency,n=GeoCurrencyList[e],i=t;i=Math.ceil(fx.convert(t,{from:r,to:n})),o?"yes"==$(this).attr("data-currency-convert-only")?$(this).html(i.toLocaleString(a,{style:"currency",currency:n})+" "+n):$(this).html($(this).text()+" "+r+"&nbsp;&nbsp;(<small>"+i.toLocaleString(a,{style:"currency",currency:n})+" "+n+'&nbsp;&nbsp;<a href="javascript:void(0);" data-toggle="popover" data-container="body" data-placement="top" data-original-title="Currency Converted to '+n+'" data-content="We detected that you are visiting our website from '+e+". As a courtesy, we have made a close approximation of this item's price after converting from "+r+" to "+n+'. Please note that we process all charges in USD, and final prices may vary due to associated credit card fees and exchange rate fluctuations."><i class="fa fa-question-circle" style="font-size: 14px;"></i></a></small>)'):"yes"==$(this).attr("data-currency-convert-only")?$(this).html(i.toLocaleString()+" "+n):$(this).html(i.toLocaleString()+" "+n+'</small> D<a href="javascript:void(0);" data-toggle="popover" data-container="body" data-placement="top" data-original-title="Currency Converted to '+n+'" data-content="We detected that you are visiting our website from '+e+". As a courtesy, we have made a close approximation of this item's price after converting from "+r+" to "+n+'. Please note that we process all charges in USD, and final prices may vary due to associated credit card fees and exchange rate fluctuations."><i class="fa fa-question-circle" style="font-size: 14px;"></i></a> (<small>'+$(this).text()+" "+r+"</small>)")}))}var r,n;e!=GeoDefaultCountryCode&&$(".geolify-exchange-from").length&&e in GeoCurrencyList&&!(e in GeoCurrencyExcludeList)&&((r=GeoDefaultCurrency)!=(n=GeoCurrencyList[e])&&$(".geolify-exchange-from").html(r));e!=GeoDefaultCountryCode&&$(".geolify-exchange-to").length&&e in GeoCurrencyList&&!(e in GeoCurrencyExcludeList)&&((r=GeoDefaultCurrency)!=(n=GeoCurrencyList[e])&&$(".geolify-exchange-to").html(n))}function GeoIsEmpty(e){if("undefined"===e||""==e||null==e||"undefined"==e)return!0;if("number"==typeof e||"boolean"==typeof e)return!1;if(null==e||null==e)return!0;if(void 0!==e.length)return 0==e.length;var t=0;for(var o in e)e.hasOwnProperty(o)&&t++;return 0==t}function toLocaleStringSupportsLocales(){try{(0).toLocaleString("i")}catch(e){return"RangeError"===e.name}return!1}function getParameterByName(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(location.search);return null==t?"":decodeURIComponent(t[1].replace(/\+/g," "))}function ReadCountryCookie(){try{return unescape((document.cookie.match("(^|; )nsc-visitor-country-code=([^;]*)")||0)[2])}catch(e){return""}}function SetCountryCookie(e){var t=new Date;t.setTime(t.getTime()+864e5*(GeoCookieExpiration||1)),document.cookie="nsc-visitor-country-code="+escape(e)+";expires="+t.toGMTString()+";path=/"}function RemoveCountryCookie(){document.cookie="nsc-visitor-country-code=;expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/"}GeoIsEmpty(ReadCountryCookie())?loadGeoTargetly(document,"script","Live"===GeolifyEnvironment?GeoTargetlyUID_Live:"Staging"===GeolifyEnvironment?GeoTargetlyUID_Staging:GeoTargetlyUID_Development):(GeoCurrentCountry=ReadCountryCookie(),$(document).ready((function(){DisplayGeoContent(GeoCurrentCountry)})));;
/*! fancyBox v2.1.3 fancyapps.com | fancyapps.com/fancybox/#license */
(function(B,x,f,q){var r=f(B),m=f(x),b=f.fancybox=function(){b.open.apply(this,arguments)},u=null,n=x.createTouch!==q,s=function(a){return a&&a.hasOwnProperty&&a instanceof f},p=function(a){return a&&"string"===f.type(a)},E=function(a){return p(a)&&0<a.indexOf("%")},k=function(a,d){var e=parseInt(a,10)||0;d&&E(a)&&(e*=b.getViewport()[d]/100);return Math.ceil(e)},v=function(a,b){return k(a,b)+"px"};f.extend(b,{version:"2.1.3",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,
maxWidth:9999,maxHeight:9999,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!n,fitToView:!0,aspectRatio:!1,topRatio:0.5,leftRatio:0.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3E3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},keys:{next:{13:"left",34:"up",39:"left",40:"up"},
prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+
(f.browser.msie?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",
openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,
isActive:!1,isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=s(a)?f(a).get():[a]),f.each(a,function(e,c){var j={},g,h,i,l,k;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),s(c)?(j={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,
j,c.metadata())):j=c);g=d.href||j.href||(p(c)?c:null);h=d.title!==q?d.title:j.title||"";l=(i=d.content||j.content)?"html":d.type||j.type;!l&&j.isDom&&(l=c.data("fancybox-type"),l||(l=(l=c.prop("class").match(/fancybox\.(\w+)/))?l[1]:null));p(g)&&(l||(b.isImage(g)?l="image":b.isSWF(g)?l="swf":"#"===g.charAt(0)?l="inline":p(c)&&(l="html",i=c)),"ajax"===l&&(k=g.split(/\s+/,2),g=k.shift(),k=k.shift()));i||("inline"===l?g?i=f(p(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):j.isDom&&(i=c):"html"===l?i=g:!l&&(!g&&
j.isDom)&&(l="inline",i=c));f.extend(j,{href:g,type:l,content:i,title:h,selector:k});a[e]=j}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==q&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current||
b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer=
setTimeout(b.next,b.current.playSpeed))},c=function(){d();f("body").unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index<b.group.length-1))b.player.isActive=!0,f("body").bind({"afterShow.player onUpdate.player":e,"onCancel.player beforeClose.player":c,"beforeLoad.player":d}),e(),b.trigger("onPlayStart")}else c()},next:function(a){var d=b.current;d&&(p(a)||(a=d.direction.next),b.jumpto(d.index+1,a,"next"))},
prev:function(a){var d=b.current;d&&(p(a)||(a=d.direction.prev),b.jumpto(d.index-1,a,"prev"))},jumpto:function(a,d,e){var c=b.current;c&&(a=k(a),b.direction=d||c.direction[a>=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==q&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,j;c&&(j=b._getPosition(d),a&&"scroll"===a.type?(delete j.position,c.stop(!0,!0).animate(j,200)):(c.css(j),e.pos=f.extend({},
e.dim,j)))},update:function(a){var d=a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(u),u=null);b.isOpen&&!u&&(u=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),u=null)},e&&!n?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,n&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),
b.trigger("onUpdate")),b.update())},hideLoading:function(){m.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('<div id="fancybox-loading"><div></div></div>').click(b.cancel).appendTo("body");m.bind("keydown.loading",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||
!1,d={x:r.scrollLeft(),y:r.scrollTop()};a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=n&&B.innerWidth?B.innerWidth:r.width(),d.h=n&&B.innerHeight?B.innerHeight:r.height());return d},unbindEvents:function(){b.wrap&&s(b.wrap)&&b.wrap.unbind(".fb");m.unbind(".fb");r.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(r.bind("orientationchange.fb"+(n?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&m.bind("keydown.fb",function(e){var c=e.which||e.keyCode,j=
e.target||e.srcElement;if(27===c&&b.coming)return!1;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!j||!j.type&&!f(j).is("[contenteditable]")))&&f.each(d,function(d,j){if(1<a.group.length&&j[c]!==q)return b[d](j[c]),e.preventDefault(),!1;if(-1<f.inArray(c,j))return b[d](),e.preventDefault(),!1})}),f.fn.mousewheel&&a.mouseWheel&&b.wrap.bind("mousewheel.fb",function(d,c,j,g){for(var h=f(d.target||null),i=!1;h.length&&!i&&!h.is(".fancybox-skin")&&!h.is(".fancybox-wrap");)i=h[0]&&!(h[0].style.overflow&&
"hidden"===h[0].style.overflow)&&(h[0].clientWidth&&h[0].scrollWidth>h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==c&&!i&&1<b.group.length&&!a.canShrink){if(0<g||0<j)b.prev(0<g?"down":"left");else if(0>g||0>j)b.next(0>g?"up":"right");d.preventDefault()}}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,
e){e&&(b.helpers[d]&&f.isFunction(b.helpers[d][a]))&&(e=f.extend(!0,{},b.helpers[d].defaults,e),b.helpers[d][a](e,c))});f.event.trigger(a+".fb")}},isImage:function(a){return p(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|img)((\?|#).*)?$)/i)},isSWF:function(a){return p(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c,a=k(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&
(d.padding=[c,c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=
!0;if("image"===c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio=!0);"iframe"===c&&n&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(n?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,v(d.padding[a]))});b.trigger("onReady");
if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");"image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width=
this.width;b.coming.height=this.height;b._afterLoad()};a.onerror=function(){this.onload=this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,
(new Date).getTime())).attr("scrolling",n?"auto":a.iframe.scrolling).attr("src",a.href);f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);n||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a=
b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,j,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());b.unbindEvents();
e=a.content;c=a.type;j=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin,outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("<div>").html(e).find(a.selector):s(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",
!1)}));break;case "image":e=a.tpl.image.replace("{href}",g);break;case "swf":e='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+g+'"></param>',h="",f.each(a.swf,function(a,b){e+='<param name="'+a+'" value="'+b+'"></param>';h+=" "+a+'="'+b+'"'}),e+='<embed src="'+g+'" type="application/x-shockwave-flash" width="100%" height="100%"'+h+"></embed></object>"}(!s(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow");
a.inner.css("overflow","yes"===j?"scroll":"no"===j?"hidden":j);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.prevMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,j=b.skin,g=b.inner,h=b.current,c=h.width,i=h.height,l=h.minWidth,t=h.minHeight,m=h.maxWidth,
n=h.maxHeight,r=h.scrolling,p=h.scrollOutside?h.scrollbarWidth:0,w=h.margin,y=k(w[1]+w[3]),q=k(w[0]+w[2]),x,z,s,C,A,F,B,D,u;e.add(j).add(g).width("auto").height("auto").removeClass("fancybox-tmp");w=k(j.outerWidth(!0)-j.width());x=k(j.outerHeight(!0)-j.height());z=y+w;s=q+x;C=E(c)?(a.w-z)*k(c)/100:c;A=E(i)?(a.h-s)*k(i)/100:i;if("iframe"===h.type){if(u=h.content,h.autoHeight&&1===u.data("ready"))try{u[0].contentWindow.document.location&&(g.width(C).height(9999),F=u.contents().find("body"),p&&F.css("overflow-x",
"hidden"),A=F.height())}catch(G){}}else if(h.autoWidth||h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(C),h.autoHeight||g.height(A),h.autoWidth&&(C=g.width()),h.autoHeight&&(A=g.height()),g.removeClass("fancybox-tmp");c=k(C);i=k(A);D=C/A;l=k(E(l)?k(l,"w")-z:l);m=k(E(m)?k(m,"w")-z:m);t=k(E(t)?k(t,"h")-s:t);n=k(E(n)?k(n,"h")-s:n);F=m;B=n;h.fitToView&&(m=Math.min(a.w-z,m),n=Math.min(a.h-s,n));z=a.w-y;q=a.h-q;h.aspectRatio?(c>m&&(c=m,i=k(c/D)),i>n&&(i=n,c=k(i*D)),c<l&&(c=l,i=k(c/D)),i<t&&
(i=t,c=k(i*D))):(c=Math.max(l,Math.min(c,m)),h.autoHeight&&"iframe"!==h.type&&(g.width(c),i=g.height()),i=Math.max(t,Math.min(i,n)));if(h.fitToView)if(g.width(c).height(i),e.width(c+w),a=e.width(),y=e.height(),h.aspectRatio)for(;(a>z||y>q)&&(c>l&&i>t)&&!(19<d++);)i=Math.max(t,Math.min(n,i-10)),c=k(i*D),c<l&&(c=l,i=k(c/D)),c>m&&(c=m,i=k(c/D)),g.width(c).height(i),e.width(c+w),a=e.width(),y=e.height();else c=Math.max(l,Math.min(c,c-(a-z))),i=Math.max(t,Math.min(i,i-(y-q)));p&&("auto"===r&&i<A&&c+w+
p<z)&&(c+=p);g.width(c).height(i);e.width(c+w);a=e.width();y=e.height();e=(a>z||y>q)&&c>l&&i>t;c=h.aspectRatio?c<F&&i<B&&c<C&&i<A:(c<F||i<B)&&(c<C||i<A);f.extend(h,{dim:{width:v(a),height:v(y)},origWidth:C,origHeight:A,canShrink:e,canExpand:c,wPadding:w,hPadding:x,wrapSpace:y-j.outerHeight(!0),skinSpace:j.height()-i});!u&&(h.autoHeight&&i>t&&i<n&&!c)&&g.height("auto")},_getPosition:function(a){var d=b.current,e=b.getViewport(),c=d.margin,f=b.wrap.width()+c[1]+c[3],g=b.wrap.height()+c[0]+c[2],c={position:"absolute",
top:c[0],left:c[3]};d.autoCenter&&d.fixed&&!a&&g<=e.h&&f<=e.w?c.position="fixed":d.locked||(c.top+=e.y,c.left+=e.x);c.top=v(Math.max(c.top,c.top+(e.h-g)*d.topRatio));c.left=v(Math.max(c.left,c.left+(e.w-f)*d.leftRatio));return c},_afterZoomIn:function(){var a=b.current;a&&(b.isOpen=b.isOpened=!0,b.wrap.css("overflow","visible").addClass("fancybox-opened"),b.update(),(a.closeClick||a.nextClick&&1<b.group.length)&&b.inner.css("cursor","pointer").bind("click.fb",function(d){!f(d.target).is("a")&&!f(d.target).parent().is("a")&&
(d.preventDefault(),b[a.closeClick?"close":"next"]())}),a.closeBtn&&f(a.tpl.closeBtn).appendTo(b.skin).bind(n?"touchstart.fb":"click.fb",function(a){a.preventDefault();b.close()}),a.arrows&&1<b.group.length&&((a.loop||0<a.index)&&f(a.tpl.prev).appendTo(b.outer).bind("click.fb",b.prev),(a.loop||a.index<b.group.length-1)&&f(a.tpl.next).appendTo(b.outer).bind("click.fb",b.next)),b.trigger("afterShow"),!a.loop&&a.index===a.group.length-1?b.play(!1):b.opts.autoPlay&&!b.player.isActive&&(b.opts.autoPlay=
!1,b.play()))},_afterZoomOut:function(a){a=a||b.current;f(".fancybox-wrap").trigger("onReset").remove();f.extend(b,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null});b.trigger("afterClose",a)}});b.transitions={getOrigPosition:function(){var a=b.current,d=a.element,e=a.orig,c={},f=50,g=50,h=a.hPadding,i=a.wPadding,l=b.getViewport();!e&&(a.isDom&&d.is(":visible"))&&(e=d.find("img:first"),e.length||(e=d));s(e)?(c=e.offset(),
e.is("img")&&(f=e.outerWidth(),g=e.outerHeight())):(c.top=l.y+(l.h-g)*a.topRatio,c.left=l.x+(l.w-f)*a.leftRatio);if("fixed"===b.wrap.css("position")||a.locked)c.top-=l.y,c.left-=l.x;return c={top:v(c.top-h*a.topRatio),left:v(c.left-i*a.leftRatio),width:v(f+i),height:v(g+h)}},step:function(a,d){var e,c,f=d.prop;c=b.current;var g=c.wrapSpace,h=c.skinSpace;if("width"===f||"height"===f)e=d.end===d.start?1:(a-d.start)/(d.end-d.start),b.isClosing&&(e=1-e),c="width"===f?c.wPadding:c.hPadding,c=a-c,b.skin[f](k("width"===
f?c:c-g*e)),b.inner[f](k("width"===f?c:c-g*e-h*e))},zoomIn:function(){var a=b.current,d=a.pos,e=a.openEffect,c="elastic"===e,j=f.extend({opacity:1},d);delete j.position;c?(d=this.getOrigPosition(),a.openOpacity&&(d.opacity=0.1)):"fade"===e&&(d.opacity=0.1);b.wrap.css(d).animate(j,{duration:"none"===e?0:a.openSpeed,easing:a.openEasing,step:c?this.step:null,complete:b._afterZoomIn})},zoomOut:function(){var a=b.current,d=a.closeEffect,e="elastic"===d,c={opacity:0.1};e&&(c=this.getOrigPosition(),a.closeOpacity&&
(c.opacity=0.1));b.wrap.animate(c,{duration:"none"===d?0:a.closeSpeed,easing:a.closeEasing,step:e?this.step:null,complete:b._afterZoomOut})},changeIn:function(){var a=b.current,d=a.nextEffect,e=a.pos,c={opacity:1},f=b.direction,g;e.opacity=0.1;"elastic"===d&&(g="down"===f||"up"===f?"top":"left","down"===f||"right"===f?(e[g]=v(k(e[g])-200),c[g]="+=200px"):(e[g]=v(k(e[g])+200),c[g]="-=200px"));"none"===d?b._afterZoomIn():b.wrap.css(e).animate(c,{duration:a.nextSpeed,easing:a.nextEasing,complete:function(){setTimeout(b._afterZoomIn,
20)}})},changeOut:function(){var a=b.previous,d=a.prevEffect,e={opacity:0.1},c=b.direction;"elastic"===d&&(e["down"===c||"up"===c?"top":"left"]=("up"===c||"left"===c?"-":"+")+"=200px");a.wrap.animate(e,{duration:"none"===d?0:a.prevSpeed,easing:a.prevEasing,complete:function(){f(this).trigger("onReset").remove()}})}};b.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!n,fixed:!0},overlay:null,fixed:!1,create:function(a){a=f.extend({},this.defaults,a);this.overlay&&this.close();
this.overlay=f('<div class="fancybox-overlay"></div>').appendTo("body");this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this,a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(r.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay",function(a){f(a.target).hasClass("fancybox-overlay")&&
(b.isActive?b.close():d.close())});this.overlay.css(a.css).show()},close:function(){f(".fancybox-overlay").remove();r.unbind("resize.overlay");this.overlay=null;!1!==this.margin&&(f("body").css("margin-right",this.margin),this.margin=!1);this.el&&this.el.removeClass("fancybox-lock")},update:function(){var a="100%",b;this.overlay.width(a).height("100%");f.browser.msie?(b=Math.max(x.documentElement.offsetWidth,x.body.offsetWidth),m.width()>b&&(a=m.width())):m.width()>r.width()&&(a=m.width());this.overlay.width(a).height(m.height())},
onReady:function(a,b){f(".fancybox-overlay").stop(!0,!0);this.overlay||(this.margin=m.height()>r.height()||"scroll"===f("body").css("overflow-y")?f("body").css("margin-right"):!1,this.el=x.all&&!x.querySelector?f("html"):f("body"),this.create(a));a.locked&&this.fixed&&(b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){b.locked&&(this.el.addClass("fancybox-lock"),!1!==this.margin&&f("body").css("margin-right",k(this.margin)+
b.scrollbarWidth));this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.isActive&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d=b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(p(e)&&""!==f.trim(e)){d=f('<div class="fancybox-title fancybox-title-'+c+'-wrap">'+e+"</div>");switch(c){case "inside":c=b.skin;break;case "outside":c=
b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),f.browser.msie&&d.width(d.width()),d.wrapInner('<span class="child"></span>'),b.current.margin[2]+=Math.abs(k(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d,e=f(this),c=this.selector||"",j=function(g){var h=f(this).blur(),i=d,j,k;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(j=a.groupAttr||"data-fancybox-group",k=h.attr(j),k||(j="rel",
k=h.get(0)[j]),k&&(""!==k&&"nofollow"!==k)&&(h=c.length?f(c):e,h=h.filter("["+j+'="'+k+'"]'),i=h.index(this)),a.index=i,!1!==b.open(h,a)&&g.preventDefault())},a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",j):m.undelegate(c,"click.fb-start").delegate(c+":not('.fancybox-item, .fancybox-nav')","click.fb-start",j);this.filter("[data-fancybox-start=1]").trigger("click");return this};m.ready(function(){f.scrollbarWidth===q&&(f.scrollbarWidth=function(){var a=f('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),
b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===q){var a=f.support,d=f('<div style="position:fixed;top:20px;"></div>').appendTo("body"),e=20===d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")})})})(window,document,jQuery);;
!function(r){r.fancybox.helpers.thumbs={defaults:{width:50,height:50,position:"bottom",source:function(t){var i;return t.element&&(i=r(t.element).find("img").attr("src")),!i&&"image"===t.type&&t.href&&(i=t.href),i}},wrap:null,list:null,width:0,init:function(t,i){for(var n=this,l=t.width,a=t.height,h=t.source,e="",s=0;s<i.group.length;s++)e+='<li><a style="width:'+l+"px;height:"+a+'px;" href="javascript:jQuery.fancybox.jumpto('+s+');"></a></li>';this.wrap=r('<div id="fancybox-thumbs"></div>').addClass(t.position).appendTo("body"),this.list=r("<ul>"+e+"</ul>").appendTo(this.wrap),r.each(i.group,function(o){var t=h(i.group[o]);t&&r("<img />").load(function(){var t,i,h,e=this.width,s=this.height;n.list&&e&&s&&(t=e/l,i=s/a,h=n.list.children().eq(o).find("a"),1<=t&&1<=i&&(s=i<t?(e=Math.floor(e/i),a):(e=l,Math.floor(s/t))),r(this).css({width:e,height:s,top:Math.floor(a/2-s/2),left:Math.floor(l/2-e/2)}),h.width(l).height(a),r(this).hide().appendTo(h).fadeIn(300))}).attr("src",t)}),this.width=this.list.children().eq(0).outerWidth(!0),this.list.width(this.width*(i.group.length+1)).css("left",Math.floor(.5*r(window).width()-(i.index*this.width+.5*this.width)))},beforeLoad:function(t,i){i.group.length<2?i.helpers.thumbs=!1:i.margin["top"===t.position?0:2]+=t.height+15},afterShow:function(t,i){this.list?this.onUpdate(t,i):this.init(t,i),this.list.children().removeClass("active").eq(i.index).addClass("active")},onUpdate:function(t,i){this.list&&this.list.stop(!0).animate({left:Math.floor(.5*r(window).width()-(i.index*this.width+.5*this.width))},150)},beforeClose:function(){this.wrap&&this.wrap.remove(),this.wrap=null,this.list=null,this.width=0}}}(jQuery);;
!function(i){var n=i.fancybox;n.helpers.buttons={defaults:{skipSingle:!1,position:"top",tpl:'<div id="fancybox-buttons"><ul><li><a class="btnPrev" title="Previous" href="javascript:;"></a></li><li><a class="btnPlay" title="Start slideshow" href="javascript:;"></a></li><li><a class="btnNext" title="Next" href="javascript:;"></a></li><li><a class="btnToggle" title="Toggle size" href="javascript:;"></a></li><li><a class="btnClose" title="Close" href="javascript:jQuery.fancybox.close();"></a></li></ul></div>'},list:null,buttons:null,beforeLoad:function(t,s){if(t.skipSingle&&s.group.length<2)return s.helpers.buttons=!1,void(s.closeBtn=!0);s.margin["bottom"===t.position?2:0]+=30},onPlayStart:function(){this.buttons&&this.buttons.play.attr("title","Pause slideshow").addClass("btnPlayOn")},onPlayEnd:function(){this.buttons&&this.buttons.play.attr("title","Start slideshow").removeClass("btnPlayOn")},afterShow:function(t,s){var l=this.buttons;l||(this.list=i(t.tpl).addClass(t.position).appendTo("body"),l={prev:this.list.find(".btnPrev").click(n.prev),next:this.list.find(".btnNext").click(n.next),play:this.list.find(".btnPlay").click(n.play),toggle:this.list.find(".btnToggle").click(n.toggle)}),0<s.index||s.loop?l.prev.removeClass("btnDisabled"):l.prev.addClass("btnDisabled"),s.loop||s.index<s.group.length-1?(l.next.removeClass("btnDisabled"),l.play.removeClass("btnDisabled")):(l.next.addClass("btnDisabled"),l.play.addClass("btnDisabled")),this.buttons=l,this.onUpdate(t,s)},onUpdate:function(t,s){var l;this.buttons&&(l=this.buttons.toggle.removeClass("btnDisabled btnToggleOn"),s.canShrink?(l.addClass("btnToggleOn"),i(".fancybox-wrap .zoomImg").remove(),i(".zoom-img-wrap img").unwrap()):s.canExpand||l.addClass("btnDisabled"))},beforeClose:function(){this.list&&this.list.remove(),this.list=null,this.buttons=null}}}(jQuery);;
function init_Assets(e) { init_Assets(e, 1, 7e3) } function init_Assets(e, t, a) { var s = 0, i = 0, n = []; if ($(".AssetViewer").length > 0) if ($(".AssetViewer .Assets .Asset").length > 0) { $(".PostLoadAsset") && $(".PostLoadAsset").each((function () { var e = ""; $.each(this.attributes, (function () { e += " " + ("relhref" == this.name ? "href" : this.name) + '="' + this.value + '"' })), $(this).replaceWith("<a" + e + ">" + $(this).html() + "</a>") })), $(".AssetViewer .Assets .Asset:first").addClass("ActiveAsset").css("display", "block"); var d = ""; if ($(".AssetViewer .Assets .Asset").each((function () { "html" == $(this).data("type") ? (i++, n.push({ html: $(this).html(), idx: i }), $(this).remove()) : d += add_Thumb_Asset(this, s += 1, 74, 74, e, i) })), $(".AssetViewer .ThumbAssets").html(d), $(".AssetViewer .ThumbAssets .ThumbAsset:first").addClass("ActiveThumbAsset"), n.length > 0) { var l = n[0].idx; if ($(".AssetViewer .ThumbAssets").attr("data-group-index", l), n.length > 1) for (var o = 1; o < n.length; o++)$(".AssetViewer").append($(".AssetViewer .ThumbAssets[data-group-index='" + n[o - 1].idx + "']").clone().attr("data-group-index", n[o].idx)); for (var r = 0; r < n.length; r++)$(".AssetViewer .ThumbAssets[data-group-index='" + n[r].idx + "']").before(n[r].html), $(".AssetViewer .ThumbAssets[data-group-index='" + n[r].idx + "'] .ThumbAsset[data-group-index!='" + n[r].idx + "']").remove() } $(".Assets .Asset a").fancybox({ margin: 20, padding: 0, maxWidth: 1380, height: "auto", autoSize: !1, autoWidth: !0, autoHeight: !0, fitToView: !0, aspectRatio: !0, nextEffect: "elastic", prevEffect: "elastic", tpl: { closeBtn: '<a title="Close" class="fancybox-item fancybox-close" href="javascript:jQuery.fancybox.close();"></a>' }, helpers: { title: null, buttons: { skipSingle: !0, position: "bottom", tpl: '<div id="fancybox-buttons"><ul><li><a class="btnPrev" title="Previous" href="javascript:;"></a></li><li><a class="btnNext" title="Next" href="javascript:;"></a></li><li><a class="btnToggle" title="Toggle size" href="javascript:;"></a></li><li><a class="btnClose" title="Close" href="javascript:jQuery.fancybox.close();"></a></li></ul></div>' } }, beforeShow: function () { }, beforeLoad: function () { try { this.title = $(this.element).find("img").attr("alt"), this.fitToView = $(this.element).closest(".Asset") } catch (e) { console.log(e.message) } if (this.element.attr("data-caption") || this.element.attr("data-caption-title")) { var e = this.element.attr("data-caption-title"), t = this.element.attr("data-caption"); $(e).length > 0 ? this.tpl.wrap = '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin" style="background: transparent !important;"><div class="fancybox-outer"><div class="fancybox-inner"></div><div class="fancybox-caption"><div class="fancybox-caption-inner p-a-md"><div class="fancybox-caption-title h3">' + e + '</div><p class="m-b-0">' + t + "</p></div></div></div></div></div>" : this.tpl.wrap = '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin" style="background: transparent !important;"><div class="fancybox-outer"><div class="fancybox-inner"></div><div class="fancybox-caption"><div class="fancybox-caption-inner p-a-md"><p class="m-b-0">' + t + "</p></div></div></div></div></div>" } else void 0 !== this.element.attr("data-type") && "hlsVideo" === this.element.attr("data-type") && (this.tpl.wrap = '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin" style="background: transparent !important;"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>') }, afterLoad: function (e) { swap_HeroAsset(e.element.parent().attr("data-index")); var t = e.element.parent().attr("data-type"); switch (t) { case "flash": try { ga("send", "event", "Product Video", "Product Video Opened", t) } catch (e) { } break; case "java3d": case "flash3d": try { ga("send", "event", "Product 3D Viewer", "Product 3D Viewer Opened", t) } catch (e) { } break; case "hls-video": try { $("video[data-index='" + e.element.parent().attr("data-index") + "']").get(0).play() } catch (e) { } try { ga("send", "event", "Phone Video", "Phone Viewer Opened", t) } catch (e) { } } }, afterShow: function (e) { $(".fancybox-image").wrap('<div class="zoom-img-wrap"></div>').parent().zoom({ on: "grab" }) }, afterClose: function (e) { if ("hls-video" == e.element.parent().attr("data-type")) try { $("video[data-index='" + e.element.parent().attr("data-index") + "']").get(0).pause() } catch (e) { } } }), e && reset_Asset_Timer(a, s, e, t) } else $(".AssetViewer .DefaultAsset").show(), $(".AssetViewer .Assets").hide(), $(".AssetViewer .ThumbAssets").hide() } function reset_Asset_Timer(e, t, a, s) { $(document).everyTime(e, "AssetTimer", (function (e) { index = Number($(".AssetViewer .Assets .ActiveAsset").attr("data-index")), index = index == t ? index = 1 : index += 1, load_Asset(index, $('.AssetViewer .Assets .Asset[data-index="' + index + '"]').attr("data-type"), !0, a) }), t * s) } function add_Thumb_Asset(e, t, a, s, i, n) { if ($(e).attr("data-thumbnail-overlay")) ThumbAsset = '<li class="ThumbAsset" data-group-index="' + n + '" data-index="' + $(e).attr("data-index") + '"><img alt="Preview Image of Item for 360 Interactive View" style="opacity:.4" src="' + $(e).attr("data-thumbnail") + '" onclick="load_Asset(' + $(e).attr("data-index") + ", '" + $(e).attr("data-type") + "', false, " + i + ');" /><img alt="360 Interactive Icon Overlay" src="' + $(e).attr("data-thumbnail-overlay") + '" onclick="load_Asset(' + $(e).attr("data-index") + ", '" + $(e).attr("data-type") + "', false, " + i + ');" style="position:absolute;top:2px;left:13%;width:75%;"></li>'; else if ($(e).attr("data-hls-overlay")) ThumbAsset = '<li class="ThumbAsset" data-group-index="' + n + '" data-index="' + $(e).attr("data-index") + '"><img alt="Screenshot Icon of Phone Video Showcasing Item in Hand for Size Comparison" class="hls-replace" src="' + $(e).attr("data-thumbnail") + '" onclick="load_Asset(' + $(e).attr("data-index") + ", '" + $(e).attr("data-type") + "', false, " + i + ');" /><img alt="Play Icon Overlay" class="hls-overlay" src="' + $(e).attr("data-hls-overlay") + '" onclick="load_Asset(' + $(e).attr("data-index") + ", '" + $(e).attr("data-type") + "', false, " + i + ');"></li>'; else if ("ring-model" === $(e).attr("data-type")) ThumbAsset = '<li class="ThumbAsset" data-group-index="' + n + '" data-index="' + $(e).attr("data-index") + '"><div class="imageModelContainer"><img alt="Icon Image of Model Hand from Above with Light Skin Tone" src="/app_templates/skin_1/images/models/ring/light.png" data-type="light" class="imageModelDefault"><img alt="Icon Image of Model Hand from Above with Medium Skin Tone" src="/app_templates/skin_1/images/models/ring/medium.png" data-type="medium"><img alt="Icon Image of Model Hand from Above with Dark Skin Tone" src="/app_templates/skin_1/images/models/ring/dark.png" data-type="dark"><img alt="Icon Image of Ring Overlayed Over Model Wearing the Ring" src="' + $(e).attr("data-thumbnail") + '" onclick="load_Asset(' + $(e).attr("data-index") + ", '" + $(e).attr("data-type") + "', false, " + i + ');" /></div></li>'; else if ("earring-model" === $(e).attr("data-type")) ThumbAsset = '<li class="ThumbAsset" data-group-index="' + n + '" data-index="' + $(e).attr("data-index") + '"><div class="imageModelContainer zoomModelContainer"><img alt="Icon Image of Model Face From Side with Light Skin Tone" src="/app_templates/skin_1/images/models/earring/light.png" data-type="light" class="imageModelDefault"><img alt="Icon Image of Model Face From Side with Medium Skin Tone" src="/app_templates/skin_1/images/models/earring/medium.png" data-type="medium"><img alt="Icon Image of Model Face From Side with Dark Skin Tone" src="/app_templates/skin_1/images/models/earring/dark.png" data-type="dark"><img alt="Icon Image of Earrings Overlayed Over Model Wearing the Earrings" src="' + $(e).attr("data-thumbnail") + '" onclick="load_Asset(' + $(e).attr("data-index") + ", '" + $(e).attr("data-type") + "', false, " + i + ');" /></div></li>'; else if ("necklace-model" === $(e).attr("data-type")) ThumbAsset = '<li class="ThumbAsset" data-group-index="' + n + '" data-index="' + $(e).attr("data-index") + '"><div class="imageModelContainer"><img alt="Icon Image of Model Neck with Light Skin Tone" src="/app_templates/skin_1/images/models/necklace/light.png" data-type="light" class="imageModelDefault"><img alt="Icon Image of Model Neck with Medium Skin Tone" src="/app_templates/skin_1/images/models/necklace/medium.png" data-type="medium"><img alt="Icon Image of Model Neck with Dark Skin Tone" src="/app_templates/skin_1/images/models/necklace/dark.png" data-type="dark"><img alt="Icon Image of Necklace Overlayed Over Model Wearing the Necklace" src="' + $(e).attr("data-thumbnail") + '" onclick="load_Asset(' + $(e).attr("data-index") + ", '" + $(e).attr("data-type") + "', false, " + i + ');" /></div></li>'; else if ("pendant-model" === $(e).attr("data-type")) ThumbAsset = '<li class="ThumbAsset" data-group-index="' + n + '" data-index="' + $(e).attr("data-index") + '"><div class="imageModelContainer"><img alt="Icon Image of Model Neck with Light Skin Tone" src="/app_templates/skin_1/images/models/pendant/light.png" data-type="light" class="imageModelDefault"><img alt="Icon Image of Model Neck with Medium Skin Tone" src="/app_templates/skin_1/images/models/pendant/medium.png" data-type="medium"><img alt="Icon Image of Model Neck with Dark Skin Tone" src="/app_templates/skin_1/images/models/pendant/dark.png" data-type="dark"><img alt="Icon Image of Pendant Overlayed Over Model Wearing the Pendant" src="' + $(e).attr("data-thumbnail") + '" onclick="load_Asset(' + $(e).attr("data-index") + ", '" + $(e).attr("data-type") + "', false, " + i + ');" /></div></li>'; else { let t = $(e).find("img").first().attr("alt") || ""; ThumbAsset = '<li class="ThumbAsset" data-group-index="' + n + '" data-index="' + $(e).attr("data-index") + '"><img alt="Icon of ' + t + '" src="' + $(e).attr("data-thumbnail") + '" onclick="load_Asset(' + $(e).attr("data-index") + ", '" + $(e).attr("data-type") + "', false, " + i + ');" /></li>' } return ThumbAsset } function swap_HeroAsset(e) { $(".Assets .Asset").removeClass("ActiveAsset").css("display", "none"), $('.Assets .Asset[data-index="' + e + '"]').addClass("ActiveAsset").css("display", "block"), $(".ThumbAssets .ThumbAsset").removeClass("ActiveThumbAsset"), $('.ThumbAssets .ThumbAsset[data-index="' + e + '"]').addClass("ActiveThumbAsset") } function load_Asset(e, t, a, s) { var i = swap_HeroAsset(e); return $.when(i).done((function () { if (!a) switch (s && $(document).stopTime("AssetTimer"), t) { case "flash3d": case "flash": case "java3d": case "hls-video": $('.Asset[data-index="' + e + '"] a').trigger("click") } })), !1 }function init_Assets(e){init_Assets(e,1,7e3)}function init_Assets(e,t,a){var s=0,i=0,n=[];if($(".AssetViewer").length>0)if($(".AssetViewer .Assets .Asset").length>0){$(".PostLoadAsset")&&$(".PostLoadAsset").each((function(){var e="";$.each(this.attributes,(function(){e+=" "+("relhref"==this.name?"href":this.name)+'="'+this.value+'"'})),$(this).replaceWith("<a"+e+">"+$(this).html()+"</a>")})),$(".AssetViewer .Assets .Asset:first").addClass("ActiveAsset").css("display","block");var d="";if($(".AssetViewer .Assets .Asset").each((function(){"html"==$(this).data("type")?(i++,n.push({html:$(this).html(),idx:i}),$(this).remove()):d+=add_Thumb_Asset(this,s+=1,74,74,e,i)})),$(".AssetViewer .ThumbAssets").html(d),$(".AssetViewer .ThumbAssets .ThumbAsset:first").addClass("ActiveThumbAsset"),n.length>0){var l=n[0].idx;if($(".AssetViewer .ThumbAssets").attr("data-group-index",l),n.length>1)for(var o=1;o<n.length;o++)$(".AssetViewer").append($(".AssetViewer .ThumbAssets[data-group-index='"+n[o-1].idx+"']").clone().attr("data-group-index",n[o].idx));for(var r=0;r<n.length;r++)$(".AssetViewer .ThumbAssets[data-group-index='"+n[r].idx+"']").before(n[r].html),$(".AssetViewer .ThumbAssets[data-group-index='"+n[r].idx+"'] .ThumbAsset[data-group-index!='"+n[r].idx+"']").remove()}$(".Assets .Asset a").fancybox({margin:20,padding:0,maxWidth:1380,height:"auto",autoSize:!1,autoWidth:!0,autoHeight:!0,fitToView:!0,aspectRatio:!0,nextEffect:"elastic",prevEffect:"elastic",tpl:{closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:jQuery.fancybox.close();"></a>'},helpers:{title:null,buttons:{skipSingle:!0,position:"bottom",tpl:'<div id="fancybox-buttons"><ul><li><a class="btnPrev" title="Previous" href="javascript:;"></a></li><li><a class="btnNext" title="Next" href="javascript:;"></a></li><li><a class="btnToggle" title="Toggle size" href="javascript:;"></a></li><li><a class="btnClose" title="Close" href="javascript:jQuery.fancybox.close();"></a></li></ul></div>'}},beforeShow:function(){},beforeLoad:function(){try{this.title=$(this.element).find("img").attr("alt"),this.fitToView=$(this.element).closest(".Asset")}catch(e){console.log(e.message)}if(this.element.attr("data-caption")||this.element.attr("data-caption-title")){var e=this.element.attr("data-caption-title"),t=this.element.attr("data-caption");$(e).length>0?this.tpl.wrap='<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin" style="background: transparent !important;"><div class="fancybox-outer"><div class="fancybox-inner"></div><div class="fancybox-caption"><div class="fancybox-caption-inner p-a-md"><div class="fancybox-caption-title h3">'+e+'</div><p class="m-b-0">'+t+"</p></div></div></div></div></div>":this.tpl.wrap='<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin" style="background: transparent !important;"><div class="fancybox-outer"><div class="fancybox-inner"></div><div class="fancybox-caption"><div class="fancybox-caption-inner p-a-md"><p class="m-b-0">'+t+"</p></div></div></div></div></div>"}else void 0!==this.element.attr("data-type")&&"hlsVideo"===this.element.attr("data-type")&&(this.tpl.wrap='<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin" style="background: transparent !important;"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>')},afterLoad:function(e){swap_HeroAsset(e.element.parent().attr("data-index"));var t=e.element.parent().attr("data-type");switch(t){case"flash":try{ga("send","event","Product Video","Product Video Opened",t)}catch(e){}break;case"java3d":case"flash3d":try{ga("send","event","Product 3D Viewer","Product 3D Viewer Opened",t)}catch(e){}break;case"hls-video":try{$("video[data-index='"+e.element.parent().attr("data-index")+"']").get(0).play()}catch(e){}try{ga("send","event","Phone Video","Phone Viewer Opened",t)}catch(e){}}},afterShow:function(e){$(".fancybox-image").wrap('<div class="zoom-img-wrap"></div>').parent().zoom({on:"grab"})},afterClose:function(e){if("hls-video"==e.element.parent().attr("data-type"))try{$("video[data-index='"+e.element.parent().attr("data-index")+"']").get(0).pause()}catch(e){}}}),e&&reset_Asset_Timer(a,s,e,t)}else $(".AssetViewer .DefaultAsset").show(),$(".AssetViewer .Assets").hide(),$(".AssetViewer .ThumbAssets").hide()}function reset_Asset_Timer(e,t,a,s){$(document).everyTime(e,"AssetTimer",(function(e){index=Number($(".AssetViewer .Assets .ActiveAsset").attr("data-index")),index=index==t?index=1:index+=1,load_Asset(index,$('.AssetViewer .Assets .Asset[data-index="'+index+'"]').attr("data-type"),!0,a)}),t*s)}function add_Thumb_Asset(e,t,a,s,i,n){if($(e).attr("data-thumbnail-overlay"))ThumbAsset='<li class="ThumbAsset" data-group-index="'+n+'" data-index="'+$(e).attr("data-index")+'"><img alt="Preview Image of Item for 360 Interactive View" style="opacity:.4" src="'+$(e).attr("data-thumbnail")+'" onclick="load_Asset('+$(e).attr("data-index")+", '"+$(e).attr("data-type")+"', false, "+i+');" /><img alt="360 Interactive Icon Overlay" src="'+$(e).attr("data-thumbnail-overlay")+'" onclick="load_Asset('+$(e).attr("data-index")+", '"+$(e).attr("data-type")+"', false, "+i+');" style="position:absolute;top:2px;left:13%;width:75%;"></li>';else if($(e).attr("data-hls-overlay"))ThumbAsset='<li class="ThumbAsset" data-group-index="'+n+'" data-index="'+$(e).attr("data-index")+'"><img alt="Screenshot Icon of Phone Video Showcasing Item in Hand for Size Comparison" class="hls-replace" src="'+$(e).attr("data-thumbnail")+'" onclick="load_Asset('+$(e).attr("data-index")+", '"+$(e).attr("data-type")+"', false, "+i+');" /><img alt="Play Icon Overlay" class="hls-overlay" src="'+$(e).attr("data-hls-overlay")+'" onclick="load_Asset('+$(e).attr("data-index")+", '"+$(e).attr("data-type")+"', false, "+i+');"></li>';else if("ring-model"===$(e).attr("data-type"))ThumbAsset='<li class="ThumbAsset" data-group-index="'+n+'" data-index="'+$(e).attr("data-index")+'"><div class="imageModelContainer"><img alt="Icon Image of Model Hand from Above with Light Skin Tone" src="/app_templates/skin_1/images/models/ring/light.png" data-type="light" class="imageModelDefault"><img alt="Icon Image of Model Hand from Above with Medium Skin Tone" src="/app_templates/skin_1/images/models/ring/medium.png" data-type="medium"><img alt="Icon Image of Model Hand from Above with Dark Skin Tone" src="/app_templates/skin_1/images/models/ring/dark.png" data-type="dark"><img alt="Icon Image of Ring Overlayed Over Model Wearing the Ring" src="'+$(e).attr("data-thumbnail")+'" onclick="load_Asset('+$(e).attr("data-index")+", '"+$(e).attr("data-type")+"', false, "+i+');" /></div></li>';else if("earring-model"===$(e).attr("data-type"))ThumbAsset='<li class="ThumbAsset" data-group-index="'+n+'" data-index="'+$(e).attr("data-index")+'"><div class="imageModelContainer zoomModelContainer"><img alt="Icon Image of Model Face From Side with Light Skin Tone" src="/app_templates/skin_1/images/models/earring/light.png" data-type="light" class="imageModelDefault"><img alt="Icon Image of Model Face From Side with Medium Skin Tone" src="/app_templates/skin_1/images/models/earring/medium.png" data-type="medium"><img alt="Icon Image of Model Face From Side with Dark Skin Tone" src="/app_templates/skin_1/images/models/earring/dark.png" data-type="dark"><img alt="Icon Image of Earrings Overlayed Over Model Wearing the Earrings" src="'+$(e).attr("data-thumbnail")+'" onclick="load_Asset('+$(e).attr("data-index")+", '"+$(e).attr("data-type")+"', false, "+i+');" /></div></li>';else if("necklace-model"===$(e).attr("data-type"))ThumbAsset='<li class="ThumbAsset" data-group-index="'+n+'" data-index="'+$(e).attr("data-index")+'"><div class="imageModelContainer"><img alt="Icon Image of Model Neck with Light Skin Tone" src="/app_templates/skin_1/images/models/necklace/light.png" data-type="light" class="imageModelDefault"><img alt="Icon Image of Model Neck with Medium Skin Tone" src="/app_templates/skin_1/images/models/necklace/medium.png" data-type="medium"><img alt="Icon Image of Model Neck with Dark Skin Tone" src="/app_templates/skin_1/images/models/necklace/dark.png" data-type="dark"><img alt="Icon Image of Necklace Overlayed Over Model Wearing the Necklace" src="'+$(e).attr("data-thumbnail")+'" onclick="load_Asset('+$(e).attr("data-index")+", '"+$(e).attr("data-type")+"', false, "+i+');" /></div></li>';else if("pendant-model"===$(e).attr("data-type"))ThumbAsset='<li class="ThumbAsset" data-group-index="'+n+'" data-index="'+$(e).attr("data-index")+'"><div class="imageModelContainer"><img alt="Icon Image of Model Neck with Light Skin Tone" src="/app_templates/skin_1/images/models/pendant/light.png" data-type="light" class="imageModelDefault"><img alt="Icon Image of Model Neck with Medium Skin Tone" src="/app_templates/skin_1/images/models/pendant/medium.png" data-type="medium"><img alt="Icon Image of Model Neck with Dark Skin Tone" src="/app_templates/skin_1/images/models/pendant/dark.png" data-type="dark"><img alt="Icon Image of Pendant Overlayed Over Model Wearing the Pendant" src="'+$(e).attr("data-thumbnail")+'" onclick="load_Asset('+$(e).attr("data-index")+", '"+$(e).attr("data-type")+"', false, "+i+');" /></div></li>';else{let t=$(e).find("img").first().attr("alt")||"";ThumbAsset='<li class="ThumbAsset" data-group-index="'+n+'" data-index="'+$(e).attr("data-index")+'"><img alt="Icon of '+t+'" src="'+$(e).attr("data-thumbnail")+'" onclick="load_Asset('+$(e).attr("data-index")+", '"+$(e).attr("data-type")+"', false, "+i+');" /></li>'}return ThumbAsset}function swap_HeroAsset(e){$(".Assets .Asset").removeClass("ActiveAsset").css("display","none"),$('.Assets .Asset[data-index="'+e+'"]').addClass("ActiveAsset").css("display","block"),$(".ThumbAssets .ThumbAsset").removeClass("ActiveThumbAsset"),$('.ThumbAssets .ThumbAsset[data-index="'+e+'"]').addClass("ActiveThumbAsset")}function load_Asset(e,t,a,s){var i=swap_HeroAsset(e);return $.when(i).done((function(){if(!a)switch(s&&$(document).stopTime("AssetTimer"),t){case"flash3d":case"flash":case"java3d":case"hls-video":$('.Asset[data-index="'+e+'"] a').trigger("click")}})),!1};
/*!
	Zoom 1.7.20
	license: MIT
	http://www.jacklmoore.com/zoom
*/
(function(o){var t={url:!1,callback:!1,target:!1,duration:120,on:"mouseover",touch:!0,onZoomIn:!1,onZoomOut:!1,magnify:1};o.zoom=function(t,n,e,i){var u,c,r,a,m,l,s,f=o(t),h=f.css("position"),d=o(n);return t.style.position=/(absolute|fixed)/.test(h)?h:"relative",t.style.overflow="hidden",e.style.width=e.style.height="",o(e).addClass("zoomImg").css({position:"absolute",top:0,left:0,opacity:0,width:e.width*i,height:e.height*i,border:"none",maxWidth:"none",maxHeight:"none"}).appendTo(t),{init:function(){c=f.outerWidth(),u=f.outerHeight(),n===t?(a=c,r=u):(a=d.outerWidth(),r=d.outerHeight()),m=(e.width-c)/a,l=(e.height-u)/r,s=d.offset()},move:function(o){var t=o.pageX-s.left,n=o.pageY-s.top;n=Math.max(Math.min(n,r),0),t=Math.max(Math.min(t,a),0),e.style.left=t*-m+"px",e.style.top=n*-l+"px"}}},o.fn.zoom=function(n){return this.each(function(){var e=o.extend({},t,n||{}),i=e.target&&o(e.target)[0]||this,u=this,c=o(u),r=document.createElement("img"),a=o(r),m="mousemove.zoom",l=!1,s=!1;if(!e.url){var f=u.querySelector("img");if(f&&(e.url=f.getAttribute("data-src")||f.currentSrc||f.src),!e.url)return}c.one("zoom.destroy",function(o,t){c.off(".zoom"),i.style.position=o,i.style.overflow=t,r.onload=null,a.remove()}.bind(this,i.style.position,i.style.overflow)),r.onload=function(){function t(t){f.init(),f.move(t),a.stop().fadeTo(o.support.opacity?e.duration:0,1,o.isFunction(e.onZoomIn)?e.onZoomIn.call(r):!1)}function n(){a.stop().fadeTo(e.duration,0,o.isFunction(e.onZoomOut)?e.onZoomOut.call(r):!1)}var f=o.zoom(i,u,r,e.magnify);"grab"===e.on?c.on("mousedown.zoom",function(e){1===e.which&&(o(document).one("mouseup.zoom",function(){n(),o(document).off(m,f.move)}),t(e),o(document).on(m,f.move),e.preventDefault())}):"click"===e.on?c.on("click.zoom",function(e){return l?void 0:(l=!0,t(e),o(document).on(m,f.move),o(document).one("click.zoom",function(){n(),l=!1,o(document).off(m,f.move)}),!1)}):"toggle"===e.on?c.on("click.zoom",function(o){l?n():t(o),l=!l}):"mouseover"===e.on&&(f.init(),c.on("mouseenter.zoom",t).on("mouseleave.zoom",n).on(m,f.move)),e.touch&&c.on("touchstart.zoom",function(o){o.preventDefault(),s?(s=!1,n()):(s=!0,t(o.originalEvent.touches[0]||o.originalEvent.changedTouches[0]))}).on("touchmove.zoom",function(o){o.preventDefault(),f.move(o.originalEvent.touches[0]||o.originalEvent.changedTouches[0])}).on("touchend.zoom",function(o){o.preventDefault(),s&&(s=!1,n())}),o.isFunction(e.callback)&&e.callback.call(r)},r.setAttribute("role","presentation"),r.src=e.url})},o.fn.zoom.defaults=t})(window.jQuery);;
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Slideout=t()}}(function(){var t,e,n;return function i(t,e,n){function o(s,a){if(!e[s]){if(!t[s]){var u=typeof require=="function"&&require;if(!a&&u)return u(s,!0);if(r)return r(s,!0);var f=new Error("Cannot find module '"+s+"'");throw f.code="MODULE_NOT_FOUND",f}var l=e[s]={exports:{}};t[s][0].call(l.exports,function(e){var n=t[s][1][e];return o(n?n:e)},l,l.exports,i,t,e,n)}return e[s].exports}var r=typeof require=="function"&&require;for(var s=0;s<n.length;s++)o(n[s]);return o}({1:[function(t,e,n){"use strict";var i=t("decouple");var o=t("emitter");var r;var s=false;var a=window.document;var u=a.documentElement;var f=window.navigator.msPointerEnabled;var l={start:f?"MSPointerDown":"touchstart",move:f?"MSPointerMove":"touchmove",end:f?"MSPointerUp":"touchend"};var p=function _(){var t=/^(Webkit|Khtml|Moz|ms|O)(?=[A-Z])/;var e=a.getElementsByTagName("script")[0].style;for(var n in e){if(t.test(n)){return"-"+n.match(t)[0].toLowerCase()+"-"}}if("WebkitOpacity"in e){return"-webkit-"}if("KhtmlOpacity"in e){return"-khtml-"}return""}();function c(t,e){for(var n in e){if(e[n]){t[n]=e[n]}}return t}function h(t,e){t.prototype=c(t.prototype||{},e.prototype)}function d(t){t=t||{};this._startOffsetX=0;this._currentOffsetX=0;this._opening=false;this._moved=false;this._opened=false;this._preventOpen=false;this._touch=t.touch===undefined?true:t.touch&&true;this.panel=t.panel;this.menu=t.menu;this.panel.className+=" slideout-panel";this.menu.className+=" slideout-menu";this._fx=t.fx||"ease";this._duration=parseInt(t.duration,10)||300;this._tolerance=parseInt(t.tolerance,10)||70;this._padding=this._translateTo=parseInt(t.padding,10)||256;this._orientation=t.side==="right"?-1:1;this._translateTo*=this._orientation;if(this._touch){this._initTouchEvents()}}h(d,o);d.prototype.open=function(){var t=this;this.emit("beforeopen");if(u.className.search("slideout-open")===-1){u.className+=" slideout-open"}this._setTransition();this._translateXTo(this._translateTo);this._opened=true;setTimeout(function(){t.panel.style.transition=t.panel.style["-webkit-transition"]="";t.emit("open")},this._duration+50);return this};d.prototype.close=function(){var t=this;if(!this.isOpen()&&!this._opening){return this}this.emit("beforeclose");this._setTransition();this._translateXTo(0);this._opened=false;setTimeout(function(){u.className=u.className.replace(/ slideout-open/,"");t.panel.style.transition=t.panel.style["-webkit-transition"]=t.panel.style[p+"transform"]=t.panel.style.transform="";t.emit("close")},this._duration+50);return this};d.prototype.toggle=function(){return this.isOpen()?this.close():this.open()};d.prototype.isOpen=function(){return this._opened};d.prototype._translateXTo=function(t){this._currentOffsetX=t;this.panel.style[p+"transform"]=this.panel.style.transform="translate3d("+t+"px, 0, 0)"};d.prototype._setTransition=function(){this.panel.style[p+"transition"]=this.panel.style.transition=p+"transform "+this._duration+"ms "+this._fx};d.prototype._initTouchEvents=function(){var t=this;i(a,"scroll",function(){if(!t._moved){clearTimeout(r);s=true;r=setTimeout(function(){s=false},250)}});a.addEventListener(l.move,function(e){if(t._moved){e.preventDefault()}});this.panel.addEventListener(l.start,function(e){if(typeof e.touches==="undefined"){return}t._moved=false;t._opening=false;t._startOffsetX=e.touches[0].pageX;t._preventOpen=!t.isOpen()&&t.menu.clientWidth!==0});this.panel.addEventListener("touchcancel",function(){t._moved=false;t._opening=false});this.panel.addEventListener(l.end,function(){if(t._moved){t._opening&&Math.abs(t._currentOffsetX)>t._tolerance?t.open():t.close()}t._moved=false});this.panel.addEventListener(l.move,function(e){if(s||t._preventOpen||typeof e.touches==="undefined"){return}var n=e.touches[0].clientX-t._startOffsetX;var i=t._currentOffsetX=n;if(Math.abs(i)>t._padding){return}if(Math.abs(n)>20){t._opening=true;var o=n*t._orientation;if(t._opened&&o>0||!t._opened&&o<0){return}if(o<=0){i=n+t._padding*t._orientation;t._opening=false}if(!t._moved&&u.className.search("slideout-open")===-1){u.className+=" slideout-open"}t.panel.style[p+"transform"]=t.panel.style.transform="translate3d("+i+"px, 0, 0)";t.emit("translate",i);t._moved=true}})};e.exports=d},{decouple:2,emitter:3}],2:[function(t,e,n){"use strict";var i=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function o(t,e,n){var o,r=false;function s(t){o=t;a()}function a(){if(!r){i(u);r=true}}function u(){n.call(t,o);r=false}t.addEventListener(e,s,false)}e.exports=o},{}],3:[function(t,e,n){"use strict";var i=function(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}};n.__esModule=true;var o=function(){function t(){i(this,t)}t.prototype.on=function e(t,n){this._eventCollection=this._eventCollection||{};this._eventCollection[t]=this._eventCollection[t]||[];this._eventCollection[t].push(n);return this};t.prototype.once=function n(t,e){var n=this;function i(){n.off(t,i);e.apply(this,arguments)}i.listener=e;this.on(t,i);return this};t.prototype.off=function o(t,e){var n=undefined;if(!this._eventCollection||!(n=this._eventCollection[t])){return this}n.forEach(function(t,i){if(t===e||t.listener===e){n.splice(i,1)}});if(n.length===0){delete this._eventCollection[t]}return this};t.prototype.emit=function r(t){var e=this;for(var n=arguments.length,i=Array(n>1?n-1:0),o=1;o<n;o++){i[o-1]=arguments[o]}var r=undefined;if(!this._eventCollection||!(r=this._eventCollection[t])){return this}r=r.slice(0);r.forEach(function(t){return t.apply(e,i)});return this};return t}();n["default"]=o;e.exports=n["default"]},{}]},{},[1])(1)});;
/*!
 * @fileOverview TouchSwipe - jQuery Plugin
 * @version 1.6.18
 *
 * @author Matt Bryson http://www.github.com/mattbryson
 * @see https://github.com/mattbryson/TouchSwipe-Jquery-Plugin
 * @see http://labs.rampinteractive.co.uk/touchSwipe/
 * @see http://plugins.jquery.com/project/touchSwipe
 * @license
 * Copyright (c) 2010-2015 Matt Bryson
 * Dual licensed under the MIT or GPL Version 2 licenses.
 *
 */
!function(factory){"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],factory):factory("undefined"!=typeof module&&module.exports?require("jquery"):jQuery)}(function($){"use strict";function init(options){return!options||void 0!==options.allowPageScroll||void 0===options.swipe&&void 0===options.swipeStatus||(options.allowPageScroll=NONE),void 0!==options.click&&void 0===options.tap&&(options.tap=options.click),options||(options={}),options=$.extend({},$.fn.swipe.defaults,options),this.each(function(){var $this=$(this),plugin=$this.data(PLUGIN_NS);plugin||(plugin=new TouchSwipe(this,options),$this.data(PLUGIN_NS,plugin))})}function TouchSwipe(element,options){function touchStart(jqEvent){if(!(getTouchInProgress()||$(jqEvent.target).closest(options.excludedElements,$element).length>0)){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent;if(!event.pointerType||"mouse"!=event.pointerType||0!=options.fallbackToMouseEvents){var ret,touches=event.touches,evt=touches?touches[0]:event;return phase=PHASE_START,touches?fingerCount=touches.length:options.preventDefaultEvents!==!1&&jqEvent.preventDefault(),distance=0,direction=null,currentDirection=null,pinchDirection=null,duration=0,startTouchesDistance=0,endTouchesDistance=0,pinchZoom=1,pinchDistance=0,maximumsMap=createMaximumsData(),cancelMultiFingerRelease(),createFingerData(0,evt),!touches||fingerCount===options.fingers||options.fingers===ALL_FINGERS||hasPinches()?(startTime=getTimeStamp(),2==fingerCount&&(createFingerData(1,touches[1]),startTouchesDistance=endTouchesDistance=calculateTouchesDistance(fingerData[0].start,fingerData[1].start)),(options.swipeStatus||options.pinchStatus)&&(ret=triggerHandler(event,phase))):ret=!1,ret===!1?(phase=PHASE_CANCEL,triggerHandler(event,phase),ret):(options.hold&&(holdTimeout=setTimeout($.proxy(function(){$element.trigger("hold",[event.target]),options.hold&&(ret=options.hold.call($element,event,event.target))},this),options.longTapThreshold)),setTouchInProgress(!0),null)}}}function touchMove(jqEvent){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent;if(phase!==PHASE_END&&phase!==PHASE_CANCEL&&!inMultiFingerRelease()){var ret,touches=event.touches,evt=touches?touches[0]:event,currentFinger=updateFingerData(evt);if(endTime=getTimeStamp(),touches&&(fingerCount=touches.length),options.hold&&clearTimeout(holdTimeout),phase=PHASE_MOVE,2==fingerCount&&(0==startTouchesDistance?(createFingerData(1,touches[1]),startTouchesDistance=endTouchesDistance=calculateTouchesDistance(fingerData[0].start,fingerData[1].start)):(updateFingerData(touches[1]),endTouchesDistance=calculateTouchesDistance(fingerData[0].end,fingerData[1].end),pinchDirection=calculatePinchDirection(fingerData[0].end,fingerData[1].end)),pinchZoom=calculatePinchZoom(startTouchesDistance,endTouchesDistance),pinchDistance=Math.abs(startTouchesDistance-endTouchesDistance)),fingerCount===options.fingers||options.fingers===ALL_FINGERS||!touches||hasPinches()){if(direction=calculateDirection(currentFinger.start,currentFinger.end),currentDirection=calculateDirection(currentFinger.last,currentFinger.end),validateDefaultEvent(jqEvent,currentDirection),distance=calculateDistance(currentFinger.start,currentFinger.end),duration=calculateDuration(),setMaxDistance(direction,distance),ret=triggerHandler(event,phase),!options.triggerOnTouchEnd||options.triggerOnTouchLeave){var inBounds=!0;if(options.triggerOnTouchLeave){var bounds=getbounds(this);inBounds=isInBounds(currentFinger.end,bounds)}!options.triggerOnTouchEnd&&inBounds?phase=getNextPhase(PHASE_MOVE):options.triggerOnTouchLeave&&!inBounds&&(phase=getNextPhase(PHASE_END)),phase!=PHASE_CANCEL&&phase!=PHASE_END||triggerHandler(event,phase)}}else phase=PHASE_CANCEL,triggerHandler(event,phase);ret===!1&&(phase=PHASE_CANCEL,triggerHandler(event,phase))}}function touchEnd(jqEvent){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent,touches=event.touches;if(touches){if(touches.length&&!inMultiFingerRelease())return startMultiFingerRelease(event),!0;if(touches.length&&inMultiFingerRelease())return!0}return inMultiFingerRelease()&&(fingerCount=fingerCountAtRelease),endTime=getTimeStamp(),duration=calculateDuration(),didSwipeBackToCancel()||!validateSwipeDistance()?(phase=PHASE_CANCEL,triggerHandler(event,phase)):options.triggerOnTouchEnd||options.triggerOnTouchEnd===!1&&phase===PHASE_MOVE?(options.preventDefaultEvents!==!1&&jqEvent.cancelable!==!1&&jqEvent.preventDefault(),phase=PHASE_END,triggerHandler(event,phase)):!options.triggerOnTouchEnd&&hasTap()?(phase=PHASE_END,triggerHandlerForGesture(event,phase,TAP)):phase===PHASE_MOVE&&(phase=PHASE_CANCEL,triggerHandler(event,phase)),setTouchInProgress(!1),null}function touchCancel(){fingerCount=0,endTime=0,startTime=0,startTouchesDistance=0,endTouchesDistance=0,pinchZoom=1,cancelMultiFingerRelease(),setTouchInProgress(!1)}function touchLeave(jqEvent){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent;options.triggerOnTouchLeave&&(phase=getNextPhase(PHASE_END),triggerHandler(event,phase))}function removeListeners(){$element.unbind(START_EV,touchStart),$element.unbind(CANCEL_EV,touchCancel),$element.unbind(MOVE_EV,touchMove),$element.unbind(END_EV,touchEnd),LEAVE_EV&&$element.unbind(LEAVE_EV,touchLeave),setTouchInProgress(!1)}function getNextPhase(currentPhase){var nextPhase=currentPhase,validTime=validateSwipeTime(),validDistance=validateSwipeDistance(),didCancel=didSwipeBackToCancel();return!validTime||didCancel?nextPhase=PHASE_CANCEL:!validDistance||currentPhase!=PHASE_MOVE||options.triggerOnTouchEnd&&!options.triggerOnTouchLeave?!validDistance&&currentPhase==PHASE_END&&options.triggerOnTouchLeave&&(nextPhase=PHASE_CANCEL):nextPhase=PHASE_END,nextPhase}function triggerHandler(event,phase){var ret,touches=event.touches;return(didSwipe()||hasSwipes())&&(ret=triggerHandlerForGesture(event,phase,SWIPE)),(didPinch()||hasPinches())&&ret!==!1&&(ret=triggerHandlerForGesture(event,phase,PINCH)),didDoubleTap()&&ret!==!1?ret=triggerHandlerForGesture(event,phase,DOUBLE_TAP):didLongTap()&&ret!==!1?ret=triggerHandlerForGesture(event,phase,LONG_TAP):didTap()&&ret!==!1&&(ret=triggerHandlerForGesture(event,phase,TAP)),phase===PHASE_CANCEL&&touchCancel(event),phase===PHASE_END&&(touches?touches.length||touchCancel(event):touchCancel(event)),ret}function triggerHandlerForGesture(event,phase,gesture){var ret;if(gesture==SWIPE){if($element.trigger("swipeStatus",[phase,direction||null,distance||0,duration||0,fingerCount,fingerData,currentDirection]),options.swipeStatus&&(ret=options.swipeStatus.call($element,event,phase,direction||null,distance||0,duration||0,fingerCount,fingerData,currentDirection),ret===!1))return!1;if(phase==PHASE_END&&validateSwipe()){if(clearTimeout(singleTapTimeout),clearTimeout(holdTimeout),$element.trigger("swipe",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipe&&(ret=options.swipe.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection),ret===!1))return!1;switch(direction){case LEFT:$element.trigger("swipeLeft",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeLeft&&(ret=options.swipeLeft.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection));break;case RIGHT:$element.trigger("swipeRight",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeRight&&(ret=options.swipeRight.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection));break;case UP:$element.trigger("swipeUp",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeUp&&(ret=options.swipeUp.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection));break;case DOWN:$element.trigger("swipeDown",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeDown&&(ret=options.swipeDown.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection))}}}if(gesture==PINCH){if($element.trigger("pinchStatus",[phase,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData]),options.pinchStatus&&(ret=options.pinchStatus.call($element,event,phase,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData),ret===!1))return!1;if(phase==PHASE_END&&validatePinch())switch(pinchDirection){case IN:$element.trigger("pinchIn",[pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData]),options.pinchIn&&(ret=options.pinchIn.call($element,event,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData));break;case OUT:$element.trigger("pinchOut",[pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData]),options.pinchOut&&(ret=options.pinchOut.call($element,event,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData))}}return gesture==TAP?phase!==PHASE_CANCEL&&phase!==PHASE_END||(clearTimeout(singleTapTimeout),clearTimeout(holdTimeout),hasDoubleTap()&&!inDoubleTap()?(doubleTapStartTime=getTimeStamp(),singleTapTimeout=setTimeout($.proxy(function(){doubleTapStartTime=null,$element.trigger("tap",[event.target]),options.tap&&(ret=options.tap.call($element,event,event.target))},this),options.doubleTapThreshold)):(doubleTapStartTime=null,$element.trigger("tap",[event.target]),options.tap&&(ret=options.tap.call($element,event,event.target)))):gesture==DOUBLE_TAP?phase!==PHASE_CANCEL&&phase!==PHASE_END||(clearTimeout(singleTapTimeout),clearTimeout(holdTimeout),doubleTapStartTime=null,$element.trigger("doubletap",[event.target]),options.doubleTap&&(ret=options.doubleTap.call($element,event,event.target))):gesture==LONG_TAP&&(phase!==PHASE_CANCEL&&phase!==PHASE_END||(clearTimeout(singleTapTimeout),doubleTapStartTime=null,$element.trigger("longtap",[event.target]),options.longTap&&(ret=options.longTap.call($element,event,event.target)))),ret}function validateSwipeDistance(){var valid=!0;return null!==options.threshold&&(valid=distance>=options.threshold),valid}function didSwipeBackToCancel(){var cancelled=!1;return null!==options.cancelThreshold&&null!==direction&&(cancelled=getMaxDistance(direction)-distance>=options.cancelThreshold),cancelled}function validatePinchDistance(){return null===options.pinchThreshold||pinchDistance>=options.pinchThreshold}function validateSwipeTime(){var result;return result=!options.maxTimeThreshold||!(duration>=options.maxTimeThreshold)}function validateDefaultEvent(jqEvent,direction){if(options.preventDefaultEvents!==!1)if(options.allowPageScroll===NONE)jqEvent.preventDefault();else{var auto=options.allowPageScroll===AUTO;switch(direction){case LEFT:(options.swipeLeft&&auto||!auto&&options.allowPageScroll!=HORIZONTAL)&&jqEvent.preventDefault();break;case RIGHT:(options.swipeRight&&auto||!auto&&options.allowPageScroll!=HORIZONTAL)&&jqEvent.preventDefault();break;case UP:(options.swipeUp&&auto||!auto&&options.allowPageScroll!=VERTICAL)&&jqEvent.preventDefault();break;case DOWN:(options.swipeDown&&auto||!auto&&options.allowPageScroll!=VERTICAL)&&jqEvent.preventDefault();break;case NONE:}}}function validatePinch(){var hasCorrectFingerCount=validateFingers(),hasEndPoint=validateEndPoint(),hasCorrectDistance=validatePinchDistance();return hasCorrectFingerCount&&hasEndPoint&&hasCorrectDistance}function hasPinches(){return!!(options.pinchStatus||options.pinchIn||options.pinchOut)}function didPinch(){return!(!validatePinch()||!hasPinches())}function validateSwipe(){var hasValidTime=validateSwipeTime(),hasValidDistance=validateSwipeDistance(),hasCorrectFingerCount=validateFingers(),hasEndPoint=validateEndPoint(),didCancel=didSwipeBackToCancel(),valid=!didCancel&&hasEndPoint&&hasCorrectFingerCount&&hasValidDistance&&hasValidTime;return valid}function hasSwipes(){return!!(options.swipe||options.swipeStatus||options.swipeLeft||options.swipeRight||options.swipeUp||options.swipeDown)}function didSwipe(){return!(!validateSwipe()||!hasSwipes())}function validateFingers(){return fingerCount===options.fingers||options.fingers===ALL_FINGERS||!SUPPORTS_TOUCH}function validateEndPoint(){return 0!==fingerData[0].end.x}function hasTap(){return!!options.tap}function hasDoubleTap(){return!!options.doubleTap}function hasLongTap(){return!!options.longTap}function validateDoubleTap(){if(null==doubleTapStartTime)return!1;var now=getTimeStamp();return hasDoubleTap()&&now-doubleTapStartTime<=options.doubleTapThreshold}function inDoubleTap(){return validateDoubleTap()}function validateTap(){return(1===fingerCount||!SUPPORTS_TOUCH)&&(isNaN(distance)||distance<options.threshold)}function validateLongTap(){return duration>options.longTapThreshold&&distance<DOUBLE_TAP_THRESHOLD}function didTap(){return!(!validateTap()||!hasTap())}function didDoubleTap(){return!(!validateDoubleTap()||!hasDoubleTap())}function didLongTap(){return!(!validateLongTap()||!hasLongTap())}function startMultiFingerRelease(event){previousTouchEndTime=getTimeStamp(),fingerCountAtRelease=event.touches.length+1}function cancelMultiFingerRelease(){previousTouchEndTime=0,fingerCountAtRelease=0}function inMultiFingerRelease(){var withinThreshold=!1;if(previousTouchEndTime){var diff=getTimeStamp()-previousTouchEndTime;diff<=options.fingerReleaseThreshold&&(withinThreshold=!0)}return withinThreshold}function getTouchInProgress(){return!($element.data(PLUGIN_NS+"_intouch")!==!0)}function setTouchInProgress(val){$element&&(val===!0?($element.bind(MOVE_EV,touchMove),$element.bind(END_EV,touchEnd),LEAVE_EV&&$element.bind(LEAVE_EV,touchLeave)):($element.unbind(MOVE_EV,touchMove,!1),$element.unbind(END_EV,touchEnd,!1),LEAVE_EV&&$element.unbind(LEAVE_EV,touchLeave,!1)),$element.data(PLUGIN_NS+"_intouch",val===!0))}function createFingerData(id,evt){var f={start:{x:0,y:0},last:{x:0,y:0},end:{x:0,y:0}};return f.start.x=f.last.x=f.end.x=evt.pageX||evt.clientX,f.start.y=f.last.y=f.end.y=evt.pageY||evt.clientY,fingerData[id]=f,f}function updateFingerData(evt){var id=void 0!==evt.identifier?evt.identifier:0,f=getFingerData(id);return null===f&&(f=createFingerData(id,evt)),f.last.x=f.end.x,f.last.y=f.end.y,f.end.x=evt.pageX||evt.clientX,f.end.y=evt.pageY||evt.clientY,f}function getFingerData(id){return fingerData[id]||null}function setMaxDistance(direction,distance){direction!=NONE&&(distance=Math.max(distance,getMaxDistance(direction)),maximumsMap[direction].distance=distance)}function getMaxDistance(direction){if(maximumsMap[direction])return maximumsMap[direction].distance}function createMaximumsData(){var maxData={};return maxData[LEFT]=createMaximumVO(LEFT),maxData[RIGHT]=createMaximumVO(RIGHT),maxData[UP]=createMaximumVO(UP),maxData[DOWN]=createMaximumVO(DOWN),maxData}function createMaximumVO(dir){return{direction:dir,distance:0}}function calculateDuration(){return endTime-startTime}function calculateTouchesDistance(startPoint,endPoint){var diffX=Math.abs(startPoint.x-endPoint.x),diffY=Math.abs(startPoint.y-endPoint.y);return Math.round(Math.sqrt(diffX*diffX+diffY*diffY))}function calculatePinchZoom(startDistance,endDistance){var percent=endDistance/startDistance*1;return percent.toFixed(2)}function calculatePinchDirection(){return pinchZoom<1?OUT:IN}function calculateDistance(startPoint,endPoint){return Math.round(Math.sqrt(Math.pow(endPoint.x-startPoint.x,2)+Math.pow(endPoint.y-startPoint.y,2)))}function calculateAngle(startPoint,endPoint){var x=startPoint.x-endPoint.x,y=endPoint.y-startPoint.y,r=Math.atan2(y,x),angle=Math.round(180*r/Math.PI);return angle<0&&(angle=360-Math.abs(angle)),angle}function calculateDirection(startPoint,endPoint){if(comparePoints(startPoint,endPoint))return NONE;var angle=calculateAngle(startPoint,endPoint);return angle<=45&&angle>=0?LEFT:angle<=360&&angle>=315?LEFT:angle>=135&&angle<=225?RIGHT:angle>45&&angle<135?DOWN:UP}function getTimeStamp(){var now=new Date;return now.getTime()}function getbounds(el){el=$(el);var offset=el.offset(),bounds={left:offset.left,right:offset.left+el.outerWidth(),top:offset.top,bottom:offset.top+el.outerHeight()};return bounds}function isInBounds(point,bounds){return point.x>bounds.left&&point.x<bounds.right&&point.y>bounds.top&&point.y<bounds.bottom}function comparePoints(pointA,pointB){return pointA.x==pointB.x&&pointA.y==pointB.y}var options=$.extend({},options),useTouchEvents=SUPPORTS_TOUCH||SUPPORTS_POINTER||!options.fallbackToMouseEvents,START_EV=useTouchEvents?SUPPORTS_POINTER?SUPPORTS_POINTER_IE10?"MSPointerDown":"pointerdown":"touchstart":"mousedown",MOVE_EV=useTouchEvents?SUPPORTS_POINTER?SUPPORTS_POINTER_IE10?"MSPointerMove":"pointermove":"touchmove":"mousemove",END_EV=useTouchEvents?SUPPORTS_POINTER?SUPPORTS_POINTER_IE10?"MSPointerUp":"pointerup":"touchend":"mouseup",LEAVE_EV=useTouchEvents?SUPPORTS_POINTER?"mouseleave":null:"mouseleave",CANCEL_EV=SUPPORTS_POINTER?SUPPORTS_POINTER_IE10?"MSPointerCancel":"pointercancel":"touchcancel",distance=0,direction=null,currentDirection=null,duration=0,startTouchesDistance=0,endTouchesDistance=0,pinchZoom=1,pinchDistance=0,pinchDirection=0,maximumsMap=null,$element=$(element),phase="start",fingerCount=0,fingerData={},startTime=0,endTime=0,previousTouchEndTime=0,fingerCountAtRelease=0,doubleTapStartTime=0,singleTapTimeout=null,holdTimeout=null;try{$element.bind(START_EV,touchStart),$element.bind(CANCEL_EV,touchCancel)}catch(e){$.error("events not supported "+START_EV+","+CANCEL_EV+" on jQuery.swipe")}this.enable=function(){return this.disable(),$element.bind(START_EV,touchStart),$element.bind(CANCEL_EV,touchCancel),$element},this.disable=function(){return removeListeners(),$element},this.destroy=function(){removeListeners(),$element.data(PLUGIN_NS,null),$element=null},this.option=function(property,value){if("object"==typeof property)options=$.extend(options,property);else if(void 0!==options[property]){if(void 0===value)return options[property];options[property]=value}else{if(!property)return options;$.error("Option "+property+" does not exist on jQuery.swipe.options")}return null}}var VERSION="1.6.18",LEFT="left",RIGHT="right",UP="up",DOWN="down",IN="in",OUT="out",NONE="none",AUTO="auto",SWIPE="swipe",PINCH="pinch",TAP="tap",DOUBLE_TAP="doubletap",LONG_TAP="longtap",HORIZONTAL="horizontal",VERTICAL="vertical",ALL_FINGERS="all",DOUBLE_TAP_THRESHOLD=10,PHASE_START="start",PHASE_MOVE="move",PHASE_END="end",PHASE_CANCEL="cancel",SUPPORTS_TOUCH="ontouchstart"in window,SUPPORTS_POINTER_IE10=window.navigator.msPointerEnabled&&!window.navigator.pointerEnabled&&!SUPPORTS_TOUCH,SUPPORTS_POINTER=(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&!SUPPORTS_TOUCH,PLUGIN_NS="TouchSwipe",defaults={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,hold:null,triggerOnTouchEnd:!0,triggerOnTouchLeave:!1,allowPageScroll:"auto",fallbackToMouseEvents:!0,excludedElements:".noSwipe",preventDefaultEvents:!0};$.fn.swipe=function(method){var $this=$(this),plugin=$this.data(PLUGIN_NS);if(plugin&&"string"==typeof method){if(plugin[method])return plugin[method].apply(plugin,Array.prototype.slice.call(arguments,1));$.error("Method "+method+" does not exist on jQuery.swipe")}else if(plugin&&"object"==typeof method)plugin.option.apply(plugin,arguments);else if(!(plugin||"object"!=typeof method&&method))return init.apply(this,arguments);return $this},$.fn.swipe.version=VERSION,$.fn.swipe.defaults=defaults,$.fn.swipe.phases={PHASE_START:PHASE_START,PHASE_MOVE:PHASE_MOVE,PHASE_END:PHASE_END,PHASE_CANCEL:PHASE_CANCEL},$.fn.swipe.directions={LEFT:LEFT,RIGHT:RIGHT,UP:UP,DOWN:DOWN,IN:IN,OUT:OUT},$.fn.swipe.pageScroll={NONE:NONE,HORIZONTAL:HORIZONTAL,VERTICAL:VERTICAL,AUTO:AUTO},$.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,FOUR:4,FIVE:5,ALL:ALL_FINGERS}});;
/*!
  * Stickyfill – `position: sticky` polyfill
  * v. 2.0.3 | https://github.com/wilddeer/stickyfill
  * MIT License
  */
!function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function d(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}function e(a){return parseFloat(a)||0}function f(a){for(var b=0;a;)b+=a.offsetTop,a=a.offsetParent;return b}function g(){function c(){a.pageXOffset!=k.left?(k.top=a.pageYOffset,k.left=a.pageXOffset,n.refreshAll()):a.pageYOffset!=k.top&&(k.top=a.pageYOffset,k.left=a.pageXOffset,l.forEach(function(a){return a._recalcPosition()}))}function d(){f=setInterval(function(){l.forEach(function(a){return a._fastCheck()})},500)}function e(){clearInterval(f)}c(),a.addEventListener("scroll",c),a.addEventListener("resize",n.refreshAll),a.addEventListener("orientationchange",n.refreshAll);var f=void 0,g=void 0,h=void 0;"hidden"in b?(g="hidden",h="visibilitychange"):"webkitHidden"in b&&(g="webkitHidden",h="webkitvisibilitychange"),h?(b[g]||d(),b.addEventListener(h,function(){b[g]?e():d()})):d()}var h=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),i=!1;a.getComputedStyle?!function(){var a=b.createElement("div");["","-webkit-","-moz-","-ms-"].some(function(b){try{a.style.position=b+"sticky"}catch(a){}return""!=a.style.position})&&(i=!0)}():i=!0;var j="undefined"!=typeof ShadowRoot,k={top:null,left:null},l=[],m=function(){function g(a){if(c(this,g),!(a instanceof HTMLElement))throw new Error("First argument must be HTMLElement");if(l.some(function(b){return b._node===a}))throw new Error("Stickyfill is already applied to this node");this._node=a,this._stickyMode=null,this._active=!1,l.push(this),this.refresh()}return h(g,[{key:"refresh",value:function(){if(!i&&!this._removed){this._active&&this._deactivate();var c=this._node,g=getComputedStyle(c),h={top:g.top,display:g.display,marginTop:g.marginTop,marginBottom:g.marginBottom,marginLeft:g.marginLeft,marginRight:g.marginRight,cssFloat:g.cssFloat};if(!isNaN(parseFloat(h.top))&&"table-cell"!=h.display&&"none"!=h.display){this._active=!0;var k=c.parentNode,l=j&&k instanceof ShadowRoot?k.host:k,m=c.getBoundingClientRect(),n=l.getBoundingClientRect(),o=getComputedStyle(l);this._parent={node:l,styles:{position:l.style.position},offsetHeight:l.offsetHeight},this._offsetToWindow={left:m.left,right:b.documentElement.clientWidth-m.right},this._offsetToParent={top:m.top-n.top-e(o.borderTopWidth),left:m.left-n.left-e(o.borderLeftWidth),right:-m.right+n.right-e(o.borderRightWidth)},this._styles={position:c.style.position,top:c.style.top,bottom:c.style.bottom,left:c.style.left,right:c.style.right,width:c.style.width,marginTop:c.style.marginTop,marginLeft:c.style.marginLeft,marginRight:c.style.marginRight};var p=e(h.top);this._limits={start:m.top+a.pageYOffset-p,end:n.top+a.pageYOffset+l.offsetHeight-e(o.borderBottomWidth)-c.offsetHeight-p-e(h.marginBottom)};var q=o.position;"absolute"!=q&&"relative"!=q&&(l.style.position="relative"),this._recalcPosition();var r=this._clone={};r.node=b.createElement("div"),d(r.node.style,{width:m.right-m.left+"px",height:m.bottom-m.top+"px",marginTop:h.marginTop,marginBottom:h.marginBottom,marginLeft:h.marginLeft,marginRight:h.marginRight,cssFloat:h.cssFloat,padding:0,border:0,borderSpacing:0,fontSize:"1em",position:"static"}),k.insertBefore(r.node,c),r.docOffsetTop=f(r.node)}}}},{key:"_recalcPosition",value:function(){if(this._active&&!this._removed){var a=k.top<=this._limits.start?"start":k.top>=this._limits.end?"end":"middle";if(this._stickyMode!=a){switch(a){case"start":d(this._node.style,{position:"absolute",left:this._offsetToParent.left+"px",right:this._offsetToParent.right+"px",top:this._offsetToParent.top+"px",bottom:"auto",width:"auto",marginLeft:0,marginRight:0,marginTop:0});break;case"middle":d(this._node.style,{position:"fixed",left:this._offsetToWindow.left+"px",right:this._offsetToWindow.right+"px",top:this._styles.top,bottom:"auto",width:"auto",marginLeft:0,marginRight:0,marginTop:0});break;case"end":d(this._node.style,{position:"absolute",left:this._offsetToParent.left+"px",right:this._offsetToParent.right+"px",top:"auto",bottom:0,width:"auto",marginLeft:0,marginRight:0})}this._stickyMode=a}}}},{key:"_fastCheck",value:function(){this._active&&!this._removed&&(Math.abs(f(this._clone.node)-this._clone.docOffsetTop)>1||Math.abs(this._parent.node.offsetHeight-this._parent.offsetHeight)>1)&&this.refresh()}},{key:"_deactivate",value:function(){var a=this;this._active&&!this._removed&&(this._clone.node.parentNode.removeChild(this._clone.node),delete this._clone,d(this._node.style,this._styles),delete this._styles,l.some(function(b){return b!==a&&b._parent&&b._parent.node===a._parent.node})||d(this._parent.node.style,this._parent.styles),delete this._parent,this._stickyMode=null,this._active=!1,delete this._offsetToWindow,delete this._offsetToParent,delete this._limits)}},{key:"remove",value:function(){var a=this;this._deactivate(),l.some(function(b,c){if(b._node===a._node)return l.splice(c,1),!0}),this._removed=!0}}]),g}(),n={stickies:l,Sticky:m,addOne:function(a){if(!(a instanceof HTMLElement)){if(!a.length||!a[0])return;a=a[0]}for(var b=0;b<l.length;b++)if(l[b]._node===a)return l[b];return new m(a)},add:function(a){if(a instanceof HTMLElement&&(a=[a]),a.length){for(var b=[],c=function(c){var d=a[c];return d instanceof HTMLElement?l.some(function(a){if(a._node===d)return b.push(a),!0})?"continue":void b.push(new m(d)):(b.push(void 0),"continue")},d=0;d<a.length;d++){c(d)}return b}},refreshAll:function(){l.forEach(function(a){return a.refresh()})},removeOne:function(a){if(!(a instanceof HTMLElement)){if(!a.length||!a[0])return;a=a[0]}l.some(function(b){if(b._node===a)return b.remove(),!0})},remove:function(a){if(a instanceof HTMLElement&&(a=[a]),a.length)for(var b=function(b){var c=a[b];l.some(function(a){if(a._node===c)return a.remove(),!0})},c=0;c<a.length;c++)b(c)},removeAll:function(){for(;l.length;)l[0].remove()}};i||g(),"undefined"!=typeof module&&module.exports?module.exports=n:a.Stickyfill=n}(window,document);;
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("global/document"),require("global/window")):"function"==typeof define&&define.amd?define(["global/document","global/window"],e):t.videojs=e(t.document,t.window)}(this,function(h,d){h=h&&h.hasOwnProperty("default")?h.default:h,d=d&&d.hasOwnProperty("default")?d.default:d;var u="7.4.1";function p(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t,e,i){return(s=function(){if("undefined"!=typeof Reflect&&Reflect.construct&&!Reflect.construct.sham){if("function"==typeof Proxy)return 1;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),1}catch(t){return}}}()?Reflect.construct:function(t,e,i){var n=[null];n.push.apply(n,e);n=new(Function.bind.apply(t,n));return i&&r(n,i.prototype),n}).apply(null,arguments)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function e(t,e){return e=e||t.slice(0),t.raw=e,t}var o=[],t=function(a,s){return function(t,e,i){var n=s.levels[e],r=new RegExp("^("+n+")$");"log"!==t&&i.unshift(t.toUpperCase()+":"),i.unshift(a+":"),o&&o.push([].concat(i)),d.console&&((e=d.console[t])||"debug"!==t||(e=d.console.info||d.console.log),e&&n&&r.test(t)&&e[Array.isArray(i)?"apply":"call"](d.console,i))}};var f=function e(i){function n(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];a("log",r,e)}var r="info",a=t(i,n);return n.createLogger=function(t){return e(i+": "+t)},n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:r},n.level=function(t){if("string"==typeof t){if(!n.levels.hasOwnProperty(t))throw new Error('"'+t+'" in not a valid log level');r=t}return r},(n.history=function(){return o?[].concat(o):[]}).filter=function(e){return(o||[]).filter(function(t){return new RegExp(".*"+e+".*").test(t[0])})},n.history.clear=function(){o&&(o.length=0)},n.history.disable=function(){null!==o&&(o.length=0,o=null)},n.history.enable=function(){null===o&&(o=[])},n.error=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return a("error",r,e)},n.warn=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return a("warn",r,e)},n.debug=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return a("debug",r,e)},n}("VIDEOJS"),m=f.createLogger;var g=function(t){for(var e="",i=0;i<arguments.length;i++)e+=t[i].replace(/\n\r?\s*/g,"")+(arguments[i+1]||"");return e},i=Object.prototype.toString,a=function(t){return v(t)?Object.keys(t):[]};function c(e,i){a(e).forEach(function(t){return i(e[t],t)})}function y(i){for(var t=arguments.length,e=new Array(1<t?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return Object.assign?Object.assign.apply(Object,[i].concat(e)):(e.forEach(function(t){t&&c(t,function(t,e){i[e]=t})}),i)}function v(t){return!!t&&"object"==typeof t}function _(t){return v(t)&&"[object Object]"===i.call(t)&&t.constructor===Object}function n(t,e){if(!t||!e)return"";if("function"!=typeof d.getComputedStyle)return"";t=d.getComputedStyle(t);return t?t[e]:""}function b(){var t=e(["Setting attributes in the second argument of createEl()\n                has been deprecated. Use the third argument instead.\n                createEl(type, properties, attributes). Attempting to set "," to ","."]);return b=function(){return t},t}function T(t){return"string"==typeof t&&/\S/.test(t)}function S(t){if(/\s/.test(t))throw new Error("class has illegal whitespace characters")}function k(){return h===d.document}function w(t){return v(t)&&1===t.nodeType}function C(){try{return d.parent!==d.self}catch(t){return!0}}function E(i){return function(t,e){if(!T(t))return h[i](null);T(e)&&(e=h.querySelector(e));e=w(e)?e:h;return e[i]&&e[i](t)}}function A(t,i,e,n){void 0===t&&(t="div"),void 0===i&&(i={}),void 0===e&&(e={});var r=h.createElement(t);return Object.getOwnPropertyNames(i).forEach(function(t){var e=i[t];-1!==t.indexOf("aria-")||"role"===t||"type"===t?(f.warn(g(b(),t,e)),r.setAttribute(t,e)):"textContent"===t?L(r,e):r[t]=e}),Object.getOwnPropertyNames(e).forEach(function(t){r.setAttribute(t,e[t])}),n&&X(r,n),r}function L(t,e){return void 0===t.textContent?t.innerText=e:t.textContent=e,t}function O(t,e){e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t)}function P(t,e){return S(e),t.classList?t.classList.contains(e):new RegExp("(^|\\s)"+e+"($|\\s)").test(t.className)}function U(t,e){return t.classList?t.classList.add(e):P(t,e)||(t.className=(t.className+" "+e).trim()),t}function I(t,e){return t.classList?t.classList.remove(e):(S(e),t.className=t.className.split(/\s+/).filter(function(t){return t!==e}).join(" ")),t}function x(t,e,i){var n=P(t,e);if("function"==typeof i&&(i=i(t,e)),"boolean"!=typeof i&&(i=!n),i!==n)return(i?U:I)(t,e),t}function D(i,n){Object.getOwnPropertyNames(n).forEach(function(t){var e=n[t];null==e||!1===e?i.removeAttribute(t):i.setAttribute(t,!0===e?"":e)})}function R(t){var e={},i=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(t&&t.attributes&&0<t.attributes.length)for(var n=t.attributes,r=n.length-1;0<=r;r--){var a=n[r].name,s=n[r].value;"boolean"!=typeof t[a]&&-1===i.indexOf(","+a+",")||(s=null!==s),e[a]=s}return e}function M(t,e){return t.getAttribute(e)}function B(t,e,i){t.setAttribute(e,i)}function N(t,e){t.removeAttribute(e)}function j(){h.body.focus(),h.onselectstart=function(){return!1}}function F(){h.onselectstart=function(){return!0}}function V(t){if(t&&t.getBoundingClientRect&&t.parentNode){var e=t.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach(function(t){void 0!==e[t]&&(i[t]=e[t])}),i.height||(i.height=parseFloat(n(t,"height"))),i.width||(i.width=parseFloat(n(t,"width"))),i}}function H(t){var e;if(t.getBoundingClientRect&&t.parentNode&&(e=t.getBoundingClientRect()),!e)return{left:0,top:0};var i=h.documentElement,n=h.body,r=i.clientLeft||n.clientLeft||0,t=d.pageXOffset||n.scrollLeft,r=e.left+t-r,i=i.clientTop||n.clientTop||0,n=d.pageYOffset||n.scrollTop,i=e.top+n-i;return{left:Math.round(r),top:Math.round(i)}}function q(t,e){var i={},n=H(t),r=t.offsetWidth,a=t.offsetHeight,s=n.top,o=n.left,t=e.pageY,n=e.pageX;return e.changedTouches&&(n=e.changedTouches[0].pageX,t=e.changedTouches[0].pageY),i.y=Math.max(0,Math.min(1,(s-t+a)/a)),i.x=Math.max(0,Math.min(1,(n-o)/r)),i}function z(t){return v(t)&&3===t.nodeType}function W(t){for(;t.firstChild;)t.removeChild(t.firstChild);return t}function G(t){return"function"==typeof t&&(t=t()),(Array.isArray(t)?t:[t]).map(function(t){return"function"==typeof t&&(t=t()),w(t)||z(t)?t:"string"==typeof t&&/\S/.test(t)?h.createTextNode(t):void 0}).filter(function(t){return t})}function X(e,t){return G(t).forEach(function(t){return e.appendChild(t)}),e}function Y(t,e){return X(W(t),e)}function $(t){return void 0===t.button&&void 0===t.buttons||(0===t.button&&void 0===t.buttons||0===t.button&&1===t.buttons)}var K=E("querySelector"),Q=E("querySelectorAll"),J=Object.freeze({isReal:k,isEl:w,isInFrame:C,createEl:A,textContent:L,prependTo:O,hasClass:P,addClass:U,removeClass:I,toggleClass:x,setAttributes:D,getAttributes:R,getAttribute:M,setAttribute:B,removeAttribute:N,blockTextSelection:j,unblockTextSelection:F,getBoundingClientRect:V,findPosition:H,getPointerPosition:q,isTextNode:z,emptyEl:W,normalizeContent:G,appendContent:X,insertContent:Y,isSingleLeftClick:$,$:K,$$:Q}),Z=1;var tt={},et="vdata"+(new Date).getTime();function it(t){var e=(e=t[et])||(t[et]=Z++);return tt[e]||(tt[e]={}),tt[e]}function nt(t){t=t[et];return t&&Object.getOwnPropertyNames(tt[t]).length}function rt(e){var t=e[et];if(t){delete tt[t];try{delete e[et]}catch(t){e.removeAttribute?e.removeAttribute(et):e[et]=null}}}function at(t,e){var i=it(t);0===i.handlers[e].length&&(delete i.handlers[e],t.removeEventListener?t.removeEventListener(e,i.dispatcher,!1):t.detachEvent&&t.detachEvent("on"+e,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&rt(t)}function st(e,i,t,n){t.forEach(function(t){e(i,t,n)})}function ot(t){function e(){return!0}function i(){return!1}if(!t||!t.isPropagationStopped){var n,r,a,s=t||d.event;for(n in t={},s)"layerX"!==n&&"layerY"!==n&&"keyLocation"!==n&&"webkitMovementX"!==n&&"webkitMovementY"!==n&&("returnValue"===n&&s.preventDefault||(t[n]=s[n]));t.target||(t.target=t.srcElement||h),t.relatedTarget||(t.relatedTarget=t.fromElement===t.target?t.toElement:t.fromElement),t.preventDefault=function(){s.preventDefault&&s.preventDefault(),t.returnValue=!1,s.returnValue=!1,t.defaultPrevented=!0},t.defaultPrevented=!1,t.stopPropagation=function(){s.stopPropagation&&s.stopPropagation(),t.cancelBubble=!0,s.cancelBubble=!0,t.isPropagationStopped=e},t.isPropagationStopped=i,t.stopImmediatePropagation=function(){s.stopImmediatePropagation&&s.stopImmediatePropagation(),t.isImmediatePropagationStopped=e,t.stopPropagation()},t.isImmediatePropagationStopped=i,null!==t.clientX&&void 0!==t.clientX&&(r=h.documentElement,a=h.body,t.pageX=t.clientX+(r&&r.scrollLeft||a&&a.scrollLeft||0)-(r&&r.clientLeft||a&&a.clientLeft||0),t.pageY=t.clientY+(r&&r.scrollTop||a&&a.scrollTop||0)-(r&&r.clientTop||a&&a.clientTop||0)),t.which=t.charCode||t.keyCode,null!==t.button&&void 0!==t.button&&(t.button=1&t.button?0:4&t.button?1:2&t.button?2:0)}return t}var ut=!1;!function(){try{var t=Object.defineProperty({},"passive",{get:function(){ut=!0}});d.addEventListener("test",null,t),d.removeEventListener("test",null,t)}catch(t){}}();var lt=["touchstart","touchmove"];function ct(s,t,e){if(Array.isArray(t))return st(ct,s,t,e);var o=it(s);o.handlers||(o.handlers={}),o.handlers[t]||(o.handlers[t]=[]),e.guid||(e.guid=Z++),o.handlers[t].push(e),o.dispatcher||(o.disabled=!1,o.dispatcher=function(t,e){if(!o.disabled){t=ot(t);var i=o.handlers[t.type];if(i)for(var n=i.slice(0),r=0,a=n.length;r<a&&!t.isImmediatePropagationStopped();r++)try{n[r].call(s,t,e)}catch(t){f.error(t)}}}),1===o.handlers[t].length&&(s.addEventListener?(e=!1,ut&&-1<lt.indexOf(t)&&(e={passive:!0}),s.addEventListener(t,o.dispatcher,e)):s.attachEvent&&s.attachEvent("on"+t,o.dispatcher))}function ht(t,e,i){if(nt(t)){var n=it(t);if(n.handlers){if(Array.isArray(e))return st(ht,t,e,i);function r(t,e){n.handlers[e]=[],at(t,e)}if(void 0!==e){var a=n.handlers[e];if(a)if(i){if(i.guid)for(var s=0;s<a.length;s++)a[s].guid===i.guid&&a.splice(s--,1);at(t,e)}else r(t,e)}else for(var o in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},o)&&r(t,o)}}}function dt(t,e,i){var n=nt(t)?it(t):{},r=t.parentNode||t.ownerDocument;return"string"==typeof e?e={type:e,target:t}:e.target||(e.target=t),e=ot(e),n.dispatcher&&n.dispatcher.call(t,e,i),r&&!e.isPropagationStopped()&&!0===e.bubbles?dt.call(null,r,e,i):r||e.defaultPrevented||(r=it(e.target),e.target[e.type]&&(r.disabled=!0,"function"==typeof e.target[e.type]&&e.target[e.type](),r.disabled=!1)),!e.defaultPrevented}function pt(t,e,i){if(Array.isArray(e))return st(pt,t,e,i);function n(){ht(t,e,n),i.apply(this,arguments)}n.guid=i.guid=i.guid||Z++,ct(t,e,n)}var ft,mt=Object.freeze({fixEvent:ot,on:ct,off:ht,trigger:dt,one:pt}),gt=!1,yt=function(){if(k()&&!1!==ft.options.autoSetup){var t=Array.prototype.slice.call(h.getElementsByTagName("video")),e=Array.prototype.slice.call(h.getElementsByTagName("audio")),i=Array.prototype.slice.call(h.getElementsByTagName("video-js")),n=t.concat(e,i);if(n&&0<n.length)for(var r=0,a=n.length;r<a;r++){var s=n[r];if(!s||!s.getAttribute){vt(1);break}void 0===s.player&&null!==s.getAttribute("data-setup")&&ft(s)}else gt||vt(1)}};function vt(t,e){e&&(ft=e),d.setTimeout(yt,t)}k()&&"complete"===h.readyState?gt=!0:pt(d,"load",function(){gt=!0});function _t(t){var e=h.createElement("style");return e.className=t,e}function bt(t,e){t.styleSheet?t.styleSheet.cssText=e:t.textContent=e}function Tt(e,i){var n=Date.now();return function(){var t=Date.now();i<=t-n&&(e.apply(void 0,arguments),n=t)}}function St(n,r,a,s){var o;function t(){var t=this,e=arguments,i=function(){i=o=null,a||n.apply(t,e)};!o&&a&&n.apply(t,e),s.clearTimeout(o),o=s.setTimeout(i,r)}return void 0===s&&(s=d),t.cancel=function(){s.clearTimeout(o),o=null},t}function kt(){}var wt,Ct=function(t,e,i){e.guid||(e.guid=Z++);function n(){return e.apply(t,arguments)}return n.guid=i?i+"_"+e.guid:e.guid,n};kt.prototype.allowedEvents_={},kt.prototype.addEventListener=kt.prototype.on=function(t,e){var i=this.addEventListener;this.addEventListener=function(){},ct(this,t,e),this.addEventListener=i},kt.prototype.removeEventListener=kt.prototype.off=function(t,e){ht(this,t,e)},kt.prototype.one=function(t,e){var i=this.addEventListener;this.addEventListener=function(){},pt(this,t,e),this.addEventListener=i},kt.prototype.dispatchEvent=kt.prototype.trigger=function(t){var e=t.type||t;"string"==typeof t&&(t={type:e}),t=ot(t),this.allowedEvents_[e]&&this["on"+e]&&this["on"+e](t),dt(this,t)},kt.prototype.queueTrigger=function(t){var e=this;wt=wt||new Map;var i=t.type||t,n=wt.get(this);n||(n=new Map,wt.set(this,n));var r=n.get(i);n.delete(i),d.clearTimeout(r);r=d.setTimeout(function(){0===n.size&&(n=null,wt.delete(e)),e.trigger(t)},0);n.set(i,r)};function Et(t){return"string"==typeof t&&/\S/.test(t)||Array.isArray(t)&&!!t.length}function At(t){if(!t.nodeName&&!It(t))throw new Error("Invalid target; must be a DOM node or evented object.")}function Lt(t){if(!Et(t))throw new Error("Invalid event type; must be a non-empty string or array.")}function Ot(t){if("function"!=typeof t)throw new Error("Invalid listener; must be a function.")}function Pt(t,e){var i,n,r=e.length<3||e[0]===t||e[0]===t.eventBusEl_,e=r?(i=t.eventBusEl_,3<=e.length&&e.shift(),n=e[0],e[1]):(i=e[0],n=e[1],e[2]);return At(i),Lt(n),Ot(e),{isTargetingSelf:r,target:i,type:n,listener:e=Ct(t,e)}}function Ut(t,e,i,n){At(t),t.nodeName?mt[e](t,i,n):t[e](i,n)}var It=function(e){return e instanceof kt||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return"function"==typeof e[t]})},xt={on:function(){for(var t=this,e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];var r,a=Pt(this,i),s=a.isTargetingSelf,o=a.target,u=a.type,l=a.listener;Ut(o,"on",u,l),s||((r=function(){return t.off(o,u,l)}).guid=l.guid,(s=function(){return t.off("dispose",r)}).guid=l.guid,Ut(this,"on","dispose",r),Ut(o,"on","dispose",s))},one:function(){for(var r=this,t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];var n=Pt(this,e),a=n.isTargetingSelf,s=n.target,o=n.type,u=n.listener;a?Ut(s,"one",o,u):((a=function t(){r.off(s,o,t);for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];u.apply(null,i)}).guid=u.guid,Ut(s,"one",o,a))},off:function(t,e,i){!t||Et(t)?ht(this.eventBusEl_,t,e):(e=e,At(t=t),Lt(e),Ot(i),i=Ct(this,i),this.off("dispose",i),t.nodeName?(ht(t,e,i),ht(t,"dispose",i)):It(t)&&(t.off(e,i),t.off("dispose",i)))},trigger:function(t,e){return dt(this.eventBusEl_,t,e)}};function Dt(t,e){void 0===e&&(e={});e=e.eventBusKey;if(e){if(!t[e].nodeName)throw new Error('The eventBusKey "'+e+'" does not refer to an element.');t.eventBusEl_=t[e]}else t.eventBusEl_=A("span",{className:"vjs-event-bus"});return y(t,xt),t.eventedCallbacks&&t.eventedCallbacks.forEach(function(t){t()}),t.on("dispose",function(){t.off(),d.setTimeout(function(){t.eventBusEl_=null},0)}),t}var Rt={state:{},setState:function(t){var i,n=this;return"function"==typeof t&&(t=t()),c(t,function(t,e){n.state[e]!==t&&((i=i||{})[e]={from:n.state[e],to:t}),n.state[e]=t}),i&&It(this)&&this.trigger({changes:i,type:"statechanged"}),i}};function Mt(t,e){return y(t,Rt),t.state=y({},t.state,e),"function"==typeof t.handleStateChanged&&It(t)&&t.on("statechanged",t.handleStateChanged),t}function Bt(t){return"string"!=typeof t?t:t.charAt(0).toUpperCase()+t.slice(1)}function Nt(){for(var i={},t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.forEach(function(t){t&&c(t,function(t,e){_(t)?(_(i[e])||(i[e]={}),i[e]=Nt(i[e],t)):i[e]=t})}),i}var jt=function(){function s(t,e,i){!t&&this.play?this.player_=t=this:this.player_=t,this.options_=Nt({},this.options_),e=this.options_=Nt(this.options_,e),this.id_=e.id||e.el&&e.el.id,this.id_||(t=t&&t.id&&t.id()||"no_player",this.id_=t+"_component_"+Z++),this.name_=e.name||null,e.el?this.el_=e.el:!1!==e.createEl&&(this.el_=this.createEl()),!1!==e.evented&&Dt(this,{eventBusKey:this.el_?"el_":null}),Mt(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},!(this.childNameIndex_={})!==e.initChildren&&this.initChildren(),this.ready(i),!1!==e.reportTouchActivity&&this.enableTouchActivity()}var t=s.prototype;return t.dispose=function(){if(this.trigger({type:"dispose",bubbles:!1}),this.children_)for(var t=this.children_.length-1;0<=t;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),rt(this.el_),this.el_=null),this.player_=null},t.player=function(){return this.player_},t.options=function(t){return f.warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),t&&(this.options_=Nt(this.options_,t)),this.options_},t.el=function(){return this.el_},t.createEl=function(t,e,i){return A(t,e,i)},t.localize=function(t,i,e){void 0===e&&(e=t);var n=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),a=r&&r[n],n=n&&n.split("-")[0],n=r&&r[n],e=e;return a&&a[t]?e=a[t]:n&&n[t]&&(e=n[t]),i&&(e=e.replace(/\{(\d+)\}/g,function(t,e){e=i[e-1];return void 0===e?t:e})),e},t.contentEl=function(){return this.contentEl_||this.el_},t.id=function(){return this.id_},t.name=function(){return this.name_},t.children=function(){return this.children_},t.getChildById=function(t){return this.childIndex_[t]},t.getChild=function(t){if(t)return t=Bt(t),this.childNameIndex_[t]},t.addChild=function(t,e,i){var n;if(void 0===e&&(e={}),void 0===i&&(i=this.children_.length),"string"==typeof t){n=Bt(t);var r=e.componentClass||n;e.name=n;var a=s.getComponent(r);if(!a)throw new Error("Component "+r+" does not exist");if("function"!=typeof a)return null;a=new a(this.player_||this,e)}else a=t;return this.children_.splice(i,0,a),"function"==typeof a.id&&(this.childIndex_[a.id()]=a),(n=n||a.name&&Bt(a.name()))&&(this.childNameIndex_[n]=a),"function"==typeof a.el&&a.el()&&(i=this.contentEl().children[i]||null,this.contentEl().insertBefore(a.el(),i)),a},t.removeChild=function(t){if("string"==typeof t&&(t=this.getChild(t)),t&&this.children_){for(var e,i=!1,n=this.children_.length-1;0<=n;n--)if(this.children_[n]===t){i=!0,this.children_.splice(n,1);break}i&&(this.childIndex_[t.id()]=null,this.childNameIndex_[t.name()]=null,(e=t.el())&&e.parentNode===this.contentEl()&&this.contentEl().removeChild(t.el()))}},t.initChildren=function(){var i,e,t,n=this,r=this.options_.children;r&&(i=this.options_,e=s.getComponent("Tech"),(t=Array.isArray(r)?r:Object.keys(r)).concat(Object.keys(this.options_).filter(function(e){return!t.some(function(t){return"string"==typeof t?e===t:e===t.name})})).map(function(t){var e,t="string"==typeof t?r[e=t]||n.options_[e]||{}:(e=t.name,t);return{name:e,opts:t}}).filter(function(t){t=s.getComponent(t.opts.componentClass||Bt(t.name));return t&&!e.isTech(t)}).forEach(function(t){var e=t.name,t=t.opts;void 0!==i[e]&&(t=i[e]),!1!==t&&(!0===t&&(t={}),t.playerOptions=n.options_.playerOptions,(t=n.addChild(e,t))&&(n[e]=t))}))},t.buildCSSClass=function(){return""},t.ready=function(t,e){if(void 0===e&&(e=!1),t)return this.isReady_?void(e?t.call(this):this.setTimeout(t,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(t))},t.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var t=this.readyQueue_;this.readyQueue_=[],t&&0<t.length&&t.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)},t.$=function(t,e){return K(t,e||this.contentEl())},t.$$=function(t,e){return Q(t,e||this.contentEl())},t.hasClass=function(t){return P(this.el_,t)},t.addClass=function(t){U(this.el_,t)},t.removeClass=function(t){I(this.el_,t)},t.toggleClass=function(t,e){x(this.el_,t,e)},t.show=function(){this.removeClass("vjs-hidden")},t.hide=function(){this.addClass("vjs-hidden")},t.lockShowing=function(){this.addClass("vjs-lock-showing")},t.unlockShowing=function(){this.removeClass("vjs-lock-showing")},t.getAttribute=function(t){return M(this.el_,t)},t.setAttribute=function(t,e){B(this.el_,t,e)},t.removeAttribute=function(t){N(this.el_,t)},t.width=function(t,e){return this.dimension("width",t,e)},t.height=function(t,e){return this.dimension("height",t,e)},t.dimensions=function(t,e){this.width(t,!0),this.height(e)},t.dimension=function(t,e,i){if(void 0!==e)return null!==e&&e==e||(e=0),-1!==(""+e).indexOf("%")||-1!==(""+e).indexOf("px")?this.el_.style[t]=e:this.el_.style[t]="auto"===e?"":e+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;e=this.el_.style[t],i=e.indexOf("px");return-1!==i?parseInt(e.slice(0,i),10):parseInt(this.el_["offset"+Bt(t)],10)},t.currentDimension=function(t){var e,i=0;if("width"!==t&&"height"!==t)throw new Error("currentDimension only accepts width or height value");return"function"==typeof d.getComputedStyle&&(i=(e=d.getComputedStyle(this.el_)).getPropertyValue(t)||e[t]),0===(i=parseFloat(i))&&(t="offset"+Bt(t),i=this.el_[t]),i},t.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},t.currentWidth=function(){return this.currentDimension("width")},t.currentHeight=function(){return this.currentDimension("height")},t.focus=function(){this.el_.focus()},t.blur=function(){this.el_.blur()},t.emitTapEvents=function(){var i,e=0,n=null;this.on("touchstart",function(t){1===t.touches.length&&(n={pageX:t.touches[0].pageX,pageY:t.touches[0].pageY},e=(new Date).getTime(),i=!0)}),this.on("touchmove",function(t){var e;1<t.touches.length?i=!1:n&&(e=t.touches[0].pageX-n.pageX,t=t.touches[0].pageY-n.pageY,10<Math.sqrt(e*e+t*t)&&(i=!1))});function t(){i=!1}this.on("touchleave",t),this.on("touchcancel",t),this.on("touchend",function(t){!(n=null)===i&&(new Date).getTime()-e<200&&(t.preventDefault(),this.trigger("tap"))})},t.enableTouchActivity=function(){var e,i,t;this.player()&&this.player().reportUserActivity&&(e=Ct(this.player(),this.player().reportUserActivity),this.on("touchstart",function(){e(),this.clearInterval(i),i=this.setInterval(e,250)}),t=function(t){e(),this.clearInterval(i)},this.on("touchmove",e),this.on("touchend",t),this.on("touchcancel",t))},t.setTimeout=function(t,e){var i,n,r=this;return t=Ct(this,t),i=d.setTimeout(function(){r.off("dispose",n),t()},e),(n=function(){return r.clearTimeout(i)}).guid="vjs-timeout-"+i,this.on("dispose",n),i},t.clearTimeout=function(t){d.clearTimeout(t);function e(){}return e.guid="vjs-timeout-"+t,this.off("dispose",e),t},t.setInterval=function(t,e){var i=this;t=Ct(this,t);var n=d.setInterval(t,e),e=function(){return i.clearInterval(n)};return e.guid="vjs-interval-"+n,this.on("dispose",e),n},t.clearInterval=function(t){d.clearInterval(t);function e(){}return e.guid="vjs-interval-"+t,this.off("dispose",e),t},t.requestAnimationFrame=function(t){var e,i,n=this;return this.supportsRaf_?(t=Ct(this,t),e=d.requestAnimationFrame(function(){n.off("dispose",i),t()}),(i=function(){return n.cancelAnimationFrame(e)}).guid="vjs-raf-"+e,this.on("dispose",i),e):this.setTimeout(t,1e3/60)},t.cancelAnimationFrame=function(t){if(this.supportsRaf_){d.cancelAnimationFrame(t);function e(){}return e.guid="vjs-raf-"+t,this.off("dispose",e),t}return this.clearTimeout(t)},s.registerComponent=function(t,e){if("string"!=typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var i=s.getComponent("Tech"),n=i&&i.isTech(e),i=s===e||s.prototype.isPrototypeOf(e.prototype);if(n||!i){var r=n?"techs must be registered using Tech.registerTech()":"must be a Component subclass";throw new Error('Illegal component, "'+t+'"; '+r+".")}t=Bt(t),s.components_||(s.components_={});r=s.getComponent("Player");if("Player"===t&&r&&r.players){var a=r.players,r=Object.keys(a);if(a&&0<r.length&&r.map(function(t){return a[t]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return s.components_[t]=e},s.getComponent=function(t){if(t)return t=Bt(t),s.components_&&s.components_[t]?s.components_[t]:void 0},s}();jt.prototype.supportsRaf_="function"==typeof d.requestAnimationFrame&&"function"==typeof d.cancelAnimationFrame,jt.registerComponent("Component",jt);var Ft=d.navigator&&d.navigator.userAgent||"",Vt=/AppleWebKit\/([\d.]+)/i.exec(Ft),Ht=Vt?parseFloat(Vt.pop()):null,qt=/iPad/i.test(Ft),zt=/iPhone/i.test(Ft)&&!qt,Wt=/iPod/i.test(Ft),Gt=zt||qt||Wt,Xt=(qe=Ft.match(/OS (\d+)_/i))&&qe[1]?qe[1]:null,Yt=/Android/i.test(Ft),$t=function(){var t=Ft.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;var e=t[1]&&parseFloat(t[1]),i=t[2]&&parseFloat(t[2]);return e&&i?parseFloat(t[1]+"."+t[2]):e||null}(),Kt=Yt&&$t<5&&Ht<537,Qt=/Firefox/i.test(Ft),Jt=/Edge/i.test(Ft),Zt=!Jt&&(/Chrome/i.test(Ft)||/CriOS/i.test(Ft)),te=(di=Ft.match(/(Chrome|CriOS)\/(\d+)/))&&di[2]?parseFloat(di[2]):null,ee=(!(pi=(pi=/MSIE\s(\d+)\.\d/.exec(Ft))&&parseFloat(pi[1]))&&/Trident\/7.0/i.test(Ft)&&/rv:11.0/.test(Ft)&&(pi=11),pi),ie=/Safari/i.test(Ft)&&!Zt&&!Yt&&!Jt,ne=(ie||Gt)&&!Zt,re=k()&&("ontouchstart"in d||d.navigator.maxTouchPoints||d.DocumentTouch&&d.document instanceof d.DocumentTouch),ae=Object.freeze({IS_IPAD:qt,IS_IPHONE:zt,IS_IPOD:Wt,IS_IOS:Gt,IOS_VERSION:Xt,IS_ANDROID:Yt,ANDROID_VERSION:$t,IS_NATIVE_ANDROID:Kt,IS_FIREFOX:Qt,IS_EDGE:Jt,IS_CHROME:Zt,CHROME_VERSION:te,IE_VERSION:ee,IS_SAFARI:ie,IS_ANY_SAFARI:ne,TOUCH_ENABLED:re});function se(t,e,i,n){return function(t,e,i){if("number"!=typeof e||e<0||i<e)throw new Error("Failed to execute '"+t+"' on 'TimeRanges': The index provided ("+e+") is non-numeric or out of bounds (0-"+i+").")}(t,n,i.length-1),i[n][e]}function oe(t){return void 0===t||0===t.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:t.length,start:se.bind(null,"start",0,t),end:se.bind(null,"end",1,t)}}function ue(t,e){return Array.isArray(t)?oe(t):void 0===t||void 0===e?oe():oe([[t,e]])}function le(t,e){var i,n,r=0;if(!e)return 0;t&&t.length||(t=ue(0,0));for(var a=0;a<t.length;a++)i=t.start(a),e<(n=t.end(a))&&(n=e),r+=n-i;return r/e}for(var ce,he={},de=[["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"]],pe=de[0],fe=0;fe<de.length;fe++)if(de[fe][1]in h){ce=de[fe];break}if(ce)for(var me=0;me<ce.length;me++)he[pe[me]]=ce[me];function ge(t){if(t instanceof ge)return t;"number"==typeof t?this.code=t:"string"==typeof t?this.message=t:v(t)&&("number"==typeof t.code&&(this.code=t.code),y(this,t)),this.message||(this.message=ge.defaultMessages[this.code]||"")}ge.prototype.code=0,ge.prototype.message="",ge.prototype.status=null,ge.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],ge.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 ye=0;ye<ge.errorTypes.length;ye++)ge[ge.errorTypes[ye]]=ye,ge.prototype[ge.errorTypes[ye]]=ye;var ve=function(t,e){var i,n=null;try{i=JSON.parse(t,e)}catch(t){n=t}return[n,i]};function _e(t){return null!=t&&"function"==typeof t.then}function be(t){_e(t)&&t.then(null,function(t){})}function Te(n){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(t,e,i){return n[e]&&(t[e]=n[e]),t},{cues:n.cues&&Array.prototype.map.call(n.cues,function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}})})}var Se=function(t){var e=t.$$("track"),i=Array.prototype.map.call(e,function(t){return t.track});return Array.prototype.map.call(e,function(t){var e=Te(t.track);return t.src&&(e.src=t.src),e}).concat(Array.prototype.filter.call(t.textTracks(),function(t){return-1===i.indexOf(t)}).map(Te))},ke=function(t,i){return t.forEach(function(t){var e=i.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(function(t){return e.addCue(t)})}),i.textTracks()},we="vjs-modal-dialog",Ce=function(i){function t(t,e){e=i.call(this,t,e)||this;return e.opened_=e.hasBeenOpened_=e.hasBeenFilled_=!1,e.closeable(!e.options_.uncloseable),e.content(e.options_.content),e.contentEl_=A("div",{className:we+"-content"},{role:"document"}),e.descEl_=A("p",{className:we+"-description vjs-control-text",id:e.el().getAttribute("aria-describedby")}),L(e.descEl_,e.description()),e.el_.appendChild(e.descEl_),e.el_.appendChild(e.contentEl_),e}p(t,i);var e=t.prototype;return e.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"})},e.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,i.prototype.dispose.call(this)},e.buildCSSClass=function(){return we+" vjs-hidden "+i.prototype.buildCSSClass.call(this)},e.handleKeyPress=function(t){27===t.which&&this.closeable()&&this.close()},e.label=function(){return this.localize(this.options_.label||"Modal Window")},e.description=function(){var t=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(t+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),t},e.open=function(){var t;this.opened_||(t=this.player(),this.trigger("beforemodalopen"),this.opened_=!0,!this.options_.fillAlways&&(this.hasBeenOpened_||this.hasBeenFilled_)||this.fill(),this.wasPlaying_=!t.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&t.pause(),this.closeable()&&this.on(this.el_.ownerDocument,"keydown",Ct(this,this.handleKeyPress)),this.hadControls_=t.controls(),t.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0)},e.opened=function(t){return"boolean"==typeof t&&this[t?"open":"close"](),this.opened_},e.close=function(){var t;this.opened_&&(t=this.player(),this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&t.play(),this.closeable()&&this.off(this.el_.ownerDocument,"keydown",Ct(this,this.handleKeyPress)),this.hadControls_&&t.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose())},e.closeable=function(t){var e,i;return"boolean"==typeof t&&(e=this.closeable_=!!t,i=this.getChild("closeButton"),e&&!i&&(t=this.contentEl_,this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=t,this.on(i,"close",this.close)),!e&&i&&(this.off(i,"close",this.close),this.removeChild(i),i.dispose())),this.closeable_},e.fill=function(){this.fillWith(this.content())},e.fillWith=function(t){var e=this.contentEl(),i=e.parentNode,n=e.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(e),this.empty(),Y(e,t),this.trigger("modalfill"),n?i.insertBefore(e,n):i.appendChild(e);e=this.getChild("closeButton");e&&i.appendChild(e.el_)},e.empty=function(){this.trigger("beforemodalempty"),W(this.contentEl()),this.trigger("modalempty")},e.content=function(t){return void 0!==t&&(this.content_=t),this.content_},e.conditionalFocus_=function(){var t=h.activeElement,e=this.player_.el_;this.previouslyActiveEl_=null,!e.contains(t)&&e!==t||(this.previouslyActiveEl_=t,this.focus(),this.on(h,"keydown",this.handleKeyDown))},e.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null),this.off(h,"keydown",this.handleKeyDown)},e.handleKeyDown=function(t){if(9===t.which){for(var e,i=this.focusableEls_(),n=this.el_.querySelector(":focus"),r=0;r<i.length;r++)if(n===i[r]){e=r;break}h.activeElement===this.el_&&(e=0),t.shiftKey&&0===e?(i[i.length-1].focus(),t.preventDefault()):t.shiftKey||e!==i.length-1||(i[0].focus(),t.preventDefault())}},e.focusableEls_=function(){var t=this.el_.querySelectorAll("*");return Array.prototype.filter.call(t,function(t){return(t instanceof d.HTMLAnchorElement||t instanceof d.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof d.HTMLInputElement||t instanceof d.HTMLSelectElement||t instanceof d.HTMLTextAreaElement||t instanceof d.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof d.HTMLIFrameElement||t instanceof d.HTMLObjectElement||t instanceof d.HTMLEmbedElement||t.hasAttribute("tabindex")&&-1!==t.getAttribute("tabindex")||t.hasAttribute("contenteditable")})},t}(jt);Ce.prototype.options_={pauseOnOpen:!0,temporary:!0},jt.registerComponent("ModalDialog",Ce);var Ee,Ae=function(n){function t(t){var e;void 0===t&&(t=[]),(e=n.call(this)||this).tracks_=[],Object.defineProperty(l(l(e)),"length",{get:function(){return this.tracks_.length}});for(var i=0;i<t.length;i++)e.addTrack(t[i]);return e}p(t,n);var e=t.prototype;return e.addTrack=function(t){var e=this.tracks_.length;""+e in this||Object.defineProperty(this,e,{get:function(){return this.tracks_[e]}}),-1===this.tracks_.indexOf(t)&&(this.tracks_.push(t),this.trigger({track:t,type:"addtrack"}))},e.removeTrack=function(t){for(var e,i=0,n=this.length;i<n;i++)if(this[i]===t){(e=this[i]).off&&e.off(),this.tracks_.splice(i,1);break}e&&this.trigger({track:e,type:"removetrack"})},e.getTrackById=function(t){for(var e=null,i=0,n=this.length;i<n;i++){var r=this[i];if(r.id===t){e=r;break}}return e},t}(kt);for(Ee in Ae.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack"},Ae.prototype.allowedEvents_)Ae.prototype["on"+Ee]=null;function Le(t,e){for(var i=0;i<t.length;i++)Object.keys(t[i]).length&&e.id!==t[i].id&&(t[i].enabled=!1)}function Oe(t,e){for(var i=0;i<t.length;i++)Object.keys(t[i]).length&&e.id!==t[i].id&&(t[i].selected=!1)}function Pe(t){var e=["protocol","hostname","port","pathname","search","hash","host"],i=h.createElement("a");i.href=t;var n,r=""===i.host&&"file:"!==i.protocol;r&&((n=h.createElement("div")).innerHTML='<a href="'+t+'"></a>',i=n.firstChild,n.setAttribute("style","display:none; position:absolute;"),h.body.appendChild(n));for(var a={},s=0;s<e.length;s++)a[e[s]]=i[e[s]];return"http:"===a.protocol&&(a.host=a.host.replace(/:80$/,"")),"https:"===a.protocol&&(a.host=a.host.replace(/:443$/,"")),a.protocol||(a.protocol=d.location.protocol),r&&h.body.removeChild(n),a}function Ue(t){var e;return t.match(/^https?:\/\//)||((e=h.createElement("div")).innerHTML='<a href="'+t+'">x</a>',t=e.firstChild.href),t}function Ie(t){if("string"==typeof t){t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i.exec(t);if(t)return t.pop().toLowerCase()}return""}function xe(t){var e=d.location;return(":"===(t=Pe(t)).protocol?e:t).protocol+t.host!==e.protocol+e.host}var De=function(n){function t(t){var e;void 0===t&&(t=[]);for(var i=t.length-1;0<=i;i--)if(t[i].enabled){Le(t,t[i]);break}return(e=n.call(this,t)||this).changing_=!1,e}return p(t,n),t.prototype.addTrack=function(t){var e=this;t.enabled&&Le(this,t),n.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("enabledchange",function(){e.changing_||(e.changing_=!0,Le(e,t),e.changing_=!1,e.trigger("change"))})},t}(Ae),Re=function(n){function t(t){var e;void 0===t&&(t=[]);for(var i=t.length-1;0<=i;i--)if(t[i].selected){Oe(t,t[i]);break}return(e=n.call(this,t)||this).changing_=!1,Object.defineProperty(l(l(e)),"selectedIndex",{get:function(){for(var t=0;t<this.length;t++)if(this[t].selected)return t;return-1},set:function(){}}),e}return p(t,n),t.prototype.addTrack=function(t){var e=this;t.selected&&Oe(this,t),n.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("selectedchange",function(){e.changing_||(e.changing_=!0,Oe(e,t),e.changing_=!1,e.trigger("change"))})},t}(Ae),Me=function(e){function t(){return e.apply(this,arguments)||this}return p(t,e),t.prototype.addTrack=function(t){e.prototype.addTrack.call(this,t),t.addEventListener("modechange",Ct(this,function(){this.queueTrigger("change")}));-1===["metadata","chapters"].indexOf(t.kind)&&t.addEventListener("modechange",Ct(this,function(){this.trigger("selectedlanguagechange")}))},t}(Ae),Be=function(){function t(t){void 0===t&&(t=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var e=0,i=t.length;e<i;e++)this.addTrackElement_(t[e])}var e=t.prototype;return e.addTrackElement_=function(t){var e=this.trackElements_.length;""+e in this||Object.defineProperty(this,e,{get:function(){return this.trackElements_[e]}}),-1===this.trackElements_.indexOf(t)&&this.trackElements_.push(t)},e.getTrackElementByTrack_=function(t){for(var e,i=0,n=this.trackElements_.length;i<n;i++)if(t===this.trackElements_[i].track){e=this.trackElements_[i];break}return e},e.removeTrackElement_=function(t){for(var e=0,i=this.trackElements_.length;e<i;e++)if(t===this.trackElements_[e]){this.trackElements_.splice(e,1);break}},t}(),Ne=function(){function e(t){e.prototype.setCues_.call(this,t),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var t=e.prototype;return t.setCues_=function(t){var e=this.length||0,i=0,n=t.length;this.cues_=t,this.length_=t.length;function r(t){""+t in this||Object.defineProperty(this,""+t,{get:function(){return this.cues_[t]}})}if(e<n)for(i=e;i<n;i++)r.call(this,i)},t.getCueById=function(t){for(var e=null,i=0,n=this.length;i<n;i++){var r=this[i];if(r.id===t){e=r;break}}return e},e}(),je={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Fe={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Ve={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},He={disabled:"disabled",hidden:"hidden",showing:"showing"},Vt=function(r){function t(t){var e;void 0===t&&(t={}),e=r.call(this)||this;var i,n={id:t.id||"vjs_track_"+Z++,kind:t.kind||"",label:t.label||"",language:t.language||""};for(i in n)!function(t){Object.defineProperty(l(l(e)),t,{get:function(){return n[t]},set:function(){}})}(i);return e}return p(t,r),t}(kt),qe=Object.freeze({parseUrl:Pe,getAbsoluteURL:Ue,getFileExtension:Ie,isCrossOrigin:xe}),ze=function(t){var e=We.call(t);return"[object Function]"===e||"function"==typeof t&&"[object RegExp]"!==e||"undefined"!=typeof window&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)},We=Object.prototype.toString;function Ge(t,e){return t(e={exports:{}},e.exports),e.exports}function Xe(t){try{var e=Ke.call(t);return Qe.test(e)}catch(t){return}}function Ye(t){return t&&(("function"==typeof t||"object"==typeof t)&&("function"==typeof t&&!t.prototype||(Ze?function(t){try{return Xe(t)?!1:(Ke.call(t),!0)}catch(t){return!1}}(t):!Xe(t)&&("[object Function]"===(t=Je.call(t))||"[object GeneratorFunction]"===t))))}var $e=Ge(function(t,e){(e=t.exports=function(t){return t.replace(/^\s*|\s*$/g,"")}).left=function(t){return t.replace(/^\s*/,"")},e.right=function(t){return t.replace(/\s*$/,"")}}),Ke=($e.left,$e.right,Function.prototype.toString),Qe=/^\s*class\b/,Je=Object.prototype.toString,Ze="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,ti=Object.prototype.toString,ei=Object.prototype.hasOwnProperty,ii=function(t,e,i){if(!Ye(e))throw new TypeError("iterator must be a function");var n;3<=arguments.length&&(n=i),("[object Array]"===ti.call(t)?function(t,e,i){for(var n=0,r=t.length;n<r;n++)ei.call(t,n)&&(null==i?e(t[n],n,t):e.call(i,t[n],n,t))}:"string"==typeof t?function(t,e,i){for(var n=0,r=t.length;n<r;n++)null==i?e(t.charAt(n),n,t):e.call(i,t.charAt(n),n,t)}:function(t,e,i){for(var n in t)ei.call(t,n)&&(null==i?e(t[n],n,t):e.call(i,t[n],n,t))})(t,e,n)},ni=function(t){if(!t)return{};var n={};return ii($e(t).split("\n"),function(t){var e=t.indexOf(":"),i=$e(t.slice(0,e)).toLowerCase(),t=$e(t.slice(e+1));void 0===n[i]?n[i]=t:(e=n[i],"[object Array]"===Object.prototype.toString.call(e)?n[i].push(t):n[i]=[n[i],t])}),n},ri=function(){for(var t={},e=0;e<arguments.length;e++){var i,n=arguments[e];for(i in n)ai.call(n,i)&&(t[i]=n[i])}return t},ai=Object.prototype.hasOwnProperty;var si=ui;function oi(t,e,i){var n=t;return ze(e)?(i=e,"string"==typeof t&&(n={uri:t})):n=ri(e,{uri:t}),n.callback=i,n}function ui(t,e,i){return li(e=oi(t,e,i))}function li(n){if(void 0===n.callback)throw new Error("callback argument missing");var r=!1,a=function(t,e,i){r||(r=!0,n.callback(t,e,i))};function s(){var t=void 0,t=l.response||l.responseText||function(t){if("document"===t.responseType)return t.responseXML;var e=t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;return""!==t.responseType||e?null:t.responseXML}(l);if(m)try{t=JSON.parse(t)}catch(t){}return t}function e(t){return clearTimeout(u),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,a(t,g)}function t(){if(!o){var t;clearTimeout(u),t=n.useXDR&&void 0===l.status?200:1223===l.status?204:l.status;var e=g,i=null;return 0!==t?(e={body:s(),statusCode:t,method:h,headers:{},url:c,rawRequest:l},l.getAllResponseHeaders&&(e.headers=ni(l.getAllResponseHeaders()))):i=new Error("Internal XMLHttpRequest Error"),a(i,e,e.body)}}var i,o,u,l=n.xhr||null,c=(l=l||new(n.cors||n.useXDR?ui.XDomainRequest:ui.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(t,0)},l.onload=t,l.onerror=e,l.onprogress=function(){},l.onabort=function(){o=!0},l.ontimeout=e,l.open(h,c,!f,n.username,n.password),f||(l.withCredentials=!!n.withCredentials),!f&&0<n.timeout&&(u=setTimeout(function(){var t;o||(o=!0,l.abort("timeout"),(t=new Error("XMLHttpRequest timeout")).code="ETIMEDOUT",e(t))},n.timeout)),l.setRequestHeader)for(i in p)p.hasOwnProperty(i)&&l.setRequestHeader(i,p[i]);else if(n.headers&&!function(t){for(var e in t)if(t.hasOwnProperty(e))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}ui.XMLHttpRequest=d.XMLHttpRequest||function(){},ui.XDomainRequest="withCredentials"in new ui.XMLHttpRequest?ui.XMLHttpRequest:d.XDomainRequest,function(t,e){for(var i=0;i<t.length;i++)e(t[i])}(["get","put","post","patch","head","delete"],function(n){ui["delete"===n?"del":n]=function(t,e,i){return(e=oi(t,e,i)).method=n.toUpperCase(),li(e)}});function ci(t,e){var i=new d.WebVTT.Parser(d,d.vttjs,d.WebVTT.StringDecoder()),n=[];i.oncue=function(t){e.addCue(t)},i.onparsingerror=function(t){n.push(t)},i.onflush=function(){e.trigger({type:"loadeddata",target:e})},i.parse(t),0<n.length&&(d.console&&d.console.groupCollapsed&&d.console.groupCollapsed("Text Track parsing errors for "+e.src),n.forEach(function(t){return f.error(t)}),d.console&&d.console.groupEnd&&d.console.groupEnd()),i.flush()}var hi=function(u){function t(t){var e;if(void 0===t&&(t={}),!t.tech)throw new Error("A tech was not provided.");var t=Nt(t,{kind:Ve[t.kind]||"subtitles",language:t.language||t.srclang||""}),i=He[t.mode]||"disabled",n=t.default;"metadata"!==t.kind&&"chapters"!==t.kind||(i="hidden"),(e=u.call(this,t)||this).tech_=t.tech,e.cues_=[],e.activeCues_=[];var r=new Ne(e.cues_),s=new Ne(e.activeCues_),o=!1,a=Ct(l(l(e)),function(){this.activeCues=this.activeCues,o&&(this.trigger("cuechange"),o=!1)});return"disabled"!==i&&e.tech_.ready(function(){e.tech_.on("timeupdate",a)},!0),Object.defineProperties(l(l(e)),{default:{get:function(){return n},set:function(){}},mode:{get:function(){return i},set:function(t){var e=this;He[t]&&("disabled"!==(i=t)?this.tech_.ready(function(){e.tech_.on("timeupdate",a)},!0):this.tech_.off("timeupdate",a),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 s;for(var t=this.tech_.currentTime(),e=[],i=0,n=this.cues.length;i<n;i++){var r=this.cues[i];(r.startTime<=t&&r.endTime>=t||r.startTime===r.endTime&&r.startTime<=t&&r.startTime+.5>=t)&&e.push(r)}if(o=!1,e.length!==this.activeCues_.length)o=!0;else for(var a=0;a<e.length;a++)-1===this.activeCues_.indexOf(e[a])&&(o=!0);return this.activeCues_=e,s.setCues_(this.activeCues_),s},set:function(){}}}),t.src?(e.src=t.src,function(t,r){var e={uri:t};(t=xe(t))&&(e.cors=t),si(e,Ct(this,function(t,e,i){return t?f.error(t,e):(r.loaded_=!0,void("function"!=typeof d.WebVTT?r.tech_&&(n=function(){return ci(i,r)},r.tech_.on("vttjsloaded",n),r.tech_.on("vttjserror",function(){f.error("vttjs failed to load, stopping trying to process "+r.src),r.tech_.off("vttjsloaded",n)})):ci(i,r)));var n}))}(t.src,l(l(e)))):e.loaded_=!0,e}p(t,u);var e=t.prototype;return e.addCue=function(t){var e=t;if(d.vttjs&&!(t instanceof d.vttjs.VTTCue)){for(var i in e=new d.vttjs.VTTCue(t.startTime,t.endTime,t.text),t)i in e||(e[i]=t[i]);e.id=t.id,e.originalCue_=t}for(var n=this.tech_.textTracks(),r=0;r<n.length;r++)n[r]!==this&&n[r].removeCue(e);this.cues_.push(e),this.cues.setCues_(this.cues_)},e.removeCue=function(t){for(var e=this.cues_.length;e--;){var i=this.cues_[e];if(i===t||i.originalCue_&&i.originalCue_===t){this.cues_.splice(e,1),this.cues.setCues_(this.cues_);break}}},t}(Vt);hi.prototype.allowedEvents_={cuechange:"cuechange"};var Ht=function(n){function t(t){void 0===t&&(t={});var e=Nt(t,{kind:Fe[t.kind]||""}),t=n.call(this,e)||this,i=!1;return Object.defineProperty(l(l(t)),"enabled",{get:function(){return i},set:function(t){"boolean"==typeof t&&t!==i&&(i=t,this.trigger("enabledchange"))}}),e.enabled&&(t.enabled=e.enabled),t.loaded_=!0,t}return p(t,n),t}(Vt),di=function(n){function t(t){void 0===t&&(t={});var e=Nt(t,{kind:je[t.kind]||""}),t=n.call(this,e)||this,i=!1;return Object.defineProperty(l(l(t)),"selected",{get:function(){return i},set:function(t){"boolean"==typeof t&&t!==i&&(i=t,this.trigger("selectedchange"))}}),e.selected&&(t.selected=e.selected),t}return p(t,n),t}(Vt),pi=function(r){function t(t){var e,i;void 0===t&&(t={}),e=r.call(this)||this;var n=new hi(t);return e.kind=n.kind,e.src=n.src,e.srclang=n.language,e.label=n.label,e.default=n.default,Object.defineProperties(l(l(e)),{readyState:{get:function(){return i}},track:{get:function(){return n}}}),i=0,n.addEventListener("loadeddata",function(){i=2,e.trigger({type:"load",target:l(l(e))})}),e}return p(t,r),t}(kt);pi.prototype.allowedEvents_={load:"load"},pi.NONE=0,pi.LOADING=1,pi.LOADED=2,pi.ERROR=3;var fi={audio:{ListClass:De,TrackClass:Ht,capitalName:"Audio"},video:{ListClass:Re,TrackClass:di,capitalName:"Video"},text:{ListClass:Me,TrackClass:hi,capitalName:"Text"}};Object.keys(fi).forEach(function(t){fi[t].getterName=t+"Tracks",fi[t].privateName=t+"Tracks_"});var mi={remoteText:{ListClass:Me,TrackClass:hi,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Be,TrackClass:pi,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},gi=Nt(fi,mi);mi.names=Object.keys(mi),fi.names=Object.keys(fi),gi.names=[].concat(mi.names).concat(fi.names);var yi=Object.create||function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return vi.prototype=t,new vi};function vi(){}function _i(t,e){this.name="ParsingError",this.code=t.code,this.message=e||t.message}function bi(t){function e(t,e,i,n){return 3600*(0|t)+60*(0|e)+(0|i)+(0|n)/1e3}t=t.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return t?t[3]?e(t[1],t[2],t[3].replace(":",""),t[4]):59<t[1]?e(t[1],t[2],0,t[4]):e(0,t[1],t[2],t[4]):null}function Ti(){this.values=yi(null)}function Si(t,e,i,n){var r,a,s=n?t.split(n):[t];for(r in s)"string"==typeof s[r]&&(2===(a=s[r].split(i)).length&&e(a[0],a[1]))}((_i.prototype=yi(Error.prototype)).constructor=_i).Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},Ti.prototype={set:function(t,e){this.get(t)||""===e||(this.values[t]=e)},get:function(t,e,i){return i?this.has(t)?this.values[t]:e[i]:this.has(t)?this.values[t]:e},has:function(t){return t in this.values},alt:function(t,e,i){for(var n=0;n<i.length;++n)if(e===i[n]){this.set(t,e);break}},integer:function(t,e){/^-?\d+$/.test(e)&&this.set(t,parseInt(e,10))},percent:function(t,e){return!!(e.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&0<=(e=parseFloat(e))&&e<=100)&&(this.set(t,e),!0)}};var ki={"&amp;":"&","&lt;":"<","&gt;":">","&lrm;":"‎","&rlm;":"‏","&nbsp;":" "},wi={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},Ci={v:"title",lang:"lang"},Ei={rt:"ruby"};function Ai(r,e){function i(t){return ki[t]}for(var t,n,a,s,o,u,l=r.document.createElement("div"),c=l,h=[];null!==(t=function(){if(!e)return null;var t=e.match(/^([^<]*)(<[^>]*>?)?/);return t=t[1]||t[2],e=e.substr(t.length),t}());)"<"!==t[0]?c.appendChild(r.document.createTextNode(function(t){for(;s=t.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)t=t.replace(s[0],i);return t}(t))):"/"!==t[1]?(n=bi(t.substr(1,t.length-2)))?(a=r.document.createProcessingInstruction("timestamp",n),c.appendChild(a)):(s=t.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/))&&(a=function(t,e){var i=wi[t];if(!i)return null;var n=r.document.createElement(i);return n.localName=i,(t=Ci[t])&&e&&(n[t]=e.trim()),n}(s[1],s[3]))&&(o=c,Ei[(u=a).localName]&&Ei[u.localName]!==o.localName||(s[2]&&(a.className=s[2].substr(1).replace("."," ")),h.push(s[1]),c.appendChild(a),c=a)):h.length&&h[h.length-1]===t.substr(2).replace(">","")&&(h.pop(),c=c.parentNode);return l}var Li=[[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 Oi(t){var e=[],i="";if(!t||!t.childNodes)return"ltr";function a(t,e){for(var i=e.childNodes.length-1;0<=i;i--)t.push(e.childNodes[i])}for(a(e,t);i=function t(e){if(!e||!e.length)return null;var i=e.pop(),n=i.textContent||i.innerText;if(n){var r=n.match(/^.*(\n|\r)/);return r?r[e.length=0]:n}return"ruby"===i.tagName?t(e):i.childNodes?(a(e,i),t(e)):void 0}(e);)for(var n=0;n<i.length;n++)if(function(t){for(var e=0;e<Li.length;e++){var i=Li[e];if(t>=i[0]&&t<=i[1])return 1}}(i.charCodeAt(n)))return"rtl";return"ltr"}function Pi(){}function Ui(t,e,i){Pi.call(this),this.cue=e,this.cueDiv=Ai(t,e.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:""===e.vertical?"horizontal-tb":"lr"===e.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(n,this.cueDiv),this.div=t.document.createElement("div"),n={direction:Oi(this.cueDiv),writingMode:""===e.vertical?"horizontal-tb":"lr"===e.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===e.align?"center":e.align,font:i.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(n),this.div.appendChild(this.cueDiv);var r=0;switch(e.positionAlign){case"start":r=e.position;break;case"middle":r=e.position-e.size/2;break;case"end":r=e.position-e.size}""===e.vertical?this.applyStyles({left:this.formatStyle(r,"%"),width:this.formatStyle(e.size,"%")}):this.applyStyles({top:this.formatStyle(r,"%"),height:this.formatStyle(e.size,"%")}),this.move=function(t){this.applyStyles({top:this.formatStyle(t.top,"px"),bottom:this.formatStyle(t.bottom,"px"),left:this.formatStyle(t.left,"px"),right:this.formatStyle(t.right,"px"),height:this.formatStyle(t.height,"px"),width:this.formatStyle(t.width,"px")})}}function Ii(t){var e,i,n,r;t.div&&(e=t.div.offsetHeight,i=t.div.offsetWidth,n=t.div.offsetTop,r=(r=t.div.childNodes)&&(r=r[0])&&r.getClientRects&&r.getClientRects(),t=t.div.getBoundingClientRect(),r=r?Math.max(r[0]&&r[0].height||0,t.height/r.length):0),this.left=t.left,this.right=t.right,this.top=t.top||n,this.height=t.height||e,this.bottom=t.bottom||n+(t.height||e),this.width=t.width||i,this.lineHeight=void 0!==r?r:t.lineHeight}function xi(t,e,o,u){var i,n=new Ii(e),r=e.cue,a=function(t){if("number"==typeof t.line&&(t.snapToLines||0<=t.line&&t.line<=100))return t.line;if(!t.track||!t.track.textTrackList||!t.track.textTrackList.mediaElement)return-1;for(var e=t.track,i=e.textTrackList,n=0,r=0;r<i.length&&i[r]!==e;r++)"showing"===i[r].mode&&n++;return-1*++n}(r),s=[];if(r.snapToLines){switch(r.vertical){case"":s=["+y","-y"],i="height";break;case"rl":s=["+x","-x"],i="width";break;case"lr":s=["-x","+x"],i="width"}var l=n.lineHeight,c=l*Math.round(a),h=o[i]+l,d=s[0];Math.abs(c)>h&&(c=c<0?-1:1,c*=Math.ceil(h/l)*l),a<0&&(c+=""===r.vertical?o.height:o.width,s=s.reverse()),n.move(d,c)}else{var p=n.lineHeight/o.height*100;switch(r.lineAlign){case"middle":a-=p/2;break;case"end":a-=p}switch(r.vertical){case"":e.applyStyles({top:e.formatStyle(a,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(a,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(a,"%")})}s=["+y","-x","+x","-y"],n=new Ii(e)}n=function(t,e){for(var i,n=new Ii(t),r=1,a=0;a<e.length;a++){for(;t.overlapsOppositeAxis(o,e[a])||t.within(o)&&t.overlapsAny(u);)t.move(e[a]);if(t.within(o))return t;var s=t.intersectPercentage(o);s<r&&(i=new Ii(t),r=s),t=new Ii(n)}return i||n}(n,s);e.move(n.toCSSCompatValues(o))}function Di(){}Pi.prototype.applyStyles=function(t,e){for(var i in e=e||this.div,t)t.hasOwnProperty(i)&&(e.style[i]=t[i])},Pi.prototype.formatStyle=function(t,e){return 0===t?0:t+e},(Ui.prototype=yi(Pi.prototype)).constructor=Ui,Ii.prototype.move=function(t,e){switch(e=void 0!==e?e:this.lineHeight,t){case"+x":this.left+=e,this.right+=e;break;case"-x":this.left-=e,this.right-=e;break;case"+y":this.top+=e,this.bottom+=e;break;case"-y":this.top-=e,this.bottom-=e}},Ii.prototype.overlaps=function(t){return this.left<t.right&&this.right>t.left&&this.top<t.bottom&&this.bottom>t.top},Ii.prototype.overlapsAny=function(t){for(var e=0;e<t.length;e++)if(this.overlaps(t[e]))return!0;return!1},Ii.prototype.within=function(t){return this.top>=t.top&&this.bottom<=t.bottom&&this.left>=t.left&&this.right<=t.right},Ii.prototype.overlapsOppositeAxis=function(t,e){switch(e){case"+x":return this.left<t.left;case"-x":return this.right>t.right;case"+y":return this.top<t.top;case"-y":return this.bottom>t.bottom}},Ii.prototype.intersectPercentage=function(t){return Math.max(0,Math.min(this.right,t.right)-Math.max(this.left,t.left))*Math.max(0,Math.min(this.bottom,t.bottom)-Math.max(this.top,t.top))/(this.height*this.width)},Ii.prototype.toCSSCompatValues=function(t){return{top:this.top-t.top,bottom:t.bottom-this.bottom,left:this.left-t.left,right:t.right-this.right,height:this.height,width:this.width}},Ii.getSimpleBoxPosition=function(t){var e=t.div?t.div.offsetHeight:t.tagName?t.offsetHeight:0,i=t.div?t.div.offsetWidth:t.tagName?t.offsetWidth:0,n=t.div?t.div.offsetTop:t.tagName?t.offsetTop:0;return{left:(t=t.div?t.div.getBoundingClientRect():t.tagName?t.getBoundingClientRect():t).left,right:t.right,top:t.top||n,height:t.height||e,bottom:t.bottom||n+(t.height||e),width:t.width||i}},Di.StringDecoder=function(){return{decode:function(t){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}},Di.convertCueToDOMTree=function(t,e){return t&&e?Ai(t,e):null};Di.processCues=function(n,r,t){if(!n||!r||!t)return null;for(;t.firstChild;)t.removeChild(t.firstChild);var a=n.document.createElement("div");if(a.style.position="absolute",a.style.left="0",a.style.right="0",a.style.top="0",a.style.bottom="0",a.style.margin="1.5%",t.appendChild(a),function(t){for(var e=0;e<t.length;e++)if(t[e].hasBeenReset||!t[e].displayState)return 1}(r)){var s=[],o=Ii.getSimpleBoxPosition(a),u={font:Math.round(.05*o.height*100)/100+"px sans-serif"};!function(){for(var t,e,i=0;i<r.length;i++)e=r[i],t=new Ui(n,e,u),a.appendChild(t.div),xi(0,t,o,s),e.displayState=t.div,s.push(Ii.getSimpleBoxPosition(t))}()}else for(var e=0;e<r.length;e++)a.appendChild(r[e].displayState)},(Di.Parser=function(t,e,i){i||(i=e,e={}),e=e||{},this.window=t,this.vttjs=e,this.state="INITIAL",this.buffer="",this.decoder=i||new TextDecoder("utf8"),this.regionList=[]}).prototype={reportOrThrowError:function(t){if(!(t instanceof _i))throw t;this.onparsingerror&&this.onparsingerror(t)},parse:function(t){var e,n=this;function i(){for(var t=n.buffer,e=0;e<t.length&&"\r"!==t[e]&&"\n"!==t[e];)++e;var i=t.substr(0,e);return"\r"===t[e]&&++e,"\n"===t[e]&&++e,n.buffer=t.substr(e),i}function r(t){t.match(/X-TIMESTAMP-MAP/)?Si(t,function(t,e){var i;"X-TIMESTAMP-MAP"===t&&(e=e,i=new Ti,Si(e,function(t,e){switch(t){case"MPEGT":i.integer(t+"S",e);break;case"LOCA":i.set(t+"L",bi(e))}},/[^\d]:/,/,/),n.ontimestampmap&&n.ontimestampmap({MPEGTS:i.get("MPEGTS"),LOCAL:i.get("LOCAL")}))},/=/):Si(t,function(t,e){var r;"Region"===t&&(e=e,r=new Ti,Si(e,function(t,e){switch(t){case"id":r.set(t,e);break;case"width":r.percent(t,e);break;case"lines":r.integer(t,e);break;case"regionanchor":case"viewportanchor":var i=e.split(",");if(2!==i.length)break;var n=new Ti;if(n.percent("x",i[0]),n.percent("y",i[1]),!n.has("x")||!n.has("y"))break;r.set(t+"X",n.get("x")),r.set(t+"Y",n.get("y"));break;case"scroll":r.alt(t,e,["up"])}},/=/,/\s/),r.has("id")&&((e=new(n.vttjs.VTTRegion||n.window.VTTRegion)).width=r.get("width",100),e.lines=r.get("lines",3),e.regionAnchorX=r.get("regionanchorX",0),e.regionAnchorY=r.get("regionanchorY",100),e.viewportAnchorX=r.get("viewportanchorX",0),e.viewportAnchorY=r.get("viewportanchorY",100),e.scroll=r.get("scroll",""),n.onregion&&n.onregion(e),n.regionList.push({id:r.get("id"),region:e})))},/:/)}t&&(n.buffer+=n.decoder.decode(t,{stream:!0}));try{if("INITIAL"===n.state){if(!/\r\n|\n/.test(n.buffer))return this;var a=(e=i()).match(/^WEBVTT([ \t].*)?$/);if(!a||!a[0])throw new _i(_i.Errors.BadSignature);n.state="HEADER"}for(var s=!1;n.buffer;){if(!/\r\n|\n/.test(n.buffer))return this;switch(s?s=!1:e=i(),n.state){case"HEADER":/:/.test(e)?r(e):e||(n.state="ID");continue;case"NOTE":e||(n.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(e)){n.state="NOTE";break}if(!e)continue;if(n.cue=new(n.vttjs.VTTCue||n.window.VTTCue)(0,0,""),n.state="CUE",-1===e.indexOf("--\x3e")){n.cue.id=e;continue}case"CUE":try{!function(e,t,a){var i,s,n=e;function r(){var t=bi(e);if(null===t)throw new _i(_i.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function o(){e=e.replace(/^\s+/,"")}if(o(),t.startTime=r(),o(),"--\x3e"!==e.substr(0,3))throw new _i(_i.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),o(),t.endTime=r(),o(),i=e,t=t,s=new Ti,Si(i,function(t,e){switch(t){case"region":for(var i=a.length-1;0<=i;i--)if(a[i].id===e){s.set(t,a[i].region);break}break;case"vertical":s.alt(t,e,["rl","lr"]);break;case"line":var n=e.split(","),r=n[0];s.integer(t,r),s.percent(t,r)&&s.set("snapToLines",!1),s.alt(t,r,["auto"]),2===n.length&&s.alt("lineAlign",n[1],["start","middle","end"]);break;case"position":n=e.split(","),s.percent(t,n[0]),2===n.length&&s.alt("positionAlign",n[1],["start","middle","end"]);break;case"size":s.percent(t,e);break;case"align":s.alt(t,e,["start","middle","end","left","right"])}},/:/,/\s/),t.region=s.get("region",null),t.vertical=s.get("vertical",""),t.line=s.get("line","auto"),t.lineAlign=s.get("lineAlign","start"),t.snapToLines=s.get("snapToLines",!0),t.size=s.get("size",100),t.align=s.get("align","middle"),t.position=s.get("position",{start:0,left:0,middle:50,end:100,right:100},t.align),t.positionAlign=s.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},t.align)}(e,n.cue,n.regionList)}catch(t){n.reportOrThrowError(t),n.cue=null,n.state="BADCUE";continue}n.state="CUETEXT";continue;case"CUETEXT":var o=-1!==e.indexOf("--\x3e");if(!e||o&&(s=!0)){n.oncue&&n.oncue(n.cue),n.cue=null,n.state="ID";continue}n.cue.text&&(n.cue.text+="\n"),n.cue.text+=e;continue;case"BADCUE":e||(n.state="ID");continue}}}catch(t){n.reportOrThrowError(t),"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 e=this;try{if(e.buffer+=e.decoder.decode(),!e.cue&&"HEADER"!==e.state||(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new _i(_i.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}};var Ri=Di,Mi={"":1,lr:1,rl:1},Bi={start:1,middle:1,end:1,left:1,right:1};function Ni(t){return"string"==typeof t&&(!!Bi[t.toLowerCase()]&&t.toLowerCase())}function ji(t,e,i){this.hasBeenReset=!1;var n="",r=!1,a=t,s=e,o=i,u=null,l="",c=!0,h="auto",d="start",p=50,f="middle",m=50,g="middle";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return n},set:function(t){n=""+t}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(t){r=!!t}},startTime:{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t)throw new TypeError("Start time must be set to a number.");a=t,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return s},set:function(t){if("number"!=typeof t)throw new TypeError("End time must be set to a number.");s=t,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(t){o=""+t,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(t){u=t,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return l},set:function(t){t="string"==typeof(t=t)&&(!!Mi[t.toLowerCase()]&&t.toLowerCase());if(!1===t)throw new SyntaxError("An invalid or illegal string was specified.");l=t,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return c},set:function(t){c=!!t,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return h},set:function(t){if("number"!=typeof t&&"auto"!==t)throw new SyntaxError("An invalid number or illegal string was specified.");h=t,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return d},set:function(t){t=Ni(t);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");d=t,this.hasBeenReset=!0}},position:{enumerable:!0,get:function(){return p},set:function(t){if(t<0||100<t)throw new Error("Position must be between 0 and 100.");p=t,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return f},set:function(t){t=Ni(t);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");f=t,this.hasBeenReset=!0}},size:{enumerable:!0,get:function(){return m},set:function(t){if(t<0||100<t)throw new Error("Size must be between 0 and 100.");m=t,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return g},set:function(t){t=Ni(t);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");g=t,this.hasBeenReset=!0}}}),this.displayState=void 0}ji.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var Fi=ji,Vi={"":!0,up:!0};function Hi(t){return"number"==typeof t&&0<=t&&t<=100}function qi(){var e=100,i=3,n=0,r=100,a=0,s=100,o="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!Hi(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return i},set:function(t){if("number"!=typeof t)throw new TypeError("Lines must be set to a number.");i=t}},regionAnchorY:{enumerable:!0,get:function(){return r},set:function(t){if(!Hi(t))throw new Error("RegionAnchorX must be between 0 and 100.");r=t}},regionAnchorX:{enumerable:!0,get:function(){return n},set:function(t){if(!Hi(t))throw new Error("RegionAnchorY must be between 0 and 100.");n=t}},viewportAnchorY:{enumerable:!0,get:function(){return s},set:function(t){if(!Hi(t))throw new Error("ViewportAnchorY must be between 0 and 100.");s=t}},viewportAnchorX:{enumerable:!0,get:function(){return a},set:function(t){if(!Hi(t))throw new Error("ViewportAnchorX must be between 0 and 100.");a=t}},scroll:{enumerable:!0,get:function(){return o},set:function(t){t="string"==typeof(t=t)&&(!!Vi[t.toLowerCase()]&&t.toLowerCase());if(!1===t)throw new SyntaxError("An invalid or illegal string was specified.");o=t}}})}var zi=Ge(function(t){t=t.exports={WebVTT:Ri,VTTCue:Fi,VTTRegion:qi};d.vttjs=t,d.WebVTT=t.WebVTT;var e=t.VTTCue,i=t.VTTRegion,n=d.VTTCue,r=d.VTTRegion;t.shim=function(){d.VTTCue=e,d.VTTRegion=i},t.restore=function(){d.VTTCue=n,d.VTTRegion=r},d.VTTCue||t.shim()});zi.WebVTT,zi.VTTCue,zi.VTTRegion;var Wi=function(n){function i(e,t){var i;return void 0===e&&(e={}),void 0===t&&(t=function(){}),e.reportTouchActivity=!1,(i=n.call(this,null,e,t)||this).hasStarted_=!1,i.on("playing",function(){this.hasStarted_=!0}),i.on("loadstart",function(){this.hasStarted_=!1}),gi.names.forEach(function(t){t=gi[t];e&&e[t.getterName]&&(i[t.privateName]=e[t.getterName])}),i.featuresProgressEvents||i.manualProgressOn(),i.featuresTimeupdateEvents||i.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(t){!1===e["native"+t+"Tracks"]&&(i["featuresNative"+t+"Tracks"]=!1)}),!1===e.nativeCaptions||!1===e.nativeTextTracks?i.featuresNativeTextTracks=!1:!0!==e.nativeCaptions&&!0!==e.nativeTextTracks||(i.featuresNativeTextTracks=!0),i.featuresNativeTextTracks||i.emulateTextTracks(),i.autoRemoteTextTracks_=new gi.text.ListClass,i.initTrackListeners(),e.nativeControlsForTouch||i.emitTapEvents(),i.constructor&&(i.name_=i.constructor.name||"Unknown Tech"),i}p(i,n);var t=i.prototype;return t.triggerSourceset=function(t){var e=this;this.isReady_||this.one("ready",function(){return e.setTimeout(function(){return e.triggerSourceset(t)},1)}),this.trigger({src:t,type:"sourceset"})},t.manualProgressOn=function(){this.on("durationchange",this.onDurationChange),this.manualProgress=!0,this.one("ready",this.trackProgress)},t.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange)},t.trackProgress=function(t){this.stopTrackingProgress(),this.progressInterval=this.setInterval(Ct(this,function(){var t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),1===(this.bufferedPercent_=t)&&this.stopTrackingProgress()}),500)},t.onDurationChange=function(t){this.duration_=this.duration()},t.buffered=function(){return ue(0,0)},t.bufferedPercent=function(){return le(this.buffered(),this.duration_)},t.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},t.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime),this.on("pause",this.stopTrackingCurrentTime)},t.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime),this.off("pause",this.stopTrackingCurrentTime)},t.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},t.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.dispose=function(){this.clearTracks(fi.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),n.prototype.dispose.call(this)},t.clearTracks=function(t){var r=this;(t=[].concat(t)).forEach(function(t){for(var e=r[t+"Tracks"]()||[],i=e.length;i--;){var n=e[i];"text"===t&&r.removeRemoteTextTrack(n),e.removeTrack(n)}})},t.cleanupAutoTextTracks=function(){for(var t=this.autoRemoteTextTracks_||[],e=t.length;e--;){var i=t[e];this.removeRemoteTextTrack(i)}},t.reset=function(){},t.error=function(t){return void 0!==t&&(this.error_=new ge(t),this.trigger("error")),this.error_},t.played=function(){return this.hasStarted_?ue(0,0):ue()},t.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.initTrackListeners=function(){var r=this;fi.names.forEach(function(t){function e(){r.trigger(t+"trackchange")}var i=fi[t],n=r[i.getterName]();n.addEventListener("removetrack",e),n.addEventListener("addtrack",e),r.on("dispose",function(){n.removeEventListener("removetrack",e),n.removeEventListener("addtrack",e)})})},t.addWebVttScript_=function(){var t,e=this;d.WebVTT||(h.body.contains(this.el())?!this.options_["vtt.js"]&&_(zi)&&0<Object.keys(zi).length?this.trigger("vttjsloaded"):((t=h.createElement("script")).src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded")},t.onerror=function(){e.trigger("vttjserror")},this.on("dispose",function(){t.onload=null,t.onerror=null}),d.WebVTT=!0,this.el().parentNode.appendChild(t)):this.ready(this.addWebVttScript_))},t.emulateTextTracks=function(){function e(t){return n.addTrack(t.track)}function i(t){return n.removeTrack(t.track)}var t=this,n=this.textTracks(),r=this.remoteTextTracks();r.on("addtrack",e),r.on("removetrack",i),this.addWebVttScript_();function a(){return t.trigger("texttrackchange")}function s(){a();for(var t=0;t<n.length;t++){var e=n[t];e.removeEventListener("cuechange",a),"showing"===e.mode&&e.addEventListener("cuechange",a)}}s(),n.addEventListener("change",s),n.addEventListener("addtrack",s),n.addEventListener("removetrack",s),this.on("dispose",function(){r.off("addtrack",e),r.off("removetrack",i),n.removeEventListener("change",s),n.removeEventListener("addtrack",s),n.removeEventListener("removetrack",s);for(var t=0;t<n.length;t++)n[t].removeEventListener("cuechange",a)})},t.addTextTrack=function(t,e,i){if(!t)throw new Error("TextTrack kind is required but was not provided");return function(t,e,i,n,r){void 0===r&&(r={});var a=t.textTracks();return r.kind=e,i&&(r.label=i),n&&(r.language=n),r.tech=t,r=new gi.text.TrackClass(r),a.addTrack(r),r}(this,t,e,i)},t.createRemoteTextTrack=function(t){t=Nt(t,{tech:this});return new mi.remoteTextEl.TrackClass(t)},t.addRemoteTextTrack=function(t,e){var i=this;void 0===t&&(t={});var n=this.createRemoteTextTrack(t);return!0!==e&&!1!==e&&(f.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),e=!0),this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),!0!==e&&this.ready(function(){return i.autoRemoteTextTracks_.addTrack(n.track)}),n},t.removeRemoteTextTrack=function(t){var e=this.remoteTextTrackEls().getTrackElementByTrack_(t);this.remoteTextTrackEls().removeTrackElement_(e),this.remoteTextTracks().removeTrack(t),this.autoRemoteTextTracks_.removeTrack(t)},t.getVideoPlaybackQuality=function(){return{}},t.setPoster=function(){},t.playsinline=function(){},t.setPlaysinline=function(){},t.overrideNativeAudioTracks=function(){},t.overrideNativeVideoTracks=function(){},t.canPlayType=function(){return""},i.canPlayType=function(){return""},i.canPlaySource=function(t,e){return i.canPlayType(t.type)},i.isTech=function(t){return t.prototype instanceof i||t instanceof i||t===i},i.registerTech=function(t,e){if(i.techs_||(i.techs_={}),!i.isTech(e))throw new Error("Tech "+t+" 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 t=Bt(t),i.techs_[t]=e,"Tech"!==t&&i.defaultTechOrder_.push(t),e},i.getTech=function(t){if(t)return t=Bt(t),i.techs_&&i.techs_[t]?i.techs_[t]:d&&d.videojs&&d.videojs[t]?(f.warn("The "+t+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),d.videojs[t]):void 0},i}(jt);gi.names.forEach(function(t){var e=gi[t];Wi.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}}),Wi.prototype.featuresVolumeControl=!0,Wi.prototype.featuresMuteControl=!0,Wi.prototype.featuresFullscreenResize=!1,Wi.prototype.featuresPlaybackRate=!1,Wi.prototype.featuresProgressEvents=!1,Wi.prototype.featuresSourceset=!1,Wi.prototype.featuresTimeupdateEvents=!1,Wi.prototype.featuresNativeTextTracks=!1,Wi.withSourceHandlers=function(r){r.registerSourceHandler=function(t,e){var i=(i=r.sourceHandlers)||(r.sourceHandlers=[]);void 0===e&&(e=i.length),i.splice(e,0,t)},r.canPlayType=function(t){for(var e,i=r.sourceHandlers||[],n=0;n<i.length;n++)if(e=i[n].canPlayType(t))return e;return""},r.selectSourceHandler=function(t,e){for(var i=r.sourceHandlers||[],n=0;n<i.length;n++)if(i[n].canHandleSource(t,e))return i[n];return null},r.canPlaySource=function(t,e){var i=r.selectSourceHandler(t,e);return i?i.canHandleSource(t,e):""};["seekable","seeking","duration"].forEach(function(t){var e=this[t];"function"==typeof e&&(this[t]=function(){return this.sourceHandler_&&this.sourceHandler_[t]?this.sourceHandler_[t].apply(this.sourceHandler_,arguments):e.apply(this,arguments)})},r.prototype),r.prototype.setSource=function(t){var e=r.selectSourceHandler(t,this.options_);e||(r.nativeSourceHandler?e=r.nativeSourceHandler:f.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler),e!==r.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=e.handleSource(t,this,this.options_),this.on("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)}},jt.registerComponent("Tech",Wi),Wi.registerTech("Tech",Wi),Wi.defaultTechOrder_=[];var Gi={},Xi={},Yi={};function $i(t,e,i){t.setTimeout(function(){return function i(n,t,r,a,s,o){void 0===n&&(n={});void 0===t&&(t=[]);void 0===s&&(s=[]);void 0===o&&(o=!1);var e=t,t=e[0],u=e.slice(1);if("string"==typeof t)i(n,Gi[t],r,a,s,o);else if(t){var l=en(a,t);if(!l.setSource)return s.push(l),i(n,u,r,a,s,o);l.setSource(y({},n),function(t,e){return t?i(n,u,r,a,s,o):(s.push(l),void i(e,n.type===e.type?u:Gi[e.type],r,a,s,o))})}else u.length?i(n,u,r,a,s,o):o?r(n,s):i(n,Gi["*"],r,a,s,!0)}(e,Gi[e.type],i,t)},1)}function Ki(t,e,i,n){void 0===n&&(n=null);var r="call"+Bt(i),r=t.reduce(tn(r),n),n=r===Yi,r=n?null:e[i](r);return function(t,e,i,n){for(var r=t.length-1;0<=r;r--){var a=t[r];a[e]&&a[e](n,i)}}(t,i,r,n),r}var Qi={buffered:1,currentTime:1,duration:1,seekable:1,played:1,paused:1},Ji={setCurrentTime:1},Zi={play:1,pause:1};function tn(i){return function(t,e){return t===Yi?Yi:e[i]?e[i](t):t}}function en(t,e){var i=Xi[t.id()],n=null;if(null==i)return n=e(t),Xi[t.id()]=[[e,n]],n;for(var r=0;r<i.length;r++){var a=i[r],s=a[0],a=a[1];s===e&&(n=a)}return null===n&&(n=e(t),i.push([e,n])),n}function nn(t){return void 0===t&&(t=""),t=Ie(t),an[t.toLowerCase()]||""}function rn(t){var e;return t=Array.isArray(t)?(e=[],t.forEach(function(t){t=rn(t),Array.isArray(t)?e=e.concat(t):v(t)&&e.push(t)}),e):"string"==typeof t&&t.trim()?[sn({src:t})]:v(t)&&"string"==typeof t.src&&t.src&&t.src.trim()?[sn(t)]:[]}var an={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",mp3:"audio/mpeg",aac:"audio/aac",oga:"audio/ogg",m3u8:"application/x-mpegURL"};function sn(t){var e=nn(t.src);return!t.type&&e&&(t.type=e),t}qt=function(u){function t(t,e,i){var n=Nt({createEl:!1},e),i=u.call(this,t,n,i)||this;if(e.playerOptions.sources&&0!==e.playerOptions.sources.length)t.src(e.playerOptions.sources);else for(var r=0,a=e.playerOptions.techOrder;r<a.length;r++){var s=Bt(a[r]),o=Wi.getTech(s);if(s||(o=jt.getComponent(s)),o&&o.isSupported()){t.loadTech_(s);break}}return i}return p(t,u),t}(jt);jt.registerComponent("MediaLoader",qt);Wt=function(n){function t(t,e){e=n.call(this,t,e)||this;return e.emitTapEvents(),e.enable(),e}p(t,n);var e=t.prototype;return e.createEl=function(t,e,i){void 0===t&&(t="div"),void 0===e&&(e={}),void 0===i&&(i={}),e=y({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass(),tabIndex:0},e),"button"===t&&f.error("Creating a ClickableComponent with an HTML element of "+t+" is not supported; use a Button instead."),i=y({role:"button"},i),this.tabIndex_=e.tabIndex;i=n.prototype.createEl.call(this,t,e,i);return this.createControlTextEl(i),i},e.dispose=function(){this.controlTextEl_=null,n.prototype.dispose.call(this)},e.createControlTextEl=function(t){return this.controlTextEl_=A("span",{className:"vjs-control-text"},{"aria-live":"polite"}),t&&t.appendChild(this.controlTextEl_),this.controlText(this.controlText_,t),this.controlTextEl_},e.controlText=function(t,e){if(void 0===e&&(e=this.el()),void 0===t)return this.controlText_||"Need Text";var i=this.localize(t);this.controlText_=t,L(this.controlTextEl_,i),this.nonIconControl||e.setAttribute("title",i)},e.buildCSSClass=function(){return"vjs-control vjs-button "+n.prototype.buildCSSClass.call(this)},e.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("focus",this.handleFocus),this.on("blur",this.handleBlur))},e.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(["tap","click"],this.handleClick),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur)},e.handleClick=function(t){},e.handleFocus=function(t){ct(h,"keydown",Ct(this,this.handleKeyPress))},e.handleKeyPress=function(t){32===t.which||13===t.which?(t.preventDefault(),this.trigger("click")):n.prototype.handleKeyPress&&n.prototype.handleKeyPress.call(this,t)},e.handleBlur=function(t){ht(h,"keydown",Ct(this,this.handleKeyPress))},t}(jt);jt.registerComponent("ClickableComponent",Wt);Xt=function(i){function t(t,e){e=i.call(this,t,e)||this;return e.update(),t.on("posterchange",Ct(l(l(e)),e.update)),e}p(t,i);var e=t.prototype;return e.dispose=function(){this.player().off("posterchange",this.update),i.prototype.dispose.call(this)},e.createEl=function(){return A("div",{className:"vjs-poster",tabIndex:-1})},e.update=function(t){var e=this.player().poster();this.setSrc(e),e?this.show():this.hide()},e.setSrc=function(t){t=t?'url("'+t+'")':"";this.el_.style.backgroundImage=t},e.handleClick=function(t){this.player_.controls()&&(this.player_.paused()?be(this.player_.play()):this.player_.pause())},t}(Wt);jt.registerComponent("PosterImage",Xt);var on="#222",un={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 ln(t,e){var i;if(4===t.length)i=t[1]+t[1]+t[2]+t[2]+t[3]+t[3];else{if(7!==t.length)throw new Error("Invalid color code provided, "+t+"; must be formatted as e.g. #f0e or #f604e2.");i=t.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+e+")"}function cn(t,e,i){try{t.style[e]=i}catch(t){return}}Jt=function(r){function t(i,t,e){var e=r.call(this,i,t,e)||this,n=Ct(l(l(e)),e.updateDisplay);return i.on("loadstart",Ct(l(l(e)),e.toggleDisplay)),i.on("texttrackchange",n),i.on("loadedmetadata",Ct(l(l(e)),e.preselectTrack)),i.ready(Ct(l(l(e)),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 t=this.options_.playerOptions.tracks||[],e=0;e<t.length;e++)this.player_.addRemoteTextTrack(t[e],!0);this.preselectTrack()}})),e}p(t,r);var e=t.prototype;return e.preselectTrack=function(){for(var t,e,i,n={captions:1,subtitles:1},r=this.player_.textTracks(),a=this.player_.cache_.selectedLanguage,s=0;s<r.length;s++){var o=r[s];a&&a.enabled&&a.language&&a.language===o.language&&o.kind in n?i=o.kind!==a.kind&&i||o:a&&!a.enabled?e=t=i=null:o.default&&("descriptions"!==o.kind||t?o.kind in n&&!e&&(e=o):t=o)}i?i.mode="showing":e?e.mode="showing":t&&(t.mode="showing")},e.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},e.createEl=function(){return r.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{"aria-live":"off","aria-atomic":"true"})},e.clearDisplay=function(){"function"==typeof d.WebVTT&&d.WebVTT.processCues(d,[],this.el_)},e.updateDisplay=function(){var t=this.player_.textTracks();this.clearDisplay();for(var e=null,i=null,n=t.length;n--;){var r=t[n];"showing"===r.mode&&("descriptions"===r.kind?e=r:i=r)}i?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(i)):e&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(e))},e.updateForTrack=function(t){if("function"==typeof d.WebVTT&&t.activeCues){for(var e=[],i=0;i<t.activeCues.length;i++)e.push(t.activeCues[i]);if(d.WebVTT.processCues(d,e,this.el_),this.player_.textTrackSettings)for(var n=this.player_.textTrackSettings.getValues(),r=e.length;r--;){var a,s=e[r];s&&(a=s.displayState,n.color&&(a.firstChild.style.color=n.color),n.textOpacity&&cn(a.firstChild,"color",ln(n.color||"#fff",n.textOpacity)),n.backgroundColor&&(a.firstChild.style.backgroundColor=n.backgroundColor),n.backgroundOpacity&&cn(a.firstChild,"backgroundColor",ln(n.backgroundColor||"#000",n.backgroundOpacity)),n.windowColor&&(n.windowOpacity?cn(a,"backgroundColor",ln(n.windowColor,n.windowOpacity)):a.style.backgroundColor=n.windowColor),n.edgeStyle&&("dropshadow"===n.edgeStyle?a.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px "+on:"raised"===n.edgeStyle?a.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px "+on:"depressed"===n.edgeStyle?a.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px "+on:"uniform"===n.edgeStyle&&(a.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px "+on)),n.fontPercent&&1!==n.fontPercent&&(s=d.parseFloat(a.style.fontSize),a.style.fontSize=s*n.fontPercent+"px",a.style.height="auto",a.style.top="auto",a.style.bottom="2px"),n.fontFamily&&"default"!==n.fontFamily&&("small-caps"===n.fontFamily?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=un[n.fontFamily]))}}},t}(jt);jt.registerComponent("TextTrackDisplay",Jt);ie=function(i){function t(){return i.apply(this,arguments)||this}return p(t,i),t.prototype.createEl=function(){var t=this.player_.isAudio(),e=this.localize(t?"Audio Player":"Video Player"),t=A("span",{className:"vjs-control-text",innerHTML:this.localize("{1} is loading.",[e])}),e=i.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return e.appendChild(t),e},t}(jt);jt.registerComponent("LoadingSpinner",ie);var hn=function(e){function t(){return e.apply(this,arguments)||this}p(t,e);var i=t.prototype;return i.createEl=function(t,e,i){void 0===e&&(e={}),void 0===i&&(i={}),e=y({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass()},e),i=y({type:"button"},i);i=jt.prototype.createEl.call(this,"button",e,i);return this.createControlTextEl(i),i},i.addChild=function(t,e){void 0===e&&(e={});var i=this.constructor.name;return f.warn("Adding an actionable (user controllable) child to a Button ("+i+") is not supported; use a ClickableComponent instead."),jt.prototype.addChild.call(this,t,e)},i.enable=function(){e.prototype.enable.call(this),this.el_.removeAttribute("disabled")},i.disable=function(){e.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},i.handleKeyPress=function(t){32!==t.which&&13!==t.which&&e.prototype.handleKeyPress.call(this,t)},t}(Wt);jt.registerComponent("Button",hn);Vt=function(i){function t(t,e){e=i.call(this,t,e)||this;return e.mouseused_=!1,e.on("mousedown",e.handleMouseDown),e}p(t,i);var e=t.prototype;return e.buildCSSClass=function(){return"vjs-big-play-button"},e.handleClick=function(t){var e,i=this.player_.play();this.mouseused_&&t.clientX&&t.clientY?be(i):(t=this.player_.getChild("controlBar"),(e=t&&t.getChild("playToggle"))?(t=function(){return e.focus()},_e(i)?i.then(t,function(){}):this.setTimeout(t,1)):this.player_.focus())},e.handleKeyPress=function(t){this.mouseused_=!1,i.prototype.handleKeyPress.call(this,t)},e.handleMouseDown=function(t){this.mouseused_=!0},t}(hn);Vt.prototype.controlText_="Play Video",jt.registerComponent("BigPlayButton",Vt);De=function(i){function t(t,e){t=i.call(this,t,e)||this;return t.controlText(e&&e.controlText||t.localize("Close")),t}p(t,i);var e=t.prototype;return e.buildCSSClass=function(){return"vjs-close-button "+i.prototype.buildCSSClass.call(this)},e.handleClick=function(t){this.trigger({type:"close",bubbles:!1})},t}(hn);jt.registerComponent("CloseButton",De);Re=function(n){function t(t,e){var i;return void 0===e&&(e={}),i=n.call(this,t,e)||this,e.replay=void 0===e.replay||e.replay,i.on(t,"play",i.handlePlay),i.on(t,"pause",i.handlePause),e.replay&&i.on(t,"ended",i.handleEnded),i}p(t,n);var e=t.prototype;return e.buildCSSClass=function(){return"vjs-play-control "+n.prototype.buildCSSClass.call(this)},e.handleClick=function(t){this.player_.paused()?this.player_.play():this.player_.pause()},e.handleSeeked=function(t){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(t):this.handlePlay(t)},e.handlePlay=function(t){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},e.handlePause=function(t){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},e.handleEnded=function(t){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",this.handleSeeked)},t}(hn);Re.prototype.controlText_="Play",jt.registerComponent("PlayToggle",Re);function dn(t,e){t=t<0?0:t;var i=Math.floor(t%60),n=Math.floor(t/60%60),r=Math.floor(t/3600),a=Math.floor(e/60%60),e=Math.floor(e/3600);return!isNaN(t)&&t!==1/0||(r=n=i="-"),(r=0<r||0<e?r+":":"")+(n=((r||10<=a)&&n<10?"0"+n:n)+":")+(i=i<10?"0"+i:i)}var pn=dn;function fn(t,e){return void 0===e&&(e=t),pn(t,e)}Me=function(n){function t(t,e){e=n.call(this,t,e)||this;return e.throttledUpdateContent=Tt(Ct(l(l(e)),e.updateContent),25),e.on(t,"timeupdate",e.throttledUpdateContent),e}p(t,n);var e=t.prototype;return e.createEl=function(t){var e=this.buildCSSClass(),i=n.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_=A("span",{className:e+"-display"},{"aria-live":"off",role:"presentation"}),this.updateTextNode_(),i.appendChild(this.contentEl_),i},e.dispose=function(){this.contentEl_=null,this.textNode_=null,n.prototype.dispose.call(this)},e.updateTextNode_=function(){if(this.contentEl_){for(;this.contentEl_.firstChild;)this.contentEl_.removeChild(this.contentEl_.firstChild);this.textNode_=h.createTextNode(this.formattedTime_||this.formatTime_(0)),this.contentEl_.appendChild(this.textNode_)}},e.formatTime_=function(t){return fn(t)},e.updateFormattedTime_=function(t){t=this.formatTime_(t);t!==this.formattedTime_&&(this.formattedTime_=t,this.requestAnimationFrame(this.updateTextNode_))},e.updateContent=function(t){},t}(jt);Me.prototype.labelText_="Time",Me.prototype.controlText_="Time",jt.registerComponent("TimeDisplay",Me);Be=function(i){function t(t,e){e=i.call(this,t,e)||this;return e.on(t,"ended",e.handleEnded),e}p(t,i);var e=t.prototype;return e.buildCSSClass=function(){return"vjs-current-time"},e.updateContent=function(t){var e=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(e)},e.handleEnded=function(t){this.player_.duration()&&this.updateFormattedTime_(this.player_.duration())},t}(Me);Be.prototype.labelText_="Current Time",Be.prototype.controlText_="Current Time",jt.registerComponent("CurrentTimeDisplay",Be);pi=function(i){function t(t,e){e=i.call(this,t,e)||this;return e.on(t,"durationchange",e.updateContent),e.on(t,"loadstart",e.updateContent),e.on(t,"loadedmetadata",e.throttledUpdateContent),e}p(t,i);var e=t.prototype;return e.buildCSSClass=function(){return"vjs-duration"},e.updateContent=function(t){var e=this.player_.duration();this.duration_!==e&&(this.duration_=e,this.updateFormattedTime_(e))},t}(Me);pi.prototype.labelText_="Duration",pi.prototype.controlText_="Duration",jt.registerComponent("DurationDisplay",pi);qt=function(t){function e(){return t.apply(this,arguments)||this}return p(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"<div><span>/</span></div>"},{"aria-hidden":!0})},e}(jt);jt.registerComponent("TimeDivider",qt);Xt=function(i){function t(t,e){e=i.call(this,t,e)||this;return e.on(t,"durationchange",e.throttledUpdateContent),e.on(t,"ended",e.handleEnded),e}p(t,i);var e=t.prototype;return e.buildCSSClass=function(){return"vjs-remaining-time"},e.formatTime_=function(t){return"-"+i.prototype.formatTime_.call(this,t)},e.updateContent=function(t){this.player_.duration()&&(this.player_.remainingTimeDisplay?this.updateFormattedTime_(this.player_.remainingTimeDisplay()):this.updateFormattedTime_(this.player_.remainingTime()))},e.handleEnded=function(t){this.player_.duration()&&this.updateFormattedTime_(0)},t}(Me);Xt.prototype.labelText_="Remaining Time",Xt.prototype.controlText_="Remaining Time",jt.registerComponent("RemainingTimeDisplay",Xt);Jt=function(i){function t(t,e){e=i.call(this,t,e)||this;return e.updateShowing(),e.on(e.player(),"durationchange",e.updateShowing),e}p(t,i);var e=t.prototype;return e.createEl=function(){var t=i.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=A("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Stream Type")+" </span>"+this.localize("LIVE")},{"aria-live":"off"}),t.appendChild(this.contentEl_),t},e.dispose=function(){this.contentEl_=null,i.prototype.dispose.call(this)},e.updateShowing=function(t){this.player().duration()===1/0?this.show():this.hide()},t}(jt);jt.registerComponent("LiveDisplay",Jt);ie=function(i){function t(t,e){e=i.call(this,t,e)||this;return e.updateLiveEdgeStatus(),e.player_.liveTracker&&e.on(e.player_.liveTracker,"liveedgechange",e.updateLiveEdgeStatus),e}p(t,i);var e=t.prototype;return e.createEl=function(){var t=i.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=A("span",{className:"vjs-seek-to-live-text",innerHTML:this.localize("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t},e.updateLiveEdgeStatus=function(t){!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"))},e.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},e.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatus),this.textEl_=null,i.prototype.dispose.call(this)},t}(hn);ie.prototype.controlText_="Seek to live, currently playing live",jt.registerComponent("SeekToLive",ie);Vt=function(n){function t(t,e){e=n.call(this,t,e)||this;return e.bar=e.getChild(e.options_.barName),e.vertical(!!e.options_.vertical),e.enable(),e}p(t,n);var e=t.prototype;return e.enabled=function(){return this.enabled_},e.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown),this.on("touchstart",this.handleMouseDown),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur),this.on("click",this.handleClick),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},e.disable=function(){var t;this.enabled()&&(t=this.bar.el_.ownerDocument,this.off("mousedown",this.handleMouseDown),this.off("touchstart",this.handleMouseDown),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur),this.off("click",this.handleClick),this.off(this.player_,"controlsvisible",this.update),this.off(t,"mousemove",this.handleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchmove",this.handleMouseMove),this.off(t,"touchend",this.handleMouseUp),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1)},e.createEl=function(t,e,i){return void 0===e&&(e={}),void 0===i&&(i={}),e.className=e.className+" vjs-slider",e=y({tabIndex:0},e),i=y({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},i),n.prototype.createEl.call(this,t,e,i)},e.handleMouseDown=function(t){var e=this.bar.el_.ownerDocument;"mousedown"===t.type&&t.preventDefault(),"touchstart"!==t.type||Zt||t.preventDefault(),j(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(e,"mousemove",this.handleMouseMove),this.on(e,"mouseup",this.handleMouseUp),this.on(e,"touchmove",this.handleMouseMove),this.on(e,"touchend",this.handleMouseUp),this.handleMouseMove(t)},e.handleMouseMove=function(t){},e.handleMouseUp=function(){var t=this.bar.el_.ownerDocument;F(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchmove",this.handleMouseMove),this.off(t,"touchend",this.handleMouseUp),this.update()},e.update=function(){if(this.el_){var t=this.getPercent(),e=this.bar;if(e){("number"!=typeof t||t!=t||t<0||t===1/0)&&(t=0);var i=(100*t).toFixed(2)+"%",e=e.el().style;return this.vertical()?e.height=i:e.width=i,t}}},e.calculateDistance=function(t){t=q(this.el_,t);return this.vertical()?t.y:t.x},e.handleFocus=function(){this.on(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},e.handleKeyPress=function(t){37===t.which||40===t.which?(t.preventDefault(),this.stepBack()):38!==t.which&&39!==t.which||(t.preventDefault(),this.stepForward())},e.handleBlur=function(){this.off(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},e.handleClick=function(t){t.stopImmediatePropagation(),t.preventDefault()},e.vertical=function(t){if(void 0===t)return this.vertical_||!1;this.vertical_=!!t,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(jt);jt.registerComponent("Slider",Vt);De=function(i){function t(t,e){e=i.call(this,t,e)||this;return e.partEls_=[],e.on(t,"progress",e.update),e}p(t,i);var e=t.prototype;return e.createEl=function(){return i.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Loaded")+'</span>: <span class="vjs-control-text-loaded-percentage">0%</span></span>'})},e.dispose=function(){this.partEls_=null,i.prototype.dispose.call(this)},e.update=function(t){function e(t,e,i){return e=100*(1<=(e=t/e||0)?1:e),i&&(e=e.toFixed(2)),e+"%"}var i=this.player_.liveTracker,n=this.player_.buffered(),r=i&&i.isLive()?i.seekableEnd():this.player_.duration(),a=this.player_.bufferedEnd(),s=this.partEls_,i=this.$(".vjs-control-text-loaded-percentage");this.el_.style.width=e(a,r),L(i,e(a,r,!0));for(var o=0;o<n.length;o++){var u=n.start(o),l=n.end(o),c=s[o];c||(c=this.el_.appendChild(A()),s[o]=c),c.style.left=e(u,a),c.style.width=e(l-u,a)}for(var h=s.length;h>n.length;h--)this.el_.removeChild(s[h-1]);s.length=n.length},t}(jt);jt.registerComponent("LoadProgressBar",De);Re=function(t){function e(){return t.apply(this,arguments)||this}p(e,t);var i=e.prototype;return i.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},i.update=function(t,e,i){var n=V(this.el_),r=V(this.player_.el()),a=t.width*e;r&&n&&(e=t.left-r.left+a,r=t.width-a+(r.right-t.right),e<(t=n.width/2)?t+=t-e:r<t&&(t=r),t<0?t=0:t>n.width&&(t=n.width),this.el_.style.right="-"+t+"px",L(this.el_,i))},i.updateTime=function(n,r,a,s){var o=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var t,e,i=o.player_.duration();i=o.player_.liveTracker&&o.player_.liveTracker.isLive()?((e=(t=o.player_.liveTracker.liveWindow())-r*t)<1?"":"-")+fn(e,t):fn(a,i),o.update(n,r,i),s&&s()})},e}(jt);jt.registerComponent("TimeTooltip",Re);Be=function(t){function e(){return t.apply(this,arguments)||this}p(e,t);var i=e.prototype;return i.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},i.update=function(t,e){var i,n=this.getChild("timeTooltip");n&&(i=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),n.updateTime(t,e,i))},e}(jt);Be.prototype.options_={children:[]},Gt||Yt||Be.prototype.options_.children.push("timeTooltip"),jt.registerComponent("PlayProgressBar",Be);pi=function(i){function t(t,e){e=i.call(this,t,e)||this;return e.update=Tt(Ct(l(l(e)),e.update),25),e}p(t,i);var e=t.prototype;return e.createEl=function(){return i.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},e.update=function(t,e){var i=this,n=e*this.player_.duration();this.getChild("timeTooltip").updateTime(t,e,n,function(){i.el_.style.left=t.width*e+"px"})},t}(jt);pi.prototype.options_={children:["timeTooltip"]},jt.registerComponent("MouseTimeDisplay",pi);qt=function(i){function t(t,e){e=i.call(this,t,e)||this;return e.setEventHandlers_(),e}p(t,i);var e=t.prototype;return e.setEventHandlers_=function(){var e=this;this.update=Tt(Ct(this,this.update),30),this.on(this.player_,"timeupdate",this.update),this.on(this.player_,"ended",this.handleEnded),this.on(this.player_,"durationchange",this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.on(this.player_,["playing"],function(){e.clearInterval(e.updateInterval),e.updateInterval=e.setInterval(function(){e.requestAnimationFrame(function(){e.update()})},30)}),this.on(this.player_,["ended","pause","waiting"],function(t){e.player_.liveTracker&&e.player_.liveTracker.isLive()&&"ended"!==t.type||e.clearInterval(e.updateInterval)}),this.on(this.player_,["timeupdate","ended"],this.update)},e.createEl=function(){return i.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},e.update_=function(t,e){var i=this.player_.liveTracker,n=this.player_.duration();i&&i.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),i&&i.seekableEnd()===1/0?this.disable():this.enable(),this.el_.setAttribute("aria-valuenow",(100*e).toFixed(2)),this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[fn(t,n),fn(n,n)],"{1} of {2}")),this.bar.update(V(this.el_),e)},e.update=function(t){var e=i.prototype.update.call(this);return this.update_(this.getCurrentTime_(),e),e},e.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},e.handleEnded=function(t){this.update_(this.player_.duration(),1)},e.getPercent=function(){var t,e=this.getCurrentTime_(),i=this.player_.liveTracker;return i&&i.isLive()?(t=(e-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),1<=t?1:t||0},e.handleMouseDown=function(t){$(t)&&(t.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),i.prototype.handleMouseDown.call(this,t))},e.handleMouseMove=function(t){if($(t)){var e=this.calculateDistance(t),i=this.player_.liveTracker;if(i&&i.isLive()){var n,r=i.seekableStart(),t=i.liveCurrentTime();if(t<=(n=r+e*i.liveWindow())&&(n=t),n<=r&&(n=r+.1),n===1/0)return}else(n=e*this.player_.duration())===this.player_.duration()&&(n-=.1);this.player_.currentTime(n)}},e.enable=function(){i.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},e.disable=function(){i.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},e.handleMouseUp=function(t){i.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying&&be(this.player_.play())},e.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+5)},e.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-5)},e.handleAction=function(t){this.player_.paused()?this.player_.play():this.player_.pause()},e.handleKeyPress=function(t){32===t.which||13===t.which?(t.preventDefault(),this.handleAction(t)):i.prototype.handleKeyPress&&i.prototype.handleKeyPress.call(this,t)},t}(Vt);qt.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},Gt||Yt||qt.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),qt.prototype.playerEvent="timeupdate",jt.registerComponent("SeekBar",qt);Me=function(i){function t(t,e){e=i.call(this,t,e)||this;return e.handleMouseMove=Tt(Ct(l(l(e)),e.handleMouseMove),25),e.throttledHandleMouseSeek=Tt(Ct(l(l(e)),e.handleMouseSeek),25),e.enable(),e}p(t,i);var e=t.prototype;return e.createEl=function(){return i.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},e.handleMouseMove=function(t){var e,i,n=this.getChild("seekBar");n&&(e=n.getChild("mouseTimeDisplay"),n=V(i=n.el()),1<(t=q(i,t).x)?t=1:t<0&&(t=0),e&&e.update(n,t))},e.handleMouseSeek=function(t){var e=this.getChild("seekBar");e&&e.handleMouseMove(t)},e.enabled=function(){return this.enabled_},e.disable=function(){this.children().forEach(function(t){return t.disable&&t.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDown),this.off(this.el_,"mousemove",this.handleMouseMove),this.handleMouseUp(),this.addClass("disabled"),this.enabled_=!1)},e.enable=function(){this.children().forEach(function(t){return t.enable&&t.enable()}),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDown),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},e.handleMouseDown=function(t){var e=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(t),this.on(e,"mousemove",this.throttledHandleMouseSeek),this.on(e,"touchmove",this.throttledHandleMouseSeek),this.on(e,"mouseup",this.handleMouseUp),this.on(e,"touchend",this.handleMouseUp)},e.handleMouseUp=function(t){var e=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseUp(t),this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchend",this.handleMouseUp)},t}(jt);Me.prototype.options_={children:["seekBar"]},jt.registerComponent("ProgressControl",Me);Xt=function(i){function t(t,e){e=i.call(this,t,e)||this;return e.on(t,"fullscreenchange",e.handleFullscreenChange),!1===h[he.fullscreenEnabled]&&e.disable(),e}p(t,i);var e=t.prototype;return e.buildCSSClass=function(){return"vjs-fullscreen-control "+i.prototype.buildCSSClass.call(this)},e.handleFullscreenChange=function(t){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},e.handleClick=function(t){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(hn);Xt.prototype.controlText_="Fullscreen",jt.registerComponent("FullscreenToggle",Xt);Jt=function(t){function e(){return t.apply(this,arguments)||this}return p(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})},e}(jt);jt.registerComponent("VolumeLevel",Jt);ie=function(n){function t(t,e){var i=n.call(this,t,e)||this;return i.on("slideractive",i.updateLastVolume_),i.on(t,"volumechange",i.updateARIAAttributes),t.ready(function(){return i.updateARIAAttributes()}),i}p(t,n);var e=t.prototype;return e.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"})},e.handleMouseDown=function(t){$(t)&&n.prototype.handleMouseDown.call(this,t)},e.handleMouseMove=function(t){$(t)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(t)))},e.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},e.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},e.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},e.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},e.updateARIAAttributes=function(t){var e=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",e),this.el_.setAttribute("aria-valuetext",e+"%")},e.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},e.updateLastVolume_=function(){var t=this,e=this.player_.volume();this.one("sliderinactive",function(){0===t.player_.volume()&&t.player_.lastVolume_(e)})},t}(Vt);ie.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},ie.prototype.playerEvent="volumechange",jt.registerComponent("VolumeBar",ie);De=function(a){function t(t,e){var i,n,r;return void 0===e&&(e={}),e.vertical=e.vertical||!1,void 0!==e.volumeBar&&!_(e.volumeBar)||(e.volumeBar=e.volumeBar||{},e.volumeBar.vertical=e.vertical),i=a.call(this,t,e)||this,n=l(l(i)),(r=t).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=Tt(Ct(l(l(i)),i.handleMouseMove),25),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}p(t,a);var e=t.prototype;return e.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),a.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},e.handleMouseDown=function(t){var e=this.el_.ownerDocument;this.on(e,"mousemove",this.throttledHandleMouseMove),this.on(e,"touchmove",this.throttledHandleMouseMove),this.on(e,"mouseup",this.handleMouseUp),this.on(e,"touchend",this.handleMouseUp)},e.handleMouseUp=function(t){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseMove),this.off(e,"touchmove",this.throttledHandleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchend",this.handleMouseUp)},e.handleMouseMove=function(t){this.volumeBar.handleMouseMove(t)},t}(jt);De.prototype.options_={children:["volumeBar"]},jt.registerComponent("VolumeControl",De);Re=function(r){function t(t,e){var i,n,e=r.call(this,t,e)||this;return i=l(l(e)),(n=t).tech_&&!n.tech_.featuresMuteControl&&i.addClass("vjs-hidden"),i.on(n,"loadstart",function(){n.tech_.featuresMuteControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")}),e.on(t,["loadstart","volumechange"],e.update),e}p(t,r);var e=t.prototype;return e.buildCSSClass=function(){return"vjs-mute-control "+r.prototype.buildCSSClass.call(this)},e.handleClick=function(t){var e=this.player_.volume(),i=this.player_.lastVolume_();0===e?(i=i<.1?.1:i,this.player_.volume(i),this.player_.muted(!1)):this.player_.muted(!this.player_.muted())},e.update=function(t){this.updateIcon_(),this.updateControlText_()},e.updateIcon_=function(){var t=this.player_.volume(),e=3;Gt&&this.player_.muted(this.player_.tech_.el_.muted),0===t||this.player_.muted()?e=0:t<.33?e=1:t<.67&&(e=2);for(var i=0;i<4;i++)I(this.el_,"vjs-vol-"+i);U(this.el_,"vjs-vol-"+e)},e.updateControlText_=function(){var t=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)},t}(hn);Re.prototype.controlText_="Mute",jt.registerComponent("MuteToggle",Re);Be=function(i){function t(t,e){return void 0===e&&(e={}),void 0!==e.inline?e.inline=e.inline:e.inline=!0,void 0!==e.volumeControl&&!_(e.volumeControl)||(e.volumeControl=e.volumeControl||{},e.volumeControl.vertical=!e.inline),(e=i.call(this,t,e)||this).on(t,["loadstart"],e.volumePanelState_),e.on(e.volumeControl,["slideractive"],e.sliderActive_),e.on(e.volumeControl,["sliderinactive"],e.sliderInactive_),e}p(t,i);var e=t.prototype;return e.sliderActive_=function(){this.addClass("vjs-slider-active")},e.sliderInactive_=function(){this.removeClass("vjs-slider-active")},e.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")},e.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),i.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},t}(jt);Be.prototype.options_={children:["muteToggle","volumeControl"]},jt.registerComponent("VolumePanel",Be);var mn=function(i){function t(t,e){t=i.call(this,t,e)||this;return e&&(t.menuButton_=e.menuButton),t.focusedChild_=-1,t.on("keydown",t.handleKeyPress),t}p(t,i);var e=t.prototype;return e.addItem=function(e){this.addChild(e),e.on("blur",Ct(this,this.handleBlur)),e.on(["tap","click"],Ct(this,function(t){this.menuButton_&&(this.menuButton_.unpressButton(),"CaptionSettingsMenuItem"!==e.name()&&this.menuButton_.focus())}))},e.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=A(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");t=i.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),ct(t,"click",function(t){t.preventDefault(),t.stopImmediatePropagation()}),t},e.dispose=function(){this.contentEl_=null,i.prototype.dispose.call(this)},e.handleBlur=function(t){var e=t.relatedTarget||h.activeElement;this.children().some(function(t){return t.el()===e})||(t=this.menuButton_)&&t.buttonPressed_&&e!==t.el().firstChild&&t.unpressButton()},e.handleKeyPress=function(t){37===t.which||40===t.which?(t.preventDefault(),this.stepForward()):38!==t.which&&39!==t.which||(t.preventDefault(),this.stepBack())},e.stepForward=function(){var t=0;void 0!==this.focusedChild_&&(t=this.focusedChild_+1),this.focus(t)},e.stepBack=function(){var t=0;void 0!==this.focusedChild_&&(t=this.focusedChild_-1),this.focus(t)},e.focus=function(t){void 0===t&&(t=0);var e=this.children().slice();e.length&&e[0].className&&/vjs-menu-title/.test(e[0].className)&&e.shift(),0<e.length&&(t<0?t=0:t>=e.length&&(t=e.length-1),e[this.focusedChild_=t].el_.focus())},t}(jt);jt.registerComponent("Menu",mn);pi=function(n){function t(t,e){var i;void 0===e&&(e={}),(i=n.call(this,t,e)||this).menuButton_=new hn(t,e),i.menuButton_.controlText(i.controlText_),i.menuButton_.el_.setAttribute("aria-haspopup","true");e=hn.prototype.buildCSSClass();return i.menuButton_.el_.className=i.buildCSSClass()+" "+e,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_,"focus",i.handleFocus),i.on(i.menuButton_,"blur",i.handleBlur),i.on(i.menuButton_,"mouseenter",function(){i.menu.show()}),i.on("keydown",i.handleSubmenuKeyPress),i}p(t,n);var e=t.prototype;return e.update=function(){var t=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=t,this.addChild(t),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},e.createMenu=function(){var t,e=new mn(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title&&(t=A("li",{className:"vjs-menu-title",innerHTML:Bt(this.options_.title),tabIndex:-1}),this.hideThreshold_+=1,e.children_.unshift(t),O(t,e.contentEl())),this.items=this.createItems(),this.items)for(var i=0;i<this.items.length;i++)e.addItem(this.items[i]);return e},e.createItems=function(){},e.createEl=function(){return n.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},e.buildWrapperCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+hn.prototype.buildCSSClass()+" "+n.prototype.buildCSSClass.call(this)},e.buildCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+n.prototype.buildCSSClass.call(this)},e.controlText=function(t,e){return void 0===e&&(e=this.menuButton_.el()),this.menuButton_.controlText(t,e)},e.handleClick=function(t){this.buttonPressed_?this.unpressButton():this.pressButton()},e.focus=function(){this.menuButton_.focus()},e.blur=function(){this.menuButton_.blur()},e.handleFocus=function(){ct(h,"keydown",Ct(this,this.handleKeyPress))},e.handleBlur=function(){ht(h,"keydown",Ct(this,this.handleKeyPress))},e.handleKeyPress=function(t){27===t.which||9===t.which?(this.buttonPressed_&&this.unpressButton(),9!==t.which&&(t.preventDefault(),this.menuButton_.el_.focus())):13!==t.which&&38!==t.which&&40!==t.which||this.buttonPressed_||(this.pressButton(),t.preventDefault())},e.handleSubmenuKeyPress=function(t){27!==t.which&&9!==t.which||(this.buttonPressed_&&this.unpressButton(),9!==t.which&&(t.preventDefault(),this.menuButton_.el_.focus()))},e.pressButton=function(){this.enabled_&&(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Gt&&C()||this.menu.focus())},e.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},e.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},e.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},t}(jt);jt.registerComponent("MenuButton",pi);qt=function(r){function t(t,e){var i=e.tracks,e=r.call(this,t,e)||this;if(e.items.length<=1&&e.hide(),!i)return l(e);var n=Ct(l(l(e)),e.update);return i.addEventListener("removetrack",n),i.addEventListener("addtrack",n),e.player_.on("ready",n),e.player_.on("dispose",function(){i.removeEventListener("removetrack",n),i.removeEventListener("addtrack",n)}),e}return p(t,r),t}(pi);jt.registerComponent("TrackButton",qt);Me=function(n){function t(t,e){t=n.call(this,t,e)||this;return t.selectable=e.selectable,t.isSelected_=e.selected||!1,t.multiSelectable=e.multiSelectable,t.selected(t.isSelected_),t.selectable?t.multiSelectable?t.el_.setAttribute("role","menuitemcheckbox"):t.el_.setAttribute("role","menuitemradio"):t.el_.setAttribute("role","menuitem"),t}p(t,n);var e=t.prototype;return e.createEl=function(t,e,i){return this.nonIconControl=!0,n.prototype.createEl.call(this,"li",y({className:"vjs-menu-item",innerHTML:'<span class="vjs-menu-item-text">'+this.localize(this.options_.label)+"</span>",tabIndex:-1},e),i)},e.handleClick=function(t){this.selected(!0)},e.selected=function(t){this.selectable&&(t?(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))},t}(Wt);jt.registerComponent("MenuItem",Me);var gn=function(u){function t(t,e){var n,i=e.track,r=t.textTracks();e.label=i.label||i.language||"Unknown",e.selected="showing"===i.mode,(n=u.call(this,t,e)||this).track=i;function a(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];n.handleTracksChange.apply(l(l(n)),e)}function s(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];n.handleSelectedLanguageChange.apply(l(l(n)),e)}var o;return t.on(["loadstart","texttrackchange"],a),r.addEventListener("change",a),r.addEventListener("selectedlanguagechange",s),n.on("dispose",function(){t.off(["loadstart","texttrackchange"],a),r.removeEventListener("change",a),r.removeEventListener("selectedlanguagechange",s)}),void 0===r.onchange&&n.on(["tap","click"],function(){if("object"!=typeof d.Event)try{o=new d.Event("change")}catch(t){}o||(o=h.createEvent("Event")).initEvent("change",!0,!0),r.dispatchEvent(o)}),n.handleTracksChange(),n}p(t,u);var e=t.prototype;return e.handleClick=function(t){var e=this.track.kind,i=this.track.kinds,n=this.player_.textTracks(),i=i||[e];if(u.prototype.handleClick.call(this,t),n)for(var r=0;r<n.length;r++){var a=n[r];a===this.track&&-1<i.indexOf(a.kind)?"showing"!==a.mode&&(a.mode="showing"):"disabled"!==a.mode&&(a.mode="disabled")}},e.handleTracksChange=function(t){var e="showing"===this.track.mode;e!==this.isSelected_&&this.selected(e)},e.handleSelectedLanguageChange=function(t){var e;"showing"===this.track.mode&&((e=this.player_.cache_.selectedLanguage)&&e.enabled&&e.language===this.track.language&&e.kind!==this.track.kind||(this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}))},e.dispose=function(){this.track=null,u.prototype.dispose.call(this)},t}(Me);jt.registerComponent("TextTrackMenuItem",gn);var yn=function(i){function t(t,e){return e.track={player:t,kind:e.kind,kinds:e.kinds,default:!1,mode:"disabled"},e.kinds||(e.kinds=[e.kind]),e.label?e.track.label=e.label:e.track.label=e.kinds.join(" and ")+" off",e.selectable=!0,e.multiSelectable=!1,i.call(this,t,e)||this}p(t,i);var e=t.prototype;return e.handleTracksChange=function(t){for(var e=this.player().textTracks(),i=!0,n=0,r=e.length;n<r;n++){var a=e[n];if(-1<this.options_.kinds.indexOf(a.kind)&&"showing"===a.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)},e.handleSelectedLanguageChange=function(t){for(var e=this.player().textTracks(),i=!0,n=0,r=e.length;n<r;n++){var a=e[n];if(-1<["captions","descriptions","subtitles"].indexOf(a.kind)&&"showing"===a.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(gn);jt.registerComponent("OffTextTrackMenuItem",yn);Xt=function(i){function t(t,e){return void 0===e&&(e={}),e.tracks=t.textTracks(),i.call(this,t,e)||this}return p(t,i),t.prototype.createItems=function(t,e){var i;void 0===t&&(t=[]),void 0===e&&(e=gn),this.label_&&(i=this.label_+" off"),t.push(new yn(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 a,s=n[r];-1<this.kinds_.indexOf(s.kind)&&((a=new e(this.player_,{track:s,selectable:!0,multiSelectable:!1})).addClass("vjs-"+s.kind+"-menu-item"),t.push(a))}return t},t}(qt);jt.registerComponent("TextTrackButton",Xt);var vn=function(a){function t(t,e){var i=e.track,n=e.cue,r=t.currentTime();return e.selectable=!0,e.multiSelectable=!1,e.label=n.text,e.selected=n.startTime<=r&&r<n.endTime,(e=a.call(this,t,e)||this).track=i,e.cue=n,i.addEventListener("cuechange",Ct(l(l(e)),e.update)),e}p(t,a);var e=t.prototype;return e.handleClick=function(t){a.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},e.update=function(t){var e=this.cue,i=this.player_.currentTime();this.selected(e.startTime<=i&&i<e.endTime)},t}(Me);jt.registerComponent("ChaptersTrackMenuItem",vn);Jt=function(n){function t(t,e,i){return n.call(this,t,e,i)||this}p(t,n);var e=t.prototype;return e.buildCSSClass=function(){return"vjs-chapters-button "+n.prototype.buildCSSClass.call(this)},e.buildWrapperCSSClass=function(){return"vjs-chapters-button "+n.prototype.buildWrapperCSSClass.call(this)},e.update=function(t){this.track_&&(!t||"addtrack"!==t.type&&"removetrack"!==t.type)||this.setTrack(this.findChaptersTrack()),n.prototype.update.call(this)},e.setTrack=function(t){var e;this.track_!==t&&(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_&&((e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_))&&e.removeEventListener("load",this.updateHandler_),this.track_=null),this.track_=t,this.track_&&(this.track_.mode="hidden",(t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_))&&t.addEventListener("load",this.updateHandler_)))},e.findChaptersTrack=function(){for(var t=this.player_.textTracks()||[],e=t.length-1;0<=e;e--){var i=t[e];if(i.kind===this.kind_)return i}},e.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(Bt(this.kind_))},e.createMenu=function(){return this.options_.title=this.getMenuCaption(),n.prototype.createMenu.call(this)},e.createItems=function(){var t=[];if(!this.track_)return t;var e=this.track_.cues;if(!e)return t;for(var i=0,n=e.length;i<n;i++){var r=e[i],r=new vn(this.player_,{track:this.track_,cue:r});t.push(r)}return t},t}(Xt);Jt.prototype.kind_="chapters",Jt.prototype.controlText_="Chapters",jt.registerComponent("ChaptersButton",Jt);Vt=function(a){function t(t,e,i){var i=a.call(this,t,e,i)||this,n=t.textTracks(),r=Ct(l(l(i)),i.handleTracksChange);return n.addEventListener("change",r),i.on("dispose",function(){n.removeEventListener("change",r)}),i}p(t,a);var e=t.prototype;return e.handleTracksChange=function(t){for(var e=this.player().textTracks(),i=!1,n=0,r=e.length;n<r;n++){var a=e[n];if(a.kind!==this.kind_&&"showing"===a.mode){i=!0;break}}i?this.disable():this.enable()},e.buildCSSClass=function(){return"vjs-descriptions-button "+a.prototype.buildCSSClass.call(this)},e.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+a.prototype.buildWrapperCSSClass.call(this)},t}(Xt);Vt.prototype.kind_="descriptions",Vt.prototype.controlText_="Descriptions",jt.registerComponent("DescriptionsButton",Vt);ie=function(n){function t(t,e,i){return n.call(this,t,e,i)||this}p(t,n);var e=t.prototype;return e.buildCSSClass=function(){return"vjs-subtitles-button "+n.prototype.buildCSSClass.call(this)},e.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+n.prototype.buildWrapperCSSClass.call(this)},t}(Xt);ie.prototype.kind_="subtitles",ie.prototype.controlText_="Subtitles",jt.registerComponent("SubtitlesButton",ie);var _n=function(i){function t(t,e){return e.track={player:t,kind:e.kind,label:e.kind+" settings",selectable:!1,default:!1,mode:"disabled"},e.selectable=!1,e.name="CaptionSettingsMenuItem",(t=i.call(this,t,e)||this).addClass("vjs-texttrack-settings"),t.controlText(", opens "+e.kind+" settings dialog"),t}return p(t,i),t.prototype.handleClick=function(t){this.player().getChild("textTrackSettings").open()},t}(gn);jt.registerComponent("CaptionSettingsMenuItem",_n);De=function(n){function t(t,e,i){return n.call(this,t,e,i)||this}p(t,n);var e=t.prototype;return e.buildCSSClass=function(){return"vjs-captions-button "+n.prototype.buildCSSClass.call(this)},e.buildWrapperCSSClass=function(){return"vjs-captions-button "+n.prototype.buildWrapperCSSClass.call(this)},e.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new _n(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),n.prototype.createItems.call(this,t)},t}(Xt);De.prototype.kind_="captions",De.prototype.controlText_="Captions",jt.registerComponent("CaptionsButton",De);var bn=function(r){function t(){return r.apply(this,arguments)||this}return p(t,r),t.prototype.createEl=function(t,e,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      "),n+="</span>",r.prototype.createEl.call(this,t,y({innerHTML:n},e),i)},t}(gn);jt.registerComponent("SubsCapsMenuItem",bn);Re=function(i){function t(t,e){return void 0===e&&(e={}),(e=i.call(this,t,e)||this).label_="subtitles",-1<["en","en-us","en-ca","fr-ca"].indexOf(e.player_.language_)&&(e.label_="captions"),e.menuButton_.controlText(Bt(e.label_)),e}p(t,i);var e=t.prototype;return e.buildCSSClass=function(){return"vjs-subs-caps-button "+i.prototype.buildCSSClass.call(this)},e.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+i.prototype.buildWrapperCSSClass.call(this)},e.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new _n(this.player_,{kind:this.label_})),this.hideThreshold_+=1),t=i.prototype.createItems.call(this,t,bn)},t}(Xt);Re.prototype.kinds_=["captions","subtitles"],Re.prototype.controlText_="Subtitles",jt.registerComponent("SubsCapsButton",Re);var Tn=function(s){function t(t,e){var n,i=e.track,r=t.audioTracks();e.label=i.label||i.language||"Unknown",e.selected=i.enabled,(n=s.call(this,t,e)||this).track=i,n.addClass("vjs-"+i.kind+"-menu-item");function a(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];n.handleTracksChange.apply(l(l(n)),e)}return r.addEventListener("change",a),n.on("dispose",function(){r.removeEventListener("change",a)}),n}p(t,s);var e=t.prototype;return e.createEl=function(t,e,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      "),n+="</span>",s.prototype.createEl.call(this,t,y({innerHTML:n},e),i)},e.handleClick=function(t){var e=this.player_.audioTracks();s.prototype.handleClick.call(this,t);for(var i=0;i<e.length;i++){var n=e[i];n.enabled=n===this.track}},e.handleTracksChange=function(t){this.selected(this.track.enabled)},t}(Me);jt.registerComponent("AudioTrackMenuItem",Tn);Be=function(i){function t(t,e){return void 0===e&&(e={}),e.tracks=t.audioTracks(),i.call(this,t,e)||this}p(t,i);var e=t.prototype;return e.buildCSSClass=function(){return"vjs-audio-button "+i.prototype.buildCSSClass.call(this)},e.buildWrapperCSSClass=function(){return"vjs-audio-button "+i.prototype.buildWrapperCSSClass.call(this)},e.createItems=function(t){void 0===t&&(t=[]),this.hideThreshold_=1;for(var e=this.player_.audioTracks(),i=0;i<e.length;i++){var n=e[i];t.push(new Tn(this.player_,{track:n,selectable:!0,multiSelectable:!1}))}return t},t}(qt);Be.prototype.controlText_="Audio Track",jt.registerComponent("AudioTrackButton",Be);var Sn=function(r){function t(t,e){var i=e.rate,n=parseFloat(i,10);return e.label=i,e.selected=1===n,e.selectable=!0,e.multiSelectable=!1,(e=r.call(this,t,e)||this).label=i,e.rate=n,e.on(t,"ratechange",e.update),e}p(t,r);var e=t.prototype;return e.handleClick=function(t){r.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},e.update=function(t){this.selected(this.player().playbackRate()===this.rate)},t}(Me);Sn.prototype.contentElType="button",jt.registerComponent("PlaybackRateMenuItem",Sn);Wt=function(i){function t(t,e){e=i.call(this,t,e)||this;return e.updateVisibility(),e.updateLabel(),e.on(t,"loadstart",e.updateVisibility),e.on(t,"ratechange",e.updateLabel),e}p(t,i);var e=t.prototype;return e.createEl=function(){var t=i.prototype.createEl.call(this);return this.labelEl_=A("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),t.appendChild(this.labelEl_),t},e.dispose=function(){this.labelEl_=null,i.prototype.dispose.call(this)},e.buildCSSClass=function(){return"vjs-playback-rate "+i.prototype.buildCSSClass.call(this)},e.buildWrapperCSSClass=function(){return"vjs-playback-rate "+i.prototype.buildWrapperCSSClass.call(this)},e.createMenu=function(){var t=new mn(this.player()),e=this.playbackRates();if(e)for(var i=e.length-1;0<=i;i--)t.addChild(new Sn(this.player(),{rate:e[i]+"x"}));return t},e.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},e.handleClick=function(t){for(var e=this.player().playbackRate(),i=this.playbackRates(),n=i[0],r=0;r<i.length;r++)if(i[r]>e){n=i[r];break}this.player().playbackRate(n)},e.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates},e.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&0<this.playbackRates().length},e.updateVisibility=function(t){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},e.updateLabel=function(t){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},t}(pi);Wt.prototype.controlText_="Playback Rate",jt.registerComponent("PlaybackRateMenuButton",Wt);Jt=function(t){function e(){return t.apply(this,arguments)||this}p(e,t);var i=e.prototype;return i.buildCSSClass=function(){return"vjs-spacer "+t.prototype.buildCSSClass.call(this)},i.createEl=function(){return t.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},e}(jt);jt.registerComponent("Spacer",Jt);Vt=function(e){function t(){return e.apply(this,arguments)||this}p(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},i.createEl=function(){var t=e.prototype.createEl.call(this,{className:this.buildCSSClass()});return t.innerHTML=" ",t},t}(Jt);jt.registerComponent("CustomControlSpacer",Vt);ie=function(t){function e(){return t.apply(this,arguments)||this}return p(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},e}(jt);ie.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},jt.registerComponent("ControlBar",ie);De=function(i){function t(t,e){e=i.call(this,t,e)||this;return e.on(t,"error",e.open),e}p(t,i);var e=t.prototype;return e.buildCSSClass=function(){return"vjs-error-display "+i.prototype.buildCSSClass.call(this)},e.content=function(){var t=this.player().error();return t?this.localize(t.message):""},t}(Ce);De.prototype.options_=Nt(Ce.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),jt.registerComponent("ErrorDisplay",De);var kn="vjs-text-track-settings",Xt=["#000","Black"],Re=["#00F","Blue"],qt=["#0FF","Cyan"],Be=["#0F0","Green"],Me=["#F0F","Magenta"],pi=["#F00","Red"],Wt=["#FFF","White"],Jt=["#FF0","Yellow"],Vt=["1","Opaque"],ie=["0.5","Semi-Transparent"],De=["0","Transparent"],wn={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Xt,Wt,pi,Be,Re,Jt,Me,qt]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[Vt,ie,De]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Wt,Xt,pi,Be,Re,Jt,Me,qt]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(t){return"1.00"===t?null:Number(t)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[Vt,ie]},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:[De,ie,Vt]}};function Cn(t,e){if(e&&(t=e(t)),t&&"none"!==t)return t}wn.windowColor.options=wn.backgroundColor.options;Vt=function(n){function t(t,e){var i;return e.temporary=!1,(i=n.call(this,t,e)||this).updateDisplay=Ct(l(l(i)),i.updateDisplay),i.fill(),i.hasBeenOpened_=i.hasBeenFilled_=!0,i.endDialog=A("p",{className:"vjs-control-text",textContent:i.localize("End of dialog window.")}),i.el().appendChild(i.endDialog),i.setDefaults(),void 0===e.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()}),c(wn,function(t){i.on(i.$(t.selector),"change",i.updateDisplay)}),i.options_.persistTextTrackSettings&&i.restoreSettings(),i}p(t,n);var e=t.prototype;return e.dispose=function(){this.endDialog=null,n.prototype.dispose.call(this)},e.createElSelect_=function(t,e,i){var n=this;void 0===e&&(e=""),void 0===i&&(i="label");var t=wn[t],r=t.id.replace("%s",this.id_),a=[e,r].join(" ").trim();return["<"+i+' id="'+r+'" class="'+("label"===i?"vjs-label":"")+'">',this.localize(t.label),"</"+i+">",'<select aria-labelledby="'+a+'">'].concat(t.options.map(function(t){var e=r+"-"+t[1].replace(/\W+/g,"");return['<option id="'+e+'" value="'+t[0]+'" ','aria-labelledby="'+a+" "+e+'">',n.localize(t[1]),"</option>"].join("")})).concat("</select>").join("")},e.createElFgColor_=function(){var t="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+t+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",t),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",t),"</span>","</fieldset>"].join("")},e.createElBgColor_=function(){var t="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+t+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",t),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",t),"</span>","</fieldset>"].join("")},e.createElWinColor_=function(){var t="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+t+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",t),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",t),"</span>","</fieldset>"].join("")},e.createElColors_=function(){return A("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},e.createElFont_=function(){return A("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("")})},e.createElControls_=function(){var t=this.localize("restore all settings to the default values");return A("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+t+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+t+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},e.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},e.label=function(){return this.localize("Caption Settings Dialog")},e.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},e.buildCSSClass=function(){return n.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},e.getValues=function(){var i,n,t,r=this;return n=function(t,e,i){var n,e=(n=r.$(e.selector),e=e.parser,Cn(n.options[n.options.selectedIndex].value,e));return void 0!==e&&(t[i]=e),t},void 0===(t={})&&(t=0),a(i=wn).reduce(function(t,e){return n(t,i[e],e)},t)},e.setValues=function(i){var n=this;c(wn,function(t,e){!function(t,e,i){if(e)for(var n=0;n<t.options.length;n++)if(Cn(t.options[n].value,i)===e){t.selectedIndex=n;break}}(n.$(t.selector),i[e],t.parser)})},e.setDefaults=function(){var i=this;c(wn,function(t){var e=t.hasOwnProperty("default")?t.default:0;i.$(t.selector).selectedIndex=e})},e.restoreSettings=function(){var t;try{t=JSON.parse(d.localStorage.getItem(kn))}catch(t){f.warn(t)}t&&this.setValues(t)},e.saveSettings=function(){if(this.options_.persistTextTrackSettings){var t=this.getValues();try{Object.keys(t).length?d.localStorage.setItem(kn,JSON.stringify(t)):d.localStorage.removeItem(kn)}catch(t){f.warn(t)}}},e.updateDisplay=function(){var t=this.player_.getChild("textTrackDisplay");t&&t.updateDisplay()},e.conditionalBlur_=function(){this.previouslyActiveEl_=null,this.off(h,"keydown",this.handleKeyDown);var t=this.player_.controlBar,e=t&&t.subsCapsButton,t=t&&t.captionsButton;e?e.focus():t&&t.focus()},t}(Ce);jt.registerComponent("TextTrackSettings",Vt);Vt=function(a){function t(t,e){var i=e.ResizeObserver||d.ResizeObserver;null===e.ResizeObserver&&(i=!1);var n,r=Nt({createEl:!i,reportTouchActivity:!1},e);return(n=a.call(this,t,r)||this).ResizeObserver=e.ResizeObserver||d.ResizeObserver,n.loadListener_=null,n.resizeObserver_=null,n.debouncedHandler_=St(function(){n.resizeHandler()},100,!1,l(l(n))),i?(n.resizeObserver_=new n.ResizeObserver(n.debouncedHandler_),n.resizeObserver_.observe(t.el())):(n.loadListener_=function(){n.el_&&n.el_.contentWindow&&ct(n.el_.contentWindow,"resize",n.debouncedHandler_)},n.one("load",n.loadListener_)),n}p(t,a);var e=t.prototype;return e.createEl=function(){return a.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager"})},e.resizeHandler=function(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")},e.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.el_&&this.el_.contentWindow&&ht(this.el_.contentWindow,"resize",this.debouncedHandler_),this.loadListener_&&this.off("load",this.loadListener_),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null},t}(jt);jt.registerComponent("ResizeManager",Vt);Vt=function(i){function t(t,e){var e=Nt({createEl:!1},e),e=i.call(this,t,e)||this;return e.reset_(),e.on(e.player_,"durationchange",e.handleDurationchange),e}p(t,i);var e=t.prototype;return e.isBehind_=function(){if(!this.timeupdateSeen_)return!1;var t=this.liveCurrentTime(),e=this.player_.currentTime(),i=this.seekableIncrement_;return t!==1/0&&e<=t-(2*i+.07)},e.trackLive_=function(){this.pastSeekEnd_=this.pastSeekEnd_;var t=this.player_.seekable();t&&t.length&&((t=this.seekableEnd())!==this.lastSeekEnd_&&(this.lastSeekEnd_&&(this.seekableIncrement_=Math.abs(t-this.lastSeekEnd_)),this.pastSeekEnd_=0,this.lastSeekEnd_=t,this.trigger("seekableendchange")),this.pastSeekEnd_=this.pastSeekEnd()+.03,this.isBehind_()!==this.behindLiveEdge()&&(this.behindLiveEdge_=this.isBehind_(),this.trigger("liveedgechange")))},e.handleDurationchange=function(){this.player_.duration()===1/0?this.startTracking():this.stopTracking()},e.startTracking=function(){var t=this;this.isTracking()||(this.trackingInterval_=this.setInterval(this.trackLive_,30),this.trackLive_(),this.on(this.player_,"play",this.trackLive_),this.on(this.player_,"pause",this.trackLive_),this.one(this.player_,"play",this.handlePlay),this.timeupdateSeen_||(this.handleTimeupdate=function(){t.timeupdateSeen_=!0,t.handleTimeupdate=null},this.one(this.player_,"timeupdate",this.handleTimeupdate)))},e.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge)},e.reset_=function(){this.pastSeekEnd_=0,this.lastSeekEnd_=null,this.behindLiveEdge_=null,this.timeupdateSeen_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.seekableIncrement_=12,this.off(this.player_,"play",this.trackLive_),this.off(this.player_,"pause",this.trackLive_),this.off(this.player_,"play",this.handlePlay),this.off(this.player_,"timeupdate",this.seekToLiveEdge),this.handleTimeupdate&&(this.off(this.player_,"timeupdate",this.handleTimeupdate),this.handleTimeupdate=null)},e.stopTracking=function(){this.isTracking()&&this.reset_()},e.seekableEnd=function(){for(var t=this.player_.seekable(),e=[],i=t?t.length:0;i--;)e.push(t.end(i));return e.length?e.sort()[e.length-1]:1/0},e.seekableStart=function(){for(var t=this.player_.seekable(),e=[],i=t?t.length:0;i--;)e.push(t.start(i));return e.length?e.sort()[0]:0},e.liveWindow=function(){var t=this.liveCurrentTime();return t===1/0?1/0:t-this.seekableStart()},e.isLive=function(){return this.isTracking()},e.atLiveEdge=function(){return!this.behindLiveEdge()},e.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},e.pastSeekEnd=function(){return this.pastSeekEnd_},e.behindLiveEdge=function(){return this.behindLiveEdge_},e.isTracking=function(){return"number"==typeof this.trackingInterval_},e.seekToLiveEdge=function(){this.atLiveEdge()||(this.player_.currentTime(this.liveCurrentTime()),this.player_.paused()&&this.player_.play())},e.dispose=function(){this.stopTracking(),i.prototype.dispose.call(this)},t}(jt);jt.registerComponent("LiveTracker",Vt);function En(t){if((n=t.el()).hasAttribute("src"))return t.triggerSourceset(n.src),1;var e=t.$$("source"),i=[],n="";if(e.length){for(var r=0;r<e.length;r++){var a=e[r].src;a&&-1===i.indexOf(a)&&i.push(a)}return!!i.length&&(1===i.length&&(n=i[0]),t.triggerSourceset(n),!0)}}function An(t,e){for(var i={},n=0;n<t.length&&!((i=Object.getOwnPropertyDescriptor(t[n],e))&&i.set&&i.get);n++);return i.enumerable=!0,i.configurable=!0,i}function Ln(a){var e,t,i,s=a.el();s.resetSourceWatch_||(e={},t=An([a.el(),d.HTMLMediaElement.prototype,d.Element.prototype,Pn],"innerHTML"),i=function(r){return function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];var n=r.apply(s,e);return En(a),n}},["append","appendChild","insertAdjacentHTML"].forEach(function(t){s[t]&&(e[t]=s[t],s[t]=i(e[t]))}),Object.defineProperty(s,"innerHTML",Nt(t,{set:i(t.set)})),s.resetSourceWatch_=function(){s.resetSourceWatch_=null,Object.keys(e).forEach(function(t){s[t]=e[t]}),Object.defineProperty(s,"innerHTML",t)},a.one("sourceset",s.resetSourceWatch_))}function On(i){var n,e,r,a;i.featuresSourceset&&((n=i.el()).resetSourceset_||(e=An([i.el(),d.HTMLMediaElement.prototype,Un],"src"),r=n.setAttribute,a=n.load,Object.defineProperty(n,"src",Nt(e,{set:function(t){t=e.set.call(n,t);return i.triggerSourceset(n.src),t}})),n.setAttribute=function(t,e){e=r.call(n,t,e);return/src/i.test(t)&&i.triggerSourceset(n.src),e},n.load=function(){var t=a.call(n);return En(i)||(i.triggerSourceset(""),Ln(i)),t},n.currentSrc?i.triggerSourceset(n.currentSrc):En(i)||Ln(i),n.resetSourceset_=function(){n.resetSourceset_=null,n.load=a,n.setAttribute=r,Object.defineProperty(n,"src",e),n.resetSourceWatch_&&n.resetSourceWatch_()}))}var Pn=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(t){var e=h.createElement(this.nodeName.toLowerCase());e.innerHTML=t;for(var i=h.createDocumentFragment();e.childNodes.length;)i.appendChild(e.childNodes[0]);return this.innerText="",d.Element.prototype.appendChild.call(this,i),this.innerHTML}}),Un=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?Ue(d.Element.prototype.getAttribute.call(this,"src")):""},set:function(t){return d.Element.prototype.setAttribute.call(this,"src",t),t}});function In(){var t=e(["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n            This may prevent text tracks from loading."]);return In=function(){return t},t}var xn=function(l){function s(t,e){var i=l.call(this,t,e)||this,e=t.source,n=!1;if(e&&(i.el_.currentSrc!==e.src||t.tag&&3===t.tag.initNetworkState_)?i.setSource(e):i.handleLateInit_(i.el_),t.enableSourceset&&i.setupSourcesetHandling_(),i.el_.hasChildNodes()){for(var r=i.el_.childNodes,a=r.length,s=[];a--;){var o=r[a];"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")||!xe(o.src)||(n=!0)):s.push(o))}for(var u=0;u<s.length;u++)i.el_.removeChild(s[u])}return i.proxyNativeTracks_(),i.featuresNativeTextTracks&&n&&f.warn(g(In())),i.restoreMetadataTracksInIOSNativePlayer_(),(re||zt||Kt)&&!0===t.nativeControlsForTouch&&i.setControls(!0),i.proxyWebkitFullscreen_(),i.triggerReady(),i}p(s,l);var t=s.prototype;return t.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),s.disposeMediaElement(this.el_),this.options_=null,l.prototype.dispose.call(this)},t.setupSourcesetHandling_=function(){On(this)},t.restoreMetadataTracksInIOSNativePlayer_=function(){function t(){i=[];for(var t=0;t<n.length;t++){var e=n[t];"metadata"===e.kind&&i.push({track:e,storedMode:e.mode})}}var i,n=this.textTracks();t(),n.addEventListener("change",t),this.on("dispose",function(){return n.removeEventListener("change",t)});function r(){for(var t=0;t<i.length;t++){var e=i[t];"disabled"===e.track.mode&&e.track.mode!==e.storedMode&&(e.track.mode=e.storedMode)}n.removeEventListener("change",r)}this.on("webkitbeginfullscreen",function(){n.removeEventListener("change",t),n.removeEventListener("change",r),n.addEventListener("change",r)}),this.on("webkitendfullscreen",function(){n.removeEventListener("change",t),n.addEventListener("change",t),n.removeEventListener("change",r)})},t.overrideNative_=function(t,e){var i,n=this;e===this["featuresNative"+t+"Tracks"]&&(this[(i=t.toLowerCase())+"TracksListeners_"]&&Object.keys(this[i+"TracksListeners_"]).forEach(function(t){n.el()[i+"Tracks"].removeEventListener(t,n[i+"TracksListeners_"][t])}),this["featuresNative"+t+"Tracks"]=!e,this[i+"TracksListeners_"]=null,this.proxyNativeTracksForType_(i))},t.overrideNativeAudioTracks=function(t){this.overrideNative_("Audio",t)},t.overrideNativeVideoTracks=function(t){this.overrideNative_("Video",t)},t.proxyNativeTracksForType_=function(t){var n,e,r=this,t=fi[t],a=this.el()[t.getterName],s=this[t.getterName]();this["featuresNative"+t.capitalName+"Tracks"]&&a&&a.addEventListener&&(n={change:function(t){s.trigger({type:"change",target:s,currentTarget:s,srcElement:s})},addtrack:function(t){s.addTrack(t.track)},removetrack:function(t){s.removeTrack(t.track)}},e=function(){for(var t=[],e=0;e<s.length;e++){for(var i=!1,n=0;n<a.length;n++)if(a[n]===s[e]){i=!0;break}i||t.push(s[e])}for(;t.length;)s.removeTrack(t.shift())},this[t.getterName+"Listeners_"]=n,Object.keys(n).forEach(function(e){var i=n[e];a.addEventListener(e,i),r.on("dispose",function(t){return a.removeEventListener(e,i)})}),this.on("loadstart",e),this.on("dispose",function(t){return r.off("loadstart",e)}))},t.proxyNativeTracks_=function(){var e=this;fi.names.forEach(function(t){e.proxyNativeTracksForType_(t)})},t.createEl=function(){var t,e=this.options_.tag;e&&(this.options_.playerElIngest||this.movingMediaElementInDOM)||(e?(t=e.cloneNode(!0),e.parentNode&&e.parentNode.insertBefore(t,e),s.disposeMediaElement(e),e=t):(e=h.createElement("video"),t=Nt({},this.options_.tag&&R(this.options_.tag)),re&&!0===this.options_.nativeControlsForTouch||delete t.controls,D(e,y(t,{id:this.options_.techId,class:"vjs-tech"}))),e.playerId=this.options_.playerId),void 0!==this.options_.preload&&B(e,"preload",this.options_.preload);for(var i=["loop","muted","playsinline","autoplay"],n=0;n<i.length;n++){var r=i[n],a=this.options_[r];void 0!==a&&(a?B(e,r,r):N(e,r),e[r]=a)}return e},t.handleLateInit_=function(t){if(0!==t.networkState&&3!==t.networkState){if(0===t.readyState){function e(){i=!0}var i=!1;this.on("loadstart",e);function n(){i||this.trigger("loadstart")}return this.on("loadedmetadata",n),void this.ready(function(){this.off("loadstart",e),this.off("loadedmetadata",n),i||this.trigger("loadstart")})}var r=["loadstart"];r.push("loadedmetadata"),2<=t.readyState&&r.push("loadeddata"),3<=t.readyState&&r.push("canplay"),4<=t.readyState&&r.push("canplaythrough"),this.ready(function(){r.forEach(function(t){this.trigger(t)},this)})}},t.setCurrentTime=function(t){try{this.el_.currentTime=t}catch(t){f(t,"Video is not ready. (Video.js)")}},t.duration=function(){var t=this;if(this.el_.duration===1/0&&Yt&&Zt&&0===this.el_.currentTime){function e(){0<t.el_.currentTime&&(t.el_.duration===1/0&&t.trigger("durationchange"),t.off("timeupdate",e))}return this.on("timeupdate",e),NaN}return this.el_.duration||NaN},t.width=function(){return this.el_.offsetWidth},t.height=function(){return this.el_.offsetHeight},t.proxyWebkitFullscreen_=function(){var t,e,i=this;"webkitDisplayingFullscreen"in this.el_&&(t=function(){this.trigger("fullscreenchange",{isFullscreen:!1})},e=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0}))},this.on("webkitbeginfullscreen",e),this.on("dispose",function(){i.off("webkitbeginfullscreen",e),i.off("webkitendfullscreen",t)}))},t.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var t=d.navigator&&d.navigator.userAgent||"";if(/Android/.test(t)||!/Chrome|Mac OS X 10.5/.test(t))return!0}return!1},t.enterFullScreen=function(){var t=this.el_;t.paused&&t.networkState<=t.HAVE_METADATA?(this.el_.play(),this.setTimeout(function(){t.pause(),t.webkitEnterFullScreen()},0)):t.webkitEnterFullScreen()},t.exitFullScreen=function(){this.el_.webkitExitFullScreen()},t.src=function(t){if(void 0===t)return this.el_.src;this.setSrc(t)},t.reset=function(){s.resetMediaElement(this.el_)},t.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},t.setControls=function(t){this.el_.controls=!!t},t.addTextTrack=function(t,e,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,e,i):l.prototype.addTextTrack.call(this,t,e,i)},t.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return l.prototype.createRemoteTextTrack.call(this,t);var e=h.createElement("track");return t.kind&&(e.kind=t.kind),t.label&&(e.label=t.label),(t.language||t.srclang)&&(e.srclang=t.language||t.srclang),t.default&&(e.default=t.default),t.id&&(e.id=t.id),t.src&&(e.src=t.src),e},t.addRemoteTextTrack=function(t,e){e=l.prototype.addRemoteTextTrack.call(this,t,e);return this.featuresNativeTextTracks&&this.el().appendChild(e),e},t.removeRemoteTextTrack=function(t){if(l.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks)for(var e=this.$$("track"),i=e.length;i--;)t!==e[i]&&t!==e[i].track||this.el().removeChild(e[i])},t.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var t={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(t.droppedVideoFrames=this.el().webkitDroppedFrameCount,t.totalVideoFrames=this.el().webkitDecodedFrameCount),d.performance&&"function"==typeof d.performance.now?t.creationTime=d.performance.now():d.performance&&d.performance.timing&&"number"==typeof d.performance.timing.navigationStart&&(t.creationTime=d.Date.now()-d.performance.timing.navigationStart),t},s}(Wi);k()&&(xn.TEST_VID=h.createElement("video"),(rr=h.createElement("track")).kind="captions",rr.srclang="en",rr.label="English",xn.TEST_VID.appendChild(rr)),xn.isSupported=function(){try{xn.TEST_VID.volume=.5}catch(t){return!1}return!(!xn.TEST_VID||!xn.TEST_VID.canPlayType)},xn.canPlayType=function(t){return xn.TEST_VID.canPlayType(t)},xn.canPlaySource=function(t,e){return xn.canPlayType(t.type)},xn.canControlVolume=function(){try{var t=xn.TEST_VID.volume;return xn.TEST_VID.volume=t/2+.1,t!==xn.TEST_VID.volume}catch(t){return!1}},xn.canMuteVolume=function(){try{var t=xn.TEST_VID.muted;return xn.TEST_VID.muted=!t,xn.TEST_VID.muted?B(xn.TEST_VID,"muted","muted"):N(xn.TEST_VID,"muted"),t!==xn.TEST_VID.muted}catch(t){return!1}},xn.canControlPlaybackRate=function(){if(Yt&&Zt&&te<58)return!1;try{var t=xn.TEST_VID.playbackRate;return xn.TEST_VID.playbackRate=t/2+.1,t!==xn.TEST_VID.playbackRate}catch(t){return!1}},xn.canOverrideAttributes=function(){try{function t(){}Object.defineProperty(h.createElement("video"),"src",{get:t,set:t}),Object.defineProperty(h.createElement("audio"),"src",{get:t,set:t}),Object.defineProperty(h.createElement("video"),"innerHTML",{get:t,set:t}),Object.defineProperty(h.createElement("audio"),"innerHTML",{get:t,set:t})}catch(t){return!1}return!0},xn.supportsNativeTextTracks=function(){return ne||Gt&&Zt},xn.supportsNativeVideoTracks=function(){return!(!xn.TEST_VID||!xn.TEST_VID.videoTracks)},xn.supportsNativeAudioTracks=function(){return!(!xn.TEST_VID||!xn.TEST_VID.audioTracks)},xn.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],xn.prototype.featuresVolumeControl=xn.canControlVolume(),xn.prototype.featuresMuteControl=xn.canMuteVolume(),xn.prototype.featuresPlaybackRate=xn.canControlPlaybackRate(),xn.prototype.featuresSourceset=xn.canOverrideAttributes(),xn.prototype.movingMediaElementInDOM=!Gt,xn.prototype.featuresFullscreenResize=!0,xn.prototype.featuresProgressEvents=!0,xn.prototype.featuresTimeupdateEvents=!0,xn.prototype.featuresNativeTextTracks=xn.supportsNativeTextTracks(),xn.prototype.featuresNativeVideoTracks=xn.supportsNativeVideoTracks(),xn.prototype.featuresNativeAudioTracks=xn.supportsNativeAudioTracks();var Dn=xn.TEST_VID&&xn.TEST_VID.constructor.prototype.canPlayType,Rn=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;function Mn(){var t=e(["\n        Using the tech directly can be dangerous. I hope you know what you're doing.\n        See https://github.com/videojs/video.js/issues/2617 for more info.\n      "]);return Mn=function(){return t},t}xn.patchCanPlayType=function(){4<=$t&&!Qt&&!Zt&&(xn.TEST_VID.constructor.prototype.canPlayType=function(t){return t&&Rn.test(t)?"maybe":Dn.call(this,t)})},xn.unpatchCanPlayType=function(){var t=xn.TEST_VID.constructor.prototype.canPlayType;return xn.TEST_VID.constructor.prototype.canPlayType=Dn,t},xn.patchCanPlayType(),xn.disposeMediaElement=function(t){if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("src"),"function"==typeof t.load&&function(){try{t.load()}catch(t){}}()}},xn.resetMediaElement=function(t){if(t){for(var e=t.querySelectorAll("source"),i=e.length;i--;)t.removeChild(e[i]);t.removeAttribute("src"),"function"==typeof t.load&&function(){try{t.load()}catch(t){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(t){xn.prototype[t]=function(){return this.el_[t]||this.el_.hasAttribute(t)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){xn.prototype["set"+Bt(e)]=function(t){(this.el_[e]=t)?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","played","networkState","readyState","videoWidth","videoHeight"].forEach(function(t){xn.prototype[t]=function(){return this.el_[t]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate"].forEach(function(e){xn.prototype["set"+Bt(e)]=function(t){this.el_[e]=t}}),["pause","load","play"].forEach(function(t){xn.prototype[t]=function(){return this.el_[t]()}}),Wi.withSourceHandlers(xn),xn.nativeSourceHandler={},xn.nativeSourceHandler.canPlayType=function(t){try{return xn.TEST_VID.canPlayType(t)}catch(t){return""}},xn.nativeSourceHandler.canHandleSource=function(t,e){if(t.type)return xn.nativeSourceHandler.canPlayType(t.type);if(t.src){t=Ie(t.src);return xn.nativeSourceHandler.canPlayType("video/"+t)}return""},xn.nativeSourceHandler.handleSource=function(t,e,i){e.setSrc(t.src)},xn.nativeSourceHandler.dispose=function(){},xn.registerSourceHandler(xn.nativeSourceHandler),Wi.registerTech("Html5",xn);var Bn=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Nn={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},jn=["tiny","xsmall","small","medium","large","xlarge","huge"],Fn={};jn.forEach(function(t){var e="x"===t.charAt(0)?"x-"+t.substring(1):t;Fn[t]="vjs-layout-"+e});var Vn={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Hn=function(c){function o(t,e,i){var n;if(t.id=t.id||e.id||"vjs_video_"+Z++,(e=y(o.getTagSettings(t),e)).initChildren=!1,e.createEl=!1,e.evented=!1,e.reportTouchActivity=!1,!e.language)if("function"==typeof t.closest){var r=t.closest("[lang]");r&&r.getAttribute&&(e.language=r.getAttribute("lang"))}else for(var a=t;a&&1===a.nodeType;){if(R(a).hasOwnProperty("lang")){e.language=a.getAttribute("lang");break}a=a.parentNode}if((r=c.call(this,null,e,i)||this).log=m(r.id_),r.isPosterFromTech_=!1,r.queuedCallbacks_=[],r.isReady_=!1,r.hasStarted_=!1,r.userActive_=!1,!r.options_||!r.options_.techOrder||!r.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");r.tag=t,r.tagAttributes=t&&R(t),r.language(r.options_.language),e.languages?(n={},Object.getOwnPropertyNames(e.languages).forEach(function(t){n[t.toLowerCase()]=e.languages[t]}),r.languages_=n):r.languages_=o.prototype.options_.languages,r.cache_={},r.poster_=e.poster||"",r.controls_=!!e.controls,r.cache_.lastVolume=1,t.controls=!1,t.removeAttribute("controls"),t.hasAttribute("autoplay")?r.options_.autoplay=!0:r.autoplay(r.options_.autoplay),r.scrubbing_=!1,r.el_=r.createEl(),r.cache_.lastPlaybackRate=r.defaultPlaybackRate(),Dt(l(l(r)),{eventBusKey:"el_"}),r.fluid_&&r.on("playerreset",r.updateStyleEl_);var s,i=Nt(r.options_);e.plugins&&(s=e.plugins,Object.keys(s).forEach(function(t){if("function"!=typeof this[t])throw new Error('plugin "'+t+'" does not exist');this[t](s[t])},l(l(r)))),r.options_.playerOptions=i,r.middleware_=[],r.initChildren(),r.isAudio("audio"===t.nodeName.toLowerCase()),r.controls()?r.addClass("vjs-controls-enabled"):r.addClass("vjs-controls-disabled"),r.el_.setAttribute("role","region"),r.isAudio()?r.el_.setAttribute("aria-label",r.localize("Audio Player")):r.el_.setAttribute("aria-label",r.localize("Video Player")),r.isAudio()&&r.addClass("vjs-audio"),r.flexNotSupported_()&&r.addClass("vjs-no-flex"),Gt||r.addClass("vjs-workinghover"),o.players[r.id_]=l(l(r));t=u.split(".")[0];return r.addClass("vjs-v"+t),r.userActive(!0),r.reportUserActivity(),r.one("play",r.listenForUserActivity_),r.on("fullscreenchange",r.handleFullscreenChange_),r.on("stageclick",r.handleStageClick_),r.breakpoints(r.options_.breakpoints),r.responsive(r.options_.responsive),r.changingSrc_=!1,r.playWaitingForReady_=!1,r.playOnLoadstart_=null,r}p(o,c);var t=o.prototype;return t.dispose=function(){this.trigger("dispose"),this.off("dispose"),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),Xi[this.id()]=null,c.prototype.dispose.call(this)},t.createEl=function(){var e,i=this.tag,t=this.playerElIngest_=i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute("data-vjs-player"),n="video-js"===this.tag.tagName.toLowerCase();t?e=this.el_=i.parentNode:n||(e=this.el_=c.prototype.createEl.call(this,"div"));var r,a,s=R(i);if(n){for(e=this.el_=i,i=this.tag=h.createElement("video");e.children.length;)i.appendChild(e.firstChild);P(e,"video-js")||U(e,"video-js"),e.appendChild(i),t=this.playerElIngest_=e,Object.keys(e).forEach(function(t){i[t]=e[t]})}i.setAttribute("tabindex","-1"),s.tabindex="-1",ee&&(i.setAttribute("role","application"),s.role="application"),i.removeAttribute("width"),i.removeAttribute("height"),"width"in s&&delete s.width,"height"in s&&delete s.height,Object.getOwnPropertyNames(s).forEach(function(t){n&&"class"===t||e.setAttribute(t,s[t]),n&&i.setAttribute(t,s[t])}),i.playerId=i.id,i.id+="_html5_api",i.className="vjs-tech",(i.player=e.player=this).addClass("vjs-paused"),!0!==d.VIDEOJS_NO_DYNAMIC_STYLE&&(this.styleEl_=_t("vjs-styles-dimensions"),r=K(".vjs-styles-defaults"),(a=K("head")).insertBefore(this.styleEl_,r?r.nextSibling:a.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);for(var o=i.getElementsByTagName("a"),u=0;u<o.length;u++){var l=o.item(u);U(l,"vjs-hidden"),l.setAttribute("hidden","hidden")}return i.initNetworkState_=i.networkState,i.parentNode&&!t&&i.parentNode.insertBefore(e,i),O(i,e),this.children_.unshift(i),this.el_.setAttribute("lang",this.language_),this.el_=e},t.width=function(t){return this.dimension("width",t)},t.height=function(t){return this.dimension("height",t)},t.dimension=function(t,e){var i=t+"_";if(void 0===e)return this[i]||0;if(""===e)return this[i]=void 0,void this.updateStyleEl_();var n=parseFloat(e);isNaN(n)?f.error('Improper value "'+e+'" supplied for for '+t):(this[i]=n,this.updateStyleEl_())},t.fluid=function(t){if(void 0===t)return!!this.fluid_;var e;this.fluid_=!!t,It(this)&&this.off("playerreset",this.updateStyleEl_),t?(this.addClass("vjs-fluid"),this.fill(!1),It(t=function(){this.on("playerreset",this.updateStyleEl_)})?e():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(e))):this.removeClass("vjs-fluid"),this.updateStyleEl_()},t.fill=function(t){if(void 0===t)return!!this.fill_;this.fill_=!!t,t?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},t.aspectRatio=function(t){if(void 0===t)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(t))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=t,this.fluid(!0),this.updateStyleEl_()},t.updateStyleEl_=function(){var t,e,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],t=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/n:this.videoWidth()||300,e=void 0!==this.height_?this.height_:t*n,i=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(i),bt(this.styleEl_,"\n      ."+i+" {\n        width: "+t+"px;\n        height: "+e+"px;\n      }\n\n      ."+i+".vjs-fluid {\n        padding-top: "+100*n+"%;\n      }\n    ")):(e="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<=e&&(n.width=e),0<=i&&(n.height=i)))},t.loadTech_=function(t,e){var i=this;this.tech_&&this.unloadTech_();var n=Bt(t),r=t.charAt(0).toLowerCase()+t.slice(1);"Html5"!==n&&this.tag&&(Wi.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;var a={source:e,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,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};gi.names.forEach(function(t){t=gi[t];a[t.getterName]=i[t.privateName]}),y(a,this.options_[n]),y(a,this.options_[r]),y(a,this.options_[t.toLowerCase()]),this.tag&&(a.tag=this.tag),e&&e.src===this.cache_.src&&0<this.cache_.currentTime&&(a.startTime=this.cache_.currentTime);t=Wi.getTech(t);if(!t)throw new Error("No Tech named '"+n+"' exists! '"+n+"' should be registered using videojs.registerTech()'");this.tech_=new t(a),this.tech_.ready(Ct(this,this.handleTechReady_),!0),ke(this.textTracksJson_||[],this.tech_),Bn.forEach(function(t){i.on(i.tech_,t,i["handleTech"+Bt(t)+"_"])}),Object.keys(Nn).forEach(function(e){i.on(i.tech_,e,function(t){0===i.tech_.playbackRate()&&i.tech_.seeking()?i.queuedCallbacks_.push({callback:i["handleTech"+Nn[e]+"_"].bind(i),event:t}):i["handleTech"+Nn[e]+"_"](t)})}),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_,"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||O(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},t.unloadTech_=function(){var e=this;gi.names.forEach(function(t){t=gi[t];e[t.privateName]=e[t.getterName]()}),this.textTracksJson_=Se(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},t.tech=function(t){return void 0===t&&f.warn(g(Mn())),this.tech_},t.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"mousedown",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_)},t.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_,"mousedown",this.handleTechClick_),this.off(this.tech_,"dblclick",this.handleTechDoubleClick_)},t.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},t.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())},t.manualAutoplay_=function(e){var i=this;if(this.tech_&&"string"==typeof e){function t(){var e=i.muted();i.muted(!0);var t=i.play();if(t&&t.then&&t.catch)return t.catch(function(t){i.muted(e)})}var n;if("any"===e?(n=this.play())&&n.then&&n.catch&&n.catch(t):n="muted"===e?t():this.play(),n&&n.then&&n.catch)return n.then(function(){i.trigger({type:"autoplay-success",autoplay:e})}).catch(function(t){i.trigger({type:"autoplay-failure",autoplay:e})})}},t.updateSourceCaches_=function(t){void 0===t&&(t="");var e=t,i="";"string"!=typeof e&&(e=t.src,i=t.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],e&&!i&&(i=function(t,e){if(!e)return"";if(t.cache_.source.src===e&&t.cache_.source.type)return t.cache_.source.type;var i=t.cache_.sources.filter(function(t){return t.src===e});if(i.length)return i[0].type;for(var n=t.$$("source"),r=0;r<n.length;r++){var a=n[r];if(a.type&&a.src&&a.src===e)return a.type}return nn(e)}(this,e)),this.cache_.source=Nt({},t,{src:e,type:i});for(var i=this.cache_.sources.filter(function(t){return t.src&&t.src===e}),n=[],r=this.$$("source"),a=[],s=0;s<r.length;s++){var o=R(r[s]);n.push(o),o.src&&o.src===e&&a.push(o.src)}a.length&&!i.length?this.cache_.sources=n:i.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=e},t.handleTechSourceset_=function(t){var e,i,n,r=this;this.changingSrc_||(e=function(t){return r.updateSourceCaches_(t)},i=this.currentSource().src,n=t.src,i&&!/^blob:/.test(i)&&/^blob:/.test(n)&&(this.lastSource_&&(this.lastSource_.tech===n||this.lastSource_.player===i)||(e=function(){})),e(n),t.src||(n=function t(e){"sourceset"!==e.type&&(e=r.techGet("currentSrc"),r.lastSource_.tech=e,r.updateSourceCaches_(e)),r.tech_.off(["sourceset","loadstart"],t)},this.tech_.one(["sourceset","loadstart"],n))),this.lastSource_={player:this.currentSource().src,tech:t.src},this.trigger({src:t.src,type:"sourceset"})},t.hasStarted=function(t){if(void 0===t)return this.hasStarted_;t!==this.hasStarted_&&(this.hasStarted_=t,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},t.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},t.handleTechRateChange_=function(){0<this.tech_.playbackRate()&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(function(t){return t.callback(t.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},t.handleTechWaiting_=function(){var t=this;this.addClass("vjs-waiting"),this.trigger("waiting");function e(){i!==t.currentTime()&&(t.removeClass("vjs-waiting"),t.off("timeupdate",e))}var i=this.currentTime();this.on("timeupdate",e)},t.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},t.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},t.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},t.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},t.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.trigger("seeked")},t.handleTechFirstPlay_=function(){this.options_.starttime&&(f.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")},t.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},t.handleTechEnded_=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},t.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},t.handleTechClick_=function(t){$(t)&&this.controls_&&(this.paused()?be(this.play()):this.pause())},t.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(t){return t.contains(e.target)})||(this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},t.handleTechTap_=function(){this.userActive(!this.userActive())},t.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},t.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},t.handleTechTouchEnd_=function(t){t.preventDefault()},t.handleFullscreenChange_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},t.handleStageClick_=function(){this.reportUserActivity()},t.handleTechFullscreenChange_=function(t,e){e&&this.isFullscreen(e.isFullscreen),this.trigger("fullscreenchange")},t.handleTechError_=function(){var t=this.tech_.error();this.error(t)},t.handleTechTextData_=function(){var t=1<arguments.length?arguments[1]:null;this.trigger("textdata",t)},t.getCache=function(){return this.cache_},t.techCall_=function(n,r){this.ready(function(){if(n in Ji)return t=this.middleware_,e=this.tech_,i=r,e[e=n](t.reduce(tn(e),i));if(n in Zi)return Ki(this.middleware_,this.tech_,n,r);var t,e,i;try{this.tech_&&this.tech_[n](r)}catch(t){throw f(t),t}},!0)},t.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in Qi)return t=this.middleware_,i=this.tech_,n=e,t.reduceRight(tn(n),i[n]());if(e in Zi)return Ki(this.middleware_,this.tech_,e);var t,i,n;try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw f("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t),t;if("TypeError"===t.name)throw f("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t),this.tech_.isReady_=!1,t;throw f(t),t}}},t.play=function(){var e=this,t=this.options_.Promise||d.Promise;return t?new t(function(t){e.play_(t)}):this.play_()},t.play_=function(t){var e=this;void 0===t&&(t=be),this.playOnLoadstart_&&this.off("loadstart",this.playOnLoadstart_),this.isReady_?this.changingSrc_||!this.src()&&!this.currentSrc()?(this.playOnLoadstart_=function(){e.playOnLoadstart_=null,t(e.play())},this.one("loadstart",this.playOnLoadstart_)):t(this.techGet_("play")):this.playWaitingForReady_||(this.playWaitingForReady_=!0,this.ready(function(){e.playWaitingForReady_=!1,t(e.play())}))},t.pause=function(){this.techCall_("pause")},t.paused=function(){return!1!==this.techGet_("paused")},t.played=function(){return this.techGet_("played")||ue(0,0)},t.scrubbing=function(t){if(void 0===t)return this.scrubbing_;this.scrubbing_=!!t,t?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},t.currentTime=function(t){return void 0!==t?(t<0&&(t=0),void this.techCall_("setCurrentTime",t)):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},t.duration=function(t){if(void 0===t)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(t=parseFloat(t))<0&&(t=1/0),t!==this.cache_.duration&&((this.cache_.duration=t)===1/0?(this.addClass("vjs-live"),this.options_.liveui&&this.player_.liveTracker&&this.addClass("vjs-liveui")):(this.removeClass("vjs-live"),this.removeClass("vjs-liveui")),isNaN(t)||this.trigger("durationchange"))},t.remainingTime=function(){return this.duration()-this.currentTime()},t.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},t.buffered=function(){var t=this.techGet_("buffered");return t&&t.length||(t=ue(0,0)),t},t.bufferedPercent=function(){return le(this.buffered(),this.duration())},t.bufferedEnd=function(){var t=this.buffered(),e=this.duration(),t=t.end(t.length-1);return e<t&&(t=e),t},t.volume=function(t){var e;return void 0!==t?(e=Math.max(0,Math.min(1,parseFloat(t))),this.cache_.volume=e,this.techCall_("setVolume",e),void(0<e&&this.lastVolume_(e))):(e=parseFloat(this.techGet_("volume")),isNaN(e)?1:e)},t.muted=function(t){if(void 0===t)return this.techGet_("muted")||!1;this.techCall_("setMuted",t)},t.defaultMuted=function(t){return void 0!==t?this.techCall_("setDefaultMuted",t):this.techGet_("defaultMuted")||!1},t.lastVolume_=function(t){if(void 0===t||0===t)return this.cache_.lastVolume;this.cache_.lastVolume=t},t.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},t.isFullscreen=function(t){if(void 0===t)return!!this.isFullscreen_;this.isFullscreen_=!!t},t.requestFullscreen=function(){var i=he;this.isFullscreen(!0),i.requestFullscreen?(ct(h,i.fullscreenchange,Ct(this,function t(e){this.isFullscreen(h[i.fullscreenElement]),!1===this.isFullscreen()&&ht(h,i.fullscreenchange,t),this.trigger("fullscreenchange")})),this.el_[i.requestFullscreen]()):this.tech_.supportsFullScreen()?this.techCall_("enterFullScreen"):(this.enterFullWindow(),this.trigger("fullscreenchange"))},t.exitFullscreen=function(){var t=he;this.isFullscreen(!1),t.requestFullscreen?h[t.exitFullscreen]():this.tech_.supportsFullScreen()?this.techCall_("exitFullScreen"):(this.exitFullWindow(),this.trigger("fullscreenchange"))},t.enterFullWindow=function(){this.isFullWindow=!0,this.docOrigOverflow=h.documentElement.style.overflow,ct(h,"keydown",Ct(this,this.fullWindowOnEscKey)),h.documentElement.style.overflow="hidden",U(h.body,"vjs-full-window"),this.trigger("enterFullWindow")},t.fullWindowOnEscKey=function(t){27===t.keyCode&&(!0===this.isFullscreen()?this.exitFullscreen():this.exitFullWindow())},t.exitFullWindow=function(){this.isFullWindow=!1,ht(h,"keydown",this.fullWindowOnEscKey),h.documentElement.style.overflow=this.docOrigOverflow,I(h.body,"vjs-full-window"),this.trigger("exitFullWindow")},t.canPlayType=function(t){for(var e,i=0,n=this.options_.techOrder;i<n.length;i++){var r=n[i],a=Wi.getTech(r);if(a=a||jt.getComponent(r)){if(a.isSupported()&&(e=a.canPlayType(t)))return e}else f.error('The "'+r+'" tech is undefined. Skipped browser support check for that tech.')}return""},t.selectSource=function(t){function e(t,i,n){var r;return t.some(function(e){return i.some(function(t){if(r=n(e,t))return!0})}),r}var i,n=this,r=this.options_.techOrder.map(function(t){return[t,Wi.getTech(t)]}).filter(function(t){var e=t[0],t=t[1];return t?t.isSupported():(f.error('The "'+e+'" tech is undefined. Skipped browser support check for that tech.'),!1)}),a=function(t,e){var i=t[0];if(t[1].canPlaySource(e,n.options_[i.toLowerCase()]))return{source:e,tech:i}},a=this.options_.sourceOrder?e(t,r,(i=a,function(t,e){return i(e,t)})):e(r,t,a);return a||!1},t.src=function(t){var n=this;if(void 0===t)return this.cache_.src||"";var r=rn(t);r.length?(this.changingSrc_=!0,this.cache_.sources=r,this.updateSourceCaches_(r[0]),$i(this,r[0],function(t,e){var i;return n.middleware_=e,n.cache_.sources=r,n.updateSourceCaches_(t),n.src_(t)?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()):(e=e,i=n.tech_,void e.forEach(function(t){return t.setTech&&t.setTech(i)}))})):this.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0)},t.src_=function(t){var e,i,n=this,r=this.selectSource([t]);return!r||(e=r.tech,i=this.techName_,Bt(e)!==Bt(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",t):this.techCall_("src",t.src),this.changingSrc_=!1},!0),!1)},t.load=function(){this.techCall_("load")},t.reset=function(){this.tech_&&this.tech_.clearTracks("text"),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),It(this)&&this.trigger("playerreset")},t.currentSources=function(){var t=this.currentSource(),e=[];return 0!==Object.keys(t).length&&e.push(t),this.cache_.sources||e},t.currentSource=function(){return this.cache_.source||{}},t.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},t.currentType=function(){return this.currentSource()&&this.currentSource().type||""},t.preload=function(t){return void 0!==t?(this.techCall_("setPreload",t),void(this.options_.preload=t)):this.techGet_("preload")},t.autoplay=function(t){if(void 0===t)return this.options_.autoplay||!1;var e;"string"==typeof t&&/(any|play|muted)/.test(t)?(this.options_.autoplay=t,this.manualAutoplay_(t),e=!1):this.options_.autoplay=!!t,e=e||this.options_.autoplay,this.tech_&&this.techCall_("setAutoplay",e)},t.playsinline=function(t){return void 0!==t?(this.techCall_("setPlaysinline",t),this.options_.playsinline=t,this):this.techGet_("playsinline")},t.loop=function(t){return void 0!==t?(this.techCall_("setLoop",t),void(this.options_.loop=t)):this.techGet_("loop")},t.poster=function(t){if(void 0===t)return this.poster_;(t=t||"")!==this.poster_&&(this.poster_=t,this.techCall_("setPoster",t),this.isPosterFromTech_=!1,this.trigger("posterchange"))},t.handleTechPosterChange_=function(){var t;this.poster_&&!this.options_.techCanOverridePoster||!this.tech_||!this.tech_.poster||(t=this.tech_.poster()||"")!==this.poster_&&(this.poster_=t,this.isPosterFromTech_=!0,this.trigger("posterchange"))},t.controls=function(t){if(void 0===t)return!!this.controls_;t=!!t,this.controls_!==t&&(this.controls_=t,this.usingNativeControls()&&this.techCall_("setControls",t),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_()))},t.usingNativeControls=function(t){if(void 0===t)return!!this.usingNativeControls_;t=!!t,this.usingNativeControls_!==t&&(this.usingNativeControls_=t,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},t.error=function(t){return void 0===t?this.error_||null:null===t?(this.error_=t,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close())):(this.error_=new ge(t),this.addClass("vjs-error"),f.error("(CODE:"+this.error_.code+" "+ge.errorTypes[this.error_.code]+")",this.error_.message,this.error_),void this.trigger("error"))},t.reportUserActivity=function(t){this.userActivity_=!0},t.userActive=function(t){if(void 0===t)return this.userActive_;if((t=!!t)!==this.userActive_){if(this.userActive_=t,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(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},t.listenForUserActivity_=function(){var e,i,n,r,a=Ct(this,this.reportUserActivity);this.on("mousedown",function(){a(),this.clearInterval(e),e=this.setInterval(a,250)}),this.on("mousemove",function(t){t.screenX===i&&t.screenY===n||(i=t.screenX,n=t.screenY,a())}),this.on("mouseup",function(t){a(),this.clearInterval(e)}),this.on("keydown",a),this.on("keyup",a),this.setInterval(function(){var t;this.userActivity_&&(this.userActivity_=!1,this.userActive(!0),this.clearTimeout(r),(t=this.options_.inactivityTimeout)<=0||(r=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},t)))},250)},t.playbackRate=function(t){if(void 0===t)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",t)},t.defaultPlaybackRate=function(t){return void 0!==t?this.techCall_("setDefaultPlaybackRate",t):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},t.isAudio=function(t){if(void 0===t)return!!this.isAudio_;this.isAudio_=!!t},t.addTextTrack=function(t,e,i){if(this.tech_)return this.tech_.addTextTrack(t,e,i)},t.addRemoteTextTrack=function(t,e){if(this.tech_)return this.tech_.addRemoteTextTrack(t,e)},t.removeRemoteTextTrack=function(t){void 0===t&&(t={});var e=(e=t.track)||t;if(this.tech_)return this.tech_.removeRemoteTextTrack(e)},t.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},t.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},t.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},t.language=function(t){if(void 0===t)return this.language_;this.language_=String(t).toLowerCase()},t.languages=function(){return Nt(o.prototype.options_.languages,this.languages_)},t.toJSON=function(){var t=Nt(this.options_),e=t.tracks;t.tracks=[];for(var i=0;i<e.length;i++){var n=e[i];(n=Nt(n)).player=void 0,t.tracks[i]=n}return t},t.createModal=function(t,e){var i=this;(e=e||{}).content=t||"";var n=new Ce(this,e);return this.addChild(n),n.on("dispose",function(){i.removeChild(n)}),n.open(),n},t.updateCurrentBreakpoint_=function(){if(this.responsive())for(var t=this.currentBreakpoint(),e=this.currentWidth(),i=0;i<jn.length;i++){var n=jn[i];if(e<=this.breakpoints_[n]){if(t===n)return;t&&this.removeClass(Fn[t]),this.addClass(Fn[n]),this.breakpoint_=n;break}}},t.removeCurrentBreakpoint_=function(){var t=this.currentBreakpointClass();this.breakpoint_="",t&&this.removeClass(t)},t.breakpoints=function(t){return void 0===t||(this.breakpoint_="",this.breakpoints_=y({},Vn,t),this.updateCurrentBreakpoint_()),y(this.breakpoints_)},t.responsive=function(t){return void 0===t?this.responsive_:(t=Boolean(t))!==this.responsive_?((this.responsive_=t)?(this.on("playerresize",this.updateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.updateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),t):void 0},t.currentBreakpoint=function(){return this.breakpoint_},t.currentBreakpointClass=function(){return Fn[this.breakpoint_]||""},o.getTagSettings=function(t){var e,i={sources:[],tracks:[]},n=R(t),r=n["data-setup"];if(P(t,"vjs-fill")&&(n.fill=!0),P(t,"vjs-fluid")&&(n.fluid=!0),null!==r&&(r=(e=ve(r||"{}"))[0],e=e[1],r&&f.error(r),y(n,e)),y(i,n),t.hasChildNodes())for(var a=t.childNodes,s=0,o=a.length;s<o;s++){var u=a[s],l=u.nodeName.toLowerCase();"source"===l?i.sources.push(R(u)):"track"===l&&i.tracks.push(R(u))}return i},t.flexNotSupported_=function(){var t=h.createElement("i");return!("flexBasis"in t.style||"webkitFlexBasis"in t.style||"mozFlexBasis"in t.style||"msFlexBasis"in t.style||"msFlexOrder"in t.style)},o}(jt);gi.names.forEach(function(t){var e=gi[t];Hn.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}}),Hn.players={};Vt=d.navigator;Hn.prototype.options_={techOrder:Wi.defaultTechOrder_,html5:{},flash:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Vt&&(Vt.languages&&Vt.languages[0]||Vt.userLanguage||Vt.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",breakpoints:{},responsive:!1},["ended","seeking","seekable","networkState","readyState"].forEach(function(t){Hn.prototype[t]=function(){return this.techGet_(t)}}),Bn.forEach(function(t){Hn.prototype["handleTech"+Bt(t)+"_"]=function(){return this.trigger(t)}}),jt.registerComponent("Player",Hn);function qn(t){return Kn.hasOwnProperty(t)}function zn(t){return qn(t)?Kn[t]:void 0}function Wn(t,e,i){i=(i?"before":"")+"pluginsetup",t.trigger(i,e),t.trigger(i+":"+e.name,e)}function Gn(e,i){function n(){Wn(this,{name:e,plugin:i,instance:null},!0);var t=i.apply(this,arguments);return Qn(this,e),Wn(this,{name:e,plugin:i,instance:t}),t}return Object.keys(i).forEach(function(t){n[t]=i[t]}),n}function Xn(r,a){return a.prototype.name=r,function(){Wn(this,{name:r,plugin:a,instance:null},!0);for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];var n=s(a,[this].concat(e));return this[r]=function(){return n},Wn(this,n.getEventHash()),n}}var Yn="plugin",$n="activePlugins_",Kn={},Qn=function(t,e){t[$n]=t[$n]||{},t[$n][e]=!0},Jn=function(){function i(t){if(this.constructor===i)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=t,Dt(this),delete this.trigger,Mt(this,this.constructor.defaultState),Qn(t,this.name),this.dispose=Ct(this,this.dispose),t.on("dispose",this.dispose)}var t=i.prototype;return t.version=function(){return this.constructor.VERSION},t.getEventHash=function(t){return void 0===t&&(t={}),t.name=this.name,t.plugin=this.constructor,t.instance=this,t},t.trigger=function(t,e){return void 0===e&&(e={}),dt(this.eventBusEl_,t,this.getEventHash(e))},t.handleStateChanged=function(t){},t.dispose=function(){var t=this.name,e=this.player;this.trigger("dispose"),this.off(),e.off("dispose",this.dispose),e[$n][t]=!1,this.player=this.state=null,e[t]=Xn(t,Kn[t])},i.isBasic=function(t){t="string"==typeof t?zn(t):t;return"function"==typeof t&&!i.prototype.isPrototypeOf(t.prototype)},i.registerPlugin=function(t,e){if("string"!=typeof t)throw new Error('Illegal plugin name, "'+t+'", must be a string, was '+typeof t+".");if(qn(t))f.warn('A plugin named "'+t+'" already exists. You may want to avoid re-registering plugins!');else if(Hn.prototype.hasOwnProperty(t))throw new Error('Illegal plugin name, "'+t+'", cannot share a name with an existing player method!');if("function"!=typeof e)throw new Error('Illegal plugin for "'+t+'", must be a function, was '+typeof e+".");return Kn[t]=e,t!==Yn&&(i.isBasic(e)?Hn.prototype[t]=Gn(t,e):Hn.prototype[t]=Xn(t,e)),e},i.deregisterPlugin=function(t){if(t===Yn)throw new Error("Cannot de-register base plugin.");qn(t)&&(delete Kn[t],delete Hn.prototype[t])},i.getPlugins=function(t){var i;return void 0===t&&(t=Object.keys(Kn)),t.forEach(function(t){var e=zn(t);e&&((i=i||{})[t]=e)}),i},i.getPluginVersion=function(t){t=zn(t);return t&&t.VERSION||""},i}();Jn.getPlugin=zn,Jn.BASE_PLUGIN_NAME=Yn,Jn.registerPlugin(Yn,Jn),Hn.prototype.usingPlugin=function(t){return!!this[$n]&&!0===this[$n][t]},Hn.prototype.hasPlugin=function(t){return!!qn(t)};var Zn=function(t){return 0===t.indexOf("#")?t.slice(1):t};function tr(t,e,i){if(r=tr.getPlayer(t))return e&&f.warn('Player "'+t+'" is already initialised. Options will not be applied.'),i&&r.ready(i),r;var n="string"==typeof t?K("#"+Zn(t)):t;if(!w(n))throw new TypeError("The element or ID supplied is not valid. (videojs)");h.body.contains(n)||f.warn("The element supplied is not included in the DOM"),e=e||{},tr.hooks("beforesetup").forEach(function(t){t=t(n,Nt(e));v(t)&&!Array.isArray(t)?e=Nt(e,t):f.error("please return an object in beforesetup hooks")});var r=new(jt.getComponent("Player"))(n,e,i);return tr.hooks("setup").forEach(function(t){return t(r)}),r}tr.hooks_={},tr.hooks=function(t,e){return tr.hooks_[t]=tr.hooks_[t]||[],e&&(tr.hooks_[t]=tr.hooks_[t].concat(e)),tr.hooks_[t]},tr.hook=function(t,e){tr.hooks(t,e)},tr.hookOnce=function(i,t){tr.hooks(i,[].concat(t).map(function(e){return function t(){return tr.removeHook(i,t),e.apply(void 0,arguments)}}))},tr.removeHook=function(t,e){e=tr.hooks(t).indexOf(e);return!(e<=-1)&&(tr.hooks_[t]=tr.hooks_[t].slice(),tr.hooks_[t].splice(e,1),!0)},!0!==d.VIDEOJS_NO_DYNAMIC_STYLE&&k()&&((Xa=K(".vjs-styles-defaults"))||(Xa=_t("vjs-styles-defaults"),(Ga=K("head"))&&Ga.insertBefore(Xa,Ga.firstChild),bt(Xa,"\n      .video-js {\n        width: 300px;\n        height: 150px;\n      }\n\n      .vjs-fluid {\n        padding-top: 56.25%\n      }\n    "))),vt(1,tr),tr.VERSION=u,tr.options=Hn.prototype.options_,tr.getPlayers=function(){return Hn.players},tr.getPlayer=function(t){var e=Hn.players;if("string"==typeof t){var i=Zn(t),n=e[i];if(n)return n;i=K("#"+i)}else i=t;if(w(i)){t=i.player,i=i.playerId;if(t||e[i])return t||e[i]}},tr.getAllPlayers=function(){return Object.keys(Hn.players).map(function(t){return Hn.players[t]}).filter(Boolean)},tr.players=Hn.players,tr.getComponent=jt.getComponent,tr.registerComponent=function(t,e){Wi.isTech(e)&&f.warn("The "+t+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),jt.registerComponent.call(jt,t,e)},tr.getTech=Wi.getTech,tr.registerTech=Wi.registerTech,tr.use=function(t,e){Gi[t]=Gi[t]||[],Gi[t].push(e)},Object.defineProperty(tr,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(tr.middleware,"TERMINATOR",{value:Yi,writeable:!1,enumerable:!0}),tr.browser=ae,tr.TOUCH_ENABLED=re,tr.extend=function(t,e){void 0===e&&(e={});var i,n=function(){t.apply(this,arguments)},r={};for(i in"object"==typeof e?(e.constructor!==Object.prototype.constructor&&(n=e.constructor),r=e):"function"==typeof e&&(n=e),function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.super_=e)}(n,t),r)r.hasOwnProperty(i)&&(n.prototype[i]=r[i]);return n},tr.mergeOptions=Nt,tr.bind=Ct,tr.registerPlugin=Jn.registerPlugin,tr.deregisterPlugin=Jn.deregisterPlugin,tr.plugin=function(t,e){return f.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Jn.registerPlugin(t,e)},tr.getPlugins=Jn.getPlugins,tr.getPlugin=Jn.getPlugin,tr.getPluginVersion=Jn.getPluginVersion,tr.addLanguage=function(t,e){var i;return t=(""+t).toLowerCase(),tr.options.languages=Nt(tr.options.languages,((i={})[t]=e,i)),tr.options.languages[t]},tr.log=f,tr.createLogger=m,tr.createTimeRange=tr.createTimeRanges=ue,tr.formatTime=fn,tr.setFormatTime=function(t){pn=t},tr.resetFormatTime=function(){pn=dn},tr.parseUrl=Pe,tr.isCrossOrigin=xe,tr.EventTarget=kt,tr.on=ct,tr.one=pt,tr.off=ht,tr.trigger=dt,tr.xhr=si,tr.TextTrack=hi,tr.AudioTrack=Ht,tr.VideoTrack=di,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(t){tr[t]=function(){return f.warn("videojs."+t+"() is deprecated; use videojs.dom."+t+"() instead"),J[t].apply(null,arguments)}}),tr.computedStyle=n,tr.dom=J,tr.url=qe;var er=Ge(function(t,e){var i,a,n,r,s;i=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,a=/^([^\/?#]*)(.*)$/,n=/(?:\/|^)\.(?=\/)/g,r=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,s={buildAbsoluteURL:function(t,e,i){if(i=i||{},t=t.trim(),!(e=e.trim())){if(!i.alwaysNormalize)return t;var n=s.parseURL(t);if(!n)throw new Error("Error trying to parse base URL.");return n.path=s.normalizePath(n.path),s.buildURLFromParts(n)}n=s.parseURL(e);if(!n)throw new Error("Error trying to parse relative URL.");if(n.scheme)return i.alwaysNormalize?(n.path=s.normalizePath(n.path),s.buildURLFromParts(n)):e;e=s.parseURL(t);if(!e)throw new Error("Error trying to parse base URL.");!e.netLoc&&e.path&&"/"!==e.path[0]&&(r=a.exec(e.path),e.netLoc=r[1],e.path=r[2]),e.netLoc&&!e.path&&(e.path="/");var r,t={scheme:e.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};return n.netLoc||(t.netLoc=e.netLoc,"/"!==n.path[0]&&(n.path?(r=(r=e.path).substring(0,r.lastIndexOf("/")+1)+n.path,t.path=s.normalizePath(r)):(t.path=e.path,n.params||(t.params=e.params,n.query||(t.query=e.query))))),null===t.path&&(t.path=i.alwaysNormalize?s.normalizePath(n.path):n.path),s.buildURLFromParts(t)},parseURL:function(t){t=i.exec(t);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(t){for(t=t.split("").reverse().join("").replace(n,"");t.length!==(t=t.replace(r,"")).length;);return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}},t.exports=s}),ir=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},nr=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i,n=arguments[e];for(i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},rr=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},ar=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},Vt=(sr.prototype.on=function(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e)},sr.prototype.off=function(t,e){if(!this.listeners[t])return!1;e=this.listeners[t].indexOf(e);return this.listeners[t].splice(e,1),-1<e},sr.prototype.trigger=function(t){var e,i=this.listeners[t],n=void 0,r=void 0;if(i)if(2===arguments.length)for(r=i.length,n=0;n<r;++n)i[n].call(this,arguments[1]);else for(e=Array.prototype.slice.call(arguments,1),r=i.length,n=0;n<r;++n)i[n].apply(this,e)},sr.prototype.dispose=function(){this.listeners={}},sr.prototype.pipe=function(e){this.on("data",function(t){e.push(t)})},sr);function sr(){ir(this,sr),this.listeners={}}var or,ur=(rr(lr,or=Vt),lr.prototype.push=function(t){var e=void 0;for(this.buffer+=t,e=this.buffer.indexOf("\n");-1<e;e=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,e)),this.buffer=this.buffer.substring(e+1)},lr);function lr(){ir(this,lr);var t=ar(this,or.call(this));return t.buffer="",t}function cr(t){for(var e=t.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),i={},n=e.length,r=void 0;n--;)""!==e[n]&&((r=/([^=]*)=(.*)/.exec(e[n]).slice(1))[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),i[r[0]]=r[1]);return i}var hr,dr=(rr(pr,hr=Vt),pr.prototype.push=function(t){var e=void 0,i=void 0;if(0!==(t=t.replace(/^[\u0000\s]+|[\u0000\s]+$/g,"")).length)if("#"===t[0]){for(var n=0;n<this.customParsers.length;n++)if(this.customParsers[n].call(this,t))return;if(0===t.indexOf("#EXT"))if(t=t.replace("\r",""),e=/^#EXTM3U/.exec(t))this.trigger("data",{type:"tag",tagType:"m3u"});else{if(e=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(t))return i={type:"tag",tagType:"inf"},e[1]&&(i.duration=parseFloat(e[1])),e[2]&&(i.title=e[2]),void this.trigger("data",i);if(e=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(t))return i={type:"tag",tagType:"targetduration"},e[1]&&(i.duration=parseInt(e[1],10)),void this.trigger("data",i);if(e=/^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(t))return i={type:"tag",tagType:"totalduration"},e[1]&&(i.duration=parseInt(e[1],10)),void this.trigger("data",i);if(e=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(t))return i={type:"tag",tagType:"version"},e[1]&&(i.version=parseInt(e[1],10)),void this.trigger("data",i);if(e=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(t))return i={type:"tag",tagType:"media-sequence"},e[1]&&(i.number=parseInt(e[1],10)),void this.trigger("data",i);if(e=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(t))return i={type:"tag",tagType:"discontinuity-sequence"},e[1]&&(i.number=parseInt(e[1],10)),void this.trigger("data",i);if(e=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(t))return i={type:"tag",tagType:"playlist-type"},e[1]&&(i.playlistType=e[1]),void this.trigger("data",i);if(e=/^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(t))return i={type:"tag",tagType:"byterange"},e[1]&&(i.length=parseInt(e[1],10)),e[2]&&(i.offset=parseInt(e[2],10)),void this.trigger("data",i);if(e=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(t))return i={type:"tag",tagType:"allow-cache"},e[1]&&(i.allowed=!/NO/.test(e[1])),void this.trigger("data",i);if(e=/^#EXT-X-MAP:?(.*)$/.exec(t)){var r,i={type:"tag",tagType:"map"};return e[1]&&((r=cr(e[1])).URI&&(i.uri=r.URI),r.BYTERANGE&&(s=(a=r.BYTERANGE.split("@"))[0],a=a[1],i.byterange={},s&&(i.byterange.length=parseInt(s,10)),a&&(i.byterange.offset=parseInt(a,10)))),void this.trigger("data",i)}var a,s,e=/^#EXT-X-STREAM-INF:?(.*)$/.exec(t);if(e)return i={type:"tag",tagType:"stream-inf"},e[1]&&(i.attributes=cr(e[1]),i.attributes.RESOLUTION&&(s={},(a=i.attributes.RESOLUTION.split("x"))[0]&&(s.width=parseInt(a[0],10)),a[1]&&(s.height=parseInt(a[1],10)),i.attributes.RESOLUTION=s),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))),void this.trigger("data",i);if(e=/^#EXT-X-MEDIA:?(.*)$/.exec(t))return i={type:"tag",tagType:"media"},e[1]&&(i.attributes=cr(e[1])),void this.trigger("data",i);if(e=/^#EXT-X-ENDLIST/.exec(t))this.trigger("data",{type:"tag",tagType:"endlist"});else{if(!(e=/^#EXT-X-DISCONTINUITY/.exec(t)))return(e=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(t))?(i={type:"tag",tagType:"program-date-time"},e[1]&&(i.dateTimeString=e[1],i.dateTimeObject=new Date(e[1])),void this.trigger("data",i)):(e=/^#EXT-X-KEY:?(.*)$/.exec(t))?(i={type:"tag",tagType:"key"},e[1]&&(i.attributes=cr(e[1]),i.attributes.IV&&("0x"===i.attributes.IV.substring(0,2).toLowerCase()&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),void this.trigger("data",i)):(e=/^#EXT-X-START:?(.*)$/.exec(t))?(i={type:"tag",tagType:"start"},e[1]&&(i.attributes=cr(e[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),void this.trigger("data",i)):(e=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(t))?(i={type:"tag",tagType:"cue-out-cont"},e[1]?i.data=e[1]:i.data="",void this.trigger("data",i)):(e=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(t))?(i={type:"tag",tagType:"cue-out"},e[1]?i.data=e[1]:i.data="",void this.trigger("data",i)):(e=/^#EXT-X-CUE-IN:?(.*)?$/.exec(t))?(i={type:"tag",tagType:"cue-in"},e[1]?i.data=e[1]:i.data="",void this.trigger("data",i)):void this.trigger("data",{type:"tag",data:t.slice(4)});this.trigger("data",{type:"tag",tagType:"discontinuity"})}}else this.trigger("data",{type:"comment",text:t.slice(1)})}else this.trigger("data",{type:"uri",uri:t})},pr.prototype.addParser=function(t){var e=this,i=t.expression,n=t.customType,r=t.dataParser,a=t.segment;"function"!=typeof r&&(r=function(t){return t}),this.customParsers.push(function(t){if(i.exec(t))return e.trigger("data",{type:"custom",data:r(t),customType:n,segment:a}),!0})},pr);function pr(){ir(this,pr);var t=ar(this,hr.call(this));return t.customParsers=[],t}var fr,mr=(rr(gr,fr=Vt),gr.prototype.push=function(t){this.lineStream.push(t)},gr.prototype.end=function(){this.lineStream.push("\n")},gr.prototype.addParser=function(t){this.parseStream.addParser(t)},gr);function gr(){ir(this,gr);var t=ar(this,fr.call(this));t.lineStream=new ur,t.parseStream=new dr,t.lineStream.pipe(t.parseStream);var r=t,a=[],s={},o=void 0,u=void 0,l={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},c=0;return t.manifest={allowCache:!0,discontinuityStarts:[],segments:[]},t.parseStream.on("data",function(e){var i=void 0,n=void 0;({tag:function(){({"allow-cache":function(){this.manifest.allowCache=e.allowed,"allowed"in e||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var t={};"length"in e&&((s.byterange=t).length=e.length,"offset"in e||(this.trigger("info",{message:"defaulting offset to zero"}),e.offset=0)),"offset"in e&&((s.byterange=t).offset=e.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<e.duration&&(s.duration=e.duration),0===e.duration&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=a},key:function(){e.attributes?"NONE"!==e.attributes.METHOD?e.attributes.URI?(e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),u={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(u.iv=e.attributes.IV)):this.trigger("warn",{message:"ignoring key declaration without URI"}):u=null:this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(e.number)?this.manifest.mediaSequence=e.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number})},"discontinuity-sequence":function(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,c=e.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number})},"playlist-type":function(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist})},map:function(){o={},e.uri&&(o.uri=e.uri),e.byterange&&(o.byterange=e.byterange)},"stream-inf":function(){this.manifest.playlists=a,this.manifest.mediaGroups=this.manifest.mediaGroups||l,e.attributes?(s.attributes||(s.attributes={}),nr(s.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){var t;this.manifest.mediaGroups=this.manifest.mediaGroups||l,e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME?((t=this.manifest.mediaGroups[e.attributes.TYPE])[e.attributes["GROUP-ID"]]=t[e.attributes["GROUP-ID"]]||{},i=t[e.attributes["GROUP-ID"]],(n={default:/yes/i.test(e.attributes.DEFAULT)}).default?n.autoselect=!0:n.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(n.language=e.attributes.LANGUAGE),e.attributes.URI&&(n.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(n.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(n.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(n.forced=/yes/i.test(e.attributes.FORCED)),i[e.attributes.NAME]=n):this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){c+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(a.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),s.dateTimeString=e.dateTimeString,s.dateTimeObject=e.dateTimeObject},targetduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):this.manifest.targetDuration=e.duration},totalduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid total duration: "+e.duration}):this.manifest.totalDuration=e.duration},start:function(){e.attributes&&!isNaN(e.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){s.cueOut=e.data},"cue-out-cont":function(){s.cueOutCont=e.data},"cue-in":function(){s.cueIn=e.data}}[e.tagType]||function(){}).call(r)},uri:function(){s.uri=e.uri,a.push(s),!this.manifest.targetDuration||"duration"in s||(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),s.duration=this.manifest.targetDuration),u&&(s.key=u),s.timeline=c,o&&(s.map=o),s={}},comment:function(){},custom:function(){e.segment?(s.custom=s.custom||{},s.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(r)}),t}function yr(t){return!!t&&"object"==typeof t}function vr(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return e.reduce(function(e,i){return Object.keys(i).forEach(function(t){Array.isArray(e[t])&&Array.isArray(i[t])?e[t]=e[t].concat(i[t]):yr(e[t])&&yr(i[t])?e[t]=vr(e[t],i[t]):e[t]=i[t]}),e},{})}function _r(t){return t.reduce(function(t,e){return t.concat(e)},[])}function br(t){if(!t.length)return[];for(var e=[],i=0;i<t.length;i++)e.push(t[i]);return e}function Tr(t){var e;return(e=t.reduce(function(t,e){var i,n=e.attributes.id+(e.attributes.lang||"");return t[n]?(e.segments[0].discontinuity=!0,(i=t[n].segments).push.apply(i,e.segments),e.attributes.contentProtection&&(t[n].attributes.contentProtection=e.attributes.contentProtection)):t[n]=e,t},{}),Object.keys(e).map(function(t){return e[t]})).map(function(t){var e,n;return t.discontinuityStarts=(e=t.segments,n="discontinuity",e.reduce(function(t,e,i){return e[n]&&t.push(i),t},[])),t})}function Sr(t){return t.reduce(function(t,e){var i=e.attributes.role&&e.attributes.role.value||"main",n=e.attributes.lang||"",r="main";return n&&(r=e.attributes.lang+" ("+i+")"),t[r]&&t[r].playlists[0].attributes.BANDWIDTH>e.attributes.bandwidth||(t[r]={language:n,autoselect:!0,default:"main"===i,playlists:[(i=(n=e).attributes,e=n.segments,e={attributes:((n={NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs})["PROGRAM-ID"]=1,n),uri:"",endList:"static"===(i.type||"static"),timeline:i.periodIndex,resolvedUri:"",targetDuration:i.duration,segments:e,mediaSequence:e.length?e[0].number:1},i.contentProtection&&(e.contentProtection=i.contentProtection),e)],uri:""}),t},{})}function kr(t){return t.reduce(function(t,e){var i,n=e.attributes.lang||"text";return t[n]||(t[n]={language:n,default:!1,autoselect:!1,playlists:[(n=(i=e).attributes,void 0===(e=i.segments)&&(e=[{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:e,mediaSequence:e.length?e[0].number:1})],uri:""}),t},{})}function wr(t){var e=t.attributes,i=t.segments,i={attributes:((t={NAME:e.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth})["PROGRAM-ID"]=1,t),uri:"",endList:"static"===(e.type||"static"),timeline:e.periodIndex,resolvedUri:"",targetDuration:e.duration,segments:i,mediaSequence:i.length?i[0].number:1};return e.contentProtection&&(i.contentProtection=e.contentProtection),i}function Cr(t,e){return/^[a-z]+:/i.test(e)?e:(/\/\//i.test(t)||(t=jr.buildAbsoluteURL(d.location.href,t)),jr.buildAbsoluteURL(t,e))}function Er(t){var e=void 0===(i=t.baseUrl)?"":i,i=void 0===(i=t.source)?"":i,t=void 0===(t=t.range)?"":t,e={uri:i,resolvedUri:Cr(e||"",i)};return t&&(i=t.split("-"),t=parseInt(i[0],10),i=parseInt(i[1],10),e.byterange={length:i-t,offset:t}),e}function Ar(t,e){for(var i,n,r,a,s,o,u=t.type,l=void 0===u?"static":u,c=void 0===(u=t.minimumUpdatePeriod)?0:u,h=void 0===(u=t.media)?"":u,d=t.sourceDuration,p=void 0===(u=t.timescale)?1:u,f=void 0===(u=t.startNumber)?1:u,m=t.periodIndex,g=[],y=-1,v=0;v<e.length;v++){var _=e[v],b=_.d,T=_.r||0,S=_.t||0;y<0&&(y=S),S&&y<S&&(y=S);var k,w=void 0;w=T<0?(k=v+1)===e.length?"dynamic"===l&&0<c&&0<h.indexOf("$Number$")?(i=y,n=b,o=o=o=_=o=s=a=r=void 0,r=(S=t).NOW,a=S.clientOffset,s=S.availabilityStartTime,o=S.timescale,_=void 0===o?1:o,o=void 0===(o=S.start)?0:o,S=S.minimumUpdatePeriod,o=(r+a)/1e3+(void 0===S?0:S)-(s+o),Math.ceil((o*_-i)/n)):(d*p-y)/b:(e[k].t-y)/b:T+1;for(var C=f+g.length+w,E=f+g.length;E<C;)g.push({number:E,duration:b/p,time:y,timeline:m}),y+=b,E++}return g}function Lr(t){var s,e=void 0===(a=t.type)?"static":a,i=t.duration,n=t.timescale,r=void 0===n?1:n,a=t.sourceDuration,t=function(t,e){for(var i=[],n=t;n<e;n++)i.push(n);return i}((n=Fr[e](t)).start,n.end).map((s=t,function(t,e){var i=s.duration,n=s.timescale,r=void 0===n?1:n,a=s.periodIndex,n=s.startNumber;return{number:(void 0===n?1:n)+t,duration:i/r,timeline:a,time:e*i}}));return"static"===e&&(t[e=t.length-1].duration=a-i/r*e),t}function Or(t,e){return t.replace(Vr,(r=e,function(t,e,i,n){if("$$"===t)return"$";if(void 0===r[e])return t;t=""+r[e];return"RepresentationID"===e||(n=i?parseInt(n,10):1)<=t.length?t:new Array(n-t.length+1).join("0")+t}));var r}function Pr(i,t){var n={RepresentationID:i.id,Bandwidth:i.bandwidth||0},e=void 0===(e=i.initialization)?{sourceURL:"",range:""}:e,r=Er({baseUrl:i.baseUrl,source:Or(e.sourceURL,n),range:e.range});return(e=t,(t=i).duration||e?t.duration?Lr(t):Ar(t,e):[{number:t.startNumber||1,duration:t.sourceDuration,time:0,timeline:t.periodIndex}]).map(function(t){n.Number=t.number,n.Time=t.time;var e=Or(i.media||"",n);return{uri:e,timeline:t.timeline,duration:t.duration,resolvedUri:Cr(i.baseUrl||"",e),map:r,number:t.number}})}function Ur(n,t){var e=n.duration,i=void 0===(i=n.segmentUrls)?[]:i;if(!e&&!t||e&&t)throw new Error(Gr);var r,a=i.map(function(t){return i=t,t=(e=n).baseUrl,e=e.initialization,e=Er({baseUrl:t,source:(e=void 0===e?{}:e).sourceURL,range:e.range}),(i=Er({baseUrl:t,source:i.media,range:i.mediaRange})).map=e,i;var e,i});return e&&(r=Lr(n)),t&&(r=Ar(n,t)),r.map(function(t,e){if(a[e]){e=a[e];return e.timeline=t.timeline,e.duration=t.duration,e.number=t.number,e}}).filter(function(t){return t})}function Ir(t){var e=t.baseUrl,i=void 0===(s=t.initialization)?{}:s,n=t.sourceDuration,r=void 0===(a=t.timescale)?1:a,a=void 0===(s=t.indexRange)?"":s,s=t.duration;if(!e)throw new Error(Wr);return i=Er({baseUrl:e,source:i.sourceURL,range:i.range}),(a=Er({baseUrl:e,source:e,range:a})).map=i,s?(t=Lr(t)).length&&(a.duration=t[0].duration,a.timeline=t[0].timeline):n&&(a.duration=n/r,a.timeline=0),a.number=0,[a]}function xr(t){var e,i=t.attributes;if((t=t.segmentInfo).template?(n=Pr,e=vr(i,t.template)):t.base?(n=Ir,e=vr(i,t.base)):t.list&&(n=Ur,e=vr(i,t.list)),!n)return{attributes:i};var n,i=n(e,t.timeline);return e.duration?(n=e.duration,t=void 0===(t=e.timescale)?1:t,e.duration=n/t):i.length?e.duration=i.reduce(function(t,e){return Math.max(t,Math.ceil(e.duration))},0):e.duration=0,{attributes:e,segments:i}}function Dr(t,e){return br(t.childNodes).filter(function(t){return t.tagName===e})}function Rr(t){return t.textContent.trim()}function Mr(t){if(!(r=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(t)))return 0;var e=(a=r.slice(1))[0],i=a[1],n=a[2],t=a[3],r=a[4],a=a[5];return 31536e3*parseFloat(e||0)+2592e3*parseFloat(i||0)+86400*parseFloat(n||0)+3600*parseFloat(t||0)+60*parseFloat(r||0)+parseFloat(a||0)}function Br(t){return t&&t.attributes?br(t.attributes).reduce(function(t,e){var i=Yr[e.name]||Yr.DEFAULT;return t[e.name]=i(e.value),t},{}):{}}var Nr,jr=(function(t){var e,a,i,n,s;e=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,a=/^([^\/?#]*)(.*)$/,i=/(?:\/|^)\.(?=\/)/g,n=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,s={buildAbsoluteURL:function(t,e,i){if(i=i||{},t=t.trim(),!(e=e.trim())){if(!i.alwaysNormalize)return t;var n=s.parseURL(t);if(!n)throw new Error("Error trying to parse base URL.");return n.path=s.normalizePath(n.path),s.buildURLFromParts(n)}n=s.parseURL(e);if(!n)throw new Error("Error trying to parse relative URL.");if(n.scheme)return i.alwaysNormalize?(n.path=s.normalizePath(n.path),s.buildURLFromParts(n)):e;e=s.parseURL(t);if(!e)throw new Error("Error trying to parse base URL.");!e.netLoc&&e.path&&"/"!==e.path[0]&&(r=a.exec(e.path),e.netLoc=r[1],e.path=r[2]),e.netLoc&&!e.path&&(e.path="/");var r,t={scheme:e.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};return n.netLoc||(t.netLoc=e.netLoc,"/"!==n.path[0]&&(n.path?(r=(r=e.path).substring(0,r.lastIndexOf("/")+1)+n.path,t.path=s.normalizePath(r)):(t.path=e.path,n.params||(t.params=e.params,n.query||(t.query=e.query))))),null===t.path&&(t.path=i.alwaysNormalize?s.normalizePath(n.path):n.path),s.buildURLFromParts(t)},parseURL:function(t){t=e.exec(t);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(t){for(t=t.split("").reverse().join("").replace(i,"");t.length!==(t=t.replace(n,"")).length;);return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}},t.exports=s}(Nr={exports:{}}),Nr.exports),Fr={static:function(t){var e=t.duration,i=t.timescale,i=void 0===i?1:i,t=t.sourceDuration;return{start:0,end:Math.ceil(t/(e/i))}},dynamic:function(t){var e=t.NOW,i=t.clientOffset,n=t.availabilityStartTime,r=t.timescale,a=void 0===r?1:r,s=t.duration,o=t.start,r=void 0===o?0:o,o=t.minimumUpdatePeriod,o=void 0===o?0:o,t=t.timeShiftBufferDepth,t=void 0===t?1/0:t,i=(e+i)/1e3,r=n+r,o=i+o-r,o=Math.ceil(o*a/s),t=Math.floor((i-r-t)*a/s),s=Math.floor((i-r)*a/s);return{start:Math.max(0,t),end:Math.min(o,s)}}},Vr=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,Hr="INVALID_NUMBER_OF_PERIOD",qr="DASH_EMPTY_MANIFEST",zr="DASH_INVALID_XML",Wr="NO_BASE_URL",Gr="SEGMENT_TIME_UNSPECIFIED",Xr="UNSUPPORTED_UTC_TIMING_SCHEME",Yr={mediaPresentationDuration:Mr,availabilityStartTime:function(t){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=t)&&(t+="Z"),Date.parse(t)/1e3},minimumUpdatePeriod:Mr,timeShiftBufferDepth:Mr,start:Mr,width:function(t){return parseInt(t,10)},height:function(t){return parseInt(t,10)},bandwidth:function(t){return parseInt(t,10)},startNumber:function(t){return parseInt(t,10)},timescale:function(t){return parseInt(t,10)},duration:function(t){var e=parseInt(t,10);return isNaN(e)?Mr(t):e},d:function(t){return parseInt(t,10)},t:function(t){return parseInt(t,10)},r:function(t){return parseInt(t,10)},DEFAULT:function(t){return t}};function $r(t,i){return i.length?_r(t.map(function(e){return i.map(function(t){return Cr(e,Rr(t))})})):t}function Kr(t){var e=Dr(t,"SegmentTemplate")[0],i=Dr(t,"SegmentList")[0],n=i&&Dr(i,"SegmentURL").map(function(t){return vr({tag:"SegmentURL"},Br(t))}),r=Dr(t,"SegmentBase")[0],t=(a=i||e)&&Dr(a,"SegmentTimeline")[0],a=(a=i||r||e)&&Dr(a,"Initialization")[0];(e=e&&Br(e))&&a?e.initialization=a&&Br(a):e&&e.initialization&&(e.initialization={sourceURL:e.initialization});var s={template:e,timeline:t&&Dr(t,"S").map(Br),list:i&&vr(Br(i),{segmentUrls:n,initialization:Br(a)}),base:r&&vr(Br(r),{initialization:Br(a)})};return Object.keys(s).forEach(function(t){s[t]||delete s[t]}),s}function Qr(t){return t.reduce(function(t,e){var i=Br(e),n=Ha[i.schemeIdUri];return n&&(t[n]={attributes:i},(e=Dr(e,"cenc:pssh")[0])&&(e=(e=Rr(e))&&function(t){for(var e=d.atob(t),i=new Uint8Array(e.length),n=0;n<e.length;n++)i[n]=e.charCodeAt(n);return i}(e),t[n].pssh=e)),t},{})}function Jr(o,u,l){return function(t){var e=Br(t),i=$r(u,Dr(t,"BaseURL")),n=Dr(t,"Role")[0],n={role:Br(n)},e=vr(o,e,n),n=Qr(Dr(t,"ContentProtection"));Object.keys(n).length&&(e=vr(e,{contentProtection:n}));var r,a,s,n=Kr(t),t=Dr(t,"Representation"),n=vr(l,n);return _r(t.map((r=e,a=i,s=n,function(t){var e=Dr(t,"BaseURL"),e=$r(a,e),i=vr(r,Br(t)),n=Kr(t);return e.map(function(t){return{segmentInfo:vr(s,n),attributes:vr(i,{baseUrl:t})}})})))}}function Zr(t,e){void 0===e&&(e={});var i=e,n=void 0===(o=i.manifestUri)?"":o,e=void 0===(r=i.NOW)?Date.now():r,r=void 0===(o=i.clientOffset)?0:o;if(!(i=Dr(t,"Period")).length)throw new Error(Hr);var a,s,o=Br(t),t=$r([n],Dr(t,"BaseURL"));return o.sourceDuration=o.mediaPresentationDuration||0,o.NOW=e,o.clientOffset=r,_r(i.map((a=o,s=t,function(t,e){var i=$r(s,Dr(t,"BaseURL")),n=Br(t),n=parseInt(n.id,10),e=d.isNaN(n)?e:n,n=vr(a,{periodIndex:e}),e=Dr(t,"AdaptationSet"),t=Kr(t);return _r(e.map(Jr(n,i,t)))})))}function ta(t){if(""===t)throw new Error(qr);if(!(t=(t=(new d.DOMParser).parseFromString(t,"application/xml"))&&"MPD"===t.documentElement.tagName?t.documentElement:null)||t&&0<t.getElementsByTagName("parsererror").length)throw new Error(zr);return t}function ea(t,e){return function(t){if(!t.length)return{};var e=t[0].attributes,i=e.sourceDuration,n=e.minimumUpdatePeriod,r=void 0===n?0:n,a=Tr(t.filter(function(t){t=t.attributes;return"video/mp4"===t.mimeType||"video"===t.contentType})).map(wr),e=Tr(t.filter(function(t){t=t.attributes;return"audio/mp4"===t.mimeType||"audio"===t.contentType})),n=t.filter(function(t){t=t.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType}),r={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:((t={AUDIO:{},VIDEO:{}})["CLOSED-CAPTIONS"]={},t.SUBTITLES={},t),uri:"",duration:i,playlists:a,minimumUpdatePeriod:1e3*r};return e.length&&(r.mediaGroups.AUDIO.audio=Sr(e)),n.length&&(r.mediaGroups.SUBTITLES.subs=kr(n)),r}(Zr(ta(t),e).map(xr))}function ia(t){return function(t){t=Dr(t,"UTCTiming")[0];if(!t)return null;var e=Br(t);switch(e.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":e.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":e.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":e.method="DIRECT",e.value=Date.parse(e.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(Xr)}return e}(ta(t))}var na,ra,aa,sa,oa,ua,la,ca,ha,da,pa,fa,ma,ga,ya,va,_a,ba,Ta,Sa,ka,wa,Ca,Ea,Aa,La,Oa,Pa,Ua,Ia,xa,Da,Ra,Ma,Ba,Na,ja,Fa,Va,Ha={"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"},qa=function(t){return t>>>0},za=function(t,e){var i,n,r,a=[];if(!e.length)return null;for(i=0;i<t.byteLength;)n=qa(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3]),r=Wa(t.subarray(i+4,i+8)),n=1<n?i+n:t.byteLength,r===e[0]&&(1===e.length?a.push(t.subarray(i+8,n)):(r=za(t.subarray(i+8,n),e.slice(1))).length&&(a=a.concat(r))),i=n;return a},Wa=function(t){var e="";return e+=String.fromCharCode(t[0]),e+=String.fromCharCode(t[1]),e+=String.fromCharCode(t[2]),e+=String.fromCharCode(t[3])},Ga=function(t){return za(t,["moov","trak"]).reduce(function(t,e){var i,n,r=za(e,["tkhd"])[0];return r?(i=r[0],r=qa(r[n=0===i?12:20]<<24|r[1+n]<<16|r[2+n]<<8|r[3+n]),(e=za(e,["mdia","mdhd"])[0])?(n=0===e[0]?12:20,t[r]=qa(e[n]<<24|e[1+n]<<16|e[2+n]<<8|e[3+n]),t):null):null},{})},Xa=function(n,t){var t=za(t,["moof","traf"]),t=[].concat.apply([],t.map(function(i){return za(i,["tfhd"]).map(function(t){var e=qa(t[4]<<24|t[5]<<16|t[6]<<8|t[7]),t=n[e]||9e4,e=za(i,["tfdt"]).map(function(t){var e=t[0],i=qa(t[4]<<24|t[5]<<16|t[6]<<8|t[7]);return 1===e&&(i*=Math.pow(2,32),i+=qa(t[8]<<24|t[9]<<16|t[10]<<8|t[11])),i})[0];return(e||1/0)/t})})),t=Math.min.apply(null,t);return isFinite(t)?t:0},ae=function(t){var t=za(t,["moov","trak"]),n=[];return t.forEach(function(t){var e=za(t,["mdia","hdlr"]),i=za(t,["tkhd"]);e.forEach(function(t,e){t=Wa(t.subarray(8,12)),e=i[e];"vide"===t&&(e=0===(e=new DataView(e.buffer,e.byteOffset,e.byteLength)).getUint8(0)?e.getUint32(12):e.getUint32(20),n.push(e))})}),n},Ya={findBox:za,parseType:Wa,timescale:Ga,startTime:Xa,videoTrackIds:ae},$a=Math.pow(2,32)-1;!function(){if(ka={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(var t in ka)ka.hasOwnProperty(t)&&(ka[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);wa=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),Ea=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),Ca=new Uint8Array([0,0,0,1]),Aa=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]),La=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]),Oa={video:Aa,audio:La},Ia=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),Ua=new Uint8Array([0,0,0,0,0,0,0,0]),xa=new Uint8Array([0,0,0,0,0,0,0,0]),Da=xa,Ra=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Ma=xa,Pa=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),na=function(t){for(var e,i=[],n=0,r=1;r<arguments.length;r++)i.push(arguments[r]);for(r=i.length;r--;)n+=i[r].byteLength;for(e=new Uint8Array(n+8),new DataView(e.buffer,e.byteOffset,e.byteLength).setUint32(0,e.byteLength),e.set(t,4),r=0,n=8;r<i.length;r++)e.set(i[r],n),n+=i[r].byteLength;return e},ra=function(){return na(ka.dinf,na(ka.dref,Ia))},aa=function(t){return na(ka.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,t.audioobjecttype<<3|t.samplingfrequencyindex>>>1,t.samplingfrequencyindex<<7|t.channelcount<<3,6,1,2]))},ga=function(t){return na(ka.hdlr,Oa[t])},ma=function(t){var e=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,t.duration>>>24&255,t.duration>>>16&255,t.duration>>>8&255,255&t.duration,85,196,0,0]);return t.samplerate&&(e[12]=t.samplerate>>>24&255,e[13]=t.samplerate>>>16&255,e[14]=t.samplerate>>>8&255,e[15]=255&t.samplerate),na(ka.mdhd,e)},fa=function(t){return na(ka.mdia,ma(t),ga(t.type),ua(t))},oa=function(t){return na(ka.mfhd,new Uint8Array([0,0,0,0,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t]))},ua=function(t){return na(ka.minf,"video"===t.type?na(ka.vmhd,Pa):na(ka.smhd,Ua),ra(),va(t))},Ht=function(t,e){for(var i=[],n=e.length;n--;)i[n]=ba(e[n]);return na.apply(null,[ka.moof,oa(t)].concat(i))},la=function(t){for(var e=t.length,i=[];e--;)i[e]=da(t[e]);return na.apply(null,[ka.moov,ha(4294967295)].concat(i).concat(ca(t)))},ca=function(t){for(var e=t.length,i=[];e--;)i[e]=Ta(t[e]);return na.apply(null,[ka.mvex].concat(i))},ha=function(t){t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t,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 na(ka.mvhd,t)},ya=function(t){for(var e,i=t.samples||[],n=new Uint8Array(4+i.length),r=0;r<i.length;r++)e=i[r].flags,n[r+4]=e.dependsOn<<4|e.isDependedOn<<2|e.hasRedundancy;return na(ka.sdtp,n)},va=function(t){return na(ka.stbl,_a(t),na(ka.stts,Ma),na(ka.stsc,Da),na(ka.stsz,Ra),na(ka.stco,xa))},_a=function(t){return na(ka.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),("video"===t.type?Ba:Na)(t))},Ba=function(t){for(var e=t.sps||[],i=t.pps||[],n=[],r=[],a=0;a<e.length;a++)n.push((65280&e[a].byteLength)>>>8),n.push(255&e[a].byteLength),n=n.concat(Array.prototype.slice.call(e[a]));for(a=0;a<i.length;a++)r.push((65280&i[a].byteLength)>>>8),r.push(255&i[a].byteLength),r=r.concat(Array.prototype.slice.call(i[a]));return na(ka.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&t.width)>>8,255&t.width,(65280&t.height)>>8,255&t.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]),na(ka.avcC,new Uint8Array([1,t.profileIdc,t.profileCompatibility,t.levelIdc,255].concat([e.length]).concat(n).concat([i.length]).concat(r))),na(ka.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))},Na=function(t){return na(ka.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&t.channelcount)>>8,255&t.channelcount,(65280&t.samplesize)>>8,255&t.samplesize,0,0,0,0,(65280&t.samplerate)>>8,255&t.samplerate,0,0]),aa(t))},pa=function(t){t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,0,(4278190080&t.duration)>>24,(16711680&t.duration)>>16,(65280&t.duration)>>8,255&t.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&t.width)>>8,255&t.width,0,0,(65280&t.height)>>8,255&t.height,0,0]);return na(ka.tkhd,t)},ba=function(t){var e,i=na(ka.tfhd,new Uint8Array([0,0,0,58,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),n=Math.floor(t.baseMediaDecodeTime/(1+$a)),r=Math.floor(t.baseMediaDecodeTime%(1+$a)),n=na(ka.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"===t.type?(e=Sa(t,92),na(ka.traf,i,n,e)):(r=ya(t),e=Sa(t,r.length+92),na(ka.traf,i,n,e,r))},da=function(t){return t.duration=t.duration||4294967295,na(ka.trak,pa(t),fa(t))},Ta=function(t){var e=new Uint8Array([0,0,0,0,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==t.type&&(e[e.length-1]=0),na(ka.trex,e)},ja=function(t,e){var i=0,n=0,r=0,a=0;return t.length&&(void 0!==t[0].duration&&(i=1),void 0!==t[0].size&&(n=2),void 0!==t[0].flags&&(r=4),void 0!==t[0].compositionTimeOffset&&(a=8)),[0,0,i|n|r|a,1,(4278190080&t.length)>>>24,(16711680&t.length)>>>16,(65280&t.length)>>>8,255&t.length,(4278190080&e)>>>24,(16711680&e)>>>16,(65280&e)>>>8,255&e]},Fa=function(t,e){for(var i,n=t.samples||[],r=ja(n,e+=20+16*n.length),a=0;a<n.length;a++)i=n[a],r=r.concat([(4278190080&i.duration)>>>24,(16711680&i.duration)>>>16,(65280&i.duration)>>>8,255&i.duration,(4278190080&i.size)>>>24,(16711680&i.size)>>>16,(65280&i.size)>>>8,255&i.size,i.flags.isLeading<<2|i.flags.dependsOn,i.flags.isDependedOn<<6|i.flags.hasRedundancy<<4|i.flags.paddingValue<<1|i.flags.isNonSyncSample,61440&i.flags.degradationPriority,15&i.flags.degradationPriority,(4278190080&i.compositionTimeOffset)>>>24,(16711680&i.compositionTimeOffset)>>>16,(65280&i.compositionTimeOffset)>>>8,255&i.compositionTimeOffset]);return na(ka.trun,new Uint8Array(r))},Va=function(t,e){for(var i,n=t.samples||[],r=ja(n,e+=20+8*n.length),a=0;a<n.length;a++)i=n[a],r=r.concat([(4278190080&i.duration)>>>24,(16711680&i.duration)>>>16,(65280&i.duration)>>>8,255&i.duration,(4278190080&i.size)>>>24,(16711680&i.size)>>>16,(65280&i.size)>>>8,255&i.size]);return na(ka.trun,new Uint8Array(r))},Sa=function(t,e){return("audio"===t.type?Va:Fa)(t,e)};var Ka={ftyp:sa=function(){return na(ka.ftyp,wa,Ca,wa,Ea)},mdat:function(t){return na(ka.mdat,t)},moof:Ht,moov:la,initSegment:function(t){var e=sa(),i=la(t),t=new Uint8Array(e.byteLength+i.byteLength);return t.set(e),t.set(i,e.byteLength),t}},di=function(){this.init=function(){var a={};this.on=function(t,e){a[t]||(a[t]=[]),a[t]=a[t].concat(e)},this.off=function(t,e){return!!a[t]&&(e=a[t].indexOf(e),a[t]=a[t].slice(),a[t].splice(e,1),-1<e)},this.trigger=function(t){var e,i,n,r=a[t];if(r)if(2===arguments.length)for(i=r.length,e=0;e<i;++e)r[e].call(this,arguments[1]);else{for(n=[],e=arguments.length,e=1;e<arguments.length;++e)n.push(arguments[e]);for(i=r.length,e=0;e<i;++e)r[e].apply(this,n)}},this.dispose=function(){a={}}}};di.prototype.pipe=function(e){return this.on("data",function(t){e.push(t)}),this.on("done",function(t){e.flush(t)}),e},di.prototype.push=function(t){this.trigger("data",t)},di.prototype.flush=function(t){this.trigger("done",t)};var Qa,qe=di,Ja=function(t){for(var e,i=[],n=[],r=i.byteLength=0;r<t.length;r++)"access_unit_delimiter_rbsp"===(e=t[r]).nalUnitType?(i.length&&(i.duration=e.dts-i.dts,n.push(i)),(i=[e]).byteLength=e.data.byteLength,i.pts=e.pts,i.dts=e.dts):("slice_layer_without_partitioning_rbsp_idr"===e.nalUnitType&&(i.keyFrame=!0),i.duration=e.dts-i.dts,i.byteLength+=e.data.byteLength,i.push(e));return n.length&&(!i.duration||i.duration<=0)&&(i.duration=n[n.length-1].duration),n.push(i),n},Za=function(t){var e,i,n=[],r=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=t[0].pts,n.dts=t[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=t[0].pts,r.dts=t[0].dts,e=0;e<t.length;e++)(i=t[e]).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},ts=function(t){var e;return!t[0][0].keyFrame&&1<t.length&&(e=t.shift(),t.byteLength-=e.byteLength,t.nalCount-=e.nalCount,t[0][0].dts=e.dts,t[0][0].pts=e.pts,t[0][0].duration+=e.duration),t},es=function(t,e){for(var i,n,r,a,s=e||0,o=[],u=0;u<t.length;u++)for(n=t[u],i=0;i<n.length;i++)a=n[i],r=a,a=void 0,(a={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}).dataOffset=s,a.compositionTimeOffset=r.pts-r.dts,a.duration=r.duration,a.size=4*r.length,a.size+=r.byteLength,r.keyFrame&&(a.flags.dependsOn=2,a.flags.isNonSyncSample=0),s+=a.size,o.push(a);return o},is=function(t){for(var e,i,n,r,a,s=0,o=t.byteLength,u=t.nalCount,l=new Uint8Array(o+4*u),c=new DataView(l.buffer),h=0;h<t.length;h++)for(n=t[h],e=0;e<n.length;e++)for(r=n[e],i=0;i<r.length;i++)a=r[i],c.setUint32(s,a.data.byteLength),s+=4,l.set(a.data,s),s+=a.data.byteLength;return l},rr=[33,16,5,32,164,27],Vt=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],Ga=function(t){for(var e=[];t--;)e.push(0);return e},Xa={96e3:[rr,[227,64],Ga(154),[56]],88200:[rr,[231],Ga(170),[56]],64e3:[rr,[248,192],Ga(240),[56]],48e3:[rr,[255,192],Ga(268),[55,148,128],Ga(54),[112]],44100:[rr,[255,192],Ga(268),[55,163,128],Ga(84),[112]],32e3:[rr,[255,192],Ga(268),[55,234],Ga(226),[112]],24e3:[rr,[255,192],Ga(268),[55,255,128],Ga(268),[111,112],Ga(126),[224]],16e3:[rr,[255,192],Ga(268),[55,255,128],Ga(268),[111,255],Ga(269),[223,108],Ga(195),[1,192]],12e3:[Vt,Ga(268),[3,127,248],Ga(268),[6,255,240],Ga(268),[13,255,224],Ga(268),[27,253,128],Ga(259),[56]],11025:[Vt,Ga(268),[3,127,248],Ga(268),[6,255,240],Ga(268),[13,255,224],Ga(268),[27,255,192],Ga(268),[55,175,128],Ga(108),[112]],8e3:[Vt,Ga(268),[3,121,16],Ga(47),[7]]},ns=(Qa=Xa,Object.keys(Qa).reduce(function(t,e){return t[e]=new Uint8Array(Qa[e].reduce(function(t,e){return t.concat(e)},[])),t},{})),rs=function(t){return 9e4*t},as=function(t,e){return t*e},ss=function(t){return t/9e4},os=function(t,e){return t/e},us=function(t,e){return rs(os(t,e))},ls=function(t,e){return as(ss(t),e)},cs=function(t,e,i,n){var r,a,s,o,u,l=0,c=0;if(e.length&&(r=us(t.baseMediaDecodeTime,t.samplerate),a=Math.ceil(9e4/(t.samplerate/1024)),i&&n&&(s=r-Math.max(i,n),c=(l=Math.floor(s/a))*a),!(l<1||45e3<c))){for(o=(o=ns[t.samplerate])||e[0].data,u=0;u<l;u++)e.splice(u,0,{data:o});t.baseMediaDecodeTime-=Math.floor(ls(c,t.samplerate))}},hs=function(t,e,i){return e.minSegmentDts>=i?t:(e.minSegmentDts=1/0,t.filter(function(t){return t.dts>=i&&(e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),e.minSegmentPts=e.minSegmentDts,!0)}))},ds=function(t){for(var e,i=[],n=0;n<t.length;n++)e=t[n],i.push({size:e.data.byteLength,duration:1024});return i},ps=function(t){for(var e,i=0,n=new Uint8Array(function(t){for(var e=0,i=0;i<t.length;i++)e+=t[i].data.byteLength;return e}(t)),r=0;r<t.length;r++)e=t[r],n.set(e.data,i),i+=e.data.byteLength;return n},fs=function(t){delete t.minSegmentDts,delete t.maxSegmentDts,delete t.minSegmentPts,delete t.maxSegmentPts},ms=function(t,e){var i=t.minSegmentDts;return e||(i-=t.timelineStartInfo.dts),e=t.timelineStartInfo.baseMediaDecodeTime,e+=i,e=Math.max(0,e),"audio"===t.type&&(e*=t.samplerate/9e4,e=Math.floor(e)),e},gs=function(t,e){"number"==typeof e.pts&&(void 0===t.timelineStartInfo.pts&&(t.timelineStartInfo.pts=e.pts),void 0===t.minSegmentPts?t.minSegmentPts=e.pts:t.minSegmentPts=Math.min(t.minSegmentPts,e.pts),void 0===t.maxSegmentPts?t.maxSegmentPts=e.pts:t.maxSegmentPts=Math.max(t.maxSegmentPts,e.pts)),"number"==typeof e.dts&&(void 0===t.timelineStartInfo.dts&&(t.timelineStartInfo.dts=e.dts),void 0===t.minSegmentDts?t.minSegmentDts=e.dts:t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),void 0===t.maxSegmentDts?t.maxSegmentDts=e.dts:t.maxSegmentDts=Math.max(t.maxSegmentDts,e.dts))},ys=function(t){for(var e=0,i={payloadType:-1,payloadSize:0},n=0,r=0;e<t.byteLength&&128!==t[e];){for(;255===t[e];)n+=255,e++;for(n+=t[e++];255===t[e];)r+=255,e++;if(r+=t[e++],!i.payload&&4===n){i.payloadType=n,i.payloadSize=r,i.payload=t.subarray(e,e+r);break}e+=r,r=n=0}return i},vs=function(t){return 181!==t.payload[0]||49!=(t.payload[1]<<8|t.payload[2])||"GA94"!==String.fromCharCode(t.payload[3],t.payload[4],t.payload[5],t.payload[6])||3!==t.payload[7]?null:t.payload.subarray(8,t.payload.length-1)},_s=function(t,e){var i,n,r,a,s=[];if(!(64&e[0]))return s;for(n=31&e[0],i=0;i<n;i++)a={type:3&e[2+(r=3*i)],pts:t},4&e[2+r]&&(a.ccData=e[3+r]<<8|e[4+r],s.push(a));return s},ae=function(t){for(var e,i,n=t.byteLength,r=[],a=1;a<n-2;)0===t[a]&&0===t[a+1]&&3===t[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return t;e=n-r.length,i=new Uint8Array(e);for(var s=0,a=0;a<e;s++,a++)s===r[0]&&(s++,r.shift()),i[a]=t[s];return i},bs=4,Ht=function t(){t.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new Cs(0,0),new Cs(0,1),new Cs(1,0),new Cs(1,1)],this.reset(),this.ccStreams_.forEach(function(t){t.on("data",this.trigger.bind(this,"data")),t.on("done",this.trigger.bind(this,"done"))},this)};(Ht.prototype=new qe).push=function(t){var e,i;if("sei_rbsp"===t.nalUnitType&&(e=ys(t.escapedRBSP),e.payloadType===bs&&(i=vs(e))))if(t.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(t.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));i=_s(t.pts,i),this.captionPackets_=this.captionPackets_.concat(i),this.latestDts_!==t.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=t.dts}},Ht.prototype.flush=function(){this.captionPackets_.length?(this.captionPackets_.forEach(function(t,e){t.presortIndex=e}),this.captionPackets_.sort(function(t,e){return t.pts===e.pts?t.presortIndex-e.presortIndex:t.pts-e.pts}),this.captionPackets_.forEach(function(t){t.type<2&&this.dispatchCea608Packet(t)},this),this.captionPackets_.length=0,this.ccStreams_.forEach(function(t){t.flush()},this)):this.ccStreams_.forEach(function(t){t.flush()},this)},Ht.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(t){t.reset()})},Ht.prototype.dispatchCea608Packet=function(t){this.setsChannel1Active(t)?this.activeCea608Channel_[t.type]=0:this.setsChannel2Active(t)&&(this.activeCea608Channel_[t.type]=1),null!==this.activeCea608Channel_[t.type]&&this.ccStreams_[(t.type<<1)+this.activeCea608Channel_[t.type]].push(t)},Ht.prototype.setsChannel1Active=function(t){return 4096==(30720&t.ccData)},Ht.prototype.setsChannel2Active=function(t){return 6144==(30720&t.ccData)};function Ts(t){return null===t?"":(t=ks[t]||t,String.fromCharCode(t))}function Ss(){for(var t=[],e=15;e--;)t.push("");return t}var ks={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},ws=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Cs=function t(e,i){t.prototype.init.call(this),this.field_=e||0,this.dataChannel_=i||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(t){var e,i,n,r,a=32639&t.ccData;a!==this.lastControlCode_?(4096==(61440&a)?this.lastControlCode_=a:a!==this.PADDING_&&(this.lastControlCode_=null),e=a>>>8,i=255&a,a===this.PADDING_||(a===this.RESUME_CAPTION_LOADING_?this.mode_="popOn":a===this.END_OF_CAPTION_?(this.mode_="popOn",this.clearFormatting(t.pts),this.flushDisplayed(t.pts),r=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=r,this.startPts_=t.pts):a===this.ROLL_UP_2_ROWS_?(this.rollUpRows_=2,this.setRollUp(t.pts)):a===this.ROLL_UP_3_ROWS_?(this.rollUpRows_=3,this.setRollUp(t.pts)):a===this.ROLL_UP_4_ROWS_?(this.rollUpRows_=4,this.setRollUp(t.pts)):a===this.CARRIAGE_RETURN_?(this.clearFormatting(t.pts),this.flushDisplayed(t.pts),this.shiftRowsUp_(),this.startPts_=t.pts):a===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):a===this.ERASE_DISPLAYED_MEMORY_?(this.flushDisplayed(t.pts),this.displayed_=Ss()):a===this.ERASE_NON_DISPLAYED_MEMORY_?this.nonDisplayed_=Ss():a===this.RESUME_DIRECT_CAPTIONING_?("paintOn"!==this.mode_&&(this.flushDisplayed(t.pts),this.displayed_=Ss()),this.mode_="paintOn",this.startPts_=t.pts):this.isSpecialCharacter(e,i)?(n=Ts((e=(3&e)<<8)|i),this[this.mode_](t.pts,n),this.column_++):this.isExtCharacter(e,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=Ts((e=(3&e)<<8)|i),this[this.mode_](t.pts,n),this.column_++):this.isMidRowCode(e,i)?(this.clearFormatting(t.pts),this[this.mode_](t.pts," "),this.column_++,14==(14&i)&&this.addFormatting(t.pts,["i"]),1==(1&i)&&this.addFormatting(t.pts,["u"])):this.isOffsetControlCode(e,i)?this.column_+=3&i:this.isPAC(e,i)?(r=ws.indexOf(7968&a),"rollUp"===this.mode_&&(r-this.rollUpRows_+1<0&&(r=this.rollUpRows_-1),this.setRollUp(t.pts,r)),r!==this.row_&&(this.clearFormatting(t.pts),this.row_=r),1&i&&-1===this.formatting_.indexOf("u")&&this.addFormatting(t.pts,["u"]),16==(16&a)&&(this.column_=4*((14&a)>>1)),this.isColorPAC(i)&&14==(14&i)&&this.addFormatting(t.pts,["i"])):this.isNormalChar(e)&&(0===i&&(i=null),n=Ts(e),n+=Ts(i),this[this.mode_](t.pts,n),this.column_+=n.length))):this.lastControlCode_=null}};Cs.prototype=new qe,Cs.prototype.flushDisplayed=function(t){var e=this.displayed_.map(function(t){try{return t.trim()}catch(t){return console.error("Skipping malformed caption."),""}}).join("\n").replace(/^\n+|\n+$/g,"");e.length&&this.trigger("data",{startPts:this.startPts_,endPts:t,text:e,stream:this.name_})},Cs.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Ss(),this.nonDisplayed_=Ss(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},Cs.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_},Cs.prototype.isSpecialCharacter=function(t,e){return t===this.EXT_&&48<=e&&e<=63},Cs.prototype.isExtCharacter=function(t,e){return(t===this.EXT_+1||t===this.EXT_+2)&&32<=e&&e<=63},Cs.prototype.isMidRowCode=function(t,e){return t===this.EXT_&&32<=e&&e<=47},Cs.prototype.isOffsetControlCode=function(t,e){return t===this.OFFSET_&&33<=e&&e<=35},Cs.prototype.isPAC=function(t,e){return t>=this.BASE_&&t<this.BASE_+8&&64<=e&&e<=127},Cs.prototype.isColorPAC=function(t){return 64<=t&&t<=79||96<=t&&t<=127},Cs.prototype.isNormalChar=function(t){return 32<=t&&t<=127},Cs.prototype.setRollUp=function(t,e){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(t),this.nonDisplayed_=Ss(),this.displayed_=Ss()),void 0!==e&&e!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[e-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]="";void 0===e&&(e=this.row_),this.topRow_=e-this.rollUpRows_+1},Cs.prototype.addFormatting=function(t,e){this.formatting_=this.formatting_.concat(e);e=e.reduce(function(t,e){return t+"<"+e+">"},"");this[this.mode_](t,e)},Cs.prototype.clearFormatting=function(t){var e;this.formatting_.length&&(e=this.formatting_.reverse().reduce(function(t,e){return t+"</"+e+">"},""),this.formatting_=[],this[this.mode_](t,e))},Cs.prototype.popOn=function(t,e){var i=this.nonDisplayed_[this.row_];i+=e,this.nonDisplayed_[this.row_]=i},Cs.prototype.rollUp=function(t,e){var i=this.displayed_[this.row_];i+=e,this.displayed_[this.row_]=i},Cs.prototype.shiftRowsUp_=function(){for(var t=0;t<this.topRow_;t++)this.displayed_[t]="";for(t=this.row_+1;t<15;t++)this.displayed_[t]="";for(t=this.topRow_;t<this.row_;t++)this.displayed_[t]=this.displayed_[t+1];this.displayed_[this.row_]=""},Cs.prototype.paintOn=function(t,e){var i=this.displayed_[this.row_];i+=e,this.displayed_[this.row_]=i};function Es(t,e){var i=1;for(e<t&&(i=-1);4294967296<Math.abs(e-t);)t+=8589934592*i;return t}var di={CaptionStream:Ht,Cea608Stream:Cs},As={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},rr=function t(e){var i,n;t.prototype.init.call(this),this.type_=e,this.push=function(t){t.type===this.type_&&(void 0===n&&(n=t.dts),t.dts=Es(t.dts,n),t.pts=Es(t.pts,n),i=t.dts,this.trigger("data",t))},this.flush=function(){n=i,this.trigger("done")},this.discontinuity=function(){i=n=void 0}};rr.prototype=new qe;function Ls(t,e,i){for(var n="",r=e;r<i;r++)n+="%"+("00"+t[r].toString(16)).slice(-2);return n}function Os(t,e,i){return decodeURIComponent(Ls(t,e,i))}function Ps(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]}var Vt=rr,Ga=Es,Us={TXXX:function(t){var e;if(3===t.data[0]){for(e=1;e<t.data.length;e++)if(0===t.data[e]){t.description=Os(t.data,1,e),t.value=Os(t.data,e+1,t.data.length).replace(/\0*$/,"");break}t.data=t.value}},WXXX:function(t){var e;if(3===t.data[0])for(e=1;e<t.data.length;e++)if(0===t.data[e]){t.description=Os(t.data,1,e),t.url=Os(t.data,e+1,t.data.length);break}},PRIV:function(t){for(var e,i=0;i<t.data.length;i++)if(0===t.data[i]){t.owner=(e=t.data,unescape(Ls(e,0,i)));break}t.privateData=t.data.subarray(i+1),t.data=t.privateData}},Is=function(t){var e,u={debug:!(!t||!t.debug),descriptor:t&&t.descriptor},l=0,c=[],h=0;if(Is.prototype.init.call(this),this.dispatchType=As.METADATA_STREAM_TYPE.toString(16),u.descriptor)for(e=0;e<u.descriptor.length;e++)this.dispatchType+=("00"+u.descriptor[e].toString(16)).slice(-2);this.push=function(t){var e,i,n,r,a,s,o;if("timed-metadata"===t.type)if(t.dataAlignmentIndicator&&(h=0,c.length=0),0===c.length&&(t.data.length<10||t.data[0]!=="I".charCodeAt(0)||t.data[1]!=="D".charCodeAt(0)||t.data[2]!=="3".charCodeAt(0)))u.debug&&console.log("Skipping unrecognized metadata packet");else if(c.push(t),h+=t.data.byteLength,1===c.length&&(l=Ps(t.data.subarray(6,10)),l+=10),!(h<l)){for(e={data:new Uint8Array(l),frames:[],pts:c[0].pts,dts:c[0].dts},r=0;r<l;)e.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&e.data[5]&&(i+=4,i+=Ps(e.data.subarray(10,14)),l-=Ps(e.data.subarray(16,20)));do{if((n=Ps(e.data.subarray(i+4,i+8)))<1)return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.")}while((o={id:String.fromCharCode(e.data[i],e.data[i+1],e.data[i+2],e.data[i+3]),data:e.data.subarray(i+10,i+n+10)}).key=o.id,Us[o.id]&&(Us[o.id](o),"com.apple.streaming.transportStreamTimestamp"===o.owner&&(s=(1&(a=o.data)[3])<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2,s*=4,s+=3&a[7],o.timeStamp=s,void 0===e.pts&&void 0===e.dts&&(e.pts=o.timeStamp,e.dts=o.timeStamp),this.trigger("timestamp",o))),e.frames.push(o),i+=10,(i+=n)<l);this.trigger("data",e)}}};Is.prototype=new qe;var xs,Ds,Xa=Is,Ht=Vt,Rs=function(){var r=new Uint8Array(188),a=0;Rs.prototype.init.call(this),this.push=function(t){var e,i=0,n=188;for(a?((e=new Uint8Array(t.byteLength+a)).set(r.subarray(0,a)),e.set(t,a),a=0):e=t;n<e.byteLength;)71!==e[i]||71!==e[n]?(i++,n++):(this.trigger("data",e.subarray(i,n)),i+=188,n+=188);i<e.byteLength&&(r.set(e.subarray(i),0),a=e.byteLength-i)},this.flush=function(){188===a&&71===r[0]&&(this.trigger("data",r),a=0),this.trigger("done")}};Rs.prototype=new qe,(xs=function(){var n,r,a,s;xs.prototype.init.call(this),(s=this).packetsWaitingForPmt=[],this.programMapTable=void 0,n=function(t,e){var i=0;e.payloadUnitStartIndicator&&(i+=t[i]+1),("pat"===e.type?r:a)(t.subarray(i),e)},r=function(t,e){e.section_number=t[7],e.last_section_number=t[8],s.pmtPid=(31&t[10])<<8|t[11],e.pmtPid=s.pmtPid},a=function(t,e){var i,n;if(1&t[5]){for(s.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&t[1])<<8|t[2])-4,n=12+((15&t[10])<<8|t[11]);n<i;){var r=t[n],a=(31&t[n+1])<<8|t[n+2];r===As.H264_STREAM_TYPE&&null===s.programMapTable.video?s.programMapTable.video=a:r===As.ADTS_STREAM_TYPE&&null===s.programMapTable.audio?s.programMapTable.audio=a:r===As.METADATA_STREAM_TYPE&&(s.programMapTable["timed-metadata"][a]=r),n+=5+((15&t[n+3])<<8|t[n+4])}e.programMapTable=s.programMapTable}},this.push=function(t){var e={},i=4;if(e.payloadUnitStartIndicator=!!(64&t[1]),e.pid=31&t[1],e.pid<<=8,e.pid|=t[2],1<(48&t[3])>>>4&&(i+=t[i]+1),0===e.pid)e.type="pat",n(t.subarray(i),e),this.trigger("data",e);else if(e.pid===this.pmtPid)for(e.type="pmt",n(t.subarray(i),e),this.trigger("data",e);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,i,e]):this.processPes_(t,i,e)},this.processPes_=function(t,e,i){i.pid===this.programMapTable.video?i.streamType=As.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=As.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=t.subarray(e),this.trigger("data",i)}}).prototype=new qe,xs.STREAM_TYPES={h264:27,adts:15},(Ds=function(){function n(t,e,i){var n,r,a,s,o=new Uint8Array(t.size),u={type:e},l=0,c=0;if(t.data.length&&!(t.size<9)){for(u.trackId=t.data[0].pid,l=0;l<t.data.length;l++)n=t.data[l],o.set(n.data,c),c+=n.data.byteLength;r=o,(a=u).packetLength=6+(r[4]<<8|r[5]),a.dataAlignmentIndicator=0!=(4&r[6]),192&(s=r[7])&&(a.pts=(14&r[9])<<27|(255&r[10])<<20|(254&r[11])<<12|(255&r[12])<<5|(254&r[13])>>>3,a.pts*=4,a.pts+=(6&r[13])>>>1,a.dts=a.pts,64&s&&(a.dts=(14&r[14])<<27|(255&r[15])<<20|(254&r[16])<<12|(255&r[17])<<5|(254&r[18])>>>3,a.dts*=4,a.dts+=(6&r[18])>>>1)),a.data=r.subarray(9+r[8]),e="video"===e||u.packetLength<=t.size,(i||e)&&(t.size=0,t.data.length=0),e&&h.trigger("data",u)}}var h=this,r={data:[],size:0},a={data:[],size:0},s={data:[],size:0};Ds.prototype.init.call(this),this.push=function(i){({pat:function(){},pes:function(){var t,e;switch(i.streamType){case As.H264_STREAM_TYPE:case As.H264_STREAM_TYPE:t=r,e="video";break;case As.ADTS_STREAM_TYPE:t=a,e="audio";break;case As.METADATA_STREAM_TYPE:t=s,e="timed-metadata";break;default:return}i.payloadUnitStartIndicator&&n(t,e,!0),t.data.push(i),t.size+=i.data.byteLength},pmt:function(){var t={type:"metadata",tracks:[]},e=i.programMapTable;null!==e.video&&t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),h.trigger("data",t)}})[i.type]()},this.flush=function(){n(r,"video"),n(a,"audio"),n(s,"timed-metadata"),this.trigger("done")}}).prototype=new qe;var Ms,Bs={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:Rs,TransportParseStream:xs,ElementaryStream:Ds,TimestampRolloverStream:Ht,CaptionStream:di.CaptionStream,Cea608Stream:di.Cea608Stream,MetadataStream:Xa};for(Ms in As)As.hasOwnProperty(Ms)&&(Bs[Ms]=As[Ms]);var Ns=Bs,js=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Fs=function(){var u;Fs.prototype.init.call(this),this.push=function(t){var e,i,n,r,a,s=0,o=0;if("audio"===t.type)for(u?(n=u,(u=new Uint8Array(n.byteLength+t.data.byteLength)).set(n),u.set(t.data,n.byteLength)):u=t.data;s+5<u.length;)if(255===u[s]&&240==(246&u[s+1])){if(e=2*(1&~u[s+1]),i=(3&u[s+3])<<11|u[s+4]<<3|(224&u[s+5])>>5,a=9e4*(r=1024*(1+(3&u[s+6])))/js[(60&u[s+2])>>>2],i=s+i,u.byteLength<i)return;if(this.trigger("data",{pts:t.pts+o*a,dts:t.dts+o*a,sampleCount:r,audioobjecttype:1+(u[s+2]>>>6&3),channelcount:(1&u[s+2])<<2|(192&u[s+3])>>>6,samplerate:js[(60&u[s+2])>>>2],samplingfrequencyindex:(60&u[s+2])>>>2,samplesize:16,data:u.subarray(s+7+e,i)}),u.byteLength===i)return void(u=void 0);o++,u=u.subarray(i)}else s++},this.flush=function(){this.trigger("done")}};Fs.prototype=new qe;var Vs,Hs,qs=Fs,zs=function(n){var r=n.byteLength,a=0,s=0;this.length=function(){return 8*r},this.bitsAvailable=function(){return 8*r+s},this.loadWord=function(){var t=n.byteLength-r,e=new Uint8Array(4),i=Math.min(4,r);if(0===i)throw new Error("no bytes available");e.set(n.subarray(t,t+i)),a=new DataView(e.buffer).getUint32(0),s=8*i,r-=i},this.skipBits=function(t){var e;t<s||(t-=s,t-=8*(e=Math.floor(t/8)),r-=e,this.loadWord()),a<<=t,s-=t},this.readBits=function(t){var e=Math.min(s,t),i=a>>>32-e;return 0<(s-=e)?a<<=e:0<r&&this.loadWord(),0<(e=t-e)?i<<e|this.readBits(e):i},this.skipLeadingZeros=function(){for(var t=0;t<s;++t)if(0!=(a&2147483648>>>t))return a<<=t,s-=t,t;return this.loadWord(),t+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var t=this.skipLeadingZeros();return this.readBits(t+1)-1},this.readExpGolomb=function(){var t=this.readUnsignedExpGolomb();return 1&t?1+t>>>1:-1*(t>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()},Ws=function(){var i,n,r=0;Ws.prototype.init.call(this),this.push=function(t){var e;for(n=n?((e=new Uint8Array(n.byteLength+t.data.byteLength)).set(n),e.set(t.data,n.byteLength),e):t.data;r<n.byteLength-3;r++)if(1===n[r+2]){i=r+5;break}for(;i<n.byteLength;)switch(n[i]){case 0:if(0!==n[i-1]){i+=2;break}if(0!==n[i-2]){i++;break}for(r+3!==i-2&&this.trigger("data",n.subarray(r+3,i-2));i++,1!==n[i]&&i<n.length;);r=i-2,i+=3;break;case 1:if(0!==n[i-1]||0!==n[i-2]){i+=3;break}this.trigger("data",n.subarray(r+3,i-2)),r=i-2,i+=3;break;default:i+=3}n=n.subarray(r),i-=r,r=0},this.flush=function(){n&&3<n.byteLength&&this.trigger("data",n.subarray(r+3)),n=null,r=0,this.trigger("done")}};Ws.prototype=new qe,Hs={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(Vs=function(){var i,n,r,a,s,o,g,e=new Ws;Vs.prototype.init.call(this),(i=this).push=function(t){"video"===t.type&&(n=t.trackId,r=t.pts,a=t.dts,e.push(t))},e.on("data",function(t){var e={trackId:n,pts:r,dts:a,data:t};switch(31&t[0]){case 5:e.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:e.nalUnitType="sei_rbsp",e.escapedRBSP=s(t.subarray(1));break;case 7:e.nalUnitType="seq_parameter_set_rbsp",e.escapedRBSP=s(t.subarray(1)),e.config=o(e.escapedRBSP);break;case 8:e.nalUnitType="pic_parameter_set_rbsp";break;case 9:e.nalUnitType="access_unit_delimiter_rbsp"}i.trigger("data",e)}),e.on("done",function(){i.trigger("done")}),this.flush=function(){e.flush()},g=function(t,e){for(var i=8,n=8,r=0;r<t;r++)0!==n&&(n=(i+e.readExpGolomb()+256)%256),i=0===n?i:n},s=function(t){for(var e,i,n=t.byteLength,r=[],a=1;a<n-2;)0===t[a]&&0===t[a+1]&&3===t[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return t;e=n-r.length,i=new Uint8Array(e);for(var s=0,a=0;a<e;s++,a++)s===r[0]&&(s++,r.shift()),i[a]=t[s];return i},o=function(t){var e,i,n,r,a,s,o=0,u=0,l=0,c=0,h=1,d=new zs(t),p=d.readUnsignedByte(),f=d.readUnsignedByte(),m=d.readUnsignedByte();if(d.skipUnsignedExpGolomb(),Hs[p]&&(3===(i=d.readUnsignedExpGolomb())&&d.skipBits(1),d.skipUnsignedExpGolomb(),d.skipUnsignedExpGolomb(),d.skipBits(1),d.readBoolean()))for(r=3!==i?8:12,s=0;s<r;s++)d.readBoolean()&&g(s<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(),e=d.readUnsignedExpGolomb(),s=0;s<e;s++)d.skipExpGolomb();if(d.skipUnsignedExpGolomb(),d.skipBits(1),t=d.readUnsignedExpGolomb(),i=d.readUnsignedExpGolomb(),n=d.readBits(1),0===n&&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:a=[1,1];break;case 2:a=[12,11];break;case 3:a=[10,11];break;case 4:a=[16,11];break;case 5:a=[40,33];break;case 6:a=[24,11];break;case 7:a=[20,11];break;case 8:a=[32,11];break;case 9:a=[80,33];break;case 10:a=[18,11];break;case 11:a=[15,11];break;case 12:a=[64,33];break;case 13:a=[160,99];break;case 14:a=[4,3];break;case 15:a=[3,2];break;case 16:a=[2,1];break;case 255:a=[d.readUnsignedByte()<<8|d.readUnsignedByte(),d.readUnsignedByte()<<8|d.readUnsignedByte()]}a&&(h=a[0]/a[1])}return{profileIdc:p,levelIdc:m,profileCompatibility:f,width:Math.ceil((16*(t+1)-2*o-2*u)*h),height:(2-n)*(i+1)*16-2*l-2*c}}}).prototype=new qe;function Gs(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]}var rr={H264Stream:Vs,NalByteStream:Ws},Xs=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Ys={isLikelyAacData:function(t){return t[0]==="I".charCodeAt(0)&&t[1]==="D".charCodeAt(0)&&t[2]==="3".charCodeAt(0)},parseId3TagSize:function(t,e){var i=t[e+6]<<21|t[e+7]<<14|t[e+8]<<7|t[e+9];return(16&t[e+5])>>4?20+i:10+i},parseAdtsSize:function(t,e){var i=(224&t[e+5])>>5,n=t[e+4]<<3;return 6144&t[e+3]|n|i},parseType:function(t,e){return t[e]==="I".charCodeAt(0)&&t[e+1]==="D".charCodeAt(0)&&t[e+2]==="3".charCodeAt(0)?"timed-metadata":!0&t[e]&&240==(240&t[e+1])?"audio":null},parseSampleRate:function(t){for(var e=0;e+5<t.length;){if(255===t[e]&&240==(246&t[e+1]))return Xs[(60&t[e+2])>>>2];e++}return null},parseAacTimestamp:function(t){var e,i,n=10;64&t[5]&&(n+=4,n+=Gs(t.subarray(10,14)));do{if((e=Gs(t.subarray(n+4,n+8)))<1)return null;if("PRIV"===String.fromCharCode(t[n],t[n+1],t[n+2],t[n+3])){i=t.subarray(n+10,n+e+10);for(var r=0;r<i.byteLength;r++)if(0===i[r]){if("com.apple.streaming.transportStreamTimestamp"!==unescape(function(t,e,i){for(var n="",r=e;r<i;r++)n+="%"+("00"+t[r].toString(16)).slice(-2);return n}(i,0,r)))break;var a=i.subarray(r+1),s=(1&a[3])<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2;return s*=4,s+=3&a[7]}}}while(n+=10,(n+=e)<t.byteLength);return null}},$s=function(){var a=new Uint8Array,s=0;$s.prototype.init.call(this),this.setTimestamp=function(t){s=t},this.push=function(t){var e,i,n=0,r=0;for(a.length?(i=a.length,(a=new Uint8Array(t.byteLength+i)).set(a.subarray(0,i)),a.set(t,i)):a=t;3<=a.length-r;)if(a[r]!=="I".charCodeAt(0)||a[r+1]!=="D".charCodeAt(0)||a[r+2]!=="3".charCodeAt(0))if(255!=(255&a[r])||240!=(240&a[r+1]))r++;else{if(a.length-r<7)break;if(r+(n=Ys.parseAdtsSize(a,r))>a.length)break;e={type:"audio",data:a.subarray(r,r+n),pts:s,dts:s},this.trigger("data",e),r+=n}else{if(a.length-r<10)break;if(r+(n=Ys.parseId3TagSize(a,r))>a.length)break;e={type:"timed-metadata",data:a.subarray(r,r+n)},this.trigger("data",e),r+=n}t=a.length-r,a=0<t?a.subarray(r):new Uint8Array}};$s.prototype=new qe;function Ks(t,e){var i;if(t.length===e.length){for(i=0;i<t.length;i++)if(t[i]!==e[i])return;return 1}}var Qs,Js,Zs,to=$s,eo=rr.H264Stream,io=Ys.isLikelyAacData,no=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],ro=["width","height","profileIdc","levelIdc","profileCompatibility"],ao=function(n,r){var a=[],s=0,o=0,u=0,l=1/0;r=r||{},ao.prototype.init.call(this),this.push=function(e){gs(n,e),n&&no.forEach(function(t){n[t]=e[t]}),a.push(e)},this.setEarliestDts=function(t){o=t-n.timelineStartInfo.baseMediaDecodeTime},this.setVideoBaseMediaDecodeTime=function(t){l=t},this.setAudioAppendStart=function(t){u=t},this.flush=function(){var t,e,i;0!==a.length&&(i=hs(a,n,o),n.baseMediaDecodeTime=ms(n,r.keepOriginalTimestamps),cs(n,i,u,l),n.samples=ds(i),e=Ka.mdat(ps(i)),a=[],t=Ka.moof(s,[n]),i=new Uint8Array(t.byteLength+e.byteLength),s++,i.set(t),i.set(e,t.byteLength),fs(n),this.trigger("data",{track:n,boxes:i})),this.trigger("done","AudioSegmentStream")}};ao.prototype=new qe,(Qs=function(s,n){var e,i,r=0,a=[],l=[];n=n||{},Qs.prototype.init.call(this),delete s.minPTS,this.gopCache_=[],this.push=function(t){gs(s,t),"seq_parameter_set_rbsp"!==t.nalUnitType||e||(e=t.config,s.sps=[t.data],ro.forEach(function(t){s[t]=e[t]},this)),"pic_parameter_set_rbsp"!==t.nalUnitType||i||(i=t.data,s.pps=[t.data]),a.push(t)},this.flush=function(){for(var t,e;a.length&&"access_unit_delimiter_rbsp"!==a[0].nalUnitType;)a.shift();if(0===a.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(e=Ja(a),(e=Za(e))[0][0].keyFrame||((t=this.getGopForFusion_(a[0],s))?(e.unshift(t),e.byteLength+=t.byteLength,e.nalCount+=t.nalCount,e.pts=t.pts,e.dts=t.dts,e.duration+=t.duration):e=ts(e)),l.length){var i=n.alignGopsAtEnd?this.alignGopsAtEnd_(e):this.alignGopsAtStart_(e);if(!i)return this.gopCache_.unshift({gop:e.pop(),pps:s.pps,sps:s.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");fs(s),e=i}gs(s,e),s.samples=es(e),t=Ka.mdat(is(e)),s.baseMediaDecodeTime=ms(s,n.keepOriginalTimestamps),this.trigger("processedGopsInfo",e.map(function(t){return{pts:t.pts,dts:t.dts,byteLength:t.byteLength}})),this.gopCache_.unshift({gop:e.pop(),pps:s.pps,sps:s.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.trigger("baseMediaDecodeTime",s.baseMediaDecodeTime),this.trigger("timelineStartInfo",s.timelineStartInfo),i=Ka.moof(r,[s]),e=new Uint8Array(i.byteLength+t.byteLength),r++,e.set(i),e.set(t,i.byteLength),this.trigger("data",{track:s,boxes:e}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.resetStream_=function(){fs(s),i=e=void 0},this.getGopForFusion_=function(t){for(var e,i,n,r=1/0,a=0;a<this.gopCache_.length;a++)i=(n=this.gopCache_[a]).gop,s.pps&&Ks(s.pps[0],n.pps[0])&&s.sps&&Ks(s.sps[0],n.sps[0])&&(i.dts<s.timelineStartInfo.dts||-1e4<=(i=t.dts-i.dts-i.duration)&&i<=45e3&&(!e||i<r)&&(e=n,r=i));return e?e.gop:null},this.alignGopsAtStart_=function(t){for(var e,i,n,r,a=t.byteLength,s=t.nalCount,o=t.duration,u=e=0;u<l.length&&e<t.length&&(i=l[u],n=t[e],i.pts!==n.pts);)n.pts>i.pts?u++:(e++,a-=n.byteLength,s-=n.nalCount,o-=n.duration);return 0===e?t:e===t.length?null:((r=t.slice(e)).byteLength=a,r.duration=o,r.nalCount=s,r.pts=r[0].pts,r.dts=r[0].dts,r)},this.alignGopsAtEnd_=function(t){for(var e,i,n=l.length-1,r=t.length-1,a=null,s=!1;0<=n&&0<=r;){if(e=l[n],i=t[r],e.pts===i.pts){s=!0;break}e.pts>i.pts?n--:(n===l.length-1&&(a=r),r--)}if(!s&&null===a)return null;if(0===(u=s?r:a))return t;var o=t.slice(u),u=o.reduce(function(t,e){return t.byteLength+=e.byteLength,t.duration+=e.duration,t.nalCount+=e.nalCount,t},{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(t){l=t}}).prototype=new qe,(Zs=function(t,e){this.numberOfTracks=0,this.metadataStream=e,void 0!==(t=t||{}).remux?this.remuxTracks=!!t.remux:this.remuxTracks=!0,"boolean"==typeof t.keepOriginalTimestamps&&(this.keepOriginalTimestamps=t.keepOriginalTimestamps),this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,Zs.prototype.init.call(this),this.push=function(t){return t.text?this.pendingCaptions.push(t):t.frames?this.pendingMetadata.push(t):(this.pendingTracks.push(t.track),this.pendingBoxes.push(t.boxes),this.pendingBytes+=t.boxes.byteLength,"video"===t.track.type&&(this.videoTrack=t.track),void("audio"===t.track.type&&(this.audioTrack=t.track)))}}).prototype=new qe,Zs.prototype.flush=function(t){var e,i,n,r=0,a={captions:[],captionStreams:{},metadata:[],info:{}},s=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==t&&"AudioSegmentStream"!==t)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}for(this.videoTrack?(s=this.videoTrack.timelineStartInfo.pts,ro.forEach(function(t){a.info[t]=this.videoTrack[t]},this)):this.audioTrack&&(s=this.audioTrack.timelineStartInfo.pts,no.forEach(function(t){a.info[t]=this.audioTrack[t]},this)),1===this.pendingTracks.length?a.type=this.pendingTracks[0].type:a.type="combined",this.emittedTracks+=this.pendingTracks.length,t=Ka.initSegment(this.pendingTracks),a.initSegment=new Uint8Array(t.byteLength),a.initSegment.set(t),a.data=new Uint8Array(this.pendingBytes),n=0;n<this.pendingBoxes.length;n++)a.data.set(this.pendingBoxes[n],r),r+=this.pendingBoxes[n].byteLength;for(n=0;n<this.pendingCaptions.length;n++)(e=this.pendingCaptions[n]).startTime=e.startPts,this.keepOriginalTimestamps||(e.startTime-=s),e.startTime/=9e4,e.endTime=e.endPts,this.keepOriginalTimestamps||(e.endTime-=s),e.endTime/=9e4,a.captionStreams[e.stream]=!0,a.captions.push(e);for(n=0;n<this.pendingMetadata.length;n++)(i=this.pendingMetadata[n]).cueTime=i.pts,this.keepOriginalTimestamps||(i.cueTime-=s),i.cueTime/=9e4,a.metadata.push(i);a.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",a),this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},(Js=function(n){var r,a,s=this,i=!0;Js.prototype.init.call(this),n=n||{},this.baseMediaDecodeTime=n.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var e={};(this.transmuxPipeline_=e).type="aac",e.metadataStream=new Ns.MetadataStream,e.aacStream=new to,e.audioTimestampRolloverStream=new Ns.TimestampRolloverStream("audio"),e.timedMetadataTimestampRolloverStream=new Ns.TimestampRolloverStream("timed-metadata"),e.adtsStream=new qs,e.coalesceStream=new Zs(n,e.metadataStream),e.headOfPipeline=e.aacStream,e.aacStream.pipe(e.audioTimestampRolloverStream).pipe(e.adtsStream),e.aacStream.pipe(e.timedMetadataTimestampRolloverStream).pipe(e.metadataStream).pipe(e.coalesceStream),e.metadataStream.on("timestamp",function(t){e.aacStream.setTimestamp(t.timeStamp)}),e.aacStream.on("data",function(t){"timed-metadata"!==t.type||e.audioSegmentStream||(a=a||{timelineStartInfo:{baseMediaDecodeTime:s.baseMediaDecodeTime},codec:"adts",type:"audio"},e.coalesceStream.numberOfTracks++,e.audioSegmentStream=new ao(a,n),e.adtsStream.pipe(e.audioSegmentStream).pipe(e.coalesceStream))}),e.coalesceStream.on("data",this.trigger.bind(this,"data")),e.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var i={};(this.transmuxPipeline_=i).type="ts",i.metadataStream=new Ns.MetadataStream,i.packetStream=new Ns.TransportPacketStream,i.parseStream=new Ns.TransportParseStream,i.elementaryStream=new Ns.ElementaryStream,i.videoTimestampRolloverStream=new Ns.TimestampRolloverStream("video"),i.audioTimestampRolloverStream=new Ns.TimestampRolloverStream("audio"),i.timedMetadataTimestampRolloverStream=new Ns.TimestampRolloverStream("timed-metadata"),i.adtsStream=new qs,i.h264Stream=new eo,i.captionStream=new Ns.CaptionStream,i.coalesceStream=new Zs(n,i.metadataStream),i.headOfPipeline=i.packetStream,i.packetStream.pipe(i.parseStream).pipe(i.elementaryStream),i.elementaryStream.pipe(i.videoTimestampRolloverStream).pipe(i.h264Stream),i.elementaryStream.pipe(i.audioTimestampRolloverStream).pipe(i.adtsStream),i.elementaryStream.pipe(i.timedMetadataTimestampRolloverStream).pipe(i.metadataStream).pipe(i.coalesceStream),i.h264Stream.pipe(i.captionStream).pipe(i.coalesceStream),i.elementaryStream.on("data",function(t){var e;if("metadata"===t.type){for(e=t.tracks.length;e--;)r||"video"!==t.tracks[e].type?a||"audio"!==t.tracks[e].type||((a=t.tracks[e]).timelineStartInfo.baseMediaDecodeTime=s.baseMediaDecodeTime):(r=t.tracks[e]).timelineStartInfo.baseMediaDecodeTime=s.baseMediaDecodeTime;r&&!i.videoSegmentStream&&(i.coalesceStream.numberOfTracks++,i.videoSegmentStream=new Qs(r,n),i.videoSegmentStream.on("timelineStartInfo",function(t){a&&(a.timelineStartInfo=t,i.audioSegmentStream.setEarliestDts(t.dts))}),i.videoSegmentStream.on("processedGopsInfo",s.trigger.bind(s,"gopInfo")),i.videoSegmentStream.on("baseMediaDecodeTime",function(t){a&&i.audioSegmentStream.setVideoBaseMediaDecodeTime(t)}),i.h264Stream.pipe(i.videoSegmentStream).pipe(i.coalesceStream)),a&&!i.audioSegmentStream&&(i.coalesceStream.numberOfTracks++,i.audioSegmentStream=new ao(a,n),i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream))}}),i.coalesceStream.on("data",this.trigger.bind(this,"data")),i.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(t){var e=this.transmuxPipeline_;n.keepOriginalTimestamps||(this.baseMediaDecodeTime=t),a&&(a.timelineStartInfo.dts=void 0,a.timelineStartInfo.pts=void 0,fs(a),n.keepOriginalTimestamps||(a.timelineStartInfo.baseMediaDecodeTime=t),e.audioTimestampRolloverStream&&e.audioTimestampRolloverStream.discontinuity()),r&&(e.videoSegmentStream&&(e.videoSegmentStream.gopCache_=[],e.videoTimestampRolloverStream.discontinuity()),r.timelineStartInfo.dts=void 0,r.timelineStartInfo.pts=void 0,fs(r),e.captionStream.reset(),n.keepOriginalTimestamps||(r.timelineStartInfo.baseMediaDecodeTime=t)),e.timedMetadataTimestampRolloverStream&&e.timedMetadataTimestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(t){a&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(t)},this.alignGopsWith=function(t){r&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(t)},this.push=function(t){var e;i&&((e=io(t))&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():e||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),i=!1),this.transmuxPipeline_.headOfPipeline.push(t)},this.flush=function(){i=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new qe;function so(t){return new Date(1e3*t-20828448e5)}function oo(t){return{isLeading:(12&t[0])>>>2,dependsOn:3&t[0],isDependedOn:(192&t[1])>>>6,hasRedundancy:(48&t[1])>>>4,paddingValue:(14&t[1])>>>1,isNonSyncSample:1&t[1],degradationPriority:t[2]<<8|t[3]}}function uo(t,c){var i=Ya.findBox(t,["moof","traf"]),t=Ya.findBox(t,["mdat"]),h={},n=[];return t.forEach(function(t,e){e=i[e];n.push({mdat:t,traf:e})}),n.forEach(function(t){var e,i,n,r,a,s=t.mdat,o=t.traf,u=Ya.findBox(o,["tfhd"]),l=vo.parseTfhd(u[0]),t=l.trackId,u=Ya.findBox(o,["tfdt"]),u=0<u.length?vo.parseTfdt(u[0]).baseMediaDecodeTime:0,o=Ya.findBox(o,["trun"]);c===t&&0<o.length&&(o=o,e=u,i=(l=l).defaultSampleDuration||0,n=l.defaultSampleSize||0,r=l.trackId,a=[],o.forEach(function(t){t=vo.parseTrun(t).samples;t.forEach(function(t){void 0===t.duration&&(t.duration=i),void 0===t.size&&(t.size=n),t.trackId=r,t.dts=e,void 0===t.compositionTimeOffset&&(t.compositionTimeOffset=0),t.pts=e+t.compositionTimeOffset,e+=t.duration}),a=a.concat(t)}),s=function(t,e,i){for(var n,r=new DataView(t.buffer,t.byteOffset,t.byteLength),a=[],s=0;s+4<t.length;s+=l){var o,u,l=r.getUint32(s);s+=4,l<=0||6==(31&t[s])&&(u=t.subarray(s+1,s+1+l),o=function(t,e){for(var i=t,n=0;n<e.length;n++){var r=e[n];if(i<r.size)return r;i-=r.size}return null}(s,e),u={nalUnitType:"sei_rbsp",size:l,data:u,escapedRBSP:_o(u),trackId:i},o?(u.pts=o.pts,u.dts=o.dts,n=o):(u.pts=n.pts,u.dts=n.dts),a.push(u))}return a}(s,a,t),h[t]||(h[t]=[]),h[t]=h[t].concat(s))}),h}function lo(t){var e=31&t[1];return e<<=8,e|=t[2]}function co(t){return!!(64&t[1])}function ho(t){var e=0;return 1<(48&t[3])>>>4&&(e+=t[4]+1),e}function po(t){switch(t){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}}var Vt={Transmuxer:Js,VideoSegmentStream:Qs,AudioSegmentStream:ao,AUDIO_PROPERTIES:no,VIDEO_PROPERTIES:ro},fo=Ya.parseType,mo={avc1:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return{dataReferenceIndex:e.getUint16(6),width:e.getUint16(24),height:e.getUint16(26),horizresolution:e.getUint16(28)+e.getUint16(30)/16,vertresolution:e.getUint16(32)+e.getUint16(34)/16,frameCount:e.getUint16(40),depth:e.getUint16(74),config:go(t.subarray(78,t.byteLength))}},avcC:function(t){for(var e,i,n=new DataView(t.buffer,t.byteOffset,t.byteLength),r={configurationVersion:t[0],avcProfileIndication:t[1],profileCompatibility:t[2],avcLevelIndication:t[3],lengthSizeMinusOne:3&t[4],sps:[],pps:[]},a=31&t[5],s=6,o=0;o<a;o++)i=n.getUint16(s),s+=2,r.sps.push(new Uint8Array(t.subarray(s,s+i))),s+=i;for(e=t[s],s++,o=0;o<e;o++)i=n.getUint16(s),s+=2,r.pps.push(new Uint8Array(t.subarray(s,s+i))),s+=i;return r},btrt:function(t){t=new DataView(t.buffer,t.byteOffset,t.byteLength);return{bufferSizeDB:t.getUint32(0),maxBitrate:t.getUint32(4),avgBitrate:t.getUint32(8)}},esds:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),esId:t[6]<<8|t[7],streamPriority:31&t[8],decoderConfig:{objectProfileIndication:t[11],streamType:t[12]>>>2&63,bufferSize:t[13]<<16|t[14]<<8|t[15],maxBitrate:t[16]<<24|t[17]<<16|t[18]<<8|t[19],avgBitrate:t[20]<<24|t[21]<<16|t[22]<<8|t[23],decoderConfigDescriptor:{tag:t[24],length:t[25],audioObjectType:t[26]>>>3&31,samplingFrequencyIndex:(7&t[26])<<1|t[27]>>>7&1,channelConfiguration:t[27]>>>3&15}}}},ftyp:function(t){for(var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={majorBrand:fo(t.subarray(0,4)),minorVersion:e.getUint32(4),compatibleBrands:[]},n=8;n<t.byteLength;)i.compatibleBrands.push(fo(t.subarray(n,n+4))),n+=4;return i},dinf:function(t){return{boxes:go(t)}},dref:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),dataReferences:go(t.subarray(8))}},hdlr:function(t){for(var e={version:new DataView(t.buffer,t.byteOffset,t.byteLength).getUint8(0),flags:new Uint8Array(t.subarray(1,4)),handlerType:fo(t.subarray(8,12)),name:""},i=8,i=24;i<t.byteLength;i++){if(0===t[i]){i++;break}e.name+=String.fromCharCode(t[i])}return e.name=decodeURIComponent(escape(e.name)),e},mdat:function(t){return{byteLength:t.byteLength,nals:function(t){for(var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n=[],r=0;r+4<t.length;r+=e)if(e=i.getUint32(r),r+=4,e<=0)n.push("<span style='color:red;'>MALFORMED DATA</span>");else switch(31&t[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 - "+t[r]&31)}return n}(t)}},mdhd:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i=4,t={version:e.getUint8(0),flags:new Uint8Array(t.subarray(1,4)),language:""};return 1===t.version?(i+=4,t.creationTime=so(e.getUint32(i)),i+=8,t.modificationTime=so(e.getUint32(i)),i+=4,t.timescale=e.getUint32(i),i+=8):(t.creationTime=so(e.getUint32(i)),i+=4,t.modificationTime=so(e.getUint32(i)),i+=4,t.timescale=e.getUint32(i),i+=4),t.duration=e.getUint32(i),i+=4,i=e.getUint16(i),t.language+=String.fromCharCode(96+(i>>10)),t.language+=String.fromCharCode(96+((992&i)>>5)),t.language+=String.fromCharCode(96+(31&i)),t},mdia:function(t){return{boxes:go(t)}},mfhd:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),sequenceNumber:t[4]<<24|t[5]<<16|t[6]<<8|t[7]}},minf:function(t){return{boxes:go(t)}},mp4a:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),e={dataReferenceIndex:e.getUint16(6),channelcount:e.getUint16(16),samplesize:e.getUint16(18),samplerate:e.getUint16(24)+e.getUint16(26)/65536};return 28<t.byteLength&&(e.streamDescriptor=go(t.subarray(28))[0]),e},moof:function(t){return{boxes:go(t)}},moov:function(t){return{boxes:go(t)}},mvex:function(t){return{boxes:go(t)}},mvhd:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i=4,n={version:e.getUint8(0),flags:new Uint8Array(t.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=so(e.getUint32(i)),i+=8,n.modificationTime=so(e.getUint32(i)),i+=4,n.timescale=e.getUint32(i),i+=8):(n.creationTime=so(e.getUint32(i)),i+=4,n.modificationTime=so(e.getUint32(i)),i+=4,n.timescale=e.getUint32(i),i+=4),n.duration=e.getUint32(i),i+=4,n.rate=e.getUint16(i)+e.getUint16(i+2)/16,i+=4,n.volume=e.getUint8(i)+e.getUint8(i+1)/8,i+=2,i+=2,i+=8,n.matrix=new Uint32Array(t.subarray(i,i+36)),i+=36,i+=24,n.nextTrackId=e.getUint32(i),n},pdin:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return{version:e.getUint8(0),flags:new Uint8Array(t.subarray(1,4)),rate:e.getUint32(4),initialDelay:e.getUint32(8)}},sdtp:function(t){for(var e={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]},i=4;i<t.byteLength;i++)e.samples.push({dependsOn:(48&t[i])>>4,isDependedOn:(12&t[i])>>2,hasRedundancy:3&t[i]});return e},sidx:function(t){for(var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:e.getUint32(4),timescale:e.getUint32(8),earliestPresentationTime:e.getUint32(12),firstOffset:e.getUint32(16)},n=e.getUint16(22),r=24;n;r+=12,n--)i.references.push({referenceType:(128&t[r])>>>7,referencedSize:2147483647&e.getUint32(r),subsegmentDuration:e.getUint32(r+4),startsWithSap:!!(128&t[r+8]),sapType:(112&t[r+8])>>>4,sapDeltaTime:268435455&e.getUint32(r+8)});return i},smhd:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),balance:t[4]+t[5]/256}},stbl:function(t){return{boxes:go(t)}},stco:function(t){for(var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),chunkOffsets:[]},n=e.getUint32(4),r=8;n;r+=4,n--)i.chunkOffsets.push(e.getUint32(r));return i},stsc:function(t){for(var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i=e.getUint32(4),n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleToChunks:[]},r=8;i;r+=12,i--)n.sampleToChunks.push({firstChunk:e.getUint32(r),samplesPerChunk:e.getUint32(r+4),sampleDescriptionIndex:e.getUint32(r+8)});return n},stsd:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleDescriptions:go(t.subarray(8))}},stsz:function(t){for(var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleSize:e.getUint32(4),entries:[]},n=12;n<t.byteLength;n+=4)i.entries.push(e.getUint32(n));return i},stts:function(t){for(var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),timeToSamples:[]},n=e.getUint32(4),r=8;n;r+=8,n--)i.timeToSamples.push({sampleCount:e.getUint32(r),sampleDelta:e.getUint32(r+4)});return i},styp:function(t){return mo.ftyp(t)},tfdt:function(t){var e={version:t[0],flags:new Uint8Array(t.subarray(1,4)),baseMediaDecodeTime:t[4]<<24|t[5]<<16|t[6]<<8|t[7]};return 1===e.version&&(e.baseMediaDecodeTime*=Math.pow(2,32),e.baseMediaDecodeTime+=t[8]<<24|t[9]<<16|t[10]<<8|t[11]),e},tfhd:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),trackId:e.getUint32(4)},n=1&i.flags[2],r=2&i.flags[2],a=8&i.flags[2],s=16&i.flags[2],o=32&i.flags[2],u=65536&i.flags[0],l=131072&i.flags[0],t=8;return n&&(t+=4,i.baseDataOffset=e.getUint32(12),t+=4),r&&(i.sampleDescriptionIndex=e.getUint32(t),t+=4),a&&(i.defaultSampleDuration=e.getUint32(t),t+=4),s&&(i.defaultSampleSize=e.getUint32(t),t+=4),o&&(i.defaultSampleFlags=e.getUint32(t)),u&&(i.durationIsEmpty=!0),!n&&l&&(i.baseDataOffsetIsMoof=!0),i},tkhd:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i=4,n={version:e.getUint8(0),flags:new Uint8Array(t.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=so(e.getUint32(i)),i+=8,n.modificationTime=so(e.getUint32(i)),i+=4,n.trackId=e.getUint32(i),i+=4,i+=8):(n.creationTime=so(e.getUint32(i)),i+=4,n.modificationTime=so(e.getUint32(i)),i+=4,n.trackId=e.getUint32(i),i+=4,i+=4),n.duration=e.getUint32(i),i+=4,i+=8,n.layer=e.getUint16(i),i+=2,n.alternateGroup=e.getUint16(i),i+=2,n.volume=e.getUint8(i)+e.getUint8(i+1)/8,i+=2,i+=2,n.matrix=new Uint32Array(t.subarray(i,i+36)),i+=36,n.width=e.getUint16(i)+e.getUint16(i+2)/16,i+=4,n.height=e.getUint16(i)+e.getUint16(i+2)/16,n},traf:function(t){return{boxes:go(t)}},trak:function(t){return{boxes:go(t)}},trex:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),trackId:e.getUint32(4),defaultSampleDescriptionIndex:e.getUint32(8),defaultSampleDuration:e.getUint32(12),defaultSampleSize:e.getUint32(16),sampleDependsOn:3&t[20],sampleIsDependedOn:(192&t[21])>>6,sampleHasRedundancy:(48&t[21])>>4,samplePaddingValue:(14&t[21])>>1,sampleIsDifferenceSample:!!(1&t[21]),sampleDegradationPriority:e.getUint16(22)}},trun:function(t){var e,i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]},n=new DataView(t.buffer,t.byteOffset,t.byteLength),r=1&i.flags[2],a=4&i.flags[2],s=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),a&&c&&(e={flags:oo(t.subarray(h,h+4))},h+=4,s&&(e.duration=n.getUint32(h),h+=4),o&&(e.size=n.getUint32(h),h+=4),l&&(e.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(e),c--);c--;)e={},s&&(e.duration=n.getUint32(h),h+=4),o&&(e.size=n.getUint32(h),h+=4),u&&(e.flags=oo(t.subarray(h,h+4)),h+=4),l&&(e.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(e);return i},"url ":function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4))}},vmhd:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),graphicsmode:e.getUint16(4),opcolor:new Uint16Array([e.getUint16(6),e.getUint16(8),e.getUint16(10)])}}},go=function(t){for(var e,i,n,r,a,s=0,o=[],u=new ArrayBuffer(t.length),l=new Uint8Array(u),c=0;c<t.length;++c)l[c]=t[c];for(e=new DataView(u);s<t.byteLength;)i=e.getUint32(s),n=fo(t.subarray(s+4,s+8)),r=1<i?s+i:t.byteLength,(a=(mo[n]||function(t){return{data:t}})(t.subarray(s+8,r))).size=i,a.type=n,o.push(a),s=r;return o},yo=function(t,e){var r;return e=e||0,r=new Array(2*e+1).join(" "),t.map(function(n,t){return r+n.type+"\n"+Object.keys(n).filter(function(t){return"type"!==t&&"boxes"!==t}).map(function(t){var e=r+"  "+t+": ",i=n[t];if(i instanceof Uint8Array||i instanceof Uint32Array){t=Array.prototype.slice.call(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)).map(function(t){return" "+("00"+t.toString(16)).slice(-2)}).join("").match(/.{1,24}/g);return t?1===t.length?e+"<"+t.join("").slice(1)+">":e+"<\n"+t.map(function(t){return r+"  "+t}).join("\n")+"\n"+r+"  >":e+"<>"}return e+JSON.stringify(i,null,2).split("\n").map(function(t,e){return 0===e?t:r+"  "+t}).join("\n")}).join("\n")+(n.boxes?"\n"+yo(n.boxes,e+1):"")}).join("\n")},vo={inspect:go,textify:yo,parseTfdt:mo.tfdt,parseHdlr:mo.hdlr,parseTfhd:mo.tfhd,parseTrun:mo.trun},_o=ae,bo=di.CaptionStream,To={generator:Ka,probe:Ya,Transmuxer:Vt.Transmuxer,AudioSegmentStream:Vt.AudioSegmentStream,VideoSegmentStream:Vt.VideoSegmentStream,CaptionParser:function(){var e,s,o,u,l,t=!1;this.isInitialized=function(){return t},this.init=function(){e=new bo,t=!0,e.on("data",function(t){t.startTime=t.startPts/u,t.endTime=t.endPts/u,l.captions.push(t),l.captionStreams[t.stream]=!0})},this.isNewInit=function(t,e){return!(t&&0===t.length||e&&"object"==typeof e&&0===Object.keys(e).length)&&(o!==t[0]||u!==e[o])},this.parse=function(t,e,i){var n,r;if(!this.isInitialized())return null;if(!e||!i)return null;if(this.isNewInit(e,i))o=e[0],u=i[o];else if(!o||!u)return s.push(t),null;for(;0<s.length;){var a=s.shift();this.parse(a,e,i)}return n=t,r=u,null!==(r=(t=o)?{seiNals:uo(n,t)[t],timescale:r}:null)&&r.seiNals?(this.pushNals(r.seiNals),this.flushStream(),l):null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach(function(t){e.push(t)})},this.flushStream=function(){if(!this.isInitialized())return null;e.flush()},this.clearParsedCaptions=function(){l.captions=[],l.captionStreams={}},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){s=[],u=o=null,l?this.clearParsedCaptions():l={captions:[],captionStreams:{}},this.resetCaptionStream()},this.reset()}}.CaptionParser,Ht={parseType:function(t,e){t=lo(t);return 0===t?"pat":t===e?"pmt":e?"pes":null},parsePat:function(t){var e=co(t),i=4+ho(t);return e&&(i+=t[i]+1),(31&t[i+10])<<8|t[i+11]},parsePmt:function(t){var e={},i=co(t),n=4+ho(t);if(i&&(n+=t[n]+1),1&t[n+5]){for(var r=3+((15&t[n+1])<<8|t[n+2])-4,a=12+((15&t[n+10])<<8|t[n+11]);a<r;){var s=n+a;e[(31&t[s+1])<<8|t[s+2]]=t[s],a+=5+((15&t[s+3])<<8|t[s+4])}return e}},parsePayloadUnitStartIndicator:co,parsePesType:function(t,e){switch(e[lo(t)]){case As.H264_STREAM_TYPE:return"video";case As.ADTS_STREAM_TYPE:return"audio";case As.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(t){if(!co(t))return null;var e=4+ho(t);if(e>=t.byteLength)return null;var i=null,n=t[e+7];return 192&n&&((i={}).pts=(14&t[e+9])<<27|(255&t[e+10])<<20|(254&t[e+11])<<12|(255&t[e+12])<<5|(254&t[e+13])>>>3,i.pts*=4,i.pts+=(6&t[e+13])>>>1,i.dts=i.pts,64&n&&(i.dts=(14&t[e+14])<<27|(255&t[e+15])<<20|(254&t[e+16])<<12|(255&t[e+17])<<5|(254&t[e+18])>>>3,i.dts*=4,i.dts+=(6&t[e+18])>>>1)),i},videoPacketContainsKeyFrame:function(t){for(var e=4+ho(t),i=t.subarray(e),n=0,r=0,a=!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"===po(31&i[r+3])&&(a=!0);n++,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"===po(31&i[r+3])&&(a=!0),r=n-2,n+=3;break;default:n+=3}return i=i.subarray(r),n-=r,r=0,i&&3<i.byteLength&&"slice_layer_without_partitioning_rbsp_idr"===po(31&i[r+3])&&(a=!0),a}},So=Ga,ko={};ko.ts=Ht,ko.aac=Ys;function wo(t,e,i){for(var n,r,a,s,o=0,u=Eo,l=!1;u<=t.byteLength;)if(71!==t[o]||71!==t[u]&&u!==t.byteLength)o++,u++;else{if(n=t.subarray(o,u),"pes"===ko.ts.parseType(n,e.pid)&&(r=ko.ts.parsePesType(n,e.table),a=ko.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&a&&(s=ko.ts.parsePesTime(n))&&(s.type="audio",i.audio.push(s),l=!0)),l)break;o+=Eo,u+=Eo}for(o=(u=t.byteLength)-Eo,l=!1;0<=o;)if(71!==t[o]||71!==t[u]&&u!==t.byteLength)o--,u--;else{if(n=t.subarray(o,u),"pes"===ko.ts.parseType(n,e.pid)&&(r=ko.ts.parsePesType(n,e.table),a=ko.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&a&&(s=ko.ts.parsePesTime(n))&&(s.type="audio",i.audio.push(s),l=!0)),l)break;o-=Eo,u-=Eo}}function Co(t){var e,i={pid:null,table:null},n={};for(e in!function(t,e){for(var i,n=0,r=Eo;r<t.byteLength;)if(71!==t[n]||71!==t[r])n++,r++;else{switch(i=t.subarray(n,r),ko.ts.parseType(i,e.pid)){case"pat":e.pid||(e.pid=ko.ts.parsePat(i));break;case"pmt":e.table||(e.table=ko.ts.parsePmt(i))}if(e.pid&&e.table)return;n+=Eo,r+=Eo}}(t,i),i.table)if(i.table.hasOwnProperty(e))switch(i.table[e]){case As.H264_STREAM_TYPE:n.video=[],function(t,e,i){for(var n,r,a,s,o,u,l,c,h=0,d=Eo,p=!1,f={data:[],size:0};d<t.byteLength;)if(71!==t[h]||71!==t[d])h++,d++;else{if(n=t.subarray(h,d),r=ko.ts.parseType(n,e.pid),"pes"===r)if(a=ko.ts.parsePesType(n,e.table),s=ko.ts.parsePayloadUnitStartIndicator(n),"video"===a&&(s&&!p&&(o=ko.ts.parsePesTime(n))&&(o.type="video",i.video.push(o),p=!0),!i.firstKeyFrame)){if(s&&0!==f.size){for(u=new Uint8Array(f.size),l=0;f.data.length;)c=f.data.shift(),u.set(c,l),l+=c.byteLength;ko.ts.videoPacketContainsKeyFrame(u)&&(i.firstKeyFrame=ko.ts.parsePesTime(u),i.firstKeyFrame.type="video"),f.size=0}f.data.push(n),f.size+=n.byteLength}if(p&&i.firstKeyFrame)break;h+=Eo,d+=Eo}for(h=(d=t.byteLength)-Eo,p=!1;0<=h;)if(71!==t[h]||71!==t[d])h--,d--;else{if(n=t.subarray(h,d),"pes"===(r=ko.ts.parseType(n,e.pid))&&(a=ko.ts.parsePesType(n,e.table),s=ko.ts.parsePayloadUnitStartIndicator(n),"video"===a&&s&&(o=ko.ts.parsePesTime(n))&&(o.type="video",i.video.push(o),p=!0)),p)break;h-=Eo,d-=Eo}}(t,i,n),0===n.video.length&&delete n.video;break;case As.ADTS_STREAM_TYPE:n.audio=[],wo(t,i,n),0===n.audio.length&&delete n.audio}return n}var Eo=188,Xa=function(t,e){var i,n,r=(ko.aac.isLikelyAacData(t)?function(t){for(var e,i=!1,n=0,r=null,a=null,s=0,o=0;3<=t.length-o;){switch(ko.aac.parseType(t,o)){case"timed-metadata":if(t.length-o<10){i=!0;break}if((s=ko.aac.parseId3TagSize(t,o))>t.length){i=!0;break}null===a&&(e=t.subarray(o,o+s),a=ko.aac.parseAacTimestamp(e)),o+=s;break;case"audio":if(t.length-o<7){i=!0;break}if((s=ko.aac.parseAdtsSize(t,o))>t.length){i=!0;break}null===r&&(e=t.subarray(o,o+s),r=ko.aac.parseSampleRate(e)),n++,o+=s;break;default:o++}if(i)return null}if(null===r||null===a)return null;var u=9e4/r;return{audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+1024*n*u,pts:a+1024*n*u}]}}:Co)(t);return r&&(r.audio||r.video)?(t=e,(e=r).audio&&e.audio.length&&(void 0===(i=t)&&(i=e.audio[0].dts),e.audio.forEach(function(t){t.dts=So(t.dts,i),t.pts=So(t.pts,i),t.dtsTime=t.dts/9e4,t.ptsTime=t.pts/9e4})),e.video&&e.video.length&&(void 0===(n=t)&&(n=e.video[0].dts),e.video.forEach(function(t){t.dts=So(t.dts,n),t.pts=So(t.pts,n),t.dtsTime=t.dts/9e4,t.ptsTime=t.pts/9e4}),e.firstKeyFrame&&((e=e.firstKeyFrame).dts=So(e.dts,n),e.pts=So(e.pts,n),e.dtsTime=e.dts/9e4,e.ptsTime=e.dts/9e4)),r):null};var Ao=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},rr=function(t,e,i){return e&&Lo(t.prototype,e),i&&Lo(t,i),t};function Lo(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Oo=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},Po=function(){for(var t,e,i,n=[[[],[],[],[],[]],[[],[],[],[],[]]],r=n[0],a=n[1],s=r[4],o=a[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;!s[l];l^=t||1,c=d[c]||1)for(i=(i=c^c<<1^c<<2^c<<3^c<<4)>>8^255&i^99,f=16843009*h[e=h[t=h[o[s[l]=i]=l]]]^65537*e^257*t^16843008*l,p=257*h[i]^16843008*i,u=0;u<4;u++)r[u][l]=p=p<<24^p>>>8,a[u][i]=f=f<<24^f>>>8;for(u=0;u<5;u++)r[u]=r[u].slice(0),a[u]=a[u].slice(0);return n},Uo=null,Io=(xo.prototype.decrypt=function(t,e,i,n,r,a){for(var s,o,u=this._key[1],l=t^u[0],c=n^u[1],h=i^u[2],d=e^u[3],p=void 0,f=u.length/4-2,m=void 0,g=4,e=this._tables[1],y=e[0],v=e[1],_=e[2],b=e[3],T=e[4],m=0;m<f;m++)p=y[l>>>24]^v[c>>16&255]^_[h>>8&255]^b[255&d]^u[g],s=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=s,h=o;for(m=0;m<4;m++)r[(3&-m)+a]=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},xo);function xo(t){Ao(this,xo),Uo=Uo||Po(),this._tables=[[Uo[0][0].slice(),Uo[0][1].slice(),Uo[0][2].slice(),Uo[0][3].slice(),Uo[0][4].slice()],[Uo[1][0].slice(),Uo[1][1].slice(),Uo[1][2].slice(),Uo[1][3].slice(),Uo[1][4].slice()]];var e=void 0,i=void 0,n=void 0,r=void 0,a=void 0,s=this._tables[0][4],o=this._tables[1],u=t.length,l=1;if(4!==u&&6!==u&&8!==u)throw new Error("Invalid aes key size");for(r=t.slice(0),a=[],this._key=[r,a],e=u;e<4*u+28;e++)n=r[e-1],(e%u==0||8===u&&e%u==4)&&(n=s[n>>>24]<<24^s[n>>16&255]<<16^s[n>>8&255]<<8^s[255&n],e%u==0&&(n=n<<8^n>>>24^l<<24,l=l<<1^283*(l>>7))),r[e]=r[e-u]^n;for(i=0;e;i++,e--)n=r[3&i?e:e-4],a[i]=e<=4||i<4?n:o[0][s[n>>>24]]^o[1][s[n>>16&255]]^o[2][s[n>>8&255]]^o[3][s[255&n]]}var Do=(Ro.prototype.on=function(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e)},Ro.prototype.off=function(t,e){if(!this.listeners[t])return!1;e=this.listeners[t].indexOf(e);return this.listeners[t].splice(e,1),-1<e},Ro.prototype.trigger=function(t){var e=this.listeners[t];if(e)if(2===arguments.length)for(var i=e.length,n=0;n<i;++n)e[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),a=e.length,s=0;s<a;++s)e[s].apply(this,r)},Ro.prototype.dispose=function(){this.listeners={}},Ro.prototype.pipe=function(e){this.on("data",function(t){e.push(t)})},Ro);function Ro(){Ao(this,Ro),this.listeners={}}var Mo,Bo=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(No,Mo=Do),No.prototype.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},No.prototype.push=function(t){this.jobs.push(t),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},No);function No(){Ao(this,No);var t=Oo(this,Mo.call(this,Do));return t.jobs=[],t.delay=1,t.timeout_=null,t}function jo(t,e,i){for(var n,r,a,s,o=new Int32Array(t.buffer,t.byteOffset,t.byteLength>>2),u=new Io(Array.prototype.slice.call(e)),t=new Uint8Array(t.byteLength),l=new Int32Array(t.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=Fo(o[f]),r=Fo(o[f+1]),a=Fo(o[f+2]),s=Fo(o[f+3]),u.decrypt(n,r,a,s,l,f),l[f]=Fo(l[f]^c),l[f+1]=Fo(l[f+1]^h),l[f+2]=Fo(l[f+2]^d),l[f+3]=Fo(l[f+3]^p),c=n,h=r,d=a,p=s;return t}var Fo=function(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24},qe=(Vo.prototype.decryptChunk_=function(e,i,n,r){return function(){var t=jo(e,i,n);r.set(t,e.byteOffset)}},rr(Vo,null,[{key:"STEP",get:function(){return 32e3}}]),Vo);function Vo(t,e,i,n){Ao(this,Vo);var r=Vo.STEP,a=new Int32Array(t.buffer),s=new Uint8Array(t.byteLength),o=0;for(this.asyncStream_=new Bo,this.asyncStream_.push(this.decryptChunk_(a.subarray(o,o+r),e,i,s)),o=r;o<a.length;o+=r)i=new Uint32Array([Fo(a[o-4]),Fo(a[o-3]),Fo(a[o-2]),Fo(a[o-1])]),this.asyncStream_.push(this.decryptChunk_(a.subarray(o,o+r),e,i,s));this.asyncStream_.push(function(){var t;n(null,(t=s).subarray(0,t.byteLength-t[t.byteLength-1]))})}var Ho=function(t,e){return/^[a-z]+:/i.test(e)?e:(/\/\//i.test(t)||(t=er.buildAbsoluteURL(d.location.href,t)),er.buildAbsoluteURL(t,e))},qo=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},ae=function(t,e,i){return e&&zo(t.prototype,e),i&&zo(t,i),t};function zo(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Wo(t,e,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0!==n){if("value"in n)return n.value;n=n.get;return void 0!==n?n.call(i):void 0}if(t=Object.getPrototypeOf(t),null!==t)return Wo(t,e,i)}function Go(r,a){["AUDIO","SUBTITLES"].forEach(function(t){for(var e in r.mediaGroups[t])for(var i in r.mediaGroups[t][e]){var n=r.mediaGroups[t][e][i];a(n,t,e,i)}})}function Xo(t,e){var i=Zo(t,{});if(!(t=i.playlists[e.uri]))return null;if(t.segments&&e.segments&&t.segments.length===e.segments.length&&t.mediaSequence===e.mediaSequence)return null;var n=Zo(t,e);t.segments&&(n.segments=function(t,e,i){var n=e.slice();i=i||0;for(var r=Math.min(t.length,e.length+i),a=i;a<r;a++)n[a-i]=Zo(t[a],n[a-i]);return n}(t.segments,e.segments,e.mediaSequence-t.mediaSequence)),n.segments.forEach(function(t){var e;e=t,t=n.resolvedUri,e.resolvedUri||(e.resolvedUri=Ho(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=Ho(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=Ho(t,e.map.uri))});for(var r=0;r<i.playlists.length;r++)i.playlists[r].uri===e.uri&&(i.playlists[r]=n);return i.playlists[e.uri]=n,i}function Yo(t){for(var e=t.playlists.length;e--;){var i=t.playlists[e];(t.playlists[i.uri]=i).resolvedUri=Ho(t.uri,i.uri),i.id=e,i.attributes||(i.attributes={},tu.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute."))}}function $o(e){Go(e,function(t){t.uri&&(t.resolvedUri=Ho(e.uri,t.uri))})}function Ko(t,e){var i=t.segments[t.segments.length-1];return e&&i&&i.duration?1e3*i.duration:500*(t.targetDuration||10)}var di=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},Qo=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},Jo=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var i=[],n=!0,r=!1,a=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){r=!0,a=t}finally{try{!n&&o.return&&o.return()}finally{if(r)throw a}}return i}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},Zo=tr.mergeOptions,Vt=tr.EventTarget,tu=tr.log,eu=(di(iu,Vt),ae(iu,[{key:"playlistRequestError",value:function(t,e,i){this.request=null,i&&(this.state=i),this.error={playlist:this.master.playlists[e],status:t.status,message:"HLS playlist request error at URL: "+e,responseText:t.responseText,code:500<=t.status?4:2},this.trigger("error")}},{key:"haveMetadata",value:function(t,e){var i=this;this.request=null,this.state="HAVE_METADATA";var n=new mr;n.push(t.responseText),n.end(),n.manifest.uri=e,n.manifest.attributes=n.manifest.attributes||{};e=Xo(this.master,n.manifest);this.targetDuration=n.manifest.targetDuration,e?(this.master=e,this.media_=this.master.playlists[n.manifest.uri]):this.trigger("playlistunchanged"),this.media().endList||(d.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=d.setTimeout(function(){i.trigger("mediaupdatetimeout")},Ko(this.media(),!!e))),this.trigger("loadedplaylist")}},{key:"dispose",value:function(){this.stopRequest(),d.clearTimeout(this.mediaUpdateTimeout)}},{key:"stopRequest",value:function(){var t;this.request&&(t=this.request,this.request=null,t.onreadystatechange=null,t.abort())}},{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 t=!this.media_||i.uri!==this.media_.uri;if(this.master.playlists[i.uri].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(Ho(this.master.uri,i.uri)===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:Ho(this.master.uri,i.uri),withCredentials:this.withCredentials},function(t,e){if(n.request){if(t)return n.playlistRequestError(n.request,i.uri,r);n.haveMetadata(e,i.uri),"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(t){var e=this;d.clearTimeout(this.mediaUpdateTimeout);var i=this.media();t?(t=i?i.targetDuration/2*1e3:5e3,this.mediaUpdateTimeout=d.setTimeout(function(){return e.load()},t)):this.started?i&&!i.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}},{key:"start",value:function(){var i=this;this.started=!0,this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},function(t,e){if(i.request){if(i.request=null,t)return i.error={status:e.status,message:"HLS playlist request error at URL: "+i.srcUrl,responseText:e.responseText,code:2},"HAVE_NOTHING"===i.state&&(i.started=!1),i.trigger("error");t=new mr;return(t.push(e.responseText),t.end(),i.state="HAVE_MASTER",t.manifest.uri=i.srcUrl,t.manifest.playlists)?(i.master=t.manifest,Yo(i.master),$o(i.master),i.trigger("loadedplaylist"),void(i.request||i.media(t.manifest.playlists[0]))):(i.master={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:d.location.href,playlists:[{uri:i.srcUrl,id:0}]},i.master.playlists[i.srcUrl]=i.master.playlists[0],i.master.playlists[0].resolvedUri=i.srcUrl,i.master.playlists[0].attributes=i.master.playlists[0].attributes||{},i.haveMetadata(e,i.srcUrl),i.trigger("loadedmetadata"))}})}}]),iu);function iu(t,e,i){qo(this,iu);var n=Qo(this,(iu.__proto__||Object.getPrototypeOf(iu)).call(this));if(n.srcUrl=t,n.hls_=e,n.withCredentials=i,!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:Ho(n.master.uri,n.media().uri),withCredentials:n.withCredentials},function(t,e){if(n.request)return t?n.playlistRequestError(n.request,n.media().uri,"HAVE_METADATA"):void n.haveMetadata(n.request,n.media().uri)}))}),n}function nu(t,e,i){var n;return void 0===e&&(e=t.mediaSequence+t.segments.length),e<t.mediaSequence?0:(n=function(t,e){var i=0,n=e-t.mediaSequence,r=t.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=t.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}}(t,e)).precise?n.result:(e=function(t,e){for(var i,n=0,r=e-t.mediaSequence;r<t.segments.length;r++){if(void 0!==(i=t.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}}(t,e)).precise?e.result:n.result+i}function ru(t,e,i){if(!t)return 0;if("number"!=typeof i&&(i=0),void 0===e){if(t.totalDuration)return t.totalDuration;if(!t.endList)return d.Infinity}return nu(t,e,i)}function au(t,e,i){var n,r=0;if(i<e&&(e=(n=[i,e])[0],i=n[1]),e<0){for(var a=e;a<Math.min(0,i);a++)r+=t.targetDuration;e=0}for(var s=e;s<i;s++)r+=t.segments[s].duration;return r}function su(t){if(!t.segments.length)return 0;for(var e=t.segments.length-1,i=t.segments[e].duration||t.targetDuration,n=i+2*t.targetDuration;e--&&!(n<=(i+=t.segments[e].duration)););return Math.max(0,e)}function ou(t,e,i){return t&&t.segments?t.endList?ru(t):null===e?null:(e=e||0,i=i?su(t):t.segments.length,nu(t,t.mediaSequence+i,e)):null}function uu(t){return t-Math.floor(t)==0}function lu(t){return t.excludeUntil&&t.excludeUntil>Date.now()}function cu(t){return t.excludeUntil&&t.excludeUntil===1/0}function hu(t){var e=lu(t);return!t.disabled&&!e}function du(t,e){return e.attributes&&e.attributes[t]}function pu(t,e){if(1===t.playlists.length)return!0;var i=e.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===t.playlists.filter(function(t){return!!hu(t)&&(t.attributes.BANDWIDTH||0)<i}).length}function fu(){return function t(e,n){e=Mu({timeout:45e3},e);var i=t.beforeRequest||tr.Hls.xhr.beforeRequest;!i||"function"!=typeof i||(i=i(e))&&(e=i);var r=Ru(e,function(t,e){var i=r.response;!t&&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))),e.headers&&(r.responseHeaders=e.headers),t&&"ETIMEDOUT"===t.code&&(r.timedout=!0),t||r.aborted||200===e.statusCode||206===e.statusCode||0===e.statusCode||(t=new Error("XHR Failed with a response of: "+(r&&(i||r.responseText)))),n(t,r)}),a=r.abort;return r.abort=function(){return r.aborted=!0,a.apply(r,arguments)},r.uri=e.uri,r.requestTime=Date.now(),r}}function mu(t,e){return t=t.toString(16),"00".substring(0,2-t.length)+t+(e%2?" ":"")}function gu(t){return 32<=t&&t<126?String.fromCharCode(t):"."}function yu(i){var n={};return Object.keys(i).forEach(function(t){var e=i[t];ArrayBuffer.isView(e)?n[t]={bytes:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength}:n[t]=e}),n}function vu(t){var e=t.byterange||{length:1/0,offset:0};return[e.length,e.offset,t.resolvedUri].join(",")}function _u(t){for(var e=Array.prototype.slice.call(t),i="",n=0;n<e.length/16;n++)i+=e.slice(16*n,16*n+16).map(mu).join("")+" "+e.slice(16*n,16*n+16).map(gu).join("")+"\n";return i}function bu(t,e,i,n){var r=void 0;if("stream"===e){r=new Date(1e3*n+i.getTime());var a=t.toISOString(),s=i.toISOString(),o=r.toISOString();return s<=a&&a<=o}if("player"===e)return r=n+i,i<=t&&t<=r}function Tu(t,e,i){if(!i.segments||0===i.segments.length)return null;if("player"!==e&&"stream"!==e)return null;for(var n=0,r=0;r<i.segments.length;r++){var a=i.segments[r],s=n+a.duration,o=void 0,u=void 0,u="player"===e?(o=a.start,n):(o=a.dateTimeObject,a.dateTimeObject),l=void 0!==a.start&&void 0!==a.end&&bu(t,e,o,a.end-a.start),o=bu(t,e,u,a.duration);if(l)return{segment:a,estimatedStart:u,type:"accurate"};if(o)return{segment:a,estimatedStart:u,type:"estimate"};n=s}return null}function Su(t){var e=t.playlist,i=void 0===(i=t.time)?void 0:i;if(!(t=t.callback))throw new Error("getStreamTime: callback must be provided");return e&&void 0!==i?(e=Tu(i,"player",e))?"estimate"===e.type?t({message:"Accurate streamTime could not be determined. Please seek to e.seekTime and try again",seekTime:e.estimatedStart}):(i={mediaSeconds:i},e.segment.dateTimeObject&&(i.programDateTime=e.segment.dateTimeObject.toISOString()),t(null,i)):t({message:"valid streamTime was not found"}):t({message:"getStreamTime: playlist and time must be provided"})}function ku(t){var e=t.streamTime,i=t.playlist,n=void 0===(a=t.retryCount)?2:a,r=t.seekTo,a=void 0===(a=t.pauseAfterSeek)||a,s=t.tech,o=t.callback;if(!o)throw new Error("seekToStreamTime: callback must be provided");return void 0!==e&&i&&r?i.endList||s.hasStarted_?function(t){if(!t.segments||0===t.segments.length)return!1;for(var e=0;e<t.segments.length;e++)if(!t.segments[e].dateTimeObject)return!1;return!0}(i)?(t=function(t,e){var i=void 0;try{i=new Date(t)}catch(t){return null}return Tu(i,"stream",e)}(e,i))?"estimate"===t.type?0===n?o({message:e+" is not buffered yet. Try again"}):ku({streamTime:e,playlist:i,retryCount:n-1,seekTo:r,pauseAfterSeek:a,tech:s,callback:o}):(t=t.segment,e=function(t,e){var i=void 0,n=void 0;try{i=new Date(t),n=new Date(e)}catch(t){}var r=i.getTime();return(n.getTime()-r)/1e3}(t.dateTimeObject,e),e=t.start+e,s.one("seeked",function(){return o(null,s.currentTime())}),a&&s.pause(),void r(e)):o({message:e+" was not found in the stream"}):o({message:"programDateTime tags must be provided in the manifest "+i.resolvedUri}):o({message:"player must be playing a live stream to start buffering"}):o({message:"seekToStreamTime: streamTime, seekTo and playlist must be provided"})}function wu(t,e){var i=[],n=void 0;if(t&&t.length)for(n=0;n<t.length;n++)e(t.start(n),t.end(n))&&i.push([t.start(n),t.end(n)]);return tr.createTimeRanges(i)}function Cu(t,i){return wu(t,function(t,e){return t-Bu<=i&&i<=e+Bu})}function Eu(t,e){return wu(t,function(t){return e<=t-Bu})}function Au(t){var e=[];if(!t||!t.length)return"";for(var i=0;i<t.length;i++)e.push(t.start(i)+" => "+t.end(i));return e.join(", ")}function Lu(t){for(var e=[],i=0;i<t.length;i++)e.push({start:t.start(i),end:t.end(i)});return e}function Ou(t,e,i){var n,r=void 0;if(i&&i.cues)for(r=i.cues.length;r--;)(n=i.cues[r]).startTime<=e&&n.endTime>=t&&i.removeCue(n)}function Pu(t,e,i){var r=d.WebKitDataCue||d.VTTCue;if(e&&e.forEach(function(t){var e=t.stream;this.inbandTextTracks_[e].addCue(new r(t.startTime+this.timestampOffset,t.endTime+this.timestampOffset,t.text))},t),i){var n=Nu(t.mediaSource_.duration);if(i.forEach(function(t){var n=t.cueTime+this.timestampOffset;t.frames.forEach(function(t){var e,i=new r(n,n,t.value||t.url||t.data||"");i.frame=t,i.value=t,e=i,Object.defineProperties(e.frame,{id:{get:function(){return tr.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return tr.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return tr.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}}),this.metadataTrack_.addCue(i)},this)},t),t.metadataTrack_&&t.metadataTrack_.cues&&t.metadataTrack_.cues.length){for(var a=t.metadataTrack_.cues,s=[],o=0;o<a.length;o++)a[o]&&s.push(a[o]);var u=s.reduce(function(t,e){var i=t[e.startTime]||[];return i.push(e),t[e.startTime]=i,t},{}),l=Object.keys(u).sort(function(t,e){return Number(t)-Number(e)});l.forEach(function(t,e){var t=u[t],i=Number(l[e+1])||n;t.forEach(function(t){t.endTime=i})})}}}var Uu=tr.createTimeRange,Ga=function(t,e){if(uu(e))return e+.1*t;for(var i=e.toString().split(".")[1].length,n=1;n<=i;n++){var r=Math.pow(10,n),a=e*r;if(uu(a)||n===i)return(a+t)/r}},Iu=Ga.bind(null,1),xu=Ga.bind(null,-1),Du={duration:ru,seekable:function(t,e){var i=e||0,e=ou(t,e,!0);return null===e?Uu():Uu(i,e)},safeLiveIndex:su,getMediaInfoForTime:function(t,e,i,n){var r=void 0,a=void 0,s=t.segments.length,o=e-n;if(o<0){if(0<i)for(r=i-1;0<=r;r--)if(a=t.segments[r],0<(o+=xu(a.duration)))return{mediaIndex:r,startTime:n-au(t,i,r)};return{mediaIndex:0,startTime:e}}if(i<0){for(r=i;r<0;r++)if((o-=t.targetDuration)<0)return{mediaIndex:0,startTime:e};i=0}for(r=i;r<s;r++)if(a=t.segments[r],(o-=Iu(a.duration))<0)return{mediaIndex:r,startTime:n+au(t,i,r)};return{mediaIndex:s-1,startTime:e}},isEnabled:hu,isDisabled:function(t){return t.disabled},isBlacklisted:lu,isIncompatible:cu,playlistEnd:ou,isAes:function(t){for(var e=0;e<t.segments.length;e++)if(t.segments[e].key)return!0;return!1},isFmp4:function(t){for(var e=0;e<t.segments.length;e++)if(t.segments[e].map)return!0;return!1},hasAttribute:du,estimateSegmentRequestTime:function(t,e,i){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0;return du("BANDWIDTH",i)?(t*i.attributes.BANDWIDTH-8*n)/e:NaN},isLowestEnabledRendition:pu},Ru=tr.xhr,Mu=tr.mergeOptions,Ht=Object.freeze({createTransferableMessage:yu,initSegmentId:vu,hexDump:_u,tagDump:function(t){t=t.bytes;return _u(t)},textRanges:function(t){for(var e,i,n="",r=void 0,r=0;r<t.length;r++)n+=(i=r,(e=t).start(i)+"-"+e.end(i)+" ");return n}}),Bu=1/30,Nu=function(t){return isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t},rr="undefined"!=typeof window?window:{},ju="undefined"==typeof Symbol?"__target":Symbol(),Fu="application/javascript",Vu=rr.BlobBuilder||rr.WebKitBlobBuilder||rr.MozBlobBuilder||rr.MSBlobBuilder,Hu=rr.URL||rr.webkitURL||Hu&&Hu.msURL,qu=rr.Worker;function zu(a,s){return function(t){var e=this;if(!s)return new qu(a);if(qu&&!t){t=Yu(s.toString().replace(/^function.+?{/,"").slice(0,-1));return this[ju]=new qu(t),i=this[ju],t=t,i&&t&&(n=i.terminate,i.objURL=t,i.terminate=function(){i.objURL&&Hu.revokeObjectURL(i.objURL),n.call(i)}),this[ju]}var i,n,r={postMessage:function(t){e.onmessage&&setTimeout(function(){e.onmessage({data:t,target:r})})}};s.call(r),this.postMessage=function(t){setTimeout(function(){r.onmessage({data:t,target:e})})},this.isThisThread=!0}}if(qu){var Wu,Gu=Yu("self.onmessage = function () {}"),Xu=new Uint8Array(1);try{(Wu=new qu(Gu)).postMessage(Xu,[Xu.buffer])}catch(t){qu=null}finally{Hu.revokeObjectURL(Gu),Wu&&Wu.terminate()}}function Yu(e){try{return Hu.createObjectURL(new Blob([e],{type:Fu}))}catch(t){var i=new Vu;return i.append(e),Hu.createObjectURL(i.getBlob(type))}}function $u(t){return t.map(function(t){return t.replace(/avc1\.(\d+)\.(\d+)/i,function(t,e,i){return"avc1."+("00"+Number(e).toString(16)).slice(-2)+"00"+("00"+Number(i).toString(16)).slice(-2)})})}function Ku(){var t,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",i={codecCount:0};return i.codecCount=e.split(",").length,i.codecCount=i.codecCount||2,(t=/(^|\s|,)+(avc[13])([^ ,]*)/i.exec(e))&&(i.videoCodec=t[2],i.videoObjectTypeIndicator=t[3]),i.audioProfile=/(^|\s|,)+mp4a.[0-9A-Fa-f]+\.([0-9A-Fa-f]+)/i.exec(e),i.audioProfile=i.audioProfile&&i.audioProfile[2],i}function Qu(t,e,i){return t+"/"+e+'; codecs="'+i.filter(function(t){return!!t}).join(", ")+'"'}function Ju(t,e){var i=(s=e).segments&&s.segments.length&&s.segments[0].map?"mp4":"mp2t",n=function(t){t=t.attributes||{};return t.CODECS?Ku(t.CODECS):el}(e),r=e.attributes||{},a=!0,s=!1;if(!e)return[];if(t.mediaGroups.AUDIO&&r.AUDIO){var o=t.mediaGroups.AUDIO[r.AUDIO];if(o)for(var u in a=!(s=!0),o)if(!o[u].uri&&!o[u].playlists){a=!0;break}}return s&&!n.audioProfile&&(a||(n.audioProfile=function(t,e){if(!t.mediaGroups.AUDIO||!e)return null;var i,n=t.mediaGroups.AUDIO[e];if(!n)return null;for(i in n){var r=n[i];if(r.default&&r.playlists)return Ku(r.playlists[0].attributes.CODECS).audioProfile}return null}(t,r.AUDIO)),n.audioProfile||(tr.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=el.audioProfile)),t={},n.videoCodec&&(t.video=""+n.videoCodec+n.videoObjectTypeIndicator),n.audioProfile&&(t.audio="mp4a.40."+n.audioProfile),r=Qu("audio",i,[t.audio]),n=Qu("video",i,[t.video]),i=Qu("video",i,[t.video,t.audio]),s?!a&&t.video?[n,r]:a||t.video?[i,r]:[r,r]:t.video?[i]:[r]}function Zu(t,e){var i,n=t.addSourceBuffer(e),r=Object.create(null);for(i in r.updating=!1,r.realBuffer_=n)!function(e){"function"==typeof n[e]?r[e]=function(){return n[e].apply(n,arguments)}:void 0===r[e]&&Object.defineProperty(r,e,{get:function(){return n[e]},set:function(t){return n[e]=t}})}(i);return r}var tl=new zu("./transmuxer-worker.worker.js",function(t,e){var _e=this;!function(){var s,e,i,n,r,a,o,u,l,c,h,d,p,f,m,g,y,v,_,b,T,S,k,w,C,E,A,L,O,P,U,I,x,D,R,M,B,N,j,F=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:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(var t in T)T.hasOwnProperty(t)&&(T[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);S=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),w=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),k=new Uint8Array([0,0,0,1]),C=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]),E=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:C,audio:E},P=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),O=new Uint8Array([0,0,0,0,0,0,0,0]),U=new Uint8Array([0,0,0,0,0,0,0,0]),I=U,x=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),D=U,L=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),s=function(t){for(var e,i=[],n=0,r=1;r<arguments.length;r++)i.push(arguments[r]);for(r=i.length;r--;)n+=i[r].byteLength;for(e=new Uint8Array(n+8),new DataView(e.buffer,e.byteOffset,e.byteLength).setUint32(0,e.byteLength),e.set(t,4),r=0,n=8;r<i.length;r++)e.set(i[r],n),n+=i[r].byteLength;return e},e=function(){return s(T.dinf,s(T.dref,P))},i=function(t){return s(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,t.audioobjecttype<<3|t.samplingfrequencyindex>>>1,t.samplingfrequencyindex<<7|t.channelcount<<3,6,1,2]))},f=function(t){return s(T.hdlr,A[t])},p=function(t){var e=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,t.duration>>>24&255,t.duration>>>16&255,t.duration>>>8&255,255&t.duration,85,196,0,0]);return t.samplerate&&(e[12]=t.samplerate>>>24&255,e[13]=t.samplerate>>>16&255,e[14]=t.samplerate>>>8&255,e[15]=255&t.samplerate),s(T.mdhd,e)},d=function(t){return s(T.mdia,p(t),f(t.type),a(t))},r=function(t){return s(T.mfhd,new Uint8Array([0,0,0,0,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t]))},a=function(t){return s(T.minf,"video"===t.type?s(T.vmhd,L):s(T.smhd,O),e(),g(t))},$=function(t,e){for(var i=[],n=e.length;n--;)i[n]=v(e[n]);return s.apply(null,[T.moof,r(t)].concat(i))},o=function(t){for(var e=t.length,i=[];e--;)i[e]=c(t[e]);return s.apply(null,[T.moov,l(4294967295)].concat(i).concat(u(t)))},u=function(t){for(var e=t.length,i=[];e--;)i[e]=_(t[e]);return s.apply(null,[T.mvex].concat(i))},l=function(t){t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t,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 s(T.mvhd,t)},m=function(t){for(var e,i=t.samples||[],n=new Uint8Array(4+i.length),r=0;r<i.length;r++)e=i[r].flags,n[r+4]=e.dependsOn<<4|e.isDependedOn<<2|e.hasRedundancy;return s(T.sdtp,n)},g=function(t){return s(T.stbl,y(t),s(T.stts,D),s(T.stsc,I),s(T.stsz,x),s(T.stco,U))},y=function(t){return s(T.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),("video"===t.type?R:M)(t))},R=function(t){for(var e=t.sps||[],i=t.pps||[],n=[],r=[],a=0;a<e.length;a++)n.push((65280&e[a].byteLength)>>>8),n.push(255&e[a].byteLength),n=n.concat(Array.prototype.slice.call(e[a]));for(a=0;a<i.length;a++)r.push((65280&i[a].byteLength)>>>8),r.push(255&i[a].byteLength),r=r.concat(Array.prototype.slice.call(i[a]));return s(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&t.width)>>8,255&t.width,(65280&t.height)>>8,255&t.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]),s(T.avcC,new Uint8Array([1,t.profileIdc,t.profileCompatibility,t.levelIdc,255].concat([e.length]).concat(n).concat([i.length]).concat(r))),s(T.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))},M=function(t){return s(T.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&t.channelcount)>>8,255&t.channelcount,(65280&t.samplesize)>>8,255&t.samplesize,0,0,0,0,(65280&t.samplerate)>>8,255&t.samplerate,0,0]),i(t))},h=function(t){t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,0,(4278190080&t.duration)>>24,(16711680&t.duration)>>16,(65280&t.duration)>>8,255&t.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&t.width)>>8,255&t.width,0,0,(65280&t.height)>>8,255&t.height,0,0]);return s(T.tkhd,t)},v=function(t){var e,i=s(T.tfhd,new Uint8Array([0,0,0,58,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),n=Math.floor(t.baseMediaDecodeTime/(1+F)),r=Math.floor(t.baseMediaDecodeTime%(1+F)),n=s(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"===t.type?(e=b(t,92),s(T.traf,i,n,e)):(r=m(t),e=b(t,r.length+92),s(T.traf,i,n,e,r))},c=function(t){return t.duration=t.duration||4294967295,s(T.trak,h(t),d(t))},_=function(t){var e=new Uint8Array([0,0,0,0,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==t.type&&(e[e.length-1]=0),s(T.trex,e)},B=function(t,e){var i=0,n=0,r=0,a=0;return t.length&&(void 0!==t[0].duration&&(i=1),void 0!==t[0].size&&(n=2),void 0!==t[0].flags&&(r=4),void 0!==t[0].compositionTimeOffset&&(a=8)),[0,0,i|n|r|a,1,(4278190080&t.length)>>>24,(16711680&t.length)>>>16,(65280&t.length)>>>8,255&t.length,(4278190080&e)>>>24,(16711680&e)>>>16,(65280&e)>>>8,255&e]},N=function(t,e){for(var i,n=t.samples||[],r=B(n,e+=20+16*n.length),a=0;a<n.length;a++)i=n[a],r=r.concat([(4278190080&i.duration)>>>24,(16711680&i.duration)>>>16,(65280&i.duration)>>>8,255&i.duration,(4278190080&i.size)>>>24,(16711680&i.size)>>>16,(65280&i.size)>>>8,255&i.size,i.flags.isLeading<<2|i.flags.dependsOn,i.flags.isDependedOn<<6|i.flags.hasRedundancy<<4|i.flags.paddingValue<<1|i.flags.isNonSyncSample,61440&i.flags.degradationPriority,15&i.flags.degradationPriority,(4278190080&i.compositionTimeOffset)>>>24,(16711680&i.compositionTimeOffset)>>>16,(65280&i.compositionTimeOffset)>>>8,255&i.compositionTimeOffset]);return s(T.trun,new Uint8Array(r))},j=function(t,e){for(var i,n=t.samples||[],r=B(n,e+=20+8*n.length),a=0;a<n.length;a++)i=n[a],r=r.concat([(4278190080&i.duration)>>>24,(16711680&i.duration)>>>16,(65280&i.duration)>>>8,255&i.duration,(4278190080&i.size)>>>24,(16711680&i.size)>>>16,(65280&i.size)>>>8,255&i.size]);return s(T.trun,new Uint8Array(r))},b=function(t,e){return("audio"===t.type?j:N)(t,e)};var V={ftyp:n=function(){return s(T.ftyp,S,k,S,w)},mdat:function(t){return s(T.mdat,t)},moof:$,moov:o,initSegment:function(t){var e=n(),i=o(t),t=new Uint8Array(e.byteLength+i.byteLength);return t.set(e),t.set(i,e.byteLength),t}},H=function(t){return t>>>0},q=function(t,e){var i,n,r,a=[];if(!e.length)return null;for(i=0;i<t.byteLength;)n=H(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3]),r=z(t.subarray(i+4,i+8)),n=1<n?i+n:t.byteLength,r===e[0]&&(1===e.length?a.push(t.subarray(i+8,n)):(r=q(t.subarray(i+8,n),e.slice(1))).length&&(a=a.concat(r))),i=n;return a},z=function(t){var e="";return e+=String.fromCharCode(t[0]),e+=String.fromCharCode(t[1]),e+=String.fromCharCode(t[2]),e+=String.fromCharCode(t[3])},t=function(t){return q(t,["moov","trak"]).reduce(function(t,e){var i,n,r=q(e,["tkhd"])[0];return r?(i=r[0],r=H(r[n=0===i?12:20]<<24|r[1+n]<<16|r[2+n]<<8|r[3+n]),(e=q(e,["mdia","mdhd"])[0])?(n=0===e[0]?12:20,t[r]=H(e[n]<<24|e[1+n]<<16|e[2+n]<<8|e[3+n]),t):null):null},{})},W=function(n,t){var t=q(t,["moof","traf"]),t=[].concat.apply([],t.map(function(i){return q(i,["tfhd"]).map(function(t){var e=H(t[4]<<24|t[5]<<16|t[6]<<8|t[7]),t=n[e]||9e4,e=q(i,["tfdt"]).map(function(t){var e=t[0],i=H(t[4]<<24|t[5]<<16|t[6]<<8|t[7]);return 1===e&&(i*=Math.pow(2,32),i+=H(t[8]<<24|t[9]<<16|t[10]<<8|t[11])),i})[0];return(e||1/0)/t})})),t=Math.min.apply(null,t);return isFinite(t)?t:0},G=function(t){var t=q(t,["moov","trak"]),n=[];return t.forEach(function(t){var e=q(t,["mdia","hdlr"]),i=q(t,["tkhd"]);e.forEach(function(t,e){t=z(t.subarray(8,12)),e=i[e];"vide"===t&&(e=0===(e=new DataView(e.buffer,e.byteOffset,e.byteLength)).getUint8(0)?e.getUint32(12):e.getUint32(20),n.push(e))})}),n},X={findBox:q,parseType:z,timescale:t,startTime:W,videoTrackIds:G};(et=function(){this.init=function(){var a={};this.on=function(t,e){a[t]||(a[t]=[]),a[t]=a[t].concat(e)},this.off=function(t,e){return!!a[t]&&(e=a[t].indexOf(e),a[t]=a[t].slice(),a[t].splice(e,1),-1<e)},this.trigger=function(t){var e,i,n,r=a[t];if(r)if(2===arguments.length)for(i=r.length,e=0;e<i;++e)r[e].call(this,arguments[1]);else{for(n=[],e=arguments.length,e=1;e<arguments.length;++e)n.push(arguments[e]);for(i=r.length,e=0;e<i;++e)r[e].apply(this,n)}},this.dispose=function(){a={}}}}).prototype.pipe=function(e){return this.on("data",function(t){e.push(t)}),this.on("done",function(t){e.flush(t)}),e},et.prototype.push=function(t){this.trigger("data",t)},et.prototype.flush=function(t){this.trigger("done",t)};var Y,$=et,K=function(t){for(var e,i=[],n=[],r=i.byteLength=0;r<t.length;r++)"access_unit_delimiter_rbsp"===(e=t[r]).nalUnitType?(i.length&&(i.duration=e.dts-i.dts,n.push(i)),(i=[e]).byteLength=e.data.byteLength,i.pts=e.pts,i.dts=e.dts):("slice_layer_without_partitioning_rbsp_idr"===e.nalUnitType&&(i.keyFrame=!0),i.duration=e.dts-i.dts,i.byteLength+=e.data.byteLength,i.push(e));return n.length&&(!i.duration||i.duration<=0)&&(i.duration=n[n.length-1].duration),n.push(i),n},Q=function(t){var e,i,n=[],r=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=t[0].pts,n.dts=t[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=t[0].pts,r.dts=t[0].dts,e=0;e<t.length;e++)(i=t[e]).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},J=function(t){var e;return!t[0][0].keyFrame&&1<t.length&&(e=t.shift(),t.byteLength-=e.byteLength,t.nalCount-=e.nalCount,t[0][0].dts=e.dts,t[0][0].pts=e.pts,t[0][0].duration+=e.duration),t},Z=function(t,e){for(var i,n,r,a,s=e||0,o=[],u=0;u<t.length;u++)for(n=t[u],i=0;i<n.length;i++)a=n[i],r=a,a=void 0,(a={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}).dataOffset=s,a.compositionTimeOffset=r.pts-r.dts,a.duration=r.duration,a.size=4*r.length,a.size+=r.byteLength,r.keyFrame&&(a.flags.dependsOn=2,a.flags.isNonSyncSample=0),s+=a.size,o.push(a);return o},tt=function(t){for(var e,i,n,r,a,s=0,o=t.byteLength,u=t.nalCount,l=new Uint8Array(o+4*u),c=new DataView(l.buffer),h=0;h<t.length;h++)for(n=t[h],e=0;e<n.length;e++)for(r=n[e],i=0;i<r.length;i++)a=r[i],c.setUint32(s,a.data.byteLength),s+=4,l.set(a.data,s),s+=a.data.byteLength;return l},W=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],et={96e3:[t=[33,16,5,32,164,27],[227,64],(G=function(t){for(var e=[];t--;)e.push(0);return e})(154),[56]],88200:[t,[231],G(170),[56]],64e3:[t,[248,192],G(240),[56]],48e3:[t,[255,192],G(268),[55,148,128],G(54),[112]],44100:[t,[255,192],G(268),[55,163,128],G(84),[112]],32e3:[t,[255,192],G(268),[55,234],G(226),[112]],24e3:[t,[255,192],G(268),[55,255,128],G(268),[111,112],G(126),[224]],16e3:[t,[255,192],G(268),[55,255,128],G(268),[111,255],G(269),[223,108],G(195),[1,192]],12e3:[W,G(268),[3,127,248],G(268),[6,255,240],G(268),[13,255,224],G(268),[27,253,128],G(259),[56]],11025:[W,G(268),[3,127,248],G(268),[6,255,240],G(268),[13,255,224],G(268),[27,255,192],G(268),[55,175,128],G(108),[112]],8e3:[W,G(268),[3,121,16],G(47),[7]]},it=(Y=et,Object.keys(Y).reduce(function(t,e){return t[e]=new Uint8Array(Y[e].reduce(function(t,e){return t.concat(e)},[])),t},{})),nt=function(t){return 9e4*t},rt=function(t,e){return t*e},at=function(t){return t/9e4},st=function(t,e){return t/e},ot=function(t,e){return nt(st(t,e))},ut=function(t,e){return rt(at(t),e)},lt=function(t,e,i,n){var r,a,s,o,u,l=0,c=0;if(e.length&&(r=ot(t.baseMediaDecodeTime,t.samplerate),a=Math.ceil(9e4/(t.samplerate/1024)),i&&n&&(s=r-Math.max(i,n),c=(l=Math.floor(s/a))*a),!(l<1||45e3<c))){for(o=(o=it[t.samplerate])||e[0].data,u=0;u<l;u++)e.splice(u,0,{data:o});t.baseMediaDecodeTime-=Math.floor(ut(c,t.samplerate))}},ct=function(t,e,i){return e.minSegmentDts>=i?t:(e.minSegmentDts=1/0,t.filter(function(t){return t.dts>=i&&(e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),e.minSegmentPts=e.minSegmentDts,!0)}))},ht=function(t){for(var e,i=[],n=0;n<t.length;n++)e=t[n],i.push({size:e.data.byteLength,duration:1024});return i},dt=function(t){for(var e,i=0,n=new Uint8Array(function(t){for(var e=0,i=0;i<t.length;i++)e+=t[i].data.byteLength;return e}(t)),r=0;r<t.length;r++)e=t[r],n.set(e.data,i),i+=e.data.byteLength;return n},pt=function(t){delete t.minSegmentDts,delete t.maxSegmentDts,delete t.minSegmentPts,delete t.maxSegmentPts},ft=function(t,e){var i=t.minSegmentDts;return e||(i-=t.timelineStartInfo.dts),e=t.timelineStartInfo.baseMediaDecodeTime,e+=i,e=Math.max(0,e),"audio"===t.type&&(e*=t.samplerate/9e4,e=Math.floor(e)),e},mt=function(t,e){"number"==typeof e.pts&&(void 0===t.timelineStartInfo.pts&&(t.timelineStartInfo.pts=e.pts),void 0===t.minSegmentPts?t.minSegmentPts=e.pts:t.minSegmentPts=Math.min(t.minSegmentPts,e.pts),void 0===t.maxSegmentPts?t.maxSegmentPts=e.pts:t.maxSegmentPts=Math.max(t.maxSegmentPts,e.pts)),"number"==typeof e.dts&&(void 0===t.timelineStartInfo.dts&&(t.timelineStartInfo.dts=e.dts),void 0===t.minSegmentDts?t.minSegmentDts=e.dts:t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),void 0===t.maxSegmentDts?t.maxSegmentDts=e.dts:t.maxSegmentDts=Math.max(t.maxSegmentDts,e.dts))},gt=function(t){for(var e=0,i={payloadType:-1,payloadSize:0},n=0,r=0;e<t.byteLength&&128!==t[e];){for(;255===t[e];)n+=255,e++;for(n+=t[e++];255===t[e];)r+=255,e++;if(r+=t[e++],!i.payload&&4===n){i.payloadType=n,i.payloadSize=r,i.payload=t.subarray(e,e+r);break}e+=r,r=n=0}return i},yt=function(t){return 181!==t.payload[0]||49!=(t.payload[1]<<8|t.payload[2])||"GA94"!==String.fromCharCode(t.payload[3],t.payload[4],t.payload[5],t.payload[6])||3!==t.payload[7]?null:t.payload.subarray(8,t.payload.length-1)},vt=function(t,e){var i,n,r,a,s=[];if(!(64&e[0]))return s;for(n=31&e[0],i=0;i<n;i++)a={type:3&e[2+(r=3*i)],pts:t},4&e[2+r]&&(a.ccData=e[3+r]<<8|e[4+r],s.push(a));return s},t=function(t){for(var e,i,n=t.byteLength,r=[],a=1;a<n-2;)0===t[a]&&0===t[a+1]&&3===t[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return t;e=n-r.length,i=new Uint8Array(e);for(var s=0,a=0;a<e;s++,a++)s===r[0]&&(s++,r.shift()),i[a]=t[s];return i},_t=4;function bt(t){return null===t?"":(t=St[t]||t,String.fromCharCode(t))}function Tt(){for(var t=[],e=15;e--;)t.push("");return t}((W=function t(){t.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new wt(0,0),new wt(0,1),new wt(1,0),new wt(1,1)],this.reset(),this.ccStreams_.forEach(function(t){t.on("data",this.trigger.bind(this,"data")),t.on("done",this.trigger.bind(this,"done"))},this)}).prototype=new $).push=function(t){var e,i;if("sei_rbsp"===t.nalUnitType&&(e=gt(t.escapedRBSP),e.payloadType===_t&&(i=yt(e))))if(t.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(t.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));i=vt(t.pts,i),this.captionPackets_=this.captionPackets_.concat(i),this.latestDts_!==t.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=t.dts}},W.prototype.flush=function(){this.captionPackets_.length?(this.captionPackets_.forEach(function(t,e){t.presortIndex=e}),this.captionPackets_.sort(function(t,e){return t.pts===e.pts?t.presortIndex-e.presortIndex:t.pts-e.pts}),this.captionPackets_.forEach(function(t){t.type<2&&this.dispatchCea608Packet(t)},this),this.captionPackets_.length=0,this.ccStreams_.forEach(function(t){t.flush()},this)):this.ccStreams_.forEach(function(t){t.flush()},this)},W.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(t){t.reset()})},W.prototype.dispatchCea608Packet=function(t){this.setsChannel1Active(t)?this.activeCea608Channel_[t.type]=0:this.setsChannel2Active(t)&&(this.activeCea608Channel_[t.type]=1),null!==this.activeCea608Channel_[t.type]&&this.ccStreams_[(t.type<<1)+this.activeCea608Channel_[t.type]].push(t)},W.prototype.setsChannel1Active=function(t){return 4096==(30720&t.ccData)},W.prototype.setsChannel2Active=function(t){return 6144==(30720&t.ccData)};var St={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},kt=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],wt=function t(e,i){t.prototype.init.call(this),this.field_=e||0,this.dataChannel_=i||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(t){var e,i,n,r,a=32639&t.ccData;a!==this.lastControlCode_?(4096==(61440&a)?this.lastControlCode_=a:a!==this.PADDING_&&(this.lastControlCode_=null),e=a>>>8,i=255&a,a===this.PADDING_||(a===this.RESUME_CAPTION_LOADING_?this.mode_="popOn":a===this.END_OF_CAPTION_?(this.mode_="popOn",this.clearFormatting(t.pts),this.flushDisplayed(t.pts),r=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=r,this.startPts_=t.pts):a===this.ROLL_UP_2_ROWS_?(this.rollUpRows_=2,this.setRollUp(t.pts)):a===this.ROLL_UP_3_ROWS_?(this.rollUpRows_=3,this.setRollUp(t.pts)):a===this.ROLL_UP_4_ROWS_?(this.rollUpRows_=4,this.setRollUp(t.pts)):a===this.CARRIAGE_RETURN_?(this.clearFormatting(t.pts),this.flushDisplayed(t.pts),this.shiftRowsUp_(),this.startPts_=t.pts):a===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):a===this.ERASE_DISPLAYED_MEMORY_?(this.flushDisplayed(t.pts),this.displayed_=Tt()):a===this.ERASE_NON_DISPLAYED_MEMORY_?this.nonDisplayed_=Tt():a===this.RESUME_DIRECT_CAPTIONING_?("paintOn"!==this.mode_&&(this.flushDisplayed(t.pts),this.displayed_=Tt()),this.mode_="paintOn",this.startPts_=t.pts):this.isSpecialCharacter(e,i)?(n=bt((e=(3&e)<<8)|i),this[this.mode_](t.pts,n),this.column_++):this.isExtCharacter(e,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=bt((e=(3&e)<<8)|i),this[this.mode_](t.pts,n),this.column_++):this.isMidRowCode(e,i)?(this.clearFormatting(t.pts),this[this.mode_](t.pts," "),this.column_++,14==(14&i)&&this.addFormatting(t.pts,["i"]),1==(1&i)&&this.addFormatting(t.pts,["u"])):this.isOffsetControlCode(e,i)?this.column_+=3&i:this.isPAC(e,i)?(r=kt.indexOf(7968&a),"rollUp"===this.mode_&&(r-this.rollUpRows_+1<0&&(r=this.rollUpRows_-1),this.setRollUp(t.pts,r)),r!==this.row_&&(this.clearFormatting(t.pts),this.row_=r),1&i&&-1===this.formatting_.indexOf("u")&&this.addFormatting(t.pts,["u"]),16==(16&a)&&(this.column_=4*((14&a)>>1)),this.isColorPAC(i)&&14==(14&i)&&this.addFormatting(t.pts,["i"])):this.isNormalChar(e)&&(0===i&&(i=null),n=bt(e),n+=bt(i),this[this.mode_](t.pts,n),this.column_+=n.length))):this.lastControlCode_=null}};function Ct(t,e){var i=1;for(e<t&&(i=-1);4294967296<Math.abs(e-t);)t+=8589934592*i;return t}wt.prototype=new $,wt.prototype.flushDisplayed=function(t){var e=this.displayed_.map(function(t){try{return t.trim()}catch(t){return console.error("Skipping malformed caption."),""}}).join("\n").replace(/^\n+|\n+$/g,"");e.length&&this.trigger("data",{startPts:this.startPts_,endPts:t,text:e,stream:this.name_})},wt.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Tt(),this.nonDisplayed_=Tt(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},wt.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_},wt.prototype.isSpecialCharacter=function(t,e){return t===this.EXT_&&48<=e&&e<=63},wt.prototype.isExtCharacter=function(t,e){return(t===this.EXT_+1||t===this.EXT_+2)&&32<=e&&e<=63},wt.prototype.isMidRowCode=function(t,e){return t===this.EXT_&&32<=e&&e<=47},wt.prototype.isOffsetControlCode=function(t,e){return t===this.OFFSET_&&33<=e&&e<=35},wt.prototype.isPAC=function(t,e){return t>=this.BASE_&&t<this.BASE_+8&&64<=e&&e<=127},wt.prototype.isColorPAC=function(t){return 64<=t&&t<=79||96<=t&&t<=127},wt.prototype.isNormalChar=function(t){return 32<=t&&t<=127},wt.prototype.setRollUp=function(t,e){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(t),this.nonDisplayed_=Tt(),this.displayed_=Tt()),void 0!==e&&e!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[e-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]="";void 0===e&&(e=this.row_),this.topRow_=e-this.rollUpRows_+1},wt.prototype.addFormatting=function(t,e){this.formatting_=this.formatting_.concat(e);e=e.reduce(function(t,e){return t+"<"+e+">"},"");this[this.mode_](t,e)},wt.prototype.clearFormatting=function(t){var e;this.formatting_.length&&(e=this.formatting_.reverse().reduce(function(t,e){return t+"</"+e+">"},""),this.formatting_=[],this[this.mode_](t,e))},wt.prototype.popOn=function(t,e){var i=this.nonDisplayed_[this.row_];i+=e,this.nonDisplayed_[this.row_]=i},wt.prototype.rollUp=function(t,e){var i=this.displayed_[this.row_];i+=e,this.displayed_[this.row_]=i},wt.prototype.shiftRowsUp_=function(){for(var t=0;t<this.topRow_;t++)this.displayed_[t]="";for(t=this.row_+1;t<15;t++)this.displayed_[t]="";for(t=this.topRow_;t<this.row_;t++)this.displayed_[t]=this.displayed_[t+1];this.displayed_[this.row_]=""},wt.prototype.paintOn=function(t,e){var i=this.displayed_[this.row_];i+=e,this.displayed_[this.row_]=i};var G={CaptionStream:W,Cea608Stream:wt},Et={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21};function At(t,e,i){for(var n="",r=e;r<i;r++)n+="%"+("00"+t[r].toString(16)).slice(-2);return n}function Lt(t,e,i){return decodeURIComponent(At(t,e,i))}function Ot(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]}(et=function t(e){var i,n;t.prototype.init.call(this),this.type_=e,this.push=function(t){t.type===this.type_&&(void 0===n&&(n=t.dts),t.dts=Ct(t.dts,n),t.pts=Ct(t.pts,n),i=t.dts,this.trigger("data",t))},this.flush=function(){n=i,this.trigger("done")},this.discontinuity=function(){i=n=void 0}}).prototype=new $;var W=et,Pt={TXXX:function(t){var e;if(3===t.data[0]){for(e=1;e<t.data.length;e++)if(0===t.data[e]){t.description=Lt(t.data,1,e),t.value=Lt(t.data,e+1,t.data.length).replace(/\0*$/,"");break}t.data=t.value}},WXXX:function(t){var e;if(3===t.data[0])for(e=1;e<t.data.length;e++)if(0===t.data[e]){t.description=Lt(t.data,1,e),t.url=Lt(t.data,e+1,t.data.length);break}},PRIV:function(t){for(var e,i=0;i<t.data.length;i++)if(0===t.data[i]){t.owner=(e=t.data,unescape(At(e,0,i)));break}t.privateData=t.data.subarray(i+1),t.data=t.privateData}},Ut=function(t){var e,u={debug:!(!t||!t.debug),descriptor:t&&t.descriptor},l=0,c=[],h=0;if(Ut.prototype.init.call(this),this.dispatchType=Et.METADATA_STREAM_TYPE.toString(16),u.descriptor)for(e=0;e<u.descriptor.length;e++)this.dispatchType+=("00"+u.descriptor[e].toString(16)).slice(-2);this.push=function(t){var e,i,n,r,a,s,o;if("timed-metadata"===t.type)if(t.dataAlignmentIndicator&&(h=0,c.length=0),0===c.length&&(t.data.length<10||t.data[0]!=="I".charCodeAt(0)||t.data[1]!=="D".charCodeAt(0)||t.data[2]!=="3".charCodeAt(0)))u.debug&&console.log("Skipping unrecognized metadata packet");else if(c.push(t),h+=t.data.byteLength,1===c.length&&(l=Ot(t.data.subarray(6,10)),l+=10),!(h<l)){for(e={data:new Uint8Array(l),frames:[],pts:c[0].pts,dts:c[0].dts},r=0;r<l;)e.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&e.data[5]&&(i+=4,i+=Ot(e.data.subarray(10,14)),l-=Ot(e.data.subarray(16,20)));do{if((n=Ot(e.data.subarray(i+4,i+8)))<1)return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.")}while((o={id:String.fromCharCode(e.data[i],e.data[i+1],e.data[i+2],e.data[i+3]),data:e.data.subarray(i+10,i+n+10)}).key=o.id,Pt[o.id]&&(Pt[o.id](o),"com.apple.streaming.transportStreamTimestamp"===o.owner&&(s=(1&(a=o.data)[3])<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2,s*=4,s+=3&a[7],o.timeStamp=s,void 0===e.pts&&void 0===e.dts&&(e.pts=o.timeStamp,e.dts=o.timeStamp),this.trigger("timestamp",o))),e.frames.push(o),i+=10,(i+=n)<l);this.trigger("data",e)}}};Ut.prototype=new $;var It,xt,et=Ut,W=W,Dt=function(){var r=new Uint8Array(188),a=0;Dt.prototype.init.call(this),this.push=function(t){var e,i=0,n=188;for(a?((e=new Uint8Array(t.byteLength+a)).set(r.subarray(0,a)),e.set(t,a),a=0):e=t;n<e.byteLength;)71!==e[i]||71!==e[n]?(i++,n++):(this.trigger("data",e.subarray(i,n)),i+=188,n+=188);i<e.byteLength&&(r.set(e.subarray(i),0),a=e.byteLength-i)},this.flush=function(){188===a&&71===r[0]&&(this.trigger("data",r),a=0),this.trigger("done")}};Dt.prototype=new $,(It=function(){var n,r,a,s;It.prototype.init.call(this),(s=this).packetsWaitingForPmt=[],this.programMapTable=void 0,n=function(t,e){var i=0;e.payloadUnitStartIndicator&&(i+=t[i]+1),("pat"===e.type?r:a)(t.subarray(i),e)},r=function(t,e){e.section_number=t[7],e.last_section_number=t[8],s.pmtPid=(31&t[10])<<8|t[11],e.pmtPid=s.pmtPid},a=function(t,e){var i,n;if(1&t[5]){for(s.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&t[1])<<8|t[2])-4,n=12+((15&t[10])<<8|t[11]);n<i;){var r=t[n],a=(31&t[n+1])<<8|t[n+2];r===Et.H264_STREAM_TYPE&&null===s.programMapTable.video?s.programMapTable.video=a:r===Et.ADTS_STREAM_TYPE&&null===s.programMapTable.audio?s.programMapTable.audio=a:r===Et.METADATA_STREAM_TYPE&&(s.programMapTable["timed-metadata"][a]=r),n+=5+((15&t[n+3])<<8|t[n+4])}e.programMapTable=s.programMapTable}},this.push=function(t){var e={},i=4;if(e.payloadUnitStartIndicator=!!(64&t[1]),e.pid=31&t[1],e.pid<<=8,e.pid|=t[2],1<(48&t[3])>>>4&&(i+=t[i]+1),0===e.pid)e.type="pat",n(t.subarray(i),e),this.trigger("data",e);else if(e.pid===this.pmtPid)for(e.type="pmt",n(t.subarray(i),e),this.trigger("data",e);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,i,e]):this.processPes_(t,i,e)},this.processPes_=function(t,e,i){i.pid===this.programMapTable.video?i.streamType=Et.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=Et.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=t.subarray(e),this.trigger("data",i)}}).prototype=new $,It.STREAM_TYPES={h264:27,adts:15},(xt=function(){function n(t,e,i){var n,r,a,s,o=new Uint8Array(t.size),u={type:e},l=0,c=0;if(t.data.length&&!(t.size<9)){for(u.trackId=t.data[0].pid,l=0;l<t.data.length;l++)n=t.data[l],o.set(n.data,c),c+=n.data.byteLength;r=o,(a=u).packetLength=6+(r[4]<<8|r[5]),a.dataAlignmentIndicator=0!=(4&r[6]),192&(s=r[7])&&(a.pts=(14&r[9])<<27|(255&r[10])<<20|(254&r[11])<<12|(255&r[12])<<5|(254&r[13])>>>3,a.pts*=4,a.pts+=(6&r[13])>>>1,a.dts=a.pts,64&s&&(a.dts=(14&r[14])<<27|(255&r[15])<<20|(254&r[16])<<12|(255&r[17])<<5|(254&r[18])>>>3,a.dts*=4,a.dts+=(6&r[18])>>>1)),a.data=r.subarray(9+r[8]),e="video"===e||u.packetLength<=t.size,(i||e)&&(t.size=0,t.data.length=0),e&&h.trigger("data",u)}}var h=this,r={data:[],size:0},a={data:[],size:0},s={data:[],size:0};xt.prototype.init.call(this),this.push=function(i){({pat:function(){},pes:function(){var t,e;switch(i.streamType){case Et.H264_STREAM_TYPE:case Et.H264_STREAM_TYPE:t=r,e="video";break;case Et.ADTS_STREAM_TYPE:t=a,e="audio";break;case Et.METADATA_STREAM_TYPE:t=s,e="timed-metadata";break;default:return}i.payloadUnitStartIndicator&&n(t,e,!0),t.data.push(i),t.size+=i.data.byteLength},pmt:function(){var t={type:"metadata",tracks:[]},e=i.programMapTable;null!==e.video&&t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),h.trigger("data",t)}})[i.type]()},this.flush=function(){n(r,"video"),n(a,"audio"),n(s,"timed-metadata"),this.trigger("done")}}).prototype=new $;var Rt,Mt={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:Dt,TransportParseStream:It,ElementaryStream:xt,TimestampRolloverStream:W,CaptionStream:G.CaptionStream,Cea608Stream:G.Cea608Stream,MetadataStream:et};for(Rt in Et)Et.hasOwnProperty(Rt)&&(Mt[Rt]=Et[Rt]);var Bt=Mt,Nt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],jt=function(){var u;jt.prototype.init.call(this),this.push=function(t){var e,i,n,r,a,s=0,o=0;if("audio"===t.type)for(u?(n=u,(u=new Uint8Array(n.byteLength+t.data.byteLength)).set(n),u.set(t.data,n.byteLength)):u=t.data;s+5<u.length;)if(255===u[s]&&240==(246&u[s+1])){if(e=2*(1&~u[s+1]),i=(3&u[s+3])<<11|u[s+4]<<3|(224&u[s+5])>>5,a=9e4*(r=1024*(1+(3&u[s+6])))/Nt[(60&u[s+2])>>>2],i=s+i,u.byteLength<i)return;if(this.trigger("data",{pts:t.pts+o*a,dts:t.dts+o*a,sampleCount:r,audioobjecttype:1+(u[s+2]>>>6&3),channelcount:(1&u[s+2])<<2|(192&u[s+3])>>>6,samplerate:Nt[(60&u[s+2])>>>2],samplingfrequencyindex:(60&u[s+2])>>>2,samplesize:16,data:u.subarray(s+7+e,i)}),u.byteLength===i)return void(u=void 0);o++,u=u.subarray(i)}else s++},this.flush=function(){this.trigger("done")}};jt.prototype=new $;var Ft,Vt,Ht=jt,qt=function(n){var r=n.byteLength,a=0,s=0;this.length=function(){return 8*r},this.bitsAvailable=function(){return 8*r+s},this.loadWord=function(){var t=n.byteLength-r,e=new Uint8Array(4),i=Math.min(4,r);if(0===i)throw new Error("no bytes available");e.set(n.subarray(t,t+i)),a=new DataView(e.buffer).getUint32(0),s=8*i,r-=i},this.skipBits=function(t){var e;t<s||(t-=s,t-=8*(e=Math.floor(t/8)),r-=e,this.loadWord()),a<<=t,s-=t},this.readBits=function(t){var e=Math.min(s,t),i=a>>>32-e;return 0<(s-=e)?a<<=e:0<r&&this.loadWord(),0<(e=t-e)?i<<e|this.readBits(e):i},this.skipLeadingZeros=function(){for(var t=0;t<s;++t)if(0!=(a&2147483648>>>t))return a<<=t,s-=t,t;return this.loadWord(),t+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var t=this.skipLeadingZeros();return this.readBits(t+1)-1},this.readExpGolomb=function(){var t=this.readUnsignedExpGolomb();return 1&t?1+t>>>1:-1*(t>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()},zt=function(){var i,n,r=0;zt.prototype.init.call(this),this.push=function(t){var e;for(n=n?((e=new Uint8Array(n.byteLength+t.data.byteLength)).set(n),e.set(t.data,n.byteLength),e):t.data;r<n.byteLength-3;r++)if(1===n[r+2]){i=r+5;break}for(;i<n.byteLength;)switch(n[i]){case 0:if(0!==n[i-1]){i+=2;break}if(0!==n[i-2]){i++;break}for(r+3!==i-2&&this.trigger("data",n.subarray(r+3,i-2));i++,1!==n[i]&&i<n.length;);r=i-2,i+=3;break;case 1:if(0!==n[i-1]||0!==n[i-2]){i+=3;break}this.trigger("data",n.subarray(r+3,i-2)),r=i-2,i+=3;break;default:i+=3}n=n.subarray(r),i-=r,r=0},this.flush=function(){n&&3<n.byteLength&&this.trigger("data",n.subarray(r+3)),n=null,r=0,this.trigger("done")}};zt.prototype=new $,Vt={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(Ft=function(){var i,n,r,a,s,o,g,e=new zt;Ft.prototype.init.call(this),(i=this).push=function(t){"video"===t.type&&(n=t.trackId,r=t.pts,a=t.dts,e.push(t))},e.on("data",function(t){var e={trackId:n,pts:r,dts:a,data:t};switch(31&t[0]){case 5:e.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:e.nalUnitType="sei_rbsp",e.escapedRBSP=s(t.subarray(1));break;case 7:e.nalUnitType="seq_parameter_set_rbsp",e.escapedRBSP=s(t.subarray(1)),e.config=o(e.escapedRBSP);break;case 8:e.nalUnitType="pic_parameter_set_rbsp";break;case 9:e.nalUnitType="access_unit_delimiter_rbsp"}i.trigger("data",e)}),e.on("done",function(){i.trigger("done")}),this.flush=function(){e.flush()},g=function(t,e){for(var i=8,n=8,r=0;r<t;r++)0!==n&&(n=(i+e.readExpGolomb()+256)%256),i=0===n?i:n},s=function(t){for(var e,i,n=t.byteLength,r=[],a=1;a<n-2;)0===t[a]&&0===t[a+1]&&3===t[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return t;e=n-r.length,i=new Uint8Array(e);for(var s=0,a=0;a<e;s++,a++)s===r[0]&&(s++,r.shift()),i[a]=t[s];return i},o=function(t){var e,i,n,r,a,s,o=0,u=0,l=0,c=0,h=1,d=new qt(t),p=d.readUnsignedByte(),f=d.readUnsignedByte(),m=d.readUnsignedByte();if(d.skipUnsignedExpGolomb(),Vt[p]&&(3===(i=d.readUnsignedExpGolomb())&&d.skipBits(1),d.skipUnsignedExpGolomb(),d.skipUnsignedExpGolomb(),d.skipBits(1),d.readBoolean()))for(r=3!==i?8:12,s=0;s<r;s++)d.readBoolean()&&g(s<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(),e=d.readUnsignedExpGolomb(),s=0;s<e;s++)d.skipExpGolomb();if(d.skipUnsignedExpGolomb(),d.skipBits(1),t=d.readUnsignedExpGolomb(),i=d.readUnsignedExpGolomb(),n=d.readBits(1),0===n&&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:a=[1,1];break;case 2:a=[12,11];break;case 3:a=[10,11];break;case 4:a=[16,11];break;case 5:a=[40,33];break;case 6:a=[24,11];break;case 7:a=[20,11];break;case 8:a=[32,11];break;case 9:a=[80,33];break;case 10:a=[18,11];break;case 11:a=[15,11];break;case 12:a=[64,33];break;case 13:a=[160,99];break;case 14:a=[4,3];break;case 15:a=[3,2];break;case 16:a=[2,1];break;case 255:a=[d.readUnsignedByte()<<8|d.readUnsignedByte(),d.readUnsignedByte()<<8|d.readUnsignedByte()]}a&&(h=a[0]/a[1])}return{profileIdc:p,levelIdc:m,profileCompatibility:f,width:Math.ceil((16*(t+1)-2*o-2*u)*h),height:(2-n)*(i+1)*16-2*l-2*c}}}).prototype=new $;var W={H264Stream:Ft,NalByteStream:zt},et=function(t){return t[0]==="I".charCodeAt(0)&&t[1]==="D".charCodeAt(0)&&t[2]==="3".charCodeAt(0)},Wt=function(t,e){var i=t[e+6]<<21|t[e+7]<<14|t[e+8]<<7|t[e+9];return(16&t[e+5])>>4?20+i:10+i},Gt=function(t,e){var i=(224&t[e+5])>>5,n=t[e+4]<<3;return 6144&t[e+3]|n|i},Xt=function(){var a=new Uint8Array,s=0;Xt.prototype.init.call(this),this.setTimestamp=function(t){s=t},this.push=function(t){var e,i,n=0,r=0;for(a.length?(i=a.length,(a=new Uint8Array(t.byteLength+i)).set(a.subarray(0,i)),a.set(t,i)):a=t;3<=a.length-r;)if(a[r]!=="I".charCodeAt(0)||a[r+1]!=="D".charCodeAt(0)||a[r+2]!=="3".charCodeAt(0))if(255!=(255&a[r])||240!=(240&a[r+1]))r++;else{if(a.length-r<7)break;if(r+(n=Gt(a,r))>a.length)break;e={type:"audio",data:a.subarray(r,r+n),pts:s,dts:s},this.trigger("data",e),r+=n}else{if(a.length-r<10)break;if(r+(n=Wt(a,r))>a.length)break;e={type:"timed-metadata",data:a.subarray(r,r+n)},this.trigger("data",e),r+=n}t=a.length-r,a=0<t?a.subarray(r):new Uint8Array}};function Yt(t,e){var i;if(t.length===e.length){for(i=0;i<t.length;i++)if(t[i]!==e[i])return;return 1}}Xt.prototype=new $;var $t,Kt,Qt,Jt=Xt,Zt=W.H264Stream,te=et,ee=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],ie=["width","height","profileIdc","levelIdc","profileCompatibility"],ne=function(n,r){var a=[],s=0,o=0,u=0,l=1/0;r=r||{},ne.prototype.init.call(this),this.push=function(e){mt(n,e),n&&ee.forEach(function(t){n[t]=e[t]}),a.push(e)},this.setEarliestDts=function(t){o=t-n.timelineStartInfo.baseMediaDecodeTime},this.setVideoBaseMediaDecodeTime=function(t){l=t},this.setAudioAppendStart=function(t){u=t},this.flush=function(){var t,e,i;0!==a.length&&(i=ct(a,n,o),n.baseMediaDecodeTime=ft(n,r.keepOriginalTimestamps),lt(n,i,u,l),n.samples=ht(i),e=V.mdat(dt(i)),a=[],t=V.moof(s,[n]),i=new Uint8Array(t.byteLength+e.byteLength),s++,i.set(t),i.set(e,t.byteLength),pt(n),this.trigger("data",{track:n,boxes:i})),this.trigger("done","AudioSegmentStream")}};function re(t){return new Date(1e3*t-20828448e5)}function ae(t){return{isLeading:(12&t[0])>>>2,dependsOn:3&t[0],isDependedOn:(192&t[1])>>>6,hasRedundancy:(48&t[1])>>>4,paddingValue:(14&t[1])>>>1,isNonSyncSample:1&t[1],degradationPriority:t[2]<<8|t[3]}}function se(t,c){var i=X.findBox(t,["moof","traf"]),t=X.findBox(t,["mdat"]),h={},n=[];return t.forEach(function(t,e){e=i[e];n.push({mdat:t,traf:e})}),n.forEach(function(t){var e,i,n,r,a,s=t.mdat,o=t.traf,u=X.findBox(o,["tfhd"]),l=he.parseTfhd(u[0]),t=l.trackId,u=X.findBox(o,["tfdt"]),u=0<u.length?he.parseTfdt(u[0]).baseMediaDecodeTime:0,o=X.findBox(o,["trun"]);c===t&&0<o.length&&(o=o,e=u,i=(l=l).defaultSampleDuration||0,n=l.defaultSampleSize||0,r=l.trackId,a=[],o.forEach(function(t){t=he.parseTrun(t).samples;t.forEach(function(t){void 0===t.duration&&(t.duration=i),void 0===t.size&&(t.size=n),t.trackId=r,t.dts=e,void 0===t.compositionTimeOffset&&(t.compositionTimeOffset=0),t.pts=e+t.compositionTimeOffset,e+=t.duration}),a=a.concat(t)}),s=function(t,e,i){for(var n,r=new DataView(t.buffer,t.byteOffset,t.byteLength),a=[],s=0;s+4<t.length;s+=l){var o,u,l=r.getUint32(s);s+=4,l<=0||6==(31&t[s])&&(u=t.subarray(s+1,s+1+l),o=function(t,e){for(var i=t,n=0;n<e.length;n++){var r=e[n];if(i<r.size)return r;i-=r.size}return null}(s,e),u={nalUnitType:"sei_rbsp",size:l,data:u,escapedRBSP:de(u),trackId:i},o?(u.pts=o.pts,u.dts=o.dts,n=o):(u.pts=n.pts,u.dts=n.dts),a.push(u))}return a}(s,a,t),h[t]||(h[t]=[]),h[t]=h[t].concat(s))}),h}ne.prototype=new $,($t=function(s,n){var e,i,r=0,a=[],l=[];n=n||{},$t.prototype.init.call(this),delete s.minPTS,this.gopCache_=[],this.push=function(t){mt(s,t),"seq_parameter_set_rbsp"!==t.nalUnitType||e||(e=t.config,s.sps=[t.data],ie.forEach(function(t){s[t]=e[t]},this)),"pic_parameter_set_rbsp"!==t.nalUnitType||i||(i=t.data,s.pps=[t.data]),a.push(t)},this.flush=function(){for(var t,e;a.length&&"access_unit_delimiter_rbsp"!==a[0].nalUnitType;)a.shift();if(0===a.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(e=K(a),(e=Q(e))[0][0].keyFrame||((t=this.getGopForFusion_(a[0],s))?(e.unshift(t),e.byteLength+=t.byteLength,e.nalCount+=t.nalCount,e.pts=t.pts,e.dts=t.dts,e.duration+=t.duration):e=J(e)),l.length){var i=n.alignGopsAtEnd?this.alignGopsAtEnd_(e):this.alignGopsAtStart_(e);if(!i)return this.gopCache_.unshift({gop:e.pop(),pps:s.pps,sps:s.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");pt(s),e=i}mt(s,e),s.samples=Z(e),t=V.mdat(tt(e)),s.baseMediaDecodeTime=ft(s,n.keepOriginalTimestamps),this.trigger("processedGopsInfo",e.map(function(t){return{pts:t.pts,dts:t.dts,byteLength:t.byteLength}})),this.gopCache_.unshift({gop:e.pop(),pps:s.pps,sps:s.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.trigger("baseMediaDecodeTime",s.baseMediaDecodeTime),this.trigger("timelineStartInfo",s.timelineStartInfo),i=V.moof(r,[s]),e=new Uint8Array(i.byteLength+t.byteLength),r++,e.set(i),e.set(t,i.byteLength),this.trigger("data",{track:s,boxes:e}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.resetStream_=function(){pt(s),i=e=void 0},this.getGopForFusion_=function(t){for(var e,i,n,r=1/0,a=0;a<this.gopCache_.length;a++)i=(n=this.gopCache_[a]).gop,s.pps&&Yt(s.pps[0],n.pps[0])&&s.sps&&Yt(s.sps[0],n.sps[0])&&(i.dts<s.timelineStartInfo.dts||-1e4<=(i=t.dts-i.dts-i.duration)&&i<=45e3&&(!e||i<r)&&(e=n,r=i));return e?e.gop:null},this.alignGopsAtStart_=function(t){for(var e,i,n,r,a=t.byteLength,s=t.nalCount,o=t.duration,u=e=0;u<l.length&&e<t.length&&(i=l[u],n=t[e],i.pts!==n.pts);)n.pts>i.pts?u++:(e++,a-=n.byteLength,s-=n.nalCount,o-=n.duration);return 0===e?t:e===t.length?null:((r=t.slice(e)).byteLength=a,r.duration=o,r.nalCount=s,r.pts=r[0].pts,r.dts=r[0].dts,r)},this.alignGopsAtEnd_=function(t){for(var e,i,n=l.length-1,r=t.length-1,a=null,s=!1;0<=n&&0<=r;){if(e=l[n],i=t[r],e.pts===i.pts){s=!0;break}e.pts>i.pts?n--:(n===l.length-1&&(a=r),r--)}if(!s&&null===a)return null;if(0===(u=s?r:a))return t;var o=t.slice(u),u=o.reduce(function(t,e){return t.byteLength+=e.byteLength,t.duration+=e.duration,t.nalCount+=e.nalCount,t},{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(t){l=t}}).prototype=new $,(Qt=function(t,e){this.numberOfTracks=0,this.metadataStream=e,void 0!==(t=t||{}).remux?this.remuxTracks=!!t.remux:this.remuxTracks=!0,"boolean"==typeof t.keepOriginalTimestamps&&(this.keepOriginalTimestamps=t.keepOriginalTimestamps),this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,Qt.prototype.init.call(this),this.push=function(t){return t.text?this.pendingCaptions.push(t):t.frames?this.pendingMetadata.push(t):(this.pendingTracks.push(t.track),this.pendingBoxes.push(t.boxes),this.pendingBytes+=t.boxes.byteLength,"video"===t.track.type&&(this.videoTrack=t.track),void("audio"===t.track.type&&(this.audioTrack=t.track)))}}).prototype=new $,Qt.prototype.flush=function(t){var e,i,n,r=0,a={captions:[],captionStreams:{},metadata:[],info:{}},s=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==t&&"AudioSegmentStream"!==t)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}for(this.videoTrack?(s=this.videoTrack.timelineStartInfo.pts,ie.forEach(function(t){a.info[t]=this.videoTrack[t]},this)):this.audioTrack&&(s=this.audioTrack.timelineStartInfo.pts,ee.forEach(function(t){a.info[t]=this.audioTrack[t]},this)),1===this.pendingTracks.length?a.type=this.pendingTracks[0].type:a.type="combined",this.emittedTracks+=this.pendingTracks.length,t=V.initSegment(this.pendingTracks),a.initSegment=new Uint8Array(t.byteLength),a.initSegment.set(t),a.data=new Uint8Array(this.pendingBytes),n=0;n<this.pendingBoxes.length;n++)a.data.set(this.pendingBoxes[n],r),r+=this.pendingBoxes[n].byteLength;for(n=0;n<this.pendingCaptions.length;n++)(e=this.pendingCaptions[n]).startTime=e.startPts,this.keepOriginalTimestamps||(e.startTime-=s),e.startTime/=9e4,e.endTime=e.endPts,this.keepOriginalTimestamps||(e.endTime-=s),e.endTime/=9e4,a.captionStreams[e.stream]=!0,a.captions.push(e);for(n=0;n<this.pendingMetadata.length;n++)(i=this.pendingMetadata[n]).cueTime=i.pts,this.keepOriginalTimestamps||(i.cueTime-=s),i.cueTime/=9e4,a.metadata.push(i);a.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",a),this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},(Kt=function(n){var r,a,s=this,i=!0;Kt.prototype.init.call(this),n=n||{},this.baseMediaDecodeTime=n.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var e={};(this.transmuxPipeline_=e).type="aac",e.metadataStream=new Bt.MetadataStream,e.aacStream=new Jt,e.audioTimestampRolloverStream=new Bt.TimestampRolloverStream("audio"),e.timedMetadataTimestampRolloverStream=new Bt.TimestampRolloverStream("timed-metadata"),e.adtsStream=new Ht,e.coalesceStream=new Qt(n,e.metadataStream),e.headOfPipeline=e.aacStream,e.aacStream.pipe(e.audioTimestampRolloverStream).pipe(e.adtsStream),e.aacStream.pipe(e.timedMetadataTimestampRolloverStream).pipe(e.metadataStream).pipe(e.coalesceStream),e.metadataStream.on("timestamp",function(t){e.aacStream.setTimestamp(t.timeStamp)}),e.aacStream.on("data",function(t){"timed-metadata"!==t.type||e.audioSegmentStream||(a=a||{timelineStartInfo:{baseMediaDecodeTime:s.baseMediaDecodeTime},codec:"adts",type:"audio"},e.coalesceStream.numberOfTracks++,e.audioSegmentStream=new ne(a,n),e.adtsStream.pipe(e.audioSegmentStream).pipe(e.coalesceStream))}),e.coalesceStream.on("data",this.trigger.bind(this,"data")),e.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var i={};(this.transmuxPipeline_=i).type="ts",i.metadataStream=new Bt.MetadataStream,i.packetStream=new Bt.TransportPacketStream,i.parseStream=new Bt.TransportParseStream,i.elementaryStream=new Bt.ElementaryStream,i.videoTimestampRolloverStream=new Bt.TimestampRolloverStream("video"),i.audioTimestampRolloverStream=new Bt.TimestampRolloverStream("audio"),i.timedMetadataTimestampRolloverStream=new Bt.TimestampRolloverStream("timed-metadata"),i.adtsStream=new Ht,i.h264Stream=new Zt,i.captionStream=new Bt.CaptionStream,i.coalesceStream=new Qt(n,i.metadataStream),i.headOfPipeline=i.packetStream,i.packetStream.pipe(i.parseStream).pipe(i.elementaryStream),i.elementaryStream.pipe(i.videoTimestampRolloverStream).pipe(i.h264Stream),i.elementaryStream.pipe(i.audioTimestampRolloverStream).pipe(i.adtsStream),i.elementaryStream.pipe(i.timedMetadataTimestampRolloverStream).pipe(i.metadataStream).pipe(i.coalesceStream),i.h264Stream.pipe(i.captionStream).pipe(i.coalesceStream),i.elementaryStream.on("data",function(t){var e;if("metadata"===t.type){for(e=t.tracks.length;e--;)r||"video"!==t.tracks[e].type?a||"audio"!==t.tracks[e].type||((a=t.tracks[e]).timelineStartInfo.baseMediaDecodeTime=s.baseMediaDecodeTime):(r=t.tracks[e]).timelineStartInfo.baseMediaDecodeTime=s.baseMediaDecodeTime;r&&!i.videoSegmentStream&&(i.coalesceStream.numberOfTracks++,i.videoSegmentStream=new $t(r,n),i.videoSegmentStream.on("timelineStartInfo",function(t){a&&(a.timelineStartInfo=t,i.audioSegmentStream.setEarliestDts(t.dts))}),i.videoSegmentStream.on("processedGopsInfo",s.trigger.bind(s,"gopInfo")),i.videoSegmentStream.on("baseMediaDecodeTime",function(t){a&&i.audioSegmentStream.setVideoBaseMediaDecodeTime(t)}),i.h264Stream.pipe(i.videoSegmentStream).pipe(i.coalesceStream)),a&&!i.audioSegmentStream&&(i.coalesceStream.numberOfTracks++,i.audioSegmentStream=new ne(a,n),i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream))}}),i.coalesceStream.on("data",this.trigger.bind(this,"data")),i.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(t){var e=this.transmuxPipeline_;n.keepOriginalTimestamps||(this.baseMediaDecodeTime=t),a&&(a.timelineStartInfo.dts=void 0,a.timelineStartInfo.pts=void 0,pt(a),n.keepOriginalTimestamps||(a.timelineStartInfo.baseMediaDecodeTime=t),e.audioTimestampRolloverStream&&e.audioTimestampRolloverStream.discontinuity()),r&&(e.videoSegmentStream&&(e.videoSegmentStream.gopCache_=[],e.videoTimestampRolloverStream.discontinuity()),r.timelineStartInfo.dts=void 0,r.timelineStartInfo.pts=void 0,pt(r),e.captionStream.reset(),n.keepOriginalTimestamps||(r.timelineStartInfo.baseMediaDecodeTime=t)),e.timedMetadataTimestampRolloverStream&&e.timedMetadataTimestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(t){a&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(t)},this.alignGopsWith=function(t){r&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(t)},this.push=function(t){var e;i&&((e=te(t))&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():e||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),i=!1),this.transmuxPipeline_.headOfPipeline.push(t)},this.flush=function(){i=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new $;var $={Transmuxer:Kt,VideoSegmentStream:$t,AudioSegmentStream:ne,AUDIO_PROPERTIES:ee,VIDEO_PROPERTIES:ie},oe=X.parseType,ue={avc1:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return{dataReferenceIndex:e.getUint16(6),width:e.getUint16(24),height:e.getUint16(26),horizresolution:e.getUint16(28)+e.getUint16(30)/16,vertresolution:e.getUint16(32)+e.getUint16(34)/16,frameCount:e.getUint16(40),depth:e.getUint16(74),config:le(t.subarray(78,t.byteLength))}},avcC:function(t){for(var e,i,n=new DataView(t.buffer,t.byteOffset,t.byteLength),r={configurationVersion:t[0],avcProfileIndication:t[1],profileCompatibility:t[2],avcLevelIndication:t[3],lengthSizeMinusOne:3&t[4],sps:[],pps:[]},a=31&t[5],s=6,o=0;o<a;o++)i=n.getUint16(s),s+=2,r.sps.push(new Uint8Array(t.subarray(s,s+i))),s+=i;for(e=t[s],s++,o=0;o<e;o++)i=n.getUint16(s),s+=2,r.pps.push(new Uint8Array(t.subarray(s,s+i))),s+=i;return r},btrt:function(t){t=new DataView(t.buffer,t.byteOffset,t.byteLength);return{bufferSizeDB:t.getUint32(0),maxBitrate:t.getUint32(4),avgBitrate:t.getUint32(8)}},esds:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),esId:t[6]<<8|t[7],streamPriority:31&t[8],decoderConfig:{objectProfileIndication:t[11],streamType:t[12]>>>2&63,bufferSize:t[13]<<16|t[14]<<8|t[15],maxBitrate:t[16]<<24|t[17]<<16|t[18]<<8|t[19],avgBitrate:t[20]<<24|t[21]<<16|t[22]<<8|t[23],decoderConfigDescriptor:{tag:t[24],length:t[25],audioObjectType:t[26]>>>3&31,samplingFrequencyIndex:(7&t[26])<<1|t[27]>>>7&1,channelConfiguration:t[27]>>>3&15}}}},ftyp:function(t){for(var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={majorBrand:oe(t.subarray(0,4)),minorVersion:e.getUint32(4),compatibleBrands:[]},n=8;n<t.byteLength;)i.compatibleBrands.push(oe(t.subarray(n,n+4))),n+=4;return i},dinf:function(t){return{boxes:le(t)}},dref:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),dataReferences:le(t.subarray(8))}},hdlr:function(t){for(var e={version:new DataView(t.buffer,t.byteOffset,t.byteLength).getUint8(0),flags:new Uint8Array(t.subarray(1,4)),handlerType:oe(t.subarray(8,12)),name:""},i=8,i=24;i<t.byteLength;i++){if(0===t[i]){i++;break}e.name+=String.fromCharCode(t[i])}return e.name=decodeURIComponent(escape(e.name)),e},mdat:function(t){return{byteLength:t.byteLength,nals:function(t){for(var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n=[],r=0;r+4<t.length;r+=e)if(e=i.getUint32(r),r+=4,e<=0)n.push("<span style='color:red;'>MALFORMED DATA</span>");else switch(31&t[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 - "+t[r]&31)}return n}(t)}},mdhd:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i=4,t={version:e.getUint8(0),flags:new Uint8Array(t.subarray(1,4)),language:""};return 1===t.version?(i+=4,t.creationTime=re(e.getUint32(i)),i+=8,t.modificationTime=re(e.getUint32(i)),i+=4,t.timescale=e.getUint32(i),i+=8):(t.creationTime=re(e.getUint32(i)),i+=4,t.modificationTime=re(e.getUint32(i)),i+=4,t.timescale=e.getUint32(i),i+=4),t.duration=e.getUint32(i),i+=4,i=e.getUint16(i),t.language+=String.fromCharCode(96+(i>>10)),t.language+=String.fromCharCode(96+((992&i)>>5)),t.language+=String.fromCharCode(96+(31&i)),t},mdia:function(t){return{boxes:le(t)}},mfhd:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),sequenceNumber:t[4]<<24|t[5]<<16|t[6]<<8|t[7]}},minf:function(t){return{boxes:le(t)}},mp4a:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),e={dataReferenceIndex:e.getUint16(6),channelcount:e.getUint16(16),samplesize:e.getUint16(18),samplerate:e.getUint16(24)+e.getUint16(26)/65536};return 28<t.byteLength&&(e.streamDescriptor=le(t.subarray(28))[0]),e},moof:function(t){return{boxes:le(t)}},moov:function(t){return{boxes:le(t)}},mvex:function(t){return{boxes:le(t)}},mvhd:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i=4,n={version:e.getUint8(0),flags:new Uint8Array(t.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=re(e.getUint32(i)),i+=8,n.modificationTime=re(e.getUint32(i)),i+=4,n.timescale=e.getUint32(i),i+=8):(n.creationTime=re(e.getUint32(i)),i+=4,n.modificationTime=re(e.getUint32(i)),i+=4,n.timescale=e.getUint32(i),i+=4),n.duration=e.getUint32(i),i+=4,n.rate=e.getUint16(i)+e.getUint16(i+2)/16,i+=4,n.volume=e.getUint8(i)+e.getUint8(i+1)/8,i+=2,i+=2,i+=8,n.matrix=new Uint32Array(t.subarray(i,i+36)),i+=36,i+=24,n.nextTrackId=e.getUint32(i),n},pdin:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return{version:e.getUint8(0),flags:new Uint8Array(t.subarray(1,4)),rate:e.getUint32(4),initialDelay:e.getUint32(8)}},sdtp:function(t){for(var e={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]},i=4;i<t.byteLength;i++)e.samples.push({dependsOn:(48&t[i])>>4,isDependedOn:(12&t[i])>>2,hasRedundancy:3&t[i]});return e},sidx:function(t){for(var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:e.getUint32(4),timescale:e.getUint32(8),earliestPresentationTime:e.getUint32(12),firstOffset:e.getUint32(16)},n=e.getUint16(22),r=24;n;r+=12,n--)i.references.push({referenceType:(128&t[r])>>>7,referencedSize:2147483647&e.getUint32(r),subsegmentDuration:e.getUint32(r+4),startsWithSap:!!(128&t[r+8]),sapType:(112&t[r+8])>>>4,sapDeltaTime:268435455&e.getUint32(r+8)});return i},smhd:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),balance:t[4]+t[5]/256}},stbl:function(t){return{boxes:le(t)}},stco:function(t){for(var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),chunkOffsets:[]},n=e.getUint32(4),r=8;n;r+=4,n--)i.chunkOffsets.push(e.getUint32(r));return i},stsc:function(t){for(var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i=e.getUint32(4),n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleToChunks:[]},r=8;i;r+=12,i--)n.sampleToChunks.push({firstChunk:e.getUint32(r),samplesPerChunk:e.getUint32(r+4),sampleDescriptionIndex:e.getUint32(r+8)});return n},stsd:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleDescriptions:le(t.subarray(8))}},stsz:function(t){for(var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleSize:e.getUint32(4),entries:[]},n=12;n<t.byteLength;n+=4)i.entries.push(e.getUint32(n));return i},stts:function(t){for(var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),timeToSamples:[]},n=e.getUint32(4),r=8;n;r+=8,n--)i.timeToSamples.push({sampleCount:e.getUint32(r),sampleDelta:e.getUint32(r+4)});return i},styp:function(t){return ue.ftyp(t)},tfdt:function(t){var e={version:t[0],flags:new Uint8Array(t.subarray(1,4)),baseMediaDecodeTime:t[4]<<24|t[5]<<16|t[6]<<8|t[7]};return 1===e.version&&(e.baseMediaDecodeTime*=Math.pow(2,32),e.baseMediaDecodeTime+=t[8]<<24|t[9]<<16|t[10]<<8|t[11]),e},tfhd:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),trackId:e.getUint32(4)},n=1&i.flags[2],r=2&i.flags[2],a=8&i.flags[2],s=16&i.flags[2],o=32&i.flags[2],u=65536&i.flags[0],l=131072&i.flags[0],t=8;return n&&(t+=4,i.baseDataOffset=e.getUint32(12),t+=4),r&&(i.sampleDescriptionIndex=e.getUint32(t),t+=4),a&&(i.defaultSampleDuration=e.getUint32(t),t+=4),s&&(i.defaultSampleSize=e.getUint32(t),t+=4),o&&(i.defaultSampleFlags=e.getUint32(t)),u&&(i.durationIsEmpty=!0),!n&&l&&(i.baseDataOffsetIsMoof=!0),i},tkhd:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i=4,n={version:e.getUint8(0),flags:new Uint8Array(t.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=re(e.getUint32(i)),i+=8,n.modificationTime=re(e.getUint32(i)),i+=4,n.trackId=e.getUint32(i),i+=4,i+=8):(n.creationTime=re(e.getUint32(i)),i+=4,n.modificationTime=re(e.getUint32(i)),i+=4,n.trackId=e.getUint32(i),i+=4,i+=4),n.duration=e.getUint32(i),i+=4,i+=8,n.layer=e.getUint16(i),i+=2,n.alternateGroup=e.getUint16(i),i+=2,n.volume=e.getUint8(i)+e.getUint8(i+1)/8,i+=2,i+=2,n.matrix=new Uint32Array(t.subarray(i,i+36)),i+=36,n.width=e.getUint16(i)+e.getUint16(i+2)/16,i+=4,n.height=e.getUint16(i)+e.getUint16(i+2)/16,n},traf:function(t){return{boxes:le(t)}},trak:function(t){return{boxes:le(t)}},trex:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),trackId:e.getUint32(4),defaultSampleDescriptionIndex:e.getUint32(8),defaultSampleDuration:e.getUint32(12),defaultSampleSize:e.getUint32(16),sampleDependsOn:3&t[20],sampleIsDependedOn:(192&t[21])>>6,sampleHasRedundancy:(48&t[21])>>4,samplePaddingValue:(14&t[21])>>1,sampleIsDifferenceSample:!!(1&t[21]),sampleDegradationPriority:e.getUint16(22)}},trun:function(t){var e,i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]},n=new DataView(t.buffer,t.byteOffset,t.byteLength),r=1&i.flags[2],a=4&i.flags[2],s=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),a&&c&&(e={flags:ae(t.subarray(h,h+4))},h+=4,s&&(e.duration=n.getUint32(h),h+=4),o&&(e.size=n.getUint32(h),h+=4),l&&(e.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(e),c--);c--;)e={},s&&(e.duration=n.getUint32(h),h+=4),o&&(e.size=n.getUint32(h),h+=4),u&&(e.flags=ae(t.subarray(h,h+4)),h+=4),l&&(e.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(e);return i},"url ":function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4))}},vmhd:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),graphicsmode:e.getUint16(4),opcolor:new Uint16Array([e.getUint16(6),e.getUint16(8),e.getUint16(10)])}}},le=function(t){for(var e,i,n,r,a,s=0,o=[],u=new ArrayBuffer(t.length),l=new Uint8Array(u),c=0;c<t.length;++c)l[c]=t[c];for(e=new DataView(u);s<t.byteLength;)i=e.getUint32(s),n=oe(t.subarray(s+4,s+8)),r=1<i?s+i:t.byteLength,(a=(ue[n]||function(t){return{data:t}})(t.subarray(s+8,r))).size=i,a.type=n,o.push(a),s=r;return o},ce=function(t,e){var r;return e=e||0,r=new Array(2*e+1).join(" "),t.map(function(n,t){return r+n.type+"\n"+Object.keys(n).filter(function(t){return"type"!==t&&"boxes"!==t}).map(function(t){var e=r+"  "+t+": ",i=n[t];if(i instanceof Uint8Array||i instanceof Uint32Array){t=Array.prototype.slice.call(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)).map(function(t){return" "+("00"+t.toString(16)).slice(-2)}).join("").match(/.{1,24}/g);return t?1===t.length?e+"<"+t.join("").slice(1)+">":e+"<\n"+t.map(function(t){return r+"  "+t}).join("\n")+"\n"+r+"  >":e+"<>"}return e+JSON.stringify(i,null,2).split("\n").map(function(t,e){return 0===e?t:r+"  "+t}).join("\n")}).join("\n")+(n.boxes?"\n"+ce(n.boxes,e+1):"")}).join("\n")},he={inspect:le,textify:ce,parseTfdt:ue.tfdt,parseHdlr:ue.hdlr,parseTfhd:ue.tfhd,parseTrun:ue.trun},de=t,pe=G.CaptionStream,fe={generator:V,probe:X,Transmuxer:$.Transmuxer,AudioSegmentStream:$.AudioSegmentStream,VideoSegmentStream:$.VideoSegmentStream,CaptionParser:function(){var e,s,o,u,l,t=!1;this.isInitialized=function(){return t},this.init=function(){e=new pe,t=!0,e.on("data",function(t){t.startTime=t.startPts/u,t.endTime=t.endPts/u,l.captions.push(t),l.captionStreams[t.stream]=!0})},this.isNewInit=function(t,e){return!(t&&0===t.length||e&&"object"==typeof e&&0===Object.keys(e).length)&&(o!==t[0]||u!==e[o])},this.parse=function(t,e,i){var n,r;if(!this.isInitialized())return null;if(!e||!i)return null;if(this.isNewInit(e,i))o=e[0],u=i[o];else if(!o||!u)return s.push(t),null;for(;0<s.length;){var a=s.shift();this.parse(a,e,i)}return n=t,r=u,null!==(r=(t=o)?{seiNals:se(n,t)[t],timescale:r}:null)&&r.seiNals?(this.pushNals(r.seiNals),this.flushStream(),l):null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach(function(t){e.push(t)})},this.flushStream=function(){if(!this.isInitialized())return null;e.flush()},this.clearParsedCaptions=function(){l.captions=[],l.captionStreams={}},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){s=[],u=o=null,l?this.clearParsedCaptions():l={captions:[],captionStreams:{}},this.resetCaptionStream()},this.reset()}},me=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function ge(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var ye=(function(t,e,i){return e&&ge(t.prototype,e),i&&ge(t,i),t}(ve,[{key:"init",value:function(){var i,t;this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new fe.Transmuxer(this.options),i=this.self,(t=this.transmuxer).on("data",function(t){var e=t.initSegment;t.initSegment={data:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength};e=t.data;t.data=e.buffer,i.postMessage({action:"data",segment:t,byteOffset:e.byteOffset,byteLength:e.byteLength},[t.data])}),t.captionStream&&t.captionStream.on("data",function(t){i.postMessage({action:"caption",data:t})}),t.on("done",function(t){i.postMessage({action:"done"})}),t.on("gopInfo",function(t){i.postMessage({action:"gopInfo",gopInfo:t})})}},{key:"push",value:function(t){t=new Uint8Array(t.data,t.byteOffset,t.byteLength);this.transmuxer.push(t)}},{key:"reset",value:function(){this.init()}},{key:"setTimestampOffset",value:function(t){t=t.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(9e4*t))}},{key:"setAudioAppendStart",value:function(t){this.transmuxer.setAudioAppendStart(Math.ceil(9e4*t.appendStart))}},{key:"flush",value:function(t){this.transmuxer.flush()}},{key:"resetCaptions",value:function(){this.transmuxer.resetCaptions()}},{key:"alignGopsWith",value:function(t){this.transmuxer.alignGopsWith(t.gopsToAlignWith.slice())}}]),ve);function ve(t,e){me(this,ve),this.options=e||{},this.self=t,this.init()}!function(e){e.onmessage=function(t){"init"===t.data.action&&t.data.options?this.messageHandlers=new ye(e,t.data.options):(this.messageHandlers||(this.messageHandlers=new ye(e)),t.data&&t.data.action&&"init"!==t.data.action&&this.messageHandlers[t.data.action]&&this.messageHandlers[t.data.action](t.data))}}(_e)}()}),el={videoCodec:"avc1",videoObjectTypeIndicator:".4d400d",audioProfile:"2"},il=function(t){return/mp4a\.\d+.\d+/i.test(t)},nl=function(t){return/avc1\.[\da-f]+/i.test(t)},rl=function(t,e,i){var n=null,r=null,a=0,s=[],o=[];if(!t&&!e)return tr.createTimeRange();if(!t)return e.buffered;if(!e)return t.buffered;if(i)return t.buffered;if(0===t.buffered.length&&0===e.buffered.length)return tr.createTimeRange();for(var u=t.buffered,l=e.buffered,c=u.length;c--;)s.push({time:u.start(c),type:"start"}),s.push({time:u.end(c),type:"end"});for(c=l.length;c--;)s.push({time:l.start(c),type:"start"}),s.push({time:l.end(c),type:"end"});for(s.sort(function(t,e){return t.time-e.time}),c=0;c<s.length;c++)"start"===s[c].type?2===++a&&(n=s[c].time):"end"===s[c].type&&1===--a&&(r=s[c].time),null!==n&&null!==r&&(o.push([n,r]),r=n=null);return tr.createTimeRanges(o)},al=(Vt=tr.EventTarget,di(sl,Vt),ae(sl,[{key:"data_",value:function(t){var e=t.data.segment;e.data=new Uint8Array(e.data,t.data.byteOffset,t.data.byteLength),e.initSegment=new Uint8Array(e.initSegment.data,e.initSegment.byteOffset,e.initSegment.byteLength),function(t,e,i){var n,r=e.player_;if(i.captions&&i.captions.length)for(var a in t.inbandTextTracks_||(t.inbandTextTracks_={}),i.captionStreams)t.inbandTextTracks_[a]||(r.tech_.trigger({type:"usage",name:"hls-608"}),n=r.textTracks().getTrackById(a),t.inbandTextTracks_[a]=n||r.addRemoteTextTrack({kind:"captions",id:a,label:a},!1).track);i.metadata&&i.metadata.length&&!t.metadataTrack_&&(t.metadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,t.metadataTrack_.inBandMetadataTrackDispatchType=i.metadata.dispatchType)}(this,this.mediaSource_,e),this.pendingBuffers_.push(e)}},{key:"done_",value:function(t){"closed"!==this.mediaSource_.readyState?this.processPendingSegments_():this.pendingBuffers_.length=0}},{key:"createRealSourceBuffers_",value:function(){var n=this,r=["audio","video"];r.forEach(function(e){var t,i;n[e+"Codec_"]&&(n[e+"Buffer_"]||(i=null,n.mediaSource_[e+"Buffer_"]?(i=n.mediaSource_[e+"Buffer_"]).updating=!1:(t=e+'/mp4;codecs="'+n[e+"Codec_"]+'"',i=Zu(n.mediaSource_.nativeMediaSource_,t),n.mediaSource_[e+"Buffer_"]=i),n[e+"Buffer_"]=i,["update","updatestart","updateend"].forEach(function(t){i.addEventListener(t,function(){if("audio"!==e||!n.audioDisabled_)return"updateend"===t&&(n[e+"Buffer_"].updating=!1),r.every(function(t){return!("audio"!==t||!n.audioDisabled_)||(e===t||!n[t+"Buffer_"]||!n[t+"Buffer_"].updating)})?n.trigger(t):void 0})})))})}},{key:"appendBuffer",value:function(t){var e;this.bufferUpdating_=!0,this.audioBuffer_&&this.audioBuffer_.buffered.length&&(e=this.audioBuffer_.buffered,this.transmuxer_.postMessage({action:"setAudioAppendStart",appendStart:e.end(e.length-1)})),this.videoBuffer_&&this.transmuxer_.postMessage({action:"alignGopsWith",gopsToAlignWith:function(t,e,i){if(null==e||!t.length)return[];for(var n=Math.ceil(9e4*(e-i+3)),r=void 0,r=0;r<t.length&&!(t[r].pts>n);r++);return t.slice(r)}(this.gopBuffer_,this.mediaSource_.player_?this.mediaSource_.player_.currentTime():null,this.timeMapping_)}),this.transmuxer_.postMessage({action:"push",data:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength},[t.buffer]),this.transmuxer_.postMessage({action:"flush"})}},{key:"appendGopInfo_",value:function(t){this.gopBuffer_=function(t,e,i){if(!e.length)return t;if(i)return e.slice();for(var n=e[0].pts,r=0;r<t.length&&!(t[r].pts>=n);r++);return t.slice(0,r).concat(e)}(this.gopBuffer_,t.data.gopInfo,this.safeAppend_)}},{key:"remove",value:function(t,e){if(this.videoBuffer_&&(this.videoBuffer_.updating=!0,this.videoBuffer_.remove(t,e),this.gopBuffer_=function(t,e,i,n){for(var r=Math.ceil(9e4*(e-n)),a=Math.ceil(9e4*(i-n)),n=t.slice(),s=t.length;s--&&!(t[s].pts<=a););if(-1===s)return n;for(var o=s+1;o--&&!(t[o].pts<=r););return o=Math.max(o,0),n.splice(o,s-o+1),n}(this.gopBuffer_,t,e,this.timeMapping_)),!this.audioDisabled_&&this.audioBuffer_&&(this.audioBuffer_.updating=!0,this.audioBuffer_.remove(t,e)),Ou(t,e,this.metadataTrack_),this.inbandTextTracks_)for(var i in this.inbandTextTracks_)Ou(t,e,this.inbandTextTracks_[i])}},{key:"processPendingSegments_",value:function(){var t={video:{segments:[],bytes:0},audio:{segments:[],bytes:0},captions:[],metadata:[]},t=this.pendingBuffers_.reduce(function(t,e){var i=e.type,n=e.data,r=e.initSegment;return t[i].segments.push(n),t[i].bytes+=n.byteLength,t[i].initSegment=r,e.captions&&(t.captions=t.captions.concat(e.captions)),e.info&&(t[i].info=e.info),e.metadata&&(t.metadata=t.metadata.concat(e.metadata)),t},t);this.videoBuffer_||this.audioBuffer_||(0===t.video.bytes&&(this.videoCodec_=null),0===t.audio.bytes&&(this.audioCodec_=null),this.createRealSourceBuffers_()),t.audio.info&&this.mediaSource_.trigger({type:"audioinfo",info:t.audio.info}),t.video.info&&this.mediaSource_.trigger({type:"videoinfo",info:t.video.info}),this.appendAudioInitSegment_&&(!this.audioDisabled_&&this.audioBuffer_&&(t.audio.segments.unshift(t.audio.initSegment),t.audio.bytes+=t.audio.initSegment.byteLength),this.appendAudioInitSegment_=!1);var e=!1;this.videoBuffer_&&t.video.bytes?(t.video.segments.unshift(t.video.initSegment),t.video.bytes+=t.video.initSegment.byteLength,this.concatAndAppendSegments_(t.video,this.videoBuffer_),Pu(this,t.captions,t.metadata)):!this.videoBuffer_||!this.audioDisabled_&&this.audioBuffer_||(e=!0),!this.audioDisabled_&&this.audioBuffer_&&this.concatAndAppendSegments_(t.audio,this.audioBuffer_),this.pendingBuffers_.length=0,e&&this.trigger("updateend"),this.bufferUpdating_=!1}},{key:"concatAndAppendSegments_",value:function(t,e){var i=0,n=void 0;if(t.bytes){n=new Uint8Array(t.bytes),t.segments.forEach(function(t){n.set(t,i),i+=t.byteLength});try{e.updating=!0,e.appendBuffer(n)}catch(t){this.mediaSource_.player_&&this.mediaSource_.player_.error({code:-3,type:"APPEND_BUFFER_ERR",message:t.message,originalError:t})}}}},{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}}]),sl);function sl(t,e){qo(this,sl);var i=Qo(this,(sl.__proto__||Object.getPrototypeOf(sl)).call(this,tr.EventTarget));i.timestampOffset_=0,i.pendingBuffers_=[],i.bufferUpdating_=!1,i.mediaSource_=t,i.codecs_=e,i.audioCodec_=null,i.videoCodec_=null,i.audioDisabled_=!1,i.appendAudioInitSegment_=!0,i.gopBuffer_=[],i.timeMapping_=0,i.safeAppend_=11<=tr.browser.IE_VERSION;e={remux:!1,alignGopsAtEnd:i.safeAppend_};return i.codecs_.forEach(function(t){il(t)?i.audioCodec_=t:nl(t)&&(i.videoCodec_=t)}),i.transmuxer_=new tl,i.transmuxer_.postMessage({action:"init",options:e}),i.transmuxer_.onmessage=function(t){return"data"===t.data.action?i.data_(t):"done"===t.data.action?i.done_(t):"gopInfo"===t.data.action?i.appendGopInfo_(t):void 0},Object.defineProperty(i,"timestampOffset",{get:function(){return this.timestampOffset_},set:function(t){"number"==typeof t&&0<=t&&(this.timestampOffset_=t,this.appendAudioInitSegment_=!0,this.gopBuffer_.length=0,this.timeMapping_=0,this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:t}))}}),Object.defineProperty(i,"appendWindowStart",{get:function(){return(this.videoBuffer_||this.audioBuffer_).appendWindowStart},set:function(t){this.videoBuffer_&&(this.videoBuffer_.appendWindowStart=t),this.audioBuffer_&&(this.audioBuffer_.appendWindowStart=t)}}),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 rl(this.videoBuffer_,this.audioBuffer_,this.audioDisabled_)}}),i}var ol=(Ga=tr.EventTarget,di(ul,Ga),ae(ul,[{key:"addSeekableRange_",value:function(t,e){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;(e>this.nativeMediaSource_.duration||isNaN(this.nativeMediaSource_.duration))&&(this.nativeMediaSource_.duration=e)}},{key:"addSourceBuffer",value:function(t){var i,e,n=void 0,r=(i={type:"",parameters:{}},e=(e=t).trim().split(";"),i.type=e.shift().trim(),e.forEach(function(t){var e=t.trim().split("=");1<e.length&&(t=e[0].replace(/"/g,"").trim(),e=e[1].replace(/"/g,"").trim(),i.parameters[t]=e)}),i);return/^(video|audio)\/mp2t$/i.test(r.type)?(e=[],r.parameters&&r.parameters.codecs&&(e=r.parameters.codecs.split(","),e=(e=$u(e)).filter(function(t){return il(t)||nl(t)})),0===e.length&&(e=["avc1.4d400d","mp4a.40.2"]),n=new al(this,e),0!==this.sourceBuffers.length&&(this.sourceBuffers[0].createRealSourceBuffers_(),n.createRealSourceBuffers_(),this.sourceBuffers[0].audioDisabled_=!0)):n=this.nativeMediaSource_.addSourceBuffer(t),this.sourceBuffers.push(n),n}}]),ul);function ul(){qo(this,ul);var a=Qo(this,(ul.__proto__||Object.getPrototypeOf(ul)).call(this)),t=void 0;for(t in a.nativeMediaSource_=new d.MediaSource,a.nativeMediaSource_)t in ul.prototype||"function"!=typeof a.nativeMediaSource_[t]||(a[t]=a.nativeMediaSource_[t].bind(a.nativeMediaSource_));return a.duration_=NaN,Object.defineProperty(a,"duration",{get:function(){return this.duration_===1/0?this.duration_:this.nativeMediaSource_.duration},set:function(t){(this.duration_=t)!==1/0&&(this.nativeMediaSource_.duration=t)}}),Object.defineProperty(a,"seekable",{get:function(){return this.duration_===1/0?tr.createTimeRanges([[0,this.nativeMediaSource_.duration]]):this.nativeMediaSource_.seekable}}),Object.defineProperty(a,"readyState",{get:function(){return this.nativeMediaSource_.readyState}}),Object.defineProperty(a,"activeSourceBuffers",{get:function(){return this.activeSourceBuffers_}}),a.sourceBuffers=[],a.activeSourceBuffers_=[],a.updateActiveSourceBuffers_=function(){if(a.activeSourceBuffers_.length=0,1===a.sourceBuffers.length){var t=a.sourceBuffers[0];return t.appendAudioInitSegment_=!0,t.audioDisabled_=!t.audioCodec_,void a.activeSourceBuffers_.push(t)}for(var i=!1,n=!0,e=0;e<a.player_.audioTracks().length;e++){var r=a.player_.audioTracks()[e];if(r.enabled&&"main"!==r.kind){n=!(i=!0);break}}a.sourceBuffers.forEach(function(t,e){if(t.appendAudioInitSegment_=!0,t.videoCodec_&&t.audioCodec_)t.audioDisabled_=i;else if(t.videoCodec_&&!t.audioCodec_)t.audioDisabled_=!0,n=!1;else if(!t.videoCodec_&&t.audioCodec_&&(t.audioDisabled_=e?n:!n,t.audioDisabled_))return;a.activeSourceBuffers_.push(t)})},a.onPlayerMediachange_=function(){a.sourceBuffers.forEach(function(t){t.appendAudioInitSegment_=!0})},a.onHlsReset_=function(){a.sourceBuffers.forEach(function(t){t.transmuxer_&&t.transmuxer_.postMessage({action:"resetCaptions"})})},a.onHlsSegmentTimeMapping_=function(e){a.sourceBuffers.forEach(function(t){return t.timeMapping_=e.mapping})},["sourceopen","sourceclose","sourceended"].forEach(function(t){this.nativeMediaSource_.addEventListener(t,this.trigger.bind(this))},a),a.on("sourceopen",function(t){var e=h.querySelector('[src="'+a.url_+'"]');e&&(a.player_=tr(e.parentNode),a.player_&&(a.player_.tech_.on("hls-reset",a.onHlsReset_),a.player_.tech_.on("hls-segment-time-mapping",a.onHlsSegmentTimeMapping_),a.player_.audioTracks&&a.player_.audioTracks()&&(a.player_.audioTracks().on("change",a.updateActiveSourceBuffers_),a.player_.audioTracks().on("addtrack",a.updateActiveSourceBuffers_),a.player_.audioTracks().on("removetrack",a.updateActiveSourceBuffers_)),a.player_.on("mediachange",a.onPlayerMediachange_)))}),a.on("sourceended",function(t){for(var e=Nu(a.duration),i=0;i<a.sourceBuffers.length;i++){var n=a.sourceBuffers[i],n=n.metadataTrack_&&n.metadataTrack_.cues;n&&n.length&&(n[n.length-1].endTime=e)}}),a.on("sourceclose",function(t){this.sourceBuffers.forEach(function(t){t.transmuxer_&&t.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_)))}),a}var ll=0;tr.mediaSources={};function cl(t,e){if(!(t=tr.mediaSources[t]))throw new Error("Media Source not found (Video.js)");t.trigger({type:"sourceopen",swfId:e})}function hl(){return!!d.MediaSource&&!!d.MediaSource.isTypeSupported&&d.MediaSource.isTypeSupported('video/mp4;codecs="avc1.4d400d,mp4a.40.2"')}rr=function(){if(this.MediaSource={open:cl,supportsNativeMediaSources:hl},hl())return new ol;throw new Error("Cannot use create a virtual MediaSource for this video")};rr.open=cl,rr.supportsNativeMediaSources=hl;Vt={createObjectURL:function(t){var e=void 0;return t instanceof ol?(e=d.URL.createObjectURL(t.nativeMediaSource_),t.url_=e):t instanceof ol?(e="blob:vjs-media-source/"+ll,ll++,tr.mediaSources[e]=t,e):(e=d.URL.createObjectURL(t),t.url_=e)}};tr.MediaSource=rr,tr.URL=Vt;function dl(t,e){for(var a=pl(t,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod}),i=0;i<e.playlists.length;i++){var n=Xo(a,e.playlists[i]);n&&(a=n)}return Go(e,function(t,e,i,n){var r;t.playlists&&t.playlists.length&&(r=t.playlists[0].uri,(t=Xo(a,t.playlists[0]))&&((a=t).mediaGroups[e][i][n].playlists[0]=a.playlists[r]))}),a}var Ga=tr.EventTarget,pl=tr.mergeOptions,fl=(di(ml,Ga),ae(ml,[{key:"dispose",value:function(){this.stopRequest(),d.clearTimeout(this.mediaUpdateTimeout)}},{key:"stopRequest",value:function(){var t;this.request&&(t=this.request,this.request=null,t.onreadystatechange=null,t.abort())}},{key:"media",value:function(t){if(!t)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var e=this.state;if("string"==typeof t){if(!this.master.playlists[t])throw new Error("Unknown playlist URI: "+t);t=this.master.playlists[t]}var i=!this.media_||t.uri!==this.media_.uri;this.state="HAVE_METADATA",i&&(this.media_&&this.trigger("mediachanging"),this.media_=t,this.refreshMedia_(),"HAVE_MASTER"!==e&&this.trigger("mediachange"))}},{key:"pause",value:function(){this.stopRequest(),d.clearTimeout(this.mediaUpdateTimeout),"HAVE_NOTHING"===this.state&&(this.started=!1)}},{key:"load",value:function(t){var e=this;d.clearTimeout(this.mediaUpdateTimeout);var i=this.media();t?(i=i?i.targetDuration/2*1e3:5e3,this.mediaUpdateTimeout=d.setTimeout(function(){return e.load()},i)):this.started?this.trigger("loadedplaylist"):this.start()}},{key:"parseMasterXml",value:function(){var r=ea(this.masterXml_,{manifestUri:this.srcUrl,clientOffset:this.clientOffset_});r.uri=this.srcUrl;for(var t=0;t<r.playlists.length;t++){var e="placeholder-uri-"+t;r.playlists[t].uri=e,r.playlists[e]=r.playlists[t]}return Go(r,function(t,e,i,n){t.playlists&&t.playlists.length&&(n="placeholder-uri-"+e+"-"+i+"-"+n,t.playlists[0].uri=n,r.playlists[n]=t.playlists[0])}),Yo(r),$o(r),r}},{key:"start",value:function(){var i=this;this.started=!0,this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},function(t,e){if(i.request){if(i.request=null,t)return i.error={status:e.status,message:"DASH playlist request error at URL: "+i.srcUrl,responseText:e.responseText,code:2},"HAVE_NOTHING"===i.state&&(i.started=!1),i.trigger("error");i.masterXml_=e.responseText,e.responseHeaders&&e.responseHeaders.date?i.masterLoaded_=Date.parse(e.responseHeaders.date):i.masterLoaded_=Date.now(),i.syncClientServerClock_(i.onClientServerClockSync_.bind(i))}})}},{key:"syncClientServerClock_",value:function(i){var n=this,r=ia(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:Ho(this.srcUrl,r.value),method:r.method,withCredentials:this.withCredentials},function(t,e){if(n.request){if(t)return n.clientOffset_=n.masterLoaded_-Date.now(),i();t=void 0,t="HEAD"===r.method?e.responseHeaders&&e.responseHeaders.date?Date.parse(e.responseHeaders.date):n.masterLoaded_:Date.parse(e.responseText);n.clientOffset_=t-Date.now(),i()}}))}},{key:"onClientServerClockSync_",value:function(){var t=this;this.master=this.parseMasterXml(),this.state="HAVE_MASTER",this.trigger("loadedplaylist"),this.media_||this.media(this.master.playlists[0]),d.setTimeout(function(){t.trigger("loadedmetadata")},0),this.master.minimumUpdatePeriod&&d.setTimeout(function(){t.trigger("minimumUpdatePeriod")},this.master.minimumUpdatePeriod)}},{key:"refreshXml_",value:function(){var i=this;this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},function(t,e){if(i.request){if(i.request=null,t)return i.error={status:e.status,message:"DASH playlist request error at URL: "+i.srcUrl,responseText:e.responseText,code:2},"HAVE_NOTHING"===i.state&&(i.started=!1),i.trigger("error");i.masterXml_=e.responseText;e=i.parseMasterXml();i.master=dl(i.master,e),d.setTimeout(function(){i.trigger("minimumUpdatePeriod")},i.master.minimumUpdatePeriod)}})}},{key:"refreshMedia_",value:function(){var t=this,e=void 0,i=void 0,i=this.masterPlaylistLoader_?(e=this.masterPlaylistLoader_.master,this.masterPlaylistLoader_.parseMasterXml()):(e=this.master,this.parseMasterXml()),i=dl(e,i);i?(this.masterPlaylistLoader_?this.masterPlaylistLoader_.master=i:this.master=i,this.media_=i.playlists[this.media_.uri]):this.trigger("playlistunchanged"),this.media().endList||(this.mediaUpdateTimeout=d.setTimeout(function(){t.trigger("mediaupdatetimeout")},Ko(this.media(),!!i))),this.trigger("loadedplaylist")}}]),ml);function ml(t,e,i,n){qo(this,ml);var r=Qo(this,(ml.__proto__||Object.getPrototypeOf(ml)).call(this));if(r.hls_=e,r.withCredentials=i,!t)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_()}),"string"==typeof t?(r.srcUrl=t,r.state="HAVE_NOTHING",Qo(r)):(r.masterPlaylistLoader_=n,r.state="HAVE_METADATA",r.started=!0,r.media(t),d.setTimeout(function(){r.trigger("loadedmetadata")},0),r)}var gl=function(t){return tr.log.debug?tr.log.debug.bind(tr,"VHS:",t+" >"):function(){}};function yl(){}var vl=(ae(_l,[{key:"createSourceBuffer_",value:function(t,e){var i=this;this.sourceBuffer_=this.mediaSource.addSourceBuffer(t),this.logger_("created SourceBuffer"),e&&(e.trigger("sourcebufferadded"),this.mediaSource.sourceBuffers.length<2)?e.on("sourcebufferadded",function(){i.start_()}):this.start_()}},{key:"start_",value:function(){var e=this;this.started_=!0,this.onUpdateendCallback_=function(){var t=e.pendingCallback_;e.pendingCallback_=null,e.logger_("buffered ["+Au(e.buffered())+"]"),t&&t(),e.runCallback_()},this.sourceBuffer_.addEventListener("updateend",this.onUpdateendCallback_),this.runCallback_()}},{key:"abort",value:function(t){var e=this;this.processedAppend_&&this.queueCallback_(function(){e.sourceBuffer_.abort()},t)}},{key:"appendBuffer",value:function(t,e){var i=this;this.processedAppend_=!0,this.queueCallback_(function(){i.sourceBuffer_.appendBuffer(t)},e)}},{key:"buffered",value:function(){return this.sourceBuffer_?this.sourceBuffer_.buffered:tr.createTimeRanges()}},{key:"remove",value:function(t,e){var i=this,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:yl;this.processedAppend_&&this.queueCallback_(function(){i.logger_("remove ["+t+" => "+e+"]"),i.sourceBuffer_.remove(t,e)},n)}},{key:"updating",value:function(){return!this.sourceBuffer_||this.sourceBuffer_.updating||this.pendingCallback_}},{key:"timestampOffset",value:function(t){var e=this;return void 0!==t&&(this.queueCallback_(function(){e.sourceBuffer_.timestampOffset=t}),this.timestampOffset_=t),this.timestampOffset_}},{key:"queueCallback_",value:function(t,e){this.callbacks_.push([t.bind(this),e]),this.runCallback_()}},{key:"runCallback_",value:function(){var t=void 0;!this.updating()&&this.callbacks_.length&&this.started_&&(t=this.callbacks_.shift(),this.pendingCallback_=t[1],t[0]())}},{key:"dispose",value:function(){this.sourceBuffer_.removeEventListener("updateend",this.onUpdateendCallback_),this.sourceBuffer_&&"open"===this.mediaSource.readyState&&this.sourceBuffer_.abort()}}]),_l);function _l(t,e,i,n){qo(this,_l),this.callbacks_=[],this.pendingCallback_=null,this.timestampOffset_=0,this.mediaSource=t,this.processedAppend_=!1,this.type_=i,this.mimeType_=e,this.logger_=gl("SourceUpdater["+i+"]["+e+"]"),"closed"===t.readyState?t.addEventListener("sourceopen",this.createSourceBuffer_.bind(this,e,n)):this.createSourceBuffer_(e,n)}function bl(t){var e,i={};return t.byterange&&(i.Range=(e=t.byterange,t=e.offset+e.length-1,"bytes="+e.offset+"-"+t)),i}function Tl(t){t.forEach(function(t){t.abort()})}function Sl(t,e){return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:Dl,xhr:e}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:Rl,xhr:e}:t?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:xl,xhr:e}:null}function kl(r,a,s){return function(t,e){var i=e.response,n=Sl(t,e),t=void 0;return n?s(n,r):0===i.byteLength?s({status:e.status,message:"Empty HLS segment content at URL: "+e.uri,code:xl,xhr:e},r):(r.stats={bandwidth:(i=e).bandwidth,bytesReceived:i.bytesReceived||0,roundTripTime:i.roundTripTime||0},r.key?r.encryptedBytes=new Uint8Array(e.response):r.bytes=new Uint8Array(e.response),r.map&&r.map.bytes&&(a.isInitialized()||a.init(),(t=a.parse(r.bytes,r.map.videoTrackIds,r.map.timescales))&&t.captions&&(r.captionStreams=t.captionStreams,r.fmp4Captions=t.captions)),s(null,r))}}function wl(e,i,n){function r(t){if(t.data.source===i.requestId){e.removeEventListener("message",r);t=t.data.decrypted;return i.bytes=new Uint8Array(t.bytes,t.byteOffset,t.byteLength),n(null,i)}}e.addEventListener("message",r),e.postMessage(yu({source:i.requestId,encrypted:i.encryptedBytes,key:i.key.bytes,iv:i.key.iv}),[i.encryptedBytes.buffer,i.key.bytes.buffer])}function Cl(n,r){return function(t){var e,i;return n.stats=tr.mergeOptions(n.stats,(i=(e=t).target,(i={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-i.requestTime||0}).bytesReceived=e.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3),i)),!n.stats.firstBytesReceivedAt&&n.stats.bytesReceived&&(n.stats.firstBytesReceivedAt=Date.now()),r(t,n)}}function El(t,e,i,n,r,a,s){var o,u,l,c,h,d,p,f,m,g,y,v=[],s=(o=v,u=i,l=s,c=0,h=!1,function(t,e){if(!h)return t?(h=!0,Tl(o),l(t,e)):(c+=1)===o.length?(e.endOfAllRequests=Date.now(),e.encryptedBytes?wl(u,e,l):l(null,e)):void 0});return r.key&&(f=t(tr.mergeOptions(e,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),(d=r,p=s,function(t,e){var i=e.response,t=Sl(t,e);if(t)return p(t,d);if(16!==i.byteLength)return p({status:e.status,message:"Invalid HLS key at URL: "+e.uri,code:xl,xhr:e},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)})),v.push(f)),r.map&&!r.map.bytes&&(f=t(tr.mergeOptions(e,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:bl(r.map)}),(m=r,g=n,y=s,function(t,e){var i=e.response,t=Sl(t,e);return t?y(t,m):0===i.byteLength?y({status:e.status,message:"Empty HLS segment content at URL: "+e.uri,code:xl,xhr:e},m):(m.map.bytes=new Uint8Array(e.response),g.isInitialized()||g.init(),m.map.timescales=Ya.timescale(m.map.bytes),m.map.videoTrackIds=Ya.videoTrackIds(m.map.bytes),y(null,m))})),v.push(f)),(s=t(tr.mergeOptions(e,{uri:r.resolvedUri,responseType:"arraybuffer",headers:bl(r)}),kl(r,n,s))).addEventListener("progress",Cl(r,a)),v.push(s),function(){return Tl(v)}}function Al(t,e){var i;return t&&(i=d.getComputedStyle(t))?i[e]:""}function Ll(t,n){var r=t.slice();t.sort(function(t,e){var i=n(t,e);return 0===i?r.indexOf(t)-r.indexOf(e):i})}function Ol(t,e){var i=void 0,n=void 0;return t.attributes.BANDWIDTH&&(i=t.attributes.BANDWIDTH),i=i||d.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(n=e.attributes.BANDWIDTH),i-(n=n||d.Number.MAX_VALUE)}function Pl(t,e,i){return!(!t||!e)&&(i=i===t.segments.length,t.endList&&"open"===e.readyState&&i)}function Ul(t){return"number"==typeof t&&isFinite(t)}var Il={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},xl=2,Dl=-101,Rl=-102,Ml=(Ga=tr.EventTarget,di(Bl,Ga),ae(Bl,[{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.state="DISPOSED",this.pause(),this.abort_(),this.sourceUpdater_&&this.sourceUpdater_.dispose(),this.resetStats_(),this.captionParser_.reset()}},{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(t){return void 0!==t&&(this.error_=t),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():tr.createTimeRanges()}},{key:"initSegment",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]&&arguments[1];if(!t)return null;var i=vu(t),n=this.initSegments_[i];return e&&!n&&t.bytes&&(this.initSegments_[i]=n={resolvedUri:t.resolvedUri,byterange:t.byterange,bytes:t.bytes,timescales:t.timescales,videoTrackIds:t.videoTrackIds}),n||t}},{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 vl(this.mediaSource_,this.mimeType_,this.loaderType_,this.sourceBufferEmitter_),this.resetEverything(),this.monitorBuffer_()}},{key:"playlist",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(t){var i=this.playlist_,n=this.pendingSegment_;this.playlist_=t,this.xhrOptions_=e,this.hasPlayed_()||(t.syncInfo={mediaSequence:t.mediaSequence,time:0});e=i?i.id:null;if(this.logger_("playlist update ["+e+" => "+t.id+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();i&&i.uri===t.uri?(e=t.mediaSequence-i.mediaSequence,this.logger_("live window shift ["+e+"]"),null!==this.mediaIndex&&(this.mediaIndex-=e),n&&(n.mediaIndex-=e,0<=n.mediaIndex&&(n.segment=t.segments[n.mediaIndex])),this.syncController_.saveExpiredSegmentInfo(i,t)):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(t,e){this.mimeType_||(this.mimeType_=t,this.sourceBufferEmitter_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_())}},{key:"resetEverything",value:function(t){this.ended_=!1,this.resetLoader(),this.remove(0,this.duration_(),t),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(t,e,i){if(this.sourceUpdater_&&this.sourceUpdater_.remove(t,e,i),Ou(t,e,this.segmentMetadataTrack_),this.inbandTextTracks_)for(var n in this.inbandTextTracks_)Ou(t,e,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 t;this.sourceUpdater_.updating()||(this.syncPoint_||(this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_())),(t=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_))&&(Pl(this.playlist_,this.mediaSource_,t.mediaIndex)?this.endOfStream():t.mediaIndex===this.playlist_.segments.length-1&&"ended"===this.mediaSource_.readyState&&!this.seeking_()||((t.timeline!==this.currentTimeline_||null!==t.startOfSegment&&t.startOfSegment<this.sourceUpdater_.timestampOffset())&&(this.syncController_.reset(),t.timestampOffset=t.startOfSegment,this.captionParser_.clearAllCaptions()),this.loadSegment_(t))))}},{key:"checkBuffer_",value:function(t,e,i,n,r,a){var s=0,o=void 0;t.length&&(s=t.end(t.length-1));t=Math.max(0,s-r);if(!e.segments.length)return null;if(t>=this.goalBufferLength_())return null;if(!n&&1<=t)return null;if(null===a)return i=this.getSyncSegmentCandidate_(e),this.generateSegmentInfo_(e,i,null,!0);if(null===i)return o=this.fetchAtBuffer_?(i=(t=Du.getMediaInfoForTime(e,s,a.segmentIndex,a.time)).mediaIndex,t.startTime):(i=(u=Du.getMediaInfoForTime(e,r,a.segmentIndex,a.time)).mediaIndex,u.startTime),this.generateSegmentInfo_(e,i,o,!1);var u=e.segments[i],o=u&&u.end?u.end:s;return this.generateSegmentInfo_(e,i+1,o,!1)}},{key:"getSyncSegmentCandidate_",value:function(t){var e=this;if(-1===this.currentTimeline_)return 0;var i=t.segments.map(function(t,e){return{timeline:t.timeline,segmentIndex:e}}).filter(function(t){return t.timeline===e.currentTimeline_});return i.length?i[Math.min(i.length-1,1)].segmentIndex:Math.max(t.segments.length-1,0)}},{key:"generateSegmentInfo_",value:function(t,e,i,n){if(e<0||e>=t.segments.length)return null;var r=t.segments[e];return{requestId:"segment-loader-"+Math.random(),uri:r.resolvedUri,mediaIndex:e,isSyncRequest:n,startOfSegment:i,playlist:t,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:r.timeline,duration:r.duration,segment:r}}},{key:"abortRequestEarly_",value:function(t){if(this.hls_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)return!1;if(Date.now()-(t.firstBytesReceivedAt||Date.now())<1e3)return!1;var e=this.currentTime_(),i=t.bandwidth,n=this.pendingSegment_.duration,r=Du.estimateSegmentRequestTime(n,i,this.playlist_,t.bytesReceived),t=function(t,e){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1;return((t.length?t.end(t.length-1):0)-e)/i}(this.buffered_(),e,this.hls_.tech_.playbackRate())-1;if(r<=t)return!1;n=function(t){var e=t.master,i=t.currentTime,n=t.bandwidth,r=t.duration,a=t.segmentDuration,s=t.timeUntilRebuffer,o=t.currentTimeline,u=t.syncController,t=e.playlists.filter(function(t){return!Du.isIncompatible(t)}),e=t.filter(Du.isEnabled);e.length||(e=t.filter(function(t){return!Du.isDisabled(t)}));t=e.filter(Du.hasAttribute.bind(null,"BANDWIDTH")).map(function(t){var e=u.getSyncPoint(t,r,o,i)?1:2;return{playlist:t,rebufferingImpact:Du.estimateSegmentRequestTime(a,n,t)*e-s}}),e=t.filter(function(t){return t.rebufferingImpact<=0});return Ll(e,function(t,e){return Ol(e.playlist,t.playlist)}),e.length?e[0]:(Ll(t,function(t,e){return t.rebufferingImpact-e.rebufferingImpact}),t[0]||null)}({master:this.hls_.playlists.master,currentTime:e,bandwidth:i,duration:this.duration_(),segmentDuration:n,timeUntilRebuffer:t,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(n){r=r-t-n.rebufferingImpact,t=t<=Bu?1:.5;return!n.playlist||n.playlist.uri===this.playlist_.uri||r<t?!1:(this.bandwidth=n.playlist.attributes.BANDWIDTH*Il.BANDWIDTH_VARIANCE+1,this.abort(),this.trigger("earlyabort"),!0)}}},{key:"handleProgress_",value:function(t,e){this.pendingSegment_&&e.requestId===this.pendingSegment_.requestId&&!this.abortRequestEarly_(e.stats)&&this.trigger("progress")}},{key:"loadSegment_",value:function(t){this.state="WAITING",this.pendingSegment_=t,this.trimBackBuffer_(t),t.abortRequests=El(this.hls_.xhr,this.xhrOptions_,this.decrypter_,this.captionParser_,this.createSimplifiedSegmentObj_(t),this.handleProgress_.bind(this),this.segmentRequestFinished_.bind(this))}},{key:"trimBackBuffer_",value:function(t){var e,i,n,r,n=(e=this.seekable_(),i=this.currentTime_(),n=this.playlist_.targetDuration||10,r=void 0,r=e.length&&0<e.start(0)&&e.start(0)<i?e.start(0):i-30,Math.min(r,i-n));0<n&&this.remove(0,n)}},{key:"createSimplifiedSegmentObj_",value:function(t){var e=t.segment,i={resolvedUri:e.resolvedUri,byterange:e.byterange,requestId:t.requestId};return e.key&&(t=e.key.iv||new Uint32Array([0,0,0,t.mediaIndex+t.playlist.mediaSequence]),i.key={resolvedUri:e.key.resolvedUri,iv:t}),e.map&&(i.map=this.initSegment(e.map)),i}},{key:"segmentRequestFinished_",value:function(t,e){if(this.mediaRequests+=1,e.stats&&(this.mediaBytesTransferred+=e.stats.bytesReceived,this.mediaTransferDuration+=e.stats.roundTripTime),this.pendingSegment_){if(e.requestId===this.pendingSegment_.requestId){if(t)return this.pendingSegment_=null,this.state="READY",t.code===Rl?void(this.mediaRequestsAborted+=1):(this.pause(),t.code===Dl?(this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,void this.trigger("bandwidthupdate")):(this.mediaRequestsErrored+=1,this.error(t),void this.trigger("error")));this.bandwidth=e.stats.bandwidth,this.roundTrip=e.stats.roundTripTime,e.map&&(e.map=this.initSegment(e.map,!0)),this.processSegmentResponse_(e)}}else this.mediaRequestsAborted+=1}},{key:"processSegmentResponse_",value:function(r){var t,a,s,o,e=this.pendingSegment_;e.bytes=r.bytes,r.map&&(e.segment.map.bytes=r.map.bytes),e.endOfAllRequests=r.endOfAllRequests,r.fmp4Captions&&(function(t,e){for(var i in r.captionStreams){var n;t[i]||(e.trigger({type:"usage",name:"hls-608"}),n=e.textTracks().getTrackById(i),t[i]=n||e.addRemoteTextTrack({kind:"captions",id:i,label:i},!1).track)}}(this.inbandTextTracks_,this.hls_.tech_),t={inbandTextTracks:this.inbandTextTracks_,captionArray:r.fmp4Captions,timestampOffset:0},s=t.inbandTextTracks,e=t.captionArray,o=t.timestampOffset,e&&(a=window.WebKitDataCue||window.VTTCue,e.forEach(function(t){var e=t.stream,i=t.startTime,n=t.endTime;s[e]&&(i+=o,n+=o,s[e].addCue(new a(i,n,t.text)))})),this.captionParser_.clearParsedCaptions()),this.handleSegment_()}},{key:"handleSegment_",value:function(){var t=this;if(this.pendingSegment_){var e=this.pendingSegment_,i=e.segment,n=this.syncController_.probeSegmentInfo(e);void 0===this.startingMedia_&&n&&(n.containsAudio||n.containsVideo)&&(this.startingMedia_={containsAudio:n.containsAudio,containsVideo:n.containsVideo});var r=(s=this.loaderType_,o=this.startingMedia_,u=n,"main"===s&&o&&u?u.containsAudio||u.containsVideo?o.containsVideo&&!u.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.":!o.containsVideo&&u.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(r)return this.error({message:r,blacklistDuration:1/0}),void this.trigger("error");if(e.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");null!==e.timestampOffset&&e.timestampOffset!==this.sourceUpdater_.timestampOffset()&&(this.sourceUpdater_.timestampOffset(e.timestampOffset),this.trigger("timestampoffset"));var a,s,o,u,l,n=this.syncController_.mappingForTimeline(e.timeline);null!==n&&this.trigger({type:"segmenttimemapping",mapping:n}),this.state="APPENDING",i.map&&(a=vu(i.map),this.activeInitSegmentId_&&this.activeInitSegmentId_===a||(l=this.initSegment(i.map),this.sourceUpdater_.appendBuffer(l.bytes,function(){t.activeInitSegmentId_=a}))),e.byteLength=e.bytes.byteLength,"number"==typeof i.start&&"number"==typeof i.end?this.mediaSecondsLoaded+=i.end-i.start:this.mediaSecondsLoaded+=i.duration,this.logger_((o=(s=e).segment,u=o.start,r=o.end,n=s.playlist,l=n.mediaSequence,i=n.id,o=n.segments,n=void 0===o?[]:o,o=s.mediaIndex,s=s.timeline,["appending ["+o+"] of ["+l+", "+(l+n.length)+"] from playlist ["+i+"]","["+u+" => "+r+"] in timeline ["+s+"]"].join(" "))),this.sourceUpdater_.appendBuffer(e.bytes,this.handleUpdateEnd_.bind(this))}else this.state="READY"}},{key:"handleUpdateEnd_",value:function(){if(!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var t=this.pendingSegment_,e=t.segment,i=null!==this.mediaIndex;this.pendingSegment_=null,this.recordThroughput_(t),this.addSegmentMetadataCue_(t),this.state="READY",this.mediaIndex=t.mediaIndex,this.fetchAtBuffer_=!0,this.currentTimeline_=t.timeline,this.trigger("syncinfoupdate"),e.end&&this.currentTime_()-e.end>3*t.playlist.targetDuration?this.resetEverything():(i&&this.trigger("bandwidthupdate"),this.trigger("progress"),Pl(t.playlist,this.mediaSource_,t.mediaIndex+1)&&this.endOfStream(),this.paused()||this.monitorBuffer_())}},{key:"recordThroughput_",value:function(t){var e=this.throughput.rate,i=Date.now()-t.endOfAllRequests+1,i=Math.floor(t.byteLength/i*8*1e3);this.throughput.rate+=(i-e)/++this.throughput.count}},{key:"addSegmentMetadataCue_",value:function(t){var e,i,n,r;this.segmentMetadataTrack_&&(i=(e=t.segment).start,r=e.end,Ul(i)&&Ul(r)&&(Ou(i,r,this.segmentMetadataTrack_),n=d.WebKitDataCue||d.VTTCue,t={dateTimeObject:e.dateTimeObject,dateTimeString:e.dateTimeString,bandwidth:t.playlist.attributes.BANDWIDTH,resolution:t.playlist.attributes.RESOLUTION,codecs:t.playlist.attributes.CODECS,byteLength:t.byteLength,uri:t.uri,timeline:t.timeline,playlist:t.playlist.uri,start:i,end:r},(r=new n(i,r,JSON.stringify(t))).value=t,this.segmentMetadataTrack_.addCue(r)))}}]),Bl);function Bl(t){qo(this,Bl);var e=Qo(this,(Bl.__proto__||Object.getPrototypeOf(Bl)).call(this));if(!t)throw new TypeError("Initialization settings are required");if("function"!=typeof t.currentTime)throw new TypeError("No currentTime getter specified");if(!t.mediaSource)throw new TypeError("No MediaSource specified");return e.bandwidth=t.bandwidth,e.throughput={rate:0,count:0},e.roundTrip=NaN,e.resetStats_(),e.mediaIndex=null,e.hasPlayed_=t.hasPlayed,e.currentTime_=t.currentTime,e.seekable_=t.seekable,e.seeking_=t.seeking,e.duration_=t.duration,e.mediaSource_=t.mediaSource,e.hls_=t.hls,e.loaderType_=t.loaderType,e.startingMedia_=void 0,e.segmentMetadataTrack_=t.segmentMetadataTrack,e.goalBufferLength_=t.goalBufferLength,e.sourceType_=t.sourceType,e.inbandTextTracks_=t.inbandTextTracks,e.state_="INIT",e.checkBufferTimeout_=null,e.error_=void 0,e.currentTimeline_=-1,e.pendingSegment_=null,e.mimeType_=null,e.sourceUpdater_=null,e.xhrOptions_=null,e.activeInitSegmentId_=null,e.initSegments_={},e.captionParser_=new To,e.decrypter_=t.decrypter,e.syncController_=t.syncController,e.syncPoint_={segmentIndex:0,time:0},e.syncController_.on("syncinfoupdate",function(){return e.trigger("syncinfoupdate")}),e.mediaSource_.addEventListener("sourceopen",function(){return e.ended_=!1}),e.fetchAtBuffer_=!1,e.logger_=gl("SegmentLoader["+e.loaderType_+"]"),Object.defineProperty(e,"state",{get:function(){return this.state_},set:function(t){t!==this.state_&&(this.logger_(this.state_+" -> "+t),this.state_=t)}}),e}function Nl(t){return decodeURIComponent(escape(String.fromCharCode.apply(null,t)))}var jl=new Uint8Array("\n\n".split("").map(function(t){return t.charCodeAt(0)})),Fl=(di(Vl,Ml),ae(Vl,[{key:"buffered_",value:function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues.length)return tr.createTimeRanges();var t=this.subtitlesTrack_.cues,e=t[0].startTime,t=t[t.length-1].startTime;return tr.createTimeRanges([[e,t]])}},{key:"initSegment",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]&&arguments[1];if(!t)return null;var i=vu(t),n=this.initSegments_[i];return e&&!n&&t.bytes&&(e=jl.byteLength+t.bytes.byteLength,(e=new Uint8Array(e)).set(t.bytes),e.set(jl,t.bytes.byteLength),this.initSegments_[i]=n={resolvedUri:t.resolvedUri,byterange:t.byterange,bytes:e}),n||t}},{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(t){return void 0===t||(this.subtitlesTrack_=t,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}},{key:"remove",value:function(t,e){Ou(t,e,this.subtitlesTrack_)}},{key:"fillBuffer_",value:function(){var t=this;this.syncPoint_||(this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_()));var e=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(e=this.skipEmptySegments_(e)){if(null===this.syncController_.timestampOffsetForTimeline(e.timeline))return this.syncController_.one("timestampoffset",function(){t.state="READY",t.paused()||t.monitorBuffer_()}),void(this.state="WAITING_ON_TIMELINE");this.loadSegment_(e)}}},{key:"skipEmptySegments_",value:function(t){for(;t&&t.segment.empty;)t=this.generateSegmentInfo_(t.playlist,t.mediaIndex+1,t.startOfSegment+t.duration,t.isSyncRequest);return t}},{key:"handleSegment_",value:function(){var e=this;if(this.pendingSegment_&&this.subtitlesTrack_){this.state="APPENDING";var t=this.pendingSegment_,i=t.segment;if("function"!=typeof d.WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){function n(){e.handleSegment_()}return this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",n),void this.subtitlesTrack_.tech_.one("vttjserror",function(){e.subtitlesTrack_.tech_.off("vttjsloaded",n),e.error({message:"Error loading vtt.js"}),e.state="READY",e.pause(),e.trigger("error")})}i.requested=!0;try{this.parseVTTCues_(t)}catch(t){return this.error({message:t.message}),this.state="READY",this.pause(),this.trigger("error")}if(this.updateTimeMapping_(t,this.syncController_.timelines[t.timeline],this.playlist_),t.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");t.byteLength=t.bytes.byteLength,this.mediaSecondsLoaded+=i.duration,t.cues.length&&this.remove(t.cues[0].endTime,t.cues[t.cues.length-1].endTime),t.cues.forEach(function(t){e.subtitlesTrack_.addCue(t)}),this.handleUpdateEnd_()}else this.state="READY"}},{key:"parseVTTCues_",value:function(e){var t=void 0,i=!1;"function"==typeof d.TextDecoder?t=new d.TextDecoder("utf8"):(t=d.WebVTT.StringDecoder(),i=!0);t=new d.WebVTT.Parser(d,d.vttjs,t);e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},t.oncue=e.cues.push.bind(e.cues),t.ontimestampmap=function(t){return e.timestampmap=t},t.onparsingerror=function(t){tr.log.warn("Error encountered when parsing cues: "+t.message)},e.segment.map&&(n=e.segment.map.bytes,i&&(n=Nl(n)),t.parse(n));var n=e.bytes;i&&(n=Nl(n)),t.parse(n),t.flush()}},{key:"updateTimeMapping_",value:function(t,e,i){var n,r,a=t.segment;e&&(t.cues.length?(r=t.timestampmap,n=r.MPEGTS/9e4-r.LOCAL+e.mapping,t.cues.forEach(function(t){t.startTime+=n,t.endTime+=n}),i.syncInfo||(r=t.cues[0].startTime,e=t.cues[t.cues.length-1].startTime,i.syncInfo={mediaSequence:i.mediaSequence+t.mediaIndex,time:Math.min(r,e-a.duration)})):a.empty=!0)}}]),Vl);function Vl(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};qo(this,Vl);e=Qo(this,(Vl.__proto__||Object.getPrototypeOf(Vl)).call(this,t,e));return e.mediaSource_=null,e.subtitlesTrack_=null,e}var Hl=Xa,ql=[{name:"VOD",run:function(t,e,i,n,r){if(i===1/0)return null;return{time:0,segmentIndex:0}}},{name:"ProgramDateTime",run:function(t,e,i,n,r){if(!t.datetimeToDisplayTime)return null;var a=e.segments||[],s=null,o=null;r=r||0;for(var u=0;u<a.length;u++){var l=a[u];if(l.dateTimeObject){var c=l.dateTimeObject.getTime()/1e3+t.datetimeToDisplayTime,l=Math.abs(r-c);if(null!==o&&o<l)break;o=l,s={time:c,segmentIndex:u}}}return s}},{name:"Segment",run:function(t,e,i,n,r){var a=e.segments||[],s=null,o=null;r=r||0;for(var u=0;u<a.length;u++){var l=a[u];if(l.timeline===n&&void 0!==l.start){var c=Math.abs(r-l.start);if(null!==o&&o<c)break;(!s||null===o||c<=o)&&(o=c,s={time:l.start,segmentIndex:u})}}return s}},{name:"Discontinuity",run:function(t,e,i,n,r){var a=null;if(r=r||0,e.discontinuityStarts&&e.discontinuityStarts.length)for(var s=null,o=0;o<e.discontinuityStarts.length;o++){var u=e.discontinuityStarts[o],l=e.discontinuitySequence+o+1,c=t.discontinuities[l];if(c){l=Math.abs(r-c.time);if(null!==s&&s<l)break;(!a||null===s||l<=s)&&(s=l,a={time:c.time,segmentIndex:u})}}return a}},{name:"Playlist",run:function(t,e,i,n,r){return e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence}:null}}],zl=(Xa=tr.EventTarget,di(Wl,Xa),ae(Wl,[{key:"getSyncPoint",value:function(t,e,i,n){i=this.runStrategies_(t,e,i,n);return i.length?this.selectSyncPoint_(i,{key:"time",value:n}):null}},{key:"getExpiredTime",value:function(t,e){if(!t||!t.segments)return null;e=this.runStrategies_(t,e,t.discontinuitySequence,0);if(!e.length)return null;e=this.selectSyncPoint_(e,{key:"segmentIndex",value:0});return 0<e.segmentIndex&&(e.time*=-1),Math.abs(e.time+au(t,e.segmentIndex,0))}},{key:"runStrategies_",value:function(t,e,i,n){for(var r=[],a=0;a<ql.length;a++){var s=ql[a],o=s.run(this,t,e,i,n);o&&(o.strategy=s.name,r.push({strategy:s.name,syncPoint:o}))}return r}},{key:"selectSyncPoint_",value:function(t,e){for(var i=t[0].syncPoint,n=Math.abs(t[0].syncPoint[e.key]-e.value),r=t[0].strategy,a=1;a<t.length;a++){var s=Math.abs(t[a].syncPoint[e.key]-e.value);s<n&&(n=s,i=t[a].syncPoint,r=t[a].strategy)}return this.logger_("syncPoint for ["+e.key+": "+e.value+"] chosen with strategy ["+r+"]: [time:"+i.time+", segmentIndex:"+i.segmentIndex+"]"),i}},{key:"saveExpiredSegmentInfo",value:function(t,e){for(var i=e.mediaSequence-t.mediaSequence-1;0<=i;i--){var n=t.segments[i];if(n&&void 0!==n.start){e.syncInfo={mediaSequence:t.mediaSequence+i,time:n.start},this.logger_("playlist refresh sync: [time:"+e.syncInfo.time+", mediaSequence: "+e.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}}},{key:"setDateTimeMapping",value:function(t){!this.datetimeToDisplayTime&&t.segments&&t.segments.length&&t.segments[0].dateTimeObject&&(t=t.segments[0].dateTimeObject.getTime()/1e3,this.datetimeToDisplayTime=-t)}},{key:"reset",value:function(){this.inspectCache_=void 0}},{key:"probeSegmentInfo",value:function(t){var e=t.segment,i=t.playlist,n=void 0;return(n=e.map?this.probeMp4Segment_(t):this.probeTsSegment_(t))&&this.calculateSegmentTimeMapping_(t,n)&&(this.saveDiscontinuitySyncInfo_(t),i.syncInfo||(i.syncInfo={mediaSequence:i.mediaSequence+t.mediaIndex,time:e.start})),n}},{key:"probeMp4Segment_",value:function(t){var e=t.segment,i=Ya.timescale(e.map.bytes),i=Ya.startTime(i,t.bytes);return null!==t.timestampOffset&&(t.timestampOffset-=i),{start:i,end:i+e.duration}}},{key:"probeTsSegment_",value:function(t){var e=Hl(t.bytes,this.inspectCache_),i=void 0,t=void 0;return e?(e.video&&2===e.video.length?(this.inspectCache_=e.video[1].dts,i=e.video[0].dtsTime,t=e.video[1].dtsTime):e.audio&&2===e.audio.length&&(this.inspectCache_=e.audio[1].dts,i=e.audio[0].dtsTime,t=e.audio[1].dtsTime),{start:i,end:t,containsVideo:e.video&&2===e.video.length,containsAudio:e.audio&&2===e.audio.length}):null}},{key:"timestampOffsetForTimeline",value:function(t){return void 0===this.timelines[t]?null:this.timelines[t].time}},{key:"mappingForTimeline",value:function(t){return void 0===this.timelines[t]?null:this.timelines[t].mapping}},{key:"calculateSegmentTimeMapping_",value:function(t,e){var i=t.segment,n=this.timelines[t.timeline];if(null!==t.timestampOffset)n={time:t.startOfSegment,mapping:t.startOfSegment-e.start},this.timelines[t.timeline]=n,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+t.timeline+": [time: "+n.time+"] [mapping: "+n.mapping+"]"),i.start=t.startOfSegment,i.end=e.end+n.mapping;else{if(!n)return!1;i.start=e.start+n.mapping,i.end=e.end+n.mapping}return!0}},{key:"saveDiscontinuitySyncInfo_",value:function(t){var e=t.playlist,i=t.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(e.discontinuityStarts&&e.discontinuityStarts.length)for(var n=0;n<e.discontinuityStarts.length;n++){var r,a=e.discontinuityStarts[n],s=e.discontinuitySequence+n+1,o=a-t.mediaIndex,u=Math.abs(o);(!this.discontinuities[s]||this.discontinuities[s].accuracy>u)&&(r=void 0,r=o<0?i.start-au(e,t.mediaIndex,a):i.end+au(e,t.mediaIndex+1,a),this.discontinuities[s]={time:r,accuracy:u})}}}]),Wl);function Wl(){qo(this,Wl);var t=Qo(this,(Wl.__proto__||Object.getPrototypeOf(Wl)).call(this));return t.inspectCache_=void 0,t.timelines=[],t.discontinuities=[],t.datetimeToDisplayTime=null,t.logger_=gl("SyncController"),t}function Gl(t,e){t.abort(),t.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)}function Xl(t,e){(e.activePlaylistLoader=t).load()}function Yl(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(t){Jl[t](t,e)});var i=e.mediaTypes,t=e.masterPlaylistLoader,n=e.tech,r=e.hls;["AUDIO","SUBTITLES"].forEach(function(t){var r,a,s,o,u,l;i[t].activeGroup=(r=t,a=e,function(e){var t=a.masterPlaylistLoader,i=a.mediaTypes[r].groups,n=t.media();if(!n)return null;t=null;return n.attributes[r]&&(t=i[n.attributes[r]]),t=t||i.main,void 0===e?t:null!==e&&t.filter(function(t){return t.id===e.id})[0]||null}),i[t].activeTrack=Zl[t](t,e),i[t].onGroupChanged=(s=t,o=e,function(){var t=o.segmentLoaders,e=t[s],i=t.main,n=o.mediaTypes[s],r=n.activeTrack(),t=n.activeGroup(r),r=n.activePlaylistLoader;Gl(e,n),t&&(t.playlistLoader?(e.resyncLoader(),Xl(t.playlistLoader,n)):r&&i.resetEverything())}),i[t].onTrackChanged=(u=t,l=e,function(){var t=l.segmentLoaders,e=t[u],i=t.main,n=l.mediaTypes[u],r=n.activeTrack(),a=n.activeGroup(r),t=n.activePlaylistLoader;Gl(e,n),a&&(a.playlistLoader?(t!==a.playlistLoader&&(e.track&&e.track(r),e.resetEverything()),Xl(a.playlistLoader,n)):i.resetEverything())})});var a,s=((s=i.AUDIO.activeGroup()).filter(function(t){return t.default})[0]||s[0]).id;function o(){i.AUDIO.onTrackChanged(),n.trigger({type:"usage",name:"hls-audio-change"})}for(a in i.AUDIO.tracks[s].enabled=!0,i.AUDIO.onTrackChanged(),t.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(t){return i[t].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[a])}var $l=new zu("./decrypter-worker.worker.js",function(t,e){var c,i,n,h,d,m,r,a,u,g,s,o=this;c=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i=function(t,e,i){return e&&l(t.prototype,e),i&&l(t,i),t},n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},h=function(){for(var t,e,i,n=[[[],[],[],[],[]],[[],[],[],[],[]]],r=n[0],a=n[1],s=r[4],o=a[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;!s[l];l^=t||1,c=d[c]||1)for(i=(i=c^c<<1^c<<2^c<<3^c<<4)>>8^255&i^99,f=16843009*h[e=h[t=h[o[s[l]=i]=l]]]^65537*e^257*t^16843008*l,p=257*h[i]^16843008*i,u=0;u<4;u++)r[u][l]=p=p<<24^p>>>8,a[u][i]=f=f<<24^f>>>8;for(u=0;u<5;u++)r[u]=r[u].slice(0),a[u]=a[u].slice(0);return n},d=null,p.prototype.decrypt=function(t,e,i,n,r,a){for(var s,o,u=this._key[1],l=t^u[0],c=n^u[1],h=i^u[2],d=e^u[3],p=void 0,f=u.length/4-2,m=void 0,g=4,e=this._tables[1],y=e[0],v=e[1],_=e[2],b=e[3],T=e[4],m=0;m<f;m++)p=y[l>>>24]^v[c>>16&255]^_[h>>8&255]^b[255&d]^u[g],s=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=s,h=o;for(m=0;m<4;m++)r[(3&-m)+a]=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=p,f.prototype.on=function(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e)},f.prototype.off=function(t,e){if(!this.listeners[t])return!1;e=this.listeners[t].indexOf(e);return this.listeners[t].splice(e,1),-1<e},f.prototype.trigger=function(t){var e=this.listeners[t];if(e)if(2===arguments.length)for(var i=e.length,n=0;n<i;++n)e[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),a=e.length,s=0;s<a;++s)e[s].apply(this,r)},f.prototype.dispose=function(){this.listeners={}},f.prototype.pipe=function(e){this.on("data",function(t){e.push(t)})},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(y,a=r=f),y.prototype.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},y.prototype.push=function(t){this.jobs.push(t),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},u=y,g=function(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24},v.prototype.decryptChunk_=function(e,i,n,r){return function(){var t=function(t,e,i){for(var n,r,a,s,o=new Int32Array(t.buffer,t.byteOffset,t.byteLength>>2),u=new m(Array.prototype.slice.call(e)),t=new Uint8Array(t.byteLength),l=new Int32Array(t.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]),a=g(o[f+2]),s=g(o[f+3]),u.decrypt(n,r,a,s,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=a,p=s;return t}(e,i,n);r.set(t,e.byteOffset)}},i(v,null,[{key:"STEP",get:function(){return 32e3}}]),s=v,function(a){a.onmessage=function(t){var r=t.data,e=new Uint8Array(r.encrypted.bytes,r.encrypted.byteOffset,r.encrypted.byteLength),i=new Uint32Array(r.key.bytes,r.key.byteOffset,r.key.byteLength/4),t=new Uint32Array(r.iv.bytes,r.iv.byteOffset,r.iv.byteLength/4);new s(e,i,t,function(t,e){var i,n;a.postMessage((i={source:r.source,decrypted:e},n={},Object.keys(i).forEach(function(t){var e=i[t];ArrayBuffer.isView(e)?n[t]={bytes:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength}:n[t]=e}),n),[e.buffer])})}}(o);function l(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function p(t){c(this,p),d=d||h(),this._tables=[[d[0][0].slice(),d[0][1].slice(),d[0][2].slice(),d[0][3].slice(),d[0][4].slice()],[d[1][0].slice(),d[1][1].slice(),d[1][2].slice(),d[1][3].slice(),d[1][4].slice()]];var e=void 0,i=void 0,n=void 0,r=void 0,a=void 0,s=this._tables[0][4],o=this._tables[1],u=t.length,l=1;if(4!==u&&6!==u&&8!==u)throw new Error("Invalid aes key size");for(r=t.slice(0),a=[],this._key=[r,a],e=u;e<4*u+28;e++)n=r[e-1],(e%u==0||8===u&&e%u==4)&&(n=s[n>>>24]<<24^s[n>>16&255]<<16^s[n>>8&255]<<8^s[255&n],e%u==0&&(n=n<<8^n>>>24^l<<24,l=l<<1^283*(l>>7))),r[e]=r[e-u]^n;for(i=0;e;i++,e--)n=r[3&i?e:e-4],a[i]=e<=4||i<4?n:o[0][s[n>>>24]]^o[1][s[n>>16&255]]^o[2][s[n>>8&255]]^o[3][s[255&n]]}function f(){c(this,f),this.listeners={}}function y(){c(this,y);var t=n(this,a.call(this,r));return t.jobs=[],t.delay=1,t.timeout_=null,t}function v(t,e,i,n){c(this,v);var r=v.STEP,a=new Int32Array(t.buffer),s=new Uint8Array(t.byteLength),o=0;for(this.asyncStream_=new u,this.asyncStream_.push(this.decryptChunk_(a.subarray(o,o+r),e,i,s)),o=r;o<a.length;o+=r)i=new Uint32Array([g(a[o-4]),g(a[o-3]),g(a[o-2]),g(a[o-1])]),this.asyncStream_.push(this.decryptChunk_(a.subarray(o,o+r),e,i,s));this.asyncStream_.push(function(){var t;n(null,(t=s).subarray(0,t.byteLength-t[t.byteLength-1]))})}}),Kl={AUDIO:function(s,o){return function(){var t=o.segmentLoaders[s],e=o.mediaTypes[s],i=o.blacklistCurrentPlaylist;Gl(t,e);var n=e.activeTrack(),t=e.activeGroup(),t=(t.filter(function(t){return t.default})[0]||t[0]).id,r=e.tracks[t];if(n!==r){for(var a in tr.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),e.tracks)e.tracks[a].enabled=e.tracks[a]===r;e.onTrackChanged()}else i({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(i,n){return function(){var t=n.segmentLoaders[i],e=n.mediaTypes[i];tr.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Gl(t,e);t=e.activeTrack();t&&(t.mode="disabled"),e.onTrackChanged()}}},Ql={AUDIO:function(t,e,i){var n,r,a;e&&(n=i.tech,r=i.requestOptions,a=i.segmentLoaders[t],e.on("loadedmetadata",function(){var t=e.media();a.playlist(t,r),(!n.paused()||t.endList&&"none"!==n.preload())&&a.load()}),e.on("loadedplaylist",function(){a.playlist(e.media(),r),n.paused()||a.load()}),e.on("error",Kl[t](t,i)))},SUBTITLES:function(t,e,i){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[t],s=i.mediaTypes[t];e.on("loadedmetadata",function(){var t=e.media();a.playlist(t,r),a.track(s.activeTrack()),(!n.paused()||t.endList&&"none"!==n.preload())&&a.load()}),e.on("loadedplaylist",function(){a.playlist(e.media(),r),n.paused()||a.load()}),e.on("error",Kl[t](t,i))}},Jl={AUDIO:function(t,e){var i,n,r=e.hls,a=e.sourceType,s=e.segmentLoaders[t],o=e.requestOptions.withCredentials,u=e.master,l=u.mediaGroups,c=u.playlists,u=e.mediaTypes[t],h=u.groups,d=u.tracks,p=e.masterPlaylistLoader;for(i in l[t]&&0!==Object.keys(l[t]).length||(l[t]={main:{default:{default:!0}}}),l[t]){h[i]||(h[i]=[]);var f,m=c.filter(function(e,i){return function(t){return t.attributes[e]===i}}(t,i));for(f in l[t][i]){var g=l[t][i][f];m.filter(function(e){return function(t){return t.resolvedUri===e}}(g.resolvedUri)).length&&delete g.resolvedUri;var y=void 0,y=g.resolvedUri?new eu(g.resolvedUri,r,o):g.playlists&&"dash"===a?new fl(g.playlists[0],r,o,p):null,g=tr.mergeOptions({id:f,playlistLoader:y},g);Ql[t](t,g.playlistLoader,e),h[i].push(g),void 0===d[f]&&(g=new tr.AudioTrack({id:f,kind:(n=void 0,n=(y=g).default?"main":"alternative",y.characteristics&&0<=y.characteristics.indexOf("public.accessibility.describes-video")&&(n="main-desc"),n),enabled:!1,language:g.language,default:g.default,label:f}),d[f]=g)}}s.on("error",Kl[t](t,e))},SUBTITLES:function(t,e){var i,n,r,a=e.tech,s=e.hls,o=e.sourceType,u=e.segmentLoaders[t],l=e.requestOptions.withCredentials,c=e.master.mediaGroups,h=e.mediaTypes[t],d=h.groups,p=h.tracks,f=e.masterPlaylistLoader;for(i in c[t])for(var m in d[i]||(d[i]=[]),c[t][i])c[t][i][m].forced||(r=c[t][i][m],n=void 0,"hls"===o?n=new eu(r.resolvedUri,s,l):"dash"===o&&(n=new fl(r.playlists[0],s,l,f)),r=tr.mergeOptions({id:m,playlistLoader:n},r),Ql[t](t,r.playlistLoader,e),d[i].push(r),void 0===p[m]&&(r=a.addRemoteTextTrack({id:m,kind:"subtitles",default:r.default&&r.autoselect,language:r.language,label:m},!1).track,p[m]=r));u.on("error",Kl[t](t,e))},"CLOSED-CAPTIONS":function(t,e){var i,n=e.tech,r=e.master.mediaGroups,e=e.mediaTypes[t],a=e.groups,s=e.tracks;for(i in r[t])for(var o in a[i]||(a[i]=[]),r[t][i]){var u=r[t][i][o];u.instreamId.match(/CC\d/)&&(a[i].push(tr.mergeOptions({id:o},u)),void 0===s[o]&&(u=n.addRemoteTextTrack({id:u.instreamId,kind:"captions",default:u.default&&u.autoselect,language:u.language,label:o},!1).track,s[o]=u))}}},Zl={AUDIO:function(i,n){return function(){var t,e=n.mediaTypes[i].tracks;for(t in e)if(e[t].enabled)return e[t];return null}},SUBTITLES:function(i,n){return function(){var t,e=n.mediaTypes[i].tracks;for(t in e)if("showing"===e[t].mode)return e[t];return null}}},tc=function(){var e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(t){e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:yl,activeTrack:yl,onGroupChanged:yl,onTrackChanged:yl}}),e},ec=void 0,ic=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred"],nc=function(t){return this.audioSegmentLoader_[t]+this.mainSegmentLoader_[t]},rc=(Xa=tr.EventTarget,di(ac,Xa),ae(ac,[{key:"setupMasterPlaylistLoaderListeners_",value:function(){var n=this;this.masterPlaylistLoader_.on("loadedmetadata",function(){var t=n.masterPlaylistLoader_.media(),e=1.5*n.masterPlaylistLoader_.targetDuration*1e3;pu(n.masterPlaylistLoader_.master,n.masterPlaylistLoader_.media())?n.requestOptions_.timeout=0:n.requestOptions_.timeout=e,t.endList&&"none"!==n.tech_.preload()&&(n.mainSegmentLoader_.playlist(t,n.requestOptions_),n.mainSegmentLoader_.load()),Yl({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(),t);try{n.setupSourceBuffers_()}catch(t){return tr.log.warn("Failed to create SourceBuffers",t),n.mediaSource.endOfStream("decode")}n.setupFirstPlay(),n.trigger("selectedinitialmedia")}),this.masterPlaylistLoader_.on("loadedplaylist",function(){var e,t=n.masterPlaylistLoader_.media();if(!t){n.excludeUnsupportedVariants_();var i=void 0;return n.enableLowInitialPlaylist&&(i=n.selectInitialPlaylist()),i=i||n.selectPlaylist(),n.initialMedia_=i,void n.masterPlaylistLoader_.media(n.initialMedia_)}n.useCueTags_&&n.updateAdCues_(t),n.mainSegmentLoader_.playlist(t,n.requestOptions_),n.updateDuration(),n.tech_.paused()||(n.mainSegmentLoader_.load(),n.audioSegmentLoader_&&n.audioSegmentLoader_.load()),t.endList||(e=function(){var t=n.seekable();0!==t.length&&n.mediaSource.addSeekableRange_(t.start(0),t.end(0))},n.duration()!==1/0?(t=function t(){n.duration()===1/0?e():n.tech_.one("durationchange",t)},n.tech_.one("durationchange",t)):e())}),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 t=n.masterPlaylistLoader_.media(),e=1.5*n.masterPlaylistLoader_.targetDuration*1e3;pu(n.masterPlaylistLoader_.master,n.masterPlaylistLoader_.media())?n.requestOptions_.timeout=0:n.requestOptions_.timeout=e,n.mainSegmentLoader_.playlist(t,n.requestOptions_),n.mainSegmentLoader_.load(),n.tech_.trigger({type:"mediachange",bubbles:!0})}),this.masterPlaylistLoader_.on("playlistunchanged",function(){var t=n.masterPlaylistLoader_.media();n.stuckAtPlaylistEnd_(t)&&(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(t,e){var i,n=t.mediaGroups||{},r=!0,t=Object.keys(n.AUDIO);for(i in n.AUDIO)for(var a in n.AUDIO[i])n.AUDIO[i][a].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"}),ec.Playlist.isAes(e)&&this.tech_.trigger({type:"usage",name:"hls-aes"}),ec.Playlist.isFmp4(e)&&this.tech_.trigger({type:"usage",name:"hls-fmp4"}),t.length&&1<Object.keys(n.AUDIO[t[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 r=this;this.mainSegmentLoader_.on("bandwidthupdate",function(){var t=r.selectPlaylist(),e=r.masterPlaylistLoader_.media(),i=r.tech_.buffered(),n=i.length?i.end(i.length-1)-r.tech_.currentTime():0,i=r.bufferLowWaterLine();(!e.endList||r.duration()<Il.MAX_BUFFER_LOW_WATER_LINE||t.attributes.BANDWIDTH<e.attributes.BANDWIDTH||i<=n)&&r.masterPlaylistLoader_.media(t),r.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("progress",function(){r.trigger("progress")}),this.mainSegmentLoader_.on("error",function(){r.blacklistCurrentPlaylist(r.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("syncinfoupdate",function(){r.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){r.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){r.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("ended",function(){r.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(){r.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120)}),this.mainSegmentLoader_.on("reseteverything",function(){r.tech_.trigger("hls-reset")}),this.mainSegmentLoader_.on("segmenttimemapping",function(t){r.tech_.trigger({type:"hls-segment-time-mapping",mapping:t.mapping})}),this.audioSegmentLoader_.on("ended",function(){r.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 t=this.selectPlaylist();t!==this.masterPlaylistLoader_.media()&&(this.masterPlaylistLoader_.media(t),this.mainSegmentLoader_.resetLoader())}},{key:"fastQualityChange_",value:function(){var t=this,e=this.selectPlaylist();e!==this.masterPlaylistLoader_.media()&&(this.masterPlaylistLoader_.media(e),this.mainSegmentLoader_.resetEverything(function(){tr.browser.IE_VERSION||tr.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime())}))}},{key:"play",value:function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.seekTo_(0),this.hasPlayed_()&&this.load();var t=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<t.start(0)?this.seekTo_(t.end(t.length-1)):void 0}}},{key:"setupFirstPlay",value:function(){var t=this,e=this.masterPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_())return!1;if(!e.endList){var i=this.seekable();if(!i.length)return!1;if(tr.browser.IE_VERSION&&0===this.tech_.readyState())return this.tech_.one("loadedmetadata",function(){t.trigger("firstplay"),t.seekTo_(i.end(0)),t.hasPlayed_=function(){return!0}}),!1;this.trigger("firstplay"),this.seekTo_(i.end(0))}return this.hasPlayed_=function(){return!0},this.load(),!0}},{key:"handleSourceOpen_",value:function(){try{this.setupSourceBuffers_()}catch(t){return tr.log.warn("Failed to create Source Buffers",t),this.mediaSource.endOfStream("decode")}var t;!this.tech_.autoplay()||void 0!==(t=this.tech_.play())&&"function"==typeof t.then&&t.then(null,function(t){}),this.trigger("sourceopen")}},{key:"onEndOfStream",value:function(){var t=this.mainSegmentLoader_.ended_;this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=(this.mainSegmentLoader_.startingMedia_&&!this.mainSegmentLoader_.startingMedia_.containsVideo||t)&&this.audioSegmentLoader_.ended_),t&&this.mediaSource.endOfStream()}},{key:"stuckAtPlaylistEnd_",value:function(t){if(!this.seekable().length)return!1;var e=this.syncController_.getExpiredTime(t,this.mediaSource.duration);if(null===e)return!1;var i=ec.Playlist.playlistEnd(t,e),t=this.tech_.currentTime(),e=this.tech_.buffered();if(!e.length)return i-t<=.1;e=e.end(e.length-1);return e-t<=.1&&i-e<=.1}},{key:"blacklistCurrentPlaylist",value:function(){var t,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},i=arguments[1],n=void 0,n=e.playlist||this.masterPlaylistLoader_.media(),i=i||e.blacklistDuration||this.blacklistDuration;if(!n){this.error=e;try{return this.mediaSource.endOfStream("network")}catch(t){return this.trigger("error")}}var r=1===this.masterPlaylistLoader_.master.playlists.filter(hu).length;return r?(tr.log.warn("Problem encountered with the current HLS playlist. Trying again since it is the final playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(r)):(n.excludeUntil=Date.now()+1e3*i,this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"}),t=this.selectPlaylist(),tr.log.warn("Problem encountered with the current HLS playlist."+(e.message?" "+e.message:"")+" Switching to another playlist."),this.masterPlaylistLoader_.media(t))}},{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(t){var e=Cu(this.tech_.buffered(),t);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?e&&e.length?t:(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:ec.Playlist.duration(this.masterPlaylistLoader_.media()):0}},{key:"seekable",value:function(){return this.seekable_}},{key:"onSyncInfoUpdate_",value:function(){var t=void 0,e=void 0;if(this.masterPlaylistLoader_){var i=this.masterPlaylistLoader_.media();if(i){var n=this.syncController_.getExpiredTime(i,this.mediaSource.duration);if(null!==n&&0!==(t=ec.Playlist.seekable(i,n)).length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(i=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(n=this.syncController_.getExpiredTime(i,this.mediaSource.duration)))return;if(0===(e=ec.Playlist.seekable(i,n)).length)return}!e||e.start(0)>t.end(0)||t.start(0)>e.end(0)?this.seekable_=t:this.seekable_=tr.createTimeRanges([[(e.start(0)>t.start(0)?e:t).start(0),(e.end(0)<t.end(0)?e:t).end(0)]]),this.logger_("seekable updated ["+Au(this.seekable_)+"]"),this.tech_.trigger("seekablechanged")}}}}},{key:"updateDuration",value:function(){function t(){e.mediaSource.duration=n,e.tech_.trigger("durationchange"),e.mediaSource.removeEventListener("sourceopen",t)}var e=this,i=this.mediaSource.duration,n=ec.Playlist.duration(this.masterPlaylistLoader_.media()),r=this.tech_.buffered();0<r.length&&(n=Math.max(n,r.end(r.length-1))),i!==n&&("open"!==this.mediaSource.readyState?this.mediaSource.addEventListener("sourceopen",t):t())}},{key:"dispose",value:function(){var n=this;this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),["AUDIO","SUBTITLES"].forEach(function(t){var e,i=n.mediaTypes_[t].groups;for(e in i)i[e].forEach(function(t){t.playlistLoader&&t.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose()}},{key:"master",value:function(){return this.masterPlaylistLoader_.master}},{key:"media",value:function(){return this.masterPlaylistLoader_.media()||this.initialMedia_}},{key:"setupSourceBuffers_",value:function(){var t,e=this.masterPlaylistLoader_.media();if(e&&"open"===this.mediaSource.readyState){if((t=Ju(this.masterPlaylistLoader_.master,e)).length<1)return this.error="No compatible SourceBuffer configuration for the variant stream:"+e.resolvedUri,this.mediaSource.endOfStream("decode");this.configureLoaderMimeTypes_(t),this.excludeIncompatibleVariants_(e)}}},{key:"configureLoaderMimeTypes_",value:function(t){var e=1<t.length&&-1===t[0].indexOf(",")&&t[0]!==t[1]?new tr.EventTarget:null;this.mainSegmentLoader_.mimeType(t[0],e),t[1]&&this.audioSegmentLoader_.mimeType(t[1],e)}},{key:"excludeUnsupportedVariants_",value:function(){this.master().playlists.forEach(function(t){t.attributes.CODECS&&d.MediaSource&&d.MediaSource.isTypeSupported&&!d.MediaSource.isTypeSupported('video/mp4; codecs="'+t.attributes.CODECS.replace(/avc1\.(\d+)\.(\d+)/i,function(t){return $u([t])[0]})+'"')&&(t.excludeUntil=1/0)})}},{key:"excludeIncompatibleVariants_",value:function(t){var e,i=2,n=null;t.attributes.CODECS&&(e=Ku(t.attributes.CODECS),n=e.videoCodec,i=e.codecCount),this.master().playlists.forEach(function(t){var e={codecCount:2,videoCodec:null};t.attributes.CODECS&&(e=Ku(t.attributes.CODECS)),e.codecCount!==i&&(t.excludeUntil=1/0),e.videoCodec!==n&&(t.excludeUntil=1/0)})}},{key:"updateAdCues_",value:function(t){var e=0,i=this.seekable();i.length&&(e=i.start(0)),function(t,e){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0;if(t.segments)for(var n=i,r=void 0,a=0;a<t.segments.length;a++){var s,o,u,l=t.segments[a];if(r=r||function(t,e){for(var i=t.cues,n=0;n<i.length;n++){var r=i[n];if(e>=r.adStartTime&&e<=r.adEndTime)return r}return null}(e,n+l.duration/2)){if("cueIn"in l){r.endTime=n,r.adEndTime=n,n+=l.duration,r=null;continue}if(n<r.endTime){n+=l.duration;continue}r.endTime+=l.duration}else"cueOut"in l&&((r=new d.VTTCue(n,n+l.duration,l.cueOut)).adStartTime=n,r.adEndTime=n+parseFloat(l.cueOut),e.addCue(r)),"cueOutCont"in l&&(u=o=void 0,s=l.cueOutCont.split("/").map(parseFloat),o=(s=Jo(s,2))[0],u=s[1],(r=new d.VTTCue(n,n+l.duration,"")).adStartTime=n-o,r.adEndTime=r.adStartTime+u,e.addCue(r));n+=l.duration}}(t,this.cueTagsTrack_,e)}},{key:"goalBufferLength",value:function(){var t=this.tech_.currentTime(),e=Il.GOAL_BUFFER_LENGTH,i=Il.GOAL_BUFFER_LENGTH_RATE,n=Math.max(e,Il.MAX_GOAL_BUFFER_LENGTH);return Math.min(e+t*i,n)}},{key:"bufferLowWaterLine",value:function(){var t=this.tech_.currentTime(),e=Il.BUFFER_LOW_WATER_LINE,i=Il.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(e,Il.MAX_BUFFER_LOW_WATER_LINE);return Math.min(e+t*i,n)}}]),ac);function ac(t){qo(this,ac);var e=Qo(this,(ac.__proto__||Object.getPrototypeOf(ac)).call(this)),i=t.url,n=t.withCredentials,r=t.tech,a=t.bandwidth,s=t.externHls,o=t.useCueTags,u=t.blacklistDuration,l=t.enableLowInitialPlaylist,c=t.sourceType,h=t.seekTo;if(!i)throw new Error("A non-empty playlist URL is required");ec=s,e.withCredentials=n,e.tech_=r,e.hls_=r.hls,e.seekTo_=h,e.sourceType_=c,e.useCueTags_=o,e.blacklistDuration=u,e.enableLowInitialPlaylist=l,e.useCueTags_&&(e.cueTagsTrack_=e.tech_.addTextTrack("metadata","ad-cues"),e.cueTagsTrack_.inBandMetadataTrackDispatchType=""),e.requestOptions_={withCredentials:e.withCredentials,timeout:null},e.mediaTypes_=tc(),e.mediaSource=new tr.MediaSource,e.mediaSource.addEventListener("sourceopen",e.handleSourceOpen_.bind(e)),e.seekable_=tr.createTimeRanges(),e.hasPlayed_=function(){return!1},e.syncController_=new zl(t),e.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,e.decrypter_=new $l,e.inbandTextTracks_={};a={hls:e.hls_,mediaSource:e.mediaSource,currentTime:e.tech_.currentTime.bind(e.tech_),seekable:function(){return e.seekable()},seeking:function(){return e.tech_.seeking()},duration:function(){return e.mediaSource.duration},hasPlayed:function(){return e.hasPlayed_()},goalBufferLength:function(){return e.goalBufferLength()},bandwidth:a,syncController:e.syncController_,decrypter:e.decrypter_,sourceType:e.sourceType_,inbandTextTracks:e.inbandTextTracks_};return e.masterPlaylistLoader_=new("dash"===e.sourceType_?fl:eu)(i,e.hls_,e.withCredentials),e.setupMasterPlaylistLoaderListeners_(),e.mainSegmentLoader_=new Ml(tr.mergeOptions(a,{segmentMetadataTrack:e.segmentMetadataTrack_,loaderType:"main"}),t),e.audioSegmentLoader_=new Ml(tr.mergeOptions(a,{loaderType:"audio"}),t),e.subtitleSegmentLoader_=new Fl(tr.mergeOptions(a,{loaderType:"vtt"}),t),e.setupSegmentLoaderListeners_(),ic.forEach(function(t){e[t+"_"]=nc.bind(e,t)}),e.logger_=gl("MPC"),e.masterPlaylistLoader_.load(),e}function sc(t,e,i){qo(this,sc);var r,a,s,n=t.masterPlaylistController_,o=n[(t.options_.smoothQualityChange?"smooth":"fast")+"QualityChange_"].bind(n);e.attributes.RESOLUTION&&(n=e.attributes.RESOLUTION,this.width=n.width,this.height=n.height),this.bandwidth=e.attributes.BANDWIDTH,this.id=i,this.enabled=(r=t.playlists,a=e.uri,s=o,function(t){var e=r.master.playlists[a],i=cu(e),n=hu(e);return void 0===t?n:(t?delete e.disabled:e.disabled=!0,t===n||i||(s(),t?r.trigger("renditionenabled"):r.trigger("renditiondisabled")),t)})}var oc=["seeking","seeked","pause","playing","error"],uc=(ae(lc,[{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 t=this.tech_.currentTime(),e=this.tech_.buffered();if(this.lastRecordedTime===t&&(!e.length||t+.1>=e.end(e.length-1)))return this.techWaiting_();5<=this.consecutiveUpdates&&t===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):t===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=t)}}},{key:"cancelTimer_",value:function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null}},{key:"fixesBadSeeks_",value:function(){var t=this.tech_.seeking(),e=this.seekable(),i=this.tech_.currentTime(),n=void 0;return t&&this.afterSeekableWindow_(e,i)&&(n=e.end(e.length-1)),t&&this.beforeSeekableWindow_(e,i)&&(n=e.start(0)+.1),void 0!==n&&(this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+Au(e)+". Seeking to "+n+"."),this.seekTo(n),!0)}},{key:"waiting_",value:function(){var t,e;this.techWaiting_()||(t=this.tech_.currentTime(),e=this.tech_.buffered(),(e=Cu(e,t)).length&&t+3<=e.end(0)&&(this.cancelTimer_(),this.seekTo(t),this.logger_("Stopped at "+t+" while inside a buffered region ["+e.start(0)+" -> "+e.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 t=this.seekable(),e=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_())return!0;if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(t,e)){var i=t.end(t.length-1);return this.logger_("Fell out of live window at time "+e+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.seekTo(i),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}t=this.tech_.buffered(),i=Eu(t,e);if(this.videoUnderflow_(i,t,e))return this.cancelTimer_(),this.seekTo(e),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;if(0<i.length){t=i.start(0)-e;return this.logger_("Stopped at "+e+", setting timer for "+t+", seeking to "+i.start(0)),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*t,e),!0}return!1}},{key:"afterSeekableWindow_",value:function(t,e){return!!t.length&&e>t.end(t.length-1)+.1}},{key:"beforeSeekableWindow_",value:function(t,e){return!!(t.length&&0<t.start(0)&&e<t.start(0)-.1)}},{key:"videoUnderflow_",value:function(t,e,i){if(0===t.length){e=this.gapFromVideoUnderflow_(e,i);if(e)return this.logger_("Encountered a gap in video from "+e.start+" to "+e.end+". Seeking to current time "+i),!0}return!1}},{key:"skipTheGap_",value:function(t){var e=this.tech_.buffered(),i=this.tech_.currentTime(),e=Eu(e,i);this.cancelTimer_(),0!==e.length&&i===t&&(this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",t,"nextRange start:",e.start(0)),this.seekTo(e.start(0)+Bu),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))}},{key:"gapFromVideoUnderflow_",value:function(t,e){for(var i=function(t){if(t.length<2)return tr.createTimeRanges();for(var e=[],i=1;i<t.length;i++){var n=t.end(i-1),r=t.start(i);e.push([n,r])}return tr.createTimeRanges(e)}(t),n=0;n<i.length;n++){var r=i.start(n),a=i.end(n);if(e-r<4&&2<e-r)return{start:r,end:a}}return null}}]),lc);function lc(t){var e=this;qo(this,lc),this.tech_=t.tech,this.seekable=t.seekable,this.seekTo=t.seekTo,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=gl("PlaybackWatcher"),this.logger_("initialize");function i(){return e.monitorCurrentTime_()}function n(){return e.techWaiting_()}function r(){return e.cancelTimer_()}function a(){return e.fixesBadSeeks_()}this.tech_.on("seekablechanged",a),this.tech_.on("waiting",n),this.tech_.on(oc,r),this.tech_.on("canplay",i),this.dispose=function(){e.logger_("dispose"),e.tech_.off("seekablechanged",a),e.tech_.off("waiting",n),e.tech_.off(oc,r),e.tech_.off("canplay",i),e.checkCurrentTimeTimeout_&&d.clearTimeout(e.checkCurrentTimeTimeout_),e.cancelTimer_()}}function cc(e,t){var i=0,n=0,r=tr.mergeOptions(hc,t);function a(){n&&e.currentTime(n)}function s(t){null!=t&&(n=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",a),e.src(t),e.trigger({type:"usage",name:"hls-error-reload"}),e.play())}function o(){if(Date.now()-i<1e3*r.errorInterval)e.trigger({type:"usage",name:"hls-error-reload-canceled"});else{if(r.getSource&&"function"==typeof r.getSource)return i=Date.now(),r.getSource.call(e,s);tr.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}}function u(){e.off("loadedmetadata",a),e.off("error",o),e.off("dispose",u)}e.ready(function(){e.trigger({type:"usage",name:"hls-error-reload-initialized"})}),e.on("error",o),e.on("dispose",u),e.reloadSourceOnError=function(t){u(),cc(e,t)}}var hc={errorInterval:30,getSource:function(t){return t(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_)}},Xa=function(t){cc(this,t)};tr.use("*",function(e){return{setSource:function(t,e){e(null,t)},setCurrentTime:function(t){return e.vhs&&e.currentSource().src===e.vhs.source_.src&&e.vhs.setCurrentTime(t),t},play:function(){e.vhs&&e.currentSource().src===e.vhs.source_.src&&e.vhs.setCurrentTime(e.currentTime())}}});var dc={PlaylistLoader:eu,Playlist:Du,Decrypter:qe,AsyncStream:Bo,decrypt:jo,utils:Ht,STANDARD_PLAYLIST_SELECTOR:function(){return function(t,e,i,n,r){var a=t.playlists.map(function(t){var e=t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width,i=t.attributes.RESOLUTION&&t.attributes.RESOLUTION.height;return{bandwidth:t.attributes.BANDWIDTH||d.Number.MAX_VALUE,width:e,height:i,playlist:t}});Ll(a,function(t,e){return t.bandwidth-e.bandwidth});var s=(a=a.filter(function(t){return!Du.isIncompatible(t.playlist)})).filter(function(t){return Du.isEnabled(t.playlist)});s.length||(s=a.filter(function(t){return!Du.isDisabled(t.playlist)}));var o=s.filter(function(t){return t.bandwidth*Il.BANDWIDTH_VARIANCE<e}),u=o[o.length-1],l=o.filter(function(t){return t.bandwidth===u.bandwidth})[0];if(!1===r){var c=l||s[0]||a[0];return c?c.playlist:null}t=o.filter(function(t){return t.width&&t.height});Ll(t,function(t,e){return t.width-e.width});var r=t.filter(function(t){return t.width===i&&t.height===n}),u=r[r.length-1],c=r.filter(function(t){return t.bandwidth===u.bandwidth})[0],h=void 0,o=void 0,r=void 0;c||(o=(h=t.filter(function(t){return t.width>i||t.height>n})).filter(function(t){return t.width===h[0].width&&t.height===h[0].height}),u=o[o.length-1],r=o.filter(function(t){return t.bandwidth===u.bandwidth})[0]);a=r||c||l||s[0]||a[0];return a?a.playlist:null}(this.playlists.master,this.systemBandwidth,parseInt(Al(this.tech_.el(),"width"),10),parseInt(Al(this.tech_.el(),"height"),10),this.limitRenditionByPlayerDimensions)},INITIAL_PLAYLIST_SELECTOR:function(){var t=this.playlists.master.playlists.filter(Du.isEnabled);return Ll(t,Ol),t.filter(function(t){return Ku(t.attributes.CODECS).videoCodec})[0]||null},comparePlaylistBandwidth:Ol,comparePlaylistResolution:function(t,e){var i=void 0,n=void 0;return t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(i=t.attributes.RESOLUTION.width),i=i||d.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(n=e.attributes.RESOLUTION.width),i===(n=n||d.Number.MAX_VALUE)&&t.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?t.attributes.BANDWIDTH-e.attributes.BANDWIDTH:i-n},xhr:fu()};["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(e){Object.defineProperty(dc,e,{get:function(){return tr.log.warn("using Hls."+e+" is UNSAFE be sure you know what you are doing"),Il[e]},set:function(t){tr.log.warn("using Hls."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?tr.log.warn("value of Hls."+e+" must be greater than or equal to 0"):Il[e]=t}})});function pc(t){return/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i.test(t)?"hls":/^application\/dash\+xml/i.test(t)?"dash":null}function fc(t,e){for(var i=e.media(),n=-1,r=0;r<t.length;r++)if(t[r].id===i.uri){n=r;break}t.selectedIndex_=n,t.trigger({selectedIndex:n,type:"change"})}var mc="videojs-vhs";dc.canPlaySource=function(){return tr.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};function gc(t){var e;"dash"===t.options_.sourceType&&(!(e=tr.players[t.tech_.options_.playerId]).eme||(t=function(t,e,i){if(!t)return t;var n,r={};for(n in t)r[n]={audioContentType:'audio/mp4; codecs="'+i.attributes.CODECS+'"',videoContentType:'video/mp4; codecs="'+e.attributes.CODECS+'"'},e.contentProtection&&e.contentProtection[n]&&e.contentProtection[n].pssh&&(r[n].pssh=e.contentProtection[n].pssh),"string"==typeof t[n]&&(r[n].url=t[n]);return tr.mergeOptions(t,r)}(t.source_.keySystems,t.playlists.media(),t.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader.media()))&&(e.currentSource().keySystems=t,e.eme.initializeMediaKeys&&e.eme.initializeMediaKeys()))}function yc(){if(!window.localStorage)return null;var t=window.localStorage.getItem(mc);if(!t)return null;try{return JSON.parse(t)}catch(t){return null}}dc.supportsNativeHls=function(){var e=h.createElement("video");if(!tr.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(t){return/maybe|probably/i.test(e.canPlayType(t))})}(),dc.supportsNativeDash=!!tr.getTech("Html5").isSupported()&&/maybe|probably/i.test(h.createElement("video").canPlayType("application/dash+xml")),dc.supportsTypeNatively=function(t){return"hls"===t?dc.supportsNativeHls:"dash"===t&&dc.supportsNativeDash},dc.isSupported=function(){return tr.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Ht=tr.getComponent("Component"),vc=(di(_c,Ht),ae(_c,[{key:"setOptions_",value:function(){var t,e=this;this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,"number"!=typeof this.options_.blacklistDuration&&(this.options_.blacklistDuration=300),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage&&((t=yc())&&t.bandwidth&&(this.options_.bandwidth=t.bandwidth,this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),t&&t.throughput&&(this.options_.throughput=t.throughput,this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))),"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=Il.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Il.INITIAL_BANDWIDTH,["withCredentials","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange"].forEach(function(t){void 0!==e.source_[t]&&(e.options_[t]=e.source_[t])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions}},{key:"src",value:function(t,e){var n=this;t&&(this.setOptions_(),this.options_.url=this.source_.src,this.options_.tech=this.tech_,this.options_.externHls=dc,this.options_.sourceType=pc(e),this.options_.seekTo=function(t){n.tech_.setCurrentTime(t),n.setCurrentTime(t)},this.masterPlaylistController_=new rc(this.options_),this.playbackWatcher_=new uc(tr.mergeOptions(this.options_,{seekable:function(){return n.seekable()}})),this.masterPlaylistController_.on("error",function(){tr.players[n.tech_.options_.playerId].error(n.masterPlaylistController_.error)}),this.masterPlaylistController_.selectPlaylist=(this.selectPlaylist||dc.STANDARD_PLAYLIST_SELECTOR).bind(this),this.masterPlaylistController_.selectInitialPlaylist=dc.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(t){this.masterPlaylistController_.selectPlaylist=t.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(t){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=t,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.bandwidth},set:function(t){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=t,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var t=1/(this.bandwidth||1),e=void 0,e=0<this.throughput?1/this.throughput:0;return Math.floor(1/(t+e))},set:function(){tr.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 Lu(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 Lu(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(t){if(window.localStorage){var e=(e=yc())?tr.mergeOptions(e,t):t;try{window.localStorage.setItem(mc,JSON.stringify(e))}catch(t){return}}}({bandwidth:n.bandwidth,throughput:Math.round(n.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){var i,t;t=(i=n).playlists,i.representations=function(){return t.master.playlists.filter(function(t){return!cu(t)}).map(function(t,e){return new sc(i,t,t.uri)})},gc(n)}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.tech_.ready(function(){return n.setupQualityLevels_()}),this.tech_.el()&&this.tech_.src(tr.URL.createObjectURL(this.masterPlaylistController_.mediaSource)))}},{key:"setupQualityLevels_",value:function(){var i=this,t=tr.players[this.tech_.options_.playerId];t&&t.qualityLevels&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){var e,t;e=i.qualityLevels_,(t=i).representations().forEach(function(t){e.addQualityLevel(t)}),fc(e,t.playlists)}),this.playlists.on("mediachange",function(){fc(i.qualityLevels_,i.playlists)}))}},{key:"play",value:function(){this.masterPlaylistController_.play()}},{key:"setCurrentTime",value:function(t){this.masterPlaylistController_.setCurrentTime(t)}},{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,Wo(_c.prototype.__proto__||Object.getPrototypeOf(_c.prototype),"dispose",this).call(this)}},{key:"convertToStreamTime",value:function(t,e){return Su({playlist:this.masterPlaylistController_.media(),time:t,callback:e})}},{key:"seekToStreamTime",value:function(t,e){var i=!(2<arguments.length&&void 0!==arguments[2])||arguments[2],n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:2;return ku({streamTime:t,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:e})}}]),_c);function _c(t,e,i){qo(this,_c);var n=Qo(this,(_c.__proto__||Object.getPrototypeOf(_c)).call(this,e,i.hls));if(e.options_&&e.options_.playerId&&((i=tr(e.options_.playerId)).hasOwnProperty("hls")||Object.defineProperty(i,"hls",{get:function(){return tr.log.warn("player.hls is deprecated. Use player.tech().hls instead."),e.trigger({type:"usage",name:"hls-player-access"}),n},configurable:!0}),i.vhs=n,(i.dash=n).player_=i),n.tech_=e,n.source_=t,n.stats={},n.setOptions_(),n.options_.overrideNative&&e.overrideNativeAudioTracks&&e.overrideNativeVideoTracks)e.overrideNativeAudioTracks(!0),e.overrideNativeVideoTracks(!0);else if(n.options_.overrideNative&&(e.featuresNativeVideoTracks||e.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return n.on(h,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(t){var e=h.fullscreenElement||h.webkitFullscreenElement||h.mozFullScreenElement||h.msFullscreenElement;e&&e.contains(n.tech_.el())&&n.masterPlaylistController_.smoothQualityChange_()}),n.on(n.tech_,"seeking",function(){this.tech_.seeking()&&0===this.tech_.currentTime()&&this.tech_.player_.loop()&&this.setCurrentTime(0)}),n.on(n.tech_,"error",function(){this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()}),n.on(n.tech_,"play",n.play),n}var bc={name:"videojs-http-streaming",VERSION:"1.5.1",canHandleSource:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=tr.mergeOptions(tr.options,e);return bc.canPlayType(t.type,e)},handleSource:function(t,e){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},i=tr.mergeOptions(tr.options,i);return e.hls=new vc(t,e,i),e.hls.xhr=fu(),e.hls.src(t.src,t.type),e.hls},canPlayType:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=tr.mergeOptions(tr.options,e).hls.overrideNative,e=pc(t);return e&&(!dc.supportsTypeNatively(e)||i)?"maybe":""}};return void 0!==tr.MediaSource&&void 0!==tr.URL||(tr.MediaSource=rr,tr.URL=Vt),rr.supportsNativeMediaSources()&&tr.getTech("Html5").registerSourceHandler(bc,0),tr.HlsHandler=vc,tr.HlsSourceHandler=bc,tr.Hls=dc,tr.use||tr.registerComponent("Hls",dc),tr.options.hls=tr.options.hls||{},tr.registerPlugin?tr.registerPlugin("reloadSourceOnError",Xa):tr.plugin("reloadSourceOnError",Xa),tr}),function(){var t;(t=(t=window)&&t.videojs)&&(t.CDN_VERSION="7.4.1")}();;
window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return setTimeout(e,1e3/60)},window.cancelAnimationFrame=window.cancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)};var CHARITY_SITE_DOMAIN=-1!==window.location.hostname.indexOf("dev.aspdotnetstorefront.thenaturalsapphirecompany.com")?"http://dev.charity.thenaturalsapphirecompany.com":-1!==window.location.hostname.indexOf("staging.aspdotnetstorefront.thenaturalsapphirecompany.com")?"http://staging.charity.thenaturalsapphirecompany.com/":"http://charity.thenaturalsapphirecompany.com/";if(navigator.userAgent.match(/IEMobile\/10\.0/)){var msViewportStyle=document.createElement("style");msViewportStyle.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")),document.querySelector("head").appendChild(msViewportStyle)}function TrackVideo(e,t){try{ga("send","event","Videos",e,t)}catch(o){console.log("GA Event Error :: Videos :: "+e+" :: "+t+" :: "+o.message)}}function updateBandSidestoneOption(){var parameterData={};parameterData.bandWidth=$("select#band-width option:selected").text().replace("(default)",""),parameterData.bandId=$("div#band-width").parent().find("#bandId").val(),$(".sidestone-row").length?$.ajax({url:"/PriceAjax.asmx/GetSidestoneOptions",type:"POST",datatype:"json",traditional:!0,data:JSON.stringify(parameterData),contentType:"application/json; charset=utf-8",success:function(data){for(var newData=eval(data.d),i=0;i<newData.length;i++){var sidestoneDiv=$("#sidestone-option-"+newData[i].StoneNickName.trim().replace(/\s/g,"-")),weightList=sidestoneDiv.find("#sidestone-weight").empty();$.each(newData[i].Weights,(function(e,t){weightList.append("<option value='"+(e+1)+"'>"+t+"</option>")}));var gradeList=sidestoneDiv.find("#sidestone-grade").empty();$.each(newData[i].Grades,(function(e,t){gradeList.append("<option value='"+(e+1)+"'>"+t+"</option>")}))}},error:function(e,t,o){console.error("Error ["+e.status+"] :: "+e.responseText)},timeout:5e3}).done((function(){setBandPrice(),$.isFunction($.fn.selectric)&&$("select.sidestone-weight, select.sidestone-grade").each((function(){$(this).selectric("refresh")}))})):setBandPrice()}function setBandPrice(){var e=[],t=$(".sidestone-row");null!==t&&$.each(t,(function(t,o){e.push({Weight:$(this).find("#sidestone-weight option:selected").text(),Grade:$(this).find("#sidestone-grade option:selected").text(),ClarityId:"3"})}));var o={ProductId:$("#productId").val(),BandWidth:$("#band-width option:selected").text().replace("(default)",""),BandSize:$("#band-size option:selected").text(),BandDiameter:$("#band-size option:selected").val(),SideStones:e};$.ajax({url:"/PriceAjax.asmx/GetBandPrice",type:"Post",datatype:"json",traditional:!0,data:JSON.stringify({costCalculatorInfo:o}),contentType:"application/json; charset=utf-8",success:function(e){var t=e.d;$(".band-question-price-override").attr("href","/showquote.aspx?ProductID="+$("#productId").val()+"&VariantID="+$("#variantId").val()+"&PriceOverride="+t.toFixed(2)),$(".geolify-currency.band-price").text("$"+t.toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,").replace(".00","")),$(".geolify-currency.band-wire").text("$"+(.975*t).toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,").replace(".00","")),$("#QuickPrice").val(t.toFixed(2)),ConvertGeoCurrency(GeoCurrentCountry),$.ajax({url:"/PriceAjax.asmx/GetExtendReferenceId",type:"Post",datatype:"json",traditional:!0,data:JSON.stringify({price:parseFloat(t.toFixed(2)),bridal:!0}),contentType:"application/json; charset=utf-8",success:function(e){console.log(e),"undefined"!=typeof Extend&&null!==Extend.buttons.instance("#extend-offer")&&Extend.buttons.instance("#extend-offer").setActiveProduct(e.d),"undefined"!=typeof ExtendPlanReferenceId&&(ExtendPlanReferenceId=e.d)},error:function(e,t,o){console.error("Error ["+e.status+"] :: "+e.responseText)},timeout:5e3});try{"undefined"!=typeof updateChargeAfterPrice&&waitForElement(".ca-promotional-widget-link").then((function(e){updateChargeAfterPrice(parseFloat(t.toFixed(2)))}))}catch(e){console.error(e)}},error:function(e,t,o){console.error("Error ["+e.status+"] :: "+e.responseText)},timeout:1e4})}function addBandToCart(e){var t=[],o=$(".buy-actions .sidestone-row");null!==o&&$.each(o,(function(e,o){t.push({Weight:$(this).find("#sidestone-weight option:selected").text(),Grade:$(this).find("#sidestone-grade option:selected").text(),ClarityId:"3"})}));var a={ProductId:$(".buy-actions #productId").val(),BandWidth:$(".buy-actions #band-width option:selected").text().replace("(default)",""),BandSize:$(".buy-actions #band-size option:selected").text(),BandDiameter:$(".buy-actions #band-size option:selected").val(),SideStones:t},n={CostInfo:a,MetalType:$(".buy-actions .MetalTypeText option:selected").text().trim(),Engraving:$(".buy-actions .TextOptionText").val(),VariantId:$(".buy-actions #variantId").val(),FinishStyle:$(".buy-actions #band-finish-style option:selected").text().trim()};$.ajax({url:"/PriceAjax.asmx/TransferToCart",type:"Post",datatype:"json",traditional:!0,data:JSON.stringify({cartType:e,bandInfo:n}),contentType:"application/json; charset=utf-8",success:function(t){if(console.log(t,n,a),"undefined"!=typeof GA4_item_event&&GA4_item_event("add_to_cart"),"undefined"!=typeof Extend&&"0"===e){const e=$("#ExtendPlanLinkedSKU_"+$(".buy-actions #productId").val()+"_"+$(".buy-actions #variantId").val()).val(),o=Extend.buttons.instance("#extend-offer");if(o){const a=o.getPlanSelection();a&&$.ajax({url:"/QuickAddTo.asmx/AddExtendToCart",type:"Post",datatype:"json",traditional:!0,data:JSON.stringify({planId:a.planId,price:(Number(a.price)/100).toFixed(2),title:a.title,linkedItemId:e,linkedCartRecId:t.d}),contentType:"application/json; charset=utf-8",timeout:5e3}).done((function(e){var t=e.d;!0===t.Success?console.log("Extend Plan Added To Cart"):console.error("AJAX Error - Extend Plan Failed Add To Cart",t.Message)})).fail((function(e,t,o){console.error("Ajax Error - Extend Plan Failed Add To Cart",o)}))}}window.location="11"===e?"https://"+document.domain+"/comparelist.aspx":"1"===e?"https://"+document.domain+"/wishlist.aspx":"https://"+document.domain+"/shoppingcart.aspx"},error:function(e,t,o){console.error("Ajax Error - Failed Add To Cart",o),window.alert("We experienced a problem adding this item to your cart. Please try again.")},timeout:2e4})}function ProcessInternationalBanner(){var e=e||!1,t=e?"IntBannerStatus":"IntSaleBannerStatus";null===$.cookie(t)||void 0===$.cookie(t)?ShowInternationalBanner(1e3,1e3):null!==$.cookie(t)&&"visible"===$.cookie(t)&&$("#notification-bar").show(),$("#notification-bar .notification-bar-close").click((function(){HideInternationalBanner()}))}function ShowInternationalBanner(e,t){var o=o||!1,a=o?"IntBannerStatus":"IntSaleBannerStatus";setTimeout((function(){$("#notification-bar").slideDown(t)}),e),$.cookie(a,"visible",{expires:1,path:"/"})}function HideInternationalBanner(){var e=e||!1,t=e?"IntBannerStatus":"IntSaleBannerStatus";$("#notification-bar").slideUp(),$.cookie(t,"hidden",{expires:1,path:"/"})}function FacebookOpenGraphFix(){if(document.namespaces)document.namespaces.add("fb","http://ogp.me/ns#"),document.namespaces.add("og","http://ogp.me/ns/fb#");else{var e=jQuery(jQuery("html").get(0));void 0===e.attr("xmlns:fb")&&(e.attr("xmlns:og","http://ogp.me/ns#"),e.attr("xmlns:fb","http://ogp.me/ns/fb#"))}}String.prototype.endsWith=function(e){return-1!==this.indexOf(e,this.length-e.length)},String.prototype.insert=function(e,t){return e>0?this.substring(0,e)+t+this.substring(e,this.length):t+this},Number.prototype.formatMoney=function(e,t,o){var a=this,n=isNaN(e=Math.abs(e))?2:e,i=void 0===t?".":t,s=void 0===o?",":o,r=a<0?"-":"",c=parseInt(a=Math.abs(+a||0).toFixed(n))+"",l=(l=c.length)>3?l%3:0;return r+(l?c.substr(0,l)+s:"")+c.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+s)+(n?i+Math.abs(a-c).toFixed(n).slice(2):"")},function(e,t,o){var a=/\+/g;function n(e){return e}function i(e){return function(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));return e}(decodeURIComponent(e.replace(a," ")))}function s(e){return r.json?JSON.parse(e):e}var r=e.cookie=function(o,a,c){if(undefined!==a){if(c=e.extend({},r.defaults,c),null===a&&(c.expires=-1),"number"==typeof c.expires){var l=c.expires,d=c.expires=new Date;d.setDate(d.getDate()+l)}return a=r.json?JSON.stringify(a):String(a),t.cookie=[encodeURIComponent(o),"=",r.raw?a:encodeURIComponent(a),c.expires?"; expires="+c.expires.toUTCString():"",c.path?"; path="+c.path:"",c.domain?"; domain="+c.domain:"",c.secure?"; secure":""].join("")}for(var p=r.raw?n:i,u=t.cookie.split("; "),g=o?null:{},h=0,m=u.length;h<m;h++){var f=u[h].split("="),v=p(f.shift()),$=p(f.join("="));if(o&&o===v){g=s($);break}o||(g[v]=s($))}return g};r.defaults={},e.removeCookie=function(t,o){return null!==e.cookie(t)&&(e.cookie(t,null,o),!0)}}(jQuery,document),jQuery.QueryString=function(e){if(""===e)return{};for(var t={},o=0;o<e.length;++o){var a=e[o].split("=");2===a.length&&(t[a[0]]=decodeURIComponent(a[1].replace(/\+/g," ")))}return t}(window.location.search.substr(1).split("&")),jQuery.fn.hasScrollBar=function(e){return"vertical"===e?this.get(0).scrollHeight>this.innerHeight():"horizontal"===e&&this.get(0).scrollWidth>this.innerWidth()},jQuery.extend({getUrlVars:function(e){for(var t=window.location.search.substring(1).split("&"),o=0;o<t.length;o++){var a=t[o].split("=");if(a[0]===e)return a[1]}}});var FancyScrollPosition=0;function InitiateFancybox(){"function"==typeof $.fancybox&&($(".popup-flash").length>0&&$(".popup-flash").fancybox({padding:0,autoSize:!0,fitToView:!0,maxWidth:800,scrolling:"no",mouseWheel:!1,nextEffect:"elastic",prevEffect:"elastic",nextSpeed:500,prevSpeed:500,tpl:{closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:jQuery.fancybox.close();"></a>'},beforeLoad:function(){this.title=$(this.element).find("img").attr("alt")},helpers:{thumbs:{width:75,height:75,source:function(e){return e.element.attr("data-thumbnail")}},title:{type:"outside"}}}),$(".ref-popup-flash").length>0&&$(".ref-popup-flash").fancybox({maxWidth:450,maxHeight:450,padding:35,fitToView:!0,autoSize:!0,closeClick:!1,openEffect:"none",closeEffect:"none",arrows:!0,type:"iframe",nextEffect:"elastic",prevEffect:"elastic",nextSpeed:500,prevSpeed:500,tpl:{closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:jQuery.fancybox.close();"></a>'},beforeLoad:function(){this.title=$(this.element).find("img").attr("alt")},helpers:{thumbs:{width:75,height:75,source:function(e){return e.element.find("img").attr("src")}}}}),$(".popup-youtube").length>0&&$(".popup-youtube").click((function(){return $.fancybox({padding:0,autoScale:!1,transitionIn:"none",transitionOut:"none",title:this.title,width:640,height:385,href:this.href.replace(new RegExp("watch\\?v=","i"),"v/"),type:"swf",swf:{wmode:"transparent",allowfullscreen:"true"}}),!1})),$(".popup-static").length>0&&$(".popup-static").fancybox({maxWidth:800,maxHeight:600,padding:15,fitToView:!0,width:"100%",height:"100%",autoSize:!0,closeClick:!1,openEffect:"none",closeEffect:"none",tpl:{closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:jQuery.fancybox.close();"></a>'}}),$(".popup-dynamic").length>0&&$(".popup-dynamic").fancybox({maxWidth:850,maxHeight:1200,padding:15,fitToView:!0,autoSize:!0,closeClick:!1,openEffect:"none",closeEffect:"none",arrows:!1,type:"iframe",tpl:{closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:jQuery.fancybox.close();"></a>'},beforeLoad:function(){iOSFix(!0)},onUpdate:function(){isApplePie()},afterClose:function(){iOSFix(!1)}}),$(".popup-dynamic-wide").length>0&&$(".popup-dynamic-wide").fancybox({maxWidth:1100,maxHeight:1200,fitToView:!0,width:"100%",height:"100%",autoSize:!0,padding:15,closeClick:!1,openEffect:"none",closeEffect:"none",arrows:!1,type:"iframe",tpl:{closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:jQuery.fancybox.close();"></a>'},beforeLoad:function(){iOSFix(!0)},onUpdate:function(){isApplePie()},afterClose:function(){iOSFix(!1)}}),$(".popup-image").length>0&&$(".popup-image").fancybox({width:"auto",height:"auto",maxWidth:800,maxHeight:800,padding:0,fitToView:!0,autoSize:!1,closeClick:!1,openEffect:"none",closeEffect:"none",arrows:!0,helpers:{thumbs:{width:75,height:75,source:function(e){return e.element.find("img").attr("src")}}},tpl:{closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:jQuery.fancybox.close();"></a>'},beforeLoad:function(){if(this.element.attr("data-caption")||this.element.attr("data-caption-title")){var e=this.element.attr("data-caption-title"),t=this.element.attr("data-caption");$(e).length>0?this.tpl.wrap='<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin" style="background: transparent !important;"><div class="fancybox-outer"><div class="fancybox-inner"></div><div class="fancybox-caption"><div class="fancybox-caption-inner p-a-md"><div class="fancybox-caption-title h3">'+e+'</div><p class="m-b-0">'+t+"</p></div></div></div></div></div>":this.tpl.wrap='<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin" style="background: transparent !important;"><div class="fancybox-outer"><div class="fancybox-inner"></div><div class="fancybox-caption"><div class="fancybox-caption-inner p-a-md"><p class="m-b-0">'+t+"</p></div></div></div></div></div>"}},beforeShow:function(){console.log(this);var e=this.element.find("img").attr("alt");this.inner.find("img").attr("alt",e)}}),$(".popup-topic").length>0&&$(".popup-topic").fancybox({maxWidth:850,maxHeight:1200,padding:25,fitToView:!0,autoSize:!0,closeClick:!1,openEffect:"none",closeEffect:"none",arrows:!0,tpl:{closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:jQuery.fancybox.close();"></a>'}}),$(".popup").length&&$(".popup").fancybox({autoSize:!1,fitToView:!0,maxWidth:800,tpl:{closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:jQuery.fancybox.close();"></a>'},afterClose:function(){$(".product-options").removeAttr("style")},parent:"#aspnetForm"}),$(".popup-video").length&&$(".popup-video").fancybox({padding:0,height:"auto",autoSize:!1,fitToView:!0,maxWidth:800,aspectRatio:!0,tpl:{closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:jQuery.fancybox.close();"></a>'},afterShow:function(){$(".fancybox-inner video")[0].play()},beforeClose:function(){$(".fancybox-inner video")[0].pause()}}),$(".popup-video-youtube").length&&$(".popup-video-youtube").fancybox({padding:0,height:"auto",autoSize:!1,fitToView:!0,maxWidth:800,aspectRatio:!0,tpl:{closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:jQuery.fancybox.close();"></a>'}}),$("[data-popup=iframe]").length&&$("[data-popup=iframe]").fancybox({maxWidth:800,type:"iframe",tpl:{closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:jQuery.fancybox.close();"></a>'},beforeLoad:function(){iOSFix(!0)},onUpdate:function(){isApplePie()&&$(".fancybox-inner").css("height","")},afterClose:function(){iOSFix(!1)}}),$("[data-popup=ajax]").length&&$("[data-popup=ajax]").fancybox({maxWidth:800,type:"ajax",tpl:{closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:jQuery.fancybox.close();"></a>'}}))}function ActionEffects(){try{$.fancybox.close()}catch(e){console.error("Error Closing Fancybox Window")}return!0}function iOSFix(e){isApplePie()&&(e?(FancyScrollPosition=window.pageYOffset,window.scrollTo(0,0),$("body").addClass("fancybox-lock"),$("html, body").addClass("swanky-fancy-fix")):($("body").removeClass("fancybox-lock"),$("html, body").removeClass("swanky-fancy-fix"),window.scrollTo(0,FancyScrollPosition),FancyScrollPosition=0))}function isApplePie(){return navigator.userAgent.match(/(iPhone|iPod|iPad)/i)}function InitiateNivo(){$(".cad-model-gallery, .cad-model-gallery2").slick({arrows:!1,autoplay:!1,draggable:!1,fade:!0,pauseOnFocus:!1,swipe:!1})}function AutoScrollTo(e){$(e).length>0&&$(e).val()>0&&$(window).scrollTo($(e).val())}function SaveScrollPosition(e,t){return $(e).length>0&&$(e).val($(t).offset().top),!0}function SubCatMultiImagesJS(){$(".carousel-img-nav").length&&($(this).parent().siblings(".thumb-tb").removeClass("hide"),$(".carousel-img-nav").click((function(e){e.preventDefault(),SubCatMultiImagesJSHelper(this)})))}function SubCatMultiImagesJSHelper(e){direction=$(e).attr("data-direction"),imgList=$(e).siblings(".carousel-img-list"),imgCount=imgList.attr("data-count"),imgIndex=Number(imgList.children(".active").attr("data-index")),imgNextIndex=Number("next"===direction?imgIndex+1>imgCount?1:imgIndex+1:imgIndex-1==0?imgCount:imgIndex-1),currentImg=$(e).siblings("a").children("img"),nextImgSrc=imgList.children("li[data-index='"+imgNextIndex+"']").html(),nextImg=new Image,nextImg.onload=function(){currentImg.fadeTo(200,.75,(function(){currentImg.prop("src",nextImgSrc),currentImg.fadeTo(200,1)}))},imgList.children("li[data-index='"+imgIndex+"']").removeClass("active"),imgList.children("li[data-index='"+imgNextIndex+"']").addClass("active"),nextImg.src=nextImgSrc;try{dataType=imgList.children("li[data-index='"+imgNextIndex+"']").attr("data-type"),"video"===dataType?(dataUrl=imgList.children("li[data-index='"+imgNextIndex+"']").attr("data-url"),void 0!==dataUrl&&dataUrl.length>0&&(videoContent='<object width="450" height="450" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">    <param value="'+dataUrl+'" name="movie">    <param value="high" name="quality">    <embed width="450" height="450" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" src="'+dataUrl+'"></embed></object>',$.fancybox.open({content:videoContent,afterClose:function(){try{ga("send","event","Category Listing Mini Video","Category Listing Mini Video Opened","flash")}catch(e){console.error("Error Sending Category Listing Mini Video (video) Event to GA")}}}))):"flash3d"===dataType||"java3d"===dataType?(dataUrl=imgList.children("li[data-index='"+imgNextIndex+"']").attr("data-url"),void 0!==dataUrl&&dataUrl.length>0&&$.fancybox.open({type:"ajax",href:dataUrl,afterClose:function(){try{ga("send","event","Category Listing Mini 3D Viewer","Category Listing Mini 3D Viewer Opened",tmpDataType)}catch(e){console.error("Error Sending Category Listing Mini 3D Viewer Event to GA")}}})):"videomp4"===dataType&&(dataUrl=imgList.children("li[data-index='"+imgNextIndex+"']").attr("data-url"),void 0!==dataUrl&&dataUrl.length>0&&(videoContent='<div><div class="iframe-rwd iframe-ratio:1x1 mb-0" style="border-radius: 0;"><video width="100%" controls loop preload="none"><source src="'+dataUrl+'" type="video/mp4"></video></div></div>',$.fancybox.open({padding:0,height:"auto",autoSize:!1,fitToView:!0,maxWidth:450,aspectRatio:!0,content:videoContent,afterShow:function(){$(".fancybox-inner video").length&&$(".fancybox-opened video")[0].play()},afterClose:function(){try{ga("send","event","Category Listing Mini Video","Category Listing Mini Video Opened","mp4")}catch(e){console.error("Error Sending Category Listing Mini Video (videomp4) Event to GA")}}})))}catch(e){console.error("Error With Videos")}}function AddFileUpload(e,t){var o=parseInt($("#ctl00_"+e+"_MultiFileCount"+t).val())+1;$("#ctl00_"+e+"_MultiFileCount"+t).val(o),$("#AddFileUpload_"+t).before('<input type="file" id="ctl00_'+e+"_"+t+o+'" style="display:none;" name="ctl00$'+e+"$"+t+o+'" />'),$("#AddFileUpload_"+t).before("<br />"),$("#ctl00_"+e+"_"+t+o).slideDown(500)}function InitiateMetalTypeDropDown(){if(!($(".MetalTypeText").length>0))return!0;$(".MetalTypeText").change((function(){var e=$(".MetalTypeText option:selected").val(),t="?";return $(".SizeText").length>0&&"-,-"!==$(".SizeText option:selected").val().toLowerCase()&&(t+="size="+$(".SizeText option:selected").val().toLowerCase()+"&"),$(".BandSizeText").length>0&&(t+="bandsize="+$(".BandSizeText option:selected").text().toLowerCase()+"&"),$(".BandWidthText").length>0&&(t+="bandwidth="+$(".BandWidthText option:selected").val().toLowerCase()+"&"),$(".FinishStyleText").length>0&&(t+="finishstyle="+$(".FinishStyleText option:selected").val().toLowerCase()+"&"),$(".TextOptionText").length>0&&(t+="engraving="+$(".TextOptionText").val()+"&"),$(".sidestone-grade").length>0&&$(".sidestone-grade").each((function(e){t+="ssgrade"+e+"="+$(this).val()+"&"})),$(".sidestone-weight").length>0&&$(".sidestone-weight").each((function(e){t+="ssweight"+e+"="+$(this).val()+"&"})),window.location=e+(t.length>1?t:""),!0}))}function LoadGalleriffic(){if($("#galleriffic").length>0){$("#galleriffic .content").css("display","block");$("#thumbs .thumbs li").opacityrollover({mouseOutOpacity:.67,mouseOverOpacity:1,fadeSpeed:"fast",exemptionSelector:".selected"});$("#thumbs").galleriffic({delay:2500,numThumbs:16,preloadAhead:4,enableTopPager:!1,enableBottomPager:!0,maxPagesToShow:10,imageContainerSel:"#slideshow",controlsContainerSel:"#controls",captionContainerSel:"#caption",loadingContainerSel:"#loading",renderSSControls:!1,renderNavControls:!0,playLinkText:"Play Slideshow",pauseLinkText:"Pause Slideshow",prevLinkText:"&laquo; Previous Photo",nextLinkText:"Next Photo &raquo;",nextPageLinkText:"Next &raquo;",prevPageLinkText:"&laquo; Prev",enableHistory:!1,autoStart:!1,syncTransitions:!1,defaultTransitionDuration:500,onPageTransitionOut:function(e){this.fadeTo("fast",0,e)},onPageTransitionIn:function(){this.fadeTo("fast",1)}})}}function ScrollToAnchor(){$('a[href^="#"]').length&&$('a[href^="#"]:not([class*="popup"])').on("click",(function(e){if("ignore"!==$(this).attr("data-scroll")){e.preventDefault();var t=this.hash,o=$(t);t&&$("html, body").stop().animate({scrollTop:o.offset().top},900,"swing",(function(){window.location.hash=t}))}}))}function ForgotPasswordToggle(){$(".forgot-password-box").length&&($(".recover_password_trigger").length&&$(".recover_password_trigger").click((function(){$("#ctl00_PageContent_ctl00_ctrlLogin_FormPanel").length&&$("#ctl00_PageContent_ctl00_ctrlLogin_FormPanel").slideUp("slow"),$(".forgot-password-box").slideDown("slow"),$("input[id=ctl00_PageContent_ctl00_WhichToShow]").length&&$("input[id=ctl00_PageContent_ctl00_WhichToShow]").val("forgot")})),$(".recover_password_untrigger").length&&$(".recover_password_untrigger").click((function(){$("#ctl00_PageContent_ctl00_ctrlLogin_FormPanel").length&&$("#ctl00_PageContent_ctl00_ctrlLogin_FormPanel").slideDown("slow"),$(".forgot-password-box").slideUp("slow"),$("input[id=ctl00_PageContent_ctl00_WhichToShow]").length&&$("input[id=ctl00_PageContent_ctl00_WhichToShow]").val("signin")}))),$(".forgot-password-box").length&&$("input[id=ctl00_PageContent_ctl00_WhichToShow]").length&&("forgot"===$("input[id=ctl00_PageContent_ctl00_WhichToShow]").val()&&$(".recover_password_trigger").length?($("#ctl00_PageContent_ctl00_ctrlLogin_FormPanel").length&&$("#ctl00_PageContent_ctl00_ctrlLogin_FormPanel").hide(),$(".forgot-password-box").show()):($(".forgot-password-box").hide(),$("#ctl00_PageContent_ctl00_ctrlLogin_FormPanel").length&&$("#ctl00_PageContent_ctl00_ctrlLogin_FormPanel").show()))}function CheckoutJumpTo(){if($("#ctl00_PageContent_JumpTo").length&&$("#ctl00_PageContent_Animate").length){var e=null;switch($("#ctl00_PageContent_JumpTo").val()){case"Shipping":e=$("#ctl00_PageContent_Step1");break;case"Billing":e=$("#ctl00_PageContent_Step2");break;case"Account":e=$("#ctl00_PageContent_Step3");break;case"CreditCard":e=$("#ctl00_PageContent_CreditCardPanel");break;case"CreditCardStatic":e=$("#ctl00_PageContent_CreditCardStaticPanel");break;default:e=null}var t=0;$("#ctl00_PageContent_Animate").val()&&(t=Number($("#ctl00_PageContent_Animate").val())),null!==e&&e.length&&$("html,body").animate({scrollTop:e.offset().top},t),$("#ctl00_PageContent_JumpTo").val(""),$("#ctl00_PageContent_Animate").val("")}}function getSelectedText(){var e="";return void 0!==window.getSelection?e=window.getSelection().toString():void 0!==document.selection&&"Text"===document.selection.type&&(e=document.selection.createRange().text),e}window.mobilecheck=function(){var e,t=!1;return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),t},window.isFlashEnabled=function(){var e=!1;try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash")&&(e=!0)}catch(t){navigator.mimeTypes&&void 0!==navigator.mimeTypes["application/x-shockwave-flash"]&&navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin&&(e=!0)}return e},jQuery.fn.getCursorPosition=function(){var e=this.get(0);if(e){if("selectionStart"in e)return e.selectionStart;if(document.selection){e.focus();var t=document.selection.createRange(),o=document.selection.createRange().text.length;return t.moveStart("character",-e.value.length),t.text.length-o}}};var cvvLength=3;function setSelectionRange(e,t,o){if(e.setSelectionRange)e.focus(),e.setSelectionRange(t,o);else if(e.createTextRange){var a=e.createTextRange();a.collapse(!0),a.moveEnd("character",o),a.moveStart("character",t),a.select()}}function setCaretToPos(e,t){setSelectionRange(e,t,t)}function MaskCC(){IsKindle()||($(".mask-ccexp").length&&($(".mask-ccexp").keydown((function(e){""===getSelectedText()&&(32===e.keyCode||e.keyCode>=65&&e.keyCode<=90||e.keyCode>=106&&e.keyCode<=126||e.keyCode>=186&&191!=e.keyCode&&220!=e.keyCode||(e.keyCode>=48&&e.keyCode<=57||e.keyCode>=96&&e.keyCode<=105||191===e.keyCode||220===e.keyCode)&&$(".mask-ccexp").val().length>=5?e.preventDefault():(191!==e.keyCode&&220!==e.keyCode||!$(".mask-ccexp").val().includes("/")&&!$(".mask-ccexp").val().includes("/"))&&(191!==e.keyCode&&220!==e.keyCode||0!==$(".mask-ccexp").val().length)||e.preventDefault())})),$(".mask-ccexp").keyup((function(){TrimCCExp()})),$(".mask-ccexp").focus((function(){TrimCCExp()})),$(".mask-ccexp").focusout((function(){var e=$(".mask-ccexp").val().replace("\\","/");4===e.length&&"/"===e[1]?e="0"+e:4!==e.length||e.includes("/")?3!==e.length||e.includes("/")||0==Number(e[0])||(e="0"+e[0]+"/"+e[1]+e[2]):e=e[0]+e[1]+"/"+e[2]+e[3],$(".mask-ccexp").val(e)}))),$(".mask-ccnum").length&&(MaskCCDynamically(),$(".mask-ccnum").keydown((function(e){if(""===getSelectedText()){var t=$(".mask-ccnum").getCursorPosition(),o=$(".mask-ccnum").val().length;if(8===e.keyCode){for(;t>0&&" "===$(".mask-ccnum").val()[t-1];)t-=1;setCaretToPos($(".mask-ccnum")[0],t)}else if(46===e.keyCode){for(;t<o&&" "===$(".mask-ccnum").val()[t];)t+=1;setCaretToPos($(".mask-ccnum")[0],t)}}})),$(".mask-ccnum").keyup((function(e){if(""===getSelectedText()){var t=$(".mask-ccnum").val().length,o=$(".mask-ccnum").getCursorPosition();39===e.keyCode?(o<t&&" "===$(".mask-ccnum").val()[o]||o<t&&o>0&&" "===$(".mask-ccnum").val()[o-1])&&(o+=1):37===e.keyCode?(o>0&&" "===$(".mask-ccnum").val()[o-1]||o>0&&" "===$(".mask-ccnum").val()[o])&&(o-=1):(MaskCCDynamically(),8!==e.keyCode&&46!==e.keyCode&&(o===t?o=o+$(".mask-ccnum").val().length-t:o<t&&o>0&&" "===$(".mask-ccnum").val()[o-1]&&(o+=1))),setCaretToPos($(".mask-ccnum")[0],o)}}))),$(".mask-ccsec").length&&($(".mask-ccsec").keydown((function(e){""===getSelectedText()&&(32===e.keyCode||e.keyCode>=65&&e.keyCode<=90||e.keyCode>=106&&e.keyCode<=123||e.keyCode>=186||(e.keyCode>=48&&e.keyCode<=57||e.keyCode>=96&&e.keyCode<=105)&&$(".mask-ccsec").val().length>=cvvLength)&&e.preventDefault()})),$(".mask-ccsec").keyup((function(){TrimCCSec()})),$(".mask-ccsec").focus((function(){TrimCCSec()}))))}function TrimCCExp(){var e=String($(".mask-ccexp").val().replace(/[^0-9\\/\\]/g,""));e.length>5&&(e=e.substring(0,5)),$(".mask-ccexp").val(e)}function TrimCCSec(){var e=String($(".mask-ccsec").val().replace(/[^0-9]/g,""));e.length>cvvLength&&(e=e.substring(0,cvvLength)),$(".mask-ccsec").val(e)}function MaskCCDynamically(){if($(".mask-ccnum").length){var e=String($(".mask-ccnum").val().replace(/[^0-9]/g,""));if(e.length>3){var t=e.substr(0,1),o=e.substr(0,2),a=e.substr(0,4);"34"===o||"37"===o?(e.length>15&&(e=e.substr(0,15)),e.length>4&&(e=e.insert(4," ")),e.length>11&&(e=e.insert(11," ")),cvvLength=4):"4"!==t&&"51"!==o&&"52"!==o&&"53"!==o&&"54"!==o&&"55"!==o&&"22"!==o&&"23"!==o&&"24"!==o&&"25"!==o&&"26"!==o&&"27"!==o&&"6011"!==a||(e.length>16&&(e=e.substr(0,16)),e.length>4&&(e=e.insert(4," ")),e.length>9&&(e=e.insert(9," ")),e.length>14&&(e=e.insert(14," ")),cvvLength=3)}$(".mask-ccnum").val(e)}}function IsKindle(){return navigator.userAgent.match(/kindle/i)||navigator.userAgent.match(/kfot/i)||navigator.userAgent.match(/kftt/i)||navigator.userAgent.match(/kfjwa/i)||navigator.userAgent.match(/kfjwi/i)||navigator.userAgent.match(/kfsowi/i)||navigator.userAgent.match(/kfthwa/i)||navigator.userAgent.match(/kfthwi/i)||navigator.userAgent.match(/kfapwa/i)||navigator.userAgent.match(/kfapwi/i)}function validateSearch(e){return!($("#"+e).length>0)||($("#"+e).val()===$("#"+e).attr("title")||""===$("#"+e).val()?(alert("Please enter Item ID# to perform search."),$("#"+e).focus(),Ladda.stopAll(),!1):(gtag("event","search",{search_term:$("#"+e).val()}),!0))}function CreateAccountToggle(e){$("#ctl00_PageContent_CreateAccount_0").length&&$("#ctl00_PageContent_CreateAccount_1").length&&$(".password-optional").length&&($("input[id=ctl00_PageContent_CreateAccount_1]").prop("checked")?e?$(".password-optional").slideDown():$(".password-optional").show():e?$(".password-optional").slideUp():$(".password-optional").hide())}function ProductAddedToCartConfirmationEffect(){$(".ProductAddedToCart").length>0&&$.fancybox.open({content:$("."+$(".ProductAddedToCart").html()).html(),wrapCSS:"atc-popup-wrapper"})}function Userlike(){$(".chat-btn-wrap").append('<button class="button button-sm button-default-outline btn-chat hidden-xs"><i class="svg svg-live-chat svg-live-chat__active" style="background-image: none;"><svg width="14" height="14" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg"><path d="M9.245 11.988l-1.837 1.837A.53.53 0 0 1 7 14a.53.53 0 0 1-.408-.175l-1.837-1.837a.325.325 0 0 1-.088.012H2.333A2.33 2.33 0 0 1 0 9.678V2.333A2.34 2.34 0 0 1 2.333 0h9.334A2.34 2.34 0 0 1 14 2.333v7.345A2.33 2.33 0 0 1 11.667 12H9.333a.325.325 0 0 1-.088-.012zM7.583 6.417c.35 0 .584-.234.584-.584s-.234-.583-.584-.583H3.5c-.35 0-.583.233-.583.583s.233.584.583.584h4.083zM10.5 4.083c.35 0 .583-.233.583-.583s-.233-.583-.583-.583h-7c-.35 0-.583.233-.583.583s.233.583.583.583h7z" fill-rule="nonzero" fill="#4FAE46"></path></svg></i>&nbsp; Live Chat</button>'),$(".btn-chat").on("click",(function(){try{$("div[id^=userlike] iframe")[0].contentWindow.document.getElementsByTagName("button")[0].click()}catch(e){}}))}var quickAddCompareIcon='<i class="svg svg-compare-add"><svg height="16" viewBox="0 0 19 16" width="19" xmlns="http://www.w3.org/2000/svg"><path d="M17.105 8.41h-3.841l1.92-3.147zM5.19 8.415H1.347L3.268 5.27zm6.727.526c0 .964.36 1.84.941 2.477.594.65 1.417 1.052 2.328 1.052.911 0 1.734-.402 2.328-1.052a3.67 3.67 0 0 0 .94-2.477v-.356L15.636 3.97l-.452-.74-5.436.002V2.39a1.255 1.255 0 1 0-1.062 0v.842l-5.418.003-.452.74-2.71 4.44L0 8.59v.356c0 .964.36 1.84.94 2.477.594.65 1.417 1.052 2.328 1.052.911 0 1.734-.402 2.328-1.052.581-.637.94-1.513.94-2.477V8.59L3.913 4.293l4.773-.002v10.647h-3.18V16h7.423v-1.062h-3.18V4.29l4.79-.002-2.516 4.121-.107.175v.11z" fill="#7ab1ff" /></svg></i>',quickAddFavoriteIcon='<i class="svg svg-heart svg-favorite"><svg width="15" height="14" viewBox="0 0 15 14" xmlns="http://www.w3.org/2000/svg"><path d="M7.583 13.708l-1.06-.957c-1.89-1.663-3.394-3.144-4.511-4.443C.896 7.009.326 5.688.303 4.343c.023-1.14.41-2.085 1.162-2.837C2.217.754 3.163.366 4.302.344c.638 0 1.242.137 1.812.41.57.274 1.06.638 1.47 1.094.41-.456.9-.82 1.47-1.094a4.134 4.134 0 0 1 1.81-.41c1.14.023 2.086.41 2.837 1.162.752.752 1.14 1.698 1.163 2.837-.023 1.345-.593 2.666-1.71 3.965-1.116 1.299-2.62 2.78-4.511 4.443l-1.06.957z" fill-rule="nonzero" fill="#bf4055" /></svg></i>',quickAddRemoveIcon='<i class="svg svg-remove-list"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M2,6V8H14V6H2M2,10V12H11V10H2M14.17,10.76L12.76,12.17L15.59,15L12.76,17.83L14.17,19.24L17,16.41L19.83,19.24L21.24,17.83L18.41,15L21.24,12.17L19.83,10.76L17,13.59L14.17,10.76M2,14V16H11V14H2Z" fill="#b20709" /></svg></i>',quickAddToolbar=['<div class="quickadd-toolbar">','  <div class="toolbar-item toolbar-item-compare hidden-xs-up">','    <a class="toolbar-link" href="/comparelist.aspx">','      <span class="toolbar-icon">'+quickAddCompareIcon+"</span>",'      <span class="d-inline-block ml-2">Compare List</span>',"    </a>","  </div>",'  <div class="toolbar-item toolbar-item-favorite hidden-xs-up">','    <a class="toolbar-link" href="/wishlist.aspx">','      <span class="toolbar-icon">'+quickAddFavoriteIcon+"</span>",'      <span class="d-inline-block ml-2">Favorites</span>',"    </a>","  </div>","</div>"].join("\n"),noticeQuickNoticeTimeout;function toggleCompareListItem(e,t,o){toggleCompareListItemAdvanced(e,t,o,0,0,0,"")}function toggleCompareListBand(e,t,o,a){toggleCompareListItemAdvanced(e,t,o,0,0,a,"")}function toggleCompareListItemAdvanced(e,t,o,a,n,i,s){var r="";a>0&&s.indexOf("Size=")>0&&((r=s.substring(s.indexOf("Size=")+5)).indexOf("&")>0&&(r=r.substring(0,r.indexOf("&")-1)),r.indexOf("/")>0&&(r=r.substring(0,r.indexOf("/")-1))),$.ajax({url:"/QuickAddTo.asmx/ToggleCompareListItem",type:"Post",datatype:"json",traditional:!0,data:JSON.stringify({productId:e,variantId:t,settingProductId:a,settingVariantId:n,overridePrice:i,overrideUrl:s,jewelrySize:r}),contentType:"application/json; charset=utf-8",timeout:5e3}).done((function(t){var n=t.d;if(!0===n.Success){var i="";a>0&&(i="-"+a.toString()),"add"===n.Action?($(".svg-compare-add-"+e.toString()+i).addClass("active"),$(".quickaddto-compare-link-"+e.toString()+i).addClass("active"),$("li.comparelist a").addClass("active"),$(".quickaddto-compare-btn").show(),o&&(window.location="https://"+document.domain+"/comparelist.aspx"),showQuickAddToolbar("compare"),showQuickAddNotice(quickAddCompareIcon,"Compare List","/comparelist.aspx")):"remove"===n.Action&&($(".svg-compare-add-"+e.toString()+i).removeClass("active"),$(".quickaddto-compare-link-"+e.toString()+i).removeClass("active"),showQuickAddRemoveNotice(quickAddRemoveIcon,"Compare List"),0===$(".svg-compare-add.active").length&&($("li.comparelist a").removeClass("active"),$(".quickaddto-compare-btn").hide(),hideQuickAddToolbar("compare")))}else showAlert(n.Message,!1)})).fail((function(e,t,o){showAlert("An error occured (toggleCompareListItem) : "+o,!0)}))}function toggleFavoriteListItem(e,t,o){toggleFavoriteListItemAdvanced(e,t,o,0,0,0,"")}function toggleFavoriteListBand(e,t,o,a){toggleFavoriteListItemAdvanced(e,t,o,0,0,a,"")}function toggleFavoriteListItemAdvanced(e,t,o,a,n,i,s){var r="";a>0&&s.indexOf("Size=")>0&&((r=s.substring(s.indexOf("Size=")+5)).indexOf("&")>0&&(r=r.substring(0,r.indexOf("&")-1)),r.indexOf("/")>0&&(r=r.substring(0,r.indexOf("/")-1))),$.ajax({url:"/QuickAddTo.asmx/ToggleFavoriteListItem",type:"Post",datatype:"json",traditional:!0,data:JSON.stringify({productId:e,variantId:t,settingProductId:a,settingVariantId:n,overridePrice:i,overrideUrl:s,jewelrySize:r}),contentType:"application/json; charset=utf-8",timeout:5e3}).done((function(t){var n=t.d;if(!0===n.Success){var i="";a>0&&(i="-"+a.toString()),"add"===n.Action?($(".svg-favorite-add-"+e.toString()+i).addClass("active"),$(".quickaddto-favorite-link-"+e.toString()+i).addClass("active"),$("li.wishlist a").addClass("active"),o&&(window.location="https://"+document.domain+"/wishlist.aspx"),showQuickAddToolbar("favorite"),showQuickAddNotice(quickAddFavoriteIcon,"Favorites","/wishlist.aspx")):"remove"===n.Action&&($(".svg-favorite-add-"+e.toString()+i).removeClass("active"),$(".quickaddto-favorite-link-"+e.toString()+i).removeClass("active"),showQuickAddRemoveNotice(quickAddRemoveIcon,"Favorites"),0===$(".svg-favorite-add.active").length&&($("li.wishlist a").removeClass("active"),hideQuickAddToolbar("favorite")))}else showAlert(n.Message,!1)})).fail((function(e,t,o){showAlert("An error occured (toggleFavoriteListItem) : "+o,!0)}))}function showQuickAddNotice(e,t,o){var a=['<div class="quickadd-notice quickadd-notice--add" style="z-index:99999999999;">','<div class="notice-icon">'+e+"</div>",'<div class="notice-message">','Item Added<span class="hidden-xs-down"> to <span class="quickadd-list">'+t+"</span></span>.","</div>",'<div class="notice-action">','<a class="notice-link font-weight-bold" href="'+o+'">',"View","</a>","</div>","</div>"].join("\n");void 0!==noticeQuickNoticeTimeout&&(clearTimeout(noticeQuickNoticeTimeout),$(".quickadd-notice").removeClass("show").remove()),$("body").append(a),setTimeout((function(){$(".quickadd-notice").addClass("show"),noticeQuickNoticeTimeout=setTimeout((function(){$(".quickadd-notice").removeClass("show"),setTimeout((function(){$(".quickadd-notice").remove()}),500)}),2500)}),100)}function showQuickAddRemoveNotice(e,t){var o=['<div class="quickadd-notice quickadd-notice--remove">','<div class="notice-icon">'+e+"</div>",'<div class="notice-message">','Item Removed<span class="hidden-xs-down"> from <span class="quickadd-list">'+t+"</span></span>.","</div>","</div>"].join("\n");void 0!==noticeQuickNoticeTimeout&&(clearTimeout(noticeQuickNoticeTimeout),$(".quickadd-notice").removeClass("show").remove()),$("body").append(o),setTimeout((function(){$(".quickadd-notice").addClass("show"),noticeQuickNoticeTimeout=setTimeout((function(){$(".quickadd-notice").removeClass("show"),setTimeout((function(){$(".quickadd-notice").remove()}),500)}),1500)}),100)}function showQuickAddToolbar(e){$(".quickadd-toolbar").addClass("show"),"compare"===e&&$(".toolbar-item-compare").removeClass("hidden-xs-up"),"favorite"===e&&$(".toolbar-item-favorite").removeClass("hidden-xs-up")}function hideQuickAddToolbar(e){"compare"===e&&$(".toolbar-item-compare").addClass("hidden-xs-up"),"favorite"===e&&$(".toolbar-item-favorite").addClass("hidden-xs-up"),$(".toolbar-item-compare").hasClass("hidden-xs-up")&&$(".toolbar-item-favorite").hasClass("hidden-xs-up")&&$(".quickadd-toolbar").removeClass("show")}function showAlert(e,t){console.log(e),t||window.alert(e)}function loadQuickAddToFunctionality(){$("body").append(quickAddToolbar),$.ajax({url:"/QuickAddTo.asmx/GetProductIdsInQuickLists",type:"Post",datatype:"json",traditional:!0,contentType:"application/json; charset=utf-8",timeout:5e3}).done((function(e){var t=e.d;t.CompareIds.forEach((e=>{$(".svg-compare-add-"+e).addClass("active"),$(".quickaddto-compare-link-"+e).addClass("active")})),$(".svg-compare-add.active").length>0&&($(".quickaddto-compare-btn").show(),showQuickAddToolbar("compare")),t.FavoriteIds.forEach((e=>{$(".svg-favorite-add-"+e).addClass("active"),$(".quickaddto-favorite-link-"+e).addClass("active")})),$(".svg-favorite-add.active").length>0&&showQuickAddToolbar("favorite")})).fail((function(e,t,o){showAlert("An error occured (GetProductIdsInQuickLists) : "+o,!0)}))}var lastScrollTop=0,delta=10,navbarHeight=0;$(document).ready((function(){$("html:first").removeClass("no-js"),$.lazyLoadXT.onload.addClass="lazy-loaded";var e,t=$(".sticky");if(Stickyfill.add(t),$(".dyo-steps-wrap").length&&(navbarHeight=$(".dyo-steps-wrap").outerHeight(),$(document).scroll((function(e){var t=$(this).scrollTop();Math.abs(lastScrollTop-t)>delta&&(t>lastScrollTop&&t>navbarHeight?($("body").removeClass("nav-down").addClass("nav-up nav-scrolled"),$(".dyo-steps-wrap").css("top",-1*navbarHeight)):t+$(window).height()<$(document).height()&&($("body").removeClass("nav-up").addClass("nav-down"),$(".dyo-steps-wrap").css("top","0")),navbarHeight>=$(window).scrollTop()&&$("body").removeClass("nav-down nav-scrolled"),lastScrollTop=t)}))),$(".slider-idea").slick({autoplay:!0,autoplaySpeed:6e3,arrows:!1,dots:!1,fade:!0}),$(".row-video").slick({dots:!0,arrows:!0,infinite:!1,speed:300,slidesToShow:4,slidesToScroll:4,responsive:[{breakpoint:1024,settings:{slidesToShow:3,slidesToScroll:3}},{breakpoint:600,settings:{slidesToShow:2,slidesToScroll:2}},{breakpoint:480,settings:{slidesToShow:1,slidesToScroll:1}}]}),$(".row-video").on("afterChange",(function(e,t,o){$(".slick-active img").lazyLoadXT({show:!0})})),$(".slider-past-creations a:not(.slick-active)").click((function(e){e.preventDefault();var t=$(this).data("slick-index");$(".slider-past-creations").slick("slickGoTo",t),$(".slider-preview-requests a.is-open, .slider-past-creations a.is-open").removeClass("is-open"),$(this).addClass("is-open");var o=$(this).attr("data-url");$(".section-preview-request.is-open").removeClass("is-open"),$("#section-preview-request .section-content").html(""),$("#section-past-creation .section-content").animate({opacity:0},500,(function(){$("#section-past-creation").hasClass("is-open")||$("#section-past-creation").addClass("is-open"),$("#section-past-creation .section-content").load(o+" #PastCreationAjaxContent",(function(){ConvertGeoCurrency(GeoCurrentCountry,"#current-creation"),$("#current-creation [data-toggle=popover]").length&&$("#current-creation [data-toggle=popover]").popover({trigger:"hover",html:!0}),$("#section-past-creation .section-content").animate({opacity:1},500),$(".slider-past-creation").slick({}),$(".slider-past-creation .slick-cloned").removeAttr("rel")}))}))})),$(".slider-preview-requests a:not(.slick-active)").click((function(e){e.preventDefault();var t=$(this).data("slick-index");$(".slider-preview-requests").slick("slickGoTo",t),$(".slider-preview-requests a.is-open, .slider-past-creations a.is-open").removeClass("is-open"),$(this).addClass("is-open");var o=$(this).attr("data-url");$(".section-past-creation.is-open").removeClass("is-open"),$("#section-past-creation .section-content").html(""),$("#section-preview-request .section-content").animate({opacity:0},500,(function(){$("#section-preview-request").hasClass("is-open")||$("#section-preview-request").addClass("is-open"),$("#section-preview-request .section-content").load(o+" #PastCreationAjaxContent",(function(){ConvertGeoCurrency(GeoCurrentCountry,"#current-creation"),$("#current-creation [data-toggle=popover]").length&&$("#current-creation [data-toggle=popover]").popover({trigger:"hover",html:!0}),$("#section-preview-request .section-content").animate({opacity:1},500),$(".slider-preview-request").slick({}),$(".slider-preview-request .slick-cloned").removeAttr("rel")}))}))})),$(".section-past-creation").on("click",".close",(function(e){e.preventDefault(),$(".section-past-creation.is-open").removeClass("is-open"),$(".slider-past-creations a.is-open").removeClass("is-open")})),$(".section-preview-request").on("click",".close",(function(e){e.preventDefault(),$(".section-preview-request.is-open").removeClass("is-open"),$(".slider-preview-requests a.is-open").removeClass("is-open")})),$(".submenu-toggle").click((function(e){e.preventDefault(),$(this).hasClass("active")?$(this).removeClass("active").next(".sub-menu").removeClass("active"):($(".sub-menu.active, .submenu-toggle.active").removeClass("active"),$(this).addClass("active").next(".sub-menu").addClass("active").lazyLoadXT({show:!0}))})),$(document).click((function(e){var t=e.target;$(t).is(".submenu-toggle")||$(t).parents().is(".submenu-toggle")||$(t).is(".toggle-alt-menu")||$(t).is(".dropdown-wrap")||$(t).is(".product-option")||$(t).is("img")||$(".submenu-toggle, .sub-menu").removeClass("active")})),$(".toggle-alt-menu").click((function(){var e=$(this).closest(".sub-menu"),t=$(this).data("target");$(e).removeClass("active"),$(t).addClass("active").lazyLoadXT({show:!0})})),$(".slider-past-creations, .slider-preview-requests").slick({centerMode:!1,centerPadding:"50px",infinite:!1,slidesToShow:5,slidesToScroll:5,responsive:[{breakpoint:1200,centerPadding:"50px",settings:{slidesToShow:3,slidesToScroll:3}},{breakpoint:900,centerPadding:"50px",settings:{slidesToShow:2,slidesToScroll:1}},{breakpoint:520,centerPadding:"15px",settings:{slidesToShow:2,slidesToScroll:1}}]}),$(".slider-past-creations .slick-cloned, .slider-past-creation .slick-cloned, .slider-preview-requests .slick-cloned, .slider-preview-request .slick-cloned").removeAttr("rel"),$((function(){$(document).trigger("enhance.tablesaw")})),$(".slide-menu").length&&(e=new Slideout({panel:document.getElementById("panel"),menu:document.getElementById("menu"),padding:256,tolerance:70,touch:!1}),$("#mobile-menu-overlay, .js-slideout-toggle").click((function(){e.isOpen()?(e.toggle(),$("#mobile-menu-overlay").removeClass("d-block")):($("#mobile-menu-overlay").addClass("d-block"),e.toggle())}))),$(".js-toggle-refinements").click((function(){$("#NarrowResults").toggleClass("is-open"),$("body").toggleClass("nav-open")})),$.isFunction($.fn.selectric)&&$("select").length&&$("select").selectric(),$("#image-combination").click((function(e){$("#requestpreviewtrigger").trigger("click"),e.preventDefault()})),$("#wax-model").click((function(e){$("#ctl00_PageContent_btnAddWaxCadModelToCart").trigger("click"),e.preventDefault()})),$(".purchase-box .name, .purchase-box .availability").clone().appendTo(".product-name-small"),$("#order-confirmation").length&&$("#order-confirmation-wait").length&&$("input[name=CacheOrderNumber]").length){var o=$("input[name=CacheOrderNumber]").val(),a="orderconfirmed"+o;$.cookie(a)!==o&&($("#order-confirmation").hide().delay(4500).fadeIn(500),$("#order-confirmation-wait").show().delay(4e3).fadeOut(500),$.cookie(a,o))}$(".PostLoadLink")&&$(".PostLoadLink").each((function(){var e=' rel="nofollow"';$.each(this.attributes,(function(){e+=" "+("rel"===this.name?"href":this.name)+'="'+this.value+'"'})),$(this).replaceWith("<a"+e+">"+$(this).html()+"</a>")})),$("#notification-bar").length&&ProcessInternationalBanner(),FacebookOpenGraphFix();var n=$("#linkCharitySite, a.linkCharitySite");$.each(n,(function(e,t){var o=$(t).attr("catid");o?$(t).attr("href",CHARITY_SITE_DOMAIN+"?catid="+o):$(t).attr("href",CHARITY_SITE_DOMAIN)})),$('a[href="#"]').length>0&&$('a[href="#"]').click((function(e){e.preventDefault()})),$('a[rel="external"]').length>0&&$('a[rel="external"]').click((function(){return window.open($(this).attr("href")),!1})),$('a[rel="external nofollow"]').length>0&&$('a[rel="external nofollow"]').click((function(){return window.open($(this).attr("href")),!1})),$('a[rel="nofollow external"]').length>0&&$('a[rel="nofollow external"]').click((function(){return window.open($(this).attr("href")),!1})),AutoScrollTo("[id$=_ScrollPosition]"),InitiateFancybox(),InitiateNivo(),InitiateMetalTypeDropDown(),$(".populate").length>0&&$(".populate").example((function(){return $(this).attr("title")}),{className:"prePopulated"}),$("#copyYear").html((new Date).getFullYear()),LoadGalleriffic(),init_Assets(!1),SubCatMultiImagesJS(),ScrollToAnchor(),ForgotPasswordToggle(),Userlike(),CreateAccountToggle(!1),MaskCC(),CheckoutJumpTo(),$("#tabs").length>0&&($("[id$=TabIndexToOpen]").length>0?$("#tabs").tabs({active:$("[id$=TabIndexToOpen]").val()}):$("#tabs").tabs()),$("#ShapeTabs").length>0&&$("#ShapeTabs").tabs({cookie:{name:"SelectedShapeTab"}}),$(".secondary-cta-box").length>0&&($(".share-link > a").click((function(e){$(".share-list").show().addClass("active")})),$(document).mouseup((function(e){$(".share-list").hide().removeClass("active")}))),$(window).scroll((function(){$(this).scrollTop()?$("#to-top").addClass("active"):$("#to-top").removeClass("active")})),$("#to-top").click((function(){$("html, body").animate({scrollTop:0},1e3)})),$(".js-info-bar-toggle").click((function(e){e.preventDefault(),$(".info-expanded").toggleClass("collapsed").toggleClass("in"),$(".info-expanded").hasClass("collapsed")?$(".js-info-bar-toggle .fa").removeClass("fa-caret-up").addClass("fa-caret-down"):$(".js-info-bar-toggle .fa").removeClass("fa-caret-down").addClass("fa-caret-up"),e.preventDefault()})),$("[data-toggle=tooltip]").length&&$("[data-toggle=tooltip]").tooltip({placement:"top auto"}),$("[data-toggle=popover]").length&&$("[data-toggle=popover]").popover({trigger:"hover",html:!0}),$(".band-option").length&&$(".band-option").change((function(){setBandPrice()})),$("select#band-width").length&&$("select#band-width").change((function(){updateBandSidestoneOption()})).change(),$(".btn-band-addtocart").click((function(e){addBandToCart("0"),e.preventDefault()})),$(".btn-band-addtowishlist").click((function(e){addBandToCart("1"),e.preventDefault()})),$(".btn-band-addtocomparelist").click((function(e){addBandToCart("11"),e.preventDefault()})),$(".button-toggle").click((function(e){var t=$(this).data("target");$(t).toggleClass("is-open"),e.preventDefault()})),$(".form-control").on("blur",(function(){var e=$(this).attr("id");$('.control-label[for="'+e+'"]').removeClass("focus")})).on("focus",(function(){var e=$(this).attr("id");$('.control-label[for="'+e+'"]').addClass("focus")})),$(".js-check-scroll").each((function(){$(this).hasScrollBar("horizontal")&&$(this).addClass("has-scrollbar")})),$(".video-js").length&&videojs(document.querySelector(".video-js"));var i=document.querySelectorAll(".js-play-in-viewport"),s=new IntersectionObserver((function(e){e.forEach((function(e){if(e.intersectionRatio>0){var t=e.target.play();void 0!==t&&t.catch((function(t){e.target.setAttribute("controls","controls")})).then((function(){s.unobserve(e.target)}))}}))}));i.forEach((function(e){s.observe(e)})),Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return!!(this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2)}}),Object.defineProperty(HTMLMediaElement.prototype,"started",{get:function(){return!!(this.currentTime>.1)}}),$("video[data-event-label]").each((function(){var e=$(this).attr("data-event-label");$(this).on("play",(function(){this.currentTime.toFixed(0)<=1?(sessionStorage.setItem(e+"25",25),sessionStorage.setItem(e+"50",50),sessionStorage.setItem(e+"75",75),sessionStorage.setItem(e+"100",100),TrackVideo("Play",e)):TrackVideo("Continue",e)})),$(this).on("pause",(function(){TrackVideo("Pause",e)})),$(this).on("timeupdate",(function(){var t=(this.currentTime/this.duration*100).toFixed(0),o=0;t>95?o=100:t>=75?o=75:t>=50?o=50:t>=25&&(o=25),o>0&&Number(sessionStorage.getItem(e+o))===o&&(sessionStorage.setItem(e+o,null),TrackVideo("Watched "+o+"%",e))})),$(this).on("error",(function(){TrackVideo("Error",e)}))})),loadQuickAddToFunctionality()}));;
