@clickview/player 1.18.0-rc.1 → 1.18.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/dist/en.json +0 -1
- package/dist/interactive-player.css +0 -88
- package/dist/interactive-player.js +0 -2
- package/dist/interactive-player.js.LICENSE.txt +0 -153
- package/dist/player.css +0 -48
- package/dist/player.js +0 -2
- package/dist/player.js.LICENSE.txt +0 -15
package/dist/player.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see player.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@clickview/player"]=t():e["@clickview/player"]=t()}(self,(()=>(()=>{var e={68942:(e,t,r)=>{"use strict";var n=r(51562),i=r(448),o=r(63848),a=function(e){var t={};return e?(e.trim().split("\n").forEach((function(e){var r=e.indexOf(":"),n=e.slice(0,r).trim().toLowerCase(),i=e.slice(r+1).trim();void 0===t[n]?t[n]=i:Array.isArray(t[n])?t[n].push(i):t[n]=[t[n],i]})),t):t};function s(e,t,r){var n=e;return o(t)?(r=t,"string"==typeof e&&(n={uri:e})):n=i({},t,{uri:e}),n.callback=r,n}function u(e,t,r){return l(t=s(e,t,r))}function l(e){if(void 0===e.callback)throw new Error("callback argument missing");var t=!1,r=function(r,n,i){t||(t=!0,e.callback(r,n,i))};function n(){var e=void 0;if(e=c.response?c.response:c.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}(c),v)try{e=JSON.parse(e)}catch(e){}return e}function i(e){return clearTimeout(f),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,r(e,g)}function o(){if(!l){var t;clearTimeout(f),t=e.useXDR&&void 0===c.status?200:1223===c.status?204:c.status;var i=g,o=null;return 0!==t?(i={body:n(),statusCode:t,method:p,headers:{},url:h,rawRequest:c},c.getAllResponseHeaders&&(i.headers=a(c.getAllResponseHeaders()))):o=new Error("Internal XMLHttpRequest Error"),r(o,i,i.body)}}var s,l,c=e.xhr||null;c||(c=e.cors||e.useXDR?new u.XDomainRequest:new u.XMLHttpRequest);var f,h=c.url=e.uri||e.url,p=c.method=e.method||"GET",d=e.body||e.data,y=c.headers=e.headers||{},m=!!e.sync,v=!1,g={body:void 0,headers:{},statusCode:0,method:p,url:h,rawRequest:c};if("json"in e&&!1!==e.json&&(v=!0,y.accept||y.Accept||(y.Accept="application/json"),"GET"!==p&&"HEAD"!==p&&(y["content-type"]||y["Content-Type"]||(y["Content-Type"]="application/json"),d=JSON.stringify(!0===e.json?d:e.json))),c.onreadystatechange=function(){4===c.readyState&&setTimeout(o,0)},c.onload=o,c.onerror=i,c.onprogress=function(){},c.onabort=function(){l=!0},c.ontimeout=i,c.open(p,h,!m,e.username,e.password),m||(c.withCredentials=!!e.withCredentials),!m&&e.timeout>0&&(f=setTimeout((function(){if(!l){l=!0,c.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",i(e)}}),e.timeout)),c.setRequestHeader)for(s in y)y.hasOwnProperty(s)&&c.setRequestHeader(s,y[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&&(c.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(c),c.send(d||null),c}e.exports=u,e.exports.default=u,u.XMLHttpRequest=n.XMLHttpRequest||function(){},u.XDomainRequest="withCredentials"in new u.XMLHttpRequest?u.XMLHttpRequest:n.XDomainRequest,function(e,t){for(var r=0;r<e.length;r++)t(e[r])}(["get","put","post","patch","head","delete"],(function(e){u["delete"===e?"del":e]=function(t,r,n){return(r=s(t,r,n)).method=e.toUpperCase(),l(r)}}))},15206:e=>{var t=!("undefined"==typeof window||!window.document||!window.document.createElement);e.exports=t},94605:e=>{e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},29076:(e,t,r)=>{var n=r(62366);e.exports=function(e){if(!n(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},5822:(e,t,r)=>{var n=r(46802),i=r(22275),o=r(50430),a=n("unscopables"),s=Array.prototype;null==s[a]&&o(s,a,i(null)),e.exports=function(e){s[a][e]=!0}},25528:(e,t,r)=>{"use strict";var n=r(50189).charAt;e.exports=function(e,t,r){return t+(r?n(e,t).length:1)}},72814:e=>{e.exports=function(e,t,r){if(!(e instanceof t))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return e}},4905:(e,t,r)=>{var n=r(62366);e.exports=function(e){if(!n(e))throw TypeError(String(e)+" is not an object");return e}},16607:(e,t,r)=>{"use strict";var n=r(72758).forEach,i=r(31853);e.exports=i("forEach")?function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}:[].forEach},5029:(e,t,r)=>{var n=r(40678),i=r(74479),o=r(6971),a=function(e){return function(t,r,a){var s,u=n(t),l=i(u.length),c=o(a,l);if(e&&r!=r){for(;l>c;)if((s=u[c++])!=s)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===r)return e||c||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},72758:(e,t,r)=>{var n=r(17755),i=r(62901),o=r(87615),a=r(74479),s=r(17021),u=[].push,l=function(e){var t=1==e,r=2==e,l=3==e,c=4==e,f=6==e,h=5==e||f;return function(p,d,y,m){for(var v,g,b=o(p),_=i(b),w=n(d,y,3),T=a(_.length),S=0,E=m||s,O=t?E(p,T):r?E(p,0):void 0;T>S;S++)if((h||S in _)&&(g=w(v=_[S],S,b),e))if(t)O[S]=g;else if(g)switch(e){case 3:return!0;case 5:return v;case 6:return S;case 2:u.call(O,v)}else if(c)return!1;return f?-1:l||c?c:O}};e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6)}},95611:(e,t,r)=>{var n=r(25061),i=r(46802),o=r(24101),a=i("species");e.exports=function(e){return o>=51||!n((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},62040:(e,t,r)=>{var n=r(94605),i=r(87615),o=r(62901),a=r(74479),s=function(e){return function(t,r,s,u){n(r);var l=i(t),c=o(l),f=a(l.length),h=e?f-1:0,p=e?-1:1;if(s<2)for(;;){if(h in c){u=c[h],h+=p;break}if(h+=p,e?h<0:f<=h)throw TypeError("Reduce of empty array with no initial value")}for(;e?h>=0:f>h;h+=p)h in c&&(u=r(u,c[h],h,l));return u}};e.exports={left:s(!1),right:s(!0)}},17021:(e,t,r)=>{var n=r(62366),i=r(20119),o=r(46802)("species");e.exports=function(e,t){var r;return i(e)&&("function"!=typeof(r=e.constructor)||r!==Array&&!i(r.prototype)?n(r)&&null===(r=r[o])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===t?0:t)}},17755:(e,t,r)=>{var n=r(94605);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}},35304:(e,t,r)=>{var n=r(4905);e.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(t){var o=e.return;throw void 0!==o&&n(o.call(e)),t}}},13165:(e,t,r)=>{var n=r(46802)("iterator"),i=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){i=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var r=!1;try{var o={};o[n]=function(){return{next:function(){return{done:r=!0}}}},e(o)}catch(e){}return r}},75489:e=>{var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},20486:(e,t,r)=>{var n=r(75489),i=r(46802)("toStringTag"),o="Arguments"==n(function(){return arguments}());e.exports=function(e){var t,r,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?r:o?n(t):"Object"==(a=n(t))&&"function"==typeof t.callee?"Arguments":a}},53769:(e,t,r)=>{"use strict";var n=r(86846),i=r(81738).getWeakData,o=r(4905),a=r(62366),s=r(72814),u=r(98971),l=r(72758),c=r(51900),f=r(50684),h=f.set,p=f.getterFor,d=l.find,y=l.findIndex,m=0,v=function(e){return e.frozen||(e.frozen=new g)},g=function(){this.entries=[]},b=function(e,t){return d(e.entries,(function(e){return e[0]===t}))};g.prototype={get:function(e){var t=b(this,e);if(t)return t[1]},has:function(e){return!!b(this,e)},set:function(e,t){var r=b(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=y(this.entries,(function(t){return t[0]===e}));return~t&&this.entries.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,r,l){var f=e((function(e,n){s(e,f,t),h(e,{type:t,id:m++,frozen:void 0}),null!=n&&u(n,e[l],e,r)})),d=p(t),y=function(e,t,r){var n=d(e),a=i(o(t),!0);return!0===a?v(n).set(t,r):a[n.id]=r,e};return n(f.prototype,{delete:function(e){var t=d(this);if(!a(e))return!1;var r=i(e);return!0===r?v(t).delete(e):r&&c(r,t.id)&&delete r[t.id]},has:function(e){var t=d(this);if(!a(e))return!1;var r=i(e);return!0===r?v(t).has(e):r&&c(r,t.id)}}),n(f.prototype,r?{get:function(e){var t=d(this);if(a(e)){var r=i(e);return!0===r?v(t).get(e):r?r[t.id]:void 0}},set:function(e,t){return y(this,e,t)}}:{add:function(e){return y(this,e,!0)}}),f}}},66606:(e,t,r)=>{"use strict";var n=r(29638),i=r(45001),o=r(91092),a=r(96313),s=r(81738),u=r(98971),l=r(72814),c=r(62366),f=r(25061),h=r(13165),p=r(40606),d=r(3419);e.exports=function(e,t,r,y,m){var v=i[e],g=v&&v.prototype,b=v,_=y?"set":"add",w={},T=function(e){var t=g[e];a(g,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(m&&!c(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return m&&!c(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return!(m&&!c(e))&&t.call(this,0===e?0:e)}:function(e,r){return t.call(this,0===e?0:e,r),this})};if(o(e,"function"!=typeof v||!(m||g.forEach&&!f((function(){(new v).entries().next()})))))b=r.getConstructor(t,e,y,_),s.REQUIRED=!0;else if(o(e,!0)){var S=new b,E=S[_](m?{}:-0,1)!=S,O=f((function(){S.has(1)})),k=h((function(e){new v(e)})),C=!m&&f((function(){for(var e=new v,t=5;t--;)e[_](t,t);return!e.has(-0)}));k||((b=t((function(t,r){l(t,b,e);var n=d(new v,t,b);return null!=r&&u(r,n[_],n,y),n}))).prototype=g,g.constructor=b),(O||C)&&(T("delete"),T("has"),y&&T("get")),(C||E)&&T(_),m&&g.clear&&delete g.clear}return w[e]=b,n({global:!0,forced:b!=v},w),p(b,e),m||r.setStrong(b,e,y),b}},46810:(e,t,r)=>{var n=r(51900),i=r(62466),o=r(8117),a=r(56462);e.exports=function(e,t){for(var r=i(t),s=a.f,u=o.f,l=0;l<r.length;l++){var c=r[l];n(e,c)||s(e,c,u(t,c))}}},10149:(e,t,r)=>{var n=r(25061);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},62141:(e,t,r)=>{"use strict";var n=r(61151).IteratorPrototype,i=r(22275),o=r(86034),a=r(40606),s=r(80501),u=function(){return this};e.exports=function(e,t,r){var l=t+" Iterator";return e.prototype=i(n,{next:o(1,r)}),a(e,l,!1,!0),s[l]=u,e}},50430:(e,t,r)=>{var n=r(11502),i=r(56462),o=r(86034);e.exports=n?function(e,t,r){return i.f(e,t,o(1,r))}:function(e,t,r){return e[t]=r,e}},86034:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},30645:(e,t,r)=>{"use strict";var n=r(29638),i=r(62141),o=r(64320),a=r(22848),s=r(40606),u=r(50430),l=r(96313),c=r(46802),f=r(20013),h=r(80501),p=r(61151),d=p.IteratorPrototype,y=p.BUGGY_SAFARI_ITERATORS,m=c("iterator"),v="keys",g="values",b="entries",_=function(){return this};e.exports=function(e,t,r,c,p,w,T){i(r,t,c);var S,E,O,k=function(e){if(e===p&&L)return L;if(!y&&e in x)return x[e];switch(e){case v:case g:case b:return function(){return new r(this,e)}}return function(){return new r(this)}},C=t+" Iterator",P=!1,x=e.prototype,j=x[m]||x["@@iterator"]||p&&x[p],L=!y&&j||k(p),I="Array"==t&&x.entries||j;if(I&&(S=o(I.call(new e)),d!==Object.prototype&&S.next&&(f||o(S)===d||(a?a(S,d):"function"!=typeof S[m]&&u(S,m,_)),s(S,C,!0,!0),f&&(h[C]=_))),p==g&&j&&j.name!==g&&(P=!0,L=function(){return j.call(this)}),f&&!T||x[m]===L||u(x,m,L),h[t]=L,p)if(E={values:k(g),keys:w?L:k(v),entries:k(b)},T)for(O in E)(y||P||!(O in x))&&l(x,O,E[O]);else n({target:t,proto:!0,forced:y||P},E);return E}},11502:(e,t,r)=>{var n=r(25061);e.exports=!n((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},36009:(e,t,r)=>{var n=r(45001),i=r(62366),o=n.document,a=i(o)&&i(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},58514:e=>{e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},72089:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},29638:(e,t,r)=>{var n=r(45001),i=r(8117).f,o=r(50430),a=r(96313),s=r(88506),u=r(46810),l=r(91092);e.exports=function(e,t){var r,c,f,h,p,d=e.target,y=e.global,m=e.stat;if(r=y?n:m?n[d]||s(d,{}):(n[d]||{}).prototype)for(c in t){if(h=t[c],f=e.noTargetGet?(p=i(r,c))&&p.value:r[c],!l(y?c:d+(m?".":"#")+c,e.forced)&&void 0!==f){if(typeof h==typeof f)continue;u(h,f)}(e.sham||f&&f.sham)&&o(h,"sham",!0),a(r,c,h,e)}}},25061:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},95453:(e,t,r)=>{"use strict";var n=r(50430),i=r(96313),o=r(25061),a=r(46802),s=r(44847),u=a("species"),l=!o((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),c=!o((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]}));e.exports=function(e,t,r,f){var h=a(e),p=!o((function(){var t={};return t[h]=function(){return 7},7!=""[e](t)})),d=p&&!o((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[u]=function(){return r},r.flags="",r[h]=/./[h]),r.exec=function(){return t=!0,null},r[h](""),!t}));if(!p||!d||"replace"===e&&!l||"split"===e&&!c){var y=/./[h],m=r(h,""[e],(function(e,t,r,n,i){return t.exec===s?p&&!i?{done:!0,value:y.call(t,r,n)}:{done:!0,value:e.call(r,t,n)}:{done:!1}})),v=m[0],g=m[1];i(String.prototype,e,v),i(RegExp.prototype,h,2==t?function(e,t){return g.call(e,this,t)}:function(e){return g.call(e,this)}),f&&n(RegExp.prototype[h],"sham",!0)}}},98218:(e,t,r)=>{var n=r(25061);e.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},21501:(e,t,r)=>{var n=r(6809);e.exports=n("native-function-to-string",Function.toString)},3425:(e,t,r)=>{var n=r(53757),i=r(45001),o=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?o(n[e])||o(i[e]):n[e]&&n[e][t]||i[e]&&i[e][t]}},26354:(e,t,r)=>{var n=r(20486),i=r(80501),o=r(46802)("iterator");e.exports=function(e){if(null!=e)return e[o]||e["@@iterator"]||i[n(e)]}},45001:(e,t,r)=>{var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||Function("return this")()},51900:e=>{var t={}.hasOwnProperty;e.exports=function(e,r){return t.call(e,r)}},92499:e=>{e.exports={}},12118:(e,t,r)=>{var n=r(3425);e.exports=n("document","documentElement")},17788:(e,t,r)=>{var n=r(11502),i=r(25061),o=r(36009);e.exports=!n&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},62901:(e,t,r)=>{var n=r(25061),i=r(75489),o="".split;e.exports=n((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==i(e)?o.call(e,""):Object(e)}:Object},3419:(e,t,r)=>{var n=r(62366),i=r(22848);e.exports=function(e,t,r){var o,a;return i&&"function"==typeof(o=t.constructor)&&o!==r&&n(a=o.prototype)&&a!==r.prototype&&i(e,a),e}},81738:(e,t,r)=>{var n=r(92499),i=r(62366),o=r(51900),a=r(56462).f,s=r(41050),u=r(98218),l=s("meta"),c=0,f=Object.isExtensible||function(){return!0},h=function(e){a(e,l,{value:{objectID:"O"+ ++c,weakData:{}}})},p=e.exports={REQUIRED:!1,fastKey:function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,l)){if(!f(e))return"F";if(!t)return"E";h(e)}return e[l].objectID},getWeakData:function(e,t){if(!o(e,l)){if(!f(e))return!0;if(!t)return!1;h(e)}return e[l].weakData},onFreeze:function(e){return u&&p.REQUIRED&&f(e)&&!o(e,l)&&h(e),e}};n[l]=!0},50684:(e,t,r)=>{var n,i,o,a=r(77650),s=r(45001),u=r(62366),l=r(50430),c=r(51900),f=r(61695),h=r(92499),p=s.WeakMap;if(a){var d=new p,y=d.get,m=d.has,v=d.set;n=function(e,t){return v.call(d,e,t),t},i=function(e){return y.call(d,e)||{}},o=function(e){return m.call(d,e)}}else{var g=f("state");h[g]=!0,n=function(e,t){return l(e,g,t),t},i=function(e){return c(e,g)?e[g]:{}},o=function(e){return c(e,g)}}e.exports={set:n,get:i,has:o,enforce:function(e){return o(e)?i(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!u(t)||(r=i(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return r}}}},55557:(e,t,r)=>{var n=r(46802),i=r(80501),o=n("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||a[o]===e)}},20119:(e,t,r)=>{var n=r(75489);e.exports=Array.isArray||function(e){return"Array"==n(e)}},91092:(e,t,r)=>{var n=r(25061),i=/#|\.prototype\./,o=function(e,t){var r=s[a(e)];return r==l||r!=u&&("function"==typeof t?n(t):!!t)},a=o.normalize=function(e){return String(e).replace(i,".").toLowerCase()},s=o.data={},u=o.NATIVE="N",l=o.POLYFILL="P";e.exports=o},62366:e=>{e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},20013:e=>{e.exports=!1},98971:(e,t,r)=>{var n=r(4905),i=r(55557),o=r(74479),a=r(17755),s=r(26354),u=r(35304),l=function(e,t){this.stopped=e,this.result=t};(e.exports=function(e,t,r,c,f){var h,p,d,y,m,v,g,b=a(t,r,c?2:1);if(f)h=e;else{if("function"!=typeof(p=s(e)))throw TypeError("Target is not iterable");if(i(p)){for(d=0,y=o(e.length);y>d;d++)if((m=c?b(n(g=e[d])[0],g[1]):b(e[d]))&&m instanceof l)return m;return new l(!1)}h=p.call(e)}for(v=h.next;!(g=v.call(h)).done;)if("object"==typeof(m=u(h,b,g.value,c))&&m&&m instanceof l)return m;return new l(!1)}).stop=function(e){return new l(!0,e)}},61151:(e,t,r)=>{"use strict";var n,i,o,a=r(64320),s=r(50430),u=r(51900),l=r(46802),c=r(20013),f=l("iterator"),h=!1;[].keys&&("next"in(o=[].keys())?(i=a(a(o)))!==Object.prototype&&(n=i):h=!0),null==n&&(n={}),c||u(n,f)||s(n,f,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:h}},80501:e=>{e.exports={}},99262:(e,t,r)=>{var n=r(25061);e.exports=!!Object.getOwnPropertySymbols&&!n((function(){return!String(Symbol())}))},77650:(e,t,r)=>{var n=r(45001),i=r(21501),o=n.WeakMap;e.exports="function"==typeof o&&/native code/.test(i.call(o))},71640:(e,t,r)=>{"use strict";var n=r(11502),i=r(25061),o=r(89749),a=r(72822),s=r(49265),u=r(87615),l=r(62901),c=Object.assign;e.exports=!c||i((function(){var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!=c({},e)[r]||o(c({},t)).join("")!=n}))?function(e,t){for(var r=u(e),i=arguments.length,c=1,f=a.f,h=s.f;i>c;)for(var p,d=l(arguments[c++]),y=f?o(d).concat(f(d)):o(d),m=y.length,v=0;m>v;)p=y[v++],n&&!h.call(d,p)||(r[p]=d[p]);return r}:c},22275:(e,t,r)=>{var n=r(4905),i=r(56191),o=r(72089),a=r(92499),s=r(12118),u=r(36009),l=r(61695)("IE_PROTO"),c="prototype",f=function(){},h=function(){var e,t=u("iframe"),r=o.length,n="script",i="java"+n+":";for(t.style.display="none",s.appendChild(t),t.src=String(i),(e=t.contentWindow.document).open(),e.write("<"+n+">document.F=Object</"+n+">"),e.close(),h=e.F;r--;)delete h[c][o[r]];return h()};e.exports=Object.create||function(e,t){var r;return null!==e?(f[c]=n(e),r=new f,f[c]=null,r[l]=e):r=h(),void 0===t?r:i(r,t)},a[l]=!0},56191:(e,t,r)=>{var n=r(11502),i=r(56462),o=r(4905),a=r(89749);e.exports=n?Object.defineProperties:function(e,t){o(e);for(var r,n=a(t),s=n.length,u=0;s>u;)i.f(e,r=n[u++],t[r]);return e}},56462:(e,t,r)=>{var n=r(11502),i=r(17788),o=r(4905),a=r(76973),s=Object.defineProperty;t.f=n?s:function(e,t,r){if(o(e),t=a(t,!0),o(r),i)try{return s(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},8117:(e,t,r)=>{var n=r(11502),i=r(49265),o=r(86034),a=r(40678),s=r(76973),u=r(51900),l=r(17788),c=Object.getOwnPropertyDescriptor;t.f=n?c:function(e,t){if(e=a(e),t=s(t,!0),l)try{return c(e,t)}catch(e){}if(u(e,t))return o(!i.f.call(e,t),e[t])}},59219:(e,t,r)=>{var n=r(23855),i=r(72089).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},72822:(e,t)=>{t.f=Object.getOwnPropertySymbols},64320:(e,t,r)=>{var n=r(51900),i=r(87615),o=r(61695),a=r(10149),s=o("IE_PROTO"),u=Object.prototype;e.exports=a?Object.getPrototypeOf:function(e){return e=i(e),n(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?u:null}},23855:(e,t,r)=>{var n=r(51900),i=r(40678),o=r(5029).indexOf,a=r(92499);e.exports=function(e,t){var r,s=i(e),u=0,l=[];for(r in s)!n(a,r)&&n(s,r)&&l.push(r);for(;t.length>u;)n(s,r=t[u++])&&(~o(l,r)||l.push(r));return l}},89749:(e,t,r)=>{var n=r(23855),i=r(72089);e.exports=Object.keys||function(e){return n(e,i)}},49265:(e,t)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);t.f=i?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},22848:(e,t,r)=>{var n=r(4905),i=r(29076);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),t=r instanceof Array}catch(e){}return function(r,o){return n(r),i(o),t?e.call(r,o):r.__proto__=o,r}}():void 0)},45085:(e,t,r)=>{"use strict";var n=r(20486),i={};i[r(46802)("toStringTag")]="z",e.exports="[object z]"!==String(i)?function(){return"[object "+n(this)+"]"}:i.toString},62466:(e,t,r)=>{var n=r(3425),i=r(59219),o=r(72822),a=r(4905);e.exports=n("Reflect","ownKeys")||function(e){var t=i.f(a(e)),r=o.f;return r?t.concat(r(e)):t}},7206:(e,t,r)=>{var n=r(45001),i=r(9522).trim,o=r(49309),a=n.parseInt,s=/^[+-]?0[Xx]/,u=8!==a(o+"08")||22!==a(o+"0x16");e.exports=u?function(e,t){var r=i(String(e));return a(r,t>>>0||(s.test(r)?16:10))}:a},53757:(e,t,r)=>{e.exports=r(45001)},86846:(e,t,r)=>{var n=r(96313);e.exports=function(e,t,r){for(var i in t)n(e,i,t[i],r);return e}},96313:(e,t,r)=>{var n=r(45001),i=r(6809),o=r(50430),a=r(51900),s=r(88506),u=r(21501),l=r(50684),c=l.get,f=l.enforce,h=String(u).split("toString");i("inspectSource",(function(e){return u.call(e)})),(e.exports=function(e,t,r,i){var u=!!i&&!!i.unsafe,l=!!i&&!!i.enumerable,c=!!i&&!!i.noTargetGet;"function"==typeof r&&("string"!=typeof t||a(r,"name")||o(r,"name",t),f(r).source=h.join("string"==typeof t?t:"")),e!==n?(u?!c&&e[t]&&(l=!0):delete e[t],l?e[t]=r:o(e,t,r)):l?e[t]=r:s(t,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&c(this).source||u.call(this)}))},41847:(e,t,r)=>{var n=r(75489),i=r(44847);e.exports=function(e,t){var r=e.exec;if("function"==typeof r){var o=r.call(e,t);if("object"!=typeof o)throw TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==n(e))throw TypeError("RegExp#exec called on incompatible receiver");return i.call(e,t)}},44847:(e,t,r)=>{"use strict";var n,i,o=r(5268),a=RegExp.prototype.exec,s=String.prototype.replace,u=a,l=(n=/a/,i=/b*/g,a.call(n,"a"),a.call(i,"a"),0!==n.lastIndex||0!==i.lastIndex),c=void 0!==/()??/.exec("")[1];(l||c)&&(u=function(e){var t,r,n,i,u=this;return c&&(r=new RegExp("^"+u.source+"$(?!\\s)",o.call(u))),l&&(t=u.lastIndex),n=a.call(u,e),l&&n&&(u.lastIndex=u.global?n.index+n[0].length:t),c&&n&&n.length>1&&s.call(n[0],r,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(n[i]=void 0)})),n}),e.exports=u},5268:(e,t,r)=>{"use strict";var n=r(4905);e.exports=function(){var e=n(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},64475:e=>{e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},88506:(e,t,r)=>{var n=r(45001),i=r(50430);e.exports=function(e,t){try{i(n,e,t)}catch(r){n[e]=t}return t}},40606:(e,t,r)=>{var n=r(56462).f,i=r(51900),o=r(46802)("toStringTag");e.exports=function(e,t,r){e&&!i(e=r?e:e.prototype,o)&&n(e,o,{configurable:!0,value:t})}},61695:(e,t,r)=>{var n=r(6809),i=r(41050),o=n("keys");e.exports=function(e){return o[e]||(o[e]=i(e))}},19982:(e,t,r)=>{var n=r(45001),i=r(88506),o="__core-js_shared__",a=n[o]||i(o,{});e.exports=a},6809:(e,t,r)=>{var n=r(20013),i=r(19982);(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.4.0",mode:n?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},31853:(e,t,r)=>{"use strict";var n=r(25061);e.exports=function(e,t){var r=[][e];return!r||!n((function(){r.call(null,t||function(){throw 1},1)}))}},50189:(e,t,r)=>{var n=r(90321),i=r(64475),o=function(e){return function(t,r){var o,a,s=String(i(t)),u=n(r),l=s.length;return u<0||u>=l?e?"":void 0:(o=s.charCodeAt(u))<55296||o>56319||u+1===l||(a=s.charCodeAt(u+1))<56320||a>57343?e?s.charAt(u):o:e?s.slice(u,u+2):a-56320+(o-55296<<10)+65536}};e.exports={codeAt:o(!1),charAt:o(!0)}},9522:(e,t,r)=>{var n=r(64475),i="["+r(49309)+"]",o=RegExp("^"+i+i+"*"),a=RegExp(i+i+"*$"),s=function(e){return function(t){var r=String(n(t));return 1&e&&(r=r.replace(o,"")),2&e&&(r=r.replace(a,"")),r}};e.exports={start:s(1),end:s(2),trim:s(3)}},6971:(e,t,r)=>{var n=r(90321),i=Math.max,o=Math.min;e.exports=function(e,t){var r=n(e);return r<0?i(r+t,0):o(r,t)}},40678:(e,t,r)=>{var n=r(62901),i=r(64475);e.exports=function(e){return n(i(e))}},90321:e=>{var t=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:t)(e)}},74479:(e,t,r)=>{var n=r(90321),i=Math.min;e.exports=function(e){return e>0?i(n(e),9007199254740991):0}},87615:(e,t,r)=>{var n=r(64475);e.exports=function(e){return Object(n(e))}},76973:(e,t,r)=>{var n=r(62366);e.exports=function(e,t){if(!n(e))return e;var r,i;if(t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;if("function"==typeof(r=e.valueOf)&&!n(i=r.call(e)))return i;if(!t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},41050:e=>{var t=0,r=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++t+r).toString(36)}},84583:(e,t,r)=>{var n=r(3425);e.exports=n("navigator","userAgent")||""},24101:(e,t,r)=>{var n,i,o=r(45001),a=r(84583),s=o.process,u=s&&s.versions,l=u&&u.v8;l?i=(n=l.split("."))[0]+n[1]:a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(i=n[1]),e.exports=i&&+i},46802:(e,t,r)=>{var n=r(45001),i=r(6809),o=r(41050),a=r(99262),s=n.Symbol,u=i("wks");e.exports=function(e){return u[e]||(u[e]=a&&s[e]||(a?s:o)("Symbol."+e))}},49309:e=>{e.exports="\t\n\v\f\r \u2028\u2029\ufeff"},15296:(e,t,r)=>{"use strict";var n=r(29638),i=r(72758).filter;n({target:"Array",proto:!0,forced:!r(95611)("filter")},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},94386:(e,t,r)=>{"use strict";var n=r(29638),i=r(16607);n({target:"Array",proto:!0,forced:[].forEach!=i},{forEach:i})},48868:(e,t,r)=>{"use strict";var n=r(40678),i=r(5822),o=r(80501),a=r(50684),s=r(30645),u="Array Iterator",l=a.set,c=a.getterFor(u);e.exports=s(Array,"Array",(function(e,t){l(this,{type:u,target:n(e),index:0,kind:t})}),(function(){var e=c(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},82937:(e,t,r)=>{"use strict";var n=r(29638),i=r(62040).left;n({target:"Array",proto:!0,forced:r(31853)("reduce")},{reduce:function(e){return i(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},66403:(e,t,r)=>{var n=r(11502),i=r(56462).f,o=Function.prototype,a=o.toString,s=/^\s*function ([^ (]*)/,u="name";n&&!(u in o)&&i(o,u,{configurable:!0,get:function(){try{return a.call(this).match(s)[1]}catch(e){return""}}})},96609:(e,t,r)=>{var n=r(29638),i=r(71640);n({target:"Object",stat:!0,forced:Object.assign!==i},{assign:i})},92274:(e,t,r)=>{var n=r(96313),i=r(45085),o=Object.prototype;i!==o.toString&&n(o,"toString",i,{unsafe:!0})},68268:(e,t,r)=>{var n=r(29638),i=r(7206);n({global:!0,forced:parseInt!=i},{parseInt:i})},42295:(e,t,r)=>{"use strict";var n=r(29638),i=r(44847);n({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},81874:(e,t,r)=>{"use strict";var n=r(50189).charAt,i=r(50684),o=r(30645),a="String Iterator",s=i.set,u=i.getterFor(a);o(String,"String",(function(e){s(this,{type:a,string:String(e),index:0})}),(function(){var e,t=u(this),r=t.string,i=t.index;return i>=r.length?{value:void 0,done:!0}:(e=n(r,i),t.index+=e.length,{value:e,done:!1})}))},52963:(e,t,r)=>{"use strict";var n=r(95453),i=r(4905),o=r(74479),a=r(64475),s=r(25528),u=r(41847);n("match",1,(function(e,t,r){return[function(t){var r=a(this),n=null==t?void 0:t[e];return void 0!==n?n.call(t,r):new RegExp(t)[e](String(r))},function(e){var n=r(t,e,this);if(n.done)return n.value;var a=i(e),l=String(this);if(!a.global)return u(a,l);var c=a.unicode;a.lastIndex=0;for(var f,h=[],p=0;null!==(f=u(a,l));){var d=String(f[0]);h[p]=d,""===d&&(a.lastIndex=s(l,o(a.lastIndex),c)),p++}return 0===p?null:h}]}))},34994:(e,t,r)=>{"use strict";var n=r(95453),i=r(4905),o=r(87615),a=r(74479),s=r(90321),u=r(64475),l=r(25528),c=r(41847),f=Math.max,h=Math.min,p=Math.floor,d=/\$([$&'`]|\d\d?|<[^>]*>)/g,y=/\$([$&'`]|\d\d?)/g;n("replace",2,(function(e,t,r){return[function(r,n){var i=u(this),o=null==r?void 0:r[e];return void 0!==o?o.call(r,i,n):t.call(String(i),r,n)},function(e,o){var u=r(t,e,this,o);if(u.done)return u.value;var p=i(e),d=String(this),y="function"==typeof o;y||(o=String(o));var m=p.global;if(m){var v=p.unicode;p.lastIndex=0}for(var g=[];;){var b=c(p,d);if(null===b)break;if(g.push(b),!m)break;""===String(b[0])&&(p.lastIndex=l(d,a(p.lastIndex),v))}for(var _,w="",T=0,S=0;S<g.length;S++){b=g[S];for(var E=String(b[0]),O=f(h(s(b.index),d.length),0),k=[],C=1;C<b.length;C++)k.push(void 0===(_=b[C])?_:String(_));var P=b.groups;if(y){var x=[E].concat(k,O,d);void 0!==P&&x.push(P);var j=String(o.apply(void 0,x))}else j=n(E,d,O,k,P,o);O>=T&&(w+=d.slice(T,O)+j,T=O+E.length)}return w+d.slice(T)}];function n(e,r,n,i,a,s){var u=n+e.length,l=i.length,c=y;return void 0!==a&&(a=o(a),c=d),t.call(s,c,(function(t,o){var s;switch(o.charAt(0)){case"$":return"$";case"&":return e;case"`":return r.slice(0,n);case"'":return r.slice(u);case"<":s=a[o.slice(1,-1)];break;default:var c=+o;if(0===c)return t;if(c>l){var f=p(c/10);return 0===f?t:f<=l?void 0===i[f-1]?o.charAt(1):i[f-1]+o.charAt(1):t}s=i[c-1]}return void 0===s?"":s}))}}))},31341:(e,t,r)=>{"use strict";var n,i=r(45001),o=r(86846),a=r(81738),s=r(66606),u=r(53769),l=r(62366),c=r(50684).enforce,f=r(77650),h=!i.ActiveXObject&&"ActiveXObject"in i,p=Object.isExtensible,d=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},y=e.exports=s("WeakMap",d,u,!0,!0);if(f&&h){n=u.getConstructor(d,"WeakMap",!0),a.REQUIRED=!0;var m=y.prototype,v=m.delete,g=m.has,b=m.get,_=m.set;o(m,{delete:function(e){if(l(e)&&!p(e)){var t=c(this);return t.frozen||(t.frozen=new n),v.call(this,e)||t.frozen.delete(e)}return v.call(this,e)},has:function(e){if(l(e)&&!p(e)){var t=c(this);return t.frozen||(t.frozen=new n),g.call(this,e)||t.frozen.has(e)}return g.call(this,e)},get:function(e){if(l(e)&&!p(e)){var t=c(this);return t.frozen||(t.frozen=new n),g.call(this,e)?b.call(this,e):t.frozen.get(e)}return b.call(this,e)},set:function(e,t){if(l(e)&&!p(e)){var r=c(this);r.frozen||(r.frozen=new n),g.call(this,e)?_.call(this,e,t):r.frozen.set(e,t)}else _.call(this,e,t);return this}})}},98457:(e,t,r)=>{var n=r(45001),i=r(58514),o=r(16607),a=r(50430);for(var s in i){var u=n[s],l=u&&u.prototype;if(l&&l.forEach!==o)try{a(l,"forEach",o)}catch(e){l.forEach=o}}},54861:(e,t,r)=>{var n=r(45001),i=r(58514),o=r(48868),a=r(50430),s=r(46802),u=s("iterator"),l=s("toStringTag"),c=o.values;for(var f in i){var h=n[f],p=h&&h.prototype;if(p){if(p[u]!==c)try{a(p,u,c)}catch(e){p[u]=c}if(p[l]||a(p,l,f),i[f])for(var d in o)if(p[d]!==o[d])try{a(p,d,o[d])}catch(e){p[d]=o[d]}}}},16951:function(e){e.exports=function(){"use strict";var e=Object.freeze||function(e){return e},t=e(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),r=e(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","audio","canvas","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","video","view","vkern"]),n=e(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),i=e(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),o=e(["#text"]),a=Object.freeze||function(e){return e},s=a(["accept","action","align","alt","autocomplete","background","bgcolor","border","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","coords","crossorigin","datetime","default","dir","disabled","download","enctype","face","for","headers","height","hidden","high","href","hreflang","id","integrity","ismap","label","lang","list","loop","low","max","maxlength","media","method","min","minlength","multiple","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","type","usemap","valign","value","width","xmlns"]),u=a(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),l=a(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),c=a(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),f=Object.hasOwnProperty,h=Object.setPrototypeOf,p=("undefined"!=typeof Reflect&&Reflect).apply;function d(e,t){h&&h(e,null);for(var r=t.length;r--;){var n=t[r];if("string"==typeof n){var i=n.toLowerCase();i!==n&&(Object.isFrozen(t)||(t[r]=i),n=i)}e[n]=!0}return e}function y(e){var t={},r=void 0;for(r in e)p(f,e,[r])&&(t[r]=e[r]);return t}p||(p=function(e,t,r){return e.apply(t,r)});var m=Object.seal||function(e){return e},v=m(/\{\{[\s\S]*|[\s\S]*\}\}/gm),g=m(/<%[\s\S]*|[\s\S]*%>/gm),b=m(/^data-[\-\w.\u00B7-\uFFFF]/),_=m(/^aria-[\-\w]+$/),w=m(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),T=m(/^(?:\w+script|data):/i),S=m(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g),E="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};function O(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var k=("undefined"!=typeof Reflect&&Reflect).apply,C=Array.prototype.slice,P=Object.freeze,x=function(){return"undefined"==typeof window?null:window};k||(k=function(e,t,r){return e.apply(t,r)});return function e(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x(),f=function(t){return e(t)};if(f.version="2.0.7",f.removed=[],!a||!a.document||9!==a.document.nodeType)return f.isSupported=!1,f;var h=a.document,p=!1,m=!1,j=a.document,L=a.DocumentFragment,I=a.HTMLTemplateElement,A=a.Node,R=a.NodeFilter,D=a.NamedNodeMap,M=void 0===D?a.NamedNodeMap||a.MozNamedAttrMap:D,N=a.Text,B=a.Comment,U=a.DOMParser,F=a.TrustedTypes;if("function"==typeof I){var V=j.createElement("template");V.content&&V.content.ownerDocument&&(j=V.content.ownerDocument)}var H=function(e,t){if("object"!==(void 0===e?"undefined":E(e))||"function"!=typeof e.createPolicy)return null;var r=null,n="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(n)&&(r=t.currentScript.getAttribute(n));var i="dompurify"+(r?"#"+r:"");try{return e.createPolicy(i,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(F,h),q=H?H.createHTML(""):"",z=j,W=z.implementation,G=z.createNodeIterator,X=z.getElementsByTagName,K=z.createDocumentFragment,Y=h.importNode,Q={};f.isSupported=W&&void 0!==W.createHTMLDocument&&9!==j.documentMode;var $=v,J=g,Z=b,ee=_,te=T,re=S,ne=w,ie=null,oe=d({},[].concat(O(t),O(r),O(n),O(i),O(o))),ae=null,se=d({},[].concat(O(s),O(u),O(l),O(c))),ue=null,le=null,ce=!0,fe=!0,he=!1,pe=!1,de=!1,ye=!1,me=!1,ve=!1,ge=!1,be=!1,_e=!1,we=!1,Te=!0,Se=!0,Ee=!1,Oe={},ke=d({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ce=d({},["audio","video","img","source","image"]),Pe=null,xe=d({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),je=null,Le=j.createElement("form"),Ie=function(e){je&&je===e||(e&&"object"===(void 0===e?"undefined":E(e))||(e={}),ie="ALLOWED_TAGS"in e?d({},e.ALLOWED_TAGS):oe,ae="ALLOWED_ATTR"in e?d({},e.ALLOWED_ATTR):se,Pe="ADD_URI_SAFE_ATTR"in e?d(y(xe),e.ADD_URI_SAFE_ATTR):xe,ue="FORBID_TAGS"in e?d({},e.FORBID_TAGS):{},le="FORBID_ATTR"in e?d({},e.FORBID_ATTR):{},Oe="USE_PROFILES"in e&&e.USE_PROFILES,ce=!1!==e.ALLOW_ARIA_ATTR,fe=!1!==e.ALLOW_DATA_ATTR,he=e.ALLOW_UNKNOWN_PROTOCOLS||!1,pe=e.SAFE_FOR_JQUERY||!1,de=e.SAFE_FOR_TEMPLATES||!1,ye=e.WHOLE_DOCUMENT||!1,ge=e.RETURN_DOM||!1,be=e.RETURN_DOM_FRAGMENT||!1,_e=e.RETURN_DOM_IMPORT||!1,we=e.RETURN_TRUSTED_TYPE||!1,ve=e.FORCE_BODY||!1,Te=!1!==e.SANITIZE_DOM,Se=!1!==e.KEEP_CONTENT,Ee=e.IN_PLACE||!1,ne=e.ALLOWED_URI_REGEXP||ne,de&&(fe=!1),be&&(ge=!0),Oe&&(ie=d({},[].concat(O(o))),ae=[],!0===Oe.html&&(d(ie,t),d(ae,s)),!0===Oe.svg&&(d(ie,r),d(ae,u),d(ae,c)),!0===Oe.svgFilters&&(d(ie,n),d(ae,u),d(ae,c)),!0===Oe.mathMl&&(d(ie,i),d(ae,l),d(ae,c))),e.ADD_TAGS&&(ie===oe&&(ie=y(ie)),d(ie,e.ADD_TAGS)),e.ADD_ATTR&&(ae===se&&(ae=y(ae)),d(ae,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&d(Pe,e.ADD_URI_SAFE_ATTR),Se&&(ie["#text"]=!0),ye&&d(ie,["html","head","body"]),ie.table&&(d(ie,["tbody"]),delete ue.tbody),P&&P(e),je=e)},Ae=function(e){f.removed.push({element:e});try{e.parentNode.removeChild(e)}catch(t){e.outerHTML=q}},Re=function(e,t){try{f.removed.push({attribute:t.getAttributeNode(e),from:t})}catch(e){f.removed.push({attribute:null,from:t})}t.removeAttribute(e)},De=function(e){var t=void 0,r=void 0;if(ve)e="<remove></remove>"+e;else{var n=e.match(/^[\s]+/);(r=n&&n[0])&&(e=e.slice(r.length))}if(p)try{t=(new U).parseFromString(e,"text/html")}catch(e){}if(m&&d(ue,["title"]),!t||!t.documentElement){var i=(t=W.createHTMLDocument("")).body;i.parentNode.removeChild(i.parentNode.firstElementChild),i.outerHTML=H?H.createHTML(e):e}return e&&r&&t.body.insertBefore(j.createTextNode(r),t.body.childNodes[0]||null),X.call(t,ye?"html":"body")[0]};f.isSupported&&(function(){try{De('<svg><p><textarea><img src="</textarea><img src=x abc=1//">').querySelector("svg img")&&(p=!0)}catch(e){}}(),function(){try{var e=De("<x/><title></title><img>");/<\/title/.test(e.querySelector("title").innerHTML)&&(m=!0)}catch(e){}}());var Me=function(e){return G.call(e.ownerDocument||e,e,R.SHOW_ELEMENT|R.SHOW_COMMENT|R.SHOW_TEXT,(function(){return R.FILTER_ACCEPT}),!1)},Ne=function(e){return"object"===(void 0===A?"undefined":E(A))?e instanceof A:e&&"object"===(void 0===e?"undefined":E(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Be=function(e,t,r){Q[e]&&Q[e].forEach((function(e){e.call(f,t,r,je)}))},Ue=function(e){var t,r=void 0;if(Be("beforeSanitizeElements",e,null),!((t=e)instanceof N||t instanceof B||"string"==typeof t.nodeName&&"string"==typeof t.textContent&&"function"==typeof t.removeChild&&t.attributes instanceof M&&"function"==typeof t.removeAttribute&&"function"==typeof t.setAttribute&&"string"==typeof t.namespaceURI))return Ae(e),!0;var n=e.nodeName.toLowerCase();if(Be("uponSanitizeElement",e,{tagName:n,allowedTags:ie}),("svg"===n||"math"===n)&&0!==e.querySelectorAll("p, br").length)return Ae(e),!0;if(!ie[n]||ue[n]){if(Se&&!ke[n]&&"function"==typeof e.insertAdjacentHTML)try{var i=e.innerHTML;e.insertAdjacentHTML("AfterEnd",H?H.createHTML(i):i)}catch(e){}return Ae(e),!0}return"noscript"===n&&/<\/noscript/i.test(e.innerHTML)||"noembed"===n&&/<\/noembed/i.test(e.innerHTML)?(Ae(e),!0):(!pe||e.firstElementChild||e.content&&e.content.firstElementChild||!/</g.test(e.textContent)||(f.removed.push({element:e.cloneNode()}),e.innerHTML?e.innerHTML=e.innerHTML.replace(/</g,"<"):e.innerHTML=e.textContent.replace(/</g,"<")),de&&3===e.nodeType&&(r=(r=(r=e.textContent).replace($," ")).replace(J," "),e.textContent!==r&&(f.removed.push({element:e.cloneNode()}),e.textContent=r)),Be("afterSanitizeElements",e,null),!1)},Fe=function(e,t,r){if(Te&&("id"===t||"name"===t)&&(r in j||r in Le))return!1;if(fe&&Z.test(t));else if(ce&&ee.test(t));else{if(!ae[t]||le[t])return!1;if(Pe[t]);else if(ne.test(r.replace(re,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==r.indexOf("data:")||!Ce[e])if(he&&!te.test(r.replace(re,"")));else if(r)return!1}return!0},Ve=function(e){var t=void 0,r=void 0,n=void 0,i=void 0,o=void 0;Be("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ae};for(o=a.length;o--;){var u=t=a[o],l=u.name,c=u.namespaceURI;if(r=t.value.trim(),n=l.toLowerCase(),s.attrName=n,s.attrValue=r,s.keepAttr=!0,Be("uponSanitizeAttribute",e,s),r=s.attrValue,"name"===n&&"IMG"===e.nodeName&&a.id)i=a.id,a=k(C,a,[]),Re("id",e),Re(l,e),a.indexOf(i)>o&&e.setAttribute("id",i.value);else{if("INPUT"===e.nodeName&&"type"===n&&"file"===r&&s.keepAttr&&(ae[n]||!le[n]))continue;"id"===l&&e.setAttribute(l,""),Re(l,e)}if(s.keepAttr)if(/svg|math/i.test(e.namespaceURI)&&new RegExp("</("+Object.keys(ke).join("|")+")","i").test(r))Re(l,e);else{de&&(r=(r=r.replace($," ")).replace(J," "));var h=e.nodeName.toLowerCase();if(Fe(h,n,r))try{c?e.setAttributeNS(c,l,r):e.setAttribute(l,r),f.removed.pop()}catch(e){}}}Be("afterSanitizeAttributes",e,null)}},He=function e(t){var r=void 0,n=Me(t);for(Be("beforeSanitizeShadowDOM",t,null);r=n.nextNode();)Be("uponSanitizeShadowNode",r,null),Ue(r)||(r.content instanceof L&&e(r.content),Ve(r));Be("afterSanitizeShadowDOM",t,null)};return f.sanitize=function(e,t){var r=void 0,n=void 0,i=void 0,o=void 0,s=void 0;if(e||(e="\x3c!--\x3e"),"string"!=typeof e&&!Ne(e)){if("function"!=typeof e.toString)throw new TypeError("toString is not a function");if("string"!=typeof(e=e.toString()))throw new TypeError("dirty is not a string, aborting")}if(!f.isSupported){if("object"===E(a.toStaticHTML)||"function"==typeof a.toStaticHTML){if("string"==typeof e)return a.toStaticHTML(e);if(Ne(e))return a.toStaticHTML(e.outerHTML)}return e}if(me||Ie(t),f.removed=[],Ee);else if(e instanceof A)1===(n=(r=De("\x3c!--\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===n.nodeName||"HTML"===n.nodeName?r=n:r.appendChild(n);else{if(!ge&&!de&&!ye&&we&&-1===e.indexOf("<"))return H?H.createHTML(e):e;if(!(r=De(e)))return ge?null:q}r&&ve&&Ae(r.firstChild);for(var u=Me(Ee?e:r);i=u.nextNode();)3===i.nodeType&&i===o||Ue(i)||(i.content instanceof L&&He(i.content),Ve(i),o=i);if(o=null,Ee)return e;if(ge){if(be)for(s=K.call(r.ownerDocument);r.firstChild;)s.appendChild(r.firstChild);else s=r;return _e&&(s=Y.call(h,s,!0)),s}var l=ye?r.outerHTML:r.innerHTML;return de&&(l=(l=l.replace($," ")).replace(J," ")),H&&we?H.createHTML(l):l},f.setConfig=function(e){Ie(e),me=!0},f.clearConfig=function(){je=null,me=!1},f.isValidAttribute=function(e,t,r){je||Ie({});var n=e.toLowerCase(),i=t.toLowerCase();return Fe(n,i,r)},f.addHook=function(e,t){"function"==typeof t&&(Q[e]=Q[e]||[],Q[e].push(t))},f.removeHook=function(e){Q[e]&&Q[e].pop()},f.removeHooks=function(e){Q[e]&&(Q[e]=[])},f.removeAllHooks=function(){Q={}},f}()}()},3384:(e,t,r)=>{var n,i=void 0!==r.g?r.g:"undefined"!=typeof window?window:{},o=r(58421);"undefined"!=typeof document?n=document:(n=i["__GLOBAL_DOCUMENT_CACHE@4"])||(n=i["__GLOBAL_DOCUMENT_CACHE@4"]=o),e.exports=n},51562:(e,t,r)=>{var n;n="undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{},e.exports=n},63848:e=>{e.exports=function(e){if(!e)return!1;var r=t.call(e);return"[object Function]"===r||"function"==typeof e&&"[object RegExp]"!==r||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var t=Object.prototype.toString},19389:(e,t)=>{function r(e){if(e&&"object"==typeof e){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if("number"==typeof e)return a[e];var r,o=String(e);return(r=n[o.toLowerCase()])?r:(r=i[o.toLowerCase()])||(1===o.length?o.charCodeAt(0):void 0)}r.isEventKey=function(e,t){if(e&&"object"==typeof e){var r=e.which||e.keyCode||e.charCode;if(null==r)return!1;if("string"==typeof t){var o;if(o=n[t.toLowerCase()])return o===r;if(o=i[t.toLowerCase()])return o===r}else if("number"==typeof t)return t===r;return!1}};var n=(t=e.exports=r).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},i=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};for(o=97;o<123;o++)n[String.fromCharCode(o)]=o-32;for(var o=48;o<58;o++)n[o-48]=o;for(o=1;o<13;o++)n["f"+o]=o+111;for(o=0;o<10;o++)n["numpad "+o]=o+96;var a=t.names=t.title={};for(o in n)a[n[o]]=o;for(var s in i)n[s]=i[s]},40001:(e,t,r)=>{var n=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,s=parseInt,u="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,l="object"==typeof self&&self&&self.Object===Object&&self,c=u||l||Function("return this")(),f=Object.prototype.toString,h=Math.max,p=Math.min,d=function(){return c.Date.now()};function y(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==f.call(e)}(e))return NaN;if(y(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=y(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var r=o.test(e);return r||a.test(e)?s(e.slice(2),r?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,r){var n,i,o,a,s,u,l=0,c=!1,f=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function g(t){var r=n,o=i;return n=i=void 0,l=t,a=e.apply(o,r)}function b(e){var r=e-u;return void 0===u||r>=t||r<0||f&&e-l>=o}function _(){var e=d();if(b(e))return w(e);s=setTimeout(_,function(e){var r=t-(e-u);return f?p(r,o-(e-l)):r}(e))}function w(e){return s=void 0,v&&n?g(e):(n=i=void 0,a)}function T(){var e=d(),r=b(e);if(n=arguments,i=this,u=e,r){if(void 0===s)return function(e){return l=e,s=setTimeout(_,t),c?g(e):a}(u);if(f)return s=setTimeout(_,t),g(u)}return void 0===s&&(s=setTimeout(_,t)),a}return t=m(t)||0,y(r)&&(c=!!r.leading,o=(f="maxWait"in r)?h(m(r.maxWait)||0,t):o,v="trailing"in r?!!r.trailing:v),T.cancel=function(){void 0!==s&&clearTimeout(s),l=0,n=u=i=s=void 0},T.flush=function(){return void 0===s?a:w(d())},T}},98511:(e,t,r)=>{var n,i="__lodash_hash_undefined__",o="[object Function]",a="[object GeneratorFunction]",s=/^\[object .+?Constructor\]$/,u="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,l="object"==typeof self&&self&&self.Object===Object&&self,c=u||l||Function("return this")(),f=Array.prototype,h=Function.prototype,p=Object.prototype,d=c["__core-js_shared__"],y=(n=/[^.]+$/.exec(d&&d.keys&&d.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",m=h.toString,v=p.hasOwnProperty,g=p.toString,b=RegExp("^"+m.call(v).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_=f.splice,w=P(c,"Map"),T=P(Object,"create");function S(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function E(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function O(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function k(e,t){for(var r,n,i=e.length;i--;)if((r=e[i][0])===(n=t)||r!=r&&n!=n)return i;return-1}function C(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function P(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){if(!j(e)||y&&y in e)return!1;var t=function(e){var t=j(e)?g.call(e):"";return t==o||t==a}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?b:s;return t.test(function(e){if(null!=e){try{return m.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}(r)?r:void 0}function x(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a),a};return r.cache=new(x.Cache||O),r}function j(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}S.prototype.clear=function(){this.__data__=T?T(null):{}},S.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},S.prototype.get=function(e){var t=this.__data__;if(T){var r=t[e];return r===i?void 0:r}return v.call(t,e)?t[e]:void 0},S.prototype.has=function(e){var t=this.__data__;return T?void 0!==t[e]:v.call(t,e)},S.prototype.set=function(e,t){return this.__data__[e]=T&&void 0===t?i:t,this},E.prototype.clear=function(){this.__data__=[]},E.prototype.delete=function(e){var t=this.__data__,r=k(t,e);return!(r<0||(r==t.length-1?t.pop():_.call(t,r,1),0))},E.prototype.get=function(e){var t=this.__data__,r=k(t,e);return r<0?void 0:t[r][1]},E.prototype.has=function(e){return k(this.__data__,e)>-1},E.prototype.set=function(e,t){var r=this.__data__,n=k(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},O.prototype.clear=function(){this.__data__={hash:new S,map:new(w||E),string:new S}},O.prototype.delete=function(e){return C(this,e).delete(e)},O.prototype.get=function(e){return C(this,e).get(e)},O.prototype.has=function(e){return C(this,e).has(e)},O.prototype.set=function(e,t){return C(this,e).set(e,t),this},x.Cache=O,e.exports=x},50200:(e,t,r)=>{var n="Expected a function",i=NaN,o="[object Symbol]",a=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt,f="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,h="object"==typeof self&&self&&self.Object===Object&&self,p=f||h||Function("return this")(),d=Object.prototype.toString,y=Math.max,m=Math.min,v=function(){return p.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function b(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&d.call(e)==o}(e))return i;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var r=u.test(e);return r||l.test(e)?c(e.slice(2),r?2:8):s.test(e)?i:+e}e.exports=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new TypeError(n);return g(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),function(e,t,r){var i,o,a,s,u,l,c=0,f=!1,h=!1,p=!0;if("function"!=typeof e)throw new TypeError(n);function d(t){var r=i,n=o;return i=o=void 0,c=t,s=e.apply(n,r)}function _(e){var r=e-l;return void 0===l||r>=t||r<0||h&&e-c>=a}function w(){var e=v();if(_(e))return T(e);u=setTimeout(w,function(e){var r=t-(e-l);return h?m(r,a-(e-c)):r}(e))}function T(e){return u=void 0,p&&i?d(e):(i=o=void 0,s)}function S(){var e=v(),r=_(e);if(i=arguments,o=this,l=e,r){if(void 0===u)return function(e){return c=e,u=setTimeout(w,t),f?d(e):s}(l);if(h)return u=setTimeout(w,t),d(l)}return void 0===u&&(u=setTimeout(w,t)),s}return t=b(t)||0,g(r)&&(f=!!r.leading,a=(h="maxWait"in r)?y(b(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p),S.cancel=function(){void 0!==u&&clearTimeout(u),c=0,i=l=o=u=void 0},S.flush=function(){return void 0===u?s:T(v())},S}(e,t,{leading:i,maxWait:t,trailing:o})}},57258:e=>{var t=Math.pow(2,32);e.exports=function(e){var r=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:r.getUint32(4),timescale:r.getUint32(8)},i=12;0===n.version?(n.earliestPresentationTime=r.getUint32(i),n.firstOffset=r.getUint32(i+4),i+=8):(n.earliestPresentationTime=r.getUint32(i)*t+r.getUint32(i+4),n.firstOffset=r.getUint32(i+8)*t+r.getUint32(i+12),i+=16),i+=2;var o=r.getUint16(i);for(i+=2;o>0;i+=12,o--)n.references.push({referenceType:(128&e[i])>>>7,referencedSize:2147483647&r.getUint32(i),subsegmentDuration:r.getUint32(i+4),startsWithSap:!!(128&e[i+8]),sapType:(112&e[i+8])>>>4,sapDeltaTime:268435455&r.getUint32(i+8)});return n}},28195:e=>{var t,r,n,i,o,a,s,u=9e4;t=function(e){return e*u},r=function(e,t){return e*t},n=function(e){return e/u},i=function(e,t){return e/t},o=function(e,r){return t(i(e,r))},a=function(e,t){return r(n(e),t)},s=function(e,t,r){return n(r?e:e-t)},e.exports={ONE_SECOND_IN_TS:u,secondsToVideoTs:t,secondsToAudioTs:r,videoTsToSeconds:n,audioTsToSeconds:i,audioTsToVideoTs:o,videoTsToAudioTs:a,metadataTsToSeconds:s}},11602:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof m?t:m,o=Object.create(i.prototype),a=new P(n||[]);return o._invoke=function(e,t,r){var n=f;return function(i,o){if(n===p)throw new Error("Generator is already running");if(n===d){if("throw"===i)throw o;return j()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=O(a,r);if(s){if(s===y)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var u=c(e,t,r);if("normal"===u.type){if(n=r.done?d:h,u.arg===y)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=d,r.method="throw",r.arg=u.arg)}}}(e,r,a),o}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var f="suspendedStart",h="suspendedYield",p="executing",d="completed",y={};function m(){}function v(){}function g(){}var b={};b[o]=function(){return this};var _=Object.getPrototypeOf,w=_&&_(_(x([])));w&&w!==r&&n.call(w,o)&&(b=w);var T=g.prototype=m.prototype=Object.create(b);function S(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(i,o,a,s){var u=c(e[i],e,o);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;this._invoke=function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}}function O(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var i=c(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var o=i.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function x(e){if(e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:j}}function j(){return{value:t,done:!0}}return v.prototype=T.constructor=g,g.constructor=v,v.displayName=u(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,u(e,s,"GeneratorFunction")),e.prototype=Object.create(T),e},e.awrap=function(e){return{__await:e}},S(E.prototype),E.prototype[a]=function(){return this},e.AsyncIterator=E,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new E(l(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(T),u(T,s,"Generator"),T[o]=function(){return this},T.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=x,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:x(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},8004:e=>{e.exports=function(e,t){var r,n=null;try{r=JSON.parse(e,t)}catch(e){n=e}return[n,r]}},31336:function(e){var t,r,n,i,o;t=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,i=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(e,t,n){if(n=n||{},e=e.trim(),!(t=t.trim())){if(!n.alwaysNormalize)return e;var i=o.parseURL(e);if(!i)throw new Error("Error trying to parse base URL.");return i.path=o.normalizePath(i.path),o.buildURLFromParts(i)}var a=o.parseURL(t);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return n.alwaysNormalize?(a.path=o.normalizePath(a.path),o.buildURLFromParts(a)):t;var s=o.parseURL(e);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&"/"!==s.path[0]){var u=r.exec(s.path);s.netLoc=u[1],s.path=u[2]}s.netLoc&&!s.path&&(s.path="/");var l={scheme:s.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(l.netLoc=s.netLoc,"/"!==a.path[0]))if(a.path){var c=s.path,f=c.substring(0,c.lastIndexOf("/")+1)+a.path;l.path=o.normalizePath(f)}else l.path=s.path,a.params||(l.params=s.params,a.query||(l.query=s.query));return null===l.path&&(l.path=n.alwaysNormalize?o.normalizePath(a.path):a.path),o.buildURLFromParts(l)},parseURL:function(e){var r=t.exec(e);return r?{scheme:r[1]||"",netLoc:r[2]||"",path:r[3]||"",params:r[4]||"",query:r[5]||"",fragment:r[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(n,"");e.length!==(e=e.replace(i,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=o},83983:(e,t,r)=>{var n=r(51562),i=e.exports={WebVTT:r(77735),VTTCue:r(65997),VTTRegion:r(17193)};n.vttjs=i,n.WebVTT=i.WebVTT;var o=i.VTTCue,a=i.VTTRegion,s=n.VTTCue,u=n.VTTRegion;i.shim=function(){n.VTTCue=o,n.VTTRegion=a},i.restore=function(){n.VTTCue=s,n.VTTRegion=u},n.VTTCue||i.shim()},77735:(e,t,r)=>{var n=r(3384),i=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 o(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function a(e){function t(e,t,r,n){return 3600*(0|e)+60*(0|t)+(0|r)+(0|n)/1e3}var r=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return r?r[3]?t(r[1],r[2],r[3].replace(":",""),r[4]):r[1]>59?t(r[1],r[2],0,r[4]):t(0,r[1],r[2],r[4]):null}function s(){this.values=i(null)}function u(e,t,r,n){var i=n?e.split(n):[e];for(var o in i)if("string"==typeof i[o]){var a=i[o].split(r);2===a.length&&t(a[0].trim(),a[1].trim())}}function l(e,t,r){var n=e;function i(){var t=a(e);if(null===t)throw new o(o.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function l(){e=e.replace(/^\s+/,"")}if(l(),t.startTime=i(),l(),"--\x3e"!==e.substr(0,3))throw new o(o.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),l(),t.endTime=i(),l(),function(e,t){var n=new s;u(e,(function(e,t){switch(e){case"region":for(var i=r.length-1;i>=0;i--)if(r[i].id===t){n.set(e,r[i].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var o=t.split(","),a=o[0];n.integer(e,a),n.percent(e,a)&&n.set("snapToLines",!1),n.alt(e,a,["auto"]),2===o.length&&n.alt("lineAlign",o[1],["start","center","end"]);break;case"position":o=t.split(","),n.percent(e,o[0]),2===o.length&&n.alt("positionAlign",o[1],["start","center","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","center","end","left","right"])}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");try{t.line=n.get("line","auto")}catch(e){}t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100);try{t.align=n.get("align","center")}catch(e){t.align=n.get("align","middle")}try{t.position=n.get("position","auto")}catch(e){t.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}o.prototype=i(Error.prototype),o.prototype.constructor=o,o.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},s.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,r){return r?this.has(e)?this.values[e]:t[r]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,r){for(var n=0;n<r.length;++n)if(t===r[n]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t))>=0&&t<=100)&&(this.set(e,t),!0)}};var c=n.createElement&&n.createElement("textarea"),f={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},h={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)"},p={v:"title",lang:"lang"},d={rt:"ruby"};function y(e,t){function r(){if(!t)return null;var e,r=t.match(/^([^<]*)(<[^>]*>?)?/);return e=r[1]?r[1]:r[2],t=t.substr(e.length),e}function n(e,t){return!d[t.localName]||d[t.localName]===e.localName}function i(t,r){var n=f[t];if(!n)return null;var i=e.document.createElement(n),o=p[t];return o&&r&&(i[o]=r.trim()),i}for(var o,s,u=e.document.createElement("div"),l=u,y=[];null!==(o=r());)if("<"!==o[0])l.appendChild(e.document.createTextNode((s=o,c.innerHTML=s,s=c.textContent,c.textContent="",s)));else{if("/"===o[1]){y.length&&y[y.length-1]===o.substr(2).replace(">","")&&(y.pop(),l=l.parentNode);continue}var m,v=a(o.substr(1,o.length-2));if(v){m=e.document.createProcessingInstruction("timestamp",v),l.appendChild(m);continue}var g=o.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!g)continue;if(!(m=i(g[1],g[3])))continue;if(!n(l,m))continue;if(g[2]){var b=g[2].split(".");b.forEach((function(e){var t=/^bg_/.test(e),r=t?e.slice(3):e;if(h.hasOwnProperty(r)){var n=t?"background-color":"color",i=h[r];m.style[n]=i}})),m.className=b.join(" ")}y.push(g[1]),l.appendChild(m),l=m}return u}var m=[[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 v(e){for(var t=0;t<m.length;t++){var r=m[t];if(e>=r[0]&&e<=r[1])return!0}return!1}function g(e){var t=[],r="";if(!e||!e.childNodes)return"ltr";function n(e,t){for(var r=t.childNodes.length-1;r>=0;r--)e.push(t.childNodes[r])}function i(e){if(!e||!e.length)return null;var t=e.pop(),r=t.textContent||t.innerText;if(r){var o=r.match(/^.*(\n|\r)/);return o?(e.length=0,o[0]):r}return"ruby"===t.tagName?i(e):t.childNodes?(n(e,t),i(e)):void 0}for(n(t,e);r=i(t);)for(var o=0;o<r.length;o++)if(v(r.charCodeAt(o)))return"rtl";return"ltr"}function b(){}function _(e,t,r){b.call(this),this.cue=t,this.cueDiv=y(e,t.text);var n={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(n,this.cueDiv),this.div=e.document.createElement("div"),n={direction:g(this.cueDiv),writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===t.align?"center":t.align,font:r.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(n),this.div.appendChild(this.cueDiv);var i=0;switch(t.positionAlign){case"start":case"line-left":i=t.position;break;case"center":i=t.position-t.size/2;break;case"end":case"line-right":i=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(i,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(i,"%"),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 w(e){var t,r,n,i;if(e.div){r=e.div.offsetHeight,n=e.div.offsetWidth,i=e.div.offsetTop;var o=(o=e.div.childNodes)&&(o=o[0])&&o.getClientRects&&o.getClientRects();e=e.div.getBoundingClientRect(),t=o?Math.max(o[0]&&o[0].height||0,e.height/o.length):0}this.left=e.left,this.right=e.right,this.top=e.top||i,this.height=e.height||r,this.bottom=e.bottom||i+(e.height||r),this.width=e.width||n,this.lineHeight=void 0!==t?t:e.lineHeight}function T(e,t,r,n){var i=new w(t),o=t.cue,a=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,r=t.textTrackList,n=0,i=0;i<r.length&&r[i]!==t;i++)"showing"===r[i].mode&&n++;return-1*++n}(o),s=[];if(o.snapToLines){var u;switch(o.vertical){case"":s=["+y","-y"],u="height";break;case"rl":s=["+x","-x"],u="width";break;case"lr":s=["-x","+x"],u="width"}var l=i.lineHeight,c=l*Math.round(a),f=r[u]+l,h=s[0];Math.abs(c)>f&&(c=c<0?-1:1,c*=Math.ceil(f/l)*l),a<0&&(c+=""===o.vertical?r.height:r.width,s=s.reverse()),i.move(h,c)}else{var p=i.lineHeight/r.height*100;switch(o.lineAlign){case"center":a-=p/2;break;case"end":a-=p}switch(o.vertical){case"":t.applyStyles({top:t.formatStyle(a,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(a,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(a,"%")})}s=["+y","-x","+x","-y"],i=new w(t)}var d=function(e,t){for(var i,o=new w(e),a=1,s=0;s<t.length;s++){for(;e.overlapsOppositeAxis(r,t[s])||e.within(r)&&e.overlapsAny(n);)e.move(t[s]);if(e.within(r))return e;var u=e.intersectPercentage(r);a>u&&(i=new w(e),a=u),e=new w(o)}return i||o}(i,s);t.move(d.toCSSCompatValues(r))}function S(){}b.prototype.applyStyles=function(e,t){for(var r in t=t||this.div,e)e.hasOwnProperty(r)&&(t.style[r]=e[r])},b.prototype.formatStyle=function(e,t){return 0===e?0:e+t},_.prototype=i(b.prototype),_.prototype.constructor=_,w.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}},w.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},w.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},w.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},w.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}},w.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)},w.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}},w.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,r=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||r}},S.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},S.convertCueToDOMTree=function(e,t){return e&&t?y(e,t):null},S.processCues=function(e,t,r){if(!e||!t||!r)return null;for(;r.firstChild;)r.removeChild(r.firstChild);var n=e.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",r.appendChild(n),function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}(t)){var i=[],o=w.getSimpleBoxPosition(n),a={font:Math.round(.05*o.height*100)/100+"px sans-serif"};!function(){for(var r,s,u=0;u<t.length;u++)s=t[u],r=new _(e,s,a),n.appendChild(r.div),T(0,r,o,i),s.displayState=r.div,i.push(w.getSimpleBoxPosition(r))}()}else for(var s=0;s<t.length;s++)n.appendChild(t[s].displayState)},S.Parser=function(e,t,r){r||(r=t,t={}),t||(t={}),this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=r||new TextDecoder("utf8"),this.regionList=[]},S.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof o))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){var t,r=this;function n(){for(var e=r.buffer,t=0;t<e.length&&"\r"!==e[t]&&"\n"!==e[t];)++t;var n=e.substr(0,t);return"\r"===e[t]&&++t,"\n"===e[t]&&++t,r.buffer=e.substr(t),n}e&&(r.buffer+=r.decoder.decode(e,{stream:!0}));try{var i;if("INITIAL"===r.state){if(!/\r\n|\n/.test(r.buffer))return this;var c=(i=n()).match(/^WEBVTT([ \t].*)?$/);if(!c||!c[0])throw new o(o.Errors.BadSignature);r.state="HEADER"}for(var f=!1;r.buffer;){if(!/\r\n|\n/.test(r.buffer))return this;switch(f?f=!1:i=n(),r.state){case"HEADER":/:/.test(i)?(t=i).match(/X-TIMESTAMP-MAP/)?u(t,(function(e,t){"X-TIMESTAMP-MAP"===e&&function(e){var t=new s;u(e,(function(e,r){switch(e){case"MPEGT":t.integer(e+"S",r);break;case"LOCA":t.set(e+"L",a(r))}}),/[^\d]:/,/,/),r.ontimestampmap&&r.ontimestampmap({MPEGTS:t.get("MPEGTS"),LOCAL:t.get("LOCAL")})}(t)}),/=/):u(t,(function(e,t){"Region"===e&&function(e){var t=new s;if(u(e,(function(e,r){switch(e){case"id":t.set(e,r);break;case"width":t.percent(e,r);break;case"lines":t.integer(e,r);break;case"regionanchor":case"viewportanchor":var n=r.split(",");if(2!==n.length)break;var i=new s;if(i.percent("x",n[0]),i.percent("y",n[1]),!i.has("x")||!i.has("y"))break;t.set(e+"X",i.get("x")),t.set(e+"Y",i.get("y"));break;case"scroll":t.alt(e,r,["up"])}}),/=/,/\s/),t.has("id")){var n=new(r.vttjs.VTTRegion||r.window.VTTRegion);n.width=t.get("width",100),n.lines=t.get("lines",3),n.regionAnchorX=t.get("regionanchorX",0),n.regionAnchorY=t.get("regionanchorY",100),n.viewportAnchorX=t.get("viewportanchorX",0),n.viewportAnchorY=t.get("viewportanchorY",100),n.scroll=t.get("scroll",""),r.onregion&&r.onregion(n),r.regionList.push({id:t.get("id"),region:n})}}(t)}),/:/):i||(r.state="ID");continue;case"NOTE":i||(r.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(i)){r.state="NOTE";break}if(!i)continue;r.cue=new(r.vttjs.VTTCue||r.window.VTTCue)(0,0,"");try{r.cue.align="center"}catch(e){r.cue.align="middle"}if(r.state="CUE",-1===i.indexOf("--\x3e")){r.cue.id=i;continue}case"CUE":try{l(i,r.cue,r.regionList)}catch(e){r.reportOrThrowError(e),r.cue=null,r.state="BADCUE";continue}r.state="CUETEXT";continue;case"CUETEXT":var h=-1!==i.indexOf("--\x3e");if(!i||h&&(f=!0)){r.oncue&&r.oncue(r.cue),r.cue=null,r.state="ID";continue}r.cue.text&&(r.cue.text+="\n"),r.cue.text+=i.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":i||(r.state="ID");continue}}}catch(e){r.reportOrThrowError(e),"CUETEXT"===r.state&&r.cue&&r.oncue&&r.oncue(r.cue),r.cue=null,r.state="INITIAL"===r.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new o(o.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}},e.exports=S},65997:e=>{var t={"":1,lr:1,rl:1},r={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function n(e){return"string"==typeof e&&!!r[e.toLowerCase()]&&e.toLowerCase()}function i(e,r,i){this.hasBeenReset=!1;var o="",a=!1,s=e,u=r,l=i,c=null,f="",h=!0,p="auto",d="start",y="auto",m="auto",v=100,g="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return o},set:function(e){o=""+e}},pauseOnExit:{enumerable:!0,get:function(){return a},set:function(e){a=!!e}},startTime:{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");s=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");u=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return l},set:function(e){l=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return c},set:function(e){c=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return f},set:function(e){var r=function(e){return"string"==typeof e&&!!t[e.toLowerCase()]&&e.toLowerCase()}(e);if(!1===r)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");f=r,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return h},set:function(e){h=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return p},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("Line: an invalid number or illegal string was specified.");p=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return d},set:function(e){var t=n(e);t?(d=t,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return y},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");y=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return m},set:function(e){var t=n(e);t?(m=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return v},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");v=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return g},set:function(e){var t=n(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");g=t,this.hasBeenReset=!0}}}),this.displayState=void 0}i.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},e.exports=i},17193:e=>{var t={"":!0,up:!0};function r(e){return"number"==typeof e&&e>=0&&e<=100}e.exports=function(){var e=100,n=3,i=0,o=100,a=0,s=100,u="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!r(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return n},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");n=e}},regionAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!r(e))throw new Error("RegionAnchorX must be between 0 and 100.");o=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!r(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return s},set:function(e){if(!r(e))throw new Error("ViewportAnchorY must be between 0 and 100.");s=e}},viewportAnchorX:{enumerable:!0,get:function(){return a},set:function(e){if(!r(e))throw new Error("ViewportAnchorX must be between 0 and 100.");a=e}},scroll:{enumerable:!0,get:function(){return u},set:function(e){var r=function(e){return"string"==typeof e&&!!t[e.toLowerCase()]&&e.toLowerCase()}(e);!1===r?console.warn("Scroll: an invalid or illegal string was specified."):u=r}}})}},73668:(e,t,r)=>{function n(e){this.options=e||{locator:{}}}function i(){this.cdata=!1}function o(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function a(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function s(e,t,r){return"string"==typeof e?e.substr(t,r):e.length>=t+r||t?new java.lang.String(e,t,r)+"":e}function u(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}n.prototype.parseFromString=function(e,t){var r=this.options,n=new f,o=r.domBuilder||new i,s=r.errorHandler,u=r.locator,c=r.xmlns||{},h=/\/x?html?$/.test(t),p=h?l.entityMap:{lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return u&&o.setDocumentLocator(u),n.errorHandler=function(e,t,r){if(!e){if(t instanceof i)return t;e=t}var n={},o=e instanceof Function;function s(t){var i=e[t];!i&&o&&(i=2==e.length?function(r){e(t,r)}:e),n[t]=i&&function(e){i("[xmldom "+t+"]\t"+e+a(r))}||function(){}}return r=r||{},s("warning"),s("error"),s("fatalError"),n}(s,o,u),n.domBuilder=r.domBuilder||o,h&&(c[""]="http://www.w3.org/1999/xhtml"),c.xml=c.xml||"http://www.w3.org/XML/1998/namespace",e&&"string"==typeof e?n.parse(e,c,p):n.errorHandler.error("invalid doc source"),o.doc},i.prototype={startDocument:function(){this.doc=(new p).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,r,n){var i=this.doc,a=i.createElementNS(e,r||t),s=n.length;u(this,a),this.currentElement=a,this.locator&&o(this.locator,a);for(var l=0;l<s;l++){e=n.getURI(l);var c=n.getValue(l),f=(r=n.getQName(l),i.createAttributeNS(e,r));this.locator&&o(n.getLocator(l),f),f.value=f.nodeValue=c,a.setAttributeNode(f)}},endElement:function(e,t,r){var n=this.currentElement;n.tagName,this.currentElement=n.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var r=this.doc.createProcessingInstruction(e,t);this.locator&&o(this.locator,r),u(this,r)},ignorableWhitespace:function(e,t,r){},characters:function(e,t,r){if(e=s.apply(this,arguments)){if(this.cdata)var n=this.doc.createCDATASection(e);else n=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(e)&&this.doc.appendChild(n),this.locator&&o(this.locator,n)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,r){e=s.apply(this,arguments);var n=this.doc.createComment(e);this.locator&&o(this.locator,n),u(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,r){var n=this.doc.implementation;if(n&&n.createDocumentType){var i=n.createDocumentType(e,t,r);this.locator&&o(this.locator,i),u(this,i)}},warning:function(e){console.warn("[xmldom warning]\t"+e,a(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,a(this.locator))},fatalError:function(e){throw new h(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(e){i.prototype[e]=function(){return null}}));var l=r(70624),c=r(91186),f=c.XMLReader,h=c.ParseError,p=r(51676).DOMImplementation;r(51676),t.a=n},51676:(e,t)=>{function r(e,t){for(var r in e)t[r]=e[r]}function n(e,t){var n=e.prototype;if(!(n instanceof t)){function i(){}i.prototype=t.prototype,r(n,i=new i),e.prototype=n=i}n.constructor!=e&&("function"!=typeof e&&console.error("unknow Class:"+e),n.constructor=e)}var i="http://www.w3.org/1999/xhtml",o={},a=o.ELEMENT_NODE=1,s=o.ATTRIBUTE_NODE=2,u=o.TEXT_NODE=3,l=o.CDATA_SECTION_NODE=4,c=o.ENTITY_REFERENCE_NODE=5,f=o.ENTITY_NODE=6,h=o.PROCESSING_INSTRUCTION_NODE=7,p=o.COMMENT_NODE=8,d=o.DOCUMENT_NODE=9,y=o.DOCUMENT_TYPE_NODE=10,m=o.DOCUMENT_FRAGMENT_NODE=11,v=o.NOTATION_NODE=12,g={},b={},_=(g.INDEX_SIZE_ERR=(b[1]="Index size error",1),g.DOMSTRING_SIZE_ERR=(b[2]="DOMString size error",2),g.HIERARCHY_REQUEST_ERR=(b[3]="Hierarchy request error",3)),w=(g.WRONG_DOCUMENT_ERR=(b[4]="Wrong document",4),g.INVALID_CHARACTER_ERR=(b[5]="Invalid character",5),g.NO_DATA_ALLOWED_ERR=(b[6]="No data allowed",6),g.NO_MODIFICATION_ALLOWED_ERR=(b[7]="No modification allowed",7),g.NOT_FOUND_ERR=(b[8]="Not found",8)),T=(g.NOT_SUPPORTED_ERR=(b[9]="Not supported",9),g.INUSE_ATTRIBUTE_ERR=(b[10]="Attribute in use",10));function S(e,t){if(t instanceof Error)var r=t;else r=this,Error.call(this,b[e]),this.message=b[e],Error.captureStackTrace&&Error.captureStackTrace(this,S);return r.code=e,t&&(this.message=this.message+": "+t),r}function E(){}function O(e,t){this._node=e,this._refresh=t,k(this)}function k(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var n=e._refresh(e._node);ne(e,"length",n.length),r(n,e),e._inc=t}}function C(){}function P(e,t){for(var r=e.length;r--;)if(e[r]===t)return r}function x(e,t,r,n){if(n?t[P(t,n)]=r:t[t.length++]=r,e){r.ownerElement=e;var i=e.ownerDocument;i&&(n&&M(i,e,n),function(e,t,r){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==r.namespaceURI&&(t._nsMap[r.prefix?r.localName:""]=r.value)}(i,e,r))}}function j(e,t,r){var n=P(t,r);if(!(n>=0))throw S(w,new Error(e.tagName+"@"+r));for(var i=t.length-1;n<i;)t[n]=t[++n];if(t.length=i,e){var o=e.ownerDocument;o&&(M(o,e,r),r.ownerElement=null)}}function L(e){if(this._features={},e)for(var t in e)this._features=e[t]}function I(){}function A(e){return("<"==e?"<":">"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function R(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(R(e,t))return!0}while(e=e.nextSibling)}function D(){}function M(e,t,r,n){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==r.namespaceURI&&delete t._nsMap[r.prefix?r.localName:""]}function N(e,t,r){if(e&&e._inc){e._inc++;var n=t.childNodes;if(r)n[n.length++]=r;else{for(var i=t.firstChild,o=0;i;)n[o++]=i,i=i.nextSibling;n.length=o}}}function B(e,t){var r=t.previousSibling,n=t.nextSibling;return r?r.nextSibling=n:e.firstChild=n,n?n.previousSibling=r:e.lastChild=r,N(e.ownerDocument,e),t}function U(e,t,r){var n=t.parentNode;if(n&&n.removeChild(t),t.nodeType===m){var i=t.firstChild;if(null==i)return t;var o=t.lastChild}else i=o=t;var a=r?r.previousSibling:e.lastChild;i.previousSibling=a,o.nextSibling=r,a?a.nextSibling=i:e.firstChild=i,null==r?e.lastChild=o:r.previousSibling=o;do{i.parentNode=e}while(i!==o&&(i=i.nextSibling));return N(e.ownerDocument||e,e),t.nodeType==m&&(t.firstChild=t.lastChild=null),t}function F(){this._nsMap={}}function V(){}function H(){}function q(){}function z(){}function W(){}function G(){}function X(){}function K(){}function Y(){}function Q(){}function $(){}function J(e,t){var r=[],n=9==this.nodeType&&this.documentElement||this,i=n.prefix,o=n.namespaceURI;if(o&&null==i&&null==(i=n.lookupPrefix(o)))var a=[{namespace:o,prefix:null}];return ee(this,r,e,t,a),r.join("")}function Z(e,t,r){var n=e.prefix||"",i=e.namespaceURI;if(!n&&!i)return!1;if("xml"===n&&"http://www.w3.org/XML/1998/namespace"===i||"http://www.w3.org/2000/xmlns/"==i)return!1;for(var o=r.length;o--;){var a=r[o];if(a.prefix==n)return a.namespace!=i}return!0}function ee(e,t,r,n,o){if(n){if(!(e=n(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case a:o||(o=[]),o.length;var f=e.attributes,v=f.length,g=e.firstChild,b=e.tagName;r=i===e.namespaceURI||r,t.push("<",b);for(var _=0;_<v;_++)"xmlns"==(w=f.item(_)).prefix?o.push({prefix:w.localName,namespace:w.value}):"xmlns"==w.nodeName&&o.push({prefix:"",namespace:w.value});for(_=0;_<v;_++){var w;if(Z(w=f.item(_),0,o)){var T=w.prefix||"",S=w.namespaceURI,E=T?" xmlns:"+T:" xmlns";t.push(E,'="',S,'"'),o.push({prefix:T,namespace:S})}ee(w,t,r,n,o)}if(Z(e,0,o)&&(T=e.prefix||"",S=e.namespaceURI,E=T?" xmlns:"+T:" xmlns",t.push(E,'="',S,'"'),o.push({prefix:T,namespace:S})),g||r&&!/^(?:meta|link|img|br|hr|input)$/i.test(b)){if(t.push(">"),r&&/^script$/i.test(b))for(;g;)g.data?t.push(g.data):ee(g,t,r,n,o),g=g.nextSibling;else for(;g;)ee(g,t,r,n,o),g=g.nextSibling;t.push("</",b,">")}else t.push("/>");return;case d:case m:for(g=e.firstChild;g;)ee(g,t,r,n,o),g=g.nextSibling;return;case s:return t.push(" ",e.name,'="',e.value.replace(/[&"]/g,A),'"');case u:return t.push(e.data.replace(/[<&]/g,A).replace(/]]>/g,"]]>"));case l:return t.push("<![CDATA[",e.data,"]]>");case p:return t.push("\x3c!--",e.data,"--\x3e");case y:var O=e.publicId,k=e.systemId;if(t.push("<!DOCTYPE ",e.name),O)t.push(" PUBLIC ",O),k&&"."!=k&&t.push(" ",k),t.push(">");else if(k&&"."!=k)t.push(" SYSTEM ",k,">");else{var C=e.internalSubset;C&&t.push(" [",C,"]"),t.push(">")}return;case h:return t.push("<?",e.target," ",e.data,"?>");case c:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function te(e,t,r){var n;switch(t.nodeType){case a:(n=t.cloneNode(!1)).ownerDocument=e;case m:break;case s:r=!0}if(n||(n=t.cloneNode(!1)),n.ownerDocument=e,n.parentNode=null,r)for(var i=t.firstChild;i;)n.appendChild(te(e,i,r)),i=i.nextSibling;return n}function re(e,t,r){var n=new t.constructor;for(var i in t){var o=t[i];"object"!=typeof o&&o!=n[i]&&(n[i]=o)}switch(t.childNodes&&(n.childNodes=new E),n.ownerDocument=e,n.nodeType){case a:var u=t.attributes,l=n.attributes=new C,c=u.length;l._ownerElement=n;for(var f=0;f<c;f++)n.setAttributeNode(re(e,u.item(f),!0));break;case s:r=!0}if(r)for(var h=t.firstChild;h;)n.appendChild(re(e,h,r)),h=h.nextSibling;return n}function ne(e,t,r){e[t]=r}g.INVALID_STATE_ERR=(b[11]="Invalid state",11),g.SYNTAX_ERR=(b[12]="Syntax error",12),g.INVALID_MODIFICATION_ERR=(b[13]="Invalid modification",13),g.NAMESPACE_ERR=(b[14]="Invalid namespace",14),g.INVALID_ACCESS_ERR=(b[15]="Invalid access",15),S.prototype=Error.prototype,r(g,S),E.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var r=[],n=0;n<this.length;n++)ee(this[n],r,e,t);return r.join("")}},O.prototype.item=function(e){return k(this),this[e]},n(O,E),C.prototype={length:0,item:E.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var r=this[t];if(r.nodeName==e)return r}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new S(T);var r=this.getNamedItem(e.nodeName);return x(this._ownerElement,this,e,r),r},setNamedItemNS:function(e){var t,r=e.ownerElement;if(r&&r!=this._ownerElement)throw new S(T);return t=this.getNamedItemNS(e.namespaceURI,e.localName),x(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return j(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var r=this.getNamedItemNS(e,t);return j(this._ownerElement,this,r),r},getNamedItemNS:function(e,t){for(var r=this.length;r--;){var n=this[r];if(n.localName==t&&n.namespaceURI==e)return n}return null}},L.prototype={hasFeature:function(e,t){var r=this._features[e.toLowerCase()];return!(!r||t&&!(t in r))},createDocument:function(e,t,r){var n=new D;if(n.implementation=this,n.childNodes=new E,n.doctype=r,r&&n.appendChild(r),t){var i=n.createElementNS(e,t);n.appendChild(i)}return n},createDocumentType:function(e,t,r){var n=new G;return n.name=e,n.nodeName=e,n.publicId=t,n.systemId=r,n}},I.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 U(this,e,t)},replaceChild:function(e,t){this.insertBefore(e,t),t&&this.removeChild(t)},removeChild:function(e){return B(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return re(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==u&&e.nodeType==u?(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 r=t._nsMap;if(r)for(var n in r)if(r[n]==e)return n;t=t.nodeType==s?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var r=t._nsMap;if(r&&e in r)return r[e];t=t.nodeType==s?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},r(o,I),r(o,I.prototype),D.prototype={nodeName:"#document",nodeType:d,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==m){for(var r=e.firstChild;r;){var n=r.nextSibling;this.insertBefore(r,t),r=n}return e}return null==this.documentElement&&e.nodeType==a&&(this.documentElement=e),U(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),B(this,e)},importNode:function(e,t){return te(this,e,t)},getElementById:function(e){var t=null;return R(this.documentElement,(function(r){if(r.nodeType==a&&r.getAttribute("id")==e)return t=r,!0})),t},getElementsByClassName:function(e){var t=new RegExp("(^|\\s)"+e+"(\\s|$)");return new O(this,(function(e){var r=[];return R(e.documentElement,(function(n){n!==e&&n.nodeType==a&&t.test(n.getAttribute("class"))&&r.push(n)})),r}))},createElement:function(e){var t=new F;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new E,(t.attributes=new C)._ownerElement=t,t},createDocumentFragment:function(){var e=new Q;return e.ownerDocument=this,e.childNodes=new E,e},createTextNode:function(e){var t=new q;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new z;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new W;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var r=new $;return r.ownerDocument=this,r.tagName=r.target=e,r.nodeValue=r.data=t,r},createAttribute:function(e){var t=new V;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new Y;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var r=new F,n=t.split(":"),i=r.attributes=new C;return r.childNodes=new E,r.ownerDocument=this,r.nodeName=t,r.tagName=t,r.namespaceURI=e,2==n.length?(r.prefix=n[0],r.localName=n[1]):r.localName=t,i._ownerElement=r,r},createAttributeNS:function(e,t){var r=new V,n=t.split(":");return r.ownerDocument=this,r.nodeName=t,r.name=t,r.namespaceURI=e,r.specified=!0,2==n.length?(r.prefix=n[0],r.localName=n[1]):r.localName=t,r}},n(D,I),F.prototype={nodeType:a,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 r=this.ownerDocument.createAttribute(e);r.value=r.nodeValue=""+t,this.setAttributeNode(r)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===m?this.insertBefore(e,null):function(e,t){var r=t.parentNode;if(r){var n=e.lastChild;r.removeChild(t),n=e.lastChild}return n=e.lastChild,t.parentNode=e,t.previousSibling=n,t.nextSibling=null,n?n.nextSibling=t:e.firstChild=t,e.lastChild=t,N(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 r=this.getAttributeNodeNS(e,t);r&&this.removeAttributeNode(r)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var r=this.getAttributeNodeNS(e,t);return r&&r.value||""},setAttributeNS:function(e,t,r){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+r,this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new O(this,(function(t){var r=[];return R(t,(function(n){n===t||n.nodeType!=a||"*"!==e&&n.tagName!=e||r.push(n)})),r}))},getElementsByTagNameNS:function(e,t){return new O(this,(function(r){var n=[];return R(r,(function(i){i===r||i.nodeType!==a||"*"!==e&&i.namespaceURI!==e||"*"!==t&&i.localName!=t||n.push(i)})),n}))}},D.prototype.getElementsByTagName=F.prototype.getElementsByTagName,D.prototype.getElementsByTagNameNS=F.prototype.getElementsByTagNameNS,n(F,I),V.prototype.nodeType=s,n(V,I),H.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(b[_])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,r){r=this.data.substring(0,e)+r+this.data.substring(e+t),this.nodeValue=this.data=r,this.length=r.length}},n(H,I),q.prototype={nodeName:"#text",nodeType:u,splitText:function(e){var t=this.data,r=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(r);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},n(q,H),z.prototype={nodeName:"#comment",nodeType:p},n(z,H),W.prototype={nodeName:"#cdata-section",nodeType:l},n(W,H),G.prototype.nodeType=y,n(G,I),X.prototype.nodeType=v,n(X,I),K.prototype.nodeType=f,n(K,I),Y.prototype.nodeType=c,n(Y,I),Q.prototype.nodeName="#document-fragment",Q.prototype.nodeType=m,n(Q,I),$.prototype.nodeType=h,n($,I),I.prototype.toString=J;try{if(Object.defineProperty){function ie(e){switch(e.nodeType){case a:case m:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(ie(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(O.prototype,"length",{get:function(){return k(this),this.$$length}}),Object.defineProperty(I.prototype,"textContent",{get:function(){return ie(this)},set:function(e){switch(this.nodeType){case a:case m: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}}}),ne=function(e,t,r){e["$$"+t]=r}}}catch(oe){}t.DOMImplementation=L},70624:(e,t)=>{t.entityMap={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:"♦"}},91186:(e,t)=>{var r=/[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]/,n=new RegExp("[\\-\\.0-9"+r.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),i=new RegExp("^"+r.source+n.source+"*(?::"+r.source+n.source+"*)?$");function o(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,o)}function a(){}function s(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function u(e,t,r,n,i,o){function a(e,t,n){e in r.attributeNames&&o.fatalError("Attribute "+e+" redefined"),r.addValue(e,t,n)}for(var s,u=++t,l=0;;){var c=e.charAt(u);switch(c){case"=":if(1===l)s=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&&(o.warning('attribute value must after "="'),s=e.slice(t,u)),t=u+1,!((u=e.indexOf(c,t))>0))throw new Error("attribute value no end '"+c+"' match");a(s,f=e.slice(t,u).replace(/&#?\w+;/g,i),t-1),l=5}else{if(4!=l)throw new Error('attribute value must after "="');a(s,f=e.slice(t,u).replace(/&#?\w+;/g,i),t),o.warning('attribute "'+s+'" missed start quot('+c+")!!"),t=u+1,l=5}break;case"/":switch(l){case 0:r.setTagName(e.slice(t,u));case 5:case 6:case 7:l=7,r.closed=!0;case 4:case 1:case 2:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),0==l&&r.setTagName(e.slice(t,u)),u;case">":switch(l){case 0:r.setTagName(e.slice(t,u));case 5:case 6:case 7:break;case 4:case 1:"/"===(f=e.slice(t,u)).slice(-1)&&(r.closed=!0,f=f.slice(0,-1));case 2:2===l&&(f=s),4==l?(o.warning('attribute "'+f+'" missed quot(")!'),a(s,f.replace(/&#?\w+;/g,i),t)):("http://www.w3.org/1999/xhtml"===n[""]&&f.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+f+'" missed value!! "'+f+'" instead!!'),a(f,f,t));break;case 3:throw new Error("attribute value missed!!")}return u;case"":c=" ";default:if(c<=" ")switch(l){case 0:r.setTagName(e.slice(t,u)),l=6;break;case 1:s=e.slice(t,u),l=2;break;case 4:var f=e.slice(t,u).replace(/&#?\w+;/g,i);o.warning('attribute "'+f+'" missed quot(")!!'),a(s,f,t);case 5:l=6}else switch(l){case 2:r.tagName,"http://www.w3.org/1999/xhtml"===n[""]&&s.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+s+'" missed value!! "'+s+'" instead2!!'),a(s,s,t),t=u,l=1;break;case 5:o.warning('attribute space is required"'+s+'"!!');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 l(e,t,r){for(var n=e.tagName,i=null,o=e.length;o--;){var a=e[o],s=a.qName,u=a.value;if((p=s.indexOf(":"))>0)var l=a.prefix=s.slice(0,p),c=s.slice(p+1),f="xmlns"===l&&c;else c=s,l=null,f="xmlns"===s&&"";a.localName=c,!1!==f&&(null==i&&(i={},h(r,r={})),r[f]=i[f]=u,a.uri="http://www.w3.org/2000/xmlns/",t.startPrefixMapping(f,u))}for(o=e.length;o--;)(l=(a=e[o]).prefix)&&("xml"===l&&(a.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==l&&(a.uri=r[l||""]));var p;(p=n.indexOf(":"))>0?(l=e.prefix=n.slice(0,p),c=e.localName=n.slice(p+1)):(l=null,c=e.localName=n);var d=e.uri=r[l||""];if(t.startElement(d,c,n,e),!e.closed)return e.currentNSMap=r,e.localNSMap=i,!0;if(t.endElement(d,c,n),i)for(l in i)t.endPrefixMapping(l)}function c(e,t,r,n,i){if(/^(?:script|textarea)$/i.test(r)){var o=e.indexOf("</"+r+">",t),a=e.substring(t+1,o);if(/[&<]/.test(a))return/^script$/i.test(r)?(i.characters(a,0,a.length),o):(a=a.replace(/&#?\w+;/g,n),i.characters(a,0,a.length),o)}return t+1}function f(e,t,r,n){var i=n[r];return null==i&&((i=e.lastIndexOf("</"+r+">"))<t&&(i=e.lastIndexOf("</"+r)),n[r]=i),i<t}function h(e,t){for(var r in e)t[r]=e[r]}function p(e,t,r,n){if("-"===e.charAt(t+2))return"-"===e.charAt(t+3)?(i=e.indexOf("--\x3e",t+4))>t?(r.comment(e,t+4,i-t-4),i+3):(n.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(t+3,6)){var i=e.indexOf("]]>",t+9);return r.startCDATA(),r.characters(e,t+9,i-t-9),r.endCDATA(),i+3}var o=function(e,t){var r,n=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=t,i.exec(e);r=i.exec(e);)if(n.push(r),r[1])return n}(e,t),a=o.length;if(a>1&&/!doctype/i.test(o[0][0])){var s=o[1][0],u=!1,l=!1;a>3&&(/^public$/i.test(o[2][0])?(u=o[3][0],l=a>4&&o[4][0]):/^system$/i.test(o[2][0])&&(l=o[3][0]));var c=o[a-1];return r.startDTD(s,u,l),r.endDTD(),c.index+c[0].length}return-1}function d(e,t,r){var n=e.indexOf("?>",t);if(n){var i=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return i?(i[0].length,r.processingInstruction(i[1],i[2]),n+2):-1}return-1}function y(){this.attributeNames={}}o.prototype=new Error,o.prototype.name=o.name,a.prototype={parse:function(e,t,r){var n=this.domBuilder;n.startDocument(),h(t,t={}),function(e,t,r,n,i){function a(e){var t=e.slice(1,-1);return t in r?r[t]:"#"===t.charAt(0)?function(e){if(e>65535){var t=55296+((e-=65536)>>10),r=56320+(1023&e);return String.fromCharCode(t,r)}return String.fromCharCode(e)}(parseInt(t.substr(1).replace("x","0x"))):(i.error("entity not found:"+e),e)}function h(t){if(t>S){var r=e.substring(S,t).replace(/&#?\w+;/g,a);_&&m(S),n.characters(r,0,t-S),S=t}}function m(t,r){for(;t>=g&&(r=b.exec(e));)v=r.index,g=v+r[0].length,_.lineNumber++;_.columnNumber=t-v+1}for(var v=0,g=0,b=/.*(?:\r\n?|\n)|.*$/g,_=n.locator,w=[{currentNSMap:t}],T={},S=0;;){try{var E=e.indexOf("<",S);if(E<0){if(!e.substr(S).match(/^\s*$/)){var O=n.doc,k=O.createTextNode(e.substr(S));O.appendChild(k),n.currentElement=k}return}switch(E>S&&h(E),e.charAt(E+1)){case"/":var C=e.indexOf(">",E+3),P=e.substring(E+2,C),x=w.pop();C<0?(P=e.substring(E+2).replace(/[\s<].*/,""),i.error("end tag name: "+P+" is not complete:"+x.tagName),C=E+1+P.length):P.match(/\s</)&&(P=P.replace(/[\s<].*/,""),i.error("end tag name: "+P+" maybe not complete"),C=E+1+P.length);var j=x.localNSMap,L=x.tagName==P;if(L||x.tagName&&x.tagName.toLowerCase()==P.toLowerCase()){if(n.endElement(x.uri,x.localName,P),j)for(var I in j)n.endPrefixMapping(I);L||i.fatalError("end tag name: "+P+" is not match the current start tagName:"+x.tagName)}else w.push(x);C++;break;case"?":_&&m(E),C=d(e,E,n);break;case"!":_&&m(E),C=p(e,E,n,i);break;default:_&&m(E);var A=new y,R=w[w.length-1].currentNSMap,D=(C=u(e,E,A,R,a,i),A.length);if(!A.closed&&f(e,C,A.tagName,T)&&(A.closed=!0,r.nbsp||i.warning("unclosed xml attribute")),_&&D){for(var M=s(_,{}),N=0;N<D;N++){var B=A[N];m(B.offset),B.locator=s(_,{})}n.locator=M,l(A,n,R)&&w.push(A),n.locator=_}else l(A,n,R)&&w.push(A);"http://www.w3.org/1999/xhtml"!==A.uri||A.closed?C++:C=c(e,C,A.tagName,a,n)}}catch(e){if(e instanceof o)throw e;i.error("element parse error: "+e),C=-1}C>S?S=C:h(Math.max(E,S)+1)}}(e,t,r,n,this.errorHandler),n.endDocument()}},y.prototype={setTagName:function(e){if(!i.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,r){if(!i.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:r}},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}},t.XMLReader=a,t.ParseError=o},58421:()=>{},448:e=>{function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(this,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Player:()=>mj}),r(11602);var e=r(51562),t=r.n(e),i=r(3384),o=r.n(i);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a.apply(this,arguments)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function l(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,u(e,t)}var c=r(8004),f=r.n(c),h=r(19389),p=r.n(h),d=r(68942),y=r.n(d),m=r(83983),v=r.n(m);function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(g=function(){return!!e})()}var b=r(31336),_=r.n(b);const w=function(e,r){if(/^[a-z]+:/i.test(r))return r;/^data:/.test(e)&&(e=t().location&&t().location.href||"");var n="function"==typeof t().URL,i=/^\/\//.test(e),o=!t().location&&!/\/\//i.test(e);if(n?e=new(t().URL)(e,t().location||"http://example.com"):/\/\//i.test(e)||(e=_().buildAbsoluteURL(t().location&&t().location.href||"",e)),n){var a=new URL(r,e);return o?a.href.slice(18):i?a.href.slice(a.protocol.length):a.href}return _().buildAbsoluteURL(e,r)};var T=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 r=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(r,1),r>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var r=t.length,n=0;n<r;++n)t[n].call(this,arguments[1]);else for(var i=Array.prototype.slice.call(arguments,1),o=t.length,a=0;a<o;++a)t[a].apply(this,i)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}();function S(e){for(var r=function(e){return t().atob?t().atob(e):Buffer.from(e,"base64").toString("binary")}(e),n=new Uint8Array(r.length),i=0;i<r.length;i++)n[i]=r.charCodeAt(i);return n}var E,O=function(e){function t(){var t;return(t=e.call(this)||this).buffer="",t}return l(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}(T),k=String.fromCharCode(9),C=function(e){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),r={};return t[1]&&(r.length=parseInt(t[1],10)),t[2]&&(r.offset=parseInt(t[2],10)),r},P=function(e){for(var t,r=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),n={},i=r.length;i--;)""!==r[i]&&((t=/([^=]*)=(.*)/.exec(r[i]).slice(1))[0]=t[0].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^['"](.*)['"]$/g,"$1"),n[t[0]]=t[1]);return n},x=function(e){function t(){var t;return(t=e.call(this)||this).customParsers=[],t.tagMappers=[],t}l(t,e);var r=t.prototype;return r.push=function(e){var t,r,n=this;0!==(e=e.trim()).length&&("#"===e[0]?this.tagMappers.reduce((function(t,r){var n=r(e);return n===e?t:t.concat([n])}),[e]).forEach((function(e){for(var i=0;i<n.customParsers.length;i++)if(n.customParsers[i].call(n,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e))n.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e))return r={type:"tag",tagType:"inf"},t[1]&&(r.duration=parseFloat(t[1])),t[2]&&(r.title=t[2]),void n.trigger("data",r);if(t=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e))return r={type:"tag",tagType:"targetduration"},t[1]&&(r.duration=parseInt(t[1],10)),void n.trigger("data",r);if(t=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(e))return r={type:"tag",tagType:"version"},t[1]&&(r.version=parseInt(t[1],10)),void n.trigger("data",r);if(t=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return r={type:"tag",tagType:"media-sequence"},t[1]&&(r.number=parseInt(t[1],10)),void n.trigger("data",r);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return r={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(r.number=parseInt(t[1],10)),void n.trigger("data",r);if(t=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e))return r={type:"tag",tagType:"playlist-type"},t[1]&&(r.playlistType=t[1]),void n.trigger("data",r);if(t=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(e))return r=a(C(t[1]),{type:"tag",tagType:"byterange"}),void n.trigger("data",r);if(t=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e))return r={type:"tag",tagType:"allow-cache"},t[1]&&(r.allowed=!/NO/.test(t[1])),void n.trigger("data",r);if(t=/^#EXT-X-MAP:?(.*)$/.exec(e)){if(r={type:"tag",tagType:"map"},t[1]){var o=P(t[1]);o.URI&&(r.uri=o.URI),o.BYTERANGE&&(r.byterange=C(o.BYTERANGE))}n.trigger("data",r)}else if(t=/^#EXT-X-STREAM-INF:?(.*)$/.exec(e)){if(r={type:"tag",tagType:"stream-inf"},t[1]){if(r.attributes=P(t[1]),r.attributes.RESOLUTION){var s=r.attributes.RESOLUTION.split("x"),u={};s[0]&&(u.width=parseInt(s[0],10)),s[1]&&(u.height=parseInt(s[1],10)),r.attributes.RESOLUTION=u}r.attributes.BANDWIDTH&&(r.attributes.BANDWIDTH=parseInt(r.attributes.BANDWIDTH,10)),r.attributes["PROGRAM-ID"]&&(r.attributes["PROGRAM-ID"]=parseInt(r.attributes["PROGRAM-ID"],10))}n.trigger("data",r)}else{if(t=/^#EXT-X-MEDIA:?(.*)$/.exec(e))return r={type:"tag",tagType:"media"},t[1]&&(r.attributes=P(t[1])),void n.trigger("data",r);if(t=/^#EXT-X-ENDLIST/.exec(e))n.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e))n.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(t=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e))return r={type:"tag",tagType:"program-date-time"},t[1]&&(r.dateTimeString=t[1],r.dateTimeObject=new Date(t[1])),void n.trigger("data",r);if(t=/^#EXT-X-KEY:?(.*)$/.exec(e))return r={type:"tag",tagType:"key"},t[1]&&(r.attributes=P(t[1]),r.attributes.IV&&("0x"===r.attributes.IV.substring(0,2).toLowerCase()&&(r.attributes.IV=r.attributes.IV.substring(2)),r.attributes.IV=r.attributes.IV.match(/.{8}/g),r.attributes.IV[0]=parseInt(r.attributes.IV[0],16),r.attributes.IV[1]=parseInt(r.attributes.IV[1],16),r.attributes.IV[2]=parseInt(r.attributes.IV[2],16),r.attributes.IV[3]=parseInt(r.attributes.IV[3],16),r.attributes.IV=new Uint32Array(r.attributes.IV))),void n.trigger("data",r);if(t=/^#EXT-X-START:?(.*)$/.exec(e))return r={type:"tag",tagType:"start"},t[1]&&(r.attributes=P(t[1]),r.attributes["TIME-OFFSET"]=parseFloat(r.attributes["TIME-OFFSET"]),r.attributes.PRECISE=/YES/.test(r.attributes.PRECISE)),void n.trigger("data",r);if(t=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e))return r={type:"tag",tagType:"cue-out-cont"},t[1]?r.data=t[1]:r.data="",void n.trigger("data",r);if(t=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(e))return r={type:"tag",tagType:"cue-out"},t[1]?r.data=t[1]:r.data="",void n.trigger("data",r);if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e))return r={type:"tag",tagType:"cue-in"},t[1]?r.data=t[1]:r.data="",void n.trigger("data",r);if((t=/^#EXT-X-SKIP:(.*)$/.exec(e))&&t[1])return(r={type:"tag",tagType:"skip"}).attributes=P(t[1]),r.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(r.attributes["SKIPPED-SEGMENTS"]=parseInt(r.attributes["SKIPPED-SEGMENTS"],10)),r.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(r.attributes["RECENTLY-REMOVED-DATERANGES"]=r.attributes["RECENTLY-REMOVED-DATERANGES"].split(k)),void n.trigger("data",r);if((t=/^#EXT-X-PART:(.*)$/.exec(e))&&t[1])return(r={type:"tag",tagType:"part"}).attributes=P(t[1]),["DURATION"].forEach((function(e){r.attributes.hasOwnProperty(e)&&(r.attributes[e]=parseFloat(r.attributes[e]))})),["INDEPENDENT","GAP"].forEach((function(e){r.attributes.hasOwnProperty(e)&&(r.attributes[e]=/YES/.test(r.attributes[e]))})),r.attributes.hasOwnProperty("BYTERANGE")&&(r.attributes.byterange=C(r.attributes.BYTERANGE)),void n.trigger("data",r);if((t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e))&&t[1])return(r={type:"tag",tagType:"server-control"}).attributes=P(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach((function(e){r.attributes.hasOwnProperty(e)&&(r.attributes[e]=parseFloat(r.attributes[e]))})),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach((function(e){r.attributes.hasOwnProperty(e)&&(r.attributes[e]=/YES/.test(r.attributes[e]))})),void n.trigger("data",r);if((t=/^#EXT-X-PART-INF:(.*)$/.exec(e))&&t[1])return(r={type:"tag",tagType:"part-inf"}).attributes=P(t[1]),["PART-TARGET"].forEach((function(e){r.attributes.hasOwnProperty(e)&&(r.attributes[e]=parseFloat(r.attributes[e]))})),void n.trigger("data",r);if((t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e))&&t[1])return(r={type:"tag",tagType:"preload-hint"}).attributes=P(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach((function(e){if(r.attributes.hasOwnProperty(e)){r.attributes[e]=parseInt(r.attributes[e],10);var t="BYTERANGE-LENGTH"===e?"length":"offset";r.attributes.byterange=r.attributes.byterange||{},r.attributes.byterange[t]=r.attributes[e],delete r.attributes[e]}})),void n.trigger("data",r);if((t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e))&&t[1])return(r={type:"tag",tagType:"rendition-report"}).attributes=P(t[1]),["LAST-MSN","LAST-PART"].forEach((function(e){r.attributes.hasOwnProperty(e)&&(r.attributes[e]=parseInt(r.attributes[e],10))})),void n.trigger("data",r);n.trigger("data",{type:"tag",data:e.slice(4)})}}}else n.trigger("data",{type:"comment",text:e.slice(1)})})):this.trigger("data",{type:"uri",uri:e}))},r.addParser=function(e){var t=this,r=e.expression,n=e.customType,i=e.dataParser,o=e.segment;"function"!=typeof i&&(i=function(e){return e}),this.customParsers.push((function(e){if(r.exec(e))return t.trigger("data",{type:"custom",data:i(e),customType:n,segment:o}),!0}))},r.addTagMapper=function(e){var t=e.expression,r=e.map;this.tagMappers.push((function(e){return t.test(e)?r(e):e}))},t}(T),j=function(e){var t={};return Object.keys(e).forEach((function(r){var n;t[(n=r,n.toLowerCase().replace(/-(\w)/g,(function(e){return e[1].toUpperCase()})))]=e[r]})),t},L=function(e){var t=e.serverControl,r=e.targetDuration,n=e.partTargetDuration;if(t){var i="#EXT-X-SERVER-CONTROL",o="holdBack",a="partHoldBack",s=r&&3*r,u=n&&2*n;r&&!t.hasOwnProperty(o)&&(t[o]=s,this.trigger("info",{message:i+" defaulting HOLD-BACK to targetDuration * 3 ("+s+")."})),s&&t[o]<s&&(this.trigger("warn",{message:i+" clamping HOLD-BACK ("+t[o]+") to targetDuration * 3 ("+s+")"}),t[o]=s),n&&!t.hasOwnProperty(a)&&(t[a]=3*n,this.trigger("info",{message:i+" defaulting PART-HOLD-BACK to partTargetDuration * 3 ("+t[a]+")."})),n&&t[a]<u&&(this.trigger("warn",{message:i+" clamping PART-HOLD-BACK ("+t[a]+") to partTargetDuration * 2 ("+u+")."}),t[a]=u)}},I=function(e){function t(){var t;(t=e.call(this)||this).lineStream=new O,t.parseStream=new x,t.lineStream.pipe(t.parseStream);var r,n,i=s(t),o=[],u={},l=!1,c=function(){},f={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},h=0;t.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var p=0,d=0;return t.on("end",(function(){u.uri||!u.parts&&!u.preloadHints||(!u.map&&r&&(u.map=r),!u.key&&n&&(u.key=n),u.timeline||"number"!=typeof h||(u.timeline=h),t.manifest.preloadSegment=u)})),t.parseStream.on("data",(function(e){var t,s;({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&&(u.byterange=t,t.length=e.length,"offset"in e||(e.offset=p)),"offset"in e&&(u.byterange=t,t.offset=e.offset),p=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&&(u.duration=e.duration),0===e.duration&&(u.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=o},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:S(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"}),n={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(n.iv=e.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else n=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,h=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(){r={},e.uri&&(r.uri=e.uri),e.byterange&&(r.byterange=e.byterange),n&&(r.key=n)},"stream-inf":function(){this.manifest.playlists=o,this.manifest.mediaGroups=this.manifest.mediaGroups||f,e.attributes?(u.attributes||(u.attributes={}),a(u.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||f,e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME){var r=this.manifest.mediaGroups[e.attributes.TYPE];r[e.attributes["GROUP-ID"]]=r[e.attributes["GROUP-ID"]]||{},t=r[e.attributes["GROUP-ID"]],(s={default:/yes/i.test(e.attributes.DEFAULT)}).default?s.autoselect=!0:s.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(s.language=e.attributes.LANGUAGE),e.attributes.URI&&(s.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(s.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(s.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(s.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=s}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){h+=1,u.discontinuity=!0,this.manifest.discontinuityStarts.push(o.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),u.dateTimeString=e.dateTimeString,u.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,L.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(){u.cueOut=e.data},"cue-out-cont":function(){u.cueOutCont=e.data},"cue-in":function(){u.cueIn=e.data},skip:function(){this.manifest.skip=j(e.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",e.attributes,["SKIPPED-SEGMENTS"])},part:function(){var t=this;l=!0;var r=this.manifest.segments.length,n=j(e.attributes);u.parts=u.parts||[],u.parts.push(n),n.byterange&&(n.byterange.hasOwnProperty("offset")||(n.byterange.offset=d),d=n.byterange.offset+n.byterange.length);var i=u.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+i+" for segment #"+r,e.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((function(e,r){e.hasOwnProperty("lastPart")||t.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+r+" lacks required attribute(s): LAST-PART"})}))},"server-control":function(){var t=this.manifest.serverControl=j(e.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),L.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,r=j(e.attributes),n=r.type&&"PART"===r.type;u.preloadHints=u.preloadHints||[],u.preloadHints.push(r),r.byterange&&(r.byterange.hasOwnProperty("offset")||(r.byterange.offset=n?d:0,n&&(d=r.byterange.offset+r.byterange.length)));var i=u.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+i+" for segment #"+t,e.attributes,["TYPE","URI"]),r.type)for(var o=0;o<u.preloadHints.length-1;o++){var a=u.preloadHints[o];a.type&&a.type===r.type&&this.trigger("warn",{message:"#EXT-X-PRELOAD-HINT #"+i+" for segment #"+t+" has the same TYPE "+r.type+" as preload hint #"+o})}},"rendition-report":function(){var t=j(e.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);var r=this.manifest.renditionReports.length-1,n=["LAST-MSN","URI"];l&&n.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+r,e.attributes,n)},"part-inf":function(){this.manifest.partInf=j(e.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",e.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),L.call(this,this.manifest)}}[e.tagType]||c).call(i)},uri:function(){u.uri=e.uri,o.push(u),this.manifest.targetDuration&&!("duration"in u)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),u.duration=this.manifest.targetDuration),n&&(u.key=n),u.timeline=h,r&&(u.map=r),d=0,u={}},comment:function(){},custom:function(){e.segment?(u.custom=u.custom||{},u.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(i)})),t}l(t,e);var r=t.prototype;return r.warnOnMissingAttributes_=function(e,t,r){var n=[];r.forEach((function(e){t.hasOwnProperty(e)||n.push(e)})),n.length&&this.trigger("warn",{message:e+" lacks required attribute(s): "+n.join(", ")})},r.push=function(e){this.lineStream.push(e)},r.end=function(){this.lineStream.push("\n"),this.trigger("end")},r.addParser=function(e){this.parseStream.addParser(e)},r.addTagMapper=function(e){this.parseStream.addTagMapper(e)},t}(T),A={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^/},R=["video","audio","text"],D=["Video","Audio","Text"],M=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,r){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(r).toString(16)).slice(-2)})):e},N=function(e){void 0===e&&(e="");var t=e.split(","),r=[];return t.forEach((function(e){var t;e=e.trim(),R.forEach((function(n){var i=A[n].exec(e.toLowerCase());if(i&&!(i.length<=1)){t=n;var o=e.substring(0,i[1].length),a=e.replace(o,"");r.push({type:o,details:a,mediaType:n})}})),t||r.push({type:e,details:"",mediaType:"unknown"})})),r},B=function(e){return void 0===e&&(e=""),A.audio.test(e.trim().toLowerCase())},U=function(e){if(e&&"string"==typeof e){var t,r=e.toLowerCase().split(",").map((function(e){return M(e.trim())})),n="video";1===r.length&&B(r[0])?n="audio":1===r.length&&(void 0===(t=r[0])&&(t=""),A.text.test(t.trim().toLowerCase()))&&(n="application");var i="mp4";return r.every((function(e){return A.mp4.test(e)}))?i="mp4":r.every((function(e){return A.webm.test(e)}))?i="webm":r.every((function(e){return A.ogg.test(e)}))&&(i="ogg"),n+"/"+i+';codecs="'+e+'"'}},F=function(e){return void 0===e&&(e=""),t().MediaSource&&t().MediaSource.isTypeSupported&&t().MediaSource.isTypeSupported(U(e))||!1},V=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every((function(e){e=e.trim();for(var t=0;t<D.length;t++)if(A["muxer"+D[t]].test(e))return!0;return!1}))},H="mp4a.40.2",q=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,z=/^application\/dash\+xml/i,W=function(e){return q.test(e)?"hls":z.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null},G=r(73668),X=function(e){return!!e&&"object"==typeof e},K=function e(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.reduce((function(t,r){return"object"!=typeof r||Object.keys(r).forEach((function(n){Array.isArray(t[n])&&Array.isArray(r[n])?t[n]=t[n].concat(r[n]):X(t[n])&&X(r[n])?t[n]=e(t[n],r[n]):t[n]=r[n]})),t}),{})},Y=function(e){return e.reduce((function(e,t){return e.concat(t)}),[])},Q=function(e){if(!e.length)return[];for(var t=[],r=0;r<e.length;r++)t.push(e[r]);return t},$=function(e){var t=e.baseUrl,r=void 0===t?"":t,n=e.source,i=void 0===n?"":n,o=e.range,a=void 0===o?"":o,s=e.indexRange,u=void 0===s?"":s,l={uri:i,resolvedUri:w(r||"",i)};if(a||u){var c=(a||u).split("-"),f=parseInt(c[0],10),h=parseInt(c[1],10);l.byterange={length:h-f+1,offset:f}}return l},J=function(e){return e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e},Z={static:function(e){var t=e.duration,r=e.timescale,n=void 0===r?1:r,i=e.sourceDuration,o=J(e.endNumber);return{start:0,end:"number"==typeof o?o:Math.ceil(i/(t/n))}},dynamic:function(e){var t=e.NOW,r=e.clientOffset,n=e.availabilityStartTime,i=e.timescale,o=void 0===i?1:i,a=e.duration,s=e.start,u=void 0===s?0:s,l=e.minimumUpdatePeriod,c=void 0===l?0:l,f=e.timeShiftBufferDepth,h=void 0===f?1/0:f,p=J(e.endNumber),d=(t+r)/1e3,y=n+u,m=d+c-y,v=Math.ceil(m*o/a),g=Math.floor((d-y-h)*o/a),b=Math.floor((d-y)*o/a);return{start:Math.max(0,g),end:"number"==typeof p?p:Math.min(v,b)}}},ee=function(e){var t=e.type,r=void 0===t?"static":t,n=e.duration,i=e.timescale,o=void 0===i?1:i,a=e.sourceDuration,s=Z[r](e),u=function(e,t){for(var r=[],n=e;n<t;n++)r.push(n);return r}(s.start,s.end).map(function(e){return function(t,r){var n=e.duration,i=e.timescale,o=void 0===i?1:i,a=e.periodIndex,s=e.startNumber;return{number:(void 0===s?1:s)+t,duration:n/o,timeline:a,time:r*n}}}(e));if("static"===r){var l=u.length-1;u[l].duration=a-n/o*l}return u},te=function(e){var t=e.baseUrl,r=e.initialization,n=void 0===r?{}:r,i=e.sourceDuration,o=e.indexRange,a=void 0===o?"":o,s=e.duration;if(!t)throw new Error("NO_BASE_URL");var u=$({baseUrl:t,source:n.sourceURL,range:n.range}),l=$({baseUrl:t,source:t,indexRange:a});if(l.map=u,s){var c=ee(e);c.length&&(l.duration=c[0].duration,l.timeline=c[0].timeline)}else i&&(l.duration=i,l.timeline=0);return l.number=0,[l]},re=function(e,t,r){for(var n=e.sidx.map?e.sidx.map:null,i=e.sidx.duration,o=e.timeline||0,a=e.sidx.byterange,s=a.offset+a.length,u=t.timescale,l=t.references.filter((function(e){return 1!==e.referenceType})),c=[],f=s+t.firstOffset,h=0;h<l.length;h++){var p=t.references[h],d=p.referencedSize,y=p.subsegmentDuration,m=te({baseUrl:r,timescale:u,timeline:o,periodIndex:o,duration:y,sourceDuration:i,indexRange:f+"-"+(f+d-1)})[0];n&&(m.map=n),c.push(m),f+=d}return e.segments=c,e},ne=function(e){return e&&e.uri+"-"+(r=(t=e.byterange).offset+t.length-1,t.offset+"-"+r);var t,r},ie=function(e){var t=function(e){return Object.keys(e).map((function(t){return e[t]}))}(e.reduce((function(e,t){var r,n=t.attributes.id+(t.attributes.lang||"");return e[n]?(t.segments[0]&&(t.segments[0].discontinuity=!0),(r=e[n].segments).push.apply(r,t.segments),t.attributes.contentProtection&&(e[n].attributes.contentProtection=t.attributes.contentProtection)):e[n]=t,e}),{}));return t.map((function(e){var t;return e.discontinuityStarts=(t=e.segments,"discontinuity",t.reduce((function(e,t,r){return t.discontinuity&&e.push(r),e}),[])),e}))},oe=function(e,t){var r=ne(e.sidx),n=r&&t[r]&&t[r].sidx;return n&&re(e,n,e.sidx.resolvedUri),e},ae=function(e,t){if(void 0===t&&(t={}),!Object.keys(t).length)return e;for(var r in e)e[r]=oe(e[r],t);return e},se=function(e){var t,r=e.attributes,n=e.segments,i=e.sidx,o={attributes:(t={NAME:r.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:r.width,height:r.height},CODECS:r.codecs,BANDWIDTH:r.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===(r.type||"static"),timeline:r.periodIndex,resolvedUri:"",targetDuration:r.duration,segments:n,mediaSequence:n.length?n[0].number:1};return r.contentProtection&&(o.contentProtection=r.contentProtection),i&&(o.sidx=i),o},ue=function(e){var t=e.attributes;return"video/mp4"===t.mimeType||"video/webm"===t.mimeType||"video"===t.contentType},le=function(e){var t=e.attributes;return"audio/mp4"===t.mimeType||"audio/webm"===t.mimeType||"audio"===t.contentType},ce=function(e){var t=e.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType},fe=function(e,t,r){var n=e.NOW,i=e.clientOffset,o=e.availabilityStartTime,a=e.timescale,s=void 0===a?1:a,u=e.start,l=void 0===u?0:u,c=e.minimumUpdatePeriod,f=(n+i)/1e3+(void 0===c?0:c)-(o+l);return Math.ceil((f*s-t)/r)},he=function(e,t){for(var r=e.type,n=void 0===r?"static":r,i=e.minimumUpdatePeriod,o=void 0===i?0:i,a=e.media,s=void 0===a?"":a,u=e.sourceDuration,l=e.timescale,c=void 0===l?1:l,f=e.startNumber,h=void 0===f?1:f,p=e.periodIndex,d=[],y=-1,m=0;m<t.length;m++){var v=t[m],g=v.d,b=v.r||0,_=v.t||0;y<0&&(y=_),_&&_>y&&(y=_);var w=void 0;if(b<0){var T=m+1;w=T===t.length?"dynamic"===n&&o>0&&s.indexOf("$Number$")>0?fe(e,y,g):(u*c-y)/g:(t[T].t-y)/g}else w=b+1;for(var S=h+d.length+w,E=h+d.length;E<S;)d.push({number:E,duration:g/c,time:y,timeline:p}),y+=g,E++}return d},pe=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,de=function(e,t){return e.replace(pe,function(e){return function(t,r,n,i){if("$$"===t)return"$";if(void 0===e[r])return t;var o=""+e[r];return"RepresentationID"===r?o:(i=n?parseInt(i,10):1,o.length>=i?o:""+new Array(i-o.length+1).join("0")+o)}}(t))},ye=function(e,t){var r={RepresentationID:e.id,Bandwidth:e.bandwidth||0},n=e.initialization,i=void 0===n?{sourceURL:"",range:""}:n,o=$({baseUrl:e.baseUrl,source:de(i.sourceURL,r),range:i.range}),a=function(e,t){return e.duration||t?e.duration?ee(e):he(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodIndex}]}(e,t);return a.map((function(t){r.Number=t.number,r.Time=t.time;var n=de(e.media||"",r),i={uri:n,timeline:t.timeline,duration:t.duration,resolvedUri:w(e.baseUrl||"",n),map:o,number:t.number};return e.presentationTimeOffset&&(i.presentationTimeOffset=e.presentationTimeOffset),i}))},me=function(e,t){var r=e.duration,n=e.segmentUrls,i=void 0===n?[]:n;if(!r&&!t||r&&t)throw new Error("SEGMENT_TIME_UNSPECIFIED");var o,a=i.map((function(t){return function(e,t){var r=e.baseUrl,n=e.initialization,i=void 0===n?{}:n,o=$({baseUrl:r,source:i.sourceURL,range:i.range}),a=$({baseUrl:r,source:t.media,range:t.mediaRange});return a.map=o,a}(e,t)}));return r&&(o=ee(e)),t&&(o=he(e,t)),o.map((function(e,t){if(a[t]){var r=a[t];return r.timeline=e.timeline,r.duration=e.duration,r.number=e.number,r}})).filter((function(e){return e}))},ve=function(e){var t,r,n=e.attributes,i=e.segmentInfo;i.template?(r=ye,t=K(n,i.template),i.template.presentationTimeOffset&&(t.presentationTimeOffset=i.template.presentationTimeOffset/i.template.timescale)):i.base?(r=te,t=K(n,i.base)):i.list&&(r=me,t=K(n,i.list));var o={attributes:n};if(!r)return o;var a=r(t,i.timeline);if(t.duration){var s=t,u=s.duration,l=s.timescale,c=void 0===l?1:l;t.duration=u/c}else a.length?t.duration=a.reduce((function(e,t){return Math.max(e,Math.ceil(t.duration))}),0):t.duration=0;return o.attributes=t,o.segments=a,i.base&&t.indexRange&&(o.sidx=a[0],o.segments=[]),o},ge=function(e,t){return Q(e.childNodes).filter((function(e){return e.tagName===t}))},be=function(e){return e.textContent.trim()},_e=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 r=t.slice(1),n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],u=r[5];return 31536e3*parseFloat(n||0)+2592e3*parseFloat(i||0)+86400*parseFloat(o||0)+3600*parseFloat(a||0)+60*parseFloat(s||0)+parseFloat(u||0)},we={mediaPresentationDuration:function(e){return _e(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 _e(e)},suggestedPresentationDelay:function(e){return _e(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return _e(e)},start:function(e){return _e(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)?_e(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}},Te=function(e){return e&&e.attributes?Q(e.attributes).reduce((function(e,t){var r=we[t.name]||we.DEFAULT;return e[t.name]=r(t.value),e}),{}):{}},Se={"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"},Ee=function(e,t){return t.length?Y(e.map((function(e){return t.map((function(t){return w(e,be(t))}))}))):e},Oe=function(e){var t=ge(e,"SegmentTemplate")[0],r=ge(e,"SegmentList")[0],n=r&&ge(r,"SegmentURL").map((function(e){return K({tag:"SegmentURL"},Te(e))})),i=ge(e,"SegmentBase")[0],o=r||t,a=o&&ge(o,"SegmentTimeline")[0],s=r||i||t,u=s&&ge(s,"Initialization")[0],l=t&&Te(t);l&&u?l.initialization=u&&Te(u):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});var c={template:l,timeline:a&&ge(a,"S").map((function(e){return Te(e)})),list:r&&K(Te(r),{segmentUrls:n,initialization:Te(u)}),base:i&&K(Te(i),{initialization:Te(u)})};return Object.keys(c).forEach((function(e){c[e]||delete c[e]})),c},ke=function(e,r){return function(n,i){var o=Ee(r,ge(n,"BaseURL")),a=Te(n),s=parseInt(a.id,10),u=t().isNaN(s)?i:s,l=K(e,{periodIndex:u}),c=ge(n,"AdaptationSet"),f=Oe(n);return Y(c.map(function(e,t,r){return function(n){var i=Te(n),o=Ee(t,ge(n,"BaseURL")),a=ge(n,"Role")[0],s={role:Te(a)},u=K(e,i,s),l=ge(n,"Label")[0];if(l&&l.childNodes.length){var c=l.childNodes[0].nodeValue.trim();u=K(u,{label:c})}var f=ge(n,"ContentProtection").reduce((function(e,t){var r=Te(t),n=Se[r.schemeIdUri];if(n){e[n]={attributes:r};var i=ge(t,"cenc:pssh")[0];if(i){var o=be(i),a=o&&S(o);e[n].pssh=a}}return e}),{});Object.keys(f).length&&(u=K(u,{contentProtection:f}));var h=Oe(n),p=ge(n,"Representation"),d=K(r,h);return Y(p.map(function(e,t,r){return function(n){var i=ge(n,"BaseURL"),o=Ee(t,i),a=K(e,Te(n)),s=Oe(n);return o.map((function(e){return{segmentInfo:K(r,s),attributes:K(a,{baseUrl:e})}}))}}(u,o,d)))}}(l,o,f)))}},Ce=function(e){if(""===e)throw new Error("DASH_EMPTY_MANIFEST");var t,r,n=new G.a;try{r=(t=n.parseFromString(e,"application/xml"))&&"MPD"===t.documentElement.tagName?t.documentElement:null}catch(e){}if(!r||r&&r.getElementsByTagName("parsererror").length>0)throw new Error("DASH_INVALID_XML");return r},Pe=function(e,t){void 0===t&&(t={});var r=function(e,t){void 0===t&&(t={});var r=t,n=r.manifestUri,i=void 0===n?"":n,o=r.NOW,a=void 0===o?Date.now():o,s=r.clientOffset,u=void 0===s?0:s,l=ge(e,"Period");if(!l.length)throw new Error("INVALID_NUMBER_OF_PERIOD");var c=ge(e,"Location"),f=Te(e),h=Ee([i],ge(e,"BaseURL"));return f.sourceDuration=f.mediaPresentationDuration||0,f.NOW=a,f.clientOffset=u,c.length&&(f.locations=c.map(be)),{locations:f.locations,representationInfo:Y(l.map(ke(f,h)))}}(Ce(e),t);return function(e,t,r){var n;if(void 0===r&&(r={}),!e.length)return{};var i=e[0].attributes,o=i.sourceDuration,a=i.type,s=void 0===a?"static":a,u=i.suggestedPresentationDelay,l=i.minimumUpdatePeriod,c=ie(e.filter(ue)).map(se),f=ie(e.filter(le)),h=e.filter(ce),p={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(n={AUDIO:{},VIDEO:{}},n["CLOSED-CAPTIONS"]={},n.SUBTITLES={},n),uri:"",duration:o,playlists:ae(c,r)};l>=0&&(p.minimumUpdatePeriod=1e3*l),t&&(p.locations=t),"dynamic"===s&&(p.suggestedPresentationDelay=u);var d=0===p.playlists.length;return f.length&&(p.mediaGroups.AUDIO.audio=function(e,t,r){var n;void 0===t&&(t={}),void 0===r&&(r=!1);var i=e.reduce((function(e,i){var o=i.attributes.role&&i.attributes.role.value||"",a=i.attributes.lang||"",s=i.attributes.label||"main";if(a&&!i.attributes.label){var u=o?" ("+o+")":"";s=""+i.attributes.lang+u}e[s]||(e[s]={language:a,autoselect:!0,default:"main"===o,playlists:[],uri:""});var l=oe(function(e,t){var r,n=e.attributes,i=e.segments,o=e.sidx,a={attributes:(r={NAME:n.id,BANDWIDTH:n.bandwidth,CODECS:n.codecs},r["PROGRAM-ID"]=1,r),uri:"",endList:"static"===(n.type||"static"),timeline:n.periodIndex,resolvedUri:"",targetDuration:n.duration,segments:i,mediaSequence:i.length?i[0].number:1};return n.contentProtection&&(a.contentProtection=n.contentProtection),o&&(a.sidx=o),t&&(a.attributes.AUDIO="audio",a.attributes.SUBTITLES="subs"),a}(i,r),t);return e[s].playlists.push(l),void 0===n&&"main"===o&&((n=i).default=!0),e}),{});return n||(i[Object.keys(i)[0]].default=!0),i}(f,r,d)),h.length&&(p.mediaGroups.SUBTITLES.subs=function(e,t){return void 0===t&&(t={}),e.reduce((function(e,r){var n=r.attributes.lang||"text";return e[n]||(e[n]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),e[n].playlists.push(oe(function(e){var t,r=e.attributes,n=e.segments;void 0===n&&(n=[{uri:r.baseUrl,timeline:r.periodIndex,resolvedUri:r.baseUrl||"",duration:r.sourceDuration,number:0}],r.duration=r.sourceDuration);var i=((t={NAME:r.id,BANDWIDTH:r.bandwidth})["PROGRAM-ID"]=1,t);return r.codecs&&(i.CODECS=r.codecs),{attributes:i,uri:"",endList:"static"===(r.type||"static"),timeline:r.periodIndex,resolvedUri:r.baseUrl||"",targetDuration:r.duration,segments:n,mediaSequence:n.length?n[0].number:1}}(r),t)),e}),{})}(h,r)),p}(r.representationInfo.map(ve),r.locations,t.sidxMapping)},xe=r(57258),je=r.n(xe),Le=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer}(e)||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))},Ie=t().BigInt||Number,Ae=[Ie("0x1"),Ie("0x100"),Ie("0x10000"),Ie("0x1000000"),Ie("0x100000000"),Ie("0x10000000000"),Ie("0x1000000000000"),Ie("0x100000000000000"),Ie("0x10000000000000000")],Re=(function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}(),function(e,t){var r=void 0===t?{}:t,n=r.signed,i=void 0!==n&&n,o=r.le,a=void 0!==o&&o;e=Le(e);var s=a?"reduce":"reduceRight",u=(e[s]?e[s]:Array.prototype[s]).call(e,(function(t,r,n){var i=a?n:Math.abs(n+1-e.length);return t+Ie(r)*Ae[i]}),Ie(0));if(i){var l=Ae[e.length]/Ie(2)-Ie(1);(u=Ie(u))>l&&(u-=l,u-=l,u-=Ie(2))}return Number(u)}),De=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 r=new Uint8Array(e.length),n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r},Me=function(e,t,r){var n=void 0===r?{}:r,i=n.offset,o=void 0===i?0:i,a=n.mask,s=void 0===a?[]:a;e=Le(e);var u=(t=Le(t)).every?t.every:Array.prototype.every;return t.length&&e.length-o>=t.length&&u.call(t,(function(t,r){return t===(s[r]?s[r]&e[o+r]:e[o+r])}))},Ne=Le([73,68,51]),Be=function e(t,r){return void 0===r&&(r=0),(t=Le(t)).length-r<10||!Me(t,Ne,{offset:r})?r:(r+=function(e,t){void 0===t&&(t=0);var r=(e=Le(e))[t+5],n=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&r)>>4?n+20:n+10}(t,r),e(t,r))},Ue=(new Uint8Array([79,112,117,115,72,101,97,100]),function(e){return"string"==typeof e?De(e):e}),Fe=function(e){e=Le(e);for(var t=[],r=0;e.length>r;){var n=e[r],i=0,o=0,a=e[++o];for(o++;128&a;)i=(127&a)<<7,a=e[o],o++;i+=127&a;for(var s=0;s<E.length;s++){var u=E[s],l=u.id,c=u.parser;if(n===l){t.push(c(e.subarray(o,o+i)));break}}r+=i+o}return t};E=[{id:3,parser:function(e){var t={tag:3,id:e[0]<<8|e[1],flags:e[2],size:3,dependsOnEsId:0,ocrEsId:0,descriptors:[],url:""};if(128&t.flags&&(t.dependsOnEsId=e[t.size]<<8|e[t.size+1],t.size+=2),64&t.flags){var r=e[t.size];t.url=function(e){if(!e)return"";e=Array.prototype.slice.call(e);var t=String.fromCharCode.apply(null,Le(e));try{return decodeURIComponent(escape(t))}catch(e){}return t}(e.subarray(t.size+1,t.size+1+r)),t.size+=r}return 32&t.flags&&(t.ocrEsId=e[t.size]<<8|e[t.size+1],t.size+=2),t.descriptors=Fe(e.subarray(t.size))||[],t}},{id:4,parser:function(e){return{tag:4,oti:e[0],streamType:e[1],bufferSize:e[2]<<16|e[3]<<8|e[4],maxBitrate:e[5]<<24|e[6]<<16|e[7]<<8|e[8],avgBitrate:e[9]<<24|e[10]<<16|e[11]<<8|e[12],descriptors:Fe(e.subarray(13))}}},{id:5,parser:function(e){return{tag:5,bytes:e}}},{id:6,parser:function(e){return{tag:6,bytes:e}}}];var Ve=function e(t,r,n){void 0===n&&(n=!1),r=function(e){return Array.isArray(e)?e.map((function(e){return Ue(e)})):[Ue(e)]}(r),t=Le(t);var i=[];if(!r.length)return i;for(var o=0;o<t.length;){var a=(t[o]<<24|t[o+1]<<16|t[o+2]<<8|t[o+3])>>>0,s=t.subarray(o+4,o+8);if(0===a)break;var u=o+a;if(u>t.length){if(n)break;u=t.length}var l=t.subarray(o+8,u);Me(s,r[0])&&(1===r.length?i.push(l):i.push.apply(i,e(l,r.slice(1),n))),o=u}return i},He={EBML:Le([26,69,223,163]),DocType:Le([66,130]),Segment:Le([24,83,128,103]),SegmentInfo:Le([21,73,169,102]),Tracks:Le([22,84,174,107]),Track:Le([174]),TrackNumber:Le([215]),DefaultDuration:Le([35,227,131]),TrackEntry:Le([174]),TrackType:Le([131]),FlagDefault:Le([136]),CodecID:Le([134]),CodecPrivate:Le([99,162]),VideoTrack:Le([224]),AudioTrack:Le([225]),Cluster:Le([31,67,182,117]),Timestamp:Le([231]),TimestampScale:Le([42,215,177]),BlockGroup:Le([160]),BlockDuration:Le([155]),Block:Le([161]),SimpleBlock:Le([163])},qe=[128,64,32,16,8,4,2,1],ze=function(e,t,r,n){void 0===r&&(r=!0),void 0===n&&(n=!1);var i=function(e){for(var t=1,r=0;r<qe.length&&!(e&qe[r]);r++)t++;return t}(e[t]),o=e.subarray(t,t+i);return r&&((o=Array.prototype.slice.call(e,t,t+i))[0]^=qe[i-1]),{length:i,value:Re(o,{signed:n}),bytes:o}},We=function e(t){return"string"==typeof t?t.match(/.{1,2}/g).map((function(t){return e(t)})):"number"==typeof t?function(e,t){var r=(void 0===t?{}:t).le,n=void 0!==r&&r;("bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!=e)&&(e=0);for(var i,o=(i=e=Ie(e),Math.ceil(function(e){return e.toString(2).length}(i)/8)),a=new Uint8Array(new ArrayBuffer(o)),s=0;s<o;s++){var u=n?s:Math.abs(s+1-a.length);a[u]=Number(e/Ae[s]&Ie(255)),e<0&&(a[u]=Math.abs(~a[u]),a[u]-=0===s?1:2)}return a}(t):t},Ge=function e(t,r,n){if(n>=r.length)return r.length;var i=ze(r,n,!1);if(Me(t.bytes,i.bytes))return n;var o=ze(r,n+i.length);return e(t,r,n+o.length+o.value+i.length)},Xe=function e(t,r){r=function(e){return Array.isArray(e)?e.map((function(e){return We(e)})):[We(e)]}(r),t=Le(t);var n=[];if(!r.length)return n;for(var i=0;i<t.length;){var o=ze(t,i,!1),a=ze(t,i+o.length),s=i+o.length+a.length;127===a.value&&(a.value=Ge(o,t,s),a.value!==t.length&&(a.value-=s));var u=s+a.value>t.length?t.length:s+a.value,l=t.subarray(s,u);Me(r[0],o.bytes)&&(1===r.length?n.push(l):n=n.concat(e(l,r.slice(1)))),i+=o.length+a.length+l.length}return n},Ke=Le([0,0,0,1]),Ye=Le([0,0,1]),Qe=Le([0,0,3]),$e=function(e){for(var t=[],r=1;r<e.length-2;)Me(e.subarray(r,r+3),Qe)&&(t.push(r+2),r++),r++;if(0===t.length)return e;var n=e.length-t.length,i=new Uint8Array(n),o=0;for(r=0;r<n;o++,r++)o===t[0]&&(o++,t.shift()),i[r]=e[o];return i},Je=function(e,t,r,n){void 0===n&&(n=1/0),e=Le(e),r=[].concat(r);for(var i,o=0,a=0;o<e.length&&(a<n||i);){var s=void 0;if(Me(e.subarray(o),Ke)?s=4:Me(e.subarray(o),Ye)&&(s=3),s){if(a++,i)return $e(e.subarray(i,o));var u=void 0;"h264"===t?u=31&e[o+s]:"h265"===t&&(u=e[o+s]>>1&63),-1!==r.indexOf(u)&&(i=o+s),o+=s+("h264"===t?1:2)}else o++}return e.subarray(0,0)},Ze={webm:Le([119,101,98,109]),matroska:Le([109,97,116,114,111,115,107,97]),flac:Le([102,76,97,67]),ogg:Le([79,103,103,83]),ac3:Le([11,119]),riff:Le([82,73,70,70]),avi:Le([65,86,73]),wav:Le([87,65,86,69]),"3gp":Le([102,116,121,112,51,103]),mp4:Le([102,116,121,112]),fmp4:Le([115,116,121,112]),mov:Le([102,116,121,112,113,116]),moov:Le([109,111,111,118]),moof:Le([109,111,111,102])},et={aac:function(e){var t=Be(e);return Me(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Be(e);return Me(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=Xe(e,[He.EBML,He.DocType])[0];return Me(t,Ze.webm)},mkv:function(e){var t=Xe(e,[He.EBML,He.DocType])[0];return Me(t,Ze.matroska)},mp4:function(e){return!et["3gp"](e)&&!et.mov(e)&&(!(!Me(e,Ze.mp4,{offset:4})&&!Me(e,Ze.fmp4,{offset:4}))||!(!Me(e,Ze.moof,{offset:4})&&!Me(e,Ze.moov,{offset:4}))||void 0)},mov:function(e){return Me(e,Ze.mov,{offset:4})},"3gp":function(e){return Me(e,Ze["3gp"],{offset:4})},ac3:function(e){var t=Be(e);return Me(e,Ze.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=Be(e);return Me(e,Ze.flac,{offset:t})},ogg:function(e){return Me(e,Ze.ogg)},avi:function(e){return Me(e,Ze.riff)&&Me(e,Ze.avi,{offset:8})},wav:function(e){return Me(e,Ze.riff)&&Me(e,Ze.wav,{offset:8})},h264:function(e){return function(e,t,r){return Je(e,"h264",7,3)}(e).length},h265:function(e){return function(e,t,r){return Je(e,"h265",[32,33],3)}(e).length}},tt=Object.keys(et).filter((function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e})).concat(["ts","h264","h265"]);tt.forEach((function(e){var t=et[e];et[e]=function(e){return t(Le(e))}}));for(var rt,nt=et,it=function(e){e=Le(e);for(var t=0;t<tt.length;t++){var r=tt[t];if(nt[r](e))return r}return""},ot=r(28195),at="7.12.4",st={prefixed:!0},ut=[["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"]],lt=ut[0],ct=0;ct<ut.length;ct++)if(ut[ct][1]in o()){rt=ut[ct];break}if(rt){for(var ft=0;ft<rt.length;ft++)st[lt[ft]]=rt[ft];st.prefixed=rt[0]!==lt[0]}var ht=[],pt=function e(r){var n,i="info",o=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,r){return function(n,i,o){var a=r.levels[i],s=new RegExp("^("+a+")$");if("log"!==n&&o.unshift(n.toUpperCase()+":"),o.unshift(e+":"),ht){ht.push([].concat(o));var u=ht.length-1e3;ht.splice(0,u>0?u:0)}if(t().console){var l=t().console[n];l||"debug"!==n||(l=t().console.info||t().console.log),l&&a&&s.test(n)&&l[Array.isArray(o)?"apply":"call"](t().console,o)}}}(r,o),o.createLogger=function(t){return e(r+": "+t)},o.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:i},o.level=function(e){if("string"==typeof e){if(!o.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');i=e}return i},(o.history=function(){return ht?[].concat(ht):[]}).filter=function(e){return(ht||[]).filter((function(t){return new RegExp(".*"+e+".*").test(t[0])}))},o.history.clear=function(){ht&&(ht.length=0)},o.history.disable=function(){null!==ht&&(ht.length=0,ht=null)},o.history.enable=function(){null===ht&&(ht=[])},o.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)},o.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)},o.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)},o}("VIDEOJS"),dt=pt.createLogger,yt=Object.prototype.toString,mt=function(e){return bt(e)?Object.keys(e):[]};function vt(e,t){mt(e).forEach((function(r){return t(e[r],r)}))}function gt(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return Object.assign?a.apply(void 0,[e].concat(r)):(r.forEach((function(t){t&&vt(t,(function(t,r){e[r]=t}))})),e)}function bt(e){return!!e&&"object"==typeof e}function _t(e){return bt(e)&&"[object Object]"===yt.call(e)&&e.constructor===Object}function wt(e,r){if(!e||!r)return"";if("function"==typeof t().getComputedStyle){var n;try{n=t().getComputedStyle(e)}catch(e){return""}return n?n.getPropertyValue(r)||n[r]:""}return""}var Tt,St,Et,Ot=t().navigator&&t().navigator.userAgent||"",kt=/AppleWebKit\/([\d.]+)/i.exec(Ot),Ct=kt?parseFloat(kt.pop()):null,Pt=/iPod/i.test(Ot),xt=(Tt=Ot.match(/OS (\d+)_/i))&&Tt[1]?Tt[1]:null,jt=/Android/i.test(Ot),Lt=function(){var e=Ot.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),r=e[2]&&parseFloat(e[2]);return t&&r?parseFloat(e[1]+"."+e[2]):t||null}(),It=jt&&Lt<5&&Ct<537,At=/Firefox/i.test(Ot),Rt=/Edg/i.test(Ot),Dt=!Rt&&(/Chrome/i.test(Ot)||/CriOS/i.test(Ot)),Mt=function(){var e=Ot.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Nt=(St=/MSIE\s(\d+)\.\d/.exec(Ot),!(Et=St&&parseFloat(St[1]))&&/Trident\/7.0/i.test(Ot)&&/rv:11.0/.test(Ot)&&(Et=11),Et),Bt=/Safari/i.test(Ot)&&!Dt&&!jt&&!Rt,Ut=/Windows/i.test(Ot),Ft=Boolean(Kt()&&("ontouchstart"in t()||t().navigator.maxTouchPoints||t().DocumentTouch&&t().document instanceof t().DocumentTouch)),Vt=/iPad/i.test(Ot)||Bt&&Ft&&!/iPhone/i.test(Ot),Ht=/iPhone/i.test(Ot)&&!Vt,qt=Ht||Vt||Pt,zt=(Bt||qt)&&!Dt,Wt=Object.freeze({__proto__:null,IS_IPOD:Pt,IOS_VERSION:xt,IS_ANDROID:jt,ANDROID_VERSION:Lt,IS_NATIVE_ANDROID:It,IS_FIREFOX:At,IS_EDGE:Rt,IS_CHROME:Dt,CHROME_VERSION:Mt,IE_VERSION:Nt,IS_SAFARI:Bt,IS_WINDOWS:Ut,TOUCH_ENABLED:Ft,IS_IPAD:Vt,IS_IPHONE:Ht,IS_IOS:qt,IS_ANY_SAFARI:zt});function Gt(e){return"string"==typeof e&&Boolean(e.trim())}function Xt(e){if(e.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function Kt(){return o()===t().document}function Yt(e){return bt(e)&&1===e.nodeType}function Qt(){try{return t().parent!==t().self}catch(e){return!0}}function $t(e){return function(t,r){if(!Gt(t))return o()[e](null);Gt(r)&&(r=o().querySelector(r));var n=Yt(r)?r:o();return n[e]&&n[e](t)}}function Jt(e,t,r,n){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===r&&(r={});var i=o().createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){var r=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(pt.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 "+r+"."),i.setAttribute(e,r)):"textContent"===e?Zt(i,r):i[e]===r&&"tabIndex"!==e||(i[e]=r)})),Object.getOwnPropertyNames(r).forEach((function(e){i.setAttribute(e,r[e])})),n&&gr(i,n),i}function Zt(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function er(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function tr(e,t){return Xt(t),e.classList?e.classList.contains(t):(r=t,new RegExp("(^|\\s)"+r+"($|\\s)")).test(e.className);var r}function rr(e,t){return e.classList?e.classList.add(t):tr(e,t)||(e.className=(e.className+" "+t).trim()),e}function nr(e,t){return e.classList?e.classList.remove(t):(Xt(t),e.className=e.className.split(/\s+/).filter((function(e){return e!==t})).join(" ")),e}function ir(e,t,r){var n=tr(e,t);if("function"==typeof r&&(r=r(e,t)),"boolean"!=typeof r&&(r=!n),r!==n)return r?rr(e,t):nr(e,t),e}function or(e,t){Object.getOwnPropertyNames(t).forEach((function(r){var n=t[r];null==n||!1===n?e.removeAttribute(r):e.setAttribute(r,!0===n?"":n)}))}function ar(e){var t={};if(e&&e.attributes&&e.attributes.length>0)for(var r=e.attributes,n=r.length-1;n>=0;n--){var i=r[n].name,o=r[n].value;"boolean"!=typeof e[i]&&-1===",autoplay,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+i+",")||(o=null!==o),t[i]=o}return t}function sr(e,t){return e.getAttribute(t)}function ur(e,t,r){e.setAttribute(t,r)}function lr(e,t){e.removeAttribute(t)}function cr(){o().body.focus(),o().onselectstart=function(){return!1}}function fr(){o().onselectstart=function(){return!0}}function hr(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),r={};return["bottom","height","left","right","top","width"].forEach((function(e){void 0!==t[e]&&(r[e]=t[e])})),r.height||(r.height=parseFloat(wt(e,"height"))),r.width||(r.width=parseFloat(wt(e,"width"))),r}}function pr(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};for(var t=e.offsetWidth,r=e.offsetHeight,n=0,i=0;e.offsetParent&&e!==o()[st.fullscreenElement];)n+=e.offsetLeft,i+=e.offsetTop,e=e.offsetParent;return{left:n,top:i,width:t,height:r}}function dr(e,t){var r={x:0,y:0};if(qt)for(var n=e;n&&"html"!==n.nodeName.toLowerCase();){var i=wt(n,"transform");if(/^matrix/.test(i)){var o=i.slice(7,-1).split(/,\s/).map(Number);r.x+=o[4],r.y+=o[5]}else if(/^matrix3d/.test(i)){var a=i.slice(9,-1).split(/,\s/).map(Number);r.x+=a[12],r.y+=a[13]}n=n.parentNode}var s={},u=pr(t.target),l=pr(e),c=l.width,f=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,qt&&(p-=r.x,h-=r.y)),s.y=1-Math.max(0,Math.min(1,h/f)),s.x=Math.max(0,Math.min(1,p/c)),s}function yr(e){return bt(e)&&3===e.nodeType}function mr(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function vr(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((function(e){return"function"==typeof e&&(e=e()),Yt(e)||yr(e)?e:"string"==typeof e&&/\S/.test(e)?o().createTextNode(e):void 0})).filter((function(e){return e}))}function gr(e,t){return vr(t).forEach((function(t){return e.appendChild(t)})),e}function br(e,t){return gr(mr(e),t)}function _r(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 wr,Tr=$t("querySelector"),Sr=$t("querySelectorAll"),Er=Object.freeze({__proto__:null,isReal:Kt,isEl:Yt,isInFrame:Qt,createEl:Jt,textContent:Zt,prependTo:er,hasClass:tr,addClass:rr,removeClass:nr,toggleClass:ir,setAttributes:or,getAttributes:ar,getAttribute:sr,setAttribute:ur,removeAttribute:lr,blockTextSelection:cr,unblockTextSelection:fr,getBoundingClientRect:hr,findPosition:pr,getPointerPosition:dr,isTextNode:yr,emptyEl:mr,normalizeContent:vr,appendContent:gr,insertContent:br,isSingleLeftClick:_r,$:Tr,$$:Sr}),Or=!1,kr=function(){if(!1!==wr.options.autoSetup){var e=Array.prototype.slice.call(o().getElementsByTagName("video")),t=Array.prototype.slice.call(o().getElementsByTagName("audio")),r=Array.prototype.slice.call(o().getElementsByTagName("video-js")),n=e.concat(t,r);if(n&&n.length>0)for(var i=0,a=n.length;i<a;i++){var s=n[i];if(!s||!s.getAttribute){Cr(1);break}void 0===s.player&&null!==s.getAttribute("data-setup")&&wr(s)}else Or||Cr(1)}};function Cr(e,r){Kt()&&(r&&(wr=r),t().setTimeout(kr,e))}function Pr(){Or=!0,t().removeEventListener("load",Pr)}Kt()&&("complete"===o().readyState?Pr():t().addEventListener("load",Pr));var xr,jr=function(e){var t=o().createElement("style");return t.className=e,t},Lr=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t},Ir=3;function Ar(){return Ir++}t().WeakMap||(xr=function(){function e(){this.vdata="vdata"+Math.floor(t().performance&&t().performance.now()||Date.now()),this.data={}}var r=e.prototype;return r.set=function(e,t){var r=e[this.vdata]||Ar();return e[this.vdata]||(e[this.vdata]=r),this.data[r]=t,this},r.get=function(e){var t=e[this.vdata];if(t)return this.data[t];pt("We have no data for this element",e)},r.has=function(e){return e[this.vdata]in this.data},r.delete=function(e){var t=e[this.vdata];t&&(delete this.data[t],delete e[this.vdata])},e}());var Rr,Dr=t().WeakMap?new WeakMap:new xr;function Mr(e,t){if(Dr.has(e)){var r=Dr.get(e);0===r.handlers[t].length&&(delete r.handlers[t],e.removeEventListener?e.removeEventListener(t,r.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,r.dispatcher)),Object.getOwnPropertyNames(r.handlers).length<=0&&(delete r.handlers,delete r.dispatcher,delete r.disabled),0===Object.getOwnPropertyNames(r).length&&Dr.delete(e)}}function Nr(e,t,r,n){r.forEach((function(r){e(t,r,n)}))}function Br(e){if(e.fixed_)return e;function r(){return!0}function n(){return!1}if(!e||!e.isPropagationStopped){var i=e||t().event;for(var a in e={},i)"layerX"!==a&&"layerY"!==a&&"keyLocation"!==a&&"webkitMovementX"!==a&&"webkitMovementY"!==a&&("returnValue"===a&&i.preventDefault||(e[a]=i[a]));if(e.target||(e.target=e.srcElement||o()),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=r},e.isPropagationStopped=n,e.stopImmediatePropagation=function(){i.stopImmediatePropagation&&i.stopImmediatePropagation(),e.isImmediatePropagationStopped=r,e.stopPropagation()},e.isImmediatePropagationStopped=n,null!==e.clientX&&void 0!==e.clientX){var s=o().documentElement,u=o().body;e.pageX=e.clientX+(s&&s.scrollLeft||u&&u.scrollLeft||0)-(s&&s.clientLeft||u&&u.clientLeft||0),e.pageY=e.clientY+(s&&s.scrollTop||u&&u.scrollTop||0)-(s&&s.clientTop||u&&u.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 Ur=function(){if("boolean"!=typeof Rr){Rr=!1;try{var e=Object.defineProperty({},"passive",{get:function(){Rr=!0}});t().addEventListener("test",null,e),t().removeEventListener("test",null,e)}catch(e){}}return Rr},Fr=["touchstart","touchmove"];function Vr(e,t,r){if(Array.isArray(t))return Nr(Vr,e,t,r);Dr.has(e)||Dr.set(e,{});var n=Dr.get(e);if(n.handlers||(n.handlers={}),n.handlers[t]||(n.handlers[t]=[]),r.guid||(r.guid=Ar()),n.handlers[t].push(r),n.dispatcher||(n.disabled=!1,n.dispatcher=function(t,r){if(!n.disabled){t=Br(t);var i=n.handlers[t.type];if(i)for(var o=i.slice(0),a=0,s=o.length;a<s&&!t.isImmediatePropagationStopped();a++)try{o[a].call(e,t,r)}catch(e){pt.error(e)}}}),1===n.handlers[t].length)if(e.addEventListener){var i=!1;Ur()&&Fr.indexOf(t)>-1&&(i={passive:!0}),e.addEventListener(t,n.dispatcher,i)}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher)}function Hr(e,t,r){if(Dr.has(e)){var n=Dr.get(e);if(n.handlers){if(Array.isArray(t))return Nr(Hr,e,t,r);var i=function(e,t){n.handlers[t]=[],Mr(e,t)};if(void 0!==t){var o=n.handlers[t];if(o)if(r){if(r.guid)for(var a=0;a<o.length;a++)o[a].guid===r.guid&&o.splice(a--,1);Mr(e,t)}else i(e,t)}else for(var s in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},s)&&i(e,s)}}}function qr(e,t,r){var n=Dr.has(e)?Dr.get(e):{},i=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=Br(t),n.dispatcher&&n.dispatcher.call(e,t,r),i&&!t.isPropagationStopped()&&!0===t.bubbles)qr.call(null,i,t,r);else if(!i&&!t.defaultPrevented&&t.target&&t.target[t.type]){Dr.has(t.target)||Dr.set(t.target,{});var o=Dr.get(t.target);t.target[t.type]&&(o.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),o.disabled=!1)}return!t.defaultPrevented}function zr(e,t,r){if(Array.isArray(t))return Nr(zr,e,t,r);var n=function n(){Hr(e,t,n),r.apply(this,arguments)};n.guid=r.guid=r.guid||Ar(),Vr(e,t,n)}function Wr(e,t,r){var n=function n(){Hr(e,t,n),r.apply(this,arguments)};n.guid=r.guid=r.guid||Ar(),Vr(e,t,n)}var Gr,Xr=Object.freeze({__proto__:null,fixEvent:Br,on:Vr,off:Hr,trigger:qr,one:zr,any:Wr}),Kr=30,Yr=function(e,t,r){t.guid||(t.guid=Ar());var n=t.bind(e);return n.guid=r?r+"_"+t.guid:t.guid,n},Qr=function(e,r){var n=t().performance.now();return function(){var i=t().performance.now();i-n>=r&&(e.apply(void 0,arguments),n=i)}},$r=function(){};$r.prototype.allowedEvents_={},$r.prototype.on=function(e,t){var r=this.addEventListener;this.addEventListener=function(){},Vr(this,e,t),this.addEventListener=r},$r.prototype.addEventListener=$r.prototype.on,$r.prototype.off=function(e,t){Hr(this,e,t)},$r.prototype.removeEventListener=$r.prototype.off,$r.prototype.one=function(e,t){var r=this.addEventListener;this.addEventListener=function(){},zr(this,e,t),this.addEventListener=r},$r.prototype.any=function(e,t){var r=this.addEventListener;this.addEventListener=function(){},Wr(this,e,t),this.addEventListener=r},$r.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=Br(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),qr(this,e)},$r.prototype.dispatchEvent=$r.prototype.trigger,$r.prototype.queueTrigger=function(e){var r=this;Gr||(Gr=new Map);var n=e.type||e,i=Gr.get(this);i||(i=new Map,Gr.set(this,i));var o=i.get(n);i.delete(n),t().clearTimeout(o);var a=t().setTimeout((function(){0===i.size&&(i=null,Gr.delete(r)),r.trigger(e)}),0);i.set(n,a)};var Jr=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:typeof e},Zr=function(e){return e instanceof $r||!!e.eventBusEl_&&["on","one","off","trigger"].every((function(t){return"function"==typeof e[t]}))},en=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},tn=function(e,t,r){if(!e||!e.nodeName&&!Zr(e))throw new Error("Invalid target for "+Jr(t)+"#"+r+"; must be a DOM node or evented object.")},rn=function(e,t,r){if(!en(e))throw new Error("Invalid event type for "+Jr(t)+"#"+r+"; must be a non-empty string or array.")},nn=function(e,t,r){if("function"!=typeof e)throw new Error("Invalid listener for "+Jr(t)+"#"+r+"; must be a function.")},on=function(e,t,r){var n,i,o,a=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return a?(n=e.eventBusEl_,t.length>=3&&t.shift(),i=t[0],o=t[1]):(n=t[0],i=t[1],o=t[2]),tn(n,e,r),rn(i,e,r),nn(o,e,r),{isTargetingSelf:a,target:n,type:i,listener:o=Yr(e,o)}},an=function(e,t,r,n){tn(e,e,t),e.nodeName?Xr[t](e,r,n):e[t](r,n)},sn={on:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=on(this,r,"on"),o=i.isTargetingSelf,a=i.target,s=i.type,u=i.listener;if(an(a,"on",s,u),!o){var l=function(){return e.off(a,s,u)};l.guid=u.guid;var c=function(){return e.off("dispose",l)};c.guid=u.guid,an(this,"on","dispose",l),an(a,"on","dispose",c)}},one:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=on(this,r,"one"),o=i.isTargetingSelf,a=i.target,s=i.type,u=i.listener;if(o)an(a,"one",s,u);else{var l=function t(){e.off(a,s,t);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];u.apply(null,n)};l.guid=u.guid,an(a,"one",s,l)}},any:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=on(this,r,"any"),o=i.isTargetingSelf,a=i.target,s=i.type,u=i.listener;if(o)an(a,"any",s,u);else{var l=function t(){e.off(a,s,t);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];u.apply(null,n)};l.guid=u.guid,an(a,"any",s,l)}},off:function(e,t,r){if(!e||en(e))Hr(this.eventBusEl_,e,t);else{var n=e,i=t;tn(n,this,"off"),rn(i,this,"off"),nn(r,this,"off"),r=Yr(this,r),this.off("dispose",r),n.nodeName?(Hr(n,i,r),Hr(n,"dispose",r)):Zr(n)&&(n.off(i,r),n.off("dispose",r))}},trigger:function(e,t){tn(this.eventBusEl_,this,"trigger");var r=e&&"string"!=typeof e?e.type:e;if(!en(r)){var n="Invalid event type for "+Jr(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(n);(this.log||pt).error(n)}return qr(this.eventBusEl_,e,t)}};function un(e,r){void 0===r&&(r={});var n=r.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_=Jt("span",{className:"vjs-event-bus"});return gt(e,sn),e.eventedCallbacks&&e.eventedCallbacks.forEach((function(e){e()})),e.on("dispose",(function(){e.off(),t().setTimeout((function(){e.eventBusEl_=null}),0)})),e}var ln={state:{},setState:function(e){var t,r=this;return"function"==typeof e&&(e=e()),vt(e,(function(e,n){r.state[n]!==e&&((t=t||{})[n]={from:r.state[n],to:e}),r.state[n]=e})),t&&Zr(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function cn(e,t){return gt(e,ln),e.state=gt({},e.state,t),"function"==typeof e.handleStateChanged&&Zr(e)&&e.on("statechanged",e.handleStateChanged),e}var fn=function(e){return"string"!=typeof e?e:e.replace(/./,(function(e){return e.toLowerCase()}))},hn=function(e){return"string"!=typeof e?e:e.replace(/./,(function(e){return e.toUpperCase()}))};function pn(){for(var e={},t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.forEach((function(t){t&&vt(t,(function(t,r){_t(t)?(_t(e[r])||(e[r]={}),e[r]=pn(e[r],t)):e[r]=t}))})),e}var dn=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 r in this.map_)e.call(t,this.map_[r],r,this)},e}(),yn=t().Map?t().Map:dn,mn=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 r in this.set_)e.call(t,r,r,this)},e}(),vn=t().Set?t().Set:mn,gn=function(){function e(e,t,r){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=pn({},this.options_),t=this.options_=pn(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){var n=e&&e.id&&e.id()||"no_player";this.id_=n+"_component_"+Ar()}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),!1!==t.evented&&(un(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),cn(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new vn,this.setIntervalIds_=new vn,this.rafIds_=new vn,this.namedRafs_=new yn,this.clearingTimersOnDispose_=!1,!1!==t.initChildren&&this.initChildren(),this.ready(r),!1!==t.reportTouchActivity&&this.enableTouchActivity()}var r=e.prototype;return r.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_),Dr.has(this.el_)&&Dr.delete(this.el_),this.el_=null),this.player_=null}},r.isDisposed=function(){return Boolean(this.isDisposed_)},r.player=function(){return this.player_},r.options=function(e){return e?(this.options_=pn(this.options_,e),this.options_):this.options_},r.el=function(){return this.el_},r.createEl=function(e,t,r){return Jt(e,t,r)},r.localize=function(e,t,r){void 0===r&&(r=e);var n=this.player_.language&&this.player_.language(),i=this.player_.languages&&this.player_.languages(),o=i&&i[n],a=n&&n.split("-")[0],s=i&&i[a],u=r;return o&&o[e]?u=o[e]:s&&s[e]&&(u=s[e]),t&&(u=u.replace(/\{(\d+)\}/g,(function(e,r){var n=t[r-1],i=n;return void 0===n&&(i=e),i}))),u},r.handleLanguagechange=function(){},r.contentEl=function(){return this.contentEl_||this.el_},r.id=function(){return this.id_},r.name=function(){return this.name_},r.children=function(){return this.children_},r.getChildById=function(e){return this.childIndex_[e]},r.getChild=function(e){if(e)return this.childNameIndex_[e]},r.getDescendant=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t=t.reduce((function(e,t){return e.concat(t)}),[]);for(var n=this,i=0;i<t.length;i++)if(!(n=n.getChild(t[i]))||!n.getChild)return;return n},r.addChild=function(t,r,n){var i,o;if(void 0===r&&(r={}),void 0===n&&(n=this.children_.length),"string"==typeof t){o=hn(t);var a=r.componentClass||o;r.name=o;var s=e.getComponent(a);if(!s)throw new Error("Component "+a+" does not exist");if("function"!=typeof s)return null;i=new s(this.player_||this,r)}else i=t;if(i.parentComponent_&&i.parentComponent_.removeChild(i),this.children_.splice(n,0,i),i.parentComponent_=this,"function"==typeof i.id&&(this.childIndex_[i.id()]=i),(o=o||i.name&&hn(i.name()))&&(this.childNameIndex_[o]=i,this.childNameIndex_[fn(o)]=i),"function"==typeof i.el&&i.el()){var u=null;this.children_[n+1]&&(this.children_[n+1].el_?u=this.children_[n+1].el_:Yt(this.children_[n+1])&&(u=this.children_[n+1])),this.contentEl().insertBefore(i.el(),u)}return i},r.removeChild=function(e){if("string"==typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,r=this.children_.length-1;r>=0;r--)if(this.children_[r]===e){t=!0,this.children_.splice(r,1);break}if(t){e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[hn(e.name())]=null,this.childNameIndex_[fn(e.name())]=null;var n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},r.initChildren=function(){var t=this,r=this.options_.children;if(r){var n,i=this.options_,o=e.getComponent("Tech");(n=Array.isArray(r)?r:Object.keys(r)).concat(Object.keys(this.options_).filter((function(e){return!n.some((function(t){return"string"==typeof t?e===t:e===t.name}))}))).map((function(e){var n,i;return"string"==typeof e?i=r[n=e]||t.options_[n]||{}:(n=e.name,i=e),{name:n,opts:i}})).filter((function(t){var r=e.getComponent(t.opts.componentClass||hn(t.name));return r&&!o.isTech(r)})).forEach((function(e){var r=e.name,n=e.opts;if(void 0!==i[r]&&(n=i[r]),!1!==n){!0===n&&(n={}),n.playerOptions=t.options_.playerOptions;var o=t.addChild(r,n);o&&(t[r]=o)}}))}},r.buildCSSClass=function(){return""},r.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))},r.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)},r.$=function(e,t){return Tr(e,t||this.contentEl())},r.$$=function(e,t){return Sr(e,t||this.contentEl())},r.hasClass=function(e){return tr(this.el_,e)},r.addClass=function(e){rr(this.el_,e)},r.removeClass=function(e){nr(this.el_,e)},r.toggleClass=function(e,t){ir(this.el_,e,t)},r.show=function(){this.removeClass("vjs-hidden")},r.hide=function(){this.addClass("vjs-hidden")},r.lockShowing=function(){this.addClass("vjs-lock-showing")},r.unlockShowing=function(){this.removeClass("vjs-lock-showing")},r.getAttribute=function(e){return sr(this.el_,e)},r.setAttribute=function(e,t){ur(this.el_,e,t)},r.removeAttribute=function(e){lr(this.el_,e)},r.width=function(e,t){return this.dimension("width",e,t)},r.height=function(e,t){return this.dimension("height",e,t)},r.dimensions=function(e,t){this.width(e,!0),this.height(t)},r.dimension=function(e,t,r){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(r||this.trigger("componentresize"));if(!this.el_)return 0;var n=this.el_.style[e],i=n.indexOf("px");return-1!==i?parseInt(n.slice(0,i),10):parseInt(this.el_["offset"+hn(e)],10)},r.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=wt(this.el_,e),0===(t=parseFloat(t))||isNaN(t)){var r="offset"+hn(e);t=this.el_[r]}return t},r.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},r.currentWidth=function(){return this.currentDimension("width")},r.currentHeight=function(){return this.currentDimension("height")},r.focus=function(){this.el_.focus()},r.blur=function(){this.el_.blur()},r.handleKeyDown=function(e){this.player_&&(e.stopPropagation(),this.player_.handleKeyDown(e))},r.handleKeyPress=function(e){this.handleKeyDown(e)},r.emitTapEvents=function(){var e,r=0,n=null;this.on("touchstart",(function(i){1===i.touches.length&&(n={pageX:i.touches[0].pageX,pageY:i.touches[0].pageY},r=t().performance.now(),e=!0)})),this.on("touchmove",(function(t){if(t.touches.length>1)e=!1;else if(n){var r=t.touches[0].pageX-n.pageX,i=t.touches[0].pageY-n.pageY;Math.sqrt(r*r+i*i)>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&&t().performance.now()-r<200&&(i.preventDefault(),this.trigger("tap"))}))},r.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,t=Yr(this.player(),this.player().reportUserActivity);this.on("touchstart",(function(){t(),this.clearInterval(e),e=this.setInterval(t,250)}));var r=function(r){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",r),this.on("touchcancel",r)}},r.setTimeout=function(e,r){var n,i=this;return e=Yr(this,e),this.clearTimersOnDispose_(),n=t().setTimeout((function(){i.setTimeoutIds_.has(n)&&i.setTimeoutIds_.delete(n),e()}),r),this.setTimeoutIds_.add(n),n},r.clearTimeout=function(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),t().clearTimeout(e)),e},r.setInterval=function(e,r){e=Yr(this,e),this.clearTimersOnDispose_();var n=t().setInterval(e,r);return this.setIntervalIds_.add(n),n},r.clearInterval=function(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),t().clearInterval(e)),e},r.requestAnimationFrame=function(e){var r,n=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),e=Yr(this,e),r=t().requestAnimationFrame((function(){n.rafIds_.has(r)&&n.rafIds_.delete(r),e()})),this.rafIds_.add(r),r):this.setTimeout(e,1e3/60)},r.requestNamedAnimationFrame=function(e,t){var r=this;if(!this.namedRafs_.has(e)){this.clearTimersOnDispose_(),t=Yr(this,t);var n=this.requestAnimationFrame((function(){t(),r.namedRafs_.has(e)&&r.namedRafs_.delete(e)}));return this.namedRafs_.set(e,n),e}},r.cancelNamedAnimationFrame=function(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))},r.cancelAnimationFrame=function(e){return this.supportsRaf_?(this.rafIds_.has(e)&&(this.rafIds_.delete(e),t().cancelAnimationFrame(e)),e):this.clearTimeout(e)},r.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 r=t[0],n=t[1];e[r].forEach((function(t,r){return e[n](r)}))})),e.clearingTimersOnDispose_=!1})))},e.registerComponent=function(t,r){if("string"!=typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var n=e.getComponent("Tech"),i=n&&n.isTech(r),o=e===r||e.prototype.isPrototypeOf(r.prototype);if(i||!o)throw new Error('Illegal component, "'+t+'"; '+(i?"techs must be registered using Tech.registerTech()":"must be a Component subclass")+".");t=hn(t),e.components_||(e.components_={});var a=e.getComponent("Player");if("Player"===t&&a&&a.players){var s=a.players,u=Object.keys(s);if(s&&u.length>0&&u.map((function(e){return s[e]})).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=r,e.components_[fn(t)]=r,r},e.getComponent=function(t){if(t&&e.components_)return e.components_[t]},e}();function bn(e,t,r,n){return function(e,t,r){if("number"!=typeof t||t<0||t>r)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+r+").")}(e,n,r.length-1),r[n][t]}function _n(e){return void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:bn.bind(null,"start",0,e),end:bn.bind(null,"end",1,e)}}function wn(e,t){return Array.isArray(e)?_n(e):void 0===e||void 0===t?_n():_n([[e,t]])}function Tn(e,t){var r,n,i=0;if(!t)return 0;e&&e.length||(e=wn(0,0));for(var o=0;o<e.length;o++)r=e.start(o),(n=e.end(o))>t&&(n=t),i+=n-r;return i/t}function Sn(e){if(e instanceof Sn)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:bt(e)&&("number"==typeof e.code&&(this.code=e.code),gt(this,e)),this.message||(this.message=Sn.defaultMessages[this.code]||"")}gn.prototype.supportsRaf_="function"==typeof t().requestAnimationFrame&&"function"==typeof t().cancelAnimationFrame,gn.registerComponent("Component",gn),Sn.prototype.code=0,Sn.prototype.message="",Sn.prototype.status=null,Sn.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Sn.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 En=0;En<Sn.errorTypes.length;En++)Sn[Sn.errorTypes[En]]=En,Sn.prototype[Sn.errorTypes[En]]=En;function On(e){return null!=e&&"function"==typeof e.then}function kn(e){On(e)&&e.then(null,(function(e){}))}var Cn=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((function(t,r,n){return e[r]&&(t[r]=e[r]),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}}))})},Pn="vjs-modal-dialog",xn=function(e){function r(t,r){var n;return(n=e.call(this,t,r)||this).handleKeyDown_=function(e){return n.handleKeyDown(e)},n.close_=function(e){return n.close(e)},n.opened_=n.hasBeenOpened_=n.hasBeenFilled_=!1,n.closeable(!n.options_.uncloseable),n.content(n.options_.content),n.contentEl_=Jt("div",{className:Pn+"-content"},{role:"document"}),n.descEl_=Jt("p",{className:Pn+"-description vjs-control-text",id:n.el().getAttribute("aria-describedby")}),Zt(n.descEl_,n.description()),n.el_.appendChild(n.descEl_),n.el_.appendChild(n.contentEl_),n}l(r,e);var n=r.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 Pn+" 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,r=this.getChild("closeButton");if(t&&!r){var n=this.contentEl_;this.contentEl_=this.el_,r=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=n,this.on(r,"close",this.close_)}!t&&r&&(this.off(r,"close",this.close_),this.removeChild(r),r.dispose())}return this.closeable_},n.fill=function(){this.fillWith(this.content())},n.fillWith=function(e){var t=this.contentEl(),r=t.parentNode,n=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,r.removeChild(t),this.empty(),br(t,e),this.trigger("modalfill"),n?r.insertBefore(t,n):r.appendChild(t);var i=this.getChild("closeButton");i&&r.appendChild(i.el_)},n.empty=function(){this.trigger("beforemodalempty"),mr(this.contentEl()),this.trigger("modalempty")},n.content=function(e){return void 0!==e&&(this.content_=e),this.content_},n.conditionalFocus_=function(){var e=o().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(),p().isEventKey(e,"Escape")&&this.closeable())return e.preventDefault(),void this.close();if(p().isEventKey(e,"Tab")){for(var t,r=this.focusableEls_(),n=this.el_.querySelector(":focus"),i=0;i<r.length;i++)if(n===r[i]){t=i;break}o().activeElement===this.el_&&(t=0),e.shiftKey&&0===t?(r[r.length-1].focus(),e.preventDefault()):e.shiftKey||t!==r.length-1||(r[0].focus(),e.preventDefault())}},n.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,(function(e){return(e instanceof t().HTMLAnchorElement||e instanceof t().HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof t().HTMLInputElement||e instanceof t().HTMLSelectElement||e instanceof t().HTMLTextAreaElement||e instanceof t().HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof t().HTMLIFrameElement||e instanceof t().HTMLObjectElement||e instanceof t().HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")}))},r}(gn);xn.prototype.options_={pauseOnOpen:!0,temporary:!0},gn.registerComponent("ModalDialog",xn);var jn=function(e){function t(t){var r;void 0===t&&(t=[]),(r=e.call(this)||this).tracks_=[],Object.defineProperty(s(r),"length",{get:function(){return this.tracks_.length}});for(var n=0;n<t.length;n++)r.addTrack(t[n]);return r}l(t,e);var r=t.prototype;return r.addTrack=function(e){var t=this,r=this.tracks_.length;""+r in this||Object.defineProperty(this,r,{get:function(){return this.tracks_[r]}}),-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})},Zr(e)&&e.addEventListener("labelchange",e.labelchange_)},r.removeTrack=function(e){for(var t,r=0,n=this.length;r<n;r++)if(this[r]===e){(t=this[r]).off&&t.off(),this.tracks_.splice(r,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})},r.getTrackById=function(e){for(var t=null,r=0,n=this.length;r<n;r++){var i=this[r];if(i.id===e){t=i;break}}return t},t}($r);for(var Ln in jn.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"},jn.prototype.allowedEvents_)jn.prototype["on"+Ln]=null;var In=function(e,t){for(var r=0;r<e.length;r++)Object.keys(e[r]).length&&t.id!==e[r].id&&(e[r].enabled=!1)},An=function(e){function t(t){var r;void 0===t&&(t=[]);for(var n=t.length-1;n>=0;n--)if(t[n].enabled){In(t,t[n]);break}return(r=e.call(this,t)||this).changing_=!1,r}l(t,e);var r=t.prototype;return r.addTrack=function(t){var r=this;t.enabled&&In(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.enabledChange_=function(){r.changing_||(r.changing_=!0,In(r,t),r.changing_=!1,r.trigger("change"))},t.addEventListener("enabledchange",t.enabledChange_))},r.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.enabledChange_&&(t.removeEventListener("enabledchange",t.enabledChange_),t.enabledChange_=null)},t}(jn),Rn=function(e,t){for(var r=0;r<e.length;r++)Object.keys(e[r]).length&&t.id!==e[r].id&&(e[r].selected=!1)},Dn=function(e){function t(t){var r;void 0===t&&(t=[]);for(var n=t.length-1;n>=0;n--)if(t[n].selected){Rn(t,t[n]);break}return(r=e.call(this,t)||this).changing_=!1,Object.defineProperty(s(r),"selectedIndex",{get:function(){for(var e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set:function(){}}),r}l(t,e);var r=t.prototype;return r.addTrack=function(t){var r=this;t.selected&&Rn(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.selectedChange_=function(){r.changing_||(r.changing_=!0,Rn(r,t),r.changing_=!1,r.trigger("change"))},t.addEventListener("selectedchange",t.selectedChange_))},r.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.selectedChange_&&(t.removeEventListener("selectedchange",t.selectedChange_),t.selectedChange_=null)},t}(jn),Mn=function(e){function t(){return e.apply(this,arguments)||this}l(t,e);var r=t.prototype;return r.addTrack=function(t){var r=this;e.prototype.addTrack.call(this,t),this.queueChange_||(this.queueChange_=function(){return r.queueTrigger("change")}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return r.trigger("selectedlanguagechange")}),t.addEventListener("modechange",this.queueChange_),-1===["metadata","chapters"].indexOf(t.kind)&&t.addEventListener("modechange",this.triggerSelectedlanguagechange_)},r.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}(jn),Nn=function(){function e(e){void 0===e&&(e=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var t=0,r=e.length;t<r;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,r=0,n=this.trackElements_.length;r<n;r++)if(e===this.trackElements_[r].track){t=this.trackElements_[r];break}return t},t.removeTrackElement_=function(e){for(var t=0,r=this.trackElements_.length;t<r;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}(),Bn=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,r=0,n=e.length;this.cues_=e,this.length_=e.length;var i=function(e){""+e in this||Object.defineProperty(this,""+e,{get:function(){return this.cues_[e]}})};if(t<n)for(r=t;r<n;r++)i.call(this,r)},t.getCueById=function(e){for(var t=null,r=0,n=this.length;r<n;r++){var i=this[r];if(i.id===e){t=i;break}}return t},e}(),Un={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Fn={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Vn={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Hn={disabled:"disabled",hidden:"hidden",showing:"showing"},qn=function(e){function t(t){var r;void 0===t&&(t={}),r=e.call(this)||this;var n={id:t.id||"vjs_track_"+Ar(),kind:t.kind||"",language:t.language||""},i=t.label||"",o=function(e){Object.defineProperty(s(r),e,{get:function(){return n[e]},set:function(){}})};for(var a in n)o(a);return Object.defineProperty(s(r),"label",{get:function(){return i},set:function(e){e!==i&&(i=e,this.trigger("labelchange"))}}),r}return l(t,e),t}($r),zn=function(e){var r=["protocol","hostname","port","pathname","search","hash","host"],n=o().createElement("a");n.href=e;var i,a=""===n.host&&"file:"!==n.protocol;a&&((i=o().createElement("div")).innerHTML='<a href="'+e+'"></a>',n=i.firstChild,i.setAttribute("style","display:none; position:absolute;"),o().body.appendChild(i));for(var s={},u=0;u<r.length;u++)s[r[u]]=n[r[u]];return"http:"===s.protocol&&(s.host=s.host.replace(/:80$/,"")),"https:"===s.protocol&&(s.host=s.host.replace(/:443$/,"")),s.protocol||(s.protocol=t().location.protocol),a&&o().body.removeChild(i),s},Wn=function(e){if(!e.match(/^https?:\/\//)){var t=o().createElement("div");t.innerHTML='<a href="'+e+'">x</a>',e=t.firstChild.href}return e},Gn=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(t)return t.pop().toLowerCase()}return""},Xn=function(e,r){void 0===r&&(r=t().location);var n=zn(e);return(":"===n.protocol?r.protocol:n.protocol)+n.host!==r.protocol+r.host},Kn=Object.freeze({__proto__:null,parseUrl:zn,getAbsoluteURL:Wn,getFileExtension:Gn,isCrossOrigin:Xn}),Yn=function(e,r){var n=new(t().WebVTT.Parser)(t(),t().vttjs,t().WebVTT.StringDecoder()),i=[];n.oncue=function(e){r.addCue(e)},n.onparsingerror=function(e){i.push(e)},n.onflush=function(){r.trigger({type:"loadeddata",target:r})},n.parse(e),i.length>0&&(t().console&&t().console.groupCollapsed&&t().console.groupCollapsed("Text Track parsing errors for "+r.src),i.forEach((function(e){return pt.error(e)})),t().console&&t().console.groupEnd&&t().console.groupEnd()),n.flush()},Qn=function(e,r){var n={uri:e},i=Xn(e);i&&(n.cors=i);var o="use-credentials"===r.tech_.crossOrigin();o&&(n.withCredentials=o),y()(n,Yr(this,(function(e,n,i){if(e)return pt.error(e,n);r.loaded_=!0,"function"!=typeof t().WebVTT?r.tech_&&r.tech_.any(["vttjsloaded","vttjserror"],(function(e){if("vttjserror"!==e.type)return Yn(i,r);pt.error("vttjs failed to load, stopping trying to process "+r.src)})):Yn(i,r)})))},$n=function(e){function r(t){var r;if(void 0===t&&(t={}),!t.tech)throw new Error("A tech was not provided.");var n=pn(t,{kind:Vn[t.kind]||"subtitles",language:t.language||t.srclang||""}),i=Hn[n.mode]||"disabled",o=n.default;"metadata"!==n.kind&&"chapters"!==n.kind||(i="hidden"),(r=e.call(this,n)||this).tech_=n.tech,r.cues_=[],r.activeCues_=[],r.preload_=!1!==r.tech_.preloadTextTracks;var a=new Bn(r.cues_),u=new Bn(r.activeCues_),l=!1,c=Yr(s(r),(function(){this.tech_.isReady_&&!this.tech_.isDisposed()&&(this.activeCues=this.activeCues,l&&(this.trigger("cuechange"),l=!1))}));return r.tech_.one("dispose",(function(){r.tech_.off("timeupdate",c)})),"disabled"!==i&&r.tech_.on("timeupdate",c),Object.defineProperties(s(r),{default:{get:function(){return o},set:function(){}},mode:{get:function(){return i},set:function(e){Hn[e]&&i!==e&&(i=e,this.preload_||"disabled"===i||0!==this.cues.length||Qn(this.src,this),this.tech_.off("timeupdate",c),"disabled"!==i&&this.tech_.on("timeupdate",c),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?a:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return u;for(var e=this.tech_.currentTime(),t=[],r=0,n=this.cues.length;r<n;r++){var i=this.cues[r];(i.startTime<=e&&i.endTime>=e||i.startTime===i.endTime&&i.startTime<=e&&i.startTime+.5>=e)&&t.push(i)}if(l=!1,t.length!==this.activeCues_.length)l=!0;else for(var o=0;o<t.length;o++)-1===this.activeCues_.indexOf(t[o])&&(l=!0);return this.activeCues_=t,u.setCues_(this.activeCues_),u},set:function(){}}}),n.src?(r.src=n.src,r.preload_||(r.loaded_=!0),(r.preload_||"subtitles"!==n.kind&&"captions"!==n.kind)&&Qn(r.src,s(r))):r.loaded_=!0,r}l(r,e);var n=r.prototype;return n.addCue=function(e){var r=e;if(t().vttjs&&!(e instanceof t().vttjs.VTTCue)){for(var n in r=new(t().vttjs.VTTCue)(e.startTime,e.endTime,e.text),e)n in r||(r[n]=e[n]);r.id=e.id,r.originalCue_=e}for(var i=this.tech_.textTracks(),o=0;o<i.length;o++)i[o]!==this&&i[o].removeCue(r);this.cues_.push(r),this.cues.setCues_(this.cues_)},n.removeCue=function(e){for(var t=this.cues_.length;t--;){var r=this.cues_[t];if(r===e||r.originalCue_&&r.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}},r}(qn);$n.prototype.allowedEvents_={cuechange:"cuechange"};var Jn=function(e){function t(t){var r;void 0===t&&(t={});var n=pn(t,{kind:Fn[t.kind]||""});r=e.call(this,n)||this;var i=!1;return Object.defineProperty(s(r),"enabled",{get:function(){return i},set:function(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("enabledchange"))}}),n.enabled&&(r.enabled=n.enabled),r.loaded_=!0,r}return l(t,e),t}(qn),Zn=function(e){function t(t){var r;void 0===t&&(t={});var n=pn(t,{kind:Un[t.kind]||""});r=e.call(this,n)||this;var i=!1;return Object.defineProperty(s(r),"selected",{get:function(){return i},set:function(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("selectedchange"))}}),n.selected&&(r.selected=n.selected),r}return l(t,e),t}(qn),ei=function(e){function t(t){var r,n;void 0===t&&(t={}),r=e.call(this)||this;var i=new $n(t);return r.kind=i.kind,r.src=i.src,r.srclang=i.language,r.label=i.label,r.default=i.default,Object.defineProperties(s(r),{readyState:{get:function(){return n}},track:{get:function(){return i}}}),n=0,i.addEventListener("loadeddata",(function(){n=2,r.trigger({type:"load",target:s(r)})})),r}return l(t,e),t}($r);ei.prototype.allowedEvents_={load:"load"},ei.NONE=0,ei.LOADING=1,ei.LOADED=2,ei.ERROR=3;var ti={audio:{ListClass:An,TrackClass:Jn,capitalName:"Audio"},video:{ListClass:Dn,TrackClass:Zn,capitalName:"Video"},text:{ListClass:Mn,TrackClass:$n,capitalName:"Text"}};Object.keys(ti).forEach((function(e){ti[e].getterName=e+"Tracks",ti[e].privateName=e+"Tracks_"}));var ri={remoteText:{ListClass:Mn,TrackClass:$n,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Nn,TrackClass:ei,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},ni=a({},ti,ri);ri.names=Object.keys(ri),ti.names=Object.keys(ti),ni.names=[].concat(ri.names).concat(ti.names);var ii=function(e){function r(t,r){var n;return void 0===t&&(t={}),void 0===r&&(r=function(){}),t.reportTouchActivity=!1,(n=e.call(this,null,t,r)||this).onDurationChange_=function(e){return n.onDurationChange(e)},n.trackProgress_=function(e){return n.trackProgress(e)},n.trackCurrentTime_=function(e){return n.trackCurrentTime(e)},n.stopTrackingCurrentTime_=function(e){return n.stopTrackingCurrentTime(e)},n.disposeSourceHandler_=function(e){return n.disposeSourceHandler(e)},n.hasStarted_=!1,n.on("playing",(function(){this.hasStarted_=!0})),n.on("loadstart",(function(){this.hasStarted_=!1})),ni.names.forEach((function(e){var r=ni[e];t&&t[r.getterName]&&(n[r.privateName]=t[r.getterName])})),n.featuresProgressEvents||n.manualProgressOn(),n.featuresTimeupdateEvents||n.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach((function(e){!1===t["native"+e+"Tracks"]&&(n["featuresNative"+e+"Tracks"]=!1)})),!1===t.nativeCaptions||!1===t.nativeTextTracks?n.featuresNativeTextTracks=!1:!0!==t.nativeCaptions&&!0!==t.nativeTextTracks||(n.featuresNativeTextTracks=!0),n.featuresNativeTextTracks||n.emulateTextTracks(),n.preloadTextTracks=!1!==t.preloadTextTracks,n.autoRemoteTextTracks_=new ni.text.ListClass,n.initTrackListeners(),t.nativeControlsForTouch||n.emitTapEvents(),n.constructor&&(n.name_=n.constructor.name||"Unknown Tech"),n}l(r,e);var n=r.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(Yr(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 wn(0,0)},n.bufferedPercent=function(){return Tn(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(ti.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 r=t[e+"Tracks"]()||[],n=r.length;n--;){var i=r[n];"text"===e&&t.removeRemoteTextTrack(i),r.removeTrack(i)}}))},n.cleanupAutoTextTracks=function(){for(var e=this.autoRemoteTextTracks_||[],t=e.length;t--;){var r=e[t];this.removeRemoteTextTrack(r)}},n.reset=function(){},n.crossOrigin=function(){},n.setCrossOrigin=function(){},n.error=function(e){return void 0!==e&&(this.error_=new Sn(e),this.trigger("error")),this.error_},n.played=function(){return this.hasStarted_?wn(0,0):wn()},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;ti.names.forEach((function(t){var r=ti[t],n=function(){e.trigger(t+"trackchange")},i=e[r.getterName]();i.addEventListener("removetrack",n),i.addEventListener("addtrack",n),e.on("dispose",(function(){i.removeEventListener("removetrack",n),i.removeEventListener("addtrack",n)}))}))},n.addWebVttScript_=function(){var e=this;if(!t().WebVTT)if(o().body.contains(this.el())){if(!this.options_["vtt.js"]&&_t(v())&&Object.keys(v()).length>0)return void this.trigger("vttjsloaded");var r=o().createElement("script");r.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",r.onload=function(){e.trigger("vttjsloaded")},r.onerror=function(){e.trigger("vttjserror")},this.on("dispose",(function(){r.onload=null,r.onerror=null})),t().WebVTT=!0,this.el().parentNode.appendChild(r)}else this.ready(this.addWebVttScript_)},n.emulateTextTracks=function(){var e=this,t=this.textTracks(),r=this.remoteTextTracks(),n=function(e){return t.addTrack(e.track)},i=function(e){return t.removeTrack(e.track)};r.on("addtrack",n),r.on("removetrack",i),this.addWebVttScript_();var o=function(){return e.trigger("texttrackchange")},a=function(){o();for(var e=0;e<t.length;e++){var r=t[e];r.removeEventListener("cuechange",o),"showing"===r.mode&&r.addEventListener("cuechange",o)}};a(),t.addEventListener("change",a),t.addEventListener("addtrack",a),t.addEventListener("removetrack",a),this.on("dispose",(function(){r.off("addtrack",n),r.off("removetrack",i),t.removeEventListener("change",a),t.removeEventListener("addtrack",a),t.removeEventListener("removetrack",a);for(var e=0;e<t.length;e++)t[e].removeEventListener("cuechange",o)}))},n.addTextTrack=function(e,t,r){if(!e)throw new Error("TextTrack kind is required but was not provided");return function(e,t,r,n,i){void 0===i&&(i={});var o=e.textTracks();i.kind=t,r&&(i.label=r),n&&(i.language=n),i.tech=e;var a=new ni.text.TrackClass(i);return o.addTrack(a),a}(this,e,t,r)},n.createRemoteTextTrack=function(e){var t=pn(e,{tech:this});return new ri.remoteTextEl.TrackClass(t)},n.addRemoteTextTrack=function(e,t){var r=this;void 0===e&&(e={});var n=this.createRemoteTextTrack(e);return!0!==t&&!1!==t&&(pt.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),t=!0),this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),!0!==t&&this.ready((function(){return r.autoRemoteTextTracks_.addTrack(n.track)})),n},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||t().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""},r.canPlayType=function(){return""},r.canPlaySource=function(e,t){return r.canPlayType(e.type)},r.isTech=function(e){return e.prototype instanceof r||e instanceof r||e===r},r.registerTech=function(e,t){if(r.techs_||(r.techs_={}),!r.isTech(t))throw new Error("Tech "+e+" must be a Tech");if(!r.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!r.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=hn(e),r.techs_[e]=t,r.techs_[fn(e)]=t,"Tech"!==e&&r.defaultTechOrder_.push(e),t},r.getTech=function(e){if(e)return r.techs_&&r.techs_[e]?r.techs_[e]:(e=hn(e),t()&&t().videojs&&t().videojs[e]?(pt.warn("The "+e+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),t().videojs[e]):void 0)},r}(gn);ni.names.forEach((function(e){var t=ni[e];ii.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}})),ii.prototype.featuresVolumeControl=!0,ii.prototype.featuresMuteControl=!0,ii.prototype.featuresFullscreenResize=!1,ii.prototype.featuresPlaybackRate=!1,ii.prototype.featuresProgressEvents=!1,ii.prototype.featuresSourceset=!1,ii.prototype.featuresTimeupdateEvents=!1,ii.prototype.featuresNativeTextTracks=!1,ii.withSourceHandlers=function(e){e.registerSourceHandler=function(t,r){var n=e.sourceHandlers;n||(n=e.sourceHandlers=[]),void 0===r&&(r=n.length),n.splice(r,0,t)},e.canPlayType=function(t){for(var r,n=e.sourceHandlers||[],i=0;i<n.length;i++)if(r=n[i].canPlayType(t))return r;return""},e.selectSourceHandler=function(t,r){for(var n=e.sourceHandlers||[],i=0;i<n.length;i++)if(n[i].canHandleSource(t,r))return n[i];return null},e.canPlaySource=function(t,r){var n=e.selectSourceHandler(t,r);return n?n.canHandleSource(t,r):""},["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 r=e.selectSourceHandler(t,this.options_);r||(e.nativeSourceHandler?r=e.nativeSourceHandler:pt.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),r!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=r.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)}},gn.registerComponent("Tech",ii),ii.registerTech("Tech",ii),ii.defaultTechOrder_=[];var oi={},ai={},si={};function ui(e,t,r){e.setTimeout((function(){return di(t,oi[t.type],r,e)}),1)}function li(e,t,r,n){void 0===n&&(n=null);var i="call"+hn(r),o=e.reduce(pi(i),n),a=o===si,s=a?null:t[r](o);return function(e,t,r,n){for(var i=e.length-1;i>=0;i--){var o=e[i];o[t]&&o[t](n,r)}}(e,r,s,a),s}var ci={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1},fi={setCurrentTime:1,setMuted:1,setVolume:1},hi={play:1,pause:1};function pi(e){return function(t,r){return t===si?si:r[e]?r[e](t):t}}function di(e,t,r,n,i,o){void 0===e&&(e={}),void 0===t&&(t=[]),void 0===i&&(i=[]),void 0===o&&(o=!1);var a=t,s=a[0],u=a.slice(1);if("string"==typeof s)di(e,oi[s],r,n,i,o);else if(s){var l=function(e,t){var r=ai[e.id()],n=null;if(null==r)return n=t(e),ai[e.id()]=[[t,n]],n;for(var i=0;i<r.length;i++){var o=r[i],a=o[0],s=o[1];a===t&&(n=s)}return null===n&&(n=t(e),r.push([t,n])),n}(n,s);if(!l.setSource)return i.push(l),di(e,u,r,n,i,o);l.setSource(gt({},e),(function(t,a){if(t)return di(e,u,r,n,i,o);i.push(l),di(a,e.type===a.type?u:oi[a.type],r,n,i,o)}))}else u.length?di(e,u,r,n,i,o):o?r(e,i):di(e,oi["*"],r,n,i,!0)}var yi={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"},mi=function(e){void 0===e&&(e="");var t=Gn(e);return yi[t.toLowerCase()]||""},vi=function e(t){if(Array.isArray(t)){var r=[];t.forEach((function(t){t=e(t),Array.isArray(t)?r=r.concat(t):bt(t)&&r.push(t)})),t=r}else t="string"==typeof t&&t.trim()?[gi({src:t})]:bt(t)&&"string"==typeof t.src&&t.src&&t.src.trim()?[gi(t)]:[];return t};function gi(e){if(!e.type){var t=mi(e.src);t&&(e.type=t)}return e}var bi=function(e){function t(t,r,n){var i,o=pn({createEl:!1},r);if(i=e.call(this,t,o,n)||this,r.playerOptions.sources&&0!==r.playerOptions.sources.length)t.src(r.playerOptions.sources);else for(var a=0,s=r.playerOptions.techOrder;a<s.length;a++){var u=hn(s[a]),l=ii.getTech(u);if(u||(l=gn.getComponent(u)),l&&l.isSupported()){t.loadTech_(u);break}}return i}return l(t,e),t}(gn);gn.registerComponent("MediaLoader",bi);var _i=function(e){function t(t,r){var n;return(n=e.call(this,t,r)||this).handleMouseOver_=function(e){return n.handleMouseOver(e)},n.handleMouseOut_=function(e){return n.handleMouseOut(e)},n.handleClick_=function(e){return n.handleClick(e)},n.handleKeyDown_=function(e){return n.handleKeyDown(e)},n.emitTapEvents(),n.enable(),n}l(t,e);var r=t.prototype;return r.createEl=function(t,r,n){void 0===t&&(t="div"),void 0===r&&(r={}),void 0===n&&(n={}),r=gt({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass(),tabIndex:0},r),"button"===t&&pt.error("Creating a ClickableComponent with an HTML element of "+t+" is not supported; use a Button instead."),n=gt({role:"button"},n),this.tabIndex_=r.tabIndex;var i=e.prototype.createEl.call(this,t,r,n);return this.createControlTextEl(i),i},r.dispose=function(){this.controlTextEl_=null,e.prototype.dispose.call(this)},r.createControlTextEl=function(e){return this.controlTextEl_=Jt("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},r.controlText=function(e,t){if(void 0===t&&(t=this.el()),void 0===e)return this.controlText_||"Need Text";var r=this.localize(e);this.controlText_=e,Zt(this.controlTextEl_,r),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",r)},r.buildCSSClass=function(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)},r.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_))},r.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_)},r.handleLanguagechange=function(){this.controlText(this.controlText_)},r.handleClick=function(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)},r.handleKeyDown=function(t){p().isEventKey(t,"Space")||p().isEventKey(t,"Enter")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},t}(gn);gn.registerComponent("ClickableComponent",_i);var wi=function(e){function t(t,r){var n;return(n=e.call(this,t,r)||this).update(),n.update_=function(e){return n.update(e)},t.on("posterchange",n.update_),n}l(t,e);var r=t.prototype;return r.dispose=function(){this.player().off("posterchange",this.update_),e.prototype.dispose.call(this)},r.createEl=function(){return Jt("div",{className:"vjs-poster",tabIndex:-1})},r.update=function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()},r.setSrc=function(e){var t="";e&&(t='url("'+e+'")'),this.el_.style.backgroundImage=t},r.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)||(Nt||Rt)&&t||this.player_.tech(!0).focus(),this.player_.paused()?kn(this.player_.play()):this.player_.pause()}},t}(_i);gn.registerComponent("PosterImage",wi);var Ti="#222",Si={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 Ei(e,t){var r;if(4===e.length)r=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.");r=e.slice(1)}return"rgba("+parseInt(r.slice(0,2),16)+","+parseInt(r.slice(2,4),16)+","+parseInt(r.slice(4,6),16)+","+t+")"}function Oi(e,t,r){try{e.style[t]=r}catch(e){return}}var ki=function(e){function r(r,n,i){var o;o=e.call(this,r,n,i)||this;var a=function(e){return o.updateDisplay(e)};return r.on("loadstart",(function(e){return o.toggleDisplay(e)})),r.on("texttrackchange",a),r.on("loadedmetadata",(function(e){return o.preselectTrack(e)})),r.ready(Yr(s(o),(function(){if(r.tech_&&r.tech_.featuresNativeTextTracks)this.hide();else{r.on("fullscreenchange",a),r.on("playerresize",a),t().addEventListener("orientationchange",a),r.on("dispose",(function(){return t().removeEventListener("orientationchange",a)}));for(var e=this.options_.playerOptions.tracks||[],n=0;n<e.length;n++)this.player_.addRemoteTextTrack(e[n],!0);this.preselectTrack()}}))),o}l(r,e);var n=r.prototype;return n.preselectTrack=function(){for(var e,t,r,n={captions:1,subtitles:1},i=this.player_.textTracks(),o=this.player_.cache_.selectedLanguage,a=0;a<i.length;a++){var s=i[a];o&&o.enabled&&o.language&&o.language===s.language&&s.kind in n?s.kind===o.kind?r=s:r||(r=s):o&&!o.enabled?(r=null,e=null,t=null):s.default&&("descriptions"!==s.kind||e?s.kind in n&&!t&&(t=s):e=s)}r?r.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"},{"aria-live":"off","aria-atomic":"true"})},n.clearDisplay=function(){"function"==typeof t().WebVTT&&t().WebVTT.processCues(t(),[],this.el_)},n.updateDisplay=function(){var e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){for(var r=[],n=0;n<e.length;++n){var i=e[n];"showing"===i.mode&&r.push(i)}this.updateForTrack(r)}else{for(var o=null,a=null,s=e.length;s--;){var u=e[s];"showing"===u.mode&&("descriptions"===u.kind?o=u:a=u)}a?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(a)):o&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(o))}},n.updateDisplayState=function(e){for(var r=this.player_.textTrackSettings.getValues(),n=e.activeCues,i=n.length;i--;){var o=n[i];if(o){var a=o.displayState;if(r.color&&(a.firstChild.style.color=r.color),r.textOpacity&&Oi(a.firstChild,"color",Ei(r.color||"#fff",r.textOpacity)),r.backgroundColor&&(a.firstChild.style.backgroundColor=r.backgroundColor),r.backgroundOpacity&&Oi(a.firstChild,"backgroundColor",Ei(r.backgroundColor||"#000",r.backgroundOpacity)),r.windowColor&&(r.windowOpacity?Oi(a,"backgroundColor",Ei(r.windowColor,r.windowOpacity)):a.style.backgroundColor=r.windowColor),r.edgeStyle&&("dropshadow"===r.edgeStyle?a.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px "+Ti:"raised"===r.edgeStyle?a.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px "+Ti:"depressed"===r.edgeStyle?a.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px "+Ti:"uniform"===r.edgeStyle&&(a.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px "+Ti)),r.fontPercent&&1!==r.fontPercent){var s=t().parseFloat(a.style.fontSize);a.style.fontSize=s*r.fontPercent+"px",a.style.height="auto",a.style.top="auto"}r.fontFamily&&"default"!==r.fontFamily&&("small-caps"===r.fontFamily?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=Si[r.fontFamily])}}},n.updateForTrack=function(e){if(Array.isArray(e)||(e=[e]),"function"==typeof t().WebVTT&&!e.every((function(e){return!e.activeCues}))){for(var r=[],n=0;n<e.length;++n)for(var i=e[n],o=0;o<i.activeCues.length;++o)r.push(i.activeCues[o]);t().WebVTT.processCues(t(),r,this.el_);for(var a=0;a<e.length;++a){for(var s=e[a],u=0;u<s.activeCues.length;++u){var l=s.activeCues[u].displayState;rr(l,"vjs-text-track-cue"),rr(l,"vjs-text-track-cue-"+(s.language?s.language:a))}this.player_.textTrackSettings&&this.updateDisplayState(s)}}},r}(gn);gn.registerComponent("TextTrackDisplay",ki);var Ci=function(e){function t(){return e.apply(this,arguments)||this}return l(t,e),t.prototype.createEl=function(){var t=this.player_.isAudio(),r=this.localize(t?"Audio Player":"Video Player"),n=Jt("span",{className:"vjs-control-text",innerHTML:this.localize("{1} is loading.",[r])}),i=e.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return i.appendChild(n),i},t}(gn);gn.registerComponent("LoadingSpinner",Ci);var Pi=function(e){function t(){return e.apply(this,arguments)||this}l(t,e);var r=t.prototype;return r.createEl=function(e,t,r){void 0===t&&(t={}),void 0===r&&(r={}),t=gt({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass()},t),r=gt({type:"button"},r);var n=gn.prototype.createEl.call(this,"button",t,r);return this.createControlTextEl(n),n},r.addChild=function(e,t){void 0===t&&(t={});var r=this.constructor.name;return pt.warn("Adding an actionable (user controllable) child to a Button ("+r+") is not supported; use a ClickableComponent instead."),gn.prototype.addChild.call(this,e,t)},r.enable=function(){e.prototype.enable.call(this),this.el_.removeAttribute("disabled")},r.disable=function(){e.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},r.handleKeyDown=function(t){p().isEventKey(t,"Space")||p().isEventKey(t,"Enter")?t.stopPropagation():e.prototype.handleKeyDown.call(this,t)},t}(_i);gn.registerComponent("Button",Pi);var xi=function(e){function t(t,r){var n;return(n=e.call(this,t,r)||this).mouseused_=!1,n.on("mousedown",(function(e){return n.handleMouseDown(e)})),n}l(t,e);var r=t.prototype;return r.buildCSSClass=function(){return"vjs-big-play-button"},r.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY){var r=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;return kn(t),void(!this.player_.tech(!0)||(Nt||Rt)&&r||this.player_.tech(!0).focus())}var n=this.player_.getChild("controlBar"),i=n&&n.getChild("playToggle");if(i){var o=function(){return i.focus()};On(t)?t.then(o,(function(){})):this.setTimeout(o,1)}else this.player_.tech(!0).focus()},r.handleKeyDown=function(t){this.mouseused_=!1,e.prototype.handleKeyDown.call(this,t)},r.handleMouseDown=function(e){this.mouseused_=!0},t}(Pi);xi.prototype.controlText_="Play Video",gn.registerComponent("BigPlayButton",xi);var ji=function(e){function t(t,r){var n;return(n=e.call(this,t,r)||this).controlText(r&&r.controlText||n.localize("Close")),n}l(t,e);var r=t.prototype;return r.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},r.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},r.handleKeyDown=function(t){p().isEventKey(t,"Esc")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},t}(Pi);gn.registerComponent("CloseButton",ji);var Li=function(e){function t(t,r){var n;return void 0===r&&(r={}),n=e.call(this,t,r)||this,r.replay=void 0===r.replay||r.replay,n.on(t,"play",(function(e){return n.handlePlay(e)})),n.on(t,"pause",(function(e){return n.handlePause(e)})),r.replay&&n.on(t,"ended",(function(e){return n.handleEnded(e)})),n}l(t,e);var r=t.prototype;return r.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},r.handleClick=function(e){this.player_.paused()?kn(this.player_.play()):this.player_.pause()},r.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},r.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},r.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},r.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}(Pi);Li.prototype.controlText_="Play",gn.registerComponent("PlayToggle",Li);var Ii=function(e,t){e=e<0?0:e;var r=Math.floor(e%60),n=Math.floor(e/60%60),i=Math.floor(e/3600),o=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(i=n=r="-"),(i=i>0||a>0?i+":":"")+(n=((i||o>=10)&&n<10?"0"+n:n)+":")+(r<10?"0"+r:r)},Ai=Ii;function Ri(e,t){return void 0===t&&(t=e),Ai(e,t)}var Di=function(e){function t(t,r){var n;return(n=e.call(this,t,r)||this).on(t,["timeupdate","ended"],(function(e){return n.updateContent(e)})),n.updateTextNode_(),n}l(t,e);var r=t.prototype;return r.createEl=function(){var t=this.buildCSSClass(),r=e.prototype.createEl.call(this,"div",{className:t+" vjs-time-control vjs-control",innerHTML:'<span class="vjs-control-text" role="presentation">'+this.localize(this.labelText_)+" </span>"});return this.contentEl_=Jt("span",{className:t+"-display"},{"aria-live":"off",role:"presentation"}),r.appendChild(this.contentEl_),r},r.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},r.updateTextNode_=function(e){var t=this;void 0===e&&(e=0),e=Ri(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,pt.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_=o().createTextNode(t.formattedTime_),t.textNode_&&(e?t.contentEl_.replaceChild(t.textNode_,e):t.contentEl_.appendChild(t.textNode_))}})))},r.updateContent=function(e){},t}(gn);Di.prototype.labelText_="Time",Di.prototype.controlText_="Time",gn.registerComponent("TimeDisplay",Di);var Mi=function(e){function t(){return e.apply(this,arguments)||this}l(t,e);var r=t.prototype;return r.buildCSSClass=function(){return"vjs-current-time"},r.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}(Di);Mi.prototype.labelText_="Current Time",Mi.prototype.controlText_="Current Time",gn.registerComponent("CurrentTimeDisplay",Mi);var Ni=function(e){function t(t,r){var n,i=function(e){return n.updateContent(e)};return(n=e.call(this,t,r)||this).on(t,"durationchange",i),n.on(t,"loadstart",i),n.on(t,"loadedmetadata",i),n}l(t,e);var r=t.prototype;return r.buildCSSClass=function(){return"vjs-duration"},r.updateContent=function(e){var t=this.player_.duration();this.updateTextNode_(t)},t}(Di);Ni.prototype.labelText_="Duration",Ni.prototype.controlText_="Duration",gn.registerComponent("DurationDisplay",Ni);var Bi=function(e){function t(){return e.apply(this,arguments)||this}return l(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"<div><span>/</span></div>"},{"aria-hidden":!0})},t}(gn);gn.registerComponent("TimeDivider",Bi);var Ui=function(e){function t(t,r){var n;return(n=e.call(this,t,r)||this).on(t,"durationchange",(function(e){return n.updateContent(e)})),n}l(t,e);var r=t.prototype;return r.buildCSSClass=function(){return"vjs-remaining-time"},r.createEl=function(){var t=e.prototype.createEl.call(this);return t.insertBefore(Jt("span",{},{"aria-hidden":!0},"-"),this.contentEl_),t},r.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}(Di);Ui.prototype.labelText_="Remaining Time",Ui.prototype.controlText_="Remaining Time",gn.registerComponent("RemainingTimeDisplay",Ui);var Fi=function(e){function t(t,r){var n;return(n=e.call(this,t,r)||this).updateShowing(),n.on(n.player(),"durationchange",(function(e){return n.updateShowing(e)})),n}l(t,e);var r=t.prototype;return r.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=Jt("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Stream Type")+" </span>"+this.localize("LIVE")},{"aria-live":"off"}),t.appendChild(this.contentEl_),t},r.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},r.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(gn);gn.registerComponent("LiveDisplay",Fi);var Vi=function(e){function t(t,r){var n;return(n=e.call(this,t,r)||this).updateLiveEdgeStatus(),n.player_.liveTracker&&(n.updateLiveEdgeStatusHandler_=function(e){return n.updateLiveEdgeStatus(e)},n.on(n.player_.liveTracker,"liveedgechange",n.updateLiveEdgeStatusHandler_)),n}l(t,e);var r=t.prototype;return r.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=Jt("span",{className:"vjs-seek-to-live-text",innerHTML:this.localize("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t},r.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"))},r.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},r.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,e.prototype.dispose.call(this)},t}(Pi);Vi.prototype.controlText_="Seek to live, currently playing live",gn.registerComponent("SeekToLive",Vi);var Hi=function(e,t,r){return e=Number(e),Math.min(r,Math.max(t,isNaN(e)?t:e))},qi=function(e){function t(t,r){var n;return(n=e.call(this,t,r)||this).handleMouseDown_=function(e){return n.handleMouseDown(e)},n.handleMouseUp_=function(e){return n.handleMouseUp(e)},n.handleKeyDown_=function(e){return n.handleKeyDown(e)},n.handleClick_=function(e){return n.handleClick(e)},n.handleMouseMove_=function(e){return n.handleMouseMove(e)},n.update_=function(e){return n.update(e)},n.bar=n.getChild(n.options_.barName),n.vertical(!!n.options_.vertical),n.enable(),n}l(t,e);var r=t.prototype;return r.enabled=function(){return this.enabled_},r.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)},r.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}},r.createEl=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),r.className=r.className+" vjs-slider",r=gt({tabIndex:0},r),n=gt({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n),e.prototype.createEl.call(this,t,r,n)},r.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||Dt||e.preventDefault(),cr(),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)},r.handleMouseMove=function(e){},r.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;fr(),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()},r.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 r=e.vertical()?"height":"width";e.bar.el().style[r]=(100*t).toFixed(2)+"%"}))),t}},r.getProgress=function(){return Number(Hi(this.getPercent(),0,1).toFixed(4))},r.calculateDistance=function(e){var t=dr(this.el_,e);return this.vertical()?t.y:t.x},r.handleKeyDown=function(t){p().isEventKey(t,"Left")||p().isEventKey(t,"Down")?(t.preventDefault(),t.stopPropagation(),this.stepBack()):p().isEventKey(t,"Right")||p().isEventKey(t,"Up")?(t.preventDefault(),t.stopPropagation(),this.stepForward()):e.prototype.handleKeyDown.call(this,t)},r.handleClick=function(e){e.stopPropagation(),e.preventDefault()},r.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}(gn);gn.registerComponent("Slider",qi);var zi=function(e,t){return Hi(e/t*100,0,100).toFixed(2)+"%"},Wi=function(e){function t(t,r){var n;return(n=e.call(this,t,r)||this).partEls_=[],n.on(t,"progress",(function(e){return n.update(e)})),n}l(t,e);var r=t.prototype;return r.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),r=Jt("span",{className:"vjs-control-text"}),n=Jt("span",{textContent:this.localize("Loaded")}),i=o().createTextNode(": ");return this.percentageEl_=Jt("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),t.appendChild(r),r.appendChild(n),r.appendChild(i),r.appendChild(this.percentageEl_),t},r.dispose=function(){this.partEls_=null,this.percentageEl_=null,e.prototype.dispose.call(this)},r.update=function(e){var t=this;this.requestNamedAnimationFrame("LoadProgressBar#update",(function(){var e=t.player_.liveTracker,r=t.player_.buffered(),n=e&&e.isLive()?e.seekableEnd():t.player_.duration(),i=t.player_.bufferedEnd(),o=t.partEls_,a=zi(i,n);t.percent_!==a&&(t.el_.style.width=a,Zt(t.percentageEl_,a),t.percent_=a);for(var s=0;s<r.length;s++){var u=r.start(s),l=r.end(s),c=o[s];c||(c=t.el_.appendChild(Jt()),o[s]=c),c.dataset.start===u&&c.dataset.end===l||(c.dataset.start=u,c.dataset.end=l,c.style.left=zi(u,i),c.style.width=zi(l-u,i))}for(var f=o.length;f>r.length;f--)t.el_.removeChild(o[f-1]);o.length=r.length}))},t}(gn);gn.registerComponent("LoadProgressBar",Wi);var Gi=function(e){function t(t,r){var n;return(n=e.call(this,t,r)||this).update=Qr(Yr(s(n),n.update),Kr),n}l(t,e);var r=t.prototype;return r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},r.update=function(e,t,r){var n=pr(this.el_),i=hr(this.player_.el()),o=e.width*t;if(i&&n){var a=e.left-i.left+o,s=e.width-o+(i.right-e.right),u=n.width/2;a<u?u+=u-a:s<u&&(u=s),u<0?u=0:u>n.width&&(u=n.width),u=Math.round(u),this.el_.style.right="-"+u+"px",this.write(r)}},r.write=function(e){Zt(this.el_,e)},r.updateTime=function(e,t,r,n){var i=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",(function(){var o,a=i.player_.duration();if(i.player_.liveTracker&&i.player_.liveTracker.isLive()){var s=i.player_.liveTracker.liveWindow(),u=s-t*s;o=(u<1?"":"-")+Ri(u,s)}else o=Ri(r,a);i.update(e,t,o),n&&n()}))},t}(gn);gn.registerComponent("TimeTooltip",Gi);var Xi=function(e){function t(t,r){var n;return(n=e.call(this,t,r)||this).update=Qr(Yr(s(n),n.update),Kr),n}l(t,e);var r=t.prototype;return r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},r.update=function(e,t){var r=this.getChild("timeTooltip");if(r){var n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();r.updateTime(e,t,n)}},t}(gn);Xi.prototype.options_={children:[]},qt||jt||Xi.prototype.options_.children.push("timeTooltip"),gn.registerComponent("PlayProgressBar",Xi);var Ki=function(e){function t(t,r){var n;return(n=e.call(this,t,r)||this).update=Qr(Yr(s(n),n.update),Kr),n}l(t,e);var r=t.prototype;return r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},r.update=function(e,t){var r=this,n=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,n,(function(){r.el_.style.left=e.width*t+"px"}))},t}(gn);Ki.prototype.options_={children:["timeTooltip"]},gn.registerComponent("MouseTimeDisplay",Ki);var Yi=function(e){function t(t,r){var n;return(n=e.call(this,t,r)||this).setEventHandlers_(),n}l(t,e);var r=t.prototype;return r.setEventHandlers_=function(){var e=this;this.update_=Yr(this,this.update),this.update=Qr(this.update_,Kr),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 o()&&"visibilityState"in o()&&this.on(o(),"visibilitychange",this.toggleVisibility_)},r.toggleVisibility_=function(e){"hidden"===o().visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())},r.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Kr))},r.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},r.update=function(t){var r=this;if("hidden"!==o().visibilityState){var n=e.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",(function(){var e=r.player_.ended()?r.player_.duration():r.getCurrentTime_(),t=r.player_.liveTracker,i=r.player_.duration();t&&t.isLive()&&(i=r.player_.liveTracker.liveCurrentTime()),r.percent_!==n&&(r.el_.setAttribute("aria-valuenow",(100*n).toFixed(2)),r.percent_=n),r.currentTime_===e&&r.duration_===i||(r.el_.setAttribute("aria-valuetext",r.localize("progress bar timing: currentTime={1} duration={2}",[Ri(e,i),Ri(i,i)],"{1} of {2}")),r.currentTime_=e,r.duration_=i),r.bar&&r.bar.update(hr(r.el()),r.getProgress())})),n}},r.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)},r.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},r.getPercent=function(){var e,t=this.getCurrentTime_(),r=this.player_.liveTracker;return r&&r.isLive()?(e=(t-r.seekableStart())/r.liveWindow(),r.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e},r.handleMouseDown=function(t){_r(t)&&(t.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},r.handleMouseMove=function(e){if(_r(e)){var t,r=this.calculateDistance(e),n=this.player_.liveTracker;if(n&&n.isLive()){if(r>=.99)return void n.seekToLiveEdge();var i=n.seekableStart(),o=n.liveCurrentTime();if((t=i+r*n.liveWindow())>=o&&(t=o),t<=i&&(t=i+.1),t===1/0)return}else(t=r*this.player_.duration())===this.player_.duration()&&(t-=.1);this.userSeek_(t)}},r.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},r.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},r.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?kn(this.player_.play()):this.update_()},r.stepForward=function(){this.userSeek_(this.player_.currentTime()+5)},r.stepBack=function(){this.userSeek_(this.player_.currentTime()-5)},r.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},r.handleKeyDown=function(t){var r=this.player_.liveTracker;if(p().isEventKey(t,"Space")||p().isEventKey(t,"Enter"))t.preventDefault(),t.stopPropagation(),this.handleAction(t);else if(p().isEventKey(t,"Home"))t.preventDefault(),t.stopPropagation(),this.userSeek_(0);else if(p().isEventKey(t,"End"))t.preventDefault(),t.stopPropagation(),r&&r.isLive()?this.userSeek_(r.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(p()(t))){t.preventDefault(),t.stopPropagation();var n=10*(p().codes[p()(t)]-p().codes[0])/100;r&&r.isLive()?this.userSeek_(r.seekableStart()+r.liveWindow()*n):this.userSeek_(this.player_.duration()*n)}else p().isEventKey(t,"PgDn")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):p().isEventKey(t,"PgUp")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):e.prototype.handleKeyDown.call(this,t)},r.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 o()&&"visibilityState"in o()&&this.off(o(),"visibilitychange",this.toggleVisibility_),e.prototype.dispose.call(this)},t}(qi);Yi.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},qt||jt||Yi.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),gn.registerComponent("SeekBar",Yi);var Qi=function(e){function t(t,r){var n;return(n=e.call(this,t,r)||this).handleMouseMove=Qr(Yr(s(n),n.handleMouseMove),Kr),n.throttledHandleMouseSeek=Qr(Yr(s(n),n.handleMouseSeek),Kr),n.handleMouseUpHandler_=function(e){return n.handleMouseUp(e)},n.handleMouseDownHandler_=function(e){return n.handleMouseDown(e)},n.enable(),n}l(t,e);var r=t.prototype;return r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},r.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var r=t.getChild("playProgressBar"),n=t.getChild("mouseTimeDisplay");if(r||n){var i=t.el(),o=pr(i),a=dr(i,e).x;a=Hi(a,0,1),n&&n.update(o,a),r&&r.update(o,t.getProgress())}}},r.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},r.enabled=function(){return this.enabled_},r.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&&kn(this.player_.play())}},r.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)},r.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_)},r.handleMouseDown=function(e){var t=this.el_.ownerDocument,r=this.getChild("seekBar");r&&r.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_)},r.handleMouseUp=function(e){var t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()},t}(gn);Qi.prototype.options_={children:["seekBar"]},gn.registerComponent("ProgressControl",Qi);var $i=function(e){function t(t,r){var n;return(n=e.call(this,t,r)||this).on(t,["enterpictureinpicture","leavepictureinpicture"],(function(e){return n.handlePictureInPictureChange(e)})),n.on(t,["disablepictureinpicturechanged","loadedmetadata"],(function(e){return n.handlePictureInPictureEnabledChange(e)})),n.disable(),n}l(t,e);var r=t.prototype;return r.buildCSSClass=function(){return"vjs-picture-in-picture-control "+e.prototype.buildCSSClass.call(this)},r.handlePictureInPictureEnabledChange=function(){o().pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable()},r.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},r.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},t}(Pi);$i.prototype.controlText_="Picture-in-Picture",gn.registerComponent("PictureInPictureToggle",$i);var Ji=function(e){function t(t,r){var n;return(n=e.call(this,t,r)||this).on(t,"fullscreenchange",(function(e){return n.handleFullscreenChange(e)})),!1===o()[t.fsApi_.fullscreenEnabled]&&n.disable(),n}l(t,e);var r=t.prototype;return r.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},r.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},r.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(Pi);Ji.prototype.controlText_="Fullscreen",gn.registerComponent("FullscreenToggle",Ji);var Zi=function(e){function t(){return e.apply(this,arguments)||this}return l(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})},t}(gn);gn.registerComponent("VolumeLevel",Zi);var eo=function(e){function t(t,r){var n;return(n=e.call(this,t,r)||this).update=Qr(Yr(s(n),n.update),Kr),n}l(t,e);var r=t.prototype;return r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},r.update=function(e,t,r,n){if(!r){var i=hr(this.el_),o=hr(this.player_.el()),a=e.width*t;if(!o||!i)return;var s=e.left-o.left+a,u=e.width-a+(o.right-e.right),l=i.width/2;s<l?l+=l-s:u<l&&(l=u),l<0?l=0:l>i.width&&(l=i.width),this.el_.style.right="-"+l+"px"}this.write(n+"%")},r.write=function(e){Zt(this.el_,e)},r.updateVolume=function(e,t,r,n,i){var o=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",(function(){o.update(e,t,r,n.toFixed(0)),i&&i()}))},t}(gn);gn.registerComponent("VolumeLevelTooltip",eo);var to=function(e){function t(t,r){var n;return(n=e.call(this,t,r)||this).update=Qr(Yr(s(n),n.update),Kr),n}l(t,e);var r=t.prototype;return r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},r.update=function(e,t,r){var n=this,i=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,r,i,(function(){r?n.el_.style.bottom=e.height*t+"px":n.el_.style.left=e.width*t+"px"}))},t}(gn);to.prototype.options_={children:["volumeLevelTooltip"]},gn.registerComponent("MouseVolumeLevelDisplay",to);var ro=function(e){function t(t,r){var n;return(n=e.call(this,t,r)||this).on("slideractive",(function(e){return n.updateLastVolume_(e)})),n.on(t,"volumechange",(function(e){return n.updateARIAAttributes(e)})),t.ready((function(){return n.updateARIAAttributes()})),n}l(t,e);var r=t.prototype;return r.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"})},r.handleMouseDown=function(t){_r(t)&&e.prototype.handleMouseDown.call(this,t)},r.handleMouseMove=function(e){var t=this.getChild("mouseVolumeLevelDisplay");if(t){var r=this.el(),n=hr(r),i=this.vertical(),o=dr(r,e);o=i?o.y:o.x,o=Hi(o,0,1),t.update(n,o,i)}_r(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},r.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},r.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},r.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},r.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},r.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},r.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},r.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",(function(){0===e.player_.volume()&&e.player_.lastVolume_(t)}))},t}(qi);ro.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},qt||jt||ro.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),ro.prototype.playerEvent="volumechange",gn.registerComponent("VolumeBar",ro);var no=function(e){function t(t,r){var n;return void 0===r&&(r={}),r.vertical=r.vertical||!1,(void 0===r.volumeBar||_t(r.volumeBar))&&(r.volumeBar=r.volumeBar||{},r.volumeBar.vertical=r.vertical),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")}))}(s(n=e.call(this,t,r)||this),t),n.throttledHandleMouseMove=Qr(Yr(s(n),n.handleMouseMove),Kr),n.handleMouseUpHandler_=function(e){return n.handleMouseUp(e)},n.on("mousedown",(function(e){return n.handleMouseDown(e)})),n.on("touchstart",(function(e){return n.handleMouseDown(e)})),n.on("mousemove",(function(e){return n.handleMouseMove(e)})),n.on(n.volumeBar,["focus","slideractive"],(function(){n.volumeBar.addClass("vjs-slider-active"),n.addClass("vjs-slider-active"),n.trigger("slideractive")})),n.on(n.volumeBar,["blur","sliderinactive"],(function(){n.volumeBar.removeClass("vjs-slider-active"),n.removeClass("vjs-slider-active"),n.trigger("sliderinactive")})),n}l(t,e);var r=t.prototype;return r.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})},r.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_)},r.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_)},r.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(gn);no.prototype.options_={children:["volumeBar"]},gn.registerComponent("VolumeControl",no);var io=function(e){function t(t,r){var n;return 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")}))}(s(n=e.call(this,t,r)||this),t),n.on(t,["loadstart","volumechange"],(function(e){return n.update(e)})),n}l(t,e);var r=t.prototype;return r.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},r.handleClick=function(e){var t=this.player_.volume(),r=this.player_.lastVolume_();if(0===t){var n=r<.1?.1:r;this.player_.volume(n),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},r.update=function(e){this.updateIcon_(),this.updateControlText_()},r.updateIcon_=function(){var e=this.player_.volume(),t=3;qt&&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 r=0;r<4;r++)nr(this.el_,"vjs-vol-"+r);rr(this.el_,"vjs-vol-"+t)},r.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},t}(Pi);io.prototype.controlText_="Mute",gn.registerComponent("MuteToggle",io);var oo=function(e){function t(t,r){var n;return void 0===r&&(r={}),void 0!==r.inline?r.inline=r.inline:r.inline=!0,(void 0===r.volumeControl||_t(r.volumeControl))&&(r.volumeControl=r.volumeControl||{},r.volumeControl.vertical=!r.inline),(n=e.call(this,t,r)||this).handleKeyPressHandler_=function(e){return n.handleKeyPress(e)},n.on(t,["loadstart"],(function(e){return n.volumePanelState_(e)})),n.on(n.muteToggle,"keyup",(function(e){return n.handleKeyPress(e)})),n.on(n.volumeControl,"keyup",(function(e){return n.handleVolumeControlKeyUp(e)})),n.on("keydown",(function(e){return n.handleKeyPress(e)})),n.on("mouseover",(function(e){return n.handleMouseOver(e)})),n.on("mouseout",(function(e){return n.handleMouseOut(e)})),n.on(n.volumeControl,["slideractive"],n.sliderActive_),n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_),n}l(t,e);var r=t.prototype;return r.sliderActive_=function(){this.addClass("vjs-slider-active")},r.sliderInactive_=function(){this.removeClass("vjs-slider-active")},r.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")},r.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})},r.dispose=function(){this.handleMouseOut(),e.prototype.dispose.call(this)},r.handleVolumeControlKeyUp=function(e){p().isEventKey(e,"Esc")&&this.muteToggle.focus()},r.handleMouseOver=function(e){this.addClass("vjs-hover"),Vr(o(),"keyup",this.handleKeyPressHandler_)},r.handleMouseOut=function(e){this.removeClass("vjs-hover"),Hr(o(),"keyup",this.handleKeyPressHandler_)},r.handleKeyPress=function(e){p().isEventKey(e,"Esc")&&this.handleMouseOut()},t}(gn);oo.prototype.options_={children:["muteToggle","volumeControl"]},gn.registerComponent("VolumePanel",oo);var ao=function(e){function t(t,r){var n;return n=e.call(this,t,r)||this,r&&(n.menuButton_=r.menuButton),n.focusedChild_=-1,n.on("keydown",(function(e){return n.handleKeyDown(e)})),n.boundHandleBlur_=function(e){return n.handleBlur(e)},n.boundHandleTapClick_=function(e){return n.handleTapClick(e)},n}l(t,e);var r=t.prototype;return r.addEventListenerForItem=function(e){e instanceof gn&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},r.removeEventListenerForItem=function(e){e instanceof gn&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},r.removeChild=function(t){"string"==typeof t&&(t=this.getChild(t)),this.removeEventListenerForItem(t),e.prototype.removeChild.call(this,t)},r.addItem=function(e){var t=this.addChild(e);t&&this.addEventListenerForItem(t)},r.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=Jt(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var r=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return r.appendChild(this.contentEl_),Vr(r,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),r},r.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,e.prototype.dispose.call(this)},r.handleBlur=function(e){var t=e.relatedTarget||o().activeElement;if(!this.children().some((function(e){return e.el()===t}))){var r=this.menuButton_;r&&r.buttonPressed_&&t!==r.el().firstChild&&r.unpressButton()}},r.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var t=this.children();if(!Array.isArray(t))return;var r=t.filter((function(t){return t.el()===e.target}))[0];if(!r)return;"CaptionSettingsMenuItem"!==r.name()&&this.menuButton_.focus()}},r.handleKeyDown=function(e){p().isEventKey(e,"Left")||p().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(p().isEventKey(e,"Right")||p().isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},r.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},r.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},r.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}(gn);gn.registerComponent("Menu",ao);var so=function(e){function t(t,r){var n;void 0===r&&(r={}),(n=e.call(this,t,r)||this).menuButton_=new Pi(t,r),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true");var i=Pi.prototype.buildCSSClass();n.menuButton_.el_.className=n.buildCSSClass()+" "+i,n.menuButton_.removeClass("vjs-control"),n.addChild(n.menuButton_),n.update(),n.enabled_=!0;var a=function(e){return n.handleClick(e)};return n.handleMenuKeyUp_=function(e){return n.handleMenuKeyUp(e)},n.on(n.menuButton_,"tap",a),n.on(n.menuButton_,"click",a),n.on(n.menuButton_,"keydown",(function(e){return n.handleKeyDown(e)})),n.on(n.menuButton_,"mouseenter",(function(){n.addClass("vjs-hover"),n.menu.show(),Vr(o(),"keyup",n.handleMenuKeyUp_)})),n.on("mouseleave",(function(e){return n.handleMouseLeave(e)})),n.on("keydown",(function(e){return n.handleSubmenuKeyDown(e)})),n}l(t,e);var r=t.prototype;return r.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()},r.createMenu=function(){var e=new ao(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=Jt("li",{className:"vjs-menu-title",innerHTML:hn(this.options_.title),tabIndex:-1}),r=new gn(this.player_,{el:t});e.addItem(r)}if(this.items=this.createItems(),this.items)for(var n=0;n<this.items.length;n++)e.addItem(this.items[n]);return e},r.createItems=function(){},r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},r.buildWrapperCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+Pi.prototype.buildCSSClass()+" "+e.prototype.buildCSSClass.call(this)},r.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)},r.controlText=function(e,t){return void 0===t&&(t=this.menuButton_.el()),this.menuButton_.controlText(e,t)},r.dispose=function(){this.handleMouseLeave(),e.prototype.dispose.call(this)},r.handleClick=function(e){this.buttonPressed_?this.unpressButton():this.pressButton()},r.handleMouseLeave=function(e){this.removeClass("vjs-hover"),Hr(o(),"keyup",this.handleMenuKeyUp_)},r.focus=function(){this.menuButton_.focus()},r.blur=function(){this.menuButton_.blur()},r.handleKeyDown=function(e){p().isEventKey(e,"Esc")||p().isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),p().isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(p().isEventKey(e,"Up")||p().isEventKey(e,"Down"))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))},r.handleMenuKeyUp=function(e){(p().isEventKey(e,"Esc")||p().isEventKey(e,"Tab"))&&this.removeClass("vjs-hover")},r.handleSubmenuKeyPress=function(e){this.handleSubmenuKeyDown(e)},r.handleSubmenuKeyDown=function(e){(p().isEventKey(e,"Esc")||p().isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),p().isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus()))},r.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),qt&&Qt())return;this.menu.focus()}},r.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},r.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},r.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},t}(gn);gn.registerComponent("MenuButton",so);var uo=function(e){function t(t,r){var n,i=r.tracks;if((n=e.call(this,t,r)||this).items.length<=1&&n.hide(),!i)return s(n);var o=Yr(s(n),n.update);return i.addEventListener("removetrack",o),i.addEventListener("addtrack",o),i.addEventListener("labelchange",o),n.player_.on("ready",o),n.player_.on("dispose",(function(){i.removeEventListener("removetrack",o),i.removeEventListener("addtrack",o),i.removeEventListener("labelchange",o)})),n}return l(t,e),t}(so);gn.registerComponent("TrackButton",uo);var lo=["Tab","Esc","Up","Down","Right","Left"],co=function(e){function t(t,r){var n;return(n=e.call(this,t,r)||this).selectable=r.selectable,n.isSelected_=r.selected||!1,n.multiSelectable=r.multiSelectable,n.selected(n.isSelected_),n.selectable?n.multiSelectable?n.el_.setAttribute("role","menuitemcheckbox"):n.el_.setAttribute("role","menuitemradio"):n.el_.setAttribute("role","menuitem"),n}l(t,e);var r=t.prototype;return r.createEl=function(t,r,n){return this.nonIconControl=!0,e.prototype.createEl.call(this,"li",gt({className:"vjs-menu-item",innerHTML:'<span class="vjs-menu-item-text">'+this.localize(this.options_.label)+"</span>",tabIndex:-1},r),n)},r.handleKeyDown=function(t){lo.some((function(e){return p().isEventKey(t,e)}))||e.prototype.handleKeyDown.call(this,t)},r.handleClick=function(e){this.selected(!0)},r.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}(_i);gn.registerComponent("MenuItem",co);var fo=function(e){function r(r,n){var i,a=n.track,u=r.textTracks();n.label=a.label||a.language||"Unknown",n.selected="showing"===a.mode,(i=e.call(this,r,n)||this).track=a,i.kinds=(n.kinds||[n.kind||i.track.kind]).filter(Boolean);var l,c=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.handleTracksChange.apply(s(i),t)},f=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.handleSelectedLanguageChange.apply(s(i),t)};return r.on(["loadstart","texttrackchange"],c),u.addEventListener("change",c),u.addEventListener("selectedlanguagechange",f),i.on("dispose",(function(){r.off(["loadstart","texttrackchange"],c),u.removeEventListener("change",c),u.removeEventListener("selectedlanguagechange",f)})),void 0===u.onchange&&i.on(["tap","click"],(function(){if("object"!=typeof t().Event)try{l=new(t().Event)("change")}catch(e){}l||(l=o().createEvent("Event")).initEvent("change",!0,!0),u.dispatchEvent(l)})),i.handleTracksChange(),i}l(r,e);var n=r.prototype;return n.handleClick=function(t){var r=this.track,n=this.player_.textTracks();if(e.prototype.handleClick.call(this,t),n)for(var i=0;i<n.length;i++){var o=n[i];-1!==this.kinds.indexOf(o.kind)&&(o===r?"showing"!==o.mode&&(o.mode="showing"):"disabled"!==o.mode&&(o.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)},r}(co);gn.registerComponent("TextTrackMenuItem",fo);var ho=function(e){function t(t,r){return r.track={player:t,kind:r.kind,kinds:r.kinds,default:!1,mode:"disabled"},r.kinds||(r.kinds=[r.kind]),r.label?r.track.label=r.label:r.track.label=r.kinds.join(" and ")+" off",r.selectable=!0,r.multiSelectable=!1,e.call(this,t,r)||this}l(t,e);var r=t.prototype;return r.handleTracksChange=function(e){for(var t=this.player().textTracks(),r=!0,n=0,i=t.length;n<i;n++){var o=t[n];if(this.options_.kinds.indexOf(o.kind)>-1&&"showing"===o.mode){r=!1;break}}r!==this.isSelected_&&this.selected(r)},r.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),r=!0,n=0,i=t.length;n<i;n++){var o=t[n];if(["captions","descriptions","subtitles"].indexOf(o.kind)>-1&&"showing"===o.mode){r=!1;break}}r&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(fo);gn.registerComponent("OffTextTrackMenuItem",ho);var po=function(e){function t(t,r){return void 0===r&&(r={}),r.tracks=t.textTracks(),e.call(this,t,r)||this}return l(t,e),t.prototype.createItems=function(e,t){var r;void 0===e&&(e=[]),void 0===t&&(t=fo),this.label_&&(r=this.label_+" off"),e.push(new ho(this.player_,{kinds:this.kinds_,kind:this.kind_,label:r})),this.hideThreshold_+=1;var n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var i=0;i<n.length;i++){var o=n[i];if(this.kinds_.indexOf(o.kind)>-1){var a=new t(this.player_,{track:o,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});a.addClass("vjs-"+o.kind+"-menu-item"),e.push(a)}}return e},t}(uo);gn.registerComponent("TextTrackButton",po);var yo=function(e){function t(t,r){var n,i=r.track,o=r.cue,a=t.currentTime();return r.selectable=!0,r.multiSelectable=!1,r.label=o.text,r.selected=o.startTime<=a&&a<o.endTime,(n=e.call(this,t,r)||this).track=i,n.cue=o,i.addEventListener("cuechange",Yr(s(n),n.update)),n}l(t,e);var r=t.prototype;return r.handleClick=function(t){e.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},r.update=function(e){var t=this.cue,r=this.player_.currentTime();this.selected(t.startTime<=r&&r<t.endTime)},t}(co);gn.registerComponent("ChaptersTrackMenuItem",yo);var mo=function(e){function t(t,r,n){return e.call(this,t,r,n)||this}l(t,e);var r=t.prototype;return r.buildCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildWrapperCSSClass.call(this)},r.update=function(t){this.track_&&(!t||"addtrack"!==t.type&&"removetrack"!==t.type)||this.setTrack(this.findChaptersTrack()),e.prototype.update.call(this)},r.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 r=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);r&&r.addEventListener("load",this.updateHandler_)}}},r.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],t=e.length-1;t>=0;t--){var r=e[t];if(r.kind===this.kind_)return r}},r.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(hn(this.kind_))},r.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},r.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var r=0,n=t.length;r<n;r++){var i=t[r],o=new yo(this.player_,{track:this.track_,cue:i});e.push(o)}return e},t}(po);mo.prototype.kind_="chapters",mo.prototype.controlText_="Chapters",gn.registerComponent("ChaptersButton",mo);var vo=function(e){function t(t,r,n){var i;i=e.call(this,t,r,n)||this;var o=t.textTracks(),a=Yr(s(i),i.handleTracksChange);return o.addEventListener("change",a),i.on("dispose",(function(){o.removeEventListener("change",a)})),i}l(t,e);var r=t.prototype;return r.handleTracksChange=function(e){for(var t=this.player().textTracks(),r=!1,n=0,i=t.length;n<i;n++){var o=t[n];if(o.kind!==this.kind_&&"showing"===o.mode){r=!0;break}}r?this.disable():this.enable()},r.buildCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(po);vo.prototype.kind_="descriptions",vo.prototype.controlText_="Descriptions",gn.registerComponent("DescriptionsButton",vo);var go=function(e){function t(t,r,n){return e.call(this,t,r,n)||this}l(t,e);var r=t.prototype;return r.buildCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(po);go.prototype.kind_="subtitles",go.prototype.controlText_="Subtitles",gn.registerComponent("SubtitlesButton",go);var bo=function(e){function t(t,r){var n;return r.track={player:t,kind:r.kind,label:r.kind+" settings",selectable:!1,default:!1,mode:"disabled"},r.selectable=!1,r.name="CaptionSettingsMenuItem",(n=e.call(this,t,r)||this).addClass("vjs-texttrack-settings"),n.controlText(", opens "+r.kind+" settings dialog"),n}return l(t,e),t.prototype.handleClick=function(e){this.player().getChild("textTrackSettings").open()},t}(fo);gn.registerComponent("CaptionSettingsMenuItem",bo);var _o=function(e){function t(t,r,n){return e.call(this,t,r,n)||this}l(t,e);var r=t.prototype;return r.buildCSSClass=function(){return"vjs-captions-button "+e.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-captions-button "+e.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new bo(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),e.prototype.createItems.call(this,t)},t}(po);_o.prototype.kind_="captions",_o.prototype.controlText_="Captions",gn.registerComponent("CaptionsButton",_o);var wo=function(e){function t(){return e.apply(this,arguments)||this}return l(t,e),t.prototype.createEl=function(t,r,n){var i='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"captions"===this.options_.track.kind&&(i+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Captions")+"</span>\n "),i+="</span>",e.prototype.createEl.call(this,t,gt({innerHTML:i},r),n)},t}(fo);gn.registerComponent("SubsCapsMenuItem",wo);var To=function(e){function t(t,r){var n;return void 0===r&&(r={}),(n=e.call(this,t,r)||this).label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(n.player_.language_)>-1&&(n.label_="captions"),n.menuButton_.controlText(hn(n.label_)),n}l(t,e);var r=t.prototype;return r.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new bo(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e.prototype.createItems.call(this,t,wo)},t}(po);To.prototype.kinds_=["captions","subtitles"],To.prototype.controlText_="Subtitles",gn.registerComponent("SubsCapsButton",To);var So=function(e){function t(t,r){var n,i=r.track,o=t.audioTracks();r.label=i.label||i.language||"Unknown",r.selected=i.enabled,(n=e.call(this,t,r)||this).track=i,n.addClass("vjs-"+i.kind+"-menu-item");var a=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n.handleTracksChange.apply(s(n),t)};return o.addEventListener("change",a),n.on("dispose",(function(){o.removeEventListener("change",a)})),n}l(t,e);var r=t.prototype;return r.createEl=function(t,r,n){var i='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"main-desc"===this.options_.track.kind&&(i+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Descriptions")+"</span>\n "),i+="</span>",e.prototype.createEl.call(this,t,gt({innerHTML:i},r),n)},r.handleClick=function(t){e.prototype.handleClick.call(this,t),this.track.enabled=!0},r.handleTracksChange=function(e){this.selected(this.track.enabled)},t}(co);gn.registerComponent("AudioTrackMenuItem",So);var Eo=function(e){function t(t,r){return void 0===r&&(r={}),r.tracks=t.audioTracks(),e.call(this,t,r)||this}l(t,e);var r=t.prototype;return r.buildCSSClass=function(){return"vjs-audio-button "+e.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-audio-button "+e.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(e){void 0===e&&(e=[]),this.hideThreshold_=1;for(var t=this.player_.audioTracks(),r=0;r<t.length;r++){var n=t[r];e.push(new So(this.player_,{track:n,selectable:!0,multiSelectable:!1}))}return e},t}(uo);Eo.prototype.controlText_="Audio Track",gn.registerComponent("AudioTrackButton",Eo);var Oo=function(e){function t(t,r){var n,i=r.rate,o=parseFloat(i,10);return r.label=i,r.selected=1===o,r.selectable=!0,r.multiSelectable=!1,(n=e.call(this,t,r)||this).label=i,n.rate=o,n.on(t,"ratechange",(function(e){return n.update(e)})),n}l(t,e);var r=t.prototype;return r.handleClick=function(t){e.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},r.update=function(e){this.selected(this.player().playbackRate()===this.rate)},t}(co);Oo.prototype.contentElType="button",gn.registerComponent("PlaybackRateMenuItem",Oo);var ko=function(e){function t(t,r){var n;return(n=e.call(this,t,r)||this).menuButton_.el_.setAttribute("aria-describedby",n.labelElId_),n.updateVisibility(),n.updateLabel(),n.on(t,"loadstart",(function(e){return n.updateVisibility(e)})),n.on(t,"ratechange",(function(e){return n.updateLabel(e)})),n}l(t,e);var r=t.prototype;return r.createEl=function(){var t=e.prototype.createEl.call(this);return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=Jt("div",{className:"vjs-playback-rate-value",id:this.labelElId_,innerHTML:"1x"}),t.appendChild(this.labelEl_),t},r.dispose=function(){this.labelEl_=null,e.prototype.dispose.call(this)},r.buildCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildWrapperCSSClass.call(this)},r.createMenu=function(){var e=new ao(this.player()),t=this.playbackRates();if(t)for(var r=t.length-1;r>=0;r--)e.addChild(new Oo(this.player(),{rate:t[r]+"x"}));return e},r.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},r.handleClick=function(e){for(var t=this.player().playbackRate(),r=this.playbackRates(),n=r[0],i=0;i<r.length;i++)if(r[i]>t){n=r[i];break}this.player().playbackRate(n)},r.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates},r.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},r.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},r.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},t}(so);ko.prototype.controlText_="Playback Rate",gn.registerComponent("PlaybackRateMenuButton",ko);var Co=function(e){function t(){return e.apply(this,arguments)||this}l(t,e);var r=t.prototype;return r.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},t}(gn);gn.registerComponent("Spacer",Co);var Po=function(e){function t(){return e.apply(this,arguments)||this}l(t,e);var r=t.prototype;return r.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},r.createEl=function(){var t=e.prototype.createEl.call(this,{className:this.buildCSSClass()});return t.innerHTML=" ",t},t}(Co);gn.registerComponent("CustomControlSpacer",Po);var xo=function(e){function t(){return e.apply(this,arguments)||this}return l(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(gn);xo.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in o()&&xo.prototype.options_.children.splice(xo.prototype.options_.children.length-1,0,"pictureInPictureToggle"),gn.registerComponent("ControlBar",xo);var jo=function(e){function t(t,r){var n;return(n=e.call(this,t,r)||this).on(t,"error",(function(e){return n.open(e)})),n}l(t,e);var r=t.prototype;return r.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},r.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(xn);jo.prototype.options_=a({},xn.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),gn.registerComponent("ErrorDisplay",jo);var Lo="vjs-text-track-settings",Io=["#000","Black"],Ao=["#00F","Blue"],Ro=["#0FF","Cyan"],Do=["#0F0","Green"],Mo=["#F0F","Magenta"],No=["#F00","Red"],Bo=["#FFF","White"],Uo=["#FF0","Yellow"],Fo=["1","Opaque"],Vo=["0.5","Semi-Transparent"],Ho=["0","Transparent"],qo={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Io,Bo,No,Do,Ao,Uo,Mo,Ro]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[Fo,Vo,Ho]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Bo,Io,No,Do,Ao,Uo,Mo,Ro]},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:[Fo,Vo]},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:[Ho,Vo,Fo]}};function zo(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}qo.windowColor.options=qo.backgroundColor.options;var Wo=function(e){function r(t,r){var n;return r.temporary=!1,(n=e.call(this,t,r)||this).updateDisplay=n.updateDisplay.bind(s(n)),n.fill(),n.hasBeenOpened_=n.hasBeenFilled_=!0,n.endDialog=Jt("p",{className:"vjs-control-text",textContent:n.localize("End of dialog window.")}),n.el().appendChild(n.endDialog),n.setDefaults(),void 0===r.persistTextTrackSettings&&(n.options_.persistTextTrackSettings=n.options_.playerOptions.persistTextTrackSettings),n.on(n.$(".vjs-done-button"),"click",(function(){n.saveSettings(),n.close()})),n.on(n.$(".vjs-default-button"),"click",(function(){n.setDefaults(),n.updateDisplay()})),vt(qo,(function(e){n.on(n.$(e.selector),"change",n.updateDisplay)})),n.options_.persistTextTrackSettings&&n.restoreSettings(),n}l(r,e);var n=r.prototype;return n.dispose=function(){this.endDialog=null,e.prototype.dispose.call(this)},n.createElSelect_=function(e,t,r){var n=this;void 0===t&&(t=""),void 0===r&&(r="label");var i=qo[e],o=i.id.replace("%s",this.id_),a=[t,o].join(" ").trim();return["<"+r+' id="'+o+'" class="'+("label"===r?"vjs-label":"")+'">',this.localize(i.label),"</"+r+">",'<select aria-labelledby="'+a+'">'].concat(i.options.map((function(e){var t=o+"-"+e[1].replace(/\W+/g,"");return['<option id="'+t+'" value="'+e[0]+'" ','aria-labelledby="'+a+" "+t+'">',n.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 Jt("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},n.createElFont_=function(){return Jt("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 Jt("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,t,r,n=this;return t=function(e,t,r){var i,o,a=(i=n.$(t.selector),o=t.parser,zo(i.options[i.options.selectedIndex].value,o));return void 0!==a&&(e[r]=a),e},void 0===(r={})&&(r=0),mt(e=qo).reduce((function(r,n){return t(r,e[n],n)}),r)},n.setValues=function(e){var t=this;vt(qo,(function(r,n){!function(e,t,r){if(t)for(var n=0;n<e.options.length;n++)if(zo(e.options[n].value,r)===t){e.selectedIndex=n;break}}(t.$(r.selector),e[n],r.parser)}))},n.setDefaults=function(){var e=this;vt(qo,(function(t){var r=t.hasOwnProperty("default")?t.default:0;e.$(t.selector).selectedIndex=r}))},n.restoreSettings=function(){var e;try{e=JSON.parse(t().localStorage.getItem(Lo))}catch(e){pt.warn(e)}e&&this.setValues(e)},n.saveSettings=function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?t().localStorage.setItem(Lo,JSON.stringify(e)):t().localStorage.removeItem(Lo)}catch(e){pt.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,r=e&&e.captionsButton;t?t.focus():r&&r.focus()},r}(xn);gn.registerComponent("TextTrackSettings",Wo);var Go=function(e){function r(r,n){var i,o=n.ResizeObserver||t().ResizeObserver;null===n.ResizeObserver&&(o=!1);var a=pn({createEl:!o,reportTouchActivity:!1},n);return(i=e.call(this,r,a)||this).ResizeObserver=n.ResizeObserver||t().ResizeObserver,i.loadListener_=null,i.resizeObserver_=null,i.debouncedHandler_=function(e,r,n,i){var o;void 0===i&&(i=t());var a=function(){var t=this,r=arguments,n=function(){o=null,n=null,e.apply(t,r)};i.clearTimeout(o),o=i.setTimeout(n,100)};return a.cancel=function(){i.clearTimeout(o),o=null},a}((function(){i.resizeHandler()}),0,0,s(i)),o?(i.resizeObserver_=new i.ResizeObserver(i.debouncedHandler_),i.resizeObserver_.observe(r.el())):(i.loadListener_=function(){if(i.el_&&i.el_.contentWindow){var e=i.debouncedHandler_,t=i.unloadListener_=function(){Hr(this,"resize",e),Hr(this,"unload",t),t=null};Vr(i.el_.contentWindow,"unload",t),Vr(i.el_.contentWindow,"resize",e)}},i.one("load",i.loadListener_)),i}l(r,e);var n=r.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)},r}(gn);gn.registerComponent("ResizeManager",Go);var Xo={trackingThreshold:30,liveTolerance:15},Ko=function(e){function r(t,r){var n,i=pn(Xo,r,{createEl:!1});return(n=e.call(this,t,i)||this).handleVisibilityChange_=function(e){return n.handleVisibilityChange(e)},n.trackLiveHandler_=function(){return n.trackLive_()},n.handlePlay_=function(e){return n.handlePlay(e)},n.handleFirstTimeupdate_=function(e){return n.handleFirstTimeupdate(e)},n.handleSeeked_=function(e){return n.handleSeeked(e)},n.seekToLiveEdge_=function(e){return n.seekToLiveEdge(e)},n.reset_(),n.on(n.player_,"durationchange",(function(e){return n.handleDurationchange(e)})),n.one(n.player_,"canplay",(function(){return n.toggleTracking()})),Nt&&"hidden"in o()&&"visibilityState"in o()&&n.on(o(),"visibilitychange",n.handleVisibilityChange_),n}l(r,e);var n=r.prototype;return n.handleVisibilityChange=function(){this.player_.duration()===1/0&&(o().hidden?this.stopTracking():this.startTracking())},n.trackLive_=function(){var e=this.player_.seekable();if(e&&e.length){var r=Number(t().performance.now().toFixed(4)),n=-1===this.lastTime_?0:(r-this.lastTime_)/1e3;this.lastTime_=r,this.pastSeekEnd_=this.pastSeekEnd()+n;var i=this.liveCurrentTime(),o=this.player_.currentTime(),a=this.player_.paused()||this.seekedBehindLive_||Math.abs(i-o)>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_,Kr),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=[],r=e?e.length:0;r--;)t.push(e.end(r));return t.length?t.sort()[t.length-1]:1/0},n.seekableStart=function(){for(var e=this.player_.seekable(),t=[],r=e?e.length:0;r--;)t.push(e.start(r));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(o(),"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),e.prototype.dispose.call(this)},r}(gn);gn.registerComponent("LiveTracker",Ko);var Yo,Qo=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var r=e.$$("source"),n=[],i="";if(!r.length)return!1;for(var o=0;o<r.length;o++){var a=r[o].src;a&&-1===n.indexOf(a)&&n.push(a)}return!!n.length&&(1===n.length&&(i=n[0]),e.triggerSourceset(i),!0)},$o=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(e){var r=o().createElement(this.nodeName.toLowerCase());r.innerHTML=e;for(var n=o().createDocumentFragment();r.childNodes.length;)n.appendChild(r.childNodes[0]);return this.innerText="",t().Element.prototype.appendChild.call(this,n),this.innerHTML}}),Jo=function(e,t){for(var r={},n=0;n<e.length&&!((r=Object.getOwnPropertyDescriptor(e[n],t))&&r.set&&r.get);n++);return r.enumerable=!0,r.configurable=!0,r},Zo=function(e){var r=e.el();if(!r.resetSourceWatch_){var n={},i=function(e){return Jo([e.el(),t().HTMLMediaElement.prototype,t().Element.prototype,$o],"innerHTML")}(e),o=function(t){return function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];var a=t.apply(r,i);return Qo(e),a}};["append","appendChild","insertAdjacentHTML"].forEach((function(e){r[e]&&(n[e]=r[e],r[e]=o(n[e]))})),Object.defineProperty(r,"innerHTML",pn(i,{set:o(i.set)})),r.resetSourceWatch_=function(){r.resetSourceWatch_=null,Object.keys(n).forEach((function(e){r[e]=n[e]})),Object.defineProperty(r,"innerHTML",i)},e.one("sourceset",r.resetSourceWatch_)}},ea=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?Wn(t().Element.prototype.getAttribute.call(this,"src")):""},set:function(e){return t().Element.prototype.setAttribute.call(this,"src",e),e}}),ta=function(e,t,r,n){void 0===n&&(n=!0);var i=function(r){return Object.defineProperty(e,t,{value:r,enumerable:!0,writable:!0})},o={configurable:!0,enumerable:!0,get:function(){var e=r();return i(e),e}};return n&&(o.set=i),Object.defineProperty(e,t,o)},ra=function(e){function r(t,r){var n;n=e.call(this,t,r)||this;var i=t.source,o=!1;if(i&&(n.el_.currentSrc!==i.src||t.tag&&3===t.tag.initNetworkState_)?n.setSource(i):n.handleLateInit_(n.el_),t.enableSourceset&&n.setupSourcesetHandling_(),n.isScrubbing_=!1,n.el_.hasChildNodes()){for(var a=n.el_.childNodes,s=a.length,u=[];s--;){var l=a[s];"track"===l.nodeName.toLowerCase()&&(n.featuresNativeTextTracks?(n.remoteTextTrackEls().addTrackElement_(l),n.remoteTextTracks().addTrack(l.track),n.textTracks().addTrack(l.track),o||n.el_.hasAttribute("crossorigin")||!Xn(l.src)||(o=!0)):u.push(l))}for(var c=0;c<u.length;c++)n.el_.removeChild(u[c])}return n.proxyNativeTracks_(),n.featuresNativeTextTracks&&o&&pt.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),n.restoreMetadataTracksInIOSNativePlayer_(),(Ft||Ht||It)&&!0===t.nativeControlsForTouch&&n.setControls(!0),n.proxyWebkitFullscreen_(),n.triggerReady(),n}l(r,e);var n=r.prototype;return n.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),r.disposeMediaElement(this.el_),this.options_=null,e.prototype.dispose.call(this)},n.setupSourcesetHandling_=function(){!function(e){if(e.featuresSourceset){var r=e.el();if(!r.resetSourceset_){var n=function(e){return Jo([e.el(),t().HTMLMediaElement.prototype,ea],"src")}(e),i=r.setAttribute,o=r.load;Object.defineProperty(r,"src",pn(n,{set:function(t){var i=n.set.call(r,t);return e.triggerSourceset(r.src),i}})),r.setAttribute=function(t,n){var o=i.call(r,t,n);return/src/i.test(t)&&e.triggerSourceset(r.src),o},r.load=function(){var t=o.call(r);return Qo(e)||(e.triggerSourceset(""),Zo(e)),t},r.currentSrc?e.triggerSourceset(r.currentSrc):Qo(e)||Zo(e),r.resetSourceset_=function(){r.resetSourceset_=null,r.load=o,r.setAttribute=i,Object.defineProperty(r,"src",n),r.resetSourceWatch_&&r.resetSourceWatch_()}}}}(this)},n.restoreMetadataTracksInIOSNativePlayer_=function(){var e,t=this.textTracks(),r=function(){e=[];for(var r=0;r<t.length;r++){var n=t[r];"metadata"===n.kind&&e.push({track:n,storedMode:n.mode})}};r(),t.addEventListener("change",r),this.on("dispose",(function(){return t.removeEventListener("change",r)}));var n=function r(){for(var n=0;n<e.length;n++){var i=e[n];"disabled"===i.track.mode&&i.track.mode!==i.storedMode&&(i.track.mode=i.storedMode)}t.removeEventListener("change",r)};this.on("webkitbeginfullscreen",(function(){t.removeEventListener("change",r),t.removeEventListener("change",n),t.addEventListener("change",n)})),this.on("webkitendfullscreen",(function(){t.removeEventListener("change",r),t.addEventListener("change",r),t.removeEventListener("change",n)}))},n.overrideNative_=function(e,t){var r=this;if(t===this["featuresNative"+e+"Tracks"]){var n=e.toLowerCase();this[n+"TracksListeners_"]&&Object.keys(this[n+"TracksListeners_"]).forEach((function(e){r.el()[n+"Tracks"].removeEventListener(e,r[n+"TracksListeners_"][e])})),this["featuresNative"+e+"Tracks"]=!t,this[n+"TracksListeners_"]=null,this.proxyNativeTracksForType_(n)}},n.overrideNativeAudioTracks=function(e){this.overrideNative_("Audio",e)},n.overrideNativeVideoTracks=function(e){this.overrideNative_("Video",e)},n.proxyNativeTracksForType_=function(e){var t=this,r=ti[e],n=this.el()[r.getterName],i=this[r.getterName]();if(this["featuresNative"+r.capitalName+"Tracks"]&&n&&n.addEventListener){var o={change:function(r){var n={type:"change",target:i,currentTarget:i,srcElement:i};i.trigger(n),"text"===e&&t[ri.remoteText.getterName]().trigger(n)},addtrack:function(e){i.addTrack(e.track)},removetrack:function(e){i.removeTrack(e.track)}},a=function(){for(var e=[],t=0;t<i.length;t++){for(var r=!1,o=0;o<n.length;o++)if(n[o]===i[t]){r=!0;break}r||e.push(i[t])}for(;e.length;)i.removeTrack(e.shift())};this[r.getterName+"Listeners_"]=o,Object.keys(o).forEach((function(e){var r=o[e];n.addEventListener(e,r),t.on("dispose",(function(t){return n.removeEventListener(e,r)}))})),this.on("loadstart",a),this.on("dispose",(function(e){return t.off("loadstart",a)}))}},n.proxyNativeTracks_=function(){var e=this;ti.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 t=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(t,e),r.disposeMediaElement(e),e=t}else{e=o().createElement("video");var n=pn({},this.options_.tag&&ar(this.options_.tag));Ft&&!0===this.options_.nativeControlsForTouch||delete n.controls,or(e,gt(n,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}void 0!==this.options_.preload&&ur(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);for(var i=["loop","muted","playsinline","autoplay"],a=0;a<i.length;a++){var s=i[a],u=this.options_[s];void 0!==u&&(u?ur(e,s,s):lr(e,s),e[s]=u)}return e},n.handleLateInit_=function(e){if(0!==e.networkState&&3!==e.networkState){if(0===e.readyState){var t=!1,r=function(){t=!0};this.on("loadstart",r);var n=function(){t||this.trigger("loadstart")};return this.on("loadedmetadata",n),void this.ready((function(){this.off("loadstart",r),this.off("loadedmetadata",n),t||this.trigger("loadstart")}))}var i=["loadstart"];i.push("loadedmetadata"),e.readyState>=2&&i.push("loadeddata"),e.readyState>=3&&i.push("canplay"),e.readyState>=4&&i.push("canplaythrough"),this.ready((function(){i.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&&zt?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){pt(e,"Video is not ready. (Video.js)")}},n.duration=function(){var e=this;return this.el_.duration===1/0&&jt&&Dt&&0===this.el_.currentTime?(this.on("timeupdate",(function t(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t))})),NaN):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})},r=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",r),this.on("dispose",(function(){e.off("webkitbeginfullscreen",r),e.off("webkitendfullscreen",t)}))}},n.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=t().navigator&&t().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)kn(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(){r.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,r,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,r,n):e.prototype.addTextTrack.call(this,t,r,n)},n.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var r=o().createElement("track");return t.kind&&(r.kind=t.kind),t.label&&(r.label=t.label),(t.language||t.srclang)&&(r.srclang=t.language||t.srclang),t.default&&(r.default=t.default),t.id&&(r.id=t.id),t.src&&(r.src=t.src),r},n.addRemoteTextTrack=function(t,r){var n=e.prototype.addRemoteTextTrack.call(this,t,r);return this.featuresNativeTextTracks&&this.el().appendChild(n),n},n.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks)for(var r=this.$$("track"),n=r.length;n--;)t!==r[n]&&t!==r[n].track||this.el().removeChild(r[n])},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),t().performance&&"function"==typeof t().performance.now?e.creationTime=t().performance.now():t().performance&&t().performance.timing&&"number"==typeof t().performance.timing.navigationStart&&(e.creationTime=t().Date.now()-t().performance.timing.navigationStart),e},r}(ii);ta(ra,"TEST_VID",(function(){if(Kt()){var e=o().createElement("video"),t=o().createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e}})),ra.isSupported=function(){try{ra.TEST_VID.volume=.5}catch(e){return!1}return!(!ra.TEST_VID||!ra.TEST_VID.canPlayType)},ra.canPlayType=function(e){return ra.TEST_VID.canPlayType(e)},ra.canPlaySource=function(e,t){return ra.canPlayType(e.type)},ra.canControlVolume=function(){try{var e=ra.TEST_VID.volume;return ra.TEST_VID.volume=e/2+.1,e!==ra.TEST_VID.volume}catch(e){return!1}},ra.canMuteVolume=function(){try{var e=ra.TEST_VID.muted;return ra.TEST_VID.muted=!e,ra.TEST_VID.muted?ur(ra.TEST_VID,"muted","muted"):lr(ra.TEST_VID,"muted"),e!==ra.TEST_VID.muted}catch(e){return!1}},ra.canControlPlaybackRate=function(){if(jt&&Dt&&Mt<58)return!1;try{var e=ra.TEST_VID.playbackRate;return ra.TEST_VID.playbackRate=e/2+.1,e!==ra.TEST_VID.playbackRate}catch(e){return!1}},ra.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(o().createElement("video"),"src",{get:e,set:e}),Object.defineProperty(o().createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(o().createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(o().createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},ra.supportsNativeTextTracks=function(){return zt||qt&&Dt},ra.supportsNativeVideoTracks=function(){return!(!ra.TEST_VID||!ra.TEST_VID.videoTracks)},ra.supportsNativeAudioTracks=function(){return!(!ra.TEST_VID||!ra.TEST_VID.audioTracks)},ra.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],r=e[1];ta(ra.prototype,t,(function(){return ra[r]()}),!0)})),ra.prototype.movingMediaElementInDOM=!qt,ra.prototype.featuresFullscreenResize=!0,ra.prototype.featuresProgressEvents=!0,ra.prototype.featuresTimeupdateEvents=!0,ra.patchCanPlayType=function(){Lt>=4&&!At&&!Dt&&(Yo=ra.TEST_VID&&ra.TEST_VID.constructor.prototype.canPlayType,ra.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e)?"maybe":Yo.call(this,e)})},ra.unpatchCanPlayType=function(){var e=ra.TEST_VID.constructor.prototype.canPlayType;return Yo&&(ra.TEST_VID.constructor.prototype.canPlayType=Yo),e},ra.patchCanPlayType(),ra.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){}}()}},ra.resetMediaElement=function(e){if(e){for(var t=e.querySelectorAll("source"),r=t.length;r--;)e.removeChild(t[r]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){ra.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){ra.prototype["set"+hn(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){ra.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(e){ra.prototype["set"+hn(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){ra.prototype[e]=function(){return this.el_[e]()}})),ii.withSourceHandlers(ra),ra.nativeSourceHandler={},ra.nativeSourceHandler.canPlayType=function(e){try{return ra.TEST_VID.canPlayType(e)}catch(e){return""}},ra.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return ra.nativeSourceHandler.canPlayType(e.type);if(e.src){var r=Gn(e.src);return ra.nativeSourceHandler.canPlayType("video/"+r)}return""},ra.nativeSourceHandler.handleSource=function(e,t,r){t.setSrc(e.src)},ra.nativeSourceHandler.dispose=function(){},ra.registerSourceHandler(ra.nativeSourceHandler),ii.registerTech("Html5",ra);var na=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],ia={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},oa=["tiny","xsmall","small","medium","large","xlarge","huge"],aa={};oa.forEach((function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;aa[e]="vjs-layout-"+t}));var sa={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},ua=function(e){function r(t,n,i){var a;if(t.id=t.id||n.id||"vjs_video_"+Ar(),(n=gt(r.getTagSettings(t),n)).initChildren=!1,n.createEl=!1,n.evented=!1,n.reportTouchActivity=!1,!n.language)if("function"==typeof t.closest){var u=t.closest("[lang]");u&&u.getAttribute&&(n.language=u.getAttribute("lang"))}else for(var l=t;l&&1===l.nodeType;){if(ar(l).hasOwnProperty("lang")){n.language=l.getAttribute("lang");break}l=l.parentNode}if((a=e.call(this,null,n,i)||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=dt(a.id_),a.fsApi_=st,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=t,a.tagAttributes=t&&ar(t),a.language(a.options_.language),n.languages){var c={};Object.getOwnPropertyNames(n.languages).forEach((function(e){c[e.toLowerCase()]=n.languages[e]})),a.languages_=c}else a.languages_=r.prototype.options_.languages;a.resetCache_(),a.poster_=n.poster||"",a.controls_=!!n.controls,t.controls=!1,t.removeAttribute("controls"),a.changingSrc_=!1,a.playCallbacks_=[],a.playTerminatedQueue_=[],t.hasAttribute("autoplay")?a.autoplay(!0):a.autoplay(a.options_.autoplay),n.plugins&&Object.keys(n.plugins).forEach((function(e){if("function"!=typeof a[e])throw new Error('plugin "'+e+'" does not exist')})),a.scrubbing_=!1,a.el_=a.createEl(),un(s(a),{eventBusKey:"el_"}),a.fsApi_.requestFullscreen&&(Vr(o(),a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_),a.on(a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_)),a.fluid_&&a.on(["playerreset","resize"],a.boundUpdateStyleEl_);var f=pn(a.options_);n.plugins&&Object.keys(n.plugins).forEach((function(e){a[e](n.plugins[e])})),n.debug&&a.debug(!0),a.options_.playerOptions=f,a.middleware_=[],a.initChildren(),a.isAudio("audio"===t.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"),Ft&&a.addClass("vjs-touch-enabled"),qt||a.addClass("vjs-workinghover"),r.players[a.id_]=s(a);var h=at.split(".")[0];return a.addClass("vjs-v"+h),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}l(r,e);var n=r.prototype;return n.dispose=function(){var t=this;this.trigger("dispose"),this.off("dispose"),Hr(o(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Hr(o(),"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),r.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),ai[this.id()]=null,ni.names.forEach((function(e){var r=ni[e],n=t[r.getterName]();n&&n.off&&n.off()})),e.prototype.dispose.call(this)},n.createEl=function(){var r,n=this.tag,i=this.playerElIngest_=n.parentNode&&n.parentNode.hasAttribute&&n.parentNode.hasAttribute("data-vjs-player"),a="video-js"===this.tag.tagName.toLowerCase();i?r=this.el_=n.parentNode:a||(r=this.el_=e.prototype.createEl.call(this,"div"));var s=ar(n);if(a){for(r=this.el_=n,n=this.tag=o().createElement("video");r.children.length;)n.appendChild(r.firstChild);tr(r,"video-js")||rr(r,"video-js"),r.appendChild(n),i=this.playerElIngest_=r,Object.keys(r).forEach((function(e){try{n[e]=r[e]}catch(e){}}))}if(n.setAttribute("tabindex","-1"),s.tabindex="-1",(Nt||Dt&&Ut)&&(n.setAttribute("role","application"),s.role="application"),n.removeAttribute("width"),n.removeAttribute("height"),"width"in s&&delete s.width,"height"in s&&delete s.height,Object.getOwnPropertyNames(s).forEach((function(e){a&&"class"===e||r.setAttribute(e,s[e]),a&&n.setAttribute(e,s[e])})),n.playerId=n.id,n.id+="_html5_api",n.className="vjs-tech",n.player=r.player=this,this.addClass("vjs-paused"),!0!==t().VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=jr("vjs-styles-dimensions");var u=Tr(".vjs-styles-defaults"),l=Tr("head");l.insertBefore(this.styleEl_,u?u.nextSibling:l.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 c=n.getElementsByTagName("a"),f=0;f<c.length;f++){var h=c.item(f);rr(h,"vjs-hidden"),h.setAttribute("hidden","hidden")}return n.initNetworkState_=n.networkState,n.parentNode&&!i&&n.parentNode.insertBefore(r,n),er(n,r),this.children_.unshift(n),this.el_.setAttribute("lang",this.language_),this.el_=r,r},n.crossOrigin=function(e){if(!e)return this.techGet_("crossOrigin");"anonymous"===e||"use-credentials"===e?this.techCall_("setCrossOrigin",e):pt.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 r=e+"_";if(void 0===t)return this[r]||0;if(""===t||"auto"===t)return this[r]=void 0,void this.updateStyleEl_();var n=parseFloat(t);isNaN(n)?pt.error('Improper value "'+t+'" supplied for for '+e):(this[r]=n,this.updateStyleEl_())},n.fluid=function(e){var t,r,n=this;if(void 0===e)return!!this.fluid_;this.fluid_=!!e,Zr(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),r=function(){n.on(["playerreset","resize"],n.boundUpdateStyleEl_)},Zr(t=this)?r():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(r))):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!==t().VIDEOJS_NO_DYNAMIC_STYLE){var e,r,n,i=(void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),o=i[1]/i[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/o:this.videoWidth()||300,r=void 0!==this.height_?this.height_:e*o,n=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(n),Lr(this.styleEl_,"\n ."+n+" {\n width: "+e+"px;\n height: "+r+"px;\n }\n\n ."+n+".vjs-fluid {\n padding-top: "+100*o+"%;\n }\n ")}else{var a="number"==typeof this.width_?this.width_:this.options_.width,s="number"==typeof this.height_?this.height_:this.options_.height,u=this.tech_&&this.tech_.el();u&&(a>=0&&(u.width=a),s>=0&&(u.height=s))}},n.loadTech_=function(e,t){var r=this;this.tech_&&this.unloadTech_();var n=hn(e),i=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==n&&this.tag&&(ii.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;var o={source:t,autoplay:"string"!=typeof this.autoplay()&&this.autoplay(),nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+i+"_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};ni.names.forEach((function(e){var t=ni[e];o[t.getterName]=r[t.privateName]})),gt(o,this.options_[n]),gt(o,this.options_[i]),gt(o,this.options_[e.toLowerCase()]),this.tag&&(o.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(o.startTime=this.cache_.currentTime);var a,s,u=ii.getTech(e);if(!u)throw new Error("No Tech named '"+n+"' exists! '"+n+"' should be registered using videojs.registerTech()'");this.tech_=new u(o),this.tech_.ready(Yr(this,this.handleTechReady_),!0),a=this.textTracksJson_||[],s=this.tech_,a.forEach((function(e){var t=s.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach((function(e){return t.addCue(e)}))})),s.textTracks(),na.forEach((function(e){r.on(r.tech_,e,(function(t){return r["handleTech"+hn(e)+"_"](t)}))})),Object.keys(ia).forEach((function(e){r.on(r.tech_,e,(function(t){0===r.tech_.playbackRate()&&r.tech_.seeking()?r.queuedCallbacks_.push({callback:r["handleTech"+ia[e]+"_"].bind(r),event:t}):r["handleTech"+ia[e]+"_"](t)}))})),this.on(this.tech_,"loadstart",(function(e){return r.handleTechLoadStart_(e)})),this.on(this.tech_,"sourceset",(function(e){return r.handleTechSourceset_(e)})),this.on(this.tech_,"waiting",(function(e){return r.handleTechWaiting_(e)})),this.on(this.tech_,"ended",(function(e){return r.handleTechEnded_(e)})),this.on(this.tech_,"seeking",(function(e){return r.handleTechSeeking_(e)})),this.on(this.tech_,"play",(function(e){return r.handleTechPlay_(e)})),this.on(this.tech_,"firstplay",(function(e){return r.handleTechFirstPlay_(e)})),this.on(this.tech_,"pause",(function(e){return r.handleTechPause_(e)})),this.on(this.tech_,"durationchange",(function(e){return r.handleTechDurationChange_(e)})),this.on(this.tech_,"fullscreenchange",(function(e,t){return r.handleTechFullscreenChange_(e,t)})),this.on(this.tech_,"fullscreenerror",(function(e,t){return r.handleTechFullscreenError_(e,t)})),this.on(this.tech_,"enterpictureinpicture",(function(e){return r.handleTechEnterPictureInPicture_(e)})),this.on(this.tech_,"leavepictureinpicture",(function(e){return r.handleTechLeavePictureInPicture_(e)})),this.on(this.tech_,"error",(function(e){return r.handleTechError_(e)})),this.on(this.tech_,"posterchange",(function(e){return r.handleTechPosterChange_(e)})),this.on(this.tech_,"textdata",(function(e){return r.handleTechTextData_(e)})),this.on(this.tech_,"ratechange",(function(e){return r.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"===n&&this.tag||er(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},n.unloadTech_=function(){var e,t,r,n=this;ni.names.forEach((function(e){var t=ni[e];n[t.privateName]=n[t.getterName]()})),this.textTracksJson_=(e=this.tech_,t=e.$$("track"),r=Array.prototype.map.call(t,(function(e){return e.track})),Array.prototype.map.call(t,(function(e){var t=Cn(e.track);return e.src&&(t.src=e.src),t})).concat(Array.prototype.filter.call(e.textTracks(),(function(e){return-1===r.indexOf(e)})).map(Cn))),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&&pt.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_,"mouseup",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_,"mouseup",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_(this.autoplay())},n.manualAutoplay_=function(e){var t=this;if(this.tech_&&"string"==typeof e){var r,n=function(){var e=t.muted();t.muted(!0);var r=function(){t.muted(e)};t.playTerminatedQueue_.push(r);var n=t.play();if(On(n))return n.catch(r)};if("any"===e&&!0!==this.muted()?On(r=this.play())&&(r=r.catch(n)):r="muted"===e&&!0!==this.muted()?n():this.play(),On(r))return r.then((function(){t.trigger({type:"autoplay-success",autoplay:e})})).catch((function(r){t.trigger({type:"autoplay-failure",autoplay:e})}))}},n.updateSourceCaches_=function(e){void 0===e&&(e="");var t=e,r="";"string"!=typeof t&&(t=e.src,r=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!r&&(r=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var r=e.cache_.sources.filter((function(e){return e.src===t}));if(r.length)return r[0].type;for(var n=e.$$("source"),i=0;i<n.length;i++){var o=n[i];if(o.type&&o.src&&o.src===t)return o.type}return mi(t)}(this,t)),this.cache_.source=pn({},e,{src:t,type:r});for(var n=this.cache_.sources.filter((function(e){return e.src&&e.src===t})),i=[],o=this.$$("source"),a=[],s=0;s<o.length;s++){var u=ar(o[s]);i.push(u),u.src&&u.src===t&&a.push(u.src)}a.length&&!n.length?this.cache_.sources=i:n.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t},n.handleTechSourceset_=function(e){var t=this;if(!this.changingSrc_){var r=function(e){return t.updateSourceCaches_(e)},n=this.currentSource().src,i=e.src;n&&!/^blob:/.test(n)&&/^blob:/.test(i)&&(!this.lastSource_||this.lastSource_.tech!==i&&this.lastSource_.player!==n)&&(r=function(){}),r(i),e.src||this.tech_.any(["sourceset","loadstart"],(function(e){if("sourceset"!==e.type){var r=t.techGet("currentSrc");t.lastSource_.tech=r,t.updateSourceCaches_(r)}}))}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 r(){t!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",r))}))},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&&(pt.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.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){_r(e)&&this.controls_&&(this.paused()?kn(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 r=this.el(),n=o()[this.fsApi_.fullscreenElement]===r;!n&&r.matches?n=r.matches(":"+this.fsApi_.fullscreen):!n&&r.msMatchesSelector&&(n=r.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(n)}},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:[],volume:1}},n.techCall_=function(e,t){this.ready((function(){if(e in fi)return function(e,t,r,n){return t[r](e.reduce(pi(r),n))}(this.middleware_,this.tech_,e,t);if(e in hi)return li(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw pt(e),e}}),!0)},n.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in ci)return function(e,t,r){return e.reduceRight(pi(r),t[r]())}(this.middleware_,this.tech_,e);if(e in hi)return li(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw pt("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t),t;if("TypeError"===t.name)throw pt("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t),this.tech_.isReady_=!1,t;throw pt(t),t}}},n.play=function(){var e=this,r=this.options_.Promise||t().Promise;return r?new r((function(t){e.play_(t)})):this.play_()},n.play_=function(e){var t=this;void 0===e&&(e=kn),this.playCallbacks_.push(e);var r=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!r)return this.waitToPlay_=function(e){t.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(r||!zt&&!qt||this.load());var n=this.techGet_("play");null===n?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(n)},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")||wn(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=wn(0,0)),e},n.bufferedPercent=function(){return Tn(this.buffered(),this.duration())},n.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),r=e.end(e.length-1);return r>t&&(r=t),r},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 r=this.options_.Promise||t().Promise;if(r){var n=this;return new r((function(t,r){function i(){n.off("fullscreenerror",a),n.off("fullscreenchange",o)}function o(){i(),t()}function a(e,t){i(),r(t)}n.one("fullscreenchange",o),n.one("fullscreenerror",a);var s=n.requestFullscreenHelper_(e);if(s)return s.then(i,i),s}))}return this.requestFullscreenHelper_()},n.requestFullscreenHelper_=function(e){var t,r=this;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){var n=this.el_[this.fsApi_.requestFullscreen](t);return n&&n.then((function(){return r.isFullscreen(!0)}),(function(){return r.isFullscreen(!1)})),n}this.tech_.supportsFullScreen()?this.techCall_("enterFullScreen"):this.enterFullWindow()},n.exitFullscreen=function(){var e=this.options_.Promise||t().Promise;if(e){var r=this;return new e((function(e,t){function n(){r.off("fullscreenerror",o),r.off("fullscreenchange",i)}function i(){n(),e()}function o(e,r){n(),t(r)}r.one("fullscreenchange",i),r.one("fullscreenerror",o);var a=r.exitFullscreenHelper_();if(a)return a.then(n,n),a}))}return this.exitFullscreenHelper_()},n.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var t=o()[this.fsApi_.exitFullscreen]();return t&&t.then((function(){return e.isFullscreen(!1)})),t}this.tech_.supportsFullScreen()?this.techCall_("exitFullScreen"):this.exitFullWindow()},n.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=o().documentElement.style.overflow,Vr(o(),"keydown",this.boundFullWindowOnEscKey_),o().documentElement.style.overflow="hidden",rr(o().body,"vjs-full-window"),this.trigger("enterFullWindow")},n.fullWindowOnEscKey=function(e){p().isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},n.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,Hr(o(),"keydown",this.boundFullWindowOnEscKey_),o().documentElement.style.overflow=this.docOrigOverflow,nr(o().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 o()&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")},n.exitPictureInPicture=function(){if("pictureInPictureEnabled"in o())return o().exitPictureInPicture()},n.handleKeyDown=function(e){var t,r,n=this.options_.userActions;n&&n.hotkeys&&(t=this.el_.ownerDocument.activeElement,r=t.tagName.toLowerCase(),t.isContentEditable||("input"===r?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(t.type):-1!==["textarea"].indexOf(r))||("function"==typeof n.hotkeys?n.hotkeys.call(this,e):this.handleHotkeys(e)))},n.handleHotkeys=function(e){var t=this.options_.userActions?this.options_.userActions.hotkeys:{},r=t.fullscreenKey,n=void 0===r?function(e){return p().isEventKey(e,"f")}:r,i=t.muteKey,a=void 0===i?function(e){return p().isEventKey(e,"m")}:i,s=t.playPauseKey,u=void 0===s?function(e){return p().isEventKey(e,"k")||p().isEventKey(e,"Space")}:s;if(n.call(this,e)){e.preventDefault(),e.stopPropagation();var l=gn.getComponent("FullscreenToggle");!1!==o()[this.fsApi_.fullscreenEnabled]&&l.prototype.handleClick.call(this,e)}else a.call(this,e)?(e.preventDefault(),e.stopPropagation(),gn.getComponent("MuteToggle").prototype.handleClick.call(this,e)):u.call(this,e)&&(e.preventDefault(),e.stopPropagation(),gn.getComponent("PlayToggle").prototype.handleClick.call(this,e))},n.canPlayType=function(e){for(var t,r=0,n=this.options_.techOrder;r<n.length;r++){var i=n[r],o=ii.getTech(i);if(o||(o=gn.getComponent(i)),o){if(o.isSupported()&&(t=o.canPlayType(e)))return t}else pt.error('The "'+i+'" tech is undefined. Skipped browser support check for that tech.')}return""},n.selectSource=function(e){var t,r,n=this,i=this.options_.techOrder.map((function(e){return[e,ii.getTech(e)]})).filter((function(e){var t=e[0],r=e[1];return r?r.isSupported():(pt.error('The "'+t+'" tech is undefined. Skipped browser support check for that tech.'),!1)})),o=function(e,t,r){var n;return e.some((function(e){return t.some((function(t){if(n=r(e,t))return!0}))})),n},a=function(e,t){var r=e[0];if(e[1].canPlaySource(t,n.options_[r.toLowerCase()]))return{source:t,tech:r}};return t=this.options_.sourceOrder?o(e,i,(r=a,function(e,t){return r(t,e)})):o(i,e,a),t||!1},n.handleSrc_=function(e,t){var r=this;if(void 0===e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();var n=vi(e);if(n.length){if(this.changingSrc_=!0,t||(this.cache_.sources=n),this.updateSourceCaches_(n[0]),ui(this,n[0],(function(e,i){var o,a;if(r.middleware_=i,t||(r.cache_.sources=n),r.updateSourceCaches_(e),r.src_(e))return n.length>1?r.handleSrc_(n.slice(1)):(r.changingSrc_=!1,r.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0),void r.triggerReady());o=i,a=r.tech_,o.forEach((function(e){return e.setTech&&e.setTech(a)}))})),this.options_.retryOnError&&n.length>1){var i=function(){r.error(null),r.handleSrc_(n.slice(1),!0)},o=function(){r.off("error",i)};this.one("error",i),this.one("playing",o),this.resetRetryOnError_=function(){r.off("error",i),r.off("playing",o)}}}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,r,n=this,i=this.selectSource([e]);return!i||(t=i.tech,r=this.techName_,hn(t)!==hn(r)?(this.changingSrc_=!0,this.loadTech_(i.tech,i.source),this.tech_.ready((function(){n.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,r=this.options_.Promise||t().Promise;this.paused()||!r?this.doReset_():kn(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_(),Zr(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,r=e.remainingTimeDisplay;t&&t.updateContent(),r&&r.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)?(this.options_.autoplay=e,this.manualAutoplay_(e),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)},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){if(void 0===e)return this.error_||null;if(this.options_.suppressNotSupportedError&&e&&4===e.code){var t=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),void this.one("loadstart",(function(){this.off(["click","touchstart"],t)}))}if(null===e)return this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new Sn(e),this.addClass("vjs-error"),pt.error("(CODE:"+this.error_.code+" "+Sn.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("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,r,n=Yr(this,this.reportUserActivity),i=function(t){n(),this.clearInterval(e)};this.on("mousedown",(function(){n(),this.clearInterval(e),e=this.setInterval(n,250)})),this.on("mousemove",(function(e){e.screenX===t&&e.screenY===r||(t=e.screenX,r=e.screenY,n())})),this.on("mouseup",i),this.on("mouseleave",i);var o,a=this.getChild("controlBar");!a||qt||jt||(a.on("mouseenter",(function(e){this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout,this.player().options_.inactivityTimeout=0})),a.on("mouseleave",(function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}))),this.on("keydown",n),this.on("keyup",n),this.setInterval((function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(o);var e=this.options_.inactivityTimeout;e<=0||(o=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,r){if(this.tech_)return this.tech_.addTextTrack(e,t,r)},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(),Zr(this)&&this.trigger("languagechange"))},n.languages=function(){return pn(r.prototype.options_.languages,this.languages_)},n.toJSON=function(){var e=pn(this.options_),t=e.tracks;e.tracks=[];for(var r=0;r<t.length;r++){var n=t[r];(n=pn(n)).player=void 0,e.tracks[r]=n}return e},n.createModal=function(e,t){var r=this;(t=t||{}).content=e||"";var n=new xn(this,t);return this.addChild(n),n.on("dispose",(function(){r.removeChild(n)})),n.open(),n},n.updateCurrentBreakpoint_=function(){if(this.responsive())for(var e=this.currentBreakpoint(),t=this.currentWidth(),r=0;r<oa.length;r++){var n=oa[r];if(t<=this.breakpoints_[n]){if(e===n)return;e&&this.removeClass(aa[e]),this.addClass(aa[n]),this.breakpoint_=n;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_=gt({},sa,e),this.updateCurrentBreakpoint_()),gt(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 aa[this.breakpoint_]||""},n.loadMedia=function(e,t){var r=this;if(e&&"object"==typeof e){this.reset(),this.cache_.media=pn(e);var n=this.cache_.media,i=n.artwork,o=n.poster,a=n.src,s=n.textTracks;!i&&o&&(this.cache_.media.artwork=[{src:o,type:mi(o)}]),a&&this.src(a),o&&this.poster(o),Array.isArray(s)&&s.forEach((function(e){return r.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:mi(t.poster)}]),t}return pn(this.cache_.media)},r.getTagSettings=function(e){var t={sources:[],tracks:[]},r=ar(e),n=r["data-setup"];if(tr(e,"vjs-fill")&&(r.fill=!0),tr(e,"vjs-fluid")&&(r.fluid=!0),null!==n){var i=f()(n||"{}"),o=i[0],a=i[1];o&&pt.error(o),gt(r,a)}if(gt(t,r),e.hasChildNodes())for(var s=e.childNodes,u=0,l=s.length;u<l;u++){var c=s[u],h=c.nodeName.toLowerCase();"source"===h?t.sources.push(ar(c)):"track"===h&&t.tracks.push(ar(c))}return t},n.flexNotSupported_=function(){var e=o().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)},r}(gn);ni.names.forEach((function(e){var t=ni[e];ua.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}})),ua.prototype.crossorigin=ua.prototype.crossOrigin,ua.players={};var la=t().navigator;ua.prototype.options_={techOrder:ii.defaultTechOrder_,html5:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:la&&(la.languages&&la.languages[0]||la.userLanguage||la.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1},["ended","seeking","seekable","networkState","readyState"].forEach((function(e){ua.prototype[e]=function(){return this.techGet_(e)}})),na.forEach((function(e){ua.prototype["handleTech"+hn(e)+"_"]=function(){return this.trigger(e)}})),gn.registerComponent("Player",ua);var ca="plugin",fa="activePlugins_",ha={},pa=function(e){return ha.hasOwnProperty(e)},da=function(e){return pa(e)?ha[e]:void 0},ya=function(e,t){e[fa]=e[fa]||{},e[fa][t]=!0},ma=function(e,t,r){var n=(r?"before":"")+"pluginsetup";e.trigger(n,t),e.trigger(n+":"+t.name,t)},va=function(e,t){return t.prototype.name=e,function(){ma(this,{name:e,plugin:t,instance:null},!0);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var o=function(e,t,r){if(g())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var i=new(e.bind.apply(e,n));return r&&u(i,r.prototype),i}(t,[this].concat(n));return this[e]=function(){return o},ma(this,o.getEventHash()),o}},ga=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)),un(this),delete this.trigger,cn(this,this.constructor.defaultState),ya(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={}),qr(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[fa][e]=!1,this.player=this.state=null,t[e]=va(e,ha[e])},e.isBasic=function(t){var r="string"==typeof t?da(t):t;return"function"==typeof r&&!e.prototype.isPrototypeOf(r.prototype)},e.registerPlugin=function(t,r){if("string"!=typeof t)throw new Error('Illegal plugin name, "'+t+'", must be a string, was '+typeof t+".");if(pa(t))pt.warn('A plugin named "'+t+'" already exists. You may want to avoid re-registering plugins!');else if(ua.prototype.hasOwnProperty(t))throw new Error('Illegal plugin name, "'+t+'", cannot share a name with an existing player method!');if("function"!=typeof r)throw new Error('Illegal plugin for "'+t+'", must be a function, was '+typeof r+".");return ha[t]=r,t!==ca&&(e.isBasic(r)?ua.prototype[t]=function(e,t){var r=function(){ma(this,{name:e,plugin:t,instance:null},!0);var r=t.apply(this,arguments);return ya(this,e),ma(this,{name:e,plugin:t,instance:r}),r};return Object.keys(t).forEach((function(e){r[e]=t[e]})),r}(t,r):ua.prototype[t]=va(t,r)),r},e.deregisterPlugin=function(e){if(e===ca)throw new Error("Cannot de-register base plugin.");pa(e)&&(delete ha[e],delete ua.prototype[e])},e.getPlugins=function(e){var t;return void 0===e&&(e=Object.keys(ha)),e.forEach((function(e){var r=da(e);r&&((t=t||{})[e]=r)})),t},e.getPluginVersion=function(e){var t=da(e);return t&&t.VERSION||""},e}();ga.getPlugin=da,ga.BASE_PLUGIN_NAME=ca,ga.registerPlugin(ca,ga),ua.prototype.usingPlugin=function(e){return!!this[fa]&&!0===this[fa][e]},ua.prototype.hasPlugin=function(e){return!!pa(e)};var ba=function(e){return 0===e.indexOf("#")?e.slice(1):e};function _a(e,t,r){var n=_a.getPlayer(e);if(n)return t&&pt.warn('Player "'+e+'" is already initialised. Options will not be applied.'),r&&n.ready(r),n;var i="string"==typeof e?Tr("#"+ba(e)):e;if(!Yt(i))throw new TypeError("The element or ID supplied is not valid. (videojs)");i.ownerDocument.defaultView&&i.ownerDocument.body.contains(i)||pt.warn("The element supplied is not included in the DOM"),t=t||{},_a.hooks("beforesetup").forEach((function(e){var r=e(i,pn(t));bt(r)&&!Array.isArray(r)?t=pn(t,r):pt.error("please return an object in beforesetup hooks")}));var o=gn.getComponent("Player");return n=new o(i,t,r),_a.hooks("setup").forEach((function(e){return e(n)})),n}if(_a.hooks_={},_a.hooks=function(e,t){return _a.hooks_[e]=_a.hooks_[e]||[],t&&(_a.hooks_[e]=_a.hooks_[e].concat(t)),_a.hooks_[e]},_a.hook=function(e,t){_a.hooks(e,t)},_a.hookOnce=function(e,t){_a.hooks(e,[].concat(t).map((function(t){return function r(){return _a.removeHook(e,r),t.apply(void 0,arguments)}})))},_a.removeHook=function(e,t){var r=_a.hooks(e).indexOf(t);return!(r<=-1||(_a.hooks_[e]=_a.hooks_[e].slice(),_a.hooks_[e].splice(r,1),0))},!0!==t().VIDEOJS_NO_DYNAMIC_STYLE&&Kt()){var wa=Tr(".vjs-styles-defaults");if(!wa){wa=jr("vjs-styles-defaults");var Ta=Tr("head");Ta&&Ta.insertBefore(wa,Ta.firstChild),Lr(wa,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ")}}Cr(1,_a),_a.VERSION=at,_a.options=ua.prototype.options_,_a.getPlayers=function(){return ua.players},_a.getPlayer=function(e){var t,r=ua.players;if("string"==typeof e){var n=ba(e),i=r[n];if(i)return i;t=Tr("#"+n)}else t=e;if(Yt(t)){var o=t,a=o.player,s=o.playerId;if(a||r[s])return a||r[s]}},_a.getAllPlayers=function(){return Object.keys(ua.players).map((function(e){return ua.players[e]})).filter(Boolean)},_a.players=ua.players,_a.getComponent=gn.getComponent,_a.registerComponent=function(e,t){ii.isTech(t)&&pt.warn("The "+e+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),gn.registerComponent.call(gn,e,t)},_a.getTech=ii.getTech,_a.registerTech=ii.registerTech,_a.use=function(e,t){oi[e]=oi[e]||[],oi[e].push(t)},Object.defineProperty(_a,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(_a.middleware,"TERMINATOR",{value:si,writeable:!1,enumerable:!0}),_a.browser=Wt,_a.TOUCH_ENABLED=Ft,_a.extend=function(e,t){void 0===t&&(t={});var r=function(){e.apply(this,arguments)},n={};for(var i in"object"==typeof t?(t.constructor!==Object.prototype.constructor&&(r=t.constructor),n=t):"function"==typeof t&&(r=t),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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(r,e),e&&(r.super_=e),n)n.hasOwnProperty(i)&&(r.prototype[i]=n[i]);return r},_a.mergeOptions=pn,_a.bind=Yr,_a.registerPlugin=ga.registerPlugin,_a.deregisterPlugin=ga.deregisterPlugin,_a.plugin=function(e,t){return pt.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),ga.registerPlugin(e,t)},_a.getPlugins=ga.getPlugins,_a.getPlugin=ga.getPlugin,_a.getPluginVersion=ga.getPluginVersion,_a.addLanguage=function(e,t){var r;return e=(""+e).toLowerCase(),_a.options.languages=pn(_a.options.languages,((r={})[e]=t,r)),_a.options.languages[e]},_a.log=pt,_a.createLogger=dt,_a.createTimeRange=_a.createTimeRanges=wn,_a.formatTime=Ri,_a.setFormatTime=function(e){Ai=e},_a.resetFormatTime=function(){Ai=Ii},_a.parseUrl=zn,_a.isCrossOrigin=Xn,_a.EventTarget=$r,_a.on=Vr,_a.one=zr,_a.off=Hr,_a.trigger=qr,_a.xhr=y(),_a.TextTrack=$n,_a.AudioTrack=Jn,_a.VideoTrack=Zn,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((function(e){_a[e]=function(){return pt.warn("videojs."+e+"() is deprecated; use videojs.dom."+e+"() instead"),Er[e].apply(null,arguments)}})),_a.computedStyle=wt,_a.dom=Er,_a.url=Kn,_a.defineLazyProperty=ta,_a.addLanguage("en",{"Non-Fullscreen":"Exit Fullscreen"});var Sa=w,Ea=function(e,t,r){return e&&r&&r.responseURL&&t!==r.responseURL?r.responseURL:t},Oa=function(e){return _a.log.debug?_a.log.debug.bind(_a,"VHS:",e+" >"):function(){}},ka=_a.log,Ca=function(e,t){return e+"-"+t},Pa=function(e){var t=e.onwarn,r=e.oninfo,n=e.manifestString,i=e.customTagParsers,o=void 0===i?[]:i,a=e.customTagMappers,s=void 0===a?[]:a,u=e.experimentalLLHLS,l=new I;t&&l.on("warn",t),r&&l.on("info",r),o.forEach((function(e){return l.addParser(e)})),s.forEach((function(e){return l.addTagMapper(e)})),l.push(n),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 f=10;c.segments&&c.segments.length&&(f=c.segments.reduce((function(e,t){return Math.max(e,t.duration)}),0)),t&&t("manifest has no targetDuration defaulting to "+f),c.targetDuration=f}return c},xa=function(e,t){e.mediaGroups&&["AUDIO","SUBTITLES"].forEach((function(r){if(e.mediaGroups[r])for(var n in e.mediaGroups[r])for(var i in e.mediaGroups[r][n]){var o=e.mediaGroups[r][n][i];t(o,r,n,i)}}))},ja=function(e){var t=e.playlist,r=e.uri,n=e.id;t.id=n,r&&(t.uri=r),t.attributes=t.attributes||{}},La=function(e,t){e.uri=t;for(var r=0;r<e.playlists.length;r++)if(!e.playlists[r].uri){var n="placeholder-uri-"+r;e.playlists[r].uri=n}xa(e,(function(t,r,n,i){var o="placeholder-uri-"+r+"-"+n+"-"+i;t.playlists&&t.playlists.length||(t.playlists=[a({},t)]),t.playlists.forEach((function(t,r){var n=Ca(r,o);t.uri?t.resolvedUri=t.resolvedUri||Sa(e.uri,t.uri):(t.uri=0===r?o:n,t.resolvedUri=t.uri),t.id=t.id||n,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t}))})),function(e){for(var t=e.playlists.length;t--;){var r=e.playlists[t];ja({playlist:r,id:Ca(t,r.uri)}),r.resolvedUri=Sa(e.uri,r.uri),e.playlists[r.id]=r,e.playlists[r.uri]=r,r.attributes.BANDWIDTH||ka.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}}(e),function(e){xa(e,(function(t){t.uri&&(t.resolvedUri=Sa(e.uri,t.uri))}))}(e)},Ia=_a.mergeOptions,Aa=_a.EventTarget,Ra=function(e,t){if(!e)return t;var r=Ia(e,t);if(e.parts&&!t.parts)delete r.parts;else if(e.parts&&t.parts)for(var n=0;n<t.parts.length;n++)e.parts&&e.parts[n]&&(r.parts[n]=Ia(e.parts[n],t.parts[n]));return r},Da=function(e,t){!e.resolvedUri&&e.uri&&(e.resolvedUri=Sa(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=Sa(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=Sa(t,e.map.uri)),e.parts&&e.parts.length&&e.parts.forEach((function(e){e.resolvedUri||(e.resolvedUri=Sa(t,e.uri))})),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach((function(e){e.resolvedUri||(e.resolvedUri=Sa(t,e.uri))}))},Ma=function(e){var t=e.segments||[];return e.preloadSegment&&e.preloadSegment.parts&&t.push(e.preloadSegment),t},Na=function(e,t){return e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence},Ba=function(e,t,r){void 0===r&&(r=Na);var n=Ia(e,{}),i=n.playlists[t.id];if(!i)return null;if(r(i,t))return null;var o=Ia(i,t);t.segments=Ma(t),i.segments&&(o.segments=function(e,t,r){var n=e.slice(),i=t.slice();r=r||0;for(var o=Math.min(e.length,t.length+r),a=r;a<o;a++){var s=a-r;i[s]=Ra(n[a],i[s])}return i}(i.segments,t.segments,t.mediaSequence-i.mediaSequence)),o.segments.forEach((function(e){Da(e,o.resolvedUri)}));for(var a=0;a<n.playlists.length;a++)n.playlists[a].id===t.id&&(n.playlists[a]=o);return n.playlists[t.id]=o,n.playlists[t.uri]=o,xa(e,(function(e,r,n,i){if(e.playlists)for(var o=0;o<e.playlists.length;o++)t.id===e.playlists[o].id&&(e.playlists[o]=t)})),n},Ua=function(e,t){var r=e.segments[e.segments.length-1],n=r&&r.parts&&r.parts[r.parts.length-1],i=n&&n.duration||r&&r.duration;return t&&i?1e3*i:500*(e.partTargetDuration||e.targetDuration||10)},Fa=function(e){function r(t,r,n){var i;if(void 0===n&&(n={}),i=e.call(this)||this,!t)throw new Error("A non-empty playlist URL or object is required");i.logger_=Oa("PlaylistLoader");var o=n,a=o.withCredentials,s=void 0!==a&&a,u=o.handleManifestRedirects,l=void 0!==u&&u;i.src=t,i.vhs_=r,i.withCredentials=s,i.handleManifestRedirects=l;var c=r.options_;return i.customTagParsers=c&&c.customTagParsers||[],i.customTagMappers=c&&c.customTagMappers||[],i.experimentalLLHLS=c&&c.experimentalLLHLS||!1,i.state="HAVE_NOTHING",i.on("mediaupdatetimeout",(function(){"HAVE_METADATA"===i.state&&(i.state="HAVE_CURRENT_METADATA",i.request=i.vhs_.xhr({uri:Sa(i.master.uri,i.media().uri),withCredentials:i.withCredentials},(function(e,t){if(i.request)return e?i.playlistRequestError(i.request,i.media(),"HAVE_METADATA"):void i.haveMetadata({playlistString:i.request.responseText,url:i.media().uri,id:i.media().id})})))})),i}l(r,e);var n=r.prototype;return n.playlistRequestError=function(e,t,r){var n=t.uri,i=t.id;this.request=null,r&&(this.state=r),this.error={playlist:this.master.playlists[i],status:e.status,message:"HLS playlist request error at URL: "+n+".",responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")},n.haveMetadata=function(e){var r=this,n=e.playlistString,i=e.playlistObject,o=e.url,a=e.id;this.request=null,this.state="HAVE_METADATA";var s=i||Pa({onwarn:function(e){var t=e.message;return r.logger_("m3u8-parser warn for "+a+": "+t)},oninfo:function(e){var t=e.message;return r.logger_("m3u8-parser info for "+a+": "+t)},manifestString:n,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS});s.lastRequest=Date.now(),ja({playlist:s,uri:o,id:a});var u=Ba(this.master,s);this.targetDuration=s.partTargetDuration||s.targetDuration,u?(this.master=u,this.media_=this.master.playlists[a]):this.trigger("playlistunchanged"),this.media().endList||(t().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=t().setTimeout((function(){r.trigger("mediaupdatetimeout")}),Ua(this.media(),!!u))),this.trigger("loadedplaylist")},n.dispose=function(){this.trigger("dispose"),this.stopRequest(),t().clearTimeout(this.mediaUpdateTimeout),t().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,r){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(t().clearTimeout(this.finalRenditionTimeout),r){var i=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=t().setTimeout(this.media.bind(this,e,!1),i)}else{var o=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"===o?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(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.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},(function(t,r){if(n.request){if(e.lastRequest=Date.now(),e.resolvedUri=Ea(n.handleManifestRedirects,e.resolvedUri,r),t)return n.playlistRequestError(n.request,e,o);n.haveMetadata({playlistString:r.responseText,url:e.uri,id:e.id}),"HAVE_MASTER"===o?n.trigger("loadedmetadata"):n.trigger("mediachange")}}))}}},n.pause=function(){this.stopRequest(),t().clearTimeout(this.mediaUpdateTimeout),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")},n.load=function(e){var r=this;t().clearTimeout(this.mediaUpdateTimeout);var n=this.media();if(e){var i=n?(n.partTargetDuration||n.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=t().setTimeout((function(){return r.load()}),i)}else this.started?n&&!n.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()},n.start=function(){var e=this;if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=t().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,r){if(e.request){if(e.request=null,t)return e.error={status:r.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:r.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.src=Ea(e.handleManifestRedirects,e.src,r);var n=Pa({manifestString:r.responseText,customTagParsers:e.customTagParsers,customTagMappers:e.customTagMappers,experimentalLLHLS:e.experimentalLLHLS});e.setupInitialPlaylist(n)}}))},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,La(this.master,this.srcUri()),e.playlists.forEach((function(e){e.segments=Ma(e),e.segments.forEach((function(t){Da(t,e.resolvedUri)}))})),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var r=this.srcUri()||t().location.href;this.master=function(e,r){var n=Ca(0,r),i={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:t().location.href,resolvedUri:t().location.href,playlists:[{uri:r,id:n,resolvedUri:r,attributes:{}}]};return i.playlists[n]=i.playlists[0],i.playlists[r]=i.playlists[0],i}(0,r),this.haveMetadata({playlistObject:e,url:r,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},r}(Aa),Va=1/30,Ha=.1,qa=function(e,t){var r,n=[];if(e&&e.length)for(r=0;r<e.length;r++)t(e.start(r),e.end(r))&&n.push([e.start(r),e.end(r)]);return _a.createTimeRanges(n)},za=function(e,t){return qa(e,(function(e,r){return e-Ha<=t&&r+Ha>=t}))},Wa=function(e,t){return qa(e,(function(e){return e-Va>=t}))},Ga=function(e){var t=[];if(!e||!e.length)return"";for(var r=0;r<e.length;r++)t.push(e.start(r)+" => "+e.end(r));return t.join(", ")},Xa=function(e){for(var t=[],r=0;r<e.length;r++)t.push({start:e.start(r),end:e.end(r)});return t},Ka=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},Ya=_a.createTimeRange,Qa=function(e,t){if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;var r=t.segments&&t.segments.length&&t.segments[t.segments.length-1],n=r&&r.parts&&r.parts.length;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},$a=function(e,t,r){if(void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;var n=function(e,t){var r=0,n=t-e.mediaSequence,i=e.segments[n];if(i){if(void 0!==i.start)return{result:i.start,precise:!0};if(void 0!==i.end)return{result:i.end-i.duration,precise:!0}}for(;n--;){if(void 0!==(i=e.segments[n]).end)return{result:r+i.end,precise:!0};if(r+=i.duration,void 0!==i.start)return{result:r+i.start,precise:!0}}return{result:r,precise:!1}}(e,t);if(n.precise)return n.result;var i=function(e,t){for(var r,n=0,i=t-e.mediaSequence;i<e.segments.length;i++){if(void 0!==(r=e.segments[i]).start)return{result:r.start-n,precise:!0};if(n+=r.duration,void 0!==r.end)return{result:r.end-n,precise:!0}}return{result:-1,precise:!1}}(e,t);return i.precise?i.result:n.result+r},Ja=function(e,r,n){if(!e)return 0;if("number"!=typeof n&&(n=0),void 0===r){if(e.totalDuration)return e.totalDuration;if(!e.endList)return t()[1/0]}return $a(e,r,n)},Za=function(e,t,r){var n=0;if(t>r){var i=[r,t];t=i[0],r=i[1]}if(t<0){for(var o=t;o<Math.min(0,r);o++)n+=e.targetDuration;t=0}for(var a=t;a<r;a++)n+=e.segments[a].duration;return n},es=function(e,t,r,n){if(!e||!e.segments)return null;if(e.endList)return Ja(e);if(null===t)return null;t=t||0;var i=$a(e,e.mediaSequence+e.segments.length,t);return r&&(i-=n="number"==typeof n?n:Qa(null,e)),Math.max(0,i)},ts=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},rs=function(e){return e.excludeUntil&&e.excludeUntil===1/0},ns=function(e){var t=ts(e);return!e.disabled&&!t},is=function(e,t){return t.attributes&&t.attributes[e]},os=function(e,t){if(1===e.playlists.length)return!0;var r=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((function(e){return!!ns(e)&&(e.attributes.BANDWIDTH||0)<r})).length},as=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))},ss=function(e,t){var r=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{},n=!1;for(var i in r){for(var o in r[i])if(n=t(r[i][o]))break;if(n)break}return!!n},us=function(e){if(!e||!e.playlists||!e.playlists.length)return ss(e,(function(e){return e.playlists&&e.playlists.length||e.uri}));for(var t=function(t){var r=e.playlists[t],n=r.attributes&&r.attributes.CODECS;return n&&n.split(",").every((function(e){return B(e)}))||ss(e,(function(e){return as(r,e)}))?"continue":{v:!1}},r=0;r<e.playlists.length;r++){var n=t(r);if("continue"!==n&&"object"==typeof n)return n.v}return!0},ls={liveEdgeDelay:Qa,duration:Ja,seekable:function(e,t,r){var n=t||0,i=es(e,t,!0,r);return null===i?Ya():Ya(n,i)},getMediaInfoForTime:function(e,t,r,n){var i=function(e){return(e.segments||[]).reduce((function(e,t,r){return t.parts?t.parts.forEach((function(t,n){e.push({duration:t.duration,segmentIndex:r,partIndex:n})})):e.push({duration:t.duration,segmentIndex:r,partIndex:null}),e}),[])}(e),o=t-n;if(o<0){if(r>0)for(var a=r-1;a>=0;a--){var s=i[a];if((o+=s.duration+Va)>0)return{mediaIndex:s.segmentIndex,startTime:n-Za(e,r,s.segmentIndex),partIndex:s.partIndex}}return{mediaIndex:i[0]&&i[0].segmentIndex||0,partIndex:i[0]&&i[0].partIndex||null,startTime:t}}if(r<0){for(var u=r;u<0;u++)if((o-=e.targetDuration)<0)return{mediaIndex:i[0].segmentIndex,startTime:t};r=0}for(var l=r;l<i.length;l++){var c=i[l];if((o-=c.duration+Va)<0)return{mediaIndex:c.segmentIndex,startTime:n+Za(e,r,c.segmentIndex),partIndex:c.partIndex}}return{mediaIndex:i[i.length-1].segmentIndex,partIndex:i[i.length-1].partIndex,startTime:t}},isEnabled:ns,isDisabled:function(e){return e.disabled},isBlacklisted:ts,isIncompatible:rs,playlistEnd:es,isAes:function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},hasAttribute:is,estimateSegmentRequestTime:function(e,t,r,n){return void 0===n&&(n=0),is("BANDWIDTH",r)?(e*r.attributes.BANDWIDTH-8*n)/t:NaN},isLowestEnabledRendition:os,isAudioOnly:us,playlistMatch:as},cs=_a.xhr,fs=_a.mergeOptions,hs=function(e,t,r,n){var i="arraybuffer"===e.responseType?e.response:e.responseText;!t&&i&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=i.byteLength||i.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),r.headers&&(e.responseHeaders=r.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===r.statusCode||206===r.statusCode||0===r.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(i||e.responseText)))),n(t,e)},ps=function(){var e=function e(t,r){t=fs({timeout:45e3},t);var n=e.beforeRequest||_a.Vhs.xhr.beforeRequest;if(n&&"function"==typeof n){var i=n(t);i&&(t=i)}var o=(!0===_a.Vhs.xhr.original?cs:_a.Vhs.xhr)(t,(function(e,t){return hs(o,e,t,r)})),a=o.abort;return o.abort=function(){return o.aborted=!0,a.apply(o,arguments)},o.uri=t.uri,o.requestTime=Date.now(),o};return e.original=!0,e},ds=function(e){var t,r,n={};return e.byterange&&(n.Range=(r=(t=e.byterange).offset+t.length-1,"bytes="+t.offset+"-"+r)),n},ys=function(e,t){return e.start(t)+"-"+e.end(t)},ms=function(e,t){var r=e.toString(16);return"00".substring(0,2-r.length)+r+(t%2?" ":"")},vs=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},gs=function(e){var t={};return Object.keys(e).forEach((function(r){var n=e[r];ArrayBuffer.isView(n)?t[r]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[r]=n})),t},bs=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},_s=function(e){return e.resolvedUri},ws=function(e){for(var t=Array.prototype.slice.call(e),r=16,n="",i=0;i<t.length/r;i++)n+=t.slice(i*r,i*r+r).map(ms).join("")+" "+t.slice(i*r,i*r+r).map(vs).join("")+"\n";return n},Ts=Object.freeze({__proto__:null,createTransferableMessage:gs,initSegmentId:bs,segmentKeyId:_s,hexDump:ws,tagDump:function(e){var t=e.bytes;return ws(t)},textRanges:function(e){var t,r="";for(t=0;t<e.length;t++)r+=ys(e,t)+" ";return r}}),Ss=function e(t){var r=t.programTime,n=t.playlist,i=t.retryCount,o=void 0===i?2:i,a=t.seekTo,s=t.pauseAfterSeek,u=void 0===s||s,l=t.tech,c=t.callback;if(!c)throw new Error("seekToProgramTime: callback must be provided");if(void 0===r||!n||!a)return c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!n.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}(n))return c({message:"programDateTime tags must be provided in the manifest "+n.resolvedUri});var f=function(e,t){var r;try{r=new Date(e)}catch(e){return null}if(!t||!t.segments||0===t.segments.length)return null;var n=t.segments[0];if(r<n.dateTimeObject)return null;for(var i=0;i<t.segments.length-1&&(n=t.segments[i],!(r<t.segments[i+1].dateTimeObject));i++);var o,a=t.segments[t.segments.length-1],s=a.dateTimeObject,u=a.videoTimingInfo?(o=a.videoTimingInfo).transmuxedPresentationEnd-o.transmuxedPresentationStart-o.transmuxerPrependedSeconds:a.duration+.25*a.duration;return r>new Date(s.getTime()+1e3*u)?null:(r>s&&(n=a),{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:ls.duration(t,t.mediaSequence+t.segments.indexOf(n)),type:n.videoTimingInfo?"accurate":"estimate"})}(r,n);if(!f)return c({message:r+" was not found in the stream"});var h=f.segment,p=function(e,t){var r,n;try{r=new Date(e),n=new Date(t)}catch(e){}var i=r.getTime();return(n.getTime()-i)/1e3}(h.dateTimeObject,r);if("estimate"===f.type)return 0===o?c({message:r+" is not buffered yet. Try again"}):(a(f.estimatedStart+p),void l.one("seeked",(function(){e({programTime:r,playlist:n,retryCount:o-1,seekTo:a,pauseAfterSeek:u,tech:l,callback:c})})));var d=h.start+p;l.one("seeked",(function(){return c(null,l.currentTime())})),u&&l.pause(),a(d)},Es=function(e,t){if(4===e.readyState)return t()},Os=_a.EventTarget,ks=_a.mergeOptions,Cs=function(e,t){if(!Na(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 r=0;r<e.segments.length;r++){var n=e.segments[r],i=t.segments[r];if(n.uri!==i.uri)return!1;if(n.byterange||i.byterange){var o=n.byterange,a=i.byterange;if(o&&!a||!o&&a)return!1;if(o.offset!==a.offset||o.length!==a.length)return!1}}return!0},Ps=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},xs=function(e,t){var r={};for(var n in e){var i=e[n].sidx;if(i){var o=ne(i);if(!t[o])break;var a=t[o].sidxInfo;Ps(a,i)&&(r[o]=t[o])}}return r},js=function(e){function r(t,r,n,i){var o;void 0===n&&(n={}),(o=e.call(this)||this).masterPlaylistLoader_=i||s(o),i||(o.isMaster_=!0);var a=n,u=a.withCredentials,l=void 0!==u&&u,c=a.handleManifestRedirects,f=void 0!==c&&c;if(o.vhs_=r,o.withCredentials=l,o.handleManifestRedirects=f,!t)throw new Error("A non-empty playlist URL or object is required");return o.on("minimumUpdatePeriod",(function(){o.refreshXml_()})),o.on("mediaupdatetimeout",(function(){o.refreshMedia_(o.media().id)})),o.state="HAVE_NOTHING",o.loadedPlaylists_={},o.logger_=Oa("DashPlaylistLoader"),o.isMaster_?(o.masterPlaylistLoader_.srcUrl=t,o.masterPlaylistLoader_.sidxMapping_={}):o.childPlaylist_=t,o}l(r,e);var n=r.prototype;return n.requestErrored_=function(e,t,r){return!this.request||(this.request=null,e?(this.error="object"!=typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2}:e,r&&(this.state=r),this.trigger("error"),!0):void 0)},n.addSidxSegments_=function(e,r,n){var i=this,o=e.sidx&&ne(e.sidx);if(e.sidx&&o&&!this.masterPlaylistLoader_.sidxMapping_[o]){var a=Ea(this.handleManifestRedirects,e.sidx.resolvedUri),s=function(t,a){if(!i.requestErrored_(t,a,r)){var s,u=i.masterPlaylistLoader_.sidxMapping_;try{s=je()(Le(a.response).subarray(8))}catch(e){return void i.requestErrored_(e,a,r)}return u[o]={sidxInfo:e.sidx,sidx:s},re(e,s,e.sidx.resolvedUri),n(!0)}};this.request=function(e,t,r){var n,i=[],o=!1,a=function(e,t,n,i){return t.abort(),o=!0,r(e,t,n,i)},s=function(e,t){if(!o){if(e)return a(e,t,"",i);var r=t.responseText.substring(i&&i.byteLength||0,t.responseText.length);if(i=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if((t=t.filter((function(e){return e&&(e.byteLength||e.length)&&"string"!=typeof e}))).length<=1)return Le(t[0]);var n=t.reduce((function(e,t,r){return e+(t.byteLength||t.length)}),0),i=new Uint8Array(n),o=0;return t.forEach((function(e){e=Le(e),i.set(e,o),o+=e.byteLength})),i}(i,De(r,!0)),n=n||Be(i),i.length<10||n&&i.length<n+2)return Es(t,(function(){return a(e,t,"",i)}));var s=it(i);return"ts"===s&&i.length<188||!s&&i.length<376?Es(t,(function(){return a(e,t,"",i)})):a(null,t,s,i)}},u={uri:e,beforeSend:function(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",(function(t){return t.total,t.loaded,hs(e,null,{statusCode:e.status},s)}))}},l=t(u,(function(e,t){return hs(l,e,t,s)}));return l}(a,this.vhs_.xhr,(function(t,r,n,o){if(t)return s(t,r);if(!n||"mp4"!==n)return s({status:r.status,message:"Unsupported "+(n||"unknown")+" container type for sidx segment at URL: "+a,response:"",playlist:e,internal:!0,blacklistDuration:1/0,code:2},r);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:r.status,uri:r.uri});i.request=i.vhs_.xhr({uri:a,responseType:"arraybuffer",headers:ds({byterange:e.sidx.byterange})},s)}))}else this.mediaRequest_=t().setTimeout((function(){return n(!1)}),0)},n.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},t().clearTimeout(this.minimumUpdatePeriodTimeout_),t().clearTimeout(this.mediaRequest_),t().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 r=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 n=!this.media_||e.id!==this.media_.id;if(n&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(n&&(this.trigger("mediachanging"),this.trigger("mediachange")));n&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,r,(function(n){t.haveMetadata({startingState:r,playlist:e})})))},n.haveMetadata=function(e){var t=e.startingState,r=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[r.id]=r,this.mediaRequest_=null,this.refreshMedia_(r.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(),t().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(t().clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)},n.load=function(e){var r=this;t().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var n=this.media();if(e){var i=n?n.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=t().setTimeout((function(){return r.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,r){e.haveMaster_(),e.hasPendingRequest()||e.media_||e.media(e.masterPlaylistLoader_.master.playlists[0])})):this.mediaRequest_=t().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(r,n){if(!t.requestErrored_(r,n)){var i=n.responseText!==t.masterPlaylistLoader_.masterXml_;return t.masterPlaylistLoader_.masterXml_=n.responseText,n.responseHeaders&&n.responseHeaders.date?t.masterLoaded_=Date.parse(n.responseHeaders.date):t.masterLoaded_=Date.now(),t.masterPlaylistLoader_.srcUrl=Ea(t.handleManifestRedirects,t.masterPlaylistLoader_.srcUrl,n),i?(t.handleMaster_(),void t.syncClientServerClock_((function(){return e(n,i)}))):e(n,i)}"HAVE_NOTHING"===t.state&&(t.started=!1)}))},n.syncClientServerClock_=function(e){var t,r=this,n=(t=this.masterPlaylistLoader_.masterXml_,function(e){var t=ge(e,"UTCTiming")[0];if(!t)return null;var r=Te(t);switch(r.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":r.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":r.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":r.method="DIRECT",r.value=Date.parse(r.value);break;default:throw new Error("UNSUPPORTED_UTC_TIMING_SCHEME")}return r}(Ce(t)));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:Sa(this.masterPlaylistLoader_.srcUrl,n.value),method:n.method,withCredentials:this.withCredentials},(function(t,i){if(r.request){if(t)return r.masterPlaylistLoader_.clientOffset_=r.masterLoaded_-Date.now(),e();var o;o="HEAD"===n.method?i.responseHeaders&&i.responseHeaders.date?Date.parse(i.responseHeaders.date):r.masterLoaded_:Date.parse(i.responseText),r.masterPlaylistLoader_.clientOffset_=o-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,r,n=(e={masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_},r=Pe(e.masterXml,{manifestUri:t=e.srcUrl,clientOffset:e.clientOffset,sidxMapping:e.sidxMapping}),La(r,t),r),i=this.masterPlaylistLoader_.master;i&&(n=function(e,t,r){for(var n=!0,i=ks(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod}),o=0;o<t.playlists.length;o++){var a=t.playlists[o];if(a.sidx){var s=ne(a.sidx);r&&r[s]&&r[s].sidx&&re(a,r[s].sidx,a.sidx.resolvedUri)}var u=Ba(i,a,Cs);u&&(i=u,n=!1)}return xa(t,(function(e,t,r,o){if(e.playlists&&e.playlists.length){var a=e.playlists[0].id,s=Ba(i,e.playlists[0],Cs);s&&((i=s).mediaGroups[t][r][o].playlists[0]=i.playlists[a],n=!1)}})),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(n=!1),n?null:i}(i,n,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=n||i;var o=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return o&&o!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=o),(!i||n&&n.minimumUpdatePeriod!==i.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),Boolean(n)},n.updateMinimumUpdatePeriodTimeout_=function(){var e=this.masterPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(t().clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);var r=e.master&&e.master.minimumUpdatePeriod;0===r&&(e.media()?r=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!=typeof r||r<=0?r<0&&this.logger_("found invalid minimumUpdatePeriod of "+r+", not setting a timeout"):this.createMUPTimeout_(r)},n.createMUPTimeout_=function(e){var r=this.masterPlaylistLoader_;r.minimumUpdatePeriodTimeout_=t().setTimeout((function(){r.minimumUpdatePeriodTimeout_=null,r.trigger("minimumUpdatePeriod"),r.createMUPTimeout_(e)}),e)},n.refreshXml_=function(){var e=this;this.requestMaster_((function(t,r){var n,i,o;r&&(e.media_&&(e.media_=e.masterPlaylistLoader_.master.playlists[e.media_.id]),e.masterPlaylistLoader_.sidxMapping_=(n=e.masterPlaylistLoader_.master,i=e.masterPlaylistLoader_.sidxMapping_,o=xs(n.playlists,i),xa(n,(function(e,t,r,n){if(e.playlists&&e.playlists.length){var a=e.playlists;o=ks(o,xs(a,i))}})),o),e.addSidxSegments_(e.media(),e.state,(function(t){e.refreshMedia_(e.media().id)})))}))},n.refreshMedia_=function(e){var r=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];i?this.media_=n[e]:this.trigger("playlistunchanged"),this.mediaUpdateTimeout||function e(){r.media().endList||(r.mediaUpdateTimeout=t().setTimeout((function(){r.trigger("mediaupdatetimeout"),e()}),Ua(r.media(),Boolean(i))))}(),this.trigger("loadedplaylist")},r}(Os),Ls={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},Is=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},As=function(e){return function(){var t=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(r){var t=new BlobBuilder;return t.append(e),URL.createObjectURL(t.getBlob())}}(e),r=Is(new Worker(t));r.objURL=t;var n=r.terminate;return r.on=r.addEventListener,r.off=r.removeEventListener,r.terminate=function(){return URL.revokeObjectURL(t),n.call(this)},r}},Rs=function(e){return"var browserWorkerPolyFill = "+Is.toString()+";\nbrowserWorkerPolyFill(self);\n"+e},Ds=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},Ms=Rs(Ds((function(){var e=function(){this.init=function(){var e={};this.on=function(t,r){e[t]||(e[t]=[]),e[t]=e[t].concat(r)},this.off=function(t,r){var n;return!!e[t]&&(n=e[t].indexOf(r),e[t]=e[t].slice(),e[t].splice(n,1),n>-1)},this.trigger=function(t){var r,n,i,o;if(r=e[t])if(2===arguments.length)for(i=r.length,n=0;n<i;++n)r[n].call(this,arguments[1]);else{for(o=[],n=arguments.length,n=1;n<arguments.length;++n)o.push(arguments[n]);for(i=r.length,n=0;n<i;++n)r[n].apply(this,o)}},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,r,n,i,o,a,s,u,l,c,f,h,p,d,y,m,v,g,b,_,w,T,S,E,O,k,C,P,x,j,L,I,A,R,D,M,N,B,U,F,V=e,H=Math.pow(2,32)-1;!function(){var e;if(T={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(e in T)T.hasOwnProperty(e)&&(T[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);S=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),O=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),E=new Uint8Array([0,0,0,1]),k=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]),C=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:k,audio:C},L=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),j=new Uint8Array([0,0,0,0,0,0,0,0]),I=new Uint8Array([0,0,0,0,0,0,0,0]),A=I,R=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),D=I,x=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),t=function(e){var t,r,n=[],i=0;for(t=1;t<arguments.length;t++)n.push(arguments[t]);for(t=n.length;t--;)i+=n[t].byteLength;for(r=new Uint8Array(i+8),new DataView(r.buffer,r.byteOffset,r.byteLength).setUint32(0,r.byteLength),r.set(e,4),t=0,i=8;t<n.length;t++)r.set(n[t],i),i+=n[t].byteLength;return r},r=function(){return t(T.dinf,t(T.dref,L))},n=function(e){return t(T.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},y=function(e){return t(T.hdlr,P[e])},d=function(e){var r=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&&(r[12]=e.samplerate>>>24&255,r[13]=e.samplerate>>>16&255,r[14]=e.samplerate>>>8&255,r[15]=255&e.samplerate),t(T.mdhd,r)},p=function(e){return t(T.mdia,d(e),y(e.type),a(e))},o=function(e){return t(T.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},a=function(e){return t(T.minf,"video"===e.type?t(T.vmhd,x):t(T.smhd,j),r(),v(e))},s=function(e,r){for(var n=[],i=r.length;i--;)n[i]=b(r[i]);return t.apply(null,[T.moof,o(e)].concat(n))},u=function(e){for(var r=e.length,n=[];r--;)n[r]=f(e[r]);return t.apply(null,[T.moov,c(4294967295)].concat(n).concat(l(e)))},l=function(e){for(var r=e.length,n=[];r--;)n[r]=_(e[r]);return t.apply(null,[T.mvex].concat(n))},c=function(e){var r=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(T.mvhd,r)},m=function(e){var r,n,i=e.samples||[],o=new Uint8Array(4+i.length);for(n=0;n<i.length;n++)r=i[n].flags,o[n+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return t(T.sdtp,o)},v=function(e){return t(T.stbl,g(e),t(T.stts,D),t(T.stsc,A),t(T.stsz,R),t(T.stco,I))},g=function(e){return t(T.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===e.type?M(e):N(e))},M=function(e){var r,n,i=e.sps||[],o=e.pps||[],a=[],s=[];for(r=0;r<i.length;r++)a.push((65280&i[r].byteLength)>>>8),a.push(255&i[r].byteLength),a=a.concat(Array.prototype.slice.call(i[r]));for(r=0;r<o.length;r++)s.push((65280&o[r].byteLength)>>>8),s.push(255&o[r].byteLength),s=s.concat(Array.prototype.slice.call(o[r]));if(n=[T.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),t(T.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([i.length],a,[o.length],s))),t(T.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];n.push(t(T.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,n)},N=function(e){return t(T.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),n(e))},h=function(e){var r=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(T.tkhd,r)},b=function(e){var r,n,i,o,a,s;return r=t(T.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),a=Math.floor(e.baseMediaDecodeTime/(H+1)),s=Math.floor(e.baseMediaDecodeTime%(H+1)),n=t(T.tfdt,new Uint8Array([1,0,0,0,a>>>24&255,a>>>16&255,a>>>8&255,255&a,s>>>24&255,s>>>16&255,s>>>8&255,255&s])),"audio"===e.type?(i=w(e,92),t(T.traf,r,n,i)):(o=m(e),i=w(e,o.length+92),t(T.traf,r,n,i,o))},f=function(e){return e.duration=e.duration||4294967295,t(T.trak,h(e),p(e))},_=function(e){var r=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&&(r[r.length-1]=0),t(T.trex,r)},F=function(e,t){var r=0,n=0,i=0,o=0;return e.length&&(void 0!==e[0].duration&&(r=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(i=4),void 0!==e[0].compositionTimeOffset&&(o=8)),[0,0,r|n|i|o,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]},U=function(e,r){var n,i,o,a,s,u;for(r+=20+16*(a=e.samples||[]).length,o=F(a,r),(i=new Uint8Array(o.length+16*a.length)).set(o),n=o.length,u=0;u<a.length;u++)s=a[u],i[n++]=(4278190080&s.duration)>>>24,i[n++]=(16711680&s.duration)>>>16,i[n++]=(65280&s.duration)>>>8,i[n++]=255&s.duration,i[n++]=(4278190080&s.size)>>>24,i[n++]=(16711680&s.size)>>>16,i[n++]=(65280&s.size)>>>8,i[n++]=255&s.size,i[n++]=s.flags.isLeading<<2|s.flags.dependsOn,i[n++]=s.flags.isDependedOn<<6|s.flags.hasRedundancy<<4|s.flags.paddingValue<<1|s.flags.isNonSyncSample,i[n++]=61440&s.flags.degradationPriority,i[n++]=15&s.flags.degradationPriority,i[n++]=(4278190080&s.compositionTimeOffset)>>>24,i[n++]=(16711680&s.compositionTimeOffset)>>>16,i[n++]=(65280&s.compositionTimeOffset)>>>8,i[n++]=255&s.compositionTimeOffset;return t(T.trun,i)},B=function(e,r){var n,i,o,a,s,u;for(r+=20+8*(a=e.samples||[]).length,o=F(a,r),(n=new Uint8Array(o.length+8*a.length)).set(o),i=o.length,u=0;u<a.length;u++)s=a[u],n[i++]=(4278190080&s.duration)>>>24,n[i++]=(16711680&s.duration)>>>16,n[i++]=(65280&s.duration)>>>8,n[i++]=255&s.duration,n[i++]=(4278190080&s.size)>>>24,n[i++]=(16711680&s.size)>>>16,n[i++]=(65280&s.size)>>>8,n[i++]=255&s.size;return t(T.trun,n)},w=function(e,t){return"audio"===e.type?B(e,t):U(e,t)},i=function(){return t(T.ftyp,S,E,S,O)};var q,z,W,G,X,K,Y,Q,$=function(e){return t(T.mdat,e)},J=s,Z=function(e,t){var r={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return r.dataOffset=t,r.compositionTimeOffset=e.pts-e.dts,r.duration=e.duration,r.size=4*e.length,r.size+=e.byteLength,e.keyFrame&&(r.flags.dependsOn=2,r.flags.isNonSyncSample=0),r},ee=[33,16,5,32,164,27],te=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],re=function(e){for(var t=[];e--;)t.push(0);return t},ne=9e4;K=function(e,t){return z(X(e,t))},Y=function(e,t){return W(G(e),t)},Q=function(e,t,r){return G(r?e:e-t)};var ie=ne,oe=z=function(e){return e*ne},ae=(W=function(e,t){return e*t},G=function(e){return e/ne}),se=(X=function(e,t){return e/t},K),ue=Y,le=Q,ce=function(e,t,r,n){var i,o,a,s,u,l=0,c=0,f=0;if(t.length&&(i=se(e.baseMediaDecodeTime,e.samplerate),o=Math.ceil(ie/(e.samplerate/1024)),r&&n&&(l=i-Math.max(r,n),f=(c=Math.floor(l/o))*o),!(c<1||f>45e3))){for((a=function(){if(!q){var e={96e3:[ee,[227,64],re(154),[56]],88200:[ee,[231],re(170),[56]],64e3:[ee,[248,192],re(240),[56]],48e3:[ee,[255,192],re(268),[55,148,128],re(54),[112]],44100:[ee,[255,192],re(268),[55,163,128],re(84),[112]],32e3:[ee,[255,192],re(268),[55,234],re(226),[112]],24e3:[ee,[255,192],re(268),[55,255,128],re(268),[111,112],re(126),[224]],16e3:[ee,[255,192],re(268),[55,255,128],re(268),[111,255],re(269),[223,108],re(195),[1,192]],12e3:[te,re(268),[3,127,248],re(268),[6,255,240],re(268),[13,255,224],re(268),[27,253,128],re(259),[56]],11025:[te,re(268),[3,127,248],re(268),[6,255,240],re(268),[13,255,224],re(268),[27,255,192],re(268),[55,175,128],re(108),[112]],8e3:[te,re(268),[3,121,16],re(47),[7]]};t=e,q=Object.keys(t).reduce((function(e,r){return e[r]=new Uint8Array(t[r].reduce((function(e,t){return e.concat(t)}),[])),e}),{})}var t;return q}()[e.samplerate])||(a=t[0].data),s=0;s<c;s++)u=t[0],t.splice(0,0,{data:a,dts:u.dts-o,pts:u.pts-o});return e.baseMediaDecodeTime-=Math.floor(ue(f,e.samplerate)),f}},fe=function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},he=function(e,t){var r,n=e.minSegmentDts;return t||(n-=e.timelineStartInfo.dts),r=e.timelineStartInfo.baseMediaDecodeTime,r+=n,r=Math.max(0,r),"audio"===e.type&&(r*=e.samplerate/9e4,r=Math.floor(r)),r},pe=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))},de=function e(t){t=t||{},e.prototype.init.call(this),this.parse708captions_="boolean"!=typeof t.parse708captions||t.parse708captions,this.captionPackets_=[],this.ccStreams_=[new Ee(0,0),new Ee(0,1),new Ee(1,0),new Ee(1,1)],this.parse708captions_&&(this.cc708Stream_=new be),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")))};(de.prototype=new V).push=function(e){var t,r,n;if("sei_rbsp"===e.nalUnitType&&(t=function(e){for(var t=0,r={payloadType:-1,payloadSize:0},n=0,i=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)n+=255,t++;for(n+=e[t++];255===e[t];)i+=255,t++;if(i+=e[t++],!r.payload&&4===n){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){r.payloadType=n,r.payloadSize=i,r.payload=e.subarray(t,t+i);break}r.payload=void 0}t+=i,n=0,i=0}return r}(e.escapedRBSP)).payload&&4===t.payloadType&&(r=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)}(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));n=function(e,t){var r,n,i,o,a=[];if(!(64&t[0]))return a;for(n=31&t[0],r=0;r<n;r++)o={type:3&t[2+(i=3*r)],pts:e},4&t[i+2]&&(o.ccData=t[i+3]<<8|t[i+4],a.push(o));return a}(e.pts,r),this.captionPackets_=this.captionPackets_.concat(n),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},de.prototype.flushCCStreams=function(e){this.ccStreams_.forEach((function(t){return"flush"===e?t.flush():t.partialFlush()}),this)},de.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)},de.prototype.flush=function(){return this.flushStream("flush")},de.prototype.partialFlush=function(){return this.flushStream("partialFlush")},de.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},de.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)},de.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},de.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},de.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)},de.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var ye={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},me=function(e){return 32<=e&&e<=127||160<=e&&e<=255},ve=function(e){this.windowNum=e,this.reset()};ve.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},ve.prototype.getText=function(){return this.rows.join("\n")},ve.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},ve.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--},ve.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},ve.prototype.addText=function(e){this.rows[this.rowIdx]+=e},ve.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var ge=function(e){this.serviceNum=e,this.text="",this.currentWindow=new ve(-1),this.windows=[]};ge.prototype.init=function(e,t){this.startPts=e;for(var r=0;r<8;r++)this.windows[r]=new ve(r),"function"==typeof t&&(this.windows[r].beforeRowOverflow=t)},ge.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]};var be=function e(){e.prototype.init.call(this);var t=this;this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(t.new708Packet(),t.add708Bytes(e)):(null===t.current708Packet&&t.new708Packet(),t.add708Bytes(e))}};be.prototype=new V,be.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},be.prototype.add708Bytes=function(e){var t=e.ccData,r=t>>>8,n=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(r),this.current708Packet.data.push(n)},be.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,r=null,n=null,i=0,o=t[i++];for(e.seq=o>>6,e.sizeCode=63&o;i<t.length;i++)n=31&(o=t[i++]),7==(r=o>>5)&&n>0&&(r=o=t[i++]),this.pushServiceBlock(r,i,n),n>0&&(i+=n-1)},be.prototype.pushServiceBlock=function(e,t,r){var n,i=t,o=this.current708Packet.data,a=this.services[e];for(a||(a=this.initService(e,i));i<t+r&&i<o.length;i++)n=o[i],me(n)?i=this.handleText(i,a):16===n?i=this.extendedCommands(i,a):128<=n&&n<=135?i=this.setCurrentWindow(i,a):152<=n&&n<=159?i=this.defineWindow(i,a):136===n?i=this.clearWindows(i,a):140===n?i=this.deleteWindows(i,a):137===n?i=this.displayWindows(i,a):138===n?i=this.hideWindows(i,a):139===n?i=this.toggleWindows(i,a):151===n?i=this.setWindowAttributes(i,a):144===n?i=this.setPenAttributes(i,a):145===n?i=this.setPenColor(i,a):146===n?i=this.setPenLocation(i,a):143===n?a=this.reset(i,a):8===n?a.currentWindow.backspace():12===n?a.currentWindow.clearText():13===n?a.currentWindow.pendingNewLine=!0:14===n?a.currentWindow.clearText():141===n&&i++},be.prototype.extendedCommands=function(e,t){var r=this.current708Packet.data[++e];return me(r)&&(e=this.handleText(e,t,!0)),e},be.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},be.prototype.initService=function(e,t){var r=this;return this.services[e]=new ge(e),this.services[e].init(this.getPts(t),(function(t){r.flushDisplayed(t,r.services[e])})),this.services[e]},be.prototype.handleText=function(e,t,r){var n,i,o=this.current708Packet.data[e],a=(i=ye[n=(r?4096:0)|o]||n,4096&n&&n===i?"":String.fromCharCode(i)),s=t.currentWindow;return s.pendingNewLine&&!s.isEmpty()&&s.newLine(this.getPts(e)),s.pendingNewLine=!1,s.addText(a),e},be.prototype.setCurrentWindow=function(e,t){var r=7&this.current708Packet.data[e];return t.setCurrentWindow(r),e},be.prototype.defineWindow=function(e,t){var r=this.current708Packet.data,n=r[e],i=7&n;t.setCurrentWindow(i);var o=t.currentWindow;return n=r[++e],o.visible=(32&n)>>5,o.rowLock=(16&n)>>4,o.columnLock=(8&n)>>3,o.priority=7&n,n=r[++e],o.relativePositioning=(128&n)>>7,o.anchorVertical=127&n,n=r[++e],o.anchorHorizontal=n,n=r[++e],o.anchorPoint=(240&n)>>4,o.rowCount=15&n,n=r[++e],o.columnCount=63&n,n=r[++e],o.windowStyle=(56&n)>>3,o.penStyle=7&n,o.virtualRowCount=o.rowCount+1,e},be.prototype.setWindowAttributes=function(e,t){var r=this.current708Packet.data,n=r[e],i=t.currentWindow.winAttr;return n=r[++e],i.fillOpacity=(192&n)>>6,i.fillRed=(48&n)>>4,i.fillGreen=(12&n)>>2,i.fillBlue=3&n,n=r[++e],i.borderType=(192&n)>>6,i.borderRed=(48&n)>>4,i.borderGreen=(12&n)>>2,i.borderBlue=3&n,n=r[++e],i.borderType+=(128&n)>>5,i.wordWrap=(64&n)>>6,i.printDirection=(48&n)>>4,i.scrollDirection=(12&n)>>2,i.justify=3&n,n=r[++e],i.effectSpeed=(240&n)>>4,i.effectDirection=(12&n)>>2,i.displayEffect=3&n,e},be.prototype.flushDisplayed=function(e,t){for(var r=[],n=0;n<8;n++)t.windows[n].visible&&!t.windows[n].isEmpty()&&r.push(t.windows[n].getText());t.endPts=e,t.text=r.join("\n\n"),this.pushCaption(t),t.startPts=e},be.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)},be.prototype.displayWindows=function(e,t){var r=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var i=0;i<8;i++)r&1<<i&&(t.windows[i].visible=1);return e},be.prototype.hideWindows=function(e,t){var r=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var i=0;i<8;i++)r&1<<i&&(t.windows[i].visible=0);return e},be.prototype.toggleWindows=function(e,t){var r=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var i=0;i<8;i++)r&1<<i&&(t.windows[i].visible^=1);return e},be.prototype.clearWindows=function(e,t){var r=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var i=0;i<8;i++)r&1<<i&&t.windows[i].clearText();return e},be.prototype.deleteWindows=function(e,t){var r=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var i=0;i<8;i++)r&1<<i&&t.windows[i].reset();return e},be.prototype.setPenAttributes=function(e,t){var r=this.current708Packet.data,n=r[e],i=t.currentWindow.penAttr;return n=r[++e],i.textTag=(240&n)>>4,i.offset=(12&n)>>2,i.penSize=3&n,n=r[++e],i.italics=(128&n)>>7,i.underline=(64&n)>>6,i.edgeType=(56&n)>>3,i.fontStyle=7&n,e},be.prototype.setPenColor=function(e,t){var r=this.current708Packet.data,n=r[e],i=t.currentWindow.penColor;return n=r[++e],i.fgOpacity=(192&n)>>6,i.fgRed=(48&n)>>4,i.fgGreen=(12&n)>>2,i.fgBlue=3&n,n=r[++e],i.bgOpacity=(192&n)>>6,i.bgRed=(48&n)>>4,i.bgGreen=(12&n)>>2,i.bgBlue=3&n,n=r[++e],i.edgeRed=(48&n)>>4,i.edgeGreen=(12&n)>>2,i.edgeBlue=3&n,e},be.prototype.setPenLocation=function(e,t){var r=this.current708Packet.data,n=r[e],i=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,n=r[++e],i.row=15&n,n=r[++e],i.column=63&n,e},be.prototype.reset=function(e,t){var r=this.getPts(e);return this.flushDisplayed(r,t),this.initService(t.serviceNum,e)};var _e={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},we=function(e){return null===e?"":(e=_e[e]||e,String.fromCharCode(e))},Te=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Se=function(){for(var e=[],t=15;t--;)e.push("");return e},Ee=function e(t,r){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=r||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,r,n,i,o;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),n=t>>>8,i=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),r=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=r,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_=Se();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Se();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Se()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,i))o=we((n=(3&n)<<8)|i),this[this.mode_](e.pts,o),this.column_++;else if(this.isExtCharacter(n,i))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),o=we((n=(3&n)<<8)|i),this[this.mode_](e.pts,o),this.column_++;else if(this.isMidRowCode(n,i))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&i)&&this.addFormatting(e.pts,["i"]),1==(1&i)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,i))this.column_+=3&i;else if(this.isPAC(n,i)){var a=Te.indexOf(7968&t);"rollUp"===this.mode_&&(a-this.rollUpRows_+1<0&&(a=this.rollUpRows_-1),this.setRollUp(e.pts,a)),a!==this.row_&&(this.clearFormatting(e.pts),this.row_=a),1&i&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(i)&&14==(14&i)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(n)&&(0===i&&(i=null),o=we(n),o+=we(i),this[this.mode_](e.pts,o),this.column_+=o.length)}else this.lastControlCode_=null}};Ee.prototype=new V,Ee.prototype.flushDisplayed=function(e){var t=this.displayed_.map((function(e){try{return e.trim()}catch(e){return console.error("Skipping malformed caption."),""}})).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},Ee.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Se(),this.nonDisplayed_=Se(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},Ee.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_},Ee.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},Ee.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},Ee.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},Ee.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},Ee.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},Ee.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},Ee.prototype.isNormalChar=function(e){return e>=32&&e<=127},Ee.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Se(),this.displayed_=Se()),void 0!==t&&t!==this.row_)for(var r=0;r<this.rollUpRows_;r++)this.displayed_[t-r]=this.displayed_[this.row_-r],this.displayed_[this.row_-r]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},Ee.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var r=t.reduce((function(e,t){return e+"<"+t+">"}),"");this[this.mode_](e,r)},Ee.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)}},Ee.prototype.popOn=function(e,t){var r=this.nonDisplayed_[this.row_];r+=t,this.nonDisplayed_[this.row_]=r},Ee.prototype.rollUp=function(e,t){var r=this.displayed_[this.row_];r+=t,this.displayed_[this.row_]=r},Ee.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_]=""},Ee.prototype.paintOn=function(e,t){var r=this.displayed_[this.row_];r+=t,this.displayed_[this.row_]=r};var Oe={CaptionStream:de,Cea608Stream:Ee,Cea708Stream:be},ke={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Ce="shared",Pe=function(e,t){var r=1;for(e>t&&(r=-1);Math.abs(t-e)>4294967296;)e+=8589934592*r;return e},xe=function e(t){var r,n;e.prototype.init.call(this),this.type_=t||Ce,this.push=function(e){this.type_!==Ce&&e.type!==this.type_||(void 0===n&&(n=e.dts),e.dts=Pe(e.dts,n),e.pts=Pe(e.pts,n),r=e.dts,this.trigger("data",e))},this.flush=function(){n=r,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){n=void 0,r=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};xe.prototype=new V;var je,Le=xe,Ie=Pe,Ae=function(e,t,r){var n,i="";for(n=t;n<r;n++)i+="%"+("00"+e[n].toString(16)).slice(-2);return i},Re=function(e,t,r){return decodeURIComponent(Ae(e,t,r))},De=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Me={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=Re(e.data,1,t),e.value=Re(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=Re(e.data,1,t),e.url=Re(e.data,t+1,e.data.length);break}},PRIV:function(e){var t,r;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=(r=e.data,unescape(Ae(r,0,t)));break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}};je=function(e){var t,r={debug:!(!e||!e.debug),descriptor:e&&e.descriptor},n=0,i=[],o=0;if(je.prototype.init.call(this),this.dispatchType=ke.METADATA_STREAM_TYPE.toString(16),r.descriptor)for(t=0;t<r.descriptor.length;t++)this.dispatchType+=("00"+r.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,a,s,u,l;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(o=0,i.length=0),0===i.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))r.debug&&console.log("Skipping unrecognized metadata packet");else if(i.push(e),o+=e.data.byteLength,1===i.length&&(n=De(e.data.subarray(6,10)),n+=10),!(o<n)){for(t={data:new Uint8Array(n),frames:[],pts:i[0].pts,dts:i[0].dts},l=0;l<n;)t.data.set(i[0].data.subarray(0,n-l),l),l+=i[0].data.byteLength,o-=i[0].data.byteLength,i.shift();a=10,64&t.data[5]&&(a+=4,a+=De(t.data.subarray(10,14)),n-=De(t.data.subarray(16,20)));do{if((s=De(t.data.subarray(a+4,a+8)))<1)return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if((u={id:String.fromCharCode(t.data[a],t.data[a+1],t.data[a+2],t.data[a+3]),data:t.data.subarray(a+10,a+s+10)}).key=u.id,Me[u.id]&&(Me[u.id](u),"com.apple.streaming.transportStreamTimestamp"===u.owner)){var c=u.data,f=(1&c[3])<<30|c[4]<<22|c[5]<<14|c[6]<<6|c[7]>>>2;f*=4,f+=3&c[7],u.timeStamp=f,void 0===t.pts&&void 0===t.dts&&(t.pts=u.timeStamp,t.dts=u.timeStamp),this.trigger("timestamp",u)}t.frames.push(u),a+=10,a+=s}while(a<n);this.trigger("data",t)}}},je.prototype=new V;var Ne,Be,Ue,Fe=je,Ve=Le,He=188;(Ne=function(){var e=new Uint8Array(He),t=0;Ne.prototype.init.call(this),this.push=function(r){var n,i=0,o=He;for(t?((n=new Uint8Array(r.byteLength+t)).set(e.subarray(0,t)),n.set(r,t),t=0):n=r;o<n.byteLength;)71!==n[i]||71!==n[o]?(i++,o++):(this.trigger("data",n.subarray(i,o)),i+=He,o+=He);i<n.byteLength&&(e.set(n.subarray(i),0),t=n.byteLength-i)},this.flush=function(){t===He&&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 V,Be=function(){var e,t,r,n;Be.prototype.init.call(this),n=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,n){var i=0;n.payloadUnitStartIndicator&&(i+=e[i]+1),"pat"===n.type?t(e.subarray(i),n):r(e.subarray(i),n)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],n.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=n.pmtPid},r=function(e,t){var r,i;if(1&e[5]){for(n.programMapTable={video:null,audio:null,"timed-metadata":{}},r=3+((15&e[1])<<8|e[2])-4,i=12+((15&e[10])<<8|e[11]);i<r;){var o=e[i],a=(31&e[i+1])<<8|e[i+2];o===ke.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=a:o===ke.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=a:o===ke.METADATA_STREAM_TYPE&&(n.programMapTable["timed-metadata"][a]=o),i+=5+((15&e[i+3])<<8|e[i+4])}t.programMapTable=n.programMapTable}},this.push=function(t){var r={},n=4;if(r.payloadUnitStartIndicator=!!(64&t[1]),r.pid=31&t[1],r.pid<<=8,r.pid|=t[2],(48&t[3])>>>4>1&&(n+=t[n]+1),0===r.pid)r.type="pat",e(t.subarray(n),r),this.trigger("data",r);else if(r.pid===this.pmtPid)for(r.type="pmt",e(t.subarray(n),r),this.trigger("data",r);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,r]):this.processPes_(t,n,r)},this.processPes_=function(e,t,r){r.pid===this.programMapTable.video?r.streamType=ke.H264_STREAM_TYPE:r.pid===this.programMapTable.audio?r.streamType=ke.ADTS_STREAM_TYPE:r.streamType=this.programMapTable["timed-metadata"][r.pid],r.type="pes",r.data=e.subarray(t),this.trigger("data",r)}},Be.prototype=new V,Be.STREAM_TYPES={h264:27,adts:15},Ue=function(){var e,t=this,r={data:[],size:0},n={data:[],size:0},i={data:[],size:0},o=function(e,r,n){var i,o,a=new Uint8Array(e.size),s={type:r},u=0,l=0;if(e.data.length&&!(e.size<9)){for(s.trackId=e.data[0].pid,u=0;u<e.data.length;u++)o=e.data[u],a.set(o.data,l),l+=o.data.byteLength;var c,f,h,p;f=s,p=(c=a)[0]<<16|c[1]<<8|c[2],f.data=new Uint8Array,1===p&&(f.packetLength=6+(c[4]<<8|c[5]),f.dataAlignmentIndicator=0!=(4&c[6]),192&(h=c[7])&&(f.pts=(14&c[9])<<27|(255&c[10])<<20|(254&c[11])<<12|(255&c[12])<<5|(254&c[13])>>>3,f.pts*=4,f.pts+=(6&c[13])>>>1,f.dts=f.pts,64&h&&(f.dts=(14&c[14])<<27|(255&c[15])<<20|(254&c[16])<<12|(255&c[17])<<5|(254&c[18])>>>3,f.dts*=4,f.dts+=(6&c[18])>>>1)),f.data=c.subarray(9+c[8])),i="video"===r||s.packetLength<=e.size,(n||i)&&(e.size=0,e.data.length=0),i&&t.trigger("data",s)}};Ue.prototype.init.call(this),this.push=function(a){({pat:function(){},pes:function(){var e,t;switch(a.streamType){case ke.H264_STREAM_TYPE:e=r,t="video";break;case ke.ADTS_STREAM_TYPE:e=n,t="audio";break;case ke.METADATA_STREAM_TYPE:e=i,t="timed-metadata";break;default:return}a.payloadUnitStartIndicator&&o(e,t,!0),e.data.push(a),e.size+=a.data.byteLength},pmt:function(){var r={type:"metadata",tracks:[]};null!==(e=a.programMapTable).video&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",r)}})[a.type]()},this.reset=function(){r.size=0,r.data.length=0,n.size=0,n.data.length=0,this.trigger("reset")},this.flushStreams_=function(){o(r,"video"),o(n,"audio"),o(i,"timed-metadata")},this.flush=function(){this.flushStreams_(),this.trigger("done")}},Ue.prototype=new V;var qe={PAT_PID:0,MP2T_PACKET_LENGTH:He,TransportPacketStream:Ne,TransportParseStream:Be,ElementaryStream:Ue,TimestampRolloverStream:Ve,CaptionStream:Oe.CaptionStream,Cea608Stream:Oe.Cea608Stream,Cea708Stream:Oe.Cea708Stream,MetadataStream:Fe};for(var ze in ke)ke.hasOwnProperty(ze)&&(qe[ze]=ke[ze]);var We,Ge=qe,Xe=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];We=function(e){var t,r=0;We.prototype.init.call(this),this.push=function(n){var i,o,a,s,u,l,c=0;if(e||(r=0),"audio"===n.type)for(t?(s=t,(t=new Uint8Array(s.byteLength+n.data.byteLength)).set(s),t.set(n.data,s.byteLength)):t=n.data;c+5<t.length;)if(255===t[c]&&240==(246&t[c+1])){if(o=2*(1&~t[c+1]),i=(3&t[c+3])<<11|t[c+4]<<3|(224&t[c+5])>>5,l=9e4*(u=1024*(1+(3&t[c+6])))/Xe[(60&t[c+2])>>>2],a=c+i,t.byteLength<a)return;if(this.trigger("data",{pts:n.pts+r*l,dts:n.dts+r*l,sampleCount:u,audioobjecttype:1+(t[c+2]>>>6&3),channelcount:(1&t[c+2])<<2|(192&t[c+3])>>>6,samplerate:Xe[(60&t[c+2])>>>2],samplingfrequencyindex:(60&t[c+2])>>>2,samplesize:16,data:t.subarray(c+7+o,a)}),r++,t.byteLength===a)return void(t=void 0);t=t.subarray(a)}else c++},this.flush=function(){r=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}},We.prototype=new V;var Ke,Ye,Qe,$e=We,Je=function(e){var t=e.byteLength,r=0,n=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+n},this.loadWord=function(){var i=e.byteLength-t,o=new Uint8Array(4),a=Math.min(4,t);if(0===a)throw new Error("no bytes available");o.set(e.subarray(i,i+a)),r=new DataView(o.buffer).getUint32(0),n=8*a,t-=a},this.skipBits=function(e){var i;n>e?(r<<=e,n-=e):(e-=n,e-=8*(i=Math.floor(e/8)),t-=i,this.loadWord(),r<<=e,n-=e)},this.readBits=function(e){var i=Math.min(n,e),o=r>>>32-i;return(n-=i)>0?r<<=i:t>0&&this.loadWord(),(i=e-i)>0?o<<i|this.readBits(i):o},this.skipLeadingZeros=function(){var e;for(e=0;e<n;++e)if(0!=(r&2147483648>>>e))return r<<=e,n-=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()};Ye=function(){var e,t,r=0;Ye.prototype.init.call(this),this.push=function(n){var i;t?((i=new Uint8Array(t.byteLength+n.data.byteLength)).set(t),i.set(n.data,t.byteLength),t=i):t=n.data;for(var o=t.byteLength;r<o-3;r++)if(1===t[r+2]){e=r+5;break}for(;e<o;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}r+3!==e-2&&this.trigger("data",t.subarray(r+3,e-2));do{e++}while(1!==t[e]&&e<o);r=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(r+3,e-2)),r=e-2,e+=3;break;default:e+=3}t=t.subarray(r),e-=r,r=0},this.reset=function(){t=null,r=0,this.trigger("reset")},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(r+3)),t=null,r=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Ye.prototype=new V,Qe={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Ke=function(){var e,t,r,n,i,o,a,s=new Ye;Ke.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,r=e.pts,n=e.dts,s.push(e))},s.on("data",(function(a){var s={trackId:t,pts:r,dts:n,data:a};switch(31&a[0]){case 5:s.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:s.nalUnitType="sei_rbsp",s.escapedRBSP=i(a.subarray(1));break;case 7:s.nalUnitType="seq_parameter_set_rbsp",s.escapedRBSP=i(a.subarray(1)),s.config=o(s.escapedRBSP);break;case 8:s.nalUnitType="pic_parameter_set_rbsp";break;case 9:s.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",s)})),s.on("done",(function(){e.trigger("done")})),s.on("partialdone",(function(){e.trigger("partialdone")})),s.on("reset",(function(){e.trigger("reset")})),s.on("endedtimeline",(function(){e.trigger("endedtimeline")})),this.flush=function(){s.flush()},this.partialFlush=function(){s.partialFlush()},this.reset=function(){s.reset()},this.endTimeline=function(){s.endTimeline()},a=function(e,t){var r,n=8,i=8;for(r=0;r<e;r++)0!==i&&(i=(n+t.readExpGolomb()+256)%256),n=0===i?n:i},i=function(e){for(var t,r,n=e.byteLength,i=[],o=1;o<n-2;)0===e[o]&&0===e[o+1]&&3===e[o+2]?(i.push(o+2),o+=2):o++;if(0===i.length)return e;t=n-i.length,r=new Uint8Array(t);var a=0;for(o=0;o<t;a++,o++)a===i[0]&&(a++,i.shift()),r[o]=e[a];return r},o=function(e){var t,r,n,i,o,s,u,l,c,f,h,p,d,y=0,m=0,v=0,g=0,b=1;if(r=(t=new Je(e)).readUnsignedByte(),i=t.readUnsignedByte(),n=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),Qe[r]&&(3===(o=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(h=3!==o?8:12,d=0;d<h;d++)t.readBoolean()&&a(d<6?16:64,t);if(t.skipUnsignedExpGolomb(),0===(s=t.readUnsignedExpGolomb()))t.readUnsignedExpGolomb();else if(1===s)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),u=t.readUnsignedExpGolomb(),d=0;d<u;d++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),l=t.readUnsignedExpGolomb(),c=t.readUnsignedExpGolomb(),0===(f=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(y=t.readUnsignedExpGolomb(),m=t.readUnsignedExpGolomb(),v=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:p=[1,1];break;case 2:p=[12,11];break;case 3:p=[10,11];break;case 4:p=[16,11];break;case 5:p=[40,33];break;case 6:p=[24,11];break;case 7:p=[20,11];break;case 8:p=[32,11];break;case 9:p=[80,33];break;case 10:p=[18,11];break;case 11:p=[15,11];break;case 12:p=[64,33];break;case 13:p=[160,99];break;case 14:p=[4,3];break;case 15:p=[3,2];break;case 16:p=[2,1];break;case 255:p=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}p&&(b=p[0]/p[1])}return{profileIdc:r,levelIdc:n,profileCompatibility:i,width:Math.ceil((16*(l+1)-2*y-2*m)*b),height:(2-f)*(c+1)*16-2*v-2*g,sarRatio:p}}},Ke.prototype=new V;var Ze,et={H264Stream:Ke,NalByteStream:Ye},tt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],rt=function(e,t){var r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return r=r>=0?r:0,(16&e[t+5])>>4?r+20:r+10},nt=function e(t,r){return t.length-r<10||t[r]!=="I".charCodeAt(0)||t[r+1]!=="D".charCodeAt(0)||t[r+2]!=="3".charCodeAt(0)?r:e(t,r+=rt(t,r))},it=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},ot={isLikelyAacData:function(e){var t=nt(e,0);return e.length>=t+2&&255==(255&e[t])&&240==(240&e[t+1])&&16==(22&e[t+1])},parseId3TagSize:rt,parseAdtsSize:function(e,t){var r=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|r},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 tt[(60&e[t+2])>>>2];t++}return null},parseAacTimestamp:function(e){var t,r,n;t=10,64&e[5]&&(t+=4,t+=it(e.subarray(10,14)));do{if((r=it(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){n=e.subarray(t+10,t+r+10);for(var i=0;i<n.byteLength;i++)if(0===n[i]){var o=unescape(function(e,t,r){var n,i="";for(n=0;n<r;n++)i+="%"+("00"+e[n].toString(16)).slice(-2);return i}(n,0,i));if("com.apple.streaming.transportStreamTimestamp"===o){var a=n.subarray(i+1),s=(1&a[3])<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2;return(s*=4)+(3&a[7])}break}}t+=10,t+=r}while(t<e.byteLength);return null}};(Ze=function(){var e=new Uint8Array,t=0;Ze.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(r){var n,i,o,a,s=0,u=0;for(e.length?(a=e.length,(e=new Uint8Array(r.byteLength+a)).set(e.subarray(0,a)),e.set(r,a)):e=r;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+(s=ot.parseAdtsSize(e,u))>e.length)break;o={type:"audio",data:e.subarray(u,u+s),pts:t,dts:t},this.trigger("data",o),u+=s}else{if(e.length-u<10)break;if(u+(s=ot.parseId3TagSize(e,u))>e.length)break;i={type:"timed-metadata",data:e.subarray(u,u+s)},this.trigger("data",i),u+=s}n=e.length-u,e=n>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 V;var at,st,ut,lt,ct=Ze,ft=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],ht=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],pt=et.H264Stream,dt=ot.isLikelyAacData,yt=function(e,t){var r;if(e.length!==t.length)return!1;for(r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0},mt=function(e,t,r,n,i,o){return{start:{dts:e,pts:e+(r-t)},end:{dts:e+(n-t),pts:e+(i-r)},prependedContentDuration:o,baseMediaDecodeTime:e}};st=function(e,t){var r=[],n=0,i=0,o=0,a=1/0;t=t||{},st.prototype.init.call(this),this.push=function(t){pe(e,t),e&&ft.forEach((function(r){e[r]=t[r]})),r.push(t)},this.setEarliestDts=function(e){i=e},this.setVideoBaseMediaDecodeTime=function(e){a=e},this.setAudioAppendStart=function(e){o=e},this.flush=function(){var s,u,l,c,f,h,p;0!==r.length?(s=function(e,t,r){return t.minSegmentDts>=r?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=r&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))}(r,e,i),e.baseMediaDecodeTime=he(e,t.keepOriginalTimestamps),p=ce(e,s,o,a),e.samples=function(e){var t,r,n=[];for(t=0;t<e.length;t++)r=e[t],n.push({size:r.data.byteLength,duration:1024});return n}(s),l=$(function(e){var t,r,n=0,i=new Uint8Array(function(e){var t,r=0;for(t=0;t<e.length;t++)r+=e[t].data.byteLength;return r}(e));for(t=0;t<e.length;t++)r=e[t],i.set(r.data,n),n+=r.data.byteLength;return i}(s)),r=[],u=J(n,[e]),c=new Uint8Array(u.byteLength+l.byteLength),n++,c.set(u),c.set(l,u.byteLength),fe(e),f=Math.ceil(9216e4/e.samplerate),s.length&&(h=s.length*f,this.trigger("segmentTimingInfo",mt(se(e.baseMediaDecodeTime,e.samplerate),s[0].dts,s[0].pts,s[0].dts+h,s[0].pts+h,p||0)),this.trigger("timingInfo",{start:s[0].pts,end:s[0].pts+h})),this.trigger("data",{track:e,boxes:c}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.reset=function(){fe(e),r=[],this.trigger("reset")}},st.prototype=new V,at=function(e,t){var r,n,i=0,o=[],a=[];t=t||{},at.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){pe(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||r||(r=t.config,e.sps=[t.data],ht.forEach((function(t){e[t]=r[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||n||(n=t.data,e.pps=[t.data]),o.push(t)},this.flush=function(){for(var r,n,s,u,l,c,f,h,p=0;o.length&&"access_unit_delimiter_rbsp"!==o[0].nalUnitType;)o.shift();if(0===o.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(r=function(e){var t,r,n=[],i=[];for(i.byteLength=0,i.nalCount=0,i.duration=0,n.byteLength=0,t=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(r=e[t]).nalUnitType?(n.length&&(n.duration=r.dts-n.dts,i.byteLength+=n.byteLength,i.nalCount+=n.length,i.duration+=n.duration,i.push(n)),(n=[r]).byteLength=r.data.byteLength,n.pts=r.pts,n.dts=r.dts):("slice_layer_without_partitioning_rbsp_idr"===r.nalUnitType&&(n.keyFrame=!0),n.duration=r.dts-n.dts,n.byteLength+=r.data.byteLength,n.push(r));return i.length&&(!n.duration||n.duration<=0)&&(n.duration=i[i.length-1].duration),i.byteLength+=n.byteLength,i.nalCount+=n.length,i.duration+=n.duration,i.push(n),i}(o),(s=function(e){var t,r,n=[],i=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts,i.byteLength=0,i.nalCount=0,i.duration=0,i.pts=e[0].pts,i.dts=e[0].dts,t=0;t<e.length;t++)(r=e[t]).keyFrame?(n.length&&(i.push(n),i.byteLength+=n.byteLength,i.nalCount+=n.nalCount,i.duration+=n.duration),(n=[r]).nalCount=r.length,n.byteLength=r.byteLength,n.pts=r.pts,n.dts=r.dts,n.duration=r.duration):(n.duration+=r.duration,n.nalCount+=r.length,n.byteLength+=r.byteLength,n.push(r));return i.length&&n.duration<=0&&(n.duration=i[i.length-1].duration),i.byteLength+=n.byteLength,i.nalCount+=n.nalCount,i.duration+=n.duration,i.push(n),i}(r))[0][0].keyFrame||((n=this.getGopForFusion_(o[0],e))?(p=n.duration,s.unshift(n),s.byteLength+=n.byteLength,s.nalCount+=n.nalCount,s.pts=n.pts,s.dts=n.dts,s.duration+=n.duration):s=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}(s)),a.length){var d;if(!(d=t.alignGopsAtEnd?this.alignGopsAtEnd_(s):this.alignGopsAtStart_(s)))return this.gopCache_.unshift({gop:s.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),o=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");fe(e),s=d}pe(e,s),e.samples=function(e,t){var r,n,i,o,a,s=t||0,u=[];for(r=0;r<e.length;r++)for(o=e[r],n=0;n<o.length;n++)a=o[n],s+=(i=Z(a,s)).size,u.push(i);return u}(s),l=$(function(e){var t,r,n,i,o,a,s=0,u=e.byteLength,l=e.nalCount,c=new Uint8Array(u+4*l),f=new DataView(c.buffer);for(t=0;t<e.length;t++)for(i=e[t],r=0;r<i.length;r++)for(o=i[r],n=0;n<o.length;n++)a=o[n],f.setUint32(s,a.data.byteLength),s+=4,c.set(a.data,s),s+=a.data.byteLength;return c}(s)),e.baseMediaDecodeTime=he(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",s.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),f=s[0],h=s[s.length-1],this.trigger("segmentTimingInfo",mt(e.baseMediaDecodeTime,f.dts,f.pts,h.dts+h.duration,h.pts+h.duration,p)),this.trigger("timingInfo",{start:s[0].pts,end:s[s.length-1].pts+s[s.length-1].duration}),this.gopCache_.unshift({gop:s.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),o=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),u=J(i,[e]),c=new Uint8Array(u.byteLength+l.byteLength),i++,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_(),o=[],this.gopCache_.length=0,a.length=0,this.trigger("reset")},this.resetStream_=function(){fe(e),r=void 0,n=void 0},this.getGopForFusion_=function(t){var r,n,i,o,a,s=1/0;for(a=0;a<this.gopCache_.length;a++)i=(o=this.gopCache_[a]).gop,e.pps&&yt(e.pps[0],o.pps[0])&&e.sps&&yt(e.sps[0],o.sps[0])&&(i.dts<e.timelineStartInfo.dts||(r=t.dts-i.dts-i.duration)>=-1e4&&r<=45e3&&(!n||s>r)&&(n=o,s=r));return n?n.gop:null},this.alignGopsAtStart_=function(e){var t,r,n,i,o,s,u,l;for(o=e.byteLength,s=e.nalCount,u=e.duration,t=r=0;t<a.length&&r<e.length&&(n=a[t],i=e[r],n.pts!==i.pts);)i.pts>n.pts?t++:(r++,o-=i.byteLength,s-=i.nalCount,u-=i.duration);return 0===r?e:r===e.length?null:((l=e.slice(r)).byteLength=o,l.duration=u,l.nalCount=s,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(e){var t,r,n,i,o,s,u;for(t=a.length-1,r=e.length-1,o=null,s=!1;t>=0&&r>=0;){if(n=a[t],i=e[r],n.pts===i.pts){s=!0;break}n.pts>i.pts?t--:(t===a.length-1&&(o=r),r--)}if(!s&&null===o)return null;if(0===(u=s?r:o))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){a=e}},at.prototype=new V,lt=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,lt.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))))}},lt.prototype=new V,lt.prototype.flush=function(e){var t,r,n,o,a=0,s={captions:[],captionStreams:{},metadata:[],info:{}},l=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?(l=this.videoTrack.timelineStartInfo.pts,ht.forEach((function(e){s.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(l=this.audioTrack.timelineStartInfo.pts,ft.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,n=function(e){var t,r=i(),n=u(e);return(t=new Uint8Array(r.byteLength+n.byteLength)).set(r),t.set(n,r.byteLength),t}(this.pendingTracks),s.initSegment=new Uint8Array(n.byteLength),s.initSegment.set(n),s.data=new Uint8Array(this.pendingBytes),o=0;o<this.pendingBoxes.length;o++)s.data.set(this.pendingBoxes[o],a),a+=this.pendingBoxes[o].byteLength;for(o=0;o<this.pendingCaptions.length;o++)(t=this.pendingCaptions[o]).startTime=le(t.startPts,l,this.keepOriginalTimestamps),t.endTime=le(t.endPts,l,this.keepOriginalTimestamps),s.captionStreams[t.stream]=!0,s.captions.push(t);for(o=0;o<this.pendingMetadata.length;o++)(r=this.pendingMetadata[o]).cueTime=le(r.pts,l,this.keepOriginalTimestamps),s.metadata.push(r);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),o=0;o<s.captions.length;o++)t=s.captions[o],this.trigger("caption",t);for(o=0;o<s.metadata.length;o++)r=s.metadata[o],this.trigger("id3Frame",r)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},lt.prototype.setRemux=function(e){this.remuxTracks=e},ut=function(e){var t,r,n=this,i=!0;ut.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var i={};this.transmuxPipeline_=i,i.type="aac",i.metadataStream=new Ge.MetadataStream,i.aacStream=new ct,i.audioTimestampRolloverStream=new Ge.TimestampRolloverStream("audio"),i.timedMetadataTimestampRolloverStream=new Ge.TimestampRolloverStream("timed-metadata"),i.adtsStream=new $e,i.coalesceStream=new lt(e,i.metadataStream),i.headOfPipeline=i.aacStream,i.aacStream.pipe(i.audioTimestampRolloverStream).pipe(i.adtsStream),i.aacStream.pipe(i.timedMetadataTimestampRolloverStream).pipe(i.metadataStream).pipe(i.coalesceStream),i.metadataStream.on("timestamp",(function(e){i.aacStream.setTimestamp(e.timeStamp)})),i.aacStream.on("data",(function(o){"timed-metadata"!==o.type&&"audio"!==o.type||i.audioSegmentStream||(r=r||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"},i.coalesceStream.numberOfTracks++,i.audioSegmentStream=new st(r,e),i.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream),n.trigger("trackinfo",{hasAudio:!!r,hasVideo:!!t}))})),i.coalesceStream.on("data",this.trigger.bind(this,"data")),i.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var i={};this.transmuxPipeline_=i,i.type="ts",i.metadataStream=new Ge.MetadataStream,i.packetStream=new Ge.TransportPacketStream,i.parseStream=new Ge.TransportParseStream,i.elementaryStream=new Ge.ElementaryStream,i.timestampRolloverStream=new Ge.TimestampRolloverStream,i.adtsStream=new $e,i.h264Stream=new pt,i.captionStream=new Ge.CaptionStream(e),i.coalesceStream=new lt(e,i.metadataStream),i.headOfPipeline=i.packetStream,i.packetStream.pipe(i.parseStream).pipe(i.elementaryStream).pipe(i.timestampRolloverStream),i.timestampRolloverStream.pipe(i.h264Stream),i.timestampRolloverStream.pipe(i.adtsStream),i.timestampRolloverStream.pipe(i.metadataStream).pipe(i.coalesceStream),i.h264Stream.pipe(i.captionStream).pipe(i.coalesceStream),i.elementaryStream.on("data",(function(o){var a;if("metadata"===o.type){for(a=o.tracks.length;a--;)t||"video"!==o.tracks[a].type?r||"audio"!==o.tracks[a].type||((r=o.tracks[a]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime):(t=o.tracks[a]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime;t&&!i.videoSegmentStream&&(i.coalesceStream.numberOfTracks++,i.videoSegmentStream=new at(t,e),i.videoSegmentStream.on("timelineStartInfo",(function(t){r&&!e.keepOriginalTimestamps&&(r.timelineStartInfo=t,i.audioSegmentStream.setEarliestDts(t.dts-n.baseMediaDecodeTime))})),i.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo")),i.videoSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"videoSegmentTimingInfo")),i.videoSegmentStream.on("baseMediaDecodeTime",(function(e){r&&i.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),i.videoSegmentStream.on("timingInfo",n.trigger.bind(n,"videoTimingInfo")),i.h264Stream.pipe(i.videoSegmentStream).pipe(i.coalesceStream)),r&&!i.audioSegmentStream&&(i.coalesceStream.numberOfTracks++,i.audioSegmentStream=new st(r,e),i.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),i.audioSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"audioSegmentTimingInfo")),i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream)),n.trigger("trackinfo",{hasAudio:!!r,hasVideo:!!t})}})),i.coalesceStream.on("data",this.trigger.bind(this,"data")),i.coalesceStream.on("id3Frame",(function(e){e.dispatchType=i.metadataStream.dispatchType,n.trigger("id3Frame",e)})),i.coalesceStream.on("caption",this.trigger.bind(this,"caption")),i.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(n){var i=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),r&&(r.timelineStartInfo.dts=void 0,r.timelineStartInfo.pts=void 0,fe(r),i.audioTimestampRolloverStream&&i.audioTimestampRolloverStream.discontinuity()),t&&(i.videoSegmentStream&&(i.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,fe(t),i.captionStream.reset()),i.timestampRolloverStream&&i.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){r&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var r=this.transmuxPipeline_;e.remux=t,r&&r.coalesceStream&&r.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.push=function(e){if(i){var t=dt(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),i=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){i=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},ut.prototype=new V;var vt,gt,bt,_t={Transmuxer:ut,VideoSegmentStream:at,AudioSegmentStream:st,AUDIO_PROPERTIES:ft,VIDEO_PROPERTIES:ht,generateSegmentTimingInfo:mt},wt=function(e){return e>>>0},Tt=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),(t+=String.fromCharCode(e[2]))+String.fromCharCode(e[3])},St=wt,Et=function e(t,r){var n,i,o,a,s,u=[];if(!r.length)return null;for(n=0;n<t.byteLength;)i=St(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3]),o=Tt(t.subarray(n+4,n+8)),a=i>1?n+i:t.byteLength,o===r[0]&&(1===r.length?u.push(t.subarray(n+8,a)):(s=e(t.subarray(n+8,a),r.slice(1))).length&&(u=u.concat(s))),n=a;return u},Ot=wt,kt=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]}},Ct=function(e){for(var t,r,n=e.byteLength,i=[],o=1;o<n-2;)0===e[o]&&0===e[o+1]&&3===e[o+2]?(i.push(o+2),o+=2):o++;if(0===i.length)return e;t=n-i.length,r=new Uint8Array(t);var a=0;for(o=0;o<t;a++,o++)a===i[0]&&(a++,i.shift()),r[o]=e[a];return r},Pt=Oe.CaptionStream,xt=function(e,t){for(var r=e,n=0;n<t.length;n++){var i=t[n];if(r<i.size)return i;r-=i.size}return null},jt=function(e,t){var r=Et(e,["moof","traf"]),n=Et(e,["mdat"]),i={},o=[];return n.forEach((function(e,t){var n=r[t];o.push({mdat:e,traf:n})})),o.forEach((function(e){var r,n,o=e.mdat,a=e.traf,s=function(e){var t,r=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:r.getUint32(4)},i=1&n.flags[2],o=2&n.flags[2],a=8&n.flags[2],s=16&n.flags[2],u=32&n.flags[2],l=65536&n.flags[0],c=131072&n.flags[0];return t=8,i&&(t+=4,n.baseDataOffset=r.getUint32(12),t+=4),o&&(n.sampleDescriptionIndex=r.getUint32(t),t+=4),a&&(n.defaultSampleDuration=r.getUint32(t),t+=4),s&&(n.defaultSampleSize=r.getUint32(t),t+=4),u&&(n.defaultSampleFlags=r.getUint32(t)),l&&(n.durationIsEmpty=!0),!i&&c&&(n.baseDataOffsetIsMoof=!0),n}(Et(a,["tfhd"])[0]),u=s.trackId,l=Et(a,["tfdt"]),c=l.length>0?function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),baseMediaDecodeTime:Ot(e[4]<<24|e[5]<<16|e[6]<<8|e[7])};return 1===t.version&&(t.baseMediaDecodeTime*=Math.pow(2,32),t.baseMediaDecodeTime+=Ot(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),t}(l[0]).baseMediaDecodeTime:0,f=Et(a,["trun"]);t===u&&f.length>0&&(r=function(e,t,r){var n=t,i=r.defaultSampleDuration||0,o=r.defaultSampleSize||0,a=r.trackId,s=[];return e.forEach((function(e){var t=function(e){var t,r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),i=1&r.flags[2],o=4&r.flags[2],a=1&r.flags[1],s=2&r.flags[1],u=4&r.flags[1],l=8&r.flags[1],c=n.getUint32(4),f=8;for(i&&(r.dataOffset=n.getInt32(f),f+=4),o&&c&&(t={flags:kt(e.subarray(f,f+4))},f+=4,a&&(t.duration=n.getUint32(f),f+=4),s&&(t.size=n.getUint32(f),f+=4),l&&(1===r.version?t.compositionTimeOffset=n.getInt32(f):t.compositionTimeOffset=n.getUint32(f),f+=4),r.samples.push(t),c--);c--;)t={},a&&(t.duration=n.getUint32(f),f+=4),s&&(t.size=n.getUint32(f),f+=4),u&&(t.flags=kt(e.subarray(f,f+4)),f+=4),l&&(1===r.version?t.compositionTimeOffset=n.getInt32(f):t.compositionTimeOffset=n.getUint32(f),f+=4),r.samples.push(t);return r}(e).samples;t.forEach((function(e){void 0===e.duration&&(e.duration=i),void 0===e.size&&(e.size=o),e.trackId=a,e.dts=n,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),e.pts=n+e.compositionTimeOffset,n+=e.duration})),s=s.concat(t)})),s}(f,c,s),n=function(e,t,r){var n,i,o,a,s=new DataView(e.buffer,e.byteOffset,e.byteLength),u=[];for(i=0;i+4<e.length;i+=o)if(o=s.getUint32(i),i+=4,!(o<=0))switch(31&e[i]){case 6:var l=e.subarray(i+1,i+1+o),c=xt(i,t);if(n={nalUnitType:"sei_rbsp",size:o,data:l,escapedRBSP:Ct(l),trackId:r},c)n.pts=c.pts,n.dts=c.dts,a=c;else{if(!a){console.log("We've encountered a nal unit without data. See mux.js#233.");break}n.pts=a.pts,n.dts=a.dts}u.push(n)}return u}(o,r,u),i[u]||(i[u]=[]),i[u]=i[u].concat(n))})),i},Lt=function(){var e,t,r,n,i,o,a=!1;this.isInitialized=function(){return a},this.init=function(t){e=new Pt,a=!0,o=!!t&&t.isPartial,e.on("data",(function(e){e.startTime=e.startPts/n,e.endTime=e.endPts/n,i.captions.push(e),i.captionStreams[e.stream]=!0}))},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length||r===e[0]&&n===t[r])},this.parse=function(e,o,a){var s;if(!this.isInitialized())return null;if(!o||!a)return null;if(this.isNewInit(o,a))r=o[0],n=a[r];else if(null===r||!n)return t.push(e),null;for(;t.length>0;){var u=t.shift();this.parse(u,o,a)}return s=function(e,t,r){return null===t?null:{seiNals:jt(e,t)[t],timescale:r}}(e,r,n),null!==s&&s.seiNals?(this.pushNals(s.seiNals),this.flushStream(),i):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;o?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){i.captions=[],i.captionStreams={}},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],r=null,n=null,i?this.clearParsedCaptions():i={captions:[],captionStreams:{}},this.resetCaptionStream()},this.reset()},It=wt,At=function(e){return("00"+e.toString(16)).slice(-2)};vt=function(e,t){var r,n,i;return r=Et(t,["moof","traf"]),n=[].concat.apply([],r.map((function(t){return Et(t,["tfhd"]).map((function(r){var n,i,o;return n=It(r[4]<<24|r[5]<<16|r[6]<<8|r[7]),i=e[n]||9e4,o=Et(t,["tfdt"]).map((function(e){var t,r;return t=e[0],r=It(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),1===t&&(r*=Math.pow(2,32),r+=It(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),r}))[0],(o="number"!=typeof o||isNaN(o)?1/0:o)/i}))}))),i=Math.min.apply(null,n),isFinite(i)?i:0},bt=function(e){var t=0===e[0]?12:20;return It(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},gt=function(e){var t=Et(e,["moov","trak"]),r=[];return t.forEach((function(e){var t,n,i={},o=Et(e,["tkhd"])[0];o&&(n=(t=new DataView(o.buffer,o.byteOffset,o.byteLength)).getUint8(0),i.id=0===n?t.getUint32(12):t.getUint32(20));var a=Et(e,["mdia","hdlr"])[0];if(a){var s=Tt(a.subarray(8,12));i.type="vide"===s?"video":"soun"===s?"audio":s}var u=Et(e,["mdia","minf","stbl","stsd"])[0];if(u){var l=u.subarray(8);i.codec=Tt(l.subarray(4,8));var c,f=Et(l,[i.codec])[0];f&&(/^[a-z]vc[1-9]$/i.test(i.codec)?(c=f.subarray(78),"avcC"===Tt(c.subarray(4,8))&&c.length>11?(i.codec+=".",i.codec+=At(c[9]),i.codec+=At(c[10]),i.codec+=At(c[11])):i.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(i.codec)?(c=f.subarray(28),"esds"===Tt(c.subarray(4,8))&&c.length>20&&0!==c[19]?(i.codec+="."+At(c[19]),i.codec+="."+At(c[20]>>>2&63).replace(/^0/,"")):i.codec="mp4a.40.2"):i.codec=i.codec.toLowerCase())}var h=Et(e,["mdia","mdhd"])[0];h&&(i.timescale=bt(h)),r.push(i)})),r};var Rt=vt,Dt=gt,Mt=function(e){var t=31&e[1];return(t<<=8)|e[2]},Nt=function(e){return!!(64&e[1])},Bt=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},Ut=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}},Ft={parseType:function(e,t){var r=Mt(e);return 0===r?"pat":r===t?"pmt":t?"pes":null},parsePat:function(e){var t=Nt(e),r=4+Bt(e);return t&&(r+=e[r]+1),(31&e[r+10])<<8|e[r+11]},parsePmt:function(e){var t={},r=Nt(e),n=4+Bt(e);if(r&&(n+=e[n]+1),1&e[n+5]){var i;i=3+((15&e[n+1])<<8|e[n+2])-4;for(var o=12+((15&e[n+10])<<8|e[n+11]);o<i;){var a=n+o;t[(31&e[a+1])<<8|e[a+2]]=e[a],o+=5+((15&e[a+3])<<8|e[a+4])}return t}},parsePayloadUnitStartIndicator:Nt,parsePesType:function(e,t){switch(t[Mt(e)]){case ke.H264_STREAM_TYPE:return"video";case ke.ADTS_STREAM_TYPE:return"audio";case ke.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!Nt(e))return null;var t=4+Bt(e);if(t>=e.byteLength)return null;var r,n=null;return 192&(r=e[t+7])&&((n={}).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,n.pts*=4,n.pts+=(6&e[t+13])>>>1,n.dts=n.pts,64&r&&(n.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,n.dts*=4,n.dts+=(6&e[t+18])>>>1)),n},videoPacketContainsKeyFrame:function(e){for(var t=4+Bt(e),r=e.subarray(t),n=0,i=0,o=!1;i<r.byteLength-3;i++)if(1===r[i+2]){n=i+5;break}for(;n<r.byteLength;)switch(r[n]){case 0:if(0!==r[n-1]){n+=2;break}if(0!==r[n-2]){n++;break}i+3!==n-2&&"slice_layer_without_partitioning_rbsp_idr"===Ut(31&r[i+3])&&(o=!0);do{n++}while(1!==r[n]&&n<r.length);i=n-2,n+=3;break;case 1:if(0!==r[n-1]||0!==r[n-2]){n+=3;break}"slice_layer_without_partitioning_rbsp_idr"===Ut(31&r[i+3])&&(o=!0),i=n-2,n+=3;break;default:n+=3}return r=r.subarray(i),n-=i,i=0,r&&r.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===Ut(31&r[i+3])&&(o=!0),o}},Vt=Ie,Ht={};Ht.ts=Ft,Ht.aac=ot;var qt=ie,zt=188,Wt=71,Gt=function(e,t,r){for(var n,i,o,a,s=0,u=zt,l=!1;u<=e.byteLength;)if(e[s]!==Wt||e[u]!==Wt&&u!==e.byteLength)s++,u++;else{if(n=e.subarray(s,u),"pes"===Ht.ts.parseType(n,t.pid)&&(i=Ht.ts.parsePesType(n,t.table),o=Ht.ts.parsePayloadUnitStartIndicator(n),"audio"===i&&o&&(a=Ht.ts.parsePesTime(n))&&(a.type="audio",r.audio.push(a),l=!0)),l)break;s+=zt,u+=zt}for(s=(u=e.byteLength)-zt,l=!1;s>=0;)if(e[s]!==Wt||e[u]!==Wt&&u!==e.byteLength)s--,u--;else{if(n=e.subarray(s,u),"pes"===Ht.ts.parseType(n,t.pid)&&(i=Ht.ts.parsePesType(n,t.table),o=Ht.ts.parsePayloadUnitStartIndicator(n),"audio"===i&&o&&(a=Ht.ts.parsePesTime(n))&&(a.type="audio",r.audio.push(a),l=!0)),l)break;s-=zt,u-=zt}},Xt=function(e,t,r){for(var n,i,o,a,s,u,l,c=0,f=zt,h=!1,p={data:[],size:0};f<e.byteLength;)if(e[c]!==Wt||e[f]!==Wt)c++,f++;else{if(n=e.subarray(c,f),"pes"===Ht.ts.parseType(n,t.pid)&&(i=Ht.ts.parsePesType(n,t.table),o=Ht.ts.parsePayloadUnitStartIndicator(n),"video"===i&&(o&&!h&&(a=Ht.ts.parsePesTime(n))&&(a.type="video",r.video.push(a),h=!0),!r.firstKeyFrame))){if(o&&0!==p.size){for(s=new Uint8Array(p.size),u=0;p.data.length;)l=p.data.shift(),s.set(l,u),u+=l.byteLength;if(Ht.ts.videoPacketContainsKeyFrame(s)){var d=Ht.ts.parsePesTime(s);d?(r.firstKeyFrame=d,r.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(n),p.size+=n.byteLength}if(h&&r.firstKeyFrame)break;c+=zt,f+=zt}for(c=(f=e.byteLength)-zt,h=!1;c>=0;)if(e[c]!==Wt||e[f]!==Wt)c--,f--;else{if(n=e.subarray(c,f),"pes"===Ht.ts.parseType(n,t.pid)&&(i=Ht.ts.parsePesType(n,t.table),o=Ht.ts.parsePayloadUnitStartIndicator(n),"video"===i&&o&&(a=Ht.ts.parsePesTime(n))&&(a.type="video",r.video.push(a),h=!0)),h)break;c-=zt,f-=zt}},Kt=function(e,t){var r;return r=Ht.aac.isLikelyAacData(e)?function(e){for(var t,r=!1,n=0,i=null,o=null,a=0,s=0;e.length-s>=3;){switch(Ht.aac.parseType(e,s)){case"timed-metadata":if(e.length-s<10){r=!0;break}if((a=Ht.aac.parseId3TagSize(e,s))>e.length){r=!0;break}null===o&&(t=e.subarray(s,s+a),o=Ht.aac.parseAacTimestamp(t)),s+=a;break;case"audio":if(e.length-s<7){r=!0;break}if((a=Ht.aac.parseAdtsSize(e,s))>e.length){r=!0;break}null===i&&(t=e.subarray(s,s+a),i=Ht.aac.parseSampleRate(t)),n++,s+=a;break;default:s++}if(r)return null}if(null===i||null===o)return null;var u=qt/i;return{audio:[{type:"audio",dts:o,pts:o},{type:"audio",dts:o+1024*n*u,pts:o+1024*n*u}]}}(e):function(e){var t={pid:null,table:null},r={};for(var n in function(e,t){for(var r,n=0,i=zt;i<e.byteLength;)if(e[n]!==Wt||e[i]!==Wt)n++,i++;else{switch(r=e.subarray(n,i),Ht.ts.parseType(r,t.pid)){case"pat":t.pid||(t.pid=Ht.ts.parsePat(r));break;case"pmt":t.table||(t.table=Ht.ts.parsePmt(r))}if(t.pid&&t.table)return;n+=zt,i+=zt}}(e,t),t.table)if(t.table.hasOwnProperty(n))switch(t.table[n]){case ke.H264_STREAM_TYPE:r.video=[],Xt(e,t,r),0===r.video.length&&delete r.video;break;case ke.ADTS_STREAM_TYPE:r.audio=[],Gt(e,t,r),0===r.audio.length&&delete r.audio}return r}(e),r&&(r.audio||r.video)?(function(e,t){if(e.audio&&e.audio.length){var r=t;(void 0===r||isNaN(r))&&(r=e.audio[0].dts),e.audio.forEach((function(e){e.dts=Vt(e.dts,r),e.pts=Vt(e.pts,r),e.dtsTime=e.dts/qt,e.ptsTime=e.pts/qt}))}if(e.video&&e.video.length){var n=t;if((void 0===n||isNaN(n))&&(n=e.video[0].dts),e.video.forEach((function(e){e.dts=Vt(e.dts,n),e.pts=Vt(e.pts,n),e.dtsTime=e.dts/qt,e.ptsTime=e.pts/qt})),e.firstKeyFrame){var i=e.firstKeyFrame;i.dts=Vt(i.dts,n),i.pts=Vt(i.pts,n),i.dtsTime=i.dts/qt,i.ptsTime=i.pts/qt}}}(r,t),r):null},Yt=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 _t.Transmuxer(this.options),function(e,t){t.on("data",(function(t){var r=t.initSegment;t.initSegment={data:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength};var n=t.data;t.data=n.buffer,e.postMessage({action:"data",segment:t,byteOffset:n.byteOffset,byteLength:n.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 r={start:{decode:ae(t.start.dts),presentation:ae(t.start.pts)},end:{decode:ae(t.end.dts),presentation:ae(t.end.pts)},baseMediaDecodeTime:ae(t.baseMediaDecodeTime)};t.prependedContentDuration&&(r.prependedContentDuration=ae(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:r})})),t.on("audioSegmentTimingInfo",(function(t){var r={start:{decode:ae(t.start.dts),presentation:ae(t.start.pts)},end:{decode:ae(t.end.dts),presentation:ae(t.end.pts)},baseMediaDecodeTime:ae(t.baseMediaDecodeTime)};t.prependedContentDuration&&(r.prependedContentDuration=ae(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:r})})),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:ae(t.start),end:ae(t.end)}})})),t.on("videoTimingInfo",(function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:ae(t.start),end:ae(t.end)}})}))}(this.self,this.transmuxer)},t.pushMp4Captions=function(e){this.captionParser||(this.captionParser=new Lt,this.captionParser.init());var t=new Uint8Array(e.data,e.byteOffset,e.byteLength),r=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:r&&r.captions||[],data:t.buffer},[t.buffer])},t.probeMp4StartTime=function(e){var t=e.timescales,r=e.data,n=Rt(t,r);this.self.postMessage({action:"probeMp4StartTime",startTime:n,data:r},[r.buffer])},t.probeMp4Tracks=function(e){var t=e.data,r=Dt(t);this.self.postMessage({action:"probeMp4Tracks",tracks:r,data:t},[t.buffer])},t.probeTs=function(e){var t=e.data,r=e.baseStartTime,n="number"!=typeof r||isNaN(r)?void 0:r*ie,i=Kt(t,n),o=null;i&&((o={hasVideo:i.video&&2===i.video.length||!1,hasAudio:i.audio&&2===i.audio.length||!1}).hasVideo&&(o.videoStart=i.video[0].ptsTime),o.hasAudio&&(o.audioStart=i.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:o,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(oe(t)))},t.setAudioAppendStart=function(e){this.transmuxer.setAudioAppendStart(Math.ceil(oe(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 Yt(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new Yt(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}}))),Ns=As(Ms),Bs=function(e){var t=e.transmuxer,r=e.bytes,n=e.audioAppendStart,i=e.gopsToAlignWith,o=e.remux,a=e.onData,s=e.onTrackInfo,u=e.onAudioTimingInfo,l=e.onVideoTimingInfo,c=e.onVideoSegmentTimingInfo,f=e.onAudioSegmentTimingInfo,h=e.onId3,p=e.onCaptions,d=e.onDone,y=e.onEndedTimeline,m=e.isEndOfTimeline,v={buffer:[]},g=m;if(t.onmessage=function(r){t.currentTransmux===e&&("data"===r.data.action&&function(e,t,r){var n=e.data.segment,i=n.type,o=n.initSegment,a=n.captions,s=n.captionStreams,u=n.metadata,l=n.videoFrameDtsTime,c=n.videoFramePtsTime;t.buffer.push({captions:a,captionStreams:s,metadata:u});var f=e.data.segment.boxes||{data:e.data.segment.data},h={type:i,data:new Uint8Array(f.data,f.data.byteOffset,f.data.byteLength),initSegment:new Uint8Array(o.data,o.byteOffset,o.byteLength)};void 0!==l&&(h.videoFrameDtsTime=l),void 0!==c&&(h.videoFramePtsTime=c),r(h)}(r,v,a),"trackinfo"===r.data.action&&s(r.data.trackInfo),"gopInfo"===r.data.action&&function(e,t){t.gopInfo=e.data.gopInfo}(r,v),"audioTimingInfo"===r.data.action&&u(r.data.audioTimingInfo),"videoTimingInfo"===r.data.action&&l(r.data.videoTimingInfo),"videoSegmentTimingInfo"===r.data.action&&c(r.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===r.data.action&&f(r.data.audioSegmentTimingInfo),"id3Frame"===r.data.action&&h([r.data.id3Frame],r.data.id3Frame.dispatchType),"caption"===r.data.action&&p(r.data.caption),"endedtimeline"===r.data.action&&(g=!1,y()),"transmuxed"===r.data.type&&(g||(t.onmessage=null,function(e){var t=e.transmuxedData,r=e.callback;t.buffer=[],r(t)}({transmuxedData:v,callback:d}),Us(t))))},n&&t.postMessage({action:"setAudioAppendStart",appendStart:n}),Array.isArray(i)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:i}),void 0!==o&&t.postMessage({action:"setRemux",remux:o}),r.byteLength){var b=r instanceof ArrayBuffer?r:r.buffer,_=r instanceof ArrayBuffer?0:r.byteOffset;t.postMessage({action:"push",data:b,byteOffset:_,byteLength:r.byteLength},[b])}m&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},Us=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():Bs(e.currentTransmux))},Fs=function(e,t){e.postMessage({action:t}),Us(e)},Vs=function(e){!function(e,t){if(!t.currentTransmux)return t.currentTransmux=e,void Fs(t,e);t.transmuxQueue.push(Fs.bind(null,t,e))}("reset",e)},Hs=function(e){var t=e.transmuxer,r=e.endAction||e.action,n=e.callback,i=a({},e,{endAction:null,transmuxer:null,callback:null});if(t.addEventListener("message",(function i(o){o.data.action===r&&(t.removeEventListener("message",i),o.data.data&&(o.data.data=new Uint8Array(o.data.data,e.byteOffset||0,e.byteLength||o.data.data.byteLength),e.data&&(e.data=o.data.data)),n(o.data))})),e.data){var o=e.data instanceof ArrayBuffer;i.byteOffset=o?0:e.data.byteOffset,i.byteLength=e.data.byteLength;var s=[o?e.data:e.data.buffer];t.postMessage(i,s)}else t.postMessage(i)},qs=-101,zs=-102,Ws=function(e){e.forEach((function(e){e.abort()}))},Gs=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:qs,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:zs,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:2,xhr:t}:null},Xs=function(e){var t=e.segment,r=e.bytes,n=e.trackInfoFn,i=e.timingInfoFn,o=e.videoSegmentTimingInfoFn,a=e.audioSegmentTimingInfoFn,s=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,f=e.dataFn,h=e.doneFn,p=t.map&&t.map.tracks||{},d=Boolean(p.audio&&p.video),y=i.bind(null,t,"audio","start"),m=i.bind(null,t,"audio","end"),v=i.bind(null,t,"video","start"),g=i.bind(null,t,"video","end");Hs({action:"probeTs",transmuxer:t.transmuxer,data:r,baseStartTime:t.baseStartTime,callback:function(e){t.bytes=r=e.data;var i=e.result;i&&(n(t,{hasAudio:i.hasAudio,hasVideo:i.hasVideo,isMuxed:d}),n=null,i.hasAudio&&!d&&y(i.audioStart),i.hasVideo&&v(i.videoStart),y=null,v=null),function(e){if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void Bs(e);e.transmuxer.transmuxQueue.push(e)}({bytes:r,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,remux:d,onData:function(e){e.type="combined"===e.type?"video":e.type,f(t,e)},onTrackInfo:function(e){n&&(d&&(e.isMuxed=!0),n(t,e))},onAudioTimingInfo:function(e){y&&void 0!==e.start&&(y(e.start),y=null),m&&void 0!==e.end&&m(e.end)},onVideoTimingInfo:function(e){v&&void 0!==e.start&&(v(e.start),v=null),g&&void 0!==e.end&&g(e.end)},onVideoSegmentTimingInfo:function(e){o(e)},onAudioSegmentTimingInfo:function(e){a(e)},onId3:function(e,r){s(t,e,r)},onCaptions:function(e){u(t,[e])},isEndOfTimeline:l,onEndedTimeline:function(){c()},onDone:function(e){h&&(e.type="combined"===e.type?"video":e.type,h(null,t,e))}})}})},Ks=function(e){var t=e.segment,r=e.bytes,n=e.trackInfoFn,i=e.timingInfoFn,o=e.videoSegmentTimingInfoFn,a=e.audioSegmentTimingInfoFn,s=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,f=e.dataFn,h=e.doneFn,p=new Uint8Array(r);if(function(e){return Ve(e,["moof"]).length>0}(p)){t.isFmp4=!0;var d=t.map.tracks,y={isFmp4:!0,hasVideo:!!d.video,hasAudio:!!d.audio};d.audio&&d.audio.codec&&"enca"!==d.audio.codec&&(y.audioCodec=d.audio.codec),d.video&&d.video.codec&&"encv"!==d.video.codec&&(y.videoCodec=d.video.codec),d.video&&d.audio&&(y.isMuxed=!0),n(t,y);var m=function(e){f(t,{data:p,type:y.hasAudio&&!y.isMuxed?"audio":"video"}),e&&e.length&&u(t,e),h(null,t,{})};Hs({action:"probeMp4StartTime",timescales:t.map.timescales,data:p,transmuxer:t.transmuxer,callback:function(e){var n=e.data,o=e.startTime;r=n.buffer,t.bytes=p=n,y.hasAudio&&!y.isMuxed&&i(t,"audio","start",o),y.hasVideo&&i(t,"video","start",o),d.video&&n.byteLength&&t.transmuxer?Hs({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:p,timescales:t.map.timescales,trackIds:[d.video.id],callback:function(e){r=e.data.buffer,t.bytes=p=e.data,m(e.captions)}}):m()}})}else if(t.transmuxer){if(void 0===t.container&&(t.container=it(p)),"ts"!==t.container&&"aac"!==t.container)return n(t,{hasAudio:!1,hasVideo:!1}),void h(null,t,{});Xs({segment:t,bytes:r,trackInfoFn:n,timingInfoFn:i,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:a,id3Fn:s,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:f,doneFn:h})}else h(null,t,{})},Ys=function(e){var t=e.xhr,r=e.xhrOptions,n=e.decryptionWorker,i=e.segment,o=e.abortFn,a=e.progressFn,s=e.trackInfoFn,u=e.timingInfoFn,l=e.videoSegmentTimingInfoFn,c=e.audioSegmentTimingInfoFn,f=e.id3Fn,h=e.captionsFn,p=e.isEndOfTimeline,d=e.endedTimelineFn,y=e.dataFn,m=e.doneFn,v=[],g=function(e){var t=e.activeXhrs,r=e.decryptionWorker,n=e.trackInfoFn,i=e.timingInfoFn,o=e.videoSegmentTimingInfoFn,a=e.audioSegmentTimingInfoFn,s=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,f=e.dataFn,h=e.doneFn,p=0,d=!1;return function(e,y){if(!d){if(e)return d=!0,Ws(t),h(e,y);if((p+=1)===t.length){if(y.endOfAllRequests=Date.now(),y.encryptedBytes)return function(e){var t,r=e.decryptionWorker,n=e.segment,i=e.trackInfoFn,o=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,u=e.id3Fn,l=e.captionsFn,c=e.isEndOfTimeline,f=e.endedTimelineFn,h=e.dataFn,p=e.doneFn;r.addEventListener("message",(function e(t){if(t.data.source===n.requestId){r.removeEventListener("message",e);var d=t.data.decrypted;n.bytes=new Uint8Array(d.bytes,d.byteOffset,d.byteLength),Ks({segment:n,bytes:n.bytes,trackInfoFn:i,timingInfoFn:o,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:u,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:f,dataFn:h,doneFn:p})}})),t=n.key.bytes.slice?n.key.bytes.slice():new Uint32Array(Array.prototype.slice.call(n.key.bytes)),r.postMessage(gs({source:n.requestId,encrypted:n.encryptedBytes,key:t,iv:n.key.iv}),[n.encryptedBytes.buffer,t.buffer])}({decryptionWorker:r,segment:y,trackInfoFn:n,timingInfoFn:i,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:a,id3Fn:s,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:f,doneFn:h});Ks({segment:y,bytes:y.bytes,trackInfoFn:n,timingInfoFn:i,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:a,id3Fn:s,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:f,doneFn:h})}}}}({activeXhrs:v,decryptionWorker:n,trackInfoFn:s,timingInfoFn:u,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:f,captionsFn:h,isEndOfTimeline:p,endedTimelineFn:d,dataFn:y,doneFn:m});if(i.key&&!i.key.bytes){var b=_a.mergeOptions(r,{uri:i.key.resolvedUri,responseType:"arraybuffer"}),_=function(e,t){return function(r,n){var i=n.response,o=Gs(r,n);if(o)return t(o,e);if(16!==i.byteLength)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:2,xhr:n},e);var a=new DataView(i);return e.key.bytes=new Uint32Array([a.getUint32(0),a.getUint32(4),a.getUint32(8),a.getUint32(12)]),t(null,e)}}(i,g),w=t(b,_);v.push(w)}if(i.map&&!i.map.bytes){var T=_a.mergeOptions(r,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:ds(i.map)}),S=function(e){var t=e.segment,r=e.finishProcessingFn;return function(e,n){var i=n.response,o=Gs(e,n);if(o)return r(o,t);if(0===i.byteLength)return r({status:n.status,message:"Empty HLS segment content at URL: "+n.uri,code:2,xhr:n},t);t.map.bytes=new Uint8Array(n.response);var a=it(t.map.bytes);if("mp4"!==a)return r({status:n.status,message:"Found unsupported "+(a||"unknown")+" container for initialization segment at URL: "+n.uri,code:2,internal:!0,xhr:n},t);Hs({action:"probeMp4Tracks",data:t.map.bytes,transmuxer:t.transmuxer,callback:function(e){var n=e.tracks,i=e.data;return t.map.bytes=i,n.forEach((function(e){t.map.tracks=t.map.tracks||{},t.map.tracks[e.type]||(t.map.tracks[e.type]=e,"number"==typeof e.id&&e.timescale&&(t.map.timescales=t.map.timescales||{},t.map.timescales[e.id]=e.timescale))})),r(null,t)}})}}({segment:i,finishProcessingFn:g}),E=t(T,S);v.push(E)}var O=_a.mergeOptions(r,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:ds(i)}),k=t(O,function(e){var t=e.segment,r=e.finishProcessingFn,n=e.responseType;return function(e,i){var o=i.response,a=Gs(e,i);if(a)return r(a,t);var s="arraybuffer"!==n&&i.responseText?function(e){for(var t=new Uint8Array(new ArrayBuffer(e.length)),r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t.buffer}(i.responseText.substring(t.lastReachedChar||0)):i.response;return 0===o.byteLength?r({status:i.status,message:"Empty HLS segment content at URL: "+i.uri,code:2,xhr:i},t):(t.stats=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}}(i),t.key?t.encryptedBytes=new Uint8Array(s):t.bytes=new Uint8Array(s),r(null,t))}}({segment:i,finishProcessingFn:g,responseType:O.responseType}));k.addEventListener("progress",function(e){var t=e.segment,r=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=_a.mergeOptions(t.stats,(i=(n=e).target,(o={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-i.requestTime||0}).bytesReceived=n.loaded,o.bandwidth=Math.floor(o.bytesReceived/o.roundTripTime*8*1e3),o)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),r(e,t);var n,i,o}}({segment:i,progressFn:a,trackInfoFn:s,timingInfoFn:u,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:f,captionsFn:h,isEndOfTimeline:p,endedTimelineFn:d,dataFn:y})),v.push(k);var C={};return v.forEach((function(e){e.addEventListener("loadend",function(e){var t=e.loadendState,r=e.abortFn;return function(e){e.target.aborted&&r&&!t.calledAbortFn&&(r(),t.calledAbortFn=!0)}}({loadendState:C,abortFn:o}))})),function(){return Ws(v)}},Qs=Oa("CodecUtils"),$s=function(e,t){var r=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&r.AUDIO&&e.mediaGroups.AUDIO[r.AUDIO]},Js=function(e){var t={};return e.forEach((function(e){var r=e.mediaType,n=e.type,i=e.details;t[r]=t[r]||[],t[r].push(M(""+n+i))})),Object.keys(t).forEach((function(e){if(t[e].length>1)return Qs("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},Zs=function(e){var t=0;return e.audio&&t++,e.video&&t++,t},eu=function(e,t){var r=t.attributes||{},n=Js(function(e){var t=e.attributes||{};if(t.CODECS)return N(t.CODECS)}(t)||[]);if($s(e,t)&&!n.audio&&!function(e,t){if(!$s(e,t))return!0;var r=t.attributes||{},n=e.mediaGroups.AUDIO[r.AUDIO];for(var i in n)if(!n[i].uri&&!n[i].playlists)return!0;return!1}(e,t)){var i=Js(function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var r=e.mediaGroups.AUDIO[t];if(!r)return null;for(var n in r){var i=r[n];if(i.default&&i.playlists)return N(i.playlists[0].attributes.CODECS)}return null}(e,r.AUDIO)||[]);i.audio&&(n.audio=i.audio)}return n},tu=Oa("PlaylistSelector"),ru=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||""})}},nu=function(e,r){if(!e)return"";var n=t().getComputedStyle(e);return n?n[r]:""},iu=function(e,t){var r=e.slice();e.sort((function(e,n){var i=t(e,n);return 0===i?r.indexOf(e)-r.indexOf(n):i}))},ou=function(e,r){var n,i;return e.attributes.BANDWIDTH&&(n=e.attributes.BANDWIDTH),n=n||t().Number.MAX_VALUE,r.attributes.BANDWIDTH&&(i=r.attributes.BANDWIDTH),n-(i||t().Number.MAX_VALUE)},au=function(e,r,n,i,o,a){if(e){var s={bandwidth:r,width:n,height:i,limitRenditionByPlayerDimensions:o},u=e.playlists;ls.isAudioOnly(e)&&(u=a.getAudioTrackPlaylists_(),s.audioOnly=!0);var l=u.map((function(e){var r=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||t().Number.MAX_VALUE,width:r,height:n,playlist:e}}));iu(l,(function(e,t){return e.bandwidth-t.bandwidth}));var c=(l=l.filter((function(e){return!ls.isIncompatible(e.playlist)}))).filter((function(e){return ls.isEnabled(e.playlist)}));c.length||(c=l.filter((function(e){return!ls.isDisabled(e.playlist)})));var f=c.filter((function(e){return e.bandwidth*Ls.BANDWIDTH_VARIANCE<r})),h=f[f.length-1],p=f.filter((function(e){return e.bandwidth===h.bandwidth}))[0];if(!1===o){var d=p||c[0]||l[0];if(d&&d.playlist){var y="sortedPlaylistReps";return p&&(y="bandwidthBestRep"),c[0]&&(y="enabledPlaylistReps"),tu("choosing "+ru(d)+" using "+y+" with options",s),d.playlist}return tu("could not choose a playlist with options",s),null}var m=f.filter((function(e){return e.width&&e.height}));iu(m,(function(e,t){return e.width-t.width}));var v=m.filter((function(e){return e.width===n&&e.height===i}));h=v[v.length-1];var g,b,_,w=v.filter((function(e){return e.bandwidth===h.bandwidth}))[0];w||(b=(g=m.filter((function(e){return e.width>n||e.height>i}))).filter((function(e){return e.width===g[0].width&&e.height===g[0].height})),h=b[b.length-1],_=b.filter((function(e){return e.bandwidth===h.bandwidth}))[0]);var T=_||w||p||c[0]||l[0];if(T&&T.playlist){var S="sortedPlaylistReps";return _?S="resolutionPlusOneRep":w?S="resolutionBestRep":p?S="bandwidthBestRep":c[0]&&(S="enabledPlaylistReps"),tu("choosing "+ru(T)+" using "+S+" with options",s),T.playlist}return tu("could not choose a playlist with options",s),null}},su=function(){var e=this.useDevicePixelRatio&&t().devicePixelRatio||1;return au(this.playlists.master,this.systemBandwidth,parseInt(nu(this.tech_.el(),"width"),10)*e,parseInt(nu(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},uu=function(e,t,r){var n,i;if(r&&r.cues)for(n=r.cues.length;n--;)(i=r.cues[n]).startTime>=e&&i.endTime<=t&&r.removeCue(i)},lu=function(e){return"number"==typeof e&&isFinite(e)},cu=1/60,fu=function(e){var t=e.startOfSegment,r=e.duration,n=e.segment,i=n.start,o=n.end,a=n.parts,s=e.playlist,u=s.mediaSequence,l=s.id,c=s.segments,f=void 0===c?[]:c,h=e.mediaIndex,p=e.partIndex,d=e.timeline,y=f.length-1,m="mediaIndex/partIndex increment";return e.getMediaInfoForTime?m="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(m="getSyncSegmentCandidate (isSyncRequest)"),(e.segment.uri?"segment":"pre-segment")+" ["+h+"/"+y+"]"+(p?" part ["+p+"/"+(a.length-1)+"]":"")+" mediaSequenceNumber ["+u+"/"+(u+y)+"] start/end ["+i+" => "+o+"] startOfSegment ["+t+"] duration ["+r+"] timeline ["+d+"] selected by ["+m+"] playlist ["+l+"]"},hu=function(e){return e+"TimingInfo"},pu=function(e){var t=e.timelineChangeController,r=e.currentTimeline,n=e.segmentTimeline,i=e.loaderType,o=e.audioDisabled;if(r===n)return!1;if("audio"===i){var a=t.lastTimelineChange({type:"main"});return!a||a.to!==n}if("main"===i&&o){var s=t.pendingTimelineChange({type:"audio"});return!s||s.to!==n}return!1},du=function(e){var t=e.segmentDuration,r=e.maxDuration;return!!t&&Math.round(t)>r+Va},yu=function(e){function r(t,r){var n;if(n=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 n.bandwidth=t.bandwidth,n.throughput={rate:0,count:0},n.roundTrip=NaN,n.resetStats_(),n.mediaIndex=null,n.partIndex=null,n.hasPlayed_=t.hasPlayed,n.currentTime_=t.currentTime,n.seekable_=t.seekable,n.seeking_=t.seeking,n.duration_=t.duration,n.mediaSource_=t.mediaSource,n.vhs_=t.vhs,n.loaderType_=t.loaderType,n.currentMediaInfo_=void 0,n.startingMediaInfo_=void 0,n.segmentMetadataTrack_=t.segmentMetadataTrack,n.goalBufferLength_=t.goalBufferLength,n.sourceType_=t.sourceType,n.sourceUpdater_=t.sourceUpdater,n.inbandTextTracks_=t.inbandTextTracks,n.state_="INIT",n.timelineChangeController_=t.timelineChangeController,n.shouldSaveSegmentTimingInfo_=!0,n.parse708captions_=t.parse708captions,n.checkBufferTimeout_=null,n.error_=void 0,n.currentTimeline_=-1,n.pendingSegment_=null,n.xhrOptions_=null,n.pendingSegments_=[],n.audioDisabled_=!1,n.isPendingTimestampOffset_=!1,n.gopBuffer_=[],n.timeMapping_=0,n.safeAppend_=_a.browser.IE_VERSION>=11,n.appendInitSegment_={audio:!0,video:!0},n.playlistOfLastInitSegment_={audio:null,video:null},n.callQueue_=[],n.loadQueue_=[],n.metadataQueue_={id3:[],caption:[]},n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=null,n.activeInitSegmentId_=null,n.initSegments_={},n.cacheEncryptionKeys_=t.cacheEncryptionKeys,n.keyCache_={},n.decrypter_=t.decrypter,n.syncController_=t.syncController,n.syncPoint_={segmentIndex:0,time:0},n.transmuxer_=n.createTransmuxer_(),n.triggerSyncInfoUpdate_=function(){return n.trigger("syncinfoupdate")},n.syncController_.on("syncinfoupdate",n.triggerSyncInfoUpdate_),n.mediaSource_.addEventListener("sourceopen",(function(){n.isEndOfStream_()||(n.ended_=!1)})),n.fetchAtBuffer_=!1,n.logger_=Oa("SegmentLoader["+n.loaderType_+"]"),Object.defineProperty(s(n),"state",{get:function(){return this.state_},set:function(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e,this.trigger("statechange"))}}),n.sourceUpdater_.on("ready",(function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()})),"main"===n.loaderType_&&n.timelineChangeController_.on("pendingtimelinechange",(function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()})),"audio"===n.loaderType_&&n.timelineChangeController_.on("timelinechange",(function(){n.hasEnoughInfoToLoad_()&&n.processLoadQueue_(),n.hasEnoughInfoToAppend_()&&n.processCallQueue_()})),n}l(r,e);var n=r.prototype;return n.createTransmuxer_=function(){return function(e){var t=new Ns;t.currentTransmux=null,t.transmuxQueue=[];var r=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,r.call(t)},t.postMessage({action:"init",options:e}),t}({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_})},n.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0},n.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&t().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,t().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_&&Vs(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},n.buffered_=function(){if(!this.sourceUpdater_||!this.startingMediaInfo_)return _a.createTimeRanges();if("main"===this.loaderType_){var e=this.startingMediaInfo_,t=e.hasAudio,r=e.hasVideo,n=e.isMuxed;if(r&&t&&!this.audioDisabled_&&!n)return this.sourceUpdater_.buffered();if(r)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},n.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var r=bs(e),n=this.initSegments_[r];return t&&!n&&e.bytes&&(this.initSegments_[r]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),n||e},n.segmentKey=function(e,t){if(void 0===t&&(t=!1),!e)return null;var r=_s(e),n=this.keyCache_[r];this.cacheEncryptionKeys_&&t&&!n&&e.bytes&&(this.keyCache_[r]=n={resolvedUri:e.resolvedUri,bytes:e.bytes});var i={resolvedUri:(n||e).resolvedUri};return n&&(i.bytes=n.bytes),i},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 r=this.playlist_,n=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 i=null;if(r&&(r.id?i=r.id:r.uri&&(i=r.uri)),this.logger_("playlist update ["+i+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!r||r.uri!==e.uri)return null!==this.mediaIndex&&this.resyncLoader(),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");var o=e.mediaSequence-r.mediaSequence;if(this.logger_("live window shift ["+o+"]"),null!==this.mediaIndex)if(this.mediaIndex-=o,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var a=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!a.parts||!a.parts.length||!a.parts[this.partIndex])){var s=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=s}}n&&(n.mediaIndex-=o,n.mediaIndex<0?(n.mediaIndex=null,n.partIndex=null):(n.mediaIndex>=0&&(n.segment=e.segments[n.mediaIndex]),n.partIndex>=0&&n.segment.parts&&(n.part=n.segment.parts[n.partIndex]))),this.syncController_.saveExpiredSegmentInfo(r,e)}},n.pause=function(){this.checkBufferTimeout_&&(t().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"})},n.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},n.resyncLoader=function(){this.transmuxer_&&Vs(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,r,n){if(void 0===r&&(r=function(){}),void 0===n&&(n=!1),t===1/0&&(t=this.duration_()),t<=e)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.startingMediaInfo_){var i=1,o=function(){0==--i&&r()};for(var a in!n&&this.audioDisabled_||(i++,this.sourceUpdater_.removeAudio(e,t,o)),(n||"main"===this.loaderType_)&&(this.gopBuffer_=function(e,t,r,n){for(var i=Math.ceil((t-n)*ot.ONE_SECOND_IN_TS),o=Math.ceil((r-n)*ot.ONE_SECOND_IN_TS),a=e.slice(),s=e.length;s--&&!(e[s].pts<=o););if(-1===s)return a;for(var u=s+1;u--&&!(e[u].pts<=i););return u=Math.max(u,0),a.splice(u,s-u+1),a}(this.gopBuffer_,e,t,this.timeMapping_),i++,this.sourceUpdater_.removeVideo(e,t,o)),this.inbandTextTracks_)uu(e,t,this.inbandTextTracks_[a]);uu(e,t,this.segmentMetadataTrack_),o()}else this.logger_("skipping remove because no source updater or starting media info")},n.monitorBuffer_=function(){this.checkBufferTimeout_&&t().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=t().setTimeout(this.monitorBufferTick_.bind(this),1)},n.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&t().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=t().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,r){if(void 0===e&&(e=this.mediaIndex),void 0===t&&(t=this.playlist_),void 0===r&&(r=this.partIndex),!t||!this.mediaSource_)return!1;var n="number"==typeof e&&t.segments[e],i=e+1===t.segments.length,o=!n||!n.parts||r+1===n.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&i&&o},n.chooseNextRequest_=function(){var e=Ka(this.buffered_())||0,t=Math.max(0,e-this.currentTime_()),r=!this.hasPlayed_()&&t>=1,n=t>=this.goalBufferLength_(),i=this.playlist_.segments;if(!i.length||r||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var o={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(o.isSyncRequest)o.mediaIndex=function(e,t){var r=(void 0===t?{}:t).segments,n=void 0===r?[]:r;if(-1===e)return 0;var i=n.reduce((function(t,r,n){return r.timeline===e&&t.push(n),t}),[]);return i.length?i[Math.min(i.length-1,1)]:Math.max(n.length-1,0)}(this.currentTimeline_,this.playlist_);else if(null!==this.mediaIndex){var a=i[this.mediaIndex],s="number"==typeof this.partIndex?this.partIndex:-1;o.startOfSegment=a.end?a.end:e,a.parts&&a.parts[s+1]?(o.mediaIndex=this.mediaIndex,o.partIndex=s+1):o.mediaIndex=this.mediaIndex+1}else{var u=ls.getMediaInfoForTime(this.playlist_,this.fetchAtBuffer_?e:this.currentTime_(),this.syncPoint_.segmentIndex,this.syncPoint_.time);o.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd":"currentTime",o.mediaIndex=u.mediaIndex,o.startOfSegment=u.startTime,o.partIndex=u.partIndex}var l=i[o.mediaIndex],c=l&&"number"==typeof o.partIndex&&l.parts&&l.parts[o.partIndex];if(!l||"number"==typeof o.partIndex&&!c)return null;"number"!=typeof o.partIndex&&l.parts&&(o.partIndex=0);var f=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return o.mediaIndex>=i.length-1&&f&&!this.seeking_()?null:this.generateSegmentInfo_(o)},n.generateSegmentInfo_=function(e){var t=e.playlist,r=e.mediaIndex,n=e.startOfSegment,i=e.isSyncRequest,o=e.partIndex,a=e.forceTimestampOffset,s=e.getMediaInfoForTime,u=t.segments[r],l="number"==typeof o&&u.parts[o],c={requestId:"segment-loader-"+Math.random(),uri:l&&l.resolvedUri||u.resolvedUri,mediaIndex:r,partIndex:l?o:null,isSyncRequest:i,startOfSegment:n,playlist:t,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:u.timeline,duration:u.duration,segment:u,part:l,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:s},f=void 0!==a?a:this.isPendingTimestampOffset_;c.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:u.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:f});var h=Ka(this.sourceUpdater_.audioBuffered());return"number"==typeof h&&(c.audioAppendStart=h-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(c.gopsToAlignWith=function(e,t,r){if(null==t||!e.length)return[];var n,i=Math.ceil((t-r+3)*ot.ONE_SECOND_IN_TS);for(n=0;n<e.length&&!(e[n].pts>i);n++);return e.slice(n)}(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),c},n.timestampOffsetForSegment_=function(e){return r=(t=e).segmentTimeline,n=t.currentTimeline,i=t.startOfSegment,o=t.buffered,t.overrideCheck||r!==n?r<n?i:o.length?o.end(o.length-1):i:null;var t,r,n,i,o},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_(),r=e.bandwidth,n=this.pendingSegment_.duration,i=ls.estimateSegmentRequestTime(n,r,this.playlist_,e.bytesReceived),o=function(e,t,r){return void 0===r&&(r=1),((e.length?e.end(e.length-1):0)-t)/r}(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(!(i<=o)){var a=function(e){var t=e.currentTime,r=e.bandwidth,n=e.duration,i=e.segmentDuration,o=e.timeUntilRebuffer,a=e.currentTimeline,s=e.syncController,u=e.master.playlists.filter((function(e){return!ls.isIncompatible(e)})),l=u.filter(ls.isEnabled);l.length||(l=u.filter((function(e){return!ls.isDisabled(e)})));var c=l.filter(ls.hasAttribute.bind(null,"BANDWIDTH")).map((function(e){var u=s.getSyncPoint(e,n,a,t)?1:2;return{playlist:e,rebufferingImpact:ls.estimateSegmentRequestTime(i,r,e)*u-o}})),f=c.filter((function(e){return e.rebufferingImpact<=0}));return iu(f,(function(e,t){return ou(t.playlist,e.playlist)})),f.length?f[0]:(iu(c,(function(e,t){return e.rebufferingImpact-t.rebufferingImpact})),c[0]||null)}({master:this.vhs_.playlists.master,currentTime:t,bandwidth:r,duration:this.duration_(),segmentDuration:n,timeUntilRebuffer:o,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(a){var s=i-o-a.rebufferingImpact,u=.5;o<=Va&&(u=1),!a.playlist||a.playlist.uri===this.playlist_.uri||s<u||(this.bandwidth=a.playlist.attributes.BANDWIDTH*Ls.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}},n.handleAbort_=function(e){this.logger_("Aborting "+fu(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 r=Object.keys(e).sort(),n=Object.keys(t).sort();if(r.length!==n.length)return!1;for(var i=0;i<r.length;i++){var o=r[i];if(o!==n[i])return!1;if(e[o]!==t[o])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,r,n){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){var i=this.pendingSegment_,o=hu(t);i[o]=i[o]||{},i[o][r]=n,this.logger_("timinginfo: "+t+" - "+r+" - "+n),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}},n.handleCaptions_=function(e,r){var n=this;if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(0!==r.length)if(this.pendingSegment_.hasAppendedData_){var i=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),o={};r.forEach((function(e){o[e.stream]=o[e.stream]||{startTime:1/0,captions:[],endTime:0};var t=o[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(o).forEach((function(e){var r=o[e],a=r.startTime,s=r.endTime,u=r.captions,l=n.inbandTextTracks_;n.logger_("adding cues from "+a+" -> "+s+" for "+e),function(e,t,r){if(!e[r]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var n=t.textTracks().getTrackById(r);e[r]=n||t.addRemoteTextTrack({kind:"captions",id:r,label:r},!1).track}}(l,n.vhs_.tech_,e),uu(a,s,l[e]),function(e){var r=e.inbandTextTracks,n=e.captionArray,i=e.timestampOffset;if(n){var o=t().WebKitDataCue||t().VTTCue;n.forEach((function(e){var t=e.stream;r[t].addCue(new o(e.startTime+i,e.endTime+i,e.text))}))}}({captionArray:u,inbandTextTracks:l,timestampOffset:i})})),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}else this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,r));else this.logger_("SegmentLoader received no captions from a caption event")},n.handleId3_=function(e,r,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,r){e.metadataTrack_||(e.metadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=t)}(this.inbandTextTracks_,n,this.vhs_.tech_),function(e){var r=e.inbandTextTracks,n=e.metadataArray,i=e.timestampOffset,o=e.videoDuration;if(n){var a=t().WebKitDataCue||t().VTTCue,s=r.metadataTrack_;if(s&&(n.forEach((function(e){var r=e.cueTime+i;!("number"!=typeof r||t().isNaN(r)||r<0)&&r<1/0&&e.frames.forEach((function(e){var t=new a(r,r,e.value||e.url||e.data||"");t.frame=e,t.value=e,function(e){Object.defineProperties(e.frame,{id:{get:function(){return _a.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return _a.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return _a.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})}(t),s.addCue(t)}))})),s.cues&&s.cues.length)){for(var u=s.cues,l=[],c=0;c<u.length;c++)u[c]&&l.push(u[c]);var f=l.reduce((function(e,t){var r=e[t.startTime]||[];return r.push(t),e[t.startTime]=r,e}),{}),h=Object.keys(f).sort((function(e,t){return Number(e)-Number(t)}));h.forEach((function(e,t){var r=f[e],n=Number(h[t+1])||o;r.forEach((function(e){e.endTime=n}))}))}}}({inbandTextTracks:this.inbandTextTracks_,metadataArray:r,timestampOffset:i,videoDuration:this.duration_()})}else this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,r,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.currentMediaInfo_&&pu({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},n.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var e=this.pendingSegment_;if(!e||!e.trackInfo)return!1;var t=this.currentMediaInfo_,r=t.hasAudio,n=t.hasVideo,i=t.isMuxed;return!(n&&!e.videoTimingInfo||r&&!this.audioDisabled_&&!i&&!e.audioTimingInfo||pu({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 r=this.pendingSegment_;if(this.setTimeMapping_(r.timeline),this.updateMediaSecondsLoaded_(r.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),r.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),r.isFmp4=e.isFmp4,r.timingInfo=r.timingInfo||{},r.isFmp4)this.trigger("fmp4"),r.timingInfo.start=r[hu(t.type)].start;else{var n,i="main"===this.loaderType_&&this.currentMediaInfo_.hasVideo;i&&(n=r.videoTimingInfo.start),r.timingInfo.start=this.trueSegmentStart_({currentStart:r.timingInfo.start,playlist:r.playlist,mediaIndex:r.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:i,firstVideoFrameTimeForData:n,videoTimingInfo:r.videoTimingInfo,audioTimingInfo:r.audioTimingInfo})}this.updateAppendInitSegmentStatus(r,t.type),this.updateSourceBufferTimestampOffset_(r),r.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(r,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,r=e.initSegment,n=e.map,i=e.playlist;if(n){var o=bs(n);if(this.activeInitSegmentId_===o)return null;r=this.initSegmentForMap(n,!0).bytes,this.activeInitSegmentId_=o}return r&&this.appendInitSegment_[t]?(this.playlistOfLastInitSegment_[t]=i,this.appendInitSegment_[t]=!1,this.activeInitSegmentId_=null,r):null},n.handleQuotaExceededError_=function(e,r){var n=this,i=e.segmentInfo,o=e.type,a=e.bytes,s=this.sourceUpdater_.audioBuffered(),u=this.sourceUpdater_.videoBuffered();s.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Xa(s).join(", ")),u.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Xa(u).join(", "));var l=s.length?s.start(0):0,c=s.length?s.end(s.length-1):0,f=u.length?u.start(0):0,h=u.length?u.end(u.length-1):0;if(c-l<=1&&h-f<=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: "+Xa(s).join(", ")+", video buffer: "+Xa(u).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",blacklistDuration:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:i,type:o,bytes:a}));var p=this.currentTime_()-1;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+p),this.remove(0,p,(function(){n.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=t().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 r=e.segmentInfo,n=e.type,i=e.bytes;t&&(22!==t.code?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",t),this.error(n+" append of "+i.length+"b failed for segment #"+r.mediaIndex+" in playlist "+r.playlist.id),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:r,type:n,bytes:i}))},n.appendToSourceBuffer_=function(e){var t,r,n,i=e.segmentInfo,o=e.type,a=e.initSegment,s=e.data,u=e.bytes;if(!u){var l=[s],c=s.byteLength;a&&(l.unshift(a),c+=a.byteLength),n=0,(t={bytes:c,segments:l}).bytes&&(r=new Uint8Array(t.bytes),t.segments.forEach((function(e){r.set(e,n),n+=e.byteLength}))),u=r}this.sourceUpdater_.appendBuffer({segmentInfo:i,type:o,bytes:u},this.handleAppendError_.bind(this,{segmentInfo:i,type:o,bytes:u}))},n.handleSegmentTimingInfo_=function(e,t,r){if(this.pendingSegment_&&t===this.pendingSegment_.requestId){var n=this.pendingSegment_.segment,i=e+"TimingInfo";n[i]||(n[i]={}),n[i].transmuxerPrependedSeconds=r.prependedContentDuration||0,n[i].transmuxedPresentationStart=r.start.presentation,n[i].transmuxedDecodeStart=r.start.decode,n[i].transmuxedPresentationEnd=r.end.presentation,n[i].transmuxedDecodeEnd=r.end.decode,n[i].baseMediaDecodeTime=r.baseMediaDecodeTime}},n.appendData_=function(e,t){var r=t.type,n=t.data;if(n&&n.byteLength&&("audio"!==r||!this.audioDisabled_)){var i=this.getInitSegmentAndUpdateState_({type:r,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:r,initSegment:i,data:n})}},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 r=a({},e,{forceTimestampOffset:!0});a(e,t.generateSegmentInfo_(r)),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 r=this.createSimplifiedSegmentObj_(e),n=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),i=null!==this.mediaIndex,o=e.timeline!==this.currentTimeline_&&e.timeline>0,a=n||i&&o;this.logger_("Requesting "+fu(e)),r.map&&!r.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=Ys({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:r,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:a,endedTimelineFn:function(){t.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this)})},n.trimBackBuffer_=function(e){var t=function(e,t,r){var n=t-Ls.BACK_BUFFER_LENGTH;e.length&&(n=Math.max(n,e.start(0)));var i=t-r;return Math.min(i,n)}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)},n.createSimplifiedSegmentObj_=function(e){var t=e.segment,r=e.part,n={resolvedUri:r?r.resolvedUri:t.resolvedUri,byterange:r?r.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},i=e.playlist.segments[e.mediaIndex-1];if(i&&i.timeline===t.timeline&&(i.videoTimingInfo?n.baseStartTime=i.videoTimingInfo.transmuxedDecodeEnd:i.audioTimingInfo&&(n.baseStartTime=i.audioTimingInfo.transmuxedDecodeEnd)),t.key){var o=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);n.key=this.segmentKey(t.key),n.key.iv=o}return t.map&&(n.map=this.initSegmentForMap(t.map)),n},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<cu?this.logger_("Ignoring segment's bandwidth because its duration of "+e+" is less than the min to record "+cu):(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,r){if(this.callQueue_.length)this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,r));else if(this.saveTransferStats_(t.stats),this.pendingSegment_&&t.requestId===this.pendingSegment_.requestId){if(e){if(this.pendingSegment_=null,this.state="READY",e.code===zs)return;return this.pause(),e.code===qs?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"))}var n=this.pendingSegment_;this.saveBandwidthRelatedStats_(n.duration,t.stats),n.endOfAllRequests=t.endOfAllRequests,r.gopInfo&&(this.gopBuffer_=function(e,t,r){if(!t.length)return e;if(r)return t.slice();for(var n=t[0].pts,i=0;i<e.length&&!(e[i].pts>=n);i++);return e.slice(0,i).concat(t)}(this.gopBuffer_,r.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(n)}},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,r=e.playlist,n=e.mediaIndex,i=e.firstVideoFrameTimeForData,o=e.currentVideoTimestampOffset,a=e.useVideoTimingInfo,s=e.videoTimingInfo,u=e.audioTimingInfo;if(void 0!==t)return t;if(!a)return u.start;var l=r.segments[n-1];return 0!==n&&l&&void 0!==l.start&&l.end===i+o?s.start:i},n.waitForAppendsToComplete_=function(e){if(!this.currentMediaInfo_)return this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),void this.trigger("error");var t=this.currentMediaInfo_,r=t.hasAudio,n=t.hasVideo,i=t.isMuxed,o="main"===this.loaderType_&&n,a=!this.audioDisabled_&&r&&!i;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);o&&e.waitingOnAppends++,a&&e.waitingOnAppends++,o&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),a&&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,r){return"main"===e&&t&&r?r.hasAudio||r.hasVideo?t.hasVideo&&!r.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&&r.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.currentMediaInfo_,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="main"===this.loaderType_&&this.currentMediaInfo_.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;t&&(e.timingInfo.end="number"==typeof t.end?t.end:t.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_}),this.logger_("Appended "+fu(e));var t=function(e,t){if("hls"!==t)return null;var r,n,i,o,a=(r=e.audioTimingInfo,n=e.videoTimingInfo,i=r&&"number"==typeof r.start&&"number"==typeof r.end?r.end-r.start:0,o=n&&"number"==typeof n.start&&"number"==typeof n.end?n.end-n.start:0,Math.max(i,o));if(!a)return null;var s=e.playlist.targetDuration,u=du({segmentDuration:a,maxDuration:2*s}),l=du({segmentDuration:a,maxDuration:s}),c="Segment with index "+e.mediaIndex+" from playlist "+e.playlist.id+" has a duration of "+a+" when the reported duration is "+e.duration+" and the target duration is "+s+". 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}(e,this.sourceType_);if(t&&("warn"===t.severity?_a.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest)this.trigger("syncinfoupdate");else{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 r=e.segment;r.end&&this.currentTime_()-r.end>3*e.playlist.targetDuration?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"),this.paused()||this.monitorBuffer_())}},n.recordThroughput_=function(e){if(e.duration<cu)this.logger_("Ignoring segment's throughput because its duration of "+e.duration+" is less than the min to record "+cu);else{var t=this.throughput.rate,r=Date.now()-e.endOfAllRequests+1,n=Math.floor(e.byteLength/r*8*1e3);this.throughput.rate+=(n-t)/++this.throughput.count}},n.addSegmentMetadataCue_=function(e){if(this.segmentMetadataTrack_){var r=e.segment,n=r.start,i=r.end;if(lu(n)&&lu(i)){uu(n,i,this.segmentMetadataTrack_);var o=t().WebKitDataCue||t().VTTCue,a={custom:r.custom,dateTimeObject:r.dateTimeObject,dateTimeString:r.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 o(n,i,JSON.stringify(a));s.value=a,this.segmentMetadataTrack_.addCue(s)}}},r}(_a.EventTarget);function mu(){}var vu,gu=function(e){return"string"!=typeof e?e:e.replace(/./,(function(e){return e.toUpperCase()}))},bu=["video","audio"],_u=function(e,t){var r=t[e+"Buffer"];return r&&r.updating||t.queuePending[e]},wu=function e(t,r){if(0!==r.queue.length){var n=0,i=r.queue[n];if("mediaSource"!==i.type){if("mediaSource"!==t&&r.ready()&&"closed"!==r.mediaSource.readyState&&!_u(t,r)){if(i.type!==t){if(n=function(e,t){for(var r=0;r<t.length;r++){var n=t[r];if("mediaSource"===n.type)return null;if(n.type===e)return r}return null}(t,r.queue),null===n)return;i=r.queue[n]}return r.queue.splice(n,1),r.queuePending[t]=i,i.action(t,r),i.doneFn?void 0:(r.queuePending[t]=null,void e(t,r))}}else r.updating()||"closed"===r.mediaSource.readyState||(r.queue.shift(),i.action(r),i.doneFn&&i.doneFn(),e("audio",r),e("video",r))}},Tu=function(e,t){var r=t[e+"Buffer"],n=gu(e);r&&(r.removeEventListener("updateend",t["on"+n+"UpdateEnd_"]),r.removeEventListener("error",t["on"+n+"Error_"]),t.codecs[e]=null,t[e+"Buffer"]=null)},Su=function(e,t){return e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t)},Eu=function(e,t,r){return function(n,i){var o=i[n+"Buffer"];if(Su(i.mediaSource,o)){i.logger_("Appending segment "+t.mediaIndex+"'s "+e.length+" bytes to "+n+"Buffer");try{o.appendBuffer(e)}catch(e){i.logger_("Error with code "+e.code+" "+(22===e.code?"(QUOTA_EXCEEDED_ERR) ":"")+"when appending segment "+t.mediaIndex+" to "+n+"Buffer"),i.queuePending[n]=null,r(e)}}}},Ou=function(e,t){return function(r,n){var i=n[r+"Buffer"];if(Su(n.mediaSource,i)){n.logger_("Removing "+e+" to "+t+" from "+r+"Buffer");try{i.remove(e,t)}catch(i){n.logger_("Remove "+e+" to "+t+" from "+r+"Buffer failed")}}}},ku=function(e){return function(t,r){var n=r[t+"Buffer"];Su(r.mediaSource,n)&&(r.logger_("Setting "+t+"timestampOffset to "+e),n.timestampOffset=e)}},Cu=function(e){return function(t,r){e()}},Pu=function(e){return function(t){if("open"===t.mediaSource.readyState){t.logger_("Calling mediaSource endOfStream("+(e||"")+")");try{t.mediaSource.endOfStream(e)}catch(e){_a.log.warn("Failed to call media source endOfStream",e)}}}},xu=function(e,t){return function(r){var n=gu(e),i=U(t);r.logger_("Adding "+e+"Buffer with codec "+t+" to mediaSource");var o=r.mediaSource.addSourceBuffer(i);o.addEventListener("updateend",r["on"+n+"UpdateEnd_"]),o.addEventListener("error",r["on"+n+"Error_"]),r.codecs[e]=t,r[e+"Buffer"]=o}},ju=function(e){return function(t){var r=t[e+"Buffer"];if(Tu(e,t),Su(t.mediaSource,r)){t.logger_("Removing "+e+"Buffer with codec "+t.codecs[e]+" from mediaSource");try{t.mediaSource.removeSourceBuffer(r)}catch(t){_a.log.warn("Failed to removeSourceBuffer "+e+"Buffer",t)}}}},Lu=function(e){return function(t,r){var n=r[t+"Buffer"],i=U(e);Su(r.mediaSource,n)&&r.codecs[t]!==e&&(r.logger_("changing "+t+"Buffer codec from "+r.codecs[t]+" to "+e),n.changeType(i),r.codecs[t]=e)}},Iu=function(e){var t=e.type,r=e.sourceUpdater,n=e.action,i=e.doneFn,o=e.name;r.queue.push({type:t,action:n,doneFn:i,name:o}),wu(t,r)},Au=function(e,t){return function(r){if(t.queuePending[e]){var n=t.queuePending[e].doneFn;t.queuePending[e]=null,n&&n(t[e+"Error_"])}wu(e,t)}},Ru=function(e){function r(t){var r;return(r=e.call(this)||this).mediaSource=t,r.sourceopenListener_=function(){return wu("mediaSource",s(r))},r.mediaSource.addEventListener("sourceopen",r.sourceopenListener_),r.logger_=Oa("SourceUpdater"),r.audioTimestampOffset_=0,r.videoTimestampOffset_=0,r.queue=[],r.queuePending={audio:null,video:null},r.delayedAudioAppendQueue_=[],r.videoAppendQueued_=!1,r.codecs={},r.onVideoUpdateEnd_=Au("video",s(r)),r.onAudioUpdateEnd_=Au("audio",s(r)),r.onVideoError_=function(e){r.videoError_=e},r.onAudioError_=function(e){r.audioError_=e},r.createdSourceBuffers_=!1,r.initializedEme_=!1,r.triggeredReady_=!1,r}l(r,e);var n=r.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){Iu({type:"mediaSource",sourceUpdater:this,action:xu(e,t),name:"addSourceBuffer"})},n.abort=function(e){Iu({type:e,sourceUpdater:this,action:function(e,t){if("open"===t.mediaSource.readyState){var r=t[e+"Buffer"];if(Su(t.mediaSource,r)){t.logger_("calling abort on "+e+"Buffer");try{r.abort()}catch(t){_a.log.warn("Failed to abort on "+e+"Buffer",t)}}}},name:"abort"})},n.removeSourceBuffer=function(e){this.canRemoveSourceBuffer()?Iu({type:"mediaSource",sourceUpdater:this,action:ju(e),name:"removeSourceBuffer"}):_a.log.error("removeSourceBuffer is not supported!")},n.canRemoveSourceBuffer=function(){return!_a.browser.IE_VERSION&&!_a.browser.IS_FIREFOX&&t().MediaSource&&t().MediaSource.prototype&&"function"==typeof t().MediaSource.prototype.removeSourceBuffer},r.canChangeType=function(){return t().SourceBuffer&&t().SourceBuffer.prototype&&"function"==typeof t().SourceBuffer.prototype.changeType},n.canChangeType=function(){return this.constructor.canChangeType()},n.changeType=function(e,t){this.canChangeType()?Iu({type:e,sourceUpdater:this,action:Lu(t),name:"changeType"}):_a.log.error("changeType is not supported!")},n.addOrChangeSourceBuffers=function(e){var t=this;if(!e||"object"!=typeof e||0===Object.keys(e).length)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach((function(r){var n=e[r];if(!t.hasCreatedSourceBuffers())return t.addSourceBuffer(r,n);t.canChangeType()&&t.changeType(r,n)}))},n.appendBuffer=function(e,t){var r=this,n=e.segmentInfo,i=e.type,o=e.bytes;if(this.processedAppend_=!0,"audio"===i&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_("delayed audio append of "+o.length+" until video append");if(Iu({type:i,sourceUpdater:this,action:Eu(o,n||{mediaIndex:-1},t),doneFn:t,name:"appendBuffer"}),"video"===i){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;var a=this.delayedAudioAppendQueue_.slice();this.logger_("queuing delayed audio "+a.length+" appendBuffers"),this.delayedAudioAppendQueue_.length=0,a.forEach((function(e){r.appendBuffer.apply(r,e)}))}},n.audioBuffered=function(){return Su(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:_a.createTimeRange()},n.videoBuffered=function(){return Su(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:_a.createTimeRange()},n.buffered=function(){var e=Su(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Su(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():function(e,t){var r=null,n=null,i=0,o=[],a=[];if(!(e&&e.length&&t&&t.length))return _a.createTimeRange();for(var s=e.length;s--;)o.push({time:e.start(s),type:"start"}),o.push({time:e.end(s),type:"end"});for(s=t.length;s--;)o.push({time:t.start(s),type:"start"}),o.push({time:t.end(s),type:"end"});for(o.sort((function(e,t){return e.time-t.time})),s=0;s<o.length;s++)"start"===o[s].type?2==++i&&(r=o[s].time):"end"===o[s].type&&1==--i&&(n=o[s].time),null!==r&&null!==n&&(a.push([r,n]),r=null,n=null);return _a.createTimeRanges(a)}(this.audioBuffered(),this.videoBuffered())},n.setDuration=function(e,t){var r;void 0===t&&(t=mu),Iu({type:"mediaSource",sourceUpdater:this,action:(r=e,function(e){e.logger_("Setting mediaSource duration to "+r);try{e.mediaSource.duration=r}catch(e){_a.log.warn("Failed to set media source duration",e)}}),name:"duration",doneFn:t})},n.endOfStream=function(e,t){void 0===e&&(e=null),void 0===t&&(t=mu),"string"!=typeof e&&(e=void 0),Iu({type:"mediaSource",sourceUpdater:this,action:Pu(e),name:"endOfStream",doneFn:t})},n.removeAudio=function(e,t,r){void 0===r&&(r=mu),this.audioBuffered().length&&0!==this.audioBuffered().end(0)?Iu({type:"audio",sourceUpdater:this,action:Ou(e,t),doneFn:r,name:"remove"}):r()},n.removeVideo=function(e,t,r){void 0===r&&(r=mu),this.videoBuffered().length&&0!==this.videoBuffered().end(0)?Iu({type:"video",sourceUpdater:this,action:Ou(e,t),doneFn:r,name:"remove"}):r()},n.updating=function(){return!(!_u("audio",this)&&!_u("video",this))},n.audioTimestampOffset=function(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Iu({type:"audio",sourceUpdater:this,action:ku(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_},n.videoTimestampOffset=function(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset!==e&&(Iu({type:"video",sourceUpdater:this,action:ku(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_},n.audioQueueCallback=function(e){this.audioBuffer&&Iu({type:"audio",sourceUpdater:this,action:Cu(e),name:"callback"})},n.videoQueueCallback=function(e){this.videoBuffer&&Iu({type:"video",sourceUpdater:this,action:Cu(e),name:"callback"})},n.dispose=function(){var e=this;this.trigger("dispose"),bu.forEach((function(t){e.abort(t),e.canRemoveSourceBuffer()?e.removeSourceBuffer(t):e[t+"QueueCallback"]((function(){return Tu(t,e)}))})),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()},r}(_a.EventTarget),Du=function(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))},Mu=new Uint8Array("\n\n".split("").map((function(e){return e.charCodeAt(0)}))),Nu=function(e){function r(t,r){var n;return void 0===r&&(r={}),(n=e.call(this,t,r)||this).mediaSource_=null,n.subtitlesTrack_=null,n.loaderType_="subtitle",n.featuresNativeTextTracks_=t.featuresNativeTextTracks,n.shouldSaveSegmentTimingInfo_=!1,n}l(r,e);var n=r.prototype;return n.createTransmuxer_=function(){return null},n.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return _a.createTimeRanges();var e=this.subtitlesTrack_.cues,t=e[0].startTime,r=e[e.length-1].startTime;return _a.createTimeRanges([[t,r]])},n.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var r=bs(e),n=this.initSegments_[r];if(t&&!n&&e.bytes){var i=Mu.byteLength+e.bytes.byteLength,o=new Uint8Array(i);o.set(e.bytes),o.set(Mu,e.bytes.byteLength),this.initSegments_[r]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:o}}return n||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){uu(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,r,n){var i=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(r.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===qs&&this.handleTimeout_(),e.code===zs?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);var o=this.pendingSegment_;this.saveBandwidthRelatedStats_(o.duration,r.stats),this.state="APPENDING",this.trigger("appending");var a=o.segment;if(a.map&&(a.map.bytes=r.map.bytes),o.bytes=r.bytes,"function"!=typeof t().WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var s,u=function(){i.subtitlesTrack_.tech_.off("vttjsloaded",s),i.stopForError({message:"Error loading vtt.js"})};return s=function(){i.subtitlesTrack_.tech_.off("vttjserror",u),i.segmentRequestFinished_(e,r,n)},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",s),void this.subtitlesTrack_.tech_.one("vttjserror",u)}a.requested=!0;try{this.parseVTTCues_(o)}catch(e){return void this.stopForError({message:e.message})}if(this.updateTimeMapping_(o,this.syncController_.timelines[o.timeline],this.playlist_),o.cues.length?o.timingInfo={start:o.cues[0].startTime,end:o.cues[o.cues.length-1].endTime}:o.timingInfo={start:o.startOfSegment,end:o.startOfSegment+o.duration},o.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");o.byteLength=o.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,o.cues.forEach((function(e){i.subtitlesTrack_.addCue(i.featuresNativeTextTracks_?new(t().VTTCue)(e.startTime,e.endTime,e.text):e)})),function(e){var t=e.cues;if(t)for(var r=0;r<t.length;r++){for(var n=[],i=0,o=0;o<t.length;o++)t[r].startTime===t[o].startTime&&t[r].endTime===t[o].endTime&&t[r].text===t[o].text&&++i>1&&n.push(t[o]);n.length&&n.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 r,n=!1;"function"==typeof t().TextDecoder?r=new(t().TextDecoder)("utf8"):(r=t().WebVTT.StringDecoder(),n=!0);var i=new(t().WebVTT.Parser)(t(),t().vttjs,r);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){_a.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){var o=e.segment.map.bytes;n&&(o=Du(o)),i.parse(o)}var a=e.bytes;n&&(a=Du(a)),i.parse(a),i.flush()},n.updateTimeMapping_=function(e,t,r){var n=e.segment;if(t)if(e.cues.length){var i=e.timestampmap,o=i.MPEGTS/ot.ONE_SECOND_IN_TS-i.LOCAL+t.mapping;if(e.cues.forEach((function(e){e.startTime+=o,e.endTime+=o})),!r.syncInfo){var a=e.cues[0].startTime,s=e.cues[e.cues.length-1].startTime;r.syncInfo={mediaSequence:r.mediaSequence+e.mediaIndex,time:Math.min(a,s-n.duration)}}}else n.empty=!0},r}(yu),Bu=function(e,t){for(var r=e.cues,n=0;n<r.length;n++){var i=r[n];if(t>=i.adStartTime&&t<=i.adEndTime)return i}return null},Uu=function(e,t,r){void 0===r&&(r=0);var n=t.segments;return t.endList||0===r?e:n.length-(e+1)},Fu=[{name:"VOD",run:function(e,t,r,n,i){return r!==1/0?{time:0,segmentIndex:0}:null}},{name:"ProgramDateTime",run:function(e,t,r,n,i){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var o=t.segments||[],a=null,s=null;i=i||0;for(var u=0;u<o.length;u++){var l=Uu(u,t,i),c=o[l],f=e.timelineToDatetimeMappings[c.timeline];if(f&&c.dateTimeObject){var h=c.dateTimeObject.getTime()/1e3+f,p=Math.abs(i-h);if(null!==s&&(0===p||s<p))break;s=p,a={time:h,segmentIndex:l}}}return a}},{name:"Segment",run:function(e,t,r,n,i){var o=t.segments||[],a=null,s=null;i=i||0;for(var u=0;u<o.length;u++){var l=Uu(u,t,i),c=o[l];if(c.timeline===n&&void 0!==c.start){var f=Math.abs(i-c.start);if(null!==s&&s<f)break;(!a||null===s||s>=f)&&(s=f,a={time:c.start,segmentIndex:l})}}return a}},{name:"Discontinuity",run:function(e,t,r,n,i){var o=null;if(i=i||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var a=null,s=0;s<t.discontinuityStarts.length;s++){var u=t.discontinuityStarts[s],l=t.discontinuitySequence+s+1,c=e.discontinuities[l];if(c){var f=Math.abs(i-c.time);if(null!==a&&a<f)break;(!o||null===a||a>=f)&&(a=f,o={time:c.time,segmentIndex:u})}}return o}},{name:"Playlist",run:function(e,t,r,n,i){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence}:null}}],Vu=function(e){function t(t){var r;return(r=e.call(this)||this).timelines=[],r.discontinuities=[],r.timelineToDatetimeMappings={},r.logger_=Oa("SyncController"),r}l(t,e);var r=t.prototype;return r.getSyncPoint=function(e,t,r,n){var i=this.runStrategies_(e,t,r,n);return i.length?this.selectSyncPoint_(i,{key:"time",value:n}):null},r.getExpiredTime=function(e,t){if(!e||!e.segments)return null;var r=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!r.length)return null;var n=this.selectSyncPoint_(r,{key:"segmentIndex",value:0});return n.segmentIndex>0&&(n.time*=-1),Math.abs(n.time+Za(e,n.segmentIndex,0))},r.runStrategies_=function(e,t,r,n){for(var i=[],o=0;o<Fu.length;o++){var a=Fu[o],s=a.run(this,e,t,r,n);s&&(s.strategy=a.name,i.push({strategy:a.name,syncPoint:s}))}return i},r.selectSyncPoint_=function(e,t){for(var r=e[0].syncPoint,n=Math.abs(e[0].syncPoint[t.key]-t.value),i=e[0].strategy,o=1;o<e.length;o++){var a=Math.abs(e[o].syncPoint[t.key]-t.value);a<n&&(n=a,r=e[o].syncPoint,i=e[o].strategy)}return this.logger_("syncPoint for ["+t.key+": "+t.value+"] chosen with strategy ["+i+"]: [time:"+r.time+", segmentIndex:"+r.segmentIndex+"]"),r},r.saveExpiredSegmentInfo=function(e,t){for(var r=t.mediaSequence-e.mediaSequence-1;r>=0;r--){var n=e.segments[r];if(n&&void 0!==n.start){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.start},this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+", mediaSequence: "+t.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},r.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var t=e.segments[0],r=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-r}},r.saveSegmentTimingInfo=function(e){var t=e.segmentInfo,r=e.shouldSaveTimelineMapping,n=this.calculateSegmentTimeMapping_(t,t.timingInfo,r),i=t.segment;n&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:i.start}));var o=i.dateTimeObject;i.discontinuity&&r&&o&&(this.timelineToDatetimeMappings[i.timeline]=-o.getTime()/1e3)},r.timestampOffsetForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].time},r.mappingForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping},r.calculateSegmentTimeMapping_=function(e,t,r){var n=e.segment,i=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)i={time:e.startOfSegment,mapping:e.startOfSegment-t.start},r&&(this.timelines[e.timeline]=i,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+i.time+"] [mapping: "+i.mapping+"]")),n.start=e.startOfSegment,n.end=t.end+i.mapping;else{if(!i)return!1;n.start=t.start+i.mapping,n.end=t.end+i.mapping}return!0},r.saveDiscontinuitySyncInfo_=function(e){var t=e.playlist,r=e.segment;if(r.discontinuity)this.discontinuities[r.timeline]={time:r.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(var n=0;n<t.discontinuityStarts.length;n++){var i=t.discontinuityStarts[n],o=t.discontinuitySequence+n+1,a=i-e.mediaIndex,s=Math.abs(a);if(!this.discontinuities[o]||this.discontinuities[o].accuracy>s){var u;u=a<0?r.start-Za(t,e.mediaIndex,i):r.end+Za(t,e.mediaIndex+1,i),this.discontinuities[o]={time:u,accuracy:s}}}},r.dispose=function(){this.trigger("dispose"),this.off()},t}(_a.EventTarget),Hu=function(e){function t(){var t;return(t=e.call(this)||this).pendingTimelineChanges_={},t.lastTimelineChanges_={},t}l(t,e);var r=t.prototype;return r.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},r.pendingTimelineChange=function(e){var t=e.type,r=e.from,n=e.to;return"number"==typeof r&&"number"==typeof n&&(this.pendingTimelineChanges_[t]={type:t,from:r,to:n},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]},r.lastTimelineChange=function(e){var t=e.type,r=e.from,n=e.to;return"number"==typeof r&&"number"==typeof n&&(this.lastTimelineChanges_[t]={type:t,from:r,to:n},delete this.pendingTimelineChanges_[t],this.trigger("timelinechange")),this.lastTimelineChanges_[t]},r.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},t}(_a.EventTarget),qu=Rs(Ds((function(){function e(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var t=e((function(e){function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0})),r=e((function(e){function t(r,n){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,t(r,n)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0})),n=e((function(e){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0})),i=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 r=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(r,1),r>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var r=t.length,n=0;n<r;++n)t[n].call(this,arguments[1]);else for(var i=Array.prototype.slice.call(arguments,1),o=t.length,a=0;a<o;++a)t[a].apply(this,i)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}(),o=null,a=function(){function e(e){var t,r,n;o||(o=function(){var e,t,r,n,i,o,a,s,u=[[[],[],[],[],[]],[[],[],[],[],[]]],l=u[0],c=u[1],f=l[4],h=c[4],p=[],d=[];for(e=0;e<256;e++)d[(p[e]=e<<1^283*(e>>7))^e]=e;for(t=r=0;!f[t];t^=n||1,r=d[r]||1)for(o=(o=r^r<<1^r<<2^r<<3^r<<4)>>8^255&o^99,f[t]=o,h[o]=t,s=16843009*p[i=p[n=p[t]]]^65537*i^257*n^16843008*t,a=257*p[o]^16843008*o,e=0;e<4;e++)l[e][t]=a=a<<24^a>>>8,c[e][o]=s=s<<24^s>>>8;for(e=0;e<5;e++)l[e]=l[e].slice(0),c[e]=c[e].slice(0);return u}()),this._tables=[[o[0][0].slice(),o[0][1].slice(),o[0][2].slice(),o[0][3].slice(),o[0][4].slice()],[o[1][0].slice(),o[1][1].slice(),o[1][2].slice(),o[1][3].slice(),o[1][4].slice()]];var i=this._tables[0][4],a=this._tables[1],s=e.length,u=1;if(4!==s&&6!==s&&8!==s)throw new Error("Invalid aes key size");var l=e.slice(0),c=[];for(this._key=[l,c],t=s;t<4*s+28;t++)n=l[t-1],(t%s==0||8===s&&t%s==4)&&(n=i[n>>>24]<<24^i[n>>16&255]<<16^i[n>>8&255]<<8^i[255&n],t%s==0&&(n=n<<8^n>>>24^u<<24,u=u<<1^283*(u>>7))),l[t]=l[t-s]^n;for(r=0;t;r++,t--)n=l[3&r?t:t-4],c[r]=t<=4||r<4?n:a[0][i[n>>>24]]^a[1][i[n>>16&255]]^a[2][i[n>>8&255]]^a[3][i[255&n]]}return e.prototype.decrypt=function(e,t,r,n,i,o){var a,s,u,l,c=this._key[1],f=e^c[0],h=n^c[1],p=r^c[2],d=t^c[3],y=c.length/4-2,m=4,v=this._tables[1],g=v[0],b=v[1],_=v[2],w=v[3],T=v[4];for(l=0;l<y;l++)a=g[f>>>24]^b[h>>16&255]^_[p>>8&255]^w[255&d]^c[m],s=g[h>>>24]^b[p>>16&255]^_[d>>8&255]^w[255&f]^c[m+1],u=g[p>>>24]^b[d>>16&255]^_[f>>8&255]^w[255&h]^c[m+2],d=g[d>>>24]^b[f>>16&255]^_[h>>8&255]^w[255&p]^c[m+3],m+=4,f=a,h=s,p=u;for(l=0;l<4;l++)i[(3&-l)+o]=T[f>>>24]<<24^T[h>>16&255]<<16^T[p>>8&255]<<8^T[255&d]^c[m++],a=f,f=h,h=p,p=d,d=a},e}(),s=function(e){function t(){var t;return(t=e.call(this,i)||this).jobs=[],t.delay=1,t.timeout_=null,t}n(t,e);var r=t.prototype;return r.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},r.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(i),u=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},l=function(){function e(t,r,n,i){var o=e.STEP,a=new Int32Array(t.buffer),l=new Uint8Array(t.byteLength),c=0;for(this.asyncStream_=new s,this.asyncStream_.push(this.decryptChunk_(a.subarray(c,c+o),r,n,l)),c=o;c<a.length;c+=o)n=new Uint32Array([u(a[c-4]),u(a[c-3]),u(a[c-2]),u(a[c-1])]),this.asyncStream_.push(this.decryptChunk_(a.subarray(c,c+o),r,n,l));this.asyncStream_.push((function(){var e;i(null,(e=l).subarray(0,e.byteLength-e[e.byteLength-1]))}))}return e.prototype.decryptChunk_=function(e,t,r,n){return function(){var i=function(e,t,r){var n,i,o,s,l,c,f,h,p,d=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),y=new a(Array.prototype.slice.call(t)),m=new Uint8Array(e.byteLength),v=new Int32Array(m.buffer);for(n=r[0],i=r[1],o=r[2],s=r[3],p=0;p<d.length;p+=4)l=u(d[p]),c=u(d[p+1]),f=u(d[p+2]),h=u(d[p+3]),y.decrypt(l,c,f,h,v,p),v[p]=u(v[p]^n),v[p+1]=u(v[p+1]^i),v[p+2]=u(v[p+2]^o),v[p+3]=u(v[p+3]^s),n=l,i=c,o=f,s=h;return m}(e,t,r);n.set(i,e.byteOffset)}},t(e,null,[{key:"STEP",get:function(){return 32e3}}]),e}();self.onmessage=function(e){var t=e.data,r=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),n=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),i=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new l(r,n,i,(function(e,r){var n,i;self.postMessage((n={source:t.source,decrypted:r},i={},Object.keys(n).forEach((function(e){var t=n[e];ArrayBuffer.isView(t)?i[e]={bytes:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}:i[e]=t})),i),[r.buffer])}))}}))),zu=As(qu),Wu=function(e){var t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},Gu=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Xu=function(e,t){t.activePlaylistLoader=e,e.load()},Ku={AUDIO:function(e,t){return function(){var r=t.segmentLoaders[e],n=t.mediaTypes[e],i=t.blacklistCurrentPlaylist;Gu(r,n);var o=n.activeTrack(),a=n.activeGroup(),s=(a.filter((function(e){return e.default}))[0]||a[0]).id,u=n.tracks[s];if(o!==u){for(var l in _a.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[l].enabled=n.tracks[l]===u;n.onTrackChanged()}else i({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var r=t.segmentLoaders[e],n=t.mediaTypes[e];_a.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Gu(r,n);var i=n.activeTrack();i&&(i.mode="disabled"),n.onTrackChanged()}}},Yu={AUDIO:function(e,t,r){if(t){var n=r.tech,i=r.requestOptions,o=r.segmentLoaders[e];t.on("loadedmetadata",(function(){var e=t.media();o.playlist(e,i),(!n.paused()||e.endList&&"none"!==n.preload())&&o.load()})),t.on("loadedplaylist",(function(){o.playlist(t.media(),i),n.paused()||o.load()})),t.on("error",Ku[e](e,r))}},SUBTITLES:function(e,t,r){var n=r.tech,i=r.requestOptions,o=r.segmentLoaders[e],a=r.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();o.playlist(e,i),o.track(a.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&o.load()})),t.on("loadedplaylist",(function(){o.playlist(t.media(),i),n.paused()||o.load()})),t.on("error",Ku[e](e,r))}},Qu={AUDIO:function(e,t){var r=t.vhs,n=t.sourceType,i=t.segmentLoaders[e],o=t.requestOptions,a=t.master.mediaGroups,s=t.mediaTypes[e],u=s.groups,l=s.tracks,c=s.logger_,f=t.masterPlaylistLoader,h=us(f.master);for(var p in a[e]&&0!==Object.keys(a[e]).length||(a[e]={main:{default:{default:!0}}}),a[e])for(var d in u[p]||(u[p]=[]),a[e][p]){var y=a[e][p][d],m=void 0;if(h?(c("AUDIO group '"+p+"' label '"+d+"' is a master playlist"),y.isMasterPlaylist=!0,m=null):m="vhs-json"===n&&y.playlists?new Fa(y.playlists[0],r,o):y.resolvedUri?new Fa(y.resolvedUri,r,o):y.playlists&&"dash"===n?new js(y.playlists[0],r,o,f):null,y=_a.mergeOptions({id:d,playlistLoader:m},y),Yu[e](e,y.playlistLoader,t),u[p].push(y),void 0===l[d]){var v=new _a.AudioTrack({id:d,kind:Wu(y),enabled:!1,language:y.language,default:y.default,label:d});l[d]=v}}i.on("error",Ku[e](e,t))},SUBTITLES:function(e,t){var r=t.tech,n=t.vhs,i=t.sourceType,o=t.segmentLoaders[e],a=t.requestOptions,s=t.master.mediaGroups,u=t.mediaTypes[e],l=u.groups,c=u.tracks,f=t.masterPlaylistLoader;for(var h in s[e])for(var p in l[h]||(l[h]=[]),s[e][h])if(!s[e][h][p].forced){var d=s[e][h][p],y=void 0;if("hls"===i)y=new Fa(d.resolvedUri,n,a);else if("dash"===i){if(!d.playlists.filter((function(e){return e.excludeUntil!==1/0})).length)return;y=new js(d.playlists[0],n,a,f)}else"vhs-json"===i&&(y=new Fa(d.playlists?d.playlists[0]:d.resolvedUri,n,a));if(d=_a.mergeOptions({id:p,playlistLoader:y},d),Yu[e](e,d.playlistLoader,t),l[h].push(d),void 0===c[p]){var m=r.addRemoteTextTrack({id:p,kind:"subtitles",default:d.default&&d.autoselect,language:d.language,label:p},!1).track;c[p]=m}}o.on("error",Ku[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var r=t.tech,n=t.master.mediaGroups,i=t.mediaTypes[e],o=i.groups,a=i.tracks;for(var s in n[e])for(var u in o[s]||(o[s]=[]),n[e][s]){var l=n[e][s][u];if(l.instreamId.match(/CC\d/)&&(o[s].push(_a.mergeOptions({id:u},l)),void 0===a[u])){var c=r.addRemoteTextTrack({id:l.instreamId,kind:"captions",default:l.default&&l.autoselect,language:l.language,label:u},!1).track;a[u]=c}}}},$u=function e(t,r){for(var n=0;n<t.length;n++){if(as(r,t[n]))return!0;if(t[n].playlists&&e(t[n].playlists,r))return!0}return!1},Ju={AUDIO:function(e,t){return function(){var r=t.mediaTypes[e].tracks;for(var n in r)if(r[n].enabled)return r[n];return null}},SUBTITLES:function(e,t){return function(){var r=t.mediaTypes[e].tracks;for(var n in r)if("showing"===r[n].mode||"hidden"===r[n].mode)return r[n];return null}}},Zu=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred"],el=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},tl=function(e){function r(r){var n;n=e.call(this)||this;var i=r.src,o=r.handleManifestRedirects,a=r.withCredentials,u=r.tech,l=r.bandwidth,c=r.externVhs,f=r.useCueTags,h=r.blacklistDuration,p=r.enableLowInitialPlaylist,d=r.sourceType,y=r.cacheEncryptionKeys,m=r.experimentalBufferBasedABR;if(!i)throw new Error("A non-empty playlist URL or JSON manifest string is required");vu=c,n.experimentalBufferBasedABR=Boolean(m),n.withCredentials=a,n.tech_=u,n.vhs_=u.vhs,n.sourceType_=d,n.useCueTags_=f,n.blacklistDuration=h,n.enableLowInitialPlaylist=p,n.useCueTags_&&(n.cueTagsTrack_=n.tech_.addTextTrack("metadata","ad-cues"),n.cueTagsTrack_.inBandMetadataTrackDispatchType=""),n.requestOptions_={withCredentials:a,handleManifestRedirects:o,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:mu,activeTrack:mu,getActiveGroup:mu,onGroupChanged:mu,onTrackChanged:mu,lastTrack_:null,logger_:Oa("MediaGroups["+t+"]")}})),e}(),n.mediaSource=new(t().MediaSource),n.handleDurationChange_=n.handleDurationChange_.bind(s(n)),n.handleSourceOpen_=n.handleSourceOpen_.bind(s(n)),n.handleSourceEnded_=n.handleSourceEnded_.bind(s(n)),n.mediaSource.addEventListener("durationchange",n.handleDurationChange_),n.mediaSource.addEventListener("sourceopen",n.handleSourceOpen_),n.mediaSource.addEventListener("sourceended",n.handleSourceEnded_),n.seekable_=_a.createTimeRanges(),n.hasPlayed_=!1,n.syncController_=new Vu(r),n.segmentMetadataTrack_=u.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,n.decrypter_=new zu,n.sourceUpdater_=new Ru(n.mediaSource),n.inbandTextTracks_={},n.timelineChangeController_=new Hu;var v={vhs:n.vhs_,parse708captions:r.parse708captions,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:l,syncController:n.syncController_,decrypter:n.decrypter_,sourceType:n.sourceType_,inbandTextTracks:n.inbandTextTracks_,cacheEncryptionKeys:y,sourceUpdater:n.sourceUpdater_,timelineChangeController:n.timelineChangeController_};return n.masterPlaylistLoader_="dash"===n.sourceType_?new js(i,n.vhs_,n.requestOptions_):new Fa(i,n.vhs_,n.requestOptions_),n.setupMasterPlaylistLoaderListeners_(),n.mainSegmentLoader_=new yu(_a.mergeOptions(v,{segmentMetadataTrack:n.segmentMetadataTrack_,loaderType:"main"}),r),n.audioSegmentLoader_=new yu(_a.mergeOptions(v,{loaderType:"audio"}),r),n.subtitleSegmentLoader_=new Nu(_a.mergeOptions(v,{loaderType:"vtt",featuresNativeTextTracks:n.tech_.featuresNativeTextTracks}),r),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_()}))),Zu.forEach((function(e){n[e+"_"]=el.bind(s(n),e)})),n.logger_=Oa("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}l(r,e);var n=r.prototype;return n.checkABR_=function(){var e=this.selectPlaylist();this.shouldSwitchToMedia_(e)&&this.switchMedia_(e,"abr")},n.switchMedia_=function(e,t,r){var n=this.media(),i=n&&(n.id||n.uri),o=e.id||e.uri;i&&i!==o&&(this.logger_("switch media "+i+" -> "+o+" from "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,r)},n.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=t().setInterval((function(){return e.checkABR_()}),250)},n.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(t().clearInterval(this.abrTimer_),this.abrTimer_=null)},n.getAudioTrackPlaylists_=function(){var e=this.master();if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return e&&e.playlists||[];var t,r=e.mediaGroups.AUDIO,n=Object.keys(r);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)t=this.mediaTypes_.AUDIO.activeTrack();else{var i=r.main||n.length&&r[n[0]];for(var o in i)if(i[o].default){t={label:o};break}}if(!t)return[];var a=[];for(var s in r)if(r[s][t.label]){var u=r[s][t.label];u.playlists?a.push.apply(a,u.playlists):a.push(u)}return a},n.setupMasterPlaylistLoaderListeners_=function(){var e=this;this.masterPlaylistLoader_.on("loadedmetadata",(function(){var t=e.masterPlaylistLoader_.media(),r=1.5*t.targetDuration*1e3;os(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=r,t.endList&&"none"!==e.tech_.preload()&&(e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load()),function(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(t){Qu[t](t,e)}));var t=e.mediaTypes,r=e.masterPlaylistLoader,n=e.tech,i=e.vhs,o=e.segmentLoaders,a=o.AUDIO,s=o.main;["AUDIO","SUBTITLES"].forEach((function(r){t[r].activeGroup=function(e,t){return function(r){var n=t.masterPlaylistLoader,i=t.mediaTypes[e].groups,o=n.media();if(!o)return null;var a=null;o.attributes[e]&&(a=i[o.attributes[e]]);var s=Object.keys(i);if(!a)if("AUDIO"===e&&s.length>1&&us(t.master))for(var u=0;u<s.length;u++){var l=i[s[u]];if($u(l,o)){a=l;break}}else i.main?a=i.main:1===s.length&&(a=i[s[0]]);return void 0===r?a:null!==r&&a&&a.filter((function(e){return e.id===r.id}))[0]||null}}(r,e),t[r].activeTrack=Ju[r](r,e),t[r].onGroupChanged=function(e,t){return function(){var r=t.segmentLoaders,n=r[e],i=r.main,o=t.mediaTypes[e],a=o.activeTrack(),s=o.getActiveGroup(),u=o.activePlaylistLoader,l=o.lastGroup_;s&&l&&s.id===l.id||(o.lastGroup_=s,o.lastTrack_=a,Gu(n,o),s&&!s.isMasterPlaylist&&(s.playlistLoader?(n.resyncLoader(),Xu(s.playlistLoader,o)):u&&i.resetEverything()))}}(r,e),t[r].onGroupChanging=function(e,t){return function(){var r=t.segmentLoaders[e];t.mediaTypes[e].lastGroup_=null,r.abort(),r.pause()}}(r,e),t[r].onTrackChanged=function(e,t){return function(){var r=t.masterPlaylistLoader,n=t.segmentLoaders,i=n[e],o=n.main,a=t.mediaTypes[e],s=a.activeTrack(),u=a.getActiveGroup(),l=a.activePlaylistLoader,c=a.lastTrack_;if((!c||!s||c.id!==s.id)&&(a.lastGroup_=u,a.lastTrack_=s,Gu(i,a),u)){if(u.isMasterPlaylist){if(!s||!c||s.id===c.id)return;var f=t.vhs.masterPlaylistController_,h=f.selectPlaylist();if(f.media()===h)return;return a.logger_("track change. Switching master audio from "+c.id+" to "+s.id),r.pause(),o.resetEverything(),void f.fastQualityChange_(h)}if("AUDIO"===e){if(!u.playlistLoader)return o.setAudio(!0),void o.resetEverything();i.setAudio(!0),o.setAudio(!1)}l!==u.playlistLoader?(i.track&&i.track(s),i.resetEverything(),Xu(u.playlistLoader,a)):Xu(u.playlistLoader,a)}}}(r,e),t[r].getActiveGroup=function(e,t){var r=t.mediaTypes;return function(){var t=r[e].activeTrack();return t?r[e].activeGroup(t):null}}(r,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?(s.setAudio(!1),a.setAudio(!0)):s.setAudio(!0)}r.on("mediachange",(function(){["AUDIO","SUBTITLES"].forEach((function(e){return t[e].onGroupChanged()}))})),r.on("mediachanging",(function(){["AUDIO","SUBTITLES"].forEach((function(e){return t[e].onGroupChanging()}))}));var c=function(){t.AUDIO.onTrackChanged(),n.trigger({type:"usage",name:"vhs-audio-change"}),n.trigger({type:"usage",name:"hls-audio-change"})};for(var f in n.audioTracks().addEventListener("change",c),n.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),i.on("dispose",(function(){n.audioTracks().removeEventListener("change",c),n.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)})),n.clearTracks("audio"),t.AUDIO.tracks)n.audioTracks().addTrack(t.AUDIO.tracks[f])}({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 r;if(e.excludeUnsupportedVariants_(),e.enableLowInitialPlaylist&&(r=e.selectInitialPlaylist()),r||(r=e.selectPlaylist()),!r||!e.shouldSwitchToMedia_(r))return;if(e.initialMedia_=r,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(),r=1.5*t.targetDuration*1e3;os(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=r,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 r=e.mediaGroups||{},n=!0,i=Object.keys(r.AUDIO);for(var o in r.AUDIO)for(var a in r.AUDIO[o])r.AUDIO[o][a].uri||(n=!1);n&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(r.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),vu.Playlist.isAes(t)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),i.length&&Object.keys(r.AUDIO[i[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(),r=this.tech_.buffered();return function(e){var t=e.currentPlaylist,r=e.nextPlaylist,n=e.forwardBuffer,i=e.bufferLowWaterLine,o=e.bufferHighWaterLine,a=e.duration,s=e.experimentalBufferBasedABR,u=e.log;if(!r)return _a.log.warn("We received no playlist to switch to. Please check your stream."),!1;var l="allowing switch "+(t&&t.id||"null")+" -> "+r.id;if(!t||!t.endList)return u(l+" as current playlist "+(t?"is live":"is not set")),!0;if(r.id===t.id)return!1;var c=s?Ls.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Ls.MAX_BUFFER_LOW_WATER_LINE;if(a<c)return u(l+" as duration < max low water line ("+a+" < "+c+")"),!0;var f=r.attributes.BANDWIDTH,h=t.attributes.BANDWIDTH;if(f<h&&(!s||n<o)){var p=l+" as next bandwidth < current bandwidth ("+f+" < "+h+")";return s&&(p+=" and forwardBuffer < bufferHighWaterLine ("+n+" < "+o+")"),u(p),!0}if((!s||f>h)&&n>=i){var d=l+" as forwardBuffer >= bufferLowWaterLine ("+n+" >= "+i+")";return s&&(d+=" and next bandwidth > current bandwidth ("+f+" > "+h+")"),u(d),!0}return u("not "+l+" as no switching criteria met"),!1}({currentPlaylist:t,nextPlaylist:e,forwardBuffer:r.length?r.end(r.length-1)-this.tech_.currentTime():0,bufferLowWaterLine:this.bufferLowWaterLine(),bufferHighWaterLine:this.bufferHighWaterLine(),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()),e!==this.masterPlaylistLoader_.media()&&(this.switchMedia_(e,"smooth-quality"),this.mainSegmentLoader_.resetLoader())},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(){_a.browser.IE_VERSION||_a.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 r=this.seekable();if(!r.length)return!1;if(_a.browser.IE_VERSION&&0===this.tech_.readyState())return this.tech_.one("loadedmetadata",(function(){e.trigger("firstplay"),e.tech_.setCurrentTime(r.end(0)),e.hasPlayed_=!0})),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(r.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_;this.mediaTypes_.AUDIO.activePlaylistLoader&&(e=!this.mainSegmentLoader_.currentMediaInfo_||this.mainSegmentLoader_.currentMediaInfo_.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 r=vu.Playlist.playlistEnd(e,t),n=this.tech_.currentTime(),i=this.tech_.buffered();if(!i.length)return r-n<=Ha;var o=i.end(i.length-1);return o-n<=Ha&&r-o<=Ha},n.blacklistCurrentPlaylist=function(e,t){void 0===e&&(e={});var r=e.playlist||this.masterPlaylistLoader_.media();if(t=t||e.blacklistDuration||this.blacklistDuration,!r)return this.error=e,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));var n=this.masterPlaylistLoader_.master.playlists,i=n.filter(ns),o=1===i.length&&i[0]===r;if(1===n.length&&t!==1/0)return _a.log.warn("Problem encountered with playlist "+r.id+". Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(o);if(o){var a=!1;n.forEach((function(e){if(e!==r){var t=e.excludeUntil;void 0!==t&&t!==1/0&&(a=!0,delete e.excludeUntil)}})),a&&(_a.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}r.excludeUntil=Date.now()+1e3*t,e.reason&&(r.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 s=this.selectPlaylist();if(!s)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var u=e.internal?this.logger_:_a.log.warn,l=e.message?" "+e.message:"";u((e.internal?"Internal problem":"Problem")+" encountered with playlist "+r.id+"."+l+" Switching to playlist "+s.id+"."),s.attributes.AUDIO!==r.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),s.attributes.SUBTITLES!==r.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var c=s.targetDuration/2*1e3||5e3,f="number"==typeof s.lastRequest&&Date.now()-s.lastRequest<=c;return this.switchMedia_(s,"exclude",o||f)},n.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},n.delegateLoaders_=function(e,t){var r=this,n=[],i="all"===e;(i||"main"===e)&&n.push(this.masterPlaylistLoader_);var o=[];(i||"audio"===e)&&o.push("AUDIO"),(i||"subtitle"===e)&&(o.push("CLOSED-CAPTIONS"),o.push("SUBTITLES")),o.forEach((function(e){var t=r.mediaTypes_[e]&&r.mediaTypes_[e].activePlaylistLoader;t&&n.push(t)})),["main","audio","subtitle"].forEach((function(t){var i=r[t+"SegmentLoader_"];!i||e!==t&&"all"!==e||n.push(i)})),n.forEach((function(e){return t.forEach((function(t){"function"==typeof e[t]&&e[t]()}))}))},n.setCurrentTime=function(e){var t=za(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:vu.Playlist.duration(e):1/0:0},n.seekable=function(){return this.seekable_},n.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var t=this.masterPlaylistLoader_.media();if(t){var r=this.syncController_.getExpiredTime(t,this.duration());if(null!==r){var n=this.masterPlaylistLoader_.master,i=vu.Playlist.seekable(t,r,vu.Playlist.liveEdgeDelay(n,t));if(0!==i.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(r=this.syncController_.getExpiredTime(t,this.duration())))return;if(0===(e=vu.Playlist.seekable(t,r,vu.Playlist.liveEdgeDelay(n,t))).length)return}var o,a;this.seekable_&&this.seekable_.length&&(o=this.seekable_.end(0),a=this.seekable_.start(0)),e?e.start(0)>i.end(0)||i.start(0)>e.end(0)?this.seekable_=i:this.seekable_=_a.createTimeRanges([[e.start(0)>i.start(0)?e.start(0):i.start(0),e.end(0)<i.end(0)?e.end(0):i.end(0)]]):this.seekable_=i,this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===o&&this.seekable_.start(0)===a||(this.logger_("seekable updated ["+Ga(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 r=this.tech_.buffered(),n=vu.Playlist.duration(this.masterPlaylistLoader_.media());r.length>0&&(n=Math.max(n,r.end(r.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)}},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 r=e.mediaTypes_[t].groups;for(var n in r)r[n].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;return!(!this.mainSegmentLoader_.currentMediaInfo_||e&&!this.audioSegmentLoader_.currentMediaInfo_)},n.getCodecsOrExclude_=function(){var e=this,t={main:this.mainSegmentLoader_.currentMediaInfo_||{},audio:this.audioSegmentLoader_.currentMediaInfo_||{}};t.video=t.main;var r=eu(this.master(),this.media()),n={},i=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(n.video=r.video||t.main.videoCodec||"avc1.4d400d"),t.main.isMuxed&&(n.video+=","+(r.audio||t.main.audioCodec||H)),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||i)&&(n.audio=r.audio||t.main.audioCodec||t.audio.audioCodec||H,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),n.audio||n.video){var o,a={};if(["video","audio"].forEach((function(e){if(n.hasOwnProperty(e)&&(i=t[e].isFmp4,s=n[e],!(i?F(s):V(s)))){var r=t[e].isFmp4?"browser":"muxer";a[r]=a[r]||[],a[r].push(n[e]),"audio"===e&&(o=r)}var i,s})),i&&o&&this.media().attributes.AUDIO){var s=this.media().attributes.AUDIO;this.master().playlists.forEach((function(t){(t.attributes&&t.attributes.AUDIO)===s&&t!==e.media()&&(t.excludeUntil=1/0)})),this.logger_("excluding audio group "+s+" as "+o+' does not support codec(s): "'+n.audio+'"')}if(!Object.keys(a).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var u=[];if(["video","audio"].forEach((function(t){var r=(N(e.sourceUpdater_.codecs[t]||"")[0]||{}).type,i=(N(n[t]||"")[0]||{}).type;r&&i&&r.toLowerCase()!==i.toLowerCase()&&u.push('"'+e.sourceUpdater_.codecs[t]+'" -> "'+n[t]+'"')})),u.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+u.join(", ")+".",blacklistDuration:1/0,internal:!0})}return n}var l=Object.keys(a).reduce((function(e,t){return e&&(e+=", "),e+(t+' does not support codec(s): "')+a[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,r=[];Object.keys(t).forEach((function(n){var i=t[n];if(-1===r.indexOf(i.id)){r.push(i.id);var o=eu(e.master,i),a=[];!o.audio||V(o.audio)||F(o.audio)||a.push("audio codec "+o.audio),!o.video||V(o.video)||F(o.video)||a.push("video codec "+o.video),o.text&&"stpp.ttml.im1t"===o.text&&a.push("text codec "+o.text),a.length&&(i.excludeUntil=1/0,e.logger_("excluding "+i.id+" for unsupported: "+a.join(", ")))}}))},n.excludeIncompatibleVariants_=function(e){var t=this,r=[],n=this.master().playlists,i=Js(N(e)),o=Zs(i),a=i.video&&N(i.video)[0]||null,s=i.audio&&N(i.audio)[0]||null;Object.keys(n).forEach((function(e){var i=n[e];if(-1===r.indexOf(i.id)&&i.excludeUntil!==1/0){r.push(i.id);var u=[],l=eu(t.masterPlaylistLoader_.master,i),c=Zs(l);if(l.audio||l.video){if(c!==o&&u.push('codec count "'+c+'" !== "'+o+'"'),!t.sourceUpdater_.canChangeType()){var f=l.video&&N(l.video)[0]||null,h=l.audio&&N(l.audio)[0]||null;f&&a&&f.type.toLowerCase()!==a.type.toLowerCase()&&u.push('video codec "'+f.type+'" !== "'+a.type+'"'),h&&s&&h.type.toLowerCase()!==s.type.toLowerCase()&&u.push('audio codec "'+h.type+'" !== "'+s.type+'"')}u.length&&(i.excludeUntil=1/0,t.logger_("blacklisting "+i.id+": "+u.join(" && ")))}}}))},n.updateAdCues_=function(e){var r=0,n=this.seekable();n.length&&(r=n.start(0)),function(e,r,n){if(void 0===n&&(n=0),e.segments)for(var i,o=n,a=0;a<e.segments.length;a++){var s=e.segments[a];if(i||(i=Bu(r,o+s.duration/2)),i){if("cueIn"in s){i.endTime=o,i.adEndTime=o,o+=s.duration,i=null;continue}if(o<i.endTime){o+=s.duration;continue}i.endTime+=s.duration}else if("cueOut"in s&&((i=new(t().VTTCue)(o,o+s.duration,s.cueOut)).adStartTime=o,i.adEndTime=o+parseFloat(s.cueOut),r.addCue(i)),"cueOutCont"in s){var u=s.cueOutCont.split("/").map(parseFloat),l=u[0],c=u[1];(i=new(t().VTTCue)(o,o+s.duration,"")).adStartTime=o-l,i.adEndTime=i.adStartTime+c,r.addCue(i)}o+=s.duration}}(e,this.cueTagsTrack_,r)},n.goalBufferLength=function(){var e=this.tech_.currentTime(),t=Ls.GOAL_BUFFER_LENGTH,r=Ls.GOAL_BUFFER_LENGTH_RATE,n=Math.max(t,Ls.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*r,n)},n.bufferLowWaterLine=function(){var e=this.tech_.currentTime(),t=Ls.BUFFER_LOW_WATER_LINE,r=Ls.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(t,Ls.MAX_BUFFER_LOW_WATER_LINE),i=Math.max(t,Ls.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*r,this.experimentalBufferBasedABR?i:n)},n.bufferHighWaterLine=function(){return Ls.BUFFER_HIGH_WATER_LINE},r}(_a.EventTarget),rl=function(e,t,r){var n,i,o,a=e.masterPlaylistController_,s=a[(e.options_.smoothQualityChange?"smooth":"fast")+"QualityChange_"].bind(a);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=eu(a.master(),t),this.playlist=t,this.id=r,this.enabled=(n=e.playlists,i=t.id,o=s,function(e){var t=n.master.playlists[i],r=rs(t),a=ns(t);return void 0===e?a:(e?delete t.disabled:t.disabled=!0,e===a||r||(o(),e?n.trigger("renditionenabled"):n.trigger("renditiondisabled")),e)})},nl=["seeking","seeked","pause","playing","error"],il=function(){function e(e){var r=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_=Oa("PlaybackWatcher"),this.logger_("initialize");var n=function(){return r.monitorCurrentTime_()},i=function(){return r.monitorCurrentTime_()},o=function(){return r.techWaiting_()},a=function(){return r.cancelTimer_()},s=function(){return r.fixesBadSeeks_()},u=this.masterPlaylistController_,l=["main","subtitle","audio"],c={};l.forEach((function(e){c[e]={reset:function(){return r.resetSegmentDownloads_(e)},updateend:function(){return r.checkSegmentDownloads_(e)}},u[e+"SegmentLoader_"].on("appendsdone",c[e].updateend),u[e+"SegmentLoader_"].on("playlistupdate",c[e].reset),r.tech_.on(["seeked","seeking"],c[e].reset)})),this.tech_.on("seekablechanged",s),this.tech_.on("waiting",o),this.tech_.on(nl,a),this.tech_.on("canplay",i),this.tech_.one("play",n),this.dispose=function(){r.logger_("dispose"),r.tech_.off("seekablechanged",s),r.tech_.off("waiting",o),r.tech_.off(nl,a),r.tech_.off("canplay",i),r.tech_.off("play",n),l.forEach((function(e){u[e+"SegmentLoader_"].off("appendsdone",c[e].updateend),u[e+"SegmentLoader_"].off("playlistupdate",c[e].reset),r.tech_.off(["seeked","seeking"],c[e].reset)})),r.checkCurrentTimeTimeout_&&t().clearTimeout(r.checkCurrentTimeTimeout_),r.cancelTimer_()}}var r=e.prototype;return r.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&t().clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=t().setTimeout(this.monitorCurrentTime_.bind(this),250)},r.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_()},r.checkSegmentDownloads_=function(e){var t=this.masterPlaylistController_,r=t[e+"SegmentLoader_"],n=r.buffered_(),i=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(var r=0;r<e.length;r++)if(e.start(r)!==t.start(r)||e.end(r)!==t.end(r))return!0;return!1}(this[e+"Buffered_"],n);this[e+"Buffered_"]=n,i?this.resetSegmentDownloads_(e):(this[e+"StalledDownloads_"]++,this.logger_("found #"+this[e+"StalledDownloads_"]+" "+e+" appends that did not increase buffer (possible stalled download)",{playlistId:r.playlist_&&r.playlist_.id,buffered:Xa(n)}),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)))},r.checkCurrentTime_=function(){if(this.tech_.seeking()&&this.fixesBadSeeks_())return this.consecutiveUpdates=0,void(this.lastRecordedTime=this.tech_.currentTime());if(!this.tech_.paused()&&!this.tech_.seeking()){var e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Ha>=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)}},r.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},r.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var e,t=this.seekable(),r=this.tech_.currentTime();if(this.afterSeekableWindow_(t,r,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1)),this.beforeSeekableWindow_(t,r)){var n=t.start(0);e=n+(n===t.end(0)?0:Ha)}if(void 0!==e)return this.logger_("Trying to seek outside of seekable at time "+r+" with seekable range "+Ga(t)+". Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0;var i=this.tech_.buffered();return!!function(e){var t=e.buffered,r=e.targetDuration,n=e.currentTime;return!(!t.length||t.end(0)-t.start(0)<2*r||n>t.start(0)||!(t.start(0)-n<r))}({buffered:i,targetDuration:this.media().targetDuration,currentTime:r})&&(e=i.start(0)+Ha,this.logger_("Buffered region starts ("+i.start(0)+") just beyond seek point ("+r+"). Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0)},r.waiting_=function(){if(!this.techWaiting_()){var e=this.tech_.currentTime(),t=this.tech_.buffered(),r=za(t,e);return r.length&&e+3<=r.end(0)?(this.cancelTimer_(),this.tech_.setCurrentTime(e),this.logger_("Stopped at "+e+" while inside a buffered region ["+r.start(0)+" -> "+r.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}},r.techWaiting_=function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_())return!0;if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var r=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+r),this.cancelTimer_(),this.tech_.setCurrentTime(r),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var n=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,i=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.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 o=Wa(i,t);if(o.length>0){var a=o.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+a+", seeking to "+o.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*a,t),!0}return!1},r.afterSeekableWindow_=function(e,t,r,n){if(void 0===n&&(n=!1),!e.length)return!1;var i=e.end(e.length-1)+Ha;return!r.endList&&n&&(i=e.end(e.length-1)+3*r.targetDuration),t>i},r.beforeSeekableWindow_=function(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)},r.videoUnderflow_=function(e){var t=e.videoBuffered,r=e.audioBuffered,n=e.currentTime;if(t){var i;if(t.length&&r.length){var o=za(t,n-3),a=za(t,n),s=za(r,n);s.length&&!a.length&&o.length&&(i={start:o.end(0),end:s.end(0)})}else Wa(t,n).length||(i=this.gapFromVideoUnderflow_(t,n));return!!i&&(this.logger_("Encountered a gap in video from "+i.start+" to "+i.end+". Seeking to current time "+n),!0)}},r.skipTheGap_=function(e){var t=this.tech_.buffered(),r=this.tech_.currentTime(),n=Wa(t,r);this.cancelTimer_(),0!==n.length&&r===e&&(this.logger_("skipTheGap_:","currentTime:",r,"scheduled currentTime:",e,"nextRange start:",n.start(0)),this.tech_.setCurrentTime(n.start(0)+Va),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))},r.gapFromVideoUnderflow_=function(e,t){for(var r=function(e){if(e.length<2)return _a.createTimeRanges();for(var t=[],r=1;r<e.length;r++){var n=e.end(r-1),i=e.start(r);t.push([n,i])}return _a.createTimeRanges(t)}(e),n=0;n<r.length;n++){var i=r.start(n),o=r.end(n);if(t-i<4&&t-i>2)return{start:i,end:o}}return null},e}(),ol={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},al=function e(t,r){var n=0,i=0,o=_a.mergeOptions(ol,r);t.ready((function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})}));var a=function(){i&&t.currentTime(i)},s=function(e){null!=e&&(i=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",a),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()-n<1e3*o.errorInterval?(t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void t.trigger({type:"usage",name:"hls-error-reload-canceled"})):o.getSource&&"function"==typeof o.getSource?(n=Date.now(),o.getSource.call(t,s)):void _a.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},l=function e(){t.off("loadedmetadata",a),t.off("error",u),t.off("dispose",e)};t.on("error",u),t.on("dispose",l),t.reloadSourceOnError=function(r){l(),e(t,r)}},sl=function(e){al(this,e)},ul="2.8.2",ll={PlaylistLoader:Fa,Playlist:ls,utils:Ts,STANDARD_PLAYLIST_SELECTOR:su,INITIAL_PLAYLIST_SELECTOR:function(){var e=this,t=this.playlists.master.playlists.filter(ls.isEnabled);return iu(t,(function(e,t){return ou(e,t)})),t.filter((function(t){return!!eu(e.playlists.master,t).video}))[0]||null},lastBandwidthSelector:su,movingAverageBandwidthSelector:function(e){var r=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var n=this.useDevicePixelRatio&&t().devicePixelRatio||1;return r<0&&(r=this.systemBandwidth),r=e*this.systemBandwidth+(1-e)*r,au(this.playlists.master,r,parseInt(nu(this.tech_.el(),"width"),10)*n,parseInt(nu(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:ou,comparePlaylistResolution:function(e,r){var n,i;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(n=e.attributes.RESOLUTION.width),n=n||t().Number.MAX_VALUE,r.attributes.RESOLUTION&&r.attributes.RESOLUTION.width&&(i=r.attributes.RESOLUTION.width),n===(i=i||t().Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&r.attributes.BANDWIDTH?e.attributes.BANDWIDTH-r.attributes.BANDWIDTH:n-i},xhr:ps()};Object.keys(Ls).forEach((function(e){Object.defineProperty(ll,e,{get:function(){return _a.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),Ls[e]},set:function(t){_a.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?_a.log.warn("value of Vhs."+e+" must be greater than or equal to 0"):Ls[e]=t}})}));var cl="videojs-vhs",fl=function(e,t){for(var r=t.media(),n=-1,i=0;i<e.length;i++)if(e[i].id===r.id){n=i;break}e.selectedIndex_=n,e.trigger({selectedIndex:n,type:"change"})};ll.canPlaySource=function(){return _a.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var hl=function(){if(!t().localStorage)return null;var e=t().localStorage.getItem(cl);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}};ll.supportsNativeHls=function(){if(!o()||!o().createElement)return!1;var e=o().createElement("video");return!!_a.getTech("Html5").isSupported()&&["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))}))}(),ll.supportsNativeDash=!!(o()&&o().createElement&&_a.getTech("Html5").isSupported())&&/maybe|probably/i.test(o().createElement("video").canPlayType("application/dash+xml")),ll.supportsTypeNatively=function(e){return"hls"===e?ll.supportsNativeHls:"dash"===e&&ll.supportsNativeDash},ll.isSupported=function(){return _a.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var pl=function(e){function r(t,r,n){var i;if(i=e.call(this,r,_a.mergeOptions(n.hls,n.vhs))||this,n.hls&&Object.keys(n.hls).length&&_a.log.warn("Using hls options is deprecated. Use vhs instead."),"number"==typeof n.initialBandwidth&&(i.options_.bandwidth=n.initialBandwidth),i.logger_=Oa("VhsHandler"),r.options_&&r.options_.playerId){var a=_a(r.options_.playerId);a.hasOwnProperty("hls")||Object.defineProperty(a,"hls",{get:function(){return _a.log.warn("player.hls is deprecated. Use player.tech().vhs instead."),r.trigger({type:"usage",name:"hls-player-access"}),s(i)},configurable:!0}),a.hasOwnProperty("vhs")||Object.defineProperty(a,"vhs",{get:function(){return _a.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."),r.trigger({type:"usage",name:"vhs-player-access"}),s(i)},configurable:!0}),a.hasOwnProperty("dash")||Object.defineProperty(a,"dash",{get:function(){return _a.log.warn("player.dash is deprecated. Use player.tech().vhs instead."),s(i)},configurable:!0}),i.player_=a}if(i.tech_=r,i.source_=t,i.stats={},i.ignoreNextSeekingEvent_=!1,i.setOptions_(),i.options_.overrideNative&&r.overrideNativeAudioTracks&&r.overrideNativeVideoTracks)r.overrideNativeAudioTracks(!0),r.overrideNativeVideoTracks(!0);else if(i.options_.overrideNative&&(r.featuresNativeVideoTracks||r.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return i.on(o(),["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(function(e){var t=o().fullscreenElement||o().webkitFullscreenElement||o().mozFullScreenElement||o().msFullscreenElement;t&&t.contains(i.tech_.el())&&i.masterPlaylistController_.smoothQualityChange_()})),i.on(i.tech_,"seeking",(function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())})),i.on(i.tech_,"error",(function(){this.tech_.error()&&this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()})),i.on(i.tech_,"play",i.play),i}l(r,e);var n=r.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_.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=hl();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=Ls.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Ls.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","experimentalBufferBasedABR","liveRangeSafeTimeDelta","experimentalLLHLS"].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,r){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=ll,this.options_.sourceType=W(r),this.options_.seekTo=function(e){n.tech_.setCurrentTime(e)},this.masterPlaylistController_=new tl(this.options_);var o=_a.mergeOptions({liveRangeSafeTimeDelta:Ha},this.options_,{seekable:function(){return n.seekable()},media:function(){return n.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_});this.playbackWatcher_=new il(o),this.masterPlaylistController_.on("error",(function(){var e=_a.players[n.tech_.options_.playerId],t=n.masterPlaylistController_.error;"object"!=typeof t||t.code?"string"==typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)}));var a=this.options_.experimentalBufferBasedABR?ll.movingAverageBandwidthSelector(.55):ll.STANDARD_PLAYLIST_SELECTOR;this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):a.bind(this),this.masterPlaylistController_.selectInitialPlaylist=ll.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(e){this.masterPlaylistController_.selectPlaylist=e.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=e,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.bandwidth},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var e,t=1/(this.bandwidth||1);return e=this.throughput>0?1/this.throughput:0,Math.floor(1/(t+e))},set:function(){_a.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return n.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return n.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return n.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return n.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return n.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return n.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return n.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return n.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},buffered:{get:function(){return Xa(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 Xa(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(!t().localStorage)return!1;var r=hl();r=r?_a.mergeOptions(r,e):e;try{t().localStorage.setItem(cl,JSON.stringify(r))}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(),r=us(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return r?r.filter((function(e){return!rs(e)})).map((function(t,r){return new rl(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_=t().URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},n.setupEme_=function(){var e,t,r,n=this,i=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,o=(e={player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:i&&i.media()},t=e.player,!(!(r=function(e,t,r){if(!e)return e;var n={};t&&t.attributes&&t.attributes.CODECS&&(n=Js(N(t.attributes.CODECS))),r&&r.attributes&&r.attributes.CODECS&&(n.audio=r.attributes.CODECS);var i=U(n.video),o=U(n.audio),a={};for(var s in e)a[s]={},o&&(a[s].audioContentType=o),i&&(a[s].videoContentType=i),t.contentProtection&&t.contentProtection[s]&&t.contentProtection[s].pssh&&(a[s].pssh=t.contentProtection[s].pssh),"string"==typeof e[s]&&(a[s].url=e[s]);return _a.mergeOptions(e,a)}(e.sourceKeySystems,e.media,e.audioMedia))||(t.currentSource().keySystems=r,r&&!t.eme&&(_a.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),1))));11!==_a.browser.IE_VERSION&&o?(this.logger_("waiting for EME key session creation"),function(e){var t=e.player,r=e.sourceKeySystems,n=e.audioMedia,i=e.mainPlaylists;if(!t.eme.initializeMediaKeys)return Promise.resolve();var o,a,s=(o=n?i.concat([n]):i,a=Object.keys(r),o.reduce((function(e,t){if(!t.contentProtection)return e;var r=a.reduce((function(e,r){var n=t.contentProtection[r];return n&&n.pssh&&(e[r]={pssh:n.pssh}),e}),{});return Object.keys(r).length&&e.push(r),e}),[])),u=[],l=[];return s.forEach((function(e){l.push(new Promise((function(e,r){t.tech_.one("keysessioncreated",e)}))),u.push(new Promise((function(r,n){t.eme.initializeMediaKeys({keySystems:e},(function(e){e?n(e):r()}))})))})),Promise.race([Promise.all(u),Promise.race(l)])}({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:i&&i.media(),mainPlaylists:this.playlists.master.playlists}).then((function(){n.logger_("created EME key session"),n.masterPlaylistController_.sourceUpdater_.initializedEme()})).catch((function(e){n.logger_("error while creating EME key session",e),n.player_.error({message:"Failed to initialize media keys for EME",code:3})}))):this.masterPlaylistController_.sourceUpdater_.initializedEme()},n.setupQualityLevels_=function(){var e=this,t=_a.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)})),fl(e,t.playlists)}(e.qualityLevels_,e)})),this.playlists.on("mediachange",(function(){fl(e.qualityLevels_,e.playlists)})))},r.version=function(){return{"@videojs/http-streaming":ul,"mux.js":"5.11.0","mpd-parser":"0.16.0","m3u8-parser":"4.7.0","aes-decrypter":"3.1.2"}},n.version=function(){return this.constructor.version()},n.canChangeType=function(){return Ru.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_&&t().URL.revokeObjectURL&&(t().URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),e.prototype.dispose.call(this)},n.convertToProgramTime=function(e,t){return function(e){var t=e.playlist,r=e.time,n=void 0===r?void 0:r,i=e.callback;if(!i)throw new Error("getProgramTime: callback must be provided");if(!t||void 0===n)return i({message:"getProgramTime: playlist and time must be provided"});var o=function(e,t){if(!t||!t.segments||0===t.segments.length)return null;for(var r,n=0,i=0;i<t.segments.length&&!(e<=(n=(r=t.segments[i]).videoTimingInfo?r.videoTimingInfo.transmuxedPresentationEnd:n+r.duration));i++);var o=t.segments[t.segments.length-1];if(o.videoTimingInfo&&o.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>n){if(e>n+.25*o.duration)return null;r=o}return{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:n-r.duration,type:r.videoTimingInfo?"accurate":"estimate"}}(n,t);if(!o)return i({message:"valid programTime was not found"});if("estimate"===o.type)return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:o.estimatedStart});var a={mediaSeconds:n},s=function(e,t){if(!t.dateTimeObject)return null;var r=t.videoTimingInfo.transmuxerPrependedSeconds,n=e-(t.videoTimingInfo.transmuxedPresentationStart+r);return new Date(t.dateTimeObject.getTime()+1e3*n)}(n,o.segment);return s&&(a.programDateTime=s.toISOString()),i(null,a)}({playlist:this.masterPlaylistController_.media(),time:e,callback:t})},n.seekToProgramTime=function(e,t,r,n){return void 0===r&&(r=!0),void 0===n&&(n=2),Ss({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:r,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})},r}(_a.getComponent("Component")),dl={name:"videojs-http-streaming",VERSION:ul,canHandleSource:function(e,t){void 0===t&&(t={});var r=_a.mergeOptions(_a.options,t);return dl.canPlayType(e.type,r)},handleSource:function(e,t,r){void 0===r&&(r={});var n=_a.mergeOptions(_a.options,r);return t.vhs=new pl(e,t,n),_a.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return _a.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=ps(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){void 0===t&&(t={});var r=_a.mergeOptions(_a.options,t).vhs.overrideNative,n=void 0===r?!_a.browser.IS_ANY_SAFARI:r,i=W(e);return!i||ll.supportsTypeNatively(i)&&!n?"":"maybe"}};F("avc1.4d400d,mp4a.40.2")&&_a.getTech("Html5").registerSourceHandler(dl,0),_a.VhsHandler=pl,Object.defineProperty(_a,"HlsHandler",{get:function(){return _a.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),pl},configurable:!0}),_a.VhsSourceHandler=dl,Object.defineProperty(_a,"HlsSourceHandler",{get:function(){return _a.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),dl},configurable:!0}),_a.Vhs=ll,Object.defineProperty(_a,"Hls",{get:function(){return _a.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),ll},configurable:!0}),_a.use||(_a.registerComponent("Hls",ll),_a.registerComponent("Vhs",ll)),_a.options.vhs=_a.options.vhs||{},_a.options.hls=_a.options.hls||{},_a.registerPlugin?_a.registerPlugin("reloadSourceOnError",sl):_a.plugin("reloadSourceOnError",sl);const yl=_a;function ml(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var vl=function e(t){var r=this;if(yl.browser.IS_IE8)for(var n in r=o().createElement("custom"),e.prototype)"constructor"!==n&&(r[n]=e.prototype[n]);return r.id=t.id,r.label=r.id,r.width=t.width,r.height=t.height,r.bitrate=t.bandwidth,r.enabled_=t.enabled,Object.defineProperty(r,"enabled",{get:function(){return r.enabled_()},set:function(e){r.enabled_(e)}}),r},gl=function(e){var t,r;function n(){var t,r=ml(ml(t=e.call(this)||this));if(yl.browser.IS_IE8)for(var i in r=o().createElement("custom"),n.prototype)"constructor"!==i&&(r[i]=n.prototype[i]);return r.levels_=[],r.selectedIndex_=-1,Object.defineProperty(r,"selectedIndex",{get:function(){return r.selectedIndex_}}),Object.defineProperty(r,"length",{get:function(){return r.levels_.length}}),r||ml(t)}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var i=n.prototype;return i.addQualityLevel=function(e){var t=this.getQualityLevelById(e.id);if(t)return t;var r=this.levels_.length;return t=new vl(e),""+r in this||Object.defineProperty(this,r,{get:function(){return this.levels_[r]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t},i.removeQualityLevel=function(e){for(var t=null,r=0,n=this.length;r<n;r++)if(this[r]===e){t=this.levels_.splice(r,1)[0],this.selectedIndex_===r?this.selectedIndex_=-1:this.selectedIndex_>r&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t},i.getQualityLevelById=function(e){for(var t=0,r=this.length;t<r;t++){var n=this[t];if(n.id===e)return n}return null},i.dispose=function(){this.selectedIndex_=-1,this.levels_.length=0},n}(yl.EventTarget);for(var bl in gl.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"},gl.prototype.allowedEvents_)gl.prototype["on"+bl]=null;var _l="2.0.9",wl=function(e){return t=this,yl.mergeOptions({},e),r=t.qualityLevels,n=new gl,t.on("dispose",(function e(){n.dispose(),t.qualityLevels=r,t.off("dispose",e)})),t.qualityLevels=function(){return n},t.qualityLevels.VERSION=_l,n;var t,r,n};(yl.registerPlugin||yl.plugin)("qualityLevels",wl),wl.VERSION=_l;function Tl(e){return Tl="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},Tl(e)}function Sl(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,El(n.key),n)}}function El(e){var t=function(e,t){if("object"!=Tl(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Tl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Tl(t)?t:t+""}function Ol(e,t,r){return t=Pl(t),function(e,t){if(t&&("object"===Tl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,kl()?Reflect.construct(t,r||[],Pl(e).constructor):t.apply(e,r))}function kl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(kl=function(){return!!e})()}function Cl(){return Cl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Pl(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Cl.apply(this,arguments)}function Pl(e){return Pl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Pl(e)}function xl(e,t){return xl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},xl(e,t)}var jl=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Ol(this,t,[e])).options=r,n.configureMenuDimensions=n.configureMenuDimensions.bind(n),n.initialize(),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xl(e,t)}(t,e),r=t,(n=[{key:"initialize",value:function(){this.player.ready(this.configureMenuDimensions),this.player.one("play",this.configureMenuDimensions),this.player.on("resize",this.configureMenuDimensions),this.player.on("fullscreenchange",this.configureMenuDimensions),this.player.on("resizemenus",this.configureMenuDimensions),this.player.on("ready",this.configureMenuDimensions)}},{key:"dispose",value:function(){this.player.off("resize",this.configureMenuDimensions),this.player.off("fullscreenchange",this.configureMenuDimensions),this.player.off("resizemenus",this.configureMenuDimensions),this.player.off("ready",this.configureMenuDimensions),Cl(Pl(t.prototype),"dispose",this).call(this)}},{key:"configureMenuDimensions",value:function(){var e=this,t=function(t){if(!e.options.mobile){var r=e.player.getChild("collapserator"),n=r.getChild("volumePanel"),i=r.children_.indexOf(n);r.removeChild(n),r.addChild("volumePanel",{inline:t},i),e.player.trigger("volumechange")}},r=this.player.isFullscreen();if(r&&!this.options.mobile){var n=this.player.whiteboardModePlugin().side;if(t("top"!==n),"left"===n||"right"===n||"top"===n){var i=this.player.currentWidth();return void this.player.el().querySelectorAll(".vjs-menu").forEach((function(e){e.style.paddingTop=null,e.style.marginBottom=null,e.style.width="calc(".concat(i,"px - 4em)")}))}}r||t(!0);var o=this.player.currentWidth(),a=this.player.currentHeight()/o*100,s=this.player.el().querySelector(".cv-collapsorator"),u=this.player.el().querySelectorAll(".vjs-menu"),l=s&&s.offsetHeight;l?("CreateClipSeekBar"===this.options.seekBarName&&(l+=22),u&&u.length&&u.forEach((function(t){!r&&e.options.overflowControls?t.style.paddingTop="80%":t.style.paddingTop="calc(".concat(a,"% - ").concat(l,"px)"),t.style.marginBottom="".concat(l,"px"),t.style.width=null,t.querySelector(".vjs-menu-content")&&(o<=450?e.player.addClass("cv-player-small"):e.player.removeClass("cv-player-small"))}))):this.player.one("play",this.configureMenuDimensions)}}])&&Sl(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getPlugin("plugin"));yl.registerPlugin("configureMenuDimensionsPlugin",jl);var Ll="cv-persisttest",Il=function(){try{return window.localStorage.setItem(Ll,"cv-player-storage-test"),window.localStorage.removeItem(Ll),!0}catch(e){return!1}},Al=function(e){return window.localStorage.getItem(e)},Rl=function(e,t){window.localStorage.setItem(e,t)};function Dl(e){return Dl="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},Dl(e)}function Ml(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Nl(n.key),n)}}function Nl(e){var t=function(e,t){if("object"!=Dl(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Dl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Dl(t)?t:t+""}function Bl(e,t,r){return t=Vl(t),function(e,t){if(t&&("object"===Dl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ul()?Reflect.construct(t,r||[],Vl(e).constructor):t.apply(e,r))}function Ul(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ul=function(){return!!e})()}function Fl(){return Fl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Vl(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Fl.apply(this,arguments)}function Vl(e){return Vl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Vl(e)}function Hl(e,t){return Hl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Hl(e,t)}var ql,zl,Wl,Gl,Xl,Kl,Yl,Ql,$l,Jl,Zl,ec,tc,rc,nc,ic,oc,ac,sc,uc,lc,cc,fc,hc,pc,dc,yc,mc,vc,gc,bc,_c,wc,Tc,Sc,Ec,Oc,kc,Cc,Pc=yl.getPlugin("plugin"),xc="cvplayer-volume",jc="cvplayer-mute",Lc=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=Bl(this,t,[e])).enabled=!0,r.player.ready((function(){return r.initialize()})),r}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hl(e,t)}(t,e),r=t,(n=[{key:"initialize",value:function(){this.player.options_.mobile?this.removeVolumeControl():Il()&&(this.saveVolumeState=this.saveVolumeState.bind(this),this.player.on("volumechange",this.saveVolumeState),this.applyUserPreferences())}},{key:"applyUserPreferences",value:function(){var e=Al(xc),t=Al(jc);e&&this.player.volume(+e),t&&this.player.muted("true"===t)}},{key:"saveVolumeState",value:function(){this.enabled&&(Rl(xc,this.player.volume().toString()),Rl(jc,this.player.muted().toString()))}},{key:"removeVolumeControl",value:function(){this.player.volume(1);var e=this.player.getChild("collapserator"),t=e.getChild("volumePanel");e.removeChild(t)}},{key:"enable",value:function(){this.enabled=!0}},{key:"disable",value:function(){this.enabled=!1}},{key:"dispose",value:function(){this.player.off("volumechange",this.saveVolumeState),Fl(Vl(t.prototype),"dispose",this).call(this)}}])&&Ml(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Pc);function Ic(e){return Ic="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},Ic(e)}function Ac(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Rc(n.key),n)}}function Rc(e){var t=function(e,t){if("object"!=Ic(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Ic(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ic(t)?t:t+""}function Dc(e,t,r){return t=Nc(t),function(e,t){if(t&&("object"===Ic(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Mc()?Reflect.construct(t,r||[],Nc(e).constructor):t.apply(e,r))}function Mc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Mc=function(){return!!e})()}function Nc(e){return Nc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Nc(e)}function Bc(e,t){return Bc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Bc(e,t)}yl.registerPlugin("persistVolumePlugin",Lc),function(e){e.Stream="cv_product_stream",e.WebPlayerStream="cv_product_webplayer_stream",e.StreamProgress="cv_product_stream_progress",e.Login="cv_product_login",e.LoginSsoRedirect="cv_product_login_sso_redirect",e.LoginFailed="cv_product_login_failed",e.Search="cv_product_search",e.InstantSearch="cv_product_instant_search",e.SearchEmptyResult="cv_product_search_empty_result",e.Filter="cv_product_search_filter",e.SearchLanding="cv_product_search_landing",e.Share="cv_product_share",e.Unshare="cv_product_unshare",e.WorkspaceAdd="cv_product_tv_add",e.Rename="cv_product_rename",e.Move="cv_product_move",e.Sort="cv_product_sort",e.Create="cv_product_create",e.Delete="cv_product_delete",e.Associate="cv_product_associate",e.Dissociate="cv_product_dissociate",e.Edit="cv_product_edit",e.Approve="cv_product_approve",e.Reject="cv_product_reject",e.Disable="cv_product_disable",e.Upload="cv_product_upload",e.Download="cv_product_download",e.Navigate="cv_product_navigate",e.Click="cv_product_click",e.Suggest="cv_product_suggest",e.EditAssoc="cv_product_edit_assoc",e.Play="cv_product_play",e.Favourite="cv_product_favourite",e.Follow="cv_product_follow",e.Prefer="cv_product_prefer",e.Print="cv_product_print",e.Copy="cv_product_copy",e.Activate="cv_product_activate",e.VerifyEmail="cv_product_verify_email",e.ChangePassword="cv_product_change_password",e.ManageGroup="cv_product_manage_group",e.Export="cv_product_export",e.SendEmail="cv_product_send_email",e.Publish="cv_product_publish",e.Submit="cv_product_submit",e.Complete="cv_product_complete",e.Archive="cv_product_archive",e.Promote="cv_product_promote",e.Demote="cv_product_demote",e.BulkAction="cv_product_bulk_action",e.Remove="cv_product_remove",e.Dismiss="cv_product_dismiss",e.Open="cv_product_open",e.Hide="cv_product_hide",e.PageView="cv_product_page_view",e.Select="cv_product_select",e.SwitchCustomer="cv_product_switch_customer",e.Focus="cv_product_focus",e.Blur="cv_product_blur",e.Hover="cv_product_hover",e.Unhover="cv_product_unhover",e.SetAccess="cv_product_set_access",e.AddToLocalCache="cv_product_add_to_lc",e.ResolveWarning="cv_product_resolve_warning",e.DismissWarning="cv_product_dismiss_warning"}(ql||(ql={})),function(e){e.Folder="folder",e.Video="video",e.Rating="rating",e.Series="series",e.Library="library",e.Resource="resource",e.Tag="tag",e.Subtitle="subtitle",e.Chapter="chapter",e.Resolution="resolution",e.PlaybackSpeed="playback_speed",e.Device="device",e.Restriction="restriction",e.Interactive="interactive",e.Interaction="interaction",e.PDF="pdf",e.CustomerSetting="customer_setting",e.UserSetting="user_setting",e.LibraryRequest="staff_request",e.Logo="logo",e.Pagination="pagination",e.Thumbnail="thumbnail",e.Banner="banner",e.Link="link",e.Playlist="playlist",e.Playlists="playlists",e.Person="person",e.Company="company",e.Classroom="classroom",e.ClassroomGroup="classroom_group",e.Classification="classification",e.ShareLink="share_link",e.DirectShare="direct_share",e.Upload="upload",e.SearchResults="search_results",e.SearchSuggestion="search_suggestion",e.Audience="audience",e.User="user",e.Clip="clip",e.UserChannel="user_channel",e.Widget="widget",e.Url="url",e.SocialShare="social_share",e.Presentation="presentation",e.BatchJob="batch_job",e.DeepLink="deep_link",e.Feedback="feedback",e.AppLink="app_link",e.SignUp="sign_up",e.FileGeneratorJob="file_generator_job",e.Product="product",e.Customer="customer",e.SpecialEvent="special_event",e.Region="region",e.ProductTip="product_tip",e.Livestream="livestream",e.DevicesCta="devices_cta",e.Integration="integration",e.Faq="faq"}(zl||(zl={})),function(e){e.TopNav="top_nav",e.LeftNav="left_nav",e.Footer="footer",e.Popup="popup",e.Banner="banner",e.VideoList="video_list",e.VideoListItem="video_list_item",e.VideoListHeader="video_header",e.VideoThumbnail="video_thumbnail",e.ExpandableVideoThumbnail="expandable_video_thumbnail",e.VideoItemPreview="video_item_preview",e.InteractiveItemPreview="interactive_item_preview",e.ClipItemPreview="clip_item_preview",e.VideoDetails="video_details",e.InteractiveDetails="interactive_details",e.ClipDetails="clip_details",e.VideoDetailsHeader="video_details_header",e.EditVideoDetails="edit_video_details",e.EditInteractiveVideoDetails="edit_interactive_video_details",e.EditClipDetails="edit_clip_details",e.EditVideoChapters="edit_video_chapters",e.EditVideoResources="edit_video_resources",e.VideoUpload="video_upload",e.VideoRequest="video_request",e.Pagination="pagination",e.LibraryHeader="library_header",e.LibraryTiles="library_tiles",e.LibraryRequestDetails="staff_request_details",e.Libraries="libraries",e.SubFolderList="sub_folder_list",e.AwaitingReviewVideoListHeader="awaiting_review_video_list_header",e.AwaitingReviewVideoItem="awaiting_review_video_item",e.PastReleasesHeader="past_releases_header",e.MigrationWarnings="migration_warnings",e.PlaylistListHeader="playlist_list_header",e.PlaylistListItem="playlist_list_item",e.SeriesListItem="series_list_item",e.SeriesWithVideos="series_with_videos",e.PlaylistWithVideos="playlist_with_videos",e.Dropdown="dropdown",e.SearchBar="search_bar",e.InstantSearch="instant_search",e.SearchFilters="search_filters",e.FeaturedSeriesSearchResult="featured_series_search_result",e.ExchangeSearchGroupItem="exchange_search_group_item",e.StaffManager="staff_manager",e.StaffManagerListItem="staff_manager_list_item",e.StudentManager="student_manager",e.ViewStudentVideos="view_student_videos",e.StudentManagerListItem="student_manager_list_item",e.EditUser="edit_user",e.UserAuditLog="user_audit_log",e.BulkUserActionsWizard="bulk_user_actions_wizard",e.BulkUserUploadWizard="bulk_user_upload_wizard",e.Classroom="classroom",e.ClassroomsList="classrooms_list",e.ClassroomsListItem="classrooms_list_item",e.ManageClassroomStudents="manage_classroom_students",e.ManageClassroomStudentListItem="manage_classroom_student_list_item",e.ManageClassroomGroups="manage_classroom_groups",e.ManageClassroomGroupListItem="manage_classroom_group_list_item",e.ManageClassroomTeachers="manage_classroom_teachers",e.ManageClassroomTeacherListItem="manage_classroom_teachers_list_item",e.ArchivedClassrooms="archived_classrooms",e.PreviewInteractive="preview_interactive",e.PreviewSharedInteractive="preview_shared_interactive",e.PreviewInteractiveQuestions="preview_interactive_questions",e.EditInteractive="edit_interactive",e.EditInteractiveDetails="edit_interactive_details",e.PlaySharedInteractive="play_shared_interactive",e.PlayInteractive="play_interactive",e.InteractiveListItem="interactive_list_item",e.DeleteInteractive="delete_interactive",e.NewInteractive="new_interactive",e.CopyInteractive="copy_interactive",e.UnpublishInteractive="unpublish_interactive",e.ShareInteractive="share_interactive",e.PlayPage="play_page",e.Player="player",e.FloatingPlayer="floating_player",e.InteractivePlayer="interactive_player",e.EmbeddedPlayer="embedded_player",e.CreateClipPlayer="create_clip_player",e.PlayClip="play_clip",e.PlaySharedClip="play_shared_clip",e.ClipListItem="clip_list_item",e.ContentUpdatesBanner="content_updates_banner",e.ContentUpdatesClassificationBanner="content_updates_classification_banner",e.PreferencesSettings="preferences_settings",e.TopicsOnboarding="topics_onboarding",e.MyUploads="my_uploads",e.MyVideos="my_videos",e.SlidingList="sliding_list",e.HeroBannerItem="hero_banner_item",e.SlidingListItem="sliding_list_item",e.ClassificationListItem="classification_list_item",e.ClassificationComingSoon="classification_coming_soon",e.ClassificationHero="classification_hero",e.ClassificationFooter="classification_footer",e.Classification="classification",e.Dashboard="dashboard",e.DiscoverFooter="discover_footer",e.ProductBanner="product_banner",e.UserOptions="user_options",e.MagicTabs="magic_tabs",e.Settings="settings",e.StudentFeed="student_feed",e.SharedByMe="shared_by_me",e.SharedWithMe="shared_with_me",e.ClassroomGuide="classroom_guide",e.TeachingResources="teaching_resources",e.TopVideos="top_videos",e.VideoViewsList="video_views_list",e.VideoOverview="video_overview",e.LiteUpgradeFeedbackPopup="lite_upgrade_feedback_popup",e.LiteUpgradeBanner="lite_upgrade_banner",e.LiteUpgradeOnboarding="lite_upgrade_onboarding",e.LibraryRequestSettings="library_request_settings",e.OpenInAppPrompt="open_in_app_prompt",e.UseAppButton="use_app_button",e.Launchpad="launchpad",e.EditableSubjectPreferencesWidget="editable_subject_preferences_widget",e.ThumbnailHeroMediaWidget="thumbnail_hero_media_widget",e.ThumbnailFixedListMediaLargeWidget="thumbnail_fixed_list_media_large",e.FilterSlidingPillListSmallWidget="filter_sliding_pill_list_small",e.CircleLogoSlidingListWidget="circle_logo_sliding_list_widget",e.HeroBannerSmallWidget="hero_banner_small",e.EventIconSlidingListWidget="event_icon_sliding_list_widget",e.OnboardingStepsWidget="onboarding_steps_widget",e.FaqQuestionWidget="faq_question_widget",e.FaqQuestionAccordionWidget="faq_question_accordion_widget",e.ExchangeLinksWidget="exchange_links_widget",e.TableOfContents="table_of_contents",e.SignUpPopup="sign_up_popup",e.SignUpPage="sign_up_page",e.TrialBanner="trial_banner",e.InviteColleaguePopup="invite_colleague_popup",e.AuthProspectSelect="auth_prospect_select",e.WelcomePopup="welcome_popup",e.WatchHistoryLanding="watch_history_landing",e.MyFavouritesLanding="my_favourites_landing",e.MyVideoLanding="my_videos_landing",e.PlaylistsLanding="playlists_landing",e.NotificationsDropdown="notifications_dropdown",e.CalendarNav="calendar_nav",e.CalendarDay="calendar_day",e.CalendarPopup="calendar_popup",e.RegionMap="region_map",e.OnboardingWelcomeVideoScreen="onboarding_welcome_video_screen",e.OnboardingSelectRoleScreen="onboarding_select_role_screen",e.OnboardingUsageIntentionScreen="onboarding_usage_intention_screen",e.OnboardingSchoolLevelScreen="onboarding_school_level_screen",e.OnboardingSelectCurriculumScreen="onboarding_select_curriculum_screen",e.OnboardingSubjectsScreen="onboarding_subjects_screen",e.OnboardingSelectVideosScreen="onboarding_select_videos_screen",e.OnboardingCreatePlaylistScreen="onboarding_create_playlist_screen",e.OnboardingSubjectsSummaryScreen="onboarding_subjects_summary_screen",e.ProductTips="product_tips",e.LivestreamBookingForm="booking_form",e.Global="global"}(Wl||(Wl={})),function(e){e.Start="start",e.Complete="complete",e.Save="save",e.Discard="discard",e.Next="next",e.Back="back"}(Gl||(Gl={})),function(e){e.PageLoad="page_load"}(Xl||(Xl={})),function(e){e.Single="single",e.Bulk="bulk",e.All="all"}(Kl||(Kl={})),function(e){e.Publish="publish",e.Unpublish="unpublish"}(Yl||(Yl={})),function(e){e.ActivateUser="activate_user",e.VerifyEmail="verify_email",e.ResetPasswordEmail="reset_password"}(Ql||(Ql={})),function(e){e.ProductionYear="production_year",e.Alphabetical="alphabetical"}($l||($l={})),function(e){e.Content="content",e.Quality="quality",e.Duration="duration",e.Reset="reset"}(Jl||(Jl={})),function(e){e.Submit="submit",e.ShowAll="show_all",e.Recent="recent",e.SearchIcon="search_icon"}(Zl||(Zl={})),function(e){e.Start="start",e.Finish="finish",e.Terminate="terminate",e.Play="play",e.Pause="pause",e.Playback="playback",e.NextChapter="next_chapter",e.PreviousChapter="previous_chapter",e.FullScreenEnter="full_screen_enter",e.FullScreenExit="full_screen_exit",e.ChangeResolution="change_resolution",e.ChangeSpeed="change_speed",e.ChangeDevice="change_device"}(ec||(ec={})),function(e){e.Embedded="embedded"}(tc||(tc={})),function(e){e.TogglePreview="toggle_preview",e.NavigateHome="navigate_home",e.OpenInStaffView="open_in_staff_view",e.Title="title",e.ToggleHideValidListings="toggle_hide_valid_listings",e.LaunchImmersiveReader="launch_immersive_reader",e.CopyEmbedHtml="copy_embed_html",e.Close="close",e.Open="open",e.Button="button",e.Link="link",e.Tile="tile",e.Thumbnail="thumbnail",e.Cover="cover",e.TallPoster="tall_poster",e.Banner="banner",e.Slide="slide",e.ExternalLink="external_link",e.ViewStudentWorkspace="view_student_workspace",e.Card="card",e.SelectAllUsers="select_all_users",e.ClickViewLogo="clickview_logo",e.Clear="clear",e.SeeMore="see_more",e.Settings="settings",e.Expand="expand",e.Collapse="collapse"}(rc||(rc={})),function(e){e.FeatureUserChannelVideo="feature_user_channel_video",e.RemoveFromUserChannelPlaylist="remove_from_user_channel_playlist",e.ShareClip="share_clip",e.ViewOriginalVideo="view_original_video",e.ShareInteractive="share_interactive",e.DeleteInteractiveVideo="delete_interactive_video",e.CopyInteractiveVideo="copy_interactive_video",e.EditInteractiveVideo="edit_interactive_video",e.PrintAsWorksheet="print_as_worksheet",e.PreviewInteractiveVideo="preview_interactive_video",e.ViewResults="view_results",e.ViewUsage="view_usage",e.MoveToAnotherFolder="move_to_another_folder",e.CreateInteractiveVideo="create_interactive_video",e.ShareVideo="share_video",e.EditVideo="edit_video",e.DownloadVideo="download_video",e.AddToExchange="add_to_exchange",e.AddToUserChannel="add_to_user_channel",e.CreateClip="create_clip",e.FlagVideo="flag_video",e.AddToLibrary="add_to_library",e.AddToWorkspace="add_to_workspace",e.AddToPlaylist="add_to_playlist",e.RemoveFromPlaylist="remove_from_playlist",e.AddCurriculumLink="add_curriculum_link",e.ViewCurriculumLinks="view_curriculum_links",e.OpenInCurator="open_in_curator",e.ManageVideoAccess="manage_video_access",e.Approve="approve",e.AddToLocalCache="add_to_local_cache",e.OpenInLibraryEditor="open_in_library_editor",e.OpenInClickView="open_in_clickview",e.PlayClip="play_clip",e.EditClip="edit_clip",e.DeleteClip="delete_clip",e.EditVideoDetails="edit_video_details",e.DeleteVideo="delete_video",e.ManageAccess="manage_access",e.SuggestEdit="suggest_edit"}(nc||(nc={})),function(e){e.Remove="remove"}(ic||(ic={})),function(e){e.LibraryReview="library_review"}(oc||(oc={})),function(e){e.FileSelect="file_select",e.DragDrop="drag_drop"}(ac||(ac={})),function(e){e.Edit="edit"}(sc||(sc={})),function(e){e.Image="image",e.User="user",e.Playlist="playlist",e.Link="link",e.Avatar="avatar",e.Clip="clip",e.Interactive="interactive",e.Classroom="classroom",e.Customer="customer"}(uc||(uc={})),function(e){e.On="on",e.Off="off"}(lc||(lc={})),function(e){e.ContinueSession="continue_session",e.NewSession="new_session"}(cc||(cc={})),function(e){e.DirectShare="direct_share",e.CopyLink="copy_link",e.CopyEmbedHtml="copy_embed_html",e.PluginEmbed="plugin_embed"}(fc||(fc={})),function(e){e.GoToOnline="go_to_online",e.Feedback="feedback",e.BookACall="book_a_call",e.RequestUpgrade="request_upgrade"}(hc||(hc={})),function(e){e.SignIn="sign_in",e.SignUp="sign_up",e.SignOut="sign_out",e.TopNavButton="top_nav_button",e.Educator="educator",e.Student="student",e.TermsAndConditions="terms_and_conditions",e.PrivacyPolicy="privacy_policy",e.EnterEmail="enter_email",e.ClosePopup="close_popup",e.Back="back",e.UseMyLocation="use_my_location",e.TrialCreated="trial_created",e.TrialRequested="trial_requested",e.DeadEnd="dead_end",e.CantFindSchool="cant_find_school",e.ResendEmail="resend_email",e.ContactUs="contact_us",e.InviteColleague="invite_colleague",e.Upgrade="upgrade",e.FindSchool="find_school",e.AddToBraze="add_to_braze",e.RequestAccess="request_access",e.AutoJoin="auto_join",e.WrongEmail="wrong_email"}(pc||(pc={})),function(e){e.RequestProgram="tv_request_program",e.AdFreeRequest="tv_ad_free_request",e.AddAdFreeVideo="tv_add_ad_free_video",e.AddFullVideo="tv_add_full_video",e.RegionSelect="tv_region_select"}(dc||(dc={})),function(e){e.AddToExchange="add_to_exchange"}(yc||(yc={})),function(e){e.ComeBackLater="come_back_later",e.Back="back",e.Next="next",e.Complete="complete",e.ReplayVideo="replay_video",e.SkipVideo="skip_video",e.PlayVideo="play_video",e.PauseVideo="pause_video",e.FinishVideo="finish_video",e.SelectPresentation="select_presentation",e.SelectCurriculum="select_curriculum",e.SelectSubject="select_subject",e.SelectAllSubjects="select_all_subjects",e.SelectVideo="select_video",e.SelectAllVideos="select_all_videos",e.DeselectAllVideos="deselect_all_videos",e.SelectOption="select_option",e.SelectJobTitle="select_job_title",e.PhoneNumber="phone_number",e.OtherInformation="other_information",e.PlaylistName="playlist_name",e.DismissWidget="dismiss_widget",e.ContactSales="contact_sales",e.FinishPersonalising="finish_personalising",e.UpdateSchoolLevel="update_school_level",e.UpdateCurriculum="update_curriculum",e.UpdateSubjects="update_subjects"}(mc||(mc={})),function(e){e.OnboardingFirstPlaylistProductTip="onboarding_first_playlist_product_tip",e.OnboardingSchoolLevelsProductTip="onboarding_school_levels_product_tip"}(vc||(vc={})),function(e){e.MyVideos="search_source_my_videos",e.School="search_source_school",e.ExchangeArchive="search_source_exchange_archive",e.ClickView="search_source_clickview"}(gc||(gc={})),function(e){e.InstallIntegration="devices_cta_install_integration",e.LearnMore="devices_cta_learn_more",e.ContactSupport="devices_cta_contact_support",e.Dismiss="devices_cta_dismiss"}(bc||(bc={})),function(e){e.Troubleshoot="troubleshoot_integration"}(_c||(_c={})),function(e){e.Popup="popup",e.FullPage="full_page"}(wc||(wc={})),function(e){e.Calendar="calendar",e.List="list"}(Tc||(Tc={})),function(e){e.EntityRemoved="cv_entity_removed",e.ValueUpdated="cv_value_updated"}(Sc||(Sc={})),function(e){e.FileSelect="file_select",e.DragDrop="drag_drop"}(Ec||(Ec={})),function(e){e.Video="videos",e.Clip="clips",e.Interactive="interactives",e.Folder="categories",e.Series="series",e.Tags="tags",e.Subjects="subjects"}(Oc||(Oc={})),function(e){e[e.V1=1]="V1",e[e.V2=2]="V2",e[e.V3=3]="V3",e[e.V4=4]="V4"}(kc||(kc={})),function(e){e.Staff="staff",e.Learner="learner",e.Unknown="unknown"}(Cc||(Cc={}));var Uc=yl.getPlugin("plugin"),Fc="cvplayer-playback-rate",Vc=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Dc(this,t,[e])).options=r,n.player.ready((function(){return n.initialize()})),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bc(e,t)}(t,e),r=t,(n=[{key:"initialize",value:function(){var e,t=this;if(Il()){this.savePlaybackRate=this.savePlaybackRate.bind(this),this.player.on("ratechange",this.savePlaybackRate),this.one("dispose",(function(){t.player.off("ratechange",t.savePlaybackRate)}));var r=+Al(Fc);(null===(e=this.player.options_.playbackRates)||void 0===e?void 0:e.some((function(e){return e===r})))&&this.player.playbackRate(r)}}},{key:"savePlaybackRate",value:function(){var e,t=this.player.playbackRate().toString();Rl(Fc,t),null===(e=this.options.analyticsService)||void 0===e||e.logUserAction({rate:t},{actionType:ql.Select,workflowPhase:Gl.Complete,descriptor:ec.ChangeSpeed,entity:zl.PlaybackSpeed,eventVersion:kc.V3})}}])&&Ac(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Uc);function Hc(e){return Hc="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},Hc(e)}function qc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,zc(n.key),n)}}function zc(e){var t=function(e,t){if("object"!=Hc(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Hc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Hc(t)?t:t+""}function Wc(e,t,r){return t=Kc(t),Gc(e,Xc()?Reflect.construct(t,r||[],Kc(e).constructor):t.apply(e,r))}function Gc(e,t){if(t&&("object"===Hc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Xc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Xc=function(){return!!e})()}function Kc(e){return Kc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Kc(e)}function Yc(e,t){return Yc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Yc(e,t)}yl.registerPlugin("persistPlaybackRatePlugin",Vc);var Qc=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=Wc(this,t,[e])).fullscreenBecauseOfRotate=!1,r.player.supportsFullScreen()?(r.onRotate=r.onRotate.bind(r),r.onFullscreenChange=r.onFullscreenChange.bind(r),r.player.ready((function(){return r.initialize()})),r):Gc(r)}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yc(e,t)}(t,e),r=t,(n=[{key:"initialize",value:function(){this.player.on("fullscreenchange",this.onFullscreenChange),window.addEventListener("orientationchange",this.onRotate)}},{key:"dispose",value:function(){this.player.off("fullscreenchange",this.onFullscreenChange),window.removeEventListener("orientationchange",this.onRotate)}},{key:"onFullscreenChange",value:function(){this.player.isFullscreen()||(this.fullscreenBecauseOfRotate=!1)}},{key:"onRotate",value:function(){var e=this.getAngle();90===e||-90===e||270===e?(this.player.requestFullscreen(),this.fullscreenBecauseOfRotate=!0):this.fullscreenBecauseOfRotate&&this.player.isFullscreen()&&this.player.exitFullscreen()}},{key:"getAngle",value:function(){var e,t;return"number"==typeof(null===(t=null===(e=window.screen)||void 0===e?void 0:e.orientation)||void 0===t?void 0:t.angle)?window.screen.orientation.angle:0}}])&&qc(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getPlugin("plugin"));yl.registerPlugin("fullscreenOnRotatePlugin",Qc);var $c="\n <svg viewBox='0 0 434 71'>\n <g>\n <path fill='#FFFFFF' d='M114.44 56.57l3.5 3.5a32.87 32.87 0 0 1-25.16 11.26c-19.63 0-33.62-15.54-33.62-35.16C59.16 16.55 73.16 1 92.78 1a32.31 32.31 0 0 1 24.19 10.4l-3.6 3.3a27.32 27.32 0 0 0-20.59-8.74c-16.91 0-28.39 13.5-28.39 30.21s11.48 30.21 28.39 30.21a28.08 28.08 0 0 0 21.66-9.81zM126.64 1h4.55v70.22h-4.73L126.64 1zm17.3 10.6a3.7 3.7 0 1 1 0 7.4 3.7 3.7 0 0 1 0-7.4zm-2.41 15.07h4.81v44.56h-4.81V26.67zm48 33.15l3.33 3.15a21.8 21.8 0 0 1-17.31 8.61c-12.59 0-21.76-10-21.76-22.22 0-12.22 9.17-22.22 21.76-22.22a21.84 21.84 0 0 1 16.85 8l-3.43 3.06a17.15 17.15 0 0 0-13.42-6.3c-10.09 0-16.76 8.15-16.76 17.5s6.67 17.5 16.76 17.5a17.38 17.38 0 0 0 13.98-7.08zm14.99-9.33v20.74h-4.73V1.01h4.73v47.75l20.74-19.02h6.64l-21.56 19.84L234 71.23h-7.01l-22.47-20.74z'/>\n <path fill='#F8981D' d='M304.09 19.4a5.56 5.56 0 1 1 0-11.12 5.56 5.56 0 0 1 0 11.12zm-5.56 7.27h11.11v44.56h-11.11V26.67zm61.42 22.15c0 .81 0 2.42-.09 4h-31.75c.8 3.77 5.2 8.61 11.93 8.61a17.11 17.11 0 0 0 11.66-4.31l5.38 8.16a27.23 27.23 0 0 1-17 6.1c-12.92 0-22.88-9.87-22.88-22.34s9.06-22.33 21.35-22.33c11.62-.04 21.4 9.02 21.4 22.11zm-10.77-3.76c-.18-3.68-3.58-8.62-10.67-8.62-6.91 0-10.05 4.85-10.4 8.62h21.07zM385.92 71h-6.42l-19.64-44.37h13.97l9.16 23.98 9.72-23.98h8.31l9.63 23.98 9.16-23.98h13.97L414.24 71h-6.52l-10.85-23.7L385.92 71zm-120.22.35h-6L226.11 1.01h17.01l19.42 44.18 18.08-44.18h16.91L265.7 71.35zM0 1l41 35L0 71V1z'/>\n </g>\n </svg>\n",Jc=function(e,t,r){var n,i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window,a=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var l=!1,c=function(){n=null,c=null,e.apply(this,s)};return!n&&r&&(e.apply(i,s),l=!0),o.clearTimeout(n),n=o.setTimeout(c,t),l};return a.cancel=function(){o.clearTimeout(n),n=null},a};function Zc(e){return Zc="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},Zc(e)}function ef(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,tf(n.key),n)}}function tf(e){var t=function(e,t){if("object"!=Zc(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Zc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Zc(t)?t:t+""}function rf(e,t,r){return t=of(t),function(e,t){if(t&&("object"===Zc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,nf()?Reflect.construct(t,r||[],of(e).constructor):t.apply(e,r))}function nf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(nf=function(){return!!e})()}function of(e){return of=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},of(e)}function af(e,t){return af=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},af(e,t)}var sf=function(e){function t(e,r){var n,i,o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=rf(this,t,[e,r])).update=(i=n.update.bind(n),1e3,o=window.performance.now(),function(){var e=window.performance.now();e-o>=1e3&&(i.apply(void 0,arguments),o=e)}),e.on("timeupdate",n.update),e.one("dispose",(function(){e.off("timeupdate",n.update),n.el_.removeEventListener("click",n.pause)})),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&af(e,t)}(t,e),r=t,(n=[{key:"update",value:function(){var e=this.player_.currentTime();this.el_.href=this.options_.getExternalLink({currentTime:Math.round(e)})}},{key:"buildCSSClass",value:function(){return"cv-open-externally-button"}},{key:"createEl",value:function(){var e={innerHTML:$c,className:this.buildCSSClass()},t={type:"button",href:this.options_.getExternalLink({currentTime:0}),target:"_blank"},r=yl.dom.createEl("a",e,t);return this.createControlTextEl(r),r.addEventListener("click",this.pause.bind(this)),r}},{key:"pause",value:function(){this.player_.pause()}}])&&ef(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("Button"));function uf(e){return uf="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},uf(e)}function lf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,cf(n.key),n)}}function cf(e){var t=function(e,t){if("object"!=uf(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=uf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==uf(t)?t:t+""}function ff(e,t,r){return t=pf(t),function(e,t){if(t&&("object"===uf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,hf()?Reflect.construct(t,r||[],pf(e).constructor):t.apply(e,r))}function hf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hf=function(){return!!e})()}function pf(e){return pf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pf(e)}function df(e,t){return df=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},df(e,t)}sf.prototype.controlText_="Open in ClickView",yl.registerComponent("OpenExternallyButton",sf);var yf=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=ff(this,t,[e,r])).options=r,e.ready((function(){return n.onReady()})),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&df(e,t)}(t,e),r=t,(n=[{key:"onReady",value:function(){var e=this.player.getChild("collapserator"),t=e.getChild("customControlSpacer"),r=e.children_.indexOf(t);e.addChild("OpenExternallyButton",{getExternalLink:this.options.getExternalLink},r+1)}}])&&lf(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getPlugin("plugin"));function mf(e){return mf="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},mf(e)}function vf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,gf(n.key),n)}}function gf(e){var t=function(e,t){if("object"!=mf(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=mf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==mf(t)?t:t+""}function bf(e,t,r){return t=Tf(t),function(e,t){if(t&&("object"===mf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,_f()?Reflect.construct(t,r||[],Tf(e).constructor):t.apply(e,r))}function _f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_f=function(){return!!e})()}function wf(){return wf="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Tf(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},wf.apply(this,arguments)}function Tf(e){return Tf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Tf(e)}function Sf(e,t){return Sf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Sf(e,t)}yl.registerPlugin("openExternallyPlugin",yf);var Ef=function(e){function t(e,r){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),bf(this,t,[e,r])}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sf(e,t)}(t,e),r=t,(n=[{key:"buildCSSClass",value:function(){return"cv-touch-control-ui ".concat(wf(Tf(t.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(e,r,n){return wf(Tf(t.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},r),{className:this.buildCSSClass()}),n)}},{key:"setUi",value:function(e,t){var r=this,n=e>0,i=n?"cv-touch-right":"cv-touch-left";this.el_.className=this.buildCSSClass()+" cv-ui-touch-active",this.el_.innerHTML="\n <div class='".concat(i,"'>\n <div class='cv-touch-text'>\n ").concat(n?"+":"").concat(10*e,"s\n </div>\n </div>\n "),window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout((function(){r.removeText()}),t)}},{key:"removeText",value:function(){this.el_.className=this.buildCSSClass(),this.el_.innerHTML=""}}])&&vf(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("component"));function Of(e){return Of="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},Of(e)}function kf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Cf(n.key),n)}}function Cf(e){var t=function(e,t){if("object"!=Of(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Of(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Of(t)?t:t+""}function Pf(e,t,r){return t=Lf(t),function(e,t){if(t&&("object"===Of(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,xf()?Reflect.construct(t,r||[],Lf(e).constructor):t.apply(e,r))}function xf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xf=function(){return!!e})()}function jf(){return jf="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Lf(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},jf.apply(this,arguments)}function Lf(e){return Lf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Lf(e)}function If(e,t){return If=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},If(e,t)}yl.registerComponent("TouchControls",Ef);var Af=yl.getPlugin("plugin"),Rf=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=Pf(this,t,[e])).doubleTouchCount=0,r.seekStartTime=0,r.directionModifier=0,r.bindFunctions(),r.player.ready((function(){return r.initialize()})),r}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&If(e,t)}(t,e),r=t,(n=[{key:"bindFunctions",value:function(){this.onTouchStart=this.onTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.reBindEventListeners=this.reBindEventListeners.bind(this),this.unBindEventListeners=this.unBindEventListeners.bind(this)}},{key:"initialize",value:function(){var e=this;this.player.addChild("TouchControls"),this.touchControls=this.player.getChild("TouchControls"),this.player.on("ready",this.reBindEventListeners),this.one("dispose",(function(){e.player.off("ready",e.reBindEventListeners)})),this.reBindEventListeners()}},{key:"reBindEventListeners",value:function(){this.unBindEventListeners(),this.tech=this.player.tech(!0),"Html5"===this.tech.name()&&(this.tech.on("touchstart",this.onTouchStart),this.tech.on("touchend",this.onTouchEnd))}},{key:"unBindEventListeners",value:function(){this.tech&&"Html5"===this.tech.name()&&(this.tech.off("touchstart",this.onTouchStart),this.tech.off("touchend",this.onTouchEnd))}},{key:"dispose",value:function(){jf(Lf(t.prototype),"dispose",this).call(this),this.unBindEventListeners()}},{key:"onTouchStart",value:function(e){this.touchStartTime=e.timeStamp,this.userActive=this.player.userActive()}},{key:"onTouchEnd",value:function(e){var t=this;if(e.changedTouches.length){if(e.timeStamp-this.lastTouchTime<300)return this.onDoubleTouch(e),void(this.lastTouchTime=e.timeStamp);this.resetProperties(),this.lastTouchTime=e.timeStamp,e.timeStamp-this.touchStartTime<300&&window.setTimeout((function(){t.doubleTouchCount||(t.player.paused()?t.player.play():t.userActive&&t.player.pause())}),300)}}},{key:"resetProperties",value:function(){this.doubleTouchCount=0,this.seekStartTime=0,this.directionModifier=0}},{key:"onDoubleTouch",value:function(e){var t=this.player.el().getBoundingClientRect(),r=t.left+t.width/2;if(0===this.doubleTouchCount&&(this.seekStartTime=this.player.currentTime(),e.changedTouches[0].pageX<r?this.directionModifier=-1:this.directionModifier=1),this.doubleTouchCount++,this.directionModifier<0){if(10*this.doubleTouchCount>this.seekStartTime+10)return;return this.touchControls.setUi(-this.doubleTouchCount,900),void this.player.currentTime(this.player.currentTime()-10)}var n=this.player.duration()-this.seekStartTime;10*this.doubleTouchCount>n+10||(this.touchControls.setUi(this.doubleTouchCount,900),this.player.currentTime(this.player.currentTime()+10))}}])&&kf(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Af);function Df(e){return Df="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},Df(e)}function Mf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Nf(n.key),n)}}function Nf(e){var t=function(e,t){if("object"!=Df(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Df(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Df(t)?t:t+""}yl.registerPlugin("touchControls",Rf);var Bf=function(){return e=function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=r.id,this.plugin=t,this.source=r,this.enabled=this.enabled.bind(this)},(t=[{key:"enabled",value:function(e){return void 0===e?this.plugin.currentSource===this.source:(e&&this.plugin.setSource(this.source.id),e)}}])&&Mf(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Uf(e){return Uf="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},Uf(e)}function Ff(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Vf(n.key),n)}}function Vf(e){var t=function(e,t){if("object"!=Uf(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Uf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Uf(t)?t:t+""}function Hf(e,t,r){return t=zf(t),function(e,t){if(t&&("object"===Uf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,qf()?Reflect.construct(t,r||[],zf(e).constructor):t.apply(e,r))}function qf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qf=function(){return!!e})()}function zf(e){return zf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zf(e)}function Wf(e,t){return Wf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Wf(e,t)}var Gf=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Hf(this,t,[e])).options_=r,n.player.ready((function(){return n.initialize()})),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wf(e,t)}(t,e),r=t,n=[{key:"initialize",value:function(){var e=this;this.sources=[],this.qualityLevels=this.player.qualityLevels(),this.populateSources(this.options_.sources),this.onQualityChange=this.onQualityChange.bind(this),this.qualityLevels.on("change",this.onQualityChange),this.player.one("dispose",(function(){e.qualityLevels.off("change",e.onQualityChange)}))}},{key:"currentSource",get:function(){return this._currentSource}},{key:"onQualityChange",value:function(){var e=this.qualityLevels[this.qualityLevels.selectedIndex];this.player.trigger("cv-quality-change",e.id)}},{key:"setSource",value:function(e){var t=this,r=this.getSourceById(e);if(null===r)return this.currentSource;var n=this.player.currentTime(),i=!this.player.paused();this._currentSource=r;var o=this.player.playbackRate();return this.player.src({src:r.url,type:r.mimeType}),this.player.one("loadedmetadata",(function(){t.player.playbackRate(o),t.player.currentTime()!==n&&t.player.currentTime(n),i&&t.player.play()})),this.trigger({event:"sourcechange",source:r}),this.sourceChangeUpdateQualityLevels(r),r}},{key:"getSourceById",value:function(e){return this.sources.find((function(t){return t.id===e}))}},{key:"repopulateSources",value:function(e){for(var t=null;this.qualityLevels.length;)this.qualityLevels[0].enabled&&(t=this.qualityLevels[0].id),this.qualityLevels.removeQualityLevel(this.qualityLevels[0]);this.sources=[],this.populateSources(e,t)}},{key:"sortSources",value:function(e){return e.sort((function(e,t){return e.id===t.id?0:+e.id>+t.id?-1:1}))}},{key:"populateSources",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=null;(e=this.sortSources(e)).forEach((function(e){t.qualityLevels.addQualityLevel(new Bf(t,e)),t.sources.push(e),t.trigger({event:"addsource",source:e}),null===r?e.default&&(n=e):e.id===r&&(n=e)})),null===n&&(n=this.sources[0]),null!==n&&this.setSource(n.id)}},{key:"sourceChangeUpdateQualityLevels",value:function(e){for(var t=this.qualityLevels,r=-1,n=0;n<t.length;n++)if(t[n].id===e.id){r=n;break}t.selectedIndex_=r,t.trigger({selectedIndex:r,type:"change"})}}],n&&Ff(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getPlugin("plugin"));function Xf(e){return Xf="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},Xf(e)}function Kf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Yf(n.key),n)}}function Yf(e){var t=function(e,t){if("object"!=Xf(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Xf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Xf(t)?t:t+""}yl.registerPlugin("progressiveFiles",Gf);var Qf=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"getKnownProfiles",value:function(){return["1080","720","480","360","240"]}},{key:"enableProfileOrNextBest",value:function(e,t){var r=e.getQualityLevelById(t);if(r||(r=this.getNextBestQuality(e,t)),!r)return null;for(var n=0;n<e.length;n++){var i=e[n];i.enabled=r.id===i.id}return r}},{key:"getNextBestQuality",value:function(e,t){var r=this.getKnownProfiles(),n=r.indexOf(t);if(n>=0){for(var i=n+1;i<r.length;i++){var o=r[i],a=e.getQualityLevelById(o);if(a)return a}for(var s=n-1;s>0;s--){var u=r[s],l=e.getQualityLevelById(u);if(l)return l}}return null}}],null&&Kf(e.prototype,null),t&&Kf(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function $f(e){return $f="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},$f(e)}function Jf(){Jf=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new j(n||[]);return i(a,"_invoke",{value:k(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(L([])));T&&T!==r&&n.call(T,a)&&(_=T);var S=b.prototype=v.prototype=Object.create(_);function E(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function r(i,o,a,s){var u=f(e[i],e,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==$f(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function k(t,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(t,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,C(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function L(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError($f(t)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},E(O.prototype),l(O.prototype,s,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new O(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=L,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function Zf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,eh(n.key),n)}}function eh(e){var t=function(e,t){if("object"!=$f(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=$f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==$f(t)?t:t+""}var th=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name=t.name,this.playbackProfile=t.playbackProfile,this.address=new URL(t.httpsAddress)},(t=[{key:"getUrl",value:function(e){return e?this.address+"cache?file="+encodeURIComponent(e):null}},{key:"ping",value:function(){return e=this,t=void 0,r=void 0,n=Jf().mark((function e(){var t,r,n,i;return Jf().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new AbortController,r=setTimeout((function(){return t.abort()}),1e3),e.prev=3,e.next=6,fetch(this.address+"ping",{method:"GET",mode:"cors",signal:t.signal});case 6:return n=e.sent,e.next=9,n.text();case 9:return i=e.sent,clearTimeout(r),e.abrupt("return","PONG"===i);case 14:return e.prev=14,e.t0=e.catch(3),e.abrupt("return",!1);case 17:case"end":return e.stop()}}),e,this,[[3,14]])})),new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}));var e,t,r,n}}])&&Zf(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function rh(e){return rh="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},rh(e)}function nh(){nh=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new j(n||[]);return i(a,"_invoke",{value:k(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(L([])));T&&T!==r&&n.call(T,a)&&(_=T);var S=b.prototype=v.prototype=Object.create(_);function E(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function r(i,o,a,s){var u=f(e[i],e,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==rh(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function k(t,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(t,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,C(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function L(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(rh(t)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},E(O.prototype),l(O.prototype,s,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new O(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=L,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function ih(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,oh(n.key),n)}}function oh(e){var t=function(e,t){if("object"!=rh(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=rh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==rh(t)?t:t+""}var ah=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.player=t,this.logger=yl.log.createLogger("localcache")},(t=[{key:"setSource",value:function(e,t){return r=this,n=void 0,i=void 0,o=nh().mark((function r(){var n;return nh().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!this.player.localCache||void 0===(null==e?void 0:e.src)){r.next=5;break}return r.next=3,this.player.localCache().getActiveLocalCache();case 3:null!==(n=r.sent)&&(this.logger.debug("Using Local Cache",n),e.src=n.getUrl(e.src));case 5:t(null,e);case 6:case"end":return r.stop()}}),r,this)})),new(i||(i=Promise))((function(e,t){function a(e){try{u(o.next(e))}catch(e){t(e)}}function s(e){try{u(o.throw(e))}catch(e){t(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}u((o=o.apply(r,n||[])).next())}));var r,n,i,o}}])&&ih(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function sh(e){return sh="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},sh(e)}function uh(){uh=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new j(n||[]);return i(a,"_invoke",{value:k(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(L([])));T&&T!==r&&n.call(T,a)&&(_=T);var S=b.prototype=v.prototype=Object.create(_);function E(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function r(i,o,a,s){var u=f(e[i],e,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==sh(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function k(t,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(t,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,C(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function L(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(sh(t)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},E(O.prototype),l(O.prototype,s,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new O(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=L,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function lh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ch(n.key),n)}}function ch(e){var t=function(e,t){if("object"!=sh(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=sh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==sh(t)?t:t+""}function fh(e,t,r){return t=dh(t),function(e,t){if(t&&("object"===sh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,hh()?Reflect.construct(t,r||[],dh(e).constructor):t.apply(e,r))}function hh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hh=function(){return!!e})()}function ph(){return ph="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=dh(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},ph.apply(this,arguments)}function dh(e){return dh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},dh(e)}function yh(e,t){return yh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},yh(e,t)}yl.use("*",(function(e){return new ah(e)}));var mh='<?xml version="1.0" encoding="UTF-8"?><svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Artboard" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.9"><g id="Local-Cache" transform="translate(2.000000, 2.000000)"><rect id="Rectangle" fill="#FFFFFF" x="0" y="2.4" width="18.8" height="15.2"></rect><ellipse id="Oval" fill="#FFFFFF" cx="9.4" cy="2.4" rx="9.4" ry="2.4"></ellipse><ellipse id="Oval-Copy" fill="#FFFFFF" cx="9.4" cy="17.6" rx="9.4" ry="2.4"></ellipse><g id="Logo/Circle" transform="translate(2.500000, 3.000000)"><circle id="Oval" fill="#FFFFFF" cx="7" cy="7" r="7"></circle><polygon id="Fill-1" fill="#F8981D" points="4.66666667 2.33333333 4.66666667 11.4245258 10.0383286 6.87866667"></polygon></g></g></g></svg>',vh=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=fh(this,t,[e,r])).hide(),n.onLocalCacheChange=n.onLocalCacheChange.bind(n),e.ready((function(){n.initialize()})),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yh(e,t)}(t,e),r=t,(n=[{key:"createEl",value:function(){return ph(dh(t.prototype),"createEl",this).call(this,"div",{className:"vjs-local-cache-indicator",innerHTML:'<div class="vjs-local-cache-indicator-icon">'.concat(mh,"</div>"),title:"Streaming from ClickView Local Cache"})}},{key:"initialize",value:function(){var e=this;this.localCachePlugin=this.player_.localCache(),this.localCachePlugin&&(this.localCachePlugin.on("localcachechanged",this.onLocalCacheChange),this.player_.on("dispose",(function(){e.localCachePlugin.off("localcachechanged",e.onLocalCacheChange)})),this.onLocalCacheChange())}},{key:"onLocalCacheChange",value:function(){return e=this,t=void 0,r=void 0,n=uh().mark((function e(){return uh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.localCachePlugin.getActiveLocalCache();case 2:e.sent?this.show():this.hide();case 4:case"end":return e.stop()}}),e,this)})),new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}));var e,t,r,n}}])&&lh(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("Component"));function gh(e){return gh="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},gh(e)}function bh(){bh=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new j(n||[]);return i(a,"_invoke",{value:k(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(L([])));T&&T!==r&&n.call(T,a)&&(_=T);var S=b.prototype=v.prototype=Object.create(_);function E(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function r(i,o,a,s){var u=f(e[i],e,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==gh(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function k(t,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(t,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,C(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function L(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(gh(t)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},E(O.prototype),l(O.prototype,s,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new O(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=L,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function _h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,wh(n.key),n)}}function wh(e){var t=function(e,t){if("object"!=gh(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=gh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==gh(t)?t:t+""}function Th(e,t,r){return t=Oh(t),function(e,t){if(t&&("object"===gh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Sh()?Reflect.construct(t,r||[],Oh(e).constructor):t.apply(e,r))}function Sh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Sh=function(){return!!e})()}function Eh(){return Eh="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Oh(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Eh.apply(this,arguments)}function Oh(e){return Oh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Oh(e)}function kh(e,t){return kh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},kh(e,t)}yl.registerComponent("localCacheIndicator",vh);var Ch=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},Ph=function(e){function t(e,r){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Th(this,t,[e])).logger_=yl.log.createLogger("localcache"),void 0===r)throw Error("no options defined");return n.localCaches_=r.localCacheAddresses.map((function(e){return new th(e)})),n.player.ready((function(){n.initialize(),r.enabled&&n.enable()})),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kh(e,t)}(t,e),r=t,n=[{key:"isEnabled",get:function(){return this.enabled_}},{key:"enable",value:function(){this.enabled_=!0,this.resetActiveLocalCache()}},{key:"disable",value:function(){this.enabled_=!1}},{key:"getActiveLocalCache",value:function(){return this.enabled_?this.activeLocalCache_:null}},{key:"resetActiveLocalCache",value:function(){this.clearActiveLocalCache(),this.activeLocalCache_=this.getActiveLocalCacheInternal()}},{key:"clearActiveLocalCache",value:function(){this.activeLocalCache_&&(this.activeLocalCache_=null,this.onLocalCacheChange(null))}},{key:"removeLocalCache",value:function(e){this.localCaches_=this.localCaches_.filter((function(t){return t!==e}))}},{key:"dispose",value:function(){Eh(Oh(t.prototype),"dispose",this).call(this)}},{key:"initialize",value:function(){this.player.controlBar.addChild("localCacheIndicator")}},{key:"handleNetworkError",value:function(){return Ch(this,void 0,void 0,bh().mark((function e(){var t;return bh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getActiveLocalCache();case 2:if(!(t=e.sent)){e.next=8;break}return e.next=6,t.ping();case 6:e.sent&&this.removeLocalCache(t);case 8:return this.resetActiveLocalCache(),e.next=11,this.getActiveLocalCache();case 11:return this.resetSource(),e.abrupt("return",!0);case 13:case"end":return e.stop()}}),e,this)})))}},{key:"resetSource",value:function(){for(var e=this.player.qualityLevels(),t=0;t<e.length;t++)e[t].enabled&&(e[t].enabled=!0)}},{key:"getActiveLocalCacheInternal",value:function(){return Ch(this,void 0,void 0,bh().mark((function e(){var t,r,n,i=this;return bh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[],r=function(e){return Ch(i,void 0,void 0,bh().mark((function r(){return bh().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.ping();case 2:if(!r.sent){r.next=4;break}t.push(e);case 4:case"end":return r.stop()}}),r)})))},e.next=4,Promise.all(this.localCaches_.map((function(e){return r(e)})));case 4:if(!(t.length>0)){e.next=8;break}return n=t[0],this.onLocalCacheChange(n),e.abrupt("return",n);case 8:return e.abrupt("return",null);case 9:case"end":return e.stop()}}),e,this)})))}},{key:"onLocalCacheChange",value:function(e){this.logger_.debug("Local Cache changed",e),this.trigger("localcachechanged",{localCache:e});var t=!1;e&&e.playbackProfile&&(this.logger_.debug("Changing active profile for local cache",e.playbackProfile),Qf.enableProfileOrNextBest(this.player.qualityLevels(),e.playbackProfile),t=!0),t||this.player.src(this.player.src())}}],n&&_h(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getPlugin("plugin"));function xh(e){return xh="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},xh(e)}function jh(e){var t="function"==typeof Map?new Map:void 0;return jh=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return function(e,t,r){if(Lh())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var i=new(e.bind.apply(e,n));return r&&Ih(i,r.prototype),i}(e,arguments,Ah(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Ih(r,e)},jh(e)}function Lh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Lh=function(){return!!e})()}function Ih(e,t){return Ih=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ih(e,t)}function Ah(e){return Ah=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ah(e)}yl.registerPlugin("localCache",Ph);var Rh=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,r){return t=Ah(t),function(e,t){if(t&&("object"===xh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Lh()?Reflect.construct(t,r||[],Ah(e).constructor):t.apply(e,r))}(this,t,[(null==r?void 0:r.title)||"Ajax error"])).url=e,n.response=r,n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ih(e,t)}(t,e),r=t,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(jh(Error));function Dh(e){return Dh="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},Dh(e)}function Mh(){Mh=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new j(n||[]);return i(a,"_invoke",{value:k(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(L([])));T&&T!==r&&n.call(T,a)&&(_=T);var S=b.prototype=v.prototype=Object.create(_);function E(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function r(i,o,a,s){var u=f(e[i],e,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Dh(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function k(t,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(t,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,C(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function L(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(Dh(t)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},E(O.prototype),l(O.prototype,s,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new O(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=L,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function Nh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Bh(n.key),n)}}function Bh(e){var t=function(e,t){if("object"!=Dh(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Dh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Dh(t)?t:t+""}var Uh=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},Fh=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tokens={gateway:null}},t=[{key:"get",value:function(e,t){return Uh(this,void 0,void 0,Mh().mark((function r(){return Mh().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.t0=this,r.next=3,fetch(e,{method:"GET",mode:"cors",headers:this.getHeaders(t)});case 3:return r.t1=r.sent,r.next=6,r.t0.parseResponse.call(r.t0,r.t1);case 6:return r.abrupt("return",r.sent);case 7:case"end":return r.stop()}}),r,this)})))}},{key:"delete",value:function(e,t){return Uh(this,void 0,void 0,Mh().mark((function r(){return Mh().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,fetch(e,{method:"DELETE",headers:this.getHeaders(t)});case 2:case"end":return r.stop()}}),r,this)})))}},{key:"post",value:function(e,t,r){return Uh(this,void 0,void 0,Mh().mark((function n(){return Mh().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.t0=this,n.next=3,fetch(e,{method:"POST",headers:this.getHeaders(r),body:t,mode:"cors"});case 3:return n.t1=n.sent,n.next=6,n.t0.parseResponse.call(n.t0,n.t1);case 6:return n.abrupt("return",n.sent);case 7:case"end":return n.stop()}}),n,this)})))}},{key:"put",value:function(e,t,r){return Uh(this,void 0,void 0,Mh().mark((function n(){return Mh().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.t0=this,n.next=3,fetch(e,{method:"PUT",headers:this.getHeaders(r),body:t,mode:"cors"});case 3:return n.t1=n.sent,n.next=6,n.t0.parseResponse.call(n.t0,n.t1);case 6:return n.abrupt("return",n.sent);case 7:case"end":return n.stop()}}),n,this)})))}},{key:"setToken",value:function(e,t){this.tokens[e]=t}},{key:"getHeaders",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={"Content-Type":"application/json"};return this.tokens[e.tokenName]&&(t.authorization="Bearer ".concat(this.tokens[e.tokenName])),t}},{key:"parseResponse",value:function(e){return Uh(this,void 0,void 0,Mh().mark((function t(){var r,n;return Mh().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(404!==e.status){t.next=2;break}return t.abrupt("return",null);case 2:if(e.ok){t.next=15;break}return t.prev=3,t.next=6,e.json();case 6:r=t.sent,t.next=12;break;case 9:throw t.prev=9,t.t0=t.catch(3),new Rh(e.url);case 12:throw t.prev=12,new Rh(e.url,r);case 15:return t.next=17,e.json();case 17:return n=t.sent,t.abrupt("return",n);case 19:case"end":return t.stop()}}),t,null,[[3,9,12,15]])})))}}],t&&Nh(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());function Vh(e){return Vh="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},Vh(e)}function Hh(){Hh=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new j(n||[]);return i(a,"_invoke",{value:k(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(L([])));T&&T!==r&&n.call(T,a)&&(_=T);var S=b.prototype=v.prototype=Object.create(_);function E(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function r(i,o,a,s){var u=f(e[i],e,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Vh(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function k(t,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(t,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,C(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function L(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(Vh(t)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},E(O.prototype),l(O.prototype,s,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new O(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=L,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function qh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,zh(n.key),n)}}function zh(e){var t=function(e,t){if("object"!=Vh(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Vh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Vh(t)?t:t+""}function Wh(e,t,r){return t=Kh(t),function(e,t){if(t&&("object"===Vh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Gh()?Reflect.construct(t,r||[],Kh(e).constructor):t.apply(e,r))}function Gh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Gh=function(){return!!e})()}function Xh(){return Xh="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Kh(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Xh.apply(this,arguments)}function Kh(e){return Kh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Kh(e)}function Yh(e,t){return Yh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Yh(e,t)}var Qh=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},$h=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Wh(this,t,[e])).playerApi=r.playerApi,n.fileToken=r.fileToken,n.logger=yl.log.createLogger("video-signature-expiry-plugin"),n.bindErrorHandlers(),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yh(e,t)}(t,e),r=t,(n=[{key:"bindErrorHandlers",value:function(){this.onError=this.onError.bind(this),this.player.on("error",this.onError)}},{key:"dispose",value:function(){this.player.off("error",this.onError),Xh(Kh(t.prototype),"dispose",this).call(this)}},{key:"onError",value:function(){return Qh(this,void 0,void 0,Hh().mark((function e(){var t,r=this;return Hh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((t=this.player.error().code)===MediaError.MEDIA_ERR_NETWORK||t===MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,this.player.localCache().getActiveLocalCache();case 5:if(!e.sent){e.next=8;break}return this.callErrorHandler((function(){return r.player.localCache().handleNetworkError()})),e.abrupt("return");case 8:this.callErrorHandler((function(){return r.handleVideoSignatureExpiry()}));case 9:case"end":return e.stop()}}),e,this)})))}},{key:"handleVideoSignatureExpiry",value:function(){return Qh(this,void 0,void 0,Hh().mark((function e(){var t,r;return Hh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.playerApi&&this.fileToken){e.next=2;break}return e.abrupt("return",!1);case 2:if(!(this.refetchedSourcesTimestamp+9e5>Date.now())){e.next=4;break}return e.abrupt("return",!1);case 4:return this.refetchedSourcesTimestamp=Date.now(),t=null,e.prev=6,this.logger.debug("Detected expired mp4 urls, attempting to refetch"),r="".concat(this.playerApi.origin,"/api/files?fileToken=").concat(this.fileToken),e.next=11,Fh.get(r);case 11:t=e.sent,e.next=18;break;case 14:return e.prev=14,e.t0=e.catch(6),this.logger.error("Failed to refetch expired mp4 urls"),e.abrupt("return",!1);case 18:return this.logger.debug("Mp4 urls successfully refetched"),this.player.progressiveFiles().repopulateSources(t.progressive.map((function(e){return{id:e.profile,mimeType:e.mimeType,url:e.url}}))),this.fileToken=t.fileToken,e.abrupt("return",!0);case 22:case"end":return e.stop()}}),e,this,[[6,14]])})))}},{key:"callErrorHandler",value:function(e){return Qh(this,void 0,void 0,Hh().mark((function t(){var r,n,i,o,a=this;return Hh().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.player.currentTime(),n=!this.player.paused(),i=this.player.playbackRate(),o=function(){a.player.playbackRate(i),a.player.currentTime(r),n&&a.player.play(),a.player.error(null)},this.player.one("loadedmetadata",o),t.next=7,e();case 7:if(!t.sent){t.next=9;break}return t.abrupt("return");case 9:this.player.off("loadedmetadata",o);case 10:case"end":return t.stop()}}),t,this)})))}}])&&qh(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getPlugin("plugin"));function Jh(e){return Jh="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},Jh(e)}function Zh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ep(n.key),n)}}function ep(e){var t=function(e,t){if("object"!=Jh(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Jh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Jh(t)?t:t+""}function tp(e,t,r){return t=np(t),function(e,t){if(t&&("object"===Jh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,rp()?Reflect.construct(t,r||[],np(e).constructor):t.apply(e,r))}function rp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(rp=function(){return!!e})()}function np(e){return np=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},np(e)}function ip(e,t){return ip=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ip(e,t)}yl.registerPlugin("handleNetworkErrors",$h);var op=yl.getPlugin("plugin"),ap="cvplayer-show-subtitles",sp="cvplayer-selected-language",up="cvplayer-subtitle-size",lp=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=tp(this,t,[e])).options=r,n.initialize(),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ip(e,t)}(t,e),r=t,n=[{key:"initialize",value:function(){this.applyUserPreferences=this.applyUserPreferences.bind(this),this.player.textTracks().length&&(this.bindEventListeners(),this.applyUserPreferences())}},{key:"applyUserPreferences",value:function(){var e=!!this.options.showSubtitles,t=this.safeGet(ap);if("true"===t&&(e=!0),"false"===t&&(e=!1),e){var r=this.guessWhichTrack();r&&(r.mode="showing")}else this.disableSubtitles();var n=this.safeGet(up);n||(n=this.options.subtitleSize),this.player.options_.mobile&&(n="medium"),n&&this.player.textTrackSettings.setSizeSetting(n)}},{key:"safeGet",value:function(e){if(Il())return Al(e)}},{key:"onSelectedLanguageChange",value:function(){for(var e,t,r=this.player.textTracks(),n=0;n<r.length;n++){var i=r[n];if("showing"===i.mode)return Rl(ap,"true"),Rl(sp,i.language),void(null===(e=this.options.analyticsService)||void 0===e||e.logUserAction({language:i.language},{actionType:ql.Select,entity:zl.Subtitle,workflowPhase:Gl.Complete,descriptor:lc.On}))}var o;Rl(ap,"false"),o=sp,window.localStorage.removeItem(o),null===(t=this.options.analyticsService)||void 0===t||t.logUserAction({language:""},{actionType:ql.Select,entity:zl.Subtitle,workflowPhase:Gl.Complete,descriptor:lc.Off,eventVersion:kc.V3})}},{key:"bindEventListeners",value:function(){var e=this;Il()&&(this.onSelectedLanguageChange=this.onSelectedLanguageChange.bind(this),this.onChangeSubtitleSize=this.onChangeSubtitleSize.bind(this),this.player.on("cv:languageselected",this.onSelectedLanguageChange),this.player.on("changesubtitlesize",this.onChangeSubtitleSize),this.one("dispose",(function(){e.player.off("cv:languageselected",e.onSelectedLanguageChange),e.player.off("changesubtitlesize",e.onChangeSubtitleSize)})))}},{key:"onChangeSubtitleSize",value:function(){var e=this.player.textTrackSettings.getSizeSetting();Rl(up,e)}},{key:"guessWhichTrack",value:function(){for(var e,t,r=this.safeGet(sp)||window.navigator.language,n=this.getLanguageParts(r),i=n.language,o=n.country,a=this.player.textTracks(),s=0;s<a.length;s++){var u=a[s],l=this.getLanguageParts(u.language),c=l.language,f=l.country;if(c===i&&(e=u,f||(t=u),f===o))return e}return t||e||null}},{key:"getLanguageParts",value:function(e){var t=e.toLowerCase().split("-");return{language:t[0],country:t[1]}}},{key:"disableSubtitles",value:function(){for(var e=this.player.textTracks(),t=0;t<e.length;t++)e[t].mode="disabled"}},{key:"previewModeSubtitles",value:function(){var e=this.guessWhichTrack();e&&(e.mode="showing"),this.player.off("changesubtitlesize",this.onChangeSubtitleSize),this.player.textTrackSettings.setSizeSetting("large"),this.player.on("changesubtitlesize",this.onChangeSubtitleSize)}}],n&&Zh(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(op);function cp(e){return cp="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},cp(e)}function fp(){fp=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new j(n||[]);return i(a,"_invoke",{value:k(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(L([])));T&&T!==r&&n.call(T,a)&&(_=T);var S=b.prototype=v.prototype=Object.create(_);function E(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function r(i,o,a,s){var u=f(e[i],e,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==cp(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function k(t,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(t,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,C(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function L(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(cp(t)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},E(O.prototype),l(O.prototype,s,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new O(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=L,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function hp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,pp(n.key),n)}}function pp(e){var t=function(e,t){if("object"!=cp(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=cp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==cp(t)?t:t+""}function dp(e,t,r){return t=mp(t),function(e,t){if(t&&("object"===cp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,yp()?Reflect.construct(t,r||[],mp(e).constructor):t.apply(e,r))}function yp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yp=function(){return!!e})()}function mp(e){return mp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},mp(e)}function vp(e,t){return vp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vp(e,t)}yl.registerPlugin("persistSubtitleSettingsPlugin",lp);var gp=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},bp=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=dp(this,t,[e])).options=r,n.player.ready((function(){return n.initialize()})),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vp(e,t)}(t,e),r=t,n=[{key:"initialize",value:function(){return gp(this,void 0,void 0,fp().mark((function e(){var t,r,n,i,o=this;return fp().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getActiveLocalCache();case 2:if(t=e.sent,(r=t?this.options.playbackProfileLocalCache:this.options.playbackProfile)||(r="1080"),Il()&&(n=Al(this.getStorageKey(!!t)))&&(r=n),i=this.player.qualityLevels(),(null==t?void 0:t.playbackProfile)||Qf.enableProfileOrNextBest(i,r),Il()){e.next=10;break}return e.abrupt("return");case 10:this.onQualityLevelsChange=this.onQualityLevelsChange.bind(this),i.on("change",this.onQualityLevelsChange),this.on("dispose",(function(){i.off("change",o.onQualityLevelsChange)}));case 13:case"end":return e.stop()}}),e,this)})))}},{key:"onQualityLevelsChange",value:function(){var e;return gp(this,void 0,void 0,fp().mark((function t(){var r,n,i;return fp().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.isLocalCacheActive();case 2:r=t.sent,n=this.player.qualityLevels(),i=n[n.selectedIndex],Rl(this.getStorageKey(r),i.id),null===(e=this.options.analyticsService)||void 0===e||e.logUserAction({quality:i.id},{actionType:ql.Select,workflowPhase:Gl.Complete,descriptor:ec.ChangeResolution,entity:zl.Resolution,eventVersion:kc.V3});case 7:case"end":return t.stop()}}),t,this)})))}},{key:"isLocalCacheActive",value:function(){return gp(this,void 0,void 0,fp().mark((function e(){return fp().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.player.localCache().getActiveLocalCache();case 2:return e.abrupt("return",!!e.sent);case 3:case"end":return e.stop()}}),e,this)})))}},{key:"getActiveLocalCache",value:function(){return this.player.localCache().getActiveLocalCache()}},{key:"getStorageKey",value:function(e){return e?"cvplayer-localcache-playback-quality":"cvplayer-playback-quality"}}],n&&hp(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getPlugin("plugin"));function _p(e){return _p="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},_p(e)}function wp(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Tp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Op(n.key),n)}}function Ep(e,t,r){return t&&Sp(e.prototype,t),r&&Sp(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Op(e){var t=function(e,t){if("object"!=_p(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=_p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_p(t)?t:t+""}function kp(e,t,r){return t=Pp(t),function(e,t){if(t&&("object"===_p(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Cp()?Reflect.construct(t,r||[],Pp(e).constructor):t.apply(e,r))}function Cp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Cp=function(){return!!e})()}function Pp(e){return Pp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Pp(e)}function xp(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&&jp(e,t)}function jp(e,t){return jp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},jp(e,t)}yl.registerPlugin("persistQualitySettingsPlugin",bp);var Lp=yl.getComponent("Component"),Ip=function(e){function t(e,r){return Tp(this,t),kp(this,t,[e,r])}return xp(t,e),Ep(t,[{key:"createEl",value:function(){return yl.dom.createEl("div",{className:"cv-progress-reporter-item"})}},{key:"update",value:function(){var e=this.options_.event,t=this.player_.duration(),r=(e.end.time-e.start.time)/t;this.el_.style.width=100*r+"%";var n=e.start.time/t;this.el_.style.left=100*n+"%"}}])}(Lp),Ap=function(e){function t(){var e;return Tp(this,t),(e=kp(this,t,arguments)).events_=[],e}return xp(t,e),Ep(t,[{key:"update",value:function(){for(var e=this,t=this.children(),r=t.length;r>0;r--)this.removeChild(t[r]);this.events_.forEach((function(t){var r=new Ip(e.player(),{event:t});e.addChild(r),r.update()}))}},{key:"addEvents",value:function(e){var t,r;(t=this.events_).push.apply(t,function(e){if(Array.isArray(e))return wp(e)}(r=e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return wp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?wp(e,t):void 0}}(r)||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.")}()),this.update()}},{key:"createEl",value:function(){return yl.dom.createEl("div",{className:"cv-progress-reporter-display"})}}])}(Lp);function Rp(e){return Rp="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},Rp(e)}function Dp(e,t,r){return(t=Np(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mp(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Np(n.key),n)}}function Np(e){var t=function(e,t){if("object"!=Rp(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Rp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Rp(t)?t:t+""}function Bp(e,t,r){return t=Fp(t),function(e,t){if(t&&("object"===Rp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Up()?Reflect.construct(t,r||[],Fp(e).constructor):t.apply(e,r))}function Up(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Up=function(){return!!e})()}function Fp(e){return Fp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Fp(e)}function Vp(e,t){return Vp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Vp(e,t)}var Hp=yl.getPlugin("plugin"),qp="play",zp="playing",Wp="pause",Gp="seekstart",Xp="ended",Kp="pausedseek",Yp=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Bp(this,t,[e,r])).eventBuffer=[],n.latestTime=0,n.lastPlayingTime=0,n.isPlaying=!1,n.isSeeking=!1,n.hasEnded=!1,n.shouldLogPlayOnTimeUpdate=!1,n.options=r,n.player.ready((function(){return n.initialize()})),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vp(e,t)}(t,e),r=t,n=[{key:"initialize",value:function(){this.validateOptions(),this.bindListeners(),this.startInterval(),this.addEasterEgg()}},{key:"validateOptions",value:function(){if("function"!=typeof this.options.onFlush)throw new Error("Please provide the onFlush option")}},{key:"bindListeners",value:function(){var e=this,t=Dp(Dp(Dp(Dp(Dp(Dp({},qp,(function(){return e.onPlay()})),Wp,(function(){return e.onPause()})),"timeupdate",(function(){return e.onTimeUpdate()})),"seeking",(function(){return e.onSeeking()})),Xp,(function(){return e.onEnded()})),zp,(function(){return e.onPlaying()})),r=Object.keys(t);r.forEach((function(r){return e.player.on(r,t[r])})),this.one("dispose",(function(){r.forEach((function(r){return e.player.off(r,t[r])}))}))}},{key:"startInterval",value:function(){var e=this,t=this.options.interval||5e3;this.interval=window.setInterval((function(){return e.flushBuffer()}),t),this.player.one("dispose",(function(){return window.clearInterval(e.interval)}))}},{key:"addEasterEgg",value:function(){var e,t,r=this,n="",i=function(t){"ArrowUpArrowUpArrowDownArrowDownArrowLeftArrowRightArrowLeftArrowRightba"===(n+=t.key)&&r.addDisplay(),window.clearTimeout(e),e=window.setTimeout((function(){n=""}),500)},o=!1,a=function(){o=!0,t=window.setTimeout((function(){o&&r.addDisplay()}),1e4)};function s(){o=!1,window.clearTimeout(t)}this.player.el().addEventListener("keyup",i);var u=this.player.getChild("Collapserator").getChild("PlayToggle");u.on("touchstart",a),u.on("touchend",s),this.player.one("dispose",(function(){var e,t;null===(t=null===(e=r.player)||void 0===e?void 0:e.el())||void 0===t||t.removeEventListener("keyup",i),u.off("touchstart",a),u.off("touchend",s)}))}},{key:"addDisplay",value:function(){var e=this;this.progressReporterDisplay||(this.progressReporterDisplay=new Ap(this.player),this.player.addChild(this.progressReporterDisplay),this.player.options_.inactivityTimeout=0,this.player.one("dispose",(function(){e.progressReporterDisplay=void 0})))}},{key:"onPlay",value:function(){return this.isPlaying=!0,this.isSeeking?(this.logEvent("seekend"),void(this.isSeeking=!1)):this.hasEnded?(this.shouldLogPlayOnTimeUpdate=!0,void(this.hasEnded=!1)):void this.logEvent(qp)}},{key:"onPause",value:function(){var e=this;this.isSeeking||(this.pauseTimeout=window.setTimeout((function(){e.isPlaying=!1,e.logEvent(Wp),delete e.pauseTimeout}),50))}},{key:"onTimeUpdate",value:function(){this.shouldLogPlayOnTimeUpdate&&(this.shouldLogPlayOnTimeUpdate=!1,this.logEvent(qp)),this.isPlaying&&!this.isSeeking&&this.logEvent(zp)}},{key:"onSeeking",value:function(){this.pauseTimeout&&(this.latestTime=this.previousLatestTime,window.clearTimeout(this.pauseTimeout),delete this.pauseTimeout),this.isPlaying||this.logEvent(Kp),!this.isSeeking&&this.isPlaying&&(this.isSeeking=!0,this.logEvent(Gp))}},{key:"onEnded",value:function(){this.hasEnded=!0,this.logEvent(Xp)}},{key:"onPlaying",value:function(){this.isSeeking=!1,this.isPlaying=!0}},{key:"logEvent",value:function(e){if(this.player){var t=this.player.currentTime();e===Gp&&(t=this.latestTime),this.previousLatestTime=this.latestTime,this.latestTime=this.player.currentTime(),this.eventBuffer.push({time:t,type:e})}}},{key:"shouldUseCarriedOverTime",value:function(e){return this.lastPlayingTime&&(e===zp||e===qp)}},{key:"shouldSaveCarriedOverTime",value:function(e){return e===zp||e===Wp}},{key:"shouldClearCarriedOverTime",value:function(e){return e===Xp||e===Kp}},{key:"flushBuffer",value:function(){for(var e,t,r=[],n={};this.eventBuffer.length;){var i=this.eventBuffer.shift();this.shouldClearCarriedOverTime(i.type)?delete this.lastPlayingTime:n.start?i.type===zp&&this.eventBuffer.length>0||(this.shouldSaveCarriedOverTime(i.type)&&(this.lastPlayingTime=i.time),n.end=i,r.push(n),n={}):(this.shouldUseCarriedOverTime(i.type)&&(i.time=this.lastPlayingTime,delete this.lastPlayingTime),n.start=i)}this.eventBuffer=[],r.length&&this.validateEvents(r)&&(this.options.onFlush(r),null===(e=this.player)||void 0===e||e.trigger("progressflush"),null===(t=this.progressReporterDisplay)||void 0===t||t.addEvents(r))}},{key:"validateEvents",value:function(e){var t=0;e.forEach((function(e){t+=e.end.time-e.start.time}));var r=this.options.interval||5e3;return r/=1e3,r+=.5,r*=this.player.playbackRate(),t<r}}],n&&Mp(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Hp);function Qp(e){return Qp="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},Qp(e)}function $p(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Jp(n.key),n)}}function Jp(e){var t=function(e,t){if("object"!=Qp(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Qp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Qp(t)?t:t+""}function Zp(e,t,r){return t=td(t),function(e,t){if(t&&("object"===Qp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ed()?Reflect.construct(t,r||[],td(e).constructor):t.apply(e,r))}function ed(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ed=function(){return!!e})()}function td(e){return td=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},td(e)}function rd(e,t){return rd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},rd(e,t)}yl.registerPlugin("progressReporterPlugin",Yp);var nd=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Zp(this,t,arguments)}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rd(e,t)}(t,e),r=t,(n=[{key:"createEl",value:function(){return yl.dom.createEl("span",{innerHTML:'<span class="vjs-icon-placeholder"></span>',className:"cv-drag-handle vjs-control vjs-button"},{})}}])&&$p(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("Component")),id=["top","left","right","bottom"],od={top:"Top",left:"Left",right:"Right",bottom:"Bottom"};function ad(e){return ad="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},ad(e)}function sd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ud(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,cd(n.key),n)}}function ld(e,t,r){return t&&ud(e.prototype,t),r&&ud(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function cd(e){var t=function(e,t){if("object"!=ad(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=ad(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ad(t)?t:t+""}function fd(e,t,r){return t=dd(t),function(e,t){if(t&&("object"===ad(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,hd()?Reflect.construct(t,r||[],dd(e).constructor):t.apply(e,r))}function hd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hd=function(){return!!e})()}function pd(){return pd="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=dd(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},pd.apply(this,arguments)}function dd(e){return dd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},dd(e)}function yd(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&&md(e,t)}function md(e,t){return md=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},md(e,t)}var vd=yl.getComponent("Component"),gd=function(e){function t(e,r){var n;return sd(this,t),(n=fd(this,t,[e,r])).bindEventListeners(),n}return yd(t,e),ld(t,[{key:"createEl",value:function(){return pd(dd(t.prototype),"createEl",this).call(this,"div",{},{class:"cv-drop-target cv-drop-".concat(this.options_.side)})}},{key:"bindEventListeners",value:function(){var e=this,t=this.el(),r=function(t){t.preventDefault(),t.dataTransfer.dropEffect="move",e.addClass("cv-drag-over")},n=function(t){t.preventDefault(),e.removeClass("cv-drag-over"),e.player_.whiteboardModePlugin().setWhiteboardMode(e.options_.side)},i=function(){e.removeClass("cv-drag-over")};t.addEventListener("dragover",r),t.addEventListener("drop",n),t.addEventListener("dragleave",i),this.on("dispose",(function(){t.removeEventListener("dragover",r),t.removeEventListener("drop",n),t.removeEventListener("dragleave",i)}))}}])}(vd),bd=function(e){function t(e,r){var n;return sd(this,t),(n=fd(this,t,[e,r])).addChildren(),n}return yd(t,e),ld(t,[{key:"addChildren",value:function(){var e=this;id.forEach((function(t){e.addChild(new gd(e.player_,{side:t}))}))}}])}(vd);function _d(e){return _d="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},_d(e)}function wd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Td(n.key),n)}}function Td(e){var t=function(e,t){if("object"!=_d(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=_d(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_d(t)?t:t+""}function Sd(e,t,r){return t=kd(t),function(e,t){if(t&&("object"===_d(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ed()?Reflect.construct(t,r||[],kd(e).constructor):t.apply(e,r))}function Ed(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ed=function(){return!!e})()}function Od(){return Od="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=kd(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Od.apply(this,arguments)}function kd(e){return kd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},kd(e)}function Cd(e,t){return Cd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Cd(e,t)}var Pd=function(e){function t(e,r){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Sd(this,t,[e,r])}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cd(e,t)}(t,e),r=t,(n=[{key:"createEl",value:function(){return yl.dom.createEl("li",{className:"vjs-menu-item cv-collapsible-menu-heading cv-divider-after-menu-item",innerHTML:'<span class="vjs-menu-item-text">'.concat(this.localize(this.options_.label),"</span>"),tabIndex:-1})}},{key:"handleClick",value:function(e){var r=this;Od(kd(t.prototype),"handleClick",this).call(this,e),this.options_.onClickBack?this.options_.onClickBack():this.requestAnimationFrame((function(){r.player_.getChild("collapserator").getChild("cogButton").pressButton()}))}}])&&wd(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("MenuItem"));function xd(e){return xd="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},xd(e)}function jd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ld(n.key),n)}}function Ld(e){var t=function(e,t){if("object"!=xd(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=xd(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==xd(t)?t:t+""}function Id(e,t,r){return t=Rd(t),function(e,t){if(t&&("object"===xd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ad()?Reflect.construct(t,r||[],Rd(e).constructor):t.apply(e,r))}function Ad(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ad=function(){return!!e})()}function Rd(e){return Rd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Rd(e)}function Dd(e,t){return Dd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Dd(e,t)}var Md=function(e){function t(e,r){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Id(this,t,[e,r])}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dd(e,t)}(t,e),r=t,(n=[{key:"handleClick",value:function(){this.player_.whiteboardModePlugin().setWhiteboardMode(this.options_.side)}}])&&jd(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("MenuItem"));function Nd(e){return Nd="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},Nd(e)}function Bd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ud(n.key),n)}}function Ud(e){var t=function(e,t){if("object"!=Nd(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Nd(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Nd(t)?t:t+""}function Fd(e,t,r){return t=qd(t),function(e,t){if(t&&("object"===Nd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Vd()?Reflect.construct(t,r||[],qd(e).constructor):t.apply(e,r))}function Vd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Vd=function(){return!!e})()}function Hd(){return Hd="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=qd(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Hd.apply(this,arguments)}function qd(e){return qd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},qd(e)}function zd(e,t){return zd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},zd(e,t)}var Wd=yl.getComponent("MenuButton"),Gd=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=Fd(this,t,arguments)).alwaysCollapsed=!0,e.isCollapsed=!1,e.isCollabsible=!0,e}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zd(e,t)}(t,e),r=t,n=[{key:"createItems",value:function(){var e=this,t=this.player_.whiteboardModePlugin().side,r=[new Pd(this.player_,{label:"Video Controls"})];return id.forEach((function(n){r.push(new Md(e.player_,{side:n,label:od[n],selectable:!0,multiSelectable:!1,selected:n===t}))})),r}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-has-left-icons ".concat(Hd(qd(t.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"getCollabsibleName",value:function(){return"Video Controls"}},{key:"getCollabsibleValue",value:function(){var e=this.player_.whiteboardModePlugin().side;return od[e]}},{key:"showInCollabsibleMenu",value:function(){return this.player_.isFullscreen()}},{key:"showCollapsibleMenu",value:function(){Wd.prototype.handleClick.apply(this)}}],n&&Bd(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Wd);function Xd(e){return Xd="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},Xd(e)}function Kd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Yd(n.key),n)}}function Yd(e){var t=function(e,t){if("object"!=Xd(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Xd(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Xd(t)?t:t+""}function Qd(e,t,r){return t=Jd(t),function(e,t){if(t&&("object"===Xd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,$d()?Reflect.construct(t,r||[],Jd(e).constructor):t.apply(e,r))}function $d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($d=function(){return!!e})()}function Jd(e){return Jd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Jd(e)}function Zd(e,t){return Zd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Zd(e,t)}var ey="cv-whiteboard-side",ty=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=Qd(this,t,[e])).side="bottom",r.player.ready((function(){r.initialize()})),r}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zd(e,t)}(t,e),r=t,n=[{key:"initialize",value:function(){if(!this.player.options_.mobile){if(Il()){var e=Al(ey);e&&(this.side=e)}this.initCollapserator(),this.initDragTargets(),this.initFullscreenListener()}}},{key:"initCollapserator",value:function(){var e=this,t=this.player.getChild("collapserator"),r=new nd(this.player);this.button=new Gd(this.player),t.addChild(r),t.addChild(this.button),this.player.trigger("cv-updatecog");var n=function(){e.player.isFullscreen()&&t.el().setAttribute("draggable","true")},i=function(){e.player.isFullscreen()&&t.el().setAttribute("draggable","false")},o=function(t){e.player.isFullscreen()&&(e.player.addClass("cv-dragging"),t.dataTransfer.setData("text/plain","handle"))},a=function(){e.player.isFullscreen()&&(e.player.removeClass("cv-dragging"),t.el().setAttribute("draggable","false"))};r.el().addEventListener("mousedown",n),r.el().addEventListener("mouseup",i),t.el().addEventListener("dragstart",o),t.el().addEventListener("dragend",a),this.on("dispose",(function(){r.el().removeEventListener("mousedown",n),r.el().removeEventListener("mouseup",i),t.el().removeEventListener("dragstart",o),t.el().removeEventListener("dragend",a)}))}},{key:"initDragTargets",value:function(){this.player.addChild(new bd(this.player))}},{key:"initFullscreenListener",value:function(){var e=this;this.update=this.update.bind(this),this.player.on("fullscreenchange",this.update),this.one("dispose",(function(){e.player.off("fullscreenchange",e.update)}))}},{key:"setWhiteboardMode",value:function(e){this.side=e,this.button.update(),Il()&&Rl(ey,e),this.player.trigger("cv-whiteboard-change"),this.update()}},{key:"update",value:function(){this.player.removeClass("cv-whiteboard-top"),this.player.removeClass("cv-whiteboard-left"),this.player.removeClass("cv-whiteboard-right"),yl.dom.removeClass(window.document.documentElement,"cv-whiteboard-html-font-size"),this.player.trigger("resizemenus"),this.player.isFullscreen()&&"bottom"!==this.side&&(this.player.addClass("cv-whiteboard-".concat(this.side)),yl.dom.addClass(window.document.documentElement,"cv-whiteboard-html-font-size"))}}],n&&Kd(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getPlugin("plugin"));function ry(e){return ry="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},ry(e)}function ny(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,iy(n.key),n)}}function iy(e){var t=function(e,t){if("object"!=ry(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=ry(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ry(t)?t:t+""}function oy(e,t,r){return t=sy(t),function(e,t){if(t&&("object"===ry(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ay()?Reflect.construct(t,r||[],sy(e).constructor):t.apply(e,r))}function ay(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ay=function(){return!!e})()}function sy(e){return sy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},sy(e)}function uy(e,t){return uy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},uy(e,t)}yl.registerPlugin("whiteboardModePlugin",ty);var ly=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),oy(this,t,[e])}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&uy(e,t)}(t,e),r=t,n=[{key:"deferMenu",value:function(){var e={subtitles:this.buildSubtitles(),qualities:this.buildQualities(),playbackSpeeds:this.buildPlaybackSpeeds()};this.player.trigger("cv-defer-menus",e)}},{key:"buildSubtitles",value:function(){for(var e=[],t=!1,r=this.player.textTracks(),n=0;n<r.length;n++){var i=r[n],o="showing"===i.mode;e.unshift({id:i.label,name:i.label,selected:o}),o&&(t=!0)}return e.push({id:null,name:"Off",selected:!t}),e}},{key:"buildQualities",value:function(){for(var e=[],t=this.player.qualityLevels(),r=0;r<t.length;r++){var n=t[r];e.push({id:n.id,name:n.id+"p",selected:n.enabled})}return e}},{key:"buildPlaybackSpeeds",value:function(){var e=this.player.playbackRate();return this.player.options_.playbackRates.map((function(t){return{id:t,name:t+"x"+(1===t?" (Normal)":""),selected:e===t}}))}}],n&&ny(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getPlugin("plugin"));yl.registerPlugin("deferMenusPlugin",ly);var cy="PreventScrubbingTooltip";function fy(e){return fy="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},fy(e)}function hy(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,py(n.key),n)}}function py(e){var t=function(e,t){if("object"!=fy(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=fy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==fy(t)?t:t+""}function dy(e,t,r){return t=vy(t),function(e,t){if(t&&("object"===fy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,yy()?Reflect.construct(t,r||[],vy(e).constructor):t.apply(e,r))}function yy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yy=function(){return!!e})()}function my(){return my="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=vy(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},my.apply(this,arguments)}function vy(e){return vy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vy(e)}function gy(e,t){return gy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gy(e,t)}var by=yl.getComponent("Component"),_y="cv-prevent-scrubbing-tooltip-show",wy="cv-prevent-scrubbing-tooltip-remove-transition",Ty=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=dy(this,t,arguments)).isShowing=!1,e}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gy(e,t)}(t,e),r=t,n=[{key:"buildCSSClass",value:function(){return"cv-prevent-scrubbing-tooltip ".concat(my(vy(t.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(e,r,n){return my(vy(t.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},r),{className:this.buildCSSClass(),innerText:"No skipping ahead!"}),n)}},{key:"show",value:function(){this.isShowing||(this.player_.userActive(!0),this.addClass(_y),this.isShowing=!0)}},{key:"hide",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isShowing&&(t&&(this.addClass(wy),window.requestAnimationFrame((function(){e.removeClass(wy)}))),this.player_.userActive(!1),this.removeClass(_y),this.isShowing=!1)}}],n&&hy(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(by);function Sy(e){return Sy="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},Sy(e)}function Ey(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Oy(n.key),n)}}function Oy(e){var t=function(e,t){if("object"!=Sy(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Sy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Sy(t)?t:t+""}function ky(e,t,r){return t=xy(t),function(e,t){if(t&&("object"===Sy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Cy()?Reflect.construct(t,r||[],xy(e).constructor):t.apply(e,r))}function Cy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Cy=function(){return!!e})()}function Py(){return Py="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=xy(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Py.apply(this,arguments)}function xy(e){return xy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xy(e)}function jy(e,t){return jy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},jy(e,t)}yl.registerComponent(cy,Ty);var Ly=function(e){function t(e,r){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=ky(this,t,[e])).isEnabled=!1,n.isPreviewing=!1;var i=null!=r?r:{},o=i.furthestVisitedTime,a=void 0===o?0:o,s=i.isEnabled,u=void 0!==s&&s;return n.playerCurrentTimeFn=n.player.currentTime.bind(e),n.player.currentTime=n.currentTime.bind(n),n.onTimeUpdate=n.onTimeUpdate.bind(n),n.furthestVisitedTime=a,n.isEnabled=u,u&&n.enable(),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jy(e,t)}(t,e),r=t,n=[{key:"dispose",value:function(){this.player.currentTime=this.playerCurrentTimeFn,this.isEnabled&&(this.disable(),Py(xy(t.prototype),"dispose",this).call(this))}},{key:"togglePreview",value:function(e){if(e){if(this.configurePreview(),this.isEnabled)return;this.enable(),this.isPreviewing=!0}else this.disable(),this.isPreviewing=!1}},{key:"configurePreview",value:function(){this.player.currentTime(0),this.furthestVisitedTime=0}},{key:"enable",value:function(){this.player.on("timeupdate",this.onTimeUpdate),this.getProgressControl().addChild(cy),this.isEnabled=!0}},{key:"disable",value:function(){this.player.off("timeupdate",this.onTimeUpdate),this.getProgressControl().removeChild(this.getPreventScrubbingTooltip()),this.isEnabled=!1}},{key:"getProgressControl",value:function(){return this.player.controlBar.getChild("progressControl")}},{key:"onTimeUpdate",value:function(){var e=this.playerCurrentTimeFn();e>this.furthestVisitedTime&&(this.furthestVisitedTime=e)}},{key:"currentTime",value:function(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];if("number"!=typeof e)return this.playerCurrentTimeFn(e,n);if(this.isEnabled){var o=this.getPreventScrubbingTooltip(),a=null===(t=this.getSeekBar())||void 0===t?void 0:t.getChild("MouseTimeDisplay");if(e>this.furthestVisitedTime)return o.show(),Jc(o.hide,1e3,!1,o)(),null==a||a.hide(),void this.playerCurrentTimeFn(this.furthestVisitedTime,n);null==a||a.show(),o.hide(!0),this.playerCurrentTimeFn(e,n)}else this.playerCurrentTimeFn(e,n)}},{key:"getPreventScrubbingTooltip",value:function(){return this.getProgressControl().getChild(cy)}},{key:"getSeekBar",value:function(){var e;return null===(e=this.player.controlBar.getChild("ProgressControl"))||void 0===e?void 0:e.getChild("SeekBar")}}],n&&Ey(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getPlugin("plugin"));function Iy(e){return Iy="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},Iy(e)}function Ay(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ry(n.key),n)}}function Ry(e){var t=function(e,t){if("object"!=Iy(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Iy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Iy(t)?t:t+""}function Dy(e,t,r){return t=Ny(t),function(e,t){if(t&&("object"===Iy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,My()?Reflect.construct(t,r||[],Ny(e).constructor):t.apply(e,r))}function My(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(My=function(){return!!e})()}function Ny(e){return Ny=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ny(e)}function By(e,t){return By=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},By(e,t)}yl.registerPlugin("preventScrubbingPlugin",Ly);var Uy=yl.getComponent("Button"),Fy="cv-muted",Vy=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=Dy(this,t,[e])).update(),r.update=r.update.bind(r),e.on("volumechange",r.update),e.on("dispose",(function(){return e.off("volumechange",r.update)})),r}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&By(e,t)}(t,e),r=t,(n=[{key:"handleClick",value:function(){this.player_.muted(!this.player_.muted()),this.update()}},{key:"update",value:function(){this.player_.muted()?this.addClass(Fy):this.removeClass(Fy)}},{key:"buildCSSClass",value:function(){return"cv-mute-button cv-muted"}}])&&Ay(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Uy);function Hy(e){return Hy="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},Hy(e)}function qy(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,zy(n.key),n)}}function zy(e){var t=function(e,t){if("object"!=Hy(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Hy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Hy(t)?t:t+""}function Wy(e,t,r){return t=Ky(t),function(e,t){if(t&&("object"===Hy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Gy()?Reflect.construct(t,r||[],Ky(e).constructor):t.apply(e,r))}function Gy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Gy=function(){return!!e})()}function Xy(){return Xy="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ky(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Xy.apply(this,arguments)}function Ky(e){return Ky=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ky(e)}function Yy(e,t){return Yy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Yy(e,t)}yl.registerComponent("muteButton",Vy),Vy.prototype.controlText_="Mute";var Qy,$y=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Wy(this,t,[e,r]))._onClickHandler=r.onClickHandler,n.bindEventListeners(),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yy(e,t)}(t,e),r=t,(n=[{key:"createEl",value:function(){return yl.dom.createEl("div",{className:"cv-player-overlay"})}},{key:"handleClick",value:function(e){"function"==typeof this._onClickHandler&&(e.stopImmediatePropagation(),this._onClickHandler())}},{key:"dispose",value:function(){this.off("click",this.handleClick),Xy(Ky(t.prototype),"dispose",this).call(this)}},{key:"bindEventListeners",value:function(){this.on("click",this.handleClick)}}])&&qy(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("Component"));function Jy(e){return Jy="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},Jy(e)}function Zy(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,em(n.key),n)}}function em(e){var t=function(e,t){if("object"!=Jy(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Jy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Jy(t)?t:t+""}function tm(e,t,r){return t=nm(t),function(e,t){if(t&&("object"===Jy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,rm()?Reflect.construct(t,r||[],nm(e).constructor):t.apply(e,r))}function rm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(rm=function(){return!!e})()}function nm(e){return nm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},nm(e)}function im(e,t){return im=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},im(e,t)}yl.registerComponent("playerOverlay",$y),function(e){e.Default="play",e.Hover="hover"}(Qy||(Qy={}));var om=yl.getPlugin("plugin"),am="cv-preview-mode",sm=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=tm(this,t,[e])).buttonAdded=!1,r.mode=null,r}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&im(e,t)}(t,e),r=t,(n=[{key:"getMode",value:function(){return this.mode}},{key:"setPlayerMode",value:function(e,t){var r=this.mode;if(this.mode=e,e===Qy.Hover)return this.buttonAdded||this.addButtons(t),this.player.addClass(am),this.enableSubtites(),this.mute(),this.removeActivityTimeout(),void this.player.trigger("resize");r===Qy.Hover&&(this.player.removeClass(am),this.disableSubtitles(),this.unmute(),this.restoreActivityTimeout(),this.player.trigger("resize"))}},{key:"addButtons",value:function(e){var t=new Vy(this.player),r=new $y(this.player,{onClickHandler:e});this.player.addChild(t),this.player.addChild(r),this.buttonAdded=!0}},{key:"enableSubtites",value:function(){var e=this;this.player.dataLoaded((function(){return e.player.persistSubtitleSettingsPlugin().previewModeSubtitles()}))}},{key:"disableSubtitles",value:function(){var e=this;this.player.dataLoaded((function(){return e.player.persistSubtitleSettingsPlugin().applyUserPreferences()}))}},{key:"mute",value:function(){var e=this;this.player.ready((function(){e.player.persistVolumePlugin().disable(),e.player.muted(!0)}))}},{key:"unmute",value:function(){var e=this;this.player.ready((function(){e.player.persistVolumePlugin().applyUserPreferences(),e.player.persistVolumePlugin().enable()}))}},{key:"removeActivityTimeout",value:function(){this.player.cache_.inactivityTimeout=this.player.options_.inactivityTimeout,this.player.options_.inactivityTimeout=0}},{key:"restoreActivityTimeout",value:function(){this.player.options_.inactivityTimeout=this.player.cache_.inactivityTimeout}}])&&Zy(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(om);function um(e){return um="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},um(e)}function lm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cm(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,hm(n.key),n)}}function fm(e,t,r){return t&&cm(e.prototype,t),r&&cm(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function hm(e){var t=function(e,t){if("object"!=um(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=um(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==um(t)?t:t+""}function pm(e,t,r){return t=ym(t),function(e,t){if(t&&("object"===um(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,dm()?Reflect.construct(t,r||[],ym(e).constructor):t.apply(e,r))}function dm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(dm=function(){return!!e})()}function ym(e){return ym=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ym(e)}function mm(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&&vm(e,t)}function vm(e,t){return vm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vm(e,t)}yl.registerPlugin("playerModePlugin",sm);var gm=yl.getComponent("Component"),bm=yl.getComponent("ClickableComponent"),_m=function(e){function t(e,r){return lm(this,t),pm(this,t,[e,r])}return mm(t,e),fm(t,[{key:"createEl",value:function(){return gm.prototype.createEl.call(this,"span",{className:"cv-favourite-button-svg",innerHTML:this.options_.fill?'\n <svg version="1.1" viewBox="0 0 24 24">\n <path id="Heart-Filled" d="m18.833 5.9735c-0.78916-0.95022-1.8839-1.4735-3.0826-1.4735-1.6859 0-2.7532 1.0685-3.3517 1.9648-0.15528 0.2326-0.28738 0.46582-0.39828 0.68529-0.11091-0.21946-0.24297-0.45269-0.39828-0.68529-0.5985-0.89636-1.6658-1.9648-3.3517-1.9648-1.1987 0-2.2935 0.52333-3.0827 1.4735-0.75275 0.90644-1.1673 2.1204-1.1673 3.4183 0 1.4128 0.51978 2.7268 1.6358 4.1353 0.99741 1.2588 2.4323 2.5564 4.0939 4.0589 0.61916 0.5599 1.2594 1.1389 1.9411 1.7718l0.02047 0.01903c0.08837 0.08211 0.19856 0.12313 0.30875 0.12313s0.22038-0.04105 0.30875-0.12313l0.02047-0.01903c0.68166-0.63289 1.3219-1.2119 1.9412-1.7719 1.6615-1.5024 3.0964-2.8 4.0938-4.0588 1.116-1.4085 1.6358-2.7225 1.6358-4.1353 0-1.2979-0.41459-2.5119-1.1674-3.4183z"/>\n </svg>\n':'\n <svg version="1.1" viewBox="0 0 24 24">\n <path id="Shape" d="m18.959 5.9741c-0.76992-0.92705-1.9357-1.5351-3.1052-1.5351-1.6448 0-2.8808 0.74937-3.4647 1.6238-0.15149 0.22693-0.28074 0.55125-0.38894 0.76537-0.10821-0.21411-0.23718-0.53844-0.38871-0.76537-0.58391-0.87451-1.8205-1.6238-3.4653-1.6238-1.1695 0-2.2376 0.60808-3.0075 1.5351-0.7344 0.88434-1.1388 1.9712-1.1388 3.2374 0 1.3784 0.50711 3.0509 1.5959 4.4251 0.97309 1.2281 2.373 2.4941 3.9941 3.9599 0.60406 0.54625 1.2285 1.1104 1.8936 1.7278l0.01997 0.01934c0.08622 0.08011 0.38931 0.21727 0.49681 0.21727 0.1075 0 0.40992-0.13796 0.49614-0.21804l0.0201-0.0178c0.66504-0.61746 1.2897-1.1824 1.8939-1.7287 1.621-1.4658 3.0209-2.7317 3.994-3.9598 1.0888-1.3742 1.5955-3.0467 1.5955-4.4251 0-1.2663-0.30646-2.3531-1.0409-3.2374zm-5.337 10.688c-0.51948 0.47226-1.0567 0.95549-1.6218 1.4768-0.56507-0.52124-1.101-1.0059-1.6219-1.4769-3.1725-2.8689-5.2684-4.7641-5.2684-7.2556 0-1.0298 0.32333-1.9863 0.91044-2.6933 0.59385-0.71497 1.4183-1.1088 2.3213-1.1088 1.254 0 2.0645 0.81976 2.5237 1.5074 0.41187 0.61679 0.62678 1.2385 0.70006 1.4772 0.06131 0.19978 0.23683 0.33499 0.43482 0.33499s0.37351-0.1352 0.43482-0.33499c0.07329-0.23867 0.28821-0.86044 0.70006-1.4773 0.45914-0.68766 1.2698-1.5074 2.5237-1.5074 0.90309 0 1.7274 0.39377 2.3213 1.1088 0.58714 0.70695 0.91047 1.6634 0.91047 2.6933 0 2.4914-2.1035 4.3783-5.2685 7.2557z" stroke-width=".97562"/>\n </svg>\n'})}}])}(gm),wm=function(e){function t(e,r){var n;return lm(this,t),(n=pm(this,t,[e,r])).isFavourited=r.isFavourited,n.update(),n.bindEventListeners(),n}return mm(t,e),fm(t,[{key:"bindEventListeners",value:function(){this.onMouseEnter=this.onMouseEnter.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.on("mouseenter",this.onMouseEnter.bind(this)),this.on("mouseleave",this.onMouseLeave.bind(this))}},{key:"dispose",value:function(){this.off("mouseenter"),this.off("mouseleave")}},{key:"onMouseEnter",value:function(){this.isHovering=!0,this.update()}},{key:"onMouseLeave",value:function(){this.isHovering=!1,this.update()}},{key:"update",value:function(){this.icon&&this.removeChild(this.icon),this.icon=new _m(this.player_,{fill:this.isFavourited||this.isHovering}),this.addChild(this.icon),this.isFavourited||this.isHovering?this.addClass("cv-favourited"):this.removeClass("cv-favourited")}},{key:"createEl",value:function(e,t,r){t=Object.assign({innerHTML:"",className:"cv-favourite-button"},t),r=Object.assign({type:"button"},r);var n=gm.prototype.createEl.call(this,"button",t,r);return this.createControlTextEl(n),n}},{key:"handleClick",value:function(){if(this.isFavourited=!this.isFavourited,this.update(),this.options_.clickHandler){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.options_.clickHandler.call(this,t)}}}])}(bm);function Tm(e){return Tm="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},Tm(e)}function Sm(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Em(n.key),n)}}function Em(e){var t=function(e,t){if("object"!=Tm(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Tm(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Tm(t)?t:t+""}function Om(e,t,r){return t=Cm(t),function(e,t){if(t&&("object"===Tm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,km()?Reflect.construct(t,r||[],Cm(e).constructor):t.apply(e,r))}function km(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(km=function(){return!!e})()}function Cm(e){return Cm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Cm(e)}function Pm(e,t){return Pm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Pm(e,t)}wm.prototype.controlText_="Favourite";var xm=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Om(this,t,arguments)}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pm(e,t)}(t,e),r=t,(n=[{key:"setFavourite",value:function(e,t){var r=this;e!==this.isFavourite&&(this.isFavourite=e,this.onClickFavourite=t,this.player.ready((function(){r.renderFavouriteButton()})))}},{key:"renderFavouriteButton",value:function(){this.button&&this.player.removeChild(this.button),this.button=new wm(this.player,{isFavourited:this.isFavourite,clickHandler:this.onClickFavourite}),this.player.addChild(this.button)}}])&&Sm(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getPlugin("plugin"));yl.registerPlugin("favouritePlugin",xm),r(94386),r(98457);var jm=r(15206),Lm=r.n(jm),Im=(r(15296),r(48868),r(96609),r(92274),r(68268),r(81874),r(31341),r(54861),r(50200)),Am=r.n(Im),Rm=r(40001),Dm=r.n(Rm),Mm=r(98511),Nm=r.n(Mm),Bm=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var r=-1;return e.some((function(e,n){return e[0]===t&&(r=n,!0)})),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var r=e(this.__entries__,t),n=this.__entries__[r];return n&&n[1]},t.prototype.set=function(t,r){var n=e(this.__entries__,t);~n?this.__entries__[n][1]=r:this.__entries__.push([t,r])},t.prototype.delete=function(t){var r=this.__entries__,n=e(r,t);~n&&r.splice(n,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var r=0,n=this.__entries__;r<n.length;r++){var i=n[r];e.call(t,i[1],i[0])}},t}()}(),Um="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,Fm=void 0!==r.g&&r.g.Math===Math?r.g:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),Vm="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(Fm):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)},Hm=["top","right","bottom","left","width","height","size","weight"],qm="undefined"!=typeof MutationObserver,zm=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var r=!1,n=!1,i=0;function o(){r&&(r=!1,e()),n&&s()}function a(){Vm(o)}function s(){var e=Date.now();if(r){if(e-i<2)return;n=!0}else r=!0,n=!1,setTimeout(a,t);i=e}return s}(this.refresh.bind(this),20)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,r=t.indexOf(e);~r&&t.splice(r,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){Um&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),qm?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){Um&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,r=void 0===t?"":t;Hm.some((function(e){return!!~r.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Wm=function(e,t){for(var r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},Gm=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||Fm},Xm=Jm(0,0,0,0);function Km(e){return parseFloat(e)||0}function Ym(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.reduce((function(t,r){return t+Km(e["border-"+r+"-width"])}),0)}var Qm="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof Gm(e).SVGGraphicsElement}:function(e){return e instanceof Gm(e).SVGElement&&"function"==typeof e.getBBox};function $m(e){return Um?Qm(e)?function(e){var t=e.getBBox();return Jm(0,0,t.width,t.height)}(e):function(e){var t=e.clientWidth,r=e.clientHeight;if(!t&&!r)return Xm;var n=Gm(e).getComputedStyle(e),i=function(e){for(var t={},r=0,n=["top","right","bottom","left"];r<n.length;r++){var i=n[r],o=e["padding-"+i];t[i]=Km(o)}return t}(n),o=i.left+i.right,a=i.top+i.bottom,s=Km(n.width),u=Km(n.height);if("border-box"===n.boxSizing&&(Math.round(s+o)!==t&&(s-=Ym(n,"left","right")+o),Math.round(u+a)!==r&&(u-=Ym(n,"top","bottom")+a)),!function(e){return e===Gm(e).document.documentElement}(e)){var l=Math.round(s+o)-t,c=Math.round(u+a)-r;1!==Math.abs(l)&&(s-=l),1!==Math.abs(c)&&(u-=c)}return Jm(i.left,i.top,s,u)}(e):Xm}function Jm(e,t,r,n){return{x:e,y:t,width:r,height:n}}var Zm=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Jm(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=$m(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),ev=function(e,t){var r,n,i,o,a,s,u,l=(n=(r=t).x,i=r.y,o=r.width,a=r.height,s="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,u=Object.create(s.prototype),Wm(u,{x:n,y:i,width:o,height:a,top:i,right:n+o,bottom:a+i,left:n}),u);Wm(this,{target:e,contentRect:l})},tv=function(){function e(e,t,r){if(this.activeObservations_=[],this.observations_=new Bm,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=r}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof Gm(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new Zm(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof Gm(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new ev(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),rv="undefined"!=typeof WeakMap?new WeakMap:new Bm,nv=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=zm.getInstance(),n=new tv(t,r,this);rv.set(this,n)};["observe","unobserve","disconnect"].forEach((function(e){nv.prototype[e]=function(){var t;return(t=rv.get(this))[e].apply(t,arguments)}}));const iv=void 0!==Fm.ResizeObserver?Fm.ResizeObserver:nv;r(82937),r(66403),r(42295),r(52963),r(34994);var ov=null,av=null;function sv(){if(null===ov){if("undefined"==typeof document)return ov=0;var e=document.body,t=document.createElement("div");t.classList.add("simplebar-hide-scrollbar"),e.appendChild(t);var r=t.getBoundingClientRect().right;e.removeChild(t),ov=r}return ov}Lm()&&window.addEventListener("resize",(function(){av!==window.devicePixelRatio&&(av=window.devicePixelRatio,ov=null)}));var uv=function(e){return Array.prototype.reduce.call(e,(function(e,t){var r=t.name.match(/data-simplebar-(.+)/);if(r){var n=r[1].replace(/\W+(.)/g,(function(e,t){return t.toUpperCase()}));switch(t.value){case"true":e[n]=!0;break;case"false":e[n]=!1;break;case void 0:e[n]=!0;break;default:e[n]=t.value}}return e}),{})};function lv(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window}function cv(e){return e&&e.ownerDocument?e.ownerDocument:document}var fv=function(){function e(t,r){var n=this;this.onScroll=function(){var e=lv(n.el);n.scrollXTicking||(e.requestAnimationFrame(n.scrollX),n.scrollXTicking=!0),n.scrollYTicking||(e.requestAnimationFrame(n.scrollY),n.scrollYTicking=!0)},this.scrollX=function(){n.axis.x.isOverflowing&&(n.showScrollbar("x"),n.positionScrollbar("x")),n.scrollXTicking=!1},this.scrollY=function(){n.axis.y.isOverflowing&&(n.showScrollbar("y"),n.positionScrollbar("y")),n.scrollYTicking=!1},this.onMouseEnter=function(){n.showScrollbar("x"),n.showScrollbar("y")},this.onMouseMove=function(e){n.mouseX=e.clientX,n.mouseY=e.clientY,(n.axis.x.isOverflowing||n.axis.x.forceVisible)&&n.onMouseMoveForAxis("x"),(n.axis.y.isOverflowing||n.axis.y.forceVisible)&&n.onMouseMoveForAxis("y")},this.onMouseLeave=function(){n.onMouseMove.cancel(),(n.axis.x.isOverflowing||n.axis.x.forceVisible)&&n.onMouseLeaveForAxis("x"),(n.axis.y.isOverflowing||n.axis.y.forceVisible)&&n.onMouseLeaveForAxis("y"),n.mouseX=-1,n.mouseY=-1},this.onWindowResize=function(){n.scrollbarWidth=n.getScrollbarWidth(),n.hideNativeScrollbar()},this.hideScrollbars=function(){n.axis.x.track.rect=n.axis.x.track.el.getBoundingClientRect(),n.axis.y.track.rect=n.axis.y.track.el.getBoundingClientRect(),n.isWithinBounds(n.axis.y.track.rect)||(n.axis.y.scrollbar.el.classList.remove(n.classNames.visible),n.axis.y.isVisible=!1),n.isWithinBounds(n.axis.x.track.rect)||(n.axis.x.scrollbar.el.classList.remove(n.classNames.visible),n.axis.x.isVisible=!1)},this.onPointerEvent=function(e){var t,r;n.axis.x.track.rect=n.axis.x.track.el.getBoundingClientRect(),n.axis.y.track.rect=n.axis.y.track.el.getBoundingClientRect(),(n.axis.x.isOverflowing||n.axis.x.forceVisible)&&(t=n.isWithinBounds(n.axis.x.track.rect)),(n.axis.y.isOverflowing||n.axis.y.forceVisible)&&(r=n.isWithinBounds(n.axis.y.track.rect)),(t||r)&&(e.preventDefault(),e.stopPropagation(),"mousedown"===e.type&&(t&&(n.axis.x.scrollbar.rect=n.axis.x.scrollbar.el.getBoundingClientRect(),n.isWithinBounds(n.axis.x.scrollbar.rect)?n.onDragStart(e,"x"):n.onTrackClick(e,"x")),r&&(n.axis.y.scrollbar.rect=n.axis.y.scrollbar.el.getBoundingClientRect(),n.isWithinBounds(n.axis.y.scrollbar.rect)?n.onDragStart(e,"y"):n.onTrackClick(e,"y"))))},this.drag=function(t){var r=n.axis[n.draggedAxis].track,i=r.rect[n.axis[n.draggedAxis].sizeAttr],o=n.axis[n.draggedAxis].scrollbar,a=n.contentWrapperEl[n.axis[n.draggedAxis].scrollSizeAttr],s=parseInt(n.elStyles[n.axis[n.draggedAxis].sizeAttr],10);t.preventDefault(),t.stopPropagation();var u=(("y"===n.draggedAxis?t.pageY:t.pageX)-r.rect[n.axis[n.draggedAxis].offsetAttr]-n.axis[n.draggedAxis].dragOffset)/(i-o.size)*(a-s);"x"===n.draggedAxis&&(u=n.isRtl&&e.getRtlHelpers().isRtlScrollbarInverted?u-(i+o.size):u,u=n.isRtl&&e.getRtlHelpers().isRtlScrollingInverted?-u:u),n.contentWrapperEl[n.axis[n.draggedAxis].scrollOffsetAttr]=u},this.onEndDrag=function(e){var t=cv(n.el),r=lv(n.el);e.preventDefault(),e.stopPropagation(),n.el.classList.remove(n.classNames.dragging),t.removeEventListener("mousemove",n.drag,!0),t.removeEventListener("mouseup",n.onEndDrag,!0),n.removePreventClickId=r.setTimeout((function(){t.removeEventListener("click",n.preventClick,!0),t.removeEventListener("dblclick",n.preventClick,!0),n.removePreventClickId=null}))},this.preventClick=function(e){e.preventDefault(),e.stopPropagation()},this.el=t,this.minScrollbarWidth=20,this.options=Object.assign({},e.defaultOptions,{},r),this.classNames=Object.assign({},e.defaultOptions.classNames,{},this.options.classNames),this.axis={x:{scrollOffsetAttr:"scrollLeft",sizeAttr:"width",scrollSizeAttr:"scrollWidth",offsetSizeAttr:"offsetWidth",offsetAttr:"left",overflowAttr:"overflowX",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}},y:{scrollOffsetAttr:"scrollTop",sizeAttr:"height",scrollSizeAttr:"scrollHeight",offsetSizeAttr:"offsetHeight",offsetAttr:"top",overflowAttr:"overflowY",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}}},this.removePreventClickId=null,e.instances.has(this.el)||(this.recalculate=Am()(this.recalculate.bind(this),64),this.onMouseMove=Am()(this.onMouseMove.bind(this),64),this.hideScrollbars=Dm()(this.hideScrollbars.bind(this),this.options.timeout),this.onWindowResize=Dm()(this.onWindowResize.bind(this),64,{leading:!0}),e.getRtlHelpers=Nm()(e.getRtlHelpers),this.init())}e.getRtlHelpers=function(){var t=document.createElement("div");t.innerHTML='<div class="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"></div></div>';var r=t.firstElementChild;document.body.appendChild(r);var n=r.firstElementChild;r.scrollLeft=0;var i=e.getOffset(r),o=e.getOffset(n);r.scrollLeft=999;var a=e.getOffset(n);return{isRtlScrollingInverted:i.left!==o.left&&o.left-a.left!=0,isRtlScrollbarInverted:i.left!==o.left}},e.getOffset=function(e){var t=e.getBoundingClientRect(),r=cv(e),n=lv(e);return{top:t.top+(n.pageYOffset||r.documentElement.scrollTop),left:t.left+(n.pageXOffset||r.documentElement.scrollLeft)}};var t=e.prototype;return t.init=function(){e.instances.set(this.el,this),Lm()&&(this.initDOM(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())},t.initDOM=function(){var e=this;if(Array.prototype.filter.call(this.el.children,(function(t){return t.classList.contains(e.classNames.wrapper)})).length)this.wrapperEl=this.el.querySelector("."+this.classNames.wrapper),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector("."+this.classNames.contentWrapper),this.contentEl=this.options.contentNode||this.el.querySelector("."+this.classNames.contentEl),this.offsetEl=this.el.querySelector("."+this.classNames.offset),this.maskEl=this.el.querySelector("."+this.classNames.mask),this.placeholderEl=this.findChild(this.wrapperEl,"."+this.classNames.placeholder),this.heightAutoObserverWrapperEl=this.el.querySelector("."+this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl=this.el.querySelector("."+this.classNames.heightAutoObserverEl),this.axis.x.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.horizontal),this.axis.y.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.vertical);else{for(this.wrapperEl=document.createElement("div"),this.contentWrapperEl=document.createElement("div"),this.offsetEl=document.createElement("div"),this.maskEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.placeholderEl=document.createElement("div"),this.heightAutoObserverWrapperEl=document.createElement("div"),this.heightAutoObserverEl=document.createElement("div"),this.wrapperEl.classList.add(this.classNames.wrapper),this.contentWrapperEl.classList.add(this.classNames.contentWrapper),this.offsetEl.classList.add(this.classNames.offset),this.maskEl.classList.add(this.classNames.mask),this.contentEl.classList.add(this.classNames.contentEl),this.placeholderEl.classList.add(this.classNames.placeholder),this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.contentWrapperEl.appendChild(this.contentEl),this.offsetEl.appendChild(this.contentWrapperEl),this.maskEl.appendChild(this.offsetEl),this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl),this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl),this.wrapperEl.appendChild(this.maskEl),this.wrapperEl.appendChild(this.placeholderEl),this.el.appendChild(this.wrapperEl)}if(!this.axis.x.track.el||!this.axis.y.track.el){var t=document.createElement("div"),r=document.createElement("div");t.classList.add(this.classNames.track),r.classList.add(this.classNames.scrollbar),t.appendChild(r),this.axis.x.track.el=t.cloneNode(!0),this.axis.x.track.el.classList.add(this.classNames.horizontal),this.axis.y.track.el=t.cloneNode(!0),this.axis.y.track.el.classList.add(this.classNames.vertical),this.el.appendChild(this.axis.x.track.el),this.el.appendChild(this.axis.y.track.el)}this.axis.x.scrollbar.el=this.axis.x.track.el.querySelector("."+this.classNames.scrollbar),this.axis.y.scrollbar.el=this.axis.y.track.el.querySelector("."+this.classNames.scrollbar),this.options.autoHide||(this.axis.x.scrollbar.el.classList.add(this.classNames.visible),this.axis.y.scrollbar.el.classList.add(this.classNames.visible)),this.el.setAttribute("data-simplebar","init")},t.initListeners=function(){var e=this,t=lv(this.el);this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach((function(t){e.el.addEventListener(t,e.onPointerEvent,!0)})),["touchstart","touchend","touchmove"].forEach((function(t){e.el.addEventListener(t,e.onPointerEvent,{capture:!0,passive:!0})})),this.el.addEventListener("mousemove",this.onMouseMove),this.el.addEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl.addEventListener("scroll",this.onScroll),t.addEventListener("resize",this.onWindowResize);var r=!1,n=t.ResizeObserver||iv;this.resizeObserver=new n((function(){r&&e.recalculate()})),this.resizeObserver.observe(this.el),this.resizeObserver.observe(this.contentEl),t.requestAnimationFrame((function(){r=!0})),this.mutationObserver=new t.MutationObserver(this.recalculate),this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})},t.recalculate=function(){var e=lv(this.el);this.elStyles=e.getComputedStyle(this.el),this.isRtl="rtl"===this.elStyles.direction;var t=this.heightAutoObserverEl.offsetHeight<=1,r=this.heightAutoObserverEl.offsetWidth<=1,n=this.contentEl.offsetWidth,i=this.contentWrapperEl.offsetWidth,o=this.elStyles.overflowX,a=this.elStyles.overflowY;this.contentEl.style.padding=this.elStyles.paddingTop+" "+this.elStyles.paddingRight+" "+this.elStyles.paddingBottom+" "+this.elStyles.paddingLeft,this.wrapperEl.style.margin="-"+this.elStyles.paddingTop+" -"+this.elStyles.paddingRight+" -"+this.elStyles.paddingBottom+" -"+this.elStyles.paddingLeft;var s=this.contentEl.scrollHeight,u=this.contentEl.scrollWidth;this.contentWrapperEl.style.height=t?"auto":"100%",this.placeholderEl.style.width=r?n+"px":"auto",this.placeholderEl.style.height=s+"px";var l=this.contentWrapperEl.offsetHeight;this.axis.x.isOverflowing=u>n,this.axis.y.isOverflowing=s>l,this.axis.x.isOverflowing="hidden"!==o&&this.axis.x.isOverflowing,this.axis.y.isOverflowing="hidden"!==a&&this.axis.y.isOverflowing,this.axis.x.forceVisible="x"===this.options.forceVisible||!0===this.options.forceVisible,this.axis.y.forceVisible="y"===this.options.forceVisible||!0===this.options.forceVisible,this.hideNativeScrollbar();var c=this.axis.x.isOverflowing?this.scrollbarWidth:0,f=this.axis.y.isOverflowing?this.scrollbarWidth:0;this.axis.x.isOverflowing=this.axis.x.isOverflowing&&u>i-f,this.axis.y.isOverflowing=this.axis.y.isOverflowing&&s>l-c,this.axis.x.scrollbar.size=this.getScrollbarSize("x"),this.axis.y.scrollbar.size=this.getScrollbarSize("y"),this.axis.x.scrollbar.el.style.width=this.axis.x.scrollbar.size+"px",this.axis.y.scrollbar.el.style.height=this.axis.y.scrollbar.size+"px",this.positionScrollbar("x"),this.positionScrollbar("y"),this.toggleTrackVisibility("x"),this.toggleTrackVisibility("y")},t.getScrollbarSize=function(e){if(void 0===e&&(e="y"),!this.axis[e].isOverflowing)return 0;var t,r=this.contentEl[this.axis[e].scrollSizeAttr],n=this.axis[e].track.el[this.axis[e].offsetSizeAttr],i=n/r;return t=Math.max(~~(i*n),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(t=Math.min(t,this.options.scrollbarMaxSize)),t},t.positionScrollbar=function(t){if(void 0===t&&(t="y"),this.axis[t].isOverflowing){var r=this.contentWrapperEl[this.axis[t].scrollSizeAttr],n=this.axis[t].track.el[this.axis[t].offsetSizeAttr],i=parseInt(this.elStyles[this.axis[t].sizeAttr],10),o=this.axis[t].scrollbar,a=this.contentWrapperEl[this.axis[t].scrollOffsetAttr],s=(a="x"===t&&this.isRtl&&e.getRtlHelpers().isRtlScrollingInverted?-a:a)/(r-i),u=~~((n-o.size)*s);u="x"===t&&this.isRtl&&e.getRtlHelpers().isRtlScrollbarInverted?u+(n-o.size):u,o.el.style.transform="x"===t?"translate3d("+u+"px, 0, 0)":"translate3d(0, "+u+"px, 0)"}},t.toggleTrackVisibility=function(e){void 0===e&&(e="y");var t=this.axis[e].track.el,r=this.axis[e].scrollbar.el;this.axis[e].isOverflowing||this.axis[e].forceVisible?(t.style.visibility="visible",this.contentWrapperEl.style[this.axis[e].overflowAttr]="scroll"):(t.style.visibility="hidden",this.contentWrapperEl.style[this.axis[e].overflowAttr]="hidden"),this.axis[e].isOverflowing?r.style.display="block":r.style.display="none"},t.hideNativeScrollbar=function(){this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?"-"+this.scrollbarWidth+"px":0,this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?"-"+this.scrollbarWidth+"px":0},t.onMouseMoveForAxis=function(e){void 0===e&&(e="y"),this.axis[e].track.rect=this.axis[e].track.el.getBoundingClientRect(),this.axis[e].scrollbar.rect=this.axis[e].scrollbar.el.getBoundingClientRect(),this.isWithinBounds(this.axis[e].scrollbar.rect)?this.axis[e].scrollbar.el.classList.add(this.classNames.hover):this.axis[e].scrollbar.el.classList.remove(this.classNames.hover),this.isWithinBounds(this.axis[e].track.rect)?(this.showScrollbar(e),this.axis[e].track.el.classList.add(this.classNames.hover)):this.axis[e].track.el.classList.remove(this.classNames.hover)},t.onMouseLeaveForAxis=function(e){void 0===e&&(e="y"),this.axis[e].track.el.classList.remove(this.classNames.hover),this.axis[e].scrollbar.el.classList.remove(this.classNames.hover)},t.showScrollbar=function(e){void 0===e&&(e="y");var t=this.axis[e].scrollbar.el;this.axis[e].isVisible||(t.classList.add(this.classNames.visible),this.axis[e].isVisible=!0),this.options.autoHide&&this.hideScrollbars()},t.onDragStart=function(e,t){void 0===t&&(t="y");var r=cv(this.el),n=lv(this.el),i=this.axis[t].scrollbar,o="y"===t?e.pageY:e.pageX;this.axis[t].dragOffset=o-i.rect[this.axis[t].offsetAttr],this.draggedAxis=t,this.el.classList.add(this.classNames.dragging),r.addEventListener("mousemove",this.drag,!0),r.addEventListener("mouseup",this.onEndDrag,!0),null===this.removePreventClickId?(r.addEventListener("click",this.preventClick,!0),r.addEventListener("dblclick",this.preventClick,!0)):(n.clearTimeout(this.removePreventClickId),this.removePreventClickId=null)},t.onTrackClick=function(e,t){var r=this;if(void 0===t&&(t="y"),this.options.clickOnTrack){var n=lv(this.el);this.axis[t].scrollbar.rect=this.axis[t].scrollbar.el.getBoundingClientRect();var i=this.axis[t].scrollbar.rect[this.axis[t].offsetAttr],o=parseInt(this.elStyles[this.axis[t].sizeAttr],10),a=this.contentWrapperEl[this.axis[t].scrollOffsetAttr],s=("y"===t?this.mouseY-i:this.mouseX-i)<0?-1:1,u=-1===s?a-o:a+o;!function e(){var i,o;-1===s?a>u&&(a-=r.options.clickOnTrackSpeed,r.contentWrapperEl.scrollTo(((i={})[r.axis[t].offsetAttr]=a,i)),n.requestAnimationFrame(e)):a<u&&(a+=r.options.clickOnTrackSpeed,r.contentWrapperEl.scrollTo(((o={})[r.axis[t].offsetAttr]=a,o)),n.requestAnimationFrame(e))}()}},t.getContentElement=function(){return this.contentEl},t.getScrollElement=function(){return this.contentWrapperEl},t.getScrollbarWidth=function(){try{return"none"===getComputedStyle(this.contentWrapperEl,"::-webkit-scrollbar").display||"scrollbarWidth"in document.documentElement.style||"-ms-overflow-style"in document.documentElement.style?0:sv()}catch(e){return sv()}},t.removeListeners=function(){var e=this,t=lv(this.el);this.options.autoHide&&this.el.removeEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach((function(t){e.el.removeEventListener(t,e.onPointerEvent,!0)})),["touchstart","touchend","touchmove"].forEach((function(t){e.el.removeEventListener(t,e.onPointerEvent,{capture:!0,passive:!0})})),this.el.removeEventListener("mousemove",this.onMouseMove),this.el.removeEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl&&this.contentWrapperEl.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onWindowResize),this.mutationObserver&&this.mutationObserver.disconnect(),this.resizeObserver&&this.resizeObserver.disconnect(),this.recalculate.cancel(),this.onMouseMove.cancel(),this.hideScrollbars.cancel(),this.onWindowResize.cancel()},t.unMount=function(){this.removeListeners(),e.instances.delete(this.el)},t.isWithinBounds=function(e){return this.mouseX>=e.left&&this.mouseX<=e.left+e.width&&this.mouseY>=e.top&&this.mouseY<=e.top+e.height},t.findChild=function(e,t){var r=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector;return Array.prototype.filter.call(e.children,(function(e){return r.call(e,t)}))[0]},e}();fv.defaultOptions={autoHide:!0,forceVisible:!1,clickOnTrack:!0,clickOnTrackSpeed:40,classNames:{contentEl:"simplebar-content",contentWrapper:"simplebar-content-wrapper",offset:"simplebar-offset",mask:"simplebar-mask",wrapper:"simplebar-wrapper",placeholder:"simplebar-placeholder",scrollbar:"simplebar-scrollbar",track:"simplebar-track",heightAutoObserverWrapperEl:"simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"simplebar-height-auto-observer",visible:"simplebar-visible",horizontal:"simplebar-horizontal",vertical:"simplebar-vertical",hover:"simplebar-hover",dragging:"simplebar-dragging"},scrollbarMinSize:25,scrollbarMaxSize:0,timeout:1e3},fv.instances=new WeakMap,fv.initDOMLoadedElements=function(){document.removeEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.removeEventListener("load",this.initDOMLoadedElements),Array.prototype.forEach.call(document.querySelectorAll("[data-simplebar]"),(function(e){"init"===e.getAttribute("data-simplebar")||fv.instances.has(e)||new fv(e,uv(e.attributes))}))},fv.removeObserver=function(){this.globalObserver.disconnect()},fv.initHtmlApi=function(){this.initDOMLoadedElements=this.initDOMLoadedElements.bind(this),"undefined"!=typeof MutationObserver&&(this.globalObserver=new MutationObserver(fv.handleMutations),this.globalObserver.observe(document,{childList:!0,subtree:!0})),"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?window.setTimeout(this.initDOMLoadedElements):(document.addEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.addEventListener("load",this.initDOMLoadedElements))},fv.handleMutations=function(e){e.forEach((function(e){Array.prototype.forEach.call(e.addedNodes,(function(e){1===e.nodeType&&(e.hasAttribute("data-simplebar")?!fv.instances.has(e)&&new fv(e,uv(e.attributes)):Array.prototype.forEach.call(e.querySelectorAll("[data-simplebar]"),(function(e){"init"===e.getAttribute("data-simplebar")||fv.instances.has(e)||new fv(e,uv(e.attributes))})))})),Array.prototype.forEach.call(e.removedNodes,(function(e){1===e.nodeType&&(e.hasAttribute('[data-simplebar="init"]')?fv.instances.has(e)&&fv.instances.get(e).unMount():Array.prototype.forEach.call(e.querySelectorAll('[data-simplebar="init"]'),(function(e){fv.instances.has(e)&&fv.instances.get(e).unMount()})))}))}))},fv.getOptions=uv,Lm()&&fv.initHtmlApi();const hv=fv;function pv(e){return pv="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},pv(e)}function dv(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,yv(n.key),n)}}function yv(e){var t=function(e,t){if("object"!=pv(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=pv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==pv(t)?t:t+""}function mv(e,t,r){return t=bv(t),function(e,t){if(t&&("object"===pv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,vv()?Reflect.construct(t,r||[],bv(e).constructor):t.apply(e,r))}function vv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(vv=function(){return!!e})()}function gv(){return gv="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=bv(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},gv.apply(this,arguments)}function bv(e){return bv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},bv(e)}function _v(e,t){return _v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_v(e,t)}var wv=yl.getComponent("Menu"),Tv=wv.prototype,Sv=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),mv(this,t,arguments)}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_v(e,t)}(t,e),r=t,(n=[{key:"createEl",value:function(){var e=gv(bv(t.prototype),"createEl",this).call(this);return this.simpleBar=new hv(this.contentEl(),{autoHide:!1}),e}},{key:"contentEl",value:function(){return this.simpleBar?this.simpleBar.getContentElement():gv(bv(t.prototype),"contentEl",this).call(this)}},{key:"dispose",value:function(){this.simpleBar&&(this.simpleBar.unMount(),delete this.simpleBar),gv(bv(t.prototype),"dispose",this).call(this)}},{key:"addItem",value:function(e){gv(bv(t.prototype),"addItem",this).call(this,e),this.simpleBar.recalculate()}},{key:"lockShowing",value:function(){gv(bv(t.prototype),"lockShowing",this).call(this),this.simpleBar.recalculate()}},{key:"recalculateScrollBar",value:function(){this.simpleBar.recalculate()}},{key:"handleBlur",value:function(e){var t=e.relatedTarget||document.activeElement;this.el().contains(t)||Tv.handleBlur.call(this,e)}}])&&dv(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(wv);function Ev(e){return Ev="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},Ev(e)}function Ov(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,kv(n.key),n)}}function kv(e){var t=function(e,t){if("object"!=Ev(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Ev(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ev(t)?t:t+""}function Cv(e,t,r){return t=xv(t),function(e,t){if(t&&("object"===Ev(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Pv()?Reflect.construct(t,r||[],xv(e).constructor):t.apply(e,r))}function Pv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Pv=function(){return!!e})()}function xv(e){return xv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xv(e)}function jv(e,t){return jv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},jv(e,t)}Sv.originalProto=Tv,wv.prototype=Sv.prototype,yl.registerComponent("Menu",Sv);var Lv=yl.getComponent("Component"),Iv=yl.getComponent("MenuButton"),Av=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Cv(this,t,arguments)}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jv(e,t)}(t,e),r=t,n=[{key:"createMenu",value:function(){var e,t=new Sv(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var r=yl.dom.createEl("li",{className:"vjs-menu-title",innerHTML:(e=this.options_.title,"string"!=typeof e?e:e.replace(/./,(function(e){return e.toUpperCase()}))),tabIndex:-1});this.hideThreshold_+=1;var n=new Lv(this.player_,{el:r});t.addItem(n)}if(this.items=this.createItems(),this.items)for(var i=0;i<this.items.length;i++)t.addItem(this.items[i]);return t}}],n&&Ov(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Iv),Rv=Iv.prototype.pressButton;Iv.prototype.pressButton=function(){Rv.call(this),this.inactivityTimeout=this.player_.cache_.inactivityTimeout,this.player_.cache_.inactivityTimeout=0,this.player_.options_.inactivityTimeout=0};var Dv=Iv.prototype.unpressButton;function Mv(e){return Mv="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},Mv(e)}function Nv(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Bv(n.key),n)}}function Bv(e){var t=function(e,t){if("object"!=Mv(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Mv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Mv(t)?t:t+""}function Uv(e,t,r){return t=Hv(t),function(e,t){if(t&&("object"===Mv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Fv()?Reflect.construct(t,r||[],Hv(e).constructor):t.apply(e,r))}function Fv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fv=function(){return!!e})()}function Vv(){return Vv="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Hv(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Vv.apply(this,arguments)}function Hv(e){return Hv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Hv(e)}function qv(e,t){return qv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},qv(e,t)}Iv.prototype.unpressButton=function(){Dv.call(this),this.player_.cache_.inactivityTimeout=this.inactivityTimeout,this.player_.options_.inactivityTimeout=this.inactivityTimeout,this.player_.reportUserActivity()},yl.registerComponent("MenuButton",Av);var zv=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Uv(this,t,arguments)}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qv(e,t)}(t,e),r=t,(n=[{key:"buildCSSClass",value:function(){return"cv-time-wrapper ".concat(Vv(Hv(t.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(e,r,n){return Vv(Hv(t.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},r),{className:this.buildCSSClass()}),n)}}])&&Nv(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("Component"));function Wv(e){return Wv="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},Wv(e)}function Gv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xv(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Yv(n.key),n)}}function Kv(e,t,r){return t&&Xv(e.prototype,t),r&&Xv(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Yv(e){var t=function(e,t){if("object"!=Wv(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Wv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Wv(t)?t:t+""}function Qv(e,t,r){return t=Zv(t),function(e,t){if(t&&("object"===Wv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,$v()?Reflect.construct(t,r||[],Zv(e).constructor):t.apply(e,r))}function $v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($v=function(){return!!e})()}function Jv(){return Jv="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Zv(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Jv.apply(this,arguments)}function Zv(e){return Zv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Zv(e)}function eg(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&&tg(e,t)}function tg(e,t){return tg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},tg(e,t)}zv.prototype.options_={children:["currentTimeDisplay","remainingTimeDisplay"]},yl.registerComponent("TimeWrapper",zv);var rg=function(e){function t(e,r){return Gv(this,t),Qv(this,t,[e,r])}return eg(t,e),Kv(t,[{key:"handleClick",value:function(e){var r=this;Jv(Zv(t.prototype),"handleClick",this).call(this,e),this.requestAnimationFrame((function(){r.options_.item.showCollapsibleMenu()}))}},{key:"createEl",value:function(e,r,n){if(!this.options_.item)return Jv(Zv(t.prototype),"createEl",this).call(this,e,r,n);var i=this.options_.item.getCollabsibleName(),o=this.options_.item.getCollabsibleValue(),a=this.options_.item.className,s='<span class="vjs-menu-item-text">'.concat(i,"</span>");this.valueHolder_=yl.dom.createEl("span",{innerHTML:o});var u=Jv(Zv(t.prototype),"createEl",this).call(this,e,{className:"vjs-menu-item cv-cog-menu-item ".concat(o?"cv-has-cog-value":""," ").concat(a||"").trim(),innerHTML:s},n);return u.appendChild(this.valueHolder_),u}},{key:"updateCollapsibleValue",value:function(){this.valueHolder_.innerHTML=this.options_.item.getCollabsibleValue()}}])}(yl.getComponent("MenuItem")),ng=function(e){function t(e,r){return Gv(this,t),Qv(this,t,[e,r])}return eg(t,e),Kv(t,[{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-cog-menu-button ".concat(Jv(Zv(t.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"buildCSSClass",value:function(){return"cv-cog-button ".concat(Jv(Zv(t.prototype),"buildCSSClass",this).call(this))}},{key:"pressButton",value:function(){this.player_.options_.deferMenus?this.player_.deferMenusPlugin().deferMenu():(this.menu.children_.forEach((function(e){e.updateCollapsibleValue&&e.updateCollapsibleValue()})),Jv(Zv(t.prototype),"pressButton",this).call(this))}},{key:"createItems",value:function(){for(var e,t=this,r=[],n=0;n<this.options_.items.length;n++){var i=this.options_.items[n];i.isCollabsible&&i.showInCollabsibleMenu()&&i.isCollapsed&&r.push(new rg(this.player_,{item:i}))}return(null===(e=this.additionalItems)||void 0===e?void 0:e.length)&&this.additionalItems.forEach((function(e){var n,i=new e.ctor(t.player_,Object.assign(Object.assign({},t.options_),null!==(n=e.options)&&void 0!==n?n:{}));r.splice(e.index,0,i)})),r}},{key:"update",value:function(){Jv(Zv(t.prototype),"update",this).call(this),this.player_.trigger("resizemenus")}},{key:"addItem",value:function(e){this.additionalItems||(this.additionalItems=[]),this.additionalItems.some((function(t){return t.name===e.name}))||(this.additionalItems.push(e),this.update())}}])}(yl.getComponent("MenuButton"));function ig(e){return ig="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},ig(e)}function og(){return og="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=hg(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},og.apply(this,arguments)}function ag(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,lg(n.key),n)}}function ug(e,t,r){return t&&sg(e.prototype,t),r&&sg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function lg(e){var t=function(e,t){if("object"!=ig(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=ig(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ig(t)?t:t+""}function cg(e,t,r){return t=hg(t),function(e,t){if(t&&("object"===ig(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,fg()?Reflect.construct(t,r||[],hg(e).constructor):t.apply(e,r))}function fg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fg=function(){return!!e})()}function hg(e){return hg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hg(e)}function pg(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&&dg(e,t)}function dg(e,t){return dg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},dg(e,t)}yl.registerComponent("cogButton",ng);var yg=yl.getComponent("MenuItem"),mg=yl.getComponent("MenuButton"),vg=["large","medium","small"],gg=function(e){function t(e,r){return ag(this,t),cg(this,t,[e,r])}return pg(t,e),ug(t,[{key:"handleClick",value:function(){this.player_.textTrackSettings.setSizeSetting(this.options_.value)}}])}(yg),bg=function(e){function t(e,r){var n;return ag(this,t),(n=cg(this,t,[e,r])).alwaysCollapsed=!0,n.isCollapsed=!1,n.isCollabsible=!0,n.player_.ready((function(){n.update()})),n}return pg(t,e),ug(t,[{key:"createItems",value:function(){var e=this,t=this.player_.textTrackSettings;if(t){var r=t.getSizeSetting(),n=[new Pd(this.player_,{label:"Caption Text Size",onClickBack:function(){e.requestAnimationFrame((function(){e.player_.getChild("collapserator").getChild("subsCapsButton").pressButton()}))}})];return vg.map((function(t){n.push(new gg(e.player_,{label:t.charAt(0).toUpperCase()+t.substring(1),selectable:!0,multiSelectable:!1,selected:t===r,value:t}))})),n}}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-has-left-icons ".concat(og(hg(t.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"getCollabsibleName",value:function(){return"Subtitle Size"}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!1}},{key:"showCollapsibleMenu",value:function(){mg.prototype.handleClick.apply(this)}}])}(mg);yl.registerComponent("SubtitleSizeButton",bg);var _g=r(16951);function wg(e,t,r){if(e.length)for(var n=e.length-1;n>=0;n--){var i=e[n];if(i.kind===t){if(r&&i.label!==r)continue;return i}}}function Tg(e,t,r,n){e.kind===t&&(r&&e.label!==r||(e.loaded_?n(e):e.one("loadeddata",(function(){n(e)}))))}function Sg(e){if(null==e?void 0:e.cues.length)for(var t=0;t<e.cues.length;t++){var r=e.cues[t];(null==r?void 0:r.text)&&(r.text=0===(n=r.text)?"0":n?_g.sanitize(n.toString(),{ADD_ATTR:["target"]}).replace("&","&"):"")}var n}var Eg={getTrack:function(e,t,r){return wg(e.textTracks(),t,r)},useTrack:function(e,t,r,n){var i=e.textTracks(),o=wg(i,t,r);if(o)Tg(o,t,r,n);else{var a=function(e){Tg(e.track,t,r,n)};i.addEventListener("addtrack",a),e.one("dispose",(function(){i.removeEventListener("addtrack",a)}))}},getCurrentTextTrack:function(e){return this.findTrackByPredicate(e,(function(e){return"showing"===e.mode}))},findTrackByPredicate:function(e,t){if(!e)return null;for(var r=e.textTracks(),n=0;n<r.length;n++){var i=r[n];if(t(i))return i}return null},forEachTrack:function(e,t){if(e)for(var r=e.textTracks(),n=0;n<r.length;n++)t(r[n])},sanitizeTrack:function(e,t){if(e&&t)if(e.loaded)Sg(e);else{var r=function(){return Sg(e)};e.addEventListener("loadeddata",r),t.one("dispose",(function(){e.removeEventListener("loadeddata",r)}))}}};function Og(e){return Og="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},Og(e)}function kg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,xg(n.key),n)}}function Pg(e,t,r){return t&&Cg(e.prototype,t),r&&Cg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function xg(e){var t=function(e,t){if("object"!=Og(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Og(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Og(t)?t:t+""}function jg(e,t,r){return t=Ag(t),function(e,t){if(t&&("object"===Og(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Lg()?Reflect.construct(t,r||[],Ag(e).constructor):t.apply(e,r))}function Lg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Lg=function(){return!!e})()}function Ig(){return Ig="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ag(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Ig.apply(this,arguments)}function Ag(e){return Ag=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ag(e)}function Rg(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&&Dg(e,t)}function Dg(e,t){return Dg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Dg(e,t)}var Mg=yl.getComponent("MenuItem"),Ng=function(e){function t(e,r){var n;return kg(this,t),(n=jg(this,t,[e,r])).onChange=Jc(n.onChange,100,!1,n),n.bindEventListeners(),n}return Rg(t,e),Pg(t,[{key:"createEl",value:function(){var e=this.localize("Search");return Ig(Ag(t.prototype),"createEl",this).call(this,"li",{className:"vjs-menu-item ".concat(this.options_.className||"").trim(),innerHTML:'\n <div class="cv-search-input-menu-item">\n <span class="cv-search-icon">\n <svg viewBox="0 0 24 24">\n <path d="M15.803 14.306l3.917 3.954a1 1 0 0 1-.007 1.417l-.018.018-.018.018a.997.997 0 0 1-1.41 0l-3.918-3.953-.3.214c-1.14.713-2.323 1.07-3.549 1.07-1.796 0-3.328-.642-4.597-1.925C4.634 13.836 4 12.296 4 10.5c0-1.796.634-3.328 1.903-4.597C7.172 4.634 8.704 4 10.5 4c1.796 0 3.329.634 4.597 1.903 1.27 1.269 1.904 2.801 1.904 4.597a6.447 6.447 0 0 1-1.027 3.507l-.17.3zM10.5 5.368c-1.425 0-2.637.5-3.635 1.497-.998.998-1.497 2.21-1.497 3.635 0 1.426.5 2.637 1.497 3.635.998.998 2.21 1.497 3.635 1.497 1.426 0 2.637-.499 3.635-1.497 1.027-1.026 1.54-2.238 1.54-3.635 0-1.397-.513-2.608-1.54-3.635-.998-.998-2.21-1.497-3.635-1.497z"/>\n </svg>\n </span><input placeholder="'.concat(e,'" type="text" autocomplete="off" spellcheck="false" aria-label="').concat(e,'" />\n </div>\n ')})}},{key:"focus",value:function(){this.$("input").focus()}},{key:"handleClick",value:function(e){e.stopImmediatePropagation(),this.$("input").focus()}},{key:"handleKeyDown",value:function(){this.focus()}},{key:"bindEventListeners",value:function(){var e=this,t=this.$("input");this.onChange=this.onChange.bind(this),t.addEventListener("keyup",this.onChange),t.addEventListener("blur",(function(t){e.options_.menuButton.menu.handleBlur(t)}))}},{key:"onChange",value:function(e){var t=e.target;this.options_.search(t.value)}}])}(Mg);yl.registerComponent("SearchInputMenuItem",Ng);var Bg=function(e){function t(){return kg(this,t),jg(this,t,arguments)}return Rg(t,e),Pg(t,[{key:"createEl",value:function(e,r,n){return Ig(Ag(t.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},r),{className:"vjs-menu-item cv-no-results"}),n)}},{key:"setLabel",value:function(e){var t=this.$(".vjs-menu-item-text");t&&(t.innerHTML=e)}}])}(Mg);function Ug(e){return Ug="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},Ug(e)}function Fg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Vg(n.key),n)}}function Vg(e){var t=function(e,t){if("object"!=Ug(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Ug(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ug(t)?t:t+""}function Hg(e,t,r){return t=zg(t),function(e,t){if(t&&("object"===Ug(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,qg()?Reflect.construct(t,r||[],zg(e).constructor):t.apply(e,r))}function qg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qg=function(){return!!e})()}function zg(e){return zg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zg(e)}function Wg(e,t){return Wg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Wg(e,t)}yl.registerComponent("NoMatchingResultsMenuItem",Bg);var Gg=function(e){function t(e,r){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Hg(this,t,[e,r])}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wg(e,t)}(t,e),r=t,(n=[{key:"update",value:function(e,t){var r=this;if(null==e?void 0:e.length){var n=[],i=0;e.forEach((function(e){var o=r.options_.label.substr(i,e);o&&n.push(o),n.push('<span class="cv-highlight">'),n.push(r.options_.label.substr(e,t)),n.push("</span>"),i=e+t})),n.push(this.options_.label.substring(i,this.options_.label.length)),this.el().innerHTML='<span class="vjs-menu-item-text">'.concat(n.join(""),"</span>")}else this.el().innerHTML='<span class="vjs-menu-item-text">'.concat(this.options_.label,"</span>")}},{key:"handleClick",value:function(e){e.stopImmediatePropagation(),this.player_.currentTime(this.options_.cue.startTime)}}])&&Fg(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("MenuItem"));function Xg(e){return Xg="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},Xg(e)}function Kg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Yg(n.key),n)}}function Yg(e){var t=function(e,t){if("object"!=Xg(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Xg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Xg(t)?t:t+""}function Qg(e,t,r){return t=Zg(t),function(e,t){if(t&&("object"===Xg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,$g()?Reflect.construct(t,r||[],Zg(e).constructor):t.apply(e,r))}function $g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($g=function(){return!!e})()}function Jg(){return Jg="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Zg(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Jg.apply(this,arguments)}function Zg(e){return Zg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Zg(e)}function eb(e,t){return eb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},eb(e,t)}var tb=yl.getComponent("MenuButton"),rb=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Qg(this,t,[e,r])).alwaysCollapsed=!0,n.isCollapsed=!1,n.isCollabsible=!0,n.update=n.update.bind(n),n.search=n.search.bind(n),n.player_.textTracks().addEventListener("selectedlanguagechange",n.update),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eb(e,t)}(t,e),r=t,n=[{key:"bindTrackEvents",value:function(e){var t=this;e.removeEventListener("loadeddata",this.update),e.addEventListener("loadeddata",this.update),this.player_.one("dispose",(function(){e.removeEventListener("loadeddata",t.update)}))}},{key:"createItems",value:function(){var e,t=Eg.getCurrentTextTrack(this.player_);if(t){if(null===(e=t.cues)||void 0===e?void 0:e.length){for(var r=[new Ng(this.player_,{menuButton:this,search:this.search})],n=0;n<t.cues.length;n++){var i=t.cues[n];r.push(new Gg(this.player_,{cue:i,label:i.text,selected:!1,multiSelectable:!1}))}var o=new Bg(this.player_,{label:"No matching results",selected:!1,selectable:!1,multiSelectable:!1});return o.hide(),r.push(o),r}this.bindTrackEvents(t)}}},{key:"search",value:function(e){var t;e=e.trim();var r=Eg.getCurrentTextTrack(this.player_);if(null===(t=null==r?void 0:r.cues)||void 0===t?void 0:t.length){var n=this.findMatches(e,r);this.toggleItemVisibility(e,n),this.toggleNoResults(e,n)}}},{key:"findMatches",value:function(e,t){var r={};if(!e)return r;for(var n=new RegExp(e,"gi"),i=0;i<t.cues.length;i++){for(var o=t.cues[i].text,a=[],s=void 0;s=n.exec(o);)a.push(s.index);a.length&&(r[i]=a)}return r}},{key:"toggleItemVisibility",value:function(e,t){this.menu.children_.slice(1,this.menu.children_.length-1).forEach((function(r,n){!e||t[n]?r.show():r.hide(),r.update(t[n],e.length)}))}},{key:"toggleNoResults",value:function(e,t){var r=this.menu.children_[this.menu.children_.length-1];!e||Object.keys(t).length?r.hide():r.show()}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-big cv-subtitle-search-button ".concat(Jg(Zg(t.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"update",value:function(){Jg(Zg(t.prototype),"update",this).call(this),this.player_.trigger("resizemenus")}},{key:"pressButton",value:function(){Jg(Zg(t.prototype),"pressButton",this).call(this);var e=this.menu.children_[0];(null==e?void 0:e.focus)&&(null==e||e.focus())}},{key:"getCollabsibleName",value:function(){return"Subtitle Size"}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!1}},{key:"showCollapsibleMenu",value:function(){tb.prototype.handleClick.apply(this)}}],n&&Kg(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(tb);function nb(e){return nb="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},nb(e)}function ib(){return ib="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=fb(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},ib.apply(this,arguments)}function ob(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ab(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ub(n.key),n)}}function sb(e,t,r){return t&&ab(e.prototype,t),r&&ab(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ub(e){var t=function(e,t){if("object"!=nb(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=nb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==nb(t)?t:t+""}function lb(e,t,r){return t=fb(t),function(e,t){if(t&&("object"===nb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,cb()?Reflect.construct(t,r||[],fb(e).constructor):t.apply(e,r))}function cb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(cb=function(){return!!e})()}function fb(e){return fb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},fb(e)}function hb(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&&pb(e,t)}function pb(e,t){return pb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},pb(e,t)}yl.registerComponent("subtitleSearchButton",rb);var db=yl.getComponent("MenuItem"),yb=yl.getComponent("MenuButton"),mb=[{label:"Play / Pause",type:"play-pause"},{label:"Volume",type:"volume"},{label:"Mute",type:"mute"},{label:"Toggle fullscreen",type:"fullscreen"},{label:"Exit fullscreen",type:"exit-fullscreen"}],vb=function(e){function t(e,r){return ob(this,t),lb(this,t,[e,r])}return hb(t,e),sb(t,[{key:"createEl",value:function(){return yl.dom.createEl("li",{className:"vjs-menu-item",tabIndex:-1,innerHTML:'\n <span class="vjs-menu-item-text">'.concat(this.options_.label,"</span>\n <span>").concat(this.getDisplayHtml(this.options_.type),"\n ")})}},{key:"getDisplayHtml",value:function(e){switch(e){case"play-pause":return'<span class="cv-keyboard-button">Spacebar</span>';case"volume":return'<span class="cv-keyboard-button">Shift</span> + \n <span class="cv-keyboard-button cv-single-key">⇑</span> / \n <span class="cv-keyboard-button">Shift</span> +\n <span class="cv-keyboard-button cv-single-key">⇓</span>';case"mute":return'<span class="cv-keyboard-button cv-single-key">m</span>';case"fullscreen":return'<span class="cv-keyboard-button cv-single-key">f</span>';case"exit-fullscreen":return'<span class="cv-keyboard-button cv-single-key">esc</span>'}return""}}])}(db),gb=function(e){function t(){var e;return ob(this,t),(e=lb(this,t,arguments)).alwaysCollapsed=!0,e.isCollapsed=!1,e.isCollabsible=!0,e}return hb(t,e),sb(t,[{key:"createItems",value:function(){var e=this,t=[];return t.push(new Pd(this.player_,{label:"Keyboard Shortcuts"})),mb.forEach((function(r){t.push(new vb(e.player_,r))})),t}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-keyboard-shortcuts ".concat(ib(fb(t.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"getCollabsibleName",value:function(){return"Keyboard Shortcuts"}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!this.player_.options_.mobile}},{key:"showCollapsibleMenu",value:function(){yb.prototype.handleClick.apply(this)}}])}(yb);function bb(e){return bb="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},bb(e)}function _b(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,wb(n.key),n)}}function wb(e){var t=function(e,t){if("object"!=bb(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=bb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==bb(t)?t:t+""}function Tb(e,t,r){return t=Ob(t),function(e,t){if(t&&("object"===bb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Sb()?Reflect.construct(t,r||[],Ob(e).constructor):t.apply(e,r))}function Sb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Sb=function(){return!!e})()}function Eb(){return Eb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ob(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Eb.apply(this,arguments)}function Ob(e){return Ob=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ob(e)}function kb(e,t){return kb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},kb(e,t)}yl.registerComponent("KeyboardShortcutsButton",gb);var Cb="cv-collapsed",Pb=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Tb(this,t,[e,r])).addChild("cogButton",{items:n.children_},n.children_.length-1),n.update=n.update.bind(n),n.player_.on("cv-updatecog",n.update),n.player_.on("playerresize",n.update),n.player_.one("play",n.update),n.player_.on("dispose",(function(){n.player_.off("cv-updatecog",n.update),n.player_.off("playerresize",n.update),n.player_.off("play",n.update)})),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kb(e,t)}(t,e),r=t,n=[{key:"togglehidden",value:function(e){for(var t=0;t<this.children_.length;t++){var r=this.children_[t];r.isCollabsible&&(r.alwaysCollapsed||e?(r.isCollapsed=!0,r.addClass(Cb)):(r.isCollapsed=!1,r.removeClass(Cb)))}this.getChild("cogButton").update()}},{key:"update",value:function(){var e=this.player_.el().getBoundingClientRect();if(0!==e.width){this.addClass("cv-collapsorator-ready");var t=e.width<600;this.player_.options_.deferMenus&&(t=!0),this.togglehidden(t)}}},{key:"buildCSSClass",value:function(){return"cv-collapsorator ".concat(Eb(Ob(t.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(e,r,n){return Eb(Ob(t.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},r),{className:this.buildCSSClass()}),n)}}],n&&_b(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("Component"));yl.registerComponent("collapserator",Pb);var xb=["playToggle","volumePanel","customControlSpacer","playbackRateMenuButton","chaptersButton","qualityButton","keyboardShortcutsButton","subsCapsButton","whiteboardModeButton","subtitleSizeButton","subtitleSearchButton","fullscreenToggle"];function jb(e){return jb="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},jb(e)}function Lb(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ib(n.key),n)}}function Ib(e){var t=function(e,t){if("object"!=jb(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=jb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==jb(t)?t:t+""}function Ab(e,t,r){return t=Db(t),function(e,t){if(t&&("object"===jb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Rb()?Reflect.construct(t,r||[],Db(e).constructor):t.apply(e,r))}function Rb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Rb=function(){return!!e})()}function Db(e){return Db=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Db(e)}function Mb(e,t){return Mb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Mb(e,t)}var Nb=yl.getComponent("SeekBar"),Bb=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ab(this,t,arguments)}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mb(e,t)}(t,e),r=t,(n=[{key:"handleMouseDown",value:function(e){var t=this.player_.preventScrubbingPlugin();t.isEnabled&&this.getMouseTime(e)>t.furthestVisitedTime||(Nb.prototype.handleMouseDown.call(this,e),this.player_.addClass("cv-disable-play-pause-feedback"))}},{key:"handleMouseMove",value:function(e){Nb.prototype.handleMouseMove.call(this,e),this.update()}},{key:"getPercent",value:function(){var e=this.player_.currentTime()/this.player_.duration();return e>=1?1:e}},{key:"handleMouseUp",value:function(e){var t=this;Nb.prototype.handleMouseUp.call(this,e),this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout((function(){t.player_.removeClass("cv-disable-play-pause-feedback")}),500)}},{key:"clamp",value:function(e,t,r){return Math.min(Math.max(e,t),r)}},{key:"getMouseTime",value:function(e){return this.clamp(Nb.prototype.calculateDistance.call(this,e).x,0,1)*this.player_.duration()}}])&&Lb(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Nb);function Ub(e){return Ub="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},Ub(e)}function Fb(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Vb(n.key),n)}}function Vb(e){var t=function(e,t){if("object"!=Ub(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Ub(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ub(t)?t:t+""}function Hb(e,t,r){return t=Wb(t),function(e,t){if(t&&("object"===Ub(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,qb()?Reflect.construct(t,r||[],Wb(e).constructor):t.apply(e,r))}function qb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qb=function(){return!!e})()}function zb(){return zb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Wb(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},zb.apply(this,arguments)}function Wb(e){return Wb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Wb(e)}function Gb(e,t){return Gb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Gb(e,t)}yl.registerComponent("SeekBar",Bb);var Xb=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Hb(this,t,arguments)}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gb(e,t)}(t,e),r=t,(n=[{key:"buildCSSClass",value:function(){return"cv-chapter-bar-load-progress ".concat(zb(Wb(t.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(e,r,n){return zb(Wb(t.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},r),{className:this.buildCSSClass()}),n)}},{key:"update",value:function(e){this.el_.style.width=100*e+"%"}}])&&Fb(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("Component"));function Kb(e){return Kb="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},Kb(e)}function Yb(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Qb(n.key),n)}}function Qb(e){var t=function(e,t){if("object"!=Kb(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Kb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Kb(t)?t:t+""}function $b(e,t,r){return t=e_(t),function(e,t){if(t&&("object"===Kb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Jb()?Reflect.construct(t,r||[],e_(e).constructor):t.apply(e,r))}function Jb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Jb=function(){return!!e})()}function Zb(){return Zb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=e_(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Zb.apply(this,arguments)}function e_(e){return e_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e_(e)}function t_(e,t){return t_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},t_(e,t)}var r_=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),$b(this,t,arguments)}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&t_(e,t)}(t,e),r=t,(n=[{key:"buildCSSClass",value:function(){return"cv-chapter-bar-play-progress ".concat(Zb(e_(t.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(e,r,n){return Zb(e_(t.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},r),{className:this.buildCSSClass()}),n)}},{key:"update",value:function(e){e>0&&e<1?this.addClass("cv-current"):this.removeClass("cv-current"),this.el_.style.width=100*e+"%"}}])&&Yb(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("Component"));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},n_(e)}function i_(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o_(n.key),n)}}function o_(e){var t=function(e,t){if("object"!=n_(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=n_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n_(t)?t:t+""}function a_(e,t,r){return t=l_(t),function(e,t){if(t&&("object"===n_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,s_()?Reflect.construct(t,r||[],l_(e).constructor):t.apply(e,r))}function s_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(s_=function(){return!!e})()}function u_(){return u_="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=l_(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},u_.apply(this,arguments)}function l_(e){return l_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l_(e)}function c_(e,t){return c_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c_(e,t)}var f_=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=a_(this,t,[e,r])).playProgress=new r_(n.player_),n.addChild(n.playProgress),n.loadProgress=new Xb(n.player_),n.addChild(n.loadProgress),n.update(),n.updateBuffered(0),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c_(e,t)}(t,e),r=t,n=[{key:"buildCSSClass",value:function(){return"cv-chapter-bar-item ".concat(u_(l_(t.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(e,r,n){return u_(l_(t.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},r),{className:this.buildCSSClass()}),n)}},{key:"getCurrentTime",value:function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}},{key:"update",value:function(){var e=this.player_.duration()||3600,t=this.options_.endTime-this.options_.startTime;if(e!==this.duration_){var r=t/e;this.el_.style.width=100*r+"%";var n=this.options_.startTime/e;this.el_.style.left=100*n+"%",this.duration_=e}var i=this.getCurrentTime();i<this.options_.startTime?this.playProgress.update(0):i>this.options_.endTime?this.playProgress.update(1):this.playProgress.update((i-this.options_.startTime)/t)}},{key:"updateBuffered",value:function(e){var t=this.options_.endTime-this.options_.startTime;e<this.options_.startTime?this.loadProgress.update(0):e>this.options_.endTime?this.loadProgress.update(1):this.loadProgress.update((e-this.options_.startTime)/t)}}],n&&i_(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("Component"));function h_(e){for(var t=e.buffered(),r=e.currentTime(),n=0,i=0;i<t.length;i++){var o=t.start(i),a=t.end(i);if(o<=r&&a>=r){n=a;break}}return n}function p_(e){return p_="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},p_(e)}function d_(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,y_(n.key),n)}}function y_(e){var t=function(e,t){if("object"!=p_(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=p_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==p_(t)?t:t+""}function m_(e,t,r){return t=b_(t),function(e,t){if(t&&("object"===p_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,v_()?Reflect.construct(t,r||[],b_(e).constructor):t.apply(e,r))}function v_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v_=function(){return!!e})()}function g_(){return g_="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=b_(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},g_.apply(this,arguments)}function b_(e){return b_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},b_(e)}function __(e,t){return __=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},__(e,t)}var w_=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),m_(this,t,arguments)}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&__(e,t)}(t,e),r=t,n=[{key:"buildCSSClass",value:function(){return"cv-chapter-bar-items ".concat(g_(b_(t.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(e,r,n){return g_(b_(t.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},r),{className:this.buildCSSClass()}),n)}},{key:"update",value:function(){this.children_.forEach((function(e){e.update()}))}},{key:"updateBuffered",value:function(){var e=this;this.children_.forEach((function(t){t.updateBuffered(h_(e.player_))}))}}],n&&d_(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("Component"));function T_(e){return T_="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},T_(e)}function S_(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,E_(n.key),n)}}function E_(e){var t=function(e,t){if("object"!=T_(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=T_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==T_(t)?t:t+""}function O_(e,t,r){return t=P_(t),function(e,t){if(t&&("object"===T_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,k_()?Reflect.construct(t,r||[],P_(e).constructor):t.apply(e,r))}function k_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(k_=function(){return!!e})()}function C_(){return C_="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=P_(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},C_.apply(this,arguments)}function P_(e){return P_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},P_(e)}function x_(e,t){return x_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x_(e,t)}var j_=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=O_(this,t,[e,r])).onDurationChange=n.onDurationChange.bind(n),n.createChapterItems=n.createChapterItems.bind(n),n.updateBuffered=n.updateBuffered.bind(n),Eg.useTrack(n.player_,"chapters",null,n.createChapterItems),n.player_.on("durationchange",n.onDurationChange),n.player_.on("progress",n.updateBuffered),n.createChapterItems(),n.update(),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x_(e,t)}(t,e),r=t,n=[{key:"dispose",value:function(){this.player_.off("durationchange",this.onDurationChange),this.player_.off("progress",this.updateBuffered),C_(P_(t.prototype),"dispose",this).call(this)}},{key:"createEl",value:function(){return yl.dom.createEl("div",{className:"vjs-progress-holder cv-chapter-seek-bar"},{"aria-label":this.localize("Progress Bar")})}},{key:"onDurationChange",value:function(){this.createChapterItems(),this.update()}},{key:"update",value:function(){var e=C_(P_(t.prototype),"update",this).call(this);return this.chapterBarItems&&this.chapterBarItems.update(),e}},{key:"updateBuffered",value:function(){this.chapterBarItems.updateBuffered()}},{key:"bindUpdateListener",value:function(e){var t=this,r=function(){t.createChapterItems(),t.updateBuffered()};e.addEventListener("cv:cuechange",r),this.player_.one("dispose",(function(){return e.removeEventListener("cv:cuechange",r)}))}},{key:"createChapterItems",value:function(e){var t,r;e&&(this.track_||this.bindUpdateListener(e),this.track_=e);var n=new w_(this.player_);if((null===(r=null===(t=this.track_)||void 0===t?void 0:t.cues)||void 0===r?void 0:r.length)&&!this.options_.ignoreChapters)for(var i=0;i<this.track_.cues.length;i++){var o=this.track_.cues[i],a=o.startTime,s=o.endTime,u=this.player_.duration();u&&(i===this.track_.cues.length-1&&o.endTime<this.player_.duration()&&(s=this.player_.duration()),s>u&&(s=u));var l=new f_(this.player_,{startTime:a,endTime:s});if(n.addChild(l),u&&s===u)break}else n.addChild(new f_(this.player_,{startTime:0,endTime:this.player_.duration()||3600}));this.chapterBarItems&&this.removeChild(this.chapterBarItems),this.chapterBarItems=n,this.addChild(this.chapterBarItems)}}],n&&S_(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("SeekBar"));function L_(e){return L_="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},L_(e)}function I_(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,A_(n.key),n)}}function A_(e){var t=function(e,t){if("object"!=L_(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=L_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==L_(t)?t:t+""}function R_(e,t,r){return t=N_(t),function(e,t){if(t&&("object"===L_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,D_()?Reflect.construct(t,r||[],N_(e).constructor):t.apply(e,r))}function D_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(D_=function(){return!!e})()}function M_(){return M_="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=N_(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},M_.apply(this,arguments)}function N_(e){return N_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},N_(e)}function B_(e,t){return B_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},B_(e,t)}j_.prototype.options_={children:["playProgressBar"],barName:"playProgressBar"},yl.browser.IS_IOS||yl.browser.IS_ANDROID||j_.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),yl.registerComponent("ChapterSeekBar",j_);var U_=yl.getComponent("ProgressControl"),F_="seekBar",V_=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=R_(this,t,arguments)).seekBarName_=F_,e}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&B_(e,t)}(t,e),r=t,(n=[{key:"setSeekBarName",value:function(e){this.seekBarName_=e}},{key:"getChild",value:function(e){return(null==e?void 0:e.toLowerCase())===F_.toLowerCase()&&(e=this.seekBarName_),M_(N_(t.prototype),"getChild",this).call(this,e)}}])&&I_(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(U_);function H_(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;e=e<0?0:e;var r=Math.floor(e%60),n=Math.floor(e/60%60),i=Math.floor(e/3600),o=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(i=n=r="-"),(i=i>0||a>0?i+":":"")+(n=((i||o>=10)&&n<10?"0"+n:n)+":")+(r<10?"0"+r:r)}function q_(e){return q_="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},q_(e)}function z_(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,W_(n.key),n)}}function W_(e){var t=function(e,t){if("object"!=q_(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=q_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==q_(t)?t:t+""}function G_(e,t,r){return t=Y_(t),function(e,t){if(t&&("object"===q_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,X_()?Reflect.construct(t,r||[],Y_(e).constructor):t.apply(e,r))}function X_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(X_=function(){return!!e})()}function K_(){return K_="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Y_(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},K_.apply(this,arguments)}function Y_(e){return Y_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Y_(e)}function Q_(e,t){return Q_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Q_(e,t)}V_.prototype.options_={children:[]},yl.registerComponent("ProgressControl",V_);var $_=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=G_(this,t,[e,r])).hasCustomChapterText=!1,Eg.useTrack(n.player_,"chapters",!1,(function(e){n.track_=e})),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Q_(e,t)}(t,e),r=t,n=[{key:"createEl",value:function(){var e=K_(Y_(t.prototype),"createEl",this).call(this);return this.chapter_=yl.dom.createEl("div"),e.appendChild(this.chapter_),this.time_=yl.dom.createEl("div"),e.appendChild(this.time_),e}},{key:"updateTime",value:function(e){var t=this.player_.duration();if(yl.dom.textContent(this.time_,H_(e,t)),this.track_&&!this.hasCustomChapterText){for(var r=0;r<this.track_.cues.length;r++){var n=this.track_.cues[r],i=n.endTime||t;if(n.startTime<=e&&i>=e)return void yl.dom.textContent(this.chapter_,n.text)}yl.dom.textContent(this.chapter_,"")}}},{key:"clearChapterContent",value:function(){yl.dom.textContent(this.chapter_,"")}},{key:"updateText",value:function(e){yl.dom.textContent(this.time_,e)}},{key:"setCustomChapterText",value:function(e){this.hasCustomChapterText=!!e,yl.dom.textContent(this.chapter_,null!=e?e:"")}}],n&&z_(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("TimeTooltip"));function J_(e){return J_="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},J_(e)}function Z_(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ew(n.key),n)}}function ew(e){var t=function(e,t){if("object"!=J_(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=J_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==J_(t)?t:t+""}function tw(e,t,r){return t=iw(t),function(e,t){if(t&&("object"===J_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,rw()?Reflect.construct(t,r||[],iw(e).constructor):t.apply(e,r))}function rw(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(rw=function(){return!!e})()}function nw(){return nw="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=iw(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},nw.apply(this,arguments)}function iw(e){return iw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},iw(e)}function ow(e,t){return ow=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ow(e,t)}yl.registerComponent("TimeTooltip",$_);var aw=function(e){function t(e,r){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),tw(this,t,[e,r])}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ow(e,t)}(t,e),r=t,n=[{key:"setTrack",value:function(e){this.track_=e}},{key:"createEl",value:function(){var e=nw(iw(t.prototype),"createEl",this).call(this,"div",{className:"cv-thumbnail-display"});return this.img_=yl.dom.createEl("img"),e.appendChild(this.img_),e}},{key:"enable",value:function(){this.addClass("cv-thumbnail-display-enabled")}},{key:"disable",value:function(){this.removeClass("cv-thumbnail-display-enabled")}},{key:"parseImageLink",value:function(e){var t=e.indexOf("#");if(-1===t)return{src:e,w:0,h:0,x:0,y:0};var r=e.substr(0,t),n=e.substr(t+1);if("xywh="!==n.substr(0,5))return{src:e,w:0,h:0,x:0,y:0};var i=this.getScale(),o=n.substr(5).split(",");return{src:r,w:parseInt(o[2])*i,h:parseInt(o[3])*i,x:parseInt(o[0])*i,y:parseInt(o[1])*i}}},{key:"getScale",value:function(){var e=this.options_.scaleFactor,t=this.player_.whiteboardModePlugin().side;return this.player_.isFullscreen()&&"bottom"!==t&&(e*=2),e}},{key:"update",value:function(e){var t,r;if(null===(r=null===(t=this.track_)||void 0===t?void 0:t.cues)||void 0===r?void 0:r.length){for(var n,i=e,o=0;o<this.track_.cues.length;){var a=this.track_.cues[o];if(a.startTime<=i&&a.endTime>=i){n=this.parseImageLink(a.text);break}o++}if(null==n?void 0:n.src){this.enable();var s=n,u=s.src,l=s.w,c=s.h,f=s.x,h=s.y,p=this.getScale();this.img_.src=u,this.img_.style.left=-f+"px",this.img_.style.top=-h+"px",this.img_.style.transformOrigin="0 0",this.img_.style.transform="scale(".concat(p,")"),this.el_.style.width=l+"px",this.el_.style.height=c+"px"}else this.disable()}}}],n&&Z_(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("Component"));function sw(e){return sw="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},sw(e)}function uw(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,lw(n.key),n)}}function lw(e){var t=function(e,t){if("object"!=sw(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=sw(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==sw(t)?t:t+""}function cw(e,t,r){return t=hw(t),function(e,t){if(t&&("object"===sw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,fw()?Reflect.construct(t,r||[],hw(e).constructor):t.apply(e,r))}function fw(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fw=function(){return!!e})()}function hw(e){return hw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hw(e)}function pw(e,t){return pw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},pw(e,t)}aw.prototype.options_={scaleFactor:1},yl.registerComponent("ThumbnailDisplay",aw);var dw=yl.getComponent("MouseTimeDisplay"),yw="cv-mouse-time-display-force-show",mw=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=cw(this,t,[e,r]),Eg.useTrack(n.player_,"metadata","thumbnails",(function(e){n.getChild("ThumbnailDisplay").setTrack(e)})),n.update=n.update.bind(n),n.player_.on("durationchange",n.update),n.player_.one("dispose",(function(){n.player_.off("durationchange",n.update)})),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pw(e,t)}(t,e),r=t,(n=[{key:"update",value:function(e,t){var r=this;this.requestAnimationFrame((function(){var n=r.getChild("TimeTooltip"),i=r.getChild("ThumbnailDisplay"),o=t*r.player_.duration(),a=r.player_.preventScrubbingPlugin(),s=r.player_.controlBar.getChild("progressControl").getChild(cy),u=!1;a.isEnabled&&(u=o>a.furthestVisitedTime),u?(r.hide(),s.show(),Jc(s.hide,1e3,!1,s)()):(r.show(),s&&s.hide(!0),i.update(o),n.updateTime(o));var l=r.el_.getBoundingClientRect();r.el_.style.marginLeft=-l.width/2+"px";var c=e.width*t;c<l.width/2?r.el_.style.left=l.width/2+"px":c>e.width-l.width/2?r.el_.style.left=e.width-l.width/2+"px":r.el_.style.left=e.width*t+"px"}))}},{key:"forceShow",value:function(){this.addClass(yw)}},{key:"removeForceShow",value:function(){this.removeClass(yw)}}])&&uw(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(dw);function vw(e){return vw="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},vw(e)}function gw(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,bw(n.key),n)}}function bw(e){var t=function(e,t){if("object"!=vw(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=vw(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==vw(t)?t:t+""}function _w(e,t,r){return t=Sw(t),function(e,t){if(t&&("object"===vw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ww()?Reflect.construct(t,r||[],Sw(e).constructor):t.apply(e,r))}function ww(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ww=function(){return!!e})()}function Tw(){return Tw="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Sw(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Tw.apply(this,arguments)}function Sw(e){return Sw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Sw(e)}function Ew(e,t){return Ew=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ew(e,t)}mw.prototype.options_={children:["ThumbnailDisplay","TimeTooltip"]},yl.registerComponent("MouseTimeDisplay",mw);var Ow=yl.getComponent("ChaptersTrackMenuItem"),kw=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=_w(this,t,[e,r])).nonIconControl=!1,n.thumbnailDisplay=new aw(n.player_,{scaleFactor:.5}),n.el().insertBefore(n.thumbnailDisplay.el(),n.el().firstChild),Eg.useTrack(n.player_,"metadata","thumbnails",(function(e){n.addClass("cv-has-thumbnails"),n.thumbnailDisplay.setTrack(e),n.thumbnailDisplay.update(n.options_.cue.startTime)})),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ew(e,t)}(t,e),r=t,n=[{key:"update",value:function(){this.player_&&Ow.prototype.update.call(this)}},{key:"buildCSSClass",value:function(){return"vjs-menu-item cv-chapter-menu-item"}},{key:"createEl",value:function(e,r,n){return this.nonIconControl=!0,Tw(Sw(t.prototype),"createEl",this).call(this,"li",Object.assign({className:this.buildCSSClass(),innerHTML:this.getInnerHTML(),tabIndex:-1},r),n)}},{key:"getInnerHTML",value:function(){var e=this.player_.duration();return'<span class="vjs-menu-item-text cv-chapter-menu-item-text">'+"<p>".concat(this.localize(this.options_.label),"</p>")+"<p>(".concat(H_(this.options_.cue.startTime,e),")</p>")+"</span>"}}],n&&gw(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Ow);function Cw(e){return Cw="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},Cw(e)}function Pw(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,xw(n.key),n)}}function xw(e){var t=function(e,t){if("object"!=Cw(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Cw(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Cw(t)?t:t+""}function jw(e,t,r){return t=Aw(t),function(e,t){if(t&&("object"===Cw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Lw()?Reflect.construct(t,r||[],Aw(e).constructor):t.apply(e,r))}function Lw(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Lw=function(){return!!e})()}function Iw(){return Iw="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Aw(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Iw.apply(this,arguments)}function Aw(e){return Aw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Aw(e)}function Rw(e,t){return Rw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Rw(e,t)}var Dw=function(e){function t(e,r,n){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=jw(this,t,[e,r,n])).alwaysCollapsed=!1,i.isCollapsed=!1,i.isCollabsible=!0,i.update=i.update.bind(i),i.player_.on("cv-whiteboard-change",i.update),i.player_.on("fullscreenchange",i.update),i.player_.on("dispose",(function(){i.player_.off("cv-whiteboard-change",i.update),i.player_.off("fullscreenchange",i.update)})),i}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Rw(e,t)}(t,e),r=t,n=[{key:"buildCSSClass",value:function(){return"cv-chapters-button ".concat(Iw(Aw(t.prototype),"buildCSSClass",this).call(this))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-big ".concat(Iw(Aw(t.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"createItems",value:function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var r=0,n=t.length;r<n;r++){var i=t[r],o=new kw(this.player_,{track:this.track_,cue:i});e.push(o)}return e}},{key:"setTrack",value:function(e){var r=this;if(Iw(Aw(t.prototype),"setTrack",this).call(this,e),this.track_&&"chapters"===this.track_.kind){e.one("loadeddata",this.update);var n=function(){r.update(),r.player_.trigger("resizemenus")};e.on("cv:cuechange",n),this.player_.one("dispose",(function(){return e.off("cv:cueupdate",n)}))}}},{key:"update",value:function(e){Iw(Aw(t.prototype),"update",this).call(this,e)}},{key:"getCollabsibleName",value:function(){return"Chapters"}},{key:"getCollabsibleValue",value:function(){var e=this.track_.activeCues[0];return(null==e?void 0:e.text)||""}},{key:"showInCollabsibleMenu",value:function(){if(!this.track_)return!1;var e=this.track_.cues;return!(!e||!e.length)}},{key:"showCollapsibleMenu",value:function(){this.handleClick(null)}}],n&&Pw(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("ChaptersButton"));function Mw(e){return Mw="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},Mw(e)}function Nw(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Bw(n.key),n)}}function Bw(e){var t=function(e,t){if("object"!=Mw(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Mw(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Mw(t)?t:t+""}function Uw(e,t,r){return t=Hw(t),function(e,t){if(t&&("object"===Mw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Fw()?Reflect.construct(t,r||[],Hw(e).constructor):t.apply(e,r))}function Fw(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fw=function(){return!!e})()}function Vw(){return Vw="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Hw(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Vw.apply(this,arguments)}function Hw(e){return Hw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Hw(e)}function qw(e,t){return qw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},qw(e,t)}yl.registerComponent("ChaptersButton",Dw);var zw=yl.getComponent("OffTextTrackMenuItem"),Ww=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Uw(this,t,arguments)}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qw(e,t)}(t,e),r=t,(n=[{key:"handleClick",value:function(e){zw.prototype.handleClick.call(this,e),this.player_.trigger("cv:languageselected")}},{key:"createEl",value:function(e,r,n){return Vw(Hw(t.prototype),"createEl",this).call(this,"li",Object.assign(Object.assign({className:"vjs-menu-item",tabIndex:-1},r),{innerHTML:'<span class="vjs-menu-item-text">Off</span>'}),n)}}])&&Nw(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(zw);function Gw(e){return Gw="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},Gw(e)}function Xw(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Kw(n.key),n)}}function Kw(e){var t=function(e,t){if("object"!=Gw(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Gw(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Gw(t)?t:t+""}function Yw(e,t,r){return t=$w(t),function(e,t){if(t&&("object"===Gw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Qw()?Reflect.construct(t,r||[],$w(e).constructor):t.apply(e,r))}function Qw(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Qw=function(){return!!e})()}function $w(e){return $w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$w(e)}function Jw(e,t){return Jw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Jw(e,t)}yl.registerComponent("OffTextTrackMenuItem",Ww);var Zw=yl.getComponent("TextTrackButton"),eT=yl.getComponent("TextTrackMenuItem"),tT=yl.getComponent("OffTextTrackMenuItem"),rT=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Yw(this,t,arguments)}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Jw(e,t)}(t,e),r=t,n=[{key:"createItems",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eT;this.label_&&(e="".concat(this.label_," off")),t.push(new tT(this.player_,{kinds:this.kinds_,kind:this.kind_,label:e})),this.hideThreshold_+=1;var n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var i=0;i<n.length;i++){var o=n[i];if(this.kinds_.indexOf(o.kind)>-1){var a=new r(this.player_,{track:o,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});a.addClass("vjs-".concat(o.kind,"-menu-item")),t.push(a)}}return t}}],n&&Xw(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Zw);function nT(e){return nT="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},nT(e)}function iT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,oT(n.key),n)}}function oT(e){var t=function(e,t){if("object"!=nT(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=nT(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==nT(t)?t:t+""}function aT(e,t,r){return t=uT(t),function(e,t){if(t&&("object"===nT(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,sT()?Reflect.construct(t,r||[],uT(e).constructor):t.apply(e,r))}function sT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(sT=function(){return!!e})()}function uT(e){return uT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},uT(e)}function lT(e,t){return lT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},lT(e,t)}yl.registerComponent("TextTrackButton",rT);var cT=yl.getComponent("SubsCapsMenuItem"),fT=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),aT(this,t,arguments)}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lT(e,t)}(t,e),r=t,(n=[{key:"handleClick",value:function(e){cT.prototype.handleClick.call(this,e),this.player_.trigger("cv:languageselected")}}])&&iT(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(cT);function hT(e){return hT="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},hT(e)}function pT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,dT(n.key),n)}}function dT(e){var t=function(e,t){if("object"!=hT(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=hT(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==hT(t)?t:t+""}function yT(e,t,r){return t=vT(t),function(e,t){if(t&&("object"===hT(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,mT()?Reflect.construct(t,r||[],vT(e).constructor):t.apply(e,r))}function mT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(mT=function(){return!!e})()}function vT(e){return vT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vT(e)}function gT(e,t){return gT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gT(e,t)}var bT=function(e){function t(e){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n={};n.track={player:e,kind:"subtitle",label:"Search Captions",selectable:!1,default:!1,mode:"disabled"},n.selectable=!1,n.name="SubtitleSearchMenuItem",(r=yT(this,t,[e,n])).addClass("vjs-texttrack-settings"),r.addClass("cv-subtitle-search-menu-item"),r.controlText(", opens subtitle search"),r.toggleEnabled=r.toggleEnabled.bind(r);var i=r.player_.textTracks();return i.addEventListener("selectedlanguagechange",r.toggleEnabled),r.player_.one("dispose",(function(){i.removeEventListener("selectedlanguagechange",r.toggleEnabled)})),r.toggleEnabled(),r}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gT(e,t)}(t,e),r=t,(n=[{key:"toggleEnabled",value:function(){var e;if(this.player_){var t=Eg.getCurrentTextTrack(this.player_);t?(null===(e=t.cues)||void 0===e?void 0:e.length)?this.removeClass("vjs-disabled"):(this.bindTrackEvents(t),this.addClass("vjs-disabled")):this.addClass("vjs-disabled")}}},{key:"bindTrackEvents",value:function(e){var t=this;e.removeEventListener("loadeddata",this.toggleEnabled),e.addEventListener("loadeddata",this.toggleEnabled),this.player_.one("dispose",(function(){e.removeEventListener("loadeddata",t.toggleEnabled)}))}},{key:"handleClick",value:function(){var e,t=this,r=Eg.getCurrentTextTrack(this.player_);(null===(e=null==r?void 0:r.cues)||void 0===e?void 0:e.length)&&this.requestAnimationFrame((function(){t.player_.getChild("collapserator").getChild("subtitleSearchButton").showCollapsibleMenu()}))}}])&&pT(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("TextTrackMenuItem"));function _T(e){return _T="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},_T(e)}function wT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,TT(n.key),n)}}function TT(e){var t=function(e,t){if("object"!=_T(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=_T(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_T(t)?t:t+""}function ST(e,t,r){return t=OT(t),function(e,t){if(t&&("object"===_T(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ET()?Reflect.construct(t,r||[],OT(e).constructor):t.apply(e,r))}function ET(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ET=function(){return!!e})()}function OT(e){return OT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},OT(e)}function kT(e,t){return kT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},kT(e,t)}var CT=function(e){function t(e){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n={};return n.track={player:e,kind:"subtitle",label:"Caption Text Size",selectable:!1,default:!1,mode:"disabled"},n.selectable=!1,n.name="SubtitleSizeMenuItem",(r=ST(this,t,[e,n])).addClass("vjs-texttrack-settings"),r.addClass("cv-divider-after-menu-item"),r.addClass("cv-subtitle-size-menu-item"),r.controlText(", opens subtitle size settings"),r}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kT(e,t)}(t,e),r=t,(n=[{key:"handleClick",value:function(){var e=this;this.requestAnimationFrame((function(){e.player_.getChild("collapserator").getChild("subtitleSizeButton").showCollapsibleMenu()}))}}])&&wT(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("TextTrackMenuItem"));function PT(e){return PT="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},PT(e)}function xT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,jT(n.key),n)}}function jT(e){var t=function(e,t){if("object"!=PT(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=PT(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==PT(t)?t:t+""}function LT(e,t,r){return t=RT(t),function(e,t){if(t&&("object"===PT(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,IT()?Reflect.construct(t,r||[],RT(e).constructor):t.apply(e,r))}function IT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(IT=function(){return!!e})()}function AT(){return AT="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=RT(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},AT.apply(this,arguments)}function RT(e){return RT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},RT(e)}function DT(e,t){return DT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},DT(e,t)}var MT=yl.getComponent("TextTrackButton"),NT=yl.getComponent("SubsCapsButton"),BT=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=LT(this,t,arguments)).alwaysCollapsed=!1,e.isCollapsed=!1,e.isCollabsible=!0,e.className="cv-subs-caps-menu-button",e}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&DT(e,t)}(t,e),r=t,n=[{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-has-left-icons ".concat(AT(RT(t.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"createItems",value:function(){var e=[];return this.player_.options_.mobile||(e.push(new bT(this.player_)),e.push(new CT(this.player_)),this.hideThreshold_=this.hideThreshold_+2),MT.prototype.createItems.call(this,e,fT)}},{key:"getCollabsibleName",value:function(){return"Subtitles"}},{key:"getCollabsibleValue",value:function(){for(var e=this.player_.textTracks(),t=0;t<e.length;t++){var r=e[t];if(this.kinds_.indexOf(r.kind)>-1&&"showing"===r.mode)return r.label}return"Off"}},{key:"showInCollabsibleMenu",value:function(){for(var e=this.player_.textTracks(),t=0;t<e.length;t++){var r=e[t];if(this.kinds_.indexOf(r.kind)>-1)return!0}return!1}},{key:"showCollapsibleMenu",value:function(){NT.prototype.handleClick.apply(this)}}],n&&xT(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(NT);function UT(e){return UT="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},UT(e)}function FT(){FT=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new j(n||[]);return i(a,"_invoke",{value:k(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(L([])));T&&T!==r&&n.call(T,a)&&(_=T);var S=b.prototype=v.prototype=Object.create(_);function E(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function r(i,o,a,s){var u=f(e[i],e,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==UT(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function k(t,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(t,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,C(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function L(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(UT(t)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},E(O.prototype),l(O.prototype,s,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new O(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=L,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function VT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,HT(n.key),n)}}function HT(e){var t=function(e,t){if("object"!=UT(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=UT(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==UT(t)?t:t+""}function qT(e,t,r){return t=WT(t),function(e,t){if(t&&("object"===UT(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,zT()?Reflect.construct(t,r||[],WT(e).constructor):t.apply(e,r))}function zT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(zT=function(){return!!e})()}function WT(e){return WT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},WT(e)}function GT(e,t){return GT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},GT(e,t)}yl.registerComponent("SubsCapsButton",BT);var XT="<span class='vjs-local-cache-indicator-icon' title='Streaming from ClickView Local Cache'>".concat(mh,"</span>"),KT=function(e){function t(e,r){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=qT(this,t,[e,r])).qualityId=r.qualityId;var i=e.qualityLevels(),o=n.handleQualityChange.bind(n);return i.on("change",o),e.one("dispose",(function(){i.off("change",o)})),n.handleLocalCacheChange=n.handleLocalCacheChange.bind(n),n.player_.ready((function(){n.player_&&(n.player_.on("localcachechanged",n.handleLocalCacheChange),n.player_.one("dispose",(function(){var e;null===(e=n.player_)||void 0===e||e.off("localcachechanged",n.handleLocalCacheChange)})),n.handleLocalCacheChange())})),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&>(e,t)}(t,e),r=t,n=[{key:"handleLocalCacheChange",value:function(){return e=this,t=void 0,r=void 0,n=FT().mark((function e(){var t,r;return FT().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.player_.localCache(),e.next=3,t.getActiveLocalCache();case 3:if(null==(r=e.sent)?void 0:r.playbackProfile){e.next=9;break}return this.show(),this.enable(),this.setLabel(this.options_.label),e.abrupt("return");case 9:r.playbackProfile!==this.qualityId?this.disable():this.setLabel(this.options_.label+XT);case 10:case"end":return e.stop()}}),e,this)})),new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}));var e,t,r,n}},{key:"setLabel",value:function(e){var t=this.$(".vjs-menu-item-text");t&&(t.innerHTML=e)}},{key:"buildCSSClass",value:function(){return"vjs-menu-item cv-quality-menu-item"}},{key:"handleClick",value:function(){for(var e=this.player_.qualityLevels(),t=0;t<e.length;t++){var r=e[t];r.enabled=r.id===this.qualityId}}},{key:"handleQualityChange",value:function(){if(this.player_){var e=this.player_.qualityLevels(),t=e[e.selectedIndex],r=t&&t.id===this.qualityId;r!==this.isSelected_&&this.selected(r)}}}],n&&VT(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("MenuItem"));function YT(e){return YT="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},YT(e)}function QT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$T(n.key),n)}}function $T(e){var t=function(e,t){if("object"!=YT(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=YT(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==YT(t)?t:t+""}function JT(e,t,r){return t=tS(t),function(e,t){if(t&&("object"===YT(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ZT()?Reflect.construct(t,r||[],tS(e).constructor):t.apply(e,r))}function ZT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ZT=function(){return!!e})()}function eS(){return eS="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=tS(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},eS.apply(this,arguments)}function tS(e){return tS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},tS(e)}function rS(e,t){return rS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},rS(e,t)}var nS={144:"144p (Preview)",240:"240p",360:"360p",480:"480p",720:"720p",1080:"1080p"},iS=yl.getComponent("MenuButton"),oS=function(e){function t(e,r){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=JT(this,t,[e,r])).alwaysCollapsed=!0,n.isCollapsed=!1,n.isCollabsible=!0,n.className="cv-quality-menu-button";var i=n.player_.qualityLevels(),o=n.update.bind(n);return i.on("addqualitylevel",o),i.on("removequalitylevel",o),e.one("dispose",(function(){i.removeEventListener("addqualitylevel",o),i.removeEventListener("removequalitylevel",o)})),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rS(e,t)}(t,e),r=t,n=[{key:"buildCSSClass",value:function(){return"cv-quality-button ".concat(eS(tS(t.prototype),"buildCSSClass",this).call(this))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small vjs-quality-button cv-has-left-icons ".concat(eS(tS(t.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"createItems",value:function(){var e=[],t=this.player_.qualityLevels();e.push(new Pd(this.player_,{label:"Quality"}));for(var r=0;r<t.length;r++){var n=t[r];if(n){var i=nS[n.id];i&&e.push(new KT(this.player_,{qualityId:n.id,label:i,selectable:!0,multiSelectable:!1}))}}return e}},{key:"getCollabsibleName",value:function(){return"Quality"}},{key:"getCollabsibleValue",value:function(){var e=this.player_.qualityLevels(),t=e[e.selectedIndex];return t?nS[t.id]:""}},{key:"showInCollabsibleMenu",value:function(){return!!this.player_.qualityLevels().length}},{key:"showCollapsibleMenu",value:function(){iS.prototype.handleClick.apply(this)}}],n&&QT(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(iS);function aS(e){return aS="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},aS(e)}function sS(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,uS(n.key),n)}}function uS(e){var t=function(e,t){if("object"!=aS(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=aS(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==aS(t)?t:t+""}function lS(e,t,r){return t=hS(t),function(e,t){if(t&&("object"===aS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,cS()?Reflect.construct(t,r||[],hS(e).constructor):t.apply(e,r))}function cS(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(cS=function(){return!!e})()}function fS(){return fS="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=hS(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},fS.apply(this,arguments)}function hS(e){return hS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hS(e)}function pS(e,t){return pS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},pS(e,t)}yl.registerComponent("QualityButton",oS);var dS=yl.getComponent("Menu"),yS=yl.getComponent("MenuButton"),mS=yl.getComponent("PlaybackRateMenuItem"),vS=yl.getComponent("PlaybackRateMenuButton"),gS=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=lS(this,t,arguments)).alwaysCollapsed=!0,e.isCollapsed=!1,e.isCollabsible=!0,e.className="cv-playback-rate-menu-button",e}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pS(e,t)}(t,e),r=t,n=[{key:"createEl",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=yS.prototype.createEl).apply.apply(e,[this].concat(r))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-has-left-icons ".concat(fS(hS(t.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"createMenu",value:function(){var e=new dS(this.player(),{menuButton:this});e.addItem(new Pd(this.player_,{label:"Playback Speed"}));var t=this.playbackRates();if(t)for(var r=0;r<t.length;r++){var n=t[r]+"x";1===t[r]&&(n+=" (Normal)"),e.addItem(new mS(this.player(),{rate:n}))}return e}},{key:"handleClick",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=yS.prototype.handleClick).apply.apply(e,[this].concat(r))}},{key:"updateLabel",value:function(){var e;this.setupLabelEl();for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=vS.prototype.updateLabel).apply.apply(e,[this].concat(r))}},{key:"setupLabelEl",value:function(){if(!this.labelEl_){var e=this.$("button");e&&(this.labelEl_=yl.dom.createEl("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),e.appendChild(this.labelEl_))}}},{key:"getCollabsibleName",value:function(){return"Playback Speed"}},{key:"getCollabsibleValue",value:function(){return this.player().playbackRate()+"x"}},{key:"showInCollabsibleMenu",value:function(){return!!this.playbackRates()}},{key:"showCollapsibleMenu",value:function(){this.handleClick(null)}}],n&&sS(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(vS);function bS(e){return bS="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},bS(e)}function _S(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,wS(n.key),n)}}function wS(e){var t=function(e,t){if("object"!=bS(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=bS(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==bS(t)?t:t+""}function TS(e,t,r){return t=ES(t),function(e,t){if(t&&("object"===bS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,SS()?Reflect.construct(t,r||[],ES(e).constructor):t.apply(e,r))}function SS(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(SS=function(){return!!e})()}function ES(e){return ES=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ES(e)}function OS(e,t){return OS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},OS(e,t)}yl.registerComponent("PlaybackRateMenuButton",gS);var kS=yl.getComponent("TextTrackSettings"),CS={backgroundColor:"#000",backgroundOpacity:"1",color:"#FFF",edgeStyle:void 0,fontFamily:"proportionalSansSerif",fontPercent:1,textOpacity:"1",windowColor:"#000",windowOpacity:"0"},PS={small:CS,medium:Object.assign(Object.assign({},CS),{fontPercent:1.5}),large:Object.assign(Object.assign({},CS),{fontPercent:2})},xS=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),TS(this,t,arguments)}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&OS(e,t)}(t,e),r=t,(n=[{key:"setSizeSetting",value:function(e){var t=this;this.size_=e,this.player_.getChild("textTrackDisplay").updateDisplay();var r=this.player_.getChild("collapserator").getChild("subtitleSizeButton");this.player_.trigger("changesubtitlesize",this.size_),window.requestAnimationFrame((function(){r.update(),t.player_.trigger("resizemenus")}))}},{key:"getSizeSetting",value:function(){return this.size_||"small"}},{key:"getValues",value:function(){return PS[this.size_]?PS[this.size_]:CS}}])&&_S(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(kS);function jS(e){return jS="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},jS(e)}function LS(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,IS(n.key),n)}}function IS(e){var t=function(e,t){if("object"!=jS(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=jS(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==jS(t)?t:t+""}function AS(e,t,r){return t=MS(t),function(e,t){if(t&&("object"===jS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,RS()?Reflect.construct(t,r||[],MS(e).constructor):t.apply(e,r))}function RS(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(RS=function(){return!!e})()}function DS(){return DS="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=MS(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},DS.apply(this,arguments)}function MS(e){return MS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},MS(e)}function NS(e,t){return NS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},NS(e,t)}yl.registerComponent("TextTrackSettings",xS);var BS=window.navigator&&window.navigator.userAgent||"",US=(/iPod/i.test(BS),/Android/i.test(BS),yl.getComponent("Player")),FS=function(e){function t(e,r){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=AS(this,t,[e,r]))._dataLoaded=!1,r.mobile&&n.addClass("cv-mobile-player");var i=function(){return n._dataLoaded=!0};return n.on("cv-playback-data-loaded",i),n.on("dispose",(function(){return n.off("cv-playback-data-loaded",i)})),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&NS(e,t)}(t,e),r=t,(n=[{key:"dataLoaded",value:function(e){var t=this;this._dataLoaded?e():(this.one("cv-playback-data-loaded",e),this.one("dispose",(function(){t.off("cv-playback-data-loaded",e)})))}},{key:"lock",value:function(e){this.callback_=e}},{key:"unlock",value:function(){delete this.callback_}},{key:"currentTime",value:function(e,r){var n=this;if("number"!=typeof e||!this.callback_||r)return DS(MS(t.prototype),"currentTime",this).call(this,e);this.callback_((function(){n.unlock(),n.currentTime(e)}))}},{key:"play",value:function(){var e=this;if(!this.callback_)return DS(MS(t.prototype),"play",this).call(this);this.callback_((function(){e.unlock(),e.play()}))}},{key:"updateStyleEl_",value:function(){if(US.prototype.updateStyleEl_.call(this),this.options_.fluid){var e=this.el_.parentNode;if(e&&this.options_.setMaxHeight){var t=this.aspectRatio();if(void 0!==t&&"auto"!==t||(t=this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9"),this.player_.playerModePlugin().getMode()===Qy.Hover)return e.style.removeProperty("maxWidth"),void e.style.removeProperty("margin");var r=t.split(":"),n=+r[1]/+r[0];e.style.maxWidth=85/n+"vh",e.style.margin="0 auto"}}}},{key:"listenForUserActivity_",value:function(){var e=this;US.prototype.listenForUserActivity_.call(this);var t=this.getChild("collapserator");t.on("mouseenter",(function(){e.player().cache_.inactivityTimeout=e.player().options_.inactivityTimeout,e.player().options_.inactivityTimeout=0})),t.on("mouseleave",(function(){e.player().options_.inactivityTimeout=e.player().cache_.inactivityTimeout}))}}])&&LS(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(US);function VS(e){return VS="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},VS(e)}function HS(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,qS(n.key),n)}}function qS(e){var t=function(e,t){if("object"!=VS(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=VS(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==VS(t)?t:t+""}function zS(e,t,r){return t=GS(t),function(e,t){if(t&&("object"===VS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,WS()?Reflect.construct(t,r||[],GS(e).constructor):t.apply(e,r))}function WS(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(WS=function(){return!!e})()}function GS(e){return GS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},GS(e)}function XS(e,t){return XS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},XS(e,t)}FS.prototype.options_=Object.assign(Object.assign({},US.prototype.options_),{setMaxHeight:!0}),yl.registerComponent("player",FS);var KS=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=zS(this,t,[e,r])).player_.addClass("cv-disable-play-pause-feedback"),n.onFirstPlay=n.onFirstPlay.bind(n),n.player_.one("firstplay",n.onFirstPlay),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&XS(e,t)}(t,e),r=t,(n=[{key:"dispose",value:function(){this.player_.off("firstplay",this.onFirstPlay)}},{key:"onFirstPlay",value:function(){var e=this;window.setTimeout((function(){e.player_.isDisposed()||e.player_.removeClass("cv-disable-play-pause-feedback")}),500)}},{key:"createEl",value:function(){return yl.dom.createEl("div",{className:"cv-play-pause-feedback"})}}])&&HS(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("Component"));function YS(e){return YS="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},YS(e)}function QS(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$S(n.key),n)}}function $S(e){var t=function(e,t){if("object"!=YS(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=YS(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==YS(t)?t:t+""}function JS(e,t,r){return t=eE(t),function(e,t){if(t&&("object"===YS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ZS()?Reflect.construct(t,r||[],eE(e).constructor):t.apply(e,r))}function ZS(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ZS=function(){return!!e})()}function eE(e){return eE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},eE(e)}function tE(e,t){return tE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},tE(e,t)}yl.registerComponent("PlayPauseFeedback",KS);var rE=yl.getComponent("PlayToggle"),nE=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),JS(this,t,arguments)}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tE(e,t)}(t,e),r=t,(n=[{key:"handleClick",value:function(e){var t=this;rE.prototype.handleClick.call(this,e),this.player_.addClass("cv-disable-play-pause-feedback"),this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout((function(){t.player_.removeClass("cv-disable-play-pause-feedback")}),500)}}])&&QS(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(rE);function iE(e){return iE="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},iE(e)}function oE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,aE(n.key),n)}}function aE(e){var t=function(e,t){if("object"!=iE(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=iE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==iE(t)?t:t+""}function sE(e,t,r){return t=lE(t),function(e,t){if(t&&("object"===iE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,uE()?Reflect.construct(t,r||[],lE(e).constructor):t.apply(e,r))}function uE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(uE=function(){return!!e})()}function lE(e){return lE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},lE(e)}function cE(e,t){return cE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},cE(e,t)}yl.registerComponent("PlayToggle",nE);var fE=yl.getComponent("TextTrackDisplay"),hE=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),sE(this,t,arguments)}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cE(e,t)}(t,e),r=t,n=[{key:"updateDisplayState",value:function(e){fE.prototype.updateDisplayState.call(this,e);for(var t=this.player_.textTrackSettings.getValues(),r=e.activeCues,n=r.length;n--;){var i=r[n];if(i){var o=i.displayState;if(t.fontPercent&&1!==t.fontPercent){var a=.025*this.el().getBoundingClientRect().width*100/100;o.style.fontSize=a*t.fontPercent+"px"}}}}}],n&&oE(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(fE);function pE(e){return pE="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},pE(e)}function dE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,yE(n.key),n)}}function yE(e){var t=function(e,t){if("object"!=pE(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=pE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==pE(t)?t:t+""}function mE(e,t,r){return t=gE(t),function(e,t){if(t&&("object"===pE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,vE()?Reflect.construct(t,r||[],gE(e).constructor):t.apply(e,r))}function vE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(vE=function(){return!!e})()}function gE(e){return gE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},gE(e)}function bE(e,t){return bE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bE(e,t)}yl.registerComponent("TextTrackDisplay",hE);var _E=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),mE(this,t,arguments)}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bE(e,t)}(t,e),r=t,(n=[{key:"createEl",value:function(){return yl.dom.createEl("div",{className:"cv-control-bar-gradient-container",innerHTML:'<div class="cv-control-bar-gradient"></div>'})}}])&&dE(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("Component"));function wE(e){return wE="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},wE(e)}function TE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,SE(n.key),n)}}function SE(e){var t=function(e,t){if("object"!=wE(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=wE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==wE(t)?t:t+""}function EE(e,t,r){return t=CE(t),function(e,t){if(t&&("object"===wE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,OE()?Reflect.construct(t,r||[],CE(e).constructor):t.apply(e,r))}function OE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(OE=function(){return!!e})()}function kE(){return kE="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=CE(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},kE.apply(this,arguments)}function CE(e){return CE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},CE(e)}function PE(e,t){return PE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},PE(e,t)}yl.registerComponent("ControlBarGradient",_E);var xE=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=EE(this,t,[e,r])).options_=r,n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&PE(e,t)}(t,e),r=t,(n=[{key:"createEl",value:function(){var e=this.options_.title;if(!this.options_.seriesName)return kE(CE(t.prototype),"createEl",this).call(this,"h1",{innerHTML:e});var r=this.buildSeasonEpisodeString();return r?(e="<div class='cv-splash-series'>".concat(this.options_.seriesName.toUpperCase()," ").concat(r,"</div>")+e,kE(CE(t.prototype),"createEl",this).call(this,"h1",{innerHTML:e})):(e="<div class='cv-splash-series'>".concat(this.options_.seriesName.toUpperCase(),"</div>")+e,kE(CE(t.prototype),"createEl",this).call(this,"h1",{innerHTML:e}))}},{key:"buildSeasonEpisodeString",value:function(){if(!this.options_.seasonNumber||!this.options_.episodeNumber)return"";var e=this.padNumber(this.options_.seasonNumber,2),t=this.padNumber(this.options_.episodeNumber,2);return"S".concat(e," • E").concat(t)}},{key:"padNumber",value:function(e,t){var r=e.toString();if(r.length>=t)return r;for(t-=r.length;t>0;)r="0"+r,t--;return r}}])&&TE(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("Component"));function jE(e){return jE="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},jE(e)}function LE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,IE(n.key),n)}}function IE(e){var t=function(e,t){if("object"!=jE(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=jE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==jE(t)?t:t+""}function AE(e,t,r){return t=ME(t),function(e,t){if(t&&("object"===jE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,RE()?Reflect.construct(t,r||[],ME(e).constructor):t.apply(e,r))}function RE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(RE=function(){return!!e})()}function DE(){return DE="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=ME(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},DE.apply(this,arguments)}function ME(e){return ME=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ME(e)}function NE(e,t){return NE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},NE(e,t)}var BE=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=AE(this,t,[e,r])).options_=r,n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&NE(e,t)}(t,e),r=t,(n=[{key:"buildCSSClass",value:function(){return"cv-splash-rating ".concat((e=this.options_.ratingValue)?function(e){switch(!0){case e<32:return"cv-rating-purple";case e<48:return"cv-rating-green";case e<80:return"cv-rating-blue";case e<96:return"cv-rating-red";case e<128:return"cv-rating-pink";case e>=128:return"cv-rating-yellow";default:return""}}(e):"");var e}},{key:"createEl",value:function(e,r,n){return this.options_.ratingCode?DE(ME(t.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},r),{className:this.buildCSSClass(),innerHTML:this.options_.ratingCode}),n):null}}])&&LE(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("Component"));function UE(e){return UE="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},UE(e)}function FE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,VE(n.key),n)}}function VE(e){var t=function(e,t){if("object"!=UE(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=UE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==UE(t)?t:t+""}function HE(e,t,r){return t=WE(t),qE(e,zE()?Reflect.construct(t,r||[],WE(e).constructor):t.apply(e,r))}function qE(e,t){if(t&&("object"===UE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function zE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(zE=function(){return!!e})()}function WE(e){return WE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},WE(e)}function GE(e,t){return GE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},GE(e,t)}var XE=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=HE(this,t,[e,r]),r.embed?(n.addChild(new xE(e,r)),n.addChild(new BE(e,r)),n):qE(n,n)}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&GE(e,t)}(t,e),r=t,(n=[{key:"createEl",value:function(){return yl.dom.createEl("div",{className:"cv-splash-metadata"})}}])&&FE(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("Component"));function KE(e){return KE="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},KE(e)}function YE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,QE(n.key),n)}}function QE(e){var t=function(e,t){if("object"!=KE(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=KE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==KE(t)?t:t+""}function $E(e,t,r){return t=ZE(t),function(e,t){if(t&&("object"===KE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,JE()?Reflect.construct(t,r||[],ZE(e).constructor):t.apply(e,r))}function JE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(JE=function(){return!!e})()}function ZE(e){return ZE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ZE(e)}function eO(e,t){return eO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},eO(e,t)}var tO=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=$E(this,t,[e,r])).addChild(new XE(e,r)),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eO(e,t)}(t,e),r=t,(n=[{key:"createEl",value:function(){var e="<div class='cv-splash-mask'></div>";return this.options_.embed&&(e+="<div class='cv-splash-logo'>".concat($c,"</div>")),yl.dom.createEl("div",{className:"vjs-poster cv-embed-splash cv-embed-splash-black",tabIndex:-1,innerHTML:e})}}])&&YE(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("posterImage"));function rO(e){return rO="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},rO(e)}function nO(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,iO(n.key),n)}}function iO(e){var t=function(e,t){if("object"!=rO(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=rO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==rO(t)?t:t+""}function oO(e,t,r){return t=sO(t),function(e,t){if(t&&("object"===rO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,aO()?Reflect.construct(t,r||[],sO(e).constructor):t.apply(e,r))}function aO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(aO=function(){return!!e})()}function sO(e){return sO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},sO(e)}function uO(e,t){return uO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},uO(e,t)}yl.registerComponent("posterImage",tO);var lO,cO=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=oO(this,t,[e,r])).el().prepend(n.getErrorImage()),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&uO(e,t)}(t,e),r=t,(n=[{key:"getErrorImage",value:function(){return yl.dom.createEl("div",{className:"cv-error-image",innerHTML:'\n <svg viewBox="0 0 301 185" xmlns="http://www.w3.org/2000/svg">\n <path d="M267.393 36.6514V167.906C267.393 168.182 267.169 168.406 266.893 168.406H32C31.7239 168.406 31.5 168.182 31.5 167.906V36.6514C31.5 36.3752 31.7239 36.1514 32 36.1514H80.5C80.7761 36.1514 81 36.3752 81 36.6514V57.7196C81 58.7622 82.0375 59.4868 83.0164 59.1279L95.7377 54.4634C95.9961 54.3687 96.2825 54.5006 96.3785 54.7585L102.094 70.1194C102.677 71.6866 105 71.2685 105 69.5964V48.4925C105 47.7632 104.475 47.1396 103.757 47.0146L94.2479 45.3609C93.9436 45.308 93.7596 44.9946 93.8616 44.7031L96.7376 36.4862C96.8077 36.2856 96.997 36.1514 97.2095 36.1514H266.893C267.169 36.1514 267.393 36.3752 267.393 36.6514Z" stroke="white"/>\n <path d="M163.296 101.777L149.437 90.1217C148.275 89.1441 146.5 89.9705 146.5 91.4894V113.664C146.5 115.141 148.191 115.98 149.367 115.087L163.226 104.569C164.139 103.876 164.173 102.515 163.296 101.777Z" stroke="white" stroke-linecap="round"/>\n <path d="M295.53 23.0783L277.524 26.2801L283.252 32.7192L274.855 38.9079L292.861 35.7061L287.133 29.2671L295.53 23.0783Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M268.06 2.91764L254.192 14.8403L262.401 17.4661L258.324 27.0679L272.192 15.1453L263.983 12.5194L268.06 2.91764Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>\n '})}}])&&nO(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("ErrorDisplay"));function fO(e){return fO="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},fO(e)}function hO(e,t,r){return t=function(e){var t=function(e,t){if("object"!=fO(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=fO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==fO(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pO(e){e.paused()?e.play():e.pause()}function dO(e,t){e.currentTime(e.currentTime()+t)}function yO(e,t){e.volume(e.volume()+t)}yl.registerComponent("ErrorDisplay",cO),function(e){e.CvApSoutheast1="cv-ap-southeast-1",e.CvApSoutheast2="cv-ap-southeast-2",e.CvEuWest1="cv-eu-west-1",e.CvNaWest1="cv-na-west-1"}(lO||(lO={}));var mO,vO=hO(hO(hO(hO(hO(hO(hO(hO(hO(hO({},"f",(function(e){document[e.fsApi_.fullscreenEnabled]&&(e.isFullscreen()?e.exitFullscreen():e.requestFullscreen())})),"m",(function(e){var t=e.volume(),r=e.lastVolume_();if(0===t){var n=r<.1?.1:r;e.volume(n),e.muted(!1)}else e.muted(!e.muted())})),"k",pO),"space",pO),"left",(function(e){return dO(e,-5)})),"right",(function(e){return dO(e,5)})),"j",(function(e){return dO(e,-10)})),"l",(function(e){return dO(e,10)})),"up",(function(e){return yO(e,.05)})),"down",(function(e){return yO(e,-.05)}));function gO(e,t,r){return t=_O(t),function(e,t){if(t&&("object"===SO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,bO()?Reflect.construct(t,r||[],_O(e).constructor):t.apply(e,r))}function bO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(bO=function(){return!!e})()}function _O(e){return _O=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_O(e)}function wO(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&&TO(e,t)}function TO(e,t){return TO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},TO(e,t)}function SO(e){return SO="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},SO(e)}function EO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OO(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,CO(n.key),n)}}function kO(e,t,r){return t&&OO(e.prototype,t),r&&OO(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function CO(e){var t=function(e,t){if("object"!=SO(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=SO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==SO(t)?t:t+""}!function(e){e.LocalStorage="localStorage",e.SessionStorage="sessionStorage"}(mO||(mO={}));var PO=function(){return kO((function e(t){if(EO(this,e),this.cachePrefix="_cv:",this.expireTime=3600,this.type=t.type,this.hasSupport=this.hasBrowserSupport(),this.hasSupport)try{this.storage=window[this.type]}catch(e){}}),[{key:"isAvailable",value:function(){return this.hasSupport}},{key:"get",value:function(e){if(this.hasSupport){var t=this.storage.getItem(e);try{return JSON.parse(t)}catch(e){return t}}}},{key:"set",value:function(e,t){if(this.hasSupport)try{return this.storage.removeItem(e),"string"!=typeof t?(this.storage.setItem(e,JSON.stringify(t)),!0):(this.storage.setItem(e,t),!0)}catch(e){return!1}}},{key:"remove",value:function(e){if(this.hasSupport)return this.storage.removeItem(e)}},{key:"length",value:function(){if(this.hasSupport)return this.storage.length}},{key:"clear",value:function(){if(this.hasSupport)return this.storage.clear()}},{key:"cacheSet",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.expireTime;this.cacheClean();var n={time:this.getCurrentTime()+1e3*r,data:null!=t&&t};return this.set("".concat(this.cachePrefix).concat(e),n)}},{key:"cacheGet",value:function(e){var t="".concat(this.cachePrefix).concat(e),r=this.get(t);return r?this.isExpired(r)?(this.remove(t),null):r.data:null}},{key:"cacheExists",value:function(e){var t="".concat(this.cachePrefix).concat(e),r=this.get(t);return!(!r||this.isExpired(r)&&(this.remove(t),1))}},{key:"cacheRemove",value:function(e){return this.remove("".concat(this.cachePrefix).concat(e))}},{key:"cacheFlush",value:function(){this.cacheClean()}},{key:"cacheClean",value:function(){if(this.hasSupport)for(var e=0;e<this.storage.length;e++){var t=this.storage.key(e);if(0===t.indexOf(this.cachePrefix)){var r=this.get(t);r&&r.time&&this.isExpired(r)&&this.remove(t)}}}},{key:"isExpired",value:function(e){return e.time<this.getCurrentTime()}},{key:"getCurrentTime",value:function(){return(new Date).getTime()}},{key:"hasBrowserSupport",value:function(){try{return this.type in window&&null!==window[this.type]}catch(e){return!1}}}])}(),xO=function(e){function t(){return EO(this,t),gO(this,t,arguments)}return wO(t,e),kO(t,null,[{key:"Instance",get:function(){return this.instance||(this.instance=new this({type:mO.LocalStorage}))}}])}(PO),jO=function(e){function t(){return EO(this,t),gO(this,t,arguments)}return wO(t,e),kO(t,null,[{key:"Instance",get:function(){return this.instance||(this.instance=new this({type:mO.SessionStorage}))}}])}(PO),LO=xO.Instance,IO=jO.Instance;const AO="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function RO(e,t,r,n){let i,o,a;const s=t||[0],u=(r=r||0)>>>3,l=-1===n?3:0;for(i=0;i<e.length;i+=1)a=i+u,o=a>>>2,s.length<=o&&s.push(0),s[o]|=e[i]<<8*(l+n*(a%4));return{value:s,binLen:8*e.length+r}}function DO(e,t,r){switch(t){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(e){case"HEX":return function(e,t,n){return function(e,t,r,n){let i,o,a,s;if(0!=e.length%2)throw new Error("String of HEX type must be in byte increments");const u=t||[0],l=(r=r||0)>>>3,c=-1===n?3:0;for(i=0;i<e.length;i+=2){if(o=parseInt(e.substr(i,2),16),isNaN(o))throw new Error("String of HEX type contains invalid characters");for(s=(i>>>1)+l,a=s>>>2;u.length<=a;)u.push(0);u[a]|=o<<8*(c+n*(s%4))}return{value:u,binLen:4*e.length+r}}(e,t,n,r)};case"TEXT":return function(e,n,i){return function(e,t,r,n,i){let o,a,s,u,l,c,f,h,p=0;const d=r||[0],y=(n=n||0)>>>3;if("UTF8"===t)for(f=-1===i?3:0,s=0;s<e.length;s+=1)for(o=e.charCodeAt(s),a=[],128>o?a.push(o):2048>o?(a.push(192|o>>>6),a.push(128|63&o)):55296>o||57344<=o?a.push(224|o>>>12,128|o>>>6&63,128|63&o):(s+=1,o=65536+((1023&o)<<10|1023&e.charCodeAt(s)),a.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),u=0;u<a.length;u+=1){for(c=p+y,l=c>>>2;d.length<=l;)d.push(0);d[l]|=a[u]<<8*(f+i*(c%4)),p+=1}else for(f=-1===i?2:0,h="UTF16LE"===t&&1!==i||"UTF16LE"!==t&&1===i,s=0;s<e.length;s+=1){for(o=e.charCodeAt(s),!0===h&&(u=255&o,o=u<<8|o>>>8),c=p+y,l=c>>>2;d.length<=l;)d.push(0);d[l]|=o<<8*(f+i*(c%4)),p+=2}return{value:d,binLen:8*p+n}}(e,t,n,i,r)};case"B64":return function(e,t,n){return function(e,t,r,n){let i,o,a,s,u,l,c,f=0;const h=t||[0],p=(r=r||0)>>>3,d=-1===n?3:0,y=e.indexOf("=");if(-1===e.search(/^[a-zA-Z0-9=+/]+$/))throw new Error("Invalid character in base-64 string");if(e=e.replace(/=/g,""),-1!==y&&y<e.length)throw new Error("Invalid '=' found in base-64 string");for(o=0;o<e.length;o+=4){for(u=e.substr(o,4),s=0,a=0;a<u.length;a+=1)i=AO.indexOf(u.charAt(a)),s|=i<<18-6*a;for(a=0;a<u.length-1;a+=1){for(c=f+p,l=c>>>2;h.length<=l;)h.push(0);h[l]|=(s>>>16-8*a&255)<<8*(d+n*(c%4)),f+=1}}return{value:h,binLen:8*f+r}}(e,t,n,r)};case"BYTES":return function(e,t,n){return function(e,t,r,n){let i,o,a,s;const u=t||[0],l=(r=r||0)>>>3,c=-1===n?3:0;for(o=0;o<e.length;o+=1)i=e.charCodeAt(o),s=o+l,a=s>>>2,u.length<=a&&u.push(0),u[a]|=i<<8*(c+n*(s%4));return{value:u,binLen:8*e.length+r}}(e,t,n,r)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(e){throw new Error("ARRAYBUFFER not supported by this environment")}return function(e,t,n){return function(e,t,r,n){return RO(new Uint8Array(e),t,r,n)}(e,t,n,r)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(e){throw new Error("UINT8ARRAY not supported by this environment")}return function(e,t,n){return RO(e,t,n,r)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function MO(e,t,r,n){switch(e){case"HEX":return function(e){return function(e,t,r,n){let i,o,a="";const s=t/8,u=-1===r?3:0;for(i=0;i<s;i+=1)o=e[i>>>2]>>>8*(u+r*(i%4)),a+="0123456789abcdef".charAt(o>>>4&15)+"0123456789abcdef".charAt(15&o);return n.outputUpper?a.toUpperCase():a}(e,t,r,n)};case"B64":return function(e){return function(e,t,r,n){let i,o,a,s,u,l="";const c=t/8,f=-1===r?3:0;for(i=0;i<c;i+=3)for(s=i+1<c?e[i+1>>>2]:0,u=i+2<c?e[i+2>>>2]:0,a=(e[i>>>2]>>>8*(f+r*(i%4))&255)<<16|(s>>>8*(f+r*((i+1)%4))&255)<<8|u>>>8*(f+r*((i+2)%4))&255,o=0;o<4;o+=1)l+=8*i+6*o<=t?AO.charAt(a>>>6*(3-o)&63):n.b64Pad;return l}(e,t,r,n)};case"BYTES":return function(e){return function(e,t,r){let n,i,o="";const a=t/8,s=-1===r?3:0;for(n=0;n<a;n+=1)i=e[n>>>2]>>>8*(s+r*(n%4))&255,o+=String.fromCharCode(i);return o}(e,t,r)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(e){throw new Error("ARRAYBUFFER not supported by this environment")}return function(e){return function(e,t,r){let n;const i=t/8,o=new ArrayBuffer(i),a=new Uint8Array(o),s=-1===r?3:0;for(n=0;n<i;n+=1)a[n]=e[n>>>2]>>>8*(s+r*(n%4))&255;return o}(e,t,r)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(e){throw new Error("UINT8ARRAY not supported by this environment")}return function(e){return function(e,t,r){let n;const i=t/8,o=-1===r?3:0,a=new Uint8Array(i);for(n=0;n<i;n+=1)a[n]=e[n>>>2]>>>8*(o+r*(n%4))&255;return a}(e,t,r)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function NO(e){const t={outputUpper:!1,b64Pad:"=",outputLen:-1},r=e||{},n="Output length must be a multiple of 8";if(t.outputUpper=r.outputUpper||!1,r.b64Pad&&(t.b64Pad=r.b64Pad),r.outputLen){if(r.outputLen%8!=0)throw new Error(n);t.outputLen=r.outputLen}else if(r.shakeLen){if(r.shakeLen%8!=0)throw new Error(n);t.outputLen=r.shakeLen}if("boolean"!=typeof t.outputUpper)throw new Error("Invalid outputUpper formatting option");if("string"!=typeof t.b64Pad)throw new Error("Invalid b64Pad formatting option");return t}function BO(e,t){return e<<t|e>>>32-t}function UO(e,t,r){return e^t^r}function FO(e,t,r){return e&t^e&r^t&r}function VO(e,t){const r=(65535&e)+(65535&t);return(65535&(e>>>16)+(t>>>16)+(r>>>16))<<16|65535&r}function HO(e,t,r,n,i){const o=(65535&e)+(65535&t)+(65535&r)+(65535&n)+(65535&i);return(65535&(e>>>16)+(t>>>16)+(r>>>16)+(n>>>16)+(i>>>16)+(o>>>16))<<16|65535&o}function qO(e){return[1732584193,4023233417,2562383102,271733878,3285377520]}function zO(e,t){let r,n,i,o,a,s,u;const l=[];for(r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],u=0;u<80;u+=1)l[u]=u<16?e[u]:BO(l[u-3]^l[u-8]^l[u-14]^l[u-16],1),s=u<20?HO(BO(r,5),(c=n)&i^~c&o,a,1518500249,l[u]):u<40?HO(BO(r,5),UO(n,i,o),a,1859775393,l[u]):u<60?HO(BO(r,5),FO(n,i,o),a,2400959708,l[u]):HO(BO(r,5),UO(n,i,o),a,3395469782,l[u]),a=o,o=i,i=BO(n,30),n=r,r=s;var c;return t[0]=VO(r,t[0]),t[1]=VO(n,t[1]),t[2]=VO(i,t[2]),t[3]=VO(o,t[3]),t[4]=VO(a,t[4]),t}function WO(e,t,r,n){let i;const o=15+(t+65>>>9<<4),a=t+r;for(;e.length<=o;)e.push(0);for(e[t>>>5]|=128<<24-t%32,e[o]=4294967295&a,e[o-1]=a/4294967296|0,i=0;i<e.length;i+=16)n=zO(e.slice(i,i+16),n);return n}const GO=class extends class{constructor(e,t,r){const n=r||{};if(this.t=t,this.i=n.encoding||"UTF8",this.numRounds=n.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error("numRounds must a integer >= 1");this.s=e,this.o=[],this.h=0,this.u=!1,this.l=0,this.A=!1,this.p=[],this.R=[]}update(e){let t,r=0;const n=this.U>>>5,i=this.T(e,this.o,this.h),o=i.binLen,a=i.value,s=o>>>5;for(t=0;t<s;t+=n)r+this.U<=o&&(this.F=this.m(a.slice(t,t+n),this.F),r+=this.U);this.l+=r,this.o=a.slice(r>>>5),this.h=o%this.U,this.u=!0}getHash(e,t){let r,n,i=this.g;const o=NO(t);if(this.B){if(-1===o.outputLen)throw new Error("Output length must be specified in options");i=o.outputLen}const a=MO(e,i,this.v,o);if(this.A&&this.Y)return a(this.Y(o));for(n=this.H(this.o.slice(),this.h,this.l,this.C(this.F),i),r=1;r<this.numRounds;r+=1)this.B&&i%32!=0&&(n[n.length-1]&=16777215>>>24-i%32),n=this.H(n,i,0,this.I(this.s),i);return a(n)}setHMACKey(e,t,r){if(!this.L)throw new Error("Variant does not support HMAC");if(this.u)throw new Error("Cannot set MAC key after calling update");const n=DO(t,(r||{}).encoding||"UTF8",this.v);this.M(n(e))}M(e){const t=this.U>>>3,r=t/4-1;let n;if(1!==this.numRounds)throw new Error("Cannot set numRounds with MAC");if(this.A)throw new Error("MAC key already set");for(t<e.binLen/8&&(e.value=this.H(e.value,e.binLen,0,this.I(this.s),this.g));e.value.length<=r;)e.value.push(0);for(n=0;n<=r;n+=1)this.p[n]=909522486^e.value[n],this.R[n]=1549556828^e.value[n];this.F=this.m(this.p,this.F),this.l=this.U,this.A=!0}getHMAC(e,t){const r=NO(t);return MO(e,this.g,this.v,r)(this.N())}N(){let e;if(!this.A)throw new Error("Cannot call getHMAC without first setting MAC key");const t=this.H(this.o.slice(),this.h,this.l,this.C(this.F),this.g);return e=this.m(this.R,this.I(this.s)),e=this.H(t,this.g,this.U,e,this.g),e}}{constructor(e,t,r){if("SHA-1"!==e)throw new Error("Chosen SHA variant is not supported");super(e,t,r);const n=r||{};this.L=!0,this.Y=this.N,this.v=-1,this.T=DO(this.t,this.i,this.v),this.m=zO,this.C=function(e){return e.slice()},this.I=qO,this.H=WO,this.F=[1732584193,4023233417,2562383102,271733878,3285377520],this.U=512,this.g=160,this.B=!1,n.hmacKey&&this.M(function(e,t,r,n){const i="hmacKey must include a value and format";if(!t)throw new Error(i);if(void 0===t.value||!t.format)throw new Error(i);return DO(t.format,t.encoding||"UTF8",r)(t.value)}(0,n.hmacKey,this.v))}};var XO={CvApSoutheast1:{systemName:lO.CvApSoutheast1},CvApSoutheast2:{systemName:lO.CvApSoutheast2},CvEuWest1:{systemName:lO.CvEuWest1},CvNaWest1:{systemName:lO.CvNaWest1}};function KO(e){return KO="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},KO(e)}var YO,QO="r",$O="cv:r",JO="referrer",ZO="cv:originalReferrer",ek=["internalReferrer"],tk=function(){var e=function(){var e=IO.get(ZO);if(e&&"string"==typeof e)return e;var t=document.referrer;if(window.URLSearchParams){var r=new URLSearchParams(window.location.search),n=r.has(JO)&&r.get(JO);r.has(JO)&&r.get(JO)&&(t=n)}return t&&IO.set(ZO,t),t}();return rk()||(e?{originalReferrer:e}:null)};function rk(){var e,t=IO.get($O);if((e=t)&&"object"===KO(e)&&!(Object.keys(e).length<ek.length)&&ek.every((function(t){return"string"==typeof e[t]})))return t;if(IO.remove($O),window.URLSearchParams){var r=new URLSearchParams(window.location.search),n=r.has(QO)&&r.get(QO);if(r.has(QO)&&r.get(QO))try{var i=atob(n),o=JSON.parse(i);return IO.set("cv:r:e",n),IO.set($O,o),rk()}catch(e){IO.remove($O)}}}var nk=new Uint8Array(16);function ik(){if(!YO&&!(YO="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 YO(nk)}const ok=/^(?:[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,ak=function(e){return"string"==typeof e&&ok.test(e)};for(var sk=[],uk=0;uk<256;++uk)sk.push((uk+256).toString(16).substr(1));const lk=function(e,t,r){var n=(e=e||{}).random||(e.rng||ik)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(sk[e[t+0]]+sk[e[t+1]]+sk[e[t+2]]+sk[e[t+3]]+"-"+sk[e[t+4]]+sk[e[t+5]]+"-"+sk[e[t+6]]+sk[e[t+7]]+"-"+sk[e[t+8]]+sk[e[t+9]]+"-"+sk[e[t+10]]+sk[e[t+11]]+sk[e[t+12]]+sk[e[t+13]]+sk[e[t+14]]+sk[e[t+15]]).toLowerCase();if(!ak(r))throw TypeError("Stringified UUID is invalid");return r}(n)};function ck(e){return ck="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},ck(e)}var fk=18e5;function hk(e){return(new Date).getTime()+e}function pk(e,t,r){var n,i=(n=t)===mO.LocalStorage?LO:n===mO.SessionStorage?IO:void 0;if(!(null==i?void 0:i.isAvailable()))return null;var o,a=i.get(e);if(!function(e){return"object"===ck(e)&&"string"==typeof(null==e?void 0:e.id)&&!(!ak(e.id)||4!==function(e){if(!ak(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}(e.id))&&"number"==typeof(null==e?void 0:e.ttl)&&!((null==e?void 0:e.ttl)<=0||isNaN(null==e?void 0:e.ttl))}(a)||(o=null==a?void 0:a.ttl)&&(new Date).getTime()>o){var s={id:lk(),ttl:hk(r)};return i.set(e,s),s.id}var u={id:a.id,ttl:hk(r)};return i.set(e,u),a.id}function dk(e){return dk="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},dk(e)}var yk=function(e){var t=dk(e);return"function"===t||"object"===t&&!!e},mk=function(e){return"function"==typeof e},vk=function(e,t){if(e){var r=e;return e.endsWith("/")||(r+="/"),t?r+=t.startsWith("/")?t.slice(1):t:r}};function gk(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var bk={mobileDevice:/Mobi/i,iphone:/iphone/i,ipad:/ipad/i,android:/android/i,blackberry:/blackberry/i,windowsPhone:/windows phone/i,iosVersion:/OS\s+([\d_.-:]+)\s/i,androidVersion:/android\s+([\d_.-\/]+)[\s;:,\)]/i,blackberryVersion:/(blackberry|version)\s?\d*\/([\d.]+)/i,windowsPhoneVersion:/windows\sphone.*?([\d_.-\/]+)[\s;:,\)]/i,mac:/Mac/i,unix:/X11/i,linux:/Linux/i,windows:/Win/i,win2000:/nt 5.0/i,winXP:/nt 5.1/i,winVista:/nt 6.0/i,win7:/nt 6.1/i,win8:/nt 6.2/i,win81:/nt 6.3/i,win10:/nt 10.0/i,osxVersion:/OS\sX\s([\d_.]+)/i,chrome:/^(?!.*Edge).*Chrome/i,safari:/^(?!.*(?:Chrome|Edge)).*Safari/i,edge:/edge/i,ie:/(msie|trident)/i,opera:/(opr|opera)/i,firefox:/firefox/i,generalVersion:/(chrome|firefox|version)\/(\d+.*?)(\s|$)/i,operaVersion:/(opr|opera)\/(\d+).*?(\s|$)/i,ieVersion:/MSIE\s+(\d+).*?/i,edgeVersion:/(edge)\/(\d+).*?(\s|$)/i},_k="Unknown";function wk(e,t,r){var n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,i=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return gk(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?gk(e,t):void 0}}(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.")}()}(t.exec(r)||[],1)[0];return n||(n=_k),{name:e,version:n}}function Tk(e,t,r){if(!t)return{name:e,version:_k};var n=t.exec(r);return{name:e,version:n&&n.length?n[0].trim():_k}}var Sk=function(){var e=window.navigator.userAgent;return bk.android.test(e)?Tk("Android",bk.androidVersion,e):bk.iphone.test(e)||bk.ipad.test(e)?Tk("iOS",bk.iosVersion,e):bk.linux.test(e)?Tk("Linux",null,e):bk.unix.test(e)?Tk("Unix",null,e):bk.mac.test(e)?Tk("Macintosh",bk.osxVersion,e):bk.windows.test(e)?function(e,t){var r={name:"Windows",version:null};return bk.win2000.test(t)&&(r.version="2000"),bk.winXP.test(t)&&(r.version="XP"),bk.winVista.test(t)&&(r.version="Vista"),bk.win7.test(t)&&(r.version="7"),bk.win8.test(t)&&(r.version="8"),bk.win81.test(t)&&(r.version="8.1"),bk.win10.test(t)&&(r.version="10"),r.version||(r.version=_k),r}(0,e):bk.blackberry.test(e)?Tk("BlackBerry",bk.blackberryVersion,e):bk.windowsPhone.test(e)?Tk("Windows Phone",bk.windowsPhoneVersion,e):{name:_k,version:_k}};function Ek(e){return Ek="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},Ek(e)}function Ok(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,i=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return kk(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?kk(e,t):void 0}}(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 kk(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ck="cv:utmparams",Pk=[["source","utm_source"],["medium","utm_medium"],["campaign","utm_campaign"],["term","utm_term"],["content","utm_content"]],xk=(Pk.reduce((function(e,t){var r=Ok(t,1)[0];return Object.assign(Object.assign({},e),function(e,t,r){return t=function(e){var t=function(e,t){if("object"!=Ek(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Ek(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ek(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},r,r))}),{}),function(){if(!window.URLSearchParams)return null;var e=new URLSearchParams(window.location.search),t={};return Pk.forEach((function(r){var n=Ok(r,2),i=n[0],o=n[1];e.has(o)&&(t[i]=e.get(o))})),function(e){if(Object.keys(e).length)return IO.set(Ck,e),e;var t=IO.get(Ck);return t&&"object"===Ek(t)&&Object.keys(t).length?t:null}(t)});var jk="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==jk&&jk,Lk="URLSearchParams"in jk,Ik="Symbol"in jk&&"iterator"in Symbol,Ak="FileReader"in jk&&"Blob"in jk&&function(){try{return new Blob,!0}catch(e){return!1}}(),Rk="FormData"in jk,Dk="ArrayBuffer"in jk;if(Dk)var Mk=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Nk=ArrayBuffer.isView||function(e){return e&&Mk.indexOf(Object.prototype.toString.call(e))>-1};function Bk(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function Uk(e){return"string"!=typeof e&&(e=String(e)),e}function Fk(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return Ik&&(t[Symbol.iterator]=function(){return t}),t}function Vk(e){this.map={},e instanceof Vk?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function Hk(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function qk(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function zk(e){var t=new FileReader,r=qk(t);return t.readAsArrayBuffer(e),r}function Wk(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function Gk(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:Ak&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:Rk&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:Lk&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():Dk&&Ak&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=Wk(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Dk&&(ArrayBuffer.prototype.isPrototypeOf(e)||Nk(e))?this._bodyArrayBuffer=Wk(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):Lk&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Ak&&(this.blob=function(){var e=Hk(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?Hk(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(zk)}),this.text=function(){var e,t,r,n=Hk(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=qk(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Rk&&(this.formData=function(){return this.text().then(Yk)}),this.json=function(){return this.text().then(JSON.parse)},this}Vk.prototype.append=function(e,t){e=Bk(e),t=Uk(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},Vk.prototype.delete=function(e){delete this.map[Bk(e)]},Vk.prototype.get=function(e){return e=Bk(e),this.has(e)?this.map[e]:null},Vk.prototype.has=function(e){return this.map.hasOwnProperty(Bk(e))},Vk.prototype.set=function(e,t){this.map[Bk(e)]=Uk(t)},Vk.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},Vk.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),Fk(e)},Vk.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),Fk(e)},Vk.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),Fk(e)},Ik&&(Vk.prototype[Symbol.iterator]=Vk.prototype.entries);var Xk=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Kk(e,t){if(!(this instanceof Kk))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,n,i=(t=t||{}).body;if(e instanceof Kk){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Vk(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new Vk(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),Xk.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function Yk(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function Qk(e,t){if(!(this instanceof Qk))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"",this.headers=new Vk(t.headers),this.url=t.url||"",this._initBody(e)}Kk.prototype.clone=function(){return new Kk(this,{body:this._bodyInit})},Gk.call(Kk.prototype),Gk.call(Qk.prototype),Qk.prototype.clone=function(){return new Qk(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Vk(this.headers),url:this.url})},Qk.error=function(){var e=new Qk(null,{status:0,statusText:""});return e.type="error",e};var $k=[301,302,303,307,308];Qk.redirect=function(e,t){if(-1===$k.indexOf(t))throw new RangeError("Invalid status code");return new Qk(null,{status:t,headers:{location:e}})};var Jk=jk.DOMException;try{new Jk}catch(e){(Jk=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack}).prototype=Object.create(Error.prototype),Jk.prototype.constructor=Jk}function Zk(e,t){return new Promise((function(r,n){var i=new Kk(e,t);if(i.signal&&i.signal.aborted)return n(new Jk("Aborted","AbortError"));var o=new XMLHttpRequest;function a(){o.abort()}o.onload=function(){var e,t,n={status:o.status,statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",t=new Vk,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};n.url="responseURL"in o?o.responseURL:n.headers.get("X-Request-URL");var i="response"in o?o.response:o.responseText;setTimeout((function(){r(new Qk(i,n))}),0)},o.onerror=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},o.ontimeout=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},o.onabort=function(){setTimeout((function(){n(new Jk("Aborted","AbortError"))}),0)},o.open(i.method,function(e){try{return""===e&&jk.location.href?jk.location.href:e}catch(t){return e}}(i.url),!0),"include"===i.credentials?o.withCredentials=!0:"omit"===i.credentials&&(o.withCredentials=!1),"responseType"in o&&(Ak?o.responseType="blob":Dk&&i.headers.get("Content-Type")&&-1!==i.headers.get("Content-Type").indexOf("application/octet-stream")&&(o.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof Vk?i.headers.forEach((function(e,t){o.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){o.setRequestHeader(e,Uk(t.headers[e]))})),i.signal&&(i.signal.addEventListener("abort",a),o.onreadystatechange=function(){4===o.readyState&&i.signal.removeEventListener("abort",a)}),o.send(void 0===i._bodyInit?null:i._bodyInit)}))}function eC(e){return eC="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},eC(e)}function tC(){tC=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new j(n||[]);return i(a,"_invoke",{value:k(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(L([])));T&&T!==r&&n.call(T,a)&&(_=T);var S=b.prototype=v.prototype=Object.create(_);function E(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function r(i,o,a,s){var u=f(e[i],e,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==eC(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function k(t,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(t,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,C(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function L(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(eC(t)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},E(O.prototype),l(O.prototype,s,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new O(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=L,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function rC(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,nC(n.key),n)}}function nC(e){var t=function(e,t){if("object"!=eC(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=eC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==eC(t)?t:t+""}Zk.polyfill=!0,jk.fetch||(jk.fetch=Zk,jk.Headers=Vk,jk.Request=Kk,jk.Response=Qk);var iC,oC,aC=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},sC="unknown",uC=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=t,this.initialize()},t=[{key:"initialize",value:function(){this.validateOptions(),this.options.logUtmParameters&&(this.utmParameters=xk()),this.options.logAttributionData&&(this.attributionData=tk())}},{key:"name",get:function(){return"CollectionApiClient"}},{key:"log",value:function(e){return aC(this,void 0,void 0,tC().mark((function t(){return tC().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!Array.isArray(e)){t.next=2;break}return t.abrupt("return",this.logBulk(e));case 2:if(this.shouldLog(e)){t.next=4;break}return t.abrupt("return");case 4:return this.validateEvent(e),t.t0=this,t.next=8,this.formatData(e);case 8:return t.t1=t.sent,t.next=11,t.t0.postData.call(t.t0,t.t1);case 11:case"end":return t.stop()}}),t,this)})))}},{key:"logBulk",value:function(e){return aC(this,void 0,void 0,tC().mark((function t(){var r,n,i=this;return tC().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.filter((function(e){return i.shouldLog(e)})),r.length){t.next=3;break}return t.abrupt("return");case 3:return r.forEach((function(e){return i.validateEvent(e)})),t.next=6,Promise.all(r.map((function(e){return i.formatData(e)})));case 6:return n=t.sent,t.next=9,this.postData(n);case 9:case"end":return t.stop()}}),t,this)})))}},{key:"validateOptions",value:function(){if(!mk(this.options.getUser))throw new Error("getUser option is required.")}},{key:"shouldLog",value:function(e){return!mk(this.options.shouldLog)||this.options.shouldLog(e)}},{key:"postData",value:function(e){return aC(this,void 0,void 0,tC().mark((function t(){var r,n,i,o,a;return tC().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getRegionalUrl(this.options.collectionApiUrls);case 2:return r=t.sent,n=JSON.stringify(e),i=Object.assign({"Content-Type":"application/json"},this.getSignatureHeader(n)),o=vk(r,"/v1/ingest"),Array.isArray(e)&&(o=vk(o,"/bulk")),t.prev=7,t.next=10,fetch(o,{method:"POST",mode:"cors",headers:i,body:n});case 10:(a=t.sent).ok||this.logError(new Error("CollectionApiClient failed to log event. Status: ".concat(a.status," ").concat(a.statusText))),t.next=17;break;case 14:t.prev=14,t.t0=t.catch(7),this.logError(t.t0);case 17:case"end":return t.stop()}}),t,this,[[7,14]])})))}},{key:"getSignatureHeader",value:function(e){var t=new GO("SHA-1","TEXT",{hmacKey:{value:"zXJL9nOHxzDlMUDjiP41",format:"TEXT",encoding:"UTF8"}});return t.update(e),{"cv-analytics-signature":"".concat(this.options.collectionApiClientId,".").concat(t.getHash("B64"))}}},{key:"getRegionalUrl",value:function(e){return aC(this,void 0,void 0,tC().mark((function t(){var r;return tC().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getRegion();case 2:r=t.sent,t.t0=r.systemName,t.next=t.t0===lO.CvEuWest1?6:t.t0===lO.CvApSoutheast2?7:t.t0===lO.CvNaWest1?8:(t.t0,lO.CvApSoutheast1,9);break;case 6:return t.abrupt("return",e.cvEuWest1);case 7:return t.abrupt("return",e.cvApSoutheast2);case 8:return t.abrupt("return",e.cvNaWest1);case 9:return t.abrupt("return",e.cvApSoutheast1);case 10:case"end":return t.stop()}}),t,this)})))}},{key:"validateEvent",value:function(e){"string"!=typeof e.type&&this.logError(new Error("Event type is required."),!0),yk(e.actionContext)||this.logError(new Error("Event actionContext is required."),!0),e.actionContext.entity||this.logError(new Error("Event actionContext entity is required."),!0)}},{key:"formatData",value:function(e){return aC(this,void 0,void 0,tC().mark((function t(){return tC().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=e.type,t.next=3,this.getEventData(e);case 3:return t.t1=t.sent,t.t2=this.getEventMetadata(e),t.abrupt("return",{type:t.t0,data:t.t1,metadata:t.t2});case 6:case"end":return t.stop()}}),t,this)})))}},{key:"getEventData",value:function(e){return aC(this,void 0,void 0,tC().mark((function t(){var r,n,i,o,a,s,u,l=this;return tC().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.actionContext,n=this.getPlatformMetadata(),t.next=4,this.getUserData();case 4:return i=t.sent,o={user:i,action:r,platform:n,product:{name:this.options.productName,version:this.options.productVersion},session:this.getSessionData()},this.utmParameters&&(o.utm=this.utmParameters),a=this.extractData(e),s=Object.keys(o).map((function(e){return e.toLowerCase()})),u=Object.keys(a).map((function(e){return e.toLowerCase()})),s.forEach((function(e){u.includes(e)&&l.logError(new Error("".concat(e," is a reserved key.")),!0)})),t.abrupt("return",Object.assign(Object.assign({},o),a));case 12:case"end":return t.stop()}}),t,this)})))}},{key:"extractData",value:function(e){return mk(this.options.formatData)?this.options.formatData(e):(t={},r=e.actionContext.entity,n=e.data,(r=nC(r))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t);var t,r,n}},{key:"getUserData",value:function(){var e,t;return aC(this,void 0,void 0,tC().mark((function r(){var n;return tC().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this.options.getUser();case 3:if(null==(n=r.sent)?void 0:n.id){r.next=6;break}return r.abrupt("return");case 6:return r.t0=n.id,r.t1=(null===(e=n.role)||void 0===e?void 0:e.toLowerCase())||sC,r.t2=(null===(t=n.userGroup)||void 0===t?void 0:t.toLowerCase())||Cc.Unknown,r.t3=this.normalizeYearGroup(n.yearGroup),r.t4=n.customerId,r.t5=n.customerName,r.t6=n.customerGuid,r.t7=n.crmId,r.t8=n.countryCode,r.next=17,this.getRegion();case 17:return r.t9=r.sent,r.t10=n.accessPolicy,r.t11={id:r.t4,name:r.t5,customerGuid:r.t6,crmId:r.t7,country:r.t8,region:r.t9,openCustomer:!1,accessPolicy:r.t10},r.abrupt("return",{id:r.t0,role:r.t1,userGroup:r.t2,yearGroup:r.t3,customer:r.t11});case 23:r.prev=23,r.t12=r.catch(0),this.logError(r.t12);case 26:case"end":return r.stop()}}),r,this,[[0,23]])})))}},{key:"getRegion",value:function(){return aC(this,void 0,void 0,tC().mark((function e(){var t,r;return tC().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.options.regionName,e.prev=1,e.next=4,this.options.getUser();case 4:(null==(r=e.sent)?void 0:r.instanceRegion)&&(t=r.instanceRegion),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),this.logError(e.t0);case 11:return t||this.logError(new Error("RegionName is not set."),!0),e.abrupt("return",this.getRegionByName(t.toLowerCase()));case 13:case"end":return e.stop()}}),e,this,[[1,8]])})))}},{key:"getSessionData",value:function(){return e=pk("cv:session",mO.LocalStorage,fk),t=pk("cv:window",mO.SessionStorage,fk),e||t?{id:e,windowId:t}:null;var e,t}},{key:"getPlatformMetadata",value:function(){var e,t,r,n={url:window.location.href,referrer:document.referrer};return(null===(e=this.attributionData)||void 0===e?void 0:e.internalReferrer)&&(n.internalReferrer=this.attributionData.internalReferrer),(null===(t=this.attributionData)||void 0===t?void 0:t.originalReferrer)&&(n.originalReferrer=this.attributionData.originalReferrer),{browser:(r=window.navigator.userAgent,bk.chrome.test(r)?wk("Chrome",bk.generalVersion,r):bk.firefox.test(r)?wk("Firefox",bk.generalVersion,r):bk.safari.test(r)?wk("Safari",bk.generalVersion,r):bk.ie.test(r)?wk("Internet Explorer",bk.ieVersion,r):bk.edge.test(r)?wk("Edge",bk.edgeVersion,r):bk.opera.test(r)?wk("Opera",bk.operaVersion,r):{name:_k,version:_k}),os:Sk(),request:n,screenResolution:"".concat(window.screen.width,"x").concat(window.screen.height),viewportResolution:"".concat(window.innerWidth,"x").concat(window.innerHeight)}}},{key:"getEventMetadata",value:function(e){return{client:{name:"".concat(this.name,".ts"),version:"1.43.0-rc.0",region:this.getRegionByName(this.options.regionName)},timestamp:(new Date).toISOString(),eventVersion:e.eventVersion}}},{key:"getRegionByName",value:function(e){var t;return Object.values(XO).forEach((function(r){r.systemName===e&&(t=r)})),t}},{key:"normalizeYearGroup",value:function(e){return e?e.toLowerCase().split(" ").join("_"):sC}},{key:"logError",value:function(e,t){if(this.options.logError&&this.options.logError(e),t)throw e}}],t&&rC(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),lC=function(e){return e},cC=function(){return!0},fC=function(){return!1},hC={getUploadData:function(e,t){var r=t.actionContext.entity;if(r===zl.Video)return hC.formatVideoUpload(e,t);if(r===zl.Resource||r===zl.Subtitle)return hC.formatResourceUpload(e);if(r===zl.Banner||r===zl.Thumbnail)return e;throw new Error("Upload data event not correctly formatted.")},formatVideoUpload:function(e,t){var r=t.actionContext.workflowPhase;return r===Gl.Start?hC.getStartVideoUploadData(e):r===Gl.Discard?hC.getDiscardVideoUploadData(e):r===Gl.Complete?hC.getCompleteUploadData(e):void 0},getStartVideoUploadData:function(e){return e&&e.length?(e instanceof FileList&&(e=Array.from(e)),e.map((function(t){return{fileName:t.name,size:t.size,type:t.type,count:e.length}}))):[]},getDiscardVideoUploadData:function(e){var t=function(t){var r=t.file,n=r.type,i=r.name,o=r.status,a=r.cvUpload,s={fileName:i,count:Array.isArray(e)?e.length:1,type:n,status:o};return t.progress&&(s.progress=t.progress.toFixed(2)),a&&(s.uploadId=a.uploadId),s};return Array.isArray(e)?e.map((function(e){return t(e)})):[t(e)]},getCompleteUploadData:function(e){return e&&e.length?e.map((function(t){return{fileName:t.fileName,libraryId:t.libraryId,folderId:t.folderId,autoCaption:t.autoCaption,count:e.length}})):[]},formatResourceUpload:function(e){var t={id:e.id,name:e.name};return yk(e.metadata)&&(t.type=e.metadata.type),t}};function pC(e){return pC="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},pC(e)}function dC(e,t,r){return t=function(e){var t=function(e,t){if("object"!=pC(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=pC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==pC(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var yC=(dC(dC(dC(dC(dC(dC(dC(dC(dC(dC(iC={},ql.Navigate,fC),ql.Click,cC),ql.Search,cC),ql.InstantSearch,cC),ql.Play,cC),ql.Stream,cC),ql.WebPlayerStream,cC),ql.StreamProgress,cC),ql.Rename,cC),ql.Move,cC),dC(dC(dC(dC(dC(dC(dC(dC(dC(dC(iC,ql.Create,cC),ql.Delete,cC),ql.Associate,cC),ql.Dissociate,cC),ql.Filter,cC),ql.Sort,cC),ql.Approve,cC),ql.Reject,cC),ql.Disable,cC),ql.Upload,cC),dC(dC(dC(dC(dC(dC(dC(dC(dC(dC(iC,ql.Download,fC),ql.SetAccess,cC),ql.AddToLocalCache,fC),ql.Share,cC),ql.Unshare,cC),ql.Edit,cC),ql.Suggest,cC),ql.Favourite,cC),ql.WorkspaceAdd,cC),ql.ResolveWarning,cC),dC(dC(dC(dC(dC(dC(dC(dC(dC(dC(iC,ql.DismissWarning,cC),ql.EditAssoc,cC),ql.Follow,cC),ql.Print,cC),ql.Copy,cC),ql.Activate,cC),ql.VerifyEmail,cC),ql.ChangePassword,cC),ql.Export,cC),ql.SendEmail,cC),dC(dC(dC(dC(dC(dC(dC(dC(dC(dC(iC,ql.Publish,cC),ql.Submit,cC),ql.Complete,cC),ql.Archive,cC),ql.Promote,cC),ql.Demote,cC),ql.BulkAction,cC),ql.Remove,cC),ql.Dismiss,cC),ql.Open,cC),dC(dC(dC(dC(dC(dC(dC(dC(iC,ql.Hide,cC),ql.PageView,cC),ql.Select,cC),ql.SwitchCustomer,cC),ql.Focus,cC),ql.Blur,cC),ql.Hover,cC),ql.Unhover,cC)),mC=(dC(dC(dC(dC(dC(dC(dC(dC(dC(dC(oC={},ql.Search,lC),ql.InstantSearch,lC),ql.Play,lC),ql.Stream,lC),ql.StreamProgress,lC),ql.Click,lC),ql.Filter,lC),ql.Sort,lC),ql.SetAccess,lC),ql.Approve,lC),dC(dC(dC(dC(dC(dC(dC(dC(dC(dC(oC,ql.Reject,lC),ql.Create,lC),ql.Delete,lC),ql.Rename,lC),ql.Move,lC),ql.Edit,lC),ql.Share,(function(e){var t,r,n,i,o={id:e.id,search:e.search,pagePositionIndex:e.pagePositionIndex};return(null===(t=e.video)||void 0===t?void 0:t.id)&&(o.video={id:e.video.id}),(null===(r=e.clip)||void 0===r?void 0:r.id)&&(o.clip={id:e.clip.id},(null===(n=e.clip.video)||void 0===n?void 0:n.id)&&(o.video={id:null===(i=e.clip.video)||void 0===i?void 0:i.id})),void 0!==e.shareCount&&(o.shareCount=e.shareCount),e.embedDetails&&(o.embedDetails=o.embedDetails),o})),ql.Disable,lC),ql.Suggest,lC),ql.Upload,hC.getUploadData),dC(dC(dC(dC(dC(oC,ql.ResolveWarning,lC),ql.DismissWarning,lC),ql.Follow,lC),ql.Print,lC),ql.Copy,lC)),vC=dC(dC(dC(dC({},ql.Search,(function(){return"search"})),ql.InstantSearch,(function(){return"search"})),ql.Filter,(function(){return"filter"})),ql.Stream,(function(){return zl.Video})),gC={user:"target_user",product:"target_product"},bC=dC(dC({},ql.StreamProgress,!0),ql.WebPlayerStream,!0),_C={shouldLog:function(e){return!!yC[e.type](e)},formatData:function(e){var t=mC[e.type],r=mk(t)?t(e.data,e):e.data;if(bC[e.type])return r;var n=e.actionContext.entity;return mk(vC[e.type])&&(n=vC[e.type](e)),gC[n]&&(n=gC[n]),dC({},n,r)}};function wC(e){return wC="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},wC(e)}function TC(){TC=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new j(n||[]);return i(a,"_invoke",{value:k(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(L([])));T&&T!==r&&n.call(T,a)&&(_=T);var S=b.prototype=v.prototype=Object.create(_);function E(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function r(i,o,a,s){var u=f(e[i],e,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==wC(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function k(t,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(t,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,C(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function L(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(wC(t)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},E(O.prototype),l(O.prototype,s,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new O(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=L,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function SC(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,EC(n.key),n)}}function EC(e){var t=function(e,t){if("object"!=wC(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=wC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==wC(t)?t:t+""}var OC,kC=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=t,this.initialize()},(t=[{key:"logStream",value:function(){var e="v:".concat(this.options.videoId);LO.cacheExists(e)||(this.collectionApiClient.log({type:ql.WebPlayerStream,actionContext:this.getActionContext(),data:this.getAnalyticsData(),eventVersion:kc.V3}),LO&&LO.cacheSet(e,null,300))}},{key:"logVideoProgress",value:function(e){var t=this,r=this.getAnalyticsData();this.collectionApiClient.log(e.map((function(e){return{type:ql.StreamProgress,actionContext:t.getActionContext(),data:Object.assign(Object.assign({},r),{progress:e}),eventVersion:kc.V2}})))}},{key:"logUserAction",value:function(e,t){var r=Object.assign(Object.assign({},this.getAnalyticsData()),e),n=Object.assign(Object.assign({},this.getActionContext()),t);this.collectionApiClient.log({type:t.actionType,data:r,actionContext:n,eventVersion:t.eventVersion||kc.V2})}},{key:"getAnalyticsData",value:function(){var e=Object.assign({video:{id:this.options.videoId},flags:{isUsingLocalCache:this.options.isUsingLocalCache}},this.options.additionalAnalyticsData||{});this.options.shareId&&(e.video.shareId=this.options.shareId);var t=this.getEntityType();return t===zl.Interactive?e.interactive={id:+this.options.mediaId}:t===zl.Clip&&(e.clip={id:+this.options.mediaId}),e}},{key:"initialize",value:function(){this.setupCollectionApiClient()}},{key:"setupCollectionApiClient",value:function(){var e=this;this.collectionApiClient=new uC({productName:"player.web",productVersion:this.options.productVersion,regionName:this.options.regionName,collectionApiUrls:this.options.collectionApiUrls,collectionApiClientId:this.options.collectionApiClientId,getUser:function(){return e.getCurrentUser()},shouldLog:_C.shouldLog,formatData:_C.formatData})}},{key:"getCurrentUser",value:function(){return e=this,t=void 0,r=void 0,n=TC().mark((function e(){return TC().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{id:this.options.userId,customerId:this.options.customerId});case 1:case"end":return e.stop()}}),e,this)})),new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}));var e,t,r,n}},{key:"getActionContext",value:function(){return{entity:this.getEntityType(),location:this.getLocationContext(),productArea:void 0,descriptor:this.options.isEmbedded?tc.Embedded:void 0,workflowPhase:void 0}}},{key:"getEntityType",value:function(){switch(this.options.mediaType){case"MasterVideo":return zl.Video;case"MasterInteractive":return zl.Interactive;case"MasterClip":return zl.Clip}}},{key:"getLocationContext",value:function(){switch(this.options.playerType){case"player":return Wl.Player;case"interactive-player":return Wl.InteractivePlayer;case"create-clip-player":return Wl.CreateClipPlayer}}}])&&SC(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function CC(e){return CC="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},CC(e)}function PC(){PC=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new j(n||[]);return i(a,"_invoke",{value:k(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(L([])));T&&T!==r&&n.call(T,a)&&(_=T);var S=b.prototype=v.prototype=Object.create(_);function E(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function r(i,o,a,s){var u=f(e[i],e,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==CC(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function k(t,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(t,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,C(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function L(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(CC(t)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},E(O.prototype),l(O.prototype,s,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new O(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=L,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function xC(e){return function(e){if(Array.isArray(e))return jC(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return jC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?jC(e,t):void 0}}(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 jC(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function LC(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,IC(n.key),n)}}function IC(e){var t=function(e,t){if("object"!=CC(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=CC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==CC(t)?t:t+""}!function(e){e.PhysicallyChapteredVideo="physically-chaptered-video"}(OC||(OC={}));var AC,RC=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},DC=yl.getComponent("Player"),MC=function(){return e=function e(t,r){var n=this;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.streamLogged=!1,this.options=yl.mergeOptions({},e.options_,r),null===this.options.playerApi)throw new Error("PlayerApi required");this.initialize(),this.createEl(t),this.buildVideoJs(),this.options.splash&&this.setupSplash(this.options.splash),this.bindEventListeners(),this.setupSeekBar(),this.fetchConfig(),this.logStream=this.logStream.bind(this),this.player.ready((function(){n._configurePlugins(),n.options.setup&&n.options.setup(n.options,n.player),n.fetch().catch((function(e){return n.handleFetchError(e)}))}))},t=[{key:"initialize",value:function(){}},{key:"_configurePlugins",value:function(){this.player.configureMenuDimensionsPlugin({mobile:this.options.mobile,overflowControls:this.options.overflowControls,seekBarName:this.getSeekBarName()}),this.player.progressReporterPlugin({onFlush:this.onFlushProgress=this.onFlushProgress.bind(this)}),this.player.persistVolumePlugin(),!this.options.mobile&&this.options.allowFullscreen&&this.player.fullscreenOnRotatePlugin(),this.player.touchControls(),this.options.getExternalLink&&this.player.openExternallyPlugin({getExternalLink:this.options.getExternalLink}),this.configurePlugins()}},{key:"configurePlugins",value:function(){}},{key:"onFlushProgress",value:function(e){var t;null===(t=this.analyticsService)||void 0===t||t.logVideoProgress(e)}},{key:"buildVideoJs",value:function(){return this.player=yl(this.el,this.getPlayerOptions())}},{key:"getInactivityTimeout",value:function(){if("number"==typeof this.options.inactivityTimeout)return this.options.inactivityTimeout;var e=500;return(this.options.mobile||yl.browser.IS_IOS||yl.browser.IS_ANDROID)&&(e=3e3),e}},{key:"getPlayerOptions",value:function(){var e=this,t=DC.prototype.options_.children;return t=t.filter((function(e){return"bigPlayButton"!==e&&"posterImage"!==e})),{controls:this.options.controls,fluid:!this.options.embed&&!this.options.mobile,fill:this.options.embed||this.options.mobile,inactivityTimeout:this.getInactivityTimeout(),controlBar:{children:["timeWrapper","progressControl"]},children:[].concat(xC(t),[{name:"collapserator",children:xb.filter((function(t){return!("fullscreenToggle"===t&&!e.options.allowFullscreen)}))},"playPauseFeedback","controlBarGradient"]),userActions:{hotkeys:function(t){return function(e,t,r){var n=p()(e);("f"!==n||r.allowFullscreen)&&vO[n]&&(["space"].includes(n)&&(e.preventDefault(),e.stopPropagation()),vO[n](t,e))}(t,e.player,e.options)}},playbackRates:this.options.playbackRates,techOrder:["html5"],html5:{nativeTextTracks:!1},playsinline:!0,aspectRatio:this.options.aspectRatio,mobile:this.options.mobile,deferMenus:this.options.deferMenus,muted:this.options.muted,devicesConfig:this.options.devicesConfig}}},{key:"getPlaybackObject",value:function(){return RC(this,void 0,void 0,PC().mark((function e(){var t,r,n=this;return PC().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.options.offlinePlaybackObject){e.next=2;break}return e.abrupt("return",this.options.offlinePlaybackObject);case 2:if(t=this.options.fetch,void 0===this.options.fetch&&(t=function(e){var t="".concat(n.options.playerApi.origin,"/api/playback?viewKey=").concat(e);return Fh.get(t)}),this.options.viewKey){e.next=6;break}throw new Error("Please specify a viewKey or a fetch function");case 6:return e.next=8,t(this.options.viewKey);case 8:if(r=e.sent){e.next=11;break}throw new Error("Error fetching playback object");case 11:return e.abrupt("return",r);case 12:case"end":return e.stop()}}),e,this)})))}},{key:"setChaptersInternal",value:function(e,t){var r=Eg.getTrack(this.player,"chapters",null);r||(r=this.player.addTextTrack("chapters")),xC(r.cues.cues_).forEach((function(e){return r.removeCue(e)})),e.forEach((function(e){r.addCue({startTime:e.timestamp,endTime:e.endTimestamp,text:e.name})})),t&&r.trigger({type:"cv:cuechange",target:r}),r.trigger({type:"loadeddata",target:r})}},{key:"setChapters",value:function(e){this.setChaptersInternal(e,!0)}},{key:"setPlayerMode",value:function(e,t){this.player.playerModePlugin().setPlayerMode(e,t)}},{key:"setFavourite",value:function(e,t){this.player.favouritePlugin().setFavourite(e,t)}},{key:"fetch",value:function(){var e,t,r,n,i;return RC(this,void 0,void 0,PC().mark((function o(){var a,s,u,l=this;return PC().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.getPlaybackObject();case 2:if(a=o.sent,!this.isDisposed()){o.next=5;break}return o.abrupt("return");case 5:s="MasterClip"===a.mediaType,u=null===(e=a.additionalData)||void 0===e?void 0:e.clipData,(null===(r=null===(t=a.chapters)||void 0===t?void 0:t.list)||void 0===r?void 0:r.length)>0&&!s&&!u&&this.setChaptersInternal(a.chapters.list,!1),this.player.localCache({localCacheAddresses:null!==(n=a.localCacheAddresses)&&void 0!==n?n:[],enabled:null===(i=this.options.enableLocalCache)||void 0===i||i}),this.player.progressiveFiles({sources:a.files.progressive.map((function(e){return{id:e.profile,mimeType:e.mimeType,url:e.url}}))}),this.player.handleNetworkErrors({playerApi:this.options.playerApi,fileToken:a.files.fileToken}),a.subtitles.list.length>0&&a.subtitles.list.forEach((function(e){if("text/vtt"===e.mimeType){var t=l.player.addRemoteTextTrack({kind:"subtitles",src:e.url,language:e.language,label:e.label},!0);Eg.sanitizeTrack(t.track,l.player)}})),a.posterUrl&&this.player.poster(a.posterUrl),this.setupSplash({title:a.title,posterUrl:a.posterUrl,episodeNumber:a.episodeNumber,ratingCode:a.ratingCode,seasonNumber:a.seasonNumber,seriesName:a.seriesName}),this.additionalSetup(a),this.handleAutoplay(a),this.options.startTime&&this.player.ready((function(){l.player.currentTime(l.options.startTime)})),this.player.trigger("cv-playback-data-loaded",a);case 18:case"end":return o.stop()}}),o,this)})))}},{key:"handleFetchError",value:function(e){var t,r=e.message;e instanceof Rh&&(null===(t=e.response)||void 0===t?void 0:t.type)===OC.PhysicallyChapteredVideo&&(r="Video cannot be played because it is either corrupt or damaged."),this.player.error(r),this.options.onError&&this.options.onError(e)}},{key:"fetchConfig",value:function(){return RC(this,void 0,void 0,PC().mark((function e(){var t;return PC().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(AC||this.options.fetch||this.options.offlinePlaybackObject)){e.next=2;break}return e.abrupt("return");case 2:return t="".concat(this.options.playerApi.origin,"/api/config"),e.next=5,Fh.get(t);case 5:if(AC=e.sent,!this.isDisposed()){e.next=8;break}return e.abrupt("return");case 8:this.trigger("config:loaded");case 9:case"end":return e.stop()}}),e,this)})))}},{key:"additionalSetup",value:function(e){var t,r=this;this.player.whiteboardModePlugin(),this.player.deferMenusPlugin();var n=this.options.enableLocalCache&&!!(null===(t=e.localCacheAddresses)||void 0===t?void 0:t.length);AC?this.setupAnalyticsService(e,n):this.one("config:loaded",(function(){return r.setupAnalyticsService(e,n)})),this.analyticsService||!this.isAnalyticsEnabled()?this.setupAnalyticsDependentPlugins(e):this.one("analytics:loaded",(function(){return r.setupAnalyticsDependentPlugins(e)}))}},{key:"setupAnalyticsService",value:function(e,t){this.options.eventLogging&&(this.analyticsService=new kC({collectionApiUrls:AC.collectionApi.urls,collectionApiClientId:AC.collectionApi.clientId,productVersion:"1.18.0-rc.0",videoId:e.videoId,mediaId:e.mediaId,userId:e.viewerId,shareId:e.shareId,customerId:e.viewerCustomerId,mediaType:e.mediaType,playerType:this.getAnalyticsPlayerType(),isEmbedded:this.options.embed,isUsingLocalCache:t,additionalAnalyticsData:this.getAdditionalAnalyticsData(e),regionName:e.instanceRegion||this.options.sharerInstanceRegion||lO.CvApSoutheast1}),this.on("timeupdate",this.logStream),this.trigger("analytics:loaded"))}},{key:"setupAnalyticsDependentPlugins",value:function(e){var t,r,n,i;this.player.persistSubtitleSettingsPlugin({showSubtitles:null===(t=e.settings)||void 0===t?void 0:t.showSubtitles,subtitleSize:null===(r=e.settings)||void 0===r?void 0:r.playbackSubtitleSizeDefault,analyticsService:this.analyticsService}),this.player.persistQualitySettingsPlugin({playbackProfile:null===(n=e.settings)||void 0===n?void 0:n.playbackProfile,playbackProfileLocalCache:null===(i=e.settings)||void 0===i?void 0:i.playbackProfileLocalCache,analyticsService:this.analyticsService}),this.player.persistPlaybackRatePlugin({analyticsService:this.analyticsService})}},{key:"getAdditionalAnalyticsData",value:function(e){return{}}},{key:"isAnalyticsEnabled",value:function(){return!this.options.fetch&&!this.options.offlinePlaybackObject&&this.options.eventLogging}},{key:"handleAutoplay",value:function(e){var t=this;this.options.autoplay&&this.player.ready((function(){t.player.play().catch((function(){t.isDisposed()||t.showSplash()}))}))}},{key:"logStream",value:function(){this.analyticsService&&(this.player.currentTime()<3||this.streamLogged||(this.analyticsService.logStream(),this.streamLogged=!0,this.off("timeupdate",this.logStream)))}},{key:"getAnalyticsPlayerType",value:function(){return"player"}},{key:"createEl",value:function(e){var t;"string"==typeof e?(e=function(e){return 0===e.indexOf("#")?e.slice(1):e}(e),t=yl.dom.$("#"+e)):t=e;var r="video-js";return this.getPlayerClassName()&&(r+=" ".concat(this.getPlayerClassName())),this.el=yl.dom.createEl("video",{},{class:r}),t.appendChild(this.el),this.el}},{key:"getPlayerClassName",value:function(){return""}},{key:"on",value:function(e,t){this.player.on(e,t)}},{key:"one",value:function(e,t){this.player.one(e,t)}},{key:"off",value:function(e,t){this.player.off(e,t)}},{key:"trigger",value:function(e,t){return this.player.trigger(e,t)}},{key:"dispose",value:function(){this.player.dispose()}},{key:"ready",value:function(e){this.player.ready(e)}},{key:"isDisposed",value:function(){return this.player.isDisposed()}},{key:"play",value:function(){this.player.play()}},{key:"pause",value:function(){this.player.pause()}},{key:"isPaused",value:function(){return this.player.paused()}},{key:"currentTime",value:function(e){return this.player.currentTime(e)}},{key:"muted",value:function(e){return this.player.muted(e)}},{key:"duration",value:function(){return this.player.duration()}},{key:"isFullscreen",value:function(){return this.player.isFullscreen()}},{key:"requestFullscreen",value:function(){this.player.requestFullscreen()}},{key:"exitFullscreen",value:function(){this.player.exitFullscreen()}},{key:"playbackRate",value:function(e){return this.player.playbackRate(e)}},{key:"quality",value:function(e){for(var t=this.player.qualityLevels(),r=0;r<t.length;r++){var n=t[r];if(e)n.enabled=n.id===e.toString();else if(n.enabled)return n.id}}},{key:"subtitles",value:function(e){for(var t=this.player.textTracks(),r=0;r<t.length;r++){var n=t[r];if(void 0===e){if("showing"===n.mode)return n.label}else n.label===e?n.mode="showing":n.mode="disabled"}}},{key:"bindEventListeners",value:function(){var e=this,t=function(e){return e.preventDefault()};if(this.showSplash=this.showSplash.bind(this),this.hideSplash=this.hideSplash.bind(this),this.player.on("ended",this.showSplash),this.player.on("play",this.hideSplash),this.player.tech(!0).on("contextmenu",t),this.player.one("dispose",(function(){e.off("ended",e.showSplash),e.off("play",e.hideSplash),e.player.tech(!0).off("contextmenu",t)})),this.options.hotkeyElQuerySelector){var r=yl.dom.$(this.options.hotkeyElQuerySelector);r&&(this.player.on(r,"keydown",this.player.handleKeyDown),this.player.one("dispose",(function(){e.player.off(r,"keydown",e.player.handleKeyDown)})))}}},{key:"setupSeekBar",value:function(){var e=this.getSeekBarName(),t=this.player.controlBar.getChild("progressControl");t.addChild(e,this.getSeekBarOptions()),t.setSeekBarName(e)}},{key:"setupSplash",value:function(e){this._splashAdded||(this._splashAdded=!0,this.player.addChild("posterImage",Object.assign({embed:this.options.embed},e)),this.player.addChild("bigPlayButton"),this.options.autoplay?this.hideSplash():this.showSplash())}},{key:"showSplash",value:function(){this.player.hasStarted(!1),this.player.getChild("posterImage").show(),this.player.getChild("bigPlayButton").show()}},{key:"hideSplash",value:function(){this.player.getChild("posterImage").hide(),this.player.getChild("bigPlayButton").hide()}},{key:"getSeekBarOptions",value:function(){return{}}},{key:"getSeekBarName",value:function(){return"ChapterSeekBar"}}],t&&LC(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function NC(e){return NC="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},NC(e)}function BC(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,UC(n.key),n)}}function UC(e){var t=function(e,t){if("object"!=NC(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=NC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==NC(t)?t:t+""}function FC(e,t,r){return t=qC(t),function(e,t){if(t&&("object"===NC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,VC()?Reflect.construct(t,r||[],qC(e).constructor):t.apply(e,r))}function VC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(VC=function(){return!!e})()}function HC(){return HC="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=qC(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},HC.apply(this,arguments)}function qC(e){return qC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},qC(e)}function zC(e,t){return zC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},zC(e,t)}MC.options_={viewKey:null,controls:!0,playbackRates:[.25,.5,.75,1,1.25,1.5,1.75,2],playerApi:new URL("http://localhost:52000"),enableLocalCache:!0,eventLogging:!0,allowFullscreen:!0};var WC=function(e){function t(e,r){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=FC(this,t,[e]),void 0===r.startTime)throw Error("Invalid clip start");if(void 0===r.endTime)throw Error("Invalid clip end");if(r.startTime>r.endTime)throw Error("Clip start cannot be greater than clip end");return n._clipStart=parseFloat(r.startTime.toPrecision(4)),n._clipEnd=parseFloat(r.endTime.toPrecision(4)),n.playerEndedFn=n.player.ended.bind(e),n.playerDurationFn=n.player.duration.bind(e),n.playerCurrentTimeFn=n.player.currentTime.bind(e),n.playerbufferedFn=n.player.buffered.bind(e),n.player.ended=n.ended.bind(n),n.player.duration=n.duration.bind(n),n.player.currentTime=n.currentTime.bind(n),n.player.buffered=n.buffered.bind(n),n.initialize(),n.player.ready((function(){n.player.trigger("durationchange")})),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zC(e,t)}(t,e),r=t,n=[{key:"clipStart",get:function(){var e=this.playerDurationFn();return this._clipStart>e?e:this._clipStart}},{key:"clipEnd",get:function(){var e=this.playerDurationFn();return e<=0?this._clipEnd:this._clipEnd>e?e:this._clipEnd}},{key:"dispose",value:function(){this.player.off("timeupdate",this.onTimeUpdate),this.player.off("play",this.onPlay),this.player.ended=this.playerEndedFn,this.player.duration=this.playerDurationFn,this.player.currentTime=this.playerCurrentTimeFn,this.player.buffered=this.playerbufferedFn,this.player.trigger("durationchange"),HC(qC(t.prototype),"dispose",this).call(this)}},{key:"initialize",value:function(){this.onTimeUpdate=this.onTimeUpdate.bind(this),this.onPlay=this.onPlay.bind(this),this.player.on("timeupdate",this.onTimeUpdate),this.player.on("play",this.onPlay)}},{key:"onPlay",value:function(){this._isEnded&&this.player.currentTime(0)}},{key:"onTimeUpdate",value:function(){var e=this.getCurrentTime(!1);e>this.clipEnd?this._isEnded||(this.player.pause(),this.player.trigger("ended"),this._isEnded=!0):(this._isEnded=!1,e<this.clipStart-10&&this.playerCurrentTimeFn(this.clipStart,!0))}},{key:"ended",value:function(){return this.getCurrentTime(!1)>this.clipEnd}},{key:"duration",value:function(e){return e&&e>0&&(this.playerDurationFn()?console.info("The duration of the player has already been set. This is a no-op."):this.playerDurationFn(e)),this.clipEnd-this.clipStart}},{key:"currentTime",value:function(e){if("number"!=typeof e)return this.getCurrentTime(!0);for(var t=e+this.clipStart,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.playerCurrentTimeFn(t,n)}},{key:"getCurrentTime",value:function(e){var t=this.playerCurrentTimeFn(),r=0;return t>=this.clipStart&&(r=t-this.clipStart),this.player.getCache().currentTime=r,e?r:t}},{key:"buffered",value:function(){for(var e=this.playerbufferedFn(),t=[],r=0;r<e.length;r++)t[r]=[Math.max(0,e.start(r)-this.clipStart),Math.min(Math.max(0,e.end(r)-this.clipStart),this.player.duration())];return yl.createTimeRanges(t)}}],n&&BC(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getPlugin("plugin"));function GC(e){return GC="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},GC(e)}function XC(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,KC(n.key),n)}}function KC(e){var t=function(e,t){if("object"!=GC(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=GC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==GC(t)?t:t+""}function YC(e,t,r){return t=JC(t),function(e,t){if(t&&("object"===GC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,QC()?Reflect.construct(t,r||[],JC(e).constructor):t.apply(e,r))}function QC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(QC=function(){return!!e})()}function $C(){return $C="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=JC(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},$C.apply(this,arguments)}function JC(e){return JC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},JC(e)}function ZC(e,t){return ZC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ZC(e,t)}yl.registerPlugin("clipPlugin",WC);var eP=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=YC(this,t,arguments)).alwaysCollapsed=!1,e.isCollapsed=!1,e.isCollabsible=!0,e}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ZC(e,t)}(t,e),r=t,(n=[{key:"buildCSSClass",value:function(){return"cv-create-clip-button"}},{key:"getCollabsibleName",value:function(){return this.controlText_}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!0}},{key:"showCollapsibleMenu",value:function(){$C(JC(t.prototype),"handleClick",this).call(this,null)}}])&&XC(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("Button"));function tP(e){return tP="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},tP(e)}function rP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,nP(n.key),n)}}function nP(e){var t=function(e,t){if("object"!=tP(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=tP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==tP(t)?t:t+""}function iP(e,t,r){return t=aP(t),function(e,t){if(t&&("object"===tP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,oP()?Reflect.construct(t,r||[],aP(e).constructor):t.apply(e,r))}function oP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(oP=function(){return!!e})()}function aP(e){return aP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},aP(e)}function sP(e,t){return sP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},sP(e,t)}eP.prototype.controlText_="Create Clip",yl.registerComponent("CreateClipButton",eP);var uP=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=iP(this,t,[e,r])).options=r,e.ready((function(){return n.onReady()})),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sP(e,t)}(t,e),r=t,n=[{key:"onReady",value:function(){var e,t=this.player.getChild("collapserator"),r=null===(e=null==t?void 0:t.children())||void 0===e?void 0:e.findIndex((function(e){return"CustomControlSpacer"===e.name()}));r&&-1!==r&&t.addChild("CreateClipButton",{clickHandler:this.options.onClick},r+1)}}],n&&rP(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getPlugin("plugin"));function lP(e){return lP="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},lP(e)}function cP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,fP(n.key),n)}}function fP(e){var t=function(e,t){if("object"!=lP(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=lP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==lP(t)?t:t+""}function hP(e,t,r){return t=dP(t),function(e,t){if(t&&("object"===lP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,pP()?Reflect.construct(t,r||[],dP(e).constructor):t.apply(e,r))}function pP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(pP=function(){return!!e})()}function dP(e){return dP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},dP(e)}function yP(e,t){return yP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},yP(e,t)}yl.registerPlugin("createClipButtonPlugin",uP);var mP=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),hP(this,t,arguments)}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yP(e,t)}(t,e),r=t,(n=[{key:"handlePictureInPictureEnabledChange",value:function(){this.enable()}}])&&cP(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("PictureInPictureToggle"));function vP(e){return vP="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},vP(e)}function gP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,bP(n.key),n)}}function bP(e){var t=function(e,t){if("object"!=vP(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=vP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==vP(t)?t:t+""}function _P(e,t,r){return t=SP(t),function(e,t){if(t&&("object"===vP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,wP()?Reflect.construct(t,r||[],SP(e).constructor):t.apply(e,r))}function wP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wP=function(){return!!e})()}function TP(){return TP="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=SP(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},TP.apply(this,arguments)}function SP(e){return SP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},SP(e)}function EP(e,t){return EP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},EP(e,t)}yl.registerComponent("PictureInPictureToggle",mP);var OP=yl.getComponent("PlayToggle"),kP=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=_P(this,t,[e,r])).pictureInPictureEnabled=!1,n.options=r,n.bindFunctions(),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&EP(e,t)}(t,e),r=t,(n=[{key:"bindFunctions",value:function(){this.requestPictureInPicture=this.requestPictureInPicture.bind(this),this.exitPictureInPicture=this.exitPictureInPicture.bind(this),this.onPlayerResize=this.onPlayerResize.bind(this),this.playerRequestPictureInPictureFn=this.player.requestPictureInPicture,this.playerExitPictureInPictureFn=this.player.exitPictureInPicture,this.player.requestPictureInPicture=this.requestPictureInPicture,this.player.exitPictureInPicture=this.exitPictureInPicture}},{key:"enablePictureInPicture",value:function(){var e=this;if(this.player.options_.fluid&&!this.pictureInPictureEnabled){var t=this.getToggleParentComponent();if(t){this.pictureInPictureEnabled=!0;var r=t.children().findIndex((function(e){var t;return"fullscreentoggle"===(null===(t=e.name())||void 0===t?void 0:t.toLowerCase())}));-1===r&&(r=t.children().length-1),t.addChild("pictureInPictureToggle",{},r);var n=t.getChild("pictureInPictureToggle");null==n||n.enable(),this.player.on("playerresize",this.onPlayerResize),this.player.on("dispose",(function(){var t;null===(t=e.player)||void 0===t||t.off("playerresize",e.onPlayerResize)}))}}}},{key:"disablePictureInPicture",value:function(){if(this.pictureInPictureEnabled){this.pictureInPictureEnabled=!1;var e=this.getToggleParentComponent(),t=null==e?void 0:e.getChild("pictureInPictureToggle");t&&e.removeChild(t),this.player.off("playerresize",this.onPlayerResize)}}},{key:"togglePictureInPicture",value:function(e){if(e!==this.player.isInPictureInPicture()){var t=e?"enterpictureinpicture":"leavepictureinpicture";this.player.isInPictureInPicture(e),this.player.trigger(t),e?this.addPipStyles():this.removePipStyles()}}},{key:"onPlayerResize",value:function(){if(!this.player.isInPictureInPicture()){var e=this.player.el().getBoundingClientRect();0!==e.width&&(e.width<800?this.disablePictureInPicture():this.enablePictureInPicture())}}},{key:"addPipStyles",value:function(){this.player.addClass("cv-picture-in-picture"),this.playToggle=new OP(this.player),this.playToggle.addClass("cv-pip-play-toggle"),this.player.addChild(this.playToggle),this.player.paused()?this.playToggle.handlePause():this.playToggle.handlePlay()}},{key:"removePipStyles",value:function(){this.player.removeClass("cv-picture-in-picture"),this.player.removeChild(this.playToggle),delete this.playToggle}},{key:"requestPictureInPicture",value:function(){var e;this.pictureInPictureEnabled&&(this.togglePictureInPicture(!0),"function"==typeof(null===(e=this.options)||void 0===e?void 0:e.onRequestPictureInPicture)&&this.options.onRequestPictureInPicture(!0))}},{key:"exitPictureInPicture",value:function(){this.togglePictureInPicture(!1),this.options.onRequestPictureInPicture(!1),this.removePipStyles()}},{key:"getToggleParentComponent",value:function(){return this.player.getChild("collapserator")}},{key:"dispose",value:function(){this.player.requestPictureInPicture=this.playerRequestPictureInPictureFn,this.player.exitPictureInPicture=this.playerExitPictureInPictureFn,TP(SP(t.prototype),"dispose",this).call(this)}}])&&gP(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getPlugin("plugin"));function CP(e){return CP="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},CP(e)}function PP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,xP(n.key),n)}}function xP(e){var t=function(e,t){if("object"!=CP(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=CP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==CP(t)?t:t+""}yl.registerPlugin("pictureInPicture",kP);var jP=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.listeners={}},t=[{key:"subscribe",value:function(e,t){this.registerListener(e,t)}},{key:"subscribeOnce",value:function(e,t){this.registerListener(e,t,1)}},{key:"unsubscribe",value:function(e,t){this.deregisterListener(e,t)}},{key:"trigger",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.triggerCallbacks(e,r)}},{key:"registerListener",value:function(e,t,r){var n;if("string"!=typeof e)throw new Error("Event name must be a string");if("function"!=typeof t)throw new Error("Event callback must be a function");if(r&&"number"!=typeof r)throw new Error("Execution limit must be a number or undefined");this.listeners[e]=null!==(n=this.listeners[e])&&void 0!==n?n:[],this.listeners[e].push({callback:t,executionLimit:r})}},{key:"deregisterListener",value:function(e,t){var r;if("string"!=typeof e)throw new Error("Event name must be a string");if(t&&"function"!=typeof t)throw new Error("Event callback must be a function");if(t){var n=null===(r=this.listeners[e])||void 0===r?void 0:r.findIndex((function(e){return e.callback===t}));"number"==typeof n&&-1!==n&&(this.listeners[e].splice(n,1),0===this.listeners[e].length&&delete this.listeners[e])}else this.listeners[e]=[]}},{key:"triggerCallbacks",value:function(e){for(var t=this,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];if(this.listeners[e]){var o=[];this.listeners[e].forEach((function(e){var t,r;"number"==typeof e.executionLimit&&(e.executionCount=null!==(r=e.executionCount)&&void 0!==r?r:0,e.executionCount++,e.executionCount===e.executionLimit&&o.push(e.callback)),(t=e.callback).apply.apply(t,[null].concat(n))})),o.length&&o.forEach((function(r){return t.deregisterListener(e,r)}))}}}],t&&PP(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),LP=new jP;function IP(e){return IP="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},IP(e)}function AP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,RP(n.key),n)}}function RP(e){var t=function(e,t){if("object"!=IP(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=IP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==IP(t)?t:t+""}function DP(e,t,r){return t=BP(t),function(e,t){if(t&&("object"===IP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,MP()?Reflect.construct(t,r||[],BP(e).constructor):t.apply(e,r))}function MP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(MP=function(){return!!e})()}function NP(){return NP="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=BP(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},NP.apply(this,arguments)}function BP(e){return BP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},BP(e)}function UP(e,t){return UP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},UP(e,t)}var FP=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=DP(this,t,[e,r])).hasBuffered=!1,n.hasPlayed=!1,n.eventsService=LP,n.pointOfInterest=r.pointOfInterest,n.onMouseOver=n.onMouseOver.bind(n),n.onMouseLeave=n.onMouseLeave.bind(n),n.onGlancePointOfInterestMouseEnter=n.onGlancePointOfInterestMouseEnter.bind(n),n.onGlancePointOfInterestMouseLeave=n.onGlancePointOfInterestMouseLeave.bind(n),n.initialize(),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&UP(e,t)}(t,e),r=t,n=[{key:"initialize",value:function(){this.setPosition(),this.bindListeners()}},{key:"buildCSSClass",value:function(){return"cv-point-of-interest-indicator ".concat(NP(BP(t.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(e,r,n){return NP(BP(t.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},r),{className:this.buildCSSClass()}),n)}},{key:"bindListeners",value:function(){this.on("mouseover",this.onMouseOver),this.on("mouseleave",this.onMouseLeave),this.eventsService.subscribe("glance:poi:mouseover",this.onGlancePointOfInterestMouseEnter),this.eventsService.subscribe("glance:poi:mouseleave",this.onGlancePointOfInterestMouseLeave)}},{key:"dispose",value:function(){this.eventsService.unsubscribe("glance:poi:mouseover",this.onGlancePointOfInterestMouseEnter),this.eventsService.unsubscribe("glance:poi:mouseleave",this.onGlancePointOfInterestMouseLeave)}},{key:"getPointOfInterestTime",value:function(){return this.pointOfInterest.startTime}},{key:"setPosition",value:function(){var e=this.player().duration();this.el_.style.left=this.getPointOfInterestTime()/e*100+"%"}},{key:"updateBuffered",value:function(e){var t=this.getPointOfInterestTime()<=e;if(t!==this.hasBuffered){this.hasBuffered=t;var r="cv-point-of-interest-indicator-buffered";this.hasBuffered?this.addClass(r):this.removeClass(r)}}},{key:"updatePlaybackProgress",value:function(e){var t=this.getPointOfInterestTime()<=e;if(t!==this.hasPlayed){this.hasPlayed=t;var r="cv-point-of-interest-indicator-played";t?this.addClass(r):this.removeClass(r)}}},{key:"toggleVisibility",value:function(e){var t="cv-point-of-interest-indicator-hidden";e?this.removeClass(t):this.addClass(t)}},{key:"onMouseOver",value:function(){this.setTimeTooltipText(),this.eventsService.trigger("player:poi:mouseover",this.pointOfInterest)}},{key:"onMouseLeave",value:function(){this.clearTimeTooltipText(),this.eventsService.trigger("player:poi:mouseleave")}},{key:"onGlancePointOfInterestMouseEnter",value:function(e){e.id===this.pointOfInterest.id&&(this.addClass("cv-point-of-interest-indicator-highlight"),this.setTimeTooltipTime(),this.setTimeTooltipText(),this.positionMouseTimeDisplay(),this.showMouseTimeDisplay())}},{key:"onGlancePointOfInterestMouseLeave",value:function(){this.removeClass("cv-point-of-interest-indicator-highlight"),this.hideMouseTimeDisplay()}},{key:"setTimeTooltipText",value:function(){var e;null===(e=this.getTimeTooltip())||void 0===e||e.setCustomChapterText(this.pointOfInterest.description)}},{key:"clearTimeTooltipText",value:function(){var e;null===(e=this.getTimeTooltip())||void 0===e||e.setCustomChapterText()}},{key:"setTimeTooltipTime",value:function(){var e=this.getTimeTooltip();null==e||e.updateTime(this.getPointOfInterestTime())}},{key:"positionMouseTimeDisplay",value:function(){var e,t,r=null===(e=this.getSeekBar())||void 0===e?void 0:e.el();if(r){var n=yl.dom.findPosition(r),i=this.getPointOfInterestTime()/this.player().duration();null===(t=this.getMouseTimeDisplay())||void 0===t||t.update(n,i)}}},{key:"showMouseTimeDisplay",value:function(){var e;null===(e=this.getMouseTimeDisplay())||void 0===e||e.forceShow()}},{key:"hideMouseTimeDisplay",value:function(){var e;null===(e=this.getMouseTimeDisplay())||void 0===e||e.removeForceShow()}},{key:"getSeekBar",value:function(){var e;return null===(e=this.player().controlBar.getChild("ProgressControl"))||void 0===e?void 0:e.getChild("SeekBar")}},{key:"getMouseTimeDisplay",value:function(){var e;return null===(e=this.getSeekBar())||void 0===e?void 0:e.getChild("MouseTimeDisplay")}},{key:"getTimeTooltip",value:function(){var e;return null===(e=this.getMouseTimeDisplay())||void 0===e?void 0:e.getChild("TimeTooltip")}}],n&&AP(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("Component"));function VP(e){return VP="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},VP(e)}function HP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,qP(n.key),n)}}function qP(e){var t=function(e,t){if("object"!=VP(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=VP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==VP(t)?t:t+""}function zP(e,t,r){return t=XP(t),function(e,t){if(t&&("object"===VP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,WP()?Reflect.construct(t,r||[],XP(e).constructor):t.apply(e,r))}function WP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(WP=function(){return!!e})()}function GP(){return GP="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=XP(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},GP.apply(this,arguments)}function XP(e){return XP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},XP(e)}function KP(e,t){return KP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},KP(e,t)}var YP=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=zP(this,t,[e,r])).pointsOfInterestVisible=r.pointsOfInterestVisible,n.toggle(n.pointsOfInterestVisible),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&KP(e,t)}(t,e),r=t,(n=[{key:"handleToggle",value:function(){this.toggle(!this.pointsOfInterestVisible)}},{key:"toggle",value:function(e){e?this.toggleOn():this.toggleOff()}},{key:"toggleOn",value:function(){yl.dom.addClass(this.toggleEl,"on"),this.pointsOfInterestVisible=!0,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}},{key:"toggleOff",value:function(){yl.dom.removeClass(this.toggleEl,"on"),this.pointsOfInterestVisible=!1,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}},{key:"handleClick",value:function(e){e.stopImmediatePropagation()}},{key:"createEl",value:function(e,r,n){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=yl.dom.createEl("div",{className:"custom-toggle toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),this.toggleEl.addEventListener("click",this.handleToggle);var i=GP(XP(t.prototype),"createEl",this).call(this,e,{className:"vjs-menu-item cv-cog-menu-item",innerHTML:'\n <span class="vjs-menu-item-text">Points of Interest</span>\n <span class="cv-toggle-container"></span>'},n);return i.children[1].appendChild(this.toggleEl),i}}])&&HP(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("MenuItem"));function QP(e){return QP="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},QP(e)}function $P(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,JP(n.key),n)}}function JP(e){var t=function(e,t){if("object"!=QP(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=QP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==QP(t)?t:t+""}function ZP(e,t,r){return t=tx(t),function(e,t){if(t&&("object"===QP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ex()?Reflect.construct(t,r||[],tx(e).constructor):t.apply(e,r))}function ex(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ex=function(){return!!e})()}function tx(e){return tx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},tx(e)}function rx(e,t){return rx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},rx(e,t)}yl.registerComponent("PointsOfInterestMenuItem",YP);var nx,ix=yl.getPlugin("plugin"),ox="cvplayer-points-of-interest",ax=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=ZP(this,t,[e])).pointOfInterestIndicators=[],n.enabled=!0,n.pointsOfInterest=null==r?void 0:r.pointsOfInterest,n.initialize=n.initialize.bind(n),n.updateBuffered=n.updateBuffered.bind(n),n.updatePlaybackProgress=n.updatePlaybackProgress.bind(n),n.player.one("loadedmetadata",(function(){return n.player.ready(n.initialize)})),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rx(e,t)}(t,e),r=t,(n=[{key:"initialize",value:function(){this.pointsOfInterest&&(Il()&&"false"===Al(ox)&&(this.enabled=!1),this.setupTrack(),this.createPointOfInterestIndicators(),this.addMenuItem(),this.bindListeners())}},{key:"bindListeners",value:function(){var e=this;this.player.on("progress",this.updateBuffered),this.player.on("timeupdate",this.updatePlaybackProgress),this.player.on("dispose",(function(){var t,r;null===(t=e.player)||void 0===t||t.off("progress",e.updateBuffered),null===(r=e.player)||void 0===r||r.off("timeupdate",e.updatePlaybackProgress)}))}},{key:"togglePointsOfInterest",value:function(e){Rl(ox,e.toString()),this.pointOfInterestIndicators.forEach((function(t){return t.toggleVisibility(e)}))}},{key:"setupTrack",value:function(){var e=this.player.addTextTrack("metadata","pointsofinterest");this.pointsOfInterest.forEach((function(t){e.addCue({startTime:t.startTime,endTime:t.endTime,text:t.description})})),e.trigger({type:"loadeddata",target:e})}},{key:"createPointOfInterestIndicators",value:function(){var e,t=this,r=null===(e=this.player.controlBar.getChild("ProgressControl"))||void 0===e?void 0:e.getChild("SeekBar");this.pointsOfInterest.forEach((function(e){var n=new FP(t.player,{pointOfInterest:e});t.pointOfInterestIndicators.push(n),r.addChild(n)}))}},{key:"addMenuItem",value:function(){var e;(null===(e=this.player.getChild("collapserator"))||void 0===e?void 0:e.getChild("cogButton")).addItem({index:0,ctor:YP,name:"PointsOfInterestMenuItem",options:{pointsOfInterestVisible:this.enabled}})}},{key:"updateBuffered",value:function(){var e=this;this.pointOfInterestIndicators.forEach((function(t){return t.updateBuffered(h_(e.player))}))}},{key:"updatePlaybackProgress",value:function(){var e=this;this.pointOfInterestIndicators.forEach((function(t){return t.updatePlaybackProgress(e.player.currentTime())}))}}])&&$P(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(ix);function sx(e){return sx="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},sx(e)}function ux(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,lx(n.key),n)}}function lx(e){var t=function(e,t){if("object"!=sx(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=sx(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==sx(t)?t:t+""}function cx(e,t,r){return t=hx(t),function(e,t){if(t&&("object"===sx(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,fx()?Reflect.construct(t,r||[],hx(e).constructor):t.apply(e,r))}function fx(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fx=function(){return!!e})()}function hx(e){return hx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hx(e)}function px(e,t){return px=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},px(e,t)}yl.registerPlugin("pointsOfInterestPlugin",ax),function(e){e.None="None",e.Complete="Complete",e.Incomplete="Incomplete"}(nx||(nx={}));var dx=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=cx(this,t,[e,r])).update(),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&px(e,t)}(t,e),r=t,n=[{key:"update",value:function(){this.options_.activityStatus===nx.Complete?this.addClass("cv-activity-completed"):this.removeClass("cv-activity-completed")}},{key:"handleClick",value:function(){if(this.options_.activityStatus=this.getToggledActivityStatus(),this.update(),this.options_.clickHandler){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.options_.clickHandler.call(this,t)}}},{key:"buildCSSClass",value:function(){return"cv-activity-status-button"}},{key:"getToggledActivityStatus",value:function(){return this.options_.activityStatus===nx.None||this.options_.activityStatus===nx.Incomplete?nx.Complete:this.options_.activityStatus===nx.Complete?nx.Incomplete:void 0}}],n&&ux(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("Button"));function yx(e){return yx="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},yx(e)}function mx(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,vx(n.key),n)}}function vx(e){var t=function(e,t){if("object"!=yx(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=yx(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==yx(t)?t:t+""}function gx(e,t,r){return t=_x(t),function(e,t){if(t&&("object"===yx(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,bx()?Reflect.construct(t,r||[],_x(e).constructor):t.apply(e,r))}function bx(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(bx=function(){return!!e})()}function _x(e){return _x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_x(e)}function wx(e,t){return wx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},wx(e,t)}dx.prototype.controlText_="Complete";var Tx=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),gx(this,t,arguments)}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wx(e,t)}(t,e),r=t,(n=[{key:"setActivityStatus",value:function(e,t){var r=this;e!==this.activityStatus&&(this.activityStatus=e,this.onToggleStatus=t,this.player.ready((function(){r.renderActivityStatusButton()})))}},{key:"renderActivityStatusButton",value:function(){this.button&&this.player.removeChild(this.button),this.button=new dx(this.player,{activityStatus:this.activityStatus,clickHandler:this.onToggleStatus}),this.player.addChild(this.button)}}])&&mx(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getPlugin("plugin"));function Sx(e){return Sx="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},Sx(e)}function Ex(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ox(n.key),n)}}function Ox(e){var t=function(e,t){if("object"!=Sx(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Sx(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Sx(t)?t:t+""}function kx(e,t,r){return t=xx(t),function(e,t){if(t&&("object"===Sx(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Cx()?Reflect.construct(t,r||[],xx(e).constructor):t.apply(e,r))}function Cx(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Cx=function(){return!!e})()}function Px(){return Px="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=xx(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Px.apply(this,arguments)}function xx(e){return xx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xx(e)}function jx(e,t){return jx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},jx(e,t)}yl.registerPlugin("activityStatusPlugin",Tx);var Lx=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=kx(this,t,[e,r])).initialize(),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jx(e,t)}(t,e),r=t,n=[{key:"initialize",value:function(){this.setPosition()}},{key:"buildCSSClass",value:function(){return"cv-range-indicator ".concat(Px(xx(t.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(e,r,n){return Px(xx(t.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},r),{className:this.buildCSSClass()}),n)}},{key:"setPosition",value:function(){var e=this.player().duration();this.el_.style.left=this.options_.time/e*100+"%"}}],n&&Ex(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("Component"));function Ix(e){return Ix="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},Ix(e)}function Ax(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Rx(n.key),n)}}function Rx(e){var t=function(e,t){if("object"!=Ix(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Ix(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ix(t)?t:t+""}function Dx(e,t,r){return t=Bx(t),function(e,t){if(t&&("object"===Ix(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Mx()?Reflect.construct(t,r||[],Bx(e).constructor):t.apply(e,r))}function Mx(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Mx=function(){return!!e})()}function Nx(){return Nx="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Bx(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Nx.apply(this,arguments)}function Bx(e){return Bx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Bx(e)}function Ux(e,t){return Ux=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ux(e,t)}var Fx=function(e){function t(e,r){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Dx(this,t,[e,r])}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ux(e,t)}(t,e),r=t,(n=[{key:"buildCSSClass",value:function(){return"cv-replay-view-button ".concat(Nx(Bx(t.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(e,r,n){return Nx(Bx(t.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},r),{innerHTML:'<span class="'.concat(this.options_.iconClassName,'"></span><span>').concat(this.options_.label,"</span>"),className:this.buildCSSClass()}),n)}},{key:"handleClick",value:function(){this.options_.onPress()}}])&&Ax(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("ClickableComponent"));function Vx(e){return Vx="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},Vx(e)}function Hx(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,qx(n.key),n)}}function qx(e){var t=function(e,t){if("object"!=Vx(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Vx(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Vx(t)?t:t+""}function zx(e,t,r){return t=Xx(t),function(e,t){if(t&&("object"===Vx(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Wx()?Reflect.construct(t,r||[],Xx(e).constructor):t.apply(e,r))}function Wx(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Wx=function(){return!!e})()}function Gx(){return Gx="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Xx(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Gx.apply(this,arguments)}function Xx(e){return Xx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Xx(e)}function Kx(e,t){return Kx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Kx(e,t)}var Yx=function(e){function t(e,r){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),zx(this,t,[e,r])}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kx(e,t)}(t,e),r=t,(n=[{key:"buildCSSClass",value:function(){return"cv-replay-view ".concat(Gx(Xx(t.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(e,r,n){var i=Gx(Xx(t.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},r),{className:this.buildCSSClass()}),n),o=yl.dom.createEl("h5",{innerHTML:this.localize("This clip has finished"),className:"cv-replay-heading"}),a=yl.dom.createEl("div",{className:"cv-button-container"}),s=new Fx(this.player_,{label:this.localize("Replay clip"),iconClassName:"cv-replay-icon",onPress:this.options_.onReplayPress}),u=new Fx(this.player_,{label:this.localize("Continue watching"),iconClassName:"cv-continue-icon",onPress:this.options_.onContinuePress});return i.appendChild(o),i.appendChild(a),a.appendChild(s.el()),a.appendChild(u.el()),i}}])&&Hx(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getComponent("Component"));function Qx(e){return Qx="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},Qx(e)}function $x(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Jx(n.key),n)}}function Jx(e){var t=function(e,t){if("object"!=Qx(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=Qx(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Qx(t)?t:t+""}function Zx(e,t,r){return t=rj(t),function(e,t){if(t&&("object"===Qx(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ej()?Reflect.construct(t,r||[],rj(e).constructor):t.apply(e,r))}function ej(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ej=function(){return!!e})()}function tj(){return tj="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=rj(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},tj.apply(this,arguments)}function rj(e){return rj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},rj(e)}function nj(e,t){return nj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},nj(e,t)}var ij=function(e){function t(e,r){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Zx(this,t,[e,r])).startTime=parseFloat(r.startTime.toPrecision(4)),n.endTime=parseFloat(r.endTime.toPrecision(4)),n.dismissed=!1,n.startTime>n.endTime)throw Error("Range start cannot be greater than range end");return n.bindFunctions(),n.initialize(),n}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nj(e,t)}(t,e),r=t,n=[{key:"bindFunctions",value:function(){this.onReady=this.onReady.bind(this),this.onTimeUpdateOrSeeked=this.onTimeUpdateOrSeeked.bind(this),this.onReplayPress=this.onReplayPress.bind(this),this.onContinuePress=this.onContinuePress.bind(this)}},{key:"initialize",value:function(){var e=this;this.player.one("loadedmetadata",(function(){return e.player.ready(e.onReady)})),this.player.on("timeupdate",this.onTimeUpdateOrSeeked),this.player.on("seeked",this.onTimeUpdateOrSeeked)}},{key:"onReady",value:function(){this.addCssClasses(),this.showRangeIndicators(),this.addMaskToProgressBar()}},{key:"onTimeUpdateOrSeeked",value:function(){if(!this.dismissed){var e=this.player.currentTime();if(!(e<this.startTime))return e>this.endTime?(this.showReplayView(),this.disablePlayToggle(),this.player.pause(),void this.player.currentTime(this.endTime)):void 0;this.player.currentTime(this.startTime)}}},{key:"onReplayPress",value:function(){this.player.currentTime(this.startTime),this.player.play(),this.hideReplayView(),this.enablePlayToggle()}},{key:"onContinuePress",value:function(){this.dismissed=!0,this.player.play(),this.hideRangeIndicators(),this.removeMaskFromProgressBar(),this.hideReplayView(),this.enablePlayToggle(),this.removeCssClasses()}},{key:"showRangeIndicators",value:function(){var e,t=null===(e=this.player.controlBar.getChild("ProgressControl"))||void 0===e?void 0:e.getChild("SeekBar");this.startTimeIndicator||(this.startTimeIndicator=new Lx(this.player,{time:this.startTime}),null==t||t.addChild(this.startTimeIndicator)),this.endTimeIndicator||(this.endTimeIndicator=new Lx(this.player,{time:this.endTime}),null==t||t.addChild(this.endTimeIndicator))}},{key:"hideRangeIndicators",value:function(){var e,t;null===(e=this.startTimeIndicator)||void 0===e||e.hide(),null===(t=this.endTimeIndicator)||void 0===t||t.hide()}},{key:"addMaskToProgressBar",value:function(){var e,t=null===(e=this.player.controlBar.getChild("ProgressControl"))||void 0===e?void 0:e.getChild("SeekBar"),r=null==t?void 0:t.el().getElementsByClassName("cv-chapter-bar-items");if(r&&r.length){var n=r[0],i=this.player.duration(),o=this.startTime/i*100,a=100-this.endTime/i*100;n.style.clipPath="inset(".concat(-5,"em ").concat(a,"% ").concat(-5,"em ").concat(o,"%)")}}},{key:"removeMaskFromProgressBar",value:function(){var e,t=null===(e=this.player.controlBar.getChild("ProgressControl"))||void 0===e?void 0:e.getChild("SeekBar"),r=null==t?void 0:t.el().getElementsByClassName("cv-chapter-bar-items");r&&r.length&&(r[0].style.clipPath="")}},{key:"showReplayView",value:function(){this.replayView||(this.replayView=new Yx(this.player,{onContinuePress:this.onContinuePress,onReplayPress:this.onReplayPress}),this.player.addChild(this.replayView)),this.replayView.show()}},{key:"hideReplayView",value:function(){var e;null===(e=this.replayView)||void 0===e||e.hide()}},{key:"getPlayToggle",value:function(){var e=this.player.getChild("collapserator");return null==e?void 0:e.getChild("PlayToggle")}},{key:"enablePlayToggle",value:function(){var e=this.getPlayToggle();e&&e.enable()}},{key:"disablePlayToggle",value:function(){var e=this.getPlayToggle();e&&e.disable()}},{key:"addCssClasses",value:function(){this.player.addClass("cv-range-indicator-plugin")}},{key:"removeCssClasses",value:function(){this.player.removeClass("cv-range-indicator-plugin")}},{key:"dispose",value:function(){var e,r,n;this.removeCssClasses(),this.player.off("timeupdate",this.onTimeUpdateOrSeeked),this.player.off("seeked",this.onTimeUpdateOrSeeked),null===(e=this.startTimeIndicator)||void 0===e||e.dispose(),null===(r=this.endTimeIndicator)||void 0===r||r.dispose(),null===(n=this.replayView)||void 0===n||n.dispose(),tj(rj(t.prototype),"dispose",this).call(this)}}],n&&$x(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yl.getPlugin("plugin"));yl.registerPlugin("rangeIndicatorPlugin",ij);var oj=function(){var e,t,r;return null!==(r=null===(t=null===(e=window.crypto)||void 0===e?void 0:e.randomUUID)||void 0===t?void 0:t.call(e))&&void 0!==r?r:Math.random().toString()};function aj(e){return aj="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},aj(e)}function sj(){sj=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new j(n||[]);return i(a,"_invoke",{value:k(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(L([])));T&&T!==r&&n.call(T,a)&&(_=T);var S=b.prototype=v.prototype=Object.create(_);function E(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function r(i,o,a,s){var u=f(e[i],e,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==aj(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function k(t,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(t,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,C(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function L(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(aj(t)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},E(O.prototype),l(O.prototype,s,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new O(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=L,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function uj(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function lj(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,cj(n.key),n)}}function cj(e){var t=function(e,t){if("object"!=aj(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=aj(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==aj(t)?t:t+""}function fj(e,t,r){return t=dj(t),function(e,t){if(t&&("object"===aj(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,hj()?Reflect.construct(t,r||[],dj(e).constructor):t.apply(e,r))}function hj(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hj=function(){return!!e})()}function pj(){return pj="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=dj(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},pj.apply(this,arguments)}function dj(e){return dj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},dj(e)}function yj(e,t){return yj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},yj(e,t)}var mj=function(e){function t(e,r){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),fj(this,t,[e,r])}return 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yj(e,t)}(t,e),r=t,(n=[{key:"getPlayerOptions",value:function(){var e,r,n=pj(dj(t.prototype),"getPlayerOptions",this).call(this);return(null===(e=n.devicesConfig)||void 0===e?void 0:e.canUserCastToDevices)?Object.assign(Object.assign({},n),{techOrder:["devices"].concat((r=n.techOrder,function(e){if(Array.isArray(e))return uj(e)}(r)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return uj(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?uj(e,t):void 0}}(r)||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.")}())),devices:{instanceId:oj()}}):n}},{key:"configurePlugins",value:function(){var e;try{this.options.onClickCreateClip&&this.player.createClipButtonPlugin({onClick:this.options.onClickCreateClip}),this.options.onRequestPictureInPicture&&this.player.pictureInPicture({onRequestPictureInPicture:this.options.onRequestPictureInPicture}),(null===(e=this.options.pointsOfInterest)||void 0===e?void 0:e.length)&&this.player.pointsOfInterestPlugin({pointsOfInterest:this.options.pointsOfInterest})}catch(e){console.log("failed to register plugins",e)}}},{key:"setNextVideo",value:function(e,t,r){this.player.nextVideoPlugin&&this.player.nextVideoPlugin().setNextVideo(e,t,r)}},{key:"enablePictureInPicture",value:function(){var e=this.player.pictureInPicture();e&&e.enablePictureInPicture()}},{key:"disablePictureInPicture",value:function(){var e=this.player.pictureInPicture();e&&e.disablePictureInPicture()}},{key:"togglePictureInPicture",value:function(e){var t=this.player.pictureInPicture();t&&t.togglePictureInPicture(e)}},{key:"additionalSetup",value:function(e){var r,n,i,o,a,s=this,u=Object.create(null,{additionalSetup:{get:function(){return pj(dj(t.prototype),"additionalSetup",s)}}});return n=this,i=void 0,o=void 0,a=sj().mark((function t(){var n;return sj().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u.additionalSetup.call(this,e),this.options.showResources&&e.resources&&this.player.resourcesPlugin&&this.player.resourcesPlugin({resources:e.resources.list,imageCdnUrl:this.options.imageCdnUrl}),"MasterClip"!==e.mediaType){t.next=7;break}if(null!==(n=e.additionalData)){t.next=6;break}throw Error("Invalid clip data");case 6:this.player.clipPlugin({startTime:n.startTime,endTime:n.endTime});case 7:if(!(null===(r=this.options.devicesConfig)||void 0===r?void 0:r.canUserCastToDevices)){t.next=11;break}if(this.player.devicesPlugin){t.next=10;break}return t.abrupt("return");case 10:this.player.devicesPlugin(Object.assign(Object.assign({},this.options.devicesConfig),{userId:parseInt(e.viewerId),title:e.title,analyticsService:this.analyticsService}));case 11:"MasterVideo"===e.mediaType&&this.options.startTime&&this.options.endTime&&this.player.rangeIndicatorPlugin({startTime:this.options.startTime,endTime:this.options.endTime});case 12:case"end":return t.stop()}}),t,this)})),new(o||(o=Promise))((function(e,t){function r(e){try{u(a.next(e))}catch(e){t(e)}}function s(e){try{u(a.throw(e))}catch(e){t(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(r,s)}u((a=a.apply(n,i||[])).next())}))}},{key:"setActivityStatus",value:function(e,t){this.player.activityStatusPlugin().setActivityStatus(e,t)}}])&&lj(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(MC)})(),n})()));
|