"use strict";function _slicedToArray2(e,t){return _arrayWithHoles2(e)||_iterableToArrayLimit2(e,t)||_unsupportedIterableToArray2(e,t)||_nonIterableRest2()}function _nonIterableRest2(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray2(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray2(e,t):void 0}}function _arrayLikeToArray2(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function _iterableToArrayLimit2(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,a,s,o=[],u=!0,l=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(i=a.call(n)).done)&&(o.push(i.value),o.length!==t);u=!0);}catch(e){l=!0,r=e}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw r}}return o}}function _arrayWithHoles2(e){if(Array.isArray(e))return e}function _classCallCheck2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,_toPropertyKey2(i.key),i)}}function _createClass2(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey2(e){var t=_toPrimitive2(e,"string");return"symbol"===_typeof2(t)?t:String(t)}function _toPrimitive2(e,t){if("object"!==_typeof2(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==_typeof2(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _inherits2(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf2(e,t)}function _setPrototypeOf2(e,t){return(_setPrototypeOf2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper2(e){var t=_isNativeReflectConstruct2();return function(){var n,i=_getPrototypeOf2(e);if(t){var r=_getPrototypeOf2(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return _possibleConstructorReturn2(this,n)}}function _possibleConstructorReturn2(e,t){if(t&&("object"===_typeof2(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized2(e)}function _assertThisInitialized2(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct2(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _getPrototypeOf2(e){return(_getPrototypeOf2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _typeof2(e){return(_typeof2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function t(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e(Object(i),!0).forEach((function(e){s(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,_(i.key),i)}}function a(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,n){return(t=_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e,t){if(t&&("object"===_typeof2(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=u(e);if(t){var r=u(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return d(this,n)}}function p(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=u(e)););return e}function f(){return(f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=p(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}}).apply(this,arguments)}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,a,s,o=[],u=!0,l=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(i=a.call(n)).done)&&(o.push(i.value),o.length!==t);u=!0);}catch(e){l=!0,r=e}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw r}}return o}}(e,t)||v(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||v(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){if(e){if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function _(e){var t=function(e,t){if("object"!==_typeof2(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==_typeof2(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===_typeof2(t)?t:String(t)}var b="undefined"!=typeof window&&window&&"node"!==window.appEnvironment;b&&(window.VIDEOJS_NO_DYNAMIC_STYLE=!0);var T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function k(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function S(e,t){return e(t={exports:{}},t.exports),t.exports}var E,C="undefined"!=typeof window?window:void 0!==T?T:"undefined"!=typeof self?self:{},w=function(e){return e&&e.default||e}(Object.freeze({__proto__:null,default:{}})),I=void 0!==T?T:"undefined"!=typeof window?window:{};"undefined"!=typeof document?E=document:(E=I["__GLOBAL_DOCUMENT_CACHE@4"])||(E=I["__GLOBAL_DOCUMENT_CACHE@4"]=w);var P=E,x=S((function(e){function t(){return e.exports=t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,t.apply(this,arguments)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0})),A=k(x),O=k(S((function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0}))),L=S((function(e){function t(n,i){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,t(n,i)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0}));k(L);var R=k(S((function(e){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,L(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0}))),D=function(e,t){var n,i=null;try{n=JSON.parse(e,t)}catch(e){i=e}return[i,n]};var M=S((function(e,t){function n(e){if(e&&"object"===_typeof2(e)){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if("number"==typeof e)return s[e];var n,a=String(e);return(n=i[a.toLowerCase()])?n:(n=r[a.toLowerCase()])||(1===a.length?a.charCodeAt(0):void 0)}n.isEventKey=function(e,t){if(e&&"object"===_typeof2(e)){var n=e.which||e.keyCode||e.charCode;if(null==n)return!1;if("string"==typeof t){var a;if(a=i[t.toLowerCase()])return a===n;if(a=r[t.toLowerCase()])return a===n}else if("number"==typeof t)return t===n;return!1}};var i=(t=e.exports=n).code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},r=t.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};
/*!
   * Programatically add the following
   */
for(a=97;a<123;a++)i[String.fromCharCode(a)]=a-32;for(var a=48;a<58;a++)i[a-48]=a;for(a=1;a<13;a++)i["f"+a]=a+111;for(a=0;a<10;a++)i["numpad "+a]=a+96;var s=t.names=t.title={};for(a in i)s[i[a]]=a;for(var o in r)i[o]=r[o]})),N=(M.code,M.codes,M.aliases,M.names,M.title,function(e){if(!e)return!1;var t=U.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}),U=Object.prototype.toString;var B=function(e,t){return void 0===t&&(t=!1),function(n,i,r){if(n)e(n);else if(i.statusCode>=400&&i.statusCode<=599){var a=r;if(t)if(C.TextDecoder){var s=function(e){void 0===e&&(e="");return e.toLowerCase().split(";").reduce((function(e,t){var n=t.split("="),i=n[0],r=n[1];return"charset"===i.trim()?r.trim():e}),"utf-8")}(i.headers&&i.headers["content-type"]);try{a=new TextDecoder(s).decode(r)}catch(e){}}else a=String.fromCharCode.apply(null,new Uint8Array(r));e({cause:a})}else e(null,r)}};V.httpHandler=B;
/**
   * @license
   * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
   * Copyright (c) 2014 David Björklund
   * Available under the MIT license
   * <https://github.com/kesla/parse-headers/blob/master/LICENCE>
   */
var F=V,j=V;function H(e,t,n){var i=e;return N(t)?(n=t,"string"==typeof e&&(i={uri:e})):i=x({},t,{uri:e}),i.callback=n,i}function V(e,t,n){return q(t=H(e,t,n))}function q(e){if(void 0===e.callback)throw new Error("callback argument missing");var t=!1,n=function(n,i,r){t||(t=!0,e.callback(n,i,r))};function i(){var e=void 0;if(e=u.response?u.response:u.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(u),m)try{e=JSON.parse(e)}catch(e){}return e}function r(e){return clearTimeout(l),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,n(e,g)}function a(){if(!o){var t;clearTimeout(l),t=e.useXDR&&void 0===u.status?200:1223===u.status?204:u.status;var r=g,a=null;return 0!==t?(r={body:i(),statusCode:t,method:d,headers:{},url:c,rawRequest:u},u.getAllResponseHeaders&&(r.headers=function(e){var t={};return e?(e.trim().split("\n").forEach((function(e){var n=e.indexOf(":"),i=e.slice(0,n).trim().toLowerCase(),r=e.slice(n+1).trim();void 0===t[i]?t[i]=r:Array.isArray(t[i])?t[i].push(r):t[i]=[t[i],r]})),t):t}(u.getAllResponseHeaders()))):a=new Error("Internal XMLHttpRequest Error"),n(a,r,r.body)}}var s,o,u=e.xhr||null;u||(u=e.cors||e.useXDR?new V.XDomainRequest:new V.XMLHttpRequest);var l,c=u.url=e.uri||e.url,d=u.method=e.method||"GET",h=e.body||e.data,p=u.headers=e.headers||{},f=!!e.sync,m=!1,g={body:void 0,headers:{},statusCode:0,method:d,url:c,rawRequest:u};if("json"in e&&!1!==e.json&&(m=!0,p.accept||p.Accept||(p.Accept="application/json"),"GET"!==d&&"HEAD"!==d&&(p["content-type"]||p["Content-Type"]||(p["Content-Type"]="application/json"),h=JSON.stringify(!0===e.json?h:e.json))),u.onreadystatechange=function(){4===u.readyState&&setTimeout(a,0)},u.onload=a,u.onerror=r,u.onprogress=function(){},u.onabort=function(){o=!0},u.ontimeout=r,u.open(d,c,!f,e.username,e.password),f||(u.withCredentials=!!e.withCredentials),!f&&e.timeout>0&&(l=setTimeout((function(){if(!o){o=!0,u.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",r(e)}}),e.timeout)),u.setRequestHeader)for(s in p)p.hasOwnProperty(s)&&u.setRequestHeader(s,p[s]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(u.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(u),u.send(h||null),u}V.XMLHttpRequest=C.XMLHttpRequest||function(){},V.XDomainRequest="withCredentials"in new V.XMLHttpRequest?V.XMLHttpRequest:C.XDomainRequest,function(e,t){for(var n=0;n<e.length;n++)t(e[n])}(["get","put","post","patch","head","delete"],(function(e){V["delete"===e?"del":e]=function(t,n,i){return(n=H(t,n,i)).method=e.toUpperCase(),q(n)}})),F.default=j;var W=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function z(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function G(e){function t(e,t,n,i){return 3600*(0|e)+60*(0|t)+(0|n)+(0|i)/1e3}var n=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return n?n[3]?t(n[1],n[2],n[3].replace(":",""),n[4]):n[1]>59?t(n[1],n[2],0,n[4]):t(0,n[1],n[2],n[4]):null}function K(){this.values=W(null)}function X(e,t,n,i){var r=i?e.split(i):[e];for(var a in r)if("string"==typeof r[a]){var s=r[a].split(n);if(2===s.length)t(s[0],s[1])}}function Q(e,t,n){var i=e;function r(){var t=G(e);if(null===t)throw new z(z.Errors.BadTimeStamp,"Malformed timestamp: "+i);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function a(){e=e.replace(/^\s+/,"")}if(a(),t.startTime=r(),a(),"--\x3e"!==e.substr(0,3))throw new z(z.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+i);e=e.substr(3),a(),t.endTime=r(),a(),function(e,t){var i=new K;X(e,(function(e,t){switch(e){case"region":for(var r=n.length-1;r>=0;r--)if(n[r].id===t){i.set(e,n[r].region);break}break;case"vertical":i.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),s=a[0];i.integer(e,s),i.percent(e,s)&&i.set("snapToLines",!1),i.alt(e,s,["auto"]),2===a.length&&i.alt("lineAlign",a[1],["start","center","end"]);break;case"position":a=t.split(","),i.percent(e,a[0]),2===a.length&&i.alt("positionAlign",a[1],["start","center","end"]);break;case"size":i.percent(e,t);break;case"align":i.alt(e,t,["start","center","end","left","right"])}}),/:/,/\s/),t.region=i.get("region",null),t.vertical=i.get("vertical","");try{t.line=i.get("line","auto")}catch(e){}t.lineAlign=i.get("lineAlign","start"),t.snapToLines=i.get("snapToLines",!0),t.size=i.get("size",100);try{t.align=i.get("align","center")}catch(e){t.align=i.get("align","middle")}try{t.position=i.get("position","auto")}catch(e){t.position=i.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=i.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}z.prototype=W(Error.prototype),z.prototype.constructor=z,z.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},K.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,n){for(var i=0;i<n.length;++i)if(t===n[i]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t))>=0&&t<=100)&&(this.set(e,t),!0)}};var Y=P.createElement&&P.createElement("textarea"),$={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},J={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},Z={v:"title",lang:"lang"},ee={rt:"ruby"};function te(e,t){function n(){if(!t)return null;var e,n=t.match(/^([^<]*)(<[^>]*>?)?/);return e=n[1]?n[1]:n[2],t=t.substr(e.length),e}function i(e){return Y.innerHTML=e,e=Y.textContent,Y.textContent="",e}function r(e,t){return!ee[t.localName]||ee[t.localName]===e.localName}function a(t,n){var i=$[t];if(!i)return null;var r=e.document.createElement(i),a=Z[t];return a&&n&&(r[a]=n.trim()),r}for(var s,o=e.document.createElement("div"),u=o,l=[];null!==(s=n());)if("<"!==s[0])u.appendChild(e.document.createTextNode(i(s)));else{if("/"===s[1]){l.length&&l[l.length-1]===s.substr(2).replace(">","")&&(l.pop(),u=u.parentNode);continue}var c,d=G(s.substr(1,s.length-2));if(d){c=e.document.createProcessingInstruction("timestamp",d),u.appendChild(c);continue}var h=s.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!h)continue;if(!(c=a(h[1],h[3])))continue;if(!r(u,c))continue;if(h[2]){var p=h[2].split(".");p.forEach((function(e){var t=/^bg_/.test(e),n=t?e.slice(3):e;if(J.hasOwnProperty(n)){var i=t?"background-color":"color",r=J[n];c.style[i]=r}})),c.className=p.join(" ")}l.push(h[1]),u.appendChild(c),u=c}return o}var ne=[[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 ie(e){for(var t=0;t<ne.length;t++){var n=ne[t];if(e>=n[0]&&e<=n[1])return!0}return!1}function re(e){var t=[],n="";if(!e||!e.childNodes)return"ltr";function i(e,t){for(var n=t.childNodes.length-1;n>=0;n--)e.push(t.childNodes[n])}function r(e){if(!e||!e.length)return null;var t=e.pop(),n=t.textContent||t.innerText;if(n){var a=n.match(/^.*(\n|\r)/);return a?(e.length=0,a[0]):n}return"ruby"===t.tagName?r(e):t.childNodes?(i(e,t),r(e)):void 0}for(i(t,e);n=r(t);)for(var a=0;a<n.length;a++)if(ie(n.charCodeAt(a)))return"rtl";return"ltr"}function ae(){}function se(e,t,n){ae.call(this),this.cue=t,this.cueDiv=te(e,t.text);var i={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(i,this.cueDiv),this.div=e.document.createElement("div"),i={direction:re(this.cueDiv),writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===t.align?"center":t.align,font:n.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(i),this.div.appendChild(this.cueDiv);var r=0;switch(t.positionAlign){case"start":r=t.position;break;case"center":r=t.position-t.size/2;break;case"end":r=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(r,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(r,"%"),height:this.formatStyle(t.size,"%")}),this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,"px"),bottom:this.formatStyle(e.bottom,"px"),left:this.formatStyle(e.left,"px"),right:this.formatStyle(e.right,"px"),height:this.formatStyle(e.height,"px"),width:this.formatStyle(e.width,"px")})}}function oe(e){var t,n,i,r;if(e.div){n=e.div.offsetHeight,i=e.div.offsetWidth,r=e.div.offsetTop;var a=(a=e.div.childNodes)&&(a=a[0])&&a.getClientRects&&a.getClientRects();e=e.div.getBoundingClientRect(),t=a?Math.max(a[0]&&a[0].height||0,e.height/a.length):0}this.left=e.left,this.right=e.right,this.top=e.top||r,this.height=e.height||n,this.bottom=e.bottom||r+(e.height||n),this.width=e.width||i,this.lineHeight=void 0!==t?t:e.lineHeight}function ue(e,t,n,i){var r=new oe(t),a=t.cue,s=function(e){if("number"==typeof e.line&&(e.snapToLines||e.line>=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,n=t.textTrackList,i=0,r=0;r<n.length&&n[r]!==t;r++)"showing"===n[r].mode&&i++;return-1*++i}(a),o=[];if(a.snapToLines){var u;switch(a.vertical){case"":o=["+y","-y"],u="height";break;case"rl":o=["+x","-x"],u="width";break;case"lr":o=["-x","+x"],u="width"}var l=r.lineHeight,c=l*Math.round(s),d=n[u]+l,h=o[0];Math.abs(c)>d&&(c=c<0?-1:1,c*=Math.ceil(d/l)*l),s<0&&(c+=""===a.vertical?n.height:n.width,o=o.reverse()),r.move(h,c)}else{var p=r.lineHeight/n.height*100;switch(a.lineAlign){case"center":s-=p/2;break;case"end":s-=p}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(s,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(s,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(s,"%")})}o=["+y","-x","+x","-y"],r=new oe(t)}var f=function(e,t){for(var r,a=new oe(e),s=1,o=0;o<t.length;o++){for(;e.overlapsOppositeAxis(n,t[o])||e.within(n)&&e.overlapsAny(i);)e.move(t[o]);if(e.within(n))return e;var u=e.intersectPercentage(n);s>u&&(r=new oe(e),s=u),e=new oe(a)}return r||a}(r,o);t.move(f.toCSSCompatValues(n))}function le(){}ae.prototype.applyStyles=function(e,t){for(var n in t=t||this.div,e)e.hasOwnProperty(n)&&(t.style[n]=e[n])},ae.prototype.formatStyle=function(e,t){return 0===e?0:e+t},se.prototype=W(ae.prototype),se.prototype.constructor=se,oe.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},oe.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},oe.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},oe.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},oe.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}},oe.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},oe.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},oe.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,n=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,i=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||i,height:e.height||t,bottom:e.bottom||i+(e.height||t),width:e.width||n}},le.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},le.convertCueToDOMTree=function(e,t){return e&&t?te(e,t):null};le.processCues=function(e,t,n){if(!e||!t||!n)return null;for(;n.firstChild;)n.removeChild(n.firstChild);var i=e.document.createElement("div");if(i.style.position="absolute",i.style.left="0",i.style.right="0",i.style.top="0",i.style.bottom="0",i.style.margin="1.5%",n.appendChild(i),function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}(t)){var r=[],a=oe.getSimpleBoxPosition(i),s={font:Math.round(.05*a.height*100)/100+"px sans-serif"};!function(){for(var n,o,u=0;u<t.length;u++)o=t[u],n=new se(e,o,s),i.appendChild(n.div),ue(0,n,a,r),o.displayState=n.div,r.push(oe.getSimpleBoxPosition(n))}()}else for(var o=0;o<t.length;o++)i.appendChild(t[o].displayState)},le.Parser=function(e,t,n){n||(n=t,t={}),t||(t={}),this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=n||new TextDecoder("utf8"),this.regionList=[]},le.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof z))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){var t=this;function n(){for(var e=t.buffer,n=0;n<e.length&&"\r"!==e[n]&&"\n"!==e[n];)++n;var i=e.substr(0,n);return"\r"===e[n]&&++n,"\n"===e[n]&&++n,t.buffer=e.substr(n),i}function i(e){e.match(/X-TIMESTAMP-MAP/)?X(e,(function(e,n){switch(e){case"X-TIMESTAMP-MAP":!function(e){var n=new K;X(e,(function(e,t){switch(e){case"MPEGT":n.integer(e+"S",t);break;case"LOCA":n.set(e+"L",G(t))}}),/[^\d]:/,/,/),t.ontimestampmap&&t.ontimestampmap({MPEGTS:n.get("MPEGTS"),LOCAL:n.get("LOCAL")})}(n)}}),/=/):X(e,(function(e,n){switch(e){case"Region":!function(e){var n=new K;if(X(e,(function(e,t){switch(e){case"id":n.set(e,t);break;case"width":n.percent(e,t);break;case"lines":n.integer(e,t);break;case"regionanchor":case"viewportanchor":var i=t.split(",");if(2!==i.length)break;var r=new K;if(r.percent("x",i[0]),r.percent("y",i[1]),!r.has("x")||!r.has("y"))break;n.set(e+"X",r.get("x")),n.set(e+"Y",r.get("y"));break;case"scroll":n.alt(e,t,["up"])}}),/=/,/\s/),n.has("id")){var i=new(t.vttjs.VTTRegion||t.window.VTTRegion);i.width=n.get("width",100),i.lines=n.get("lines",3),i.regionAnchorX=n.get("regionanchorX",0),i.regionAnchorY=n.get("regionanchorY",100),i.viewportAnchorX=n.get("viewportanchorX",0),i.viewportAnchorY=n.get("viewportanchorY",100),i.scroll=n.get("scroll",""),t.onregion&&t.onregion(i),t.regionList.push({id:n.get("id"),region:i})}}(n)}}),/:/)}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{var r;if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;var a=(r=n()).match(/^WEBVTT([ \t].*)?$/);if(!a||!a[0])throw new z(z.Errors.BadSignature);t.state="HEADER"}for(var s=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(s?s=!1:r=n(),t.state){case"HEADER":/:/.test(r)?i(r):r||(t.state="ID");continue;case"NOTE":r||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){t.state="NOTE";break}if(!r)continue;t.cue=new(t.vttjs.VTTCue||t.window.VTTCue)(0,0,"");try{t.cue.align="center"}catch(e){t.cue.align="middle"}if(t.state="CUE",-1===r.indexOf("--\x3e")){t.cue.id=r;continue}case"CUE":try{Q(r,t.cue,t.regionList)}catch(e){t.reportOrThrowError(e),t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var o=-1!==r.indexOf("--\x3e");if(!r||o&&(s=!0)){t.oncue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}t.cue.text&&(t.cue.text+="\n"),t.cue.text+=r.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":r||(t.state="ID");continue}}}catch(e){t.reportOrThrowError(e),"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){try{if(this.buffer+=this.decoder.decode(),(this.cue||"HEADER"===this.state)&&(this.buffer+="\n\n",this.parse()),"INITIAL"===this.state)throw new z(z.Errors.BadSignature)}catch(e){this.reportOrThrowError(e)}return this.onflush&&this.onflush(),this}};var ce=le,de={"":1,lr:1,rl:1},he={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function pe(e){return"string"==typeof e&&(!!he[e.toLowerCase()]&&e.toLowerCase())}function fe(e,t,n){this.hasBeenReset=!1;var i="",r=!1,a=e,s=t,o=n,u=null,l="",c=!0,d="auto",h="start",p="auto",f="auto",m=100,g="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return i},set:function(e){i=""+e}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(e){r=!!e}},startTime:{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");a=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");s=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(e){o=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(e){u=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return l},set:function(e){var t=function(e){return"string"==typeof e&&(!!de[e.toLowerCase()]&&e.toLowerCase())}(e);if(!1===t)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");l=t,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return c},set:function(e){c=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return d},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("Line: an invalid number or illegal string was specified.");d=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return h},set:function(e){var t=pe(e);t?(h=t,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return p},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");p=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return f},set:function(e){var t=pe(e);t?(f=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return m},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");m=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return g},set:function(e){var t=pe(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");g=t,this.hasBeenReset=!0}}}),this.displayState=void 0}fe.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var me=fe,ge={"":!0,up:!0};function ve(e){return"number"==typeof e&&e>=0&&e<=100}var ye=function(){var e=100,t=3,n=0,i=100,r=0,a=100,s="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!ve(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return i},set:function(e){if(!ve(e))throw new Error("RegionAnchorX must be between 0 and 100.");i=e}},regionAnchorX:{enumerable:!0,get:function(){return n},set:function(e){if(!ve(e))throw new Error("RegionAnchorY must be between 0 and 100.");n=e}},viewportAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!ve(e))throw new Error("ViewportAnchorY must be between 0 and 100.");a=e}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(e){if(!ve(e))throw new Error("ViewportAnchorX must be between 0 and 100.");r=e}},scroll:{enumerable:!0,get:function(){return s},set:function(e){var t=function(e){return"string"==typeof e&&(!!ge[e.toLowerCase()]&&e.toLowerCase())}(e);!1===t?console.warn("Scroll: an invalid or illegal string was specified."):s=t}}})},_e=S((function(e){var t=e.exports={WebVTT:ce,VTTCue:me,VTTRegion:ye};C.vttjs=t,C.WebVTT=t.WebVTT;var n=t.VTTCue,i=t.VTTRegion,r=C.VTTCue,a=C.VTTRegion;t.shim=function(){C.VTTCue=n,C.VTTRegion=i},t.restore=function(){C.VTTCue=r,C.VTTRegion=a},C.VTTCue||t.shim()})),be=(_e.WebVTT,_e.VTTCue,_e.VTTRegion,S((function(e){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.default=e.exports,e.exports.__esModule=!0})));k(be);var Te=k(S((function(e){function t(n,i,r){return be()?(e.exports=t=Reflect.construct,e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=t=function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&L(r,n.prototype),r},e.exports.default=e.exports,e.exports.__esModule=!0),t.apply(null,arguments)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0}))),ke=k(S((function(e){e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&L(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0}))),Se=S((function(e,t){var n,i,r,a,s;n=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#.*)?$/,i=/^([^\/?#]*)(.*)$/,r=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,s={buildAbsoluteURL:function(e,t,n){if(n=n||{},e=e.trim(),!(t=t.trim())){if(!n.alwaysNormalize)return e;var r=s.parseURL(e);if(!r)throw new Error("Error trying to parse base URL.");return r.path=s.normalizePath(r.path),s.buildURLFromParts(r)}var a=s.parseURL(t);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return n.alwaysNormalize?(a.path=s.normalizePath(a.path),s.buildURLFromParts(a)):t;var o=s.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var u=i.exec(o.path);o.netLoc=u[1],o.path=u[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(l.netLoc=o.netLoc,"/"!==a.path[0]))if(a.path){var c=o.path,d=c.substring(0,c.lastIndexOf("/")+1)+a.path;l.path=s.normalizePath(d)}else l.path=o.path,a.params||(l.params=o.params,a.query||(l.query=o.query));return null===l.path&&(l.path=n.alwaysNormalize?s.normalizePath(a.path):a.path),s.buildURLFromParts(l)},parseURL:function(e){var t=n.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(r,"");e.length!==(e=e.replace(a,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=s})),Ee=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=C.location&&C.location.href||"");var n="function"==typeof C.URL,i=/^\/\//.test(e),r=!C.location&&!/\/\//i.test(e);if(n?e=new C.URL(e,C.location||"http://example.com"):/\/\//i.test(e)||(e=Se.buildAbsoluteURL(C.location&&C.location.href||"",e)),n){var a=new URL(t,e);return r?a.href.slice("http://example.com".length):i?a.href.slice(a.protocol.length):a.href}return Se.buildAbsoluteURL(e,t)},Ce=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(n,1),n>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var n=t.length,i=0;i<n;++i)t[i].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}();function we(e){for(var t=function(e){return C.atob?C.atob(e):Buffer.from(e,"base64").toString("binary")}(e),n=new Uint8Array(t.length),i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}/*! @name m3u8-parser @version 4.7.0 @license Apache-2.0 */var Ie=function(e){function t(){var t;return(t=e.call(this)||this).buffer="",t}return R(t,e),t.prototype.push=function(e){var t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(Ce),Pe=String.fromCharCode(9),xe=function(e){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),n={};return t[1]&&(n.length=parseInt(t[1],10)),t[2]&&(n.offset=parseInt(t[2],10)),n},Ae=function(e){for(var t,n=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),i={},r=n.length;r--;)""!==n[r]&&((t=/([^=]*)=(.*)/.exec(n[r]).slice(1))[0]=t[0].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^['"](.*)['"]$/g,"$1"),i[t[0]]=t[1]);return i},Oe=function(e){function t(){var t;return(t=e.call(this)||this).customParsers=[],t.tagMappers=[],t}R(t,e);var n=t.prototype;return n.push=function(e){var t,n,i=this;0!==(e=e.trim()).length&&("#"===e[0]?this.tagMappers.reduce((function(t,n){var i=n(e);return i===e?t:t.concat([i])}),[e]).forEach((function(e){for(var r=0;r<i.customParsers.length;r++)if(i.customParsers[r].call(i,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e))i.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e))return n={type:"tag",tagType:"inf"},t[1]&&(n.duration=parseFloat(t[1])),t[2]&&(n.title=t[2]),void i.trigger("data",n);if(t=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e))return n={type:"tag",tagType:"targetduration"},t[1]&&(n.duration=parseInt(t[1],10)),void i.trigger("data",n);if(t=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(e))return n={type:"tag",tagType:"version"},t[1]&&(n.version=parseInt(t[1],10)),void i.trigger("data",n);if(t=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return n={type:"tag",tagType:"media-sequence"},t[1]&&(n.number=parseInt(t[1],10)),void i.trigger("data",n);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return n={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(n.number=parseInt(t[1],10)),void i.trigger("data",n);if(t=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e))return n={type:"tag",tagType:"playlist-type"},t[1]&&(n.playlistType=t[1]),void i.trigger("data",n);if(t=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(e))return n=A(xe(t[1]),{type:"tag",tagType:"byterange"}),void i.trigger("data",n);if(t=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e))return n={type:"tag",tagType:"allow-cache"},t[1]&&(n.allowed=!/NO/.test(t[1])),void i.trigger("data",n);if(t=/^#EXT-X-MAP:?(.*)$/.exec(e)){if(n={type:"tag",tagType:"map"},t[1]){var a=Ae(t[1]);a.URI&&(n.uri=a.URI),a.BYTERANGE&&(n.byterange=xe(a.BYTERANGE))}i.trigger("data",n)}else if(t=/^#EXT-X-STREAM-INF:?(.*)$/.exec(e)){if(n={type:"tag",tagType:"stream-inf"},t[1]){if(n.attributes=Ae(t[1]),n.attributes.RESOLUTION){var s=n.attributes.RESOLUTION.split("x"),o={};s[0]&&(o.width=parseInt(s[0],10)),s[1]&&(o.height=parseInt(s[1],10)),n.attributes.RESOLUTION=o}n.attributes.BANDWIDTH&&(n.attributes.BANDWIDTH=parseInt(n.attributes.BANDWIDTH,10)),n.attributes["PROGRAM-ID"]&&(n.attributes["PROGRAM-ID"]=parseInt(n.attributes["PROGRAM-ID"],10))}i.trigger("data",n)}else{if(t=/^#EXT-X-MEDIA:?(.*)$/.exec(e))return n={type:"tag",tagType:"media"},t[1]&&(n.attributes=Ae(t[1])),void i.trigger("data",n);if(t=/^#EXT-X-ENDLIST/.exec(e))i.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e))i.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(t=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e))return n={type:"tag",tagType:"program-date-time"},t[1]&&(n.dateTimeString=t[1],n.dateTimeObject=new Date(t[1])),void i.trigger("data",n);if(t=/^#EXT-X-KEY:?(.*)$/.exec(e))return n={type:"tag",tagType:"key"},t[1]&&(n.attributes=Ae(t[1]),n.attributes.IV&&("0x"===n.attributes.IV.substring(0,2).toLowerCase()&&(n.attributes.IV=n.attributes.IV.substring(2)),n.attributes.IV=n.attributes.IV.match(/.{8}/g),n.attributes.IV[0]=parseInt(n.attributes.IV[0],16),n.attributes.IV[1]=parseInt(n.attributes.IV[1],16),n.attributes.IV[2]=parseInt(n.attributes.IV[2],16),n.attributes.IV[3]=parseInt(n.attributes.IV[3],16),n.attributes.IV=new Uint32Array(n.attributes.IV))),void i.trigger("data",n);if(t=/^#EXT-X-START:?(.*)$/.exec(e))return n={type:"tag",tagType:"start"},t[1]&&(n.attributes=Ae(t[1]),n.attributes["TIME-OFFSET"]=parseFloat(n.attributes["TIME-OFFSET"]),n.attributes.PRECISE=/YES/.test(n.attributes.PRECISE)),void i.trigger("data",n);if(t=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e))return n={type:"tag",tagType:"cue-out-cont"},t[1]?n.data=t[1]:n.data="",void i.trigger("data",n);if(t=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(e))return n={type:"tag",tagType:"cue-out"},t[1]?n.data=t[1]:n.data="",void i.trigger("data",n);if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e))return n={type:"tag",tagType:"cue-in"},t[1]?n.data=t[1]:n.data="",void i.trigger("data",n);if((t=/^#EXT-X-SKIP:(.*)$/.exec(e))&&t[1])return(n={type:"tag",tagType:"skip"}).attributes=Ae(t[1]),n.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(n.attributes["SKIPPED-SEGMENTS"]=parseInt(n.attributes["SKIPPED-SEGMENTS"],10)),n.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(n.attributes["RECENTLY-REMOVED-DATERANGES"]=n.attributes["RECENTLY-REMOVED-DATERANGES"].split(Pe)),void i.trigger("data",n);if((t=/^#EXT-X-PART:(.*)$/.exec(e))&&t[1])return(n={type:"tag",tagType:"part"}).attributes=Ae(t[1]),["DURATION"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))})),["INDEPENDENT","GAP"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=/YES/.test(n.attributes[e]))})),n.attributes.hasOwnProperty("BYTERANGE")&&(n.attributes.byterange=xe(n.attributes.BYTERANGE)),void i.trigger("data",n);if((t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e))&&t[1])return(n={type:"tag",tagType:"server-control"}).attributes=Ae(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))})),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=/YES/.test(n.attributes[e]))})),void i.trigger("data",n);if((t=/^#EXT-X-PART-INF:(.*)$/.exec(e))&&t[1])return(n={type:"tag",tagType:"part-inf"}).attributes=Ae(t[1]),["PART-TARGET"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))})),void i.trigger("data",n);if((t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e))&&t[1])return(n={type:"tag",tagType:"preload-hint"}).attributes=Ae(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach((function(e){if(n.attributes.hasOwnProperty(e)){n.attributes[e]=parseInt(n.attributes[e],10);var t="BYTERANGE-LENGTH"===e?"length":"offset";n.attributes.byterange=n.attributes.byterange||{},n.attributes.byterange[t]=n.attributes[e],delete n.attributes[e]}})),void i.trigger("data",n);if((t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e))&&t[1])return(n={type:"tag",tagType:"rendition-report"}).attributes=Ae(t[1]),["LAST-MSN","LAST-PART"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseInt(n.attributes[e],10))})),void i.trigger("data",n);i.trigger("data",{type:"tag",data:e.slice(4)})}}}else i.trigger("data",{type:"comment",text:e.slice(1)})})):this.trigger("data",{type:"uri",uri:e}))},n.addParser=function(e){var t=this,n=e.expression,i=e.customType,r=e.dataParser,a=e.segment;"function"!=typeof r&&(r=function(e){return e}),this.customParsers.push((function(e){if(n.exec(e))return t.trigger("data",{type:"custom",data:r(e),customType:i,segment:a}),!0}))},n.addTagMapper=function(e){var t=e.expression,n=e.map;this.tagMappers.push((function(e){return t.test(e)?n(e):e}))},t}(Ce),Le=function(e){var t={};return Object.keys(e).forEach((function(n){var i;t[(i=n,i.toLowerCase().replace(/-(\w)/g,(function(e){return e[1].toUpperCase()})))]=e[n]})),t},Re=function(e){var t=e.serverControl,n=e.targetDuration,i=e.partTargetDuration;if(t){var r="#EXT-X-SERVER-CONTROL",a="holdBack",s="partHoldBack",o=n&&3*n,u=i&&2*i;n&&!t.hasOwnProperty(a)&&(t[a]=o,this.trigger("info",{message:r+" defaulting HOLD-BACK to targetDuration * 3 ("+o+")."})),o&&t[a]<o&&(this.trigger("warn",{message:r+" clamping HOLD-BACK ("+t[a]+") to targetDuration * 3 ("+o+")"}),t[a]=o),i&&!t.hasOwnProperty(s)&&(t[s]=3*i,this.trigger("info",{message:r+" defaulting PART-HOLD-BACK to partTargetDuration * 3 ("+t[s]+")."})),i&&t[s]<u&&(this.trigger("warn",{message:r+" clamping PART-HOLD-BACK ("+t[s]+") to partTargetDuration * 2 ("+u+")."}),t[s]=u)}},De=function(e){function t(){var t;(t=e.call(this)||this).lineStream=new Ie,t.parseStream=new Oe,t.lineStream.pipe(t.parseStream);var n,i,r=O(t),a=[],s={},o=!1,u=function(){},l={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},c=0;t.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var d=0,h=0;return t.on("end",(function(){s.uri||!s.parts&&!s.preloadHints||(!s.map&&n&&(s.map=n),!s.key&&i&&(s.key=i),s.timeline||"number"!=typeof c||(s.timeline=c),t.manifest.preloadSegment=s)})),t.parseStream.on("data",(function(e){var t,p;({tag:function(){({version:function(){e.version&&(this.manifest.version=e.version)},"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,t.length=e.length,"offset"in e||(e.offset=d)),"offset"in e&&(s.byterange=t,t.offset=e.offset),d=t.offset+t.length},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"})),e.duration>0&&(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(){if(e.attributes)if("NONE"!==e.attributes.METHOD)if(e.attributes.URI){if("com.apple.streamingkeydelivery"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:e.attributes});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===e.attributes.KEYFORMAT){return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(e.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===e.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==e.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):e.attributes.KEYID&&"0x"===e.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:we(e.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}))}e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),i={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(i.iv=e.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else i=null;else 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(){n={},e.uri&&(n.uri=e.uri),e.byterange&&(n.byterange=e.byterange),i&&(n.key=i)},"stream-inf":function(){this.manifest.playlists=a,this.manifest.mediaGroups=this.manifest.mediaGroups||l,e.attributes?(s.attributes||(s.attributes={}),A(s.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||l,e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME){var n=this.manifest.mediaGroups[e.attributes.TYPE];n[e.attributes["GROUP-ID"]]=n[e.attributes["GROUP-ID"]]||{},t=n[e.attributes["GROUP-ID"]],(p={default:/yes/i.test(e.attributes.DEFAULT)}).default?p.autoselect=!0:p.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(p.language=e.attributes.LANGUAGE),e.attributes.URI&&(p.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(p.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(p.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(p.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=p}else 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,Re.call(this,this.manifest))},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},skip:function(){this.manifest.skip=Le(e.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",e.attributes,["SKIPPED-SEGMENTS"])},part:function(){var t=this;o=!0;var n=this.manifest.segments.length,i=Le(e.attributes);s.parts=s.parts||[],s.parts.push(i),i.byterange&&(i.byterange.hasOwnProperty("offset")||(i.byterange.offset=h),h=i.byterange.offset+i.byterange.length);var r=s.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+r+" for segment #"+n,e.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((function(e,n){e.hasOwnProperty("lastPart")||t.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+n+" lacks required attribute(s): LAST-PART"})}))},"server-control":function(){var t=this.manifest.serverControl=Le(e.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Re.call(this,this.manifest),t.canSkipDateranges&&!t.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint":function(){var t=this.manifest.segments.length,n=Le(e.attributes),i=n.type&&"PART"===n.type;s.preloadHints=s.preloadHints||[],s.preloadHints.push(n),n.byterange&&(n.byterange.hasOwnProperty("offset")||(n.byterange.offset=i?h:0,i&&(h=n.byterange.offset+n.byterange.length)));var r=s.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+r+" for segment #"+t,e.attributes,["TYPE","URI"]),n.type)for(var a=0;a<s.preloadHints.length-1;a++){var o=s.preloadHints[a];o.type&&(o.type===n.type&&this.trigger("warn",{message:"#EXT-X-PRELOAD-HINT #"+r+" for segment #"+t+" has the same TYPE "+n.type+" as preload hint #"+a}))}},"rendition-report":function(){var t=Le(e.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);var n=this.manifest.renditionReports.length-1,i=["LAST-MSN","URI"];o&&i.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+n,e.attributes,i)},"part-inf":function(){this.manifest.partInf=Le(e.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",e.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),Re.call(this,this.manifest)}}[e.tagType]||u).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),i&&(s.key=i),s.timeline=c,n&&(s.map=n),h=0,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}R(t,e);var n=t.prototype;return n.warnOnMissingAttributes_=function(e,t,n){var i=[];n.forEach((function(e){t.hasOwnProperty(e)||i.push(e)})),i.length&&this.trigger("warn",{message:e+" lacks required attribute(s): "+i.join(", ")})},n.push=function(e){this.lineStream.push(e)},n.end=function(){this.lineStream.push("\n"),this.trigger("end")},n.addParser=function(e){this.parseStream.addParser(e)},n.addTagMapper=function(e){this.parseStream.addTagMapper(e)},t}(Ce),Me={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},Ne=["video","audio","text"],Ue=["Video","Audio","Text"],Be=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,n){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(n).toString(16)).slice(-2)})):e},Fe=function(e){void 0===e&&(e="");var t=e.split(","),n=[];return t.forEach((function(e){var t;e=e.trim(),Ne.forEach((function(i){var r=Me[i].exec(e.toLowerCase());if(r&&!(r.length<=1)){t=i;var a=e.substring(0,r[1].length),s=e.replace(a,"");n.push({type:a,details:s,mediaType:i})}})),t||n.push({type:e,details:"",mediaType:"unknown"})})),n},je=function(e){return void 0===e&&(e=""),Me.audio.test(e.trim().toLowerCase())},He=function(e){if(e&&"string"==typeof e){var t,n=e.toLowerCase().split(",").map((function(e){return Be(e.trim())})),i="video";1===n.length&&je(n[0])?i="audio":1===n.length&&(void 0===(t=n[0])&&(t=""),Me.text.test(t.trim().toLowerCase()))&&(i="application");var r="mp4";return n.every((function(e){return Me.mp4.test(e)}))?r="mp4":n.every((function(e){return Me.webm.test(e)}))?r="webm":n.every((function(e){return Me.ogg.test(e)}))&&(r="ogg"),i+"/"+r+';codecs="'+e+'"'}},Ve=function(e){return void 0===e&&(e=""),C.MediaSource&&C.MediaSource.isTypeSupported&&C.MediaSource.isTypeSupported(He(e))||!1},qe=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every((function(e){e=e.trim();for(var t=0;t<Ue.length;t++){if(Me["muxer"+Ue[t]].test(e))return!0}return!1}))},We=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,ze=/^application\/dash\+xml/i,Ge=function(e){return We.test(e)?"hls":ze.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null};function Ke(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.freeze?t.freeze(e):e}var Xe=Ke({HTML:"text/html",isHTML:function(e){return e===Xe.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),Qe=Ke({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===Qe.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"}),Ye={freeze:Ke,MIME_TYPE:Xe,NAMESPACE:Qe},$e=Ye.NAMESPACE;function Je(e){return""!==e}function Ze(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function et(e){if(!e)return[];var t=function(e){return e?e.split(/[\t\n\f\r ]+/).filter(Je):[]}(e);return Object.keys(t.reduce(Ze,{}))}function tt(e,t){for(var n in e)t[n]=e[n]}function nt(e,t){var n=e.prototype;if(!(n instanceof t)){var i=function(){};i.prototype=t.prototype,tt(n,i=new i),e.prototype=n=i}n.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),n.constructor=e)}var it={},rt=it.ELEMENT_NODE=1,at=it.ATTRIBUTE_NODE=2,st=it.TEXT_NODE=3,ot=it.CDATA_SECTION_NODE=4,ut=it.ENTITY_REFERENCE_NODE=5,lt=it.ENTITY_NODE=6,ct=it.PROCESSING_INSTRUCTION_NODE=7,dt=it.COMMENT_NODE=8,ht=it.DOCUMENT_NODE=9,pt=it.DOCUMENT_TYPE_NODE=10,ft=it.DOCUMENT_FRAGMENT_NODE=11,mt=it.NOTATION_NODE=12,gt={},vt={},yt=(gt.INDEX_SIZE_ERR=(vt[1]="Index size error",1),gt.DOMSTRING_SIZE_ERR=(vt[2]="DOMString size error",2),gt.HIERARCHY_REQUEST_ERR=(vt[3]="Hierarchy request error",3)),_t=(gt.WRONG_DOCUMENT_ERR=(vt[4]="Wrong document",4),gt.INVALID_CHARACTER_ERR=(vt[5]="Invalid character",5),gt.NO_DATA_ALLOWED_ERR=(vt[6]="No data allowed",6),gt.NO_MODIFICATION_ALLOWED_ERR=(vt[7]="No modification allowed",7),gt.NOT_FOUND_ERR=(vt[8]="Not found",8)),bt=(gt.NOT_SUPPORTED_ERR=(vt[9]="Not supported",9),gt.INUSE_ATTRIBUTE_ERR=(vt[10]="Attribute in use",10));gt.INVALID_STATE_ERR=(vt[11]="Invalid state",11),gt.SYNTAX_ERR=(vt[12]="Syntax error",12),gt.INVALID_MODIFICATION_ERR=(vt[13]="Invalid modification",13),gt.NAMESPACE_ERR=(vt[14]="Invalid namespace",14),gt.INVALID_ACCESS_ERR=(vt[15]="Invalid access",15);function Tt(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,vt[e]),this.message=vt[e],Error.captureStackTrace&&Error.captureStackTrace(this,Tt);return n.code=e,t&&(this.message=this.message+": "+t),n}function kt(){}function St(e,t){this._node=e,this._refresh=t,Et(this)}function Et(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var n=e._refresh(e._node);tn(e,"length",n.length),tt(n,e),e._inc=t}}function Ct(){}function wt(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function It(e,t,n,i){if(i?t[wt(t,i)]=n:t[t.length++]=n,e){n.ownerElement=e;var r=e.ownerDocument;r&&(i&&Dt(r,e,i),function(e,t,n){e&&e._inc++,n.namespaceURI===$e.XMLNS&&(t._nsMap[n.prefix?n.localName:""]=n.value)}(r,e,n))}}function Pt(e,t,n){var i=wt(t,n);if(!(i>=0))throw Tt(_t,new Error(e.tagName+"@"+n));for(var r=t.length-1;i<r;)t[i]=t[++i];if(t.length=r,e){var a=e.ownerDocument;a&&(Dt(a,e,n),n.ownerElement=null)}}function xt(){}function At(){}function Ot(e){return("<"==e?"&lt;":">"==e&&"&gt;")||"&"==e&&"&amp;"||'"'==e&&"&quot;"||"&#"+e.charCodeAt()+";"}function Lt(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(Lt(e,t))return!0}while(e=e.nextSibling)}function Rt(){}function Dt(e,t,n,i){e&&e._inc++,n.namespaceURI===$e.XMLNS&&delete t._nsMap[n.prefix?n.localName:""]}function Mt(e,t,n){if(e&&e._inc){e._inc++;var i=t.childNodes;if(n)i[i.length++]=n;else{for(var r=t.firstChild,a=0;r;)i[a++]=r,r=r.nextSibling;i.length=a}}}function Nt(e,t){var n=t.previousSibling,i=t.nextSibling;return n?n.nextSibling=i:e.firstChild=i,i?i.previousSibling=n:e.lastChild=n,Mt(e.ownerDocument,e),t}function Ut(e,t,n){var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===ft){var r=t.firstChild;if(null==r)return t;var a=t.lastChild}else r=a=t;var s=n?n.previousSibling:e.lastChild;r.previousSibling=s,a.nextSibling=n,s?s.nextSibling=r:e.firstChild=r,null==n?e.lastChild=a:n.previousSibling=a;do{r.parentNode=e}while(r!==a&&(r=r.nextSibling));return Mt(e.ownerDocument||e,e),t.nodeType==ft&&(t.firstChild=t.lastChild=null),t}function Bt(){this._nsMap={}}function Ft(){}function jt(){}function Ht(){}function Vt(){}function qt(){}function Wt(){}function zt(){}function Gt(){}function Kt(){}function Xt(){}function Qt(){}function Yt(){}function $t(e,t){var n=[],i=9==this.nodeType&&this.documentElement||this,r=i.prefix,a=i.namespaceURI;if(a&&null==r&&null==(r=i.lookupPrefix(a)))var s=[{namespace:a,prefix:null}];return en(this,n,e,t,s),n.join("")}function Jt(e,t,n){var i=e.prefix||"",r=e.namespaceURI;if(!r)return!1;if("xml"===i&&r===$e.XML||r===$e.XMLNS)return!1;for(var a=n.length;a--;){var s=n[a];if(s.prefix===i)return s.namespace!==r}return!0}function Zt(e,t,n){e.push(" ",t,'="',n.replace(/[<&"]/g,Ot),'"')}function en(e,t,n,i,r){if(r||(r=[]),i){if(!(e=i(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case rt:var a=e.attributes,s=a.length,o=e.firstChild,u=e.tagName,l=u;if(!(n=$e.isHTML(e.namespaceURI)||n)&&!e.prefix&&e.namespaceURI){for(var c,d=0;d<a.length;d++)if("xmlns"===a.item(d).name){c=a.item(d).value;break}if(!c)for(var h=r.length-1;h>=0;h--){if(""===(p=r[h]).prefix&&p.namespace===e.namespaceURI){c=p.namespace;break}}if(c!==e.namespaceURI)for(h=r.length-1;h>=0;h--){var p;if((p=r[h]).namespace===e.namespaceURI){p.prefix&&(l=p.prefix+":"+u);break}}}t.push("<",l);for(var f=0;f<s;f++){"xmlns"==(m=a.item(f)).prefix?r.push({prefix:m.localName,namespace:m.value}):"xmlns"==m.nodeName&&r.push({prefix:"",namespace:m.value})}for(f=0;f<s;f++){var m,g,v;if(Jt(m=a.item(f),0,r))Zt(t,(g=m.prefix||"")?"xmlns:"+g:"xmlns",v=m.namespaceURI),r.push({prefix:g,namespace:v});en(m,t,n,i,r)}if(u===l&&Jt(e,0,r))Zt(t,(g=e.prefix||"")?"xmlns:"+g:"xmlns",v=e.namespaceURI),r.push({prefix:g,namespace:v});if(o||n&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(t.push(">"),n&&/^script$/i.test(u))for(;o;)o.data?t.push(o.data):en(o,t,n,i,r.slice()),o=o.nextSibling;else for(;o;)en(o,t,n,i,r.slice()),o=o.nextSibling;t.push("</",l,">")}else t.push("/>");return;case ht:case ft:for(o=e.firstChild;o;)en(o,t,n,i,r.slice()),o=o.nextSibling;return;case at:return Zt(t,e.name,e.value);case st:return t.push(e.data.replace(/[<&]/g,Ot).replace(/]]>/g,"]]&gt;"));case ot:return t.push("<![CDATA[",e.data,"]]>");case dt:return t.push("\x3c!--",e.data,"--\x3e");case pt:var y=e.publicId,_=e.systemId;if(t.push("<!DOCTYPE ",e.name),y)t.push(" PUBLIC ",y),_&&"."!=_&&t.push(" ",_),t.push(">");else if(_&&"."!=_)t.push(" SYSTEM ",_,">");else{var b=e.internalSubset;b&&t.push(" [",b,"]"),t.push(">")}return;case ct:return t.push("<?",e.target," ",e.data,"?>");case ut:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function tn(e,t,n){e[t]=n}Tt.prototype=Error.prototype,tt(gt,Tt),kt.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var n=[],i=0;i<this.length;i++)en(this[i],n,e,t);return n.join("")}},St.prototype.item=function(e){return Et(this),this[e]},nt(St,kt),Ct.prototype={length:0,item:kt.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var n=this[t];if(n.nodeName==e)return n}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new Tt(bt);var n=this.getNamedItem(e.nodeName);return It(this._ownerElement,this,e,n),n},setNamedItemNS:function(e){var t,n=e.ownerElement;if(n&&n!=this._ownerElement)throw new Tt(bt);return t=this.getNamedItemNS(e.namespaceURI,e.localName),It(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return Pt(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);return Pt(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){for(var n=this.length;n--;){var i=this[n];if(i.localName==t&&i.namespaceURI==e)return i}return null}},xt.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,n){var i=new Rt;if(i.implementation=this,i.childNodes=new kt,i.doctype=n||null,n&&i.appendChild(n),t){var r=i.createElementNS(e,t);i.appendChild(r)}return i},createDocumentType:function(e,t,n){var i=new Wt;return i.name=e,i.nodeName=e,i.publicId=t||"",i.systemId=n||"",i}},At.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return Ut(this,e,t)},replaceChild:function(e,t){this.insertBefore(e,t),t&&this.removeChild(t)},removeChild:function(e){return Nt(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return function e(t,n,i){var r=new n.constructor;for(var a in n){var s=n[a];"object"!=_typeof2(s)&&s!=r[a]&&(r[a]=s)}n.childNodes&&(r.childNodes=new kt);switch(r.ownerDocument=t,r.nodeType){case rt:var o=n.attributes,u=r.attributes=new Ct,l=o.length;u._ownerElement=r;for(var c=0;c<l;c++)r.setAttributeNode(e(t,o.item(c),!0));break;case at:i=!0}if(i)for(var d=n.firstChild;d;)r.appendChild(e(t,d,i)),d=d.nextSibling;return r}(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==st&&e.nodeType==st?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var i in n)if(n[i]==e)return i;t=t.nodeType==at?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&e in n)return n[e];t=t.nodeType==at?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},tt(it,At),tt(it,At.prototype),Rt.prototype={nodeName:"#document",nodeType:ht,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==ft){for(var n=e.firstChild;n;){var i=n.nextSibling;this.insertBefore(n,t),n=i}return e}return null==this.documentElement&&e.nodeType==rt&&(this.documentElement=e),Ut(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),Nt(this,e)},importNode:function(e,t){return function e(t,n,i){var r;switch(n.nodeType){case rt:(r=n.cloneNode(!1)).ownerDocument=t;case ft:break;case at:i=!0}r||(r=n.cloneNode(!1));if(r.ownerDocument=t,r.parentNode=null,i)for(var a=n.firstChild;a;)r.appendChild(e(t,a,i)),a=a.nextSibling;return r}(this,e,t)},getElementById:function(e){var t=null;return Lt(this.documentElement,(function(n){if(n.nodeType==rt&&n.getAttribute("id")==e)return t=n,!0})),t},getElementsByClassName:function(e){var t=et(e);return new St(this,(function(n){var i=[];return t.length>0&&Lt(n.documentElement,(function(r){if(r!==n&&r.nodeType===rt){var a=r.getAttribute("class");if(a){var s=e===a;if(!s){var o=et(a);s=t.every((u=o,function(e){return u&&-1!==u.indexOf(e)}))}s&&i.push(r)}}var u})),i}))},createElement:function(e){var t=new Bt;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new kt,(t.attributes=new Ct)._ownerElement=t,t},createDocumentFragment:function(){var e=new Xt;return e.ownerDocument=this,e.childNodes=new kt,e},createTextNode:function(e){var t=new Ht;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new Vt;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new qt;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new Qt;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new Ft;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new Kt;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new Bt,i=t.split(":"),r=n.attributes=new Ct;return n.childNodes=new kt,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=t,r._ownerElement=n,n},createAttributeNS:function(e,t){var n=new Ft,i=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=t,n}},nt(Rt,At),Bt.prototype={nodeType:rt,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===ft?this.insertBefore(e,null):function(e,t){var n=t.parentNode;if(n){var i=e.lastChild;n.removeChild(t);i=e.lastChild}return i=e.lastChild,t.parentNode=e,t.previousSibling=i,t.nextSibling=null,i?i.nextSibling=t:e.firstChild=t,e.lastChild=t,Mt(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var i=this.ownerDocument.createAttributeNS(e,t);i.value=i.nodeValue=""+n,this.setAttributeNode(i)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new St(this,(function(t){var n=[];return Lt(t,(function(i){i===t||i.nodeType!=rt||"*"!==e&&i.tagName!=e||n.push(i)})),n}))},getElementsByTagNameNS:function(e,t){return new St(this,(function(n){var i=[];return Lt(n,(function(r){r===n||r.nodeType!==rt||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||i.push(r)})),i}))}},Rt.prototype.getElementsByTagName=Bt.prototype.getElementsByTagName,Rt.prototype.getElementsByTagNameNS=Bt.prototype.getElementsByTagNameNS,nt(Bt,At),Ft.prototype.nodeType=at,nt(Ft,At),jt.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(vt[yt])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length}},nt(jt,At),Ht.prototype={nodeName:"#text",nodeType:st,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var i=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}},nt(Ht,jt),Vt.prototype={nodeName:"#comment",nodeType:dt},nt(Vt,jt),qt.prototype={nodeName:"#cdata-section",nodeType:ot},nt(qt,jt),Wt.prototype.nodeType=pt,nt(Wt,At),zt.prototype.nodeType=mt,nt(zt,At),Gt.prototype.nodeType=lt,nt(Gt,At),Kt.prototype.nodeType=ut,nt(Kt,At),Xt.prototype.nodeName="#document-fragment",Xt.prototype.nodeType=ft,nt(Xt,At),Qt.prototype.nodeType=ct,nt(Qt,At),Yt.prototype.serializeToString=function(e,t,n){return $t.call(e,t,n)},At.prototype.toString=$t;try{if(Object.defineProperty){Object.defineProperty(St.prototype,"length",{get:function(){return Et(this),this.$$length}}),Object.defineProperty(At.prototype,"textContent",{get:function(){return function e(t){switch(t.nodeType){case rt:case ft:var n=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&n.push(e(t)),t=t.nextSibling;return n.join("");default:return t.nodeValue}}(this)},set:function(e){switch(this.nodeType){case rt:case ft:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),tn=function(e,t,n){e["$$"+t]=n}}}catch(Cv){}var nn={DocumentType:Wt,DOMException:Tt,DOMImplementation:xt,Element:Bt,Node:At,NodeList:kt,XMLSerializer:Yt},rn=S((function(e,t){var n=Ye.freeze;t.XML_ENTITIES=n({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=n({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}),t.entityMap=t.HTML_ENTITIES})),an=(rn.XML_ENTITIES,rn.HTML_ENTITIES,rn.entityMap,Ye.NAMESPACE),sn=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,on=new RegExp("[\\-\\.0-9"+sn.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),un=new RegExp("^"+sn.source+on.source+"*(?::"+sn.source+on.source+"*)?$");function ln(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,ln)}function cn(){}function dn(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function hn(e,t,n,i,r,a){function s(e,t,i){n.attributeNames.hasOwnProperty(e)&&a.fatalError("Attribute "+e+" redefined"),n.addValue(e,t,i)}for(var o,u=++t,l=0;;){var c=e.charAt(u);switch(c){case"=":if(1===l)o=e.slice(t,u),l=3;else{if(2!==l)throw new Error("attribute equal must after attrName");l=3}break;case"'":case'"':if(3===l||1===l){if(1===l&&(a.warning('attribute value must after "="'),o=e.slice(t,u)),t=u+1,!((u=e.indexOf(c,t))>0))throw new Error("attribute value no end '"+c+"' match");s(o,d=e.slice(t,u).replace(/&#?\w+;/g,r),t-1),l=5}else{if(4!=l)throw new Error('attribute value must after "="');s(o,d=e.slice(t,u).replace(/&#?\w+;/g,r),t),a.warning('attribute "'+o+'" missed start quot('+c+")!!"),t=u+1,l=5}break;case"/":switch(l){case 0:n.setTagName(e.slice(t,u));case 5:case 6:case 7:l=7,n.closed=!0;case 4:case 1:case 2:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),0==l&&n.setTagName(e.slice(t,u)),u;case">":switch(l){case 0:n.setTagName(e.slice(t,u));case 5:case 6:case 7:break;case 4:case 1:"/"===(d=e.slice(t,u)).slice(-1)&&(n.closed=!0,d=d.slice(0,-1));case 2:2===l&&(d=o),4==l?(a.warning('attribute "'+d+'" missed quot(")!'),s(o,d.replace(/&#?\w+;/g,r),t)):(an.isHTML(i[""])&&d.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+d+'" missed value!! "'+d+'" instead!!'),s(d,d,t));break;case 3:throw new Error("attribute value missed!!")}return u;case"":c=" ";default:if(c<=" ")switch(l){case 0:n.setTagName(e.slice(t,u)),l=6;break;case 1:o=e.slice(t,u),l=2;break;case 4:var d=e.slice(t,u).replace(/&#?\w+;/g,r);a.warning('attribute "'+d+'" missed quot(")!!'),s(o,d,t);case 5:l=6}else switch(l){case 2:n.tagName;an.isHTML(i[""])&&o.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),s(o,o,t),t=u,l=1;break;case 5:a.warning('attribute space is required"'+o+'"!!');case 6:l=1,t=u;break;case 3:l=4,t=u;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}u++}}function pn(e,t,n){for(var i=e.tagName,r=null,a=e.length;a--;){var s=e[a],o=s.qName,u=s.value;if((h=o.indexOf(":"))>0)var l=s.prefix=o.slice(0,h),c=o.slice(h+1),d="xmlns"===l&&c;else c=o,l=null,d="xmlns"===o&&"";s.localName=c,!1!==d&&(null==r&&(r={},gn(n,n={})),n[d]=r[d]=u,s.uri=an.XMLNS,t.startPrefixMapping(d,u))}for(a=e.length;a--;){(l=(s=e[a]).prefix)&&("xml"===l&&(s.uri=an.XML),"xmlns"!==l&&(s.uri=n[l||""]))}var h;(h=i.indexOf(":"))>0?(l=e.prefix=i.slice(0,h),c=e.localName=i.slice(h+1)):(l=null,c=e.localName=i);var p=e.uri=n[l||""];if(t.startElement(p,c,i,e),!e.closed)return e.currentNSMap=n,e.localNSMap=r,!0;if(t.endElement(p,c,i),r)for(l in r)t.endPrefixMapping(l)}function fn(e,t,n,i,r){if(/^(?:script|textarea)$/i.test(n)){var a=e.indexOf("</"+n+">",t),s=e.substring(t+1,a);if(/[&<]/.test(s))return/^script$/i.test(n)?(r.characters(s,0,s.length),a):(s=s.replace(/&#?\w+;/g,i),r.characters(s,0,s.length),a)}return t+1}function mn(e,t,n,i){var r=i[n];return null==r&&((r=e.lastIndexOf("</"+n+">"))<t&&(r=e.lastIndexOf("</"+n)),i[n]=r),r<t}function gn(e,t){for(var n in e)t[n]=e[n]}function vn(e,t,n,i){switch(e.charAt(t+2)){case"-":return"-"===e.charAt(t+3)?(r=e.indexOf("--\x3e",t+4))>t?(n.comment(e,t+4,r-t-4),r+3):(i.error("Unclosed comment"),-1):-1;default:if("CDATA["==e.substr(t+3,6)){var r=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,r-t-9),n.endCDATA(),r+3}var a=function(e,t){var n,i=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;r.lastIndex=t,r.exec(e);for(;n=r.exec(e);)if(i.push(n),n[1])return i}(e,t),s=a.length;if(s>1&&/!doctype/i.test(a[0][0])){var o=a[1][0],u=!1,l=!1;s>3&&(/^public$/i.test(a[2][0])?(u=a[3][0],l=s>4&&a[4][0]):/^system$/i.test(a[2][0])&&(l=a[3][0]));var c=a[s-1];return n.startDTD(o,u,l),n.endDTD(),c.index+c[0].length}}return-1}function yn(e,t,n){var i=e.indexOf("?>",t);if(i){var r=e.substring(t,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(r){r[0].length;return n.processingInstruction(r[1],r[2]),i+2}return-1}return-1}function _n(){this.attributeNames={}}ln.prototype=new Error,ln.prototype.name=ln.name,cn.prototype={parse:function(e,t,n){var i=this.domBuilder;i.startDocument(),gn(t,t={}),function(e,t,n,i,r){function a(e){var t=e.slice(1,-1);return t in n?n[t]:"#"===t.charAt(0)?function(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}(parseInt(t.substr(1).replace("x","0x"))):(r.error("entity not found:"+e),e)}function s(t){if(t>f){var n=e.substring(f,t).replace(/&#?\w+;/g,a);d&&o(f),i.characters(n,0,t-f),f=t}}function o(t,n){for(;t>=l&&(n=c.exec(e));)u=n.index,l=u+n[0].length,d.lineNumber++;d.columnNumber=t-u+1}var u=0,l=0,c=/.*(?:\r\n?|\n)|.*$/g,d=i.locator,h=[{currentNSMap:t}],p={},f=0;for(;;){try{var m=e.indexOf("<",f);if(m<0){if(!e.substr(f).match(/^\s*$/)){var g=i.doc,v=g.createTextNode(e.substr(f));g.appendChild(v),i.currentElement=v}return}switch(m>f&&s(m),e.charAt(m+1)){case"/":var y=e.indexOf(">",m+3),_=e.substring(m+2,y).replace(/[ \t\n\r]+$/g,""),b=h.pop();y<0?(_=e.substring(m+2).replace(/[\s<].*/,""),r.error("end tag name: "+_+" is not complete:"+b.tagName),y=m+1+_.length):_.match(/\s</)&&(_=_.replace(/[\s<].*/,""),r.error("end tag name: "+_+" maybe not complete"),y=m+1+_.length);var T=b.localNSMap,k=b.tagName==_;if(k||b.tagName&&b.tagName.toLowerCase()==_.toLowerCase()){if(i.endElement(b.uri,b.localName,_),T)for(var S in T)i.endPrefixMapping(S);k||r.fatalError("end tag name: "+_+" is not match the current start tagName:"+b.tagName)}else h.push(b);y++;break;case"?":d&&o(m),y=yn(e,m,i);break;case"!":d&&o(m),y=vn(e,m,i,r);break;default:d&&o(m);var E=new _n,C=h[h.length-1].currentNSMap,w=(y=hn(e,m,E,C,a,r),E.length);if(!E.closed&&mn(e,y,E.tagName,p)&&(E.closed=!0,n.nbsp||r.warning("unclosed xml attribute")),d&&w){for(var I=dn(d,{}),P=0;P<w;P++){var x=E[P];o(x.offset),x.locator=dn(d,{})}i.locator=I,pn(E,i,C)&&h.push(E),i.locator=d}else pn(E,i,C)&&h.push(E);an.isHTML(E.uri)&&!E.closed?y=fn(e,y,E.tagName,a,i):y++}}catch(e){if(e instanceof ln)throw e;r.error("element parse error: "+e),y=-1}y>f?f=y:s(Math.max(m,f)+1)}}(e,t,n,i,this.errorHandler),i.endDocument()}},_n.prototype={setTagName:function(e){if(!un.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,n){if(!un.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};var bn={XMLReader:cn,ParseError:ln},Tn=nn.DOMImplementation,kn=Ye.NAMESPACE,Sn=bn.ParseError,En=bn.XMLReader;function Cn(e){this.options=e||{locator:{}}}function wn(){this.cdata=!1}function In(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function Pn(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function xn(e,t,n){return"string"==typeof e?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+"":e}function An(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}Cn.prototype.parseFromString=function(e,t){var n=this.options,i=new En,r=n.domBuilder||new wn,a=n.errorHandler,s=n.locator,o=n.xmlns||{},u=/\/x?html?$/.test(t),l=u?rn.HTML_ENTITIES:rn.XML_ENTITIES;return s&&r.setDocumentLocator(s),i.errorHandler=function(e,t,n){if(!e){if(t instanceof wn)return t;e=t}var i={},r=e instanceof Function;function a(t){var a=e[t];!a&&r&&(a=2==e.length?function(n){e(t,n)}:e),i[t]=a&&function(e){a("[xmldom "+t+"]\t"+e+Pn(n))}||function(){}}return n=n||{},a("warning"),a("error"),a("fatalError"),i}(a,r,s),i.domBuilder=n.domBuilder||r,u&&(o[""]=kn.HTML),o.xml=o.xml||kn.XML,e&&"string"==typeof e?i.parse(e,o,l):i.errorHandler.error("invalid doc source"),r.doc},wn.prototype={startDocument:function(){this.doc=(new Tn).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,i){var r=this.doc,a=r.createElementNS(e,n||t),s=i.length;An(this,a),this.currentElement=a,this.locator&&In(this.locator,a);for(var o=0;o<s;o++){e=i.getURI(o);var u=i.getValue(o),l=(n=i.getQName(o),r.createAttributeNS(e,n));this.locator&&In(i.getLocator(o),l),l.value=l.nodeValue=u,a.setAttributeNode(l)}},endElement:function(e,t,n){var i=this.currentElement;i.tagName;this.currentElement=i.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var n=this.doc.createProcessingInstruction(e,t);this.locator&&In(this.locator,n),An(this,n)},ignorableWhitespace:function(e,t,n){},characters:function(e,t,n){if(e=xn.apply(this,arguments)){if(this.cdata)var i=this.doc.createCDATASection(e);else i=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(i):/^\s*$/.test(e)&&this.doc.appendChild(i),this.locator&&In(this.locator,i)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,n){e=xn.apply(this,arguments);var i=this.doc.createComment(e);this.locator&&In(this.locator,i),An(this,i)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,n){var i=this.doc.implementation;if(i&&i.createDocumentType){var r=i.createDocumentType(e,t,n);this.locator&&In(this.locator,r),An(this,r),this.doc.doctype=r}},warning:function(e){console.warn("[xmldom warning]\t"+e,Pn(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,Pn(this.locator))},fatalError:function(e){throw new Sn(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(e){wn.prototype[e]=function(){return null}}));var On={__DOMHandler:wn,DOMParser:Cn,DOMImplementation:nn.DOMImplementation,XMLSerializer:nn.XMLSerializer}.DOMParser,Ln=function(e){return!!e&&"object"===_typeof2(e)},Rn=function e(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return n.reduce((function(t,n){return"object"!==_typeof2(n)||Object.keys(n).forEach((function(i){Array.isArray(t[i])&&Array.isArray(n[i])?t[i]=t[i].concat(n[i]):Ln(t[i])&&Ln(n[i])?t[i]=e(t[i],n[i]):t[i]=n[i]})),t}),{})},Dn=function(e){return e.reduce((function(e,t){return e.concat(t)}),[])},Mn=function(e){if(!e.length)return[];for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t},Nn="INVALID_NUMBER_OF_PERIOD",Un="DASH_EMPTY_MANIFEST",Bn="DASH_INVALID_XML",Fn="NO_BASE_URL",jn="SEGMENT_TIME_UNSPECIFIED",Hn="UNSUPPORTED_UTC_TIMING_SCHEME",Vn=function(e){var t=e.baseUrl,n=void 0===t?"":t,i=e.source,r=void 0===i?"":i,a=e.range,s=void 0===a?"":a,o=e.indexRange,u=void 0===o?"":o,l={uri:r,resolvedUri:Ee(n||"",r)};if(s||u){var c=(s||u).split("-"),d=parseInt(c[0],10),h=parseInt(c[1],10);l.byterange={length:h-d+1,offset:d}}return l},qn=function(e){return e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e},Wn={static:function(e){var t=e.duration,n=e.timescale,i=void 0===n?1:n,r=e.sourceDuration,a=e.periodDuration,s=qn(e.endNumber),o=t/i;return"number"==typeof s?{start:0,end:s}:"number"==typeof a?{start:0,end:a/o}:{start:0,end:r/o}},dynamic:function(e){var t=e.NOW,n=e.clientOffset,i=e.availabilityStartTime,r=e.timescale,a=void 0===r?1:r,s=e.duration,o=e.start,u=void 0===o?0:o,l=e.minimumUpdatePeriod,c=void 0===l?0:l,d=e.timeShiftBufferDepth,h=void 0===d?1/0:d,p=qn(e.endNumber),f=(t+n)/1e3,m=i+u,g=f+c-m,v=Math.ceil(g*a/s),y=Math.floor((f-m-h)*a/s),_=Math.floor((f-m)*a/s);return{start:Math.max(0,y),end:"number"==typeof p?p:Math.min(v,_)}}},zn=function(e){var t=e.type,n=e.duration,i=e.timescale,r=void 0===i?1:i,a=e.periodDuration,s=e.sourceDuration,o=Wn[t](e),u=function(e,t){for(var n=[],i=e;i<t;i++)n.push(i);return n}(o.start,o.end).map(function(e){return function(t,n){var i=e.duration,r=e.timescale,a=void 0===r?1:r,s=e.periodIndex,o=e.startNumber;return{number:(void 0===o?1:o)+t,duration:i/a,timeline:s,time:n*i}}}(e));if("static"===t){var l=u.length-1,c="number"==typeof a?a:s;u[l].duration=c-n/r*l}return u},Gn=function(e){var t=e.baseUrl,n=e.initialization,i=void 0===n?{}:n,r=e.sourceDuration,a=e.indexRange,s=void 0===a?"":a,o=e.duration;if(!t)throw new Error(Fn);var u=Vn({baseUrl:t,source:i.sourceURL,range:i.range}),l=Vn({baseUrl:t,source:t,indexRange:s});if(l.map=u,o){var c=zn(e);c.length&&(l.duration=c[0].duration,l.timeline=c[0].timeline)}else r&&(l.duration=r,l.timeline=0);return l.number=0,[l]},Kn=function(e,t,n){for(var i=e.sidx.map?e.sidx.map:null,r=e.sidx.duration,a=e.timeline||0,s=e.sidx.byterange,o=s.offset+s.length,u=t.timescale,l=t.references.filter((function(e){return 1!==e.referenceType})),c=[],d=e.endList?"static":"dynamic",h=o+t.firstOffset,p=0;p<l.length;p++){var f=t.references[p],m=f.referencedSize,g=f.subsegmentDuration,v=Gn({baseUrl:n,timescale:u,timeline:a,periodIndex:a,duration:g,sourceDuration:r,indexRange:h+"-"+(h+m-1),type:d})[0];i&&(v.map=i),c.push(v),h+=m}return e.segments=c,e},Xn=function(e){return e&&e.uri+"-"+(t=e.byterange,n=t.offset+t.length-1,t.offset+"-"+n);var t,n},Qn=function(e){return function(e){return Object.keys(e).map((function(t){return e[t]}))}(e.reduce((function(e,t){var n,i=t.attributes.id+(t.attributes.lang||"");e[i]?(t.segments[0]&&(t.segments[0].discontinuity=!0),(n=e[i].segments).push.apply(n,t.segments),t.attributes.contentProtection&&(e[i].attributes.contentProtection=t.attributes.contentProtection)):e[i]=t;return e}),{})).map((function(e){return e.discontinuityStarts=function(e,t){return e.reduce((function(e,n,i){return n[t]&&e.push(i),e}),[])}(e.segments,"discontinuity"),e}))},Yn=function(e,t){var n=Xn(e.sidx),i=n&&t[n]&&t[n].sidx;return i&&Kn(e,i,e.sidx.resolvedUri),e},$n=function(e,t){if(void 0===t&&(t={}),!Object.keys(t).length)return e;for(var n in e)e[n]=Yn(e[n],t);return e},Jn=function(e){var t,n=e.attributes,i=e.segments,r=e.sidx,a={attributes:(t={NAME:n.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:n.width,height:n.height},CODECS:n.codecs,BANDWIDTH:n.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===n.type,timeline:n.periodIndex,resolvedUri:"",targetDuration:n.duration,segments:i,mediaSequence:i.length?i[0].number:1};return n.contentProtection&&(a.contentProtection=n.contentProtection),r&&(a.sidx=r),a},Zn=function(e){var t=e.attributes;return"video/mp4"===t.mimeType||"video/webm"===t.mimeType||"video"===t.contentType},ei=function(e){var t=e.attributes;return"audio/mp4"===t.mimeType||"audio/webm"===t.mimeType||"audio"===t.contentType},ti=function(e){var t=e.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType},ni=function(e,t,n){var i;if(void 0===n&&(n={}),!e.length)return{};var r=e[0].attributes,a=r.sourceDuration,s=r.type,o=r.suggestedPresentationDelay,u=r.minimumUpdatePeriod,l=Qn(e.filter(Zn)).map(Jn),c=Qn(e.filter(ei)),d=e.filter(ti),h=e.map((function(e){return e.attributes.captionServices})).filter(Boolean),p={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(i={AUDIO:{},VIDEO:{}},i["CLOSED-CAPTIONS"]={},i.SUBTITLES={},i),uri:"",duration:a,playlists:$n(l,n)};u>=0&&(p.minimumUpdatePeriod=1e3*u),t&&(p.locations=t),"dynamic"===s&&(p.suggestedPresentationDelay=o);var f=0===p.playlists.length;return c.length&&(p.mediaGroups.AUDIO.audio=function(e,t,n){var i;void 0===t&&(t={}),void 0===n&&(n=!1);var r=e.reduce((function(e,r){var a=r.attributes.role&&r.attributes.role.value||"",s=r.attributes.lang||"",o=r.attributes.label||"main";if(s&&!r.attributes.label){var u=a?" ("+a+")":"";o=""+r.attributes.lang+u}e[o]||(e[o]={language:s,autoselect:!0,default:"main"===a,playlists:[],uri:""});var l=Yn(function(e,t){var n,i=e.attributes,r=e.segments,a=e.sidx,s={attributes:(n={NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs},n["PROGRAM-ID"]=1,n),uri:"",endList:"static"===i.type,timeline:i.periodIndex,resolvedUri:"",targetDuration:i.duration,segments:r,mediaSequence:r.length?r[0].number:1};return i.contentProtection&&(s.contentProtection=i.contentProtection),a&&(s.sidx=a),t&&(s.attributes.AUDIO="audio",s.attributes.SUBTITLES="subs"),s}(r,n),t);return e[o].playlists.push(l),void 0===i&&"main"===a&&((i=r).default=!0),e}),{});i||(r[Object.keys(r)[0]].default=!0);return r}(c,n,f)),d.length&&(p.mediaGroups.SUBTITLES.subs=function(e,t){return void 0===t&&(t={}),e.reduce((function(e,n){var i=n.attributes.lang||"text";return e[i]||(e[i]={language:i,default:!1,autoselect:!1,playlists:[],uri:""}),e[i].playlists.push(Yn(function(e){var t,n=e.attributes,i=e.segments;void 0===i&&(i=[{uri:n.baseUrl,timeline:n.periodIndex,resolvedUri:n.baseUrl||"",duration:n.sourceDuration,number:0}],n.duration=n.sourceDuration);var r=((t={NAME:n.id,BANDWIDTH:n.bandwidth})["PROGRAM-ID"]=1,t);return n.codecs&&(r.CODECS=n.codecs),{attributes:r,uri:"",endList:"static"===n.type,timeline:n.periodIndex,resolvedUri:n.baseUrl||"",targetDuration:n.duration,segments:i,mediaSequence:i.length?i[0].number:1}}(n),t)),e}),{})}(d,n)),h.length&&(p.mediaGroups["CLOSED-CAPTIONS"].cc=h.reduce((function(e,t){return t?(t.forEach((function(t){var n=t.channel,i=t.language;e[i]={autoselect:!1,default:!1,instreamId:n,language:i},t.hasOwnProperty("aspectRatio")&&(e[i].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[i].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[i]["3D"]=t["3D"])})),e):e}),{})),p},ii=function(e,t,n){var i=e.NOW,r=e.clientOffset,a=e.availabilityStartTime,s=e.timescale,o=void 0===s?1:s,u=e.start,l=void 0===u?0:u,c=e.minimumUpdatePeriod,d=(i+r)/1e3+(void 0===c?0:c)-(a+l);return Math.ceil((d*o-t)/n)},ri=function(e,t){for(var n=e.type,i=e.minimumUpdatePeriod,r=void 0===i?0:i,a=e.media,s=void 0===a?"":a,o=e.sourceDuration,u=e.timescale,l=void 0===u?1:u,c=e.startNumber,d=void 0===c?1:c,h=e.periodIndex,p=[],f=-1,m=0;m<t.length;m++){var g=t[m],v=g.d,y=g.r||0,_=g.t||0;f<0&&(f=_),_&&_>f&&(f=_);var b=void 0;if(y<0){var T=m+1;b=T===t.length?"dynamic"===n&&r>0&&s.indexOf("$Number$")>0?ii(e,f,v):(o*l-f)/v:(t[T].t-f)/v}else b=y+1;for(var k=d+p.length+b,S=d+p.length;S<k;)p.push({number:S,duration:v/l,time:f,timeline:h}),f+=v,S++}return p},ai=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,si=function(e,t){return e.replace(ai,function(e){return function(t,n,i,r){if("$$"===t)return"$";if(void 0===e[n])return t;var a=""+e[n];return"RepresentationID"===n?a:(r=i?parseInt(r,10):1,a.length>=r?a:""+new Array(r-a.length+1).join("0")+a)}}(t))},oi=function(e,t){var n={RepresentationID:e.id,Bandwidth:e.bandwidth||0},i=e.initialization,r=void 0===i?{sourceURL:"",range:""}:i,a=Vn({baseUrl:e.baseUrl,source:si(r.sourceURL,n),range:r.range});return function(e,t){return e.duration||t?e.duration?zn(e):ri(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodIndex}]}(e,t).map((function(t){n.Number=t.number,n.Time=t.time;var i=si(e.media||"",n),r=e.timescale||1,s=e.presentationTimeOffset||0,o=e.periodStart+(t.time-s)/r;return{uri:i,timeline:t.timeline,duration:t.duration,resolvedUri:Ee(e.baseUrl||"",i),map:a,number:t.number,presentationTime:o}}))},ui=function(e,t){var n=e.duration,i=e.segmentUrls,r=void 0===i?[]:i,a=e.periodStart;if(!n&&!t||n&&t)throw new Error(jn);var s,o=r.map((function(t){return function(e,t){var n=e.baseUrl,i=e.initialization,r=void 0===i?{}:i,a=Vn({baseUrl:n,source:r.sourceURL,range:r.range}),s=Vn({baseUrl:n,source:t.media,range:t.mediaRange});return s.map=a,s}(e,t)}));return n&&(s=zn(e)),t&&(s=ri(e,t)),s.map((function(t,n){if(o[n]){var i=o[n],r=e.timescale||1,s=e.presentationTimeOffset||0;return i.timeline=t.timeline,i.duration=t.duration,i.number=t.number,i.presentationTime=a+(t.time-s)/r,i}})).filter((function(e){return e}))},li=function(e){var t,n,i=e.attributes,r=e.segmentInfo;r.template?(n=oi,t=Rn(i,r.template)):r.base?(n=Gn,t=Rn(i,r.base)):r.list&&(n=ui,t=Rn(i,r.list));var a={attributes:i};if(!n)return a;var s=n(t,r.segmentTimeline);if(t.duration){var o=t,u=o.duration,l=o.timescale,c=void 0===l?1:l;t.duration=u/c}else s.length?t.duration=s.reduce((function(e,t){return Math.max(e,Math.ceil(t.duration))}),0):t.duration=0;return a.attributes=t,a.segments=s,r.base&&t.indexRange&&(a.sidx=s[0],a.segments=[]),a},ci=function(e,t){return Mn(e.childNodes).filter((function(e){return e.tagName===t}))},di=function(e){return e.textContent.trim()},hi=function(e){var t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;var n=t.slice(1),i=n[0],r=n[1],a=n[2],s=n[3],o=n[4],u=n[5];return 31536e3*parseFloat(i||0)+2592e3*parseFloat(r||0)+86400*parseFloat(a||0)+3600*parseFloat(s||0)+60*parseFloat(o||0)+parseFloat(u||0)},pi={mediaPresentationDuration:function(e){return hi(e)},availabilityStartTime:function(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=e)&&(t+="Z"),Date.parse(t)/1e3;var t},minimumUpdatePeriod:function(e){return hi(e)},suggestedPresentationDelay:function(e){return hi(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return hi(e)},start:function(e){return hi(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},presentationTimeOffset:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?hi(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},fi=function(e){return e&&e.attributes?Mn(e.attributes).reduce((function(e,t){var n=pi[t.name]||pi.DEFAULT;return e[t.name]=n(t.value),e}),{}):{}},mi={"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"},gi=function(e,t){return t.length?Dn(e.map((function(e){return t.map((function(t){return Ee(e,di(t))}))}))):e},vi=function(e){var t=ci(e,"SegmentTemplate")[0],n=ci(e,"SegmentList")[0],i=n&&ci(n,"SegmentURL").map((function(e){return Rn({tag:"SegmentURL"},fi(e))})),r=ci(e,"SegmentBase")[0],a=n||t,s=a&&ci(a,"SegmentTimeline")[0],o=n||r||t,u=o&&ci(o,"Initialization")[0],l=t&&fi(t);l&&u?l.initialization=u&&fi(u):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});var c={template:l,segmentTimeline:s&&ci(s,"S").map((function(e){return fi(e)})),list:n&&Rn(fi(n),{segmentUrls:i,initialization:fi(u)}),base:r&&Rn(fi(r),{initialization:fi(u)})};return Object.keys(c).forEach((function(e){c[e]||delete c[e]})),c},yi=function(e,t,n){return function(i){var r,a=fi(i),s=gi(t,ci(i,"BaseURL")),o=ci(i,"Role")[0],u={role:fi(o)},l=Rn(e,a,u),c=ci(i,"Accessibility")[0],d="urn:scte:dash:cc:cea-608:2015"===(r=fi(c)).schemeIdUri?("string"!=typeof r.value?[]:r.value.split(";")).map((function(e){var t,n;if(n=e,/^CC\d=/.test(e)){var i=e.split("=");t=i[0],n=i[1]}else/^CC\d$/.test(e)&&(t=e);return{channel:t,language:n}})):"urn:scte:dash:cc:cea-708:2015"===r.schemeIdUri?("string"!=typeof r.value?[]:r.value.split(";")).map((function(e){var t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){var n=e.split("="),i=n[0],r=n[1],a=void 0===r?"":r;t.channel=i,t.language=e,a.split(",").forEach((function(e){var n=e.split(":"),i=n[0],r=n[1];"lang"===i?t.language=r:"er"===i?t.easyReader=Number(r):"war"===i?t.aspectRatio=Number(r):"3D"===i&&(t["3D"]=Number(r))}))}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t})):void 0;d&&(l=Rn(l,{captionServices:d}));var h=ci(i,"Label")[0];if(h&&h.childNodes.length){var p=h.childNodes[0].nodeValue.trim();l=Rn(l,{label:p})}var f=ci(i,"ContentProtection").reduce((function(e,t){var n=fi(t),i=mi[n.schemeIdUri];if(i){e[i]={attributes:n};var r=ci(t,"cenc:pssh")[0];if(r){var a=di(r),s=a&&we(a);e[i].pssh=s}}return e}),{});Object.keys(f).length&&(l=Rn(l,{contentProtection:f}));var m=vi(i),g=ci(i,"Representation"),v=Rn(n,m);return Dn(g.map(function(e,t,n){return function(i){var r=ci(i,"BaseURL"),a=gi(t,r),s=Rn(e,fi(i)),o=vi(i);return a.map((function(e){return{segmentInfo:Rn(n,o),attributes:Rn(s,{baseUrl:e})}}))}}(l,s,v)))}},_i=function(e,t){return function(n,i){var r=gi(t,ci(n.node,"BaseURL")),a=parseInt(n.attributes.id,10),s=C.isNaN(a)?i:a,o=Rn(e,{periodIndex:s,periodStart:n.attributes.start});"number"==typeof n.attributes.duration&&(o.periodDuration=n.attributes.duration);var u=ci(n.node,"AdaptationSet"),l=vi(n.node);return Dn(u.map(yi(o,r,l)))}},bi=function(e){if(""===e)throw new Error(Un);var t,n,i=new On;try{n=(t=i.parseFromString(e,"application/xml"))&&"MPD"===t.documentElement.tagName?t.documentElement:null}catch(e){}if(!n||n&&n.getElementsByTagName("parsererror").length>0)throw new Error(Bn);return n},Ti=function(e,t){void 0===t&&(t={});var n=function(e,t){void 0===t&&(t={});var n=t,i=n.manifestUri,r=void 0===i?"":i,a=n.NOW,s=void 0===a?Date.now():a,o=n.clientOffset,u=void 0===o?0:o,l=ci(e,"Period");if(!l.length)throw new Error(Nn);var c=ci(e,"Location"),d=fi(e),h=gi([r],ci(e,"BaseURL"));d.type=d.type||"static",d.sourceDuration=d.mediaPresentationDuration||0,d.NOW=s,d.clientOffset=u,c.length&&(d.locations=c.map(di));var p=[];return l.forEach((function(e,t){var n=fi(e),i=p[t-1];n.start=function(e){var t=e.attributes,n=e.priorPeriodAttributes,i=e.mpdType;return"number"==typeof t.start?t.start:n&&"number"==typeof n.start&&"number"==typeof n.duration?n.start+n.duration:n||"static"!==i?null:0}({attributes:n,priorPeriodAttributes:i?i.attributes:null,mpdType:d.type}),p.push({node:e,attributes:n})})),{locations:d.locations,representationInfo:Dn(p.map(_i(d,h)))}}(bi(e),t),i=n.representationInfo.map(li);return ni(i,n.locations,t.sidxMapping)},ki=function(e){return function(e){var t=ci(e,"UTCTiming")[0];if(!t)return null;var n=fi(t);switch(n.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":n.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":n.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":n.method="DIRECT",n.value=Date.parse(n.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(Hn)}return n}(bi(e))},Si=Math.pow(2,32),Ei=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},i=12;0===n.version?(n.earliestPresentationTime=t.getUint32(i),n.firstOffset=t.getUint32(i+4),i+=8):(n.earliestPresentationTime=t.getUint32(i)*Si+t.getUint32(i+4),n.firstOffset=t.getUint32(i+8)*Si+t.getUint32(i+12),i+=16),i+=2;var r=t.getUint16(i);for(i+=2;r>0;i+=12,r--)n.references.push({referenceType:(128&e[i])>>>7,referencedSize:2147483647&t.getUint32(i),subsegmentDuration:t.getUint32(i+4),startsWithSap:!!(128&e[i+8]),sapType:(112&e[i+8])>>>4,sapDeltaTime:268435455&t.getUint32(i+8)});return n},Ci=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||(t=e,ArrayBuffer.isView(t))||e instanceof ArrayBuffer||(e="number"!=typeof e||"number"==typeof e&&e!=e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0));var t},wi=C.BigInt||Number,Ii=[wi("0x1"),wi("0x100"),wi("0x10000"),wi("0x1000000"),wi("0x100000000"),wi("0x10000000000"),wi("0x1000000000000"),wi("0x100000000000000"),wi("0x10000000000000000")],Pi=function(e,t){var n=void 0===t?{}:t,i=n.signed,r=void 0!==i&&i,a=n.le,s=void 0!==a&&a;e=Ci(e);var o=s?"reduce":"reduceRight",u=(e[o]?e[o]:Array.prototype[o]).call(e,(function(t,n,i){var r=s?i:Math.abs(i+1-e.length);return t+wi(n)*Ii[r]}),wi(0));if(r){var l=Ii[e.length]/wi(2)-wi(1);(u=wi(u))>l&&(u-=l,u-=l,u-=wi(2))}return Number(u)},xi=function(e,t){var n=(void 0===t?{}:t).le,i=void 0!==n&&n;("bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!=e)&&(e=0);for(var r=function(e){return Math.ceil(function(e){return e.toString(2).length}(e)/8)}(e=wi(e)),a=new Uint8Array(new ArrayBuffer(r)),s=0;s<r;s++){var o=i?s:Math.abs(s+1-a.length);a[o]=Number(e/Ii[s]&wi(255)),e<0&&(a[o]=Math.abs(~a[o]),a[o]-=0===s?1:2)}return a},Ai=function(e,t){if("string"!=typeof e&&e&&"function"==typeof e.toString&&(e=e.toString()),"string"!=typeof e)return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var n=new Uint8Array(e.length),i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return n},Oi=function(e,t,n){var i=void 0===n?{}:n,r=i.offset,a=void 0===r?0:r,s=i.mask,o=void 0===s?[]:s;e=Ci(e);var u=(t=Ci(t)).every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&u.call(t,(function(t,n){return t===(o[n]?o[n]&e[a+n]:e[a+n])}))},Li=Ci([73,68,51]),Ri=function e(t,n){return void 0===n&&(n=0),(t=Ci(t)).length-n<10||!Oi(t,Li,{offset:n})?n:(n+=function(e,t){void 0===t&&(t=0);var n=(e=Ci(e))[t+5],i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&n)>>4?i+20:i+10}(t,n),e(t,n))},Di=function(e){return"string"==typeof e?Ai(e):e},Mi=function e(t,n,i){void 0===i&&(i=!1),n=function(e){return Array.isArray(e)?e.map((function(e){return Di(e)})):[Di(e)]}(n),t=Ci(t);var r=[];if(!n.length)return r;for(var a=0;a<t.length;){var s=(t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3])>>>0,o=t.subarray(a+4,a+8);if(0===s)break;var u=a+s;if(u>t.length){if(i)break;u=t.length}var l=t.subarray(a+8,u);Oi(o,n[0])&&(1===n.length?r.push(l):r.push.apply(r,e(l,n.slice(1),i))),a=u}return r},Ni={EBML:Ci([26,69,223,163]),DocType:Ci([66,130]),Segment:Ci([24,83,128,103]),SegmentInfo:Ci([21,73,169,102]),Tracks:Ci([22,84,174,107]),Track:Ci([174]),TrackNumber:Ci([215]),DefaultDuration:Ci([35,227,131]),TrackEntry:Ci([174]),TrackType:Ci([131]),FlagDefault:Ci([136]),CodecID:Ci([134]),CodecPrivate:Ci([99,162]),VideoTrack:Ci([224]),AudioTrack:Ci([225]),Cluster:Ci([31,67,182,117]),Timestamp:Ci([231]),TimestampScale:Ci([42,215,177]),BlockGroup:Ci([160]),BlockDuration:Ci([155]),Block:Ci([161]),SimpleBlock:Ci([163])},Ui=[128,64,32,16,8,4,2,1],Bi=function(e,t,n,i){void 0===n&&(n=!0),void 0===i&&(i=!1);var r=function(e){for(var t=1,n=0;n<Ui.length&&!(e&Ui[n]);n++)t++;return t}(e[t]),a=e.subarray(t,t+r);return n&&((a=Array.prototype.slice.call(e,t,t+r))[0]^=Ui[r-1]),{length:r,value:Pi(a,{signed:i}),bytes:a}},Fi=function e(t){return"string"==typeof t?t.match(/.{1,2}/g).map((function(t){return e(t)})):"number"==typeof t?xi(t):t},ji=function e(t,n,i){if(i>=n.length)return n.length;var r=Bi(n,i,!1);if(Oi(t.bytes,r.bytes))return i;var a=Bi(n,i+r.length);return e(t,n,i+a.length+a.value+r.length)},Hi=function e(t,n){n=function(e){return Array.isArray(e)?e.map((function(e){return Fi(e)})):[Fi(e)]}(n),t=Ci(t);var i=[];if(!n.length)return i;for(var r=0;r<t.length;){var a=Bi(t,r,!1),s=Bi(t,r+a.length),o=r+a.length+s.length;127===s.value&&(s.value=ji(a,t,o),s.value!==t.length&&(s.value-=o));var u=o+s.value>t.length?t.length:o+s.value,l=t.subarray(o,u);Oi(n[0],a.bytes)&&(1===n.length?i.push(l):i=i.concat(e(l,n.slice(1)))),r+=a.length+s.length+l.length}return i},Vi=Ci([0,0,0,1]),qi=Ci([0,0,1]),Wi=Ci([0,0,3]),zi=function(e){for(var t=[],n=1;n<e.length-2;)Oi(e.subarray(n,n+3),Wi)&&(t.push(n+2),n++),n++;if(0===t.length)return e;var i=e.length-t.length,r=new Uint8Array(i),a=0;for(n=0;n<i;a++,n++)a===t[0]&&(a++,t.shift()),r[n]=e[a];return r},Gi=function(e,t,n,i){void 0===i&&(i=1/0),e=Ci(e),n=[].concat(n);for(var r,a=0,s=0;a<e.length&&(s<i||r);){var o=void 0;if(Oi(e.subarray(a),Vi)?o=4:Oi(e.subarray(a),qi)&&(o=3),o){if(s++,r)return zi(e.subarray(r,a));var u=void 0;"h264"===t?u=31&e[a+o]:"h265"===t&&(u=e[a+o]>>1&63),-1!==n.indexOf(u)&&(r=a+o),a+=o+("h264"===t?1:2)}else a++}return e.subarray(0,0)},Ki={webm:Ci([119,101,98,109]),matroska:Ci([109,97,116,114,111,115,107,97]),flac:Ci([102,76,97,67]),ogg:Ci([79,103,103,83]),ac3:Ci([11,119]),riff:Ci([82,73,70,70]),avi:Ci([65,86,73]),wav:Ci([87,65,86,69]),"3gp":Ci([102,116,121,112,51,103]),mp4:Ci([102,116,121,112]),fmp4:Ci([115,116,121,112]),mov:Ci([102,116,121,112,113,116]),moov:Ci([109,111,111,118]),moof:Ci([109,111,111,102])},Xi={aac:function(e){var t=Ri(e);return Oi(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Ri(e);return Oi(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=Hi(e,[Ni.EBML,Ni.DocType])[0];return Oi(t,Ki.webm)},mkv:function(e){var t=Hi(e,[Ni.EBML,Ni.DocType])[0];return Oi(t,Ki.matroska)},mp4:function(e){return!Xi["3gp"](e)&&!Xi.mov(e)&&(!(!Oi(e,Ki.mp4,{offset:4})&&!Oi(e,Ki.fmp4,{offset:4}))||(!(!Oi(e,Ki.moof,{offset:4})&&!Oi(e,Ki.moov,{offset:4}))||void 0))},mov:function(e){return Oi(e,Ki.mov,{offset:4})},"3gp":function(e){return Oi(e,Ki["3gp"],{offset:4})},ac3:function(e){var t=Ri(e);return Oi(e,Ki.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];for(var t=0;t+188<e.length&&t<188;){if(71===e[t]&&71===e[t+188])return!0;t+=1}return!1},flac:function(e){var t=Ri(e);return Oi(e,Ki.flac,{offset:t})},ogg:function(e){return Oi(e,Ki.ogg)},avi:function(e){return Oi(e,Ki.riff)&&Oi(e,Ki.avi,{offset:8})},wav:function(e){return Oi(e,Ki.riff)&&Oi(e,Ki.wav,{offset:8})},h264:function(e){return function(e,t,n){return Gi(e,"h264",t,n)}(e,7,3).length},h265:function(e){return function(e,t,n){return Gi(e,"h265",t,n)}(e,[32,33],3).length}},Qi=Object.keys(Xi).filter((function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e})).concat(["ts","h264","h265"]);Qi.forEach((function(e){var t=Xi[e];Xi[e]=function(e){return t(Ci(e))}}));var Yi,$i,Ji,Zi,er=Xi,tr=function(e){e=Ci(e);for(var t=0;t<Qi.length;t++){var n=Qi[t];if(er[n](e))return n}return""};Yi=function(e){return 9e4*e},$i=function(e,t){return e*t},Ji=function(e){return e/9e4},Zi=function(e,t){return e/t};for(var nr,ir=9e4,rr={},ar=function(e,t){return rr[e]=rr[e]||[],t&&(rr[e]=rr[e].concat(t)),rr[e]},sr=function(e,t){var n=ar(e).indexOf(t);return!(n<=-1)&&(rr[e]=rr[e].slice(),rr[e].splice(n,1),!0)},or={prefixed:!0},ur=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],lr=ur[0],cr=0;cr<ur.length;cr++)if(ur[cr][1]in P){nr=ur[cr];break}if(nr){for(var dr=0;dr<nr.length;dr++)or[lr[dr]]=nr[dr];or.prefixed=nr[0]!==lr[0]}var hr=[];var pr=function e(t){var n,i="info",r=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n("log",i,t)};return n=function(e,t){return function(n,i,r){var a=t.levels[i],s=new RegExp("^("+a+")$");if("log"!==n&&r.unshift(n.toUpperCase()+":"),r.unshift(e+":"),hr){hr.push([].concat(r));var o=hr.length-1e3;hr.splice(0,o>0?o:0)}if(C.console){var u=C.console[n];u||"debug"!==n||(u=C.console.info||C.console.log),u&&a&&s.test(n)&&u[Array.isArray(r)?"apply":"call"](C.console,r)}}}(t,r),r.createLogger=function(n){return e(t+": "+n)},r.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:i},r.level=function(e){if("string"==typeof e){if(!r.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');i=e}return i},(r.history=function(){return hr?[].concat(hr):[]}).filter=function(e){return(hr||[]).filter((function(t){return new RegExp(".*"+e+".*").test(t[0])}))},r.history.clear=function(){hr&&(hr.length=0)},r.history.disable=function(){null!==hr&&(hr.length=0,hr=null)},r.history.enable=function(){null===hr&&(hr=[])},r.error=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n("error",i,t)},r.warn=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n("warn",i,t)},r.debug=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n("debug",i,t)},r}("VIDEOJS"),fr=pr.createLogger,mr=Object.prototype.toString,gr=function(e){return _r(e)?Object.keys(e):[]};function vr(e,t){gr(e).forEach((function(n){return t(e[n],n)}))}function yr(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return Object.assign?A.apply(void 0,[e].concat(n)):(n.forEach((function(t){t&&vr(t,(function(t,n){e[n]=t}))})),e)}function _r(e){return!!e&&"object"===_typeof2(e)}function br(e){return _r(e)&&"[object Object]"===mr.call(e)&&e.constructor===Object}function Tr(e,t){if(!e||!t)return"";if("function"==typeof C.getComputedStyle){var n;try{n=C.getComputedStyle(e)}catch(e){return""}return n?n.getPropertyValue(t)||n[t]:""}return""}var kr,Sr=C.navigator&&C.navigator.userAgent||"",Er=/AppleWebKit\/([\d.]+)/i.exec(Sr),Cr=Er?parseFloat(Er.pop()):null,wr=/iPod/i.test(Sr),Ir=(kr=Sr.match(/OS (\d+)_/i))&&kr[1]?kr[1]:null,Pr=/Android/i.test(Sr),xr=function(){var e=Sr.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),n=e[2]&&parseFloat(e[2]);return t&&n?parseFloat(e[1]+"."+e[2]):t||null}(),Ar=Pr&&xr<5&&Cr<537,Or=/Firefox/i.test(Sr),Lr=/Edg/i.test(Sr),Rr=!Lr&&(/Chrome/i.test(Sr)||/CriOS/i.test(Sr)),Dr=function(){var e=Sr.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Mr=function(){var e=/MSIE\s(\d+)\.\d/.exec(Sr),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(Sr)&&/rv:11.0/.test(Sr)&&(t=11),t}(),Nr=/Safari/i.test(Sr)&&!Rr&&!Pr&&!Lr,Ur=/Windows/i.test(Sr),Br=Boolean(Gr()&&("ontouchstart"in C||C.navigator.maxTouchPoints||C.DocumentTouch&&C.document instanceof C.DocumentTouch)),Fr=/iPad/i.test(Sr)||Nr&&Br&&!/iPhone/i.test(Sr),jr=/iPhone/i.test(Sr)&&!Fr,Hr=jr||Fr||wr,Vr=(Nr||Hr)&&!Rr,qr=Object.freeze({__proto__:null,IS_IPOD:wr,IOS_VERSION:Ir,IS_ANDROID:Pr,ANDROID_VERSION:xr,IS_NATIVE_ANDROID:Ar,IS_FIREFOX:Or,IS_EDGE:Lr,IS_CHROME:Rr,CHROME_VERSION:Dr,IE_VERSION:Mr,IS_SAFARI:Nr,IS_WINDOWS:Ur,TOUCH_ENABLED:Br,IS_IPAD:Fr,IS_IPHONE:jr,IS_IOS:Hr,IS_ANY_SAFARI:Vr});function Wr(e){return"string"==typeof e&&Boolean(e.trim())}function zr(e){if(e.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function Gr(){return P===C.document}function Kr(e){return _r(e)&&1===e.nodeType}function Xr(){try{return C.parent!==C.self}catch(e){return!0}}function Qr(e){return function(t,n){if(!Wr(t))return P[e](null);Wr(n)&&(n=P.querySelector(n));var i=Kr(n)?n:P;return i[e]&&i[e](t)}}function Yr(e,t,n,i){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===n&&(n={});var r=P.createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){var n=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(pr.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+e+" to "+n+"."),r.setAttribute(e,n)):"textContent"===e?$r(r,n):r[e]===n&&"tabIndex"!==e||(r[e]=n)})),Object.getOwnPropertyNames(n).forEach((function(e){r.setAttribute(e,n[e])})),i&&ga(r,i),r}function $r(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function Jr(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function Zr(e,t){return zr(t),e.classList?e.classList.contains(t):(n=t,new RegExp("(^|\\s)"+n+"($|\\s)")).test(e.className);var n}function ea(e,t){return e.classList?e.classList.add(t):Zr(e,t)||(e.className=(e.className+" "+t).trim()),e}function ta(e,t){return e?(e.classList?e.classList.remove(t):(zr(t),e.className=e.className.split(/\s+/).filter((function(e){return e!==t})).join(" ")),e):(pr.warn("removeClass was called with an element that doesn't exist"),null)}function na(e,t,n){var i=Zr(e,t);if("function"==typeof n&&(n=n(e,t)),"boolean"!=typeof n&&(n=!i),n!==i)return n?ea(e,t):ta(e,t),e}function ia(e,t){Object.getOwnPropertyNames(t).forEach((function(n){var i=t[n];null==i||!1===i?e.removeAttribute(n):e.setAttribute(n,!0===i?"":i)}))}function ra(e){var t={},n=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&e.attributes.length>0)for(var i=e.attributes,r=i.length-1;r>=0;r--){var a=i[r].name,s=i[r].value;"boolean"!=typeof e[a]&&-1===n.indexOf(","+a+",")||(s=null!==s),t[a]=s}return t}function aa(e,t){return e.getAttribute(t)}function sa(e,t,n){e.setAttribute(t,n)}function oa(e,t){e.removeAttribute(t)}function ua(){P.body.focus(),P.onselectstart=function(){return!1}}function la(){P.onselectstart=function(){return!0}}function ca(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),n={};return["bottom","height","left","right","top","width"].forEach((function(e){void 0!==t[e]&&(n[e]=t[e])})),n.height||(n.height=parseFloat(Tr(e,"height"))),n.width||(n.width=parseFloat(Tr(e,"width"))),n}}function da(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};for(var t=e.offsetWidth,n=e.offsetHeight,i=0,r=0;e.offsetParent&&e!==P[or.fullscreenElement];)i+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;return{left:i,top:r,width:t,height:n}}function ha(e,t){var n={x:0,y:0};if(Hr)for(var i=e;i&&"html"!==i.nodeName.toLowerCase();){var r=Tr(i,"transform");if(/^matrix/.test(r)){var a=r.slice(7,-1).split(/,\s/).map(Number);n.x+=a[4],n.y+=a[5]}else if(/^matrix3d/.test(r)){var s=r.slice(9,-1).split(/,\s/).map(Number);n.x+=s[12],n.y+=s[13]}i=i.parentNode}var o={},u=da(t.target),l=da(e),c=l.width,d=l.height,h=t.offsetY-(l.top-u.top),p=t.offsetX-(l.left-u.left);return t.changedTouches&&(p=t.changedTouches[0].pageX-l.left,h=t.changedTouches[0].pageY+l.top,Hr&&(p-=n.x,h-=n.y)),o.y=1-Math.max(0,Math.min(1,h/d)),o.x=Math.max(0,Math.min(1,p/c)),o}function pa(e){return _r(e)&&3===e.nodeType}function fa(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function ma(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((function(e){return"function"==typeof e&&(e=e()),Kr(e)||pa(e)?e:"string"==typeof e&&/\S/.test(e)?P.createTextNode(e):void 0})).filter((function(e){return e}))}function ga(e,t){return ma(t).forEach((function(t){return e.appendChild(t)})),e}function va(e,t){return ga(fa(e),t)}function ya(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||("mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons))}var _a,ba=Qr("querySelector"),Ta=Qr("querySelectorAll"),ka=Object.freeze({__proto__:null,isReal:Gr,isEl:Kr,isInFrame:Xr,createEl:Yr,textContent:$r,prependTo:Jr,hasClass:Zr,addClass:ea,removeClass:ta,toggleClass:na,setAttributes:ia,getAttributes:ra,getAttribute:aa,setAttribute:sa,removeAttribute:oa,blockTextSelection:ua,unblockTextSelection:la,getBoundingClientRect:ca,findPosition:da,getPointerPosition:ha,isTextNode:pa,emptyEl:fa,normalizeContent:ma,appendContent:ga,insertContent:va,isSingleLeftClick:ya,$:ba,$$:Ta}),Sa=!1,Ea=function(){if(!1!==_a.options.autoSetup){var e=Array.prototype.slice.call(P.getElementsByTagName("video")),t=Array.prototype.slice.call(P.getElementsByTagName("audio")),n=Array.prototype.slice.call(P.getElementsByTagName("video-js")),i=e.concat(t,n);if(i&&i.length>0)for(var r=0,a=i.length;r<a;r++){var s=i[r];if(!s||!s.getAttribute){Ca(1);break}void 0===s.player&&null!==s.getAttribute("data-setup")&&_a(s)}else Sa||Ca(1)}};function Ca(e,t){Gr()&&(t&&(_a=t),C.setTimeout(Ea,e))}function wa(){Sa=!0,C.removeEventListener("load",wa)}Gr()&&("complete"===P.readyState?wa():C.addEventListener("load",wa));var Ia,Pa=function(e){var t=P.createElement("style");return t.className=e,t},xa=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t},Aa=3;function Oa(){return Aa++}C.WeakMap||(Ia=function(){function e(){this.vdata="vdata"+Math.floor(C.performance&&C.performance.now()||Date.now()),this.data={}}var t=e.prototype;return t.set=function(e,t){var n=e[this.vdata]||Oa();return e[this.vdata]||(e[this.vdata]=n),this.data[n]=t,this},t.get=function(e){var t=e[this.vdata];if(t)return this.data[t];pr("We have no data for this element",e)},t.has=function(e){return e[this.vdata]in this.data},t.delete=function(e){var t=e[this.vdata];t&&(delete this.data[t],delete e[this.vdata])},e}());var La,Ra=C.WeakMap?new WeakMap:new Ia;function Da(e,t){if(Ra.has(e)){var n=Ra.get(e);0===n.handlers[t].length&&(delete n.handlers[t],e.removeEventListener?e.removeEventListener(t,n.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,n.dispatcher)),Object.getOwnPropertyNames(n.handlers).length<=0&&(delete n.handlers,delete n.dispatcher,delete n.disabled),0===Object.getOwnPropertyNames(n).length&&Ra.delete(e)}}function Ma(e,t,n,i){n.forEach((function(n){e(t,n,i)}))}function Na(e){if(e.fixed_)return e;function t(){return!0}function n(){return!1}if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){var i=e||C.event;for(var r in e={},i)"layerX"!==r&&"layerY"!==r&&"keyLocation"!==r&&"webkitMovementX"!==r&&"webkitMovementY"!==r&&("returnValue"===r&&i.preventDefault||(e[r]=i[r]));if(e.target||(e.target=e.srcElement||P),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){i.preventDefault&&i.preventDefault(),e.returnValue=!1,i.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){i.stopPropagation&&i.stopPropagation(),e.cancelBubble=!0,i.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=n,e.stopImmediatePropagation=function(){i.stopImmediatePropagation&&i.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=n,null!==e.clientX&&void 0!==e.clientX){var a=P.documentElement,s=P.body;e.pageX=e.clientX+(a&&a.scrollLeft||s&&s.scrollLeft||0)-(a&&a.clientLeft||s&&s.clientLeft||0),e.pageY=e.clientY+(a&&a.scrollTop||s&&s.scrollTop||0)-(a&&a.clientTop||s&&s.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e.fixed_=!0,e}var Ua=["touchstart","touchmove"];function Ba(e,t,n){if(Array.isArray(t))return Ma(Ba,e,t,n);Ra.has(e)||Ra.set(e,{});var i=Ra.get(e);if(i.handlers||(i.handlers={}),i.handlers[t]||(i.handlers[t]=[]),n.guid||(n.guid=Oa()),i.handlers[t].push(n),i.dispatcher||(i.disabled=!1,i.dispatcher=function(t,n){if(!i.disabled){t=Na(t);var r=i.handlers[t.type];if(r)for(var a=r.slice(0),s=0,o=a.length;s<o&&!t.isImmediatePropagationStopped();s++)try{a[s].call(e,t,n)}catch(e){pr.error(e)}}}),1===i.handlers[t].length)if(e.addEventListener){var r=!1;(function(){if("boolean"!=typeof La){La=!1;try{var e=Object.defineProperty({},"passive",{get:function(){La=!0}});C.addEventListener("test",null,e),C.removeEventListener("test",null,e)}catch(e){}}return La})()&&Ua.indexOf(t)>-1&&(r={passive:!0}),e.addEventListener(t,i.dispatcher,r)}else e.attachEvent&&e.attachEvent("on"+t,i.dispatcher)}function Fa(e,t,n){if(Ra.has(e)){var i=Ra.get(e);if(i.handlers){if(Array.isArray(t))return Ma(Fa,e,t,n);var r=function(e,t){i.handlers[t]=[],Da(e,t)};if(void 0!==t){var a=i.handlers[t];if(a)if(n){if(n.guid)for(var s=0;s<a.length;s++)a[s].guid===n.guid&&a.splice(s--,1);Da(e,t)}else r(e,t)}else for(var o in i.handlers)Object.prototype.hasOwnProperty.call(i.handlers||{},o)&&r(e,o)}}}function ja(e,t,n){var i=Ra.has(e)?Ra.get(e):{},r=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=Na(t),i.dispatcher&&i.dispatcher.call(e,t,n),r&&!t.isPropagationStopped()&&!0===t.bubbles)ja.call(null,r,t,n);else if(!r&&!t.defaultPrevented&&t.target&&t.target[t.type]){Ra.has(t.target)||Ra.set(t.target,{});var a=Ra.get(t.target);t.target[t.type]&&(a.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),a.disabled=!1)}return!t.defaultPrevented}function Ha(e,t,n){if(Array.isArray(t))return Ma(Ha,e,t,n);var i=function i(){Fa(e,t,i),n.apply(this,arguments)};i.guid=n.guid=n.guid||Oa(),Ba(e,t,i)}function Va(e,t,n){var i=function i(){Fa(e,t,i),n.apply(this,arguments)};i.guid=n.guid=n.guid||Oa(),Ba(e,t,i)}var qa,Wa=Object.freeze({__proto__:null,fixEvent:Na,on:Ba,off:Fa,trigger:ja,one:Ha,any:Va}),za=function(e,t,n){t.guid||(t.guid=Oa());var i=t.bind(e);return i.guid=n?n+"_"+t.guid:t.guid,i},Ga=function(e,t){var n=C.performance.now();return function(){var i=C.performance.now();i-n>=t&&(e.apply(void 0,arguments),n=i)}},Ka=function(){};Ka.prototype.allowedEvents_={},Ka.prototype.on=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},Ba(this,e,t),this.addEventListener=n},Ka.prototype.addEventListener=Ka.prototype.on,Ka.prototype.off=function(e,t){Fa(this,e,t)},Ka.prototype.removeEventListener=Ka.prototype.off,Ka.prototype.one=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},Ha(this,e,t),this.addEventListener=n},Ka.prototype.any=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},Va(this,e,t),this.addEventListener=n},Ka.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=Na(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),ja(this,e)},Ka.prototype.dispatchEvent=Ka.prototype.trigger,Ka.prototype.queueTrigger=function(e){var t=this;qa||(qa=new Map);var n=e.type||e,i=qa.get(this);i||(i=new Map,qa.set(this,i));var r=i.get(n);i.delete(n),C.clearTimeout(r);var a=C.setTimeout((function(){0===i.size&&(i=null,qa.delete(t)),t.trigger(e)}),0);i.set(n,a)};var Xa=function(e){return"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:_typeof2(e)},Qa=function(e){return e instanceof Ka||!!e.eventBusEl_&&["on","one","off","trigger"].every((function(t){return"function"==typeof e[t]}))},Ya=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},$a=function(e,t,n){if(!e||!e.nodeName&&!Qa(e))throw new Error("Invalid target for "+Xa(t)+"#"+n+"; must be a DOM node or evented object.")},Ja=function(e,t,n){if(!Ya(e))throw new Error("Invalid event type for "+Xa(t)+"#"+n+"; must be a non-empty string or array.")},Za=function(e,t,n){if("function"!=typeof e)throw new Error("Invalid listener for "+Xa(t)+"#"+n+"; must be a function.")},es=function(e,t,n){var i,r,a,s=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return s?(i=e.eventBusEl_,t.length>=3&&t.shift(),r=t[0],a=t[1]):(i=t[0],r=t[1],a=t[2]),$a(i,e,n),Ja(r,e,n),Za(a,e,n),{isTargetingSelf:s,target:i,type:r,listener:a=za(e,a)}},ts=function(e,t,n,i){$a(e,e,t),e.nodeName?Wa[t](e,n,i):e[t](n,i)},ns={on:function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var r=es(this,n,"on"),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;if(ts(s,"on",o,u),!a){var l=function(){return e.off(s,o,u)};l.guid=u.guid;var c=function(){return e.off("dispose",l)};c.guid=u.guid,ts(this,"on","dispose",l),ts(s,"on","dispose",c)}},one:function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var r=es(this,n,"one"),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;if(a)ts(s,"one",o,u);else{var l=function t(){e.off(s,o,t);for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];u.apply(null,i)};l.guid=u.guid,ts(s,"one",o,l)}},any:function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var r=es(this,n,"any"),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;if(a)ts(s,"any",o,u);else{var l=function t(){e.off(s,o,t);for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];u.apply(null,i)};l.guid=u.guid,ts(s,"any",o,l)}},off:function(e,t,n){if(!e||Ya(e))Fa(this.eventBusEl_,e,t);else{var i=e,r=t;$a(i,this,"off"),Ja(r,this,"off"),Za(n,this,"off"),n=za(this,n),this.off("dispose",n),i.nodeName?(Fa(i,r,n),Fa(i,"dispose",n)):Qa(i)&&(i.off(r,n),i.off("dispose",n))}},trigger:function(e,t){$a(this.eventBusEl_,this,"trigger");var n=e&&"string"!=typeof e?e.type:e;if(!Ya(n)){var i="Invalid event type for "+Xa(this)+"#trigger; must be a non-empty string or object with a type key that has a non-empty value.";if(!e)throw new Error(i);(this.log||pr).error(i)}return ja(this.eventBusEl_,e,t)}};function is(e,t){void 0===t&&(t={});var n=t.eventBusKey;if(n){if(!e[n].nodeName)throw new Error('The eventBusKey "'+n+'" does not refer to an element.');e.eventBusEl_=e[n]}else e.eventBusEl_=Yr("span",{className:"vjs-event-bus"});return yr(e,ns),e.eventedCallbacks&&e.eventedCallbacks.forEach((function(e){e()})),e.on("dispose",(function(){e.off(),[e,e.el_,e.eventBusEl_].forEach((function(e){e&&Ra.has(e)&&Ra.delete(e)})),C.setTimeout((function(){e.eventBusEl_=null}),0)})),e}var rs={state:{},setState:function(e){var t,n=this;return"function"==typeof e&&(e=e()),vr(e,(function(e,i){n.state[i]!==e&&((t=t||{})[i]={from:n.state[i],to:e}),n.state[i]=e})),t&&Qa(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function as(e,t){return yr(e,rs),e.state=yr({},e.state,t),"function"==typeof e.handleStateChanged&&Qa(e)&&e.on("statechanged",e.handleStateChanged),e}var ss=function(e){return"string"!=typeof e?e:e.replace(/./,(function(e){return e.toLowerCase()}))},os=function(e){return"string"!=typeof e?e:e.replace(/./,(function(e){return e.toUpperCase()}))};function us(){for(var e={},t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return n.forEach((function(t){t&&vr(t,(function(t,n){br(t)?(br(e[n])||(e[n]={}),e[n]=us(e[n],t)):e[n]=t}))})),e}var ls=function(){function e(){this.map_={}}var t=e.prototype;return t.has=function(e){return e in this.map_},t.delete=function(e){var t=this.has(e);return delete this.map_[e],t},t.set=function(e,t){return this.map_[e]=t,this},t.forEach=function(e,t){for(var n in this.map_)e.call(t,this.map_[n],n,this)},e}(),cs=C.Map?C.Map:ls,ds=function(){function e(){this.set_={}}var t=e.prototype;return t.has=function(e){return e in this.set_},t.delete=function(e){var t=this.has(e);return delete this.set_[e],t},t.add=function(e){return this.set_[e]=1,this},t.forEach=function(e,t){for(var n in this.set_)e.call(t,n,n,this)},e}(),hs=C.Set?C.Set:ds,ps=function(){function e(e,t,n){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=us({},this.options_),t=this.options_=us(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){var i=e&&e.id&&e.id()||"no_player";this.id_=i+"_component_"+Oa()}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),!1!==t.evented&&(is(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),as(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new hs,this.setIntervalIds_=new hs,this.rafIds_=new hs,this.namedRafs_=new cs,this.clearingTimersOnDispose_=!1,!1!==t.initChildren&&this.initChildren(),this.ready(n),!1!==t.reportTouchActivity&&this.enableTouchActivity()}var t=e.prototype;return t.dispose=function(){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(var e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),this.el_=null),this.player_=null}},t.isDisposed=function(){return Boolean(this.isDisposed_)},t.player=function(){return this.player_},t.options=function(e){return e?(this.options_=us(this.options_,e),this.options_):this.options_},t.el=function(){return this.el_},t.createEl=function(e,t,n){return Yr(e,t,n)},t.localize=function(e,t,n){void 0===n&&(n=e);var i=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),a=r&&r[i],s=i&&i.split("-")[0],o=r&&r[s],u=n;return a&&a[e]?u=a[e]:o&&o[e]&&(u=o[e]),t&&(u=u.replace(/\{(\d+)\}/g,(function(e,n){var i=t[n-1],r=i;return void 0===i&&(r=e),r}))),u},t.handleLanguagechange=function(){},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(e){return this.childIndex_[e]},t.getChild=function(e){if(e)return this.childNameIndex_[e]},t.getDescendant=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t=t.reduce((function(e,t){return e.concat(t)}),[]);for(var i=this,r=0;r<t.length;r++)if(!(i=i.getChild(t[r]))||!i.getChild)return;return i},t.addChild=function(t,n,i){var r,a;if(void 0===n&&(n={}),void 0===i&&(i=this.children_.length),"string"==typeof t){a=os(t);var s=n.componentClass||a;n.name=a;var o=e.getComponent(s);if(!o)throw new Error("Component "+s+" does not exist");if("function"!=typeof o)return null;r=new o(this.player_||this,n)}else r=t;if(r.parentComponent_&&r.parentComponent_.removeChild(r),this.children_.splice(i,0,r),r.parentComponent_=this,"function"==typeof r.id&&(this.childIndex_[r.id()]=r),(a=a||r.name&&os(r.name()))&&(this.childNameIndex_[a]=r,this.childNameIndex_[ss(a)]=r),"function"==typeof r.el&&r.el()){var u=null;this.children_[i+1]&&(this.children_[i+1].el_?u=this.children_[i+1].el_:Kr(this.children_[i+1])&&(u=this.children_[i+1])),this.contentEl().insertBefore(r.el(),u)}return r},t.removeChild=function(e){if("string"==typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,n=this.children_.length-1;n>=0;n--)if(this.children_[n]===e){t=!0,this.children_.splice(n,1);break}if(t){e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[os(e.name())]=null,this.childNameIndex_[ss(e.name())]=null;var i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},t.initChildren=function(){var t=this,n=this.options_.children;if(n){var i,r=this.options_,a=e.getComponent("Tech");(i=Array.isArray(n)?n:Object.keys(n)).concat(Object.keys(this.options_).filter((function(e){return!i.some((function(t){return"string"==typeof t?e===t:e===t.name}))}))).map((function(e){var i,r;return"string"==typeof e?r=n[i=e]||t.options_[i]||{}:(i=e.name,r=e),{name:i,opts:r}})).filter((function(t){var n=e.getComponent(t.opts.componentClass||os(t.name));return n&&!a.isTech(n)})).forEach((function(e){var n=e.name,i=e.opts;if(void 0!==r[n]&&(i=r[n]),!1!==i){!0===i&&(i={}),i.playerOptions=t.options_.playerOptions;var a=t.addChild(n,i);a&&(t[n]=a)}}))}},t.buildCSSClass=function(){return""},t.ready=function(e,t){if(void 0===t&&(t=!1),e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},t.triggerReady=function(){this.isReady_=!0,this.setTimeout((function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)},t.$=function(e,t){return ba(e,t||this.contentEl())},t.$$=function(e,t){return Ta(e,t||this.contentEl())},t.hasClass=function(e){return Zr(this.el_,e)},t.addClass=function(e){ea(this.el_,e)},t.removeClass=function(e){ta(this.el_,e)},t.toggleClass=function(e,t){na(this.el_,e,t)},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(e){return aa(this.el_,e)},t.setAttribute=function(e,t){sa(this.el_,e,t)},t.removeAttribute=function(e){oa(this.el_,e)},t.width=function(e,t){return this.dimension("width",e,t)},t.height=function(e,t){return this.dimension("height",e,t)},t.dimensions=function(e,t){this.width(e,!0),this.height(t)},t.dimension=function(e,t,n){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(n||this.trigger("componentresize"));if(!this.el_)return 0;var i=this.el_.style[e],r=i.indexOf("px");return-1!==r?parseInt(i.slice(0,r),10):parseInt(this.el_["offset"+os(e)],10)},t.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=Tr(this.el_,e),0===(t=parseFloat(t))||isNaN(t)){var n="offset"+os(e);t=this.el_[n]}return t},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.handleKeyDown=function(e){this.player_&&(e.stopPropagation(),this.player_.handleKeyDown(e))},t.handleKeyPress=function(e){this.handleKeyDown(e)},t.emitTapEvents=function(){var e,t=0,n=null;this.on("touchstart",(function(i){1===i.touches.length&&(n={pageX:i.touches[0].pageX,pageY:i.touches[0].pageY},t=C.performance.now(),e=!0)})),this.on("touchmove",(function(t){if(t.touches.length>1)e=!1;else if(n){var i=t.touches[0].pageX-n.pageX,r=t.touches[0].pageY-n.pageY;Math.sqrt(i*i+r*r)>10&&(e=!1)}}));var i=function(){e=!1};this.on("touchleave",i),this.on("touchcancel",i),this.on("touchend",(function(i){(n=null,!0===e)&&(C.performance.now()-t<200&&(i.preventDefault(),this.trigger("tap")))}))},t.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,t=za(this.player(),this.player().reportUserActivity);this.on("touchstart",(function(){t(),this.clearInterval(e),e=this.setInterval(t,250)}));var n=function(n){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",n),this.on("touchcancel",n)}},t.setTimeout=function(e,t){var n,i=this;return e=za(this,e),this.clearTimersOnDispose_(),n=C.setTimeout((function(){i.setTimeoutIds_.has(n)&&i.setTimeoutIds_.delete(n),e()}),t),this.setTimeoutIds_.add(n),n},t.clearTimeout=function(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),C.clearTimeout(e)),e},t.setInterval=function(e,t){e=za(this,e),this.clearTimersOnDispose_();var n=C.setInterval(e,t);return this.setIntervalIds_.add(n),n},t.clearInterval=function(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),C.clearInterval(e)),e},t.requestAnimationFrame=function(e){var t,n=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),e=za(this,e),t=C.requestAnimationFrame((function(){n.rafIds_.has(t)&&n.rafIds_.delete(t),e()})),this.rafIds_.add(t),t):this.setTimeout(e,1e3/60)},t.requestNamedAnimationFrame=function(e,t){var n=this;if(!this.namedRafs_.has(e)){this.clearTimersOnDispose_(),t=za(this,t);var i=this.requestAnimationFrame((function(){t(),n.namedRafs_.has(e)&&n.namedRafs_.delete(e)}));return this.namedRafs_.set(e,i),e}},t.cancelNamedAnimationFrame=function(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))},t.cancelAnimationFrame=function(e){return this.supportsRaf_?(this.rafIds_.has(e)&&(this.rafIds_.delete(e),C.cancelAnimationFrame(e)),e):this.clearTimeout(e)},t.clearTimersOnDispose_=function(){var e=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",(function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach((function(t){var n=t[0],i=t[1];e[n].forEach((function(t,n){return e[i](n)}))})),e.clearingTimersOnDispose_=!1})))},e.registerComponent=function(t,n){if("string"!=typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var i,r=e.getComponent("Tech"),a=r&&r.isTech(n),s=e===n||e.prototype.isPrototypeOf(n.prototype);if(a||!s)throw i=a?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+t+'"; '+i+".");t=os(t),e.components_||(e.components_={});var o=e.getComponent("Player");if("Player"===t&&o&&o.players){var u=o.players,l=Object.keys(u);if(u&&l.length>0&&l.map((function(e){return u[e]})).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=n,e.components_[ss(t)]=n,n},e.getComponent=function(t){if(t&&e.components_)return e.components_[t]},e}();function fs(e,t,n,i){return function(e,t,n){if("number"!=typeof t||t<0||t>n)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+n+").")}(e,i,n.length-1),n[i][t]}function ms(e){var t;return t=void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:fs.bind(null,"start",0,e),end:fs.bind(null,"end",1,e)},C.Symbol&&C.Symbol.iterator&&(t[C.Symbol.iterator]=function(){return(e||[]).values()}),t}function gs(e,t){return Array.isArray(e)?ms(e):void 0===e||void 0===t?ms():ms([[e,t]])}function vs(e,t){var n,i,r=0;if(!t)return 0;e&&e.length||(e=gs(0,0));for(var a=0;a<e.length;a++)n=e.start(a),(i=e.end(a))>t&&(i=t),r+=i-n;return r/t}function ys(e){if(e instanceof ys)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:_r(e)&&("number"==typeof e.code&&(this.code=e.code),yr(this,e)),this.message||(this.message=ys.defaultMessages[this.code]||"")}ps.prototype.supportsRaf_="function"==typeof C.requestAnimationFrame&&"function"==typeof C.cancelAnimationFrame,ps.registerComponent("Component",ps),ys.prototype.code=0,ys.prototype.message="",ys.prototype.status=null,ys.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],ys.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 _s=0;_s<ys.errorTypes.length;_s++)ys[ys.errorTypes[_s]]=_s,ys.prototype[ys.errorTypes[_s]]=_s;function bs(e){return null!=e&&"function"==typeof e.then}function Ts(e){bs(e)&&e.then(null,(function(e){}))}var ks=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((function(t,n,i){return e[n]&&(t[n]=e[n]),t}),{cues:e.cues&&Array.prototype.map.call(e.cues,(function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}}))})},Ss=function(e){var t=e.$$("track"),n=Array.prototype.map.call(t,(function(e){return e.track}));return Array.prototype.map.call(t,(function(e){var t=ks(e.track);return e.src&&(t.src=e.src),t})).concat(Array.prototype.filter.call(e.textTracks(),(function(e){return-1===n.indexOf(e)})).map(ks))},Es=function(e,t){return e.forEach((function(e){var n=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach((function(e){return n.addCue(e)}))})),t.textTracks()},Cs=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).handleKeyDown_=function(e){return i.handleKeyDown(e)},i.close_=function(e){return i.close(e)},i.opened_=i.hasBeenOpened_=i.hasBeenFilled_=!1,i.closeable(!i.options_.uncloseable),i.content(i.options_.content),i.contentEl_=Yr("div",{className:"vjs-modal-dialog-content"},{role:"document"}),i.descEl_=Yr("p",{className:"vjs-modal-dialog-description vjs-control-text",id:i.el().getAttribute("aria-describedby")}),$r(i.descEl_,i.description()),i.el_.appendChild(i.descEl_),i.el_.appendChild(i.contentEl_),i}R(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},n.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,e.prototype.dispose.call(this)},n.buildCSSClass=function(){return"vjs-modal-dialog vjs-hidden "+e.prototype.buildCSSClass.call(this)},n.label=function(){return this.localize(this.options_.label||"Modal Window")},n.description=function(){var e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e},n.open=function(){if(!this.opened_){var e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},n.opened=function(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_},n.close=function(){if(this.opened_){var e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},n.closeable=function(e){if("boolean"==typeof e){var t=this.closeable_=!!e,n=this.getChild("closeButton");if(t&&!n){var i=this.contentEl_;this.contentEl_=this.el_,n=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=i,this.on(n,"close",this.close_)}!t&&n&&(this.off(n,"close",this.close_),this.removeChild(n),n.dispose())}return this.closeable_},n.fill=function(){this.fillWith(this.content())},n.fillWith=function(e){var t=this.contentEl(),n=t.parentNode,i=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,n.removeChild(t),this.empty(),va(t,e),this.trigger("modalfill"),i?n.insertBefore(t,i):n.appendChild(t);var r=this.getChild("closeButton");r&&n.appendChild(r.el_)},n.empty=function(){this.trigger("beforemodalempty"),fa(this.contentEl()),this.trigger("modalempty")},n.content=function(e){return void 0!==e&&(this.content_=e),this.content_},n.conditionalFocus_=function(){var e=P.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())},n.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)},n.handleKeyDown=function(e){if(e.stopPropagation(),M.isEventKey(e,"Escape")&&this.closeable())return e.preventDefault(),void this.close();if(M.isEventKey(e,"Tab")){for(var t,n=this.focusableEls_(),i=this.el_.querySelector(":focus"),r=0;r<n.length;r++)if(i===n[r]){t=r;break}P.activeElement===this.el_&&(t=0),e.shiftKey&&0===t?(n[n.length-1].focus(),e.preventDefault()):e.shiftKey||t!==n.length-1||(n[0].focus(),e.preventDefault())}},n.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,(function(e){return(e instanceof C.HTMLAnchorElement||e instanceof C.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof C.HTMLInputElement||e instanceof C.HTMLSelectElement||e instanceof C.HTMLTextAreaElement||e instanceof C.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof C.HTMLIFrameElement||e instanceof C.HTMLObjectElement||e instanceof C.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")}))},t}(ps);Cs.prototype.options_={pauseOnOpen:!0,temporary:!0},ps.registerComponent("ModalDialog",Cs);var ws=function(e){function t(t){var n;void 0===t&&(t=[]),(n=e.call(this)||this).tracks_=[],Object.defineProperty(O(n),"length",{get:function(){return this.tracks_.length}});for(var i=0;i<t.length;i++)n.addTrack(t[i]);return n}R(t,e);var n=t.prototype;return n.addTrack=function(e){var t=this,n=this.tracks_.length;""+n in this||Object.defineProperty(this,n,{get:function(){return this.tracks_[n]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=function(){t.trigger({track:e,type:"labelchange",target:t})},Qa(e)&&e.addEventListener("labelchange",e.labelchange_)},n.removeTrack=function(e){for(var t,n=0,i=this.length;n<i;n++)if(this[n]===e){(t=this[n]).off&&t.off(),this.tracks_.splice(n,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})},n.getTrackById=function(e){for(var t=null,n=0,i=this.length;n<i;n++){var r=this[n];if(r.id===e){t=r;break}}return t},t}(Ka);for(var Is in ws.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"},ws.prototype.allowedEvents_)ws.prototype["on"+Is]=null;var Ps=function(e,t){for(var n=0;n<e.length;n++)Object.keys(e[n]).length&&t.id!==e[n].id&&(e[n].enabled=!1)},xs=function(e){function t(t){var n;void 0===t&&(t=[]);for(var i=t.length-1;i>=0;i--)if(t[i].enabled){Ps(t,t[i]);break}return(n=e.call(this,t)||this).changing_=!1,n}R(t,e);var n=t.prototype;return n.addTrack=function(t){var n=this;t.enabled&&Ps(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.enabledChange_=function(){n.changing_||(n.changing_=!0,Ps(n,t),n.changing_=!1,n.trigger("change"))},t.addEventListener("enabledchange",t.enabledChange_))},n.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.enabledChange_&&(t.removeEventListener("enabledchange",t.enabledChange_),t.enabledChange_=null)},t}(ws),As=function(e,t){for(var n=0;n<e.length;n++)Object.keys(e[n]).length&&t.id!==e[n].id&&(e[n].selected=!1)},Os=function(e){function t(t){var n;void 0===t&&(t=[]);for(var i=t.length-1;i>=0;i--)if(t[i].selected){As(t,t[i]);break}return(n=e.call(this,t)||this).changing_=!1,Object.defineProperty(O(n),"selectedIndex",{get:function(){for(var e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set:function(){}}),n}R(t,e);var n=t.prototype;return n.addTrack=function(t){var n=this;t.selected&&As(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.selectedChange_=function(){n.changing_||(n.changing_=!0,As(n,t),n.changing_=!1,n.trigger("change"))},t.addEventListener("selectedchange",t.selectedChange_))},n.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.selectedChange_&&(t.removeEventListener("selectedchange",t.selectedChange_),t.selectedChange_=null)},t}(ws),Ls=function(e){function t(){return e.apply(this,arguments)||this}R(t,e);var n=t.prototype;return n.addTrack=function(t){var n=this;e.prototype.addTrack.call(this,t),this.queueChange_||(this.queueChange_=function(){return n.queueTrigger("change")}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return n.trigger("selectedlanguagechange")}),t.addEventListener("modechange",this.queueChange_);-1===["metadata","chapters"].indexOf(t.kind)&&t.addEventListener("modechange",this.triggerSelectedlanguagechange_)},n.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&(this.queueChange_&&t.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&t.removeEventListener("modechange",this.triggerSelectedlanguagechange_))},t}(ws),Rs=function(){function e(e){void 0===e&&(e=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var t=0,n=e.length;t<n;t++)this.addTrackElement_(e[t])}var t=e.prototype;return t.addTrackElement_=function(e){var t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)},t.getTrackElementByTrack_=function(e){for(var t,n=0,i=this.trackElements_.length;n<i;n++)if(e===this.trackElements_[n].track){t=this.trackElements_[n];break}return t},t.removeTrackElement_=function(e){for(var t=0,n=this.trackElements_.length;t<n;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&"function"==typeof this.trackElements_[t].track.off&&this.trackElements_[t].track.off(),"function"==typeof this.trackElements_[t].off&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}},e}(),Ds=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(e){var t=this.length||0,n=0,i=e.length;this.cues_=e,this.length_=e.length;var r=function(e){""+e in this||Object.defineProperty(this,""+e,{get:function(){return this.cues_[e]}})};if(t<i)for(n=t;n<i;n++)r.call(this,n)},t.getCueById=function(e){for(var t=null,n=0,i=this.length;n<i;n++){var r=this[n];if(r.id===e){t=r;break}}return t},e}(),Ms={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Ns={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Us={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Bs={disabled:"disabled",hidden:"hidden",showing:"showing"},Fs=function(e){function t(t){var n;void 0===t&&(t={}),n=e.call(this)||this;var i={id:t.id||"vjs_track_"+Oa(),kind:t.kind||"",language:t.language||""},r=t.label||"",a=function(e){Object.defineProperty(O(n),e,{get:function(){return i[e]},set:function(){}})};for(var s in i)a(s);return Object.defineProperty(O(n),"label",{get:function(){return r},set:function(e){e!==r&&(r=e,this.trigger("labelchange"))}}),n}return R(t,e),t}(Ka),js=function(e){var t=["protocol","hostname","port","pathname","search","hash","host"],n=P.createElement("a");n.href=e;for(var i={},r=0;r<t.length;r++)i[t[r]]=n[t[r]];return"http:"===i.protocol&&(i.host=i.host.replace(/:80$/,"")),"https:"===i.protocol&&(i.host=i.host.replace(/:443$/,"")),i.protocol||(i.protocol=C.location.protocol),i.host||(i.host=C.location.host),i},Hs=function(e){if(!e.match(/^https?:\/\//)){var t=P.createElement("a");t.href=e,e=t.href}return e},Vs=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(t)return t.pop().toLowerCase()}return""},qs=function(e,t){void 0===t&&(t=C.location);var n=js(e);return(":"===n.protocol?t.protocol:n.protocol)+n.host!==t.protocol+t.host},Ws=Object.freeze({__proto__:null,parseUrl:js,getAbsoluteURL:Hs,getFileExtension:Vs,isCrossOrigin:qs}),zs=function(e,t){var n=new C.WebVTT.Parser(C,C.vttjs,C.WebVTT.StringDecoder()),i=[];n.oncue=function(e){t.addCue(e)},n.onparsingerror=function(e){i.push(e)},n.onflush=function(){t.trigger({type:"loadeddata",target:t})},n.parse(e),i.length>0&&(C.console&&C.console.groupCollapsed&&C.console.groupCollapsed("Text Track parsing errors for "+t.src),i.forEach((function(e){return pr.error(e)})),C.console&&C.console.groupEnd&&C.console.groupEnd()),n.flush()},Gs=function(e,t){var n={uri:e},i=qs(e);i&&(n.cors=i);var r="use-credentials"===t.tech_.crossOrigin();r&&(n.withCredentials=r),F(n,za(this,(function(e,n,i){if(e)return pr.error(e,n);t.loaded_=!0,"function"!=typeof C.WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],(function(e){if("vttjserror"!==e.type)return zs(i,t);pr.error("vttjs failed to load, stopping trying to process "+t.src)})):zs(i,t)})))},Ks=function(e){function t(t){var n;if(void 0===t&&(t={}),!t.tech)throw new Error("A tech was not provided.");var i=us(t,{kind:Us[t.kind]||"subtitles",language:t.language||t.srclang||""}),r=Bs[i.mode]||"disabled",a=i.default;"metadata"!==i.kind&&"chapters"!==i.kind||(r="hidden"),(n=e.call(this,i)||this).tech_=i.tech,n.cues_=[],n.activeCues_=[],n.preload_=!1!==n.tech_.preloadTextTracks;var s=new Ds(n.cues_),o=new Ds(n.activeCues_),u=!1,l=za(O(n),(function(){this.tech_.isReady_&&!this.tech_.isDisposed()&&(this.activeCues=this.activeCues,u&&(this.trigger("cuechange"),u=!1))}));return n.tech_.one("dispose",(function(){n.tech_.off("timeupdate",l)})),"disabled"!==r&&n.tech_.on("timeupdate",l),Object.defineProperties(O(n),{default:{get:function(){return a},set:function(){}},mode:{get:function(){return r},set:function(e){Bs[e]&&r!==e&&(r=e,this.preload_||"disabled"===r||0!==this.cues.length||Gs(this.src,this),this.tech_.off("timeupdate",l),"disabled"!==r&&this.tech_.on("timeupdate",l),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?s:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return o;for(var e=this.tech_.currentTime(),t=[],n=0,i=this.cues.length;n<i;n++){var r=this.cues[n];(r.startTime<=e&&r.endTime>=e||r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e)&&t.push(r)}if(u=!1,t.length!==this.activeCues_.length)u=!0;else for(var a=0;a<t.length;a++)-1===this.activeCues_.indexOf(t[a])&&(u=!0);return this.activeCues_=t,o.setCues_(this.activeCues_),o},set:function(){}}}),i.src?(n.src=i.src,n.preload_||(n.loaded_=!0),(n.preload_||"subtitles"!==i.kind&&"captions"!==i.kind)&&Gs(n.src,O(n))):n.loaded_=!0,n}R(t,e);var n=t.prototype;return n.addCue=function(e){var t=e;if(C.vttjs&&!(e instanceof C.vttjs.VTTCue)){for(var n in t=new C.vttjs.VTTCue(e.startTime,e.endTime,e.text),e)n in t||(t[n]=e[n]);t.id=e.id,t.originalCue_=e}for(var i=this.tech_.textTracks(),r=0;r<i.length;r++)i[r]!==this&&i[r].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)},n.removeCue=function(e){for(var t=this.cues_.length;t--;){var n=this.cues_[t];if(n===e||n.originalCue_&&n.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}},t}(Fs);Ks.prototype.allowedEvents_={cuechange:"cuechange"};var Xs=function(e){function t(t){var n;void 0===t&&(t={});var i=us(t,{kind:Ns[t.kind]||""});n=e.call(this,i)||this;var r=!1;return Object.defineProperty(O(n),"enabled",{get:function(){return r},set:function(e){"boolean"==typeof e&&e!==r&&(r=e,this.trigger("enabledchange"))}}),i.enabled&&(n.enabled=i.enabled),n.loaded_=!0,n}return R(t,e),t}(Fs),Qs=function(e){function t(t){var n;void 0===t&&(t={});var i=us(t,{kind:Ms[t.kind]||""});n=e.call(this,i)||this;var r=!1;return Object.defineProperty(O(n),"selected",{get:function(){return r},set:function(e){"boolean"==typeof e&&e!==r&&(r=e,this.trigger("selectedchange"))}}),i.selected&&(n.selected=i.selected),n}return R(t,e),t}(Fs),Ys=function(e){function t(t){var n,i;void 0===t&&(t={}),n=e.call(this)||this;var r=new Ks(t);return n.kind=r.kind,n.src=r.src,n.srclang=r.language,n.label=r.label,n.default=r.default,Object.defineProperties(O(n),{readyState:{get:function(){return i}},track:{get:function(){return r}}}),i=0,r.addEventListener("loadeddata",(function(){i=2,n.trigger({type:"load",target:O(n)})})),n}return R(t,e),t}(Ka);Ys.prototype.allowedEvents_={load:"load"},Ys.NONE=0,Ys.LOADING=1,Ys.LOADED=2,Ys.ERROR=3;var $s={audio:{ListClass:xs,TrackClass:Xs,capitalName:"Audio"},video:{ListClass:Os,TrackClass:Qs,capitalName:"Video"},text:{ListClass:Ls,TrackClass:Ks,capitalName:"Text"}};Object.keys($s).forEach((function(e){$s[e].getterName=e+"Tracks",$s[e].privateName=e+"Tracks_"}));var Js={remoteText:{ListClass:Ls,TrackClass:Ks,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Rs,TrackClass:Ys,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Zs=A({},$s,Js);Js.names=Object.keys(Js),$s.names=Object.keys($s),Zs.names=[].concat(Js.names).concat($s.names);var eo=function(e){function t(t,n){var i;return void 0===t&&(t={}),void 0===n&&(n=function(){}),t.reportTouchActivity=!1,(i=e.call(this,null,t,n)||this).onDurationChange_=function(e){return i.onDurationChange(e)},i.trackProgress_=function(e){return i.trackProgress(e)},i.trackCurrentTime_=function(e){return i.trackCurrentTime(e)},i.stopTrackingCurrentTime_=function(e){return i.stopTrackingCurrentTime(e)},i.disposeSourceHandler_=function(e){return i.disposeSourceHandler(e)},i.hasStarted_=!1,i.on("playing",(function(){this.hasStarted_=!0})),i.on("loadstart",(function(){this.hasStarted_=!1})),Zs.names.forEach((function(e){var n=Zs[e];t&&t[n.getterName]&&(i[n.privateName]=t[n.getterName])})),i.featuresProgressEvents||i.manualProgressOn(),i.featuresTimeupdateEvents||i.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach((function(e){!1===t["native"+e+"Tracks"]&&(i["featuresNative"+e+"Tracks"]=!1)})),!1===t.nativeCaptions||!1===t.nativeTextTracks?i.featuresNativeTextTracks=!1:!0!==t.nativeCaptions&&!0!==t.nativeTextTracks||(i.featuresNativeTextTracks=!0),i.featuresNativeTextTracks||i.emulateTextTracks(),i.preloadTextTracks=!1!==t.preloadTextTracks,i.autoRemoteTextTracks_=new Zs.text.ListClass,i.initTrackListeners(),t.nativeControlsForTouch||i.emitTapEvents(),i.constructor&&(i.name_=i.constructor.name||"Unknown Tech"),i}R(t,e);var n=t.prototype;return n.triggerSourceset=function(e){var t=this;this.isReady_||this.one("ready",(function(){return t.setTimeout((function(){return t.triggerSourceset(e)}),1)})),this.trigger({src:e,type:"sourceset"})},n.manualProgressOn=function(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)},n.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)},n.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(za(this,(function(){var e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()})),500)},n.onDurationChange=function(e){this.duration_=this.duration()},n.buffered=function(){return gs(0,0)},n.bufferedPercent=function(){return vs(this.buffered(),this.duration_)},n.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},n.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)},n.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)},n.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}),250)},n.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},n.dispose=function(){this.clearTracks($s.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),e.prototype.dispose.call(this)},n.clearTracks=function(e){var t=this;(e=[].concat(e)).forEach((function(e){for(var n=t[e+"Tracks"]()||[],i=n.length;i--;){var r=n[i];"text"===e&&t.removeRemoteTextTrack(r),n.removeTrack(r)}}))},n.cleanupAutoTextTracks=function(){for(var e=this.autoRemoteTextTracks_||[],t=e.length;t--;){var n=e[t];this.removeRemoteTextTrack(n)}},n.reset=function(){},n.crossOrigin=function(){},n.setCrossOrigin=function(){},n.error=function(e){return void 0!==e&&(this.error_=new ys(e),this.trigger("error")),this.error_},n.played=function(){return this.hasStarted_?gs(0,0):gs()},n.play=function(){},n.setScrubbing=function(){},n.scrubbing=function(){},n.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},n.initTrackListeners=function(){var e=this;$s.names.forEach((function(t){var n=$s[t],i=function(){e.trigger(t+"trackchange")},r=e[n.getterName]();r.addEventListener("removetrack",i),r.addEventListener("addtrack",i),e.on("dispose",(function(){r.removeEventListener("removetrack",i),r.removeEventListener("addtrack",i)}))}))},n.addWebVttScript_=function(){var e=this;if(!C.WebVTT)if(P.body.contains(this.el())){if(!this.options_["vtt.js"]&&br(_e)&&Object.keys(_e).length>0)return void this.trigger("vttjsloaded");var t=P.createElement("script");t.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})),C.WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},n.emulateTextTracks=function(){var e=this,t=this.textTracks(),n=this.remoteTextTracks(),i=function(e){return t.addTrack(e.track)},r=function(e){return t.removeTrack(e.track)};n.on("addtrack",i),n.on("removetrack",r),this.addWebVttScript_();var a=function(){return e.trigger("texttrackchange")},s=function(){a();for(var e=0;e<t.length;e++){var n=t[e];n.removeEventListener("cuechange",a),"showing"===n.mode&&n.addEventListener("cuechange",a)}};s(),t.addEventListener("change",s),t.addEventListener("addtrack",s),t.addEventListener("removetrack",s),this.on("dispose",(function(){n.off("addtrack",i),n.off("removetrack",r),t.removeEventListener("change",s),t.removeEventListener("addtrack",s),t.removeEventListener("removetrack",s);for(var e=0;e<t.length;e++){t[e].removeEventListener("cuechange",a)}}))},n.addTextTrack=function(e,t,n){if(!e)throw new Error("TextTrack kind is required but was not provided");return function(e,t,n,i,r){void 0===r&&(r={});var a=e.textTracks();r.kind=t,n&&(r.label=n),i&&(r.language=i),r.tech=e;var s=new Zs.text.TrackClass(r);return a.addTrack(s),s}(this,e,t,n)},n.createRemoteTextTrack=function(e){var t=us(e,{tech:this});return new Js.remoteTextEl.TrackClass(t)},n.addRemoteTextTrack=function(e,t){var n=this;void 0===e&&(e={});var i=this.createRemoteTextTrack(e);return!0!==t&&!1!==t&&(pr.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),t=!0),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),!0!==t&&this.ready((function(){return n.autoRemoteTextTracks_.addTrack(i.track)})),i},n.removeRemoteTextTrack=function(e){var t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},n.getVideoPlaybackQuality=function(){return{}},n.requestPictureInPicture=function(){var e=this.options_.Promise||C.Promise;if(e)return e.reject()},n.disablePictureInPicture=function(){return!0},n.setDisablePictureInPicture=function(){},n.setPoster=function(){},n.playsinline=function(){},n.setPlaysinline=function(){},n.overrideNativeAudioTracks=function(){},n.overrideNativeVideoTracks=function(){},n.canPlayType=function(){return""},t.canPlayType=function(){return""},t.canPlaySource=function(e,n){return t.canPlayType(e.type)},t.isTech=function(e){return e.prototype instanceof t||e instanceof t||e===t},t.registerTech=function(e,n){if(t.techs_||(t.techs_={}),!t.isTech(n))throw new Error("Tech "+e+" must be a Tech");if(!t.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!t.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=os(e),t.techs_[e]=n,t.techs_[ss(e)]=n,"Tech"!==e&&t.defaultTechOrder_.push(e),n},t.getTech=function(e){if(e)return t.techs_&&t.techs_[e]?t.techs_[e]:(e=os(e),C&&C.videojs&&C.videojs[e]?(pr.warn("The "+e+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),C.videojs[e]):void 0)},t}(ps);Zs.names.forEach((function(e){var t=Zs[e];eo.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}})),eo.prototype.featuresVolumeControl=!0,eo.prototype.featuresMuteControl=!0,eo.prototype.featuresFullscreenResize=!1,eo.prototype.featuresPlaybackRate=!1,eo.prototype.featuresProgressEvents=!1,eo.prototype.featuresSourceset=!1,eo.prototype.featuresTimeupdateEvents=!1,eo.prototype.featuresNativeTextTracks=!1,eo.withSourceHandlers=function(e){e.registerSourceHandler=function(t,n){var i=e.sourceHandlers;i||(i=e.sourceHandlers=[]),void 0===n&&(n=i.length),i.splice(n,0,t)},e.canPlayType=function(t){for(var n,i=e.sourceHandlers||[],r=0;r<i.length;r++)if(n=i[r].canPlayType(t))return n;return""},e.selectSourceHandler=function(t,n){for(var i=e.sourceHandlers||[],r=0;r<i.length;r++)if(i[r].canHandleSource(t,n))return i[r];return null},e.canPlaySource=function(t,n){var i=e.selectSourceHandler(t,n);return i?i.canHandleSource(t,n):""};["seekable","seeking","duration"].forEach((function(e){var t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})}),e.prototype),e.prototype.setSource=function(t){var n=e.selectSourceHandler(t,this.options_);n||(e.nativeSourceHandler?n=e.nativeSourceHandler:pr.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),n!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=n.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},e.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)}},ps.registerComponent("Tech",eo),eo.registerTech("Tech",eo),eo.defaultTechOrder_=[];var to={},no={},io={};function ro(e,t,n){e.setTimeout((function(){return function e(t,n,i,r,a,s){void 0===t&&(t={});void 0===n&&(n=[]);void 0===a&&(a=[]);void 0===s&&(s=!1);var o=n,u=o[0],l=o.slice(1);if("string"==typeof u)e(t,to[u],i,r,a,s);else if(u){var c=function(e,t){var n=no[e.id()],i=null;if(null==n)return i=t(e),no[e.id()]=[[t,i]],i;for(var r=0;r<n.length;r++){var a=n[r],s=a[0],o=a[1];s===t&&(i=o)}null===i&&(i=t(e),n.push([t,i]));return i}(r,u);if(!c.setSource)return a.push(c),e(t,l,i,r,a,s);c.setSource(yr({},t),(function(n,o){if(n)return e(t,l,i,r,a,s);a.push(c),e(o,t.type===o.type?l:to[o.type],i,r,a,s)}))}else l.length?e(t,l,i,r,a,s):s?i(t,a):e(t,to["*"],i,r,a,!0)}(t,to[t.type],n,e)}),1)}function ao(e,t,n,i){void 0===i&&(i=null);var r="call"+os(n),a=e.reduce(lo(r),i),s=a===io,o=s?null:t[n](a);return function(e,t,n,i){for(var r=e.length-1;r>=0;r--){var a=e[r];a[t]&&a[t](i,n)}}(e,n,o,s),o}var so={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},oo={setCurrentTime:1,setMuted:1,setVolume:1},uo={play:1,pause:1};function lo(e){return function(t,n){return t===io?io:n[e]?n[e](t):t}}var co={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},ho=function(e){void 0===e&&(e="");var t=Vs(e);return co[t.toLowerCase()]||""};function po(e){if(!e.type){var t=ho(e.src);t&&(e.type=t)}return e}var fo=function(e){function t(t,n,i){var r,a=us({createEl:!1},n);if(r=e.call(this,t,a,i)||this,n.playerOptions.sources&&0!==n.playerOptions.sources.length)t.src(n.playerOptions.sources);else for(var s=0,o=n.playerOptions.techOrder;s<o.length;s++){var u=os(o[s]),l=eo.getTech(u);if(u||(l=ps.getComponent(u)),l&&l.isSupported()){t.loadTech_(u);break}}return r}return R(t,e),t}(ps);ps.registerComponent("MediaLoader",fo);var mo=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).handleMouseOver_=function(e){return i.handleMouseOver(e)},i.handleMouseOut_=function(e){return i.handleMouseOut(e)},i.handleClick_=function(e){return i.handleClick(e)},i.handleKeyDown_=function(e){return i.handleKeyDown(e)},i.emitTapEvents(),i.enable(),i}R(t,e);var n=t.prototype;return n.createEl=function(e,t,n){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===n&&(n={}),t=yr({className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&pr.error("Creating a ClickableComponent with an HTML element of "+e+" is not supported; use a Button instead."),n=yr({role:"button"},n),this.tabIndex_=t.tabIndex;var i=Yr(e,t,n);return i.appendChild(Yr("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(i),i},n.dispose=function(){this.controlTextEl_=null,e.prototype.dispose.call(this)},n.createControlTextEl=function(e){return this.controlTextEl_=Yr("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},n.controlText=function(e,t){if(void 0===t&&(t=this.el()),void 0===e)return this.controlText_||"Need Text";var n=this.localize(e);this.controlText_=e,$r(this.controlTextEl_,n),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",n)},n.buildCSSClass=function(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)},n.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))},n.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)},n.handleLanguagechange=function(){this.controlText(this.controlText_)},n.handleClick=function(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)},n.handleKeyDown=function(t){M.isEventKey(t,"Space")||M.isEventKey(t,"Enter")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},t}(ps);ps.registerComponent("ClickableComponent",mo);var go=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).update(),i.update_=function(e){return i.update(e)},t.on("posterchange",i.update_),i}R(t,e);var n=t.prototype;return n.dispose=function(){this.player().off("posterchange",this.update_),e.prototype.dispose.call(this)},n.createEl=function(){return Yr("div",{className:"vjs-poster",tabIndex:-1})},n.update=function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()},n.setSrc=function(e){var t="";e&&(t='url("'+e+'")'),this.el_.style.backgroundImage=t},n.handleClick=function(e){if(this.player_.controls()){var t=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;!this.player_.tech(!0)||(Mr||Lr)&&t||this.player_.tech(!0).focus(),this.player_.paused()?Ts(this.player_.play()):this.player_.pause()}},t}(mo);ps.registerComponent("PosterImage",go);var vo={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 yo(e,t){var n;if(4===e.length)n=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");n=e.slice(1)}return"rgba("+parseInt(n.slice(0,2),16)+","+parseInt(n.slice(2,4),16)+","+parseInt(n.slice(4,6),16)+","+t+")"}function _o(e,t,n){try{e.style[t]=n}catch(e){return}}var bo=function(e){function t(t,n,i){var r;r=e.call(this,t,n,i)||this;var a=function(e){return r.updateDisplay(e)};return t.on("loadstart",(function(e){return r.toggleDisplay(e)})),t.on("texttrackchange",a),t.on("loadedmetadata",(function(e){return r.preselectTrack(e)})),t.ready(za(O(r),(function(){if(t.tech_&&t.tech_.featuresNativeTextTracks)this.hide();else{t.on("fullscreenchange",a),t.on("playerresize",a),C.addEventListener("orientationchange",a),t.on("dispose",(function(){return C.removeEventListener("orientationchange",a)}));for(var e=this.options_.playerOptions.tracks||[],n=0;n<e.length;n++)this.player_.addRemoteTextTrack(e[n],!0);this.preselectTrack()}}))),r}R(t,e);var n=t.prototype;return n.preselectTrack=function(){for(var e,t,n,i={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 i?o.kind===a.kind?n=o:n||(n=o):a&&!a.enabled?(n=null,e=null,t=null):o.default&&("descriptions"!==o.kind||e?o.kind in i&&!t&&(t=o):e=o)}n?n.mode="showing":t?t.mode="showing":e&&(e.mode="showing")},n.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})},n.clearDisplay=function(){"function"==typeof C.WebVTT&&C.WebVTT.processCues(C,[],this.el_)},n.updateDisplay=function(){var e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){for(var n=[],i=0;i<e.length;++i){var r=e[i];"showing"===r.mode&&n.push(r)}this.updateForTrack(n)}else{for(var a=null,s=null,o=e.length;o--;){var u=e[o];"showing"===u.mode&&("descriptions"===u.kind?a=u:s=u)}s?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(s)):a&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(a))}},n.updateDisplayState=function(e){for(var t=this.player_.textTrackSettings.getValues(),n=e.activeCues,i=n.length;i--;){var r=n[i];if(r){var a=r.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&_o(a.firstChild,"color",yo(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&_o(a.firstChild,"backgroundColor",yo(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?_o(a,"backgroundColor",yo(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?a.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px #222":"raised"===t.edgeStyle?a.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px #222":"depressed"===t.edgeStyle?a.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px #222":"uniform"===t.edgeStyle&&(a.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px #222")),t.fontPercent&&1!==t.fontPercent){var s=C.parseFloat(a.style.fontSize);a.style.fontSize=s*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&"default"!==t.fontFamily&&("small-caps"===t.fontFamily?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=vo[t.fontFamily])}}},n.updateForTrack=function(e){if(Array.isArray(e)||(e=[e]),"function"==typeof C.WebVTT&&!e.every((function(e){return!e.activeCues}))){for(var t=[],n=0;n<e.length;++n)for(var i=e[n],r=0;r<i.activeCues.length;++r)t.push(i.activeCues[r]);C.WebVTT.processCues(C,t,this.el_);for(var a=0;a<e.length;++a){for(var s=e[a],o=0;o<s.activeCues.length;++o){var u=s.activeCues[o].displayState;ea(u,"vjs-text-track-cue"),ea(u,"vjs-text-track-cue-"+(s.language?s.language:a)),s.language&&sa(u,"lang",s.language)}this.player_.textTrackSettings&&this.updateDisplayState(s)}}},t}(ps);ps.registerComponent("TextTrackDisplay",bo);var To=function(e){function t(){return e.apply(this,arguments)||this}return R(t,e),t.prototype.createEl=function(){var t=this.player_.isAudio(),n=this.localize(t?"Audio Player":"Video Player"),i=Yr("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[n])}),r=e.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(i),r},t}(ps);ps.registerComponent("LoadingSpinner",To);var ko=function(e){function t(){return e.apply(this,arguments)||this}R(t,e);var n=t.prototype;return n.createEl=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n={});var i=Yr("button",t=yr({className:this.buildCSSClass()},t),n=yr({type:"button"},n));return i.appendChild(Yr("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(i),i},n.addChild=function(e,t){void 0===t&&(t={});var n=this.constructor.name;return pr.warn("Adding an actionable (user controllable) child to a Button ("+n+") is not supported; use a ClickableComponent instead."),ps.prototype.addChild.call(this,e,t)},n.enable=function(){e.prototype.enable.call(this),this.el_.removeAttribute("disabled")},n.disable=function(){e.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},n.handleKeyDown=function(t){M.isEventKey(t,"Space")||M.isEventKey(t,"Enter")?t.stopPropagation():e.prototype.handleKeyDown.call(this,t)},t}(mo);ps.registerComponent("Button",ko);var So=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).mouseused_=!1,i.on("mousedown",(function(e){return i.handleMouseDown(e)})),i}R(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-big-play-button"},n.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY){var n=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;return Ts(t),void(!this.player_.tech(!0)||(Mr||Lr)&&n||this.player_.tech(!0).focus())}var i=this.player_.getChild("controlBar"),r=i&&i.getChild("playToggle");if(r){var a=function(){return r.focus()};bs(t)?t.then(a,(function(){})):this.setTimeout(a,1)}else this.player_.tech(!0).focus()},n.handleKeyDown=function(t){this.mouseused_=!1,e.prototype.handleKeyDown.call(this,t)},n.handleMouseDown=function(e){this.mouseused_=!0},t}(ko);So.prototype.controlText_="Play Video",ps.registerComponent("BigPlayButton",So);var Eo=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).controlText(n&&n.controlText||i.localize("Close")),i}R(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},n.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},n.handleKeyDown=function(t){M.isEventKey(t,"Esc")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},t}(ko);ps.registerComponent("CloseButton",Eo);var Co=function(e){function t(t,n){var i;return void 0===n&&(n={}),i=e.call(this,t,n)||this,n.replay=void 0===n.replay||n.replay,i.on(t,"play",(function(e){return i.handlePlay(e)})),i.on(t,"pause",(function(e){return i.handlePause(e)})),n.replay&&i.on(t,"ended",(function(e){return i.handleEnded(e)})),i}R(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},n.handleClick=function(e){this.player_.paused()?Ts(this.player_.play()):this.player_.pause()},n.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},n.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},n.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},n.handleEnded=function(e){var t=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",(function(e){return t.handleSeeked(e)}))},t}(ko);Co.prototype.controlText_="Play",ps.registerComponent("PlayToggle",Co);var wo=function(e,t){e=e<0?0:e;var n=Math.floor(e%60),i=Math.floor(e/60%60),r=Math.floor(e/3600),a=Math.floor(t/60%60),s=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=i=n="-"),(r=r>0||s>0?r+":":"")+(i=((r||a>=10)&&i<10?"0"+i:i)+":")+(n=n<10?"0"+n:n)},Io=wo;function Po(e,t){return void 0===t&&(t=e),Io(e,t)}var xo=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).on(t,["timeupdate","ended"],(function(e){return i.updateContent(e)})),i.updateTextNode_(),i}R(t,e);var n=t.prototype;return n.createEl=function(){var t=this.buildCSSClass(),n=e.prototype.createEl.call(this,"div",{className:t+" vjs-time-control vjs-control"}),i=Yr("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+" "},{role:"presentation"});return n.appendChild(i),this.contentEl_=Yr("span",{className:t+"-display"},{"aria-live":"off",role:"presentation"}),n.appendChild(this.contentEl_),n},n.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},n.updateTextNode_=function(e){var t=this;void 0===e&&(e=0),e=Po(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",(function(){if(t.contentEl_){var e=t.textNode_;e&&t.contentEl_.firstChild!==e&&(e=null,pr.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),t.textNode_=P.createTextNode(t.formattedTime_),t.textNode_&&(e?t.contentEl_.replaceChild(t.textNode_,e):t.contentEl_.appendChild(t.textNode_))}})))},n.updateContent=function(e){},t}(ps);xo.prototype.labelText_="Time",xo.prototype.controlText_="Time",ps.registerComponent("TimeDisplay",xo);var Ao=function(e){function t(){return e.apply(this,arguments)||this}R(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-current-time"},n.updateContent=function(e){var t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)},t}(xo);Ao.prototype.labelText_="Current Time",Ao.prototype.controlText_="Current Time",ps.registerComponent("CurrentTimeDisplay",Ao);var Oo=function(e){function t(t,n){var i,r=function(e){return i.updateContent(e)};return(i=e.call(this,t,n)||this).on(t,"durationchange",r),i.on(t,"loadstart",r),i.on(t,"loadedmetadata",r),i}R(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-duration"},n.updateContent=function(e){var t=this.player_.duration();this.updateTextNode_(t)},t}(xo);Oo.prototype.labelText_="Duration",Oo.prototype.controlText_="Duration",ps.registerComponent("DurationDisplay",Oo);var Lo=function(e){function t(){return e.apply(this,arguments)||this}return R(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),n=e.prototype.createEl.call(this,"div"),i=e.prototype.createEl.call(this,"span",{textContent:"/"});return n.appendChild(i),t.appendChild(n),t},t}(ps);ps.registerComponent("TimeDivider",Lo);var Ro=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).on(t,"durationchange",(function(e){return i.updateContent(e)})),i}R(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-remaining-time"},n.createEl=function(){var t=e.prototype.createEl.call(this);return t.insertBefore(Yr("span",{},{"aria-hidden":!0},"-"),this.contentEl_),t},n.updateContent=function(e){var t;"number"==typeof this.player_.duration()&&(t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t))},t}(xo);Ro.prototype.labelText_="Remaining Time",Ro.prototype.controlText_="Remaining Time",ps.registerComponent("RemainingTimeDisplay",Ro);var Do=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).updateShowing(),i.on(i.player(),"durationchange",(function(e){return i.updateShowing(e)})),i}R(t,e);var n=t.prototype;return n.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=Yr("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(Yr("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+" "})),this.contentEl_.appendChild(P.createTextNode(this.localize("LIVE"))),t.appendChild(this.contentEl_),t},n.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},n.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(ps);ps.registerComponent("LiveDisplay",Do);var Mo=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).updateLiveEdgeStatus(),i.player_.liveTracker&&(i.updateLiveEdgeStatusHandler_=function(e){return i.updateLiveEdgeStatus(e)},i.on(i.player_.liveTracker,"liveedgechange",i.updateLiveEdgeStatusHandler_)),i}R(t,e);var n=t.prototype;return n.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=Yr("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t},n.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},n.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},n.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,e.prototype.dispose.call(this)},t}(ko);Mo.prototype.controlText_="Seek to live, currently playing live",ps.registerComponent("SeekToLive",Mo);var No=function(e,t,n){return e=Number(e),Math.min(n,Math.max(t,isNaN(e)?t:e))},Uo=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).handleMouseDown_=function(e){return i.handleMouseDown(e)},i.handleMouseUp_=function(e){return i.handleMouseUp(e)},i.handleKeyDown_=function(e){return i.handleKeyDown(e)},i.handleClick_=function(e){return i.handleClick(e)},i.handleMouseMove_=function(e){return i.handleMouseMove(e)},i.update_=function(e){return i.update(e)},i.bar=i.getChild(i.options_.barName),i.vertical(!!i.options_.vertical),i.enable(),i}R(t,e);var n=t.prototype;return n.enabled=function(){return this.enabled_},n.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},n.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},n.createEl=function(t,n,i){return void 0===n&&(n={}),void 0===i&&(i={}),n.className=n.className+" vjs-slider",n=yr({tabIndex:0},n),i=yr({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},i),e.prototype.createEl.call(this,t,n,i)},n.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||Rr||e.preventDefault(),ua(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e)},n.handleMouseMove=function(e){},n.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;la(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.update()},n.update=function(){var e=this;if(this.el_&&this.bar){var t=this.getProgress();return t===this.progress_||(this.progress_=t,this.requestNamedAnimationFrame("Slider#update",(function(){var n=e.vertical()?"height":"width";e.bar.el().style[n]=(100*t).toFixed(2)+"%"}))),t}},n.getProgress=function(){return Number(No(this.getPercent(),0,1).toFixed(4))},n.calculateDistance=function(e){var t=ha(this.el_,e);return this.vertical()?t.y:t.x},n.handleKeyDown=function(t){M.isEventKey(t,"Left")||M.isEventKey(t,"Down")?(t.preventDefault(),t.stopPropagation(),this.stepBack()):M.isEventKey(t,"Right")||M.isEventKey(t,"Up")?(t.preventDefault(),t.stopPropagation(),this.stepForward()):e.prototype.handleKeyDown.call(this,t)},n.handleClick=function(e){e.stopPropagation(),e.preventDefault()},n.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(ps);ps.registerComponent("Slider",Uo);var Bo=function(e,t){return No(e/t*100,0,100).toFixed(2)+"%"},Fo=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).partEls_=[],i.on(t,"progress",(function(e){return i.update(e)})),i}R(t,e);var n=t.prototype;return n.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),n=Yr("span",{className:"vjs-control-text"}),i=Yr("span",{textContent:this.localize("Loaded")}),r=P.createTextNode(": ");return this.percentageEl_=Yr("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),t.appendChild(n),n.appendChild(i),n.appendChild(r),n.appendChild(this.percentageEl_),t},n.dispose=function(){this.partEls_=null,this.percentageEl_=null,e.prototype.dispose.call(this)},n.update=function(e){var t=this;this.requestNamedAnimationFrame("LoadProgressBar#update",(function(){var e=t.player_.liveTracker,n=t.player_.buffered(),i=e&&e.isLive()?e.seekableEnd():t.player_.duration(),r=t.player_.bufferedEnd(),a=t.partEls_,s=Bo(r,i);t.percent_!==s&&(t.el_.style.width=s,$r(t.percentageEl_,s),t.percent_=s);for(var o=0;o<n.length;o++){var u=n.start(o),l=n.end(o),c=a[o];c||(c=t.el_.appendChild(Yr()),a[o]=c),c.dataset.start===u&&c.dataset.end===l||(c.dataset.start=u,c.dataset.end=l,c.style.left=Bo(u,r),c.style.width=Bo(l-u,r))}for(var d=a.length;d>n.length;d--)t.el_.removeChild(a[d-1]);a.length=n.length}))},t}(ps);ps.registerComponent("LoadProgressBar",Fo);var jo=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).update=Ga(za(O(i),i.update),30),i}R(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},n.update=function(e,t,n){var i=da(this.el_),r=ca(this.player_.el()),a=e.width*t;if(r&&i){var s=e.left-r.left+a,o=e.width-a+(r.right-e.right),u=i.width/2;s<u?u+=u-s:o<u&&(u=o),u<0?u=0:u>i.width&&(u=i.width),u=Math.round(u),this.el_.style.right="-"+u+"px",this.write(n)}},n.write=function(e){$r(this.el_,e)},n.updateTime=function(e,t,n,i){var r=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",(function(){var a,s=r.player_.duration();if(r.player_.liveTracker&&r.player_.liveTracker.isLive()){var o=r.player_.liveTracker.liveWindow(),u=o-t*o;a=(u<1?"":"-")+Po(u,o)}else a=Po(n,s);r.update(e,t,a),i&&i()}))},t}(ps);ps.registerComponent("TimeTooltip",jo);var Ho=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).update=Ga(za(O(i),i.update),30),i}R(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},n.update=function(e,t){var n=this.getChild("timeTooltip");if(n){var i=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();n.updateTime(e,t,i)}},t}(ps);Ho.prototype.options_={children:[]},Hr||Pr||Ho.prototype.options_.children.push("timeTooltip"),ps.registerComponent("PlayProgressBar",Ho);var Vo=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).update=Ga(za(O(i),i.update),30),i}R(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},n.update=function(e,t){var n=this,i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,(function(){n.el_.style.left=e.width*t+"px"}))},t}(ps);Vo.prototype.options_={children:["timeTooltip"]},ps.registerComponent("MouseTimeDisplay",Vo);var qo=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).setEventHandlers_(),i}R(t,e);var n=t.prototype;return n.setEventHandlers_=function(){var e=this;this.update_=za(this,this.update),this.update=Ga(this.update_,30),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(t){return e.enableInterval_(t)},this.disableIntervalHandler_=function(t){return e.disableInterval_(t)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in P&&"visibilityState"in P&&this.on(P,"visibilitychange",this.toggleVisibility_)},n.toggleVisibility_=function(e){"hidden"===P.visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())},n.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,30))},n.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},n.update=function(t){var n=this;if("hidden"!==P.visibilityState){var i=e.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",(function(){var e=n.player_.ended()?n.player_.duration():n.getCurrentTime_(),t=n.player_.liveTracker,r=n.player_.duration();t&&t.isLive()&&(r=n.player_.liveTracker.liveCurrentTime()),n.percent_!==i&&(n.el_.setAttribute("aria-valuenow",(100*i).toFixed(2)),n.percent_=i),n.currentTime_===e&&n.duration_===r||(n.el_.setAttribute("aria-valuetext",n.localize("progress bar timing: currentTime={1} duration={2}",[Po(e,r),Po(r,r)],"{1} of {2}")),n.currentTime_=e,n.duration_=r),n.bar&&n.bar.update(ca(n.el()),n.getProgress())})),i}},n.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)},n.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},n.getPercent=function(){var e,t=this.getCurrentTime_(),n=this.player_.liveTracker;return n&&n.isLive()?(e=(t-n.seekableStart())/n.liveWindow(),n.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e},n.handleMouseDown=function(t){ya(t)&&(t.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},n.handleMouseMove=function(e){if(ya(e)){var t,n=this.calculateDistance(e),i=this.player_.liveTracker;if(i&&i.isLive()){if(n>=.99)return void i.seekToLiveEdge();var r=i.seekableStart(),a=i.liveCurrentTime();if((t=r+n*i.liveWindow())>=a&&(t=a),t<=r&&(t=r+.1),t===1/0)return}else(t=n*this.player_.duration())===this.player_.duration()&&(t-=.1);this.userSeek_(t)}},n.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},n.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},n.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Ts(this.player_.play()):this.update_()},n.stepForward=function(){this.userSeek_(this.player_.currentTime()+5)},n.stepBack=function(){this.userSeek_(this.player_.currentTime()-5)},n.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},n.handleKeyDown=function(t){var n=this.player_.liveTracker;if(M.isEventKey(t,"Space")||M.isEventKey(t,"Enter"))t.preventDefault(),t.stopPropagation(),this.handleAction(t);else if(M.isEventKey(t,"Home"))t.preventDefault(),t.stopPropagation(),this.userSeek_(0);else if(M.isEventKey(t,"End"))t.preventDefault(),t.stopPropagation(),n&&n.isLive()?this.userSeek_(n.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(M(t))){t.preventDefault(),t.stopPropagation();var i=10*(M.codes[M(t)]-M.codes[0])/100;n&&n.isLive()?this.userSeek_(n.seekableStart()+n.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else M.isEventKey(t,"PgDn")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):M.isEventKey(t,"PgUp")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):e.prototype.handleKeyDown.call(this,t)},n.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in P&&"visibilityState"in P&&this.off(P,"visibilitychange",this.toggleVisibility_),e.prototype.dispose.call(this)},t}(Uo);qo.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},Hr||Pr||qo.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),ps.registerComponent("SeekBar",qo);var Wo=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).handleMouseMove=Ga(za(O(i),i.handleMouseMove),30),i.throttledHandleMouseSeek=Ga(za(O(i),i.handleMouseSeek),30),i.handleMouseUpHandler_=function(e){return i.handleMouseUp(e)},i.handleMouseDownHandler_=function(e){return i.handleMouseDown(e)},i.enable(),i}R(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},n.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var n=t.getChild("playProgressBar"),i=t.getChild("mouseTimeDisplay");if(n||i){var r=t.el(),a=da(r),s=ha(r,e).x;s=No(s,0,1),i&&i.update(a,s),n&&n.update(a,t.getProgress())}}},n.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},n.enabled=function(){return this.enabled_},n.disable=function(){if(this.children().forEach((function(e){return e.disable&&e.disable()})),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Ts(this.player_.play())}},n.enable=function(){this.children().forEach((function(e){return e.enable&&e.enable()})),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},n.removeListenersAddedOnMousedownAndTouchstart=function(){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)},n.handleMouseDown=function(e){var t=this.el_.ownerDocument,n=this.getChild("seekBar");n&&n.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)},n.handleMouseUp=function(e){var t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()},t}(ps);Wo.prototype.options_={children:["seekBar"]},ps.registerComponent("ProgressControl",Wo);var zo=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).on(t,["enterpictureinpicture","leavepictureinpicture"],(function(e){return i.handlePictureInPictureChange(e)})),i.on(t,["disablepictureinpicturechanged","loadedmetadata"],(function(e){return i.handlePictureInPictureEnabledChange(e)})),i.disable(),i}R(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-picture-in-picture-control "+e.prototype.buildCSSClass.call(this)},n.handlePictureInPictureEnabledChange=function(){P.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable()},n.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},n.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},t}(ko);zo.prototype.controlText_="Picture-in-Picture",ps.registerComponent("PictureInPictureToggle",zo);var Go=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).on(t,"fullscreenchange",(function(e){return i.handleFullscreenChange(e)})),!1===P[t.fsApi_.fullscreenEnabled]&&i.disable(),i}R(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},n.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},n.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(ko);Go.prototype.controlText_="Fullscreen",ps.registerComponent("FullscreenToggle",Go);var Ko=function(e){function t(){return e.apply(this,arguments)||this}return R(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return t.appendChild(e.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),t},t}(ps);ps.registerComponent("VolumeLevel",Ko);var Xo=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).update=Ga(za(O(i),i.update),30),i}R(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},n.update=function(e,t,n,i){if(!n){var r=ca(this.el_),a=ca(this.player_.el()),s=e.width*t;if(!a||!r)return;var o=e.left-a.left+s,u=e.width-s+(a.right-e.right),l=r.width/2;o<l?l+=l-o:u<l&&(l=u),l<0?l=0:l>r.width&&(l=r.width),this.el_.style.right="-"+l+"px"}this.write(i+"%")},n.write=function(e){$r(this.el_,e)},n.updateVolume=function(e,t,n,i,r){var a=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",(function(){a.update(e,t,n,i.toFixed(0)),r&&r()}))},t}(ps);ps.registerComponent("VolumeLevelTooltip",Xo);var Qo=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).update=Ga(za(O(i),i.update),30),i}R(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},n.update=function(e,t,n){var i=this,r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,n,r,(function(){n?i.el_.style.bottom=e.height*t+"px":i.el_.style.left=e.width*t+"px"}))},t}(ps);Qo.prototype.options_={children:["volumeLevelTooltip"]},ps.registerComponent("MouseVolumeLevelDisplay",Qo);var Yo=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).on("slideractive",(function(e){return i.updateLastVolume_(e)})),i.on(t,"volumechange",(function(e){return i.updateARIAAttributes(e)})),t.ready((function(){return i.updateARIAAttributes()})),i}R(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},n.handleMouseDown=function(t){ya(t)&&e.prototype.handleMouseDown.call(this,t)},n.handleMouseMove=function(e){var t=this.getChild("mouseVolumeLevelDisplay");if(t){var n=this.el(),i=ca(n),r=this.vertical(),a=ha(n,e);a=r?a.y:a.x,a=No(a,0,1),t.update(i,a,r)}ya(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},n.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},n.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},n.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},n.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},n.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},n.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},n.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",(function(){0===e.player_.volume()&&e.player_.lastVolume_(t)}))},t}(Uo);Yo.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},Hr||Pr||Yo.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),Yo.prototype.playerEvent="volumechange",ps.registerComponent("VolumeBar",Yo);var $o=function(e){function t(t,n){var i;return void 0===n&&(n={}),n.vertical=n.vertical||!1,(void 0===n.volumeBar||br(n.volumeBar))&&(n.volumeBar=n.volumeBar||{},n.volumeBar.vertical=n.vertical),i=e.call(this,t,n)||this,function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(O(i),t),i.throttledHandleMouseMove=Ga(za(O(i),i.handleMouseMove),30),i.handleMouseUpHandler_=function(e){return i.handleMouseUp(e)},i.on("mousedown",(function(e){return i.handleMouseDown(e)})),i.on("touchstart",(function(e){return i.handleMouseDown(e)})),i.on("mousemove",(function(e){return i.handleMouseMove(e)})),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}R(t,e);var n=t.prototype;return n.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},n.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)},n.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)},n.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(ps);$o.prototype.options_={children:["volumeBar"]},ps.registerComponent("VolumeControl",$o);var Jo=function(e){function t(t,n){var i;return i=e.call(this,t,n)||this,function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(O(i),t),i.on(t,["loadstart","volumechange"],(function(e){return i.update(e)})),i}R(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},n.handleClick=function(e){var t=this.player_.volume(),n=this.player_.lastVolume_();if(0===t){var i=n<.1?.1:n;this.player_.volume(i),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},n.update=function(e){this.updateIcon_(),this.updateControlText_()},n.updateIcon_=function(){var e=this.player_.volume(),t=3;Hr&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var n=0;n<4;n++)ta(this.el_,"vjs-vol-"+n);ea(this.el_,"vjs-vol-"+t)},n.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},t}(ko);Jo.prototype.controlText_="Mute",ps.registerComponent("MuteToggle",Jo);var Zo=function(e){function t(t,n){var i;return void 0===n&&(n={}),void 0!==n.inline?n.inline=n.inline:n.inline=!0,(void 0===n.volumeControl||br(n.volumeControl))&&(n.volumeControl=n.volumeControl||{},n.volumeControl.vertical=!n.inline),(i=e.call(this,t,n)||this).handleKeyPressHandler_=function(e){return i.handleKeyPress(e)},i.on(t,["loadstart"],(function(e){return i.volumePanelState_(e)})),i.on(i.muteToggle,"keyup",(function(e){return i.handleKeyPress(e)})),i.on(i.volumeControl,"keyup",(function(e){return i.handleVolumeControlKeyUp(e)})),i.on("keydown",(function(e){return i.handleKeyPress(e)})),i.on("mouseover",(function(e){return i.handleMouseOver(e)})),i.on("mouseout",(function(e){return i.handleMouseOut(e)})),i.on(i.volumeControl,["slideractive"],i.sliderActive_),i.on(i.volumeControl,["sliderinactive"],i.sliderInactive_),i}R(t,e);var n=t.prototype;return n.sliderActive_=function(){this.addClass("vjs-slider-active")},n.sliderInactive_=function(){this.removeClass("vjs-slider-active")},n.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},n.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},n.dispose=function(){this.handleMouseOut(),e.prototype.dispose.call(this)},n.handleVolumeControlKeyUp=function(e){M.isEventKey(e,"Esc")&&this.muteToggle.focus()},n.handleMouseOver=function(e){this.addClass("vjs-hover"),Ba(P,"keyup",this.handleKeyPressHandler_)},n.handleMouseOut=function(e){this.removeClass("vjs-hover"),Fa(P,"keyup",this.handleKeyPressHandler_)},n.handleKeyPress=function(e){M.isEventKey(e,"Esc")&&this.handleMouseOut()},t}(ps);Zo.prototype.options_={children:["muteToggle","volumeControl"]},ps.registerComponent("VolumePanel",Zo);var eu=function(e){function t(t,n){var i;return i=e.call(this,t,n)||this,n&&(i.menuButton_=n.menuButton),i.focusedChild_=-1,i.on("keydown",(function(e){return i.handleKeyDown(e)})),i.boundHandleBlur_=function(e){return i.handleBlur(e)},i.boundHandleTapClick_=function(e){return i.handleTapClick(e)},i}R(t,e);var n=t.prototype;return n.addEventListenerForItem=function(e){e instanceof ps&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},n.removeEventListenerForItem=function(e){e instanceof ps&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},n.removeChild=function(t){"string"==typeof t&&(t=this.getChild(t)),this.removeEventListenerForItem(t),e.prototype.removeChild.call(this,t)},n.addItem=function(e){var t=this.addChild(e);t&&this.addEventListenerForItem(t)},n.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=Yr(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var n=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return n.appendChild(this.contentEl_),Ba(n,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),n},n.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,e.prototype.dispose.call(this)},n.handleBlur=function(e){var t=e.relatedTarget||P.activeElement;if(!this.children().some((function(e){return e.el()===t}))){var n=this.menuButton_;n&&n.buttonPressed_&&t!==n.el().firstChild&&n.unpressButton()}},n.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var t=this.children();if(!Array.isArray(t))return;var n=t.filter((function(t){return t.el()===e.target}))[0];if(!n)return;"CaptionSettingsMenuItem"!==n.name()&&this.menuButton_.focus()}},n.handleKeyDown=function(e){M.isEventKey(e,"Left")||M.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(M.isEventKey(e,"Right")||M.isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},n.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},n.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},n.focus=function(e){void 0===e&&(e=0);var t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())},t}(ps);ps.registerComponent("Menu",eu);var tu=function(e){function t(t,n){var i;void 0===n&&(n={}),(i=e.call(this,t,n)||this).menuButton_=new ko(t,n),i.menuButton_.controlText(i.controlText_),i.menuButton_.el_.setAttribute("aria-haspopup","true");var r=ko.prototype.buildCSSClass();i.menuButton_.el_.className=i.buildCSSClass()+" "+r,i.menuButton_.removeClass("vjs-control"),i.addChild(i.menuButton_),i.update(),i.enabled_=!0;var a=function(e){return i.handleClick(e)};return i.handleMenuKeyUp_=function(e){return i.handleMenuKeyUp(e)},i.on(i.menuButton_,"tap",a),i.on(i.menuButton_,"click",a),i.on(i.menuButton_,"keydown",(function(e){return i.handleKeyDown(e)})),i.on(i.menuButton_,"mouseenter",(function(){i.addClass("vjs-hover"),i.menu.show(),Ba(P,"keyup",i.handleMenuKeyUp_)})),i.on("mouseleave",(function(e){return i.handleMouseLeave(e)})),i.on("keydown",(function(e){return i.handleSubmenuKeyDown(e)})),i}R(t,e);var n=t.prototype;return n.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},n.createMenu=function(){var e=new eu(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=Yr("li",{className:"vjs-menu-title",textContent:os(this.options_.title),tabIndex:-1}),n=new ps(this.player_,{el:t});e.addItem(n)}if(this.items=this.createItems(),this.items)for(var i=0;i<this.items.length;i++)e.addItem(this.items[i]);return e},n.createItems=function(){},n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},n.buildWrapperCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+ko.prototype.buildCSSClass()+" "+e.prototype.buildCSSClass.call(this)},n.buildCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+e.prototype.buildCSSClass.call(this)},n.controlText=function(e,t){return void 0===t&&(t=this.menuButton_.el()),this.menuButton_.controlText(e,t)},n.dispose=function(){this.handleMouseLeave(),e.prototype.dispose.call(this)},n.handleClick=function(e){this.buttonPressed_?this.unpressButton():this.pressButton()},n.handleMouseLeave=function(e){this.removeClass("vjs-hover"),Fa(P,"keyup",this.handleMenuKeyUp_)},n.focus=function(){this.menuButton_.focus()},n.blur=function(){this.menuButton_.blur()},n.handleKeyDown=function(e){M.isEventKey(e,"Esc")||M.isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),M.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(M.isEventKey(e,"Up")||M.isEventKey(e,"Down"))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))},n.handleMenuKeyUp=function(e){(M.isEventKey(e,"Esc")||M.isEventKey(e,"Tab"))&&this.removeClass("vjs-hover")},n.handleSubmenuKeyPress=function(e){this.handleSubmenuKeyDown(e)},n.handleSubmenuKeyDown=function(e){(M.isEventKey(e,"Esc")||M.isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),M.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus()))},n.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Hr&&Xr())return;this.menu.focus()}},n.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},n.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},n.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},t}(ps);ps.registerComponent("MenuButton",tu);var nu=function(e){function t(t,n){var i,r=n.tracks;if((i=e.call(this,t,n)||this).items.length<=1&&i.hide(),!r)return O(i);var a=za(O(i),i.update);return r.addEventListener("removetrack",a),r.addEventListener("addtrack",a),r.addEventListener("labelchange",a),i.player_.on("ready",a),i.player_.on("dispose",(function(){r.removeEventListener("removetrack",a),r.removeEventListener("addtrack",a),r.removeEventListener("labelchange",a)})),i}return R(t,e),t}(tu);ps.registerComponent("TrackButton",nu);var iu=["Tab","Esc","Up","Down","Right","Left"],ru=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).selectable=n.selectable,i.isSelected_=n.selected||!1,i.multiSelectable=n.multiSelectable,i.selected(i.isSelected_),i.selectable?i.multiSelectable?i.el_.setAttribute("role","menuitemcheckbox"):i.el_.setAttribute("role","menuitemradio"):i.el_.setAttribute("role","menuitem"),i}R(t,e);var n=t.prototype;return n.createEl=function(t,n,i){this.nonIconControl=!0;var r=e.prototype.createEl.call(this,"li",yr({className:"vjs-menu-item",tabIndex:-1},n),i);return r.replaceChild(Yr("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)}),r.querySelector(".vjs-icon-placeholder")),r},n.handleKeyDown=function(t){iu.some((function(e){return M.isEventKey(t,e)}))||e.prototype.handleKeyDown.call(this,t)},n.handleClick=function(e){this.selected(!0)},n.selected=function(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))},t}(mo);ps.registerComponent("MenuItem",ru);var au=function(e){function t(t,n){var i,r=n.track,a=t.textTracks();n.label=r.label||r.language||"Unknown",n.selected="showing"===r.mode,(i=e.call(this,t,n)||this).track=r,i.kinds=(n.kinds||[n.kind||i.track.kind]).filter(Boolean);var s,o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];i.handleTracksChange.apply(O(i),t)},u=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];i.handleSelectedLanguageChange.apply(O(i),t)};(t.on(["loadstart","texttrackchange"],o),a.addEventListener("change",o),a.addEventListener("selectedlanguagechange",u),i.on("dispose",(function(){t.off(["loadstart","texttrackchange"],o),a.removeEventListener("change",o),a.removeEventListener("selectedlanguagechange",u)})),void 0===a.onchange)&&i.on(["tap","click"],(function(){if("object"!==_typeof2(C.Event))try{s=new C.Event("change")}catch(e){}s||(s=P.createEvent("Event")).initEvent("change",!0,!0),a.dispatchEvent(s)}));return i.handleTracksChange(),i}R(t,e);var n=t.prototype;return n.handleClick=function(t){var n=this.track,i=this.player_.textTracks();if(e.prototype.handleClick.call(this,t),i)for(var r=0;r<i.length;r++){var a=i[r];-1!==this.kinds.indexOf(a.kind)&&(a===n?"showing"!==a.mode&&(a.mode="showing"):"disabled"!==a.mode&&(a.mode="disabled"))}},n.handleTracksChange=function(e){var t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)},n.handleSelectedLanguageChange=function(e){if("showing"===this.track.mode){var t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},n.dispose=function(){this.track=null,e.prototype.dispose.call(this)},t}(ru);ps.registerComponent("TextTrackMenuItem",au);var su=function(e){function t(t,n){return n.track={player:t,kind:n.kind,kinds:n.kinds,default:!1,mode:"disabled"},n.kinds||(n.kinds=[n.kind]),n.label?n.track.label=n.label:n.track.label=n.kinds.join(" and ")+" off",n.selectable=!0,n.multiSelectable=!1,e.call(this,t,n)||this}R(t,e);var n=t.prototype;return n.handleTracksChange=function(e){for(var t=this.player().textTracks(),n=!0,i=0,r=t.length;i<r;i++){var a=t[i];if(this.options_.kinds.indexOf(a.kind)>-1&&"showing"===a.mode){n=!1;break}}n!==this.isSelected_&&this.selected(n)},n.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),n=!0,i=0,r=t.length;i<r;i++){var a=t[i];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&"showing"===a.mode){n=!1;break}}n&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(au);ps.registerComponent("OffTextTrackMenuItem",su);var ou=function(e){function t(t,n){return void 0===n&&(n={}),n.tracks=t.textTracks(),e.call(this,t,n)||this}return R(t,e),t.prototype.createItems=function(e,t){var n;void 0===e&&(e=[]),void 0===t&&(t=au),this.label_&&(n=this.label_+" off"),e.push(new su(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hideThreshold_+=1;var i=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var r=0;r<i.length;r++){var a=i[r];if(this.kinds_.indexOf(a.kind)>-1){var s=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});s.addClass("vjs-"+a.kind+"-menu-item"),e.push(s)}}return e},t}(nu);ps.registerComponent("TextTrackButton",ou);var uu=function(e){function t(t,n){var i,r=n.track,a=n.cue,s=t.currentTime();return n.selectable=!0,n.multiSelectable=!1,n.label=a.text,n.selected=a.startTime<=s&&s<a.endTime,(i=e.call(this,t,n)||this).track=r,i.cue=a,r.addEventListener("cuechange",za(O(i),i.update)),i}R(t,e);var n=t.prototype;return n.handleClick=function(t){e.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},n.update=function(e){var t=this.cue,n=this.player_.currentTime();this.selected(t.startTime<=n&&n<t.endTime)},t}(ru);ps.registerComponent("ChaptersTrackMenuItem",uu);var lu=function(e){function t(t,n,i){return e.call(this,t,n,i)||this}R(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildWrapperCSSClass.call(this)},n.update=function(t){this.track_&&(!t||"addtrack"!==t.type&&"removetrack"!==t.type)||this.setTrack(this.findChaptersTrack()),e.prototype.update.call(this)},n.setTrack=function(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";var n=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);n&&n.addEventListener("load",this.updateHandler_)}}},n.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],t=e.length-1;t>=0;t--){var n=e[t];if(n.kind===this.kind_)return n}},n.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(os(this.kind_))},n.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},n.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var n=0,i=t.length;n<i;n++){var r=t[n],a=new uu(this.player_,{track:this.track_,cue:r});e.push(a)}return e},t}(ou);lu.prototype.kind_="chapters",lu.prototype.controlText_="Chapters",ps.registerComponent("ChaptersButton",lu);var cu=function(e){function t(t,n,i){var r;r=e.call(this,t,n,i)||this;var a=t.textTracks(),s=za(O(r),r.handleTracksChange);return a.addEventListener("change",s),r.on("dispose",(function(){a.removeEventListener("change",s)})),r}R(t,e);var n=t.prototype;return n.handleTracksChange=function(e){for(var t=this.player().textTracks(),n=!1,i=0,r=t.length;i<r;i++){var a=t[i];if(a.kind!==this.kind_&&"showing"===a.mode){n=!0;break}}n?this.disable():this.enable()},n.buildCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(ou);cu.prototype.kind_="descriptions",cu.prototype.controlText_="Descriptions",ps.registerComponent("DescriptionsButton",cu);var du=function(e){function t(t,n,i){return e.call(this,t,n,i)||this}R(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(ou);du.prototype.kind_="subtitles",du.prototype.controlText_="Subtitles",ps.registerComponent("SubtitlesButton",du);var hu=function(e){function t(t,n){var i;return n.track={player:t,kind:n.kind,label:n.kind+" settings",selectable:!1,default:!1,mode:"disabled"},n.selectable=!1,n.name="CaptionSettingsMenuItem",(i=e.call(this,t,n)||this).addClass("vjs-texttrack-settings"),i.controlText(", opens "+n.kind+" settings dialog"),i}return R(t,e),t.prototype.handleClick=function(e){this.player().getChild("textTrackSettings").open()},t}(au);ps.registerComponent("CaptionSettingsMenuItem",hu);var pu=function(e){function t(t,n,i){return e.call(this,t,n,i)||this}R(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-captions-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-captions-button "+e.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new hu(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),e.prototype.createItems.call(this,t)},t}(ou);pu.prototype.kind_="captions",pu.prototype.controlText_="Captions",ps.registerComponent("CaptionsButton",pu);var fu=function(e){function t(){return e.apply(this,arguments)||this}return R(t,e),t.prototype.createEl=function(t,n,i){var r=e.prototype.createEl.call(this,t,n,i),a=r.querySelector(".vjs-menu-item-text");return"captions"===this.options_.track.kind&&(a.appendChild(Yr("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),a.appendChild(Yr("span",{className:"vjs-control-text",textContent:" "+this.localize("Captions")}))),r},t}(au);ps.registerComponent("SubsCapsMenuItem",fu);var mu=function(e){function t(t,n){var i;return void 0===n&&(n={}),(i=e.call(this,t,n)||this).label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(i.player_.language_)>-1&&(i.label_="captions"),i.menuButton_.controlText(os(i.label_)),i}R(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new hu(this.player_,{kind:this.label_})),this.hideThreshold_+=1),t=e.prototype.createItems.call(this,t,fu)},t}(ou);mu.prototype.kinds_=["captions","subtitles"],mu.prototype.controlText_="Subtitles",ps.registerComponent("SubsCapsButton",mu);var gu=function(e){function t(t,n){var i,r=n.track,a=t.audioTracks();n.label=r.label||r.language||"Unknown",n.selected=r.enabled,(i=e.call(this,t,n)||this).track=r,i.addClass("vjs-"+r.kind+"-menu-item");var s=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];i.handleTracksChange.apply(O(i),t)};return a.addEventListener("change",s),i.on("dispose",(function(){a.removeEventListener("change",s)})),i}R(t,e);var n=t.prototype;return n.createEl=function(t,n,i){var r=e.prototype.createEl.call(this,t,n,i),a=r.querySelector(".vjs-menu-item-text");return"main-desc"===this.options_.track.kind&&(a.appendChild(e.prototype.createEl.call(this,"span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),a.appendChild(e.prototype.createEl.call(this,"span",{className:"vjs-control-text",textContent:this.localize("Descriptions")}))),r},n.handleClick=function(t){e.prototype.handleClick.call(this,t),this.track.enabled=!0},n.handleTracksChange=function(e){this.selected(this.track.enabled)},t}(ru);ps.registerComponent("AudioTrackMenuItem",gu);var vu=function(e){function t(t,n){return void 0===n&&(n={}),n.tracks=t.audioTracks(),e.call(this,t,n)||this}R(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-audio-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-audio-button "+e.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(e){void 0===e&&(e=[]),this.hideThreshold_=1;for(var t=this.player_.audioTracks(),n=0;n<t.length;n++){var i=t[n];e.push(new gu(this.player_,{track:i,selectable:!0,multiSelectable:!1}))}return e},t}(nu);vu.prototype.controlText_="Audio Track",ps.registerComponent("AudioTrackButton",vu);var yu=function(e){function t(t,n){var i,r=n.rate,a=parseFloat(r,10);return n.label=r,n.selected=a===t.playbackRate(),n.selectable=!0,n.multiSelectable=!1,(i=e.call(this,t,n)||this).label=r,i.rate=a,i.on(t,"ratechange",(function(e){return i.update(e)})),i}R(t,e);var n=t.prototype;return n.handleClick=function(t){e.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},n.update=function(e){this.selected(this.player().playbackRate()===this.rate)},t}(ru);yu.prototype.contentElType="button",ps.registerComponent("PlaybackRateMenuItem",yu);var _u=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).menuButton_.el_.setAttribute("aria-describedby",i.labelElId_),i.updateVisibility(),i.updateLabel(),i.on(t,"loadstart",(function(e){return i.updateVisibility(e)})),i.on(t,"ratechange",(function(e){return i.updateLabel(e)})),i.on(t,"playbackrateschange",(function(e){return i.handlePlaybackRateschange(e)})),i}R(t,e);var n=t.prototype;return n.createEl=function(){var t=e.prototype.createEl.call(this);return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=Yr("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),t.appendChild(this.labelEl_),t},n.dispose=function(){this.labelEl_=null,e.prototype.dispose.call(this)},n.buildCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(){for(var e=this.playbackRates(),t=[],n=e.length-1;n>=0;n--)t.push(new yu(this.player(),{rate:e[n]+"x"}));return t},n.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},n.handleClick=function(e){for(var t=this.player().playbackRate(),n=this.playbackRates(),i=n[0],r=0;r<n.length;r++)if(n[r]>t){i=n[r];break}this.player().playbackRate(i)},n.handlePlaybackRateschange=function(e){this.update()},n.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]},n.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},n.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},n.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},t}(tu);_u.prototype.controlText_="Playback Rate",ps.registerComponent("PlaybackRateMenuButton",_u);var bu=function(e){function t(){return e.apply(this,arguments)||this}R(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},n.createEl=function(t,n,i){return void 0===t&&(t="div"),void 0===n&&(n={}),void 0===i&&(i={}),n.className||(n.className=this.buildCSSClass()),e.prototype.createEl.call(this,t,n,i)},t}(ps);ps.registerComponent("Spacer",bu);var Tu=function(e){function t(){return e.apply(this,arguments)||this}R(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:" "})},t}(bu);ps.registerComponent("CustomControlSpacer",Tu);var ku=function(e){function t(){return e.apply(this,arguments)||this}return R(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(ps);ku.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in P&&ku.prototype.options_.children.splice(ku.prototype.options_.children.length-1,0,"pictureInPictureToggle"),ps.registerComponent("ControlBar",ku);var Su=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this).on(t,"error",(function(e){return i.open(e)})),i}R(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},n.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(Cs);Su.prototype.options_=A({},Cs.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),ps.registerComponent("ErrorDisplay",Su);var Eu=["#000","Black"],Cu=["#00F","Blue"],wu=["#0FF","Cyan"],Iu=["#0F0","Green"],Pu=["#F0F","Magenta"],xu=["#F00","Red"],Au=["#FFF","White"],Ou=["#FF0","Yellow"],Lu=["1","Opaque"],Ru=["0.5","Semi-Transparent"],Du=["0","Transparent"],Mu={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Eu,Au,xu,Iu,Cu,Ou,Pu,wu]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[Lu,Ru,Du]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Au,Eu,xu,Iu,Cu,Ou,Pu,wu]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(e){return"1.00"===e?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[Lu,Ru]},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:[Du,Ru,Lu]}};function Nu(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}Mu.windowColor.options=Mu.backgroundColor.options;var Uu=function(e){function t(t,n){var i;return n.temporary=!1,(i=e.call(this,t,n)||this).updateDisplay=i.updateDisplay.bind(O(i)),i.fill(),i.hasBeenOpened_=i.hasBeenFilled_=!0,i.endDialog=Yr("p",{className:"vjs-control-text",textContent:i.localize("End of dialog window.")}),i.el().appendChild(i.endDialog),i.setDefaults(),void 0===n.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()})),vr(Mu,(function(e){i.on(i.$(e.selector),"change",i.updateDisplay)})),i.options_.persistTextTrackSettings&&i.restoreSettings(),i}R(t,e);var n=t.prototype;return n.dispose=function(){this.endDialog=null,e.prototype.dispose.call(this)},n.createElSelect_=function(e,t,n){var i=this;void 0===t&&(t=""),void 0===n&&(n="label");var r=Mu[e],a=r.id.replace("%s",this.id_),s=[t,a].join(" ").trim();return["<"+n+' id="'+a+'" class="'+("label"===n?"vjs-label":"")+'">',this.localize(r.label),"</"+n+">",'<select aria-labelledby="'+s+'">'].concat(r.options.map((function(e){var t=a+"-"+e[1].replace(/\W+/g,"");return['<option id="'+t+'" value="'+e[0]+'" ','aria-labelledby="'+s+" "+t+'">',i.localize(e[1]),"</option>"].join("")}))).concat("</select>").join("")},n.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",e),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")},n.createElBgColor_=function(){var e="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",e),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")},n.createElWinColor_=function(){var e="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",e),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")},n.createElColors_=function(){return Yr("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},n.createElFont_=function(){return Yr("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("")})},n.createElControls_=function(){var e=this.localize("restore all settings to the default values");return Yr("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+e+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+e+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},n.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},n.label=function(){return this.localize("Caption Settings Dialog")},n.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},n.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},n.getValues=function(){var e=this;return function(e,t,n){return void 0===n&&(n=0),gr(e).reduce((function(n,i){return t(n,e[i],i)}),n)}(Mu,(function(t,n,i){var r,a,s=(r=e.$(n.selector),a=n.parser,Nu(r.options[r.options.selectedIndex].value,a));return void 0!==s&&(t[i]=s),t}),{})},n.setValues=function(e){var t=this;vr(Mu,(function(n,i){!function(e,t,n){if(t)for(var i=0;i<e.options.length;i++)if(Nu(e.options[i].value,n)===t){e.selectedIndex=i;break}}(t.$(n.selector),e[i],n.parser)}))},n.setDefaults=function(){var e=this;vr(Mu,(function(t){var n=t.hasOwnProperty("default")?t.default:0;e.$(t.selector).selectedIndex=n}))},n.restoreSettings=function(){var e;try{e=JSON.parse(C.localStorage.getItem("vjs-text-track-settings"))}catch(e){pr.warn(e)}e&&this.setValues(e)},n.saveSettings=function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?C.localStorage.setItem("vjs-text-track-settings",JSON.stringify(e)):C.localStorage.removeItem("vjs-text-track-settings")}catch(e){pr.warn(e)}}},n.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},n.conditionalBlur_=function(){this.previouslyActiveEl_=null;var e=this.player_.controlBar,t=e&&e.subsCapsButton,n=e&&e.captionsButton;t?t.focus():n&&n.focus()},t}(Cs);ps.registerComponent("TextTrackSettings",Uu);var Bu=function(e){function t(t,n){var i,r=n.ResizeObserver||C.ResizeObserver;null===n.ResizeObserver&&(r=!1);var a=us({createEl:!r,reportTouchActivity:!1},n);return(i=e.call(this,t,a)||this).ResizeObserver=n.ResizeObserver||C.ResizeObserver,i.loadListener_=null,i.resizeObserver_=null,i.debouncedHandler_=function(e,t,n,i){var r;void 0===i&&(i=C);var a=function(){var a=this,s=arguments,o=function(){r=null,o=null,n||e.apply(a,s)};!r&&n&&e.apply(a,s),i.clearTimeout(r),r=i.setTimeout(o,t)};return a.cancel=function(){i.clearTimeout(r),r=null},a}((function(){i.resizeHandler()}),100,!1,O(i)),r?(i.resizeObserver_=new i.ResizeObserver(i.debouncedHandler_),i.resizeObserver_.observe(t.el())):(i.loadListener_=function(){if(i.el_&&i.el_.contentWindow){var e=i.debouncedHandler_,t=i.unloadListener_=function(){Fa(this,"resize",e),Fa(this,"unload",t),t=null};Ba(i.el_.contentWindow,"unload",t),Ba(i.el_.contentWindow,"resize",e)}},i.one("load",i.loadListener_)),i}R(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1},{"aria-hidden":"true"})},n.resizeHandler=function(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")},n.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,e.prototype.dispose.call(this)},t}(ps);ps.registerComponent("ResizeManager",Bu);var Fu={trackingThreshold:20,liveTolerance:15},ju=function(e){function t(t,n){var i,r=us(Fu,n,{createEl:!1});return(i=e.call(this,t,r)||this).handleVisibilityChange_=function(e){return i.handleVisibilityChange(e)},i.trackLiveHandler_=function(){return i.trackLive_()},i.handlePlay_=function(e){return i.handlePlay(e)},i.handleFirstTimeupdate_=function(e){return i.handleFirstTimeupdate(e)},i.handleSeeked_=function(e){return i.handleSeeked(e)},i.seekToLiveEdge_=function(e){return i.seekToLiveEdge(e)},i.reset_(),i.on(i.player_,"durationchange",(function(e){return i.handleDurationchange(e)})),i.one(i.player_,"canplay",(function(){return i.toggleTracking()})),Mr&&"hidden"in P&&"visibilityState"in P&&i.on(P,"visibilitychange",i.handleVisibilityChange_),i}R(t,e);var n=t.prototype;return n.handleVisibilityChange=function(){this.player_.duration()===1/0&&(P.hidden?this.stopTracking():this.startTracking())},n.trackLive_=function(){var e=this.player_.seekable();if(e&&e.length){var t=Number(C.performance.now().toFixed(4)),n=-1===this.lastTime_?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+n;var i=this.liveCurrentTime(),r=this.player_.currentTime(),a=this.player_.paused()||this.seekedBehindLive_||Math.abs(i-r)>this.options_.liveTolerance;this.timeupdateSeen_&&i!==1/0||(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}},n.handleDurationchange=function(){this.toggleTracking()},n.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},n.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,30),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))},n.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},n.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()},n.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},n.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},n.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},n.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},n.seekableEnd=function(){for(var e=this.player_.seekable(),t=[],n=e?e.length:0;n--;)t.push(e.end(n));return t.length?t.sort()[t.length-1]:1/0},n.seekableStart=function(){for(var e=this.player_.seekable(),t=[],n=e?e.length:0;n--;)t.push(e.start(n));return t.length?t.sort()[0]:0},n.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()},n.isLive=function(){return this.isTracking()},n.atLiveEdge=function(){return!this.behindLiveEdge()},n.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},n.pastSeekEnd=function(){var e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_},n.behindLiveEdge=function(){return this.behindLiveEdge_},n.isTracking=function(){return"number"==typeof this.trackingInterval_},n.seekToLiveEdge=function(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},n.dispose=function(){this.off(P,"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),e.prototype.dispose.call(this)},t}(ps);ps.registerComponent("LiveTracker",ju);var Hu,Vu=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var n=e.$$("source"),i=[],r="";if(!n.length)return!1;for(var a=0;a<n.length;a++){var s=n[a].src;s&&-1===i.indexOf(s)&&i.push(s)}return!!i.length&&(1===i.length&&(r=i[0]),e.triggerSourceset(r),!0)},qu=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(e){var t=P.createElement(this.nodeName.toLowerCase());t.innerHTML=e;for(var n=P.createDocumentFragment();t.childNodes.length;)n.appendChild(t.childNodes[0]);return this.innerText="",C.Element.prototype.appendChild.call(this,n),this.innerHTML}}),Wu=function(e,t){for(var n={},i=0;i<e.length&&!((n=Object.getOwnPropertyDescriptor(e[i],t))&&n.set&&n.get);i++);return n.enumerable=!0,n.configurable=!0,n},zu=function(e){var t=e.el();if(!t.resetSourceWatch_){var n={},i=function(e){return Wu([e.el(),C.HTMLMediaElement.prototype,C.Element.prototype,qu],"innerHTML")}(e),r=function(n){return function(){for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];var s=n.apply(t,r);return Vu(e),s}};["append","appendChild","insertAdjacentHTML"].forEach((function(e){t[e]&&(n[e]=t[e],t[e]=r(n[e]))})),Object.defineProperty(t,"innerHTML",us(i,{set:r(i.set)})),t.resetSourceWatch_=function(){t.resetSourceWatch_=null,Object.keys(n).forEach((function(e){t[e]=n[e]})),Object.defineProperty(t,"innerHTML",i)},e.one("sourceset",t.resetSourceWatch_)}},Gu=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?Hs(C.Element.prototype.getAttribute.call(this,"src")):""},set:function(e){return C.Element.prototype.setAttribute.call(this,"src",e),e}}),Ku=function(e){if(e.featuresSourceset){var t=e.el();if(!t.resetSourceset_){var n=function(e){return Wu([e.el(),C.HTMLMediaElement.prototype,Gu],"src")}(e),i=t.setAttribute,r=t.load;Object.defineProperty(t,"src",us(n,{set:function(i){var r=n.set.call(t,i);return e.triggerSourceset(t.src),r}})),t.setAttribute=function(n,r){var a=i.call(t,n,r);return/src/i.test(n)&&e.triggerSourceset(t.src),a},t.load=function(){var n=r.call(t);return Vu(e)||(e.triggerSourceset(""),zu(e)),n},t.currentSrc?e.triggerSourceset(t.currentSrc):Vu(e)||zu(e),t.resetSourceset_=function(){t.resetSourceset_=null,t.load=r,t.setAttribute=i,Object.defineProperty(t,"src",n),t.resetSourceWatch_&&t.resetSourceWatch_()}}}},Xu=function(e,t,n,i){void 0===i&&(i=!0);var r=function(n){return Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0})},a={configurable:!0,enumerable:!0,get:function(){var e=n();return r(e),e}};return i&&(a.set=r),Object.defineProperty(e,t,a)},Qu=function(e){function t(t,n){var i;i=e.call(this,t,n)||this;var r=t.source,a=!1;if(r&&(i.el_.currentSrc!==r.src||t.tag&&3===t.tag.initNetworkState_)?i.setSource(r):i.handleLateInit_(i.el_),t.enableSourceset&&i.setupSourcesetHandling_(),i.isScrubbing_=!1,i.el_.hasChildNodes()){for(var s=i.el_.childNodes,o=s.length,u=[];o--;){var l=s[o];"track"===l.nodeName.toLowerCase()&&(i.featuresNativeTextTracks?(i.remoteTextTrackEls().addTrackElement_(l),i.remoteTextTracks().addTrack(l.track),i.textTracks().addTrack(l.track),a||i.el_.hasAttribute("crossorigin")||!qs(l.src)||(a=!0)):u.push(l))}for(var c=0;c<u.length;c++)i.el_.removeChild(u[c])}return i.proxyNativeTracks_(),i.featuresNativeTextTracks&&a&&pr.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),i.restoreMetadataTracksInIOSNativePlayer_(),(Br||jr||Ar)&&!0===t.nativeControlsForTouch&&i.setControls(!0),i.proxyWebkitFullscreen_(),i.triggerReady(),i}R(t,e);var n=t.prototype;return n.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),t.disposeMediaElement(this.el_),this.options_=null,e.prototype.dispose.call(this)},n.setupSourcesetHandling_=function(){Ku(this)},n.restoreMetadataTracksInIOSNativePlayer_=function(){var e,t=this.textTracks(),n=function(){e=[];for(var n=0;n<t.length;n++){var i=t[n];"metadata"===i.kind&&e.push({track:i,storedMode:i.mode})}};n(),t.addEventListener("change",n),this.on("dispose",(function(){return t.removeEventListener("change",n)}));var i=function n(){for(var i=0;i<e.length;i++){var r=e[i];"disabled"===r.track.mode&&r.track.mode!==r.storedMode&&(r.track.mode=r.storedMode)}t.removeEventListener("change",n)};this.on("webkitbeginfullscreen",(function(){t.removeEventListener("change",n),t.removeEventListener("change",i),t.addEventListener("change",i)})),this.on("webkitendfullscreen",(function(){t.removeEventListener("change",n),t.addEventListener("change",n),t.removeEventListener("change",i)}))},n.overrideNative_=function(e,t){var n=this;if(t===this["featuresNative"+e+"Tracks"]){var i=e.toLowerCase();this[i+"TracksListeners_"]&&Object.keys(this[i+"TracksListeners_"]).forEach((function(e){n.el()[i+"Tracks"].removeEventListener(e,n[i+"TracksListeners_"][e])})),this["featuresNative"+e+"Tracks"]=!t,this[i+"TracksListeners_"]=null,this.proxyNativeTracksForType_(i)}},n.overrideNativeAudioTracks=function(e){this.overrideNative_("Audio",e)},n.overrideNativeVideoTracks=function(e){this.overrideNative_("Video",e)},n.proxyNativeTracksForType_=function(e){var t=this,n=$s[e],i=this.el()[n.getterName],r=this[n.getterName]();if(this["featuresNative"+n.capitalName+"Tracks"]&&i&&i.addEventListener){var a={change:function(n){var i={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(i),"text"===e&&t[Js.remoteText.getterName]().trigger(i)},addtrack:function(e){r.addTrack(e.track)},removetrack:function(e){r.removeTrack(e.track)}},s=function(){for(var e=[],t=0;t<r.length;t++){for(var n=!1,a=0;a<i.length;a++)if(i[a]===r[t]){n=!0;break}n||e.push(r[t])}for(;e.length;)r.removeTrack(e.shift())};this[n.getterName+"Listeners_"]=a,Object.keys(a).forEach((function(e){var n=a[e];i.addEventListener(e,n),t.on("dispose",(function(t){return i.removeEventListener(e,n)}))})),this.on("loadstart",s),this.on("dispose",(function(e){return t.off("loadstart",s)}))}},n.proxyNativeTracks_=function(){var e=this;$s.names.forEach((function(t){e.proxyNativeTracksForType_(t)}))},n.createEl=function(){var e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){var n=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(n,e),t.disposeMediaElement(e),e=n}else{e=P.createElement("video");var i=us({},this.options_.tag&&ra(this.options_.tag));Br&&!0===this.options_.nativeControlsForTouch||delete i.controls,ia(e,yr(i,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}void 0!==this.options_.preload&&sa(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);for(var r=["loop","muted","playsinline","autoplay"],a=0;a<r.length;a++){var s=r[a],o=this.options_[s];void 0!==o&&(o?sa(e,s,s):oa(e,s),e[s]=o)}return e},n.handleLateInit_=function(e){if(0!==e.networkState&&3!==e.networkState){if(0===e.readyState){var t=!1,n=function(){t=!0};this.on("loadstart",n);var i=function(){t||this.trigger("loadstart")};return this.on("loadedmetadata",i),void this.ready((function(){this.off("loadstart",n),this.off("loadedmetadata",i),t||this.trigger("loadstart")}))}var r=["loadstart"];r.push("loadedmetadata"),e.readyState>=2&&r.push("loadeddata"),e.readyState>=3&&r.push("canplay"),e.readyState>=4&&r.push("canplaythrough"),this.ready((function(){r.forEach((function(e){this.trigger(e)}),this)}))}},n.setScrubbing=function(e){this.isScrubbing_=e},n.scrubbing=function(){return this.isScrubbing_},n.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&Vr?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){pr(e,"Video is not ready. (Video.js)")}},n.duration=function(){var e=this;if(this.el_.duration===1/0&&Pr&&Rr&&0===this.el_.currentTime){return this.on("timeupdate",(function t(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t))})),NaN}return this.el_.duration||NaN},n.width=function(){return this.el_.offsetWidth},n.height=function(){return this.el_.offsetHeight},n.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var t=function(){this.trigger("fullscreenchange",{isFullscreen:!1})},n=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",n),this.on("dispose",(function(){e.off("webkitbeginfullscreen",n),e.off("webkitendfullscreen",t)}))}},n.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=C.navigator&&C.navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},n.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Ts(this.el_.play()),this.setTimeout((function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}),0);else try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}},n.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))},n.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},n.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},n.reset=function(){t.resetMediaElement(this.el_)},n.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},n.setControls=function(e){this.el_.controls=!!e},n.addTextTrack=function(t,n,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,n,i):e.prototype.addTextTrack.call(this,t,n,i)},n.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var n=P.createElement("track");return t.kind&&(n.kind=t.kind),t.label&&(n.label=t.label),(t.language||t.srclang)&&(n.srclang=t.language||t.srclang),t.default&&(n.default=t.default),t.id&&(n.id=t.id),t.src&&(n.src=t.src),n},n.addRemoteTextTrack=function(t,n){var i=e.prototype.addRemoteTextTrack.call(this,t,n);return this.featuresNativeTextTracks&&this.el().appendChild(i),i},n.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks)for(var n=this.$$("track"),i=n.length;i--;)t!==n[i]&&t!==n[i].track||this.el().removeChild(n[i])},n.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),C.performance&&"function"==typeof C.performance.now?e.creationTime=C.performance.now():C.performance&&C.performance.timing&&"number"==typeof C.performance.timing.navigationStart&&(e.creationTime=C.Date.now()-C.performance.timing.navigationStart),e},t}(eo);Xu(Qu,"TEST_VID",(function(){if(Gr()){var e=P.createElement("video"),t=P.createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e}})),Qu.isSupported=function(){try{Qu.TEST_VID.volume=.5}catch(e){return!1}return!(!Qu.TEST_VID||!Qu.TEST_VID.canPlayType)},Qu.canPlayType=function(e){return Qu.TEST_VID.canPlayType(e)},Qu.canPlaySource=function(e,t){return Qu.canPlayType(e.type)},Qu.canControlVolume=function(){try{var e=Qu.TEST_VID.volume;return Qu.TEST_VID.volume=e/2+.1,e!==Qu.TEST_VID.volume}catch(e){return!1}},Qu.canMuteVolume=function(){try{var e=Qu.TEST_VID.muted;return Qu.TEST_VID.muted=!e,Qu.TEST_VID.muted?sa(Qu.TEST_VID,"muted","muted"):oa(Qu.TEST_VID,"muted"),e!==Qu.TEST_VID.muted}catch(e){return!1}},Qu.canControlPlaybackRate=function(){if(Pr&&Rr&&Dr<58)return!1;try{var e=Qu.TEST_VID.playbackRate;return Qu.TEST_VID.playbackRate=e/2+.1,e!==Qu.TEST_VID.playbackRate}catch(e){return!1}},Qu.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(P.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(P.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(P.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(P.createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},Qu.supportsNativeTextTracks=function(){return Vr||Hr&&Rr},Qu.supportsNativeVideoTracks=function(){return!(!Qu.TEST_VID||!Qu.TEST_VID.videoTracks)},Qu.supportsNativeAudioTracks=function(){return!(!Qu.TEST_VID||!Qu.TEST_VID.audioTracks)},Qu.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresVolumeControl","canControlVolume"],["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach((function(e){var t=e[0],n=e[1];Xu(Qu.prototype,t,(function(){return Qu[n]()}),!0)})),Qu.prototype.movingMediaElementInDOM=!Hr,Qu.prototype.featuresFullscreenResize=!0,Qu.prototype.featuresProgressEvents=!0,Qu.prototype.featuresTimeupdateEvents=!0,Qu.patchCanPlayType=function(){xr>=4&&!Or&&!Rr&&(Hu=Qu.TEST_VID&&Qu.TEST_VID.constructor.prototype.canPlayType,Qu.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e)?"maybe":Hu.call(this,e)})},Qu.unpatchCanPlayType=function(){var e=Qu.TEST_VID.constructor.prototype.canPlayType;return Hu&&(Qu.TEST_VID.constructor.prototype.canPlayType=Hu),e},Qu.patchCanPlayType(),Qu.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},Qu.resetMediaElement=function(e){if(e){for(var t=e.querySelectorAll("source"),n=t.length;n--;)e.removeChild(t[n]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){Qu.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){Qu.prototype["set"+os(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}})),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach((function(e){Qu.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(e){Qu.prototype["set"+os(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){Qu.prototype[e]=function(){return this.el_[e]()}})),eo.withSourceHandlers(Qu),Qu.nativeSourceHandler={},Qu.nativeSourceHandler.canPlayType=function(e){try{return Qu.TEST_VID.canPlayType(e)}catch(e){return""}},Qu.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return Qu.nativeSourceHandler.canPlayType(e.type);if(e.src){var n=Vs(e.src);return Qu.nativeSourceHandler.canPlayType("video/"+n)}return""},Qu.nativeSourceHandler.handleSource=function(e,t,n){t.setSrc(e.src)},Qu.nativeSourceHandler.dispose=function(){},Qu.registerSourceHandler(Qu.nativeSourceHandler),eo.registerTech("Html5",Qu);var Yu=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],$u={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Ju=["tiny","xsmall","small","medium","large","xlarge","huge"],Zu={};Ju.forEach((function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;Zu[e]="vjs-layout-"+t}));var el={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},tl=function(e){function t(n,i,r){var a;if(n.id=n.id||i.id||"vjs_video_"+Oa(),(i=yr(t.getTagSettings(n),i)).initChildren=!1,i.createEl=!1,i.evented=!1,i.reportTouchActivity=!1,!i.language)if("function"==typeof n.closest){var s=n.closest("[lang]");s&&s.getAttribute&&(i.language=s.getAttribute("lang"))}else for(var o=n;o&&1===o.nodeType;){if(ra(o).hasOwnProperty("lang")){i.language=o.getAttribute("lang");break}o=o.parentNode}if((a=e.call(this,null,i,r)||this).boundDocumentFullscreenChange_=function(e){return a.documentFullscreenChange_(e)},a.boundFullWindowOnEscKey_=function(e){return a.fullWindowOnEscKey(e)},a.boundUpdateStyleEl_=function(e){return a.updateStyleEl_(e)},a.boundApplyInitTime_=function(e){return a.applyInitTime_(e)},a.boundUpdateCurrentBreakpoint_=function(e){return a.updateCurrentBreakpoint_(e)},a.boundHandleTechClick_=function(e){return a.handleTechClick_(e)},a.boundHandleTechDoubleClick_=function(e){return a.handleTechDoubleClick_(e)},a.boundHandleTechTouchStart_=function(e){return a.handleTechTouchStart_(e)},a.boundHandleTechTouchMove_=function(e){return a.handleTechTouchMove_(e)},a.boundHandleTechTouchEnd_=function(e){return a.handleTechTouchEnd_(e)},a.boundHandleTechTap_=function(e){return a.handleTechTap_(e)},a.isFullscreen_=!1,a.log=fr(a.id_),a.fsApi_=or,a.isPosterFromTech_=!1,a.queuedCallbacks_=[],a.isReady_=!1,a.hasStarted_=!1,a.userActive_=!1,a.debugEnabled_=!1,!a.options_||!a.options_.techOrder||!a.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(a.tag=n,a.tagAttributes=n&&ra(n),a.language(a.options_.language),i.languages){var u={};Object.getOwnPropertyNames(i.languages).forEach((function(e){u[e.toLowerCase()]=i.languages[e]})),a.languages_=u}else a.languages_=t.prototype.options_.languages;a.resetCache_(),a.poster_=i.poster||"",a.controls_=!!i.controls,n.controls=!1,n.removeAttribute("controls"),a.changingSrc_=!1,a.playCallbacks_=[],a.playTerminatedQueue_=[],n.hasAttribute("autoplay")?a.autoplay(!0):a.autoplay(a.options_.autoplay),i.plugins&&Object.keys(i.plugins).forEach((function(e){if("function"!=typeof a[e])throw new Error('plugin "'+e+'" does not exist')})),a.scrubbing_=!1,a.el_=a.createEl(),is(O(a),{eventBusKey:"el_"}),a.fsApi_.requestFullscreen&&(Ba(P,a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_),a.on(a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_)),a.fluid_&&a.on(["playerreset","resize"],a.boundUpdateStyleEl_);var l=us(a.options_);i.plugins&&Object.keys(i.plugins).forEach((function(e){a[e](i.plugins[e])})),i.debug&&a.debug(!0),a.options_.playerOptions=l,a.middleware_=[],a.playbackRates(i.playbackRates),a.initChildren(),a.isAudio("audio"===n.nodeName.toLowerCase()),a.controls()?a.addClass("vjs-controls-enabled"):a.addClass("vjs-controls-disabled"),a.el_.setAttribute("role","region"),a.isAudio()?a.el_.setAttribute("aria-label",a.localize("Audio Player")):a.el_.setAttribute("aria-label",a.localize("Video Player")),a.isAudio()&&a.addClass("vjs-audio"),a.flexNotSupported_()&&a.addClass("vjs-no-flex"),Br&&a.addClass("vjs-touch-enabled"),Hr||a.addClass("vjs-workinghover"),t.players[a.id_]=O(a);var c="7.17.0".split(".")[0];return a.addClass("vjs-v"+c),a.userActive(!0),a.reportUserActivity(),a.one("play",(function(e){return a.listenForUserActivity_(e)})),a.on("stageclick",(function(e){return a.handleStageClick_(e)})),a.on("keydown",(function(e){return a.handleKeyDown(e)})),a.on("languagechange",(function(e){return a.handleLanguagechange(e)})),a.breakpoints(a.options_.breakpoints),a.responsive(a.options_.responsive),a}R(t,e);var n=t.prototype;return n.dispose=function(){var n=this;this.trigger("dispose"),this.off("dispose"),Fa(P,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Fa(P,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),no[this.id()]=null,Zs.names.forEach((function(e){var t=Zs[e],i=n[t.getterName]();i&&i.off&&i.off()})),e.prototype.dispose.call(this)},n.createEl=function(){var t,n=this.tag,i=this.playerElIngest_=n.parentNode&&n.parentNode.hasAttribute&&n.parentNode.hasAttribute("data-vjs-player"),r="video-js"===this.tag.tagName.toLowerCase();i?t=this.el_=n.parentNode:r||(t=this.el_=e.prototype.createEl.call(this,"div"));var a=ra(n);if(r){for(t=this.el_=n,n=this.tag=P.createElement("video");t.children.length;)n.appendChild(t.firstChild);Zr(t,"video-js")||ea(t,"video-js"),t.appendChild(n),i=this.playerElIngest_=t,Object.keys(t).forEach((function(e){try{n[e]=t[e]}catch(e){}}))}if(n.setAttribute("tabindex","-1"),a.tabindex="-1",(Mr||Rr&&Ur)&&(n.setAttribute("role","application"),a.role="application"),n.removeAttribute("width"),n.removeAttribute("height"),"width"in a&&delete a.width,"height"in a&&delete a.height,Object.getOwnPropertyNames(a).forEach((function(e){r&&"class"===e||t.setAttribute(e,a[e]),r&&n.setAttribute(e,a[e])})),n.playerId=n.id,n.id+="_html5_api",n.className="vjs-tech",n.player=t.player=this,this.addClass("vjs-paused"),!0!==C.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Pa("vjs-styles-dimensions");var s=ba(".vjs-styles-defaults"),o=ba("head");o.insertBefore(this.styleEl_,s?s.nextSibling:o.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var u=n.getElementsByTagName("a"),l=0;l<u.length;l++){var c=u.item(l);ea(c,"vjs-hidden"),c.setAttribute("hidden","hidden")}return n.initNetworkState_=n.networkState,n.parentNode&&!i&&n.parentNode.insertBefore(t,n),Jr(n,t),this.children_.unshift(n),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=t,t},n.crossOrigin=function(e){if(!e)return this.techGet_("crossOrigin");"anonymous"===e||"use-credentials"===e?this.techCall_("setCrossOrigin",e):pr.warn('crossOrigin must be "anonymous" or "use-credentials", given "'+e+'"')},n.width=function(e){return this.dimension("width",e)},n.height=function(e){return this.dimension("height",e)},n.dimension=function(e,t){var n=e+"_";if(void 0===t)return this[n]||0;if(""===t||"auto"===t)return this[n]=void 0,void this.updateStyleEl_();var i=parseFloat(t);isNaN(i)?pr.error('Improper value "'+t+'" supplied for for '+e):(this[n]=i,this.updateStyleEl_())},n.fluid=function(e){var t,n,i=this;if(void 0===e)return!!this.fluid_;this.fluid_=!!e,Qa(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),n=function(){i.on(["playerreset","resize"],i.boundUpdateStyleEl_)},Qa(t=this)?n():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(n))):this.removeClass("vjs-fluid"),this.updateStyleEl_()},n.fill=function(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},n.aspectRatio=function(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()},n.updateStyleEl_=function(){if(!0!==C.VIDEOJS_NO_DYNAMIC_STYLE){var e,t,n,i=(void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),r=i[1]/i[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/r:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*r,n=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(n),xa(this.styleEl_,"\n      ."+n+" {\n        width: "+e+"px;\n        height: "+t+"px;\n      }\n\n      ."+n+".vjs-fluid {\n        padding-top: "+100*r+"%;\n      }\n    ")}else{var a="number"==typeof this.width_?this.width_:this.options_.width,s="number"==typeof this.height_?this.height_:this.options_.height,o=this.tech_&&this.tech_.el();o&&(a>=0&&(o.width=a),s>=0&&(o.height=s))}},n.loadTech_=function(e,t){var n=this;this.tech_&&this.unloadTech_();var i=os(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==i&&this.tag&&(eo.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;var a=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(a=!1);var s={source:t,autoplay:a,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+r+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};Zs.names.forEach((function(e){var t=Zs[e];s[t.getterName]=n[t.privateName]})),yr(s,this.options_[i]),yr(s,this.options_[r]),yr(s,this.options_[e.toLowerCase()]),this.tag&&(s.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(s.startTime=this.cache_.currentTime);var o=eo.getTech(e);if(!o)throw new Error("No Tech named '"+i+"' exists! '"+i+"' should be registered using videojs.registerTech()'");this.tech_=new o(s),this.tech_.ready(za(this,this.handleTechReady_),!0),Es(this.textTracksJson_||[],this.tech_),Yu.forEach((function(e){n.on(n.tech_,e,(function(t){return n["handleTech"+os(e)+"_"](t)}))})),Object.keys($u).forEach((function(e){n.on(n.tech_,e,(function(t){0===n.tech_.playbackRate()&&n.tech_.seeking()?n.queuedCallbacks_.push({callback:n["handleTech"+$u[e]+"_"].bind(n),event:t}):n["handleTech"+$u[e]+"_"](t)}))})),this.on(this.tech_,"loadstart",(function(e){return n.handleTechLoadStart_(e)})),this.on(this.tech_,"sourceset",(function(e){return n.handleTechSourceset_(e)})),this.on(this.tech_,"waiting",(function(e){return n.handleTechWaiting_(e)})),this.on(this.tech_,"ended",(function(e){return n.handleTechEnded_(e)})),this.on(this.tech_,"seeking",(function(e){return n.handleTechSeeking_(e)})),this.on(this.tech_,"play",(function(e){return n.handleTechPlay_(e)})),this.on(this.tech_,"firstplay",(function(e){return n.handleTechFirstPlay_(e)})),this.on(this.tech_,"pause",(function(e){return n.handleTechPause_(e)})),this.on(this.tech_,"durationchange",(function(e){return n.handleTechDurationChange_(e)})),this.on(this.tech_,"fullscreenchange",(function(e,t){return n.handleTechFullscreenChange_(e,t)})),this.on(this.tech_,"fullscreenerror",(function(e,t){return n.handleTechFullscreenError_(e,t)})),this.on(this.tech_,"enterpictureinpicture",(function(e){return n.handleTechEnterPictureInPicture_(e)})),this.on(this.tech_,"leavepictureinpicture",(function(e){return n.handleTechLeavePictureInPicture_(e)})),this.on(this.tech_,"error",(function(e){return n.handleTechError_(e)})),this.on(this.tech_,"posterchange",(function(e){return n.handleTechPosterChange_(e)})),this.on(this.tech_,"textdata",(function(e){return n.handleTechTextData_(e)})),this.on(this.tech_,"ratechange",(function(e){return n.handleTechRateChange_(e)})),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===i&&this.tag||Jr(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},n.unloadTech_=function(){var e=this;Zs.names.forEach((function(t){var n=Zs[t];e[n.privateName]=e[n.getterName]()})),this.textTracksJson_=Ss(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},n.tech=function(e){return void 0===e&&pr.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_},n.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},n.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},n.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},n.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())},n.manualAutoplay_=function(e){var t=this;if(this.tech_&&"string"==typeof e){var n,i=function(){var e=t.muted();t.muted(!0);var n=function(){t.muted(e)};t.playTerminatedQueue_.push(n);var i=t.play();if(bs(i))return i.catch((function(e){throw n(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(e||""))}))};if("any"!==e||this.muted()?n="muted"!==e||this.muted()?this.play():i():bs(n=this.play())&&(n=n.catch(i)),bs(n))return n.then((function(){t.trigger({type:"autoplay-success",autoplay:e})})).catch((function(){t.trigger({type:"autoplay-failure",autoplay:e})}))}},n.updateSourceCaches_=function(e){void 0===e&&(e="");var t=e,n="";"string"!=typeof t&&(t=e.src,n=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!n&&(n=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var n=e.cache_.sources.filter((function(e){return e.src===t}));if(n.length)return n[0].type;for(var i=e.$$("source"),r=0;r<i.length;r++){var a=i[r];if(a.type&&a.src&&a.src===t)return a.type}return ho(t)}(this,t)),this.cache_.source=us({},e,{src:t,type:n});for(var i=this.cache_.sources.filter((function(e){return e.src&&e.src===t})),r=[],a=this.$$("source"),s=[],o=0;o<a.length;o++){var u=ra(a[o]);r.push(u),u.src&&u.src===t&&s.push(u.src)}s.length&&!i.length?this.cache_.sources=r:i.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t},n.handleTechSourceset_=function(e){var t=this;if(!this.changingSrc_){var n=function(e){return t.updateSourceCaches_(e)},i=this.currentSource().src,r=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==i)&&(n=function(){}),n(r),e.src||this.tech_.any(["sourceset","loadstart"],(function(e){if("sourceset"!==e.type){var n=t.techGet("currentSrc");t.lastSource_.tech=n,t.updateSourceCaches_(n)}}))}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})},n.hasStarted=function(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},n.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},n.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach((function(e){return e.callback(e.event)})),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},n.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var t=this.currentTime();this.on("timeupdate",(function n(){t!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",n))}))},n.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},n.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},n.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},n.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},n.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},n.handleTechFirstPlay_=function(){this.options_.starttime&&(pr.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},n.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},n.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},n.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},n.handleTechClick_=function(e){this.controls_&&(void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.click&&!1===this.options_.userActions.click||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?Ts(this.play()):this.pause()))},n.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(function(t){return t.contains(e.target)}))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},n.handleTechTap_=function(){this.userActive(!this.userActive())},n.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},n.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},n.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault()},n.handleStageClick_=function(){this.reportUserActivity()},n.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},n.documentFullscreenChange_=function(e){var t=e.target.player;if(!t||t===this){var n=this.el(),i=P[this.fsApi_.fullscreenElement]===n;!i&&n.matches?i=n.matches(":"+this.fsApi_.fullscreen):!i&&n.msMatchesSelector&&(i=n.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(i)}},n.handleTechFullscreenChange_=function(e,t){t&&(t.nativeIOSFullscreen&&this.toggleClass("vjs-ios-native-fs"),this.isFullscreen(t.isFullscreen))},n.handleTechFullscreenError_=function(e,t){this.trigger("fullscreenerror",t)},n.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},n.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},n.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},n.handleTechError_=function(){var e=this.tech_.error();this.error(e)},n.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},n.getCache=function(){return this.cache_},n.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},n.techCall_=function(e,t){this.ready((function(){if(e in oo)return function(e,t,n,i){return t[n](e.reduce(lo(n),i))}(this.middleware_,this.tech_,e,t);if(e in uo)return ao(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw pr(e),e}}),!0)},n.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in so)return function(e,t,n){return e.reduceRight(lo(n),t[n]())}(this.middleware_,this.tech_,e);if(e in uo)return ao(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw pr("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t),t;if("TypeError"===t.name)throw pr("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t),this.tech_.isReady_=!1,t;throw pr(t),t}}},n.play=function(){var e=this,t=this.options_.Promise||C.Promise;return t?new t((function(t){e.play_(t)})):this.play_()},n.play_=function(e){var t=this;void 0===e&&(e=Ts),this.playCallbacks_.push(e);var n=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!n)return this.waitToPlay_=function(e){t.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(n||!Vr&&!Hr||this.load());var i=this.techGet_("play");null===i?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(i)},n.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach((function(e){e()}))},n.runPlayCallbacks_=function(e){var t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach((function(t){t(e)}))},n.pause=function(){this.techCall_("pause")},n.paused=function(){return!1!==this.techGet_("paused")},n.played=function(){return this.techGet_("played")||gs(0,0)},n.scrubbing=function(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},n.currentTime=function(e){return void 0!==e?(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),void(this.cache_.initTime=0)):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},n.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},n.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))},n.remainingTime=function(){return this.duration()-this.currentTime()},n.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},n.buffered=function(){var e=this.techGet_("buffered");return e&&e.length||(e=gs(0,0)),e},n.bufferedPercent=function(){return vs(this.buffered(),this.duration())},n.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),n=e.end(e.length-1);return n>t&&(n=t),n},n.volume=function(e){var t;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)},n.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},n.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},n.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e},n.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},n.isFullscreen=function(e){if(void 0!==e){var t=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_},n.requestFullscreen=function(e){var t=this.options_.Promise||C.Promise;if(t){var n=this;return new t((function(t,i){function r(){n.off("fullscreenerror",s),n.off("fullscreenchange",a)}function a(){r(),t()}function s(e,t){r(),i(t)}n.one("fullscreenchange",a),n.one("fullscreenerror",s);var o=n.requestFullscreenHelper_(e);o&&(o.then(r,r),o.then(t,i))}))}return this.requestFullscreenHelper_()},n.requestFullscreenHelper_=function(e){var t,n=this;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){var i=this.el_[this.fsApi_.requestFullscreen](t);return i&&i.then((function(){return n.isFullscreen(!0)}),(function(){return n.isFullscreen(!1)})),i}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},n.exitFullscreen=function(){var e=this.options_.Promise||C.Promise;if(e){var t=this;return new e((function(e,n){function i(){t.off("fullscreenerror",a),t.off("fullscreenchange",r)}function r(){i(),e()}function a(e,t){i(),n(t)}t.one("fullscreenchange",r),t.one("fullscreenerror",a);var s=t.exitFullscreenHelper_();s&&(s.then(i,i),s.then(e,n))}))}return this.exitFullscreenHelper_()},n.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var t=P[this.fsApi_.exitFullscreen]();return t&&Ts(t.then((function(){return e.isFullscreen(!1)}))),t}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},n.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=P.documentElement.style.overflow,Ba(P,"keydown",this.boundFullWindowOnEscKey_),P.documentElement.style.overflow="hidden",ea(P.body,"vjs-full-window"),this.trigger("enterFullWindow")},n.fullWindowOnEscKey=function(e){M.isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},n.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,Fa(P,"keydown",this.boundFullWindowOnEscKey_),P.documentElement.style.overflow=this.docOrigOverflow,ta(P.body,"vjs-full-window"),this.trigger("exitFullWindow")},n.disablePictureInPicture=function(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")},n.isInPictureInPicture=function(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},n.requestPictureInPicture=function(){if("pictureInPictureEnabled"in P&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")},n.exitPictureInPicture=function(){if("pictureInPictureEnabled"in P)return P.exitPictureInPicture()},n.handleKeyDown=function(e){var t=this.options_.userActions;if(t&&t.hotkeys){(function(e){var t=e.tagName.toLowerCase();if(e.isContentEditable)return!0;if("input"===t)return-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type);return-1!==["textarea"].indexOf(t)})(this.el_.ownerDocument.activeElement)||("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e))}},n.handleHotkeys=function(e){var t=this.options_.userActions?this.options_.userActions.hotkeys:{},n=t.fullscreenKey,i=void 0===n?function(e){return M.isEventKey(e,"f")}:n,r=t.muteKey,a=void 0===r?function(e){return M.isEventKey(e,"m")}:r,s=t.playPauseKey,o=void 0===s?function(e){return M.isEventKey(e,"k")||M.isEventKey(e,"Space")}:s;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();var u=ps.getComponent("FullscreenToggle");!1!==P[this.fsApi_.fullscreenEnabled]&&u.prototype.handleClick.call(this,e)}else if(a.call(this,e)){e.preventDefault(),e.stopPropagation(),ps.getComponent("MuteToggle").prototype.handleClick.call(this,e)}else if(o.call(this,e)){e.preventDefault(),e.stopPropagation(),ps.getComponent("PlayToggle").prototype.handleClick.call(this,e)}},n.canPlayType=function(e){for(var t,n=0,i=this.options_.techOrder;n<i.length;n++){var r=i[n],a=eo.getTech(r);if(a||(a=ps.getComponent(r)),a){if(a.isSupported()&&(t=a.canPlayType(e)))return t}else pr.error('The "'+r+'" tech is undefined. Skipped browser support check for that tech.')}return""},n.selectSource=function(e){var t=this,n=this.options_.techOrder.map((function(e){return[e,eo.getTech(e)]})).filter((function(e){var t=e[0],n=e[1];return n?n.isSupported():(pr.error('The "'+t+'" tech is undefined. Skipped browser support check for that tech.'),!1)})),i=function(e,t,n){var i;return e.some((function(e){return t.some((function(t){if(i=n(e,t))return!0}))})),i},r=function(e,n){var i=e[0];if(e[1].canPlaySource(n,t.options_[i.toLowerCase()]))return{source:n,tech:i}};return(this.options_.sourceOrder?i(e,n,function(e){return function(t,n){return e(n,t)}}(r)):i(n,e,r))||!1},n.handleSrc_=function(e,t){var n=this;if(void 0===e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();var i=function e(t){if(Array.isArray(t)){var n=[];t.forEach((function(t){t=e(t),Array.isArray(t)?n=n.concat(t):_r(t)&&n.push(t)})),t=n}else t="string"==typeof t&&t.trim()?[po({src:t})]:_r(t)&&"string"==typeof t.src&&t.src&&t.src.trim()?[po(t)]:[];return t}(e);if(i.length){if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),ro(this,i[0],(function(e,r){var a,s;if(n.middleware_=r,t||(n.cache_.sources=i),n.updateSourceCaches_(e),n.src_(e))return i.length>1?n.handleSrc_(i.slice(1)):(n.changingSrc_=!1,n.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0),void n.triggerReady());a=r,s=n.tech_,a.forEach((function(e){return e.setTech&&e.setTech(s)}))})),this.options_.retryOnError&&i.length>1){var r=function(){n.error(null),n.handleSrc_(i.slice(1),!0)},a=function(){n.off("error",r)};this.one("error",r),this.one("playing",a),this.resetRetryOnError_=function(){n.off("error",r),n.off("playing",a)}}}else this.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0)},n.src=function(e){return this.handleSrc_(e,!1)},n.src_=function(e){var t,n,i=this,r=this.selectSource([e]);return!r||(t=r.tech,n=this.techName_,os(t)!==os(n)?(this.changingSrc_=!0,this.loadTech_(r.tech,r.source),this.tech_.ready((function(){i.changingSrc_=!1})),!1):(this.ready((function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1}),!0),!1))},n.load=function(){this.techCall_("load")},n.reset=function(){var e=this,t=this.options_.Promise||C.Promise;this.paused()||!t?this.doReset_():Ts(this.play().then((function(){return e.doReset_()})))},n.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),Qa(this)&&this.trigger("playerreset")},n.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},n.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar,t=e.durationDisplay,n=e.remainingTimeDisplay;t&&t.updateContent(),n&&n.updateContent()},n.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},n.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},n.currentSources=function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t},n.currentSource=function(){return this.cache_.source||{}},n.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},n.currentType=function(){return this.currentSource()&&this.currentSource().type||""},n.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},n.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var t;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)},n.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},n.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},n.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},n.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},n.controls=function(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},n.usingNativeControls=function(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},n.error=function(e){var t=this;if(void 0===e)return this.error_||null;if(ar("beforeerror").forEach((function(n){var i=n(t,e);_r(i)&&!Array.isArray(i)||"string"==typeof i||"number"==typeof i||null===i?e=i:t.log.error("please return a value that MediaError expects in beforeerror hooks")})),this.options_.suppressNotSupportedError&&e&&4===e.code){var n=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],n),void this.one("loadstart",(function(){this.off(["click","touchstart"],n)}))}if(null===e)return this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new ys(e),this.addClass("vjs-error"),pr.error("(CODE:"+this.error_.code+" "+ys.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),ar("error").forEach((function(e){return e(t,t.error_)}))},n.reportUserActivity=function(e){this.userActivity_=!0},n.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",(function(e){e.stopPropagation(),e.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},n.listenForUserActivity_=function(){var e,t,n,i=za(this,this.reportUserActivity),r=function(t){i(),this.clearInterval(e)};this.on("mousedown",(function(){i(),this.clearInterval(e),e=this.setInterval(i,250)})),this.on("mousemove",(function(e){e.screenX===t&&e.screenY===n||(t=e.screenX,n=e.screenY,i())})),this.on("mouseup",r),this.on("mouseleave",r);var a,s=this.getChild("controlBar");!s||Hr||Pr||(s.on("mouseenter",(function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0})),s.on("mouseleave",(function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}))),this.on("keydown",i),this.on("keyup",i),this.setInterval((function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(a);var e=this.options_.inactivityTimeout;e<=0||(a=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))}}),250)},n.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},n.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},n.isAudio=function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e},n.addTextTrack=function(e,t,n){if(this.tech_)return this.tech_.addTextTrack(e,t,n)},n.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)},n.removeRemoteTextTrack=function(e){void 0===e&&(e={});var t=e.track;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)},n.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},n.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},n.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},n.language=function(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Qa(this)&&this.trigger("languagechange"))},n.languages=function(){return us(t.prototype.options_.languages,this.languages_)},n.toJSON=function(){var e=us(this.options_),t=e.tracks;e.tracks=[];for(var n=0;n<t.length;n++){var i=t[n];(i=us(i)).player=void 0,e.tracks[n]=i}return e},n.createModal=function(e,t){var n=this;(t=t||{}).content=e||"";var i=new Cs(this,t);return this.addChild(i),i.on("dispose",(function(){n.removeChild(i)})),i.open(),i},n.updateCurrentBreakpoint_=function(){if(this.responsive())for(var e=this.currentBreakpoint(),t=this.currentWidth(),n=0;n<Ju.length;n++){var i=Ju[n];if(t<=this.breakpoints_[i]){if(e===i)return;e&&this.removeClass(Zu[e]),this.addClass(Zu[i]),this.breakpoint_=i;break}}},n.removeCurrentBreakpoint_=function(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)},n.breakpoints=function(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=yr({},el,e),this.updateCurrentBreakpoint_()),yr(this.breakpoints_)},n.responsive=function(e){return void 0===e?this.responsive_:(e=Boolean(e))!==this.responsive_?(this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0},n.currentBreakpoint=function(){return this.breakpoint_},n.currentBreakpointClass=function(){return Zu[this.breakpoint_]||""},n.loadMedia=function(e,t){var n=this;if(e&&"object"===_typeof2(e)){this.reset(),this.cache_.media=us(e);var i=this.cache_.media,r=i.artwork,a=i.poster,s=i.src,o=i.textTracks;!r&&a&&(this.cache_.media.artwork=[{src:a,type:ho(a)}]),s&&this.src(s),a&&this.poster(a),Array.isArray(o)&&o.forEach((function(e){return n.addRemoteTextTrack(e,!1)})),this.ready(t)}},n.getMedia=function(){if(!this.cache_.media){var e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),(function(e){return{kind:e.kind,label:e.label,language:e.language,src:e.src}}))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:ho(t.poster)}]),t}return us(this.cache_.media)},t.getTagSettings=function(e){var t={sources:[],tracks:[]},n=ra(e),i=n["data-setup"];if(Zr(e,"vjs-fill")&&(n.fill=!0),Zr(e,"vjs-fluid")&&(n.fluid=!0),null!==i){var r=D(i||"{}"),a=r[0],s=r[1];a&&pr.error(a),yr(n,s)}if(yr(t,n),e.hasChildNodes())for(var o=e.childNodes,u=0,l=o.length;u<l;u++){var c=o[u],d=c.nodeName.toLowerCase();"source"===d?t.sources.push(ra(c)):"track"===d&&t.tracks.push(ra(c))}return t},n.flexNotSupported_=function(){var e=P.createElement("i");return!("flexBasis"in e.style||"webkitFlexBasis"in e.style||"mozFlexBasis"in e.style||"msFlexBasis"in e.style||"msFlexOrder"in e.style)},n.debug=function(e){if(void 0===e)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)},n.playbackRates=function(e){if(void 0===e)return this.cache_.playbackRates;Array.isArray(e)&&e.every((function(e){return"number"==typeof e}))&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))},t}(ps);Zs.names.forEach((function(e){var t=Zs[e];tl.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}})),tl.prototype.crossorigin=tl.prototype.crossOrigin,tl.players={};var nl=C.navigator;tl.prototype.options_={techOrder:eo.defaultTechOrder_,html5:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:nl&&(nl.languages&&nl.languages[0]||nl.userLanguage||nl.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1},["ended","seeking","seekable","networkState","readyState"].forEach((function(e){tl.prototype[e]=function(){return this.techGet_(e)}})),Yu.forEach((function(e){tl.prototype["handleTech"+os(e)+"_"]=function(){return this.trigger(e)}})),ps.registerComponent("Player",tl);var il={},rl=function(e){return il.hasOwnProperty(e)},al=function(e){return rl(e)?il[e]:void 0},sl=function(e,t){e.activePlugins_=e.activePlugins_||{},e.activePlugins_[t]=!0},ol=function(e,t,n){var i=(n?"before":"")+"pluginsetup";e.trigger(i,t),e.trigger(i+":"+t.name,t)},ul=function(e,t){return t.prototype.name=e,function(){ol(this,{name:e,plugin:t,instance:null},!0);for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];var a=Te(t,[this].concat(i));return this[e]=function(){return a},ol(this,a.getEventHash()),a}},ll=function(){function e(t){if(this.constructor===e)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=t,this.log||(this.log=this.player.log.createLogger(this.name)),is(this),delete this.trigger,as(this,this.constructor.defaultState),sl(t,this.name),this.dispose=this.dispose.bind(this),t.on("dispose",this.dispose)}var t=e.prototype;return t.version=function(){return this.constructor.VERSION},t.getEventHash=function(e){return void 0===e&&(e={}),e.name=this.name,e.plugin=this.constructor,e.instance=this,e},t.trigger=function(e,t){return void 0===t&&(t={}),ja(this.eventBusEl_,e,this.getEventHash(t))},t.handleStateChanged=function(e){},t.dispose=function(){var e=this.name,t=this.player;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t.activePlugins_[e]=!1,this.player=this.state=null,t[e]=ul(e,il[e])},e.isBasic=function(t){var n="string"==typeof t?al(t):t;return"function"==typeof n&&!e.prototype.isPrototypeOf(n.prototype)},e.registerPlugin=function(t,n){if("string"!=typeof t)throw new Error('Illegal plugin name, "'+t+'", must be a string, was '+_typeof2(t)+".");if(rl(t))pr.warn('A plugin named "'+t+'" already exists. You may want to avoid re-registering plugins!');else if(tl.prototype.hasOwnProperty(t))throw new Error('Illegal plugin name, "'+t+'", cannot share a name with an existing player method!');if("function"!=typeof n)throw new Error('Illegal plugin for "'+t+'", must be a function, was '+_typeof2(n)+".");return il[t]=n,"plugin"!==t&&(e.isBasic(n)?tl.prototype[t]=function(e,t){var n=function(){ol(this,{name:e,plugin:t,instance:null},!0);var n=t.apply(this,arguments);return sl(this,e),ol(this,{name:e,plugin:t,instance:n}),n};return Object.keys(t).forEach((function(e){n[e]=t[e]})),n}(t,n):tl.prototype[t]=ul(t,n)),n},e.deregisterPlugin=function(e){if("plugin"===e)throw new Error("Cannot de-register base plugin.");rl(e)&&(delete il[e],delete tl.prototype[e])},e.getPlugins=function(e){var t;return void 0===e&&(e=Object.keys(il)),e.forEach((function(e){var n=al(e);n&&((t=t||{})[e]=n)})),t},e.getPluginVersion=function(e){var t=al(e);return t&&t.VERSION||""},e}();ll.getPlugin=al,ll.BASE_PLUGIN_NAME="plugin",ll.registerPlugin("plugin",ll),tl.prototype.usingPlugin=function(e){return!!this.activePlugins_&&!0===this.activePlugins_[e]},tl.prototype.hasPlugin=function(e){return!!rl(e)};var cl=function(e){return 0===e.indexOf("#")?e.slice(1):e};function dl(e,t,n){var i=dl.getPlayer(e);if(i)return t&&pr.warn('Player "'+e+'" is already initialised. Options will not be applied.'),n&&i.ready(n),i;var r="string"==typeof e?ba("#"+cl(e)):e;if(!Kr(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");r.ownerDocument.defaultView&&r.ownerDocument.body.contains(r)||pr.warn("The element supplied is not included in the DOM"),t=t||{},ar("beforesetup").forEach((function(e){var n=e(r,us(t));_r(n)&&!Array.isArray(n)?t=us(t,n):pr.error("please return an object in beforesetup hooks")}));var a=ps.getComponent("Player");return i=new a(r,t,n),ar("setup").forEach((function(e){return e(i)})),i}if(dl.hooks_=rr,dl.hooks=ar,dl.hook=function(e,t){ar(e,t)},dl.hookOnce=function(e,t){ar(e,[].concat(t).map((function(t){return function n(){return sr(e,n),t.apply(void 0,arguments)}})))},dl.removeHook=sr,!0!==C.VIDEOJS_NO_DYNAMIC_STYLE&&Gr()){var hl=ba(".vjs-styles-defaults");if(!hl){hl=Pa("vjs-styles-defaults");var pl=ba("head");pl&&pl.insertBefore(hl,pl.firstChild),xa(hl,"\n      .video-js {\n        width: 300px;\n        height: 150px;\n      }\n\n      .vjs-fluid {\n        padding-top: 56.25%\n      }\n    ")}}Ca(1,dl),dl.VERSION="7.17.0",dl.options=tl.prototype.options_,dl.getPlayers=function(){return tl.players},dl.getPlayer=function(e){var t,n=tl.players;if("string"==typeof e){var i=cl(e),r=n[i];if(r)return r;t=ba("#"+i)}else t=e;if(Kr(t)){var a=t,s=a.player,o=a.playerId;if(s||n[o])return s||n[o]}},dl.getAllPlayers=function(){return Object.keys(tl.players).map((function(e){return tl.players[e]})).filter(Boolean)},dl.players=tl.players,dl.getComponent=ps.getComponent,dl.registerComponent=function(e,t){eo.isTech(t)&&pr.warn("The "+e+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),ps.registerComponent.call(ps,e,t)},dl.getTech=eo.getTech,dl.registerTech=eo.registerTech,dl.use=function(e,t){to[e]=to[e]||[],to[e].push(t)},Object.defineProperty(dl,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(dl.middleware,"TERMINATOR",{value:io,writeable:!1,enumerable:!0}),dl.browser=qr,dl.TOUCH_ENABLED=Br,dl.extend=function(e,t){void 0===t&&(t={});var n=function(){e.apply(this,arguments)},i={};for(var r in"object"===_typeof2(t)?(t.constructor!==Object.prototype.constructor&&(n=t.constructor),i=t):"function"==typeof t&&(n=t),ke(n,e),e&&(n.super_=e),i)i.hasOwnProperty(r)&&(n.prototype[r]=i[r]);return n},dl.mergeOptions=us,dl.bind=za,dl.registerPlugin=ll.registerPlugin,dl.deregisterPlugin=ll.deregisterPlugin,dl.plugin=function(e,t){return pr.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),ll.registerPlugin(e,t)},dl.getPlugins=ll.getPlugins,dl.getPlugin=ll.getPlugin,dl.getPluginVersion=ll.getPluginVersion,dl.addLanguage=function(e,t){var n;return e=(""+e).toLowerCase(),dl.options.languages=us(dl.options.languages,((n={})[e]=t,n)),dl.options.languages[e]},dl.log=pr,dl.createLogger=fr,dl.createTimeRange=dl.createTimeRanges=gs,dl.formatTime=Po,dl.setFormatTime=function(e){Io=e},dl.resetFormatTime=function(){Io=wo},dl.parseUrl=js,dl.isCrossOrigin=qs,dl.EventTarget=Ka,dl.on=Ba,dl.one=Ha,dl.off=Fa,dl.trigger=ja,dl.xhr=F,dl.TextTrack=Ks,dl.AudioTrack=Xs,dl.VideoTrack=Qs,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((function(e){dl[e]=function(){return pr.warn("videojs."+e+"() is deprecated; use videojs.dom."+e+"() instead"),ka[e].apply(null,arguments)}})),dl.computedStyle=Tr,dl.dom=ka,dl.url=Ws,dl.defineLazyProperty=Xu,dl.addLanguage("en",{"Non-Fullscreen":"Exit Fullscreen"});/*! @name @videojs/http-streaming @version 2.12.0 @license Apache-2.0 */
var fl=Ee,ml=function(e,t,n){return e&&n&&n.responseURL&&t!==n.responseURL?n.responseURL:t},gl=function(e){return dl.log.debug?dl.log.debug.bind(dl,"VHS:",e+" >"):function(){}},vl=function(e,t){var n,i=[];if(e&&e.length)for(n=0;n<e.length;n++)t(e.start(n),e.end(n))&&i.push([e.start(n),e.end(n)]);return dl.createTimeRanges(i)},yl=function(e,t){return vl(e,(function(e,n){return e-.1<=t&&n+.1>=t}))},_l=function(e,t){return vl(e,(function(e){return e-1/30>=t}))},bl=function(e){var t=[];if(!e||!e.length)return"";for(var n=0;n<e.length;n++)t.push(e.start(n)+" => "+e.end(n));return t.join(", ")},Tl=function(e){for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t},kl=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},Sl=function(e,t){var n=0;if(!e||!e.length)return n;for(var i=0;i<e.length;i++){var r=e.start(i),a=e.end(i);t>a||(n+=t>r&&t<=a?a-t:a-r)}return n},El=dl.createTimeRange,Cl=function(e,t){if(!t.preload)return t.duration;var n=0;return(t.parts||[]).forEach((function(e){n+=e.duration})),(t.preloadHints||[]).forEach((function(t){"PART"===t.type&&(n+=e.partTargetDuration)})),n},wl=function(e){return(e.segments||[]).reduce((function(e,t,n){return t.parts?t.parts.forEach((function(i,r){e.push({duration:i.duration,segmentIndex:n,partIndex:r,part:i,segment:t})})):e.push({duration:t.duration,segmentIndex:n,partIndex:null,segment:t,part:null}),e}),[])},Il=function(e){var t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},Pl=function(e){var t=e.preloadSegment;if(t){var n=t.parts,i=(t.preloadHints||[]).reduce((function(e,t){return e+("PART"===t.type?1:0)}),0);return i+=n&&n.length?n.length:0}},xl=function(e,t){if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;var n=Il(t).length>0;return n&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:n&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},Al=function(e,t,n){if(void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;var i=function(e,t){var n=0,i=t-e.mediaSequence,r=e.segments[i];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(;i--;){if(void 0!==(r=e.segments[i]).end)return{result:n+r.end,precise:!0};if(n+=Cl(e,r),void 0!==r.start)return{result:n+r.start,precise:!0}}return{result:n,precise:!1}}(e,t);if(i.precise)return i.result;var r=function(e,t){for(var n,i=0,r=t-e.mediaSequence;r<e.segments.length;r++){if(void 0!==(n=e.segments[r]).start)return{result:n.start-i,precise:!0};if(i+=Cl(e,n),void 0!==n.end)return{result:n.end-i,precise:!0}}return{result:-1,precise:!1}}(e,t);return r.precise?r.result:i.result+n},Ol=function(e,t,n){if(!e)return 0;if("number"!=typeof n&&(n=0),void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return C.Infinity}return Al(e,t,n)},Ll=function(e){var t=e.defaultDuration,n=e.durationList,i=e.startIndex,r=e.endIndex,a=0;if(i>r){var s=[r,i];i=s[0],r=s[1]}if(i<0){for(var o=i;o<Math.min(0,r);o++)a+=t;i=0}for(var u=i;u<r;u++)a+=n[u].duration;return a},Rl=function(e,t,n,i){if(!e||!e.segments)return null;if(e.endList)return Ol(e);if(null===t)return null;t=t||0;var r=Al(e,e.mediaSequence+e.segments.length,t);return n&&(r-=i="number"==typeof i?i:xl(null,e)),Math.max(0,r)},Dl=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},Ml=function(e){return e.excludeUntil&&e.excludeUntil===1/0},Nl=function(e){var t=Dl(e);return!e.disabled&&!t},Ul=function(e,t){return t.attributes&&t.attributes[e]},Bl=function(e,t){if(1===e.playlists.length)return!0;var n=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((function(e){return!!Nl(e)&&(e.attributes.BANDWIDTH||0)<n})).length},Fl=function(e,t){return!(!e&&!t||!e&&t||e&&!t)&&(e===t||(!(!e.id||!t.id||e.id!==t.id)||(!(!e.resolvedUri||!t.resolvedUri||e.resolvedUri!==t.resolvedUri)||!(!e.uri||!t.uri||e.uri!==t.uri))))},jl=function(e,t){var n=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{},i=!1;for(var r in n){for(var a in n[r])if(i=t(n[r][a]))break;if(i)break}return!!i},Hl=function(e){if(!e||!e.playlists||!e.playlists.length)return jl(e,(function(e){return e.playlists&&e.playlists.length||e.uri}));for(var t=function(t){var n=e.playlists[t],i=n.attributes&&n.attributes.CODECS;return i&&i.split(",").every((function(e){return je(e)}))||jl(e,(function(e){return Fl(n,e)}))?"continue":{v:!1}},n=0;n<e.playlists.length;n++){var i=t(n);if("continue"!==i&&"object"===_typeof2(i))return i.v}return!0},Vl={liveEdgeDelay:xl,duration:Ol,seekable:function(e,t,n){var i=t||0,r=Rl(e,t,!0,n);return null===r?El():El(i,r)},getMediaInfoForTime:function(e){for(var t=e.playlist,n=e.currentTime,i=e.startingSegmentIndex,r=e.startingPartIndex,a=e.startTime,s=e.experimentalExactManifestTimings,o=n-a,u=wl(t),l=0,c=0;c<u.length;c++){var d=u[c];if(i===d.segmentIndex&&("number"!=typeof r||"number"!=typeof d.partIndex||r===d.partIndex)){l=c;break}}if(o<0){if(l>0)for(var h=l-1;h>=0;h--){var p=u[h];if(o+=p.duration,s){if(o<0)continue}else if(o+1/30<=0)continue;return{partIndex:p.partIndex,segmentIndex:p.segmentIndex,startTime:a-Ll({defaultDuration:t.targetDuration,durationList:u,startIndex:l,endIndex:h})}}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:n}}if(l<0){for(var f=l;f<0;f++)if((o-=t.targetDuration)<0)return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:n};l=0}for(var m=l;m<u.length;m++){var g=u[m];if(o-=g.duration,s){if(o>0)continue}else if(o-1/30>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:a+Ll({defaultDuration:t.targetDuration,durationList:u,startIndex:l,endIndex:m})}}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:n}},isEnabled:Nl,isDisabled:function(e){return e.disabled},isBlacklisted:Dl,isIncompatible:Ml,playlistEnd:Rl,isAes:function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},hasAttribute:Ul,estimateSegmentRequestTime:function(e,t,n,i){return void 0===i&&(i=0),Ul("BANDWIDTH",n)?(e*n.attributes.BANDWIDTH-8*i)/t:NaN},isLowestEnabledRendition:Bl,isAudioOnly:Hl,playlistMatch:Fl,segmentDurationWithParts:Cl},ql=dl.log,Wl=function(e,t){return e+"-"+t},zl=function(e,t){e.mediaGroups&&["AUDIO","SUBTITLES"].forEach((function(n){if(e.mediaGroups[n])for(var i in e.mediaGroups[n])for(var r in e.mediaGroups[n][i]){var a=e.mediaGroups[n][i][r];t(a,n,i,r)}}))},Gl=function(e){var t=e.playlist,n=e.uri,i=e.id;t.id=i,t.playlistErrors_=0,n&&(t.uri=n),t.attributes=t.attributes||{}},Kl=function(e,t){e.uri=t;for(var n=0;n<e.playlists.length;n++)if(!e.playlists[n].uri){var i="placeholder-uri-"+n;e.playlists[n].uri=i}var r=Hl(e);zl(e,(function(t,n,i,a){var s="placeholder-uri-"+n+"-"+i+"-"+a;if(!t.playlists||!t.playlists.length){if(r&&"AUDIO"===n&&!t.uri)for(var o=0;o<e.playlists.length;o++){var u=e.playlists[o];if(u.attributes&&u.attributes.AUDIO&&u.attributes.AUDIO===i)return}t.playlists=[A({},t)]}t.playlists.forEach((function(t,n){var i=Wl(n,s);t.uri?t.resolvedUri=t.resolvedUri||fl(e.uri,t.uri):(t.uri=0===n?s:i,t.resolvedUri=t.uri),t.id=t.id||i,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t}))})),function(e){for(var t=e.playlists.length;t--;){var n=e.playlists[t];Gl({playlist:n,id:Wl(t,n.uri)}),n.resolvedUri=fl(e.uri,n.uri),e.playlists[n.id]=n,e.playlists[n.uri]=n,n.attributes.BANDWIDTH||ql.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}}(e),function(e){zl(e,(function(t){t.uri&&(t.resolvedUri=fl(e.uri,t.uri))}))}(e)},Xl=dl.mergeOptions,Ql=dl.EventTarget,Yl=function(e,t){if(!e)return t;var n=Xl(e,t);if(e.preloadHints&&!t.preloadHints&&delete n.preloadHints,e.parts&&!t.parts)delete n.parts;else if(e.parts&&t.parts)for(var i=0;i<t.parts.length;i++)e.parts&&e.parts[i]&&(n.parts[i]=Xl(e.parts[i],t.parts[i]));return!e.skipped&&t.skipped&&(n.skipped=!1),e.preload&&!t.preload&&(n.preload=!1),n},$l=function(e,t){!e.resolvedUri&&e.uri&&(e.resolvedUri=fl(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=fl(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=fl(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=fl(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach((function(e){e.resolvedUri||(e.resolvedUri=fl(t,e.uri))})),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach((function(e){e.resolvedUri||(e.resolvedUri=fl(t,e.uri))}))},Jl=function(e){var t=e.segments||[],n=e.preloadSegment;if(n&&n.parts&&n.parts.length){if(n.preloadHints)for(var i=0;i<n.preloadHints.length;i++)if("MAP"===n.preloadHints[i].type)return t;n.duration=e.targetDuration,n.preload=!0,t.push(n)}return t},Zl=function(e,t){return e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment},ec=function(e,t,n){void 0===n&&(n=Zl);var i=Xl(e,{}),r=i.playlists[t.id];if(!r)return null;if(n(r,t))return null;t.segments=Jl(t);var a=Xl(r,t);if(a.preloadSegment&&!t.preloadSegment&&delete a.preloadSegment,r.segments){if(t.skip){t.segments=t.segments||[];for(var s=0;s<t.skip.skippedSegments;s++)t.segments.unshift({skipped:!0})}a.segments=function(e,t,n){var i=e.slice(),r=t.slice();n=n||0;for(var a,s=[],o=0;o<r.length;o++){var u=i[o+n],l=r[o];u?(a=u.map||a,s.push(Yl(u,l))):(a&&!l.map&&(l.map=a),s.push(l))}return s}(r.segments,t.segments,t.mediaSequence-r.mediaSequence)}a.segments.forEach((function(e){$l(e,a.resolvedUri)}));for(var o=0;o<i.playlists.length;o++)i.playlists[o].id===t.id&&(i.playlists[o]=a);return i.playlists[t.id]=a,i.playlists[t.uri]=a,zl(e,(function(e,n,i,r){if(e.playlists)for(var a=0;a<e.playlists.length;a++)t.id===e.playlists[a].id&&(e.playlists[a]=t)})),i},tc=function(e,t){var n=e.segments||[],i=n[n.length-1],r=i&&i.parts&&i.parts[i.parts.length-1],a=r&&r.duration||i&&i.duration;return t&&a?1e3*a:500*(e.partTargetDuration||e.targetDuration||10)},nc=function(e){function t(t,n,i){var r;if(void 0===i&&(i={}),r=e.call(this)||this,!t)throw new Error("A non-empty playlist URL or object is required");r.logger_=gl("PlaylistLoader");var a=i,s=a.withCredentials,o=void 0!==s&&s,u=a.handleManifestRedirects,l=void 0!==u&&u;r.src=t,r.vhs_=n,r.withCredentials=o,r.handleManifestRedirects=l;var c=n.options_;return r.customTagParsers=c&&c.customTagParsers||[],r.customTagMappers=c&&c.customTagMappers||[],r.experimentalLLHLS=c&&c.experimentalLLHLS||!1,dl.browser.IE_VERSION&&(r.experimentalLLHLS=!1),r.state="HAVE_NOTHING",r.handleMediaupdatetimeout_=r.handleMediaupdatetimeout_.bind(O(r)),r.on("mediaupdatetimeout",r.handleMediaupdatetimeout_),r}R(t,e);var n=t.prototype;return n.handleMediaupdatetimeout_=function(){var e=this;if("HAVE_METADATA"===this.state){var t=this.media(),n=fl(this.master.uri,t.uri);this.experimentalLLHLS&&(n=function(e,t){if(t.endList||!t.serverControl)return e;var n={};if(t.serverControl.canBlockReload){var i=t.preloadSegment,r=t.mediaSequence+t.segments.length;if(i){var a=i.parts||[],s=Pl(t)-1;s>-1&&s!==a.length-1&&(n._HLS_part=s),(s>-1||a.length)&&r--}n._HLS_msn=r}if(t.serverControl&&t.serverControl.canSkipUntil&&(n._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(n).length){var o=new C.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach((function(e){n.hasOwnProperty(e)&&o.searchParams.set(e,n[e])})),e=o.toString()}return e}(n,t)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:n,withCredentials:this.withCredentials},(function(t,n){if(e.request)return t?e.playlistRequestError(e.request,e.media(),"HAVE_METADATA"):void e.haveMetadata({playlistString:e.request.responseText,url:e.media().uri,id:e.media().id})}))}},n.playlistRequestError=function(e,t,n){var i=t.uri,r=t.id;this.request=null,n&&(this.state=n),this.error={playlist:this.master.playlists[r],status:e.status,message:"HLS playlist request error at URL: "+i+".",responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")},n.parseManifest_=function(e){var t=this,n=e.url;return function(e){var t=e.onwarn,n=e.oninfo,i=e.manifestString,r=e.customTagParsers,a=void 0===r?[]:r,s=e.customTagMappers,o=void 0===s?[]:s,u=e.experimentalLLHLS,l=new De;t&&l.on("warn",t),n&&l.on("info",n),a.forEach((function(e){return l.addParser(e)})),o.forEach((function(e){return l.addTagMapper(e)})),l.push(i),l.end();var c=l.manifest;if(u||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach((function(e){c.hasOwnProperty(e)&&delete c[e]})),c.segments&&c.segments.forEach((function(e){["parts","preloadHints"].forEach((function(t){e.hasOwnProperty(t)&&delete e[t]}))}))),!c.targetDuration){var d=10;c.segments&&c.segments.length&&(d=c.segments.reduce((function(e,t){return Math.max(e,t.duration)}),0)),t&&t("manifest has no targetDuration defaulting to "+d),c.targetDuration=d}var h=Il(c);if(h.length&&!c.partTargetDuration){var p=h.reduce((function(e,t){return Math.max(e,t.duration)}),0);t&&(t("manifest has no partTargetDuration defaulting to "+p),ql.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),c.partTargetDuration=p}return c}({onwarn:function(e){var i=e.message;return t.logger_("m3u8-parser warn for "+n+": "+i)},oninfo:function(e){var i=e.message;return t.logger_("m3u8-parser info for "+n+": "+i)},manifestString:e.manifestString,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},n.haveMetadata=function(e){var t=e.playlistString,n=e.playlistObject,i=e.url,r=e.id;this.request=null,this.state="HAVE_METADATA";var a=n||this.parseManifest_({url:i,manifestString:t});a.lastRequest=Date.now(),Gl({playlist:a,uri:i,id:r});var s=ec(this.master,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,s?(this.master=s,this.media_=this.master.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(tc(this.media(),!!s)),this.trigger("loadedplaylist")},n.dispose=function(){this.trigger("dispose"),this.stopRequest(),C.clearTimeout(this.mediaUpdateTimeout),C.clearTimeout(this.finalRenditionTimeout),this.off()},n.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},n.media=function(e,t){var n=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}if(C.clearTimeout(this.finalRenditionTimeout),t){var i=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=C.setTimeout(this.media.bind(this,e,!1),i)}else{var r=this.state,a=!this.media_||e.id!==this.media_.id,s=this.master.playlists[e.id];if(s&&s.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(a&&(this.trigger("mediachanging"),"HAVE_MASTER"===r?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(tc(e,!0)),a){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},(function(t,i){if(n.request){if(e.lastRequest=Date.now(),e.resolvedUri=ml(n.handleManifestRedirects,e.resolvedUri,i),t)return n.playlistRequestError(n.request,e,r);n.haveMetadata({playlistString:i.responseText,url:e.uri,id:e.id}),"HAVE_MASTER"===r?n.trigger("loadedmetadata"):n.trigger("mediachange")}}))}}},n.pause=function(){this.mediaUpdateTimeout&&(C.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"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")},n.load=function(e){var t=this;this.mediaUpdateTimeout&&(C.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var n=this.media();if(e){var i=n?(n.partTargetDuration||n.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=C.setTimeout((function(){t.mediaUpdateTimeout=null,t.load()}),i)}else this.started?n&&!n.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()},n.updateMediaUpdateTimeout_=function(e){var t=this;this.mediaUpdateTimeout&&(C.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=C.setTimeout((function(){t.mediaUpdateTimeout=null,t.trigger("mediaupdatetimeout"),t.updateMediaUpdateTimeout_(e)}),e))},n.start=function(){var e=this;if(this.started=!0,"object"===_typeof2(this.src))return this.src.uri||(this.src.uri=C.location.href),this.src.resolvedUri=this.src.uri,void setTimeout((function(){e.setupInitialPlaylist(e.src)}),0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},(function(t,n){if(e.request){if(e.request=null,t)return e.error={status:n.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:n.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.src=ml(e.handleManifestRedirects,e.src,n);var i=e.parseManifest_({manifestString:n.responseText,url:e.src});e.setupInitialPlaylist(i)}}))},n.srcUri=function(){return"string"==typeof this.src?this.src:this.src.uri},n.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists)return this.master=e,Kl(this.master,this.srcUri()),e.playlists.forEach((function(e){e.segments=Jl(e),e.segments.forEach((function(t){$l(t,e.resolvedUri)}))})),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var t=this.srcUri()||C.location.href;this.master=function(e,t){var n=Wl(0,t),i={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:C.location.href,resolvedUri:C.location.href,playlists:[{uri:t,id:n,resolvedUri:t,attributes:{}}]};return i.playlists[n]=i.playlists[0],i.playlists[t]=i.playlists[0],i}(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},t}(Ql),ic=dl.xhr,rc=dl.mergeOptions,ac=function(e,t,n,i){var r="arraybuffer"===e.responseType?e.response:e.responseText;!t&&r&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=r.byteLength||r.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),n.headers&&(e.responseHeaders=n.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===n.statusCode||206===n.statusCode||0===n.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(r||e.responseText)))),i(t,e)},sc=function(){var e=function e(t,n){t=rc({timeout:45e3},t);var i=e.beforeRequest||dl.Vhs.xhr.beforeRequest;if(i&&"function"==typeof i){var r=i(t);r&&(t=r)}var a=(!0===dl.Vhs.xhr.original?ic:dl.Vhs.xhr)(t,(function(e,t){return ac(a,e,t,n)})),s=a.abort;return a.abort=function(){return a.aborted=!0,s.apply(a,arguments)},a.uri=t.uri,a.requestTime=Date.now(),a};return e.original=!0,e},oc=function(e){var t,n,i={};return e.byterange&&(i.Range=(t=e.byterange,n=t.offset+t.length-1,"bytes="+t.offset+"-"+n)),i},uc=function(e,t){return e.start(t)+"-"+e.end(t)},lc=function(e,t){var n=e.toString(16);return"00".substring(0,2-n.length)+n+(t%2?" ":"")},cc=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},dc=function(e){var t={};return Object.keys(e).forEach((function(n){var i=e[n];ArrayBuffer.isView(i)?t[n]={bytes:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength}:t[n]=i})),t},hc=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},pc=function(e){return e.resolvedUri},fc=function(e){for(var t=Array.prototype.slice.call(e),n="",i=0;i<t.length/16;i++)n+=t.slice(16*i,16*i+16).map(lc).join("")+" "+t.slice(16*i,16*i+16).map(cc).join("")+"\n";return n},mc=Object.freeze({__proto__:null,createTransferableMessage:dc,initSegmentId:hc,segmentKeyId:pc,hexDump:fc,tagDump:function(e){var t=e.bytes;return fc(t)},textRanges:function(e){var t,n="";for(t=0;t<e.length;t++)n+=uc(e,t)+" ";return n}}),gc=function(e){var t=e.playlist,n=e.time,i=void 0===n?void 0:n,r=e.callback;if(!r)throw new Error("getProgramTime: callback must be provided");if(!t||void 0===i)return r({message:"getProgramTime: playlist and time must be provided"});var a=function(e,t){if(!t||!t.segments||0===t.segments.length)return null;for(var n,i=0,r=0;r<t.segments.length&&!(e<=(i=(n=t.segments[r]).videoTimingInfo?n.videoTimingInfo.transmuxedPresentationEnd:i+n.duration));r++);var a=t.segments[t.segments.length-1];if(a.videoTimingInfo&&a.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>i){if(e>i+.25*a.duration)return null;n=a}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:i-n.duration,type:n.videoTimingInfo?"accurate":"estimate"}}(i,t);if(!a)return r({message:"valid programTime was not found"});if("estimate"===a.type)return r({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var s={mediaSeconds:i},o=function(e,t){if(!t.dateTimeObject)return null;var n=t.videoTimingInfo.transmuxerPrependedSeconds,i=e-(t.videoTimingInfo.transmuxedPresentationStart+n);return new Date(t.dateTimeObject.getTime()+1e3*i)}(i,a.segment);return o&&(s.programDateTime=o.toISOString()),r(null,s)},vc=function e(t){var n=t.programTime,i=t.playlist,r=t.retryCount,a=void 0===r?2:r,s=t.seekTo,o=t.pauseAfterSeek,u=void 0===o||o,l=t.tech,c=t.callback;if(!c)throw new Error("seekToProgramTime: callback must be provided");if(void 0===n||!i||!s)return c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!i.endList&&!l.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!function(e){if(!e.segments||0===e.segments.length)return!1;for(var t=0;t<e.segments.length;t++){if(!e.segments[t].dateTimeObject)return!1}return!0}(i))return c({message:"programDateTime tags must be provided in the manifest "+i.resolvedUri});var d=function(e,t){var n;try{n=new Date(e)}catch(e){return null}if(!t||!t.segments||0===t.segments.length)return null;var i=t.segments[0];if(n<i.dateTimeObject)return null;for(var r=0;r<t.segments.length-1;r++){if(i=t.segments[r],n<t.segments[r+1].dateTimeObject)break}var a,s=t.segments[t.segments.length-1],o=s.dateTimeObject,u=s.videoTimingInfo?(a=s.videoTimingInfo).transmuxedPresentationEnd-a.transmuxedPresentationStart-a.transmuxerPrependedSeconds:s.duration+.25*s.duration;return n>new Date(o.getTime()+1e3*u)?null:(n>o&&(i=s),{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:Vl.duration(t,t.mediaSequence+t.segments.indexOf(i)),type:i.videoTimingInfo?"accurate":"estimate"})}(n,i);if(!d)return c({message:n+" was not found in the stream"});var h=d.segment,p=function(e,t){var n,i;try{n=new Date(e),i=new Date(t)}catch(e){}var r=n.getTime();return(i.getTime()-r)/1e3}(h.dateTimeObject,n);if("estimate"===d.type)return 0===a?c({message:n+" is not buffered yet. Try again"}):(s(d.estimatedStart+p),void l.one("seeked",(function(){e({programTime:n,playlist:i,retryCount:a-1,seekTo:s,pauseAfterSeek:u,tech:l,callback:c})})));var f=h.start+p;l.one("seeked",(function(){return c(null,l.currentTime())})),u&&l.pause(),s(f)},yc=function(e,t){if(4===e.readyState)return t()},_c=function(e,t,n){var i,r=[],a=!1,s=function(e,t,i,r){return t.abort(),a=!0,n(e,t,i,r)},o=function(e,t){if(!a){if(e)return s(e,t,"",r);var n=t.responseText.substring(r&&r.byteLength||0,t.responseText.length);if(r=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if((t=t.filter((function(e){return e&&(e.byteLength||e.length)&&"string"!=typeof e}))).length<=1)return Ci(t[0]);var i=t.reduce((function(e,t,n){return e+(t.byteLength||t.length)}),0),r=new Uint8Array(i),a=0;return t.forEach((function(e){e=Ci(e),r.set(e,a),a+=e.byteLength})),r}(r,Ai(n,!0)),i=i||Ri(r),r.length<10||i&&r.length<i+2)return yc(t,(function(){return s(e,t,"",r)}));var o=tr(r);return"ts"===o&&r.length<188||!o&&r.length<376?yc(t,(function(){return s(e,t,"",r)})):s(null,t,o,r)}},u=t({uri:e,beforeSend:function(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",(function(t){return t.total,t.loaded,ac(e,null,{statusCode:e.status},o)}))}},(function(e,t){return ac(u,e,t,o)}));return u},bc=dl.EventTarget,Tc=dl.mergeOptions,kc=function(e,t){if(!Zl(e,t))return!1;if(e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx)return!1;if(e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(var n=0;n<e.segments.length;n++){var i=e.segments[n],r=t.segments[n];if(i.uri!==r.uri)return!1;if(i.byterange||r.byterange){var a=i.byterange,s=r.byterange;if(a&&!s||!a&&s)return!1;if(a.offset!==s.offset||a.length!==s.length)return!1}}return!0},Sc=function(e,t){return(Boolean(!e.map&&!t.map)||Boolean(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length))&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length},Ec=function(e,t){var n={};for(var i in e){var r=e[i].sidx;if(r){var a=Xn(r);if(!t[a])break;var s=t[a].sidxInfo;Sc(s,r)&&(n[a]=t[a])}}return n},Cc=function(e){function t(t,n,i,r){var a;void 0===i&&(i={}),(a=e.call(this)||this).masterPlaylistLoader_=r||O(a),r||(a.isMaster_=!0);var s=i,o=s.withCredentials,u=void 0!==o&&o,l=s.handleManifestRedirects,c=void 0!==l&&l;if(a.vhs_=n,a.withCredentials=u,a.handleManifestRedirects=c,!t)throw new Error("A non-empty playlist URL or object is required");return a.on("minimumUpdatePeriod",(function(){a.refreshXml_()})),a.on("mediaupdatetimeout",(function(){a.refreshMedia_(a.media().id)})),a.state="HAVE_NOTHING",a.loadedPlaylists_={},a.logger_=gl("DashPlaylistLoader"),a.isMaster_?(a.masterPlaylistLoader_.srcUrl=t,a.masterPlaylistLoader_.sidxMapping_={}):a.childPlaylist_=t,a}R(t,e);var n=t.prototype;return n.requestErrored_=function(e,t,n){return!this.request||(this.request=null,e?(this.error="object"!==_typeof2(e)||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2}:e,n&&(this.state=n),this.trigger("error"),!0):void 0)},n.addSidxSegments_=function(e,t,n){var i=this,r=e.sidx&&Xn(e.sidx);if(e.sidx&&r&&!this.masterPlaylistLoader_.sidxMapping_[r]){var a=ml(this.handleManifestRedirects,e.sidx.resolvedUri),s=function(a,s){if(!i.requestErrored_(a,s,t)){var o,u=i.masterPlaylistLoader_.sidxMapping_;try{o=Ei(Ci(s.response).subarray(8))}catch(e){return void i.requestErrored_(e,s,t)}return u[r]={sidxInfo:e.sidx,sidx:o},Kn(e,o,e.sidx.resolvedUri),n(!0)}};this.request=_c(a,this.vhs_.xhr,(function(t,n,r,o){if(t)return s(t,n);if(!r||"mp4"!==r)return s({status:n.status,message:"Unsupported "+(r||"unknown")+" container type for sidx segment at URL: "+a,response:"",playlist:e,internal:!0,blacklistDuration:1/0,code:2},n);var u=e.sidx.byterange,l=u.offset,c=u.length;if(o.length>=c+l)return s(t,{response:o.subarray(l,l+c),status:n.status,uri:n.uri});i.request=i.vhs_.xhr({uri:a,responseType:"arraybuffer",headers:oc({byterange:e.sidx.byterange})},s)}))}else this.mediaRequest_=C.setTimeout((function(){return n(!1)}),0)},n.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},C.clearTimeout(this.minimumUpdatePeriodTimeout_),C.clearTimeout(this.mediaRequest_),C.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},n.hasPendingRequest=function(){return this.request||this.mediaRequest_},n.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},n.media=function(e){var t=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var n=this.state;if("string"==typeof e){if(!this.masterPlaylistLoader_.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e]}var i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(i&&(this.trigger("mediachanging"),this.trigger("mediachange")));i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,n,(function(i){t.haveMetadata({startingState:n,playlist:e})})))},n.haveMetadata=function(e){var t=e.startingState,n=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[n.id]=n,this.mediaRequest_=null,this.refreshMedia_(n.id),"HAVE_MASTER"===t?this.trigger("loadedmetadata"):this.trigger("mediachange")},n.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),C.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(C.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)},n.load=function(e){var t=this;C.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var n=this.media();if(e){var i=n?n.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=C.setTimeout((function(){return t.load()}),i)}else this.started?n&&!n.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()},n.start=function(){var e=this;this.started=!0,this.isMaster_?this.requestMaster_((function(t,n){e.haveMaster_(),e.hasPendingRequest()||e.media_||e.media(e.masterPlaylistLoader_.master.playlists[0])})):this.mediaRequest_=C.setTimeout((function(){return e.haveMaster_()}),0)},n.requestMaster_=function(e){var t=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},(function(n,i){if(!t.requestErrored_(n,i)){var r=i.responseText!==t.masterPlaylistLoader_.masterXml_;return t.masterPlaylistLoader_.masterXml_=i.responseText,i.responseHeaders&&i.responseHeaders.date?t.masterLoaded_=Date.parse(i.responseHeaders.date):t.masterLoaded_=Date.now(),t.masterPlaylistLoader_.srcUrl=ml(t.handleManifestRedirects,t.masterPlaylistLoader_.srcUrl,i),r?(t.handleMaster_(),void t.syncClientServerClock_((function(){return e(i,r)}))):e(i,r)}"HAVE_NOTHING"===t.state&&(t.started=!1)}))},n.syncClientServerClock_=function(e){var t=this,n=ki(this.masterPlaylistLoader_.masterXml_);return null===n?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===n.method?(this.masterPlaylistLoader_.clientOffset_=n.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:fl(this.masterPlaylistLoader_.srcUrl,n.value),method:n.method,withCredentials:this.withCredentials},(function(i,r){if(t.request){if(i)return t.masterPlaylistLoader_.clientOffset_=t.masterLoaded_-Date.now(),e();var a;a="HEAD"===n.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):t.masterLoaded_:Date.parse(r.responseText),t.masterPlaylistLoader_.clientOffset_=a-Date.now(),e()}})))},n.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},n.handleMaster_=function(){this.mediaRequest_=null;var e,t,n,i,r,a,s=(e={masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_},t=e.masterXml,n=e.srcUrl,i=e.clientOffset,r=e.sidxMapping,a=Ti(t,{manifestUri:n,clientOffset:i,sidxMapping:r}),Kl(a,n),a),o=this.masterPlaylistLoader_.master;o&&(s=function(e,t,n){for(var i=!0,r=Tc(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod}),a=0;a<t.playlists.length;a++){var s=t.playlists[a];if(s.sidx){var o=Xn(s.sidx);n&&n[o]&&n[o].sidx&&Kn(s,n[o].sidx,s.sidx.resolvedUri)}var u=ec(r,s,kc);u&&(r=u,i=!1)}return zl(t,(function(e,t,n,a){if(e.playlists&&e.playlists.length){var s=e.playlists[0].id,o=ec(r,e.playlists[0],kc);o&&((r=o).mediaGroups[t][n][a].playlists[0]=r.playlists[s],i=!1)}})),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(i=!1),i?null:r}(o,s,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=s||o;var u=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return u&&u!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=u),(!o||s&&s.minimumUpdatePeriod!==o.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),Boolean(s)},n.updateMinimumUpdatePeriodTimeout_=function(){var e=this.masterPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(C.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);var t=e.master&&e.master.minimumUpdatePeriod;0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!=typeof t||t<=0?t<0&&this.logger_("found invalid minimumUpdatePeriod of "+t+", not setting a timeout"):this.createMUPTimeout_(t)},n.createMUPTimeout_=function(e){var t=this.masterPlaylistLoader_;t.minimumUpdatePeriodTimeout_=C.setTimeout((function(){t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)}),e)},n.refreshXml_=function(){var e=this;this.requestMaster_((function(t,n){var i,r,a;n&&(e.media_&&(e.media_=e.masterPlaylistLoader_.master.playlists[e.media_.id]),e.masterPlaylistLoader_.sidxMapping_=(i=e.masterPlaylistLoader_.master,r=e.masterPlaylistLoader_.sidxMapping_,a=Ec(i.playlists,r),zl(i,(function(e,t,n,i){if(e.playlists&&e.playlists.length){var s=e.playlists;a=Tc(a,Ec(s,r))}})),a),e.addSidxSegments_(e.media(),e.state,(function(t){e.refreshMedia_(e.media().id)})))}))},n.refreshMedia_=function(e){var t=this;if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var n=this.masterPlaylistLoader_.master.playlists,i=!this.media_||this.media_!==n[e];if(i?this.media_=n[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){!function e(){t.media().endList||(t.mediaUpdateTimeout=C.setTimeout((function(){t.trigger("mediaupdatetimeout"),e()}),tc(t.media(),Boolean(i))))}()}this.trigger("loadedplaylist")},t}(bc),wc={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30},Ic=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},Pc=function(e){return function(){var t=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(n){var t=new BlobBuilder;return t.append(e),URL.createObjectURL(t.getBlob())}}(e),n=Ic(new Worker(t));n.objURL=t;var i=n.terminate;return n.on=n.addEventListener,n.off=n.removeEventListener,n.terminate=function(){return URL.revokeObjectURL(t),i.call(this)},n}},xc=function(e){return"var browserWorkerPolyFill = "+Ic.toString()+";\nbrowserWorkerPolyFill(self);\n"+e},Ac=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},Oc=Pc(xc(Ac((function(){var e=function(){this.init=function(){var e={};this.on=function(t,n){e[t]||(e[t]=[]),e[t]=e[t].concat(n)},this.off=function(t,n){var i;return!!e[t]&&(i=e[t].indexOf(n),e[t]=e[t].slice(),e[t].splice(i,1),i>-1)},this.trigger=function(t){var n,i,r,a;if(n=e[t])if(2===arguments.length)for(r=n.length,i=0;i<r;++i)n[i].call(this,arguments[1]);else{for(a=[],i=arguments.length,i=1;i<arguments.length;++i)a.push(arguments[i]);for(r=n.length,i=0;i<r;++i)n[i].apply(this,a)}},this.dispose=function(){e={}}}};e.prototype.pipe=function(e){return this.on("data",(function(t){e.push(t)})),this.on("done",(function(t){e.flush(t)})),this.on("partialdone",(function(t){e.partialFlush(t)})),this.on("endedtimeline",(function(t){e.endTimeline(t)})),this.on("reset",(function(t){e.reset(t)})),e},e.prototype.push=function(e){this.trigger("data",e)},e.prototype.flush=function(e){this.trigger("done",e)},e.prototype.partialFlush=function(e){this.trigger("partialdone",e)},e.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)},e.prototype.reset=function(e){this.trigger("reset",e)};var t,n,i,r,a,s,o,u,l,c,d,h,p,f,m,g,v,y,_,b,T,k,S,E,C,w,I,P,x,A,O,L,R,D,M,N,U,B,F,j,H=e,V=Math.pow(2,32)-1;!function(){var e;if(k={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(e in k)k.hasOwnProperty(e)&&(k[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);S=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),C=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),E=new Uint8Array([0,0,0,1]),w=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]),I=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]),P={video:w,audio:I},O=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),A=new Uint8Array([0,0,0,0,0,0,0,0]),L=new Uint8Array([0,0,0,0,0,0,0,0]),R=L,D=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),M=L,x=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),t=function(e){var t,n,i=[],r=0;for(t=1;t<arguments.length;t++)i.push(arguments[t]);for(t=i.length;t--;)r+=i[t].byteLength;for(n=new Uint8Array(r+8),new DataView(n.buffer,n.byteOffset,n.byteLength).setUint32(0,n.byteLength),n.set(e,4),t=0,r=8;t<i.length;t++)n.set(i[t],r),r+=i[t].byteLength;return n},n=function(){return t(k.dinf,t(k.dref,O))},i=function(e){return t(k.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},m=function(e){return t(k.hdlr,P[e])},f=function(e){var n=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(n[12]=e.samplerate>>>24&255,n[13]=e.samplerate>>>16&255,n[14]=e.samplerate>>>8&255,n[15]=255&e.samplerate),t(k.mdhd,n)},p=function(e){return t(k.mdia,f(e),m(e.type),s(e))},a=function(e){return t(k.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},s=function(e){return t(k.minf,"video"===e.type?t(k.vmhd,x):t(k.smhd,A),n(),v(e))},o=function(e,n){for(var i=[],r=n.length;r--;)i[r]=_(n[r]);return t.apply(null,[k.moof,a(e)].concat(i))},u=function(e){for(var n=e.length,i=[];n--;)i[n]=d(e[n]);return t.apply(null,[k.moov,c(4294967295)].concat(i).concat(l(e)))},l=function(e){for(var n=e.length,i=[];n--;)i[n]=b(e[n]);return t.apply(null,[k.mvex].concat(i))},c=function(e){var n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return t(k.mvhd,n)},g=function(e){var n,i,r=e.samples||[],a=new Uint8Array(4+r.length);for(i=0;i<r.length;i++)n=r[i].flags,a[i+4]=n.dependsOn<<4|n.isDependedOn<<2|n.hasRedundancy;return t(k.sdtp,a)},v=function(e){return t(k.stbl,y(e),t(k.stts,M),t(k.stsc,R),t(k.stsz,D),t(k.stco,L))},y=function(e){return t(k.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===e.type?N(e):U(e))},N=function(e){var n,i,r=e.sps||[],a=e.pps||[],s=[],o=[];for(n=0;n<r.length;n++)s.push((65280&r[n].byteLength)>>>8),s.push(255&r[n].byteLength),s=s.concat(Array.prototype.slice.call(r[n]));for(n=0;n<a.length;n++)o.push((65280&a[n].byteLength)>>>8),o.push(255&a[n].byteLength),o=o.concat(Array.prototype.slice.call(a[n]));if(i=[k.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),t(k.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([r.length],s,[a.length],o))),t(k.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var u=e.sarRatio[0],l=e.sarRatio[1];i.push(t(k.pasp,new Uint8Array([(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u,(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l])))}return t.apply(null,i)},U=function(e){return t(k.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),i(e))},h=function(e){var n=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return t(k.tkhd,n)},_=function(e){var n,i,r,a,s,o;return n=t(k.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),s=Math.floor(e.baseMediaDecodeTime/(V+1)),o=Math.floor(e.baseMediaDecodeTime%(V+1)),i=t(k.tfdt,new Uint8Array([1,0,0,0,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),92,"audio"===e.type?(r=T(e,92),t(k.traf,n,i,r)):(a=g(e),r=T(e,a.length+92),t(k.traf,n,i,r,a))},d=function(e){return e.duration=e.duration||4294967295,t(k.trak,h(e),p(e))},b=function(e){var n=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(n[n.length-1]=0),t(k.trex,n)},j=function(e,t){var n=0,i=0,r=0,a=0;return e.length&&(void 0!==e[0].duration&&(n=1),void 0!==e[0].size&&(i=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,n|i|r|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},F=function(e,n){var i,r,a,s,o,u;for(n+=20+16*(s=e.samples||[]).length,a=j(s,n),(r=new Uint8Array(a.length+16*s.length)).set(a),i=a.length,u=0;u<s.length;u++)o=s[u],r[i++]=(4278190080&o.duration)>>>24,r[i++]=(16711680&o.duration)>>>16,r[i++]=(65280&o.duration)>>>8,r[i++]=255&o.duration,r[i++]=(4278190080&o.size)>>>24,r[i++]=(16711680&o.size)>>>16,r[i++]=(65280&o.size)>>>8,r[i++]=255&o.size,r[i++]=o.flags.isLeading<<2|o.flags.dependsOn,r[i++]=o.flags.isDependedOn<<6|o.flags.hasRedundancy<<4|o.flags.paddingValue<<1|o.flags.isNonSyncSample,r[i++]=61440&o.flags.degradationPriority,r[i++]=15&o.flags.degradationPriority,r[i++]=(4278190080&o.compositionTimeOffset)>>>24,r[i++]=(16711680&o.compositionTimeOffset)>>>16,r[i++]=(65280&o.compositionTimeOffset)>>>8,r[i++]=255&o.compositionTimeOffset;return t(k.trun,r)},B=function(e,n){var i,r,a,s,o,u;for(n+=20+8*(s=e.samples||[]).length,a=j(s,n),(i=new Uint8Array(a.length+8*s.length)).set(a),r=a.length,u=0;u<s.length;u++)o=s[u],i[r++]=(4278190080&o.duration)>>>24,i[r++]=(16711680&o.duration)>>>16,i[r++]=(65280&o.duration)>>>8,i[r++]=255&o.duration,i[r++]=(4278190080&o.size)>>>24,i[r++]=(16711680&o.size)>>>16,i[r++]=(65280&o.size)>>>8,i[r++]=255&o.size;return t(k.trun,i)},T=function(e,t){return"audio"===e.type?B(e,t):F(e,t)};r=function(){return t(k.ftyp,S,E,S,C)};var q,W,z,G,K,X,Q,Y,$=function(e){return t(k.mdat,e)},J=o,Z=function(e){var t,n=r(),i=u(e);return(t=new Uint8Array(n.byteLength+i.byteLength)).set(n),t.set(i,n.byteLength),t},ee=function(e,t){var n={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return n.dataOffset=t,n.compositionTimeOffset=e.pts-e.dts,n.duration=e.duration,n.size=4*e.length,n.size+=e.byteLength,e.keyFrame&&(n.flags.dependsOn=2,n.flags.isNonSyncSample=0),n},te=function(e){var t,n,i=[],r=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,i.byteLength=0,t=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(n=e[t]).nalUnitType?(i.length&&(i.duration=n.dts-i.dts,r.byteLength+=i.byteLength,r.nalCount+=i.length,r.duration+=i.duration,r.push(i)),(i=[n]).byteLength=n.data.byteLength,i.pts=n.pts,i.dts=n.dts):("slice_layer_without_partitioning_rbsp_idr"===n.nalUnitType&&(i.keyFrame=!0),i.duration=n.dts-i.dts,i.byteLength+=n.data.byteLength,i.push(n));return r.length&&(!i.duration||i.duration<=0)&&(i.duration=r[r.length-1].duration),r.byteLength+=i.byteLength,r.nalCount+=i.length,r.duration+=i.duration,r.push(i),r},ne=function(e){var t,n,i=[],r=[];for(i.byteLength=0,i.nalCount=0,i.duration=0,i.pts=e[0].pts,i.dts=e[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,t=0;t<e.length;t++)(n=e[t]).keyFrame?(i.length&&(r.push(i),r.byteLength+=i.byteLength,r.nalCount+=i.nalCount,r.duration+=i.duration),(i=[n]).nalCount=n.length,i.byteLength=n.byteLength,i.pts=n.pts,i.dts=n.dts,i.duration=n.duration):(i.duration+=n.duration,i.nalCount+=n.length,i.byteLength+=n.byteLength,i.push(n));return r.length&&i.duration<=0&&(i.duration=r[r.length-1].duration),r.byteLength+=i.byteLength,r.nalCount+=i.nalCount,r.duration+=i.duration,r.push(i),r},ie=function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},re=function(e,t){var n,i,r,a,s,o=t||0,u=[];for(n=0;n<e.length;n++)for(a=e[n],i=0;i<a.length;i++)s=a[i],o+=(r=ee(s,o)).size,u.push(r);return u},ae=function(e){var t,n,i,r,a,s,o=0,u=e.byteLength,l=e.nalCount,c=new Uint8Array(u+4*l),d=new DataView(c.buffer);for(t=0;t<e.length;t++)for(r=e[t],n=0;n<r.length;n++)for(a=r[n],i=0;i<a.length;i++)s=a[i],d.setUint32(o,s.data.byteLength),o+=4,c.set(s.data,o),o+=s.data.byteLength;return c},se=[33,16,5,32,164,27],oe=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],ue=function(e){for(var t=[];e--;)t.push(0);return t},le=function(){if(!q){var e={96e3:[se,[227,64],ue(154),[56]],88200:[se,[231],ue(170),[56]],64e3:[se,[248,192],ue(240),[56]],48e3:[se,[255,192],ue(268),[55,148,128],ue(54),[112]],44100:[se,[255,192],ue(268),[55,163,128],ue(84),[112]],32e3:[se,[255,192],ue(268),[55,234],ue(226),[112]],24e3:[se,[255,192],ue(268),[55,255,128],ue(268),[111,112],ue(126),[224]],16e3:[se,[255,192],ue(268),[55,255,128],ue(268),[111,255],ue(269),[223,108],ue(195),[1,192]],12e3:[oe,ue(268),[3,127,248],ue(268),[6,255,240],ue(268),[13,255,224],ue(268),[27,253,128],ue(259),[56]],11025:[oe,ue(268),[3,127,248],ue(268),[6,255,240],ue(268),[13,255,224],ue(268),[27,255,192],ue(268),[55,175,128],ue(108),[112]],8e3:[oe,ue(268),[3,121,16],ue(47),[7]]};t=e,q=Object.keys(t).reduce((function(e,n){return e[n]=new Uint8Array(t[n].reduce((function(e,t){return e.concat(t)}),[])),e}),{})}var t;return q};X=function(e,t){return W(K(e,t))},Q=function(e,t){return z(G(e),t)},Y=function(e,t,n){return G(n?e:e-t)};var ce=9e4,de=W=function(e){return 9e4*e},he=(z=function(e,t){return e*t},G=function(e){return e/9e4}),pe=(K=function(e,t){return e/t},X),fe=Q,me=Y,ge=function(e,t,n,i){var r,a,s,o,u,l=0,c=0,d=0;if(t.length&&(r=pe(e.baseMediaDecodeTime,e.samplerate),a=Math.ceil(ce/(e.samplerate/1024)),n&&i&&(l=r-Math.max(n,i),d=(c=Math.floor(l/a))*a),!(c<1||d>ce/2))){for((s=le()[e.samplerate])||(s=t[0].data),o=0;o<c;o++)u=t[0],t.splice(0,0,{data:s,dts:u.dts-a,pts:u.pts-a});return e.baseMediaDecodeTime-=Math.floor(fe(d,e.samplerate)),d}},ve=function(e,t,n){return t.minSegmentDts>=n?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=n&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))},ye=function(e){var t,n,i=[];for(t=0;t<e.length;t++)n=e[t],i.push({size:n.data.byteLength,duration:1024});return i},_e=function(e){var t,n,i=0,r=new Uint8Array(function(e){var t,n=0;for(t=0;t<e.length;t++)n+=e[t].data.byteLength;return n}(e));for(t=0;t<e.length;t++)n=e[t],r.set(n.data,i),i+=n.data.byteLength;return r},be=ce,Te=function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},ke=function(e,t){var n,i=e.minSegmentDts;return t||(i-=e.timelineStartInfo.dts),n=e.timelineStartInfo.baseMediaDecodeTime,n+=i,n=Math.max(0,n),"audio"===e.type&&(n*=e.samplerate/be,n=Math.floor(n)),n},Se=function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))},Ee=function(e){for(var t=0,n={payloadType:-1,payloadSize:0},i=0,r=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)i+=255,t++;for(i+=e[t++];255===e[t];)r+=255,t++;if(r+=e[t++],!n.payload&&4===i){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){n.payloadType=i,n.payloadSize=r,n.payload=e.subarray(t,t+r);break}n.payload=void 0}t+=r,i=0,r=0}return n},Ce=function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},we=function(e,t){var n,i,r,a,s=[];if(!(64&t[0]))return s;for(i=31&t[0],n=0;n<i;n++)a={type:3&t[(r=3*n)+2],pts:e},4&t[r+2]&&(a.ccData=t[r+3]<<8|t[r+4],s.push(a));return s},Ie=function(e){for(var t,n,i=e.byteLength,r=[],a=1;a<i-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=i-r.length,n=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),n[a]=e[s];return n},Pe=4,xe=function e(t){t=t||{},e.prototype.init.call(this),this.parse708captions_="boolean"!=typeof t.parse708captions||t.parse708captions,this.captionPackets_=[],this.ccStreams_=[new Fe(0,0),new Fe(0,1),new Fe(1,0),new Fe(1,1)],this.parse708captions_&&(this.cc708Stream_=new De({captionServices:t.captionServices})),this.reset(),this.ccStreams_.forEach((function(e){e.on("data",this.trigger.bind(this,"data")),e.on("partialdone",this.trigger.bind(this,"partialdone")),e.on("done",this.trigger.bind(this,"done"))}),this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};(xe.prototype=new H).push=function(e){var t,n,i;if("sei_rbsp"===e.nalUnitType&&(t=Ee(e.escapedRBSP)).payload&&t.payloadType===Pe&&(n=Ce(t)))if(e.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));i=we(e.pts,n),this.captionPackets_=this.captionPackets_.concat(i),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},xe.prototype.flushCCStreams=function(e){this.ccStreams_.forEach((function(t){return"flush"===e?t.flush():t.partialFlush()}),this)},xe.prototype.flushStream=function(e){this.captionPackets_.length?(this.captionPackets_.forEach((function(e,t){e.presortIndex=t})),this.captionPackets_.sort((function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts})),this.captionPackets_.forEach((function(e){e.type<2?this.dispatchCea608Packet(e):this.dispatchCea708Packet(e)}),this),this.captionPackets_.length=0,this.flushCCStreams(e)):this.flushCCStreams(e)},xe.prototype.flush=function(){return this.flushStream("flush")},xe.prototype.partialFlush=function(){return this.flushStream("partialFlush")},xe.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},xe.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},xe.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},xe.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},xe.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)},xe.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var Ae={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},Oe=function(e){return 32<=e&&e<=127||160<=e&&e<=255},Le=function(e){this.windowNum=e,this.reset()};Le.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},Le.prototype.getText=function(){return this.rows.join("\n")},Le.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},Le.prototype.newLine=function(e){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Le.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},Le.prototype.addText=function(e){this.rows[this.rowIdx]+=e},Le.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var Re=function(e,t,n){this.serviceNum=e,this.text="",this.currentWindow=new Le(-1),this.windows=[],this.stream=n,"string"==typeof t&&this.createTextDecoder(t)};Re.prototype.init=function(e,t){this.startPts=e;for(var n=0;n<8;n++)this.windows[n]=new Le(n),"function"==typeof t&&(this.windows[n].beforeRowOverflow=t)},Re.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},Re.prototype.createTextDecoder=function(e){if("undefined"==typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+e+" encoding. "+t})}};var De=function e(t){t=t||{},e.prototype.init.call(this);var n,i=this,r=t.captionServices||{},a={};Object.keys(r).forEach((function(e){n=r[e],/^SERVICE/.test(e)&&(a[e]=n.encoding)})),this.serviceEncodings=a,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(i.new708Packet(),i.add708Bytes(e)):(null===i.current708Packet&&i.new708Packet(),i.add708Bytes(e))}};De.prototype=new H,De.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},De.prototype.add708Bytes=function(e){var t=e.ccData,n=t>>>8,i=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(n),this.current708Packet.data.push(i)},De.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,n=null,i=null,r=0,a=t[r++];for(e.seq=a>>6,e.sizeCode=63&a;r<t.length;r++)i=31&(a=t[r++]),7===(n=a>>5)&&i>0&&(n=a=t[r++]),this.pushServiceBlock(n,r,i),i>0&&(r+=i-1)},De.prototype.pushServiceBlock=function(e,t,n){var i,r=t,a=this.current708Packet.data,s=this.services[e];for(s||(s=this.initService(e,r));r<t+n&&r<a.length;r++)i=a[r],Oe(i)?r=this.handleText(r,s):24===i?r=this.multiByteCharacter(r,s):16===i?r=this.extendedCommands(r,s):128<=i&&i<=135?r=this.setCurrentWindow(r,s):152<=i&&i<=159?r=this.defineWindow(r,s):136===i?r=this.clearWindows(r,s):140===i?r=this.deleteWindows(r,s):137===i?r=this.displayWindows(r,s):138===i?r=this.hideWindows(r,s):139===i?r=this.toggleWindows(r,s):151===i?r=this.setWindowAttributes(r,s):144===i?r=this.setPenAttributes(r,s):145===i?r=this.setPenColor(r,s):146===i?r=this.setPenLocation(r,s):143===i?s=this.reset(r,s):8===i?s.currentWindow.backspace():12===i?s.currentWindow.clearText():13===i?s.currentWindow.pendingNewLine=!0:14===i?s.currentWindow.clearText():141===i&&r++},De.prototype.extendedCommands=function(e,t){var n=this.current708Packet.data[++e];return Oe(n)&&(e=this.handleText(e,t,{isExtended:!0})),e},De.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},De.prototype.initService=function(e,t){var n,i,r=this;return(n="SERVICE"+e)in this.serviceEncodings&&(i=this.serviceEncodings[n]),this.services[e]=new Re(e,i,r),this.services[e].init(this.getPts(t),(function(t){r.flushDisplayed(t,r.services[e])})),this.services[e]},De.prototype.handleText=function(e,t,n){var i,r,a,s,o=n&&n.isExtended,u=n&&n.isMultiByte,l=this.current708Packet.data,c=o?4096:0,d=l[e],h=l[e+1],p=t.currentWindow;return t.textDecoder_&&!o?(u?(r=[d,h],e++):r=[d],i=t.textDecoder_.decode(new Uint8Array(r))):(s=Ae[a=c|d]||a,i=4096&a&&a===s?"":String.fromCharCode(s)),p.pendingNewLine&&!p.isEmpty()&&p.newLine(this.getPts(e)),p.pendingNewLine=!1,p.addText(i),e},De.prototype.multiByteCharacter=function(e,t){var n=this.current708Packet.data,i=n[e+1],r=n[e+2];return Oe(i)&&Oe(r)&&(e=this.handleText(++e,t,{isMultiByte:!0})),e},De.prototype.setCurrentWindow=function(e,t){var n=7&this.current708Packet.data[e];return t.setCurrentWindow(n),e},De.prototype.defineWindow=function(e,t){var n=this.current708Packet.data,i=n[e],r=7&i;t.setCurrentWindow(r);var a=t.currentWindow;return i=n[++e],a.visible=(32&i)>>5,a.rowLock=(16&i)>>4,a.columnLock=(8&i)>>3,a.priority=7&i,i=n[++e],a.relativePositioning=(128&i)>>7,a.anchorVertical=127&i,i=n[++e],a.anchorHorizontal=i,i=n[++e],a.anchorPoint=(240&i)>>4,a.rowCount=15&i,i=n[++e],a.columnCount=63&i,i=n[++e],a.windowStyle=(56&i)>>3,a.penStyle=7&i,a.virtualRowCount=a.rowCount+1,e},De.prototype.setWindowAttributes=function(e,t){var n=this.current708Packet.data,i=n[e],r=t.currentWindow.winAttr;return i=n[++e],r.fillOpacity=(192&i)>>6,r.fillRed=(48&i)>>4,r.fillGreen=(12&i)>>2,r.fillBlue=3&i,i=n[++e],r.borderType=(192&i)>>6,r.borderRed=(48&i)>>4,r.borderGreen=(12&i)>>2,r.borderBlue=3&i,i=n[++e],r.borderType+=(128&i)>>5,r.wordWrap=(64&i)>>6,r.printDirection=(48&i)>>4,r.scrollDirection=(12&i)>>2,r.justify=3&i,i=n[++e],r.effectSpeed=(240&i)>>4,r.effectDirection=(12&i)>>2,r.displayEffect=3&i,e},De.prototype.flushDisplayed=function(e,t){for(var n=[],i=0;i<8;i++)t.windows[i].visible&&!t.windows[i].isEmpty()&&n.push(t.windows[i].getText());t.endPts=e,t.text=n.join("\n\n"),this.pushCaption(t),t.startPts=e},De.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},De.prototype.displayWindows=function(e,t){var n=this.current708Packet.data[++e],i=this.getPts(e);this.flushDisplayed(i,t);for(var r=0;r<8;r++)n&1<<r&&(t.windows[r].visible=1);return e},De.prototype.hideWindows=function(e,t){var n=this.current708Packet.data[++e],i=this.getPts(e);this.flushDisplayed(i,t);for(var r=0;r<8;r++)n&1<<r&&(t.windows[r].visible=0);return e},De.prototype.toggleWindows=function(e,t){var n=this.current708Packet.data[++e],i=this.getPts(e);this.flushDisplayed(i,t);for(var r=0;r<8;r++)n&1<<r&&(t.windows[r].visible^=1);return e},De.prototype.clearWindows=function(e,t){var n=this.current708Packet.data[++e],i=this.getPts(e);this.flushDisplayed(i,t);for(var r=0;r<8;r++)n&1<<r&&t.windows[r].clearText();return e},De.prototype.deleteWindows=function(e,t){var n=this.current708Packet.data[++e],i=this.getPts(e);this.flushDisplayed(i,t);for(var r=0;r<8;r++)n&1<<r&&t.windows[r].reset();return e},De.prototype.setPenAttributes=function(e,t){var n=this.current708Packet.data,i=n[e],r=t.currentWindow.penAttr;return i=n[++e],r.textTag=(240&i)>>4,r.offset=(12&i)>>2,r.penSize=3&i,i=n[++e],r.italics=(128&i)>>7,r.underline=(64&i)>>6,r.edgeType=(56&i)>>3,r.fontStyle=7&i,e},De.prototype.setPenColor=function(e,t){var n=this.current708Packet.data,i=n[e],r=t.currentWindow.penColor;return i=n[++e],r.fgOpacity=(192&i)>>6,r.fgRed=(48&i)>>4,r.fgGreen=(12&i)>>2,r.fgBlue=3&i,i=n[++e],r.bgOpacity=(192&i)>>6,r.bgRed=(48&i)>>4,r.bgGreen=(12&i)>>2,r.bgBlue=3&i,i=n[++e],r.edgeRed=(48&i)>>4,r.edgeGreen=(12&i)>>2,r.edgeBlue=3&i,e},De.prototype.setPenLocation=function(e,t){var n=this.current708Packet.data,i=n[e],r=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,i=n[++e],r.row=15&i,i=n[++e],r.column=63&i,e},De.prototype.reset=function(e,t){var n=this.getPts(e);return this.flushDisplayed(n,t),this.initService(t.serviceNum,e)};var Me={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},Ne=function(e){return null===e?"":(e=Me[e]||e,String.fromCharCode(e))},Ue=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Be=function(){for(var e=[],t=15;t--;)e.push("");return e},Fe=function e(t,n){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=n||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,n,i,r,a;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),i=t>>>8,r=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),n=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=n,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===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);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Be();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Be();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Be()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(i,r))a=Ne((i=(3&i)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(i,r))"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=Ne((i=(3&i)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(i,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&r)&&this.addFormatting(e.pts,["i"]),1==(1&r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(i,r))this.column_+=3&r;else if(this.isPAC(i,r)){var s=Ue.indexOf(7968&t);"rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(e.pts,s)),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(r)&&14==(14&r)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(i)&&(0===r&&(r=null),a=Ne(i),a+=Ne(r),this[this.mode_](e.pts,a),this.column_+=a.length)}else this.lastControlCode_=null}};Fe.prototype=new H,Fe.prototype.flushDisplayed=function(e){var t=this.displayed_.map((function(e,t){try{return e.trim()}catch(e){return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."}),""}}),this).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},Fe.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Be(),this.nonDisplayed_=Be(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},Fe.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_},Fe.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},Fe.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},Fe.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},Fe.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},Fe.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},Fe.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},Fe.prototype.isNormalChar=function(e){return e>=32&&e<=127},Fe.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Be(),this.displayed_=Be()),void 0!==t&&t!==this.row_)for(var n=0;n<this.rollUpRows_;n++)this.displayed_[t-n]=this.displayed_[this.row_-n],this.displayed_[this.row_-n]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},Fe.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var n=t.reduce((function(e,t){return e+"<"+t+">"}),"");this[this.mode_](e,n)},Fe.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+"</"+t+">"}),"");this.formatting_=[],this[this.mode_](e,t)}},Fe.prototype.popOn=function(e,t){var n=this.nonDisplayed_[this.row_];n+=t,this.nonDisplayed_[this.row_]=n},Fe.prototype.rollUp=function(e,t){var n=this.displayed_[this.row_];n+=t,this.displayed_[this.row_]=n},Fe.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<15;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]=""},Fe.prototype.paintOn=function(e,t){var n=this.displayed_[this.row_];n+=t,this.displayed_[this.row_]=n};var je={CaptionStream:xe,Cea608Stream:Fe,Cea708Stream:De},He={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Ve=function(e,t){var n=1;for(e>t&&(n=-1);Math.abs(t-e)>4294967296;)e+=8589934592*n;return e},qe=function e(t){var n,i;e.prototype.init.call(this),this.type_=t||"shared",this.push=function(e){"shared"!==this.type_&&e.type!==this.type_||(void 0===i&&(i=e.dts),e.dts=Ve(e.dts,i),e.pts=Ve(e.pts,i),n=e.dts,this.trigger("data",e))},this.flush=function(){i=n,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){i=void 0,n=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};qe.prototype=new H;var We,ze=qe,Ge=Ve,Ke=function(e,t,n){var i,r="";for(i=t;i<n;i++)r+="%"+("00"+e[i].toString(16)).slice(-2);return r},Xe=function(e,t,n){return decodeURIComponent(Ke(e,t,n))},Qe=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Ye={TXXX:function(e){var t;if(3===e.data[0]){for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=Xe(e.data,1,t),e.value=Xe(e.data,t+1,e.data.length).replace(/\0*$/,"");break}e.data=e.value}},WXXX:function(e){var t;if(3===e.data[0])for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=Xe(e.data,1,t),e.url=Xe(e.data,t+1,e.data.length);break}},PRIV:function(e){var t,n;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=(n=e.data,unescape(Ke(n,0,t)));break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}};(We=function(e){var t,n={descriptor:e&&e.descriptor},i=0,r=[],a=0;if(We.prototype.init.call(this),this.dispatchType=He.METADATA_STREAM_TYPE.toString(16),n.descriptor)for(t=0;t<n.descriptor.length;t++)this.dispatchType+=("00"+n.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,n,s,o,u;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(a=0,r.length=0),0===r.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});else if(r.push(e),a+=e.data.byteLength,1===r.length&&(i=Qe(e.data.subarray(6,10)),i+=10),!(a<i)){for(t={data:new Uint8Array(i),frames:[],pts:r[0].pts,dts:r[0].dts},u=0;u<i;)t.data.set(r[0].data.subarray(0,i-u),u),u+=r[0].data.byteLength,a-=r[0].data.byteLength,r.shift();n=10,64&t.data[5]&&(n+=4,n+=Qe(t.data.subarray(10,14)),i-=Qe(t.data.subarray(16,20)));do{if((s=Qe(t.data.subarray(n+4,n+8)))<1)return void this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping metadata parsing."});if((o={id:String.fromCharCode(t.data[n],t.data[n+1],t.data[n+2],t.data[n+3]),data:t.data.subarray(n+10,n+s+10)}).key=o.id,Ye[o.id]&&(Ye[o.id](o),"com.apple.streaming.transportStreamTimestamp"===o.owner)){var l=o.data,c=(1&l[3])<<30|l[4]<<22|l[5]<<14|l[6]<<6|l[7]>>>2;c*=4,c+=3&l[7],o.timeStamp=c,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o)}t.frames.push(o),n+=10,n+=s}while(n<i);this.trigger("data",t)}}}).prototype=new H;var $e,Je,Ze,et=We,tt=ze;($e=function(){var e=new Uint8Array(188),t=0;$e.prototype.init.call(this),this.push=function(n){var i,r=0,a=188;for(t?((i=new Uint8Array(n.byteLength+t)).set(e.subarray(0,t)),i.set(n,t),t=0):i=n;a<i.byteLength;)71!==i[r]||71!==i[a]?(r++,a++):(this.trigger("data",i.subarray(r,a)),r+=188,a+=188);r<i.byteLength&&(e.set(i.subarray(r),0),t=i.byteLength-r)},this.flush=function(){188===t&&71===e[0]&&(this.trigger("data",e),t=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){t=0,this.trigger("reset")}}).prototype=new H,(Je=function(){var e,t,n,i;Je.prototype.init.call(this),i=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,i){var r=0;i.payloadUnitStartIndicator&&(r+=e[r]+1),"pat"===i.type?t(e.subarray(r),i):n(e.subarray(r),i)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],i.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=i.pmtPid},n=function(e,t){var n,r;if(1&e[5]){for(i.programMapTable={video:null,audio:null,"timed-metadata":{}},n=3+((15&e[1])<<8|e[2])-4,r=12+((15&e[10])<<8|e[11]);r<n;){var a=e[r],s=(31&e[r+1])<<8|e[r+2];a===He.H264_STREAM_TYPE&&null===i.programMapTable.video?i.programMapTable.video=s:a===He.ADTS_STREAM_TYPE&&null===i.programMapTable.audio?i.programMapTable.audio=s:a===He.METADATA_STREAM_TYPE&&(i.programMapTable["timed-metadata"][s]=a),r+=5+((15&e[r+3])<<8|e[r+4])}t.programMapTable=i.programMapTable}},this.push=function(t){var n={},i=4;if(n.payloadUnitStartIndicator=!!(64&t[1]),n.pid=31&t[1],n.pid<<=8,n.pid|=t[2],(48&t[3])>>>4>1&&(i+=t[i]+1),0===n.pid)n.type="pat",e(t.subarray(i),n),this.trigger("data",n);else if(n.pid===this.pmtPid)for(n.type="pmt",e(t.subarray(i),n),this.trigger("data",n);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,i,n]):this.processPes_(t,i,n)},this.processPes_=function(e,t,n){n.pid===this.programMapTable.video?n.streamType=He.H264_STREAM_TYPE:n.pid===this.programMapTable.audio?n.streamType=He.ADTS_STREAM_TYPE:n.streamType=this.programMapTable["timed-metadata"][n.pid],n.type="pes",n.data=e.subarray(t),this.trigger("data",n)}}).prototype=new H,Je.STREAM_TYPES={h264:27,adts:15},(Ze=function(){var e,t=this,n=!1,i={data:[],size:0},r={data:[],size:0},a={data:[],size:0},s=function(e,n,i){var r,a,s=new Uint8Array(e.size),o={type:n},u=0,l=0;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,u=0;u<e.data.length;u++)a=e.data[u],s.set(a.data,l),l+=a.data.byteLength;var c,d,h,p;d=o,p=(c=s)[0]<<16|c[1]<<8|c[2],d.data=new Uint8Array,1===p&&(d.packetLength=6+(c[4]<<8|c[5]),d.dataAlignmentIndicator=0!=(4&c[6]),192&(h=c[7])&&(d.pts=(14&c[9])<<27|(255&c[10])<<20|(254&c[11])<<12|(255&c[12])<<5|(254&c[13])>>>3,d.pts*=4,d.pts+=(6&c[13])>>>1,d.dts=d.pts,64&h&&(d.dts=(14&c[14])<<27|(255&c[15])<<20|(254&c[16])<<12|(255&c[17])<<5|(254&c[18])>>>3,d.dts*=4,d.dts+=(6&c[18])>>>1)),d.data=c.subarray(9+c[8])),r="video"===n||o.packetLength<=e.size,(i||r)&&(e.size=0,e.data.length=0),r&&t.trigger("data",o)}};Ze.prototype.init.call(this),this.push=function(o){({pat:function(){},pes:function(){var e,t;switch(o.streamType){case He.H264_STREAM_TYPE:e=i,t="video";break;case He.ADTS_STREAM_TYPE:e=r,t="audio";break;case He.METADATA_STREAM_TYPE:e=a,t="timed-metadata";break;default:return}o.payloadUnitStartIndicator&&s(e,t,!0),e.data.push(o),e.size+=o.data.byteLength},pmt:function(){var i={type:"metadata",tracks:[]};null!==(e=o.programMapTable).video&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),n=!0,t.trigger("data",i)}})[o.type]()},this.reset=function(){i.size=0,i.data.length=0,r.size=0,r.data.length=0,this.trigger("reset")},this.flushStreams_=function(){s(i,"video"),s(r,"audio"),s(a,"timed-metadata")},this.flush=function(){if(!n&&e){var i={type:"metadata",tracks:[]};null!==e.video&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",i)}n=!1,this.flushStreams_(),this.trigger("done")}}).prototype=new H;var nt={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:$e,TransportParseStream:Je,ElementaryStream:Ze,TimestampRolloverStream:tt,CaptionStream:je.CaptionStream,Cea608Stream:je.Cea608Stream,Cea708Stream:je.Cea708Stream,MetadataStream:et};for(var it in He)He.hasOwnProperty(it)&&(nt[it]=He[it]);var rt,at=nt,st=ce,ot=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(rt=function(e){var t,n=0;rt.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:"adts skiping bytes "+e+" to "+t+" in frame "+n+" outside syncword"})},this.push=function(i){var r,a,s,o,u,l=0;if(e||(n=0),"audio"===i.type){var c;for(t&&t.length?(s=t,(t=new Uint8Array(s.byteLength+i.data.byteLength)).set(s),t.set(i.data,s.byteLength)):t=i.data;l+7<t.length;)if(255===t[l]&&240==(246&t[l+1])){if("number"==typeof c&&(this.skipWarn_(c,l),c=null),a=2*(1&~t[l+1]),r=(3&t[l+3])<<11|t[l+4]<<3|(224&t[l+5])>>5,u=(o=1024*(1+(3&t[l+6])))*st/ot[(60&t[l+2])>>>2],t.byteLength-l<r)break;this.trigger("data",{pts:i.pts+n*u,dts:i.dts+n*u,sampleCount:o,audioobjecttype:1+(t[l+2]>>>6&3),channelcount:(1&t[l+2])<<2|(192&t[l+3])>>>6,samplerate:ot[(60&t[l+2])>>>2],samplingfrequencyindex:(60&t[l+2])>>>2,samplesize:16,data:t.subarray(l+7+a,l+r)}),n++,l+=r}else"number"!=typeof c&&(c=l),l++;"number"==typeof c&&(this.skipWarn_(c,l),c=null),t=t.subarray(l)}},this.flush=function(){n=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}}).prototype=new H;var ut,lt,ct,dt=rt,ht=function(e){var t=e.byteLength,n=0,i=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+i},this.loadWord=function(){var r=e.byteLength-t,a=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw new Error("no bytes available");a.set(e.subarray(r,r+s)),n=new DataView(a.buffer).getUint32(0),i=8*s,t-=s},this.skipBits=function(e){var r;i>e?(n<<=e,i-=e):(e-=i,e-=8*(r=Math.floor(e/8)),t-=r,this.loadWord(),n<<=e,i-=e)},this.readBits=function(e){var r=Math.min(i,e),a=n>>>32-r;return(i-=r)>0?n<<=r:t>0&&this.loadWord(),(r=e-r)>0?a<<r|this.readBits(r):a},this.skipLeadingZeros=function(){var e;for(e=0;e<i;++e)if(0!=(n&2147483648>>>e))return n<<=e,i-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};(lt=function(){var e,t,n=0;lt.prototype.init.call(this),this.push=function(i){var r;t?((r=new Uint8Array(t.byteLength+i.data.byteLength)).set(t),r.set(i.data,t.byteLength),t=r):t=i.data;for(var a=t.byteLength;n<a-3;n++)if(1===t[n+2]){e=n+5;break}for(;e<a;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}n+3!==e-2&&this.trigger("data",t.subarray(n+3,e-2));do{e++}while(1!==t[e]&&e<a);n=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(n+3,e-2)),n=e-2,e+=3;break;default:e+=3}t=t.subarray(n),e-=n,n=0},this.reset=function(){t=null,n=0,this.trigger("reset")},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(n+3)),t=null,n=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new H,ct={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(ut=function(){var e,t,n,i,r,a,s,o=new lt;ut.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,n=e.pts,i=e.dts,o.push(e))},o.on("data",(function(s){var o={trackId:t,pts:n,dts:i,data:s,nalUnitTypeCode:31&s[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=r(s.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=r(s.subarray(1)),o.config=a(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",o)})),o.on("done",(function(){e.trigger("done")})),o.on("partialdone",(function(){e.trigger("partialdone")})),o.on("reset",(function(){e.trigger("reset")})),o.on("endedtimeline",(function(){e.trigger("endedtimeline")})),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},s=function(e,t){var n,i=8,r=8;for(n=0;n<e;n++)0!==r&&(r=(i+t.readExpGolomb()+256)%256),i=0===r?i:r},r=function(e){for(var t,n,i=e.byteLength,r=[],a=1;a<i-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=i-r.length,n=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),n[a]=e[s];return n},a=function(e){var t,n,i,r,a,o,u,l,c,d,h,p,f=0,m=0,g=0,v=0,y=[1,1];if(n=(t=new ht(e)).readUnsignedByte(),r=t.readUnsignedByte(),i=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),ct[n]&&(3===(a=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(h=3!==a?8:12,p=0;p<h;p++)t.readBoolean()&&s(p<6?16:64,t);if(t.skipUnsignedExpGolomb(),0===(o=t.readUnsignedExpGolomb()))t.readUnsignedExpGolomb();else if(1===o)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),u=t.readUnsignedExpGolomb(),p=0;p<u;p++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),l=t.readUnsignedExpGolomb(),c=t.readUnsignedExpGolomb(),0===(d=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(f=t.readUnsignedExpGolomb(),m=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),v=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:y=[1,1];break;case 2:y=[12,11];break;case 3:y=[10,11];break;case 4:y=[16,11];break;case 5:y=[40,33];break;case 6:y=[24,11];break;case 7:y=[20,11];break;case 8:y=[32,11];break;case 9:y=[80,33];break;case 10:y=[18,11];break;case 11:y=[15,11];break;case 12:y=[64,33];break;case 13:y=[160,99];break;case 14:y=[4,3];break;case 15:y=[3,2];break;case 16:y=[2,1];break;case 255:y=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}y&&(y[0],y[1])}return{profileIdc:n,levelIdc:i,profileCompatibility:r,width:16*(l+1)-2*f-2*m,height:(2-d)*(c+1)*16-2*g-2*v,sarRatio:y}}}).prototype=new H;var pt,ft={H264Stream:ut,NalByteStream:lt},mt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],gt=function(e,t){var n=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return n=n>=0?n:0,(16&e[t+5])>>4?n+20:n+10},vt=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},yt={isLikelyAacData:function(e){var t=function e(t,n){return t.length-n<10||t[n]!=="I".charCodeAt(0)||t[n+1]!=="D".charCodeAt(0)||t[n+2]!=="3".charCodeAt(0)?n:e(t,n+=gt(t,n))}(e,0);return e.length>=t+2&&255==(255&e[t])&&240==(240&e[t+1])&&16==(22&e[t+1])},parseId3TagSize:gt,parseAdtsSize:function(e,t){var n=(224&e[t+5])>>5,i=e[t+4]<<3;return 6144&e[t+3]|i|n},parseType:function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240==(240&e[t+1])?"audio":null},parseSampleRate:function(e){for(var t=0;t+5<e.length;){if(255===e[t]&&240==(246&e[t+1]))return mt[(60&e[t+2])>>>2];t++}return null},parseAacTimestamp:function(e){var t,n,i;t=10,64&e[5]&&(t+=4,t+=vt(e.subarray(10,14)));do{if((n=vt(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){i=e.subarray(t+10,t+n+10);for(var r=0;r<i.byteLength;r++)if(0===i[r]){if("com.apple.streaming.transportStreamTimestamp"===unescape(function(e,t,n){var i,r="";for(i=t;i<n;i++)r+="%"+("00"+e[i].toString(16)).slice(-2);return r}(i,0,r))){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]}break}}t+=10,t+=n}while(t<e.byteLength);return null}};(pt=function(){var e=new Uint8Array,t=0;pt.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(n){var i,r,a,s,o=0,u=0;for(e.length?(s=e.length,(e=new Uint8Array(n.byteLength+s)).set(e.subarray(0,s)),e.set(n,s)):e=n;e.length-u>=3;)if(e[u]!=="I".charCodeAt(0)||e[u+1]!=="D".charCodeAt(0)||e[u+2]!=="3".charCodeAt(0))if(255!=(255&e[u])||240!=(240&e[u+1]))u++;else{if(e.length-u<7)break;if(u+(o=yt.parseAdtsSize(e,u))>e.length)break;a={type:"audio",data:e.subarray(u,u+o),pts:t,dts:t},this.trigger("data",a),u+=o}else{if(e.length-u<10)break;if(u+(o=yt.parseId3TagSize(e,u))>e.length)break;r={type:"timed-metadata",data:e.subarray(u,u+o)},this.trigger("data",r),u+=o}i=e.length-u,e=i>0?e.subarray(u):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new H;var _t,bt,Tt,kt,St=pt,Et=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Ct=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],wt=ft.H264Stream,It=yt.isLikelyAacData,Pt=ce,xt=function(e,t){t.stream=e,this.trigger("log",t)},At=function(e,t){for(var n=Object.keys(t),i=0;i<n.length;i++){var r=n[i];"headOfPipeline"!==r&&t[r].on&&t[r].on("log",xt.bind(e,r))}},Ot=function(e,t){var n;if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0},Lt=function(e,t,n,i,r,a){return{start:{dts:e,pts:e+(n-t)},end:{dts:e+(i-t),pts:e+(r-n)},prependedContentDuration:a,baseMediaDecodeTime:e}};(bt=function(e,t){var n,i=[],r=0,a=0,s=1/0;n=(t=t||{}).firstSequenceNumber||0,bt.prototype.init.call(this),this.push=function(t){Se(e,t),e&&Et.forEach((function(n){e[n]=t[n]})),i.push(t)},this.setEarliestDts=function(e){r=e},this.setVideoBaseMediaDecodeTime=function(e){s=e},this.setAudioAppendStart=function(e){a=e},this.flush=function(){var o,u,l,c,d,h,p;0!==i.length?(o=ve(i,e,r),e.baseMediaDecodeTime=ke(e,t.keepOriginalTimestamps),p=ge(e,o,a,s),e.samples=ye(o),l=$(_e(o)),i=[],u=J(n,[e]),c=new Uint8Array(u.byteLength+l.byteLength),n++,c.set(u),c.set(l,u.byteLength),Te(e),d=Math.ceil(1024*Pt/e.samplerate),o.length&&(h=o.length*d,this.trigger("segmentTimingInfo",Lt(pe(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+h,o[0].pts+h,p||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+h})),this.trigger("data",{track:e,boxes:c}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.reset=function(){Te(e),i=[],this.trigger("reset")}}).prototype=new H,(_t=function(e,t){var n,i,r,a=[],s=[];n=(t=t||{}).firstSequenceNumber||0,_t.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){Se(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||i||(i=t.config,e.sps=[t.data],Ct.forEach((function(t){e[t]=i[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||r||(r=t.data,e.pps=[t.data]),a.push(t)},this.flush=function(){for(var i,r,o,u,l,c,d,h,p=0;a.length&&"access_unit_delimiter_rbsp"!==a[0].nalUnitType;)a.shift();if(0===a.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(i=te(a),(o=ne(i))[0][0].keyFrame||((r=this.getGopForFusion_(a[0],e))?(p=r.duration,o.unshift(r),o.byteLength+=r.byteLength,o.nalCount+=r.nalCount,o.pts=r.pts,o.dts=r.dts,o.duration+=r.duration):o=ie(o)),s.length){var f;if(!(f=t.alignGopsAtEnd?this.alignGopsAtEnd_(o):this.alignGopsAtStart_(o)))return this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");Te(e),o=f}Se(e,o),e.samples=re(o),l=$(ae(o)),e.baseMediaDecodeTime=ke(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),d=o[0],h=o[o.length-1],this.trigger("segmentTimingInfo",Lt(e.baseMediaDecodeTime,d.dts,d.pts,h.dts+h.duration,h.pts+h.duration,p)),this.trigger("timingInfo",{start:o[0].pts,end:o[o.length-1].pts+o[o.length-1].duration}),this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),u=J(n,[e]),c=new Uint8Array(u.byteLength+l.byteLength),n++,c.set(u),c.set(l,u.byteLength),this.trigger("data",{track:e,boxes:c}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),a=[],this.gopCache_.length=0,s.length=0,this.trigger("reset")},this.resetStream_=function(){Te(e),i=void 0,r=void 0},this.getGopForFusion_=function(t){var n,i,r,a,s,o=1/0;for(s=0;s<this.gopCache_.length;s++)r=(a=this.gopCache_[s]).gop,e.pps&&Ot(e.pps[0],a.pps[0])&&e.sps&&Ot(e.sps[0],a.sps[0])&&(r.dts<e.timelineStartInfo.dts||(n=t.dts-r.dts-r.duration)>=-1e4&&n<=45e3&&(!i||o>n)&&(i=a,o=n));return i?i.gop:null},this.alignGopsAtStart_=function(e){var t,n,i,r,a,o,u,l;for(a=e.byteLength,o=e.nalCount,u=e.duration,t=n=0;t<s.length&&n<e.length&&(i=s[t],r=e[n],i.pts!==r.pts);)r.pts>i.pts?t++:(n++,a-=r.byteLength,o-=r.nalCount,u-=r.duration);return 0===n?e:n===e.length?null:((l=e.slice(n)).byteLength=a,l.duration=u,l.nalCount=o,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(e){var t,n,i,r,a,o,u;for(t=s.length-1,n=e.length-1,a=null,o=!1;t>=0&&n>=0;){if(i=s[t],r=e[n],i.pts===r.pts){o=!0;break}i.pts>r.pts?t--:(t===s.length-1&&(a=n),n--)}if(!o&&null===a)return null;if(0===(u=o?n:a))return e;var l=e.slice(u),c=l.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return l.byteLength=c.byteLength,l.duration=c.duration,l.nalCount=c.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l},this.alignGopsWith=function(e){s=e}}).prototype=new H,(kt=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,kt.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))}}).prototype=new H,kt.prototype.flush=function(e){var t,n,i,r,a=0,s={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,Ct.forEach((function(e){s.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,Et.forEach((function(e){s.info[e]=this.audioTrack[e]}),this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,i=Z(this.pendingTracks),s.initSegment=new Uint8Array(i.byteLength),s.initSegment.set(i),s.data=new Uint8Array(this.pendingBytes),r=0;r<this.pendingBoxes.length;r++)s.data.set(this.pendingBoxes[r],a),a+=this.pendingBoxes[r].byteLength;for(r=0;r<this.pendingCaptions.length;r++)(t=this.pendingCaptions[r]).startTime=me(t.startPts,o,this.keepOriginalTimestamps),t.endTime=me(t.endPts,o,this.keepOriginalTimestamps),s.captionStreams[t.stream]=!0,s.captions.push(t);for(r=0;r<this.pendingMetadata.length;r++)(n=this.pendingMetadata[r]).cueTime=me(n.pts,o,this.keepOriginalTimestamps),s.metadata.push(n);for(s.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",s),r=0;r<s.captions.length;r++)t=s.captions[r],this.trigger("caption",t);for(r=0;r<s.metadata.length;r++)n=s.metadata[r],this.trigger("id3Frame",n)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},kt.prototype.setRemux=function(e){this.remuxTracks=e},(Tt=function(e){var t,n,i=this,r=!0;Tt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="aac",r.metadataStream=new at.MetadataStream,r.aacStream=new St,r.audioTimestampRolloverStream=new at.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new at.TimestampRolloverStream("timed-metadata"),r.adtsStream=new dt,r.coalesceStream=new kt(e,r.metadataStream),r.headOfPipeline=r.aacStream,r.aacStream.pipe(r.audioTimestampRolloverStream).pipe(r.adtsStream),r.aacStream.pipe(r.timedMetadataTimestampRolloverStream).pipe(r.metadataStream).pipe(r.coalesceStream),r.metadataStream.on("timestamp",(function(e){r.aacStream.setTimestamp(e.timeStamp)})),r.aacStream.on("data",(function(a){"timed-metadata"!==a.type&&"audio"!==a.type||r.audioSegmentStream||(n=n||{timelineStartInfo:{baseMediaDecodeTime:i.baseMediaDecodeTime},codec:"adts",type:"audio"},r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new bt(n,e),r.audioSegmentStream.on("log",i.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",i.trigger.bind(i,"audioTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream),i.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!t}))})),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),At(this,r)},this.setupTsPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="ts",r.metadataStream=new at.MetadataStream,r.packetStream=new at.TransportPacketStream,r.parseStream=new at.TransportParseStream,r.elementaryStream=new at.ElementaryStream,r.timestampRolloverStream=new at.TimestampRolloverStream,r.adtsStream=new dt,r.h264Stream=new wt,r.captionStream=new at.CaptionStream(e),r.coalesceStream=new kt(e,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream).pipe(r.timestampRolloverStream),r.timestampRolloverStream.pipe(r.h264Stream),r.timestampRolloverStream.pipe(r.adtsStream),r.timestampRolloverStream.pipe(r.metadataStream).pipe(r.coalesceStream),r.h264Stream.pipe(r.captionStream).pipe(r.coalesceStream),r.elementaryStream.on("data",(function(a){var s;if("metadata"===a.type){for(s=a.tracks.length;s--;)t||"video"!==a.tracks[s].type?n||"audio"!==a.tracks[s].type||((n=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=i.baseMediaDecodeTime):(t=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=i.baseMediaDecodeTime;t&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new _t(t,e),r.videoSegmentStream.on("log",i.getLogTrigger_("videoSegmentStream")),r.videoSegmentStream.on("timelineStartInfo",(function(t){n&&!e.keepOriginalTimestamps&&(n.timelineStartInfo=t,r.audioSegmentStream.setEarliestDts(t.dts-i.baseMediaDecodeTime))})),r.videoSegmentStream.on("processedGopsInfo",i.trigger.bind(i,"gopInfo")),r.videoSegmentStream.on("segmentTimingInfo",i.trigger.bind(i,"videoSegmentTimingInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",(function(e){n&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),r.videoSegmentStream.on("timingInfo",i.trigger.bind(i,"videoTimingInfo")),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),n&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new bt(n,e),r.audioSegmentStream.on("log",i.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",i.trigger.bind(i,"audioTimingInfo")),r.audioSegmentStream.on("segmentTimingInfo",i.trigger.bind(i,"audioSegmentTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream)),i.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!t})}})),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("id3Frame",(function(e){e.dispatchType=r.metadataStream.dispatchType,i.trigger("id3Frame",e)})),r.coalesceStream.on("caption",this.trigger.bind(this,"caption")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),At(this,r)},this.setBaseMediaDecodeTime=function(i){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=i),n&&(n.timelineStartInfo.dts=void 0,n.timelineStartInfo.pts=void 0,Te(n),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,Te(t),r.captionStream.reset()),r.timestampRolloverStream&&r.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){n&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var n=this.transmuxPipeline_;e.remux=t,n&&n.coalesceStream&&n.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(n){n.stream=e,t.trigger("log",n)}},this.push=function(e){if(r){var t=It(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),r=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){r=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new H;var Rt,Dt,Mt,Nt={Transmuxer:Tt,VideoSegmentStream:_t,AudioSegmentStream:bt,AUDIO_PROPERTIES:Et,VIDEO_PROPERTIES:Ct,generateSegmentTimingInfo:Lt},Ut=function(e){return e>>>0},Bt=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3])},Ft=Ut,jt=function e(t,n){var i,r,a,s,o,u=[];if(!n.length)return null;for(i=0;i<t.byteLength;)r=Ft(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3]),a=Bt(t.subarray(i+4,i+8)),s=r>1?i+r:t.byteLength,a===n[0]&&(1===n.length?u.push(t.subarray(i+8,s)):(o=e(t.subarray(i+8,s),n.slice(1))).length&&(u=u.concat(o))),i=s;return u},Ht=Ut,Vt=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),baseMediaDecodeTime:Ht(e[4]<<24|e[5]<<16|e[6]<<8|e[7])};return 1===t.version&&(t.baseMediaDecodeTime*=Math.pow(2,32),t.baseMediaDecodeTime+=Ht(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),t},qt=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},Wt=function(e){var t,n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},i=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&n.flags[2],a=4&n.flags[2],s=1&n.flags[1],o=2&n.flags[1],u=4&n.flags[1],l=8&n.flags[1],c=i.getUint32(4),d=8;for(r&&(n.dataOffset=i.getInt32(d),d+=4),a&&c&&(t={flags:qt(e.subarray(d,d+4))},d+=4,s&&(t.duration=i.getUint32(d),d+=4),o&&(t.size=i.getUint32(d),d+=4),l&&(1===n.version?t.compositionTimeOffset=i.getInt32(d):t.compositionTimeOffset=i.getUint32(d),d+=4),n.samples.push(t),c--);c--;)t={},s&&(t.duration=i.getUint32(d),d+=4),o&&(t.size=i.getUint32(d),d+=4),u&&(t.flags=qt(e.subarray(d,d+4)),d+=4),l&&(1===n.version?t.compositionTimeOffset=i.getInt32(d):t.compositionTimeOffset=i.getUint32(d),d+=4),n.samples.push(t);return n},zt=function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:n.getUint32(4)},r=1&i.flags[2],a=2&i.flags[2],s=8&i.flags[2],o=16&i.flags[2],u=32&i.flags[2],l=65536&i.flags[0],c=131072&i.flags[0];return t=8,r&&(t+=4,i.baseDataOffset=n.getUint32(12),t+=4),a&&(i.sampleDescriptionIndex=n.getUint32(t),t+=4),s&&(i.defaultSampleDuration=n.getUint32(t),t+=4),o&&(i.defaultSampleSize=n.getUint32(t),t+=4),u&&(i.defaultSampleFlags=n.getUint32(t)),l&&(i.durationIsEmpty=!0),!r&&c&&(i.baseDataOffsetIsMoof=!0),i},Gt=Ie,Kt=je.CaptionStream,Xt=function(e,t){for(var n=e,i=0;i<t.length;i++){var r=t[i];if(n<r.size)return r;n-=r.size}return null},Qt=function(e,t){var n=jt(e,["moof","traf"]),i=jt(e,["mdat"]),r={},a=[];return i.forEach((function(e,t){var i=n[t];a.push({mdat:e,traf:i})})),a.forEach((function(e){var n,i=e.mdat,a=e.traf,s=jt(a,["tfhd"]),o=zt(s[0]),u=o.trackId,l=jt(a,["tfdt"]),c=l.length>0?Vt(l[0]).baseMediaDecodeTime:0,d=jt(a,["trun"]);t===u&&d.length>0&&(n=function(e,t,n){var i,r,a,s,o=new DataView(e.buffer,e.byteOffset,e.byteLength),u={logs:[],seiNals:[]};for(r=0;r+4<e.length;r+=a)if(a=o.getUint32(r),r+=4,!(a<=0))switch(31&e[r]){case 6:var l=e.subarray(r+1,r+1+a),c=Xt(r,t);if(i={nalUnitType:"sei_rbsp",size:a,data:l,escapedRBSP:Gt(l),trackId:n},c)i.pts=c.pts,i.dts=c.dts,s=c;else{if(!s){u.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+r+" for trackId "+n+". See mux.js#223."});break}i.pts=s.pts,i.dts=s.dts}u.seiNals.push(i)}return u}(i,function(e,t,n){var i=t,r=n.defaultSampleDuration||0,a=n.defaultSampleSize||0,s=n.trackId,o=[];return e.forEach((function(e){var t=Wt(e).samples;t.forEach((function(e){void 0===e.duration&&(e.duration=r),void 0===e.size&&(e.size=a),e.trackId=s,e.dts=i,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),e.pts=i+e.compositionTimeOffset,i+=e.duration})),o=o.concat(t)})),o}(d,c,o),u),r[u]||(r[u]={seiNals:[],logs:[]}),r[u].seiNals=r[u].seiNals.concat(n.seiNals),r[u].logs=r[u].logs.concat(n.logs))})),r},Yt=function(){var e,t,n,i,r,a,s=!1;this.isInitialized=function(){return s},this.init=function(t){e=new Kt,s=!0,a=!!t&&t.isPartial,e.on("data",(function(e){e.startTime=e.startPts/i,e.endTime=e.endPts/i,r.captions.push(e),r.captionStreams[e.stream]=!0})),e.on("log",(function(e){r.logs.push(e)}))},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"===_typeof2(t)&&0===Object.keys(t).length)&&(n!==e[0]||i!==t[n])},this.parse=function(e,a,s){var o;if(!this.isInitialized())return null;if(!a||!s)return null;if(this.isNewInit(a,s))n=a[0],i=s[n];else if(null===n||!i)return t.push(e),null;for(;t.length>0;){var u=t.shift();this.parse(u,a,s)}return(o=function(e,t,n){if(null===t)return null;var i=Qt(e,t)[t]||{};return{seiNals:i.seiNals,logs:i.logs,timescale:n}}(e,n,i))&&o.logs&&(r.logs=r.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),r):r.logs.length?{logs:r.logs,captions:[],captionStreams:[]}: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;a?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={},r.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],n=null,i=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},$t=Ut,Jt=function(e){return("00"+e.toString(16)).slice(-2)};Rt=function(e,t){var n,i,r;return n=jt(t,["moof","traf"]),i=[].concat.apply([],n.map((function(t){return jt(t,["tfhd"]).map((function(n){var i,r,a;return i=$t(n[4]<<24|n[5]<<16|n[6]<<8|n[7]),r=e[i]||9e4,(a="number"!=typeof(a=jt(t,["tfdt"]).map((function(e){var t,n;return t=e[0],n=$t(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),1===t&&(n*=Math.pow(2,32),n+=$t(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),n}))[0])||isNaN(a)?1/0:a)/r}))}))),r=Math.min.apply(null,i),isFinite(r)?r:0},Dt=function(e){var t=jt(e,["moov","trak"]),n=[];return t.forEach((function(e){var t,i,r={},a=jt(e,["tkhd"])[0];a&&(i=(t=new DataView(a.buffer,a.byteOffset,a.byteLength)).getUint8(0),r.id=0===i?t.getUint32(12):t.getUint32(20));var s=jt(e,["mdia","hdlr"])[0];if(s){var o=Bt(s.subarray(8,12));r.type="vide"===o?"video":"soun"===o?"audio":o}var u=jt(e,["mdia","minf","stbl","stsd"])[0];if(u){var l=u.subarray(8);r.codec=Bt(l.subarray(4,8));var c,d=jt(l,[r.codec])[0];d&&(/^[asm]vc[1-9]$/i.test(r.codec)?(c=d.subarray(78),"avcC"===Bt(c.subarray(4,8))&&c.length>11?(r.codec+=".",r.codec+=Jt(c[9]),r.codec+=Jt(c[10]),r.codec+=Jt(c[11])):r.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(r.codec)?(c=d.subarray(28),"esds"===Bt(c.subarray(4,8))&&c.length>20&&0!==c[19]?(r.codec+="."+Jt(c[19]),r.codec+="."+Jt(c[20]>>>2&63).replace(/^0/,"")):r.codec="mp4a.40.2"):r.codec=r.codec.toLowerCase())}var h=jt(e,["mdia","mdhd"])[0];h&&(r.timescale=Mt(h)),n.push(r)})),n};var Zt=Rt,en=Dt,tn=(Mt=function(e){var t=0===e[0]?12:20;return $t(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},function(e){var t=31&e[1];return t<<=8,t|=e[2]}),nn=function(e){return!!(64&e[1])},rn=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},an=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},sn={parseType:function(e,t){var n=tn(e);return 0===n?"pat":n===t?"pmt":t?"pes":null},parsePat:function(e){var t=nn(e),n=4+rn(e);return t&&(n+=e[n]+1),(31&e[n+10])<<8|e[n+11]},parsePmt:function(e){var t={},n=nn(e),i=4+rn(e);if(n&&(i+=e[i]+1),1&e[i+5]){var r;r=3+((15&e[i+1])<<8|e[i+2])-4;for(var a=12+((15&e[i+10])<<8|e[i+11]);a<r;){var s=i+a;t[(31&e[s+1])<<8|e[s+2]]=e[s],a+=5+((15&e[s+3])<<8|e[s+4])}return t}},parsePayloadUnitStartIndicator:nn,parsePesType:function(e,t){switch(t[tn(e)]){case He.H264_STREAM_TYPE:return"video";case He.ADTS_STREAM_TYPE:return"audio";case He.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!nn(e))return null;var t=4+rn(e);if(t>=e.byteLength)return null;var n,i=null;return 192&(n=e[t+7])&&((i={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,i.pts*=4,i.pts+=(6&e[t+13])>>>1,i.dts=i.pts,64&n&&(i.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,i.dts*=4,i.dts+=(6&e[t+18])>>>1)),i},videoPacketContainsKeyFrame:function(e){for(var t=4+rn(e),n=e.subarray(t),i=0,r=0,a=!1;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}r+3!==i-2&&"slice_layer_without_partitioning_rbsp_idr"===an(31&n[r+3])&&(a=!0);do{i++}while(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}"slice_layer_without_partitioning_rbsp_idr"===an(31&n[r+3])&&(a=!0),r=i-2,i+=3;break;default:i+=3}return n=n.subarray(r),i-=r,r=0,n&&n.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===an(31&n[r+3])&&(a=!0),a}},on=Ge,un={};un.ts=sn,un.aac=yt;var ln=ce,cn=function(e,t,n){for(var i,r,a,s,o=0,u=188,l=!1;u<=e.byteLength;)if(71!==e[o]||71!==e[u]&&u!==e.byteLength)o++,u++;else{switch(i=e.subarray(o,u),un.ts.parseType(i,t.pid)){case"pes":r=un.ts.parsePesType(i,t.table),a=un.ts.parsePayloadUnitStartIndicator(i),"audio"===r&&a&&(s=un.ts.parsePesTime(i))&&(s.type="audio",n.audio.push(s),l=!0)}if(l)break;o+=188,u+=188}for(o=(u=e.byteLength)-188,l=!1;o>=0;)if(71!==e[o]||71!==e[u]&&u!==e.byteLength)o--,u--;else{switch(i=e.subarray(o,u),un.ts.parseType(i,t.pid)){case"pes":r=un.ts.parsePesType(i,t.table),a=un.ts.parsePayloadUnitStartIndicator(i),"audio"===r&&a&&(s=un.ts.parsePesTime(i))&&(s.type="audio",n.audio.push(s),l=!0)}if(l)break;o-=188,u-=188}},dn=function(e,t,n){for(var i,r,a,s,o,u,l,c=0,d=188,h=!1,p={data:[],size:0};d<e.byteLength;)if(71!==e[c]||71!==e[d])c++,d++;else{switch(i=e.subarray(c,d),un.ts.parseType(i,t.pid)){case"pes":if(r=un.ts.parsePesType(i,t.table),a=un.ts.parsePayloadUnitStartIndicator(i),"video"===r&&(a&&!h&&(s=un.ts.parsePesTime(i))&&(s.type="video",n.video.push(s),h=!0),!n.firstKeyFrame)){if(a&&0!==p.size){for(o=new Uint8Array(p.size),u=0;p.data.length;)l=p.data.shift(),o.set(l,u),u+=l.byteLength;if(un.ts.videoPacketContainsKeyFrame(o)){var f=un.ts.parsePesTime(o);f?(n.firstKeyFrame=f,n.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}p.size=0}p.data.push(i),p.size+=i.byteLength}}if(h&&n.firstKeyFrame)break;c+=188,d+=188}for(c=(d=e.byteLength)-188,h=!1;c>=0;)if(71!==e[c]||71!==e[d])c--,d--;else{switch(i=e.subarray(c,d),un.ts.parseType(i,t.pid)){case"pes":r=un.ts.parsePesType(i,t.table),a=un.ts.parsePayloadUnitStartIndicator(i),"video"===r&&a&&(s=un.ts.parsePesTime(i))&&(s.type="video",n.video.push(s),h=!0)}if(h)break;c-=188,d-=188}},hn=function(e){var t={pid:null,table:null},n={};for(var i in function(e,t){for(var n,i=0,r=188;r<e.byteLength;)if(71!==e[i]||71!==e[r])i++,r++;else{switch(n=e.subarray(i,r),un.ts.parseType(n,t.pid)){case"pat":t.pid=un.ts.parsePat(n);break;case"pmt":var a=un.ts.parsePmt(n);t.table=t.table||{},Object.keys(a).forEach((function(e){t.table[e]=a[e]}))}i+=188,r+=188}}(e,t),t.table){if(t.table.hasOwnProperty(i))switch(t.table[i]){case He.H264_STREAM_TYPE:n.video=[],dn(e,t,n),0===n.video.length&&delete n.video;break;case He.ADTS_STREAM_TYPE:n.audio=[],cn(e,t,n),0===n.audio.length&&delete n.audio}}return n},pn=function(e,t){var n;return(n=un.aac.isLikelyAacData(e)?function(e){for(var t,n=!1,i=0,r=null,a=null,s=0,o=0;e.length-o>=3;){switch(un.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){n=!0;break}if((s=un.aac.parseId3TagSize(e,o))>e.length){n=!0;break}null===a&&(t=e.subarray(o,o+s),a=un.aac.parseAacTimestamp(t)),o+=s;break;case"audio":if(e.length-o<7){n=!0;break}if((s=un.aac.parseAdtsSize(e,o))>e.length){n=!0;break}null===r&&(t=e.subarray(o,o+s),r=un.aac.parseSampleRate(t)),i++,o+=s;break;default:o++}if(n)return null}if(null===r||null===a)return null;var u=ln/r;return{audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+1024*i*u,pts:a+1024*i*u}]}}(e):hn(e))&&(n.audio||n.video)?(function(e,t){if(e.audio&&e.audio.length){var n=t;(void 0===n||isNaN(n))&&(n=e.audio[0].dts),e.audio.forEach((function(e){e.dts=on(e.dts,n),e.pts=on(e.pts,n),e.dtsTime=e.dts/ln,e.ptsTime=e.pts/ln}))}if(e.video&&e.video.length){var i=t;if((void 0===i||isNaN(i))&&(i=e.video[0].dts),e.video.forEach((function(e){e.dts=on(e.dts,i),e.pts=on(e.pts,i),e.dtsTime=e.dts/ln,e.ptsTime=e.pts/ln})),e.firstKeyFrame){var r=e.firstKeyFrame;r.dts=on(r.dts,i),r.pts=on(r.pts,i),r.dtsTime=r.dts/ln,r.ptsTime=r.pts/ln}}}(n,t),n):null},fn=function(){function e(e,t){this.options=t||{},this.self=e,this.init()}var t=e.prototype;return t.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Nt.Transmuxer(this.options),function(e,t){t.on("data",(function(t){var n=t.initSegment;t.initSegment={data:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength};var i=t.data;t.data=i.buffer,e.postMessage({action:"data",segment:t,byteOffset:i.byteOffset,byteLength:i.byteLength},[t.data])})),t.on("done",(function(t){e.postMessage({action:"done"})})),t.on("gopInfo",(function(t){e.postMessage({action:"gopInfo",gopInfo:t})})),t.on("videoSegmentTimingInfo",(function(t){var n={start:{decode:he(t.start.dts),presentation:he(t.start.pts)},end:{decode:he(t.end.dts),presentation:he(t.end.pts)},baseMediaDecodeTime:he(t.baseMediaDecodeTime)};t.prependedContentDuration&&(n.prependedContentDuration=he(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:n})})),t.on("audioSegmentTimingInfo",(function(t){var n={start:{decode:he(t.start.dts),presentation:he(t.start.pts)},end:{decode:he(t.end.dts),presentation:he(t.end.pts)},baseMediaDecodeTime:he(t.baseMediaDecodeTime)};t.prependedContentDuration&&(n.prependedContentDuration=he(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:n})})),t.on("id3Frame",(function(t){e.postMessage({action:"id3Frame",id3Frame:t})})),t.on("caption",(function(t){e.postMessage({action:"caption",caption:t})})),t.on("trackinfo",(function(t){e.postMessage({action:"trackinfo",trackInfo:t})})),t.on("audioTimingInfo",(function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:he(t.start),end:he(t.end)}})})),t.on("videoTimingInfo",(function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:he(t.start),end:he(t.end)}})})),t.on("log",(function(t){e.postMessage({action:"log",log:t})}))}(this.self,this.transmuxer)},t.pushMp4Captions=function(e){this.captionParser||(this.captionParser=new Yt,this.captionParser.init());var t=new Uint8Array(e.data,e.byteOffset,e.byteLength),n=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:n&&n.captions||[],logs:n&&n.logs||[],data:t.buffer},[t.buffer])},t.probeMp4StartTime=function(e){var t=e.timescales,n=e.data,i=Zt(t,n);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:n},[n.buffer])},t.probeMp4Tracks=function(e){var t=e.data,n=en(t);this.self.postMessage({action:"probeMp4Tracks",tracks:n,data:t},[t.buffer])},t.probeTs=function(e){var t=e.data,n=e.baseStartTime,i="number"!=typeof n||isNaN(n)?void 0:n*ce,r=pn(t,i),a=null;r&&((a={hasVideo:r.video&&2===r.video.length||!1,hasAudio:r.audio&&2===r.audio.length||!1}).hasVideo&&(a.videoStart=r.video[0].ptsTime),a.hasAudio&&(a.audioStart=r.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:a,data:t},[t.buffer])},t.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},t.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},t.push=function(e){var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)},t.reset=function(){this.transmuxer.reset()},t.setTimestampOffset=function(e){var t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(de(t)))},t.setAudioAppendStart=function(e){this.transmuxer.setAudioAppendStart(Math.ceil(de(e.appendStart)))},t.setRemux=function(e){this.transmuxer.setRemux(e.remux)},t.flush=function(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},t.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},t.alignGopsWith=function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())},e}();self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new fn(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new fn(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}})))),Lc=function(e){var t=e.transmuxer,n=e.bytes,i=e.audioAppendStart,r=e.gopsToAlignWith,a=e.remux,s=e.onData,o=e.onTrackInfo,u=e.onAudioTimingInfo,l=e.onVideoTimingInfo,c=e.onVideoSegmentTimingInfo,d=e.onAudioSegmentTimingInfo,h=e.onId3,p=e.onCaptions,f=e.onDone,m=e.onEndedTimeline,g=e.onTransmuxerLog,v=e.isEndOfTimeline,y={buffer:[]},_=v;if(t.onmessage=function(n){t.currentTransmux===e&&("data"===n.data.action&&function(e,t,n){var i=e.data.segment,r=i.type,a=i.initSegment,s=i.captions,o=i.captionStreams,u=i.metadata,l=i.videoFrameDtsTime,c=i.videoFramePtsTime;t.buffer.push({captions:s,captionStreams:o,metadata:u});var d=e.data.segment.boxes||{data:e.data.segment.data},h={type:r,data:new Uint8Array(d.data,d.data.byteOffset,d.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)};void 0!==l&&(h.videoFrameDtsTime=l),void 0!==c&&(h.videoFramePtsTime=c),n(h)}(n,y,s),"trackinfo"===n.data.action&&o(n.data.trackInfo),"gopInfo"===n.data.action&&function(e,t){t.gopInfo=e.data.gopInfo}(n,y),"audioTimingInfo"===n.data.action&&u(n.data.audioTimingInfo),"videoTimingInfo"===n.data.action&&l(n.data.videoTimingInfo),"videoSegmentTimingInfo"===n.data.action&&c(n.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===n.data.action&&d(n.data.audioSegmentTimingInfo),"id3Frame"===n.data.action&&h([n.data.id3Frame],n.data.id3Frame.dispatchType),"caption"===n.data.action&&p(n.data.caption),"endedtimeline"===n.data.action&&(_=!1,m()),"log"===n.data.action&&g(n.data.log),"transmuxed"===n.data.type&&(_||(t.onmessage=null,function(e){var t=e.transmuxedData,n=e.callback;t.buffer=[],n(t)}({transmuxedData:y,callback:f}),Rc(t))))},i&&t.postMessage({action:"setAudioAppendStart",appendStart:i}),Array.isArray(r)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),void 0!==a&&t.postMessage({action:"setRemux",remux:a}),n.byteLength){var b=n instanceof ArrayBuffer?n:n.buffer,T=n instanceof ArrayBuffer?0:n.byteOffset;t.postMessage({action:"push",data:b,byteOffset:T,byteLength:n.byteLength},[b])}v&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},Rc=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():Lc(e.currentTransmux))},Dc=function(e,t){e.postMessage({action:t}),Rc(e)},Mc=function(e,t){if(!t.currentTransmux)return t.currentTransmux=e,void Dc(t,e);t.transmuxQueue.push(Dc.bind(null,t,e))},Nc=function(e){if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void Lc(e);e.transmuxer.transmuxQueue.push(e)},Uc=function(e){Mc("reset",e)},Bc=function(e){var t=new Oc;t.currentTransmux=null,t.transmuxQueue=[];var n=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,n.call(t)},t.postMessage({action:"init",options:e}),t},Fc=function(e){var t=e.transmuxer,n=e.endAction||e.action,i=e.callback,r=A({},e,{endAction:null,transmuxer:null,callback:null});if(t.addEventListener("message",(function r(a){a.data.action===n&&(t.removeEventListener("message",r),a.data.data&&(a.data.data=new Uint8Array(a.data.data,e.byteOffset||0,e.byteLength||a.data.data.byteLength),e.data&&(e.data=a.data.data)),i(a.data))})),e.data){var a=e.data instanceof ArrayBuffer;r.byteOffset=a?0:e.data.byteOffset,r.byteLength=e.data.byteLength;var s=[a?e.data:e.data.buffer];t.postMessage(r,s)}else t.postMessage(r)},jc=2,Hc=-101,Vc=-102,qc=function(e){e.forEach((function(e){e.abort()}))},Wc=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Hc,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Vc,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:jc,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:jc,xhr:t}:null},zc=function(e,t,n){return function(i,r){var a=r.response,s=Wc(i,r);if(s)return n(s,e);if(16!==a.byteLength)return n({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:jc,xhr:r},e);for(var o=new DataView(a),u=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]),l=0;l<t.length;l++)t[l].bytes=u;return n(null,e)}},Gc=function(e,t){var n=tr(e.map.bytes);if("mp4"!==n){var i=e.map.resolvedUri||e.map.uri;return t({internal:!0,message:"Found unsupported "+(n||"unknown")+" container for initialization segment at URL: "+i,code:jc})}Fc({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:function(n){var i=n.tracks,r=n.data;return e.map.bytes=r,i.forEach((function(t){e.map.tracks=e.map.tracks||{},e.map.tracks[t.type]||(e.map.tracks[t.type]=t,"number"==typeof t.id&&t.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[t.id]=t.timescale))})),t(null)}})},Kc=function(e){var t=e.segment,n=e.finishProcessingFn,i=e.responseType;return function(e,r){var a=Wc(e,r);if(a)return n(a,t);var s="arraybuffer"!==i&&r.responseText?function(e){for(var t=new Uint8Array(new ArrayBuffer(e.length)),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t.buffer}(r.responseText.substring(t.lastReachedChar||0)):r.response;return t.stats=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}}(r),t.key?t.encryptedBytes=new Uint8Array(s):t.bytes=new Uint8Array(s),n(null,t)}},Xc=function(e){var t=e.segment,n=e.bytes,i=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog,f=t.map&&t.map.tracks||{},m=Boolean(f.audio&&f.video),g=r.bind(null,t,"audio","start"),v=r.bind(null,t,"audio","end"),y=r.bind(null,t,"video","start"),_=r.bind(null,t,"video","end");Fc({action:"probeTs",transmuxer:t.transmuxer,data:n,baseStartTime:t.baseStartTime,callback:function(e){t.bytes=n=e.data;var r=e.result;r&&(i(t,{hasAudio:r.hasAudio,hasVideo:r.hasVideo,isMuxed:m}),i=null,r.hasAudio&&!m&&g(r.audioStart),r.hasVideo&&y(r.videoStart),g=null,y=null),Nc({bytes:n,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,remux:m,onData:function(e){e.type="combined"===e.type?"video":e.type,d(t,e)},onTrackInfo:function(e){i&&(m&&(e.isMuxed=!0),i(t,e))},onAudioTimingInfo:function(e){g&&void 0!==e.start&&(g(e.start),g=null),v&&void 0!==e.end&&v(e.end)},onVideoTimingInfo:function(e){y&&void 0!==e.start&&(y(e.start),y=null),_&&void 0!==e.end&&_(e.end)},onVideoSegmentTimingInfo:function(e){a(e)},onAudioSegmentTimingInfo:function(e){s(e)},onId3:function(e,n){o(t,e,n)},onCaptions:function(e){u(t,[e])},isEndOfTimeline:l,onEndedTimeline:function(){c()},onTransmuxerLog:p,onDone:function(e){h&&(e.type="combined"===e.type?"video":e.type,h(null,t,e))}})}})},Qc=function(e){var t=e.segment,n=e.bytes,i=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog,f=new Uint8Array(n);if(function(e){return Mi(e,["moof"]).length>0}(f)){t.isFmp4=!0;var m=t.map.tracks,g={isFmp4:!0,hasVideo:!!m.video,hasAudio:!!m.audio};m.audio&&m.audio.codec&&"enca"!==m.audio.codec&&(g.audioCodec=m.audio.codec),m.video&&m.video.codec&&"encv"!==m.video.codec&&(g.videoCodec=m.video.codec),m.video&&m.audio&&(g.isMuxed=!0),i(t,g);var v=function(e){d(t,{data:f,type:g.hasAudio&&!g.isMuxed?"audio":"video"}),e&&e.length&&u(t,e),h(null,t,{})};Fc({action:"probeMp4StartTime",timescales:t.map.timescales,data:f,transmuxer:t.transmuxer,callback:function(e){var i=e.data,a=e.startTime;n=i.buffer,t.bytes=f=i,g.hasAudio&&!g.isMuxed&&r(t,"audio","start",a),g.hasVideo&&r(t,"video","start",a),m.video&&i.byteLength&&t.transmuxer?Fc({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:f,timescales:t.map.timescales,trackIds:[m.video.id],callback:function(e){n=e.data.buffer,t.bytes=f=e.data,e.logs.forEach((function(e){p(dl.mergeOptions(e,{stream:"mp4CaptionParser"}))})),v(e.captions)}}):v()}})}else if(t.transmuxer){if(void 0===t.container&&(t.container=tr(f)),"ts"!==t.container&&"aac"!==t.container)return i(t,{hasAudio:!1,hasVideo:!1}),void h(null,t,{});Xc({segment:t,bytes:n,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p})}else h(null,t,{})},Yc=function(e,t){var n,i=e.id,r=e.key,a=e.encryptedBytes,s=e.decryptionWorker;s.addEventListener("message",(function e(n){if(n.data.source===i){s.removeEventListener("message",e);var r=n.data.decrypted;t(new Uint8Array(r.bytes,r.byteOffset,r.byteLength))}})),n=r.bytes.slice?r.bytes.slice():new Uint32Array(Array.prototype.slice.call(r.bytes)),s.postMessage(dc({source:i,encrypted:a,key:n,iv:r.iv}),[a.buffer,n.buffer])},$c=function(e){var t=e.activeXhrs,n=e.decryptionWorker,i=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog,f=0,m=!1;return function(e,g){if(!m){if(e)return m=!0,qc(t),h(e,g);if((f+=1)===t.length){var v=function(){if(g.encryptedBytes)return function(e){var t=e.decryptionWorker,n=e.segment,i=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog;Yc({id:n.requestId,key:n.key,encryptedBytes:n.encryptedBytes,decryptionWorker:t},(function(e){n.bytes=e,Qc({segment:n,bytes:n.bytes,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p})}))}({decryptionWorker:n,segment:g,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p});Qc({segment:g,bytes:g.bytes,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p})};if(g.endOfAllRequests=Date.now(),g.map&&g.map.encryptedBytes&&!g.map.bytes)return Yc({decryptionWorker:n,id:g.requestId+"-init",encryptedBytes:g.map.encryptedBytes,key:g.map.key},(function(e){g.map.bytes=e,Gc(g,(function(e){if(e)return qc(t),h(e,g);v()}))}));v()}}}},Jc=function(e){var t=e.segment,n=e.progressFn;return e.trackInfoFn,e.timingInfoFn,e.videoSegmentTimingInfoFn,e.audioSegmentTimingInfoFn,e.id3Fn,e.captionsFn,e.isEndOfTimeline,e.endedTimelineFn,e.dataFn,function(e){if(!e.target.aborted)return t.stats=dl.mergeOptions(t.stats,function(e){var t=e.target,n={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return n.bytesReceived=e.loaded,n.bandwidth=Math.floor(n.bytesReceived/n.roundTripTime*8*1e3),n}(e)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),n(e,t)}},Zc=function(e){var t=e.xhr,n=e.xhrOptions,i=e.decryptionWorker,r=e.segment,a=e.abortFn,s=e.progressFn,o=e.trackInfoFn,u=e.timingInfoFn,l=e.videoSegmentTimingInfoFn,c=e.audioSegmentTimingInfoFn,d=e.id3Fn,h=e.captionsFn,p=e.isEndOfTimeline,f=e.endedTimelineFn,m=e.dataFn,g=e.doneFn,v=e.onTransmuxerLog,y=[],_=$c({activeXhrs:y,decryptionWorker:i,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:d,captionsFn:h,isEndOfTimeline:p,endedTimelineFn:f,dataFn:m,doneFn:g,onTransmuxerLog:v});if(r.key&&!r.key.bytes){var b=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&b.push(r.map.key);var T=t(dl.mergeOptions(n,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),zc(r,b,_));y.push(T)}if(r.map&&!r.map.bytes){if(r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri)){var k=t(dl.mergeOptions(n,{uri:r.map.key.resolvedUri,responseType:"arraybuffer"}),zc(r,[r.map.key],_));y.push(k)}var S=t(dl.mergeOptions(n,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:oc(r.map)}),function(e){var t=e.segment,n=e.finishProcessingFn;return function(e,i){var r=Wc(e,i);if(r)return n(r,t);var a=new Uint8Array(i.response);if(t.map.key)return t.map.encryptedBytes=a,n(null,t);t.map.bytes=a,Gc(t,(function(e){if(e)return e.xhr=i,e.status=i.status,n(e,t);n(null,t)}))}}({segment:r,finishProcessingFn:_}));y.push(S)}var E=dl.mergeOptions(n,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:oc(r)}),C=t(E,Kc({segment:r,finishProcessingFn:_,responseType:E.responseType}));C.addEventListener("progress",Jc({segment:r,progressFn:s,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:d,captionsFn:h,isEndOfTimeline:p,endedTimelineFn:f,dataFn:m})),y.push(C);var w={};return y.forEach((function(e){e.addEventListener("loadend",function(e){var t=e.loadendState,n=e.abortFn;return function(e){e.target.aborted&&n&&!t.calledAbortFn&&(n(),t.calledAbortFn=!0)}}({loadendState:w,abortFn:a}))})),function(){return qc(y)}},ed=gl("CodecUtils"),td=function(e,t){var n=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&n.AUDIO&&e.mediaGroups.AUDIO[n.AUDIO]},nd=function(e){var t={};return e.forEach((function(e){var n=e.mediaType,i=e.type,r=e.details;t[n]=t[n]||[],t[n].push(Be(""+i+r))})),Object.keys(t).forEach((function(e){if(t[e].length>1)return ed("multiple "+e+" codecs found as attributes: "+t[e].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),void(t[e]=null);t[e]=t[e][0]})),t},id=function(e){var t=0;return e.audio&&t++,e.video&&t++,t},rd=function(e,t){var n=t.attributes||{},i=nd(function(e){var t=e.attributes||{};if(t.CODECS)return Fe(t.CODECS)}(t)||[]);if(td(e,t)&&!i.audio&&!function(e,t){if(!td(e,t))return!0;var n=t.attributes||{},i=e.mediaGroups.AUDIO[n.AUDIO];for(var r in i)if(!i[r].uri&&!i[r].playlists)return!0;return!1}(e,t)){var r=nd(function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var n=e.mediaGroups.AUDIO[t];if(!n)return null;for(var i in n){var r=n[i];if(r.default&&r.playlists)return Fe(r.playlists[0].attributes.CODECS)}return null}(e,n.AUDIO)||[]);r.audio&&(i.audio=r.audio)}return i},ad=gl("PlaylistSelector"),sd=function(e){if(e&&e.playlist){var t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})}},od=function(e,t){if(!e)return"";var n=C.getComputedStyle(e);return n?n[t]:""},ud=function(e,t){var n=e.slice();e.sort((function(e,i){var r=t(e,i);return 0===r?n.indexOf(e)-n.indexOf(i):r}))},ld=function(e,t){var n,i;return e.attributes.BANDWIDTH&&(n=e.attributes.BANDWIDTH),n=n||C.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(i=t.attributes.BANDWIDTH),n-(i=i||C.Number.MAX_VALUE)},cd=function(e,t,n,i,r,a){if(e){var s={bandwidth:t,width:n,height:i,limitRenditionByPlayerDimensions:r},o=e.playlists;Vl.isAudioOnly(e)&&(o=a.getAudioTrackPlaylists_(),s.audioOnly=!0);var u=o.map((function(e){var t=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,n=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return{bandwidth:e.attributes&&e.attributes.BANDWIDTH||C.Number.MAX_VALUE,width:t,height:n,playlist:e}}));ud(u,(function(e,t){return e.bandwidth-t.bandwidth}));var l=(u=u.filter((function(e){return!Vl.isIncompatible(e.playlist)}))).filter((function(e){return Vl.isEnabled(e.playlist)}));l.length||(l=u.filter((function(e){return!Vl.isDisabled(e.playlist)})));var c=l.filter((function(e){return e.bandwidth*wc.BANDWIDTH_VARIANCE<t})),d=c[c.length-1],h=c.filter((function(e){return e.bandwidth===d.bandwidth}))[0];if(!1===r){var p=h||l[0]||u[0];if(p&&p.playlist){var f="sortedPlaylistReps";return h&&(f="bandwidthBestRep"),l[0]&&(f="enabledPlaylistReps"),ad("choosing "+sd(p)+" using "+f+" with options",s),p.playlist}return ad("could not choose a playlist with options",s),null}var m=c.filter((function(e){return e.width&&e.height}));ud(m,(function(e,t){return e.width-t.width}));var g=m.filter((function(e){return e.width===n&&e.height===i}));d=g[g.length-1];var v,y,_,b,T=g.filter((function(e){return e.bandwidth===d.bandwidth}))[0];if(T||(y=(v=m.filter((function(e){return e.width>n||e.height>i}))).filter((function(e){return e.width===v[0].width&&e.height===v[0].height})),d=y[y.length-1],_=y.filter((function(e){return e.bandwidth===d.bandwidth}))[0]),a.experimentalLeastPixelDiffSelector){var k=m.map((function(e){return e.pixelDiff=Math.abs(e.width-n)+Math.abs(e.height-i),e}));ud(k,(function(e,t){return e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff})),b=k[0]}var S=b||_||T||h||l[0]||u[0];if(S&&S.playlist){var E="sortedPlaylistReps";return b?E="leastPixelDiffRep":_?E="resolutionPlusOneRep":T?E="resolutionBestRep":h?E="bandwidthBestRep":l[0]&&(E="enabledPlaylistReps"),ad("choosing "+sd(S)+" using "+E+" with options",s),S.playlist}return ad("could not choose a playlist with options",s),null}},dd=function(){var e=this.useDevicePixelRatio&&C.devicePixelRatio||1;return cd(this.playlists.master,this.systemBandwidth,parseInt(od(this.tech_.el(),"width"),10)*e,parseInt(od(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},hd=function(e){var t=e.inbandTextTracks,n=e.metadataArray,i=e.timestampOffset,r=e.videoDuration;if(n){var a=C.WebKitDataCue||C.VTTCue,s=t.metadataTrack_;if(s&&(n.forEach((function(e){var t=e.cueTime+i;!("number"!=typeof t||C.isNaN(t)||t<0)&&t<1/0&&e.frames.forEach((function(e){var n=new a(t,t,e.value||e.url||e.data||"");n.frame=e,n.value=e,function(e){Object.defineProperties(e.frame,{id:{get:function(){return dl.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return dl.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return dl.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})}(n),s.addCue(n)}))})),s.cues&&s.cues.length)){for(var o=s.cues,u=[],l=0;l<o.length;l++)o[l]&&u.push(o[l]);var c=u.reduce((function(e,t){var n=e[t.startTime]||[];return n.push(t),e[t.startTime]=n,e}),{}),d=Object.keys(c).sort((function(e,t){return Number(e)-Number(t)}));d.forEach((function(e,t){var n=c[e],i=Number(d[t+1])||r;n.forEach((function(e){e.endTime=i}))}))}}},pd=function(e,t,n){var i,r;if(n&&n.cues)for(i=n.cues.length;i--;)(r=n.cues[i]).startTime>=e&&r.endTime<=t&&n.removeCue(r)},fd=function(e){return"number"==typeof e&&isFinite(e)},md=function(e){var t=e.startOfSegment,n=e.duration,i=e.segment,r=e.part,a=e.playlist,s=a.mediaSequence,o=a.id,u=a.segments,l=void 0===u?[]:u,c=e.mediaIndex,d=e.partIndex,h=e.timeline,p=l.length-1,f="mediaIndex/partIndex increment";e.getMediaInfoForTime?f="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(f="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(f+=" with independent "+e.independent);var m="number"==typeof d,g=e.segment.uri?"segment":"pre-segment",v=m?Pl({preloadSegment:i})-1:0;return g+" ["+(s+c)+"/"+(s+p)+"]"+(m?" part ["+d+"/"+v+"]":"")+" segment start/end ["+i.start+" => "+i.end+"]"+(m?" part start/end ["+r.start+" => "+r.end+"]":"")+" startOfSegment ["+t+"] duration ["+n+"] timeline ["+h+"] selected by ["+f+"] playlist ["+o+"]"},gd=function(e){return e+"TimingInfo"},vd=function(e){var t=e.timelineChangeController,n=e.currentTimeline,i=e.segmentTimeline,r=e.loaderType,a=e.audioDisabled;if(n===i)return!1;if("audio"===r){var s=t.lastTimelineChange({type:"main"});return!s||s.to!==i}if("main"===r&&a){var o=t.pendingTimelineChange({type:"audio"});return!o||o.to!==i}return!1},yd=function(e){var t=e.segmentDuration,n=e.maxDuration;return!!t&&Math.round(t)>n+1/30},_d=function(e,t){if("hls"!==t)return null;var n,i,r,a,s=(n=e.audioTimingInfo,i=e.videoTimingInfo,r=n&&"number"==typeof n.start&&"number"==typeof n.end?n.end-n.start:0,a=i&&"number"==typeof i.start&&"number"==typeof i.end?i.end-i.start:0,Math.max(r,a));if(!s)return null;var o=e.playlist.targetDuration,u=yd({segmentDuration:s,maxDuration:2*o}),l=yd({segmentDuration:s,maxDuration:o}),c="Segment with index "+e.mediaIndex+" from playlist "+e.playlist.id+" has a duration of "+s+" when the reported duration is "+e.duration+" and the target duration is "+o+". For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";return u||l?{severity:u?"warn":"info",message:c}:null},bd=function(e){function t(t,n){var i;if(i=e.call(this)||this,!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 i.bandwidth=t.bandwidth,i.throughput={rate:0,count:0},i.roundTrip=NaN,i.resetStats_(),i.mediaIndex=null,i.partIndex=null,i.hasPlayed_=t.hasPlayed,i.currentTime_=t.currentTime,i.seekable_=t.seekable,i.seeking_=t.seeking,i.duration_=t.duration,i.mediaSource_=t.mediaSource,i.vhs_=t.vhs,i.loaderType_=t.loaderType,i.currentMediaInfo_=void 0,i.startingMediaInfo_=void 0,i.segmentMetadataTrack_=t.segmentMetadataTrack,i.goalBufferLength_=t.goalBufferLength,i.sourceType_=t.sourceType,i.sourceUpdater_=t.sourceUpdater,i.inbandTextTracks_=t.inbandTextTracks,i.state_="INIT",i.timelineChangeController_=t.timelineChangeController,i.shouldSaveSegmentTimingInfo_=!0,i.parse708captions_=t.parse708captions,i.captionServices_=t.captionServices,i.experimentalExactManifestTimings=t.experimentalExactManifestTimings,i.checkBufferTimeout_=null,i.error_=void 0,i.currentTimeline_=-1,i.pendingSegment_=null,i.xhrOptions_=null,i.pendingSegments_=[],i.audioDisabled_=!1,i.isPendingTimestampOffset_=!1,i.gopBuffer_=[],i.timeMapping_=0,i.safeAppend_=dl.browser.IE_VERSION>=11,i.appendInitSegment_={audio:!0,video:!0},i.playlistOfLastInitSegment_={audio:null,video:null},i.callQueue_=[],i.loadQueue_=[],i.metadataQueue_={id3:[],caption:[]},i.waitingOnRemove_=!1,i.quotaExceededErrorRetryTimeout_=null,i.activeInitSegmentId_=null,i.initSegments_={},i.cacheEncryptionKeys_=t.cacheEncryptionKeys,i.keyCache_={},i.decrypter_=t.decrypter,i.syncController_=t.syncController,i.syncPoint_={segmentIndex:0,time:0},i.transmuxer_=i.createTransmuxer_(),i.triggerSyncInfoUpdate_=function(){return i.trigger("syncinfoupdate")},i.syncController_.on("syncinfoupdate",i.triggerSyncInfoUpdate_),i.mediaSource_.addEventListener("sourceopen",(function(){i.isEndOfStream_()||(i.ended_=!1)})),i.fetchAtBuffer_=!1,i.logger_=gl("SegmentLoader["+i.loaderType_+"]"),Object.defineProperty(O(i),"state",{get:function(){return this.state_},set:function(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e,this.trigger("statechange"))}}),i.sourceUpdater_.on("ready",(function(){i.hasEnoughInfoToAppend_()&&i.processCallQueue_()})),"main"===i.loaderType_&&i.timelineChangeController_.on("pendingtimelinechange",(function(){i.hasEnoughInfoToAppend_()&&i.processCallQueue_()})),"audio"===i.loaderType_&&i.timelineChangeController_.on("timelinechange",(function(){i.hasEnoughInfoToLoad_()&&i.processLoadQueue_(),i.hasEnoughInfoToAppend_()&&i.processCallQueue_()})),i}R(t,e);var n=t.prototype;return n.createTransmuxer_=function(){return Bc({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},n.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},n.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&C.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},n.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},n.abort=function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)},n.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,C.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},n.checkForAbort_=function(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)},n.error=function(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},n.endOfStream=function(){this.ended_=!0,this.transmuxer_&&Uc(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},n.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return dl.createTimeRanges();if("main"===this.loaderType_){var t=e.hasAudio,n=e.hasVideo,i=e.isMuxed;if(n&&t&&!this.audioDisabled_&&!i)return this.sourceUpdater_.buffered();if(n)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},n.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var n=hc(e),i=this.initSegments_[n];return t&&!i&&e.bytes&&(this.initSegments_[n]=i={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),i||e},n.segmentKey=function(e,t){if(void 0===t&&(t=!1),!e)return null;var n=pc(e),i=this.keyCache_[n];this.cacheEncryptionKeys_&&t&&!i&&e.bytes&&(this.keyCache_[n]=i={resolvedUri:e.resolvedUri,bytes:e.bytes});var r={resolvedUri:(i||e).resolvedUri};return i&&(r.bytes=i.bytes),r},n.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},n.load=function(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))},n.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},n.playlist=function(e,t){if(void 0===t&&(t={}),e){var n=this.playlist_,i=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));var r=null;if(n&&(n.id?r=n.id:n.uri&&(r=n.uri)),this.logger_("playlist update ["+r+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!n||n.uri!==e.uri)return null!==this.mediaIndex&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");var a=e.mediaSequence-n.mediaSequence;if(this.logger_("live window shift ["+a+"]"),null!==this.mediaIndex)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var s=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!s.parts||!s.parts.length||!s.parts[this.partIndex])){var o=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=o}}i&&(i.mediaIndex-=a,i.mediaIndex<0?(i.mediaIndex=null,i.partIndex=null):(i.mediaIndex>=0&&(i.segment=e.segments[i.mediaIndex]),i.partIndex>=0&&i.segment.parts&&(i.part=i.segment.parts[i.partIndex]))),this.syncController_.saveExpiredSegmentInfo(n,e)}},n.pause=function(){this.checkBufferTimeout_&&(C.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},n.paused=function(){return null===this.checkBufferTimeout_},n.resetEverything=function(e){this.ended_=!1,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},n.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},n.resyncLoader=function(){this.transmuxer_&&Uc(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},n.remove=function(e,t,n,i){if(void 0===n&&(n=function(){}),void 0===i&&(i=!1),t===1/0&&(t=this.duration_()),t<=e)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.getMediaInfo_()){var r=1,a=function(){0===--r&&n()};for(var s in!i&&this.audioDisabled_||(r++,this.sourceUpdater_.removeAudio(e,t,a)),(i||"main"===this.loaderType_)&&(this.gopBuffer_=function(e,t,n,i){for(var r=Math.ceil((t-i)*ir),a=Math.ceil((n-i)*ir),s=e.slice(),o=e.length;o--&&!(e[o].pts<=a););if(-1===o)return s;for(var u=o+1;u--&&!(e[u].pts<=r););return u=Math.max(u,0),s.splice(u,o-u+1),s}(this.gopBuffer_,e,t,this.timeMapping_),r++,this.sourceUpdater_.removeVideo(e,t,a)),this.inbandTextTracks_)pd(e,t,this.inbandTextTracks_[s]);pd(e,t,this.segmentMetadataTrack_),a()}else this.logger_("skipping remove because no source updater or starting media info")},n.monitorBuffer_=function(){this.checkBufferTimeout_&&C.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=C.setTimeout(this.monitorBufferTick_.bind(this),1)},n.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&C.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=C.setTimeout(this.monitorBufferTick_.bind(this),500)},n.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();e&&("number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}},n.isEndOfStream_=function(e,t,n){if(void 0===e&&(e=this.mediaIndex),void 0===t&&(t=this.playlist_),void 0===n&&(n=this.partIndex),!t||!this.mediaSource_)return!1;var i="number"==typeof e&&t.segments[e],r=e+1===t.segments.length,a=!i||!i.parts||n+1===i.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&r&&a},n.chooseNextRequest_=function(){var e=this.buffered_(),t=kl(e)||0,n=Sl(e,this.currentTime_()),i=!this.hasPlayed_()&&n>=1,r=n>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||i||r)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var s={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(s.isSyncRequest)s.mediaIndex=function(e,t,n){t=t||[];for(var i=[],r=0,a=0;a<t.length;a++){var s=t[a];if(e===s.timeline&&(i.push(a),(r+=s.duration)>n))return a}return 0===i.length?0:i[i.length-1]}(this.currentTimeline_,a,t);else if(null!==this.mediaIndex){var o=a[this.mediaIndex],u="number"==typeof this.partIndex?this.partIndex:-1;s.startOfSegment=o.end?o.end:t,o.parts&&o.parts[u+1]?(s.mediaIndex=this.mediaIndex,s.partIndex=u+1):s.mediaIndex=this.mediaIndex+1}else{var l=Vl.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),c=l.segmentIndex,d=l.startTime,h=l.partIndex;s.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+t:"currentTime "+this.currentTime_(),s.mediaIndex=c,s.startOfSegment=d,s.partIndex=h}var p=a[s.mediaIndex],f=p&&"number"==typeof s.partIndex&&p.parts&&p.parts[s.partIndex];if(!p||"number"==typeof s.partIndex&&!f)return null;if("number"!=typeof s.partIndex&&p.parts&&(s.partIndex=0,f=p.parts[0]),!n&&f&&!f.independent)if(0===s.partIndex){var m=a[s.mediaIndex-1],g=m.parts&&m.parts.length&&m.parts[m.parts.length-1];g&&g.independent&&(s.mediaIndex-=1,s.partIndex=m.parts.length-1,s.independent="previous segment")}else p.parts[s.partIndex-1].independent&&(s.partIndex-=1,s.independent="previous part");var v=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return s.mediaIndex>=a.length-1&&v&&!this.seeking_()?null:this.generateSegmentInfo_(s)},n.generateSegmentInfo_=function(e){var t=e.independent,n=e.playlist,i=e.mediaIndex,r=e.startOfSegment,a=e.isSyncRequest,s=e.partIndex,o=e.forceTimestampOffset,u=e.getMediaInfoForTime,l=n.segments[i],c="number"==typeof s&&l.parts[s],d={requestId:"segment-loader-"+Math.random(),uri:c&&c.resolvedUri||l.resolvedUri,mediaIndex:i,partIndex:c?s:null,isSyncRequest:a,startOfSegment:r,playlist:n,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:l.timeline,duration:c&&c.duration||l.duration,segment:l,part:c,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:u,independent:t},h=void 0!==o?o:this.isPendingTimestampOffset_;d.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:l.timeline,currentTimeline:this.currentTimeline_,startOfSegment:r,buffered:this.buffered_(),overrideCheck:h});var p=kl(this.sourceUpdater_.audioBuffered());return"number"==typeof p&&(d.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(d.gopsToAlignWith=function(e,t,n){if(null==t||!e.length)return[];var i,r=Math.ceil((t-n+3)*ir);for(i=0;i<e.length&&!(e[i].pts>r);i++);return e.slice(i)}(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),d},n.timestampOffsetForSegment_=function(e){return n=(t=e).segmentTimeline,i=t.currentTimeline,r=t.startOfSegment,a=t.buffered,t.overrideCheck||n!==i?n<i?r:a.length?a.end(a.length-1):r:null;var t,n,i,r,a},n.earlyAbortWhenNeeded_=function(e){if(!this.vhs_.tech_.paused()&&this.xhrOptions_.timeout&&this.playlist_.attributes.BANDWIDTH&&!(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)){var t=this.currentTime_(),n=e.bandwidth,i=this.pendingSegment_.duration,r=Vl.estimateSegmentRequestTime(i,n,this.playlist_,e.bytesReceived),a=function(e,t,n){return void 0===n&&(n=1),((e.length?e.end(e.length-1):0)-t)/n}(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(!(r<=a)){var s=function(e){var t=e.master,n=e.currentTime,i=e.bandwidth,r=e.duration,a=e.segmentDuration,s=e.timeUntilRebuffer,o=e.currentTimeline,u=e.syncController,l=t.playlists.filter((function(e){return!Vl.isIncompatible(e)})),c=l.filter(Vl.isEnabled);c.length||(c=l.filter((function(e){return!Vl.isDisabled(e)})));var d=c.filter(Vl.hasAttribute.bind(null,"BANDWIDTH")).map((function(e){var t=u.getSyncPoint(e,r,o,n)?1:2;return{playlist:e,rebufferingImpact:Vl.estimateSegmentRequestTime(a,i,e)*t-s}})),h=d.filter((function(e){return e.rebufferingImpact<=0}));return ud(h,(function(e,t){return ld(t.playlist,e.playlist)})),h.length?h[0]:(ud(d,(function(e,t){return e.rebufferingImpact-t.rebufferingImpact})),d[0]||null)}({master:this.vhs_.playlists.master,currentTime:t,bandwidth:n,duration:this.duration_(),segmentDuration:i,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(s){var o=r-a-s.rebufferingImpact,u=.5;a<=1/30&&(u=1),!s.playlist||s.playlist.uri===this.playlist_.uri||o<u||(this.bandwidth=s.playlist.attributes.BANDWIDTH*wc.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}},n.handleAbort_=function(e){this.logger_("Aborting "+md(e)),this.mediaRequestsAborted+=1},n.handleProgress_=function(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress")},n.handleTrackInfo_=function(e,t){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t)||(t=t||{},function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;var n=Object.keys(e).sort(),i=Object.keys(t).sort();if(n.length!==i.length)return!1;for(var r=0;r<n.length;r++){var a=n[r];if(a!==i[r])return!1;if(e[a]!==t[a])return!1}return!0}(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),this.checkForAbort_(e.requestId)||(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()&&this.processCallQueue_()))},n.handleTimingInfo_=function(e,t,n,i){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){var r=this.pendingSegment_,a=gd(t);r[a]=r[a]||{},r[a][n]=i,this.logger_("timinginfo: "+t+" - "+n+" - "+i),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}},n.handleCaptions_=function(e,t){var n=this;if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(0!==t.length)if(this.pendingSegment_.hasAppendedData_){var i=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),r={};t.forEach((function(e){r[e.stream]=r[e.stream]||{startTime:1/0,captions:[],endTime:0};var t=r[e.stream];t.startTime=Math.min(t.startTime,e.startTime+i),t.endTime=Math.max(t.endTime,e.endTime+i),t.captions.push(e)})),Object.keys(r).forEach((function(e){var t=r[e],a=t.startTime,s=t.endTime,o=t.captions,u=n.inbandTextTracks_;n.logger_("adding cues from "+a+" -> "+s+" for "+e),function(e,t,n){if(!e[n]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var i=n;/^cc708_/.test(n)&&(i="SERVICE"+n.split("_")[1]);var r=t.textTracks().getTrackById(i);if(r)e[n]=r;else{var a=n,s=n,o=!1,u=(t.options_.vhs&&t.options_.vhs.captionServices||{})[i];u&&(a=u.label,s=u.language,o=u.default),e[n]=t.addRemoteTextTrack({kind:"captions",id:i,default:o,label:a,language:s},!1).track}}}(u,n.vhs_.tech_,e),pd(a,s,u[e]),function(e){var t=e.inbandTextTracks,n=e.captionArray,i=e.timestampOffset;if(n){var r=C.WebKitDataCue||C.VTTCue;n.forEach((function(e){var n=e.stream;t[n].addCue(new r(e.startTime+i,e.endTime+i,e.text))}))}}({captionArray:o,inbandTextTracks:u,timestampOffset:i})})),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}else this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));else this.logger_("SegmentLoader received no captions from a caption event")},n.handleId3_=function(e,t,n){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(this.pendingSegment_.hasAppendedData_){var i=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();!function(e,t,n){e.metadataTrack_||(e.metadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=t)}(this.inbandTextTracks_,n,this.vhs_.tech_),hd({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:i,videoDuration:this.duration_()})}else this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,n))},n.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach((function(e){return e()})),this.metadataQueue_.caption.forEach((function(e){return e()})),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},n.processCallQueue_=function(){var e=this.callQueue_;this.callQueue_=[],e.forEach((function(e){return e()}))},n.processLoadQueue_=function(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach((function(e){return e()}))},n.hasEnoughInfoToLoad_=function(){if("audio"!==this.loaderType_)return!0;var e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!vd({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},n.getCurrentMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),e&&e.trackInfo||this.currentMediaInfo_},n.getMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),this.getCurrentMediaInfo_(e)||this.startingMediaInfo_},n.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;var n=t.hasAudio,i=t.hasVideo,r=t.isMuxed;return!(i&&!e.videoTimingInfo)&&(!(n&&!this.audioDisabled_&&!r&&!e.audioTimingInfo)&&!vd({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},n.handleData_=function(e,t){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(!this.callQueue_.length&&this.hasEnoughInfoToAppend_()){var n=this.pendingSegment_;if(this.setTimeMapping_(n.timeline),this.updateMediaSecondsLoaded_(n.part||n.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),n.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),n.isFmp4=e.isFmp4,n.timingInfo=n.timingInfo||{},n.isFmp4)this.trigger("fmp4"),n.timingInfo.start=n[gd(t.type)].start;else{var i,r=this.getCurrentMediaInfo_(),a="main"===this.loaderType_&&r&&r.hasVideo;a&&(i=n.videoTimingInfo.start),n.timingInfo.start=this.trueSegmentStart_({currentStart:n.timingInfo.start,playlist:n.playlist,mediaIndex:n.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:a,firstVideoFrameTimeForData:i,videoTimingInfo:n.videoTimingInfo,audioTimingInfo:n.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(n,t.type),this.updateSourceBufferTimestampOffset_(n),n.isSyncRequest){this.updateTimingInfoEnd_(n),this.syncController_.saveSegmentTimingInfo({segmentInfo:n,shouldSaveTimelineMapping:"main"===this.loaderType_});var s=this.chooseNextRequest_();if(s.mediaIndex!==n.mediaIndex||s.partIndex!==n.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}n.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(n,t)}}else this.callQueue_.push(this.handleData_.bind(this,e,t))},n.updateAppendInitSegmentStatus=function(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)},n.getInitSegmentAndUpdateState_=function(e){var t=e.type,n=e.initSegment,i=e.map,r=e.playlist;if(i){var a=hc(i);if(this.activeInitSegmentId_===a)return null;n=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=a}return n&&this.appendInitSegment_[t]?(this.playlistOfLastInitSegment_[t]=r,this.appendInitSegment_[t]=!1,this.activeInitSegmentId_=null,n):null},n.handleQuotaExceededError_=function(e,t){var n=this,i=e.segmentInfo,r=e.type,a=e.bytes,s=this.sourceUpdater_.audioBuffered(),o=this.sourceUpdater_.videoBuffered();s.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Tl(s).join(", ")),o.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Tl(o).join(", "));var u=s.length?s.start(0):0,l=s.length?s.end(s.length-1):0,c=o.length?o.start(0):0,d=o.length?o.end(o.length-1):0;if(l-u<=1&&d-c<=1)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+a.byteLength+", audio buffer: "+Tl(s).join(", ")+", video buffer: "+Tl(o).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:i,type:r,bytes:a}));var h=this.currentTime_()-1;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+h),this.remove(0,h,(function(){n.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=C.setTimeout((function(){n.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),n.quotaExceededErrorRetryTimeout_=null,n.processCallQueue_()}),1e3)}),!0)},n.handleAppendError_=function(e,t){var n=e.segmentInfo,i=e.type,r=e.bytes;t&&(22!==t.code?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",t),this.error(i+" append of "+r.length+"b failed for segment #"+n.mediaIndex+" in playlist "+n.playlist.id),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:n,type:i,bytes:r}))},n.appendToSourceBuffer_=function(e){var t,n,i,r=e.segmentInfo,a=e.type,s=e.initSegment,o=e.data,u=e.bytes;if(!u){var l=[o],c=o.byteLength;s&&(l.unshift(s),c+=s.byteLength),i=0,(t={bytes:c,segments:l}).bytes&&(n=new Uint8Array(t.bytes),t.segments.forEach((function(e){n.set(e,i),i+=e.byteLength}))),u=n}this.sourceUpdater_.appendBuffer({segmentInfo:r,type:a,bytes:u},this.handleAppendError_.bind(this,{segmentInfo:r,type:a,bytes:u}))},n.handleSegmentTimingInfo_=function(e,t,n){if(this.pendingSegment_&&t===this.pendingSegment_.requestId){var i=this.pendingSegment_.segment,r=e+"TimingInfo";i[r]||(i[r]={}),i[r].transmuxerPrependedSeconds=n.prependedContentDuration||0,i[r].transmuxedPresentationStart=n.start.presentation,i[r].transmuxedDecodeStart=n.start.decode,i[r].transmuxedPresentationEnd=n.end.presentation,i[r].transmuxedDecodeEnd=n.end.decode,i[r].baseMediaDecodeTime=n.baseMediaDecodeTime}},n.appendData_=function(e,t){var n=t.type,i=t.data;if(i&&i.byteLength&&("audio"!==n||!this.audioDisabled_)){var r=this.getInitSegmentAndUpdateState_({type:n,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:n,initSegment:r,data:i})}},n.loadSegment_=function(e){var t=this;this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push((function(){var n=A({},e,{forceTimestampOffset:!0});A(e,t.generateSegmentInfo_(n)),t.isPendingTimestampOffset_=!1,t.updateTransmuxerAndRequestSegment_(e)}))},n.updateTransmuxerAndRequestSegment_=function(e){var t=this;this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));var n=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=null!==this.mediaIndex,a=e.timeline!==this.currentTimeline_&&e.timeline>0,s=i||r&&a;this.logger_("Requesting "+md(e)),n.map&&!n.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=Zc({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:n,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:s,endedTimelineFn:function(){t.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(n){var i=n.message,r=n.level,a=n.stream;t.logger_(md(e)+" logged from transmuxer stream "+a+" as a "+r+": "+i)}})},n.trimBackBuffer_=function(e){var t=function(e,t,n){var i=t-wc.BACK_BUFFER_LENGTH;e.length&&(i=Math.max(i,e.start(0)));var r=t-n;return Math.min(r,i)}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)},n.createSimplifiedSegmentObj_=function(e){var t=e.segment,n=e.part,i={resolvedUri:n?n.resolvedUri:t.resolvedUri,byterange:n?n.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},r=e.playlist.segments[e.mediaIndex-1];if(r&&r.timeline===t.timeline&&(r.videoTimingInfo?i.baseStartTime=r.videoTimingInfo.transmuxedDecodeEnd:r.audioTimingInfo&&(i.baseStartTime=r.audioTimingInfo.transmuxedDecodeEnd)),t.key){var a=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);i.key=this.segmentKey(t.key),i.key.iv=a}return t.map&&(i.map=this.initSegmentForMap(t.map)),i},n.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},n.saveBandwidthRelatedStats_=function(e,t){this.pendingSegment_.byteLength=t.bytesReceived,e<1/60?this.logger_("Ignoring segment's bandwidth because its duration of "+e+" is less than the min to record "+1/60):(this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime)},n.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate")},n.segmentRequestFinished_=function(e,t,n){if(this.callQueue_.length)this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,n));else if(this.saveTransferStats_(t.stats),this.pendingSegment_&&t.requestId===this.pendingSegment_.requestId){if(e){if(this.pendingSegment_=null,this.state="READY",e.code===Vc)return;return this.pause(),e.code===Hc?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"))}var i=this.pendingSegment_;this.saveBandwidthRelatedStats_(i.duration,t.stats),i.endOfAllRequests=t.endOfAllRequests,n.gopInfo&&(this.gopBuffer_=function(e,t,n){if(!t.length)return e;if(n)return t.slice();for(var i=t[0].pts,r=0;r<e.length&&!(e[r].pts>=i);r++);return e.slice(0,r).concat(t)}(this.gopBuffer_,n.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(i)}},n.setTimeMapping_=function(e){var t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)},n.updateMediaSecondsLoaded_=function(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration},n.shouldUpdateTransmuxerTimestampOffset_=function(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())},n.trueSegmentStart_=function(e){var t=e.currentStart,n=e.playlist,i=e.mediaIndex,r=e.firstVideoFrameTimeForData,a=e.currentVideoTimestampOffset,s=e.useVideoTimingInfo,o=e.videoTimingInfo,u=e.audioTimingInfo;if(void 0!==t)return t;if(!s)return u.start;var l=n.segments[i-1];return 0!==i&&l&&void 0!==l.start&&l.end===r+a?o.start:r},n.waitForAppendsToComplete_=function(e){var t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),void this.trigger("error");var n=t.hasAudio,i=t.hasVideo,r=t.isMuxed,a="main"===this.loaderType_&&i,s=!this.audioDisabled_&&n&&!r;if(e.waitingOnAppends=0,!e.hasAppendedData_)return e.timingInfo||"number"!=typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);a&&e.waitingOnAppends++,s&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),s&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))},n.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())},n.checkForIllegalMediaSwitch=function(e){var t=function(e,t,n){return"main"===e&&t&&n?n.hasAudio||n.hasVideo?t.hasVideo&&!n.hasVideo?"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.":!t.hasVideo&&n.hasVideo?"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}(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!t&&(this.error({message:t,blacklistDuration:1/0}),this.trigger("error"),!0)},n.updateSourceBufferTimestampOffset_=function(e){if(null!==e.timestampOffset&&"number"==typeof e.timingInfo.start&&!e.changedTimestampOffset&&"main"===this.loaderType_){var t=!1;e.timestampOffset-=e.timingInfo.start,e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}},n.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var t=this.getMediaInfo_(),n="main"===this.loaderType_&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;n&&(e.timingInfo.end="number"==typeof n.end?n.end:n.start+e.duration)},n.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});var t=_d(e,this.sourceType_);if(t&&("warn"===t.severity?dl.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",!e.isSyncRequest||(this.trigger("syncinfoupdate"),e.hasAppendedData_)){this.logger_("Appended "+md(e)),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");var n=e.segment,i=e.part,r=n.end&&this.currentTime_()-n.end>3*e.playlist.targetDuration,a=i&&i.end&&this.currentTime_()-i.end>3*e.playlist.partTargetDuration;if(r||a)return this.logger_("bad "+(r?"segment":"part")+" "+md(e)),void this.resetEverything();null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}else this.logger_("Throwing away un-appended sync request "+md(e))},n.recordThroughput_=function(e){if(e.duration<1/60)this.logger_("Ignoring segment's throughput because its duration of "+e.duration+" is less than the min to record "+1/60);else{var t=this.throughput.rate,n=Date.now()-e.endOfAllRequests+1,i=Math.floor(e.byteLength/n*8*1e3);this.throughput.rate+=(i-t)/++this.throughput.count}},n.addSegmentMetadataCue_=function(e){if(this.segmentMetadataTrack_){var t=e.segment,n=t.start,i=t.end;if(fd(n)&&fd(i)){pd(n,i,this.segmentMetadataTrack_);var r=C.WebKitDataCue||C.VTTCue,a={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:n,end:i},s=new r(n,i,JSON.stringify(a));s.value=a,this.segmentMetadataTrack_.addCue(s)}}},t}(dl.EventTarget);function Td(){}var kd,Sd=function(e){return"string"!=typeof e?e:e.replace(/./,(function(e){return e.toUpperCase()}))},Ed=["video","audio"],Cd=function(e,t){var n=t[e+"Buffer"];return n&&n.updating||t.queuePending[e]},wd=function e(t,n){if(0!==n.queue.length){var i=0,r=n.queue[i];if("mediaSource"!==r.type){if("mediaSource"!==t&&n.ready()&&"closed"!==n.mediaSource.readyState&&!Cd(t,n)){if(r.type!==t){if(null===(i=function(e,t){for(var n=0;n<t.length;n++){var i=t[n];if("mediaSource"===i.type)return null;if(i.type===e)return n}return null}(t,n.queue)))return;r=n.queue[i]}return n.queue.splice(i,1),n.queuePending[t]=r,r.action(t,n),r.doneFn?void 0:(n.queuePending[t]=null,void e(t,n))}}else n.updating()||"closed"===n.mediaSource.readyState||(n.queue.shift(),r.action(n),r.doneFn&&r.doneFn(),e("audio",n),e("video",n))}},Id=function(e,t){var n=t[e+"Buffer"],i=Sd(e);n&&(n.removeEventListener("updateend",t["on"+i+"UpdateEnd_"]),n.removeEventListener("error",t["on"+i+"Error_"]),t.codecs[e]=null,t[e+"Buffer"]=null)},Pd=function(e,t){return e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t)},xd=function(e,t,n){return function(i,r){var a=r[i+"Buffer"];if(Pd(r.mediaSource,a)){r.logger_("Appending segment "+t.mediaIndex+"'s "+e.length+" bytes to "+i+"Buffer");try{a.appendBuffer(e)}catch(e){r.logger_("Error with code "+e.code+" "+(22===e.code?"(QUOTA_EXCEEDED_ERR) ":"")+"when appending segment "+t.mediaIndex+" to "+i+"Buffer"),r.queuePending[i]=null,n(e)}}}},Ad=function(e,t){return function(n,i){var r=i[n+"Buffer"];if(Pd(i.mediaSource,r)){i.logger_("Removing "+e+" to "+t+" from "+n+"Buffer");try{r.remove(e,t)}catch(r){i.logger_("Remove "+e+" to "+t+" from "+n+"Buffer failed")}}}},Od=function(e){return function(t,n){var i=n[t+"Buffer"];Pd(n.mediaSource,i)&&(n.logger_("Setting "+t+"timestampOffset to "+e),i.timestampOffset=e)}},Ld=function(e){return function(t,n){e()}},Rd=function(e){return function(t){if("open"===t.mediaSource.readyState){t.logger_("Calling mediaSource endOfStream("+(e||"")+")");try{t.mediaSource.endOfStream(e)}catch(e){dl.log.warn("Failed to call media source endOfStream",e)}}}},Dd=function(e){return function(t){t.logger_("Setting mediaSource duration to "+e);try{t.mediaSource.duration=e}catch(e){dl.log.warn("Failed to set media source duration",e)}}},Md=function(){return function(e,t){if("open"===t.mediaSource.readyState){var n=t[e+"Buffer"];if(Pd(t.mediaSource,n)){t.logger_("calling abort on "+e+"Buffer");try{n.abort()}catch(t){dl.log.warn("Failed to abort on "+e+"Buffer",t)}}}}},Nd=function(e,t){return function(n){var i=Sd(e),r=He(t);n.logger_("Adding "+e+"Buffer with codec "+t+" to mediaSource");var a=n.mediaSource.addSourceBuffer(r);a.addEventListener("updateend",n["on"+i+"UpdateEnd_"]),a.addEventListener("error",n["on"+i+"Error_"]),n.codecs[e]=t,n[e+"Buffer"]=a}},Ud=function(e){return function(t){var n=t[e+"Buffer"];if(Id(e,t),Pd(t.mediaSource,n)){t.logger_("Removing "+e+"Buffer with codec "+t.codecs[e]+" from mediaSource");try{t.mediaSource.removeSourceBuffer(n)}catch(t){dl.log.warn("Failed to removeSourceBuffer "+e+"Buffer",t)}}}},Bd=function(e){return function(t,n){var i=n[t+"Buffer"],r=He(e);Pd(n.mediaSource,i)&&n.codecs[t]!==e&&(n.logger_("changing "+t+"Buffer codec from "+n.codecs[t]+" to "+e),i.changeType(r),n.codecs[t]=e)}},Fd=function(e){var t=e.type,n=e.sourceUpdater,i=e.action,r=e.doneFn,a=e.name;n.queue.push({type:t,action:i,doneFn:r,name:a}),wd(t,n)},jd=function(e,t){return function(n){if(t.queuePending[e]){var i=t.queuePending[e].doneFn;t.queuePending[e]=null,i&&i(t[e+"Error_"])}wd(e,t)}},Hd=function(e){function t(t){var n;return(n=e.call(this)||this).mediaSource=t,n.sourceopenListener_=function(){return wd("mediaSource",O(n))},n.mediaSource.addEventListener("sourceopen",n.sourceopenListener_),n.logger_=gl("SourceUpdater"),n.audioTimestampOffset_=0,n.videoTimestampOffset_=0,n.queue=[],n.queuePending={audio:null,video:null},n.delayedAudioAppendQueue_=[],n.videoAppendQueued_=!1,n.codecs={},n.onVideoUpdateEnd_=jd("video",O(n)),n.onAudioUpdateEnd_=jd("audio",O(n)),n.onVideoError_=function(e){n.videoError_=e},n.onAudioError_=function(e){n.audioError_=e},n.createdSourceBuffers_=!1,n.initializedEme_=!1,n.triggeredReady_=!1,n}R(t,e);var n=t.prototype;return n.initializedEme=function(){this.initializedEme_=!0,this.triggerReady()},n.hasCreatedSourceBuffers=function(){return this.createdSourceBuffers_},n.hasInitializedAnyEme=function(){return this.initializedEme_},n.ready=function(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()},n.createSourceBuffers=function(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())},n.triggerReady=function(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))},n.addSourceBuffer=function(e,t){Fd({type:"mediaSource",sourceUpdater:this,action:Nd(e,t),name:"addSourceBuffer"})},n.abort=function(e){Fd({type:e,sourceUpdater:this,action:Md(e),name:"abort"})},n.removeSourceBuffer=function(e){this.canRemoveSourceBuffer()?Fd({type:"mediaSource",sourceUpdater:this,action:Ud(e),name:"removeSourceBuffer"}):dl.log.error("removeSourceBuffer is not supported!")},n.canRemoveSourceBuffer=function(){return!dl.browser.IE_VERSION&&!dl.browser.IS_FIREFOX&&C.MediaSource&&C.MediaSource.prototype&&"function"==typeof C.MediaSource.prototype.removeSourceBuffer},t.canChangeType=function(){return C.SourceBuffer&&C.SourceBuffer.prototype&&"function"==typeof C.SourceBuffer.prototype.changeType},n.canChangeType=function(){return this.constructor.canChangeType()},n.changeType=function(e,t){this.canChangeType()?Fd({type:e,sourceUpdater:this,action:Bd(t),name:"changeType"}):dl.log.error("changeType is not supported!")},n.addOrChangeSourceBuffers=function(e){var t=this;if(!e||"object"!==_typeof2(e)||0===Object.keys(e).length)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach((function(n){var i=e[n];if(!t.hasCreatedSourceBuffers())return t.addSourceBuffer(n,i);t.canChangeType()&&t.changeType(n,i)}))},n.appendBuffer=function(e,t){var n=this,i=e.segmentInfo,r=e.type,a=e.bytes;if(this.processedAppend_=!0,"audio"===r&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_("delayed audio append of "+a.length+" until video append");if(Fd({type:r,sourceUpdater:this,action:xd(a,i||{mediaIndex:-1},t),doneFn:t,name:"appendBuffer"}),"video"===r){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;var s=this.delayedAudioAppendQueue_.slice();this.logger_("queuing delayed audio "+s.length+" appendBuffers"),this.delayedAudioAppendQueue_.length=0,s.forEach((function(e){n.appendBuffer.apply(n,e)}))}},n.audioBuffered=function(){return Pd(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:dl.createTimeRange()},n.videoBuffered=function(){return Pd(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:dl.createTimeRange()},n.buffered=function(){var e=Pd(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Pd(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():function(e,t){var n=null,i=null,r=0,a=[],s=[];if(!(e&&e.length&&t&&t.length))return dl.createTimeRange();for(var o=e.length;o--;)a.push({time:e.start(o),type:"start"}),a.push({time:e.end(o),type:"end"});for(o=t.length;o--;)a.push({time:t.start(o),type:"start"}),a.push({time:t.end(o),type:"end"});for(a.sort((function(e,t){return e.time-t.time})),o=0;o<a.length;o++)"start"===a[o].type?2===++r&&(n=a[o].time):"end"===a[o].type&&1===--r&&(i=a[o].time),null!==n&&null!==i&&(s.push([n,i]),n=null,i=null);return dl.createTimeRanges(s)}(this.audioBuffered(),this.videoBuffered())},n.setDuration=function(e,t){void 0===t&&(t=Td),Fd({type:"mediaSource",sourceUpdater:this,action:Dd(e),name:"duration",doneFn:t})},n.endOfStream=function(e,t){void 0===e&&(e=null),void 0===t&&(t=Td),"string"!=typeof e&&(e=void 0),Fd({type:"mediaSource",sourceUpdater:this,action:Rd(e),name:"endOfStream",doneFn:t})},n.removeAudio=function(e,t,n){void 0===n&&(n=Td),this.audioBuffered().length&&0!==this.audioBuffered().end(0)?Fd({type:"audio",sourceUpdater:this,action:Ad(e,t),doneFn:n,name:"remove"}):n()},n.removeVideo=function(e,t,n){void 0===n&&(n=Td),this.videoBuffered().length&&0!==this.videoBuffered().end(0)?Fd({type:"video",sourceUpdater:this,action:Ad(e,t),doneFn:n,name:"remove"}):n()},n.updating=function(){return!(!Cd("audio",this)&&!Cd("video",this))},n.audioTimestampOffset=function(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Fd({type:"audio",sourceUpdater:this,action:Od(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_},n.videoTimestampOffset=function(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset!==e&&(Fd({type:"video",sourceUpdater:this,action:Od(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_},n.audioQueueCallback=function(e){this.audioBuffer&&Fd({type:"audio",sourceUpdater:this,action:Ld(e),name:"callback"})},n.videoQueueCallback=function(e){this.videoBuffer&&Fd({type:"video",sourceUpdater:this,action:Ld(e),name:"callback"})},n.dispose=function(){var e=this;this.trigger("dispose"),Ed.forEach((function(t){e.abort(t),e.canRemoveSourceBuffer()?e.removeSourceBuffer(t):e[t+"QueueCallback"]((function(){return Id(t,e)}))})),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()},t}(dl.EventTarget),Vd=function(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))},qd=new Uint8Array("\n\n".split("").map((function(e){return e.charCodeAt(0)}))),Wd=function(e){function t(t,n){var i;return void 0===n&&(n={}),(i=e.call(this,t,n)||this).mediaSource_=null,i.subtitlesTrack_=null,i.loaderType_="subtitle",i.featuresNativeTextTracks_=t.featuresNativeTextTracks,i.shouldSaveSegmentTimingInfo_=!1,i}R(t,e);var n=t.prototype;return n.createTransmuxer_=function(){return null},n.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return dl.createTimeRanges();var e=this.subtitlesTrack_.cues,t=e[0].startTime,n=e[e.length-1].startTime;return dl.createTimeRanges([[t,n]])},n.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var n=hc(e),i=this.initSegments_[n];if(t&&!i&&e.bytes){var r=qd.byteLength+e.bytes.byteLength,a=new Uint8Array(r);a.set(e.bytes),a.set(qd,e.bytes.byteLength),this.initSegments_[n]=i={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return i||e},n.couldBeginLoading_=function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()},n.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},n.track=function(e){return void 0===e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_},n.remove=function(e,t){pd(e,t,this.subtitlesTrack_)},n.fillBuffer_=function(){var e=this,t=this.chooseNextRequest_();if(t){if(null===this.syncController_.timestampOffsetForTimeline(t.timeline)){return this.syncController_.one("timestampoffset",(function(){e.state="READY",e.paused()||e.monitorBuffer_()})),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(t)}},n.timestampOffsetForSegment_=function(){return null},n.chooseNextRequest_=function(){return this.skipEmptySegments_(e.prototype.chooseNextRequest_.call(this))},n.skipEmptySegments_=function(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e},n.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},n.segmentRequestFinished_=function(e,t,n){var i=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===Hc&&this.handleTimeout_(),e.code===Vc?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);var r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),this.state="APPENDING",this.trigger("appending");var a=r.segment;if(a.map&&(a.map.bytes=t.map.bytes),r.bytes=t.bytes,"function"!=typeof C.WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var s,o=function(){i.subtitlesTrack_.tech_.off("vttjsloaded",s),i.stopForError({message:"Error loading vtt.js"})};return s=function(){i.subtitlesTrack_.tech_.off("vttjserror",o),i.segmentRequestFinished_(e,t,n)},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",s),void this.subtitlesTrack_.tech_.one("vttjserror",o)}a.requested=!0;try{this.parseVTTCues_(r)}catch(e){return void this.stopForError({message:e.message})}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,r.cues.forEach((function(e){i.subtitlesTrack_.addCue(i.featuresNativeTextTracks_?new C.VTTCue(e.startTime,e.endTime,e.text):e)})),function(e){var t=e.cues;if(t)for(var n=0;n<t.length;n++){for(var i=[],r=0,a=0;a<t.length;a++)t[n].startTime===t[a].startTime&&t[n].endTime===t[a].endTime&&t[n].text===t[a].text&&++r>1&&i.push(t[a]);i.length&&i.forEach((function(t){return e.removeCue(t)}))}}(this.subtitlesTrack_),this.handleAppendsDone_()}else this.state="READY"},n.handleData_=function(){},n.updateTimingInfoEnd_=function(){},n.parseVTTCues_=function(e){var t,n=!1;"function"==typeof C.TextDecoder?t=new C.TextDecoder("utf8"):(t=C.WebVTT.StringDecoder(),n=!0);var i=new C.WebVTT.Parser(C,C.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},i.oncue=e.cues.push.bind(e.cues),i.ontimestampmap=function(t){e.timestampmap=t},i.onparsingerror=function(e){dl.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){var r=e.segment.map.bytes;n&&(r=Vd(r)),i.parse(r)}var a=e.bytes;n&&(a=Vd(a)),i.parse(a),i.flush()},n.updateTimeMapping_=function(e,t,n){var i=e.segment;if(t)if(e.cues.length){var r=e.timestampmap,a=r.MPEGTS/ir-r.LOCAL+t.mapping;if(e.cues.forEach((function(e){e.startTime+=a,e.endTime+=a})),!n.syncInfo){var s=e.cues[0].startTime,o=e.cues[e.cues.length-1].startTime;n.syncInfo={mediaSequence:n.mediaSequence+e.mediaIndex,time:Math.min(s,o-i.duration)}}}else i.empty=!0},t}(bd),zd=function(e,t){for(var n=e.cues,i=0;i<n.length;i++){var r=n[i];if(t>=r.adStartTime&&t<=r.adEndTime)return r}return null},Gd=[{name:"VOD",run:function(e,t,n,i,r){if(n!==1/0){return{time:0,segmentIndex:0,partIndex:null}}return null}},{name:"ProgramDateTime",run:function(e,t,n,i,r){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var a=null,s=null,o=wl(t);r=r||0;for(var u=0;u<o.length;u++){var l=o[t.endList||0===r?u:o.length-(u+1)],c=l.segment,d=e.timelineToDatetimeMappings[c.timeline];if(d&&c.dateTimeObject){var h=c.dateTimeObject.getTime()/1e3+d;if(c.parts&&"number"==typeof l.partIndex)for(var p=0;p<l.partIndex;p++)h+=c.parts[p].duration;var f=Math.abs(r-h);if(null!==s&&(0===f||s<f))break;s=f,a={time:h,segmentIndex:l.segmentIndex,partIndex:l.partIndex}}}return a}},{name:"Segment",run:function(e,t,n,i,r){var a=null,s=null;r=r||0;for(var o=wl(t),u=0;u<o.length;u++){var l=o[t.endList||0===r?u:o.length-(u+1)],c=l.segment,d=l.part&&l.part.start||c&&c.start;if(c.timeline===i&&void 0!==d){var h=Math.abs(r-d);if(null!==s&&s<h)break;(!a||null===s||s>=h)&&(s=h,a={time:d,segmentIndex:l.segmentIndex,partIndex:l.partIndex})}}return a}},{name:"Discontinuity",run:function(e,t,n,i,r){var a=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var s=null,o=0;o<t.discontinuityStarts.length;o++){var u=t.discontinuityStarts[o],l=t.discontinuitySequence+o+1,c=e.discontinuities[l];if(c){var d=Math.abs(r-c.time);if(null!==s&&s<d)break;(!a||null===s||s>=d)&&(s=d,a={time:c.time,segmentIndex:u,partIndex:null})}}return a}},{name:"Playlist",run:function(e,t,n,i,r){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}}],Kd=function(e){function t(t){var n;return(n=e.call(this)||this).timelines=[],n.discontinuities=[],n.timelineToDatetimeMappings={},n.logger_=gl("SyncController"),n}R(t,e);var n=t.prototype;return n.getSyncPoint=function(e,t,n,i){var r=this.runStrategies_(e,t,n,i);return r.length?this.selectSyncPoint_(r,{key:"time",value:i}):null},n.getExpiredTime=function(e,t){if(!e||!e.segments)return null;var n=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!n.length)return null;var i=this.selectSyncPoint_(n,{key:"segmentIndex",value:0});return i.segmentIndex>0&&(i.time*=-1),Math.abs(i.time+Ll({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:i.segmentIndex,endIndex:0}))},n.runStrategies_=function(e,t,n,i){for(var r=[],a=0;a<Gd.length;a++){var s=Gd[a],o=s.run(this,e,t,n,i);o&&(o.strategy=s.name,r.push({strategy:s.name,syncPoint:o}))}return r},n.selectSyncPoint_=function(e,t){for(var n=e[0].syncPoint,i=Math.abs(e[0].syncPoint[t.key]-t.value),r=e[0].strategy,a=1;a<e.length;a++){var s=Math.abs(e[a].syncPoint[t.key]-t.value);s<i&&(i=s,n=e[a].syncPoint,r=e[a].strategy)}return this.logger_("syncPoint for ["+t.key+": "+t.value+"] chosen with strategy ["+r+"]: [time:"+n.time+", segmentIndex:"+n.segmentIndex+("number"==typeof n.partIndex?",partIndex:"+n.partIndex:"")+"]"),n},n.saveExpiredSegmentInfo=function(e,t){var n=t.mediaSequence-e.mediaSequence;if(n>86400)dl.log.warn("Not saving expired segment info. Media sequence gap "+n+" is too large.");else for(var i=n-1;i>=0;i--){var r=e.segments[i];if(r&&void 0!==r.start){t.syncInfo={mediaSequence:e.mediaSequence+i,time:r.start},this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+", mediaSequence: "+t.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},n.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var t=e.segments[0],n=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-n}},n.saveSegmentTimingInfo=function(e){var t=e.segmentInfo,n=e.shouldSaveTimelineMapping,i=this.calculateSegmentTimeMapping_(t,t.timingInfo,n),r=t.segment;i&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:r.start}));var a=r.dateTimeObject;r.discontinuity&&n&&a&&(this.timelineToDatetimeMappings[r.timeline]=-a.getTime()/1e3)},n.timestampOffsetForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].time},n.mappingForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping},n.calculateSegmentTimeMapping_=function(e,t,n){var i,r,a=e.segment,s=e.part,o=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},n&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+o.time+"] [mapping: "+o.mapping+"]")),i=e.startOfSegment,r=t.end+o.mapping;else{if(!o)return!1;i=t.start+o.mapping,r=t.end+o.mapping}return s&&(s.start=i,s.end=r),(!a.start||i<a.start)&&(a.start=i),a.end=r,!0},n.saveDiscontinuitySyncInfo_=function(e){var t=e.playlist,n=e.segment;if(n.discontinuity)this.discontinuities[n.timeline]={time:n.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(var i=0;i<t.discontinuityStarts.length;i++){var r=t.discontinuityStarts[i],a=t.discontinuitySequence+i+1,s=r-e.mediaIndex,o=Math.abs(s);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>o){var u=void 0;u=s<0?n.start-Ll({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:r}):n.end+Ll({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:r}),this.discontinuities[a]={time:u,accuracy:o}}}},n.dispose=function(){this.trigger("dispose"),this.off()},t}(dl.EventTarget),Xd=function(e){function t(){var t;return(t=e.call(this)||this).pendingTimelineChanges_={},t.lastTimelineChanges_={},t}R(t,e);var n=t.prototype;return n.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},n.pendingTimelineChange=function(e){var t=e.type,n=e.from,i=e.to;return"number"==typeof n&&"number"==typeof i&&(this.pendingTimelineChanges_[t]={type:t,from:n,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]},n.lastTimelineChange=function(e){var t=e.type,n=e.from,i=e.to;return"number"==typeof n&&"number"==typeof i&&(this.lastTimelineChanges_[t]={type:t,from:n,to:i},delete this.pendingTimelineChanges_[t],this.trigger("timelinechange")),this.lastTimelineChanges_[t]},n.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},t}(dl.EventTarget),Qd=Pc(xc(Ac((function(){function e(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var t=e((function(e){function t(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}e.exports=function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e},e.exports.default=e.exports,e.exports.__esModule=!0})),n=e((function(e){function t(n,i){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,t(n,i)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0})),i=e((function(e){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0})),r=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(n,1),n>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var n=t.length,i=0;i<n;++i)t[i].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}();/*! @name aes-decrypter @version 3.1.2 @license Apache-2.0 */
var a=null,s=function(){function e(e){var t,n,i;a||(a=function(){var e,t,n,i,r,a,s,o,u=[[[],[],[],[],[]],[[],[],[],[],[]]],l=u[0],c=u[1],d=l[4],h=c[4],p=[],f=[];for(e=0;e<256;e++)f[(p[e]=e<<1^283*(e>>7))^e]=e;for(t=n=0;!d[t];t^=i||1,n=f[n]||1)for(a=(a=n^n<<1^n<<2^n<<3^n<<4)>>8^255&a^99,d[t]=a,h[a]=t,o=16843009*p[r=p[i=p[t]]]^65537*r^257*i^16843008*t,s=257*p[a]^16843008*a,e=0;e<4;e++)l[e][t]=s=s<<24^s>>>8,c[e][a]=o=o<<24^o>>>8;for(e=0;e<5;e++)l[e]=l[e].slice(0),c[e]=c[e].slice(0);return u}()),this._tables=[[a[0][0].slice(),a[0][1].slice(),a[0][2].slice(),a[0][3].slice(),a[0][4].slice()],[a[1][0].slice(),a[1][1].slice(),a[1][2].slice(),a[1][3].slice(),a[1][4].slice()]];var r=this._tables[0][4],s=this._tables[1],o=e.length,u=1;if(4!==o&&6!==o&&8!==o)throw new Error("Invalid aes key size");var l=e.slice(0),c=[];for(this._key=[l,c],t=o;t<4*o+28;t++)i=l[t-1],(t%o==0||8===o&&t%o==4)&&(i=r[i>>>24]<<24^r[i>>16&255]<<16^r[i>>8&255]<<8^r[255&i],t%o==0&&(i=i<<8^i>>>24^u<<24,u=u<<1^283*(u>>7))),l[t]=l[t-o]^i;for(n=0;t;n++,t--)i=l[3&n?t:t-4],c[n]=t<=4||n<4?i:s[0][r[i>>>24]]^s[1][r[i>>16&255]]^s[2][r[i>>8&255]]^s[3][r[255&i]]}return e.prototype.decrypt=function(e,t,n,i,r,a){var s,o,u,l,c=this._key[1],d=e^c[0],h=i^c[1],p=n^c[2],f=t^c[3],m=c.length/4-2,g=4,v=this._tables[1],y=v[0],_=v[1],b=v[2],T=v[3],k=v[4];for(l=0;l<m;l++)s=y[d>>>24]^_[h>>16&255]^b[p>>8&255]^T[255&f]^c[g],o=y[h>>>24]^_[p>>16&255]^b[f>>8&255]^T[255&d]^c[g+1],u=y[p>>>24]^_[f>>16&255]^b[d>>8&255]^T[255&h]^c[g+2],f=y[f>>>24]^_[d>>16&255]^b[h>>8&255]^T[255&p]^c[g+3],g+=4,d=s,h=o,p=u;for(l=0;l<4;l++)r[(3&-l)+a]=k[d>>>24]<<24^k[h>>16&255]<<16^k[p>>8&255]<<8^k[255&f]^c[g++],s=d,d=h,h=p,p=f,f=s},e}(),o=function(e){function t(){var t;return(t=e.call(this,r)||this).jobs=[],t.delay=1,t.timeout_=null,t}i(t,e);var n=t.prototype;return n.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},n.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(r),u=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},l=function(){function e(t,n,i,r){var a=e.STEP,s=new Int32Array(t.buffer),l=new Uint8Array(t.byteLength),c=0;for(this.asyncStream_=new o,this.asyncStream_.push(this.decryptChunk_(s.subarray(c,c+a),n,i,l)),c=a;c<s.length;c+=a)i=new Uint32Array([u(s[c-4]),u(s[c-3]),u(s[c-2]),u(s[c-1])]),this.asyncStream_.push(this.decryptChunk_(s.subarray(c,c+a),n,i,l));this.asyncStream_.push((function(){/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
var e;r(null,(e=l).subarray(0,e.byteLength-e[e.byteLength-1]))}))}return e.prototype.decryptChunk_=function(e,t,n,i){return function(){var r=function(e,t,n){var i,r,a,o,l,c,d,h,p,f=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),m=new s(Array.prototype.slice.call(t)),g=new Uint8Array(e.byteLength),v=new Int32Array(g.buffer);for(i=n[0],r=n[1],a=n[2],o=n[3],p=0;p<f.length;p+=4)l=u(f[p]),c=u(f[p+1]),d=u(f[p+2]),h=u(f[p+3]),m.decrypt(l,c,d,h,v,p),v[p]=u(v[p]^i),v[p+1]=u(v[p+1]^r),v[p+2]=u(v[p+2]^a),v[p+3]=u(v[p+3]^o),i=l,r=c,a=d,o=h;return g}(e,t,n);i.set(r,e.byteOffset)}},t(e,null,[{key:"STEP",get:function(){return 32e3}}]),e}();self.onmessage=function(e){var t=e.data,n=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),i=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),r=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new l(n,i,r,(function(e,n){var i,r;self.postMessage((i={source:t.source,decrypted:n},r={},Object.keys(i).forEach((function(e){var t=i[e];ArrayBuffer.isView(t)?r[e]={bytes:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}:r[e]=t})),r),[n.buffer])}))}})))),Yd=function(e){var t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},$d=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Jd=function(e,t){t.activePlaylistLoader=e,e.load()},Zd={AUDIO:function(e,t){return function(){var n=t.segmentLoaders[e],i=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;$d(n,i);var a=i.activeTrack(),s=i.activeGroup(),o=(s.filter((function(e){return e.default}))[0]||s[0]).id,u=i.tracks[o];if(a!==u){for(var l in dl.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),i.tracks)i.tracks[l].enabled=i.tracks[l]===u;i.onTrackChanged()}else r({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var n=t.segmentLoaders[e],i=t.mediaTypes[e];dl.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),$d(n,i);var r=i.activeTrack();r&&(r.mode="disabled"),i.onTrackChanged()}}},eh={AUDIO:function(e,t,n){if(t){var i=n.tech,r=n.requestOptions,a=n.segmentLoaders[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),(!i.paused()||e.endList&&"none"!==i.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),i.paused()||a.load()})),t.on("error",Zd[e](e,n))}},SUBTITLES:function(e,t,n){var i=n.tech,r=n.requestOptions,a=n.segmentLoaders[e],s=n.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!i.paused()||e.endList&&"none"!==i.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),i.paused()||a.load()})),t.on("error",Zd[e](e,n))}},th={AUDIO:function(e,t){var n=t.vhs,i=t.sourceType,r=t.segmentLoaders[e],a=t.requestOptions,s=t.master.mediaGroups,o=t.mediaTypes[e],u=o.groups,l=o.tracks,c=o.logger_,d=t.masterPlaylistLoader,h=Hl(d.master);for(var p in s[e]&&0!==Object.keys(s[e]).length||(s[e]={main:{default:{default:!0}}},h&&(s[e].main.default.playlists=d.master.playlists)),s[e])for(var f in u[p]||(u[p]=[]),s[e][p]){var m=s[e][p][f],g=void 0;if(h?(c("AUDIO group '"+p+"' label '"+f+"' is a master playlist"),m.isMasterPlaylist=!0,g=null):g="vhs-json"===i&&m.playlists?new nc(m.playlists[0],n,a):m.resolvedUri?new nc(m.resolvedUri,n,a):m.playlists&&"dash"===i?new Cc(m.playlists[0],n,a,d):null,m=dl.mergeOptions({id:f,playlistLoader:g},m),eh[e](e,m.playlistLoader,t),u[p].push(m),void 0===l[f]){var v=new dl.AudioTrack({id:f,kind:Yd(m),enabled:!1,language:m.language,default:m.default,label:f});l[f]=v}}r.on("error",Zd[e](e,t))},SUBTITLES:function(e,t){var n=t.tech,i=t.vhs,r=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions,o=t.master.mediaGroups,u=t.mediaTypes[e],l=u.groups,c=u.tracks,d=t.masterPlaylistLoader;for(var h in o[e])for(var p in l[h]||(l[h]=[]),o[e][h])if(!o[e][h][p].forced){var f=o[e][h][p],m=void 0;if("hls"===r)m=new nc(f.resolvedUri,i,s);else if("dash"===r){if(!f.playlists.filter((function(e){return e.excludeUntil!==1/0})).length)return;m=new Cc(f.playlists[0],i,s,d)}else"vhs-json"===r&&(m=new nc(f.playlists?f.playlists[0]:f.resolvedUri,i,s));if(f=dl.mergeOptions({id:p,playlistLoader:m},f),eh[e](e,f.playlistLoader,t),l[h].push(f),void 0===c[p]){var g=n.addRemoteTextTrack({id:p,kind:"subtitles",default:f.default&&f.autoselect,language:f.language,label:p},!1).track;c[p]=g}}a.on("error",Zd[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var n=t.tech,i=t.master.mediaGroups,r=t.mediaTypes[e],a=r.groups,s=r.tracks;for(var o in i[e])for(var u in a[o]||(a[o]=[]),i[e][o]){var l=i[e][o][u];if(/^(?:CC|SERVICE)/.test(l.instreamId)){var c=n.options_.vhs&&n.options_.vhs.captionServices||{},d={label:u,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(c[d.instreamId]&&(d=dl.mergeOptions(d,c[d.instreamId])),void 0===d.default&&delete d.default,a[o].push(dl.mergeOptions({id:u},l)),void 0===s[u]){var h=n.addRemoteTextTrack({id:d.instreamId,kind:"captions",default:d.default,language:d.language,label:d.label},!1).track;s[u]=h}}}}},nh=function e(t,n){for(var i=0;i<t.length;i++){if(Fl(n,t[i]))return!0;if(t[i].playlists&&e(t[i].playlists,n))return!0}return!1},ih={AUDIO:function(e,t){return function(){var n=t.mediaTypes[e].tracks;for(var i in n)if(n[i].enabled)return n[i];return null}},SUBTITLES:function(e,t){return function(){var n=t.mediaTypes[e].tracks;for(var i in n)if("showing"===n[i].mode||"hidden"===n[i].mode)return n[i];return null}}},rh=function(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(t){th[t](t,e)}));var t=e.mediaTypes,n=e.masterPlaylistLoader,i=e.tech,r=e.vhs,a=e.segmentLoaders,s=a.AUDIO,o=a.main;["AUDIO","SUBTITLES"].forEach((function(n){t[n].activeGroup=function(e,t){return function(n){var i=t.masterPlaylistLoader,r=t.mediaTypes[e].groups,a=i.media();if(!a)return null;var s=null;a.attributes[e]&&(s=r[a.attributes[e]]);var o=Object.keys(r);if(!s)if("AUDIO"===e&&o.length>1&&Hl(t.master))for(var u=0;u<o.length;u++){var l=r[o[u]];if(nh(l,a)){s=l;break}}else r.main?s=r.main:1===o.length&&(s=r[o[0]]);return void 0===n?s:null!==n&&s&&s.filter((function(e){return e.id===n.id}))[0]||null}}(n,e),t[n].activeTrack=ih[n](n,e),t[n].onGroupChanged=function(e,t){return function(){var n=t.segmentLoaders,i=n[e],r=n.main,a=t.mediaTypes[e],s=a.activeTrack(),o=a.getActiveGroup(),u=a.activePlaylistLoader,l=a.lastGroup_;o&&l&&o.id===l.id||(a.lastGroup_=o,a.lastTrack_=s,$d(i,a),o&&!o.isMasterPlaylist&&(o.playlistLoader?(i.resyncLoader(),Jd(o.playlistLoader,a)):u&&r.resetEverything()))}}(n,e),t[n].onGroupChanging=function(e,t){return function(){var n=t.segmentLoaders[e];t.mediaTypes[e].lastGroup_=null,n.abort(),n.pause()}}(n,e),t[n].onTrackChanged=function(e,t){return function(){var n=t.masterPlaylistLoader,i=t.segmentLoaders,r=i[e],a=i.main,s=t.mediaTypes[e],o=s.activeTrack(),u=s.getActiveGroup(),l=s.activePlaylistLoader,c=s.lastTrack_;if((!c||!o||c.id!==o.id)&&(s.lastGroup_=u,s.lastTrack_=o,$d(r,s),u)){if(u.isMasterPlaylist){if(!o||!c||o.id===c.id)return;var d=t.vhs.masterPlaylistController_,h=d.selectPlaylist();if(d.media()===h)return;return s.logger_("track change. Switching master audio from "+c.id+" to "+o.id),n.pause(),a.resetEverything(),void d.fastQualityChange_(h)}if("AUDIO"===e){if(!u.playlistLoader)return a.setAudio(!0),void a.resetEverything();r.setAudio(!0),a.setAudio(!1)}l!==u.playlistLoader?(r.track&&r.track(o),r.resetEverything(),Jd(u.playlistLoader,s)):Jd(u.playlistLoader,s)}}}(n,e),t[n].getActiveGroup=function(e,t){var n=t.mediaTypes;return function(){var t=n[e].activeTrack();return t?n[e].activeGroup(t):null}}(n,e)}));var u=t.AUDIO.activeGroup();if(u){var l=(u.filter((function(e){return e.default}))[0]||u[0]).id;t.AUDIO.tracks[l].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),t.AUDIO.getActiveGroup().playlistLoader?(o.setAudio(!1),s.setAudio(!0)):o.setAudio(!0)}n.on("mediachange",(function(){["AUDIO","SUBTITLES"].forEach((function(e){return t[e].onGroupChanged()}))})),n.on("mediachanging",(function(){["AUDIO","SUBTITLES"].forEach((function(e){return t[e].onGroupChanging()}))}));var c=function(){t.AUDIO.onTrackChanged(),i.trigger({type:"usage",name:"vhs-audio-change"}),i.trigger({type:"usage",name:"hls-audio-change"})};for(var d in i.audioTracks().addEventListener("change",c),i.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),r.on("dispose",(function(){i.audioTracks().removeEventListener("change",c),i.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)})),i.clearTracks("audio"),t.AUDIO.tracks)i.audioTracks().addTrack(t.AUDIO.tracks[d])},ah=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],sh=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},oh=function(e){function t(t){var n;n=e.call(this)||this;var i=t.src,r=t.handleManifestRedirects,a=t.withCredentials,s=t.tech,o=t.bandwidth,u=t.externVhs,l=t.useCueTags,c=t.blacklistDuration,d=t.enableLowInitialPlaylist,h=t.sourceType,p=t.cacheEncryptionKeys,f=t.experimentalBufferBasedABR,m=t.experimentalLeastPixelDiffSelector,g=t.captionServices;if(!i)throw new Error("A non-empty playlist URL or JSON manifest string is required");var v=t.maxPlaylistRetries;null==v&&(v=1/0),kd=u,n.experimentalBufferBasedABR=Boolean(f),n.experimentalLeastPixelDiffSelector=Boolean(m),n.withCredentials=a,n.tech_=s,n.vhs_=s.vhs,n.sourceType_=h,n.useCueTags_=l,n.blacklistDuration=c,n.maxPlaylistRetries=v,n.enableLowInitialPlaylist=d,n.useCueTags_&&(n.cueTagsTrack_=n.tech_.addTextTrack("metadata","ad-cues"),n.cueTagsTrack_.inBandMetadataTrackDispatchType=""),n.requestOptions_={withCredentials:a,handleManifestRedirects:r,maxPlaylistRetries:v,timeout:null},n.on("error",n.pauseLoading),n.mediaTypes_=function(){var e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(t){e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Td,activeTrack:Td,getActiveGroup:Td,onGroupChanged:Td,onTrackChanged:Td,lastTrack_:null,logger_:gl("MediaGroups["+t+"]")}})),e}(),n.mediaSource=new C.MediaSource,n.handleDurationChange_=n.handleDurationChange_.bind(O(n)),n.handleSourceOpen_=n.handleSourceOpen_.bind(O(n)),n.handleSourceEnded_=n.handleSourceEnded_.bind(O(n)),n.mediaSource.addEventListener("durationchange",n.handleDurationChange_),n.mediaSource.addEventListener("sourceopen",n.handleSourceOpen_),n.mediaSource.addEventListener("sourceended",n.handleSourceEnded_),n.seekable_=dl.createTimeRanges(),n.hasPlayed_=!1,n.syncController_=new Kd(t),n.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,n.decrypter_=new Qd,n.sourceUpdater_=new Hd(n.mediaSource),n.inbandTextTracks_={},n.timelineChangeController_=new Xd;var y={vhs:n.vhs_,parse708captions:t.parse708captions,captionServices:g,mediaSource:n.mediaSource,currentTime:n.tech_.currentTime.bind(n.tech_),seekable:function(){return n.seekable()},seeking:function(){return n.tech_.seeking()},duration:function(){return n.duration()},hasPlayed:function(){return n.hasPlayed_},goalBufferLength:function(){return n.goalBufferLength()},bandwidth:o,syncController:n.syncController_,decrypter:n.decrypter_,sourceType:n.sourceType_,inbandTextTracks:n.inbandTextTracks_,cacheEncryptionKeys:p,sourceUpdater:n.sourceUpdater_,timelineChangeController:n.timelineChangeController_,experimentalExactManifestTimings:t.experimentalExactManifestTimings};n.masterPlaylistLoader_="dash"===n.sourceType_?new Cc(i,n.vhs_,n.requestOptions_):new nc(i,n.vhs_,n.requestOptions_),n.setupMasterPlaylistLoaderListeners_(),n.mainSegmentLoader_=new bd(dl.mergeOptions(y,{segmentMetadataTrack:n.segmentMetadataTrack_,loaderType:"main"}),t),n.audioSegmentLoader_=new bd(dl.mergeOptions(y,{loaderType:"audio"}),t),n.subtitleSegmentLoader_=new Wd(dl.mergeOptions(y,{loaderType:"vtt",featuresNativeTextTracks:n.tech_.featuresNativeTextTracks}),t),n.setupSegmentLoaderListeners_(),n.experimentalBufferBasedABR&&(n.masterPlaylistLoader_.one("loadedplaylist",(function(){return n.startABRTimer_()})),n.tech_.on("pause",(function(){return n.stopABRTimer_()})),n.tech_.on("play",(function(){return n.startABRTimer_()}))),ah.forEach((function(e){n[e+"_"]=sh.bind(O(n),e)})),n.logger_=gl("MPC"),n.triggeredFmp4Usage=!1,"none"===n.tech_.preload()?(n.loadOnPlay_=function(){n.loadOnPlay_=null,n.masterPlaylistLoader_.load()},n.tech_.one("play",n.loadOnPlay_)):n.masterPlaylistLoader_.load(),n.timeToLoadedData__=-1,n.mainAppendsToLoadedData__=-1,n.audioAppendsToLoadedData__=-1;var _="none"===n.tech_.preload()?"play":"loadstart";return n.tech_.one(_,(function(){var e=Date.now();n.tech_.one("loadeddata",(function(){n.timeToLoadedData__=Date.now()-e,n.mainAppendsToLoadedData__=n.mainSegmentLoader_.mediaAppends,n.audioAppendsToLoadedData__=n.audioSegmentLoader_.mediaAppends}))})),n}R(t,e);var n=t.prototype;return n.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},n.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},n.appendsToLoadedData_=function(){var e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return-1===e||-1===t?-1:e+t},n.timeToLoadedData_=function(){return this.timeToLoadedData__},n.checkABR_=function(){var e=this.selectPlaylist();e&&this.shouldSwitchToMedia_(e)&&this.switchMedia_(e,"abr")},n.switchMedia_=function(e,t,n){var i=this.media(),r=i&&(i.id||i.uri),a=e.id||e.uri;r&&r!==a&&(this.logger_("switch media "+r+" -> "+a+" from "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,n)},n.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=C.setInterval((function(){return e.checkABR_()}),250)},n.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(C.clearInterval(this.abrTimer_),this.abrTimer_=null)},n.getAudioTrackPlaylists_=function(){var e=this.master(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;var n,i=e.mediaGroups.AUDIO,r=Object.keys(i);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{var a=i.main||r.length&&i[r[0]];for(var s in a)if(a[s].default){n={label:s};break}}if(!n)return t;var o=[];for(var u in i)if(i[u][n.label]){var l=i[u][n.label];if(l.playlists&&l.playlists.length)o.push.apply(o,l.playlists);else if(l.uri)o.push(l);else if(e.playlists.length)for(var c=0;c<e.playlists.length;c++){var d=e.playlists[c];d.attributes&&d.attributes.AUDIO&&d.attributes.AUDIO===u&&o.push(d)}}return o.length?o:t},n.setupMasterPlaylistLoaderListeners_=function(){var e=this;this.masterPlaylistLoader_.on("loadedmetadata",(function(){var t=e.masterPlaylistLoader_.media(),n=1.5*t.targetDuration*1e3;Bl(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=n,t.endList&&"none"!==e.tech_.preload()&&(e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load()),rh({sourceType:e.sourceType_,segmentLoaders:{AUDIO:e.audioSegmentLoader_,SUBTITLES:e.subtitleSegmentLoader_,main:e.mainSegmentLoader_},tech:e.tech_,requestOptions:e.requestOptions_,masterPlaylistLoader:e.masterPlaylistLoader_,vhs:e.vhs_,master:e.master(),mediaTypes:e.mediaTypes_,blacklistCurrentPlaylist:e.blacklistCurrentPlaylist.bind(e)}),e.triggerPresenceUsage_(e.master(),t),e.setupFirstPlay(),!e.mediaTypes_.AUDIO.activePlaylistLoader||e.mediaTypes_.AUDIO.activePlaylistLoader.media()?e.trigger("selectedinitialmedia"):e.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",(function(){e.trigger("selectedinitialmedia")}))})),this.masterPlaylistLoader_.on("loadedplaylist",(function(){e.loadOnPlay_&&e.tech_.off("play",e.loadOnPlay_);var t=e.masterPlaylistLoader_.media();if(!t){var n;if(e.excludeUnsupportedVariants_(),e.enableLowInitialPlaylist&&(n=e.selectInitialPlaylist()),n||(n=e.selectPlaylist()),!n||!e.shouldSwitchToMedia_(n))return;if(e.initialMedia_=n,e.switchMedia_(e.initialMedia_,"initial"),!("vhs-json"===e.sourceType_&&e.initialMedia_.segments))return;t=e.initialMedia_}e.handleUpdatedMediaPlaylist(t)})),this.masterPlaylistLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.masterPlaylistLoader_.error)})),this.masterPlaylistLoader_.on("mediachanging",(function(){e.mainSegmentLoader_.abort(),e.mainSegmentLoader_.pause()})),this.masterPlaylistLoader_.on("mediachange",(function(){var t=e.masterPlaylistLoader_.media(),n=1.5*t.targetDuration*1e3;Bl(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=n,e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load(),e.tech_.trigger({type:"mediachange",bubbles:!0})})),this.masterPlaylistLoader_.on("playlistunchanged",(function(){var t=e.masterPlaylistLoader_.media();"playlist-unchanged"!==t.lastExcludeReason_&&(e.stuckAtPlaylistEnd_(t)&&(e.blacklistCurrentPlaylist({message:"Playlist no longer updating.",reason:"playlist-unchanged"}),e.tech_.trigger("playliststuck")))})),this.masterPlaylistLoader_.on("renditiondisabled",(function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})})),this.masterPlaylistLoader_.on("renditionenabled",(function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})}))},n.handleUpdatedMediaPlaylist=function(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())},n.triggerPresenceUsage_=function(e,t){var n=e.mediaGroups||{},i=!0,r=Object.keys(n.AUDIO);for(var a in n.AUDIO)for(var s in n.AUDIO[a]){n.AUDIO[a][s].uri||(i=!1)}i&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(n.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),kd.Playlist.isAes(t)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),r.length&&Object.keys(n.AUDIO[r[0]]).length>1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},n.shouldSwitchToMedia_=function(e){var t=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,n=this.tech_.currentTime(),i=this.bufferLowWaterLine(),r=this.bufferHighWaterLine();return function(e){var t=e.currentPlaylist,n=e.buffered,i=e.currentTime,r=e.nextPlaylist,a=e.bufferLowWaterLine,s=e.bufferHighWaterLine,o=e.duration,u=e.experimentalBufferBasedABR,l=e.log;if(!r)return dl.log.warn("We received no playlist to switch to. Please check your stream."),!1;var c="allowing switch "+(t&&t.id||"null")+" -> "+r.id;if(!t)return l(c+" as current playlist is not set"),!0;if(r.id===t.id)return!1;var d=Boolean(yl(n,i).length);if(!t.endList)return d||"number"!=typeof t.partTargetDuration?(l(c+" as current playlist is live"),!0):(l("not "+c+" as current playlist is live llhls, but currentTime isn't in buffered."),!1);var h=Sl(n,i),p=u?wc.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:wc.MAX_BUFFER_LOW_WATER_LINE;if(o<p)return l(c+" as duration < max low water line ("+o+" < "+p+")"),!0;var f=r.attributes.BANDWIDTH,m=t.attributes.BANDWIDTH;if(f<m&&(!u||h<s)){var g=c+" as next bandwidth < current bandwidth ("+f+" < "+m+")";return u&&(g+=" and forwardBuffer < bufferHighWaterLine ("+h+" < "+s+")"),l(g),!0}if((!u||f>m)&&h>=a){var v=c+" as forwardBuffer >= bufferLowWaterLine ("+h+" >= "+a+")";return u&&(v+=" and next bandwidth > current bandwidth ("+f+" > "+m+")"),l(v),!0}return l("not "+c+" as no switching criteria met"),!1}({buffered:this.tech_.buffered(),currentTime:n,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:i,bufferHighWaterLine:r,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},n.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",(function(){var t=e.selectPlaylist();e.shouldSwitchToMedia_(t)&&e.switchMedia_(t,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("progress",(function(){e.trigger("progress")}))),this.mainSegmentLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())})),this.mainSegmentLoader_.on("appenderror",(function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.audioSegmentLoader_.on("appenderror",(function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("ended",(function(){e.logger_("main segment loader ended"),e.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(function(t){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))}));var t=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var t=e.getCodecsOrExclude_();t&&e.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("ended",(function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()}))},n.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},n.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},n.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},n.fastQualityChange_=function(e){var t=this;void 0===e&&(e=this.selectPlaylist()),e!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything((function(){dl.browser.IE_VERSION||dl.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime())}))):this.logger_("skipping fastQualityChange because new media is same as old")},n.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}},n.setupFirstPlay=function(){var e=this,t=this.masterPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_)return!1;if(!t.endList){var n=this.seekable();if(!n.length)return!1;if(dl.browser.IE_VERSION&&0===this.tech_.readyState())return this.tech_.one("loadedmetadata",(function(){e.trigger("firstplay"),e.tech_.setCurrentTime(n.end(0)),e.hasPlayed_=!0})),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(n.end(0))}return this.hasPlayed_=!0,this.load(),!0},n.handleSourceOpen_=function(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){var e=this.tech_.play();void 0!==e&&"function"==typeof e.then&&e.then(null,(function(e){}))}this.trigger("sourceopen")},n.handleSourceEnded_=function(){if(this.inbandTextTracks_.metadataTrack_){var e=this.inbandTextTracks_.metadataTrack_.cues;if(e&&e.length){var t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}}},n.handleDurationChange_=function(){this.tech_.trigger("durationchange")},n.onEndOfStream=function(){var e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){var t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())},n.stuckAtPlaylistEnd_=function(e){if(!this.seekable().length)return!1;var t=this.syncController_.getExpiredTime(e,this.duration());if(null===t)return!1;var n=kd.Playlist.playlistEnd(e,t),i=this.tech_.currentTime(),r=this.tech_.buffered();if(!r.length)return n-i<=.1;var a=r.end(r.length-1);return a-i<=.1&&n-a<=.1},n.blacklistCurrentPlaylist=function(e,t){void 0===e&&(e={});var n=e.playlist||this.masterPlaylistLoader_.media();if(t=t||e.blacklistDuration||this.blacklistDuration,!n)return this.error=e,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));n.playlistErrors_++;var i,r=this.masterPlaylistLoader_.master.playlists,a=r.filter(Nl),s=1===a.length&&a[0]===n;if(1===r.length&&t!==1/0)return dl.log.warn("Problem encountered with playlist "+n.id+". Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(s);if(s){var o=!1;r.forEach((function(e){if(e!==n){var t=e.excludeUntil;void 0!==t&&t!==1/0&&(o=!0,delete e.excludeUntil)}})),o&&(dl.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}i=n.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*t,n.excludeUntil=i,e.reason&&(n.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var u=this.selectPlaylist();if(!u)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var l=e.internal?this.logger_:dl.log.warn,c=e.message?" "+e.message:"";l((e.internal?"Internal problem":"Problem")+" encountered with playlist "+n.id+"."+c+" Switching to playlist "+u.id+"."),u.attributes.AUDIO!==n.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),u.attributes.SUBTITLES!==n.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var d=u.targetDuration/2*1e3||5e3,h="number"==typeof u.lastRequest&&Date.now()-u.lastRequest<=d;return this.switchMedia_(u,"exclude",s||h)},n.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},n.delegateLoaders_=function(e,t){var n=this,i=[],r="all"===e;(r||"main"===e)&&i.push(this.masterPlaylistLoader_);var a=[];(r||"audio"===e)&&a.push("AUDIO"),(r||"subtitle"===e)&&(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach((function(e){var t=n.mediaTypes_[e]&&n.mediaTypes_[e].activePlaylistLoader;t&&i.push(t)})),["main","audio","subtitle"].forEach((function(t){var r=n[t+"SegmentLoader_"];!r||e!==t&&"all"!==e||i.push(r)})),i.forEach((function(e){return t.forEach((function(t){"function"==typeof e[t]&&e[t]()}))}))},n.setCurrentTime=function(e){var t=yl(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},n.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:kd.Playlist.duration(e):1/0:0},n.seekable=function(){return this.seekable_},n.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_&&!this.sourceUpdater_.hasCreatedSourceBuffers()){var t=this.masterPlaylistLoader_.media();if(t){var n=this.syncController_.getExpiredTime(t,this.duration());if(null!==n){var i=this.masterPlaylistLoader_.master,r=kd.Playlist.seekable(t,n,kd.Playlist.liveEdgeDelay(i,t));if(0!==r.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(n=this.syncController_.getExpiredTime(t,this.duration())))return;if(0===(e=kd.Playlist.seekable(t,n,kd.Playlist.liveEdgeDelay(i,t))).length)return}var a,s;this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),s=this.seekable_.start(0)),e?e.start(0)>r.end(0)||r.start(0)>e.end(0)?this.seekable_=r:this.seekable_=dl.createTimeRanges([[e.start(0)>r.start(0)?e.start(0):r.start(0),e.end(0)<r.end(0)?e.end(0):r.end(0)]]):this.seekable_=r,this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===a&&this.seekable_.start(0)===s||(this.logger_("seekable updated ["+bl(this.seekable_)+"]"),this.tech_.trigger("seekablechanged"))}}}}},n.updateDuration=function(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,e),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(e){var t=this.seekable();if(!t.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<t.end(t.length-1))&&this.sourceUpdater_.setDuration(t.end(t.length-1))}else{var n=this.tech_.buffered(),i=kd.Playlist.duration(this.masterPlaylistLoader_.media());n.length>0&&(i=Math.max(i,n.end(n.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}},n.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach((function(t){var n=e.mediaTypes_[t].groups;for(var i in n)n[i].forEach((function(e){e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},n.master=function(){return this.masterPlaylistLoader_.master},n.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},n.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),n=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!n)},n.getCodecsOrExclude_=function(){var e=this,t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};t.video=t.main;var n=rd(this.master(),this.media()),i={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(i.video=n.video||t.main.videoCodec||"avc1.4d400d"),t.main.isMuxed&&(i.video+=","+(n.audio||t.main.audioCodec||"mp4a.40.2")),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||r)&&(i.audio=n.audio||t.main.audioCodec||t.audio.audioCodec||"mp4a.40.2",t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),i.audio||i.video){var a,s={};if(["video","audio"].forEach((function(e){if(i.hasOwnProperty(e)&&(r=t[e].isFmp4,o=i[e],!(r?Ve(o):qe(o)))){var n=t[e].isFmp4?"browser":"muxer";s[n]=s[n]||[],s[n].push(i[e]),"audio"===e&&(a=n)}var r,o})),r&&a&&this.media().attributes.AUDIO){var o=this.media().attributes.AUDIO;this.master().playlists.forEach((function(t){(t.attributes&&t.attributes.AUDIO)===o&&t!==e.media()&&(t.excludeUntil=1/0)})),this.logger_("excluding audio group "+o+" as "+a+' does not support codec(s): "'+i.audio+'"')}if(!Object.keys(s).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var u=[];if(["video","audio"].forEach((function(t){var n=(Fe(e.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(Fe(i[t]||"")[0]||{}).type;n&&r&&n.toLowerCase()!==r.toLowerCase()&&u.push('"'+e.sourceUpdater_.codecs[t]+'" -> "'+i[t]+'"')})),u.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+u.join(", ")+".",blacklistDuration:1/0,internal:!0})}return i}var l=Object.keys(s).reduce((function(e,t){return e&&(e+=", "),e+=t+' does not support codec(s): "'+s[t].join(",")+'"'}),"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:l,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},n.tryToCreateSourceBuffers_=function(){if("open"===this.mediaSource.readyState&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}}},n.excludeUnsupportedVariants_=function(){var e=this,t=this.master().playlists,n=[];Object.keys(t).forEach((function(i){var r=t[i];if(-1===n.indexOf(r.id)){n.push(r.id);var a=rd(e.master,r),s=[];!a.audio||qe(a.audio)||Ve(a.audio)||s.push("audio codec "+a.audio),!a.video||qe(a.video)||Ve(a.video)||s.push("video codec "+a.video),a.text&&"stpp.ttml.im1t"===a.text&&s.push("text codec "+a.text),s.length&&(r.excludeUntil=1/0,e.logger_("excluding "+r.id+" for unsupported: "+s.join(", ")))}}))},n.excludeIncompatibleVariants_=function(e){var t=this,n=[],i=this.master().playlists,r=nd(Fe(e)),a=id(r),s=r.video&&Fe(r.video)[0]||null,o=r.audio&&Fe(r.audio)[0]||null;Object.keys(i).forEach((function(e){var r=i[e];if(-1===n.indexOf(r.id)&&r.excludeUntil!==1/0){n.push(r.id);var u=[],l=rd(t.masterPlaylistLoader_.master,r),c=id(l);if(l.audio||l.video){if(c!==a&&u.push('codec count "'+c+'" !== "'+a+'"'),!t.sourceUpdater_.canChangeType()){var d=l.video&&Fe(l.video)[0]||null,h=l.audio&&Fe(l.audio)[0]||null;d&&s&&d.type.toLowerCase()!==s.type.toLowerCase()&&u.push('video codec "'+d.type+'" !== "'+s.type+'"'),h&&o&&h.type.toLowerCase()!==o.type.toLowerCase()&&u.push('audio codec "'+h.type+'" !== "'+o.type+'"')}u.length&&(r.excludeUntil=1/0,t.logger_("blacklisting "+r.id+": "+u.join(" && ")))}}}))},n.updateAdCues_=function(e){var t=0,n=this.seekable();n.length&&(t=n.start(0)),function(e,t,n){if(void 0===n&&(n=0),e.segments)for(var i,r=n,a=0;a<e.segments.length;a++){var s=e.segments[a];if(i||(i=zd(t,r+s.duration/2)),i){if("cueIn"in s){i.endTime=r,i.adEndTime=r,r+=s.duration,i=null;continue}if(r<i.endTime){r+=s.duration;continue}i.endTime+=s.duration}else if("cueOut"in s&&((i=new C.VTTCue(r,r+s.duration,s.cueOut)).adStartTime=r,i.adEndTime=r+parseFloat(s.cueOut),t.addCue(i)),"cueOutCont"in s){var o=s.cueOutCont.split("/").map(parseFloat),u=o[0],l=o[1];(i=new C.VTTCue(r,r+s.duration,"")).adStartTime=r-u,i.adEndTime=i.adStartTime+l,t.addCue(i)}r+=s.duration}}(e,this.cueTagsTrack_,t)},n.goalBufferLength=function(){var e=this.tech_.currentTime(),t=wc.GOAL_BUFFER_LENGTH,n=wc.GOAL_BUFFER_LENGTH_RATE,i=Math.max(t,wc.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*n,i)},n.bufferLowWaterLine=function(){var e=this.tech_.currentTime(),t=wc.BUFFER_LOW_WATER_LINE,n=wc.BUFFER_LOW_WATER_LINE_RATE,i=Math.max(t,wc.MAX_BUFFER_LOW_WATER_LINE),r=Math.max(t,wc.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*n,this.experimentalBufferBasedABR?r:i)},n.bufferHighWaterLine=function(){return wc.BUFFER_HIGH_WATER_LINE},t}(dl.EventTarget),uh=function(e,t,n){var i,r,a,s=e.masterPlaylistController_,o=s[(e.options_.smoothQualityChange?"smooth":"fast")+"QualityChange_"].bind(s);if(t.attributes){var u=t.attributes.RESOLUTION;this.width=u&&u.width,this.height=u&&u.height,this.bandwidth=t.attributes.BANDWIDTH}this.codecs=rd(s.master(),t),this.playlist=t,this.id=n,this.enabled=(i=e.playlists,r=t.id,a=o,function(e){var t=i.master.playlists[r],n=Ml(t),s=Nl(t);return void 0===e?s:(e?delete t.disabled:t.disabled=!0,e===s||n||(a(),e?i.trigger("renditionenabled"):i.trigger("renditiondisabled")),e)})},lh=["seeking","seeked","pause","playing","error"],ch=function(){function e(e){var t=this;this.masterPlaylistController_=e.masterPlaylistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=gl("PlaybackWatcher"),this.logger_("initialize");var n=function(){return t.monitorCurrentTime_()},i=function(){return t.monitorCurrentTime_()},r=function(){return t.techWaiting_()},a=function(){return t.cancelTimer_()},s=this.masterPlaylistController_,o=["main","subtitle","audio"],u={};o.forEach((function(e){u[e]={reset:function(){return t.resetSegmentDownloads_(e)},updateend:function(){return t.checkSegmentDownloads_(e)}},s[e+"SegmentLoader_"].on("appendsdone",u[e].updateend),s[e+"SegmentLoader_"].on("playlistupdate",u[e].reset),t.tech_.on(["seeked","seeking"],u[e].reset)}));var l=function(e){["main","audio"].forEach((function(n){s[n+"SegmentLoader_"][e]("appended",t.seekingAppendCheck_)}))};this.seekingAppendCheck_=function(){t.fixesBadSeeks_()&&(t.consecutiveUpdates=0,t.lastRecordedTime=t.tech_.currentTime(),l("off"))},this.clearSeekingAppendCheck_=function(){return l("off")},this.watchForBadSeeking_=function(){t.clearSeekingAppendCheck_(),l("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(lh,a),this.tech_.on("canplay",i),this.tech_.one("play",n),this.dispose=function(){t.clearSeekingAppendCheck_(),t.logger_("dispose"),t.tech_.off("waiting",r),t.tech_.off(lh,a),t.tech_.off("canplay",i),t.tech_.off("play",n),t.tech_.off("seeking",t.watchForBadSeeking_),t.tech_.off("seeked",t.clearSeekingAppendCheck_),o.forEach((function(e){s[e+"SegmentLoader_"].off("appendsdone",u[e].updateend),s[e+"SegmentLoader_"].off("playlistupdate",u[e].reset),t.tech_.off(["seeked","seeking"],u[e].reset)})),t.checkCurrentTimeTimeout_&&C.clearTimeout(t.checkCurrentTimeTimeout_),t.cancelTimer_()}}var t=e.prototype;return t.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&C.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=C.setTimeout(this.monitorCurrentTime_.bind(this),250)},t.resetSegmentDownloads_=function(e){var t=this.masterPlaylistController_[e+"SegmentLoader_"];this[e+"StalledDownloads_"]>0&&this.logger_("resetting possible stalled download count for "+e+" loader"),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_()},t.checkSegmentDownloads_=function(e){var t=this.masterPlaylistController_,n=t[e+"SegmentLoader_"],i=n.buffered_(),r=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(var n=0;n<e.length;n++)if(e.start(n)!==t.start(n)||e.end(n)!==t.end(n))return!0;return!1}(this[e+"Buffered_"],i);this[e+"Buffered_"]=i,r?this.resetSegmentDownloads_(e):(this[e+"StalledDownloads_"]++,this.logger_("found #"+this[e+"StalledDownloads_"]+" "+e+" appends that did not increase buffer (possible stalled download)",{playlistId:n.playlist_&&n.playlist_.id,buffered:Tl(i)}),this[e+"StalledDownloads_"]<10||(this.logger_(e+" loader stalled download exclusion"),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:"vhs-"+e+"-download-exclusion"}),"subtitle"!==e&&t.blacklistCurrentPlaylist({message:"Excessive "+e+" segment downloading detected."},1/0)))},t.checkCurrentTime_=function(){if(!this.tech_.paused()&&!this.tech_.seeking()){var e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+.1>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var e,t=this.seekable(),n=this.tech_.currentTime();this.afterSeekableWindow_(t,n,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1));if(this.beforeSeekableWindow_(t,n)){var i=t.start(0);e=i+(i===t.end(0)?0:.1)}if(void 0!==e)return this.logger_("Trying to seek outside of seekable at time "+n+" with seekable range "+bl(t)+". Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0;for(var r=this.masterPlaylistController_.sourceUpdater_,a=this.tech_.buffered(),s=r.audioBuffer?r.audioBuffered():null,o=r.videoBuffer?r.videoBuffered():null,u=this.media(),l=u.partTargetDuration?u.partTargetDuration:2*(u.targetDuration-1/30),c=[s,o],d=0;d<c.length;d++){if(c[d])if(Sl(c[d],n)<l)return!1}var h=_l(a,n);return 0!==h.length&&(e=h.start(0)+.1,this.logger_("Buffered region starts ("+h.start(0)+")  just beyond seek point ("+n+"). Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0)},t.waiting_=function(){if(!this.techWaiting_()){var e=this.tech_.currentTime(),t=this.tech_.buffered(),n=yl(t,e);return n.length&&e+3<=n.end(0)?(this.cancelTimer_(),this.tech_.setCurrentTime(e),this.logger_("Stopped at "+e+" while inside a buffered region ["+n.start(0)+" -> "+n.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}},t.techWaiting_=function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var n=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+n),this.cancelTimer_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var i=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t}))return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var a=_l(r,t);if(a.length>0){var s=a.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+s+", seeking to "+a.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*s,t),!0}return!1},t.afterSeekableWindow_=function(e,t,n,i){if(void 0===i&&(i=!1),!e.length)return!1;var r=e.end(e.length-1)+.1;return!n.endList&&i&&(r=e.end(e.length-1)+3*n.targetDuration),t>r},t.beforeSeekableWindow_=function(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)},t.videoUnderflow_=function(e){var t=e.videoBuffered,n=e.audioBuffered,i=e.currentTime;if(t){var r;if(t.length&&n.length){var a=yl(t,i-3),s=yl(t,i),o=yl(n,i);o.length&&!s.length&&a.length&&(r={start:a.end(0),end:o.end(0)})}else{_l(t,i).length||(r=this.gapFromVideoUnderflow_(t,i))}return!!r&&(this.logger_("Encountered a gap in video from "+r.start+" to "+r.end+". Seeking to current time "+i),!0)}},t.skipTheGap_=function(e){var t=this.tech_.buffered(),n=this.tech_.currentTime(),i=_l(t,n);this.cancelTimer_(),0!==i.length&&n===e&&(this.logger_("skipTheGap_:","currentTime:",n,"scheduled currentTime:",e,"nextRange start:",i.start(0)),this.tech_.setCurrentTime(i.start(0)+1/30),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))},t.gapFromVideoUnderflow_=function(e,t){for(var n=function(e){if(e.length<2)return dl.createTimeRanges();for(var t=[],n=1;n<e.length;n++){var i=e.end(n-1),r=e.start(n);t.push([i,r])}return dl.createTimeRanges(t)}(e),i=0;i<n.length;i++){var r=n.start(i),a=n.end(i);if(t-r<4&&t-r>2)return{start:r,end:a}}return null},e}(),dh={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},hh={PlaylistLoader:nc,Playlist:Vl,utils:mc,STANDARD_PLAYLIST_SELECTOR:dd,INITIAL_PLAYLIST_SELECTOR:function(){var e=this,t=this.playlists.master.playlists.filter(Vl.isEnabled);return ud(t,(function(e,t){return ld(e,t)})),t.filter((function(t){return!!rd(e.playlists.master,t).video}))[0]||null},lastBandwidthSelector:dd,movingAverageBandwidthSelector:function(e){var t=-1,n=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var i=this.useDevicePixelRatio&&C.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,n=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==n&&(t=e*this.systemBandwidth+(1-e)*t,n=this.systemBandwidth),cd(this.playlists.master,t,parseInt(od(this.tech_.el(),"width"),10)*i,parseInt(od(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:ld,comparePlaylistResolution:function(e,t){var n,i;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(n=e.attributes.RESOLUTION.width),n=n||C.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(i=t.attributes.RESOLUTION.width),n===(i=i||C.Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:n-i},xhr:sc()};Object.keys(wc).forEach((function(e){Object.defineProperty(hh,e,{get:function(){return dl.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),wc[e]},set:function(t){dl.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?dl.log.warn("value of Vhs."+e+" must be greater than or equal to 0"):wc[e]=t}})}));var ph=function(e,t){for(var n=t.media(),i=-1,r=0;r<e.length;r++)if(e[r].id===n.id){i=r;break}e.selectedIndex_=i,e.trigger({selectedIndex:i,type:"change"})};hh.canPlaySource=function(){return dl.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var fh=function(e){var t=e.player,n=e.sourceKeySystems,i=e.audioMedia,r=e.mainPlaylists;if(!t.eme.initializeMediaKeys)return Promise.resolve();var a=function(e,t){return e.reduce((function(e,n){if(!n.contentProtection)return e;var i=t.reduce((function(e,t){var i=n.contentProtection[t];return i&&i.pssh&&(e[t]={pssh:i.pssh}),e}),{});return Object.keys(i).length&&e.push(i),e}),[])}(i?r.concat([i]):r,Object.keys(n)),s=[],o=[];return a.forEach((function(e){o.push(new Promise((function(e,n){t.tech_.one("keysessioncreated",e)}))),s.push(new Promise((function(n,i){t.eme.initializeMediaKeys({keySystems:e},(function(e){e?i(e):n()}))})))})),Promise.race([Promise.all(s),Promise.race(o)])},mh=function(e){var t=e.player,n=function(e,t,n){if(!e)return e;var i={};t&&t.attributes&&t.attributes.CODECS&&(i=nd(Fe(t.attributes.CODECS))),n&&n.attributes&&n.attributes.CODECS&&(i.audio=n.attributes.CODECS);var r=He(i.video),a=He(i.audio),s={};for(var o in e)s[o]={},a&&(s[o].audioContentType=a),r&&(s[o].videoContentType=r),t.contentProtection&&t.contentProtection[o]&&t.contentProtection[o].pssh&&(s[o].pssh=t.contentProtection[o].pssh),"string"==typeof e[o]&&(s[o].url=e[o]);return dl.mergeOptions(e,s)}(e.sourceKeySystems,e.media,e.audioMedia);return!!n&&(t.currentSource().keySystems=n,!(n&&!t.eme)||(dl.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))},gh=function(){if(!C.localStorage)return null;var e=C.localStorage.getItem("videojs-vhs");if(!e)return null;try{return JSON.parse(e)}catch(e){return null}};hh.supportsNativeHls=function(){if(!P||!P.createElement)return!1;var e=P.createElement("video");if(!dl.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))}))}(),hh.supportsNativeDash=!!(P&&P.createElement&&dl.getTech("Html5").isSupported())&&/maybe|probably/i.test(P.createElement("video").canPlayType("application/dash+xml")),hh.supportsTypeNatively=function(e){return"hls"===e?hh.supportsNativeHls:"dash"===e&&hh.supportsNativeDash},hh.isSupported=function(){return dl.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var vh=function(e){function t(t,n,i){var r;if(r=e.call(this,n,dl.mergeOptions(i.hls,i.vhs))||this,i.hls&&Object.keys(i.hls).length&&dl.log.warn("Using hls options is deprecated. Use vhs instead."),"number"==typeof i.initialBandwidth&&(r.options_.bandwidth=i.initialBandwidth),r.logger_=gl("VhsHandler"),n.options_&&n.options_.playerId){var a=dl(n.options_.playerId);a.hasOwnProperty("hls")||Object.defineProperty(a,"hls",{get:function(){return dl.log.warn("player.hls is deprecated. Use player.tech().vhs instead."),n.trigger({type:"usage",name:"hls-player-access"}),O(r)},configurable:!0}),a.hasOwnProperty("vhs")||Object.defineProperty(a,"vhs",{get:function(){return dl.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."),n.trigger({type:"usage",name:"vhs-player-access"}),O(r)},configurable:!0}),a.hasOwnProperty("dash")||Object.defineProperty(a,"dash",{get:function(){return dl.log.warn("player.dash is deprecated. Use player.tech().vhs instead."),O(r)},configurable:!0}),r.player_=a}if(r.tech_=n,r.source_=t,r.stats={},r.ignoreNextSeekingEvent_=!1,r.setOptions_(),r.options_.overrideNative&&n.overrideNativeAudioTracks&&n.overrideNativeVideoTracks)n.overrideNativeAudioTracks(!0),n.overrideNativeVideoTracks(!0);else if(r.options_.overrideNative&&(n.featuresNativeVideoTracks||n.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return r.on(P,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(function(e){var t=P.fullscreenElement||P.webkitFullscreenElement||P.mozFullScreenElement||P.msFullscreenElement;t&&t.contains(r.tech_.el())?r.masterPlaylistController_.fastQualityChange_():r.masterPlaylistController_.checkABR_()})),r.on(r.tech_,"seeking",(function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())})),r.on(r.tech_,"error",(function(){this.tech_.error()&&this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()})),r.on(r.tech_,"play",r.play),r}R(t,e);var n=t.prototype;return n.setOptions_=function(){var e=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=!1!==this.options_.handleManifestRedirects,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,"number"!=typeof this.options_.blacklistDuration&&(this.options_.blacklistDuration=300),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){var t=gh();t&&t.bandwidth&&(this.options_.bandwidth=t.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"}),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:"vhs-throughput-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=wc.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===wc.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","experimentalBufferBasedABR","liveRangeSafeTimeDelta","experimentalLLHLS","useNetworkInformationApi","experimentalExactManifestTimings","experimentalLeastPixelDiffSelector"].forEach((function(t){void 0!==e.source_[t]&&(e.options_[t]=e.source_[t])})),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio},n.src=function(e,t){var n=this;if(e){var i;this.setOptions_(),this.options_.src=0===(i=this.source_.src).toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(i.substring(i.indexOf(",")+1)):i,this.options_.tech=this.tech_,this.options_.externVhs=hh,this.options_.sourceType=Ge(t),this.options_.seekTo=function(e){n.tech_.setCurrentTime(e)},this.options_.smoothQualityChange&&dl.log.warn("smoothQualityChange is deprecated and will be removed in the next major version"),this.masterPlaylistController_=new oh(this.options_);var r=dl.mergeOptions({liveRangeSafeTimeDelta:.1},this.options_,{seekable:function(){return n.seekable()},media:function(){return n.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_});this.playbackWatcher_=new ch(r),this.masterPlaylistController_.on("error",(function(){var e=dl.players[n.tech_.options_.playerId],t=n.masterPlaylistController_.error;"object"!==_typeof2(t)||t.code?"string"==typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)}));var a=this.options_.experimentalBufferBasedABR?hh.movingAverageBandwidthSelector(.55):hh.STANDARD_PLAYLIST_SELECTOR;this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):a.bind(this),this.masterPlaylistController_.selectInitialPlaylist=hh.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(e){this.masterPlaylistController_.selectPlaylist=e.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=e,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){var e=this.masterPlaylistController_.mainSegmentLoader_.bandwidth,t=C.navigator.connection||C.navigator.mozConnection||C.navigator.webkitConnection;if(this.options_.useNetworkInformationApi&&t){var n=1e3*t.downlink*1e3;e=n>=1e7&&e>=1e7?Math.max(e,n):n}return e},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var e,t=1/(this.bandwidth||1);return e=this.throughput>0?1/this.throughput:0,Math.floor(1/(t+e))},set:function(){dl.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},mediaAppends:{get:function(){return n.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return n.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return n.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return n.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return n.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return Tl(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 Tl(n.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return n.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",(function(){n.options_.useBandwidthFromLocalStorage&&function(e){if(!C.localStorage)return!1;var t=gh();t=t?dl.mergeOptions(t,e):e;try{C.localStorage.setItem("videojs-vhs",JSON.stringify(t))}catch(e){return!1}}({bandwidth:n.bandwidth,throughput:Math.round(n.throughput)})})),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var e;(e=n).representations=function(){var t=e.masterPlaylistController_.master(),n=Hl(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return n?n.filter((function(e){return!Ml(e)})).map((function(t,n){return new uh(e,t,t.id)})):[]}})),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",(function(){n.setupEme_()})),this.on(this.masterPlaylistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.masterPlaylistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=C.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},n.setupEme_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,n=mh({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});this.player_.tech_.on("keystatuschange",(function(t){"output-restricted"===t.status&&e.masterPlaylistController_.blacklistCurrentPlaylist({playlist:e.masterPlaylistController_.media(),message:"DRM keystatus changed to "+t.status+". Playlist will fail to play. Check for HDCP content.",blacklistDuration:1/0})})),11!==dl.browser.IE_VERSION&&n?(this.logger_("waiting for EME key session creation"),fh({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.master.playlists}).then((function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()})).catch((function(t){e.logger_("error while creating EME key session",t),e.player_.error({message:"Failed to initialize media keys for EME",code:3})}))):this.masterPlaylistController_.sourceUpdater_.initializedEme()},n.setupQualityLevels_=function(){var e=this,t=dl.players[this.tech_.options_.playerId];t&&t.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",(function(){!function(e,t){t.representations().forEach((function(t){e.addQualityLevel(t)})),ph(e,t.playlists)}(e.qualityLevels_,e)})),this.playlists.on("mediachange",(function(){ph(e.qualityLevels_,e.playlists)})))},t.version=function(){return{"@videojs/http-streaming":"2.12.0","mux.js":"5.14.1","mpd-parser":"0.19.2","m3u8-parser":"4.7.0","aes-decrypter":"3.1.2"}},n.version=function(){return this.constructor.version()},n.canChangeType=function(){return Hd.canChangeType()},n.play=function(){this.masterPlaylistController_.play()},n.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},n.duration=function(){return this.masterPlaylistController_.duration()},n.seekable=function(){return this.masterPlaylistController_.seekable()},n.dispose=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_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&C.URL.revokeObjectURL&&(C.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),e.prototype.dispose.call(this)},n.convertToProgramTime=function(e,t){return gc({playlist:this.masterPlaylistController_.media(),time:e,callback:t})},n.seekToProgramTime=function(e,t,n,i){return void 0===n&&(n=!0),void 0===i&&(i=2),vc({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:i,pauseAfterSeek:n,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})},t}(dl.getComponent("Component")),yh={name:"videojs-http-streaming",VERSION:"2.12.0",canHandleSource:function(e,t){void 0===t&&(t={});var n=dl.mergeOptions(dl.options,t);return yh.canPlayType(e.type,n)},handleSource:function(e,t,n){void 0===n&&(n={});var i=dl.mergeOptions(dl.options,n);return t.vhs=new vh(e,t,i),dl.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return dl.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=sc(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){void 0===t&&(t={});var n=dl.mergeOptions(dl.options,t).vhs.overrideNative,i=void 0===n?!dl.browser.IS_ANY_SAFARI:n,r=Ge(e);return r&&(!hh.supportsTypeNatively(r)||i)?"maybe":""}};(Ve("avc1.4d400d,mp4a.40.2")&&dl.getTech("Html5").registerSourceHandler(yh,0),dl.VhsHandler=vh,Object.defineProperty(dl,"HlsHandler",{get:function(){return dl.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),vh},configurable:!0}),dl.VhsSourceHandler=yh,Object.defineProperty(dl,"HlsSourceHandler",{get:function(){return dl.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),yh},configurable:!0}),dl.Vhs=hh,Object.defineProperty(dl,"Hls",{get:function(){return dl.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),hh},configurable:!0}),dl.use||(dl.registerComponent("Hls",hh),dl.registerComponent("Vhs",hh)),dl.options.vhs=dl.options.vhs||{},dl.options.hls=dl.options.hls||{},dl.getPlugin&&dl.getPlugin("reloadSourceOnError"))||(dl.registerPlugin||dl.plugin)("reloadSourceOnError",(function(e){!function e(t,n){var i=0,r=0,a=dl.mergeOptions(dh,n);t.ready((function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})}));var s=function(){r&&t.currentTime(r)},o=function(e){null!=e&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(e),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},u=function(){return Date.now()-i<1e3*a.errorInterval?(t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void t.trigger({type:"usage",name:"hls-error-reload-canceled"})):a.getSource&&"function"==typeof a.getSource?(i=Date.now(),a.getSource.call(t,o)):void dl.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},l=function e(){t.off("loadedmetadata",s),t.off("error",u),t.off("dispose",e)};t.on("error",u),t.on("dispose",l),t.reloadSourceOnError=function(n){l(),e(t,n)}}(this,e)}))/*! @name videojs-contrib-quality-levels @version 2.0.9 @license Apache-2.0 */;function _h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var bh=function e(t){var n=this;if(dl.browser.IS_IE8)for(var i in n=P.createElement("custom"),e.prototype)"constructor"!==i&&(n[i]=e.prototype[i]);return n.id=t.id,n.label=n.id,n.width=t.width,n.height=t.height,n.bitrate=t.bandwidth,n.enabled_=t.enabled,Object.defineProperty(n,"enabled",{get:function(){return n.enabled_()},set:function(e){n.enabled_(e)}}),n},Th=function(e){var t,n;function i(){var t,n=_h(_h(t=e.call(this)||this));if(dl.browser.IS_IE8)for(var r in n=P.createElement("custom"),i.prototype)"constructor"!==r&&(n[r]=i.prototype[r]);return n.levels_=[],n.selectedIndex_=-1,Object.defineProperty(n,"selectedIndex",{get:function(){return n.selectedIndex_}}),Object.defineProperty(n,"length",{get:function(){return n.levels_.length}}),n||_h(t)}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var r=i.prototype;return r.addQualityLevel=function(e){var t=this.getQualityLevelById(e.id);if(t)return t;var n=this.levels_.length;return t=new bh(e),""+n in this||Object.defineProperty(this,n,{get:function(){return this.levels_[n]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t},r.removeQualityLevel=function(e){for(var t=null,n=0,i=this.length;n<i;n++)if(this[n]===e){t=this.levels_.splice(n,1)[0],this.selectedIndex_===n?this.selectedIndex_=-1:this.selectedIndex_>n&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t},r.getQualityLevelById=function(e){for(var t=0,n=this.length;t<n;t++){var i=this[t];if(i.id===e)return i}return null},r.dispose=function(){this.selectedIndex_=-1,this.levels_.length=0},i}(dl.EventTarget);for(var kh in Th.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"},Th.prototype.allowedEvents_)Th.prototype["on"+kh]=null;var Sh=dl.registerPlugin||dl.plugin,Eh=function(e){return t=this,dl.mergeOptions({},e),n=t.qualityLevels,i=new Th,t.on("dispose",(function e(){i.dispose(),t.qualityLevels=n,t.off("dispose",e)})),t.qualityLevels=function(){return i},t.qualityLevels.VERSION="2.0.9",i;var t,n,i};Sh("qualityLevels",Eh),Eh.VERSION="2.0.9";var Ch=dl.getComponent("Component"),wh=dl.dom,Ih=function(e){o(n,e);var t=h(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=a.checked,o=void 0!==s&&s,u=a.readonly,l=void 0!==u&&u;return i(this,n),(r=t.apply(this,arguments))._player=e,r._isReadonly=l,r._isReadonly||r.on(["tap","click"],r._onClick),o&&r.check(),r}return a(n,[{key:"createEl",value:function(){var e=wh.createEl("div",{className:"vjs-toggle"});return this._artdecoToggle=wh.createEl("div",{className:"vjs-toggle-input artdeco-toggle artdeco-toggle--24dp artdeco-toggle--inverse"},{id:this.id()}),this._label=wh.createEl("label",{className:"vjs-toggle-label artdeco-toggle__label a11y-text"},{for:this.id()}),this._labelText=document.createTextNode(""),this._label.appendChild(this._labelText),this._artdecoToggle.appendChild(this._label),this._checkbox=wh.createEl("input",{className:"vjs-toggle-button artdeco-toggle__input"},{type:"checkbox",role:"switch"}),this._checkboxText=document.createTextNode(""),this._checkbox.appendChild(this._checkboxText),this._artdecoToggle.appendChild(this._checkbox),e.appendChild(this._artdecoToggle),e}},{key:"check",value:function(){this._artdecoToggle.setAttribute("data-artdeco-toggled",!0),this._artdecoToggle.classList.add("artdeco-toggle--toggled"),this._labelText.nodeValue=this._player.localize("On"),this._isChecked=!0,this.trigger("check")}},{key:"uncheck",value:function(){this._artdecoToggle.removeAttribute("data-artdeco-toggled"),this._artdecoToggle.classList.remove("artdeco-toggle--toggled"),this._labelText.nodeValue=this._player.localize("Off"),this._isChecked=!1,this.trigger("uncheck")}},{key:"_onClick",value:function(){this._isChecked?this.uncheck():this.check()}}]),n}(Ch);function Ph(e,t){if(!t)throw new Error("Assertion Failed: ".concat(e))}function xh(e,t){t||console.warn(e)}function Ah(e){return(e instanceof window.HTMLAnchorElement||e instanceof window.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof window.HTMLInputElement||e instanceof window.HTMLSelectElement||e instanceof window.HTMLTextAreaElement||e instanceof window.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof window.HTMLIFrameElement||e instanceof window.HTMLObjectElement||e instanceof window.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")}dl.registerComponent("Toggle",Ih);var Oh=dl.getComponent("Player");function Lh(e){var t=e.split(":");return"vjs-".concat(t[0],"-").concat(t[1])}var Rh=["auto","16:9","4:3","1:1"],Dh=function(e){o(n,e);var t=h(n);function n(e,r){var a;return i(this,n),(a=t.call(this,e,r))._focusableControls=a._getFocusableControls(),a._focusableControls.forEach((function(e){a.on(e,"keydown",a._handleKeydown)})),a}return a(n,[{key:"_handleKeydown",value:function(e){!this.isFullscreen()||"Tab"!==e.key&&9!==e.keyCode||this._trapFullscreenTap(e)}},{key:"_trapFullscreenTap",value:function(e){if(b){var t,n=this._focusableControls.indexOf(e.target);e.shiftKey?0===n&&(t=this._focusableControls.length-1):n===this._focusableControls.length-1&&(t=0),void 0!==t&&(this._focusableControls[t].focus(),e.preventDefault())}}},{key:"_getFocusableControls",value:function(){var e=this.controlBar.children(),t=[];return e.forEach((function(e){var n=e.el();if(Ah(n))t.push(n);else if(n.children){var i=Array.from(n.children).find((function(e){return Ah(e)}));i&&t.push(i)}})),t}},{key:"aspectRatio",value:function(e){return void 0===e?this.aspectRatio_:(Ph("media-player: Aspect ratio ".concat(e," is not supported"),Rh.indexOf(e)>-1),this.aspectRatio_&&"auto"!==this.aspectRatio_&&this.removeClass(Lh(this.aspectRatio_)),"auto"!==e&&this.addClass(Lh(e)),this.aspectRatio_=e,e)}},{key:"resetPlaybackRate_",value:function(){var e=this.playbackRate();this.playbackRate(e)}},{key:"reset",value:function(){var e=this;this._isResetting=!0;var t=this.volume(),i=this.muted(),r=this.playbackRate();this.one("playerreset",(function(){e.volume(t),e.muted(i),e.defaultPlaybackRate(r),e._isResetting=!1})),f(u(n.prototype),"reset",this).call(this)}},{key:"isResetting",value:function(){return this._isResetting||!1}}]),n}(Oh);dl.registerComponent("Player",Dh);var Mh=dl.getComponent("Component"),Nh=dl.dom,Uh=function(e){o(n,e);var t=h(n);function n(e){var r;return i(this,n),(r=t.apply(this,arguments))._isShowing=!0,r.addClass("vjs-custom-captions-display"),r.hide(),r._hasPlayed=!1,r._showOnPlayed=!1,r.on(e,"playerreset",r._onPlayerReset),r.on(e,"playing",r._onPlaying),r}return a(n,[{key:"contentEl",value:function(){return this._cue}},{key:"hide",value:function(){this._isShowing&&(f(u(n.prototype),"hide",this).call(this),this._showOnPlayed=!1,this._isShowing=!1,this.trigger("hide"))}},{key:"show",value:function(){this._hasPlayed?f(u(n.prototype),"show",this).call(this):this._showOnPlayed=!0,this._isShowing||(this._isShowing=!0,this.trigger("show"))}},{key:"createEl",value:function(){return this._display=Nh.createEl("div",void 0,{class:"vjs-custom-captions-display"}),this._cue=Nh.createEl("div",void 0,{class:"vjs-custom-captions-cue",id:this.id()}),Nh.appendContent(this._display,this._cue)}},{key:"setText",value:function(e){Nh.textContent(this.contentEl(),e)}},{key:"_onPlaying",value:function(){this._hasPlayed=!0,this._showOnPlayed&&this.show()}},{key:"_onPlayerReset",value:function(){var e=this._isShowing;this.hide(),this._hasPlayed=!1,this._showOnPlayed=e}}]),n}(Mh);dl.registerComponent("CustomCaptionsDisplay",Uh);var Bh=dl.mergeOptions,Fh=dl.getComponent("Button"),jh={useCustomCaptions:!1,selected:!1},Hh=function(e){o(n,e);var t=h(n);function n(e,r){var a;if(i(this,n),(a=t.call(this,e,Bh({},jh,r)))._player=e,a._isActive=!1,a.options_.useCustomCaptions||a.hide(),a.controlText("Show Captions"),a.addClass("vjs-captions-toggle"),a._player.usingPlugin("userPreferences")&&(a._userPrefs=a._player.userPreferences(),a.one(a._player,"play",a._handlePlay),a.on(a._player,"playerreset",(function(){a.off(a._player,"off",a._handlePlay),a.one(a._player,"play",a._handlePlay)}))),a.options_.useCustomCaptions)a._player.ready((function(){var e=a._player.getChild("customCaptionsDisplay");a.on(e,"show",a.activate),a.on(e,"hide",a.deactivate)}));else{var s=a._player.textTracks();s&&(a.on(s,"addtrack",a._handleAddTrack),a.on(s,"removetrack",a._handleRemoveTrack))}return a}return a(n,[{key:"handleClick",value:function(){this._isActive?this.deactivate():this.activate(),this._userPrefs&&this._userPrefs.set("captions",this._isActive)}},{key:"activate",value:function(){this.options_.useCustomCaptions?this._player.getChild("customCaptionsDisplay").show():this._textTrack&&(this._textTrack.mode="showing"),this._player.usingPlugin("tracking")&&this._player.tracking().setIsCcVisible(!0),this.addClass("vjs-captions-active"),this.controlText("Hide Captions"),this._isActive=!0,this.trigger("activate")}},{key:"deactivate",value:function(){this._isActive&&(this.options_.useCustomCaptions?this._player.getChild("customCaptionsDisplay").hide():this._textTrack&&(this._textTrack.mode="hidden"),this._player.usingPlugin("tracking")&&this._player.tracking().setIsCcVisible(!1),this.removeClass("vjs-captions-active"),this.controlText("Show Captions"),this._isActive=!1,this.trigger("deactivate"))}},{key:"_handleAddTrack",value:function(e){e.track&&"captions"===e.track.kind&&(this._textTrack=e.track,this.show(),"showing"===this._textTrack.mode&&this.activate())}},{key:"_handleRemoveTrack",value:function(e){e.track&&"captions"===e.track.kind&&(this._textTrack=null,this.deactivate(),this.hide())}},{key:"_handlePlay",value:function(){this._userPrefs&&this._userPrefs.get("captions")&&this.activate()}}]),n}(Fh);function Vh(e,t,n){var i,r,a,s,o;function u(){var l=Date.now()-s;l<t&&l>=0?i=setTimeout(u,t-l):(i=null,n||(o=e.apply(a,r),a=r=null))}null==t&&(t=100);var l=function(){a=this,r=arguments,s=Date.now();var l=n&&!i;return i||(i=setTimeout(u,t)),l&&(o=e.apply(a,r),a=r=null),o};return l.clear=function(){i&&(clearTimeout(i),i=null)},l.flush=function(){i&&(o=e.apply(a,r),a=r=null,clearTimeout(i),i=null)},l}dl.registerComponent("CaptionsToggle",Hh),Vh.debounce=Vh;var qh=Vh,Wh=dl.getComponent("TextTrackMenuItem"),zh=dl.dom,Gh=function(e){o(n,e);var t=h(n);function n(){return i(this,n),t.apply(this,arguments)}return a(n,[{key:"createEl",value:function(e,t,i){var r=f(u(n.prototype),"createEl",this).call(this,e,t,i);if("subtitles"===this.options_.track.kind){this.options_.label="English (auto-generated)",r.removeChild(r.querySelector(".vjs-menu-item-text"));var a=zh.createEl("span",void 0,{class:"vjs-menu-item-text"});zh.textContent(a,this.localize(this.options_.label)),r.appendChild(a)}return r}}]),n}(Wh);dl.registerComponent("CaptionsMenuItem",Gh);var Kh=dl.getComponent("TextTrackButton"),Xh=dl.getComponent("OffTextTrackMenuItem"),Qh="vjs-captions-active",Yh=function(e){o(n,e);var t=h(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,n),(r=t.call(this,e,a))._player=e,r.controlText("Open Captions Menu"),r._isMenuOpen=!1,r._hasManuallyDisabled=!1,r.addClass("vjs-captions-menu-toggle"),a.id&&r.setAttribute("id",a.id);var s=e.textTracks();return r.sort=a.sort,r.selectedLanguage=a.selectedLanguage,r.reEnableCaptions=qh(r._reEnableCaptions,300,!0),r.on("captionMenuItemSelected",(function(e,t){var n=t.track;r.trigger("captionChange",n)})),r._player.usingPlugin("userPreferences")&&(r._userPrefs=r._player.userPreferences(),r.on(r._player,"playerreset",(function(){r.removeClass(Qh)}))),s&&r.on(s,"change",r._handleChangeTrack),r.on("dispose",r._onDispose),r.on(r._player,"loadedmetadata",r._handleLoadedMetaData),r}return a(n,[{key:"createItems",value:function(){var e=this,t=[];this.removeClass(Qh),(t=f(u(n.prototype),"createItems",this).call(this,t,Gh)).shift(),"function"==typeof this.sort?t.sort(this.sort):!1!==this.sort&&t.sort((function(e,t){var n=e.track.label.toLowerCase(),i=t.track.label.toLowerCase();return n<i?-1:i<n?1:0})),1===t.length&&"CC1"===t[0].track.label&&(t[0].el().textContent="CC");var i=new Xh(this.player_,{kinds:this.kinds_,kind:this.kind_,label:"Off"});return t.unshift(i),i.on(["tap","click"],this._offMenuItemSelected.bind(this)),t.forEach((function(t){var n=t.track;"showing"===n.mode&&"Off"!==n.label&&e.addClass(Qh),t.on(["tap","click"],(function(){e.trigger("captionMenuItemSelected",t)}))})),this._items=t,t}},{key:"handleClick",value:function(e){f(u(n.prototype),"handleClick",this).call(this,e),this._isMenuOpen=!this._isMenuOpen,this.controlText(this._isMenuOpen?"Close Captions Menu":"Open Captions Menu")}},{key:"_handleChangeTrack",value:function(){var e=this.items.find((function(e){return"showing"===e.track.mode})),t=!!e;if(!this._hasManuallyDisabled&&!t)return this.reEnableCaptions(),void(this._hasManuallyDisabled=!1);t?(this.addClass(Qh),this._activeTrack=e.track):(this.removeClass(Qh),this._activeTrack=void 0),this._player.usingPlugin("tracking")&&this._player.tracking().setIsCcVisible(t),this._userPrefs&&this._userPrefs.set("captionsLang",this._activeTrack?this._activeTrack.language:""),this._hasManuallyDisabled=!1}},{key:"_handleLoadedMetaData",value:function(){var e=this._player.textTracks(),t=this._userPrefs&&this._userPrefs.get("captionsLang"),n=this.selectedLanguage||t;if(e&&n)for(var i=0;i<e.length;i++){var r=e[i];r.language===n&&(r.mode="showing",this.trigger("captionChange",r))}}},{key:"_offMenuItemSelected",value:function(){this._hasManuallyDisabled=!0}},{key:"_onDispose",value:function(){this.reEnableCaptions.clear()}},{key:"_reEnableCaptions",value:function(){this._activeTrack&&(this._activeTrack.mode="showing",this.trigger("captionChange",this._activeTrack))}}]),n}(Kh);Yh.prototype.kinds_=["captions","subtitles"],dl.registerComponent("CaptionsMenuToggle",Yh);var $h=function(e){o(n,e);var t=h(n);function n(e,r){var a,s=r.disabled,o=void 0!==s&&s;return i(this,n),(a=t.apply(this,arguments)).controlText("Previous"),a.addClass("vjs-previous-button"),o&&a.disable(),a}return a(n,[{key:"handleClick",value:function(){this.trigger("previous")}}]),n}(dl.getComponent("Button"));dl.registerComponent("PreviousButton",$h);var Jh=function(e){o(n,e);var t=h(n);function n(e,r){var a,s=r.disabled,o=void 0!==s&&s;return i(this,n),(a=t.apply(this,arguments)).controlText("Next"),a.addClass("vjs-next-button"),o&&a.disable(),a}return a(n,[{key:"handleClick",value:function(){this.trigger("next")}}]),n}(dl.getComponent("Button"));dl.registerComponent("NextButton",Jh);var Zh=".vjs-play-control:not(.vjs-playing):not(.vjs-ended)",ep=".vjs-play-control.vjs-playing:not(.vjs-ended)",tp=".vjs-play-control.vjs-ended",np=".vjs-tech",ip=".vjs-poster",rp=".vjs-mute-control",ap=".vjs-fullscreen-control",sp=".vjs-captions-toggle.vjs-captions-active",op=".vjs-captions-toggle:not(.vjs-captions-active)",up=".vjs-subtitles-menu-item",lp=".vjs-captions-menu-item",cp=".vjs-menu-item",dp=".vjs-progress-holder",hp=".vjs-volume-control",pp=".vjs-back-to-start-button",fp=".vjs-big-play-button",mp="PLAY_CONTROL",gp="PAUSE_CONTROL",vp="REPLAY_CONTROL",yp="MUTE_CONTROL",_p="UNMUTE_CONTROL",bp="POSTER_CONTROL",Tp="MEDIA_CONTROL",kp="FULLSCREEN_CONTROL",Sp="UNFULLSCREEN_CONTROL",Ep="CAPTIONS_ON_CONTROL",Cp="CAPTIONS_OFF_CONTROL",wp="MENU_CAPTIONS_ON_CONTROL",Ip="MENU_CAPTIONS_OFF_CONTROL",Pp="PROGRESS_SCRUBBER_CONTROL",xp="VOLUME_SLIDER_CONTROL",Ap="BACK_TO_START_CONTROL",Op="PLAY_OVERLAY_CONTROL",Lp="SKIP_AHEAD_CONTROL",Rp="SKIP_BACK_CONTROL",Dp="THEATER_MODE_CONTROL",Mp="PLAYBACK_RATE_CONTROL",Np=dl.getComponent("Button"),Up=10,Bp=function(e){o(n,e);var t=h(n);function n(e,r){var a,s=r.duration,o=void 0===s?Up:s;return i(this,n),(a=t.apply(this,arguments))._player=e,a._duration=o,e.playerInteraction().registerControl(a.el(),Lp),a.controlText("Skip ahead"),a.addClass("vjs-skip-ahead-button"),a}return a(n,[{key:"handleClick",value:function(){var e=this._player.currentTime()+this._duration;e>this._player.duration()&&(e=this._player.duration()),this._player.currentTime(e),this.trigger("skipAhead")}}]),n}(Np);dl.registerComponent("SkipAheadButton",Bp);var Fp=dl.getComponent("Button"),jp=10,Hp=function(e){o(n,e);var t=h(n);function n(e,r){var a,s=r.duration,o=void 0===s?jp:s;return i(this,n),(a=t.apply(this,arguments))._player=e,a._duration=o,e.playerInteraction().registerControl(a.el(),Rp),a.controlText("Skip back"),a.addClass("vjs-skip-back-button"),a}return a(n,[{key:"handleClick",value:function(){var e=this._player.currentTime()-this._duration,t=e<0?0:e;this._player.currentTime(t),this.trigger("skipBack")}}]),n}(Fp);dl.registerComponent("SkipBackButton",Hp);var Vp=function(e){o(n,e);var t=h(n);function n(e){var r;return i(this,n),(r=t.apply(this,arguments))._player=e,r.controlText("Back to start"),r.addClass("vjs-back-to-start-button"),r}return a(n,[{key:"handleClick",value:function(){this._player.currentTime(0),this.trigger("backToStart")}}]),n}(dl.getComponent("Button"));dl.registerComponent("BackToStartButton",Vp);var qp=function(e){o(n,e);var t=h(n);function n(e){var r;return i(this,n),(r=t.apply(this,arguments))._player=e,r._player.playerInteraction().registerControl(r.el(),Dp),r.controlText("Theater mode"),r.addClass("vjs-theater-mode-button"),r.isTheaterModeEnabled=!1,r}return a(n,[{key:"handleClick",value:function(){this.isTheaterModeEnabled=!this.isTheaterModeEnabled,this.isTheaterModeEnabled?(this.addClass("vjs-theater-mode-button--enabled"),this.controlText("Theater mode default view"),this.trigger("activate")):(this.removeClass("vjs-theater-mode-button--enabled"),this.controlText("Theater mode"),this.trigger("deactivate"))}}]),n}(dl.getComponent("Button"));dl.registerComponent("TheaterModeButton",qp);var Wp=dl.getComponent("PlaybackRateMenuButton"),zp=dl.getComponent("PlaybackRateMenuItem"),Gp=dl.dom,Kp=function(e){o(n,e);var t=h(n);function n(){var e;return i(this,n),(e=t.apply(this,arguments)).player().playerInteraction().registerControl(e.getChild("PlaybackRateMenuButton").el(),Mp),e}return a(n,[{key:"createEl",value:function(){var e=f(u(n.prototype),"createEl",this).call(this);return this.labelEl_.setAttribute("aria-hidden",!0),e}},{key:"createItems",value:function(){var e=this,t=this.playbackRates(),n=[];return t&&t.forEach((function(t){var i=new zp(e.player(),{rate:"".concat(t,"x")}),r=Gp.createEl("span",{className:"vjs-icon-placeholder"});Gp.prependTo(r,i.el()),i.addClass("vjs-menu-item-checkable"),n.push(i)})),n}},{key:"handleClick",value:function(){this.buttonPressed_?this.unpressButton():this.pressButton()}}]),n}(Wp);dl.registerComponent("PlaybackRateMenuButton",Kp);var Xp=function(e){o(n,e);var t=h(n);function n(e){var r;return i(this,n),(r=t.apply(this,arguments)).addClass("vjs-poster-background"),r.setBackground(),r.on(e,"playerreset",r._playerReset),r.on(e,"posterchange",r.setBackground),r}return a(n,[{key:"setBackground",value:function(){var e=this.player().poster();e&&(this.el().style.backgroundImage="url(".concat(e,")"))}},{key:"_playerReset",value:function(){this.el().style.backgroundImage="none"}}]),n}(dl.getComponent("Component"));dl.registerComponent("PosterBackground",Xp);var Qp=dl.getComponent("Component"),Yp=dl.dom,$p="LEFT",Jp="RIGHT",Zp={LEFT:"vjs-tooltip-left",RIGHT:"vjs-tooltip-right"},ef=function(e){o(n,e);var t=h(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=a.control,o=a.text;return i(this,n),Ph("tooltip: must be pased a control",s),(r=t.apply(this,arguments)).player=e,r._control=s,r._titleText=r._control.el().getAttribute("title"),r.setText(o),r.on(s,"focus",r._onFocus),r.on(s,"focusout",r._onFocusout),r.on(s,"keydown",r._onKeydown),r.on(s,"mouseenter",r._onMouseenter),r.on(s,"mouseleave",r._onMouseleave),r.on(r.player,"fullscreenchange",r._exitFullscreen),r.on(r._tooltipContainer,"click",(function(e){e.target.classList.contains("vjs-tooltip-container")&&(e.preventDefault(),e.stopPropagation())})),r}return a(n,[{key:"createEl",value:function(){var e=Zp[this.options_.side]||"";return this._tooltip=f(u(n.prototype),"createEl",this).call(this,"div",{className:"vjs-tooltip"},{"aria-hidden":"true",role:"tooltip"}),this._tooltipContainer=f(u(n.prototype),"createEl",this).call(this,"div",{className:"vjs-tooltip-container ".concat(e)}),this._tooltipContainer.appendChild(this._tooltip),this._tooltipContainer}},{key:"show",value:function(){this._isShowing||(this.addClass("vjs-tooltip-active"),this._control.el().removeAttribute("title"),this._isShowing=!0)}},{key:"hide",value:function(){this._isShowing&&(this.removeClass("vjs-tooltip-active"),this._control.el().setAttribute("title",this._titleText),this._isShowing=!1)}},{key:"setText",value:function(e){var t=this.player.localize(e);Yp.textContent(this._tooltip,t)}},{key:"_onKeydown",value:function(e){"Escape"!==e.key&&"Esc"!==e.key||!this._isShowing||this.hide()}},{key:"_exitFullscreen",value:function(){this._isShowing&&this.hide()}},{key:"_onFocus",value:function(){this.show()}},{key:"_onFocusout",value:function(){this.hide()}},{key:"_onMouseenter",value:function(){this.show()}},{key:"_onMouseleave",value:function(){this.hide()}}]),n}(Qp);ef.prototype.options_={name:"ControlTooltip"},dl.registerComponent("ControlTooltip",ef);var tf=function(e){o(n,e);var t=h(n);function n(){return i(this,n),t.apply(this,arguments)}return a(n,[{key:"handleClick",value:function(){var e=this;f(u(n.prototype),"handleClick",this).apply(this,arguments),this.player().one("fullscreenchange",(function(){e.el().focus()}))}}]),n}(dl.getComponent("FullscreenToggle"));dl.registerComponent("FullscreenToggle",tf);var nf=function(e){o(n,e);var t=h(n);function n(e,r){var a;return i(this,n),a=t.call(this,e,r),e.ready((function(){r.inline?e.controlBar.addClass("vjs-control-bar--inline"):e.controlBar.addClass("vjs-control-bar--tier")})),a}return a(n)}(dl.getComponent("ProgressControl"));dl.registerComponent("ProgressControl",nf);var rf=dl.getComponent("Menu"),af=dl.dom,sf=function(e){o(n,e);var t=h(n);function n(){var e;return i(this,n),(e=t.apply(this,arguments))._selectedSubMenuItem=null,e.on("focusout",e._onFocusout),e}return a(n,[{key:"createEl",value:function(){var e=f(u(n.prototype),"createEl",this).apply(this,arguments);return af.addClass(e,"vjs-settings-menu"),this._subMenus=af.createEl("div",{className:"vjs-settings-menu-sub-menus"}),e.appendChild(this._subMenus),e}},{key:"addItem",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.index;this.addChild(e,void 0,i);var r=e.getMenu();r&&(this._subMenus.appendChild(r.el()),this.on(e,"select",(function(){return t._onSelectSubMenu(e)})),this.on(e,"deselect",(function(){return t._onDeselectSubMenu(e)})))}},{key:"_onFocusout",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.relatedTarget;!this.menuButton_||this.el().contains(t)||this.menuButton_.el().contains(t)||(this.menuButton_.unpressButton(),this._selectedSubMenuItem&&this._selectedSubMenuItem.selected(!1))}},{key:"_onSelectSubMenu",value:function(e){var t=e.getMenu();t&&(t.focus(),this.addClass("vjs-settings-menu-sub-menu-active"),this._selectedSubMenuItem=e)}},{key:"_onDeselectSubMenu",value:function(e){e.getMenu()&&(this.removeClass("vjs-settings-menu-sub-menu-active"),this.hasClass("vjs-lock-showing")&&e.focus(),this._selectedSubMenuItem=null)}}]),n}(rf);dl.registerComponent("SettingsMenu",sf);var of=dl.getComponent("MenuItem"),uf=dl.dom,lf=dl.mergeOptions,cf={selectable:!0,valueText:void 0},df=function(e){o(n,e);var t=h(n);function n(e,r){return i(this,n),t.call(this,e,lf({},cf,r))}return a(n,[{key:"createMenu",value:function(){}},{key:"getMenu",value:function(){return this._menu}},{key:"createEl",value:function(){var e=this,t=f(u(n.prototype),"createEl",this).apply(this,arguments),i=this.options_,r=i.valueText,a=i.icon;if(uf.addClass(t,"vjs-settings-menu-item"),this._menu=this.createMenu(),this._value=uf.createEl("div",{className:"vjs-settings-menu-item-value"}),r&&this.setValueText(r),t.appendChild(this._value),a&&uf.prependTo(uf.createEl("span",{className:"vjs-icon-placeholder"}),t),this._menu){var s=new n(this.player(),{label:this.options_.label,icon:!0,selectable:!1});s.addClass("vjs-settings-menu-item-header"),s.on(["tap","click"],(function(){e.selected(!1)})),this._menu.addChild(s,void 0,0),uf.addClass(t,"vjs-settings-menu-item-expandable"),t.appendChild(uf.createEl("span",{className:"vjs-icon-placeholder"})),t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded","false")}return t}},{key:"setValueText",value:function(e){e&&uf.textContent(this._value,this.localize(e))}},{key:"selected",value:function(e){f(u(n.prototype),"selected",this).apply(this,arguments),this.selectable&&(e?this._select():this._deselect())}},{key:"handleClick",value:function(){f(u(n.prototype),"handleClick",this).apply(this,arguments),this.trigger("clicked")}},{key:"_select",value:function(){this._menu&&(this._menu.addClass("vjs-settings-menu-item-active"),this.el().setAttribute("aria-expanded","true")),this.trigger("select")}},{key:"_deselect",value:function(){this._menu&&(this._menu.removeClass("vjs-settings-menu-item-active"),this.el().setAttribute("aria-expanded","false")),this.trigger("deselect")}}]),n}(of);function hf(e){return!!e||!1===e||0===e}dl.registerComponent("SettingsMenuItem",df);var pf=dl.mergeOptions,ff=dl.getComponent("SettingsMenuItem"),mf=dl.getComponent("Toggle"),gf={multiselectable:!0,selected:!0},vf=function(e){o(n,e);var t=h(n);function n(e,r){var a;i(this,n);var s=(a=t.call(this,e,pf({},gf,r))).options_,o=s.userPrefsKey,u=s.enableUserPrefs,l=s.className;return a.addClass("vjs-settings-toggle-menu-item"),l&&a.addClass(l),u&&e.usingPlugin("userPreferences")&&(a._userPrefs=e.userPreferences(),a._userPrefsKey=o,e.ready((function(){var e=a._userPrefs.get(o);hf(e)&&a.selected(e)}))),a}return a(n,[{key:"createEl",value:function(){var e=f(u(n.prototype),"createEl",this).apply(this,arguments);return this._toggle=this._createToggle(),e.appendChild(this._toggle.el()),e}},{key:"handleClick",value:function(){this.selected(!this.isSelected_),this._userPrefs&&this._userPrefs.set(this._userPrefsKey,this.isSelected_)}},{key:"selected",value:function(e){return hf(e)&&e!==this._lastSelected&&(f(u(n.prototype),"selected",this).apply(this,arguments),e?(this.setValueText("On"),this._toggle.check()):(this.setValueText("Off"),this._toggle.uncheck()),this._lastSelected=e),this.isSelected_}},{key:"_createToggle",value:function(){var e=new mf(this.player(),{readonly:!0});return e.el().setAttribute("aria-hidden","true"),e}}]),n}(ff);dl.registerComponent("SettingsToggleMenuItem",vf);var yf=dl.getComponent("SettingsMenu"),_f=function(e){o(n,e);var t=h(n);function n(){var e;return i(this,n),(e=t.apply(this,arguments)).addClass("vjs-settings-menu-button"),e}return a(n,[{key:"createMenu",value:function(){var e=new yf(this.player(),{menuButton:this});return this.hideThreshold_=0,this.items||(this.items=this.createItems()),this.items.forEach((function(t){e.addItem(t)})),e}},{key:"createItems",value:function(){var e,t=this,n=this.options_&&this.options_.items||[];return Array.isArray(n)?(e=n,n={}):e=Object.keys(n),e.map((function(e){var i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.charAt(0).toUpperCase()+e.slice(1)}(e),r=dl.getComponent(i);Ph("settings-menu: Component ".concat(i," must exist"),r);var a=new r(t.player(),n[e]||{});return a.addClass("vjs-settings-menu-button-item"),a}))}}]),n}(dl.getComponent("MenuButton"));_f.prototype.controlText_="Settings",dl.registerComponent("SettingsMenuButton",_f);var bf=dl.mergeOptions,Tf=dl.getComponent("SettingsToggleMenuItem"),kf=function(e){o(n,e);var t=h(n);function n(){return i(this,n),t.apply(this,arguments)}return a(n)}(Tf);kf.prototype.options_=bf(Tf.prototype.options_,{label:"Autoplay",name:"AutoplaySetting",enableUserPrefs:!0,userPrefsKey:"autoplay",className:"vjs-autoplay-setting"}),dl.registerComponent("AutoplaySetting",kf);var Sf=dl.mergeOptions,Ef=dl.getComponent("SettingsToggleMenuItem"),Cf=function(e){o(n,e);var t=h(n);function n(){return i(this,n),t.apply(this,arguments)}return a(n)}(Ef);Cf.prototype.options_=Sf(Ef.prototype.options_,{label:"Auto-advance",name:"AutoAdvanceSetting",enableUserPrefs:!0,userPrefsKey:"auto-advance",className:"vjs-auto-advance-setting"}),dl.registerComponent("AutoAdvanceSetting",Cf);var wf=dl.mergeOptions,If=dl.getComponent("SettingsMenu"),Pf=dl.getComponent("SettingsMenuItem"),xf={multiselectable:!1,selected:!1},Af="quality-adapt",Of="quality-prog";function Lf(e){return"auto"===e?"Auto":"".concat(e,"p")}var Rf=function(e){o(n,e);var t=h(n);function n(e,r){var a;return i(this,n),a=t.call(this,e,wf({},xf,r)),Ph("quality-setting: The qualityLevels plugin is required",e.hasPlugin("qualityLevels")),a.addClass("vjs-quality-setting"),a._qualityLevels=e.qualityLevels(),a._items=[],a._qualities=[],a._selectedHeight=null,e.usingPlugin("userPreferences")&&(a._userPrefs=e.userPreferences(),a._userPrefsKey=a.options_.userPrefsKey),a.on(a._qualityLevels,"addqualitylevel",a._onAddQualityLevel),a.on(a._qualityLevels,"removequalitylevel",a._onRemoveQualityLevel),a.on(a.player_,"sourceset",a._onSourceSet),a.on(a.player_,"loadedmetadata",a._onLoadedMetadata),a.on(a.player_,"playerreset",a._onPlayerReset),a}return a(n,[{key:"createMenu",value:function(){var e=new If(this.player_);return e.addClass("vjs-quality-setting-sub-menu"),e}},{key:"_onSourceSet",value:function(){this._isAdaptive()&&this._onAddQualityLevel({qualityLevel:{height:"auto"}})}},{key:"_onLoadedMetadata",value:function(){this._qualityLevels.length?this.enable():this.disable();var e=this._userPrefs&&this._userPrefs.get(this._getUserPrefKey()),t=this._items[e]&&e;if(!t)if(this._isAdaptive())t="auto";else{var n=this._qualityLevels,i=n[n.selectedIndex];t=i&&i.height}var r=this._items[t];r&&r.selected(!0)}},{key:"_onPlayerReset",value:function(){var e=this;this._qualities.forEach((function(t){e._removeQualityLevelMenuItem({height:t})})),this._qualities=[],this._selectedHeight=null}},{key:"_onAddQualityLevel",value:function(e){var t=e.qualityLevel,n=t.height;n&&-1===this._qualities.indexOf(n)&&(this._qualities.push(n),this._qualities.sort((function(e,t){return e-t})),this._addQualityLevelMenuItem(t))}},{key:"_onRemoveQualityLevel",value:function(e){var t=e.qualityLevel,n=t.height,i=n?this._qualities.indexOf(n):null;n&&i>-1&&(this._qualities.splice(i,1),this._removeQualityLevelMenuItem(t))}},{key:"_addQualityLevelMenuItem",value:function(e){var t=this,n=e.height,i=new Pf(this.player_,{icon:!0,label:Lf(n),selected:!1});this.on(i,"select",(function(){t.trigger("change",e),t._onSelectQuality(e)})),this.on(i,"clicked",(function(){t._userPrefs&&t._selectedHeight&&t._userPrefs.set(t._getUserPrefKey(),t._selectedHeight)})),i.addClass("vjs-quality-setting-level"),i.addClass("vjs-menu-item-checkable"),this._items[n]=i;var r=this._qualities.indexOf(n);this._menu.addItem(i,{index:r>-1?r+1:void 0})}},{key:"_removeQualityLevelMenuItem",value:function(e){var t=e.height,n=this._items[t];this._menu.removeChild(n),n.dispose(),delete this._items[t]}},{key:"_onSelectQuality",value:function(e){var t=e.height;if(this._selectedHeight!==t){var n=this._qualityLevels,i=this._items[this._selectedHeight];if(i&&i.selected(!1),this._isAdaptive())for(var r=0;r<n.length;r++){var a=n[r];a.enabled=a.height===t||"auto"===t}else{var s=n.levels_.findIndex((function(e){return e.height===t}));n.selectedIndex_=s,n.trigger({type:"change",selectedIndex:s})}this.setValueText(Lf(t)),this._selectedHeight=t,this.selected(!1)}}},{key:"_isAdaptive",value:function(){return!!this.player_.tech({IWillNotUseThisInPlugins:!0}).vhs}},{key:"_getUserPrefKey",value:function(){var e=this._userPrefsKey;return e||(e=this._isAdaptive()?Af:Of),e}}]),n}(Pf);Rf.prototype.options_=wf(Pf.prototype.options_,{label:"Quality",name:"QualitySetting"}),dl.registerComponent("QualitySetting",Rf);var Df=function(e){o(n,e);var t=h(n);function n(){return i(this,n),t.apply(this,arguments)}return a(n,[{key:"createEl",value:function(){return f(u(n.prototype),"createEl",this).call(this,"div",{className:"vjs-time-display vjs-control"},{translate:"no"})}}]),n}(dl.getComponent("Component"));Df.prototype.options_={name:"TimeDisplay",children:["currentTimeDisplay","timeDivider","durationDisplay"]},dl.registerComponent("TimeDisplay",Df);var Mf=dl.getComponent("Component"),Nf=dl.dom,Uf=function(e){o(n,e);var t=h(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=a.id,o=a.hideOnInactivity,u=void 0===o||o,l=a.hideBeforeStart,c=void 0===l||l;return i(this,n),(r=t.apply(this,arguments)).addClass("vjs-player-banner"),u&&r.addClass("vjs-hide-on-inactivity"),c&&r.addClass("vjs-hide-before-start"),s&&r.contentEl().setAttribute("id",s),r}return a(n,[{key:"fillWith",value:function(e){Nf.insertContent(this.contentEl(),e)}}]),n}(Mf);function Bf(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];e&&"function"==typeof e[t]&&e[t].apply(e,g(n))}function Ff(e,t){Ph("throttle requires a wait time",t&&!Number.isNaN(t));var n=window.performance.now();return function(){var i=window.performance.now();i-n>=t&&(e.apply(void 0,arguments),n=i)}}dl.registerComponent("PlayerBanner",Uf);var jf="MediaInitializationStartEvent",Hf="MediaInitializationEndEvent",Vf="MediaBufferingStartEvent",qf="MediaBufferingEndEvent",Wf="MediaPlaybackErrorV2Event",zf="MediaBitrateChangedEvent",Gf="MediaRenderedEvent",Kf="CAPTION",Xf="CUSTOM",Qf="ABORTED",Yf="NETWORK",$f="DECODING",Jf="SOURCE_FILE",Zf="ENCRYPTION",em="INIT",tm="SEEK",nm={EDGECAST:"ecst",AKAMAI:"akam"},im="STREAMING",rm="PROGRESSIVE",am="HLS",sm="VIDEO",om="HTML5",um={FREE:"FREE",PAID:"PAID",ENTERPRISE:"ENTERPRISE",GUEST:"GUEST"},lm=Object.keys(nm).map((function(e){return nm[e]})),cm=["ads","assessments","career_video","learning","linkedin","live_video","messaging","slideshare","stories","ugc.aws","ugc.inhouse","ugc"],dm={IS_LIVE:"IS_LIVE",WAS_LIVE:"WAS_LIVE",PRE_RECORDED:"PRE_RECORDED"},hm=Object.assign||function(e,t){return Object.keys(t).forEach((function(n){e[n]=t[n]})),e};function pm(){return window.performance&&window.performance.timing&&"function"==typeof window.performance.now?Math.round(window.performance.now())+(window.performance.timing.navigationStart||1):(new Date).getTime()}var fm=function(){function e(){i(this,e),this._bufferingRanges={},this.mediaHeader={},this.mediaLiveState=null,this.mediaTrackingObject={objectUrn:""}}return a(e,[{key:"_buildInitializationBeacon",value:function(e){var t={mobileHeader:null,mediaHeader:this.mediaHeader,mediaTrackingObject:this.mediaTrackingObject,initializationStartTime:this._initializationStartTs};return e||(t.duration=this._initializationEndTs-this._initializationStartTs,t.mediaLiveState=this.mediaLiveState),{eventName:e?jf:Hf,eventBody:t}}},{key:"_buildBufferingEventBeacon",value:function(e,t){var n=this._bufferingRanges[e],i={mobileHeader:null,mediaHeader:this.mediaHeader,mediaTrackingObject:this.mediaTrackingObject,mediaLiveState:this.mediaLiveState,bufferingType:n.type,initializationStartTime:this._initializationStartTs,bufferingStartTime:n.start};return t||(i.duration=n.end-n.start,delete this._bufferingRanges[e]),{eventName:t?Vf:qf,eventBody:i}}},{key:"_buildMediaPlaybackErrorEventBeacon",value:function(e,t,n){var i={mobileHeader:null,mediaHeader:this.mediaHeader,mediaTrackingObject:this.mediaTrackingObject,mediaLiveState:this.mediaLiveState,errorType:e};return"string"==typeof t&&(i.errorMessage=t),"string"==typeof n&&""!==n&&(i.url=n),{eventName:Wf,eventBody:i}}},{key:"_buildMediaBitrateChangedEventBeacon",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{eventName:zf,eventBody:hm({mobileHeader:null,mediaHeader:this.mediaHeader,mediaTrackingObject:this.mediaTrackingObject,mediaLiveState:this.mediaLiveState},e)}}},{key:"_buildMediaRenderedEvent",value:function(e){return this._ensureInitCalled(),{eventName:Gf,eventBody:{mobileHeader:null,mediaHeader:this.mediaHeader,mediaLiveState:this.mediaLiveState,mediaTrackingObject:this.mediaTrackingObject,perceivedTimeToFirstFrameDuration:e}}}},{key:"_ensureInitCalled",value:function(){if("number"!=typeof this._initializationStartTs)throw new Error("initializationStart not called")}},{key:"_throwErrorIfBufferingEventInvalid",value:function(e,t){if(this._ensureInitCalled(),"number"!=typeof e)throw new TypeError("bufferingId not a number");if(t){if("object"===n(this._bufferingRanges[e]))throw new Error("duplicate bufferingId")}else if("object"!==n(this._bufferingRanges[e])||void 0!==this._bufferingRanges[e].end)throw new Error("incorrect bufferingId or wrong buffering type")}},{key:"setTrackingId",value:function(e){this.mediaTrackingObject.trackingId=e}},{key:"setObjectUrn",value:function(e){this.mediaTrackingObject.objectUrn=e}},{key:"setMediaHeader",value:function(e){this.mediaHeader=e}},{key:"setMediaLiveState",value:function(e){Ph("rum-video-tracking: Must provide a valid mediaLiveState",dm[e]),this.mediaLiveState=e}},{key:"initializationStart",value:function(){return this._initializationStartTs=pm(),this._buildInitializationBeacon(!0)}},{key:"initializationEnd",value:function(){return this._ensureInitCalled(),this._initializationEndTs=pm(),this._buildInitializationBeacon(!1)}},{key:"mediaRenderStart",value:function(){this._renderStart=pm()}},{key:"mediaRenderEnd",value:function(){if(!this._renderStart)throw new Error("mediaRenderStart not called before mediaRenderEnd");return this._buildMediaRenderedEvent(pm()-this._renderStart)}},{key:"bufferingStart",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.type,i=void 0===n?null:n,r=!0;return this._throwErrorIfBufferingEventInvalid(e,r),this._bufferingRanges[e]={start:pm(),type:i},this._buildBufferingEventBeacon(e,r)}},{key:"bufferingEnd",value:function(e){return this._throwErrorIfBufferingEventInvalid(e,!1),this._bufferingRanges[e].end=pm(),this._buildBufferingEventBeacon(e,!1)}},{key:"mediaPlaybackError",value:function(e,t,n){var i=n;if("string"==typeof i&&""!==i){var r=i.match("^[^?]+");i=m(r,1)[0]}return this._buildMediaPlaybackErrorEventBeacon(e,t,i)}},{key:"bitrateChangedEvent",value:function(e){return this._buildMediaBitrateChangedEventBeacon(e)}}]),e}();function mm(e,t){return fetch(t,{method:"HEAD"}).then((function(t){var n=t.headers;e.cdnProvider=n.get("x-cdn")}))}function gm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.cdnProvider,i=t.accountAccessType,r=t.mediaSource,a=t.contextTrackingId,s=t.fetchCDN,o=void 0!==s&&s;n&&Ph("media-player: rum: cdnProvider must be a valid param",lm.includes(n)),i&&Ph("media-player: rum: accountAccessType must be a valid param",um[i]),r&&xh("media-player: rum: mediaSource must be a valid param",cm.includes(r));var u=!!e.tech({IWillNotUseThisInPlugins:!0}).vhs,l={deliveryMode:u?im:rm,playerType:om,mediaType:sm,cdnProvider:n};return o&&mm(l,e.currentSource().src),i&&(l.accountAccessType=i),r&&(l.mediaSource=r),a&&(l.contextTrackingId=a),u&&(l.streamProtocol=am),l}function vm(e,t){return"live_video"!==e?dm.PRE_RECORDED:t.duration()===1/0?dm.IS_LIVE:dm.WAS_LIVE}var ym={0:Xf,1:Qf,2:Yf,3:$f,4:Jf,5:Zf},_m=function(e){o(n,e);var t=h(n);function n(e,r){var a,s=r.mediaUrn,o=r.trackingId,u=r.mediaHeader,l=r.onTrack,c=r.resetMediaRenderStartOnPause,d=void 0!==c&&c;i(this,n),(a=t.apply(this,arguments))._bufferId=0,a._resetMediaRenderStartOnPause=d,a.setState({mediaUrn:s,trackingId:o,mediaHeader:u,onTrack:l}),a.on(e,"sourceset",a._onSourceset),a.on(e,"loadstart",a._onLoadStart),a.on(e,"loadedmetadata",a._onLoadedMetadata),a.on(e,"loadeddata",a._onLoadedData),a.on(e,"play",a._onPlay),a.on(e,"playing",a._onPlaying),a.on(e,"pause",a._onPause),a.on(e,"waiting",a._onWaiting),a.on(e,"error",a._onError),a.on(e,"dispose",a._onDispose),a.on(e,"playerreset",a._onPlayerReset),a.on(e,"autoplay-failure",a._onAutoplayFailure);var h=a.player.textTracks();return h&&a.on(h,"addtrack",a._onAddTrack),e.ready((function(){a.player.usingPlugin("playlist")&&a.on(e.playlist(),"itemchange",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.plugins,i=void 0===n?{}:n;Ph("rum must be updated on playlist item change",i.rum)}))})),a}return a(n,[{key:"handleStateChanged",value:function(e){var t=e.changes;if(t.mediaUrn||t.trackingId){var n=this.state.mediaUrn,i=t.trackingId;Ph("rum: mediaUrn is required when updating trackingId",n),i&&i.from!==i.to&&this.player.generateTrackingId().setTrackingId(i.to),this.tracker=new fm,this.tracker.setObjectUrn(n),this.tracker.setTrackingId(this.player.generateTrackingId().getTrackingId())}}},{key:"getEventHash",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e}},{key:"_setInitializationStart",value:function(){this._isInitializationStarted||(this.tracker.setMediaHeader(gm(this.player,this.state.mediaHeader)),this._trigger(this.tracker.initializationStart()),this._isInitializationStarted=!0)}},{key:"_setInitializationEnd",value:function(){this._isInitializationEnded||(this._trigger(this.tracker.initializationEnd()),this._isInitializationEnded=!0)}},{key:"_setMediaRenderStart",value:function(){this._isMediaRenderStarted||(this.tracker.mediaRenderStart(),this._isMediaRenderStarted=!0)}},{key:"_setMediaRenderEnd",value:function(){this._isMediaRenderEnded||(this._trigger(this.tracker.mediaRenderEnd()),this._isMediaRenderEnded=!0)}},{key:"_setBufferingStart",value:function(){if(!this._isBuffering){this._isBuffering=!0,this._bufferId++;var e=null;this.player.seeking()?e=tm:this._hasPlayed||(e=em),this._trigger(this.tracker.bufferingStart(this._bufferId,{type:e}))}}},{key:"_setBufferingEnd",value:function(){this._isBuffering&&(this._trigger(this.tracker.bufferingEnd(this._bufferId)),this._isBuffering=!1)}},{key:"_onSourceset",value:function(){this._reset()}},{key:"_onLoadStart",value:function(){"none"!==this.player.preload()&&this._setInitializationStart()}},{key:"_onLoadedMetadata",value:function(){var e=this.state.mediaHeader,t=(e=void 0===e?{}:e).mediaSource;this.tracker.setMediaLiveState(vm(t,this.player)),this._metadataTrack=this.player.textTracks().tracks_.find((function(e){return"segment-metadata"===e.label})),this._metadataTrack&&this.on(this._metadataTrack,"cuechange",this._onBitrateChange)}},{key:"_onLoadedData",value:function(){this._setInitializationStart(),this._setInitializationEnd()}},{key:"_onPlay",value:function(){this._setInitializationStart(),this._setMediaRenderStart()}},{key:"_onPause",value:function(){this._setBufferingEnd(),this._resetMediaRenderStartOnPause&&this._isMediaRenderStarted&&!this._isMediaRenderEnded&&(this._isMediaRenderStarted=!1)}},{key:"_onAutoplayFailure",value:function(){this._setBufferingEnd()}},{key:"_onPlaying",value:function(){this._hasPlayed=!0,this._setBufferingEnd(),this._setMediaRenderEnd()}},{key:"_onWaiting",value:function(){this._setBufferingStart()}},{key:"_onBitrateChange",value:function(){var e=this._metadataTrack.activeCues[0],t=e&&e.value;if(t&&t.playlist!==this._lastCuePlaylist){var n=Math.floor(1e3*(t.end-t.start)),i=m(t.codecs?t.codecs.split(",").map((function(e){return e.trim()})):[],2),r=i[0],a=i[1];this._trigger(this.tracker.bitrateChangedEvent({newBitrate:t.bandwidth,viewingDisplaySize:{width:this.player.currentWidth(),height:this.player.currentHeight()},encodedDisplaySize:t.resolution,audioCodec:a,videoCodec:r,newSegmentDuration:n,targetSegmentDuration:6e3,frameRate:60})),this._lastCuePlaylist=t.playlist}}},{key:"_onError",value:function(){this._setBufferingEnd();var e=this.player.error(),t=this.player.currentSrc(),n=this.tracker.mediaPlaybackError(ym[e.code],e.message,t);this._trigger(n)}},{key:"_onAddTrack",value:function(e){var t=e.track;t&&"captions"===t.kind&&this.one(t,"loadeddata",this._onCaptionsLoad)}},{key:"_onCaptionsLoad",value:function(){var e=this.player.log.history().find((function(e){var t=m(e,3)[2];return t&&"ParsingError"===t.name}));if(e){var t=[].find.call(this.player.textTracks(),(function(e){return"captions"===e.kind})),n=this.tracker.mediaPlaybackError(Kf,e[2].message,t.src);this._trigger(n)}}},{key:"_onPlayerReset",value:function(){this._reset()}},{key:"_onDispose",value:function(){this._reset()}},{key:"_trigger",value:function(e){var t=e.eventBody,n=e.eventName;this.trigger(n,t),this.trigger("track",{eventName:n,eventData:t}),Bf(this.state,"onTrack",[n,t])}},{key:"_reset",value:function(){this._setBufferingEnd(),this._isInitializationStarted=!1,this._isInitializationEnded=!1,this._isBuffering=!1,this._isMediaRenderStarted=!1,this._isMediaRenderEnded=!1,this._hasPlayed=!1,this._metadataTrack&&(this.off(this._metadataTrack,"cuechange",this._onBitrateChange),this._metadataTrack=null)}}]),n}(dl.getPlugin("plugin"));dl.registerPlugin("rum",_m);var bm=dl.getPlugin("plugin"),Tm={viewQuartile:.25,viewMidpoint:.5,viewThirdQuartile:.75,viewCompletion:.97},km=Object.keys(Tm),Sm=function(e){o(n,e);var t=h(n);function n(e,r){var a,s=r.pageContext,o=r.onTrack;return i(this,n),a=t.apply(this,arguments),Ph("moat: pageContext is required field which must be a value referring to SponsoredVideoViewEvent.pageContext",s),a.setState({pageContext:s,onTrack:o}),a._setInitialState(),a.on(e,"ended",a._onEnded),a.on(e,"playing",a._onPlaying),a.on(e,"pause",a._onPause),a.on(e,"loadedmetadata",a._onLoadedMetadata),a.on(e,"timeupdate",a._onTimeUpdate),a.on(e,"playerreset",a._onPlayerreset),a.on(e.playerInteraction(),"interact",a._onInteract),a}return a(n,[{key:"getEventHash",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e}},{key:"_setInitialState",value:function(){hm(this,{_elapsedPlaybackTime:0,_currentTime:0,_previousTime:0,_hasFiredViewVideo:!1,_hasFiredViewPlayStart:!1})}},{key:"_onInteract",value:function(e,t){var n,i,r=t.controlId,a=t.meta;switch(r){case Tp:n=this.player.paused()?"pauseVideo":"playVideo",i="video_play_pause";break;case bp:case Op:n="playVideo",i="video_thumbnail_play";break;case mp:n="playVideo",i="video_toolbar_play_pause";break;case gp:n="pauseVideo",i="video_toolbar_play_pause";break;case kp:n="fullscreenVideo",i="video_toolbar_fullscreen_toggle";break;case Sp:n="unfullscreenVideo",i="video_toolbar_fullscreen_toggle";break;case Pp:n="seekVideo",i="video_toolbar_scrubber";break;case vp:n="replayVideo",i="video_toolbar_replay"}n&&i&&this.fireVideoActionEvent(n,i,a)}},{key:"_didSeekOccur",value:function(){return Math.abs(this._currentTime-this._previousTime)>2}},{key:"_maybeFireViewVideoEvent",value:function(){var e=this;this._hasFiredViewVideo||this._elapsedPlaybackTime>2&&this.fireVideoViewEvent("viewVideo",(function(){e._hasFiredViewVideo=!0,e._elapsedPlaybackTime=0}))}},{key:"_trigger",value:function(e,t,n){this.trigger(e,hm(t,n)),this.trigger("track",{eventName:e,eventData:t,meta:n}),Bf(this.state,"onTrack",[e,t,n])}},{key:"_onEnded",value:function(){this.fireVideoViewEvent("viewFullCompletion")}},{key:"_onPause",value:function(){this.resetElapsedPlaybackTime()}},{key:"_onPlaying",value:function(){var e=this;this._hasFiredViewPlayStart||this.fireVideoViewEvent("viewPlayStart",(function(){e._hasFiredViewPlayStart=!0}))}},{key:"_onLoadedMetadata",value:function(){this.computeThresholds()}},{key:"_onTimeUpdate",value:function(){this.updateCurrentPlayerPosition()}},{key:"_onPlayerreset",value:function(){this._setInitialState()}},{key:"computeThresholds",value:function(){var e=1e3*this.player.duration();this._thresholds=km.reduce((function(t,n){var i=Tm[n];return t[n]=Math.floor(i*e),t}),{})}},{key:"fireElapsedThresholdEvents",value:function(){var e=this;if(this._thresholds){var t=Math.floor(1e3*this._previousTime),n=Math.floor(1e3*this._currentTime);km.forEach((function(i){var r=e._thresholds[i];t<r&&n>=r&&e.fireVideoViewEvent(i)}))}}},{key:"fireVideoViewEvent",value:function(e,t){var n=!this.player.muted()&&this.player.volume()>0,i=this.player.duration();if(i){var r={videoDuration:1e3*i,isVideoAudible:n,videoUIContext:this.state.pageContext,timestamp:Date.now()};this._trigger("viewEvent",{eventName:e,trackingParams:r}),"function"==typeof t&&t()}}},{key:"fireVideoActionEvent",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._trigger("actionEvent",{actionName:e,controlName:t,timestamp:Date.now()},n)}},{key:"updateCurrentPlayerPosition",value:function(){this._previousTime=this._currentTime||0,this._currentTime=this.player.currentTime()||0,this._didSeekOccur()?this.resetElapsedPlaybackTime():(this._elapsedPlaybackTime+=this._currentTime-this._previousTime,this._maybeFireViewVideoEvent(),this.fireElapsedThresholdEvents())}},{key:"resetElapsedPlaybackTime",value:function(){this._elapsedPlaybackTime=0}}]),n}(bm);dl.registerPlugin("moat",Sm);var Em="PlayerAskToPlayEvent",Cm="PlayerBeaconEvent",wm="PlayerPlayPauseEvent",Im="PlayerPlaybackExitEvent",Pm="PlayerPlaybackStallEvent",xm="PlayerSeekEvent",Am="PlayerVolumeChangedEvent",Om={AUTOPLAY_ON_LOAD:"AUTOPLAY_ON_LOAD",DISALLOW_BACKGROUND_PLAYBACK:"DISALLOW_BACKGROUND_PLAYBACK",ENTERED_VIEWPORT:"ENTERED_VIEWPORT",EXITED_VIEWPORT:"EXITED_VIEWPORT",USER_TRIGGERED:"USER_TRIGGERED",VIDEO_PRIORITY_CHANGED:"VIDEO_PRIORITY_CHANGED",VIDEO_AUTOLOOPED:"VIDEO_AUTOLOOPED"},Lm={ENTERED_VIEWPORT:"ENTERED_VIEWPORT",USER_TRIGGERED:"USER_TRIGGERED",AUTO_TRIGGERED:"AUTO_TRIGGERED",UNKNOWN:"UNKNOWN"},Rm="ERROR",Dm="END",Mm="PLAYING",Nm="STALLING",Um="UNKNOWN",Bm="ENDED",Fm="STARTED",jm="ON",Hm="OFF",Vm="NOT_MEASURED",qm={CAPTIONS_ON_CONTROL:!0,CAPTIONS_OFF_CONTROL:!0,MENU_CAPTIONS_ON_CONTROL:!0,MENU_CAPTIONS_OFF_CONTROL:!0},Wm=dl.getPlugin("plugin"),zm=[0,3e3,7e3,2e4,3e4],Gm=function(e){o(n,e);var t=h(n);function n(e,r){var a,s=r.mediaUrn,o=r.trackingId,u=r.mediaHeader,l=r.onTrack,d=r.useTimeupdateForBeacon,h=void 0!==d&&d;i(this,n),a=t.apply(this,arguments),Ph("tracking: playerInteraction plugin is required",e.hasPlugin("playerInteraction")),a._qualityLevels=e.qualityLevels(),a._hasRenderedFirstFrame=!1,a._isPlaying=!1,a._isStalled=!1,a._isCcVisible=Hm,a._volume=a._getVolume(),a._fullscreenState=a._getFullScreenState(),a._isVisible=null,a._pauseReason=null,a._playReason=null,a._mediaHeader=null,a._currentPlaylist=null,a._currentTime=0,a._currentBeaconInterval=null,a.useTimeupdateForBeacon=h,a.setState({mediaUrn:s,trackingId:o,mediaHeader:u,onTrack:l});var p=a._onUnload.bind(c(a)),f=qh(a._onSeeked,300),m=qh(a._onVolumeChange,300);a.on(e.playerInteraction(),"interact",a._onPlayerInteraction),a.on(e,"fullscreenchange",a._onFullscreenChange),a.on(e,"pause",a._onPause),a.on(e,"play",a._onPlay),a.on(e,"error",a._onError),a.on(e,"playing",a._onPlaying),a.on(e,"timeupdate",a._onTimeupdate),a.on(e,"ratechange",a._onRateChange),a.on(e,"seeked",f),a.on(e,"seeking",a._onSeeking),a.on(e,"volumechange",m),a.on(e,"waiting",a._onWaiting),a.on(e,"sourceset",a._onSourceSet),a.on(e,"playerreset",a._onPlayerReset),a.on(e,"loadstart",a._onLoadStart),a.one(e,"loadedmetadata",a._onLoadedMetadata);var g="onpagehide"in window?"pagehide":"beforeunload";return window.addEventListener(g,p),a.on("dispose",(function(){window.removeEventListener(g,p),f.clear(),m.clear()})),e.ready((function(){var t=e.playerVisibility();t.ready((function(){a._isVisible=t.isVisible(),a.on(t,"visibilityChange",a._onVisibilityChange)})),e.usingPlugin("playlist")&&a.on(e.playlist(),"itemchange",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.plugins,i=void 0===n?{}:n;Ph("tracking must be updated on playlist item change",i.tracking)}))})),a}return a(n,[{key:"getEventHash",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e}},{key:"_getPlaybackExitState",value:function(){if(this.player.ended())return Dm;if(this._isStalled)return Nm;var e=this._pauseReason;return e?[Om.DISALLOW_BACKGROUND_PLAYBACK,Om.USER_TRIGGERED,Om.EXITED_VIEWPORT,Om.VIDEO_PRIORITY_CHANGED].includes(e)?Mm:Um:Mm}},{key:"setPauseReason",value:function(e){Ph("tracking: A valid reason must be supplied to setPauseReason",Om[e]),this._pauseReason=e}},{key:"setPlayReason",value:function(e){Ph("tracking: A valid reason must be supplied to setPlayReason",Om[e]),this._playReason=e}},{key:"handleStateChanged",value:function(e){var t=e.changes;if(t.mediaUrn||t.trackingId){var n=this.state.mediaUrn,i=t.trackingId;Ph("tracking: mediaUrn is required when updating trackingId",n),this.stopBeaconPolling(),i&&i.from!==i.to&&this.player.generateTrackingId().setTrackingId(i.to),this._mediaTrackingObject={objectUrn:n,trackingId:this.player.generateTrackingId().getTrackingId()},this._userInteracted=!1,this._previousTimeElapsed=0,this._playbackRate=null}}},{key:"getPlayerState",value:function(){var e=this._qualityLevels[this._qualityLevels.selectedIndex],t=e?e.bitrate:this.player.currentSource().bitRate;this._playbackRate||(this._playbackRate=this.player.playbackRate());var n={bitrate:t||null,casting:Vm,ccVisible:this._isCcVisible,downloaded:Vm,fullScreen:this._fullscreenState,isAudioOnly:!1,isPlaying:this._isPlaying,isVisible:this._isVisible,length:this._getDuration(),speed:this._playbackRate,timeElapsed:this.useTimeupdateForBeacon?this._currentTime:this.player.currentTime(),volume:this._volume,mediaUrl:this._currentPlaylist||this.player.currentSrc()},i=this.state.mediaHeader,r=(i=void 0===i?{}:i).mediaSource;return n.mediaLiveState=vm(r,this.player),n}},{key:"startBeaconPolling",value:function(){this._isPolling=!0,this.useTimeupdateForBeacon?(this._currentTime=this.player.currentTime(),this._currentBeaconInterval=zm[1],this._fireBeaconEvent()):(this._cancelBeaconInterval(),this._runBeaconInterval(zm[0]))}},{key:"restartBeaconPolling",value:function(){this._isPolling&&this.startBeaconPolling()}},{key:"stopBeaconPolling",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._isPolling&&(this._isPolling=!1,this.useTimeupdateForBeacon?this._currentBeaconInterval=null:this._cancelBeaconInterval(),e&&this._fireBeaconEvent(),this._lastBeaconTime=null)}},{key:"checkBeaconProgress",value:function(){this._currentTime=this.player.currentTime(),(this._currentTime-(this._lastBeaconTime||0))/this._playbackRate*1e3>=this._currentBeaconInterval&&(this._fireBeaconEvent(),this._currentBeaconInterval=zm[zm.indexOf(this._currentBeaconInterval)+1]||zm[zm.length-1])}},{key:"dispose",value:function(){this.stopBeaconPolling(),this._isStalled&&this._endStall(),f(u(n.prototype),"dispose",this).call(this)}},{key:"setIsCcVisible",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._isCcVisible=e?jm:Hm}},{key:"_onPlayerReset",value:function(){this._playReason=null,this._pauseReason=null,this._mediaHeader=null,this._currentTime=0,this._isStalled&&this._endStall(),this._hasRenderedFirstFrame=!1}},{key:"_onSegmentMetadataChange",value:function(){this._setSegmentMetadata()}},{key:"_setSegmentMetadata",value:function(){var e=this._metadataTrack&&this._metadataTrack.activeCues[0];if(e&&e.value){var t=this.player.tech().vhs.representations().find((function(t){return t.id===e.value.playlist}));this._currentPlaylist=t&&t.playlist&&t.playlist.resolvedUri}}},{key:"_onLoadedMetadata",value:function(){this._metadataTrack=this.player.textTracks().tracks_.find((function(e){return"segment-metadata"===e.label})),this._metadataTrack&&(this._setSegmentMetadata(),this.on(this._metadataTrack,"cuechange",this._onSegmentMetadataChange))}},{key:"_onLoadStart",value:function(){this._getMediaHeader()}},{key:"_onPlay",value:function(){var e;this._isPlaying=!0,this._volume=this._getVolume(),this._trigger(wm,{mediaTrackingObject:this._mediaTrackingObject,mediaHeader:this._getMediaHeader(),reason:this._playReason||Om.USER_TRIGGERED,state:this.getPlayerState(),createdTime:Date.now()}),this._trigger(Em,{mediaTrackingObject:this._mediaTrackingObject,mediaHeader:this._getMediaHeader(),reason:(e=this._playReason,Lm[e]||Lm.AUTO_TRIGGERED),createdTime:Date.now()}),this._playReason=null}},{key:"_onPlaying",value:function(){this._isPlaying=!0,this._playbackRate=this.player.playbackRate(),this._hasRenderedFirstFrame=!0,this._isStalled&&this._endStall(),this._isPolling||this.startBeaconPolling()}},{key:"_onError",value:function(){this._firePlaybackExitEvent(Rm),this._isStalled&&this._endStall()}},{key:"_onPause",value:function(){this._isPlaying=!1,this._trigger(wm,{mediaTrackingObject:this._mediaTrackingObject,mediaHeader:this._getMediaHeader(),reason:this._pauseReason||Om.USER_TRIGGERED,state:this.getPlayerState(),createdTime:Date.now()}),this._firePlaybackExitEvent(this._getPlaybackExitState()),this._isStalled&&this._endStall(),this._pauseReason=null,this.stopBeaconPolling()}},{key:"_endStall",value:function(){this._isStalled=!1,this._firePlaybackStallEvent(Bm)}},{key:"_firePlaybackExitEvent",value:function(e){this._trigger(Im,{mediaTrackingObject:this._mediaTrackingObject,mediaHeader:this._getMediaHeader(),state:e||Um,createdTime:Date.now()})}},{key:"_firePlaybackStallEvent",value:function(e){this._trigger(Pm,{mediaTrackingObject:this._mediaTrackingObject,mediaHeader:this._getMediaHeader(),playerState:this.getPlayerState(),stallState:e,createdTime:Date.now()})}},{key:"_onWaiting",value:function(){this._isPlaying=!1,this._isStalled||!this._hasRenderedFirstFrame||this._isSeeking||(this._isStalled=!0,this._firePlaybackStallEvent(Fm)),this.stopBeaconPolling()}},{key:"_onSourceSet",value:function(){this._isPlaying=!1,this.stopBeaconPolling(),this._hasRenderedFirstFrame=!1,this._isStalled&&this._endStall()}},{key:"_onVolumeChange",value:function(){var e=this._volume;this.restartBeaconPolling(),this._volume=this._getVolume(),this._trigger(Am,{mediaTrackingObject:this._mediaTrackingObject,mediaHeader:this._getMediaHeader(),state:this.getPlayerState(),createdTime:Date.now(),previousVolume:e})}},{key:"_onFullscreenChange",value:function(){this.restartBeaconPolling(),this._fullscreenState=this._getFullScreenState()}},{key:"_onRateChange",value:function(){this.restartBeaconPolling(),this._playbackRate=this.player.playbackRate()}},{key:"_onSeeking",value:function(){this._isSeeking=!0,this._isStalled&&this._endStall()}},{key:"_onTimeupdate",value:function(){this._isSeeking||this.player.seeking()||(this._previousTimeElapsed=this.player.currentTime()),this.player.seeking()||this.player.paused()||!this._isPolling||this.checkBeaconProgress()}},{key:"_onSeeked",value:function(){this._trigger(xm,{mediaTrackingObject:this._mediaTrackingObject,mediaHeader:this._getMediaHeader(),previousTimeElapsed:this._previousTimeElapsed,state:this.getPlayerState(),createdTime:Date.now()}),this._isSeeking=!1}},{key:"_onPlayerInteraction",value:function(e,t){var n=t.controlId;this._userInteracted=!0,qm[n]&&this.restartBeaconPolling()}},{key:"_onUnload",value:function(){this.stopBeaconPolling()}},{key:"_onVisibilityChange",value:function(e,t){var n=t.isVisible;this.restartBeaconPolling(),this._isVisible=n}},{key:"_runBeaconInterval",value:function(e){var t=this,n=this.getPlayerState().timeElapsed;if(n===this._beaconTimeElapsed&&e>0)this.stopBeaconPolling(!1);else{this._beaconTimeElapsed=n;var i=zm[zm.indexOf(e)+1]||zm[zm.length-1];this._fireBeaconEvent(),this._beaconPoll=this.player.setTimeout((function(){return t._runBeaconInterval(i)}),i)}}},{key:"_cancelBeaconInterval",value:function(){this._beaconPoll&&(this.player.clearTimeout(this._beaconPoll),this._beaconPoll=null)}},{key:"_fireBeaconEvent",value:function(){var e;if(this.useTimeupdateForBeacon){var t=hf(this._lastBeaconTime)?this._lastBeaconTime:this._currentTime;e=Math.round((this._currentTime-t)/this._playbackRate*1e3),this._lastBeaconTime=this._currentTime}else{var n=pm();e=n-(this._lastBeaconTime||n),this._lastBeaconTime=n}this._trigger(Cm,{mediaTrackingObject:this._mediaTrackingObject,mediaHeader:this._getMediaHeader(),isAutoplaying:this._isAutoplaying(),timeSinceLastBeacon:e,state:this.getPlayerState(),createdTime:Date.now()})}},{key:"_isAutoplaying",value:function(){return!this._userInteracted&&!!this.player.autoplay()}},{key:"_getFullScreenState",value:function(){return this.player.isFullscreen()?jm:Hm}},{key:"_getDuration",value:function(){var e=this.player.duration();return e&&isFinite(e)?e:0}},{key:"_getVolume",value:function(){return this.player.muted()?0:Math.round(100*this.player.volume())}},{key:"_getMediaHeader",value:function(){return this._mediaHeader||(this._mediaHeader=gm(this.player,this.state.mediaHeader)),this._mediaHeader}},{key:"_trigger",value:function(e,t,n){this.trigger(e,t),this.trigger("track",{eventName:e,eventData:t,meta:n}),Bf(this.state,"onTrack",[e,t,n])}}]),n}(Wm);dl.registerPlugin("tracking",Gm);var Km=function(e){o(n,e);var t=h(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=a.allowUnmutedBackgroundPlayback,o=void 0!==s&&s,u=a.visibilityChangeDelay,l=void 0===u?1e3:u;return i(this,n),r=t.apply(this,arguments),Ph("playbackAudit: tracking plugin is required",e.hasPlugin("tracking")),r._isVisible=null,r._checkVisibilityTimer=null,r._allowUnmutedBackgroundPlayback=o,r._visibilityChangeDelay=l,r.on(e,"timeupdate",r._onTimeupdate),r.on(e,"pause",r._onPause),r.on(e,"playerreset",r._onPlayerreset),e.ready((function(){var t=e.playerVisibility();t.ready((function(){r._isVisible=t.isVisible(),r.on(t,"visibilityChange",r._onVisibilityChange)}))})),r}return a(n,[{key:"_isMuted",value:function(){return this.player.muted()||0===this.player.volume()}},{key:"_shouldPause",value:function(){return!this._isVisible&&!this.player.paused()&&!this.player.isFullscreen()&&(!this._allowUnmutedBackgroundPlayback||this._isMuted())}},{key:"_clearVisibilityTimer",value:function(){this.player.clearTimeout(this._checkVisibilityTimer),this._checkVisibilityTimer=null}},{key:"_onVisibilityChange",value:function(e,t){var n=t.isVisible;this._isVisible=n,n&&this._clearVisibilityTimer()}},{key:"_onPlayerreset",value:function(){this._clearVisibilityTimer()}},{key:"_onPause",value:function(){this._clearVisibilityTimer()}},{key:"_onTimeupdate",value:function(){var e=this;!this._checkVisibilityTimer&&this._shouldPause()&&(this._checkVisibilityTimer=this.player.setTimeout((function(){e._shouldPause()&&(e.player.tracking().setPauseReason(Om.DISALLOW_BACKGROUND_PLAYBACK),e.player.pause()),e._clearVisibilityTimer()}),this._visibilityChangeDelay))}}]),n}(dl.getPlugin("plugin"));dl.registerPlugin("playbackAudit",Km);var Xm=function(e){o(n,e);var t=h(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=a.onInteract;return i(this,n),(r=t.apply(this,arguments))._registeredControls={},r.setState({onInteract:s}),e.ready((function(){r._attachControlEventListeners()})),r}return a(n,[{key:"registerControl",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Ph("playerInteraction: A valid control el must be supplied to the `registerControl` method",e),Ph("playerInteraction: A controlId must be supplied to the `registerControl` method",t),this._registeredControls[t]||(this._registeredControls[t]=hm({el:e},n))}},{key:"unregisterControl",value:function(e){delete this._registeredControls[e]}},{key:"_attachControlEventListeners",value:function(){this.on(this.player,["click"],this._onInteraction);var e=this.player.getDescendant("controlBar","volumePanel","volumeControl"),t=this.player.getDescendant("controlBar","progressControl","seekBar"),n=this.player.getDescendant("controlBar","captionsMenuToggle");e&&this.on(e,["mouseup"],this._onInteraction),t&&this.on(t,["click"],this._onInteraction),n&&this.on(n,["captionMenuItemSelected"],this._onCaptionsMenuItemSelected)}},{key:"_onCaptionsMenuItemSelected",value:function(e,t){var n,i=t.el();i.matches(up)||i.matches(lp)?n=wp:i.matches(cp)&&(n=Ip),this._triggerInteract(n)}},{key:"_onInteraction",value:function(e){var t=this._getControlId(e);t&&this._triggerInteract(t,{isUserInitiated:e.isTrusted})}},{key:"_getControlId",value:function(e){var t=this,n=e.target,i=e.currentTarget;return n.matches(rp)?this.player.muted()?yp:_p:n.matches(ap)?this.player.isFullscreen()?Sp:kp:n.matches(Zh)?mp:n.matches(ep)?gp:n.matches(tp)?vp:n.matches(sp)?Ep:n.matches(op)?Cp:n.matches(ip)?bp:n.matches(np)?Tp:n.matches(pp)?Ap:i.matches(dp)?Pp:i.matches(hp)?xp:n.matches(fp)?Op:Object.keys(this._registeredControls).find((function(e){var i=t._registeredControls[e];return n===i.el}))}},{key:"_triggerInteract",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.trigger("interact",{controlId:e,meta:t}),Bf(this.state,"onInteract",[e,t])}}]),n}(dl.getPlugin("plugin"));dl.registerPlugin("playerInteraction",Xm);var Qm=function(e){o(n,e);var t=h(n);function n(e){var r;return i(this,n),(r=t.apply(this,arguments))._background=e.addChild("PosterBackground"),r.on(e,"sourceset",r._onSourceSet),r}return a(n,[{key:"_onSourceSet",value:function(){var e=this.player.tech().el();this.player.el().insertBefore(this._background.el(),e)}}]),n}(dl.getPlugin("plugin"));dl.registerPlugin("posterBackground",Qm);var Ym=dl.getComponent("ModalDialog"),$m=dl.mergeOptions,Jm=function(e){o(n,e);var t=h(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=a.id,o=a.classNames;return i(this,n),(r=t.apply(this,arguments))._player=e,r.addClass("vjs-screen"),s&&r.contentEl().setAttribute("id",s),(o||[]).forEach((function(e){r.setAttribute("class",e)})),r.fill(),r.on("modalopen",r._onOpen),r.on("modalclose",r._onClose),r}return a(n,[{key:"_onOpen",value:function(){this._player.addClass("vjs-screen-active"),this.trigger("show")}},{key:"_onClose",value:function(){this._player.removeClass("vjs-screen-active"),this.trigger("hide")}}]),n}(Ym);Jm.prototype.options_=$m(Ym.prototype.options_,{uncloseable:!0,pauseOnOpen:!0,temporary:!1}),dl.registerComponent("Screen",Jm);var Zm=function(e){o(n,e);var t=h(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i(this,n),(r=t.apply(this,arguments))._player=e,r._options=a,r.screen=r._createScreen(),r.on(r._player,"play",r._onPlay),r.on(r._player,"sourceset",r._onSourceset),r.on("dispose",r._onDispose),r._player.ready((function(){r.screen&&r.screen.open()})),r}return a(n,[{key:"_createScreen",value:function(){var e=this,t=new Jm(this._player,this._options);return t.content(),t.addClass("vjs-start-screen"),t.on(["show","hide"],(function(t){e.trigger(t.type,{screen:e.screen})})),this._player.addChild(t),t}},{key:"_onPlay",value:function(){this.screen.close()}},{key:"_onSourceset",value:function(){this.screen.open()}},{key:"_onDispose",value:function(){this._player.removeChild(this.screen),this.screen=null}}]),n}(dl.getPlugin("plugin"));dl.registerPlugin("startScreen",Zm);var eg=function(e){o(n,e);var t=h(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i(this,n),(r=t.apply(this,arguments))._player=e,r.screen=r._createScreen(a),r.on(r._player,"ended",r._onEnded),r.on(r._player,"play",r._onPlay),r.on(r._player,"sourceset",r._onSourceset),r.on(r._player,"playerreset",r._onPlayerreset),r.on("dispose",r._onDispose),r.enable(),r}return a(n,[{key:"enable",value:function(){this._isEnabled=!0,this._isEnded&&this.screen.open()}},{key:"disable",value:function(){this._isEnabled=!1,this._isEnded&&this.screen.close()}},{key:"enabled",value:function(){return this._isEnabled}},{key:"_createScreen",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.id,i=t.classNames,r=t.closeable,a=void 0===r||r,s=new Jm(this._player,{id:n,classNames:i,uncloseable:!a});return s.addClass("vjs-end-screen"),s.on(["show","hide"],(function(t){e.trigger(t.type,{screen:e.screen})})),this._player.addChild(s),s}},{key:"_onEnded",value:function(){this._isEnded=!0,!this._player.loop()&&this.enabled()&&this.screen.open()}},{key:"_onPlay",value:function(){this._isEnded=!1,this.screen.close()}},{key:"_onSourceset",value:function(){this._isEnded=!1,this.screen.close()}},{key:"_onPlayerreset",value:function(){this._isEnded=!1,this.screen.close()}},{key:"_onDispose",value:function(){this._player.removeChild(this.screen),this.screen=null}}]),n}(dl.getPlugin("plugin"));dl.registerPlugin("endScreen",eg);var tg=function(e){o(n,e);var t=h(n);function n(e,r){var a;return i(this,n),(a=t.apply(this,arguments))._player=e,a._options=r,a.screen=a._createScreen(),a._player.ready((function(){a._disableErrorDisplay()})),a.on(a._player,"error",a._onError),a.on(a._player,"play",a._onPlay),a.on(a._player,"sourceset",a._onSourceset),a.on(a._player,"playerreset",a._onPlayerreset),a.on("dispose",a._onDispose),a}return a(n,[{key:"_createScreen",value:function(){var e=this,t=new Jm(this._player,this._options);return t.addClass("vjs-error-screen"),t.on(["show","hide"],(function(t){e.trigger(t.type,{screen:e.screen,error:e._player.error()})})),this._player.addChild(t),t}},{key:"_disableErrorDisplay",value:function(){var e=this._player.getChild("errorDisplay");e&&e.dispose()}},{key:"_onError",value:function(){this.screen.open()}},{key:"_onPlay",value:function(){this.screen.close()}},{key:"_onSourceset",value:function(){this.screen.close()}},{key:"_onPlayerreset",value:function(){this.screen.close()}},{key:"_onDispose",value:function(){this._player.removeChild(this.screen),this.screen=null}}]),n}(dl.getPlugin("plugin"));dl.registerPlugin("errorScreen",tg);var ng=dl.getComponent("Component"),ig=function(e){o(n,e);var t=h(n);function n(e,r){var a;return i(this,n),(a=t.call(this,e,r))._player=e,a}return a(n,[{key:"createControl",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new ng(this._player);return e.id&&t.setAttribute("id",e.id),e.className&&t.setAttribute("class",e.className),t.addClass("vjs-control"),this._player.getChild("controlBar").addChild(t,{},e.index)}}]),n}(dl.getPlugin("plugin"));dl.registerPlugin("customControl",ig);var rg="video_toolbar_mute_unmute",ag="video_toolbar_fullscreen_toggle",sg="video_toolbar_closed_caption_toggle",og={PLAY_CONTROL:"video_toolbar_play_pause",PAUSE_CONTROL:"video_toolbar_play_pause",REPLAY_CONTROL:"video_toolbar_replay",MUTE_CONTROL:rg,UNMUTE_CONTROL:rg,FULLSCREEN_CONTROL:ag,UNFULLSCREEN_CONTROL:ag,PROGRESS_SCRUBBER_CONTROL:"video_toolbar_scrubber",VOLUME_SLIDER_CONTROL:"video_toolbar_volume_slider",BACK_TO_START_CONTROL:"video_toolbar_back_to_start",THEATER_MODE_CONTROL:"video_toolbar_theater_mode",PLAY_OVERLAY_CONTROL:"video_thumbnail_play",POSTER_CONTROL:"video_thumbnail_play",CAPTIONS_ON_CONTROL:sg,CAPTIONS_OFF_CONTROL:sg,MENU_CAPTIONS_ON_CONTROL:sg,MENU_CAPTIONS_OFF_CONTROL:sg,PLAYBACK_RATE_CONTROL:"video_settings_playback_speed",SKIP_BACK_CONTROL:"video_skip_back",SKIP_AHEAD_CONTROL:"video_skip_ahead"},ug="SHORT_PRESS",lg="DRAG",cg="SWIPE_RIGHT",dg="SWIPE_LEFT",hg=function(e){o(n,e);var t=h(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=a.onTrack;return i(this,n),(r=t.apply(this,arguments)).setState({onTrack:s}),Ph("control-interaction: playerInteraction plugin is required",e.hasPlugin("playerInteraction")),r.on(e.playerInteraction(),"interact",r._onPlayerInteraction),r.on(e,"volumechange",r._onVolumechange),r}return a(n,[{key:"_onPlayerInteraction",value:function(e,t){var n=t.controlId,i=og[n];if(xh("media-player: control-interaction: controlId ".concat(n," was registered with the playerInteraction plugin but no associated control name was found."),i),i){var r,a={controlName:i};n===xp?r=this._previousVolume<this._currentVolume?cg:dg:n===Pp&&(r=lg),r&&(a.eventInfo={interactionType:r}),this.fireControlInteractionEvent(a)}}},{key:"_onVolumechange",value:function(){var e=this.player.volume();this._previousVolume=Number.isNaN(this._currentVolume)?e:this._currentVolume,this._currentVolume=e}},{key:"fireControlInteractionEvent",value:function(e){var t=e.controlName,n=e.eventInfo,i=(void 0===n?{}:n).interactionType||ug;Ph("controlInteraction: controlName must be a property on eventData",t),this.trigger("track",e),Bf(this.state,"onTrack",[t,i])}}]),n}(dl.getPlugin("plugin"));dl.registerPlugin("controlInteraction",hg);var pg=dl.getPlugin("plugin"),fg=dl.mergeOptions,mg={namespace:void 0},gg="media-player-prefs",vg="rate",yg="volume",_g="muted",bg=function(e){o(n,e);var t=h(n);function n(e,r){var a;i(this,n),a=t.apply(this,arguments);var s=fg(mg,r),o=s.namespace;return a._key=o?"".concat(o,":").concat(gg):gg,a.one(a.player,"loadstart",a._onLoadStart),a.player.ready((function(){a.on(a.player,"ratechange",a._onRatechange),a.on(a.player,"volumechange",a._onVolumechange)})),a}return a(n,[{key:"set",value:function(e,t){if(!this._cache||this._cache[e]!==t){var n=fg(this._cache,s({},e,t));try{this.localStorage.setItem(this._key,JSON.stringify(n))}catch(e){}this._cache=n}}},{key:"save",value:function(e){try{this.localStorage.setItem(this._key,JSON.stringify(e))}catch(e){}}},{key:"get",value:function(e){if(this._cache)return this._cache[e];try{var t=this.localStorage.getItem(this._key);this._cache=t?JSON.parse(t):{}}catch(e){this._cache={}}return this._cache[e]}},{key:"_onLoadStart",value:function(){this._setInitialRate(),this._setInitialVolume()}},{key:"_onRatechange",value:function(){this.player.isResetting()||this.set(vg,this.player.playbackRate())}},{key:"_onVolumechange",value:function(){this.player.isResetting()||(this.set(_g,this.player.muted()),this.set(yg,this.player.volume()))}},{key:"_setInitialVolume",value:function(){var e=this.get(yg),t=this.get(_g);hf(e)&&this.player.volume(e),hf(t)&&!hf(this.player.options_.muted)&&this.player.muted(t)}},{key:"_setInitialRate",value:function(){var e=this.get(vg),t=this.player.getChild("controlBar").getChild("playbackRateMenuButton");e&&t&&t.playbackRates().indexOf(e)>-1&&(this.player.defaultPlaybackRate(e),this.player.playbackRate(e))}}]),n}(pg);if(b)try{bg.prototype.localStorage=window.localStorage}catch(Cv){}dl.registerPlugin("userPreferences",bg);var Tg=function(e){o(n,e);var t=h(n);function n(e){var r;return i(this,n),(r=t.apply(this,arguments)).on(e,"play",r._onPlay),r.on(e,"pause",r._onPause),r.on(e,"ended",r._onEnded),r}return a(n,[{key:"_onPlay",value:function(){this.setText("Pause tooltip")}},{key:"_onPause",value:function(){this.setText("Play tooltip")}},{key:"_onEnded",value:function(){this.setText("Replay tooltip")}}],[{key:"getDefaultText",value:function(){return"Play tooltip"}}]),n}(ef);dl.registerComponent("PlayToggleTooltip",Tg);var kg=function(e){o(n,e);var t=h(n);function n(e){var r;return i(this,n),(r=t.apply(this,arguments)).on(e,"fullscreenchange",r._onFullscreenchange),r}return a(n,[{key:"_onFullscreenchange",value:function(){this.player.isFullscreen()?this.setText("Exit fullscreen tooltip"):this.setText("Fullscreen tooltip")}}],[{key:"getDefaultText",value:function(){return"Fullscreen tooltip"}}]),n}(ef);dl.registerComponent("FullscreenToggleTooltip",kg);var Sg=function(e){o(n,e);var t=h(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=a.control;return i(this,n),(r=t.apply(this,arguments)).on(s,"activate",r._onActivate),r.on(s,"deactivate",r._onDeactivate),r}return a(n,[{key:"_onActivate",value:function(){this.setText("Hide captions tooltip")}},{key:"_onDeactivate",value:function(){this.setText("Show captions tooltip")}}],[{key:"getDefaultText",value:function(){return"Show captions tooltip"}}]),n}(ef);dl.registerComponent("CaptionsToggleTooltip",Sg);var Eg=function(e){o(n,e);var t=h(n);function n(){return i(this,n),t.apply(this,arguments)}return a(n,null,[{key:"getDefaultText",value:function(){return"Captions Menu tooltip"}}]),n}(ef);dl.registerComponent("CaptionsMenuToggleTooltip",Eg);var Cg=function(e){o(n,e);var t=h(n);function n(){return i(this,n),t.apply(this,arguments)}return a(n,null,[{key:"getDefaultText",value:function(){return"Skip back tooltip"}}]),n}(ef);dl.registerComponent("SkipBackTooltip",Cg);var wg=function(e){o(n,e);var t=h(n);function n(){return i(this,n),t.apply(this,arguments)}return a(n,null,[{key:"getDefaultText",value:function(){return"Skip ahead tooltip"}}]),n}(ef);dl.registerComponent("SkipAheadTooltip",wg);var Ig=function(e){o(n,e);var t=h(n);function n(){return i(this,n),t.apply(this,arguments)}return a(n,null,[{key:"getDefaultText",value:function(){return"Back to start tooltip"}}]),n}(ef);dl.registerComponent("BackToStartTooltip",Ig);var Pg=function(e){o(n,e);var t=h(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=a.control;return i(this,n),(r=t.apply(this,arguments)).on(s,"activate",r._onActivate),r.on(s,"deactivate",r._onDeactivate),r}return a(n,[{key:"_onActivate",value:function(){this.setText("Deactivate theater mode tooltip")}},{key:"_onDeactivate",value:function(){this.setText("Activate theater mode tooltip")}}],[{key:"getDefaultText",value:function(){return"Activate theater mode tooltip"}}]),n}(ef);dl.registerComponent("TheaterModeTooltip",Pg);var xg=function(e){o(n,e);var t=h(n);function n(){return i(this,n),t.apply(this,arguments)}return a(n,null,[{key:"getDefaultText",value:function(){return"Previous tooltip"}}]),n}(ef);dl.registerComponent("PreviousTooltip",xg);var Ag=function(e){o(n,e);var t=h(n);function n(){return i(this,n),t.apply(this,arguments)}return a(n,null,[{key:"getDefaultText",value:function(){return"Next tooltip"}}]),n}(ef);dl.registerComponent("NextTooltip",Ag);var Og=function(e){o(n,e);var t=h(n);function n(){return i(this,n),t.apply(this,arguments)}return a(n,null,[{key:"getDefaultText",value:function(){return"Settings tooltip"}}]),n}(ef);dl.registerComponent("SettingsMenuTooltip",Og);var Lg=function(e){o(n,e);var t=h(n);function n(){return i(this,n),t.apply(this,arguments)}return a(n,null,[{key:"getDefaultText",value:function(){return"Playback speed tooltip"}}]),n}(ef);dl.registerComponent("PlaybackRateMenuTooltip",Lg);var Rg=dl.getPlugin("plugin"),Dg=dl.getComponent("ControlTooltip"),Mg={PlayToggle:Tg,SkipBackButton:Cg,SkipAheadButton:wg,BackToStartButton:Ig,TheaterModeButton:Pg,PreviousButton:xg,NextButton:Ag,CaptionsToggle:Sg,CaptionsMenuToggle:Eg,FullscreenToggle:kg,"SettingsMenuButton.SettingsMenuButton":Og,"PlaybackRateMenuButton.PlaybackRateMenuButton":Lg},Ng=function(e){o(n,e);var t=h(n);function n(e){var r;return i(this,n),(r=t.apply(this,arguments))._player=e,e.ready((function(){r._controlBar=e.getChild("controlBar"),r._controls=r._controlBar.children(),r._middleIndex=r._getMiddleIndex(),Object.keys(Mg).forEach((function(e){var t=Mg[e];Ph("tooltip: The tooltip class must provide a getDefaultText method","function"==typeof t.getDefaultText);var n=r._controlBar.getDescendant(e.split("."));if(n){var i=n,a=e.split(".");a.length>1&&(i=r._controlBar.getChild(a[0])),r.addTooltip(n,{side:r._getSide(i),TooltipClass:t})}})),r._middleIndex=null})),r}return a(n,[{key:"addTooltip",value:function(e,t){var n=t.side,i=t.TooltipClass,r=void 0===i?Dg:i,a=new r(this._player,{control:e,side:n,text:r.getDefaultText()});e.addChild(a)}},{key:"_getSide",value:function(e){var t=this._middleIndex||this._getMiddleIndex();return t?this._controls.indexOf(e)>t?Jp:$p:null}},{key:"_getMiddleIndex",value:function(){var e=this._controlBar.getChild("CustomControlSpacer"),t=e&&this._controls.indexOf(e);return t>-1?t:null}}]),n}(Rg);dl.registerPlugin("controlTooltips",Ng);var Ug=function(e){o(n,e);var t=h(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=a.autoplay,o=void 0===s||s;return i(this,n),(r=t.apply(this,arguments))._autoplay=o,e.ready((function(){var t=e.getDescendant("controlBar","nextButton"),n=e.getDescendant("controlBar","previousButton");t&&r.on(t,"next",(function(){r.next({autoplay:o&&!e.paused()})})),n&&r.on(n,"previous",(function(){r.previous({autoplay:o&&!e.paused()})})),r.on(e,"ended",r._onEnded)})),r}return a(n,[{key:"previous",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.autoplay;this.player.options({autoplay:!!t&&"play"}),this.trigger("previous")}},{key:"next",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.autoplay;this.player.options({autoplay:!!t&&"play"}),this.trigger("next")}},{key:"setCurrentItem",value:function(e){var t=this,n=e.source,i=e.autoplay,r=e.plugins,a=void 0===r?{}:r,s=e.poster,o=e.tracks;Ph("playlist setCurrentItem(): source is required",n),this.player.paused()||this.player.pause(),this.player.reset(),hf(i)&&this.player.options({autoplay:i}),Object.keys(a).forEach((function(e){t.player[e]().setState(a[e])})),this.player.poster(s),this.player.src(n),Array.isArray(o)&&o.forEach((function(e){var n=e.label,i=e.srclang,r=e.src;t.player.addRemoteTextTrack({kind:"captions",label:n,srclang:i,src:r})})),this.trigger("itemchange",e)}},{key:"_onEnded",value:function(){var e=this.player,t=e.getDescendant("controlBar","settingsMenuButton"),n=t&&t.menu.getChild("autoplaySetting"),i=!n||n.selected(),r=this._autoplay&&i&&!e.loop();this.trigger("ended",{autoplay:r,next:this.next.bind(this)})}}]),n}(dl.getPlugin("plugin"));dl.registerPlugin("playlist",Ug),dl.registerPlugin("disableContextMenu",(function(){this.on("contextmenu",(function(e){e.preventDefault()}))}));var Bg=!1,Fg=!1,jg=!1;dl.registerPlugin("highContrastMode",(function(){var e=this.el();if(b&&!jg){var t=document.createElement("div");t.style.width="1px",t.style.height="1px",t.style.backgroundImage="url(".concat("data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",")"),t.style.backgroundColor="#000000",e.appendChild(t);var n=window.getComputedStyle(t);Bg="none"===n.backgroundImage,Fg="rgb(255, 255, 255)"===n.backgroundColor,e.removeChild(t)}Bg&&this.addClass("vjs-high-contrast"),Fg&&this.addClass("vjs-black-on-white"),jg=!0}));var Hg=dl.getPlugin("plugin"),Vg=function(e){o(n,e);var t=h(n);function n(e,r){var a,s=r.topBufferSize,o=void 0===s?5:s;return i(this,n),(a=t.apply(this,arguments))._topBufferSize=o,a.on(e,"ready",a._onReady),a.on(e,"dispose",a._onDispose),a}return a(n,[{key:"_onReady",value:function(){var e=this;this._controlBar=this.player.getChild("controlBar"),this._controlBarResizeObserver=new ResizeObserver((function(){e._setMaxHeight()})),this._controlBarResizeObserver.observe(this._controlBar.el())}},{key:"_setMaxHeight",value:function(){if(this._controlBar&&this._controlBar.el()){var e=this.player.el().getBoundingClientRect().top,t=this._controlBar.children().find((function(e){return null!==e.el().offsetParent}));if(t){var n=t.el().getBoundingClientRect().top,i=Math.abs(e-n)-this._topBufferSize;this._controlBar.el().querySelectorAll(".vjs-slider-vertical").forEach((function(e){e.parentElement.style.maxHeight="".concat(i,"px")})),this.trigger("heightchange")}}}},{key:"_onDispose",value:function(){this._controlBarResizeObserver&&this._controlBarResizeObserver.unobserve(this._controlBar.el())}}]),n}(Hg);dl.registerPlugin("verticalSliderMaxHeight",Vg),dl.registerPlugin("throwErrors",(function(){var e=dl.log.error;dl.log.error=function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];if(n[0]instanceof Error)throw n[0];e.apply(e,n)}}));var qg=function(e){o(n,e);var t=h(n);function n(e,r){var a,s=r.checkInterval,o=void 0===s?1e3:s;return i(this,n),(a=t.apply(this,arguments)).setRateRanges(),a.on(e,"playbackrateschange",a.setRateRanges),a.on(e,"ratechange",a.restrictRate),a.on(e,"timeupdate",Ff((function(){return a.restrictRate()}),o)),a}return a(n,[{key:"setRateRanges",value:function(){var e=this.player.playbackRates();this.maxRate=!!e.length&&Math.max.apply(Math,g(e)),this.minRate=!!e.length&&Math.min.apply(Math,g(e))}},{key:"restrictRate",value:function(){if(!1!==this.maxRate&&!1!==this.minRate){var e=this.player.tech(!0).el().playbackRate;e>this.maxRate&&this.player.playbackRate(this.maxRate),e<this.minRate&&this.player.playbackRate(this.minRate)}}}]),n}(dl.getPlugin("plugin"));dl.registerPlugin("restrictPlaybackRate",qg),dl.registerPlugin("useMercado",(function(){this.addClass("media-player--use-mercado")}));var Wg=function(e){o(n,e);var t=h(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=a.rootMargin,o=a.threshold,u=void 0===o?0:o;if(i(this,n),r=t.apply(this,arguments),!b)return d(r);r._threshold=u,r._isInViewport=null,r._isDocumentVisible=!document.hidden;var l=r._onDocumentVisibilityChange.bind(c(r));document.addEventListener("visibilitychange",l);var h=new window.IntersectionObserver(r._onInViewportChange.bind(c(r)),{rootMargin:s,threshold:u});return h.observe(e.el()),r.on(e,"dispose",(function(){document.removeEventListener("visibilitychange",l),h.disconnect(),h=void 0})),r}return a(n,[{key:"ready",value:function(e){this._isReady?e():this.on("ready",e)}},{key:"isVisible",value:function(){return Ph("player-visibility: isVisible should not be called before `ready`",this._isReady),this._isVisible}},{key:"isInViewport",value:function(){return Ph("player-visibility: isInViewport should not be called before `ready`",this._isReady),this._isInViewport}},{key:"isDocumentVisible",value:function(){return this._isDocumentVisible}},{key:"_onInViewportChange",value:function(e){var t=this;e.forEach((function(e){var n=e.isIntersecting,i=e.intersectionRatio;t._isInViewport=n&&i>=t._threshold})),this._setIsVisible(),this._isReady?this.trigger("inViewportChange",{isInViewport:this._isInViewport}):(this._isReady=!0,this.trigger("ready"))}},{key:"_onDocumentVisibilityChange",value:function(){this._isDocumentVisible=!document.hidden,this._setIsVisible(),this.trigger("documentVisibilityChange",{isDocumentVisible:this._isDocumentVisible})}},{key:"_setIsVisible",value:function(){var e=this._isVisible;this._isVisible=this._isDocumentVisible&&this._isInViewport,this._isReady&&this._isVisible!==e&&this.trigger("visibilityChange",{isVisible:this._isVisible,isDocumentVisible:this._isDocumentVisible,isInViewport:this._isInViewport})}}]),n}(dl.getPlugin("plugin"));dl.registerPlugin("playerVisibility",Wg);var zg=dl.getPlugin("plugin"),Gg=["ready","loadstart","loadeddata","loadedmetadata","canplay","autoplay-success","autoplay-failure"],Kg=function(e){o(n,e);var t=h(n);function n(e){var r;return i(this,n),(r=t.apply(this,arguments)).Promise=e.options().Promise||window.Promise,r._setupEventPromises(),r.on(e,"playerreset",r._onReset),r}return a(n,[{key:"waitForEvent",value:function(e){return Ph("lifecycle: Must be a supported event",Gg.includes(e)),this._eventPromises[e]}},{key:"_setupEventPromises",value:function(){var e=this;this._eventPromises={},Gg.forEach((function(t){e._eventPromises[t]=new e.Promise((function(n){e.one(e.player,t,n),e.one(e.player,"playerreset",(function(){e.off(e.player,t,n)}))}))}))}},{key:"_onReset",value:function(){this._setupEventPromises()}}]),n}(zg);dl.registerPlugin("lifecycle",Kg);var Xg=dl.getPlugin("plugin"),Qg=function(e){o(n,e);var t=h(n);function n(e){var r;return i(this,n),(r=t.apply(this,arguments))._poster=null,r.on(e,"play",r._onPlay),r.on(e,"pause",r._onPause),r.on(e,"playerreset",r._onReset),r.one(e,"loadstart",(function(){r.on(e,"posterchange",r._onPosterChange),r.on(e,"autoplay-failure",r._onAutoplayFailure)})),r}return a(n,[{key:"_onPlay",value:function(){this.player.addClass("vjs-is-playing")}},{key:"_onPause",value:function(){this.player.removeClass("vjs-is-playing")}},{key:"_onReset",value:function(){this._poster=null,this.player.autoplay()||this.player.removeClass("vjs-is-playing")}},{key:"_onPosterChange",value:function(){var e=this.player.poster();e&&this.player.autoplay()&&e!==this._poster&&(this._poster=e,this.player.poster(""))}},{key:"_onAutoplayFailure",value:function(){this._poster&&(this.player.poster(this._poster),this._poster=null)}}]),n}(Xg);dl.registerPlugin("smoothMediaChange",Qg);dl.registerPlugin("menuOverflow",(function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.offset,i=void 0===n?80:n,r=t.maxHeight;this.on(["ready","playerresize","loadedmetadata"],(function(){var t=e.el().querySelectorAll(".vjs-menu-button-popup > .vjs-menu"),n=e.currentHeight();t.forEach((function(e){var t=Math.max(n-i,24);r&&(t=Math.min(t,r)),e.style.maxHeight="".concat(t,"px")}))}))}));var Yg=dl.getPlugin("plugin"),$g=function(e){o(n,e);var t=h(n);function n(e){var r;return i(this,n),r=t.apply(this,arguments),e.options({liveTracker:{liveTolerance:2}}),r.on(e,"play",r._onPlay),r.on(e,"pause",r._onPause),r.on(e,"ended",r._onEnded),r}return a(n,[{key:"_onPlay",value:function(){this.player.liveTracker&&this.player.liveTracker.isLive()&&this._maintainLiveEdge()}},{key:"_onPause",value:function(){this.player.clearTimeout(this._maintainLiveEdgeTimeout)}},{key:"_onEnded",value:function(){this.player.clearTimeout(this._maintainLiveEdgeTimeout),this._startedPlaybackDuringLive=!1}},{key:"_maintainLiveEdge",value:function(){this.player.liveTracker.liveCurrentTime()-this.player.currentTime()>2&&this.player.liveTracker.seekToLiveEdge(),this._maintainLiveEdgeTimeout=this.player.setTimeout(this._maintainLiveEdge.bind(this),1e3)}},{key:"dispose",value:function(){this.player.clearTimeout(this._maintainLiveEdgeTimeout),f(u(n.prototype),"dispose",this).call(this)}}]),n}(Yg);dl.registerPlugin("maintainLiveEdge",$g);var Jg,Zg=function(e){o(n,e);var t=h(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=a.events,o=void 0===s?["tap","click","keydown"]:s;return i(this,n),(r=t.apply(this,arguments)).on(e,o,(function(e){e.isTrusted||(e.preventDefault(),e.stopPropagation())})),r}return a(n)}(dl.getPlugin("plugin"));dl.registerPlugin("disableScriptInteraction",Zg),dl.registerPlugin("setAriaLiveToOff",(function(){var e=this;this.ready((function(){e.el().querySelectorAll(".vjs-control-text[aria-live=polite]").forEach((function(e){e.setAttribute("aria-live","off")}))}))}));var ev=new Uint8Array(16);function tv(){if(!Jg&&!(Jg="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Jg(ev)}var nv=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function iv(e){return"string"==typeof e&&nv.test(e)}for(var rv=[],av=0;av<256;++av)rv.push((av+256).toString(16).substr(1));function sv(e,t,n){var i=(e=e||{}).random||(e.rng||tv)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=i[r];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(rv[e[t+0]]+rv[e[t+1]]+rv[e[t+2]]+rv[e[t+3]]+"-"+rv[e[t+4]]+rv[e[t+5]]+"-"+rv[e[t+6]]+rv[e[t+7]]+"-"+rv[e[t+8]]+rv[e[t+9]]+"-"+rv[e[t+10]]+rv[e[t+11]]+rv[e[t+12]]+rv[e[t+13]]+rv[e[t+14]]+rv[e[t+15]]).toLowerCase();if(!iv(n))throw TypeError("Stringified UUID is invalid");return n}(i)}var ov=function(e){o(n,e);var t=h(n);function n(e){var r;return i(this,n),(r=t.apply(this,arguments))._sourceSet=!1,r.generateNewTrackingId(),r.on(e,"sourceset",(function(t){if(r._sourceSet){var n=t.src||"";n.length&&r._isSrcInCurrentSources(n,e.currentSources())||r.generateNewTrackingId()}else r._sourceSet=!0})),r}return a(n,[{key:"generateNewTrackingId",value:function(){this.trackingId=sv()}},{key:"getTrackingId",value:function(){return this.clientTrackingId||this.trackingId}},{key:"setTrackingId",value:function(e){this.clientTrackingId=e}},{key:"_isSrcInCurrentSources",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.length>1&&t.find((function(t){return t.src.length&&e.indexOf(t.src)>-1}))}}]),n}(dl.getPlugin("plugin"));dl.registerPlugin("generateTrackingId",ov);var uv={rum:1,tracking:2},lv=function(e){return uv[e]||1/0},cv=function(e){return Object.keys(e).sort((function(e,t){return lv(e)-lv(t)}))};var dv=function(e){_inherits2(n,e);var t=_createSuper2(n);function n(e,i){var r,a=i.hideControls;return _classCallCheck2(this,n),r=t.apply(this,arguments),e.options({inactivityTimeout:0}),e.userActive(!a),r.setState({hideControls:a}),r}return _createClass2(n,[{key:"handleStateChanged",value:function(e){e.changes.hideControls&&this.player.userActive(!this.state.hideControls)}}]),n}(dl.getPlugin("plugin"));dl.registerPlugin("controlsDisplay",dv);var hv="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function pv(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var fv,mv,gv,vv,yv=pv((function(e,t){!function(e,t){var n="undefined"!=typeof window&&window&&"node"!==window.appEnvironment,i=n&&!!window.requestIdleCallback,r={AJAX_METHOD:"POST",DEFAULT_PAGE_TYPE:"ajax",globalTrackingUrl:null,globalTrackingAppId:"no.app.id",queue:[],paused:!1,maxQueueSize:1,queueTimeout:1e3,timeoutId:null,disableSendBeacon:!0,csrfToken:"",testId:"",testSegId:"",setProperty:function(e,t){void 0!==t&&(this[e]=t)},setTrackingUrl:function(e){this.setProperty("globalTrackingUrl",e)},setAppId:function(e){this.setProperty("globalTrackingAppId",e)},setCsrfToken:function(e){this.setProperty("csrfToken",e)},setTestId:function(e){this.setProperty("testId",e)},setTestSegId:function(e){this.setProperty("testSegId",e)},getCookieString:function(){return document.cookie},getCsrfToken:function(){for(var e=this.getCookieString().split(";"),t=0;t<e.length;t++){for(var n=e[t];" "===n.charAt(0);)n=n.substring(1);if(-1!==n.indexOf("JSESSIONID=")){var i=n.substring("JSESSIONID=".length,n.length);return'"'===i[0]&&'"'===i[i.length-1]&&(i=i.substring(1,i.length-1)),i}}return""},createXmlHttpObject:function(){return n&&window.XMLHttpRequest?new XMLHttpRequest:null},beacon:function(e,t,i,r){this._beacon(e,t,i,r||this.globalTrackingUrl,this.disableSendBeacon?null:n&&navigator.sendBeacon&&navigator.sendBeacon.bind(navigator))},_beacon:function(e,t,n,i,r){if(r){var a=void 0;try{a=r(i,e)}catch(t){throw"object"===_typeof2(t)&&(t.message="Error sending ["+e+"] to "+i+" using sendBeacon:"+t.message,t.tags=["tracking"]),t}if(a)return void(t&&t(a))}this.ajax(e,t,n,i)},ajax:function(e,t,n,i){var r;i?(r=this.createXmlHttpObject())&&(r.open(this.AJAX_METHOD,i,!0),r.withCredentials=!0,r.setRequestHeader("Content-type","application/json"),this.csrfToken?r.setRequestHeader("Csrf-Token",this.csrfToken):r.setRequestHeader("Csrf-Token",this.getCsrfToken()),this.testId&&r.setRequestHeader("X-LinkedIn-traceDataContext-ENG_TEST_ID",this.testId),this.testSegId&&r.setRequestHeader("X-LinkedIn-traceDataContext-ENG_TEST_SEGMENT_ID",this.testSegId),r.onreadystatechange=function(){4===r.readyState&&(200===r.status||304===r.status?"function"==typeof t&&t(r):n&&n('Response is not "OK" or "Not Modified" for tracking request'))},4!==r.readyState&&r.send(e)):n&&n("Tracking url is not defined")},pause:function(){this.paused=!0},unpause:function(){this.paused=!1,this.queue.length>=this.maxQueueSize&&this.flush()},flush:function(){this.queue.length>0&&(this.beacon(JSON.stringify(this.queue),null,this.logError),this.queue=[]),i?cancelIdleCallback(this.timeoutId):clearTimeout(this.timeoutId),this.timeoutId=null,this.paused=!1},idleFlush:function(e){var t=this,n=Date.now();return requestIdleCallback((function(i){i.timeRemaining()>8||i.didTimeout?t.flush():t.timeoutId=t.idleFlush(e-(Date.now()-n))}),{timeout:e})},addToQueue:function(e){if(this.queue.push(e),this.queue.length>=this.maxQueueSize&&!this.paused)return this.flush();if(!this.timeoutId){var t=this;i&&!this.paused?this.timeoutId=this.idleFlush(this.queueTimeout):this.timeoutId=setTimeout((function(){t.flush()}),this.queueTimeout)}},validateEvent:function(e,t,n){this.beacon(JSON.stringify([{eventInfo:this.populateEventInfo(e),eventBody:this.populateEventHeaders(t)}]),(function(e){return n(null,e)}),(function(e){return n(e)}),this.globalTrackingUrl+"/validate")},sendEvent:function(e,t){this.addToQueue({eventInfo:this.populateEventInfo(e),eventBody:this.populateEventHeaders(t)})},getTimestamp:function(){return Math.round((new Date).getTime()/1e3)},populateEventInfo:function(e){return"string"==typeof e&&(e={eventName:e}),e&&"object"===_typeof2(e)?(e.appId||(e.appId=this.globalTrackingAppId),e):(this.logError("Event info must be object"),{})},populateEventHeaders:function(e){return e&&"object"===_typeof2(e)?e:(this.logError("Event body must be object"),{})},logError:function(e){var t=window.console;t&&t.error&&t.error(e)},init:function(){this.setTrackingUrl(),this.setAppId(),this.onBeforeUnload=this.onBeforeUnload.bind(this),n&&window.addEventListener("beforeunload",this.onBeforeUnload)},destroy:function(){this.flush(),n&&window.removeEventListener("beforeunload",this.onBeforeUnload)},onBeforeUnload:function(){this.flush()}};t.exports=r}(0,e)})),_v="undefined"!=typeof window?window:null;_v?function(){var e=_v.crypto||_v.msCrypto;if(!fv&&e&&e.getRandomValues)try{var t=new Uint8Array(16);vv=fv=function(){return e.getRandomValues(t),t},fv()}catch(e){}if(!fv){var n=new Array(16);mv=fv=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n},"undefined"!=typeof console&&console.warn&&console.warn("[SECURITY] node-uuid: crypto not usable, falling back to insecure Math.random()")}}():function(){if("function"==typeof require)try{var e=require("crypto").randomBytes;gv=fv=e&&function(){return e(16)},fv()}catch(e){}}();for(var bv="function"==typeof Buffer?Buffer:Array,Tv=[],kv=0;kv<256;kv++)Tv[kv]=(kv+256).toString(16).substr(1);function Sv(e,t){var n=t||0,i=Tv;return i[e[n++]]+i[e[n++]]+i[e[n++]]+i[e[n++]]+"-"+i[e[n++]]+i[e[n++]]+"-"+i[e[n++]]+i[e[n++]]+"-"+i[e[n++]]+i[e[n++]]+"-"+i[e[n++]]+i[e[n++]]+i[e[n++]]+i[e[n++]]+i[e[n++]]+i[e[n++]]}function Ev(e,t,n){var i=t&&n||0;"string"==typeof e&&(t="binary"===e?new bv(16):null,e=null);var r=(e=e||{}).random||(e.rng||fv)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t)for(var a=0;a<16;a++)t[i+a]=r[a];return t||Sv(r)}var Cv,wv=Ev;function Iv(){var e=new Array(16);return wv.v4(null,e),function(e){for(var t,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=[],r=0,a=e.length,s=a%3,o=a-s;r<o;)t=e[r]<<16,t|=e[r+1]<<8,t|=e[r+2],i.push(n.charAt(t>>>18&63)),i.push(n.charAt(t>>>12&63)),i.push(n.charAt(t>>>6&63)),i.push(n.charAt(63&t)),r+=3;switch(s){case 2:t=e[r]<<16,t|=e[r+1]<<8,i.push(n.charAt(t>>>18&63)),i.push(n.charAt(t>>>12&63)),i.push(n.charAt(t>>>6&63)),i.push("=");break;case 1:t=e[r]<<16,i.push(n.charAt(t>>>18&63)),i.push(n.charAt(t>>>12&63)),i.push("="),i.push("=")}return i.join("")}(e)}function Pv(e){var t=e.eventName,n=void 0===t?"":t,i=e.pageKey,r=void 0===i?"":i,a=e.eventData,s=void 0===a?{}:a,o=e.requestHeader,u=void 0===o?{pageKey:r,referer:document.referrer||null}:o,l=s;l.requestHeader=u,yv.sendEvent(n,l)}function xv(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Ov(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function Av(e){return function(e){if(Array.isArray(e))return Lv(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Ov(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ov(e,t){if(e){if("string"==typeof e)return Lv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lv(e,t):void 0}}function Lv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Rv(e){return(Rv="function"==typeof Symbol&&"symbol"==_typeof2(Symbol.iterator)?function(e){return _typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof2(e)})(e)}function Dv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mv(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Nv(e,t,n){return t&&Mv(e.prototype,t),n&&Mv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Uv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}wv.v4=Ev,wv.unparse=Sv,wv.BufferClass=bv,wv._rng=fv,wv._mathRNG=mv,wv._nodeRNG=gv,wv._whatwgRNG=vv;var Bv,Fv=new Uint8Array(16);function jv(){if(!Bv&&!(Bv="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Bv(Fv)}var Hv=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Vv(e){return"string"==typeof e&&Hv.test(e)}for(var qv=[],Wv=0;Wv<256;++Wv)qv.push((Wv+256).toString(16).substr(1));function zv(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(qv[e[t+0]]+qv[e[t+1]]+qv[e[t+2]]+qv[e[t+3]]+"-"+qv[e[t+4]]+qv[e[t+5]]+"-"+qv[e[t+6]]+qv[e[t+7]]+"-"+qv[e[t+8]]+qv[e[t+9]]+"-"+qv[e[t+10]]+qv[e[t+11]]+qv[e[t+12]]+qv[e[t+13]]+qv[e[t+14]]+qv[e[t+15]]).toLowerCase();if(!Vv(n))throw TypeError("Stringified UUID is invalid");return n}function Gv(e){if(!Vv(e))throw TypeError("Invalid UUID");var t,n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}function Kv(e,t,n){function i(e,i,r,a){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof i&&(i=Gv(i)),16!==i.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var s=new Uint8Array(16+e.length);if(s.set(i),s.set(e,i.length),(s=n(s))[6]=15&s[6]|t,s[8]=63&s[8]|128,r){a=a||0;for(var o=0;o<16;++o)r[a+o]=s[o];return r}return zv(s)}try{i.name=e}catch(e){}return i.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",i.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",i}function Xv(e){return 14+(e+64>>>9<<4)+1}function Qv(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function Yv(e,t,n,i,r,a){return Qv((s=Qv(Qv(t,e),Qv(i,a)))<<(o=r)|s>>>32-o,n);var s,o}function $v(e,t,n,i,r,a,s){return Yv(t&n|~t&i,e,t,r,a,s)}function Jv(e,t,n,i,r,a,s){return Yv(t&i|n&~i,e,t,r,a,s)}function Zv(e,t,n,i,r,a,s){return Yv(t^n^i,e,t,r,a,s)}function ey(e,t,n,i,r,a,s){return Yv(n^(t|~i),e,t,r,a,s)}function ty(e,t,n){var i=(e=e||{}).random||(e.rng||jv)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=i[r];return t}return zv(i)}function ny(e,t,n,i){switch(e){case 0:return t&n^~t&i;case 1:return t^n^i;case 2:return t&n^t&i^n&i;case 3:return t^n^i}}function iy(e,t){return e<<t|e>>>32-t}Kv("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(e){for(var t=[],n=32*e.length,i="0123456789abcdef",r=0;r<n;r+=8){var a=e[r>>5]>>>r%32&255,s=parseInt(i.charAt(a>>>4&15)+i.charAt(15&a),16);t.push(s)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[Xv(t)-1]=t;for(var n=1732584193,i=-271733879,r=-1732584194,a=271733878,s=0;s<e.length;s+=16){var o=n,u=i,l=r,c=a;n=$v(n,i,r,a,e[s],7,-680876936),a=$v(a,n,i,r,e[s+1],12,-389564586),r=$v(r,a,n,i,e[s+2],17,606105819),i=$v(i,r,a,n,e[s+3],22,-1044525330),n=$v(n,i,r,a,e[s+4],7,-176418897),a=$v(a,n,i,r,e[s+5],12,1200080426),r=$v(r,a,n,i,e[s+6],17,-1473231341),i=$v(i,r,a,n,e[s+7],22,-45705983),n=$v(n,i,r,a,e[s+8],7,1770035416),a=$v(a,n,i,r,e[s+9],12,-1958414417),r=$v(r,a,n,i,e[s+10],17,-42063),i=$v(i,r,a,n,e[s+11],22,-1990404162),n=$v(n,i,r,a,e[s+12],7,1804603682),a=$v(a,n,i,r,e[s+13],12,-40341101),r=$v(r,a,n,i,e[s+14],17,-1502002290),n=Jv(n,i=$v(i,r,a,n,e[s+15],22,1236535329),r,a,e[s+1],5,-165796510),a=Jv(a,n,i,r,e[s+6],9,-1069501632),r=Jv(r,a,n,i,e[s+11],14,643717713),i=Jv(i,r,a,n,e[s],20,-373897302),n=Jv(n,i,r,a,e[s+5],5,-701558691),a=Jv(a,n,i,r,e[s+10],9,38016083),r=Jv(r,a,n,i,e[s+15],14,-660478335),i=Jv(i,r,a,n,e[s+4],20,-405537848),n=Jv(n,i,r,a,e[s+9],5,568446438),a=Jv(a,n,i,r,e[s+14],9,-1019803690),r=Jv(r,a,n,i,e[s+3],14,-187363961),i=Jv(i,r,a,n,e[s+8],20,1163531501),n=Jv(n,i,r,a,e[s+13],5,-1444681467),a=Jv(a,n,i,r,e[s+2],9,-51403784),r=Jv(r,a,n,i,e[s+7],14,1735328473),n=Zv(n,i=Jv(i,r,a,n,e[s+12],20,-1926607734),r,a,e[s+5],4,-378558),a=Zv(a,n,i,r,e[s+8],11,-2022574463),r=Zv(r,a,n,i,e[s+11],16,1839030562),i=Zv(i,r,a,n,e[s+14],23,-35309556),n=Zv(n,i,r,a,e[s+1],4,-1530992060),a=Zv(a,n,i,r,e[s+4],11,1272893353),r=Zv(r,a,n,i,e[s+7],16,-155497632),i=Zv(i,r,a,n,e[s+10],23,-1094730640),n=Zv(n,i,r,a,e[s+13],4,681279174),a=Zv(a,n,i,r,e[s],11,-358537222),r=Zv(r,a,n,i,e[s+3],16,-722521979),i=Zv(i,r,a,n,e[s+6],23,76029189),n=Zv(n,i,r,a,e[s+9],4,-640364487),a=Zv(a,n,i,r,e[s+12],11,-421815835),r=Zv(r,a,n,i,e[s+15],16,530742520),n=ey(n,i=Zv(i,r,a,n,e[s+2],23,-995338651),r,a,e[s],6,-198630844),a=ey(a,n,i,r,e[s+7],10,1126891415),r=ey(r,a,n,i,e[s+14],15,-1416354905),i=ey(i,r,a,n,e[s+5],21,-57434055),n=ey(n,i,r,a,e[s+12],6,1700485571),a=ey(a,n,i,r,e[s+3],10,-1894986606),r=ey(r,a,n,i,e[s+10],15,-1051523),i=ey(i,r,a,n,e[s+1],21,-2054922799),n=ey(n,i,r,a,e[s+8],6,1873313359),a=ey(a,n,i,r,e[s+15],10,-30611744),r=ey(r,a,n,i,e[s+6],15,-1560198380),i=ey(i,r,a,n,e[s+13],21,1309151649),n=ey(n,i,r,a,e[s+4],6,-145523070),a=ey(a,n,i,r,e[s+11],10,-1120210379),r=ey(r,a,n,i,e[s+2],15,718787259),i=ey(i,r,a,n,e[s+9],21,-343485551),n=Qv(n,o),i=Qv(i,u),r=Qv(r,l),a=Qv(a,c)}return[n,i,r,a]}(function(e){if(0===e.length)return[];for(var t=8*e.length,n=new Uint32Array(Xv(t)),i=0;i<t;i+=8)n[i>>5]|=(255&e[i/8])<<i%32;return n}(e),8*e.length))})),Kv("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var i=unescape(encodeURIComponent(e));e=[];for(var r=0;r<i.length;++r)e.push(i.charCodeAt(r))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var a=e.length/4+2,s=Math.ceil(a/16),o=new Array(s),u=0;u<s;++u){for(var l=new Uint32Array(16),c=0;c<16;++c)l[c]=e[64*u+4*c]<<24|e[64*u+4*c+1]<<16|e[64*u+4*c+2]<<8|e[64*u+4*c+3];o[u]=l}o[s-1][14]=8*(e.length-1)/Math.pow(2,32),o[s-1][14]=Math.floor(o[s-1][14]),o[s-1][15]=8*(e.length-1)&4294967295;for(var d=0;d<s;++d){for(var h=new Uint32Array(80),p=0;p<16;++p)h[p]=o[d][p];for(var f=16;f<80;++f)h[f]=iy(h[f-3]^h[f-8]^h[f-14]^h[f-16],1);for(var m=n[0],g=n[1],v=n[2],y=n[3],_=n[4],b=0;b<80;++b){var T=Math.floor(b/20),k=iy(m,5)+ny(T,g,v,y)+_+t[T]+h[b]>>>0;_=y,y=v,v=iy(g,30)>>>0,g=m,m=k}n[0]=n[0]+m>>>0,n[1]=n[1]+g>>>0,n[2]=n[2]+v>>>0,n[3]=n[3]+y>>>0,n[4]=n[4]+_>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}));var ry=Uint8Array,ay=Uint16Array,sy=Uint32Array,oy=new ry([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),uy=new ry([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ly=new ry([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),cy=function(e,t){for(var n=new ay(31),i=0;i<31;++i)n[i]=t+=1<<e[i-1];var r=new sy(n[30]);for(i=1;i<30;++i)for(var a=n[i];a<n[i+1];++a)r[a]=a-n[i]<<5|i;return[n,r]},dy=cy(oy,2),hy=dy[0],py=dy[1];hy[28]=258,py[258]=28;for(var fy=cy(uy,0)[1],my=new ay(32768),gy=0;gy<32768;++gy){var vy=(43690&gy)>>>1|(21845&gy)<<1;vy=(61680&(vy=(52428&vy)>>>2|(13107&vy)<<2))>>>4|(3855&vy)<<4,my[gy]=((65280&vy)>>>8|(255&vy)<<8)>>>1}var yy=function(e,t,n){for(var i=e.length,r=0,a=new ay(t);r<i;++r)e[r]&&++a[e[r]-1];var s,o=new ay(t);for(r=0;r<t;++r)o[r]=o[r-1]+a[r-1]<<1;if(n){s=new ay(1<<t);var u=15-t;for(r=0;r<i;++r)if(e[r])for(var l=r<<4|e[r],c=t-e[r],d=o[e[r]-1]++<<c,h=d|(1<<c)-1;d<=h;++d)s[my[d]>>>u]=l}else for(s=new ay(i),r=0;r<i;++r)e[r]&&(s[r]=my[o[e[r]-1]++]>>>15-e[r]);return s},_y=new ry(288);for(gy=0;gy<144;++gy)_y[gy]=8;for(gy=144;gy<256;++gy)_y[gy]=9;for(gy=256;gy<280;++gy)_y[gy]=7;for(gy=280;gy<288;++gy)_y[gy]=8;var by=new ry(32);for(gy=0;gy<32;++gy)by[gy]=5;var Ty=yy(_y,9,0),ky=yy(by,5,0),Sy=function(e){return(e+7)/8|0},Ey=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8},Cy=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},wy=function(e,t){for(var n=[],i=0;i<e.length;++i)e[i]&&n.push({s:i,f:e[i]});var r=n.length,a=n.slice();if(!r)return[Ry,0];if(1==r){var s=new ry(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var o=n[0],u=n[1],l=0,c=1,d=2;for(n[0]={s:-1,f:o.f+u.f,l:o,r:u};c!=r-1;)o=n[n[l].f<n[d].f?l++:d++],u=n[l!=c&&n[l].f<n[d].f?l++:d++],n[c++]={s:-1,f:o.f+u.f,l:o,r:u};var h=a[0].s;for(i=1;i<r;++i)a[i].s>h&&(h=a[i].s);var p=new ay(h+1),f=Iy(n[c-1],p,0);if(f>t){i=0;var m=0,g=f-t,v=1<<g;for(a.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));i<r;++i){var y=a[i].s;if(!(p[y]>t))break;m+=v-(1<<f-p[y]),p[y]=t}for(m>>>=g;m>0;){var _=a[i].s;p[_]<t?m-=1<<t-p[_]++-1:++i}for(;i>=0&&m;--i){var b=a[i].s;p[b]==t&&(--p[b],++m)}f=t}return[new ry(p),f]},Iy=function e(t,n,i){return-1==t.s?Math.max(e(t.l,n,i+1),e(t.r,n,i+1)):n[t.s]=i},Py=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new ay(++t),i=0,r=e[0],a=1,s=function(e){n[i++]=e},o=1;o<=t;++o)if(e[o]==r&&o!=t)++a;else{if(!r&&a>2){for(;a>138;a-=138)s(32754);a>2&&(s(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(s(r),--a;a>6;a-=6)s(8304);a>2&&(s(a-3<<5|8208),a=0)}for(;a--;)s(r);a=1,r=e[o]}return[n.subarray(0,i),t]},xy=function(e,t){for(var n=0,i=0;i<t.length;++i)n+=e[i]*t[i];return n},Ay=function(e,t,n){var i=n.length,r=Sy(t+2);e[r]=255&i,e[r+1]=i>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var a=0;a<i;++a)e[r+a+4]=n[a];return 8*(r+4+i)},Oy=function(e,t,n,i,r,a,s,o,u,l,c){Ey(t,c++,n),++r[256];for(var d=wy(r,15),h=d[0],p=d[1],f=wy(a,15),m=f[0],g=f[1],v=Py(h),y=v[0],_=v[1],b=Py(m),T=b[0],k=b[1],S=new ay(19),E=0;E<y.length;++E)S[31&y[E]]++;for(E=0;E<T.length;++E)S[31&T[E]]++;for(var C=wy(S,7),w=C[0],I=C[1],P=19;P>4&&!w[ly[P-1]];--P);var x,A,O,L,R=l+5<<3,D=xy(r,_y)+xy(a,by)+s,M=xy(r,h)+xy(a,m)+s+14+3*P+xy(S,w)+(2*S[16]+3*S[17]+7*S[18]);if(R<=D&&R<=M)return Ay(t,c,e.subarray(u,u+l));if(Ey(t,c,1+(M<D)),c+=2,M<D){x=yy(h,p,0),A=h,O=yy(m,g,0),L=m;var N=yy(w,I,0);for(Ey(t,c,_-257),Ey(t,c+5,k-1),Ey(t,c+10,P-4),c+=14,E=0;E<P;++E)Ey(t,c+3*E,w[ly[E]]);c+=3*P;for(var U=[y,T],B=0;B<2;++B){var F=U[B];for(E=0;E<F.length;++E){var j=31&F[E];Ey(t,c,N[j]),c+=w[j],j>15&&(Ey(t,c,F[E]>>>5&127),c+=F[E]>>>12)}}}else x=Ty,A=_y,O=ky,L=by;for(E=0;E<o;++E)if(i[E]>255){j=i[E]>>>18&31,Cy(t,c,x[j+257]),c+=A[j+257],j>7&&(Ey(t,c,i[E]>>>23&31),c+=oy[j]);var H=31&i[E];Cy(t,c,O[H]),c+=L[H],H>3&&(Cy(t,c,i[E]>>>5&8191),c+=uy[H])}else Cy(t,c,x[i[E]]),c+=A[i[E]];return Cy(t,c,x[256]),c+A[256]},Ly=new sy([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ry=new ry(0),Dy=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,i=9;--i;)n=(1&n&&-306674912)^n>>>1;e[t]=n}return e}(),My=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Ny(e,t){t||(t={});var n=function(){var e=-1;return{p:function(t){for(var n=e,i=0;i<t.length;++i)n=Dy[255&n^t[i]]^n>>>8;e=n},d:function(){return~e}}}(),i=e.length;n.p(e);var r,a,s,o=(r=e,a=t,s=function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),8,function(e,t,n,i,r,a){var s=e.length,o=new ry(i+s+5*(1+Math.ceil(s/7e3))+r),u=o.subarray(i,o.length-r),l=0;if(!t||s<8)for(var c=0;c<=s;c+=65535){var d=c+65535;d>=s&&(u[l>>3]=a),l=Ay(u,l+1,e.subarray(c,d))}else{for(var h=Ly[t-1],p=h>>>13,f=8191&h,m=(1<<n)-1,g=new ay(32768),v=new ay(m+1),y=Math.ceil(n/3),_=2*y,b=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<_)&m},T=new sy(25e3),k=new ay(288),S=new ay(32),E=0,C=0,w=(c=0,0),I=0,P=0;c<s;++c){var x=b(c),A=32767&c,O=v[x];if(g[A]=O,v[x]=A,I<=c){var L=s-c;if((E>7e3||w>24576)&&L>423){l=Oy(e,u,0,T,k,S,C,w,P,c-P,l),w=E=C=0,P=c;for(var R=0;R<286;++R)k[R]=0;for(R=0;R<30;++R)S[R]=0}var D=2,M=0,N=f,U=A-O&32767;if(L>2&&x==b(c-U))for(var B=Math.min(p,L)-1,F=Math.min(32767,c),j=Math.min(258,L);U<=F&&--N&&A!=O;){if(e[c+D]==e[c+D-U]){for(var H=0;H<j&&e[c+H]==e[c+H-U];++H);if(H>D){if(D=H,M=U,H>B)break;var V=Math.min(U,H-2),q=0;for(R=0;R<V;++R){var W=c-U+R+32768&32767,z=W-g[W]+32768&32767;z>q&&(q=z,O=W)}}}U+=(A=O)-(O=g[A])+32768&32767}if(M){T[w++]=268435456|py[D]<<18|fy[M];var G=31&py[D],K=31&fy[M];C+=oy[G]+uy[K],++k[257+G],++S[K],I=c+D,++E}else T[w++]=e[c],++k[e[c]]}}l=Oy(e,u,a,T,k,S,C,w,P,c-P,l),!a&&7&l&&(l=Ay(u,l+1,Ry))}return function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var i=new(2==e.BYTES_PER_ELEMENT?ay:4==e.BYTES_PER_ELEMENT?sy:ry)(n-t);return i.set(e.subarray(t,n)),i}(o,0,i+Sy(l)+r)}(r,null==a.level?6:a.level,null==a.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+a.mem,s,8,!0)),u=o.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&My(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var i=0;i<=n.length;++i)e[i+10]=n.charCodeAt(i)}}(o,t),My(o,u-8,n.d()),My(o,u-4,i),o}var Uy="undefined"!=typeof TextDecoder&&new TextDecoder;try{Uy.decode(Ry,{stream:!0})}catch(Yb){}function By(){return"undefined"!=typeof window&&"function"==typeof window.fetch}function Fy(){try{return By()&&"keepalive"in new Request("")}catch(e){return!1}}function jy(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("undefined"!=typeof window&&void 0!==window.XMLHttpRequest){var i=new XMLHttpRequest;if(i.open("POST",e,!0),i.withCredentials=!0,n.headers)for(var r=0,a=Object.keys(n.headers);r<a.length;r++){var s=a[r];i.setRequestHeader(s,n.headers[s])}i.send(t)}}function Hy(e){var t=e.body,n=e.keepalive,i=e.headers,r=e.compress;i["content-type"]||(i["content-type"]="text/plain;charset=UTF-8");var a=t;if(r&&"undefined"!=typeof TextEncoder)try{a=Ny((new TextEncoder).encode(t)),i["content-encoding"]="gzip"}catch(e){}return{body:a,keepalive:n,credentials:"include",headers:i,method:"POST",mode:"cors"}}function Vy(e){return e&&"message"in e?e.message:"UNKNOWN_ERROR"}var qy,Wy="undefined"!=typeof navigator&&"sendBeacon"in navigator,zy=Fy()?function(e,t,n,i){return new Promise((function(r){fetch(e,Hy({body:t,keepalive:!0,headers:n,compress:i})).catch((function(){return fetch(e,Hy({body:t,keepalive:!1,headers:n,compress:i}))})).then((function(e){e.ok?r({type:"success",drop:!1,statusCode:e.status}):r({type:"response",drop:!0,statusCode:e.status,rawError:e.statusText})}),(function(e){return r({type:"network",drop:!0,rawError:Vy(e)})}))}))}:function(e,t,n,i){return new Promise((function(r){if(Wy){var a=!1;try{a=navigator.sendBeacon(e,t)}catch(e){}if(a)return void r({type:"unknown",drop:!1})}fetch(e,Hy({body:t,keepalive:!1,headers:n,compress:i})).then((function(e){e.ok?r({type:"success",drop:!1,statusCode:200}):r({type:"response",drop:!0,statusCode:e.status,rawError:e.statusText})}),(function(e){return r({type:"network",drop:!0,rawError:Vy(e)})}))}))};function Gy(e){return new Promise((function(t,n){e.oncomplete=e.onsuccess=function(){return t(e.result)},e.onabort=e.onerror=function(){return n(e.error)}}))}function Ky(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"key",i=arguments.length>3?arguments[3]:void 0,r=indexedDB.open(e);r.onupgradeneeded=function(){try{r.result.createObjectStore(t,{keyPath:n})}catch(e){null==i||i.onError(e)}};var a=new Promise((function(e,t){r.onsuccess=function(){var t=r.result;t.onversionchange=function(){return t.close()},e(t),null==i||i.onSuccess()},r.onerror=function(){t(r.error),null==i||i.onError(r.error)}}));return function(e,n){return a.then((function(i){return n(i.transaction(t,e).objectStore(t))}))}}function Xy(){return qy||(qy=Ky("idb-queue","default")),qy}function Qy(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{maxNumber:1e3,batchEvictionNumber:300},n=0,i=null;return e.openKeyCursor().onsuccess=function(){var r=this.result;r&&n++<t.batchEvictionNumber?(i=r.key,r.continue()):null!=i&&e.delete(IDBKeyRange.upperBound(i))},Gy(e.transaction)}function Yy(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{maxNumber:1e3,batchEvictionNumber:300},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xy();return t("readwrite",(function(t){return Qy(t,e)}))}var $y=!1;function Jy(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{maxNumber:1e3,batchEvictionNumber:300},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Xy();return n("readwrite",(function(n){return n.put(e),Gy(n.count()).then((function(e){if(!(e<=t.maxNumber))return Qy(n,t)}))})).catch((function(e){if(e&&"QuotaExceededError"===e.name)return Yy(t,n)}))}function Zy(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{maxNumber:1e3,batchEvictionNumber:300},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Xy();return $y?Promise.resolve():Jy(e,t,n)}function e_(e,t,n){return t("readwrite",(function(t){var i=[];return t.openCursor(null,n).onsuccess=function(){var t=this.result;t&&(i.push(t.value),t.delete(),(e<0||i.length<e)&&t.continue())},Gy(t.transaction).then((function(){return i}))}))}function t_(e,t,n){return t("readonly",(function(t){var i=[];return t.openCursor(null,n).onsuccess=function(){var t=this.result;t&&(i.push(t.value),(e<0||i.length<e)&&t.continue())},Gy(t.transaction).then((function(){return i}))}))}function n_(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xy();return t_(e,t,"next")}function i_(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xy();return t_(e,t,"prev")}function r_(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;return!t||n<1||(e[t]=JSON.stringify({attempt:n,errorCode:i})),e}function a_(e){"undefined"!=typeof window&&window.__DEBUG_BEACON_TRANSPORTER&&console.debug("[beacon-transporter] ",e())}function s_(e){"undefined"!=typeof window&&window.__DEBUG_BEACON_TRANSPORTER&&console.error("[beacon-transporter] ",e())}function o_(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timeRemaining:5,timeout:1e4};if("undefined"==typeof requestIdleCallback)setTimeout(e,t.fallbackTimeout||10);else{var n=function n(){requestIdleCallback((function(i){i.timeRemaining()>t.timeRemaining||i.didTimeout?e():n()}),{timeout:t.timeout})};n()}}function u_(e,t){var n=0;return{throttledFn:function(){var i=Date.now();i-n>t&&(a_((function(){return"[throttle] Run fn() at "+String(i)})),e(),n=i)},resetThrottle:function(){n=0}}}var l_=function(){function e(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Dv(this,e),Uv(this,"config",void 0),Uv(this,"compress",void 0),Uv(this,"throttleControl",void 0),Uv(this,"withStore",void 0),Uv(this,"disablePersistence",!1),this.config=t,this.compress=i;var r=t.measureIDB;r&&performance.mark(r.createStartMark),this.withStore=Ky(t.idbName,"beacons","timestamp",{onSuccess:function(){r&&performance.measure(r.createSuccessMeasure,r.createStartMark)},onError:function(){r&&performance.measure(r.createFailMeasure,r.createStartMark),n.disablePersistence=!0}}),this.throttleControl=u_(this.replayEntries.bind(this),t.throttleWait)}return Nv(e,[{key:"onNotify",value:function(){this.disablePersistence||this.throttleControl.throttledFn()}},{key:"push",value:function(e){var t=this;if(!this.disablePersistence){var n=function(){a_((function(){return"Persisting to DB "+e.url})),Zy(e,t.config,t.withStore).then((function(){t.throttleControl.resetThrottle(),a_((function(){return"push completed"}))})).catch((function(){t.disablePersistence=!0,s_((function(){return"push failed"}))}))};this.config.useIdle?o_(n):n()}}},{key:"clear",value:function(){var e=this;return this.disablePersistence?Promise.resolve():function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xy();return $y=!0,e("readwrite",(function(e){return e.clear(),Gy(e.transaction).finally((function(){return $y=!1}))}))}(this.withStore).catch((function(){e.disablePersistence=!0,s_((function(){return"clear failed"}))}))}},{key:"peek",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.disablePersistence?Promise.resolve([]):n_(t,this.withStore).catch((function(){return e.disablePersistence=!0,s_((function(){return"peek failed"})),[]}))}},{key:"peekBack",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.disablePersistence?Promise.resolve([]):i_(t,this.withStore).catch((function(){return e.disablePersistence=!0,s_((function(){return"peekBack failed"})),[]}))}},{key:"replayEntries",value:function(){var e=this;if(!this.disablePersistence){var t=function(){a_((function(){return"Replaying entry: shift from store"})),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xy();return e_(e,t,"next")}(1,e.withStore).then((function(t){if(t.length>0){var n,i,r=t[0],a=r.url,s=r.body,o=r.headers,u=r.timestamp,l=r.statusCode,c=r.attemptCount;return a_((function(){return"header: ".concat(String(e.config.headerName),"; attemptCount: ").concat(c)})),null===(n=(i=e.config).onBeforeRetry)||void 0===n||n.call(i,s),zy(a,s,r_(o,e.config.headerName,c,l),e.compress).then((function(t){if("unknown"===t.type||"success"===t.type){var n,i;null===(n=(i=e.config).onResult)||void 0===n||n.call(i,t,s),e.replayEntries()}else{var r,o,d,h,p,f;if(c+1>e.config.attemptLimit)return a_((function(){return"Exceeded attempt count, dropping the entry: "+JSON.stringify({url:a,timestamp:u,statusCode:l},null,2)})),t.drop=!0,void(null===(r=(o=e.config).onResult)||void 0===r||r.call(o,t,s));if("network"===t.type||e.config.statusCodes.includes(t.statusCode))return t.drop=!1,null===(d=(h=e.config).onResult)||void 0===d||d.call(h,t,s),a_((function(){return"Replaying the entry failed, pushing back to IDB: "+JSON.stringify({url:a,timestamp:u,statusCode:l},null,2)})),Zy({url:a,body:s,timestamp:u,statusCode:l,attemptCount:c+1},e.config,e.withStore);t.drop=!0,null===(p=(f=e.config).onResult)||void 0===p||p.call(f,t,s)}}))}})).catch((function(t){e.disablePersistence=!0,t&&t.message&&s_((function(){return"Replay entry failed: ".concat(t.message)}))}))};this.config.useIdle?o_(t):t()}}}]),e}(),c_=function(){function e(){Dv(this,e)}return Nv(e,[{key:"onNotify",value:function(){}},{key:"push",value:function(){}},{key:"clear",value:function(){return Promise.resolve()}},{key:"peek",value:function(){return Promise.resolve([])}},{key:"peekBack",value:function(){return Promise.resolve([])}}]),e}(),d_=function(){function e(t,n){Dv(this,e),Uv(this,"queue",void 0),Uv(this,"beaconListeners",new Set),this.queue=e.hasSupport&&!n.disablePersistenceRetry?new l_(t,n.compress):new c_}return Nv(e,[{key:"pushToQueue",value:function(e){this.queue.push(e)}},{key:"notifyQueue",value:function(){this.queue.onNotify()}},{key:"clearQueue",value:function(){return this.beaconListeners.forEach((function(e){return e()})),this.queue.clear()}},{key:"peekQueue",value:function(e){return this.queue.peek(e)}},{key:"peekBackQueue",value:function(e){return this.queue.peekBack(e)}},{key:"onClear",value:function(e){this.beaconListeners.add(e)}},{key:"removeOnClear",value:function(e){this.beaconListeners.delete(e)}}]),e}();Uv(d_,"hasSupport","undefined"!=typeof globalThis&&!!globalThis.indexedDB);var h_=[502,504],p_=[429,503],f_=function(){function e(t,n,i,r){var a=this,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Dv(this,e),Uv(this,"url",void 0),Uv(this,"body",void 0),Uv(this,"config",void 0),Uv(this,"persistenceConfig",void 0),Uv(this,"compress",void 0),Uv(this,"timestamp",void 0),Uv(this,"isClearQueuePending",!1),Uv(this,"onClearCallback",void 0),this.url=t,this.body=n,this.config=i,this.persistenceConfig=r,this.compress=s,this.timestamp=Date.now(),this.onClearCallback=function(){return a.isClearQueuePending=!0}}return Nv(e,[{key:"send",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.persistenceConfig.db.onClear(this.onClearCallback);var n=this.retryLimit;return this.retry((function(t){return zy(e.url,e.body,t,e.compress)}),n,t).finally((function(){a_((function(){return"beacon finished"})),e.persistenceConfig.db.removeOnClear(e.onClearCallback)}))}},{key:"retryLimit",get:function(){return this.config.attemptLimit}},{key:"getAttemptCount",value:function(e){return this.retryLimit-e+1}},{key:"retry",value:function(e,t,n,i){var r=this,a=this.getAttemptCount(t)-1;return e(r_(n,this.config.headerName,a,i)).then((function(i){var a,s,o,u;if(i.drop=!1,"unknown"===i.type||"success"===i.type)r.isClearQueuePending||r.persistenceConfig.disabled||r.persistenceConfig.db.notifyQueue(),o=i;else if(a_((function(){return"retry rejected "+JSON.stringify(i)})),r.shouldPersist(t,i))r.persistenceConfig.db.pushToQueue({url:r.url,body:r.body,headers:n,statusCode:i.statusCode,timestamp:r.timestamp,attemptCount:r.getAttemptCount(t)}),o={type:"persisted",drop:!1,statusCode:i.statusCode};else{if(t>0&&r.isRetryableError(i)){var l,c;null===(l=(c=r.config).onIntermediateResult)||void 0===l||l.call(c,i,r.body);var d=r.config.calculateRetryDelay(r.getAttemptCount(t),t);return a_((function(){return"in memory retry in ".concat(d,"ms")})),(u=d,new Promise((function(e){return setTimeout(e,u)}))).then((function(){return r.retry(e,t-1,n,i.statusCode)}))}(o=i).drop=!0}return null===(a=(s=r.config).onIntermediateResult)||void 0===a||a.call(s,o,r.body),o}))}},{key:"isRetryableError",value:function(e){return!("network"!==e.type&&!this.config.statusCodes.includes(e.statusCode))}},{key:"shouldPersist",value:function(e,t){return!(this.isClearQueuePending||this.persistenceConfig.disabled||navigator.onLine&&(0!==e||"network"!==t.type)&&("response"!==t.type||!this.persistenceConfig.statusCodes.includes(t.statusCode)))}}]),e}(),m_=null;if(("undefined"==typeof crypto||!crypto.getRandomValues)&&"undefined"!=typeof require){var g_=("undefined"!=typeof FastBoot?FastBoot.require:"function"==typeof __webpack_require__?__non_webpack_require__:require)("crypto");if(g_){var v_=new Uint8Array(256),y_=v_.length;m_={rng:function(){return y_>v_.length-16&&(g_.randomFillSync(v_),y_=0),v_.slice(y_,y_+=16)}}}}"object"===("undefined"==typeof crypto?"undefined":Rv(crypto))&&crypto.randomUUID;function __(){return ty(m_,new Array(16),0)}function b_(e){return Av(e).map((function(e){return String.fromCharCode(e)})).join("")}function T_(){return b_(__())}var k_=/^[a-zA-Z0-9/+]+[=]+$/;function S_(e,t){return{pageUrn:C_(e),trackingId:t||function(e){for(var t,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=[],r=0,a=e.length,s=a%3,o=a-s;r<o;)t=e[r]<<16,t|=e[r+1]<<8,t|=e[r+2],i.push(n.charAt(t>>>18&63)),i.push(n.charAt(t>>>12&63)),i.push(n.charAt(t>>>6&63)),i.push(n.charAt(63&t)),r+=3;switch(s){case 2:t=e[r]<<16,t|=e[r+1]<<8,i.push(n.charAt(t>>>18&63)),i.push(n.charAt(t>>>12&63)),i.push(n.charAt(t>>>6&63)),i.push("=");break;case 1:t=e[r]<<16,i.push(n.charAt(t>>>18&63)),i.push(n.charAt(t>>>12&63)),i.push("="),i.push("=")}return i.join("")}(__())}}function E_(e,t){return"urn:li:control:".concat(e,"-").concat(t)}function C_(e){return"urn:li:page:".concat(e)}function w_(e,t){return{pageInstance:t.assign({},e.pageInstance),pageKey:e.pageKey,applicationInstance:e.applicationInstance}}function I_(e,t){return void 0!==t.allSettled?t.allSettled(e):function(e){return new Promise((function(t){var n=new Set,i=function(e){n.delete(e),0===n.size&&t()};0===e.length?t():e.map((function(e){return e.then((function(){return i(e)})).catch((function(){return i(e)}))}))}))}(e)}function P_(e){var t=[];return e.forEach((function(e){return t.push(e)})),t}function x_(e,t,n){if("undefined"!=typeof window&&window.indexedDB){var i="sequenceNumber",r=window.indexedDB.open(i);return new Promise((function(a,s){r.onupgradeneeded=function(){var e=r.result;e.objectStoreNames.contains(i)||e.createObjectStore(i,{autoIncrement:!0})},r.onsuccess=function(){var o=r.result,u=o.transaction(i,"readwrite"),l=u.objectStore(i),c=l.get(1);c.onsuccess=function(){var i=c.result;if(i){if("read"===e)return a(i);if("update"!==e)return a(null);var r,o=Object.assign({},i),u=!1,d=null!==(r=o.sequenceNumber)&&void 0!==r?r:0;if(void 0!==t&&t>d&&(o.sequenceNumber=t,u=!0),n&&Object.keys(n).forEach((function(e){var t,i=null!==(t=o[e])&&void 0!==t?t:0,r=n[e];r>i&&(o[e]=r,u=!0)})),u){var h=l.put(o,1);h.onsuccess=function(){return a(null)},h.onerror=function(){s(h.error)}}}else{var p={sequenceNumber:0};n&&Object.keys(n).forEach((function(e){p[e]=0}));var f=l.add(p);f.onsuccess=function(){return a(0)},f.onerror=function(){s(f.error)}}},c.onerror=function(){return o.close(),s(new Error("Error: get sequence number from indexedDB ".concat(String(c.error))))},u.oncomplete=function(){return o.close()}},r.onerror=function(){return a(null)}}))}return Promise.resolve(null)}function A_(){return"undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>-1||!By()||"undefined"==typeof Promise}function O_(e,t,n){var i=e.get(t);i&&i.push(n)||e.set(t,[n])}function L_(e,t,n){var i=e.get(t);i&&i.splice(i.indexOf(n)>>>0,1)}var R_,D_,M_=(R_=new Map,D_=new Map,{on:function(e,t){O_(R_,e,t)},before:function(e,t){O_(D_,e,t)},off:function(e,t){L_(R_,e,t)},offBefore:function(e,t){L_(D_,e,t)},emit:function(e,t){(D_.get(e)||[]).concat(R_.get(e)||[]).slice().map((function(e){e(t)}))},clear:function(){D_.clear(),R_.clear()}});if("undefined"!=typeof document&&"undefined"!=typeof window){var N_=function(e){"pagehide"!==e.type&&"hidden"!==document.visibilityState||M_.emit("internal:hide",e)};document.addEventListener("visibilitychange",N_),window.addEventListener("pagehide",N_)}function U_(){if("undefined"==typeof Promise||"undefined"==typeof navigator)return!1;var e=navigator.userAgent.indexOf("Chrome")>-1,t=navigator.cookieEnabled,n=navigator.storage;return e&&Fy()&&t&&n}function B_(e,t,n,i,r){"control"!==i&&e.retryConfig&&U_()&&navigator.storage.estimate().then((function(a){if(!((a.quota||0)-(a.usage||0)>52428800))return function(e){var t=window.indexedDB.deleteDatabase(e);return new Promise((function(e,n){t.onsuccess=function(){return e()},t.onerror=function(){return n(t.error)}}))}("beacons");var s,o,u=null!==(s=e.retryConfig.inMemory)&&void 0!==s?s:{attemptLimit:4,statusCodes:[502,504]},l=null!==(o=e.retryConfig.persist)&&void 0!==o?o:{attemptLimit:3,statusCodes:[429,503],maxNumber:1e3,batchEvictionNumber:300,throttleWait:3e5},c={compress:n,inMemoryRetry:{onIntermediateResult:null==r?void 0:r.onIntermediateResult,attemptLimit:u.attemptLimit,statusCodes:u.statusCodes,headerName:"x-li-retry-context",calculateRetryDelay:function(e){return function(e){return 1e3*Math.pow(2,e)}(e)}},disablePersistenceRetry:e.retryConfig.disablePersistence,persistenceRetry:{onBeforeRetry:null==r?void 0:r.onBeforeRetry,onResult:null==r?void 0:r.onResult,idbName:"beacons",attemptLimit:l.attemptLimit,statusCodes:l.statusCodes,maxNumber:l.maxNumber,batchEvictionNumber:l.batchEvictionNumber,throttleWait:l.throttleWait,useIdle:!0,measureIDB:{createStartMark:"idb_open_start",createSuccessMeasure:"idb_open_success_phase",createFailMeasure:"idb_open_fail_phase"}}},d=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Boolean(t.compress),i=Object.assign({attemptLimit:0,statusCodes:h_,calculateRetryDelay:function(e,t){return 2e3*t}},t.inMemoryRetry);if(t.retryDB)e=t.retryDB;else{var r=Object.assign({idbName:"beacon-transporter",attemptLimit:3,statusCodes:p_,maxNumber:1e3,batchEvictionNumber:300,throttleWait:3e5},t.persistenceRetry);r.headerName=r.headerName||i.headerName,e=new d_(r,{compress:t.compress,disablePersistenceRetry:t.disablePersistenceRetry})}return{beacon:function(r,a,s){var o;return By()?new f_(r,a,i,{db:e,disabled:Boolean(t.disablePersistenceRetry),statusCodes:(null===(o=t.persistenceRetry)||void 0===o?void 0:o.statusCodes)||p_},n).send(s):Promise.resolve({type:"unknown",drop:!0})},database:e}}(c),h=d.beacon,p=d.database;return e.retryBeacon={shouldRetry:!0,beacon:h,database:p},"enabled"===i?(e.retryBeacon.shouldRetry=!1,!c.disablePersistenceRetry&&t.shouldAnonymizeMemberId()?p.peekQueue(1).then((function(e){if(Array.isArray(e)&&e[0]){var t=JSON.parse(e[0].body);if(Array.isArray(t)&&t.some((function(e){return!e.eventInfo.shouldAnonymizeMemberId})))return p.clearQueue()}}),(function(){return p.clearQueue()})).then((function(){e.retryBeacon.shouldRetry=!0})).catch((function(e){M_.emit("internal:error",{tags:["core-web-tracking:retry:idb"],reason:e})})):(e.retryBeacon.shouldRetry=!0,Promise.resolve())):void 0})).catch((function(e){M_.emit("internal:error",{tags:["core-web-tracking:retry:setup"],reason:e})}))}var F_=function(){function e(t){Dv(this,e),Uv(this,"host",void 0),this.host=t}return Nv(e,[{key:"checkAndEnablePersistentRetry",value:function(e,t){if("function"==typeof(null==e?void 0:e.shouldAnonymizeMemberId)&&!this.host.retryBeacon){var n=this.getRetryTreatment();this.host.retryConfig&&B_(this.host,e,this.shouldCompressPayload(),n,t)}}},{key:"clearPersistedEventsOnLogout",value:function(){var e=this.host.retryBeacon;if(e&&e.shouldRetry)return e.shouldRetry=!1,e.database.clearQueue().catch((function(e){M_.emit("internal:error",{tags:["core-web-tracking:retry:logout"],reason:e})}))}},{key:"sendPayload",value:function(e,t,n,i){var r,a=this.getRetryTreatment();Fy()&&"control"!==a&&null!==(r=this.host.retryBeacon)&&void 0!==r&&r.shouldRetry?this.sendPayloadWithRetry(e,t,n):this.sendPayloadFireForget(e,t,n,i)}},{key:"sendPayloadWithRetry",value:function(e,t,n){(!Array.isArray(t)||t.length>0)&&this.host.retryBeacon.beacon(e,JSON.stringify(t),n).catch((function(e){M_.emit("internal:error",{tags:["core-web-tracking:retry:beacon"],reason:e})}))}},{key:"sendPayloadFireForget",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;(!Array.isArray(t)||t.length>0)&&(A_()?jy(e,JSON.stringify(t),{headers:n}):zy(e,JSON.stringify(t),n,this.shouldCompressPayload()).then((function(e){null==i||i.onResult(e,t)}),(function(){})))}},{key:"getRetryTreatment",value:function(){var e,t,n;if(!this.host.retryConfig)return"control";var i=this.host.retryConfig.lixKey;return i?null!==(e=null===(t=(n=this.host).__getLixTreatment)||void 0===t?void 0:t.call(n,i))&&void 0!==e?e:"control":"enabled"}},{key:"shouldCompressPayload",value:function(){return!0!==this.host.disableCompression}},{key:"isBrowserPersistentRetryEnabled",value:function(){var e,t;return"control"!==this.getRetryTreatment()&&null!==(e=null===(t=this.host.retryBeacon)||void 0===t?void 0:t.shouldRetry)&&void 0!==e&&e&&U_()&&"undefined"!=typeof globalThis&&!!globalThis.indexedDB}}]),e}(),j_="undefined"!=typeof window&&"undefined"!=typeof document,H_=/JSESSIONID="?([^";]+)"?/,V_="",q_=0;function W_(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.cacheLifeSpan,n=void 0===t?1e4:t,i=e.regex,r=void 0===i?H_:i;if(!V_||Date.now()-q_>n){var a=j_&&document.cookie.match(r);V_=a&&a[1]||"",q_=Date.now()}return V_}var z_=function(){function e(t){Dv(this,e),Uv(this,"networkTransporter",void 0),Uv(this,"inactive",void 0),Uv(this,"mpName",void 0),Uv(this,"endpoint",void 0),Uv(this,"debug",void 0),this.networkTransporter=new F_(t),this.mpName=t.appId,this.inactive=t.inactive;var n=function(e){var t,n=!1;switch(e){case"https://www.linkedin.com/li/track":t=K_;break;case"https://www.linkedin-ei.com/li/track/validate":n=!0,t=G_;break;case"https://www.linkedin-ei.com/li/track":t=G_;break;default:n=!0,t=G_}return{endpoint:t,debug:n}}(t.endpoint);this.endpoint=n.endpoint,this.debug=n.debug}return Nv(e,[{key:"fireFragment",value:function(e){var t;if(!this.inactive){var n={"content-type":"application/json; charset=UTF-8","x-li-track":JSON.stringify({mpName:this.mpName}),"csrf-token":W_(),"x-restli-protocol-version":"2.0.0"},i=[],r=null!==(t=null==e?void 0:e.stats)&&void 0!==t?t:{},a=r.failures,s=r.previousInstanceEventStats.reduce((function(e,t){return e.push.apply(e,Av(t.failures)),e}),[]);[].concat(Av(a),Av(s)).forEach((function(e){var t=e.reason,n=e.rawError,r=e.eventTopic,a=e.header,s=e.requestHeader;i.push({reason:t,rawError:n,failedTopicName:r,header:a,requestHeader:s})}));var o={clientTrackingFailures:i,debug:this.debug};this.networkTransporter.sendPayload(this.endpoint,o,n)}}}]),e}(),G_="https://www.linkedin-ei.com/trackingMonitoring/?action=reportClientFailures",K_="https://www.linkedin.com/trackingMonitoring/?action=reportClientFailures";function X_(e){return"string"==typeof e}function Q_(e){return X_(e)?e:e.topicName||e.eventName}function Y_(e){return X_(e)?e:e.eventName}var $_,J_,Z_=function(){function e(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Dv(this,e),Uv(this,"host",void 0),Uv(this,"cmoTransporter",void 0),Uv(this,"clientMonitoringInstanceId",T_()),Uv(this,"currentContext",nb()),Uv(this,"appState",{}),Uv(this,"estimatedFragmentSize",0),Uv(this,"fragmentSizeLimit",void 0),Uv(this,"activeFragmentEvent",void 0),Uv(this,"debounceTimer",void 0),this.host=t,this.cmoTransporter=i.cmoTransporter||new z_(t),this.fragmentSizeLimit=(null===(n=t.clientMonitoringConfig)||void 0===n?void 0:n.fragmentSizeLimit)||10240,this.activeFragmentEvent=tb(this.clientMonitoringInstanceId,0,0,!1,this.getEventHeaders())}return Nv(e,[{key:"getCurrentInstanceId",value:function(){return this.clientMonitoringInstanceId}},{key:"scheduleDebouncedFiring",value:function(){var e,t,n=this;void 0!==this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=void 0),this.fragmentIsFull()&&this.fireFragmentEventIfFull(!0),this.debounceTimer=setTimeout((function(){n.fireFragmentEventIfFull()}),null!==(e=null===(t=this.host.batching)||void 0===t?void 0:t.debounceTime)&&void 0!==e?e:1)}},{key:"logEventGenerated",value:function(e){this.scheduleDebouncedFiring();var t=this.activeFragmentEvent.stats,n=this.activeFragmentEvent.firstEventNumber+t.eventsGenerated;return t.eventTopics.push(e),t.eventsGenerated++,this.estimatedFragmentSize+=e.length,n}},{key:"logEventReadyToSend",value:function(e){this.activeFragmentEvent.stats.eventsReadyToSend+=e}},{key:"logEventSent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getCurrentInstanceId();t===this.getCurrentInstanceId()?this.activeFragmentEvent.stats.eventsSent+=e:this.findPreviousInstanceStat(t,(function(t){t.eventsSent+=e}))}},{key:"logNetworkResponseCode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getCurrentInstanceId(),n=this.activeFragmentEvent.stats.networkResponseStats;t!==this.getCurrentInstanceId()&&this.findPreviousInstanceStat(t,(function(e){n=e.networkResponseStats})),e>=200&&e<300?n.eventsWith2XXResponse++:400===e?n.eventsWith400Response++:408===e?n.eventsWith408Response++:429===e?n.eventsWith429Response++:e>400&&e<500?n.eventsWith4XXResponse++:500===e?n.eventsWith500Response++:502===e?n.eventsWith502Response++:503===e?n.eventsWith503Response++:504===e?n.eventsWith504Response++:e>500&&e<600&&n.eventsWith5XXResponse++}},{key:"findPreviousInstanceStat",value:function(e,t){var n,i=xv(this.activeFragmentEvent.stats.previousInstanceEventStats);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(r.instanceId===e)return void t(r)}}catch(e){i.e(e)}finally{i.f()}var a=this.getEventHeaders(),s=a.header,o=a.requestHeader,u={header:Object.assign(s,{memberId:-1}),requestHeader:o,instanceId:e,eventsSent:0,eventTopics:[],networkResponseStats:{eventsWith2XXResponse:0,eventsWith400Response:0,eventsWith408Response:0,eventsWith429Response:0,eventsWith4XXResponse:0,eventsWith500Response:0,eventsWith502Response:0,eventsWith503Response:0,eventsWith504Response:0,eventsWith5XXResponse:0},failures:[]};t(u),this.activeFragmentEvent.stats.previousInstanceEventStats.push(u)}},{key:"logFailedEvent",value:function(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.getCurrentInstanceId(),a=this.getEventHeaders(),s=a.header,o=a.requestHeader,u={header:Object.assign(s,{memberId:-1}),requestHeader:o,instanceId:r,instanceEventNumber:i,reason:e,rawError:n,eventName:Y_(t),eventTopic:Q_(t)};this.estimatedFragmentSize+=JSON.stringify(u).length,r===this.getCurrentInstanceId()?this.activeFragmentEvent.stats.failures.push(u):this.findPreviousInstanceStat(r,(function(e){e.failures.push(u)})),this.fireFragmentEventIfFull()}},{key:"flush",value:function(){this.activeFragmentEvent.isLastFragment=!0,this.fireFragmentEventIfFull(!0)}},{key:"fragmentIsFull",value:function(){return this.activeFragmentEvent.stats.eventsGenerated>=100||this.estimatedFragmentSize>=this.fragmentSizeLimit}},{key:"fireFragmentEventIfFull",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||this.fragmentIsFull()){this.debounceTimer=void 0;var t=this.getEventHeaders(),n=t.header,i=t.requestHeader,r=this.activeFragmentEvent;r.header=n,r.requestHeader=i,this.cmoTransporter.fireFragment(r),this.estimatedFragmentSize=0,this.activeFragmentEvent=tb(this.clientMonitoringInstanceId,r.fragmentNumber+1,r.firstEventNumber+r.stats.eventsGenerated,!1,t)}}},{key:"setCurrentContext",value:function(e){this.currentContext=e}},{key:"updateAppState",value:function(e){this.host.api.assign(this.appState,e)}},{key:"getEventHeaders",value:function(){var e=void 0;this.appState.clientApplicationInstance&&((e=this.appState.clientApplicationInstance).trackingId=ib(e.trackingId));var t=this.currentContext.pageInstance;return t.trackingId=ib(t.trackingId),{requestHeader:{interfaceLocale:this.host.locale,pageKey:this.currentContext.pageKey,path:this.host.api.location.pathname+this.host.api.location.search,referer:this.host.api.document.referrer},header:{applicationViewerUrn:this.appState.applicationViewerUrn,clientApplicationInstance:e,pageInstance:t,time:Date.now(),version:this.host.appVersion,server:"",service:"",guid:T_(),memberId:0}}}}]),e}();function eb(e){return $_||($_=new Z_(e)),{getCurrentInstanceId:function(){return $_.getCurrentInstanceId()},logEventGenerated:function(e){return $_.logEventGenerated(e)},logEventReadyToSend:function(e){$_.logEventReadyToSend(e)},logEventSent:function(e){$_.logEventSent(e)},logPersistedEventSent:function(e,t){$_.logEventSent(t,e)},logNetworkResponseCode:function(e){$_.logNetworkResponseCode(e)},logPersistedNetworkResponseCode:function(e,t){var n;null===(n=$_)||void 0===n||n.logNetworkResponseCode(t,e)},logFailedEvent:function(e,t,n,i){$_.logFailedEvent(e,t,n,i)},logPersistedFailedEvent:function(e,t,n,i,r){$_.logFailedEvent(t,n,i,r,e)},flush:function(){$_.flush()},destroy:function(){$_=void 0},isDestroyed:function(){return void 0===$_},setCurrentContext:function(e){$_.setCurrentContext(e)},updateAppState:function(e){$_.updateAppState(e)}}}function tb(e,t,n,i,r){return{fragmentNumber:t,firstEventNumber:n,isLastFragment:i,stats:{instanceId:e,eventsGenerated:0,eventsReadyToSend:0,eventsSent:0,networkResponseStats:{eventsWith2XXResponse:0,eventsWith400Response:0,eventsWith408Response:0,eventsWith429Response:0,eventsWith4XXResponse:0,eventsWith500Response:0,eventsWith502Response:0,eventsWith503Response:0,eventsWith504Response:0,eventsWith5XXResponse:0},eventTopics:[],failures:[],previousInstanceEventStats:[]},requestHeader:r.requestHeader,header:r.header}}function nb(){return{pageKey:"unknown",pageInstance:S_("unknown")}}function ib(e){return Array.isArray(e)?b_(e):16===e.length?e:function(e){return"string"==typeof e&&!!e.match(k_)}(e)?atob(e):b_(function(e){return Gv(e)}(e))}!function(e){e.NONE="NONE",e.UNKNOWN_EXECUTION_ERROR="UNKNOWN_EXECUTION_ERROR",e.MISSING_REQUIRED_PROPERTIES="MISSING_REQUIRED_PROPERITES",e.STORAGE_WRITE_FAILURE="STORAGE_WRITE_FAILURE",e.RETRIES_EXCEEDED="RETRIES_EXCEEDED",e.EVENT_EVICTED_FROM_STORAGE="EVENT_EVICTED_FROM_STORAGE",e.STORAGE_UNAVAILABLE="STORAGE_UNAVAILABLE",e.SERIALIZATION_FAILURE="SERIALIZATION_FAILURE"}(J_||(J_={}));var rb=["PageViewEvent","SponsoredImpressionEvent","JobViewEvent"],ab="PageViewEvent",sb=function(){function e(t){var n=this;Dv(this,e),Uv(this,"host",void 0),Uv(this,"queue",void 0),Uv(this,"preContextQueue",void 0),Uv(this,"debounceTimer",void 0),Uv(this,"unloadHandlers",void 0),Uv(this,"maxQueueSize",void 0),Uv(this,"flushDebounceTime",void 0),Uv(this,"trackingEventListeners",[]),Uv(this,"onHideHandler",(function(){n.forceFlush()})),Uv(this,"networkTransporter",void 0),Uv(this,"clientMonitoringConn",void 0),Uv(this,"clientGlobalSequenceNumberCounter",void 0),Uv(this,"clientTopicLocalSequenceNumberCountersMap",{}),Uv(this,"isTimerRunning",void 0),Uv(this,"enableSequenceNumberLix",void 0),this.host=t,this.queue=[],this.preContextQueue=[],this.unloadHandlers=[];var i=t.batching;this.maxQueueSize=i&&i.maxSize||1,this.flushDebounceTime=i&&i.debounceTime||0,M_.on("internal:hide",this.onHideHandler),this.networkTransporter=new F_(t),this.isLixEnabled("pemberly.tracking.monitoring")&&t.clientMonitoringConfig&&!t.inactive&&(this.clientMonitoringConn=eb(t)),this.enableSequenceNumberLix=this.isLixEnabled("tracking.data-loss-web.sequence-number"),this.enableSequenceNumberLix&&(this.getSequenceNumberFromIDB(),this.updateSequenceNumberOnExit(),this.isTimerRunning=!1)}return Nv(e,[{key:"checkAndEnablePersistentRetry",value:function(e){var t,n=(t=this.clientMonitoringConn,{onIntermediateResult:function(e,n){var i;if(t&&!t.isDestroyed())try{if(i=JSON.parse(n),!Array.isArray(i)||0===i.length)return;e.statusCode&&t.logNetworkResponseCode(e.statusCode),!0===e.drop&&i.forEach((function(n){var i,r=n.eventInfo.eventName,a=n.eventInfo.topicName||r,s="rawError"in e?e.rawError:"null",o=["type: ".concat(e.type),"statusCode: ".concat(e.statusCode||"null"),"drop: ".concat(String(e.drop)),"rawError: ".concat(s)].join(", ");t.logFailedEvent(J_.UNKNOWN_EXECUTION_ERROR,{eventName:r,topicName:a},o,null!==(i=n.eventBody.header.clientMonitoringInstanceEventNumber)&&void 0!==i?i:-1)}))}catch(e){}},onBeforeRetry:function(e){var n;if(t&&!t.isDestroyed())try{if(n=JSON.parse(e),!Array.isArray(n)||0===n.length||!n[0].eventBody.header.clientMonitoringInstanceId)return;var i=n[0].eventBody.header.clientMonitoringInstanceId,r=n.length;t.logPersistedEventSent(i,r)}catch(e){}},onResult:function(e,n){var i;if(t)try{if(i=JSON.parse(n),!Array.isArray(i)||0===i.length||!i[0].eventBody.header.clientMonitoringInstanceId)return;var r=i[0].eventBody.header.clientMonitoringInstanceId;e.statusCode&&t.logPersistedNetworkResponseCode(r,e.statusCode),!0===e.drop&&i.forEach((function(n){var i=n.eventInfo.eventName,a=n.eventInfo.topicName||i,s="rawError"in e?e.rawError:"null",o=["type: ".concat(e.type),"statusCode: ".concat(e.statusCode||"null"),"drop: ".concat(String(e.drop)),"rawError: ".concat(s)].join(", ");t.logPersistedFailedEvent(r,J_.UNKNOWN_EXECUTION_ERROR,{eventName:i,topicName:a},o,n.eventBody.header.clientMonitoringInstanceEventNumber)}))}catch(e){}}});this.networkTransporter.checkAndEnablePersistentRetry(e,n)}},{key:"clearPersistedEventsOnLogout",value:function(){return this.networkTransporter.clearPersistedEventsOnLogout()}},{key:"on",value:function(e){this.trackingEventListeners.push(e)}},{key:"fireEvent",value:function(e){var t=function(e){return e.meta.time=Date.now(),e}(e);this.clientMonitoringConn&&(t.meta.clientMonitoringInstanceId=this.clientMonitoringConn.getCurrentInstanceId(),t.meta.clientMonitoringInstanceEventNumber=this.clientMonitoringConn.logEventGenerated(Q_(e.id)));var n,i=this.host,r=i.api.Promise,a=i.batching;return function(e){return!!e.meta.context}(t)?(this.prepareCompleteEnvelopeQueue(t),null===(n=this.clientMonitoringConn)||void 0===n||n.logEventReadyToSend(1),a?(this.batchFire(),r.resolve(!0)):(this.flush(!0),r.resolve(!0))):(this.preContextQueue.push(t),r.resolve(!0))}},{key:"callOnDestroy",value:function(e){this.unloadHandlers.push(e)}},{key:"destroy",value:function(){this.unloadHandlers.forEach((function(e){return e()})),this.forceFlush(),this.trackingEventListeners=[],this.clientMonitoringConn=void 0,M_.off("internal:hide",this.onHideHandler)}},{key:"forceFlush",value:function(){var e=this;this.populatePreContextQueue({pageInstance:S_("unknown"),pageKey:"unknown"}).forEach((function(t){return e.queue.push(t)})),this.flush(!0)}},{key:"isLixEnabled",value:function(e){var t,n;return"enabled"===(null===(t=(n=this.host).__getLixTreatment)||void 0===t?void 0:t.call(n,e))}},{key:"getSequenceNumberFromIDB",value:function(){var e=this;x_("read").then((function(t){var n;e.clientGlobalSequenceNumberCounter=null!==(n=null==t?void 0:t.sequenceNumber)&&void 0!==n?n:0,rb.forEach((function(n){var i;e.clientTopicLocalSequenceNumberCountersMap[n]=null!==(i=null==t?void 0:t[n])&&void 0!==i?i:0}))})).catch((function(e){M_.emit("internal:error",{tags:["core-web-tracking:sequence-number:idb-read"],reason:e})}))}},{key:"updateSequenceNumberToIDB",value:function(){x_("update",this.clientGlobalSequenceNumberCounter,this.clientTopicLocalSequenceNumberCountersMap).catch((function(e){M_.emit("internal:error",{tags:["core-web-tracking:sequence-number:idb-update"],reason:e})}))}},{key:"updateSequenceNumberOnExit",value:function(){var e=this;"undefined"!=typeof window&&"undefined"!=typeof document&&window.addEventListener("beforeunload",(function t(){e.updateSequenceNumberToIDB(),window.removeEventListener("beforeunload",t)}))}},{key:"prepareCompleteEnvelopeQueue",value:function(e){var t=this,n=e.meta.context=w_(e.meta.context,this.host.api);"function"==typeof e.body&&(e.body=e.body(n)),this.preContextQueue.length>0&&this.populatePreContextQueue(n).forEach((function(e){return t.queue.push(e)})),this.queue.push(e)}},{key:"envelop",value:function(e,t,n){var i=this.host,r=i.appId,a=i.api,s={eventBody:t,eventInfo:"string"==typeof e?{appId:r,eventName:e,topicName:e}:a.assign({appId:r},e)};return n.length>0&&this.host.api.assign(s,{clientBreadcrumbs:n}),s}},{key:"getBreadcrumbs",value:function(e){return e.clientBreadcrumbs||[]}},{key:"getGenericEventBody",value:function(e){var t,n=this.host,i=n.appVersion,r=n.locale,a=n.api,s=a.location,o=a.document,u=a.assign,l=e.meta.context,c=l.pageKey,d=l.pageInstance,h=function(e){return"string"==typeof e?e===ab:e.eventName===ab}(e.id)&&(null===(t=e.body.requestHeader)||void 0===t?void 0:t.pageKey)||c,p=null;"string"!=typeof r&&null!==this.host.locale||(p=r);var f={interfaceLocale:p,pageKey:h,path:s.pathname+s.search,referer:o.referrer,isFlushOnCloseBrowserTabEnabled:!A_()&&(Fy()||"undefined"!=typeof navigator&&"sendBeacon"in navigator),isBrowserPersistentRetryEnabled:this.networkTransporter.isBrowserPersistentRetryEnabled()},m={pageInstance:d,time:e.meta.time,version:i,server:"",service:"",guid:T_(),memberId:0};"number"==typeof this.clientGlobalSequenceNumberCounter&&u(m,{clientGlobalSequenceNumber:this.clientGlobalSequenceNumberCounter});var g=Q_(e.id);if(rb.includes(g)){var v=this.clientTopicLocalSequenceNumberCountersMap[g];"number"==typeof v&&u(m,{clientTopicLocalSequenceNumber:v})}var y={header:u(m,e.meta.header||{}),requestHeader:u(f,e.meta.requestHeader||{})},_=e.meta.clientMonitoringInstanceId,b=e.meta.clientMonitoringInstanceEventNumber;return _&&u(y.header,{clientMonitoringInstanceId:_,clientMonitoringInstanceEventNumber:b}),u(e.body,y)}},{key:"populatePreContextQueue",value:function(e){var t,n=this.preContextQueue;return this.preContextQueue=[],null===(t=this.clientMonitoringConn)||void 0===t||t.logEventReadyToSend(n.length),n.map((function(t){return t.meta.context=e,"function"==typeof t.body&&(t.body=t.body(e)),t}))}},{key:"trigger",value:function(e,t){this.trackingEventListeners.forEach((function(n){return n(e,t)}))}},{key:"requestFlush",value:function(e){var t=this;e((function(){t.forceFlush()}),{timeout:1e4})}},{key:"flush",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.host.api.requestIdleCallback;e||!t?this.sendPayload():this.requestFlush(t)}},{key:"batchFire",value:function(){var e=this;this.queue.length>this.maxQueueSize?this.flush():(this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout((function(){return e.flush()}),this.flushDebounceTime))}},{key:"sendPayload",value:function(){var e=this,t=this.queue;if(0!==t.length){this.enableSequenceNumberLix&&"undefined"!=typeof window&&!1===this.isTimerRunning&&(this.isTimerRunning=!0,setInterval((function(){e.updateSequenceNumberToIDB()}),5e3)),this.queue=[];var n,i,r=[],a=[];t.forEach((function(t){var n=e.getGenericEventBody(t),i=e.getBreadcrumbs(t),s=e.envelop(t.id,n,i);e.trigger(s,t.meta);var o=s.eventInfo.eventName;if("LixTreatmentsEvent"===o||"JavaScriptErrorEvent"===o?r.push(s):a.push(s),e.enableSequenceNumberLix){"number"==typeof e.clientGlobalSequenceNumberCounter&&e.clientGlobalSequenceNumberCounter++;var u=Q_(t.id);rb.includes(u)&&"number"==typeof e.clientTopicLocalSequenceNumberCountersMap[u]&&e.clientTopicLocalSequenceNumberCountersMap[u]++}})),this.host.inactive||(this.clientMonitoringConn&&(this.clientMonitoringConn.logEventSent(r.length+a.length),i=this.clientMonitoringConn,n={onResult:function(e,t){i&&!i.isDestroyed()&&(e.statusCode&&i.logNetworkResponseCode(e.statusCode),!0===e.drop&&t.forEach((function(t){var n=t.eventInfo.eventName,r=t.eventInfo.topicName||n,a="rawError"in e?e.rawError:"null",s=["type: ".concat(e.type),"statusCode: ".concat(e.statusCode||"null"),"drop: ".concat(String(e.drop)),"rawError: ".concat(a)].join(", ");null==i||i.logFailedEvent(J_.UNKNOWN_EXECUTION_ERROR,{eventName:n,topicName:r},s,t.eventBody.header.clientMonitoringInstanceEventNumber||-1)})))}}),this.networkTransporter.sendPayloadFireForget(this.host.endpoint,r,void 0,n),this.networkTransporter.sendPayload(this.host.endpoint,a,void 0,n))}}}]),e}();var ob,ub=function(){function e(t,n){Dv(this,e),this.clientBreadcrumbType=t,this.id=n}return Nv(e,[{key:"builder",get:function(){return function(){var e={},t=new Proxy({},{get:function(n,i){return"build"===i?function(){return e}:function(n){return e[i.toString()]=n,t}}});return t}().id(this.id).clientBreadcrumbType(this.clientBreadcrumbType)}}],[{key:"toPointer",value:function(e){return{id:e.id,type:e.clientBreadcrumbType}}}]),e}();function lb(e){if(!e)return{};var t=e.trk,n=!1,i=e.licu&&decodeURIComponent(e.licu);e.external_control&&(i="urn:li:externalControl:".concat(decodeURIComponent(e.external_control)),n=!0);var r,a=e.lipi&&function(e){var t=decodeURIComponent(e).split(";");if(t.length>1)return{pageUrn:t[0],trackingId:t[1]}}(e.lipi);if(a?r={pageInstance:a,pageKey:t}:t&&(r={pageKey:t}),e.external_page&&e.external_page_instance){var s=decodeURIComponent(e.external_page);r={pageInstance:{pageUrn:"urn:li:externalPage:".concat(s),trackingId:e.external_page_instance},pageKey:s},n=!0}var o=e.external_app&&e.external_app_instance?{applicationUrn:"urn:li:externalApplication:".concat(decodeURIComponent(e.external_app)),trackingId:e.external_app_instance,version:""}:void 0;return o&&((r=r||{}).applicationInstance=o),{fromExternalApp:n||!!o,previousApplicationInstance:o,previousContext:r,previousControlId:e.lici&&decodeURIComponent(e.lici),previousControlUrn:i}}function cb(e){return"retryConfig"in e.host}!function(e){e.UNKNOWN="UNKNOWN",e.ME_NOTIFICATION="ME_NOTIFICATION",e.ME_NOTIFICATION_ACTION="ME_NOTIFICATION_ACTION"}(ob||(ob={}));var db=function(){function e(t,n){var i,r;if(Dv(this,e),Uv(this,"transporter",void 0),Uv(this,"delegate",void 0),Uv(this,"currentContext",void 0),Uv(this,"appState",void 0),Uv(this,"previousAppContext",void 0),Uv(this,"customTransporters",void 0),Uv(this,"clientMonitoringConn",void 0),this.transporter=t,this.delegate=n,this.appState={},this.customTransporters={},n&&n.customTransporterHosts)for(var a in n.customTransporterHosts)if(Object.prototype.hasOwnProperty.call(n.customTransporterHosts,a)){var s=this.transporter.host.api.assign({},this.transporter.host);this.customTransporters[a]=new sb(this.transporter.host.api.assign(s,n.customTransporterHosts[a]))}"enabled"===(null===(i=(r=t.host).__getLixTreatment)||void 0===i?void 0:i.call(r,"pemberly.tracking.monitoring"))&&t.host.clientMonitoringConfig&&!t.host.inactive&&"location"in t.host.api&&(this.clientMonitoringConn=eb(t.host))}return Nv(e,[{key:"host",get:function(){return this.transporter.host}},{key:"checkAndEnablePersistentRetry",value:function(){cb(this.transporter)&&this.transporter.checkAndEnablePersistentRetry(this.delegate)}},{key:"flushAndClearPersistedEventsOnLogout",value:function(){this.forceFlush();var e=cb(this.transporter)?this.transporter.clearPersistedEventsOnLogout():null;return null!=e?e:this.host.api.Promise.resolve()}},{key:"getCurrentContext",value:function(){if(this.currentContext)return w_(this.currentContext,this.host.api)}},{key:"navigate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.navMetaFromSeed(e,lb(t));if(this.setCurrentContext(i.to),!n.suppressEventsFiring)return this.fireNavEvents(i)}},{key:"setCurrentContext",value:function(e){var t;this.currentContext=w_(e,this.host.api),null===(t=this.clientMonitoringConn)||void 0===t||t.setCurrentContext(w_(e,this.host.api))}},{key:"updateAppState",value:function(e){var t;this.host.api.assign(this.appState,e),null===(t=this.clientMonitoringConn)||void 0===t||t.updateAppState(e)}},{key:"fireCIE",value:function(e,t,n,i,r){return this.fireEvent("ControlInteractionEvent",(function(n){var a=E_(n.pageKey,e),s={controlTrackingId:i,controlUrn:a,interactionType:t};return r&&r(a),s}),{context:n})}},{key:"fireEvent",value:function(e,t,n,i){if(!t){var r=Q_(e),a=void 0===t?"undefined":null===t?"null":Rv(t),s='Firing tracking event "'.concat(r,'" with invalid body, you fired "').concat(a,'"');if(this.clientMonitoringConn){var o=this.clientMonitoringConn.logEventGenerated(r);this.clientMonitoringConn.logFailedEvent(J_.MISSING_REQUIRED_PROPERTIES,e,s,o)}throw new Error(s)}var u=i||[];if(u.length>0){var l=u.map((function(e){return ub.toPointer(e)}));this.host.api.assign(t,{clientBreadcrumbPointers:l})}var c=u.length>0?this.generateEnvelopeWithBreadcrumbs(e,t,n,u):this.generateEnvelope(e,t,n);return this.fireEnvelope(c)}},{key:"generateEnvelopeWithBreadcrumbs",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],r=this.generateEnvelope(e,t,n),a=i.length>0?this.addBreadcrumbsToEnvelope(r,i):r;return a}},{key:"addBreadcrumbsToEnvelope",value:function(e,t){var n=t.map((function(e){var t=e;return delete t.clientBreadcrumbType,t}));return this.host.api.assign(e,{clientBreadcrumbs:n}),e}},{key:"fireEnvelope",value:function(e){var t,n;if(null!==(t=this.delegate)&&void 0!==t&&null!==(n=t.shouldAnonymizeMemberId)&&void 0!==n&&n.call(t))if(X_(e.id)){var i=e.id;e.id={eventName:i,topicName:i,shouldAnonymizeMemberId:!0}}else e.id.shouldAnonymizeMemberId=!0;var r=this.delegate&&this.delegate.preTransporter?this.delegate.preTransporter(e):e;if(r){var a=r.meta.transporterKey,s=a?this.customTransporters[a]:this.transporter;if(!s&&a){var o=Q_(r.id),u="Could not find custom transporter: ".concat(a);if(this.clientMonitoringConn){var l=this.clientMonitoringConn.logEventGenerated(o);this.clientMonitoringConn.logFailedEvent(J_.UNKNOWN_EXECUTION_ERROR,r.id,u,l)}throw new Error(u)}return s.fireEvent(r)}return this.host.api.Promise.resolve(!0)}},{key:"generatePageInstance",value:function(e,t){return S_(e,t)}},{key:"firePVE",value:function(e,t,n){return this._firePVE(e,t,n)}},{key:"_firePVE",value:function(e,t,n){var i={pageType:"full",totalTime:0,trackingCode:this.getTrackingCode(),trackingInfo:{}},r=this.host.api.assign(i,t),a=this.generateEnvelope("PageViewEvent",r,{context:n});return a.meta.requestHeader.pageKey=e,this.fireEnvelope(a)}},{key:"destroy",value:function(){for(var e in this.transporter.destroy(),this.customTransporters)this.customTransporters[e].destroy();this.clientMonitoringConn&&(this.clientMonitoringConn.flush(),this.clientMonitoringConn.destroy(),this.clientMonitoringConn=void 0),M_.clear()}},{key:"forceFlush",value:function(){for(var e in this.transporter.forceFlush(),this.customTransporters)this.customTransporters[e].forceFlush()}},{key:"generateControlUrn",value:function(e,t){return E_((t||this.currentContext||{pageKey:"unknown"}).pageKey,e)}},{key:"fireRawCIE",value:function(e,t,n,i){var r={controlTrackingId:i,controlUrn:e,interactionType:t};return{beacon:this.fireEvent("ControlInteractionEvent",r,{context:n}),controlUrn:e}}},{key:"generateNavigationEvent",value:function(e){var t=e.triggerId,n=e.triggerUrn,i=e.from;return{previousPageInstance:i&&i.pageInstance,triggerControlTrackingId:t,triggerControlUrn:n}}},{key:"getTrackingCode",value:function(){return this.previousAppContext&&this.previousAppContext.pageKey}},{key:"navMetaFromSeed",value:function(e,t){var n="NavigationEvent";this.previousAppContext=t.previousContext;var i=t.fromExternalApp?{eventName:n,topicName:"InboundNavigationEvent"}:n;return{from:t.previousContext,navEventId:i,to:{applicationInstance:t.applicationInstance,pageInstance:this.generatePageInstance(e,t.pageTrackingId),pageKey:e},triggerId:t.previousControlId,triggerUrn:t.previousControlUrn}}},{key:"fireNavEvents",value:function(e){var t=this.generateNavigationEvent(e),n=e.to,i=e.from,r=e.navEventId,a=this.generateEnvelope(r,t);a.meta.requestHeader.pageKey=n.pageKey;var s=i&&i.applicationInstance;return s&&(a.meta.header.clientApplicationInstance=s),this.host.api.Promise.all([this._firePVE(n.pageKey),this.fireEnvelope(a)])}},{key:"generateEnvelope",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={directive:n.directive,transporterKey:n.transporterKey,context:n.context||this.currentContext&&w_(this.currentContext,this.host.api),requestHeader:this.host.api.assign({trackingCode:this.getTrackingCode()},n.requestHeader||{}),header:this.host.api.assign({applicationViewerUrn:this.appState.applicationViewerUrn,clientApplicationInstance:this.appState.clientApplicationInstance},n.header||{})};return{body:"function"==typeof t?t:function(){return t},id:e,meta:i}}}]),e}();function hb(e){return e.split("").reduce((function(e,t){return(e<<5)-e+t.charCodeAt(0)|0}),0)}!function(){function e(t,n){var i,r=this;Dv(this,e),Uv(this,"core",void 0),Uv(this,"protocol",void 0),Uv(this,"throttleKeySet",new Set),Uv(this,"config",void 0),Uv(this,"reportTransporterError",(function(e){e.reason instanceof Error||(e.reason=new Error(e.reason||"An error occurred in the transporter")),r.reportError(e.reason,e.tags.concat(["info"])).catch((function(){}))})),this.core=t;var a=this.core.host.api.location.protocol;this.protocol=a.substring(0,a.length-1),this.config={throttleTime:null!==(i=null==n?void 0:n.throttleTime)&&void 0!==i?i:100},M_.on("internal:error",this.reportTransporterError)}Nv(e,[{key:"reportError",value:function(e){var t,n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=r.callTreeId,s=void 0===a?"":a,o=r.responseHeaders,u=void 0===o?{}:o,l=e.message,c=e.name,d=e.stack,h=void 0===d?"":d,p=e.fileName,f=void 0===p?"":p,m=e.lineNumber,g=void 0===m?0:m,v=e.columnNumber,y=void 0===v?0:v,_=this.core.host,b=_.appId,T=_.appVersion,k=_.service,S=_.serviceInstance,E=_.treeID,C=void 0===E?"":E,w=_.api,I=w.Promise,P=w.location,x=P.host,A=P.pathname,O=P.search,L=P.hash,R=void 0===L?"":L;if(u){t={};var D=new Map;Object.keys(u).forEach((function(e){D.set(e.toLowerCase(),u[e])})),t.callTreeId=D.get("x-li-uuid"),t.microsoftEdgeReference=D.get("x-msedge-ref"),t.pointOfPresenceId=D.get("x-li-pop"),t.fabric=D.get("x-li-fabric")}var M=function(){return n.core.fireEvent("JavaScriptErrorEvent",(function(e){return{appId:b,e:{c:y,l:g,m:l,s:h,t:c,u:f},h:R,l:n.protocol,o:x,p:A,pageKey:e.pageKey,q:O,service:k,serviceInstance:S,serviceVersion:T,t:i,trackingID:e.pageInstance.trackingId,treeID:C,callTreeId:s,responseTraceHeaders:t}}))};if(this.config.throttleTime<0)return M();var N=hb(c+l+h+i.join("")+s);return this.throttleKeySet.has(N)?I.resolve(!1):(this.throttleKeySet.add(N),setTimeout((function(){return n.throttleKeySet.delete(N)}),this.config.throttleTime),M())}},{key:"flush",value:function(){this.core.forceFlush()}},{key:"destroy",value:function(){this.core.destroy(),M_.off("internal:error",this.reportTransporterError)}}])}();var pb,fb,mb,gb=function(){function e(){Dv(this,e),Uv(this,"userTimingEntries",[]),Uv(this,"longTasks",[]),Uv(this,"resourceTimingEntries",[]),Uv(this,"cdnData",void 0)}return Nv(e,[{key:"reset",value:function(){this.userTimingEntries=[],this.longTasks=[],this.resourceTimingEntries=[]}},{key:"attachTreeIds",value:function(e){this.resourceTimingEntries.forEach((function(t){var n=e.get(t.name);n&&(t.resourceTreeId=n)}))}},{key:"getData",value:function(){return{userTimingEntries:this.userTimingEntries,longTasks:this.longTasks,resourceTimingEntries:this.resourceTimingEntries.map(yb),cdnData:this.cdnData}}}]),e}(),vb=["resourceTreeId","name","entryType","startTime","duration","initiatorType","nextHopProtocol","redirectStart","redirectEnd","fetchStart","domainLookupStart","domainLookupEnd","connectStart","connectEnd","secureConnectionStart","requestStart","responseStart","responseEnd","transferSize","encodedBodySize","decodedBodySize","workerStart"];function yb(e){return vb.reduce((function(t,n){var i=e[n];return void 0!==i&&(t[n]=i),t}),{})}function _b(e,t,n){for(var i=null,r=[],a=e,s=0,o=function(){var e=wb(function(e){var t=e.getAttribute("id");return t&&fb.idName(t)?{name:"#"+Nb(t,{isIdentifier:!0}),penalty:0}:null}(a))||wb.apply(void 0,Av(function(e){return Array.from(e.attributes).filter((function(e){return fb.attr(e.name,e.value)})).map((function(e){return{name:"["+Nb(e.name,{isIdentifier:!0})+'="'+Nb(e.value)+'"]',penalty:.5}}))}(a)))||wb.apply(void 0,Av(function(e){return Array.from(e.classList).filter(fb.className).map((function(e){return{name:"."+Nb(e,{isIdentifier:!0}),penalty:1}}))}(a)))||wb(function(e){var t=e.tagName.toLowerCase();return fb.tagName(t)?{name:t,penalty:2}:null}(a))||[{name:"*",penalty:3}],o=function(e){var t=e.parentNode;if(!t)return null;var n=t.firstChild;if(!n)return null;for(var i=0;n&&(n.nodeType===Node.ELEMENT_NODE&&i++,n!==e);)n=n.nextSibling;return i}(a);if(t===pb.All)o&&(e=e.concat(e.filter(Cb).map((function(e){return Eb(e,o)}))));else if(t===pb.Two)e=e.slice(0,1),o&&(e=e.concat(e.filter(Cb).map((function(e){return Eb(e,o)}))));else if(t===pb.One){var u=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,a=[],s=!0,o=!1;try{for(n=n.call(e);!(s=(i=n.next()).done)&&(a.push(i.value),!t||a.length!==t);s=!0);}catch(e){o=!0,r=e}finally{try{s||null==n.return||n.return()}finally{if(o)throw r}}return a}}(e,t)||Ov(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e=e.slice(0,1),1)[0];o&&Cb(u)&&(e=[Eb(u,o)])}var l,c=xv(e);try{for(c.s();!(l=c.n()).done;)l.value.level=s}catch(e){c.e(e)}finally{c.f()}if(r.push(e),r.length>=fb.seedMinLength&&(i=bb(r,n)))return"break";a=a.parentElement,s++};a&&a!==fb.root.parentElement&&"break"!==o(););return i||(i=bb(r,n)),i}function bb(e,t){var n=Pb(function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(t.length>0){var i,r=[],a=xv(t[0]);try{for(a.s();!(i=a.n()).done;){var s=i.value;r=r.concat(e(t.slice(1,t.length),n.concat(s)))}}catch(t){a.e(t)}finally{a.f()}return r}return[n]}(e));if(n.length>fb.threshold)return t?t():null;var i,r=xv(n);try{for(r.s();!(i=r.n()).done;){var a=i.value;if(Sb(a))return a}}catch(e){r.e(e)}finally{r.f()}return null}function Tb(e){for(var t=e[0],n=t.name,i=1;i<e.length;i++){var r=e[i].level||0;n=t.level===r-1?"".concat(e[i].name," > ").concat(n):"".concat(e[i].name," ").concat(n),t=e[i]}return n}function kb(e){return e.map((function(e){return e.penalty})).reduce((function(e,t){return e+t}),0)}function Sb(e){switch(mb.querySelectorAll(Tb(e)).length){case 0:throw new Error("Can't select any node with this selector: ".concat(Tb(e)));case 1:return!0;default:return!1}}function Eb(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function Cb(e){return"html"!==e.name&&!e.name.startsWith("#")}function wb(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i=t.filter(Ib);return i.length>0?i:null}function Ib(e){return null!=e}function Pb(e){return Array.from(e).sort((function(e,t){return kb(e)-kb(t)}))}function xb(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{counter:0,visited:new Map},i=[];if(e.length>2&&e.length>fb.optimizedMinLength)for(var r=1;r<e.length-1;r++){if(n.counter>fb.maxNumberOfTries)return i;n.counter+=1;var a=Av(e);a.splice(r,1);var s=Tb(a);if(n.visited.has(s))return i;Sb(a)&&Ab(a,t)&&(i.push(a),n.visited.set(s,!0),i=i.concat(xb(a,t,n)))}return i}function Ab(e,t){return mb.querySelector(Tb(e))===t}!function(e){e[e.All=0]="All",e[e.Two=1]="Two",e[e.One=2]="One"}(pb||(pb={}));var Ob,Lb=/[ -,\.\/:-@\[-\^`\{-~]/,Rb=/[ -,\.\/:-@\[\]\^`\{-~]/,Db=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,Mb={escapeEverything:!1,isIdentifier:!1,quotes:"single",wrap:!1};function Nb(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object.assign(Object.assign({},Mb),t);"single"!=n.quotes&&"double"!=n.quotes&&(n.quotes="single");for(var i="double"==n.quotes?'"':"'",r=n.isIdentifier,a=e.charAt(0),s="",o=0,u=e.length;o<u;){var l=e.charAt(o++),c=l.charCodeAt(0),d=void 0;if(c<32||c>126){if(c>=55296&&c<=56319&&o<u){var h=e.charCodeAt(o++);56320==(64512&h)?c=((1023&c)<<10)+(1023&h)+65536:o--}d="\\"+c.toString(16).toUpperCase()+" "}else d=n.escapeEverything?Lb.test(l)?"\\"+l:"\\"+c.toString(16).toUpperCase()+" ":/[\t\n\f\r\x0B]/.test(l)?"\\"+c.toString(16).toUpperCase()+" ":"\\"==l||!r&&('"'==l&&i==l||"'"==l&&i==l)||r&&Rb.test(l)?"\\"+l:l;s+=d}return r&&(/^-[-\d]/.test(s)?s="\\-"+s.slice(1):/\d/.test(a)&&(s="\\3"+a+" "+s.slice(1))),s=s.replace(Db,(function(e,t,n){return t&&t.length%2?e:(t||"")+n})),!r&&n.wrap?i+s+i:s}function Ub(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e&&"function"==typeof e.now&&(e.timeOrigin||e.timing)){var n,i=e.now();return n=!e.timing&&t?Math.floor(e.timeOrigin):e.timing.navigationStart,Math.round(i+n)}return Date.now()}function Bb(e){var t=e||performance;return Math.round(t.now())}function Fb(e){if(!e)return"null";if(e.nodeType===Node.ELEMENT_NODE)try{return function(e,t){if(e.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if("html"===e.tagName.toLowerCase())return"html";var n={root:document.body,idName:function(e){return!0},className:function(e){return!0},tagName:function(e){return!0},attr:function(e,t){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4};fb=Object.assign(Object.assign({},n),t),mb=function(e,t){return e.nodeType===Node.DOCUMENT_NODE?e:e===t.root?e.ownerDocument:e}(fb.root,n);var i=_b(e,pb.All,(function(){return _b(e,pb.Two,(function(){return _b(e,pb.One)}))}));if(i){var r=Pb(xb(i,e));return r.length>0&&(i=r[0]),Tb(i)}throw new Error("Selector was not found.")}(e,{idName:function(e){return 0!==e.indexOf("ember")}})}catch(e){return"serialization_error"}var t=Fb(e.parentElement||void 0);return"".concat(t," > nodeType(").concat(e.nodeType,")")}function jb(e,t,n){var i=[];return e&&"function"==typeof e.getEntriesByType&&(t["user-timing-measure-enabled"]&&e.getEntriesByType("measure").forEach((function(e){i.push({entryType:"MEASURE",name:e.name,startTime:e.startTime,duration:e.duration})})),t["user-timing-mark-enabled"]&&e.getEntriesByType("mark").forEach((function(e){i.push({entryType:"MARK",name:e.name,startTime:e.startTime,duration:e.duration})})),n&&(e.clearMeasures(),e.clearMarks())),i}function Hb(e){var t=[];return e.forEach((function(e){return t.push(e)})),t}var Vb,qb,Wb=function(){function e(t){Dv(this,e),Uv(this,"hostApis",void 0),Uv(this,"hostnameProperties",void 0),Uv(this,"usedHostnames",void 0),Uv(this,"abortController",void 0),Uv(this,"pendingPromises",void 0),this.hostApis=t;var n=t.AbortController;this.hostnameProperties={},this.usedHostnames=new Set,this.abortController=new n,this.pendingPromises=new Set}return Nv(e,[{key:"clearUsedHostnames",value:function(){this.usedHostnames=new Set}},{key:"getPresentData",value:function(){var e=this;return P_(this.usedHostnames).map((function(t){return e.hostnameProperties[t]||{hostname:t,provider:"",ipVersion:"",httpVersion:""}}))}},{key:"getDataWhenReady",value:function(e){var t=this,n=this.hostApis,i=n.AbortController,r=n.Promise,a=I_(P_(this.pendingPromises),r),s=setTimeout((function(){t.abortController.abort(),t.abortController=new i}),e);return a.then((function(){return clearTimeout(s),t.getPresentData()}))}},{key:"inspectEntryForCdnData",value:function(e){var t=this;if(!(e.name.indexOf(".licdn.")<0)){var n,i,r=this.hostApis.assign,a=(n=e.name,i=this.hostApis.document,(Ob=Ob||i.createElement("a")).href=n,Ob.hostname);if(this.usedHostnames.add(a),!this.hostnameProperties[a]&&!this.isResourcePossiblyFromCache(e)){var s=this.fetchCdnFromUrl(e.name).then((function(e){var n=r({hostname:a},e);return t.hostnameProperties[a]||(t.hostnameProperties[a]=n),t.pendingPromises.delete(s),n}));this.pendingPromises.add(s)}}}},{key:"fetchCdnFromUrl",value:function(e){return(0,this.hostApis.fetch)(e,{method:"HEAD",signal:this.abortController.signal}).then((function(e){return{provider:e.headers.get("X-CDN")||"",ipVersion:e.headers.get("X-CDN-CLIENT-IP-VERSION")||"",httpVersion:e.headers.get("X-CDN-Proto")||""}}))}},{key:"isResourcePossiblyFromCache",value:function(e){return void 0!==e.transferSize?0===e.transferSize:e.domainLookupStart===e.domainLookupEnd&&e.connectEnd===e.connectStart&&0===e.secureConnectionStart}}]),e}(),zb=function(){function e(t,n,i,r){Dv(this,e),Uv(this,"hostApis",void 0),Uv(this,"statics",void 0),Uv(this,"options",void 0),Uv(this,"allowTimingOrigin",void 0),Uv(this,"collectResourceTimings",void 0),Uv(this,"collectCdnData",void 0),Uv(this,"perfObserver",void 0),Uv(this,"renderTimings",new Map),Uv(this,"urlToTreeId",new Map),Uv(this,"pageLoadId",T_()),Uv(this,"cdnDataProvider",void 0),Uv(this,"observables",new gb),this.hostApis=t,this.statics=n,this.options=i,this.allowTimingOrigin=r,this.collectResourceTimings=i["enable-rs-timing"],this.collectCdnData=i["enable-cdn-tracking"],this.collectCdnData&&(this.cdnDataProvider=new Wb(t))}return Nv(e,[{key:"recordTreeId",value:function(e,t){this.collectResourceTimings&&this.urlToTreeId.set(function(e,t){return(Ob=Ob||t.createElement("a")).href=e,Ob.href}(t,this.hostApis.document),e)}},{key:"recordRenderStart",value:function(e,t){this.renderTimings.has(e)||this.renderTimings.set(e,{renderName:t,viewId:e,renderStart:Ub(this.hostApis.performance,this.allowTimingOrigin)})}},{key:"recordRenderEnd",value:function(e){var t=this.renderTimings.get(e);t&&(t.renderEnd=t.renderEnd||Ub(this.hostApis.performance,this.allowTimingOrigin))}},{key:"startObserving",value:function(){var e=this.hostApis,t=e.PerformanceObserver,n=e.performance;this.stopObserving(),t?this.setupPerformanceObserver(t):this.collectResourceTimings&&this.emulateResourceTimingObserver(n),this.collectResourceTimings&&this.processNewResourceTimings()}},{key:"stopObserving",value:function(){var e;null===(e=this.perfObserver)||void 0===e||e.disconnect(),this.reset()}},{key:"collect",value:function(e){var t=this,n=e.isInitial,i=e.immediate,r=this.collectSynchronousData(n);if(i)return r;var a=this.collectAsynchronousData();return"then"in a?a.then((function(e){return(0,t.hostApis.assign)(r,e),r})):r}},{key:"collectPageLoadStartData",value:function(e){var t=e.isInitial,n=e.rumKey,i=Object.create(null);i.pageLoadId=this.pageLoadId,i.pageKey=n,i.pageLoadType=t?"INITIAL_LOAD":"SUBSEQUENT_LOAD",i.networkInformationMetrics=this.snapshot.networkInformationMetrics;var r=this.statics,a=r.webUIFramework,s=r.timeSource,o=r.isSinglePageApp,u=r.appRenderMode,l=r.isAppRenderFailed,c=r.isFromServiceWorker,d=r.treeId;return i.treeId=d,i.browserPageLoadStartContext={webUIFramework:a,timeSource:s,isSinglePageApp:o,appRenderMode:u,isAppRenderFailed:l,isFromServiceWorker:c},i}},{key:"reset",value:function(){var e;this.observables.reset(),null===(e=this.cdnDataProvider)||void 0===e||e.clearUsedHostnames()}},{key:"collectSynchronousData",value:function(e){var t=this.hostApis,n=t.assign,i=t.PerformanceObserver,r=Object.create(null);return this.statics.pageLoadMode=e?"INITIAL":"PARTIAL",i||(this.observables.userTimingEntries=jb(this.hostApis.performance,this.options,!0),this.collectResourceTimings&&this.processNewResourceTimings()),this.observables.attachTreeIds(this.urlToTreeId),this.urlToTreeId.clear(),n(r,this.observables.getData(),this.snapshot,this.statics),e&&n(r,function(e){if(!e)return{navigationTimingApi:!1};var t=Object.create({});if("function"==typeof e.getEntriesByType){var n=e.getEntriesByType("navigation")[0];n&&(["fetchStart","responseEnd","decodedBodySize","encodedBodySize","transferSize"].every((function(e){return"number"==typeof n[e]}))&&(t.htmlMetrics={htmlFetchStart:n.fetchStart,htmlResponseEnd:n.responseEnd,htmlDecodedBodySize:n.decodedBodySize,htmlEncodedBodySize:n.encodedBodySize,htmlTransferSize:n.transferSize}),t.workerStart=n.workerStart)}var i=e.timing,r=e.navigation;return i&&r?(t.navigationTimingApi=!0,Gb.forEach((function(e){e in i&&(t[e]=i[e])})),t.navigationType=r.type,t.redirectCount=r.redirectCount):t.navigationTimingApi=!1,t}(this.hostApis.performance)),n(r,this.collectAsynchronousData(!0)),r}},{key:"collectAsynchronousData",value:function(e){var t=this,n={cdnData:[],usedCDN:this.extractUsedCDN([])};if(e){if(this.collectCdnData){var i=this.cdnDataProvider.getPresentData();n.cdnData=i,n.usedCDN=this.extractUsedCDN(i)}return n}var r=[];return this.collectCdnData&&r.push(this.cdnDataProvider.getDataWhenReady(this.options["async-plugins-timeout"]).then((function(e){n.cdnData=e,n.usedCDN=t.extractUsedCDN(e)}))),r.length>0?I_(r,Promise).then((function(){return n})):n}},{key:"setupPerformanceObserver",value:function(e){var t=this;this.perfObserver=new e((function(e){e.getEntries().forEach((function(e){var n=e.entryType,i=e.name,r=e.startTime,a=e.duration;"resource"===n?t.processSingleResourceTiming(e):"mark"===n?t.observables.userTimingEntries.push({entryType:"MARK",name:i,startTime:r,duration:a}):"measure"===n?t.observables.userTimingEntries.push({entryType:"MEASURE",name:i,startTime:r,duration:a}):"longtask"===n&&t.observables.longTasks.push({duration:a,name:i,startTime:r})}))})),this.observables.userTimingEntries=jb(this.hostApis.performance,this.options,!1);var n=["longtask"];(this.collectResourceTimings||this.collectCdnData)&&n.push("resource"),this.options["user-timing-mark-enabled"]&&n.push("mark"),this.options["user-timing-measure-enabled"]&&n.push("measure"),this.perfObserver.observe({entryTypes:n})}},{key:"emulateResourceTimingObserver",value:function(e){var t=this;e&&"function"==typeof e.setResourceTimingBufferSize&&"function"==typeof e.onresourcetimingbufferfull&&(e.setResourceTimingBufferSize(100),e.onresourcetimingbufferfull=function(){return t.processNewResourceTimings()})}},{key:"processNewResourceTimings",value:function(){var e=this,t=this.hostApis.performance;"function"==typeof t.getEntriesByType&&"function"==typeof t.clearResourceTimings&&(t.getEntriesByType("resource").forEach((function(t){return e.processSingleResourceTiming(t)})),t.clearResourceTimings())}},{key:"processSingleResourceTiming",value:function(e){this.collectResourceTimings&&this.observables.resourceTimingEntries.push(e),this.collectCdnData&&this.cdnDataProvider.inspectEntryForCdnData(e)}},{key:"extractUsedCDN",value:function(e){var t=e.filter((function(e){return e.hostname.indexOf("static")>=0})),n=t.length>0?t[0]:{hostname:"",provider:"",httpVersion:"",ipVersion:""};return{static_domain:n.provider,http_version:n.httpVersion,ip_version:n.ipVersion}}},{key:"snapshot",get:function(){var e={detailedRenderTimingEntries:Hb(this.renderTimings),networkInformationMetrics:Kb(this.hostApis.connection)};return this.renderTimings.clear(),e}}]),e}(),Gb=["loadEventEnd","loadEventStart","domComplete","domContentLoadedEventEnd","domContentLoadedEventStart","domInteractive","domLoading","responseEnd","responseStart","requestStart","secureConnectionStart","connectEnd","connectStart","domainLookupEnd","domainLookupStart","fetchStart","redirectEnd","redirectStart","unloadEventEnd","unloadEventStart","navigationStart"];function Kb(e){return e?{connectionType:e.type&&e.type.toUpperCase()||"UNKNOWN",effectiveType:function(e){switch(e){case"2g":return"TWO_G";case"3g":return"THREE_G";case"4g":return"FOUR_G";default:return"SLOW_2G"}}(e.effectiveType),roundTripTime:e.rtt||-1,downlinkBandwidth:e.downlink||-1,downlinkMaxBandwidth:void 0===e.downlinkMax?-1:e.downlinkMax===1/0?0:e.downlinkMax}:void 0}!function(e){e.RealUserMonitoringEvent="RealUserMonitoringEvent",e.FeaturePerformanceMeasurementEvent="FeaturePerformanceMeasurementEvent",e.ClientPerfMetricsEvent="ClientPerfMetricsEvent",e.WEB_UI_FRAMEWORK="web-ui-framework",e.APP_ID="app-id",e.APP_VERSION="app-version",e.IS_SINGLE_PAGE_APP="is-single-page-app",e.IS_APP_RENDER_FAILED="is-app-render-failed",e.APP_RENDER_MODE="app-render-mode",e.USER_TIMING_MARK_ENABLED="user-timing-mark-enabled",e.USER_TIMING_MEASURE_ENABLED="user-timing-measure-enabled",e.BEACON_SOURCE="beacon-source",e.BEACON_TIMEOUT="beacon-timeout",e.ENABLE_RS_TIMING="enable-rs-timing",e.ENABLE_CDN_TRACKING="enable-cdn-tracking",e.ASYNC_PLUGINS_TIMEOUT="async-plugins-timeout",e.ENABLE_MEMORY_MEASUREMENT="enable-memory-measurement",e.PAGE_KEY_PREFIX="pageKeyPrefix"}(Vb||(Vb={})),function(e){e.PageLoadStartEvent="PageLoadStartEvent",e.PageLoadEndEvent="PageLoadEndEvent",e.ResourceLoadEvent="ResourceLoadEvent",e.CustomMeasureEvent="CustomMeasureEvent",e.ViewLoadEvent="ViewLoadEvent"}(qb||(qb={}));var Xb=(Uv(Cv={},"web-ui-framework","EMBER"),Uv(Cv,"app-id","linkedin.rum.tracking"),Uv(Cv,"app-version","unknown"),Uv(Cv,"is-single-page-app",!0),Uv(Cv,"user-timing-mark-enabled",!1),Uv(Cv,"user-timing-measure-enabled",!0),Uv(Cv,"beacon-source","apps"),Uv(Cv,"enable-rs-timing",!0),Uv(Cv,"enable-cdn-tracking",!1),Uv(Cv,"async-plugins-timeout",5e3),Uv(Cv,"beacon-timeout",3e4),Uv(Cv,"enable-memory-measurement",!1),Uv(Cv,"pageKeyPrefix",""),Cv),Qb=function(){function e(t,n,i){Dv(this,e),Uv(this,"featureName",void 0),Uv(this,"trackingCore",void 0),Uv(this,"rumConfig",void 0),Uv(this,"observing",!1),Uv(this,"basePageTreeId",void 0),Uv(this,"startPageInstance",void 0),Uv(this,"startMemory",void 0),Uv(this,"reportTimeouts",[]),this.featureName=t,this.trackingCore=n,this.rumConfig=i}return Nv(e,[{key:"startObserving",value:function(){var t,n=this,i=this.getMemory();i&&!this.observing&&(this.basePageTreeId=this.trackingCore.host.treeID||"",this.startPageInstance=(null===(t=this.trackingCore.getCurrentContext())||void 0===t?void 0:t.pageInstance)||S_("unknown"),this.startMemory=i,this.reportTimeouts=e.checkpoints.map((function(e){return setTimeout((function(){return n.reportMemory(e)}),60*e*1e3)})))}},{key:"stopObserving",value:function(){this.reportTimeouts.forEach((function(e){return clearTimeout(e)})),this.observing=!1}},{key:"reportMemory",value:function(e){var t={name:this.featureName,basePageTreeId:this.basePageTreeId,startTime:Bb(this.trackingCore.host.api.performance),duration:0,startPageInstance:this.startPageInstance,marks:this.createMemoryMarks("-".concat(e,"min")),spans:[]};this.trackingCore.fireEvent({appId:this.rumConfig["app-id"],eventName:"FeaturePerformanceMeasurementEvent"},t)}},{key:"createMemoryMarks",value:function(e){var t=this.getMemory(),n=["jsHeapSizeLimit","totalJSHeapSize","usedJSHeapSize"].map((function(n){return{name:n+e,startTime:t[n]}})),i=t.usedJSHeapSize-this.startMemory.usedJSHeapSize;return n.push({name:(i<0?"usedJSHeapSizeDecrease":"usedJSHeapSizeIncrease")+e,startTime:Math.abs(i)},{name:"utilization"+e,startTime:Math.round(t.usedJSHeapSize/t.totalJSHeapSize*100)}),n}},{key:"getMemory",value:function(){return this.trackingCore.host.api.performance.memory}}]),e}();Uv(Qb,"checkpoints",[1,3,10,30,90,180,300]);var Yb,$b,Jb,Zb,eT,tT=Nv((function e(t,n,i){Dv(this,e),Uv(this,"webUIFramework",void 0),Uv(this,"timeSource",void 0),Uv(this,"isSinglePageApp",void 0),Uv(this,"appRenderMode",void 0),Uv(this,"isAppRenderFailed",void 0),Uv(this,"pageLoadMode","INITIAL"),Uv(this,"isSSL",void 0),Uv(this,"treeId",void 0),Uv(this,"isFromServiceWorker",void 0),this.webUIFramework=n["web-ui-framework"],this.timeSource=n["beacon-source"],this.isSinglePageApp=n["is-single-page-app"],this.appRenderMode=t["app-render-mode"],this.isAppRenderFailed=t["is-app-render-failed"],this.isSSL="https:"===i.api.location.protocol?1:0,this.treeId=i.treeID,this.isFromServiceWorker=i.isFromServiceWorker})),nT=function(e,t){return{name:e,value:void 0===t?-1:t,delta:0,entries:[],id:"v2-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12)}},iT=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){if("first-input"===e&&!("PerformanceEventTiming"in self))return;var n=new PerformanceObserver((function(e){return e.getEntries().map(t)}));return n.observe({type:e,buffered:!0}),n}}catch(e){}},rT=function(e,t){var n=function n(i){"pagehide"!==i.type&&"hidden"!==document.visibilityState||(e(i),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},aT=function(e){addEventListener("pageshow",(function(t){t.persisted&&e(t)}),!0)},sT=function(e,t,n){var i;return function(r){t.value>=0&&(r||n)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},oT=-1,uT=function(){return"hidden"===document.visibilityState?0:1/0},lT=function(){rT((function(e){var t=e.timeStamp;oT=t}),!0)},cT=function(){return oT<0&&(oT=uT(),lT(),aT((function(){setTimeout((function(){oT=uT(),lT()}),0)}))),{get firstHiddenTime(){return oT}}},dT=!1,hT=-1,pT=function(e,t){dT||(function(e,t){var n,i=cT(),r=nT("FCP"),a=function(e){"first-contentful-paint"===e.name&&(o&&o.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=e.startTime,r.entries.push(e),n(!0)))},s=window.performance&&performance.getEntriesByName&&performance.getEntriesByName("first-contentful-paint")[0],o=s?null:iT("paint",a);(s||o)&&(n=sT(e,r,t),s&&a(s),aT((function(i){r=nT("FCP"),n=sT(e,r,t),requestAnimationFrame((function(){requestAnimationFrame((function(){r.value=performance.now()-i.timeStamp,n(!0)}))}))})))}((function(e){hT=e.value})),dT=!0);var n,i=function(t){hT>-1&&e(t)},r=nT("CLS",0),a=0,s=[],o=function(e){if(!e.hadRecentInput){var t=s[0],i=s[s.length-1];a&&e.startTime-i.startTime<1e3&&e.startTime-t.startTime<5e3?(a+=e.value,s.push(e)):(a=e.value,s=[e]),a>r.value&&(r.value=a,r.entries=s,n())}},u=iT("layout-shift",o);u&&(n=sT(i,r,t),rT((function(){u.takeRecords().map(o),n(!0)})),aT((function(){a=0,hT=-1,r=nT("CLS",0),n=sT(i,r,t)})))},fT={passive:!0,capture:!0},mT=new Date,gT=function(e,t){Yb||(Yb=t,$b=e,Jb=new Date,_T(removeEventListener),vT())},vT=function(){if($b>=0&&$b<Jb-mT){var e={entryType:"first-input",name:Yb.type,target:Yb.target,cancelable:Yb.cancelable,startTime:Yb.timeStamp,processingStart:Yb.timeStamp+$b};Zb.forEach((function(t){t(e)})),Zb=[]}},yT=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){gT(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,fT),removeEventListener("pointercancel",i,fT)};addEventListener("pointerup",n,fT),addEventListener("pointercancel",i,fT)}(t,e):gT(t,e)}},_T=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,yT,fT)}))},bT=function(e,t){var n,i=cT(),r=nT("FID"),a=function(e){e.startTime<i.firstHiddenTime&&(r.value=e.processingStart-e.startTime,r.entries.push(e),n(!0))},s=iT("first-input",a);n=sT(e,r,t),s&&rT((function(){s.takeRecords().map(a),s.disconnect()}),!0),s&&aT((function(){var i;r=nT("FID"),n=sT(e,r,t),Zb=[],$b=-1,Yb=null,_T(addEventListener),i=a,Zb.push(i),vT()}))},TT={},kT=function(e,t){var n,i=cT(),r=nT("LCP"),a=function(e){var t=e.startTime;t<i.firstHiddenTime&&(r.value=t,r.entries.push(e)),n()},s=iT("largest-contentful-paint",a);if(s){n=sT(e,r,t);var o=function(){TT[r.id]||(s.takeRecords().map(a),s.disconnect(),TT[r.id]=!0,n(!0))};["keydown","click"].forEach((function(e){addEventListener(e,o,{once:!0,capture:!0})})),rT(o,!0),aT((function(i){r=nT("LCP"),n=sT(e,r,t),requestAnimationFrame((function(){requestAnimationFrame((function(){r.value=performance.now()-i.timeStamp,TT[r.id]=!0,n(!0)}))}))}))}},ST=["LCP","FID","CLS"],ET={LCP:"LargestContentfulPaint",FID:"FirstInputDelay",CLS:"CumulativeLayoutShift"},CT={},wT=function(){var e;if(!j_)return"";var t=window.performance,n=void 0;if("function"==typeof(null==t?void 0:t.getEntriesByType)){var i,r=null===(i=window.performance)||void 0===i?void 0:i.getEntriesByType("navigation");(null==r?void 0:r.length)>0&&(n=r[0])}return(null===(e=n)||void 0===e?void 0:e.name)||window.location.href}(),IT=!1,PT=[],xT={LCP:"largest-contentful-paint",FID:"first-input",CLS:"layout-shift"};function AT(){var e=!0===window.__test__resetWebVitalsState;if(!IT||e){e&&(PT=[]),ST.forEach(OT);var t=Symbol();eT=t,[kT,bT,pT].forEach((function(e){return e(LT.bind(null,t),!0)})),[kT,bT,pT].forEach((function(e){return e(RT.bind(null,t))})),IT=!0}}function OT(e){CT[e]={name:e,value:-1,updateHistory:[]};var t=xT[e];"undefined"!=typeof PerformanceObserver&&void 0!==PerformanceObserver.supportedEntryTypes&&"string"==typeof t&&PerformanceObserver.supportedEntryTypes.indexOf(t)>-1||(CT[e].value=-2)}function LT(e,t){if(e===eT){var n=CT[t.name],i=Bb();n&&(n.updateHistory.push({time:i,data:t}),n.value=t.value),PT.forEach((function(e){return e(t,i,!1)}))}}function RT(e,t){e===eT&&PT.forEach((function(e){return e(t,Bb(),!0)}))}var DT=function(){function e(t,n){Dv(this,e),Uv(this,"basePageTreeId",void 0),Uv(this,"basePageKey",void 0),Uv(this,"observing",!1),Uv(this,"appContextMap",new Map),Uv(this,"rumConfig",void 0),Uv(this,"trackingCore",void 0),this.trackingCore=t,this.rumConfig=n}return Nv(e,[{key:"startObserving",value:function(){var e,t,n=this;AT(),this.observing||(this.observing=!0,this.basePageTreeId=this.trackingCore.host.treeID||"_unknown",this.basePageKey=(null===(e=this.trackingCore.getCurrentContext())||void 0===e?void 0:e.pageKey)||"_unknown",ST.forEach((function(e){var t;-2===(null===(t=CT[e])||void 0===t?void 0:t.value)&&n.reportMetric(e)})),t=this.onMetricUpdate.bind(this),PT.push(t))}},{key:"stopObserving",value:function(){this.observing=!1}},{key:"onMetricUpdate",value:function(e,t,n){var i;this.observing&&(n?this.reportMetric(e.name):this.appContextMap.set(t,{time:t,url:location.href,pageKey:null===(i=this.trackingCore.getCurrentContext())||void 0===i?void 0:i.pageKey}))}},{key:"reportMetric",value:function(e){var t=CT[e],n={name:ET[e]||e};"CLS"===e?n.doubleValue=t.value:n.longValue=Math.round(t.value);var i=CT[e];if(i){var r=function(e,t,n,i,r){var a={basePageTreeId:e,basePageKey:t,basePageUrl:wT},s=null;switch(n.name){case"LCP":s=function(e,t){var n;if(0===e.updateHistory.length)return null;var i=e.updateHistory[e.updateHistory.length-1],r=i.data.entries,a=r[r.length-1],s={pageKey:(null===(n=t.get(i.time))||void 0===n?void 0:n.pageKey)||"_unknown",element:Fb(a.element),renderTime:Math.round(a.renderTime),loadTime:Math.round(a.loadTime),size:Math.round(a.size)};return a.url&&(s.url=a.url),s}(n,i);break;case"FID":s=function(e,t){var n;if(0===e.updateHistory.length)return null;var i=e.updateHistory[e.updateHistory.length-1],r=i.data.entries,a=r[r.length-1];return{pageKey:(null===(n=t.get(i.time))||void 0===n?void 0:n.pageKey)||"_unknown",processingStart:Math.round(a.processingStart),processingEnd:Math.round(a.processingEnd),target:Fb(a.target)}}(n,i);break;case"CLS":s=function(e,t){if(0===e.updateHistory.length)return null;var n=e.updateHistory.map((function(e){return e.data.entries})).flat();if(0===n.length)return null;var i=n.reduce((function(e,t){return e&&e.value>t.value?e:t})),r=e.updateHistory.find((function(e){return e.data.entries.includes(i)})),a=null;i&&i.sources&&i.sources.length&&(a=i.sources.reduce((function(e,t){return e.node&&e.previousRect.width*e.previousRect.height>t.previousRect.width*t.previousRect.height?e:t})));var s,o=t.get(r.time);return a&&o?{shiftCount:n.length,"largestShift.value":i.value,"largestShift.hadRecentInput":i.hadRecentInput,"largestShift.largestSource.node":Fb(null===(s=a)||void 0===s?void 0:s.node),"largestShift.pageKey":o.pageKey||"_unknown","largestShift.url":o.url,"largestShift.startTime":Math.round(i.startTime)}:null}(n,i)}if(s){var o={};return r(o,a,s),o}return a}(this.basePageTreeId,this.basePageKey,i,this.appContextMap,this.trackingCore.host.api.assign);n.metadata=function(e){var t={};return Object.keys(e).forEach((function(n){var i=e[n];t[n]="string"==typeof i?i:JSON.stringify(i)})),t}(r)}var a={scope:{scopeType:"APPLICATION_INSTANCE",scopeKey:this.basePageTreeId},metrics:[n]};this.trackingCore.fireEvent({appId:this.rumConfig["app-id"],eventName:"ClientPerfMetricsEvent"},a)}}]),e}(),MT=function(){function e(t,n,i){var r,a;Dv(this,e),Uv(this,"core",void 0),Uv(this,"config",void 0),Uv(this,"collector",void 0),Uv(this,"boomerangStart",-1),Uv(this,"webVitalsObserver",void 0),Uv(this,"appMemoryObserver",void 0),Uv(this,"pageMemoryObserver",void 0),Uv(this,"liveTokens",new Set),Uv(this,"stateWM",new WeakMap),Uv(this,"activeToken",void 0),Uv(this,"isInitial",void 0),Uv(this,"beforeHideHandlerBound",this.beforeHideHandler.bind(this)),this.core=i,this.config=function(e,t){for(var n in e)void 0!==t[n]&&(e[n]=t[n]);return e}(i.host.api.assign({},Xb),n);var s="enabled"===(null===(r=(a=this.core.host).__getLixTreatment)||void 0===r?void 0:r.call(a,"pemberly.tracking.time-origin-epoch-time"));this.collector=new zb(i.host.api,new tT(t,this.config,i.host),this.config,s),this.collector.startObserving(),M_.before("internal:hide",this.beforeHideHandlerBound)}return Nv(e,[{key:"pingCDN",value:function(){}},{key:"recordTreeId",value:function(e,t){e&&this.collector.recordTreeId(e,t)}},{key:"recordRenderStart",value:function(e,t){this.collector.recordRenderStart(e,t||e)}},{key:"recordRenderEnd",value:function(e){this.collector.recordRenderEnd(e)}},{key:"start",value:function(){var e,t;this.activeToken&&this.abort(this.activeToken),this.flushEndedSessions(),this.isInitial=void 0===this.isInitial,this.isInitial||this.collector.reset();var n,i=Object.create(null),r="enabled"===(null===(e=(t=this.core.host).__getLixTreatment)||void 0===e?void 0:e.call(t,"pemberly.tracking.time-origin-epoch-time"));return this.activeToken=i,this.liveTokens.add(i),this.stateWM.set(i,{isInitial:this.isInitial,startTime:Ub(this.core.host.api.performance,r)}),this.config["enable-memory-measurement"]&&(null===(n=this.pageMemoryObserver)||void 0===n||n.stopObserving(),this.pageMemoryObserver=new Qb("page-memory",this.core,this.config),this.pageMemoryObserver.startObserving(),void 0===this.appMemoryObserver&&(this.appMemoryObserver=new Qb("application-memory",this.core,this.config),this.appMemoryObserver.startObserving())),i}},{key:"observeWebVitals",value:function(){void 0===this.webVitalsObserver&&(this.webVitalsObserver=new DT(this.core,this.config),this.webVitalsObserver.startObserving())}},{key:"end",value:function(e){var t,n,i=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2?arguments[2]:void 0;if(e&&this.activeToken&&this.activeToken===e){var s=this.stateWM.get(e),o="enabled"===(null===(t=(n=this.core.host).__getLixTreatment)||void 0===t?void 0:t.call(n,"pemberly.tracking.time-origin-epoch-time")),u=Ub(this.core.host.api.performance,o);s.endProps={renderCompleteTime:u,isImpactedByHiddenWindow:r,rumKey:a};var l=this.activeToken;s.fireRumEventTimeout=setTimeout((function(){var e=i.collector.collect({isInitial:s.isInitial});"then"in e?e.then((function(e){i.fireRumEvent(e,l)})):i.fireRumEvent(e,l)}),this.config["beacon-timeout"]),this.activeToken=void 0}else M_.emit("internal:error",{tags:["core-web-tracking:rum:end"],reason:new Error("RUM end: rum token passed is invalid")})}},{key:"firePageLoadStartEvent",value:function(e,t){if(e&&this.activeToken&&this.activeToken===e){var n=this.stateWM.get(e),i=this.collector.collectPageLoadStartData({isInitial:n.isInitial,rumKey:t});this.core.fireEvent({appId:this.config["app-id"],eventName:"PageLoadStartEvent"},i)}else M_.emit("internal:error",{tags:["core-web-tracking:tracers:pageloadstart"],reason:new Error("Tracers PageloadStart: rum token passed is invalid")})}},{key:"destroy",value:function(){var e,t,n;M_.offBefore("internal:hide",this.beforeHideHandlerBound),this.activeToken&&this.abort(this.activeToken),this.flushEndedSessions(),this.collector.stopObserving(),null===(e=this.webVitalsObserver)||void 0===e||e.stopObserving(),null===(t=this.appMemoryObserver)||void 0===t||t.stopObserving(),null===(n=this.pageMemoryObserver)||void 0===n||n.stopObserving(),this.core.destroy()}},{key:"abort",value:function(e){var t;if(!e||this.activeToken!==e)throw new Error("RUM abort: rum token passed is invalid");if(null!==(t=this.stateWM.get(e))&&void 0!==t&&t.endProps)throw new Error("RUM abort: Can't abort a session that was already ended");this.activeToken=void 0,this.stateWM.delete(e),this.liveTokens.delete(e)}},{key:"flushEndedSessions",value:function(){var e=this;this.liveTokens.forEach((function(t){var n=e.stateWM.get(t);if(n.endProps){var i=e.collector.collect({isInitial:n.isInitial,immediate:!0});e.fireRumEvent(i,t)}}))}},{key:"fireRumEvent",value:function(e,t){if(this.stateWM.get(t)){var n=this.core.host.api.assign,i=this.stateWM.get(t),r=i.startTime,a=i.endProps;if(a){var s=a.renderCompleteTime,o=a.isImpactedByHiddenWindow,u=a.rumKey,l=this.boomerangStart=e.navigationStart||this.boomerangStart,c=e.navigationStart||r,d=s-c,h=this.config["app-version"];this.core.fireEvent({appId:this.config["app-id"],eventName:"RealUserMonitoringEvent"},(function(t){return n({pageKey:u||t.pageKey,isImpactedByHiddenWindow:o,appVersion:h,timeDone:d,navigationStart:c,boomerangStart:l,renderCompleteTime:s},e)})),i.fireRumEventTimeout&&clearTimeout(i.fireRumEventTimeout),this.liveTokens.delete(t),this.stateWM.delete(t)}else this.abort(t)}}},{key:"beforeHideHandler",value:function(){this.flushEndedSessions()}}]),e}(),NT="undefined"!=typeof window&&"undefined"!=typeof performance,UT="undefined"!=typeof location&&-1!==location.search.indexOf("_LI_MEASURE_DEBUG"),BT=(function(){function e(t,n){Dv(this,e),Uv(this,"trackingCore",void 0),Uv(this,"endPageInstance",void 0),Uv(this,"startPageInstance",void 0),Uv(this,"featureIdentifier",void 0),Uv(this,"marks",[]),Uv(this,"spans",[]),Uv(this,"spanStarts",new Map),Uv(this,"started",!1),Uv(this,"ended",!1),Uv(this,"featureKey",void 0),Uv(this,"productName",void 0),Uv(this,"flushOnEnd",void 0),Uv(this,"basePageTreeId",void 0),Uv(this,"debounceFlush",void 0),Uv(this,"disableAutoFlush",void 0),Uv(this,"isCanceled",!1),Uv(this,"isClosed",!1),this.trackingCore=t;var i=n.featureKey,r=n.productName,a=n.flushDebounceMilliseconds,s=n.flushOnEnd;this.featureKey=i,this.productName=r,this.flushOnEnd=s;var o=r?"::".concat(r):"";this.featureIdentifier="".concat(i).concat(o);var u=void 0!==a?a:3e3;u>0&&(this.debounceFlush=function(e,t,n){var i,r,a;void 0===t&&(t=50),void 0===n&&(n={});var s=null!=(i=n.isImmediate)&&i,o=null!=(r=n.callback)&&r,u=n.maxWait,l=Date.now(),c=[];function d(){if(void 0!==u){var e=Date.now()-l;if(e+t>=u)return u-e}return t}var h=function(){var t=[].slice.call(arguments),n=this;return new Promise((function(i,r){var u=s&&void 0===a;if(void 0!==a&&clearTimeout(a),a=setTimeout((function(){if(a=void 0,l=Date.now(),!s){var i=e.apply(n,t);o&&o(i),c.forEach((function(e){return(0,e.resolve)(i)})),c=[]}}),d()),u){var h=e.apply(n,t);return o&&o(h),i(h)}c.push({resolve:i,reject:r})}))};return h.cancel=function(e){void 0!==a&&clearTimeout(a),c.forEach((function(t){return(0,t.reject)(e)})),c=[]},h}(this.flush.bind(this),u)),this.disableAutoFlush=u<0}Nv(e,[{key:"start",value:function(e){var t;if(NT){if(this.started)throw new Error("Same PerfMeasurement (".concat(this.featureIdentifier,") cannot be started twice"));this.startPageInstance=e||(null===(t=this.trackingCore.getCurrentContext())||void 0===t?void 0:t.pageInstance),this.spanStart("load"),this.started=!0}}},{key:"end",value:function(e){var t;if(!this.isClosed){if(this.isClosed=!0,this.isCanceled)throw new Error('[rum measurement] cannot end a canceled measurement "'.concat(this.featureIdentifier,'"'));if(NT){if(this.ended)throw new Error("Same PerfMeasurement (".concat(this.featureIdentifier,") should not be ended twice"));this.endPageInstance=e||(null===(t=this.trackingCore.getCurrentContext())||void 0===t?void 0:t.pageInstance),this.spanEnd("load"),this.ended=!0,this.flushOnEnd&&this.flush()}}}},{key:"mark",value:function(e){NT&&(this.marks.push({name:e,startTime:Bb()}),UT&&(performance.mark("LI:".concat(this.featureIdentifier,"-mark-").concat(e)),performance.measure("LI:".concat(this.featureIdentifier,"-mark-").concat(e),"LI:".concat(this.featureIdentifier,"-start"),"LI:".concat(this.featureIdentifier,"-mark-").concat(e))),this.handleNewData())}},{key:"spanStart",value:function(e){NT&&(this.spanStarts.set(e,Bb()),UT&&performance.mark("LI:".concat(this.featureIdentifier,"-span-").concat(e,"-start")))}},{key:"spanEnd",value:function(e,t){if(NT&&this.spanStarts.has(e)){var n=this.spanStarts.get(e),i=t||e;this.spans.push({name:i,startTime:n,duration:Bb()-n}),UT&&(performance.mark("LI:".concat(this.featureIdentifier,"-span-").concat(e,"-end")),performance.measure("LI:".concat(this.featureIdentifier,"-span-").concat(t||e),"LI:".concat(this.featureIdentifier,"-span-").concat(e,"-start"),"LI:".concat(this.featureIdentifier,"-span-").concat(e,"-end"))),this.handleNewData()}}},{key:"addSpan",value:function(e){this.spans.push(e),this.handleNewData()}},{key:"setBasePageTreeId",value:function(e){this.basePageTreeId=e}},{key:"getTimestamp",value:function(){return Bb()}},{key:"flush",value:function(){0===this.marks.length&&0===this.spans.length||(this.fireEvent(),this.marks=[],this.spans=[],this.debounceFlush&&this.debounceFlush.cancel())}},{key:"handleNewData",value:function(){this.debounceFlush?this.debounceFlush().catch((function(e){})):this.disableAutoFlush||this.flush()}},{key:"fireEvent",value:function(){var e=this,t=this.endPageInstance&&{header:{pageInstance:this.endPageInstance}};this.trackingCore.fireEvent("FeaturePerformanceMeasurementEvent",(function(t){var n=e.startPageInstance||t.pageInstance||S_("unknown"),i={name:e.featureKey,startTime:-1,duration:-1,startPageInstance:n,marks:e.marks,spans:e.spans};return e.productName&&(i.productName=e.productName),e.basePageTreeId&&(i.basePageTreeId=e.basePageTreeId),i}),t)}},{key:"cancel",value:function(){this.isCanceled=!0}},{key:"check",value:function(){if(NT){if(this.isCanceled)throw new Error('[rum measurement] "'.concat(this.featureIdentifier,'" has been canceled'));if(!this.isClosed)throw new Error('[rum measurement] "'.concat(this.featureIdentifier,'" is still open'))}}}])}(),pv((function(e,t){t.__esModule=!0,t.extend=s,t.indexOf=function(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return n;return-1},t.escapeExpression=function(e){if("string"!=typeof e){if(e&&e.toHTML)return e.toHTML();if(null==e)return"";if(!e)return e+"";e=""+e}if(!r.test(e))return e;return e.replace(i,a)},t.isEmpty=function(e){return!e&&0!==e||!(!l(e)||0!==e.length)},t.createFrame=function(e){var t=s({},e);return t._parent=e,t},t.blockParams=function(e,t){return e.path=t,e},t.appendContextPath=function(e,t){return(e?e+".":"")+t};var n={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},i=/[&<>"'`=]/g,r=/[&<>"'`=]/;function a(e){return n[e]}function s(e){for(var t=1;t<arguments.length;t++)for(var n in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],n)&&(e[n]=arguments[t][n]);return e}var o=Object.prototype.toString;t.toString=o;var u=function(e){return"function"==typeof e};u(/x/)&&(t.isFunction=u=function(e){return"function"==typeof e&&"[object Function]"===o.call(e)}),t.isFunction=u;var l=Array.isArray||function(e){return!(!e||"object"!==_typeof2(e))&&"[object Array]"===o.call(e)};t.isArray=l}))),FT=pv((function(e,t){t.__esModule=!0;var n=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function i(e,t){var r=t&&t.loc,a=void 0,s=void 0,o=void 0,u=void 0;r&&(a=r.start.line,s=r.end.line,o=r.start.column,u=r.end.column,e+=" - "+a+":"+o);for(var l=Error.prototype.constructor.call(this,e),c=0;c<n.length;c++)this[n[c]]=l[n[c]];Error.captureStackTrace&&Error.captureStackTrace(this,i);try{r&&(this.lineNumber=a,this.endLineNumber=s,Object.defineProperty?(Object.defineProperty(this,"column",{value:o,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:u,enumerable:!0})):(this.column=o,this.endColumn=u))}catch(e){}}i.prototype=new Error,t.default=i,e.exports=t.default})),jT=pv((function(e,t){t.__esModule=!0,t.default=function(e){e.registerHelper("blockHelperMissing",(function(t,n){var i=n.inverse,r=n.fn;if(!0===t)return r(this);if(!1===t||null==t)return i(this);if(BT.isArray(t))return t.length>0?(n.ids&&(n.ids=[n.name]),e.helpers.each(t,n)):i(this);if(n.data&&n.ids){var a=BT.createFrame(n.data);a.contextPath=BT.appendContextPath(n.data.contextPath,n.name),n={data:a}}return r(t,n)}))},e.exports=t.default})),HT=pv((function(e,t){t.__esModule=!0;var n,i=(n=FT)&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("each",(function(e,t){if(!t)throw new i.default("Must pass iterator to #each");var n,r=t.fn,a=t.inverse,s=0,o="",u=void 0,l=void 0;function c(t,n,i){u&&(u.key=t,u.index=n,u.first=0===n,u.last=!!i,l&&(u.contextPath=l+t)),o+=r(e[t],{data:u,blockParams:BT.blockParams([e[t],t],[l+t,null])})}if(t.data&&t.ids&&(l=BT.appendContextPath(t.data.contextPath,t.ids[0])+"."),BT.isFunction(e)&&(e=e.call(this)),t.data&&(u=BT.createFrame(t.data)),e&&"object"===_typeof2(e))if(BT.isArray(e))for(var d=e.length;s<d;s++)s in e&&c(s,s,s===e.length-1);else if(hv.Symbol&&e[hv.Symbol.iterator]){for(var h=[],p=e[hv.Symbol.iterator](),f=p.next();!f.done;f=p.next())h.push(f.value);for(d=(e=h).length;s<d;s++)c(s,s,s===e.length-1)}else n=void 0,Object.keys(e).forEach((function(e){void 0!==n&&c(n,s-1),n=e,s++})),void 0!==n&&c(n,s-1,!0);return 0===s&&(o=a(this)),o}))},e.exports=t.default})),VT=pv((function(e,t){t.__esModule=!0;var n,i=(n=FT)&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("helperMissing",(function(){if(1!==arguments.length)throw new i.default('Missing helper: "'+arguments[arguments.length-1].name+'"')}))},e.exports=t.default})),qT=pv((function(e,t){t.__esModule=!0;var n,i=(n=FT)&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("if",(function(e,t){if(2!=arguments.length)throw new i.default("#if requires exactly one argument");return BT.isFunction(e)&&(e=e.call(this)),!t.hash.includeZero&&!e||BT.isEmpty(e)?t.inverse(this):t.fn(this)})),e.registerHelper("unless",(function(t,n){if(2!=arguments.length)throw new i.default("#unless requires exactly one argument");return e.helpers.if.call(this,t,{fn:n.inverse,inverse:n.fn,hash:n.hash})}))},e.exports=t.default})),WT=pv((function(e,t){t.__esModule=!0,t.default=function(e){e.registerHelper("log",(function(){for(var t=[void 0],n=arguments[arguments.length-1],i=0;i<arguments.length-1;i++)t.push(arguments[i]);var r=1;null!=n.hash.level?r=n.hash.level:n.data&&null!=n.data.level&&(r=n.data.level),t[0]=r,e.log.apply(e,t)}))},e.exports=t.default})),zT=pv((function(e,t){t.__esModule=!0,t.default=function(e){e.registerHelper("lookup",(function(e,t,n){return e?n.lookupProperty(e,t):e}))},e.exports=t.default})),GT=pv((function(e,t){t.__esModule=!0;var n,i=(n=FT)&&n.__esModule?n:{default:n};t.default=function(e){e.registerHelper("with",(function(e,t){if(2!=arguments.length)throw new i.default("#with requires exactly one argument");BT.isFunction(e)&&(e=e.call(this));var n=t.fn;if(BT.isEmpty(e))return t.inverse(this);var r=t.data;return t.data&&t.ids&&((r=BT.createFrame(t.data)).contextPath=BT.appendContextPath(t.data.contextPath,t.ids[0])),n(e,{data:r,blockParams:BT.blockParams([e],[r&&r.contextPath])})}))},e.exports=t.default})),KT=pv((function(e,t){function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.registerDefaultHelpers=function(e){i.default(e),r.default(e),a.default(e),s.default(e),o.default(e),u.default(e),l.default(e)},t.moveHelperToHooks=function(e,t,n){e.helpers[t]&&(e.hooks[t]=e.helpers[t],n||delete e.helpers[t])};var i=n(jT),r=n(HT),a=n(VT),s=n(qT),o=n(WT),u=n(zT),l=n(GT)})),XT=pv((function(e,t){t.__esModule=!0,t.default=function(e){e.registerDecorator("inline",(function(e,t,n,i){var r=e;return t.partials||(t.partials={},r=function(i,r){var a=n.partials;n.partials=BT.extend({},a,t.partials);var s=e(i,r);return n.partials=a,s}),t.partials[i.args[0]]=i.fn,r}))},e.exports=t.default})),QT=pv((function(e,t){t.__esModule=!0,t.registerDefaultDecorators=function(e){i.default(e)};var n,i=(n=XT)&&n.__esModule?n:{default:n}})),YT=pv((function(e,t){t.__esModule=!0;var n={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if("string"==typeof e){var t=BT.indexOf(n.methodMap,e.toLowerCase());e=t>=0?t:parseInt(e,10)}return e},log:function(e){if(e=n.lookupLevel(e),"undefined"!=typeof console&&n.lookupLevel(n.level)<=e){var t=n.methodMap[e];console[t]||(t="log");for(var i=arguments.length,r=Array(i>1?i-1:0),a=1;a<i;a++)r[a-1]=arguments[a];console[t].apply(console,r)}}};t.default=n,e.exports=t.default})),$T=pv((function(e,t){t.__esModule=!0,t.createNewLookupObject=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return BT.extend.apply(void 0,[Object.create(null)].concat(t))}})),JT=pv((function(e,t){t.__esModule=!0,t.createProtoAccessControl=function(e){var t=Object.create(null);t.constructor=!1,t.__defineGetter__=!1,t.__defineSetter__=!1,t.__lookupGetter__=!1;var n=Object.create(null);return n.__proto__=!1,{properties:{whitelist:$T.createNewLookupObject(n,e.allowedProtoProperties),defaultValue:e.allowProtoPropertiesByDefault},methods:{whitelist:$T.createNewLookupObject(t,e.allowedProtoMethods),defaultValue:e.allowProtoMethodsByDefault}}},t.resultIsAllowed=function(e,t,n){return r("function"==typeof e?t.methods:t.properties,n)},t.resetLoggedProperties=function(){Object.keys(i).forEach((function(e){delete i[e]}))};var n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(YT),i=Object.create(null);function r(e,t){return void 0!==e.whitelist[t]?!0===e.whitelist[t]:void 0!==e.defaultValue?e.defaultValue:(function(e){!0!==i[e]&&(i[e]=!0,n.log("error",'Handlebars: Access has been denied to resolve the property "'+e+'" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details'))}(t),!1)}})),ZT=pv((function(e,t){function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.HandlebarsEnvironment=a;var i=n(FT),r=n(YT);t.VERSION="4.7.7";t.COMPILER_REVISION=8;t.LAST_COMPATIBLE_COMPILER_REVISION=7;t.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};function a(e,t,n){this.helpers=e||{},this.partials=t||{},this.decorators=n||{},KT.registerDefaultHelpers(this),QT.registerDefaultDecorators(this)}a.prototype={constructor:a,logger:r.default,log:r.default.log,registerHelper:function(e,t){if("[object Object]"===BT.toString.call(e)){if(t)throw new i.default("Arg not supported with multiple helpers");BT.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if("[object Object]"===BT.toString.call(e))BT.extend(this.partials,e);else{if(void 0===t)throw new i.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=t}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,t){if("[object Object]"===BT.toString.call(e)){if(t)throw new i.default("Arg not supported with multiple decorators");BT.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function(){JT.resetLoggedProperties()}};var s=r.default.log;t.log=s,t.createFrame=BT.createFrame,t.logger=r.default})),ek=pv((function(e,t){function n(e){this.string=e}t.__esModule=!0,n.prototype.toString=n.prototype.toHTML=function(){return""+this.string},t.default=n,e.exports=t.default})),tk=pv((function(e,t){t.__esModule=!0,t.wrapHelper=function(e,t){if("function"!=typeof e)return e;return function(){var n=arguments[arguments.length-1];return arguments[arguments.length-1]=t(n),e.apply(this,arguments)}}})),nk=pv((function(e,t){t.__esModule=!0,t.checkRevision=function(e){var t=e&&e[0]||1,n=ZT.COMPILER_REVISION;if(t>=ZT.LAST_COMPATIBLE_COMPILER_REVISION&&t<=ZT.COMPILER_REVISION)return;if(t<ZT.LAST_COMPATIBLE_COMPILER_REVISION){var i=ZT.REVISION_CHANGES[n],a=ZT.REVISION_CHANGES[t];throw new r.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+i+") or downgrade your runtime to an older version ("+a+").")}throw new r.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+e[1]+").")},t.template=function(e,t){if(!t)throw new r.default("No environment passed to template");if(!e||!e.main)throw new r.default("Unknown template object: "+_typeof2(e));e.main.decorator=e.main_d,t.VM.checkRevision(e.compiler);var n=e.compiler&&7===e.compiler[0];var s={strict:function(e,t,n){if(!e||!(t in e))throw new r.default('"'+t+'" not defined in '+e,{loc:n});return s.lookupProperty(e,t)},lookupProperty:function(e,t){var n=e[t];return null==n||Object.prototype.hasOwnProperty.call(e,t)||JT.resultIsAllowed(n,s.protoAccessControl,t)?n:void 0},lookup:function(e,t){for(var n=e.length,i=0;i<n;i++){if(null!=(e[i]&&s.lookupProperty(e[i],t)))return e[i][t]}},lambda:function(e,t){return"function"==typeof e?e.call(t):e},escapeExpression:i.escapeExpression,invokePartial:function(n,a,s){s.hash&&(a=i.extend({},a,s.hash),s.ids&&(s.ids[0]=!0)),n=t.VM.resolvePartial.call(this,n,a,s);var o=i.extend({},s,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),u=t.VM.invokePartial.call(this,n,a,o);if(null==u&&t.compile&&(s.partials[s.name]=t.compile(n,e.compilerOptions,t),u=s.partials[s.name](a,o)),null!=u){if(s.indent){for(var l=u.split("\n"),c=0,d=l.length;c<d&&(l[c]||c+1!==d);c++)l[c]=s.indent+l[c];u=l.join("\n")}return u}throw new r.default("The partial "+s.name+" could not be compiled when running in runtime-only mode")},fn:function(t){var n=e[t];return n.decorator=e[t+"_d"],n},programs:[],program:function(e,t,n,i,r){var s=this.programs[e],o=this.fn(e);return t||r||i||n?s=a(this,e,o,t,n,i,r):s||(s=this.programs[e]=a(this,e,o)),s},data:function(e,t){for(;e&&t--;)e=e._parent;return e},mergeIfNeeded:function(e,t){var n=e||t;return e&&t&&e!==t&&(n=i.extend({},t,e)),n},nullContext:Object.seal({}),noop:t.VM.noop,compilerInfo:e.compiler};function l(t){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=n.data;l._setup(n),!n.partial&&e.useData&&(i=o(t,i));var r=void 0,a=e.useBlockParams?[]:void 0;function c(t){return""+e.main(s,t,s.helpers,s.partials,i,a,r)}return e.useDepths&&(r=n.depths?t!=n.depths[0]?[t].concat(n.depths):n.depths:[t]),(c=u(e.main,c,s,n.depths||[],i,a))(t,n)}return l.isTop=!0,l._setup=function(r){if(r.partial)s.protoAccessControl=r.protoAccessControl,s.helpers=r.helpers,s.partials=r.partials,s.decorators=r.decorators,s.hooks=r.hooks;else{var a=i.extend({},t.helpers,r.helpers);!function(e,t){Object.keys(e).forEach((function(n){var r=e[n];e[n]=function(e,t){var n=t.lookupProperty;return tk.wrapHelper(e,(function(e){return i.extend({lookupProperty:n},e)}))}(r,t)}))}(a,s),s.helpers=a,e.usePartial&&(s.partials=s.mergeIfNeeded(r.partials,t.partials)),(e.usePartial||e.useDecorators)&&(s.decorators=i.extend({},t.decorators,r.decorators)),s.hooks={},s.protoAccessControl=JT.createProtoAccessControl(r);var o=r.allowCallsToHelperMissing||n;KT.moveHelperToHooks(s,"helperMissing",o),KT.moveHelperToHooks(s,"blockHelperMissing",o)}},l._child=function(t,n,i,o){if(e.useBlockParams&&!i)throw new r.default("must pass block params");if(e.useDepths&&!o)throw new r.default("must pass parent depths");return a(s,t,e[t],n,0,i,o)},l},t.wrapProgram=a,t.resolvePartial=function(e,t,n){e?e.call||n.name||(n.name=e,e=n.partials[e]):e="@partial-block"===n.name?n.data["partial-block"]:n.partials[n.name];return e},t.invokePartial=function(e,t,n){var a=n.data&&n.data["partial-block"];n.partial=!0,n.ids&&(n.data.contextPath=n.ids[0]||n.data.contextPath);var o=void 0;n.fn&&n.fn!==s&&function(){n.data=ZT.createFrame(n.data);var e=n.fn;o=n.data["partial-block"]=function(t){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return n.data=ZT.createFrame(n.data),n.data["partial-block"]=a,e(t,n)},e.partials&&(n.partials=i.extend({},n.partials,e.partials))}();void 0===e&&o&&(e=o);if(void 0===e)throw new r.default("The partial "+n.name+" could not be found");if(e instanceof Function)return e(t,n)},t.noop=s;var n,i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(BT),r=(n=FT)&&n.__esModule?n:{default:n};function a(e,t,n,i,r,a,s){function o(t){var r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=s;return!s||t==s[0]||t===e.nullContext&&null===s[0]||(o=[t].concat(s)),n(e,t,e.helpers,e.partials,r.data||i,a&&[r.blockParams].concat(a),o)}return(o=u(n,o,e,s,i,a)).program=t,o.depth=s?s.length:0,o.blockParams=r||0,o}function s(){return""}function o(e,t){return t&&"root"in t||((t=t?ZT.createFrame(t):{}).root=e),t}function u(e,t,n,r,a,s){if(e.decorator){var o={};t=e.decorator(t,o,n,r&&r[0],a,s,r),i.extend(t,o)}return t}})),ik=pv((function(e,t){t.__esModule=!0,t.default=function(e){var t=void 0!==hv?hv:window,n=t.Handlebars;e.noConflict=function(){return t.Handlebars===e&&(t.Handlebars=n),e}},e.exports=t.default})),rk=pv((function(e,t){function n(e){return e&&e.__esModule?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}t.__esModule=!0;var r=i(ZT),a=n(ek),s=n(FT),o=i(BT),u=i(nk),l=n(ik);function c(){var e=new r.HandlebarsEnvironment;return o.extend(e,r),e.SafeString=a.default,e.Exception=s.default,e.Utils=o,e.escapeExpression=o.escapeExpression,e.VM=u,e.template=function(t){return u.template(t,e)},e}var d=c();d.create=c,l.default(d),d.default=d,t.default=d,e.exports=t.default})),ak={};ak.button=rk.template({1:function(e,t,n,i,r){return"disabled"},compiler:[8,">= 4.3.0"],main:function(e,t,n,i,r){var a,s,o=null!=t?t:e.nullContext||{},u=e.hooks.helperMissing,l="function",c=e.escapeExpression,d=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'<button class="'+c(_typeof2(s=null!=(s=d(n,"buttonClass")||(null!=t?d(t,"buttonClass"):t))?s:u)===l?s.call(o,{name:"buttonClass",hash:{},data:r,loc:{start:{line:1,column:15},end:{line:1,column:30}}}):s)+'" data-ssplayer-event="'+c(_typeof2(s=null!=(s=d(n,"event")||(null!=t?d(t,"event"):t))?s:u)===l?s.call(o,{name:"event",hash:{},data:r,loc:{start:{line:1,column:53},end:{line:1,column:62}}}):s)+'" '+(null!=(a=d(n,"if").call(o,null!=t?d(t,"disabled"):t,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r,loc:{start:{line:1,column:64},end:{line:1,column:95}}}))?a:"")+'>\n  <li-icon class="'+c(_typeof2(s=null!=(s=d(n,"iconClass")||(null!=t?d(t,"iconClass"):t))?s:u)===l?s.call(o,{name:"iconClass",hash:{},data:r,loc:{start:{line:2,column:18},end:{line:2,column:31}}}):s)+'" type="'+c(_typeof2(s=null!=(s=d(n,"icon")||(null!=t?d(t,"icon"):t))?s:u)===l?s.call(o,{name:"icon",hash:{},data:r,loc:{start:{line:2,column:39},end:{line:2,column:47}}}):s)+'-icon" a11y-text="'+c(_typeof2(s=null!=(s=d(n,"text")||(null!=t?d(t,"text"):t))?s:u)===l?s.call(o,{name:"text",hash:{},data:r,loc:{start:{line:2,column:65},end:{line:2,column:73}}}):s)+'"></li-icon>\n</button>\n'},useData:!0}),ak["endcards/embed-endcard"]=rk.template({1:function(e,t,n,i,r){return"embed-endcard__current--single-card"},3:function(e,t,n,i,r,a){var s,o=null!=t?t:e.nullContext||{},u=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'    <div class="embed-endcard__related">\n      <h3 class="embed-endcard__headline">\n        '+e.escapeExpression((u(n,"t8")||t&&u(t,"t8")||e.hooks.helperMissing).call(o,"or_explore_related_courses",{name:"t8",hash:{},data:r,blockParams:a,loc:{start:{line:12,column:8},end:{line:12,column:43}}}))+'\n      </h3>\n        <ul class="embed-endcard__related-list">\n'+(null!=(s=u(n,"each").call(o,null!=t?u(t,"relatedCourses"):t,{name:"each",hash:{},fn:e.program(4,r,1,a),inverse:e.noop,data:r,blockParams:a,loc:{start:{line:15,column:10},end:{line:19,column:19}}}))?s:"")+"        </ul>\n    </div>\n"},4:function(e,t,n,i,r,a){var s,o=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'            <li class="embed-endcard__related-item">\n'+(null!=(s=e.invokePartial(o(i,"endcards/entities/video-entity"),t,{name:"endcards/entities/video-entity",hash:{entity:a[0][0]},data:r,blockParams:a,indent:"              ",helpers:n,partials:i,decorators:e.decorators}))?s:"")+"            </li>\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,i,r,a){var s,o=null!=t?t:e.nullContext||{},u=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'<div class="embed-endcard">\n  <div class="embed-endcard__current '+(null!=(s=u(n,"unless").call(o,null!=(s=null!=t?u(t,"relatedCourses"):t)?u(s,"length"):s,{name:"unless",hash:{},fn:e.program(1,r,0,a),inverse:e.noop,data:r,blockParams:a,loc:{start:{line:2,column:37},end:{line:2,column:116}}}))?s:"")+'">\n    <h3 class="embed-endcard__headline">\n      '+e.escapeExpression((u(n,"t8")||t&&u(t,"t8")||e.hooks.helperMissing).call(o,"watch_more_from_this_course",{name:"t8",hash:{},data:r,blockParams:a,loc:{start:{line:4,column:6},end:{line:4,column:42}}}))+"\n    </h3>\n"+(null!=(s=e.invokePartial(u(i,"endcards/entities/video-entity"),t,{name:"endcards/entities/video-entity",hash:{entity:null!=t?u(t,"course"):t},data:r,blockParams:a,indent:"    ",helpers:n,partials:i,decorators:e.decorators}))?s:"")+"  </div>\n\n"+(null!=(s=u(n,"if").call(o,null!=(s=null!=t?u(t,"relatedCourses"):t)?u(s,"length"):s,{name:"if",hash:{},fn:e.program(3,r,0,a),inverse:e.noop,data:r,blockParams:a,loc:{start:{line:9,column:2},end:{line:22,column:9}}}))?s:"")+"</div>\n"},usePartial:!0,useData:!0,useBlockParams:!0}),ak["endcards/entities/video-entity"]=rk.template({compiler:[8,">= 4.3.0"],main:function(e,t,n,i,r){var a,s,o=e.lambda,u=e.escapeExpression,l=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'<div class="video-entity">\n  <a class="video-entity__link" href='+u(o(null!=(a=null!=t?l(t,"entity"):t)?l(a,"url"):a,t))+" target="+u("function"==typeof(s=null!=(s=l(n,"external-link-target")||(null!=t?l(t,"external-link-target"):t))?s:e.hooks.helperMissing)?s.call(null!=t?t:e.nullContext||{},{name:"external-link-target",hash:{},data:r,loc:{start:{line:2,column:64},end:{line:2,column:88}}}):s)+'>\n    <img alt="'+u(o(null!=(a=null!=t?l(t,"entity"):t)?l(a,"title"):a,t))+'" class="video-entity__img" src='+u(o(null!=(a=null!=t?l(t,"entity"):t)?l(a,"thumbnailUrl"):a,t))+' />\n    <div class="video-entity__content">\n      <div class="video-entity__title">\n        '+u(o(null!=(a=null!=t?l(t,"entity"):t)?l(a,"title"):a,t))+"\n      </div>\n    </div>\n  </a>\n</div>"},useData:!0}),ak["layers/captions"]=rk.template({compiler:[8,">= 4.3.0"],main:function(e,t,n,i,r){return'<div class="captions">\n  <span class="captions__text"></span>\n</div>\n'},useData:!0}),ak["lil-brand"]=rk.template({compiler:[8,">= 4.3.0"],main:function(e,t,n,i,r){var a,s=null!=t?t:e.nullContext||{},o=e.hooks.helperMissing,u=e.escapeExpression,l=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'<a\n  class="lil-brand '+u("function"===_typeof2(a=null!=(a=l(n,"class")||(null!=t?l(t,"class"):t))?a:o)?a.call(s,{name:"class",hash:{},data:r,loc:{start:{line:2,column:19},end:{line:2,column:28}}}):a)+'"\n  data-ssplayer-event="linkedin"\n  href="https://www.linkedin.com/learning"\n  target="'+u("function"===_typeof2(a=null!=(a=l(n,"external-link-target")||(null!=t?l(t,"external-link-target"):t))?a:o)?a.call(s,{name:"external-link-target",hash:{},data:r,loc:{start:{line:5,column:10},end:{line:5,column:34}}}):a)+'">\n  <linkedin-logo type="inverse-bug" size="21dp" color="inverse">LEARNING</linkedin-logo>\n</a>\n'},useData:!0}),ak["share-overlay"]=rk.template({1:function(e,t,n,i,r){var a,s=e.escapeExpression,o=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'        <li>\n          <button class="ssplayer-share-btn"\n            data-ssplayer-network="linkedin"\n            data-ssplayer-url="'+s(e.lambda(null!=(a=null!=t?o(t,"urls"):t)?o(a,"linkedinUrl"):a,t))+'"\n            type="button"\n          >\n            <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 100 100">\n              <g fill="none">\n                <path d="M0 90C0 95.5 4.5 100 10 100L90 100C95.5 100 100 95.5 100 90L100 10C100 4.5 95.5 0 90 0L10 0C4.5 0 0 4.5 0 10L0 90Z" fill="#0077B5"/>\n                <path d="M53.8 42C55.9 38.4 61.2 34.3 68.6 34.3 80.3 34.3 86.4 41 86.4 52.5L86.4 84.7 72.1 84.7 72.1 59.3C72.1 52.5 70.2 48.6 63.8 48.6 56.7 48.6 54.3 54.7 54.3 61.1L54.3 84.7 40 84.7 40 34.7 53.8 34.7 53.8 42Z" fill="#FFF"/>\n                <polygon points="15.5 85.5 29.8 85.5 29.8 35.5 15.5 35.5" fill="#FFF"/>\n                <path d="M22.6 12.9C27.2 12.9 31 16.6 31 21.2 31 25.8 27.2 29.5 22.6 29.5 18 29.5 14.3 25.8 14.3 21.2 14.3 16.6 18 12.9 22.6 12.9Z" fill="#FFF"/>\n              </g>\n            </svg>\n            <span class="a11y-text">'+s((o(n,"t8")||t&&o(t,"t8")||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"share_this_course_on_linkedin",{name:"t8",hash:{},data:r,loc:{start:{line:28,column:36},end:{line:28,column:74}}}))+"</span>\n          </button>\n        </li>\n"},3:function(e,t,n,i,r){var a,s=e.escapeExpression,o=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'        <li>\n          <button class="ssplayer-share-btn"\n            data-ssplayer-network="facebook"\n            data-ssplayer-url="'+s(e.lambda(null!=(a=null!=t?o(t,"urls"):t)?o(a,"facebookUrl"):a,t))+'"\n            type="button"\n          >\n            <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 100 100">\n              <g fill="none">\n                <path d="M0 90C0 95.5 4.5 100 10 100L90 100C95.5 100 100 95.5 100 90L100 10C100 4.5 95.5 0 90 0L10 0C4.5 0 0 4.5 0 10L0 90Z" fill="#395185"/>\n                <path d="M69.6 101L69.6 62.2 82.5 62.2 84.5 47.1 69.6 47.1 69.6 37.5C69.6 33.1 70.8 30.1 77 30.1L85 30.1 85 16.6C83.6 16.4 78.9 16 73.4 16 61.9 16 54 23 54 36L54 47.1 41 47.1 41 62.2 54 62.2 54 101 69.6 101Z" fill="#FFF"/>\n              </g>\n            </svg>\n            <span class="a11y-text">'+s((o(n,"t8")||t&&o(t,"t8")||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"share_this_course_on_facebook",{name:"t8",hash:{},data:r,loc:{start:{line:45,column:36},end:{line:45,column:74}}}))+"</span>\n          </button>\n        </li>\n"},5:function(e,t,n,i,r){var a,s=e.escapeExpression,o=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'        <li>\n          <button class="ssplayer-share-btn"\n            data-ssplayer-network="twitter"\n            data-ssplayer-url="'+s(e.lambda(null!=(a=null!=t?o(t,"urls"):t)?o(a,"twitterUrl"):a,t))+'"\n            type="button"\n          >\n            <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 100 100">\n              <g fill="none">\n                <path d="M0 90C0 95.523 4.475 100 10 100L90 100C95.523 100 100 95.525 100 90L100 10C100 4.477 95.525 0 90 0L10 0C4.477 0 0 4.475 0 10L0 90Z" fill="#55acee"/>\n                <path d="M82.993 30.161C80.523 31.195 77.874 31.862 75.082 32.162 77.946 30.594 80.129 28.093 81.132 25.124 78.483 26.592 75.548 27.659 72.398 28.226 69.892 25.758 66.313 24.19 62.375 24.19 54.751 24.19 48.595 29.894 48.595 36.932 48.595 37.933 48.702 38.9 48.953 39.834 37.498 39.3 27.369 34.23 20.568 26.525 19.387 28.393 18.706 30.594 18.706 32.929 18.706 37.332 21.14 41.235 24.827 43.536 22.572 43.469 20.46 42.902 18.599 41.935L18.599 42.102C18.599 48.272 23.36 53.409 29.624 54.577 28.478 54.877 27.261 55.01 26.008 55.01 25.114 55.01 24.255 54.943 23.431 54.81 25.185 59.847 30.268 63.549 36.281 63.649 31.557 67.051 25.651 69.086 19.172 69.086 18.062 69.086 16.988 69.019 15.914 68.919 22 72.521 29.23 74.623 36.997 74.623 62.34 74.623 76.156 55.244 76.156 38.399L76.12 36.765C78.841 34.964 81.167 32.729 82.993 30.161Z" fill="#FFF"/>\n              </g>\n            </svg>\n            <span class="a11y-text">'+s((o(n,"t8")||t&&o(t,"t8")||e.hooks.helperMissing).call(null!=t?t:e.nullContext||{},"share_this_course_on_twitter",{name:"t8",hash:{},data:r,loc:{start:{line:62,column:36},end:{line:62,column:73}}}))+"</span>\n          </button>\n        </li>\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,i,r){var a,s=null!=t?t:e.nullContext||{},o=e.hooks.helperMissing,u=e.escapeExpression,l=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'<div class="ssplayer-modal ssplayer-component-hide embed-share-modal">\n  <button\n    class="ssplayer-modal-close"\n    data-ssplayer-modal-close\n    type="button"\n  >\n    <li-icon type="cancel-icon" aria-hidden="true"></li-icon>\n    <span class="a11y-text">'+u((l(n,"t8")||t&&l(t,"t8")||o).call(s,"close",{name:"t8",hash:{},data:r,loc:{start:{line:8,column:28},end:{line:8,column:42}}}))+'</span>\n  </button>\n  <div class="ssplayer-modal-content">\n    <h4 class="ssplayer-share-title">'+u((l(n,"t8")||t&&l(t,"t8")||o).call(s,"share_this_course",{name:"t8",hash:{},data:r,loc:{start:{line:11,column:37},end:{line:11,column:63}}}))+'</h4>\n    <ul class="ssplayer-share-btn-list">\n'+(null!=(a=l(n,"if").call(s,null!=(a=null!=t?l(t,"urls"):t)?l(a,"linkedinUrl"):a,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r,loc:{start:{line:13,column:6},end:{line:31,column:13}}}))?a:"")+(null!=(a=l(n,"if").call(s,null!=(a=null!=t?l(t,"urls"):t)?l(a,"facebookUrl"):a,{name:"if",hash:{},fn:e.program(3,r,0),inverse:e.noop,data:r,loc:{start:{line:32,column:6},end:{line:48,column:13}}}))?a:"")+(null!=(a=l(n,"if").call(s,null!=(a=null!=t?l(t,"urls"):t)?l(a,"twitterUrl"):a,{name:"if",hash:{},fn:e.program(5,r,0),inverse:e.noop,data:r,loc:{start:{line:49,column:6},end:{line:65,column:13}}}))?a:"")+'    </ul>\n    <p class="ssplayer-share-link">\n      '+u(e.lambda(null!=(a=null!=t?l(t,"urls"):t)?l(a,"courseUrl"):a,t))+"\n    </p>\n  </div>\n</div>\n"},useData:!0}),ak["toolbars/bottom-toolbar"]=rk.template({1:function(e,t,n,i,r){var a,s=null!=t?t:e.nullContext||{},o=e.hooks.helperMissing,u=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(a=e.invokePartial(u(i,"button"),t,{name:"button",hash:{text:(u(n,"t8")||t&&u(t,"t8")||o).call(s,"skip_back_num_seconds",{name:"t8",hash:{seconds:(u(n,"format-number")||t&&u(t,"format-number")||o).call(s,"10",{name:"format-number",hash:{},data:r,loc:{start:{line:38,column:49},end:{line:38,column:69}}})},data:r,loc:{start:{line:38,column:13},end:{line:38,column:70}}}),icon:"rewind-ten",event:"play",buttonClass:"ssplayer-rewind-button"},data:r,indent:"      ",helpers:n,partials:i,decorators:e.decorators}))?a:""},3:function(e,t,n,i,r){var a,s=null!=t?t:e.nullContext||{},o=e.hooks.helperMissing,u=e.escapeExpression,l=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'      <div class="video-player__toolbar-menu">\n'+(null!=(a=e.invokePartial(l(i,"button"),t,{name:"button",hash:{text:(l(n,"t8")||t&&l(t,"t8")||o).call(s,"settings",{name:"t8",hash:{},data:r,loc:{start:{line:70,column:15},end:{line:70,column:30}}}),icon:"gear",buttonClass:"ssplayer-settings-button ssplayer-toolbar-menu-button"},data:r,indent:"        ",helpers:n,partials:i,decorators:e.decorators}))?a:"")+'        <span class="video-player__toolbar-menu-content video-player__toolbar-menu-right">\n          <div class="">\n            <section class="settings-menu__section">\n              <p class="settings-menu__title">'+u((l(n,"t8")||t&&l(t,"t8")||o).call(s,"playback_speed",{name:"t8",hash:{},data:r,loc:{start:{line:75,column:46},end:{line:75,column:69}}}))+'</p>\n              <ul class="settings-menu__options-list">\n                <li class="settings-menu__option">'+u((l(n,"t8")||t&&l(t,"t8")||o).call(s,"playback_speed_x",{name:"t8",hash:{speed:(l(n,"format-number")||t&&l(t,"format-number")||o).call(s,"2",{name:"format-number",hash:{},data:r,loc:{start:{line:77,column:80},end:{line:77,column:99}}})},data:r,loc:{start:{line:77,column:50},end:{line:77,column:101}}}))+'</li>\n                <li class="settings-menu__option">'+u((l(n,"t8")||t&&l(t,"t8")||o).call(s,"playback_speed_x",{name:"t8",hash:{speed:(l(n,"format-number")||t&&l(t,"format-number")||o).call(s,"1.75",{name:"format-number",hash:{},data:r,loc:{start:{line:78,column:80},end:{line:78,column:102}}})},data:r,loc:{start:{line:78,column:50},end:{line:78,column:104}}}))+'</li>\n                <li class="settings-menu__option">'+u((l(n,"t8")||t&&l(t,"t8")||o).call(s,"playback_speed_x",{name:"t8",hash:{speed:(l(n,"format-number")||t&&l(t,"format-number")||o).call(s,"1.5",{name:"format-number",hash:{},data:r,loc:{start:{line:79,column:80},end:{line:79,column:101}}})},data:r,loc:{start:{line:79,column:50},end:{line:79,column:103}}}))+'</li>\n                <li class="settings-menu__option">'+u((l(n,"t8")||t&&l(t,"t8")||o).call(s,"playback_speed_x",{name:"t8",hash:{speed:(l(n,"format-number")||t&&l(t,"format-number")||o).call(s,"1.25",{name:"format-number",hash:{},data:r,loc:{start:{line:80,column:80},end:{line:80,column:102}}})},data:r,loc:{start:{line:80,column:50},end:{line:80,column:104}}}))+'</li>\n                <li class="settings-menu__option settings-menu__option--active">'+u((l(n,"t8")||t&&l(t,"t8")||o).call(s,"playback_speed_x",{name:"t8",hash:{speed:(l(n,"format-number")||t&&l(t,"format-number")||o).call(s,"1",{name:"format-number",hash:{},data:r,loc:{start:{line:81,column:110},end:{line:81,column:129}}})},data:r,loc:{start:{line:81,column:80},end:{line:81,column:131}}}))+'</li>\n                <li class="settings-menu__option">'+u((l(n,"t8")||t&&l(t,"t8")||o).call(s,"playback_speed_x",{name:"t8",hash:{speed:(l(n,"format-number")||t&&l(t,"format-number")||o).call(s,"0.75",{name:"format-number",hash:{},data:r,loc:{start:{line:82,column:80},end:{line:82,column:102}}})},data:r,loc:{start:{line:82,column:50},end:{line:82,column:104}}}))+'</li>\n                <li class="settings-menu__option">'+u((l(n,"t8")||t&&l(t,"t8")||o).call(s,"playback_speed_x",{name:"t8",hash:{speed:(l(n,"format-number")||t&&l(t,"format-number")||o).call(s,"2",{name:"format-number",hash:{},data:r,loc:{start:{line:83,column:80},end:{line:83,column:99}}})},data:r,loc:{start:{line:83,column:50},end:{line:83,column:101}}}))+'</li>\n              </ul>\n            </section>\n            <section class="settings-menu__section">\n              <p class="settings-menu__title">'+u((l(n,"t8")||t&&l(t,"t8")||o).call(s,"video_quality",{name:"t8",hash:{},data:r,loc:{start:{line:87,column:46},end:{line:87,column:68}}}))+'</p>\n              <ul class="settings-menu__options-list">\n                <li class="settings-menu__option">'+u((l(n,"t8")||t&&l(t,"t8")||o).call(s,"video_quality_360p",{name:"t8",hash:{},data:r,loc:{start:{line:89,column:50},end:{line:89,column:77}}}))+'</li>\n                <li class="settings-menu__option settings-menu__option--active">'+u((l(n,"t8")||t&&l(t,"t8")||o).call(s,"video_quality_540p",{name:"t8",hash:{},data:r,loc:{start:{line:90,column:80},end:{line:90,column:107}}}))+'</li>\n                <li class="settings-menu__option">'+u((l(n,"t8")||t&&l(t,"t8")||o).call(s,"video_quality_720p",{name:"t8",hash:{},data:r,loc:{start:{line:91,column:50},end:{line:91,column:77}}}))+"</li>\n              </ul>\n            </section>\n          </div>\n        </span>\n      </div>\n"},5:function(e,t,n,i,r){var a,s=null!=t?t:e.nullContext||{},o=e.hooks.helperMissing,u=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'      <div class="video-player__toolbar-menu">\n'+(null!=(a=e.invokePartial(u(i,"button"),t,{name:"button",hash:{text:(u(n,"t8")||t&&u(t,"t8")||o).call(s,"share",{name:"t8",hash:{},data:r,loc:{start:{line:124,column:15},end:{line:124,column:27}}}),icon:"share-linkedin",event:"share",buttonClass:"ssplayer-share-button"},data:r,indent:"        ",helpers:n,partials:i,decorators:e.decorators}))?a:"")+(null!=(a=e.invokePartial(u(i,"tooltip"),t,{name:"tooltip",hash:{static:(u(n,"t8")||t&&u(t,"t8")||o).call(s,"share",{name:"t8",hash:{},data:r,loc:{start:{line:128,column:17},end:{line:128,column:29}}}),position:"right"},data:r,indent:"        ",helpers:n,partials:i,decorators:e.decorators}))?a:"")+"      </div>\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,i,r){var a,s=null!=t?t:e.nullContext||{},o=e.hooks.helperMissing,u=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'<div class="ssplayer-video-toolbar ssplayer-video-toolbar-bottom ssplayer-superposed ssplayer-slide-down">\n  <div class="ssplayer-progress ssplayer-progress-slider ssplayer-autoexpand">\n    <progress class="ssplayer-primary"></progress>\n    <progress class="ssplayer-buffer ssplayer-secondary ssplayer-animate"></progress>\n  </div>\n  <div class="ssplayer-left-actions">\n    <div class="video-player__toolbar-menu">\n'+(null!=(a=e.invokePartial(u(i,"button"),t,{name:"button",hash:{text:(u(n,"t8")||t&&u(t,"t8")||o).call(s,"replay",{name:"t8",hash:{},data:r,loc:{start:{line:12,column:13},end:{line:12,column:26}}}),icon:"replay",event:"play",buttonClass:"ssplayer-replay-button playback__button"},data:r,indent:"      ",helpers:n,partials:i,decorators:e.decorators}))?a:"")+(null!=(a=e.invokePartial(u(i,"button"),t,{name:"button",hash:{text:(u(n,"t8")||t&&u(t,"t8")||o).call(s,"play",{name:"t8",hash:{},data:r,loc:{start:{line:18,column:13},end:{line:18,column:24}}}),icon:"play",event:"play",buttonClass:"ssplayer-play-button playback__button"},data:r,indent:"      ",helpers:n,partials:i,decorators:e.decorators}))?a:"")+(null!=(a=e.invokePartial(u(i,"button"),t,{name:"button",hash:{text:(u(n,"t8")||t&&u(t,"t8")||o).call(s,"pause",{name:"t8",hash:{},data:r,loc:{start:{line:24,column:13},end:{line:24,column:25}}}),icon:"pause",event:"pause",buttonClass:"ssplayer-pause-button playback__button"},data:r,indent:"      ",helpers:n,partials:i,decorators:e.decorators}))?a:"")+(null!=(a=e.invokePartial(u(i,"tooltip"),t,{name:"tooltip",hash:{dynamic2:(u(n,"t8")||t&&u(t,"t8")||o).call(s,"replay",{name:"t8",hash:{},data:r,loc:{start:{line:30,column:17},end:{line:30,column:30}}}),dynamic1:(u(n,"t8")||t&&u(t,"t8")||o).call(s,"pause",{name:"t8",hash:{},data:r,loc:{start:{line:29,column:17},end:{line:29,column:29}}}),dynamic0:(u(n,"t8")||t&&u(t,"t8")||o).call(s,"play",{name:"t8",hash:{},data:r,loc:{start:{line:28,column:17},end:{line:28,column:28}}}),position:"left"},data:r,indent:"      ",helpers:n,partials:i,decorators:e.decorators}))?a:"")+"    </div>\n"+(null!=(a=u(n,"if").call(s,null!=t?u(t,"rewind"):t,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r,loc:{start:{line:33,column:4},end:{line:40,column:11}}}))?a:"")+'    <div class="ssplayer-time-display">\n      <span class="ssplayer-time-display-current-time"></span>\n      <span class="ssplayer-time-display-separator">/</span>\n      <span class="ssplayer-time-display-duration"></span>\n    </div>\n  </div>\n  <div class="ssplayer-right-actions">\n\n'+(null!=(a=e.invokePartial(u(i,"toolbars/captions-button"),t,{name:"toolbars/captions-button",data:r,indent:"    ",helpers:n,partials:i,decorators:e.decorators}))?a:"")+'\n    <div class="ssplayer-toolbar-menu">\n      <button class="ssplayer-volume-switch ssplayer-toolbar-menu-button">\n        <li-icon class="ssplayer-volume-muted" type="mute-icon"></li-icon>\n        <li-icon class="ssplayer-volume-min" type="volume-min-icon"></li-icon>\n        <li-icon class="ssplayer-volume-med" type="volume-med-icon"></li-icon>\n        <li-icon class="ssplayer-volume-max" type="volume-max-icon"></li-icon>\n      </button>\n      <span class="ssplayer-toolbar-menu-content ssplayer-vertical video-player__volume-slider-menu">\n        <div class="ssplayer-volume-slider">\n          <span class="ssplayer-handle"></span>\n          <progress class="ssplayer-primary"></progress>\n        </div>\n      </span>\n    </div>\n'+(null!=(a=u(n,"if").call(s,null!=t?u(t,"settings"):t,{name:"if",hash:{},fn:e.program(3,r,0),inverse:e.noop,data:r,loc:{start:{line:65,column:4},end:{line:97,column:11}}}))?a:"")+'\n    <div class="video-player__toolbar-menu">\n'+(null!=(a=e.invokePartial(u(i,"button"),t,{name:"button",hash:{text:(u(n,"t8")||t&&u(t,"t8")||o).call(s,"fullscreen",{name:"t8",hash:{},data:r,loc:{start:{line:104,column:13},end:{line:104,column:30}}}),icon:"fullscreen",event:"enterFullscreen",buttonClass:"ssplayer-fullscreen-on-button fullscreen__button"},data:r,indent:"      ",helpers:n,partials:i,decorators:e.decorators}))?a:"")+(null!=(a=e.invokePartial(u(i,"button"),t,{name:"button",hash:{text:(u(n,"t8")||t&&u(t,"t8")||o).call(s,"exit_fullscreen",{name:"t8",hash:{},data:r,loc:{start:{line:110,column:13},end:{line:110,column:35}}}),icon:"exit-fullscreen",event:"exitFullscreen",buttonClass:"ssplayer-fullscreen-off-button fullscreen__button"},data:r,indent:"      ",helpers:n,partials:i,decorators:e.decorators}))?a:"")+(null!=(a=e.invokePartial(u(i,"tooltip"),t,{name:"tooltip",hash:{dynamic1:(u(n,"t8")||t&&u(t,"t8")||o).call(s,"exit_fullscreen",{name:"t8",hash:{},data:r,loc:{start:{line:115,column:17},end:{line:115,column:39}}}),dynamic0:(u(n,"t8")||t&&u(t,"t8")||o).call(s,"fullscreen",{name:"t8",hash:{},data:r,loc:{start:{line:114,column:17},end:{line:114,column:34}}}),position:"right"},data:r,indent:"      ",helpers:n,partials:i,decorators:e.decorators}))?a:"")+"    </div>\n"+(null!=(a=u(n,"if").call(s,null!=t?u(t,"withShare"):t,{name:"if",hash:{},fn:e.program(5,r,0),inverse:e.noop,data:r,loc:{start:{line:118,column:4},end:{line:131,column:11}}}))?a:"")+"  </div>\n</div>\n"},usePartial:!0,useData:!0}),ak["toolbars/captions-button"]=rk.template({compiler:[8,">= 4.3.0"],main:function(e,t,n,i,r){var a,s=null!=t?t:e.nullContext||{},o=e.hooks.helperMissing,u=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'<div class="video-player__toolbar-menu captions-button">\n'+(null!=(a=e.invokePartial(u(i,"button"),t,{name:"button",hash:{disabled:!0,text:(u(n,"t8")||t&&u(t,"t8")||o).call(s,"turn_captions_off",{name:"t8",hash:{},data:r,loc:{start:{line:6,column:9},end:{line:6,column:33}}}),icon:"closed-caption-filled",event:"hideCaptions",buttonClass:"captions-button__on ssplayer-toolbar-menu-button"},data:r,indent:"  ",helpers:n,partials:i,decorators:e.decorators}))?a:"")+(null!=(a=e.invokePartial(u(i,"button"),t,{name:"button",hash:{disabled:!0,text:(u(n,"t8")||t&&u(t,"t8")||o).call(s,"turn_captions_on",{name:"t8",hash:{},data:r,loc:{start:{line:13,column:9},end:{line:13,column:32}}}),icon:"closed-caption",event:"showCaptions",buttonClass:"captions-button__off ssplayer-toolbar-menu-button"},data:r,indent:"  ",helpers:n,partials:i,decorators:e.decorators}))?a:"")+(null!=(a=e.invokePartial(u(i,"tooltip"),t,{name:"tooltip",hash:{dynamic2:(u(n,"t8")||t&&u(t,"t8")||o).call(s,"captions_unavailable",{name:"t8",hash:{},data:r,loc:{start:{line:20,column:13},end:{line:20,column:40}}}),dynamic1:(u(n,"t8")||t&&u(t,"t8")||o).call(s,"turn_captions_off",{name:"t8",hash:{},data:r,loc:{start:{line:19,column:13},end:{line:19,column:37}}}),dynamic0:(u(n,"t8")||t&&u(t,"t8")||o).call(s,"turn_captions_on",{name:"t8",hash:{},data:r,loc:{start:{line:18,column:13},end:{line:18,column:36}}}),position:"right"},data:r,indent:"  ",helpers:n,partials:i,decorators:e.decorators}))?a:"")+"</div>\n"},usePartial:!0,useData:!0}),ak["toolbars/top-toolbar"]=rk.template({compiler:[8,">= 4.3.0"],main:function(e,t,n,i,r){var a,s,o=e.lambda,u=e.escapeExpression,l=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'<div class="ssplayer-video-toolbar top-toolbar slide-up">\n'+(null!=(a=e.invokePartial(l(i,"lil-brand"),t,{name:"lil-brand",hash:{class:"top-toolbar__brand top-toolbar__item"},data:r,indent:"  ",helpers:n,partials:i,decorators:e.decorators}))?a:"")+'\n  <a\n    class="top-toolbar__item top-toolbar__link"\n    href="'+u(o(null!=(a=null!=t?l(t,"course"):t)?l(a,"url"):a,t))+'"\n    target="'+u("function"==typeof(s=null!=(s=l(n,"external-link-target")||(null!=t?l(t,"external-link-target"):t))?s:e.hooks.helperMissing)?s.call(null!=t?t:e.nullContext||{},{name:"external-link-target",hash:{},data:r,loc:{start:{line:8,column:12},end:{line:8,column:36}}}):s)+'">\n    <span class="top-toolbar__title">'+u(o(null!=(a=null!=t?l(t,"video"):t)?l(a,"title"):a,t))+"</span>\n  </a>\n</div>\n"},usePartial:!0,useData:!0}),ak.tooltip=rk.template({1:function(e,t,n,i,r){var a,s,o=null!=t?t:e.nullContext||{},u=e.hooks.helperMissing,l=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'  <div\n    class="video-player__toolbar-menu-content'+(null!=(a=c(n,"if").call(o,null!=t?c(t,"position"):t,{name:"if",hash:{},fn:e.program(2,r,0),inverse:e.noop,data:r,loc:{start:{line:4,column:45},end:{line:4,column:108}}}))?a:"")+' video-player__tooltip"\n    data-tooltip-text-0="'+l("function"===_typeof2(s=null!=(s=c(n,"dynamic0")||(null!=t?c(t,"dynamic0"):t))?s:u)?s.call(o,{name:"dynamic0",hash:{},data:r,loc:{start:{line:5,column:25},end:{line:5,column:37}}}):s)+'"\n    data-tooltip-text-1="'+l("function"===_typeof2(s=null!=(s=c(n,"dynamic1")||(null!=t?c(t,"dynamic1"):t))?s:u)?s.call(o,{name:"dynamic1",hash:{},data:r,loc:{start:{line:6,column:25},end:{line:6,column:37}}}):s)+'"\n    data-tooltip-text-2="'+l("function"===_typeof2(s=null!=(s=c(n,"dynamic2")||(null!=t?c(t,"dynamic2"):t))?s:u)?s.call(o,{name:"dynamic2",hash:{},data:r,loc:{start:{line:7,column:25},end:{line:7,column:37}}}):s)+'"\n  >'+l("function"===_typeof2(s=null!=(s=c(n,"static")||(null!=t?c(t,"static"):t))?s:u)?s.call(o,{name:"static",hash:{},data:r,loc:{start:{line:8,column:3},end:{line:8,column:13}}}):s)+"</div>\n"},2:function(e,t,n,i,r){var a,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return" video-player__toolbar-menu-"+e.escapeExpression("function"==typeof(a=null!=(a=s(n,"position")||(null!=t?s(t,"position"):t))?a:e.hooks.helperMissing)?a.call(null!=t?t:e.nullContext||{},{name:"position",hash:{},data:r,loc:{start:{line:4,column:89},end:{line:4,column:101}}}):a)},compiler:[8,">= 4.3.0"],main:function(e,t,n,i,r){var a,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(a=s(n,"if").call(null!=t?t:e.nullContext||{},null!=t?s(t,"dynamic0"):t,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r,loc:{start:{line:2,column:0},end:{line:9,column:7}}}))?a:""},useData:!0}),ak["video-errorcard"]=rk.template({compiler:[8,">= 4.3.0"],main:function(e,t,n,i,r){var a,s,o=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'<div class="video-errorcard">\n'+(null!=(a=e.invokePartial(o(i,"lil-brand"),t,{name:"lil-brand",hash:{class:"video-errorcard__brand"},data:r,indent:"  ",helpers:n,partials:i,decorators:e.decorators}))?a:"")+'\n  <h3 class="video-errorcard__title">\n    This video is no longer available\n  </h3>\n\n  <p class="video-errorcard__subtitle">\n    Get business, technology, and creative skills you need with\n    expert-led online courses on LinkedIn Learning.\n  </p>\n\n  <div class="video-errorcard__site">\n    <a\n      class="video-errorcard__site-link"\n      data-ssplayer-event="linkedin"\n      href="https://www.linkedin.com/learning"\n      target="'+e.escapeExpression("function"==typeof(s=null!=(s=o(n,"external-link-target")||(null!=t?o(t,"external-link-target"):t))?s:e.hooks.helperMissing)?s.call(null!=t?t:e.nullContext||{},{name:"external-link-target",hash:{},data:r,loc:{start:{line:19,column:14},end:{line:19,column:38}}}):s)+'">\n      Go to LinkedIn Learning\n    </a>\n  </div>\n</div>\n'},usePartial:!0,useData:!0}),ak["video-player"]=rk.template({1:function(e,t,n,i,r){var a,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(a=e.invokePartial(s(i,"toolbars/top-toolbar"),t,{name:"toolbars/top-toolbar",hash:{video:null!=t?s(t,"video"):t,course:null!=t?s(t,"course"):t},data:r,indent:"  ",helpers:n,partials:i,decorators:e.decorators}))?a:""},compiler:[8,">= 4.3.0"],main:function(e,t,n,i,r){var a,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return(null!=(a=s(n,"if").call(null!=t?t:e.nullContext||{},null!=t?s(t,"withTopToolbar"):t,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r,loc:{start:{line:1,column:0},end:{line:6,column:7}}}))?a:"")+'\n<video class="video-js media-player__player">\n</video>\n\n<div class="video-endcards">\n'+(null!=(a=e.invokePartial(s(i,"endcards/embed-endcard"),t,{name:"endcards/embed-endcard",hash:{relatedCourses:null!=t?s(t,"relatedCourses"):t,course:null!=t?s(t,"course"):t},data:r,indent:"  ",helpers:n,partials:i,decorators:e.decorators}))?a:"")+(null!=(a=e.invokePartial(s(i,"video-errorcard"),t,{name:"video-errorcard",data:r,indent:"  ",helpers:n,partials:i,decorators:e.decorators}))?a:"")+"</div>\n"},usePartial:!0,useData:!0}),ak.video=rk.template({compiler:[8,">= 4.3.0"],main:function(e,t,n,i,r){var a,s=e.lambda,o=e.escapeExpression,u=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'<video\n  class="video-js player"\n  preload=""\n  webkit-playsinline=""\n  data-continuous-play=""\n  src="'+o(s(null!=(a=null!=t?u(t,"video"):t)?u(a,"src"):a,t))+'"\n  poster="'+o(s(null!=(a=null!=t?u(t,"video"):t)?u(a,"poster"):a,t))+'"\n  width="790"\n  height="444"\n  style="width: 100%; height: 100%;">\n</video>\n'},useData:!0});var sk={en_US:{turn_captions_off:"Turn captions off",turn_captions_on:"Turn captions on",captions_unavailable:"No captions available",course:"COURSE",exit_fullscreen:"Exit fullscreen",fullscreen:"Fullscreen",pause:"Pause",play:"Play",playback_speed:"Playback speed",playback_speed_x:"{:speed}x",replay:"Replay",settings:"Settings",share:"Share",skip_back_num_seconds:"Skip back {:seconds} seconds",video_quality:"Video quality",video_quality_360p:"360p",video_quality_540p:"540p",video_quality_720p:"720p HD",share_this_course:"Share this course",share_this_course_on_linkedin:"Share this course on LinkedIn",share_this_course_on_twitter:"Share this course on Twitter",share_this_course_on_facebook:"Share this course on Facebook",watch_more_from_this_course:"Watch more from this course",or_explore_related_courses:"Or explore related courses",close:"Close",watch_more_on_linkedin_learning:"Watch more on LinkedIn Learning",next_video:"NEXT VIDEO",duration_minutes:"{:minutes}m {:seconds}s",duration_seconds:"{:seconds}s",textTrackLabel:"English",textTrackSrclang:"en"},es_ES:{turn_captions_off:"Desactivar los subtítulos",turn_captions_on:"Activar los subtítulos",captions_unavailable:"No hay subtítulos",exit_fullscreen:"Salir de la pantalla completa",replay:"Volver a reproducir",settings:"Configuración",play:"Reproducir",pause:"Pausa",fullscreen:"Pantalla completa",playback_speed:"Velocidad de reproducción",skip_back_num_seconds:"Retroceder {:seconds} segundos",playback_speed_x:"{:speed}x",course:"CURSO",share:"Compartir",video_quality:"Calidad de vídeo",video_quality_360p:"360p",video_quality_540p:"540p",video_quality_720p:"720p HD",share_this_course:"Compartir este curso",share_this_course_on_linkedin:"Compartir este curso en LinkedIn",share_this_course_on_twitter:"Compartir este curso en Twitter",share_this_course_on_facebook:"Compartir este curso en Facebook",watch_more_from_this_course:"Ver más de este curso",or_explore_related_courses:"O explorar otros cursos relacionados",close:"Cerrar",watch_more_on_linkedin_learning:"Ver más en LinkedIn Learning",next_video:"SIGUIENTE VÍDEO",duration_minutes:"{:minutes} m {:seconds} s",duration_seconds:"{:seconds} s",textTrackLabel:"Español",textTrackSrclang:"es"},fr_FR:{turn_captions_off:"Désactiver les sous-titres",turn_captions_on:"Activer les sous-titres",captions_unavailable:"Aucun sous-titre disponible",exit_fullscreen:"Sortir du plein écran",replay:"Relancer",settings:"Préférences",play:"Lire",pause:"Interrompre",fullscreen:"Plein écran",playback_speed:"Vitesse de lecture",skip_back_num_seconds:"Retour de {:seconds} secondes",playback_speed_x:"{:speed}x",video_quality:"Qualité de la vidéo",video_quality_360p:"360p",video_quality_540p:"540p",video_quality_720p:"720p HD",course:"COURS",share:"Partager",share_this_course:"Partager ce cours",share_this_course_on_linkedin:"Partager ce cours sur LinkedIn",share_this_course_on_twitter:"Partager ce cours sur Twitter",share_this_course_on_facebook:"Partager ce cours sur Facebook",watch_more_from_this_course:"En voir plus de ce cours",or_explore_related_courses:"Ou découvrir des cours connexes",close:"Fermer",watch_more_on_linkedin_learning:"En voir plus sur LinkedIn Learning",next_video:"VIDÉO SUIVANTE",duration_minutes:"{:minutes} min {:seconds} sec",duration_seconds:"{:seconds} sec",textTrackLabel:"Français",textTrackSrclang:"fr"},de_DE:{turn_captions_off:"Untertitel ausschalten",turn_captions_on:"Untertitel einschalten",captions_unavailable:"Keine Untertitel verfügbar",exit_fullscreen:"Vollbild beenden",replay:"Erneut abspielen",settings:"Einstellungen",play:"Ansehen",pause:"Anhalten",fullscreen:"Vollbild",playback_speed:"Abspielgeschwindigkeit",skip_back_num_seconds:"{:seconds} Sekunden zurückspringen",playback_speed_x:"{:speed}x",video_quality:"Videoqualität",video_quality_360p:"360p",video_quality_540p:"540p",video_quality_720p:"720p HD",course:"Kurs",share:"Teilen",share_this_course:"Diesen Kurs teilen",share_this_course_on_linkedin:"Kurs auf LinkedIn teilen",share_this_course_on_twitter:"Kurs auf Twitter teilen",share_this_course_on_facebook:"Kurs auf Facebook teilen",watch_more_from_this_course:"Mehr aus diesem Kurs ansehen",or_explore_related_courses:"Oder ähnliche Kurse ansehen",close:"Schließen",watch_more_on_linkedin_learning:"Mehr auf LinkedIn Learning ansehen",next_video:"NÄCHSTES VIDEO",duration_minutes:"{:minutes} Min. {:seconds} Sek.",duration_seconds:"{:seconds} Sek.",textTrackLabel:"Deutsche",textTrackSrclang:"de"},ja_JP:{turn_captions_off:"字幕: 無効にする",turn_captions_on:"字幕: 有効にする",captions_unavailable:"字幕: なし",exit_fullscreen:"全画面モードを解除",replay:"もう一度見る",settings:"設定",play:"再生",pause:"一時停止",fullscreen:"フルスクリーン",playback_speed:"再生速度",skip_back_num_seconds:"スキップして{:seconds}秒戻る",playback_speed_x:"{:speed}x",video_quality:"動画品質",video_quality_360p:"360p",video_quality_540p:"540p",video_quality_720p:"720p HD",course:"コース",share:"シェア",share_this_course:"このコースをシェアする",share_this_course_on_linkedin:"このコースをLinkedInでシェアする",share_this_course_on_twitter:"このコースをTwitterでシェアする",share_this_course_on_facebook:"このコースをFacebookでシェアする",watch_more_from_this_course:"このコースの動画をさらに視聴する",or_explore_related_courses:"関連するコースを検索する",close:"閉じる",watch_more_on_linkedin_learning:"LinkedInラーニングで視聴する",next_video:"次の動画",duration_minutes:"{:minutes}分{:seconds}秒",duration_seconds:"{:seconds}秒",textTrackLabel:"日本語",textTrackSrclang:"ja"},pt_BR:{turn_captions_off:"Desativar legendas",turn_captions_on:"Ativar legendas",captions_unavailable:"Não há legendas disponíveis",course:"CURSO",exit_fullscreen:"Sair da tela cheia",fullscreen:"Tela cheia",pause:"Pausar",play:"Reproduzir",playback_speed:"Velocidade de reprodução",playback_speed_x:"{:speed}x",replay:"Reproduzir novamente",settings:"Comprado",share:"Compartilhar",skip_back_num_seconds:"Voltar {:seconds} segundos",video_quality:"Qualidade do vídeo",video_quality_360p:"360p",video_quality_540p:"540p",video_quality_720p:"720p HD",share_this_course:"Compartilhar este curso",share_this_course_on_linkedin:"Compartilhar este curso no LinkedIn",share_this_course_on_twitter:"Compartilhar este curso no Twitter",share_this_course_on_facebook:"Compartilhar este curso no Facebook",watch_more_from_this_course:"Assistir mais deste curso",or_explore_related_courses:"Ou explorar cursos relacionados",close:"Fechar",watch_more_on_linkedin_learning:"Assistir mais no LinkedIn Learning",next_video:"PRÓXIMO VÍDEO",duration_minutes:"{:minutes}m {:seconds}s",duration_seconds:"{:seconds}s",textTrackLabel:"Português",textTrackSrclang:"pt"},zh_CN:{turn_captions_off:"关闭字幕",turn_captions_on:"打开字幕",captions_unavailable:"无可用字幕",course:"课程",exit_fullscreen:"退出全屏",fullscreen:"全屏",pause:"暂停",play:"播放",playback_speed:"播放速度",playback_speed_x:"{:speed} 倍",replay:"重播",settings:"设置",share:"分享",skip_back_num_seconds:"后退 {:seconds} 秒",video_quality:"视频质量",video_quality_360p:"360p",video_quality_540p:"540p",video_quality_720p:"720p 高清",share_this_course:"分享本课程",share_this_course_on_linkedin:"将此课程分享到领英",share_this_course_on_twitter:"将此课程分享到推特",share_this_course_on_facebook:"将此课程分享到 Facebook",watch_more_from_this_course:"观看本课程的更多内容",or_explore_related_courses:"或探索相关课程",close:"关闭",watch_more_on_linkedin_learning:"在领英学习上观看更多课程",next_video:"下一个视频",duration_minutes:"{:minutes} 分钟 {:seconds} 秒",duration_seconds:"{:seconds} 秒",textTrackLabel:"简体中文",textTrackSrclang:"zh"}},ok=window.t8,uk=["en_US","fr_FR","es_ES","de_DE","ja_JP","pt_BR","zh_CN"],lk=new(function(){function e(){_classCallCheck2(this,e),this.locale="en_US"}return _createClass2(e,[{key:"locale",get:function(){return this._locale},set:function(e){uk.indexOf(e)>-1&&(this._locale=e)}},{key:"formatName",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"FULL_NAME";return(new ok.NameFormatter).format(e,t,this.locale)}},{key:"formatNumber",value:function(e){return(new ok.NumberFormatter).format(e,this.locale)}}]),e}());function ck(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(e||"").replace(/{:((\w|\d)+)}/g,(function(e,n){return t[n]||""}))}function dk(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=sk[lk.locale]||{},i=n[e];return i?ck(i,t.hash):e}rk.registerHelper("t8",dk),rk.registerHelper("format-number",(function(e){return lk.formatNumber(e)})),rk.registerHelper("format-name",(function(e,t){return lk.formatName(e,t.hash.type)})),rk.registerHelper("format-duration",(function(e){var t=Math.floor(e/60),n=e%60;return t>0?dk("duration_minutes",{hash:{minutes:String(t),seconds:String(n)}}):dk("duration_seconds",{hash:{seconds:String(n)}})}));var hk=/\b(Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Windows Phone|Opera Mini)\b/i;function pk(e){return hk.test(e)}var fk=pk(window.navigator.userAgent);rk.registerHelper("external-link-target",(function(){return fk?"_top":"_blank"}));var mk=pv((function(e,t){e.exports=function(){var e="aria-[a-z0-9_\\-]+|class|data-[a-z0-9_\\-]+|dir|id|role|tabindex",t="undefined"==typeof document||"textContent"in document.createElement("div")?"textContent":"innerText",n=["b","del","em","i","s","strong","sub","sup"],i=n.concat(["a","abbr","address","area","article","aside","audio","bdi","bdo","big","blockquote","br","button","center","cite","code","datalist","dd","details","dfn","div","dl","dt","fieldset","figcaption","figure","font","footer","h1","h2","h3","h4","h5","h6","header","hgroup","hr","img","ins","kbd","label","legend","li","map","mark","marquee","nav","nobr","ol","p","pre","q","rp","rt","ruby","samp","section","small","source","span","strike","table","tbody","td","tfoot","th","thead","time","tr","u","ul","var","video","wbr"]),r=[e,"alt|checked|selected|colgroup|cols|colspan|disabled|height|hidden|maxlength|method|multiple|name|placeholder|readonly|rel|required|rows|rowspan|spellcheck|target|title|width","border|caption|color|controls|coords|hreflang|label|lang|loop|marginheight|marginwidth|preload|reversed|type|usemap|clear|headers|ismap|start|datetime|accept|max|min|size|step|style|cellspacing|cellpadding"].join("|");function a(){}function s(e,t){if(t=t||"log","undefined"!=typeof window&&window&&window.jet&&"error"===t.toLowerCase())try{throw new Error(e)}catch(e){try{window.jet.error(e)}catch(e){}}"undefined"!=typeof console&&"function"==typeof console[t]&&console[t](e)}var o,u,l=(u=/[&<>"'\u0000\\=]/g,o={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","\0":"�","\\":"&#92;","=":"&#61;"},function(e){return null==e?null:e.toString().replace(u,(function(e){return o[e]}))}),c=function(){var e,n,i=/&(?:([a-z0-9]+)|#x([\da-f]{1,6})|#(\d{1,8}));/gi;if("undefined"==typeof document)return function(){throw new Error("document is undefined (i.e. you are probably in Node.js)")};e=document.createElement("div");var r={nbsp:" ",lt:"<",gt:">",amp:"&",quot:'"'};return n="function"==typeof String.fromCodePoint?function(e){return String.fromCodePoint(e)}:function(e){return e<=65535?String.fromCharCode(e):"�"},function(a){return null==a?null:(a+"").replace(i,(function(i,a,s,o){return a?(u=a,r.hasOwnProperty(u)?r[u]:(e.innerHTML="&"+u+";",l=e[t],r[u]=l,l)):s||o?n(parseInt(s||o,s?16:10)||65533):"�";var u,l}))}}(),d=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function h(e){return/[<&]/.test(e)}var p,f=Array.prototype.forEach?function(e,t){Array.prototype.forEach.call(e,t)}:function(e,t){for(var n=0,i=e.length;n<i;n++)t(e[n],n)};function m(e){e=d(e)?e:[e];var t,n,a,s=0,o="<(?!/?";return o+="(?:",f(e,(function(e,u){t=e.tags||i,n=e.attrs||r,a=e.checkUrlAttrs||!1,0!==u&&(o+="|"),o+="(?:"+t.join("|")+")",o+="(?:",o+="[ \t\r\n]*",o+="|[ \t\r\n]+",o+="(?:(?:",o+="(?:"+n+")(?:=([\"'])[^'\"<>]*\\"+ ++s+")?",a&&(o+="|(?:href|src)=([\"'])(?:(?:https?|ftp|mailto|invalid)(?::|&#(?:58|x3a);)|(?:data:image/(?:gif|jpg|jpeg|png);base64,)|[/.#?]|&#(?:35|4[67]|63|x(?:2[3ef]|3f));)[^'\"<>]*\\"+ ++s),o+=")[ \t\r\n]*)+",o+=")"})),o+=")",o+="/?>)",new RegExp(o,"i")}function g(e){return m({tags:e=e||i,checkUrlAttrs:!0})}function v(e,t){var n=(t=t||{}).allowTags,i=!1!==t.hasCustomElementMarkup;return n?!g(n).test(e):i?!v.R_UNSAFE_CUSTOM_ELEMENT.test(e):!v.R_UNSAFE_HTML.test(e)}function y(e){return e.replace(/<[^>]*>|[<>'"&\\]/g,"")}function _(e,t,n){if(null==e)return null;e=e.toString();var i=t?function(e,t){var n={};return e.replace(/\{([^}]+)\}/g,(function(e,i){var r,s=e;if(n.hasOwnProperty(i))return n[i];if(t.hasOwnProperty(i)){if(!((r="string"==typeof(s=t[i]))||s instanceof a||"number"==typeof s))throw new Error("Only strings, numbers, and jSecure types are allowed as placeholder replacements.");s=r?l(s):s.toString()}return n[i]=s,s}))}(e,t):e,r=e;return h(i)&&!v(i,n)&&(i=y(i),s("Content contains tags or attributes that are not allowed:\nContent: "+r,"error")),i}function b(e,t){for(var n=+t.length,i=0,r=e.length;i<n;i++)e[r++]=t[i];return e.length=r,e}v.R_UNSAFE_HTML=g(),v.R_UNSAFE_CUSTOM_ELEMENT=m([{tags:i,checkUrlAttrs:!0},{tags:[(p={tag:"li-icon",attrs:"active|a11y-text|animate|color|size|type"}).tag],attrs:[e,p.attrs].join("|"),checkUrlAttrs:!1}]);var T={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};T.optgroup=T.option,T.tbody=T.tfoot=T.colgroup=T.caption=T.thead,T.th=T.td;var k=/<([\w:]+)/;function S(e,t){var n,i,r,a,s,o,u,l=t.createDocumentFragment(),c=[];for(s=0,u=e.length;s<u;s++)if((a=e[s])||0===a)if("string"==typeof a){for(r=r||l.appendChild(t.createElement("div")),n=(k.exec(a)||["",""])[1].toLowerCase(),w(r,(i=T[n]||T._default)[1]+a+i[2]),o=i[0];o--;)r.lastChild&&r.lastChild.nodeType===Node.ELEMENT_NODE&&(r=r.lastChild);b(c,r.childNodes),(r=l.firstChild).textContent=""}else b(c,a.nodeType?[a]:a);for(l.textContent="",a=c[s=0];a;)l.appendChild(a),a=c[++s];return l}var E=_,C=_;function w(e,n,i){var r=_(n,i);return h(r)?e.innerHTML=r:e[t]=r,r}function I(e,t){if(!(this instanceof I))return new I(e,t);(t=t||{}).allowTags=t.allowTags?t.allowTags.reduce((function(e,t){return e.concat(t)}),[]):null,this._string=e,this._options=t}I.prototype=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}(new a,{toString:function(){var e=this._string,t=this._stringVal,n=e;return void 0!==t?t:(v(e,this._options)||(n=e,e=y(e),s("UnsafeString contains tags or attributes that are not allowed.\nString: "+n,"error")),this._stringVal=e,e)}});var P=/ /g,x=/[\s\u0000<>"]|%00/,A=/\\/,O=/([.]|%2e){2}/i,L=new RegExp("^(?:HTTPS?|https?|ftp|mailto|tel|sms|blob|voyager|android-app|linkedin|chrome-extension|invalid|data:(?:(?:image/(?:gif|jpe?g|png|webp|bmp|tiff))|(?:application/x-font-woff)|(?:font/(?:opentype|ttf)))[;,]|[/.#?])");function R(e){var t=void 0;if("string"!=typeof e)return s("jSecure Warning: url must be a string","error"),"invalid://";if((t=e.trim()).indexOf(" ")>-1&&(s("jSecure Warning: url should not contain spaces: "+e,"warn"),t=t.replace(P,"+")),!L.test(t))return s("jSecure Error: URL should be absolute with allowed schemas, relative, a hash fragment or query string. "+e,"error"),"invalid://";if(x.test(t))return s("jSecure Error: not valid url character found in url: "+e,"error"),"invalid://";var n=t.split("?")[0],i=void 0,r=!1;try{i=decodeURI(n)}catch(e){r=!0}return r?(s("jSecure Error: malformed url path detected: "+n),"invalid://"):A.test(n)||O.test(n)||O.test(i)?(s("jSecure Error: malicious data found in url path: "+n,"error"),"invalid://"):e}var D={redirect:function(e){window&&(window.location.href=e)}};return{ALLOWED_TAGS:i,FORMATTING_TAGS:n,htmlEncode:l,htmlUnencode:c,log:s,mk:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var r="",a=void 0,s=n.length;return e&&e.forEach((function(e,t){r+=e,t<s&&(a=n[t],r+=a instanceof I?a:l(a))})),C(r)},parseHTML:function(e,t){var n;if(t=t||document.implementation&&document.implementation.createHTMLDocument?document.implementation.createHTMLDocument(""):document,"string"==typeof e)n=S([e],t);else{if(!d(e))return e;n=S(e,t)}return b([],n.childNodes)},parseSelector:function(e){return"string"==typeof e&&/^(?:\s*(<[\w\W]+>)[^>]*)$/.test(e)?[]:e},processTemplate:E,reEncode:function(e){return l(c(e))},_redirector:D,redirect:function(e){var t=R(e);t===e&&D.redirect(t)},sanitizeHTML:C,sanitizeUrl:R,setElementContent:w,text:function(e){return s("jSecure.text() is deprecated. Please use jSecure.htmlEncode().","warn"),l(e)},unsafe:function(e){return e},UnsafeString:I}}()}));function gk(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t={},n=e;return n||(n=window.location.search),n.indexOf("?")>-1&&(n=n.split("?")[1]),(n=n.split("&")).length&&n.forEach((function(e){if(e){var n=e.split("="),i=n[0],r=n[1]&&decodeURIComponent(n[1]);t[i]=r}})),t}var vk=(gk()||{}).claim,yk=void 0===vk?"unknown":vk;function _k(e,t){return function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{shouldEncode:!0},r=n,a=e;if(!t)return a;null==r&&(r=""),r instanceof Array&&(r=r.join(",")),"object"===_typeof2(r)&&(r=r.toString());var s="",o=a.indexOf("#");if(-1!==o){var u=a.split("#"),l=_slicedToArray2(u,2);a=l[0],s=l[1],s="#".concat(s)}var c=null;c="".concat(t,"=").concat(i.shouldEncode?encodeURIComponent(r):r);var d=a.indexOf("?"),h="&";return-1===d&&(h="?"),"".concat(a).concat(h).concat(c).concat(s)}(e,"trk","embed_".concat(yk,"_").concat(t,"_learning"))}function bk(e){return mk.sanitizeUrl("".concat("https://www.linkedin.com/learning","/").concat(e))}function Tk(e){var t,n,i,r,a,s,o,u=e&&e.sourceV2Union&&e.sourceV2Union.vectorImage;return u?(n=(t=u).artifacts,i=void 0===n?[]:n,r=t.digitalmediaAsset,a=void 0===r?"":r,s=t.rootUrl,o=void 0===s?"":s,{artifacts:i,digitalmediaAsset:a,rootUrl:mk.sanitizeUrl(o)}):null}function kk(e,t,n,i){return e?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.rootUrl||"",i=t&&t.fileIdentifyingUrlPathSegment||"";return"".concat(n).concat(i)}(e,function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=t,a=n;if(!e||!e.artifacts||!e.artifacts.length)return null;r*=i,a*=i;var s=e.artifacts,o=(s=s.sort((function(e,t){return e.width-t.width})))[s.length-1];return r||a?s.find((function(e){return e.width>=r&&e.height>=a}))||o:null}(e,t,n,i)):null}function Sk(e){var t,n,i,r=e.locale,a=void 0===r?{}:r,s=e.slug,o=void 0===s?"":s,u=e.title,l=void 0===u?"":u,c=e.urn,d=void 0===c?"":c,h=e.thumbnailV2,p=Tk(void 0===h?{}:h),f=kk(p,512,218);return f&&(f=mk.sanitizeUrl(f)),{locale:(t=a,n=t.country,i=t.language,"".concat(i,"_").concat(n)),slug:o,title:mk.sanitizeHTML(l),url:bk(o),urn:d,thumbnailV2:p,thumbnailUrl:f}}var Ek=new(function(){function e(){_classCallCheck2(this,e),this._lixTreatments={}}return _createClass2(e,[{key:"lixTreatments",get:function(){return this._lixTreatments},set:function(e){this._lixTreatments=e}},{key:"getTreatmentIsEnabled",value:function(e){return"control"!==this._lixTreatments[e]}}]),e}());function Ck(e,t){return t.split(".").reduce((function(e,t){return e&&e[t]?e[t]:null}),e)}var wk=Ik;function Ik(e){xk.length||Pk(),xk[xk.length]=e}var Pk,xk=[],Ak=0;function Ok(){for(;Ak<xk.length;){var e=Ak;if(Ak+=1,xk[e].call(),Ak>1024){for(var t=0,n=xk.length-Ak;t<n;t++)xk[t]=xk[t+Ak];xk.length-=Ak,Ak=0}}xk.length=0,Ak=0}var Lk,Rk,Dk,Mk=void 0!==hv?hv:self,Nk=Mk.MutationObserver||Mk.WebKitMutationObserver;function Uk(e){return function(){var t=setTimeout(i,0),n=setInterval(i,50);function i(){clearTimeout(t),clearInterval(n),e()}}}function Bk(){}"function"==typeof Nk?(Lk=1,Rk=new Nk(Ok),Dk=document.createTextNode(""),Rk.observe(Dk,{characterData:!0}),Pk=function(){Lk=-Lk,Dk.data=Lk}):Pk=Uk(Ok),Ik.requestFlush=Pk,Ik.makeRequestCallFromTimer=Uk;var Fk=null,jk={};var Hk=Vk;function Vk(e){if("object"!==_typeof2(this))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("Promise constructor's argument is not a function");this._40=0,this._65=0,this._55=null,this._72=null,e!==Bk&&Xk(e,this)}function qk(e,t){for(;3===e._65;)e=e._55;if(Vk._37&&Vk._37(e),0===e._65)return 0===e._40?(e._40=1,void(e._72=t)):1===e._40?(e._40=2,void(e._72=[e._72,t])):void e._72.push(t);!function(e,t){wk((function(){var n=1===e._65?t.onFulfilled:t.onRejected;if(null!==n){var i=function(e,t){try{return e(t)}catch(e){return Fk=e,jk}}(n,e._55);i===jk?zk(t.promise,Fk):Wk(t.promise,i)}else 1===e._65?Wk(t.promise,e._55):zk(t.promise,e._55)}))}(e,t)}function Wk(e,t){if(t===e)return zk(e,new TypeError("A promise cannot be resolved with itself."));if(t&&("object"===_typeof2(t)||"function"==typeof t)){var n=function(e){try{return e.then}catch(e){return Fk=e,jk}}(t);if(n===jk)return zk(e,Fk);if(n===e.then&&t instanceof Vk)return e._65=3,e._55=t,void Gk(e);if("function"==typeof n)return void Xk(n.bind(t),e)}e._65=1,e._55=t,Gk(e)}function zk(e,t){e._65=2,e._55=t,Vk._87&&Vk._87(e,t),Gk(e)}function Gk(e){if(1===e._40&&(qk(e,e._72),e._72=null),2===e._40){for(var t=0;t<e._72.length;t++)qk(e,e._72[t]);e._72=null}}function Kk(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function Xk(e,t){var n=!1,i=function(e,t,n){try{e(t,n)}catch(e){return Fk=e,jk}}(e,(function(e){n||(n=!0,Wk(t,e))}),(function(e){n||(n=!0,zk(t,e))}));n||i!==jk||(n=!0,zk(t,Fk))}Vk._37=null,Vk._87=null,Vk._61=Bk,Vk.prototype.then=function(e,t){if(this.constructor!==Vk)return function(e,t,n){return new e.constructor((function(i,r){var a=new Vk(Bk);a.then(i,r),qk(e,new Kk(t,n,a))}))}(this,e,t);var n=new Vk(Bk);return qk(this,new Kk(e,t,n)),n},Hk.prototype.done=function(e,t){var n=arguments.length?this.then.apply(this,arguments):this;n.then(null,(function(e){setTimeout((function(){throw e}),0)}))},Hk.prototype.finally=function(e){return this.then((function(t){return Hk.resolve(e()).then((function(){return t}))}),(function(t){return Hk.resolve(e()).then((function(){throw t}))}))};var Qk=tS(!0),Yk=tS(!1),$k=tS(null),Jk=tS(void 0),Zk=tS(0),eS=tS("");function tS(e){var t=new Hk(Hk._61);return t._65=1,t._55=e,t}Hk.resolve=function(e){if(e instanceof Hk)return e;if(null===e)return $k;if(void 0===e)return Jk;if(!0===e)return Qk;if(!1===e)return Yk;if(0===e)return Zk;if(""===e)return eS;if("object"===_typeof2(e)||"function"==typeof e)try{var t=e.then;if("function"==typeof t)return new Hk(t.bind(e))}catch(e){return new Hk((function(t,n){n(e)}))}return tS(e)},Hk.all=function(e){var t=Array.prototype.slice.call(e);return new Hk((function(e,n){if(0===t.length)return e([]);var i=t.length;function r(a,s){if(s&&("object"===_typeof2(s)||"function"==typeof s)){if(s instanceof Hk&&s.then===Hk.prototype.then){for(;3===s._65;)s=s._55;return 1===s._65?r(a,s._55):(2===s._65&&n(s._55),void s.then((function(e){r(a,e)}),n))}var o=s.then;if("function"==typeof o)return void new Hk(o.bind(s)).then((function(e){r(a,e)}),n)}t[a]=s,0==--i&&e(t)}for(var a=0;a<t.length;a++)r(a,t[a])}))},Hk.reject=function(e){return new Hk((function(t,n){n(e)}))},Hk.race=function(e){return new Hk((function(t,n){e.forEach((function(e){Hk.resolve(e).then(t,n)}))}))},Hk.prototype.catch=function(e){return this.then(null,e)};var nS=[],iS=[],rS=wk.makeRequestCallFromTimer((function(){if(iS.length)throw iS.shift()}));var aS=sS;function sS(e){var t;(t=nS.length?nS.pop():new oS).task=e,wk(t)}function oS(){this.task=null}oS.prototype.call=function(){try{this.task.call()}catch(e){sS.onerror?sS.onerror(e):(iS.push(e),rS())}finally{this.task=null,nS[nS.length]=this}},Hk.denodeify=function(e,t){return"number"==typeof t&&t!==1/0?function(e,t){for(var n=[],i=0;i<t;i++)n.push("a"+i);var r=["return function ("+n.join(",")+") {","var self = this;","return new Promise(function (rs, rj) {","var res = fn.call(",["self"].concat(n).concat([uS]).join(","),");","if (res &&",'(typeof res === "object" || typeof res === "function") &&','typeof res.then === "function"',") {rs(res);}","});","};"].join("");return Function(["Promise","fn"],r)(Hk,e)}(e,t):function(e){for(var t=Math.max(e.length-1,3),n=[],i=0;i<t;i++)n.push("a"+i);var r=["return function ("+n.join(",")+") {","var self = this;","var args;","var argLength = arguments.length;","if (arguments.length > "+t+") {","args = new Array(arguments.length + 1);","for (var i = 0; i < arguments.length; i++) {","args[i] = arguments[i];","}","}","return new Promise(function (rs, rj) {","var cb = "+uS+";","var res;","switch (argLength) {",n.concat(["extra"]).map((function(e,t){return"case "+t+":res = fn.call("+["self"].concat(n.slice(0,t)).concat("cb").join(",")+");break;"})).join(""),"default:","args[argLength] = cb;","res = fn.apply(self, args);","}","if (res &&",'(typeof res === "object" || typeof res === "function") &&','typeof res.then === "function"',") {rs(res);}","});","};"].join("");return Function(["Promise","fn"],r)(Hk,e)}(e)};var uS="function (err, res) {if (err) { rj(err); } else { rs(res); }}";Hk.nodeify=function(e){return function(){var t=Array.prototype.slice.call(arguments),n="function"==typeof t[t.length-1]?t.pop():null,i=this;try{return e.apply(this,arguments).nodeify(n,i)}catch(e){if(null==n)return new Hk((function(t,n){n(e)}));aS((function(){n.call(i,e)}))}}},Hk.prototype.nodeify=function(e,t){if("function"!=typeof e)return this;this.then((function(n){aS((function(){e.call(t,null,n)}))}),(function(n){aS((function(){e.call(t,n)}))}))},Hk.enableSynchronous=function(){Hk.prototype.isPending=function(){return 0==this.getState()},Hk.prototype.isFulfilled=function(){return 1==this.getState()},Hk.prototype.isRejected=function(){return 2==this.getState()},Hk.prototype.getValue=function(){if(3===this._65)return this._55.getValue();if(!this.isFulfilled())throw new Error("Cannot get a value of an unfulfilled promise.");return this._55},Hk.prototype.getReason=function(){if(3===this._65)return this._55.getReason();if(!this.isRejected())throw new Error("Cannot get a rejection reason of a non-rejected promise.");return this._55},Hk.prototype.getState=function(){return 3===this._65?this._55.getState():-1===this._65||-2===this._65?0:this._65}},Hk.disableSynchronous=function(){Hk.prototype.isPending=void 0,Hk.prototype.isFulfilled=void 0,Hk.prototype.isRejected=void 0,Hk.prototype.getValue=void 0,Hk.prototype.getReason=void 0,Hk.prototype.getState=void 0};var lS=Hk;var cS,dS=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;return new lS((function(t){"interactive"===e.readyState||"complete"===e.readyState?t(e):e.addEventListener("DOMContentLoaded",(function(){return t(e)}))}))}(document);rk.partials=ak,cS=function(){var e=function(e){try{return JSON.parse(mk.htmlUnencode(e.innerText))}catch(e){return null}}(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return t.querySelector(e)}("#embed-data"))||{},n=gk(),i="true"===n.autoplay,r="0"!==n.endscreen,a=e.lixTreatments;Ek.lixTreatments=a;var s,o,u,l,c,d,h,p,f,m,g,v,y,_,b,T,k,S,E,C,w,I=Ck(e,"detailedCourses.elements.0")||{},P=I.selectedVideo||{},x=Ck(e,"relatedContent.elements")||[],A=Sk(I),O=(l=(s=P).course,c=void 0===l?{}:l,d=s.defaultThumbnail,h=void 0===d?"":d,p=s.slug,f=void 0===p?"":p,m=s.title,g=void 0===m?"":m,v=s.transcript,y=void 0===v?{lines:[]}:v,_=s.url,b=void 0===_?{}:_,T=s.urn,k=void 0===T?"":T,S=s.thumbnailV2,E=Sk(c),C=Tk(S),(w=kk(C,512,218))&&(w=mk.sanitizeUrl(w)),{defaultThumbnail:mk.sanitizeUrl(h),streamUrl:b.progressiveUrl||"",slug:f,title:mk.sanitizeHTML(g),transcript:y.lines,url:(o=E.slug,u=f,mk.sanitizeUrl("".concat(bk(o),"/").concat(u))),urn:k,thumbnailV2:C,thumbnailUrl:w}),L=x.map((function(e){e.thumbnailV2=e.thumbnails[0],e.title=e.headline.title.text;var t=Sk(e);return t.url=mk.sanitizeUrl(_k(t.url,"relatedcourse")),t}));lk.locale=A.locale;var R="";R+=function(e){var t=e.course,n=void 0===t?{}:t,i=e.video,r=void 0===i?{}:i,a=e.similarCourses,s=void 0===a?[]:a,o=n;return o.url=mk.sanitizeUrl(_k(o.url,"thiscourse")),ak["video-player"]({course:o,relatedCourses:s,video:r,withShare:!0,withTopToolbar:!0})}({course:A,video:O,similarCourses:L}),document.querySelector("head title").innerHTML=mk.sanitizeHTML(O.title),yv.setTrackingUrl(document.querySelector('meta[name="globalTrackingUrl"]').getAttribute("content"));var D="com.linkedin.web.learning.external";yv.setAppId(D);var M=Iv(),N="".concat(pk(window.navigator.userAgent)?"mw":"d","_learning_embed"),U={pageKey:N};document.referrer&&(U.referrer=document.referrer);var B=new sb({appId:D,appVersion:"0.0.0",locale:A.locale,endpoint:"/li/track",api:{AbortController:AbortController,performance:window.performance,PerformanceObserver:window.PerformanceObserver,locale:A.locale,location:window.location,document:document,Promise:Promise,assign:Object.assign,fetch:fetch,sendBeacon:window.navigator.sendBeacon&&window.navigator.sendBeacon.bind(window.navigator),requestIdleCallback:window.requestIdleCallback}}),F=new db(B);F.setCurrentContext({pageKey:N,pageInstance:S_(N,Iv())}),F.firePVE(N);var j=new MT({"app-render-mode":"VANILLA","is-app-render-failed":!1},{"is-single-page-app":!1,"navigation-timing-only":!0,"enable-rs-timing":!0,"enable-cdn-tracking":!0,"enable-pop-tracking":!0,"request-sampling-rate":1,"beacon-timeout":500,"web-ui-framework":"DUST"},F);j.end(j.start());var H=function(e,t){var n,i=document.querySelector(".top-toolbar"),r=e.controlsDisplay();function a(t){t?i.classList.remove("a11y-text"):e.paused()||i.classList.add("a11y-text")}function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4e3;clearTimeout(n),e?(r.setState({hideControls:!1}),a(!0),s(!1,t)):n=setTimeout((function(){r.setState({hideControls:!0}),a(!1)}),t)}t.addEventListener("mouseenter",(function(){return s(!0)})),t.addEventListener("focusin",(function(){return s(!0)})),t.addEventListener("mousemove",function(e,t){var n;return function(){for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];n||(n=setTimeout((function(){e.apply(void 0,r),n=null}),t))}}((function(){return s(!0)}),200)),t.addEventListener("focusout",(function(e){t.contains(e.relatedTarget)||s(!1,200)}))};!function(){var e=document.querySelector(".media-player");e.innerHTML=R;var n=A.thumbnailUrl,a=function(e){var n,i,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={customCaptionsDisplay:!1,playerBanner:!1,children:{playerBanner:{},mediaLoader:{},posterImage:{},bigPlayButton:{},loadingSpinner:{},controlBar:{},errorDisplay:{},customCaptionsDisplay:{},textTrackDisplay:{},resizeManager:{},liveTracker:{}},controlBar:{skipBackButton:!1,skipAheadButton:!1,previousButton:!1,nextButton:!1,settingsMenuButton:!1,backToStartButton:!1,theaterModeButton:!1,fullscreenToggle:!1,captionsToggle:!1,captionsMenuToggle:!1,muteToggle:!1,remainingTimeDisplay:!1,children:t(t({},null!==(n=a.controlBar)&&void 0!==n&&null!==(i=n.progressControl)&&void 0!==i&&i.inline?{playToggle:{},progressControl:{}}:{progressControl:{},playToggle:{}}),{},{backToStartButton:{},skipBackButton:{},skipAheadButton:{},previousButton:{},nextButton:{},liveDisplay:{},timeDisplay:{},remainingTimeDisplay:{},customControlSpacer:{},playbackRateMenuButton:{},captionsToggle:{},captionsMenuToggle:{},settingsMenuButton:{},volumePanel:{inline:!1},muteToggle:{},theaterModeButton:{},fullscreenToggle:{}})},plugins:{disableContextMenu:!0,lifecycle:!0,qualityLevels:!0,highContrastMode:!0,verticalSliderMaxHeight:!0,menuOverflow:!0,setAriaLiveToOff:!0,generateTrackingId:!0},controls:!0,fluid:!0,responsive:!0,aspectRatio:"auto",enableSourceset:!0,techOrder:["html5"],html5:{vhs:{withCredentials:!1,limitRenditionByPlayerDimensions:!1,experimentalBufferBasedABR:!0,useNetworkInformationApi:!0,cacheEncryptionKeys:!0},nativeTextTracks:!1}},u=dl.mergeOptions(o,a,{autoplay:!0===a.autoplay?"any":a.autoplay||!1});if(s.sortPluginsByPriority){var l=u.plugins;delete u.plugins,r=dl(e,u),cv(l).forEach((function(e){r[e](l[e])}))}else r=dl(e,u);return r}(e.querySelector("video.video-js"),{autoplay:i,bigPlayButton:!0,customCaptionsDisplay:!1,poster:n,controlBar:{captionsToggle:!0,fullscreenToggle:!0},plugins:{controlsDisplay:{hideControls:!1}},html5:{nativeTextTracks:dl.browser.IS_IPHONE}});a.src(O.streamUrl),a.addRemoteTextTrack({kind:"captions",src:P.captionFile,label:dk("textTrackLabel"),srclang:dk("textTrackSrclang")}),H(a,e),function(e){if(O.urn){var t=e.tracking({mediaUrn:O.urn,trackingId:M}),n=e.rum({mediaUrn:O.urn,trackingId:M,mediaHeader:{mediaSource:"learning"}});t.on("track",(function(e,t){var n=t.eventName,i=t.eventData;Pv({appId:D,eventName:n,pageKey:N,eventData:i,requestHeader:U})})),n.on("track",(function(e,t){var n=t.eventName,i=t.eventData;Pv({appId:D,eventName:n,pageKey:N,eventData:i,requestHeader:U})}))}}(a),r&&function(e){var t=e.endScreen(),n=document.querySelector(".embed-endcard");n&&t.screen.fillWith(n)}(a),function(e){var t=e.errorScreen();t.on("show",(function(e,n){var i=n.screen,r=n.error,a=document.querySelector(".video-errorcard");a?t.screen.fillWith(a):i.fillWith(r.message)}))}(a),document.querySelector(".media-player__player").addEventListener("click",(function(){a.play()}),{once:!0})}()},dS.then(cS).then((function(){}),(function(){}))}();
//# sourceMappingURL=index.map