senza-sdk 4.3.4 → 4.3.5

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/dist/bundle.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see bundle.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.senza=t():e.senza=t()}(this,(()=>(()=>{var e={159:(e,t,n)=>{!function(){var e="undefined"!=typeof window?window:n.g,i={};for(var r in function(e,t,n){var i;function r(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var a="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e},o=function(n){n=["object"==typeof globalThis&&globalThis,n,"object"==typeof e&&e,"object"==typeof self&&self,"object"==typeof t&&t];for(var i=0;i<n.length;++i){var r=n[i];if(r&&r.Math==Math)return r}throw Error("Cannot find global object")}(this);function s(e,t){if(t)e:{var n=o;e=e.split(".");for(var i=0;i<e.length-1;i++){var r=e[i];if(!(r in n))break e;n=n[r]}(t=t(i=n[e=e[e.length-1]]))!=i&&null!=t&&a(n,e,{configurable:!0,writable:!0,value:t})}}function u(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function l(e){var t="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];if(t)return t.call(e);if("number"==typeof e.length)return{next:r(e)};throw Error(String(e)+" is not an iterable or ArrayLike")}function c(e){if(!(e instanceof Array)){e=l(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}s("Symbol",(function(e){function t(e,t){this.g=e,a(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),s("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),n=0;n<t.length;n++){var i=o[t[n]];"function"==typeof i&&"function"!=typeof i.prototype[e]&&a(i.prototype,e,{configurable:!0,writable:!0,value:function(){return u(r(this))}})}return e}));var d,h="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)d=Object.setPrototypeOf;else{var f;e:{var p={};try{p.__proto__={a:!0},f=p.a;break e}catch(e){}f=!1}d=f?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var g=d;function m(e,t){if(e.prototype=h(t.prototype),e.prototype.constructor=e,g)g(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var i=Object.getOwnPropertyDescriptor(t,n);i&&Object.defineProperty(e,n,i)}else e[n]=t[n];e.pk=t.prototype}function v(){this.o=!1,this.l=null,this.h=void 0,this.g=1,this.j=this.m=0,this.A=this.i=null}function y(e){if(e.o)throw new TypeError("Generator is already running");e.o=!0}function b(e,t){e.i={vg:t,Ig:!0},e.g=e.m||e.j}function w(e,t,n){return e.g=n,{value:t}}function T(e){e.g=0}function S(e,t,n){e.m=t,null!=n&&(e.j=n)}function x(e,t){e.m=0,e.j=t||0}function A(e,t,n){e.g=t,e.m=n||0}function E(e,t){return e.m=t||0,t=e.i.vg,e.i=null,t}function k(e){e.A=[e.i],e.m=0,e.j=0}function I(e,t){var n=e.A.splice(0)[0];(n=e.i=e.i||n)?n.Ig?e.g=e.m||e.j:null!=n.u&&e.j<n.u?(e.g=n.u,e.i=null):e.g=e.j:e.g=t}function M(e){this.g=new v,this.h=e}function C(e,t,n,i){try{var r=t.call(e.g.l,n);if(!(r instanceof Object))throw new TypeError("Iterator result "+r+" is not an object");if(!r.done)return e.g.o=!1,r;var a=r.value}catch(t){return e.g.l=null,b(e.g,t),D(e)}return e.g.l=null,i.call(e.g,a),D(e)}function D(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.o=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,b(e.g,t)}if(e.g.o=!1,e.g.i){if(t=e.g.i,e.g.i=null,t.Ig)throw t.vg;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function R(e){this.next=function(t){return y(e.g),e.g.l?t=C(e,e.g.l.next,t,e.g.s):(e.g.s(t),t=D(e)),t},this.throw=function(t){return y(e.g),e.g.l?t=C(e,e.g.l.throw,t,e.g.s):(b(e.g,t),t=D(e)),t},this.return=function(t){return function(e,t){y(e.g);var n=e.g.l;return n?C(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),D(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function P(e){return function(e){function t(t){return e.next(t)}function n(t){return e.throw(t)}return new Promise((function(i,r){!function e(a){a.done?i(a.value):Promise.resolve(a.value).then(t,n).then(e,r)}(e.next())}))}(new R(new M(e)))}function L(){for(var e=Number(this),t=[],n=e;n<arguments.length;n++)t[n-e]=arguments[n];return t}function N(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function j(e,t){e instanceof String&&(e+="");var n=0,i=!1,r={next:function(){if(!i&&n<e.length){var r=n++;return{value:t(r,e[r]),done:!1}}return i=!0,{done:!0,value:void 0}}};return r[Symbol.iterator]=function(){return r},r}function O(e,t,n){e instanceof String&&(e=String(e));for(var i=e.length,r=0;r<i;r++){var a=e[r];if(t.call(n,a,r,e))return{Gg:r,v:a}}return{Gg:-1,v:void 0}}function U(e,t,n){if(null==e)throw new TypeError("The 'this' value for String.prototype."+n+" must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype."+n+" must not be a regular expression");return e+""}v.prototype.s=function(e){this.h=e},v.prototype.return=function(e){this.i={return:e},this.g=this.j},v.prototype.u=function(e){this.g=e},s("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function i(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var r=o.setTimeout;n.prototype.i=function(e){r(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(i){n||(n=!0,e.call(t,i))}}var t=this,n=!1;return{resolve:e(this.F),reject:e(this.l)}},t.prototype.F=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.H(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.C(e):this.m(e)}},t.prototype.C=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.I(t,e):this.m(e)},t.prototype.l=function(e){this.s(2,e)},t.prototype.m=function(e){this.s(1,e)},t.prototype.s=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.G(),this.A()},t.prototype.G=function(){var e=this;r((function(){if(e.B()){var t=o.console;void 0!==t&&t.error(e.i)}}),1)},t.prototype.B=function(){if(this.o)return!1;var e=o.CustomEvent,t=o.Event,n=o.dispatchEvent;return void 0===n||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=o.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.A=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)a.h(this.g[e]);this.g=null}};var a=new n;return t.prototype.H=function(e){var t=this.j();e.Hd(t.resolve,t.reject)},t.prototype.I=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function i(e,t){return"function"==typeof e?function(t){try{r(e(t))}catch(e){a(e)}}:t}var r,a,o=new t((function(e,t){r=e,a=t}));return this.Hd(i(e,r),i(n,a)),o},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.Hd=function(e,t){function n(){switch(i.h){case 1:e(i.i);break;case 2:t(i.i);break;default:throw Error("Unexpected state: "+i.h)}}var i=this;null==this.g?a.h(n):this.g.push(n),this.o=!0},t.resolve=i,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=l(e),a=r.next();!a.done;a=r.next())i(a.value).Hd(t,n)}))},t.all=function(e){var n=l(e),r=n.next();return r.done?i([]):new t((function(e,t){function a(t){return function(n){o[t]=n,0==--s&&e(o)}}var o=[],s=0;do{o.push(void 0),s++,i(r.value).Hd(a(o.length-1),t),r=n.next()}while(!r.done)}))},t})),s("WeakMap",(function(e){function t(e){if(this.g=(u+=Math.random()+1).toString(),e){e=l(e);for(var t;!(t=e.next()).done;)t=t.value,this.set(t[0],t[1])}}function n(){}function i(e){var t=typeof e;return"object"===t&&null!==e||"function"===t}function r(e){if(!N(e,s)){var t=new n;a(e,s,{value:t})}}function o(e){var t=Object[e];t&&(Object[e]=function(e){return e instanceof n?e:(Object.isExtensible(e)&&r(e),t(e))})}if(function(){if(!e||!Object.seal)return!1;try{var t=Object.seal({}),n=Object.seal({}),i=new e([[t,2],[n,3]]);return 2==i.get(t)&&3==i.get(n)&&(i.delete(t),i.set(n,4),!i.has(t)&&4==i.get(n))}catch(e){return!1}}())return e;var s="$jscomp_hidden_"+Math.random();o("freeze"),o("preventExtensions"),o("seal");var u=0;return t.prototype.set=function(e,t){if(!i(e))throw Error("Invalid WeakMap key");if(r(e),!N(e,s))throw Error("WeakMap key fail: "+e);return e[s][this.g]=t,this},t.prototype.get=function(e){return i(e)&&N(e,s)?e[s][this.g]:void 0},t.prototype.has=function(e){return i(e)&&N(e,s)&&N(e[s],this.g)},t.prototype.delete=function(e){return!!(i(e)&&N(e,s)&&N(e[s],this.g))&&delete e[s][this.g]},t})),s("Map",(function(e){function t(){var e={};return e.Ob=e.next=e.head=e}function n(e,t){var n=e[1];return u((function(){if(n){for(;n.head!=e[1];)n=n.Ob;for(;n.next!=n.head;)return n=n.next,{done:!1,value:t(n)};n=null}return{done:!0,value:void 0}}))}function i(e,t){var n=t&&typeof t;"object"==n||"function"==n?a.has(t)?n=a.get(t):(n=""+ ++o,a.set(t,n)):n="p_"+t;var i=e[0][n];if(i&&N(e[0],n))for(e=0;e<i.length;e++){var r=i[e];if(t!=t&&r.key!=r.key||t===r.key)return{id:n,list:i,index:e,entry:r}}return{id:n,list:i,index:-1,entry:void 0}}function r(e){if(this[0]={},this[1]=t(),this.size=0,e){e=l(e);for(var n;!(n=e.next()).done;)n=n.value,this.set(n[0],n[1])}}if(function(){if(!e||"function"!=typeof e||!e.prototype.entries||"function"!=typeof Object.seal)return!1;try{var t=Object.seal({x:4}),n=new e(l([[t,"s"]]));if("s"!=n.get(t)||1!=n.size||n.get({x:4})||n.set({x:4},"t")!=n||2!=n.size)return!1;var i=n.entries(),r=i.next();return!r.done&&r.value[0]==t&&"s"==r.value[1]&&!((r=i.next()).done||4!=r.value[0].x||"t"!=r.value[1]||!i.next().done)}catch(e){return!1}}())return e;var a=new WeakMap;r.prototype.set=function(e,t){var n=i(this,e=0===e?0:e);return n.list||(n.list=this[0][n.id]=[]),n.entry?n.entry.value=t:(n.entry={next:this[1],Ob:this[1].Ob,head:this[1],key:e,value:t},n.list.push(n.entry),this[1].Ob.next=n.entry,this[1].Ob=n.entry,this.size++),this},r.prototype.delete=function(e){return!(!(e=i(this,e)).entry||!e.list||(e.list.splice(e.index,1),e.list.length||delete this[0][e.id],e.entry.Ob.next=e.entry.next,e.entry.next.Ob=e.entry.Ob,e.entry.head=null,this.size--,0))},r.prototype.clear=function(){this[0]={},this[1]=this[1].Ob=t(),this.size=0},r.prototype.has=function(e){return!!i(this,e).entry},r.prototype.get=function(e){return(e=i(this,e).entry)&&e.value},r.prototype.entries=function(){return n(this,(function(e){return[e.key,e.value]}))},r.prototype.keys=function(){return n(this,(function(e){return e.key}))},r.prototype.values=function(){return n(this,(function(e){return e.value}))},r.prototype.forEach=function(e,t){for(var n,i=this.entries();!(n=i.next()).done;)n=n.value,e.call(t,n[1],n[0],this)},r.prototype[Symbol.iterator]=r.prototype.entries;var o=0;return r})),s("Set",(function(e){function t(e){if(this.g=new Map,e){e=l(e);for(var t;!(t=e.next()).done;)this.add(t.value)}this.size=this.g.size}return function(){if(!e||"function"!=typeof e||!e.prototype.entries||"function"!=typeof Object.seal)return!1;try{var t=Object.seal({x:4}),n=new e(l([t]));if(!n.has(t)||1!=n.size||n.add(t)!=n||1!=n.size||n.add({x:4})!=n||2!=n.size)return!1;var i=n.entries(),r=i.next();return!r.done&&r.value[0]==t&&r.value[1]==t&&!(r=i.next()).done&&r.value[0]!=t&&4==r.value[0].x&&r.value[1]==r.value[0]&&i.next().done}catch(e){return!1}}()?e:(t.prototype.add=function(e){return e=0===e?0:e,this.g.set(e,e),this.size=this.g.size,this},t.prototype.delete=function(e){return e=this.g.delete(e),this.size=this.g.size,e},t.prototype.clear=function(){this.g.clear(),this.size=0},t.prototype.has=function(e){return this.g.has(e)},t.prototype.entries=function(){return this.g.entries()},t.prototype.values=function(){return this.g.values()},t.prototype.keys=t.prototype.values,t.prototype[Symbol.iterator]=t.prototype.values,t.prototype.forEach=function(e,t){var n=this;this.g.forEach((function(i){return e.call(t,i,i,n)}))},t)})),s("Array.prototype.keys",(function(e){return e||function(){return j(this,(function(e){return e}))}})),s("Array.prototype.findIndex",(function(e){return e||function(e,t){return O(this,e,t).Gg}})),s("Array.from",(function(e){return e||function(e,t,n){t=null!=t?t:function(e){return e};var i=[],r="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];if("function"==typeof r){e=r.call(e);for(var a=0;!(r=e.next()).done;)i.push(t.call(n,r.value,a++))}else for(r=e.length,a=0;a<r;a++)i.push(t.call(n,e[a],a));return i}})),s("Array.prototype.values",(function(e){return e||function(){return j(this,(function(e,t){return t}))}})),s("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),s("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var i=n.length;for(0>(t=t||0)&&(t=Math.max(t+i,0));t<i;t++){var r=n[t];if(r===e||Object.is(r,e))return!0}return!1}})),s("String.prototype.includes",(function(e){return e||function(e,t){return-1!==U(this,e,"includes").indexOf(e,t||0)}})),s("String.fromCodePoint",(function(e){return e||function(e){for(var t="",n=0;n<arguments.length;n++){var i=Number(arguments[n]);if(0>i||1114111<i||i!==Math.floor(i))throw new RangeError("invalid_code_point "+i);65535>=i?t+=String.fromCharCode(i):(i-=65536,t+=String.fromCharCode(i>>>10&1023|55296),t+=String.fromCharCode(1023&i|56320))}return t}})),s("WeakSet",(function(e){function t(e){if(this.g=new WeakMap,e){e=l(e);for(var t;!(t=e.next()).done;)this.add(t.value)}}return function(){if(!e||!Object.seal)return!1;try{var t=Object.seal({}),n=Object.seal({}),i=new e([t]);return!(!i.has(t)||i.has(n))&&(i.delete(t),i.add(n),!i.has(t)&&i.has(n))}catch(e){return!1}}()?e:(t.prototype.add=function(e){return this.g.set(e,!0),this},t.prototype.has=function(e){return this.g.has(e)},t.prototype.delete=function(e){return this.g.delete(e)},t)})),s("Array.prototype.find",(function(e){return e||function(e,t){return O(this,e,t).v}})),s("String.prototype.startsWith",(function(e){return e||function(e,t){var n=U(this,e,"startsWith"),i=n.length,r=e.length;t=Math.max(0,Math.min(0|t,n.length));for(var a=0;a<r&&t<i;)if(n[t++]!=e[a++])return!1;return a>=r}})),s("Object.entries",(function(e){return e||function(e){var t,n=[];for(t in e)N(e,t)&&n.push([t,e[t]]);return n}}));var _="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var i=arguments[n];if(i)for(var r in i)N(i,r)&&(e[r]=i[r])}return e};s("Object.assign",(function(e){return e||_})),s("Promise.prototype.finally",(function(e){return e||function(e){return this.then((function(t){return Promise.resolve(e()).then((function(){return t}))}),(function(t){return Promise.resolve(e()).then((function(){throw t}))}))}})),s("Array.prototype.entries",(function(e){return e||function(){return j(this,(function(e,t){return[e,t]}))}})),s("Number.isNaN",(function(e){return e||function(e){return"number"==typeof e&&isNaN(e)}})),s("String.prototype.repeat",(function(e){return e||function(e){var t=U(this,null,"repeat");if(0>e||1342177279<e)throw new RangeError("Invalid count value");e|=0;for(var n="";e;)1&e&&(n+=t),(e>>>=1)&&(t+=t);return n}})),s("Number.EPSILON",(function(){return Math.pow(2,-52)})),s("Number.MAX_SAFE_INTEGER",(function(){return 9007199254740991})),s("Number.isFinite",(function(e){return e||function(e){return"number"==typeof e&&!isNaN(e)&&1/0!==e&&-1/0!==e}})),s("Object.values",(function(e){return e||function(e){var t,n=[];for(t in e)N(e,t)&&n.push(e[t]);return n}})),s("Math.log2",(function(e){return e||function(e){return Math.log(e)/Math.LN2}})),s("String.prototype.endsWith",(function(e){return e||function(e,t){var n=U(this,e,"endsWith");void 0===t&&(t=n.length),t=Math.max(0,Math.min(0|t,n.length));for(var i=e.length;0<i&&0<t;)if(n[--t]!=e[--i])return!1;return 0>=i}})),s("Math.trunc",(function(e){return e||function(e){if(e=Number(e),isNaN(e)||1/0===e||-1/0===e||0===e)return e;var t=Math.floor(Math.abs(e));return 0>e?-t:t}}));var B=this||self;function F(e,t){e=e.split(".");var n,i=B;e[0]in i||void 0===i.execScript||i.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?i=i[n]&&i[n]!==Object.prototype[n]?i[n]:i[n]={}:i[n]=t}function V(){}function H(){}function G(e){this.g=Math.exp(Math.log(.5)/e),this.i=this.h=0}function K(e){return e.h/(1-Math.pow(e.g,e.i))}function X(){this.h=new G(2),this.j=new G(5),this.g=0,this.i=128e3,this.l=16e3}function q(){}function z(){}function W(){}function Y(e){var t=L.apply(1,arguments);$.has(e)||($.add(e),W.apply(q,c(t)))}function J(){}G.prototype.sample=function(e,t){var n=Math.pow(this.g,e);t=t*(1-n)+n*this.h,isNaN(t)||(this.h=t,this.i+=e)},X.prototype.configure=function(e){this.i=e.minTotalBytes,this.l=e.minBytes,this.h.g=Math.exp(Math.log(.5)/e.fastHalfLife),this.j.g=Math.exp(Math.log(.5)/e.slowHalfLife)},X.prototype.sample=function(e,t){if(!(t<this.l)){var n=8e3*t/e;e/=1e3,this.g+=t,this.h.sample(e,n),this.j.sample(e,n)}},X.prototype.getBandwidthEstimate=function(e){return this.g<this.i?e:Math.min(K(this.h),K(this.j))};var $=new Set;function Q(){this.g={}}function Z(){this.g=new Q}function ee(e,t,n,i){this.target=e,this.type=t,this.listener=n,this.g=function(e,t){if(null==t)return!1;if("boolean"==typeof t)return t;var n=new Set(["passive","capture"]);return Object.keys(t).filter((function(e){return!n.has(e)})),function(e){var t=te;if(null==t){t=!1;try{var n={},i={get:function(){return t=!0,!1}};Object.defineProperty(n,"passive",i),Object.defineProperty(n,"capture",i),i=function(){},e.addEventListener("test",i,n),e.removeEventListener("test",i,n)}catch(e){t=!1}te=t}return t||!1}(e)?t:t.capture||!1}(e,i),this.target.addEventListener(t,n,this.g)}e.console&&(W=function(){return console.warn.apply(console,c(L.apply(0,arguments)))},z=function(){console.error.apply(console,c(L.apply(0,arguments)))}),(i=Q.prototype).push=function(e,t){this.g.hasOwnProperty(e)?this.g[e].push(t):this.g[e]=[t]},i.get=function(e){return(e=this.g[e])?e.slice():null},i.remove=function(e,t){e in this.g&&(this.g[e]=this.g[e].filter((function(e){return e!=t})),0==this.g[e].length&&delete this.g[e])},i.forEach=function(e){for(var t in this.g)e(t,this.g[t])},i.size=function(){return Object.keys(this.g).length},i.keys=function(){return Object.keys(this.g)},(i=Z.prototype).release=function(){this.Va(),this.g=null},i.D=function(e,t,n,i){this.g&&(e=new ee(e,t,n,i),this.g.push(t,e))},i.pa=function(e,t,n,i){var r=this;this.D(e,t,(function i(a){r.cb(e,t,i),n(a)}),i)},i.cb=function(e,t,n){if(this.g)for(var i=this.g.get(t)||[],r=(i=l(i)).next();!r.done;r=i.next())(r=r.value).target!=e||n!=r.listener&&n||(r.cb(),this.g.remove(t,r))},i.Va=function(){if(this.g){var e,t=this.g,n=[];for(e in t.g)n.push.apply(n,c(t.g[e]));for(n=(t=l(n)).next();!n.done;n=t.next())n.value.cb();this.g.g={}}},F("shaka.util.EventManager",Z),Z.prototype.removeAll=Z.prototype.Va,Z.prototype.unlisten=Z.prototype.cb,Z.prototype.listenOnce=Z.prototype.pa,Z.prototype.listen=Z.prototype.D,Z.prototype.release=Z.prototype.release,ee.prototype.cb=function(){this.target.removeEventListener(this.type,this.listener,this.g),this.listener=this.target=null,this.g=!1};var te=void 0;function ne(t){if(re.has(t))return re.get(t);var n=e.ManagedMediaSource||e.MediaSource;return!!n&&(n=n.isTypeSupported(t),re.set(t,n),n)}function ie(){var t=e.ManagedSourceBuffer||e.SourceBuffer;return!!t&&!!t.prototype&&!!t.prototype.changeType}var re=new Map;function ae(e,t){this.g=e,this.h=t}function oe(e,t){var n=new ae(5,0),i=le,r=i.g,a=n.h-r.h;(0<(n.g-r.g||a)?i.i:i.h)(i.g,n,e,t)}function se(e,t,n,i){W([n,"has been deprecated and will be removed in",t,". We are currently at version",e,". Additional information:",i].join(" "))}function ue(e,t,n,i){z([n,"has been deprecated and has been removed in",t,". We are now at version",e,". Additional information:",i].join(" "))}ae.prototype.toString=function(){return"v"+this.g+"."+this.h};var le=null;function ce(){}function de(){}function he(){}function fe(e,t){if(!e&&!t)return!0;if(!e||!t||e.byteLength!=t.byteLength)return!1;if((ArrayBuffer.isView(e)?e.buffer:e)==(ArrayBuffer.isView(t)?t.buffer:t)&&(e.byteOffset||0)==(t.byteOffset||0))return!0;var n=ge(e);t=ge(t);for(var i=0;i<e.byteLength;i++)if(n[i]!=t[i])return!1;return!0}function pe(e){return ArrayBuffer.isView(e)?0==e.byteOffset&&e.byteLength==e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer:e}function ge(e,t,n){return ye(e,void 0===t?0:t,n=void 0===n?1/0:n,Uint8Array)}function me(e,t,n){return ye(e,void 0===t?0:t,n=void 0===n?1/0:n,Uint16Array)}function ve(e,t,n){return ye(e,void 0===t?0:t,n=void 0===n?1/0:n,DataView)}function ye(e,t,n,i){var r=ArrayBuffer.isView(e)?e.buffer:e,a=1;"BYTES_PER_ELEMENT"in i&&(a=i.BYTES_PER_ELEMENT);var o=((e.byteOffset||0)+e.byteLength)/a;return new i(r,e=Math.floor(Math.max(0,Math.min(((e.byteOffset||0)+t)/a,o))),Math.floor(Math.min(e+Math.max(n,0),o))-e)}function be(){}function we(e){this.l=new de,(e=Te[e.toLowerCase()])&&(this.l=e()),this.h=new ce,(e=Se)&&(this.h=e())}ce.prototype.extract=function(){},ce.prototype.decode=function(){return[]},ce.prototype.clear=function(){},ce.prototype.getStreams=function(){return[]},de.prototype.init=function(){},de.prototype.parse=function(){return[]},F("shaka.util.BufferUtils",he),he.toDataView=ve,he.toUint16=me,he.toUint8=ge,he.toArrayBuffer=pe,he.equal=fe,be.prototype.init=function(){},be.prototype.i=function(){},be.prototype.g=function(){},be.prototype.j=function(){},F("shaka.media.IClosedCaptionParser",be),we.prototype.init=function(e,t){void 0!==t&&t||this.g(),this.l.init(e)},we.prototype.i=function(e){for(var t=(e=l(e=this.l.parse(e))).next();!t.done;t=e.next()){var n=ge((t=t.value).packet);0<n.length&&this.h.extract(n,t.pts)}return this.h.decode()},we.prototype.g=function(){this.h.clear()},we.prototype.j=function(){return this.h.getStreams()},F("shaka.media.ClosedCaptionParser",we),we.findDecoder=function(){return Se},we.unregisterDecoder=function(){Se=null},we.registerDecoder=function(e){Se=e},we.findParser=function(e){return Te[e]},we.unregisterParser=function(e){delete Te[e]},we.registerParser=function(e,t){Te[e]=t};var Te={},Se=null;function xe(){this.id="",this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0,this.height=this.width=100,this.viewportAnchorUnits=this.widthUnits=this.heightUnits=Ae,this.scroll=Ee}F("shaka.text.CueRegion",xe);var Ae=1;xe.units={PX:0,PERCENTAGE:Ae,LINES:2};var Ee="";function ke(e,t){return!("number"!=typeof e||"number"!=typeof t||!isNaN(e)||!isNaN(t))||e===t}function Ie(e,t){-1<(t=e.indexOf(t))&&e.splice(t,1)}function Me(e,t,n){if(n||(n=ke),e.length!=t.length)return!1;t=t.slice();for(var i=(e=l(e)).next(),r={};!i.done;r={Jg:void 0},i=e.next()){if(r.Jg=i.value,-1==(i=t.findIndex(function(e){return function(t){return n(e.Jg,t)}}(r))))return!1;t[i]=t[t.length-1],t.pop()}return 0==t.length}function Ce(e,t,n){if(n||(n=ke),e.length!=t.length)return!1;for(var i=0;i<e.length;i++)if(!n(e[i],t[i]))return!1;return!0}function De(e,t,n){var i=L.apply(3,arguments);if(this.severity=e,this.category=t,this.code=n,this.data=i,this.handled=!1,this.message="Shaka Error "+this.code,Re)try{throw Error(this.message||"Shaka Error")}catch(e){this.stack=e.stack}}xe.scrollMode={NONE:Ee,UP:"up"},De.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")},F("shaka.util.Error",De);var Re=!0;function Pe(e){this.h=e,this.g=void 0}function Le(e,t){return!e.length||!t.length||e===t||0<Ne(e,t).length}function Ne(e,t){if(!e.length)return t;if(!t.length)return e;for(var n=[],i=(e=l(e)).next();!i.done;i=e.next()){i=i.value;for(var r=l(t),a=r.next();!a.done;a=r.next())if(a=a.value,i.keySystem==a.keySystem){r=new Map;for(var o=l((i.initData||[]).concat(a.initData||[])),s=o.next();!s.done;s=o.next())s=s.value,r.set(s.keyId,s);r=Array.from(r.values()),o=i.keyIds&&a.keyIds?new Set([].concat(c(i.keyIds),c(a.keyIds))):i.keyIds||a.keyIds,n.push({keySystem:i.keySystem,licenseServerUri:i.licenseServerUri||a.licenseServerUri,distinctiveIdentifierRequired:i.distinctiveIdentifierRequired||a.distinctiveIdentifierRequired,persistentStateRequired:i.persistentStateRequired||a.persistentStateRequired,videoRobustness:i.videoRobustness||a.videoRobustness,audioRobustness:i.audioRobustness||a.audioRobustness,serverCertificate:i.serverCertificate||a.serverCertificate,serverCertificateUri:i.serverCertificateUri||a.serverCertificateUri,initData:r,keyIds:o});break}}return n}function je(e){return!!e&&!!e.match(/^com\.(microsoft|chromecast)\.playready/)}De.Severity={RECOVERABLE:1,CRITICAL:2},De.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9,ADS:10},De.Code={UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,ATTEMPTS_EXHAUSTED:1010,SEGMENT_MISSING:1011,INVALID_TEXT_HEADER:2e3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,UNABLE_TO_EXTRACT_CUE_START_TIME:2009,INVALID_MP4_CEA:2010,TEXT_COULD_NOT_GUESS_MIME_TYPE:2011,CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS:2012,TEXT_ONLY_WEBVTT_SRC_EQUALS:2013,MISSING_TEXT_PLUGIN:2014,CHAPTERS_TRACK_FAILED:2015,UNSUPPORTED_EXTERNAL_THUMBNAILS_URI:2017,BUFFER_READ_OUT_OF_BOUNDS:3e3,JS_INTEGER_OVERFLOW:3001,EBML_OVERFLOW:3002,EBML_BAD_FLOATING_POINT_SIZE:3003,MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005,MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,TRANSMUXING_FAILED:3018,CONTENT_TRANSFORMATION_FAILED:3019,MSS_MISSING_DATA_FOR_TRANSMUXING:3020,MSS_TRANSMUXING_FAILED:3022,TRANSMUXING_NO_VIDEO_DATA:3023,UNABLE_TO_GUESS_MANIFEST_TYPE:4e3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,DASH_WEBM_MISSING_INIT:4005,DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,RESTRICTIONS_CANNOT_BE_MET:4012,HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,DASH_UNSUPPORTED_XLINK_ACTUATE:4027,DASH_XLINK_DEPTH_LIMIT:4028,CONTENT_UNSUPPORTED_BY_BROWSER:4032,CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM:4033,NO_VARIANTS:4036,PERIOD_FLATTENING_FAILED:4037,INCONSISTENT_DRM_ACROSS_PERIODS:4038,HLS_VARIABLE_NOT_FOUND:4039,HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED:4040,HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED:4041,NO_WEB_CRYPTO_API:4042,CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_LIVE_STREAM:4045,MSS_INVALID_XML:4046,MSS_LIVE_CONTENT_NOT_SUPPORTED:4047,AES_128_INVALID_IV_LENGTH:4048,AES_128_INVALID_KEY_LENGTH:4049,DASH_CONFLICTING_AES_128:4050,DASH_UNSUPPORTED_AES_128:4051,DASH_INVALID_PATCH:4052,HLS_EMPTY_MEDIA_PLAYLIST:4053,DASH_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED:4054,STREAMING_ENGINE_STARTUP_INVALID_STATE:5006,NO_RECOGNIZED_KEY_SYSTEMS:6e3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,SERVER_CERTIFICATE_REQUIRED:6015,INIT_DATA_TRANSFORM_ERROR:6016,SERVER_CERTIFICATE_REQUEST_FAILED:6017,MIN_HDCP_VERSION_NOT_MATCH:6018,ERROR_CHECKING_HDCP_VERSION:6019,LOAD_INTERRUPTED:7e3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,OBJECT_DESTROYED:7003,CONTENT_NOT_LOADED:7004,SRC_EQUALS_PRELOAD_NOT_SUPPORTED:7005,CAST_API_UNAVAILABLE:8e3,NO_CAST_RECEIVERS:8001,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,STORAGE_NOT_SUPPORTED:9e3,INDEXED_DB_ERROR:9001,DEPRECATED_OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,NEW_KEY_OPERATION_NOT_SUPPORTED:9011,KEY_NOT_FOUND:9012,MISSING_STORAGE_CELL:9013,STORAGE_LIMIT_REACHED:9014,DOWNLOAD_SIZE_CALLBACK_ERROR:9015,MODIFY_OPERATION_NOT_SUPPORTED:9016,INDEXED_DB_INIT_TIMED_OUT:9017,CS_IMA_SDK_MISSING:1e4,CS_AD_MANAGER_NOT_INITIALIZED:10001,SS_IMA_SDK_MISSING:10002,SS_AD_MANAGER_NOT_INITIALIZED:10003,CURRENT_DAI_REQUEST_NOT_FINISHED:10004,MT_AD_MANAGER_NOT_INITIALIZED:10005,INTERSTITIAL_AD_MANAGER_NOT_INITIALIZED:10006,VAST_INVALID_XML:10007},Pe.prototype.value=function(){return null==this.g&&(this.g=this.h()),this.g};var Oe=new Pe((function(){return pe(new Uint8Array([0]))})),Ue=new Map;function _e(e){this.h=e,this.g=null}function Be(e){this.h=e,this.g=null}function Fe(){var t=e.ManagedMediaSource||e.MediaSource;return!(!t||!t.isTypeSupported)}function Ve(e){return""!=at().canPlayType(e)}function He(){return!!navigator.userAgent.match(/Edge?\//)}function Ge(){return rt("Xbox One")}function Ke(){return rt("Tizen")}function Xe(){return rt("Tizen 3")}function qe(){return rt("Web0S")}function ze(){return rt("CrKey")}function We(){if(!rt("Chrome")||navigator.userAgent.match(/Edge\//))return null;var e=navigator.userAgent.match(/Chrome\/(\d+)/);return e?parseInt(e[1],10):null}function Ye(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!Ke()&&!rt("PC=EOS")&&!rt("PC=APL")&&!rt("VirginMedia")&&!Ze()&&!$e()&&!rt("AFT")&&!rt("WPE")&&!rt("DT_STB_BCM")&&!rt("Sky_STB")}function Je(){return rt("PlayStation 5")}function $e(){return rt("PlayStation 4")}function Qe(){return rt("Hisense")||rt("VIDAA")}function Ze(){return rt("SOPOpenBrowser")}function et(){if(!Ye())return null;var e=navigator.userAgent.match(/Version\/(\d+)/);return e||(e=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(e[1],10):null}function tt(){return navigator.userAgentData&&navigator.userAgentData.platform?"windows"==navigator.userAgentData.platform.toLowerCase():!!navigator.platform&&navigator.platform.toLowerCase().includes("win32")}function nt(){return rt("Android")}function it(){return!!(Ke()||qe()||Ge()||$e()||Je()||rt("AFT")||rt("PC=EOS")||rt("PC=APL")||rt("VirginMedia")||Ze()||rt("WPE")||ze()||Qe()||rt("DT_STB_BCM"))}function rt(e){return(navigator.userAgent||"").includes(e)}function at(){return lt||(ut||(ut=new Be((function(){lt=null}))),(lt=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(lt=document.createElement("video")),ut.$(1),lt)}function ot(t){return t?t===e.shakaMediaKeysPolyfill:!!e.shakaMediaKeysPolyfill}function st(){var t,n,i,r,a,o,s,u,l,c,d,h,f;return P((function(p){switch(p.g){case 1:if(t={width:1/0,height:1/0},ze()){if(d=e.cast&&cast.__platform__&&cast.__platform__.canDisplayType,t.width=1280,t.height=720,S(p,14),!(h=d)){p.u(16);break}return w(p,cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160'),17)}if(Ke()){t.width=1920,t.height=1080;try{webapis.systeminfo&&webapis.systeminfo.getMaxVideoResolution?(n=webapis.systeminfo.getMaxVideoResolution(),t.width=n.width,t.height=n.height):webapis.productinfo.is8KPanelSupported&&webapis.productinfo.is8KPanelSupported()?(t.width=7680,t.height=4320):webapis.productinfo.isUdPanelSupported&&webapis.productinfo.isUdPanelSupported()&&(t.width=3840,t.height=2160)}catch(e){W("Tizen: Error detecting screen size, default screen size 1920x1080.")}p.u(3);break}if(qe()){try{i=JSON.parse(e.PalmSystem.deviceInfo),t.width=Math.max(1920,i.screenWidth),t.height=Math.max(1080,i.screenHeight)}catch(e){W("WebOS: Error detecting screen size, default screen size 1920x1080."),t.width=1920,t.height=1080}p.u(3);break}if(Qe()){e.Hisense_Get4KSupportState&&e.Hisense_Get4KSupportState()?(t.width=3840,t.height=2160):(t.width=1920,t.height=1080),p.u(3);break}if(!$e()&&!Je()){r=void 0;try{r="undefined"!=typeof Windows?Windows:chrome.webview.hostObjects.sync.Windows}catch(e){}if(r){t.width=1920,t.height=1080;try{a=new r.Media.Protection.ProtectionCapabilities,o=r.Media.Protection.ProtectionCapabilityResult,s=null;do{s=a.isTypeSupported('video/mp4;codecs="hvc1,mp4a";features="decode-res-x=3840,decode-res-y=2160,decode-bitrate=20000,decode-fps=30,decode-bpc=10,display-res-x=3840,display-res-y=2160,display-bpc=8"',"com.microsoft.playready.recommendation")}while(s===o.maybe);s===o.probably&&(t.width=3840,t.height=2160)}catch(e){W("Xbox: Error detecting screen size, default screen size 1920x1080.")}}else Ge()&&(t.width=1920,t.height=1080,W("Xbox: Error detecting screen size, default screen size 1920x1080."));p.u(3);break}return u=!1,S(p,8),w(p,e.msdk.device.getDisplayInfo(),10);case 10:l=p.h,u="4K"===l.resolution,A(p,9);break;case 8:return E(p),S(p,11),w(p,e.msdk.device.getDisplayInfoImmediate(),13);case 13:c=p.h,u="4K"===c.resolution,A(p,9);break;case 11:W("PlayStation: Failed to get the display info:",E(p));case 9:u?(t.width=3840,t.height=2160):(t.width=1920,t.height=1080),p.u(3);break;case 17:h=p.h;case 16:if(h){t.width=3840,t.height=2160,p.u(18);break}if(!(f=d)){p.u(19);break}return w(p,cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=1920; height=1080'),20);case 20:f=p.h;case 19:f&&(t.width=1920,t.height=1080);case 18:A(p,3);break;case 14:z("Failed to check canDisplayType:",E(p));case 3:return p.return(t)}}))}_e.prototype.$=function(t){var n=this;this.stop();var i=!0,r=null;return this.g=function(){e.clearTimeout(r),i=!1},r=e.setTimeout((function(){i&&n.h()}),1e3*t),this},_e.prototype.stop=function(){this.g&&(this.g(),this.g=null)},Be.prototype.hc=function(){return this.stop(),this.h(),this},Be.prototype.$=function(e){var t=this;return this.stop(),this.g=new _e((function(){t.h()})).$(e),this},Be.prototype.Ra=function(e){var t=this;return this.stop(),this.g=new _e((function(){t.g.$(e),t.h()})).$(e),this},Be.prototype.stop=function(){this.g&&(this.g.stop(),this.g=null)},F("shaka.util.Timer",Be),Be.prototype.stop=Be.prototype.stop,Be.prototype.tickEvery=Be.prototype.Ra,Be.prototype.tickAfter=Be.prototype.$,Be.prototype.tickNow=Be.prototype.hc;var ut=null,lt=null;function ct(){}function dt(t){if(!t)return"";if(239==(t=ge(t))[0]&&187==t[1]&&191==t[2]&&(t=t.subarray(3)),e.TextDecoder&&!$e())return(t=(new TextDecoder).decode(t)).includes("�")&&z('Decoded string contains an "unknown character" codepoint. That probably means the UTF8 encoding was incorrect!'),t;for(var n="",i=0;i<t.length;++i){var r=65533;if(128&t[i]?t.length>=i+2&&192==(224&t[i])&&128==(192&t[i+1])?(r=(31&t[i])<<6|63&t[i+1],i+=1):t.length>=i+3&&224==(240&t[i])&&128==(192&t[i+1])&&128==(192&t[i+2])?(r=(15&t[i])<<12|(63&t[i+1])<<6|63&t[i+2],i+=2):t.length>=i+4&&240==(241&t[i])&&128==(192&t[i+1])&&128==(192&t[i+2])&&128==(192&t[i+3])&&(r=(7&t[i])<<18|(63&t[i+1])<<12|(63&t[i+2])<<6|63&t[i+3],i+=3):r=t[i],65535>=r)n+=String.fromCharCode(r);else{var a=1023&(r-=65536);n+=String.fromCharCode(55296+(r>>10)),n+=String.fromCharCode(56320+a)}}return n}function ht(e,t,n){if(!e)return"";if(!n&&0!=e.byteLength%2)throw new De(2,2,2004);n=Math.floor(e.byteLength/2);var i=new Uint16Array(n);e=ve(e);for(var r=0;r<n;r++)i[r]=e.getUint16(2*r,t);return mt(i)}function ft(e){function t(e){return n.byteLength<=e||32<=n[e]&&126>=n[e]}if(!e)return"";var n=ge(e);if(239==n[0]&&187==n[1]&&191==n[2])return dt(n);if(254==n[0]&&255==n[1])return ht(n.subarray(2),!1);if(255==n[0]&&254==n[1])return ht(n.subarray(2),!0);if(0==n[0]&&0==n[2])return ht(e,!1);if(0==n[1]&&0==n[3])return ht(e,!0);if(t(0)&&t(1)&&t(2)&&t(3))return dt(e);throw new De(2,2,2003)}function pt(t){if(e.TextEncoder&&!$e()){var n=new TextEncoder;return pe(n.encode(t))}t=encodeURIComponent(t),t=unescape(t),n=new Uint8Array(t.length);for(var i=0;i<t.length;i++)n[i]=t[i].charCodeAt(0);return pe(n)}function gt(e,t){for(var n=new ArrayBuffer(2*e.length),i=new DataView(n),r=0;r<e.length;++r)i.setUint16(2*r,e.charCodeAt(r),t);return n}function mt(e){return yt.value()(e)}function vt(e){var t={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&apos;":"'","&nbsp;":" ","&lrm;":"‎","&rlm;":"‏"},n=/&(?:amp|lt|gt|quot|apos|nbsp|lrm|rlm|#[xX]?[0-9a-fA-F]+);/g,i=RegExp(n.source);return e&&i.test(e)?e.replace(n,(function(e){return"#"==e[1]?0<=(e="x"==e[2]||"X"==e[2]?parseInt(e.substring(3),16):parseInt(e.substring(2),10))&&1114111>=e?String.fromCodePoint(e):"":t[e]||"'"})):e||""}F("shaka.util.StringUtils",ct),ct.resetFromCharCode=function(){yt.g=void 0},ct.toUTF16=gt,ct.toUTF8=pt,ct.fromBytesAutoDetect=ft,ct.fromUTF16=ht,ct.fromUTF8=dt;var yt=new Pe((function(){function e(e){try{var t=new Uint8Array(e);return 0<String.fromCharCode.apply(null,t).length}catch(e){return!1}}for(var t={fc:65536};0<t.fc;(t={fc:t.fc}).fc/=2)if(e(t.fc))return function(e){return function(t){for(var n="",i=0;i<t.length;i+=e.fc)n+=String.fromCharCode.apply(null,t.subarray(i,i+e.fc));return n}}(t);return null}));function bt(e){this.h=e||"",this.g=0}function wt(e){Tt(e,/[ \t]+/gm)}function Tt(e,t){return t.lastIndex=e.g,t=null==(t=t.exec(e.h))?null:{position:t.index,length:t[0].length,results:t},e.g==e.h.length||null==t||t.position!=e.g?null:(e.g+=t.length,t.results)}function St(e){return e.g==e.h.length?null:(e=Tt(e,/[^ \t\n]*/gm))?e[0]:null}function xt(e){if(null==(e=Tt(e,Et)))return null;var t=Number(e[2]),n=Number(e[3]);return 59<t||59<n?null:(Number(e[6])||0)/1e3+n+60*t+3600*(Number(e[1])||0)}function At(e){return e?xt(new bt(e)):null}var Et=/(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;function kt(e){var t=new WeakSet;return function e(n){switch(typeof n){case"undefined":case"boolean":case"number":case"string":case"symbol":case"function":return n;default:if(!n||ArrayBuffer.isView(n))return n;if(t.has(n))return null;var i=n.constructor==Array;if(n.constructor!=Object&&!i)return null;t.add(n);var r,a=i?[]:{};for(r in n)a[r]=e(n[r]);return i&&(a.length=n.length),a}}(e)}function It(e){var t,n={};for(t in e)n[t]=e[t];return n}function Mt(e){if(Array.isArray(e)){for(var t=[],n=0;n<e.length;n++){var i=n.toString(),r=e[n];void 0!==r&&(r=Mt(r))&&t.push(i+":"+r)}e="["+t.join(",")+"]"}else if("function"==typeof e)e="";else if(e instanceof Object){for((n=Object.keys(e)).sort(),t=[],i=(n=l(n)).next();!i.done;i=n.next())r=i.value,i=JSON.stringify(r),void 0!==(r=e[r])&&(r=Mt(r))&&t.push(i+":"+r);e="{"+t.join(",")+"}"}else e=JSON.stringify(e);return e}function Ct(e,t){var n=void 0!==n&&n;return Dt(e=ft(e),t,n)}function Dt(e,t,n){return e=function(e,t){function n(){for(var t=i;-1==="\r\n\t>/= ".indexOf(e[i])&&e[i];)i++;return e.slice(t,i)}var i=0;return function r(a,o){o=void 0!==o&&o;for(var s=[];e[i];)if(60==e.charCodeAt(i)){if(47===e.charCodeAt(i+1)){o=i+2,i=e.indexOf(">",i);var u=(o=e.substring(o,i)).indexOf(a);if(-1==u){var l=a.indexOf(".");0<l&&(u=o.indexOf(a.substring(0,l)))}if(-1==u)throw a=e.substring(0,i).split("\n"),Error("Unexpected close tag\nLine: "+(a.length-1)+"\nColumn: "+(a[a.length-1].length+1)+"\nChar: "+e[i]);i+1&&(i+=1);break}if(33===e.charCodeAt(i+1)){if(45==e.charCodeAt(i+2)){for(;-1!==i&&(62!==e.charCodeAt(i)||45!=e.charCodeAt(i-1)||45!=e.charCodeAt(i-2)||-1==i);)i=e.indexOf(">",i+1);-1===i&&(i=e.length)}else if(91===e.charCodeAt(i+2)&&91===e.charCodeAt(i+8)&&"cdata"===e.substr(i+3,5).toLowerCase()){-1==(u=e.indexOf("]]>",i))?(s.push(e.substr(i+9)),i=e.length):(s.push(e.substring(i+9,u)),i=u+3);continue}i++;continue}e:{l=o,i++;var d=n(),h={};for(u=[];62!==e.charCodeAt(i)&&e[i];){var f=e.charCodeAt(i);if(64<f&&91>f||96<f&&123>f){f=n();for(var p=e.charCodeAt(i);p&&39!==p&&34!==p&&!(64<p&&91>p||96<p&&123>p)&&62!==p;)i++,p=e.charCodeAt(i);var g=i+1;if(i=e.indexOf(e[i],g),g=e.slice(g,i),39===p||34===p){if(-1===i){if(l={tagName:d,attributes:h,children:u,parent:null},t)for(d=0;d<u.length;d++)"string"!=typeof u[d]&&(u[d].parent=l);u=l;break e}}else g=null,i--;if(f.startsWith("xmlns:")){p=g;var m=f.split(":")[1];on.set(p,m),sn.set(m,p)}"tt"===d&&"xml:space"===f&&"preserve"===g&&(l=!0),h[f]=g}i++}for(47!==e.charCodeAt(i-1)?(i++,u=r(d,l)):i++,l={tagName:d,attributes:h,children:u,parent:null},d=u.length,h=0;h<d;h++)"string"!=typeof(f=u[h])?t&&(f.parent=l):h==d-1&&"\n"==f&&u.pop();u=l}if(s.push(u),"string"==typeof u)break;"?"===u.tagName[0]&&u.children&&(s.push.apply(s,c(u.children)),u.children=[])}else u=i,-2==(i=e.indexOf("<",i)-1)&&(i=e.length),u=e.slice(u,i+1),o?0<u.length&&s.push(u):(s.length&&1==u.length&&"\n"==u[0]||0<u.trim().length)&&s.push(u),i++;return s}("")}(e,void 0!==n&&n),!t&&e.length?e[0]:(e=e.find((function(e){return t.split(",").includes(e.tagName)})))?e:null}function Rt(e){return on.has(e)?on.get(e):""}function Pt(e){return"string"==typeof e}function Lt(e){var t=[];if(!e.children)return[];for(var n=(e=l(e.children)).next();!n.done;n=e.next())"string"!=typeof(n=n.value)&&t.push(n);return t}function Nt(e,t){var n=[];if(!e.children)return[];for(var i=(e=l(e.children)).next();!i.done;i=e.next())(i=i.value).tagName===t&&n.push(i);return n}function jt(e){return"string"==typeof e?vt(e):""===(e=e.children.reduce((function(e,t){return"string"==typeof t?e+t:e}),""))?null:vt(e)}function Ot(e){return Array.from(e.children).every((function(e){return"string"==typeof e}))?((e=jt(e))&&(e=e.trim()),e):null}function Ut(e,t,n){if(n=void 0===n?[]:n,e.tagName===t&&n.push(e),e.children)for(var i=(e=l(e.children)).next();!i.done;i=e.next())Ut(i.value,t,n);return n}function _t(e,t){return 1!=(e=Nt(e,t)).length?null:e[0]}function Bt(e,t,n){return 1!=(e=Ht(e,t,n)).length?null:e[0]}function Ft(e,t,n,i){i=void 0===i?null:i;var r=null;return null!=(e=e.attributes[t])&&(r=n(e)),null==r?i:r}function Vt(e,t,n){return t=Rt(t),e.attributes[t+":"+n]||null}function Ht(e,t,n){t=Rt(t);var i=[];if(e.children)for(var r=(e=l(e.children)).next();!r.done;r=e.next())(r=r.value)&&r.tagName===t+":"+n&&i.push(r);return i}function Gt(e,t,n){for(var i=(t=l(t)).next();!i.done;i=t.next())if(i=Vt(e,i.value,n))return i;return null}function Kt(e){return e?(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)&&(e+="Z"),e=Date.parse(e),isNaN(e)?null:e/1e3):null}function Xt(e){return e&&(e=RegExp("^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$").exec(e))?(e=31536e3*Number(e[1]||null)+2592e3*Number(e[2]||null)+86400*Number(e[3]||null)+3600*Number(e[4]||null)+60*Number(e[5]||null)+Number(e[6]||null),isFinite(e)?e:null):null}function qt(e){var t=/([0-9]+)-([0-9]+)/.exec(e);return t?(e=Number(t[1]),isFinite(e)?(t=Number(t[2]),isFinite(t)?{start:e,end:t}:null):null):null}function zt(e){return 0==(e=Number(e))%1?e:null}function Wt(e){return 0==(e=Number(e))%1&&0<e?e:null}function Yt(e){return 0==(e=Number(e))%1&&0<=e?e:null}function Jt(e){return e=Number(e),isNaN(e)?null:e}function $t(e){return!!e&&"true"===e.toLowerCase()}function Qt(e){var t,n=(t=e.match(/^(\d+)\/(\d+)$/))?Number(t[1])/Number(t[2]):Number(e);return isNaN(n)?null:n}function Zt(e){for(var t=[],n=(e=l(e=vt(e).split(/\/+(?=(?:[^'"]*['"][^'"]*['"])*[^'"]*$)/))).next();!n.done;n=e.next()){var i=(n=n.value).match(/^([\w]+)/);if(i){var r=n.match(/(@id='(.*?)')/),a=n.match(/(@t='(\d+)')/),o=n.match(/(@n='(\d+)')/),s=n.match(/\[(\d+)\]/);t.push({name:i[0],id:r?r[0].match(/'(.*?)'/)[0].replace(/'/gm,""):null,t:a?Number(a[0].match(/'(.*?)'/)[0].replace(/'/gm,"")):null,n:o?Number(o[0].match(/'(.*?)'/)[0].replace(/'/gm,"")):null,position:s?Number(s[1])-1:null,Ub:n.split("/@")[1]||null})}else n.startsWith("@")&&t.length&&(t[t.length-1].Ub=n.slice(1))}return t}function en(e,t){var n=Zt(t.attributes.sel||"");if(n.length){var i=n[n.length-1],r=t.attributes.pos||null;null==(n=i.position)&&(null!==i.t&&(n=tn(e,"t",i.t)),null!==i.n&&(n=tn(e,"n",i.n))),null===n?n="prepend"===r?0:e.length:"prepend"===r?--n:"after"===r&&++n,r=t.tagName,(i=i.Ub)&&e[n]?nn(e[n],r,i,Ot(t)||""):("remove"!==r&&"replace"!==r||e.splice(n,1),"add"!==r&&"replace"!==r||e.splice.apply(e,[n,0].concat(c(t.children))))}}function tn(e,t,n){for(var i=0,r=(e=l(e)).next();!r.done;r=e.next()){if(Number(r.value.attributes[t])===n)return i;i++}return null}function nn(e,t,n,i){"remove"===t?delete e.attributes[n]:"add"!==t&&"replace"!==t||(e.attributes[n]=i)}function rn(e){var t="",n=e.tagName.split(":");for(var i in 0<n.length&&(t=n[0],t=sn.has(t)?sn.get(t):""),t=document.createElementNS(t,e.tagName),e.attributes)t.setAttribute(i,e.attributes[i]);for(i=(e=l(e.children)).next();!i.done;i=e.next())n=void 0,n="string"==typeof(i=i.value)?new Text(i):rn(i),t.appendChild(n);return t}function an(e){if(!e)return null;for(var t={tagName:e.tagName,attributes:It(e.attributes),children:[],parent:null},n=(e=l(e.children)).next();!n.done;n=e.next())"string"==typeof(n=n.value)||((n=an(n)).parent=t),t.children.push(n);return t}var on=new Map,sn=new Map;function un(e,t,n){this.startTime=e,this.endTime=t,this.payload=n,this.region=new xe,this.position=null,this.positionAlign=gn,this.size=0,this.textAlign=mn,this.direction=wn,this.writingMode=Tn,this.lineInterpretation=Sn,this.line=null,this.lineHeight="",this.lineAlign=xn,this.displayAlign=yn,this.fontSize=this.border=this.backgroundImage=this.backgroundColor=this.color="",this.fontWeight=In,this.fontStyle=Cn,this.linePadding=this.letterSpacing=this.fontFamily="",this.opacity=1,this.textCombineUpright="",this.textDecoration=[],this.textStrokeWidth=this.textStrokeColor=this.textShadow="",this.wrapLine=!0,this.id="",this.nestedCues=[],this.lineBreak=this.isContainer=!1,this.rubyTag=null,this.cellResolution={lc:32,rows:15}}function ln(e,t){return(e=new un(e,t,"")).lineBreak=!0,e}function cn(e,t){if(e.startTime!=t.startTime||e.endTime!=t.endTime||e.payload!=t.payload)return!1;for(var n in e)if("startTime"!=n&&"endTime"!=n&&"payload"!=n)if("nestedCues"==n){if(!Ce(e.nestedCues,t.nestedCues,cn))return!1}else if("region"==n||"cellResolution"==n){for(var i in e[n])if(e[n][i]!=t[n][i])return!1}else if(Array.isArray(e[n])){if(!Ce(e[n],t[n]))return!1}else if(e[n]!=t[n])return!1;return!0}function dn(e,t){t=void 0===t?new Map:t;var n=e.payload;if(n.includes("<")){0===t.size&&hn(t);var i=n;n=[];for(var r=-1,a=0;a<i.length;a++)"<"===i[a]?r=a+1:">"===i[a]&&0<r&&((r=i.substr(r,a-r)).match(Ln)&&n.push(r),r=-1);for(a=(n=l(n)).next();!a.done;a=n.next())a=a.value,i=i.replace("<"+a+">",'<div time="'+a+'">'),i+="</div>";e:{a=i,r=[];var o=-1;n="",i=!1;for(var s=0;s<a.length;s++)if("/"===a[s]){var u=a.indexOf(">",s);if(-1===u){n=a;break e}if((u=a.substring(s+1,u))&&"v"==u){i=!0;var c=null;if(r.length&&(c=r[r.length-1]),c){if(c===u)n+="/"+u+">";else{if(!c.startsWith("v")){n+=a[s];continue}n+="/"+c+">"}s+=u.length+1}else n+=a[s]}else n+=a[s]}else"<"===a[s]?"v"!=a[o=s+1]&&(o=-1):">"===a[s]&&0<o&&(r.push(a.substr(o,s-o)),o=-1),n+=a[s];for(r=(a=l(r)).next();!r.done;r=a.next())o=(r=r.value).replace(" ",".voice-"),n=(n=n.replace("<"+r+">","<"+o+">")).replace("</"+r+">","</"+o+">"),i||(n+="</"+o+">")}n=function(e){var t={"< ":""," >":" &gt;"},n=/(< +>|<\s|\s>)/g,i=RegExp(n.source);return e&&i.test(e)?e.replace(n,(function(e){return t[e]||""})):e||""}(n),e.payload="";try{var d=Dt("<span>"+n+"</span>","span")}catch(e){}if(d)if(1!=(d=d.children).length||d[0].tagName)for(n=(d=l(d)).next();!n.done;n=d.next())fn(n.value,e,t);else e.payload=vt(n);else e.payload=vt(n)}else e.payload=vt(n)}function hn(e){for(var t=l(Object.entries(En)),n=t.next();!n.done;n=t.next()){var i=l(n.value);n=i.next().value,i=i.next().value;var r=new un(0,0,"");r.color=i,e.set("."+n,r)}for(n=(t=l(Object.entries(kn))).next();!n.done;n=t.next())n=(i=l(n.value)).next().value,i=i.next().value,(r=new un(0,0,"")).backgroundColor=i,e.set("."+n,r)}function fn(e,t,n){var i=t.clone();if(i.nestedCues=[],i.payload="",i.rubyTag="",i.line=null,i.region=new xe,i.position=null,i.size=0,i.textAlign=mn,e.tagName)for(var r=l(e.tagName.split(/(?=[ .])+/g)),a=r.next();!a.done;a=r.next()){var o=a=a.value;if(o.startsWith(".voice-")){var s=o.split("-").pop();o='v[voice="'+s+'"]',n.has(o)||(o="v[voice="+s+"]")}switch(n.has(o)&&(s=i,o=n.get(o))&&(s.backgroundColor=pn(o.backgroundColor,s.backgroundColor),s.color=pn(o.color,s.color),s.fontFamily=pn(o.fontFamily,s.fontFamily),s.fontSize=pn(o.fontSize,s.fontSize),s.textShadow=pn(o.textShadow,s.textShadow),s.fontWeight=o.fontWeight,s.fontStyle=o.fontStyle,s.opacity=o.opacity,s.rubyTag=o.rubyTag,s.textCombineUpright=o.textCombineUpright,s.wrapLine=o.wrapLine),a){case"br":return i=ln(i.startTime,i.endTime),void t.nestedCues.push(i);case"b":i.fontWeight=Mn;break;case"i":i.fontStyle=Dn;break;case"u":i.textDecoration.push(Pn);break;case"font":(a=e.attributes.color)&&(i.color=a);break;case"div":if(!(a=e.attributes.time))break;(a=At(a))&&(i.startTime=a);break;case"ruby":case"rp":case"rt":i.rubyTag=a}}if(r=e.children,Pt(e)||1==r.length&&Pt(r[0]))for(n=jt(e).split("\n"),e=!0,r=(n=l(n)).next();!r.done;r=n.next())r=r.value,e||(e=ln(i.startTime,i.endTime),t.nestedCues.push(e)),0<r.length&&((e=i.clone()).payload=vt(r),t.nestedCues.push(e)),e=!1;else for(t.nestedCues.push(i),e=(t=l(r)).next();!e.done;e=t.next())fn(e.value,i,n)}function pn(e,t){return e&&0<e.length?e:t}un.prototype.clone=function(){var e,t=new un(0,0,"");for(e in this)t[e]=this[e],t[e]&&t[e].constructor==Array&&(t[e]=t[e].slice());return t},F("shaka.text.Cue",un),un.parseCuePayload=dn,un.equal=cn,un.prototype.clone=un.prototype.clone;var gn="auto";un.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:gn};var mn="center",vn={LEFT:"left",RIGHT:"right",CENTER:mn,START:"start",END:"end"};un.textAlign=vn;var yn="after",bn={BEFORE:"before",CENTER:"center",AFTER:yn};un.displayAlign=bn;var wn="ltr";un.direction={HORIZONTAL_LEFT_TO_RIGHT:wn,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var Tn="horizontal-tb";un.writingMode={HORIZONTAL_TOP_TO_BOTTOM:Tn,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};var Sn=0;un.lineInterpretation={LINE_NUMBER:Sn,PERCENTAGE:1};var xn="start",An={CENTER:"center",START:xn,END:"end"};un.lineAlign=An;var En={white:"white",lime:"lime",cyan:"cyan",red:"red",yellow:"yellow",magenta:"magenta",blue:"blue",black:"black"};un.defaultTextColor=En;var kn={bg_white:"white",bg_lime:"lime",bg_cyan:"cyan",bg_red:"red",bg_yellow:"yellow",bg_magenta:"magenta",bg_blue:"blue",bg_black:"black"};un.defaultTextBackgroundColor=kn;var In=400,Mn=700;un.fontWeight={NORMAL:In,BOLD:Mn};var Cn="normal",Dn="italic",Rn={NORMAL:Cn,ITALIC:Dn,OBLIQUE:"oblique"};un.fontStyle=Rn;var Pn="underline";un.textDecoration={UNDERLINE:Pn,LINE_THROUGH:"lineThrough",OVERLINE:"overline"};var Ln=/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g;function Nn(){}function jn(e,t,n){Un[e.toLowerCase().split(";")[0]+"-"+n]={priority:n,he:t}}function On(e,t){for(var n=e.toLowerCase().split(";")[0],i=l([Vn,Fn,Bn,_n]),r=i.next();!r.done;r=i.next())if(r=Un[n+"-"+r.value]){var a=r.he(),o=a.isSupported(e,t);if(a.destroy(),o)return r.he}return null}Nn.prototype.destroy=function(){},F("shaka.transmuxer.TransmuxerEngine",Nn),Nn.findTransmuxer=On,Nn.unregisterTransmuxer=function(e,t){delete Un[e.toLowerCase().split(";")[0]+"-"+t]},Nn.registerTransmuxer=jn,Nn.prototype.destroy=Nn.prototype.destroy;var Un={},_n=1,Bn=2,Fn=3,Vn=4;Nn.PluginPriority={FALLBACK:_n,PREFERRED_SECONDARY:Bn,PREFERRED:Fn,APPLICATION:Vn};var Hn=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");function Gn(e){var t;e instanceof Gn?(Kn(this,e.Db),this.Cc=e.Cc,Xn(this,e.Fb),qn(this,e.Uc),this.Ua=e.Ua,zn(this,e.g.clone()),this.mc=e.mc):e&&(t=String(e).match(Hn))?(Kn(this,t[1]||"",!0),this.Cc=Wn(t[2]||""),Xn(this,t[3]||"",!0),qn(this,t[4]),this.Ua=Wn(t[5]||"",!0),zn(this,t[6]||"",!0),this.mc=Wn(t[7]||"")):this.g=new ni(null)}function Kn(e,t,n){e.Db=n?Wn(t,!0):t,e.Db&&(e.Db=e.Db.replace(/:$/,""))}function Xn(e,t,n){e.Fb=n?Wn(t,!0):t}function qn(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.Uc=t}else e.Uc=null}function zn(e,t,n){t instanceof ni?e.g=t:(n||(t=Yn(t,ei)),e.g=new ni(t))}function Wn(e,t){return e?t?decodeURI(e):decodeURIComponent(e):""}function Yn(e,t,n){return null!=e?(e=encodeURI(e).replace(t,Jn),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function Jn(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}(i=Gn.prototype).Db="",i.Cc="",i.Fb="",i.Uc=null,i.Ua="",i.mc="",i.toString=function(){var e=[],t=this.Db;if(t&&e.push(Yn(t,$n,!0),":"),t=this.Fb){e.push("//");var n=this.Cc;n&&e.push(Yn(n,$n,!0),"@"),e.push(encodeURIComponent(t).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(t=this.Uc)&&e.push(":",String(t))}return(t=this.Ua)&&(this.Fb&&"/"!=t.charAt(0)&&e.push("/"),e.push(Yn(t,"/"==t.charAt(0)?Zn:Qn,!0))),(t=this.g.toString())&&e.push("?",t),(t=this.mc)&&e.push("#",Yn(t,ti)),e.join("")},i.resolve=function(e){var t=this.clone();"data"===t.Db&&(t=new Gn);var n=!!e.Db;n?Kn(t,e.Db):n=!!e.Cc,n?t.Cc=e.Cc:n=!!e.Fb,n?Xn(t,e.Fb):n=null!=e.Uc;var i=e.Ua;if(n)qn(t,e.Uc);else if(n=!!e.Ua){if("/"!=i.charAt(0))if(this.Fb&&!this.Ua)i="/"+i;else{var r=t.Ua.lastIndexOf("/");-1!=r&&(i=t.Ua.substr(0,r+1)+i)}if(".."==i||"."==i)i="";else if(-1!=i.indexOf("./")||-1!=i.indexOf("/.")){r=0==i.lastIndexOf("/",0),i=i.split("/");for(var a=[],o=0;o<i.length;){var s=i[o++];"."==s?r&&o==i.length&&a.push(""):".."==s?((1<a.length||1==a.length&&""!=a[0])&&a.pop(),r&&o==i.length&&a.push("")):(a.push(s),r=!0)}i=a.join("/")}}return n?t.Ua=i:n=""!==e.g.toString(),n?zn(t,e.g.clone()):n=!!e.mc,n&&(t.mc=e.mc),t},i.clone=function(){return new Gn(this)};var $n=/[#\/\?@]/g,Qn=/[#\?:]/g,Zn=/[#\?]/g,ei=/[#\?@]/g,ti=/#/g;function ni(e){this.g=e||null}function ii(e){if(!e.Pa&&(e.Pa={},e.dd=0,e.g))for(var t=e.g.split("&"),n=0;n<t.length;n++){var i=t[n].indexOf("="),r=null;if(0<=i){var a=t[n].substring(0,i);r=t[n].substring(i+1)}else a=t[n];a=decodeURIComponent(a.replace(/\+/g," ")),r=r||"",e.add(a,decodeURIComponent(r.replace(/\+/g," ")))}}function ri(e){return ii(e),e.dd}function ai(){}function oi(e){return e=mt(ge(e)),btoa(e)}function si(e,t){return t=null==t||t,e=oi(e).replace(/\+/g,"-").replace(/\//g,"_"),t?e:e.replace(/[=]*$/,"")}function ui(t){t=e.atob(t.replace(/-/g,"+").replace(/_/g,"/"));for(var n=new Uint8Array(t.length),i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}function li(t){for(var n=t.length/2,i=new Uint8Array(n),r=0;r<n;r++)i[r]=e.parseInt(t.substr(2*r,2),16);return i}function ci(e){var t=ge(e);e="";for(var n=(t=l(t)).next();!n.done;n=t.next())1==(n=(n=n.value).toString(16)).length&&(n="0"+n),e+=n;return e}function di(){for(var e=L.apply(0,arguments),t=0,n=0;n<e.length;++n)t+=e[n].byteLength;t=new Uint8Array(t);for(var i=n=0;i<e.length;++i){var r=e[i];ArrayBuffer.isView(r)&&1===r.BYTES_PER_ELEMENT?t.set(r,n):t.set(ge(r),n),n+=r.byteLength}return t}function hi(e,t,n){if(n=void 0===n?"":n,0==t.length)return e;if(1==e.length&&1==t.length){var i=new Gn(e[0]);return t=new Gn(t[0]),t=i.resolve(t),n&&zn(t,n),[t.toString()]}t=t.map((function(e){return new Gn(e)})),i=[];for(var r=(e=l(e)).next();!r.done;r=e.next()){r=new Gn(r.value);for(var a=l(t),o=a.next();!o.done;o=a.next())o=r.resolve(o.value),n&&zn(o,n),i.push(o.toString())}return i}function fi(e,t,n,i){return e={keySystem:e,encryptionScheme:t,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:n||[],keyIds:new Set},i&&(e.keySystemUris=new Set([i])),e}function pi(t,n){n=void 0===n?"cenc":n;var i=[],r=[],a=[];t.forEach((function(e,t){var n=t;22!=n.length&&(n=si(li(t),!1));var o=e;22!=o.length&&(o=si(li(e),!1)),e={kty:"oct",kid:n,k:o},i.push(e),r.push(e.kid),a.push(t)})),t=JSON.stringify({keys:i});var o=JSON.stringify({kids:r});return o=[{initData:ge(pt(o)),initDataType:"keyids"}],{keySystem:"org.w3.clearkey",encryptionScheme:n,licenseServerUri:"data:application/json;base64,"+e.btoa(t),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:o,keyIds:new Set(a)}}function gi(e,t){if(1==t.length)return t[0];if(null!=(e=mi(e,t)))return e;throw new De(2,4,4025,t)}function mi(e,t){for(var n=l(Ti[e]),i=n.next();!i.done;i=n.next()){i=i.value;for(var r=l(t),a=r.next();!a.done;a=r.next())if(a=a.value,i.test(a.trim()))return a.trim()}return e==yi?"":null}function vi(e,t){for(var n=[],i=(e=l(Ti[e])).next();!i.done;i=e.next()){i=i.value;for(var r=l(t),a=r.next();!a.done;a=r.next())a=a.value,i.test(a.trim())&&n.push(a.trim())}return n}(i=ni.prototype).Pa=null,i.dd=null,i.add=function(e,t){ii(this),this.g=null;var n=this.Pa.hasOwnProperty(e)?this.Pa[e]:null;return n||(this.Pa[e]=n=[]),n.push(t),this.dd++,this},i.set=function(e,t){return ii(this),this.g=null,this.Pa.hasOwnProperty(e)?this.Pa[e]=[t]:this.add(e,t),this},i.get=function(e){return ii(this),this.Pa[e]||[]},i.toString=function(){if(this.g)return this.g;if(!this.Pa)return"";var e,t=[];for(e in this.Pa)for(var n=encodeURIComponent(e),i=this.Pa[e],r=0;r<i.length;r++){var a=n;""!==i[r]&&(a+="="+encodeURIComponent(i[r])),t.push(a)}return this.g=t.join("&")},i.clone=function(){var e=new ni;if(e.g=this.g,this.Pa){var t,n={};for(t in this.Pa)n[t]=this.Pa[t].concat();e.Pa=n,e.dd=this.dd}return e},F("shaka.util.Uint8ArrayUtils",ai),ai.concat=di,ai.toHex=ci,ai.fromHex=li,ai.fromBase64=ui,ai.toBase64=si,ai.toStandardBase64=oi;var yi="text",bi={la:"video",V:"audio",wa:yi,He:"image",kj:"application"},wi=1/15,Ti={audio:[/^vorbis$/,/^Opus$/,/^opus$/,/^fLaC$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4/,/^dts[cex]$/,/^iamf/,/^mhm[12]/],video:[/^avc/,/^hev/,/^hvc/,/^vvc/,/^vvi/,/^vp0?[89]/,/^av01/,/^dvh/,/^dva/,/^dav/],text:[/^vtt$/,/^wvtt/,/^stpp/]};function Si(){}function xi(e,t){var n=e;return t&&!ji.includes(e)&&(n+='; codecs="'+t+'"'),n}function Ai(e,t){return t&&(e+='; codecs="'+t+'"'),e}function Ei(e,t,n){var i=xi(e,t);return On(t=Ai(e,t))?(e=On(t))?(n=(e=e()).convertCodecs(n,t),e.destroy()):n=t:n="video/mp2t"!=e&&"audio"==n?i.replace("video","audio"):i,n}function ki(e,t,n){var i=[t];return Ni.forEach((function(t,r){var a=e[r];"codecs"==r?ji.includes(e.mimeType)||i.push('codecs="'+n+'"'):a&&i.push(t+'="'+a+'"')})),"PQ"==e.hdr&&i.push('eotf="smpte2084"'),i.join(";")}function Ii(e){return e.split(";")[0].split("/")[1]}function Mi(e){var t=Li(e);switch(e=t[0],t=t[1].toLowerCase(),!0){case"mp4a"===e&&"69"===t:case"mp4a"===e&&"6b"===t:case"mp4a"===e&&"40.34"===t:return"mp3";case"mp4a"===e&&"66"===t:case"mp4a"===e&&"67"===t:case"mp4a"===e&&"68"===t:case"mp4a"===e&&"40.2"===t:case"mp4a"===e&&"40.02"===t:case"mp4a"===e&&"40.5"===t:case"mp4a"===e&&"40.05"===t:case"mp4a"===e&&"40.29"===t:case"mp4a"===e&&"40.42"===t:return"aac";case"mp4a"===e&&"a5"===t:return"ac-3";case"mp4a"===e&&"a6"===t:return"ec-3";case"mp4a"===e&&"b2"===t:return"dtsx";case"mp4a"===e&&"a9"===t:return"dtsc";case"vp09"===e:return"vp9";case"avc1"===e:case"avc3"===e:return"avc";case"hvc1"===e:case"hev1"===e:return"hevc";case"vvc1"===e:case"vvi1"===e:return"vvc";case"dvh1"===e:case"dvhe"===e:return t&&t.startsWith("05")?"dovi-p5":"dovi-hevc";case"dvav"===e:case"dva1"===e:return"dovi-avc";case"dav1"===e:return"dovi-av1";case"dvc1"===e:case"dvi1"===e:return"dovi-vvc"}return e}function Ci(e){for(var t=[],n=(e=l(e.split(","))).next();!n.done;n=e.next())n=Li(n.value),t.push(n[0]);return t.sort().join(",")}function Di(e){return e.split(";")[0]}function Ri(e){return(e=e.split(/ *; */)).shift(),(e=e.find((function(e){return e.startsWith("codecs=")})))?e.split("=")[1].replace(/^"|"$/g,""):""}function Pi(e){return"application/x-mpegurl"===e||"application/vnd.apple.mpegurl"===e}function Li(e){var t=(e=e.split("."))[0];return e.shift(),[t,e.join(".")]}F("shaka.util.MimeUtils",Si),Si.getFullTypeWithAllCodecs=Ai,Si.getFullType=xi;var Ni=(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels"),ji=["audio/aac","audio/ac3","audio/ec3","audio/mpeg"];function Oi(e){this.i=null,this.j=e,this.B=!1,this.l=this.s=0,this.m=1/0,this.h=this.g=null,this.C="",this.A=function(){},this.o=new Map}function Ui(e){return!!Fi[e]||("application/cea-608"==e||"application/cea-708"==e)&&!!Se}function _i(e,t,n){if(e.C=t,t=e.o.get(t))for(var i=l(t.keys()),r=i.next();!r.done;r=i.next())(r=t.get(r.value).filter((function(e){return e.endTime<=n})))&&e.j.append(r)}function Bi(e,t,n){t.startTime+=n,t.endTime+=n;for(var i=(t=l(t.nestedCues)).next();!i.done;i=t.next())Bi(e,i.value,n)}Oi.prototype.destroy=function(){return this.j=this.i=null,this.o.clear(),Promise.resolve()},Oi.prototype.remove=function(e,t){var n=this;return P((function(i){if(1==i.g)return w(i,Promise.resolve(),2);!n.j||!n.j.remove(e,t)||null==n.g||t<=n.g||e>=n.h||(e<=n.g&&t>=n.h?n.g=n.h=null:e<=n.g&&t<n.h?n.g=t:e>n.g&&t>=n.h&&(n.h=e)),T(i)}))},F("shaka.text.TextEngine",Oi),Oi.prototype.destroy=Oi.prototype.destroy,Oi.findParser=function(e){return Fi[e]},Oi.unregisterParser=function(e){delete Fi[e]},Oi.registerParser=function(e,t){Fi[e]=t};var Fi={};function Vi(e,t){return e.concat(t)}function Hi(){}function Gi(e){return null!=e}function Ki(e,t){return Promise.race([t,new Promise((function(t,n){new Be(n).$(e)}))])}function Xi(){}function qi(e,t){return e=Yi(e),t=Yi(t),e.split("-")[0]==t.split("-")[0]}function zi(e,t){return e=Yi(e),t=Yi(t),e=e.split("-"),t=t.split("-"),e[0]==t[0]&&1==e.length&&2==t.length}function Wi(e,t){return e=Yi(e),t=Yi(t),e=e.split("-"),t=t.split("-"),2==e.length&&2==t.length&&e[0]==t[0]}function Yi(e){var t=(e=l(e.split("-x-"))).next().value;t=void 0===t?"":t,e=void 0===(e=e.next().value)?"":e;var n=l(t.split("-"));return t=void 0===(t=n.next().value)?"":t,n=void 0===(n=n.next().value)?"":n,e=e?"x-"+e:"",t=t.toLowerCase(),t=er.get(t)||t,((n=n.toUpperCase())?t+"-"+n:t)+(e?"-"+e:"")}function Ji(e,t){return e=Yi(e),(t=Yi(t))==e?4:zi(t,e)?3:Wi(t,e)?2:zi(e,t)?1:0}function $i(e){var t=e.indexOf("-");return e=(e=0<=t?e.substring(0,t):e).toLowerCase(),er.get(e)||e}function Qi(e){return e.language?Yi(e.language):e.audio&&e.audio.language?Yi(e.audio.language):e.video&&e.video.language?Yi(e.video.language):"und"}function Zi(e,t){e=Yi(e);for(var n=new Set,i=(t=l(t)).next();!i.done;i=t.next())n.add(Yi(i.value));for(i=(t=l(n)).next();!i.done;i=t.next())if((i=i.value)==e)return i;for(i=(t=l(n)).next();!i.done;i=t.next())if(zi(i=i.value,e))return i;for(i=(t=l(n)).next();!i.done;i=t.next())if(Wi(i=i.value,e))return i;for(t=(n=l(n)).next();!t.done;t=n.next())if(zi(e,t=t.value))return t;return null}F("shaka.util.LanguageUtils",Xi),Xi.findClosestLocale=Zi,Xi.getLocaleForVariant=Qi,Xi.getLocaleForText=function(e){return Yi(e.language||"und")},Xi.getBase=$i,Xi.relatedness=Ji,Xi.areSiblings=function(e,t){var n=$i(e),i=$i(t);return e!=n&&t!=i&&n==i},Xi.normalize=Yi,Xi.isSiblingOf=Wi,Xi.isParentOf=zi,Xi.areLanguageCompatible=qi,Xi.areLocaleCompatible=function(e,t){return(e=Yi(e))==Yi(t)};var er=new Map([["aar","aa"],["abk","ab"],["afr","af"],["aka","ak"],["alb","sq"],["amh","am"],["ara","ar"],["arg","an"],["arm","hy"],["asm","as"],["ava","av"],["ave","ae"],["aym","ay"],["aze","az"],["bak","ba"],["bam","bm"],["baq","eu"],["bel","be"],["ben","bn"],["bih","bh"],["bis","bi"],["bod","bo"],["bos","bs"],["bre","br"],["bul","bg"],["bur","my"],["cat","ca"],["ces","cs"],["cha","ch"],["che","ce"],["chi","zh"],["chu","cu"],["chv","cv"],["cor","kw"],["cos","co"],["cre","cr"],["cym","cy"],["cze","cs"],["dan","da"],["deu","de"],["div","dv"],["dut","nl"],["dzo","dz"],["ell","el"],["eng","en"],["epo","eo"],["est","et"],["eus","eu"],["ewe","ee"],["fao","fo"],["fas","fa"],["fij","fj"],["fin","fi"],["fra","fr"],["fre","fr"],["fry","fy"],["ful","ff"],["geo","ka"],["ger","de"],["gla","gd"],["gle","ga"],["glg","gl"],["glv","gv"],["gre","el"],["grn","gn"],["guj","gu"],["hat","ht"],["hau","ha"],["heb","he"],["her","hz"],["hin","hi"],["hmo","ho"],["hrv","hr"],["hun","hu"],["hye","hy"],["ibo","ig"],["ice","is"],["ido","io"],["iii","ii"],["iku","iu"],["ile","ie"],["ina","ia"],["ind","id"],["ipk","ik"],["isl","is"],["ita","it"],["jav","jv"],["jpn","ja"],["kal","kl"],["kan","kn"],["kas","ks"],["kat","ka"],["kau","kr"],["kaz","kk"],["khm","km"],["kik","ki"],["kin","rw"],["kir","ky"],["kom","kv"],["kon","kg"],["kor","ko"],["kua","kj"],["kur","ku"],["lao","lo"],["lat","la"],["lav","lv"],["lim","li"],["lin","ln"],["lit","lt"],["ltz","lb"],["lub","lu"],["lug","lg"],["mac","mk"],["mah","mh"],["mal","ml"],["mao","mi"],["mar","mr"],["may","ms"],["mkd","mk"],["mlg","mg"],["mlt","mt"],["mon","mn"],["mri","mi"],["msa","ms"],["mya","my"],["nau","na"],["nav","nv"],["nbl","nr"],["nde","nd"],["ndo","ng"],["nep","ne"],["nld","nl"],["nno","nn"],["nob","nb"],["nor","no"],["nya","ny"],["oci","oc"],["oji","oj"],["ori","or"],["orm","om"],["oss","os"],["pan","pa"],["per","fa"],["pli","pi"],["pol","pl"],["por","pt"],["pus","ps"],["que","qu"],["roh","rm"],["ron","ro"],["rum","ro"],["run","rn"],["rus","ru"],["sag","sg"],["san","sa"],["sin","si"],["slk","sk"],["slo","sk"],["slv","sl"],["sme","se"],["smo","sm"],["sna","sn"],["snd","sd"],["som","so"],["sot","st"],["spa","es"],["sqi","sq"],["srd","sc"],["srp","sr"],["ssw","ss"],["sun","su"],["swa","sw"],["swe","sv"],["tah","ty"],["tam","ta"],["tat","tt"],["tel","te"],["tgk","tg"],["tgl","tl"],["tha","th"],["tib","bo"],["tir","ti"],["ton","to"],["tsn","tn"],["tso","ts"],["tuk","tk"],["tur","tr"],["twi","tw"],["uig","ug"],["ukr","uk"],["urd","ur"],["uzb","uz"],["ven","ve"],["vie","vi"],["vol","vo"],["wel","cy"],["wln","wa"],["wol","wo"],["xho","xh"],["yid","yi"],["yor","yo"],["zha","za"],["zho","zh"],["zul","zu"]]);function tr(){}function nr(e,t,n,i,r){if(r.length){for(var a=e.textStreams,o=(r=l(r)).next(),s={};!o.done;s={$f:void 0},o=r.next())if(s.$f=o.value,(o=a.filter(function(e){return function(t){return!(!t.codecs.startsWith(e.$f)&&!t.mimeType.startsWith(e.$f))}}(s))).length){a=o;break}e.textStreams=a}if(a=e.variants,(t.length||n.length)&&(a=function(e,t,n){for(var i=(t=l(t)).next(),r={};!i.done;r={rh:void 0},i=t.next())if(r.rh=i.value,i=e.filter(function(e){return function(t){return t.video&&t.video.codecs.startsWith(e.rh)}}(r)),i.length){e=i;break}for(t=(n=l(n)).next(),i={};!t.done;i={kg:void 0},t=n.next())if(i.kg=t.value,t=e.filter(function(e){return function(t){return t.audio&&t.audio.codecs.startsWith(e.kg)}}(i)),t.length){e=t;break}return e}(a,t,n)),i.length){for(t=new Q,a=(n=l(a)).next();!a.done;a=n.next())a=a.value,t.push(String(a.video.width||0),a);var u=[];t.forEach((function(e,t){e=0;for(var n=[],r=(t=l(t)).next(),a={};!r.done;a={Be:void 0},r=t.next())a.Be=r.value,(r=i.filter(function(e){return function(t){return e.Be.decodingInfos[0][t]}}(a)).length)>e?(e=r,n=[a.Be]):r==e&&n.push(a.Be);u.push.apply(u,c(n))})),a=u}for(n=new Set,t=new Set,r=(a=l(a)).next();!r.done;r=a.next())(r=r.value).audio&&n.add(r.audio),r.video&&t.add(r.video);a=Array.from(n).sort((function(e,t){return e.bandwidth-t.bandwidth}));var d=[];for(n=new Map,r=(a=l(a)).next();!r.done;r=a.next()){if(o=(r=r.value).language+(r.channelsCount||0)+(r.audioSamplingRate||0)+r.roles.join(",")+r.label+r.groupId+r.fastSwitching,(s=n.get(o)||[]).length){var h=s[s.length-1],f=Mi(h.codecs),p=Mi(r.codecs);f!=p||r.bandwidth&&h.bandwidth&&!(r.bandwidth>h.bandwidth)||(s.push(r),d.push(r.id))}else s.push(r),d.push(r.id);n.set(o,s)}var g={vp8:1,avc:1,"dovi-avc":.95,vp9:.9,vp09:.9,hevc:.85,"dovi-hevc":.8,"dovi-p5":.75,av01:.7,"dovi-av1":.65,vvc:.6};a=Array.from(t).sort((function(e,t){if(!e.bandwidth||!t.bandwidth||e.bandwidth==t.bandwidth){if(e.codecs&&t.codecs&&e.codecs!=t.codecs&&e.width==t.width){var n=Mi(e.codecs),i=Mi(t.codecs);if(n!=i)return(g[n]||1)-(g[i]||1)}return e.width-t.width}return e.bandwidth-t.bandwidth})),t=ie();var m=[];for(n=new Map,r=(a=l(a)).next();!r.done;r=a.next()){if(r=r.value,o=Math.round(r.frameRate||0)+(r.hdr||"")+r.fastSwitching,(s=n.get(o)||[]).length){if(h=s[s.length-1],!t&&(f=Mi(h.codecs))!==(p=Mi(r.codecs)))continue;r.width>h.width||r.height>h.height?(s.push(r),m.push(r.id)):r.width==h.width&&r.height==h.height&&((f=Mi(h.codecs))!=(p=Mi(r.codecs))||r.bandwidth&&h.bandwidth&&!(r.bandwidth>h.bandwidth)||(s.push(r),m.push(r.id)))}else s.push(r),m.push(r.id);n.set(o,s)}e.variants=e.variants.filter((function(e){var t=e.audio;return e=e.video,!(t&&!d.includes(t.id)||e&&!m.includes(e.id))}))}function ir(e,t,n){function i(e,t,n){return e>=t&&e<=n}var r=e.video;if(r&&r.width&&r.height){var a=r.width,o=r.height;if(o>a&&(a=(o=l([o,a])).next().value,o=o.next().value),!i(a,t.minWidth,Math.min(t.maxWidth,n.width))||!i(o,t.minHeight,Math.min(t.maxHeight,n.height))||!i(r.width*r.height,t.minPixels,t.maxPixels))return!1}return!(e&&e.video&&e.video.frameRate&&!i(e.video.frameRate,t.minFrameRate,t.maxFrameRate)||e&&e.audio&&e.audio.channelsCount&&!i(e.audio.channelsCount,t.minChannelsCount,t.maxChannelsCount)||!i(e.bandwidth,t.minBandwidth,t.maxBandwidth))}function rr(e,t,n,i,r){var a,o;return P((function(s){if(1==s.g)return Ge()&&function(e){for(var t={dvav:"avc3",dva1:"avc1",dvhe:"hev1",dvh1:"hvc1",dvc1:"vvc1",dvi1:"vvi1"},n=new Set,i=(e=l(e)).next();!i.done;i=e.next())(i=i.value).video&&n.add(i.video);for(e=(n=l(n)).next();!e.done;e=n.next()){e=e.value;for(var r=(i=l(Object.keys(t))).next();!r.done;r=i.next())if(r=r.value,e.codecs.includes(r)){e.codecs=e.codecs.replace(r,t[r]);break}}}(t.variants),w(s,sr(t.variants,n,!1,i),2);a=null,e&&(o=e.g)&&(a=o.keySystem),t.variants=t.variants.filter((function(e){var t=function(e,t,n){if(!e.decodingInfos.some((function(e){return!(!e.supported||t&&(e=e.keySystemAccess)&&(n[e.keySystem]||e.keySystem)!=t)})))return!1;var i=Ge(),r=rt("Firefox")&&nt(),a=e.video,o=a&&a.width||0,s=a&&a.height||0;if(i&&a&&(1920<o||1080<s)&&(a.codecs.includes("avc1.")||a.codecs.includes("avc3.")))return!1;if(a){if(i=cr(a.codecs),a.codecs.includes(",")){if(i=cr(i=gi("video",o=a.codecs.split(","))),o=lr(o=gi("audio",o),a.mimeType),!ne(s=Ei(a.mimeType,o,"audio")))return!1;i=[i,o].join()}if(a.codecs!=i){if(!ne(o=Ei(a.mimeType,i,"video")))return!1;a.codecs=i}}if(e=e.audio,r&&e&&e.encrypted&&e.codecs.toLowerCase().includes("opus"))return!1;if(e&&(r=lr(e.codecs,e.mimeType),e.codecs!=r)){if(!ne(a=Ei(e.mimeType,r,"audio")))return!1;e.codecs=r}return!0}(e,a,r);if(!t){var n=[];e.audio&&n.push(xr(e.audio)),e.video&&n.push(xr(e.video))}return t})),T(s)}))}function ar(e,t){var n,i,r,a,o,s,u;return P((function(c){if(1==c.g){for(n=function(e,t){if(e){var n=It(e);return n.supported=e.supported&&t.supported,n.powerEfficient=e.powerEfficient&&t.powerEfficient,n.smooth=e.smooth&&t.smooth,t.keySystemAccess&&!n.keySystemAccess&&(n.keySystemAccess=t.keySystemAccess),n}return t},i=null,r=[],a=l(t),o=a.next(),s={};!o.done;s={cache:void 0,Gd:void 0},o=a.next())u=o.value,s.Gd=Mt(u),s.cache=Ar,s.cache[s.Gd]?i=n(i,s.cache[s.Gd]):r.push(or(u).then(function(e){return function(t){for(var r=null,a=(t=l(t||[])).next();!a.done;a=t.next())r=n(r,a.value);r&&(e.cache[e.Gd]=r,i=n(i,r))}}(s)));return w(c,Promise.all(r),2)}i&&e.decodingInfos.push(i),T(c)}))}function or(e){var t=[""];e.video&&(t=Ri(e.video.contentType).split(","));var n=[""];e.audio&&(n=Ri(e.audio.contentType).split(","));for(var i=[],r=(t=l(t)).next();!r.done;r=t.next()){r=r.value;for(var a=l(n),o=a.next(),s={};!o.done;s={Fc:void 0},o=a.next())o=o.value,s.Fc=kt(e),e.video&&(s.Fc.video.contentType=xi(Di(s.Fc.video.contentType),r)),e.audio&&(s.Fc.audio.contentType=xi(Di(s.Fc.audio.contentType),o)),i.push(new Promise(function(e){return function(t,n){Ki(1,navigator.mediaCapabilities.decodingInfo(e.Fc)).then((function(e){t(e)})).catch(n)}}(s)))}return Promise.all(i).catch((function(){return JSON.stringify(e),null}))}function sr(e,t,n,i){var r,a,o,s,u,c,d,h,f,p,g,m,v,y,b,T,S,x;return P((function(A){switch(A.g){case 1:if(e.some((function(e){return e.decodingInfos.length})))return A.return();r=l(i),a=r.next(),o={};case 2:if(a.done){A.u(4);break}o.Tg=a.value,s=!1,u=l(e),c=u.next();case 5:if(c.done){A.u(7);break}d=c.value,h=ur(d,t,n).filter((E=o,function(e){return((e=e[0]).keySystemConfiguration&&e.keySystemConfiguration.keySystem)===E.Tg})),f=l(h),p=f.next();case 8:if(p.done){A.u(10);break}return g=p.value,w(A,ar(d,g),9);case 9:p=f.next(),A.u(8);break;case 10:d.decodingInfos.length&&(s=!0),c=u.next(),A.u(5);break;case 7:if(s)return A.return();o={Tg:void 0},a=r.next(),A.u(2);break;case 4:m=l(e),v=m.next();case 12:if(v.done){A.u(0);break}y=v.value,b=ur(y,t,n).filter((function(e){return!(e=(e=e[0]).keySystemConfiguration&&e.keySystemConfiguration.keySystem)||!i.includes(e)})),T=l(b),S=T.next();case 15:if(S.done){v=m.next(),A.u(12);break}return x=S.value,w(A,ar(y,x),16);case 16:S=T.next(),A.u(15)}var E}))}function ur(e,t,n){var i=e.audio,r=e.video,a=[],o=[];if(r)for(var s=l(r.fullMimeTypes),u=s.next();!u.done;u=s.next()){var c=Ri(u=u.value);if(c.includes(",")&&!i){var d=c.split(","),h=Di(u);c=gi("video",d),h=Ei(h,d=lr(d=gi("audio",d),h),"audio"),o.push({contentType:h,channels:2,bitrate:e.bandwidth||1,samplerate:1,spatialRendering:!1})}if(c=cr(c),u={contentType:Ei(Di(u),c,"video"),width:r.width||64,height:r.height||64,bitrate:r.bandwidth||e.bandwidth||1,framerate:r.frameRate||1},r.hdr)switch(r.hdr){case"SDR":u.transferFunction="srgb";break;case"PQ":u.transferFunction="pq";break;case"HLG":u.transferFunction="hlg"}r.colorGamut&&(u.colorGamut=r.colorGamut),a.push(u)}if(i)for(u=(s=l(i.fullMimeTypes)).next();!u.done;u=s.next())u=Ei(u=Di(c=u.value),c=lr(Ri(c),u),"audio"),o.push({contentType:u,channels:i.channelsCount||2,bitrate:i.bandwidth||e.bandwidth||1,samplerate:i.audioSamplingRate||1,spatialRendering:i.spatialAudio});for(s=[],0==a.length&&a.push(null),0==o.length&&o.push(null),u=(a=l(a)).next();!u.done;u=a.next())for(u=u.value,h=(c=l(o)).next();!h.done;h=c.next())h=h.value,d={type:n?"file":"media-source"},u&&(d.video=u),h&&(d.audio=h),s.push(d);if(!(o=(e.video?e.video.drmInfos:[]).concat(e.audio?e.audio.drmInfos:[])).length)return[s];for(e=[],n=new Map,a=(o=l(o)).next();!a.done;a=o.next())a=a.value,n.get(a.keySystem)||n.set(a.keySystem,[]),n.get(a.keySystem).push(a);for(o=t?"required":"optional",t=t?["persistent-license"]:["temporary"],u=(a=l(n.keys())).next();!u.done;u=a.next()){for(u=u.value,c=[],d=(h=l(s)).next();!d.done;d=h.next()){d=Object.assign({},d.value);for(var f=n.get(u),p={keySystem:u,initDataType:"cenc",persistentState:o,distinctiveIdentifier:"optional",sessionTypes:t},g=(f=l(f)).next();!g.done;g=f.next()){if((g=g.value).initData&&g.initData.length){for(var m=new Set,v=l(g.initData),y=v.next();!y.done;y=v.next())m.add(y.value.initDataType);p.initDataType=g.initData[0].initDataType}g.distinctiveIdentifierRequired&&(p.distinctiveIdentifier="required"),g.persistentStateRequired&&(p.persistentState="required"),g.sessionType&&(p.sessionTypes=[g.sessionType]),i&&(p.audio?(g.encryptionScheme&&(p.audio.encryptionScheme=p.audio.encryptionScheme||g.encryptionScheme),p.audio.robustness=p.audio.robustness||g.audioRobustness):(p.audio={robustness:g.audioRobustness},g.encryptionScheme&&(p.audio.encryptionScheme=g.encryptionScheme)),""==p.audio.robustness&&delete p.audio.robustness),r&&(p.video?(g.encryptionScheme&&(p.video.encryptionScheme=p.video.encryptionScheme||g.encryptionScheme),p.video.robustness=p.video.robustness||g.videoRobustness):(p.video={robustness:g.videoRobustness},g.encryptionScheme&&(p.video.encryptionScheme=g.encryptionScheme)),""==p.video.robustness&&delete p.video.robustness)}d.keySystemConfiguration=p,c.push(d)}e.push(c)}return e}function lr(e,t){return"flac"==e.toLowerCase()?et()?"fLaC":"flac":"opus"===e.toLowerCase()?et()&&"mp4"==Ii(t)?"Opus":"opus":e}function cr(e){if(e.includes("avc1")){var t=e.split(".");if(3==t.length)return e=t.shift()+".",(e+=parseInt(t.shift(),10).toString(16))+("000"+parseInt(t.shift(),10).toString(16)).slice(-4)}else if("vp9"==e)return"vp09.00.41.08";return e}function dr(e){var t=e.audio,n=e.video,i=t?t.mimeType:null,r=n?n.mimeType:null,a=t?t.codecs:null,o=n?n.codecs:null,s=[];o&&s.push(o),a&&s.push(a);var u=[];n&&u.push(n.mimeType),t&&u.push(t.mimeType),u=u[0]||null;var c=[];t&&c.push(t.kind),n&&c.push(n.kind),c=c[0]||null;var d=new Set;if(t)for(var h=l(t.roles),f=h.next();!f.done;f=h.next())d.add(f.value);if(n)for(f=(h=l(n.roles)).next();!f.done;f=h.next())d.add(f.value);return e={id:e.id,active:!1,type:"variant",bandwidth:e.bandwidth,language:e.language,label:null,kind:c,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:u,audioMimeType:i,videoMimeType:r,codecs:s.join(", "),audioCodec:a,videoCodec:o,primary:e.primary,roles:Array.from(d),audioRoles:null,forced:!1,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:null},n&&(e.videoId=n.id,e.originalVideoId=n.originalId,e.width=n.width||null,e.height=n.height||null,e.frameRate=n.frameRate||null,e.pixelAspectRatio=n.pixelAspectRatio||null,e.videoBandwidth=n.bandwidth||null,e.hdr=n.hdr||null,e.colorGamut=n.colorGamut||null,e.videoLayout=n.videoLayout||null,o.includes(",")&&(e.channelsCount=n.channelsCount,e.audioSamplingRate=n.audioSamplingRate,e.spatialAudio=n.spatialAudio,e.originalLanguage=n.originalLanguage)),t&&(e.audioId=t.id,e.originalAudioId=t.originalId,e.channelsCount=t.channelsCount,e.audioSamplingRate=t.audioSamplingRate,e.audioBandwidth=t.bandwidth||null,e.spatialAudio=t.spatialAudio,e.label=t.label,e.audioRoles=t.roles,e.accessibilityPurpose=t.accessibilityPurpose,e.originalLanguage=t.originalLanguage),e}function hr(e){return{id:e.id,active:!1,type:yi,bandwidth:0,language:e.language,label:e.label,kind:e.kind||null,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:e.mimeType,audioMimeType:null,videoMimeType:null,codecs:e.codecs||null,audioCodec:null,videoCodec:null,primary:e.primary,roles:e.roles,audioRoles:null,forced:e.forced,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:e.originalId,originalImageId:null,accessibilityPurpose:e.accessibilityPurpose,originalLanguage:e.originalLanguage}}function fr(e){var t=e.width||null,n=e.height||null,i=null;e.segmentIndex&&(i=eu(e.segmentIndex));var r=e.tilesLayout;return i&&(r=i.tilesLayout||r),r&&null!=t&&(t/=Number(r.split("x")[0])),r&&null!=n&&(n/=Number(r.split("x")[1])),{id:e.id,active:!1,type:"image",bandwidth:e.bandwidth||0,language:"",label:null,kind:null,width:t,height:n,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:e.mimeType,audioMimeType:null,videoMimeType:null,codecs:e.codecs||null,audioCodec:null,videoCodec:null,primary:!1,roles:[],audioRoles:null,forced:!1,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:r||null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:e.originalId,accessibilityPurpose:null,originalLanguage:null}}function pr(e){return e.__shaka_id||(e.__shaka_id=Er++),e.__shaka_id}function gr(e){var t=vr(e);return t.active="disabled"!=e.mode,t.type="text",t.originalTextId=e.id,"captions"==e.kind&&(t.mimeType="unknown"),"subtitles"==e.kind&&(t.mimeType="text/vtt"),e.kind&&(t.roles=[e.kind]),"forced"==e.kind&&(t.forced=!0),t}function mr(e){var t=vr(e);return t.active=e.enabled,t.type="variant",t.originalAudioId=e.id,"main"==e.kind&&(t.primary=!0),e.kind&&(t.roles=[e.kind],t.audioRoles=[e.kind],t.label=e.label),t}function vr(e){var t=e.language;return{id:pr(e),active:!1,type:"",bandwidth:0,language:Yi(t||"und"),label:e.label,kind:e.kind,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:null,audioMimeType:null,videoMimeType:null,codecs:null,audioCodec:null,videoCodec:null,primary:!1,roles:[],forced:!1,audioRoles:null,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:t}}function yr(e){return e.allowedByApplication&&e.allowedByKeySystem&&0==e.disabledUntilTime}function br(e){return e.filter((function(e){return yr(e)}))}function wr(e,t,n,i){var r=e,a=e.filter((function(e){return e.primary}));a.length&&(r=a);var o=r.length?r[0].language:"";if(r=r.filter((function(e){return e.language==o})),t){var s=Zi(Yi(t),e.map((function(e){return e.language})));s&&(r=e.filter((function(e){return Yi(e.language)==s})))}if(r=r.filter((function(e){return e.forced==i})),n){if((e=Tr(r,n)).length)return e}else if(e=r.filter((function(e){return 0==e.roles.length})),e.length)return e;return e=r.map((function(e){return e.roles})).reduce(Vi,[]),e.length?Tr(r,e[0]):r}function Tr(e,t){return e.filter((function(e){return e.roles.includes(t)}))}function Sr(e,t){t.length&&(t=t.filter((function(t){return Mi(e.codecs)==Mi(t.codecs)})).sort((function(e,t){return e.bandwidth&&t.bandwidth&&e.bandwidth!=t.bandwidth?e.bandwidth-t.bandwidth:(e.width||0)-(t.width||0)})),e.trickModeVideo=t[0],1<t.length&&(t=t.find((function(t){return e.width==t.width&&e.height==t.height}))))&&(e.trickModeVideo=t)}function xr(e){return"audio"==e.type?"type=audio codecs="+e.codecs+" bandwidth="+e.bandwidth+" channelsCount="+e.channelsCount+" audioSamplingRate="+e.audioSamplingRate:"video"==e.type?"type=video codecs="+e.codecs+" bandwidth="+e.bandwidth+" frameRate="+e.frameRate+" width="+e.width+" height="+e.height:"unexpected stream type"}F("shaka.util.StreamUtils",tr),tr.meetsRestrictions=ir;var Ar={},Er=0,kr=(new Map).set("image/svg+xml",!0).set("image/png",!0).set("image/jpeg",!0).set("image/jpg",!0),Ir=(new Map).set("image/webp","data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA").set("image/avif","data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=");function Mr(){var e=this;this.A=null,this.j=!1,this.i=new X,this.F=new Z,navigator.connection&&navigator.connection.addEventListener&&this.F.D(navigator.connection,"change",(function(){if(e.j&&e.g.useNetworkInformation){e.i=new X,e.g&&e.i.configure(e.g.advanced);var t=e.chooseVariant();t&&navigator.onLine&&e.A(t,e.g.clearBufferSwitch,e.g.safeMarginSwitch)}})),this.s=[],this.B=1,this.G=!1,this.h=this.o=this.g=this.l=null,this.C=new Be((function(){if(e.j&&e.g.restrictToElementSize){var t=e.chooseVariant();t&&e.A(t,e.g.clearBufferSwitch,e.g.safeMarginSwitch)}})),this.m=null}function Cr(e){if(!e.G){var t=e.i;if(!(t.g>=t.i))return;e.G=!0,e.l-=1e3*(e.g.switchInterval-e.g.minTimeToSwitch)}Date.now()-e.l<1e3*e.g.switchInterval||(t=e.chooseVariant(),e.getBandwidthEstimate(),t&&e.A(t,e.g.clearBufferSwitch,e.g.safeMarginSwitch))}function Dr(e,t,n,i,r){if(e.m){var a=e.m.Cg();a&&(n=n.filter((function(e){return!e.bandwidth||!a||e.bandwidth<=a})))}return t&&(n=n.filter((function(e){return ir(e,t,{width:r,height:i})}))),n.sort((function(e,t){return e.bandwidth-t.bandwidth}))}(i=Mr.prototype).stop=function(){this.A=null,this.j=!1,this.s=[],this.B=1,this.o=this.l=null,this.h&&(this.h.disconnect(),this.h=null),this.C.stop(),this.m=null},i.release=function(){this.F.release(),this.C=null},i.init=function(e){this.A=e},i.chooseVariant=function(){var t=1/0,n=1/0;if(this.g.restrictToScreenSize){var i=this.g.ignoreDevicePixelRatio?1:e.devicePixelRatio;t=e.screen.height*i,n=e.screen.width*i}this.h&&this.g.restrictToElementSize&&(i=this.g.ignoreDevicePixelRatio?1:e.devicePixelRatio,t=Math.min(t,this.o.clientHeight*i),n=Math.min(n,this.o.clientWidth*i)),(i=this.s.filter((function(e){return e&&!(e.audio&&e.audio.fastSwitching||e.video&&e.video.fastSwitching)}))).length||(i=this.s);var r=i;if(i.length!=this.s.length&&(r=this.s.filter((function(e){return e&&!!(e.audio&&e.audio.fastSwitching||e.video&&e.video.fastSwitching)}))),i=Dr(this,this.g.restrictions,r,1/0,1/0),1/0!=t||1/0!=n){i=function(e){for(var t=[],n=(e=l(e)).next();!n.done;n=e.next())(n=n.value.video)&&n.height&&n.width&&t.push({height:n.height,width:n.width});return t.sort((function(e,t){return e.width-t.width}))}(i);for(var a=(i=l(i)).next();!a.done;a=i.next())if((a=a.value).height>=t&&a.width>=n){t=a.height,n=a.width;break}i=Dr(this,this.g.restrictions,r,t,n)}for(t=this.getBandwidthEstimate(),r.length&&!i.length&&(i=[(i=Dr(this,null,r,1/0,1/0))[0]]),n=i[0]||null,r=0;r<i.length;r++){a=i[r];for(var o=isNaN(this.B)?1:Math.abs(this.B),s=o*a.bandwidth/this.g.bandwidthDowngradeTarget,u={bandwidth:1/0},c=r+1;c<i.length;c++)if(a.bandwidth!=i[c].bandwidth){u=i[c];break}o=o*u.bandwidth/this.g.bandwidthUpgradeTarget,t>=s&&t<=o&&(n.bandwidth!=a.bandwidth||n.bandwidth==a.bandwidth&&n.video&&a.video&&(n.video.width<a.video.width||n.video.height<a.video.height))&&(n=a)}return this.l=Date.now(),n},i.enable=function(){this.j=!0},i.disable=function(){this.j=!1},i.segmentDownloaded=function(e,t,n){e<this.g.cacheLoadThreshold||(this.i.sample(e,t),n&&null!=this.l&&this.j&&Cr(this))},i.trySuggestStreams=function(){null!=this.l&&this.j&&Cr(this)},i.getBandwidthEstimate=function(){var e=this.g.defaultBandwidthEstimate;return navigator.connection&&navigator.connection.downlink&&this.g.useNetworkInformation&&(e=1e6*navigator.connection.downlink),navigator.connection&&navigator.connection.downlink&&this.g.useNetworkInformation&&this.g.preferNetworkInformationBandwidth?e:(e=this.i.getBandwidthEstimate(e),this.m?this.m.getBandwidthEstimate(e):e)},i.setVariants=function(e){this.s=e},i.playbackRateChanged=function(e){this.B=e},i.setMediaElement=function(t){var n=this;this.o=t,this.h&&(this.h.disconnect(),this.h=null),this.o&&"ResizeObserver"in e&&(this.h=new ResizeObserver((function(){n.C.$(Rr)})),this.h.observe(this.o))},i.setCmsdManager=function(e){this.m=e},i.configure=function(e){this.g=e,this.i&&this.g&&this.i.configure(this.g.advanced)},F("shaka.abr.SimpleAbrManager",Mr),Mr.prototype.configure=Mr.prototype.configure,Mr.prototype.setCmsdManager=Mr.prototype.setCmsdManager,Mr.prototype.setMediaElement=Mr.prototype.setMediaElement,Mr.prototype.playbackRateChanged=Mr.prototype.playbackRateChanged,Mr.prototype.setVariants=Mr.prototype.setVariants,Mr.prototype.getBandwidthEstimate=Mr.prototype.getBandwidthEstimate,Mr.prototype.trySuggestStreams=Mr.prototype.trySuggestStreams,Mr.prototype.segmentDownloaded=Mr.prototype.segmentDownloaded,Mr.prototype.disable=Mr.prototype.disable,Mr.prototype.enable=Mr.prototype.enable,Mr.prototype.chooseVariant=Mr.prototype.chooseVariant,Mr.prototype.init=Mr.prototype.init,Mr.prototype.release=Mr.prototype.release,Mr.prototype.stop=Mr.prototype.stop;var Rr=1;function Pr(e,t,n){for(n=void 0===n||n,this.h=e,this.g=new Set([e]),t=(e=l(t=t||[])).next();!t.done;t=e.next())this.add(t.value,n)}function Lr(e,t){if(e.mimeType!=t.mimeType)return!1;if(e=e.codecs.split(",").map((function(e){return Ci(e)})),t=t.codecs.split(",").map((function(e){return Ci(e)})),e.length!=t.length)return!1;e.sort(),t.sort();for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function Nr(e,t){if(e=new Set(e),t=new Set(t),e.delete("main"),t.delete("main"),e.size!=t.size)return!1;for(var n=(e=l(e)).next();!n.done;n=e.next())if(!t.has(n.value))return!1;return!0}function jr(e,t){this.g=new Or(e.language,"",e.audio&&e.audio.channelsCount?e.audio.channelsCount:0,e.video&&e.video.hdr?e.video.hdr:"",!(!e.audio||!e.audio.spatialAudio)&&e.audio.spatialAudio,e.video&&e.video.videoLayout?e.video.videoLayout:"","","",t,e.audio&&e.audio.codecs?e.audio.codecs:"")}function Or(e,t,n,i,r,a,o,s,u,l){this.s=e,this.A=t,this.i=n,this.j=i,this.B=r,this.m=a,this.h=o,this.l=s,this.o=u,this.g=l}function Ur(){this.g=Fr,this.i=(new Map).set(Fr,2).set(Br,1),this.h=0}function _r(e,t,n){e.i.set(Fr,n).set(Br,t)}F("shaka.config.AutoShowText",{NEVER:0,ALWAYS:1,IF_PREFERRED_TEXT_LANGUAGE:2,IF_SUBTITLES_MAY_BE_NEEDED:3}),F("shaka.config.CodecSwitchingStrategy",{RELOAD:"reload",SMOOTH:"smooth"}),Pr.prototype.add=function(e,t){var n,i=this.h;if(t=void 0===t||t,!(n=!!i.audio!=!!e.audio||!!i.video!=!!e.video||i.language!=e.language)&&(n=i.audio&&e.audio)){n=i.audio;var r=e.audio;n=!(!((!n.channelsCount||!r.channelsCount||2<n.channelsCount||2<r.channelsCount)&&n.channelsCount!=r.channelsCount||n.spatialAudio!==r.spatialAudio||t&&!Lr(n,r))&&Nr(n.roles,r.roles)&&n.groupId===r.groupId)}return!n&&(n=i.video&&e.video)&&(i=i.video,n=e.video,n=!((!t||Lr(i,n))&&Nr(i.roles,n.roles))),!n&&(this.g.add(e),!0)},Pr.prototype.values=function(){return this.g.values()},jr.prototype.create=function(e){return this.g.create(e)},Or.prototype.create=function(t){var n=[];n=function(e,t){var n=Zi(t=Yi(t),e.map((function(e){return Qi(e)})));return n?e.filter((function(e){return n==Qi(e)})):[]}(t,this.s);var i=t.filter((function(e){return e.primary}));return t=function(e,t){return e.filter((function(e){return!!e.audio&&(t?e.audio.roles.includes(t):0==e.audio.roles.length)}))}(n=n.length?n:i.length?i:t,this.A),t.length&&(n=t),this.m&&(t=function(e,t){return e.filter((function(e){return!e.video||!e.video.videoLayout||e.video.videoLayout==t}))}(n,this.m),t.length&&(n=t)),this.j&&(t=function(t,n){return"AUTO"==n&&(n=e.matchMedia("(color-gamut: p3)").matches?t.some((function(e){return!(!e.video||!e.video.hdr||"HLG"!=e.video.hdr)}))?"HLG":"PQ":"SDR"),t.filter((function(e){return!e.video||!e.video.hdr||e.video.hdr==n}))}(n,this.j),t.length&&(n=t)),this.i&&(t=function(e,t){return e.filter((function(e){return!e.audio||!e.audio.channelsCount||e.audio.channelsCount==t}))}(n,this.i),t.length&&(n=t)),this.h&&(t=function(e,t){return e.filter((function(e){return!(!e.audio||!e.audio.label)&&e.audio.label.toLowerCase()==t.toLowerCase()}))}(n,this.h),t.length&&(n=t)),this.l&&(t=function(e,t){return e.filter((function(e){return!(!e.video||!e.video.label)&&e.video.label.toLowerCase()==t.toLowerCase()}))}(n,this.l),t.length&&(n=t)),t=function(e,t){return e.filter((function(e){return!e.audio||e.audio.spatialAudio==t}))}(n,this.B),t.length&&(n=t),this.g&&(t=function(e,t){return e.filter((function(e){return!e.audio||e.audio.codecs==t}))}(n,this.g),t.length&&(n=t)),new Pr(n[0],n,!("smooth"==this.o&&ie()))};var Br=0,Fr=1;function Vr(e,t){var n=2,i=1e3,r=2,a=.5;this.l=null==e.maxAttempts?n:e.maxAttempts,this.j=null==e.baseDelay?i:e.baseDelay,this.o=null==e.fuzzFactor?a:e.fuzzFactor,this.m=null==e.backoffFactor?r:e.backoffFactor,this.g=0,this.h=this.j,(this.i=void 0!==t&&t)&&(this.g=1)}function Hr(e){var t,n;return P((function(i){if(1==i.g){if(e.g>=e.l){if(!e.i)throw new De(2,7,1010);e.g=1,e.h=e.j}return t=e.g,e.g++,0==t?i.return():(n=e.h*(1+(2*Math.random()-1)*e.o),w(i,new Promise((function(e){new Be(e).$(n/1e3)})),2))}e.h*=e.m,T(i)}))}function Gr(){var e,t,n=new Promise((function(n,i){e=n,t=i}));return n.resolve=e,n.reject=t,n}function Kr(e,t){this.promise=e,this.i=t,this.g=null}function Xr(e){return new Kr(Promise.reject(e),(function(){return Promise.resolve()}))}function qr(){var e=Promise.reject(new De(2,7,7001));return e.catch((function(){})),new Kr(e,(function(){return Promise.resolve()}))}function zr(e){return new Kr(Promise.resolve(e),(function(){return Promise.resolve()}))}function Wr(e){return new Kr(e,(function(){return e.catch((function(){}))}))}function Yr(e){return new Kr(Promise.all(e.map((function(e){return e.promise}))),(function(){return Promise.all(e.map((function(e){return e.abort()})))}))}function Jr(t,n){if(n)if(n instanceof Map)for(var i=l(n.keys()),r=i.next();!r.done;r=i.next())r=r.value,Object.defineProperty(this,r,{value:n.get(r),writable:!0,enumerable:!0});else for(i in n)Object.defineProperty(this,i,{value:n[i],writable:!0,enumerable:!0});this.defaultPrevented=this.cancelable=this.bubbles=!1,this.timeStamp=e.performance&&e.performance.now?e.performance.now():Date.now(),this.type=t,this.isTrusted=!1,this.target=this.currentTarget=null,this.g=!1}function $r(e){var t,n=new Jr(e.type);for(t in e)Object.defineProperty(n,t,{value:e[t],writable:!0,enumerable:!0});return n}Gr.prototype.resolve=function(){},Gr.prototype.reject=function(){},Kr.prototype.abort=function(){return this.g||(this.g=this.i()),this.g},Kr.prototype.finally=function(e){return this.promise.then((function(){return e(!0)}),(function(){return e(!1)})),this},Kr.prototype.Ca=function(e,t){function n(n){return function(s){if(r.g&&n)a.reject(o);else{var u=n?e:t;u?i=function(e,t,n){try{var i=e(t);return i&&i.promise&&i.abort?(n.resolve(i.promise),function(){return i.abort()}):(n.resolve(i),function(){return Promise.resolve(i).then((function(){}),(function(){}))})}catch(e){return n.reject(e),function(){return Promise.resolve()}}}(u,s,a):(n?a.resolve:a.reject)(s)}}}function i(){return a.reject(o),r.abort()}var r=this,a=new Gr;a.catch((function(){}));var o=new De(2,7,7001);return this.promise.then(n(!0),n(!1)),new Kr(a,(function(){return i()}))},o.Object.defineProperties(Kr.prototype,{aborted:{configurable:!0,enumerable:!0,get:function(){return null!==this.g}}}),F("shaka.util.AbortableOperation",Kr),Kr.prototype.chain=Kr.prototype.Ca,Kr.prototype.finally=Kr.prototype.finally,Kr.all=Yr,Kr.prototype.abort=Kr.prototype.abort,Kr.notAbortable=Wr,Kr.completed=zr,Kr.aborted=qr,Kr.failed=Xr,Jr.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)},Jr.prototype.stopImmediatePropagation=function(){this.g=!0},Jr.prototype.stopPropagation=function(){},F("shaka.util.FakeEvent",Jr);var Qr={mj:"abrstatuschanged",nj:"adaptation",oj:"audiotrackchanged",pj:"buffering",qj:"complete",rj:"downloadfailed",sj:"downloadheadersreceived",tj:"drmsessionupdate",vj:"emsg",Pj:"prft",Error:"error",wj:"expirationupdated",xj:"firstquartile",yj:"gapjumped",Bj:"keystatuschanged",Fj:"loaded",Gj:"loading",Ij:"manifestparsed",Jj:"manifestupdated",Kj:"mediaqualitychanged",Lj:"mediasourcerecovered",Metadata:"metadata",Mj:"midpoint",Nj:"nospatialvideoinfo",Oj:"onstatechange",Qj:"ratechange",Sj:"segmentappended",Tj:"sessiondata",Uj:"spatialvideoinfo",Vj:"stalldetected",Wj:"started",Xj:"statechanged",Yj:"streaming",Zj:"textchanged",$j:"texttrackvisibility",ak:"thirdquartile",bk:"timelineregionadded",ck:"timelineregionenter",dk:"timelineregionexit",ek:"trackschanged",gk:"unloading",ik:"variantchanged"};function Zr(){this.ra=new Q,this.re=this}function ea(){this.g=[]}function ta(e,t){e.g.push(t.finally((function(){Ie(e.g,t)})))}function na(e,t,n,i,r,a){Zr.call(this),this.i=!1,this.o=new ea,this.g=new Set,this.h=new Set,this.l=e||null,this.j=t||null,this.B=n||null,this.C=i||null,this.G=r||null,this.F=a||null,this.s=this.A=!1,this.m=16e3}function ia(e,t,n,i){n=n||da;var r=ha[e];(!r||n>=r.priority)&&(ha[e]={priority:n,he:t,Hi:void 0!==i&&i})}function ra(e,t){for(var n=l(e.g),i=n.next();!i.done;i=n.next())t.g.add(i.value);for(n=(e=l(e.h)).next();!n.done;n=e.next())t.h.add(n.value)}function aa(e,t,n){return{uris:e,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:t,licenseRequestType:null,sessionId:null,drmInfo:null,initData:null,initDataType:null,streamDataCallback:void 0===n?null:n}}function oa(e,t,n,i,r,a,o,s){e.A&&(n.uris[a]=n.uris[a].replace("https://","http://")),e.s&&(n.uris[a]=n.uris[a].replace("http://","https://")),0<a&&e.G&&e.G(t,i,n.uris[a],n.uris[a-1]);var u=new Gn(n.uris[a]),l=u.Db,c=!1;l||(Kn(u,l=(l=location.protocol).slice(0,-1)),n.uris[a]=u.toString()),l=l.toLowerCase();var d=(l=ha[l])?l.he:null;if(!d)return Xr(new De(2,1,1e3,u));var h,f=l.Hi,p=null,g=null,m=!1,v=!1;return Wr(Hr(r)).Ca((function(){if(e.i)return qr();h=Date.now();var r=0;n.requestStartTime=Date.now();var o=d(n.uris[a],n,t,(function(a,o,u){p&&p.stop(),g&&g.$(l/1e3),e.l&&t==ca&&(r++,n.packetNumber=r,e.l(a,o,sa(i),n),c=!0,s.g=u)}),(function(i){v=!0,n.timeToFirstByte=Date.now()-n.requestStartTime,e.j&&e.j(i,n,t)}),{minBytesForProgressEvents:e.m});if(!f)return o;var u=n.retryParameters.connectionTimeout;u&&(p=new Be((function(){m=!0,o.abort()}))).$(u/1e3);var l=n.retryParameters.stallTimeout;return l&&(g=new Be((function(){m=!0,o.abort()}))),o})).Ca((function(i){p&&p.stop(),g&&g.stop(),null==i.timeMs&&(i.timeMs=Date.now()-h);var r={response:i,mi:c};return!v&&e.j&&e.j(i.headers,n,t),r}),(function(u){if(p&&p.stop(),g&&g.stop(),e.B){var l=null,c=0;u instanceof De&&(l=u,1001==u.code&&(c=u.data[1])),e.B(n,l,c,m)}if(e.i)return qr();if(m&&(u=new De(1,1,1003,n.uris[a],t)),u instanceof De){if(7001==u.code)throw u;if(1010==u.code)throw o;if(1==u.severity)return l=new Jr("retry",l=(new Map).set("error",u)),e.dispatchEvent(l),a=(a+1)%n.uris.length,oa(e,t,n,i,r,a,u,s)}throw u}))}function sa(e){if(e){var t=e.segment;if(e=e.stream,t&&e&&e.fastSwitching&&t.o)return!1}return!0}function ua(){this.g=0}function la(e,t,n){Kr.call(this,e,t),this.h=n}Zr.prototype.addEventListener=function(e,t){this.ra&&this.ra.push(e,t)},Zr.prototype.removeEventListener=function(e,t){this.ra&&this.ra.remove(e,t)},Zr.prototype.dispatchEvent=function(e){if(!this.ra)return!0;var t=this.ra.get(e.type)||[],n=this.ra.get("All");for(n&&(t=t.concat(n)),n=(t=l(t)).next();!n.done;n=t.next()){n=n.value,e.target=this.re,e.currentTarget=this.re;try{n.handleEvent?n.handleEvent(e):n.call(this,e)}catch(e){}if(e.g)break}return e.defaultPrevented},Zr.prototype.release=function(){this.ra=null},ea.prototype.destroy=function(){for(var e=[],t=l(this.g),n=t.next();!n.done;n=t.next())(n=n.value).promise.catch((function(){})),e.push(n.abort());return this.g=[],Promise.all(e)},m(na,Zr),(i=na.prototype).Tf=function(e){this.A=e},i.Uf=function(e){this.s=e},i.Ki=function(e){this.g.add(e)},i.fj=function(e){this.g.delete(e)},i.og=function(){this.g.clear()},i.Li=function(e){this.h.add(e)},i.gj=function(e){this.h.delete(e)},i.pg=function(){this.h.clear()},i.destroy=function(){return this.i=!0,this.g.clear(),this.h.clear(),Zr.prototype.release.call(this),this.o.destroy()},i.request=function(e,t,n){var i=this,r=new ua;if(this.i){var a=Promise.reject(new De(2,7,7001));return a.catch((function(){})),new la(a,(function(){return Promise.resolve()}),r)}t.method=t.method||"GET",t.headers=t.headers||{},t.retryParameters=t.retryParameters?kt(t.retryParameters):{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4},t.uris=kt(t.uris),a=function(e,t,n,i){function r(e){a=a.Ca((function(){return n.body&&(n.body=pe(n.body)),e(t,n,i)}))}var a=zr(void 0);e.C&&r(e.C);for(var o=(e=l(e.g)).next();!o.done;o=e.next())r(o.value);return a.Ca(void 0,(function(e){if(e instanceof De&&7001==e.code)throw e;throw new De(2,1,1006,e)}))}(this,e,t,n);var o=a.Ca((function(){return oa(i,e,t,n,new Vr(t.retryParameters,!1),0,null,r)})),s=o.Ca((function(t){return function(e,t,n,i){for(var r=zr(void 0),a=(e=l(e.h)).next(),o={};!a.done;o={Yg:void 0},a=e.next())o.Yg=a.value,r=r.Ca(function(e){return function(){var r=n.response;return r.data&&(r.data=pe(r.data)),(0,e.Yg)(t,r,i)}}(o));return r.Ca((function(){return n}),(function(e){var t=2;if(e instanceof De){if(7001==e.code)throw e;t=e.severity}throw new De(t,1,1007,e)}))}(i,e,t,n)})),u=Date.now(),c=0;a.promise.then((function(){c=Date.now()-u}),(function(){}));var d=0;o.promise.then((function(){d=Date.now()}),(function(){}));var h=s.Ca((function(r){var a=Date.now()-d,o=r.response;return o.timeMs+=c,o.timeMs+=a,r.mi||!i.l||o.fromCache||"HEAD"==t.method||e!=ca||i.l(o.timeMs,o.data.byteLength,sa(n)),i.F&&i.F(e,o,n),o}),(function(e){throw e&&(e.severity=2),e}));return a=new la(h.promise,(function(){return h.abort()}),r),ta(this.o,a),a},F("shaka.net.NetworkingEngine",na),na.prototype.request=na.prototype.request,na.prototype.destroy=na.prototype.destroy,na.makeRequest=aa,na.defaultRetryParameters=function(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4}},na.prototype.clearAllResponseFilters=na.prototype.pg,na.prototype.unregisterResponseFilter=na.prototype.gj,na.prototype.registerResponseFilter=na.prototype.Li,na.prototype.clearAllRequestFilters=na.prototype.og,na.prototype.unregisterRequestFilter=na.prototype.fj,na.prototype.registerRequestFilter=na.prototype.Ki,na.unregisterScheme=function(e){delete ha[e]},na.registerScheme=ia,na.prototype.setForceHTTPS=na.prototype.Uf,na.prototype.setForceHTTP=na.prototype.Tf,na.NumBytesRemainingClass=ua,m(la,Kr),na.PendingRequest=la;var ca=1;na.RequestType={MANIFEST:0,SEGMENT:ca,LICENSE:2,APP:3,TIMING:4,SERVER_CERTIFICATE:5,KEY:6,ADS:7,CONTENT_STEERING:8},na.AdvancedRequestType={INIT_SEGMENT:0,MEDIA_SEGMENT:1,MEDIA_PLAYLIST:2,MASTER_PLAYLIST:3,MPD:4,MSS:5,MPD_PATCH:6,MEDIATAILOR_SESSION_INFO:7,MEDIATAILOR_TRACKING_INFO:8,MEDIATAILOR_STATIC_RESOURCE:9,MEDIATAILOR_TRACKING_EVENT:10,INTERSTITIAL_ASSET_LIST:11,INTERSTITIAL_AD_URL:12};var da=3;na.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:da};var ha={};function fa(e){this.g=!1,this.h=new Gr,this.i=e}function pa(e,t){if(e.g){if(t instanceof De&&7003==t.code)throw t;throw new De(2,7,7003,t)}}function ga(e,t){for(var n=[],i=(e=l(e)).next();!i.done;i=e.next())n.push(t(i.value));return n}function ma(e){for(var t=new Map,n=l(Object.keys(e)),i=n.next();!i.done;i=n.next())i=i.value,t.set(i,e[i]);return t}function va(e){var t={};return e.forEach((function(e,n){t[n]=e})),t}function ya(e,t){this.h=ve(e),this.i=t==wa,this.g=0}function ba(){return new De(2,3,3e3)}fa.prototype.destroy=function(){var e=this;return this.g?this.h:(this.g=!0,this.i().then((function(){e.h.resolve()}),(function(){e.h.resolve()})))},(i=ya.prototype).sa=function(){return this.g<this.h.byteLength},i.ya=function(){return this.g},i.getLength=function(){return this.h.byteLength},i.T=function(){try{var e=this.h.getUint8(this.g);return this.g+=1,e}catch(e){throw ba()}},i.ma=function(){try{var e=this.h.getUint16(this.g,this.i);return this.g+=2,e}catch(e){throw ba()}},i.P=function(){try{var e=this.h.getUint32(this.g,this.i);return this.g+=4,e}catch(e){throw ba()}},i.Vg=function(){try{var e=this.h.getInt32(this.g,this.i);return this.g+=4,e}catch(e){throw ba()}},i.Vc=function(){try{if(this.i)var e=this.h.getUint32(this.g,!0),t=this.h.getUint32(this.g+4,!0);else t=this.h.getUint32(this.g,!1),e=this.h.getUint32(this.g+4,!1)}catch(e){throw ba()}if(2097151<t)throw new De(2,3,3001);return this.g+=8,t*Math.pow(2,32)+e},i.vb=function(e){if(this.g+e>this.h.byteLength)throw ba();var t=ge(this.h,this.g,e);return this.g+=e,t},i.skip=function(e){if(this.g+e>this.h.byteLength)throw ba();this.g+=e},i.Si=function(e){if(this.g<e)throw ba();this.g-=e},i.seek=function(e){if(0>e||e>this.h.byteLength)throw ba();this.g=e},i.yc=function(){for(var e=this.g;this.sa()&&0!=this.h.getUint8(this.g);)this.g+=1;return e=ge(this.h,e,this.g-e),this.g+=1,dt(e)},F("shaka.util.DataViewReader",ya),ya.prototype.readTerminatedString=ya.prototype.yc,ya.prototype.seek=ya.prototype.seek,ya.prototype.rewind=ya.prototype.Si,ya.prototype.skip=ya.prototype.skip,ya.prototype.readBytes=ya.prototype.vb,ya.prototype.readUint64=ya.prototype.Vc,ya.prototype.readInt32=ya.prototype.Vg,ya.prototype.readUint32=ya.prototype.P,ya.prototype.readUint16=ya.prototype.ma,ya.prototype.readUint8=ya.prototype.T,ya.prototype.getLength=ya.prototype.getLength,ya.prototype.getPosition=ya.prototype.ya,ya.prototype.hasMoreData=ya.prototype.sa;var wa=1;function Ta(){this.i=[],this.h=[],this.g=!1}function Sa(e){for(var t=Ca(e);e.reader.sa()&&!e.parser.g;)e.parser.Sc(e.start+t,e.reader,e.partialOkay)}function xa(e){for(var t=Ca(e),n=e.reader.P(),i=0;i<n&&(e.parser.Sc(e.start+t,e.reader,e.partialOkay),!e.parser.g);i++);}function Aa(e){var t=Ca(e);for(e.reader.skip(78);e.reader.sa()&&!e.parser.g;)e.parser.Sc(e.start+t,e.reader,e.partialOkay)}function Ea(e){var t=Ca(e);e.reader.skip(8);var n=e.reader.ma();for(e.reader.skip(6),2==n?e.reader.skip(48):e.reader.skip(12),1==n&&e.reader.skip(16);e.reader.sa()&&!e.parser.g;)e.parser.Sc(e.start+t,e.reader,e.partialOkay)}function ka(e){return function(t){e(t.reader.vb(t.reader.getLength()-t.reader.ya()))}}function Ia(e){for(var t=0,n=(e=l(e)).next();!n.done;n=e.next())t=t<<8|n.value.charCodeAt(0);return t}function Ma(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)}function Ca(e){return 8+(e.has64BitSize?8:0)+(null!=e.flags?4:0)}ya.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:wa},(i=Ta.prototype).box=function(e,t){return e=Ia(e),this.i[e]=Da,this.h[e]=t,this},i.R=function(e,t){return e=Ia(e),this.i[e]=Ra,this.h[e]=t,this},i.stop=function(){this.g=!0},i.parse=function(e,t,n){for(e=new ya(e,0),this.g=!1;e.sa()&&!this.g;)this.Sc(0,e,t,n)},i.Sc=function(e,t,n,i){var r=t.ya();if(i&&r+8>t.getLength())this.g=!0;else{var a=t.P(),o=t.P(),s=Ma(o),u=!1;switch(a){case 0:a=t.getLength()-r;break;case 1:if(i&&t.ya()+8>t.getLength())return void(this.g=!0);a=t.Vc(),u=!0}var l=this.h[o];if(l){var c=null,d=null;if(this.i[o]==Ra){if(i&&t.ya()+4>t.getLength())return void(this.g=!0);c=(d=t.P())>>>24,d&=16777215}o=r+a,n&&o>t.getLength()&&(o=t.getLength()),i&&o>t.getLength()?this.g=!0:(i=o-t.ya(),l({name:s,parser:this,partialOkay:n||!1,version:c,flags:d,reader:t=new ya(t=0<i?t.vb(i):new Uint8Array(0),0),size:a,start:r+e,has64BitSize:u}))}else t.skip(Math.min(r+a-t.ya(),t.getLength()-t.ya()))}},F("shaka.util.Mp4Parser",Ta),Ta.headerSize=Ca,Ta.typeToString=Ma,Ta.allData=ka,Ta.audioSampleEntry=Ea,Ta.visualSampleEntry=Aa,Ta.sampleDescription=xa,Ta.children=Sa,Ta.prototype.parseNext=Ta.prototype.Sc,Ta.prototype.parse=Ta.prototype.parse,Ta.prototype.stop=Ta.prototype.stop,Ta.prototype.fullBox=Ta.prototype.R,Ta.prototype.box=Ta.prototype.box;var Da=0,Ra=1;function Pa(e){var t=this;this.g=[],this.h=[],this.data=[],(new Ta).box("moov",Sa).box("moof",Sa).R("pssh",(function(e){if(!(1<e.version)){var n=ge(e.reader.h,-12,e.size);if(t.data.push(n),t.g.push(ci(e.reader.vb(16))),0<e.version){n=e.reader.P();for(var i=0;i<n;i++){var r=ci(e.reader.vb(16));t.h.push(r)}}}})).parse(e)}function La(e,t,n,i){var r=e.length,a=t.length+16+r;0<i&&(a+=4+16*n.size);var o=new Uint8Array(a),s=ve(o),u=0;if(s.setUint32(u,a),u+=4,s.setUint32(u,1886614376),u+=4,1>i?s.setUint32(u,0):s.setUint32(u,16777216),u+=4,o.set(t,u),u+=t.length,0<i)for(s.setUint32(u,n.size),u+=4,n=(t=l(n)).next();!n.done;n=t.next())n=li(n.value),o.set(n,u),u+=n.length;return s.setUint32(u,r),o.set(e,u+4),o}function Na(e){var t=this;this.C=e,this.l=this.A=null,this.ja=this.fa=!1,this.H=0,this.g=null,this.o=new Z,this.i=new Map,this.Y=[],this.B=new Map,this.K=!1,this.m=new Gr,this.h=null,this.s=function(n){2==n.severity&&t.m.reject(n),e.onError(n)},this.aa=new Map,this.ga=new Map,this.L=new Be((function(){return function(e){var t=e.aa,n=e.ga;n.clear(),t.forEach((function(e,t){return n.set(t,e)})),(t=Array.from(n.values())).length&&t.every((function(e){return"expired"==e}))&&e.s(new De(2,6,6014)),e.C.ee(va(n))}(t)})),this.O=!1,this.M=[],this.Z=!1,this.I=new Be((function(){!function(e){e.i.forEach((function(t,n){var i=t.Df,r=n.expiration;isNaN(r)&&(r=1/0),r!=i&&(e.C.onExpirationUpdated(n.sessionId,r),t.Df=r)}))}(t)})),this.m.catch((function(){})),this.j=new fa((function(){return function(e){return P((function(t){switch(t.g){case 1:return e.o.release(),e.o=null,e.m.reject(),e.I.stop(),e.I=null,e.L.stop(),e.L=null,w(t,za(e),2);case 2:if(!e.l){t.u(3);break}return S(t,4),w(t,e.l.setMediaKeys(null),6);case 6:A(t,5);break;case 4:E(t);case 5:e.l=null;case 3:e.g=null,e.A=null,e.B=new Map,e.h=null,e.s=function(){},e.C=null,e.da=!1,e.G=null,T(t)}}))}(t)})),this.da=!1,this.F=this.G=null,this.S=function(){return!1}}function ja(e,t,n){e.B=new Map;for(var i=(n=l(n)).next();!i.done;i=n.next())e.B.set(i.value,{initData:null,initDataType:null});for(i=(n=l(e.h.persistentSessionsMetadata)).next();!i.done;i=n.next())i=i.value,e.B.set(i.sessionId,{initData:i.initData,initDataType:i.initDataType});return e.O=0<e.B.size,Oa(e,t)}function Oa(e,t){var n,i,r,a,o,s,u,c,d,h,f,p,g,m,v,y,b;return P((function(T){if(1==T.g){if(n=function(e){return 0==(e=ma(e.h.clearKeys)).size?null:pi(e)}(e))for(i=l(t),r=i.next();!r.done;r=i.next())(a=r.value).video&&(a.video.drmInfos=[n]),a.audio&&(a.audio.drmInfos=[n]);for((o=t.some((function(e){return!!(e.video&&e.video.drmInfos.length||e.audio&&e.audio.drmInfos.length)})))||(s=ma(e.h.servers),function(e,t){var n=[];for(t.forEach((function(e,t){n.push({keySystem:t,licenseServerUri:e,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",initData:[],keyIds:new Set})})),t=(e=l(e)).next();!t.done;t=e.next())(t=t.value).video&&(t.video.drmInfos=n),t.audio&&(t.audio.drmInfos=n)}(t,s)),u=new Set,c=l(t),d=c.next();!d.done;d=c.next())for(h=d.value,f=Wa(h),p=l(f),g=p.next();!g.done;g=p.next())m=g.value,u.add(m);for(v=l(u),y=v.next();!y.done;y=v.next())$a(y.value,ma(e.h.servers),ma(e.h.advanced||{}),e.h.keySystemsMapping);return w(T,sr(t,e.O,e.da,e.h.preferredKeySystems),2)}return pa(e.j),o||Object.keys(e.h.servers).length?(b=Va(e,void 0,t),T.return(o?b:b.catch((function(){})))):(e.fa=!0,T.return(Promise.resolve()))}))}function Ua(e){var t;return P((function(n){switch(n.g){case 1:if(e.l.mediaKeys)return n.return();if(!e.G){n.u(2);break}return w(n,e.G,3);case 3:return pa(e.j),n.return();case 2:return S(n,4),e.G=e.l.setMediaKeys(e.A),w(n,e.G,6);case 6:A(n,5);break;case 4:t=E(n),e.s(new De(2,6,6003,t.message));case 5:pa(e.j),T(n)}}))}function _a(e){var t,n,i,r;return P((function(a){if(1==a.g)return e.B.size?(e.B.forEach((function(t,n){Ka(e,n,t)})),w(a,e.m,3)):a.u(2);if(2!=a.g){if(0<(e.g&&e.g.keyIds||new Set([])).size&&function(e){for(var t=l(e.g&&e.g.keyIds||new Set([])),n=t.next();!n.done;n=t.next())if("usable"!==e.aa.get(n.value))return!1;return!0}(e))return a.return(e.m);e.K=!1,e.m=new Gr,e.m.catch((function(){}))}for(t=(e.g?e.g.initData:[])||[],n=l(t),i=n.next();!i.done;i=n.next())r=i.value,Ba(e,r.initDataType,r.initData);return Ya(e)&&e.m.resolve(),a.return(e.m)}))}function Ba(e,t,n){if(n.length){if(e.h.ignoreDuplicateInitData){for(var i=e.i.values(),r=(i=l(i)).next();!r.done;r=i.next())if(fe(n,r.value.initData))return;var a=!1;if(e.B.forEach((function(e){!a&&fe(n,e.initData)&&(a=!0)})),a)return}e.K=!0,0<e.i.size&&Ya(e)&&(e.m.resolve(),e.K=!1,e.m=new Gr,e.m.catch((function(){}))),function(e,t,n,i){try{var r=e.A.createSession(i)}catch(t){return void e.s(new De(2,6,6005,t.message))}e.o.D(r,"message",(function(t){e.l&&e.h.delayLicenseRequestUntilPlayed&&e.l.paused&&!e.Z?e.M.push(t):Xa(e,t)})),e.o.D(r,"keystatuseschange",(function(t){return qa(e,t)})),e.i.set(r,{initData:n,initDataType:t,loaded:!1,Df:1/0,nb:null,type:i});try{n=e.h.initDataTransform(n,t,e.g)}catch(n){return t=n,n instanceof De||(t=new De(2,6,6016,n)),void e.s(t)}e.h.logLicenseExchange&&si(n),r.generateRequest(t,n).catch((function(t){if(!e.j.g){e.i.delete(r);var n=t.errorCode;if(n&&n.systemCode){var i=n.systemCode;0>i&&(i+=Math.pow(2,32)),i="0x"+i.toString(16)}e.s(new De(2,6,6006,t.message,t,i))}}))}(e,t,n,e.g.sessionType)}}function Fa(e){return e=ga(e=e.i.keys(),(function(e){return e.sessionId})),Array.from(e)}function Va(e,t,n){var i,r,a,o,s,u,c;return P((function(d){switch(d.g){case 1:if(i=new Map,n.length){r=function(e,t,n){for(var i=l(t),r=i.next();!r.done;r=i.next())for(var a=(r=l(Wa(r.value))).next();!a.done;a=r.next())a=a.value,n.has(a.keySystem)||n.set(a.keySystem,[]),n.get(a.keySystem).push(a);if(1==n.size&&n.has(""))throw new De(2,6,6e3);for(a=(i=l(e.h.preferredKeySystems)).next(),r={};!a.done;r={Ug:void 0},a=i.next()){r.Ug=a.value;for(var o=(a=l(t)).next();!o.done;o=a.next())if(o=o.value.decodingInfos.find(function(e){return function(t){return t.supported&&null!=t.keySystemAccess&&t.keySystemAccess.keySystem==e.Ug}}(r)))return o.keySystemAccess}for(r=(i=l([!0,!1])).next();!r.done;r=i.next())for(r=r.value,o=(a=l(t)).next();!o.done;o=a.next())for(var s=(o=l(o.value.decodingInfos)).next();!s.done;s=o.next())if((s=s.value).supported&&s.keySystemAccess){var u=s.keySystemAccess.keySystem,c=n.get(u);for(!c&&e.h.keySystemsMapping[u]&&(c=n.get(e.h.keySystemsMapping[u])),c=(u=l(c)).next();!c.done;c=u.next())if(!!c.value.licenseServerUri==r)return s.keySystemAccess}return null}(e,n,i),d.u(2);break}return w(d,function(e,t){var n,i,r,a,o,s,u,c,d,h,f,p,g,m,v,y;return P((function(b){switch(b.g){case 1:if(1==t.size&&t.has(""))throw new De(2,6,6e3);for(i=l(t.values()),r=i.next();!r.done;r=i.next())0==(a=r.value).audioCapabilities.length&&delete a.audioCapabilities,0==a.videoCapabilities.length&&delete a.videoCapabilities;o=l(e.h.preferredKeySystems),s=o.next();case 2:if(s.done){b.u(4);break}if(u=s.value,!t.has(u)){b.u(3);break}return c=t.get(u),S(b,6),w(b,navigator.requestMediaKeySystemAccess(u,[c]),8);case 8:return n=b.h,b.return(n);case 6:E(b);case 7:pa(e.j);case 3:s=o.next(),b.u(2);break;case 4:d=l([!0,!1]),h=d.next();case 9:if(h.done){b.u(11);break}f=h.value,p=l(t.keys()),g=p.next();case 12:if(g.done){h=d.next(),b.u(9);break}if(m=g.value,v=t.get(m),y=v.drmInfos.some((function(e){return!!e.licenseServerUri})),y!=f){b.u(13);break}return S(b,15),w(b,navigator.requestMediaKeySystemAccess(m,[v]),17);case 17:return n=b.h,b.return(n);case 15:E(b);case 16:pa(e.j);case 13:g=p.next(),b.u(12);break;case 11:return b.return(n)}}))}(e,t),3);case 3:r=d.h;case 2:if(!(a=r))throw new De(2,6,6001);if(pa(e.j),S(d,4),a.getConfiguration(),o=e.h.keySystemsMapping[a.keySystem]||a.keySystem,n.length){var h=o,f=i.get(o),p=[],g=[],m=[],v=[],y=[],b=new Set,T=new Set;Ja(f,p,g,v,m,y,b,T);var x=e.O?"persistent-license":"temporary";for(h={keySystem:h,encryptionScheme:p[0],licenseServerUri:g[0],distinctiveIdentifierRequired:f[0].distinctiveIdentifierRequired,persistentStateRequired:f[0].persistentStateRequired,sessionType:f[0].sessionType||x,audioRobustness:f[0].audioRobustness||"",videoRobustness:f[0].videoRobustness||"",serverCertificate:v[0],serverCertificateUri:m[0],initData:y,keyIds:b},0<T.size&&(h.keySystemUris=T),T=(f=l(f)).next();!T.done;T=f.next())(T=T.value).distinctiveIdentifierRequired&&(h.distinctiveIdentifierRequired=T.distinctiveIdentifierRequired),T.persistentStateRequired&&(h.persistentStateRequired=T.persistentStateRequired);f=h}else f=o,T=t.get(o),h=[],p=[],g=[],m=[],v=[],y=new Set,Ja(T.drmInfos,h,p,m,g,v,y),f={keySystem:f,encryptionScheme:h[0],licenseServerUri:p[0],distinctiveIdentifierRequired:"required"==T.distinctiveIdentifier,persistentStateRequired:"required"==T.persistentState,sessionType:T.sessionTypes[0]||"temporary",audioRobustness:(T.audioCapabilities?T.audioCapabilities[0].robustness:"")||"",videoRobustness:(T.videoCapabilities?T.videoCapabilities[0].robustness:"")||"",serverCertificate:m[0],serverCertificateUri:g[0],initData:v,keyIds:y};if(e.g=f,!e.g.licenseServerUri)throw new De(2,6,6012,e.g.keySystem);return w(d,a.createMediaKeys(),6);case 6:if(s=d.h,pa(e.j),e.A=s,""==e.h.minHdcpVersion||!("getStatusForPolicy"in e.A)){d.u(7);break}return S(d,8),w(d,e.A.getStatusForPolicy({minHdcpVersion:e.h.minHdcpVersion}),10);case 10:if("usable"!=d.h)throw new De(2,6,6018);pa(e.j),A(d,7,4);break;case 8:if((u=E(d,4))instanceof De)throw u;throw new De(2,6,6019,u.message);case 7:return e.fa=!0,w(d,function(e){var t,n;return P((function(i){switch(i.g){case 1:if(!e.A||!e.g)return i.return();if(!e.g.serverCertificateUri||e.g.serverCertificate&&e.g.serverCertificate.length){i.u(2);break}return t=aa([e.g.serverCertificateUri],e.h.retryParameters),S(i,3),w(i,e.C.Nb.request(5,t,{isPreload:e.S()}).promise,5);case 5:n=i.h,e.g.serverCertificate=ge(n.data),A(i,4);break;case 3:throw new De(2,6,6017,E(i));case 4:if(e.j.g)return i.return();case 2:return e.g.serverCertificate&&e.g.serverCertificate.length?(S(i,6),w(i,e.A.setServerCertificate(e.g.serverCertificate),8)):i.return();case 8:A(i,0);break;case 6:throw new De(2,6,6004,E(i).message)}}))}(e),11);case 11:pa(e.j),A(d,0);break;case 4:if(c=E(d),pa(e.j,c),e.g=null,c instanceof De)throw c;throw new De(2,6,6002,c.message)}}))}function Ha(e){Ya(e)&&e.m.resolve()}function Ga(e,t){new Be((function(){t.loaded=!0,Ha(e)})).$(Za)}function Ka(e,t,n){var i,r,a,o,s,u,l;return P((function(c){switch(c.g){case 1:try{i=e.A.createSession("persistent-license")}catch(t){return r=new De(2,6,6005,t.message),e.s(r),c.return(Promise.reject(r))}return e.o.D(i,"message",(function(t){e.l&&e.h.delayLicenseRequestUntilPlayed&&e.l.paused&&!e.Z?e.M.push(t):Xa(e,t)})),e.o.D(i,"keystatuseschange",(function(t){return qa(e,t)})),a={initData:n.initData,initDataType:n.initDataType,loaded:!1,Df:1/0,nb:null,type:"persistent-license"},e.i.set(i,a),S(c,2),w(c,i.load(t),4);case 4:return o=c.h,pa(e.j),o||(e.i.delete(i),s=e.h.persistentSessionOnlinePlayback?1:2,e.s(new De(s,6,6013)),a.loaded=!0),Ga(e,a),Ha(e),c.return(i);case 2:u=E(c),pa(e.j,u),e.i.delete(i),l=e.h.persistentSessionOnlinePlayback?1:2,e.s(new De(l,6,6005,u.message)),a.loaded=!0,Ha(e);case 3:return c.return(Promise.resolve())}}))}function Xa(e,t){var n,i,r,a,o,s,u,c,d,h,f,p,g,m;P((function(v){switch(v.g){case 1:if(n=t.target,e.h.logLicenseExchange&&si(t.message),i=e.i.get(n),r=e.g.licenseServerUri,a=e.h.advanced[e.g.keySystem],"individualization-request"==t.messageType&&a&&a.individualizationServer&&(r=a.individualizationServer),(o=aa([r],e.h.retryParameters)).body=t.message,o.method="POST",o.licenseRequestType=t.messageType,o.sessionId=n.sessionId,o.drmInfo=e.g,i&&(o.initData=i.initData,o.initDataType=i.initDataType),a&&a.headers)for(s in a.headers)o.headers[s]=a.headers[s];if(je(e.g.keySystem)){var y=ht(o.body,!0,!0);if(y.includes("PlayReadyKeyMessage")){for(var b=Ut(y=Dt(y,"PlayReadyKeyMessage"),"HttpHeader"),x=(b=l(b)).next();!x.done;x=b.next()){var k=x.value;x=Ut(k,"name")[0],k=Ut(k,"value")[0],o.headers[jt(x)]=jt(k)}y=Ut(y,"Challenge")[0],o.body=ui(jt(y))}else o.headers["Content-Type"]="text/xml; charset=utf-8"}return u=Date.now(),S(v,2),d=e.C.Nb.request(2,o,{isPreload:e.S()}),e.Y.push(d),w(v,d.promise,4);case 4:c=v.h,Ie(e.Y,d),A(v,3);break;case 2:return h=E(v),e.j.g||(f=new De(2,6,6007,h),1==e.i.size?(e.s(f),i&&i.nb&&i.nb.reject(f)):(i&&i.nb&&i.nb.reject(f),e.i.delete(n),Ya(e)&&(e.m.resolve(),e.L.$(.1)))),v.return();case 3:return e.j.g?v.return():(e.H+=(Date.now()-u)/1e3,e.h.logLicenseExchange&&si(c.data),S(v,5),w(v,n.update(c.data),7));case 7:A(v,6);break;case 5:return p=E(v),g=new De(2,6,6008,p.message),e.s(g),i&&i.nb&&i.nb.reject(g),v.return();case 6:if(e.j.g)return v.return();m=new Jr("drmsessionupdate"),e.C.onEvent(m),i&&(i.nb&&i.nb.resolve(),Ga(e,i)),T(v)}}))}function qa(e,t){t=t.target;var n=e.i.get(t),i=!1;t.keyStatuses.forEach((function(t,r){if("string"==typeof r){var a=r;r=t,t=a}if(je(e.g.keySystem)&&16==r.byteLength&&(He()||$e())){var o=(a=ve(r)).getUint32(0,!0),s=a.getUint16(4,!0),u=a.getUint16(6,!0);a.setUint32(0,o,!1),a.setUint16(4,s,!1),a.setUint16(6,u,!1)}"status-pending"!=t&&(n.loaded=!0),"expired"==t&&(i=!0),r=ci(r).slice(0,32),e.aa.set(r,t)}));var r=t.expiration-Date.now();(0>r||i&&1e3>r)&&n&&!n.nb&&(e.i.delete(t),t.close().catch((function(){}))),Ya(e)&&(e.m.resolve(),e.L.$(eo))}function za(e){var t;return P((function(n){return t=Array.from(e.i.entries()),e.i.clear(),w(n,Promise.all(t.map((function(t){var n=(t=l(t)).next().value,i=t.next().value;return P((function(t){return 1==t.g?(S(t,2),e.ja||e.B.has(n.sessionId)||"persistent-license"!==i.type||e.h.persistentSessionOnlinePlayback?w(t,function(e){return P((function(t){return 1==t.g?(S(t,2),w(t,Ki(Qa,Promise.all([e.close(),e.closed])),4)):2!=t.g?A(t,0):(E(t),void T(t))}))}(n),5):w(t,n.remove(),5)):2!=t.g?A(t,0):(E(t),void T(t))}))}))),0)}))}function Wa(e){return(e.video?e.video.drmInfos:[]).concat(e.audio?e.audio.drmInfos:[])}function Ya(e){return function(e,t){for(var n=(e=l(e)).next();!n.done;n=e.next())if(!t(n.value))return!1;return!0}(e=e.i.values(),(function(e){return e.loaded}))}function Ja(t,n,i,r,a,o,s,u){for(var d=[],h=(t=l(t)).next(),f={};!h.done;f={ua:void 0},h=t.next()){if(f.ua=h.value,n.includes(f.ua.encryptionScheme)||n.push(f.ua.encryptionScheme),"org.w3.clearkey"==f.ua.keySystem&&f.ua.licenseServerUri.startsWith("data:application/json;base64,")?d.includes(f.ua.licenseServerUri)||d.push(f.ua.licenseServerUri):i.includes(f.ua.licenseServerUri)||i.push(f.ua.licenseServerUri),a.includes(f.ua.serverCertificateUri)||a.push(f.ua.serverCertificateUri),f.ua.serverCertificate&&(r.some(function(e){return function(t){return fe(t,e.ua.serverCertificate)}}(f))||r.push(f.ua.serverCertificate)),f.ua.initData)for(var p=(h=l(f.ua.initData)).next(),g={};!p.done;g={qf:void 0},p=h.next())g.qf=p.value,o.some(function(e){return function(t){var n=e.qf;return!(!t.keyId||t.keyId!=n.keyId)||t.initDataType==n.initDataType&&fe(t.initData,n.initData)}}(g))||o.push(g.qf);if(f.ua.keyIds)for(p=(h=l(f.ua.keyIds)).next();!p.done;p=h.next())s.add(p.value);if(f.ua.keySystemUris&&u)for(h=(f=l(f.ua.keySystemUris)).next();!h.done;h=f.next())u.add(h.value)}if(1==d.length)i.push(d[0]);else if(0<d.length){for(n=[],r=(d=l(d)).next();!r.done;r=d.next())r=e.atob(r.value.split("data:application/json;base64,").pop()),r=JSON.parse(r),n.push.apply(n,c(r.keys));d=JSON.stringify({keys:n}),i.push("data:application/json;base64,"+e.btoa(d))}}function $a(t,n,i,r){var a=t.keySystem;!a||"org.w3.clearkey"==a&&t.licenseServerUri||(n.size&&(n=n.get(a)||"",t.licenseServerUri=n),t.keyIds||(t.keyIds=new Set),(i=i.get(a))&&(t.distinctiveIdentifierRequired||(t.distinctiveIdentifierRequired=i.distinctiveIdentifierRequired),t.persistentStateRequired||(t.persistentStateRequired=i.persistentStateRequired),t.videoRobustness||(t.videoRobustness=i.videoRobustness),t.audioRobustness||(t.audioRobustness=i.audioRobustness),t.serverCertificate||(t.serverCertificate=i.serverCertificate),i.sessionType&&(t.sessionType=i.sessionType),t.serverCertificateUri||(t.serverCertificateUri=i.serverCertificateUri)),r[a]&&(t.keySystem=r[a]),e.cast&&e.cast.__platform__&&"com.microsoft.playready"==a&&(t.keySystem="com.chromecast.playready"))}(i=Na.prototype).destroy=function(){return this.j.destroy()},i.configure=function(e,t){this.h=e,t&&(this.S=t),this.I&&this.I.Ra(this.h.updateExpirationTime)},i.Tb=function(e){var t=this;return P((function(n){if(1==n.g)return t.A?(t.l=e,t.o.pa(t.l,"play",(function(){for(var e=l(t.M),n=e.next();!n.done;n=e.next())Xa(t,n.value);t.Z=!0,t.M=[]})),t.l.remote?(t.o.D(t.l.remote,"connect",(function(){return za(t)})),t.o.D(t.l.remote,"connecting",(function(){return za(t)})),t.o.D(t.l.remote,"disconnect",(function(){return za(t)}))):"webkitCurrentPlaybackTargetIsWireless"in t.l&&t.o.D(t.l,"webkitcurrentplaybacktargetiswirelesschanged",(function(){return za(t)})),t.F=t.g&&t.g.initData.find((function(e){return 0<e.initData.length}))||null,t.F||"com.apple.fps"!==t.g.keySystem||t.B.size?w(n,Ua(t),2):n.u(2)):(t.o.pa(e,"encrypted",(function(){t.s(new De(2,6,6010))})),n.return());_a(t).catch((function(){})),t.F||t.B.size||t.h.parseInbandPsshEnabled||t.o.D(t.l,"encrypted",(function(e){return function(e,t){return P((function(n){if(1==n.g)return w(n,Ua(e),2);Ba(e,t.initDataType,ge(t.initData)),T(n)}))}(t,e)})),T(n)}))},i.jf=function(){var e=this,t=this.i.keys();return t=ga(t,(function(t){var n=e.i.get(t);return{sessionId:t.sessionId,sessionType:n.type,initData:n.initData,initDataType:n.initDataType}})),Array.from(t)},i.gd=function(){for(var e=1/0,t=this.i.keys(),n=(t=l(t)).next();!n.done;n=t.next())n=n.value,isNaN(n.expiration)||(e=Math.min(e,n.expiration));return e},i.Od=function(){return va(this.ga)};var Qa=1,Za=5,eo=.5;function to(e,t,n){this.g=e,this.i=t,this.h=n}function no(e,t){return P((function(n){if(1==n.g)return w(n,function(e,t,n,i){return n=void 0===n?[]:n,i=void 0===i?{}:i,P((function(r){return 1==r.g?w(r,rr(e,t,0<t.offlineSessionIds.length,n,i),2):(function(e){e.textStreams=e.textStreams.filter((function(e){return Ui(e=xi(e.mimeType,e.codecs))}))}(t),w(r,function(e){var t,n,i,r,a,o,s;return P((function(u){switch(u.g){case 1:t=[],n=l(e.imageStreams),i=n.next();case 2:if(i.done){u.u(4);break}if(r=i.value,"application/mp4"==(a=r.mimeType)&&"mjpg"==r.codecs&&(a="image/jpg"),kr.has(a)){u.u(5);break}if(!(o=Ir.get(a))){kr.set(a,!1),u.u(5);break}return w(u,function(e){return new Promise((function(t){var n=new Image;n.src=e,"decode"in n?n.decode().then((function(){t(!0)})).catch((function(){t(!1)})):n.onload=n.onerror=function(){t(2===n.height)}}))}(o),7);case 7:s=u.h,kr.set(a,s);case 5:kr.get(a)&&t.push(r),i=n.next(),u.u(2);break;case 4:e.imageStreams=t,T(u)}}))}(t),0))}))}(e.h,t,e.g.drm.preferredKeySystems,e.g.drm.keySystemsMapping),2);if(e.g.streaming.dontChooseCodecs||nr(t,e.g.preferredVideoCodecs,e.g.preferredAudioCodecs,e.g.preferredDecodingAttributes,e.g.preferredTextFormats),!t.variants.some(yr))throw new De(2,4,4032);return n.return(ro(e,t))}))}function io(e,t){var n=e.g.restrictions;e=e.i;for(var i=!1,r=(t=l(t.variants)).next();!r.done;r=t.next()){var a=(r=r.value).allowedByApplication;r.allowedByApplication=ir(r,n,e),a!=r.allowedByApplication&&(i=!0)}return i}function ro(e,t){var n=io(e,t);if(t){var i=e.h?e.h.g:null;if(i&&e.h.A)for(var r=l(t.variants),a=r.next();!a.done;a=r.next())a=a.value,ao(e,i.keySystem,a.video),ao(e,i.keySystem,a.audio);oo(e,t)}return n}function ao(e,t,n){if(n)for(var i=(n=l(n.drmInfos)).next();!i.done;i=n.next())if((i=i.value).keySystem==t)for(var r=(i=l(i.initData||[])).next();!r.done;r=i.next())r=r.value,Ba(e.h,r.initDataType,r.initData)}function oo(e,t){e=e.h?e.h.Od():{};var n=Object.keys(e);n=n.length&&"00"==n[0];for(var i=!1,r=!1,a=new Set,o=new Set,s=(t=l(t.variants)).next();!s.done;s=t.next()){var u=[];(s=s.value).audio&&u.push(s.audio),s.video&&u.push(s.video);for(var c=(u=l(u)).next();!c.done;c=u.next())if((c=c.value).keyIds.size)for(var d=(c=l(c.keyIds)).next();!d.done;d=c.next()){d=d.value;var h=e[n?"00":d];h?so.includes(h)&&o.add(h):a.add(d)}s.allowedByApplication?s.allowedByKeySystem&&(i=!0):r=!0}if(!i)throw new De(2,4,4012,e={hasAppRestrictions:r,missingKeys:Array.from(a),restrictedKeyStatuses:Array.from(o)})}var so=["output-restricted","internal-error"];function uo(){}function lo(e,t){if(t){var n=co[t.toLowerCase()];if(n)return n}throw new De(2,4,4e3,e,t)}F("shaka.media.ManifestParser",uo),uo.unregisterParserByMime=function(e){delete co[e]},uo.registerParserByMime=function(e,t){co[e]=t},uo.registerParserByExtension=function(){oe("ManifestParser.registerParserByExtension","Please use an ManifestParser with registerParserByMime function.")},uo.AccessibilityPurpose={hk:"visually impaired",zj:"hard of hearing"};var co={};function ho(e,t,n,i,r){var a=po.value(),o=e.subarray(n.start,n.start+n.size),s=ve(o),u=new Uint8Array(n.size+a.byteLength);for(u.set(o,0),(o=ve(u)).setUint32(4,r),u.set(a,n.size),r=s.getUint32(4),o.setUint32(n.size+16,r),fo(u,0,u.byteLength),r=new Uint8Array(e.byteLength+u.byteLength),n=Ge()||He()?n.start:n.start+n.size,a=e.subarray(n),r.set(e.subarray(0,n)),r.set(u,n),r.set(a,n+u.byteLength),i=(e=l(i)).next();!i.done;i=e.next())fo(r,(i=i.value).start,i.size+u.byteLength);return u=ve(r,t.start),t=Ca(t),e=u.getUint32(t),u.setUint32(t,e+1),r}function fo(e,t,n){0!=(t=(e=ve(e,t)).getUint32(0))&&(1==t?(e.setUint32(8,n>>32),e.setUint32(12,4294967295&n)):e.setUint32(0,n))}var po=new Pe((function(){return new Uint8Array([0,0,0,80,115,105,110,102,0,0,0,12,102,114,109,97,0,0,0,0,0,0,0,20,115,99,104,109,0,0,0,0,99,101,110,99,0,1,0,0,0,0,0,40,115,99,104,105,0,0,0,32,116,101,110,99,0,0,0,0,0,0,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])}));function go(e,t,n,i,r,a,o){this.N=e,this.Ja=t,this.va=n,this.Qc=void 0===i?null:i,this.timescale=void 0===r?null:r,this.g=void 0===a?null:a,this.aesKey=void 0===o?null:o,this.mimeType=this.codecs=null}function mo(e,t){return e===t||(e&&t?e.Zb()==t.Zb()&&e.Xb()==t.Xb()&&Ce(e.N().sort(),t.N().sort())&&fe(e.pc(),t.pc()):e==t)}function vo(e,t,n,i,r,a,o,s,u,c,d,h,f,p,g,m){for(c=void 0===c?[]:c,p=void 0===p?bo:p,this.startTime=e,this.j=this.endTime=t,this.C=n,this.Ja=i,this.va=r,this.ba=a,this.timestampOffset=o,this.appendWindowStart=s,this.appendWindowEnd=u,this.g=c,this.tilesLayout=void 0===d?"":d,this.A=void 0===h?null:h,this.h=void 0===f?null:f,this.status=p,this.preload=!1,this.l=!0,this.m=!1,this.aesKey=void 0===g?null:g,this.thumbnailSprite=null,this.i=-1,this.s=void 0!==m&&m,this.F=this.o=!1,t=(e=l(this.g)).next();!t.done;t=e.next())t.value.Ng();this.s&&this.g.length&&this.g[this.g.length-1].Mg(),this.B=this.bandwidth=this.mimeType=this.codecs=null}function yo(e,t){e.ba=t;for(var n=(e=l(e.g)).next();!n.done;n=e.next())yo(n.value,t)}go.prototype.Zb=function(){return this.Ja},go.prototype.Xb=function(){return this.va},go.prototype.pc=function(){return this.g},F("shaka.media.InitSegmentReference",go),go.prototype.getEndByte=go.prototype.Xb,go.prototype.getStartByte=go.prototype.Zb,(i=vo.prototype).N=function(){return this.C()},i.getStartTime=function(){return this.startTime},i.Ph=function(){return this.endTime},i.Zb=function(){return this.Ja},i.Xb=function(){return this.va},i.hi=function(){return this.tilesLayout},i.gi=function(){return this.A},i.$b=function(){return this.status},i.Ai=function(){this.status=wo},i.Af=function(){this.preload=!0},i.isPreload=function(){return this.preload},i.Pc=function(){this.l=!1},i.si=function(){return this.l},i.Ng=function(){this.o=!0},i.ui=function(){return this.o},i.Mg=function(){this.F=!0},i.ti=function(){return this.F},i.Lg=function(){this.m=!0},i.ni=function(){return this.m},i.qe=function(e){this.thumbnailSprite=e},i.fi=function(){return this.thumbnailSprite},i.offset=function(e){this.startTime+=e,this.endTime+=e,this.j+=e;for(var t=l(this.g),n=t.next();!n.done;n=t.next())(n=n.value).startTime+=e,n.endTime+=e,n.j+=e},i.Yf=function(e){null==this.h?z("Sync attempted without sync time!"):(e=this.h-e-this.startTime,.001<=Math.abs(e)&&this.offset(e))},i.cj=function(e){this.B=e},i.pc=function(){return this.B},F("shaka.media.SegmentReference",vo),vo.prototype.getSegmentData=vo.prototype.pc,vo.prototype.setSegmentData=vo.prototype.cj,vo.prototype.syncAgainst=vo.prototype.Yf,vo.prototype.offset=vo.prototype.offset,vo.prototype.getThumbnailSprite=vo.prototype.fi,vo.prototype.setThumbnailSprite=vo.prototype.qe,vo.prototype.hasByterangeOptimization=vo.prototype.ni,vo.prototype.markAsByterangeOptimization=vo.prototype.Lg,vo.prototype.isLastPartial=vo.prototype.ti,vo.prototype.markAsLastPartial=vo.prototype.Mg,vo.prototype.isPartial=vo.prototype.ui,vo.prototype.markAsPartial=vo.prototype.Ng,vo.prototype.isIndependent=vo.prototype.si,vo.prototype.markAsNonIndependent=vo.prototype.Pc,vo.prototype.isPreload=vo.prototype.isPreload,vo.prototype.markAsPreload=vo.prototype.Af,vo.prototype.markAsUnavailable=vo.prototype.Ai,vo.prototype.getStatus=vo.prototype.$b,vo.prototype.getTileDuration=vo.prototype.gi,vo.prototype.getTilesLayout=vo.prototype.hi,vo.prototype.getEndByte=vo.prototype.Xb,vo.prototype.getStartByte=vo.prototype.Zb,vo.prototype.getEndTime=vo.prototype.Ph,vo.prototype.getStartTime=vo.prototype.getStartTime,vo.prototype.getUris=vo.prototype.N;var bo=0,wo=1;function To(e){return 1==e.length&&1e-4>e.end(0)-e.start(0)}function So(e){return!e||To(e)?null:e.length?e.end(e.length-1):null}function xo(e,t){return!(!e||!e.length||To(e)||t>e.end(e.length-1))&&t>=e.start(0)}function Ao(e,t){if(!e||!e.length||To(e))return 0;for(var n=0,i=(e=l(Eo(e))).next();!i.done;i=e.next()){var r=i.value;i=r.start,(r=r.end)>t&&(n+=r-Math.max(i,t))}return n}function Eo(e){if(!e)return[];for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}function ko(){}function Io(e,t){var n=document.createElement("source");return n.src=e,n.type=void 0===t?"":t,n}function Mo(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Co(){}function Do(e,t){return t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&255>e[t+3]&&255>e[t+4]&&128>e[t+6]&&128>e[t+7]&&128>e[t+8]&&128>e[t+9]}function Ro(e,t){return t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&255>e[t+3]&&255>e[t+4]&&128>e[t+6]&&128>e[t+7]&&128>e[t+8]&&128>e[t+9]}function Po(e,t){var n=(127&e[t])<<21;return n|=(127&e[t+1])<<14,(n|=(127&e[t+2])<<7)|127&e[t+3]}function Lo(e){var t={key:e.type,description:"",data:"",mimeType:null,pictureType:null};if("APIC"===e.type){if(2>e.size||3!==e.data[0])return null;var n=e.data.subarray(1).indexOf(0);if(-1===n)return null;var i=dt(ge(e.data,1,n)),r=e.data[2+n],a=e.data.subarray(3+n).indexOf(0);if(-1===a)return null;var o,s=dt(ge(e.data,3+n,a));return o="--\x3e"===i?dt(ge(e.data,4+n+a)):pe(e.data.subarray(4+n+a)),t.mimeType=i,t.pictureType=r,t.description=s,t.data=o,t}return"TXXX"===e.type||"WXXX"===e.type?2>e.size||3!==e.data[0]||-1===(i=e.data.subarray(1).indexOf(0))?null:(n=dt(ge(e.data,1,i)),e=dt(ge(e.data,2+i)).replace(/\0*$/,""),t.description=n,t.data=e,t):"PRIV"===e.type?2>e.size||-1===(n=e.data.indexOf(0))?null:(n=dt(ge(e.data,0,n)),t.description=n,"com.apple.streaming.transportStreamTimestamp"==n?(n=e.data.subarray(n.length+1),e=1&n[3],n=(n[4]<<23)+(n[5]<<15)+(n[6]<<7)+n[7],n/=45,e&&(n+=47721858.84),t.data=n):(e=pe(e.data.subarray(n.length+1)),t.data=e),t):"T"===e.type[0]?2>e.size||3!==e.data[0]?null:(e=dt(e.data.subarray(1)).replace(/\0*$/,""),t.data=e,t):"W"===e.type[0]?(e=dt(e.data).replace(/\0*$/,""),t.data=e,t):e.data?(t.data=pe(e.data),t):null}function No(e){for(var t=0,n=[];Do(e,t);){var i=Po(e,t+6);for(e[t+5]>>6&1&&(t+=10),i=(t+=10)+i;t+10<i;){var r=e.subarray(t),a=Po(r,4);(a=Lo(r={type:String.fromCharCode(r[0],r[1],r[2],r[3]),size:a,data:r.subarray(10,10+a)}))&&n.push(a),t+=r.size+10}Ro(e,t)&&(t+=10)}return n}function jo(e,t){for(var n=t=void 0===t?0:t,i=0;Do(e,t);)e[t+5]>>6&1&&(i+=10),i+=10,i+=Po(e,t+6),Ro(e,t+10)&&(i+=10),t+=i;return 0<i?e.subarray(n,n+i):new Uint8Array([])}function Oo(e,t){var n=null,i=null,r=null,a=e.P();return 1&t&&(r=e.Vc()),2&t&&e.skip(4),8&t&&(n=e.P()),16&t&&(i=e.P()),{trackId:a,ed:n,Ld:i,jk:r}}function Uo(e,t){return 1==t?(t=e.P(),e=e.P(),{baseMediaDecodeTime:t*Math.pow(2,32)+e}):{baseMediaDecodeTime:e.P()}}function _o(e,t){return 1==t?(e.skip(8),e.skip(8)):(e.skip(4),e.skip(4)),t=e.P(),e.skip(4),e=e.ma(),{timescale:t,language:String.fromCharCode(96+(e>>10))+String.fromCharCode(96+((960&e)>>5))+String.fromCharCode(96+(31&e))}}function Bo(e,t,n){var i=e.P(),r=[],a=null;1&n&&(a=e.P()),4&n&&e.skip(4);for(var o=0;o<i;o++){var s={Of:null,sampleSize:null,me:null};256&n&&(s.Of=e.P()),512&n&&(s.sampleSize=e.P()),1024&n&&e.skip(4),2048&n&&(s.me=0==t?e.P():e.Vg()),r.push(s)}return{nk:i,Zg:r,Ih:a}}function Fo(e){e.skip(6),e.skip(2),e.skip(8);var t=e.ma();return e.skip(2),e.skip(2),e.skip(2),{channelCount:t,sampleRate:e=e.ma()+e.ma()/65536}}function Vo(e){return{codec:Ma(e=e.P())}}function Ho(e,t){return t=void 0!==t&&t,e=e.toString(16).toUpperCase(),t?e:("0"+e).slice(-2)}function Go(e){return(10>e?"0":"")+e}function Ko(e,t){if(this.j=e,void 0!==t&&t){t=new Uint8Array(e.byteLength);for(var n=0,i=0;i<e.byteLength;i++)2<=i&&3==e[i]&&0==e[i-1]&&0==e[i-2]||(t[n]=e[i],n++);this.j=ge(t,0,n)}this.i=this.j.byteLength,this.g=this.h=0}function Xo(e){var t=e.j.byteLength-e.i,n=new Uint8Array(4),i=Math.min(4,e.i);0!==i&&(n.set(e.j.subarray(t,t+i)),e.h=new ya(n,0).P(),e.g=8*i,e.i-=i)}function qo(e,t){if(e.g<=t){t-=e.g;var n=Math.floor(t/8);t-=8*n,e.g-=n,Xo(e)}e.h<<=t,e.g-=t}function zo(e,t){var n=Math.min(e.g,t),i=e.h>>>32-n;return e.g-=n,0<e.g?e.h<<=n:0<e.i&&Xo(e),0<(n=t-n)?i<<n|zo(e,n):i}function Wo(e){var t;for(t=0;t<e.g;++t)if(e.h&2147483648>>>t)return e.h<<=t,e.g-=t,t;return Xo(e),t+Wo(e)}function Yo(e){qo(e,1+Wo(e))}function Jo(e){return zo(e,Wo(e)+1)-1}function $o(e){return 1&(e=Jo(e))?1+e>>>1:-1*(e>>>1)}function Qo(e){return 1===zo(e,1)}function Zo(e){return zo(e,8)}function es(e,t){for(var n=8,i=8,r=0;r<t;r++)0!==i&&(i=(n+(i=$o(e))+256)%256),n=0===i?n:i}function ts(e){return Zo(e),Jo(e),Jo(e)}function ns(){this.G=null,this.H=!1,this.m=this.I=null,this.j=[],this.g=[],this.A=this.B=null,this.i=[],this.h=[],this.C=null,this.l=[],this.F=this.o=this.s=null}function is(e,t){if(1!=(t[0]<<16|t[1]<<8|t[2]))return null;var n={data:new Uint8Array(0),packetLength:t[4]<<8|t[5],pts:null,dts:null,nalus:[]};if(n.packetLength&&n.packetLength>t.byteLength-6)return null;var i=t[7];if(192&i){var r=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2;null==e.s&&(e.s=r),n.pts=as(r,e.s),e.s=n.pts,n.dts=n.pts,64&i&&(i=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2,null==e.o&&(e.o=i),n.dts=as(i,e.o)),e.o=n.dts}return e=t[8]+9,t.byteLength<=e?null:(n.data=t.subarray(e),n)}function rs(e){var t=e.sc();return 1<t.length&&(e=t[0].pts,t=t[1].pts,!isNaN(t-e))?String(1/(t-e)*9e4):null}function as(e,t){var n=1;for(e>t&&(n=-1);4294967296<Math.abs(t-e);)e+=8589934592*n;return e}function os(e){return!(0>ss(e))}function ss(e){for(var t=Math.min(1e3,e.length-564),n=0;n<t;){if(71==e[n]&&71==e[n+188]&&71==e[n+376])return n;n++}return-1}vo.Status={lj:bo,fk:wo,Hj:2},F("shaka.util.Dom",ko),ko.removeAllChildren=Mo,F("shaka.util.Id3Utils",Co),Co.getID3Data=jo,Co.getID3Frames=No,F("shaka.util.ExpGolomb",Ko),(i=ns.prototype).clearData=function(){this.j=[],this.g=[],this.i=[],this.h=[],this.l=[]},i.parse=function(e){if(564>e.length)return this;for(var t=Math.max(0,ss(e)),n=e.length-(e.length+t)%188,i=!1,r=t;r<n;r+=188)if(71==e[r]){var a=!!(64&e[r+1]),o=((31&e[r+1])<<8)+e[r+2];if(1<(48&e[r+3])>>4){var s=r+5+e[r+4];if(s==r+188)continue}else s=r+4;switch(o){case 0:a&&(s+=e[s]+1),this.G=(31&e[s+10])<<8|e[s+11];break;case 17:case 8191:break;case this.G:a&&(s+=e[s]+1),o={audio:-1,video:-1,Td:-1,audioCodec:"",videoCodec:""};var u=s+3+((15&(a=e)[s+1])<<8|a[s+2])-4;for(s+=12+((15&a[s+10])<<8|a[s+11]);s<u;){var l=(31&a[s+1])<<8|a[s+2],c=(15&a[s+3])<<8|a[s+4];switch(a[s]){case 6:if(0<c)for(var d=s+5,h=c;2<h;){var f=a[d+1]+2;switch(a[d]){case 5:var p=mt(a.subarray(d+2,d+f));-1==o.audio&&"Opus"===p?(o.audio=l,o.audioCodec="opus"):-1==o.video&&"AV01"===p&&(o.video=l,o.videoCodec="av1");break;case 106:-1==o.audio&&(o.audio=l,o.audioCodec="ac3");break;case 122:-1==o.audio&&(o.audio=l,o.audioCodec="ec3");break;case 124:-1==o.audio&&(o.audio=l,o.audioCodec="aac");break;case 127:"opus"==o.audioCodec&&(p=null,128===a[d+2]&&(p=a[d+3]),null!=p&&(this.F={channelCount:15&p?15&p:2,Fh:p,sampleRate:48e3}))}d+=f,h-=f}break;case 15:-1==o.audio&&(o.audio=l,o.audioCodec="aac");break;case 17:-1==o.audio&&(o.audio=l,o.audioCodec="aac-loas");break;case 21:-1==o.Td&&(o.Td=l);break;case 27:-1==o.video&&(o.video=l,o.videoCodec="avc");break;case 3:case 4:-1==o.audio&&(o.audio=l,o.audioCodec="mp3");break;case 36:-1==o.video&&(o.video=l,o.videoCodec="hvc");break;case 129:-1==o.audio&&(o.audio=l,o.audioCodec="ac3");break;case 132:case 135:-1==o.audio&&(o.audio=l,o.audioCodec="ec3")}s+=c+5}-1!=(a=o).video&&(this.I=a.video,this.m=a.videoCodec),-1!=a.audio&&(this.B=a.audio,this.A=a.audioCodec),-1!=a.Td&&(this.C=a.Td),i&&!this.H&&(i=!1,r=t-188),this.H=!0;break;case this.I:s=e.subarray(s,r+188),a?this.j.push([s]):this.j.length&&this.j[this.j.length-1]&&this.j[this.j.length-1].push(s);break;case this.B:s=e.subarray(s,r+188),a?this.i.push([s]):this.i.length&&this.i[this.i.length-1]&&this.i[this.i.length-1].push(s);break;case this.C:s=e.subarray(s,r+188),a?this.l.push([s]):this.l.length&&this.l[this.l.length-1]&&this.l[this.l.length-1].push(s);break;default:i=!0}}return this},i.Gi=function(e){return oe("TsParser.parseAvcNalus","Please use parseNalus function instead."),this.Gf(e)},i.Gf=function(e,t,n){var i=e.pts?e.pts/9e4:null,r=(e=e.data).byteLength,a=1;"hvc"==this.m&&(a=2);for(var o,s=n||0,u=[],l=-1,c=0,d=0;d<r;++d){var h=e[d];if(h){if(2<=s&&1==h){if(t&&!u.length&&-1==l&&(h=d-(3<s?3:s),n&&0!=h&&(h=e.subarray(0,h),t.data=di(t.data,h),t.fullData=di(t.fullData,h))),0<=l?(s=d-((3<s?3:s)+1),u.push({data:e.subarray(l+a,s+1),fullData:e.subarray(l,s+1),type:c,time:i})):t&&!u.length&&0<(l=d-s)&&(l=e.subarray(0,l),t.data=di(t.data,l),t.fullData=di(t.fullData,l)),d>=r-a)return u;l=++d,c="hvc"==this.m?e[d]>>1&63:31&e[d]}s=0}else s++;d>=r-1&&0<=l&&0<=s&&(o={data:e.subarray(l+a,r),fullData:e.subarray(l,r),type:c,time:i})}return o&&u.push(o),!u.length&&t&&(t.data=di(t.data,e),t.fullData=di(t.fullData,e)),u},i.getMetadata=function(){for(var e=[],t=l(this.l),n=t.next();!n.done;n=t.next())(n=is(this,n=di.apply(ai,c(n.value))))&&e.push({cueTime:n.pts?n.pts/9e4:null,data:n.data,frames:No(n.data),dts:n.dts,pts:n.pts});return e},i.Wb=function(){if(this.i.length&&!this.h.length){for(var e=!1,t=l(this.i),n=t.next();!n.done;n=t.next()){var i=di.apply(ai,c(n.value)),r=is(this,i);n=this.h.length?this.h[this.h.length-1]:null,r&&null!=r.pts&&null!=r.dts&&(!n||n.pts!=r.pts&&n.dts!=r.dts)?(this.h.length&&r.dts<(n.dts||0)&&(e=!0),this.h.push(r)):this.h.length&&(i=r?r.data:i)&&((n=this.h.pop()).data=di(n.data,i),this.h.push(n))}e&&(this.h=this.h.sort((function(e,t){var n=(e.pts||0)-(t.pts||0);return(e.dts||0)-(t.dts||0)||n})))}return this.h},i.sc=function(e){if(e=void 0===e||e,this.j.length&&!this.g.length){for(var t=!1,n=l(this.j),i=n.next();!i.done;i=n.next()){var r=di.apply(ai,c(i.value)),a=is(this,r);i=this.g.length?this.g[this.g.length-1]:null,a&&null!=a.pts&&null!=a.dts&&(!i||i.pts!=a.pts&&i.dts!=a.dts)?(this.g.length&&a.dts<(i.dts||0)&&(t=!0),this.g.push(a)):this.g.length&&(r=a?a.data:r)&&((i=this.g.pop()).data=di(i.data,r),this.g.push(i))}if(e){for(n=[],r=(i=l(this.g)).next();!r.done;r=i.next())if((r=r.value).nalus=this.Gf(r,o,void 0),r.nalus.length){n.push(r);var o=r.nalus[r.nalus.length-1]}this.g=n}t&&(this.g=this.g.sort((function(e,t){var n=(e.pts||0)-(t.pts||0);return(e.dts||0)-(t.dts||0)||n})))}return e?this.g:(e=this.g,this.g=[],e)},i.getStartTime=function(e){if("audio"==e){e=null;var t=this.Wb();return t.length&&(e=t[0],e=Math.min(e.dts,e.pts)/9e4),e}return"video"==e?(e=null,(t=this.sc(!1)).length&&(e=t[0],e=Math.min(e.dts,e.pts)/9e4),e):null},i.fd=function(){return{audio:this.A,video:this.m}},i.Rd=function(){for(var e=[],t=l(this.sc()),n=t.next();!n.done;n=t.next())e.push.apply(e,c(n.value.nalus));return e},i.ki=function(){oe("TsParser.getVideoResolution","Please use getVideoInfo function instead.");var e=this.nf();return{height:e.height,width:e.width}},i.nf=function(){return"hvc"==this.m?function(e){var t={height:null,width:null,codec:null,frameRate:null},n=e.Rd();if(!n.length)return t;if(!(n=n.find((function(e){return 33==e.type}))))return t;var i=new Ko(n.fullData,!0);Zo(i),Zo(i),zo(i,4);var r=zo(i,3);Qo(i);var a=zo(i,2),o=zo(i,1),s=zo(i,5),u=zo(i,32);n=Zo(i);for(var l=Zo(i),c=Zo(i),d=Zo(i),h=Zo(i),f=Zo(i),p=Zo(i),g=[],m=[],v=0;v<r;v++)g.push(Qo(i)),m.push(Qo(i));if(0<r)for(v=r;8>v;v++)zo(i,2);for(v=0;v<r;v++)g[v]&&zo(i,88),m[v]&&Zo(i);Jo(i),3==(r=Jo(i))&&zo(i,1),g=Jo(i),m=Jo(i);var y=v=0,b=0,w=0;return Qo(i)&&(v+=Jo(i),y+=Jo(i),b+=Jo(i),w+=Jo(i)),t.width=String(g-(v+y)*(1===r||2===r?2:1)),t.height=String(m-(b+w)*(1===r?2:1)),i=function(e){for(var t=0,n=0;32>n;n++)t|=(e>>n&1)<<31-n;return t>>>0}(u),o=1==o?"H":"L",a="hvc1."+["","A","B","C"][a]+s,a+="."+i.toString(16).toUpperCase(),a+="."+o+p,f&&(a+="."+f.toString(16).toUpperCase()),h&&(a+="."+h.toString(16).toUpperCase()),d&&(a+="."+d.toString(16).toUpperCase()),c&&(a+="."+c.toString(16).toUpperCase()),l&&(a+="."+l.toString(16).toUpperCase()),n&&(a+="."+n.toString(16).toUpperCase()),t.codec=a,t.frameRate=rs(e),t}(this):function(e){var t={height:null,width:null,codec:null,frameRate:null},n=e.Rd();if(!n.length)return t;if(!(n=n.find((function(e){return 7==e.type}))))return t;var i=Zo(n=new Ko(n.data)),r=Zo(n),a=Zo(n);if(Yo(n),us.includes(i)){var o=Jo(n);if(3===o&&qo(n,1),Yo(n),Yo(n),qo(n,1),Qo(n)){o=3!==o?8:12;for(var s=0;s<o;s++)Qo(n)&&es(n,6>s?16:64)}}if(Yo(n),0===(o=Jo(n)))Jo(n);else if(1===o)for(qo(n,1),Yo(n),Yo(n),o=Jo(n),s=0;s<o;s++)Yo(n);Yo(n),qo(n,1),o=Jo(n),s=Jo(n);var u=zo(n,1);0===u&&qo(n,1),qo(n,1);var l=0,c=0,d=0,h=0;return Qo(n)&&(l=Jo(n),c=Jo(n),d=Jo(n),h=Jo(n)),t.height=String((2-u)*(s+1)*16-2*d-2*h),t.width=String(16*(o+1)-2*l-2*c),t.codec="avc1."+("0"+i.toString(16).toUpperCase()).slice(-2)+("0"+r.toString(16).toUpperCase()).slice(-2)+("0"+a.toString(16).toUpperCase()).slice(-2),t.frameRate=rs(e),t}(this)},F("shaka.util.TsParser",ns),ns.syncOffset=ss,ns.probe=os,ns.prototype.getVideoInfo=ns.prototype.nf,ns.prototype.getVideoResolution=ns.prototype.ki,ns.prototype.getVideoNalus=ns.prototype.Rd,ns.prototype.getCodecs=ns.prototype.fd,ns.prototype.getStartTime=ns.prototype.getStartTime,ns.prototype.getVideoData=ns.prototype.sc,ns.prototype.getAudioData=ns.prototype.Wb,ns.prototype.getMetadata=ns.prototype.getMetadata,ns.prototype.parseNalus=ns.prototype.Gf,ns.prototype.parseAvcNalus=ns.prototype.Gi,ns.prototype.parse=ns.prototype.parse,ns.prototype.clearData=ns.prototype.clearData,ns.Timescale=9e4;var us=[100,110,122,244,44,83,86,118,128,138,139,134];function ls(e,t,n){this.g=null,this.o=-1,this.l=e,this.i=t,this.m=n,this.j=!1;e:{if("undefined"==typeof libDPIModule&&W("Could not find LCEVC Library dependencies on this page"),"undefined"!=typeof LCEVCdec)this.h=LCEVCdec;else{if("undefined"==typeof LcevcDil){W("Could not find LCEVC Library on this page"),e=!1;break e}this.h=LcevcDil,this.j=!0,oe("LcevcDil","lcevc_dil.js is deprecated, please use lcevc_dec.js instead")}void 0===this.h.SupportObject?(W("Could not find LCEVC Library on this page"),e=!1):(this.h.SupportObject.SupportStatus||W(this.h.SupportObject.SupportError),e=void 0!==this.h&&"undefined"!=typeof libDPIModule&&this.i instanceof HTMLCanvasElement&&this.h.SupportObject.SupportStatus)}e&&!this.g&&this.h.SupportObject.webGLSupport(this.i)&&(this.i.classList.remove("shaka-hidden"),this.g=this.j?new this.h.LcevcDil(this.l,this.i,this.m):new this.h.LCEVCdec(this.l,this.i,this.m))}function cs(e){e.g&&e.i.classList.add("shaka-hidden")}function ds(e,t,n){var i=0,r=-1;switch(t.mimeType){case"video/webm":i=1;break;case"video/mp4":i=2}switch(n){case"DASH":r=1;break;case"HLS":r=0}e.g&&(e.o=t.id,e.g.setLevelSwitching(t.id,!0),e.g.setContainerFormat(i),e.j||e.g.setStreamingFormat(r))}function hs(e,t,n,i){var r=this;this.g=e,this.F=n,this.A=null,this.fa=t,this.i={},this.G={},this.Ka={},this.h=null,this.xa=!1,this.da=i||null,this.o={},this.s=new Z,this.j={},this.H=null,this.S=new Gr,this.Aa="",this.Na=!1,this.ta=!0,this.Z=!1,this.B=this.K=null,this.l=fs(this,this.S),this.I=!1,this.L=new fa((function(){return function(e){var t,n,i,r,a,o,s;return P((function(u){if(1==u.g){for(n in t=[],e.o)for(i=e.o[n],r=i[0],e.o[n]=i.slice(0,1),r&&t.push(r.p.catch(Hi)),a=l(i.slice(1)),o=a.next();!o.done;o=a.next())o.value.p.reject(new De(2,7,7003,void 0));return e.h&&t.push(e.h.destroy()),w(u,Promise.all(t),2)}for(s in e.j)e.j[s].destroy();e.s&&(e.s.release(),e.s=null),e.g&&e.B&&e.g.removeChild(e.B),e.g&&e.K&&(e.g.removeChild(e.K),e.g.load(),e.g.disableRemotePlayback=!1),e.g=null,e.K=null,e.B=null,e.A=null,e.l=null,e.h=null,e.fa=null,e.i={},e.j={},e.H=null,e.o={},e.da=null,e.Y={},e.F=null,T(u)}))}(r)})),this.C=!1,this.aa="UNKNOWN",this.Ga=this.La=!1,this.Ba=new Gr,this.m=!1,this.na=null,this.Y={},this.ja=this.M=this.ra=this.O=null,this.ga=new Gr,this.g.remote&&(this.Z="disconnected"!=this.g.remote.state,this.s.D(this.g.remote,"connect",(function(){r.Z="disconnected"!=r.g.remote.state})),this.s.D(this.g.remote,"connecting",(function(){r.Z="disconnected"!=r.g.remote.state})),this.s.D(this.g.remote,"disconnect",(function(){r.Z="disconnected"!=r.g.remote.state})))}function fs(t,n){if(t.ta=!0,e.ManagedMediaSource){t.B||(t.g.disableRemotePlayback=!0);var i=new ManagedMediaSource;t.s.D(i,"startstreaming",(function(){t.ta=!0})),t.s.D(i,"endstreaming",(function(){t.ta=!1}))}else i=new MediaSource;return t.s.pa(i,"sourceopen",(function(){URL.revokeObjectURL(t.Aa),n.resolve()})),t.s.pa(t.g,"playing",(function(){t.Na=!0})),t.Aa=Rs(i),t.g.removeAttribute("src"),t.K&&t.g.removeChild(t.K),t.B&&t.g.removeChild(t.B),t.K=Io(t.Aa),t.g.appendChild(t.K),t.B&&t.g.appendChild(t.B),t.g.load(),i}function ps(e,t,n,i){var r,a,o,s,u,c,d,h,f,p,g,m;return P((function(v){switch(v.g){case 1:return r=bi,a=V,o=H,w(v,function(e,t){var n,i,r,a,o,s,u,c,d,h;return P((function(f){if(1==f.g)return e.createSegmentIndex?w(f,e.createSegmentIndex(),2):f.u(2);if(!e.segmentIndex)return f.return(!1);if(0==e.segmentIndex.getNumReferences())return f.return(!0);for(n=bi,i=new Set,r=l(e.segmentIndex),a=r.next();!a.done;a=r.next())if(o=a.value,s=o.mimeType||e.mimeType||"",u=o.codecs||e.codecs||"",c=s+":"+u,!i.has(c))if(i.add(c),t==n.wa){if(!Ui(xi(s,u)))return f.return(!1)}else if(t==n.la?u=cr(u):t==n.V&&(u=lr(u,s)),d=ki(e,s,u),h=Ai(s,u),!ne(d)&&!On(h))return f.return(!1);return f.return(!0)}))}(n,t),2);case 2:if(o.call(a,v.h,"Type negotiation should happen before MediaSourceEngine.init!"),s=xi(n.mimeType,i),t==r.wa){gs(e,s,e.C,n.external),v.u(0);break}if(u=e.A.forceTransmux,(!ne(s)||!e.C&&ji.includes(s))&&(u=!0),c=Ai(n.mimeType,i),!u){v.u(4);break}if(d=mi(r.V,(i||"").split(",")),h=mi(r.la,(i||"").split(",")),!d||!h){v.u(5);break}return e.m=!0,w(v,ps(e,r.V,n,d),6);case 6:return w(v,ps(e,r.la,n,h),7);case 7:return v.return();case 5:(f=On(c))&&(p=f(),e.j[t]=p,s=p.convertCodecs(t,c));case 4:g=s+e.A.addExtraFeaturesToSourceBuffer(s),pa(e.L);try{m=e.l.addSourceBuffer(g)}catch(t){throw new De(2,3,3015,t,"The mediaSource_ status was "+e.l.readyState+" expected 'open'",null)}e.C&&(m.mode=Ps),e.s.D(m,"error",(function(){var n=e.o[t][0];n.p.reject(new De(2,3,3014,e.g.error?e.g.error.code:0,n.uri))})),e.s.D(m,"updateend",(function(){return Es(e,t)})),e.i[t]=m,e.G[t]=s,e.Ka[t]=!!n.drmInfos.length,T(v)}}))}function gs(e,t,n,i){e.h||(e.h=new Oi(e.fa),e.h&&(e.h.A=e.A.modifyCueCallback));var r=e.h;i=i||e.xa,e=e.aa,"application/cea-608"==t||"application/cea-708"==t?r.i=null:(r.i=(0,Fi[t])(),r.i.setSequenceMode?r.i.setSequenceMode(n):oe("Text parsers w/ setSequenceMode",'Text parsers should have a "setSequenceMode" method!'),r.i.setManifestType?r.i.setManifestType(e):oe("Text parsers w/ setManifestType",'Text parsers should have a "setManifestType" method!'),r.B=i)}function ms(e){return!(e.I||e.l&&"ended"!=e.l.readyState)}function vs(e,t){return e=Object.keys(e.i).length?t==yi?e.h.g:!(e=bs(e,t))||To(e)?null:1==e.length&&0>e.start(0)?0:e.length?e.start(0):null:null}function ys(e,t){return Object.keys(e.i).length?t==yi?e.h.h:So(bs(e,t)):null}function bs(e,t){if(e.I||e.Z)return null;try{return e.i[t].buffered}catch(e){return null}}function ws(e,t,n,i,r,a,o,s,u,c){var d,h,f,p,g,m,v,y,b,S,x,A,E,k;return o=void 0!==o&&o,s=void 0!==s&&s,u=void 0!==u&&u,c=void 0!==c&&c,P((function(I){switch(I.g){case 1:if(t!=(d=bi).wa){I.u(2);break}if("HLS"!=e.aa){I.u(3);break}return w(I,e.Ba,4);case 4:h=I.h,e.h.s=h;case 3:return w(I,function(e,t,n,i,r){var a,o,s,u,c,d,h;return P((function(f){if(1==f.g)return w(f,Promise.resolve(),2);if(!e.i||!e.j)return f.return();if(null==n||null==i)return e.i.parseInit(ge(t)),f.return();for(a=e.B?n:e.s,o={periodStart:e.s,segmentStart:n,segmentEnd:i,vttOffset:a},s=e.i.parseMedia(ge(t),o,r,[]),u=l(s),c=u.next();!c.done;c=u.next())d=c.value,e.A(d,r||null,o);h=s.filter((function(t){return t.startTime>=e.l&&t.startTime<e.m})),e.j.append(h),null==e.g&&(e.g=Math.max(n,e.l)),e.h=Math.min(i,e.m),T(f)}))}(e.h,n,i?i.startTime:null,i?i.endTime:null,i?i.N()[0]:null),5);case 5:return I.return();case 2:if(c||!e.m){I.u(6);break}return w(I,ws(e,d.V,n,i,r,a,o,s,u,!0),7);case 7:return w(I,ws(e,d.la,n,i,r,a,o,s,u,!0),8);case 8:return I.return();case 6:if(!e.i[t])return I.return();if(f=e.i[t].timestampOffset,p=e.G[t],e.j[t]&&(p=e.j[t].getOriginalMimeType()),i&&(g=function(e,t,n,i,r,a){var o=null,s=[],u=ge(n);if(ji.includes(a))(t=No(u)).length&&i&&((n=t.find((function(e){return"com.apple.streaming.transportStreamTimestamp"===e.description})))&&(o=Math.round(n.data)/1e3),e.F.onMetadata([{cueTime:i.startTime,data:u,frames:t,dts:i.startTime,pts:i.startTime}],0,i.endTime));else if(a.includes("/mp4")&&i&&i.ba&&i.ba.timescale){var l=i.ba.timescale;if(!isNaN(l)){var c=0,d=!1;u=new Ta,(null!=r.emsgSchemeIdUris&&0<r.emsgSchemeIdUris.length||e.A.dispatchAllEmsgBoxes)&&u.R("emsg",(function(t){var n=r.emsgSchemeIdUris;if(0===t.version)var a=t.reader.yc(),o=t.reader.yc(),s=t.reader.P(),u=t.reader.P(),l=t.reader.P(),c=t.reader.P(),d=i.startTime+u/s;else s=t.reader.P(),u=(d=t.reader.Vc()/s+i.timestampOffset)-i.startTime,l=t.reader.P(),c=t.reader.P(),a=t.reader.yc(),o=t.reader.yc();t=t.reader.vb(t.reader.getLength()-t.reader.ya()),(n&&n.includes(a)||e.A.dispatchAllEmsgBoxes)&&("urn:mpeg:dash:event:2012"==a?e.F.Fi():(n=d+l/s,(s=new Jr("emsg",s=(new Map).set("detail",{startTime:d,endTime:n,schemeIdUri:a,value:o,timescale:s,presentationTimeDelta:u,eventDuration:l,id:c,messageData:t}))).cancelable=!0,e.F.onEvent(s),s.defaultPrevented||"https://aomedia.org/emsg/ID3"!=a&&"https://developer.apple.com/streaming/emsg-id3"!=a||!(a=No(t)).length||e.F.onMetadata([{cueTime:d,data:t,frames:a,dts:d,pts:d}],0,n)))})),u.R("prft",(function(t){var n=t.reader,i=t.version;n.P(),t=1e3*(t=n.P())+n.P()/Math.pow(2,32)*1e3,0===i?n=n.P():(i=n.P(),n=n.P(),n=i*Math.pow(2,32)+n),t=new Date(new Date(Date.UTC(1900,0,1,0,0,0)).getTime()+t).getTime(),n=new Jr("prft",n=(new Map).set("detail",{wallClockTime:t,programStartDate:new Date(t-n/l*1e3)})),e.F.onEvent(n)})).box("moof",Sa).box("traf",Sa).R("tfdt",(function(e){c=Uo(e.reader,e.version).baseMediaDecodeTime/l,d=!0,e.parser.stop()})).parse(n,!0),d&&0==i.timestampOffset&&(o=c)}}else a.includes("/mp4")||a.includes("/webm")||!os(u)||(e.Y[t]?e.Y[t].clearData():e.Y[t]=new ns,null!=(u=(s=e.Y[t].parse(u)).getStartTime(t))&&(o=u),s=s.getMetadata());return{timestamp:o,metadata:s}}(e,t,n,i,r,p),m=g.timestamp,v=g.metadata,null!=m&&(null==e.O&&t==d.la&&(e.O=m,e.ra=i.startTime,null!=e.M&&(y=0,e.ra==e.ja&&(y=e.O-e.M),e.ga.resolve(y))),null==e.M&&t==d.V&&(e.M=m,e.ja=i.startTime,null!=e.O&&(b=0,e.ra==e.ja&&(b=e.O-e.M),e.ga.resolve(b))),S=i.startTime-m,(.001<=Math.abs(f-S)||o||s)&&(!u||0<S||!f)&&(f=S,e.Ga&&(ks(e,t,(function(){return xs(e,t)}),null),ks(e,t,(function(){return As(e,t,f)}),null))),(t==d.la||!(d.la in e.i))&&e.Ba.resolve(f)),v.length)&&e.F.onMetadata(v,f,i?i.endTime:null),a&&t==d.la&&(e.h||gs(e,"application/cea-608",e.C,!1),e.H||(x=p.split(";",1)[0],e.H=new we(x)),i?(A=e.H.i(n)).length&&function(e,t,n,i,r){for(var a=n+" "+i,o=new Map,s=(t=l(t)).next();!s.done;s=t.next()){var u=s.value;s=u.stream,u=u.cue,o.has(s)||o.set(s,new Map),o.get(s).has(a)||o.get(s).set(a,[]),Bi(e,u,r),u.startTime>=e.l&&u.startTime<e.m&&(o.get(s).get(a).push(u),s==e.C&&e.j.append([u]))}for(a=(r=l(o.keys())).next();!a.done;a=r.next())for(a=a.value,e.o.has(a)||e.o.set(a,new Map),s=(t=l(o.get(a).keys())).next();!s.done;s=t.next())s=s.value,u=o.get(a).get(s),e.o.get(a).set(s,u);e.g=null==e.g?Math.max(n,e.l):Math.min(e.g,Math.max(n,e.l)),e.h=Math.max(e.h,Math.min(i,e.m))}(e.h,A,i.startTime,i.endTime,f):e.H.init(n,s)),!e.j[t]){I.u(9);break}return w(I,e.j[t].transmux(n,r,i,e.l.duration,t),10);case 10:n=I.h;case 9:if(n=function(e,t,n,i,r){var a=null==n,o=e.Ka[i];return n=e.F.Uh(),(a=e.A.insertFakeEncryptionInInit&&a&&o)&&(n=je(n),a=Ke()||Ge()||Ze()||He()&&tt()&&n),a&&"mp4"==Ii(e.G[i])&&(t=function(e,t){function n(){o=!0}function i(e){s.push(e),Sa(e)}var r,a=e=ge(e),o=!1,s=[],u=[];if((new Ta).box("moov",i).box("trak",i).box("mdia",i).box("minf",i).box("stbl",i).R("stsd",(function(e){r=e,s.push(e),xa(e)})).R("encv",n).R("enca",n).R("dvav",(function(e){u.push({box:e,Ta:1701733238})})).R("dva1",(function(e){u.push({box:e,Ta:1701733238})})).R("dvh1",(function(e){u.push({box:e,Ta:1701733238})})).R("dvhe",(function(e){u.push({box:e,Ta:1701733238})})).R("dvc1",(function(e){u.push({box:e,Ta:1701733238})})).R("dvi1",(function(e){u.push({box:e,Ta:1701733238})})).R("hev1",(function(e){u.push({box:e,Ta:1701733238})})).R("hvc1",(function(e){u.push({box:e,Ta:1701733238})})).R("avc1",(function(e){u.push({box:e,Ta:1701733238})})).R("avc3",(function(e){u.push({box:e,Ta:1701733238})})).R("ac-3",(function(e){u.push({box:e,Ta:1701733217})})).R("ec-3",(function(e){u.push({box:e,Ta:1701733217})})).R("ac-4",(function(e){u.push({box:e,Ta:1701733217})})).R("mp4a",(function(e){u.push({box:e,Ta:1701733217})})).parse(e),o)return e;if(0==u.length||!r)throw ci(e),new De(2,3,3019,t);u.reverse();for(var c=(t=l(u)).next();!c.done;c=t.next())c=c.value,a=ho(a,r,c.box,s,c.Ta);return He()&&tt()&&!Ge()?((t=new Uint8Array(e.byteLength+a.byteLength)).set(a),t.set(e,a.byteLength),t):a}(t,r)),t}(e,n,i?i.startTime:null,t,i?i.N()[0]:null),!i||!e.C||t==d.wa){I.u(11);break}if(!o&&!s){I.u(11);break}if(E=i.startTime,"HLS"!=e.aa||e.m||t!=d.V||!e.i[d.la]){I.u(13);break}return w(I,e.ga,14);case 14:k=I.h,.1<Math.abs(k)&&(E-=k);case 13:ks(e,t,(function(){return xs(e,t)}),null),ks(e,t,(function(){return As(e,t,E)}),null);case 11:return w(I,ks(e,t,(function(){var i=n;if("video"==t&&e.da){var r=e.da;r.g&&r.g.appendBuffer(i,"video",r.o,-f)}e.i[t].appendBuffer(i)}),i?i.N()[0]:null),15);case 15:T(I)}}))}function Ts(e,t){var n;return P((function(i){return 1==i.g?t==(n=bi).wa?e.h?w(i,e.h.remove(0,1/0),0):i.return():w(i,ks(e,t,(function(){return Ss(e,t,0,e.l.duration)}),null),4):e.m?w(i,ks(e,n.V,(function(){return Ss(e,n.V,0,e.l.duration)}),null),0):i.u(0)}))}function Ss(e,t,n,i){i<=n?Es(e,t):e.i[t].remove(n,i)}function xs(e,t){var n=e.i[t].appendWindowStart,i=e.i[t].appendWindowEnd;e.i[t].abort(),e.i[t].appendWindowStart=n,e.i[t].appendWindowEnd=i,Es(e,t)}function As(e,t,n){0>n&&(n+=.001),e.i[t].timestampOffset=n,Es(e,t)}function Es(e,t){if(!e.I){var n=e.o[t][0];n&&(n.p.resolve(),Ms(e,t))}}function ks(e,t,n,i){return pa(e.L),n={start:n,p:new Gr,uri:i},e.o[t].push(n),1==e.o[t].length&&Cs(e,t),n.p}function Is(e,t){var n,i,r,a,o,s,u,c,d,h;return P((function(f){switch(f.g){case 1:for(pa(e.L),n=[],i=Object.keys(e.i),r=l(i),a=r.next(),o={};!a.done;o={ready:void 0},a=r.next())s=a.value,o.ready=new Gr,u={start:function(e){return function(){return e.ready.resolve()}}(o),p:o.ready,uri:null},e.o[s].push(u),n.push(o.ready),1==e.o[s].length&&u.start();return S(f,2),w(f,Promise.all(n),4);case 4:A(f,3);break;case 2:throw E(f);case 3:return S(f,5,6),w(f,t(),6);case 6:for(k(f),c=l(i),d=c.next();!d.done;d=c.next())h=d.value,Ms(e,h);I(f,0);break;case 5:throw new De(2,3,3015,E(f),e.g.error||"No error in the media element",null)}}))}function Ms(e,t){e.o[t].shift(),Cs(e,t)}function Cs(e,t){var n=e.o[t][0];if(n)try{n.start()}catch(i){"QuotaExceededError"==i.name?n.p.reject(new De(2,3,3017,t)):n.p.reject(new De(2,3,3015,i,e.g.error||"No error in the media element",n.uri)),Ms(e,t)}}function Ds(e,t){return Is(e,(function(){return function(e,t){var n,i,r,a,o,s,u,c,d,h,f,p,g,m,v,y,b,T;return P((function(S){switch(S.g){case 1:for(o in n=bi,e.I=!0,e.m=!1,i=e.g.currentTime,r=e.g.autoplay,a=e.g.paused,e.Na&&(e.g.autoplay=!1),x(S,2),e.s.Va(),e.j)e.j[o].destroy();for(s in e.i){u=e.i[s];try{e.l.removeSourceBuffer(u)}catch(e){}}return e.j={},e.i={},c=e.l.duration,e.S=new Gr,e.l=fs(e,e.S),w(S,e.S,4);case 4:!isNaN(c)&&c?e.l.duration=c:!isNaN(e.na)&&e.na&&(e.l.duration=e.na),d=new Gr,h=e.l.sourceBuffers,f=t.size,p=0,g=function(){++p===f&&(d.resolve(),e.s.cb(h,"addsourcebuffer",g))},e.s.D(h,"addsourcebuffer",g),m=l(t.keys()),v=m.next();case 5:return v.done?((T=t.get(n.V))&&T.isAudioMuxedInVideo&&(e.m=!0),e.m&&!e.o[n.V]&&(e.o[n.V]=[]),e.g.currentTime=i,w(S,d,2)):(y=v.value,b=t.get(y),w(S,ps(e,y,b,b.codecs),6));case 6:v=m.next(),S.u(5);break;case 2:k(S),e.I=!1,pa(e.L),e.s.pa(e.g,"canplaythrough",(function(){e.L.g||(e.g.autoplay=r,a||e.g.play())})),I(S,0)}}))}(e,t)}))}ls.prototype.release=function(){this.g&&(this.g.close(),this.g=null)},F("shaka.lcevc.Dec",ls),ls.prototype.release=ls.prototype.release,(i=hs.prototype).destroy=function(){return this.L.destroy()},i.init=function(e,t,n,i){t=void 0!==t&&t,n=void 0===n?"UNKNOWN":n,i=void 0!==i&&i;var r,a,o,s,u,c,d=this;return P((function(h){switch(h.g){case 1:return r=bi,w(h,d.S,2);case 2:d.C=t,d.aa=n,d.La=i,d.Ga=!d.C&&"HLS"==d.aa&&!d.La,d.Y={},d.O=null,d.ra=null,d.M=null,d.ja=null,d.ga=new Gr,a=l(e.keys()),o=a.next();case 3:if(o.done){h.u(5);break}return s=o.value,u=e.get(s),w(h,ps(d,s,u,u.codecs),6);case 6:d.m?(d.o[r.V]=[],d.o[r.la]=[]):d.o[s]=[],o=a.next(),h.u(3);break;case 5:(c=e.get(r.V))&&c.isAudioMuxedInVideo&&(d.m=!0),T(h)}}))},i.configure=function(e){this.A=e,this.h&&(this.h.A=e.modifyCueCallback)},i.zb=function(){var e={total:this.I?[]:Eo(this.g.buffered),audio:Eo(bs(this,"audio")),video:Eo(bs(this,"video")),text:[]};if(this.h){var t=this.h.g,n=this.h.h;null!=t&&null!=n&&e.text.push({start:t,end:n})}return e},i.remove=function(e,t,n){var i,r=this;return P((function(a){return 1==a.g?e==(i=bi).wa?w(a,r.h.remove(t,n),0):w(a,ks(r,e,(function(){return Ss(r,e,t,n)}),null),4):r.m?w(a,ks(r,i.V,(function(){return Ss(r,i.V,t,n)}),null),0):a.u(0)}))},i.flush=function(e){var t,n=this;return P((function(i){return 1==i.g?e==(t=bi).wa?i.return():w(i,ks(n,e,(function(){n.g.currentTime-=.001,Es(n,e)}),null),2):n.m?w(i,ks(n,t.V,(function(){var e=t.V;n.g.currentTime-=.001,Es(n,e)}),null),0):i.u(0)}))},i.endOfStream=function(e){var t=this;return P((function(n){return w(n,Is(t,(function(){ms(t)||"closed"===t.l.readyState||(e?t.l.endOfStream(e):t.l.endOfStream())})),0)}))},i.bb=function(e){var t=this;return P((function(n){return w(n,Is(t,(function(){if(e<t.l.duration)for(var n in t.i){var i={start:function(){},p:new Gr,uri:null};t.o[n].unshift(i)}t.l.duration=e,t.na=e})),0)}))},i.getDuration=function(){return this.l.duration};var Rs=e.URL.createObjectURL,Ps="sequence";function Ls(e,t,n){this.i=e,this.C=t,this.o=this.l=1/0,this.h=1,this.g=this.j=null,this.A=0,this.B=!0,this.I=!1,this.H=0,this.F=void 0===n||n,this.G=0,this.s=!1,this.m=e}function Ns(e,t,n){this.j=n,this.l=e,this.s=Os(e),this.g=e.g.currentTime,this.m=Date.now()/1e3,this.h=!1,this.o=0,this.A=t,this.i=function(){}}function js(e){this.g=e}function Os(e){if(e.g.paused||0==e.g.playbackRate||0==e.g.buffered.length)var t=!1;else e:{t=e.g.currentTime;for(var n=(e=l(Eo(e.g.buffered))).next();!n.done;n=e.next())if(!(t<(n=n.value).start-.1||t>n.end-.5)){t=!0;break e}t=!1}return t}function Us(e,t,n,i,r){var a=this;this.A=r,this.g=e,this.B=t,this.m=n,this.l=new Z,this.j=!1,this.F=e.readyState,this.C=this.i=0,this.h=i,this.s=!1,this.l.D(e,"waiting",(function(){return _s(a)})),this.o=new Be((function(){_s(a)})).Ra(this.m.gapJumpTimerTime)}function _s(e){if(0!=e.g.readyState){if(e.g.seeking){if(!e.j)return}else e.j=!1;if(!e.g.paused||e.g.currentTime==e.i&&(e.g.autoplay||e.g.currentTime!=e.i)){var t;if(e.g.readyState!=e.F&&(e.F=e.g.readyState),!(t=!e.h)){var n=(t=e.h).l,i=Os(n),r=n.g.currentTime,a=Date.now()/1e3;t.g==r&&t.s==i||(t.m=a,t.g=r,t.s=i,t.h=!1),(i=(r=a-t.m)>=t.A&&i&&!t.h)&&(t.i(t.g,r),t.h=!0,t.g=n.g.currentTime,t.o++,t.j(new Jr("stalldetected"))),t=!i}t&&(t=e.g.currentTime,i=function(e,t,n){return e&&e.length&&!To(e)&&0<=(e=Eo(e).findIndex((function(e,i,r){return e.start>t&&(0==i||r[i-1].end-t<=n)})))?e:null}(n=e.g.buffered,t,e.m.gapDetectionThreshold),null!=i&&(0!=i||e.s))&&(r=n.start(i),(navigator.userAgent.match(/Edge\//)||Ge()||Ke())&&(r=Math.ceil(100*(r+e.m.gapPadding))/100),r>=e.B.Bb()||.001>r-t||(0!=i&&n.end(i-1),e.g.currentTime=r,t==e.i&&(e.i=r),e.C++,e.A(new Jr("gapjumped"))))}}}function Bs(e,t,n,i){t==HTMLMediaElement.HAVE_NOTHING||e.readyState>=t?i():(t=Fs.value().get(t),n.pa(e,t,i))}(i=Ls.prototype).getDuration=function(){return this.l},i.Wh=function(){return this.h},i.gh=function(e){this.i=e},i.bb=function(e){this.l=e},i.ai=function(){return this.i},i.eh=function(e){this.A=e},i.Bc=function(e){e&&!this.B&&(this.I=!0),this.B=e},i.pe=function(e){this.o=e},i.Qd=function(){return this.o},i.Sf=function(e){this.C=e},i.Oh=function(){return this.C},i.Rg=function(e,t){if(0!=e.length){var n=(Date.now()+this.A)/1e3;if(0!=(e=e.filter((function(e){return e.start+t<n}))).length){var i=e[e.length-1].end+t;this.be(e[0].start+t),this.h=e.reduce((function(e,t){return Math.max(e,t.end-t.start)}),this.h),this.g=Math.max(this.g,i),null!=this.i&&this.F&&!this.s&&(this.i=n-this.g-this.h)}}},i.vd=function(e){if(0!=e.length){for(var t=e[0].startTime,n=e[0].endTime,i=(Date.now()+this.A)/1e3,r=(e=l(e)).next();!r.done;r=e.next())i<(r=r.value).startTime||(t=Math.min(t,r.startTime),n=Math.max(n,r.endTime),this.h=Math.max(this.h,r.endTime-r.startTime));this.be(t),this.g=Math.max(this.g,n),null!=this.i&&this.F&&!this.s&&(this.i=i-this.g-this.h)}},i.Qg=function(e,t){this.be(e),1/0==t||this.U()||(this.g=Math.max(this.g,t))},i.Xh=function(){return this.g},i.Xd=function(){this.s=!0},i.vi=function(){return this.s},i.fh=function(e){this.m=e},i.Th=function(){return this.m},i.be=function(e){null==this.j?this.j=e:this.I||(this.j=Math.min(this.j,e))},i.Bf=function(e){this.h=Math.max(this.h,e)},i.offset=function(e){null!=this.j&&(this.j+=e),null!=this.g&&(this.g+=e)},i.U=function(){return 1/0==this.l&&!this.B},i.uc=function(){return 1/0!=this.l&&!this.B},i.qb=function(){return Math.max(this.H,this.Yb()-this.o)},i.jh=function(e){this.H=e},i.Yb=function(){return this.U()||this.uc()?Math.min(Math.max(0,(Date.now()+this.A)/1e3-this.h-this.i)+this.G,this.l):this.g?Math.min(this.g,this.l):this.l},i.jd=function(e){var t=Math.max(this.j,this.H);return 1/0==this.o?Math.ceil(1e3*t)/1e3:Math.max(t,Math.min(this.Yb()-this.o+e,this.Bb()))},i.Kb=function(){return this.jd(0)},i.Bb=function(){return Math.max(0,this.Yb()-(this.U()||this.uc()?this.C:0))},i.qh=function(){return!(null==this.i||null!=this.g&&this.F)},i.dh=function(e){this.G=e},i.Mh=function(){return this.G},F("shaka.media.PresentationTimeline",Ls),Ls.prototype.getAvailabilityTimeOffset=Ls.prototype.Mh,Ls.prototype.setAvailabilityTimeOffset=Ls.prototype.dh,Ls.prototype.usingPresentationStartTime=Ls.prototype.qh,Ls.prototype.getSeekRangeEnd=Ls.prototype.Bb,Ls.prototype.getSeekRangeStart=Ls.prototype.Kb,Ls.prototype.getSafeSeekRangeStart=Ls.prototype.jd,Ls.prototype.getSegmentAvailabilityEnd=Ls.prototype.Yb,Ls.prototype.setUserSeekStart=Ls.prototype.jh,Ls.prototype.getSegmentAvailabilityStart=Ls.prototype.qb,Ls.prototype.isInProgress=Ls.prototype.uc,Ls.prototype.isLive=Ls.prototype.U,Ls.prototype.offset=Ls.prototype.offset,Ls.prototype.notifyMaxSegmentDuration=Ls.prototype.Bf,Ls.prototype.notifyMinSegmentStartTime=Ls.prototype.be,Ls.prototype.getInitialProgramDateTime=Ls.prototype.Th,Ls.prototype.setInitialProgramDateTime=Ls.prototype.fh,Ls.prototype.isStartTimeLocked=Ls.prototype.vi,Ls.prototype.lockStartTime=Ls.prototype.Xd,Ls.prototype.getMaxSegmentEndTime=Ls.prototype.Xh,Ls.prototype.notifyPeriodDuration=Ls.prototype.Qg,Ls.prototype.notifySegments=Ls.prototype.vd,Ls.prototype.notifyTimeRange=Ls.prototype.Rg,Ls.prototype.getDelay=Ls.prototype.Oh,Ls.prototype.setDelay=Ls.prototype.Sf,Ls.prototype.getSegmentAvailabilityDuration=Ls.prototype.Qd,Ls.prototype.setSegmentAvailabilityDuration=Ls.prototype.pe,Ls.prototype.setStatic=Ls.prototype.Bc,Ls.prototype.setClockOffset=Ls.prototype.eh,Ls.prototype.getPresentationStartTime=Ls.prototype.ai,Ls.prototype.setDuration=Ls.prototype.bb,Ls.prototype.setPresentationStartTime=Ls.prototype.gh,Ls.prototype.getMaxSegmentDuration=Ls.prototype.Wh,Ls.prototype.getDuration=Ls.prototype.getDuration,Ns.prototype.release=function(){this.j=this.l=null,this.i=function(){}},Us.prototype.release=function(){this.l&&(this.l.release(),this.l=null),null!=this.o&&(this.o.stop(),this.o=null),this.h&&(this.h.release(),this.h=null),this.g=this.B=this.A=null},Us.prototype.Ef=function(){this.s=!0,_s(this)};var Fs=new Pe((function(){return new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]])}));function Vs(e,t,n,i){var r=this;this.g=e,this.m=t,this.s=n,this.l=null,this.j=function(){return null==r.l&&(r.l=i()),r.l},this.o=!1,this.h=new Z,this.i=new qs(e),Bs(this.g,HTMLMediaElement.HAVE_METADATA,this.h,(function(){Ks(r,r.j())}))}function Hs(e){return e.o?e.g.currentTime:e.j()}function Gs(e,t){0<e.g.readyState?zs(e.i,t):Bs(e.g,HTMLMediaElement.HAVE_METADATA,e.h,(function(){Ks(e,e.j())}))}function Ks(e,t){.001>Math.abs(e.g.currentTime-t)?Xs(e):(e.h.pa(e.g,"seeking",(function(){Xs(e)})),zs(e.i,e.g.currentTime&&0!=e.g.currentTime?e.g.currentTime:t))}function Xs(e){e.o=!0,e.h.D(e.g,"seeking",(function(){return e.m()})),e.s(e.g.currentTime)}function qs(e){var t=this;this.g=e,this.m=10,this.j=this.l=this.i=0,this.h=new Be((function(){0>=t.i||t.g.currentTime!=t.l||t.g.currentTime===t.j?t.h.stop():(t.g.currentTime=t.j,t.i--)}))}function zs(e,t){e.l=e.g.currentTime,e.j=t,e.i=e.m,e.g.currentTime=t,e.h.Ra(.1)}function Ws(e){this.h=e,this.j=!1,this.g=null,this.i=new Z}function Ys(e,t,n,i,r,a){var o=this;this.i=e,this.g=t.presentationTimeline,this.B=t.minBufferTime||0,this.l=n,this.A=r,this.s=null,this.o=function(e,t,n){if(!t.stallEnabled)return null;var i=t.stallSkip;return function(e,t){e.i=t}(t=new Ns(new js(e),t.stallThreshold,n),(function(){i?e.currentTime+=i:(e.pause(),e.play())})),t}(e,n,a),this.j=new Us(e,t.presentationTimeline,n,this.o,a),this.h=new Vs(e,(function(){e:{var e=o.j;e.j=!0,e.s=!1;var t=Hs(o.h);if(e=$s(o,t),.001<Math.abs(e-t)){if(t=!1,!ze()||ze()&&nt())t=!0;else{var n=Date.now()/1e3,i=ze()&&rt("Fuchsia")?3:1;(!o.s||o.s<n-i)&&(o.s=n,t=!0)}if(t){Gs(o.h,e),e=void 0;break e}}o.A(),e=void 0}return e}),(function(e){var t=o.j;t.g.seeking&&!t.j&&(t.j=!0,t.i=e)}),(function(){var e=i;return null==e?e=1/0>o.g.getDuration()?o.g.Kb():o.g.Bb():0>e&&(e=o.g.Bb()+e),Js(o,Qs(o,e))})),this.m=new Be((function(){if(0!=o.i.readyState&&!o.i.paused){var e=Hs(o.h),t=o.g.Kb(),n=o.g.Bb();3>n-t&&(t=n-3),e<t&&(e=$s(o,e),o.i.currentTime=e)}}))}function Js(e,t){var n=e.g.getDuration();return t>=n?n-e.l.durationBackoff:t}function $s(e,t){var n=Math.max(e.B,e.l.rebufferingGoal),i=e.l.safeSeekOffset,r=e.g.Kb(),a=e.g.Bb(),o=e.g.getDuration();3>a-r&&(r=a-3);var s=e.g.jd(n),u=e.g.jd(i);return n=e.g.jd(n+i),t>=o?Js(e,t):t>a?a-e.l.safeSeekEndOffset:t<r?xo(e.i.buffered,u)?u:n:t>=s||xo(e.i.buffered,t)?t:n}function Qs(e,t){var n=e.g.Kb();return t<n?n:t>(e=e.g.Bb())?e:t}function Zs(e){this.g=e,this.m=null,this.i=0,this.o=!1}function eu(e){return e.g[0]||null}function tu(e,t,n){return new Zs([e=new vo(e,e+t,(function(){return n}),0,null,null,e,e,e+t)])}function nu(e,t,n,i){this.i=e,this.h=t,this.g=n,this.reverse=i}function iu(){Zs.call(this,[]),this.h=[]}function ru(e){var t=this;this.g=e,this.j=!1,this.i=this.g.Pd(),this.h=new Be((function(){t.g.Og(.25*t.i)}))}function au(e){e.h.stop();var t=e.j?0:e.i;if(0<=t)try{return void(e.g.Pd()!=t&&e.g.Vf(t))}catch(e){}e.h.Ra(.25),0!=e.g.Pd()&&e.g.Vf(0)}function ou(e){var t=this;this.h=e,this.g=new Set,this.i=new Be((function(){su(t,!1)})).Ra(.25)}function su(e,t){for(var n=l(e.g),i=n.next();!i.done;i=n.next())i.value.j(e.h.currentTime,t)}function uu(){this.g=null,this.h=[]}function lu(e,t){var n=0;e.g&&e.g.state==t&&(n+=e.g.duration);for(var i=(e=l(e.h)).next();!i.done;i=e.next())n+=(i=i.value).state==t?i.duration:0;return n}function cu(){this.i=this.h=null,this.g=[]}function du(e,t,n){e.i!=t&&(e.i=t,e.g.push({timestamp:Date.now()/1e3,id:t.id,type:"text",fromAdaptation:n,bandwidth:null}))}function hu(){this.kc=this.Kg=this.s=this.A=this.I=this.B=this.o=this.j=this.H=this.C=this.i=this.S=this.Y=this.L=this.M=this.O=this.l=this.m=NaN,this.K=0,this.F=this.G=NaN,this.g=new uu,this.h=new cu}function fu(e,t,n,i){this.m=e,this.i=t,this.l=n,this.h=new Map,this.j=new Map,this.g=null,this.o=i}function pu(e,t){e.l=t;for(var n=(e=l(e.h.values())).next();!n.done;n=e.next())n.value.g=t}function gu(e,t,n){if(n=void 0!==n&&n,!e.i.segmentIndex)return Promise.resolve();if(e.g||(e.g=e.i.segmentIndex.Jb(t,!0,e.o)),!e.g)return Promise.resolve();for(n&&e.g.next(),t=[];e.h.size<e.m&&(n=e.g.next().value);){var i=!0;n.isPreload()&&null!=n.va&&(i=!1),2==n.$b()&&(i=!1),n.pc()&&(i=!1),i&&n.ba&&t.push(mu(e,n.ba)),i&&!e.h.has(n)&&(i=new Su(e.l),t.push(xu(i,n,e.i)),e.h.set(n,i))}return bu(e),Promise.all(t)}function mu(e,t){if(!e.i.segmentIndex||t.pc()||Array.from(e.j.keys()).some((function(e){return mo(e,t)})))return Promise.resolve();var n=new Su(e.l),i=xu(n,t,e.i);return e.j.set(t,n),i}function vu(e,t){for(var n=(t=l(t.keys())).next();!n.done;n=t.next())(n=n.value)&&Tu(e,n)}function yu(e){vu(e,e.h),vu(e,e.j),e.g=null}function bu(e){for(var t=Array.from(e.h.keys()),n=l(e.j.keys()),i=n.next(),r={};!i.done;r={rf:void 0},i=n.next())r.rf=i.value,t.some(function(e){return function(t){return mo(t.ba,e.rf)}}(r))||Tu(e,r.rf)}function wu(e,t){e.m=t;for(var n=Array.from(e.h.keys());n.length>t;){var i=n.pop();i&&Tu(e,i)}bu(e)}function Tu(e,t){var n=e.h;t instanceof go&&(n=e.j),e=n.get(t),n.delete(t),e&&e.abort()}function Su(e){this.g=e,this.wd=this.Xf=null}function xu(e,t,n){var i=new Uint8Array(0);return e.wd=e.g(t,n,(function(t){return P((function(n){if(1==n.g)return i=0<i.byteLength?di(i,t):t,e.Xf?w(n,e.Xf(i),3):n.u(0);i=new Uint8Array(0),T(n)}))})),e.wd.promise.catch((function(e){return e instanceof De&&7001==e.code?Promise.resolve():Promise.reject(e)}))}function Au(e){Zr.call(this);var t=this;this.g=new Set,this.i=e,this.h=new Be((function(){for(var e=t.i(),n=l(t.g),i=n.next();!i.done;i=n.next())(i=i.value).endTime<e.start&&(t.g.delete(i),i=new Jr("regionremove",new Map([["region",i]])),t.dispatchEvent(i))})).Ra(2)}function Eu(e){Zr.call(this),this.g=new Map,this.h=e}function ku(e,t,n){return!!((e=e.h()[n])&&0<e.length&&(n=e[e.length-1].end,t>=e[0].start&&t<n))}function Iu(e){var t={bandwidth:e.bandwidth||0,audioSamplingRate:null,codecs:e.codecs,contentType:e.type,frameRate:null,height:null,mimeType:e.mimeType,channelsCount:null,pixelAspectRatio:null,width:null,label:null,roles:e.roles,language:null};return"video"==e.type&&(t.frameRate=e.frameRate||null,t.height=e.height||null,t.pixelAspectRatio=e.pixelAspectRatio||null,t.width=e.width||null),"audio"==e.type&&(t.audioSamplingRate=e.audioSamplingRate,t.channelsCount=e.channelsCount,t.label=e.label||null,t.language=e.language),t}function Mu(e){var t=Di(e);return{type:t.split("/")[0],mimeType:t,codecs:e=Ri(e),language:null,height:null,width:null,channelCount:null,sampleRate:null,closedCaptions:new Map,Cd:null,colorGamut:null,frameRate:null}}function Cu(e){for(var t=new Set,n=[],i=(e=l(e)).next();!i.done;i=e.next()){var r=Ci(i=i.value);t.has(r)||(n.push(i),t.add(r))}return t=vi("audio",n),i=vi("video",n),e=vi(yi,n),i=function(e){if(1>=e.length)return e;var t=e.find((function(e){return e.startsWith("dvav.")||e.startsWith("dva1.")||e.startsWith("dvh1.")||e.startsWith("dvhe.")||e.startsWith("dav1.")||e.startsWith("dvc1.")||e.startsWith("dvi1.")}));return t?ne('video/mp4; codecs="'+t+'"')?[t]:e.filter((function(e){return e!=t})):e}(i),t=t.concat(i).concat(e),n.length&&!t.length?n:t}function Du(t,n,i){var r,a,o,s,u;return P((function(l){if(1==l.g)return(r=n).cryptoKey?l.u(2):w(l,r.fetchKey(),3);if(!(a=r.iv))for(a=ge(new ArrayBuffer(16)),o=r.firstMediaSequenceNumber+i,s=a.byteLength-1;0<=s;s--)a[s]=255&o,o>>=8;return u="CBC"==n.blockCipherMode?{name:"AES-CBC",iv:a}:{name:"AES-CTR",counter:a,length:64},l.return(e.crypto.subtle.decrypt(u,r.cryptoKey,t))}))}function Ru(e,t,n,i,r){return e=aa(e,i,r),0==t&&null==n||(e.headers.Range=n?"bytes="+t+"-"+n:"bytes="+t+"-"),e}function Pu(e,t){var n=this;this.g=t,this.l=e,this.h=null,this.G=new Map,this.B=1,this.s=this.j=null,this.I=0,this.i=new Map,this.F=!1,this.K=null,this.A=!1,this.m=new fa((function(){return function(e){var t,n,i,r,a,o;return P((function(s){if(1==s.g){for(t=[],n=l(e.i.values()),i=n.next();!i.done;i=n.next())Wu(r=i.value),t.push(Yu(r)),r.W&&(yu(r.W),r.W=null);for(a=l(e.o.values()),o=a.next();!o.done;o=a.next())yu(o.value);return w(s,Promise.all(t),2)}e.i.clear(),e.o.clear(),e.g=null,e.l=null,e.h=null,T(s)}))}(n)})),this.L=Date.now()/1e3,this.o=new Map,this.H={projection:null,hfov:null},this.O=0,this.M=1/0,this.C=null}function Lu(e,t){for(var n=0>e.g.ib(),i=l(e.i.values()),r=i.next();!r.done;r=i.next())(r=r.value).ia&&r.ia.Zc(n),r.W&&r.W.Zc(n);for(r=(i=l(e.o.values())).next();!r.done;r=i.next())r.value.Zc(n);(n=e.i.get("video"))&&(i=n.stream)&&(t?(t=i.trickModeVideo)&&!n.dc&&(Ou(e,t,!1,0,!1),n.dc=i):(t=n.dc)&&(n.dc=null,Ou(e,t,!0,0,!1)))}function Nu(e,t,n,i,r,a){n=void 0!==n&&n,i=void 0===i?0:i,r=void 0!==r&&r,a=void 0!==a&&a,e.j=t,e.F&&(t.video&&Ou(e,t.video,n,i,r,a),t.audio&&Ou(e,t.audio,n,i,r,a))}function ju(e,t){P((function(n){if(1==n.g)return e.C=null,e.s=t,e.F?t.segmentIndex?n.u(2):w(n,t.createSegmentIndex(),2):n.return();Ou(e,t,!0,0,!1),T(n)}))}function Ou(e,t,n,i,r,a){var o=e.i.get(t.type);o||t.type!=yi?o&&(o.dc&&(t.trickModeVideo?(o.dc=t,t=t.trickModeVideo):o.dc=null),o.stream!=t||r)&&(e.o.has(t)?o.W=e.o.get(t):o.W&&function(e,t){t&&t!==e.i&&(yu(e),e.i=t)}(o.W,t),t.type==yi&&(r=xi(t.mimeType,t.codecs),gs(e.g.ca,r,e.l.sequenceMode,t.external)),!e.o.has(o.stream)&&o.stream.closeSegmentIndex&&(o.Ea?(r="("+o.type+":"+o.stream.id+")",e.G.has(r)||e.G.set(r,o.stream.closeSegmentIndex)):o.stream.closeSegmentIndex()),r=o.stream.isAudioMuxedInVideo!=t.isAudioMuxedInVideo,o.stream=t,o.ia=null,o.jg=!!a,r?$u(e,!0,!1):(n?o.bd?o.De=!0:o.Ea?(o.jc=!0,o.Kd=i,o.De=!0):(Wu(o),qu(e,o,!0,i).catch((function(t){e.g&&e.g.onError(t)}))):o.Ea||o.eb||zu(e,o,0),function(e,t){var n,i;return P((function(r){if(1==r.g)return t.mb?(n=t.stream,i=t.mb,n.segmentIndex?r.u(2):w(r,n.createSegmentIndex(),2)):r.return();if(t.mb!=i||t.stream!=n)return r.return();var a=e.g.hd(),o=ys(e.g.ca,t.type),s=t.stream.segmentIndex.find(t.Sa?t.Sa.endTime:a),u=null==s?null:t.stream.segmentIndex.get(s);s=u&&u.va?u.va-u.Ja:null,u&&!s&&(s=(u.endTime-u.getStartTime())*(t.stream.bandwidth||0)/8),s?((u=u.ba)&&(s+=(u.va?u.va-u.Ja:null)||0),a=8*s/(u=e.g.getBandwidthEstimate())<(o||0)-a-Math.max(e.l.minBufferTime||0,e.h.rebufferingGoal)||t.mb.h.g>s):a=!1,a&&t.mb.abort(),T(r)}))}(e,o).catch((function(t){e.g&&e.g.onError(t)})))):function(e,t){var n,i,r,a,o;P((function(s){switch(s.g){case 1:return n=bi,e.I++,i=e.I,S(s,2),w(s,Ts(e.g.ca,n.wa),4);case 4:A(s,3);break;case 2:r=E(s),e.g&&e.g.onError(r);case 3:a=xi(t.mimeType,t.codecs),gs(e.g.ca,a,e.l.sequenceMode,t.external),(e.g.ca.fa.isTextVisible()||e.h.alwaysStreamText)&&e.I==i&&(o=_u(e,t),e.i.set(n.wa,o),zu(e,o,0)),T(s)}}))}(e,t)}function Uu(e,t){t.bd||t.jc||(t.Ea?(t.jc=!0,t.Kd=0):null==vs(e.g.ca,t.type)?null==t.eb&&zu(e,t,0):(Wu(t),qu(e,t,!1,0).catch((function(t){e.g&&e.g.onError(t)}))))}function _u(e,t){return{stream:t,type:t.type,ia:null,W:Bu(e,t),Sa:null,Oc:null,Wd:null,wc:null,vc:null,dc:null,endOfStream:!1,Ea:!1,eb:null,jc:!1,Kd:0,De:!1,bd:!1,Xc:!0,Kf:!1,ld:!1,mb:null}}function Bu(e,t){if("video"===t.type&&e.h.disableVideoPrefetch||"audio"===t.type&&e.h.disableAudioPrefetch||t.type===yi&&("application/cea-608"==t.mimeType||"application/cea-708"==t.mimeType)||t.type===yi&&e.h.disableTextPrefetch)return null;if(e.o.has(t))return e.o.get(t);var n=e.i.get(t.type);return(n=n&&n.W)&&t===n.i?n:0<e.h.segmentPrefetchLimit?new fu(e.h.segmentPrefetchLimit,t,(function(t,n,i){return Xu(t,n,i||null,e.h.retryParameters,e.g.Nb)}),0>e.g.ib()):null}function Fu(e,t,n,i,r,a,o,s){var u,l,c,d;return P((function(h){if(1==h.g)return u=bi,l=new Map,e.j.audio&&l.set(u.V,e.j.audio),e.j.video&&l.set(u.la,e.j.video),S(h,2),t.wc=i,t.vc=r,o&&(t.xf=o),s&&(t.yf=s),t.Wd=n,c=e.l.sequenceMode||"HLS"==e.l.type,w(h,function(e,t,n,i,r,a,o,s,u){var l,c;return P((function(d){return 1==d.g?t==(l=bi).wa?(a||(e.h.s=n),function(e,t,n){e.l=t,e.m=n}(e.h,i,r),d.return()):(c=[],w(d,function(e,t,n,i,r){var a,o,s,u,l,c,d,h,f,p,g,m,v,y,b;return P((function(T){return 1==T.g?t==(a=bi).wa?T.return(!1):(o=Mi(Ri(e.G[t])),s=Di(e.G[t]),l=!1,c=xi(n,i),d=e.A.forceTransmux,(!ne(c)||!e.C&&ji.includes(c))&&(d=!0),d&&(h=Ai(n,i),f=On(h))&&(u=f(),p=mi(a.V,(i||"").split(",")),g=mi(a.la,(i||"").split(",")),p&&g?(l=!0,m=g,t==a.V&&(m=p),c=u.convertCodecs(t,Ai(n,m))):c=u.convertCodecs(t,h)),v=Mi(Ri(c)),y=Di(c),o===v&&s===y?(e.j[t]&&!u?(e.j[t].destroy(),delete e.j[t]):!e.j[t]&&u?e.j[t]=u:u&&(e.j[t]&&e.j[t].transmux!=u.transmux?(e.j[t].destroy(),delete e.j[t],e.j[t]=u):u.destroy()),T.return(!1)):(b=!0,(e.m||l&&u&&!e.j[t])&&(b=!1),b&&"smooth"===e.A.codecSwitchingStrategy&&ie()?w(T,function(e,t,n,i){return ks(e,t,(function(){t!==yi&&(ie()&&(e.j[t]&&(e.j[t].destroy(),delete e.j[t]),i&&(e.j[t]=i),e.i[t].changeType(n+e.A.addExtraFeaturesToSourceBuffer(n)),e.G[t]=n),Es(e,t))}),null)}(e,t,c,u),3):(u&&u.destroy(),w(T,Ds(e,r),3)))):T.return(!0)}))}(e,t,o,s,u),2)):(d.h||(c.push(ks(e,t,(function(){return xs(e,t)}),null)),e.m&&c.push(ks(e,l.V,(function(){return xs(e,l.V)}),null))),a||(c.push(ks(e,t,(function(){return As(e,t,n)}),null)),e.m&&c.push(ks(e,l.V,(function(){return As(e,l.V,n)}),null))),c.push(ks(e,t,(function(){e.i[t].appendWindowStart=0,e.i[t].appendWindowEnd=r,e.i[t].appendWindowStart=i,Es(e,t)}),null)),e.m&&c.push(ks(e,l.V,(function(){var t=l.V;e.i[t].appendWindowStart=0,e.i[t].appendWindowEnd=r,e.i[t].appendWindowStart=i,Es(e,t)}),null)),w(d,Promise.all(c),0))}))}(e.g.ca,t.type,n,i,r,c,a.mimeType||t.stream.mimeType,a.codecs||t.stream.codecs,l),4);if(2!=h.g)return A(h,0);throw d=E(h),t.wc=null,t.vc=null,t.xf=null,t.yf=null,t.Wd=null,d}))}function Vu(e,t,n,i,r,a,o,s){var u,l,c,d,h,f;return o=void 0!==o&&o,s=void 0!==s&&s,P((function(p){switch(p.g){case 1:return u=i.closedCaptions&&0<i.closedCaptions.size,e.h.shouldFixTimestampOffset&&(c="video/mp4"==i.mimeType||"audio/mp4"==i.mimeType,d=null,r.ba&&(d=r.ba.timescale),(h=c&&d&&"video"===i.type&&"DASH"==e.l.type)&&(l=new Ta),h&&l.box("moof",Sa).box("traf",Sa).R("tfdt",(function(n){var i,a,o,s,u;return P((function(l){return i=Uo(n.reader,n.version),(a=i.baseMediaDecodeTime)?(o=-a/d,(Number(t.Wd)||0)<o?(s=t.wc,u=t.vc,w(l,Fu(e,t,o,s,u,r),0)):l.u(0)):l.return()}))})),h&&l.parse(a,!1,o)),w(p,Hu(e,t,n),2);case 2:return pa(e.m),f=t.Xc,t.Xc=!1,w(p,e.g.mg(t.type,a),3);case 3:return w(p,ws(e.g.ca,t.type,a,r,i,u,f,s,o),4);case 4:pa(e.m),T(p)}}))}function Hu(e,t,n){var i,r,a,o;return P((function(s){return 1==s.g?((i=t.stream.segmentIndex)instanceof iu&&i.Ha(e.l.presentationTimeline.Kb()),r=Math.max(e.h.bufferBehind*e.B,e.l.presentationTimeline.h),null==(a=vs(e.g.ca,t.type))?(e.C==t&&(e.C=null),s.return()):(o=n-a-r)<=e.h.evictionGoal?s.return():w(s,e.g.ca.remove(t.type,a,a+o),2)):4!=s.g?(pa(e.m),e.C?w(s,Hu(e,e.C,n),4):s.u(0)):(pa(e.m),void T(s))}))}function Gu(e){return e&&e.type==yi&&("application/cea-608"==e.stream.mimeType||"application/cea-708"==e.stream.mimeType)}function Ku(e,t,n,i){var r,a,o,s,u;return P((function(l){switch(l.g){case 1:if(r=n.pc())return l.return(r);if(a=null,t.W){var c=t.W,d=c.h;n instanceof go&&(d=c.j),d.has(n)?(c=d.get(n),i&&(c.Xf=i),a=c.wd):a=null}return a||(a=Xu(n,t.stream,i||null,e.h.retryParameters,e.g.Nb)),o=0,t.ia&&(o=t.ia.h),t.mb=a,w(l,a.promise,2);case 2:if(s=l.h,t.mb=null,u=s.data,!n.aesKey){l.u(3);break}return w(l,Du(u,n.aesKey,o),4);case 4:u=l.h;case 3:return l.return(u)}}))}function Xu(e,t,n,i,r,a){a=void 0!==a&&a;var o=e instanceof vo?e:void 0,s=o?1:0;return(e=Ru(e.N(),e.Ja,e.va,i,n)).contentType=t.type,r.request(ca,e,{type:s,stream:t,segment:o,isPreload:a})}function qu(e,t,n,i){var r,a;return P((function(o){return 1==o.g?(t.jc=!1,t.De=!1,t.Kd=0,t.bd=!0,t.Sa=null,t.ia=null,t.W&&!e.o.has(t.stream)&&yu(t.W),i?(r=e.g.hd(),a=e.g.ca.getDuration(),w(o,e.g.ca.remove(t.type,r+i,a),3)):w(o,Ts(e.g.ca,t.type),4)):3!=o.g?(pa(e.m),n?w(o,e.g.ca.flush(t.type),3):o.u(3)):(pa(e.m),t.bd=!1,t.endOfStream=!1,t.Ea||t.eb||zu(e,t,0),void T(o))}))}function zu(t,n,i){var r=n.type;(r!=yi||t.i.has(r))&&(n.eb=new _e((function(){var i;return P((function(r){return 1==r.g?(S(r,2),w(r,function(t,n){var i,r,a,o,s,u;return P((function(c){switch(c.g){case 1:if(pa(t.m),n.Ea||null==n.eb||n.bd)return c.return();if(n.eb=null,!n.jc){c.u(2);break}return w(c,qu(t,n,n.De,n.Kd),3);case 3:return c.return();case 2:if(function(e,t){for(var n=l(e.G.entries()),i=n.next();!i.done;i=n.next()){var r=l(i.value);i=r.next().value,r=r.next().value,i.includes(t.type)&&(r(),e.G.delete(i))}}(t,n),n.stream.segmentIndex){c.u(4);break}return i=n.stream,S(c,5),w(c,n.stream.createSegmentIndex(),7);case 7:A(c,6);break;case 5:return r=E(c),w(c,Ju(t,n,r),8);case 8:return c.return();case 6:if(i!=n.stream)return i.closeSegmentIndex&&i.closeSegmentIndex(),n.Ea||n.eb||zu(t,n,0),c.return();case 4:S(c,9),a=function(t,n){if(Gu(n))return function(e,t){var n=ys(e,"video")||0;_i(e.h,t,n)}(t.g.ca,n.stream.originalId||""),null;if(n.type==yi&&function(e){e.h&&_i(e.h,"",0)}(t.g.ca),n.stream.isAudioMuxedInVideo)return null;if(!function(e){return e.ta&&!e.Z&&!e.I}(t.g.ca)&&n.type!=yi)return t.h.updateIntervalSeconds/2;var i=t.g.hd();if("audio"===n.type)for(var r=l(t.o.keys()),a=r.next();!a.done;a=r.next())(a=t.o.get(a.value)).Ha(i,!0),gu(a,i);r=n.Sa?n.Sa.endTime:i;var o=function(e,t,n){return t==yi?null==(e=e.h).h||e.h<n?0:e.h-Math.max(n,e.g):Ao(e=bs(e,t),n)}(t.g.ca,n.type,i),s=Math.max(1,Math.max(t.l.minBufferTime||0,t.h.rebufferingGoal,t.h.bufferingGoal)*t.B),u=t.l.presentationTimeline.getDuration()-r;if(a=ys(t.g.ca,n.type),1e-6>u&&a)return n.endOfStream=!0,"video"==n.type&&(t=t.i.get(yi))&&Gu(t)&&(t.endOfStream=!0),null;if(n.endOfStream=!1,o>=s)return t.h.updateIntervalSeconds/2;if(s=!n.ia,a=function(e,t,n,i){if(t.ia)return t.ia.current();if(t.Sa||i)return n=t.Sa?t.Sa.endTime:i,e=0>e.g.ib(),t.stream.segmentIndex&&(t.ia=t.stream.segmentIndex.Jb(n,!1,e)),t.ia&&t.ia.next().value;i=e.l.sequenceMode?0:e.h.inaccurateManifestTolerance;var r=Math.max(n-i,0);e=0>e.g.ib();var a=null;return i&&(t.stream.segmentIndex&&(t.ia=t.stream.segmentIndex.Jb(r,!1,e)),a=t.ia&&t.ia.next().value),a||(t.stream.segmentIndex&&(t.ia=t.stream.segmentIndex.Jb(n,!1,e)),a=t.ia&&t.ia.next().value),a}(t,n,i,a),!a)return t.h.updateIntervalSeconds;o=!1,s&&n.jg&&(o=!0,n.jg=!1),s=1/0;for(var c=(u=l(u=Array.from(t.i.values()))).next();!c.done;c=u.next())Gu(c=c.value)||c.ia&&!c.ia.current()||(s=Math.min(s,c.Sa?c.Sa.endTime:i));return r>=s+t.l.presentationTimeline.h?t.h.updateIntervalSeconds:(n.W&&n.ia&&!t.o.has(n.stream)&&(n.W.Ha(a.startTime),gu(n.W,a.startTime)),function(t,n,i,r,a){var o,s,u,l,c,d,h,f,p,g,m,v,y,b,x;return P((function(k){switch(k.g){case 1:if(o=bi,s=n.stream,u=n.ia,n.Ea=!0,S(k,2),2==r.$b())throw new De(1,1,1011);return w(k,function(e,t,n,i){var r,a,o,s,u,l,c,d,h,f,p,g,m,v,y,b;return P((function(T){switch(T.g){case 1:if(r=bi,a=null==t.Sa,o=[],s=Math.max(0,Math.max(n.appendWindowStart,e.O)-.1),u=Math.min(n.appendWindowEnd,e.M)+.01,l=n.codecs||t.stream.codecs,c=Ci(l),d=Di(n.mimeType||t.stream.mimeType),(h=n.timestampOffset)==t.Wd&&s==t.wc&&u==t.vc&&c==t.xf&&d==t.yf){T.u(2);break}if(f=t.xf&&t.yf&&function(e,t,n,i){if(t==yi)var r=!1;else{r=Mi(Ri(e.G[t]));var a=Di(e.G[t]),o=xi(n,i),s=e.A.forceTransmux;(!ne(o)||!e.C&&ji.includes(o))&&(s=!0),n=Ai(n,i),s&&(s=On(n))&&(o=(s=s()).convertCodecs(t,n),s.destroy()),t=Mi(Ri(o)),o=Di(o),r=r!==t||a!==o}return!!r&&("smooth"!==e.A.codecSwitchingStrategy||!ie()||e.m)}(e.g.ca,t.type,d,l),!f){T.u(3);break}if(p=null,t.type===r.la?p=e.i.get(r.V):t.type===r.V&&(p=e.i.get(r.la)),!p){T.u(3);break}return w(T,Yu(p).catch((function(){})),5);case 5:p.Oc=null,p.wc=null,p.vc=null,Uu(e,p);case 3:return w(T,Fu(e,t,h,s,u,n,c,d),2);case 2:return mo(n.ba,t.Oc)||(t.Oc=n.ba,n.l&&n.ba&&(g=Ku(e,t,n.ba),m=function(){var a,o,s,u,l,c;return P((function(d){switch(d.g){case 1:return S(d,2),w(d,g,4);case 4:return a=d.h,pa(e.m),o=null,s=new Map,u={projection:null,hfov:null},(new Ta).box("moov",Sa).box("trak",Sa).box("mdia",Sa).R("mdhd",(function(e){o=_o(e.reader,e.version).timescale})).box("hdlr",(function(e){switch((e=e.reader).skip(8),e.yc()){case"soun":s.set(r.V,o);break;case"vide":s.set(r.la,o)}o=null})).box("minf",Sa).box("stbl",Sa).R("stsd",xa).box("encv",Aa).box("avc1",Aa).box("avc3",Aa).box("hev1",Aa).box("hvc1",Aa).box("dvav",Aa).box("dva1",Aa).box("dvh1",Aa).box("dvhe",Aa).box("dvc1",Aa).box("dvi1",Aa).box("vexu",Sa).box("proj",Sa).R("prji",(function(e){e=e.reader.yc(),u.projection=e})).box("hfov",(function(e){e=e.reader.P()/1e3,u.hfov=e})).parse(a),function(e,t){if(e.H.projection!=t.projection||e.H.hfov!=t.hfov){if(null!=t.projection||null!=t.hfov){var n=(new Map).set("detail",t);n=new Jr("spatialvideoinfo",n)}else n=new Jr("nospatialvideoinfo");n.cancelable=!0,e.g.onEvent(n),e.H=t}}(e,u),s.has(t.type)?n.ba.timescale=s.get(t.type):null!=o&&(n.ba.timescale=o),l=t.stream.closedCaptions&&0<t.stream.closedCaptions.size,w(d,e.g.mg(t.type,a),5);case 5:return w(d,ws(e.g.ca,t.type,a,null,t.stream,l,t.Xc,i),6);case 6:A(d,0);break;case 2:throw c=E(d),t.Oc=null,c}}))},v=n.startTime,a&&null!=(y=ys(e.g.ca,t.type))&&(v=y),e.g.Ei(v,n.ba),o.push(m()))),b=t.Sa?t.Sa.i:null,n.i!=b&&o.push(function(e,t,n){var i;return P((function(r){return 1==r.g?t==(i=bi).wa?r.return():(t==i.la&&(e.Ba=new Gr),e.C?(ks(e,t,(function(){return xs(e,t)}),null),e.m&&ks(e,i.V,(function(){return xs(e,i.V)}),null),w(r,ks(e,t,(function(){return As(e,t,n)}),null),2)):r.return()):e.m?w(r,ks(e,i.V,(function(){return As(e,i.V,n)}),null),0):r.u(0)}))}(e.g.ca,t.type,n.startTime)),w(T,Promise.all(o),0)}}))}(t,n,r,a),4);case 4:return pa(t.m),t.A?k.return():(l="video/mp4"==s.mimeType||"audio/mp4"==s.mimeType,c=e.ReadableStream,t.h.lowLatencyMode&&t.l.isLowLatency&&c&&l&&("HLS"!=t.l.type||r.m)?(h=new Uint8Array(0),p=f=!1,m=function(e){var o,u,l;return P((function(c){switch(c.g){case 1:if(f)return c.return();if(p=!0,pa(t.m),t.A)return c.return();if(S(c,2),h=function(e,t){var n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(h,e),o=!1,u=0,(new Ta).box("mdat",(function(e){u=e.size+e.start,o=!0})).parse(h,!1,!0),!o){c.u(4);break}return l=h.subarray(0,u),h=h.subarray(u),w(c,Vu(t,n,i,s,r,l,!0,a),5);case 5:n.W&&n.ia&&gu(n.W,r.startTime,!0);case 4:A(c,0);break;case 2:g=E(c),T(c)}}))},w(k,Ku(t,n,r,m),9)):w(k,Ku(t,n,r),7));case 7:return d=k.h,pa(t.m),t.A?k.return():(pa(t.m),n.jc?(n.Ea=!1,zu(t,n,0),k.return()):w(k,Vu(t,n,i,s,r,d,!1,a),6));case 9:if(v=k.h,g)throw g;if(p){k.u(10);break}return f=!0,pa(t.m),t.A?k.return():n.jc?(n.Ea=!1,zu(t,n,0),k.return()):w(k,Vu(t,n,i,s,r,v,!1,a),10);case 10:n.W&&n.ia&&gu(n.W,r.startTime,!0);case 6:if(pa(t.m),t.A)return k.return();n.Sa=r,u.next(),n.Ea=!1,n.Kf=!1,y=t.g.ca.zb(),b=y[n.type],JSON.stringify(b),n.jc||t.g.Ef(r,n.stream),zu(t,n,0),A(k,0);break;case 2:if(x=E(k),pa(t.m,x),t.A)return k.return();if(n.Ea=!1,7001==x.code)n.Ea=!1,Wu(n),zu(t,n,0),k.u(0);else{if(n.type!=o.wa||!t.h.ignoreTextStreamFailures)return 3017==x.code?w(k,function(e,t,n){var i,r,a;return P((function(o){if(1==o.g){if(Array.from(e.i.values()).some((function(e){return e!=t&&e.Kf})))return o.u(2);if(i=0===e.h.maxDisabledTime&&1011==n.code?1:e.h.maxDisabledTime,e.g.disableStream(t.stream,i))return o.return();if(20<(r=Math.round(100*e.B)))e.B-=.2;else{if(!(4<r))return t.ld=!0,e.A=!0,e.g.onError(n),o.return();e.B-=.04}return t.Kf=!0,a=e.g.hd(),w(o,Hu(e,t,a),2)}zu(e,t,4),T(o)}))}(t,n,x),0):(n.ld=!0,1==x.category&&n.W&&Tu(n.W,r),x.severity=2,w(k,Ju(t,n,x),0));t.i.delete(o.wa),k.u(0)}}}))}(t,n,i,a,o).catch((function(){})),null)}(t,n),null!=a&&(zu(t,n,a),n.ld=!1),A(c,10);break;case 9:return o=E(c),w(c,Ju(t,n,o),11);case 11:return c.return();case 10:if(s=Array.from(t.i.values()),!t.F||!s.every((function(e){return e.endOfStream}))){c.u(0);break}return w(c,t.g.ca.endOfStream(),13);case 13:pa(t.m),0!=(u=t.g.ca.getDuration())&&u<t.l.presentationTimeline.getDuration()&&t.l.presentationTimeline.bb(u),T(c)}}))}(t,n),4)):2!=r.g?A(r,0):(i=E(r),t.g&&t.g.onError(i),void T(r))}))})).$(i))}function Wu(e){null!=e.eb&&(e.eb.stop(),e.eb=null)}function Yu(e){return P((function(t){return e.mb?w(t,e.mb.abort(),0):t.u(0)}))}function Ju(e,t,n){var i;return P((function(r){if(1==r.g)return w(r,Hr(e.K),2);if(pa(e.m),1===n.category&&1003!=n.code){if(t.dc)return Lu(e,!1),r.return();i=0===e.h.maxDisabledTime&&1011==n.code?1:e.h.maxDisabledTime,n.handled=e.g.disableStream(t.stream,i),n.handled&&(n.severity=1)}n.handled&&1011==n.code||e.g.onError(n),n.handled||e.h.failureCallback(n),T(r)}))}function $u(e,t,n){var i,r,a,o,s,u;return t=void 0!==t&&t,n=void 0===n||n,P((function(l){if(1==l.g){if(i=Date.now()/1e3,r=e.h.minTimeBetweenRecoveries,!t){if(!e.h.allowMediaSourceRecoveries||i-e.L<r)return l.return(!1);e.L=i}return a=bi,(o=e.i.get(a.V))&&(o.Oc=null,o.wc=null,o.vc=null,n&&Uu(e,o),Yu(o).catch((function(){})),o.ia&&o.ia.Mf()),(s=e.i.get(a.la))&&(s.Oc=null,s.wc=null,s.vc=null,n&&Uu(e,s),Yu(s).catch((function(){})),s.ia&&s.ia.Mf()),u=new Map,e.j.audio&&u.set(a.V,e.j.audio),e.j.video&&u.set(a.la,e.j.video),w(l,Ds(e.g.ca,u),2)}return!s||s.Ea||s.eb||zu(e,s,0),!o||o.Ea||o.eb||zu(e,o,0),l.return(!0)}))}function Qu(){}function Zu(e,t,n,i,r){var a,o=r in i,s=o?n.constructor==Object&&0==Object.keys(i).length:n.constructor==Object&&0==Object.keys(n).length,u=o||s,l=!0;for(a in t){var c=r+"."+a,d=o?i[r]:n[a];u||a in n?void 0===t[a]?void 0===d||u?delete e[a]:e[a]=kt(d):s?e[a]=t[a]:d.constructor==Object&&t[a]&&t[a].constructor==Object?(e[a]||(e[a]=kt(d)),c=Zu(e[a],t[a],d,i,c),l=l&&c):typeof t[a]!=typeof d||null==t[a]||"function"!=typeof t[a]&&t[a].constructor!=d.constructor?(z("Invalid config, wrong type for "+c),l=!1):("function"==typeof n[a]&&n[a].length!=t[a].length&&W("Unexpected number of arguments for "+c),e[a]=t[a]):(z("Invalid config, unrecognized key "+c),l=!1)}return l}function el(e,t){for(var n={},i=n,r=0,a=0;!(0>(r=e.indexOf(".",r)));)0!=r&&"\\"==e[r-1]||(i[a=e.substring(a,r).replace(/\\\./g,".")]={},i=i[a],a=r+1),r+=1;return i[e.substring(a).replace(/\\\./g,".")]=t,n}function tl(e,t){return e&&t}function nl(e,t){function n(e){return Array.isArray(e)&&0===e.length}function i(e){return e&&"object"==typeof e&&!Array.isArray(e)}return e=function e(t,r){return Object.keys(t).reduce((function(a,o){var s=t[o];return r.hasOwnProperty(o)?i(s)&&i(r[o])?(s=e(s,r[o]),(0<Object.keys(s).length||!i(s))&&(a[o]=s)):n(s)&&n(r[o])||Number.isNaN(s)&&Number.isNaN(r[o])||s!==r[o]&&(a[o]=s):a[o]=s,a}),{})}(e,t),function e(t){for(var r=l(Object.keys(t)),a=r.next();!a.done;a=r.next())i(t[a=a.value])&&0===Object.keys(t[a]).length||n(t[a])||"function"==typeof t[a]?delete t[a]:i(t[a])&&(e(t[a]),0===Object.keys(t[a]).length&&delete t[a])}(e),e}function il(){}function rl(e){return new Gn(e=ft(e)).Fb}function al(e,t,n){function i(e){ve(a).setUint32(o,e.byteLength,!0),o+=4,a.set(ge(e),o),o+=e.byteLength}if(!n||!n.byteLength)throw new De(2,6,6015);var r;r="string"==typeof t?gt(t,!0):t,e=gt(e=ft(e),!0);var a=new Uint8Array(12+e.byteLength+r.byteLength+n.byteLength),o=0;return i(e),i(r),i(n),a}function ol(e,t,n){return"skd"!==t?e:(t=n.serverCertificate,al(e,n=ft(e).split("skd://").pop(),t))}function sl(e,t){2===e&&(t.headers["Content-Type"]="application/octet-stream")}function ul(){}function ll(){var t=1/0;navigator.connection&&navigator.connection.saveData&&(t=360);var n={retryParameters:{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4},servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1,persistentSessionOnlinePlayback:!1,persistentSessionsMetadata:[],initDataTransform:function(e,t,n){return ot()&&"skd"==t&&(t=n.serverCertificate,e=al(e,n=rl(e),t)),e},logLicenseExchange:!1,updateExpirationTime:1,preferredKeySystems:[],keySystemsMapping:{},parseInbandPsshEnabled:Ge(),minHdcpVersion:"",ignoreDuplicateInitData:!rt("Tizen 2")};(Ge()||$e())&&n.preferredKeySystems.push("com.microsoft.playready");var i="reload",r=!1;!ie()||Ke()||$e()||Je()||qe()&&79===We()||!(!ze()||ze()&&nt()||ze()&&rt("Fuchsia"))||tt()&&He()||(i="smooth",r=!0),r={retryParameters:{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4},availabilityWindowOverride:NaN,disableAudio:!1,disableVideo:!1,disableText:!1,disableThumbnails:!1,disableIFrames:!1,defaultPresentationDelay:0,segmentRelativeVttTiming:!1,raiseFatalErrorOnManifestUpdateRequestFailure:!1,continueLoadingWhenPaused:!0,dash:{clockSyncUri:"",ignoreDrmInfo:!1,disableXlinkProcessing:!0,xlinkFailGracefully:!1,ignoreMinBufferTime:!1,autoCorrectDrift:!0,initialSegmentLimit:1e3,ignoreSuggestedPresentationDelay:!1,ignoreEmptyAdaptationSet:!1,ignoreMaxSegmentDuration:!1,keySystemsByURI:{"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e":"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:79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:94ce86fb-07ff-4f43-adb8-93d2fa968ca2":"com.apple.fps"},manifestPreprocessor:dl,manifestPreprocessorTXml:hl,sequenceMode:!1,multiTypeVariantsAllowed:r,useStreamOnceInPeriodFlattening:!1,updatePeriod:-1,enableFastSwitching:!0},hls:{ignoreTextStreamFailures:!1,ignoreImageStreamFailures:!1,defaultAudioCodec:"mp4a.40.2",defaultVideoCodec:"avc1.42E01E",ignoreManifestProgramDateTime:!1,ignoreManifestProgramDateTimeForTypes:[],mediaPlaylistFullMimeType:'video/mp2t; codecs="avc1.42E01E, mp4a.40.2"',liveSegmentsDelay:3,sequenceMode:!(Xe()||rt("Tizen 2")||qe()&&38===We()||$e()),ignoreManifestTimestampsInSegmentsMode:!1,disableCodecGuessing:!1,disableClosedCaptionsDetection:!1,updatePeriod:-1,allowLowLatencyByteRangeOptimization:!0},mss:{manifestPreprocessor:dl,manifestPreprocessorTXml:hl,sequenceMode:!1,keySystemsBySystemId:{"9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready"}}};var a={retryParameters:{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4},failureCallback:function(e){return tl([e])},rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,evictionGoal:1,ignoreTextStreamFailures:!1,alwaysStreamText:!1,startAtSegmentBoundary:!1,gapDetectionThreshold:.5,gapPadding:.01,gapJumpTimerTime:.25,durationBackoff:1,safeSeekOffset:5,safeSeekEndOffset:0,stallEnabled:!0,stallThreshold:1,stallSkip:.1,useNativeHlsForFairPlay:!0,inaccurateManifestTolerance:2,lowLatencyMode:!1,autoLowLatencyMode:!1,forceHTTP:!1,forceHTTPS:!1,minBytesForProgressEvents:16e3,preferNativeHls:!1,updateIntervalSeconds:1,observeQualityChanges:!1,maxDisabledTime:30,segmentPrefetchLimit:0,prefetchAudioLanguages:[],disableAudioPrefetch:!1,disableTextPrefetch:!1,disableVideoPrefetch:!1,liveSync:{enabled:!1,targetLatency:.5,targetLatencyTolerance:.5,maxPlaybackRate:1.1,minPlaybackRate:.95,panicMode:!1,panicThreshold:60,dynamicTargetLatency:{enabled:!1,stabilityThreshold:60,rebufferIncrement:.5,maxAttempts:10,maxLatency:4,minLatency:1}},allowMediaSourceRecoveries:!0,minTimeBetweenRecoveries:5,vodDynamicPlaybackRate:!1,vodDynamicPlaybackRateLowBufferRate:.95,vodDynamicPlaybackRateBufferRatio:.5,infiniteLiveStreamDuration:!1,preloadNextUrlWindow:30,loadTimeout:30,clearDecodingCache:$e()||Je(),dontChooseCodecs:!1,shouldFixTimestampOffset:qe()||Ke()};(qe()||Ke()||ze()||Qe())&&(a.stallSkip=0),Ke()&&(a.gapPadding=2);var o={trackSelectionCallback:function(e){return P((function(t){return t.return(e)}))},downloadSizeCallback:function(e){var t;return P((function(n){return 1==n.g?navigator.storage&&navigator.storage.estimate?w(n,navigator.storage.estimate(),3):n.return(!0):(t=n.h,n.return(t.usage+e<.95*t.quota))}))},progressCallback:function(e,t){return tl([e,t])},usePersistentLicense:!0,numberOfParallelDownloads:5};t={enabled:!0,useNetworkInformation:!0,defaultBandwidthEstimate:1e6,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:t,minPixels:0,maxPixels:1/0,minFrameRate:0,maxFrameRate:1/0,minBandwidth:0,maxBandwidth:1/0,minChannelsCount:0,maxChannelsCount:1/0},advanced:{minTotalBytes:128e3,minBytes:16e3,fastHalfLife:2,slowHalfLife:5},restrictToElementSize:!1,restrictToScreenSize:!1,ignoreDevicePixelRatio:!1,clearBufferSwitch:!1,safeMarginSwitch:0,cacheLoadThreshold:20,minTimeToSwitch:Ye()?.5:0,preferNetworkInformationBandwidth:!1},i={codecSwitchingStrategy:i,addExtraFeaturesToSourceBuffer:function(e){return tl([e],"")},forceTransmux:!1,insertFakeEncryptionInInit:!0,modifyCueCallback:function(e,t){return tl([e,t])},dispatchAllEmsgBoxes:!1};var s=!1,u=!1,c=!0;it()&&(u=s=!0,c=!1);var d={drm:n,manifest:r,streaming:a,mediaSource:i,offline:o,abrFactory:function(){return new Mr},abr:t,autoShowText:3,preferredAudioLanguage:"",preferredAudioLabel:"",preferredTextLanguage:"",preferredVariantRole:"",preferredTextRole:"",preferredAudioChannelCount:2,preferredVideoHdrLevel:"AUTO",preferredVideoLayout:"",preferredVideoLabel:"",preferredVideoCodecs:[],preferredAudioCodecs:[],preferredTextFormats:[],preferForcedSubs:!1,preferSpatialAudio:!1,preferredDecodingAttributes:[],restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:1/0,minPixels:0,maxPixels:1/0,minFrameRate:0,maxFrameRate:1/0,minBandwidth:0,maxBandwidth:1/0,minChannelsCount:0,maxChannelsCount:1/0},playRangeStart:0,playRangeEnd:1/0,textDisplayer:{captionsUpdatePeriod:.25},textDisplayFactory:function(){return null},cmcd:{enabled:!1,sessionId:"",contentId:"",rtpSafetyFactor:5,useHeaders:!1,includeKeys:[]},cmsd:{enabled:!0,applyMaximumSuggestedBitrate:!0,estimatedThroughputWeightRatio:.5},lcevc:{enabled:!1,dynamicPerformanceScaling:!0,logLevel:0,drawLogo:!1},ads:{customPlayheadTracker:s,skipPlayDetection:u,supportsMultipleMediaElements:c,disableHLSInterstitial:!1,disableDASHInterstitial:!1},ignoreHardwareResolution:!1};return o.trackSelectionCallback=function(t){return P((function(n){return n.return(function(t,n,i){var r=i;"AUTO"==r&&(r=e.matchMedia("(color-gamut: p3)").matches?"PQ":"SDR");var a=t.filter((function(e){return!("variant"!=e.type||e.hdr&&e.hdr!=r)}));i=[];var o=Zi(n,a.map((function(e){return e.language})));o&&(i=a.filter((function(e){return Yi(e.language)==o}))),0==i.length&&(i=a.filter((function(e){return e.primary}))),0==i.length&&(a.map((function(e){return e.language})),i=a);var s=i.filter((function(e){return e.height&&480>=e.height}));for(s.length&&(s.sort((function(e,t){return t.height-e.height})),i=s.filter((function(e){return e.height==s[0].height}))),n=[],i.length&&(a=Math.floor(i.length/2),i.sort((function(e,t){return e.bandwidth-t.bandwidth})),n.push(i[a])),i=(t=l(t)).next();!i.done;i=t.next())(i=i.value).type!=yi&&"image"!=i.type||n.push(i);return n}(t,d.preferredAudioLanguage,d.preferredVideoHdrLevel))}))},d}function cl(e,t,n){var i={".drm.keySystemsMapping":"",".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",sessionType:"",serverCertificate:new Uint8Array(0),serverCertificateUri:"",individualizationServer:"",headers:{}}};return Zu(e,t,n||ll(),i,"")}function dl(e){return tl([e],e)}function hl(e){return tl([e],e)}function fl(e,t,n,i){Zr.call(this),this.M=e,this.Y=t,this.Ba=i.networkingEngine,this.B=n,this.o=null,this.xa=0,this.La=i.Gc,this.F=i.yi,this.Na=i.zi,this.g=i.config,this.j=this.G=this.h=null,this.ga=!1,this.H=i.Ji,this.na=!1,this.l=null,this.da=!1,this.i=this.C=null,this.aa=!1,this.L=new Map,this.ta=!1,this.Aa=i.Ii,this.Z=new hu,this.fa=new Gr,this.m=new Gr,this.O=null,this.s=!1,this.Ka=i.Bh,this.ja=null,this.Ga=i.Ah,this.S=!1,this.K=[],this.I=[],this.A=!0}function pl(e,t,n){(e=t?e.I:e.K)?e.push(n):n()}function gl(e,t){if(e.O=t,e.S=!0,e.K)for(var n=(t=l(e.K)).next();!n.done;n=t.next())(n=n.value)();e.K=null}function ml(e){if(e.s)throw new De(2,7,7003)}function vl(e,t){e.dispatchEvent(new Jr("onstatechange",(new Map).set("state",t)))}function yl(e,t,n){var i,r,a,o,s;return P((function(u){return 1==u.g?(i=e.g.streaming.segmentPrefetchLimit||2,r=new fu(i,t,(function(t,n,i){return Xu(t,n,i||null,e.g.streaming.retryParameters,e.Ba,e.A)}),!1),e.L.set(t.id,r),w(u,t.createSegmentIndex(),2)):(a=e.B||0,(s=(o=t.segmentIndex.Jb(a))?o.current():null)||(s=eu(t.segmentIndex)),s?n?s.ba?w(u,mu(r,s.ba),0):u.u(0):w(u,gu(r,s.startTime),0):u.u(0))}))}function bl(e,t){Zr.call(this);var n=this;this.i=e,this.l=t,this.g=new Map,this.m=[{Ec:null,Dc:Sl,tc:function(e,t){return wl(n,"enter",e,t)}},{Ec:Tl,Dc:Sl,tc:function(e,t){return wl(n,"enter",e,t)}},{Ec:xl,Dc:Sl,tc:function(e,t){return wl(n,"enter",e,t)}},{Ec:Sl,Dc:Tl,tc:function(e,t){return wl(n,"exit",e,t)}},{Ec:Sl,Dc:xl,tc:function(e,t){return wl(n,"exit",e,t)}},{Ec:Tl,Dc:xl,tc:function(e,t){return wl(n,"skip",e,t)}},{Ec:xl,Dc:Tl,tc:function(e,t){return wl(n,"skip",e,t)}}],this.h=new Z,this.h.D(this.i,"regionremove",(function(e){n.g.delete(e.region)}))}function wl(e,t,n,i){t=new Jr(t,new Map([["region",n],["seeking",i]])),e.dispatchEvent(t)}Vs.prototype.release=function(){this.h&&(this.h.release(),this.h=null),null!=this.i&&(this.i.release(),this.i=null),this.m=function(){},this.g=null},qs.prototype.release=function(){this.h&&(this.h.stop(),this.h=null),this.g=null},(i=Ws.prototype).ready=function(){var e=this;Bs(this.h,HTMLMediaElement.HAVE_CURRENT_DATA,this.i,(function(){!function(){if(null==e.g||0==e.g&&1/0!=e.h.duration)e.j=!0;else{var t=e.h.currentTime,n=e.g;0>e.g&&(n=Math.max(0,t+e.g)),t!=n?(e.i.pa(e.h,"seeking",(function(){e.j=!0})),e.h.currentTime=n):e.j=!0}}()}))},i.release=function(){this.i&&(this.i.release(),this.i=null),this.h=null},i.Ie=function(e){this.g=this.j?this.g:e},i.Dd=function(){return(this.j?this.h.currentTime:this.g)||0},i.ig=function(){return 0},i.hg=function(){return 0},i.Pg=function(){},(i=Ys.prototype).ready=function(){this.m.Ra(.25)},i.release=function(){this.h&&(this.h.release(),this.h=null),this.j&&(this.j.release(),this.j=null),this.m&&(this.m.stop(),this.m=null),this.i=this.h=this.g=this.l=null,this.A=function(){}},i.Ie=function(e){Gs(this.h,e)},i.Dd=function(){var e=Hs(this.h);return 0<this.i.readyState&&!this.i.paused?Qs(this,e):e},i.ig=function(){return this.o?this.o.o:0},i.hg=function(){return this.j.C},i.Pg=function(){this.j.Ef()},(i=Zs.prototype).getNumReferences=function(){return this.g.length},i.getNumEvicted=function(){return this.i},i.release=function(){this.o||(this.g=[],this.m&&this.m.stop(),this.m=null)},i.Bi=function(){this.o=!0},i.yb=function(e){for(var t=l(this.g),n=t.next();!n.done;n=t.next())e(n.value)},i.find=function(e){for(var t=this.g.length-1,n=t;0<=n;--n){var i=this.g[n],r=n<t?this.g[n+1].startTime:i.endTime;if(e>=i.startTime&&e<r)return n+this.i}return this.g.length&&e<this.g[0].startTime?this.i:null},i.get=function(e){return 0==this.g.length||0>(e-=this.i)||e>=this.g.length?null:this.g[e]},i.offset=function(e){if(!this.o)for(var t=l(this.g),n=t.next();!n.done;n=t.next())n.value.offset(e)},i.Zd=function(e){if(!this.o&&e.length){var t=Math.round(1e3*e[0].startTime)/1e3;this.g=this.g.filter((function(e){return Math.round(1e3*e.startTime)/1e3<t})),this.g.push.apply(this.g,c(e))}},i.td=function(e,t){var n=this;e=e.filter((function(e){return e.endTime>t&&(0==n.g.length||e.endTime>n.g[0].startTime)})),this.Zd(e),this.Ha(t)},i.Ha=function(e){if(!this.o){var t=this.g.length;this.g=this.g.filter((function(t){return t.endTime>e})),this.i+=t-this.g.length}},i.Kc=function(e,t,n){if(n=void 0!==n&&n,!this.o){for(;this.g.length&&this.g[this.g.length-1].startTime>=t;)this.g.pop();for(;this.g.length&&this.g[0].endTime<=e;)this.g.shift(),n||this.i++;0!=this.g.length&&((t=new vo((e=this.g[this.g.length-1]).startTime,t,e.C,e.Ja,e.va,e.ba,e.timestampOffset,e.appendWindowStart,e.appendWindowEnd,e.g,e.tilesLayout,e.A,e.h,e.status,e.aesKey)).mimeType=e.mimeType,t.codecs=e.codecs,t.i=e.i,this.g[this.g.length-1]=t)}},i.ue=function(e,t){var n=this;this.o||(this.m&&this.m.stop(),this.m=new Be((function(){var e=t();e?n.g.push.apply(n.g,c(e)):(n.m.stop(),n.m=null)})),this.m.Ra(e))},Zs.prototype[Symbol.iterator]=function(){return this.Jb(0)},Zs.prototype.Jb=function(e,t,n){t=void 0!==t&&t,n=void 0!==n&&n;var i=this.find(e);if(null==i)return null;var r=this.get(i);n?i++:i--;var a=-1;if(r&&0<r.g.length)for(var o=r.g.length-1;0<=o;--o){var s=r.g[o];if(e>=s.startTime&&e<s.endTime){if(!t){for(;o&&!s.l;)o--,s=r.g[o];if(!s.l)return z("No independent partial segment found!"),null}n?i--:i++,a=o-1;break}}return new nu(this,i,a,n)},F("shaka.media.SegmentIndex",Zs),Zs.forSingleSegment=tu,Zs.prototype.getIteratorForTime=Zs.prototype.Jb,Zs.prototype.updateEvery=Zs.prototype.ue,Zs.prototype.fit=Zs.prototype.Kc,Zs.prototype.evict=Zs.prototype.Ha,Zs.prototype.mergeAndEvict=Zs.prototype.td,Zs.prototype.offset=Zs.prototype.offset,Zs.prototype.get=Zs.prototype.get,Zs.prototype.find=Zs.prototype.find,Zs.prototype.markImmutable=Zs.prototype.Bi,Zs.prototype.release=Zs.prototype.release,Zs.prototype.getNumEvicted=Zs.prototype.getNumEvicted,Zs.prototype.getNumReferences=Zs.prototype.getNumReferences,(i=nu.prototype).Zc=function(e){this.reverse=e},i.Hh=function(){return this.h},i.current=function(){var e=this.i.get(this.h);return e&&0<e.g.length&&e.s&&this.g>=e.g.length&&(this.h++,this.g=0,e=this.i.get(this.h)),e&&0<e.g.length?e.g[this.g]:e},i.next=function(){var e=this.i.get(this.h);return this.reverse?e&&0<e.g.length?(this.g--,0>this.g&&(this.h--,this.g=(e=this.i.get(this.h))&&0<e.g.length?e.g.length-1:0)):(this.h--,this.g=0):e&&0<e.g.length?(this.g++,e.s&&this.g==e.g.length&&(this.h++,this.g=0)):(this.h++,this.g=0),{value:e=this.current(),done:!e}},i.Mf=function(){var e=this.current();if(e.o&&!e.l&&(e=this.i.get(this.h))&&0<e.g.length)for(var t=e.g[this.g];t.l&&!(0>=this.g);)this.g--,t=e.g[this.g]},F("shaka.media.SegmentIterator",nu),nu.prototype.resetToLastIndependent=nu.prototype.Mf,nu.prototype.next=nu.prototype.next,nu.prototype.current=nu.prototype.current,nu.prototype.currentPosition=nu.prototype.Hh,nu.prototype.setReverse=nu.prototype.Zc,m(iu,Zs),(i=iu.prototype).clone=function(){var e=new iu;return e.h=this.h.slice(),e.i=this.i,e},i.release=function(){for(var e=l(this.h),t=e.next();!t.done;t=e.next())t.value.release();this.h=[]},i.yb=function(e){for(var t=l(this.h),n=t.next();!n.done;n=t.next())n.value.yb(e)},i.find=function(e){for(var t=this.i,n=l(this.h),i=n.next();!i.done;i=n.next()){var r=(i=i.value).find(e);if(null!=r)return r+t;t+=i.getNumEvicted()+i.getNumReferences()}return null},i.get=function(e){for(var t=this.i,n=l(this.h),i=n.next();!i.done;i=n.next()){var r=(i=i.value).get(e-t);if(r)return r;r=i.getNumReferences(),t+=i.getNumEvicted()+r}return null},i.offset=function(){},i.Zd=function(){},i.Ha=function(e){for(var t=l(this.h),n=t.next();!n.done;n=t.next())n.value.Ha(e);for(;1<this.h.length&&0==this.h[0].getNumReferences();)e=this.h.shift(),this.i+=e.getNumEvicted(),e.release()},i.td=function(){},i.Kc=function(){},i.ue=function(){},F("shaka.media.MetaSegmentIndex",iu),iu.prototype.updateEvery=iu.prototype.ue,iu.prototype.fit=iu.prototype.Kc,iu.prototype.mergeAndEvict=iu.prototype.td,iu.prototype.evict=iu.prototype.Ha,iu.prototype.merge=iu.prototype.Zd,iu.prototype.offset=iu.prototype.offset,iu.prototype.get=iu.prototype.get,iu.prototype.find=iu.prototype.find,iu.prototype.forEachTopLevelReference=iu.prototype.yb,iu.prototype.release=iu.prototype.release,ru.prototype.release=function(){this.set(this.oc()),this.h&&(this.h.stop(),this.h=null),this.g=null},ru.prototype.set=function(e){this.i=e,au(this)},ru.prototype.oc=function(){return this.g.oc()},ou.prototype.release=function(){this.i.stop();for(var e=l(this.g),t=e.next();!t.done;t=e.next())t.value.release();this.g.clear()},fu.prototype.Ha=function(e,t){t=void 0!==t&&t;for(var n=l(this.h.keys()),i=n.next();!i.done;i=n.next())e>(i=i.value).endTime&&Tu(this,i);t&&bu(this)},fu.prototype.Zc=function(e){this.o=e,this.g&&this.g.Zc(e)},Su.prototype.abort=function(){this.wd&&this.wd.abort()},m(Au,Zr),Au.prototype.release=function(){this.g.clear(),this.h.stop(),Zr.prototype.release.call(this)},m(Eu,Zr),Eu.prototype.release=function(){this.g.clear(),Zr.prototype.release.call(this)},Eu.prototype.j=function(e){for(var t=l(this.g.values()),n=t.next();!n.done;n=t.next()){var i=(n=n.value).Se;e:{for(var r=n.yd,a=r.length-1;0<=a;a--){var o=r[a];if(o.position<=e){r=o.Qc;break e}}r=null}a=r&&!(i===r||i&&r&&i.bandwidth==r.bandwidth&&i.audioSamplingRate==r.audioSamplingRate&&i.codecs==r.codecs&&i.contentType==r.contentType&&i.frameRate==r.frameRate&&i.height==r.height&&i.mimeType==r.mimeType&&i.channelsCount==r.channelsCount&&i.pixelAspectRatio==r.pixelAspectRatio&&i.width==r.width),o=r&&i&&r.label&&i.label&&i.label!==r.label;var s=r&&i&&r.language&&i.language&&i.language!==r.language;i=r&&i&&r.roles&&i.roles&&!Ce(i.roles,r.roles),(o||s||i)&&ku(this,e,r.contentType)&&(n.Se=r,i=new Jr("audiotrackchange",new Map([["quality",r],["position",e]])),this.dispatchEvent(i)),a&&ku(this,e,r.contentType)&&(n.Se=r,JSON.stringify(r),n=new Jr("qualitychange",new Map([["quality",r],["position",e]])),this.dispatchEvent(n))}},(i=Pu.prototype).destroy=function(){return this.m.destroy()},i.configure=function(e){if(this.h=e,this.K=new Vr({maxAttempts:Math.max(e.retryParameters.maxAttempts,2),baseDelay:e.retryParameters.baseDelay,backoffFactor:e.retryParameters.backoffFactor,fuzzFactor:e.retryParameters.fuzzFactor,timeout:0,stallTimeout:0,connectionTimeout:0},!0),e.disableAudioPrefetch){var t=this.i.get("audio");t&&t.W&&(yu(t.W),t.W=null);for(var n=(t=l(this.o.keys())).next();!n.done;n=t.next())n=n.value,yu(this.o.get(n)),this.o.delete(n)}for(e.disableTextPrefetch&&(t=this.i.get(yi))&&t.W&&(yu(t.W),t.W=null),e.disableVideoPrefetch&&(t=this.i.get("video"))&&t.W&&(yu(t.W),t.W=null),n=(t=l(this.i.keys())).next();!n.done;n=t.next())(n=this.i.get(n.value)).W?(wu(n.W,e.segmentPrefetchLimit),0<e.segmentPrefetchLimit||(yu(n.W),n.W=null)):0<e.segmentPrefetchLimit&&(n.W=Bu(this,n.stream));e.disableAudioPrefetch||function(e){for(var t=e.h.segmentPrefetchLimit,n=e.h.prefetchAudioLanguages,i=l(e.l.variants),r=i.next(),a={};!r.done;a={pb:void 0},r=i.next())if(a.pb=r.value,a.pb.audio)if(e.o.has(a.pb.audio)){if(wu(r=e.o.get(a.pb.audio),t),!(0<t&&n.some(function(e){return function(t){return qi(e.pb.audio.language,t)}}(a)))){var o=e.i.get(a.pb.audio.type);r!==(o&&o.W)&&yu(r),e.o.delete(a.pb.audio)}}else 0>=t||!n.some(function(e){return function(t){return qi(e.pb.audio.language,t)}}(a))||!(r=Bu(e,a.pb.audio))||(a.pb.audio.segmentIndex||a.pb.audio.createSegmentIndex(),e.o.set(a.pb.audio,r))}(this)},i.start=function(e){var t=this;return P((function(n){if(1==n.g)return w(n,function(e,t){var n,i,r,a,o,s,u,c,d;return P((function(h){if(1==h.g){if(n=bi,!e.j)throw new De(2,5,5006);return i=new Map,r=new Set,e.j.audio&&(i.set(n.V,e.j.audio),r.add(e.j.audio)),e.j.video&&(i.set(n.la,e.j.video),r.add(e.j.video)),e.s&&(i.set(n.wa,e.s),r.add(e.s)),w(h,e.g.ca.init(i,e.l.sequenceMode,e.l.type,e.l.ignoreManifestTimestampsInSegmentsMode),2)}for(pa(e.m),e.updateDuration(),a=l(i.keys()),o=a.next();!o.done;o=a.next())s=o.value,u=i.get(s),e.i.has(s)||(c=_u(e,u),t.has(u.id)&&(pu(d=t.get(u.id),(function(t,n,i){return Xu(t,n,i||null,e.h.retryParameters,e.g.Nb)})),c.W=d),e.i.set(s,c),zu(e,c,0));T(h)}))}(t,e||new Map),2);pa(t.m),t.F=!0,T(n)}))},i.Xc=function(){if(this.g)for(var e=this.g.hd(),t=l(this.i.keys()),n=t.next();!n.done;n=t.next()){var i=n.value;n=this.i.get(i);var r=this.g.ca;if(!(r=i==yi?null!=(r=r.h).g&&null!=r.h&&e>=r.g&&e<r.h:xo(r=bs(r,i),e))){if(n.W&&(n.W.g=null),"audio"===n.type)for(var a=(r=l(this.o.values())).next();!a.done;a=r.next())a.value.g=null;n.ia=null,(null!=ys(this.g.ca,i)||n.Ea)&&Uu(this,n),n.mb&&(n.mb.abort(),n.mb=null),i===yi&&(i=this.g.ca).H&&i.H.g(),n.Xc=!0}}},i.updateDuration=function(){var e=this.l.presentationTimeline.getDuration();1/0>e?this.g.ca.bb(e):this.g.ca.bb(this.h.infiniteLiveStreamDuration?1/0:Math.pow(2,32))},F("shaka.util.ConfigUtils",Qu),Qu.getDifferenceFromConfigObjects=nl,Qu.convertToConfigObject=el,Qu.mergeConfigObjects=Zu,F("shaka.util.FairPlayUtils",il),il.commonFairPlayResponse=function(e,t){if(2===e){try{var n=dt(t.data)}catch(e){return}e=!1,"<ckc>"===(n=n.trim()).substr(0,5)&&"</ckc>"===n.substr(-6)&&(n=n.slice(5,-6),e=!0);try{var i=JSON.parse(n);i.ckc&&(n=i.ckc,e=!0),i.CkcMessage&&(n=i.CkcMessage,e=!0),i.License&&(n=i.License,e=!0)}catch(e){}e&&(t.data=pe(ui(n)))}},il.expressplayFairPlayRequest=function(e,t){sl(e,t)},il.conaxFairPlayRequest=function(e,t){sl(e,t)},il.ezdrmFairPlayRequest=function(e,t){sl(e,t)},il.verimatrixFairPlayRequest=function(e,t){2===e&&(e=si(e=ge(t.body)),t.headers["Content-Type"]="application/x-www-form-urlencoded",t.body=pt("spc="+e))},il.expressplayInitDataTransform=function(e,t,n){return ol(e,t,n)},il.conaxInitDataTransform=function(t,n,i){if("skd"!==n)return t;n=i.serverCertificate,i=ft(t).split("skd://").pop().split("?").shift(),i=e.atob(i);var r=new ArrayBuffer(2*i.length);r=me(r);for(var a=0,o=i.length;a<o;a++)r[a]=i.charCodeAt(a);return al(t,r,n)},il.ezdrmInitDataTransform=function(e,t,n){return"skd"!==t?e:(t=n.serverCertificate,al(e,n=ft(e).split(";").pop(),t))},il.verimatrixInitDataTransform=function(e,t,n){return ol(e,t,n)},il.initDataTransform=al,il.defaultGetContentId=rl,il.isFairPlaySupported=function(){var e;return P((function(t){return 1==t.g?(e={initDataTypes:["cenc","sinf","skd"],videoCapabilities:[{contentType:'video/mp4; codecs="avc1.42E01E"'}]},S(t,2),w(t,navigator.requestMediaKeySystemAccess("com.apple.fps",[e]),4)):2!=t.g?t.return(!0):(E(t),t.return(!1))}))},F("shaka.util.PlayerConfiguration",ul),ul.mergeConfigObjects=cl,ul.createDefault=ll,m(fl,Zr),(i=fl.prototype).getStartTime=function(){return this.B},i.Mc=function(){return this.M},i.kf=function(){return this.h},i.getStats=function(){return this.Z},i.start=function(){var e,t=this;P((function(n){switch(n.g){case 1:return w(n,Promise.resolve(),2);case 2:return S(n,3),w(n,function(e){var t,n,i,r;return P((function(a){switch(a.g){case 1:if(vl(e,"manifest-parser"),e.j||(e.G=lo(e.M,e.Y),e.j=e.G(),e.j.configure(e.g.manifest,(function(){return e.A}))),t=Date.now()/1e3,vl(e,"manifest"),e.h){a.u(2);break}return w(a,e.j.start(e.M,e.Na),3);case 3:e.h=a.h;case 2:return e.fa.resolve(),n=new Jr("manifestparsed",void 0),w(a,Promise.resolve(),4);case 4:if(e.dispatchEvent(n),0==e.h.variants.length)throw new De(2,4,4036);!function(e){function t(e){return e.video&&e.audio||e.video&&e.video.codecs.includes(",")}e.variants.some(t)&&(e.variants=e.variants.filter(t))}(e.h),i=Date.now()/1e3,r=i-t,e.Z.H=r,T(a)}}))}(t),5);case 5:return ml(t),w(n,function(e){var t,n,i;return P((function(r){switch(r.g){case 1:if(vl(e,"drm-engine"),e.xa=Date.now()/1e3,e.l=e.La(),e.F.h=e.l,e.l.configure(e.g.drm,(function(){return e.A})),!io(e.F,e.h)){r.u(2);break}return t=new Jr("trackschanged",void 0),w(r,Promise.resolve(),3);case 3:ml(e),e.dispatchEvent(t);case 2:return n=br(e.h.variants),w(r,ja(e.l,n,e.h.offlineSessionIds),4);case 4:return ml(e),w(r,no(e.F,e.h),5);case 5:if(!r.h){r.u(0);break}return i=new Jr("trackschanged",void 0),w(r,Promise.resolve(),7);case 7:e.dispatchEvent(i),T(r)}}))}(t),6);case 6:return ml(t),w(n,function(e){var t,n,i,r,a,o;return P((function(s){return e.o||(e.o=new Or(e.g.preferredAudioLanguage,e.g.preferredVariantRole,e.g.preferredAudioChannelCount,e.g.preferredVideoHdrLevel,e.g.preferSpatialAudio,e.g.preferredVideoLayout,e.g.preferredAudioLabel,e.g.preferredVideoLabel,e.g.mediaSource.codecSwitchingStrategy,"")),e.Ga&&(t=e.g.abrFactory,e.C=t,e.i=t(),e.i.configure(e.g.abr)),e.Ka?(n=e.h.presentationTimeline.U(),i=br(e.h.variants),r=e.o.create(i),e.i.configure(e.g.abr),e.i.setVariants(Array.from(r.values())),(a=e.i.chooseVariant())?(o=[],e.ja=a,a.video&&o.push(yl(e,a.video,n)),a.audio&&o.push(yl(e,a.audio,n)),w(s,Promise.all(o),0)):s.u(0)):s.u(0)}))}(t),7);case 7:return ml(t),w(n,function(e){return P((function(t){return 1==t.g?e.K?w(t,e.m,3):t.u(0):w(t,Promise.all(e.Y.map((function(e){return e.promise}))),0)}))}(t.l),8);case 8:ml(t),t.m.resolve(),A(n,0);break;case 3:(e=E(n))instanceof De&&(7001==e.code||7003==e.code)||t.m.reject(e),T(n)}}))},i.dispatchEvent=function(e){return this.O?this.O.dispatchEvent(e):Zr.prototype.dispatchEvent.call(this,e)},i.onError=function(e){2===e.severity&&(this.m.reject(e),this.destroy());var t=(new Map).set("detail",e);t=new Jr("error",t),this.dispatchEvent(t),t.defaultPrevented&&(e.handled=!0)},i.configure=function(e,t){e=el(e,t),cl(this.g,e)},i.getConfiguration=function(){return kt(this.g)},i.jj=function(){return this.m},i.destroy=function(){var e,t,n=this;return P((function(i){switch(i.g){case 1:if(n.s=!0,!n.j||n.ga){i.u(2);break}return w(i,n.j.stop(),2);case 2:if(!n.i||n.aa){i.u(4);break}return w(i,n.i.stop(),4);case 4:if(n.H&&!n.na&&n.H.release(),!n.l||n.da){i.u(6);break}return w(i,n.l.destroy(),6);case 6:if(0<n.L.size&&!n.ta)for(e=l(n.L.values()),t=e.next();!t.done;t=e.next())yu(t.value);T(i)}}))},F("shaka.media.PreloadManager",fl),fl.prototype.destroy=fl.prototype.destroy,fl.prototype.waitForFinish=fl.prototype.jj,m(bl,Zr),bl.prototype.release=function(){this.i=null,this.g.clear(),this.h.release(),this.h=null,Zr.prototype.release.call(this)},bl.prototype.j=function(e,t){if(!this.l||0!=e){this.l=!1;for(var n=l(this.i.g),i=n.next();!i.done;i=n.next()){i=i.value;var r=this.g.get(i),a=e<i.startTime?Tl:e>i.endTime?xl:Sl;this.g.set(i,a);for(var o=l(this.m),s=o.next();!s.done;s=o.next())(s=s.value).Ec==r&&s.Dc==a&&s.tc(i,t)}}};var Tl=1,Sl=2,xl=3;function Al(e,t,n){var i,r,a,o,s,u,l;return P((function(c){switch(c.g){case 1:var d=new Gn(e).Ua.split("/").pop().split(".");return i=1==d.length?"":d.pop().toLowerCase(),(r=El[i])?c.return(r):(a=0,o=aa([e],n),S(c,2),o.method="HEAD",w(c,t.request(a,o).promise,4));case 4:s=c.h,r=s.headers["content-type"],A(c,3);break;case 2:if(!(u=E(c))||1002!=u.code&&1001!=u.code){c.u(3);break}return o.method="GET",w(c,t.request(a,o).promise,6);case 6:l=c.h,r=l.headers["content-type"];case 3:return c.return(r?r.toLowerCase().split(";").shift():"")}}))}var El={mp4:"video/mp4",m4v:"video/mp4",m4a:"audio/mp4",webm:"video/webm",weba:"audio/webm",mkv:"video/webm",ts:"video/mp2t",ogv:"video/ogg",ogg:"audio/ogg",mpg:"video/mpeg",mpeg:"video/mpeg",m3u8:"application/x-mpegurl",mpd:"application/dash+xml",ism:"application/vnd.ms-sstr+xml",mp3:"audio/mpeg",aac:"audio/aac",flac:"audio/flac",wav:"audio/wav",sbv:"text/x-subviewer",srt:"text/srt",vtt:"text/vtt",webvtt:"text/vtt",ttml:"application/ttml+xml",lrc:"application/x-subtitle-lrc",ssa:"text/x-ssa",ass:"text/x-ssa",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"};function kl(e,t){if(e.lineBreak)return"\n";if(e.nestedCues.length)return e.nestedCues.map((function(t){return kl(t,e)})).join("");if(!e.payload)return e.payload;var n=[],i=e.fontWeight>=Mn,r=e.fontStyle==Dn,a=e.textDecoration.includes(Pn);return i&&n.push(["b"]),r&&n.push(["i"]),a&&n.push(["u"]),""==(r=e.color)&&t&&(r=t.color),i="",(r=Il(r))&&(i+="."+r),""==(r=e.backgroundColor)&&t&&(r=t.backgroundColor),(t=Il(r))&&(i+=".bg_"+t),i&&n.push(["c",i]),n.reduceRight((function(e,t){var n=l(t);return"<"+(t=n.next().value)+(void 0===(n=n.next().value)?"":n)+">"+e+"</"+t+">"}),e.payload)}function Il(e){var t=(e=e.toLowerCase()).replace(/\s/g,"").match(/^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i);switch(t?e="#"+(256|parseInt(t[1],10)).toString(16).slice(1)+(256|parseInt(t[2],10)).toString(16).slice(1)+(256|parseInt(t[3],10)).toString(16).slice(1):e.startsWith("#")&&7<e.length&&(e=e.slice(0,7)),e){case"white":case"#fff":case"#ffffff":return"white";case"lime":case"#0f0":case"#00ff00":return"lime";case"cyan":case"#0ff":case"#00ffff":return"cyan";case"red":case"#f00":case"#ff0000":return"red";case"yellow":case"#ff0":case"#ffff00":return"yellow";case"magenta":case"#f0f":case"#ff00ff":return"magenta";case"blue":case"#00f":case"#0000ff":return"blue";case"black":case"#000":case"#000000":return"black"}return null}function Ml(e,t){for(var n=[],i=(e=l(Cl(e))).next();!i.done;i=e.next())if((i=i.value).isContainer)n.push.apply(n,c(Ml(i.nestedCues,i)));else{var r=i.clone();r.nestedCues=[],r.payload=kl(i,t),n.push(r)}return n}function Cl(e){for(var t=[],n=(e=l(e)).next(),i={};!n.done;i={Pe:void 0},n=e.next())i.Pe=n.value,t.some(function(e){return function(t){return cn(e.Pe,t)}}(i))||t.push(i.Pe);return t}function Dl(e){function t(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return(t>>>0).toString()}if(e.startTime>=e.endTime)return null;var n=new VTTCue(e.startTime,e.endTime,e.payload);n.id=t(e.startTime.toString())+t(e.endTime.toString())+t(e.payload),n.lineAlign=e.lineAlign,n.positionAlign=e.positionAlign,e.size&&(n.size=e.size);try{n.align=e.textAlign}catch(e){}return"center"==e.textAlign&&"center"!=n.align&&(n.align="middle"),"vertical-lr"==e.writingMode?n.vertical="lr":"vertical-rl"==e.writingMode&&(n.vertical="rl"),1==e.lineInterpretation&&(n.snapToLines=!1),null!=e.line&&(n.line=e.line),null!=e.position&&(n.position=e.position),n}function Rl(e){if(1/0===e.endTime||e.endTime<e.startTime)return null;var t=new un(e.startTime,e.endTime,e.text);return t.line="number"==typeof e.line?e.line:null,e.lineAlign&&(t.lineAlign=e.lineAlign),t.lineInterpretation=e.snapToLines?Sn:1,t.position="number"==typeof e.position?e.position:null,e.positionAlign&&(t.positionAlign=e.positionAlign),t.size=e.size,t.textAlign=e.align,"lr"===e.vertical?t.writingMode="vertical-lr":"rl"===e.vertical&&(t.writingMode="vertical-rl"),e.region&&(t.region.id=e.region.id,t.region.height=e.region.lines,t.region.heightUnits=2,t.region.regionAnchorX=e.region.regionAnchorX,t.region.regionAnchorY=e.region.regionAnchorY,t.region.scroll=e.region.scroll,t.region.viewportAnchorX=e.region.viewportAnchorX,t.region.viewportAnchorY=e.region.viewportAnchorY,t.region.viewportAnchorUnits=Ae,t.region.width=e.region.width,t.region.widthUnits=Ae),dn(t),t}function Pl(e,t){this.g=null;for(var n=l(Array.from(e.textTracks)),i=n.next();!i.done;i=n.next())"metadata"!==(i=i.value).kind&&"chapters"!==i.kind&&(i.mode="disabled",i.label==t&&(this.g=i));this.g||(this.g=e.addTextTrack("subtitles",t)),this.g.mode="hidden"}function Ll(e,t){var n=e.mode;e.mode="showing"==n?"showing":"hidden";for(var i=l(Array.from(e.cues)),r=i.next();!r.done;r=i.next())(r=r.value)&&t(r)&&e.removeCue(r);e.mode=n}function Nl(){}function jl(t,n,i){var r=this;document.fullscreenEnabled||W("Using UITextDisplayer in a browser without Fullscreen API support causes subtitles to not be rendered in fullscreen"),this.m=!1,this.h=[],this.A=t,this.s=n,this.l=null,this.g=document.createElement("div"),this.g.classList.add("shaka-text-container"),this.g.style.textAlign="center",this.g.style.display="flex",this.g.style.flexDirection="column",this.g.style.alignItems="center",this.g.style.justifyContent="flex-end",this.s.appendChild(this.g),i&&i.captionsUpdatePeriod||oe("UITextDisplayer w/ config","Please migrate to initializing UITextDisplayer with a config."),this.C=new Be((function(){r.A.paused||_l(r)})).Ra(i&&i.captionsUpdatePeriod?i.captionsUpdatePeriod:.25),this.i=new Map,this.j=new Z,this.j.D(document,"fullscreenchange",(function(){_l(r,!0)})),this.j.D(this.A,"seeking",(function(){_l(r,!0)})),this.j.D(this.A,"resize",(function(){var e=r.A,t=e.videoWidth;e=e.videoHeight,r.l=t&&e?t/e:null})),this.o=null,"ResizeObserver"in e&&(this.o=new ResizeObserver((function(){_l(r,!0)})),this.o.observe(this.g)),this.B=new Map}function Ol(e,t){for(;null!=t;){if(t==e.g)return!0;t=t.parentElement}return!1}function Ul(e,t,n,i,r){for(var a=!1,o=[],s=[],u=(t=l(t)).next();!u.done;u=t.next()){u=u.value,r.push(u);var c=e.i.get(u),d=u.startTime<=i&&u.endTime>i,h=c?c.th:null;c&&(o.push(c.Re),c.Ac&&o.push(c.Ac),d||(a=!0,e.i.delete(u),c=null)),d&&(s.push(u),c?Ol(e,h)||(a=!0):(Bl(e,u,r),h=(c=e.i.get(u)).th,a=!0)),0<u.nestedCues.length&&h&&Ul(e,u.nestedCues,h,i,r),r.pop()}if(a){for(r=(i=l(o)).next();!r.done;r=i.next())(r=r.value).parentElement&&r.parentElement.removeChild(r);for(s.sort((function(e,t){return e.startTime!=t.startTime?e.startTime-t.startTime:e.endTime-t.endTime})),i=(s=l(s)).next();!i.done;i=s.next())(i=e.i.get(i.value)).Ac?(i.Ac.contains(n)&&i.Ac.removeChild(n),n.appendChild(i.Ac),i.Ac.appendChild(i.Re)):n.appendChild(i.Re)}}function _l(e,t){if(e.g){var n=e.A.currentTime;if(!e.m||void 0!==t&&t){for(var i=(t=l(e.B.values())).next();!i.done;i=t.next())Mo(i.value);Mo(e.g),e.i.clear(),e.B.clear()}e.m&&Ul(e,e.h,e.g,n,[])}}function Bl(e,t,n){var i=1<n.length,r=i?"span":"div";t.lineBreak&&(r="br"),t.rubyTag&&(r=t.rubyTag),i=!i&&0<t.nestedCues.length;var a=document.createElement(r);if("br"!=r&&function(e,t,n,i,r){var a=t.style,o=0==n.nestedCues.length,s=1<i.length;a.whiteSpace="pre-wrap";var u=n.payload.replace(/\s+$/g,(function(e){return" ".repeat(e.length)}));if(a.webkitTextStrokeColor=n.textStrokeColor,a.webkitTextStrokeWidth=n.textStrokeWidth,a.color=n.color,a.direction=n.direction,a.opacity=n.opacity,a.paddingLeft=Fl(n.linePadding,n,e.s),a.paddingRight=Fl(n.linePadding,n,e.s),a.textCombineUpright=n.textCombineUpright,a.textShadow=n.textShadow,n.backgroundImage)a.backgroundImage="url('"+n.backgroundImage+"')",a.backgroundRepeat="no-repeat",a.backgroundSize="contain",a.backgroundPosition="center",n.backgroundColor&&(a.backgroundColor=n.backgroundColor),a.width="100%",a.height="100%";else{if(n.nestedCues.length)var l=t;else l=document.createElement("span"),t.appendChild(l);n.border&&(l.style.border=n.border),r||((t=function(e,t){for(var n=e.length-1;0<=n;n--){var i=t(e[n]);if(i||0===i)return i}return null}(i,(function(e){return e.backgroundColor})))?l.style.backgroundColor=t:u&&(l.style.backgroundColor="rgba(0, 0, 0, 0.8)")),u&&(l.textContent=u)}s&&!i[i.length-1].isContainer?a.display="inline":(a.display="flex",a.flexDirection="column",a.alignItems="center","left"==n.textAlign||"start"==n.textAlign?(a.width="100%",a.alignItems="start"):"right"!=n.textAlign&&"end"!=n.textAlign||(a.width="100%",a.alignItems="end"),a.justifyContent="before"==n.displayAlign?"flex-start":"center"==n.displayAlign?"center":"flex-end"),o||(a.margin="0"),a.fontFamily=n.fontFamily,a.fontWeight=n.fontWeight.toString(),a.fontStyle=n.fontStyle,a.letterSpacing=n.letterSpacing,a.fontSize=Fl(n.fontSize,n,e.s),null!=(i=n.line)&&((o=n.lineInterpretation)==Sn&&(o=1,s=16,e.l&&1>e.l&&(s=32),i=0>i?100+i/s*100:i/s*100),1==o&&(a.position="absolute",n.writingMode==Tn?(a.width="100%",n.lineAlign==xn?a.top=i+"%":"end"==n.lineAlign&&(a.bottom=100-i+"%")):"vertical-lr"==n.writingMode?(a.height="100%",n.lineAlign==xn?a.left=i+"%":"end"==n.lineAlign&&(a.right=100-i+"%")):(a.height="100%",n.lineAlign==xn?a.right=i+"%":"end"==n.lineAlign&&(a.left=100-i+"%")))),a.lineHeight=n.lineHeight,e=function(e){var t=e.direction,n=e.positionAlign;return e=e.textAlign,n!==gn?n:"left"===e||"start"===e&&t===wn||"end"===e&&"rtl"===t?"line-left":"right"===e||"start"===e&&"rtl"===t||"end"===e&&t===wn?"line-right":"center"}(n),"line-left"==e?(a.cssFloat="left",null!==n.position&&(a.position="absolute",n.writingMode==Tn?(a.left=n.position+"%",a.width="auto"):a.top=n.position+"%")):"line-right"==e?(a.cssFloat="right",null!==n.position&&(a.position="absolute",n.writingMode==Tn?(a.right=100-n.position+"%",a.width="auto"):a.bottom=n.position+"%")):null!==n.position&&50!=n.position&&(a.position="absolute",n.writingMode==Tn?(a.left=n.position+"%",a.width="auto"):a.top=n.position+"%"),a.textAlign=n.textAlign,a.textDecoration=n.textDecoration.join(" "),a.writingMode=n.writingMode,"writingMode"in document.documentElement.style&&a.writingMode==n.writingMode||(a.webkitWritingMode=n.writingMode),n.size&&(n.writingMode==Tn?a.width=n.size+"%":a.height=n.size+"%")}(e,a,t,n,i),n=null,t.region&&t.region.id){var o=t.region,s=e.l===4/3?2.5:1.9;if(n=o.id+"_"+o.width+"x"+o.height+(o.heightUnits==Ae?"%":"px")+"-"+o.viewportAnchorX+"x"+o.viewportAnchorY+(o.viewportAnchorUnits==Ae?"%":"px"),e.B.has(n))n=e.B.get(n);else{r=document.createElement("span");var u=o.heightUnits==Ae?"%":"px",l=o.widthUnits==Ae?"%":"px",c=o.viewportAnchorUnits==Ae?"%":"px";r.id="shaka-text-region---"+n,r.classList.add("shaka-text-region"),r.style.position="absolute";var d=o.height,h=o.width;2===o.heightUnits&&(d=5.33*o.height,u="%"),2===o.widthUnits&&(h=o.width*s,l="%"),r.style.height=d+u,r.style.width=h+l,2===o.viewportAnchorUnits?(s=o.viewportAnchorY/75*100,u=o.viewportAnchorX/(e.l===4/3?160:210)*100,s-=o.regionAnchorY*d/100,u-=o.regionAnchorX*h/100,r.style.top=s+"%",r.style.left=u+"%"):(r.style.top=o.viewportAnchorY-o.regionAnchorY*d/100+c,r.style.left=o.viewportAnchorX-o.regionAnchorX*h/100+c),0!==o.heightUnits&&0!==o.widthUnits&&0!==o.viewportAnchorUnits&&(o=Math.max(0,Math.min(100-(parseInt(r.style.width.slice(0,-1),10)||0),parseInt(r.style.left.slice(0,-1),10)||0)),r.style.top=Math.max(0,Math.min(100-(parseInt(r.style.height.slice(0,-1),10)||0),parseInt(r.style.top.slice(0,-1),10)||0))+"%",r.style.left=o+"%"),r.style.display="flex",r.style.flexDirection="column",r.style.alignItems="center",r.style.justifyContent="before"==t.displayAlign?"flex-start":"center"==t.displayAlign?"center":"flex-end",e.B.set(n,r),n=r}}r=a,i&&((r=document.createElement("span")).classList.add("shaka-text-wrapper"),r.style.backgroundColor=t.backgroundColor,r.style.lineHeight="normal",a.appendChild(r)),e.i.set(t,{Re:a,th:r,Ac:n})}function Fl(e,t,n){var i=(i=new RegExp(/(\d*\.?\d+)([a-z]+|%+)/).exec(e))?{value:Number(i[1]),unit:i[2]}:null;if(!i)return e;var r=i.value;switch(i.unit){case"%":return r/100*n.clientHeight/t.cellResolution.rows+"px";case"c":return n.clientHeight*r/t.cellResolution.rows+"px";default:return e}}function Vl(e,t){this.h=e,this.g=t,this.i=void 0,this.l=!1,this.o=!0,this.j=this.m=!1}function Hl(t){return t.g.sessionId||(t.g.sessionId=e.crypto.randomUUID()),{v:1,sf:t.i,sid:t.g.sessionId,cid:t.g.contentId,mtp:t.h.getBandwidthEstimate()/1e3}}function Gl(e,t,n){n=void 0===n?{}:n;var i=void 0===i?e.g.useHeaders:i;if(e.g.enabled){Object.assign(n,Hl(e)),n.pr=e.h.ib();var r=n.ot===Wl||n.ot===Yl;if(e.m&&r&&(n.bs=!0,n.su=!0,e.m=!1),null==n.su&&(n.su=e.o),e=function(e,t){var n=e.g.includeKeys;return n.length?Object.keys(t).reduce((function(e,i){return n.includes(i)&&(e[i]=t[i]),e}),{}):t}(e,n),i)i=function(e){for(var t=Object.keys(e),n={},i=["Object","Request","Session","Status"],r=[{},{},{},{}],a={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},o=(t=l(t)).next();!o.done;o=t.next())r[null!=a[o=o.value]?a[o]:1][o]=e[o];for(e=0;e<r.length;e++)(a=Xl(r[e]))&&(n["CMCD-"+i[e]]=a);return n}(e),Object.keys(i).length&&Object.assign(t.headers,i);else{var a=Xl(e);a&&(t.uris=t.uris.map((function(e){return ql(e,a)})))}}}function Kl(e,t){if(!(t=e.h.zb()[t]).length)return 0;var n=e.h.getCurrentTime();return(e=t.find((function(e){return e.start<=n&&e.end>=n})))?1e3*(e.end-n):0}function Xl(e){function t(e){return 100*n(e/100)}function n(e){return Math.round(e)}for(var i,r=[],a={br:n,d:n,bl:t,dl:t,mtp:t,nor:function(e){return encodeURIComponent(e)},rtp:t,tb:n},o=Object.keys(e||{}).sort(),s=(o=l(o)).next();!s.done;s=o.next()){var u=e[s=s.value];if(i=u,!(Number.isNaN(i)||null==i||""===i||!1===i||"v"===s&&1===u||"pr"==s&&1===u)){var c,d=a[s];d&&(u=d(u)),c="string"==(d=typeof u)&&"ot"!==s&&"sf"!==s&&"st"!==s?s+"="+JSON.stringify(u):"boolean"===d?s:"symbol"===d?s+"="+u.description:s+"="+u,r.push(c)}}return r.join(",")}function ql(e,t){return!t||e.includes("offline:")?e:((e=new Gn(e)).g.set("CMCD",t),e.toString())}(i=Pl.prototype).configure=function(){},i.remove=function(e,t){return!!this.g&&(Ll(this.g,(function(n){return n.startTime<t&&n.endTime>e})),!0)},i.append=function(e){var t=Ml(e),n=[];e=this.g.cues?Array.from(this.g.cues):[];for(var i=(t=l(t)).next(),r={};!i.done;r={Nc:void 0},i=t.next())r.Nc=i.value,!e.some(function(e){return function(t){return t.startTime==e.Nc.startTime&&t.endTime==e.Nc.endTime&&t.text==e.Nc.payload}}(r))&&r.Nc.payload&&(i=Dl(r.Nc))&&n.push(i);for(t=(e=l(e=n.slice().sort((function(e,t){return e.startTime!=t.startTime?e.startTime-t.startTime:e.endTime!=t.endTime?e.endTime-t.startTime:"line"in VTTCue.prototype?n.indexOf(t)-n.indexOf(e):n.indexOf(e)-n.indexOf(t)})))).next();!t.done;t=e.next())this.g.addCue(t.value)},i.destroy=function(){return this.g&&(Ll(this.g,(function(){return!0})),this.g.mode="disabled"),this.g=null,Promise.resolve()},i.isTextVisible=function(){return"showing"==this.g.mode},i.setTextVisibility=function(e){this.g.mode=e?"showing":"hidden"},i.setTextLanguage=function(){},F("shaka.text.SimpleTextDisplayer",Pl),Pl.prototype.setTextLanguage=Pl.prototype.setTextLanguage,Pl.prototype.setTextVisibility=Pl.prototype.setTextVisibility,Pl.prototype.isTextVisible=Pl.prototype.isTextVisible,Pl.prototype.destroy=Pl.prototype.destroy,Pl.prototype.append=Pl.prototype.append,Pl.prototype.remove=Pl.prototype.remove,Pl.prototype.configure=Pl.prototype.configure,(i=Nl.prototype).configure=function(){},i.remove=function(){},i.append=function(){},i.destroy=function(){},i.isTextVisible=function(){return!1},i.setTextVisibility=function(){},i.setTextLanguage=function(){},F("shaka.text.StubTextDisplayer",Nl),Nl.prototype.setTextLanguage=Nl.prototype.setTextLanguage,Nl.prototype.setTextVisibility=Nl.prototype.setTextVisibility,Nl.prototype.isTextVisible=Nl.prototype.isTextVisible,Nl.prototype.destroy=Nl.prototype.destroy,Nl.prototype.append=Nl.prototype.append,Nl.prototype.remove=Nl.prototype.remove,Nl.prototype.configure=Nl.prototype.configure,(i=jl.prototype).configure=function(e){this.C&&this.C.Ra(e.captionsUpdatePeriod)},i.append=function(e){for(var t=[].concat(c(this.h)),n=(e=l(Cl(e))).next(),i={};!n.done;i={Qe:void 0},n=e.next())i.Qe=n.value,t.some(function(e){return function(t){return cn(t,e.Qe)}}(i))||this.h.push(i.Qe);_l(this)},i.destroy=function(){return this.g?(this.s.removeChild(this.g),this.g=null,this.m=!1,this.h=[],this.C&&this.C.stop(),this.i.clear(),this.j&&(this.j.release(),this.j=null),this.o&&(this.o.disconnect(),this.o=null),Promise.resolve()):Promise.resolve()},i.remove=function(e,t){if(!this.g)return!1;var n=this.h.length;return this.h=this.h.filter((function(n){return n.startTime<e||n.endTime>=t})),_l(this,n>this.h.length),!0},i.isTextVisible=function(){return this.m},i.setTextVisibility=function(e){this.m=e,_l(this,!0)},i.setTextLanguage=function(e){e&&"und"!=e?this.g.setAttribute("lang",e):this.g.setAttribute("lang","")},F("shaka.text.UITextDisplayer",jl),jl.prototype.setTextLanguage=jl.prototype.setTextLanguage,jl.prototype.setTextVisibility=jl.prototype.setTextVisibility,jl.prototype.isTextVisible=jl.prototype.isTextVisible,jl.prototype.remove=jl.prototype.remove,jl.prototype.destroy=jl.prototype.destroy,jl.prototype.append=jl.prototype.append,jl.prototype.configure=jl.prototype.configure,F("shaka.text.WebVttGenerator",(function(){})),Vl.prototype.configure=function(e){this.g=e};var zl="a",Wl="v",Yl="av",Jl="tt",$l="d",Ql="ld",Zl="h",ec="lh";function tc(e){this.h=e,this.g=null}function nc(e){return!e||"false"!==e.toLowerCase()&&(/^[-0-9]/.test(e)?parseInt(e,10):e.replace(/["]+/g,""))}F("shaka.util.CmcdManager.StreamingFormat",{DASH:$l,Dj:Ql,HLS:Zl,Ej:ec,Rj:"s",OTHER:"o"}),(i=tc.prototype).configure=function(e){this.h=e},i.Cg=function(){return this.h.enabled&&this.h.applyMaximumSuggestedBitrate&&this.g&&this.g.has(rc)?1e3*this.g.get(rc):null},i.Ag=function(){return this.h.enabled&&this.g&&this.g.has(ic)?1e3*this.g.get(ic):null},i.bi=function(){return this.h.enabled&&this.g&&this.g.has(ac)?this.g.get(ac):null},i.ci=function(){return this.h.enabled&&this.g&&this.g.has(oc)?this.g.get(oc):null},i.getBandwidthEstimate=function(e){var t=this.Ag();if(!t)return e;var n=this.h.estimatedThroughputWeightRatio;return 0<n&&1>=n?e*(1-n)+t*n:e},F("shaka.util.CmsdManager",tc),tc.prototype.getBandwidthEstimate=tc.prototype.getBandwidthEstimate,tc.prototype.getRoundTripTime=tc.prototype.ci,tc.prototype.getResponseDelay=tc.prototype.bi,tc.prototype.getEstimatedThroughput=tc.prototype.Ag,tc.prototype.getMaxBitrate=tc.prototype.Cg;var ic="etp",rc="mb",ac="rd",oc="rtt";function sc(){this.g=null,this.h=[]}function uc(e,t){return P((function(n){if(1==n.g)return e.g?w(n,new Promise((function(t){return e.h.push(t)})),2):n.u(2);e.g=t,T(n)}))}function lc(t,n,i){n=void 0===n?null:n,Zr.call(this);var r=this;this.m=ad,this.h=null,this.ge=n,this.ja=!1,this.te=new Z,this.od=new Z,this.l=new Z,this.Ga=new Z,this.Na=new Z,this.F=this.I=this.C=this.G=null,this.Ce=0,this.Z=new sc,this.ga=this.Ka=this.Y=this.i=this.La=this.H=this.j=this.ac=this.L=this.gg=this.da=this.O=this.bc=this.M=this.ie=this.K=this.Hb=null,this.Ba=!1,this.ta=this.o=null,this.fg=1e9,this.ud=[],this.eg=-1,this.g=Nc(this),this.S=null,this.Ee=-1,this.Aa=null,this.fa={width:1/0,height:1/0},this.de=new to(this.g,this.fa,null),this.le=[],this.A=null,this.xa=new Or(this.g.preferredAudioLanguage,this.g.preferredVariantRole,this.g.preferredAudioChannelCount,this.g.preferredVideoHdrLevel,this.g.preferSpatialAudio,this.g.preferredVideoLayout,this.g.preferredAudioLabel,this.g.preferredVideoLabel,this.g.mediaSource.codecSwitchingStrategy,""),this.Gb=this.g.preferredTextLanguage,this.sd=this.g.preferredTextRole,this.rd=this.g.preferForcedSubs,this.qd=[],i&&i(this),this.O=function(e){return new Vl({getBandwidthEstimate:function(){return e.o?e.o.getBandwidthEstimate():NaN},zb:function(){return e.zb()},getCurrentTime:function(){return e.h?e.h.currentTime:0},ib:function(){return e.ib()},Ab:function(){return e.Ab()},rc:function(){return e.rc()},U:function(){return e.U()}},e.g.cmcd)}(this),this.da=new tc(this.g.cmsd),this.G=Sc(this),this.G.Tf(this.g.streaming.forceHTTP),this.G.Uf(this.g.streaming.forceHTTPS),this.G.m=this.g.streaming.minBytesForProgressEvents,this.Ib=this.aa=this.s=null,this.Ge=!1,this.Fe=new Be((function(){return P((function(e){return 1==e.g?r.aa?w(e,r.Tb(r.Ib,!0),3):e.u(0):4!=e.g?w(e,r.load(r.aa),4):(r.Ge?r.Ib.pause():r.Ib.play(),r.aa=null,r.Ge=!1,void T(e))}))})),cd&&(this.s=cd(),this.s.configure(this.g.ads),this.Na.D(this.s,"ad-content-pause-requested",(function(e){var t;return P((function(n){if(1==n.g)return r.Fe.stop(),r.aa?n.u(0):(r.Ib=r.h,r.Ge=r.h.ended,t=e.saveLivePosition||!1,w(n,r.tg(!0,t),3));r.aa=n.h,T(n)}))})),this.Na.D(this.s,"ad-content-resume-requested",(function(e){if(e=e.offset||0,r.aa){var t=r.aa;t.B&&e&&(t.B+=e)}r.Fe.$(.1)})),this.Na.D(this.s,"ad-content-attach-requested",(function(){return P((function(e){return r.h||!r.Ib?e.u(0):w(e,r.Tb(r.Ib,!0),0)}))}))),this.te.D(e,"online",(function(){Yc(r),r.Nf()})),this.je=new Be((function(){for(var e=Date.now()/1e3,t=!1,n=!0,i=l(r.i.variants),a=i.next();!a.done;a=i.next())0<(a=a.value).disabledUntilTime&&a.disabledUntilTime<=e&&(a.disabledUntilTime=0,t=!0),0<a.disabledUntilTime&&(n=!1);n&&r.je.stop(),t&&Fc(r,!1,void 0,!1,!1)})),this.na=null,t&&(oe("Player w/ mediaElement","Please migrate from initializing Player with a mediaElement; use the attach method instead."),this.Tb(t,!0)),this.B=null}function cc(e){null!=e.L&&(cs(e.L),e.L.release(),e.L=null)}function dc(e,t){return new Jr(e,t)}function hc(e,t){e.dispatchEvent(dc("onstatechange",(new Map).set("state",t)))}function fc(e,t){var n;return P((function(i){return 1==i.g?(n=++e.Ce,w(i,uc(e.Z,t),2)):n!=e.Ce?(e.Z.release(),i.return(!0)):i.return(!1)}))}function pc(e,t){var n,i;return t=void 0!==t&&t,P((function(r){if(1==r.g)return n=null,e.i&&e.H&&e.La&&e.Y?(i=e.h.currentTime,e.U()&&!t&&(i=null),w(r,mc(e,e.Y,i,e.Ka,!0,!1,!1),3)):r.u(2);if(2!=r.g){n=r.h,e.le.push(n),e.H&&e.H.setMediaElement&&e.H.setMediaElement(null);var a=n,o=e.H,s=e.La;a.h=e.i,a.j=o,a.G=s,a=n,o=e.ta,a.i=e.o,a.C=o,n.o=e.xa,n.start(),e.i=null,e.H=null,e.La=null,e.o=null,e.ta=null}return r.return(n)}))}function gc(e,t,n,i,r){var a,o,s;return r=void 0!==r&&r,P((function(u){return 1==u.g?i?u.u(2):w(u,vc(e,t),3):(2!=u.g&&(i=u.h),function(e,t){if(!Fe())return!0;if(t){if(""==(e.h||at()).canPlayType(t))return!1;if(!Fe()||!(t in co))return!0;if(Pi(t))return Ye()&&(e.g.drm.servers["com.apple.fps"]||e.g.drm.servers["com.apple.fps.1_0"])?e.g.streaming.useNativeHlsForFairPlay:e.g.streaming.preferNativeHls}return!1}(e,i)?u.return(null):(a=!1,o=!0,r&&(e.o&&e.ta==e.g.abrFactory&&(o=!1),e.h&&"AUDIO"===e.h.nodeName&&(a=!0)),s=mc(e,t,n,i||null,!r,a,o),s=r?s.then((function(e){return e.A=!1,e})):s.then((function(t){return e.le.push(t),t})),u.return(s)))}))}function mc(e,t,n,i,r,a,o){var s,u,c,d,h,f,p,g,m,v,y,b,S;return r=void 0===r||r,a=void 0!==a&&a,o=void 0===o||o,P((function(x){return 1==x.g?(s=null,u=kt(e.g),a&&(u.manifest.disableVideo=!0),c=function(){return s.S&&s.s?null:s},d=function(){return c()?c().getConfiguration():e.g},h=function(t,n){c()?s.configure(t,n):e.configure(t,n)},1/0!=e.fa.width||1/0!=e.fa.height||e.g.ignoreHardwareResolution?x.u(2):w(x,st(),3)):(2!=x.g&&(f=x.h,e.fa.width=f.width,e.fa.height=f.height),p=new to(u,e.fa,null),g={networkingEngine:e.G,filter:function(e){var t;return P((function(n){return 1==n.g?w(n,no(p,e),2):4!=n.g?n.h?(t=dc("trackschanged"),w(n,Promise.resolve(),4)):n.u(0):(s.dispatchEvent(t),void T(n))}))},makeTextStreamsForClosedCaptions:function(t){return function(e,t){for(var n=new Set,i=l(t.textStreams),r=i.next();!r.done;r=i.next())"application/cea-608"!=(r=r.value).mimeType&&"application/cea-708"!=r.mimeType||n.add(r.originalId);for(r=(i=l(t.variants)).next();!r.done;r=i.next())if((r=r.value.video)&&r.closedCaptions)for(var a=l(r.closedCaptions.keys()),o=a.next();!o.done;o=a.next())if(o=o.value,!n.has(o)){var s=o.startsWith("CC")?"application/cea-608":"application/cea-708",u=new iu,c=r.closedCaptions.get(o);s={id:e.fg++,originalId:o,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:u,mimeType:s,codecs:"",kind:"caption",encrypted:!1,drmInfos:[],keyIds:new Set,language:c,originalLanguage:c,label:null,type:yi,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:r.roles,forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set([xi(s,"")]),isAudioMuxedInVideo:!1},t.textStreams.push(s),n.add(o)}}(e,t)},onTimelineRegionAdded:function(e){var t=s.H;e:{for(var n=l(t.g),i=n.next();!i.done;i=n.next())if((i=i.value).schemeIdUri==e.schemeIdUri&&i.id==e.id&&i.startTime==e.startTime&&i.endTime==e.endTime){n=i;break e}n=null}null==n&&(t.g.add(e),e=new Jr("regionadd",new Map([["region",e]])),t.dispatchEvent(e))},onEvent:function(e){return s.dispatchEvent(e)},onError:function(e){return s.onError(e)},isLowLatencyMode:function(){return d().streaming.lowLatencyMode},isAutoLowLatencyMode:function(){return d().streaming.autoLowLatencyMode},enableLowLatencyMode:function(){h("streaming.lowLatencyMode",!0)},updateDuration:function(){e.j&&s.S&&e.j.updateDuration()},newDrmInfo:function(e){var t=s.l,n=t?t.g:null;n&&t.A&&ao(p,n.keySystem,e)},onManifestUpdated:function(){var t=(new Map).set("isLive",e.U());s.dispatchEvent(dc("manifestupdated",t)),pl(s,!1,(function(){e.s&&e.s.onManifestUpdated(e.U())}))},getBandwidthEstimate:function(){return e.o.getBandwidthEstimate()},onMetadata:function(t,n,i,r){var a=t;"com.apple.hls.interstitial"==t&&(a="com.apple.quicktime.HLS",t={startTime:n,endTime:i,values:r},e.s)&&e.s.onHLSInterstitialMetadata(e,e.h,t),t=(r=l(r)).next();for(var o={};!t.done;o={If:void 0},t=r.next())o.If=t.value,"ID"!=o.If.name&&pl(s,!1,function(t){return function(){Tc(e,n,i,a,t.If)}}(o))},disableStream:function(t){return e.disableStream(t,e.g.streaming.maxDisabledTime)},addFont:function(t,n){return e.addFont(t,n)}},(m=new Au((function(){return e.Qb()}))).addEventListener("regionadd",(function(t){var n=t.region;$c(e,"timelineregionadded",n,s),pl(s,!1,(function(){e.s&&(e.s.onDashTimedMetadata(n),e.s.onDASHInterstitialMetadata(e,e.h,n))}))})),v=null,u.streaming.observeQualityChanges&&((v=new Eu((function(){return e.zb()}))).addEventListener("qualitychange",(function(t){Qc(e,t.quality,t.position)})),v.addEventListener("audiotrackchange",(function(t){Qc(e,t.quality,t.position,!0)}))),y=!0,b={Nb:e.G,onError:function(e){return s.onError(e)},ee:function(t){pl(s,!0,(function(){var n=t,i=dc("keystatuschanged");e.dispatchEvent(i);var r=Object.keys(n);1==r.length&&""==r[0]&&(r=["00"],n={"00":n[""]}),i=1==r.length&&"00"==r[0];var a=!1;if(r.length)for(var o=(r=l(e.i.variants)).next();!o.done;o=r.next()){var s=[];(o=o.value).audio&&s.push(o.audio),o.video&&s.push(o.video);for(var u=(s=l(s)).next();!u.done;u=s.next()){var c=u.value;if(u=o.allowedByKeySystem,c.keyIds.size){o.allowedByKeySystem=!0;for(var d=(c=l(c.keyIds)).next();!d.done;d=c.next())d=d.value,((d=n[i?"00":d])||e.C.F)&&(o.allowedByKeySystem=o.allowedByKeySystem&&!!d&&!so.includes(d))}u!=o.allowedByKeySystem&&(a=!0)}}a&&(Gc(e),!Bc(e))||(n=e.j.j)&&!n.allowedByKeySystem&&Fc(e)}))},onExpirationUpdated:function(e,t){var n=dc("expirationupdated");s.dispatchEvent(n),(n=s.j)&&n.onExpirationUpdated&&n.onExpirationUpdated(e,t)},onEvent:function(t){s.dispatchEvent(t),"drmsessionupdate"==t.type&&y&&(y=!1,t=Date.now()/1e3-s.xa,(e.A||s.getStats()).j=t,e.L&&cs(e.L))}},S=Sc(e,c),ra(e.G,S),s=new fl(t,i,n,{config:u,zi:g,Ji:m,Ii:v,Gc:function(){return e.Gc(b)},yi:p,networkingEngine:S,Bh:r,Ah:o}),x.return(s))}))}function vc(e,t){var n,i;return P((function(r){return 1==r.g?(n=e.g.manifest.retryParameters,w(r,Al(t,e.G,n),2)):("application/x-mpegurl"==(i=r.h)&&Ye()&&(i="application/vnd.apple.mpegurl"),r.return(i))}))}function yc(e){var t=e.g.textDisplayFactory;t!==e.Ae&&(e.B=t(),e.B.configure?e.B.configure(e.g.textDisplayer):oe("Text displayer w/ configure",'Text displayer should have a "configure" method!'),e.Ae=t,e.B.setTextVisibility(e.ja))}function bc(e){var t,n,i;return P((function(r){if(1==r.g)return hc(e,"media-source"),e.h.removeAttribute("src"),Mo(e.h),yc(e),t=function(e,t,n,i){return new hs(e,t,n,i)}(e.h,e.B,{Uh:function(){return e.keySystem()},onMetadata:function(t,n,i){for(var r=(t=l(t)).next();!r.done;r=t.next())if((r=r.value).data&&"number"==typeof r.cueTime&&r.frames){var a=r.cueTime+n,o=i;o&&a>o&&(o=a);for(var s=l(r.frames),u=s.next();!u.done;u=s.next())Tc(e,a,o,"org.id3",u.value);e.s&&e.s.onHlsTimedMetadata(r,a)}},onEvent:function(t){return e.dispatchEvent(t)},Fi:function(){e.H&&e.H.update&&e.H.update()}},e.L),t.configure(e.g.mediaSource),n=e.g.manifest,i=n.segmentRelativeVttTiming,t.xa=i,w(r,t.S,2);e.I=t,T(r)}))}function wc(e,t,n){function i(){return Oc(e)}e.l.D(t,"playing",i),e.l.D(t,"pause",i),e.l.D(t,"ended",i),e.l.D(t,"ratechange",(function(){var t=e.h.playbackRate;0!=t&&(e.K&&e.K.set(t),t=dc("ratechange"),e.dispatchEvent(t))})),t.remote&&(e.l.D(t.remote,"connect",(function(){return Gc(e)})),e.l.D(t.remote,"connecting",(function(){return Gc(e)})),e.l.D(t.remote,"disconnect",(function(){return P((function(n){if(1==n.g)return e.j&&"disconnected"==t.remote.state?w(n,$u(e.j),2):n.u(2);Gc(e),T(n)}))}))),t.audioTracks&&(e.l.D(t.audioTracks,"addtrack",(function(){return Gc(e)})),e.l.D(t.audioTracks,"removetrack",(function(){return Gc(e)})),e.l.D(t.audioTracks,"change",(function(){return Gc(e)}))),t.textTracks&&(e.l.D(t.textTracks,"addtrack",(function(t){if(t.track)switch(t=t.track,t.kind){case"metadata":!function(e,t){if("metadata"==t.kind){t.mode="hidden",e.l.D(t,"cuechange",(function(){if(t.activeCues)for(var n=l(t.activeCues),i=n.next();!i.done;i=n.next())i=i.value,Tc(e,i.startTime,i.endTime,i.type,i.value),e.s&&e.s.onCueMetadataChange(i.value);if(t.cues){n=[];for(var r=(i=l(t.cues)).next(),a={};!r.done;a={Vb:void 0},r=i.next())a.Vb=r.value,"com.apple.quicktime.HLS"==a.Vb.type&&null!=a.Vb.startTime&&(r=n.find(function(e){return function(t){return t.startTime==e.Vb.startTime&&t.endTime==e.Vb.endTime}}(a)),r||(r={startTime:a.Vb.startTime,endTime:a.Vb.endTime,values:[]},n.push(r)),r.values.push(a.Vb.value));for(i=(n=l(n)).next();!i.done;i=n.next())(i=i.value).values.some((function(e){return"X-ASSET-URI"==e.key||"X-ASSET-LIST"==e.key}))&&e.s&&(i.values.push({key:"CUE",description:"",data:0!=i.startTime||e.U()?"ONCE":"ONCE,PRE",mimeType:null,pictureType:null}),e.s.onHLSInterstitialMetadata(e,e.h,i))}}));var n=new Be((function(){for(var t=function(e){return Array.from(e.h.textTracks).filter((function(e){return"metadata"==e.kind}))}(e),n=(t=l(t)).next();!n.done;n=t.next())n.value.mode="hidden"})).hc().$(.5);e.qd.push((function(){n.stop()}))}}(e,t);break;case"chapters":!function(e,t){if(t&&"chapters"==t.kind){t.mode="hidden";var n=new Be((function(){t.mode="hidden"})).hc().$(.5);e.qd.push((function(){n.stop()}))}}(e,t);break;default:Gc(e)}})),e.l.D(t.textTracks,"removetrack",(function(){return Gc(e)})),e.l.D(t.textTracks,"change",(function(){return Gc(e)}))),"none"!=t.preload&&e.l.pa(t,"loadedmetadata",(function(){e.A.C=Date.now()/1e3-n}))}function Tc(e,t,n,i,r){t=(new Map).set("startTime",t).set("endTime",n).set("metadataType",i).set("payload",r),e.dispatchEvent(dc("metadata",t))}function Sc(e,t){function n(n){t()?t().dispatchEvent(n):e.dispatchEvent(n)}function i(e){t()?pl(t(),!0,e):e()}return t||(t=function(){return null}),new na((function(n,i,r,a){var o=t()?t().i:e.o;o&&o.segmentDownloaded(n,i,r,a)}),(function(t,r,a){n(dc("downloadheadersreceived",r=(new Map).set("headers",t).set("request",r).set("requestType",a))),i((function(){if(e.da){var n=e.da;if(n.h.enabled){var i=t["cmsd-static"];if(i)try{var r=new Map,a=i.split(",");for(i=0;i<a.length;i++){var o=a[i].split("=");r.set(o[0],nc(o[1]))}}catch(e){}if(r=t["cmsd-dynamic"]){try{var s=new Map,u=r.split(";");for(r=1;r<u.length;r++){var l=u[r].split("=");s.set(l[0],nc(l[1]))}var c=s}catch(e){c=null}c&&(n.g=c)}}}}))}),(function(e,t,i,r){n(dc("downloadfailed",e=(new Map).set("request",e).set("error",t).set("httpResponseCode",i).set("aborted",r)))}),(function(t,n,r){i((function(){var i=e.O,a=r;if(a=void 0===a?{}:a,i.g.enabled)if("HEAD"===n.method)Gl(i,n);else switch(t){case 0:try{if(i.g.enabled){if(a.type){e:{switch(a.type){case 4:var o=i.j?Ql:$l;break e;case 3:case 2:o=i.j?ec:Zl;break e;case 5:o="s";break e}o=void 0}i.i=o}Gl(i,n,{ot:"m",su:!i.l})}}catch(e){Y("CMCD_MANIFEST_ERROR","Could not generate manifest CMCD data.",e)}break;case ca:try{if(i.g.enabled){var s=a.segment;o=0,s&&(o=s.endTime-s.startTime);var u={d:1e3*o,st:i.h.U()?"l":"v"};u.ot=function(e){if(0===e.type)return"i";if(e=e.stream){var t=e.type;if("video"==t)return e.codecs&&e.codecs.includes(",")?Yl:Wl;if("audio"==t)return zl;if("text"==t)return"application/mp4"===e.mimeType?Jl:"c"}}(a);var c=u.ot===Wl||u.ot===zl||u.ot===Yl||u.ot===Jl,d=a.stream;if(d){var h=i.h.ib();if(c&&(u.bl=function(e,t){if(!(t=e.h.zb()[t]).length)return NaN;var n=e.h.getCurrentTime();return(e=t.find((function(e){return e.start<=n&&e.end>=n})))?1e3*(e.end-n):NaN}(i,d.type),u.ot!==Jl)){var f=Kl(i,d.type);u.dl=h?f/Math.abs(h):f}if(d.bandwidth&&(u.br=d.bandwidth/1e3),d.segmentIndex&&s){var p=d.segmentIndex.Jb(s.endTime,!0,0>h);if(p){var g=p.next().value;if(g&&g!=s){if(!Ce(s.N(),g.N())){var m=g.N()[0],v=n.uris[0],y=new URL(m),b=new URL(v);if(y.origin!==b.origin)var w=m;else{for(var T=y.pathname.split("/").slice(1),S=b.pathname.split("/").slice(1,-1);T[0]===S[0];)T.shift(),S.shift();for(;S.length;)S.shift(),T.unshift("..");w=T.join("/")}u.nor=w}if((g.Ja||g.va)&&(s.Ja!=g.Ja||s.va!=g.va)){var x=g.Ja+"-";g.va&&(x+=g.va),u.nrr=x}}}var A=i.h.ib()||1,E=Kl(i,d.type)||500,k=d.bandwidth,I=k?k*(s.endTime-s.startTime)/1e3/(E/A/1e3)*i.g.rtpSafetyFactor:NaN;isNaN(I)||(u.rtp=I)}}c&&u.ot!==Jl&&(u.tb=function(e,t){var n=e.h.rc();if(!n.length)return NaN;e=n[0];for(var i=(n=l(n)).next();!i.done;i=n.next())"variant"===(i=i.value).type&&i.bandwidth>e.bandwidth&&(e=i);switch(t){case Wl:return e.videoBandwidth||NaN;case zl:return e.audioBandwidth||NaN;default:return e.bandwidth}}(i,u.ot)/1e3),Gl(i,n,u)}}catch(e){Y("CMCD_SEGMENT_ERROR","Could not generate segment CMCD data.",e)}break;case 2:case 5:case 6:Gl(i,n,{ot:"k"});break;case 4:Gl(i,n,{ot:"o"})}}))}),(function(n,i,r,a){(n=t()?t().j:e.H)&&n.banLocation&&n.banLocation(a)}),(function(n,i){if(i.data){i=i.data.byteLength;var r=t()?t().getStats():e.A;r&&(r.kc=isNaN(r.kc)?i:r.kc+i,0===n&&(r.Kg=i))}}))}function xc(e,t,n){e.M=new Ur,e.M.g=Br,_r(e.M,n,Math.min(.5,n/2)),jc(e),e.ie=new Be((function(){Ac(e)})).Ra(.25),e.l.D(t,"waiting",(function(){return Ac(e)})),e.l.D(t,"stalled",(function(){return Ac(e)})),e.l.D(t,"canplaythrough",(function(){return Ac(e)})),e.l.D(t,"progress",(function(){return Ac(e)}))}function Ac(e){switch(e.m){case sd:if(e.h.ended)var t=!0;else{var n=So(e.h.buffered);t=null!=n&&n>=e.h.duration-1}break;case od:e:if(e.h.ended||ms(e.I))t=!0;else{if(e.i.presentationTimeline.U()){n=e.i.presentationTimeline.Yb();var i=So(e.h.buffered);if(null!=i&&i>=n){t=!0;break e}}t=!1}break;default:t=!1}i=Ao(e.h.buffered,e.h.currentTime);var r=t,a=(n=e.M).i.get(n.g);t=n.g,i=r||i>=a?Fr:Br,n.g=i,(t=t!=i)&&i===Fr&&(n.h=Date.now()),t&&jc(e)}function Ec(e){if(e.de=new to(e.g,e.fa,e.C),e.H){var t=kt(e.g.manifest);e.h&&"AUDIO"===e.h.nodeName&&(t.disableVideo=!0),e.H.configure(t)}if(e.C&&e.C.configure(e.g.drm),e.j){e.j.configure(e.g.streaming);try{e.m!=rd&&ro(e.de,e.i)&&Gc(e)}catch(t){Jc(e,t)}e.o&&Bc(e),!(t=e.j.j)||t.allowedByApplication&&t.allowedByKeySystem||Fc(e)}if(e.G&&(e.G.Tf(e.g.streaming.forceHTTP),e.G.Uf(e.g.streaming.forceHTTPS),e.G.m=e.g.streaming.minBytesForProgressEvents),e.I&&(e.I.configure(e.g.mediaSource),e.I.xa=e.g.manifest.segmentRelativeVttTiming),e.B)if(t=e.g.textDisplayFactory,e.Ae!=t){var n=e.B;if(e.B=t(),e.B.configure?e.B.configure(e.g.textDisplayer):oe("Text displayer w/ configure",'Text displayer should have a "configure" method!'),e.B.setTextLanguage||oe("Text displayer w/ setTextLanguage",'Text displayer should have a "setTextLanguage" method!'),e.B.setTextVisibility(n.isTextVisible()),n.destroy(),e.I){n=e.I;var i=e.B;n.fa=i,n.h&&(n.h.j=i)}e.Ae=t,e.j&&(n=(t=e.j).i.get(yi))&&Ou(t,n.stream,!0,0,!0)}else e.B.configure&&e.B.configure(e.g.textDisplayer);e.o&&(e.o.configure(e.g.abr),e.g.abr.enabled?e.o.enable():e.o.disable(),zc(e)),e.M&&(t=e.g.streaming.rebufferingGoal,e.i&&(t=Math.max(t,e.i.minBufferTime)),_r(e.M,t,Math.min(.5,t/2))),e.i&&ed(e.i.presentationTimeline,e.g.playRangeStart,e.g.playRangeEnd),e.s&&e.s.configure(e.g.ads),e.O&&e.O.configure(e.g.cmcd),e.da&&e.da.configure(e.g.cmsd)}function kc(e){return e&&(e=/(\d+)x(\d+)/.exec(e))?{lc:parseInt(e[1],10),rows:parseInt(e[2],10)}:null}function Ic(e,t){e.l.D(t,"cuechange",(function(){e.B.remove(0,Math.max(0,e.h.currentTime-e.g.streaming.bufferBehind));var n=Array.from(t.activeCues||[]).map(Rl).filter(Gi);e.B.append(n)})),t.mode=document.pictureInPictureElement?"showing":"hidden"}function Mc(e){return Array.from(e.h.textTracks).filter((function(e){return"metadata"!=e.kind&&"chapters"!=e.kind&&"Shaka Player TextTrack"!=e.label}))}function Cc(e){return Array.from(e.h.textTracks).filter((function(e){return"chapters"==e.kind}))}function Dc(e,t){var n;return P((function(i){switch(i.g){case 1:return S(i,2),w(i,Al(t,e.G,e.g.streaming.retryParameters),4);case 4:n=i.h,A(i,3);break;case 2:E(i);case 3:if(n)return i.return(n);throw new De(1,2,2011,t)}}))}function Rc(e,t,n,i,r,a,o){var s,u,l,c;return P((function(d){if(1==d.g)return"text/vtt"!=r||o.length?w(d,Pc(e,t,e.G,e.g.streaming.retryParameters),3):d.u(2);2!=d.g&&(s=d.h,u=Lc(e,s,r,o),l=new Blob([u],{type:"text/vtt"}),t=Rs(l),r="text/vtt"),c=document.createElement("track");var h=e.O,f=t;try{if(h.g.enabled){var p=Hl(h);p.ot="c",p.su=!0;var g=ql(f,Xl(p))}else g=f}catch(e){Y("CMCD_TEXT_TRACK_ERROR","Could not generate text track CMCD data.",e),g=f}return c.src=g,c.label=a,c.kind=i,c.srclang=n,e.h.getAttribute("crossorigin")||e.h.setAttribute("crossorigin","anonymous"),e.h.appendChild(c),d.return(c)}))}function Pc(e,t,n,i){var r,a,o;return P((function(s){if(1==s.g){r=ca,(a=aa([t],i)).method="GET";var u=e.O;try{u.g.enabled&&Gl(u,a,{ot:"c",su:!0})}catch(e){Y("CMCD_TEXT_ERROR","Could not generate text CMCD data.",e)}return w(s,n.request(r,a).promise,2)}return o=s.h,s.return(o.data)}))}function Lc(e,t,n,i){var r=Fi[n];if(r)return n=r(),e={periodStart:0,segmentStart:0,segmentEnd:e.h.duration,vttOffset:0},t=ge(t),function(e,t){function n(e){for(var n=e,i=l(t),r=i.next();!r.done;r=i.next())(r=r.value).end&&r.start<e&&(n+=r.end-r.start);return(10>(e=Math.floor(n/3600))?"0":"")+e+":"+(10>(i=Math.floor(n/60%60))?"0":"")+i+":"+(10>(r=Math.floor(n%60))?"0":"")+r+"."+(100>(n=Math.floor(1e3*n%1e3))?10>n?"00":"0":"")+n}var i=Ml(e);e="WEBVTT\n\n";for(var r=(i=l(i)).next();!r.done;r=i.next())e+=n((r=r.value).startTime)+" --\x3e "+n(r.endTime)+function(e){var t=[];switch(e.textAlign){case"left":t.push("align:left");break;case"right":t.push("align:right");break;case mn:t.push("align:middle");break;case"start":t.push("align:start");break;case"end":t.push("align:end")}switch(e.writingMode){case"vertical-lr":t.push("vertical:lr");break;case"vertical-rl":t.push("vertical:rl")}return t.length?" "+t.join(" "):""}(r)+"\n",e+=r.payload+"\n\n";return e}(t=n.parseMedia(t,e,null,[]),i);throw new De(2,2,2014,n)}function Nc(e){var t=ll();return t.streaming.failureCallback=function(t){if(e.U()){var n=null;1001==t.code||1002==t.code?(n=1,e.g.streaming.lowLatencyMode&&(n=.1)):1003==t.code&&(n=.1),null!=n&&(t.severity=1,e.Nf(n))}},t.textDisplayFactory=function(){if(!e.ge||et()&&!document.fullscreenEnabled)return HTMLMediaElement.prototype.addTextTrack?new Pl(e.h,"Shaka Player TextTrack"):new Nl;var t=e.getConfiguration();return new jl(e.h,e.ge,t.textDisplayer)},t}function jc(e){var t=e.tf();if(e.A&&e.M&&e.F){var n=e.K;if(n.j=t,au(n),e.O&&(n=e.O,t||n.l||(n.l=!0),n.l&&t&&(n.m=!0),n.o=t),Oc(e),n=e.g.streaming.liveSync.dynamicTargetLatency.maxAttempts,e.g.streaming.liveSync.dynamicTargetLatency.enabled&&t&&e.Ee<n){n=e.g.streaming.liveSync.dynamicTargetLatency.maxLatency;var i=e.g.streaming.liveSync.targetLatencyTolerance,r=e.g.streaming.liveSync.dynamicTargetLatency.rebufferIncrement;e.S&&(e.S=Math.min(e.S+ ++e.Ee*r,n-i))}}t=(new Map).set("buffering",t),e.dispatchEvent(dc("buffering",t))}function Oc(e){if(e.A&&e.M){var t=e.A.g,n="playing";e.M.g==Br?n="buffering":e.h.ended?n="ended":e.h.paused&&(n="paused");var i=n;if(null==t.g)t.g={timestamp:Date.now()/1e3,state:i,duration:0},t=!0;else{var r=Date.now()/1e3;t.g.duration=r-t.g.timestamp,t.g.state==i?t=!1:(t.h.push(t.g),t.g={timestamp:r,state:i,duration:0},t=!0)}t&&(n=(new Map).set("newstate",n),e.dispatchEvent(dc("statechanged",n)))}}function Uc(e){var t=e.h.playbackRate,n=e.U();if(e.g.streaming.vodDynamicPlaybackRate&&!n){var i=e.g.streaming.vodDynamicPlaybackRateLowBufferRate,r=e.yg();r<=e.g.streaming.vodDynamicPlaybackRateBufferRatio?t!=i&&e.Bd(i,!1):1==r&&t!==e.K.oc()&&e.$c()}if(n&&(n=e.Qb(),Number.isFinite(n.end)&&!(e.h.currentTime<n.start||e.h.paused))){i=e.g.streaming.liveSync.targetLatencyTolerance,r=e.g.streaming.liveSync.dynamicTargetLatency.enabled;var a=e.g.streaming.liveSync.dynamicTargetLatency.stabilityThreshold;if(e.g.streaming.liveSync&&e.g.streaming.liveSync.enabled)var o=e.g.streaming.liveSync.targetLatency,s=o+i,u=Math.max(0,o-i),l=e.g.streaming.liveSync.maxPlaybackRate,c=e.g.streaming.liveSync.minPlaybackRate;else e.i&&e.i.serviceDescription&&(o=e.i.serviceDescription.targetLatency,null!=e.i.serviceDescription.targetLatency?s=e.i.serviceDescription.targetLatency+i:null!=e.i.serviceDescription.maxLatency&&(s=e.i.serviceDescription.maxLatency),null!=e.i.serviceDescription.targetLatency?u=Math.max(0,e.i.serviceDescription.targetLatency-i):null!=e.i.serviceDescription.minLatency&&(u=e.i.serviceDescription.minLatency),l=e.i.serviceDescription.maxPlaybackRate||e.g.streaming.liveSync.maxPlaybackRate,c=e.i.serviceDescription.minPlaybackRate||e.g.streaming.liveSync.minPlaybackRate);e.S||"number"!=typeof o||(e.S=o);var d=e.g.streaming.liveSync.dynamicTargetLatency.maxAttempts;r&&e.Aa&&null!==e.S&&"number"==typeof o&&e.Ee<d&&Date.now()-e.Aa>1e3*a&&(a=e.g.streaming.liveSync.dynamicTargetLatency.minLatency,e.S=Math.max(e.S-(o-a)/2,a+i),e.Aa=Date.now()),r&&null!==e.S&&(s=e.S+i,u=e.S-i),o=n.end-e.h.currentTime,i=0,e.m==sd&&0<(r=e.h.buffered).length&&(i=r.end(r.length-1),i=Math.max(l,i-n.end)),n=e.g.streaming.liveSync.panicMode,r=1e3*e.g.streaming.liveSync.panicThreshold,a=Date.now()-e.M.h,n&&!c&&(c=e.g.streaming.liveSync.minPlaybackRate),n&&c&&a<=r?t!=c&&e.Bd(c,!1):null!=s&&l&&o-i>s?(t!=l&&e.Bd(l,!1),e.Aa=null):null!=u&&c&&o-i<u?(t!=c&&e.Bd(c,!1),e.Aa=null):t!==e.K.oc()&&(e.$c(),e.Aa=Date.now())}}function _c(e){if(e.h){var t,n=function(t,n){var i=void 0===i?Number.EPSILON:i;if(t===n)i=!0;else{var r=Math.abs(t-n);i=r<=i||i!==Number.EPSILON&&Math.abs(r-i)<=Number.EPSILON}return!!((i||n>t)&&e.eg<t)&&(e.eg=t,!0)},i=e.h.currentTime/e.h.duration;isNaN(i)||(n(0,i*=100)?t=dc("started"):n(25,i)?t=dc("firstquartile"):n(50,i)?t=dc("midpoint"):n(75,i)?t=dc("thirdquartile"):n(100,i)&&(t=dc("complete")),t&&e.dispatchEvent(t))}}function Bc(e){try{oo(e.de,e.i)}catch(t){return Jc(e,t),!1}var t=br(e.i.variants);return t=e.xa.create(t),e.o.setVariants(Array.from(t.values())),!0}function Fc(e,t,n,i,r){var a;t=void 0===t||t,n=void 0===n?0:n,i=void 0!==i&&i,r=void 0===r||r,(a=Bc(e)?e.o.chooseVariant():null)&&Vc(e,a,r,t,n,i)}function Vc(e,t,n,i,r,a){a=void 0!==a&&a;var o=e.j.j;if(t==o)i&&Nu(e.j,t,i,r,!0);else{var s=e.A.h;s.h!=t&&(s.h=t,s.g.push({timestamp:Date.now()/1e3,id:t.id,type:"variant",fromAdaptation:n,bandwidth:t.bandwidth})),Nu(e.j,t,i,r,a,n),i=null,o&&(i=dr(o)),(t=dr(t)).active=!0,n?(n=(new Map).set("oldTrack",i).set("newTrack",t),e.L&&ds(e.L,t,e.lf()),td(e,n=dc("adaptation",n))):Kc(e,i,t)}}function Hc(e,t){var n=Array.from(e.h.audioTracks).find((function(e){return e.enabled}));t.enabled=!0,n&&(t.id!==n.id&&(n.enabled=!1),Kc(e,n=mr(n),t=mr(t)))}function Gc(e){td(e,dc("trackschanged"))}function Kc(e,t,n){t=(new Map).set("oldTrack",t).set("newTrack",n),e.L&&ds(e.L,n,e.lf()),td(e,n=dc("variantchanged",t))}function Xc(e){td(e,dc("textchanged"))}function qc(e){td(e,dc("texttrackvisibility"))}function zc(e){e.g.abr.enabled||Yc(e),td(e,dc("abrstatuschanged",(new Map).set("newStatus",e.g.abr.enabled)))}function Wc(e){var t=e.qc().find((function(e){return e.active}));t&&e.B&&e.B.setTextLanguage&&e.B.setTextLanguage(t.language)}function Yc(e,t){if(t=void 0===t||t,e.m==od){e.je.stop();for(var n=l(e.i.variants),i=n.next();!i.done;i=n.next())i.value.disabledUntilTime=0;t&&Bc(e)}}function Jc(e,t){var n,i,r,a;return P((function(o){switch(o.g){case 1:if(e.m==rd)return o.return();if(1===t.severity&&e.A.K++,n=!0,!(e.Ba&&e.i&&e.j)||3016!=t.code&&3014!=t.code&&3015!=t.code&&3018!=t.code){o.u(2);break}return S(o,3),w(o,$u(e.j),5);case 5:i=o.h,n=!i,i&&(r=dc("mediasourcerecovered"),e.dispatchEvent(r)),A(o,2);break;case 3:E(o),n=!0;case 2:if(!n)return o.return();2===t.severity&&Yc(e,!1),a=dc("error",(new Map).set("detail",t)),e.dispatchEvent(a),a.defaultPrevented&&(t.handled=!0),T(o)}}))}function $c(e,t,n,i){i=void 0===i?e:i,e=(new Map).set("detail",{schemeIdUri:n.schemeIdUri,value:n.value,startTime:n.startTime,endTime:n.endTime,id:n.id,eventElement:n.eventElement,eventNode:n.eventNode}),i.dispatchEvent(dc(t,e))}function Qc(e,t,n,i){i=void 0!==i&&i,t=(new Map).set("mediaQuality",{bandwidth:t.bandwidth,audioSamplingRate:t.audioSamplingRate,codecs:t.codecs,contentType:t.contentType,frameRate:t.frameRate,height:t.height,mimeType:t.mimeType,channelsCount:t.channelsCount,pixelAspectRatio:t.pixelAspectRatio,width:t.width,label:t.label,roles:t.roles,language:t.language}).set("position",n),e.dispatchEvent(dc(i?"audiotrackchanged":"mediaqualitychanged",t))}function Zc(e,t){if(t=void 0===t||t,!e.h.error)return t?new De(2,3,3016):null;var n=e.h.error.code;return t||1!=n?((t=e.h.error.msExtendedCode)&&(0>t&&(t+=Math.pow(2,32)),t=t.toString(16)),new De(2,3,3016,n,t,e.h.error.message)):null}function ed(e,t,n){0<t&&(e.U()||e.jh(t)),n<(t=e.getDuration())&&(e.U()||e.bb(n))}function td(e,t){P((function(n){if(1==n.g)return w(n,Promise.resolve(),2);e.m!=rd&&e.dispatchEvent(t),T(n)}))}function nd(e){for(var t=new Set,n=(e=l(e)).next();!n.done;n=e.next())(n=n.value).language?t.add(Yi(n.language)):t.add("und");return t}function id(e){for(var t=new Map,n=new Map,i=(e=l(e)).next();!i.done;i=e.next()){var r="und",a=[];(i=i.value).language&&(r=Yi(i.language)),(a="variant"==i.type?i.audioRoles:i.roles)&&a.length||(a=[""]),t.has(r)||t.set(r,new Set);for(var o=(a=l(a)).next();!o.done;o=a.next())o=o.value,t.get(r).add(o),i.label&&(n.has(r)||n.set(r,new Map),n.get(r).set(o,i.label))}var s=[];return t.forEach((function(e,t){for(var i=(e=l(e)).next();!i.done;i=e.next()){i=i.value;var r=null;n.has(t)&&n.get(t).has(i)&&(r=n.get(t).get(i)),s.push({language:t,role:i,label:r})}})),s}sc.prototype.release=function(){0<this.h.length?this.h.shift()():this.g=null},m(lc,Zr),(i=lc.prototype).destroy=function(){var e,t=this;return P((function(n){switch(n.g){case 1:return t.m==rd?n.return():(cc(t),e=t.detach(),t.m=rd,w(n,e,2));case 2:return w(n,t.Te(),3);case 3:if(t.te&&(t.te.release(),t.te=null),t.od&&(t.od.release(),t.od=null),t.l&&(t.l.release(),t.l=null),t.Ga&&(t.Ga.release(),t.Ga=null),t.Na&&(t.Na.release(),t.Na=null),t.ta=null,t.g=null,t.A=null,t.ge=null,t.O=null,t.da=null,!t.G){n.u(4);break}return w(n,t.G.destroy(),5);case 5:t.G=null;case 4:t.o&&(t.o.release(),t.o=null),Zr.prototype.release.call(t),T(n)}}))},i.Tb=function(e,t){t=void 0===t||t;var n,i,r,a=this;return P((function(o){switch(o.g){case 1:if(a.m==rd)throw new De(2,7,7e3);if(n=a.h&&a.h==e,!a.h||a.h==e){o.u(2);break}return w(o,a.detach(),2);case 2:return w(o,fc(a,"attach"),4);case 4:if(o.h)return o.return();if(S(o,5,6),n||(hc(a,"attach"),i=function(){var e=Zc(a,!1);e&&Jc(a,e)},a.od.D(e,"error",i),a.h=e),!t||!Fe()||a.I){o.u(6);break}return w(o,bc(a),6);case 6:k(o),a.Z.release(),I(o,0);break;case 5:return r=E(o),w(o,a.detach(),10);case 10:throw r}}))},i.Ch=function(e){this.gg=e},i.detach=function(e){e=void 0!==e&&e;var t=this;return P((function(n){if(1==n.g){if(t.m==rd)throw new De(2,7,7e3);return w(n,t.ic(!1,e),2)}if(3!=n.g)return w(n,fc(t,"detach"),3);if(n.h)return n.return();try{t.h&&(t.od.Va(),t.h=null),hc(t,"detach"),t.s&&!e&&t.s.release()}finally{t.Z.release()}T(n)}))},i.ic=function(e,t){e=void 0===e||e,t=void 0!==t&&t;var n,i,r,a,o,s,u,c,d,h,f=this;return P((function(p){switch(p.g){case 1:return f.m!=rd&&(f.m=ad),w(p,fc(f,"unload"),2);case 2:return p.h?p.return():(x(p,3),f.Ba=!1,hc(f,"unload"),e&&!Fe()&&(e=!1),cc(f),n=f.qd.map((function(e){return e()})),f.qd=[],w(p,Promise.all(n),5));case 5:if(f.dispatchEvent(dc("unloading")),f.bc&&(f.bc.release(),f.bc=null),f.h&&(f.l.Va(),f.Ga.Va()),f.je.stop(),f.Hb&&(f.Hb.release(),f.Hb=null),f.ie&&(f.ie.stop(),f.ie=null),!f.H){p.u(6);break}return w(p,f.H.stop(),7);case 7:f.H=null,f.La=null;case 6:if(!f.o){p.u(8);break}return w(p,f.o.stop(),8);case 8:if(!f.j){p.u(10);break}return w(p,f.j.destroy(),11);case 11:f.j=null;case 10:if(f.K&&(f.K.release(),f.K=null),f.F&&(f.F.release(),f.F=null),!ot("webkit")||!f.C){p.u(12);break}return w(p,f.C.destroy(),13);case 13:f.C=null;case 12:if(!f.I){p.u(14);break}return w(p,f.I.destroy(),15);case 15:f.I=null;case 14:if(f.s&&!t&&f.s.onAssetUnload(),f.aa&&!t&&(f.aa.destroy(),f.aa=null),t||f.Fe.stop(),f.O&&function(e){e.l=!1,e.o=!0,e.m=!1,e.j=!1}(f.O),f.da&&(f.da.g=null),!f.B){p.u(16);break}return w(p,f.B.destroy(),17);case 17:f.B=null;case 16:if(f.h&&(Mo(f.h),f.h.src&&(f.h.removeAttribute("src"),f.h.load())),!f.C){p.u(18);break}return w(p,f.C.destroy(),19);case 19:f.C=null;case 18:if(f.na&&f.Y!=f.na.Mc()&&(f.na.s||f.na.destroy(),f.na=null),f.Y=null,f.Ka=null,f.M=null,f.i){for(i=l(f.i.variants),r=i.next();!r.done;r=i.next())for(a=r.value,o=l([a.audio,a.video]),s=o.next();!s.done;s=o.next())(u=s.value)&&u.segmentIndex&&u.segmentIndex.release();for(c=l(f.i.textStreams),d=c.next();!d.done;d=c.next())(h=d.value).segmentIndex&&h.segmentIndex.release()}f.g&&f.g.streaming.clearDecodingCache&&(Ar={},Ue.clear()),f.i=null,f.A=new hu,f.Ae=null,f.Aa=null,f.S=null,f.Ee=-1,f.ud=[],f.eg=-1,jc(f);case 3:k(p),f.Z.release(),I(p,4);break;case 4:if(e&&Fe()&&!f.I&&f.h)return w(p,bc(f),0);p.u(0)}}))},i.ij=function(e){this.ga=e},i.load=function(t,n,i){n=void 0===n?null:n;var r,a,o,s,u,c,d,h,f,p,g,m,v,y=this;return P((function(b){switch(b.g){case 1:if(y.m==rd)throw new De(2,7,7e3);return r=null,a="",a=t instanceof fl?(r=t).Mc()||"":t||"",w(b,uc(y.Z,"load"),2);case 2:if(y.Z.release(),!y.h)throw new De(2,7,7002);if(!y.Y){b.u(3);break}return y.Y=a,w(b,y.ic(!1),3);case 3:if(o=++y.Ce,s=function(){return P((function(e){if(1==e.g)return y.Ce==o?e.u(0):r?w(e,r.destroy(),3):e.u(3);throw new De(2,7,7e3)}))},u=function(e,t){return P((function(n){switch(n.g){case 1:return x(n,2),w(n,uc(y.Z,t),4);case 4:return w(n,s(),5);case 5:return w(n,e(),6);case 6:return w(n,s(),7);case 7:r&&y.g&&(r.g=y.g);case 2:k(n),y.Z.release(),I(n,0)}}))},S(b,5,6),null==n&&r&&(n=r.getStartTime()),y.ga=n,y.Ba=!1,y.dispatchEvent(dc("loading")),r){i=r.Y,b.u(8);break}if(i){b.u(8);break}return w(b,u((function(){return P((function(e){if(1==e.g)return w(e,vc(y,a),2);i=e.h,T(e)}))}),"guessMimeType_"),8);case 8:if(c=!!r,r){gl(r,y),y.A=r.getStats(),b.u(11);break}return w(b,gc(y,a,n,i,!0),12);case 12:(r=b.h)?(r.A=!1,gl(r,y),y.A=r.getStats(),r.start(),r.m.catch((function(){}))):y.A=new hu;case 11:return d=!r,h=Date.now()/1e3,y.A=r?r.getStats():new hu,y.Y=a,y.Ka=i||null,d?w(b,u((function(){return P((function(e){return w(e,function(e,t){var n,i,r,a,o;return P((function(s){return 1==s.g?(n=bi,i=Date.now()/1e3,r=!0,e.C=e.Gc({Nb:e.G,onError:function(t){Jc(e,t)},ee:function(){},onExpirationUpdated:function(){var t=dc("expirationupdated");e.dispatchEvent(t)},onEvent:function(t){e.dispatchEvent(t),"drmsessionupdate"==t.type&&r&&(r=!1,e.A.j=Date.now()/1e3-i)}}),e.C.configure(e.g.drm),a={id:0,language:"und",disabledUntilTime:0,primary:!1,audio:null,video:null,bandwidth:100,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},(o={id:0,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:t?Di(t):"",codecs:t?Ri(t):"",encrypted:!0,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:n.la,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set,isAudioMuxedInVideo:!1}).fullMimeTypes.add(xi(o.mimeType,o.codecs)),t.startsWith("audio/")?(o.type=n.V,a.audio=o):a.video=o,e.C.da=!0,w(s,ja(e.C,[a],[]),2)):w(s,e.C.Tb(e.h),0)}))}(y,i),0)}))}),"initializeSrcEqualsDrmInner_"),21):w(b,u((function(){return P((function(e){if(1==e.g)return w(e,Promise.race([r.fa,r.m]),2);y.La=r.G;var t=r;t.ga=!0,y.H=t.j,y.i=r.kf(),T(e)}))}),"waitForFinish"),15);case 15:if(y.I){b.u(16);break}return w(b,u((function(){return P((function(e){return w(e,bc(y),0)}))}),"initializeMediaSourceEngineInner_"),16);case 16:return w(b,u((function(){return P((function(e){return w(e,r.m,0)}))}),"waitForFinish"),18);case 18:return y.g=r.getConfiguration(),y.de=r.F,y.H&&y.H.setMediaElement&&y.h&&y.H.setMediaElement(y.h),y.bc=function(e){return e.na=!0,e.H}(r),y.ac=r.Aa,(f=r.o)&&(y.xa=f),c&&y.h&&"AUDIO"===y.h.nodeName&&(function(e){for(var t=l(e.i.variants),n=t.next();!n.done;n=t.next())(n=n.value).video&&(n.video.closeSegmentIndex(),n.video=null),n.bandwidth=n.audio&&n.audio.bandwidth?n.audio.bandwidth:0;e.i.variants=e.i.variants.filter((function(e){return e.audio}))}(y),y.configure("manifest.disableVideo",!0)),y.C=function(e){return e.da=!0,e.l}(r),w(b,u((function(){return P((function(e){return w(e,y.C.Tb(y.h),0)}))}),"drmEngine_.attach"),19);case 19:return!(p=r.C)||y.ta&&y.ta==p||(y.o=function(e){return e.aa=!0,e.i}(r),y.ta=r.C,"function"!=typeof y.o.setMediaElement&&(oe("AbrManager w/o setMediaElement","Please use an AbrManager with setMediaElement function."),y.o.setMediaElement=function(){}),"function"!=typeof y.o.setCmsdManager&&(oe("AbrManager w/o setCmsdManager","Please use an AbrManager with setCmsdManager function."),y.o.setCmsdManager=function(){}),"function"!=typeof y.o.trySuggestStreams&&(oe("AbrManager w/o trySuggestStreams","Please use an AbrManager with trySuggestStreams function."),y.o.trySuggestStreams=function(){})),g=function(e){return e.ta=!0,e.L}(r),m=r.ja,w(b,u((function(){return P((function(e){return w(e,function(e,t,n,i){var r,a,o,s,u,c,d,h,f,p,g,m,v,y,b,S,x,A,E,k;return P((function(I){switch(I.g){case 1:hc(e,"load"),r=e.h,e.K=new ru({Pd:function(){return r.playbackRate},oc:function(){return r.defaultPlaybackRate},Vf:function(e){r.playbackRate=e},Og:function(e){r.currentTime+=e}}),wc(e,r,t),function(e,t){t.lcevc.enabled?(cc(e),null==e.L&&(e.L=new ls(e.h,e.gg,t.lcevc),e.I&&(e.I.da=e.L))):cc(e)}(e,e.g),e.Gb=e.g.preferredTextLanguage,e.sd=e.g.preferredTextRole,e.rd=e.g.preferForcedSubs,ed(e.i.presentationTimeline,e.g.playRangeStart,e.g.playRangeEnd),e.o.init((function(t,n,i){e.i&&e.j&&t!=e.j.j&&Vc(e,t,!0,void 0!==n&&n,void 0===i?0:i)})),e.o.setMediaElement(r),e.o.setCmsdManager(e.da),e.j=function(e){return new Pu(e.i,{hd:function(){return e.F?e.F.Dd():0},getBandwidthEstimate:function(){return e.o.getBandwidthEstimate()},ib:function(){return e.ib()},ca:e.I,Nb:e.G,onError:function(t){return Jc(e,t)},onEvent:function(t){return e.dispatchEvent(t)},Ef:function(t,n){var i=t.startTime;t=t.endTime;var r=n.type;if(n=n.codecs.includes(","),r!=yi){if(e.F){e.F.Pg();var a=vs(e.I,r);!e.U()&&e.h.paused&&null!=a&&0<a&&e.F.Dd()<a&&e.F.Ie(a)}Ac(e)}i=(new Map).set("start",i).set("end",t).set("contentType",r).set("isMuxed",n),e.dispatchEvent(dc("segmentappended",i))},Ei:function(t,n){(n=n.Qc)&&e.ac&&function(e,t,n){var i=function(e,t){var n=e.g.get(t);return n||(n={yd:[],Se:null,contentType:t},e.g.set(t,n)),n}(e,t.contentType);!function(e,t){if((e=e.h()[t.contentType])&&0<e.length){var n=e[0].start,i=e[e.length-1].end,r=t.yd;t.yd=r.filter((function(e,t){return!(e.position<=n&&t+1<r.length&&r[t+1].position<=n||e.position>=i)}))}else t.yd=[]}(e,i),e={Qc:t,position:n},0<=(t=(i=i.yd).findIndex((function(e){return e.position>=n})))?i.splice(t,i[t].position==n?1:0,e):i.push(e)}(e.ac,n,t)},mg:function(t,n){var i=e.C;if(i.h.parseInbandPsshEnabled&&!i.F&&["audio","video"].includes(t)){t=new Pa(ge(n)),n=0;for(var r=l(t.data),a=r.next();!a.done;a=r.next())n+=a.value.length;if(0==n)i=Promise.resolve();else{for(n=new Uint8Array(n),r=0,a=(t=l(t.data)).next();!a.done;a=t.next())a=a.value,n.set(a,r),r+=a.length;Ba(i,"cenc",n),i=i.m}}else i=Promise.resolve();return i},disableStream:function(t,n){return e.disableStream(t,n)}})}(e),e.j.configure(e.g.streaming),e.m=od,e.dispatchEvent(dc("streaming")),a=n;case 2:for((s=e.j.j)||a||(a=Bc(e)?e.o.chooseVariant():null),u=[],c=l([(o=s||a).video,o.audio]),d=c.next();!d.done;d=c.next())(h=d.value)&&!h.segmentIndex&&u.push(h.createSegmentIndex());if(!(0<u.length)){I.u(4);break}return w(I,Promise.all(u),4);case 4:if(!o||0!=o.disabledUntilTime){I.u(2);break}if(e.H&&e.H.onInitialVariantChosen&&e.H.onInitialVariantChosen(o),e.i.isLowLatency&&!e.g.streaming.lowLatencyMode&&W("Low-latency live stream detected, but low-latency streaming mode is not enabled in Shaka Player. Set streaming.lowLatencyMode configuration to true, and see https://bit.ly/3clctcj for details."),e.O&&function(e,t){e.j=t,e.j?e.i==$l?e.i=Ql:e.i==Zl&&(e.i=ec):e.i==Ql?e.i=$l:e.i==ec&&(e.i=Zl)}(e.O,e.i.isLowLatency&&e.g.streaming.lowLatencyMode),ed(e.i.presentationTimeline,e.g.playRangeStart,e.g.playRangeEnd),function(e,t,n){e.l.presentationTimeline.U()||(e.O=t,e.M=n)}(e.j,e.g.playRangeStart,e.g.playRangeEnd),f=function(t){e.F=function(e,t){return new Ys(e.h,e.i,e.g.streaming,t,(function(){e.Hb&&su(e.Hb,!0),e.j&&e.j.Xc(),e.M&&Ac(e)}),(function(t){return e.dispatchEvent(t)}))}(e,t),e.Hb=function(e,t){(t=new bl(e.bc,e.U()||0<t)).addEventListener("enter",(function(t){$c(e,"timelineregionenter",t.region)})),t.addEventListener("exit",(function(t){$c(e,"timelineregionexit",t.region)})),t.addEventListener("skip",(function(t){var n=t.region;t.seeking||($c(e,"timelineregionenter",n),$c(e,"timelineregionexit",n))}));var n=new ou(e.h);return n.g.add(t),e.ac&&n.g.add(e.ac),n}(e,t),xc(e,r,Math.max(e.i.minBufferTime,e.g.streaming.rebufferingGoal))},e.g.streaming.startAtSegmentBoundary||(null==(p=e.ga)&&e.i.startTime&&(p=e.i.startTime),f(p)),s){I.u(7);break}if(!e.g.streaming.startAtSegmentBoundary){I.u(8);break}return g=e.i.presentationTimeline,m=e.ga||e.h.currentTime,null==e.ga&&e.i.startTime&&(m=e.i.startTime),v=g.Kb(),y=g.Bb(),m<v?m=v:m>y&&(m=y),w(I,function(e,t){var n,i,r,a,o;return P((function(s){return 1==s.g?(n=e.audio,i=e.video,r=function(e,t){var n,i,r;return P((function(a){return 1==a.g?e?w(a,e.createSegmentIndex(),2):a.return(null):(i=(n=e.segmentIndex.Jb(t))?n.next().value:null)?(r=i.startTime,a.return(r)):a.return(null)}))},w(s,r(n,t),2)):3!=s.g?(a=s.h,w(s,r(i,t),3)):null!=(o=s.h)&&null!=a?s.return(Math.max(o,a)):null!=o?s.return(o):null!=a?s.return(a):s.return(t)}))}(a,m),9);case 9:b=I.h,f(b);case 8:Vc(e,a,!0,!1,0);case 7:return e.F.ready(),e.qc().find((function(e){return e.active}))||((S=wr(e.i.textStreams,e.Gb,e.sd,e.rd)[0]||null)&&du(e.A.h,S,!0),a&&(S?(function(e,t,n){if(0==e.g.autoShowText)return!1;if(1==e.g.autoShowText)return!0;var i=Yi(e.g.preferredTextLanguage);return n=Yi(n.language),2==e.g.autoShowText?qi(n,i):3==e.g.autoShowText?!!t&&(e=Yi(t.language),qi(n,i)&&!qi(e,n)):(W("Invalid autoShowText setting!"),!1)}(e,a.audio,S)&&(e.ja=!0),e.ja&&e.B.setTextVisibility(!0),qc(e)):e.ja=!1),S&&(e.g.streaming.alwaysStreamText||e.vf())&&(ju(e.j,S),Wc(e))),w(I,e.j.start(i),10);case 10:e.g.abr.enabled&&(e.o.enable(),zc(e)),Gc(e),Bc(e),e.i.variants.some((function(e){return e.primary})),((x=e.U())&&(e.g.streaming.liveSync&&e.g.streaming.liveSync.enabled||e.i.serviceDescription||e.g.streaming.liveSync.panicMode)||e.g.streaming.vodDynamicPlaybackRate)&&(A=function(){return Uc(e)},e.l.D(r,"timeupdate",A)),x||(E=function(){return _c(e)},e.l.D(r,"timeupdate",E),_c(e),e.i.nextUrl&&(0<e.g.streaming.preloadNextUrlWindow&&(k=function(){var t;return P((function(n){if(1==n.g)return t=e.h.duration-e.h.currentTime,!isNaN(t)&&t<=e.g.streaming.preloadNextUrlWindow?(e.l.cb(r,"timeupdate",k),w(n,e.preload(e.i.nextUrl),4)):n.u(0);e.na=n.h,T(n)}))},e.l.D(r,"timeupdate",k)),e.l.D(r,"ended",(function(){e.load(e.na||e.i.nextUrl)})))),e.s&&e.s.onManifestUpdated(x),e.Ba=!0,T(I)}}))}(y,h,m,g),0)}))}),"loadInner_"),20);case 20:!function(e){if(e.I)for(var t=l(e.I),n=t.next();!n.done;n=t.next())(n=n.value)();e.I=null}(r),y.Ka&&et()&&Pi(y.Ka)&&function(t,n,i){t.g&&e.ManagedMediaSource&&t.l&&(t.B&&t.g.removeChild(t.B),t.B=Io(n,i),t.g.appendChild(t.B),t.g.disableRemotePlayback=!1)}(y.I,y.Y,y.Ka),b.u(14);break;case 21:return w(b,u((function(){return P((function(e){return w(e,function(e,t,n){var i,r,a,o,s,u,c,d,h,f,p,g;return P((function(m){switch(m.g){case 1:if(hc(e,"src-equals"),i=e.h,e.F=new Ws(i),r=!1,e.qd.push((function(){r=!0})),null!=e.ga&&e.F.Ie(e.ga),e.K=new ru({Pd:function(){return i.playbackRate},oc:function(){return i.defaultPlaybackRate},Vf:function(e){i.playbackRate=e},Og:function(e){i.currentTime+=e}}),a=e.g.streaming.rebufferingGoal,xc(e,i,a),i.textTracks&&(yc(e),o=function(){var t=Mc(e).find((function(e){return"disabled"!==e.mode}));t&&(t.mode="showing")},s=function(){var t=Mc(e).find((function(e){return"disabled"!==e.mode}));t&&(t.mode="hidden")},e.l.D(i,"enterpictureinpicture",(function(){return o()})),e.l.D(i,"leavepictureinpicture",(function(){return s()})),i.remote?(e.l.D(i.remote,"connect",(function(){return s()})),e.l.D(i.remote,"connecting",(function(){return s()})),e.l.D(i.remote,"disconnect",(function(){return s()}))):"webkitCurrentPlaybackTargetIsWireless"in i&&e.l.D(i,"webkitcurrentplaybacktargetiswirelesschanged",(function(){return s()})),(u=i).webkitSupportsFullscreen&&e.l.D(u,"webkitpresentationmodechanged",(function(){"inline"!=u.webkitPresentationMode?o():s()}))),wc(e,i,t),c=function(e,t,n){try{if(!e.g.enabled)return t;var i=Hl(e);e:{switch(n.toLowerCase()){case"audio/mp4":case"audio/webm":case"audio/ogg":case"audio/mpeg":case"audio/aac":case"audio/flac":case"audio/wav":var r=zl;break e;case"video/webm":case"video/mp4":case"video/mpeg":case"video/mp2t":r=Yl;break e;case"application/x-mpegurl":case"application/vnd.apple.mpegurl":case"application/dash+xml":case"video/vnd.mpeg.dash.mpd":case"application/vnd.ms-sstr+xml":r="m";break e}r=void 0}return i.ot=r,i.su=!0,ql(t,Xl(i))}catch(e){return Y("CMCD_SRC_ERROR","Could not generate src CMCD data.",e),t}}(e.O,e.Y,n),!c.includes("#t=")&&(0<e.g.playRangeStart||isFinite(e.g.playRangeEnd))&&(c+="#t=",0<e.g.playRangeStart&&(c+=e.g.playRangeStart),isFinite(e.g.playRangeEnd)&&(c+=","+e.g.playRangeEnd)),!e.I){m.u(2);break}return w(m,e.I.destroy(),3);case 3:e.I=null;case 2:return Mo(i),i.src=c,(Ke()||qe())&&i.load(),"none"!=i.preload&&!i.autoplay&&Pi(n)&&et()&&i.load(),e.m=sd,e.dispatchEvent(dc("streaming")),d=new Gr,Bs(i,HTMLMediaElement.HAVE_METADATA,e.l,(function(){e.F.ready(),d.resolve()})),Bs(i,HTMLMediaElement.HAVE_CURRENT_DATA,e.l,(function(){var t,n,a,o,s;return P((function(u){if(1==u.g)return function(e){var t=e.g.preferredAudioLanguage;""!=t&&e.$g(t,e.g.preferredVariantRole)}(e),(t=Mc(e)).find((function(e){return"disabled"!=e.mode}))?(0<t.length&&(e.ja=!0,e.B.setTextVisibility(!0)),u.u(2)):w(u,new Promise((function(t){e.l.pa(i.textTracks,"change",t),new Be(t).$(1)})),2);if(r)return u.return();for(n=!1,a=l(t),o=a.next();!o.done;o=a.next())"disabled"!==(s=o.value).mode&&(n?(s.mode="disabled",W("Found more than one enabled text track, disabling it",s)):(Ic(e,s),n=!0));!function(e){var t=e.g.preferredTextLanguage;""!=t&&e.Pf(t,e.g.preferredTextRole,e.g.preferForcedSubs)}(e),T(u)}))})),i.error?d.reject(Zc(e)):"none"==i.preload&&(W('With <video preload="none">, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way, and we cannot provide track info yet. Please do not use preload="none" with Shaka Player.'),d.resolve()),e.l.pa(i,"error",(function(){d.reject(Zc(e))})),w(m,Ki(e.g.streaming.loadTimeout,d),4);case 4:((h=e.U())&&(e.g.streaming.liveSync&&e.g.streaming.liveSync.enabled||e.g.streaming.liveSync.panicMode)||e.g.streaming.vodDynamicPlaybackRate)&&(f=function(){return Uc(e)},e.l.D(i,"timeupdate",f)),h||(p=function(){return _c(e)},e.l.D(i,"timeupdate",p),_c(e)),e.s&&(e.s.onManifestUpdated(h),h&&(g=e.Qb().end,e.l.D(i,"progress",(function(){var t=e.Qb().end;g!=t&&(e.s.onManifestUpdated(e.U()),g=t)})))),e.Ba=!0,T(m)}}))}(y,h,i),0)}))}),"srcEqualsInner_"),14);case 14:y.dispatchEvent(dc("loaded"));case 6:if(k(b),!r){b.u(23);break}return w(b,r.destroy(),23);case 23:y.na=null,I(b,0);break;case 5:if(!(v=E(b))||7e3==v.code){b.u(25);break}return w(b,y.ic(!1),25);case 25:throw v}}))},i.ej=function(e,t){e=void 0===e||e,t=void 0!==t&&t;var n,i=this;return P((function(r){return 1==r.g?w(r,pc(i),2):3!=r.g?(n=r.h,w(r,i.ic(e,t),3)):r.return(n)}))},i.tg=function(e,t){e=void 0!==e&&e,t=void 0!==t&&t;var n,i=this;return P((function(r){return 1==r.g?w(r,pc(i,t),2):3!=r.g?(n=r.h,w(r,i.detach(e),3)):r.return(n)}))},i.preload=function(e,t,n){t=void 0===t?null:t;var i,r=this;return P((function(a){return 1==a.g?w(a,gc(r,e,t,n),2):((i=a.h)?i.start():Jc(r,new De(2,7,7005)),a.return(i))}))},i.Te=function(){var e,t,n,i,r=this;return P((function(a){for(e=[],t=l(r.le),n=t.next();!n.done;n=t.next())(i=n.value).s||e.push(i.destroy());return r.le=[],w(a,Promise.all(e),0)}))},i.Ni=function(){for(var e=this.Z;e.g;)e.release()},i.Gc=function(e){return new Na(e)},i.configure=function(e,t){if(2==arguments.length&&"string"==typeof e&&(e=el(e,t)),e.streaming&&"forceTransmuxTS"in e.streaming&&(oe("streaming.forceTransmuxTS configuration","Please Use mediaSource.forceTransmux instead."),e.mediaSource.mediaSource=e.streaming.forceTransmuxTS,delete e.streaming.forceTransmuxTS),e.streaming&&"forceTransmux"in e.streaming&&(oe("streaming.forceTransmux configuration","Please Use mediaSource.forceTransmux instead."),e.mediaSource.mediaSource=e.streaming.forceTransmux,delete e.streaming.forceTransmux),e.streaming&&"useNativeHlsOnSafari"in e.streaming&&(oe("streaming.useNativeHlsOnSafari configuration","Please Use streaming.useNativeHlsForFairPlay or streaming.preferNativeHls instead."),e.streaming.preferNativeHls=e.streaming.useNativeHlsOnSafari&&Ye(),delete e.streaming.useNativeHlsOnSafari),e.streaming&&"boolean"==typeof e.streaming.liveSync){oe("streaming.liveSync","Please Use streaming.liveSync.enabled instead.");var n=e.streaming.liveSync;e.streaming.liveSync={},e.streaming.liveSync.enabled=n}if(e.streaming&&(!e.streaming.liveSync||!("targetLatency"in e.streaming.liveSync))&&("liveSyncMinLatency"in e.streaming||"liveSyncMaxLatency"in e.streaming)){n=e.streaming.liveSyncMinLatency||0;var i=Math.abs((e.streaming.liveSyncMaxLatency||1)-n)/2;e.streaming.liveSync=e.streaming.liveSync||{},e.streaming.liveSync.targetLatency=n+i,e.streaming.liveSync.targetLatencyTolerance=i}if(e.streaming&&"liveSyncMaxLatency"in e.streaming&&(oe("streaming.liveSyncMaxLatency","Please Use streaming.liveSync.targetLatency and streaming.liveSync.targetLatencyTolerance instead. Or, set the values in your DASH manifest"),delete e.streaming.liveSyncMaxLatency),e.streaming&&"liveSyncMinLatency"in e.streaming&&(oe("streaming.liveSyncMinLatency","Please Use streaming.liveSync.targetLatency and streaming.liveSync.targetLatencyTolerance instead. Or, set the values in your DASH manifest"),delete e.streaming.liveSyncMinLatency),e.streaming&&"liveSyncTargetLatency"in e.streaming&&(oe("streaming.liveSyncTargetLatency","Please Use streaming.liveSync.targetLatency instead."),e.streaming.liveSync=e.streaming.liveSync||{},e.streaming.liveSync.targetLatency=e.streaming.liveSyncTargetLatency,delete e.streaming.liveSyncTargetLatency),e.streaming&&"liveSyncTargetLatencyTolerance"in e.streaming&&(oe("streaming.liveSyncTargetLatencyTolerance","Please Use streaming.liveSync.targetLatencyTolerance instead."),e.streaming.liveSync=e.streaming.liveSync||{},e.streaming.liveSync.targetLatencyTolerance=e.streaming.liveSyncTargetLatencyTolerance,delete e.streaming.liveSyncTargetLatencyTolerance),e.streaming&&"liveSyncPlaybackRate"in e.streaming&&(oe("streaming.liveSyncPlaybackRate","Please Use streaming.liveSync.maxPlaybackRate instead."),e.streaming.liveSync=e.streaming.liveSync||{},e.streaming.liveSync.maxPlaybackRate=e.streaming.liveSyncPlaybackRate,delete e.streaming.liveSyncPlaybackRate),e.streaming&&"liveSyncMinPlaybackRate"in e.streaming&&(oe("streaming.liveSyncMinPlaybackRate","Please Use streaming.liveSync.minPlaybackRate instead."),e.streaming.liveSync=e.streaming.liveSync||{},e.streaming.liveSync.minPlaybackRate=e.streaming.liveSyncMinPlaybackRate,delete e.streaming.liveSyncMinPlaybackRate),e.streaming&&"liveSyncPanicMode"in e.streaming&&(oe("streaming.liveSyncPanicMode","Please Use streaming.liveSync.panicMode instead."),e.streaming.liveSync=e.streaming.liveSync||{},e.streaming.liveSync.panicMode=e.streaming.liveSyncPanicMode,delete e.streaming.liveSyncPanicMode),e.streaming&&"liveSyncPanicThreshold"in e.streaming&&(oe("streaming.liveSyncPanicThreshold","Please Use streaming.liveSync.panicThreshold instead."),e.streaming.liveSync=e.streaming.liveSync||{},e.streaming.liveSync.panicThreshold=e.streaming.liveSyncPanicThreshold,delete e.streaming.liveSyncPanicThreshold),e.mediaSource&&"sourceBufferExtraFeatures"in e.mediaSource){oe("mediaSource.sourceBufferExtraFeatures configuration","Please Use mediaSource.addExtraFeaturesToSourceBuffer() instead.");var r=e.mediaSource.sourceBufferExtraFeatures;e.mediaSource.addExtraFeaturesToSourceBuffer=function(){return r},delete e.mediaSource.sourceBufferExtraFeatures}return e.manifest&&e.manifest.hls&&"useSafariBehaviorForLive"in e.manifest.hls&&(oe("manifest.hls.useSafariBehaviorForLive configuration","Please Use liveSync config to keep on live Edge instead."),delete e.manifest.hls.useSafariBehaviorForLive),e.streaming&&"parsePrftBox"in e.streaming&&(oe("streaming.parsePrftBox configuration","Now fired without needing a configuration."),delete e.streaming.parsePrftBox),e.manifest&&e.manifest.dash&&"enableAudioGroups"in e.manifest.dash&&(oe("manifest.dash.enableAudioGroups configuration","It is now enabled by default and cannot be disabled."),delete e.manifest.dash.enableAudioGroups),e.streaming&&"dispatchAllEmsgBoxes"in e.streaming&&(oe("streaming.dispatchAllEmsgBoxes configuration","Please Use mediaSource.dispatchAllEmsgBoxes instead."),e.mediaSource.dispatchAllEmsgBoxes=e.streaming.dispatchAllEmsgBoxes,delete e.streaming.dispatchAllEmsgBoxes),e.streaming&&e.streaming.lowLatencyMode&&(null==e.streaming.inaccurateManifestTolerance&&(e.streaming.inaccurateManifestTolerance=0),null==e.streaming.rebufferingGoal&&(e.streaming.rebufferingGoal=.01),null==e.streaming.segmentPrefetchLimit&&(e.streaming.segmentPrefetchLimit=2),null==e.streaming.updateIntervalSeconds&&(e.streaming.updateIntervalSeconds=.1),null==e.streaming.maxDisabledTime&&(e.streaming.maxDisabledTime=1),null==e.streaming.retryParameters&&(e.streaming.retryParameters={}),null==e.streaming.retryParameters.baseDelay&&(e.streaming.retryParameters.baseDelay=100),null==e.manifest&&(e.manifest={}),null==e.manifest.dash&&(e.manifest.dash={}),null==e.manifest.dash.autoCorrectDrift&&(e.manifest.dash.autoCorrectDrift=!1),null==e.manifest.retryParameters&&(e.manifest.retryParameters={}),null==e.manifest.retryParameters.baseDelay&&(e.manifest.retryParameters.baseDelay=100),null==e.drm&&(e.drm={}),null==e.drm.retryParameters&&(e.drm.retryParameters={}),null==e.drm.retryParameters.baseDelay&&(e.drm.retryParameters.baseDelay=100)),n=cl(this.g,e,Nc(this)),Ec(this),n},i.getConfiguration=function(){var e=Nc(this);return cl(e,this.g,Nc(this)),e},i.Dg=function(){return cl(Nc(this),this.g,Nc(this)),nl(this.g,Nc(this))},i.yg=function(){if(this.h){var e=this.h.buffered.length;e=e?this.h.buffered.end(e-1):0;var t=this.getConfiguration().streaming.bufferingGoal;if(e>=(t=Math.min(this.h.currentTime+t,this.Qb().end)))return 1;if(!(e<=this.h.currentTime)&&e<t)return(e-this.h.currentTime)/(t-this.h.currentTime)}return 0},i.Ri=function(){for(var e in this.g)delete this.g[e];cl(this.g,Nc(this),Nc(this)),Ec(this)},i.Bg=function(){return this.m},i.lf=function(){return this.i?this.i.type:null},i.Yh=function(){return this.h},i.Ab=function(){return this.G},i.Mc=function(){return this.Y},i.xg=function(){return this.s?this.s:null},i.U=function(){return this.i&&!this.Ia()?this.i.presentationTimeline.U():!(!this.h||!this.h.src)&&1/0==this.h.duration},i.uc=function(){return!!this.i&&this.i.presentationTimeline.uc()},i.oi=function(){if(this.i&&!this.Ia()){var e=this.i.variants;return!!e.length&&!e[0].video}return!(!this.h||!this.h.src)&&(this.h.videoTracks?0==this.h.videoTracks.length:0==this.h.videoHeight)},i.Qb=function(){if(this.i&&!this.Ia()){if(!this.Ba&&"HLS"==this.i.type)return{start:0,end:0};var e=this.i.presentationTimeline;return{start:e.Kb(),end:e.Bb()}}return this.h&&this.h.src&&(e=this.h.seekable).length?{start:e.start(0),end:e.end(e.length-1)}:{start:0,end:0}},i.li=function(){this.U()&&(this.h.currentTime=this.Qb().end)},i.pi=function(){return this.Ba},i.keySystem=function(){var e=this.drmInfo();return e?e.keySystem:""},i.drmInfo=function(){return this.C?this.C.g:null},i.gd=function(){return this.C?this.C.gd():1/0},i.jf=function(){return this.C?this.C.jf():[]},i.Od=function(){return this.C?this.C.Od():{}},i.tf=function(){return!!this.M&&this.M.g==Br},i.ib=function(){return this.h?this.K?this.K.i:1:0},i.Bd=function(e,t){var n=this;t=void 0===t||t,0==e?W("A trick play rate of 0 is unsupported!"):(this.Ga.Va(),this.h.paused&&this.h.play(),this.K.set(e),this.m==od&&(this.o.playbackRateChanged(e),Lu(this.j,t&&1<Math.abs(e))),this.U()&&this.Ga.D(this.h,"timeupdate",(function(){var t=n.h.currentTime,i=n.Qb(),r=n.g.streaming.safeSeekOffset;0<e?Math.floor(t)>=Math.floor(i.end)&&n.$c():Math.floor(t)<=Math.floor(i.start+r)&&n.$c()})))},i.$c=function(){var e=this.K.oc();this.m==sd&&this.K.set(e),this.m==od&&(this.K.set(e),this.o.playbackRateChanged(e),Lu(this.j,!1)),this.Ga.Va()},i.rc=function(){if(this.i&&!this.Ia()){for(var e=this.j?this.j.j:null,t=[],n=0,i=l(this.i.variants),r=i.next();!r.done;r=i.next())if(yr(r=r.value)){var a=dr(r);a.active=r==e,a.active||1==n||null==e||r.video!=e.video||r.audio!=e.audio||(a.active=!0),a.active&&n++,t.push(a)}return t}return this.h&&this.h.audioTracks?Array.from(this.h.audioTracks).map((function(e){return mr(e)})):[]},i.qc=function(){if(this.i&&!this.Ia()){for(var e=this.j?this.j.s:null,t=[],n=l(this.i.textStreams),i=n.next();!i.done;i=n.next()){var r=hr(i=i.value);r.active=i==e,t.push(r)}return t}return this.h&&this.h.src&&this.h.textTracks?Mc(this).map((function(e){return gr(e)})):[]},i.Sh=function(){var e=this.ud;return this.i&&(e=this.i.imageStreams),e.map((function(e){return fr(e)}))},i.Jh=function(e){var t,n,i,r,a=this;return P((function(o){return 1==o.g?a.m!=od&&a.m!=sd?o.return(null):(t=a.ud,a.i&&(t=a.i.imageStreams),(n=t.find((function(t){return t.id==e})))?n.segmentIndex?o.u(2):w(o,n.createSegmentIndex(),2):o.return(null)):4!=o.g?(i=[],n.segmentIndex.yb((function(t){var r=kc(t.tilesLayout||n.tilesLayout);if(r){r=r.rows*r.lc;for(var o=t.j-t.startTime,s=0;s<r;s++)i.push(a.Fg(e,t.startTime+o*s/r))}})),w(o,Promise.all(i),4)):(r=o.h,o.return(r.filter((function(e){return e}))))}))},i.Fg=function(e,t){var n,i,r,a,o,s,u,l,c,d,h,f,p,g,m,v,y,b,T=this;return P((function(S){return 1==S.g?T.m!=od&&T.m!=sd?S.return(null):(n=T.ud,T.i&&(n=T.i.imageStreams),(i=n.find((function(t){return t.id==e})))?i.segmentIndex?S.u(2):w(S,i.createSegmentIndex(),2):S.return(null)):null==(r=i.segmentIndex.find(t))?S.return(null):(a=i.segmentIndex.get(r),(o=kc(a.tilesLayout||i.tilesLayout))?(s=i.width||0,u=i.height||0,l=s/o.lc,c=u/o.rows,d=o.lc*o.rows,h=a.j-a.startTime,f=a.A||h/d,p=a.startTime,m=g=0,1<d&&(v=Math.floor((t-a.startTime)/f),p=a.startTime+v*f,g=v%o.lc*l,m=Math.floor(v/o.lc)*c),y=!1,(b=a.thumbnailSprite)&&(y=!0,c=b.height,g=b.positionX,m=b.positionY,l=b.width),S.return({segment:a,imageHeight:u,imageWidth:s,height:c,positionX:g,positionY:m,startTime:p,duration:f,uris:a.N(),width:l,sprite:y})):S.return(null))}))},i.ah=function(e){var t,n=this;this.i&&this.F&&((t=n.i.textStreams.find((function(t){return t.id==e.id})))&&t!=n.j.s&&(du(n.A.h,t,!1),ju(n.j,t),Xc(n),Wc(n),n.Gb=t.language),!this.Ia())||function(){if(n.h&&n.h.textTracks){var t=Mc(n),i=t.find((function(e){return"disabled"!==e.mode}));(t=t.find((function(t){return pr(t)===e.id})))&&(i!==t&&(i&&(i.mode="disabled",n.l.cb(i,"cuechange"),n.B.remove(0,1/0)),t&&Ic(n,t)),Xc(n),Wc(n))}}()},i.Qf=function(e,t,n){var i=this;t=void 0!==t&&t,n=void 0===n?0:n,this.i&&this.F&&(function(){var r=i.i.variants.find((function(t){return t.id==e.id}));if(r&&yr(r)){var a=i.j.j;i.g.abr.enabled&&(a.video!=r.video||a.audio&&r.audio&&a.audio.language==r.audio.language&&a.audio.channelsCount==r.audio.channelsCount)&&W("Changing tracks while abr manager is enabled will likely result in the selected track being overriden. Consider disabling abr before calling selectVariantTrack()."),i.Ia()?Vc(i,r,!1,!1,0):Vc(i,r,!1,t||!1,n||0),i.xa=new jr(r,i.g.mediaSource.codecSwitchingStrategy),Bc(i)}}(),!this.Ia())||function(){if(i.h&&i.h.audioTracks)for(var t=Array.from(i.h.audioTracks),n=(t=l(t)).next();!n.done;n=t.next())if(pr(n=n.value)==e.id){Hc(i,n);break}}()},i.Lh=function(){return id(this.rc())},i.ei=function(){return id(this.qc())},i.Kh=function(){return Array.from(nd(this.rc()))},i.di=function(){return Array.from(nd(this.qc()))},i.$g=function(e,t,n,i,r){var a=this;n=void 0===n?0:n,i=void 0===i?0:i,r=void 0===r?"":r,this.i&&this.F&&(function(){function o(e,t){return e.video||t.video?e.video&&t.video?Math.abs((e.video.height||0)-(t.video.height||0))+Math.abs((e.video.width||0)-(t.video.width||0)):1/0:0}a.xa=new Or(e,t||"",n||0,"",!1,"","","",a.g.mediaSource.codecSwitchingStrategy,r||"");for(var s=a.j.j,u=a.xa.create(a.i.variants),c=null,d=(u=l(u.values())).next();!d.done;d=u.next())yr(d=d.value)&&(!c||o(c,s)>o(d,s))&&(c=d);c!=s&&(c?(s=dr(c),a.Qf(s,!0,i||0)):Fc(a))}(),!this.Ia())||function(){if(a.h&&a.h.audioTracks){var n=wr(a.rc(),e,t||"",!1)[0];n&&a.Qf(n)}}()},i.Pf=function(e,t,n){var i,r=this;n=void 0!==n&&n,this.i&&this.F&&(function(){r.Gb=e,r.sd=t||"",r.rd=n||!1;var i=wr(r.i.textStreams,r.Gb,r.sd,r.rd)[0]||null;i&&i!=r.j.s&&(du(r.A.h,i,!1),r.g.streaming.alwaysStreamText||r.vf())&&(ju(r.j,i),Xc(r),Wc(r))}(),!this.Ia())||(i=wr(r.qc(),e,t||"",n||!1)[0])&&r.ah(i)},i.Xi=function(e,t,n){var i=this;t=void 0===t||t,n=void 0===n?0:n,this.i&&this.F&&(function(){for(var r=null,a=l(i.i.variants),o=a.next();!o.done;o=a.next())if((o=o.value).audio.label==e){r=o;break}null!=r&&(i.xa=new Or(r.language,"",0,"",!1,"",e,"",i.g.mediaSource.codecSwitchingStrategy,""),Fc(i,t,n))}(),!this.Ia())||function(){if(i.h&&i.h.audioTracks){for(var t=Array.from(i.h.audioTracks),n=null,r=(t=l(t)).next();!r.done;r=t.next())(r=r.value).label==e&&(n=r);n&&Hc(i,n)}}()},i.vf=function(){var e=this.ja;return this.B?this.B.isTextVisible():e},i.zg=function(){return this.h&&this.h.currentSrc&&this.h.textTracks?Cc(this).map((function(e){return gr(e)})):[]},i.Nh=function(e){if(!this.h||!this.h.currentSrc||!this.h.textTracks)return[];var t=Yi(e),n=Cc(this).filter((function(e){return Yi(e.language)==t}));if(!n||!n.length)return[];e=[];for(var i=new Set,r=(n=l(n)).next();!r.done;r=n.next())if((r=r.value)&&r.cues)for(var a=(r=l(r.cues)).next();!a.done;a=r.next()){var o=a.value;(a=o.id)&&""!=a||(a=o.startTime+"-"+o.endTime+"-"+o.text),o={id:a,title:o.text,startTime:o.startTime,endTime:o.endTime},i.has(a)||(e.push(o),i.add(a))}return e},i.hh=function(e){e=!!e,this.ja!=e&&(this.ja=e,this.m==od?(this.B.setTextVisibility(e),this.g.streaming.alwaysStreamText||(e?this.j.s||0<(e=wr(this.i.textStreams,this.Gb,this.sd,this.rd)).length&&(ju(this.j,e[0]),Xc(this),Wc(this)):function(e){var t=e.i.get(yi);t&&(Wu(t),Yu(t).catch((function(){})),e.C=e.i.get(yi),e.i.delete(yi)),e.s=null}(this.j))):this.h&&this.h.src&&this.h.textTracks&&this.B.setTextVisibility(e),qc(this))},i.$h=function(){if(this.F)var e=this.F.Dd();else{if(null==this.ga)return new Date;e=this.ga}if(this.i&&!this.Ia()){var t=this.i.presentationTimeline;return new Date(1e3*((t.m||t.i)+e))}return this.h&&this.h.getStartDate?(t=this.h.getStartDate(),isNaN(t.getTime())?null:new Date(t.getTime()+1e3*e)):null},i.Eg=function(){if(this.i&&!this.Ia()){var e=this.i.presentationTimeline;return new Date(1e3*(e.m||e.i))}return this.h&&this.h.getStartDate?(e=this.h.getStartDate(),isNaN(e.getTime())?null:e):null},i.Qd=function(){return this.U()&&this.i?this.i.presentationTimeline.Qd():null},i.zb=function(){if(this.m==od)return this.I.zb();var e={total:[],audio:[],video:[],text:[]};return this.m==sd&&(e.total=Eo(this.h.buffered)),e},i.getStats=function(){if(this.m!=od&&this.m!=sd)return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,corruptedFrames:NaN,stallsDetected:NaN,gapsJumped:NaN,estimatedBandwidth:NaN,completionPercent:NaN,loadLatency:NaN,manifestTimeSeconds:NaN,drmTimeSeconds:NaN,playTime:NaN,pauseTime:NaN,bufferingTime:NaN,licenseTime:NaN,liveLatency:NaN,maxSegmentDuration:NaN,manifestSizeBytes:NaN,bytesDownloaded:NaN,nonFatalErrorCount:NaN,manifestPeriodCount:NaN,manifestGapCount:NaN,switchHistory:[],stateHistory:[]};Oc(this);var e=this.h,t=e.currentTime/e.duration;if(!isNaN(t)&&!this.U()){var n=this.A;t=Math.round(100*t),n.i=isNaN(n.i)?t:Math.max(n.i,t)}if(this.F&&(this.A.S=this.F.hg(),this.A.Y=this.F.ig()),e.getVideoPlaybackQuality){n=e.getVideoPlaybackQuality(),t=this.A;var i=Number(n.totalVideoFrames);t.O=Number(n.droppedVideoFrames),t.M=i,this.A.L=Number(n.corruptedVideoFrames)}if(n=this.C&&(n=this.C).H?n.H:NaN,this.A.o=n,this.m==od){if(n=this.j.j,t=this.j.s,n){var r=(i=this.K?this.K.i:1)*n.bandwidth;t&&t.bandwidth&&(r+=i*t.bandwidth),this.A.A=r}n&&n.video&&(t=this.A,i=n.video.height||NaN,t.m=n.video.width||NaN,t.l=i),this.U()&&(n=this.Eg().valueOf()+1e3*e.currentTime,this.A.B=(Date.now()-n)/1e3),this.i&&(this.A.G=this.i.periodCount,this.A.F=this.i.gapCount,this.i.presentationTimeline&&(this.A.I=this.i.presentationTimeline.h)),n=this.o.getBandwidthEstimate(),this.A.s=n}this.m==sd&&((n=this.A).kc=isNaN(n.kc)?NaN:n.kc+NaN,n=this.A,t=e.videoHeight||NaN,n.m=e.videoWidth||NaN,n.l=t);var a=this.A;e=a.m,n=a.l,t=a.A,i=a.M,r=a.O;for(var o=a.L,s=a.Y,u=a.S,c=a.s,d=a.i,h=a.C,f=a.H,p=a.j,g=lu(a.g,"playing"),m=lu(a.g,"paused"),v=lu(a.g,"buffering"),y=a.o,b=a.B,w=a.I,T=a.Kg,S=a.kc,x=a.K,A=a.G,E=a.F,k=function(e){function t(e){return{timestamp:e.timestamp,state:e.state,duration:e.duration}}for(var n=[],i=l(e.h),r=i.next();!r.done;r=i.next())n.push(t(r.value));return e.g&&n.push(t(e.g)),n}(a.g),I=[],M=(a=l(a.h.g)).next();!M.done;M=a.next())M=M.value,I.push({timestamp:M.timestamp,id:M.id,type:M.type,fromAdaptation:M.fromAdaptation,bandwidth:M.bandwidth});return{width:e,height:n,streamBandwidth:t,decodedFrames:i,droppedFrames:r,corruptedFrames:o,stallsDetected:s,gapsJumped:u,estimatedBandwidth:c,completionPercent:d,loadLatency:h,manifestTimeSeconds:f,drmTimeSeconds:p,playTime:g,pauseTime:m,bufferingTime:v,licenseTime:y,liveLatency:b,maxSegmentDuration:w,manifestSizeBytes:T,bytesDownloaded:S,nonFatalErrorCount:x,manifestPeriodCount:A,manifestGapCount:E,stateHistory:k,switchHistory:I}},i.xh=function(e,t,n,i,r,a,o){o=void 0!==o&&o;var s,u,l,c,d,h,f,p,g,m,v=this;return P((function(y){switch(y.g){case 1:if(v.m!=od&&v.m!=sd)throw new De(1,7,7004);if("subtitles"!=n&&"captions"!=n&&W("Using a kind value different of `subtitles` or `captions` can cause unwanted issues."),i){y.u(2);break}return w(y,Dc(v,e),3);case 3:i=y.h;case 2:if(s=[],v.s&&(s=v.s.getCuePoints()),v.m!=sd){y.u(4);break}return o&&(n="forced"),w(y,Rc(v,e,t,n,i,a||"",s),5);case 5:if(u=Yi(t),l=v.qc(),c=l.find((function(e){return Yi(e.language)==u&&e.label==(a||"")&&e.kind==n})))return Gc(v),y.return(c);throw new De(1,2,2012);case 4:if(d=bi,h=v.h.duration,v.i&&(h=v.i.presentationTimeline.getDuration()),1/0==h)throw new De(1,4,4033);if(!s.length){y.u(6);break}return w(y,Pc(v,e,v.G,v.g.streaming.retryParameters),7);case 7:f=y.h,p=Lc(v,f,i,s),g=new Blob([p],{type:"text/vtt"}),e=Rs(g),i="text/vtt";case 6:if(m={id:v.fg++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:tu(0,h,[e]),mimeType:i||"",codecs:r||"",kind:n,encrypted:!1,drmInfos:[],keyIds:new Set,language:t,originalLanguage:t,label:a||null,type:d.wa,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!!o,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([xi(i||"",r||"")]),isAudioMuxedInVideo:!1},!Ui(xi(m.mimeType,m.codecs)))throw new De(2,2,2014,i);return v.i.textStreams.push(m),Gc(v),y.return(hr(m))}}))},i.yh=function(e,t){var n,i,r,a,o,s,u,c,d,h,f,p,g,m,v,y,b,T=this;return P((function(S){switch(S.g){case 1:if(T.m!=od&&T.m!=sd)throw new De(1,7,7004);if(t){S.u(2);break}return w(S,Dc(T,e),3);case 3:t=S.h;case 2:if("text/vtt"!=t)throw new De(1,2,2017,e);if(n=bi,i=T.h.duration,T.i&&(i=T.i.presentationTimeline.getDuration()),1/0==i)throw new De(1,4,4045);return w(S,Pc(T,e,T.G,T.g.streaming.retryParameters),4);case 4:if(r=S.h,!(a=Fi[t]))throw new De(2,2,2014,t);for(o=a(),s={periodStart:0,segmentStart:0,segmentEnd:i,vttOffset:0},u=ge(r),c=o.parseMedia(u,s,e,[]),d=[],h=l(c),f=h.next(),p={};!f.done;p={ze:void 0,Hc:void 0},f=h.next())p.Hc=f.value,p.ze=null,g=function(t){return function(){return null==t.ze&&(t.ze=hi([e],[t.Hc.payload])),t.ze||[]}}(p),m=new vo(p.Hc.startTime,p.Hc.endTime,g,0,null,null,0,0,1/0),p.Hc.payload.includes("#xywh")&&4===(v=p.Hc.payload.split("#xywh=")[1].split(",")).length&&m.qe({height:parseInt(v[3],10),positionX:parseInt(v[0],10),positionY:parseInt(v[1],10),width:parseInt(v[2],10)}),d.push(m);if(y=t,!d.length){S.u(5);break}return w(S,Al(d[0].N()[0],T.G,T.g.manifest.retryParameters),6);case 6:y=S.h;case 5:return b={id:T.fg++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new Zs(d),mimeType:y||"",codecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:n.He,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,tilesLayout:"1x1",accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([xi(y||"","")]),isAudioMuxedInVideo:!1},T.m==sd?T.ud.push(b):T.i.imageStreams.push(b),Gc(T),S.return(fr(b))}}))},i.wh=function(e,t,n){var i,r,a,o,s=this;return P((function(u){switch(u.g){case 1:if(s.m!=od&&s.m!=sd)throw new De(1,7,7004);if(n){u.u(2);break}return w(u,Dc(s,e),3);case 3:n=u.h;case 2:return i=[],s.s&&(i=s.s.getCuePoints()),w(u,Rc(s,e,t,"chapters",n,"",i),4);case 4:if(r=u.h,a=s.zg(),!(o=a.find((function(e){return e.language==t})))){u.u(5);break}return w(u,new Promise((function(e,t){s.l.pa(r,"load",e),s.l.pa(r,"error",(function(){t(new De(1,2,2015))}))})),6);case 6:return Gc(s),u.return(o);case 5:throw new De(1,2,2012)}}))},i.bj=function(e,t){this.fa.width=e,this.fa.height=t},i.Nf=function(e){if(this.m==od){var t=this.j;if(e=void 0===e?.1:e,t.m.g)t=!1;else if(t.A)t=!1;else{for(var n=l(t.i.values()),i=n.next();!i.done;i=n.next())!(i=i.value).ld||i.Ea||i.eb||(i.ld=!1,zu(t,i,e));t=!0}}else t=!1;return t},i.kf=function(){return W("Shaka Player's internal Manifest structure is NOT covered by semantic versioning compatibility guarantees. It may change at any time! Please consider filing a feature request for whatever you use getManifest() for."),this.i},i.Vh=function(){return this.La},i.Qh=function(){var e={video:null,audio:null,text:null};if(this.m!=od)return e;for(var t=this.j.j,n=this.h.currentTime,i=(t=l([t.video,t.audio,this.j.s])).next();!i.done;i=t.next())if((i=i.value)&&i.segmentIndex){var r=i.segmentIndex.find(n);r={codecs:(r=i.segmentIndex.get(r)).codecs||i.codecs,mimeType:r.mimeType||i.mimeType,bandwidth:r.bandwidth||i.bandwidth},"video"==i.type?(r.width=i.width,r.height=i.height,e.video=r):"audio"==i.type?e.audio=r:i.type==yi&&(e.text=r)}return e},i.kh=function(e){this.ge=e},i.disableStream=function(e,t){if(!this.g.abr.enabled||this.m===rd||!navigator.onLine||0==t||!this.i)return!1;if(this.i.variants.some((function(t){var n=t[e.type];return!(!n||n.id===e.id||t.disabledUntilTime||"audio"==e.type&&e.language!==n.language)}))){for(var n=!1,i=!1,r=l(this.i.variants),a=r.next();!a.done;a=r.next()){var o=(a=a.value)[e.type];o&&(o.id===e.id?(a.disabledUntilTime=Date.now()/1e3+t,n=!0):o.trickModeVideo&&o.trickModeVideo.id==e.id&&(i=!0))}return!(!n&&i||(this.je.Ra(1),t=this.zb().video.reduce((function(e,t){return e+t.end-t.start}),0),Fc(this,!1,t,!0,!1),0))}return!1},i.addFont=function(t,n){var i,r,a,o,s;return P((function(u){if(1==u.g)return"fonts"in document&&"FontFace"in e?w(u,document.fonts.ready,3):u.u(0);if(!("entries"in document.fonts))return u.return();for(i=function(e){for(var t=[],n=(e=e.entries()).next();!1===n.done;)t.push(n.value),n=e.next();return t},r=l(i(document.fonts)),a=r.next();!a.done;a=r.next())if((o=a.value).family==t&&"swap"==o.display)return u.return();s=new FontFace(t,"url("+n+")",{display:"swap"}),document.fonts.add(s),T(u)}))},i.Ia=function(){return!(!this.h||!this.h.remote)&&"disconnected"!=this.h.remote.state},F("shaka.Player",lc),lc.prototype.isRemotePlayback=lc.prototype.Ia,lc.prototype.addFont=lc.prototype.addFont,lc.prototype.setVideoContainer=lc.prototype.kh,lc.prototype.getFetchedPlaybackInfo=lc.prototype.Qh,lc.prototype.getManifestParserFactory=lc.prototype.Vh,lc.prototype.getManifest=lc.prototype.kf,lc.prototype.retryStreaming=lc.prototype.Nf,lc.prototype.setMaxHardwareResolution=lc.prototype.bj,lc.prototype.addChaptersTrack=lc.prototype.wh,lc.prototype.addThumbnailsTrack=lc.prototype.yh,lc.prototype.addTextTrackAsync=lc.prototype.xh,lc.prototype.getStats=lc.prototype.getStats,lc.prototype.getBufferedInfo=lc.prototype.zb,lc.prototype.getSegmentAvailabilityDuration=lc.prototype.Qd,lc.prototype.getPresentationStartTimeAsDate=lc.prototype.Eg,lc.prototype.getPlayheadTimeAsDate=lc.prototype.$h,lc.prototype.setTextTrackVisibility=lc.prototype.hh,lc.prototype.getChapters=lc.prototype.Nh,lc.prototype.getChaptersTracks=lc.prototype.zg,lc.prototype.isTextTrackVisible=lc.prototype.vf,lc.prototype.selectVariantsByLabel=lc.prototype.Xi,lc.prototype.selectTextLanguage=lc.prototype.Pf,lc.prototype.selectAudioLanguage=lc.prototype.$g,lc.prototype.getTextLanguages=lc.prototype.di,lc.prototype.getAudioLanguages=lc.prototype.Kh,lc.prototype.getTextLanguagesAndRoles=lc.prototype.ei,lc.prototype.getAudioLanguagesAndRoles=lc.prototype.Lh,lc.prototype.selectVariantTrack=lc.prototype.Qf,lc.prototype.selectTextTrack=lc.prototype.ah,lc.prototype.getThumbnails=lc.prototype.Fg,lc.prototype.getAllThumbnails=lc.prototype.Jh,lc.prototype.getImageTracks=lc.prototype.Sh,lc.prototype.getTextTracks=lc.prototype.qc,lc.prototype.getVariantTracks=lc.prototype.rc,lc.prototype.cancelTrickPlay=lc.prototype.$c,lc.prototype.trickPlay=lc.prototype.Bd,lc.prototype.getPlaybackRate=lc.prototype.ib,lc.prototype.isBuffering=lc.prototype.tf,lc.prototype.getKeyStatuses=lc.prototype.Od,lc.prototype.getActiveSessionsMetadata=lc.prototype.jf,lc.prototype.getExpiration=lc.prototype.gd,lc.prototype.drmInfo=lc.prototype.drmInfo,lc.prototype.keySystem=lc.prototype.keySystem,lc.prototype.isFullyLoaded=lc.prototype.pi,lc.prototype.goToLive=lc.prototype.li,lc.prototype.seekRange=lc.prototype.Qb,lc.prototype.isAudioOnly=lc.prototype.oi,lc.prototype.isInProgress=lc.prototype.uc,lc.prototype.isLive=lc.prototype.U,lc.prototype.getAdManager=lc.prototype.xg,lc.prototype.getAssetUri=lc.prototype.Mc,lc.prototype.getNetworkingEngine=lc.prototype.Ab,lc.prototype.getMediaElement=lc.prototype.Yh,lc.prototype.getManifestType=lc.prototype.lf,lc.prototype.getLoadMode=lc.prototype.Bg,lc.prototype.resetConfiguration=lc.prototype.Ri,lc.prototype.getBufferFullness=lc.prototype.yg,lc.prototype.getNonDefaultConfiguration=lc.prototype.Dg,lc.prototype.getConfiguration=lc.prototype.getConfiguration,lc.prototype.configure=lc.prototype.configure,lc.prototype.releaseAllMutexes=lc.prototype.Ni,lc.prototype.destroyAllPreloads=lc.prototype.Te,lc.prototype.preload=lc.prototype.preload,lc.prototype.detachAndSavePreload=lc.prototype.tg,lc.prototype.unloadAndSavePreload=lc.prototype.ej,lc.prototype.load=lc.prototype.load,lc.prototype.updateStartTime=lc.prototype.ij,lc.prototype.unload=lc.prototype.ic,lc.prototype.detach=lc.prototype.detach,lc.prototype.attachCanvas=lc.prototype.Ch,lc.prototype.attach=lc.prototype.Tb,lc.probeSupport=function(e){var t,n,i,r,a,o,s;return e=void 0===e||e,P((function(u){switch(u.g){case 1:if(t={},!e){u.u(2);break}return w(u,function(){var e,t,n,i,r,a,o,s,u,c,d,h,f,p,g,m,v,y,b,x,k,I,M,C,D,R,L;return P((function(N){if(1==N.g){for(e="org.w3.clearkey com.widevine.alpha com.widevine.alpha.experiment com.microsoft.playready com.microsoft.playready.hardware com.microsoft.playready.recommendation com.chromecast.playready com.apple.fps.1_0 com.apple.fps".split(" "),n={"com.widevine.alpha":t=["SW_SECURE_CRYPTO","SW_SECURE_DECODE","HW_SECURE_CRYPTO","HW_SECURE_DECODE","HW_SECURE_ALL"],"com.widevine.alpha.experiment":t,"com.microsoft.playready.recommendation":["150","2000","3000"]},a={videoCapabilities:i=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],audioCapabilities:r=[{contentType:'audio/mp4; codecs="mp4a.40.2"'},{contentType:'audio/webm; codecs="opus"'}],initDataTypes:["cenc","sinf","skd","keyids"]},o=[null,"cenc","cbcs","cbcs-1-9"],s=new Map,u=function(e,t){var n,i,r,a,o,u,l,c;return P((function(d){switch(d.g){case 1:return S(d,2),w(d,t.createMediaKeys(),4);case 4:A(d,3);break;case 2:return E(d),d.return();case 3:i=!!(n=t.getConfiguration().sessionTypes)&&n.includes("persistent-license"),Xe()&&(i=!1),r=t.getConfiguration().videoCapabilities,a=t.getConfiguration().audioCapabilities,o={persistentState:i,encryptionSchemes:[],videoRobustnessLevels:[],audioRobustnessLevels:[]},s.has(e)&&s.get(e)?o=s.get(e):s.set(e,o),(u=r[0].encryptionScheme)&&!o.encryptionSchemes.includes(u)&&o.encryptionSchemes.push(u),(l=r[0].robustness)&&!o.videoRobustnessLevels.includes(l)&&o.videoRobustnessLevels.push(l),(c=a[0].robustness)&&!o.audioRobustnessLevels.includes(c)&&o.audioRobustnessLevels.push(c),T(d)}}))},c=function(e,t,n,i){var r,o,s,c,d,h,f,p,g,m;return P((function(v){switch(v.g){case 1:for(S(v,2),r=kt(a),o=l(r.videoCapabilities),s=o.next();!s.done;s=o.next())(c=s.value).encryptionScheme=t,c.robustness=n;for(d=l(r.audioCapabilities),h=d.next();!h.done;h=d.next())(f=h.value).encryptionScheme=t,f.robustness=i;return(p=kt(r)).persistentState="required",p.sessionTypes=["persistent-license"],g=[p,r],w(v,Ki(1,navigator.requestMediaKeySystemAccess(e,g)),4);case 4:return m=v.h,w(v,u(e,m),5);case 5:A(v,0);break;case 2:E(v),T(v)}}))},d=function(e,t,n,a){var o,s,l;return P((function(c){switch(c.g){case 1:return S(c,2),o={type:"media-source",video:{contentType:i[0].contentType,width:640,height:480,bitrate:1,framerate:1},audio:{contentType:r[0].contentType,channels:2,bitrate:1,samplerate:1},keySystemConfiguration:{keySystem:e,video:{encryptionScheme:t,robustness:n},audio:{encryptionScheme:t,robustness:a}}},w(c,Ki(1,navigator.mediaCapabilities.decodingInfo(o)),4);case 4:return s=c.h,l=s.keySystemAccess,w(c,u(e,l),5);case 5:A(c,0);break;case 2:E(c),T(c)}}))},h=l(e),f=h.next();!f.done;f=h.next())p=f.value,s.set(p,null);for(g=[],m=l(o),v=m.next();!v.done;v=m.next())for(y=v.value,b=l(e),x=b.next();!x.done;x=b.next())"org.w3.clearkey"===(k=x.value)&&et()||(g.push(c(k,y,"","")),g.push(d(k,y,"","")));for(I=l(e),M=I.next();!M.done;M=I.next())for(C=M.value,D=l(n[C]||[]),R=D.next();!R.done;R=D.next())L=R.value,g.push(c(C,null,L,"")),g.push(c(C,null,"",L)),g.push(d(C,null,L,"")),g.push(d(C,null,"",L));return w(N,Promise.all(g),2)}return N.return(va(s))}))}(),3);case 3:t=u.h;case 2:var d={};if(Fe())for(var h in co)d[h]=!0;for(var f=(h=l(["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"])).next();!f.done;f=h.next())d[f=f.value]=Fe()?!!co[f]:Ve(f);for(n=d,d={},f=(h=l(h='video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hev1.1.6.L93.90",video/mp4; codecs="hvc1.1.6.L93.90",video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",video/mp4; codecs="av01.0.01M.08",video/mp4; codecs="dvh1.05.01",video/mp4; codecs="dvh1.20.01",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="ac-4.02.01.01",audio/mp4; codecs="opus",audio/mp4; codecs="flac",audio/mp4; codecs="dtsc",audio/mp4; codecs="dtse",audio/mp4; codecs="dtsx",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="vp09.00.10.08",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").concat(c(ji)))).next();!f.done;f=h.next()){d[f=f.value]=!!Ui(f)||(Fe()?ne(f)||!!On(f):Ve(f));var p=f.split(";")[0];d[p]=d[p]||d[f]}return i=d,w(u,st(),4);case 4:for(s in r=u.h,a={manifest:n,media:i,drm:t,hardwareResolution:r},o=ld)a[s]=o[s]();return u.return(a)}}))},lc.isBrowserSupported=function(){if(e.Promise||W("A Promise implementation or polyfill is required"),!(e.Promise&&e.Uint8Array&&Array.prototype.forEach)||rt("Trident/"))return!1;var t=et();return!(t&&9>t||!(e.MediaKeys&&e.navigator&&e.navigator.requestMediaKeySystemAccess&&e.MediaKeySystemAccess&&e.MediaKeySystemAccess.prototype.getConfiguration))&&(!!Fe()||Ve("application/x-mpegurl"))},lc.setAdManagerFactory=function(e){cd=e},lc.registerSupportPlugin=function(e,t){ld[e]=t},lc.prototype.destroy=lc.prototype.destroy;var rd=0,ad=1,od=2,sd=3;lc.LoadMode={DESTROYED:rd,NOT_LOADED:ad,MEDIA_SOURCE:od,SRC_EQUALS:sd},lc.version="v4.12.5";var ud=["4","12"];le=new function(e){this.g=e,this.i=se,this.h=ue}(new ae(Number(ud[0]),Number(ud[1])));var ld={},cd=null;function dd(){this.g=[],this.i=this.l=this.j=this.h=0}function hd(e){return e.g.length?e.g.reduce((function(e,t){return e+t}),0)/e.g.length:0}function fd(e,t,n){var i=this;this.g=e,this.h=t,this.j=n,this.i=!1,this.l=this.h.getVolume(),this.m=new Z,this.m.D(this.h,google.ima.AdEvent.Type.PAUSED,(function(){i.i=!0})),this.m.D(this.h,google.ima.AdEvent.Type.RESUMED,(function(){i.i=!1}))}function pd(){}function gd(e,t){var n=[],i=0;null!=t&&(i=t);for(var r=(e=l(Nt(e,"Ad"))).next();!r.done;r=e.next())if((r=_t(r.value,"InLine"))&&(r=_t(r,"Creatives")))for(var a=(r=l(Nt(r,"Creative"))).next();!a.done;a=r.next()){var o=_t(a.value,"Linear");if(o&&(a=null,o.attributes.skipoffset&&(a=At(o.attributes.skipoffset),isNaN(a)&&(a=null)),o=_t(o,"MediaFiles"))){var s=Nt(o,"MediaFile");for(o=s,(s=s.filter((function(e){return"streaming"==e.attributes.delivery}))).length&&(o=s),s=(o=l(o=o.sort((function(e,t){return(parseInt(t.attributes.height,10)||0)-(parseInt(e.attributes.height,10)||0)})))).next();!s.done;s=o.next()){var u=jt(s=s.value);if(u){n.push({id:null,startTime:i,endTime:null,uri:u,mimeType:s.attributes.type||null,isSkippable:null!=a,skipOffset:a,skipFor:null,canJump:!1,resumeOffset:0,playoutLimit:null,once:!0,pre:null==t,post:1/0==t,timelineRange:!1});break}}}}return n}function md(t,n,i,r,a){var o=this;this.s=t,this.i=n,this.F=!1,this.A=this.o=null,this.G=NaN,this.l=a,this.j=null,this.h=new Z,google.ima.settings.setLocale(i),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(!0),this.C=new google.ima.AdDisplayContainer(this.s,this.i),this.C.initialize(),this.m=new google.ima.AdsLoader(this.C),this.m.getSettings().setPlayerType("shaka-player"),this.m.getSettings().setPlayerVersion("v4.12.5"),this.g=null,this.B=r||new google.ima.AdsRenderingSettings,this.h.D(this.m,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,(function(t){!function(t,n){if(t.l(new Jr("ads-loaded",(new Map).set("loadTime",Date.now()/1e3-t.G))),t.o.customPlayheadTracker){var i={currentTime:t.i.currentTime};t.g=n.getAdsManager(i,t.B),t.i.muted?t.g.setVolume(0):t.g.setVolume(t.i.volume),t.h.D(t.i,"timeupdate",(function(){t.i.duration&&(i.currentTime=t.i.currentTime)})),t.h.D(t.i,"volumechange",(function(){t.j&&(t.j.setVolume(t.i.volume),t.i.muted&&t.j.setMuted(!0))}))}else t.g=n.getAdsManager(t.i,t.B);t.l(new Jr("ima-ad-manager-loaded",(new Map).set("imaAdManager",t.g)));var r=t.g.getCuePoints();if(r.length){n=[];for(var a=(r=l(r)).next();!a.done;a=r.next())n.push({start:a.value,end:null});t.l(new Jr("ad-cue-points-changed",(new Map).set("cuepoints",n)))}!function(e){function t(t,n){t=(new Map).set("originalEvent",t),e.l(new Jr(n,t))}e.h.D(e.g,google.ima.AdErrorEvent.Type.AD_ERROR,(function(t){vd(e,t)})),e.h.D(e.g,google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,(function(t){bd(e,t)})),e.h.D(e.g,google.ima.AdEvent.Type.STARTED,(function(t){bd(e,t)})),e.h.D(e.g,google.ima.AdEvent.Type.FIRST_QUARTILE,(function(e){t(e,"ad-first-quartile")})),e.h.D(e.g,google.ima.AdEvent.Type.MIDPOINT,(function(e){t(e,"ad-midpoint")})),e.h.D(e.g,google.ima.AdEvent.Type.THIRD_QUARTILE,(function(e){t(e,"ad-third-quartile")})),e.h.D(e.g,google.ima.AdEvent.Type.COMPLETE,(function(e){t(e,"ad-complete")})),e.h.D(e.g,google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,(function(t){wd(e,t)})),e.h.D(e.g,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,(function(t){wd(e,t)})),e.h.D(e.g,google.ima.AdEvent.Type.SKIPPED,(function(e){t(e,"ad-skipped")})),e.h.D(e.g,google.ima.AdEvent.Type.VOLUME_CHANGED,(function(e){t(e,"ad-volume-changed")})),e.h.D(e.g,google.ima.AdEvent.Type.VOLUME_MUTED,(function(e){t(e,"ad-muted")})),e.h.D(e.g,google.ima.AdEvent.Type.PAUSED,(function(n){e.j&&(e.j.i=!0,t(n,"ad-paused"))})),e.h.D(e.g,google.ima.AdEvent.Type.RESUMED,(function(n){e.j&&(e.j.i=!1,t(n,"ad-resumed"))})),e.h.D(e.g,google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,(function(n){e.j&&t(n,"ad-skip-state-changed")})),e.h.D(e.g,google.ima.AdEvent.Type.CLICK,(function(e){t(e,"ad-clicked")})),e.h.D(e.g,google.ima.AdEvent.Type.AD_PROGRESS,(function(e){t(e,"ad-progress")})),e.h.D(e.g,google.ima.AdEvent.Type.AD_BUFFERING,(function(e){t(e,"ad-buffering")})),e.h.D(e.g,google.ima.AdEvent.Type.IMPRESSION,(function(e){t(e,"ad-impression")})),e.h.D(e.g,google.ima.AdEvent.Type.DURATION_CHANGE,(function(e){t(e,"ad-duration-changed")})),e.h.D(e.g,google.ima.AdEvent.Type.USER_CLOSE,(function(e){t(e,"ad-closed")})),e.h.D(e.g,google.ima.AdEvent.Type.LOADED,(function(e){t(e,"ad-loaded")})),e.h.D(e.g,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,(function(e){t(e,"all-ads-completed")})),e.h.D(e.g,google.ima.AdEvent.Type.LINEAR_CHANGED,(function(e){t(e,"ad-linear-changed")})),e.h.D(e.g,google.ima.AdEvent.Type.AD_METADATA,(function(e){t(e,"ad-metadata")})),e.h.D(e.g,google.ima.AdEvent.Type.LOG,(function(e){t(e,"ad-recoverable-error")})),e.h.D(e.g,google.ima.AdEvent.Type.AD_BREAK_READY,(function(e){t(e,"ad-break-ready")})),e.h.D(e.g,google.ima.AdEvent.Type.INTERACTION,(function(e){t(e,"ad-interaction")}))}(t);try{t.g.init(t.i.offsetWidth,t.i.offsetHeight,yd(t)?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL),t.h.D(t.i,"loadeddata",(function(){t.g.resize(t.i.offsetWidth,t.i.offsetHeight,yd(t)?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)})),"ResizeObserver"in e?(t.A=new ResizeObserver((function(){t.g.resize(t.i.offsetWidth,t.i.offsetHeight,yd(t)?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)})),t.A.observe(t.i)):t.h.D(document,"fullscreenchange",(function(){t.g.resize(t.i.offsetWidth,t.i.offsetHeight,yd(t)?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)})),t.F||t.o.skipPlayDetection?t.g.start():t.h.pa(t.i,"play",(function(){t.F=!0,t.g.start()}))}catch(e){wd(t,null)}}(o,t)})),this.h.D(this.m,google.ima.AdErrorEvent.Type.AD_ERROR,(function(e){vd(o,e)})),this.h.D(this.i,"ended",(function(){o.m.contentComplete()})),this.h.pa(this.i,"play",(function(){o.F=!0}))}function vd(e,t){t.getError(),t=(new Map).set("originalEvent",t),e.l(new Jr("ad-error",t)),wd(e,null),e.l(new Jr("ad-cue-points-changed",(new Map).set("cuepoints",[])))}function yd(e){return document.fullscreenEnabled?!!document.fullscreenElement:!!(e=e.i).webkitSupportsFullscreen&&e.webkitDisplayingFullscreen}function bd(e,t){var n=t.getAd();n?(e.j=new fd(n,e.g,e.i),t.type!=google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED||e.o.supportsMultipleMediaElements||e.l(new Jr("ad-content-pause-requested")),t=(new Map).set("ad",e.j).set("sdkAdObject",n).set("originalEvent",t),e.l(new Jr("ad-started",t)),e.j.isLinear()&&(e.s.setAttribute("ad-active","true"),e.o.customPlayheadTracker||e.i.pause(),e.i.muted?((t=e.j).l=e.i.volume,t.h.setVolume(0)):e.j.setVolume(e.i.volume))):W("The IMA SDK fired a "+t.type+" event with no associated ad. Unable to play ad!")}function wd(e,t){t&&t.type==google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED&&!e.o.supportsMultipleMediaElements&&e.l(new Jr("ad-content-resume-requested")),e.l(new Jr("ad-stopped",(new Map).set("originalEvent",t))),e.j&&e.j.isLinear()&&(e.s.removeAttribute("ad-active"),e.o.customPlayheadTracker||e.i.ended||e.i.play())}function Td(e,t,n,i,r,a,o,s){this.g=e,this.i=(this.h=t)?n||0:n,this.j=i,this.o=r,this.s=a,this.l=o,this.m=s}function Sd(e,t,n,i){function r(){if(!a.H&&a.l&&!a.B.Ia()){a.l=a.h.currentTime,a.m&&!a.m.pre&&!a.m.post&&a.l<a.m.startTime&&(a.m=null);var e=Ed(a);e&&kd(a,e,1,1,Date.now())}}var a=this;if(this.M=null,this.G=e,this.B=t,this.h=n,this.F=null,this.s=!0,this.o=this.h,this.i=i,this.I=new Set,this.C=new Set,this.A=new Map,this.g=new lc,Md(this),this.K=new Z,this.j=new Z,this.H=!1,this.m=this.l=null,this.K.D(this.h,"timeupdate",(function(){if(!(a.H||a.l||a.B.Ia())){a.l=a.h.currentTime;var e=Ed(a,!0);e&&kd(a,e,1,1,Date.now())}})),this.K.D(this.h,"ended",(function(){r()})),this.L=new Be(r),"requestVideoFrameCallback"in this.h&&!it()){var o=this.h,s=function(){r(),o.requestVideoFrameCallback(s)};o.requestVideoFrameCallback(s)}else this.L.Ra(.025);this.O=new Be((function(){var e,t,n,i,r,o,s,u,c,d,h;return P((function(f){switch(f.g){case 1:if(!a.C.size||null==a.l){f.u(0);break}if((e=a.B.Bg())==rd||e==ad)return f.return();t=!1,n=Array.from(a.C),i=a.B.Qb(),r=l(n),o=r.next();case 3:if(o.done){f.u(5);break}if((s=o.value)==a.m){f.u(4);break}if(u=s.endTime||s.startTime,!(1<=i.start-u)){0<(c=s.startTime-a.l)&&10>=c&&(a.A.has(s)||a.A.set(s,a.g.preload(s.uri,null,s.mimeType||void 0))),f.u(4);break}if(!a.A.has(s)){f.u(7);break}return w(f,a.A.get(s),8);case 8:(d=f.h)&&d.destroy(),a.A.delete(s);case 7:h=JSON.stringify(s),a.I.has(h)&&a.I.delete(h),a.C.delete(s),t=!0;case 4:o=r.next(),f.u(3);break;case 5:t&&Id(a),T(f)}}))})).Ra(1)}function xd(e){if(e.G&&e.M&&!e.H){var t=e.M.supportsMultipleMediaElements,n=e.h;n.webkitSupportsFullscreen&&n.webkitDisplayingFullscreen&&(t=!1),e.s==t&&(e.s=!t,e.s?(e.o=e.h,e.F&&(e.F.parentElement&&e.G.removeChild(e.F),e.F=null)):(e.F||((t=document.createElement(e.h.tagName)).autoplay=!0,t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.width="100%",t.style.height="100%",t.style.backgroundColor="rgb(0, 0, 0)",t.setAttribute("playsinline",""),e.F=t),e.o=e.F))}}function Ad(e,t){for(var n=!1,i=(t=l(t)).next();!i.done;i=t.next()){var r=(i=i.value).id||JSON.stringify(i);if(!e.I.has(r)){if(n=!0,e.I.add(r),e.C.add(i),r=!1,i.pre&&null==e.l)r=!0;else if(0!=i.startTime||i.canJump){if(null!=e.l){var a=i.startTime-e.l;0<a&&10>=a&&(r=!0)}}else r=!0;r&&(e.A.has(i)||e.A.set(i,e.g.preload(i.uri,null,i.mimeType||void 0)))}}n&&Id(e)}function Ed(e,t,n){t=void 0!==t&&t,n=void 0===n?null:n;var i=0,r=null;if(e.C.size&&null!=e.l){var a=e.h.ended,o=Array.from(e.C).sort((function(e,t){return t.startTime-e.startTime})),s=o;for(s=t?o.filter((function(e){return e.pre})):a?o.filter((function(e){return e.post})):o.filter((function(e){return!e.pre&&!e.post})),s=(o=l(s)).next();!s.done;s=o.next()){s=s.value;var u=!1;if(t)u=s.pre;else if(a)u=s.post;else if(!s.pre&&!s.post){var c=e.l-Math.round(1e3*s.startTime)/1e3;0<c&&(1>=c||!s.canJump)&&(u=!(null==n&&e.m&&!e.m.pre&&!e.m.post&&e.m.startTime>=s.startTime))}u&&(!e.m||s.startTime>=e.m.startTime)&&(i==(n||0)?r=s:r&&!s.canJump&&.001<Math.round(1e3*s.startTime)/1e3-Math.round(1e3*r.startTime)/1e3&&(r=s,i=0),i++)}}return r}function kd(e,t,n,i,r,a){var o,s,u,l,c,d,h,f,p,g,m,v,y,b,x,k;a=void 0===a?0:a,P((function(I){switch(I.g){case 1:if(xd(e),e.m=t,o=Date.now(),!e.o.parentElement&&e.G&&e.G.appendChild(e.o),1==i&&1==n&&(n=Array.from(e.C).filter((function(e){return t.pre?e.pre==t.pre:t.post?e.post==t.post:.001>Math.abs(e.startTime-t.startTime)})).length),t.once&&(a++,e.C.delete(t),Id(e)),e.H=!0,!e.s||1!=i){I.u(2);break}return e.i(new Jr("ad-content-pause-requested",(new Map).set("saveLivePosition",!0))),s=new Gr,u=function(t){return P((function(n){if(1==n.g)return"detach"!=t.state?n.u(0):it()?w(n,new Promise((function(e){return new Be(e).$(.1)})),3):n.u(3);s.resolve(),e.j.cb(e.B,"onstatechange",u),T(n)}))},e.j.D(e.B,"onstatechange",u),w(I,s,2);case 2:return e.s||(e.h.pause(),null!=t.resumeOffset&&0!=t.resumeOffset&&(e.h.currentTime+=t.resumeOffset)),l=!1,c=null,d=function(){if(!e.s&&null==t.resumeOffset)if(t.timelineRange&&t.endTime&&1/0!=t.endTime)e.h.currentTime!=t.endTime&&(e.h.currentTime=t.endTime);else{var n=Date.now();e.h.currentTime+=(n-r)/1e3,r=n}},h=function(){var o,s;return P((function(u){if(1==u.g)return d(),c&&c.stop(),(o=Ed(e,t.pre,i-a))?(e.i(new Jr("ad-stopped")),e.j.Va(),kd(e,o,n,++i,r,a),u.u(0)):(t.post&&(e.l=null,e.m=null),e.s?w(u,e.g.detach(),4):w(u,e.g.ic(),4));e.s&&(null==(s=t.resumeOffset)&&(s=t.timelineRange&&t.endTime&&1/0!=t.endTime?t.endTime-(e.l||0):(Date.now()-r)/1e3),e.i(new Jr("ad-content-resume-requested",(new Map).set("offset",s)))),e.i(new Jr("ad-stopped")),e.j.Va(),e.H=!1,e.s?Id(e):(d(),e.h.ended||e.h.play()),xd(e),T(u)}))},f=function(t){return P((function(n){return l?n.return():(l=!0,e.i(new Jr("ad-error",(new Map).set("originalEvent",t))),w(n,h(),0))}))},p=function(){return P((function(t){if(1==t.g)return l?t.return():(l=!0,w(t,h(),2));e.i(new Jr("ad-complete")),T(t)}))},g=function(){return P((function(t){return l?t.return():(l=!0,e.i(new Jr("ad-skipped")),w(t,h(),0))}))},m=new Td(e.o,t.isSkippable,t.skipOffset,t.skipFor,g,n,i,!e.s),e.s||(m.setMuted(e.h.muted),m.setVolume(e.h.volume)),e.i(new Jr("ad-started",(new Map).set("ad",m))),(v=m.canSkipNow())&&e.i(new Jr("ad-skip-state-changed")),e.j.pa(e.g,"error",f),e.j.D(e.o,"timeupdate",(function(){if(e.o.duration){var t=m.canSkipNow();v!=t&&0<m.getRemainingTime()&&0<m.getDuration()&&e.i(new Jr("ad-skip-state-changed")),v=t}})),e.j.pa(e.g,"firstquartile",(function(){d(),e.i(new Jr("ad-first-quartile"))})),e.j.pa(e.g,"midpoint",(function(){d(),e.i(new Jr("ad-midpoint"))})),e.j.pa(e.g,"thirdquartile",(function(){d(),e.i(new Jr("ad-third-quartile"))})),e.j.pa(e.g,"complete",p),e.j.D(e.o,"play",(function(){e.i(new Jr("ad-resumed"))})),e.j.D(e.o,"pause",(function(){var t=e.g.getConfiguration();e.o.currentTime>=t.playRangeEnd?p():e.i(new Jr("ad-paused"))})),e.j.D(e.o,"volumechange",(function(){e.o.muted?e.i(new Jr("ad-muted")):e.i(new Jr("ad-volume-changed"))})),S(I,4),Md(e),t.startTime&&t.endTime&&1/0!=t.endTime&&t.startTime!=t.endTime&&0<(y=t.endTime-t.startTime)&&e.g.configure("playRangeEnd",y),t.playoutLimit&&(c=new Be((function(){m.skip()})).$(t.playoutLimit),e.g.configure("playRangeEnd",t.playoutLimit)),w(I,e.g.Tb(e.o),6);case 6:return e.A.has(t)?w(I,e.A.get(t),10):w(I,e.g.load(t.uri,null,t.mimeType||void 0),8);case 10:return b=I.h,e.A.delete(t),w(I,b?e.g.load(b):e.g.load(t.uri,null,t.mimeType||void 0),8);case 8:t.playoutLimit&&(c&&c.stop(),c=new Be((function(){m.skip()})).$(t.playoutLimit)),x=(Date.now()-o)/1e3,e.i(new Jr("ads-loaded",(new Map).set("loadTime",x))),e.s&&e.h.play(),A(I,0);break;case 4:k=E(I),f(k),T(I)}}))}function Id(e){for(var t=[],n=l(e.C),i=n.next(),r={};!i.done;r={Sb:void 0},i=n.next())i=i.value,r.Sb={start:i.startTime,end:null},i.pre?(r.Sb.start=0,r.Sb.end=null):i.post?(r.Sb.start=-1,r.Sb.end=null):i.timelineRange&&(r.Sb.end=i.endTime),t.find(function(e){return function(t){return e.Sb.start==t.start&&e.Sb.end==t.end}}(r))||t.push(r.Sb);e.i(new Jr("ad-cue-points-changed",(new Map).set("cuepoints",t)))}function Md(e){e.g.configure(e.B.Dg()),e.g.configure("ads.disableHLSInterstitial",!0),e.g.configure("ads.disableDASHInterstitial",!0);var t=e.g.Ab();t.og(),t.pg(),ra(e.B.Ab(),t)}function Cd(e,t,n){var i,r;return P((function(a){return 1==a.g?(i=aa([t],{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4}),w(a,e.B.Ab().request(7,i,n).promise,2)):(r=a.h,a.return(r.data))}))}function Dd(e,t,n,i,r){this.h=e,this.j=At(this.h.skipOffset),this.g=r,this.i=t,this.l=n,this.o=i,this.m=!1}function Rd(e,t,n,i){this.B=e,this.K=t,this.h=n,this.l=null,this.S=NaN,this.i=i,this.I=!1,this.A=null,this.j=[],this.M=[],this.L=this.C=this.g=null,this.F=new Map,this.m=[],this.s=[],this.G="",this.O=!0,this.H="",this.o=new Z}function Pd(e,t){var n,i,r,a,o,s,u,l;P((function(c){return 1==c.g?t.staticResource?(n=Ld(t),e.F.get(n)?c.return():(i={type:9},r=aa([t.staticResource],{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4}),a=e.K.request(7,r,i),S(c,2),e.F.set(n,[]),w(c,a.promise,4))):c.return():2!=c.g?(o=c.h,s=dt(o.data),u=JSON.parse(s),l=u.apps,e.F.set(n,l),A(c,0)):(E(c),e.F.delete(n),void T(c))}))}function Ld(e){return[e.adId,e.adParameters,e.adSystem,e.adTitle,e.creativeAdId,e.creativeId,e.creativeSequence,e.height,e.width,e.staticResource].join("")}function Nd(e){var t=e.h.currentTime;if(0!=t&&null==e.A){for(var n,i,r=l(e.j),a=r.next();!a.done;a=r.next())for(var o=l((a=a.value).ads),s=o.next();!s.done;s=o.next())if(s=s.value,i){if(s.startTimeInSeconds<t&&s.startTimeInSeconds>i.startTimeInSeconds+i.durationInSeconds){i=s,n=a;break}}else s.startTimeInSeconds<t&&(i=s,n=a);n&&i&&!e.M.includes(i.adId)&&(e.A=t,e.h.currentTime=n.startTimeInSeconds)}}function jd(e){if(e.h.duration&&(e.g||e.j.length)){var t=e.h.currentTime,n=!1;if(e.g){n=!0;var i=e.C,r=i.startTimeInSeconds+.5*i.durationInSeconds,a=i.startTimeInSeconds+.75*i.durationInSeconds;t>=i.startTimeInSeconds+.25*i.durationInSeconds&&!e.s.includes("firstQuartile")?(e.s.push("firstQuartile"),_d(e,"firstQuartile")):t>=r&&!e.s.includes("midpoint")?(e.s.push("midpoint"),_d(e,"midpoint")):t>=a&&!e.s.includes("thirdQuartile")&&(e.s.push("thirdQuartile"),_d(e,"thirdQuartile")),i=e.g.getRemainingTime(),r=e.g.getDuration(),e.g.canSkipNow()&&0<i&&0<r&&_d(e,"skipStateChanged"),0<r&&(0>=i||i>r)&&Od(e)}if(!e.g||!e.g.isLinear()){e:for(i=l(e.j),r=i.next();!r.done&&(r=r.value,!e.g||!e.g.isLinear());r=i.next())for(a=0;a<r.ads.length;a++){var o=r.ads[a],s=o.startTimeInSeconds+o.durationInSeconds;if(o.startTimeInSeconds<=t&&s>t){if(e.M.includes(o.adId)){if(e.h.ended)continue;e.h.currentTime=s;break e}Od(e),e.L=r,e.g=new Dd(o,a+1,r.ads.length,!0,e.h),e.C=o,0===a&&_d(e,"breakStart"),Ud(e);break}}if(!e.g)for(r=(i=l(e.j)).next();!r.done&&(r=r.value,!e.g);r=i.next())for(a=0;a<r.nonLinearAdsList.length;a++)if((o=r.nonLinearAdsList[a]).nonLinearAdList.length){s=r.startTimeInSeconds;var u=e.F.get(Ld(o.nonLinearAdList[0]));if(s<=t&&u&&u.length){Od(e),s=e;for(var c=(u=l(u)).next();!c.done;c=u.next())if((c=c.value).data.source.length){var d=document.createElement("img");d.src=c.data.source[0].url,d.style.top=(c.placeholder.top||0)+"%",d.style.height=100-(c.placeholder.top||0)+"%",d.style.left=(c.placeholder.left||0)+"%",d.style.maxWidth=100-(c.placeholder.left||0)+"%",d.style.objectFit="contain",d.style.position="absolute",s.B.appendChild(d)}e.L=r,e.g=new Dd(o,a+1,r.ads.length,!1,e.h),e.C=o,0===a&&_d(e,"breakStart"),Ud(e);break}}n&&!e.g&&(t=e.h.currentTime,e.A&&e.A>t&&(e.h.currentTime=e.A),e.A=null)}}}function Od(e){if(e.g){for(;e.B.lastChild;)e.B.removeChild(e.B.firstChild);e.I||e.M.push(e.C.adId);var t=e.g.m;_d(e,void 0!==t&&t?"skip":"complete");for(var n=(t=l(e.m)).next();!n.done;n=t.next())n=n.value,e.o.cb(n.target,n.type,n.listener);e.m=[],e.s=[],(t=e.g.getPositionInSequence())===(n=e.g.getSequenceLength())&&_d(e,"breakEnd"),e.g=null,e.C=null,e.L=null}}function Ud(e){var t=!1;e.h.paused?t=!0:(_d(e,"impression"),_d(e,"start")),e.m.push({target:e.h,type:"volumechange",listener:function(){e.h.muted&&_d(e,"mute")}}),e.m.push({target:e.h,type:"volumechange",listener:function(){e.h.muted||_d(e,"unmute")}}),e.m.push({target:e.h,type:"play",listener:function(){t?(_d(e,"impression"),_d(e,"start"),t=!1):_d(e,"resume")}}),e.m.push({target:e.h,type:"pause",listener:function(){_d(e,"pause")}});for(var n=l(e.m),i=n.next();!i.done;i=n.next())i=i.value,e.o.D(i.target,i.type,i.listener)}function _d(e,t){var n=e.C.trackingEvents.find((function(e){return e.eventType==t}));if(n||(n=e.L.adBreakTrackingEvents.find((function(e){return e.eventType==t}))),n)for(var i={type:10},r=(n=l(n.beaconUrls)).next();!r.done;r=n.next())(r=r.value)&&""!=r&&((r=aa([r],{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4})).method="POST",e.K.request(7,r,i));switch(t){case"impression":e.i(new Jr("ad-impression"));break;case"start":e.i(new Jr("ad-started",(new Map).set("ad",e.g)));break;case"mute":e.i(new Jr("ad-muted"));break;case"unmute":e.i(new Jr("ad-volume-changed"));break;case"resume":e.i(new Jr("ad-resumed"));break;case"pause":e.i(new Jr("ad-paused"));break;case"firstQuartile":e.i(new Jr("ad-first-quartile"));break;case"midpoint":e.i(new Jr("ad-midpoint"));break;case"thirdQuartile":e.i(new Jr("ad-third-quartile"));break;case"complete":e.i(new Jr("ad-complete")),e.i(new Jr("ad-stopped"));break;case"skip":e.i(new Jr("ad-skipped")),e.i(new Jr("ad-stopped"));break;case"breakStart":e.B.setAttribute("ad-active","true");break;case"breakEnd":e.B.removeAttribute("ad-active");break;case"skipStateChanged":e.i(new Jr("ad-skip-state-changed"))}}function Bd(e,t){this.g=e,this.i=null,this.h=t}function Fd(e,t,n,i){var r=this;this.s=e,this.l=t,this.j=null,this.F=NaN,this.i=i,this.G=!1,this.A=this.m=this.o=null,this.B="",this.C=[],this.h=new Z,(e=new google.ima.dai.api.UiSettings).setLocale(n),this.g=new google.ima.dai.api.StreamManager(this.l,this.s,e),this.i(new Jr("ima-stream-manager-loaded",(new Map).set("imaStreamManager",this.g))),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.LOADED,(function(e){!function(e,t){e.i(new Jr("ads-loaded",(new Map).set("loadTime",Date.now()/1e3-e.F))),t=t.getStreamData().url,e.j.resolve(t),e.j=null,e.G||e.h.D(e.l,"seeked",(function(){var t=e.l.currentTime;if(0!=t){e.g.streamTimeForContentTime(t);var n=e.g.previousCuePointForStreamTime(t);n&&!n.played&&(e.o=t,e.l.currentTime=n.start)}}))}(r,e)})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.ERROR,(function(){r.B.length?r.j.resolve(r.B):r.j.reject("IMA Stream request returned an error and there was no backup asset uri provided."),r.j=null})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED,(function(){})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.STARTED,(function(e){e=e.getAd(),r.m=new Bd(e,r.l),r.A&&(r.m.i=r.A),r.i(new Jr("ad-started",(new Map).set("ad",r.m))),r.s.setAttribute("ad-active","true")})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED,(function(){r.s.removeAttribute("ad-active");var e=r.l.currentTime;r.o&&r.o>e&&(r.l.currentTime=r.o,r.o=null)})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.AD_PROGRESS,(function(e){r.A=e.getStreamData().adProgressData,r.m&&(r.m.i=r.A)})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.FIRST_QUARTILE,(function(){r.i(new Jr("ad-first-quartile"))})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.MIDPOINT,(function(){r.i(new Jr("ad-midpoint"))})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.THIRD_QUARTILE,(function(){r.i(new Jr("ad-third-quartile"))})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.COMPLETE,(function(){r.i(new Jr("ad-complete")),r.i(new Jr("ad-stopped")),r.s.removeAttribute("ad-active"),r.m=null})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.SKIPPED,(function(){r.i(new Jr("ad-skipped")),r.i(new Jr("ad-stopped"))})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.CUEPOINTS_CHANGED,(function(e){var t=e.getStreamData();e=[];for(var n=(t=l(t.cuepoints)).next();!n.done;n=t.next())n=n.value,e.push({start:n.start,end:n.end});r.C=e,r.i(new Jr("ad-cue-points-changed",(new Map).set("cuepoints",e)))}))}function Vd(){Zr.call(this),this.g=this.i=this.j=this.h=null,this.m=new dd,this.o=navigator.language,this.l=null}function Hd(e,t){if(t&&t.type)switch(t.type){case"ads-loaded":e.m.g.push(t.loadTime);break;case"ad-started":e.m.h++;break;case"ad-complete":e.m.j++;break;case"ad-skipped":e.m.l++;break;case"ad-error":e.m.i++}e.dispatchEvent(t)}function Gd(e){return JSON.stringify(e,(function(e,t){if("function"!=typeof t){if(t instanceof Event||t instanceof Jr){var n={};for(i in t)(e=t[i])&&"object"==typeof e?"detail"==i&&(n[i]=e):i in Event||(n[i]=e);return n}if(t instanceof Error){var i=new Set(["name","message","stack"]);for(n in t)i.add(n);for(e=(n=l(Object.getOwnPropertyNames(t))).next();!e.done;e=n.next())i.add(e.value);for(n={},e=(i=l(i)).next();!e.done;e=i.next())n[e=e.value]=t[e];t={__type__:"Error",contents:n}}else if(t instanceof TimeRanges){for(i={__type__:"TimeRanges",length:t.length,start:[],end:[]},n=(t=l(Eo(t))).next();!n.done;n=t.next())e=(n=n.value).end,i.start.push(n.start),i.end.push(e);t=i}else t=ArrayBuffer.isView(t)&&1===t.BYTES_PER_ELEMENT?{__type__:"Uint8Array",entries:Array.from(t)}:"number"==typeof t?isNaN(t)?"NaN":isFinite(t)?t:0>t?"-Infinity":"Infinity":t;return t}}))}function Kd(e){return JSON.parse(e,(function(e,t){if("NaN"==t)var n=NaN;else if("-Infinity"==t)n=-1/0;else if("Infinity"==t)n=1/0;else if(t&&"object"==typeof t&&"TimeRanges"==t.__type__)n=function(e){return{length:e.length,start:function(t){return e.start[t]},end:function(t){return e.end[t]}}}(t);else if(t&&"object"==typeof t&&"Uint8Array"==t.__type__)n=new Uint8Array(t.entries);else if(t&&"object"==typeof t&&"Error"==t.__type__){for(n in e=t.contents,t=Error(e.message),e)t[n]=e[n];n=t}else n=t;return n}))}(i=fd.prototype).needsSkipUI=function(){return!1},i.isClientRendering=function(){return!0},i.isUsingAnotherMediaElement=function(){return!0},i.getDuration=function(){return this.g.getDuration()},i.getMinSuggestedDuration=function(){return this.g.getMinSuggestedDuration()},i.getRemainingTime=function(){return this.h.getRemainingTime()},i.isPaused=function(){return this.i},i.isSkippable=function(){return 0<=this.g.getSkipTimeOffset()},i.getTimeUntilSkippable=function(){var e=this.g.getSkipTimeOffset();return e=this.getRemainingTime()-e,Math.max(e,0)},i.canSkipNow=function(){return this.h.getAdSkippableState()},i.skip=function(){return this.h.skip()},i.pause=function(){return this.h.pause()},i.play=function(){return this.h.resume()},i.getVolume=function(){return this.h.getVolume()},i.setVolume=function(e){return this.j.volume=e,this.h.setVolume(e)},i.isMuted=function(){return 0==this.h.getVolume()},i.isLinear=function(){return this.g.isLinear()},i.resize=function(e,t){var n=!1,i=this.j;document.fullscreenEnabled?n=!!document.fullscreenElement:i.webkitSupportsFullscreen&&(n=i.webkitDisplayingFullscreen),this.h.resize(e,t,n?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)},i.setMuted=function(e){(this.j.muted=e)?(this.l=this.getVolume(),this.h.setVolume(0)):this.h.setVolume(this.l)},i.getSequenceLength=function(){var e=this.g.getAdPodInfo();return null==e?1:e.getTotalAds()},i.getPositionInSequence=function(){var e=this.g.getAdPodInfo();return null==e?1:e.getAdPosition()},i.getTitle=function(){return this.g.getTitle()},i.getDescription=function(){return this.g.getDescription()},i.getVastMediaBitrate=function(){return this.g.getVastMediaBitrate()},i.getVastMediaHeight=function(){return this.g.getVastMediaHeight()},i.getVastMediaWidth=function(){return this.g.getVastMediaWidth()},i.getAdId=function(){return this.g.getAdId()},i.getCreativeAdId=function(){return this.g.getCreativeAdId()},i.getAdvertiserName=function(){return this.g.getAdvertiserName()},i.getMediaUrl=function(){return this.g.getMediaUrl()},i.getTimeOffset=function(){var e=this.g.getAdPodInfo();return null==e?0:e.getTimeOffset()},i.getPodIndex=function(){var e=this.g.getAdPodInfo();return null==e?0:e.getPodIndex()},i.release=function(){this.h=this.g=null},F("shaka.ads.ClientSideAd",fd),fd.prototype.release=fd.prototype.release,fd.prototype.getPodIndex=fd.prototype.getPodIndex,fd.prototype.getTimeOffset=fd.prototype.getTimeOffset,fd.prototype.getMediaUrl=fd.prototype.getMediaUrl,fd.prototype.getAdvertiserName=fd.prototype.getAdvertiserName,fd.prototype.getCreativeAdId=fd.prototype.getCreativeAdId,fd.prototype.getAdId=fd.prototype.getAdId,fd.prototype.getVastMediaWidth=fd.prototype.getVastMediaWidth,fd.prototype.getVastMediaHeight=fd.prototype.getVastMediaHeight,fd.prototype.getVastMediaBitrate=fd.prototype.getVastMediaBitrate,fd.prototype.getDescription=fd.prototype.getDescription,fd.prototype.getTitle=fd.prototype.getTitle,fd.prototype.getPositionInSequence=fd.prototype.getPositionInSequence,fd.prototype.getSequenceLength=fd.prototype.getSequenceLength,fd.prototype.setMuted=fd.prototype.setMuted,fd.prototype.resize=fd.prototype.resize,fd.prototype.isLinear=fd.prototype.isLinear,fd.prototype.isMuted=fd.prototype.isMuted,fd.prototype.setVolume=fd.prototype.setVolume,fd.prototype.getVolume=fd.prototype.getVolume,fd.prototype.play=fd.prototype.play,fd.prototype.pause=fd.prototype.pause,fd.prototype.skip=fd.prototype.skip,fd.prototype.canSkipNow=fd.prototype.canSkipNow,fd.prototype.getTimeUntilSkippable=fd.prototype.getTimeUntilSkippable,fd.prototype.isSkippable=fd.prototype.isSkippable,fd.prototype.isPaused=fd.prototype.isPaused,fd.prototype.getRemainingTime=fd.prototype.getRemainingTime,fd.prototype.getMinSuggestedDuration=fd.prototype.getMinSuggestedDuration,fd.prototype.getDuration=fd.prototype.getDuration,fd.prototype.isUsingAnotherMediaElement=fd.prototype.isUsingAnotherMediaElement,fd.prototype.isClientRendering=fd.prototype.isClientRendering,fd.prototype.needsSkipUI=fd.prototype.needsSkipUI,F("shaka.ads.Utils",pd),pd.ADS_LOADED="ads-loaded",pd.AD_STARTED="ad-started",pd.AD_FIRST_QUARTILE="ad-first-quartile",pd.AD_MIDPOINT="ad-midpoint",pd.AD_THIRD_QUARTILE="ad-third-quartile",pd.AD_COMPLETE="ad-complete",pd.AD_STOPPED="ad-stopped",pd.AD_SKIPPED="ad-skipped",pd.AD_VOLUME_CHANGED="ad-volume-changed",pd.AD_MUTED="ad-muted",pd.AD_PAUSED="ad-paused",pd.AD_RESUMED="ad-resumed",pd.AD_SKIP_STATE_CHANGED="ad-skip-state-changed",pd.CUEPOINTS_CHANGED="ad-cue-points-changed",pd.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded",pd.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded",pd.AD_CLICKED="ad-clicked",pd.AD_PROGRESS="ad-progress",pd.AD_BUFFERING="ad-buffering",pd.AD_IMPRESSION="ad-impression",pd.AD_DURATION_CHANGED="ad-duration-changed",pd.AD_CLOSED="ad-closed",pd.AD_LOADED="ad-loaded",pd.ALL_ADS_COMPLETED="all-ads-completed",pd.AD_LINEAR_CHANGED="ad-linear-changed",pd.AD_METADATA="ad-metadata",pd.AD_RECOVERABLE_ERROR="ad-recoverable-error",pd.AD_ERROR="ad-error",pd.AD_BREAK_READY="ad-break-ready",pd.AD_INTERACTION="ad-interaction",pd.AD_CONTENT_PAUSE_REQUESTED="ad-content-pause-requested",pd.AD_CONTENT_RESUME_REQUESTED="ad-content-resume-requested",pd.AD_CONTENT_ATTACH_REQUESTED="ad-content-attach-requested",md.prototype.configure=function(e){this.o=e},md.prototype.stop=function(){this.g&&this.g.stop(),this.s&&Mo(this.s)},md.prototype.release=function(){this.stop(),this.A&&this.A.disconnect(),this.h&&this.h.release(),this.g&&this.g.destroy(),this.m.destroy(),this.C.destroy()},(i=Td.prototype).needsSkipUI=function(){return!0},i.isClientRendering=function(){return!0},i.isUsingAnotherMediaElement=function(){return this.m},i.getDuration=function(){var e=this.g.duration;return isNaN(e)?-1:e},i.getMinSuggestedDuration=function(){return this.getDuration()},i.getRemainingTime=function(){var e=this.g.duration;return isNaN(e)?-1:e-this.g.currentTime},i.isPaused=function(){return this.g.paused},i.isSkippable=function(){return this.h&&null!=this.j?this.getDuration()-this.getRemainingTime()<this.i+this.j:this.h},i.getTimeUntilSkippable=function(){if(this.isSkippable()){var e=this.getRemainingTime()+this.i-this.getDuration();return Math.max(e,0)}return Math.max(this.getRemainingTime(),0)},i.canSkipNow=function(){return this.h&&0==this.getTimeUntilSkippable()},i.skip=function(){this.canSkipNow()&&this.o()},i.pause=function(){return this.g.pause()},i.play=function(){return this.g.play()},i.getVolume=function(){return this.g.volume},i.setVolume=function(e){this.g.volume=e},i.isMuted=function(){return this.g.muted},i.isLinear=function(){return!0},i.resize=function(){},i.setMuted=function(e){this.g.muted=e},i.getSequenceLength=function(){return this.s},i.getPositionInSequence=function(){return this.l},i.getTitle=function(){return""},i.getDescription=function(){return""},i.getVastMediaBitrate=function(){return 0},i.getVastMediaHeight=function(){return 0},i.getVastMediaWidth=function(){return 0},i.getAdId=function(){return""},i.getCreativeAdId=function(){return""},i.getAdvertiserName=function(){return""},i.getMediaUrl=function(){return null},i.getTimeOffset=function(){return 0},i.getPodIndex=function(){return 0},i.release=function(){this.g=null},F("shaka.ads.InterstitialAd",Td),Td.prototype.release=Td.prototype.release,Td.prototype.getPodIndex=Td.prototype.getPodIndex,Td.prototype.getTimeOffset=Td.prototype.getTimeOffset,Td.prototype.getMediaUrl=Td.prototype.getMediaUrl,Td.prototype.getAdvertiserName=Td.prototype.getAdvertiserName,Td.prototype.getCreativeAdId=Td.prototype.getCreativeAdId,Td.prototype.getAdId=Td.prototype.getAdId,Td.prototype.getVastMediaWidth=Td.prototype.getVastMediaWidth,Td.prototype.getVastMediaHeight=Td.prototype.getVastMediaHeight,Td.prototype.getVastMediaBitrate=Td.prototype.getVastMediaBitrate,Td.prototype.getDescription=Td.prototype.getDescription,Td.prototype.getTitle=Td.prototype.getTitle,Td.prototype.getPositionInSequence=Td.prototype.getPositionInSequence,Td.prototype.getSequenceLength=Td.prototype.getSequenceLength,Td.prototype.setMuted=Td.prototype.setMuted,Td.prototype.resize=Td.prototype.resize,Td.prototype.isLinear=Td.prototype.isLinear,Td.prototype.isMuted=Td.prototype.isMuted,Td.prototype.setVolume=Td.prototype.setVolume,Td.prototype.getVolume=Td.prototype.getVolume,Td.prototype.play=Td.prototype.play,Td.prototype.pause=Td.prototype.pause,Td.prototype.skip=Td.prototype.skip,Td.prototype.canSkipNow=Td.prototype.canSkipNow,Td.prototype.getTimeUntilSkippable=Td.prototype.getTimeUntilSkippable,Td.prototype.isSkippable=Td.prototype.isSkippable,Td.prototype.isPaused=Td.prototype.isPaused,Td.prototype.getRemainingTime=Td.prototype.getRemainingTime,Td.prototype.getMinSuggestedDuration=Td.prototype.getMinSuggestedDuration,Td.prototype.getDuration=Td.prototype.getDuration,Td.prototype.isUsingAnotherMediaElement=Td.prototype.isUsingAnotherMediaElement,Td.prototype.isClientRendering=Td.prototype.isClientRendering,Td.prototype.needsSkipUI=Td.prototype.needsSkipUI,Sd.prototype.configure=function(e){this.M=e,xd(this)},Sd.prototype.stop=function(){this.j&&this.j.Va(),this.I.clear(),this.C.clear(),this.g.Te(),this.A.clear(),this.g.detach(),this.H=!1,this.m=this.l=null},Sd.prototype.release=function(){this.stop(),this.K&&this.K.release(),this.j&&this.j.release(),this.G&&Mo(this.G),this.L&&(this.L.stop(),this.L=null),this.O&&(this.O.stop(),this.O=null),this.g.destroy()},Sd.prototype.addAdUrlInterstitial=function(e){var t,n,i,r,a,o,s,u,d,h=this;return P((function(f){switch(f.g){case 1:return w(f,Cd(h,e,t={type:12}),2);case 2:if(n=f.h,!(i=Ct(n,"VAST,vmap:VMAP")))throw new De(2,10,10007);if(r=[],"VAST"==i.tagName){r=gd(i,h.l),f.u(3);break}if("vmap:VMAP"!=i.tagName){f.u(3);break}for(var p=[],g=l(Nt(i,"vmap:AdBreak")),m=g.next();!m.done;m=g.next()){var v=m.value,y=v.attributes.timeOffset;y&&(m=null,m="start"==y?0:"end"==y?1/0:At(y),(v=_t(v,"vmap:AdSource"))&&(v=_t(v,"vmap:AdTagURI"))&&(v=jt(v))&&p.push({time:m,uri:v}))}a=l(p),o=a.next();case 5:if(o.done){f.u(3);break}return s=o.value,w(f,Cd(h,s.uri,t),8);case 8:if(u=f.h,!(d=Ct(u,"VAST")))throw new De(2,10,10007);r.push.apply(r,c(gd(d,s.time))),o=a.next(),f.u(5);break;case 3:Ad(h,r),T(f)}}))},(i=Dd.prototype).needsSkipUI=function(){return!0},i.isClientRendering=function(){return!1},i.isUsingAnotherMediaElement=function(){return!1},i.getDuration=function(){return this.h.durationInSeconds},i.getMinSuggestedDuration=function(){return this.getDuration()},i.getRemainingTime=function(){return this.h.startTimeInSeconds+this.h.durationInSeconds-this.g.currentTime},i.isPaused=function(){return this.g.paused},i.isSkippable=function(){return"number"==typeof this.j},i.getTimeUntilSkippable=function(){if("number"!=typeof this.j)return this.getRemainingTime();var e=this.getRemainingTime()+this.j-this.getDuration();return Math.max(e,0)},i.canSkipNow=function(){return 0==this.getTimeUntilSkippable()},i.skip=function(){this.m=!0,this.g.currentTime+=this.getRemainingTime()},i.pause=function(){return this.g.pause()},i.play=function(){return this.g.play()},i.getVolume=function(){return this.g.volume},i.setVolume=function(e){this.g.volume=e},i.isMuted=function(){return this.g.muted},i.isLinear=function(){return this.o},i.resize=function(){},i.setMuted=function(e){this.g.muted=e},i.getSequenceLength=function(){return this.l?this.l:1},i.getPositionInSequence=function(){return this.i?this.i:1},i.getTitle=function(){return this.h.adTitle},i.getDescription=function(){return""},i.getVastMediaBitrate=function(){return 0},i.getVastMediaHeight=function(){return 0},i.getVastMediaWidth=function(){return 0},i.getAdId=function(){return this.h.adId},i.getCreativeAdId=function(){return this.h.creativeId},i.getAdvertiserName=function(){return""},i.getMediaUrl=function(){return null},i.getTimeOffset=function(){return 0},i.getPodIndex=function(){return 0},i.release=function(){this.l=this.i=this.g=this.h=null},F("shaka.ads.MediaTailorAd",Dd),Dd.prototype.release=Dd.prototype.release,Dd.prototype.getPodIndex=Dd.prototype.getPodIndex,Dd.prototype.getTimeOffset=Dd.prototype.getTimeOffset,Dd.prototype.getMediaUrl=Dd.prototype.getMediaUrl,Dd.prototype.getAdvertiserName=Dd.prototype.getAdvertiserName,Dd.prototype.getCreativeAdId=Dd.prototype.getCreativeAdId,Dd.prototype.getAdId=Dd.prototype.getAdId,Dd.prototype.getVastMediaWidth=Dd.prototype.getVastMediaWidth,Dd.prototype.getVastMediaHeight=Dd.prototype.getVastMediaHeight,Dd.prototype.getVastMediaBitrate=Dd.prototype.getVastMediaBitrate,Dd.prototype.getDescription=Dd.prototype.getDescription,Dd.prototype.getTitle=Dd.prototype.getTitle,Dd.prototype.getPositionInSequence=Dd.prototype.getPositionInSequence,Dd.prototype.getSequenceLength=Dd.prototype.getSequenceLength,Dd.prototype.setMuted=Dd.prototype.setMuted,Dd.prototype.resize=Dd.prototype.resize,Dd.prototype.isLinear=Dd.prototype.isLinear,Dd.prototype.isMuted=Dd.prototype.isMuted,Dd.prototype.setVolume=Dd.prototype.setVolume,Dd.prototype.getVolume=Dd.prototype.getVolume,Dd.prototype.play=Dd.prototype.play,Dd.prototype.pause=Dd.prototype.pause,Dd.prototype.skip=Dd.prototype.skip,Dd.prototype.canSkipNow=Dd.prototype.canSkipNow,Dd.prototype.getTimeUntilSkippable=Dd.prototype.getTimeUntilSkippable,Dd.prototype.isSkippable=Dd.prototype.isSkippable,Dd.prototype.isPaused=Dd.prototype.isPaused,Dd.prototype.getRemainingTime=Dd.prototype.getRemainingTime,Dd.prototype.getMinSuggestedDuration=Dd.prototype.getMinSuggestedDuration,Dd.prototype.getDuration=Dd.prototype.getDuration,Dd.prototype.isUsingAnotherMediaElement=Dd.prototype.isUsingAnotherMediaElement,Dd.prototype.isClientRendering=Dd.prototype.isClientRendering,Dd.prototype.needsSkipUI=Dd.prototype.needsSkipUI,Rd.prototype.stop=function(){for(var e=l(this.m),t=e.next();!t.done;t=e.next())t=t.value,this.o.cb(t.target,t.type,t.listener);Od(this),this.m=[],this.s=[],this.G="",this.O=!0,this.H="",this.A=null,this.j=[],this.M=[],this.F.clear()},Rd.prototype.release=function(){this.stop(),this.o&&this.o.release()},Rd.prototype.onManifestUpdated=function(e){this.I=e,""!=this.G&&(function(e,t,n){var i,r,a,o,s,u,c,d,h,f,p,g,m,v,y,b;P((function(x){if(1==x.g)return i={type:8},r=aa([t],{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4}),a=e.K.request(7,r,i),S(x,2),w(x,a.promise,4);if(2!=x.g){if(o=x.h,s=[],u=dt(o.data),0<(c=JSON.parse(u)).avails.length){if(JSON.stringify(e.j)!=JSON.stringify(c.avails)){for(e.j=c.avails,d=l(e.j),h=d.next();!h.done;h=d.next())for(f=h.value,p=l(f.nonLinearAdsList),g=p.next();!g.done;g=p.next())for(m=g.value,v=l(m.nonLinearAdList),y=v.next();!y.done;y=v.next())b=y.value,Pd(e,b);s=e.getCuePoints(),e.i(new Jr("ad-cue-points-changed",(new Map).set("cuepoints",s)))}}else e.j.length&&e.i(new Jr("ad-cue-points-changed",(new Map).set("cuepoints",s))),Od(e),e.j=[];return n&&(e.I||0<s.length)&&function(e){jd(e),e.I||(Nd(e),e.o.D(e.h,"seeked",(function(){Nd(e)})),e.o.D(e.h,"ended",(function(){Od(e)}))),e.o.D(e.h,"timeupdate",(function(){jd(e)}))}(e),A(x,0)}E(x),T(x)}))}(this,this.G,this.O),this.O=!1)},Rd.prototype.getCuePoints=function(){for(var e=[],t=l(this.j),n=t.next();!n.done;n=t.next())for(var i=(n=l(n.value.ads)).next();!i.done;i=n.next())i=i.value,e.push({start:i.startTimeInSeconds,end:i.startTimeInSeconds+i.durationInSeconds});return e},(i=Bd.prototype).needsSkipUI=function(){return!0},i.isClientRendering=function(){return!1},i.isUsingAnotherMediaElement=function(){return!1},i.getDuration=function(){return this.i?this.i.duration:-1},i.getMinSuggestedDuration=function(){return this.getDuration()},i.getRemainingTime=function(){return this.i?this.i.duration-this.i.currentTime:-1},i.isPaused=function(){return this.h.paused},i.isSkippable=function(){return this.g.isSkippable()},i.getTimeUntilSkippable=function(){var e=this.g.getSkipTimeOffset();return e=this.getRemainingTime()-e,Math.max(e,0)},i.canSkipNow=function(){return 0==this.getTimeUntilSkippable()},i.skip=function(){this.h.currentTime+=this.getRemainingTime()},i.pause=function(){return this.h.pause()},i.play=function(){return this.h.play()},i.getVolume=function(){return this.h.volume},i.setVolume=function(e){this.h.volume=e},i.isMuted=function(){return this.h.muted},i.isLinear=function(){return!0},i.resize=function(){},i.setMuted=function(e){this.h.muted=e},i.getSequenceLength=function(){var e=this.g.getAdPodInfo();return null==e?1:e.getTotalAds()},i.getPositionInSequence=function(){var e=this.g.getAdPodInfo();return null==e?1:e.getAdPosition()},i.getTitle=function(){return this.g.getTitle()},i.getDescription=function(){return this.g.getDescription()},i.getVastMediaBitrate=function(){return 0},i.getVastMediaHeight=function(){return this.g.getVastMediaHeight()},i.getVastMediaWidth=function(){return this.g.getVastMediaWidth()},i.getAdId=function(){return this.g.getAdId()},i.getCreativeAdId=function(){return this.g.getCreativeAdId()},i.getAdvertiserName=function(){return this.g.getAdvertiserName()},i.getMediaUrl=function(){return null},i.getTimeOffset=function(){var e=this.g.getAdPodInfo();return null==e?0:e.getTimeOffset()},i.getPodIndex=function(){var e=this.g.getAdPodInfo();return null==e?0:e.getPodIndex()},i.release=function(){this.h=this.i=this.g=null},F("shaka.ads.ServerSideAd",Bd),Bd.prototype.release=Bd.prototype.release,Bd.prototype.getPodIndex=Bd.prototype.getPodIndex,Bd.prototype.getTimeOffset=Bd.prototype.getTimeOffset,Bd.prototype.getMediaUrl=Bd.prototype.getMediaUrl,Bd.prototype.getAdvertiserName=Bd.prototype.getAdvertiserName,Bd.prototype.getCreativeAdId=Bd.prototype.getCreativeAdId,Bd.prototype.getAdId=Bd.prototype.getAdId,Bd.prototype.getVastMediaWidth=Bd.prototype.getVastMediaWidth,Bd.prototype.getVastMediaHeight=Bd.prototype.getVastMediaHeight,Bd.prototype.getVastMediaBitrate=Bd.prototype.getVastMediaBitrate,Bd.prototype.getDescription=Bd.prototype.getDescription,Bd.prototype.getTitle=Bd.prototype.getTitle,Bd.prototype.getPositionInSequence=Bd.prototype.getPositionInSequence,Bd.prototype.getSequenceLength=Bd.prototype.getSequenceLength,Bd.prototype.setMuted=Bd.prototype.setMuted,Bd.prototype.resize=Bd.prototype.resize,Bd.prototype.isLinear=Bd.prototype.isLinear,Bd.prototype.isMuted=Bd.prototype.isMuted,Bd.prototype.setVolume=Bd.prototype.setVolume,Bd.prototype.getVolume=Bd.prototype.getVolume,Bd.prototype.play=Bd.prototype.play,Bd.prototype.pause=Bd.prototype.pause,Bd.prototype.skip=Bd.prototype.skip,Bd.prototype.canSkipNow=Bd.prototype.canSkipNow,Bd.prototype.getTimeUntilSkippable=Bd.prototype.getTimeUntilSkippable,Bd.prototype.isSkippable=Bd.prototype.isSkippable,Bd.prototype.isPaused=Bd.prototype.isPaused,Bd.prototype.getRemainingTime=Bd.prototype.getRemainingTime,Bd.prototype.getMinSuggestedDuration=Bd.prototype.getMinSuggestedDuration,Bd.prototype.getDuration=Bd.prototype.getDuration,Bd.prototype.isUsingAnotherMediaElement=Bd.prototype.isUsingAnotherMediaElement,Bd.prototype.isClientRendering=Bd.prototype.isClientRendering,Bd.prototype.needsSkipUI=Bd.prototype.needsSkipUI,(i=Fd.prototype).configure=function(){},i.stop=function(){this.B="",this.o=null,this.C=[]},i.release=function(){this.stop(),this.h&&this.h.release()},i.onCueMetadataChange=function(e){if(e.key&&e.data){var t={};t[e.key]=e.data,this.g.onTimedMetadata(t)}},i.getCuePoints=function(){return this.C},m(Vd,Zr),(i=Vd.prototype).setLocale=function(e){this.o=e},i.configure=function(e){this.l=e,this.h&&this.h.configure(this.l),this.j&&this.j.configure(this.l),this.g&&this.g.configure(this.l)},i.initInterstitial=function(e,t,n){var i=this;this.h&&this.h.release(),this.h=new Sd(e,t,n,(function(e){return Hd(i,e)})),this.h.configure(this.l)},i.initClientSide=function(t,n,i){var r=this;if(!e.google||!google.ima||!google.ima.AdsLoader)throw new De(2,10,1e4);this.j&&this.j.release(),this.j=new md(t,n,this.o,i,(function(e){return Hd(r,e)})),this.j.configure(this.l)},i.release=function(){this.h&&(this.h.release(),this.h=null),this.j&&(this.j.release(),this.j=null),this.i&&(this.i.release(),this.i=null),this.g&&(this.g.release(),this.g=null),Zr.prototype.release.call(this)},i.onAssetUnload=function(){this.h&&this.h.stop(),this.j&&this.j.stop(),this.i&&this.i.stop(),this.g&&this.g.stop(),this.dispatchEvent(new Jr("ad-stopped")),this.dispatchEvent(new Jr("ad-content-attach-requested")),this.m=new dd},i.requestClientSideAds=function(e){if(!this.j)throw new De(1,10,10001);var t=this.j;t.g&&t.g.destroy(),t.m&&t.m.contentComplete(),t.G=Date.now()/1e3,t.m.requestAds(e)},i.updateClientSideAdsRenderingSettings=function(e){if(!this.j)throw new De(1,10,10001);var t=this.j;t.B=e,t.g&&t.g.updateAdsRenderingSettings(t.B)},i.initMediaTailor=function(e,t,n){var i=this;this.i&&this.i.release(),this.i=new Rd(e,t,n,(function(e){return Hd(i,e)}))},i.requestMediaTailorStream=function(e,t,n){if(!this.i)throw new De(1,10,10005);var i=this.i;return n=void 0===n?"":n,i.l?e=Promise.reject(new De(1,10,10004)):(i.l=new Gr,function(e,t,n){var i,r,a,o,s,u,l,c,d,h,f,p;P((function(g){if(1==g.g)return i={type:7},(r=aa([t],{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4})).method="POST",n&&(a=JSON.stringify(n),r.body=pt(a)),o=e.K.request(7,r,i),S(g,2),w(g,o.promise,4);if(2!=g.g){if(s=g.h,u=dt(s.data),!(l=JSON.parse(u)).manifestUrl||!l.trackingUrl)throw Error("Insufficient data from MediaTailor.");return c=new Gn(t),d=new Gn(l.trackingUrl),e.G=c.resolve(d).toString(),h=Date.now()/1e3,f=h-e.S,e.i(new Jr("ads-loaded",(new Map).set("loadTime",f))),p=new Gn(l.manifestUrl),e.l.resolve(c.resolve(p).toString()),e.l=null,A(g,0)}if(E(g),!e.H.length)return e.l.reject("MediaTailor request returned an error and there was no backup asset uri provided."),e.l=null,g.return();e.l.resolve(e.H),e.l=null,T(g)}))}(i,e,t),i.H=n||"",i.S=Date.now()/1e3,e=i.l),e},i.addMediaTailorTrackingUrl=function(e){if(!this.i)throw new De(1,10,10005);var t=this.i;t.G=e,t.i(new Jr("ads-loaded",(new Map).set("loadTime",0)))},i.initServerSide=function(t,n){var i=this;if(!e.google||!google.ima||!google.ima.dai)throw new De(2,10,10002);this.g&&this.g.release(),this.g=new Fd(t,n,this.o,(function(e){return Hd(i,e)})),this.g.configure(this.l)},i.requestServerSideStream=function(e,t){if(t=void 0===t?"":t,!this.g)throw new De(1,10,10003);e.adTagParameters||(e.adTagParameters={});var n=e.adTagParameters;return(n.mpt||n.mpv)&&W('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overriden.'),e.adTagParameters.mpt="shaka-player",e.adTagParameters.mpv="v4.12.5",(n=this.g).j?e=Promise.reject(new De(1,10,10004)):(e instanceof google.ima.dai.api.LiveStreamRequest&&(n.G=!0),n.j=new Gr,n.g.requestStream(e),n.B=t||"",n.F=Date.now()/1e3,e=n.j),e},i.replaceServerSideAdTagParameters=function(e){if(!this.g)throw new De(1,10,10003);(e.mpt||e.mpv)&&W('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overriden.'),e.mpt="Shaka Player",e.mpv="v4.12.5",this.g.g.replaceAdTagParameters(e)},i.getServerSideCuePoints=function(){return oe("AdManager.getServerSideCuePoints","Please use getCuePoints function."),this.getCuePoints()},i.getCuePoints=function(){var e=[];return this.g&&(e=e.concat(this.g.getCuePoints())),this.i&&(e=e.concat(this.i.getCuePoints())),e},i.getStats=function(){var e=this.m;return{loadTimes:e.g,averageLoadTime:hd(e),started:e.h,playedCompletely:e.j,skipped:e.l,errors:e.i}},i.onManifestUpdated=function(e){this.i&&this.i.onManifestUpdated(e)},i.onDashTimedMetadata=function(e){this.g&&"urn:google:dai:2018"==e.schemeIdUri&&this.g.g.processMetadata(e.schemeIdUri,e.eventNode?e.eventNode.attributes.messageData:null,e.startTime)},i.onHlsTimedMetadata=function(e,t){this.g&&this.g.g.processMetadata("ID3",e.data,t)},i.onCueMetadataChange=function(e){this.g&&this.g.onCueMetadataChange(e)},i.onHLSInterstitialMetadata=function(e,t,n){this.l&&this.l.disableHLSInterstitial||(this.h||this.initInterstitial(null,e,t),this.h&&function(e,t){var n;P((function(i){if(1==i.g)return Md(e),w(i,function(e,t){var n,i,r,a,o,s,u,l,c,d,h,f,p,g,m,v,y,b,T,x,k,I,M,C,D,R,L,N,j,O,U,_,B,F,V,H,G,K,X,q,z;return P((function(P){switch(P.g){case 1:if(n=[],!t)return P.return(n);if(i=t.values.find((function(e){return"X-ASSET-URI"==e.key})),r=t.values.find((function(e){return"X-ASSET-LIST"==e.key})),!i&&!r)return P.return(n);if(a=null,(o=t.values.find((function(e){return"ID"==e.key})))&&(a=o.data),s=null==a?Math.floor(10*t.startTime)/10:t.startTime,(u=t.endTime)&&1/0!=t.endTime&&"number"==typeof t.endTime&&(u=null==a?Math.floor(10*t.endTime)/10:t.endTime),l=t.values.find((function(e){return"X-RESTRICT"==e.key})),d=c=!0,l&&l.data&&(h=l.data,c=!h.includes("SKIP"),d=!h.includes("JUMP")),f=c?0:null,(p=t.values.find((function(e){return"X-ENABLE-SKIP-AFTER"==e.key})))&&(g=p.data,f=parseFloat(g),isNaN(f)&&(f=c?0:null)),m=null,(v=t.values.find((function(e){return"X-ENABLE-SKIP-FOR"==e.key})))&&(y=v.data,m=parseFloat(y),isNaN(f)&&(m=null)),b=null,(T=t.values.find((function(e){return"X-RESUME-OFFSET"==e.key})))&&(x=T.data,b=parseFloat(x),isNaN(b)&&(b=null)),k=null,(I=t.values.find((function(e){return"X-PLAYOUT-LIMIT"==e.key})))&&(M=I.data,k=parseFloat(M),isNaN(k)&&(k=null)),R=D=C=!1,(L=t.values.find((function(e){return"CUE"==e.key})))&&(N=L.data,C=N.includes("ONCE"),D=N.includes("PRE"),R=N.includes("POST")),j=!1,(O=t.values.find((function(e){return"X-TIMELINE-OCCUPIES"==e.key})))?(U=O.data,j=U.includes("RANGE")):!T&&e.B.U()&&(j=!D&&!R),i){if(!(_=i.data))return P.return(n);n.push({id:a,startTime:s,endTime:u,uri:_,mimeType:null,isSkippable:c,skipOffset:f,skipFor:m,canJump:d,resumeOffset:b,playoutLimit:k,once:C,pre:D,post:R,timelineRange:j}),P.u(2);break}if(!r){P.u(2);break}return(B=r.data)?(S(P,4),w(P,Cd(e,B,{type:11}),6)):P.return(n);case 6:for(F=P.h,V=dt(F),H=JSON.parse(V),(G=H["SKIP-CONTROL"])&&("number"==typeof(K=G["ENABLE-SKIP-AFTER"])&&(f=parseFloat(K),isNaN(K)&&(f=c?0:null)),"number"==typeof(X=G["ENABLE-SKIP-FOR"])&&(m=parseFloat(X),isNaN(X)&&(m=null))),q=0;q<H.ASSETS.length;q++)(z=H.ASSETS[q]).URI&&n.push({id:a+"_asset_"+q,startTime:s,endTime:u,uri:z.URI,mimeType:null,isSkippable:c,skipOffset:f,skipFor:m,canJump:d,resumeOffset:b,playoutLimit:k,once:C,pre:D,post:R,timelineRange:j});A(P,2);break;case 4:E(P);case 2:return P.return(n)}}))}(e,t),2);(n=i.h).length?Ad(e,n):W("Unsupported HLS interstitial",t),T(i)}))}(this.h,n))},i.onDASHInterstitialMetadata=function(e,t,n){if(!(this.l&&this.l.disableDASHInterstitial||"urn:mpeg:dash:event:alternativeMPD:2022"!=n.schemeIdUri)&&(this.h||this.initInterstitial(null,e,t),this.h)){e=this.h;for(var i=(t=l(n.eventNode.children)).next();!i.done;i=t.next()){var r=i.value;if("AlternativeMPD"==r.tagName&&(i=r.attributes.uri,r=r.attributes.mode,i)){var a=i,o=r;break}}a?(t="replace"==o,o="insert"==o,(t||o)&&Ad(e,[{id:n.id,startTime:n.startTime,endTime:n.endTime,uri:a,mimeType:null,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!0,resumeOffset:o?0:null,playoutLimit:null,once:!1,pre:!1,post:!1,timelineRange:t&&!o}])):W("Unsupported MPD alternate",n)}},i.addCustomInterstitial=function(e){if(!this.h)throw new De(1,10,10006);Ad(this.h,[e])},i.addAdUrlInterstitial=function(e){if(!this.h)throw new De(1,10,10006);return this.h.addAdUrlInterstitial(e)},F("shaka.ads.AdManager",Vd),Vd.prototype.addAdUrlInterstitial=Vd.prototype.addAdUrlInterstitial,Vd.prototype.addCustomInterstitial=Vd.prototype.addCustomInterstitial,Vd.prototype.onDASHInterstitialMetadata=Vd.prototype.onDASHInterstitialMetadata,Vd.prototype.onHLSInterstitialMetadata=Vd.prototype.onHLSInterstitialMetadata,Vd.prototype.onCueMetadataChange=Vd.prototype.onCueMetadataChange,Vd.prototype.onHlsTimedMetadata=Vd.prototype.onHlsTimedMetadata,Vd.prototype.onDashTimedMetadata=Vd.prototype.onDashTimedMetadata,Vd.prototype.onManifestUpdated=Vd.prototype.onManifestUpdated,Vd.prototype.getStats=Vd.prototype.getStats,Vd.prototype.getCuePoints=Vd.prototype.getCuePoints,Vd.prototype.getServerSideCuePoints=Vd.prototype.getServerSideCuePoints,Vd.prototype.replaceServerSideAdTagParameters=Vd.prototype.replaceServerSideAdTagParameters,Vd.prototype.requestServerSideStream=Vd.prototype.requestServerSideStream,Vd.prototype.initServerSide=Vd.prototype.initServerSide,Vd.prototype.addMediaTailorTrackingUrl=Vd.prototype.addMediaTailorTrackingUrl,Vd.prototype.requestMediaTailorStream=Vd.prototype.requestMediaTailorStream,Vd.prototype.initMediaTailor=Vd.prototype.initMediaTailor,Vd.prototype.updateClientSideAdsRenderingSettings=Vd.prototype.updateClientSideAdsRenderingSettings,Vd.prototype.requestClientSideAds=Vd.prototype.requestClientSideAds,Vd.prototype.onAssetUnload=Vd.prototype.onAssetUnload,Vd.prototype.release=Vd.prototype.release,Vd.prototype.initClientSide=Vd.prototype.initClientSide,Vd.prototype.initInterstitial=Vd.prototype.initInterstitial,Vd.prototype.configure=Vd.prototype.configure,Vd.prototype.setLocale=Vd.prototype.setLocale,Vd.ADS_LOADED="ads-loaded",Vd.AD_STARTED="ad-started",Vd.AD_FIRST_QUARTILE="ad-first-quartile",Vd.AD_MIDPOINT="ad-midpoint",Vd.AD_THIRD_QUARTILE="ad-third-quartile",Vd.AD_COMPLETE="ad-complete",Vd.AD_STOPPED="ad-stopped",Vd.AD_SKIPPED="ad-skipped",Vd.AD_VOLUME_CHANGED="ad-volume-changed",Vd.AD_MUTED="ad-muted",Vd.AD_PAUSED="ad-paused",Vd.AD_RESUMED="ad-resumed",Vd.AD_SKIP_STATE_CHANGED="ad-skip-state-changed",Vd.CUEPOINTS_CHANGED="ad-cue-points-changed",Vd.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded",Vd.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded",Vd.AD_CLICKED="ad-clicked",Vd.AD_PROGRESS="ad-progress",Vd.AD_BUFFERING="ad-buffering",Vd.AD_IMPRESSION="ad-impression",Vd.AD_DURATION_CHANGED="ad-duration-changed",Vd.AD_CLOSED="ad-closed",Vd.AD_LOADED="ad-loaded",Vd.ALL_ADS_COMPLETED="all-ads-completed",Vd.AD_LINEAR_CHANGED="ad-linear-changed",Vd.AD_METADATA="ad-metadata",Vd.AD_RECOVERABLE_ERROR="ad-recoverable-error",Vd.AD_ERROR="ad-error",Vd.AD_BREAK_READY="ad-break-ready",Vd.AD_INTERACTION="ad-interaction",Vd.AD_CONTENT_PAUSE_REQUESTED="ad-content-pause-requested",Vd.AD_CONTENT_RESUME_REQUESTED="ad-content-resume-requested",Vd.AD_CONTENT_ATTACH_REQUESTED="ad-content-attach-requested",cd=function(){return new Vd};var Xd="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),qd="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),zd=["loop","playbackRate"],Wd=["pause","play"],Yd={getAssetUri:2,getAudioLanguages:4,getAudioLanguagesAndRoles:4,getBufferFullness:1,getBufferedInfo:2,getExpiration:2,getKeyStatuses:2,getPlaybackRate:2,getTextLanguages:4,getTextLanguagesAndRoles:4,getImageTracks:2,getThumbnails:2,isAudioOnly:10,isBuffering:1,isInProgress:1,isLive:10,isTextTrackVisible:1,keySystem:10,seekRange:1,getLoadMode:10,getManifestType:10,isFullyLoaded:1},Jd={getConfiguration:4,getStats:5,getTextTracks:2,getVariantTracks:2},$d={getPlayheadTimeAsDate:1,getPresentationStartTimeAsDate:20,getSegmentAvailabilityDuration:20},Qd=[["getConfiguration","configure"]],Zd=[["isTextTrackVisible","setTextTrackVisibility"]],eh="addChaptersTrack addTextTrackAsync addThumbnailsTrack cancelTrickPlay configure getChapters getChaptersTracks resetConfiguration retryStreaming selectAudioLanguage selectTextLanguage selectTextTrack selectVariantTrack selectVariantsByLabel setTextTrackVisibility trickPlay updateStartTime goToLive".split(" "),th=["attach","attachCanvas","detach","load","unload"];function nh(e,t,n,i,r,a,o){var s=this;this.G=e,this.K=o,this.l=new Be(t),this.L=n,this.s=!1,this.A=i,this.F=r,this.M=a,this.h=this.m=!1,this.I="",this.o=null,this.B=function(){return oh(s)},this.C=function(e,t){switch((e=Kd(t)).type){case"event":var n=e.targetName,i=$r(e.event);s.A(n,i);break;case"update":for(i in n=e.update)for(var r in e=s.g[i]||{},n[i])e[r]=n[i][r];s.s&&(s.L(),s.s=!1);break;case"asyncComplete":if(i=e.id,r=e.error,e=s.i[i],delete s.i[i],e)if(r){for(n in i=new De(r.severity,r.category,r.code),r)i[n]=r[n];e.reject(i)}else e.resolve()}},this.g={video:{},player:{}},this.H=0,this.i={},this.j=null,fh.add(this)}function ih(e,t){var n=e.M();dh=t,t.addUpdateListener(e.B),t.addMessageListener("urn:x-cast:com.google.shaka.v2",e.C),oh(e),uh(e,{type:"init",initState:n,appData:e.o}),e.j.resolve()}function rh(e,t){var n=8003;switch(t.code){case"cancel":n=8004;break;case"timeout":n=8005;break;case"receiver_unavailable":n=8006}e.j.reject(new De(2,8,n,t))}function ah(e){var t=dh;t.removeUpdateListener(e.B),t.removeMessageListener("urn:x-cast:com.google.shaka.v2",e.C)}function oh(e){var t=!!dh&&"connected"==dh.status;if(e.h&&!t){for(var n in e.F(),e.g)e.g[n]={};sh(e)}e.h=t,e.I=t?dh.receiver.friendlyName:"",e.l.hc()}function sh(e){for(var t in e.i){var n=e.i[t];delete e.i[t],n.reject(new De(1,7,7e3))}}function uh(e,t){t=Gd(t);var n=dh;try{n.sendMessage("urn:x-cast:com.google.shaka.v2",t,(function(){}),J)}catch(i){throw t=new De(2,8,8005,i),n=new Jr("error",(new Map).set("detail",t)),e.A("player",n),e.Lc(),t}}(i=nh.prototype).destroy=function(){return fh.delete(this),sh(this),dh&&ah(this),this.l&&(this.l.stop(),this.l=null),this.F=this.A=null,this.h=this.m=!1,this.C=this.B=this.j=this.i=this.g=this.o=null,Promise.resolve()},i.jb=function(){return this.h},i.Jf=function(){return this.I},i.init=function(){if(this.G.length)if(e.chrome&&chrome.cast&&chrome.cast.isAvailable){this.m=!0,this.l.hc();var t=new chrome.cast.SessionRequest(this.G,[],null,this.K,null);t=new chrome.cast.ApiConfig(t,(function(e){for(var t=l(fh),n=t.next();!n.done;n=t.next()){var i=e;(n=n.value).j=new Gr,n.s=!0,ih(n,i)}}),(function(e){for(var t=l(fh),n=t.next();!n.done;n=t.next())n=n.value,ch="available"==e,n.l.hc()}),"origin_scoped"),chrome.cast.initialize(t,(function(){}),(function(){})),ch&&this.l.$(lh),(t=dh)&&t.status!=chrome.cast.SessionStatus.STOPPED?(this.j=new Gr,this.s=!0,ih(this,t)):dh=null}else e.__onGCastApiAvailable!==ph&&(hh=e.__onGCastApiAvailable||null,e.__onGCastApiAvailable=ph)},i.Rf=function(e){this.o=e,this.h&&uh(this,{type:"appData",appData:this.o})},i.cast=function(){var e=this;return P((function(t){if(!e.m)throw new De(1,8,8e3);if(!ch)throw new De(1,8,8001);if(e.h)throw new De(1,8,8002);return e.j=new Gr,chrome.cast.requestSession((function(t){return ih(e,t)}),(function(t){return rh(e,t)})),w(t,e.j,0)}))},i.Lc=function(){if(this.h){if(sh(this),dh){ah(this);try{dh.stop((function(){}),(function(){}))}catch(e){}dh=null}oh(this)}},i.get=function(e,t){var n=this;if("video"==e){if(Wd.includes(t))return function(){return n.Xg.apply(n,[e,t].concat(c(L.apply(0,arguments))))}}else if("player"==e){if($d[t]&&!this.get("player","isLive")())return function(){};if(eh.includes(t))return function(){return n.Xg.apply(n,[e,t].concat(c(L.apply(0,arguments))))};if(th.includes(t))return function(){return n.Oi.apply(n,[e,t].concat(c(L.apply(0,arguments))))};if(Yd[t]||Jd[t])return function(){return n.g[e][t]}}return this.g[e][t]},i.set=function(e,t,n){this.g[e][t]=n,uh(this,{type:"set",targetName:e,property:t,value:n})},i.Xg=function(e,t){uh(this,{type:"call",targetName:e,methodName:t,args:L.apply(2,arguments)})},i.Oi=function(e,t){var n=L.apply(2,arguments),i=new Gr,r=this.H.toString();this.H++,this.i[r]=i;try{uh(this,{type:"asyncCall",targetName:e,methodName:t,args:n,id:r})}catch(e){i.reject(e)}return i};var lh=.02,ch=!1,dh=null,hh=null,fh=new Set;function ph(t){if(hh?e.__onGCastApiAvailable=hh:delete e.__onGCastApiAvailable,hh=null,t)for(var n=l(fh),i=n.next();!i.done;i=n.next())i.value.init();"function"==typeof e.__onGCastApiAvailable&&e.__onGCastApiAvailable(t)}function gh(e,t,n,i){i=void 0!==i&&i,Zr.call(this);var r=this;this.i=e,this.h=t,this.m=this.o=this.j=this.s=this.l=null,this.C=n,this.B=i,this.A=new Map,this.g=new nh(n,(function(){return yh(r)}),(function(){return bh(r)}),(function(e,t){return Sh(r,e,t)}),(function(){return wh(r)}),(function(){return vh(r)}),i),function(e){e.g.init(),e.m=new Z;for(var t=l(Xd),n=t.next();!n.done;n=t.next())e.m.D(e.i,n.value,(function(t){e.g.jb()||(t=$r(t),e.j.dispatchEvent(t))}));for(var i in Qr)e.m.D(e.h,Qr[i],(function(t){e.g.jb()||e.o.dispatchEvent(t)}));for(var r in e.l={},t={},e.i)(t={pd:t.pd}).pd=r,Object.defineProperty(e.l,t.pd,{configurable:!1,enumerable:!0,get:function(t){return function(){return Th(e,t.pd)}}(t),set:function(t){return function(n){var i=t.pd;e.g.jb()?e.g.set("video",i,n):e.i[i]=n}}(t)});e.s={},mh(e,(function(t){Object.defineProperty(e.s,t,{configurable:!1,enumerable:!0,get:function(){return function(e,t){if(e.A.has(t)&&(t=e.A.get(t)),"addEventListener"==t)return function(t,n,i){return e.o.addEventListener(t,n,i)};if("removeEventListener"==t)return function(t,n,i){return e.o.removeEventListener(t,n,i)};if("getMediaElement"==t)return function(){return e.l};if("getSharedConfiguration"==t)return e.g.get("player","getConfiguration");if("getNetworkingEngine"==t)return function(){return e.h.Ab()};if("getDrmEngine"==t)return function(){return e.h.C};if("getAdManager"==t)return function(){return e.h.xg()};if("setVideoContainer"==t)return function(t){return e.h.kh(t)};if(e.g.jb()){if("getManifest"==t||"drmInfo"==t)return function(){return W(t+"() does not work while casting!"),null};if("attach"==t||"detach"==t)return function(){return W(t+"() does not work while casting!"),Promise.resolve()}}return e.g.jb()&&0==Object.keys(e.g.g.video).length&&(Yd[t]||Jd[t])||!e.g.jb()?e.h[t].bind(e.h):e.g.get("player",t)}(e,t)}})})),function(e){var t=new Map;mh(e,(function(n,i){t.has(i)?(i=t.get(i),n.length<i.length?e.A.set(n,i):e.A.set(i,n)):t.set(i,n)}))}(e),e.j=new Zr,e.j.re=e.l,e.o=new Zr,e.o.re=e.s}(this)}function mh(e,t){function n(e){return"constructor"!=e&&"function"==typeof r[e]&&!a.has(e)}var i,r=e.h,a=new Set;for(i in r)n(i)&&(a.add(i),t(i,r[i]));for(e=Object.getPrototypeOf(r),i=Object.getPrototypeOf({});e&&e!=i;){for(var o=l(Object.getOwnPropertyNames(e)),s=o.next();!s.done;s=o.next())n(s=s.value)&&(a.add(s),t(s,r[s]));e=Object.getPrototypeOf(e)}}function vh(e){var t={video:{},player:{},playerAfterLoad:{},manifest:e.h.Mc(),startTime:null};e.i.pause();for(var n=l(zd),i=n.next();!i.done;i=n.next())i=i.value,t.video[i]=e.i[i];for(e.i.ended||(t.startTime=e.i.currentTime),i=(n=l(Qd)).next();!i.done;i=n.next()){var r=i.value;i=r[1],r=e.h[r[0]](),t.player[i]=r}for(i=(n=l(Zd)).next();!i.done;i=n.next())i=(r=i.value)[1],r=e.h[r[0]](),t.playerAfterLoad[i]=r;return t}function yh(e){var t=new Jr("caststatuschanged");e.dispatchEvent(t)}function bh(e){var t=new Jr(e.l.paused?"pause":"play");e.j.dispatchEvent(t)}function wh(e){for(var t=l(Qd),n=t.next();!n.done;n=t.next()){var i=n.value;n=i[1],i=e.g.get("player",i[0])(),e.h[n](i)}var r=e.g.get("player","getAssetUri")();i=e.g.get("video","ended"),t=Promise.resolve();var a,o=e.i.autoplay;n=null,i||(n=e.g.get("video","currentTime")),(i=e.g.get("player","getTextTracks")())&&i.length&&(a=i.find((function(e){return e.active})));var s=e.g.get("player","isTextTrackVisible")();r&&(e.i.autoplay=!1,t=e.h.load(r,n));var u={};for(i=(n=l(zd)).next();!i.done;i=n.next())i=i.value,u[i]=e.g.get("video",i);t.then((function(){if(e.i){for(var t=l(zd),n=t.next();!n.done;n=t.next())n=n.value,e.i[n]=u[n];for(n=(t=l(Zd)).next();!n.done;n=t.next()){var i=n.value;n=i[1],i=e.g.get("player",i[0])(),e.h[n](i)}e.h.hh(s),a&&e.h.Pf(a.language,a.roles,a.forced),e.i.autoplay=o,r&&e.i.play()}}),(function(t){t=new Jr("error",t=(new Map).set("detail",t)),e.h.dispatchEvent(t)}))}function Th(e,t){if("addEventListener"==t)return function(t,n,i){return e.j.addEventListener(t,n,i)};if("removeEventListener"==t)return function(t,n,i){return e.j.removeEventListener(t,n,i)};if(e.g.jb()&&0==Object.keys(e.g.g.video).length){var n=e.i[t];if("function"!=typeof n)return n}return e.g.jb()?e.g.get("video",t):("function"==typeof(t=e.i[t])&&(t=t.bind(e.i)),t)}function Sh(e,t,n){e.g.jb()&&("video"==t?e.j.dispatchEvent(n):"player"==t&&e.o.dispatchEvent(n))}function xh(e,t,n,i){Zr.call(this);var r=this;this.g=e,this.h=t,this.j=new Z,this.H={video:e,player:t},this.F=n||function(){},this.I=i||function(e){return e},this.i=null,this.G=!1,this.o=!0,this.m=0,this.B=!1,this.A=!0,this.s=this.l=null,this.C=new Be((function(){Ih(r)})),function(e){var t=cast.receiver.CastReceiverManager.getInstance();t.onSenderConnected=function(){return Ah(e)},t.onSenderDisconnected=function(){return Ah(e)},t.onSystemVolumeChanged=function(){var t=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();t&&Rh(e,{type:"update",update:{video:{volume:t.level,muted:t.muted}}},e.l),Rh(e,{type:"event",targetName:"video",event:{type:"volumechange"}},e.l)},e.s=t.getCastMessageBus("urn:x-cast:com.google.cast.media"),e.s.onMessage=function(t){return function(e,t){var n=Kd(t.data);switch(n.type){case"PLAY":e.g.play(),Ph(e);break;case"PAUSE":e.g.pause(),Ph(e);break;case"SEEK":t=n.currentTime;var i=n.resumeState;null!=t&&(e.g.currentTime=Number(t)),i&&"PLAYBACK_START"==i?(e.g.play(),Ph(e)):i&&"PLAYBACK_PAUSE"==i&&(e.g.pause(),Ph(e));break;case"STOP":e.h.ic().then((function(){e.h&&Ph(e)}));break;case"GET_STATUS":Ch(e,Number(n.requestId));break;case"VOLUME":t=(i=n.volume).level,i=i.muted;var r=e.g.volume,a=e.g.muted;null!=t&&(e.g.volume=Number(t)),null!=i&&(e.g.muted=i),r==e.g.volume&&a==e.g.muted||Ph(e);break;case"LOAD":e.m=0,e.B=!1,e.A=!1,t=n.media,i=n.currentTime,r=e.I(t.contentId),a=n.autoplay||!0,e.F(t.customData),a&&(e.g.autoplay=!0),e.h.load(r,i).then((function(){e.h&&Ch(e)})).catch((function(t){var i="LOAD_FAILED";7==t.category&&7e3==t.code&&(i="LOAD_CANCELLED"),Rh(e,{requestId:Number(n.requestId),type:i},e.s)}));break;default:Rh(e,{requestId:Number(n.requestId),type:"INVALID_REQUEST",reason:"INVALID_COMMAND"},e.s)}}(e,t)},e.l=t.getCastMessageBus("urn:x-cast:com.google.shaka.v2"),e.l.onMessage=function(t){return function(e,t){var n=Kd(t.data);switch(n.type){case"init":e.m=0,e.B=!1,e.A=!0,function(e,t,n){var i,r,a,o,s,u,l,c,d,h;P((function(f){switch(f.g){case 1:for(i in t.player)r=t.player[i],e.h[i](r);return e.F(n),a=e.g.autoplay,t.manifest?(e.g.autoplay=!1,S(f,5),w(f,e.h.load(t.manifest,t.startTime),7)):w(f,Promise.resolve(),3);case 7:A(f,3);break;case 5:return o=E(f),s=(new Map).set("detail",o),u=new Jr("error",s),e.h&&e.h.dispatchEvent(u),f.return();case 3:if(!e.h)return f.return();for(l in t.video)c=t.video[l],e.g[l]=c;for(d in t.playerAfterLoad)h=t.playerAfterLoad[d],e.h[d](h);e.g.autoplay=a,t.manifest&&(e.g.play(),Ph(e)),T(f)}}))}(e,n.initState,n.appData),Ih(e);break;case"appData":e.F(n.appData);break;case"set":var i=n.targetName,r=n.property;if(n=n.value,"video"==i){if(t=cast.receiver.CastReceiverManager.getInstance(),"volume"==r){t.setSystemVolumeLevel(n);break}if("muted"==r){t.setSystemVolumeMuted(n);break}}e.H[i][r]=n;break;case"call":(i=e.H[n.targetName])[n.methodName].apply(i,n.args);break;case"asyncCall":i=n.targetName,r=n.methodName,"player"==i&&"load"==r&&(e.m=0,e.B=!1);var a=n.id,o=t.senderId;n=(t=e.H[i])[r].apply(t,n.args),"player"==i&&"load"==r&&(n=n.then((function(){e.A=!0}))),n.then((function(){return Dh(e,o,a,null)}),(function(t){return Dh(e,o,a,t)}))}}(e,t)},t.start();for(var n=(t=l(Xd)).next();!n.done;n=t.next())e.j.D(e.g,n.value,(function(t){return kh(e,"video",t)}));for(var i in Qr)e.j.D(e.h,Qr[i],(function(t){return kh(e,"player",t)}));e.j.D(e.g,"loadeddata",(function(){e.B=!0})),e.j.D(e.h,"loading",(function(){e.o=!1,Eh(e)})),e.j.D(e.g,"playing",(function(){e.o=!1,Eh(e)})),e.j.D(e.g,"pause",(function(){Eh(e)})),e.j.D(e.h,"unloading",(function(){e.o=!0,Eh(e)})),e.j.D(e.g,"ended",(function(){new Be((function(){e.g&&e.g.ended&&(e.o=!0,Eh(e))})).$(Nh)}))}(this)}function Ah(e){e.m=0,e.A=!0,e.G=0!=cast.receiver.CastReceiverManager.getInstance().getSenders().length,Eh(e)}function Eh(e){var t;P((function(n){return 1==n.g?w(n,Promise.resolve(),2):e.h?(t=new Jr("caststatuschanged"),e.dispatchEvent(t),Mh(e)||Ph(e),void T(n)):n.return()}))}function kh(e,t,n){e.h&&(Ih(e),Rh(e,{type:"event",targetName:t,event:n},e.l))}function Ih(e){e.C.$(Lh);for(var t={video:{},player:{}},n=l(qd),i=n.next();!i.done;i=n.next())i=i.value,t.video[i]=e.g[i];if(e.h.U())for(var r in $d)0==e.m%$d[r]&&(t.player[r]=e.h[r]());for(var a in Yd)0==e.m%Yd[a]&&(t.player[a]=e.h[a]());for(var o in(n=cast.receiver.CastReceiverManager.getInstance().getSystemVolume())&&(t.video.volume=n.level,t.video.muted=n.muted),Rh(e,{type:"update",update:t},e.l),Jd)0==e.m%Jd[o]&&((t={player:{}}).player[o]=e.h[o](),Rh(e,{type:"update",update:t},e.l));e.B&&(e.m+=1),Mh(e)}function Mh(e){return!(!e.A||!e.g.duration&&!e.h.U()||(Ch(e),e.A=!1,0))}function Ch(e,t){var n={contentId:e.h.Mc(),streamType:e.h.U()?"LIVE":"BUFFERED",contentType:""};e.h.U()||(n.duration=e.g.duration),e.i&&(n.metadata=e.i),Ph(e,void 0===t?0:t,n)}function Dh(e,t,n,i){e.h&&Rh(e,{type:"asyncComplete",id:n,error:i},e.l,t)}function Rh(e,t,n,i){e.G&&(e=Gd(t),i?n.getCastChannel(i).send(e):n.broadcast(e))}function Ph(e,t,n){n=void 0===n?null:n;var i={mediaSessionId:0,playbackRate:e.g.playbackRate,playerState:e.o?jh:e.h.tf()?Uh:e.g.paused?_h:Oh,currentTime:e.g.currentTime,supportedMediaCommands:63,volume:{level:e.g.volume,muted:e.g.muted}};n&&(i.media=n),Rh(e,{requestId:void 0===t?0:t,type:"MEDIA_STATUS",status:[i]},e.s)}m(gh,Zr),(i=gh.prototype).destroy=function(e){return e&&this.g.Lc(),this.m&&(this.m.release(),this.m=null),e=[],this.h&&(e.push(this.h.destroy()),this.h=null),this.g&&(e.push(this.g.destroy()),this.g=null),this.s=this.l=this.i=null,Zr.prototype.release.call(this),Promise.all(e)},i.ji=function(){return this.l},i.Zh=function(){return this.s},i.Dh=function(){return this.g.m&&ch},i.jb=function(){return this.g.jb()},i.Jf=function(){return this.g.Jf()},i.cast=function(){var e=this;return P((function(t){return 1==t.g?w(t,e.g.cast(),2):e.h?w(t,e.h.ic(),0):t.return()}))},i.Rf=function(e){this.g.Rf(e)},i.dj=function(){var e;(e=this.g).h&&chrome.cast.requestSession((function(t){return ih(e,t)}),(function(t){return rh(e,t)}))},i.Lc=function(){this.g.Lc()},i.Eh=function(e,t){t=void 0!==t&&t;var n=this;return P((function(i){if(1==i.g)return e==n.C&&t==n.B?i.return():(n.C=e,n.B=t,n.g.Lc(),w(i,n.g.destroy(),2));n.g=null,n.g=new nh(e,(function(){return yh(n)}),(function(){return bh(n)}),(function(e,t){return Sh(n,e,t)}),(function(){return wh(n)}),(function(){return vh(n)}),t),n.g.init(),T(i)}))},F("shaka.cast.CastProxy",gh),gh.prototype.changeReceiverId=gh.prototype.Eh,gh.prototype.forceDisconnect=gh.prototype.Lc,gh.prototype.suggestDisconnect=gh.prototype.dj,gh.prototype.setAppData=gh.prototype.Rf,gh.prototype.cast=gh.prototype.cast,gh.prototype.receiverName=gh.prototype.Jf,gh.prototype.isCasting=gh.prototype.jb,gh.prototype.canCast=gh.prototype.Dh,gh.prototype.getPlayer=gh.prototype.Zh,gh.prototype.getVideo=gh.prototype.ji,gh.prototype.destroy=gh.prototype.destroy,m(xh,Zr),(i=xh.prototype).isConnected=function(){return this.G},i.ri=function(){return this.o},i.$i=function(e){this.i=e},i.Gh=function(){this.i=null},i.aj=function(e){this.i||(this.i={metadataType:cast.receiver.media.MetadataType.GENERIC}),this.i.title=e},i.Zi=function(e){this.i||(this.i={metadataType:cast.receiver.media.MetadataType.GENERIC}),this.i.images=[{url:e}]},i.Yi=function(e){this.i||(this.i={}),this.i.artist=e,this.i.metadataType=cast.receiver.media.MetadataType.MUSIC_TRACK},i.destroy=function(){var e,t=this;return P((function(n){if(1==n.g)return t.j&&(t.j.release(),t.j=null),e=[],t.h&&(e.push(t.h.destroy()),t.h=null),t.C&&(t.C.stop(),t.C=null),t.g=null,t.H=null,t.F=null,t.G=!1,t.o=!0,t.l=null,t.s=null,Zr.prototype.release.call(t),w(n,Promise.all(e),2);cast.receiver.CastReceiverManager.getInstance().stop(),T(n)}))},F("shaka.cast.CastReceiver",xh),xh.prototype.destroy=xh.prototype.destroy,xh.prototype.setContentArtist=xh.prototype.Yi,xh.prototype.setContentImage=xh.prototype.Zi,xh.prototype.setContentTitle=xh.prototype.aj,xh.prototype.clearContentMetadata=xh.prototype.Gh,xh.prototype.setContentMetadata=xh.prototype.$i,xh.prototype.isIdle=xh.prototype.ri,xh.prototype.isConnected=xh.prototype.isConnected;var Lh=.5,Nh=5,jh="IDLE",Oh="PLAYING",Uh="BUFFERING",_h="PAUSED";function Bh(e,t,n,i,r){if(i>=r)return null;for(var a=-1,o=-1,s=0;s<n.length;s++)if(n[s].some((function(e){return null!=e&&""!=e.g.trim()}))){a=s;break}for(s=n.length-1;0<=s;s--)if(n[s].some((function(e){return null!=e&&""!=e.g.trim()}))){o=s;break}if(-1===a||-1===o)return null;for(var u=s=!1,l="white",c="black",d=Fh(i,r,s,u,l,c);a<=o;a++){for(var h=n[a],f=-1,p=-1,g=0;g<h.length;g++)if(null!=h[g]&&""!==h[g].g.trim()){f=g;break}for(g=h.length-1;0<=g;g--)if(null!=h[g]&&""!==h[g].g.trim()){p=g;break}if(-1===f||-1===p)h=Vh(i,r),e.nestedCues.push(h);else{for(;f<=p;f++)if(g=h[f]){var m=g.l,v=g.i,y=g.j,b=g.h;m==s&&v==u&&y==l&&b==c||(d.payload&&e.nestedCues.push(d),d=Fh(i,r,m,v,y,b),s=m,u=v,l=y,c=b),d.payload+=g.g}else d.payload+=" ";d.payload&&e.nestedCues.push(d),a!==o&&(d=Vh(i,r),e.nestedCues.push(d)),d=Fh(i,r,s,u,l,c)}}return e.nestedCues.length?{cue:e,stream:t}:null}function Fh(e,t,n,i,r,a){return e=new un(e,t,""),n&&e.textDecoration.push(Pn),i&&(e.fontStyle=Dn),e.color=r,e.backgroundColor=a,e}function Vh(e,t){return(e=new un(e,t,"")).lineBreak=!0,e}function Hh(e,t,n,i,r){this.g=e,this.l=t,this.i=n,this.h=i,this.j=r}function Gh(e,t){this.i=[],this.g=1,this.h=0,this.C=e,this.B=t,this.j=this.m=!1,this.l="white",this.o="black",this.s=this.A=null,Xh(this)}function Kh(e,t,n){var i="CC"+(1+(e.C<<1|e.B)),r=new un(t,n,"");r.lineInterpretation=1;var a=Zh.get(e.g);return a&&(r.line=a),null!=e.s&&null!=e.A&&(r.position=10+Math.min(70,10*e.s)+2.5*e.A),(t=Bh(r,i,e.i,t,n))&&15<e.g+t.cue.nestedCues.length-3&&(a=Zh.get(e.g+3-t.cue.nestedCues.length))&&(r.line=a),t}function Xh(e){Wh(e,0,15),e.g=1}function qh(e,t,n){if(!(32>n||127<n)){var i="";switch(t){case 0:i=Yh.has(n)?Yh.get(n):String.fromCharCode(n);break;case 1:i=Jh.get(n);break;case 2:e.i[e.g].pop(),i=$h.get(n);break;case 3:e.i[e.g].pop(),i=Qh.get(n)}i&&e.i[e.g].push(new Hh(i,e.m,e.j,e.o,e.l))}}function zh(e,t,n,i){if(!(0>n||0>t))if(t>=n)for(--i;0<=i;i--)e.i[t+i]=e.i[n+i].map((function(e){return e}));else for(var r=0;r<i;r++)e.i[t+r]=e.i[n+r].map((function(e){return e}))}function Wh(e,t,n){for(var i=0;i<=n;i++)e.i[t+i]=[]}var Yh=new Map([[39,"’"],[42,"á"],[92,"é"],[92,"é"],[94,"í"],[95,"ó"],[96,"ú"],[123,"ç"],[124,"÷"],[125,"Ñ"],[126,"ñ"],[127,"█"]]),Jh=new Map([[48,"®"],[49,"°"],[50,"½"],[51,"¿"],[52,"™"],[53,"¢"],[54,"£"],[55,"♪"],[56,"à"],[57," "],[58,"è"],[59,"â"],[60,"ê"],[61,"î"],[62,"ô"],[63,"û"]]),$h=new Map([[32,"Á"],[33,"É"],[34,"Ó"],[35,"Ú"],[36,"Ü"],[37,"ü"],[38,"‘"],[39,"¡"],[40,"*"],[41,"'"],[42,"─"],[43,"©"],[44,"℠"],[45,"·"],[46,"“"],[47,"”"],[48,"À"],[49,"Â"],[50,"Ç"],[51,"È"],[52,"Ê"],[53,"Ë"],[54,"ë"],[55,"Î"],[56,"Ï"],[57,"ï"],[58,"Ô"],[59,"Ù"],[60,"ù"],[61,"Û"],[62,"«"],[63,"»"]]),Qh=new Map([[32,"Ã"],[33,"ã"],[34,"Í"],[35,"Ì"],[36,"ì"],[37,"Ò"],[38,"ò"],[39,"Õ"],[40,"õ"],[41,"{"],[42,"}"],[43,"\\"],[44,"^"],[45,"_"],[46,"|"],[47,"~"],[48,"Ä"],[49,"ä"],[50,"Ö"],[51,"ö"],[52,"ß"],[53,"¥"],[54,"¤"],[55,"│"],[56,"Å"],[57,"å"],[58,"Ø"],[59,"ø"],[60,"┌"],[61,"┐"],[62,"└"],[63,"┘"]]),Zh=new Map([[1,10],[2,15.33],[3,20.66],[4,26],[5,31.33],[6,36.66],[7,42],[8,47.33],[9,52.66],[10,58],[11,63.33],[12,68.66],[13,74],[14,79.33],[15,84.66]]);function ef(e,t){this.h=0,this.o=new Gh(e,t),this.i=new Gh(e,t),this.g=this.j=new Gh(e,t),this.l=0,this.m=null}function tf(e,t,n){e.g=e.i;var i=e.g,r=null;return 3!==e.h&&4!==e.h&&(r=Kh(i,e.l,n),(n=e.i).g=0<n.h?n.h:0,Wh(n,0,15),(n=e.j).g=0<n.h?n.h:0,Wh(n,0,15),i.g=15),e.h=3,i.h=t,r}function nf(e){e.h=1,e.g=e.j,e.g.h=0}function rf(e){Y("Cea608DataChannel","CEA-608 text mode entered, but is unsupported"),e.g=e.o,e.h=4}var af="black green blue cyan red yellow magenta black".split(" "),of="white green blue cyan red yellow magenta white_italics".split(" ");function sf(e,t){this.I=t,this.M=e,this.K=this.l=!1,this.m=this.o=this.G=this.L=this.H=0,this.F=2,this.i=[],this.g=this.h=this.j=0,this.C=this.A=!1,this.B="white",this.s="black",uf(this)}function uf(e){e.i=[];for(var t=0;16>t;t++)e.i.push(lf())}function lf(){for(var e=[],t=0;42>t;t++)e.push(null);return e}function cf(e,t){df(e)&&(e.i[e.h][e.g]=new Hh(t,e.C,e.A,e.s,e.B),e.g++)}function df(e){var t=e.g<e.m&&0<=e.g;return e.h<e.o&&0<=e.h&&t}function hf(e,t,n){var i=new un(e.j,t,"");i.textAlign=0===e.F?"left":1===e.F?"right":mn;var r=i.region;switch(e.I&&(r.id+="svc"+e.I),r.id+="win"+e.M,r.height=e.o,r.width=e.m,r.heightUnits=2,r.widthUnits=2,r.viewportAnchorX=e.H,r.viewportAnchorY=e.L,r.viewportAnchorUnits=e.K?Ae:2,e.G){case 0:r.regionAnchorX=0,r.regionAnchorY=0;break;case 1:r.regionAnchorX=50,r.regionAnchorY=0;break;case 2:r.regionAnchorX=100,r.regionAnchorY=0;break;case 3:r.regionAnchorX=0,r.regionAnchorY=50;break;case 4:r.regionAnchorX=50,r.regionAnchorY=50;break;case 5:r.regionAnchorX=100,r.regionAnchorY=50;break;case 6:r.regionAnchorX=0,r.regionAnchorY=100;break;case 7:r.regionAnchorX=50,r.regionAnchorY=100;break;case 8:r.regionAnchorX=100,r.regionAnchorY=100}return(n=Bh(i,"svc"+n,e.i,e.j,t))&&(e.j=t),n}function ff(){this.i=[],this.h=null,this.g=0}function pf(e,t){3===t.type?(e.g=2*(63&t.value)-1,e.h=[]):e.h&&(0<e.g&&(e.h.push(t),e.g--),0===e.g&&(e.i.push(new gf(e.h)),e.h=null,e.g=0))}function gf(e){this.g=0,this.h=e}function mf(e){if(!e.sa())throw new De(2,2,3e3);return e.h[e.g++]}function vf(e){this.i=e,this.h=[null,null,null,null,null,null,null,null],this.g=null}function yf(e,t,n,i){if(128<=n&&135>=n)i=7&n,e.h[i]&&(e.g=e.h[i]);else{if(136===n){n=mf(t).value,t=null;for(var r=(n=l(bf(e,n))).next();!r.done;r=n.next())(r=e.h[r.value]).isVisible()&&(t=hf(r,i,e.i)),uf(r);return t}if(137===n)for(n=(t=l(bf(e,t=mf(t).value))).next();!n.done;n=t.next())(n=e.h[n.value]).isVisible()||(n.j=i),n.display();else{if(138===n){for(n=mf(t).value,t=null,r=(n=l(bf(e,n))).next();!r.done;r=n.next())(r=e.h[r.value]).isVisible()&&(t=hf(r,i,e.i)),r.l=!1;return t}if(139===n){for(n=mf(t).value,t=null,r=(n=l(bf(e,n))).next();!r.done;r=n.next())(r=e.h[r.value]).isVisible()?t=hf(r,i,e.i):r.j=i,r.l=!r.l;return t}if(140===n)return wf(e,t=mf(t).value,i);if(143===n)return i=wf(e,255,i),Tf(e),i;if(144===n)t.skip(1),i=mf(t).value,e.g&&(e.g.A=0<(128&i),e.g.C=0<(64&i));else if(145===n)i=mf(t).value,n=mf(t).value,t.skip(1),e.g&&(t=Sf((48&n)>>4,(12&n)>>2,3&n),e.g.B=Sf((48&i)>>4,(12&i)>>2,3&i),e.g.s=t);else if(146===n)i=mf(t).value,t=mf(t).value,e.g&&((e=e.g).h=15&i,e.g=63&t);else if(151===n)t.skip(1),t.skip(1),i=mf(t).value,t.skip(1),e.g&&(e.g.F=3&i);else if(152<=n&&159>=n){if(n=(15&n)-8,!(r=null!==e.h[n])){var a=new sf(n,e.i);a.j=i,e.h[n]=a}i=mf(t).value,a=mf(t).value;var o=mf(t).value,s=mf(t).value,u=mf(t).value;t=mf(t).value,r&&!(7&t)||((t=e.h[n]).h=0,t.g=0,t.C=!1,t.A=!1,t.B="white",t.s="black"),(t=e.h[n]).l=0<(32&i),t.L=127&a,t.H=o,t.G=(240&s)>>4,t.K=0<(128&a),t.o=1+(15&s),t.m=1+(63&u),e.g=e.h[n]}}}return null}function bf(e,t){for(var n=[],i=0;8>i;i++)!(1&~t)&&e.h[i]&&n.push(i),t>>=1;return n}function wf(e,t,n){for(var i=null,r=(t=l(bf(e,t))).next();!r.done;r=t.next()){r=r.value;var a=e.h[r];a.isVisible()&&(i=hf(a,n,e.i)),e.h[r]=null}return i}function Tf(e){e.g=null,e.h=[null,null,null,null,null,null,null,null]}function Sf(e,t,n){var i={0:0,1:0,2:1,3:1};return Af[(e=i[e])<<2|(t=i[t])<<1|(n=i[n])]}sf.prototype.isVisible=function(){return this.l},sf.prototype.display=function(){this.l=!0},gf.prototype.sa=function(){return this.g<this.h.length},gf.prototype.ya=function(){return this.g},gf.prototype.skip=function(e){if(this.g+e>this.h.length)throw new De(2,2,3e3);this.g+=e};var xf=new Map([[32," "],[33," "],[37,"…"],[42,"Š"],[44,"Œ"],[48,"█"],[49,"‘"],[50,"’"],[51,"“"],[52,"”"],[53,"•"],[57,"™"],[58,"š"],[60,"œ"],[61,"℠"],[63,"Ÿ"],[118,"⅛"],[119,"⅜"],[120,"⅝"],[121,"⅞"],[122,"│"],[123,"┐"],[124,"└"],[125,"─"],[126,"┘"],[127,"┌"]]),Af="black blue green cyan red magenta yellow white".split(" ");function Ef(){this.h=[],this.g=[],this.i=new ff,this.l=0,this.m=new Map([["CC1",new ef(0,0)],["CC2",new ef(0,1)],["CC3",new ef(1,0)],["CC4",new ef(1,1)]]),this.s=this.o=0,this.j=new Map,this.B=!0,this.A=new Set,kf(this)}function kf(e){e.o=0,e.s=0;for(var t=l(e.m.values()),n=t.next();!n.done;n=t.next())(n=n.value).h=0,n.g=n.j,n.m=null,Xh(n.i),Xh(n.j),Xh(n.o);e.B=!0}function If(e,t){var n=t.type;if(16==(112&t.gb)){var i=t.gb>>3&1;0===n?e.o=i:e.s=i}if(i="CC"+(1+(n<<1|(n?e.s:e.o))),n=e.m.get(i),255===t.gb&&255===t.Eb||!t.gb&&!t.Eb||!Cf(t.gb)||!Cf(t.Eb))return 45<=++e.l&&kf(e),null;e.l=0,t.gb&=127,t.Eb&=127;var r=t.gb;if(1<=r&&15>=r||!t.gb&&!t.Eb)return null;if(r=null,16==(112&t.gb))e:{if(e.A.add(i),i=t.gb,e=t.Eb,n.m===(i<<8|e))n.m=null;else if(n.m=i<<8|e,16==(240&i)&&64==(192&e)){t=[11,11,1,2,3,4,12,13,14,15,5,6,7,8,9,10][(7&i)<<1|e>>5&1],i="white",r=!1;var a=null,o=95<e?e-96:e-64;13>=o?i=of[Math.floor(o/2)]:15>=o?r=!0:a=Math.floor((o-16)/2),e=!(1&~e),4!==n.h&&(o=n.g,3===n.h&&t!==o.g&&(zh(o,n=1+t-o.h,1+o.g-o.h,o.h),Wh(o,0,n-1),Wh(o,t+1,15-t)),o.g=t,o.m=e,o.j=r,o.l=i,o.s=a,o.o="black")}else if(17==(247&i)&&32==(240&e))n.g.m=!1,n.g.j=!1,n.g.l="white",qh(n.g,0,32),i=!1,"white_italics"===(t=of[(14&e)>>1])&&(t="white",i=!0),n.g.m=!(1&~e),n.g.j=i,n.g.l=t;else if(16==(247&i)&&32==(240&e)||23==(247&i)&&45==(255&e))t="black",!(7&i)&&(t=af[(14&e)>>1]),n.g.o=t;else if(17==(247&i)&&48==(240&e))qh(n.g,1,e);else if(18==(246&i)&&32==(224&e))qh(n.g,1&i?3:2,e);else{if(20==(246&i)&&32==(240&e)){switch(e=t.pts,i=null,t.Eb){case 32:nf(n);break;case 33:(n=n.g).i[n.g].pop();break;case 37:i=tf(n,2,e);break;case 38:i=tf(n,3,e);break;case 39:i=tf(n,4,e);break;case 40:qh(n.g,0,32);break;case 41:n.h=2,n.g=n.i,n.g.h=0,n.l=e;break;case 42:Xh(n.o),rf(n);break;case 43:rf(n);break;case 44:t=n.i,i=null,4!==n.h&&(i=Kh(t,n.l,e)),Wh(t,0,15);break;case 45:t=n.g,3!==n.h?i=null:(i=Kh(t,n.l,e),zh(t,(r=t.g-t.h+1)-1,r,t.h),Wh(t,0,r-1),Wh(t,t.g,15-t.g),n.l=e);break;case 46:Wh(n.j,0,15);break;case 47:t=null,4!==n.h&&(t=Kh(n.i,n.l,e)),i=n.j,n.j=n.i,n.i=i,nf(n),n.l=e,i=t}r=i;break e}(23==i||31==i)&&33<=e&&35>=e&&(n.g.A=e-32)}r=null}else e=t.Eb,qh(n.g,0,t.gb),qh(n.g,0,e);return r}function Mf(e,t){var n=[];try{for(;t.sa();){var i=mf(t).value,r=(224&i)>>5,a=31&i;if(7===r&&0!=a&&(r=63&mf(t).value),0!=r){e.A.add("svc"+r),e.j.has(r)||e.j.set(r,new vf(r));for(var o=e.j.get(r),s=t.ya();t.ya()-s<a;){r=o;var u=t,l=mf(u),c=l.value,d=l.pts;if(16===c&&(c=c<<16|mf(u).value),0<=c&&31>=c){var h=c,f=d;if((u=r).g){var p=u.g;switch(r=null,h){case 8:!df(p)||0>=p.g&&0>=p.h||(0>=p.g?(p.g=p.m-1,p.h--):p.g--,p.i[p.h][p.g]=null);break;case 13:if(p.isVisible()&&(r=hf(p,f,u.i)),p.h+1>=p.o){for(u=p,h=0,f=1;16>f;f++,h++)u.i[h]=u.i[f];for(f=0;1>f;f++,h++)u.i[h]=lf()}else p.h++;p.g=0;break;case 14:p.isVisible()&&(r=hf(p,f,u.i)),p.i[p.h]=lf(),p.g=0;break;case 12:p.isVisible()&&(r=hf(p,f,u.i)),uf(p),(u=p).h=0,u.g=0}var g=r}else g=null}else if(128<=c&&159>=c)g=yf(r,u,c,d);else{if(4096<=c&&4127>=c)r=u,8<=(u=255&c)&&15>=u?r.skip(1):16<=u&&23>=u?r.skip(2):24<=u&&31>=u&&r.skip(3);else if(4224<=c&&4255>=c)r=u,128<=(u=255&c)&&135>=u?r.skip(4):136<=u&&143>=u&&r.skip(5);else if(32<=c&&127>=c)u=c,r.g&&cf(r.g,127===u?"♪":String.fromCharCode(u));else if(160<=c&&255>=c)r.g&&cf(r.g,String.fromCharCode(c));else if(4128<=c&&4223>=c){if(u=255&c,r.g)if(xf.has(u)){var m=xf.get(u);cf(r.g,m)}else cf(r.g,"_")}else 4256<=c&&4351>=c&&r.g&&cf(r.g,160!=(255&c)?"_":"[CC]");g=null}(r=g)&&n.push(r)}}}}catch(e){if(!(e instanceof De&&3e3===e.code))throw e;Y("CEA708_INVALID_DATA","Buffer read out of bounds / invalid CEA-708 Data.")}return n}function Cf(e){for(var t=0;e;)t^=1&e,e>>=1;return 1===t}function Df(e){for(var t=[],n=e,i=e=0;i<n.length;)2==e&&3==n[i]?(e=0,(n=[].concat(c(n))).splice(i,1),n=new Uint8Array(n)):0==n[i]?e++:e=0,i++;for(e=n,i=0;i<e.length;){for(n=0;255==e[i];)n+=255,i++;n+=e[i++];for(var r=0;255==e[i];)r+=255,i++;r+=e[i++],4==n&&t.push(e.subarray(i,i+r)),i+=r}return t}function Rf(){this.j=new Map,this.i=this.h=0,this.g=Lf}function Pf(e,t,n,i,r,a,o,s,u){var d=0,h=a,f=s.map((function(e){return e.Zg}));for((f=[].concat.apply([],c(f))).length&&(h=f[0].sampleSize||a),t.skip(o+s[0].Ih);t.sa();){o=t.P();var p=t.T(),g=null;switch(g=!1,s=1,e.g){case Nf:g=6==(g=31&p);break;case jf:s=2,t.skip(1),g=39==(g=p>>1&63)||40==g;break;case Of:s=2,t.skip(1),g=23==(g=p>>1&63)||24==g;break;default:return}if(g)for(p=0,d<f.length&&(p=f[d].me||0),p=(n+p)/i,g=(s=l(Df(t.vb(o-s)))).next();!g.done;g=s.next())u.push({packet:g.value,pts:p});else try{t.skip(o-s)}catch(e){break}0==(h-=o+4)&&(n=d<f.length?n+(f[d].Of||r):n+r,h=++d<f.length&&f[d].sampleSize||a)}}Ef.prototype.clear=function(){this.l=0,this.h=[],this.g=[];var e=this.i;e.i=[],e.h=[],e.g=0,kf(this);for(var t=(e=l(this.j.values())).next();!t.done;t=e.next())Tf(t.value)},Ef.prototype.extract=function(e,t){if(this.B){for(var n=l(this.m.values()),i=n.next();!i.done;i=n.next())i.value.l=t;this.B=!1}if(!(8>(e=new ya(e,0)).getLength())&&181===e.T()&&49===e.ma()&&1195456820===e.P()&&3===e.T()&&64&(n=e.T()))for(n&=31,e.skip(1),i=0;i<n;i++){var r=e.T(),a=(4&r)>>2,o=e.T(),s=e.T();a&&(0==(r&=3)||1===r?this.h.push({pts:t,type:r,gb:o,Eb:s,order:this.h.length}):(this.g.push({pts:t,type:r,value:o,order:this.g.length}),this.g.push({pts:t,type:2,value:s,order:this.g.length})))}},Ef.prototype.decode=function(){function e(e,t){return e.pts-t.pts||e.order-t.order}var t=[];this.h.sort(e),this.g.sort(e);for(var n=l(this.h),i=n.next();!i.done;i=n.next())(i=If(this,i.value))&&t.push(i);for(i=(n=l(this.g)).next();!i.done;i=n.next())pf(this.i,i.value);for(i=(n=l(this.i.i)).next();!i.done;i=n.next())i=Mf(this,i.value),t.push.apply(t,c(i));return this.i.i=[],this.h=[],this.g=[],t},Ef.prototype.getStreams=function(){return Array.from(this.A)},F("shaka.cea.CeaDecoder",Ef),Se=function(){return new Ef},Rf.prototype.init=function(e){function t(e){(e=e.name)in Uf&&(n.g=Uf[e])}var n=this,i=[],r=[];if((new Ta).box("moov",Sa).box("mvex",Sa).R("trex",(function(e){var t=e.reader;t.skip(4),t.skip(4),e=t.P(),t=t.P(),n.h=e,n.i=t})).box("trak",Sa).R("tkhd",(function(e){var t=e.reader;1==(e=e.version)?(t.skip(8),t.skip(8)):(t.skip(4),t.skip(4));var n=t.P();1==e?t.skip(8):t.skip(4),t.skip(4),t.skip(8),t.skip(2),t.skip(2),t.skip(2),t.skip(2),t.skip(36),t.ma(),t.ma(),t.ma(),t.ma(),i.push(n)})).box("mdia",Sa).R("mdhd",(function(e){e=_o(e.reader,e.version),r.push(e.timescale)})).box("minf",Sa).box("stbl",Sa).R("stsd",xa).box("avc1",t).box("avc3",t).box("dvav",t).box("dva1",t).box("hev1",t).box("hvc1",t).box("dvh1",t).box("dvhe",t).box("vvc1",t).box("vvi1",t).box("dvc1",t).box("dvi1",t).box("encv",Aa).box("sinf",Sa).box("frma",(function(e){(e=Vo(e.reader).codec)in Uf&&(n.g=Uf[e])})).parse(e,!0),!i.length||!r.length||i.length!=r.length)throw new De(2,2,2010);this.g==Lf&&W("Unable to determine bitstream format for CEA parsing!"),i.forEach((function(e,t){n.j.set(e,r[t])}))},Rf.prototype.parse=function(e){var t=this;if(this.g==Lf)return[];var n=[],i=0,r=[];return(new Ta).box("moof",(function(e){i=e.start,r=[],Sa(e)})).box("traf",(function(e){r.push({baseMediaDecodeTime:null,ed:t.h,Ld:t.i,Sg:[],timescale:9e4}),Sa(e)})).R("trun",(function(e){var t=r[r.length-1];e=Bo(e.reader,e.version,e.flags),t.Sg.push(e)})).R("tfhd",(function(e){var n=r[r.length-1];e=Oo(e.reader,e.flags),n.ed=e.ed||t.h,n.Ld=e.Ld||t.i,e=e.trackId,t.j.has(e)&&(n.timescale=t.j.get(e))})).R("tfdt",(function(e){var t=r[r.length-1];e=Uo(e.reader,e.version),t.baseMediaDecodeTime=e.baseMediaDecodeTime})).box("mdat",(function(e){for(var a=i-e.start-8,o=e.reader.ya(),s=l(r),u=s.next();!u.done;u=s.next()){if(null===(u=u.value).baseMediaDecodeTime)throw W("Unable to find base media decode time for CEA captions!"),new De(2,2,2010);e.reader.seek(o),Pf(t,e.reader,u.baseMediaDecodeTime,u.timescale,u.ed,u.Ld,a,u.Sg,n)}})).parse(e,!1),n},F("shaka.cea.Mp4CeaParser",Rf);var Lf=0,Nf=1,jf=2,Of=3,Uf={avc1:Nf,avc3:Nf,dvav:Nf,dva1:Nf,hev1:jf,hvc1:jf,dvh1:jf,dvhe:jf,vvc1:Of,vvi1:Of,dvc1:Of,dvi1:Of};function _f(){this.g=null}function Bf(t,n,i){var r=function(e){for(var t=[],n=(e=l(e)).next();!n.done;n=e.next())(n=Vf(n.value))&&t.push(n);return t}(t),a=null;t=[];var o=[],s=null,u=new Set(r.map((function(e){return e.keyId})));u.delete(null);var c="cenc";if(1<u.size)throw new De(2,4,4010);if(!n){if(1<(o=r.filter((function(e){return"urn:mpeg:dash:sea:2012"==e.Wc}))).length)throw new De(2,4,4050);o.length&&(s=function(t){if(!e.crypto||!e.crypto.subtle)throw W("Web Crypto API is not available to decrypt AES-128. (Web Crypto only exists in secure origins like https)"),new De(2,4,4042);var n=Bt(t.node,"urn:mpeg:dash:schema:sea:2012","SegmentEncryption");if(!n)throw new De(2,4,4051);if("urn:mpeg:dash:sea:aes128-cbc:2013"!=n.attributes.schemeIdUri)throw new De(2,4,4051);if(!(n=Bt(t.node,"urn:mpeg:dash:schema:sea:2012","CryptoPeriod")))throw new De(2,4,4051);if(t=n.attributes.IV,n=vt(n.attributes.keyUriTemplate),!t||!n)throw new De(2,4,4051);if(16!=(t=li(t.substr(2))).byteLength)throw new De(2,4,4048);return{wi:n,iv:t}}(o[0])),(o=r.find((function(e){return"urn:mpeg:dash:mp4protection:2011"==e.Wc})))&&o.encryptionScheme&&(c=o.encryptionScheme),(o=r.filter((function(e){return"urn:mpeg:dash:mp4protection:2011"==e.Wc?(a=e.init||a,!1):"urn:mpeg:dash:sea:2012"!=e.Wc}))).length&&(t=function(e,t,n,i,r){for(var a=[],o=(n=l(n)).next();!o.done;o=n.next()){var s=i[(o=o.value).Wc];if(s){var u;if((u=Bt(o.node,"urn:microsoft:playready","pro"))&&jt(u)){u=ui(u=jt(u));var c=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);u=[{initData:La(u,c,new Set,0),initDataType:"cenc",keyId:o.keyId}]}else u=null;if(c=null,"urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e"===o.Wc){c=o;var d=r;if(0==d.size)c=null;else{var h=new Uint8Array([16,119,239,236,192,178,77,2,172,227,60,30,82,226,251,75]);c=[{initData:La(new Uint8Array([]),h,d,1),initDataType:"cenc",keyId:c.keyId}]}}u=fi(s,t,o.init||e||u||c),(s=Gf.get(s))&&(u.licenseServerUri=s(o)),a.push(u)}}return a}(a,c,o,i,u),0==t.length&&(t=[fi("",c,a)]))}if(r.length&&!s&&(n||!o.length))for(t=[],i=(n=l(Object.values(i))).next();!i.done;i=n.next())"org.w3.clearkey"!=(i=i.value)&&t.push(fi(i,c,a));if(u=Array.from(u)[0]||null)for(n=(c=l(t)).next();!n.done;n=c.next())for(i=(n=l(n.value.initData)).next();!i.done;i=n.next())i.value.keyId=u;return{rg:u,kk:a,drmInfos:t,Je:s,wg:!0}}function Ff(e){var t=Bt(e.node,"https://dashif.org/CPS","Laurl");return t&&(t=jt(t))?t:(e=Bt(e.node,"urn:microsoft:playready","pro"))&&jt(e)?(e=function(e){var t=0,n=ve(e),i=n.getUint32(t,!0);if(i!=e.byteLength)return[];e:{for(e=t+6,t=[];e<n.byteLength-1;){i=n.getUint16(e,!0),e+=2;var r=n.getUint16(e,!0);if(e+=2,1&r||r+e>n.byteLength){n=[];break e}var a=ge(n,e,r);t.push({type:i,value:a}),e+=r}n=t}return n}(e=ui(e=jt(e))).filter((function(e){return e.type===Hf}))[0],e&&(e=Dt(e=ht(e.value,!0),"WRMHEADER"))?function(e){for(var t=(e=l(Ut(e,"DATA"))).next();!t.done;t=e.next())if((t=t.value).children)for(var n=(t=l(t.children)).next();!n.done;n=t.next())if("LA_URL"==(n=n.value).tagName)return jt(n);return""}(e):""):""}function Vf(e){var t=e.attributes.schemeIdUri,n=Vt(e,"urn:mpeg:cenc:2013","default_KID"),i=Ht(e,"urn:mpeg:cenc:2013","pssh").map(Ot),r=e.attributes.value;if(!t)return null;if(t=t.toLowerCase(),n&&(n=n.replace(/-/g,"").toLowerCase()).includes(" "))throw new De(2,4,4009);var a=[];try{a=i.map((function(e){return{initDataType:"cenc",initData:ui(e),keyId:null}}))}catch(e){throw new De(2,4,4007)}return{node:e,Wc:t,keyId:n,init:0<a.length?a:null,encryptionScheme:r}}Te["video/mp4"]=function(){return new Rf},_f.prototype.init=function(){},_f.prototype.parse=function(e){this.g?this.g.clearData():this.g=new ns;var t=[];if(!os(e=ge(e)))return t;var n=(e=this.g.parse(e)).fd(),i=e.Rd();switch(e=[],n.video){case"avc":e.push(6);break;case"hvc":e.push(39),e.push(40)}if(!e.length)return t;for(i=(n=l(i)).next();!i.done;i=n.next())if(i=i.value,e.includes(i.type)&&null!=i.time)for(var r=l(Df(i.data)),a=r.next();!a.done;a=r.next())t.push({packet:a.value,pts:i.time});return t},F("shaka.cea.TsCeaParser",_f),Te["video/mp2t"]=function(){return new _f};var Hf=1,Gf=(new Map).set("com.apple.fps",(function(e){if(ot())throw new De(2,4,4054);return(e=Bt(e.node,"https://dashif.org/CPS","Laurl"))&&(e=jt(e))?e:""})).set("com.widevine.alpha",(function(e){var t=Bt(e.node,"https://dashif.org/CPS","Laurl");return t&&(t=jt(t))?t:(e=Bt(e.node,"urn:microsoft","laurl"))&&vt(e.attributes.licenseUrl)||""})).set("com.microsoft.playready",Ff).set("com.microsoft.playready.recommendation",Ff).set("com.microsoft.playready.software",Ff).set("com.microsoft.playready.hardware",Ff).set("org.w3.clearkey",(function(e){var t=Bt(e.node,"https://dashif.org/CPS","Laurl");return t&&(t=jt(t))?t:(e=Bt(e.node,"http://dashif.org/guidelines/clearKey","Laurl"))&&"EME-1.0"===e.attributes.Lic_type&&e&&(e=jt(e))?e:""}));function Kf(t,n,i,r,a,o){var s={RepresentationID:n,Number:i,SubNumber:r,Bandwidth:a,Time:o};return t.replace(/\$(RepresentationID|Number|SubNumber|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,(function(t,n,i,r){if("$$"==t)return"$";var a=s[n];if(null==a)return t;switch("RepresentationID"==n&&i&&(i=void 0),"Time"==n&&"bigint"!=typeof a&&(.2<=Math.abs(a-Math.round(a))&&W("Calculated $Time$ values must be close to integers"),a=Math.round(a)),r){case void 0:case"d":case"i":case"u":t=a.toString();break;case"o":t=a.toString(8);break;case"x":t=a.toString(16);break;case"X":t=a.toString(16).toUpperCase();break;default:t=a.toString()}return i=e.parseInt(i,10)||1,Array(Math.max(0,i-t.length)+1).join("0")+t}))}function Xf(e,t){var n=zf(e,t,"timescale"),i=1;n&&(i=Wt(n)||1),(n=Wt((n=zf(e,t,"duration"))||""))&&(n/=i);var r=zf(e,t,"startNumber"),a=Number(zf(e,t,"presentationTimeOffset"))||0,o=Yt(r||"");if(null!=r&&null!=o||(o=1),r=null,t=Wf(e,t,"SegmentTimeline")){t=Nt(t,"S"),r=i,e=e.ka.duration||1/0;for(var s=o,u=[],l=-a,c=0;c<t.length;++c){var d=t[c],h=t[c+1],f=Ft(d,"t",Yt),p=Ft(d,"d",Yt),g=Ft(d,"r",zt);if(d=Ft(d,"k",zt)||0,null!=f&&(f-=a),p){if(f=null!=f?f:l,0>(g=g||0))if(h){if(null==(h=Ft(h,"t",Yt)))break;if(f>=h)break;g=Math.ceil((h-f)/p)-1}else{if(1/0==e)break;if(f/r>=e)break;g=Math.ceil((e*r-f)/p)-1}for(0<u.length&&f!=l&&(u[u.length-1].end=f/r),h=0;h<=g;++h)l=f+p,u.push({start:f/r,end:l/r,dg:f,Cb:d,Wi:u.length+s}),f=l}}r=u}return{timescale:i,Qa:n,zd:o,Pb:a/i||0,cg:a,timeline:r}}function qf(e,t){return[t(e.J),t(e.ha),t(e.oa)].filter(Gi)}function zf(e,t,n){t=qf(e,t),e=null;for(var i=(t=l(t)).next();!i.done&&!(e=i.value.attributes[n]);i=t.next());return e}function Wf(e,t,n){t=qf(e,t),e=null;for(var i=(t=l(t)).next();!i.done&&!(e=_t(i.value,n));i=t.next());return e}function Yf(e,t,n,i,r,a){if(a=void 0===a?0:a,Vt(e,"http://www.w3.org/1999/xlink","href")){var o=function(e,t,n,i,r,a){for(var o=Vt(e,"http://www.w3.org/1999/xlink","href"),s=Vt(e,"http://www.w3.org/1999/xlink","actuate")||"onRequest",u=l(Object.keys(e.attributes)),c=u.next();!c.done;c=u.next()){var d=(c=c.value).split(":"),h=Rt("http://www.w3.org/1999/xlink");d[0]==h&&delete e.attributes[c]}if(5<=a)return Xr(new De(2,4,4028));if("onLoad"!=s)return Xr(new De(2,4,4027));var f=hi([i],[o]);return r.request(0,aa(f,t)).Ca((function(i){if(!(i=Ct(i.data,e.tagName)))return Xr(new De(2,4,4001,o));for(e.children=[];i.children.length;){var s=i.children.shift();e.children.push(s)}for(var u=(s=l(Object.keys(i.attributes))).next();!u.done;u=s.next())u=u.value,e.attributes[u]=i.attributes[u];return Yf(e,t,n,f[0],r,a+1)}))}(e,t,n,i,r,a);return n&&(o=o.Ca(void 0,(function(){return Yf(e,t,n,i,r,a)}))),o}o=[];for(var s=l(Lt(e)),u=s.next(),c={};!u.done;c={ad:void 0},u=s.next())c.ad=u.value,"urn:mpeg:dash:resolve-to-zero:2013"==Vt(c.ad,"http://www.w3.org/1999/xlink","href")?e.children=e.children.filter(function(e){return function(t){return t!==e.ad}}(c)):"SegmentTimeline"!=c.ad.tagName&&o.push(Yf(c.ad,t,n,i,r,a));return Yr(o).Ca((function(){return e}))}function Jf(e){this.h=ve(e),this.g=new ya(this.h,0)}function $f(e){var t=Qf(e);if(7<t.length)throw new De(2,3,3002);for(var n=0,i=(t=l(t)).next();!i.done;i=t.next())n=256*n+i.value;t=Qf(e);e:{for(var r=(i=l(Zf)).next();!r.done;r=i.next())if(fe(t,new Uint8Array(r.value))){i=!0;break e}i=!1}if(i)t=e.h.byteLength-e.g.ya();else{if(8==t.length&&224&t[1])throw new De(2,3,3001);for(r=i=0;r<t.length;r++){var a=t[r];i=0==r?a&(1<<8-t.length)-1:256*i+a}t=i}return t=e.g.ya()+t<=e.h.byteLength?t:e.h.byteLength-e.g.ya(),i=ve(e.h,e.g.ya(),t),e.g.skip(t),new ep(n,i)}function Qf(e){var t=e.g.ya(),n=e.g.T();if(0==n)throw new De(2,3,3002);return n=8-Math.floor(Math.log2(n)),e.g.skip(n-1),ge(e.h,t,n)}Jf.prototype.sa=function(){return this.g.sa()};var Zf=[[255],[127,255],[63,255,255],[31,255,255,255],[15,255,255,255,255],[7,255,255,255,255,255],[3,255,255,255,255,255,255],[1,255,255,255,255,255,255,255]];function ep(e,t){this.id=e,this.g=t}function tp(e){if(8<e.g.byteLength)throw new De(2,3,3002);if(8==e.g.byteLength&&224&e.g.getUint8(0))throw new De(2,3,3001);for(var t=0,n=0;n<e.g.byteLength;n++)t=256*t+e.g.getUint8(n);return t}function np(e){var t=new Jf(e.g);if(179!=(e=$f(t)).id)throw new De(2,3,3013);if(e=tp(e),183!=(t=$f(t)).id)throw new De(2,3,3012);t=new Jf(t.g);for(var n=0;t.sa();){var i=$f(t);if(241==i.id){n=tp(i);break}}return{hj:e,Mi:n}}function ip(e,t,n){if(!(t=Wf(e,t,"Initialization")))return null;var i=e.J.Oa(),r=t.attributes.sourceURL;r&&(i=hi(i,[vt(r)],e.ob())),r=0;var a=null;return(t=Ft(t,"range",qt))&&(r=t.start,a=t.end),(n=new go((function(){return i}),r,a,up(e),null,null,n)).codecs=e.J.codecs,n.mimeType=e.J.mimeType,n}function rp(e,t,n,i,r,a,o){var s,u,c,d,h,f,p,g,m,v,y,b,T,S,x,A,E,k;return P((function(I){if(1==I.g)return s=e.presentationTimeline,u=!e.xb||!e.ka.uf,c=e.ka.start,d=e.ka.duration,h=e.J.mimeType.split("/")[1],p=null,g=[(f=t)(i,r,a,!1),"webm"==h?f(n.N(),n.Ja,n.va,!0):null],f=null,w(I,Promise.all(g),2);if(m=I.h,v=m[0],y=m[1]||null,T=c-o,S=c,x=d?c+d:1/0,"mp4"==h)var M=function(e,t,n,i,r,a,o){var s,u=(new Ta).R("sidx",(function(e){s=function(e,t,n,i,r,a,o){var s=[];o.reader.skip(4);var u=o.reader.P();if(0==u)throw new De(2,3,3005);if(0==o.version)var l=o.reader.P(),c=o.reader.P();else l=o.reader.Vc(),c=o.reader.Vc();o.reader.skip(2);var d=o.reader.ma();for(e=e+o.size+c,c=0;c<d;c++){var h=o.reader.P(),f=(2147483648&h)>>>31;h&=2147483647;var p=o.reader.P();if(o.reader.skip(4),1==f)throw new De(2,3,3006);s.push(new vo(l/u+n,(l+p)/u+n,(function(){return a}),e,e+h-1,t,n,i,r)),l+=p,e+=h}return o.parser.stop(),s}(t,i,r,a,o,n,e)}));if(e&&u.parse(e),s)return s;throw new De(2,3,3004)}(v,r,i,n,T,S,x);else{M=v;var C=new Jf(y);if(440786851!=$f(C).id)throw new De(2,3,3008);var D=$f(C);if(408125543!=D.id)throw new De(2,3,3009);C=D.g.byteOffset,D=new Jf(D.g);for(var R=null;D.sa();){var P=$f(D);if(357149030==P.id){R=P;break}}if(!R)throw new De(2,3,3010);for(R=new Jf(R.g),P=1e6,D=null;R.sa();){var L=$f(R);if(2807729==L.id)P=tp(L);else if(17545==L.id)if(4==L.g.byteLength)D=L.g.getFloat32(0);else{if(8!=L.g.byteLength)throw new De(2,3,3003);D=L.g.getFloat64(0)}}if(null==D)throw new De(2,3,3011);if(D*=R=P/1e9,475249515!=(M=$f(new Jf(M))).id)throw new De(2,3,3007);M=function(e,t,n,i,r,a,o,s,u){function l(){return r}var c=[];e=new Jf(e.g);for(var d=null,h=null;e.sa();){var f=$f(e);if(187==f.id){var p=np(f);p&&(f=n*p.hj,p=t+p.Mi,null!=d&&c.push(new vo(d+o,f+o,l,h,p-1,a,o,s,u)),d=f,h=p)}}return null!=d&&c.push(new vo(d+o,i+o,l,h,null,a,o,s,u)),c}(M,C,R,D,i,n,T,S,x)}for(A=l(b=M),E=A.next();!E.done;E=A.next())(k=E.value).codecs=e.J.codecs,k.mimeType=e.J.mimeType,k.bandwidth=e.bandwidth;return s.vd(b),p=new Zs(b),u&&p.Kc(S,x,!0),I.return(p)}))}function ap(e){return e.Yc}function op(e){var t=Wf(e,ap,"RepresentationIndex");return e=qt((e=zf(e,ap,"indexRange"))||""),t&&(e=Ft(t,"range",qt,e)),e}function sp(e,t){var n=e.J.mimeType.split("/")[1];if(e.J.contentType!=yi&&"mp4"!=n&&"webm"!=n)throw new De(2,4,4006);if("webm"==n&&!t)throw new De(2,4,4005)}function up(e){var t=e.J;return{bandwidth:e.bandwidth,audioSamplingRate:t.audioSamplingRate,codecs:t.codecs,contentType:t.contentType,frameRate:t.frameRate||null,height:t.height||null,mimeType:t.mimeType,channelsCount:t.ce,pixelAspectRatio:t.pixelAspectRatio||null,width:t.width||null,label:e.ha.label||null,roles:e.roles||null,language:e.ha.language||null}}function lp(e){return e.Rb}function cp(t,n,i,r,a,o,s,u,c){c||t.J.Ud||(t.J.Ud=zf(t,dp,"initialization"));var d=t.J.Ud?function(e,t){var n=e.J.Ud;if(n||(n=zf(e,dp,"initialization")),!n)return null;n=vt(n);var i=e.J.id,r=e.bandwidth||null,a=e.J.Oa,o=e.ob;return t=new go((function(){var e=Kf(n,i,null,null,r,null);return hi(a(),[e],o())}),0,null,up(e),null,null,t),t.codecs=e.J.codecs,t.mimeType=e.J.mimeType,t}(t,s):null,h=function(e){var t=Xf(e,dp),n=zf(e,dp,"media"),i=zf(e,dp,"index"),r=zf(e,dp,"k"),a=0;return r&&(a=parseInt(r,10)),{Qa:t.Qa,timescale:t.timescale,zd:t.zd,Pb:t.Pb,cg:t.cg,timeline:t.timeline,cc:n&&vt(n),md:i,mimeType:e.J.mimeType,codecs:e.J.codecs,bandwidth:e.bandwidth,Di:a}}(t);!function(e){var t=e.md?1:0;if(t+=e.timeline?1:0,0==(t+=e.Qa?1:0))throw new De(2,4,4002);if(1!=t&&(e.md&&(e.timeline=null),e.Qa=null),!e.md&&!e.cc)throw new De(2,4,4002)}(h);var f=It(t);if(h.md)return sp(t,d),{nc:function(){var e=Kf(h.md,f.J.id,null,null,f.bandwidth||null,null);return e=hi(f.J.Oa(),[e]),rp(f,n,d,e,0,null,h.Pb)}};if(h.Qa)return r||"image"===t.ha.contentType||"text"===t.ha.contentType||(i=t.ka.start,r=t.oa.id,c=t.ka.duration,r=(r=null!=r&&o[r]||c)?i+r:1/0,t.presentationTimeline.Bf(h.Qa),t.presentationTimeline.Qg(i,r)),{nc:function(){return function(t,n,i,r,a,o,s,u){function c(i){var a=(i-y)*v,s=a+n.Pb,l=a+p;a=l+v;var c=Math.min(a,h()),d=[],f=n.Di;if(f)for(var g=(c-l)/f,m={},k=0;k<f;m={mh:void 0},k++){var I=l+g*k,M=I+g;m.mh=k+1,(m=new vo(I,M,function(t){return function(){var n=s*b;return"BigInt"in e&&n>Number.MAX_SAFE_INTEGER&&(n=BigInt(s)*BigInt(b)),n=Kf(w,S,i,t.mh,T,n),hi(x(),[n],A())}}(m),0,null,r,E,p,h(),[],"",null,null,bo,o)).codecs=t.J.codecs,m.mimeType=t.J.mimeType,0==u?0<k&&m.Pc():0!=k%u&&m.Pc(),d.push(m)}return(l=new vo(l,c,(function(){if(f)return[];var t=s*b;return"BigInt"in e&&t>Number.MAX_SAFE_INTEGER&&(t=BigInt(s)*BigInt(b)),t=Kf(w,S,i,null,T,t),hi(x(),[t],A())}),0,null,r,E,p,h(),d,"",null,null,bo,o,0<d.length)).codecs=t.J.codecs,l.mimeType=t.J.mimeType,l.bandwidth=t.bandwidth,l.j=a,l}function d(){var e=[Math.max(f.qb(),p),Math.min(f.Yb(),h())].map((function(e){return e-p}));return e=[Math.ceil(e[0]/v),Math.ceil(e[1]/v)-1],t.J.Wa&&e[1]++,e.map((function(e){return e+y}))}function h(){var e=null!=g&&a[g]||m;return e?p+e:1/0}var f=t.presentationTimeline,p=t.ka.start,g=t.oa.id,m=t.ka.duration,v=n.Qa,y=n.zd,b=n.timescale,w=n.cc,T=t.bandwidth||null,S=t.J.id,x=t.J.Oa,A=t.ob,E=p-n.Pb,k=d();i=t.xb?Math.max(k[0],k[1]-i+1):k[0],s=s||k[1],k=[];for(var I=i;I<=s;++I){var M=c(I);k.push(M)}var C=new Zs(k);if(k=f.Yb()<h(),I=f.U(),k||I){var D=Math.max(i,s+1);i=v,t.J.Wa&&(i=.1),C.ue(i,(function(){var e=f.qb();C.Ha(e);var t=l(d());t.next(),t=t.next().value;for(var n=[];D<=t;){var i=c(D);n.push(i),D++}return e>h()&&!n.length?null:n}))}return Promise.resolve(C)}(f,h,a,d,o,s,u,t.J.oe)}};var p=null;r=r=null,t.oa.id&&t.J.id&&(r=i[r=t.oa.id+","+t.J.id])&&(p=r.segmentIndex);var g=t.ka.start,m=t.ka.duration?g+t.ka.duration:1/0,v=!(t.xb&&t.ka.uf);return p?(fp(i=p,h,g,m,v,d),i.Ha(t.presentationTimeline.qb())):p=new hp(h,t.J.id,t.bandwidth,t.J.Oa,t.ob,g,m,d,v,s,t.J.oe),h.timeline&&"image"!==t.ha.contentType&&"text"!==t.ha.contentType&&t.presentationTimeline.Rg(h.timeline,g),r&&t.xb&&(r.segmentIndex=p),{nc:function(){return p instanceof hp&&0==p.getNumReferences()&&fp(p,h,g,m,v,d),Promise.resolve(p)}}}function dp(e){return e.ec}function hp(e,t,n,i,r,a,o,s,u,l,c){Zs.call(this,[]),this.h=e,this.F=t,this.B=n,this.C=i,this.H=r,this.j=a,this.l=o,this.s=s,this.A=l,this.G=c,u&&pp(this)}function fp(e,t,n,i,r,a){if(function(e,t){if(e.s!==t){e.s=t;for(var n=(e=l(e.g)).next();!n.done;n=e.next())(n=n.value)&&yo(n,t)}}(e,a),e.h){if(n=e.h.timeline,e.h.cc!==t.cc&&(e.h.cc=t.cc),n.length){var o=n[n.length-1];t=t.timeline.filter((function(e){return e.end>o.end}))}else t=t.timeline.slice();0<t.length&&e.h.timeline.push.apply(e.h.timeline,c(t)),e.l!==i&&(e.l=i)}else e.h=t,e.j=n,e.l=i;r&&pp(e)}function pp(e){if(!e.o){for(var t=e.h.timeline;t.length&&t[t.length-1].start>=e.l;)t.pop();e.Ha(e.j)}}function gp(e,t,n,i,r,a,o,s){return e=Kf(e,t,n,a,i||null,r),hi(o(),[e],s()).map((function(e){return e.toString()}))}function mp(e){this.o=null,this.A=e,this.G=new ea,this.i=[],this.h=null,this.m=[],this.B=null,this.F=[],this.C=300,this.l=new Map,this.j=new Map,this.g=null,this.s="UNKNOWN"}function vp(e,t){var n,i,r,a,o,s,u;return P((function(l){return 1==l.g?(n=hi(e.i,[yp(e,t)]),i=aa(n,e.o.retryParameters),r=e.A.networkingEngine.request(8,i),ta(e.G,r),S(l,2),w(l,r.promise,4)):2!=l.g?(a=l.h,o=dt(a.data),1==(s=JSON.parse(o)).VERSION&&function(e,t,n){null!=e.g&&(e.g.stop(),e.g=null);var i=t["RELOAD-URI"]||n;e.g=new Be((function(){vp(e,i)})),(n=t.TTL)&&(e.C=n),e.g.$(e.C),e.m=t["PATHWAY-PRIORITY"]||[],e.F=t["PATHWAY-CLONES"]||[]}(e,s,a.uri),A(l,0)):(u=E(l))&&7001==u.code?l.return():(null!=e.g&&(e.g.stop(),e.g=null),e.g=new Be((function(){vp(e,t)})),e.g.$(e.C),void T(l))}))}function yp(e,t){if(!e.m.length)return t;t=new Gn(t);var n=e.B||e.m[0],i=Math.round(e.A.getBandwidthEstimate()),r=t.g;return"DASH"==e.s?(r.add("_DASH_pathway",n),r.add("_DASH_throughput",String(i))):"HLS"==e.s&&(r.add("_HLS_pathway",n),r.add("_HLS_throughput",String(i))),ri(r)&&zn(t,r),t.toString()}function bp(e,t,n,i){var r=e.l.get(t);r||(r=new Map),r.set(n,i),e.l.set(t,r)}function wp(e,t,n){n=void 0!==n&&n,t=e.l.get(t)||new Map;for(var i=[],r=l(e.m),a=r.next(),o={};!a.done;o={Tc:void 0},a=r.next())if(o.Tc=a.value,a=t.get(o.Tc))i.push({Hf:o.Tc,location:a});else if(a=e.F.find(function(e){return function(t){return t.Aj==e.Tc}}(o))){var s=t.get(a["BASE-ID"]);s&&(a["URI-REPLACEMENT"].uh?(Xn(s=new Gn(s),a["URI-REPLACEMENT"].uh),i.push({Hf:o.Tc,location:s.toString()})):i.push({Hf:o.Tc,location:s}))}for(r=Date.now(),a=(o=l(e.j.keys())).next();!a.done;a=o.next())a=a.value,r>(s=e.j.get(a))&&e.j.delete(a);if(i=i.filter((function(t){for(var n=l(e.j.keys()),i=n.next();!i.done;i=n.next())if(i.value.includes(new Gn(t.location).Fb))return!1;return!0})),i.length&&(e.B=i[0].Hf),i=i.map((function(e){return e.location})),!i.length&&e.h)for(o=(r=l(e.h.split(","))).next();!o.done;o=r.next())(o=t.get(o.value))&&(e.B=e.h,i.push(o));if(!i.length)for(r=(t=l(t.values())).next();!r.done;r=t.next())i.push(r.value);return n?i:hi(e.i,i)}function Tp(){this.l=[],this.h=[],this.g=[],this.j=[],this.i=[],this.s=this.o=!1,this.m=new Set}function Sp(e,t){for(var n=[],i=[],r=[],a=[],o=(e=l(e)).next();!o.done;o=e.next()){var s=o.value;o=new Map(s.audioStreams.map((function(e){return[Wp(e),e]})));var u=new Map(s.videoStreams.map((function(e){return[zp(e),e]}))),c=new Map(s.textStreams.map((function(e){return[Yp(e),e]})));if(s=new Map(s.imageStreams.map((function(e){return[Jp(e),e]}))),t){var d=Gp(yi);c.set(Yp(d),d),d=Gp("image"),s.set(Jp(d),d)}n.push(o),i.push(u),r.push(c),a.push(s)}return{lg:n,sh:i,oh:r,Hg:a}}function xp(e){var t,n,i,r,a,o,s,u,c,d,h,f,p,g,m,v,y,b,T,S,x,A,E,k,I,M,C,D,R;return P((function(P){switch(P.g){case 1:if(t=bi,1==e.length)return P.return(e[0]);for(n=e.map((function(e){return new Map(e.filter((function(e){return e.type===t.V})).map((function(e){return[Wp(e),e]})))})),i=e.map((function(e){return new Map(e.filter((function(e){return e.type===t.la})).map((function(e){return[zp(e),e]})))})),r=e.map((function(e){return new Map(e.filter((function(e){return e.type===t.wa})).map((function(e){return[Yp(e),e]})))})),a=e.map((function(e){return new Map(e.filter((function(e){return e.type===t.He})).map((function(e){return[Jp(e),e]})))})),o=l(r),s=o.next();!s.done;s=o.next())u=s.value,c=Hp(t.wa),u.set(Yp(c),c);for(d=l(a),h=d.next();!h.done;h=d.next())f=h.value,p=Hp(t.He),f.set(Jp(p),p);return w(P,Ap(g=new Tp,[],n,0,Cp,Rp,0),2);case 2:return m=P.h,w(P,Ap(g,[],i,0,Cp,Rp,0),3);case 3:return v=P.h,w(P,Ap(g,[],r,0,Cp,Rp,0),4);case 4:return y=P.h,w(P,Ap(g,[],a,0,Cp,Rp,0),5);case 5:if(b=P.h,T=0,v.length&&m.length)for(E=l(m),k=E.next();!k.done;k=E.next())for(I=k.value,M=l(v),C=M.next();!C.done;C=M.next())D=C.value,R=T++,D.variantIds.push(R),I.variantIds.push(R);else for(S=v.concat(m),x=l(S),A=x.next();!A.done;A=x.next())A.value.variantIds=[T++];return P.return(v.concat(m).concat(y).concat(b))}}))}function Ap(e,t,n,i,r,a,o){var s,u,c,d,h,f,p,g,m,v,y,b,T,S,x,A,E,k;return P((function(I){switch(I.g){case 1:for(s=[],u=0;u<n.length;u++)u>=i?s.push(new Set(n[u].values())):s.push(new Set);c=l(t),d=c.next();case 2:if(d.done){I.u(4);break}return h=d.value,w(I,function(e,t,n,i,r,a,o){return P((function(s){return 1==s.g?(Pp(e,n,t,0<o),t.matchedStreams?t.segmentIndex?w(s,Ep(t,i+o),2):s.u(2):s.return(!1)):(Ip(t,i,r,a,o),s.return(!0))}))}(e,h,n,i,a,s,o),5);case 5:if(!I.h)throw new De(2,4,4037);d=c.next(),I.u(2);break;case 4:for(f=l(s),p=f.next();!p.done;p=f.next())for(g=p.value,m=l(g),v=m.next();!v.done;v=m.next())y=v.value,(b=kp(e,y,n,r,a,s))&&t.push(b);for(T=l(s),S=T.next();!S.done;S=T.next())for(x=S.value,A=l(x),E=A.next(),k={};!E.done;k={Wf:void 0},E=A.next())if(k.Wf=E.value,!qp(k.Wf)&&t.some(function(t){return function(n){return jp(e,t.Wf,n)}}(k)))throw new De(2,4,4037);return I.return(t)}}))}function Ep(e,t){var n,i,r,a,o,s;return P((function(u){if(1==u.g){for(n=[],i=e.matchedStreams,r=t;r<i.length;r++)a=i[r],n.push(a.createSegmentIndex()),a.trickModeVideo&&!a.trickModeVideo.segmentIndex&&n.push(a.trickModeVideo.createSegmentIndex());return w(u,Promise.all(n),2)}if(e.segmentIndex instanceof iu)for(o=t;o<i.length;o++)(s=i[o]).segmentIndex&&e.segmentIndex.h.push(s.segmentIndex);T(u)}))}function kp(e,t,n,i,r,a){if(qp(t))return null;var o=i(t);return Pp(e,n,o),o.createSegmentIndex&&(o.createSegmentIndex=function(){return P((function(e){return o.segmentIndex?e.u(0):(o.segmentIndex=new iu,w(e,Ep(o,0),0))}))}),o.matchedStreams&&o.matchedStreams.length?(Ip(o,0,r,a,0),o):null}function Ip(e,t,n,i,r){var a=e.matchedStreams;for(t+=r;t<a.length;t++){var o=a[t];n(e,o);var s=!0;if("audio"==e.type&&0==Ji(e.language,o.language)&&(s=!1),s&&(i[t-r].delete(o),o.fullMimeTypes))for(s=(o=l(o.fullMimeTypes.values())).next();!s.done;s=o.next())e.fullMimeTypes.add(s.value)}}function Mp(e){var t=Object.assign({},e);return t.originalId=null,t.createSegmentIndex=function(){return Promise.resolve()},t.closeSegmentIndex=function(){if(t.segmentIndex&&(t.segmentIndex.release(),t.segmentIndex=null),t.matchedStreams)for(var e=l(t.matchedStreams),n=e.next();!n.done;n=e.next())(n=n.value).segmentIndex&&(n.segmentIndex.release(),n.segmentIndex=null)},t.roles=t.roles.slice(),t.segmentIndex=null,t.emsgSchemeIdUris=[],t.keyIds=new Set,t.closedCaptions=e.closedCaptions?new Map(e.closedCaptions):null,t.trickModeVideo=null,t}function Cp(e){var t=Object.assign({},e);return t.roles=t.roles.slice(),t.keyIds=new Set,t.segments=[],t.variantIds=[],t.closedCaptions=e.closedCaptions?new Map(e.closedCaptions):null,t}function Dp(e,t){function n(e,t){e||(e=[]);for(var n=(t=l(t)).next();!n.done;n=t.next())n=n.value,e.includes(n)||e.push(n);return e}e.roles=n(e.roles,t.roles),t.emsgSchemeIdUris&&(e.emsgSchemeIdUris=n(e.emsgSchemeIdUris,t.emsgSchemeIdUris));for(var i=l(t.keyIds),r=i.next();!r.done;r=i.next())e.keyIds.add(r.value);if(null==e.originalId?e.originalId=t.originalId:(i=t.originalId||"")&&!e.originalId.endsWith(i)&&(e.originalId+=","+i),i=Ne(e.drmInfos,t.drmInfos),t.drmInfos.length&&e.drmInfos.length&&!i.length)throw new De(2,4,4038);if(e.drmInfos=i,e.encrypted=e.encrypted||t.encrypted,t.closedCaptions)for(e.closedCaptions||(e.closedCaptions=new Map),r=(i=l(t.closedCaptions)).next();!r.done;r=i.next()){var a=l(r.value);r=a.next().value,a=a.next().value,e.closedCaptions.set(r,a)}e.bandwidth&&t.bandwidth&&(e.bandwidth=Math.max(e.bandwidth,t.bandwidth)),t.trickModeVideo?(e.trickModeVideo||(e.trickModeVideo=Mp(t.trickModeVideo),e.trickModeVideo.matchedStreams=[],e.trickModeVideo.createSegmentIndex=function(){if(e.trickModeVideo.segmentIndex)return Promise.resolve();for(var t=new iu,n=l(e.trickModeVideo.matchedStreams),i=n.next();!i.done;i=n.next())t.h.push(i.value.segmentIndex);return e.trickModeVideo.segmentIndex=t,Promise.resolve()}),e.trickModeVideo.matchedStreams.push(t.trickModeVideo),Dp(e.trickModeVideo,t.trickModeVideo)):e.trickModeVideo&&(e.trickModeVideo.matchedStreams.push(t),Dp(e.trickModeVideo,t))}function Rp(e,t){var n=e.roles;n||(n=[]);for(var i=l(t.roles),r=i.next();!r.done;r=i.next())r=r.value,n.includes(r)||n.push(r);for(e.roles=n,i=(n=l(t.keyIds)).next();!i.done;i=n.next())e.keyIds.add(i.value);if(e.encrypted=e.encrypted&&t.encrypted,e.segments.push.apply(e.segments,c(t.segments)),t.closedCaptions)for(e.closedCaptions||(e.closedCaptions=new Map),n=(t=l(t.closedCaptions)).next();!n.done;n=t.next())n=(i=l(n.value)).next().value,i=i.next().value,e.closedCaptions.set(n,i)}function Pp(e,t,n,i){i=void 0!==i&&i?n.matchedStreams:[];for(var r=(t=l(t)).next();!r.done;r=t.next()){if(!(r=Lp(e,r.value,n)))return;i.push(r)}n.matchedStreams=i}function Lp(e,t,n){var i={audio:Wp,video:zp,text:Yp,image:Jp}[n.type],r=null,a=i(n);if(t.has(a))r=t.get(a);else{a={audio:function(t,n){return jp(e,t,n)},video:function(t,n){return jp(e,t,n)},text:Op,image:Up}[n.type];for(var o={audio:_p,video:Bp,text:Fp,image:Vp}[n.type],s=l(t.values()),u=s.next();!u.done;u=s.next())!a(n,u=u.value)||n.fastSwitching!=u.fastSwitching||r&&!o(n,r,u)||(r=u)}return e.s&&!qp(r)&&t.delete(i(r)),r}function Np(e,t){return e.mimeType==t.mimeType&&$p(e.codecs)===$p(t.codecs)}function jp(e,t,n){return!(!Np(t,n)&&!e.o||t.drmInfos&&!Le(t.drmInfos,n.drmInfos))}function Op(e,t){return!t.language||e.forced===t.forced&&0!=Ji(e.language,t.language)&&t.kind==e.kind}function Up(){return!0}function _p(e,t,n){var i=Np(e,t),r=Np(e,n);if(i&&!r)return!1;if(!i&&r)return!0;if(i=Ji(e.language,t.language),(r=Ji(e.language,n.language))>i)return!0;if(r<i)return!1;if(t.label!==n.label){if(e.label===t.label)return!1;if(e.label===n.label)return!0}if(e.roles.length){if(i=t.roles.filter((function(t){return e.roles.includes(t)})),(r=n.roles.filter((function(t){return e.roles.includes(t)}))).length>i.length)return!0;if(r.length<i.length)return!1;if(n.roles.length!==t.roles.length)return n.roles.length<t.roles.length}else{if(!n.roles.length&&t.roles.length)return!0;if(n.roles.length&&!t.roles.length)return!1}return!(t.primary||!n.primary)||!(t.primary&&!n.primary)&&((i=Kp(e.channelsCount,t.channelsCount,n.channelsCount))==Qp||i!=eg&&((i=Kp(e.audioSamplingRate,t.audioSamplingRate,n.audioSamplingRate))==Qp||i!=eg&&!(!e.bandwidth||Xp(e.bandwidth,t.bandwidth,n.bandwidth)!=Qp)))}function Bp(e,t,n){var i=Np(e,t),r=Np(e,n);if(i&&!r)return!1;if(!i&&r)return!0;if((i=Kp(e.width*e.height,t.width*t.height,n.width*n.height))==Qp)return!0;if(i==eg)return!1;if(e.frameRate){if((i=Kp(e.frameRate,t.frameRate,n.frameRate))==Qp)return!0;if(i==eg)return!1}return!(!e.bandwidth||Xp(e.bandwidth,t.bandwidth,n.bandwidth)!=Qp)}function Fp(e,t,n){var i=Ji(e.language,t.language),r=Ji(e.language,n.language);if(r>i)return!0;if(r<i)return!1;if(!t.primary&&n.primary)return!0;if(t.primary&&!n.primary)return!1;if(t.label!==n.label){if(e.label===t.label)return!1;if(e.label===n.label)return!0}if(e.roles.length){if(i=t.roles.filter((function(t){return e.roles.includes(t)})),(r=n.roles.filter((function(t){return e.roles.includes(t)}))).length>i.length)return!0;if(r.length<i.length)return!1}else{if(!n.roles.length&&t.roles.length)return!0;if(n.roles.length&&!t.roles.length)return!1}return n.mimeType==e.mimeType&&n.codecs==e.codecs&&(t.mimeType!=e.mimeType||t.codecs!=e.codecs)}function Vp(e,t,n){return Kp(e.width*e.height,t.width*t.height,n.width*n.height)==Qp}function Hp(e){return{id:0,originalId:"",groupId:null,primary:!1,type:e,mimeType:"",codecs:"",language:"",originalLanguage:null,label:null,width:null,height:null,encrypted:!1,keyIds:new Set,segments:[],variantIds:[],roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,external:!1,fastSwitching:!1,isAudioMuxedInVideo:!1}}function Gp(e){return{id:0,originalId:"",groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new Zs([]),mimeType:"",codecs:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"",originalLanguage:null,label:null,type:e,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set,isAudioMuxedInVideo:!1}}function Kp(e,t,n){if(t==e&&e!=n)return eg;if(n==e&&e!=t)return Qp;if(t>e){if(n<=e||n-e<t-e)return Qp;if(n-e>t-e)return eg}else{if(n>e)return eg;if(e-n<e-t)return Qp;if(e-n>e-t)return eg}return Zp}function Xp(e,t,n){return t=Math.abs(e-t),(e=Math.abs(e-n))<t?Qp:t<e?eg:Zp}function qp(e){switch(e.type){case yi:return!e.language;case"image":return!e.tilesLayout;default:return!1}}function zp(e){return JSON.stringify([e.fastSwitching,e.width,e.frameRate,$p(e.codecs),e.mimeType,e.label,e.roles,e.closedCaptions?Array.from(e.closedCaptions.entries()):null,e.bandwidth])}function Wp(e){return JSON.stringify([e.fastSwitching,e.channelsCount,e.language,e.bandwidth,e.label,$p(e.codecs),e.mimeType,e.roles,e.audioSamplingRate,e.primary])}function Yp(e){return JSON.stringify([e.language,e.label,e.codecs,e.mimeType,e.bandwidth,e.roles])}function Jp(e){return JSON.stringify([e.width,e.codecs,e.mimeType])}function $p(e){if(!tg.has(e)){var t=Mi(e);tg.set(e,t)}return tg.get(e)}m(hp,Zs),(i=hp.prototype).getNumReferences=function(){return this.h?this.h.timeline.length:0},i.release=function(){Zs.prototype.release.call(this),this.h=null},i.Ha=function(e){if(this.h){for(var t=0,n=this.h.timeline,i=0;i<n.length&&n[i].end+this.j<=e;i+=1)t+=1;0<t&&(this.h.timeline=n.slice(t),this.g.length>=t&&(this.g=this.g.slice(t)),this.i+=t,0===this.getNumReferences()&&this.release())}},i.find=function(e){if(this.h&&this.h.timeline&&this.h.timeline.length&&e<this.h.timeline[0].start+this.j)return this.i;if(!this.h)return null;var t=this.h.timeline;if(e<this.j||e>=this.l)return null;for(var n=t.length-1,i=0;i<t.length;i++){var r=t[i],a=r.start+this.j;if(r=i<n?t[i+1].start+this.j:1/0===this.l?r.end+this.j:this.l,e>=a&&e<r)return i+this.i}return null},i.get=function(e){var t=this;if(0>(e-=this.i)||e>=this.getNumReferences()||!this.h)return null;var n=this.g[e];if(!n){var i=this.h.timeline[e],r=i.Wi,a=this.h.cg+i.dg;n=this.j-this.h.Pb;var o=this.j+i.end,s=o;e===this.getNumReferences()-1&&1/0!==this.l&&(s=this.l);for(var u=this.h.codecs,l=this.h.mimeType,c=this.h.bandwidth,d=[],h=(i.end-i.start)/i.Cb,f={},p=0;p<i.Cb;f={we:void 0,nh:void 0},p++){var g=i.start+h*p,m=g+h;f.nh=p+1,f.we=null,(f=new vo(this.j+g,this.j+m,function(e){return function(){return t.h?(null==e.we&&(e.we=gp(t.h.cc,t.F,r,t.B,a,e.nh,t.C,t.H)),e.we):[]}}(f),0,null,this.s,n,this.j,this.l,[],"",null,null,bo,this.A)).codecs=u,f.mimeType=l,f.bandwidth=c,0==this.G?0<p&&f.Pc():0!=p%this.G&&f.Pc(),d.push(f)}(n=new vo(this.j+i.start,s,(function(){return 0<i.Cb||!t.h?[]:gp(t.h.cc,t.F,r,t.B,a,null,t.C,t.H)}),0,null,this.s,n,this.j,this.l,d,"",null,null,bo,this.A,0<i.Cb)).codecs=u,n.mimeType=l,n.j=o,n.bandwidth=c,this.g[e]=n}return n},i.yb=function(e){pp(this);for(var t=0;t<this.getNumReferences();t++){var n=this.get(t+this.i);n&&e(n)}},mp.prototype.configure=function(e){this.o=e},mp.prototype.destroy=function(){return this.A=this.o=null,this.i=[],this.h=null,this.m=[],this.F=[],this.l.clear(),null!=this.g&&(this.g.stop(),this.g=null),this.G.destroy()},mp.prototype.setManifestType=function(e){this.s=e},mp.prototype.banLocation=function(e){this.j.set(e,Date.now()+6e4)},(i=Tp.prototype).release=function(){for(var e=l(this.h.concat(this.g,this.j,this.i)),t=e.next();!t.done;t=e.next())(t=t.value).segmentIndex&&t.segmentIndex.release();this.h=[],this.g=[],this.j=[],this.i=[],this.l=[],this.s=this.o=!1,this.m.clear()},i.ii=function(){return this.l},i.mf=function(){return this.j.slice()},i.Rh=function(){return this.i},i.sg=function(e,t){if(e){if("audio"==e.type)for(var n=l(this.h),i=n.next();!i.done;i=n.next())(i=i.value).matchedStreams=i.matchedStreams.filter((function(t){return t!==e}));else if("video"==e.type)for(i=(n=l(this.g)).next();!i.done;i=n.next())(i=i.value).matchedStreams=i.matchedStreams.filter((function(t){return t!==e})),i.trickModeVideo&&(i.trickModeVideo.matchedStreams=i.trickModeVideo.matchedStreams.filter((function(t){return t!==e})));else if(e.type==yi)for(i=(n=l(this.j)).next();!i.done;i=n.next())(i=i.value).matchedStreams=i.matchedStreams.filter((function(t){return t!==e}));else if("image"==e.type)for(i=(n=l(this.i)).next();!i.done;i=n.next())(i=i.value).matchedStreams=i.matchedStreams.filter((function(t){return t!==e}));e.segmentIndex&&e.closeSegmentIndex(),this.m.delete(t)}},i.Ne=function(e,t,n){n=void 0!==n&&n;var i,r,a,o,s,u,c,d,h,f,p,g,m,v,y,b,S,x,A,E,k,I,M,C,D,R,L,N,j,O,U=this;return P((function(P){if(1==P.g){if(i=bi,!t&&1==e.length)return r=Sp(e,!1),a=r.lg,o=r.sh,s=r.oh,u=r.Hg,U.h=Array.from(a[0].values()),U.g=Array.from(o[0].values()),U.j=Array.from(s[0].values()),U.i=Array.from(u[0].values()),P.u(2);for(c=n?U.m.size:0,d=-1,h=0;h<e.length;h++)f=e[h],U.m.has(f.id)||(U.m.add(f.id),-1==d&&(d=h));return-1==d?P.return():(p=Sp(e,!0),g=p.lg,m=p.sh,v=p.oh,y=p.Hg,w(P,Promise.all([Ap(U,U.h,g,d,Mp,Dp,c),Ap(U,U.g,m,d,Mp,Dp,c),Ap(U,U.j,v,d,Mp,Dp,c),Ap(U,U.i,y,d,Mp,Dp,c)]),2))}if(b=0,S=[],U.g.length&&U.h.length)for(M=l(U.h),C=M.next();!C.done;C=M.next())for(D=C.value,R=l(U.g),L=R.next();!L.done;L=R.next())N=L.value,j=Ne(D.drmInfos,N.drmInfos),D.drmInfos.length&&N.drmInfos.length&&!j.length||(O=b++,S.push({id:O,language:D.language,disabledUntilTime:0,primary:D.primary,audio:D,video:N,bandwidth:(D.bandwidth||0)+(N.bandwidth||0),drmInfos:j,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]}));else for(x=U.g.length?U.g:U.h,A=l(x),E=A.next();!E.done;E=A.next())k=E.value,I=b++,S.push({id:I,language:k.language,disabledUntilTime:0,primary:k.primary,audio:k.type==i.V?k:null,video:k.type==i.la?k:null,bandwidth:k.bandwidth||0,drmInfos:k.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});U.l=S,T(P)}))},i.bh=function(e){this.o=e},i.ih=function(e){this.s=e},F("shaka.util.PeriodCombiner",Tp),Tp.prototype.setUseStreamOnce=Tp.prototype.ih,Tp.prototype.setAllowMultiTypeVariants=Tp.prototype.bh,Tp.prototype.combinePeriods=Tp.prototype.Ne,Tp.prototype.deleteStream=Tp.prototype.sg,Tp.prototype.getImageStreams=Tp.prototype.Rh,Tp.prototype.getTextStreams=Tp.prototype.mf,Tp.prototype.getVariants=Tp.prototype.ii;var Qp=1,Zp=0,eg=-1,tg=new Map;function ng(e,t){try{return function(e,t){var n=new DOMParser,i=ig.value()(e);e=null;try{e=n.parseFromString(i,"text/xml")}catch(e){return null}if(!(n=e.documentElement)||n.getElementsByTagName("parsererror").length||n.tagName!=t)return null;if(!("createNodeIterator"in document))return n;for(t=document.createNodeIterator(e,NodeFilter.SHOW_ALL);e=t.nextNode();)if(e instanceof HTMLElement||e instanceof SVGElement)return null;return n}(ft(e),t)}catch(e){return null}}var ig=new Pe((function(){if("undefined"!=typeof trustedTypes){var e=trustedTypes.createPolicy("shaka-player#xml",{createHTML:function(e){return e}});return function(t){return e.createHTML(t)}}return function(e){return e}}));function rg(){var e=this;this.j=this.g=null,this.A=[],this.i=null,this.na=1,this.F=[],this.l={ae:"",type:"",profiles:[],Mb:null,Wa:0,Oa:null,xd:0},this.s=new Map,this.o={},this.B={},this.ja={},this.m=new Tp,this.K=0,this.ra=new G(5),this.L=new Be((function(){e.I&&!e.g.continueLoadingWhenPaused&&(e.G.cb(e.I,"timeupdate"),e.I.paused)?e.G.pa(e.I,"timeupdate",(function(){return yg(e)})):yg(e)})),this.S=new ea,this.O=null,this.C=[],this.da=1/0,this.H=!1,this.h=null,this.M=0,this.ga=!1,this.G=new Z,this.I=null,this.Y=!1,this.aa="",this.fa=function(){return!1},this.Z=[]}function ag(e){var t,n,i,r,a,o,s,u,d,h,f;return P((function(p){return 1==p.g?(t=4,n="MPD",i=function(e){var t=e.l.xd;if(!e.l.ae||!t||!e.F.length)return[];var n=Date.now()/1e3,i=e.F.filter((function(e){return!(e=Yt(e.attributes.ttl))||t+e>n})).map(Ot).filter(Gi);return i.length?hi(e.A,i):[]}(e),r=e.A,i.length?(r=i,n="Patch",t=6):1<e.A.length&&e.h&&(a=wp(e.h,"Location",!0)).length&&(r=a),o=aa(r,e.g.retryParameters),s=Date.now(),w(p,Eg(e,o,0,{type:t}),2)):3!=p.g?(u=p.h,e.j?(u.uri&&u.uri!=u.originalUri&&!e.A.includes(u.uri)&&e.A.unshift(u.uri),d=new Gn(u.uri),e.aa=d.g.toString(),w(p,function(e,t,n,i){var r,a,o,s,u,d,h,f;return P((function(p){if(1==p.g){if(r=t,(a=e.g.dash.manifestPreprocessor)!=dl){if(oe("manifest.dash.manifestPreprocessor configuration","Please Use manifest.dash.manifestPreprocessorTXml instead."),!(o=ng(r,i)))throw new De(2,4,4001,n);a(o),r=pt(o.outerHTML)}if(!(s=Ct(r,i)))throw new De(2,4,4001,n);return(u=e.g.dash.manifestPreprocessorTXml)!=hl&&u(s),"Patch"===i?p.return(function(e,t){var n,i,r,a,o,s,u,d,h,f,p,g,m,v,y,b,S,x,A,E,k,I,M,C;return P((function(D){if(1==D.g){if(n=t.attributes.mpdId,i=Ft(t,"originalPublishTime",Kt),!n||n!==e.l.ae||i!==e.l.xd)throw e.F=[],new De(1,4,4052);for(r=[],a=[],o=new Set,s=l(Lt(t)),u=s.next();!u.done;u=s.next())if(d=u.value,h=Zt(d.attributes.sel||""),f=h[h.length-1],p=Ot(d)||"","MPD"===f.name)if("mediaPresentationDuration"===f.Ub){var R=Xt(Ot(d)||"");if(null!=R){e.l.Mb=R;for(var P=l(e.s.values()),L=P.next();!L.done;L=P.next())L.value.Mb=R}}else if("type"===f.Ub){for(e.i.presentationTimeline.Bc("static"==p),e.l.type=p,P=(R=l(e.s.values())).next();!P.done;P=R.next())P.value.xb="dynamic"==p;"static"==p&&(e.K=-1)}else"publishTime"===f.Ub?e.l.xd=Kt(p)||0:null===f.Ub&&"add"===d.tagName&&a.push(d);else if("PatchLocation"===f.name)en(e.F,d);else if("Period"===f.name)"add"===d.tagName?a.push(d):"remove"===d.tagName&&f.id&&lg(e,f.id);else if("SegmentTemplate"===f.name){if((R=(P=Zt(d.attributes.sel||""))[P.length-1]).Ub){P=cg(e,P),L=Ot(d)||"";for(var N=l(P),j=N.next();!j.done;j=N.next())nn((j=e.s.get(j.value)).J.ec,d.tagName,R.Ub,L);R=P}else R=[];for(g=l(R),m=g.next();!m.done;m=g.next())v=m.value,o.add(v)}else if("SegmentTimeline"===f.name||"S"===f.name){for(R=Zt(d.attributes.sel||""),L=(P=l(R=cg(e,R))).next();!L.done;L=P.next())en(N=Nt(L=Wf(L=e.s.get(L.value),dp,"SegmentTimeline"),"S"),d),L.children=N;for(y=l(R),b=y.next();!b.done;b=y.next())S=b.value,o.add(S)}for(x=l(o),A=x.next();!A.done;A=x.next())E=A.value,dg(e,E);for(k=l(a),I=k.next();!I.done;I=k.next())M=I.value,r.push.apply(r,c(ug(e,M)));return r.length?(e.i.periodCount+=r.length,e.i.gapCount=e.M,w(D,sg(e,r,!0),2)):D.u(2)}"static"==e.l.type&&(C=e.l.Mb,e.i.presentationTimeline.bb(C||1/0)),T(D)}))}(e,s)):e.g.dash.disableXlinkProcessing?p.return(og(e,s,n)):(d=e.g.dash.xlinkFailGracefully,h=Yf(s,e.g.retryParameters,d,n,e.j.networkingEngine),ta(e.S,h),w(p,h.promise,2))}return f=p.h,p.return(og(e,f,n))}))}(e,u.data,u.uri,n),3)):p.return(0)):(h=Date.now(),f=(h-s)/1e3,e.ra.sample(1,f),p.return(f))}))}function og(e,t,n){var i,r,a,o,s,u,c,d,h,f,p,g,m,v,y,b,x,k,I,M,C,D,R,L,N,j,O,U,_,B,F,V,H,G,K,X,q,z,Y,J,$,Q,Z,ee,te,ne,ie,re,ae,oe,se;return P((function(ue){switch(ue.g){case 1:for(e.h&&e.h.l.clear(),i=[n],r=[],a=new Map,o=Nt(t,"Location"),s=l(o),u=s.next();!u.done;u=s.next())c=u.value,d=c.attributes.serviceLocation,(h=Ot(c))&&(f=hi(i,[h])[0],d&&(e.h?bp(e.h,"Location",d,f):a.set(d,f)),r.push(f));if(e.h?0<(p=wp(e.h,"Location",!0)).length&&(i=e.A=p):r.length&&(i=e.A=r),e.l.ae=t.attributes.id||"",e.l.xd=Ft(t,"publishTime",Kt)||0,e.F=Nt(t,"PatchLocation"),g=Promise.resolve(),(m=_t(t,"ContentSteering"))&&e.j)for(v=m.attributes.defaultServiceLocation,e.h?(e.h.i=i,e.h.h=v):(e.h=new mp(e.j),e.h.configure(e.g),e.h.setManifestType("DASH"),e.h.i=i,e.h.h=v,(y=Ot(m))&&(Ft(m,"queryBeforeStart",$t,!1)?g=vp(e.h,y):vp(e.h,y))),b=l(a.keys()),x=b.next();!x.done;x=b.next())k=x.value,I=a.get(k),bp(e.h,"Location",k,I);if(M=Nt(t,"BaseURL"),C=!1,e.h)for(D=l(M),R=D.next();!R.done;R=D.next())L=R.value,N=L.attributes.serviceLocation,j=Ot(L),N&&j&&(bp(e.h,"BaseURL",N,j),C=!0);if(e.Z=null,C&&e.h||(O=M.map(Ot),e.Z=hi(i,O)),U=function(){return e.h&&C?wp(e.h,"BaseURL"):e.Z?e.Z:[]},e.l.Oa=U,_=0,M&&M.length&&(_=Ft(M[0],"availabilityTimeOffset",Jt)||0),e.l.Wa=_,B=e.g.dash.ignoreMinBufferTime,F=0,B||(F=Ft(t,"minBufferTime",Xt)||0),e.K=Ft(t,"minimumUpdatePeriod",Xt,-1),V=Ft(t,"availabilityStartTime",Kt),H=Ft(t,"timeShiftBufferDepth",Xt),G=e.g.dash.ignoreSuggestedPresentationDelay,K=null,G||(K=Ft(t,"suggestedPresentationDelay",Xt)),X=e.g.dash.ignoreMaxSegmentDuration,q=null,X||(q=Ft(t,"maxSegmentDuration",Xt)),z=t.attributes.type||"static",e.i&&e.i.presentationTimeline&&(e.Y=e.i.presentationTimeline.U()&&"static"==z),e.l.type=z,e.i)for(Y=e.i.presentationTimeline,J=l(Object.values(e.o)),$=J.next();!$.done;$=J.next())(Q=$.value).segmentIndex&&Q.segmentIndex.Ha(Y.qb());else Z=e.g.defaultPresentationDelay||1.5*F,Y=new Ls(V,null!=K?K:Z,e.g.dash.autoCorrectDrift);return Y.Bc("static"==z),Y.U()&&!isNaN(e.g.availabilityWindowOverride)&&(H=e.g.availabilityWindowOverride),null==H&&(H=1/0),Y.pe(H),ee=t.attributes.profiles||"",e.l.profiles=ee.split(","),te={xb:"static"!=z,presentationTimeline:Y,oa:null,ka:null,ha:null,J:null,bandwidth:0,pf:!1,Wa:_,Mb:null,profiles:ee.split(","),roles:null,ob:function(){return""}},e.M=0,ne=pg(e,te,U,t,!1),ie=ne.duration,re=ne.periods,("static"!=z||e.Y)&&ne.ug||Y.bb(ie||1/0),e.ga&&!e.H&&e.j.isAutoLowLatencyMode()&&(e.j.enableLowLatencyMode(),e.H=e.j.isLowLatencyMode()),e.H&&Y.dh(e.da),Y.Bf(q||1),w(ue,g,2);case 2:return e.H&&(F=0,ae=null!=K?K:e.g.defaultPresentationDelay,Y.Sf(ae)),e.i?(e.i.periodCount=re.length,e.i.gapCount=e.M,w(ue,sg(e,re,!1),4)):w(ue,e.m.Ne(re,te.xb),6);case 6:if(e.i={presentationTimeline:Y,variants:e.m.l,textStreams:e.m.mf(),imageStreams:e.m.i,offlineSessionIds:[],minBufferTime:F||0,sequenceMode:e.g.dash.sequenceMode,ignoreManifestTimestampsInSegmentsMode:!1,type:"DASH",serviceDescription:hg(t),nextUrl:fg(t),periodCount:re.length,gapCount:e.M,isLowLatency:e.ga,startTime:null},!Y.qh()){ue.u(7);break}return oe=Nt(t,"UTCTiming"),w(ue,function(e,t,n){var i,r,a,o,s,u,c,d;return P((function(h){switch(h.g){case 1:i=n.map((function(e){return{scheme:e.attributes.schemeIdUri,value:e.attributes.value}})),r=e.g.dash.clockSyncUri,!i.length&&r&&i.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:r}),a=l(i),o=a.next();case 2:if(o.done){h.u(4);break}switch(s=o.value,S(h,5),u=s.scheme,c=s.value,u){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":return h.u(7);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":return h.u(8);case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":return d=Date.parse(c),h.return(isNaN(d)?0:d-Date.now());case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":W("NTP UTCTiming scheme is not supported");break;default:W("Unrecognized scheme in UTCTiming element",u)}h.u(9);break;case 7:return w(h,Tg(e,t,c,"HEAD"),10);case 10:return h.return(h.h);case 8:return w(h,Tg(e,t,c,"GET"),11);case 11:return h.return(h.h);case 9:A(h,3);break;case 5:E(h);case 3:o=a.next(),h.u(2);break;case 4:return W("A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!"),h.return(0)}}))}(e,U,oe),8);case 8:if(se=ue.h,!e.j)return ue.return();Y.eh(se);case 7:Y.Xd();case 4:e.j.makeTextStreamsForClosedCaptions(e.i),function(e){for(var t=Object.keys(e.B).filter((function(t){return!e.C.includes(t)})),n=(t=l(t)).next();!n.done;n=t.next()){n=n.value;for(var i=!0,r=l(e.B[n]),a=r.next();!a.done;a=r.next()){a=a.value;var o=e.o[a];o&&(o.segmentIndex&&0!=o.segmentIndex.getNumReferences()?i=!1:(e.m&&e.m.sg(e.o[a],n),delete e.o[a]))}i&&delete e.B[n]}}(e),T(ue)}}))}function sg(e,t,n){var i;return P((function(r){if(1==r.g)return w(r,e.m.Ne(t,!0,n),2);e.i.variants=e.m.l,0<(i=e.m.mf()).length&&(e.i.textStreams=i),e.i.imageStreams=e.m.i,e.j.filter(e.i),T(r)}))}function ug(e,t){return pg(e,{xb:"dynamic"==e.l.type,presentationTimeline:e.i.presentationTimeline,oa:null,ka:null,ha:null,J:null,bandwidth:0,pf:!1,Wa:e.l.Wa,profiles:e.l.profiles,Mb:e.l.Mb,roles:null,ob:function(){return""}},e.l.Oa,t,!0).periods}function lg(e,t){e.i.periodCount--;for(var n=l(e.s.keys()),i=n.next();!i.done;i=n.next())(i=i.value).startsWith(t)&&(Wf(e.s.get(i),dp,"SegmentTimeline").children=[],dg(e,i),e.s.delete(i));e.C=e.C.filter((function(e){return e!==t}))}function cg(e,t){for(var n="",i="",r=-1,a="",o=(t=l(t)).next();!o.done;o=t.next())"Period"===(o=o.value).name?n=o.id:"AdaptationSet"===o.name?(i=o.id,null!==o.position&&(r=o.position)):"Representation"===o.name&&(a=o.id);if(t=[],a)t.push(n+","+a);else if(i)for(r=l(e.s.values()),e=r.next();!e.done;e=r.next())(e=e.value).oa.id===n&&e.ha.id===i&&e.J.id&&t.push(n+","+e.J.id);else if(-1<r)for(i=l(e.s.values()),e=i.next();!e.done;e=i.next())(e=e.value).oa.id===n&&e.ha.position===r&&e.J.id&&t.push(n+","+e.J.id);return t}function dg(e,t){var n=e.s.get(t),i=e.o[t];i.segmentIndex&&i.segmentIndex.Ha(e.i.presentationTimeline.qb());try{var r=cp(n,(function(t,n,i,r){return xg(e,t,n,i,r)}),e.o,!0,e.g.dash.initialSegmentLimit,e.ja,n.J.aesKey,null,!0);i.createSegmentIndex=function(){return P((function(e){if(1==e.g)return i.segmentIndex?e.u(0):w(e,r.nc(),3);i.segmentIndex=e.h,T(e)}))}}catch(e){if((t=n.J.contentType)!=yi&&"application"!=t&&"image"!=t||4002!=e.code)throw e}}function hg(e){var t=_t(e,"ServiceDescription");if(!t)return null;if(e=_t(t,"Latency"),t=_t(t,"PlaybackRate"),!e&&!t)return null;var n={};return e&&("target"in e.attributes&&(n.targetLatency=parseInt(e.attributes.target,10)/1e3),"max"in e.attributes&&(n.maxLatency=parseInt(e.attributes.max,10)/1e3),"min"in e.attributes&&(n.minLatency=parseInt(e.attributes.min,10)/1e3)),t&&("max"in t.attributes&&(n.maxPlaybackRate=parseFloat(t.attributes.max)),"min"in t.attributes&&(n.minPlaybackRate=parseFloat(t.attributes.min))),n}function fg(e){if(!(e=Nt(e,"SupplementalProperty")).length)return null;for(var t=(e=l(e)).next();!t.done;t=e.next())if("urn:mpeg:dash:chaining:2016"==(t=t.value).attributes.schemeIdUri)return t.attributes.value;return null}function pg(e,t,n,i,r){var a=t.Mb;a||(a=Ft(i,"mediaPresentationDuration",Xt),e.l.Mb=a);var o=0;e.i&&e.i.presentationTimeline&&e.Y&&(o=e.i.presentationTimeline.Kb());var s=[],u=o;i=Nt(i,"Period");for(var c=0;c<i.length;c++){var d=i[c],h=i[c+1],f=Ft(d,"start",Xt,u),p=d.attributes.id,g=Ft(d,"duration",Xt);f=0==c&&0==f&&e.Y?o:f;var m=null;if(h){var v=Ft(h,"start",Xt);null!=v&&(m=v-f+o)}else null!=a&&(m=a-f+o);if(v=wi,m&&g&&Math.abs(m-g)>v&&m>g&&e.M++,null==m&&(m=g),!(null!==e.O&&null!==p&&null!==f&&f<e.O)||e.C.includes(p)||c+1==i.length){if(null!==f&&(null===e.O||f>e.O)&&(e.O=f),u=gg(e,t,n,{start:f,duration:m,node:d,uf:null==m||!h}),s.push(u),t.oa.id&&m&&(e.ja[t.oa.id]=m),null==m){u=null;break}u=f+m}}if(r)for(n=(t=l(s)).next();!n.done;n=t.next())n=n.value.id,e.C.includes(n)||e.C.push(n);else e.C=s.map((function(e){return e.id}));return null!=a?{periods:s,duration:a+o,ug:!1}:{periods:s,duration:u,ug:!0}}function gg(t,n,i,r){n.oa=wg(t,r.node,null,i),n.ka=r,n.oa.Wa=n.Wa,n.oa.id||(n.oa.id="__shaka_period_"+r.start);var a=Nt(r.node,"EventStream");i=n.presentationTimeline.qb();for(var o=(a=l(a)).next();!o.done;o=a.next())Sg(t,r.start,r.duration,o.value,i);for(a=(i=l(i=Nt(r.node,"SupplementalProperty"))).next();!a.done;a=i.next())"urn:mpeg:dash:urlparam:2014"==(a=a.value).attributes.schemeIdUri&&(a=vg(t,a))&&(n.ob=a);if(i=Nt(r.node,"AdaptationSet").map((function(i,r){return function(t,n,i,r){function a(e){var i=e.attributes["dvb:fontFamily"];e=e.attributes["dvb:url"],i&&e&&(e=hi(n.ha.Oa(),[e],n.ob()),t.j.addFont(i,e[0]))}function o(e){switch(e){case 1:case 5:case 6:case 7:return"srgb";case 9:return"rec2020";case 11:case 12:return"p3"}}function s(e){switch(e){case 1:case 6:case 13:case 14:case 15:return"SDR";case 16:return"PQ";case 18:return"HLG"}}n.ha=wg(t,r,n.oa,null),n.ha.position=i;var u=!1,d=(i=Nt(r,"Role")).map((function(e){return e.attributes.value})).filter(Gi),h=void 0,f=n.ha.contentType==yi;f&&(h="subtitle");for(var p=(i=l(i)).next();!p.done;p=i.next()){var g=(p=p.value).attributes.schemeIdUri;if(null==g||"urn:mpeg:dash:role:2011"==g)switch(p=p.attributes.value,p){case"main":u=!0;break;case"caption":case"subtitle":h=p}}var m=Nt(r,"EssentialProperty");i=null;var v=!1;p=null,g=!1;for(var y=(m=l(m)).next();!y.done;y=m.next()){var b=(y=y.value).attributes.schemeIdUri;if("http://dashif.org/guidelines/trickmode"==b)i=y.attributes.value;else if("urn:mpeg:mpegB:cicp:TransferCharacteristics"==b)var S=s(parseInt(y.attributes.value,10));else if("urn:mpeg:mpegB:cicp:ColourPrimaries"==b)var x=o(parseInt(y.attributes.value,10));else"urn:mpeg:mpegB:cicp:MatrixCoefficients"!=b&&("urn:mpeg:dash:ssr:2023"==b&&t.g.dash.enableFastSwitching?v=!0:"urn:dvb:dash:fontdownload:2014"==b?a(y):"urn:mpeg:dash:urlparam:2014"==b&&(p=vg(t,y))||(g=!0))}if(g)return null;var A=null;for(m=(g=l(g=Nt(r,"SupplementalProperty"))).next();!m.done;m=g.next())"http://dashif.org/guidelines/last-segment-number"==(y=(m=m.value).attributes.schemeIdUri)?A=parseInt(m.attributes.value,10)-1:"urn:mpeg:mpegB:cicp:TransferCharacteristics"==y?S=s(parseInt(m.attributes.value,10)):"urn:mpeg:mpegB:cicp:ColourPrimaries"==y?x=o(parseInt(m.attributes.value,10)):"urn:dvb:dash:fontdownload:2014"==y?a(m):"urn:mpeg:dash:urlparam:2014"==y&&(p=vg(t,m));p&&(n.ob=p),p=Nt(r,"Accessibility");var E,k=new Map;for(g=(p=l(p)).next();!g.done;g=p.next())if(g=(m=g.value).attributes.schemeIdUri,m=m.attributes.value,"urn:scte:dash:cc:cea-608:2015"!=g||t.g.disableText)if("urn:scte:dash:cc:cea-708:2015"!=g||t.g.disableText)"urn:mpeg:dash:role:2011"==g?null!=m&&(d.push(m),"captions"==m&&(h="caption")):"urn:tva:metadata:cs:AudioPurposeCS:2007"==g&&("1"==m?E="visually impaired":"2"==m&&(E="hard of hearing"));else if(g=1,null!=m)for(y=(m=l(m.split(";"))).next();!y.done;y=m.next()){b=y.value;var I=y=void 0;b.includes("=")?(y="svc"+(b=b.split("="))[0],I=b[1].split(",")[0].split(":").pop()):(y="svc"+g,g++,I=b),k.set(y,Yi(I))}else k.set("svc1","und");else if(g=1,null!=m)for(b=(y=l(m=m.split(";"))).next();!b.done;b=y.next()){I=b.value;var M=b=void 0;I.includes("=")?(b=(I=I.split("="))[0].startsWith("CC")?I[0]:"CC"+I[0],M=I[1]||"und"):(b="CC"+g,2==m.length?g+=2:g++,M=I),k.set(b,Yi(M))}else k.set("CC1","und");var C=Bf(p=Nt(r,"ContentProtection"),t.g.dash.ignoreDrmInfo,t.g.dash.keySystemsByURI),D=Yi(n.ha.language||"und"),R=n.ha.label;if(r=(p=Nt(r,"Representation")).map((function(i){return(i=function(t,n,i,r,a,o,s,u,l,c,d,h){n.J=wg(t,c,n.ha,null);var f=n.J.id;if(t.da=Math.min(t.da,n.J.Wa),t.ga=0<t.da,!function(e){var t=e.Yc?1:0;return t+=e.Rb?1:0,0==(t+=e.ec?1:0)?e.contentType==yi||"application"==e.contentType:(1!=t&&(e.Yc&&(e.Rb=null),e.ec=null),!0)}(n.J))return null;var p=n.ka.start;n.bandwidth=Ft(c,"bandwidth",Wt)||0,n.roles=u;var g,m,v=Nt(c,"SupplementalProperty"),y=Nt(c,"EssentialProperty"),b=null,S=y.find((function(e){return"urn:mpeg:dash:urlparam:2014"==e.attributes.schemeIdUri}));(S||(S=v.find((function(e){return"urn:mpeg:dash:urlparam:2014"==e.attributes.schemeIdUri}))))&&(b=vg(t,S)),b&&(n.ob=b),b=(S=n.J.contentType)==yi||"application"==S,S="image"==S;try{var x=void 0;if(i.Je){var A=n.J.Oa,E=n.ob,k=aa(hi(A(),[i.Je.wi],E()),t.g.retryParameters);x={bitsKey:128,blockCipherMode:"CBC",iv:i.Je.iv,firstMediaSequenceNumber:0,fetchKey:function(){var n,i,r;return P((function(a){if(1==a.g)return w(a,Eg(t,k,6),2);if(3!=a.g){if(!(n=a.h).data||16!=n.data.byteLength)throw new De(2,4,4049);return i={name:"AES-CBC"},r=x,w(a,e.crypto.subtle.importKey("raw",n.data,i,!0,["decrypt"]),3)}r.cryptoKey=a.h,x.fetchKey=void 0,T(a)}))}}}if(n.J.aesKey=x,A=function(e,n,i,r){return xg(t,e,n,i,r)},n.J.Yc)var I=function(e,t,n){var i=Number(zf(e,ap,"presentationTimeOffset"))||0,r=zf(e,ap,"timescale"),a=1;r&&(a=Wt(r)||1);var o=i/a||0,s=ip(e,ap,n);!function(e,t){if(sp(e,t),!op(e))throw new De(2,4,4002)}(e,s);var u=It(e);return{nc:function(){var e=Wf(u,ap,"RepresentationIndex"),n=u.J.Oa();return e&&(e=vt(e.attributes.sourceURL))&&(n=hi(n,[e],u.ob())),e=op(u),rp(u,t,s,n,e.start,e.end,o)}}}(n,A,x);else if(n.J.Rb)I=function(e,t,n){var i=ip(e,lp,n),r=function(e){var t=function(e){return[e.J.Rb,e.ha.Rb,e.oa.Rb].filter(Gi).map((function(e){return Nt(e,"SegmentURL")})).reduce((function(e,t){return 0<e.length?e:t})).map((function(t){return t.attributes.indexRange&&!e.pf&&(e.pf=!0),{Ci:vt(t.attributes.media),start:(t=Ft(t,"mediaRange",qt,{start:0,end:null})).start,end:t.end}}))}(e),n=(e=Xf(e,lp)).zd;0==n&&(n=1);var i=0;return e.Qa?i=e.Qa*(n-1):e.timeline&&0<e.timeline.length&&(i=e.timeline[0].start),{Qa:e.Qa,startTime:i,zd:n,Pb:e.Pb,timeline:e.timeline,Rc:t}}(e);if(!r.Qa&&!r.timeline&&1<r.Rc.length)throw new De(2,4,4002);if(!r.Qa&&!e.ka.duration&&!r.timeline&&1==r.Rc.length)throw new De(2,4,4002);if(r.timeline&&0==r.timeline.length)throw new De(2,4,4002);var a=null,o=null;e.oa.id&&e.J.id&&(o=t[e.oa.id+","+e.J.id])&&(a=o.segmentIndex);var s=function(e,t,n,i,r,a,o,s,u,l){var c=i.Rc.length;i.timeline&&i.timeline.length!=i.Rc.length&&(c=Math.min(i.timeline.length,i.Rc.length));for(var d=e-i.Pb,h=t?e+t:1/0,f=[],p=i.startTime,g={},m=0;m<c;g={ve:void 0,ne:void 0},m++){g.ne=i.Rc[m];var v=p;p=void 0,p=null!=i.Qa?v+i.Qa:i.timeline?i.timeline[m].end:v+t,g.ve=null,(g=new vo(e+v,e+p,function(e){return function(){return null==e.ve&&(e.ve=hi(n(),[e.ne.Ci],l())),e.ve}}(g),g.ne.start,g.ne.end,r,d,e,h,[],"",null,null,bo,a)).codecs=s,g.mimeType=o,g.bandwidth=u,f.push(g)}return f}(e.ka.start,e.ka.duration,e.J.Oa,r,i,n,e.J.mimeType,e.J.codecs,e.bandwidth,e.ob);return t=!a,a?a.td(s,e.presentationTimeline.qb()):a=new Zs(s),e.presentationTimeline.vd(s),e.xb&&e.ka.uf||a.Kc(e.ka.start,e.ka.duration?e.ka.start+e.ka.duration:1/0,t),o&&(o.segmentIndex=a),{nc:function(){return a&&0!=a.getNumReferences()||a.Zd(s),Promise.resolve(a)}}}(n,t.o,x);else if(n.J.ec)I=cp(n,A,t.o,!!t.i,t.g.dash.initialSegmentLimit,t.ja,x,h,!1);else{var M=n.ka.duration||0,C=n.J.Oa,D=n.J.mimeType,R=n.J.codecs;I={nc:function(){var e=tu(p,M,C());return e.yb((function(e){e.mimeType=D,e.codecs=R})),Promise.resolve(e)}}}}catch(e){if((b||S)&&4002==e.code)return null;throw e}if(c=function(e,t,n,i){var r=Bf(e,n,i);if(t.wg)e=1==t.drmInfos.length&&!t.drmInfos[0].keySystem,n=0==r.drmInfos.length,(0==t.drmInfos.length||e&&!n)&&(t.drmInfos=r.drmInfos),t.wg=!1;else if(0<r.drmInfos.length&&(t.drmInfos=t.drmInfos.filter((function(e){return r.drmInfos.some((function(t){return t.keySystem==e.keySystem}))})),0==t.drmInfos.length))throw new De(2,4,4008);return r.rg||t.rg}(c=Nt(c,"ContentProtection"),i,t.g.dash.ignoreDrmInfo,t.g.dash.keySystemsByURI),c=new Set(c?[c]:[]),h=!1,v.some((function(e){return"tag:dolby.com,2018:dash:EC3_ExtensionType:2018"==e.attributes.schemeIdUri&&"JOC"==e.attributes.value}))&&(h=!0),v=!1,b&&(v=u.includes("forced_subtitle")||u.includes("forced-subtitle")),S&&((y=y.find((function(e){return["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"].includes(e.attributes.schemeIdUri)})))&&(g=y.attributes.value),!g))return null;b=n.J.codecs,n.profiles.includes("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&(b.includes("hvc1.2.4.L153.B0")||b.includes("hev1.2.4.L153.B0"))&&(m="PQ"),y=n.J.id?n.oa.id+","+n.J.id:"",t.F.length&&f&&t.s.set(n.oa.id+","+f,function(e){function t(e){return e?((e=It(e)).Yc=null,e.Rb=null,e.ec=an(e.ec),e):null}return(e=It(e)).oa=t(e.oa),e.ha=t(e.ha),e.J=t(e.J),e.ka&&(e.ka=It(e.ka),e.ka.node=null),e}(n));var L=y&&t.o[y]?t.o[y]:{id:t.na++,originalId:n.J.id,groupId:null,createSegmentIndex:function(){return Promise.resolve()},closeSegmentIndex:function(){L.segmentIndex&&(L.segmentIndex.release(),L.segmentIndex=null)},segmentIndex:null,mimeType:n.J.mimeType,codecs:b,frameRate:n.J.frameRate,pixelAspectRatio:n.J.pixelAspectRatio,bandwidth:n.bandwidth,width:n.J.width,height:n.J.height,kind:r,encrypted:0<i.drmInfos.length,drmInfos:i.drmInfos,keyIds:c,language:a,originalLanguage:n.ha.language,label:o,type:n.ha.contentType,primary:s,trickModeVideo:null,emsgSchemeIdUris:n.J.emsgSchemeIdUris,roles:u,forced:v,channelsCount:n.J.ce,audioSamplingRate:n.J.audioSamplingRate,spatialAudio:h,closedCaptions:l,hdr:m,colorGamut:void 0,videoLayout:void 0,tilesLayout:g,accessibilityPurpose:d,external:!1,fastSwitching:!1,fullMimeTypes:new Set([xi(n.J.mimeType,n.J.codecs)]),isAudioMuxedInVideo:!1};return L.createSegmentIndex=function(){var e;return P((function(t){if(1==t.g)return L.segmentIndex?t.u(0):(e=L,w(t,I.nc(),3));e.segmentIndex=t.h,T(t)}))},y&&n.xb&&!t.o[y]&&(n=n.oa.id||"",t.B[n]||(t.B[n]=[]),t.o[y]=L,t.B[n].push(y)),L}(t,n,C,h,D,R,u,d,k,i,E,A))&&(i.hdr=i.hdr||S,i.colorGamut=i.colorGamut||x,i.fastSwitching=v),i})).filter((function(e){return!!e})),0==r.length){if(i="image"==n.ha.contentType,t.g.dash.ignoreEmptyAdaptationSet||f||i)return null;throw new De(2,4,4003)}if(!n.ha.contentType||"application"==n.ha.contentType)for(n.ha.contentType=Ag(r[0].mimeType,r[0].codecs),g=(f=l(r)).next();!g.done;g=f.next())g.value.type=n.ha.contentType;for(f=n.ha.id||"__fake__"+t.na++,m=(g=l(r)).next();!m.done;m=g.next()){for(m=m.value,b=(y=l(C.drmInfos)).next();!b.done;b=y.next())(b=b.value).keyIds=b.keyIds&&m.keyIds?new Set([].concat(c(b.keyIds),c(m.keyIds))):b.keyIds||m.keyIds;m.groupId=f}return p=p.map((function(e){return e.attributes.id})).filter(Gi),{id:f,contentType:n.ha.contentType,language:D,lk:u,streams:r,drmInfos:C.drmInfos,bg:i,Qi:p}}(t,n,r,i)})).filter(Gi),n.xb){for(r=[],o=(a=l(i)).next();!o.done;o=a.next())for(var s=(o=l(o.value.Qi)).next();!s.done;s=o.next())r.push(s.value);if(r.length!=new Set(r).size)throw new De(2,4,4018)}if(r=i.filter((function(e){return!e.bg})),i=i.filter((function(e){return e.bg})),!t.g.disableIFrames)for(a=(i=l(i)).next();!a.done;a=i.next()){o=(a=a.value).bg.split(" ");for(var u=(s=l(r)).next();!u.done;u=s.next())if(u=u.value,o.includes(u.id))for(var d=(u=l(u.streams)).next();!d.done;d=u.next())Sr(d.value,a.streams)}if(i=mg(t.g.disableAudio,r,"audio"),a=mg(t.g.disableVideo,r,"video"),o=mg(t.g.disableText,r,yi),r=mg(t.g.disableThumbnails,r,"image"),0===a.length&&0===i.length)throw new De(2,4,4004);return{id:n.oa.id,audioStreams:i,videoStreams:a,textStreams:o,imageStreams:r}}function mg(e,t,n){return e||!t.length?[]:t.reduce((function(e,t){return t.contentType!=n||e.push.apply(e,c(t.streams)),e}),[])}function vg(e,t){if((t=Bt(t,"urn:mpeg:dash:schema:urlparam:2014","UrlQueryInfo"))&&Ft(t,"useMPDUrlQuery",$t,!1)){var n=t.attributes.queryTemplate;if(n)return function(){return"$querypart$"==n?e.aa:n.split("&").map((function(t){if("$querypart$"==t)return e.aa;var n=/\$query:(.*?)\$/g.exec(t);if(n&&2==n.length){n=n[1];var i=new ni(e.aa).get(n);if(i.length)return n+"="+i[0]}return t})).join("&")}}return null}function yg(e){var t,n;return P((function(i){switch(i.g){case 1:return t=0,S(i,2),w(i,ag(e),4);case 4:t=i.h,A(i,3);break;case 2:if(n=E(i),e.j){if(e.g.raiseFatalErrorOnManifestUpdateRequestFailure)return e.j.onError(n),i.return();n.severity=1,e.j.onError(n)}case 3:if(!e.j)return i.return();e.j.onManifestUpdated(),bg(e,t),T(i)}}))}function bg(e,t){if(!(0>e.K)){var n=e.K;0<=e.g.dash.updatePeriod&&(n=e.g.dash.updatePeriod),e.L.$(Math.max(n-t,K(e.ra)))}}function wg(e,t,n,i){n=n||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,pixelAspectRatio:void 0,ce:null,audioSamplingRate:null,Wa:0,oe:0},i=i||n.Oa;var r,a=t.attributes.id,o=Nt(t,"BaseURL"),s=!1;if(e.h)for(var u=l(o),c=u.next();!c.done;c=u.next()){var d=c.value;c=d.attributes.serviceLocation,d=Ot(d),c&&d&&(bp(e.h,a,c,d),s=!0)}s&&e.h||(r=o.map(Ot)),u=t.attributes.contentType||n.contentType,c=t.attributes.mimeType||n.mimeType,d=[t.attributes.codecs||n.codecs];var h=Vt(t,"urn:scte:dash:scte214-extensions","supplementalCodecs");h&&d.push(h),d=Cu(d).join(","),h=Ft(t,"frameRate",Qt)||n.frameRate;var f=t.attributes.sar||n.pixelAspectRatio,p=function(e,t){t=t.slice();for(var n=(e=l(e)).next();!n.done;n=e.next())n=n.value.attributes.schemeIdUri,t.includes(n)||t.push(n);return t}(Nt(t,"InbandEventStream"),n.emsgSchemeIdUris),g=Nt(t,"AudioChannelConfiguration");g=function(e){for(var t=(e=l(e)).next();!t.done;t=e.next()){var n=(t=t.value).attributes.schemeIdUri;if(n&&(t=t.attributes.value))switch(n){case"urn:mpeg:dash:outputChannelPositionList:2012":return t.trim().split(/ +/).length;case"urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case"urn:dts:dash:audio_channel_configuration:2012":if(!(t=parseInt(t,10)))continue;return t;case"tag:dolby.com,2015:dash:audio_channel_configuration:2015":if(n=[2,1,2,2,2,2,1,2,2,1,1,1,1,2,1,1,2,2],!(t=parseInt(t,16)))continue;for(var i=0,r=0;r<n.length;r++)t&1<<r&&(i+=n[r]);if(i)return i;continue;case"tag:dolby.com,2014:dash:audio_channel_configuration:2011":case"urn:dolby:dash:audio_channel_configuration:2011":if(n=[1,1,1,1,1,2,2,1,1,2,2,2,1,2,1,1].reverse(),!(t=parseInt(t,16)))continue;for(r=i=0;r<n.length;r++)t&1<<r&&(i+=n[r]);if(i)return i;continue;case"urn:mpeg:mpegB:cicp:ChannelConfiguration":if(n=[0,1,2,3,4,5,6,8,2,3,4,7,8,24,8,12,10,12,14,12,14],(t=parseInt(t,10))&&0<t&&t<n.length)return n[t]}}return null}(g)||n.ce;var m=Ft(t,"audioSamplingRate",Yt)||n.audioSamplingRate;u||(u=Ag(c,d));var v=_t(t,"SegmentBase"),y=_t(t,"SegmentTemplate"),b=v&&Ft(v,"availabilityTimeOffset",Jt)||0,w=y&&Ft(y,"availabilityTimeOffset",Jt)||0,T=o&&o.length&&Ft(o[0],"availabilityTimeOffset",Jt)||0;b=n.Wa+T+b+w,w=null,(T=_t(t,"SegmentSequenceProperties"))&&(T=_t(T,"SAP"))&&(w=Ft(T,"cadence",zt)),T=t.attributes.label;var S=Nt(t,"Label");return S&&S.length&&jt(S=S[0])&&(T=jt(S)),{Oa:function(){return hi(i(),o.length?e.h&&s?wp(e.h,a):r||[]:[])},Yc:v||n.Yc,Rb:_t(t,"SegmentList")||n.Rb,ec:y||n.ec,width:Ft(t,"width",Yt)||n.width,height:Ft(t,"height",Yt)||n.height,contentType:u,mimeType:c,codecs:d,frameRate:h,pixelAspectRatio:f,emsgSchemeIdUris:p,id:a,language:t.attributes.lang,ce:g,audioSamplingRate:m,Wa:b,Ud:null,oe:w||n.oe,label:T||null}}function Tg(e,t,n,i){var r,a,o,s,u,l,c;return P((function(d){if(1==d.g)return r=[vt(n)],a=hi(t(),r),(o=aa(a,e.g.retryParameters)).method=i,s=e.j.networkingEngine.request(4,o,{isPreload:e.fa()}),ta(e.S,s),w(d,s.promise,2);if(u=d.h,"HEAD"==i){if(!u.headers||!u.headers.date)return d.return(0);l=u.headers.date}else l=dt(u.data);return c=Date.parse(l),isNaN(c)?d.return(0):d.return(c-Date.now())}))}function Sg(e,t,n,i,r){for(var a=i.attributes.schemeIdUri||"",o=i.attributes.value||"",s=Ft(i,"timescale",Yt)||1,u=Ft(i,"presentationTimeOffset",Yt)||0,c=(i=l(Nt(i,"Event"))).next();!c.done;c=i.next()){var d=Ft(c=c.value,"presentationTime",Yt)||0,h=Ft(c,"duration",Yt)||0;h=(d=Math.max((d-u)/s+t,t))+h/s,null!=n&&(d=Math.min(d,t+n),h=Math.min(h,t+n)),h<r||(c={schemeIdUri:a,value:o,startTime:d,endTime:h,id:c.attributes.id||"",eventElement:rn(c),eventNode:an(c)},e.j.onTimelineRegionAdded(c))}}function xg(e,t,n,i,r){var a,o,s,u;return P((function(l){return 1==l.g?(a=ca,o=r?0:1,s=Ru(t,n,i,e.g.retryParameters),w(l,Eg(e,s,a,{type:o}),2)):(u=l.h,l.return(u.data))}))}function Ag(e,t){return Ui(t=xi(e,t))?yi:e.split("/")[0]}function Eg(e,t,n,i){return i||(i={}),i.isPreload=e.fa(),t=e.j.networkingEngine.request(n,t,i),ta(e.S,t),t.promise}function kg(){}(i=rg.prototype).configure=function(e,t){var n=this.j&&e.dash.updatePeriod!=this.g.dash.updatePeriod&&0<=e.dash.updatePeriod;this.g=e,t&&(this.fa=t),n&&this.i&&this.i.presentationTimeline.U()&&this.L.hc(),this.h&&this.h.configure(this.g),this.m&&(this.m.bh(this.g.dash.multiTypeVariantsAllowed&&ie()),this.m.ih(this.g.dash.useStreamOnceInPeriodFlattening))},i.start=function(e,t){var n,i=this;return P((function(r){if(1==r.g)return i.H=t.isLowLatencyMode(),i.A=[e],i.j=t,w(r,ag(i),2);if(n=r.h,i.j&&bg(i,n),!i.j)throw new De(2,7,7001);return r.return(i.i)}))},i.stop=function(){for(var e=l(Object.values(this.o)),t=e.next();!t.done;t=e.next())(t=t.value).segmentIndex&&t.segmentIndex.release();return this.m&&this.m.release(),this.g=this.j=null,this.A=[],this.i=null,this.o={},this.B={},this.s.clear(),this.l={ae:"",type:"",profiles:[],Mb:null,Wa:0,Oa:null,xd:0},this.m=null,null!=this.L&&(this.L.stop(),this.L=null),this.h&&this.h.destroy(),this.G&&(this.G.release(),this.G=null),this.S.destroy()},i.update=function(){var e,t=this;return P((function(n){return 1==n.g?(S(n,2),w(n,ag(t),4)):2!=n.g?A(n,0):(e=E(n),t.j&&e?(t.j.onError(e),void T(n)):n.return())}))},i.onExpirationUpdated=function(){},i.onInitialVariantChosen=function(e){if(this.i&&this.i.presentationTimeline.U()){var t=e.video||e.audio;if(t&&t.segmentIndex){e=this.i.presentationTimeline.Yb();var n=t.segmentIndex.find(e);null!=n&&(t=t.segmentIndex.get(n))&&(this.K=t.endTime-e,bg(this,0))}}},i.banLocation=function(e){this.h&&this.h.banLocation(e)},i.setMediaElement=function(e){this.I=e},F("shaka.dash.DashParser",rg),co["application/dash+xml"]=function(){return new rg},co["video/vnd.mpeg.dash.mpd"]=function(){return new rg},F("shaka.dependencies",kg),kg.has=function(e){return Cg.has(e)},kg.add=function(e,t){if(!Mg[e])throw Error(e+" is not supported");e==Ig?oe("mux.js","mux.js is no longer used in Shaka Player."):Cg.set(e,(function(){return t}))};var Ig="muxjs",Mg={mk:Ig,ISOBoxer:"ISOBoxer"};kg.Allowed=Mg;var Cg=new Map([["ISOBoxer",function(){return e.ISOBoxer}]]);function Dg(e,t,n){this.type=e,this.X=t,this.segments=n||null}function Rg(e,t,n,i){this.id=e,this.name=t,this.attributes=n,this.value=void 0===i?null:i}function Pg(e,t){return t?e.toString():(t=(new Set).add("AUDIO").add("VIDEO").add("SUBTITLES").add("PATHWAY-ID").add("GROUP-ID").add("URI"),e.toString(t))}function Lg(e,t){return(e=e.attributes.filter((function(e){return e.name==t}))).length?e[0]:null}function Ng(e,t,n){return(e=Lg(e,t))?e.value:n||null}function jg(e,t){if(!(e=Lg(e,t)))throw new De(2,4,4023,t);return e.value}function Og(e,t,n){n=void 0===n?[]:n,this.X=t,this.g=e,this.Cb=n}function Ug(e,t){this.name=e,this.value=t}function _g(e,t){return e.filter((function(e){return e.name==t}))}function Bg(e,t){return e.filter((function(e){return jg(e,"TYPE")==t}))}function Fg(e,t){for(var n=(e=l(e)).next();!n.done;n=e.next())if((n=n.value).name===t)return n;return null}function Vg(e,t,n){return n=void 0===n?0:n,(e=Fg(e,t))?Number(e.value):n}function Hg(e,t,n){return t?Gg(e,[t],n):[]}function Gg(e,t,n){if(!t.length)return[];t=hi(e,t),e=[];for(var i=(t=l(t)).next();!i.done;i=t.next())e.push(Kg(i.value,n));return e}function Kg(e,t){if(!t||!t.size)return e;var n=(e=String(e).replace(/%7B/g,"{").replace(/%7D/g,"}")).match(/{\$\w*}/g);if(n)for(var i=(n=l(n)).next();!i.done;i=n.next()){var r=(i=i.value).slice(2,i.length-1),a=t.get(r);if(!a)throw new De(2,4,4039,r);e=e.replace(i,a)}return e}function Xg(){this.g=0}function qg(e,t){var n=(t=(t=dt(t)).replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim()).split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(n[0]))throw new De(2,4,4015);t=0;for(var i=!0,r=l(n),a=r.next();!a.done;a=r.next())if(a=a.value,/^#(?!EXT)/m.test(a)||i)i=!1;else{if(a=zg(e,a),--e.g,Wg.includes(a.name)){t=1;break}"EXT-X-STREAM-INF"==a.name&&(i=!0)}for(r=[],i=!0,a=0;a<n.length;a++){var o=n[a],s=n[a+1];if(/^#(?!EXT)/m.test(o)||i)i=!1;else{if(o=zg(e,o),Yg.includes(o.name)){if(1!=t)throw new De(2,4,4017);o=n.splice(a,n.length-a),n=[],i=[],a=[],s=null;for(var u=(o=l(o)).next();!u.done;u=o.next())u=u.value,/^(#EXT)/.test(u)?(u=zg(e,u),Wg.includes(u.name)?r.push(u):"EXT-X-MAP"==u.name?s=u:"EXT-X-PART"==u.name?a.push(u):"EXT-X-PRELOAD-HINT"==u.name?"PART"==Ng(u,"TYPE")?a.push(u):"MAP"==Ng(u,"TYPE")&&(u.name="EXT-X-MAP",s=u):i.push(u)):/^#(?!EXT)/m.test(u)||(u=u.trim(),s&&i.push(s),n.push(new Og(u,i,a)),i=[],a=[]);return a.length&&(s&&i.push(s),n.push(new Og("",i,a))),new Dg(t,r,n)}r.push(o),"EXT-X-STREAM-INF"==o.name&&(o.attributes.push(new Ug("URI",s)),i=!0)}}return new Dg(t,r)}function zg(e,t){e=e.g++;var n=t.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!n)throw new De(2,4,4016,t);t=n[1];var i,r=n[2];if(n=[],r){var a;(a=Tt(r=new bt(r),/^([^,=]+)(?:,|$)/g))&&(i=a[1]);for(var o=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;a=Tt(r,o);)n.push(new Ug(a[1],a[2]||a[3])),wt(r)}return new Rg(e,t,n,i)}Rg.prototype.toString=function(e){var t="#"+this.name,n=this.attributes?this.attributes.filter((function(t){return!e||!e.has(t.name)})).map((function(e){return e.name+"="+(isNaN(Number(e.value))?'"'+e.value+'"':e.value)})):[];return this.value&&n.unshift(this.value),0<n.length&&(t+=":"+n.join(",")),t};var Wg="EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-I-FRAMES-ONLY EXT-X-ENDLIST EXT-X-SERVER-CONTROL EXT-X-SKIP EXT-X-PART-INF EXT-X-DATERANGE".split(" "),Yg="EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE EXT-X-MAP EXT-X-GAP".split(" ");function Jg(){}function $g(e){try{var t=Qg(e);return zr({uri:e,originalUri:e,data:t.data,headers:{"content-type":t.contentType}})}catch(e){return Xr(e)}}function Qg(t){var n=t.split(":");if(2>n.length||"data"!=n[0])throw new De(2,1,1004,t);if(2>(n=n.slice(1).join(":").split(",")).length)throw new De(2,1,1004,t);var i=n[0];t=e.decodeURIComponent(n.slice(1).join(",")),n=i.split(";"),i=n[0];var r=!1;return 1<n.length&&"base64"==n[n.length-1]&&(r=!0,n.pop()),{data:r?ui(t):pt(t),contentType:i}}function Zg(){var e=this;this.g=this.h=null,this.C=1,this.A=new Map,this.H=new Map,this.O=new Map,this.O.set("video",new Map),this.O.set("audio",new Map),this.O.set(yi,new Map),this.O.set("image",new Map),this.Na=new Set,this.i=new Map,this.l=null,this.M="",this.Ka=new Xg,this.I=-1,this.ga=1/0,this.fa=this.ac=this.bc=!1,this.B=new Be((function(){e.aa&&!e.g.continueLoadingWhenPaused&&(e.Z.cb(e.aa,"timeupdate"),e.aa.paused)?e.Z.pa(e.aa,"timeupdate",(function(){return jm(e)})):jm(e)})),this.xa=Xm,this.m=null,this.La=0,this.o=1/0,this.Ga=this.Ba=this.Y=0,this.da=new ea,this.F=new Map,this.G=new Map,this.ta=new Map,this.ja=new Map,this.L=new Map,this.ra=new Map,this.na=new Map,this.Ib=this.K=!1,this.Gb=new G(5),this.j=null,this.S=!0,this.Aa=new Set,this.Z=new Z,this.s=this.aa=null,this.Hb=function(){return!1}}function em(e,t){return Om(e)?e.O.get(t.type):t.Yd}function tm(e,t){var n,i,r,a,o,s,u,d,h,f,p,g,m,v,y,b,x,k,I,M,C,D,R,L,N,j,O,U,_,B,F,V,H;return P((function(P){switch(P.g){case 1:if(t.stream.isAudioMuxedInVideo)return P.return();for(n=[],i=l(t.N()),r=i.next();!r.done;r=i.next())a=r.value,o=new Gn(a),s=o.g,t.Id&&(0<=t.sb&&s.add("_HLS_msn",String(t.sb)),0<=t.ub&&s.add("_HLS_part",String(t.ub))),t.Jd&&s.add("_HLS_skip","YES"),ri(s)&&zn(o,s),n.push(o.toString());return S(P,2),w(P,Nm(e,n,!0).promise,4);case 4:u=P.h,A(P,3);break;case 2:throw d=E(P),e.h&&e.h.disableStream(t.stream),d;case 3:if(!t.stream.segmentIndex)return P.return();if(1!=(h=qg(e.Ka,u.data)).type)throw new De(2,4,4017);return(f=u.uri)==u.originalUri||t.N().includes(f)||t.Wg.push(f),p=_g(h.X,"EXT-X-DEFINE"),g=am(e,p,f),m=t.stream,v=em(e,t),w(P,wm(e,h,m.mimeType,t.N,g),5);case 5:for(y=P.h,b=y.keyIds,x=y.drmInfos,function(e,t){return e.size===t.size&&[].concat(c(e)).every((function(e){return t.has(e)}))}(m.keyIds,b)||(m.keyIds=b,m.drmInfos=x,e.h.newDrmInfo(m)),k=Cm(e,h,v,g,t.N,t.type),I=k.segments,(M=k.bandwidth)&&(m.bandwidth=M),C=Iu(m),D=l(I),R=D.next();!R.done;R=D.next())(L=R.value).ba&&(L.ba.Qc=C);m.segmentIndex.td(I,e.l.qb()),I.length&&(N=Vg(h.X,"EXT-X-MEDIA-SEQUENCE",0),O=(j=Fg(h.X,"EXT-X-SKIP"))?Number(Ng(j,"SKIPPED-SEGMENTS")):0,U=ym(N,I),_=U.sb,B=U.ub,t.sb=_+O,t.ub=B,F=v.get(N),m.segmentIndex.Ha(F)),(V=eu(m.segmentIndex))&&(t.xc=V.startTime,H=I[I.length-1],t.Lb=H.endTime),Fg(h.X,"EXT-X-ENDLIST")&&(t.kd=!0),xm(e,h),Mm(e,h.X,m.type,g,t.N),T(P)}}))}function nm(e,t,n){n=void 0!==n&&n;for(var i=-1==e.I,r=l(t),a=r.next();!a.done;a=r.next()){var o=(a=a.value).stream.segmentIndex,s=em(e,a);if(o=eu(o))for(var u=(s=l(s)).next();!u.done;u=s.next()){var c=(u=l(u.value)).next().value;if(u.next().value==o.startTime){i&&(e.I=Math.max(e.I,c)),a.Ue=c;break}}}if(!(0>e.I))for(i=(t=l(t)).next();!i.done;i=t.next())(mm(e,(i=i.value).type)||n)&&(r=i.stream.segmentIndex)&&0<(a=e.I-i.Ue)&&(r.g.splice(0,a),r=eu(r))&&(r=-r.startTime,i.stream.segmentIndex.offset(r),im(e,i,r))}function im(e,t,n){t.xc+=n,t.Lb+=n;for(var i=l(e=em(e,t)),r=i.next();!r.done;r=i.next()){var a=l(r.value);r=a.next().value,a=a.next().value,e.set(r,a+n)}t.N()}function rm(e){if(Om(e)){if(e.xa==zm){for(var t=1/0,n=1/0,i=l(e.i.values()),r=i.next();!r.done;r=i.next())(r=r.value).stream.segmentIndex&&"text"!=r.stream.type&&!r.stream.isAudioMuxedInVideo&&(t=Math.min(t,r.Lb),n=Math.min(n,r.xc));t=t-n||0,isNaN(e.g.availabilityWindowOverride)||(t=e.g.availabilityWindowOverride),e.l.pe(t)}}else e.l.bb(fm(e));if(!e.l.s)for(n=(t=l(e.i.values())).next();!n.done;n=t.next())!(n=n.value).stream.segmentIndex||"audio"!=n.type&&"video"!=n.type||(n=eu(n.stream.segmentIndex))&&n.h&&e.l.fh(n.h);e.l.Xd()}function am(e,t,n){n=new Gn(n).g;for(var i=new Map,r=(t=l(t)).next();!r.done;r=t.next()){var a=r.value,o=Ng(a,"NAME"),s=Ng(a,"VALUE");r=Ng(a,"QUERYPARAM"),a=Ng(a,"IMPORT"),o&&s&&(i.has(o)||i.set(o,s)),r&&(o=n.get(r)[0])&&!i.has(o)&&i.set(r,o),a&&(r=e.A.get(a))&&i.set(a,r)}return i}function om(e){var t=new Set([xi(e.mimeType,e.codecs)]);e.segmentIndex&&e.segmentIndex.yb((function(n){n.mimeType&&t.add(xi(n.mimeType,e.codecs))})),e.fullMimeTypes=t}function sm(e,t,n){for(var i={audio:[],video:[]},r=new Map,a=[],o=!1,s=!1,u=l(t),d=u.next();!d.done;d=u.next()){var h=d.value;d=Ng(h,"AUDIO");var f=Ng(h,"VIDEO"),p=d||f;p&&(a.includes(p)||a.push(p),(h=Ng(h,"PATHWAY-ID"))&&r.set(p,h),d?o=!0:f&&(s=!0))}a.length&&n.length&&function(e,t,n){t=t.filter((function(e){var t=Ng(e,"URI")||"";return"SUBTITLES"!=(e=Ng(e,"TYPE"))&&(""!=t||"AUDIO"==e)}));for(var i={},r=(t=l(t)).next();!r.done;r=t.next()){var a=Pg(r=r.value,!e.j);i[a]?i[a].push(r):i[a]=[r]}for(var o in i)cm(e,i[o],n,!1)}(e,n=n.filter((function(e){return a.includes(jg(e,"GROUP-ID"))})),r),n=(r=a.sort().join(","))&&e.H.has(r)?e.H.get(r):[],o?i.audio.push.apply(i.audio,c(n)):s&&i.video.push.apply(i.video,c(n)),o=!1;var g=t.map((function(e){return jg(e,"URI")}));return d=i.audio.find((function(e){return e&&e.N().find((function(e){return g.includes(e)}))})),n=mi("video",s=um(e,t[0])),(u=mi("audio",s))&&!n?(d="audio",o=0<i.audio.length):!i.audio.length&&!i.video.length&&u&&n?(d="video",s=[[n,u].join()]):i.audio.length&&d?(d="audio",o=!0):d=i.video.length&&!i.audio.length?"audio":"video",o||(e=function(e,t,n,i){for(var r=e.C++,a=[],o=l(t),s=o.next();!s.done;s=o.next()){var u=s.value;s=jg(u,"URI"),u=Ng(u,"PATHWAY-ID"),e.j&&u&&bp(e.j,r,u,s),a.push(s)}if(o=a.sort().join(","),e.i.has(o))return e.i.get(o);e:{if(t=Ng(t[0],"CLOSED-CAPTIONS"),"video"==i){if(e.g.disableText){e.S=!1,t=null;break e}if(t){if("NONE"!=t){t=e.F.get(t);break e}e.S=!1}else if(!t&&e.F.size)for(t=l(e.F.keys()).next();!t.done;){t=e.F.get(t.value);break e}}t=null}return i=hm(e,r,a,n=gi(i,n),i,null,!1,null,null,t,null,!1,null,!1),e.i.set(o,i),i}(e,t,s,d),r&&(e.stream.groupId=r),i[e.stream.type]=[e]),i}function um(e,t){var n=Ng(t,"CODECS")||"";return t=Ng(t,"SUPPLEMENTAL-CODECS"),e.fa=0<n.length,e.fa||e.g.hls.disableCodecGuessing||(n=[],e.g.disableVideo||n.push(e.g.hls.defaultVideoCodec),e.g.disableAudio||n.push(e.g.hls.defaultAudioCodec),n=n.join(",")),e=n.split(/\s*,\s*/),t&&(t=t.split(/\s*,\s*/).map((function(e){return e.split("/")[0]})),e.push.apply(e,c(t))),Cu(e)}function lm(e,t,n,i,r,a,o,s,u,c,d,h){for(var f=l(n),p=f.next();!p.done;p=f.next())Lm(p.value.stream,r,a,o,s,u,null);for(r=e.g.disableAudio,t.length&&!r||(t=[null]),r=e.g.disableVideo,n.length&&!r||(n=[null]),r=[],a=(t=l(t)).next();!a.done;a=t.next())for(a=a.value,s=(o=l(n)).next();!s.done;s=o.next()){var g=s.value;(s=a?a.stream:null)&&(s.drmInfos=c,s.keyIds=d),(u=g?g.stream:null)&&(u.drmInfos=c,u.keyIds=d,e.g.disableIFrames||Sr(u,h)),u&&!s&&(u.bandwidth=i),!u&&s&&(s.bandwidth=i),f=a?a.stream.drmInfos:null,p=g?g.stream.drmInfos:null,g=(g=g?g.N().sort().join(","):"")+" - "+(a?a.N().sort().join(","):""),s&&u&&!Le(f,p)||e.Na.has(g)||(s={id:e.C++,language:s?s.language:"und",disabledUntilTime:0,primary:!!s&&s.primary||!!u&&u.primary,audio:s,video:u,bandwidth:i,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},r.push(s),e.Na.add(g))}return r}function cm(e,t,n,i){i=void 0===i||i;for(var r=[],a=[],o=new Map,s=l(t),u=s.next();!u.done;u=s.next()){var c=u.value;u=i?jg(c,"URI"):Ng(c,"URI")||"shaka://hls-muxed",c=jg(c,"GROUP-ID"),r.push(u),a.push(c),o.set(c,u)}if(i=a.sort().join(","),u=t[0],t="","subtitles"==(s=jg(u,"TYPE").toLowerCase())&&(s=yi),s==yi)t=Ng(u,"CODECS")||"";else for(c=(a=l(a)).next();!c.done;c=a.next())if(c=c.value,e.G.has(c)){t=e.G.get(c);break}if(a=r.sort().join(","),e.i.has(a))return e.i.get(a);if(c=e.C++,e.j)for(var d=(o=l(o)).next();!d.done;d=o.next()){var h=l(d.value);d=h.next().value,h=h.next().value,(d=n.get(d))&&bp(e.j,c,d,h)}n=Ng(u,"LANGUAGE"),o=Ng(u,"NAME"),d="YES"==Ng(u,"DEFAULT"),h="audio"==s&&(h=Ng(u,"CHANNELS"))?parseInt(h.split("/")[0],10):null;var f="audio"==s&&!!(f=Ng(u,"CHANNELS"))&&f.includes("/JOC");return(r=hm(e,c,r,t,s,n,d,o,h,null,Ng(u,"CHARACTERISTICS"),"YES"==Ng(u,"FORCED"),u="audio"==s&&(u=Ng(u,"SAMPLE-RATE"))?parseInt(u,10):null,f)).stream&&(r.stream.groupId=i),e.H.has(i)?e.H.get(i).push(r):e.H.set(i,[r]),e.i.set(a,r),r}function dm(e,t){var n="video",i=jg(t,"URI"),r=Ng(t,"CODECS")||"";if("mjpg"==r&&(n="image"),e.i.has(i))return e.i.get(i);var a=Ng(t,"LANGUAGE"),o=Ng(t,"NAME"),s=Ng(t,"CHARACTERISTICS");return n=hm(e,e.C++,[i],r,n,a,!1,o,null,null,s,!1,null,!1),a=l((r=Ng(t,"RESOLUTION"))?r.split("x"):[null,null]),r=a.next().value,a=a.next().value,n.stream.width=Number(r)||void 0,n.stream.height=Number(a)||void 0,(t=Ng(t,"BANDWIDTH"))&&(n.stream.bandwidth=Number(t)),e.i.set(i,n),n}function hm(e,t,n,i,r,a,o,s,u,c,d,h,f,p){function g(){return e.j&&1<n.length?wp(e.j,t):y.concat(Gg([e.M],n,e.A))}var m=bm(e,i,r,a,o,s,u,c,d,h,f,p);n.includes("shaka://hls-muxed")&&(m.isAudioMuxedInVideo=!0,m.mimeType="video/mp2t",om(m));var v,y=[],b={stream:m,type:r,Wg:y,N:g,xc:0,Lb:0,Yd:new Map,Jd:!1,Id:!1,kd:!1,Ue:-1,sb:-1,ub:-1,zf:!1},x=null;return m.createSegmentIndex=function(){return x||(m.isAudioMuxedInVideo?(m.segmentIndex=new Zs([]),Promise.resolve()):(v=Nm(e,b.N(),!0),x=new Promise((function(t){t(function(t){var n,v,x,k,I,M,C,D,R,L,N,j,O,U,_,B,F,V,H,G,K,X;return P((function(P){switch(P.g){case 1:return n=bi,S(P,2),v=b.N(),w(P,t.promise,4);case 4:if(x=P.h,t.aborted)return P.return();if((k=x.uri)==x.originalUri||v.includes(k)||y.push(k),1!=(I=qg(e.Ka,x.data)).type)throw new De(2,4,4017);return M=_g(I.X,"EXT-X-DEFINE"),C=am(e,M,k),D=!1,(!e.fa&&e.g.hls.disableCodecGuessing||e.S&&r==n.la&&!e.g.hls.disableClosedCaptionsDetection)&&0<I.segments.length&&(e.S=!1,D=!0),R=!e.fa&&e.g.hls.disableCodecGuessing,L=Om(e),w(P,vm(e,0,C,I,g,i,r,a,o,s,u,c,d,h,f,p,void 0,D,R),5);case 5:if(N=P.h,t.aborted)return P.return();if(j=N.stream,Sm(e,I),Om(e)&&!L&&Am(e,I),b.xc=N.xc,b.Lb=N.Lb,b.Jd=N.Jd,b.Id=N.Id,b.kd=N.kd,b.Yd=N.Yd,b.sb=N.sb,b.ub=N.ub,b.zf=!0,m.segmentIndex=j.segmentIndex,m.encrypted=j.encrypted,m.drmInfos=j.drmInfos,m.keyIds=j.keyIds,m.mimeType=j.mimeType,m.bandwidth=m.bandwidth||j.bandwidth,m.codecs=m.codecs||j.codecs,m.closedCaptions=m.closedCaptions||j.closedCaptions,m.width=m.width||j.width,m.height=m.height||j.height,m.hdr=m.hdr||j.hdr,m.colorGamut=m.colorGamut||j.colorGamut,m.frameRate=m.frameRate||j.frameRate,"und"==m.language&&"und"!=j.language&&(m.language=j.language),m.language=m.language||j.language,m.channelsCount=m.channelsCount||j.channelsCount,m.audioSamplingRate=m.audioSamplingRate||j.audioSamplingRate,om(m),m.drmInfos.length&&e.h.newDrmInfo(m),O=!1,(!c&&m.closedCaptions||c&&m.closedCaptions&&c.size!=m.closedCaptions.size)&&(O=!0),e.m&&O&&e.h.makeTextStreamsForClosedCaptions(e.m),r==n.la||r==n.V)for(U=l(e.i.values()),_=U.next();!_.done;_=U.next())(B=_.value).zf||B.type!=r||(B.stream.mimeType=j.mimeType,om(B.stream));r==n.wa&&(F=eu(j.segmentIndex))&&F.ba&&(m.mimeType="application/mp4",om(m)),V=Iu(m),m.segmentIndex.yb((function(e){e.ba&&(e.ba.Qc=V)})),function(e){if(!e.m)return!1;for(var t=[],n=[],i=(e=l(e.m.variants)).next();!i.done;i=e.next())(i=i.value).video&&t.push(i.video),i.audio&&n.push(i.audio);return!(0<t.length&&!t.some((function(e){return e.segmentIndex}))||0<n.length&&!n.some((function(e){return e.segmentIndex})))}(e)&&(e.ac?gm(e,[b]):(e.ac=!0,H=Array.from(e.i.values()),G=H.filter((function(e){return e.stream.segmentIndex})),gm(e,G),rm(e),0<(K=e.o)&&e.B.$(K))),Mm(e,I.X,m.type,C,g),e.m&&(e.m.startTime=e.s),A(P,0);break;case 2:if(X=E(P),m.closeSegmentIndex(),7001===X.code)return P.return();if(!e.h.disableStream(m))throw X;T(P)}}))}(v))}))))},m.closeSegmentIndex=function(){x&&!m.segmentIndex&&v.abort(),m.segmentIndex&&(m.segmentIndex.release(),m.segmentIndex=null),x=null},b}function fm(e){for(var t=1/0,n=(e=l(e.i.values())).next();!n.done;n=e.next())(n=n.value).stream.segmentIndex&&"text"!=n.stream.type&&!n.stream.isAudioMuxedInVideo&&(t=Math.min(t,n.Lb));return t}function pm(e,t){for(var n=[],i=(t=l(t)).next();!i.done;i=t.next())(i=i.value).segmentIndex&&i.segmentIndex.yb((function(e){n.push(e)}));e.l.vd(n)}function gm(e,t){if(!Om(e))for(var n=fm(e),i=l(t),r=i.next();!r.done;r=i.next())r.value.stream.segmentIndex.Kc(0,n);pm(e,t.map((function(e){return e.stream}))),n=Om(e)&&!e.bc,e.g.hls.ignoreManifestProgramDateTime||n?nm(e,t,n):(function(e,t){if(1/0==e.ga)for(var n=(t=l(t)).next();!n.done;n=t.next())null!=(n=eu(n.value.stream.segmentIndex))&&null!=n.h&&(e.ga=Math.min(e.ga,n.h));if(1/0!=(t=e.ga))for(var i=(n=l(e.i.values())).next();!i.done;i=n.next())if(!mm(e,(i=i.value).type)){var r=i.stream.segmentIndex;if(null!=r){var a=eu(r);if(a)if(null==a.h)z("Missing EXT-X-PROGRAM-DATE-TIME for stream",i.N(),"Expect AV sync issues!");else for(im(e,i,a.h-t-a.startTime),r=(i=l(r)).next();!r.done;r=i.next())r.value.Yf(t)}}}(e,t),0<e.g.hls.ignoreManifestProgramDateTimeForTypes.length&&nm(e,t))}function mm(e,t){return!!e.g.hls.ignoreManifestProgramDateTime||e.g.hls.ignoreManifestProgramDateTimeForTypes.includes(t)}function vm(e,t,n,i,r,a,o,s,u,c,d,h,f,p,g,m,v,y,b){var T,x,k,I,M,C,D,R,L,N,j,O,U,_,B,F,V,H,G,K,X,q,z,W,Y,J,$,Q,Z;return y=void 0===y||y,b=void 0===b||b,P((function(t){switch(t.g){case 1:if(T=i.segments||[],x=T.every((function(e){return!!Fg(e.X,"EXT-X-GAP")})),!T.length||x)throw new De(2,4,4053);if(function(e,t){var n=Fg(t.X,"EXT-X-PLAYLIST-TYPE");t=Fg(t.X,"EXT-X-ENDLIST"),t=n&&"VOD"==n.value||t,n=n&&"EVENT"==n.value&&!t,n=!t&&!n,Um(e,t?Xm:n?zm:qm)}(e,i),Om(e)&&xm(e,i),k=Om(e)?e.O.get(o):new Map,I=Cm(e,i,k,n,r,o),M=I.segments,C=I.bandwidth,j=N=L=R=D=null,!(0<M.length&&y)){t.u(2);break}return w(t,function(e,t){var n,i,r,a,o,s,u,c,d,h,f,p,g,m,v,y,b,T,S,x,A,E,k;return P((function(I){switch(I.g){case 1:if(n=Mu(e.g.hls.mediaPlaylistFullMimeType),!t.length)return I.return(n);if(i=Pm(e,t),r=i.segment,a=i.segmentIndex,o=r.N(),s=o[0],u=new Gn(s),c=u.Ua.split(".").pop(),d=Vm[c])return I.return(Mu(d));if(h=ca,p=f=null,!(g=r.ba)){I.u(2);break}return m=Ru(g.N(),g.Zb(),g.Xb(),e.g.retryParameters),w(I,_m(e,m,h,{type:0}).promise,3);case 3:if(v=I.h,f=v.data,!g.aesKey){I.u(4);break}return w(I,Du(f,g.aesKey,0),5);case 5:f=I.h;case 4:(p=v.headers["content-type"])&&(p=p.split(";")[0].toLowerCase());case 2:return y=Ru(r.N(),r.Zb(),r.Xb(),e.g.retryParameters),w(I,_m(e,y,h,{type:1}).promise,6);case 6:if(b=I.h,T=b.data,!r.aesKey){I.u(7);break}return w(I,Du(T,r.aesKey,a),8);case 8:T=I.h;case 7:if((S=b.headers["content-type"])&&(S=S.split(";")[0].toLowerCase()),x="mp4 mp4a m4s m4i m4a m4f cmfa mp4v m4v cmfv fmp4".split(" "),A=["audio/mp4","video/mp4","video/iso.segment"],os(ge(T))){var M=T,C=ge(M),D=(C=(new ns).parse(C)).fd();C=C.nf();var R=[],P=!1,L=!1;switch(D.audio){case"aac":case"aac-loas":R.push("mp4a.40.2"),P=!0;break;case"mp3":R.push("mp4a.40.34"),P=!0;break;case"ac3":R.push("ac-3"),P=!0;break;case"ec3":R.push("ec-3"),P=!0;break;case"opus":R.push("opus"),P=!0}switch(D.video){case"avc":C.codec?R.push(C.codec):R.push("avc1.42E01E"),L=!0;break;case"hvc":C.codec?R.push(C.codec):R.push("hvc1.1.6.L93.90"),L=!0;break;case"av1":R.push("av01.0.01M.08"),L=!0}if(R.length){if(D=P&&!L,P=new Map,L){(L=new we("video/mp2t")).i(M);for(var N=(M=l(L.j())).next();!N.done;N=M.next())N=N.value,P.set(N,N);L.g()}C={type:D?"audio":"video",mimeType:"video/mp2t",codecs:R.join(", "),language:null,height:C.height,width:C.width,channelCount:null,sampleRate:null,closedCaptions:P,Cd:null,colorGamut:null,frameRate:C.frameRate}}else C=null;if(E=C)return I.return(E)}else if((x.includes(c)||A.includes(S)||p&&A.includes(p))&&(k=function(e,t){function n(e){a=e.name;var t=e.reader;t.skip(24);var n=t.ma(),i=t.ma();t.skip(50),f=String(n),h=String(i),e.reader.sa()&&Sa(e)}function i(e){var t=Fo(e.reader);p=t.channelCount,g=t.sampleRate,r(e.name)}function r(e){switch(e=e.toLowerCase()){case"avc1":case"avc3":s.push(e+".42E01E"),c=!0;break;case"hev1":case"hvc1":s.push(e+".1.6.L93.90"),c=!0;break;case"dvh1":case"dvhe":s.push(e+".05.04"),c=!0;break;case"vp09":s.push(e+".00.10.08"),c=!0;break;case"av01":s.push(e+".0.01M.08"),c=!0;break;case"mp4a":o.push("mp4a.40.2"),u=!0;break;case"ac-3":case"ec-3":case"ac-4":case"opus":case"flac":o.push(e),u=!0}}var a,o=[],s=[],u=!1,c=!1,d=null,h=null,f=null,p=null,g=null,m=null,v=null;if((new Ta).box("moov",Sa).box("trak",Sa).box("mdia",Sa).R("mdhd",(function(e){d=_o(e.reader,e.version).language})).box("minf",Sa).box("stbl",Sa).R("stsd",xa).box("mp4a",(function(e){var t=Fo(e.reader);p=t.channelCount,g=t.sampleRate,e.reader.sa()?Sa(e):r(e.name)})).box("esds",(function(e){e=e.reader;for(var t,n,i="mp4a";e.sa();){t=e.T();for(var r=e.T();128&r;)r=e.T();if(3==t)e.ma(),128&(r=e.T())&&e.ma(),64&r&&e.skip(e.T()),32&r&&e.ma();else if(4==t)n=e.T(),e.skip(12);else if(5==t)break}n&&(i+="."+Ho(n),5==t&&e.sa()&&(31==(n=(248&(t=e.T()))>>3)&&e.sa()&&(n=32+((7&t)<<3)+((224&e.T())>>5)),i+="."+n)),o.push(i),u=!0})).box("ac-3",i).box("ec-3",i).box("ac-4",i).box("Opus",i).box("fLaC",i).box("avc1",n).box("avc3",n).box("hev1",n).box("hvc1",n).box("dva1",n).box("dvav",n).box("dvh1",n).box("dvhe",n).box("vp09",n).box("av01",n).box("avcC",(function(e){var t=a||"";switch(a){case"dvav":t="avc3";break;case"dva1":t="avc1"}(e=e.reader).skip(1),e=t+"."+Ho(e.T())+Ho(e.T())+Ho(e.T()),s.push(e),c=!0})).box("hvcC",(function(e){var t=a||"";switch(a){case"dvh1":t="hvc1";break;case"dvhe":t="hev1"}var n=e.reader;n.skip(1);var i=["","A","B","C"][(e=n.T())>>6],r=31&e,o=n.P(),u=(32&e)>>5?"H":"L";e=[n.T(),n.T(),n.T(),n.T(),n.T(),n.T()],n=n.T();for(var l=0,d=0;32>d&&(l|=1&o,31!=d);d++)l<<=1,o>>=1;for(t=t+"."+i+r+"."+Ho(l,!0),t+="."+u+n,i="",r=e.length;r--;)((u=e[r])||i)&&(i="."+u.toString(16).toUpperCase()+i);t+=i,s.push(t),c=!0})).box("dvcC",(function(e){var t=a||"";switch(a){case"hvc1":t="dvh1";break;case"hev1":t="dvhe";break;case"avc1":t="dva1";break;case"avc3":t="dvav";break;case"av01":t="dav1"}var n=e.reader;n.skip(2),e=n.T(),n=n.T(),s.push(t+"."+Go(e>>1&127)+"."+Go(e<<5&32|n>>3&31)),c=!0})).box("dvvC",(function(e){var t=a||"";switch(a){case"hvc1":t="dvh1";break;case"hev1":t="dvhe";break;case"avc1":t="dva1";break;case"avc3":t="dvav";break;case"av01":t="dav1"}var n=e.reader;n.skip(2),e=n.T(),n=n.T(),s.push(t+"."+Go(e>>1&127)+"."+Go(e<<5&32|n>>3&31)),c=!0})).R("vpcC",(function(e){var t=a||"",n=e.reader;e=n.T();var i=n.T();n=n.T()>>4&15,s.push(t+"."+Go(e)+"."+Go(i)+"."+Go(n)),c=!0})).box("av1C",(function(e){var t=a||"";"dav1"===a&&(t="av01");var n=e.reader;n.skip(1);var i=(e=n.T())>>>5,r=(64&(n=n.T()))>>6;s.push(t+"."+i+"."+Go(31&e)+(n>>>7?"H":"M")+"."+Go(2===i&&r?(32&n)>>5?12:10:r?10:8)+"."+((16&n)>>4)+"."+((8&n)>>3)+((4&n)>>2)+(3&n)+"."+Go(1)+"."+Go(1)+"."+Go(1)+".0"),c=!0})).box("enca",Ea).box("encv",Aa).box("sinf",Sa).box("frma",(function(e){r(e=Vo(e.reader).codec)})).box("colr",(function(e){s=s.map((function(t){if(t.startsWith("av01.")){var n=e.reader,i=n.ya(),r=n.vb(4),a=String.fromCharCode(r[0]);if(a+=String.fromCharCode(r[1]),a+=String.fromCharCode(r[2]),"nclx"===(a+=String.fromCharCode(r[3]))){r=n.ma(),a=n.ma();var o=n.ma(),s=n.T()>>7,u=t.split(".");10==u.length&&(u[6]=Go(r),u[7]=Go(a),u[8]=Go(o),u[9]=String(s),t=u.join("."))}n.seek(i)}return t}));var t=function(e){var t=null,n=null,i=e.vb(4),r=String.fromCharCode(i[0]);if(r+=String.fromCharCode(i[1]),r+=String.fromCharCode(i[2]),"nclx"===(r+=String.fromCharCode(i[3]))){switch(e.ma()){case 1:case 5:case 6:case 7:t="srgb";break;case 9:t="rec2020";break;case 11:case 12:t="p3"}switch(i=e.ma(),e.ma(),i){case 1:case 6:case 13:case 14:case 15:n="SDR";break;case 16:n="PQ";break;case 18:n="HLG"}}return{colorGamut:t,Cd:n}}(e.reader),n=t.colorGamut;m=t.Cd,v=n})).parse(e||t,!0),!o.length&&!s.length)return null;var y=u&&!c,b=new Map;if(c){var w=new we("video/mp4");e&&w.init(e);try{w.i(t);for(var T=l(w.j()),S=T.next();!S.done;S=T.next()){var x=S.value;b.set(x,x)}}catch(e){}w.g()}return{type:y?"audio":"video",mimeType:y?"audio/mp4":"video/mp4",codecs:Cu(o.concat(s)).join(", "),language:d,height:h,width:f,channelCount:p,sampleRate:g,closedCaptions:b,Cd:m,colorGamut:v,frameRate:null}}(f,T)))return I.return(k);return S?I.return(Mu(S)):p?I.return(Mu(p)):I.return(n)}}))}(e,M),3);case 3:O=t.h,o=O.type,s=O.language,d=O.channelCount,g=O.sampleRate,e.g.disableText||(h=O.closedCaptions),R=O.height,D=O.width,L=O.Cd,N=O.colorGamut,j=O.frameRate,b&&(v=O.mimeType,a=O.codecs);case 2:if(v){t.u(4);break}return w(t,function(e,t,n,i){var r,a,o,s,u,l,c,d,h,f,p,g,m,v;return P((function(y){switch(y.g){case 1:return r=ca,a=Pm(e,i),2==(o=a.segment).status?y.return(Rm(t)):(s=o.N(),u=new Gn(s[0]),l=u.Ua.split(".").pop(),c=Hm[t],(d=c[l])||(d=Vm[l])||(d=Dm(t,n))?y.return(d):(f=1,p=aa(s,e.g.retryParameters),S(y,2),p.method="HEAD",w(y,_m(e,p,r,{type:f}).promise,4)));case 4:g=y.h,h=g.headers["content-type"],A(y,3);break;case 2:if(!(m=E(y))||1002!=m.code&&1001!=m.code){y.u(3);break}return p.method="GET",w(y,_m(e,p,r,{type:f}).promise,6);case 6:v=y.h,h=v.headers["content-type"];case 3:return h?y.return(h.toLowerCase().split(";")[0]):y.return(Rm(t))}}))}(e,o,a,M),5);case 5:v=t.h;case 4:return w(t,wm(e,i,v,r,n),6);case 6:if(U=t.h,_=U.drmInfos,B=U.keyIds,F=U.encrypted,V=U.zh,F&&!_.length&&!V)throw new De(2,4,4026);return(H=bm(e,a,o,s,u,c,d,h,f,p,g,m)).encrypted=F,H.drmInfos=_,H.keyIds=B,H.mimeType=v,C&&(H.bandwidth=C),om(H),"video"==o&&(D||R||L||N)&&Lm(H,D,R,j,L,null,N),Om(e)&&xm(e,i),G=M[0].startTime,K=M[M.length-1],X=K.endTime,q=new Zs(M),H.segmentIndex=q,W=!!(z=Fg(i.X,"EXT-X-SERVER-CONTROL"))&&null!=Lg(z,"CAN-SKIP-UNTIL"),Y=!!z&&null!=Lg(z,"CAN-BLOCK-RELOAD"),J=Vg(i.X,"EXT-X-MEDIA-SEQUENCE",0),$=ym(J,M),Q=$.sb,Z=$.ub,t.return({stream:H,type:o,Wg:[],N:r,xc:G,Lb:X,Jd:W,Id:Y,kd:!1,Ue:-1,sb:Q,ub:Z,Yd:k,zf:!1})}}))}function ym(e,t){e=e+t.length-1;var n=-1;if(!t.length)return{sb:++e,ub:n};var i=(t=t[t.length-1]).g;return t.g.length?(n=i.length-1,i[i.length-1].isPreload()||(e++,n=0),{sb:e,ub:n}):(e++,t.m&&(n=0),{sb:e,ub:n})}function bm(e,t,n,i,r,a,o,s,u,c,d,h){var f=Dm(n,t)||Rm(n),p=[];if(u)for(var g=(u=l(u.split(","))).next();!g.done;g=u.next())p.push(g.value);return u=void 0,g=null,n==yi?u=p.includes("public.accessibility.transcribes-spoken-dialog")&&p.includes("public.accessibility.describes-music-and-sound")?"caption":"subtitle":p.includes("public.accessibility.describes-video")&&(g="visually impaired"),p.length||"subtitle"!==u||p.push("subtitle"),om(e={id:e.C++,originalId:a,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:f,codecs:t,kind:n==yi?"subtitle":void 0,encrypted:!1,drmInfos:[],keyIds:new Set,language:Yi(i||"und"),originalLanguage:i,label:a,type:n,primary:r,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:void 0,pixelAspectRatio:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:p,forced:c,channelsCount:o,audioSamplingRate:d,spatialAudio:h,closedCaptions:s,hdr:void 0,colorGamut:void 0,videoLayout:void 0,tilesLayout:void 0,accessibilityPurpose:g,external:!1,fastSwitching:!1,fullMimeTypes:new Set,isAudioMuxedInVideo:!1}),e}function wm(e,t,n,i,r){var a,o,s,u,c,d,h,f,p,g,m,v,y,b,T,S,x,A,E,k,I,M,C,D,R,L,N,j;return P((function(P){switch(P.g){case 1:if(a=new Map,t.segments)for(o=l(t.segments),s=o.next();!s.done;s=o.next())if(u=s.value,c=_g(u.X,"EXT-X-KEY"),d=null,c.length)for(d=Em(e,t,u.X,i,r),h=l(c),f=h.next();!f.done;f=h.next())p=f.value,a.set(p,d);m=g=!1,v=[],y=new Set,b=l(a),T=b.next();case 2:if(T.done){P.u(4);break}if(S=T.value,x=l(S),A=x.next().value,E=x.next().value,I=E,"NONE"==(M=jg(k=A,"METHOD"))){P.u(3);break}if(g=!0,C=Ng(k,"KEYFORMAT")||"identity",D=null,Bm(M)){m=!0,P.u(3);break}if("identity"!=C){D=(R=Km[C])?R(k,n):null,P.u(6);break}return w(P,Fm(e,k,n,i,I,r),8);case 8:D=P.h;case 6:if(D){if(D.keyIds)for(L=l(D.keyIds),N=L.next();!N.done;N=L.next())j=N.value,y.add(j);v.push(D)}case 3:T=b.next(),P.u(2);break;case 4:return P.return({drmInfos:v,keyIds:y,encrypted:g,zh:m})}}))}function Tm(t,n,i,r,a){if(!e.crypto||!e.crypto.subtle)throw W("Web Crypto API is not available to decrypt AES. (Web Crypto only exists in secure origins like https)"),new De(2,4,4042);var o=0,s=Ng(n,"IV","");if(s){var u=li(s.substr(2));if(16!=u.byteLength)throw new De(2,4,4048)}else o=Vg(i.X,"EXT-X-MEDIA-SEQUENCE",0);if(i=n.toString()+"-"+o,!t.ja.has(i)){var l={bitsKey:128,blockCipherMode:"CBC",iv:u,firstMediaSequenceNumber:o};switch(jg(n,"METHOD")){case"AES-256":l.bitsKey=256;break;case"AES-256-CTR":l.bitsKey=256,l.blockCipherMode="CTR"}l.fetchKey=function(){var i,o,s,u,c,d;return P((function(h){if(1==h.g)return i=Hg(r(),jg(n,"URI"),a),o=i.sort().join(""),t.L.has(o)||(s=aa(i,t.g.retryParameters),u=_m(t,s,6).promise,t.L.set(o,u)),w(h,t.L.get(o),2);if(3!=h.g){if(!(c=h.h).data||c.data.byteLength!=l.bitsKey/8)throw new De(2,4,4049);return d={name:"CTR"==l.blockCipherMode?"AES-CTR":"AES-CBC",length:l.bitsKey},w(h,e.crypto.subtle.importKey("raw",c.data,d,!0,["decrypt"]),3)}l.cryptoKey=h.h,l.fetchKey=void 0,T(h)}))},t.ja.set(i,l)}return t.ja.get(i)}function Sm(e,t){null==e.s&&(t=Fg(t.X,"EXT-X-START"))&&(e.s=Number(jg(t,"TIME-OFFSET")))}function xm(e,t){var n=1/0,i=t.segments;if(i.length)for(var r=i.length-1;0<=r;){var a=Fg(i[r].X,"EXTINF");if(a){n=Number(a.value.split(",")[0]);break}r--}if(!(i=Fg(t.X,"EXT-X-TARGETDURATION")))throw new De(2,4,4024,"EXT-X-TARGETDURATION");i=Number(i.value),(r=Fg(t.X,"EXT-X-PART-INF"))&&(e.Y=Number(jg(r,"PART-TARGET"))),t=Fg(t.X,"EXT-X-SERVER-CONTROL"),e.K&&e.Y?(e.o=e.Ib?5*e.Y<=n?Math.min(e.Y,e.o):Math.min(n,e.o):Math.min(e.Y,e.o),e.Ga=t?Number(jg(t,"PART-HOLD-BACK")):0):(e.o=Math.min(n,e.o),n=t?Lg(t,"HOLD-BACK"):null,e.Ba=n?Number(n.value):0),e.La=Math.max(i,e.La)}function Am(e,t){var n=0;if(e.g.defaultPresentationDelay)n=e.g.defaultPresentationDelay;else if(e.Ga)n=e.Ga;else if(e.Ba)n=e.Ba;else{var i=t.segments.length,r=e.g.hls.liveSegmentsDelay;for(r>i-2&&(r=Math.max(1,i-2)),r=i-r;r<i;r++){var a=Fg(t.segments[r].X,"EXTINF");n=a?n+Math.ceil(Number(a.value.split(",")[0])):n+e.La}}e.s&&0>e.s&&(n=Math.min(-e.s,n),e.s+=n),e.l.gh(0),e.l.Sf(n),e.l.Bc(!1)}function Em(e,t,n,i,r){var a=Fg(n,"EXT-X-MAP");if(!a)return null;var o=jg(a,"URI"),s=Hg(i(),o,r);if(o=[s.toString(),Ng(a,"BYTERANGE","")].join("-"),!e.ta.has(o)){for(var u=void 0,c=null,d=(n=l(n)).next();!d.done;d=n.next())"EXT-X-KEY"==(d=d.value).name?Bm(jg(d,"METHOD"))&&d.id<a.id&&(u=Tm(e,d,t,i,r)):"EXT-X-BYTERANGE"==d.name&&d.id<a.id&&(c=d);t=function(e,t,n,i){var r=0,a=null;return!(t=Ng(t,"BYTERANGE"))&&n&&(t=n.value),t&&(r=t.split("@"),a=Number(r[0]),a=(r=Number(r[1]))+a-1,i&&((n=a+1-r)%16&&(a+=16-n%16))),new go((function(){return e}),r,a,null,null,null,i)}(s,a,c,u),e.ta.set(o,t)}return e.ta.get(o)}function km(t,n,i,r,a,o,s,u,c){function d(e){e=new Gn(e).Ua.split(".").pop();var t=Hm[s][e];return t||(t=Vm[e]),t}var h=r.X,f=Fg(h,"EXTINF"),p=0,g=0,m=null;r.Cb.length&&(t.m.isLowLatency=!0);var v=null;if(!t.g.hls.ignoreManifestProgramDateTime){var y=Fg(h,"EXT-X-PROGRAM-DATE-TIME");y&&y.value&&(v=Kt(y.value),t.bc=!0)}var b=bo;if(Fg(h,"EXT-X-GAP")&&(t.m.gapCount++,b=2),!f){if(0==r.Cb.length)throw new De(2,4,4024,"EXTINF");if(!t.K)return null}var w=[];y=!1;var T=null,S=!1,x=!1;if(t.K&&r.Cb.length){p=n&&e.ReadableStream&&t.g.hls.allowLowLatencyByteRangeOptimization;for(var A=v,E={},k=0;k<r.Cb.length;E={xe:void 0,fe:void 0},k++){var I=r.Cb[k],M=0==k?i:w[w.length-1],C=0==k?a:M.endTime,D=Number(Ng(I,"DURATION"))||t.Y;if(D){var R=C+D,P=0,L=null;if("EXT-X-PRELOAD-HINT"==I.name?(P=(P=Ng(I,"BYTERANGE-START"))?Number(P):0,(M=Ng(I,"BYTERANGE-LENGTH"))?L=P+Number(M)-1:P&&(L=Number.MAX_SAFE_INTEGER)):(P=(L=l(Im(M,P=Ng(I,"BYTERANGE")))).next().value,L=L.next().value),E.fe=Ng(I,"URI"),E.fe){M=bo,"YES"==Ng(I,"GAP")&&(t.m.gapCount++,M=2,S=!0),E.xe=null;var N=function(e){return function(){return null==e.xe&&(e.xe=Hg(u(),e.fe,o)),e.xe}}(E);p&&0<=P&&null!=L&&(T=N,y=!0),C=new vo(C,R,N,P,L,n,0,0,1/0,[],"",null,A,M,c),"EXT-X-PRELOAD-HINT"==I.name&&(C.Af(),x=!0),"YES"!=Ng(I,"INDEPENDENT")&&0<k&&C.Pc(),(E=d(E.fe))&&(C.mimeType=E,Gm.has(E)&&(C.ba=null)),w.push(C),A&&(A+=D)}}}}if(f){if(0==(f=Number(f.value.split(",")[0])))return null;p=a+f}else{if(!w.length)return null;p=w[w.length-1].endTime}y&&(S||0!=w[0].Ja?(y=!1,T=null):w=[]),(f=Fg(h,"EXT-X-BYTERANGE"))?(g=(m=l(Im(i,f.value))).next().value,m=m.next().value):w.length&&(g=w[0].Ja,m=w[w.length-1].va),i="",f=null,"image"==s&&(i="1x1",h=Fg(h,"EXT-X-TILES"))&&(i=jg(h,"LAYOUT"),(h=Ng(h,"DURATION"))&&(f=Number(h)));var j=null;return n=new vo(a,p,(function(){return T?T():(null==j&&(j=Hg(u(),r.g,o)),j||[])}),g,m,n,0,0,1/0,w,i,f,v,b,c,0<w.length&&!!r.g),(a=d(r.g))&&(n.mimeType=a,Gm.has(a)&&(n.ba=null)),y&&(t.Ib=!0,n.Lg(),x&&n.Af()),n}function Im(e,t){var n=0,i=null;return t&&(n=t.split("@"),t=Number(n[0]),i=(n=n[1]?Number(n[1]):e.va+1)+t-1),[n,i]}function Mm(e,t,n,i,r){if("video"==n||"audio"==n){var a=e.l.m;if(a&&!mm(e,n))for(t=(t=_g(t,"EXT-X-DATERANGE")).sort((function(e,t){return(e=jg(e,"START-DATE"))<(t=jg(t,"START-DATE"))?-1:e>t?1:0})),n=0;n<t.length;n++){var o=t[n];try{var s=jg(o,"ID");if(!e.Aa.has(s)){var u=Kt(jg(o,"START-DATE"));if(!isNaN(u)){var c=Math.max(0,u-a),d=null,h=Ng(o,"END-DATE");if(h){var f=Kt(h);if(!isNaN(f)&&0>(d=f-a))continue}if(null==d){var p=Ng(o,"DURATION")||Ng(o,"PLANNED-DURATION");if(p){var g=parseFloat(p);if(isNaN(g)||(d=c+g),0>u-a+g)continue}}var m=Ng(o,"CLASS")||"com.apple.quicktime.HLS",v="YES"==Ng(o,"END-ON-NEXT");if(null==d&&v){for(var y=n+1;y<t.length;y++)if(m==(Ng(t[y],"CLASS")||"com.apple.quicktime.HLS")){var b=Kt(jg(t[y],"START-DATE"));if(!isNaN(b)&&b&&b>u){d=Math.max(0,b-a);break}}if(null==d)continue}y=["CLASS","START-DATE","END-DATE","DURATION","END-ON-NEXT"];for(var w=[],T=l(o.attributes),S=T.next();!S.done;S=T.next()){var x=S.value;if(!y.includes(x.name)){var A=Kg(x.value,i);"X-ASSET-URI"!=x.name&&"X-ASSET-LIST"!=x.name||(A=Hg(r(),x.value,i)[0]),w.push({key:x.name,description:"",data:A,mimeType:null,pictureType:null})}}1<w.length&&e.h.onMetadata(m,c,d,w),e.Aa.add(s)}}}catch(e){}}}}function Cm(e,t,n,i,r,a){var o=t.segments,s=void 0,u=Vg(t.X,"EXT-X-DISCONTINUITY-SEQUENCE",-1),c=Vg(t.X,"EXT-X-MEDIA-SEQUENCE",0),d=Fg(t.X,"EXT-X-SKIP"),h=d?Number(Ng(d,"SKIPPED-SEGMENTS")):0,f=c+h,p=0;Om(e)&&n.has(f)&&(p=n.get(f)),0===p&&e.xa==zm&&0<n.size&&!n.has(f)&&null!=e.l.i&&(p=e.l.qb());var g=[],m=null;d=[];for(var v=0;v<o.length;v++){var y=o[v],b=0==v?p:m.endTime;f=c+h+v,Fg(y.X,"EXT-X-DISCONTINUITY")&&u++;for(var w=l(y.X),T=w.next();!T.done;T=w.next())"EXT-X-KEY"==(T=T.value).name&&(s=Bm(jg(T,"METHOD"))?Tm(e,T,t,r,i):void 0);n.set(f,b),w=Em(e,t,y.X,r,i),!e.K&&e.h.isAutoLowLatencyMode()&&(e.h.enableLowLatencyMode(),e.K=e.h.isLowLatencyMode()),(b=km(e,w,m,y,b,i,a,r,s))&&((m=Vg(y.X,"EXT-X-BITRATE"))?d.push({bitrate:m,duration:b.endTime-b.startTime}):d.length&&((m=d.pop()).duration+=b.endTime-b.startTime,d.push(m)),m=b,b.i=u,mm(e,a)&&null!=e.I&&f<e.I||g.push(b))}if(t=void 0,d.length&&(t=d.reduce((function(e,t){return e+t.duration}),0),t=Math.round(d.reduce((function(e,t){return e+t.bitrate*t.duration}),0)/t*1e3)),d=g.some((function(e){return null!=e.h})))for(n={},i=0;i<g.length;n={Nd:void 0,Md:void 0,Fd:void 0,zc:void 0,Ed:void 0},i++)if(n.zc=g[i],null==n.zc.h)for(n.Md=0,n.Nd=i,r=function(e){return function(){var t=g[e.Nd];if(t){if(null!=t.h)return t.h+e.Md;e.Md-=t.endTime-t.startTime,e.Nd+=1}return null}}(n),n.Ed=0,n.Fd=i,o=function(e){return function(){var t=g[e.Fd];if(t){if(t!=e.zc&&(e.Ed+=t.endTime-t.startTime),null!=t.h)return t.h+e.Ed;--e.Fd}return null}}(n);null==n.zc.h;)n.zc.h=o(),null==n.zc.h&&(n.zc.h=r());if(d)for(i=(n=l(g)).next();!i.done;i=n.next())for(i=(r=i.value).h,o=(r=l(r.g)).next();!o.done;o=r.next())(o=o.value).h=i,i+=o.endTime-o.startTime;if(n=e.ga,d&&1/0!=n&&!mm(e,a))for(a=(e=l(g)).next();!a.done;a=e.next())a.value.Yf(n);return{segments:g,bandwidth:t}}function Dm(e,t){if(e==yi){if("vtt"==t||"wvtt"==t)return"text/vtt";if(t&&""!==t)return"application/mp4"}return"image"!=e||t&&"jpeg"!=t?"audio"==e&&"mp4a.40.34"==t?"audio/mpeg":"mjpg"==t?"application/mp4":null:"image/jpeg"}function Rm(e){return e==yi?"text/vtt":Hm[e].mp4}function Pm(e,t){for(var n=t[e=Om(e)?Math.trunc((t.length-1)/2):0];2==n.$b()&&e+1<t.length;)n=t[++e];return{segment:n,segmentIndex:e}}function Lm(e,t,n,i,r,a,o){e&&(e.width=Number(t)||void 0,e.height=Number(n)||void 0,e.frameRate=Number(i)||void 0,e.hdr=r||void 0,e.videoLayout=a||void 0,e.colorGamut=o||void 0)}function Nm(e,t,n){return _m(e,aa(t,e.g.retryParameters),0,{type:n?2:3})}function jm(e){var t,n,i,r,a,o;return P((function(s){switch(s.g){case 1:return e.h?(S(s,2),t=Date.now(),w(s,e.update(),4)):s.return();case 4:n=Date.now(),Om(e)&&(i=(n-t)/1e3,e.Gb.sample(1,i),r=0<e.g.hls.updatePeriod?e.g.hls.updatePeriod:e.o,a=Math.max(0,r-K(e.Gb)),e.B.$(a)),A(s,3);break;case 2:if(o=E(s),!e.h)return s.return();if(e.g.raiseFatalErrorOnManifestUpdateRequestFailure)return e.h.onError(o),s.return();o.severity=1,e.h.onError(o),e.B.$(.1);case 3:if(!e.h)return s.return();e.h.onManifestUpdated(),T(s)}}))}function Om(e){return e.xa!=Xm}function Um(e,t){e.xa=t,e.l&&e.l.Bc(!Om(e)),Om(e)||e.B.stop()}function _m(e,t,n,i){if(!e.da)throw new De(2,7,7001);return i||(i={}),i.isPreload=e.Hb(),t=e.h.networkingEngine.request(n,t,i),ta(e.da,t),t}function Bm(e){return"AES-128"==e||"AES-256"==e||"AES-256-CTR"==e}function Fm(e,t,n,i,r,a){var o,s,u,l,c,d,h,f,p,g,m,v,y;return P((function(b){switch(b.g){case 1:if("video/mp2t"==n)throw new De(2,4,4040);if(ot())throw new De(2,4,4041);if(o=jg(t,"METHOD"),!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(o))return b.return(null);if((s=Hg(i(),jg(t,"URI"),a))[0].startsWith("data:text/plain;base64,")){u=ci(ui(s[0].split("data:text/plain;base64,").pop())),b.u(2);break}return l=s.sort().join(""),e.ra.has(l)||(c=aa(s,e.g.retryParameters),d=_m(e,c,6).promise,e.ra.set(l,d)),w(b,e.ra.get(l),3);case 3:h=b.h,u=ci(h.data);case 2:if(f="00000000000000000000000000000000",!r){b.u(4);break}if(e.na.has(r)){p=e.na.get(r),b.u(5);break}return g=Ru(r.N(),r.Zb(),r.Xb(),e.g.retryParameters),w(b,_m(e,g,ca,{type:0}).promise,6);case 6:m=b.h,p=function(e){var t=null;return(new Ta).box("moov",Sa).box("trak",Sa).box("mdia",Sa).box("minf",Sa).box("stbl",Sa).R("stsd",xa).box("encv",Aa).box("enca",Ea).box("sinf",Sa).box("schi",Sa).R("tenc",(function(e){(e=e.reader).T(),e.T(),e.T(),e.T(),t=ci(e.vb(16))})).parse(e,!0),t}(m.data),e.na.set(r,p);case 5:p&&(f=p);case 4:return(v=new Map).set(f,u),y="cenc","SAMPLE-AES"==o&&(y="cbcs"),b.return(pi(v,y))}}))}F("shaka.net.DataUriPlugin",Jg),Jg.parse=$g,ia("data",$g),(i=Zg.prototype).configure=function(e,t){var n=this.h&&e.hls.updatePeriod!=this.g.hls.updatePeriod&&0<=e.hls.updatePeriod;this.g=e,t&&(this.Hb=t),this.j&&this.j.configure(this.g),n&&this.m&&this.m.presentationTimeline.U()&&this.B.hc()},i.start=function(e,t){var n,i=this;return P((function(r){return 1==r.g?(i.h=t,i.K=t.isLowLatencyMode(),w(r,Nm(i,[e]).promise,2)):3!=r.g?(n=r.h,i.M=n.uri,w(r,function(e,t,n){var i,r,a,o,s,u,d,h,f,p,g,m,v,y,b,T,x,A,k,I,M,C,D,R,L,N,j,O,U,_,B,F,V;return P((function(H){switch(H.g){case 1:return i=bi,r=qg(e.Ka,t),a=_g(r.X,"EXT-X-DEFINE"),o=[],s=[],u=[],e.l=new Ls(null,0),e.l.Bc(!0),d=function(){return[n]},h=null,f=new Map,1==r.type?(e.S=!1,A=_g(r.X,"EXT-X-DEFINE"),f=am(e,A,e.M),h=i.la,k="",I=new Map,w(H,vm(e,e.C++,f,r,d,"",h,k,!0,"Media Playlist",null,I,null,!1,null,!1),7)):(function(e,t){for(var n=new Gn(e.M).g,i=(t=l(t)).next();!i.done;i=t.next()){var r=i.value;i=Ng(r,"NAME");var a=Ng(r,"VALUE");r=Ng(r,"QUERYPARAM"),i&&a&&(e.A.has(i)||e.A.set(i,a)),r&&(i=n.get(r)[0])&&!e.A.has(i)&&e.A.set(r,i)}}(e,a),p=_g(r.X,"EXT-X-MEDIA"),g=_g(r.X,"EXT-X-STREAM-INF"),m=_g(r.X,"EXT-X-IMAGE-STREAM-INF"),v=_g(r.X,"EXT-X-I-FRAME-STREAM-INF"),y=_g(r.X,"EXT-X-SESSION-KEY"),b=_g(r.X,"EXT-X-SESSION-DATA"),T=_g(r.X,"EXT-X-CONTENT-STEERING"),function(e,t){for(var n=(t=l(t)).next();!n.done;n=t.next()){var i=n.value,r=Ng(i,"DATA-ID");n=Ng(i,"URI");var a=Ng(i,"LANGUAGE");i=Ng(i,"VALUE"),r=(new Map).set("id",r),n&&r.set("uri",Hg([e.M],n,e.A)[0]),a&&r.set("language",a),i&&r.set("value",i),n=new Jr("sessiondata",r),e.h&&e.h.onEvent(n)}}(e,b),w(H,function(e,t){var n,i,r,a,o,s;return P((function(u){if(!e.h||!e.g)return u.return();for(i=l(t),r=i.next();!r.done;r=i.next())if(a=r.value,o=Ng(a,"PATHWAY-ID"),s=Ng(a,"SERVER-URI"),o&&s){e.j=new mp(e.h),e.j.configure(e.g),e.j.i=[e.M],e.j.setManifestType("HLS"),e.j.h=o,n=vp(e.j,s);break}return w(u,n,0)}))}(e,T),4));case 4:return function(e,t){for(var n=(t=l(t)).next();!n.done;n=t.next()){var i=n.value,r=Ng(i,"AUDIO");n=Ng(i,"VIDEO");var a=Ng(i,"SUBTITLES");if(i=um(e,i),a){var o=mi(yi,i);e.G.set(a,o),Ie(i,o)}r&&((a=mi("audio",i))||(a=e.g.hls.defaultAudioCodec),e.G.set(r,a)),n&&((r=mi("video",i))||(r=e.g.hls.defaultVideoCodec),e.G.set(n,r))}}(e,g),function(e,t){t=Bg(t,"CLOSED-CAPTIONS"),e.S=0==t.length;for(var n=(t=l(t)).next();!n.done;n=t.next()){var i=n.value,r=Ng(i,"LANGUAGE");n=Yi(r||"und"),r||(r=Ng(i,"NAME"))&&(n=r),r=jg(i,"GROUP-ID"),i=jg(i,"INSTREAM-ID").replace("SERVICE","svc"),e.F.get(r)||e.F.set(r,new Map),e.F.get(r).set(i,n)}}(e,p),x=function(e,t){return t.map((function(t){return"video"!==(t=dm(e,t)).stream.type?null:t.stream})).filter((function(e){return e}))}(e,v),w(H,function(e,t,n,i,r,a,o){var s,u,d,h,f,p,g,m,v,y,b,T,S,x,A,E,k,I,M,C,D,R,L,N,j,O,U,_,B,F,V,H,G,K,X;return P((function(P){switch(P.g){case 1:if(s=[],u=new Set,!(0<n.length)){P.u(2);break}d=l(n),h=d.next();case 3:if(h.done){P.u(2);break}if(f=h.value,p=jg(f,"METHOD"),g=Ng(f,"KEYFORMAT")||"identity",m=null,"NONE"==p){P.u(4);break}if(Bm(p)){v=Hg(r(),jg(f,"URI"),a),y=v.sort().join(""),e.L.has(y)||(b=aa(v,e.g.retryParameters),T=_m(e,b,6).promise,e.L.set(y,T)),P.u(4);break}if("identity"!=g){m=(S=Km[g])?S(f,""):null,P.u(6);break}return w(P,Fm(e,f,"",r,null,a),9);case 9:m=P.h;case 6:if(m){if(m.keyIds)for(x=l(m.keyIds),A=x.next();!A.done;A=x.next())E=A.value,u.add(E);s.push(m)}case 4:h=d.next(),P.u(3);break;case 2:for(k={},I=l(t),M=I.next();!M.done;M=I.next())C=M.value,D=Pg(C,!e.j),k[D]?k[D].push(C):k[D]=[C];for(L in R=[],k)N=k[L],j=N[0],O=Ng(j,"FRAME-RATE"),U=Number(Ng(j,"AVERAGE-BANDWIDTH"))||Number(jg(j,"BANDWIDTH")),_=Ng(j,"RESOLUTION"),B=l(_?_.split("x"):[null,null]),F=B.next().value,V=B.next().value,H=Ng(j,"VIDEO-RANGE"),(G=Ng(j,"REQ-VIDEO-LAYOUT"))&&G.includes(",")&&(K=G.split(",").filter((function(e){return"CH-STEREO"==e||"CH-MONO"==e})),G=K[0]),G=G||"CH-MONO",X=sm(e,N,i),R.push.apply(R,c(lm(e,X.audio,X.video,U,F,V,O,H,G,s,u,o)));return P.return(R.filter((function(e){return null!=e})))}}))}(e,g,y,p,d,e.A,x),5);case 5:return o=H.h,s=function(e,t){var n=Bg(t,"SUBTITLES");t=n.map((function(t){if(e.g.disableText)return null;try{return cm(e,[t],new Map).stream}catch(t){if(e.g.hls.ignoreTextStreamFailures)return null;throw t}}));for(var i=(n=l(n)).next();!i.done;i=n.next()){var r=jg(i.value,"GROUP-ID");if((i=e.G.get(r))&&(r=e.H.get(r)))for(var a=(r=l(r)).next();!a.done;a=r.next())(a=a.value).stream.codecs=i,a.stream.mimeType=Dm(yi,i)||Rm(yi),om(a.stream)}return t.filter((function(e){return e}))}(e,p),w(H,function(e,t,n){var i,r;return P((function(a){return 1==a.g?(i=t.map((function(t){var n,i;return P((function(r){if(1==r.g)return e.g.disableThumbnails?r.return(null):(S(r,2),w(r,function(e,t){var n,i,r,a,o,s,u,l,c,d;return P((function(h){return 1==h.g?(n=jg(t,"URI"),i=Ng(t,"CODECS","jpeg")||"",e.i.has(n)?h.return(e.i.get(n)):(r=Ng(t,"LANGUAGE"),a=Ng(t,"NAME"),o=Ng(t,"CHARACTERISTICS"),s=hm(e,e.C++,[n],i,"image",r,!1,a,null,null,o,!1,null,!1),(u=Ng(t,"RESOLUTION"))?w(h,s.stream.createSegmentIndex(),3):h.u(2))):(2!=h.g&&(l=eu(s.stream.segmentIndex),c=l.tilesLayout)&&(s.stream.width=Number(u.split("x")[0])*Number(c.split("x")[0]),s.stream.height=Number(u.split("x")[1])*Number(c.split("x")[1])),(d=Ng(t,"BANDWIDTH"))&&(s.stream.bandwidth=Number(d)),e.i.set(n,s),h.return(s))}))}(e,t),4));if(2!=r.g)return n=r.h,r.return(n.stream);if(i=E(r),e.g.hls.ignoreImageStreamFailures)return r.return(null);throw i}))})).concat(n.map((function(t){if(e.g.disableThumbnails)return null;try{var n=dm(e,t);return"image"!==n.stream.type?null:n.stream}catch(t){if(e.g.hls.ignoreImageStreamFailures)return null;throw t}}))),w(a,Promise.all(i),2)):(r=a.h,a.return(r.filter((function(e){return e}))))}))}(e,m,v),6);case 6:u=H.h,H.u(3);break;case 7:M=H.h,e.i.set(n,M),M.stream&&(C=Iu(M.stream),M.stream.segmentIndex.yb((function(e){e.ba&&(e.ba.Qc=C)}))),h=M.stream.type,o.push({id:0,language:Yi(k||"und"),disabledUntilTime:0,primary:!0,audio:"audio"==h?M.stream:null,video:"video"==h?M.stream:null,bandwidth:M.stream.bandwidth||0,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});case 3:if(!e.h)throw new De(2,7,7001);if(Sm(e,r),1==r.type&&(Om(e)&&(Am(e,r),D=e.o,e.B.$(D)),R=Array.from(e.i.values()),gm(e,R),rm(e),Mm(e,r.X,h,f,d)),e.m={presentationTimeline:e.l,variants:o,textStreams:s,imageStreams:u,offlineSessionIds:[],minBufferTime:0,sequenceMode:e.g.hls.sequenceMode,ignoreManifestTimestampsInSegmentsMode:e.g.hls.ignoreManifestTimestampsInSegmentsMode,type:"HLS",serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,isLowLatency:!1,startTime:e.s},e.fa||!e.g.hls.disableCodecGuessing){H.u(8);break}for(L=[],N=l(e.m.variants),j=N.next();!j.done;j=N.next())(O=j.value).audio&&""===O.audio.codecs&&L.push(O.audio.createSegmentIndex()),O.video&&""===O.video.codecs&&L.push(O.video.createSegmentIndex());return w(H,Promise.all(L),8);case 8:if(e.h.makeTextStreamsForClosedCaptions(e.m),1==o.length){for(U=[],_=o[0],B=l([_.video,_.audio]),F=B.next();!F.done;F=B.next())(V=F.value)&&!V.segmentIndex&&U.push(V.createSegmentIndex());if(0<U.length)return w(H,Promise.all(U),0)}H.u(0)}}))}(i,n.data,e),3)):r.return(i.m)}))},i.stop=function(){this.B&&(this.B.stop(),this.B=null);var e=[];return this.da&&(e.push(this.da.destroy()),this.da=null),this.g=this.h=null,this.Na.clear(),this.m=null,this.i.clear(),this.H.clear(),this.G.clear(),this.A.clear(),this.ta.clear(),this.ja.clear(),this.L.clear(),this.ra.clear(),this.na.clear(),this.Aa.clear(),this.j&&this.j.destroy(),this.Z&&(this.Z.release(),this.Z=null),Promise.all(e)},i.update=function(){var e,t,n,i,r,a,o,s,u,d,h,f=this;return P((function(p){if(1==p.g){if(!Om(f))return p.return();for(e=[],t=Array.from(f.i.values()),f.o=1/0,f.m.gapCount=0,n=t.filter((function(e){return e.stream.segmentIndex})),i=l(n),r=i.next();!r.done;r=i.next())a=r.value,e.push(tm(f,a));return w(p,Promise.all(e),2)}for(pm(f,n.map((function(e){return e.stream}))),o=n.some((function(e){return 0==e.kd})),n.length&&!o&&(Um(f,Wm.vh),s=n.map((function(e){return e.Lb})),f.l.bb(Math.min.apply(Math,c(s))),f.h.updateDuration()),o&&rm(f),u=l(n),d=u.next();!d.done;d=u.next())(h=d.value).stream.isAudioMuxedInVideo||!h.stream.segmentIndex||eu(h.stream.segmentIndex)||f.h.disableStream(h.stream);T(p)}))},i.onExpirationUpdated=function(){},i.onInitialVariantChosen=function(){},i.banLocation=function(e){this.j&&this.j.banLocation(e)},i.setMediaElement=function(e){this.aa=e},F("shaka.hls.HlsParser",Zg);var Vm={aac:"audio/aac",ac3:"audio/ac3",ec3:"audio/ec3",mp3:"audio/mpeg"},Hm={audio:{mp4:"audio/mp4",mp4a:"audio/mp4",m4s:"audio/mp4",m4i:"audio/mp4",m4a:"audio/mp4",m4f:"audio/mp4",cmfa:"audio/mp4",ts:"video/mp2t",tsa:"video/mp2t"},video:{mp4:"video/mp4",mp4v:"video/mp4",m4s:"video/mp4",m4i:"video/mp4",m4v:"video/mp4",m4f:"video/mp4",cmfv:"video/mp4",ts:"video/mp2t",tsv:"video/mp2t"},text:{mp4:"application/mp4",m4s:"application/mp4",m4i:"application/mp4",m4f:"application/mp4",cmft:"application/mp4",vtt:"text/vtt",webvtt:"text/vtt",ttml:"application/ttml+xml"},image:{jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"}},Gm=new Set(["video/mp2t"].concat(c(ji))),Km={"com.apple.streamingkeydelivery":function(e,t){if("video/mp2t"==t)throw new De(2,4,4040);if(ot())throw new De(2,4,4041);if(t=jg(e,"METHOD"),!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(t))return null;var n="cenc";return"SAMPLE-AES"==t&&(n="cbcs"),fi("com.apple.fps",n,[{initDataType:"sinf",initData:new Uint8Array(0),keyId:null}],jg(e,"URI"))},"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(e){var t=jg(e,"METHOD");if(!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(t))return null;var n="cenc";return"SAMPLE-AES"==t&&(n="cbcs"),n=fi("com.widevine.alpha",n,[{initDataType:"cenc",initData:t=ge((t=Qg((t=jg(e,"URI")).split("?")[0])).data)}]),(e=Ng(e,"KEYID"))&&(n.keyIds=new Set([e.toLowerCase().substr(2)])),n},"com.microsoft.playready":function(e){var t=jg(e,"METHOD");if(!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(t))return null;var n="cenc";return"SAMPLE-AES"==t&&(n="cbcs"),fi("com.microsoft.playready",n,[{initDataType:"cenc",initData:e=La(e=ge((e=Qg((e=jg(e,"URI")).split("?")[0])).data),t=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),new Set,0)}])}},Xm="VOD",qm="EVENT",zm="LIVE",Wm={vh:Xm,uj:qm,Cj:zm};function Ym(e){if(e=Jm(e))e:{for(var t=(e=l(Ut(e,"DATA"))).next();!t.done;t=e.next())if(t=_t(t.value,"LA_URL")){e=jt(t);break e}e=""}else e="";return e}function Jm(e){return(e=function(e){var t=0,n=ve(e),i=n.getUint32(t,!0);if(i!=e.byteLength)return[];e:{for(e=t+6,t=[];e<n.byteLength-1;){i=n.getUint16(e,!0),e+=2;var r=n.getUint16(e,!0);if(e+=2,1&r||r+e>n.byteLength){n=[];break e}var a=ge(n,e,r);t.push({type:i,value:a}),e+=r}n=t}return n}(e=ui(jt(e))).filter((function(e){return e.type===$m}))[0])&&(e=Dt(e=ht(e.value,!0),"WRMHEADER"))?e:null}co["application/x-mpegurl"]=function(){return new Zg},co["application/vnd.apple.mpegurl"]=function(){return new Zg};var $m=1,Qm=(new Map).set("com.microsoft.playready",Ym).set("com.microsoft.playready.recommendation",Ym).set("com.microsoft.playready.software",Ym).set("com.microsoft.playready.hardware",Ym);function Zm(e){if(!cv){cv=!0;var t=new Uint8Array([105,115,111,109]),n=new Uint8Array([97,118,99,49]),i=new Uint8Array([0,0,0,1]);Sv=lv("ftyp",t,i,t,n),t=lv("dref",xv),Av=lv("dinf",t)}this.g=e}function ev(e){for(var t=[],n=l(e.g),i=n.next();!i.done;i=n.next()){var r=t,a=r.push,o=i.value;i=lv;var s=o.id+1,u=o.stream.width||0,d=o.stream.height||0;"audio"==o.type&&(d=u=0);var h=o.duration*o.timescale,f=Math.floor(h/(dv+1));switch(h=Math.floor(h%(dv+1)),s=lv("tkhd",s=new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3].concat(c(sv(s,4)),[0,0,0,0],c(sv(f,4)),c(sv(h,4)),[0,0,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,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0],c(sv(u,2)),[0,0],c(sv(d,2)),[0,0]))),u=lv,f=o.duration*o.timescale,d=Math.floor(f/(dv+1)),f=Math.floor(f%(dv+1)),h=(h=o.stream.language).charCodeAt(0)-96<<10|h.charCodeAt(1)-96<<5|h.charCodeAt(2)-96,d=lv("mdhd",d=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3].concat(c(sv(o.timescale,4)),c(sv(d,4)),c(sv(f,4)),c(sv(h,2)),[0,0]))),f=o,h=new Uint8Array([]),f.type){case"video":h=fv;break;case"audio":h=pv}f=lv("hdlr",h);e:{switch(o.type){case"video":o=lv("minf",lv("vmhd",bv),Av,tv(o));break e;case"audio":o=lv("minf",lv("smhd",wv),Av,tv(o));break e}o=new Uint8Array([])}i=i("trak",s,o=u("mdia",d,f,o)),a.call(r,i)}for(t=di.apply(ai,c(t)),n=lv,i=(a=e.g[0]).duration*a.timescale,r=Math.floor(i/(dv+1)),i=Math.floor(i%(dv+1)),r=lv("mvhd",r=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3].concat(c(sv(a.timescale,4)),c(sv(r,4)),c(sv(i,4)),[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]))),i=[],u=(e=l(e.g)).next();!u.done;u=e.next())s=(o=i).push,u=lv("trex",u=new Uint8Array([0,0,0,0].concat(c(sv(u.value.id+1,4)),[0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]))),s.call(o,u);if(e=lv("mvex",e=di.apply(ai,c(i))),i=[],a.encrypted){for(o=(a=l(a.stream.drmInfos)).next();!o.done;o=a.next())if((o=o.value).initData)for(s=(o=l(o.initData)).next();!s.done;s=o.next())i.push(s.value.initData);a=di.apply(ai,c(i))}else a=new Uint8Array([]);return e=n("moov",r,t,e,a),(t=new Uint8Array(Sv.byteLength+e.byteLength)).set(Sv),t.set(e,Sv.byteLength),t}function tv(e){var t=lv,n=new Uint8Array([]);switch(e.type){case"video":if(e.codecs.includes("avc1")){n=e.stream.width||0;var i=e.stream.height||0;if(0<e.za.byteLength)var r=lv("avcC",e.za);else{r=lv;for(var a=7,o=[],s=[],u=0,l=0,d=0,h=0;h<e.fb.length;h++){var f=uv(e.fb[h]);switch(31&f[0]){case 7:o.push(f),a+=f.length+2;break;case 8:s.push(f),a+=f.length+2}}for(0<o.length&&(u=o[0][1],d=o[0][2],l=o[0][3]),h=0,(a=new Uint8Array(a))[h++]=1,a[h++]=u,a[h++]=d,a[h++]=l,a[h++]=255,a[h++]=224|o.length,u=0;u<o.length;u++)a[h++]=(65280&o[u].length)>>8,a[h++]=255&o[u].length,a.set(o[u],h),h+=o[u].length;for(a[h++]=s.length,o=0;o<s.length;o++)a[h++]=(65280&s[o].length)>>8,a[h++]=255&s[o].length,a.set(s[o],h),h+=s[o].length;r=r("avcC",a)}n=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].concat(c(sv(n,2)),c(sv(i,2)),[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])),i="avc1",s=nv(e),o=new Uint8Array([]),e.encrypted&&(o=rv(e),i="encv"),n=lv(i,n,r,s,o)}else e.codecs.includes("hvc1")&&(i=e.stream.width||0,r=e.stream.height||0,n=new Uint8Array([]),0<e.za.byteLength&&(n=lv("hvcC",e.za)),i=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].concat(c(sv(i,2)),c(sv(r,2)),[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])),r="hvc1",s=nv(e),o=new Uint8Array([]),e.encrypted&&(o=rv(e),r="encv"),n=lv(r,i,n,s,o));break;case"audio":e.codecs.includes("mp3")?e=lv(".mp3",iv(e)):e.codecs.includes("ac-3")?(n=lv("dac3",e.qa),i="ac-3",r=new Uint8Array([]),e.encrypted&&(r=rv(e),i="enca"),e=lv(i,iv(e),n,r)):e.codecs.includes("ec-3")?(n=lv("dec3",e.qa),i="ec-3",r=new Uint8Array([]),e.encrypted&&(r=rv(e),i="enca"),e=lv(i,iv(e),n,r)):e.codecs.includes("opus")?(n=lv("dOps",e.qa),i="Opus",r=new Uint8Array([]),e.encrypted&&(r=rv(e),i="enca"),e=lv(i,iv(e),n,r)):(0<e.qa.byteLength?n=lv("esds",e.qa):(n=lv,i=e.id+1,r=e.stream.channelsCount||2,o=e.stream.audioSamplingRate||44100,u=gi("audio",e.codecs.split(",")),s=(l={96e3:0,88200:1,64e3:2,48e3:3,44100:4,32e3:5,24e3:6,22050:7,16e3:8,12e3:9,11025:10,8e3:11,7350:12})[o],"mp4a.40.5"!==u&&"mp4a.40.29"!==u||(s=l[2*o]),o=parseInt(u.split(".").pop(),10),n=n("esds",i=new Uint8Array([0,0,0,0,3,25].concat(c(sv(i,2)),[0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,o<<3|s>>>1,s<<7|r<<3,6,1,2])))),i="mp4a",r=new Uint8Array([]),e.encrypted&&(r=rv(e),i="enca"),e=lv(i,iv(e),n,r)),n=e}return t("stbl",e=lv("stsd",Tv,n),lv("stts",gv),lv("stsc",mv),lv("stsz",yv),lv("stco",vv))}function nv(e){if(!e.Da&&!e.Fa)return new Uint8Array([]);var t=e.Fa;return lv("pasp",e=new Uint8Array([].concat(c(sv(e.Da,4)),c(sv(t,4)))))}function iv(e){return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.stream.channelsCount||2,0,16,0,0,0,0].concat(c(sv(e.stream.audioSamplingRate||44100,2)),[0,0]))}function rv(e){for(var t=lv,n=e.codecs.substring(0,e.codecs.indexOf(".")),i=0,r=0;r<n.length;r+=1)i|=n.charCodeAt(r)<<8*(n.length-r-1);n=lv("frma",n=new Uint8Array([].concat(c(sv(i,4))))),i=lv("schm",i=new Uint8Array([0,0,0,0,99,101,110,99,0,1,0,0])),r=lv;for(var a=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),o=(e=l(e.stream.drmInfos)).next();!o.done;o=e.next())if((o=o.value)&&o.keyIds&&o.keyIds.size)for(var s=(o=l(o.keyIds)).next();!s.done;s=o.next())a=uv(s.value);return t("sinf",n,i,r("schi",a=lv("tenc",e=new Uint8Array([0,0,0,0,0,0,1,8]),a)))}function av(e){for(var t=[],n=(e=l(e.g)).next();!n.done;n=e.next()){n=n.value;var i,r=t.push,a=r.apply,o=lv,s=new Uint8Array([0,0,0,0].concat(c(sv(n.data?n.data.wb:0,4))));s=lv("mfhd",s);var u=n.data?n.data.ab:[],d=new Uint8Array(4+u.length);for(i=0;i<u.length;i++){var h=u[i].flags;d[i+4]=h.Ya<<4|h.$a<<2|h.Za}var f=(u=lv("sdtp",d)).length+92;d=lv,i=lv("tfhd",i=new Uint8Array([0,0,0,58].concat(c(sv(n.id+1,4)),[0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]))),h=n.data?n.data.baseMediaDecodeTime:0;var p=Math.floor(h%(dv+1));h=lv("tfdt",h=new Uint8Array([1,0,0,0].concat(c(sv(Math.floor(h/(dv+1)),4)),c(sv(p,4)))));var g=f,m=12+16*(p=(f=n.data?n.data.ab:[]).length),v=new Uint8Array(m);for(g+=8+m,v.set(["video"===n.type?1:0,0,15,1].concat(c(sv(p,4)),c(sv(g,4))),0),g=0;g<p;g++){var y=f[g];m=sv(y.duration,4);var b=sv(y.size,4),w=y.flags;y=sv(y.hb,4),v.set([].concat(c(m),c(b),[w.kb<<2|w.Ya,w.$a<<6|w.Za<<4|w.lb,61440&w.Xa,15&w.Xa],c(y)),12+16*g)}o=o("moof",s,u=d("traf",i,h,f=lv("trun",v),u)),a.call(r,t,[o,ov(n)])}return di.apply(ai,c(t))}function ov(e){return e=(e.data?e.data.ab:[]).map((function(e){return e.data})),lv("mdat",e=di.apply(ai,c(e)))}function sv(e,t){var n=[];for(--t;0<=t;t--)n.push(e>>8*t&255);return n}function uv(e){for(var t=new Uint8Array(e.length/2),n=0;n<e.length/2;n+=1)t[n]=parseInt(String(e[2*n]+e[2*n+1]),16);return t}function lv(e){var t=L.apply(1,arguments),n=hv[e];n||(n=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)],hv[e]=n);for(var i=8,r=t.length-1;0<=r;r--)i+=t[r].byteLength;for((r=new Uint8Array(i))[0]=i>>24&255,r[1]=i>>16&255,r[2]=i>>8&255,r[3]=255&i,r.set(n,4),n=0,i=8;n<t.length;n++)r.set(t[n],i),i+=t[n].byteLength;return r}var cv=!1,dv=Math.pow(2,32)-1,hv={},fv=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]),pv=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]),gv=new Uint8Array([0,0,0,0,0,0,0,0]),mv=new Uint8Array([0,0,0,0,0,0,0,0]),vv=new Uint8Array([0,0,0,0,0,0,0,0]),yv=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),bv=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),wv=new Uint8Array([0,0,0,0,0,0,0,0]),Tv=new Uint8Array([0,0,0,0,0,0,0,1]),Sv=new Uint8Array([]),xv=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),Av=new Uint8Array([]);function Ev(){var e=this;this.h=this.g=null,this.l=[],this.j=null,this.s=1,this.i=null,this.C=new G(5),this.o=new Be((function(){!function(e){var t;P((function(n){switch(n.g){case 1:return S(n,2),w(n,kv(e),4);case 4:A(n,3);break;case 2:t=E(n),e.h&&(t.severity=1,e.h.onError(t));case 3:if(!e.h)return n.return();T(n)}}))}(e)})),this.B=new ea,this.m=new Map,this.A=function(){return!1}}function kv(e){var t,n,i,r,a,o,s;return P((function(u){if(1==u.g)return t=aa(e.l,e.g.retryParameters),n=e.h.networkingEngine,i=Date.now(),r=n.request(0,t,{type:5,isPreload:e.A()}),ta(e.B,r),w(u,r.promise,2);if(a=u.h,!e.h)return u.return();a.uri&&!e.l.includes(a.uri)&&e.l.unshift(a.uri);var d=a.uri,h=a.data,f=e.g.mss.manifestPreprocessor;if(f!=dl){if(oe("manifest.mss.manifestPreprocessor configuration","Please Use manifest.mss.manifestPreprocessorTXml instead."),!(h=ng(h,"SmoothStreamingMedia")))throw new De(2,4,4046,d);f(h),h=pt(h.outerHTML)}var p=Ct(h,"SmoothStreamingMedia");if(!p)throw new De(2,4,4046,d);if((d=e.g.mss.manifestPreprocessorTXml)!=hl&&d(p),e.i||(e.i=new Ls(null,0)),d=Ft(p,"IsLive",$t,!1))throw new De(2,4,4047);e.i.Bc(!d),f=Ft(p,"TimeScale",Yt,1e7),h=Ft(p,"DVRWindowLength",Yt),d&&(0===h||isNaN(h))&&(h=1/0);var g,m=Ft(p,"CanSeek",$t,!1);for(0===h&&m&&(h=1/0),m=null,h&&0<h&&(m=h/f),d&&!isNaN(e.g.availabilityWindowOverride)&&(m=e.g.availabilityWindowOverride),null==m&&(m=1/0),e.i.pe(m),h=Ft(p,"Duration",Yt,1/0),d||e.i.bb(h/f),d={variants:[],textStreams:[],timescale:f,duration:h/f},m=Nt(p,"Protection"),f=e.g.mss.keySystemsBySystemId,h=[],g=(m=l(m)).next();!g.done;g=m.next())h=h.concat(Nt(g.value,"ProtectionHeader"));if(h.length){for(m=[],g=0;g<h.length;g++){var v=h[g],y=v.attributes.SystemID.toLowerCase(),b=f[y];if(b){var S=Jm(v);if(S)e:{for(var x=(S=l(Ut(S,"DATA"))).next();!x.done;x=S.next())if(x=_t(x.value,"KID")){S=ui(jt(x)),S=ci(S=new Uint8Array([S[3],S[2],S[1],S[0],S[5],S[4],S[7],S[6]].concat(c(S.slice(8)))));break e}S=null}else S=null;y=fi(b,"cenc",y=[{initData:La(x=ui(jt(v)),y=li(y.replace(/-/g,"")),new Set,0),initDataType:"cenc",keyId:S}]),S&&y.keyIds.add(S),(b=Qm.get(b))&&(y.licenseServerUri=b(v)),m.push(y)}}f=m}else f=[];for(g=f,m=[],f=[],h=[],v=(p=l(p=Nt(p,"StreamIndex"))).next();!v.done;v=p.next()){b=Nt(v=v.value,"QualityLevel"),y=d.timescale,S=d.duration,x=Nt(v,"c");for(var A=[],E=0,k=0;k<x.length;++k){var I=x[k],M=x[k+1],C=Ft(I,"t",Yt),D=Ft(I,"d",Yt);if(I=Ft(I,"r",zt),!D)break;if(C=null!=C?C:E,(I=I||0)&&I--,0>I)if(M){if(null==(M=Ft(M,"t",Yt)))break;if(C>=M)break;I=Math.ceil((M-C)/D)-1}else{if(1/0==S)break;if(C/y>=S)break;I=Math.ceil((S*y-C)/D)-1}for(M=0;M<=I;++M)E=C+D,A.push({start:C/y,end:E/y,dg:C}),C=E}for(y=A,S=(b=l(b)).next();!S.done;S=b.next())(S=Iv(e,v,S.value,y,g,d))&&("audio"!=S.type||e.g.disableAudio?"video"!=S.type||e.g.disableVideo?S.type!=yi||e.g.disableText||h.push(S):f.push(S):m.push(S))}for(p=[],g=(m=l(0<m.length?m:[null])).next();!g.done;g=m.next())for(g=g.value,A=(v=l(0<f.length?f:[null])).next();!A.done;A=v.next())y=(b=p).push,S=e,x=g,A=A.value,k=0,x&&x.bandwidth&&0<x.bandwidth&&(k+=x.bandwidth),A&&A.bandwidth&&0<A.bandwidth&&(k+=A.bandwidth),S={id:S.s++,language:x?x.language:"und",disabledUntilTime:0,primary:!!x&&x.primary||!!A&&A.primary,audio:x,video:A,bandwidth:k,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},y.call(b,S);d.variants=p,d.textStreams=h,e.j?(e.j.variants=d.variants,e.j.textStreams=d.textStreams,e.h.filter(e.j)):(e.j={presentationTimeline:e.i,variants:d.variants,textStreams:d.textStreams,imageStreams:[],offlineSessionIds:[],minBufferTime:0,sequenceMode:e.g.mss.sequenceMode,ignoreManifestTimestampsInSegmentsMode:!1,type:"MSS",serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,isLowLatency:!1,startTime:null},e.i.Xd()),Promise.resolve(),o=Date.now(),s=(o-i)/1e3,e.C.sample(1,s),T(u)}))}function Iv(e,t,n,i,r,a){var o=t.attributes.Type;if("audio"!==o&&"video"!==o&&"text"!==o)return W("Ignoring unrecognized type:",o),null;var s=t.attributes.Language,u=e.s++,c=Ft(n,"Bitrate",Wt),d=Ft(n,"MaxWidth",Wt),h=Ft(n,"MaxHeight",Wt),f=Ft(n,"Channels",Wt),p=Ft(n,"SamplingRate",Wt),g=a.duration;i.length&&(g=i[i.length-1].end-i[0].start);var m=e.i.getDuration();e.i.bb(Math.min(g,m));var v={id:u,originalId:t.attributes.Name||String(u),groupId:null,createSegmentIndex:function(){return Promise.resolve()},closeSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:"",codecs:"",frameRate:void 0,pixelAspectRatio:void 0,bandwidth:c||0,width:d||void 0,height:h||void 0,kind:"",encrypted:0<r.length,drmInfos:r,keyIds:new Set,language:Yi(s||"und"),originalLanguage:s,label:"",type:"",primary:!1,trickModeVideo:null,emsgSchemeIdUris:[],roles:[],forced:!1,channelsCount:f,audioSamplingRate:p,spatialAudio:!1,closedCaptions:null,hdr:void 0,colorGamut:void 0,videoLayout:void 0,tilesLayout:void 0,matchedStreams:[],mssPrivateData:{duration:g,timescale:a.timescale,codecPrivateData:null},accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set,isAudioMuxedInVideo:!1};if((r=t.attributes.Subtype)&&((r=Cv[r])&&v.roles.push(r),"main"===r&&(v.primary=!0)),null!==(r=n.attributes.FourCC)&&""!==r||(r=t.attributes.FourCC),!r)if("audio"===o)r="AAC";else if("video"===o)return W('FourCC is not defined whereas it is required for a QualityLevel element for a StreamIndex of type "video"'),null;if(!Mv.includes(r.toUpperCase()))return W("Codec not supported:",r),null;switch(n=function(e,t,n,i){if(e=e.attributes.CodecPrivateData)return e;if("audio"!==t)return null;t=i.channelsCount||2;var r={96e3:0,88200:1,64e3:2,48e3:3,44100:4,32e3:5,24e3:6,22050:7,16e3:8,12e3:9,11025:10,8e3:11,7350:12};return i=r[e=i.audioSamplingRate||44100],"AACH"===n?(n=new Uint8Array(4),e=r[2*e],n[0]=40|i>>1,n[1]=i<<7|t<<3|e>>1,n[2]=e<<7|8,n[3]=0,(t=new Uint16Array(2))[0]=(n[0]<<8)+n[1],t[1]=(n[2]<<8)+n[3],t[0].toString(16)+t[1].toString(16)):((n=new Uint8Array(2))[0]=16|i>>1,n[1]=i<<7|t<<3,(t=new Uint16Array(1))[0]=(n[0]<<8)+n[1],t[0].toString(16))}(n,o,r,v),v.mssPrivateData.codecPrivateData=n,o){case"audio":if(!n)return W("Quality unsupported without CodecPrivateData",o),null;v.type="audio",v.mimeType="mss/audio/mp4",v.codecs=function(e,t){var n=0;return"AACH"===e&&(n=5),t?0===n&&(n=(248&parseInt(t.substr(0,2),16))>>3):(n=2,"AACH"===e&&(n=5)),"mp4a.40."+n}(r,n);break;case"video":if(!n)return W("Quality unsupported without CodecPrivateData",o),null;v.type="video",v.mimeType="mss/video/mp4",v.codecs=function(e){var t=/00000001[0-9]7/.exec(e);return t.length&&e?"avc1."+e.substr(e.indexOf(t[0])+10,6):""}(n);break;case"text":v.type=yi,v.mimeType="application/mp4",("TTML"===r||"DFXP"===r)&&(v.codecs="stpp")}return v.fullMimeTypes.add(xi(v.mimeType,v.codecs)),v.createSegmentIndex=function(){if(v.segmentIndex)return Promise.resolve();if(e.m.has(v.id))var n=e.m.get(v.id);else n=[],"video"==v.type&&(n=v.mssPrivateData.codecPrivateData.split("00000001").slice(1)),n=ev(new Zm([n={id:v.id,type:v.type,codecs:v.codecs,encrypted:v.encrypted,timescale:v.mssPrivateData.timescale,duration:v.mssPrivateData.duration,fb:n,qa:new Uint8Array([]),za:new Uint8Array([]),Da:0,Fa:0,data:null,stream:v}])),e.m.set(v.id,n);return n=function(e,t,n,i,r){var a=i.attributes.Url.replace("{bitrate}",String(n.bandwidth));i=[];for(var o=(r=l(r)).next(),s={};!o.done;s={se:void 0},o=r.next())s.se=o.value,i.push(new vo(s.se.start,s.se.end,function(t){return function(){return hi(e.l,[a.replace("{start time}",String(t.se.dg))])}}(s),0,null,t,0,0,n.mssPrivateData.duration));return i}(e,new go((function(){return[]}),0,null,Iu(v),v.mssPrivateData.timescale,n),v,t,i),v.segmentIndex=new Zs(n),Promise.resolve()},v.closeSegmentIndex=function(){v.segmentIndex&&(v.segmentIndex.release(),v.segmentIndex=null)},v}(i=Ev.prototype).configure=function(e,t){this.g=e,t&&(this.A=t)},i.start=function(e,t){var n=this;return P((function(i){if(1==i.g)return n.l=[e],n.h=t,w(i,kv(n),2);if(!n.h)throw new De(2,7,7001);return i.return(n.j)}))},i.stop=function(){return this.g=this.h=null,this.l=[],this.j=null,null!=this.o&&(this.o.stop(),this.o=null),this.m.clear(),this.B.destroy()},i.update=function(){var e,t=this;return P((function(n){return 1==n.g?(S(n,2),w(n,kv(t),4)):2!=n.g?A(n,0):(e=E(n),t.h&&e?(t.h.onError(e),void T(n)):n.return())}))},i.onExpirationUpdated=function(){},i.onInitialVariantChosen=function(){},i.banLocation=function(){},i.setMediaElement=function(){},F("shaka.mss.MssParser",Ev);var Mv="AAC AACL AACH AACP AVC1 H264 TTML DFXP".split(" "),Cv={CAPT:"main",SUBT:"alternate",DESC:"main"};function Dv(e,t,n,i,r,a){if(200<=n&&299>=n&&202!=n)return{uri:r||i,originalUri:i,data:t,status:n,headers:e,fromCache:!!e["x-shaka-from-cache"]};var o=null;try{o=ft(t)}catch(e){}throw new De(401==n||403==n?2:1,1,1001,i,n,o,e,a,r||i)}function Rv(){}function Pv(e,t,n,i,r,a){var o=new _v;ma(t.headers).forEach((function(e,t){o.append(t,e)}));var s=new Ov,u={ng:!1,ph:!1};if(e=function(e,t,n,i,r,a,o,s){var u,l,c,d,h,f,p,g,m,v,y,b;return P((function(x){switch(x.g){case 1:return u=jv,l=Uv,f=h=0,p=Date.now(),S(x,2),w(x,u(e,n),4);case 4:if(c=x.h,a(Lv(c.headers)),"HEAD"==n.method){x.u(5);break}return g=c.clone().body.getReader(),v=(m=c.headers.get("Content-Length"))?parseInt(m,10):0,new l({start:function(e){!function t(){var n,i,a,u;return P((function(l){switch(l.g){case 1:return S(l,2),w(l,g.read(),4);case 4:n=l.h,A(l,3);break;case 2:return E(l),l.return();case 3:if(n.done){l.u(5);break}if(h+=n.value.byteLength,!o){l.u(5);break}return w(l,o(n.value),5);case 5:i=Date.now(),a=h-f,(100<i-p&&a>=s||n.done)&&(u=n.done?0:v-h,r(i-p,a,u),f=h,p=i),n.done?e.close():(e.enqueue(n.value),t()),T(l)}}))}()}}),w(x,c.arrayBuffer(),6);case 6:d=x.h;case 5:A(x,3);break;case 2:if(y=E(x),i.ng)throw new De(1,1,7001,e,t);if(i.ph)throw new De(1,1,1003,e,t);throw new De(1,1,1002,e,y,t);case 3:return b=Lv(c.headers),x.return(Dv(b,d,c.status,e,c.url,t))}}))}(e,n,{body:t.body||void 0,headers:o,method:t.method,signal:s.signal,credentials:t.allowCrossSiteCredentials?"include":void 0},u,i,r,t.streamDataCallback,a.minBytesForProgressEvents||0),e=new Kr(e,(function(){return u.ng=!0,s.abort(),Promise.resolve()})),t=t.retryParameters.timeout){var l=new Be((function(){u.ph=!0,s.abort()}));l.$(t/1e3),e.finally((function(){l.stop()}))}return e}function Lv(e){var t={};return e.forEach((function(e,n){t[n.trim()]=e})),t}function Nv(){if(!e.ReadableStream)return!1;try{new ReadableStream({})}catch(e){return!1}return!!e.Response&&!!new Response("").body&&!(!e.fetch||"polyfill"in e.fetch||!e.AbortController)}co["application/vnd.ms-sstr+xml"]=function(){return new Ev},F("shaka.net.HttpFetchPlugin",Rv),Rv.isSupported=Nv,Rv.parse=Pv;var jv=e.fetch,Ov=e.AbortController,Uv=e.ReadableStream,_v=e.Headers;function Bv(){}function Fv(e,t,n,i,r,a){var o=new Hv,s=Date.now(),u=0;return new Kr(new Promise((function(l,c){o.open(t.method,e,!0),o.responseType="arraybuffer",o.timeout=t.retryParameters.timeout,o.withCredentials=t.allowCrossSiteCredentials,o.onabort=function(){c(new De(1,1,7001,e,n))};var d=!1;for(var h in o.onreadystatechange=function(){if(2==o.readyState&&!d){var e=Vv(o);r(e),d=!0}},o.onload=function(t){var r=Vv(o),a=o.response;try{i(Date.now()-s,t.loaded-u,0);var d=Dv(r,a,o.status,e,o.responseURL,n);l(d)}catch(e){c(e)}},o.onerror=function(t){c(new De(1,1,1002,e,t,n))},o.ontimeout=function(){c(new De(1,1,1003,e,n))},o.onprogress=function(e){var t=Date.now(),n=a.minBytesForProgressEvents||0,r=e.loaded-u;(100<t-s&&r>=n||e.lengthComputable&&e.loaded==e.total)&&(i(t-s,r,4==o.readyState?0:e.total-e.loaded),u=e.loaded,s=t)},t.headers)o.setRequestHeader(h.toLowerCase(),t.headers[h]);o.send(t.body)})),(function(){return o.abort(),Promise.resolve()}))}function Vv(e){var t=e.getAllResponseHeaders().trim().split("\r\n");e={};for(var n=(t=l(t)).next();!n.done;n=t.next())e[(n=n.value.split(": "))[0].toLowerCase()]=n.slice(1).join(": ");return e}Nv()&&(ia("http",Pv,2,!0),ia("https",Pv,2,!0),ia("blob",Pv,2,!0)),F("shaka.net.HttpXHRPlugin",Bv),Bv.parse=Fv;var Hv=e.XMLHttpRequest;function Gv(e,t,n,i){this.g=e,this.i=t,this.groupId=n,this.h=i}function Kv(e){return e.N().map((function(e){return"{"+encodeURI(e.split("#xywh=")[0])+"}"})).join("")+":"+e.Ja+":"+e.va}function Xv(e,t){return Ru(e.g.N(),e.g.Ja,e.g.va,t.streaming.retryParameters)}function qv(){this.h=this.j=this.i=0,this.g=new Map,this.l=0}function zv(e,t){e.i+=t;var n=e.l;return e.l++,e.g.set(n,t),n}function Wv(e){var t=this;this.o=e,this.j=new Map,this.i=new fa((function(){return Yv(t).catch((function(){}))})),this.h=[],this.m=function(){},this.l=function(){},this.g=new qv}function Yv(e){var t=e.h.map((function(e){return e()}));return e.h=[],Promise.all(t)}function Jv(e,t,n,i,r,a){pa(e.i);var o=(e.j.get(t)||Promise.resolve()).then((function(){var t,o,s,u,l,c,d;return P((function(h){if(1==h.g)return w(h,function(e,t){var n,i,r,a;return P((function(o){return 1==o.g?(n=ca,i=e.o.request(n,t),r=function(){return i.abort()},e.h.push(r),w(o,i.promise,2)):(a=o.h,Ie(e.h,r),o.return(a.data))}))}(e,n),2);if(t=h.h,e.i.g)throw new De(2,9,7001);if(r)for(u in o=ge(t),(s=new Pa(o)).data)l=Number(u),c=s.data[l],d=s.g[l],e.l(c,d);e.g.close(i,t.byteLength);var f=e.g;return e.m(0==f.i?0:f.j/f.i,e.g.h),h.return(a(t))}))}));e.j.set(t,o)}function $v(e,t){var n=this;this.i=e,this.h=e.objectStore(t),this.g=new Gr,e.onabort=function(e){e.preventDefault(),n.g.reject()},e.onerror=function(e){e.preventDefault(),n.g.reject()},e.oncomplete=function(){n.g.resolve()}}function Qv(e,t){return new Promise((function(n,i){var r=e.h.openCursor();r.onerror=i,r.onsuccess=function(){var e;return P((function(i){if(1==i.g)return null==r.result?(n(),i.return()):(e=r.result,w(i,t(e.key,e.value,e),2));e.continue(),T(i)}))}}))}function Zv(e){this.h=e,this.g=[]}function ey(e,t){return ty(e,t,"readwrite")}function ty(e,t,n){var i=new $v(n=e.h.transaction([t],n),t);return e.g.push(i),i.promise().then((function(){Ie(e.g,i)}),(function(){Ie(e.g,i)})),i}function ny(e,t,n){this.h=new Zv(e),this.i=t,this.g=n}function iy(e){return Promise.reject(new De(2,9,9011,"Cannot add new value to "+e))}function ry(e,t,n,i){t=(e=ey(e.h,t)).store();for(var r=(n=l(n)).next(),a={};!r.done;a={wf:void 0},r=n.next())a.wf=r.value,t.delete(a.wf).onsuccess=function(e){return function(){return i(e.wf)}}(a);return e.promise()}function ay(e,t,n){var i,r,a,o,s,u,c;return P((function(d){if(1==d.g){for(i=ty(e.h,t,"readonly"),r=i.store(),a={},o=[],s=l(n),u=s.next(),c={};!u.done;c={ke:void 0,Vd:void 0},u=s.next())c.Vd=u.value,c.ke=r.get(c.Vd),c.ke.onsuccess=function(e){return function(){null==e.ke.result&&o.push(e.Vd),a[e.Vd]=e.ke.result}}(c);return w(d,i.promise(),2)}if(o.length)throw new De(2,9,9012,"Could not find values for "+o);return d.return(n.map((function(e){return a[e]})))}))}function oy(e){this.g=new Zv(e)}function sy(){this.g=new Map}function uy(e){var t=null;if(e.g.forEach((function(e,n){e.getCells().forEach((function(e,i){e.hasFixedKeySpace()||t||(t={path:{rb:n,Ma:i},Ma:e})}))})),t)return t;throw new De(2,9,9013,"Could not find a cell that supports add-operations")}function ly(e,t,n){if(!(e=e.g.get(t)))throw new De(2,9,9013,"Could not find mechanism with name "+t);if(!(t=e.getCells().get(n)))throw new De(2,9,9013,"Could not find cell with name "+n);return t}function cy(e,t){dy.set(e,t)}ia("http",Fv,1,!0),ia("https",Fv,1,!0),ia("blob",Fv,1,!0),qv.prototype.close=function(e,t){if(this.g.has(e)){var n=this.g.get(e);this.g.delete(e),this.j+=n,this.h+=t}},Wv.prototype.destroy=function(){return this.i.destroy()},$v.prototype.abort=function(){var e=this;return P((function(t){if(1==t.g){try{e.i.abort()}catch(e){}return S(t,2),w(t,e.g,4)}if(2!=t.g)return A(t,0);E(t),T(t)}))},$v.prototype.store=function(){return this.h},$v.prototype.promise=function(){return this.g},Zv.prototype.destroy=function(){return Promise.all(this.g.map((function(e){return e.abort()})))},(i=ny.prototype).destroy=function(){return this.h.destroy()},i.hasFixedKeySpace=function(){return!0},i.addSegments=function(){return iy(this.i)},i.removeSegments=function(e,t){return ry(this,this.i,e,t)},i.getSegments=function(e){var t,n=this;return P((function(i){return 1==i.g?w(i,ay(n,n.i,e),2):(t=i.h,i.return(t.map((function(e){return n.qg(e)}))))}))},i.addManifests=function(){return iy(this.g)},i.updateManifest=function(){return Promise.reject(new De(2,9,9016,"Cannot modify values in "+this.g))},i.updateManifestExpiration=function(e,t){var n=ey(this.h,this.g),i=n.store();return i.get(e).onsuccess=function(n){(n=n.target.result)&&(n.expiration=t,i.put(n,e))},n.promise()},i.removeManifests=function(e,t){return ry(this,this.g,e,t)},i.getManifests=function(e){var t,n=this;return P((function(i){return 1==i.g?w(i,ay(n,n.g,e),2):(t=i.h,i.return(Promise.all(t.map((function(e){return n.cd(e)})))))}))},i.getAllManifests=function(){var e,t,n=this;return P((function(i){return 1==i.g?(e=ty(n.h,n.g,"readonly"),t=new Map,w(i,Qv(e,(function(e,i){var r;return P((function(a){if(1==a.g)return w(a,n.cd(i),2);r=a.h,t.set(e,r),T(a)}))})),2)):3!=i.g?w(i,e.promise(),3):i.return(t)}))},i.qg=function(e){return e},i.cd=function(e){return Promise.resolve(e)},i.add=function(e,t){var n,i,r,a,o,s,u,c=this;return P((function(d){if(1==d.g){for(n=ey(c.h,e),i=n.store(),r=[],a=l(t),o=a.next(),s={};!o.done;s={Lf:void 0},o=a.next())u=o.value,s.Lf=i.add(u),s.Lf.onsuccess=function(e){return function(){r.push(e.Lf.result)}}(s);return w(d,n.promise(),2)}return d.return(r)}))},oy.prototype.destroy=function(){return this.g.destroy()},oy.prototype.getAll=function(){var e,t,n=this;return P((function(i){return 1==i.g?(e=ty(n.g,"session-ids","readonly"),t=[],w(i,Qv(e,(function(e,n){t.push(n)})),2)):3!=i.g?w(i,e.promise(),3):i.return(t)}))},oy.prototype.add=function(e){for(var t=ey(this.g,"session-ids"),n=t.store(),i=(e=l(e)).next();!i.done;i=e.next())n.add(i.value);return t.promise()},oy.prototype.remove=function(e){var t,n=this;return P((function(i){return 1==i.g?w(i,Qv(t=ey(n.g,"session-ids"),(function(t,n,i){e.includes(n.sessionId)&&i.delete()})),2):w(i,t.promise(),0)}))},sy.prototype.destroy=function(){for(var e=[],t=l(this.g.values()),n=t.next();!n.done;n=t.next())e.push(n.value.destroy());return this.g.clear(),Promise.all(e)},sy.prototype.init=function(){var e=this;dy.forEach((function(t,n){(t=t())&&e.g.set(n,t)}));for(var t=[],n=l(this.g.values()),i=n.next();!i.done;i=n.next())t.push(i.value.init());return Promise.all(t)},F("shaka.offline.StorageMuxer",sy),sy.unregister=function(e){dy.delete(e)},sy.register=cy,sy.prototype.destroy=sy.prototype.destroy;var dy=new Map;function hy(){ny.apply(this,arguments)}function fy(e,t){!function(e){var t=e.streams.filter((function(e){return"audio"==e.contentType}));if(e=e.streams.filter((function(e){return"video"==e.contentType})),!t.every((function(e){return e.variantIds}))||!e.every((function(e){return e.variantIds}))){for(var n=l(t),i=n.next();!i.done;i=n.next())i.value.variantIds=[];for(i=(n=l(e)).next();!i.done;i=n.next())i.value.variantIds=[];if(n=0,e.length&&!t.length){i=n++;for(var r=l(e),a=r.next();!a.done;a=r.next())a.value.variantIds.push(i)}if(!e.length&&t.length)for(i=n++,a=(r=l(t)).next();!a.done;a=r.next())a.value.variantIds.push(i);if(e.length&&t.length)for(i=(t=l(t)).next();!i.done;i=t.next())for(i=i.value,a=(r=l(e)).next();!a.done;a=r.next()){a=a.value;var o=n++;i.variantIds.push(o),a.variantIds.push(o)}}}(e);for(var n=l(e.streams),i=n.next();!i.done;i=n.next());return e.streams.map((function(n){return function(e,t,n){var i=e.initSegmentUri?py(e.initSegmentUri):null,r=t+e.presentationTimeOffset,a=t+n;return{id:e.id,originalId:null,groupId:null,primary:e.primary,type:e.contentType,mimeType:e.mimeType,codecs:e.codecs,frameRate:e.frameRate,pixelAspectRatio:void 0,hdr:void 0,colorGamut:void 0,videoLayout:void 0,kind:e.kind,language:e.language,originalLanguage:e.language||null,label:e.label,width:e.width,height:e.height,initSegmentKey:i,encrypted:e.encrypted,keyIds:new Set([e.keyId]),segments:e.segments.map((function(e){var n=py(e.uri);return{startTime:t+e.startTime,endTime:t+e.endTime,dataKey:n,initSegmentKey:i,appendWindowStart:t,appendWindowEnd:a,timestampOffset:r,tilesLayout:"",mimeType:null,codecs:null,thumbnailSprite:null}})),variantIds:e.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0,external:!1,fastSwitching:!1,isAudioMuxedInVideo:!1}}(n,e.startTime,t)}))}function py(e){var t;if((t=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(e))||(t=/^offline:segment\/([0-9]+)$/.exec(e)))return Number(t[1]);throw new De(2,9,9004,"Could not parse uri "+e)}function gy(){ny.apply(this,arguments)}function my(e,t,n){return{id:e.id,originalId:e.originalId,groupId:null,primary:e.primary,type:e.contentType,mimeType:e.mimeType,codecs:e.codecs,frameRate:e.frameRate,pixelAspectRatio:e.pixelAspectRatio,hdr:void 0,colorGamut:void 0,videoLayout:void 0,kind:e.kind,language:e.language,originalLanguage:e.language||null,label:e.label,width:e.width,height:e.height,encrypted:e.encrypted,keyIds:new Set([e.keyId]),segments:e.segments.map((function(i){return{startTime:t+i.startTime,endTime:t+i.endTime,initSegmentKey:e.initSegmentKey,appendWindowStart:t,appendWindowEnd:n,timestampOffset:t-e.presentationTimeOffset,dataKey:i.dataKey,tilesLayout:"",mimeType:null,codecs:null,thumbnailSprite:null}})),variantIds:e.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0,external:!1,fastSwitching:!1,isAudioMuxedInVideo:!1}}function vy(){ny.apply(this,arguments)}function yy(){this.m=this.j=this.i=this.h=this.g=this.l=null}function by(e,t,n,i){this.g=e,this.i=t,this.h=n,this.l=i,this.j=["offline:",e,"/",t,"/",n,"/",i].join("")}function wy(e){if(null==(e=/^offline:([a-z]+)\/([^/]+)\/([^/]+)\/([0-9]+)$/.exec(e)))return null;var t=e[1];if("manifest"!=t&&"segment"!=t)return null;var n=e[2];if(!n)return null;var i=e[3];return i&&null!=t?new by(t,n,i,Number(e[4])):null}function Ty(e,t){this.h=e,this.g=t}function Sy(e,t){var n=new Ls(null,0);n.bb(t.duration);var i=t.streams.filter((function(e){return"audio"==e.type})),r=t.streams.filter((function(e){return"video"==e.type}));i=function(e,t,n,i){for(var r=new Set,a=l(t),o=a.next();!o.done;o=a.next())for(var s=(o=l(o.value.variantIds)).next();!s.done;s=o.next())r.add(s.value);for(o=(a=l(n)).next();!o.done;o=a.next())for(s=(o=l(o.value.variantIds)).next();!s.done;s=o.next())r.add(s.value);for(a=new Map,o=(r=l(r)).next();!o.done;o=r.next())o=o.value,a.set(o,{id:o,language:"",disabledUntilTime:0,primary:!1,audio:null,video:null,bandwidth:0,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});for(r=(t=l(t)).next();!r.done;r=t.next())for(r=xy(e,o=r.value,i),s=(o=l(o.variantIds)).next();!s.done;s=o.next())(s=a.get(s.value)).language=r.language,s.primary=s.primary||r.primary,s.audio=r;for(t=(n=l(n)).next();!t.done;t=n.next())for(t=xy(e,r=t.value,i),o=(r=l(r.variantIds)).next();!o.done;o=r.next())(o=a.get(o.value)).primary=o.primary||t.primary,o.video=t;return a}(e,i,r,n),r=t.streams.filter((function(e){return e.type==yi})).map((function(t){return xy(e,t,n)}));var a=t.streams.filter((function(e){return"image"==e.type})).map((function(t){return xy(e,t,n)})),o=t.drmInfo?[t.drmInfo]:[];if(t.drmInfo)for(var s=l(i.values()),u=s.next();!u.done;u=s.next())(u=u.value).audio&&u.audio.encrypted&&(u.audio.drmInfos=o),u.video&&u.video.encrypted&&(u.video.drmInfos=o);return{presentationTimeline:n,minBufferTime:2,offlineSessionIds:t.sessionIds,variants:Array.from(i.values()),textStreams:r,imageStreams:a,sequenceMode:t.sequenceMode||!1,ignoreManifestTimestampsInSegmentsMode:!1,type:t.type||"UNKNOWN",serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,isLowLatency:!1,startTime:null}}function xy(e,t,n){var i=t.segments.map((function(n){return function(e,t,n){var i=new by("segment",e.h,e.g,t.dataKey);return e=new vo(t.startTime,t.endTime,(function(){return[i.toString()]}),0,null,null!=t.initSegmentKey?function(e,t){var n=new by("segment",e.h,e.g,t);return new go((function(){return[n.toString()]}),0,null)}(e,t.initSegmentKey):null,t.timestampOffset,t.appendWindowStart,t.appendWindowEnd,[],t.tilesLayout||""),e.mimeType=t.mimeType||n.mimeType||"",e.codecs=t.codecs||n.codecs||"",t.thumbnailSprite&&e.qe(t.thumbnailSprite),e}(e,n,t)}));return n.vd(i),{id:t.id,originalId:t.originalId,groupId:t.groupId,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new Zs(i),mimeType:t.mimeType,codecs:t.codecs,width:t.width||void 0,height:t.height||void 0,frameRate:t.frameRate,pixelAspectRatio:t.pixelAspectRatio,hdr:t.hdr,colorGamut:t.colorGamut,videoLayout:t.videoLayout,kind:t.kind,encrypted:t.encrypted,drmInfos:[],keyIds:t.keyIds,language:t.language,originalLanguage:t.originalLanguage||null,label:t.label,type:t.type,primary:t.primary,trickModeVideo:null,emsgSchemeIdUris:null,roles:t.roles,forced:t.forced,channelsCount:t.channelsCount,audioSamplingRate:t.audioSamplingRate,spatialAudio:t.spatialAudio,closedCaptions:t.closedCaptions,tilesLayout:t.tilesLayout,accessibilityPurpose:null,external:t.external,fastSwitching:t.fastSwitching,fullMimeTypes:new Set([xi(t.mimeType,t.codecs)]),isAudioMuxedInVideo:!1}}function Ay(){this.g=null}function Ey(){}function ky(e){var t=wy(e);return e=t&&"manifest"==t.g?zr(e={uri:e,originalUri:e,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}}):t&&"segment"==t.g?function(e,t){var n=new sy;return zr(void 0).Ca((function(){return n.init()})).Ca((function(){return ly(n,t.rb(),t.Ma())})).Ca((function(e){return e.getSegments([t.key()])})).Ca((function(e){return{uri:t,data:e[0].data,headers:{}}})).finally((function(){return n.destroy()}))}(t.key(),t):Xr(new De(2,1,9004,e))}function Iy(e,t,n){var i,r,a,o,s,u;return P((function(c){switch(c.g){case 1:i=[];for(var d=[],h=l(n),f=h.next();!f.done;f=h.next()){f=f.value;for(var p=!1,g=l(d),m=g.next();!m.done;m=g.next())if(My((m=m.value).info,f)){m.sessionIds.push(f.sessionId),p=!0;break}p||d.push({info:f,sessionIds:[f.sessionId]})}r=l(d),a=r.next();case 2:if(a.done){c.u(4);break}return o=a.value,s=function(e,t,n){var i,r;return P((function(a){switch(a.g){case 1:return i=new Na({Nb:t,onError:function(){},ee:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),S(a,2),i.configure(e),w(a,function(e,t,n,i,r,a){var o=new Map;return(r={audioCapabilities:r,videoCapabilities:a,distinctiveIdentifier:"optional",persistentState:"required",sessionTypes:["persistent-license"],label:t}).drmInfos=[{keySystem:t,licenseServerUri:n,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:i,serverCertificateUri:"",initData:null,keyIds:null}],o.set(t,r),Va(e,o,[])}(i,n.info.keySystem,n.info.licenseUri,n.info.serverCertificate,n.info.audioCapabilities,n.info.videoCapabilities),4);case 4:A(a,3);break;case 2:return E(a),w(a,i.destroy(),5);case 5:return a.return([]);case 3:return r=[],w(a,Promise.all(n.sessionIds.map((function(e){return P((function(t){return 1==t.g?(S(t,2),w(t,function(e,t){var n,i,r;return P((function(a){return 1==a.g?w(a,Ka(e,t,{initData:null,initDataType:null}),2):3!=a.g?(n=a.h)?(i=[],(r=e.i.get(n))&&(r.nb=new Gr,i.push(r.nb)),i.push(n.remove()),w(a,Promise.all(i),3)):a.return():(e.i.delete(n),void T(a))}))}(i,e),4)):2!=t.g?(r.push(e),A(t,0)):(E(t),void T(t))}))}))),6);case 6:return w(a,i.destroy(),7);case 7:return a.return(r)}}))}(e,t,o),w(c,s,5);case 5:u=c.h,i=i.concat(u),a=r.next(),c.u(2);break;case 4:return c.return(i)}}))}function My(e,t){function n(e,t){return e.robustness==t.robustness&&e.contentType==t.contentType}return e.keySystem==t.keySystem&&e.licenseUri==t.licenseUri&&Me(e.audioCapabilities,t.audioCapabilities,n)&&Me(e.videoCapabilities,t.videoCapabilities,n)}function Cy(e,t){var n=Sy(new Ty(e.rb(),e.Ma()),t),i=t.appMetadata||{};return n=Dy(n),{offlineUri:e.toString(),originalManifestUri:t.originalManifestUri,duration:t.duration,size:t.size,expiration:t.expiration,tracks:n,appMetadata:i,isIncomplete:t.isIncomplete||!1}}function Dy(e){for(var t=[],n=br(e.variants),i=(n=l(n)).next();!i.done;i=n.next())t.push(dr(i.value));for(n=(e=l(e.textStreams)).next();!n.done;n=e.next())t.push(hr(n.value));return t}function Ry(){this.g={}}function Py(e,t){var n=t.audio,i=t.video;if(n&&!i&&(e.g[n.id]=n.bandwidth||t.bandwidth),!n&&i&&(e.g[i.id]=i.bandwidth||t.bandwidth),n&&i){var r=n.bandwidth||393216,a=i.bandwidth||t.bandwidth-r;0>=a&&(a=t.bandwidth),e.g[n.id]=r,e.g[i.id]=a}}function Ly(e,t){e.g[t.id]=t.bandwidth||2048}function Ny(e,t){return null==(e=e.g[t])&&(e=0),e}function jy(e){var t=this;if(e&&e.constructor!=lc)throw new De(2,9,9008);this.g=this.h=null,e?(this.h=e.g,this.g=e.Ab()):(this.h=ll(),this.g=new na),this.i=[],this.j=[];var n=!e;this.l=new fa((function(){var e,i,r,a,o;return P((function(s){switch(s.g){case 1:return w(s,Promise.all(t.j.map((function(e){return Yv(e)}))),2);case 2:for(e=function(){},i=[],r=l(t.i),a=r.next();!a.done;a=r.next())o=a.value,i.push(o.then(e,e));return w(s,Promise.all(i),3);case 3:if(!n){s.u(4);break}return w(s,t.g.destroy(),4);case 4:t.h=null,t.g=null,T(s)}}))})),this.m=1e9}function Oy(){if(Fe())e:{for(var e=l(dy.values()),t=e.next();!t.done;t=e.next())if(t=(t=t.value)()){t.destroy(),e=!0;break e}e=!1}else e=!1;return e}function Uy(e){var t,n,i;return P((function(r){switch(r.g){case 1:return w(r,(t=new sy).init(),2);case 2:return w(r,uy(t),3);case 3:return n=r.h,i=new by("manifest",n.path.rb,n.path.Ma,e),w(r,t.destroy(),4);case 4:return w(r,(new jy).remove(i.toString()),0)}}))}function _y(e,t,n,i,r,a){var o,s,u,c,d,h,f,p,g,m,v;return P((function(y){switch(y.g){case 1:for(o=!1,S(y,2),s=!0,u=l(n.streams),c=u.next();!c.done;c=u.next())for(d=c.value,h=l(d.segments),f=h.next();!f.done;f=h.next())p=f.value,null!=(g=p.pendingSegmentRefId?i[p.pendingSegmentRefId]:null)&&(p.dataKey=g,p.pendingSegmentRefId=void 0),null!=(g=p.pendingInitSegmentRefId?i[p.pendingInitSegmentRefId]:null)&&(p.initSegmentKey=g,p.pendingInitSegmentRefId=void 0),p.pendingSegmentRefId&&(s=!1),p.pendingInitSegmentRefId&&(s=!1);return n.size+=r,s&&(n.isIncomplete=!1),w(y,e.updateManifest(t,n),4);case 4:o=!0,a(),A(y,0);break;case 2:return m=E(y),w(y,Uy(t),5);case 5:if(o){y.u(6);break}return v=Object.values(i),w(y,e.removeSegments(v,(function(){})),6);case 6:throw m}}))}function By(e){return e.variants.some((function(e){var t=e.audio&&e.audio.encrypted;return e.video&&e.video.encrypted||t}))}function Fy(e){return e.variants.some((function(e){return(e.video?e.video.drmInfos:[]).concat(e.audio?e.audio.drmInfos:[]).some((function(e){return e.initData&&e.initData.length}))}))}function Vy(e,t,n,i){if(t.expiration=n.gd(),n=Fa(n),t.sessionIds=i.offline.usePersistentLicense?n:[],By(e)&&i.offline.usePersistentLicense&&!n.length)throw new De(2,9,9007)}function Hy(e,t){for(var n=[],i=l(e.streams),r=i.next();!r.done;r=i.next())r=r.value,t&&"video"==r.type?n.push({contentType:xi(r.mimeType,r.codecs),robustness:e.drmInfo.videoRobustness}):t||"audio"!=r.type||n.push({contentType:xi(r.mimeType,r.codecs),robustness:e.drmInfo.audioRobustness});return n}function Gy(e,t,n){return P((function(i){return w(i,function(e,t,n,i){var r,a,o;return P((function(s){return 1==s.g?i.drmInfo?(r=function(e){var t=Array.from(e.g.keys());if(!t.length)throw new De(2,9,9e3,"No supported storage mechanisms found");return e.g.get(t[0]).getEmeSessionCell()}(n),a=i.sessionIds.map((function(e){return{sessionId:e,keySystem:i.drmInfo.keySystem,licenseUri:i.drmInfo.licenseServerUri,serverCertificate:i.drmInfo.serverCertificate,audioCapabilities:Hy(i,!1),videoCapabilities:Hy(i,!0)}})),w(s,Iy(t,e,a),2)):s.return():3!=s.g?(o=s.h,w(s,r.remove(o),3)):w(s,r.add(a.filter((function(e){return!o.includes(e.sessionId)}))),0)}))}(e.g,e.h.drm,n,t),0)}))}function Ky(e,t,n){function i(){}var r=function(e){for(var t=new Set,n=(e=l(e.streams)).next();!n.done;n=e.next())for(var i=(n=l(n.value.segments)).next();!i.done;i=n.next())null!=(i=i.value).initSegmentKey&&t.add(i.initSegmentKey),t.add(i.dataKey);return Array.from(t)}(n);return Cy(t,n),Promise.all([e.removeSegments(r,i),e.removeManifests([t.key()],i)])}function Xy(e,t){var n;return P((function(i){switch(i.g){case 1:return S(i,2),w(i,Al(t,e.g,e.h.streaming.retryParameters),4);case 4:n=i.h,A(i,3);break;case 2:E(i);case 3:if(n)return i.return(n);throw new De(1,2,2011,t)}}))}function qy(e,t,n,i,r,a){var o={id:i.id,originalId:i.originalId,groupId:i.groupId,primary:i.primary,type:i.type,mimeType:i.mimeType,codecs:i.codecs,frameRate:i.frameRate,pixelAspectRatio:i.pixelAspectRatio,hdr:i.hdr,colorGamut:i.colorGamut,videoLayout:i.videoLayout,kind:i.kind,language:i.language,originalLanguage:i.originalLanguage,label:i.label,width:i.width||null,height:i.height||null,encrypted:i.encrypted,keyIds:i.keyIds,segments:[],variantIds:[],roles:i.roles,forced:i.forced,channelsCount:i.channelsCount,audioSamplingRate:i.audioSamplingRate,spatialAudio:i.spatialAudio,closedCaptions:i.closedCaptions,tilesLayout:i.tilesLayout,external:i.external,fastSwitching:i.fastSwitching,isAudioMuxedInVideo:i.isAudioMuxedInVideo},s=r.offline.numberOfParallelDownloads,u=0===s?i.id:0;return function(e,t,n){if(null!=(t=e.segmentIndex.find(t)))for(var i=e.segmentIndex.get(t);i;)n(i),i=e.segmentIndex.get(++t)}(i,n.presentationTimeline.qb(),(function(n){var r=Kv(n),l=void 0;if(!a.has(r)){var c=n.endTime-n.startTime;c=Ny(t,i.id)*c,c=zv(e.g,c),a.set(r,new Gv(n,c,u,!1))}n.ba&&(l=Kv(n.ba),a.has(l)||(c=.5*Ny(t,i.id),c=zv(e.g,c),a.set(l,new Gv(n.ba,c,u,!0)))),o.segments.push({pendingInitSegmentRefId:l,initSegmentKey:l?0:null,startTime:n.startTime,endTime:n.endTime,appendWindowStart:n.appendWindowStart,appendWindowEnd:n.appendWindowEnd,timestampOffset:n.timestampOffset,tilesLayout:n.tilesLayout,pendingSegmentRefId:r,dataKey:0,mimeType:n.mimeType,codecs:n.codecs,thumbnailSprite:n.thumbnailSprite}),0!==s&&(u=(u+1)%s)})),o}function zy(e){if(e.l.g)throw new De(2,9,7001)}function Wy(){if(!Oy())throw new De(2,9,9e3)}function Yy(e,t){return P((function(n){return 1==n.g?(e.i.push(t),x(n,2),w(n,t,4)):2!=n.g?n.return(n.h):(k(n),Ie(e.i,t),I(n,0))}))}function Jy(e){for(var t=new Set,n=l(e.variants),i=n.next();!i.done;i=n.next())(i=i.value).audio&&t.add(i.audio),i.video&&t.add(i.video);for(i=(n=l(e.textStreams)).next();!i.done;i=n.next())t.add(i.value);for(n=(e=l(e.imageStreams)).next();!n.done;n=e.next())t.add(n.value);return t}m(hy,ny),hy.prototype.updateManifestExpiration=function(e,t){var n,i,r,a=this;return P((function(o){return n=ey(a.h,a.g),i=n.store(),r=new Gr,i.get(e).onsuccess=function(n){(n=n.target.result)?(n.expiration=t,i.put(n),r.resolve()):r.reject(new De(2,9,9012,"Could not find values for "+e))},w(o,Promise.all([n.promise(),r]),0)}))},hy.prototype.cd=function(e){var t,n,i,r,a,o;return P((function(s){if(1==s.g){for(t=[],n=0;n<e.periods.length;++n)i=n==e.periods.length-1?e.duration:e.periods[n+1].startTime,r=i-e.periods[n].startTime,a=fy(e.periods[n],r),t.push(a);return w(s,xp(t),2)}return o=s.h,s.return({creationTime:0,originalManifestUri:e.originalManifestUri,duration:e.duration,size:e.size,expiration:null==e.expiration?1/0:e.expiration,streams:o,sessionIds:e.sessionIds,drmInfo:e.drmInfo,appMetadata:e.appMetadata,sequenceMode:!1})}))},hy.prototype.qg=function(e){return{data:e.data}},m(gy,ny),gy.prototype.cd=function(e){var t,n,i,r,a,o;return P((function(s){if(1==s.g){for(t=[],n=0;n<e.periods.length;++n){i=n==e.periods.length-1?e.duration:e.periods[n+1].startTime,r=i-e.periods[n].startTime;for(var u=e.periods[n],c=[],d=l(u.streams),h=d.next();!h.done;h=d.next())0!=(h=h.value).variantIds.length&&c.push(my(h,u.startTime,u.startTime+r));a=c,t.push(a)}return w(s,xp(t),2)}return o=s.h,s.return({appMetadata:e.appMetadata,creationTime:0,drmInfo:e.drmInfo,duration:e.duration,expiration:null==e.expiration?1/0:e.expiration,originalManifestUri:e.originalManifestUri,sessionIds:e.sessionIds,size:e.size,streams:o,sequenceMode:!1})}))},m(vy,ny),(i=vy.prototype).hasFixedKeySpace=function(){return!1},i.addSegments=function(e){return this.add(this.i,e)},i.addManifests=function(e){return this.add(this.g,e)},i.updateManifest=function(e,t){return function(e,t,n){var i=(e=ey(e.h,e.g)).store();return i.get(t).onsuccess=function(){i.put(n,t)},e.promise()}(this,e,t)},i.cd=function(e){return null==e.expiration&&(e.expiration=1/0),Promise.resolve(e)},(i=yy.prototype).init=function(){var t=this,n=new Gr,i=!1,r=new Be((function(){i=!0,n.reject(new De(2,9,9017))}));r.$(5);var a=e.indexedDB.open("shaka_offline_db",5);return a.onsuccess=function(){if(!i){var e=a.result;t.l=e;var o=e.objectStoreNames;o=o.contains("manifest")&&o.contains("segment")?new hy(e,"segment","manifest"):null,t.g=o,o=(o=e.objectStoreNames).contains("manifest-v2")&&o.contains("segment-v2")?new gy(e,"segment-v2","manifest-v2"):null,t.h=o,o=(o=e.objectStoreNames).contains("manifest-v3")&&o.contains("segment-v3")?new gy(e,"segment-v3","manifest-v3"):null,t.i=o,o=(o=e.objectStoreNames).contains("manifest-v5")&&o.contains("segment-v5")?new vy(e,"segment-v5","manifest-v5"):null,t.j=o,e=e.objectStoreNames.contains("session-ids")?new oy(e):null,t.m=e,r.stop(),n.resolve()}},a.onupgradeneeded=function(){for(var e=a.result,t=l(["segment-v5","manifest-v5","session-ids"]),n=t.next();!n.done;n=t.next())n=n.value,e.objectStoreNames.contains(n)||e.createObjectStore(n,{autoIncrement:!0})},a.onerror=function(e){i||(n.reject(new De(2,9,9001,a.error)),r.stop(),e.preventDefault())},n},i.destroy=function(){var e=this;return P((function(t){switch(t.g){case 1:if(!e.g){t.u(2);break}return w(t,e.g.destroy(),2);case 2:if(!e.h){t.u(4);break}return w(t,e.h.destroy(),4);case 4:if(!e.i){t.u(6);break}return w(t,e.i.destroy(),6);case 6:if(!e.j){t.u(8);break}return w(t,e.j.destroy(),8);case 8:if(!e.m){t.u(10);break}return w(t,e.m.destroy(),10);case 10:e.l&&e.l.close(),T(t)}}))},i.getCells=function(){var e=new Map;return this.g&&e.set("v1",this.g),this.h&&e.set("v2",this.h),this.i&&e.set("v3",this.i),this.j&&e.set("v5",this.j),e},i.getEmeSessionCell=function(){return this.m},i.erase=function(){var t=this;return P((function(n){switch(n.g){case 1:if(!t.g){n.u(2);break}return w(n,t.g.destroy(),2);case 2:if(!t.h){n.u(4);break}return w(n,t.h.destroy(),4);case 4:if(!t.i){n.u(6);break}return w(n,t.i.destroy(),6);case 6:if(!t.j){n.u(8);break}return w(n,t.j.destroy(),8);case 8:return t.l&&t.l.close(),w(n,function(){var t=new Gr,n=e.indexedDB.deleteDatabase("shaka_offline_db");return n.onblocked=function(){},n.onsuccess=function(){t.resolve()},n.onerror=function(e){t.reject(new De(2,9,9001,n.error)),e.preventDefault()},t}(),10);case 10:return t.l=null,t.g=null,t.h=null,t.i=null,t.j=null,w(n,t.init(),0)}}))},cy("idb",(function(){return(!ze()||ze()&&nt())&&!Ge()&&e.indexedDB?new yy:null})),by.prototype.rb=function(){return this.i},by.prototype.Ma=function(){return this.h},by.prototype.key=function(){return this.l},by.prototype.toString=function(){return this.j},(i=Ay.prototype).configure=function(){},i.start=function(e,t){var n,i,r,a,o,s,u=this;return P((function(l){switch(l.g){case 1:if(n=wy(e),u.g=n,null==n||"manifest"!=n.g)throw new De(2,1,9004,e);return i=new sy,x(l,2),w(l,i.init(),4);case 4:return w(l,ly(i,n.rb(),n.Ma()),5);case 5:return w(l,l.h.getManifests([n.key()]),6);case 6:return r=l.h,a=r[0],o=new Ty(n.rb(),n.Ma()),s=Sy(o,a),t.makeTextStreamsForClosedCaptions(s),l.return(s);case 2:return k(l),w(l,i.destroy(),7);case 7:I(l,0)}}))},i.stop=function(){return Promise.resolve()},i.update=function(){},i.onExpirationUpdated=function(e,t){var n,i,r,a,o,s,u,l=this;return P((function(c){switch(c.g){case 1:return n=l.g,i=new sy,S(c,2,3),w(c,i.init(),5);case 5:return w(c,ly(i,n.rb(),n.Ma()),6);case 6:return w(c,(r=c.h).getManifests([n.key()]),7);case 7:if(a=c.h,o=a[0],s=o.sessionIds.includes(e),u=null==o.expiration||o.expiration>t,!s||!u){c.u(3);break}return w(c,r.updateManifestExpiration(n.key(),t),3);case 3:return k(c),w(c,i.destroy(),10);case 10:I(c,0);break;case 2:E(c),c.u(3)}}))},i.onInitialVariantChosen=function(){},i.banLocation=function(){},i.setMediaElement=function(){},co["application/x-offline-manifest"]=function(){return new Ay},F("shaka.offline.OfflineScheme",Ey),Ey.plugin=ky,ia("offline",ky),(i=jy.prototype).destroy=function(){return this.l.destroy()},i.configure=function(e,t){return 2==arguments.length&&"string"==typeof e&&(e=el(e,t)),cl(this.h,e)},i.getConfiguration=function(){var e=ll();return cl(e,this.h,ll()),e},i.Ab=function(){return this.g},i.store=function(e,t,n,i,r){var a=this,o=this.getConfiguration(),s=new Wv(this.g);return this.j.push(s),t=function(e,t,n,i,r,a,o,s){var u,c,d,h,f,p,g,m,v,y,b,x,M,C,D,R,L,N,j,O,U;return P((function(_){switch(_.g){case 1:return Wy(),c=u=null,d=new sy,p=f=h=null,S(_,2,3),w(_,a(),5);case 5:return u=_.h,w(_,function(e,t,n,i){var r,a,o,s,u;return P((function(l){if(1==l.g)return r=null,a=e.g,o={networkingEngine:a,filter:function(){return Promise.resolve()},makeTextStreamsForClosedCaptions:function(){},onTimelineRegionAdded:function(){},onEvent:function(){},onError:function(e){r=e},isLowLatencyMode:function(){return!1},isAutoLowLatencyMode:function(){return!1},enableLowLatencyMode:function(){},updateDuration:function(){},newDrmInfo:function(){},onManifestUpdated:function(){},getBandwidthEstimate:function(){return i.abr.defaultBandwidthEstimate},onMetadata:function(){},disableStream:function(){},addFont:function(){}},n.configure(i.manifest),zy(e),w(l,n.start(t,o),2);if(3!=l.g)return s=l.h,zy(e),u=Jy(s),w(l,Promise.all(ga(u,(function(e){return e.createSegmentIndex()}))),3);if(zy(e),r)throw r;return l.return(s)}))}(e,t,u,o),6);case 6:if(g=_.h,zy(e),g.presentationTimeline.U()||g.presentationTimeline.uc())throw new De(2,9,9005,t);m=l(i),v=m.next();case 7:if(v.done){_.u(9);break}return y=v.value,w(_,function(e,t,n){var i,r,a,o,s,u,c,d,h,f,p,g,m,v,y;return P((function(b){switch(b.g){case 1:return w(b,Xy(e,t),2);case 2:if("text/vtt"!=(i=b.h))throw new De(1,2,2017,t);return w(b,function(e,t,n){var i,r,a;return P((function(o){return 1==o.g?(i=ca,(r=aa([e],n)).method="GET",w(o,t.request(i,r).promise,2)):(a=o.h,o.return(a.data))}))}(t,e.g,e.h.streaming.retryParameters),3);case 3:if(r=b.h,!(a=Fi[i]))throw new De(2,2,2014,i);for(o=a(),s={periodStart:0,segmentStart:0,segmentEnd:n.presentationTimeline.getDuration(),vttOffset:0},u=ge(r),c=o.parseMedia(u,s,t,[]),d=[],h=l(c),f=h.next(),p={};!f.done;p={ye:void 0,Ic:void 0},f=h.next())p.Ic=f.value,p.ye=null,g=function(e){return function(){return null==e.ye&&(e.ye=hi([t],[e.Ic.payload])),e.ye||[]}}(p),m=new vo(p.Ic.startTime,p.Ic.endTime,g,0,null,null,0,0,1/0),p.Ic.payload.includes("#xywh")&&4===(v=p.Ic.payload.split("#xywh=")[1].split(",")).length&&m.qe({height:parseInt(v[3],10),positionX:parseInt(v[0],10),positionY:parseInt(v[1],10),width:parseInt(v[2],10)}),d.push(m);if(y=i,!d.length){b.u(4);break}return w(b,Al(d[0].N()[0],e.g,e.h.manifest.retryParameters),5);case 5:y=b.h;case 4:return b.return({id:e.m++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new Zs(d),mimeType:y||"",codecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:"image",primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,tilesLayout:"1x1",accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([xi(y||"","")]),isAudioMuxedInVideo:!1})}}))}(e,y,g),10);case 10:b=_.h,g.imageStreams.push(b),zy(e),v=m.next(),_.u(7);break;case 9:x=l(r),M=x.next();case 11:return M.done?w(_,e.Gc(g,(function(e){p=p||e}),o),15):(C=M.value,w(_,function(e,t,n,i,r,a,o){var s;return P((function(u){if(1==u.g)return a?u.u(2):w(u,Xy(e,n),3);if(2!=u.g&&(a=u.h),s={id:e.m++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:tu(0,t.presentationTimeline.getDuration(),[n]),mimeType:a||"",codecs:o||"",kind:r,encrypted:!1,drmInfos:[],keyIds:new Set,language:i,originalLanguage:i,label:null,type:yi,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([xi(a||"",o||"")]),isAudioMuxedInVideo:!1},!Ui(xi(s.mimeType,s.codecs)))throw new De(2,2,2014,a);return u.return(s)}))}(e,g,C.uri,C.language,C.kind,C.mime,C.codecs),14));case 14:D=_.h,g.textStreams.push(D),zy(e),M=x.next(),_.u(11);break;case 15:if(c=_.h,zy(e),p)throw p;return w(_,function(e,t,n){var i,r,a,o,s,u,c,d,h,f,p,g,m,v,y,b,x,k,I,M,C,D,R,L,N,j,O,U,_;return P((function(P){switch(P.g){case 1:return i={width:1/0,height:1/0},function(e,t,n){e.variants=e.variants.filter((function(e){return ir(e,t,n)}))}(e,n.restrictions,i),w(P,rr(t,e,n.offline.usePersistentLicense,n.drm.preferredKeySystems,n.drm.keySystemsMapping),2);case 2:for(r=[],a=n.preferredDecodingAttributes,o=n.preferredVideoCodecs,s=n.preferredAudioCodecs,u=n.preferredTextFormats,nr(e,o,s,a,u),c=l(e.variants),d=c.next();!d.done;d=c.next())h=d.value,r.push(dr(h));for(f=l(e.textStreams),p=f.next();!p.done;p=f.next())g=p.value,r.push(hr(g));for(m=l(e.imageStreams),v=m.next();!v.done;v=m.next())y=v.value,r.push(fr(y));return w(P,n.offline.trackSelectionCallback(r),3);case 3:for(b=P.h,x=e.presentationTimeline.getDuration(),k=0,I=l(b),M=I.next();!M.done;M=I.next())C=M.value,D=C.bandwidth*x/8,k+=D;return S(P,4),w(P,n.offline.downloadSizeCallback(k),6);case 6:if(!P.h)throw new De(2,9,9014);A(P,5);break;case 4:if((R=E(P))instanceof De)throw R;throw new De(2,9,9015);case 5:for(L=new Set,N=new Set,j=new Set,O=l(b),U=O.next();!U.done;U=O.next())"variant"==(_=U.value).type&&L.add(_.id),"text"==_.type&&N.add(_.id),"image"==_.type&&j.add(_.id);e.variants=e.variants.filter((function(e){return L.has(e.id)})),e.textStreams=e.textStreams.filter((function(e){return N.has(e.id)})),e.imageStreams=e.imageStreams.filter((function(e){return j.has(e.id)})),function(e){e.variants.map((function(e){return e.video}));var t=new Set(e.variants.map((function(e){return e.audio})));e=e.textStreams;for(var n=l(t),i=n.next();!i.done;i=n.next())for(var r=(i=l(t)).next();!r.done;r=i.next());for(n=(t=l(e)).next();!n.done;n=t.next())for(i=(n=l(e)).next();!i.done;i=n.next());}(e),T(P)}}))}(g,c,o),16);case 16:return w(_,d.init(),17);case 17:return zy(e),w(_,uy(d),18);case 18:return h=_.h,zy(e),R=function(e,t,n,i,r,a){var o=function(e,t,n){return{offlineUri:null,originalManifestUri:e,duration:t.presentationTimeline.getDuration(),size:0,expiration:1/0,tracks:t=Dy(t),appMetadata:n,isIncomplete:!1}}(n,t,i),s=r.offline.progressCallback;!function(e,t,n){e.m=function(e,t){o.size=t,s(o,e)},e.l=n}(a,0,(function(t,n){u&&r.offline.usePersistentLicense&&c==n&&Ba(e,"cenc",t)}));var u=By(t)&&!Fy(t),c=null;u&&(c=$y.get(e.g.keySystem));for(var d=new Ry,h=l(t.textStreams),f=h.next();!f.done;f=h.next())d.g[f.value.id]=52;for(f=(h=l(t.imageStreams)).next();!f.done;f=h.next())Ly(d,f.value);for(f=(h=l(t.variants)).next();!f.done;f=h.next())Py(d,f.value);return d=function(e,t,n,i){for(var r=new Map,a=Jy(n),o=new Map,s=(a=l(a)).next();!s.done;s=a.next()){var u=qy(e,t,n,s=s.value,i,r);o.set(s.id,u)}for(t=(e=l(n.variants)).next();!t.done;t=e.next())(t=t.value).audio&&o.get(t.audio.id).variantIds.push(t.id),t.video&&o.get(t.video.id).variantIds.push(t.id);return{streams:Array.from(o.values()),ag:Array.from(r.values())}}(a,d,t,r),a=d.streams,d=d.ag,h=e.g,f=r.offline.usePersistentLicense,h&&f&&(h.initData=[]),{xi:{creationTime:Date.now(),originalManifestUri:n,duration:t.presentationTimeline.getDuration(),size:0,expiration:e.gd(),streams:a,sessionIds:f?Fa(e):[],drmInfo:h,appMetadata:i,isIncomplete:!0,sequenceMode:t.sequenceMode,type:t.type},ag:d}}(c,g,t,n,o,s),L=R.xi,N=R.ag,w(_,h.Ma.addManifests([L]),19);case 19:if(j=_.h,zy(e),f=j[0],zy(e),p)throw p;return w(_,function(e,t,n,i,r,a,o,s,u){var c,d,h,f,p,g,m,v,y,b;return P((function(x){switch(x.g){case 1:if(c={},d=0,h=function(t,h){var f,p,g,m,v,y,b;return P((function(S){if(1==S.g){for(f=l(t),p=f.next(),g={};!p.done;g={Jc:void 0},p=f.next())g.Jc=p.value,m=Xv(g.Jc,a),v=g.Jc.i,y=g.Jc.h,b=function(t){return function(n){var i,r,a;return P((function(s){if(1==s.g)return w(s,o.addSegments([{data:n}]),2);i=s.h,zy(e),r=t.Jc.g,a=Kv(r),c[a]=i[0],d+=n.byteLength,T(s)}))}}(g),Jv(r,g.Jc.groupId,m,v,y,b);return w(S,function(e){return P((function(t){return 1==t.g?w(t,Promise.all(e.j.values()),2):t.return(e.g.h)}))}(r),2)}return h?(zy(e),Vy(s,i,u,a),w(S,o.updateManifest(n,i),0)):S.u(0)}))},f=!1,S(x,2),!By(s)||!f||Fy(s)){x.u(4);break}return w(x,h(t.filter((function(e){return e.h})),!0),5);case 5:return zy(e),t=t.filter((function(e){return!e.h})),p=c,g=d,c={},d=0,w(x,_y(o,n,i,p,g,(function(){return zy(e)})),6);case 6:zy(e);case 4:if(f){x.u(7);break}return w(x,h(t,!1),8);case 8:return zy(e),m=c,v=d,c={},d=0,w(x,_y(o,n,i,m,v,(function(){return zy(e)})),9);case 9:zy(e);case 7:A(x,0);break;case 2:return y=E(x),b=Object.values(c),w(x,o.removeSegments(b,(function(){})),10);case 10:throw y}}))}(e,N,f,L,s,o,h.Ma,g,c),20);case 20:return zy(e),Vy(g,L,c,o),w(_,h.Ma.updateManifest(f,L),21);case 21:return zy(e),O=new by("manifest",h.path.rb,h.path.Ma,f),_.return(Cy(O,L));case 3:return k(_),w(_,d.destroy(),22);case 22:if(!u){_.u(23);break}return w(_,u.stop(),23);case 23:if(!c){_.u(25);break}return w(_,c.destroy(),25);case 25:I(_,0);break;case 2:if(U=E(_),null==f){_.u(27);break}return w(_,Uy(f),27);case 27:throw p||U}}))}(this,e,t||{},i||[],r||[],(function(){var t;return P((function(i){return 1==i.g?n?i.u(2):w(i,Al(e,a.g,o.manifest.retryParameters),3):(2!=i.g&&(n=i.h),t=lo(e,n||null),i.return(t()))}))}),o,s),(t=new Kr(t,(function(){return Yv(s)}))).finally((function(){Ie(a.j,s)})),function(e,t){var n=t.promise;return e.i.push(n),t.finally((function(){Ie(e.i,n)}))}(this,t)},i.remove=function(e){return Yy(this,function(e,t){var n,i,r,a,o,s;return P((function(u){switch(u.g){case 1:if(Wy(),null==(n=wy(t))||"manifest"!=n.g)throw new De(2,9,9004,t);return i=n,r=new sy,x(u,2),w(u,r.init(),4);case 4:return w(u,ly(r,i.rb(),i.Ma()),5);case 5:return w(u,(a=u.h).getManifests([i.key()]),6);case 6:return o=u.h,s=o[0],w(u,Promise.all([Gy(e,s,r),Ky(a,i,s)]),2);case 2:return k(u),w(u,r.destroy(),8);case 8:I(u,0)}}))}(this,e))},i.Pi=function(){return Yy(this,function(e){var t,n,i,r,a,o,s,u,c,d;return P((function(h){switch(h.g){case 1:return Wy(),t=e.g,n=e.h.drm,i=new sy,r=!1,x(h,2),w(h,i.init(),4);case 4:a=[],function(e){e.g.forEach((function(e){var t;t=e.getEmeSessionCell(),a.push(t)}))}(i),o=l(a),s=o.next();case 5:if(s.done){h.u(2);break}return w(h,(u=s.value).getAll(),8);case 8:return c=h.h,w(h,Iy(n,t,c),9);case 9:return d=h.h,w(h,u.remove(d),10);case 10:d.length!=c.length&&(r=!0),s=o.next(),h.u(5);break;case 2:return k(h),w(h,i.destroy(),11);case 11:I(h,3);break;case 3:return h.return(!r)}}))}(this))},i.list=function(){return Yy(this,P((function(i){switch(i.g){case 1:return Wy(),e=[],t=new sy,x(i,2),w(i,t.init(),4);case 4:return n=Promise.resolve(),function(e,t){e.g.forEach((function(e,n){e.getCells().forEach((function(e,i){t({rb:n,Ma:i},e)}))}))}(t,(function(t,i){n=n.then((function(){return P((function(n){if(1==n.g)return w(n,i.getAllManifests(),2);n.h.forEach((function(n,i){n=Cy(new by("manifest",t.rb,t.Ma,i),n),e.push(n)})),T(n)}))}))})),w(i,n,2);case 2:return k(i),w(i,t.destroy(),6);case 6:I(i,3);break;case 3:return i.return(e)}})));var e,t,n},i.Gc=function(e,t,n){var i,r=this;return P((function(a){return 1==a.g?((i=new Na({Nb:r.g,onError:t,ee:function(){},onExpirationUpdated:function(){},onEvent:function(){}})).configure(n.drm),w(a,function(e,t,n){return e.ja=!0,e.B=new Map,e.O=n,Oa(e,t)}(i,e.variants,n.offline.usePersistentLicense),2)):3!=a.g?w(a,_a(i),3):a.return(i)}))},F("shaka.offline.Storage",jy),jy.deleteAll=function(){var e;return P((function(t){return 1==t.g?(e=new sy,x(t,2),w(t,function(e){var t,n;return P((function(i){return 1==i.g?(t=Array.from(e.g.values()),(n=0<t.length)||dy.forEach((function(e){(e=e())&&t.push(e)})),w(i,Promise.all(t.map((function(e){return e.erase()}))),2)):n?i.u(0):w(i,Promise.all(t.map((function(e){return e.destroy()}))),0)}))}(e),2)):5!=t.g?(k(t),w(t,e.destroy(),5)):I(t,0)}))},jy.prototype.list=jy.prototype.list,jy.prototype.removeEmeSessions=jy.prototype.Pi,jy.prototype.remove=jy.prototype.remove,jy.prototype.store=jy.prototype.store,jy.prototype.getNetworkingEngine=jy.prototype.Ab,jy.prototype.getConfiguration=jy.prototype.getConfiguration,jy.prototype.configure=jy.prototype.configure,jy.prototype.destroy=jy.prototype.destroy,jy.support=Oy;var $y=(new Map).set("org.w3.clearkey","1077efecc0b24d02ace33c1e52e2fb4b").set("com.widevine.alpha","edef8ba979d64acea3c827dcd51d21ed").set("com.microsoft.playready","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.recommendation","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.software","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.hardware","9a04f07998404286ab92e65be0885f95");function Qy(){}function Zy(e,t){for(e={priority:t||0,callback:e},t=0;t<eb.length;t++)if(eb[t].priority<e.priority)return void eb.splice(t,0,e);eb.push(e)}ld.offline=Oy,F("shaka.polyfill",Qy),Qy.register=Zy,Qy.installAll=function(){for(var e=l(eb),t=e.next();!t.done;t=e.next()){t=t.value;try{t.callback()}catch(e){W("Error installing polyfill!",e)}}};var eb=[];function tb(){}function nb(){if(!Object.getOwnPropertyDescriptor(Element.prototype,"ariaHidden"))for(var e=l(["ariaHidden","ariaLabel","ariaPressed","ariaSelected"]),t=e.next();!t.done;t=e.next())ib(t.value)}function ib(e){var t="aria-"+e.toLowerCase().replace(/^aria/,"");Object.defineProperty(Element.prototype,e,{get:function(){return this.getAttribute(t)},set:function(e){null==e||null==e?this.removeAttribute(t):this.setAttribute(t,e)}})}function rb(){}function ab(){$e()||rt("Sky_STB")||mS()}function ob(){}function sb(){if(e.Document){var t=Element.prototype;t.requestFullscreen=t.requestFullscreen||t.mozRequestFullScreen||t.msRequestFullscreen||t.webkitRequestFullscreen,(t=Document.prototype).exitFullscreen=t.exitFullscreen||t.mozCancelFullScreen||t.msExitFullscreen||t.webkitCancelFullScreen,"fullscreenElement"in document||(Object.defineProperty(document,"fullscreenElement",{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement||document.webkitFullscreenElement}}),Object.defineProperty(document,"fullscreenEnabled",{get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled}})),document.addEventListener("webkitfullscreenchange",ub),document.addEventListener("webkitfullscreenerror",ub),document.addEventListener("mozfullscreenchange",ub),document.addEventListener("mozfullscreenerror",ub),document.addEventListener("MSFullscreenChange",ub),document.addEventListener("MSFullscreenError",ub)}}function ub(e){var t=e.type.replace(/^(webkit|moz|MS)/,"").toLowerCase(),n=document.createEvent("Event");n.initEvent(t,e.bubbles,e.cancelable),e.target.dispatchEvent(n)}function lb(){}function cb(){var e=!0;!ze()||ze()&&nt()||ze()&&rt("Fuchsia")||(e=!1),(Ye()||Je()||$e()||qe()||Ke()||rt("PC=EOS")||Qe()||rt("WPE"))&&(e=!1),e&&navigator.mediaCapabilities||(navigator.mediaCapabilities||(navigator.mediaCapabilities={}),hb=navigator.mediaCapabilities,navigator.mediaCapabilities.decodingInfo=db)}function db(t){var n,i,r,a,o;return P((function(s){switch(s.g){case 1:if(n={supported:!1,powerEfficient:!0,smooth:!0,keySystemAccess:null,configuration:t},i=t.video,r=t.audio,"media-source"!=t.type){if("file"!=t.type)return s.return(n);if(i&&!Ve(i.contentType)||r&&!Ve(r.contentType))return s.return(n);s.u(2);break}if(!Fe())return s.return(n);if(!i){s.u(3);break}return w(s,function(t){var n,i;return P((function(r){return 1==r.g?ze()?w(r,function(t){var n,i,r;return P((function(a){if(1==a.g){if(!(e.cast&&cast.__platform__&&cast.__platform__.canDisplayType))return a.return(ne(t.contentType));switch(n=t.contentType,t.width&&t.height&&(1280<t.width||720<t.height)&&(n+="; width="+t.width+"; height="+t.height),t.framerate&&(24>(i=Math.round(t.framerate))||30<i)&&(n+="; framerate="+t.framerate),t.transferFunction||""){case"":case"srgb":break;case"pq":n+="; eotf=smpte2084";break;case"hlg":n+="; eotf=arib-std-b67";break;default:return a.return(!1)}return r=!1,n in bb?(r=bb[n],a.u(2)):w(a,cast.__platform__.canDisplayType(n),3)}return 2!=a.g&&(r=a.h,bb[n]=r),a.return(r)}))}(t),3):Ke()?(n=t.contentType,t.width&&t.height&&(n+="; width="+t.width,n+="; height="+t.height),t.framerate&&(n+="; framerate="+t.framerate),t.bitrate&&(n+="; bitrate="+t.bitrate),r.return(ne(n))):r.u(2):2!=r.g?(i=r.h,r.return(i)):r.return(ne(t.contentType))}))}(i),4);case 4:if(!s.h)return s.return(n);case 3:if(r){var u=r.contentType;if(ze()&&r.spatialRendering&&(u+="; spatialRendering=true"),!ne(u))return s.return(n)}case 2:return t.keySystemConfiguration?(a=t.keySystemConfiguration,w(s,function(e,t,n){var i,r,a,o,s,u,l,c,d,h,f;return P((function(p){switch(p.g){case 1:if(i=[],r=[],n.audio&&(a={robustness:n.audio.robustness||"",contentType:t.contentType},Ke()&&t.contentType.includes('codecs="ac-3"')&&(a.contentType='audio/mp4; codecs="ec-3"'),n.audio.encryptionScheme&&(a.encryptionScheme=n.audio.encryptionScheme),i.push(a)),n.video&&(o={robustness:n.video.robustness||"",contentType:e.contentType},n.video.encryptionScheme&&(o.encryptionScheme=n.video.encryptionScheme),r.push(o)),s={initDataTypes:[n.initDataType],distinctiveIdentifier:n.distinctiveIdentifier,persistentState:n.persistentState,sessionTypes:n.sessionTypes},i.length&&(s.audioCapabilities=i),r.length&&(s.videoCapabilities=r),u=e?e.contentType:"",l=t?t.contentType:"",c=Di(u)+";"+Ci(u),d=Di(l)+";"+Ci(l),h=n.keySystem,f=null,S(p,2),Ue.has(c+"#"+d+"#"+h)){f=Ue.get(c+"#"+d+"#"+h)||null,p.u(4);break}return w(p,navigator.requestMediaKeySystemAccess(n.keySystem,[s]),5);case 5:f=p.h,Ue.set(c+"#"+d+"#"+h,f);case 4:A(p,3);break;case 2:E(p);case 3:return p.return(f)}}))}(i,r,a),6)):(n.supported=!0,s.return(n));case 6:(o=s.h)&&(n.supported=!0,n.keySystemAccess=o);case 5:return s.return(n)}}))}Qy.Aria=tb,tb.install=nb,Zy(nb),Qy.EncryptionScheme=rb,rb.install=ab,Zy(ab,-2),Qy.Fullscreen=ob,ob.install=sb,Zy(sb),Qy.MediaCapabilities=lb,lb.install=cb;var hb=null;lb.originalMcap=hb;var fb,pb,gb,mb,vb,yb,bb={};function wb(){}function Tb(){var t=et();(e.MediaSource||e.ManagedMediaSource)&&(t&&e.MediaSource?10>=t?e.MediaSource=null:12>=t?(Sb(),xb()):15>=t&&Sb():rt("DT_STB_BCM")?(Sb(),xb()):rt("Tizen 2")||Xe()||rt("Tizen 4")?function(){var t=MediaSource.isTypeSupported.bind(MediaSource);if(MediaSource.isTypeSupported=function(e){return"opus"!=Ci(e)&&t(e)},e.ManagedMediaSource){var n=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);e.ManagedMediaSource.isTypeSupported=function(e){return"opus"!=Ci(e)&&n(e)}}}():rt("WPE")&&(Sb(),xb())),(e.MediaSource||e.ManagedMediaSource)&&function(){if(e.MediaSource){var t=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=function(e){return"mp2t"!=Ii(e)&&t(e)}}if(e.ManagedMediaSource){var n=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);e.ManagedMediaSource.isTypeSupported=function(e){return"mp2t"!=Ii(e)&&n(e)}}}(),e.MediaSource&&MediaSource.isTypeSupported('video/webm; codecs="vp9"')&&!MediaSource.isTypeSupported('video/webm; codecs="vp09.00.10.08"')&&function(){var e=MediaSource.isTypeSupported;qe()||(MediaSource.isTypeSupported=function(t){var n=t.split(/ *; */),i=n.findIndex((function(e){return e.startsWith("codecs=")}));if(0>i)return e(t);var r=n[i].replace("codecs=","").replace(/"/g,"").split(/\s*,\s*/),a=r.findIndex((function(e){return e.startsWith("vp09")}));return 0<=a&&(r[a]="vp9",n[i]='codecs="'+r.join(",")+'"',t=n.join("; ")),e(t)})}()}function Sb(){var e=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var t=e.apply(this,L.apply(0,arguments));return t.abort=function(){},t}}function xb(){var e=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(t,n){return e.call(this,t,n-.001)}}function Ab(){}function Eb(){screen.orientation&&screen.orientation.unlock||(null!=screen.orientation?(void 0===screen.orientation.lock&&(screen.orientation.lock=function(){return Promise.resolve()}),void 0===screen.orientation.unlock&&(screen.orientation.unlock=function(){})):null!=e.orientation&&function(){function t(){switch(e.orientation){case-90:n.type="landscape-secondary",n.angle=270;break;case 0:n.type="portrait-primary",n.angle=0;break;case 90:n.type="landscape-primary",n.angle=90;break;case 180:n.type="portrait-secondary",n.angle=180}}var n=new kb;screen.orientation=n,t(),e.addEventListener("orientationchange",(function(){t();var e=new Jr("change");n.dispatchEvent(e)}))}())}function kb(){Zr.call(this),this.type="",this.angle=0}function Ib(){}function Mb(e,t){try{var n=new Rb(e,t);return Promise.resolve(n)}catch(e){return Promise.reject(e)}}function Cb(e){var t=this.mediaKeys;return t&&t!=e&&Lb(t,null),delete this.mediaKeys,(this.mediaKeys=e)?Lb(e,this):Promise.resolve()}function Db(e){if(ve(e=ge(e.initData)).getUint32(0,!0)+4!=e.byteLength)throw new RangeError("Malformed FairPlay init data");e=pt(e=ht(e.subarray(4),!0));var t=new Event("encrypted");t.initDataType="skd",t.initData=pe(e),this.dispatchEvent(t)}function Rb(e,t){if(this.keySystem=e,e.startsWith("com.apple.fps"))for(t=(e=l(t)).next();!t.done;t=e.next()){var n=t.value;if("required"==n.persistentState)t=null;else{t={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:n.initDataTypes,sessionTypes:["temporary"],label:n.label};var i=!1,r=!1;if(n.audioCapabilities)for(var a=l(n.audioCapabilities),o=a.next();!o.done;o=a.next())(o=o.value).contentType&&(i=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,o.contentType.split(";")[0])&&(t.audioCapabilities.push(o),r=!0));if(n.videoCapabilities)for(a=(n=l(n.videoCapabilities)).next();!a.done;a=n.next())(a=a.value).contentType&&(i=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,a.contentType.split(";")[0])&&(t.videoCapabilities.push(a),r=!0));i||(r=WebKitMediaKeys.isTypeSupported(this.keySystem,"video/mp4")),t=r?t:null}if(t)return void(this.g=t)}throw(e=Error("Unsupported keySystem")).name="NotSupportedError",e.code=DOMException.NOT_SUPPORTED_ERR,e}function Pb(e){this.h=new WebKitMediaKeys(e),this.g=new Z}function Lb(e,t){if(e.g.Va(),!t)return Promise.resolve();e.g.D(t,"webkitneedkey",Db);try{return Bs(t,HTMLMediaElement.HAVE_METADATA,e.g,(function(){t.webkitSetMediaKeys(e.h)})),Promise.resolve()}catch(e){return Promise.reject(e)}}function Nb(e){Zr.call(this),this.i=null,this.l=e,this.g=this.h=null,this.j=new Z,this.sessionId="",this.expiration=NaN,this.closed=new Gr,this.keyStatuses=new Ob}function jb(e,t){var n=e.keyStatuses;n.size=null==t?0:1,n.g=t,t=new Jr("keystatuseschange"),e.dispatchEvent(t)}function Ob(){this.size=0,this.g=void 0}lb.memoizedCanDisplayTypeRequests_=bb,Zy(cb,-1),Qy.MediaSource=wb,wb.install=Tb,Zy(Tb),Qy.Orientation=Ab,Ab.install=Eb,m(kb,Zr),kb.prototype.lock=function(e){function t(e){return screen.lockOrientation?screen.lockOrientation(e):screen.mozLockOrientation?screen.mozLockOrientation(e):!!screen.msLockOrientation&&screen.msLockOrientation(e)}var n=!1;switch(e){case"natural":n=t("default");break;case"any":n=!0,this.unlock();break;default:n=t(e)}return n?Promise.resolve():((e=Error("screen.orientation.lock() is not available on this device")).name="NotSupportedError",e.code=DOMException.NOT_SUPPORTED_ERR,Promise.reject(e))},kb.prototype.unlock=function(){screen.unlockOrientation?screen.unlockOrientation():screen.mozUnlockOrientation?screen.mozUnlockOrientation():screen.msUnlockOrientation&&screen.msUnlockOrientation()},Zy(Eb),Qy.PatchedMediaKeysApple=Ib,Ib.uninstall=function(){fb&&(fb=!1,Object.defineProperty(HTMLMediaElement.prototype,"mediaKeys",pb),HTMLMediaElement.prototype.setMediaKeys=gb,e.MediaKeys=mb,e.MediaKeySystemAccess=vb,navigator.requestMediaKeySystemAccess=yb,pb=yb=gb=vb=mb=null,e.shakaMediaKeysPolyfill="")},Ib.install=function(t){e.HTMLVideoElement&&e.WebKitMediaKeys&&(void 0!==t&&t&&(fb=!0,pb=Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"mediaKeys"),gb=HTMLMediaElement.prototype.setMediaKeys,mb=e.MediaKeys,vb=e.MediaKeySystemAccess,yb=navigator.requestMediaKeySystemAccess),delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Cb,e.MediaKeys=Pb,e.MediaKeySystemAccess=Rb,navigator.requestMediaKeySystemAccess=Mb,e.shakaMediaKeysPolyfill=Ub)},Rb.prototype.createMediaKeys=function(){var e=new Pb(this.keySystem);return Promise.resolve(e)},Rb.prototype.getConfiguration=function(){return this.g},Pb.prototype.createSession=function(e){if("temporary"!=(e=e||"temporary"))throw new TypeError("Session type "+e+" is unsupported on this platform.");return new Nb(this.h,e)},Pb.prototype.setServerCertificate=function(){return Promise.resolve(!1)},Pb.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")},m(Nb,Zr),(i=Nb.prototype).generateRequest=function(e,t){var n=this;this.h=new Gr;try{var i=this.l.createSession("video/mp4",ge(t));this.i=i,this.sessionId=i.sessionId||"",this.j.D(this.i,"webkitkeymessage",(function(e){n.h&&(n.h.resolve(),n.h=null),e=new Jr("message",e=(new Map).set("messageType",null==n.keyStatuses.$b()?"license-request":"license-renewal").set("message",pe(e.message))),n.dispatchEvent(e)})),this.j.D(i,"webkitkeyadded",(function(){n.g&&(jb(n,"usable"),n.g.resolve(),n.g=null)})),this.j.D(i,"webkitkeyerror",(function(){var e=Error("EME PatchedMediaKeysApple key error");if(e.errorCode=n.i.error,null!=n.h)n.h.reject(e),n.h=null;else if(null!=n.g)n.g.reject(e),n.g=null;else switch(n.i.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:jb(n,"output-not-allowed");break;default:jb(n,"internal-error")}})),jb(this,"status-pending")}catch(e){this.h.reject(e)}return this.h},i.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))},i.update=function(e){this.g=new Gr;try{this.i.update(ge(e))}catch(e){this.g.reject(e)}return this.g},i.close=function(){try{this.i.close(),this.closed.resolve(),this.j.Va()}catch(e){this.closed.reject(e)}return this.closed},i.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))},(i=Ob.prototype).$b=function(){return this.g},i.forEach=function(e){this.g&&e(this.g,Oe.value())},i.get=function(e){if(this.has(e))return this.g},i.has=function(e){var t=Oe.value();return!(!this.g||!fe(e,t))},i.entries=function(){},i.keys=function(){},i.values=function(){};var Ub="apple";function _b(){}function Bb(){e.MediaKeys&&(!MediaKeys.prototype.setServerCertificate||Xe()||rt("Tizen 4")||rt("Tizen 5.0")||qe()&&38===We())&&(MediaKeys.prototype.setServerCertificate=Fb)}function Fb(){return Promise.resolve(!1)}function Vb(){}function Hb(){!e.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(navigator.requestMediaKeySystemAccess=Gb,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Kb,e.MediaKeys=Xb,e.MediaKeySystemAccess=qb,e.shakaMediaKeysPolyfill=zb)}function Gb(){return Promise.reject(Error("The key system specified is not supported."))}function Kb(e){return null==e?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}function Xb(){throw new TypeError("Illegal constructor.")}function qb(){throw this.keySystem="",new TypeError("Illegal constructor.")}Qy.PatchedMediaKeysCert=_b,_b.install=Bb,Zy(Bb),Qy.PatchedMediaKeysNop=Vb,Vb.install=Hb,Xb.prototype.createSession=function(){},Xb.prototype.setServerCertificate=function(){},Xb.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")},qb.prototype.getConfiguration=function(){},qb.prototype.createMediaKeys=function(){};var zb="nop";function Wb(){}function Yb(){if(!(!e.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)uw="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;navigator.requestMediaKeySystemAccess=$b,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Qb,e.MediaKeys=ew,e.MediaKeySystemAccess=Zb,e.shakaMediaKeysPolyfill=lw}}function Jb(e){return uw?uw+e.charAt(0).toUpperCase()+e.slice(1):e}function $b(e,t){try{var n=new Zb(e,t);return Promise.resolve(n)}catch(e){return Promise.reject(e)}}function Qb(e){var t=this.mediaKeys;return t&&t!=e&&tw(t,null),delete this.mediaKeys,(this.mediaKeys=e)&&tw(e,this),Promise.resolve()}function Zb(e,t){this.g=this.keySystem=e;var n=!1;"org.w3.clearkey"==e&&(this.g="webkit-org.w3.clearkey",n=!1);var i=!1,r=document.getElementsByTagName("video");r=r.length?r[0]:document.createElement("video");for(var a=(t=l(t)).next();!a.done;a=t.next()){var o={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:(a=a.value).initDataTypes,sessionTypes:["temporary"],label:a.label},s=!1;if(a.audioCapabilities)for(var u=l(a.audioCapabilities),c=u.next();!c.done;c=u.next())(c=c.value).contentType&&(s=!0,r.canPlayType(c.contentType.split(";")[0],this.g)&&(o.audioCapabilities.push(c),i=!0));if(a.videoCapabilities)for(c=(u=l(a.videoCapabilities)).next();!c.done;c=u.next())(c=c.value).contentType&&(s=!0,r.canPlayType(c.contentType,this.g)&&(o.videoCapabilities.push(c),i=!0));if(s||(i=r.canPlayType("video/mp4",this.g)||r.canPlayType("video/webm",this.g)),"required"==a.persistentState&&(n?(o.persistentState="required",o.sessionTypes=["persistent-license"]):i=!1),i)return void(this.h=o)}throw n="Unsupported keySystem","org.w3.clearkey"!=e&&"com.widevine.alpha"!=e||(n="None of the requested configurations were supported."),(e=Error(n)).name="NotSupportedError",e.code=DOMException.NOT_SUPPORTED_ERR,e}function ew(e){this.l=e,this.h=null,this.g=new Z,this.i=[],this.j=new Map}function tw(e,t){e.h=t,e.g.Va();var n=uw;t&&(e.g.D(t,n+"needkey",(function(t){var n=new CustomEvent("encrypted");n.initDataType="cenc",n.initData=pe(t.initData),e.h.dispatchEvent(n)})),e.g.D(t,n+"keymessage",(function(t){var n=nw(e,t.sessionId);n&&(t=new Jr("message",t=(new Map).set("messageType",null==n.keyStatuses.$b()?"licenserequest":"licenserenewal").set("message",t.message)),n.h&&(n.h.resolve(),n.h=null),n.dispatchEvent(t))})),e.g.D(t,n+"keyadded",(function(t){(t=nw(e,t.sessionId))&&t.ready()})),e.g.D(t,n+"keyerror",(function(t){var n=nw(e,t.sessionId);if(n){var i=Error("EME v0.1b key error"),r=t.errorCode;r.systemCode=t.systemCode,i.errorCode=r,!t.sessionId&&n.h?(45==t.systemCode&&(i.message="Unsupported session type."),n.h.reject(i),n.h=null):t.sessionId&&n.g?(n.g.reject(i),n.g=null):(i=t.systemCode,t.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?ow(n,"output-restricted"):ow(n,1==i?"expired":"internal-error"))}})))}function nw(e,t){var n=e.j.get(t);return n||((n=e.i.shift())?(n.sessionId=t,e.j.set(t,n),n):null)}function iw(e,t,n){Zr.call(this),this.j=e,this.m=!1,this.g=this.h=null,this.i=t,this.l=n,this.sessionId="",this.expiration=NaN,this.closed=new Gr,this.keyStatuses=new sw}function rw(e,t,n){if(e.m)return Promise.reject(Error("The session is already initialized."));e.m=!0;try{if("persistent-license"==e.l)if(n)var i=ge(pt("LOAD_SESSION|"+n));else{var r=pt("PERSISTENT|");i=di(r,t)}else i=ge(t)}catch(e){return Promise.reject(e)}e.h=new Gr;var a=Jb("generateKeyRequest");try{e.j[a](e.i,i)}catch(t){if("InvalidStateError"!=t.name)return e.h=null,Promise.reject(t);new Be((function(){try{e.j[a](e.i,i)}catch(t){e.h.reject(t),e.h=null}})).$(.01)}return e.h}function aw(e,t,n){if(e.g)e.g.then((function(){return aw(e,t,n)})).catch((function(){return aw(e,t,n)}));else{if(e.g=t,"webkit-org.w3.clearkey"==e.i){var i=dt(n),r=JSON.parse(i);"oct"!=r.keys[0].kty&&(e.g.reject(Error("Response is not a valid JSON Web Key Set.")),e.g=null),i=ui(r.keys[0].k),r=ui(r.keys[0].kid)}else i=ge(n),r=null;var a=Jb("addKey");try{e.j[a](e.i,i,r,e.sessionId)}catch(t){e.g.reject(t),e.g=null}}}function ow(e,t){var n=e.keyStatuses;n.size=null==t?0:1,n.g=t,t=new Jr("keystatuseschange"),e.dispatchEvent(t)}function sw(){this.size=0,this.g=void 0}Zy(Hb,-10),Qy.PatchedMediaKeysWebkit=Wb,Wb.install=Yb,Zb.prototype.createMediaKeys=function(){var e=new ew(this.g);return Promise.resolve(e)},Zb.prototype.getConfiguration=function(){return this.h},ew.prototype.createSession=function(e){if("temporary"!=(e=e||"temporary")&&"persistent-license"!=e)throw new TypeError("Session type "+e+" is unsupported on this platform.");var t=this.h||document.createElement("video");return t.src||(t.src="about:blank"),e=new iw(t,this.l,e),this.i.push(e),e},ew.prototype.setServerCertificate=function(){return Promise.resolve(!1)},ew.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")},m(iw,Zr),(i=iw.prototype).ready=function(){ow(this,"usable"),this.g&&this.g.resolve(),this.g=null},i.generateRequest=function(e,t){return rw(this,t,null)},i.load=function(e){return"persistent-license"==this.l?rw(this,null,e):Promise.reject(Error("Not a persistent session."))},i.update=function(e){var t=new Gr;return aw(this,t,e),t},i.close=function(){if("persistent-license"!=this.l){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var e=Jb("cancelKeyRequest");try{this.j[e](this.i,this.sessionId)}catch(e){}}return this.closed.resolve(),this.closed},i.remove=function(){return"persistent-license"!=this.l?Promise.reject(Error("Not a persistent session.")):this.close()},(i=sw.prototype).$b=function(){return this.g},i.forEach=function(e){this.g&&e(this.g,Oe.value())},i.get=function(e){if(this.has(e))return this.g},i.has=function(e){var t=Oe.value();return!(!this.g||!fe(e,t))},i.entries=function(){},i.keys=function(){},i.values=function(){};var uw="",lw="webkit";function cw(){}function dw(){if(e.HTMLVideoElement){var t=HTMLVideoElement.prototype;t.requestPictureInPicture&&document.exitPictureInPicture||!t.webkitSupportsPresentationMode||(document.pictureInPictureEnabled=!0,document.pictureInPictureElement=null,t.requestPictureInPicture=fw,Object.defineProperty(t,"disablePictureInPicture",{get:gw,set:mw,enumerable:!0,configurable:!0}),document.exitPictureInPicture=pw,document.addEventListener("webkitpresentationmodechanged",hw,!0))}}function hw(e){if("picture-in-picture"==(e=e.target).webkitPresentationMode){document.pictureInPictureElement=e;var t=new Event("enterpictureinpicture");e.dispatchEvent(t)}else document.pictureInPictureElement==e&&(document.pictureInPictureElement=null),t=new Event("leavepictureinpicture"),e.dispatchEvent(t)}function fw(){return this.webkitSupportsPresentationMode("picture-in-picture")?(this.webkitSetPresentationMode("picture-in-picture"),document.pictureInPictureElement=this,Promise.resolve()):Promise.reject(Error("PiP not allowed by video element"))}function pw(){var e=document.pictureInPictureElement;return e?(e.webkitSetPresentationMode("inline"),document.pictureInPictureElement=null,Promise.resolve()):Promise.reject(Error("No picture in picture element found"))}function gw(){return!!this.hasAttribute("disablePictureInPicture")||!this.webkitSupportsPresentationMode("picture-in-picture")}function mw(e){e?this.setAttribute("disablePictureInPicture",""):this.removeAttribute("disablePictureInPicture")}function vw(){}function yw(){e.crypto&&("randomUUID"in e.crypto||(e.crypto.randomUUID=bw))}function bw(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.substr(t.lastIndexOf("/")+1)}function ww(){}function Tw(){var e=Symbol.prototype;"description"in e||Object.defineProperty(e,"description",{get:Sw})}function Sw(){var e=/\((.*)\)/.exec(this.toString());return e?e[1]:void 0}function xw(){}function Aw(){if(e.HTMLMediaElement){var t=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var e=t.apply(this);return e&&e.catch((function(){})),e}}}function Ew(){}function kw(){if(e.HTMLVideoElement){var t=HTMLVideoElement.prototype;!t.getVideoPlaybackQuality&&("webkitDroppedFrameCount"in t||qe()&&38===We())&&(t.getVideoPlaybackQuality=Iw)}}function Iw(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}function Mw(){}function Cw(){if(!e.VTTCue&&e.TextTrackCue){var t=null,n=TextTrackCue.length;if(3==n)t=Dw;else if(6==n)t=Rw;else{try{var i=!!Dw(1,2,"")}catch(e){i=!1}i&&(t=Dw)}t&&(e.VTTCue=function(e,n,i){return t(e,n,i)})}}function Dw(t,n,i){return new e.TextTrackCue(t,n,i)}function Rw(t,n,i){return new e.TextTrackCue(t+"-"+n+"-"+i,t,n,i)}function Pw(){}Zy(Yb),Qy.PiPWebkit=cw,cw.install=dw,Zy(dw),Qy.RandomUUID=vw,vw.install=yw,Zy(yw),Qy.Symbol=ww,ww.install=Tw,Zy(Tw),Qy.VideoPlayPromise=xw,xw.install=Aw,Zy(Aw),Qy.VideoPlaybackQuality=Ew,Ew.install=kw,Zy(kw),Qy.VTTCue=Mw,Mw.install=Cw,Zy(Cw),Pw.prototype.parseInit=function(){},Pw.prototype.setSequenceMode=function(){},Pw.prototype.setManifestType=function(){},Pw.prototype.parseMedia=function(e,t){for(var n=null,i=[],r=(e=l(e=dt(e).split(/\r?\n/))).next();!r.done;r=e.next())if((r=r.value)&&!/^\s+$/.test(r)&&(r=Lw.exec(r))){var a=Nw.exec(r[1]);r=new un(a=60*parseInt(a[1],10)+parseFloat(a[2].replace(",",".")),t.segmentEnd?t.segmentEnd:a+2,r[2]),n&&(n.endTime=a,i.push(n)),n=r}return n&&i.push(n),i},F("shaka.text.LrcTextParser",Pw),Pw.prototype.parseMedia=Pw.prototype.parseMedia,Pw.prototype.setManifestType=Pw.prototype.setManifestType,Pw.prototype.setSequenceMode=Pw.prototype.setSequenceMode,Pw.prototype.parseInit=Pw.prototype.parseInit;var Lw=/^\[(\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?)\](.*)/,Nw=/^(\d+):(\d{1,2}(?:[.,]\d{1,3})?)$/;function jw(){}function Ow(e,t,n,i,r,a,o,s,u,c,d,h,f){var p=c;if(Pt(e)){if(!d)return null;var g={tagName:"span",children:[jt(e)],attributes:{},parent:null}}else g=e;for(var m=null,v=l(cT),y=v.next();!y.done&&!(m=Kw(g,"backgroundImage",i,"#",y.value)[0]);y=v.next());v=null;var b=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/;if((y=Gt(g,cT,"backgroundImage"))&&b.test(y)){if((v=parseInt(y.split(":").pop(),10)-1)>=f.length)return null;v=f[v]}else h&&y&&!y.startsWith("#")&&(b=new Gn(h),y=new Gn(y),(y=b.resolve(y).toString())&&(v=y));if(("p"==e.tagName||m||v)&&(d=!0),e=d,y="default"==(g.attributes["xml:space"]||(s?"default":"preserve")),s=[],!(b=g.children.every(Pt)))for(var w=l(g.children),T=w.next();!T.done;T=w.next())(T=Ow(T.value,t,n,i,r,a,o,y,u,g,d,h,f))&&s.push(T);if(i=null!=c,h=jt(g),h=g.children.length&&h&&/\S/.test(h),!((w=g.attributes.begin||g.attributes.end||g.attributes.dur)||h||"br"==g.tagName||0!=s.length||i&&!y))return null;for(h=(f=qw(g,n)).start,f=f.end;p&&p.tagName&&"tt"!=p.tagName;)h=(f=Xw(p,n,h,f)).start,f=f.end,p=p.parent;if(null==h&&(h=0),h+=t.periodStart,f=null==f?1/0:f+t.periodStart,h=Math.max(h,t.segmentStart),f=Math.min(f,t.segmentEnd),!w&&0<s.length)for(h=1/0,f=0,n=(t=l(s)).next();!n.done;n=t.next())n=n.value,h=Math.min(h,n.startTime),f=Math.max(f,n.endTime);if("br"==g.tagName)return(r=new un(h,f,"")).lineBreak=!0,r;if(t="",b&&(t=vt(jt(g)||""),y&&(t=t.replace(/\s+/g," "))),(t=new un(h,f,t)).nestedCues=s,d||(t.isContainer=!0),u&&(t.cellResolution=u),u=Kw(g,"region",a,"")[0],g.attributes.region&&u&&u.attributes["xml:id"]){var S=u.attributes["xml:id"];t.region=o.filter((function(e){return e.id==S}))[0]}return o=u,c&&i&&!g.attributes.region&&!g.attributes.style&&(o=Kw(c,"region",a,"")[0]),function(e,t,n,i,r,a,o,s){if("rtl"==Fw(t,n,a,"direction",o=o||s)&&(e.direction="rtl"),"tb"==(s=Fw(t,n,a,"writingMode",o))||"tblr"==s?e.writingMode="vertical-lr":"tbrl"==s?e.writingMode="vertical-rl":"rltb"==s||"rl"==s?e.direction="rtl":s&&(e.direction=wn),(s=Fw(t,n,a,"textAlign",!0))?(e.positionAlign=sT[s],e.lineAlign=oT[s],e.textAlign=vn[s.toUpperCase()]):e.textAlign=mn,(s=Fw(t,n,a,"displayAlign",!0))&&(e.displayAlign=bn[s.toUpperCase()]),(s=Fw(t,n,a,"color",o))&&(e.color=_w(s)),(s=Fw(t,n,a,"backgroundColor",o))&&(e.backgroundColor=_w(s)),(s=Fw(t,n,a,"border",o))&&(e.border=s),s=Fw(t,n,a,"fontFamily",o))switch(s){case"monospaceSerif":e.fontFamily="Courier New,Liberation Mono,Courier,monospace";break;case"proportionalSansSerif":e.fontFamily="Arial,Helvetica,Liberation Sans,sans-serif";break;case"sansSerif":e.fontFamily="sans-serif";break;case"monospaceSansSerif":e.fontFamily="Consolas,monospace";break;case"proportionalSerif":e.fontFamily="serif";break;default:e.fontFamily=s.split(",").filter((function(e){return"default"!=e})).join(",")}switch((s=Fw(t,n,a,"fontWeight",o))&&"bold"==s&&(e.fontWeight=Mn),s=Fw(t,n,a,"wrapOption",o),e.wrapLine=!s||"noWrap"!=s,(s=Fw(t,n,a,"lineHeight",o))&&s.match(Qw)&&(e.lineHeight=s),(s=Fw(t,n,a,"fontSize",o))&&(s.match(Qw)||s.match($w))&&(e.fontSize=s),(s=Fw(t,n,a,"fontStyle",o))&&(e.fontStyle=Rn[s.toUpperCase()]),i?(r=i.attributes.imageType||i.attributes.imagetype,s=i.attributes.encoding,i=jt(i).trim(),"PNG"==r&&"Base64"==s&&i&&(e.backgroundImage="data:image/png;base64,"+i)):r&&(e.backgroundImage=r),(i=Fw(t,n,a,"textOutline",o))&&((i=i.split(" "))[0].match(Qw)?e.textStrokeColor=e.color:(e.textStrokeColor=_w(i[0]),i.shift()),i[0]&&i[0].match(Qw)?e.textStrokeWidth=i[0]:e.textStrokeColor=""),(i=Fw(t,n,a,"letterSpacing",o))&&i.match(Qw)&&(e.letterSpacing=i),(i=Fw(t,n,a,"linePadding",o))&&i.match(Qw)&&(e.linePadding=i),(i=Fw(t,n,a,"opacity",o))&&(e.opacity=parseFloat(i)),(i=Vw(n,a,"textDecoration"))&&Bw(e,i),(i=Hw(t,a,"textDecoration"))&&Bw(e,i),(i=Fw(t,n,a,"textCombine",o))&&(e.textCombineUpright=i),Fw(t,n,a,"ruby",o)){case"container":e.rubyTag="ruby";break;case"text":e.rubyTag="rt"}}(t,g,o,m,v,r,e,0==s.length),t}function Uw(e,t,n){var i=new xe,r=e.attributes["xml:id"];if(!r)return null;i.id=r,r=null,n&&(r=Jw.exec(n)||Zw.exec(n)),n=r?Number(r[1]):null,r=r?Number(r[2]):null;var a,o=Vw(e,t,"extent");if(o){var s=(a=Jw.exec(o))||Zw.exec(o);null!=s&&(i.width=Number(s[1]),i.height=Number(s[2]),a||(null!=n&&(i.width=100*i.width/n),null!=r&&(i.height=100*i.height/r)),i.widthUnits=a||null!=n?Ae:0,i.heightUnits=a||null!=r?Ae:0)}return(e=Vw(e,t,"origin"))&&null!=(s=(a=Jw.exec(e))||Zw.exec(e))&&(i.viewportAnchorX=Number(s[1]),i.viewportAnchorY=Number(s[2]),a?o||(i.width=100-i.viewportAnchorX,i.widthUnits=Ae,i.height=100-i.viewportAnchorY,i.heightUnits=Ae):(null!=r&&(i.viewportAnchorY=100*i.viewportAnchorY/r),null!=n&&(i.viewportAnchorX=100*i.viewportAnchorX/n)),i.viewportAnchorUnits=a||null!=n?Ae:0),i}function _w(e){var t=e.match(/rgba\(([^)]+)\)/);return t&&4==(t=t[1].split(",")).length?(t[3]=String(Number(t[3])/255),"rgba("+t.join(",")+")"):e}function Bw(e,t){for(var n=(t=l(t.split(" "))).next();!n.done;n=t.next())switch(n.value){case"underline":e.textDecoration.includes(Pn)||e.textDecoration.push(Pn);break;case"noUnderline":e.textDecoration.includes(Pn)&&Ie(e.textDecoration,Pn);break;case"lineThrough":e.textDecoration.includes("lineThrough")||e.textDecoration.push("lineThrough");break;case"noLineThrough":e.textDecoration.includes("lineThrough")&&Ie(e.textDecoration,"lineThrough");break;case"overline":e.textDecoration.includes("overline")||e.textDecoration.push("overline");break;case"noOverline":e.textDecoration.includes("overline")&&Ie(e.textDecoration,"overline")}}function Fw(e,t,n,i,r){return r=void 0===r||r,(e=Hw(e,n,i))?e:r?Vw(t,n,i):null}function Vw(e,t,n){return e?Gt(e,lT,n)||Gw(e,t,n):null}function Hw(e,t,n){return Gt(e,lT,n)||Gw(e,t,n)}function Gw(e,t,n){e=Kw(e,"style",t,"");for(var i=null,r=0;r<e.length;r++){var a=Vt(e[r],"urn:ebu:tt:style",n);a||(a=Gt(e[r],lT,n)),a||(a=Hw(e[r],t,n)),a&&(i=a)}return i}function Kw(e,t,n,i,r){var a=[];if(!e||1>n.length)return a;var o=e;for(e=null;!e&&!(e=r?Vt(o,r,t):o.attributes[t])&&(o=o.parent););if(t=e)for(r=(t=l(t.split(" "))).next();!r.done;r=t.next())for(r=r.value,o=(e=l(n)).next();!o.done;o=e.next())if(i+(o=o.value).attributes["xml:id"]==r){a.push(o);break}return a}function Xw(e,t,n,i){return e=qw(e,t),null==n?n=e.start:null!=e.start&&(n+=e.start),null==i?i=e.end:null!=e.start&&(i+=e.start),{start:n,end:i}}function qw(e,t){var n=zw(e.attributes.begin,t),i=zw(e.attributes.end,t);return e=zw(e.attributes.dur,t),null==i&&null!=e&&(i=n+e),{start:n,end:i}}function zw(e,t){var n=null;if(eT.test(e)){e=eT.exec(e),n=Number(e[1]);var i=Number(e[2]),r=Number(e[3]),a=Number(e[4]);n=(r+=(a+=(Number(e[5])||0)/t.h)/t.frameRate)+60*i+3600*n}else if(tT.test(e))n=Ww(tT,e);else if(nT.test(e))n=Ww(nT,e);else if(iT.test(e))e=iT.exec(e),n=Number(e[1])/t.frameRate;else if(rT.test(e))e=rT.exec(e),n=Number(e[1])/t.g;else if(aT.test(e))n=Ww(aT,e);else if(e)throw new De(2,2,2001,"Could not parse cue time range in TTML");return n}function Ww(e,t){return null==(e=e.exec(t))||""==e[0]?null:(Number(e[4])||0)/1e3+(Number(e[3])||0)+60*(Number(e[2])||0)+3600*(Number(e[1])||0)}function Yw(e,t,n,i){this.frameRate=Number(e)||30,this.h=Number(t)||1,this.g=Number(i),0==this.g&&(this.g=e?this.frameRate*this.h:1),n&&(e=/^(\d+) (\d+)$/g.exec(n))&&(this.frameRate*=Number(e[1])/Number(e[2]))}Fi["application/x-subtitle-lrc"]=function(){return new Pw},jw.prototype.parseInit=function(){},jw.prototype.setSequenceMode=function(){},jw.prototype.setManifestType=function(){},jw.prototype.parseMedia=function(e,t,n,i){var r=dt(e);if(e=[],""==r)return e;var a=Dt(r,"tt",!0);if(!a)throw new De(2,2,2005,"Failed to parse TTML.");if(!(r=Ut(a,"body")[0]))return[];var o=Gt(a,uT,"frameRate"),s=Gt(a,uT,"subFrameRate"),u=Gt(a,uT,"frameRateMultiplier"),c=Gt(a,uT,"tickRate"),d=Gt(a,uT,"cellResolution"),h=a.attributes["xml:space"]||"default",f=Gt(a,lT,"extent");if("default"!=h&&"preserve"!=h)throw new De(2,2,2005,"Invalid xml:space value: "+h);h="default"==h,o=new Yw(o,s,u,c),d=function(e){return e&&(e=/^(\d+) (\d+)$/.exec(e))?{lc:parseInt(e[1],10),rows:parseInt(e[2],10)}:null}(d),s=((s=Ut(a,"metadata")[0])?s.children:[]).filter((function(e){return"\n"!=e})),u=Ut(a,"style"),c=[];for(var p=l(a=Ut(a,"region")),g=p.next();!g.done;g=p.next())(g=Uw(g.value,u,f))&&c.push(g);if(Nt(r,"p").length)throw new De(2,2,2001,"<p> can only be inside <div> in TTML");for(p=(f=l(Nt(r,"div"))).next();!p.done;p=f.next())if(Nt(p.value,"span").length)throw new De(2,2,2001,"<span> can only be inside <p> in TTML");return(t=Ow(r,t,o,s,u,a,c,h,d,null,!1,n,i))&&(t.backgroundColor||(t.backgroundColor="transparent"),e.push(t)),e},F("shaka.text.TtmlTextParser",jw),jw.prototype.parseMedia=jw.prototype.parseMedia,jw.prototype.setManifestType=jw.prototype.setManifestType,jw.prototype.setSequenceMode=jw.prototype.setSequenceMode,jw.prototype.parseInit=jw.prototype.parseInit;var Jw=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,$w=/^(\d{1,4}(?:\.\d+)?|100)%$/,Qw=/^(\d+px|\d+em|\d*\.?\d+c)$/,Zw=/^(\d+)px (\d+)px$/,eT=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,tT=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,nT=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,iT=/^(\d*(?:\.\d*)?)f$/,rT=/^(\d*(?:\.\d*)?)t$/,aT=RegExp("^(?:(\\d*(?:\\.\\d*)?)h)?(?:(\\d*(?:\\.\\d*)?)m)?(?:(\\d*(?:\\.\\d*)?)s)?(?:(\\d*(?:\\.\\d*)?)ms)?$"),oT={left:xn,center:"center",right:"end",start:xn,end:"end"},sT={left:"line-left",center:"center",right:"line-right"},uT=["http://www.w3.org/ns/ttml#parameter","http://www.w3.org/2006/10/ttaf1#parameter"],lT=["http://www.w3.org/ns/ttml#styling","http://www.w3.org/2006/10/ttaf1#styling"],cT=["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt","http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];function dT(){this.g=new jw}function hT(){this.g="UNKNOWN"}function fT(e,t,n){var i;(i=/^align:(start|middle|center|end|left|right)$/.exec(t))?(t=i[1],e.textAlign="middle"==t?mn:vn[t.toUpperCase()]):(i=/^vertical:(lr|rl)$/.exec(t))?e.writingMode="lr"==i[1]?"vertical-lr":"vertical-rl":(i=/^size:([\d.]+)%$/.exec(t))?e.size=Number(i[1]):(i=/^position:([\d.]+)%(?:,(line-left|line-right|middle|center|start|end|auto))?$/.exec(t))?(e.position=Number(i[1]),i[2]&&(t=i[2],e.positionAlign="line-left"==t||"start"==t?"line-left":"line-right"==t||"end"==t?"line-right":"center"==t||"middle"==t?"center":gn)):(i=/^region:(.*)$/.exec(t))?(t=function(e,t){return e=e.filter((function(e){return e.id==t})),e.length?e[0]:null}(n,i[1]))&&(e.region=t):(n=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(t))?(e.lineInterpretation=1,e.line=Number(n[1]),n[2]&&(e.lineAlign=An[n[2].toUpperCase()])):(n=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(t))&&(e.lineInterpretation=Sn,e.line=Number(n[1]),n[2]&&(e.lineAlign=An[n[2].toUpperCase()]))}function pT(){this.g=null}function gT(e,t,n){var i,r,a;return(new Ta).box("payl",ka((function(e){i=dt(e)}))).box("iden",ka((function(e){r=dt(e)}))).box("sttg",ka((function(e){a=dt(e)}))).parse(e),i?function(e,t,n,i,r){if(dn(e=new un(i,r,e)),t&&(e.id=t),n)for(n=St(t=new bt(n));n;)fT(e,n,[]),wt(t),n=St(t);return e}(i,r,a,t,n):null}function mT(){}function vT(){this.g=new hT}function yT(e){var t="WEBVTT\n\n";if(""==e)return t;for(var n=(e=l((e=(e=e.replace(/\r+/g,"")).trim()).split("\n\n"))).next();!n.done;n=e.next())(n=n.value.split(/\n/))[0].match(/\d+/)&&n.shift(),n[0]=n[0].replace(/,/g,"."),t+=n.join("\n").replace(/{b}/g,"<b>").replace(/{\/b}/g,"</b>").replace(/{i}/g,"<i>").replace(/{\/i}/g,"</i>").replace(/{u}/g,"<u>").replace(/{\/u}/g,"</u>")+"\n\n";return t}function bT(){}function wT(e,t){var n=t.Fontname;if(n&&(e.fontFamily=n),(n=t.Fontsize)&&(e.fontSize=n+"px"),(n=t.PrimaryColour)&&(n=TT(n))&&(e.color=n),(n=t.BackColour)&&(n=TT(n))&&(e.backgroundColor=n),t.Bold&&(e.fontWeight=Mn),t.Italic&&(e.fontStyle=Dn),t.Underline&&e.textDecoration.push(Pn),(n=t.Spacing)&&(e.letterSpacing=n+"px"),n=t.Alignment)switch(parseInt(n,10)){case 1:e.displayAlign=yn,e.textAlign="start";break;case 2:e.displayAlign=yn,e.textAlign=mn;break;case 3:e.displayAlign=yn,e.textAlign="end";break;case 5:e.displayAlign="before",e.textAlign="start";break;case 6:e.displayAlign="before",e.textAlign=mn;break;case 7:e.displayAlign="before",e.textAlign="end";break;case 9:e.displayAlign="center",e.textAlign="start";break;case 10:e.displayAlign="center",e.textAlign=mn;break;case 11:e.displayAlign="center",e.textAlign="end"}(t=t.AlphaLevel)&&(e.opacity=parseFloat(t))}function TT(e){return 0<=(e=parseInt(e.replace("&H",""),16))?"rgba("+(255&e)+","+(e>>8&255)+","+(e>>16&255)+","+(e>>24&255^255)/255+")":null}function ST(e){return 3600*((e=kT.exec(e))[1]?parseInt(e[1].replace(":",""),10):0)+60*parseInt(e[2],10)+parseFloat(e[3])}Fi["application/ttml+xml"]=function(){return new jw},dT.prototype.parseInit=function(e){var t=!1;if((new Ta).box("moov",Sa).box("trak",Sa).box("mdia",Sa).box("minf",Sa).box("stbl",Sa).R("stsd",xa).box("stpp",(function(e){t=!0,e.parser.stop()})).parse(e),!t)throw new De(2,2,2007)},dT.prototype.setSequenceMode=function(){},dT.prototype.setManifestType=function(){},dT.prototype.parseMedia=function(e,t,n){var i=this,r=!1,a=[],o=[];if((new Ta).box("moof",Sa).box("traf",Sa).R("subs",(function(e){o=[];for(var t=e.reader,n=t.P(),i=0;i<n;i++){t.P();for(var r=t.ma(),a=0;a<r;a++)1==e.version?o.push(t.P()):o.push(t.ma()),t.T(),t.T(),t.P()}})).box("mdat",ka((function(e){if(r=!0,o.length){for(var s=ge(e,0,o[0]),u=[],l=o[0],c=1;c<o.length;c++){var d=ge(e,l,o[c]);d=oi(d),u.push("data:image/png;base64,"+d),l+=o[c]}a=a.concat(i.g.parseMedia(s,t,n,u))}else a=a.concat(i.g.parseMedia(e,t,n,[]))}))).parse(e,!1),!r)throw new De(2,2,2007);return a},F("shaka.text.Mp4TtmlParser",dT),dT.prototype.parseMedia=dT.prototype.parseMedia,dT.prototype.setManifestType=dT.prototype.setManifestType,dT.prototype.setSequenceMode=dT.prototype.setSequenceMode,dT.prototype.parseInit=dT.prototype.parseInit,Fi['application/mp4; codecs="stpp"']=function(){return new dT},Fi['application/mp4; codecs="stpp.ttml"']=function(){return new dT},Fi['application/mp4; codecs="stpp.ttml.im1i"']=function(){return new dT},Fi['application/mp4; codecs="stpp.ttml.im1t"']=function(){return new dT},Fi['application/mp4; codecs="stpp.ttml.im2i"']=function(){return new dT},Fi['application/mp4; codecs="stpp.ttml.im2t"']=function(){return new dT},Fi['application/mp4; codecs="stpp.ttml.etd1"']=function(){return new dT},Fi['application/mp4; codecs="stpp.ttml.etd1|im1t"']=function(){return new dT},Fi['application/mp4; codecs="stpp.ttml.im1t|etd1"']=function(){return new dT},Fi['application/mp4; codecs="stpp.TTML.im1t"']=function(){return new dT},hT.prototype.parseInit=function(){},hT.prototype.setSequenceMode=function(){},hT.prototype.setManifestType=function(e){this.g=e},hT.prototype.parseMedia=function(e,t){var n=(e=(e=dt(e)).replace(/\r\n|\r(?=[^\n]|$)/gm,"\n")).split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(n[0]))throw new De(2,2,2e3);if(e=t.vttOffset,"HLS"==this.g)if(n[0].includes("X-TIMESTAMP-MAP")){var i=n[0];if(e=i.match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),i=i.match(/MPEGTS:(\d+)/m),!e||!i)throw new De(2,2,2e3);if(null==(e=At(e[1])))throw new De(2,2,2e3);i=Number(i[1]);for(var r=t.segmentStart-t.periodStart;95443.7176888889<=r;)r-=95443.7176888889,i+=8589934592;e=t.periodStart+i/9e4-e}else t.periodStart&&t.vttOffset==t.periodStart&&(e=0);for(t=[],r=(i=l(n[0].split("\n"))).next();!r.done;r=i.next())if(r=r.value,/^Region:/.test(r)){r=new bt(r);var a=new xe;St(r),wt(r);for(var o=St(r);o;){var s=a,u=o;(o=/^id=(.*)$/.exec(u))?s.id=o[1]:(o=/^width=(\d{1,2}|100)%$/.exec(u))?s.width=Number(o[1]):(o=/^lines=(\d+)$/.exec(u))?(s.height=Number(o[1]),s.heightUnits=2):(o=/^regionanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(u))?(s.regionAnchorX=Number(o[1]),s.regionAnchorY=Number(o[2])):(o=/^viewportanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(u))?(s.viewportAnchorX=Number(o[1]),s.viewportAnchorY=Number(o[2])):/^scroll=up$/.exec(u)&&(s.scroll="up"),wt(r),o=St(r)}t.push(a)}for(hn(i=new Map),r=[],a=(n=l(n.slice(1))).next();!a.done;a=n.next()){if((1!=(a=a.value.split("\n")).length||a[0])&&!/^NOTE($|[ \t])/.test(a[0])&&"STYLE"==a[0]){for(s=[],o=-1,u=1;u<a.length;u++)a[u].includes("::cue")&&(s.push([]),o=s.length-1),-1!=o&&(s[o].push(a[u]),a[u].includes("}")&&(o=-1));for(o=(s=l(s)).next();!o.done;o=s.next()){var c=o.value;o="global",(u=c[0].match(/\((.*)\)/))&&(o=u.pop()),u=c.slice(1,-1),c[0].includes("}")&&(c=/\{(.*?)\}/.exec(c[0]))&&(u=c[1].split(";")),(c=i.get(o))||(c=new un(0,0,""));for(var d=!1,h=0;h<u.length;h++){var f=/^\s*([^:]+):\s*(.*)/.exec(u[h]);if(f){var p=f[2].trim().replace(";","");switch(f[1].trim()){case"background-color":case"background":d=!0,c.backgroundColor=p;break;case"color":d=!0,c.color=p;break;case"font-family":d=!0,c.fontFamily=p;break;case"font-size":d=!0,c.fontSize=p;break;case"font-weight":(700<=parseInt(p,10)||"bold"==p)&&(d=!0,c.fontWeight=Mn);break;case"font-style":switch(p){case"normal":d=!0,c.fontStyle=Cn;break;case"italic":d=!0,c.fontStyle=Dn;break;case"oblique":d=!0,c.fontStyle="oblique"}break;case"opacity":d=!0,c.opacity=parseFloat(p);break;case"text-combine-upright":d=!0,c.textCombineUpright=p;break;case"text-shadow":d=!0,c.textShadow=p;break;case"white-space":d=!0,c.wrapLine="noWrap"!=p}}}d&&i.set(o,c)}}if(d=e,1==(c=a).length&&!c[0]||/^NOTE($|[ \t])/.test(c[0])||"STYLE"==c[0]||"REGION"==c[0])a=null;else if(a=null,c[0].includes("--\x3e")||(a=c[0],c.splice(0,1)),o=xt(s=new bt(c[0])),h=Tt(s,/[ \t]+--\x3e[ \t]+/g),u=xt(s),null==o||null==h||null==u)W("Failed to parse VTT time code. Cue skipped:",a,c),a=null;else{for(o+=d,u+=d,d=c.slice(1).join("\n").trim(),i.has("global")?((c=i.get("global").clone()).startTime=o,c.endTime=u,c.payload=d):c=new un(o,u,d),wt(s),o=St(s);o;)fT(c,o,t),wt(s),o=St(s);dn(c,i),null!=a&&(c.id=a),a=c}a&&r.push(a)}return r},F("shaka.text.VttTextParser",hT),hT.prototype.parseMedia=hT.prototype.parseMedia,hT.prototype.setManifestType=hT.prototype.setManifestType,hT.prototype.setSequenceMode=hT.prototype.setSequenceMode,hT.prototype.parseInit=hT.prototype.parseInit,Fi["text/vtt"]=function(){return new hT},Fi['text/vtt; codecs="vtt"']=function(){return new hT},Fi['text/vtt; codecs="wvtt"']=function(){return new hT},pT.prototype.parseInit=function(e){var t=this,n=!1;if((new Ta).box("moov",Sa).box("trak",Sa).box("mdia",Sa).R("mdhd",(function(e){e=_o(e.reader,e.version),t.g=e.timescale})).box("minf",Sa).box("stbl",Sa).R("stsd",xa).box("wvtt",(function(){n=!0})).parse(e),!this.g)throw new De(2,2,2008);if(!n)throw new De(2,2,2008)},pT.prototype.setSequenceMode=function(){},pT.prototype.setManifestType=function(){},pT.prototype.parseMedia=function(e,t){if(!e.length)return[];if(!this.g)throw new De(2,2,2008);var n,i=0,r=[],a=[],o=!1,s=!1,u=!1,c=null;if((new Ta).box("moof",Sa).box("traf",Sa).R("tfdt",(function(e){o=!0,i=Uo(e.reader,e.version).baseMediaDecodeTime})).R("tfhd",(function(e){c=Oo(e.reader,e.flags).ed})).R("trun",(function(e){s=!0,r=Bo(e.reader,e.version,e.flags).Zg})).box("mdat",ka((function(e){u=!0,n=e}))).parse(e,!1),!u&&!o&&!s)throw new De(2,2,2008);e=i;for(var d=new ya(n,0),h=l(r),f=h.next();!f.done;f=h.next()){var p=(f=f.value).Of||c,g=f.me?i+f.me:e;e=g+(p||0);var m=0;do{var v=d.P();m+=v;var y=null;"vttc"==Ma(d.P())?8<v&&(y=d.vb(v-8)):d.skip(v-8),p&&y&&(v=gT(y,t.periodStart+g/this.g,t.periodStart+e/this.g),a.push(v))}while(f.sampleSize&&m<f.sampleSize)}return a.filter(Gi)},F("shaka.text.Mp4VttParser",pT),pT.prototype.parseMedia=pT.prototype.parseMedia,pT.prototype.setManifestType=pT.prototype.setManifestType,pT.prototype.setSequenceMode=pT.prototype.setSequenceMode,pT.prototype.parseInit=pT.prototype.parseInit,Fi['application/mp4; codecs="wvtt"']=function(){return new pT},mT.prototype.parseInit=function(){},mT.prototype.setSequenceMode=function(){},mT.prototype.setManifestType=function(){},mT.prototype.parseMedia=function(e){var t=dt(e).replace(/\r+/g,"");if(e=[],""==(t=t.trim()))return e;for(var n=(t=l(t.split("\n\n"))).next();!n.done;n=t.next()){var i=new bt((n=n.value.split("\n"))[0]),r=xt(i),a=Tt(i,/,/g);if(i=xt(i),null==r||null==a||null==i)throw new De(2,2,2001,"Could not parse cue time range in SubViewer");e.push(new un(r,i,n.slice(1).join("\n").trim()))}return e},F("shaka.text.SbvTextParser",mT),mT.prototype.parseMedia=mT.prototype.parseMedia,mT.prototype.setManifestType=mT.prototype.setManifestType,mT.prototype.setSequenceMode=mT.prototype.setSequenceMode,mT.prototype.parseInit=mT.prototype.parseInit,Fi["text/x-subviewer"]=function(){return new mT},vT.prototype.parseInit=function(){},vT.prototype.setSequenceMode=function(){},vT.prototype.setManifestType=function(){},vT.prototype.parseMedia=function(e,t,n){return e=ge(pt(e=yT(e=dt(e)))),this.g.parseMedia(e,t,n,[])},F("shaka.text.SrtTextParser",vT),vT.srt2webvtt=yT,vT.prototype.parseMedia=vT.prototype.parseMedia,vT.prototype.setManifestType=vT.prototype.setManifestType,vT.prototype.setSequenceMode=vT.prototype.setSequenceMode,vT.prototype.parseInit=vT.prototype.parseInit,Fi["text/srt"]=function(){return new vT},bT.prototype.parseInit=function(){},bT.prototype.setSequenceMode=function(){},bT.prototype.setManifestType=function(){},bT.prototype.parseMedia=function(e){var t="",n="",i=null,r=null;for(r=(e=l(r=dt(e).split(/\r?\n\s*\r?\n/))).next();!r.done;r=e.next()){var a=r.value;r=a,(a=xT.exec(a))&&(i=a[1],r=a[2]),"V4 Styles"==i||"V4+ Styles"==i?(t=r,t=n?t+"\n"+r:r):"Events"==i&&(n=n?n+"\n"+r:r)}for(i=[],r=null,e=(t=l(t.split(/\r?\n/))).next();!e.done;e=t.next())if(e=e.value,!/^\s*;/.test(e)&&(a=AT.exec(e)))if(e=a[1].trim(),a=a[2].trim(),"Format"==e)r=a.split(ET);else if("Style"==e){e=a.split(ET),a={};for(var o=0;o<r.length&&o<e.length;o++)a[r[o]]=e[o];i.push(a)}for(r=[],t=null,a=(n=l(n.split(/\r?\n/))).next(),e={};!a.done;e={lh:void 0},a=n.next())if(a=a.value,!/^\s*;/.test(a)&&(o=AT.exec(a)))if(a=o[1].trim(),o=o[2].trim(),"Format"==a)t=o.split(ET);else if("Dialogue"==a){o=o.split(ET),a={};for(var s=0;s<t.length&&s<o.length;s++)a[t[s]]=o[s];o=new un(s=ST(a.Start),ST(a.End),o.slice(t.length-1).join(",").replace(/\\N/g,"\n").replace(/\{[^}]+\}/g,"")),e.lh=a.Style,(e=i.find(function(e){return function(t){return t.Name==e.lh}}(e)))&&wT(o,e),r.push(o)}return r},F("shaka.text.SsaTextParser",bT),bT.prototype.parseMedia=bT.prototype.parseMedia,bT.prototype.setManifestType=bT.prototype.setManifestType,bT.prototype.setSequenceMode=bT.prototype.setSequenceMode,bT.prototype.parseInit=bT.prototype.parseInit;var xT=/^\s*\[([^\]]+)\]\r?\n([\s\S]*)/,AT=/^\s*([^:]+):\s*(.*)/,ET=/\s*,\s*/,kT=/^(\d+:)?(\d{1,2}):(\d{1,2}(?:[.]\d{1,3})?)?$/;function IT(e,t){var n=1&e[t+1]?7:9;return t+n<=e.length&&0<(e=((3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5)-n)?{Sd:n,ea:e}:null}function MT(e,t){var n=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],i=(60&e[t+2])>>>2;if(i>n.length-1)return null;var r=1+((192&e[t+2])>>>6),a=(1&e[t+2])<<2;return a|=(192&e[t+3])>>>6,{sampleRate:n[i],channelCount:a,codec:"mp4a.40."+r}}function CT(e,t){if(t+1<e.length&&255===e[t]&&240==(246&e[t+1])){var n=1&e[t+1]?7:9;if(t+n>=e.length)return!1;var i=(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5;return!(i<=n)&&((t+=i)===e.length||t+1<e.length&&255===e[t]&&240==(246&e[t+1]))}return!1}function DT(e){this.i=e,this.h=0,this.g=new Map}function RT(e,t){if(t+8>e.length||11!==e[t]||119!==e[t+1])return null;var n=e[t+4]>>6;if(3<=n)return null;var i=63&e[t+4],r=2*[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][3*i+n];if(t+r>e.length)return null;var a=e[t+6]>>5,o=0;2===a?o+=2:(1&a&&1!==a&&(o+=2),4&a&&(o+=2)),o=(e[t+6]<<8|e[t+7])>>12-o&1;var s=7&e[t+5];return e=new Uint8Array([n<<6|e[t+5]>>3<<1|s>>2,(3&s)<<6|a<<3|o<<2|i>>4,i<<4&224]),{sampleRate:[48e3,44100,32e3][n],channelCount:[2,1,2,3,3,4,4,5][a]+o,qa:e,ea:r}}function PT(e,t){if(11===e[t]&&119===e[t+1]){var n,i,r=0,a=5;for(t+=a;0<a;){i=e[t];var o=Math.min(a,8),s=8-o;n=(i&(n=4278190080>>>24+s<<s))>>s,r=r?r<<o|n:n,t+=1,a-=o}if(16>r)return!0}return!1}function LT(e){this.i=e,this.h=0,this.g=new Map}function NT(e,t){if(t+8>e.length||2935!=(e[t]<<8|e[t+1]))return null;var n=new Ko(e.subarray(t+2));qo(n,2),qo(n,3);var i=zo(n,11)+1<<1,r=zo(n,2);if(3==r){r=[24e3,22060,16e3][r=zo(n,2)];var a=3}else r=[48e3,44100,32e3][r],a=zo(n,2);var o=zo(n,3),s=zo(n,1);return n=zo(n,5),t+i>e.byteLength?null:(e=Math.floor(i*r/(16*[1,2,3,6][a])),e=new Uint8Array([(8160&e)>>5,(31&e)<<3,r<<6|n<<1,o<<1|s,0]),{sampleRate:r,channelCount:[2,1,2,3,3,4,4,5][o]+s,qa:e,ea:i})}function jT(e){this.i=e,this.h=0,this.g=new Map}function OT(e){for(var t=!1,n=[],i=e.find((function(e){return 7==e.type})),r=!1,a=(e=l(e)).next();!a.done;a=e.next()){var o=!1;switch((a=a.value).type){case 1:o=r=!0;var s=a.data;i&&4<s.length&&(2===(s=ts(new Ko(s)))||4===s||7===s||9===s)&&(t=!0);break;case 5:t=o=r=!0;break;case 6:case 7:case 8:case 12:o=!0;break;case 9:r=o=!0;break;default:o=!1}r&&o&&(o=a.fullData.byteLength,(s=new Uint8Array(4))[0]=o>>24&255,s[1]=o>>16&255,s[2]=o>>8&255,s[3]=255&o,n.push(s),n.push(a.fullData))}return n.length?{data:di.apply(ai,c(n)),nd:t}:null}Fi["text/x-ssa"]=function(){return new bT},(i=DT.prototype).destroy=function(){this.g.clear()},i.isSupported=function(e){return"audio/aac"==e.toLowerCase().split(";")[0]&&ne(this.convertCodecs("audio",e))},i.convertCodecs=function(e,t){return"audio/aac"==t.toLowerCase().split(";")[0]?'audio/mp4; codecs="'+(Ri(t)||"mp4a.40.2")+'"':t},i.getOriginalMimeType=function(){return this.i},i.transmux=function(e,t,n,i){for(var r=ge(e),a=jo(r),o=a.length;o<r.length&&!CT(r,o);o++);if(e=1e3*n.endTime,(a=No(a)).length&&n&&(a=a.find((function(e){return"com.apple.streaming.transportStreamTimestamp"===e.description})))&&(e=a.data),!(a=MT(r,o)))return Promise.reject(new De(2,3,3018,n?n.N()[0]:null));t.audioSamplingRate=a.sampleRate,t.channelsCount=a.channelCount;for(var s=[];o<r.length;){var u=IT(r,o);if(!u)return Promise.reject(new De(2,3,3018,n?n.N()[0]:null));var l=u.Sd+u.ea;o+l<=r.length&&s.push({data:r.subarray(o+u.Sd,o+l),size:u.ea,duration:1024,hb:0,flags:{kb:0,$a:0,Za:0,Xa:0,Ya:2,lb:0}}),o+=l}return r=a.sampleRate,e=Math.floor(e*r/1e3),i=new Zm([i={id:t.id,type:"audio",codecs:a.codec,encrypted:t.encrypted&&0<t.drmInfos.length,timescale:r,duration:i,fb:[],qa:new Uint8Array([]),za:new Uint8Array([]),Da:0,Fa:0,data:{wb:this.h,baseMediaDecodeTime:e,ab:s},stream:t}]),n=t.id+"_"+n.i,this.g.has(n)?t=this.g.get(n):(t=ev(i),this.g.set(n,t)),n=av(i),this.h++,t=di(t,n),Promise.resolve(t)},F("shaka.transmuxer.AacTransmuxer",DT),DT.prototype.transmux=DT.prototype.transmux,DT.prototype.getOriginalMimeType=DT.prototype.getOriginalMimeType,DT.prototype.convertCodecs=DT.prototype.convertCodecs,DT.prototype.isSupported=DT.prototype.isSupported,DT.prototype.destroy=DT.prototype.destroy,jn("audio/aac",(function(){return new DT("audio/aac")}),_n),(i=LT.prototype).destroy=function(){this.g.clear()},i.isSupported=function(e){return"audio/ac3"==e.toLowerCase().split(";")[0]&&ne(this.convertCodecs("audio",e))},i.convertCodecs=function(e,t){return"audio/ac3"==t.toLowerCase().split(";")[0]?'audio/mp4; codecs="ac-3"':t},i.getOriginalMimeType=function(){return this.i},i.transmux=function(e,t,n,i){for(var r=jo(e=ge(e)),a=r.length;a<e.length&&!PT(e,a);a++);var o=1e3*n.endTime;(r=No(r)).length&&n&&(r=r.find((function(e){return"com.apple.streaming.transportStreamTimestamp"===e.description})))&&(o=r.data),r=0;for(var s=new Uint8Array([]),u=[];a<e.length;){var l=RT(e,a);if(!l)return Promise.reject(new De(2,3,3018,n?n.N()[0]:null));t.audioSamplingRate=l.sampleRate,t.channelsCount=l.channelCount,r=l.sampleRate,s=l.qa,u.push({data:e.subarray(a,a+l.ea),size:l.ea,duration:1536,hb:0,flags:{kb:0,$a:0,Za:0,Xa:0,Ya:2,lb:0}}),a+=l.ea}return e=Math.floor(o*r/1e3),i=new Zm([i={id:t.id,type:"audio",codecs:"ac-3",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:r,duration:i,fb:[],qa:s,za:new Uint8Array([]),Da:0,Fa:0,data:{wb:this.h,baseMediaDecodeTime:e,ab:u},stream:t}]),n=t.id+"_"+n.i,this.g.has(n)?t=this.g.get(n):(t=ev(i),this.g.set(n,t)),n=av(i),this.h++,t=di(t,n),Promise.resolve(t)},F("shaka.transmuxer.Ac3Transmuxer",LT),LT.prototype.transmux=LT.prototype.transmux,LT.prototype.getOriginalMimeType=LT.prototype.getOriginalMimeType,LT.prototype.convertCodecs=LT.prototype.convertCodecs,LT.prototype.isSupported=LT.prototype.isSupported,LT.prototype.destroy=LT.prototype.destroy,jn("audio/ac3",(function(){return new LT("audio/ac3")}),_n),(i=jT.prototype).destroy=function(){this.g.clear()},i.isSupported=function(e){return"audio/ec3"==e.toLowerCase().split(";")[0]&&ne(this.convertCodecs("audio",e))},i.convertCodecs=function(e,t){return"audio/ec3"==t.toLowerCase().split(";")[0]?'audio/mp4; codecs="ec-3"':t},i.getOriginalMimeType=function(){return this.i},i.transmux=function(e,t,n,i){for(var r=jo(e=ge(e)),a=r.length;a<e.length&&2935!=(e[a]<<8|e[a+1]);a++);var o=1e3*n.endTime;(r=No(r)).length&&n&&(r=r.find((function(e){return"com.apple.streaming.transportStreamTimestamp"===e.description})))&&(o=r.data),r=0;for(var s=new Uint8Array([]),u=[];a<e.length;){var l=NT(e,a);if(!l)return Promise.reject(new De(2,3,3018,n?n.N()[0]:null));t.audioSamplingRate=l.sampleRate,t.channelsCount=l.channelCount,r=l.sampleRate,s=l.qa,u.push({data:e.subarray(a,a+l.ea),size:l.ea,duration:1536,hb:0,flags:{kb:0,$a:0,Za:0,Xa:0,Ya:2,lb:0}}),a+=l.ea}return e=Math.floor(o*r/1e3),i=new Zm([i={id:t.id,type:"audio",codecs:"ec-3",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:r,duration:i,fb:[],qa:s,za:new Uint8Array([]),Da:0,Fa:0,data:{wb:this.h,baseMediaDecodeTime:e,ab:u},stream:t}]),n=t.id+"_"+n.i,this.g.has(n)?t=this.g.get(n):(t=ev(i),this.g.set(n,t)),n=av(i),this.h++,t=di(t,n),Promise.resolve(t)},F("shaka.transmuxer.Ec3Transmuxer",jT),jT.prototype.transmux=jT.prototype.transmux,jT.prototype.getOriginalMimeType=jT.prototype.getOriginalMimeType,jT.prototype.convertCodecs=jT.prototype.convertCodecs,jT.prototype.isSupported=jT.prototype.isSupported,jT.prototype.destroy=jT.prototype.destroy,jn("audio/ec3",(function(){return new jT("audio/ec3")}),_n);var UT=[100,110,122,244,44,83,86,118,128,138,139,134];function _T(e,t){var n=e[t+1]>>3&3,i=e[t+1]>>1&3,r=e[t+2]>>4&15,a=e[t+2]>>2&3;if(1!==n&&0!==r&&15!==r&&3!==a){var o=e[t+3]>>6;r=1e3*VT[14*(3===n?3-i:3===i?3:4)+r-1],a=HT[3*(3===n?0:2===n?1:2)+a],n=GT[n][i];var s=KT[i],u=Math.floor(n*r/a+(e[t+2]>>1&1))*s,l=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);return(l=l?parseInt(l[1],10):0)&&87>=l&&2===i&&224e3<=r&&0===o&&(e[t+3]|=128),{sampleRate:a,channelCount:3===o?1:2,ea:u,Ti:8*n*s}}return null}function BT(e,t){return!(255!==e[t]||224&~e[t+1]||!(6&e[t+1]))}function FT(e,t){if(t+1<e.length&&BT(e,t)){var n=_T(e,t),i=4;return n&&n.ea&&(i=n.ea),(t+=i)===e.length||t+1<e.length&&BT(e,t)}return!1}var VT=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],HT=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],GT=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],KT=[0,1,1,4];function XT(e){this.i=e,this.h=0,this.g=new Map}function qT(e){this.h=e,this.g=null}function zT(e){this.h=e,(this.g=Cg.get("ISOBoxer")())&&function(e){function t(){this._procFullBox(),1&this.flags&&(this._procField("AlgorithmID","uint",24),this._procField("IV_size","uint",8),this._procFieldArray("KID",16,"uint",8)),this._procField("sample_count","uint",32),this._procEntries("entry",this.sample_count,(function(e){this._procEntryField(e,"InitializationVector","data",8),2&this.flags&&(this._procEntryField(e,"NumberOfEntries","uint",16),this._procSubEntries(e,"clearAndCryptedData",e.NumberOfEntries,(function(e){this._procEntryField(e,"BytesOfClearData","uint",16),this._procEntryField(e,"BytesOfEncryptedData","uint",32)})))}))}e.g.addBoxProcessor("saio",(function(){this._procFullBox(),1&this.flags&&(this._procField("aux_info_type","uint",32),this._procField("aux_info_type_parameter","uint",32)),this._procField("entry_count","uint",32),this._procFieldArray("offset",this.entry_count,"uint",1===this.version?64:32)})),e.g.addBoxProcessor("saiz",(function(){this._procFullBox(),1&this.flags&&(this._procField("aux_info_type","uint",32),this._procField("aux_info_type_parameter","uint",32)),this._procField("default_sample_info_size","uint",8),this._procField("sample_count","uint",32),0===this.default_sample_info_size&&this._procFieldArray("sample_info_size",this.sample_count,"uint",8)})),e.g.addBoxProcessor("senc",t),e.g.addBoxProcessor("uuid",(function(){for(var e=!0,n=0;16>n;n++)this.usertype[n]!==YT[n]&&(e=!1);e&&(this._parsing&&(this.type="sepiff"),t.call(this))}))}(this)}function WT(e,t){for(var n=8,i=0;i<e.boxes.length&&e.boxes[i].type!==t;i++)n+=e.boxes[i].size;return n}(i=XT.prototype).destroy=function(){this.g.clear()},i.isSupported=function(e){return"audio/mpeg"==e.toLowerCase().split(";")[0]&&ne(this.convertCodecs("audio",e))},i.convertCodecs=function(e,t){return"audio/mpeg"==t.toLowerCase().split(";")[0]?'audio/mp4; codecs="mp3"':t},i.getOriginalMimeType=function(){return this.i},i.transmux=function(e,t,n,i){for(var r=ge(e),a=jo(r).length;a<r.length&&!FT(r,a);a++);var o;for(e=[];a<r.length;){var s=_T(r,a);if(!s)return Promise.reject(new De(2,3,3018,n?n.N()[0]:null));o||(o=s),a+s.ea<=r.length&&e.push({data:r.subarray(a,a+s.ea),size:s.ea,duration:1152,hb:0,flags:{kb:0,$a:0,Za:0,Xa:0,Ya:2,lb:0}}),a+=s.ea}return o?(r=9e4*o.Ti/o.sampleRate*this.h,i=new Zm([i={id:t.id,type:"audio",codecs:"mp3",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:o.sampleRate,duration:i,fb:[],qa:new Uint8Array([]),za:new Uint8Array([]),Da:0,Fa:0,data:{wb:this.h,baseMediaDecodeTime:r,ab:e},stream:t}]),n=t.id+"_"+n.i,this.g.has(n)?t=this.g.get(n):(t=ev(i),this.g.set(n,t)),n=av(i),this.h++,t=di(t,n),Promise.resolve(t)):Promise.reject(new De(2,3,3018,n?n.N()[0]:null))},F("shaka.transmuxer.Mp3Transmuxer",XT),XT.prototype.transmux=XT.prototype.transmux,XT.prototype.getOriginalMimeType=XT.prototype.getOriginalMimeType,XT.prototype.convertCodecs=XT.prototype.convertCodecs,XT.prototype.isSupported=XT.prototype.isSupported,XT.prototype.destroy=XT.prototype.destroy,jn("audio/mpeg",(function(){return new XT("audio/mpeg")}),_n),(i=qT.prototype).destroy=function(){},i.isSupported=function(e){if("video/mp2t"!=e.toLowerCase().split(";")[0])return!1;var t=Ri(e).split(","),n=mi("audio",t);return t=mi("video",t),!(!n||t||"mp3"!=Mi(n))&&ne(this.convertCodecs("audio",e))},i.convertCodecs=function(e,t){return"video/mp2t"==t.toLowerCase().split(";")[0]?"audio/mpeg":t},i.getOriginalMimeType=function(){return this.h},i.transmux=function(e,t,n,i,r){if(this.g?this.g.clearData():this.g=new ns,e=ge(e),"mp3"!=(e=this.g.parse(e)).fd().audio||"audio"!=r)return Promise.reject(new De(2,3,3018,n?n.N()[0]:null));for(n=new Uint8Array([]),r=l(e.Wb()),e=r.next();!e.done;e=r.next())if(e=e.value.data)for(t=0;t<e.length;)(i=_T(e,t))?(t+i.ea<=e.length&&(n=di(n,e.subarray(t,t+i.ea))),t+=i.ea):t++;return Promise.resolve(n)},F("shaka.transmuxer.MpegTsTransmuxer",qT),qT.prototype.transmux=qT.prototype.transmux,qT.prototype.getOriginalMimeType=qT.prototype.getOriginalMimeType,qT.prototype.convertCodecs=qT.prototype.convertCodecs,qT.prototype.isSupported=qT.prototype.isSupported,qT.prototype.destroy=qT.prototype.destroy,jn("video/mp2t",(function(){return new qT("video/mp2t")}),Bn),(i=zT.prototype).destroy=function(){},i.isSupported=function(e,t){var n=e.startsWith("mss/");return!(!this.g||!n)&&(t?ne(this.convertCodecs(t,e)):(t=this.convertCodecs("audio",e),e=this.convertCodecs("video",e),ne(t)||ne(e)))},i.convertCodecs=function(e,t){return t.replace("mss/","")},i.getOriginalMimeType=function(){return this.h},i.transmux=function(e,t,n){if(!n)return Promise.resolve(ge(e));if(!t.mssPrivateData)return Promise.reject(new De(2,3,3020,n?n.N()[0]:null));try{var i,r=this.g.parseBuffer(e),a=r.fetch("tfhd");a.track_ID=t.id+1;var o=r.fetch("tfdt"),s=r.fetch("traf");null===o&&((o=this.g.createFullBox("tfdt",s,a)).version=1,o.flags=0,o.baseMediaDecodeTime=Math.floor(n.startTime*t.mssPrivateData.timescale));var u=r.fetch("trun"),l=r.fetch("tfxd");l&&l._parent.boxes.splice(l._parent.boxes.indexOf(l),1);var c=r.fetch("tfrf");c&&c._parent.boxes.splice(c._parent.boxes.indexOf(c),1);var d=r.fetch("sepiff");if(null!==d){d.type="senc",d.usertype=void 0;var h=r.fetch("saio");if(null===h){(h=this.g.createFullBox("saio",s)).version=0,h.flags=0,h.entry_count=1,h.offset=[0];var f=this.g.createFullBox("saiz",s);if(f.version=0,f.flags=0,f.sample_count=d.sample_count,f.default_sample_info_size=0,f.sample_info_size=[],2&d.flags)for(i=0;i<d.sample_count;i+=1)f.sample_info_size[i]=10+6*d.entry[i].NumberOfEntries;else f.default_sample_info_size=8}}a.flags&=16777214,a.flags|=131072,u.flags|=1;var p=r.fetch("moof");u.data_offset=p.getLength()+8;var g=r.fetch("saio");null!==g&&(g.offset[0]=WT(p,"traf")+WT(s,"senc")+16);var m=ge(r.write());return Promise.resolve(m)}catch(e){return e instanceof De?Promise.reject(e):Promise.reject(new De(2,3,3022,n?n.N()[0]:null))}},F("shaka.transmuxer.MssTransmuxer",zT),zT.prototype.transmux=zT.prototype.transmux,zT.prototype.getOriginalMimeType=zT.prototype.getOriginalMimeType,zT.prototype.convertCodecs=zT.prototype.convertCodecs,zT.prototype.isSupported=zT.prototype.isSupported,zT.prototype.destroy=zT.prototype.destroy;var YT=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);function JT(e){this.l=e,this.g=0,this.i=new Map,this.h=this.j=null}jn("mss/audio/mp4",(function(){return new zT("mss/audio/mp4")}),_n),jn("mss/video/mp4",(function(){return new zT("mss/video/mp4")}),_n),(i=JT.prototype).destroy=function(){this.i.clear(),this.h&&this.h.destroy()},i.isSupported=function(e,t){if("video/mp2t"!=e.toLowerCase().split(";")[0])return!1;var n=e;t&&(n=this.convertCodecs(t,e));var i=Ri(n).split(",");return n=mi("audio",i),i=mi("video",i),!(n&&(n=Mi(n),!ZT.includes(n))||i&&(n=Mi(i),!eS.includes(n)))&&(t?ne(this.convertCodecs(t,e)):(t=this.convertCodecs("audio",e),e=this.convertCodecs("video",e),ne(t)||ne(e)))},i.convertCodecs=function(e,t){return"video/mp2t"==t.toLowerCase().split(";")[0]?(t=Ri(t).replace("mp4a.40.34","mp3").split(",").map((function(e){return lr(e,"audio/mp4")})).map(cr).join(","),"audio"==e?'audio/mp4; codecs="'+t+'"':'video/mp4; codecs="'+t+'"'):t},i.getOriginalMimeType=function(){return this.l},i.transmux=function(e,t,n,i,r){var a=ge(e);if("audio"==r&&!os(a)){for(var o=jo(a),s=o.length;s<a.length;s++)if(FT(a,s))return Promise.reject(new De(2,3,3018,n?n.N()[0]:null));for(s=o.length;s<a.length;s++)if(CT(a,s))return this.h||(this.h=new DT("audio/aac")),this.h.transmux(e,t,n,i,r);return Promise.reject(new De(2,3,3018,n?n.N()[0]:null))}this.j?this.j.clearData():this.j=new ns;var u=this.j.parse(a),d=[],h=u.fd();try{var f=null;if("video"==r){switch(h.video){case"avc":var p=[],g=null,m=[],v=u.sc();if(!v.length)throw new De(2,3,3023,n?n.N()[0]:null);for(var y=0;y<v.length;y++){var b=v[y],w=b.nalus;m.push.apply(m,c(w));var T,S=OT(w);if(S)null==g&&(g=b.dts),T=y+1<v.length?(v[y+1].dts||0)-(b.dts||0):1<v.length?(b.dts||0)-(v[y-1].dts||0):9e4*(n.endTime-n.startTime),p.push({data:S.data,size:S.data.byteLength,duration:T,hb:Math.round((b.pts||0)-(b.dts||0)),flags:{kb:0,$a:0,Za:0,Xa:0,Ya:S.nd?2:1,lb:S.nd?0:1}})}var x=function(e){if(!e.length)return null;var t=e.find((function(e){return 7==e.type}));if(e=e.find((function(e){return 8==e.type})),!t||!e)return null;var n=new Ko(t.data),i=Zo(n);if(Zo(n),Zo(n),Yo(n),UT.includes(i)&&(3===(i=Jo(n))&&qo(n,1),Yo(n),Yo(n),qo(n,1),Qo(n))){i=3!==i?8:12;for(var r=0;r<i;r++)Qo(n)&&es(n,6>r?16:64)}if(Yo(n),0===(i=Jo(n)))Jo(n);else if(1===i)for(qo(n,1),Yo(n),Yo(n),i=Jo(n),r=0;r<i;r++)Yo(n);Yo(n),qo(n,1);var a=Jo(n),o=Jo(n),s=zo(n,1);0===s&&qo(n,1),qo(n,1);var u=0,l=0,d=0,h=0;if(Qo(n)&&(u=Jo(n),l=Jo(n),d=Jo(n),h=Jo(n)),r=i=1,Qo(n)&&Qo(n)){var f=Zo(n);0<f&&16>=f?(i=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][f-1],r=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][f-1]):255===f&&(i=zo(n,16),r=zo(n,16))}return n=(2-s)*(o+1)*16-2*d-2*h,a=16*(a+1)-2*u-2*l,u=[],t=t.fullData,u.push(t.byteLength>>>8&255),u.push(255&t.byteLength),u=u.concat.apply(u,c(t)),t=[],e=e.fullData,t.push(e.byteLength>>>8&255),t.push(255&e.byteLength),t=t.concat.apply(t,c(e)),{height:n,width:a,za:e=new Uint8Array([1,u[3],u[4],u[5],255,225].concat(u,[1],t)),Da:i,Fa:r}}(m);if(!x||null==g)throw new De(2,3,3018,n?n.N()[0]:null);t.height=x.height,t.width=x.width,f={id:t.id,type:"video",codecs:"avc1",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:9e4,duration:i,fb:[],qa:new Uint8Array([]),za:x.za,Da:x.Da,Fa:x.Fa,data:{wb:this.g,baseMediaDecodeTime:g,ab:p},stream:t};break;case"hvc":var A=[],E=null,k=[],I=u.sc();if(!I.length)throw new De(2,3,3023,n?n.N()[0]:null);for(var M=0;M<I.length;M++){var C=I[M],D=C.nalus;k.push.apply(k,c(D));for(var R=!1,P=[],L=!1,N=l(D),j=N.next();!j.done;j=N.next()){var O=j.value;switch(O.type){case 1:case 0:var U=L=!0;break;case 19:case 20:case 21:R=U=L=!0;break;case 32:case 33:case 34:case 39:case 40:U=!0;break;case 35:L=U=!0;break;default:U=!1}if(L&&U){var _=O.fullData.byteLength,B=new Uint8Array(4);B[0]=_>>24&255,B[1]=_>>16&255,B[2]=_>>8&255,B[3]=255&_,P.push(B),P.push(O.fullData)}}var F,V=P.length?{data:di.apply(ai,c(P)),nd:R}:null;if(V)null==E&&null!=C.dts&&(E=C.dts),F=M+1<I.length?(I[M+1].dts||0)-(C.dts||0):1<I.length?(C.dts||0)-(I[M-1].dts||0):9e4*(n.endTime-n.startTime),A.push({data:V.data,size:V.data.byteLength,duration:F,hb:Math.round((C.pts||0)-(C.dts||0)),flags:{kb:0,$a:0,Za:0,Xa:0,Ya:V.nd?2:1,lb:V.nd?0:1}})}var H=function(e){if(!e.length)return null;var t=e.find((function(e){return 32==e.type})),n=e.find((function(e){return 33==e.type})),i=e.find((function(e){return 34==e.type}));if(!t||!n||!i)return null;var r=function(e){var t=new Ko(e,!0);return Zo(t),Zo(t),zo(t,4),zo(t,2),zo(t,6),{Cf:(e=zo(t,3))+1,Zf:t=Qo(t)}}(t.fullData);e=function(e){Zo(e=new Ko(e,!0)),Zo(e);var t=0,n=0,i=0,r=0;zo(e,4);var a=zo(e,3);Qo(e);for(var o=zo(e,2),s=zo(e,1),u=zo(e,5),l=Zo(e),c=Zo(e),d=Zo(e),h=Zo(e),f=Zo(e),p=Zo(e),g=Zo(e),m=Zo(e),v=Zo(e),y=Zo(e),b=Zo(e),w=[],T=[],S=0;S<a;S++)w.push(Qo(e)),T.push(Qo(e));if(0<a)for(S=a;8>S;S++)zo(e,2);for(S=0;S<a;S++)w[S]&&zo(e,88),T[S]&&Zo(e);Jo(e),3==(w=Jo(e))&&zo(e,1),T=Jo(e),S=Jo(e),Qo(e)&&(t+=Jo(e),n+=Jo(e),i+=Jo(e),r+=Jo(e));var x=Jo(e),A=Jo(e),E=Jo(e);if(Qo(e))for(var k=0;k<=a;k++)Jo(e),Jo(e),Jo(e);else Jo(e),Jo(e),Jo(e);if(Jo(e),Jo(e),Jo(e),Jo(e),Jo(e),Jo(e),Qo(e)&&Qo(e))for(k=0;4>k;k++)for(var I=0;I<(3===k?2:6);I++)if(Qo(e)){var M=Math.min(64,1<<4+(k<<1));1<k&&$o(e);for(var C=0;C<M;C++)$o(e)}else Jo(e);for(Qo(e),Qo(e),Qo(e)&&(Zo(e),Jo(e),Jo(e),Qo(e)),k=Jo(e),M=I=0;M<k;M++)if(C=!1,0!==M&&(C=Qo(e)),C){M===k&&Jo(e),Qo(e),Jo(e);for(var D=C=0;D<=I;D++){var R=Qo(e),P=!1;R||(P=Qo(e)),(R||P)&&C++}I=C}else{for(I=(D=Jo(e))+(C=Jo(e)),R=0;R<D;R++)Jo(e),Qo(e);for(D=0;D<C;D++)Jo(e),Qo(e)}if(Qo(e))for(k=Jo(e),I=0;I<k;I++){for(M=0;M<E+4;M++)zo(e,1);zo(e,1)}if(k=E=1,I=0,Qo(e),Qo(e),Qo(e)){if(Qo(e)&&(C=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],D=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1],0<(M=Zo(e))&&16>=M?(E=C[M-1],k=D[M-1]):255===M&&(E=zo(e,16),k=zo(e,16))),Qo(e)&&Qo(e),Qo(e)&&(zo(e,3),Qo(e),Qo(e)&&(Zo(e),Zo(e),Zo(e))),Qo(e)&&(Jo(e),Jo(e)),Qo(e),Qo(e),Qo(e),(M=Qo(e))&&(Jo(e),Jo(e),Jo(e),Jo(e)),Qo(e)&&(zo(e,32),zo(e,32),Qo(e)&&Jo(e),Qo(e)))for(D=!1,M=Qo(e),C=Qo(e),(M||C)&&((D=Qo(e))&&(Zo(e),zo(e,5),Qo(e),zo(e,5)),zo(e,4),zo(e,4),D&&zo(e,4),zo(e,5),zo(e,5),zo(e,5)),R=0;R<=a;R++){var L=!0;P=1,Qo(e)||(L=Qo(e));var N=!1;if(L?Jo(e):N=Qo(e),N||(P=Jo(e)+1),M){for(L=0;L<P;L++)Jo(e),Jo(e),D&&(Jo(e),Jo(e));Qo(e)}if(C){for(L=0;L<P;L++)Jo(e),Jo(e),D&&(Jo(e),Jo(e));Qo(e)}}Qo(e)&&(Qo(e),Qo(e),Qo(e),I=Jo(e),Jo(e),Jo(e),Jo(e),Jo(e))}return{af:b,gf:o,hf:s,ff:u,bf:l,cf:c,df:d,ef:h,Ve:f,We:p,Xe:g,Ye:m,Ze:v,$e:y,$d:I,Oe:0,Me:w,Le:x,Ke:A,width:T-(t+n)*(1===w||2===w?2:1),height:S-(i+r)*(1===w?2:1),Vi:E,Ui:k}}(n.fullData);var a=function(e){var t=new Ko(e,!0);Zo(t),Zo(t),Jo(t),Jo(t),Qo(t),Qo(t),zo(t,3),Qo(t),Qo(t),Jo(t),Jo(t),$o(t),Qo(t),Qo(t),Qo(t)&&Jo(t),$o(t),$o(t),Qo(t),Qo(t),Qo(t),Qo(t),e=Qo(t);var n=1;return(t=Qo(t))&&e?n=0:t?n=3:e&&(n=2),{Ff:n}}(i.fullData);return t=function(e,t,n,i){var r=new Uint8Array(23+(5+e.byteLength)+(5+t.byteLength)+(5+n.byteLength));return r[0]=1,r[1]=(3&i.gf)<<6|(i.hf?1:0)<<5|31&i.ff,r[2]=i.bf,r[3]=i.cf,r[4]=i.df,r[5]=i.ef,r[6]=i.Ve,r[7]=i.We,r[8]=i.Xe,r[9]=i.Ye,r[10]=i.Ze,r[11]=i.$e,r[12]=i.af,r[13]=240|(3840&i.$d)>>8,r[14]=255&i.$d,r[15]=252|3&i.Ff,r[16]=252|3&i.Me,r[17]=248|7&i.Le,r[18]=248|7&i.Ke,r[19]=0,r[20]=0,r[21]=(3&i.Oe)<<6|(7&i.Cf)<<3|(i.Zf?1:0)<<2|3,r[22]=3,r[23]=160,r[24]=0,r[25]=1,r[26]=(65280&e.byteLength)>>8,r[27]=255&e.byteLength,r.set(e,28),r[23+(5+e.byteLength)]=161,r[e.byteLength+29]=0,r[e.byteLength+30]=1,r[e.byteLength+31]=(65280&t.byteLength)>>8,r[e.byteLength+32]=255&t.byteLength,r.set(t,e.byteLength+33),r[23+(e.byteLength+10+t.byteLength)]=162,r[e.byteLength+10+t.byteLength+24]=0,r[e.byteLength+10+t.byteLength+25]=1,r[e.byteLength+10+t.byteLength+26]=(65280&n.byteLength)>>8,r[e.byteLength+10+t.byteLength+27]=255&n.byteLength,r.set(n,e.byteLength+10+t.byteLength+28),r}(t.fullData,n.fullData,i.fullData,{Cf:r.Cf,Zf:r.Zf,gf:e.gf,hf:e.hf,af:e.af,ff:e.ff,bf:e.bf,cf:e.cf,df:e.df,ef:e.ef,Ve:e.Ve,We:e.We,Xe:e.Xe,Ye:e.Ye,Ze:e.Ze,$e:e.$e,Oe:e.Oe,$d:e.$d,Me:e.Me,Le:e.Le,Ke:e.Ke,Ff:a.Ff}),{height:e.height,width:e.width,za:t,Da:e.Vi,Fa:e.Ui}}(k);if(!H||null==E)throw new De(2,3,3018,n?n.N()[0]:null);t.height=H.height,t.width=H.width,f={id:t.id,type:"video",codecs:"hvc1",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:9e4,duration:i,fb:[],qa:new Uint8Array([]),za:H.za,Da:H.Da,Fa:H.Fa,data:{wb:this.g,baseMediaDecodeTime:E,ab:A},stream:t}}f&&(d.push(f),f=null)}if("audio"==r){switch(h.audio){case"aac":for(var G,K=[],X=null,q=l(u.Wb()),z=q.next();!z.done;z=q.next()){var W=z.value,Y=W.data;if(Y){var J=0;if(!(G=MT(Y,J)))throw new De(2,3,3018,n?n.N()[0]:null);for(t.audioSamplingRate=G.sampleRate,t.channelsCount=G.channelCount,null==X&&null!==W.pts&&(X=W.pts);J<Y.length;){var $=IT(Y,J);if($){var Q=$.Sd+$.ea;J+Q<=Y.length&&K.push({data:Y.subarray(J+$.Sd,J+Q),size:$.ea,duration:1024,hb:0,flags:{kb:0,$a:0,Za:0,Xa:0,Ya:2,lb:0}}),J+=Q}else J++}}}if(!G||null==X){if(!u.sc().length)throw new De(2,3,3018,n?n.N()[0]:null);X=9e4*n.startTime;var Z=mi("audio",t.codecs.split(","));if(!Z||!t.channelsCount||!t.audioSamplingRate)throw new De(2,3,3018,n?n.N()[0]:null);G={sampleRate:t.audioSamplingRate,channelCount:t.channelsCount,codec:Z};var ee=function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t||3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null}(Z,t.channelsCount);if(!ee)throw new De(2,3,3018,n?n.N()[0]:null);for(var te=X+9e4*(n.endTime-n.startTime),ne=X;ne<te;)K.push({data:ee,size:ee.byteLength,duration:1024,hb:0,flags:{kb:0,$a:0,Za:0,Xa:0,Ya:2,lb:0}}),ne+=1024/G.sampleRate*9e4}var ie=G.sampleRate,re=X/9e4*ie;f={id:t.id,type:"audio",codecs:G.codec,encrypted:t.encrypted&&0<t.drmInfos.length,timescale:ie,duration:i,fb:[],qa:new Uint8Array([]),za:new Uint8Array([]),Da:0,Fa:0,data:{wb:this.g,baseMediaDecodeTime:re,ab:K},stream:t};break;case"ac3":for(var ae=[],oe=0,se=new Uint8Array([]),ue=null,le=l(u.Wb()),ce=le.next();!ce.done;ce=le.next()){var de=ce.value,he=de.data;null==ue&&null!==de.pts&&(ue=de.pts);for(var fe=0;fe<he.length;){var pe=RT(he,fe);pe?(t.audioSamplingRate=pe.sampleRate,t.channelsCount=pe.channelCount,oe=pe.sampleRate,se=pe.qa,ae.push({data:he.subarray(fe,fe+pe.ea),size:pe.ea,duration:1536,hb:0,flags:{kb:0,$a:0,Za:0,Xa:0,Ya:2,lb:0}}),fe+=pe.ea):fe++}}if(0==oe||0==se.byteLength||null==ue)throw new De(2,3,3018,n?n.N()[0]:null);var me=ue/9e4*oe;f={id:t.id,type:"audio",codecs:"ac-3",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:oe,duration:i,fb:[],qa:se,za:new Uint8Array([]),Da:0,Fa:0,data:{wb:this.g,baseMediaDecodeTime:me,ab:ae},stream:t};break;case"ec3":for(var ve=[],ye=0,be=new Uint8Array([]),we=null,Te=l(u.Wb()),Se=Te.next();!Se.done;Se=Te.next()){var xe=Se.value,Ae=xe.data;null==we&&null!==xe.pts&&(we=xe.pts);for(var Ee=0;Ee<Ae.length;){var ke=NT(Ae,Ee);ke?(t.audioSamplingRate=ke.sampleRate,t.channelsCount=ke.channelCount,ye=ke.sampleRate,be=ke.qa,ve.push({data:Ae.subarray(Ee,Ee+ke.ea),size:ke.ea,duration:1536,hb:0,flags:{kb:0,$a:0,Za:0,Xa:0,Ya:2,lb:0}}),Ee+=ke.ea):Ee++}}if(0==ye||0==be.byteLength||null==we)throw new De(2,3,3018,n?n.N()[0]:null);var Ie=we/9e4*ye;f={id:t.id,type:"audio",codecs:"ec-3",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:ye,duration:i,fb:[],qa:be,za:new Uint8Array([]),Da:0,Fa:0,data:{wb:this.g,baseMediaDecodeTime:Ie,ab:ve},stream:t};break;case"mp3":for(var Me,Ce=[],Re=null,Pe=l(u.Wb()),Le=Pe.next();!Le.done;Le=Pe.next()){var Ne=Le.value,je=Ne.data;if(je){null==Re&&null!==Ne.pts&&(Re=Ne.pts);for(var Oe=0;Oe<je.length;){var Ue=_T(je,Oe);Ue?(Me||(Me=Ue),Oe+Ue.ea<=je.length&&Ce.push({data:je.subarray(Oe,Oe+Ue.ea),size:Ue.ea,duration:1152,hb:0,flags:{kb:0,$a:0,Za:0,Xa:0,Ya:2,lb:0}}),Oe+=Ue.ea):Oe++}}}if(!Me||null==Re)throw new De(2,3,3018,n?n.N()[0]:null);var _e=Me.sampleRate,Be=Re/9e4*_e;f={id:t.id,type:"audio",codecs:"mp3",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:_e,duration:i,fb:[],qa:new Uint8Array([]),za:new Uint8Array([]),Da:0,Fa:0,data:{wb:this.g,baseMediaDecodeTime:Be,ab:Ce},stream:t};break;case"opus":var Fe=[],Ve=null,He=u.F;if(!He)throw new De(2,3,3018,n?n.N()[0]:null);var Ge=[];switch(He.Fh){case 1:case 2:Ge=[0];break;case 0:Ge=[255,1,1,0,1];break;case 128:Ge=[255,2,0,0,1];break;case 3:Ge=[1,2,1,0,2,1];break;case 4:Ge=[1,2,2,0,1,2,3];break;case 5:Ge=[1,3,2,0,4,1,2,3];break;case 6:Ge=[1,4,2,0,4,1,2,3,5];break;case 7:Ge=[1,4,2,0,4,1,2,3,5,6];break;case 8:Ge=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:Ge=[1,1,2,0,1];break;case 131:Ge=[1,1,3,0,1,2];break;case 132:Ge=[1,1,4,0,1,2,3];break;case 133:Ge=[1,1,5,0,1,2,3,4];break;case 134:Ge=[1,1,6,0,1,2,3,4,5];break;case 135:Ge=[1,1,7,0,1,2,3,4,5,6];break;case 136:Ge=[1,1,8,0,1,2,3,4,5,6,7]}for(var Ke=new Uint8Array([0,He.channelCount,0,0,He.sampleRate>>>24&255,He.sampleRate>>>17&255,He.sampleRate>>>8&255,He.sampleRate>>>0&255,0,0].concat(c(Ge))),Xe=He.sampleRate,qe=l(u.Wb()),ze=qe.next();!ze.done;ze=qe.next()){var We=ze.value,Ye=We.data;null==Ve&&null!==We.pts&&(Ve=We.pts);for(var Je=0;Je<Ye.length;){for(var $e=!!(16&Ye[Je+1]),Qe=!!(8&Ye[Je+1]),Ze=Je+2,et=0;255===Ye[Ze];)et+=255,Ze+=1;et+=Ye[Ze],Ze+=1,Ze+=$e?2:0,Ze+=Qe?2:0;var tt=Ye.slice(Ze,Ze+et);Fe.push({data:tt,size:tt.byteLength,duration:960,hb:0,flags:{kb:0,$a:0,Za:0,Xa:0,Ya:2,lb:0}}),Je=Ze+et}}if(0==Ke.byteLength||null==Ve)throw new De(2,3,3018,n?n.N()[0]:null);t.audioSamplingRate=He.sampleRate,t.channelsCount=He.channelCount;var nt=Ve/9e4*Xe;f={id:t.id,type:"audio",codecs:"opus",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:Xe,duration:i,fb:[],qa:Ke,za:new Uint8Array([]),Da:0,Fa:0,data:{wb:this.g,baseMediaDecodeTime:nt,ab:Fe},stream:t}}f&&(d.push(f),f=null)}}catch(e){return e&&3023==e.code?Promise.resolve(new Uint8Array([])):Promise.reject(e)}if(!d.length)return Promise.reject(new De(2,3,3018,n?n.N()[0]:null));var it=new Zm(d),rt=t.id+"_"+n.i;if(this.i.has(rt))var at=this.i.get(rt);else at=ev(it),this.i.set(rt,at);var ot=av(it);this.g++;var st=di(at,ot);return Promise.resolve(st)},F("shaka.transmuxer.TsTransmuxer",JT),JT.prototype.transmux=JT.prototype.transmux,JT.prototype.getOriginalMimeType=JT.prototype.getOriginalMimeType,JT.prototype.convertCodecs=JT.prototype.convertCodecs,JT.prototype.isSupported=JT.prototype.isSupported,JT.prototype.destroy=JT.prototype.destroy;var $T,QT,ZT=["aac","ac-3","ec-3","mp3","opus"],eS=["avc","hevc"];function tS(){}function nS(){$T||navigator.emeEncryptionSchemePolyfilled?console.debug("EmeEncryptionSchemePolyfill: Already installed."):navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration?($T=navigator.requestMediaKeySystemAccess,console.debug("EmeEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.requestMediaKeySystemAccess=iS,navigator.emeEncryptionSchemePolyfilled=!0):console.debug("EmeEncryptionSchemePolyfill: EME not found")}function iS(e,t){var n,i=this;return P((function(r){return 1==r.g?(console.assert(i==navigator,'bad "this" for requestMediaKeySystemAccess'),w(r,$T.call(i,e,t),2)):fS(n=r.h)?(console.debug("EmeEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.requestMediaKeySystemAccess=$T,r.return(n)):(console.debug("EmeEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support."),navigator.requestMediaKeySystemAccess=rS,r.return(rS.call(i,e,t)))}))}function rS(e,t){var n,i,r,a,o,s,u,c,d,h,f,p,g=this;return P((function(m){if(1==m.g){for(console.assert(g==navigator,'bad "this" for requestMediaKeySystemAccess'),n=hS(e),i=[],r=l(t),a=r.next();!a.done;a=r.next())o=a.value,s=aS(o.videoCapabilities,n),u=aS(o.audioCapabilities,n),o.videoCapabilities&&o.videoCapabilities.length&&!s.length||o.audioCapabilities&&o.audioCapabilities.length&&!u.length||((c=Object.assign({},o)).videoCapabilities=s,c.audioCapabilities=u,i.push(c));if(!i.length)throw(d=Error("Unsupported keySystem or supportedConfigurations.")).name="NotSupportedError",d.code=DOMException.NOT_SUPPORTED_ERR,d;return w(m,$T.call(g,e,i),2)}return h=m.h,p=f=null,i[0]&&(i[0].videoCapabilities&&(f=i[0].videoCapabilities[0].encryptionScheme),i[0].audioCapabilities&&(p=i[0].audioCapabilities[0].encryptionScheme)),m.return(new dS(h,f,p))}))}function aS(e,t){return e?e.filter((function(e){return pS(e.encryptionScheme,t)})):e}function oS(){}function sS(){QT||navigator.mediaCapabilitiesEncryptionSchemePolyfilled?console.debug("McEncryptionSchemePolyfill: Already installed."):navigator.mediaCapabilities?(QT=navigator.mediaCapabilities.decodingInfo,console.debug("McEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=uS,navigator.mediaCapabilitiesEncryptionSchemePolyfilled=!0):console.debug("McEncryptionSchemePolyfill: MediaCapabilities not found")}function uS(e){var t,n,i=this;return P((function(r){switch(r.g){case 1:return console.assert(i==navigator.mediaCapabilities,'bad "this" for decodingInfo'),w(r,QT.call(i,e),2);case 2:if(t=r.h,!e.keySystemConfiguration)return r.return(t);if((n=t.keySystemAccess)&&fS(n))return console.debug("McEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.mediaCapabilities.decodingInfo=QT,r.return(t);if(console.debug("McEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=lS,n){r.u(3);break}return w(r,cS(e),4);case 4:return t.keySystemAccess=r.h,r.return(t);case 3:return r.return(lS.call(i,e))}}))}function lS(e){var t,n,i,r,a,o,s,u=this;return P((function(l){switch(l.g){case 1:return console.assert(u==navigator.mediaCapabilities,'bad "this" for decodingInfo'),n=t=null,!e.keySystemConfiguration||(i=e.keySystemConfiguration,r=i.keySystem,n=i.audio&&i.audio.encryptionScheme,t=i.video&&i.video.encryptionScheme,a=hS(r),o={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:e},pS(n,a)&&pS(t,a))?w(l,QT.call(u,e),2):l.return(o);case 2:if((s=l.h).keySystemAccess){s.keySystemAccess=new dS(s.keySystemAccess,t,n),l.u(3);break}if(!e.keySystemConfiguration){l.u(3);break}return w(l,cS(e),5);case 5:s.keySystemAccess=l.h;case 3:return l.return(s)}}))}function cS(e){var t,n;return P((function(i){if(1==i.g){var r=e.keySystemConfiguration,a=[],o=[];return r.audio&&a.push({robustness:r.audio.robustness||"",contentType:e.audio.contentType,encryptionScheme:r.audio.encryptionScheme}),r.video&&o.push({robustness:r.video.robustness||"",contentType:e.video.contentType,encryptionScheme:r.video.encryptionScheme}),r={initDataTypes:r.initDataType?[r.initDataType]:[],distinctiveIdentifier:r.distinctiveIdentifier,persistentState:r.persistentState,sessionTypes:r.sessionTypes},a.length&&(r.audioCapabilities=a),o.length&&(r.videoCapabilities=o),t=r,w(i,navigator.requestMediaKeySystemAccess(e.keySystemConfiguration.keySystem,[t]),2)}return n=i.h,i.return(n)}))}function dS(e,t,n){this.g=e,this.i=t||null,this.h=n||null,this.keySystem=e.keySystem}function hS(e){return e.startsWith("com.widevine")||e.startsWith("com.microsoft")||e.startsWith("com.chromecast")||e.startsWith("com.adobe")||e.startsWith("org.w3")?"cenc":e.startsWith("com.apple")?"cbcs":(console.warn("EmeEncryptionSchemePolyfill: Unknown key system:",e,"Please contribute!"),null)}function fS(e){var t=(e=e.getConfiguration()).audioCapabilities&&e.audioCapabilities[0];return!(!(e=e.videoCapabilities&&e.videoCapabilities[0]||t)||void 0===e.encryptionScheme)}function pS(e,t){return!e||e==t||!("cbcs"!=e&&"cbcs-1-9"!=e||!(bS||SS||yS))}function gS(){}function mS(){nS(),sS()}jn("video/mp2t",(function(){return new JT("video/mp2t")}),Fn),F("EmeEncryptionSchemePolyfill",tS),tS.install=nS,F("McEncryptionSchemePolyfill",oS),oS.install=sS,dS.prototype.getConfiguration=function(){var e=this.g.getConfiguration();if(e.videoCapabilities)for(var t=l(e.videoCapabilities),n=t.next();!n.done;n=t.next())n.value.encryptionScheme=this.i;if(e.audioCapabilities)for(n=(t=l(e.audioCapabilities)).next();!n.done;n=t.next())n.value.encryptionScheme=this.h;return e},dS.prototype.createMediaKeys=function(){return this.g.createMediaKeys()},F("EncryptionSchemePolyfills",gS),gS.install=mS;var vS,yS=navigator.userAgent.includes("CrKey"),bS=100<=parseInt(navigator.userAgent.split("Firefox/").pop(),10),wS=navigator.userAgent||"";if(wS.includes("Web0S")){var TS=wS.match(/Chrome\/(\d+)/);vS=!!TS&&79<=parseInt(TS[1],10)}else vS=!1;var SS=vS;void 0!==n&&n.exports&&(n.exports=gS)}.call(i,e,e,void 0),i.shaka)t[r]=i.shaka[r]}()}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{ClientAssertionError:()=>N,ConnectReason:()=>I,ShakaPlayer:()=>H,alarmManager:()=>_,auth:()=>k,deviceManager:()=>B,envInfo:()=>P,getClientAssertion:()=>j,getConnectReason:()=>K,getDeviceInfo:()=>z,getPlatformInfo:()=>C,getTriggerEvent:()=>X,init:()=>M,initSequence:()=>x,isRunningE2E:()=>D,lifecycle:()=>O,messageManager:()=>V,platformManager:()=>F,remotePlayer:()=>U,setTimezone:()=>q,shaka:()=>G,showSequence:()=>A,uiReady:()=>R,writeLicenseResponse:()=>L});var e={};n.r(e),n.d(e,{ClientAssertionError:()=>N,ConnectReason:()=>I,ShakaPlayer:()=>H,alarmManager:()=>_,auth:()=>k,deviceManager:()=>B,envInfo:()=>P,getClientAssertion:()=>j,getConnectReason:()=>K,getDeviceInfo:()=>z,getPlatformInfo:()=>C,getTriggerEvent:()=>X,init:()=>M,initSequence:()=>x,isRunningE2E:()=>D,lifecycle:()=>O,messageManager:()=>V,platformManager:()=>F,remotePlayer:()=>U,setTimezone:()=>q,shaka:()=>G,showSequence:()=>A,uiReady:()=>R,writeLicenseResponse:()=>L});const t="4.3.4";class r{constructor(e){this.logFields=e}debug(...e){console.debug(this.formatLogString(e))}log(...e){console.log(this.formatLogString(e))}info(...e){console.info(this.formatLogString(e))}warn(...e){console.warn(this.formatLogString(e))}error(...e){console.error(this.formatLogString(e))}metrics(e){console.info(`[hs-sdk] [metrics] ${JSON.stringify(e)}`)}withFields(e){return new r({...this.logFields,...e})}formatLogString(e){let t="[hs-sdk] "+e.join(" ");return this.logFields&&(t+=" [log-fields] "+JSON.stringify(this.logFields)),t}}const a=new r({sdkVersion:t});function o(e,...t){return console.log(`Called "${e}" with args:`,...t||[],"This feature is only supported E2E."),Promise.resolve()}class s extends EventTarget{ConnectReason=Object.freeze({UNKNOWN:"unknown",INITIAL_CONNECTION:"initial_connection",APPLICATION_RELOAD:"reload_app",UI_RELEASE:"ui_release",UI_TERMINATION:"ui_termination",WEBRTC_ERROR:"webrtc_error",UI_WATCHDOG:"ui_watchdog"});UiState=Object.freeze({UNKNOWN:"unknown",FOREGROUND:"foreground",IN_TRANSITION_TO_FOREGROUND:"inTransitionToForeground",BACKGROUND:"background",IN_TRANSITION_TO_BACKGROUND:"inTransitionToBackground"});configure(e){o("lifecycle.configure",e)}getConfiguration(){return{autoBackground:{enabled:!1,timeout:{playing:0,idle:0}}}}get state(){return this._state=this.UiState.UNKNOWN,this._state}get connectReason(){return this.ConnectReason.UNKNOWN}get triggerEvent(){return{}}set autoBackground(e){o("lifecycle.autoBackground",e)}get autoBackground(){return!1}set autoBackgroundDelay(e){o("lifecycle.autoBackgroundDelay",e)}get autoBackgroundDelay(){return 0}set autoBackgroundOnUIDelay(e){o("lifecycle.autoBackgroundOnUIDelay",e)}get autoBackgroundOnUIDelay(){return 0}getState(){a.warn("lifecycle getState is not supported if NOT running e2e")}moveToForeground(){return o("lifecycle.moveToForeground")}moveToBackground(){return o("lifecycle.moveToBackground")}switchTenant(e){return o("lifecycle.switchTenant",e)}exitApplication(){return o("lifecycle.exitApplication")}disconnect(){return o("lifecycle.disconnect")}addEventListener(e,t,n){super.addEventListener(e,t,n)}removeEventListener(e,t,n){super.removeEventListener(e,t,n)}}const u={level:0,quality:0,ssid:"unknown",bssid:"unknown"};class l extends EventTarget{get deviceInfo(){return a.log("getDeviceInfo running locally, returning dummy info"),{deviceId:"123456789",modelNumber:"ABC",connectionId:"dummy",community:"LocalDev",tenant:"XXXXXX",clientIp:"0.0.0.0",countryCode:"XX",connectionType:"simulator"}}get wifiInfo(){return u}reboot(){return o("DeviceManager.reboot")}clearWifi(){return o("DeviceManager.clearWifi")}sendDataToDevice(e){return o("DeviceManager.sendDataToDevice",e)}async factoryReset(e=!0){return o("DeviceManager.factoryReset",e)}async getWifiInfo(){return Promise.resolve({})}}class c extends EventTarget{get appConfig(){return{}}setTimezone(e){o("PlatformManager.setTimezone",e)}}class d extends EventTarget{addEventListener(e,t){o("AlarmManager.addEventListener",e,t)}removeEventListener(e,t){o("AlarmManager.removeEventListener",e,t)}addAlarm(e,t,n="",i=0,r=0){o("AlarmManager.addAlarm",e,t,n,i,r)}deleteAlarm(e){o("AlarmManager.deleteAlarm",e)}deleteAllAlarms(){o("AlarmManager.deleteAllAlarms")}getActiveAlarms(){return o("AlarmManager.getActiveAlarms")}}class h extends EventTarget{async registerGroups(e){return o("MessageManager.registerGroups",e)}}class f extends EventTarget{LoadMode=Object.freeze({NOT_LOADED:"notLoaded",LOADING:"loading",LOADED:"loaded",UNLOADING:"unloading"});getConfiguration(){return{preferredAudioLanguage:"",preferredSubtitlesLanguage:""}}configure(e){o("RemotePlayer.configure",e)}registerVideoElement(e){this.attach(e)}attach(e){o("RemotePlayer.attach",e)}detach(){o("RemotePlayer.detach")}async load(e,t){return o("RemotePlayer.load",e,t)}async play(){return o("RemotePlayer.play")}async pause(){return o("RemotePlayer.pause")}async stop(){return o("RemotePlayer.stop")}getAssetUri(){return""}getLoadMode(){return this.LoadMode.NOT_LOADED}getTextTracks(){return[]}getAudioTracks(){return[]}async selectAudioTrack(e){return o("RemotePlayer.selectAudioTrack",e)}async selectTextTrack(e){return o("RemotePlayer.selectTextTrack",e)}setTextTrackVisibility(e){return o("RemotePlayer.setTextTrackVisibility",e)}setScreenBlackout(e){return o("RemotePlayer.setScreenBlackout",e)}resetScreenBlackout(){return o("RemotePlayer.resetScreenBlackout")}get currentTime(){return 0}set currentTime(e){o("RemotePlayer.currentTime",e)}get duration(){return 0}get textTrackVisibility(){return!1}getPresentationStartTimeAsDate(){return null}async unload(){return o("RemotePlayer.unload")}}var p=n(159);p.util.Error.Category.SENZA_PLAYER_ERROR=50,p.util.Error.Code.SENZA_PLAYER_ERROR=10500;const g={...p};class m extends p.Player{constructor(e,t,n){super(e,t,n)}async attach(e,t=!0){await super.attach(e,t)}async detach(e=!1){return super.detach(e)}async unload(e=!0,t=!1){return super.unload(e,t)}getTextLanguages(){return super.getTextLanguages()}getAudioLanguages(){return super.getAudioLanguages()}selectAudioLanguage(e,t){super.selectAudioLanguage(e,t)}selectTextLanguage(e,t){super.selectTextLanguage(e,t)}setTextTrackVisibility(e){super.setTextTrackVisibility(e)}get isInRemotePlayback(){return!1}async load(e,t,n){return super.load(e,t,n)}async destroy(){return super.destroy()}configure(e){return super.configure(e)}}g.Player=m;const v={BACK:27,HOME:36,LEFT:37,RIGHT:39,UP:38,DOWN:40,ENTER:13},y={root:{top:"5vh",left:"82vw",height:"90vh",fontSize:"16px",width:"16vw",position:"fixed",zIndex:1e4,overflow:"hidden",visibility:"hidden"},item:{backgroundColor:"white",color:"black",fontSize:"12px",display:"flex",padding:"6px",border:"1px solid black",borderTop:"none"},item_key:{borderTopLeftRadius:"6px",borderTopRightRadius:"6px",marginTop:"20px",borderBottom:"3px solid black"},component:{fontWeight:"bold",width:"5vw"},component_key:{fontWeight:"normal",color:"darkgray"},id:{textAlign:"left",fontWeight:"normal",flex:1},id_key:{fontWeight:"bold"},time:{fontVariantNumeric:"tabular-nums",width:"3vw"},time_key:{fontWeight:"bold"}};let b=performance.now();const w=(e,t)=>"key"===t?new Date(e).toLocaleTimeString("en-US",{hour12:!1}):`${(e/1e3).toFixed(2)}s`,T=(e,t,n)=>{Object.entries(e).forEach((([e,i])=>{Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach((r=>{if(n&&n(r))return;const a=i[r];"function"==typeof a&&(i[r]=function(...n){return t(e,r,...n),a.apply(this,n)})}))}))},S=(e,t)=>{e.innerHTML="",t.forEach(((n,i)=>{const r=document.createElement("div");Object.assign(r.style,{...y.item,...y[`item_${n?.component}`]}),["component","id","time"].forEach((e=>{if(n[e]){const t=document.createElement("div");Object.assign(t.style,y[e],y[`${e}_${n.component}`]),t.textContent="time"===e?w(n.time,n.component):n[e],r.appendChild(t)}})),e.appendChild(r),i===t.length-1&&r.scrollIntoView({behavior:"smooth"})}))},x=e=>{if(!e)return void a.error("No components to sequence");let t=document.getElementById("sequence-container");if(t)return;t=(()=>{const e=document.createElement("div");return e.id="sequence-container",Object.assign(e.style,y.root),document.body.appendChild(e),e})();const n=new Proxy([],{set:(e,i,r)=>(e[i]=r,"length"!==i&&S(t,n),!0)});window.printSequence=()=>(e=>{const t=e.map((e=>{const t=e.separator?"\n":"",n=e?.time?` ${w(e.time,e?.component)}`:"";if(e.args){const i=e.args.map((e=>"object"==typeof e?"object":e)).join(", ");return`${t}${e.component}.${e.id}(${i})${n}`}return`\n${e.component}: ${e.id}${n}`}));a.log("sequence:\n",t.join("\n"))})(n),((e,t)=>{t.push({component:"key",id:"BOOT",time:Date.now()}),T(e,((e,n,...i)=>{t.push({component:e,id:n,args:i,time:performance.now()-b})}),(e=>e.startsWith("_")||e.startsWith("get"))),(e=>{window.addEventListener("keydown",(t=>{var n;e.push({component:"key",id:(n=t.keyCode,Object.entries(v).find((([,e])=>e===n))?.[0]||String(n)),time:Date.now()}),b=performance.now()}))})(t),function(e,t){e.remotePlayer.addEventListener("videoelementattached",(()=>{const n=e.remotePlayer._videoElement;n&&!n._devSequenceRateChangeHandler&&(n._devSequenceRateChangeHandler=()=>{t.push({component:"localPlayer",id:"ratechange="+n.playbackRate,time:performance.now()-b})},n.addEventListener("ratechange",n._devSequenceRateChangeHandler)),n&&!n._devSequencePlayingHandler&&(n._devSequencePlayingHandler=()=>{t.push({component:"localPlayer",id:"playing event",time:performance.now()-b})},n.addEventListener("playing",n._devSequencePlayingHandler))})),e.remotePlayer.addEventListener("playing",(()=>{t.push({component:"remotePlayer",id:"playing event",time:performance.now()-b})}))}(e,t),a.log("Sequence initialized.")})(e,n),S(t,n)},A=(e=!0)=>{const t=document.getElementById("sequence-container");t?t.style.visibility=e?"visible":"hidden":a.error("Sequence not initialized")};let E;"undefined"!=typeof document&&document.addEventListener("keydown",(e=>{a.log(`Got ${e.key} key`)}));const k={getToken:async function(){return window.senzaSDKImplementation?window.senzaSDKImplementation.auth.getToken():Promise.resolve(E)},forceTokenUpdate:function(){if(E=null,window.senzaSDKImplementation)return window.senzaSDKImplementation.auth.forceTokenUpdate();a.error("forceTokenUpdate: window.cefQuery is undefined")},getClientAssertion:j},I=Object.freeze({UNKNOWN:"unknown",INITIAL_CONNECTION:"initial_connection",APPLICATION_RELOAD:"reload_app",UI_RELEASE:"ui_release",UI_TERMINATION:"ui_termination",WEBRTC_ERROR:"webrtc_error",UI_WATCHDOG:"ui_watchdog"});async function M(){a.log(`init interface ${t}`),window.senzaSDKImplementation?await window.senzaSDKImplementation.init(t,A,x):o("init"),window.close=()=>{a.warn("window.close is disabled on Senza platform. Use lifecycle.exitApplication() instead.")}}function C(){return window.senzaSDKImplementation?window.senzaSDKImplementation.getPlatformInfo():{version:"X.X.XX-X",pod:"ui-streamer-X.X.XX-X-QWERT-ASDFG-XXX-XXXXXX-XXXXX",podIP:"0.0.0.0",sessionInfo:{userAgent:"SynamediaSenza/XX.YY.ZZ",connectionId:"dummy",deviceId:"123456789",community:"LocalDev",tenant:"XXXXXX",tenantId:"XXXXXX",manifest:{transcontainer:"X.X.XX-X"},settings:{webUI:{backendHeaders:{Authorization:"Bearer dummytoken"}}},homeSessionInfo:{tenantId:"XXXXXX",community:"LocalDev"}}}}function D(){return!("undefined"==typeof window||!window.senzaSDKImplementation)}function R(){if(window.senzaSDKImplementation)return window.senzaSDKImplementation.uiReady();a.error("uiReady: window.cefQuery is undefined")}const P={remoteBrowserIp:window?.diagnostics?.()?.podIP||"127.0.0.1",sdkVersion:t,sdkBackendVersion:window?.senzaSDKImplementation?.version||"N/A"};function L(e,t,n,i){if(window?.senzaSDKImplementation)return window.senzaSDKImplementation.writeLicenseResponse(e,t,n,i);a.error("writeLicenseResponse: window.cefQuery is undefined")}class N extends Error{constructor(e,t){super(t),this.code=e}}function j(){if(window?.senzaSDKImplementation)return window.senzaSDKImplementation.auth.getClientAssertion();a.warn("getClientAssertion is not supported if NOT running e2e")}let O,U,_,B,F,V,H,G;function K(){return O.connectReason}function X(){return O.triggerEvent}function q(e){if(window.cefQuery){const t={message:JSON.stringify({type:"setTimeZone",timezone:e}),waitForResponse:!1,target:"UI-Streamer"};window.cefQuery({request:JSON.stringify(t),persistent:!1,onSuccess:()=>{a.log("timezome is successfully set to",e)},onFailure:(t,n)=>{a.error(`error occurred setting timezone to ${e}: ${t} ${n}`)}})}}function z(){return D()?{deviceId:B.deviceInfo.deviceId,connectionId:B.deviceInfo.connectionId,community:B.deviceInfo.community,tenant:B.deviceInfo.tenant,clientIp:B.deviceInfo.clientIp}:(a.log("getDeviceInfo running locally, returning dummy info"),{deviceId:"123456789",connectionId:"dummy",community:"LocalDev",tenant:"XXXXXX",clientIp:"0.0.0.0"})}D()?(O=window.senzaSDKImplementation.lifecycle,U=window.senzaSDKImplementation.remotePlayer,_=window.senzaSDKImplementation.alarmManager,B=window.senzaSDKImplementation.deviceManager,F=window.senzaSDKImplementation.platformManager,V=window.senzaSDKImplementation.messageManager,H=window.senzaSDKImplementation.ShakaPlayer,G=window.senzaSDKImplementation.shaka):(a.warn("Senza SDK is not running in E2E environment. Some features may not work as expected."),O=new s,U=new f,_=new d,B=new l,F=new c,V=new h,H=m,G=g),"undefined"!=typeof window&&(window.hs=e,window.senza=window.senza||e)})(),i})()));
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.senza=t():e.senza=t()}(this,(()=>(()=>{var e={159:(e,t,n)=>{!function(){var e="undefined"!=typeof window?window:n.g,i={};for(var r in function(e,t,n){var i;function r(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var a="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e},o=function(n){n=["object"==typeof globalThis&&globalThis,n,"object"==typeof e&&e,"object"==typeof self&&self,"object"==typeof t&&t];for(var i=0;i<n.length;++i){var r=n[i];if(r&&r.Math==Math)return r}throw Error("Cannot find global object")}(this);function s(e,t){if(t)e:{var n=o;e=e.split(".");for(var i=0;i<e.length-1;i++){var r=e[i];if(!(r in n))break e;n=n[r]}(t=t(i=n[e=e[e.length-1]]))!=i&&null!=t&&a(n,e,{configurable:!0,writable:!0,value:t})}}function u(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function l(e){var t="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];if(t)return t.call(e);if("number"==typeof e.length)return{next:r(e)};throw Error(String(e)+" is not an iterable or ArrayLike")}function c(e){if(!(e instanceof Array)){e=l(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}s("Symbol",(function(e){function t(e,t){this.g=e,a(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),s("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),n=0;n<t.length;n++){var i=o[t[n]];"function"==typeof i&&"function"!=typeof i.prototype[e]&&a(i.prototype,e,{configurable:!0,writable:!0,value:function(){return u(r(this))}})}return e}));var d,h="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)d=Object.setPrototypeOf;else{var f;e:{var p={};try{p.__proto__={a:!0},f=p.a;break e}catch(e){}f=!1}d=f?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var g=d;function m(e,t){if(e.prototype=h(t.prototype),e.prototype.constructor=e,g)g(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var i=Object.getOwnPropertyDescriptor(t,n);i&&Object.defineProperty(e,n,i)}else e[n]=t[n];e.pk=t.prototype}function v(){this.o=!1,this.l=null,this.h=void 0,this.g=1,this.j=this.m=0,this.A=this.i=null}function y(e){if(e.o)throw new TypeError("Generator is already running");e.o=!0}function b(e,t){e.i={vg:t,Ig:!0},e.g=e.m||e.j}function w(e,t,n){return e.g=n,{value:t}}function T(e){e.g=0}function S(e,t,n){e.m=t,null!=n&&(e.j=n)}function x(e,t){e.m=0,e.j=t||0}function A(e,t,n){e.g=t,e.m=n||0}function E(e,t){return e.m=t||0,t=e.i.vg,e.i=null,t}function k(e){e.A=[e.i],e.m=0,e.j=0}function I(e,t){var n=e.A.splice(0)[0];(n=e.i=e.i||n)?n.Ig?e.g=e.m||e.j:null!=n.u&&e.j<n.u?(e.g=n.u,e.i=null):e.g=e.j:e.g=t}function M(e){this.g=new v,this.h=e}function C(e,t,n,i){try{var r=t.call(e.g.l,n);if(!(r instanceof Object))throw new TypeError("Iterator result "+r+" is not an object");if(!r.done)return e.g.o=!1,r;var a=r.value}catch(t){return e.g.l=null,b(e.g,t),D(e)}return e.g.l=null,i.call(e.g,a),D(e)}function D(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.o=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,b(e.g,t)}if(e.g.o=!1,e.g.i){if(t=e.g.i,e.g.i=null,t.Ig)throw t.vg;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function R(e){this.next=function(t){return y(e.g),e.g.l?t=C(e,e.g.l.next,t,e.g.s):(e.g.s(t),t=D(e)),t},this.throw=function(t){return y(e.g),e.g.l?t=C(e,e.g.l.throw,t,e.g.s):(b(e.g,t),t=D(e)),t},this.return=function(t){return function(e,t){y(e.g);var n=e.g.l;return n?C(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),D(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function P(e){return function(e){function t(t){return e.next(t)}function n(t){return e.throw(t)}return new Promise((function(i,r){!function e(a){a.done?i(a.value):Promise.resolve(a.value).then(t,n).then(e,r)}(e.next())}))}(new R(new M(e)))}function L(){for(var e=Number(this),t=[],n=e;n<arguments.length;n++)t[n-e]=arguments[n];return t}function N(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function j(e,t){e instanceof String&&(e+="");var n=0,i=!1,r={next:function(){if(!i&&n<e.length){var r=n++;return{value:t(r,e[r]),done:!1}}return i=!0,{done:!0,value:void 0}}};return r[Symbol.iterator]=function(){return r},r}function O(e,t,n){e instanceof String&&(e=String(e));for(var i=e.length,r=0;r<i;r++){var a=e[r];if(t.call(n,a,r,e))return{Gg:r,v:a}}return{Gg:-1,v:void 0}}function U(e,t,n){if(null==e)throw new TypeError("The 'this' value for String.prototype."+n+" must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype."+n+" must not be a regular expression");return e+""}v.prototype.s=function(e){this.h=e},v.prototype.return=function(e){this.i={return:e},this.g=this.j},v.prototype.u=function(e){this.g=e},s("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function i(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var r=o.setTimeout;n.prototype.i=function(e){r(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(i){n||(n=!0,e.call(t,i))}}var t=this,n=!1;return{resolve:e(this.F),reject:e(this.l)}},t.prototype.F=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.H(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.C(e):this.m(e)}},t.prototype.C=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.I(t,e):this.m(e)},t.prototype.l=function(e){this.s(2,e)},t.prototype.m=function(e){this.s(1,e)},t.prototype.s=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.G(),this.A()},t.prototype.G=function(){var e=this;r((function(){if(e.B()){var t=o.console;void 0!==t&&t.error(e.i)}}),1)},t.prototype.B=function(){if(this.o)return!1;var e=o.CustomEvent,t=o.Event,n=o.dispatchEvent;return void 0===n||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=o.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.A=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)a.h(this.g[e]);this.g=null}};var a=new n;return t.prototype.H=function(e){var t=this.j();e.Hd(t.resolve,t.reject)},t.prototype.I=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function i(e,t){return"function"==typeof e?function(t){try{r(e(t))}catch(e){a(e)}}:t}var r,a,o=new t((function(e,t){r=e,a=t}));return this.Hd(i(e,r),i(n,a)),o},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.Hd=function(e,t){function n(){switch(i.h){case 1:e(i.i);break;case 2:t(i.i);break;default:throw Error("Unexpected state: "+i.h)}}var i=this;null==this.g?a.h(n):this.g.push(n),this.o=!0},t.resolve=i,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=l(e),a=r.next();!a.done;a=r.next())i(a.value).Hd(t,n)}))},t.all=function(e){var n=l(e),r=n.next();return r.done?i([]):new t((function(e,t){function a(t){return function(n){o[t]=n,0==--s&&e(o)}}var o=[],s=0;do{o.push(void 0),s++,i(r.value).Hd(a(o.length-1),t),r=n.next()}while(!r.done)}))},t})),s("WeakMap",(function(e){function t(e){if(this.g=(u+=Math.random()+1).toString(),e){e=l(e);for(var t;!(t=e.next()).done;)t=t.value,this.set(t[0],t[1])}}function n(){}function i(e){var t=typeof e;return"object"===t&&null!==e||"function"===t}function r(e){if(!N(e,s)){var t=new n;a(e,s,{value:t})}}function o(e){var t=Object[e];t&&(Object[e]=function(e){return e instanceof n?e:(Object.isExtensible(e)&&r(e),t(e))})}if(function(){if(!e||!Object.seal)return!1;try{var t=Object.seal({}),n=Object.seal({}),i=new e([[t,2],[n,3]]);return 2==i.get(t)&&3==i.get(n)&&(i.delete(t),i.set(n,4),!i.has(t)&&4==i.get(n))}catch(e){return!1}}())return e;var s="$jscomp_hidden_"+Math.random();o("freeze"),o("preventExtensions"),o("seal");var u=0;return t.prototype.set=function(e,t){if(!i(e))throw Error("Invalid WeakMap key");if(r(e),!N(e,s))throw Error("WeakMap key fail: "+e);return e[s][this.g]=t,this},t.prototype.get=function(e){return i(e)&&N(e,s)?e[s][this.g]:void 0},t.prototype.has=function(e){return i(e)&&N(e,s)&&N(e[s],this.g)},t.prototype.delete=function(e){return!!(i(e)&&N(e,s)&&N(e[s],this.g))&&delete e[s][this.g]},t})),s("Map",(function(e){function t(){var e={};return e.Ob=e.next=e.head=e}function n(e,t){var n=e[1];return u((function(){if(n){for(;n.head!=e[1];)n=n.Ob;for(;n.next!=n.head;)return n=n.next,{done:!1,value:t(n)};n=null}return{done:!0,value:void 0}}))}function i(e,t){var n=t&&typeof t;"object"==n||"function"==n?a.has(t)?n=a.get(t):(n=""+ ++o,a.set(t,n)):n="p_"+t;var i=e[0][n];if(i&&N(e[0],n))for(e=0;e<i.length;e++){var r=i[e];if(t!=t&&r.key!=r.key||t===r.key)return{id:n,list:i,index:e,entry:r}}return{id:n,list:i,index:-1,entry:void 0}}function r(e){if(this[0]={},this[1]=t(),this.size=0,e){e=l(e);for(var n;!(n=e.next()).done;)n=n.value,this.set(n[0],n[1])}}if(function(){if(!e||"function"!=typeof e||!e.prototype.entries||"function"!=typeof Object.seal)return!1;try{var t=Object.seal({x:4}),n=new e(l([[t,"s"]]));if("s"!=n.get(t)||1!=n.size||n.get({x:4})||n.set({x:4},"t")!=n||2!=n.size)return!1;var i=n.entries(),r=i.next();return!r.done&&r.value[0]==t&&"s"==r.value[1]&&!((r=i.next()).done||4!=r.value[0].x||"t"!=r.value[1]||!i.next().done)}catch(e){return!1}}())return e;var a=new WeakMap;r.prototype.set=function(e,t){var n=i(this,e=0===e?0:e);return n.list||(n.list=this[0][n.id]=[]),n.entry?n.entry.value=t:(n.entry={next:this[1],Ob:this[1].Ob,head:this[1],key:e,value:t},n.list.push(n.entry),this[1].Ob.next=n.entry,this[1].Ob=n.entry,this.size++),this},r.prototype.delete=function(e){return!(!(e=i(this,e)).entry||!e.list||(e.list.splice(e.index,1),e.list.length||delete this[0][e.id],e.entry.Ob.next=e.entry.next,e.entry.next.Ob=e.entry.Ob,e.entry.head=null,this.size--,0))},r.prototype.clear=function(){this[0]={},this[1]=this[1].Ob=t(),this.size=0},r.prototype.has=function(e){return!!i(this,e).entry},r.prototype.get=function(e){return(e=i(this,e).entry)&&e.value},r.prototype.entries=function(){return n(this,(function(e){return[e.key,e.value]}))},r.prototype.keys=function(){return n(this,(function(e){return e.key}))},r.prototype.values=function(){return n(this,(function(e){return e.value}))},r.prototype.forEach=function(e,t){for(var n,i=this.entries();!(n=i.next()).done;)n=n.value,e.call(t,n[1],n[0],this)},r.prototype[Symbol.iterator]=r.prototype.entries;var o=0;return r})),s("Set",(function(e){function t(e){if(this.g=new Map,e){e=l(e);for(var t;!(t=e.next()).done;)this.add(t.value)}this.size=this.g.size}return function(){if(!e||"function"!=typeof e||!e.prototype.entries||"function"!=typeof Object.seal)return!1;try{var t=Object.seal({x:4}),n=new e(l([t]));if(!n.has(t)||1!=n.size||n.add(t)!=n||1!=n.size||n.add({x:4})!=n||2!=n.size)return!1;var i=n.entries(),r=i.next();return!r.done&&r.value[0]==t&&r.value[1]==t&&!(r=i.next()).done&&r.value[0]!=t&&4==r.value[0].x&&r.value[1]==r.value[0]&&i.next().done}catch(e){return!1}}()?e:(t.prototype.add=function(e){return e=0===e?0:e,this.g.set(e,e),this.size=this.g.size,this},t.prototype.delete=function(e){return e=this.g.delete(e),this.size=this.g.size,e},t.prototype.clear=function(){this.g.clear(),this.size=0},t.prototype.has=function(e){return this.g.has(e)},t.prototype.entries=function(){return this.g.entries()},t.prototype.values=function(){return this.g.values()},t.prototype.keys=t.prototype.values,t.prototype[Symbol.iterator]=t.prototype.values,t.prototype.forEach=function(e,t){var n=this;this.g.forEach((function(i){return e.call(t,i,i,n)}))},t)})),s("Array.prototype.keys",(function(e){return e||function(){return j(this,(function(e){return e}))}})),s("Array.prototype.findIndex",(function(e){return e||function(e,t){return O(this,e,t).Gg}})),s("Array.from",(function(e){return e||function(e,t,n){t=null!=t?t:function(e){return e};var i=[],r="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];if("function"==typeof r){e=r.call(e);for(var a=0;!(r=e.next()).done;)i.push(t.call(n,r.value,a++))}else for(r=e.length,a=0;a<r;a++)i.push(t.call(n,e[a],a));return i}})),s("Array.prototype.values",(function(e){return e||function(){return j(this,(function(e,t){return t}))}})),s("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),s("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var i=n.length;for(0>(t=t||0)&&(t=Math.max(t+i,0));t<i;t++){var r=n[t];if(r===e||Object.is(r,e))return!0}return!1}})),s("String.prototype.includes",(function(e){return e||function(e,t){return-1!==U(this,e,"includes").indexOf(e,t||0)}})),s("String.fromCodePoint",(function(e){return e||function(e){for(var t="",n=0;n<arguments.length;n++){var i=Number(arguments[n]);if(0>i||1114111<i||i!==Math.floor(i))throw new RangeError("invalid_code_point "+i);65535>=i?t+=String.fromCharCode(i):(i-=65536,t+=String.fromCharCode(i>>>10&1023|55296),t+=String.fromCharCode(1023&i|56320))}return t}})),s("WeakSet",(function(e){function t(e){if(this.g=new WeakMap,e){e=l(e);for(var t;!(t=e.next()).done;)this.add(t.value)}}return function(){if(!e||!Object.seal)return!1;try{var t=Object.seal({}),n=Object.seal({}),i=new e([t]);return!(!i.has(t)||i.has(n))&&(i.delete(t),i.add(n),!i.has(t)&&i.has(n))}catch(e){return!1}}()?e:(t.prototype.add=function(e){return this.g.set(e,!0),this},t.prototype.has=function(e){return this.g.has(e)},t.prototype.delete=function(e){return this.g.delete(e)},t)})),s("Array.prototype.find",(function(e){return e||function(e,t){return O(this,e,t).v}})),s("String.prototype.startsWith",(function(e){return e||function(e,t){var n=U(this,e,"startsWith"),i=n.length,r=e.length;t=Math.max(0,Math.min(0|t,n.length));for(var a=0;a<r&&t<i;)if(n[t++]!=e[a++])return!1;return a>=r}})),s("Object.entries",(function(e){return e||function(e){var t,n=[];for(t in e)N(e,t)&&n.push([t,e[t]]);return n}}));var _="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var i=arguments[n];if(i)for(var r in i)N(i,r)&&(e[r]=i[r])}return e};s("Object.assign",(function(e){return e||_})),s("Promise.prototype.finally",(function(e){return e||function(e){return this.then((function(t){return Promise.resolve(e()).then((function(){return t}))}),(function(t){return Promise.resolve(e()).then((function(){throw t}))}))}})),s("Array.prototype.entries",(function(e){return e||function(){return j(this,(function(e,t){return[e,t]}))}})),s("Number.isNaN",(function(e){return e||function(e){return"number"==typeof e&&isNaN(e)}})),s("String.prototype.repeat",(function(e){return e||function(e){var t=U(this,null,"repeat");if(0>e||1342177279<e)throw new RangeError("Invalid count value");e|=0;for(var n="";e;)1&e&&(n+=t),(e>>>=1)&&(t+=t);return n}})),s("Number.EPSILON",(function(){return Math.pow(2,-52)})),s("Number.MAX_SAFE_INTEGER",(function(){return 9007199254740991})),s("Number.isFinite",(function(e){return e||function(e){return"number"==typeof e&&!isNaN(e)&&1/0!==e&&-1/0!==e}})),s("Object.values",(function(e){return e||function(e){var t,n=[];for(t in e)N(e,t)&&n.push(e[t]);return n}})),s("Math.log2",(function(e){return e||function(e){return Math.log(e)/Math.LN2}})),s("String.prototype.endsWith",(function(e){return e||function(e,t){var n=U(this,e,"endsWith");void 0===t&&(t=n.length),t=Math.max(0,Math.min(0|t,n.length));for(var i=e.length;0<i&&0<t;)if(n[--t]!=e[--i])return!1;return 0>=i}})),s("Math.trunc",(function(e){return e||function(e){if(e=Number(e),isNaN(e)||1/0===e||-1/0===e||0===e)return e;var t=Math.floor(Math.abs(e));return 0>e?-t:t}}));var B=this||self;function F(e,t){e=e.split(".");var n,i=B;e[0]in i||void 0===i.execScript||i.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?i=i[n]&&i[n]!==Object.prototype[n]?i[n]:i[n]={}:i[n]=t}function V(){}function H(){}function G(e){this.g=Math.exp(Math.log(.5)/e),this.i=this.h=0}function K(e){return e.h/(1-Math.pow(e.g,e.i))}function X(){this.h=new G(2),this.j=new G(5),this.g=0,this.i=128e3,this.l=16e3}function q(){}function z(){}function W(){}function Y(e){var t=L.apply(1,arguments);$.has(e)||($.add(e),W.apply(q,c(t)))}function J(){}G.prototype.sample=function(e,t){var n=Math.pow(this.g,e);t=t*(1-n)+n*this.h,isNaN(t)||(this.h=t,this.i+=e)},X.prototype.configure=function(e){this.i=e.minTotalBytes,this.l=e.minBytes,this.h.g=Math.exp(Math.log(.5)/e.fastHalfLife),this.j.g=Math.exp(Math.log(.5)/e.slowHalfLife)},X.prototype.sample=function(e,t){if(!(t<this.l)){var n=8e3*t/e;e/=1e3,this.g+=t,this.h.sample(e,n),this.j.sample(e,n)}},X.prototype.getBandwidthEstimate=function(e){return this.g<this.i?e:Math.min(K(this.h),K(this.j))};var $=new Set;function Q(){this.g={}}function Z(){this.g=new Q}function ee(e,t,n,i){this.target=e,this.type=t,this.listener=n,this.g=function(e,t){if(null==t)return!1;if("boolean"==typeof t)return t;var n=new Set(["passive","capture"]);return Object.keys(t).filter((function(e){return!n.has(e)})),function(e){var t=te;if(null==t){t=!1;try{var n={},i={get:function(){return t=!0,!1}};Object.defineProperty(n,"passive",i),Object.defineProperty(n,"capture",i),i=function(){},e.addEventListener("test",i,n),e.removeEventListener("test",i,n)}catch(e){t=!1}te=t}return t||!1}(e)?t:t.capture||!1}(e,i),this.target.addEventListener(t,n,this.g)}e.console&&(W=function(){return console.warn.apply(console,c(L.apply(0,arguments)))},z=function(){console.error.apply(console,c(L.apply(0,arguments)))}),(i=Q.prototype).push=function(e,t){this.g.hasOwnProperty(e)?this.g[e].push(t):this.g[e]=[t]},i.get=function(e){return(e=this.g[e])?e.slice():null},i.remove=function(e,t){e in this.g&&(this.g[e]=this.g[e].filter((function(e){return e!=t})),0==this.g[e].length&&delete this.g[e])},i.forEach=function(e){for(var t in this.g)e(t,this.g[t])},i.size=function(){return Object.keys(this.g).length},i.keys=function(){return Object.keys(this.g)},(i=Z.prototype).release=function(){this.Va(),this.g=null},i.D=function(e,t,n,i){this.g&&(e=new ee(e,t,n,i),this.g.push(t,e))},i.pa=function(e,t,n,i){var r=this;this.D(e,t,(function i(a){r.cb(e,t,i),n(a)}),i)},i.cb=function(e,t,n){if(this.g)for(var i=this.g.get(t)||[],r=(i=l(i)).next();!r.done;r=i.next())(r=r.value).target!=e||n!=r.listener&&n||(r.cb(),this.g.remove(t,r))},i.Va=function(){if(this.g){var e,t=this.g,n=[];for(e in t.g)n.push.apply(n,c(t.g[e]));for(n=(t=l(n)).next();!n.done;n=t.next())n.value.cb();this.g.g={}}},F("shaka.util.EventManager",Z),Z.prototype.removeAll=Z.prototype.Va,Z.prototype.unlisten=Z.prototype.cb,Z.prototype.listenOnce=Z.prototype.pa,Z.prototype.listen=Z.prototype.D,Z.prototype.release=Z.prototype.release,ee.prototype.cb=function(){this.target.removeEventListener(this.type,this.listener,this.g),this.listener=this.target=null,this.g=!1};var te=void 0;function ne(t){if(re.has(t))return re.get(t);var n=e.ManagedMediaSource||e.MediaSource;return!!n&&(n=n.isTypeSupported(t),re.set(t,n),n)}function ie(){var t=e.ManagedSourceBuffer||e.SourceBuffer;return!!t&&!!t.prototype&&!!t.prototype.changeType}var re=new Map;function ae(e,t){this.g=e,this.h=t}function oe(e,t){var n=new ae(5,0),i=le,r=i.g,a=n.h-r.h;(0<(n.g-r.g||a)?i.i:i.h)(i.g,n,e,t)}function se(e,t,n,i){W([n,"has been deprecated and will be removed in",t,". We are currently at version",e,". Additional information:",i].join(" "))}function ue(e,t,n,i){z([n,"has been deprecated and has been removed in",t,". We are now at version",e,". Additional information:",i].join(" "))}ae.prototype.toString=function(){return"v"+this.g+"."+this.h};var le=null;function ce(){}function de(){}function he(){}function fe(e,t){if(!e&&!t)return!0;if(!e||!t||e.byteLength!=t.byteLength)return!1;if((ArrayBuffer.isView(e)?e.buffer:e)==(ArrayBuffer.isView(t)?t.buffer:t)&&(e.byteOffset||0)==(t.byteOffset||0))return!0;var n=ge(e);t=ge(t);for(var i=0;i<e.byteLength;i++)if(n[i]!=t[i])return!1;return!0}function pe(e){return ArrayBuffer.isView(e)?0==e.byteOffset&&e.byteLength==e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer:e}function ge(e,t,n){return ye(e,void 0===t?0:t,n=void 0===n?1/0:n,Uint8Array)}function me(e,t,n){return ye(e,void 0===t?0:t,n=void 0===n?1/0:n,Uint16Array)}function ve(e,t,n){return ye(e,void 0===t?0:t,n=void 0===n?1/0:n,DataView)}function ye(e,t,n,i){var r=ArrayBuffer.isView(e)?e.buffer:e,a=1;"BYTES_PER_ELEMENT"in i&&(a=i.BYTES_PER_ELEMENT);var o=((e.byteOffset||0)+e.byteLength)/a;return new i(r,e=Math.floor(Math.max(0,Math.min(((e.byteOffset||0)+t)/a,o))),Math.floor(Math.min(e+Math.max(n,0),o))-e)}function be(){}function we(e){this.l=new de,(e=Te[e.toLowerCase()])&&(this.l=e()),this.h=new ce,(e=Se)&&(this.h=e())}ce.prototype.extract=function(){},ce.prototype.decode=function(){return[]},ce.prototype.clear=function(){},ce.prototype.getStreams=function(){return[]},de.prototype.init=function(){},de.prototype.parse=function(){return[]},F("shaka.util.BufferUtils",he),he.toDataView=ve,he.toUint16=me,he.toUint8=ge,he.toArrayBuffer=pe,he.equal=fe,be.prototype.init=function(){},be.prototype.i=function(){},be.prototype.g=function(){},be.prototype.j=function(){},F("shaka.media.IClosedCaptionParser",be),we.prototype.init=function(e,t){void 0!==t&&t||this.g(),this.l.init(e)},we.prototype.i=function(e){for(var t=(e=l(e=this.l.parse(e))).next();!t.done;t=e.next()){var n=ge((t=t.value).packet);0<n.length&&this.h.extract(n,t.pts)}return this.h.decode()},we.prototype.g=function(){this.h.clear()},we.prototype.j=function(){return this.h.getStreams()},F("shaka.media.ClosedCaptionParser",we),we.findDecoder=function(){return Se},we.unregisterDecoder=function(){Se=null},we.registerDecoder=function(e){Se=e},we.findParser=function(e){return Te[e]},we.unregisterParser=function(e){delete Te[e]},we.registerParser=function(e,t){Te[e]=t};var Te={},Se=null;function xe(){this.id="",this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0,this.height=this.width=100,this.viewportAnchorUnits=this.widthUnits=this.heightUnits=Ae,this.scroll=Ee}F("shaka.text.CueRegion",xe);var Ae=1;xe.units={PX:0,PERCENTAGE:Ae,LINES:2};var Ee="";function ke(e,t){return!("number"!=typeof e||"number"!=typeof t||!isNaN(e)||!isNaN(t))||e===t}function Ie(e,t){-1<(t=e.indexOf(t))&&e.splice(t,1)}function Me(e,t,n){if(n||(n=ke),e.length!=t.length)return!1;t=t.slice();for(var i=(e=l(e)).next(),r={};!i.done;r={Jg:void 0},i=e.next()){if(r.Jg=i.value,-1==(i=t.findIndex(function(e){return function(t){return n(e.Jg,t)}}(r))))return!1;t[i]=t[t.length-1],t.pop()}return 0==t.length}function Ce(e,t,n){if(n||(n=ke),e.length!=t.length)return!1;for(var i=0;i<e.length;i++)if(!n(e[i],t[i]))return!1;return!0}function De(e,t,n){var i=L.apply(3,arguments);if(this.severity=e,this.category=t,this.code=n,this.data=i,this.handled=!1,this.message="Shaka Error "+this.code,Re)try{throw Error(this.message||"Shaka Error")}catch(e){this.stack=e.stack}}xe.scrollMode={NONE:Ee,UP:"up"},De.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")},F("shaka.util.Error",De);var Re=!0;function Pe(e){this.h=e,this.g=void 0}function Le(e,t){return!e.length||!t.length||e===t||0<Ne(e,t).length}function Ne(e,t){if(!e.length)return t;if(!t.length)return e;for(var n=[],i=(e=l(e)).next();!i.done;i=e.next()){i=i.value;for(var r=l(t),a=r.next();!a.done;a=r.next())if(a=a.value,i.keySystem==a.keySystem){r=new Map;for(var o=l((i.initData||[]).concat(a.initData||[])),s=o.next();!s.done;s=o.next())s=s.value,r.set(s.keyId,s);r=Array.from(r.values()),o=i.keyIds&&a.keyIds?new Set([].concat(c(i.keyIds),c(a.keyIds))):i.keyIds||a.keyIds,n.push({keySystem:i.keySystem,licenseServerUri:i.licenseServerUri||a.licenseServerUri,distinctiveIdentifierRequired:i.distinctiveIdentifierRequired||a.distinctiveIdentifierRequired,persistentStateRequired:i.persistentStateRequired||a.persistentStateRequired,videoRobustness:i.videoRobustness||a.videoRobustness,audioRobustness:i.audioRobustness||a.audioRobustness,serverCertificate:i.serverCertificate||a.serverCertificate,serverCertificateUri:i.serverCertificateUri||a.serverCertificateUri,initData:r,keyIds:o});break}}return n}function je(e){return!!e&&!!e.match(/^com\.(microsoft|chromecast)\.playready/)}De.Severity={RECOVERABLE:1,CRITICAL:2},De.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9,ADS:10},De.Code={UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,ATTEMPTS_EXHAUSTED:1010,SEGMENT_MISSING:1011,INVALID_TEXT_HEADER:2e3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,UNABLE_TO_EXTRACT_CUE_START_TIME:2009,INVALID_MP4_CEA:2010,TEXT_COULD_NOT_GUESS_MIME_TYPE:2011,CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS:2012,TEXT_ONLY_WEBVTT_SRC_EQUALS:2013,MISSING_TEXT_PLUGIN:2014,CHAPTERS_TRACK_FAILED:2015,UNSUPPORTED_EXTERNAL_THUMBNAILS_URI:2017,BUFFER_READ_OUT_OF_BOUNDS:3e3,JS_INTEGER_OVERFLOW:3001,EBML_OVERFLOW:3002,EBML_BAD_FLOATING_POINT_SIZE:3003,MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005,MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,TRANSMUXING_FAILED:3018,CONTENT_TRANSFORMATION_FAILED:3019,MSS_MISSING_DATA_FOR_TRANSMUXING:3020,MSS_TRANSMUXING_FAILED:3022,TRANSMUXING_NO_VIDEO_DATA:3023,UNABLE_TO_GUESS_MANIFEST_TYPE:4e3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,DASH_WEBM_MISSING_INIT:4005,DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,RESTRICTIONS_CANNOT_BE_MET:4012,HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,DASH_UNSUPPORTED_XLINK_ACTUATE:4027,DASH_XLINK_DEPTH_LIMIT:4028,CONTENT_UNSUPPORTED_BY_BROWSER:4032,CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM:4033,NO_VARIANTS:4036,PERIOD_FLATTENING_FAILED:4037,INCONSISTENT_DRM_ACROSS_PERIODS:4038,HLS_VARIABLE_NOT_FOUND:4039,HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED:4040,HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED:4041,NO_WEB_CRYPTO_API:4042,CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_LIVE_STREAM:4045,MSS_INVALID_XML:4046,MSS_LIVE_CONTENT_NOT_SUPPORTED:4047,AES_128_INVALID_IV_LENGTH:4048,AES_128_INVALID_KEY_LENGTH:4049,DASH_CONFLICTING_AES_128:4050,DASH_UNSUPPORTED_AES_128:4051,DASH_INVALID_PATCH:4052,HLS_EMPTY_MEDIA_PLAYLIST:4053,DASH_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED:4054,STREAMING_ENGINE_STARTUP_INVALID_STATE:5006,NO_RECOGNIZED_KEY_SYSTEMS:6e3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,SERVER_CERTIFICATE_REQUIRED:6015,INIT_DATA_TRANSFORM_ERROR:6016,SERVER_CERTIFICATE_REQUEST_FAILED:6017,MIN_HDCP_VERSION_NOT_MATCH:6018,ERROR_CHECKING_HDCP_VERSION:6019,LOAD_INTERRUPTED:7e3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,OBJECT_DESTROYED:7003,CONTENT_NOT_LOADED:7004,SRC_EQUALS_PRELOAD_NOT_SUPPORTED:7005,CAST_API_UNAVAILABLE:8e3,NO_CAST_RECEIVERS:8001,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,STORAGE_NOT_SUPPORTED:9e3,INDEXED_DB_ERROR:9001,DEPRECATED_OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,NEW_KEY_OPERATION_NOT_SUPPORTED:9011,KEY_NOT_FOUND:9012,MISSING_STORAGE_CELL:9013,STORAGE_LIMIT_REACHED:9014,DOWNLOAD_SIZE_CALLBACK_ERROR:9015,MODIFY_OPERATION_NOT_SUPPORTED:9016,INDEXED_DB_INIT_TIMED_OUT:9017,CS_IMA_SDK_MISSING:1e4,CS_AD_MANAGER_NOT_INITIALIZED:10001,SS_IMA_SDK_MISSING:10002,SS_AD_MANAGER_NOT_INITIALIZED:10003,CURRENT_DAI_REQUEST_NOT_FINISHED:10004,MT_AD_MANAGER_NOT_INITIALIZED:10005,INTERSTITIAL_AD_MANAGER_NOT_INITIALIZED:10006,VAST_INVALID_XML:10007},Pe.prototype.value=function(){return null==this.g&&(this.g=this.h()),this.g};var Oe=new Pe((function(){return pe(new Uint8Array([0]))})),Ue=new Map;function _e(e){this.h=e,this.g=null}function Be(e){this.h=e,this.g=null}function Fe(){var t=e.ManagedMediaSource||e.MediaSource;return!(!t||!t.isTypeSupported)}function Ve(e){return""!=at().canPlayType(e)}function He(){return!!navigator.userAgent.match(/Edge?\//)}function Ge(){return rt("Xbox One")}function Ke(){return rt("Tizen")}function Xe(){return rt("Tizen 3")}function qe(){return rt("Web0S")}function ze(){return rt("CrKey")}function We(){if(!rt("Chrome")||navigator.userAgent.match(/Edge\//))return null;var e=navigator.userAgent.match(/Chrome\/(\d+)/);return e?parseInt(e[1],10):null}function Ye(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!Ke()&&!rt("PC=EOS")&&!rt("PC=APL")&&!rt("VirginMedia")&&!Ze()&&!$e()&&!rt("AFT")&&!rt("WPE")&&!rt("DT_STB_BCM")&&!rt("Sky_STB")}function Je(){return rt("PlayStation 5")}function $e(){return rt("PlayStation 4")}function Qe(){return rt("Hisense")||rt("VIDAA")}function Ze(){return rt("SOPOpenBrowser")}function et(){if(!Ye())return null;var e=navigator.userAgent.match(/Version\/(\d+)/);return e||(e=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(e[1],10):null}function tt(){return navigator.userAgentData&&navigator.userAgentData.platform?"windows"==navigator.userAgentData.platform.toLowerCase():!!navigator.platform&&navigator.platform.toLowerCase().includes("win32")}function nt(){return rt("Android")}function it(){return!!(Ke()||qe()||Ge()||$e()||Je()||rt("AFT")||rt("PC=EOS")||rt("PC=APL")||rt("VirginMedia")||Ze()||rt("WPE")||ze()||Qe()||rt("DT_STB_BCM"))}function rt(e){return(navigator.userAgent||"").includes(e)}function at(){return lt||(ut||(ut=new Be((function(){lt=null}))),(lt=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(lt=document.createElement("video")),ut.$(1),lt)}function ot(t){return t?t===e.shakaMediaKeysPolyfill:!!e.shakaMediaKeysPolyfill}function st(){var t,n,i,r,a,o,s,u,l,c,d,h,f;return P((function(p){switch(p.g){case 1:if(t={width:1/0,height:1/0},ze()){if(d=e.cast&&cast.__platform__&&cast.__platform__.canDisplayType,t.width=1280,t.height=720,S(p,14),!(h=d)){p.u(16);break}return w(p,cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160'),17)}if(Ke()){t.width=1920,t.height=1080;try{webapis.systeminfo&&webapis.systeminfo.getMaxVideoResolution?(n=webapis.systeminfo.getMaxVideoResolution(),t.width=n.width,t.height=n.height):webapis.productinfo.is8KPanelSupported&&webapis.productinfo.is8KPanelSupported()?(t.width=7680,t.height=4320):webapis.productinfo.isUdPanelSupported&&webapis.productinfo.isUdPanelSupported()&&(t.width=3840,t.height=2160)}catch(e){W("Tizen: Error detecting screen size, default screen size 1920x1080.")}p.u(3);break}if(qe()){try{i=JSON.parse(e.PalmSystem.deviceInfo),t.width=Math.max(1920,i.screenWidth),t.height=Math.max(1080,i.screenHeight)}catch(e){W("WebOS: Error detecting screen size, default screen size 1920x1080."),t.width=1920,t.height=1080}p.u(3);break}if(Qe()){e.Hisense_Get4KSupportState&&e.Hisense_Get4KSupportState()?(t.width=3840,t.height=2160):(t.width=1920,t.height=1080),p.u(3);break}if(!$e()&&!Je()){r=void 0;try{r="undefined"!=typeof Windows?Windows:chrome.webview.hostObjects.sync.Windows}catch(e){}if(r){t.width=1920,t.height=1080;try{a=new r.Media.Protection.ProtectionCapabilities,o=r.Media.Protection.ProtectionCapabilityResult,s=null;do{s=a.isTypeSupported('video/mp4;codecs="hvc1,mp4a";features="decode-res-x=3840,decode-res-y=2160,decode-bitrate=20000,decode-fps=30,decode-bpc=10,display-res-x=3840,display-res-y=2160,display-bpc=8"',"com.microsoft.playready.recommendation")}while(s===o.maybe);s===o.probably&&(t.width=3840,t.height=2160)}catch(e){W("Xbox: Error detecting screen size, default screen size 1920x1080.")}}else Ge()&&(t.width=1920,t.height=1080,W("Xbox: Error detecting screen size, default screen size 1920x1080."));p.u(3);break}return u=!1,S(p,8),w(p,e.msdk.device.getDisplayInfo(),10);case 10:l=p.h,u="4K"===l.resolution,A(p,9);break;case 8:return E(p),S(p,11),w(p,e.msdk.device.getDisplayInfoImmediate(),13);case 13:c=p.h,u="4K"===c.resolution,A(p,9);break;case 11:W("PlayStation: Failed to get the display info:",E(p));case 9:u?(t.width=3840,t.height=2160):(t.width=1920,t.height=1080),p.u(3);break;case 17:h=p.h;case 16:if(h){t.width=3840,t.height=2160,p.u(18);break}if(!(f=d)){p.u(19);break}return w(p,cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=1920; height=1080'),20);case 20:f=p.h;case 19:f&&(t.width=1920,t.height=1080);case 18:A(p,3);break;case 14:z("Failed to check canDisplayType:",E(p));case 3:return p.return(t)}}))}_e.prototype.$=function(t){var n=this;this.stop();var i=!0,r=null;return this.g=function(){e.clearTimeout(r),i=!1},r=e.setTimeout((function(){i&&n.h()}),1e3*t),this},_e.prototype.stop=function(){this.g&&(this.g(),this.g=null)},Be.prototype.hc=function(){return this.stop(),this.h(),this},Be.prototype.$=function(e){var t=this;return this.stop(),this.g=new _e((function(){t.h()})).$(e),this},Be.prototype.Ra=function(e){var t=this;return this.stop(),this.g=new _e((function(){t.g.$(e),t.h()})).$(e),this},Be.prototype.stop=function(){this.g&&(this.g.stop(),this.g=null)},F("shaka.util.Timer",Be),Be.prototype.stop=Be.prototype.stop,Be.prototype.tickEvery=Be.prototype.Ra,Be.prototype.tickAfter=Be.prototype.$,Be.prototype.tickNow=Be.prototype.hc;var ut=null,lt=null;function ct(){}function dt(t){if(!t)return"";if(239==(t=ge(t))[0]&&187==t[1]&&191==t[2]&&(t=t.subarray(3)),e.TextDecoder&&!$e())return(t=(new TextDecoder).decode(t)).includes("�")&&z('Decoded string contains an "unknown character" codepoint. That probably means the UTF8 encoding was incorrect!'),t;for(var n="",i=0;i<t.length;++i){var r=65533;if(128&t[i]?t.length>=i+2&&192==(224&t[i])&&128==(192&t[i+1])?(r=(31&t[i])<<6|63&t[i+1],i+=1):t.length>=i+3&&224==(240&t[i])&&128==(192&t[i+1])&&128==(192&t[i+2])?(r=(15&t[i])<<12|(63&t[i+1])<<6|63&t[i+2],i+=2):t.length>=i+4&&240==(241&t[i])&&128==(192&t[i+1])&&128==(192&t[i+2])&&128==(192&t[i+3])&&(r=(7&t[i])<<18|(63&t[i+1])<<12|(63&t[i+2])<<6|63&t[i+3],i+=3):r=t[i],65535>=r)n+=String.fromCharCode(r);else{var a=1023&(r-=65536);n+=String.fromCharCode(55296+(r>>10)),n+=String.fromCharCode(56320+a)}}return n}function ht(e,t,n){if(!e)return"";if(!n&&0!=e.byteLength%2)throw new De(2,2,2004);n=Math.floor(e.byteLength/2);var i=new Uint16Array(n);e=ve(e);for(var r=0;r<n;r++)i[r]=e.getUint16(2*r,t);return mt(i)}function ft(e){function t(e){return n.byteLength<=e||32<=n[e]&&126>=n[e]}if(!e)return"";var n=ge(e);if(239==n[0]&&187==n[1]&&191==n[2])return dt(n);if(254==n[0]&&255==n[1])return ht(n.subarray(2),!1);if(255==n[0]&&254==n[1])return ht(n.subarray(2),!0);if(0==n[0]&&0==n[2])return ht(e,!1);if(0==n[1]&&0==n[3])return ht(e,!0);if(t(0)&&t(1)&&t(2)&&t(3))return dt(e);throw new De(2,2,2003)}function pt(t){if(e.TextEncoder&&!$e()){var n=new TextEncoder;return pe(n.encode(t))}t=encodeURIComponent(t),t=unescape(t),n=new Uint8Array(t.length);for(var i=0;i<t.length;i++)n[i]=t[i].charCodeAt(0);return pe(n)}function gt(e,t){for(var n=new ArrayBuffer(2*e.length),i=new DataView(n),r=0;r<e.length;++r)i.setUint16(2*r,e.charCodeAt(r),t);return n}function mt(e){return yt.value()(e)}function vt(e){var t={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&apos;":"'","&nbsp;":" ","&lrm;":"‎","&rlm;":"‏"},n=/&(?:amp|lt|gt|quot|apos|nbsp|lrm|rlm|#[xX]?[0-9a-fA-F]+);/g,i=RegExp(n.source);return e&&i.test(e)?e.replace(n,(function(e){return"#"==e[1]?0<=(e="x"==e[2]||"X"==e[2]?parseInt(e.substring(3),16):parseInt(e.substring(2),10))&&1114111>=e?String.fromCodePoint(e):"":t[e]||"'"})):e||""}F("shaka.util.StringUtils",ct),ct.resetFromCharCode=function(){yt.g=void 0},ct.toUTF16=gt,ct.toUTF8=pt,ct.fromBytesAutoDetect=ft,ct.fromUTF16=ht,ct.fromUTF8=dt;var yt=new Pe((function(){function e(e){try{var t=new Uint8Array(e);return 0<String.fromCharCode.apply(null,t).length}catch(e){return!1}}for(var t={fc:65536};0<t.fc;(t={fc:t.fc}).fc/=2)if(e(t.fc))return function(e){return function(t){for(var n="",i=0;i<t.length;i+=e.fc)n+=String.fromCharCode.apply(null,t.subarray(i,i+e.fc));return n}}(t);return null}));function bt(e){this.h=e||"",this.g=0}function wt(e){Tt(e,/[ \t]+/gm)}function Tt(e,t){return t.lastIndex=e.g,t=null==(t=t.exec(e.h))?null:{position:t.index,length:t[0].length,results:t},e.g==e.h.length||null==t||t.position!=e.g?null:(e.g+=t.length,t.results)}function St(e){return e.g==e.h.length?null:(e=Tt(e,/[^ \t\n]*/gm))?e[0]:null}function xt(e){if(null==(e=Tt(e,Et)))return null;var t=Number(e[2]),n=Number(e[3]);return 59<t||59<n?null:(Number(e[6])||0)/1e3+n+60*t+3600*(Number(e[1])||0)}function At(e){return e?xt(new bt(e)):null}var Et=/(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;function kt(e){var t=new WeakSet;return function e(n){switch(typeof n){case"undefined":case"boolean":case"number":case"string":case"symbol":case"function":return n;default:if(!n||ArrayBuffer.isView(n))return n;if(t.has(n))return null;var i=n.constructor==Array;if(n.constructor!=Object&&!i)return null;t.add(n);var r,a=i?[]:{};for(r in n)a[r]=e(n[r]);return i&&(a.length=n.length),a}}(e)}function It(e){var t,n={};for(t in e)n[t]=e[t];return n}function Mt(e){if(Array.isArray(e)){for(var t=[],n=0;n<e.length;n++){var i=n.toString(),r=e[n];void 0!==r&&(r=Mt(r))&&t.push(i+":"+r)}e="["+t.join(",")+"]"}else if("function"==typeof e)e="";else if(e instanceof Object){for((n=Object.keys(e)).sort(),t=[],i=(n=l(n)).next();!i.done;i=n.next())r=i.value,i=JSON.stringify(r),void 0!==(r=e[r])&&(r=Mt(r))&&t.push(i+":"+r);e="{"+t.join(",")+"}"}else e=JSON.stringify(e);return e}function Ct(e,t){var n=void 0!==n&&n;return Dt(e=ft(e),t,n)}function Dt(e,t,n){return e=function(e,t){function n(){for(var t=i;-1==="\r\n\t>/= ".indexOf(e[i])&&e[i];)i++;return e.slice(t,i)}var i=0;return function r(a,o){o=void 0!==o&&o;for(var s=[];e[i];)if(60==e.charCodeAt(i)){if(47===e.charCodeAt(i+1)){o=i+2,i=e.indexOf(">",i);var u=(o=e.substring(o,i)).indexOf(a);if(-1==u){var l=a.indexOf(".");0<l&&(u=o.indexOf(a.substring(0,l)))}if(-1==u)throw a=e.substring(0,i).split("\n"),Error("Unexpected close tag\nLine: "+(a.length-1)+"\nColumn: "+(a[a.length-1].length+1)+"\nChar: "+e[i]);i+1&&(i+=1);break}if(33===e.charCodeAt(i+1)){if(45==e.charCodeAt(i+2)){for(;-1!==i&&(62!==e.charCodeAt(i)||45!=e.charCodeAt(i-1)||45!=e.charCodeAt(i-2)||-1==i);)i=e.indexOf(">",i+1);-1===i&&(i=e.length)}else if(91===e.charCodeAt(i+2)&&91===e.charCodeAt(i+8)&&"cdata"===e.substr(i+3,5).toLowerCase()){-1==(u=e.indexOf("]]>",i))?(s.push(e.substr(i+9)),i=e.length):(s.push(e.substring(i+9,u)),i=u+3);continue}i++;continue}e:{l=o,i++;var d=n(),h={};for(u=[];62!==e.charCodeAt(i)&&e[i];){var f=e.charCodeAt(i);if(64<f&&91>f||96<f&&123>f){f=n();for(var p=e.charCodeAt(i);p&&39!==p&&34!==p&&!(64<p&&91>p||96<p&&123>p)&&62!==p;)i++,p=e.charCodeAt(i);var g=i+1;if(i=e.indexOf(e[i],g),g=e.slice(g,i),39===p||34===p){if(-1===i){if(l={tagName:d,attributes:h,children:u,parent:null},t)for(d=0;d<u.length;d++)"string"!=typeof u[d]&&(u[d].parent=l);u=l;break e}}else g=null,i--;if(f.startsWith("xmlns:")){p=g;var m=f.split(":")[1];on.set(p,m),sn.set(m,p)}"tt"===d&&"xml:space"===f&&"preserve"===g&&(l=!0),h[f]=g}i++}for(47!==e.charCodeAt(i-1)?(i++,u=r(d,l)):i++,l={tagName:d,attributes:h,children:u,parent:null},d=u.length,h=0;h<d;h++)"string"!=typeof(f=u[h])?t&&(f.parent=l):h==d-1&&"\n"==f&&u.pop();u=l}if(s.push(u),"string"==typeof u)break;"?"===u.tagName[0]&&u.children&&(s.push.apply(s,c(u.children)),u.children=[])}else u=i,-2==(i=e.indexOf("<",i)-1)&&(i=e.length),u=e.slice(u,i+1),o?0<u.length&&s.push(u):(s.length&&1==u.length&&"\n"==u[0]||0<u.trim().length)&&s.push(u),i++;return s}("")}(e,void 0!==n&&n),!t&&e.length?e[0]:(e=e.find((function(e){return t.split(",").includes(e.tagName)})))?e:null}function Rt(e){return on.has(e)?on.get(e):""}function Pt(e){return"string"==typeof e}function Lt(e){var t=[];if(!e.children)return[];for(var n=(e=l(e.children)).next();!n.done;n=e.next())"string"!=typeof(n=n.value)&&t.push(n);return t}function Nt(e,t){var n=[];if(!e.children)return[];for(var i=(e=l(e.children)).next();!i.done;i=e.next())(i=i.value).tagName===t&&n.push(i);return n}function jt(e){return"string"==typeof e?vt(e):""===(e=e.children.reduce((function(e,t){return"string"==typeof t?e+t:e}),""))?null:vt(e)}function Ot(e){return Array.from(e.children).every((function(e){return"string"==typeof e}))?((e=jt(e))&&(e=e.trim()),e):null}function Ut(e,t,n){if(n=void 0===n?[]:n,e.tagName===t&&n.push(e),e.children)for(var i=(e=l(e.children)).next();!i.done;i=e.next())Ut(i.value,t,n);return n}function _t(e,t){return 1!=(e=Nt(e,t)).length?null:e[0]}function Bt(e,t,n){return 1!=(e=Ht(e,t,n)).length?null:e[0]}function Ft(e,t,n,i){i=void 0===i?null:i;var r=null;return null!=(e=e.attributes[t])&&(r=n(e)),null==r?i:r}function Vt(e,t,n){return t=Rt(t),e.attributes[t+":"+n]||null}function Ht(e,t,n){t=Rt(t);var i=[];if(e.children)for(var r=(e=l(e.children)).next();!r.done;r=e.next())(r=r.value)&&r.tagName===t+":"+n&&i.push(r);return i}function Gt(e,t,n){for(var i=(t=l(t)).next();!i.done;i=t.next())if(i=Vt(e,i.value,n))return i;return null}function Kt(e){return e?(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)&&(e+="Z"),e=Date.parse(e),isNaN(e)?null:e/1e3):null}function Xt(e){return e&&(e=RegExp("^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$").exec(e))?(e=31536e3*Number(e[1]||null)+2592e3*Number(e[2]||null)+86400*Number(e[3]||null)+3600*Number(e[4]||null)+60*Number(e[5]||null)+Number(e[6]||null),isFinite(e)?e:null):null}function qt(e){var t=/([0-9]+)-([0-9]+)/.exec(e);return t?(e=Number(t[1]),isFinite(e)?(t=Number(t[2]),isFinite(t)?{start:e,end:t}:null):null):null}function zt(e){return 0==(e=Number(e))%1?e:null}function Wt(e){return 0==(e=Number(e))%1&&0<e?e:null}function Yt(e){return 0==(e=Number(e))%1&&0<=e?e:null}function Jt(e){return e=Number(e),isNaN(e)?null:e}function $t(e){return!!e&&"true"===e.toLowerCase()}function Qt(e){var t,n=(t=e.match(/^(\d+)\/(\d+)$/))?Number(t[1])/Number(t[2]):Number(e);return isNaN(n)?null:n}function Zt(e){for(var t=[],n=(e=l(e=vt(e).split(/\/+(?=(?:[^'"]*['"][^'"]*['"])*[^'"]*$)/))).next();!n.done;n=e.next()){var i=(n=n.value).match(/^([\w]+)/);if(i){var r=n.match(/(@id='(.*?)')/),a=n.match(/(@t='(\d+)')/),o=n.match(/(@n='(\d+)')/),s=n.match(/\[(\d+)\]/);t.push({name:i[0],id:r?r[0].match(/'(.*?)'/)[0].replace(/'/gm,""):null,t:a?Number(a[0].match(/'(.*?)'/)[0].replace(/'/gm,"")):null,n:o?Number(o[0].match(/'(.*?)'/)[0].replace(/'/gm,"")):null,position:s?Number(s[1])-1:null,Ub:n.split("/@")[1]||null})}else n.startsWith("@")&&t.length&&(t[t.length-1].Ub=n.slice(1))}return t}function en(e,t){var n=Zt(t.attributes.sel||"");if(n.length){var i=n[n.length-1],r=t.attributes.pos||null;null==(n=i.position)&&(null!==i.t&&(n=tn(e,"t",i.t)),null!==i.n&&(n=tn(e,"n",i.n))),null===n?n="prepend"===r?0:e.length:"prepend"===r?--n:"after"===r&&++n,r=t.tagName,(i=i.Ub)&&e[n]?nn(e[n],r,i,Ot(t)||""):("remove"!==r&&"replace"!==r||e.splice(n,1),"add"!==r&&"replace"!==r||e.splice.apply(e,[n,0].concat(c(t.children))))}}function tn(e,t,n){for(var i=0,r=(e=l(e)).next();!r.done;r=e.next()){if(Number(r.value.attributes[t])===n)return i;i++}return null}function nn(e,t,n,i){"remove"===t?delete e.attributes[n]:"add"!==t&&"replace"!==t||(e.attributes[n]=i)}function rn(e){var t="",n=e.tagName.split(":");for(var i in 0<n.length&&(t=n[0],t=sn.has(t)?sn.get(t):""),t=document.createElementNS(t,e.tagName),e.attributes)t.setAttribute(i,e.attributes[i]);for(i=(e=l(e.children)).next();!i.done;i=e.next())n=void 0,n="string"==typeof(i=i.value)?new Text(i):rn(i),t.appendChild(n);return t}function an(e){if(!e)return null;for(var t={tagName:e.tagName,attributes:It(e.attributes),children:[],parent:null},n=(e=l(e.children)).next();!n.done;n=e.next())"string"==typeof(n=n.value)||((n=an(n)).parent=t),t.children.push(n);return t}var on=new Map,sn=new Map;function un(e,t,n){this.startTime=e,this.endTime=t,this.payload=n,this.region=new xe,this.position=null,this.positionAlign=gn,this.size=0,this.textAlign=mn,this.direction=wn,this.writingMode=Tn,this.lineInterpretation=Sn,this.line=null,this.lineHeight="",this.lineAlign=xn,this.displayAlign=yn,this.fontSize=this.border=this.backgroundImage=this.backgroundColor=this.color="",this.fontWeight=In,this.fontStyle=Cn,this.linePadding=this.letterSpacing=this.fontFamily="",this.opacity=1,this.textCombineUpright="",this.textDecoration=[],this.textStrokeWidth=this.textStrokeColor=this.textShadow="",this.wrapLine=!0,this.id="",this.nestedCues=[],this.lineBreak=this.isContainer=!1,this.rubyTag=null,this.cellResolution={lc:32,rows:15}}function ln(e,t){return(e=new un(e,t,"")).lineBreak=!0,e}function cn(e,t){if(e.startTime!=t.startTime||e.endTime!=t.endTime||e.payload!=t.payload)return!1;for(var n in e)if("startTime"!=n&&"endTime"!=n&&"payload"!=n)if("nestedCues"==n){if(!Ce(e.nestedCues,t.nestedCues,cn))return!1}else if("region"==n||"cellResolution"==n){for(var i in e[n])if(e[n][i]!=t[n][i])return!1}else if(Array.isArray(e[n])){if(!Ce(e[n],t[n]))return!1}else if(e[n]!=t[n])return!1;return!0}function dn(e,t){t=void 0===t?new Map:t;var n=e.payload;if(n.includes("<")){0===t.size&&hn(t);var i=n;n=[];for(var r=-1,a=0;a<i.length;a++)"<"===i[a]?r=a+1:">"===i[a]&&0<r&&((r=i.substr(r,a-r)).match(Ln)&&n.push(r),r=-1);for(a=(n=l(n)).next();!a.done;a=n.next())a=a.value,i=i.replace("<"+a+">",'<div time="'+a+'">'),i+="</div>";e:{a=i,r=[];var o=-1;n="",i=!1;for(var s=0;s<a.length;s++)if("/"===a[s]){var u=a.indexOf(">",s);if(-1===u){n=a;break e}if((u=a.substring(s+1,u))&&"v"==u){i=!0;var c=null;if(r.length&&(c=r[r.length-1]),c){if(c===u)n+="/"+u+">";else{if(!c.startsWith("v")){n+=a[s];continue}n+="/"+c+">"}s+=u.length+1}else n+=a[s]}else n+=a[s]}else"<"===a[s]?"v"!=a[o=s+1]&&(o=-1):">"===a[s]&&0<o&&(r.push(a.substr(o,s-o)),o=-1),n+=a[s];for(r=(a=l(r)).next();!r.done;r=a.next())o=(r=r.value).replace(" ",".voice-"),n=(n=n.replace("<"+r+">","<"+o+">")).replace("</"+r+">","</"+o+">"),i||(n+="</"+o+">")}n=function(e){var t={"< ":""," >":" &gt;"},n=/(< +>|<\s|\s>)/g,i=RegExp(n.source);return e&&i.test(e)?e.replace(n,(function(e){return t[e]||""})):e||""}(n),e.payload="";try{var d=Dt("<span>"+n+"</span>","span")}catch(e){}if(d)if(1!=(d=d.children).length||d[0].tagName)for(n=(d=l(d)).next();!n.done;n=d.next())fn(n.value,e,t);else e.payload=vt(n);else e.payload=vt(n)}else e.payload=vt(n)}function hn(e){for(var t=l(Object.entries(En)),n=t.next();!n.done;n=t.next()){var i=l(n.value);n=i.next().value,i=i.next().value;var r=new un(0,0,"");r.color=i,e.set("."+n,r)}for(n=(t=l(Object.entries(kn))).next();!n.done;n=t.next())n=(i=l(n.value)).next().value,i=i.next().value,(r=new un(0,0,"")).backgroundColor=i,e.set("."+n,r)}function fn(e,t,n){var i=t.clone();if(i.nestedCues=[],i.payload="",i.rubyTag="",i.line=null,i.region=new xe,i.position=null,i.size=0,i.textAlign=mn,e.tagName)for(var r=l(e.tagName.split(/(?=[ .])+/g)),a=r.next();!a.done;a=r.next()){var o=a=a.value;if(o.startsWith(".voice-")){var s=o.split("-").pop();o='v[voice="'+s+'"]',n.has(o)||(o="v[voice="+s+"]")}switch(n.has(o)&&(s=i,o=n.get(o))&&(s.backgroundColor=pn(o.backgroundColor,s.backgroundColor),s.color=pn(o.color,s.color),s.fontFamily=pn(o.fontFamily,s.fontFamily),s.fontSize=pn(o.fontSize,s.fontSize),s.textShadow=pn(o.textShadow,s.textShadow),s.fontWeight=o.fontWeight,s.fontStyle=o.fontStyle,s.opacity=o.opacity,s.rubyTag=o.rubyTag,s.textCombineUpright=o.textCombineUpright,s.wrapLine=o.wrapLine),a){case"br":return i=ln(i.startTime,i.endTime),void t.nestedCues.push(i);case"b":i.fontWeight=Mn;break;case"i":i.fontStyle=Dn;break;case"u":i.textDecoration.push(Pn);break;case"font":(a=e.attributes.color)&&(i.color=a);break;case"div":if(!(a=e.attributes.time))break;(a=At(a))&&(i.startTime=a);break;case"ruby":case"rp":case"rt":i.rubyTag=a}}if(r=e.children,Pt(e)||1==r.length&&Pt(r[0]))for(n=jt(e).split("\n"),e=!0,r=(n=l(n)).next();!r.done;r=n.next())r=r.value,e||(e=ln(i.startTime,i.endTime),t.nestedCues.push(e)),0<r.length&&((e=i.clone()).payload=vt(r),t.nestedCues.push(e)),e=!1;else for(t.nestedCues.push(i),e=(t=l(r)).next();!e.done;e=t.next())fn(e.value,i,n)}function pn(e,t){return e&&0<e.length?e:t}un.prototype.clone=function(){var e,t=new un(0,0,"");for(e in this)t[e]=this[e],t[e]&&t[e].constructor==Array&&(t[e]=t[e].slice());return t},F("shaka.text.Cue",un),un.parseCuePayload=dn,un.equal=cn,un.prototype.clone=un.prototype.clone;var gn="auto";un.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:gn};var mn="center",vn={LEFT:"left",RIGHT:"right",CENTER:mn,START:"start",END:"end"};un.textAlign=vn;var yn="after",bn={BEFORE:"before",CENTER:"center",AFTER:yn};un.displayAlign=bn;var wn="ltr";un.direction={HORIZONTAL_LEFT_TO_RIGHT:wn,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var Tn="horizontal-tb";un.writingMode={HORIZONTAL_TOP_TO_BOTTOM:Tn,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};var Sn=0;un.lineInterpretation={LINE_NUMBER:Sn,PERCENTAGE:1};var xn="start",An={CENTER:"center",START:xn,END:"end"};un.lineAlign=An;var En={white:"white",lime:"lime",cyan:"cyan",red:"red",yellow:"yellow",magenta:"magenta",blue:"blue",black:"black"};un.defaultTextColor=En;var kn={bg_white:"white",bg_lime:"lime",bg_cyan:"cyan",bg_red:"red",bg_yellow:"yellow",bg_magenta:"magenta",bg_blue:"blue",bg_black:"black"};un.defaultTextBackgroundColor=kn;var In=400,Mn=700;un.fontWeight={NORMAL:In,BOLD:Mn};var Cn="normal",Dn="italic",Rn={NORMAL:Cn,ITALIC:Dn,OBLIQUE:"oblique"};un.fontStyle=Rn;var Pn="underline";un.textDecoration={UNDERLINE:Pn,LINE_THROUGH:"lineThrough",OVERLINE:"overline"};var Ln=/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g;function Nn(){}function jn(e,t,n){Un[e.toLowerCase().split(";")[0]+"-"+n]={priority:n,he:t}}function On(e,t){for(var n=e.toLowerCase().split(";")[0],i=l([Vn,Fn,Bn,_n]),r=i.next();!r.done;r=i.next())if(r=Un[n+"-"+r.value]){var a=r.he(),o=a.isSupported(e,t);if(a.destroy(),o)return r.he}return null}Nn.prototype.destroy=function(){},F("shaka.transmuxer.TransmuxerEngine",Nn),Nn.findTransmuxer=On,Nn.unregisterTransmuxer=function(e,t){delete Un[e.toLowerCase().split(";")[0]+"-"+t]},Nn.registerTransmuxer=jn,Nn.prototype.destroy=Nn.prototype.destroy;var Un={},_n=1,Bn=2,Fn=3,Vn=4;Nn.PluginPriority={FALLBACK:_n,PREFERRED_SECONDARY:Bn,PREFERRED:Fn,APPLICATION:Vn};var Hn=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");function Gn(e){var t;e instanceof Gn?(Kn(this,e.Db),this.Cc=e.Cc,Xn(this,e.Fb),qn(this,e.Uc),this.Ua=e.Ua,zn(this,e.g.clone()),this.mc=e.mc):e&&(t=String(e).match(Hn))?(Kn(this,t[1]||"",!0),this.Cc=Wn(t[2]||""),Xn(this,t[3]||"",!0),qn(this,t[4]),this.Ua=Wn(t[5]||"",!0),zn(this,t[6]||"",!0),this.mc=Wn(t[7]||"")):this.g=new ni(null)}function Kn(e,t,n){e.Db=n?Wn(t,!0):t,e.Db&&(e.Db=e.Db.replace(/:$/,""))}function Xn(e,t,n){e.Fb=n?Wn(t,!0):t}function qn(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.Uc=t}else e.Uc=null}function zn(e,t,n){t instanceof ni?e.g=t:(n||(t=Yn(t,ei)),e.g=new ni(t))}function Wn(e,t){return e?t?decodeURI(e):decodeURIComponent(e):""}function Yn(e,t,n){return null!=e?(e=encodeURI(e).replace(t,Jn),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function Jn(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}(i=Gn.prototype).Db="",i.Cc="",i.Fb="",i.Uc=null,i.Ua="",i.mc="",i.toString=function(){var e=[],t=this.Db;if(t&&e.push(Yn(t,$n,!0),":"),t=this.Fb){e.push("//");var n=this.Cc;n&&e.push(Yn(n,$n,!0),"@"),e.push(encodeURIComponent(t).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(t=this.Uc)&&e.push(":",String(t))}return(t=this.Ua)&&(this.Fb&&"/"!=t.charAt(0)&&e.push("/"),e.push(Yn(t,"/"==t.charAt(0)?Zn:Qn,!0))),(t=this.g.toString())&&e.push("?",t),(t=this.mc)&&e.push("#",Yn(t,ti)),e.join("")},i.resolve=function(e){var t=this.clone();"data"===t.Db&&(t=new Gn);var n=!!e.Db;n?Kn(t,e.Db):n=!!e.Cc,n?t.Cc=e.Cc:n=!!e.Fb,n?Xn(t,e.Fb):n=null!=e.Uc;var i=e.Ua;if(n)qn(t,e.Uc);else if(n=!!e.Ua){if("/"!=i.charAt(0))if(this.Fb&&!this.Ua)i="/"+i;else{var r=t.Ua.lastIndexOf("/");-1!=r&&(i=t.Ua.substr(0,r+1)+i)}if(".."==i||"."==i)i="";else if(-1!=i.indexOf("./")||-1!=i.indexOf("/.")){r=0==i.lastIndexOf("/",0),i=i.split("/");for(var a=[],o=0;o<i.length;){var s=i[o++];"."==s?r&&o==i.length&&a.push(""):".."==s?((1<a.length||1==a.length&&""!=a[0])&&a.pop(),r&&o==i.length&&a.push("")):(a.push(s),r=!0)}i=a.join("/")}}return n?t.Ua=i:n=""!==e.g.toString(),n?zn(t,e.g.clone()):n=!!e.mc,n&&(t.mc=e.mc),t},i.clone=function(){return new Gn(this)};var $n=/[#\/\?@]/g,Qn=/[#\?:]/g,Zn=/[#\?]/g,ei=/[#\?@]/g,ti=/#/g;function ni(e){this.g=e||null}function ii(e){if(!e.Pa&&(e.Pa={},e.dd=0,e.g))for(var t=e.g.split("&"),n=0;n<t.length;n++){var i=t[n].indexOf("="),r=null;if(0<=i){var a=t[n].substring(0,i);r=t[n].substring(i+1)}else a=t[n];a=decodeURIComponent(a.replace(/\+/g," ")),r=r||"",e.add(a,decodeURIComponent(r.replace(/\+/g," ")))}}function ri(e){return ii(e),e.dd}function ai(){}function oi(e){return e=mt(ge(e)),btoa(e)}function si(e,t){return t=null==t||t,e=oi(e).replace(/\+/g,"-").replace(/\//g,"_"),t?e:e.replace(/[=]*$/,"")}function ui(t){t=e.atob(t.replace(/-/g,"+").replace(/_/g,"/"));for(var n=new Uint8Array(t.length),i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}function li(t){for(var n=t.length/2,i=new Uint8Array(n),r=0;r<n;r++)i[r]=e.parseInt(t.substr(2*r,2),16);return i}function ci(e){var t=ge(e);e="";for(var n=(t=l(t)).next();!n.done;n=t.next())1==(n=(n=n.value).toString(16)).length&&(n="0"+n),e+=n;return e}function di(){for(var e=L.apply(0,arguments),t=0,n=0;n<e.length;++n)t+=e[n].byteLength;t=new Uint8Array(t);for(var i=n=0;i<e.length;++i){var r=e[i];ArrayBuffer.isView(r)&&1===r.BYTES_PER_ELEMENT?t.set(r,n):t.set(ge(r),n),n+=r.byteLength}return t}function hi(e,t,n){if(n=void 0===n?"":n,0==t.length)return e;if(1==e.length&&1==t.length){var i=new Gn(e[0]);return t=new Gn(t[0]),t=i.resolve(t),n&&zn(t,n),[t.toString()]}t=t.map((function(e){return new Gn(e)})),i=[];for(var r=(e=l(e)).next();!r.done;r=e.next()){r=new Gn(r.value);for(var a=l(t),o=a.next();!o.done;o=a.next())o=r.resolve(o.value),n&&zn(o,n),i.push(o.toString())}return i}function fi(e,t,n,i){return e={keySystem:e,encryptionScheme:t,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:n||[],keyIds:new Set},i&&(e.keySystemUris=new Set([i])),e}function pi(t,n){n=void 0===n?"cenc":n;var i=[],r=[],a=[];t.forEach((function(e,t){var n=t;22!=n.length&&(n=si(li(t),!1));var o=e;22!=o.length&&(o=si(li(e),!1)),e={kty:"oct",kid:n,k:o},i.push(e),r.push(e.kid),a.push(t)})),t=JSON.stringify({keys:i});var o=JSON.stringify({kids:r});return o=[{initData:ge(pt(o)),initDataType:"keyids"}],{keySystem:"org.w3.clearkey",encryptionScheme:n,licenseServerUri:"data:application/json;base64,"+e.btoa(t),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:o,keyIds:new Set(a)}}function gi(e,t){if(1==t.length)return t[0];if(null!=(e=mi(e,t)))return e;throw new De(2,4,4025,t)}function mi(e,t){for(var n=l(Ti[e]),i=n.next();!i.done;i=n.next()){i=i.value;for(var r=l(t),a=r.next();!a.done;a=r.next())if(a=a.value,i.test(a.trim()))return a.trim()}return e==yi?"":null}function vi(e,t){for(var n=[],i=(e=l(Ti[e])).next();!i.done;i=e.next()){i=i.value;for(var r=l(t),a=r.next();!a.done;a=r.next())a=a.value,i.test(a.trim())&&n.push(a.trim())}return n}(i=ni.prototype).Pa=null,i.dd=null,i.add=function(e,t){ii(this),this.g=null;var n=this.Pa.hasOwnProperty(e)?this.Pa[e]:null;return n||(this.Pa[e]=n=[]),n.push(t),this.dd++,this},i.set=function(e,t){return ii(this),this.g=null,this.Pa.hasOwnProperty(e)?this.Pa[e]=[t]:this.add(e,t),this},i.get=function(e){return ii(this),this.Pa[e]||[]},i.toString=function(){if(this.g)return this.g;if(!this.Pa)return"";var e,t=[];for(e in this.Pa)for(var n=encodeURIComponent(e),i=this.Pa[e],r=0;r<i.length;r++){var a=n;""!==i[r]&&(a+="="+encodeURIComponent(i[r])),t.push(a)}return this.g=t.join("&")},i.clone=function(){var e=new ni;if(e.g=this.g,this.Pa){var t,n={};for(t in this.Pa)n[t]=this.Pa[t].concat();e.Pa=n,e.dd=this.dd}return e},F("shaka.util.Uint8ArrayUtils",ai),ai.concat=di,ai.toHex=ci,ai.fromHex=li,ai.fromBase64=ui,ai.toBase64=si,ai.toStandardBase64=oi;var yi="text",bi={la:"video",V:"audio",wa:yi,He:"image",kj:"application"},wi=1/15,Ti={audio:[/^vorbis$/,/^Opus$/,/^opus$/,/^fLaC$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4/,/^dts[cex]$/,/^iamf/,/^mhm[12]/],video:[/^avc/,/^hev/,/^hvc/,/^vvc/,/^vvi/,/^vp0?[89]/,/^av01/,/^dvh/,/^dva/,/^dav/],text:[/^vtt$/,/^wvtt/,/^stpp/]};function Si(){}function xi(e,t){var n=e;return t&&!ji.includes(e)&&(n+='; codecs="'+t+'"'),n}function Ai(e,t){return t&&(e+='; codecs="'+t+'"'),e}function Ei(e,t,n){var i=xi(e,t);return On(t=Ai(e,t))?(e=On(t))?(n=(e=e()).convertCodecs(n,t),e.destroy()):n=t:n="video/mp2t"!=e&&"audio"==n?i.replace("video","audio"):i,n}function ki(e,t,n){var i=[t];return Ni.forEach((function(t,r){var a=e[r];"codecs"==r?ji.includes(e.mimeType)||i.push('codecs="'+n+'"'):a&&i.push(t+'="'+a+'"')})),"PQ"==e.hdr&&i.push('eotf="smpte2084"'),i.join(";")}function Ii(e){return e.split(";")[0].split("/")[1]}function Mi(e){var t=Li(e);switch(e=t[0],t=t[1].toLowerCase(),!0){case"mp4a"===e&&"69"===t:case"mp4a"===e&&"6b"===t:case"mp4a"===e&&"40.34"===t:return"mp3";case"mp4a"===e&&"66"===t:case"mp4a"===e&&"67"===t:case"mp4a"===e&&"68"===t:case"mp4a"===e&&"40.2"===t:case"mp4a"===e&&"40.02"===t:case"mp4a"===e&&"40.5"===t:case"mp4a"===e&&"40.05"===t:case"mp4a"===e&&"40.29"===t:case"mp4a"===e&&"40.42"===t:return"aac";case"mp4a"===e&&"a5"===t:return"ac-3";case"mp4a"===e&&"a6"===t:return"ec-3";case"mp4a"===e&&"b2"===t:return"dtsx";case"mp4a"===e&&"a9"===t:return"dtsc";case"vp09"===e:return"vp9";case"avc1"===e:case"avc3"===e:return"avc";case"hvc1"===e:case"hev1"===e:return"hevc";case"vvc1"===e:case"vvi1"===e:return"vvc";case"dvh1"===e:case"dvhe"===e:return t&&t.startsWith("05")?"dovi-p5":"dovi-hevc";case"dvav"===e:case"dva1"===e:return"dovi-avc";case"dav1"===e:return"dovi-av1";case"dvc1"===e:case"dvi1"===e:return"dovi-vvc"}return e}function Ci(e){for(var t=[],n=(e=l(e.split(","))).next();!n.done;n=e.next())n=Li(n.value),t.push(n[0]);return t.sort().join(",")}function Di(e){return e.split(";")[0]}function Ri(e){return(e=e.split(/ *; */)).shift(),(e=e.find((function(e){return e.startsWith("codecs=")})))?e.split("=")[1].replace(/^"|"$/g,""):""}function Pi(e){return"application/x-mpegurl"===e||"application/vnd.apple.mpegurl"===e}function Li(e){var t=(e=e.split("."))[0];return e.shift(),[t,e.join(".")]}F("shaka.util.MimeUtils",Si),Si.getFullTypeWithAllCodecs=Ai,Si.getFullType=xi;var Ni=(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels"),ji=["audio/aac","audio/ac3","audio/ec3","audio/mpeg"];function Oi(e){this.i=null,this.j=e,this.B=!1,this.l=this.s=0,this.m=1/0,this.h=this.g=null,this.C="",this.A=function(){},this.o=new Map}function Ui(e){return!!Fi[e]||("application/cea-608"==e||"application/cea-708"==e)&&!!Se}function _i(e,t,n){if(e.C=t,t=e.o.get(t))for(var i=l(t.keys()),r=i.next();!r.done;r=i.next())(r=t.get(r.value).filter((function(e){return e.endTime<=n})))&&e.j.append(r)}function Bi(e,t,n){t.startTime+=n,t.endTime+=n;for(var i=(t=l(t.nestedCues)).next();!i.done;i=t.next())Bi(e,i.value,n)}Oi.prototype.destroy=function(){return this.j=this.i=null,this.o.clear(),Promise.resolve()},Oi.prototype.remove=function(e,t){var n=this;return P((function(i){if(1==i.g)return w(i,Promise.resolve(),2);!n.j||!n.j.remove(e,t)||null==n.g||t<=n.g||e>=n.h||(e<=n.g&&t>=n.h?n.g=n.h=null:e<=n.g&&t<n.h?n.g=t:e>n.g&&t>=n.h&&(n.h=e)),T(i)}))},F("shaka.text.TextEngine",Oi),Oi.prototype.destroy=Oi.prototype.destroy,Oi.findParser=function(e){return Fi[e]},Oi.unregisterParser=function(e){delete Fi[e]},Oi.registerParser=function(e,t){Fi[e]=t};var Fi={};function Vi(e,t){return e.concat(t)}function Hi(){}function Gi(e){return null!=e}function Ki(e,t){return Promise.race([t,new Promise((function(t,n){new Be(n).$(e)}))])}function Xi(){}function qi(e,t){return e=Yi(e),t=Yi(t),e.split("-")[0]==t.split("-")[0]}function zi(e,t){return e=Yi(e),t=Yi(t),e=e.split("-"),t=t.split("-"),e[0]==t[0]&&1==e.length&&2==t.length}function Wi(e,t){return e=Yi(e),t=Yi(t),e=e.split("-"),t=t.split("-"),2==e.length&&2==t.length&&e[0]==t[0]}function Yi(e){var t=(e=l(e.split("-x-"))).next().value;t=void 0===t?"":t,e=void 0===(e=e.next().value)?"":e;var n=l(t.split("-"));return t=void 0===(t=n.next().value)?"":t,n=void 0===(n=n.next().value)?"":n,e=e?"x-"+e:"",t=t.toLowerCase(),t=er.get(t)||t,((n=n.toUpperCase())?t+"-"+n:t)+(e?"-"+e:"")}function Ji(e,t){return e=Yi(e),(t=Yi(t))==e?4:zi(t,e)?3:Wi(t,e)?2:zi(e,t)?1:0}function $i(e){var t=e.indexOf("-");return e=(e=0<=t?e.substring(0,t):e).toLowerCase(),er.get(e)||e}function Qi(e){return e.language?Yi(e.language):e.audio&&e.audio.language?Yi(e.audio.language):e.video&&e.video.language?Yi(e.video.language):"und"}function Zi(e,t){e=Yi(e);for(var n=new Set,i=(t=l(t)).next();!i.done;i=t.next())n.add(Yi(i.value));for(i=(t=l(n)).next();!i.done;i=t.next())if((i=i.value)==e)return i;for(i=(t=l(n)).next();!i.done;i=t.next())if(zi(i=i.value,e))return i;for(i=(t=l(n)).next();!i.done;i=t.next())if(Wi(i=i.value,e))return i;for(t=(n=l(n)).next();!t.done;t=n.next())if(zi(e,t=t.value))return t;return null}F("shaka.util.LanguageUtils",Xi),Xi.findClosestLocale=Zi,Xi.getLocaleForVariant=Qi,Xi.getLocaleForText=function(e){return Yi(e.language||"und")},Xi.getBase=$i,Xi.relatedness=Ji,Xi.areSiblings=function(e,t){var n=$i(e),i=$i(t);return e!=n&&t!=i&&n==i},Xi.normalize=Yi,Xi.isSiblingOf=Wi,Xi.isParentOf=zi,Xi.areLanguageCompatible=qi,Xi.areLocaleCompatible=function(e,t){return(e=Yi(e))==Yi(t)};var er=new Map([["aar","aa"],["abk","ab"],["afr","af"],["aka","ak"],["alb","sq"],["amh","am"],["ara","ar"],["arg","an"],["arm","hy"],["asm","as"],["ava","av"],["ave","ae"],["aym","ay"],["aze","az"],["bak","ba"],["bam","bm"],["baq","eu"],["bel","be"],["ben","bn"],["bih","bh"],["bis","bi"],["bod","bo"],["bos","bs"],["bre","br"],["bul","bg"],["bur","my"],["cat","ca"],["ces","cs"],["cha","ch"],["che","ce"],["chi","zh"],["chu","cu"],["chv","cv"],["cor","kw"],["cos","co"],["cre","cr"],["cym","cy"],["cze","cs"],["dan","da"],["deu","de"],["div","dv"],["dut","nl"],["dzo","dz"],["ell","el"],["eng","en"],["epo","eo"],["est","et"],["eus","eu"],["ewe","ee"],["fao","fo"],["fas","fa"],["fij","fj"],["fin","fi"],["fra","fr"],["fre","fr"],["fry","fy"],["ful","ff"],["geo","ka"],["ger","de"],["gla","gd"],["gle","ga"],["glg","gl"],["glv","gv"],["gre","el"],["grn","gn"],["guj","gu"],["hat","ht"],["hau","ha"],["heb","he"],["her","hz"],["hin","hi"],["hmo","ho"],["hrv","hr"],["hun","hu"],["hye","hy"],["ibo","ig"],["ice","is"],["ido","io"],["iii","ii"],["iku","iu"],["ile","ie"],["ina","ia"],["ind","id"],["ipk","ik"],["isl","is"],["ita","it"],["jav","jv"],["jpn","ja"],["kal","kl"],["kan","kn"],["kas","ks"],["kat","ka"],["kau","kr"],["kaz","kk"],["khm","km"],["kik","ki"],["kin","rw"],["kir","ky"],["kom","kv"],["kon","kg"],["kor","ko"],["kua","kj"],["kur","ku"],["lao","lo"],["lat","la"],["lav","lv"],["lim","li"],["lin","ln"],["lit","lt"],["ltz","lb"],["lub","lu"],["lug","lg"],["mac","mk"],["mah","mh"],["mal","ml"],["mao","mi"],["mar","mr"],["may","ms"],["mkd","mk"],["mlg","mg"],["mlt","mt"],["mon","mn"],["mri","mi"],["msa","ms"],["mya","my"],["nau","na"],["nav","nv"],["nbl","nr"],["nde","nd"],["ndo","ng"],["nep","ne"],["nld","nl"],["nno","nn"],["nob","nb"],["nor","no"],["nya","ny"],["oci","oc"],["oji","oj"],["ori","or"],["orm","om"],["oss","os"],["pan","pa"],["per","fa"],["pli","pi"],["pol","pl"],["por","pt"],["pus","ps"],["que","qu"],["roh","rm"],["ron","ro"],["rum","ro"],["run","rn"],["rus","ru"],["sag","sg"],["san","sa"],["sin","si"],["slk","sk"],["slo","sk"],["slv","sl"],["sme","se"],["smo","sm"],["sna","sn"],["snd","sd"],["som","so"],["sot","st"],["spa","es"],["sqi","sq"],["srd","sc"],["srp","sr"],["ssw","ss"],["sun","su"],["swa","sw"],["swe","sv"],["tah","ty"],["tam","ta"],["tat","tt"],["tel","te"],["tgk","tg"],["tgl","tl"],["tha","th"],["tib","bo"],["tir","ti"],["ton","to"],["tsn","tn"],["tso","ts"],["tuk","tk"],["tur","tr"],["twi","tw"],["uig","ug"],["ukr","uk"],["urd","ur"],["uzb","uz"],["ven","ve"],["vie","vi"],["vol","vo"],["wel","cy"],["wln","wa"],["wol","wo"],["xho","xh"],["yid","yi"],["yor","yo"],["zha","za"],["zho","zh"],["zul","zu"]]);function tr(){}function nr(e,t,n,i,r){if(r.length){for(var a=e.textStreams,o=(r=l(r)).next(),s={};!o.done;s={$f:void 0},o=r.next())if(s.$f=o.value,(o=a.filter(function(e){return function(t){return!(!t.codecs.startsWith(e.$f)&&!t.mimeType.startsWith(e.$f))}}(s))).length){a=o;break}e.textStreams=a}if(a=e.variants,(t.length||n.length)&&(a=function(e,t,n){for(var i=(t=l(t)).next(),r={};!i.done;r={rh:void 0},i=t.next())if(r.rh=i.value,i=e.filter(function(e){return function(t){return t.video&&t.video.codecs.startsWith(e.rh)}}(r)),i.length){e=i;break}for(t=(n=l(n)).next(),i={};!t.done;i={kg:void 0},t=n.next())if(i.kg=t.value,t=e.filter(function(e){return function(t){return t.audio&&t.audio.codecs.startsWith(e.kg)}}(i)),t.length){e=t;break}return e}(a,t,n)),i.length){for(t=new Q,a=(n=l(a)).next();!a.done;a=n.next())a=a.value,t.push(String(a.video.width||0),a);var u=[];t.forEach((function(e,t){e=0;for(var n=[],r=(t=l(t)).next(),a={};!r.done;a={Be:void 0},r=t.next())a.Be=r.value,(r=i.filter(function(e){return function(t){return e.Be.decodingInfos[0][t]}}(a)).length)>e?(e=r,n=[a.Be]):r==e&&n.push(a.Be);u.push.apply(u,c(n))})),a=u}for(n=new Set,t=new Set,r=(a=l(a)).next();!r.done;r=a.next())(r=r.value).audio&&n.add(r.audio),r.video&&t.add(r.video);a=Array.from(n).sort((function(e,t){return e.bandwidth-t.bandwidth}));var d=[];for(n=new Map,r=(a=l(a)).next();!r.done;r=a.next()){if(o=(r=r.value).language+(r.channelsCount||0)+(r.audioSamplingRate||0)+r.roles.join(",")+r.label+r.groupId+r.fastSwitching,(s=n.get(o)||[]).length){var h=s[s.length-1],f=Mi(h.codecs),p=Mi(r.codecs);f!=p||r.bandwidth&&h.bandwidth&&!(r.bandwidth>h.bandwidth)||(s.push(r),d.push(r.id))}else s.push(r),d.push(r.id);n.set(o,s)}var g={vp8:1,avc:1,"dovi-avc":.95,vp9:.9,vp09:.9,hevc:.85,"dovi-hevc":.8,"dovi-p5":.75,av01:.7,"dovi-av1":.65,vvc:.6};a=Array.from(t).sort((function(e,t){if(!e.bandwidth||!t.bandwidth||e.bandwidth==t.bandwidth){if(e.codecs&&t.codecs&&e.codecs!=t.codecs&&e.width==t.width){var n=Mi(e.codecs),i=Mi(t.codecs);if(n!=i)return(g[n]||1)-(g[i]||1)}return e.width-t.width}return e.bandwidth-t.bandwidth})),t=ie();var m=[];for(n=new Map,r=(a=l(a)).next();!r.done;r=a.next()){if(r=r.value,o=Math.round(r.frameRate||0)+(r.hdr||"")+r.fastSwitching,(s=n.get(o)||[]).length){if(h=s[s.length-1],!t&&(f=Mi(h.codecs))!==(p=Mi(r.codecs)))continue;r.width>h.width||r.height>h.height?(s.push(r),m.push(r.id)):r.width==h.width&&r.height==h.height&&((f=Mi(h.codecs))!=(p=Mi(r.codecs))||r.bandwidth&&h.bandwidth&&!(r.bandwidth>h.bandwidth)||(s.push(r),m.push(r.id)))}else s.push(r),m.push(r.id);n.set(o,s)}e.variants=e.variants.filter((function(e){var t=e.audio;return e=e.video,!(t&&!d.includes(t.id)||e&&!m.includes(e.id))}))}function ir(e,t,n){function i(e,t,n){return e>=t&&e<=n}var r=e.video;if(r&&r.width&&r.height){var a=r.width,o=r.height;if(o>a&&(a=(o=l([o,a])).next().value,o=o.next().value),!i(a,t.minWidth,Math.min(t.maxWidth,n.width))||!i(o,t.minHeight,Math.min(t.maxHeight,n.height))||!i(r.width*r.height,t.minPixels,t.maxPixels))return!1}return!(e&&e.video&&e.video.frameRate&&!i(e.video.frameRate,t.minFrameRate,t.maxFrameRate)||e&&e.audio&&e.audio.channelsCount&&!i(e.audio.channelsCount,t.minChannelsCount,t.maxChannelsCount)||!i(e.bandwidth,t.minBandwidth,t.maxBandwidth))}function rr(e,t,n,i,r){var a,o;return P((function(s){if(1==s.g)return Ge()&&function(e){for(var t={dvav:"avc3",dva1:"avc1",dvhe:"hev1",dvh1:"hvc1",dvc1:"vvc1",dvi1:"vvi1"},n=new Set,i=(e=l(e)).next();!i.done;i=e.next())(i=i.value).video&&n.add(i.video);for(e=(n=l(n)).next();!e.done;e=n.next()){e=e.value;for(var r=(i=l(Object.keys(t))).next();!r.done;r=i.next())if(r=r.value,e.codecs.includes(r)){e.codecs=e.codecs.replace(r,t[r]);break}}}(t.variants),w(s,sr(t.variants,n,!1,i),2);a=null,e&&(o=e.g)&&(a=o.keySystem),t.variants=t.variants.filter((function(e){var t=function(e,t,n){if(!e.decodingInfos.some((function(e){return!(!e.supported||t&&(e=e.keySystemAccess)&&(n[e.keySystem]||e.keySystem)!=t)})))return!1;var i=Ge(),r=rt("Firefox")&&nt(),a=e.video,o=a&&a.width||0,s=a&&a.height||0;if(i&&a&&(1920<o||1080<s)&&(a.codecs.includes("avc1.")||a.codecs.includes("avc3.")))return!1;if(a){if(i=cr(a.codecs),a.codecs.includes(",")){if(i=cr(i=gi("video",o=a.codecs.split(","))),o=lr(o=gi("audio",o),a.mimeType),!ne(s=Ei(a.mimeType,o,"audio")))return!1;i=[i,o].join()}if(a.codecs!=i){if(!ne(o=Ei(a.mimeType,i,"video")))return!1;a.codecs=i}}if(e=e.audio,r&&e&&e.encrypted&&e.codecs.toLowerCase().includes("opus"))return!1;if(e&&(r=lr(e.codecs,e.mimeType),e.codecs!=r)){if(!ne(a=Ei(e.mimeType,r,"audio")))return!1;e.codecs=r}return!0}(e,a,r);if(!t){var n=[];e.audio&&n.push(xr(e.audio)),e.video&&n.push(xr(e.video))}return t})),T(s)}))}function ar(e,t){var n,i,r,a,o,s,u;return P((function(c){if(1==c.g){for(n=function(e,t){if(e){var n=It(e);return n.supported=e.supported&&t.supported,n.powerEfficient=e.powerEfficient&&t.powerEfficient,n.smooth=e.smooth&&t.smooth,t.keySystemAccess&&!n.keySystemAccess&&(n.keySystemAccess=t.keySystemAccess),n}return t},i=null,r=[],a=l(t),o=a.next(),s={};!o.done;s={cache:void 0,Gd:void 0},o=a.next())u=o.value,s.Gd=Mt(u),s.cache=Ar,s.cache[s.Gd]?i=n(i,s.cache[s.Gd]):r.push(or(u).then(function(e){return function(t){for(var r=null,a=(t=l(t||[])).next();!a.done;a=t.next())r=n(r,a.value);r&&(e.cache[e.Gd]=r,i=n(i,r))}}(s)));return w(c,Promise.all(r),2)}i&&e.decodingInfos.push(i),T(c)}))}function or(e){var t=[""];e.video&&(t=Ri(e.video.contentType).split(","));var n=[""];e.audio&&(n=Ri(e.audio.contentType).split(","));for(var i=[],r=(t=l(t)).next();!r.done;r=t.next()){r=r.value;for(var a=l(n),o=a.next(),s={};!o.done;s={Fc:void 0},o=a.next())o=o.value,s.Fc=kt(e),e.video&&(s.Fc.video.contentType=xi(Di(s.Fc.video.contentType),r)),e.audio&&(s.Fc.audio.contentType=xi(Di(s.Fc.audio.contentType),o)),i.push(new Promise(function(e){return function(t,n){Ki(1,navigator.mediaCapabilities.decodingInfo(e.Fc)).then((function(e){t(e)})).catch(n)}}(s)))}return Promise.all(i).catch((function(){return JSON.stringify(e),null}))}function sr(e,t,n,i){var r,a,o,s,u,c,d,h,f,p,g,m,v,y,b,T,S,x;return P((function(A){switch(A.g){case 1:if(e.some((function(e){return e.decodingInfos.length})))return A.return();r=l(i),a=r.next(),o={};case 2:if(a.done){A.u(4);break}o.Tg=a.value,s=!1,u=l(e),c=u.next();case 5:if(c.done){A.u(7);break}d=c.value,h=ur(d,t,n).filter((E=o,function(e){return((e=e[0]).keySystemConfiguration&&e.keySystemConfiguration.keySystem)===E.Tg})),f=l(h),p=f.next();case 8:if(p.done){A.u(10);break}return g=p.value,w(A,ar(d,g),9);case 9:p=f.next(),A.u(8);break;case 10:d.decodingInfos.length&&(s=!0),c=u.next(),A.u(5);break;case 7:if(s)return A.return();o={Tg:void 0},a=r.next(),A.u(2);break;case 4:m=l(e),v=m.next();case 12:if(v.done){A.u(0);break}y=v.value,b=ur(y,t,n).filter((function(e){return!(e=(e=e[0]).keySystemConfiguration&&e.keySystemConfiguration.keySystem)||!i.includes(e)})),T=l(b),S=T.next();case 15:if(S.done){v=m.next(),A.u(12);break}return x=S.value,w(A,ar(y,x),16);case 16:S=T.next(),A.u(15)}var E}))}function ur(e,t,n){var i=e.audio,r=e.video,a=[],o=[];if(r)for(var s=l(r.fullMimeTypes),u=s.next();!u.done;u=s.next()){var c=Ri(u=u.value);if(c.includes(",")&&!i){var d=c.split(","),h=Di(u);c=gi("video",d),h=Ei(h,d=lr(d=gi("audio",d),h),"audio"),o.push({contentType:h,channels:2,bitrate:e.bandwidth||1,samplerate:1,spatialRendering:!1})}if(c=cr(c),u={contentType:Ei(Di(u),c,"video"),width:r.width||64,height:r.height||64,bitrate:r.bandwidth||e.bandwidth||1,framerate:r.frameRate||1},r.hdr)switch(r.hdr){case"SDR":u.transferFunction="srgb";break;case"PQ":u.transferFunction="pq";break;case"HLG":u.transferFunction="hlg"}r.colorGamut&&(u.colorGamut=r.colorGamut),a.push(u)}if(i)for(u=(s=l(i.fullMimeTypes)).next();!u.done;u=s.next())u=Ei(u=Di(c=u.value),c=lr(Ri(c),u),"audio"),o.push({contentType:u,channels:i.channelsCount||2,bitrate:i.bandwidth||e.bandwidth||1,samplerate:i.audioSamplingRate||1,spatialRendering:i.spatialAudio});for(s=[],0==a.length&&a.push(null),0==o.length&&o.push(null),u=(a=l(a)).next();!u.done;u=a.next())for(u=u.value,h=(c=l(o)).next();!h.done;h=c.next())h=h.value,d={type:n?"file":"media-source"},u&&(d.video=u),h&&(d.audio=h),s.push(d);if(!(o=(e.video?e.video.drmInfos:[]).concat(e.audio?e.audio.drmInfos:[])).length)return[s];for(e=[],n=new Map,a=(o=l(o)).next();!a.done;a=o.next())a=a.value,n.get(a.keySystem)||n.set(a.keySystem,[]),n.get(a.keySystem).push(a);for(o=t?"required":"optional",t=t?["persistent-license"]:["temporary"],u=(a=l(n.keys())).next();!u.done;u=a.next()){for(u=u.value,c=[],d=(h=l(s)).next();!d.done;d=h.next()){d=Object.assign({},d.value);for(var f=n.get(u),p={keySystem:u,initDataType:"cenc",persistentState:o,distinctiveIdentifier:"optional",sessionTypes:t},g=(f=l(f)).next();!g.done;g=f.next()){if((g=g.value).initData&&g.initData.length){for(var m=new Set,v=l(g.initData),y=v.next();!y.done;y=v.next())m.add(y.value.initDataType);p.initDataType=g.initData[0].initDataType}g.distinctiveIdentifierRequired&&(p.distinctiveIdentifier="required"),g.persistentStateRequired&&(p.persistentState="required"),g.sessionType&&(p.sessionTypes=[g.sessionType]),i&&(p.audio?(g.encryptionScheme&&(p.audio.encryptionScheme=p.audio.encryptionScheme||g.encryptionScheme),p.audio.robustness=p.audio.robustness||g.audioRobustness):(p.audio={robustness:g.audioRobustness},g.encryptionScheme&&(p.audio.encryptionScheme=g.encryptionScheme)),""==p.audio.robustness&&delete p.audio.robustness),r&&(p.video?(g.encryptionScheme&&(p.video.encryptionScheme=p.video.encryptionScheme||g.encryptionScheme),p.video.robustness=p.video.robustness||g.videoRobustness):(p.video={robustness:g.videoRobustness},g.encryptionScheme&&(p.video.encryptionScheme=g.encryptionScheme)),""==p.video.robustness&&delete p.video.robustness)}d.keySystemConfiguration=p,c.push(d)}e.push(c)}return e}function lr(e,t){return"flac"==e.toLowerCase()?et()?"fLaC":"flac":"opus"===e.toLowerCase()?et()&&"mp4"==Ii(t)?"Opus":"opus":e}function cr(e){if(e.includes("avc1")){var t=e.split(".");if(3==t.length)return e=t.shift()+".",(e+=parseInt(t.shift(),10).toString(16))+("000"+parseInt(t.shift(),10).toString(16)).slice(-4)}else if("vp9"==e)return"vp09.00.41.08";return e}function dr(e){var t=e.audio,n=e.video,i=t?t.mimeType:null,r=n?n.mimeType:null,a=t?t.codecs:null,o=n?n.codecs:null,s=[];o&&s.push(o),a&&s.push(a);var u=[];n&&u.push(n.mimeType),t&&u.push(t.mimeType),u=u[0]||null;var c=[];t&&c.push(t.kind),n&&c.push(n.kind),c=c[0]||null;var d=new Set;if(t)for(var h=l(t.roles),f=h.next();!f.done;f=h.next())d.add(f.value);if(n)for(f=(h=l(n.roles)).next();!f.done;f=h.next())d.add(f.value);return e={id:e.id,active:!1,type:"variant",bandwidth:e.bandwidth,language:e.language,label:null,kind:c,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:u,audioMimeType:i,videoMimeType:r,codecs:s.join(", "),audioCodec:a,videoCodec:o,primary:e.primary,roles:Array.from(d),audioRoles:null,forced:!1,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:null},n&&(e.videoId=n.id,e.originalVideoId=n.originalId,e.width=n.width||null,e.height=n.height||null,e.frameRate=n.frameRate||null,e.pixelAspectRatio=n.pixelAspectRatio||null,e.videoBandwidth=n.bandwidth||null,e.hdr=n.hdr||null,e.colorGamut=n.colorGamut||null,e.videoLayout=n.videoLayout||null,o.includes(",")&&(e.channelsCount=n.channelsCount,e.audioSamplingRate=n.audioSamplingRate,e.spatialAudio=n.spatialAudio,e.originalLanguage=n.originalLanguage)),t&&(e.audioId=t.id,e.originalAudioId=t.originalId,e.channelsCount=t.channelsCount,e.audioSamplingRate=t.audioSamplingRate,e.audioBandwidth=t.bandwidth||null,e.spatialAudio=t.spatialAudio,e.label=t.label,e.audioRoles=t.roles,e.accessibilityPurpose=t.accessibilityPurpose,e.originalLanguage=t.originalLanguage),e}function hr(e){return{id:e.id,active:!1,type:yi,bandwidth:0,language:e.language,label:e.label,kind:e.kind||null,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:e.mimeType,audioMimeType:null,videoMimeType:null,codecs:e.codecs||null,audioCodec:null,videoCodec:null,primary:e.primary,roles:e.roles,audioRoles:null,forced:e.forced,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:e.originalId,originalImageId:null,accessibilityPurpose:e.accessibilityPurpose,originalLanguage:e.originalLanguage}}function fr(e){var t=e.width||null,n=e.height||null,i=null;e.segmentIndex&&(i=eu(e.segmentIndex));var r=e.tilesLayout;return i&&(r=i.tilesLayout||r),r&&null!=t&&(t/=Number(r.split("x")[0])),r&&null!=n&&(n/=Number(r.split("x")[1])),{id:e.id,active:!1,type:"image",bandwidth:e.bandwidth||0,language:"",label:null,kind:null,width:t,height:n,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:e.mimeType,audioMimeType:null,videoMimeType:null,codecs:e.codecs||null,audioCodec:null,videoCodec:null,primary:!1,roles:[],audioRoles:null,forced:!1,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:r||null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:e.originalId,accessibilityPurpose:null,originalLanguage:null}}function pr(e){return e.__shaka_id||(e.__shaka_id=Er++),e.__shaka_id}function gr(e){var t=vr(e);return t.active="disabled"!=e.mode,t.type="text",t.originalTextId=e.id,"captions"==e.kind&&(t.mimeType="unknown"),"subtitles"==e.kind&&(t.mimeType="text/vtt"),e.kind&&(t.roles=[e.kind]),"forced"==e.kind&&(t.forced=!0),t}function mr(e){var t=vr(e);return t.active=e.enabled,t.type="variant",t.originalAudioId=e.id,"main"==e.kind&&(t.primary=!0),e.kind&&(t.roles=[e.kind],t.audioRoles=[e.kind],t.label=e.label),t}function vr(e){var t=e.language;return{id:pr(e),active:!1,type:"",bandwidth:0,language:Yi(t||"und"),label:e.label,kind:e.kind,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:null,audioMimeType:null,videoMimeType:null,codecs:null,audioCodec:null,videoCodec:null,primary:!1,roles:[],forced:!1,audioRoles:null,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:t}}function yr(e){return e.allowedByApplication&&e.allowedByKeySystem&&0==e.disabledUntilTime}function br(e){return e.filter((function(e){return yr(e)}))}function wr(e,t,n,i){var r=e,a=e.filter((function(e){return e.primary}));a.length&&(r=a);var o=r.length?r[0].language:"";if(r=r.filter((function(e){return e.language==o})),t){var s=Zi(Yi(t),e.map((function(e){return e.language})));s&&(r=e.filter((function(e){return Yi(e.language)==s})))}if(r=r.filter((function(e){return e.forced==i})),n){if((e=Tr(r,n)).length)return e}else if(e=r.filter((function(e){return 0==e.roles.length})),e.length)return e;return e=r.map((function(e){return e.roles})).reduce(Vi,[]),e.length?Tr(r,e[0]):r}function Tr(e,t){return e.filter((function(e){return e.roles.includes(t)}))}function Sr(e,t){t.length&&(t=t.filter((function(t){return Mi(e.codecs)==Mi(t.codecs)})).sort((function(e,t){return e.bandwidth&&t.bandwidth&&e.bandwidth!=t.bandwidth?e.bandwidth-t.bandwidth:(e.width||0)-(t.width||0)})),e.trickModeVideo=t[0],1<t.length&&(t=t.find((function(t){return e.width==t.width&&e.height==t.height}))))&&(e.trickModeVideo=t)}function xr(e){return"audio"==e.type?"type=audio codecs="+e.codecs+" bandwidth="+e.bandwidth+" channelsCount="+e.channelsCount+" audioSamplingRate="+e.audioSamplingRate:"video"==e.type?"type=video codecs="+e.codecs+" bandwidth="+e.bandwidth+" frameRate="+e.frameRate+" width="+e.width+" height="+e.height:"unexpected stream type"}F("shaka.util.StreamUtils",tr),tr.meetsRestrictions=ir;var Ar={},Er=0,kr=(new Map).set("image/svg+xml",!0).set("image/png",!0).set("image/jpeg",!0).set("image/jpg",!0),Ir=(new Map).set("image/webp","data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA").set("image/avif","data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=");function Mr(){var e=this;this.A=null,this.j=!1,this.i=new X,this.F=new Z,navigator.connection&&navigator.connection.addEventListener&&this.F.D(navigator.connection,"change",(function(){if(e.j&&e.g.useNetworkInformation){e.i=new X,e.g&&e.i.configure(e.g.advanced);var t=e.chooseVariant();t&&navigator.onLine&&e.A(t,e.g.clearBufferSwitch,e.g.safeMarginSwitch)}})),this.s=[],this.B=1,this.G=!1,this.h=this.o=this.g=this.l=null,this.C=new Be((function(){if(e.j&&e.g.restrictToElementSize){var t=e.chooseVariant();t&&e.A(t,e.g.clearBufferSwitch,e.g.safeMarginSwitch)}})),this.m=null}function Cr(e){if(!e.G){var t=e.i;if(!(t.g>=t.i))return;e.G=!0,e.l-=1e3*(e.g.switchInterval-e.g.minTimeToSwitch)}Date.now()-e.l<1e3*e.g.switchInterval||(t=e.chooseVariant(),e.getBandwidthEstimate(),t&&e.A(t,e.g.clearBufferSwitch,e.g.safeMarginSwitch))}function Dr(e,t,n,i,r){if(e.m){var a=e.m.Cg();a&&(n=n.filter((function(e){return!e.bandwidth||!a||e.bandwidth<=a})))}return t&&(n=n.filter((function(e){return ir(e,t,{width:r,height:i})}))),n.sort((function(e,t){return e.bandwidth-t.bandwidth}))}(i=Mr.prototype).stop=function(){this.A=null,this.j=!1,this.s=[],this.B=1,this.o=this.l=null,this.h&&(this.h.disconnect(),this.h=null),this.C.stop(),this.m=null},i.release=function(){this.F.release(),this.C=null},i.init=function(e){this.A=e},i.chooseVariant=function(){var t=1/0,n=1/0;if(this.g.restrictToScreenSize){var i=this.g.ignoreDevicePixelRatio?1:e.devicePixelRatio;t=e.screen.height*i,n=e.screen.width*i}this.h&&this.g.restrictToElementSize&&(i=this.g.ignoreDevicePixelRatio?1:e.devicePixelRatio,t=Math.min(t,this.o.clientHeight*i),n=Math.min(n,this.o.clientWidth*i)),(i=this.s.filter((function(e){return e&&!(e.audio&&e.audio.fastSwitching||e.video&&e.video.fastSwitching)}))).length||(i=this.s);var r=i;if(i.length!=this.s.length&&(r=this.s.filter((function(e){return e&&!!(e.audio&&e.audio.fastSwitching||e.video&&e.video.fastSwitching)}))),i=Dr(this,this.g.restrictions,r,1/0,1/0),1/0!=t||1/0!=n){i=function(e){for(var t=[],n=(e=l(e)).next();!n.done;n=e.next())(n=n.value.video)&&n.height&&n.width&&t.push({height:n.height,width:n.width});return t.sort((function(e,t){return e.width-t.width}))}(i);for(var a=(i=l(i)).next();!a.done;a=i.next())if((a=a.value).height>=t&&a.width>=n){t=a.height,n=a.width;break}i=Dr(this,this.g.restrictions,r,t,n)}for(t=this.getBandwidthEstimate(),r.length&&!i.length&&(i=[(i=Dr(this,null,r,1/0,1/0))[0]]),n=i[0]||null,r=0;r<i.length;r++){a=i[r];for(var o=isNaN(this.B)?1:Math.abs(this.B),s=o*a.bandwidth/this.g.bandwidthDowngradeTarget,u={bandwidth:1/0},c=r+1;c<i.length;c++)if(a.bandwidth!=i[c].bandwidth){u=i[c];break}o=o*u.bandwidth/this.g.bandwidthUpgradeTarget,t>=s&&t<=o&&(n.bandwidth!=a.bandwidth||n.bandwidth==a.bandwidth&&n.video&&a.video&&(n.video.width<a.video.width||n.video.height<a.video.height))&&(n=a)}return this.l=Date.now(),n},i.enable=function(){this.j=!0},i.disable=function(){this.j=!1},i.segmentDownloaded=function(e,t,n){e<this.g.cacheLoadThreshold||(this.i.sample(e,t),n&&null!=this.l&&this.j&&Cr(this))},i.trySuggestStreams=function(){null!=this.l&&this.j&&Cr(this)},i.getBandwidthEstimate=function(){var e=this.g.defaultBandwidthEstimate;return navigator.connection&&navigator.connection.downlink&&this.g.useNetworkInformation&&(e=1e6*navigator.connection.downlink),navigator.connection&&navigator.connection.downlink&&this.g.useNetworkInformation&&this.g.preferNetworkInformationBandwidth?e:(e=this.i.getBandwidthEstimate(e),this.m?this.m.getBandwidthEstimate(e):e)},i.setVariants=function(e){this.s=e},i.playbackRateChanged=function(e){this.B=e},i.setMediaElement=function(t){var n=this;this.o=t,this.h&&(this.h.disconnect(),this.h=null),this.o&&"ResizeObserver"in e&&(this.h=new ResizeObserver((function(){n.C.$(Rr)})),this.h.observe(this.o))},i.setCmsdManager=function(e){this.m=e},i.configure=function(e){this.g=e,this.i&&this.g&&this.i.configure(this.g.advanced)},F("shaka.abr.SimpleAbrManager",Mr),Mr.prototype.configure=Mr.prototype.configure,Mr.prototype.setCmsdManager=Mr.prototype.setCmsdManager,Mr.prototype.setMediaElement=Mr.prototype.setMediaElement,Mr.prototype.playbackRateChanged=Mr.prototype.playbackRateChanged,Mr.prototype.setVariants=Mr.prototype.setVariants,Mr.prototype.getBandwidthEstimate=Mr.prototype.getBandwidthEstimate,Mr.prototype.trySuggestStreams=Mr.prototype.trySuggestStreams,Mr.prototype.segmentDownloaded=Mr.prototype.segmentDownloaded,Mr.prototype.disable=Mr.prototype.disable,Mr.prototype.enable=Mr.prototype.enable,Mr.prototype.chooseVariant=Mr.prototype.chooseVariant,Mr.prototype.init=Mr.prototype.init,Mr.prototype.release=Mr.prototype.release,Mr.prototype.stop=Mr.prototype.stop;var Rr=1;function Pr(e,t,n){for(n=void 0===n||n,this.h=e,this.g=new Set([e]),t=(e=l(t=t||[])).next();!t.done;t=e.next())this.add(t.value,n)}function Lr(e,t){if(e.mimeType!=t.mimeType)return!1;if(e=e.codecs.split(",").map((function(e){return Ci(e)})),t=t.codecs.split(",").map((function(e){return Ci(e)})),e.length!=t.length)return!1;e.sort(),t.sort();for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function Nr(e,t){if(e=new Set(e),t=new Set(t),e.delete("main"),t.delete("main"),e.size!=t.size)return!1;for(var n=(e=l(e)).next();!n.done;n=e.next())if(!t.has(n.value))return!1;return!0}function jr(e,t){this.g=new Or(e.language,"",e.audio&&e.audio.channelsCount?e.audio.channelsCount:0,e.video&&e.video.hdr?e.video.hdr:"",!(!e.audio||!e.audio.spatialAudio)&&e.audio.spatialAudio,e.video&&e.video.videoLayout?e.video.videoLayout:"","","",t,e.audio&&e.audio.codecs?e.audio.codecs:"")}function Or(e,t,n,i,r,a,o,s,u,l){this.s=e,this.A=t,this.i=n,this.j=i,this.B=r,this.m=a,this.h=o,this.l=s,this.o=u,this.g=l}function Ur(){this.g=Fr,this.i=(new Map).set(Fr,2).set(Br,1),this.h=0}function _r(e,t,n){e.i.set(Fr,n).set(Br,t)}F("shaka.config.AutoShowText",{NEVER:0,ALWAYS:1,IF_PREFERRED_TEXT_LANGUAGE:2,IF_SUBTITLES_MAY_BE_NEEDED:3}),F("shaka.config.CodecSwitchingStrategy",{RELOAD:"reload",SMOOTH:"smooth"}),Pr.prototype.add=function(e,t){var n,i=this.h;if(t=void 0===t||t,!(n=!!i.audio!=!!e.audio||!!i.video!=!!e.video||i.language!=e.language)&&(n=i.audio&&e.audio)){n=i.audio;var r=e.audio;n=!(!((!n.channelsCount||!r.channelsCount||2<n.channelsCount||2<r.channelsCount)&&n.channelsCount!=r.channelsCount||n.spatialAudio!==r.spatialAudio||t&&!Lr(n,r))&&Nr(n.roles,r.roles)&&n.groupId===r.groupId)}return!n&&(n=i.video&&e.video)&&(i=i.video,n=e.video,n=!((!t||Lr(i,n))&&Nr(i.roles,n.roles))),!n&&(this.g.add(e),!0)},Pr.prototype.values=function(){return this.g.values()},jr.prototype.create=function(e){return this.g.create(e)},Or.prototype.create=function(t){var n=[];n=function(e,t){var n=Zi(t=Yi(t),e.map((function(e){return Qi(e)})));return n?e.filter((function(e){return n==Qi(e)})):[]}(t,this.s);var i=t.filter((function(e){return e.primary}));return t=function(e,t){return e.filter((function(e){return!!e.audio&&(t?e.audio.roles.includes(t):0==e.audio.roles.length)}))}(n=n.length?n:i.length?i:t,this.A),t.length&&(n=t),this.m&&(t=function(e,t){return e.filter((function(e){return!e.video||!e.video.videoLayout||e.video.videoLayout==t}))}(n,this.m),t.length&&(n=t)),this.j&&(t=function(t,n){return"AUTO"==n&&(n=e.matchMedia("(color-gamut: p3)").matches?t.some((function(e){return!(!e.video||!e.video.hdr||"HLG"!=e.video.hdr)}))?"HLG":"PQ":"SDR"),t.filter((function(e){return!e.video||!e.video.hdr||e.video.hdr==n}))}(n,this.j),t.length&&(n=t)),this.i&&(t=function(e,t){return e.filter((function(e){return!e.audio||!e.audio.channelsCount||e.audio.channelsCount==t}))}(n,this.i),t.length&&(n=t)),this.h&&(t=function(e,t){return e.filter((function(e){return!(!e.audio||!e.audio.label)&&e.audio.label.toLowerCase()==t.toLowerCase()}))}(n,this.h),t.length&&(n=t)),this.l&&(t=function(e,t){return e.filter((function(e){return!(!e.video||!e.video.label)&&e.video.label.toLowerCase()==t.toLowerCase()}))}(n,this.l),t.length&&(n=t)),t=function(e,t){return e.filter((function(e){return!e.audio||e.audio.spatialAudio==t}))}(n,this.B),t.length&&(n=t),this.g&&(t=function(e,t){return e.filter((function(e){return!e.audio||e.audio.codecs==t}))}(n,this.g),t.length&&(n=t)),new Pr(n[0],n,!("smooth"==this.o&&ie()))};var Br=0,Fr=1;function Vr(e,t){var n=2,i=1e3,r=2,a=.5;this.l=null==e.maxAttempts?n:e.maxAttempts,this.j=null==e.baseDelay?i:e.baseDelay,this.o=null==e.fuzzFactor?a:e.fuzzFactor,this.m=null==e.backoffFactor?r:e.backoffFactor,this.g=0,this.h=this.j,(this.i=void 0!==t&&t)&&(this.g=1)}function Hr(e){var t,n;return P((function(i){if(1==i.g){if(e.g>=e.l){if(!e.i)throw new De(2,7,1010);e.g=1,e.h=e.j}return t=e.g,e.g++,0==t?i.return():(n=e.h*(1+(2*Math.random()-1)*e.o),w(i,new Promise((function(e){new Be(e).$(n/1e3)})),2))}e.h*=e.m,T(i)}))}function Gr(){var e,t,n=new Promise((function(n,i){e=n,t=i}));return n.resolve=e,n.reject=t,n}function Kr(e,t){this.promise=e,this.i=t,this.g=null}function Xr(e){return new Kr(Promise.reject(e),(function(){return Promise.resolve()}))}function qr(){var e=Promise.reject(new De(2,7,7001));return e.catch((function(){})),new Kr(e,(function(){return Promise.resolve()}))}function zr(e){return new Kr(Promise.resolve(e),(function(){return Promise.resolve()}))}function Wr(e){return new Kr(e,(function(){return e.catch((function(){}))}))}function Yr(e){return new Kr(Promise.all(e.map((function(e){return e.promise}))),(function(){return Promise.all(e.map((function(e){return e.abort()})))}))}function Jr(t,n){if(n)if(n instanceof Map)for(var i=l(n.keys()),r=i.next();!r.done;r=i.next())r=r.value,Object.defineProperty(this,r,{value:n.get(r),writable:!0,enumerable:!0});else for(i in n)Object.defineProperty(this,i,{value:n[i],writable:!0,enumerable:!0});this.defaultPrevented=this.cancelable=this.bubbles=!1,this.timeStamp=e.performance&&e.performance.now?e.performance.now():Date.now(),this.type=t,this.isTrusted=!1,this.target=this.currentTarget=null,this.g=!1}function $r(e){var t,n=new Jr(e.type);for(t in e)Object.defineProperty(n,t,{value:e[t],writable:!0,enumerable:!0});return n}Gr.prototype.resolve=function(){},Gr.prototype.reject=function(){},Kr.prototype.abort=function(){return this.g||(this.g=this.i()),this.g},Kr.prototype.finally=function(e){return this.promise.then((function(){return e(!0)}),(function(){return e(!1)})),this},Kr.prototype.Ca=function(e,t){function n(n){return function(s){if(r.g&&n)a.reject(o);else{var u=n?e:t;u?i=function(e,t,n){try{var i=e(t);return i&&i.promise&&i.abort?(n.resolve(i.promise),function(){return i.abort()}):(n.resolve(i),function(){return Promise.resolve(i).then((function(){}),(function(){}))})}catch(e){return n.reject(e),function(){return Promise.resolve()}}}(u,s,a):(n?a.resolve:a.reject)(s)}}}function i(){return a.reject(o),r.abort()}var r=this,a=new Gr;a.catch((function(){}));var o=new De(2,7,7001);return this.promise.then(n(!0),n(!1)),new Kr(a,(function(){return i()}))},o.Object.defineProperties(Kr.prototype,{aborted:{configurable:!0,enumerable:!0,get:function(){return null!==this.g}}}),F("shaka.util.AbortableOperation",Kr),Kr.prototype.chain=Kr.prototype.Ca,Kr.prototype.finally=Kr.prototype.finally,Kr.all=Yr,Kr.prototype.abort=Kr.prototype.abort,Kr.notAbortable=Wr,Kr.completed=zr,Kr.aborted=qr,Kr.failed=Xr,Jr.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)},Jr.prototype.stopImmediatePropagation=function(){this.g=!0},Jr.prototype.stopPropagation=function(){},F("shaka.util.FakeEvent",Jr);var Qr={mj:"abrstatuschanged",nj:"adaptation",oj:"audiotrackchanged",pj:"buffering",qj:"complete",rj:"downloadfailed",sj:"downloadheadersreceived",tj:"drmsessionupdate",vj:"emsg",Pj:"prft",Error:"error",wj:"expirationupdated",xj:"firstquartile",yj:"gapjumped",Bj:"keystatuschanged",Fj:"loaded",Gj:"loading",Ij:"manifestparsed",Jj:"manifestupdated",Kj:"mediaqualitychanged",Lj:"mediasourcerecovered",Metadata:"metadata",Mj:"midpoint",Nj:"nospatialvideoinfo",Oj:"onstatechange",Qj:"ratechange",Sj:"segmentappended",Tj:"sessiondata",Uj:"spatialvideoinfo",Vj:"stalldetected",Wj:"started",Xj:"statechanged",Yj:"streaming",Zj:"textchanged",$j:"texttrackvisibility",ak:"thirdquartile",bk:"timelineregionadded",ck:"timelineregionenter",dk:"timelineregionexit",ek:"trackschanged",gk:"unloading",ik:"variantchanged"};function Zr(){this.ra=new Q,this.re=this}function ea(){this.g=[]}function ta(e,t){e.g.push(t.finally((function(){Ie(e.g,t)})))}function na(e,t,n,i,r,a){Zr.call(this),this.i=!1,this.o=new ea,this.g=new Set,this.h=new Set,this.l=e||null,this.j=t||null,this.B=n||null,this.C=i||null,this.G=r||null,this.F=a||null,this.s=this.A=!1,this.m=16e3}function ia(e,t,n,i){n=n||da;var r=ha[e];(!r||n>=r.priority)&&(ha[e]={priority:n,he:t,Hi:void 0!==i&&i})}function ra(e,t){for(var n=l(e.g),i=n.next();!i.done;i=n.next())t.g.add(i.value);for(n=(e=l(e.h)).next();!n.done;n=e.next())t.h.add(n.value)}function aa(e,t,n){return{uris:e,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:t,licenseRequestType:null,sessionId:null,drmInfo:null,initData:null,initDataType:null,streamDataCallback:void 0===n?null:n}}function oa(e,t,n,i,r,a,o,s){e.A&&(n.uris[a]=n.uris[a].replace("https://","http://")),e.s&&(n.uris[a]=n.uris[a].replace("http://","https://")),0<a&&e.G&&e.G(t,i,n.uris[a],n.uris[a-1]);var u=new Gn(n.uris[a]),l=u.Db,c=!1;l||(Kn(u,l=(l=location.protocol).slice(0,-1)),n.uris[a]=u.toString()),l=l.toLowerCase();var d=(l=ha[l])?l.he:null;if(!d)return Xr(new De(2,1,1e3,u));var h,f=l.Hi,p=null,g=null,m=!1,v=!1;return Wr(Hr(r)).Ca((function(){if(e.i)return qr();h=Date.now();var r=0;n.requestStartTime=Date.now();var o=d(n.uris[a],n,t,(function(a,o,u){p&&p.stop(),g&&g.$(l/1e3),e.l&&t==ca&&(r++,n.packetNumber=r,e.l(a,o,sa(i),n),c=!0,s.g=u)}),(function(i){v=!0,n.timeToFirstByte=Date.now()-n.requestStartTime,e.j&&e.j(i,n,t)}),{minBytesForProgressEvents:e.m});if(!f)return o;var u=n.retryParameters.connectionTimeout;u&&(p=new Be((function(){m=!0,o.abort()}))).$(u/1e3);var l=n.retryParameters.stallTimeout;return l&&(g=new Be((function(){m=!0,o.abort()}))),o})).Ca((function(i){p&&p.stop(),g&&g.stop(),null==i.timeMs&&(i.timeMs=Date.now()-h);var r={response:i,mi:c};return!v&&e.j&&e.j(i.headers,n,t),r}),(function(u){if(p&&p.stop(),g&&g.stop(),e.B){var l=null,c=0;u instanceof De&&(l=u,1001==u.code&&(c=u.data[1])),e.B(n,l,c,m)}if(e.i)return qr();if(m&&(u=new De(1,1,1003,n.uris[a],t)),u instanceof De){if(7001==u.code)throw u;if(1010==u.code)throw o;if(1==u.severity)return l=new Jr("retry",l=(new Map).set("error",u)),e.dispatchEvent(l),a=(a+1)%n.uris.length,oa(e,t,n,i,r,a,u,s)}throw u}))}function sa(e){if(e){var t=e.segment;if(e=e.stream,t&&e&&e.fastSwitching&&t.o)return!1}return!0}function ua(){this.g=0}function la(e,t,n){Kr.call(this,e,t),this.h=n}Zr.prototype.addEventListener=function(e,t){this.ra&&this.ra.push(e,t)},Zr.prototype.removeEventListener=function(e,t){this.ra&&this.ra.remove(e,t)},Zr.prototype.dispatchEvent=function(e){if(!this.ra)return!0;var t=this.ra.get(e.type)||[],n=this.ra.get("All");for(n&&(t=t.concat(n)),n=(t=l(t)).next();!n.done;n=t.next()){n=n.value,e.target=this.re,e.currentTarget=this.re;try{n.handleEvent?n.handleEvent(e):n.call(this,e)}catch(e){}if(e.g)break}return e.defaultPrevented},Zr.prototype.release=function(){this.ra=null},ea.prototype.destroy=function(){for(var e=[],t=l(this.g),n=t.next();!n.done;n=t.next())(n=n.value).promise.catch((function(){})),e.push(n.abort());return this.g=[],Promise.all(e)},m(na,Zr),(i=na.prototype).Tf=function(e){this.A=e},i.Uf=function(e){this.s=e},i.Ki=function(e){this.g.add(e)},i.fj=function(e){this.g.delete(e)},i.og=function(){this.g.clear()},i.Li=function(e){this.h.add(e)},i.gj=function(e){this.h.delete(e)},i.pg=function(){this.h.clear()},i.destroy=function(){return this.i=!0,this.g.clear(),this.h.clear(),Zr.prototype.release.call(this),this.o.destroy()},i.request=function(e,t,n){var i=this,r=new ua;if(this.i){var a=Promise.reject(new De(2,7,7001));return a.catch((function(){})),new la(a,(function(){return Promise.resolve()}),r)}t.method=t.method||"GET",t.headers=t.headers||{},t.retryParameters=t.retryParameters?kt(t.retryParameters):{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4},t.uris=kt(t.uris),a=function(e,t,n,i){function r(e){a=a.Ca((function(){return n.body&&(n.body=pe(n.body)),e(t,n,i)}))}var a=zr(void 0);e.C&&r(e.C);for(var o=(e=l(e.g)).next();!o.done;o=e.next())r(o.value);return a.Ca(void 0,(function(e){if(e instanceof De&&7001==e.code)throw e;throw new De(2,1,1006,e)}))}(this,e,t,n);var o=a.Ca((function(){return oa(i,e,t,n,new Vr(t.retryParameters,!1),0,null,r)})),s=o.Ca((function(t){return function(e,t,n,i){for(var r=zr(void 0),a=(e=l(e.h)).next(),o={};!a.done;o={Yg:void 0},a=e.next())o.Yg=a.value,r=r.Ca(function(e){return function(){var r=n.response;return r.data&&(r.data=pe(r.data)),(0,e.Yg)(t,r,i)}}(o));return r.Ca((function(){return n}),(function(e){var t=2;if(e instanceof De){if(7001==e.code)throw e;t=e.severity}throw new De(t,1,1007,e)}))}(i,e,t,n)})),u=Date.now(),c=0;a.promise.then((function(){c=Date.now()-u}),(function(){}));var d=0;o.promise.then((function(){d=Date.now()}),(function(){}));var h=s.Ca((function(r){var a=Date.now()-d,o=r.response;return o.timeMs+=c,o.timeMs+=a,r.mi||!i.l||o.fromCache||"HEAD"==t.method||e!=ca||i.l(o.timeMs,o.data.byteLength,sa(n)),i.F&&i.F(e,o,n),o}),(function(e){throw e&&(e.severity=2),e}));return a=new la(h.promise,(function(){return h.abort()}),r),ta(this.o,a),a},F("shaka.net.NetworkingEngine",na),na.prototype.request=na.prototype.request,na.prototype.destroy=na.prototype.destroy,na.makeRequest=aa,na.defaultRetryParameters=function(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4}},na.prototype.clearAllResponseFilters=na.prototype.pg,na.prototype.unregisterResponseFilter=na.prototype.gj,na.prototype.registerResponseFilter=na.prototype.Li,na.prototype.clearAllRequestFilters=na.prototype.og,na.prototype.unregisterRequestFilter=na.prototype.fj,na.prototype.registerRequestFilter=na.prototype.Ki,na.unregisterScheme=function(e){delete ha[e]},na.registerScheme=ia,na.prototype.setForceHTTPS=na.prototype.Uf,na.prototype.setForceHTTP=na.prototype.Tf,na.NumBytesRemainingClass=ua,m(la,Kr),na.PendingRequest=la;var ca=1;na.RequestType={MANIFEST:0,SEGMENT:ca,LICENSE:2,APP:3,TIMING:4,SERVER_CERTIFICATE:5,KEY:6,ADS:7,CONTENT_STEERING:8},na.AdvancedRequestType={INIT_SEGMENT:0,MEDIA_SEGMENT:1,MEDIA_PLAYLIST:2,MASTER_PLAYLIST:3,MPD:4,MSS:5,MPD_PATCH:6,MEDIATAILOR_SESSION_INFO:7,MEDIATAILOR_TRACKING_INFO:8,MEDIATAILOR_STATIC_RESOURCE:9,MEDIATAILOR_TRACKING_EVENT:10,INTERSTITIAL_ASSET_LIST:11,INTERSTITIAL_AD_URL:12};var da=3;na.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:da};var ha={};function fa(e){this.g=!1,this.h=new Gr,this.i=e}function pa(e,t){if(e.g){if(t instanceof De&&7003==t.code)throw t;throw new De(2,7,7003,t)}}function ga(e,t){for(var n=[],i=(e=l(e)).next();!i.done;i=e.next())n.push(t(i.value));return n}function ma(e){for(var t=new Map,n=l(Object.keys(e)),i=n.next();!i.done;i=n.next())i=i.value,t.set(i,e[i]);return t}function va(e){var t={};return e.forEach((function(e,n){t[n]=e})),t}function ya(e,t){this.h=ve(e),this.i=t==wa,this.g=0}function ba(){return new De(2,3,3e3)}fa.prototype.destroy=function(){var e=this;return this.g?this.h:(this.g=!0,this.i().then((function(){e.h.resolve()}),(function(){e.h.resolve()})))},(i=ya.prototype).sa=function(){return this.g<this.h.byteLength},i.ya=function(){return this.g},i.getLength=function(){return this.h.byteLength},i.T=function(){try{var e=this.h.getUint8(this.g);return this.g+=1,e}catch(e){throw ba()}},i.ma=function(){try{var e=this.h.getUint16(this.g,this.i);return this.g+=2,e}catch(e){throw ba()}},i.P=function(){try{var e=this.h.getUint32(this.g,this.i);return this.g+=4,e}catch(e){throw ba()}},i.Vg=function(){try{var e=this.h.getInt32(this.g,this.i);return this.g+=4,e}catch(e){throw ba()}},i.Vc=function(){try{if(this.i)var e=this.h.getUint32(this.g,!0),t=this.h.getUint32(this.g+4,!0);else t=this.h.getUint32(this.g,!1),e=this.h.getUint32(this.g+4,!1)}catch(e){throw ba()}if(2097151<t)throw new De(2,3,3001);return this.g+=8,t*Math.pow(2,32)+e},i.vb=function(e){if(this.g+e>this.h.byteLength)throw ba();var t=ge(this.h,this.g,e);return this.g+=e,t},i.skip=function(e){if(this.g+e>this.h.byteLength)throw ba();this.g+=e},i.Si=function(e){if(this.g<e)throw ba();this.g-=e},i.seek=function(e){if(0>e||e>this.h.byteLength)throw ba();this.g=e},i.yc=function(){for(var e=this.g;this.sa()&&0!=this.h.getUint8(this.g);)this.g+=1;return e=ge(this.h,e,this.g-e),this.g+=1,dt(e)},F("shaka.util.DataViewReader",ya),ya.prototype.readTerminatedString=ya.prototype.yc,ya.prototype.seek=ya.prototype.seek,ya.prototype.rewind=ya.prototype.Si,ya.prototype.skip=ya.prototype.skip,ya.prototype.readBytes=ya.prototype.vb,ya.prototype.readUint64=ya.prototype.Vc,ya.prototype.readInt32=ya.prototype.Vg,ya.prototype.readUint32=ya.prototype.P,ya.prototype.readUint16=ya.prototype.ma,ya.prototype.readUint8=ya.prototype.T,ya.prototype.getLength=ya.prototype.getLength,ya.prototype.getPosition=ya.prototype.ya,ya.prototype.hasMoreData=ya.prototype.sa;var wa=1;function Ta(){this.i=[],this.h=[],this.g=!1}function Sa(e){for(var t=Ca(e);e.reader.sa()&&!e.parser.g;)e.parser.Sc(e.start+t,e.reader,e.partialOkay)}function xa(e){for(var t=Ca(e),n=e.reader.P(),i=0;i<n&&(e.parser.Sc(e.start+t,e.reader,e.partialOkay),!e.parser.g);i++);}function Aa(e){var t=Ca(e);for(e.reader.skip(78);e.reader.sa()&&!e.parser.g;)e.parser.Sc(e.start+t,e.reader,e.partialOkay)}function Ea(e){var t=Ca(e);e.reader.skip(8);var n=e.reader.ma();for(e.reader.skip(6),2==n?e.reader.skip(48):e.reader.skip(12),1==n&&e.reader.skip(16);e.reader.sa()&&!e.parser.g;)e.parser.Sc(e.start+t,e.reader,e.partialOkay)}function ka(e){return function(t){e(t.reader.vb(t.reader.getLength()-t.reader.ya()))}}function Ia(e){for(var t=0,n=(e=l(e)).next();!n.done;n=e.next())t=t<<8|n.value.charCodeAt(0);return t}function Ma(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)}function Ca(e){return 8+(e.has64BitSize?8:0)+(null!=e.flags?4:0)}ya.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:wa},(i=Ta.prototype).box=function(e,t){return e=Ia(e),this.i[e]=Da,this.h[e]=t,this},i.R=function(e,t){return e=Ia(e),this.i[e]=Ra,this.h[e]=t,this},i.stop=function(){this.g=!0},i.parse=function(e,t,n){for(e=new ya(e,0),this.g=!1;e.sa()&&!this.g;)this.Sc(0,e,t,n)},i.Sc=function(e,t,n,i){var r=t.ya();if(i&&r+8>t.getLength())this.g=!0;else{var a=t.P(),o=t.P(),s=Ma(o),u=!1;switch(a){case 0:a=t.getLength()-r;break;case 1:if(i&&t.ya()+8>t.getLength())return void(this.g=!0);a=t.Vc(),u=!0}var l=this.h[o];if(l){var c=null,d=null;if(this.i[o]==Ra){if(i&&t.ya()+4>t.getLength())return void(this.g=!0);c=(d=t.P())>>>24,d&=16777215}o=r+a,n&&o>t.getLength()&&(o=t.getLength()),i&&o>t.getLength()?this.g=!0:(i=o-t.ya(),l({name:s,parser:this,partialOkay:n||!1,version:c,flags:d,reader:t=new ya(t=0<i?t.vb(i):new Uint8Array(0),0),size:a,start:r+e,has64BitSize:u}))}else t.skip(Math.min(r+a-t.ya(),t.getLength()-t.ya()))}},F("shaka.util.Mp4Parser",Ta),Ta.headerSize=Ca,Ta.typeToString=Ma,Ta.allData=ka,Ta.audioSampleEntry=Ea,Ta.visualSampleEntry=Aa,Ta.sampleDescription=xa,Ta.children=Sa,Ta.prototype.parseNext=Ta.prototype.Sc,Ta.prototype.parse=Ta.prototype.parse,Ta.prototype.stop=Ta.prototype.stop,Ta.prototype.fullBox=Ta.prototype.R,Ta.prototype.box=Ta.prototype.box;var Da=0,Ra=1;function Pa(e){var t=this;this.g=[],this.h=[],this.data=[],(new Ta).box("moov",Sa).box("moof",Sa).R("pssh",(function(e){if(!(1<e.version)){var n=ge(e.reader.h,-12,e.size);if(t.data.push(n),t.g.push(ci(e.reader.vb(16))),0<e.version){n=e.reader.P();for(var i=0;i<n;i++){var r=ci(e.reader.vb(16));t.h.push(r)}}}})).parse(e)}function La(e,t,n,i){var r=e.length,a=t.length+16+r;0<i&&(a+=4+16*n.size);var o=new Uint8Array(a),s=ve(o),u=0;if(s.setUint32(u,a),u+=4,s.setUint32(u,1886614376),u+=4,1>i?s.setUint32(u,0):s.setUint32(u,16777216),u+=4,o.set(t,u),u+=t.length,0<i)for(s.setUint32(u,n.size),u+=4,n=(t=l(n)).next();!n.done;n=t.next())n=li(n.value),o.set(n,u),u+=n.length;return s.setUint32(u,r),o.set(e,u+4),o}function Na(e){var t=this;this.C=e,this.l=this.A=null,this.ja=this.fa=!1,this.H=0,this.g=null,this.o=new Z,this.i=new Map,this.Y=[],this.B=new Map,this.K=!1,this.m=new Gr,this.h=null,this.s=function(n){2==n.severity&&t.m.reject(n),e.onError(n)},this.aa=new Map,this.ga=new Map,this.L=new Be((function(){return function(e){var t=e.aa,n=e.ga;n.clear(),t.forEach((function(e,t){return n.set(t,e)})),(t=Array.from(n.values())).length&&t.every((function(e){return"expired"==e}))&&e.s(new De(2,6,6014)),e.C.ee(va(n))}(t)})),this.O=!1,this.M=[],this.Z=!1,this.I=new Be((function(){!function(e){e.i.forEach((function(t,n){var i=t.Df,r=n.expiration;isNaN(r)&&(r=1/0),r!=i&&(e.C.onExpirationUpdated(n.sessionId,r),t.Df=r)}))}(t)})),this.m.catch((function(){})),this.j=new fa((function(){return function(e){return P((function(t){switch(t.g){case 1:return e.o.release(),e.o=null,e.m.reject(),e.I.stop(),e.I=null,e.L.stop(),e.L=null,w(t,za(e),2);case 2:if(!e.l){t.u(3);break}return S(t,4),w(t,e.l.setMediaKeys(null),6);case 6:A(t,5);break;case 4:E(t);case 5:e.l=null;case 3:e.g=null,e.A=null,e.B=new Map,e.h=null,e.s=function(){},e.C=null,e.da=!1,e.G=null,T(t)}}))}(t)})),this.da=!1,this.F=this.G=null,this.S=function(){return!1}}function ja(e,t,n){e.B=new Map;for(var i=(n=l(n)).next();!i.done;i=n.next())e.B.set(i.value,{initData:null,initDataType:null});for(i=(n=l(e.h.persistentSessionsMetadata)).next();!i.done;i=n.next())i=i.value,e.B.set(i.sessionId,{initData:i.initData,initDataType:i.initDataType});return e.O=0<e.B.size,Oa(e,t)}function Oa(e,t){var n,i,r,a,o,s,u,c,d,h,f,p,g,m,v,y,b;return P((function(T){if(1==T.g){if(n=function(e){return 0==(e=ma(e.h.clearKeys)).size?null:pi(e)}(e))for(i=l(t),r=i.next();!r.done;r=i.next())(a=r.value).video&&(a.video.drmInfos=[n]),a.audio&&(a.audio.drmInfos=[n]);for((o=t.some((function(e){return!!(e.video&&e.video.drmInfos.length||e.audio&&e.audio.drmInfos.length)})))||(s=ma(e.h.servers),function(e,t){var n=[];for(t.forEach((function(e,t){n.push({keySystem:t,licenseServerUri:e,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",initData:[],keyIds:new Set})})),t=(e=l(e)).next();!t.done;t=e.next())(t=t.value).video&&(t.video.drmInfos=n),t.audio&&(t.audio.drmInfos=n)}(t,s)),u=new Set,c=l(t),d=c.next();!d.done;d=c.next())for(h=d.value,f=Wa(h),p=l(f),g=p.next();!g.done;g=p.next())m=g.value,u.add(m);for(v=l(u),y=v.next();!y.done;y=v.next())$a(y.value,ma(e.h.servers),ma(e.h.advanced||{}),e.h.keySystemsMapping);return w(T,sr(t,e.O,e.da,e.h.preferredKeySystems),2)}return pa(e.j),o||Object.keys(e.h.servers).length?(b=Va(e,void 0,t),T.return(o?b:b.catch((function(){})))):(e.fa=!0,T.return(Promise.resolve()))}))}function Ua(e){var t;return P((function(n){switch(n.g){case 1:if(e.l.mediaKeys)return n.return();if(!e.G){n.u(2);break}return w(n,e.G,3);case 3:return pa(e.j),n.return();case 2:return S(n,4),e.G=e.l.setMediaKeys(e.A),w(n,e.G,6);case 6:A(n,5);break;case 4:t=E(n),e.s(new De(2,6,6003,t.message));case 5:pa(e.j),T(n)}}))}function _a(e){var t,n,i,r;return P((function(a){if(1==a.g)return e.B.size?(e.B.forEach((function(t,n){Ka(e,n,t)})),w(a,e.m,3)):a.u(2);if(2!=a.g){if(0<(e.g&&e.g.keyIds||new Set([])).size&&function(e){for(var t=l(e.g&&e.g.keyIds||new Set([])),n=t.next();!n.done;n=t.next())if("usable"!==e.aa.get(n.value))return!1;return!0}(e))return a.return(e.m);e.K=!1,e.m=new Gr,e.m.catch((function(){}))}for(t=(e.g?e.g.initData:[])||[],n=l(t),i=n.next();!i.done;i=n.next())r=i.value,Ba(e,r.initDataType,r.initData);return Ya(e)&&e.m.resolve(),a.return(e.m)}))}function Ba(e,t,n){if(n.length){if(e.h.ignoreDuplicateInitData){for(var i=e.i.values(),r=(i=l(i)).next();!r.done;r=i.next())if(fe(n,r.value.initData))return;var a=!1;if(e.B.forEach((function(e){!a&&fe(n,e.initData)&&(a=!0)})),a)return}e.K=!0,0<e.i.size&&Ya(e)&&(e.m.resolve(),e.K=!1,e.m=new Gr,e.m.catch((function(){}))),function(e,t,n,i){try{var r=e.A.createSession(i)}catch(t){return void e.s(new De(2,6,6005,t.message))}e.o.D(r,"message",(function(t){e.l&&e.h.delayLicenseRequestUntilPlayed&&e.l.paused&&!e.Z?e.M.push(t):Xa(e,t)})),e.o.D(r,"keystatuseschange",(function(t){return qa(e,t)})),e.i.set(r,{initData:n,initDataType:t,loaded:!1,Df:1/0,nb:null,type:i});try{n=e.h.initDataTransform(n,t,e.g)}catch(n){return t=n,n instanceof De||(t=new De(2,6,6016,n)),void e.s(t)}e.h.logLicenseExchange&&si(n),r.generateRequest(t,n).catch((function(t){if(!e.j.g){e.i.delete(r);var n=t.errorCode;if(n&&n.systemCode){var i=n.systemCode;0>i&&(i+=Math.pow(2,32)),i="0x"+i.toString(16)}e.s(new De(2,6,6006,t.message,t,i))}}))}(e,t,n,e.g.sessionType)}}function Fa(e){return e=ga(e=e.i.keys(),(function(e){return e.sessionId})),Array.from(e)}function Va(e,t,n){var i,r,a,o,s,u,c;return P((function(d){switch(d.g){case 1:if(i=new Map,n.length){r=function(e,t,n){for(var i=l(t),r=i.next();!r.done;r=i.next())for(var a=(r=l(Wa(r.value))).next();!a.done;a=r.next())a=a.value,n.has(a.keySystem)||n.set(a.keySystem,[]),n.get(a.keySystem).push(a);if(1==n.size&&n.has(""))throw new De(2,6,6e3);for(a=(i=l(e.h.preferredKeySystems)).next(),r={};!a.done;r={Ug:void 0},a=i.next()){r.Ug=a.value;for(var o=(a=l(t)).next();!o.done;o=a.next())if(o=o.value.decodingInfos.find(function(e){return function(t){return t.supported&&null!=t.keySystemAccess&&t.keySystemAccess.keySystem==e.Ug}}(r)))return o.keySystemAccess}for(r=(i=l([!0,!1])).next();!r.done;r=i.next())for(r=r.value,o=(a=l(t)).next();!o.done;o=a.next())for(var s=(o=l(o.value.decodingInfos)).next();!s.done;s=o.next())if((s=s.value).supported&&s.keySystemAccess){var u=s.keySystemAccess.keySystem,c=n.get(u);for(!c&&e.h.keySystemsMapping[u]&&(c=n.get(e.h.keySystemsMapping[u])),c=(u=l(c)).next();!c.done;c=u.next())if(!!c.value.licenseServerUri==r)return s.keySystemAccess}return null}(e,n,i),d.u(2);break}return w(d,function(e,t){var n,i,r,a,o,s,u,c,d,h,f,p,g,m,v,y;return P((function(b){switch(b.g){case 1:if(1==t.size&&t.has(""))throw new De(2,6,6e3);for(i=l(t.values()),r=i.next();!r.done;r=i.next())0==(a=r.value).audioCapabilities.length&&delete a.audioCapabilities,0==a.videoCapabilities.length&&delete a.videoCapabilities;o=l(e.h.preferredKeySystems),s=o.next();case 2:if(s.done){b.u(4);break}if(u=s.value,!t.has(u)){b.u(3);break}return c=t.get(u),S(b,6),w(b,navigator.requestMediaKeySystemAccess(u,[c]),8);case 8:return n=b.h,b.return(n);case 6:E(b);case 7:pa(e.j);case 3:s=o.next(),b.u(2);break;case 4:d=l([!0,!1]),h=d.next();case 9:if(h.done){b.u(11);break}f=h.value,p=l(t.keys()),g=p.next();case 12:if(g.done){h=d.next(),b.u(9);break}if(m=g.value,v=t.get(m),y=v.drmInfos.some((function(e){return!!e.licenseServerUri})),y!=f){b.u(13);break}return S(b,15),w(b,navigator.requestMediaKeySystemAccess(m,[v]),17);case 17:return n=b.h,b.return(n);case 15:E(b);case 16:pa(e.j);case 13:g=p.next(),b.u(12);break;case 11:return b.return(n)}}))}(e,t),3);case 3:r=d.h;case 2:if(!(a=r))throw new De(2,6,6001);if(pa(e.j),S(d,4),a.getConfiguration(),o=e.h.keySystemsMapping[a.keySystem]||a.keySystem,n.length){var h=o,f=i.get(o),p=[],g=[],m=[],v=[],y=[],b=new Set,T=new Set;Ja(f,p,g,v,m,y,b,T);var x=e.O?"persistent-license":"temporary";for(h={keySystem:h,encryptionScheme:p[0],licenseServerUri:g[0],distinctiveIdentifierRequired:f[0].distinctiveIdentifierRequired,persistentStateRequired:f[0].persistentStateRequired,sessionType:f[0].sessionType||x,audioRobustness:f[0].audioRobustness||"",videoRobustness:f[0].videoRobustness||"",serverCertificate:v[0],serverCertificateUri:m[0],initData:y,keyIds:b},0<T.size&&(h.keySystemUris=T),T=(f=l(f)).next();!T.done;T=f.next())(T=T.value).distinctiveIdentifierRequired&&(h.distinctiveIdentifierRequired=T.distinctiveIdentifierRequired),T.persistentStateRequired&&(h.persistentStateRequired=T.persistentStateRequired);f=h}else f=o,T=t.get(o),h=[],p=[],g=[],m=[],v=[],y=new Set,Ja(T.drmInfos,h,p,m,g,v,y),f={keySystem:f,encryptionScheme:h[0],licenseServerUri:p[0],distinctiveIdentifierRequired:"required"==T.distinctiveIdentifier,persistentStateRequired:"required"==T.persistentState,sessionType:T.sessionTypes[0]||"temporary",audioRobustness:(T.audioCapabilities?T.audioCapabilities[0].robustness:"")||"",videoRobustness:(T.videoCapabilities?T.videoCapabilities[0].robustness:"")||"",serverCertificate:m[0],serverCertificateUri:g[0],initData:v,keyIds:y};if(e.g=f,!e.g.licenseServerUri)throw new De(2,6,6012,e.g.keySystem);return w(d,a.createMediaKeys(),6);case 6:if(s=d.h,pa(e.j),e.A=s,""==e.h.minHdcpVersion||!("getStatusForPolicy"in e.A)){d.u(7);break}return S(d,8),w(d,e.A.getStatusForPolicy({minHdcpVersion:e.h.minHdcpVersion}),10);case 10:if("usable"!=d.h)throw new De(2,6,6018);pa(e.j),A(d,7,4);break;case 8:if((u=E(d,4))instanceof De)throw u;throw new De(2,6,6019,u.message);case 7:return e.fa=!0,w(d,function(e){var t,n;return P((function(i){switch(i.g){case 1:if(!e.A||!e.g)return i.return();if(!e.g.serverCertificateUri||e.g.serverCertificate&&e.g.serverCertificate.length){i.u(2);break}return t=aa([e.g.serverCertificateUri],e.h.retryParameters),S(i,3),w(i,e.C.Nb.request(5,t,{isPreload:e.S()}).promise,5);case 5:n=i.h,e.g.serverCertificate=ge(n.data),A(i,4);break;case 3:throw new De(2,6,6017,E(i));case 4:if(e.j.g)return i.return();case 2:return e.g.serverCertificate&&e.g.serverCertificate.length?(S(i,6),w(i,e.A.setServerCertificate(e.g.serverCertificate),8)):i.return();case 8:A(i,0);break;case 6:throw new De(2,6,6004,E(i).message)}}))}(e),11);case 11:pa(e.j),A(d,0);break;case 4:if(c=E(d),pa(e.j,c),e.g=null,c instanceof De)throw c;throw new De(2,6,6002,c.message)}}))}function Ha(e){Ya(e)&&e.m.resolve()}function Ga(e,t){new Be((function(){t.loaded=!0,Ha(e)})).$(Za)}function Ka(e,t,n){var i,r,a,o,s,u,l;return P((function(c){switch(c.g){case 1:try{i=e.A.createSession("persistent-license")}catch(t){return r=new De(2,6,6005,t.message),e.s(r),c.return(Promise.reject(r))}return e.o.D(i,"message",(function(t){e.l&&e.h.delayLicenseRequestUntilPlayed&&e.l.paused&&!e.Z?e.M.push(t):Xa(e,t)})),e.o.D(i,"keystatuseschange",(function(t){return qa(e,t)})),a={initData:n.initData,initDataType:n.initDataType,loaded:!1,Df:1/0,nb:null,type:"persistent-license"},e.i.set(i,a),S(c,2),w(c,i.load(t),4);case 4:return o=c.h,pa(e.j),o||(e.i.delete(i),s=e.h.persistentSessionOnlinePlayback?1:2,e.s(new De(s,6,6013)),a.loaded=!0),Ga(e,a),Ha(e),c.return(i);case 2:u=E(c),pa(e.j,u),e.i.delete(i),l=e.h.persistentSessionOnlinePlayback?1:2,e.s(new De(l,6,6005,u.message)),a.loaded=!0,Ha(e);case 3:return c.return(Promise.resolve())}}))}function Xa(e,t){var n,i,r,a,o,s,u,c,d,h,f,p,g,m;P((function(v){switch(v.g){case 1:if(n=t.target,e.h.logLicenseExchange&&si(t.message),i=e.i.get(n),r=e.g.licenseServerUri,a=e.h.advanced[e.g.keySystem],"individualization-request"==t.messageType&&a&&a.individualizationServer&&(r=a.individualizationServer),(o=aa([r],e.h.retryParameters)).body=t.message,o.method="POST",o.licenseRequestType=t.messageType,o.sessionId=n.sessionId,o.drmInfo=e.g,i&&(o.initData=i.initData,o.initDataType=i.initDataType),a&&a.headers)for(s in a.headers)o.headers[s]=a.headers[s];if(je(e.g.keySystem)){var y=ht(o.body,!0,!0);if(y.includes("PlayReadyKeyMessage")){for(var b=Ut(y=Dt(y,"PlayReadyKeyMessage"),"HttpHeader"),x=(b=l(b)).next();!x.done;x=b.next()){var k=x.value;x=Ut(k,"name")[0],k=Ut(k,"value")[0],o.headers[jt(x)]=jt(k)}y=Ut(y,"Challenge")[0],o.body=ui(jt(y))}else o.headers["Content-Type"]="text/xml; charset=utf-8"}return u=Date.now(),S(v,2),d=e.C.Nb.request(2,o,{isPreload:e.S()}),e.Y.push(d),w(v,d.promise,4);case 4:c=v.h,Ie(e.Y,d),A(v,3);break;case 2:return h=E(v),e.j.g||(f=new De(2,6,6007,h),1==e.i.size?(e.s(f),i&&i.nb&&i.nb.reject(f)):(i&&i.nb&&i.nb.reject(f),e.i.delete(n),Ya(e)&&(e.m.resolve(),e.L.$(.1)))),v.return();case 3:return e.j.g?v.return():(e.H+=(Date.now()-u)/1e3,e.h.logLicenseExchange&&si(c.data),S(v,5),w(v,n.update(c.data),7));case 7:A(v,6);break;case 5:return p=E(v),g=new De(2,6,6008,p.message),e.s(g),i&&i.nb&&i.nb.reject(g),v.return();case 6:if(e.j.g)return v.return();m=new Jr("drmsessionupdate"),e.C.onEvent(m),i&&(i.nb&&i.nb.resolve(),Ga(e,i)),T(v)}}))}function qa(e,t){t=t.target;var n=e.i.get(t),i=!1;t.keyStatuses.forEach((function(t,r){if("string"==typeof r){var a=r;r=t,t=a}if(je(e.g.keySystem)&&16==r.byteLength&&(He()||$e())){var o=(a=ve(r)).getUint32(0,!0),s=a.getUint16(4,!0),u=a.getUint16(6,!0);a.setUint32(0,o,!1),a.setUint16(4,s,!1),a.setUint16(6,u,!1)}"status-pending"!=t&&(n.loaded=!0),"expired"==t&&(i=!0),r=ci(r).slice(0,32),e.aa.set(r,t)}));var r=t.expiration-Date.now();(0>r||i&&1e3>r)&&n&&!n.nb&&(e.i.delete(t),t.close().catch((function(){}))),Ya(e)&&(e.m.resolve(),e.L.$(eo))}function za(e){var t;return P((function(n){return t=Array.from(e.i.entries()),e.i.clear(),w(n,Promise.all(t.map((function(t){var n=(t=l(t)).next().value,i=t.next().value;return P((function(t){return 1==t.g?(S(t,2),e.ja||e.B.has(n.sessionId)||"persistent-license"!==i.type||e.h.persistentSessionOnlinePlayback?w(t,function(e){return P((function(t){return 1==t.g?(S(t,2),w(t,Ki(Qa,Promise.all([e.close(),e.closed])),4)):2!=t.g?A(t,0):(E(t),void T(t))}))}(n),5):w(t,n.remove(),5)):2!=t.g?A(t,0):(E(t),void T(t))}))}))),0)}))}function Wa(e){return(e.video?e.video.drmInfos:[]).concat(e.audio?e.audio.drmInfos:[])}function Ya(e){return function(e,t){for(var n=(e=l(e)).next();!n.done;n=e.next())if(!t(n.value))return!1;return!0}(e=e.i.values(),(function(e){return e.loaded}))}function Ja(t,n,i,r,a,o,s,u){for(var d=[],h=(t=l(t)).next(),f={};!h.done;f={ua:void 0},h=t.next()){if(f.ua=h.value,n.includes(f.ua.encryptionScheme)||n.push(f.ua.encryptionScheme),"org.w3.clearkey"==f.ua.keySystem&&f.ua.licenseServerUri.startsWith("data:application/json;base64,")?d.includes(f.ua.licenseServerUri)||d.push(f.ua.licenseServerUri):i.includes(f.ua.licenseServerUri)||i.push(f.ua.licenseServerUri),a.includes(f.ua.serverCertificateUri)||a.push(f.ua.serverCertificateUri),f.ua.serverCertificate&&(r.some(function(e){return function(t){return fe(t,e.ua.serverCertificate)}}(f))||r.push(f.ua.serverCertificate)),f.ua.initData)for(var p=(h=l(f.ua.initData)).next(),g={};!p.done;g={qf:void 0},p=h.next())g.qf=p.value,o.some(function(e){return function(t){var n=e.qf;return!(!t.keyId||t.keyId!=n.keyId)||t.initDataType==n.initDataType&&fe(t.initData,n.initData)}}(g))||o.push(g.qf);if(f.ua.keyIds)for(p=(h=l(f.ua.keyIds)).next();!p.done;p=h.next())s.add(p.value);if(f.ua.keySystemUris&&u)for(h=(f=l(f.ua.keySystemUris)).next();!h.done;h=f.next())u.add(h.value)}if(1==d.length)i.push(d[0]);else if(0<d.length){for(n=[],r=(d=l(d)).next();!r.done;r=d.next())r=e.atob(r.value.split("data:application/json;base64,").pop()),r=JSON.parse(r),n.push.apply(n,c(r.keys));d=JSON.stringify({keys:n}),i.push("data:application/json;base64,"+e.btoa(d))}}function $a(t,n,i,r){var a=t.keySystem;!a||"org.w3.clearkey"==a&&t.licenseServerUri||(n.size&&(n=n.get(a)||"",t.licenseServerUri=n),t.keyIds||(t.keyIds=new Set),(i=i.get(a))&&(t.distinctiveIdentifierRequired||(t.distinctiveIdentifierRequired=i.distinctiveIdentifierRequired),t.persistentStateRequired||(t.persistentStateRequired=i.persistentStateRequired),t.videoRobustness||(t.videoRobustness=i.videoRobustness),t.audioRobustness||(t.audioRobustness=i.audioRobustness),t.serverCertificate||(t.serverCertificate=i.serverCertificate),i.sessionType&&(t.sessionType=i.sessionType),t.serverCertificateUri||(t.serverCertificateUri=i.serverCertificateUri)),r[a]&&(t.keySystem=r[a]),e.cast&&e.cast.__platform__&&"com.microsoft.playready"==a&&(t.keySystem="com.chromecast.playready"))}(i=Na.prototype).destroy=function(){return this.j.destroy()},i.configure=function(e,t){this.h=e,t&&(this.S=t),this.I&&this.I.Ra(this.h.updateExpirationTime)},i.Tb=function(e){var t=this;return P((function(n){if(1==n.g)return t.A?(t.l=e,t.o.pa(t.l,"play",(function(){for(var e=l(t.M),n=e.next();!n.done;n=e.next())Xa(t,n.value);t.Z=!0,t.M=[]})),t.l.remote?(t.o.D(t.l.remote,"connect",(function(){return za(t)})),t.o.D(t.l.remote,"connecting",(function(){return za(t)})),t.o.D(t.l.remote,"disconnect",(function(){return za(t)}))):"webkitCurrentPlaybackTargetIsWireless"in t.l&&t.o.D(t.l,"webkitcurrentplaybacktargetiswirelesschanged",(function(){return za(t)})),t.F=t.g&&t.g.initData.find((function(e){return 0<e.initData.length}))||null,t.F||"com.apple.fps"!==t.g.keySystem||t.B.size?w(n,Ua(t),2):n.u(2)):(t.o.pa(e,"encrypted",(function(){t.s(new De(2,6,6010))})),n.return());_a(t).catch((function(){})),t.F||t.B.size||t.h.parseInbandPsshEnabled||t.o.D(t.l,"encrypted",(function(e){return function(e,t){return P((function(n){if(1==n.g)return w(n,Ua(e),2);Ba(e,t.initDataType,ge(t.initData)),T(n)}))}(t,e)})),T(n)}))},i.jf=function(){var e=this,t=this.i.keys();return t=ga(t,(function(t){var n=e.i.get(t);return{sessionId:t.sessionId,sessionType:n.type,initData:n.initData,initDataType:n.initDataType}})),Array.from(t)},i.gd=function(){for(var e=1/0,t=this.i.keys(),n=(t=l(t)).next();!n.done;n=t.next())n=n.value,isNaN(n.expiration)||(e=Math.min(e,n.expiration));return e},i.Od=function(){return va(this.ga)};var Qa=1,Za=5,eo=.5;function to(e,t,n){this.g=e,this.i=t,this.h=n}function no(e,t){return P((function(n){if(1==n.g)return w(n,function(e,t,n,i){return n=void 0===n?[]:n,i=void 0===i?{}:i,P((function(r){return 1==r.g?w(r,rr(e,t,0<t.offlineSessionIds.length,n,i),2):(function(e){e.textStreams=e.textStreams.filter((function(e){return Ui(e=xi(e.mimeType,e.codecs))}))}(t),w(r,function(e){var t,n,i,r,a,o,s;return P((function(u){switch(u.g){case 1:t=[],n=l(e.imageStreams),i=n.next();case 2:if(i.done){u.u(4);break}if(r=i.value,"application/mp4"==(a=r.mimeType)&&"mjpg"==r.codecs&&(a="image/jpg"),kr.has(a)){u.u(5);break}if(!(o=Ir.get(a))){kr.set(a,!1),u.u(5);break}return w(u,function(e){return new Promise((function(t){var n=new Image;n.src=e,"decode"in n?n.decode().then((function(){t(!0)})).catch((function(){t(!1)})):n.onload=n.onerror=function(){t(2===n.height)}}))}(o),7);case 7:s=u.h,kr.set(a,s);case 5:kr.get(a)&&t.push(r),i=n.next(),u.u(2);break;case 4:e.imageStreams=t,T(u)}}))}(t),0))}))}(e.h,t,e.g.drm.preferredKeySystems,e.g.drm.keySystemsMapping),2);if(e.g.streaming.dontChooseCodecs||nr(t,e.g.preferredVideoCodecs,e.g.preferredAudioCodecs,e.g.preferredDecodingAttributes,e.g.preferredTextFormats),!t.variants.some(yr))throw new De(2,4,4032);return n.return(ro(e,t))}))}function io(e,t){var n=e.g.restrictions;e=e.i;for(var i=!1,r=(t=l(t.variants)).next();!r.done;r=t.next()){var a=(r=r.value).allowedByApplication;r.allowedByApplication=ir(r,n,e),a!=r.allowedByApplication&&(i=!0)}return i}function ro(e,t){var n=io(e,t);if(t){var i=e.h?e.h.g:null;if(i&&e.h.A)for(var r=l(t.variants),a=r.next();!a.done;a=r.next())a=a.value,ao(e,i.keySystem,a.video),ao(e,i.keySystem,a.audio);oo(e,t)}return n}function ao(e,t,n){if(n)for(var i=(n=l(n.drmInfos)).next();!i.done;i=n.next())if((i=i.value).keySystem==t)for(var r=(i=l(i.initData||[])).next();!r.done;r=i.next())r=r.value,Ba(e.h,r.initDataType,r.initData)}function oo(e,t){e=e.h?e.h.Od():{};var n=Object.keys(e);n=n.length&&"00"==n[0];for(var i=!1,r=!1,a=new Set,o=new Set,s=(t=l(t.variants)).next();!s.done;s=t.next()){var u=[];(s=s.value).audio&&u.push(s.audio),s.video&&u.push(s.video);for(var c=(u=l(u)).next();!c.done;c=u.next())if((c=c.value).keyIds.size)for(var d=(c=l(c.keyIds)).next();!d.done;d=c.next()){d=d.value;var h=e[n?"00":d];h?so.includes(h)&&o.add(h):a.add(d)}s.allowedByApplication?s.allowedByKeySystem&&(i=!0):r=!0}if(!i)throw new De(2,4,4012,e={hasAppRestrictions:r,missingKeys:Array.from(a),restrictedKeyStatuses:Array.from(o)})}var so=["output-restricted","internal-error"];function uo(){}function lo(e,t){if(t){var n=co[t.toLowerCase()];if(n)return n}throw new De(2,4,4e3,e,t)}F("shaka.media.ManifestParser",uo),uo.unregisterParserByMime=function(e){delete co[e]},uo.registerParserByMime=function(e,t){co[e]=t},uo.registerParserByExtension=function(){oe("ManifestParser.registerParserByExtension","Please use an ManifestParser with registerParserByMime function.")},uo.AccessibilityPurpose={hk:"visually impaired",zj:"hard of hearing"};var co={};function ho(e,t,n,i,r){var a=po.value(),o=e.subarray(n.start,n.start+n.size),s=ve(o),u=new Uint8Array(n.size+a.byteLength);for(u.set(o,0),(o=ve(u)).setUint32(4,r),u.set(a,n.size),r=s.getUint32(4),o.setUint32(n.size+16,r),fo(u,0,u.byteLength),r=new Uint8Array(e.byteLength+u.byteLength),n=Ge()||He()?n.start:n.start+n.size,a=e.subarray(n),r.set(e.subarray(0,n)),r.set(u,n),r.set(a,n+u.byteLength),i=(e=l(i)).next();!i.done;i=e.next())fo(r,(i=i.value).start,i.size+u.byteLength);return u=ve(r,t.start),t=Ca(t),e=u.getUint32(t),u.setUint32(t,e+1),r}function fo(e,t,n){0!=(t=(e=ve(e,t)).getUint32(0))&&(1==t?(e.setUint32(8,n>>32),e.setUint32(12,4294967295&n)):e.setUint32(0,n))}var po=new Pe((function(){return new Uint8Array([0,0,0,80,115,105,110,102,0,0,0,12,102,114,109,97,0,0,0,0,0,0,0,20,115,99,104,109,0,0,0,0,99,101,110,99,0,1,0,0,0,0,0,40,115,99,104,105,0,0,0,32,116,101,110,99,0,0,0,0,0,0,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])}));function go(e,t,n,i,r,a,o){this.N=e,this.Ja=t,this.va=n,this.Qc=void 0===i?null:i,this.timescale=void 0===r?null:r,this.g=void 0===a?null:a,this.aesKey=void 0===o?null:o,this.mimeType=this.codecs=null}function mo(e,t){return e===t||(e&&t?e.Zb()==t.Zb()&&e.Xb()==t.Xb()&&Ce(e.N().sort(),t.N().sort())&&fe(e.pc(),t.pc()):e==t)}function vo(e,t,n,i,r,a,o,s,u,c,d,h,f,p,g,m){for(c=void 0===c?[]:c,p=void 0===p?bo:p,this.startTime=e,this.j=this.endTime=t,this.C=n,this.Ja=i,this.va=r,this.ba=a,this.timestampOffset=o,this.appendWindowStart=s,this.appendWindowEnd=u,this.g=c,this.tilesLayout=void 0===d?"":d,this.A=void 0===h?null:h,this.h=void 0===f?null:f,this.status=p,this.preload=!1,this.l=!0,this.m=!1,this.aesKey=void 0===g?null:g,this.thumbnailSprite=null,this.i=-1,this.s=void 0!==m&&m,this.F=this.o=!1,t=(e=l(this.g)).next();!t.done;t=e.next())t.value.Ng();this.s&&this.g.length&&this.g[this.g.length-1].Mg(),this.B=this.bandwidth=this.mimeType=this.codecs=null}function yo(e,t){e.ba=t;for(var n=(e=l(e.g)).next();!n.done;n=e.next())yo(n.value,t)}go.prototype.Zb=function(){return this.Ja},go.prototype.Xb=function(){return this.va},go.prototype.pc=function(){return this.g},F("shaka.media.InitSegmentReference",go),go.prototype.getEndByte=go.prototype.Xb,go.prototype.getStartByte=go.prototype.Zb,(i=vo.prototype).N=function(){return this.C()},i.getStartTime=function(){return this.startTime},i.Ph=function(){return this.endTime},i.Zb=function(){return this.Ja},i.Xb=function(){return this.va},i.hi=function(){return this.tilesLayout},i.gi=function(){return this.A},i.$b=function(){return this.status},i.Ai=function(){this.status=wo},i.Af=function(){this.preload=!0},i.isPreload=function(){return this.preload},i.Pc=function(){this.l=!1},i.si=function(){return this.l},i.Ng=function(){this.o=!0},i.ui=function(){return this.o},i.Mg=function(){this.F=!0},i.ti=function(){return this.F},i.Lg=function(){this.m=!0},i.ni=function(){return this.m},i.qe=function(e){this.thumbnailSprite=e},i.fi=function(){return this.thumbnailSprite},i.offset=function(e){this.startTime+=e,this.endTime+=e,this.j+=e;for(var t=l(this.g),n=t.next();!n.done;n=t.next())(n=n.value).startTime+=e,n.endTime+=e,n.j+=e},i.Yf=function(e){null==this.h?z("Sync attempted without sync time!"):(e=this.h-e-this.startTime,.001<=Math.abs(e)&&this.offset(e))},i.cj=function(e){this.B=e},i.pc=function(){return this.B},F("shaka.media.SegmentReference",vo),vo.prototype.getSegmentData=vo.prototype.pc,vo.prototype.setSegmentData=vo.prototype.cj,vo.prototype.syncAgainst=vo.prototype.Yf,vo.prototype.offset=vo.prototype.offset,vo.prototype.getThumbnailSprite=vo.prototype.fi,vo.prototype.setThumbnailSprite=vo.prototype.qe,vo.prototype.hasByterangeOptimization=vo.prototype.ni,vo.prototype.markAsByterangeOptimization=vo.prototype.Lg,vo.prototype.isLastPartial=vo.prototype.ti,vo.prototype.markAsLastPartial=vo.prototype.Mg,vo.prototype.isPartial=vo.prototype.ui,vo.prototype.markAsPartial=vo.prototype.Ng,vo.prototype.isIndependent=vo.prototype.si,vo.prototype.markAsNonIndependent=vo.prototype.Pc,vo.prototype.isPreload=vo.prototype.isPreload,vo.prototype.markAsPreload=vo.prototype.Af,vo.prototype.markAsUnavailable=vo.prototype.Ai,vo.prototype.getStatus=vo.prototype.$b,vo.prototype.getTileDuration=vo.prototype.gi,vo.prototype.getTilesLayout=vo.prototype.hi,vo.prototype.getEndByte=vo.prototype.Xb,vo.prototype.getStartByte=vo.prototype.Zb,vo.prototype.getEndTime=vo.prototype.Ph,vo.prototype.getStartTime=vo.prototype.getStartTime,vo.prototype.getUris=vo.prototype.N;var bo=0,wo=1;function To(e){return 1==e.length&&1e-4>e.end(0)-e.start(0)}function So(e){return!e||To(e)?null:e.length?e.end(e.length-1):null}function xo(e,t){return!(!e||!e.length||To(e)||t>e.end(e.length-1))&&t>=e.start(0)}function Ao(e,t){if(!e||!e.length||To(e))return 0;for(var n=0,i=(e=l(Eo(e))).next();!i.done;i=e.next()){var r=i.value;i=r.start,(r=r.end)>t&&(n+=r-Math.max(i,t))}return n}function Eo(e){if(!e)return[];for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}function ko(){}function Io(e,t){var n=document.createElement("source");return n.src=e,n.type=void 0===t?"":t,n}function Mo(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Co(){}function Do(e,t){return t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&255>e[t+3]&&255>e[t+4]&&128>e[t+6]&&128>e[t+7]&&128>e[t+8]&&128>e[t+9]}function Ro(e,t){return t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&255>e[t+3]&&255>e[t+4]&&128>e[t+6]&&128>e[t+7]&&128>e[t+8]&&128>e[t+9]}function Po(e,t){var n=(127&e[t])<<21;return n|=(127&e[t+1])<<14,(n|=(127&e[t+2])<<7)|127&e[t+3]}function Lo(e){var t={key:e.type,description:"",data:"",mimeType:null,pictureType:null};if("APIC"===e.type){if(2>e.size||3!==e.data[0])return null;var n=e.data.subarray(1).indexOf(0);if(-1===n)return null;var i=dt(ge(e.data,1,n)),r=e.data[2+n],a=e.data.subarray(3+n).indexOf(0);if(-1===a)return null;var o,s=dt(ge(e.data,3+n,a));return o="--\x3e"===i?dt(ge(e.data,4+n+a)):pe(e.data.subarray(4+n+a)),t.mimeType=i,t.pictureType=r,t.description=s,t.data=o,t}return"TXXX"===e.type||"WXXX"===e.type?2>e.size||3!==e.data[0]||-1===(i=e.data.subarray(1).indexOf(0))?null:(n=dt(ge(e.data,1,i)),e=dt(ge(e.data,2+i)).replace(/\0*$/,""),t.description=n,t.data=e,t):"PRIV"===e.type?2>e.size||-1===(n=e.data.indexOf(0))?null:(n=dt(ge(e.data,0,n)),t.description=n,"com.apple.streaming.transportStreamTimestamp"==n?(n=e.data.subarray(n.length+1),e=1&n[3],n=(n[4]<<23)+(n[5]<<15)+(n[6]<<7)+n[7],n/=45,e&&(n+=47721858.84),t.data=n):(e=pe(e.data.subarray(n.length+1)),t.data=e),t):"T"===e.type[0]?2>e.size||3!==e.data[0]?null:(e=dt(e.data.subarray(1)).replace(/\0*$/,""),t.data=e,t):"W"===e.type[0]?(e=dt(e.data).replace(/\0*$/,""),t.data=e,t):e.data?(t.data=pe(e.data),t):null}function No(e){for(var t=0,n=[];Do(e,t);){var i=Po(e,t+6);for(e[t+5]>>6&1&&(t+=10),i=(t+=10)+i;t+10<i;){var r=e.subarray(t),a=Po(r,4);(a=Lo(r={type:String.fromCharCode(r[0],r[1],r[2],r[3]),size:a,data:r.subarray(10,10+a)}))&&n.push(a),t+=r.size+10}Ro(e,t)&&(t+=10)}return n}function jo(e,t){for(var n=t=void 0===t?0:t,i=0;Do(e,t);)e[t+5]>>6&1&&(i+=10),i+=10,i+=Po(e,t+6),Ro(e,t+10)&&(i+=10),t+=i;return 0<i?e.subarray(n,n+i):new Uint8Array([])}function Oo(e,t){var n=null,i=null,r=null,a=e.P();return 1&t&&(r=e.Vc()),2&t&&e.skip(4),8&t&&(n=e.P()),16&t&&(i=e.P()),{trackId:a,ed:n,Ld:i,jk:r}}function Uo(e,t){return 1==t?(t=e.P(),e=e.P(),{baseMediaDecodeTime:t*Math.pow(2,32)+e}):{baseMediaDecodeTime:e.P()}}function _o(e,t){return 1==t?(e.skip(8),e.skip(8)):(e.skip(4),e.skip(4)),t=e.P(),e.skip(4),e=e.ma(),{timescale:t,language:String.fromCharCode(96+(e>>10))+String.fromCharCode(96+((960&e)>>5))+String.fromCharCode(96+(31&e))}}function Bo(e,t,n){var i=e.P(),r=[],a=null;1&n&&(a=e.P()),4&n&&e.skip(4);for(var o=0;o<i;o++){var s={Of:null,sampleSize:null,me:null};256&n&&(s.Of=e.P()),512&n&&(s.sampleSize=e.P()),1024&n&&e.skip(4),2048&n&&(s.me=0==t?e.P():e.Vg()),r.push(s)}return{nk:i,Zg:r,Ih:a}}function Fo(e){e.skip(6),e.skip(2),e.skip(8);var t=e.ma();return e.skip(2),e.skip(2),e.skip(2),{channelCount:t,sampleRate:e=e.ma()+e.ma()/65536}}function Vo(e){return{codec:Ma(e=e.P())}}function Ho(e,t){return t=void 0!==t&&t,e=e.toString(16).toUpperCase(),t?e:("0"+e).slice(-2)}function Go(e){return(10>e?"0":"")+e}function Ko(e,t){if(this.j=e,void 0!==t&&t){t=new Uint8Array(e.byteLength);for(var n=0,i=0;i<e.byteLength;i++)2<=i&&3==e[i]&&0==e[i-1]&&0==e[i-2]||(t[n]=e[i],n++);this.j=ge(t,0,n)}this.i=this.j.byteLength,this.g=this.h=0}function Xo(e){var t=e.j.byteLength-e.i,n=new Uint8Array(4),i=Math.min(4,e.i);0!==i&&(n.set(e.j.subarray(t,t+i)),e.h=new ya(n,0).P(),e.g=8*i,e.i-=i)}function qo(e,t){if(e.g<=t){t-=e.g;var n=Math.floor(t/8);t-=8*n,e.g-=n,Xo(e)}e.h<<=t,e.g-=t}function zo(e,t){var n=Math.min(e.g,t),i=e.h>>>32-n;return e.g-=n,0<e.g?e.h<<=n:0<e.i&&Xo(e),0<(n=t-n)?i<<n|zo(e,n):i}function Wo(e){var t;for(t=0;t<e.g;++t)if(e.h&2147483648>>>t)return e.h<<=t,e.g-=t,t;return Xo(e),t+Wo(e)}function Yo(e){qo(e,1+Wo(e))}function Jo(e){return zo(e,Wo(e)+1)-1}function $o(e){return 1&(e=Jo(e))?1+e>>>1:-1*(e>>>1)}function Qo(e){return 1===zo(e,1)}function Zo(e){return zo(e,8)}function es(e,t){for(var n=8,i=8,r=0;r<t;r++)0!==i&&(i=(n+(i=$o(e))+256)%256),n=0===i?n:i}function ts(e){return Zo(e),Jo(e),Jo(e)}function ns(){this.G=null,this.H=!1,this.m=this.I=null,this.j=[],this.g=[],this.A=this.B=null,this.i=[],this.h=[],this.C=null,this.l=[],this.F=this.o=this.s=null}function is(e,t){if(1!=(t[0]<<16|t[1]<<8|t[2]))return null;var n={data:new Uint8Array(0),packetLength:t[4]<<8|t[5],pts:null,dts:null,nalus:[]};if(n.packetLength&&n.packetLength>t.byteLength-6)return null;var i=t[7];if(192&i){var r=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2;null==e.s&&(e.s=r),n.pts=as(r,e.s),e.s=n.pts,n.dts=n.pts,64&i&&(i=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2,null==e.o&&(e.o=i),n.dts=as(i,e.o)),e.o=n.dts}return e=t[8]+9,t.byteLength<=e?null:(n.data=t.subarray(e),n)}function rs(e){var t=e.sc();return 1<t.length&&(e=t[0].pts,t=t[1].pts,!isNaN(t-e))?String(1/(t-e)*9e4):null}function as(e,t){var n=1;for(e>t&&(n=-1);4294967296<Math.abs(t-e);)e+=8589934592*n;return e}function os(e){return!(0>ss(e))}function ss(e){for(var t=Math.min(1e3,e.length-564),n=0;n<t;){if(71==e[n]&&71==e[n+188]&&71==e[n+376])return n;n++}return-1}vo.Status={lj:bo,fk:wo,Hj:2},F("shaka.util.Dom",ko),ko.removeAllChildren=Mo,F("shaka.util.Id3Utils",Co),Co.getID3Data=jo,Co.getID3Frames=No,F("shaka.util.ExpGolomb",Ko),(i=ns.prototype).clearData=function(){this.j=[],this.g=[],this.i=[],this.h=[],this.l=[]},i.parse=function(e){if(564>e.length)return this;for(var t=Math.max(0,ss(e)),n=e.length-(e.length+t)%188,i=!1,r=t;r<n;r+=188)if(71==e[r]){var a=!!(64&e[r+1]),o=((31&e[r+1])<<8)+e[r+2];if(1<(48&e[r+3])>>4){var s=r+5+e[r+4];if(s==r+188)continue}else s=r+4;switch(o){case 0:a&&(s+=e[s]+1),this.G=(31&e[s+10])<<8|e[s+11];break;case 17:case 8191:break;case this.G:a&&(s+=e[s]+1),o={audio:-1,video:-1,Td:-1,audioCodec:"",videoCodec:""};var u=s+3+((15&(a=e)[s+1])<<8|a[s+2])-4;for(s+=12+((15&a[s+10])<<8|a[s+11]);s<u;){var l=(31&a[s+1])<<8|a[s+2],c=(15&a[s+3])<<8|a[s+4];switch(a[s]){case 6:if(0<c)for(var d=s+5,h=c;2<h;){var f=a[d+1]+2;switch(a[d]){case 5:var p=mt(a.subarray(d+2,d+f));-1==o.audio&&"Opus"===p?(o.audio=l,o.audioCodec="opus"):-1==o.video&&"AV01"===p&&(o.video=l,o.videoCodec="av1");break;case 106:-1==o.audio&&(o.audio=l,o.audioCodec="ac3");break;case 122:-1==o.audio&&(o.audio=l,o.audioCodec="ec3");break;case 124:-1==o.audio&&(o.audio=l,o.audioCodec="aac");break;case 127:"opus"==o.audioCodec&&(p=null,128===a[d+2]&&(p=a[d+3]),null!=p&&(this.F={channelCount:15&p?15&p:2,Fh:p,sampleRate:48e3}))}d+=f,h-=f}break;case 15:-1==o.audio&&(o.audio=l,o.audioCodec="aac");break;case 17:-1==o.audio&&(o.audio=l,o.audioCodec="aac-loas");break;case 21:-1==o.Td&&(o.Td=l);break;case 27:-1==o.video&&(o.video=l,o.videoCodec="avc");break;case 3:case 4:-1==o.audio&&(o.audio=l,o.audioCodec="mp3");break;case 36:-1==o.video&&(o.video=l,o.videoCodec="hvc");break;case 129:-1==o.audio&&(o.audio=l,o.audioCodec="ac3");break;case 132:case 135:-1==o.audio&&(o.audio=l,o.audioCodec="ec3")}s+=c+5}-1!=(a=o).video&&(this.I=a.video,this.m=a.videoCodec),-1!=a.audio&&(this.B=a.audio,this.A=a.audioCodec),-1!=a.Td&&(this.C=a.Td),i&&!this.H&&(i=!1,r=t-188),this.H=!0;break;case this.I:s=e.subarray(s,r+188),a?this.j.push([s]):this.j.length&&this.j[this.j.length-1]&&this.j[this.j.length-1].push(s);break;case this.B:s=e.subarray(s,r+188),a?this.i.push([s]):this.i.length&&this.i[this.i.length-1]&&this.i[this.i.length-1].push(s);break;case this.C:s=e.subarray(s,r+188),a?this.l.push([s]):this.l.length&&this.l[this.l.length-1]&&this.l[this.l.length-1].push(s);break;default:i=!0}}return this},i.Gi=function(e){return oe("TsParser.parseAvcNalus","Please use parseNalus function instead."),this.Gf(e)},i.Gf=function(e,t,n){var i=e.pts?e.pts/9e4:null,r=(e=e.data).byteLength,a=1;"hvc"==this.m&&(a=2);for(var o,s=n||0,u=[],l=-1,c=0,d=0;d<r;++d){var h=e[d];if(h){if(2<=s&&1==h){if(t&&!u.length&&-1==l&&(h=d-(3<s?3:s),n&&0!=h&&(h=e.subarray(0,h),t.data=di(t.data,h),t.fullData=di(t.fullData,h))),0<=l?(s=d-((3<s?3:s)+1),u.push({data:e.subarray(l+a,s+1),fullData:e.subarray(l,s+1),type:c,time:i})):t&&!u.length&&0<(l=d-s)&&(l=e.subarray(0,l),t.data=di(t.data,l),t.fullData=di(t.fullData,l)),d>=r-a)return u;l=++d,c="hvc"==this.m?e[d]>>1&63:31&e[d]}s=0}else s++;d>=r-1&&0<=l&&0<=s&&(o={data:e.subarray(l+a,r),fullData:e.subarray(l,r),type:c,time:i})}return o&&u.push(o),!u.length&&t&&(t.data=di(t.data,e),t.fullData=di(t.fullData,e)),u},i.getMetadata=function(){for(var e=[],t=l(this.l),n=t.next();!n.done;n=t.next())(n=is(this,n=di.apply(ai,c(n.value))))&&e.push({cueTime:n.pts?n.pts/9e4:null,data:n.data,frames:No(n.data),dts:n.dts,pts:n.pts});return e},i.Wb=function(){if(this.i.length&&!this.h.length){for(var e=!1,t=l(this.i),n=t.next();!n.done;n=t.next()){var i=di.apply(ai,c(n.value)),r=is(this,i);n=this.h.length?this.h[this.h.length-1]:null,r&&null!=r.pts&&null!=r.dts&&(!n||n.pts!=r.pts&&n.dts!=r.dts)?(this.h.length&&r.dts<(n.dts||0)&&(e=!0),this.h.push(r)):this.h.length&&(i=r?r.data:i)&&((n=this.h.pop()).data=di(n.data,i),this.h.push(n))}e&&(this.h=this.h.sort((function(e,t){var n=(e.pts||0)-(t.pts||0);return(e.dts||0)-(t.dts||0)||n})))}return this.h},i.sc=function(e){if(e=void 0===e||e,this.j.length&&!this.g.length){for(var t=!1,n=l(this.j),i=n.next();!i.done;i=n.next()){var r=di.apply(ai,c(i.value)),a=is(this,r);i=this.g.length?this.g[this.g.length-1]:null,a&&null!=a.pts&&null!=a.dts&&(!i||i.pts!=a.pts&&i.dts!=a.dts)?(this.g.length&&a.dts<(i.dts||0)&&(t=!0),this.g.push(a)):this.g.length&&(r=a?a.data:r)&&((i=this.g.pop()).data=di(i.data,r),this.g.push(i))}if(e){for(n=[],r=(i=l(this.g)).next();!r.done;r=i.next())if((r=r.value).nalus=this.Gf(r,o,void 0),r.nalus.length){n.push(r);var o=r.nalus[r.nalus.length-1]}this.g=n}t&&(this.g=this.g.sort((function(e,t){var n=(e.pts||0)-(t.pts||0);return(e.dts||0)-(t.dts||0)||n})))}return e?this.g:(e=this.g,this.g=[],e)},i.getStartTime=function(e){if("audio"==e){e=null;var t=this.Wb();return t.length&&(e=t[0],e=Math.min(e.dts,e.pts)/9e4),e}return"video"==e?(e=null,(t=this.sc(!1)).length&&(e=t[0],e=Math.min(e.dts,e.pts)/9e4),e):null},i.fd=function(){return{audio:this.A,video:this.m}},i.Rd=function(){for(var e=[],t=l(this.sc()),n=t.next();!n.done;n=t.next())e.push.apply(e,c(n.value.nalus));return e},i.ki=function(){oe("TsParser.getVideoResolution","Please use getVideoInfo function instead.");var e=this.nf();return{height:e.height,width:e.width}},i.nf=function(){return"hvc"==this.m?function(e){var t={height:null,width:null,codec:null,frameRate:null},n=e.Rd();if(!n.length)return t;if(!(n=n.find((function(e){return 33==e.type}))))return t;var i=new Ko(n.fullData,!0);Zo(i),Zo(i),zo(i,4);var r=zo(i,3);Qo(i);var a=zo(i,2),o=zo(i,1),s=zo(i,5),u=zo(i,32);n=Zo(i);for(var l=Zo(i),c=Zo(i),d=Zo(i),h=Zo(i),f=Zo(i),p=Zo(i),g=[],m=[],v=0;v<r;v++)g.push(Qo(i)),m.push(Qo(i));if(0<r)for(v=r;8>v;v++)zo(i,2);for(v=0;v<r;v++)g[v]&&zo(i,88),m[v]&&Zo(i);Jo(i),3==(r=Jo(i))&&zo(i,1),g=Jo(i),m=Jo(i);var y=v=0,b=0,w=0;return Qo(i)&&(v+=Jo(i),y+=Jo(i),b+=Jo(i),w+=Jo(i)),t.width=String(g-(v+y)*(1===r||2===r?2:1)),t.height=String(m-(b+w)*(1===r?2:1)),i=function(e){for(var t=0,n=0;32>n;n++)t|=(e>>n&1)<<31-n;return t>>>0}(u),o=1==o?"H":"L",a="hvc1."+["","A","B","C"][a]+s,a+="."+i.toString(16).toUpperCase(),a+="."+o+p,f&&(a+="."+f.toString(16).toUpperCase()),h&&(a+="."+h.toString(16).toUpperCase()),d&&(a+="."+d.toString(16).toUpperCase()),c&&(a+="."+c.toString(16).toUpperCase()),l&&(a+="."+l.toString(16).toUpperCase()),n&&(a+="."+n.toString(16).toUpperCase()),t.codec=a,t.frameRate=rs(e),t}(this):function(e){var t={height:null,width:null,codec:null,frameRate:null},n=e.Rd();if(!n.length)return t;if(!(n=n.find((function(e){return 7==e.type}))))return t;var i=Zo(n=new Ko(n.data)),r=Zo(n),a=Zo(n);if(Yo(n),us.includes(i)){var o=Jo(n);if(3===o&&qo(n,1),Yo(n),Yo(n),qo(n,1),Qo(n)){o=3!==o?8:12;for(var s=0;s<o;s++)Qo(n)&&es(n,6>s?16:64)}}if(Yo(n),0===(o=Jo(n)))Jo(n);else if(1===o)for(qo(n,1),Yo(n),Yo(n),o=Jo(n),s=0;s<o;s++)Yo(n);Yo(n),qo(n,1),o=Jo(n),s=Jo(n);var u=zo(n,1);0===u&&qo(n,1),qo(n,1);var l=0,c=0,d=0,h=0;return Qo(n)&&(l=Jo(n),c=Jo(n),d=Jo(n),h=Jo(n)),t.height=String((2-u)*(s+1)*16-2*d-2*h),t.width=String(16*(o+1)-2*l-2*c),t.codec="avc1."+("0"+i.toString(16).toUpperCase()).slice(-2)+("0"+r.toString(16).toUpperCase()).slice(-2)+("0"+a.toString(16).toUpperCase()).slice(-2),t.frameRate=rs(e),t}(this)},F("shaka.util.TsParser",ns),ns.syncOffset=ss,ns.probe=os,ns.prototype.getVideoInfo=ns.prototype.nf,ns.prototype.getVideoResolution=ns.prototype.ki,ns.prototype.getVideoNalus=ns.prototype.Rd,ns.prototype.getCodecs=ns.prototype.fd,ns.prototype.getStartTime=ns.prototype.getStartTime,ns.prototype.getVideoData=ns.prototype.sc,ns.prototype.getAudioData=ns.prototype.Wb,ns.prototype.getMetadata=ns.prototype.getMetadata,ns.prototype.parseNalus=ns.prototype.Gf,ns.prototype.parseAvcNalus=ns.prototype.Gi,ns.prototype.parse=ns.prototype.parse,ns.prototype.clearData=ns.prototype.clearData,ns.Timescale=9e4;var us=[100,110,122,244,44,83,86,118,128,138,139,134];function ls(e,t,n){this.g=null,this.o=-1,this.l=e,this.i=t,this.m=n,this.j=!1;e:{if("undefined"==typeof libDPIModule&&W("Could not find LCEVC Library dependencies on this page"),"undefined"!=typeof LCEVCdec)this.h=LCEVCdec;else{if("undefined"==typeof LcevcDil){W("Could not find LCEVC Library on this page"),e=!1;break e}this.h=LcevcDil,this.j=!0,oe("LcevcDil","lcevc_dil.js is deprecated, please use lcevc_dec.js instead")}void 0===this.h.SupportObject?(W("Could not find LCEVC Library on this page"),e=!1):(this.h.SupportObject.SupportStatus||W(this.h.SupportObject.SupportError),e=void 0!==this.h&&"undefined"!=typeof libDPIModule&&this.i instanceof HTMLCanvasElement&&this.h.SupportObject.SupportStatus)}e&&!this.g&&this.h.SupportObject.webGLSupport(this.i)&&(this.i.classList.remove("shaka-hidden"),this.g=this.j?new this.h.LcevcDil(this.l,this.i,this.m):new this.h.LCEVCdec(this.l,this.i,this.m))}function cs(e){e.g&&e.i.classList.add("shaka-hidden")}function ds(e,t,n){var i=0,r=-1;switch(t.mimeType){case"video/webm":i=1;break;case"video/mp4":i=2}switch(n){case"DASH":r=1;break;case"HLS":r=0}e.g&&(e.o=t.id,e.g.setLevelSwitching(t.id,!0),e.g.setContainerFormat(i),e.j||e.g.setStreamingFormat(r))}function hs(e,t,n,i){var r=this;this.g=e,this.F=n,this.A=null,this.fa=t,this.i={},this.G={},this.Ka={},this.h=null,this.xa=!1,this.da=i||null,this.o={},this.s=new Z,this.j={},this.H=null,this.S=new Gr,this.Aa="",this.Na=!1,this.ta=!0,this.Z=!1,this.B=this.K=null,this.l=fs(this,this.S),this.I=!1,this.L=new fa((function(){return function(e){var t,n,i,r,a,o,s;return P((function(u){if(1==u.g){for(n in t=[],e.o)for(i=e.o[n],r=i[0],e.o[n]=i.slice(0,1),r&&t.push(r.p.catch(Hi)),a=l(i.slice(1)),o=a.next();!o.done;o=a.next())o.value.p.reject(new De(2,7,7003,void 0));return e.h&&t.push(e.h.destroy()),w(u,Promise.all(t),2)}for(s in e.j)e.j[s].destroy();e.s&&(e.s.release(),e.s=null),e.g&&e.B&&e.g.removeChild(e.B),e.g&&e.K&&(e.g.removeChild(e.K),e.g.load(),e.g.disableRemotePlayback=!1),e.g=null,e.K=null,e.B=null,e.A=null,e.l=null,e.h=null,e.fa=null,e.i={},e.j={},e.H=null,e.o={},e.da=null,e.Y={},e.F=null,T(u)}))}(r)})),this.C=!1,this.aa="UNKNOWN",this.Ga=this.La=!1,this.Ba=new Gr,this.m=!1,this.na=null,this.Y={},this.ja=this.M=this.ra=this.O=null,this.ga=new Gr,this.g.remote&&(this.Z="disconnected"!=this.g.remote.state,this.s.D(this.g.remote,"connect",(function(){r.Z="disconnected"!=r.g.remote.state})),this.s.D(this.g.remote,"connecting",(function(){r.Z="disconnected"!=r.g.remote.state})),this.s.D(this.g.remote,"disconnect",(function(){r.Z="disconnected"!=r.g.remote.state})))}function fs(t,n){if(t.ta=!0,e.ManagedMediaSource){t.B||(t.g.disableRemotePlayback=!0);var i=new ManagedMediaSource;t.s.D(i,"startstreaming",(function(){t.ta=!0})),t.s.D(i,"endstreaming",(function(){t.ta=!1}))}else i=new MediaSource;return t.s.pa(i,"sourceopen",(function(){URL.revokeObjectURL(t.Aa),n.resolve()})),t.s.pa(t.g,"playing",(function(){t.Na=!0})),t.Aa=Rs(i),t.g.removeAttribute("src"),t.K&&t.g.removeChild(t.K),t.B&&t.g.removeChild(t.B),t.K=Io(t.Aa),t.g.appendChild(t.K),t.B&&t.g.appendChild(t.B),t.g.load(),i}function ps(e,t,n,i){var r,a,o,s,u,c,d,h,f,p,g,m;return P((function(v){switch(v.g){case 1:return r=bi,a=V,o=H,w(v,function(e,t){var n,i,r,a,o,s,u,c,d,h;return P((function(f){if(1==f.g)return e.createSegmentIndex?w(f,e.createSegmentIndex(),2):f.u(2);if(!e.segmentIndex)return f.return(!1);if(0==e.segmentIndex.getNumReferences())return f.return(!0);for(n=bi,i=new Set,r=l(e.segmentIndex),a=r.next();!a.done;a=r.next())if(o=a.value,s=o.mimeType||e.mimeType||"",u=o.codecs||e.codecs||"",c=s+":"+u,!i.has(c))if(i.add(c),t==n.wa){if(!Ui(xi(s,u)))return f.return(!1)}else if(t==n.la?u=cr(u):t==n.V&&(u=lr(u,s)),d=ki(e,s,u),h=Ai(s,u),!ne(d)&&!On(h))return f.return(!1);return f.return(!0)}))}(n,t),2);case 2:if(o.call(a,v.h,"Type negotiation should happen before MediaSourceEngine.init!"),s=xi(n.mimeType,i),t==r.wa){gs(e,s,e.C,n.external),v.u(0);break}if(u=e.A.forceTransmux,(!ne(s)||!e.C&&ji.includes(s))&&(u=!0),c=Ai(n.mimeType,i),!u){v.u(4);break}if(d=mi(r.V,(i||"").split(",")),h=mi(r.la,(i||"").split(",")),!d||!h){v.u(5);break}return e.m=!0,w(v,ps(e,r.V,n,d),6);case 6:return w(v,ps(e,r.la,n,h),7);case 7:return v.return();case 5:(f=On(c))&&(p=f(),e.j[t]=p,s=p.convertCodecs(t,c));case 4:g=s+e.A.addExtraFeaturesToSourceBuffer(s),pa(e.L);try{m=e.l.addSourceBuffer(g)}catch(t){throw new De(2,3,3015,t,"The mediaSource_ status was "+e.l.readyState+" expected 'open'",null)}e.C&&(m.mode=Ps),e.s.D(m,"error",(function(){var n=e.o[t][0];n.p.reject(new De(2,3,3014,e.g.error?e.g.error.code:0,n.uri))})),e.s.D(m,"updateend",(function(){return Es(e,t)})),e.i[t]=m,e.G[t]=s,e.Ka[t]=!!n.drmInfos.length,T(v)}}))}function gs(e,t,n,i){e.h||(e.h=new Oi(e.fa),e.h&&(e.h.A=e.A.modifyCueCallback));var r=e.h;i=i||e.xa,e=e.aa,"application/cea-608"==t||"application/cea-708"==t?r.i=null:(r.i=(0,Fi[t])(),r.i.setSequenceMode?r.i.setSequenceMode(n):oe("Text parsers w/ setSequenceMode",'Text parsers should have a "setSequenceMode" method!'),r.i.setManifestType?r.i.setManifestType(e):oe("Text parsers w/ setManifestType",'Text parsers should have a "setManifestType" method!'),r.B=i)}function ms(e){return!(e.I||e.l&&"ended"!=e.l.readyState)}function vs(e,t){return e=Object.keys(e.i).length?t==yi?e.h.g:!(e=bs(e,t))||To(e)?null:1==e.length&&0>e.start(0)?0:e.length?e.start(0):null:null}function ys(e,t){return Object.keys(e.i).length?t==yi?e.h.h:So(bs(e,t)):null}function bs(e,t){if(e.I||e.Z)return null;try{return e.i[t].buffered}catch(e){return null}}function ws(e,t,n,i,r,a,o,s,u,c){var d,h,f,p,g,m,v,y,b,S,x,A,E,k;return o=void 0!==o&&o,s=void 0!==s&&s,u=void 0!==u&&u,c=void 0!==c&&c,P((function(I){switch(I.g){case 1:if(t!=(d=bi).wa){I.u(2);break}if("HLS"!=e.aa){I.u(3);break}return w(I,e.Ba,4);case 4:h=I.h,e.h.s=h;case 3:return w(I,function(e,t,n,i,r){var a,o,s,u,c,d,h;return P((function(f){if(1==f.g)return w(f,Promise.resolve(),2);if(!e.i||!e.j)return f.return();if(null==n||null==i)return e.i.parseInit(ge(t)),f.return();for(a=e.B?n:e.s,o={periodStart:e.s,segmentStart:n,segmentEnd:i,vttOffset:a},s=e.i.parseMedia(ge(t),o,r,[]),u=l(s),c=u.next();!c.done;c=u.next())d=c.value,e.A(d,r||null,o);h=s.filter((function(t){return t.startTime>=e.l&&t.startTime<e.m})),e.j.append(h),null==e.g&&(e.g=Math.max(n,e.l)),e.h=Math.min(i,e.m),T(f)}))}(e.h,n,i?i.startTime:null,i?i.endTime:null,i?i.N()[0]:null),5);case 5:return I.return();case 2:if(c||!e.m){I.u(6);break}return w(I,ws(e,d.V,n,i,r,a,o,s,u,!0),7);case 7:return w(I,ws(e,d.la,n,i,r,a,o,s,u,!0),8);case 8:return I.return();case 6:if(!e.i[t])return I.return();if(f=e.i[t].timestampOffset,p=e.G[t],e.j[t]&&(p=e.j[t].getOriginalMimeType()),i&&(g=function(e,t,n,i,r,a){var o=null,s=[],u=ge(n);if(ji.includes(a))(t=No(u)).length&&i&&((n=t.find((function(e){return"com.apple.streaming.transportStreamTimestamp"===e.description})))&&(o=Math.round(n.data)/1e3),e.F.onMetadata([{cueTime:i.startTime,data:u,frames:t,dts:i.startTime,pts:i.startTime}],0,i.endTime));else if(a.includes("/mp4")&&i&&i.ba&&i.ba.timescale){var l=i.ba.timescale;if(!isNaN(l)){var c=0,d=!1;u=new Ta,(null!=r.emsgSchemeIdUris&&0<r.emsgSchemeIdUris.length||e.A.dispatchAllEmsgBoxes)&&u.R("emsg",(function(t){var n=r.emsgSchemeIdUris;if(0===t.version)var a=t.reader.yc(),o=t.reader.yc(),s=t.reader.P(),u=t.reader.P(),l=t.reader.P(),c=t.reader.P(),d=i.startTime+u/s;else s=t.reader.P(),u=(d=t.reader.Vc()/s+i.timestampOffset)-i.startTime,l=t.reader.P(),c=t.reader.P(),a=t.reader.yc(),o=t.reader.yc();t=t.reader.vb(t.reader.getLength()-t.reader.ya()),(n&&n.includes(a)||e.A.dispatchAllEmsgBoxes)&&("urn:mpeg:dash:event:2012"==a?e.F.Fi():(n=d+l/s,(s=new Jr("emsg",s=(new Map).set("detail",{startTime:d,endTime:n,schemeIdUri:a,value:o,timescale:s,presentationTimeDelta:u,eventDuration:l,id:c,messageData:t}))).cancelable=!0,e.F.onEvent(s),s.defaultPrevented||"https://aomedia.org/emsg/ID3"!=a&&"https://developer.apple.com/streaming/emsg-id3"!=a||!(a=No(t)).length||e.F.onMetadata([{cueTime:d,data:t,frames:a,dts:d,pts:d}],0,n)))})),u.R("prft",(function(t){var n=t.reader,i=t.version;n.P(),t=1e3*(t=n.P())+n.P()/Math.pow(2,32)*1e3,0===i?n=n.P():(i=n.P(),n=n.P(),n=i*Math.pow(2,32)+n),t=new Date(new Date(Date.UTC(1900,0,1,0,0,0)).getTime()+t).getTime(),n=new Jr("prft",n=(new Map).set("detail",{wallClockTime:t,programStartDate:new Date(t-n/l*1e3)})),e.F.onEvent(n)})).box("moof",Sa).box("traf",Sa).R("tfdt",(function(e){c=Uo(e.reader,e.version).baseMediaDecodeTime/l,d=!0,e.parser.stop()})).parse(n,!0),d&&0==i.timestampOffset&&(o=c)}}else a.includes("/mp4")||a.includes("/webm")||!os(u)||(e.Y[t]?e.Y[t].clearData():e.Y[t]=new ns,null!=(u=(s=e.Y[t].parse(u)).getStartTime(t))&&(o=u),s=s.getMetadata());return{timestamp:o,metadata:s}}(e,t,n,i,r,p),m=g.timestamp,v=g.metadata,null!=m&&(null==e.O&&t==d.la&&(e.O=m,e.ra=i.startTime,null!=e.M&&(y=0,e.ra==e.ja&&(y=e.O-e.M),e.ga.resolve(y))),null==e.M&&t==d.V&&(e.M=m,e.ja=i.startTime,null!=e.O&&(b=0,e.ra==e.ja&&(b=e.O-e.M),e.ga.resolve(b))),S=i.startTime-m,(.001<=Math.abs(f-S)||o||s)&&(!u||0<S||!f)&&(f=S,e.Ga&&(ks(e,t,(function(){return xs(e,t)}),null),ks(e,t,(function(){return As(e,t,f)}),null))),(t==d.la||!(d.la in e.i))&&e.Ba.resolve(f)),v.length)&&e.F.onMetadata(v,f,i?i.endTime:null),a&&t==d.la&&(e.h||gs(e,"application/cea-608",e.C,!1),e.H||(x=p.split(";",1)[0],e.H=new we(x)),i?(A=e.H.i(n)).length&&function(e,t,n,i,r){for(var a=n+" "+i,o=new Map,s=(t=l(t)).next();!s.done;s=t.next()){var u=s.value;s=u.stream,u=u.cue,o.has(s)||o.set(s,new Map),o.get(s).has(a)||o.get(s).set(a,[]),Bi(e,u,r),u.startTime>=e.l&&u.startTime<e.m&&(o.get(s).get(a).push(u),s==e.C&&e.j.append([u]))}for(a=(r=l(o.keys())).next();!a.done;a=r.next())for(a=a.value,e.o.has(a)||e.o.set(a,new Map),s=(t=l(o.get(a).keys())).next();!s.done;s=t.next())s=s.value,u=o.get(a).get(s),e.o.get(a).set(s,u);e.g=null==e.g?Math.max(n,e.l):Math.min(e.g,Math.max(n,e.l)),e.h=Math.max(e.h,Math.min(i,e.m))}(e.h,A,i.startTime,i.endTime,f):e.H.init(n,s)),!e.j[t]){I.u(9);break}return w(I,e.j[t].transmux(n,r,i,e.l.duration,t),10);case 10:n=I.h;case 9:if(n=function(e,t,n,i,r){var a=null==n,o=e.Ka[i];return n=e.F.Uh(),(a=e.A.insertFakeEncryptionInInit&&a&&o)&&(n=je(n),a=Ke()||Ge()||Ze()||He()&&tt()&&n),a&&"mp4"==Ii(e.G[i])&&(t=function(e,t){function n(){o=!0}function i(e){s.push(e),Sa(e)}var r,a=e=ge(e),o=!1,s=[],u=[];if((new Ta).box("moov",i).box("trak",i).box("mdia",i).box("minf",i).box("stbl",i).R("stsd",(function(e){r=e,s.push(e),xa(e)})).R("encv",n).R("enca",n).R("dvav",(function(e){u.push({box:e,Ta:1701733238})})).R("dva1",(function(e){u.push({box:e,Ta:1701733238})})).R("dvh1",(function(e){u.push({box:e,Ta:1701733238})})).R("dvhe",(function(e){u.push({box:e,Ta:1701733238})})).R("dvc1",(function(e){u.push({box:e,Ta:1701733238})})).R("dvi1",(function(e){u.push({box:e,Ta:1701733238})})).R("hev1",(function(e){u.push({box:e,Ta:1701733238})})).R("hvc1",(function(e){u.push({box:e,Ta:1701733238})})).R("avc1",(function(e){u.push({box:e,Ta:1701733238})})).R("avc3",(function(e){u.push({box:e,Ta:1701733238})})).R("ac-3",(function(e){u.push({box:e,Ta:1701733217})})).R("ec-3",(function(e){u.push({box:e,Ta:1701733217})})).R("ac-4",(function(e){u.push({box:e,Ta:1701733217})})).R("mp4a",(function(e){u.push({box:e,Ta:1701733217})})).parse(e),o)return e;if(0==u.length||!r)throw ci(e),new De(2,3,3019,t);u.reverse();for(var c=(t=l(u)).next();!c.done;c=t.next())c=c.value,a=ho(a,r,c.box,s,c.Ta);return He()&&tt()&&!Ge()?((t=new Uint8Array(e.byteLength+a.byteLength)).set(a),t.set(e,a.byteLength),t):a}(t,r)),t}(e,n,i?i.startTime:null,t,i?i.N()[0]:null),!i||!e.C||t==d.wa){I.u(11);break}if(!o&&!s){I.u(11);break}if(E=i.startTime,"HLS"!=e.aa||e.m||t!=d.V||!e.i[d.la]){I.u(13);break}return w(I,e.ga,14);case 14:k=I.h,.1<Math.abs(k)&&(E-=k);case 13:ks(e,t,(function(){return xs(e,t)}),null),ks(e,t,(function(){return As(e,t,E)}),null);case 11:return w(I,ks(e,t,(function(){var i=n;if("video"==t&&e.da){var r=e.da;r.g&&r.g.appendBuffer(i,"video",r.o,-f)}e.i[t].appendBuffer(i)}),i?i.N()[0]:null),15);case 15:T(I)}}))}function Ts(e,t){var n;return P((function(i){return 1==i.g?t==(n=bi).wa?e.h?w(i,e.h.remove(0,1/0),0):i.return():w(i,ks(e,t,(function(){return Ss(e,t,0,e.l.duration)}),null),4):e.m?w(i,ks(e,n.V,(function(){return Ss(e,n.V,0,e.l.duration)}),null),0):i.u(0)}))}function Ss(e,t,n,i){i<=n?Es(e,t):e.i[t].remove(n,i)}function xs(e,t){var n=e.i[t].appendWindowStart,i=e.i[t].appendWindowEnd;e.i[t].abort(),e.i[t].appendWindowStart=n,e.i[t].appendWindowEnd=i,Es(e,t)}function As(e,t,n){0>n&&(n+=.001),e.i[t].timestampOffset=n,Es(e,t)}function Es(e,t){if(!e.I){var n=e.o[t][0];n&&(n.p.resolve(),Ms(e,t))}}function ks(e,t,n,i){return pa(e.L),n={start:n,p:new Gr,uri:i},e.o[t].push(n),1==e.o[t].length&&Cs(e,t),n.p}function Is(e,t){var n,i,r,a,o,s,u,c,d,h;return P((function(f){switch(f.g){case 1:for(pa(e.L),n=[],i=Object.keys(e.i),r=l(i),a=r.next(),o={};!a.done;o={ready:void 0},a=r.next())s=a.value,o.ready=new Gr,u={start:function(e){return function(){return e.ready.resolve()}}(o),p:o.ready,uri:null},e.o[s].push(u),n.push(o.ready),1==e.o[s].length&&u.start();return S(f,2),w(f,Promise.all(n),4);case 4:A(f,3);break;case 2:throw E(f);case 3:return S(f,5,6),w(f,t(),6);case 6:for(k(f),c=l(i),d=c.next();!d.done;d=c.next())h=d.value,Ms(e,h);I(f,0);break;case 5:throw new De(2,3,3015,E(f),e.g.error||"No error in the media element",null)}}))}function Ms(e,t){e.o[t].shift(),Cs(e,t)}function Cs(e,t){var n=e.o[t][0];if(n)try{n.start()}catch(i){"QuotaExceededError"==i.name?n.p.reject(new De(2,3,3017,t)):n.p.reject(new De(2,3,3015,i,e.g.error||"No error in the media element",n.uri)),Ms(e,t)}}function Ds(e,t){return Is(e,(function(){return function(e,t){var n,i,r,a,o,s,u,c,d,h,f,p,g,m,v,y,b,T;return P((function(S){switch(S.g){case 1:for(o in n=bi,e.I=!0,e.m=!1,i=e.g.currentTime,r=e.g.autoplay,a=e.g.paused,e.Na&&(e.g.autoplay=!1),x(S,2),e.s.Va(),e.j)e.j[o].destroy();for(s in e.i){u=e.i[s];try{e.l.removeSourceBuffer(u)}catch(e){}}return e.j={},e.i={},c=e.l.duration,e.S=new Gr,e.l=fs(e,e.S),w(S,e.S,4);case 4:!isNaN(c)&&c?e.l.duration=c:!isNaN(e.na)&&e.na&&(e.l.duration=e.na),d=new Gr,h=e.l.sourceBuffers,f=t.size,p=0,g=function(){++p===f&&(d.resolve(),e.s.cb(h,"addsourcebuffer",g))},e.s.D(h,"addsourcebuffer",g),m=l(t.keys()),v=m.next();case 5:return v.done?((T=t.get(n.V))&&T.isAudioMuxedInVideo&&(e.m=!0),e.m&&!e.o[n.V]&&(e.o[n.V]=[]),e.g.currentTime=i,w(S,d,2)):(y=v.value,b=t.get(y),w(S,ps(e,y,b,b.codecs),6));case 6:v=m.next(),S.u(5);break;case 2:k(S),e.I=!1,pa(e.L),e.s.pa(e.g,"canplaythrough",(function(){e.L.g||(e.g.autoplay=r,a||e.g.play())})),I(S,0)}}))}(e,t)}))}ls.prototype.release=function(){this.g&&(this.g.close(),this.g=null)},F("shaka.lcevc.Dec",ls),ls.prototype.release=ls.prototype.release,(i=hs.prototype).destroy=function(){return this.L.destroy()},i.init=function(e,t,n,i){t=void 0!==t&&t,n=void 0===n?"UNKNOWN":n,i=void 0!==i&&i;var r,a,o,s,u,c,d=this;return P((function(h){switch(h.g){case 1:return r=bi,w(h,d.S,2);case 2:d.C=t,d.aa=n,d.La=i,d.Ga=!d.C&&"HLS"==d.aa&&!d.La,d.Y={},d.O=null,d.ra=null,d.M=null,d.ja=null,d.ga=new Gr,a=l(e.keys()),o=a.next();case 3:if(o.done){h.u(5);break}return s=o.value,u=e.get(s),w(h,ps(d,s,u,u.codecs),6);case 6:d.m?(d.o[r.V]=[],d.o[r.la]=[]):d.o[s]=[],o=a.next(),h.u(3);break;case 5:(c=e.get(r.V))&&c.isAudioMuxedInVideo&&(d.m=!0),T(h)}}))},i.configure=function(e){this.A=e,this.h&&(this.h.A=e.modifyCueCallback)},i.zb=function(){var e={total:this.I?[]:Eo(this.g.buffered),audio:Eo(bs(this,"audio")),video:Eo(bs(this,"video")),text:[]};if(this.h){var t=this.h.g,n=this.h.h;null!=t&&null!=n&&e.text.push({start:t,end:n})}return e},i.remove=function(e,t,n){var i,r=this;return P((function(a){return 1==a.g?e==(i=bi).wa?w(a,r.h.remove(t,n),0):w(a,ks(r,e,(function(){return Ss(r,e,t,n)}),null),4):r.m?w(a,ks(r,i.V,(function(){return Ss(r,i.V,t,n)}),null),0):a.u(0)}))},i.flush=function(e){var t,n=this;return P((function(i){return 1==i.g?e==(t=bi).wa?i.return():w(i,ks(n,e,(function(){n.g.currentTime-=.001,Es(n,e)}),null),2):n.m?w(i,ks(n,t.V,(function(){var e=t.V;n.g.currentTime-=.001,Es(n,e)}),null),0):i.u(0)}))},i.endOfStream=function(e){var t=this;return P((function(n){return w(n,Is(t,(function(){ms(t)||"closed"===t.l.readyState||(e?t.l.endOfStream(e):t.l.endOfStream())})),0)}))},i.bb=function(e){var t=this;return P((function(n){return w(n,Is(t,(function(){if(e<t.l.duration)for(var n in t.i){var i={start:function(){},p:new Gr,uri:null};t.o[n].unshift(i)}t.l.duration=e,t.na=e})),0)}))},i.getDuration=function(){return this.l.duration};var Rs=e.URL.createObjectURL,Ps="sequence";function Ls(e,t,n){this.i=e,this.C=t,this.o=this.l=1/0,this.h=1,this.g=this.j=null,this.A=0,this.B=!0,this.I=!1,this.H=0,this.F=void 0===n||n,this.G=0,this.s=!1,this.m=e}function Ns(e,t,n){this.j=n,this.l=e,this.s=Os(e),this.g=e.g.currentTime,this.m=Date.now()/1e3,this.h=!1,this.o=0,this.A=t,this.i=function(){}}function js(e){this.g=e}function Os(e){if(e.g.paused||0==e.g.playbackRate||0==e.g.buffered.length)var t=!1;else e:{t=e.g.currentTime;for(var n=(e=l(Eo(e.g.buffered))).next();!n.done;n=e.next())if(!(t<(n=n.value).start-.1||t>n.end-.5)){t=!0;break e}t=!1}return t}function Us(e,t,n,i,r){var a=this;this.A=r,this.g=e,this.B=t,this.m=n,this.l=new Z,this.j=!1,this.F=e.readyState,this.C=this.i=0,this.h=i,this.s=!1,this.l.D(e,"waiting",(function(){return _s(a)})),this.o=new Be((function(){_s(a)})).Ra(this.m.gapJumpTimerTime)}function _s(e){if(0!=e.g.readyState){if(e.g.seeking){if(!e.j)return}else e.j=!1;if(!e.g.paused||e.g.currentTime==e.i&&(e.g.autoplay||e.g.currentTime!=e.i)){var t;if(e.g.readyState!=e.F&&(e.F=e.g.readyState),!(t=!e.h)){var n=(t=e.h).l,i=Os(n),r=n.g.currentTime,a=Date.now()/1e3;t.g==r&&t.s==i||(t.m=a,t.g=r,t.s=i,t.h=!1),(i=(r=a-t.m)>=t.A&&i&&!t.h)&&(t.i(t.g,r),t.h=!0,t.g=n.g.currentTime,t.o++,t.j(new Jr("stalldetected"))),t=!i}t&&(t=e.g.currentTime,i=function(e,t,n){return e&&e.length&&!To(e)&&0<=(e=Eo(e).findIndex((function(e,i,r){return e.start>t&&(0==i||r[i-1].end-t<=n)})))?e:null}(n=e.g.buffered,t,e.m.gapDetectionThreshold),null!=i&&(0!=i||e.s))&&(r=n.start(i),(navigator.userAgent.match(/Edge\//)||Ge()||Ke())&&(r=Math.ceil(100*(r+e.m.gapPadding))/100),r>=e.B.Bb()||.001>r-t||(0!=i&&n.end(i-1),e.g.currentTime=r,t==e.i&&(e.i=r),e.C++,e.A(new Jr("gapjumped"))))}}}function Bs(e,t,n,i){t==HTMLMediaElement.HAVE_NOTHING||e.readyState>=t?i():(t=Fs.value().get(t),n.pa(e,t,i))}(i=Ls.prototype).getDuration=function(){return this.l},i.Wh=function(){return this.h},i.gh=function(e){this.i=e},i.bb=function(e){this.l=e},i.ai=function(){return this.i},i.eh=function(e){this.A=e},i.Bc=function(e){e&&!this.B&&(this.I=!0),this.B=e},i.pe=function(e){this.o=e},i.Qd=function(){return this.o},i.Sf=function(e){this.C=e},i.Oh=function(){return this.C},i.Rg=function(e,t){if(0!=e.length){var n=(Date.now()+this.A)/1e3;if(0!=(e=e.filter((function(e){return e.start+t<n}))).length){var i=e[e.length-1].end+t;this.be(e[0].start+t),this.h=e.reduce((function(e,t){return Math.max(e,t.end-t.start)}),this.h),this.g=Math.max(this.g,i),null!=this.i&&this.F&&!this.s&&(this.i=n-this.g-this.h)}}},i.vd=function(e){if(0!=e.length){for(var t=e[0].startTime,n=e[0].endTime,i=(Date.now()+this.A)/1e3,r=(e=l(e)).next();!r.done;r=e.next())i<(r=r.value).startTime||(t=Math.min(t,r.startTime),n=Math.max(n,r.endTime),this.h=Math.max(this.h,r.endTime-r.startTime));this.be(t),this.g=Math.max(this.g,n),null!=this.i&&this.F&&!this.s&&(this.i=i-this.g-this.h)}},i.Qg=function(e,t){this.be(e),1/0==t||this.U()||(this.g=Math.max(this.g,t))},i.Xh=function(){return this.g},i.Xd=function(){this.s=!0},i.vi=function(){return this.s},i.fh=function(e){this.m=e},i.Th=function(){return this.m},i.be=function(e){null==this.j?this.j=e:this.I||(this.j=Math.min(this.j,e))},i.Bf=function(e){this.h=Math.max(this.h,e)},i.offset=function(e){null!=this.j&&(this.j+=e),null!=this.g&&(this.g+=e)},i.U=function(){return 1/0==this.l&&!this.B},i.uc=function(){return 1/0!=this.l&&!this.B},i.qb=function(){return Math.max(this.H,this.Yb()-this.o)},i.jh=function(e){this.H=e},i.Yb=function(){return this.U()||this.uc()?Math.min(Math.max(0,(Date.now()+this.A)/1e3-this.h-this.i)+this.G,this.l):this.g?Math.min(this.g,this.l):this.l},i.jd=function(e){var t=Math.max(this.j,this.H);return 1/0==this.o?Math.ceil(1e3*t)/1e3:Math.max(t,Math.min(this.Yb()-this.o+e,this.Bb()))},i.Kb=function(){return this.jd(0)},i.Bb=function(){return Math.max(0,this.Yb()-(this.U()||this.uc()?this.C:0))},i.qh=function(){return!(null==this.i||null!=this.g&&this.F)},i.dh=function(e){this.G=e},i.Mh=function(){return this.G},F("shaka.media.PresentationTimeline",Ls),Ls.prototype.getAvailabilityTimeOffset=Ls.prototype.Mh,Ls.prototype.setAvailabilityTimeOffset=Ls.prototype.dh,Ls.prototype.usingPresentationStartTime=Ls.prototype.qh,Ls.prototype.getSeekRangeEnd=Ls.prototype.Bb,Ls.prototype.getSeekRangeStart=Ls.prototype.Kb,Ls.prototype.getSafeSeekRangeStart=Ls.prototype.jd,Ls.prototype.getSegmentAvailabilityEnd=Ls.prototype.Yb,Ls.prototype.setUserSeekStart=Ls.prototype.jh,Ls.prototype.getSegmentAvailabilityStart=Ls.prototype.qb,Ls.prototype.isInProgress=Ls.prototype.uc,Ls.prototype.isLive=Ls.prototype.U,Ls.prototype.offset=Ls.prototype.offset,Ls.prototype.notifyMaxSegmentDuration=Ls.prototype.Bf,Ls.prototype.notifyMinSegmentStartTime=Ls.prototype.be,Ls.prototype.getInitialProgramDateTime=Ls.prototype.Th,Ls.prototype.setInitialProgramDateTime=Ls.prototype.fh,Ls.prototype.isStartTimeLocked=Ls.prototype.vi,Ls.prototype.lockStartTime=Ls.prototype.Xd,Ls.prototype.getMaxSegmentEndTime=Ls.prototype.Xh,Ls.prototype.notifyPeriodDuration=Ls.prototype.Qg,Ls.prototype.notifySegments=Ls.prototype.vd,Ls.prototype.notifyTimeRange=Ls.prototype.Rg,Ls.prototype.getDelay=Ls.prototype.Oh,Ls.prototype.setDelay=Ls.prototype.Sf,Ls.prototype.getSegmentAvailabilityDuration=Ls.prototype.Qd,Ls.prototype.setSegmentAvailabilityDuration=Ls.prototype.pe,Ls.prototype.setStatic=Ls.prototype.Bc,Ls.prototype.setClockOffset=Ls.prototype.eh,Ls.prototype.getPresentationStartTime=Ls.prototype.ai,Ls.prototype.setDuration=Ls.prototype.bb,Ls.prototype.setPresentationStartTime=Ls.prototype.gh,Ls.prototype.getMaxSegmentDuration=Ls.prototype.Wh,Ls.prototype.getDuration=Ls.prototype.getDuration,Ns.prototype.release=function(){this.j=this.l=null,this.i=function(){}},Us.prototype.release=function(){this.l&&(this.l.release(),this.l=null),null!=this.o&&(this.o.stop(),this.o=null),this.h&&(this.h.release(),this.h=null),this.g=this.B=this.A=null},Us.prototype.Ef=function(){this.s=!0,_s(this)};var Fs=new Pe((function(){return new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]])}));function Vs(e,t,n,i){var r=this;this.g=e,this.m=t,this.s=n,this.l=null,this.j=function(){return null==r.l&&(r.l=i()),r.l},this.o=!1,this.h=new Z,this.i=new qs(e),Bs(this.g,HTMLMediaElement.HAVE_METADATA,this.h,(function(){Ks(r,r.j())}))}function Hs(e){return e.o?e.g.currentTime:e.j()}function Gs(e,t){0<e.g.readyState?zs(e.i,t):Bs(e.g,HTMLMediaElement.HAVE_METADATA,e.h,(function(){Ks(e,e.j())}))}function Ks(e,t){.001>Math.abs(e.g.currentTime-t)?Xs(e):(e.h.pa(e.g,"seeking",(function(){Xs(e)})),zs(e.i,e.g.currentTime&&0!=e.g.currentTime?e.g.currentTime:t))}function Xs(e){e.o=!0,e.h.D(e.g,"seeking",(function(){return e.m()})),e.s(e.g.currentTime)}function qs(e){var t=this;this.g=e,this.m=10,this.j=this.l=this.i=0,this.h=new Be((function(){0>=t.i||t.g.currentTime!=t.l||t.g.currentTime===t.j?t.h.stop():(t.g.currentTime=t.j,t.i--)}))}function zs(e,t){e.l=e.g.currentTime,e.j=t,e.i=e.m,e.g.currentTime=t,e.h.Ra(.1)}function Ws(e){this.h=e,this.j=!1,this.g=null,this.i=new Z}function Ys(e,t,n,i,r,a){var o=this;this.i=e,this.g=t.presentationTimeline,this.B=t.minBufferTime||0,this.l=n,this.A=r,this.s=null,this.o=function(e,t,n){if(!t.stallEnabled)return null;var i=t.stallSkip;return function(e,t){e.i=t}(t=new Ns(new js(e),t.stallThreshold,n),(function(){i?e.currentTime+=i:(e.pause(),e.play())})),t}(e,n,a),this.j=new Us(e,t.presentationTimeline,n,this.o,a),this.h=new Vs(e,(function(){e:{var e=o.j;e.j=!0,e.s=!1;var t=Hs(o.h);if(e=$s(o,t),.001<Math.abs(e-t)){if(t=!1,!ze()||ze()&&nt())t=!0;else{var n=Date.now()/1e3,i=ze()&&rt("Fuchsia")?3:1;(!o.s||o.s<n-i)&&(o.s=n,t=!0)}if(t){Gs(o.h,e),e=void 0;break e}}o.A(),e=void 0}return e}),(function(e){var t=o.j;t.g.seeking&&!t.j&&(t.j=!0,t.i=e)}),(function(){var e=i;return null==e?e=1/0>o.g.getDuration()?o.g.Kb():o.g.Bb():0>e&&(e=o.g.Bb()+e),Js(o,Qs(o,e))})),this.m=new Be((function(){if(0!=o.i.readyState&&!o.i.paused){var e=Hs(o.h),t=o.g.Kb(),n=o.g.Bb();3>n-t&&(t=n-3),e<t&&(e=$s(o,e),o.i.currentTime=e)}}))}function Js(e,t){var n=e.g.getDuration();return t>=n?n-e.l.durationBackoff:t}function $s(e,t){var n=Math.max(e.B,e.l.rebufferingGoal),i=e.l.safeSeekOffset,r=e.g.Kb(),a=e.g.Bb(),o=e.g.getDuration();3>a-r&&(r=a-3);var s=e.g.jd(n),u=e.g.jd(i);return n=e.g.jd(n+i),t>=o?Js(e,t):t>a?a-e.l.safeSeekEndOffset:t<r?xo(e.i.buffered,u)?u:n:t>=s||xo(e.i.buffered,t)?t:n}function Qs(e,t){var n=e.g.Kb();return t<n?n:t>(e=e.g.Bb())?e:t}function Zs(e){this.g=e,this.m=null,this.i=0,this.o=!1}function eu(e){return e.g[0]||null}function tu(e,t,n){return new Zs([e=new vo(e,e+t,(function(){return n}),0,null,null,e,e,e+t)])}function nu(e,t,n,i){this.i=e,this.h=t,this.g=n,this.reverse=i}function iu(){Zs.call(this,[]),this.h=[]}function ru(e){var t=this;this.g=e,this.j=!1,this.i=this.g.Pd(),this.h=new Be((function(){t.g.Og(.25*t.i)}))}function au(e){e.h.stop();var t=e.j?0:e.i;if(0<=t)try{return void(e.g.Pd()!=t&&e.g.Vf(t))}catch(e){}e.h.Ra(.25),0!=e.g.Pd()&&e.g.Vf(0)}function ou(e){var t=this;this.h=e,this.g=new Set,this.i=new Be((function(){su(t,!1)})).Ra(.25)}function su(e,t){for(var n=l(e.g),i=n.next();!i.done;i=n.next())i.value.j(e.h.currentTime,t)}function uu(){this.g=null,this.h=[]}function lu(e,t){var n=0;e.g&&e.g.state==t&&(n+=e.g.duration);for(var i=(e=l(e.h)).next();!i.done;i=e.next())n+=(i=i.value).state==t?i.duration:0;return n}function cu(){this.i=this.h=null,this.g=[]}function du(e,t,n){e.i!=t&&(e.i=t,e.g.push({timestamp:Date.now()/1e3,id:t.id,type:"text",fromAdaptation:n,bandwidth:null}))}function hu(){this.kc=this.Kg=this.s=this.A=this.I=this.B=this.o=this.j=this.H=this.C=this.i=this.S=this.Y=this.L=this.M=this.O=this.l=this.m=NaN,this.K=0,this.F=this.G=NaN,this.g=new uu,this.h=new cu}function fu(e,t,n,i){this.m=e,this.i=t,this.l=n,this.h=new Map,this.j=new Map,this.g=null,this.o=i}function pu(e,t){e.l=t;for(var n=(e=l(e.h.values())).next();!n.done;n=e.next())n.value.g=t}function gu(e,t,n){if(n=void 0!==n&&n,!e.i.segmentIndex)return Promise.resolve();if(e.g||(e.g=e.i.segmentIndex.Jb(t,!0,e.o)),!e.g)return Promise.resolve();for(n&&e.g.next(),t=[];e.h.size<e.m&&(n=e.g.next().value);){var i=!0;n.isPreload()&&null!=n.va&&(i=!1),2==n.$b()&&(i=!1),n.pc()&&(i=!1),i&&n.ba&&t.push(mu(e,n.ba)),i&&!e.h.has(n)&&(i=new Su(e.l),t.push(xu(i,n,e.i)),e.h.set(n,i))}return bu(e),Promise.all(t)}function mu(e,t){if(!e.i.segmentIndex||t.pc()||Array.from(e.j.keys()).some((function(e){return mo(e,t)})))return Promise.resolve();var n=new Su(e.l),i=xu(n,t,e.i);return e.j.set(t,n),i}function vu(e,t){for(var n=(t=l(t.keys())).next();!n.done;n=t.next())(n=n.value)&&Tu(e,n)}function yu(e){vu(e,e.h),vu(e,e.j),e.g=null}function bu(e){for(var t=Array.from(e.h.keys()),n=l(e.j.keys()),i=n.next(),r={};!i.done;r={rf:void 0},i=n.next())r.rf=i.value,t.some(function(e){return function(t){return mo(t.ba,e.rf)}}(r))||Tu(e,r.rf)}function wu(e,t){e.m=t;for(var n=Array.from(e.h.keys());n.length>t;){var i=n.pop();i&&Tu(e,i)}bu(e)}function Tu(e,t){var n=e.h;t instanceof go&&(n=e.j),e=n.get(t),n.delete(t),e&&e.abort()}function Su(e){this.g=e,this.wd=this.Xf=null}function xu(e,t,n){var i=new Uint8Array(0);return e.wd=e.g(t,n,(function(t){return P((function(n){if(1==n.g)return i=0<i.byteLength?di(i,t):t,e.Xf?w(n,e.Xf(i),3):n.u(0);i=new Uint8Array(0),T(n)}))})),e.wd.promise.catch((function(e){return e instanceof De&&7001==e.code?Promise.resolve():Promise.reject(e)}))}function Au(e){Zr.call(this);var t=this;this.g=new Set,this.i=e,this.h=new Be((function(){for(var e=t.i(),n=l(t.g),i=n.next();!i.done;i=n.next())(i=i.value).endTime<e.start&&(t.g.delete(i),i=new Jr("regionremove",new Map([["region",i]])),t.dispatchEvent(i))})).Ra(2)}function Eu(e){Zr.call(this),this.g=new Map,this.h=e}function ku(e,t,n){return!!((e=e.h()[n])&&0<e.length&&(n=e[e.length-1].end,t>=e[0].start&&t<n))}function Iu(e){var t={bandwidth:e.bandwidth||0,audioSamplingRate:null,codecs:e.codecs,contentType:e.type,frameRate:null,height:null,mimeType:e.mimeType,channelsCount:null,pixelAspectRatio:null,width:null,label:null,roles:e.roles,language:null};return"video"==e.type&&(t.frameRate=e.frameRate||null,t.height=e.height||null,t.pixelAspectRatio=e.pixelAspectRatio||null,t.width=e.width||null),"audio"==e.type&&(t.audioSamplingRate=e.audioSamplingRate,t.channelsCount=e.channelsCount,t.label=e.label||null,t.language=e.language),t}function Mu(e){var t=Di(e);return{type:t.split("/")[0],mimeType:t,codecs:e=Ri(e),language:null,height:null,width:null,channelCount:null,sampleRate:null,closedCaptions:new Map,Cd:null,colorGamut:null,frameRate:null}}function Cu(e){for(var t=new Set,n=[],i=(e=l(e)).next();!i.done;i=e.next()){var r=Ci(i=i.value);t.has(r)||(n.push(i),t.add(r))}return t=vi("audio",n),i=vi("video",n),e=vi(yi,n),i=function(e){if(1>=e.length)return e;var t=e.find((function(e){return e.startsWith("dvav.")||e.startsWith("dva1.")||e.startsWith("dvh1.")||e.startsWith("dvhe.")||e.startsWith("dav1.")||e.startsWith("dvc1.")||e.startsWith("dvi1.")}));return t?ne('video/mp4; codecs="'+t+'"')?[t]:e.filter((function(e){return e!=t})):e}(i),t=t.concat(i).concat(e),n.length&&!t.length?n:t}function Du(t,n,i){var r,a,o,s,u;return P((function(l){if(1==l.g)return(r=n).cryptoKey?l.u(2):w(l,r.fetchKey(),3);if(!(a=r.iv))for(a=ge(new ArrayBuffer(16)),o=r.firstMediaSequenceNumber+i,s=a.byteLength-1;0<=s;s--)a[s]=255&o,o>>=8;return u="CBC"==n.blockCipherMode?{name:"AES-CBC",iv:a}:{name:"AES-CTR",counter:a,length:64},l.return(e.crypto.subtle.decrypt(u,r.cryptoKey,t))}))}function Ru(e,t,n,i,r){return e=aa(e,i,r),0==t&&null==n||(e.headers.Range=n?"bytes="+t+"-"+n:"bytes="+t+"-"),e}function Pu(e,t){var n=this;this.g=t,this.l=e,this.h=null,this.G=new Map,this.B=1,this.s=this.j=null,this.I=0,this.i=new Map,this.F=!1,this.K=null,this.A=!1,this.m=new fa((function(){return function(e){var t,n,i,r,a,o;return P((function(s){if(1==s.g){for(t=[],n=l(e.i.values()),i=n.next();!i.done;i=n.next())Wu(r=i.value),t.push(Yu(r)),r.W&&(yu(r.W),r.W=null);for(a=l(e.o.values()),o=a.next();!o.done;o=a.next())yu(o.value);return w(s,Promise.all(t),2)}e.i.clear(),e.o.clear(),e.g=null,e.l=null,e.h=null,T(s)}))}(n)})),this.L=Date.now()/1e3,this.o=new Map,this.H={projection:null,hfov:null},this.O=0,this.M=1/0,this.C=null}function Lu(e,t){for(var n=0>e.g.ib(),i=l(e.i.values()),r=i.next();!r.done;r=i.next())(r=r.value).ia&&r.ia.Zc(n),r.W&&r.W.Zc(n);for(r=(i=l(e.o.values())).next();!r.done;r=i.next())r.value.Zc(n);(n=e.i.get("video"))&&(i=n.stream)&&(t?(t=i.trickModeVideo)&&!n.dc&&(Ou(e,t,!1,0,!1),n.dc=i):(t=n.dc)&&(n.dc=null,Ou(e,t,!0,0,!1)))}function Nu(e,t,n,i,r,a){n=void 0!==n&&n,i=void 0===i?0:i,r=void 0!==r&&r,a=void 0!==a&&a,e.j=t,e.F&&(t.video&&Ou(e,t.video,n,i,r,a),t.audio&&Ou(e,t.audio,n,i,r,a))}function ju(e,t){P((function(n){if(1==n.g)return e.C=null,e.s=t,e.F?t.segmentIndex?n.u(2):w(n,t.createSegmentIndex(),2):n.return();Ou(e,t,!0,0,!1),T(n)}))}function Ou(e,t,n,i,r,a){var o=e.i.get(t.type);o||t.type!=yi?o&&(o.dc&&(t.trickModeVideo?(o.dc=t,t=t.trickModeVideo):o.dc=null),o.stream!=t||r)&&(e.o.has(t)?o.W=e.o.get(t):o.W&&function(e,t){t&&t!==e.i&&(yu(e),e.i=t)}(o.W,t),t.type==yi&&(r=xi(t.mimeType,t.codecs),gs(e.g.ca,r,e.l.sequenceMode,t.external)),!e.o.has(o.stream)&&o.stream.closeSegmentIndex&&(o.Ea?(r="("+o.type+":"+o.stream.id+")",e.G.has(r)||e.G.set(r,o.stream.closeSegmentIndex)):o.stream.closeSegmentIndex()),r=o.stream.isAudioMuxedInVideo!=t.isAudioMuxedInVideo,o.stream=t,o.ia=null,o.jg=!!a,r?$u(e,!0,!1):(n?o.bd?o.De=!0:o.Ea?(o.jc=!0,o.Kd=i,o.De=!0):(Wu(o),qu(e,o,!0,i).catch((function(t){e.g&&e.g.onError(t)}))):o.Ea||o.eb||zu(e,o,0),function(e,t){var n,i;return P((function(r){if(1==r.g)return t.mb?(n=t.stream,i=t.mb,n.segmentIndex?r.u(2):w(r,n.createSegmentIndex(),2)):r.return();if(t.mb!=i||t.stream!=n)return r.return();var a=e.g.hd(),o=ys(e.g.ca,t.type),s=t.stream.segmentIndex.find(t.Sa?t.Sa.endTime:a),u=null==s?null:t.stream.segmentIndex.get(s);s=u&&u.va?u.va-u.Ja:null,u&&!s&&(s=(u.endTime-u.getStartTime())*(t.stream.bandwidth||0)/8),s?((u=u.ba)&&(s+=(u.va?u.va-u.Ja:null)||0),a=8*s/(u=e.g.getBandwidthEstimate())<(o||0)-a-Math.max(e.l.minBufferTime||0,e.h.rebufferingGoal)||t.mb.h.g>s):a=!1,a&&t.mb.abort(),T(r)}))}(e,o).catch((function(t){e.g&&e.g.onError(t)})))):function(e,t){var n,i,r,a,o;P((function(s){switch(s.g){case 1:return n=bi,e.I++,i=e.I,S(s,2),w(s,Ts(e.g.ca,n.wa),4);case 4:A(s,3);break;case 2:r=E(s),e.g&&e.g.onError(r);case 3:a=xi(t.mimeType,t.codecs),gs(e.g.ca,a,e.l.sequenceMode,t.external),(e.g.ca.fa.isTextVisible()||e.h.alwaysStreamText)&&e.I==i&&(o=_u(e,t),e.i.set(n.wa,o),zu(e,o,0)),T(s)}}))}(e,t)}function Uu(e,t){t.bd||t.jc||(t.Ea?(t.jc=!0,t.Kd=0):null==vs(e.g.ca,t.type)?null==t.eb&&zu(e,t,0):(Wu(t),qu(e,t,!1,0).catch((function(t){e.g&&e.g.onError(t)}))))}function _u(e,t){return{stream:t,type:t.type,ia:null,W:Bu(e,t),Sa:null,Oc:null,Wd:null,wc:null,vc:null,dc:null,endOfStream:!1,Ea:!1,eb:null,jc:!1,Kd:0,De:!1,bd:!1,Xc:!0,Kf:!1,ld:!1,mb:null}}function Bu(e,t){if("video"===t.type&&e.h.disableVideoPrefetch||"audio"===t.type&&e.h.disableAudioPrefetch||t.type===yi&&("application/cea-608"==t.mimeType||"application/cea-708"==t.mimeType)||t.type===yi&&e.h.disableTextPrefetch)return null;if(e.o.has(t))return e.o.get(t);var n=e.i.get(t.type);return(n=n&&n.W)&&t===n.i?n:0<e.h.segmentPrefetchLimit?new fu(e.h.segmentPrefetchLimit,t,(function(t,n,i){return Xu(t,n,i||null,e.h.retryParameters,e.g.Nb)}),0>e.g.ib()):null}function Fu(e,t,n,i,r,a,o,s){var u,l,c,d;return P((function(h){if(1==h.g)return u=bi,l=new Map,e.j.audio&&l.set(u.V,e.j.audio),e.j.video&&l.set(u.la,e.j.video),S(h,2),t.wc=i,t.vc=r,o&&(t.xf=o),s&&(t.yf=s),t.Wd=n,c=e.l.sequenceMode||"HLS"==e.l.type,w(h,function(e,t,n,i,r,a,o,s,u){var l,c;return P((function(d){return 1==d.g?t==(l=bi).wa?(a||(e.h.s=n),function(e,t,n){e.l=t,e.m=n}(e.h,i,r),d.return()):(c=[],w(d,function(e,t,n,i,r){var a,o,s,u,l,c,d,h,f,p,g,m,v,y,b;return P((function(T){return 1==T.g?t==(a=bi).wa?T.return(!1):(o=Mi(Ri(e.G[t])),s=Di(e.G[t]),l=!1,c=xi(n,i),d=e.A.forceTransmux,(!ne(c)||!e.C&&ji.includes(c))&&(d=!0),d&&(h=Ai(n,i),f=On(h))&&(u=f(),p=mi(a.V,(i||"").split(",")),g=mi(a.la,(i||"").split(",")),p&&g?(l=!0,m=g,t==a.V&&(m=p),c=u.convertCodecs(t,Ai(n,m))):c=u.convertCodecs(t,h)),v=Mi(Ri(c)),y=Di(c),o===v&&s===y?(e.j[t]&&!u?(e.j[t].destroy(),delete e.j[t]):!e.j[t]&&u?e.j[t]=u:u&&(e.j[t]&&e.j[t].transmux!=u.transmux?(e.j[t].destroy(),delete e.j[t],e.j[t]=u):u.destroy()),T.return(!1)):(b=!0,(e.m||l&&u&&!e.j[t])&&(b=!1),b&&"smooth"===e.A.codecSwitchingStrategy&&ie()?w(T,function(e,t,n,i){return ks(e,t,(function(){t!==yi&&(ie()&&(e.j[t]&&(e.j[t].destroy(),delete e.j[t]),i&&(e.j[t]=i),e.i[t].changeType(n+e.A.addExtraFeaturesToSourceBuffer(n)),e.G[t]=n),Es(e,t))}),null)}(e,t,c,u),3):(u&&u.destroy(),w(T,Ds(e,r),3)))):T.return(!0)}))}(e,t,o,s,u),2)):(d.h||(c.push(ks(e,t,(function(){return xs(e,t)}),null)),e.m&&c.push(ks(e,l.V,(function(){return xs(e,l.V)}),null))),a||(c.push(ks(e,t,(function(){return As(e,t,n)}),null)),e.m&&c.push(ks(e,l.V,(function(){return As(e,l.V,n)}),null))),c.push(ks(e,t,(function(){e.i[t].appendWindowStart=0,e.i[t].appendWindowEnd=r,e.i[t].appendWindowStart=i,Es(e,t)}),null)),e.m&&c.push(ks(e,l.V,(function(){var t=l.V;e.i[t].appendWindowStart=0,e.i[t].appendWindowEnd=r,e.i[t].appendWindowStart=i,Es(e,t)}),null)),w(d,Promise.all(c),0))}))}(e.g.ca,t.type,n,i,r,c,a.mimeType||t.stream.mimeType,a.codecs||t.stream.codecs,l),4);if(2!=h.g)return A(h,0);throw d=E(h),t.wc=null,t.vc=null,t.xf=null,t.yf=null,t.Wd=null,d}))}function Vu(e,t,n,i,r,a,o,s){var u,l,c,d,h,f;return o=void 0!==o&&o,s=void 0!==s&&s,P((function(p){switch(p.g){case 1:return u=i.closedCaptions&&0<i.closedCaptions.size,e.h.shouldFixTimestampOffset&&(c="video/mp4"==i.mimeType||"audio/mp4"==i.mimeType,d=null,r.ba&&(d=r.ba.timescale),(h=c&&d&&"video"===i.type&&"DASH"==e.l.type)&&(l=new Ta),h&&l.box("moof",Sa).box("traf",Sa).R("tfdt",(function(n){var i,a,o,s,u;return P((function(l){return i=Uo(n.reader,n.version),(a=i.baseMediaDecodeTime)?(o=-a/d,(Number(t.Wd)||0)<o?(s=t.wc,u=t.vc,w(l,Fu(e,t,o,s,u,r),0)):l.u(0)):l.return()}))})),h&&l.parse(a,!1,o)),w(p,Hu(e,t,n),2);case 2:return pa(e.m),f=t.Xc,t.Xc=!1,w(p,e.g.mg(t.type,a),3);case 3:return w(p,ws(e.g.ca,t.type,a,r,i,u,f,s,o),4);case 4:pa(e.m),T(p)}}))}function Hu(e,t,n){var i,r,a,o;return P((function(s){return 1==s.g?((i=t.stream.segmentIndex)instanceof iu&&i.Ha(e.l.presentationTimeline.Kb()),r=Math.max(e.h.bufferBehind*e.B,e.l.presentationTimeline.h),null==(a=vs(e.g.ca,t.type))?(e.C==t&&(e.C=null),s.return()):(o=n-a-r)<=e.h.evictionGoal?s.return():w(s,e.g.ca.remove(t.type,a,a+o),2)):4!=s.g?(pa(e.m),e.C?w(s,Hu(e,e.C,n),4):s.u(0)):(pa(e.m),void T(s))}))}function Gu(e){return e&&e.type==yi&&("application/cea-608"==e.stream.mimeType||"application/cea-708"==e.stream.mimeType)}function Ku(e,t,n,i){var r,a,o,s,u;return P((function(l){switch(l.g){case 1:if(r=n.pc())return l.return(r);if(a=null,t.W){var c=t.W,d=c.h;n instanceof go&&(d=c.j),d.has(n)?(c=d.get(n),i&&(c.Xf=i),a=c.wd):a=null}return a||(a=Xu(n,t.stream,i||null,e.h.retryParameters,e.g.Nb)),o=0,t.ia&&(o=t.ia.h),t.mb=a,w(l,a.promise,2);case 2:if(s=l.h,t.mb=null,u=s.data,!n.aesKey){l.u(3);break}return w(l,Du(u,n.aesKey,o),4);case 4:u=l.h;case 3:return l.return(u)}}))}function Xu(e,t,n,i,r,a){a=void 0!==a&&a;var o=e instanceof vo?e:void 0,s=o?1:0;return(e=Ru(e.N(),e.Ja,e.va,i,n)).contentType=t.type,r.request(ca,e,{type:s,stream:t,segment:o,isPreload:a})}function qu(e,t,n,i){var r,a;return P((function(o){return 1==o.g?(t.jc=!1,t.De=!1,t.Kd=0,t.bd=!0,t.Sa=null,t.ia=null,t.W&&!e.o.has(t.stream)&&yu(t.W),i?(r=e.g.hd(),a=e.g.ca.getDuration(),w(o,e.g.ca.remove(t.type,r+i,a),3)):w(o,Ts(e.g.ca,t.type),4)):3!=o.g?(pa(e.m),n?w(o,e.g.ca.flush(t.type),3):o.u(3)):(pa(e.m),t.bd=!1,t.endOfStream=!1,t.Ea||t.eb||zu(e,t,0),void T(o))}))}function zu(t,n,i){var r=n.type;(r!=yi||t.i.has(r))&&(n.eb=new _e((function(){var i;return P((function(r){return 1==r.g?(S(r,2),w(r,function(t,n){var i,r,a,o,s,u;return P((function(c){switch(c.g){case 1:if(pa(t.m),n.Ea||null==n.eb||n.bd)return c.return();if(n.eb=null,!n.jc){c.u(2);break}return w(c,qu(t,n,n.De,n.Kd),3);case 3:return c.return();case 2:if(function(e,t){for(var n=l(e.G.entries()),i=n.next();!i.done;i=n.next()){var r=l(i.value);i=r.next().value,r=r.next().value,i.includes(t.type)&&(r(),e.G.delete(i))}}(t,n),n.stream.segmentIndex){c.u(4);break}return i=n.stream,S(c,5),w(c,n.stream.createSegmentIndex(),7);case 7:A(c,6);break;case 5:return r=E(c),w(c,Ju(t,n,r),8);case 8:return c.return();case 6:if(i!=n.stream)return i.closeSegmentIndex&&i.closeSegmentIndex(),n.Ea||n.eb||zu(t,n,0),c.return();case 4:S(c,9),a=function(t,n){if(Gu(n))return function(e,t){var n=ys(e,"video")||0;_i(e.h,t,n)}(t.g.ca,n.stream.originalId||""),null;if(n.type==yi&&function(e){e.h&&_i(e.h,"",0)}(t.g.ca),n.stream.isAudioMuxedInVideo)return null;if(!function(e){return e.ta&&!e.Z&&!e.I}(t.g.ca)&&n.type!=yi)return t.h.updateIntervalSeconds/2;var i=t.g.hd();if("audio"===n.type)for(var r=l(t.o.keys()),a=r.next();!a.done;a=r.next())(a=t.o.get(a.value)).Ha(i,!0),gu(a,i);r=n.Sa?n.Sa.endTime:i;var o=function(e,t,n){return t==yi?null==(e=e.h).h||e.h<n?0:e.h-Math.max(n,e.g):Ao(e=bs(e,t),n)}(t.g.ca,n.type,i),s=Math.max(1,Math.max(t.l.minBufferTime||0,t.h.rebufferingGoal,t.h.bufferingGoal)*t.B),u=t.l.presentationTimeline.getDuration()-r;if(a=ys(t.g.ca,n.type),1e-6>u&&a)return n.endOfStream=!0,"video"==n.type&&(t=t.i.get(yi))&&Gu(t)&&(t.endOfStream=!0),null;if(n.endOfStream=!1,o>=s)return t.h.updateIntervalSeconds/2;if(s=!n.ia,a=function(e,t,n,i){if(t.ia)return t.ia.current();if(t.Sa||i)return n=t.Sa?t.Sa.endTime:i,e=0>e.g.ib(),t.stream.segmentIndex&&(t.ia=t.stream.segmentIndex.Jb(n,!1,e)),t.ia&&t.ia.next().value;i=e.l.sequenceMode?0:e.h.inaccurateManifestTolerance;var r=Math.max(n-i,0);e=0>e.g.ib();var a=null;return i&&(t.stream.segmentIndex&&(t.ia=t.stream.segmentIndex.Jb(r,!1,e)),a=t.ia&&t.ia.next().value),a||(t.stream.segmentIndex&&(t.ia=t.stream.segmentIndex.Jb(n,!1,e)),a=t.ia&&t.ia.next().value),a}(t,n,i,a),!a)return t.h.updateIntervalSeconds;o=!1,s&&n.jg&&(o=!0,n.jg=!1),s=1/0;for(var c=(u=l(u=Array.from(t.i.values()))).next();!c.done;c=u.next())Gu(c=c.value)||c.ia&&!c.ia.current()||(s=Math.min(s,c.Sa?c.Sa.endTime:i));return r>=s+t.l.presentationTimeline.h?t.h.updateIntervalSeconds:(n.W&&n.ia&&!t.o.has(n.stream)&&(n.W.Ha(a.startTime),gu(n.W,a.startTime)),function(t,n,i,r,a){var o,s,u,l,c,d,h,f,p,g,m,v,y,b,x;return P((function(k){switch(k.g){case 1:if(o=bi,s=n.stream,u=n.ia,n.Ea=!0,S(k,2),2==r.$b())throw new De(1,1,1011);return w(k,function(e,t,n,i){var r,a,o,s,u,l,c,d,h,f,p,g,m,v,y,b;return P((function(T){switch(T.g){case 1:if(r=bi,a=null==t.Sa,o=[],s=Math.max(0,Math.max(n.appendWindowStart,e.O)-.1),u=Math.min(n.appendWindowEnd,e.M)+.01,l=n.codecs||t.stream.codecs,c=Ci(l),d=Di(n.mimeType||t.stream.mimeType),(h=n.timestampOffset)==t.Wd&&s==t.wc&&u==t.vc&&c==t.xf&&d==t.yf){T.u(2);break}if(f=t.xf&&t.yf&&function(e,t,n,i){if(t==yi)var r=!1;else{r=Mi(Ri(e.G[t]));var a=Di(e.G[t]),o=xi(n,i),s=e.A.forceTransmux;(!ne(o)||!e.C&&ji.includes(o))&&(s=!0),n=Ai(n,i),s&&(s=On(n))&&(o=(s=s()).convertCodecs(t,n),s.destroy()),t=Mi(Ri(o)),o=Di(o),r=r!==t||a!==o}return!!r&&("smooth"!==e.A.codecSwitchingStrategy||!ie()||e.m)}(e.g.ca,t.type,d,l),!f){T.u(3);break}if(p=null,t.type===r.la?p=e.i.get(r.V):t.type===r.V&&(p=e.i.get(r.la)),!p){T.u(3);break}return w(T,Yu(p).catch((function(){})),5);case 5:p.Oc=null,p.wc=null,p.vc=null,Uu(e,p);case 3:return w(T,Fu(e,t,h,s,u,n,c,d),2);case 2:return mo(n.ba,t.Oc)||(t.Oc=n.ba,n.l&&n.ba&&(g=Ku(e,t,n.ba),m=function(){var a,o,s,u,l,c;return P((function(d){switch(d.g){case 1:return S(d,2),w(d,g,4);case 4:return a=d.h,pa(e.m),o=null,s=new Map,u={projection:null,hfov:null},(new Ta).box("moov",Sa).box("trak",Sa).box("mdia",Sa).R("mdhd",(function(e){o=_o(e.reader,e.version).timescale})).box("hdlr",(function(e){switch((e=e.reader).skip(8),e.yc()){case"soun":s.set(r.V,o);break;case"vide":s.set(r.la,o)}o=null})).box("minf",Sa).box("stbl",Sa).R("stsd",xa).box("encv",Aa).box("avc1",Aa).box("avc3",Aa).box("hev1",Aa).box("hvc1",Aa).box("dvav",Aa).box("dva1",Aa).box("dvh1",Aa).box("dvhe",Aa).box("dvc1",Aa).box("dvi1",Aa).box("vexu",Sa).box("proj",Sa).R("prji",(function(e){e=e.reader.yc(),u.projection=e})).box("hfov",(function(e){e=e.reader.P()/1e3,u.hfov=e})).parse(a),function(e,t){if(e.H.projection!=t.projection||e.H.hfov!=t.hfov){if(null!=t.projection||null!=t.hfov){var n=(new Map).set("detail",t);n=new Jr("spatialvideoinfo",n)}else n=new Jr("nospatialvideoinfo");n.cancelable=!0,e.g.onEvent(n),e.H=t}}(e,u),s.has(t.type)?n.ba.timescale=s.get(t.type):null!=o&&(n.ba.timescale=o),l=t.stream.closedCaptions&&0<t.stream.closedCaptions.size,w(d,e.g.mg(t.type,a),5);case 5:return w(d,ws(e.g.ca,t.type,a,null,t.stream,l,t.Xc,i),6);case 6:A(d,0);break;case 2:throw c=E(d),t.Oc=null,c}}))},v=n.startTime,a&&null!=(y=ys(e.g.ca,t.type))&&(v=y),e.g.Ei(v,n.ba),o.push(m()))),b=t.Sa?t.Sa.i:null,n.i!=b&&o.push(function(e,t,n){var i;return P((function(r){return 1==r.g?t==(i=bi).wa?r.return():(t==i.la&&(e.Ba=new Gr),e.C?(ks(e,t,(function(){return xs(e,t)}),null),e.m&&ks(e,i.V,(function(){return xs(e,i.V)}),null),w(r,ks(e,t,(function(){return As(e,t,n)}),null),2)):r.return()):e.m?w(r,ks(e,i.V,(function(){return As(e,i.V,n)}),null),0):r.u(0)}))}(e.g.ca,t.type,n.startTime)),w(T,Promise.all(o),0)}}))}(t,n,r,a),4);case 4:return pa(t.m),t.A?k.return():(l="video/mp4"==s.mimeType||"audio/mp4"==s.mimeType,c=e.ReadableStream,t.h.lowLatencyMode&&t.l.isLowLatency&&c&&l&&("HLS"!=t.l.type||r.m)?(h=new Uint8Array(0),p=f=!1,m=function(e){var o,u,l;return P((function(c){switch(c.g){case 1:if(f)return c.return();if(p=!0,pa(t.m),t.A)return c.return();if(S(c,2),h=function(e,t){var n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(h,e),o=!1,u=0,(new Ta).box("mdat",(function(e){u=e.size+e.start,o=!0})).parse(h,!1,!0),!o){c.u(4);break}return l=h.subarray(0,u),h=h.subarray(u),w(c,Vu(t,n,i,s,r,l,!0,a),5);case 5:n.W&&n.ia&&gu(n.W,r.startTime,!0);case 4:A(c,0);break;case 2:g=E(c),T(c)}}))},w(k,Ku(t,n,r,m),9)):w(k,Ku(t,n,r),7));case 7:return d=k.h,pa(t.m),t.A?k.return():(pa(t.m),n.jc?(n.Ea=!1,zu(t,n,0),k.return()):w(k,Vu(t,n,i,s,r,d,!1,a),6));case 9:if(v=k.h,g)throw g;if(p){k.u(10);break}return f=!0,pa(t.m),t.A?k.return():n.jc?(n.Ea=!1,zu(t,n,0),k.return()):w(k,Vu(t,n,i,s,r,v,!1,a),10);case 10:n.W&&n.ia&&gu(n.W,r.startTime,!0);case 6:if(pa(t.m),t.A)return k.return();n.Sa=r,u.next(),n.Ea=!1,n.Kf=!1,y=t.g.ca.zb(),b=y[n.type],JSON.stringify(b),n.jc||t.g.Ef(r,n.stream),zu(t,n,0),A(k,0);break;case 2:if(x=E(k),pa(t.m,x),t.A)return k.return();if(n.Ea=!1,7001==x.code)n.Ea=!1,Wu(n),zu(t,n,0),k.u(0);else{if(n.type!=o.wa||!t.h.ignoreTextStreamFailures)return 3017==x.code?w(k,function(e,t,n){var i,r,a;return P((function(o){if(1==o.g){if(Array.from(e.i.values()).some((function(e){return e!=t&&e.Kf})))return o.u(2);if(i=0===e.h.maxDisabledTime&&1011==n.code?1:e.h.maxDisabledTime,e.g.disableStream(t.stream,i))return o.return();if(20<(r=Math.round(100*e.B)))e.B-=.2;else{if(!(4<r))return t.ld=!0,e.A=!0,e.g.onError(n),o.return();e.B-=.04}return t.Kf=!0,a=e.g.hd(),w(o,Hu(e,t,a),2)}zu(e,t,4),T(o)}))}(t,n,x),0):(n.ld=!0,1==x.category&&n.W&&Tu(n.W,r),x.severity=2,w(k,Ju(t,n,x),0));t.i.delete(o.wa),k.u(0)}}}))}(t,n,i,a,o).catch((function(){})),null)}(t,n),null!=a&&(zu(t,n,a),n.ld=!1),A(c,10);break;case 9:return o=E(c),w(c,Ju(t,n,o),11);case 11:return c.return();case 10:if(s=Array.from(t.i.values()),!t.F||!s.every((function(e){return e.endOfStream}))){c.u(0);break}return w(c,t.g.ca.endOfStream(),13);case 13:pa(t.m),0!=(u=t.g.ca.getDuration())&&u<t.l.presentationTimeline.getDuration()&&t.l.presentationTimeline.bb(u),T(c)}}))}(t,n),4)):2!=r.g?A(r,0):(i=E(r),t.g&&t.g.onError(i),void T(r))}))})).$(i))}function Wu(e){null!=e.eb&&(e.eb.stop(),e.eb=null)}function Yu(e){return P((function(t){return e.mb?w(t,e.mb.abort(),0):t.u(0)}))}function Ju(e,t,n){var i;return P((function(r){if(1==r.g)return w(r,Hr(e.K),2);if(pa(e.m),1===n.category&&1003!=n.code){if(t.dc)return Lu(e,!1),r.return();i=0===e.h.maxDisabledTime&&1011==n.code?1:e.h.maxDisabledTime,n.handled=e.g.disableStream(t.stream,i),n.handled&&(n.severity=1)}n.handled&&1011==n.code||e.g.onError(n),n.handled||e.h.failureCallback(n),T(r)}))}function $u(e,t,n){var i,r,a,o,s,u;return t=void 0!==t&&t,n=void 0===n||n,P((function(l){if(1==l.g){if(i=Date.now()/1e3,r=e.h.minTimeBetweenRecoveries,!t){if(!e.h.allowMediaSourceRecoveries||i-e.L<r)return l.return(!1);e.L=i}return a=bi,(o=e.i.get(a.V))&&(o.Oc=null,o.wc=null,o.vc=null,n&&Uu(e,o),Yu(o).catch((function(){})),o.ia&&o.ia.Mf()),(s=e.i.get(a.la))&&(s.Oc=null,s.wc=null,s.vc=null,n&&Uu(e,s),Yu(s).catch((function(){})),s.ia&&s.ia.Mf()),u=new Map,e.j.audio&&u.set(a.V,e.j.audio),e.j.video&&u.set(a.la,e.j.video),w(l,Ds(e.g.ca,u),2)}return!s||s.Ea||s.eb||zu(e,s,0),!o||o.Ea||o.eb||zu(e,o,0),l.return(!0)}))}function Qu(){}function Zu(e,t,n,i,r){var a,o=r in i,s=o?n.constructor==Object&&0==Object.keys(i).length:n.constructor==Object&&0==Object.keys(n).length,u=o||s,l=!0;for(a in t){var c=r+"."+a,d=o?i[r]:n[a];u||a in n?void 0===t[a]?void 0===d||u?delete e[a]:e[a]=kt(d):s?e[a]=t[a]:d.constructor==Object&&t[a]&&t[a].constructor==Object?(e[a]||(e[a]=kt(d)),c=Zu(e[a],t[a],d,i,c),l=l&&c):typeof t[a]!=typeof d||null==t[a]||"function"!=typeof t[a]&&t[a].constructor!=d.constructor?(z("Invalid config, wrong type for "+c),l=!1):("function"==typeof n[a]&&n[a].length!=t[a].length&&W("Unexpected number of arguments for "+c),e[a]=t[a]):(z("Invalid config, unrecognized key "+c),l=!1)}return l}function el(e,t){for(var n={},i=n,r=0,a=0;!(0>(r=e.indexOf(".",r)));)0!=r&&"\\"==e[r-1]||(i[a=e.substring(a,r).replace(/\\\./g,".")]={},i=i[a],a=r+1),r+=1;return i[e.substring(a).replace(/\\\./g,".")]=t,n}function tl(e,t){return e&&t}function nl(e,t){function n(e){return Array.isArray(e)&&0===e.length}function i(e){return e&&"object"==typeof e&&!Array.isArray(e)}return e=function e(t,r){return Object.keys(t).reduce((function(a,o){var s=t[o];return r.hasOwnProperty(o)?i(s)&&i(r[o])?(s=e(s,r[o]),(0<Object.keys(s).length||!i(s))&&(a[o]=s)):n(s)&&n(r[o])||Number.isNaN(s)&&Number.isNaN(r[o])||s!==r[o]&&(a[o]=s):a[o]=s,a}),{})}(e,t),function e(t){for(var r=l(Object.keys(t)),a=r.next();!a.done;a=r.next())i(t[a=a.value])&&0===Object.keys(t[a]).length||n(t[a])||"function"==typeof t[a]?delete t[a]:i(t[a])&&(e(t[a]),0===Object.keys(t[a]).length&&delete t[a])}(e),e}function il(){}function rl(e){return new Gn(e=ft(e)).Fb}function al(e,t,n){function i(e){ve(a).setUint32(o,e.byteLength,!0),o+=4,a.set(ge(e),o),o+=e.byteLength}if(!n||!n.byteLength)throw new De(2,6,6015);var r;r="string"==typeof t?gt(t,!0):t,e=gt(e=ft(e),!0);var a=new Uint8Array(12+e.byteLength+r.byteLength+n.byteLength),o=0;return i(e),i(r),i(n),a}function ol(e,t,n){return"skd"!==t?e:(t=n.serverCertificate,al(e,n=ft(e).split("skd://").pop(),t))}function sl(e,t){2===e&&(t.headers["Content-Type"]="application/octet-stream")}function ul(){}function ll(){var t=1/0;navigator.connection&&navigator.connection.saveData&&(t=360);var n={retryParameters:{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4},servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1,persistentSessionOnlinePlayback:!1,persistentSessionsMetadata:[],initDataTransform:function(e,t,n){return ot()&&"skd"==t&&(t=n.serverCertificate,e=al(e,n=rl(e),t)),e},logLicenseExchange:!1,updateExpirationTime:1,preferredKeySystems:[],keySystemsMapping:{},parseInbandPsshEnabled:Ge(),minHdcpVersion:"",ignoreDuplicateInitData:!rt("Tizen 2")};(Ge()||$e())&&n.preferredKeySystems.push("com.microsoft.playready");var i="reload",r=!1;!ie()||Ke()||$e()||Je()||qe()&&79===We()||!(!ze()||ze()&&nt()||ze()&&rt("Fuchsia"))||tt()&&He()||(i="smooth",r=!0),r={retryParameters:{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4},availabilityWindowOverride:NaN,disableAudio:!1,disableVideo:!1,disableText:!1,disableThumbnails:!1,disableIFrames:!1,defaultPresentationDelay:0,segmentRelativeVttTiming:!1,raiseFatalErrorOnManifestUpdateRequestFailure:!1,continueLoadingWhenPaused:!0,dash:{clockSyncUri:"",ignoreDrmInfo:!1,disableXlinkProcessing:!0,xlinkFailGracefully:!1,ignoreMinBufferTime:!1,autoCorrectDrift:!0,initialSegmentLimit:1e3,ignoreSuggestedPresentationDelay:!1,ignoreEmptyAdaptationSet:!1,ignoreMaxSegmentDuration:!1,keySystemsByURI:{"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e":"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:79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:94ce86fb-07ff-4f43-adb8-93d2fa968ca2":"com.apple.fps"},manifestPreprocessor:dl,manifestPreprocessorTXml:hl,sequenceMode:!1,multiTypeVariantsAllowed:r,useStreamOnceInPeriodFlattening:!1,updatePeriod:-1,enableFastSwitching:!0},hls:{ignoreTextStreamFailures:!1,ignoreImageStreamFailures:!1,defaultAudioCodec:"mp4a.40.2",defaultVideoCodec:"avc1.42E01E",ignoreManifestProgramDateTime:!1,ignoreManifestProgramDateTimeForTypes:[],mediaPlaylistFullMimeType:'video/mp2t; codecs="avc1.42E01E, mp4a.40.2"',liveSegmentsDelay:3,sequenceMode:!(Xe()||rt("Tizen 2")||qe()&&38===We()||$e()),ignoreManifestTimestampsInSegmentsMode:!1,disableCodecGuessing:!1,disableClosedCaptionsDetection:!1,updatePeriod:-1,allowLowLatencyByteRangeOptimization:!0},mss:{manifestPreprocessor:dl,manifestPreprocessorTXml:hl,sequenceMode:!1,keySystemsBySystemId:{"9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready"}}};var a={retryParameters:{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4},failureCallback:function(e){return tl([e])},rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,evictionGoal:1,ignoreTextStreamFailures:!1,alwaysStreamText:!1,startAtSegmentBoundary:!1,gapDetectionThreshold:.5,gapPadding:.01,gapJumpTimerTime:.25,durationBackoff:1,safeSeekOffset:5,safeSeekEndOffset:0,stallEnabled:!0,stallThreshold:1,stallSkip:.1,useNativeHlsForFairPlay:!0,inaccurateManifestTolerance:2,lowLatencyMode:!1,autoLowLatencyMode:!1,forceHTTP:!1,forceHTTPS:!1,minBytesForProgressEvents:16e3,preferNativeHls:!1,updateIntervalSeconds:1,observeQualityChanges:!1,maxDisabledTime:30,segmentPrefetchLimit:0,prefetchAudioLanguages:[],disableAudioPrefetch:!1,disableTextPrefetch:!1,disableVideoPrefetch:!1,liveSync:{enabled:!1,targetLatency:.5,targetLatencyTolerance:.5,maxPlaybackRate:1.1,minPlaybackRate:.95,panicMode:!1,panicThreshold:60,dynamicTargetLatency:{enabled:!1,stabilityThreshold:60,rebufferIncrement:.5,maxAttempts:10,maxLatency:4,minLatency:1}},allowMediaSourceRecoveries:!0,minTimeBetweenRecoveries:5,vodDynamicPlaybackRate:!1,vodDynamicPlaybackRateLowBufferRate:.95,vodDynamicPlaybackRateBufferRatio:.5,infiniteLiveStreamDuration:!1,preloadNextUrlWindow:30,loadTimeout:30,clearDecodingCache:$e()||Je(),dontChooseCodecs:!1,shouldFixTimestampOffset:qe()||Ke()};(qe()||Ke()||ze()||Qe())&&(a.stallSkip=0),Ke()&&(a.gapPadding=2);var o={trackSelectionCallback:function(e){return P((function(t){return t.return(e)}))},downloadSizeCallback:function(e){var t;return P((function(n){return 1==n.g?navigator.storage&&navigator.storage.estimate?w(n,navigator.storage.estimate(),3):n.return(!0):(t=n.h,n.return(t.usage+e<.95*t.quota))}))},progressCallback:function(e,t){return tl([e,t])},usePersistentLicense:!0,numberOfParallelDownloads:5};t={enabled:!0,useNetworkInformation:!0,defaultBandwidthEstimate:1e6,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:t,minPixels:0,maxPixels:1/0,minFrameRate:0,maxFrameRate:1/0,minBandwidth:0,maxBandwidth:1/0,minChannelsCount:0,maxChannelsCount:1/0},advanced:{minTotalBytes:128e3,minBytes:16e3,fastHalfLife:2,slowHalfLife:5},restrictToElementSize:!1,restrictToScreenSize:!1,ignoreDevicePixelRatio:!1,clearBufferSwitch:!1,safeMarginSwitch:0,cacheLoadThreshold:20,minTimeToSwitch:Ye()?.5:0,preferNetworkInformationBandwidth:!1},i={codecSwitchingStrategy:i,addExtraFeaturesToSourceBuffer:function(e){return tl([e],"")},forceTransmux:!1,insertFakeEncryptionInInit:!0,modifyCueCallback:function(e,t){return tl([e,t])},dispatchAllEmsgBoxes:!1};var s=!1,u=!1,c=!0;it()&&(u=s=!0,c=!1);var d={drm:n,manifest:r,streaming:a,mediaSource:i,offline:o,abrFactory:function(){return new Mr},abr:t,autoShowText:3,preferredAudioLanguage:"",preferredAudioLabel:"",preferredTextLanguage:"",preferredVariantRole:"",preferredTextRole:"",preferredAudioChannelCount:2,preferredVideoHdrLevel:"AUTO",preferredVideoLayout:"",preferredVideoLabel:"",preferredVideoCodecs:[],preferredAudioCodecs:[],preferredTextFormats:[],preferForcedSubs:!1,preferSpatialAudio:!1,preferredDecodingAttributes:[],restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:1/0,minPixels:0,maxPixels:1/0,minFrameRate:0,maxFrameRate:1/0,minBandwidth:0,maxBandwidth:1/0,minChannelsCount:0,maxChannelsCount:1/0},playRangeStart:0,playRangeEnd:1/0,textDisplayer:{captionsUpdatePeriod:.25},textDisplayFactory:function(){return null},cmcd:{enabled:!1,sessionId:"",contentId:"",rtpSafetyFactor:5,useHeaders:!1,includeKeys:[]},cmsd:{enabled:!0,applyMaximumSuggestedBitrate:!0,estimatedThroughputWeightRatio:.5},lcevc:{enabled:!1,dynamicPerformanceScaling:!0,logLevel:0,drawLogo:!1},ads:{customPlayheadTracker:s,skipPlayDetection:u,supportsMultipleMediaElements:c,disableHLSInterstitial:!1,disableDASHInterstitial:!1},ignoreHardwareResolution:!1};return o.trackSelectionCallback=function(t){return P((function(n){return n.return(function(t,n,i){var r=i;"AUTO"==r&&(r=e.matchMedia("(color-gamut: p3)").matches?"PQ":"SDR");var a=t.filter((function(e){return!("variant"!=e.type||e.hdr&&e.hdr!=r)}));i=[];var o=Zi(n,a.map((function(e){return e.language})));o&&(i=a.filter((function(e){return Yi(e.language)==o}))),0==i.length&&(i=a.filter((function(e){return e.primary}))),0==i.length&&(a.map((function(e){return e.language})),i=a);var s=i.filter((function(e){return e.height&&480>=e.height}));for(s.length&&(s.sort((function(e,t){return t.height-e.height})),i=s.filter((function(e){return e.height==s[0].height}))),n=[],i.length&&(a=Math.floor(i.length/2),i.sort((function(e,t){return e.bandwidth-t.bandwidth})),n.push(i[a])),i=(t=l(t)).next();!i.done;i=t.next())(i=i.value).type!=yi&&"image"!=i.type||n.push(i);return n}(t,d.preferredAudioLanguage,d.preferredVideoHdrLevel))}))},d}function cl(e,t,n){var i={".drm.keySystemsMapping":"",".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",sessionType:"",serverCertificate:new Uint8Array(0),serverCertificateUri:"",individualizationServer:"",headers:{}}};return Zu(e,t,n||ll(),i,"")}function dl(e){return tl([e],e)}function hl(e){return tl([e],e)}function fl(e,t,n,i){Zr.call(this),this.M=e,this.Y=t,this.Ba=i.networkingEngine,this.B=n,this.o=null,this.xa=0,this.La=i.Gc,this.F=i.yi,this.Na=i.zi,this.g=i.config,this.j=this.G=this.h=null,this.ga=!1,this.H=i.Ji,this.na=!1,this.l=null,this.da=!1,this.i=this.C=null,this.aa=!1,this.L=new Map,this.ta=!1,this.Aa=i.Ii,this.Z=new hu,this.fa=new Gr,this.m=new Gr,this.O=null,this.s=!1,this.Ka=i.Bh,this.ja=null,this.Ga=i.Ah,this.S=!1,this.K=[],this.I=[],this.A=!0}function pl(e,t,n){(e=t?e.I:e.K)?e.push(n):n()}function gl(e,t){if(e.O=t,e.S=!0,e.K)for(var n=(t=l(e.K)).next();!n.done;n=t.next())(n=n.value)();e.K=null}function ml(e){if(e.s)throw new De(2,7,7003)}function vl(e,t){e.dispatchEvent(new Jr("onstatechange",(new Map).set("state",t)))}function yl(e,t,n){var i,r,a,o,s;return P((function(u){return 1==u.g?(i=e.g.streaming.segmentPrefetchLimit||2,r=new fu(i,t,(function(t,n,i){return Xu(t,n,i||null,e.g.streaming.retryParameters,e.Ba,e.A)}),!1),e.L.set(t.id,r),w(u,t.createSegmentIndex(),2)):(a=e.B||0,(s=(o=t.segmentIndex.Jb(a))?o.current():null)||(s=eu(t.segmentIndex)),s?n?s.ba?w(u,mu(r,s.ba),0):u.u(0):w(u,gu(r,s.startTime),0):u.u(0))}))}function bl(e,t){Zr.call(this);var n=this;this.i=e,this.l=t,this.g=new Map,this.m=[{Ec:null,Dc:Sl,tc:function(e,t){return wl(n,"enter",e,t)}},{Ec:Tl,Dc:Sl,tc:function(e,t){return wl(n,"enter",e,t)}},{Ec:xl,Dc:Sl,tc:function(e,t){return wl(n,"enter",e,t)}},{Ec:Sl,Dc:Tl,tc:function(e,t){return wl(n,"exit",e,t)}},{Ec:Sl,Dc:xl,tc:function(e,t){return wl(n,"exit",e,t)}},{Ec:Tl,Dc:xl,tc:function(e,t){return wl(n,"skip",e,t)}},{Ec:xl,Dc:Tl,tc:function(e,t){return wl(n,"skip",e,t)}}],this.h=new Z,this.h.D(this.i,"regionremove",(function(e){n.g.delete(e.region)}))}function wl(e,t,n,i){t=new Jr(t,new Map([["region",n],["seeking",i]])),e.dispatchEvent(t)}Vs.prototype.release=function(){this.h&&(this.h.release(),this.h=null),null!=this.i&&(this.i.release(),this.i=null),this.m=function(){},this.g=null},qs.prototype.release=function(){this.h&&(this.h.stop(),this.h=null),this.g=null},(i=Ws.prototype).ready=function(){var e=this;Bs(this.h,HTMLMediaElement.HAVE_CURRENT_DATA,this.i,(function(){!function(){if(null==e.g||0==e.g&&1/0!=e.h.duration)e.j=!0;else{var t=e.h.currentTime,n=e.g;0>e.g&&(n=Math.max(0,t+e.g)),t!=n?(e.i.pa(e.h,"seeking",(function(){e.j=!0})),e.h.currentTime=n):e.j=!0}}()}))},i.release=function(){this.i&&(this.i.release(),this.i=null),this.h=null},i.Ie=function(e){this.g=this.j?this.g:e},i.Dd=function(){return(this.j?this.h.currentTime:this.g)||0},i.ig=function(){return 0},i.hg=function(){return 0},i.Pg=function(){},(i=Ys.prototype).ready=function(){this.m.Ra(.25)},i.release=function(){this.h&&(this.h.release(),this.h=null),this.j&&(this.j.release(),this.j=null),this.m&&(this.m.stop(),this.m=null),this.i=this.h=this.g=this.l=null,this.A=function(){}},i.Ie=function(e){Gs(this.h,e)},i.Dd=function(){var e=Hs(this.h);return 0<this.i.readyState&&!this.i.paused?Qs(this,e):e},i.ig=function(){return this.o?this.o.o:0},i.hg=function(){return this.j.C},i.Pg=function(){this.j.Ef()},(i=Zs.prototype).getNumReferences=function(){return this.g.length},i.getNumEvicted=function(){return this.i},i.release=function(){this.o||(this.g=[],this.m&&this.m.stop(),this.m=null)},i.Bi=function(){this.o=!0},i.yb=function(e){for(var t=l(this.g),n=t.next();!n.done;n=t.next())e(n.value)},i.find=function(e){for(var t=this.g.length-1,n=t;0<=n;--n){var i=this.g[n],r=n<t?this.g[n+1].startTime:i.endTime;if(e>=i.startTime&&e<r)return n+this.i}return this.g.length&&e<this.g[0].startTime?this.i:null},i.get=function(e){return 0==this.g.length||0>(e-=this.i)||e>=this.g.length?null:this.g[e]},i.offset=function(e){if(!this.o)for(var t=l(this.g),n=t.next();!n.done;n=t.next())n.value.offset(e)},i.Zd=function(e){if(!this.o&&e.length){var t=Math.round(1e3*e[0].startTime)/1e3;this.g=this.g.filter((function(e){return Math.round(1e3*e.startTime)/1e3<t})),this.g.push.apply(this.g,c(e))}},i.td=function(e,t){var n=this;e=e.filter((function(e){return e.endTime>t&&(0==n.g.length||e.endTime>n.g[0].startTime)})),this.Zd(e),this.Ha(t)},i.Ha=function(e){if(!this.o){var t=this.g.length;this.g=this.g.filter((function(t){return t.endTime>e})),this.i+=t-this.g.length}},i.Kc=function(e,t,n){if(n=void 0!==n&&n,!this.o){for(;this.g.length&&this.g[this.g.length-1].startTime>=t;)this.g.pop();for(;this.g.length&&this.g[0].endTime<=e;)this.g.shift(),n||this.i++;0!=this.g.length&&((t=new vo((e=this.g[this.g.length-1]).startTime,t,e.C,e.Ja,e.va,e.ba,e.timestampOffset,e.appendWindowStart,e.appendWindowEnd,e.g,e.tilesLayout,e.A,e.h,e.status,e.aesKey)).mimeType=e.mimeType,t.codecs=e.codecs,t.i=e.i,this.g[this.g.length-1]=t)}},i.ue=function(e,t){var n=this;this.o||(this.m&&this.m.stop(),this.m=new Be((function(){var e=t();e?n.g.push.apply(n.g,c(e)):(n.m.stop(),n.m=null)})),this.m.Ra(e))},Zs.prototype[Symbol.iterator]=function(){return this.Jb(0)},Zs.prototype.Jb=function(e,t,n){t=void 0!==t&&t,n=void 0!==n&&n;var i=this.find(e);if(null==i)return null;var r=this.get(i);n?i++:i--;var a=-1;if(r&&0<r.g.length)for(var o=r.g.length-1;0<=o;--o){var s=r.g[o];if(e>=s.startTime&&e<s.endTime){if(!t){for(;o&&!s.l;)o--,s=r.g[o];if(!s.l)return z("No independent partial segment found!"),null}n?i--:i++,a=o-1;break}}return new nu(this,i,a,n)},F("shaka.media.SegmentIndex",Zs),Zs.forSingleSegment=tu,Zs.prototype.getIteratorForTime=Zs.prototype.Jb,Zs.prototype.updateEvery=Zs.prototype.ue,Zs.prototype.fit=Zs.prototype.Kc,Zs.prototype.evict=Zs.prototype.Ha,Zs.prototype.mergeAndEvict=Zs.prototype.td,Zs.prototype.offset=Zs.prototype.offset,Zs.prototype.get=Zs.prototype.get,Zs.prototype.find=Zs.prototype.find,Zs.prototype.markImmutable=Zs.prototype.Bi,Zs.prototype.release=Zs.prototype.release,Zs.prototype.getNumEvicted=Zs.prototype.getNumEvicted,Zs.prototype.getNumReferences=Zs.prototype.getNumReferences,(i=nu.prototype).Zc=function(e){this.reverse=e},i.Hh=function(){return this.h},i.current=function(){var e=this.i.get(this.h);return e&&0<e.g.length&&e.s&&this.g>=e.g.length&&(this.h++,this.g=0,e=this.i.get(this.h)),e&&0<e.g.length?e.g[this.g]:e},i.next=function(){var e=this.i.get(this.h);return this.reverse?e&&0<e.g.length?(this.g--,0>this.g&&(this.h--,this.g=(e=this.i.get(this.h))&&0<e.g.length?e.g.length-1:0)):(this.h--,this.g=0):e&&0<e.g.length?(this.g++,e.s&&this.g==e.g.length&&(this.h++,this.g=0)):(this.h++,this.g=0),{value:e=this.current(),done:!e}},i.Mf=function(){var e=this.current();if(e.o&&!e.l&&(e=this.i.get(this.h))&&0<e.g.length)for(var t=e.g[this.g];t.l&&!(0>=this.g);)this.g--,t=e.g[this.g]},F("shaka.media.SegmentIterator",nu),nu.prototype.resetToLastIndependent=nu.prototype.Mf,nu.prototype.next=nu.prototype.next,nu.prototype.current=nu.prototype.current,nu.prototype.currentPosition=nu.prototype.Hh,nu.prototype.setReverse=nu.prototype.Zc,m(iu,Zs),(i=iu.prototype).clone=function(){var e=new iu;return e.h=this.h.slice(),e.i=this.i,e},i.release=function(){for(var e=l(this.h),t=e.next();!t.done;t=e.next())t.value.release();this.h=[]},i.yb=function(e){for(var t=l(this.h),n=t.next();!n.done;n=t.next())n.value.yb(e)},i.find=function(e){for(var t=this.i,n=l(this.h),i=n.next();!i.done;i=n.next()){var r=(i=i.value).find(e);if(null!=r)return r+t;t+=i.getNumEvicted()+i.getNumReferences()}return null},i.get=function(e){for(var t=this.i,n=l(this.h),i=n.next();!i.done;i=n.next()){var r=(i=i.value).get(e-t);if(r)return r;r=i.getNumReferences(),t+=i.getNumEvicted()+r}return null},i.offset=function(){},i.Zd=function(){},i.Ha=function(e){for(var t=l(this.h),n=t.next();!n.done;n=t.next())n.value.Ha(e);for(;1<this.h.length&&0==this.h[0].getNumReferences();)e=this.h.shift(),this.i+=e.getNumEvicted(),e.release()},i.td=function(){},i.Kc=function(){},i.ue=function(){},F("shaka.media.MetaSegmentIndex",iu),iu.prototype.updateEvery=iu.prototype.ue,iu.prototype.fit=iu.prototype.Kc,iu.prototype.mergeAndEvict=iu.prototype.td,iu.prototype.evict=iu.prototype.Ha,iu.prototype.merge=iu.prototype.Zd,iu.prototype.offset=iu.prototype.offset,iu.prototype.get=iu.prototype.get,iu.prototype.find=iu.prototype.find,iu.prototype.forEachTopLevelReference=iu.prototype.yb,iu.prototype.release=iu.prototype.release,ru.prototype.release=function(){this.set(this.oc()),this.h&&(this.h.stop(),this.h=null),this.g=null},ru.prototype.set=function(e){this.i=e,au(this)},ru.prototype.oc=function(){return this.g.oc()},ou.prototype.release=function(){this.i.stop();for(var e=l(this.g),t=e.next();!t.done;t=e.next())t.value.release();this.g.clear()},fu.prototype.Ha=function(e,t){t=void 0!==t&&t;for(var n=l(this.h.keys()),i=n.next();!i.done;i=n.next())e>(i=i.value).endTime&&Tu(this,i);t&&bu(this)},fu.prototype.Zc=function(e){this.o=e,this.g&&this.g.Zc(e)},Su.prototype.abort=function(){this.wd&&this.wd.abort()},m(Au,Zr),Au.prototype.release=function(){this.g.clear(),this.h.stop(),Zr.prototype.release.call(this)},m(Eu,Zr),Eu.prototype.release=function(){this.g.clear(),Zr.prototype.release.call(this)},Eu.prototype.j=function(e){for(var t=l(this.g.values()),n=t.next();!n.done;n=t.next()){var i=(n=n.value).Se;e:{for(var r=n.yd,a=r.length-1;0<=a;a--){var o=r[a];if(o.position<=e){r=o.Qc;break e}}r=null}a=r&&!(i===r||i&&r&&i.bandwidth==r.bandwidth&&i.audioSamplingRate==r.audioSamplingRate&&i.codecs==r.codecs&&i.contentType==r.contentType&&i.frameRate==r.frameRate&&i.height==r.height&&i.mimeType==r.mimeType&&i.channelsCount==r.channelsCount&&i.pixelAspectRatio==r.pixelAspectRatio&&i.width==r.width),o=r&&i&&r.label&&i.label&&i.label!==r.label;var s=r&&i&&r.language&&i.language&&i.language!==r.language;i=r&&i&&r.roles&&i.roles&&!Ce(i.roles,r.roles),(o||s||i)&&ku(this,e,r.contentType)&&(n.Se=r,i=new Jr("audiotrackchange",new Map([["quality",r],["position",e]])),this.dispatchEvent(i)),a&&ku(this,e,r.contentType)&&(n.Se=r,JSON.stringify(r),n=new Jr("qualitychange",new Map([["quality",r],["position",e]])),this.dispatchEvent(n))}},(i=Pu.prototype).destroy=function(){return this.m.destroy()},i.configure=function(e){if(this.h=e,this.K=new Vr({maxAttempts:Math.max(e.retryParameters.maxAttempts,2),baseDelay:e.retryParameters.baseDelay,backoffFactor:e.retryParameters.backoffFactor,fuzzFactor:e.retryParameters.fuzzFactor,timeout:0,stallTimeout:0,connectionTimeout:0},!0),e.disableAudioPrefetch){var t=this.i.get("audio");t&&t.W&&(yu(t.W),t.W=null);for(var n=(t=l(this.o.keys())).next();!n.done;n=t.next())n=n.value,yu(this.o.get(n)),this.o.delete(n)}for(e.disableTextPrefetch&&(t=this.i.get(yi))&&t.W&&(yu(t.W),t.W=null),e.disableVideoPrefetch&&(t=this.i.get("video"))&&t.W&&(yu(t.W),t.W=null),n=(t=l(this.i.keys())).next();!n.done;n=t.next())(n=this.i.get(n.value)).W?(wu(n.W,e.segmentPrefetchLimit),0<e.segmentPrefetchLimit||(yu(n.W),n.W=null)):0<e.segmentPrefetchLimit&&(n.W=Bu(this,n.stream));e.disableAudioPrefetch||function(e){for(var t=e.h.segmentPrefetchLimit,n=e.h.prefetchAudioLanguages,i=l(e.l.variants),r=i.next(),a={};!r.done;a={pb:void 0},r=i.next())if(a.pb=r.value,a.pb.audio)if(e.o.has(a.pb.audio)){if(wu(r=e.o.get(a.pb.audio),t),!(0<t&&n.some(function(e){return function(t){return qi(e.pb.audio.language,t)}}(a)))){var o=e.i.get(a.pb.audio.type);r!==(o&&o.W)&&yu(r),e.o.delete(a.pb.audio)}}else 0>=t||!n.some(function(e){return function(t){return qi(e.pb.audio.language,t)}}(a))||!(r=Bu(e,a.pb.audio))||(a.pb.audio.segmentIndex||a.pb.audio.createSegmentIndex(),e.o.set(a.pb.audio,r))}(this)},i.start=function(e){var t=this;return P((function(n){if(1==n.g)return w(n,function(e,t){var n,i,r,a,o,s,u,c,d;return P((function(h){if(1==h.g){if(n=bi,!e.j)throw new De(2,5,5006);return i=new Map,r=new Set,e.j.audio&&(i.set(n.V,e.j.audio),r.add(e.j.audio)),e.j.video&&(i.set(n.la,e.j.video),r.add(e.j.video)),e.s&&(i.set(n.wa,e.s),r.add(e.s)),w(h,e.g.ca.init(i,e.l.sequenceMode,e.l.type,e.l.ignoreManifestTimestampsInSegmentsMode),2)}for(pa(e.m),e.updateDuration(),a=l(i.keys()),o=a.next();!o.done;o=a.next())s=o.value,u=i.get(s),e.i.has(s)||(c=_u(e,u),t.has(u.id)&&(pu(d=t.get(u.id),(function(t,n,i){return Xu(t,n,i||null,e.h.retryParameters,e.g.Nb)})),c.W=d),e.i.set(s,c),zu(e,c,0));T(h)}))}(t,e||new Map),2);pa(t.m),t.F=!0,T(n)}))},i.Xc=function(){if(this.g)for(var e=this.g.hd(),t=l(this.i.keys()),n=t.next();!n.done;n=t.next()){var i=n.value;n=this.i.get(i);var r=this.g.ca;if(!(r=i==yi?null!=(r=r.h).g&&null!=r.h&&e>=r.g&&e<r.h:xo(r=bs(r,i),e))){if(n.W&&(n.W.g=null),"audio"===n.type)for(var a=(r=l(this.o.values())).next();!a.done;a=r.next())a.value.g=null;n.ia=null,(null!=ys(this.g.ca,i)||n.Ea)&&Uu(this,n),n.mb&&(n.mb.abort(),n.mb=null),i===yi&&(i=this.g.ca).H&&i.H.g(),n.Xc=!0}}},i.updateDuration=function(){var e=this.l.presentationTimeline.getDuration();1/0>e?this.g.ca.bb(e):this.g.ca.bb(this.h.infiniteLiveStreamDuration?1/0:Math.pow(2,32))},F("shaka.util.ConfigUtils",Qu),Qu.getDifferenceFromConfigObjects=nl,Qu.convertToConfigObject=el,Qu.mergeConfigObjects=Zu,F("shaka.util.FairPlayUtils",il),il.commonFairPlayResponse=function(e,t){if(2===e){try{var n=dt(t.data)}catch(e){return}e=!1,"<ckc>"===(n=n.trim()).substr(0,5)&&"</ckc>"===n.substr(-6)&&(n=n.slice(5,-6),e=!0);try{var i=JSON.parse(n);i.ckc&&(n=i.ckc,e=!0),i.CkcMessage&&(n=i.CkcMessage,e=!0),i.License&&(n=i.License,e=!0)}catch(e){}e&&(t.data=pe(ui(n)))}},il.expressplayFairPlayRequest=function(e,t){sl(e,t)},il.conaxFairPlayRequest=function(e,t){sl(e,t)},il.ezdrmFairPlayRequest=function(e,t){sl(e,t)},il.verimatrixFairPlayRequest=function(e,t){2===e&&(e=si(e=ge(t.body)),t.headers["Content-Type"]="application/x-www-form-urlencoded",t.body=pt("spc="+e))},il.expressplayInitDataTransform=function(e,t,n){return ol(e,t,n)},il.conaxInitDataTransform=function(t,n,i){if("skd"!==n)return t;n=i.serverCertificate,i=ft(t).split("skd://").pop().split("?").shift(),i=e.atob(i);var r=new ArrayBuffer(2*i.length);r=me(r);for(var a=0,o=i.length;a<o;a++)r[a]=i.charCodeAt(a);return al(t,r,n)},il.ezdrmInitDataTransform=function(e,t,n){return"skd"!==t?e:(t=n.serverCertificate,al(e,n=ft(e).split(";").pop(),t))},il.verimatrixInitDataTransform=function(e,t,n){return ol(e,t,n)},il.initDataTransform=al,il.defaultGetContentId=rl,il.isFairPlaySupported=function(){var e;return P((function(t){return 1==t.g?(e={initDataTypes:["cenc","sinf","skd"],videoCapabilities:[{contentType:'video/mp4; codecs="avc1.42E01E"'}]},S(t,2),w(t,navigator.requestMediaKeySystemAccess("com.apple.fps",[e]),4)):2!=t.g?t.return(!0):(E(t),t.return(!1))}))},F("shaka.util.PlayerConfiguration",ul),ul.mergeConfigObjects=cl,ul.createDefault=ll,m(fl,Zr),(i=fl.prototype).getStartTime=function(){return this.B},i.Mc=function(){return this.M},i.kf=function(){return this.h},i.getStats=function(){return this.Z},i.start=function(){var e,t=this;P((function(n){switch(n.g){case 1:return w(n,Promise.resolve(),2);case 2:return S(n,3),w(n,function(e){var t,n,i,r;return P((function(a){switch(a.g){case 1:if(vl(e,"manifest-parser"),e.j||(e.G=lo(e.M,e.Y),e.j=e.G(),e.j.configure(e.g.manifest,(function(){return e.A}))),t=Date.now()/1e3,vl(e,"manifest"),e.h){a.u(2);break}return w(a,e.j.start(e.M,e.Na),3);case 3:e.h=a.h;case 2:return e.fa.resolve(),n=new Jr("manifestparsed",void 0),w(a,Promise.resolve(),4);case 4:if(e.dispatchEvent(n),0==e.h.variants.length)throw new De(2,4,4036);!function(e){function t(e){return e.video&&e.audio||e.video&&e.video.codecs.includes(",")}e.variants.some(t)&&(e.variants=e.variants.filter(t))}(e.h),i=Date.now()/1e3,r=i-t,e.Z.H=r,T(a)}}))}(t),5);case 5:return ml(t),w(n,function(e){var t,n,i;return P((function(r){switch(r.g){case 1:if(vl(e,"drm-engine"),e.xa=Date.now()/1e3,e.l=e.La(),e.F.h=e.l,e.l.configure(e.g.drm,(function(){return e.A})),!io(e.F,e.h)){r.u(2);break}return t=new Jr("trackschanged",void 0),w(r,Promise.resolve(),3);case 3:ml(e),e.dispatchEvent(t);case 2:return n=br(e.h.variants),w(r,ja(e.l,n,e.h.offlineSessionIds),4);case 4:return ml(e),w(r,no(e.F,e.h),5);case 5:if(!r.h){r.u(0);break}return i=new Jr("trackschanged",void 0),w(r,Promise.resolve(),7);case 7:e.dispatchEvent(i),T(r)}}))}(t),6);case 6:return ml(t),w(n,function(e){var t,n,i,r,a,o;return P((function(s){return e.o||(e.o=new Or(e.g.preferredAudioLanguage,e.g.preferredVariantRole,e.g.preferredAudioChannelCount,e.g.preferredVideoHdrLevel,e.g.preferSpatialAudio,e.g.preferredVideoLayout,e.g.preferredAudioLabel,e.g.preferredVideoLabel,e.g.mediaSource.codecSwitchingStrategy,"")),e.Ga&&(t=e.g.abrFactory,e.C=t,e.i=t(),e.i.configure(e.g.abr)),e.Ka?(n=e.h.presentationTimeline.U(),i=br(e.h.variants),r=e.o.create(i),e.i.configure(e.g.abr),e.i.setVariants(Array.from(r.values())),(a=e.i.chooseVariant())?(o=[],e.ja=a,a.video&&o.push(yl(e,a.video,n)),a.audio&&o.push(yl(e,a.audio,n)),w(s,Promise.all(o),0)):s.u(0)):s.u(0)}))}(t),7);case 7:return ml(t),w(n,function(e){return P((function(t){return 1==t.g?e.K?w(t,e.m,3):t.u(0):w(t,Promise.all(e.Y.map((function(e){return e.promise}))),0)}))}(t.l),8);case 8:ml(t),t.m.resolve(),A(n,0);break;case 3:(e=E(n))instanceof De&&(7001==e.code||7003==e.code)||t.m.reject(e),T(n)}}))},i.dispatchEvent=function(e){return this.O?this.O.dispatchEvent(e):Zr.prototype.dispatchEvent.call(this,e)},i.onError=function(e){2===e.severity&&(this.m.reject(e),this.destroy());var t=(new Map).set("detail",e);t=new Jr("error",t),this.dispatchEvent(t),t.defaultPrevented&&(e.handled=!0)},i.configure=function(e,t){e=el(e,t),cl(this.g,e)},i.getConfiguration=function(){return kt(this.g)},i.jj=function(){return this.m},i.destroy=function(){var e,t,n=this;return P((function(i){switch(i.g){case 1:if(n.s=!0,!n.j||n.ga){i.u(2);break}return w(i,n.j.stop(),2);case 2:if(!n.i||n.aa){i.u(4);break}return w(i,n.i.stop(),4);case 4:if(n.H&&!n.na&&n.H.release(),!n.l||n.da){i.u(6);break}return w(i,n.l.destroy(),6);case 6:if(0<n.L.size&&!n.ta)for(e=l(n.L.values()),t=e.next();!t.done;t=e.next())yu(t.value);T(i)}}))},F("shaka.media.PreloadManager",fl),fl.prototype.destroy=fl.prototype.destroy,fl.prototype.waitForFinish=fl.prototype.jj,m(bl,Zr),bl.prototype.release=function(){this.i=null,this.g.clear(),this.h.release(),this.h=null,Zr.prototype.release.call(this)},bl.prototype.j=function(e,t){if(!this.l||0!=e){this.l=!1;for(var n=l(this.i.g),i=n.next();!i.done;i=n.next()){i=i.value;var r=this.g.get(i),a=e<i.startTime?Tl:e>i.endTime?xl:Sl;this.g.set(i,a);for(var o=l(this.m),s=o.next();!s.done;s=o.next())(s=s.value).Ec==r&&s.Dc==a&&s.tc(i,t)}}};var Tl=1,Sl=2,xl=3;function Al(e,t,n){var i,r,a,o,s,u,l;return P((function(c){switch(c.g){case 1:var d=new Gn(e).Ua.split("/").pop().split(".");return i=1==d.length?"":d.pop().toLowerCase(),(r=El[i])?c.return(r):(a=0,o=aa([e],n),S(c,2),o.method="HEAD",w(c,t.request(a,o).promise,4));case 4:s=c.h,r=s.headers["content-type"],A(c,3);break;case 2:if(!(u=E(c))||1002!=u.code&&1001!=u.code){c.u(3);break}return o.method="GET",w(c,t.request(a,o).promise,6);case 6:l=c.h,r=l.headers["content-type"];case 3:return c.return(r?r.toLowerCase().split(";").shift():"")}}))}var El={mp4:"video/mp4",m4v:"video/mp4",m4a:"audio/mp4",webm:"video/webm",weba:"audio/webm",mkv:"video/webm",ts:"video/mp2t",ogv:"video/ogg",ogg:"audio/ogg",mpg:"video/mpeg",mpeg:"video/mpeg",m3u8:"application/x-mpegurl",mpd:"application/dash+xml",ism:"application/vnd.ms-sstr+xml",mp3:"audio/mpeg",aac:"audio/aac",flac:"audio/flac",wav:"audio/wav",sbv:"text/x-subviewer",srt:"text/srt",vtt:"text/vtt",webvtt:"text/vtt",ttml:"application/ttml+xml",lrc:"application/x-subtitle-lrc",ssa:"text/x-ssa",ass:"text/x-ssa",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"};function kl(e,t){if(e.lineBreak)return"\n";if(e.nestedCues.length)return e.nestedCues.map((function(t){return kl(t,e)})).join("");if(!e.payload)return e.payload;var n=[],i=e.fontWeight>=Mn,r=e.fontStyle==Dn,a=e.textDecoration.includes(Pn);return i&&n.push(["b"]),r&&n.push(["i"]),a&&n.push(["u"]),""==(r=e.color)&&t&&(r=t.color),i="",(r=Il(r))&&(i+="."+r),""==(r=e.backgroundColor)&&t&&(r=t.backgroundColor),(t=Il(r))&&(i+=".bg_"+t),i&&n.push(["c",i]),n.reduceRight((function(e,t){var n=l(t);return"<"+(t=n.next().value)+(void 0===(n=n.next().value)?"":n)+">"+e+"</"+t+">"}),e.payload)}function Il(e){var t=(e=e.toLowerCase()).replace(/\s/g,"").match(/^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i);switch(t?e="#"+(256|parseInt(t[1],10)).toString(16).slice(1)+(256|parseInt(t[2],10)).toString(16).slice(1)+(256|parseInt(t[3],10)).toString(16).slice(1):e.startsWith("#")&&7<e.length&&(e=e.slice(0,7)),e){case"white":case"#fff":case"#ffffff":return"white";case"lime":case"#0f0":case"#00ff00":return"lime";case"cyan":case"#0ff":case"#00ffff":return"cyan";case"red":case"#f00":case"#ff0000":return"red";case"yellow":case"#ff0":case"#ffff00":return"yellow";case"magenta":case"#f0f":case"#ff00ff":return"magenta";case"blue":case"#00f":case"#0000ff":return"blue";case"black":case"#000":case"#000000":return"black"}return null}function Ml(e,t){for(var n=[],i=(e=l(Cl(e))).next();!i.done;i=e.next())if((i=i.value).isContainer)n.push.apply(n,c(Ml(i.nestedCues,i)));else{var r=i.clone();r.nestedCues=[],r.payload=kl(i,t),n.push(r)}return n}function Cl(e){for(var t=[],n=(e=l(e)).next(),i={};!n.done;i={Pe:void 0},n=e.next())i.Pe=n.value,t.some(function(e){return function(t){return cn(e.Pe,t)}}(i))||t.push(i.Pe);return t}function Dl(e){function t(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return(t>>>0).toString()}if(e.startTime>=e.endTime)return null;var n=new VTTCue(e.startTime,e.endTime,e.payload);n.id=t(e.startTime.toString())+t(e.endTime.toString())+t(e.payload),n.lineAlign=e.lineAlign,n.positionAlign=e.positionAlign,e.size&&(n.size=e.size);try{n.align=e.textAlign}catch(e){}return"center"==e.textAlign&&"center"!=n.align&&(n.align="middle"),"vertical-lr"==e.writingMode?n.vertical="lr":"vertical-rl"==e.writingMode&&(n.vertical="rl"),1==e.lineInterpretation&&(n.snapToLines=!1),null!=e.line&&(n.line=e.line),null!=e.position&&(n.position=e.position),n}function Rl(e){if(1/0===e.endTime||e.endTime<e.startTime)return null;var t=new un(e.startTime,e.endTime,e.text);return t.line="number"==typeof e.line?e.line:null,e.lineAlign&&(t.lineAlign=e.lineAlign),t.lineInterpretation=e.snapToLines?Sn:1,t.position="number"==typeof e.position?e.position:null,e.positionAlign&&(t.positionAlign=e.positionAlign),t.size=e.size,t.textAlign=e.align,"lr"===e.vertical?t.writingMode="vertical-lr":"rl"===e.vertical&&(t.writingMode="vertical-rl"),e.region&&(t.region.id=e.region.id,t.region.height=e.region.lines,t.region.heightUnits=2,t.region.regionAnchorX=e.region.regionAnchorX,t.region.regionAnchorY=e.region.regionAnchorY,t.region.scroll=e.region.scroll,t.region.viewportAnchorX=e.region.viewportAnchorX,t.region.viewportAnchorY=e.region.viewportAnchorY,t.region.viewportAnchorUnits=Ae,t.region.width=e.region.width,t.region.widthUnits=Ae),dn(t),t}function Pl(e,t){this.g=null;for(var n=l(Array.from(e.textTracks)),i=n.next();!i.done;i=n.next())"metadata"!==(i=i.value).kind&&"chapters"!==i.kind&&(i.mode="disabled",i.label==t&&(this.g=i));this.g||(this.g=e.addTextTrack("subtitles",t)),this.g.mode="hidden"}function Ll(e,t){var n=e.mode;e.mode="showing"==n?"showing":"hidden";for(var i=l(Array.from(e.cues)),r=i.next();!r.done;r=i.next())(r=r.value)&&t(r)&&e.removeCue(r);e.mode=n}function Nl(){}function jl(t,n,i){var r=this;document.fullscreenEnabled||W("Using UITextDisplayer in a browser without Fullscreen API support causes subtitles to not be rendered in fullscreen"),this.m=!1,this.h=[],this.A=t,this.s=n,this.l=null,this.g=document.createElement("div"),this.g.classList.add("shaka-text-container"),this.g.style.textAlign="center",this.g.style.display="flex",this.g.style.flexDirection="column",this.g.style.alignItems="center",this.g.style.justifyContent="flex-end",this.s.appendChild(this.g),i&&i.captionsUpdatePeriod||oe("UITextDisplayer w/ config","Please migrate to initializing UITextDisplayer with a config."),this.C=new Be((function(){r.A.paused||_l(r)})).Ra(i&&i.captionsUpdatePeriod?i.captionsUpdatePeriod:.25),this.i=new Map,this.j=new Z,this.j.D(document,"fullscreenchange",(function(){_l(r,!0)})),this.j.D(this.A,"seeking",(function(){_l(r,!0)})),this.j.D(this.A,"resize",(function(){var e=r.A,t=e.videoWidth;e=e.videoHeight,r.l=t&&e?t/e:null})),this.o=null,"ResizeObserver"in e&&(this.o=new ResizeObserver((function(){_l(r,!0)})),this.o.observe(this.g)),this.B=new Map}function Ol(e,t){for(;null!=t;){if(t==e.g)return!0;t=t.parentElement}return!1}function Ul(e,t,n,i,r){for(var a=!1,o=[],s=[],u=(t=l(t)).next();!u.done;u=t.next()){u=u.value,r.push(u);var c=e.i.get(u),d=u.startTime<=i&&u.endTime>i,h=c?c.th:null;c&&(o.push(c.Re),c.Ac&&o.push(c.Ac),d||(a=!0,e.i.delete(u),c=null)),d&&(s.push(u),c?Ol(e,h)||(a=!0):(Bl(e,u,r),h=(c=e.i.get(u)).th,a=!0)),0<u.nestedCues.length&&h&&Ul(e,u.nestedCues,h,i,r),r.pop()}if(a){for(r=(i=l(o)).next();!r.done;r=i.next())(r=r.value).parentElement&&r.parentElement.removeChild(r);for(s.sort((function(e,t){return e.startTime!=t.startTime?e.startTime-t.startTime:e.endTime-t.endTime})),i=(s=l(s)).next();!i.done;i=s.next())(i=e.i.get(i.value)).Ac?(i.Ac.contains(n)&&i.Ac.removeChild(n),n.appendChild(i.Ac),i.Ac.appendChild(i.Re)):n.appendChild(i.Re)}}function _l(e,t){if(e.g){var n=e.A.currentTime;if(!e.m||void 0!==t&&t){for(var i=(t=l(e.B.values())).next();!i.done;i=t.next())Mo(i.value);Mo(e.g),e.i.clear(),e.B.clear()}e.m&&Ul(e,e.h,e.g,n,[])}}function Bl(e,t,n){var i=1<n.length,r=i?"span":"div";t.lineBreak&&(r="br"),t.rubyTag&&(r=t.rubyTag),i=!i&&0<t.nestedCues.length;var a=document.createElement(r);if("br"!=r&&function(e,t,n,i,r){var a=t.style,o=0==n.nestedCues.length,s=1<i.length;a.whiteSpace="pre-wrap";var u=n.payload.replace(/\s+$/g,(function(e){return" ".repeat(e.length)}));if(a.webkitTextStrokeColor=n.textStrokeColor,a.webkitTextStrokeWidth=n.textStrokeWidth,a.color=n.color,a.direction=n.direction,a.opacity=n.opacity,a.paddingLeft=Fl(n.linePadding,n,e.s),a.paddingRight=Fl(n.linePadding,n,e.s),a.textCombineUpright=n.textCombineUpright,a.textShadow=n.textShadow,n.backgroundImage)a.backgroundImage="url('"+n.backgroundImage+"')",a.backgroundRepeat="no-repeat",a.backgroundSize="contain",a.backgroundPosition="center",n.backgroundColor&&(a.backgroundColor=n.backgroundColor),a.width="100%",a.height="100%";else{if(n.nestedCues.length)var l=t;else l=document.createElement("span"),t.appendChild(l);n.border&&(l.style.border=n.border),r||((t=function(e,t){for(var n=e.length-1;0<=n;n--){var i=t(e[n]);if(i||0===i)return i}return null}(i,(function(e){return e.backgroundColor})))?l.style.backgroundColor=t:u&&(l.style.backgroundColor="rgba(0, 0, 0, 0.8)")),u&&(l.textContent=u)}s&&!i[i.length-1].isContainer?a.display="inline":(a.display="flex",a.flexDirection="column",a.alignItems="center","left"==n.textAlign||"start"==n.textAlign?(a.width="100%",a.alignItems="start"):"right"!=n.textAlign&&"end"!=n.textAlign||(a.width="100%",a.alignItems="end"),a.justifyContent="before"==n.displayAlign?"flex-start":"center"==n.displayAlign?"center":"flex-end"),o||(a.margin="0"),a.fontFamily=n.fontFamily,a.fontWeight=n.fontWeight.toString(),a.fontStyle=n.fontStyle,a.letterSpacing=n.letterSpacing,a.fontSize=Fl(n.fontSize,n,e.s),null!=(i=n.line)&&((o=n.lineInterpretation)==Sn&&(o=1,s=16,e.l&&1>e.l&&(s=32),i=0>i?100+i/s*100:i/s*100),1==o&&(a.position="absolute",n.writingMode==Tn?(a.width="100%",n.lineAlign==xn?a.top=i+"%":"end"==n.lineAlign&&(a.bottom=100-i+"%")):"vertical-lr"==n.writingMode?(a.height="100%",n.lineAlign==xn?a.left=i+"%":"end"==n.lineAlign&&(a.right=100-i+"%")):(a.height="100%",n.lineAlign==xn?a.right=i+"%":"end"==n.lineAlign&&(a.left=100-i+"%")))),a.lineHeight=n.lineHeight,e=function(e){var t=e.direction,n=e.positionAlign;return e=e.textAlign,n!==gn?n:"left"===e||"start"===e&&t===wn||"end"===e&&"rtl"===t?"line-left":"right"===e||"start"===e&&"rtl"===t||"end"===e&&t===wn?"line-right":"center"}(n),"line-left"==e?(a.cssFloat="left",null!==n.position&&(a.position="absolute",n.writingMode==Tn?(a.left=n.position+"%",a.width="auto"):a.top=n.position+"%")):"line-right"==e?(a.cssFloat="right",null!==n.position&&(a.position="absolute",n.writingMode==Tn?(a.right=100-n.position+"%",a.width="auto"):a.bottom=n.position+"%")):null!==n.position&&50!=n.position&&(a.position="absolute",n.writingMode==Tn?(a.left=n.position+"%",a.width="auto"):a.top=n.position+"%"),a.textAlign=n.textAlign,a.textDecoration=n.textDecoration.join(" "),a.writingMode=n.writingMode,"writingMode"in document.documentElement.style&&a.writingMode==n.writingMode||(a.webkitWritingMode=n.writingMode),n.size&&(n.writingMode==Tn?a.width=n.size+"%":a.height=n.size+"%")}(e,a,t,n,i),n=null,t.region&&t.region.id){var o=t.region,s=e.l===4/3?2.5:1.9;if(n=o.id+"_"+o.width+"x"+o.height+(o.heightUnits==Ae?"%":"px")+"-"+o.viewportAnchorX+"x"+o.viewportAnchorY+(o.viewportAnchorUnits==Ae?"%":"px"),e.B.has(n))n=e.B.get(n);else{r=document.createElement("span");var u=o.heightUnits==Ae?"%":"px",l=o.widthUnits==Ae?"%":"px",c=o.viewportAnchorUnits==Ae?"%":"px";r.id="shaka-text-region---"+n,r.classList.add("shaka-text-region"),r.style.position="absolute";var d=o.height,h=o.width;2===o.heightUnits&&(d=5.33*o.height,u="%"),2===o.widthUnits&&(h=o.width*s,l="%"),r.style.height=d+u,r.style.width=h+l,2===o.viewportAnchorUnits?(s=o.viewportAnchorY/75*100,u=o.viewportAnchorX/(e.l===4/3?160:210)*100,s-=o.regionAnchorY*d/100,u-=o.regionAnchorX*h/100,r.style.top=s+"%",r.style.left=u+"%"):(r.style.top=o.viewportAnchorY-o.regionAnchorY*d/100+c,r.style.left=o.viewportAnchorX-o.regionAnchorX*h/100+c),0!==o.heightUnits&&0!==o.widthUnits&&0!==o.viewportAnchorUnits&&(o=Math.max(0,Math.min(100-(parseInt(r.style.width.slice(0,-1),10)||0),parseInt(r.style.left.slice(0,-1),10)||0)),r.style.top=Math.max(0,Math.min(100-(parseInt(r.style.height.slice(0,-1),10)||0),parseInt(r.style.top.slice(0,-1),10)||0))+"%",r.style.left=o+"%"),r.style.display="flex",r.style.flexDirection="column",r.style.alignItems="center",r.style.justifyContent="before"==t.displayAlign?"flex-start":"center"==t.displayAlign?"center":"flex-end",e.B.set(n,r),n=r}}r=a,i&&((r=document.createElement("span")).classList.add("shaka-text-wrapper"),r.style.backgroundColor=t.backgroundColor,r.style.lineHeight="normal",a.appendChild(r)),e.i.set(t,{Re:a,th:r,Ac:n})}function Fl(e,t,n){var i=(i=new RegExp(/(\d*\.?\d+)([a-z]+|%+)/).exec(e))?{value:Number(i[1]),unit:i[2]}:null;if(!i)return e;var r=i.value;switch(i.unit){case"%":return r/100*n.clientHeight/t.cellResolution.rows+"px";case"c":return n.clientHeight*r/t.cellResolution.rows+"px";default:return e}}function Vl(e,t){this.h=e,this.g=t,this.i=void 0,this.l=!1,this.o=!0,this.j=this.m=!1}function Hl(t){return t.g.sessionId||(t.g.sessionId=e.crypto.randomUUID()),{v:1,sf:t.i,sid:t.g.sessionId,cid:t.g.contentId,mtp:t.h.getBandwidthEstimate()/1e3}}function Gl(e,t,n){n=void 0===n?{}:n;var i=void 0===i?e.g.useHeaders:i;if(e.g.enabled){Object.assign(n,Hl(e)),n.pr=e.h.ib();var r=n.ot===Wl||n.ot===Yl;if(e.m&&r&&(n.bs=!0,n.su=!0,e.m=!1),null==n.su&&(n.su=e.o),e=function(e,t){var n=e.g.includeKeys;return n.length?Object.keys(t).reduce((function(e,i){return n.includes(i)&&(e[i]=t[i]),e}),{}):t}(e,n),i)i=function(e){for(var t=Object.keys(e),n={},i=["Object","Request","Session","Status"],r=[{},{},{},{}],a={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},o=(t=l(t)).next();!o.done;o=t.next())r[null!=a[o=o.value]?a[o]:1][o]=e[o];for(e=0;e<r.length;e++)(a=Xl(r[e]))&&(n["CMCD-"+i[e]]=a);return n}(e),Object.keys(i).length&&Object.assign(t.headers,i);else{var a=Xl(e);a&&(t.uris=t.uris.map((function(e){return ql(e,a)})))}}}function Kl(e,t){if(!(t=e.h.zb()[t]).length)return 0;var n=e.h.getCurrentTime();return(e=t.find((function(e){return e.start<=n&&e.end>=n})))?1e3*(e.end-n):0}function Xl(e){function t(e){return 100*n(e/100)}function n(e){return Math.round(e)}for(var i,r=[],a={br:n,d:n,bl:t,dl:t,mtp:t,nor:function(e){return encodeURIComponent(e)},rtp:t,tb:n},o=Object.keys(e||{}).sort(),s=(o=l(o)).next();!s.done;s=o.next()){var u=e[s=s.value];if(i=u,!(Number.isNaN(i)||null==i||""===i||!1===i||"v"===s&&1===u||"pr"==s&&1===u)){var c,d=a[s];d&&(u=d(u)),c="string"==(d=typeof u)&&"ot"!==s&&"sf"!==s&&"st"!==s?s+"="+JSON.stringify(u):"boolean"===d?s:"symbol"===d?s+"="+u.description:s+"="+u,r.push(c)}}return r.join(",")}function ql(e,t){return!t||e.includes("offline:")?e:((e=new Gn(e)).g.set("CMCD",t),e.toString())}(i=Pl.prototype).configure=function(){},i.remove=function(e,t){return!!this.g&&(Ll(this.g,(function(n){return n.startTime<t&&n.endTime>e})),!0)},i.append=function(e){var t=Ml(e),n=[];e=this.g.cues?Array.from(this.g.cues):[];for(var i=(t=l(t)).next(),r={};!i.done;r={Nc:void 0},i=t.next())r.Nc=i.value,!e.some(function(e){return function(t){return t.startTime==e.Nc.startTime&&t.endTime==e.Nc.endTime&&t.text==e.Nc.payload}}(r))&&r.Nc.payload&&(i=Dl(r.Nc))&&n.push(i);for(t=(e=l(e=n.slice().sort((function(e,t){return e.startTime!=t.startTime?e.startTime-t.startTime:e.endTime!=t.endTime?e.endTime-t.startTime:"line"in VTTCue.prototype?n.indexOf(t)-n.indexOf(e):n.indexOf(e)-n.indexOf(t)})))).next();!t.done;t=e.next())this.g.addCue(t.value)},i.destroy=function(){return this.g&&(Ll(this.g,(function(){return!0})),this.g.mode="disabled"),this.g=null,Promise.resolve()},i.isTextVisible=function(){return"showing"==this.g.mode},i.setTextVisibility=function(e){this.g.mode=e?"showing":"hidden"},i.setTextLanguage=function(){},F("shaka.text.SimpleTextDisplayer",Pl),Pl.prototype.setTextLanguage=Pl.prototype.setTextLanguage,Pl.prototype.setTextVisibility=Pl.prototype.setTextVisibility,Pl.prototype.isTextVisible=Pl.prototype.isTextVisible,Pl.prototype.destroy=Pl.prototype.destroy,Pl.prototype.append=Pl.prototype.append,Pl.prototype.remove=Pl.prototype.remove,Pl.prototype.configure=Pl.prototype.configure,(i=Nl.prototype).configure=function(){},i.remove=function(){},i.append=function(){},i.destroy=function(){},i.isTextVisible=function(){return!1},i.setTextVisibility=function(){},i.setTextLanguage=function(){},F("shaka.text.StubTextDisplayer",Nl),Nl.prototype.setTextLanguage=Nl.prototype.setTextLanguage,Nl.prototype.setTextVisibility=Nl.prototype.setTextVisibility,Nl.prototype.isTextVisible=Nl.prototype.isTextVisible,Nl.prototype.destroy=Nl.prototype.destroy,Nl.prototype.append=Nl.prototype.append,Nl.prototype.remove=Nl.prototype.remove,Nl.prototype.configure=Nl.prototype.configure,(i=jl.prototype).configure=function(e){this.C&&this.C.Ra(e.captionsUpdatePeriod)},i.append=function(e){for(var t=[].concat(c(this.h)),n=(e=l(Cl(e))).next(),i={};!n.done;i={Qe:void 0},n=e.next())i.Qe=n.value,t.some(function(e){return function(t){return cn(t,e.Qe)}}(i))||this.h.push(i.Qe);_l(this)},i.destroy=function(){return this.g?(this.s.removeChild(this.g),this.g=null,this.m=!1,this.h=[],this.C&&this.C.stop(),this.i.clear(),this.j&&(this.j.release(),this.j=null),this.o&&(this.o.disconnect(),this.o=null),Promise.resolve()):Promise.resolve()},i.remove=function(e,t){if(!this.g)return!1;var n=this.h.length;return this.h=this.h.filter((function(n){return n.startTime<e||n.endTime>=t})),_l(this,n>this.h.length),!0},i.isTextVisible=function(){return this.m},i.setTextVisibility=function(e){this.m=e,_l(this,!0)},i.setTextLanguage=function(e){e&&"und"!=e?this.g.setAttribute("lang",e):this.g.setAttribute("lang","")},F("shaka.text.UITextDisplayer",jl),jl.prototype.setTextLanguage=jl.prototype.setTextLanguage,jl.prototype.setTextVisibility=jl.prototype.setTextVisibility,jl.prototype.isTextVisible=jl.prototype.isTextVisible,jl.prototype.remove=jl.prototype.remove,jl.prototype.destroy=jl.prototype.destroy,jl.prototype.append=jl.prototype.append,jl.prototype.configure=jl.prototype.configure,F("shaka.text.WebVttGenerator",(function(){})),Vl.prototype.configure=function(e){this.g=e};var zl="a",Wl="v",Yl="av",Jl="tt",$l="d",Ql="ld",Zl="h",ec="lh";function tc(e){this.h=e,this.g=null}function nc(e){return!e||"false"!==e.toLowerCase()&&(/^[-0-9]/.test(e)?parseInt(e,10):e.replace(/["]+/g,""))}F("shaka.util.CmcdManager.StreamingFormat",{DASH:$l,Dj:Ql,HLS:Zl,Ej:ec,Rj:"s",OTHER:"o"}),(i=tc.prototype).configure=function(e){this.h=e},i.Cg=function(){return this.h.enabled&&this.h.applyMaximumSuggestedBitrate&&this.g&&this.g.has(rc)?1e3*this.g.get(rc):null},i.Ag=function(){return this.h.enabled&&this.g&&this.g.has(ic)?1e3*this.g.get(ic):null},i.bi=function(){return this.h.enabled&&this.g&&this.g.has(ac)?this.g.get(ac):null},i.ci=function(){return this.h.enabled&&this.g&&this.g.has(oc)?this.g.get(oc):null},i.getBandwidthEstimate=function(e){var t=this.Ag();if(!t)return e;var n=this.h.estimatedThroughputWeightRatio;return 0<n&&1>=n?e*(1-n)+t*n:e},F("shaka.util.CmsdManager",tc),tc.prototype.getBandwidthEstimate=tc.prototype.getBandwidthEstimate,tc.prototype.getRoundTripTime=tc.prototype.ci,tc.prototype.getResponseDelay=tc.prototype.bi,tc.prototype.getEstimatedThroughput=tc.prototype.Ag,tc.prototype.getMaxBitrate=tc.prototype.Cg;var ic="etp",rc="mb",ac="rd",oc="rtt";function sc(){this.g=null,this.h=[]}function uc(e,t){return P((function(n){if(1==n.g)return e.g?w(n,new Promise((function(t){return e.h.push(t)})),2):n.u(2);e.g=t,T(n)}))}function lc(t,n,i){n=void 0===n?null:n,Zr.call(this);var r=this;this.m=ad,this.h=null,this.ge=n,this.ja=!1,this.te=new Z,this.od=new Z,this.l=new Z,this.Ga=new Z,this.Na=new Z,this.F=this.I=this.C=this.G=null,this.Ce=0,this.Z=new sc,this.ga=this.Ka=this.Y=this.i=this.La=this.H=this.j=this.ac=this.L=this.gg=this.da=this.O=this.bc=this.M=this.ie=this.K=this.Hb=null,this.Ba=!1,this.ta=this.o=null,this.fg=1e9,this.ud=[],this.eg=-1,this.g=Nc(this),this.S=null,this.Ee=-1,this.Aa=null,this.fa={width:1/0,height:1/0},this.de=new to(this.g,this.fa,null),this.le=[],this.A=null,this.xa=new Or(this.g.preferredAudioLanguage,this.g.preferredVariantRole,this.g.preferredAudioChannelCount,this.g.preferredVideoHdrLevel,this.g.preferSpatialAudio,this.g.preferredVideoLayout,this.g.preferredAudioLabel,this.g.preferredVideoLabel,this.g.mediaSource.codecSwitchingStrategy,""),this.Gb=this.g.preferredTextLanguage,this.sd=this.g.preferredTextRole,this.rd=this.g.preferForcedSubs,this.qd=[],i&&i(this),this.O=function(e){return new Vl({getBandwidthEstimate:function(){return e.o?e.o.getBandwidthEstimate():NaN},zb:function(){return e.zb()},getCurrentTime:function(){return e.h?e.h.currentTime:0},ib:function(){return e.ib()},Ab:function(){return e.Ab()},rc:function(){return e.rc()},U:function(){return e.U()}},e.g.cmcd)}(this),this.da=new tc(this.g.cmsd),this.G=Sc(this),this.G.Tf(this.g.streaming.forceHTTP),this.G.Uf(this.g.streaming.forceHTTPS),this.G.m=this.g.streaming.minBytesForProgressEvents,this.Ib=this.aa=this.s=null,this.Ge=!1,this.Fe=new Be((function(){return P((function(e){return 1==e.g?r.aa?w(e,r.Tb(r.Ib,!0),3):e.u(0):4!=e.g?w(e,r.load(r.aa),4):(r.Ge?r.Ib.pause():r.Ib.play(),r.aa=null,r.Ge=!1,void T(e))}))})),cd&&(this.s=cd(),this.s.configure(this.g.ads),this.Na.D(this.s,"ad-content-pause-requested",(function(e){var t;return P((function(n){if(1==n.g)return r.Fe.stop(),r.aa?n.u(0):(r.Ib=r.h,r.Ge=r.h.ended,t=e.saveLivePosition||!1,w(n,r.tg(!0,t),3));r.aa=n.h,T(n)}))})),this.Na.D(this.s,"ad-content-resume-requested",(function(e){if(e=e.offset||0,r.aa){var t=r.aa;t.B&&e&&(t.B+=e)}r.Fe.$(.1)})),this.Na.D(this.s,"ad-content-attach-requested",(function(){return P((function(e){return r.h||!r.Ib?e.u(0):w(e,r.Tb(r.Ib,!0),0)}))}))),this.te.D(e,"online",(function(){Yc(r),r.Nf()})),this.je=new Be((function(){for(var e=Date.now()/1e3,t=!1,n=!0,i=l(r.i.variants),a=i.next();!a.done;a=i.next())0<(a=a.value).disabledUntilTime&&a.disabledUntilTime<=e&&(a.disabledUntilTime=0,t=!0),0<a.disabledUntilTime&&(n=!1);n&&r.je.stop(),t&&Fc(r,!1,void 0,!1,!1)})),this.na=null,t&&(oe("Player w/ mediaElement","Please migrate from initializing Player with a mediaElement; use the attach method instead."),this.Tb(t,!0)),this.B=null}function cc(e){null!=e.L&&(cs(e.L),e.L.release(),e.L=null)}function dc(e,t){return new Jr(e,t)}function hc(e,t){e.dispatchEvent(dc("onstatechange",(new Map).set("state",t)))}function fc(e,t){var n;return P((function(i){return 1==i.g?(n=++e.Ce,w(i,uc(e.Z,t),2)):n!=e.Ce?(e.Z.release(),i.return(!0)):i.return(!1)}))}function pc(e,t){var n,i;return t=void 0!==t&&t,P((function(r){if(1==r.g)return n=null,e.i&&e.H&&e.La&&e.Y?(i=e.h.currentTime,e.U()&&!t&&(i=null),w(r,mc(e,e.Y,i,e.Ka,!0,!1,!1),3)):r.u(2);if(2!=r.g){n=r.h,e.le.push(n),e.H&&e.H.setMediaElement&&e.H.setMediaElement(null);var a=n,o=e.H,s=e.La;a.h=e.i,a.j=o,a.G=s,a=n,o=e.ta,a.i=e.o,a.C=o,n.o=e.xa,n.start(),e.i=null,e.H=null,e.La=null,e.o=null,e.ta=null}return r.return(n)}))}function gc(e,t,n,i,r){var a,o,s;return r=void 0!==r&&r,P((function(u){return 1==u.g?i?u.u(2):w(u,vc(e,t),3):(2!=u.g&&(i=u.h),function(e,t){if(!Fe())return!0;if(t){if(""==(e.h||at()).canPlayType(t))return!1;if(!Fe()||!(t in co))return!0;if(Pi(t))return Ye()&&(e.g.drm.servers["com.apple.fps"]||e.g.drm.servers["com.apple.fps.1_0"])?e.g.streaming.useNativeHlsForFairPlay:e.g.streaming.preferNativeHls}return!1}(e,i)?u.return(null):(a=!1,o=!0,r&&(e.o&&e.ta==e.g.abrFactory&&(o=!1),e.h&&"AUDIO"===e.h.nodeName&&(a=!0)),s=mc(e,t,n,i||null,!r,a,o),s=r?s.then((function(e){return e.A=!1,e})):s.then((function(t){return e.le.push(t),t})),u.return(s)))}))}function mc(e,t,n,i,r,a,o){var s,u,c,d,h,f,p,g,m,v,y,b,S;return r=void 0===r||r,a=void 0!==a&&a,o=void 0===o||o,P((function(x){return 1==x.g?(s=null,u=kt(e.g),a&&(u.manifest.disableVideo=!0),c=function(){return s.S&&s.s?null:s},d=function(){return c()?c().getConfiguration():e.g},h=function(t,n){c()?s.configure(t,n):e.configure(t,n)},1/0!=e.fa.width||1/0!=e.fa.height||e.g.ignoreHardwareResolution?x.u(2):w(x,st(),3)):(2!=x.g&&(f=x.h,e.fa.width=f.width,e.fa.height=f.height),p=new to(u,e.fa,null),g={networkingEngine:e.G,filter:function(e){var t;return P((function(n){return 1==n.g?w(n,no(p,e),2):4!=n.g?n.h?(t=dc("trackschanged"),w(n,Promise.resolve(),4)):n.u(0):(s.dispatchEvent(t),void T(n))}))},makeTextStreamsForClosedCaptions:function(t){return function(e,t){for(var n=new Set,i=l(t.textStreams),r=i.next();!r.done;r=i.next())"application/cea-608"!=(r=r.value).mimeType&&"application/cea-708"!=r.mimeType||n.add(r.originalId);for(r=(i=l(t.variants)).next();!r.done;r=i.next())if((r=r.value.video)&&r.closedCaptions)for(var a=l(r.closedCaptions.keys()),o=a.next();!o.done;o=a.next())if(o=o.value,!n.has(o)){var s=o.startsWith("CC")?"application/cea-608":"application/cea-708",u=new iu,c=r.closedCaptions.get(o);s={id:e.fg++,originalId:o,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:u,mimeType:s,codecs:"",kind:"caption",encrypted:!1,drmInfos:[],keyIds:new Set,language:c,originalLanguage:c,label:null,type:yi,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:r.roles,forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set([xi(s,"")]),isAudioMuxedInVideo:!1},t.textStreams.push(s),n.add(o)}}(e,t)},onTimelineRegionAdded:function(e){var t=s.H;e:{for(var n=l(t.g),i=n.next();!i.done;i=n.next())if((i=i.value).schemeIdUri==e.schemeIdUri&&i.id==e.id&&i.startTime==e.startTime&&i.endTime==e.endTime){n=i;break e}n=null}null==n&&(t.g.add(e),e=new Jr("regionadd",new Map([["region",e]])),t.dispatchEvent(e))},onEvent:function(e){return s.dispatchEvent(e)},onError:function(e){return s.onError(e)},isLowLatencyMode:function(){return d().streaming.lowLatencyMode},isAutoLowLatencyMode:function(){return d().streaming.autoLowLatencyMode},enableLowLatencyMode:function(){h("streaming.lowLatencyMode",!0)},updateDuration:function(){e.j&&s.S&&e.j.updateDuration()},newDrmInfo:function(e){var t=s.l,n=t?t.g:null;n&&t.A&&ao(p,n.keySystem,e)},onManifestUpdated:function(){var t=(new Map).set("isLive",e.U());s.dispatchEvent(dc("manifestupdated",t)),pl(s,!1,(function(){e.s&&e.s.onManifestUpdated(e.U())}))},getBandwidthEstimate:function(){return e.o.getBandwidthEstimate()},onMetadata:function(t,n,i,r){var a=t;"com.apple.hls.interstitial"==t&&(a="com.apple.quicktime.HLS",t={startTime:n,endTime:i,values:r},e.s)&&e.s.onHLSInterstitialMetadata(e,e.h,t),t=(r=l(r)).next();for(var o={};!t.done;o={If:void 0},t=r.next())o.If=t.value,"ID"!=o.If.name&&pl(s,!1,function(t){return function(){Tc(e,n,i,a,t.If)}}(o))},disableStream:function(t){return e.disableStream(t,e.g.streaming.maxDisabledTime)},addFont:function(t,n){return e.addFont(t,n)}},(m=new Au((function(){return e.Qb()}))).addEventListener("regionadd",(function(t){var n=t.region;$c(e,"timelineregionadded",n,s),pl(s,!1,(function(){e.s&&(e.s.onDashTimedMetadata(n),e.s.onDASHInterstitialMetadata(e,e.h,n))}))})),v=null,u.streaming.observeQualityChanges&&((v=new Eu((function(){return e.zb()}))).addEventListener("qualitychange",(function(t){Qc(e,t.quality,t.position)})),v.addEventListener("audiotrackchange",(function(t){Qc(e,t.quality,t.position,!0)}))),y=!0,b={Nb:e.G,onError:function(e){return s.onError(e)},ee:function(t){pl(s,!0,(function(){var n=t,i=dc("keystatuschanged");e.dispatchEvent(i);var r=Object.keys(n);1==r.length&&""==r[0]&&(r=["00"],n={"00":n[""]}),i=1==r.length&&"00"==r[0];var a=!1;if(r.length)for(var o=(r=l(e.i.variants)).next();!o.done;o=r.next()){var s=[];(o=o.value).audio&&s.push(o.audio),o.video&&s.push(o.video);for(var u=(s=l(s)).next();!u.done;u=s.next()){var c=u.value;if(u=o.allowedByKeySystem,c.keyIds.size){o.allowedByKeySystem=!0;for(var d=(c=l(c.keyIds)).next();!d.done;d=c.next())d=d.value,((d=n[i?"00":d])||e.C.F)&&(o.allowedByKeySystem=o.allowedByKeySystem&&!!d&&!so.includes(d))}u!=o.allowedByKeySystem&&(a=!0)}}a&&(Gc(e),!Bc(e))||(n=e.j.j)&&!n.allowedByKeySystem&&Fc(e)}))},onExpirationUpdated:function(e,t){var n=dc("expirationupdated");s.dispatchEvent(n),(n=s.j)&&n.onExpirationUpdated&&n.onExpirationUpdated(e,t)},onEvent:function(t){s.dispatchEvent(t),"drmsessionupdate"==t.type&&y&&(y=!1,t=Date.now()/1e3-s.xa,(e.A||s.getStats()).j=t,e.L&&cs(e.L))}},S=Sc(e,c),ra(e.G,S),s=new fl(t,i,n,{config:u,zi:g,Ji:m,Ii:v,Gc:function(){return e.Gc(b)},yi:p,networkingEngine:S,Bh:r,Ah:o}),x.return(s))}))}function vc(e,t){var n,i;return P((function(r){return 1==r.g?(n=e.g.manifest.retryParameters,w(r,Al(t,e.G,n),2)):("application/x-mpegurl"==(i=r.h)&&Ye()&&(i="application/vnd.apple.mpegurl"),r.return(i))}))}function yc(e){var t=e.g.textDisplayFactory;t!==e.Ae&&(e.B=t(),e.B.configure?e.B.configure(e.g.textDisplayer):oe("Text displayer w/ configure",'Text displayer should have a "configure" method!'),e.Ae=t,e.B.setTextVisibility(e.ja))}function bc(e){var t,n,i;return P((function(r){if(1==r.g)return hc(e,"media-source"),e.h.removeAttribute("src"),Mo(e.h),yc(e),t=function(e,t,n,i){return new hs(e,t,n,i)}(e.h,e.B,{Uh:function(){return e.keySystem()},onMetadata:function(t,n,i){for(var r=(t=l(t)).next();!r.done;r=t.next())if((r=r.value).data&&"number"==typeof r.cueTime&&r.frames){var a=r.cueTime+n,o=i;o&&a>o&&(o=a);for(var s=l(r.frames),u=s.next();!u.done;u=s.next())Tc(e,a,o,"org.id3",u.value);e.s&&e.s.onHlsTimedMetadata(r,a)}},onEvent:function(t){return e.dispatchEvent(t)},Fi:function(){e.H&&e.H.update&&e.H.update()}},e.L),t.configure(e.g.mediaSource),n=e.g.manifest,i=n.segmentRelativeVttTiming,t.xa=i,w(r,t.S,2);e.I=t,T(r)}))}function wc(e,t,n){function i(){return Oc(e)}e.l.D(t,"playing",i),e.l.D(t,"pause",i),e.l.D(t,"ended",i),e.l.D(t,"ratechange",(function(){var t=e.h.playbackRate;0!=t&&(e.K&&e.K.set(t),t=dc("ratechange"),e.dispatchEvent(t))})),t.remote&&(e.l.D(t.remote,"connect",(function(){return Gc(e)})),e.l.D(t.remote,"connecting",(function(){return Gc(e)})),e.l.D(t.remote,"disconnect",(function(){return P((function(n){if(1==n.g)return e.j&&"disconnected"==t.remote.state?w(n,$u(e.j),2):n.u(2);Gc(e),T(n)}))}))),t.audioTracks&&(e.l.D(t.audioTracks,"addtrack",(function(){return Gc(e)})),e.l.D(t.audioTracks,"removetrack",(function(){return Gc(e)})),e.l.D(t.audioTracks,"change",(function(){return Gc(e)}))),t.textTracks&&(e.l.D(t.textTracks,"addtrack",(function(t){if(t.track)switch(t=t.track,t.kind){case"metadata":!function(e,t){if("metadata"==t.kind){t.mode="hidden",e.l.D(t,"cuechange",(function(){if(t.activeCues)for(var n=l(t.activeCues),i=n.next();!i.done;i=n.next())i=i.value,Tc(e,i.startTime,i.endTime,i.type,i.value),e.s&&e.s.onCueMetadataChange(i.value);if(t.cues){n=[];for(var r=(i=l(t.cues)).next(),a={};!r.done;a={Vb:void 0},r=i.next())a.Vb=r.value,"com.apple.quicktime.HLS"==a.Vb.type&&null!=a.Vb.startTime&&(r=n.find(function(e){return function(t){return t.startTime==e.Vb.startTime&&t.endTime==e.Vb.endTime}}(a)),r||(r={startTime:a.Vb.startTime,endTime:a.Vb.endTime,values:[]},n.push(r)),r.values.push(a.Vb.value));for(i=(n=l(n)).next();!i.done;i=n.next())(i=i.value).values.some((function(e){return"X-ASSET-URI"==e.key||"X-ASSET-LIST"==e.key}))&&e.s&&(i.values.push({key:"CUE",description:"",data:0!=i.startTime||e.U()?"ONCE":"ONCE,PRE",mimeType:null,pictureType:null}),e.s.onHLSInterstitialMetadata(e,e.h,i))}}));var n=new Be((function(){for(var t=function(e){return Array.from(e.h.textTracks).filter((function(e){return"metadata"==e.kind}))}(e),n=(t=l(t)).next();!n.done;n=t.next())n.value.mode="hidden"})).hc().$(.5);e.qd.push((function(){n.stop()}))}}(e,t);break;case"chapters":!function(e,t){if(t&&"chapters"==t.kind){t.mode="hidden";var n=new Be((function(){t.mode="hidden"})).hc().$(.5);e.qd.push((function(){n.stop()}))}}(e,t);break;default:Gc(e)}})),e.l.D(t.textTracks,"removetrack",(function(){return Gc(e)})),e.l.D(t.textTracks,"change",(function(){return Gc(e)}))),"none"!=t.preload&&e.l.pa(t,"loadedmetadata",(function(){e.A.C=Date.now()/1e3-n}))}function Tc(e,t,n,i,r){t=(new Map).set("startTime",t).set("endTime",n).set("metadataType",i).set("payload",r),e.dispatchEvent(dc("metadata",t))}function Sc(e,t){function n(n){t()?t().dispatchEvent(n):e.dispatchEvent(n)}function i(e){t()?pl(t(),!0,e):e()}return t||(t=function(){return null}),new na((function(n,i,r,a){var o=t()?t().i:e.o;o&&o.segmentDownloaded(n,i,r,a)}),(function(t,r,a){n(dc("downloadheadersreceived",r=(new Map).set("headers",t).set("request",r).set("requestType",a))),i((function(){if(e.da){var n=e.da;if(n.h.enabled){var i=t["cmsd-static"];if(i)try{var r=new Map,a=i.split(",");for(i=0;i<a.length;i++){var o=a[i].split("=");r.set(o[0],nc(o[1]))}}catch(e){}if(r=t["cmsd-dynamic"]){try{var s=new Map,u=r.split(";");for(r=1;r<u.length;r++){var l=u[r].split("=");s.set(l[0],nc(l[1]))}var c=s}catch(e){c=null}c&&(n.g=c)}}}}))}),(function(e,t,i,r){n(dc("downloadfailed",e=(new Map).set("request",e).set("error",t).set("httpResponseCode",i).set("aborted",r)))}),(function(t,n,r){i((function(){var i=e.O,a=r;if(a=void 0===a?{}:a,i.g.enabled)if("HEAD"===n.method)Gl(i,n);else switch(t){case 0:try{if(i.g.enabled){if(a.type){e:{switch(a.type){case 4:var o=i.j?Ql:$l;break e;case 3:case 2:o=i.j?ec:Zl;break e;case 5:o="s";break e}o=void 0}i.i=o}Gl(i,n,{ot:"m",su:!i.l})}}catch(e){Y("CMCD_MANIFEST_ERROR","Could not generate manifest CMCD data.",e)}break;case ca:try{if(i.g.enabled){var s=a.segment;o=0,s&&(o=s.endTime-s.startTime);var u={d:1e3*o,st:i.h.U()?"l":"v"};u.ot=function(e){if(0===e.type)return"i";if(e=e.stream){var t=e.type;if("video"==t)return e.codecs&&e.codecs.includes(",")?Yl:Wl;if("audio"==t)return zl;if("text"==t)return"application/mp4"===e.mimeType?Jl:"c"}}(a);var c=u.ot===Wl||u.ot===zl||u.ot===Yl||u.ot===Jl,d=a.stream;if(d){var h=i.h.ib();if(c&&(u.bl=function(e,t){if(!(t=e.h.zb()[t]).length)return NaN;var n=e.h.getCurrentTime();return(e=t.find((function(e){return e.start<=n&&e.end>=n})))?1e3*(e.end-n):NaN}(i,d.type),u.ot!==Jl)){var f=Kl(i,d.type);u.dl=h?f/Math.abs(h):f}if(d.bandwidth&&(u.br=d.bandwidth/1e3),d.segmentIndex&&s){var p=d.segmentIndex.Jb(s.endTime,!0,0>h);if(p){var g=p.next().value;if(g&&g!=s){if(!Ce(s.N(),g.N())){var m=g.N()[0],v=n.uris[0],y=new URL(m),b=new URL(v);if(y.origin!==b.origin)var w=m;else{for(var T=y.pathname.split("/").slice(1),S=b.pathname.split("/").slice(1,-1);T[0]===S[0];)T.shift(),S.shift();for(;S.length;)S.shift(),T.unshift("..");w=T.join("/")}u.nor=w}if((g.Ja||g.va)&&(s.Ja!=g.Ja||s.va!=g.va)){var x=g.Ja+"-";g.va&&(x+=g.va),u.nrr=x}}}var A=i.h.ib()||1,E=Kl(i,d.type)||500,k=d.bandwidth,I=k?k*(s.endTime-s.startTime)/1e3/(E/A/1e3)*i.g.rtpSafetyFactor:NaN;isNaN(I)||(u.rtp=I)}}c&&u.ot!==Jl&&(u.tb=function(e,t){var n=e.h.rc();if(!n.length)return NaN;e=n[0];for(var i=(n=l(n)).next();!i.done;i=n.next())"variant"===(i=i.value).type&&i.bandwidth>e.bandwidth&&(e=i);switch(t){case Wl:return e.videoBandwidth||NaN;case zl:return e.audioBandwidth||NaN;default:return e.bandwidth}}(i,u.ot)/1e3),Gl(i,n,u)}}catch(e){Y("CMCD_SEGMENT_ERROR","Could not generate segment CMCD data.",e)}break;case 2:case 5:case 6:Gl(i,n,{ot:"k"});break;case 4:Gl(i,n,{ot:"o"})}}))}),(function(n,i,r,a){(n=t()?t().j:e.H)&&n.banLocation&&n.banLocation(a)}),(function(n,i){if(i.data){i=i.data.byteLength;var r=t()?t().getStats():e.A;r&&(r.kc=isNaN(r.kc)?i:r.kc+i,0===n&&(r.Kg=i))}}))}function xc(e,t,n){e.M=new Ur,e.M.g=Br,_r(e.M,n,Math.min(.5,n/2)),jc(e),e.ie=new Be((function(){Ac(e)})).Ra(.25),e.l.D(t,"waiting",(function(){return Ac(e)})),e.l.D(t,"stalled",(function(){return Ac(e)})),e.l.D(t,"canplaythrough",(function(){return Ac(e)})),e.l.D(t,"progress",(function(){return Ac(e)}))}function Ac(e){switch(e.m){case sd:if(e.h.ended)var t=!0;else{var n=So(e.h.buffered);t=null!=n&&n>=e.h.duration-1}break;case od:e:if(e.h.ended||ms(e.I))t=!0;else{if(e.i.presentationTimeline.U()){n=e.i.presentationTimeline.Yb();var i=So(e.h.buffered);if(null!=i&&i>=n){t=!0;break e}}t=!1}break;default:t=!1}i=Ao(e.h.buffered,e.h.currentTime);var r=t,a=(n=e.M).i.get(n.g);t=n.g,i=r||i>=a?Fr:Br,n.g=i,(t=t!=i)&&i===Fr&&(n.h=Date.now()),t&&jc(e)}function Ec(e){if(e.de=new to(e.g,e.fa,e.C),e.H){var t=kt(e.g.manifest);e.h&&"AUDIO"===e.h.nodeName&&(t.disableVideo=!0),e.H.configure(t)}if(e.C&&e.C.configure(e.g.drm),e.j){e.j.configure(e.g.streaming);try{e.m!=rd&&ro(e.de,e.i)&&Gc(e)}catch(t){Jc(e,t)}e.o&&Bc(e),!(t=e.j.j)||t.allowedByApplication&&t.allowedByKeySystem||Fc(e)}if(e.G&&(e.G.Tf(e.g.streaming.forceHTTP),e.G.Uf(e.g.streaming.forceHTTPS),e.G.m=e.g.streaming.minBytesForProgressEvents),e.I&&(e.I.configure(e.g.mediaSource),e.I.xa=e.g.manifest.segmentRelativeVttTiming),e.B)if(t=e.g.textDisplayFactory,e.Ae!=t){var n=e.B;if(e.B=t(),e.B.configure?e.B.configure(e.g.textDisplayer):oe("Text displayer w/ configure",'Text displayer should have a "configure" method!'),e.B.setTextLanguage||oe("Text displayer w/ setTextLanguage",'Text displayer should have a "setTextLanguage" method!'),e.B.setTextVisibility(n.isTextVisible()),n.destroy(),e.I){n=e.I;var i=e.B;n.fa=i,n.h&&(n.h.j=i)}e.Ae=t,e.j&&(n=(t=e.j).i.get(yi))&&Ou(t,n.stream,!0,0,!0)}else e.B.configure&&e.B.configure(e.g.textDisplayer);e.o&&(e.o.configure(e.g.abr),e.g.abr.enabled?e.o.enable():e.o.disable(),zc(e)),e.M&&(t=e.g.streaming.rebufferingGoal,e.i&&(t=Math.max(t,e.i.minBufferTime)),_r(e.M,t,Math.min(.5,t/2))),e.i&&ed(e.i.presentationTimeline,e.g.playRangeStart,e.g.playRangeEnd),e.s&&e.s.configure(e.g.ads),e.O&&e.O.configure(e.g.cmcd),e.da&&e.da.configure(e.g.cmsd)}function kc(e){return e&&(e=/(\d+)x(\d+)/.exec(e))?{lc:parseInt(e[1],10),rows:parseInt(e[2],10)}:null}function Ic(e,t){e.l.D(t,"cuechange",(function(){e.B.remove(0,Math.max(0,e.h.currentTime-e.g.streaming.bufferBehind));var n=Array.from(t.activeCues||[]).map(Rl).filter(Gi);e.B.append(n)})),t.mode=document.pictureInPictureElement?"showing":"hidden"}function Mc(e){return Array.from(e.h.textTracks).filter((function(e){return"metadata"!=e.kind&&"chapters"!=e.kind&&"Shaka Player TextTrack"!=e.label}))}function Cc(e){return Array.from(e.h.textTracks).filter((function(e){return"chapters"==e.kind}))}function Dc(e,t){var n;return P((function(i){switch(i.g){case 1:return S(i,2),w(i,Al(t,e.G,e.g.streaming.retryParameters),4);case 4:n=i.h,A(i,3);break;case 2:E(i);case 3:if(n)return i.return(n);throw new De(1,2,2011,t)}}))}function Rc(e,t,n,i,r,a,o){var s,u,l,c;return P((function(d){if(1==d.g)return"text/vtt"!=r||o.length?w(d,Pc(e,t,e.G,e.g.streaming.retryParameters),3):d.u(2);2!=d.g&&(s=d.h,u=Lc(e,s,r,o),l=new Blob([u],{type:"text/vtt"}),t=Rs(l),r="text/vtt"),c=document.createElement("track");var h=e.O,f=t;try{if(h.g.enabled){var p=Hl(h);p.ot="c",p.su=!0;var g=ql(f,Xl(p))}else g=f}catch(e){Y("CMCD_TEXT_TRACK_ERROR","Could not generate text track CMCD data.",e),g=f}return c.src=g,c.label=a,c.kind=i,c.srclang=n,e.h.getAttribute("crossorigin")||e.h.setAttribute("crossorigin","anonymous"),e.h.appendChild(c),d.return(c)}))}function Pc(e,t,n,i){var r,a,o;return P((function(s){if(1==s.g){r=ca,(a=aa([t],i)).method="GET";var u=e.O;try{u.g.enabled&&Gl(u,a,{ot:"c",su:!0})}catch(e){Y("CMCD_TEXT_ERROR","Could not generate text CMCD data.",e)}return w(s,n.request(r,a).promise,2)}return o=s.h,s.return(o.data)}))}function Lc(e,t,n,i){var r=Fi[n];if(r)return n=r(),e={periodStart:0,segmentStart:0,segmentEnd:e.h.duration,vttOffset:0},t=ge(t),function(e,t){function n(e){for(var n=e,i=l(t),r=i.next();!r.done;r=i.next())(r=r.value).end&&r.start<e&&(n+=r.end-r.start);return(10>(e=Math.floor(n/3600))?"0":"")+e+":"+(10>(i=Math.floor(n/60%60))?"0":"")+i+":"+(10>(r=Math.floor(n%60))?"0":"")+r+"."+(100>(n=Math.floor(1e3*n%1e3))?10>n?"00":"0":"")+n}var i=Ml(e);e="WEBVTT\n\n";for(var r=(i=l(i)).next();!r.done;r=i.next())e+=n((r=r.value).startTime)+" --\x3e "+n(r.endTime)+function(e){var t=[];switch(e.textAlign){case"left":t.push("align:left");break;case"right":t.push("align:right");break;case mn:t.push("align:middle");break;case"start":t.push("align:start");break;case"end":t.push("align:end")}switch(e.writingMode){case"vertical-lr":t.push("vertical:lr");break;case"vertical-rl":t.push("vertical:rl")}return t.length?" "+t.join(" "):""}(r)+"\n",e+=r.payload+"\n\n";return e}(t=n.parseMedia(t,e,null,[]),i);throw new De(2,2,2014,n)}function Nc(e){var t=ll();return t.streaming.failureCallback=function(t){if(e.U()){var n=null;1001==t.code||1002==t.code?(n=1,e.g.streaming.lowLatencyMode&&(n=.1)):1003==t.code&&(n=.1),null!=n&&(t.severity=1,e.Nf(n))}},t.textDisplayFactory=function(){if(!e.ge||et()&&!document.fullscreenEnabled)return HTMLMediaElement.prototype.addTextTrack?new Pl(e.h,"Shaka Player TextTrack"):new Nl;var t=e.getConfiguration();return new jl(e.h,e.ge,t.textDisplayer)},t}function jc(e){var t=e.tf();if(e.A&&e.M&&e.F){var n=e.K;if(n.j=t,au(n),e.O&&(n=e.O,t||n.l||(n.l=!0),n.l&&t&&(n.m=!0),n.o=t),Oc(e),n=e.g.streaming.liveSync.dynamicTargetLatency.maxAttempts,e.g.streaming.liveSync.dynamicTargetLatency.enabled&&t&&e.Ee<n){n=e.g.streaming.liveSync.dynamicTargetLatency.maxLatency;var i=e.g.streaming.liveSync.targetLatencyTolerance,r=e.g.streaming.liveSync.dynamicTargetLatency.rebufferIncrement;e.S&&(e.S=Math.min(e.S+ ++e.Ee*r,n-i))}}t=(new Map).set("buffering",t),e.dispatchEvent(dc("buffering",t))}function Oc(e){if(e.A&&e.M){var t=e.A.g,n="playing";e.M.g==Br?n="buffering":e.h.ended?n="ended":e.h.paused&&(n="paused");var i=n;if(null==t.g)t.g={timestamp:Date.now()/1e3,state:i,duration:0},t=!0;else{var r=Date.now()/1e3;t.g.duration=r-t.g.timestamp,t.g.state==i?t=!1:(t.h.push(t.g),t.g={timestamp:r,state:i,duration:0},t=!0)}t&&(n=(new Map).set("newstate",n),e.dispatchEvent(dc("statechanged",n)))}}function Uc(e){var t=e.h.playbackRate,n=e.U();if(e.g.streaming.vodDynamicPlaybackRate&&!n){var i=e.g.streaming.vodDynamicPlaybackRateLowBufferRate,r=e.yg();r<=e.g.streaming.vodDynamicPlaybackRateBufferRatio?t!=i&&e.Bd(i,!1):1==r&&t!==e.K.oc()&&e.$c()}if(n&&(n=e.Qb(),Number.isFinite(n.end)&&!(e.h.currentTime<n.start||e.h.paused))){i=e.g.streaming.liveSync.targetLatencyTolerance,r=e.g.streaming.liveSync.dynamicTargetLatency.enabled;var a=e.g.streaming.liveSync.dynamicTargetLatency.stabilityThreshold;if(e.g.streaming.liveSync&&e.g.streaming.liveSync.enabled)var o=e.g.streaming.liveSync.targetLatency,s=o+i,u=Math.max(0,o-i),l=e.g.streaming.liveSync.maxPlaybackRate,c=e.g.streaming.liveSync.minPlaybackRate;else e.i&&e.i.serviceDescription&&(o=e.i.serviceDescription.targetLatency,null!=e.i.serviceDescription.targetLatency?s=e.i.serviceDescription.targetLatency+i:null!=e.i.serviceDescription.maxLatency&&(s=e.i.serviceDescription.maxLatency),null!=e.i.serviceDescription.targetLatency?u=Math.max(0,e.i.serviceDescription.targetLatency-i):null!=e.i.serviceDescription.minLatency&&(u=e.i.serviceDescription.minLatency),l=e.i.serviceDescription.maxPlaybackRate||e.g.streaming.liveSync.maxPlaybackRate,c=e.i.serviceDescription.minPlaybackRate||e.g.streaming.liveSync.minPlaybackRate);e.S||"number"!=typeof o||(e.S=o);var d=e.g.streaming.liveSync.dynamicTargetLatency.maxAttempts;r&&e.Aa&&null!==e.S&&"number"==typeof o&&e.Ee<d&&Date.now()-e.Aa>1e3*a&&(a=e.g.streaming.liveSync.dynamicTargetLatency.minLatency,e.S=Math.max(e.S-(o-a)/2,a+i),e.Aa=Date.now()),r&&null!==e.S&&(s=e.S+i,u=e.S-i),o=n.end-e.h.currentTime,i=0,e.m==sd&&0<(r=e.h.buffered).length&&(i=r.end(r.length-1),i=Math.max(l,i-n.end)),n=e.g.streaming.liveSync.panicMode,r=1e3*e.g.streaming.liveSync.panicThreshold,a=Date.now()-e.M.h,n&&!c&&(c=e.g.streaming.liveSync.minPlaybackRate),n&&c&&a<=r?t!=c&&e.Bd(c,!1):null!=s&&l&&o-i>s?(t!=l&&e.Bd(l,!1),e.Aa=null):null!=u&&c&&o-i<u?(t!=c&&e.Bd(c,!1),e.Aa=null):t!==e.K.oc()&&(e.$c(),e.Aa=Date.now())}}function _c(e){if(e.h){var t,n=function(t,n){var i=void 0===i?Number.EPSILON:i;if(t===n)i=!0;else{var r=Math.abs(t-n);i=r<=i||i!==Number.EPSILON&&Math.abs(r-i)<=Number.EPSILON}return!!((i||n>t)&&e.eg<t)&&(e.eg=t,!0)},i=e.h.currentTime/e.h.duration;isNaN(i)||(n(0,i*=100)?t=dc("started"):n(25,i)?t=dc("firstquartile"):n(50,i)?t=dc("midpoint"):n(75,i)?t=dc("thirdquartile"):n(100,i)&&(t=dc("complete")),t&&e.dispatchEvent(t))}}function Bc(e){try{oo(e.de,e.i)}catch(t){return Jc(e,t),!1}var t=br(e.i.variants);return t=e.xa.create(t),e.o.setVariants(Array.from(t.values())),!0}function Fc(e,t,n,i,r){var a;t=void 0===t||t,n=void 0===n?0:n,i=void 0!==i&&i,r=void 0===r||r,(a=Bc(e)?e.o.chooseVariant():null)&&Vc(e,a,r,t,n,i)}function Vc(e,t,n,i,r,a){a=void 0!==a&&a;var o=e.j.j;if(t==o)i&&Nu(e.j,t,i,r,!0);else{var s=e.A.h;s.h!=t&&(s.h=t,s.g.push({timestamp:Date.now()/1e3,id:t.id,type:"variant",fromAdaptation:n,bandwidth:t.bandwidth})),Nu(e.j,t,i,r,a,n),i=null,o&&(i=dr(o)),(t=dr(t)).active=!0,n?(n=(new Map).set("oldTrack",i).set("newTrack",t),e.L&&ds(e.L,t,e.lf()),td(e,n=dc("adaptation",n))):Kc(e,i,t)}}function Hc(e,t){var n=Array.from(e.h.audioTracks).find((function(e){return e.enabled}));t.enabled=!0,n&&(t.id!==n.id&&(n.enabled=!1),Kc(e,n=mr(n),t=mr(t)))}function Gc(e){td(e,dc("trackschanged"))}function Kc(e,t,n){t=(new Map).set("oldTrack",t).set("newTrack",n),e.L&&ds(e.L,n,e.lf()),td(e,n=dc("variantchanged",t))}function Xc(e){td(e,dc("textchanged"))}function qc(e){td(e,dc("texttrackvisibility"))}function zc(e){e.g.abr.enabled||Yc(e),td(e,dc("abrstatuschanged",(new Map).set("newStatus",e.g.abr.enabled)))}function Wc(e){var t=e.qc().find((function(e){return e.active}));t&&e.B&&e.B.setTextLanguage&&e.B.setTextLanguage(t.language)}function Yc(e,t){if(t=void 0===t||t,e.m==od){e.je.stop();for(var n=l(e.i.variants),i=n.next();!i.done;i=n.next())i.value.disabledUntilTime=0;t&&Bc(e)}}function Jc(e,t){var n,i,r,a;return P((function(o){switch(o.g){case 1:if(e.m==rd)return o.return();if(1===t.severity&&e.A.K++,n=!0,!(e.Ba&&e.i&&e.j)||3016!=t.code&&3014!=t.code&&3015!=t.code&&3018!=t.code){o.u(2);break}return S(o,3),w(o,$u(e.j),5);case 5:i=o.h,n=!i,i&&(r=dc("mediasourcerecovered"),e.dispatchEvent(r)),A(o,2);break;case 3:E(o),n=!0;case 2:if(!n)return o.return();2===t.severity&&Yc(e,!1),a=dc("error",(new Map).set("detail",t)),e.dispatchEvent(a),a.defaultPrevented&&(t.handled=!0),T(o)}}))}function $c(e,t,n,i){i=void 0===i?e:i,e=(new Map).set("detail",{schemeIdUri:n.schemeIdUri,value:n.value,startTime:n.startTime,endTime:n.endTime,id:n.id,eventElement:n.eventElement,eventNode:n.eventNode}),i.dispatchEvent(dc(t,e))}function Qc(e,t,n,i){i=void 0!==i&&i,t=(new Map).set("mediaQuality",{bandwidth:t.bandwidth,audioSamplingRate:t.audioSamplingRate,codecs:t.codecs,contentType:t.contentType,frameRate:t.frameRate,height:t.height,mimeType:t.mimeType,channelsCount:t.channelsCount,pixelAspectRatio:t.pixelAspectRatio,width:t.width,label:t.label,roles:t.roles,language:t.language}).set("position",n),e.dispatchEvent(dc(i?"audiotrackchanged":"mediaqualitychanged",t))}function Zc(e,t){if(t=void 0===t||t,!e.h.error)return t?new De(2,3,3016):null;var n=e.h.error.code;return t||1!=n?((t=e.h.error.msExtendedCode)&&(0>t&&(t+=Math.pow(2,32)),t=t.toString(16)),new De(2,3,3016,n,t,e.h.error.message)):null}function ed(e,t,n){0<t&&(e.U()||e.jh(t)),n<(t=e.getDuration())&&(e.U()||e.bb(n))}function td(e,t){P((function(n){if(1==n.g)return w(n,Promise.resolve(),2);e.m!=rd&&e.dispatchEvent(t),T(n)}))}function nd(e){for(var t=new Set,n=(e=l(e)).next();!n.done;n=e.next())(n=n.value).language?t.add(Yi(n.language)):t.add("und");return t}function id(e){for(var t=new Map,n=new Map,i=(e=l(e)).next();!i.done;i=e.next()){var r="und",a=[];(i=i.value).language&&(r=Yi(i.language)),(a="variant"==i.type?i.audioRoles:i.roles)&&a.length||(a=[""]),t.has(r)||t.set(r,new Set);for(var o=(a=l(a)).next();!o.done;o=a.next())o=o.value,t.get(r).add(o),i.label&&(n.has(r)||n.set(r,new Map),n.get(r).set(o,i.label))}var s=[];return t.forEach((function(e,t){for(var i=(e=l(e)).next();!i.done;i=e.next()){i=i.value;var r=null;n.has(t)&&n.get(t).has(i)&&(r=n.get(t).get(i)),s.push({language:t,role:i,label:r})}})),s}sc.prototype.release=function(){0<this.h.length?this.h.shift()():this.g=null},m(lc,Zr),(i=lc.prototype).destroy=function(){var e,t=this;return P((function(n){switch(n.g){case 1:return t.m==rd?n.return():(cc(t),e=t.detach(),t.m=rd,w(n,e,2));case 2:return w(n,t.Te(),3);case 3:if(t.te&&(t.te.release(),t.te=null),t.od&&(t.od.release(),t.od=null),t.l&&(t.l.release(),t.l=null),t.Ga&&(t.Ga.release(),t.Ga=null),t.Na&&(t.Na.release(),t.Na=null),t.ta=null,t.g=null,t.A=null,t.ge=null,t.O=null,t.da=null,!t.G){n.u(4);break}return w(n,t.G.destroy(),5);case 5:t.G=null;case 4:t.o&&(t.o.release(),t.o=null),Zr.prototype.release.call(t),T(n)}}))},i.Tb=function(e,t){t=void 0===t||t;var n,i,r,a=this;return P((function(o){switch(o.g){case 1:if(a.m==rd)throw new De(2,7,7e3);if(n=a.h&&a.h==e,!a.h||a.h==e){o.u(2);break}return w(o,a.detach(),2);case 2:return w(o,fc(a,"attach"),4);case 4:if(o.h)return o.return();if(S(o,5,6),n||(hc(a,"attach"),i=function(){var e=Zc(a,!1);e&&Jc(a,e)},a.od.D(e,"error",i),a.h=e),!t||!Fe()||a.I){o.u(6);break}return w(o,bc(a),6);case 6:k(o),a.Z.release(),I(o,0);break;case 5:return r=E(o),w(o,a.detach(),10);case 10:throw r}}))},i.Ch=function(e){this.gg=e},i.detach=function(e){e=void 0!==e&&e;var t=this;return P((function(n){if(1==n.g){if(t.m==rd)throw new De(2,7,7e3);return w(n,t.ic(!1,e),2)}if(3!=n.g)return w(n,fc(t,"detach"),3);if(n.h)return n.return();try{t.h&&(t.od.Va(),t.h=null),hc(t,"detach"),t.s&&!e&&t.s.release()}finally{t.Z.release()}T(n)}))},i.ic=function(e,t){e=void 0===e||e,t=void 0!==t&&t;var n,i,r,a,o,s,u,c,d,h,f=this;return P((function(p){switch(p.g){case 1:return f.m!=rd&&(f.m=ad),w(p,fc(f,"unload"),2);case 2:return p.h?p.return():(x(p,3),f.Ba=!1,hc(f,"unload"),e&&!Fe()&&(e=!1),cc(f),n=f.qd.map((function(e){return e()})),f.qd=[],w(p,Promise.all(n),5));case 5:if(f.dispatchEvent(dc("unloading")),f.bc&&(f.bc.release(),f.bc=null),f.h&&(f.l.Va(),f.Ga.Va()),f.je.stop(),f.Hb&&(f.Hb.release(),f.Hb=null),f.ie&&(f.ie.stop(),f.ie=null),!f.H){p.u(6);break}return w(p,f.H.stop(),7);case 7:f.H=null,f.La=null;case 6:if(!f.o){p.u(8);break}return w(p,f.o.stop(),8);case 8:if(!f.j){p.u(10);break}return w(p,f.j.destroy(),11);case 11:f.j=null;case 10:if(f.K&&(f.K.release(),f.K=null),f.F&&(f.F.release(),f.F=null),!ot("webkit")||!f.C){p.u(12);break}return w(p,f.C.destroy(),13);case 13:f.C=null;case 12:if(!f.I){p.u(14);break}return w(p,f.I.destroy(),15);case 15:f.I=null;case 14:if(f.s&&!t&&f.s.onAssetUnload(),f.aa&&!t&&(f.aa.destroy(),f.aa=null),t||f.Fe.stop(),f.O&&function(e){e.l=!1,e.o=!0,e.m=!1,e.j=!1}(f.O),f.da&&(f.da.g=null),!f.B){p.u(16);break}return w(p,f.B.destroy(),17);case 17:f.B=null;case 16:if(f.h&&(Mo(f.h),f.h.src&&(f.h.removeAttribute("src"),f.h.load())),!f.C){p.u(18);break}return w(p,f.C.destroy(),19);case 19:f.C=null;case 18:if(f.na&&f.Y!=f.na.Mc()&&(f.na.s||f.na.destroy(),f.na=null),f.Y=null,f.Ka=null,f.M=null,f.i){for(i=l(f.i.variants),r=i.next();!r.done;r=i.next())for(a=r.value,o=l([a.audio,a.video]),s=o.next();!s.done;s=o.next())(u=s.value)&&u.segmentIndex&&u.segmentIndex.release();for(c=l(f.i.textStreams),d=c.next();!d.done;d=c.next())(h=d.value).segmentIndex&&h.segmentIndex.release()}f.g&&f.g.streaming.clearDecodingCache&&(Ar={},Ue.clear()),f.i=null,f.A=new hu,f.Ae=null,f.Aa=null,f.S=null,f.Ee=-1,f.ud=[],f.eg=-1,jc(f);case 3:k(p),f.Z.release(),I(p,4);break;case 4:if(e&&Fe()&&!f.I&&f.h)return w(p,bc(f),0);p.u(0)}}))},i.ij=function(e){this.ga=e},i.load=function(t,n,i){n=void 0===n?null:n;var r,a,o,s,u,c,d,h,f,p,g,m,v,y=this;return P((function(b){switch(b.g){case 1:if(y.m==rd)throw new De(2,7,7e3);return r=null,a="",a=t instanceof fl?(r=t).Mc()||"":t||"",w(b,uc(y.Z,"load"),2);case 2:if(y.Z.release(),!y.h)throw new De(2,7,7002);if(!y.Y){b.u(3);break}return y.Y=a,w(b,y.ic(!1),3);case 3:if(o=++y.Ce,s=function(){return P((function(e){if(1==e.g)return y.Ce==o?e.u(0):r?w(e,r.destroy(),3):e.u(3);throw new De(2,7,7e3)}))},u=function(e,t){return P((function(n){switch(n.g){case 1:return x(n,2),w(n,uc(y.Z,t),4);case 4:return w(n,s(),5);case 5:return w(n,e(),6);case 6:return w(n,s(),7);case 7:r&&y.g&&(r.g=y.g);case 2:k(n),y.Z.release(),I(n,0)}}))},S(b,5,6),null==n&&r&&(n=r.getStartTime()),y.ga=n,y.Ba=!1,y.dispatchEvent(dc("loading")),r){i=r.Y,b.u(8);break}if(i){b.u(8);break}return w(b,u((function(){return P((function(e){if(1==e.g)return w(e,vc(y,a),2);i=e.h,T(e)}))}),"guessMimeType_"),8);case 8:if(c=!!r,r){gl(r,y),y.A=r.getStats(),b.u(11);break}return w(b,gc(y,a,n,i,!0),12);case 12:(r=b.h)?(r.A=!1,gl(r,y),y.A=r.getStats(),r.start(),r.m.catch((function(){}))):y.A=new hu;case 11:return d=!r,h=Date.now()/1e3,y.A=r?r.getStats():new hu,y.Y=a,y.Ka=i||null,d?w(b,u((function(){return P((function(e){return w(e,function(e,t){var n,i,r,a,o;return P((function(s){return 1==s.g?(n=bi,i=Date.now()/1e3,r=!0,e.C=e.Gc({Nb:e.G,onError:function(t){Jc(e,t)},ee:function(){},onExpirationUpdated:function(){var t=dc("expirationupdated");e.dispatchEvent(t)},onEvent:function(t){e.dispatchEvent(t),"drmsessionupdate"==t.type&&r&&(r=!1,e.A.j=Date.now()/1e3-i)}}),e.C.configure(e.g.drm),a={id:0,language:"und",disabledUntilTime:0,primary:!1,audio:null,video:null,bandwidth:100,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},(o={id:0,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:t?Di(t):"",codecs:t?Ri(t):"",encrypted:!0,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:n.la,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set,isAudioMuxedInVideo:!1}).fullMimeTypes.add(xi(o.mimeType,o.codecs)),t.startsWith("audio/")?(o.type=n.V,a.audio=o):a.video=o,e.C.da=!0,w(s,ja(e.C,[a],[]),2)):w(s,e.C.Tb(e.h),0)}))}(y,i),0)}))}),"initializeSrcEqualsDrmInner_"),21):w(b,u((function(){return P((function(e){if(1==e.g)return w(e,Promise.race([r.fa,r.m]),2);y.La=r.G;var t=r;t.ga=!0,y.H=t.j,y.i=r.kf(),T(e)}))}),"waitForFinish"),15);case 15:if(y.I){b.u(16);break}return w(b,u((function(){return P((function(e){return w(e,bc(y),0)}))}),"initializeMediaSourceEngineInner_"),16);case 16:return w(b,u((function(){return P((function(e){return w(e,r.m,0)}))}),"waitForFinish"),18);case 18:return y.g=r.getConfiguration(),y.de=r.F,y.H&&y.H.setMediaElement&&y.h&&y.H.setMediaElement(y.h),y.bc=function(e){return e.na=!0,e.H}(r),y.ac=r.Aa,(f=r.o)&&(y.xa=f),c&&y.h&&"AUDIO"===y.h.nodeName&&(function(e){for(var t=l(e.i.variants),n=t.next();!n.done;n=t.next())(n=n.value).video&&(n.video.closeSegmentIndex(),n.video=null),n.bandwidth=n.audio&&n.audio.bandwidth?n.audio.bandwidth:0;e.i.variants=e.i.variants.filter((function(e){return e.audio}))}(y),y.configure("manifest.disableVideo",!0)),y.C=function(e){return e.da=!0,e.l}(r),w(b,u((function(){return P((function(e){return w(e,y.C.Tb(y.h),0)}))}),"drmEngine_.attach"),19);case 19:return!(p=r.C)||y.ta&&y.ta==p||(y.o=function(e){return e.aa=!0,e.i}(r),y.ta=r.C,"function"!=typeof y.o.setMediaElement&&(oe("AbrManager w/o setMediaElement","Please use an AbrManager with setMediaElement function."),y.o.setMediaElement=function(){}),"function"!=typeof y.o.setCmsdManager&&(oe("AbrManager w/o setCmsdManager","Please use an AbrManager with setCmsdManager function."),y.o.setCmsdManager=function(){}),"function"!=typeof y.o.trySuggestStreams&&(oe("AbrManager w/o trySuggestStreams","Please use an AbrManager with trySuggestStreams function."),y.o.trySuggestStreams=function(){})),g=function(e){return e.ta=!0,e.L}(r),m=r.ja,w(b,u((function(){return P((function(e){return w(e,function(e,t,n,i){var r,a,o,s,u,c,d,h,f,p,g,m,v,y,b,S,x,A,E,k;return P((function(I){switch(I.g){case 1:hc(e,"load"),r=e.h,e.K=new ru({Pd:function(){return r.playbackRate},oc:function(){return r.defaultPlaybackRate},Vf:function(e){r.playbackRate=e},Og:function(e){r.currentTime+=e}}),wc(e,r,t),function(e,t){t.lcevc.enabled?(cc(e),null==e.L&&(e.L=new ls(e.h,e.gg,t.lcevc),e.I&&(e.I.da=e.L))):cc(e)}(e,e.g),e.Gb=e.g.preferredTextLanguage,e.sd=e.g.preferredTextRole,e.rd=e.g.preferForcedSubs,ed(e.i.presentationTimeline,e.g.playRangeStart,e.g.playRangeEnd),e.o.init((function(t,n,i){e.i&&e.j&&t!=e.j.j&&Vc(e,t,!0,void 0!==n&&n,void 0===i?0:i)})),e.o.setMediaElement(r),e.o.setCmsdManager(e.da),e.j=function(e){return new Pu(e.i,{hd:function(){return e.F?e.F.Dd():0},getBandwidthEstimate:function(){return e.o.getBandwidthEstimate()},ib:function(){return e.ib()},ca:e.I,Nb:e.G,onError:function(t){return Jc(e,t)},onEvent:function(t){return e.dispatchEvent(t)},Ef:function(t,n){var i=t.startTime;t=t.endTime;var r=n.type;if(n=n.codecs.includes(","),r!=yi){if(e.F){e.F.Pg();var a=vs(e.I,r);!e.U()&&e.h.paused&&null!=a&&0<a&&e.F.Dd()<a&&e.F.Ie(a)}Ac(e)}i=(new Map).set("start",i).set("end",t).set("contentType",r).set("isMuxed",n),e.dispatchEvent(dc("segmentappended",i))},Ei:function(t,n){(n=n.Qc)&&e.ac&&function(e,t,n){var i=function(e,t){var n=e.g.get(t);return n||(n={yd:[],Se:null,contentType:t},e.g.set(t,n)),n}(e,t.contentType);!function(e,t){if((e=e.h()[t.contentType])&&0<e.length){var n=e[0].start,i=e[e.length-1].end,r=t.yd;t.yd=r.filter((function(e,t){return!(e.position<=n&&t+1<r.length&&r[t+1].position<=n||e.position>=i)}))}else t.yd=[]}(e,i),e={Qc:t,position:n},0<=(t=(i=i.yd).findIndex((function(e){return e.position>=n})))?i.splice(t,i[t].position==n?1:0,e):i.push(e)}(e.ac,n,t)},mg:function(t,n){var i=e.C;if(i.h.parseInbandPsshEnabled&&!i.F&&["audio","video"].includes(t)){t=new Pa(ge(n)),n=0;for(var r=l(t.data),a=r.next();!a.done;a=r.next())n+=a.value.length;if(0==n)i=Promise.resolve();else{for(n=new Uint8Array(n),r=0,a=(t=l(t.data)).next();!a.done;a=t.next())a=a.value,n.set(a,r),r+=a.length;Ba(i,"cenc",n),i=i.m}}else i=Promise.resolve();return i},disableStream:function(t,n){return e.disableStream(t,n)}})}(e),e.j.configure(e.g.streaming),e.m=od,e.dispatchEvent(dc("streaming")),a=n;case 2:for((s=e.j.j)||a||(a=Bc(e)?e.o.chooseVariant():null),u=[],c=l([(o=s||a).video,o.audio]),d=c.next();!d.done;d=c.next())(h=d.value)&&!h.segmentIndex&&u.push(h.createSegmentIndex());if(!(0<u.length)){I.u(4);break}return w(I,Promise.all(u),4);case 4:if(!o||0!=o.disabledUntilTime){I.u(2);break}if(e.H&&e.H.onInitialVariantChosen&&e.H.onInitialVariantChosen(o),e.i.isLowLatency&&!e.g.streaming.lowLatencyMode&&W("Low-latency live stream detected, but low-latency streaming mode is not enabled in Shaka Player. Set streaming.lowLatencyMode configuration to true, and see https://bit.ly/3clctcj for details."),e.O&&function(e,t){e.j=t,e.j?e.i==$l?e.i=Ql:e.i==Zl&&(e.i=ec):e.i==Ql?e.i=$l:e.i==ec&&(e.i=Zl)}(e.O,e.i.isLowLatency&&e.g.streaming.lowLatencyMode),ed(e.i.presentationTimeline,e.g.playRangeStart,e.g.playRangeEnd),function(e,t,n){e.l.presentationTimeline.U()||(e.O=t,e.M=n)}(e.j,e.g.playRangeStart,e.g.playRangeEnd),f=function(t){e.F=function(e,t){return new Ys(e.h,e.i,e.g.streaming,t,(function(){e.Hb&&su(e.Hb,!0),e.j&&e.j.Xc(),e.M&&Ac(e)}),(function(t){return e.dispatchEvent(t)}))}(e,t),e.Hb=function(e,t){(t=new bl(e.bc,e.U()||0<t)).addEventListener("enter",(function(t){$c(e,"timelineregionenter",t.region)})),t.addEventListener("exit",(function(t){$c(e,"timelineregionexit",t.region)})),t.addEventListener("skip",(function(t){var n=t.region;t.seeking||($c(e,"timelineregionenter",n),$c(e,"timelineregionexit",n))}));var n=new ou(e.h);return n.g.add(t),e.ac&&n.g.add(e.ac),n}(e,t),xc(e,r,Math.max(e.i.minBufferTime,e.g.streaming.rebufferingGoal))},e.g.streaming.startAtSegmentBoundary||(null==(p=e.ga)&&e.i.startTime&&(p=e.i.startTime),f(p)),s){I.u(7);break}if(!e.g.streaming.startAtSegmentBoundary){I.u(8);break}return g=e.i.presentationTimeline,m=e.ga||e.h.currentTime,null==e.ga&&e.i.startTime&&(m=e.i.startTime),v=g.Kb(),y=g.Bb(),m<v?m=v:m>y&&(m=y),w(I,function(e,t){var n,i,r,a,o;return P((function(s){return 1==s.g?(n=e.audio,i=e.video,r=function(e,t){var n,i,r;return P((function(a){return 1==a.g?e?w(a,e.createSegmentIndex(),2):a.return(null):(i=(n=e.segmentIndex.Jb(t))?n.next().value:null)?(r=i.startTime,a.return(r)):a.return(null)}))},w(s,r(n,t),2)):3!=s.g?(a=s.h,w(s,r(i,t),3)):null!=(o=s.h)&&null!=a?s.return(Math.max(o,a)):null!=o?s.return(o):null!=a?s.return(a):s.return(t)}))}(a,m),9);case 9:b=I.h,f(b);case 8:Vc(e,a,!0,!1,0);case 7:return e.F.ready(),e.qc().find((function(e){return e.active}))||((S=wr(e.i.textStreams,e.Gb,e.sd,e.rd)[0]||null)&&du(e.A.h,S,!0),a&&(S?(function(e,t,n){if(0==e.g.autoShowText)return!1;if(1==e.g.autoShowText)return!0;var i=Yi(e.g.preferredTextLanguage);return n=Yi(n.language),2==e.g.autoShowText?qi(n,i):3==e.g.autoShowText?!!t&&(e=Yi(t.language),qi(n,i)&&!qi(e,n)):(W("Invalid autoShowText setting!"),!1)}(e,a.audio,S)&&(e.ja=!0),e.ja&&e.B.setTextVisibility(!0),qc(e)):e.ja=!1),S&&(e.g.streaming.alwaysStreamText||e.vf())&&(ju(e.j,S),Wc(e))),w(I,e.j.start(i),10);case 10:e.g.abr.enabled&&(e.o.enable(),zc(e)),Gc(e),Bc(e),e.i.variants.some((function(e){return e.primary})),((x=e.U())&&(e.g.streaming.liveSync&&e.g.streaming.liveSync.enabled||e.i.serviceDescription||e.g.streaming.liveSync.panicMode)||e.g.streaming.vodDynamicPlaybackRate)&&(A=function(){return Uc(e)},e.l.D(r,"timeupdate",A)),x||(E=function(){return _c(e)},e.l.D(r,"timeupdate",E),_c(e),e.i.nextUrl&&(0<e.g.streaming.preloadNextUrlWindow&&(k=function(){var t;return P((function(n){if(1==n.g)return t=e.h.duration-e.h.currentTime,!isNaN(t)&&t<=e.g.streaming.preloadNextUrlWindow?(e.l.cb(r,"timeupdate",k),w(n,e.preload(e.i.nextUrl),4)):n.u(0);e.na=n.h,T(n)}))},e.l.D(r,"timeupdate",k)),e.l.D(r,"ended",(function(){e.load(e.na||e.i.nextUrl)})))),e.s&&e.s.onManifestUpdated(x),e.Ba=!0,T(I)}}))}(y,h,m,g),0)}))}),"loadInner_"),20);case 20:!function(e){if(e.I)for(var t=l(e.I),n=t.next();!n.done;n=t.next())(n=n.value)();e.I=null}(r),y.Ka&&et()&&Pi(y.Ka)&&function(t,n,i){t.g&&e.ManagedMediaSource&&t.l&&(t.B&&t.g.removeChild(t.B),t.B=Io(n,i),t.g.appendChild(t.B),t.g.disableRemotePlayback=!1)}(y.I,y.Y,y.Ka),b.u(14);break;case 21:return w(b,u((function(){return P((function(e){return w(e,function(e,t,n){var i,r,a,o,s,u,c,d,h,f,p,g;return P((function(m){switch(m.g){case 1:if(hc(e,"src-equals"),i=e.h,e.F=new Ws(i),r=!1,e.qd.push((function(){r=!0})),null!=e.ga&&e.F.Ie(e.ga),e.K=new ru({Pd:function(){return i.playbackRate},oc:function(){return i.defaultPlaybackRate},Vf:function(e){i.playbackRate=e},Og:function(e){i.currentTime+=e}}),a=e.g.streaming.rebufferingGoal,xc(e,i,a),i.textTracks&&(yc(e),o=function(){var t=Mc(e).find((function(e){return"disabled"!==e.mode}));t&&(t.mode="showing")},s=function(){var t=Mc(e).find((function(e){return"disabled"!==e.mode}));t&&(t.mode="hidden")},e.l.D(i,"enterpictureinpicture",(function(){return o()})),e.l.D(i,"leavepictureinpicture",(function(){return s()})),i.remote?(e.l.D(i.remote,"connect",(function(){return s()})),e.l.D(i.remote,"connecting",(function(){return s()})),e.l.D(i.remote,"disconnect",(function(){return s()}))):"webkitCurrentPlaybackTargetIsWireless"in i&&e.l.D(i,"webkitcurrentplaybacktargetiswirelesschanged",(function(){return s()})),(u=i).webkitSupportsFullscreen&&e.l.D(u,"webkitpresentationmodechanged",(function(){"inline"!=u.webkitPresentationMode?o():s()}))),wc(e,i,t),c=function(e,t,n){try{if(!e.g.enabled)return t;var i=Hl(e);e:{switch(n.toLowerCase()){case"audio/mp4":case"audio/webm":case"audio/ogg":case"audio/mpeg":case"audio/aac":case"audio/flac":case"audio/wav":var r=zl;break e;case"video/webm":case"video/mp4":case"video/mpeg":case"video/mp2t":r=Yl;break e;case"application/x-mpegurl":case"application/vnd.apple.mpegurl":case"application/dash+xml":case"video/vnd.mpeg.dash.mpd":case"application/vnd.ms-sstr+xml":r="m";break e}r=void 0}return i.ot=r,i.su=!0,ql(t,Xl(i))}catch(e){return Y("CMCD_SRC_ERROR","Could not generate src CMCD data.",e),t}}(e.O,e.Y,n),!c.includes("#t=")&&(0<e.g.playRangeStart||isFinite(e.g.playRangeEnd))&&(c+="#t=",0<e.g.playRangeStart&&(c+=e.g.playRangeStart),isFinite(e.g.playRangeEnd)&&(c+=","+e.g.playRangeEnd)),!e.I){m.u(2);break}return w(m,e.I.destroy(),3);case 3:e.I=null;case 2:return Mo(i),i.src=c,(Ke()||qe())&&i.load(),"none"!=i.preload&&!i.autoplay&&Pi(n)&&et()&&i.load(),e.m=sd,e.dispatchEvent(dc("streaming")),d=new Gr,Bs(i,HTMLMediaElement.HAVE_METADATA,e.l,(function(){e.F.ready(),d.resolve()})),Bs(i,HTMLMediaElement.HAVE_CURRENT_DATA,e.l,(function(){var t,n,a,o,s;return P((function(u){if(1==u.g)return function(e){var t=e.g.preferredAudioLanguage;""!=t&&e.$g(t,e.g.preferredVariantRole)}(e),(t=Mc(e)).find((function(e){return"disabled"!=e.mode}))?(0<t.length&&(e.ja=!0,e.B.setTextVisibility(!0)),u.u(2)):w(u,new Promise((function(t){e.l.pa(i.textTracks,"change",t),new Be(t).$(1)})),2);if(r)return u.return();for(n=!1,a=l(t),o=a.next();!o.done;o=a.next())"disabled"!==(s=o.value).mode&&(n?(s.mode="disabled",W("Found more than one enabled text track, disabling it",s)):(Ic(e,s),n=!0));!function(e){var t=e.g.preferredTextLanguage;""!=t&&e.Pf(t,e.g.preferredTextRole,e.g.preferForcedSubs)}(e),T(u)}))})),i.error?d.reject(Zc(e)):"none"==i.preload&&(W('With <video preload="none">, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way, and we cannot provide track info yet. Please do not use preload="none" with Shaka Player.'),d.resolve()),e.l.pa(i,"error",(function(){d.reject(Zc(e))})),w(m,Ki(e.g.streaming.loadTimeout,d),4);case 4:((h=e.U())&&(e.g.streaming.liveSync&&e.g.streaming.liveSync.enabled||e.g.streaming.liveSync.panicMode)||e.g.streaming.vodDynamicPlaybackRate)&&(f=function(){return Uc(e)},e.l.D(i,"timeupdate",f)),h||(p=function(){return _c(e)},e.l.D(i,"timeupdate",p),_c(e)),e.s&&(e.s.onManifestUpdated(h),h&&(g=e.Qb().end,e.l.D(i,"progress",(function(){var t=e.Qb().end;g!=t&&(e.s.onManifestUpdated(e.U()),g=t)})))),e.Ba=!0,T(m)}}))}(y,h,i),0)}))}),"srcEqualsInner_"),14);case 14:y.dispatchEvent(dc("loaded"));case 6:if(k(b),!r){b.u(23);break}return w(b,r.destroy(),23);case 23:y.na=null,I(b,0);break;case 5:if(!(v=E(b))||7e3==v.code){b.u(25);break}return w(b,y.ic(!1),25);case 25:throw v}}))},i.ej=function(e,t){e=void 0===e||e,t=void 0!==t&&t;var n,i=this;return P((function(r){return 1==r.g?w(r,pc(i),2):3!=r.g?(n=r.h,w(r,i.ic(e,t),3)):r.return(n)}))},i.tg=function(e,t){e=void 0!==e&&e,t=void 0!==t&&t;var n,i=this;return P((function(r){return 1==r.g?w(r,pc(i,t),2):3!=r.g?(n=r.h,w(r,i.detach(e),3)):r.return(n)}))},i.preload=function(e,t,n){t=void 0===t?null:t;var i,r=this;return P((function(a){return 1==a.g?w(a,gc(r,e,t,n),2):((i=a.h)?i.start():Jc(r,new De(2,7,7005)),a.return(i))}))},i.Te=function(){var e,t,n,i,r=this;return P((function(a){for(e=[],t=l(r.le),n=t.next();!n.done;n=t.next())(i=n.value).s||e.push(i.destroy());return r.le=[],w(a,Promise.all(e),0)}))},i.Ni=function(){for(var e=this.Z;e.g;)e.release()},i.Gc=function(e){return new Na(e)},i.configure=function(e,t){if(2==arguments.length&&"string"==typeof e&&(e=el(e,t)),e.streaming&&"forceTransmuxTS"in e.streaming&&(oe("streaming.forceTransmuxTS configuration","Please Use mediaSource.forceTransmux instead."),e.mediaSource.mediaSource=e.streaming.forceTransmuxTS,delete e.streaming.forceTransmuxTS),e.streaming&&"forceTransmux"in e.streaming&&(oe("streaming.forceTransmux configuration","Please Use mediaSource.forceTransmux instead."),e.mediaSource.mediaSource=e.streaming.forceTransmux,delete e.streaming.forceTransmux),e.streaming&&"useNativeHlsOnSafari"in e.streaming&&(oe("streaming.useNativeHlsOnSafari configuration","Please Use streaming.useNativeHlsForFairPlay or streaming.preferNativeHls instead."),e.streaming.preferNativeHls=e.streaming.useNativeHlsOnSafari&&Ye(),delete e.streaming.useNativeHlsOnSafari),e.streaming&&"boolean"==typeof e.streaming.liveSync){oe("streaming.liveSync","Please Use streaming.liveSync.enabled instead.");var n=e.streaming.liveSync;e.streaming.liveSync={},e.streaming.liveSync.enabled=n}if(e.streaming&&(!e.streaming.liveSync||!("targetLatency"in e.streaming.liveSync))&&("liveSyncMinLatency"in e.streaming||"liveSyncMaxLatency"in e.streaming)){n=e.streaming.liveSyncMinLatency||0;var i=Math.abs((e.streaming.liveSyncMaxLatency||1)-n)/2;e.streaming.liveSync=e.streaming.liveSync||{},e.streaming.liveSync.targetLatency=n+i,e.streaming.liveSync.targetLatencyTolerance=i}if(e.streaming&&"liveSyncMaxLatency"in e.streaming&&(oe("streaming.liveSyncMaxLatency","Please Use streaming.liveSync.targetLatency and streaming.liveSync.targetLatencyTolerance instead. Or, set the values in your DASH manifest"),delete e.streaming.liveSyncMaxLatency),e.streaming&&"liveSyncMinLatency"in e.streaming&&(oe("streaming.liveSyncMinLatency","Please Use streaming.liveSync.targetLatency and streaming.liveSync.targetLatencyTolerance instead. Or, set the values in your DASH manifest"),delete e.streaming.liveSyncMinLatency),e.streaming&&"liveSyncTargetLatency"in e.streaming&&(oe("streaming.liveSyncTargetLatency","Please Use streaming.liveSync.targetLatency instead."),e.streaming.liveSync=e.streaming.liveSync||{},e.streaming.liveSync.targetLatency=e.streaming.liveSyncTargetLatency,delete e.streaming.liveSyncTargetLatency),e.streaming&&"liveSyncTargetLatencyTolerance"in e.streaming&&(oe("streaming.liveSyncTargetLatencyTolerance","Please Use streaming.liveSync.targetLatencyTolerance instead."),e.streaming.liveSync=e.streaming.liveSync||{},e.streaming.liveSync.targetLatencyTolerance=e.streaming.liveSyncTargetLatencyTolerance,delete e.streaming.liveSyncTargetLatencyTolerance),e.streaming&&"liveSyncPlaybackRate"in e.streaming&&(oe("streaming.liveSyncPlaybackRate","Please Use streaming.liveSync.maxPlaybackRate instead."),e.streaming.liveSync=e.streaming.liveSync||{},e.streaming.liveSync.maxPlaybackRate=e.streaming.liveSyncPlaybackRate,delete e.streaming.liveSyncPlaybackRate),e.streaming&&"liveSyncMinPlaybackRate"in e.streaming&&(oe("streaming.liveSyncMinPlaybackRate","Please Use streaming.liveSync.minPlaybackRate instead."),e.streaming.liveSync=e.streaming.liveSync||{},e.streaming.liveSync.minPlaybackRate=e.streaming.liveSyncMinPlaybackRate,delete e.streaming.liveSyncMinPlaybackRate),e.streaming&&"liveSyncPanicMode"in e.streaming&&(oe("streaming.liveSyncPanicMode","Please Use streaming.liveSync.panicMode instead."),e.streaming.liveSync=e.streaming.liveSync||{},e.streaming.liveSync.panicMode=e.streaming.liveSyncPanicMode,delete e.streaming.liveSyncPanicMode),e.streaming&&"liveSyncPanicThreshold"in e.streaming&&(oe("streaming.liveSyncPanicThreshold","Please Use streaming.liveSync.panicThreshold instead."),e.streaming.liveSync=e.streaming.liveSync||{},e.streaming.liveSync.panicThreshold=e.streaming.liveSyncPanicThreshold,delete e.streaming.liveSyncPanicThreshold),e.mediaSource&&"sourceBufferExtraFeatures"in e.mediaSource){oe("mediaSource.sourceBufferExtraFeatures configuration","Please Use mediaSource.addExtraFeaturesToSourceBuffer() instead.");var r=e.mediaSource.sourceBufferExtraFeatures;e.mediaSource.addExtraFeaturesToSourceBuffer=function(){return r},delete e.mediaSource.sourceBufferExtraFeatures}return e.manifest&&e.manifest.hls&&"useSafariBehaviorForLive"in e.manifest.hls&&(oe("manifest.hls.useSafariBehaviorForLive configuration","Please Use liveSync config to keep on live Edge instead."),delete e.manifest.hls.useSafariBehaviorForLive),e.streaming&&"parsePrftBox"in e.streaming&&(oe("streaming.parsePrftBox configuration","Now fired without needing a configuration."),delete e.streaming.parsePrftBox),e.manifest&&e.manifest.dash&&"enableAudioGroups"in e.manifest.dash&&(oe("manifest.dash.enableAudioGroups configuration","It is now enabled by default and cannot be disabled."),delete e.manifest.dash.enableAudioGroups),e.streaming&&"dispatchAllEmsgBoxes"in e.streaming&&(oe("streaming.dispatchAllEmsgBoxes configuration","Please Use mediaSource.dispatchAllEmsgBoxes instead."),e.mediaSource.dispatchAllEmsgBoxes=e.streaming.dispatchAllEmsgBoxes,delete e.streaming.dispatchAllEmsgBoxes),e.streaming&&e.streaming.lowLatencyMode&&(null==e.streaming.inaccurateManifestTolerance&&(e.streaming.inaccurateManifestTolerance=0),null==e.streaming.rebufferingGoal&&(e.streaming.rebufferingGoal=.01),null==e.streaming.segmentPrefetchLimit&&(e.streaming.segmentPrefetchLimit=2),null==e.streaming.updateIntervalSeconds&&(e.streaming.updateIntervalSeconds=.1),null==e.streaming.maxDisabledTime&&(e.streaming.maxDisabledTime=1),null==e.streaming.retryParameters&&(e.streaming.retryParameters={}),null==e.streaming.retryParameters.baseDelay&&(e.streaming.retryParameters.baseDelay=100),null==e.manifest&&(e.manifest={}),null==e.manifest.dash&&(e.manifest.dash={}),null==e.manifest.dash.autoCorrectDrift&&(e.manifest.dash.autoCorrectDrift=!1),null==e.manifest.retryParameters&&(e.manifest.retryParameters={}),null==e.manifest.retryParameters.baseDelay&&(e.manifest.retryParameters.baseDelay=100),null==e.drm&&(e.drm={}),null==e.drm.retryParameters&&(e.drm.retryParameters={}),null==e.drm.retryParameters.baseDelay&&(e.drm.retryParameters.baseDelay=100)),n=cl(this.g,e,Nc(this)),Ec(this),n},i.getConfiguration=function(){var e=Nc(this);return cl(e,this.g,Nc(this)),e},i.Dg=function(){return cl(Nc(this),this.g,Nc(this)),nl(this.g,Nc(this))},i.yg=function(){if(this.h){var e=this.h.buffered.length;e=e?this.h.buffered.end(e-1):0;var t=this.getConfiguration().streaming.bufferingGoal;if(e>=(t=Math.min(this.h.currentTime+t,this.Qb().end)))return 1;if(!(e<=this.h.currentTime)&&e<t)return(e-this.h.currentTime)/(t-this.h.currentTime)}return 0},i.Ri=function(){for(var e in this.g)delete this.g[e];cl(this.g,Nc(this),Nc(this)),Ec(this)},i.Bg=function(){return this.m},i.lf=function(){return this.i?this.i.type:null},i.Yh=function(){return this.h},i.Ab=function(){return this.G},i.Mc=function(){return this.Y},i.xg=function(){return this.s?this.s:null},i.U=function(){return this.i&&!this.Ia()?this.i.presentationTimeline.U():!(!this.h||!this.h.src)&&1/0==this.h.duration},i.uc=function(){return!!this.i&&this.i.presentationTimeline.uc()},i.oi=function(){if(this.i&&!this.Ia()){var e=this.i.variants;return!!e.length&&!e[0].video}return!(!this.h||!this.h.src)&&(this.h.videoTracks?0==this.h.videoTracks.length:0==this.h.videoHeight)},i.Qb=function(){if(this.i&&!this.Ia()){if(!this.Ba&&"HLS"==this.i.type)return{start:0,end:0};var e=this.i.presentationTimeline;return{start:e.Kb(),end:e.Bb()}}return this.h&&this.h.src&&(e=this.h.seekable).length?{start:e.start(0),end:e.end(e.length-1)}:{start:0,end:0}},i.li=function(){this.U()&&(this.h.currentTime=this.Qb().end)},i.pi=function(){return this.Ba},i.keySystem=function(){var e=this.drmInfo();return e?e.keySystem:""},i.drmInfo=function(){return this.C?this.C.g:null},i.gd=function(){return this.C?this.C.gd():1/0},i.jf=function(){return this.C?this.C.jf():[]},i.Od=function(){return this.C?this.C.Od():{}},i.tf=function(){return!!this.M&&this.M.g==Br},i.ib=function(){return this.h?this.K?this.K.i:1:0},i.Bd=function(e,t){var n=this;t=void 0===t||t,0==e?W("A trick play rate of 0 is unsupported!"):(this.Ga.Va(),this.h.paused&&this.h.play(),this.K.set(e),this.m==od&&(this.o.playbackRateChanged(e),Lu(this.j,t&&1<Math.abs(e))),this.U()&&this.Ga.D(this.h,"timeupdate",(function(){var t=n.h.currentTime,i=n.Qb(),r=n.g.streaming.safeSeekOffset;0<e?Math.floor(t)>=Math.floor(i.end)&&n.$c():Math.floor(t)<=Math.floor(i.start+r)&&n.$c()})))},i.$c=function(){var e=this.K.oc();this.m==sd&&this.K.set(e),this.m==od&&(this.K.set(e),this.o.playbackRateChanged(e),Lu(this.j,!1)),this.Ga.Va()},i.rc=function(){if(this.i&&!this.Ia()){for(var e=this.j?this.j.j:null,t=[],n=0,i=l(this.i.variants),r=i.next();!r.done;r=i.next())if(yr(r=r.value)){var a=dr(r);a.active=r==e,a.active||1==n||null==e||r.video!=e.video||r.audio!=e.audio||(a.active=!0),a.active&&n++,t.push(a)}return t}return this.h&&this.h.audioTracks?Array.from(this.h.audioTracks).map((function(e){return mr(e)})):[]},i.qc=function(){if(this.i&&!this.Ia()){for(var e=this.j?this.j.s:null,t=[],n=l(this.i.textStreams),i=n.next();!i.done;i=n.next()){var r=hr(i=i.value);r.active=i==e,t.push(r)}return t}return this.h&&this.h.src&&this.h.textTracks?Mc(this).map((function(e){return gr(e)})):[]},i.Sh=function(){var e=this.ud;return this.i&&(e=this.i.imageStreams),e.map((function(e){return fr(e)}))},i.Jh=function(e){var t,n,i,r,a=this;return P((function(o){return 1==o.g?a.m!=od&&a.m!=sd?o.return(null):(t=a.ud,a.i&&(t=a.i.imageStreams),(n=t.find((function(t){return t.id==e})))?n.segmentIndex?o.u(2):w(o,n.createSegmentIndex(),2):o.return(null)):4!=o.g?(i=[],n.segmentIndex.yb((function(t){var r=kc(t.tilesLayout||n.tilesLayout);if(r){r=r.rows*r.lc;for(var o=t.j-t.startTime,s=0;s<r;s++)i.push(a.Fg(e,t.startTime+o*s/r))}})),w(o,Promise.all(i),4)):(r=o.h,o.return(r.filter((function(e){return e}))))}))},i.Fg=function(e,t){var n,i,r,a,o,s,u,l,c,d,h,f,p,g,m,v,y,b,T=this;return P((function(S){return 1==S.g?T.m!=od&&T.m!=sd?S.return(null):(n=T.ud,T.i&&(n=T.i.imageStreams),(i=n.find((function(t){return t.id==e})))?i.segmentIndex?S.u(2):w(S,i.createSegmentIndex(),2):S.return(null)):null==(r=i.segmentIndex.find(t))?S.return(null):(a=i.segmentIndex.get(r),(o=kc(a.tilesLayout||i.tilesLayout))?(s=i.width||0,u=i.height||0,l=s/o.lc,c=u/o.rows,d=o.lc*o.rows,h=a.j-a.startTime,f=a.A||h/d,p=a.startTime,m=g=0,1<d&&(v=Math.floor((t-a.startTime)/f),p=a.startTime+v*f,g=v%o.lc*l,m=Math.floor(v/o.lc)*c),y=!1,(b=a.thumbnailSprite)&&(y=!0,c=b.height,g=b.positionX,m=b.positionY,l=b.width),S.return({segment:a,imageHeight:u,imageWidth:s,height:c,positionX:g,positionY:m,startTime:p,duration:f,uris:a.N(),width:l,sprite:y})):S.return(null))}))},i.ah=function(e){var t,n=this;this.i&&this.F&&((t=n.i.textStreams.find((function(t){return t.id==e.id})))&&t!=n.j.s&&(du(n.A.h,t,!1),ju(n.j,t),Xc(n),Wc(n),n.Gb=t.language),!this.Ia())||function(){if(n.h&&n.h.textTracks){var t=Mc(n),i=t.find((function(e){return"disabled"!==e.mode}));(t=t.find((function(t){return pr(t)===e.id})))&&(i!==t&&(i&&(i.mode="disabled",n.l.cb(i,"cuechange"),n.B.remove(0,1/0)),t&&Ic(n,t)),Xc(n),Wc(n))}}()},i.Qf=function(e,t,n){var i=this;t=void 0!==t&&t,n=void 0===n?0:n,this.i&&this.F&&(function(){var r=i.i.variants.find((function(t){return t.id==e.id}));if(r&&yr(r)){var a=i.j.j;i.g.abr.enabled&&(a.video!=r.video||a.audio&&r.audio&&a.audio.language==r.audio.language&&a.audio.channelsCount==r.audio.channelsCount)&&W("Changing tracks while abr manager is enabled will likely result in the selected track being overriden. Consider disabling abr before calling selectVariantTrack()."),i.Ia()?Vc(i,r,!1,!1,0):Vc(i,r,!1,t||!1,n||0),i.xa=new jr(r,i.g.mediaSource.codecSwitchingStrategy),Bc(i)}}(),!this.Ia())||function(){if(i.h&&i.h.audioTracks)for(var t=Array.from(i.h.audioTracks),n=(t=l(t)).next();!n.done;n=t.next())if(pr(n=n.value)==e.id){Hc(i,n);break}}()},i.Lh=function(){return id(this.rc())},i.ei=function(){return id(this.qc())},i.Kh=function(){return Array.from(nd(this.rc()))},i.di=function(){return Array.from(nd(this.qc()))},i.$g=function(e,t,n,i,r){var a=this;n=void 0===n?0:n,i=void 0===i?0:i,r=void 0===r?"":r,this.i&&this.F&&(function(){function o(e,t){return e.video||t.video?e.video&&t.video?Math.abs((e.video.height||0)-(t.video.height||0))+Math.abs((e.video.width||0)-(t.video.width||0)):1/0:0}a.xa=new Or(e,t||"",n||0,"",!1,"","","",a.g.mediaSource.codecSwitchingStrategy,r||"");for(var s=a.j.j,u=a.xa.create(a.i.variants),c=null,d=(u=l(u.values())).next();!d.done;d=u.next())yr(d=d.value)&&(!c||o(c,s)>o(d,s))&&(c=d);c!=s&&(c?(s=dr(c),a.Qf(s,!0,i||0)):Fc(a))}(),!this.Ia())||function(){if(a.h&&a.h.audioTracks){var n=wr(a.rc(),e,t||"",!1)[0];n&&a.Qf(n)}}()},i.Pf=function(e,t,n){var i,r=this;n=void 0!==n&&n,this.i&&this.F&&(function(){r.Gb=e,r.sd=t||"",r.rd=n||!1;var i=wr(r.i.textStreams,r.Gb,r.sd,r.rd)[0]||null;i&&i!=r.j.s&&(du(r.A.h,i,!1),r.g.streaming.alwaysStreamText||r.vf())&&(ju(r.j,i),Xc(r),Wc(r))}(),!this.Ia())||(i=wr(r.qc(),e,t||"",n||!1)[0])&&r.ah(i)},i.Xi=function(e,t,n){var i=this;t=void 0===t||t,n=void 0===n?0:n,this.i&&this.F&&(function(){for(var r=null,a=l(i.i.variants),o=a.next();!o.done;o=a.next())if((o=o.value).audio.label==e){r=o;break}null!=r&&(i.xa=new Or(r.language,"",0,"",!1,"",e,"",i.g.mediaSource.codecSwitchingStrategy,""),Fc(i,t,n))}(),!this.Ia())||function(){if(i.h&&i.h.audioTracks){for(var t=Array.from(i.h.audioTracks),n=null,r=(t=l(t)).next();!r.done;r=t.next())(r=r.value).label==e&&(n=r);n&&Hc(i,n)}}()},i.vf=function(){var e=this.ja;return this.B?this.B.isTextVisible():e},i.zg=function(){return this.h&&this.h.currentSrc&&this.h.textTracks?Cc(this).map((function(e){return gr(e)})):[]},i.Nh=function(e){if(!this.h||!this.h.currentSrc||!this.h.textTracks)return[];var t=Yi(e),n=Cc(this).filter((function(e){return Yi(e.language)==t}));if(!n||!n.length)return[];e=[];for(var i=new Set,r=(n=l(n)).next();!r.done;r=n.next())if((r=r.value)&&r.cues)for(var a=(r=l(r.cues)).next();!a.done;a=r.next()){var o=a.value;(a=o.id)&&""!=a||(a=o.startTime+"-"+o.endTime+"-"+o.text),o={id:a,title:o.text,startTime:o.startTime,endTime:o.endTime},i.has(a)||(e.push(o),i.add(a))}return e},i.hh=function(e){e=!!e,this.ja!=e&&(this.ja=e,this.m==od?(this.B.setTextVisibility(e),this.g.streaming.alwaysStreamText||(e?this.j.s||0<(e=wr(this.i.textStreams,this.Gb,this.sd,this.rd)).length&&(ju(this.j,e[0]),Xc(this),Wc(this)):function(e){var t=e.i.get(yi);t&&(Wu(t),Yu(t).catch((function(){})),e.C=e.i.get(yi),e.i.delete(yi)),e.s=null}(this.j))):this.h&&this.h.src&&this.h.textTracks&&this.B.setTextVisibility(e),qc(this))},i.$h=function(){if(this.F)var e=this.F.Dd();else{if(null==this.ga)return new Date;e=this.ga}if(this.i&&!this.Ia()){var t=this.i.presentationTimeline;return new Date(1e3*((t.m||t.i)+e))}return this.h&&this.h.getStartDate?(t=this.h.getStartDate(),isNaN(t.getTime())?null:new Date(t.getTime()+1e3*e)):null},i.Eg=function(){if(this.i&&!this.Ia()){var e=this.i.presentationTimeline;return new Date(1e3*(e.m||e.i))}return this.h&&this.h.getStartDate?(e=this.h.getStartDate(),isNaN(e.getTime())?null:e):null},i.Qd=function(){return this.U()&&this.i?this.i.presentationTimeline.Qd():null},i.zb=function(){if(this.m==od)return this.I.zb();var e={total:[],audio:[],video:[],text:[]};return this.m==sd&&(e.total=Eo(this.h.buffered)),e},i.getStats=function(){if(this.m!=od&&this.m!=sd)return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,corruptedFrames:NaN,stallsDetected:NaN,gapsJumped:NaN,estimatedBandwidth:NaN,completionPercent:NaN,loadLatency:NaN,manifestTimeSeconds:NaN,drmTimeSeconds:NaN,playTime:NaN,pauseTime:NaN,bufferingTime:NaN,licenseTime:NaN,liveLatency:NaN,maxSegmentDuration:NaN,manifestSizeBytes:NaN,bytesDownloaded:NaN,nonFatalErrorCount:NaN,manifestPeriodCount:NaN,manifestGapCount:NaN,switchHistory:[],stateHistory:[]};Oc(this);var e=this.h,t=e.currentTime/e.duration;if(!isNaN(t)&&!this.U()){var n=this.A;t=Math.round(100*t),n.i=isNaN(n.i)?t:Math.max(n.i,t)}if(this.F&&(this.A.S=this.F.hg(),this.A.Y=this.F.ig()),e.getVideoPlaybackQuality){n=e.getVideoPlaybackQuality(),t=this.A;var i=Number(n.totalVideoFrames);t.O=Number(n.droppedVideoFrames),t.M=i,this.A.L=Number(n.corruptedVideoFrames)}if(n=this.C&&(n=this.C).H?n.H:NaN,this.A.o=n,this.m==od){if(n=this.j.j,t=this.j.s,n){var r=(i=this.K?this.K.i:1)*n.bandwidth;t&&t.bandwidth&&(r+=i*t.bandwidth),this.A.A=r}n&&n.video&&(t=this.A,i=n.video.height||NaN,t.m=n.video.width||NaN,t.l=i),this.U()&&(n=this.Eg().valueOf()+1e3*e.currentTime,this.A.B=(Date.now()-n)/1e3),this.i&&(this.A.G=this.i.periodCount,this.A.F=this.i.gapCount,this.i.presentationTimeline&&(this.A.I=this.i.presentationTimeline.h)),n=this.o.getBandwidthEstimate(),this.A.s=n}this.m==sd&&((n=this.A).kc=isNaN(n.kc)?NaN:n.kc+NaN,n=this.A,t=e.videoHeight||NaN,n.m=e.videoWidth||NaN,n.l=t);var a=this.A;e=a.m,n=a.l,t=a.A,i=a.M,r=a.O;for(var o=a.L,s=a.Y,u=a.S,c=a.s,d=a.i,h=a.C,f=a.H,p=a.j,g=lu(a.g,"playing"),m=lu(a.g,"paused"),v=lu(a.g,"buffering"),y=a.o,b=a.B,w=a.I,T=a.Kg,S=a.kc,x=a.K,A=a.G,E=a.F,k=function(e){function t(e){return{timestamp:e.timestamp,state:e.state,duration:e.duration}}for(var n=[],i=l(e.h),r=i.next();!r.done;r=i.next())n.push(t(r.value));return e.g&&n.push(t(e.g)),n}(a.g),I=[],M=(a=l(a.h.g)).next();!M.done;M=a.next())M=M.value,I.push({timestamp:M.timestamp,id:M.id,type:M.type,fromAdaptation:M.fromAdaptation,bandwidth:M.bandwidth});return{width:e,height:n,streamBandwidth:t,decodedFrames:i,droppedFrames:r,corruptedFrames:o,stallsDetected:s,gapsJumped:u,estimatedBandwidth:c,completionPercent:d,loadLatency:h,manifestTimeSeconds:f,drmTimeSeconds:p,playTime:g,pauseTime:m,bufferingTime:v,licenseTime:y,liveLatency:b,maxSegmentDuration:w,manifestSizeBytes:T,bytesDownloaded:S,nonFatalErrorCount:x,manifestPeriodCount:A,manifestGapCount:E,stateHistory:k,switchHistory:I}},i.xh=function(e,t,n,i,r,a,o){o=void 0!==o&&o;var s,u,l,c,d,h,f,p,g,m,v=this;return P((function(y){switch(y.g){case 1:if(v.m!=od&&v.m!=sd)throw new De(1,7,7004);if("subtitles"!=n&&"captions"!=n&&W("Using a kind value different of `subtitles` or `captions` can cause unwanted issues."),i){y.u(2);break}return w(y,Dc(v,e),3);case 3:i=y.h;case 2:if(s=[],v.s&&(s=v.s.getCuePoints()),v.m!=sd){y.u(4);break}return o&&(n="forced"),w(y,Rc(v,e,t,n,i,a||"",s),5);case 5:if(u=Yi(t),l=v.qc(),c=l.find((function(e){return Yi(e.language)==u&&e.label==(a||"")&&e.kind==n})))return Gc(v),y.return(c);throw new De(1,2,2012);case 4:if(d=bi,h=v.h.duration,v.i&&(h=v.i.presentationTimeline.getDuration()),1/0==h)throw new De(1,4,4033);if(!s.length){y.u(6);break}return w(y,Pc(v,e,v.G,v.g.streaming.retryParameters),7);case 7:f=y.h,p=Lc(v,f,i,s),g=new Blob([p],{type:"text/vtt"}),e=Rs(g),i="text/vtt";case 6:if(m={id:v.fg++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:tu(0,h,[e]),mimeType:i||"",codecs:r||"",kind:n,encrypted:!1,drmInfos:[],keyIds:new Set,language:t,originalLanguage:t,label:a||null,type:d.wa,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!!o,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([xi(i||"",r||"")]),isAudioMuxedInVideo:!1},!Ui(xi(m.mimeType,m.codecs)))throw new De(2,2,2014,i);return v.i.textStreams.push(m),Gc(v),y.return(hr(m))}}))},i.yh=function(e,t){var n,i,r,a,o,s,u,c,d,h,f,p,g,m,v,y,b,T=this;return P((function(S){switch(S.g){case 1:if(T.m!=od&&T.m!=sd)throw new De(1,7,7004);if(t){S.u(2);break}return w(S,Dc(T,e),3);case 3:t=S.h;case 2:if("text/vtt"!=t)throw new De(1,2,2017,e);if(n=bi,i=T.h.duration,T.i&&(i=T.i.presentationTimeline.getDuration()),1/0==i)throw new De(1,4,4045);return w(S,Pc(T,e,T.G,T.g.streaming.retryParameters),4);case 4:if(r=S.h,!(a=Fi[t]))throw new De(2,2,2014,t);for(o=a(),s={periodStart:0,segmentStart:0,segmentEnd:i,vttOffset:0},u=ge(r),c=o.parseMedia(u,s,e,[]),d=[],h=l(c),f=h.next(),p={};!f.done;p={ze:void 0,Hc:void 0},f=h.next())p.Hc=f.value,p.ze=null,g=function(t){return function(){return null==t.ze&&(t.ze=hi([e],[t.Hc.payload])),t.ze||[]}}(p),m=new vo(p.Hc.startTime,p.Hc.endTime,g,0,null,null,0,0,1/0),p.Hc.payload.includes("#xywh")&&4===(v=p.Hc.payload.split("#xywh=")[1].split(",")).length&&m.qe({height:parseInt(v[3],10),positionX:parseInt(v[0],10),positionY:parseInt(v[1],10),width:parseInt(v[2],10)}),d.push(m);if(y=t,!d.length){S.u(5);break}return w(S,Al(d[0].N()[0],T.G,T.g.manifest.retryParameters),6);case 6:y=S.h;case 5:return b={id:T.fg++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new Zs(d),mimeType:y||"",codecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:n.He,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,tilesLayout:"1x1",accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([xi(y||"","")]),isAudioMuxedInVideo:!1},T.m==sd?T.ud.push(b):T.i.imageStreams.push(b),Gc(T),S.return(fr(b))}}))},i.wh=function(e,t,n){var i,r,a,o,s=this;return P((function(u){switch(u.g){case 1:if(s.m!=od&&s.m!=sd)throw new De(1,7,7004);if(n){u.u(2);break}return w(u,Dc(s,e),3);case 3:n=u.h;case 2:return i=[],s.s&&(i=s.s.getCuePoints()),w(u,Rc(s,e,t,"chapters",n,"",i),4);case 4:if(r=u.h,a=s.zg(),!(o=a.find((function(e){return e.language==t})))){u.u(5);break}return w(u,new Promise((function(e,t){s.l.pa(r,"load",e),s.l.pa(r,"error",(function(){t(new De(1,2,2015))}))})),6);case 6:return Gc(s),u.return(o);case 5:throw new De(1,2,2012)}}))},i.bj=function(e,t){this.fa.width=e,this.fa.height=t},i.Nf=function(e){if(this.m==od){var t=this.j;if(e=void 0===e?.1:e,t.m.g)t=!1;else if(t.A)t=!1;else{for(var n=l(t.i.values()),i=n.next();!i.done;i=n.next())!(i=i.value).ld||i.Ea||i.eb||(i.ld=!1,zu(t,i,e));t=!0}}else t=!1;return t},i.kf=function(){return W("Shaka Player's internal Manifest structure is NOT covered by semantic versioning compatibility guarantees. It may change at any time! Please consider filing a feature request for whatever you use getManifest() for."),this.i},i.Vh=function(){return this.La},i.Qh=function(){var e={video:null,audio:null,text:null};if(this.m!=od)return e;for(var t=this.j.j,n=this.h.currentTime,i=(t=l([t.video,t.audio,this.j.s])).next();!i.done;i=t.next())if((i=i.value)&&i.segmentIndex){var r=i.segmentIndex.find(n);r={codecs:(r=i.segmentIndex.get(r)).codecs||i.codecs,mimeType:r.mimeType||i.mimeType,bandwidth:r.bandwidth||i.bandwidth},"video"==i.type?(r.width=i.width,r.height=i.height,e.video=r):"audio"==i.type?e.audio=r:i.type==yi&&(e.text=r)}return e},i.kh=function(e){this.ge=e},i.disableStream=function(e,t){if(!this.g.abr.enabled||this.m===rd||!navigator.onLine||0==t||!this.i)return!1;if(this.i.variants.some((function(t){var n=t[e.type];return!(!n||n.id===e.id||t.disabledUntilTime||"audio"==e.type&&e.language!==n.language)}))){for(var n=!1,i=!1,r=l(this.i.variants),a=r.next();!a.done;a=r.next()){var o=(a=a.value)[e.type];o&&(o.id===e.id?(a.disabledUntilTime=Date.now()/1e3+t,n=!0):o.trickModeVideo&&o.trickModeVideo.id==e.id&&(i=!0))}return!(!n&&i||(this.je.Ra(1),t=this.zb().video.reduce((function(e,t){return e+t.end-t.start}),0),Fc(this,!1,t,!0,!1),0))}return!1},i.addFont=function(t,n){var i,r,a,o,s;return P((function(u){if(1==u.g)return"fonts"in document&&"FontFace"in e?w(u,document.fonts.ready,3):u.u(0);if(!("entries"in document.fonts))return u.return();for(i=function(e){for(var t=[],n=(e=e.entries()).next();!1===n.done;)t.push(n.value),n=e.next();return t},r=l(i(document.fonts)),a=r.next();!a.done;a=r.next())if((o=a.value).family==t&&"swap"==o.display)return u.return();s=new FontFace(t,"url("+n+")",{display:"swap"}),document.fonts.add(s),T(u)}))},i.Ia=function(){return!(!this.h||!this.h.remote)&&"disconnected"!=this.h.remote.state},F("shaka.Player",lc),lc.prototype.isRemotePlayback=lc.prototype.Ia,lc.prototype.addFont=lc.prototype.addFont,lc.prototype.setVideoContainer=lc.prototype.kh,lc.prototype.getFetchedPlaybackInfo=lc.prototype.Qh,lc.prototype.getManifestParserFactory=lc.prototype.Vh,lc.prototype.getManifest=lc.prototype.kf,lc.prototype.retryStreaming=lc.prototype.Nf,lc.prototype.setMaxHardwareResolution=lc.prototype.bj,lc.prototype.addChaptersTrack=lc.prototype.wh,lc.prototype.addThumbnailsTrack=lc.prototype.yh,lc.prototype.addTextTrackAsync=lc.prototype.xh,lc.prototype.getStats=lc.prototype.getStats,lc.prototype.getBufferedInfo=lc.prototype.zb,lc.prototype.getSegmentAvailabilityDuration=lc.prototype.Qd,lc.prototype.getPresentationStartTimeAsDate=lc.prototype.Eg,lc.prototype.getPlayheadTimeAsDate=lc.prototype.$h,lc.prototype.setTextTrackVisibility=lc.prototype.hh,lc.prototype.getChapters=lc.prototype.Nh,lc.prototype.getChaptersTracks=lc.prototype.zg,lc.prototype.isTextTrackVisible=lc.prototype.vf,lc.prototype.selectVariantsByLabel=lc.prototype.Xi,lc.prototype.selectTextLanguage=lc.prototype.Pf,lc.prototype.selectAudioLanguage=lc.prototype.$g,lc.prototype.getTextLanguages=lc.prototype.di,lc.prototype.getAudioLanguages=lc.prototype.Kh,lc.prototype.getTextLanguagesAndRoles=lc.prototype.ei,lc.prototype.getAudioLanguagesAndRoles=lc.prototype.Lh,lc.prototype.selectVariantTrack=lc.prototype.Qf,lc.prototype.selectTextTrack=lc.prototype.ah,lc.prototype.getThumbnails=lc.prototype.Fg,lc.prototype.getAllThumbnails=lc.prototype.Jh,lc.prototype.getImageTracks=lc.prototype.Sh,lc.prototype.getTextTracks=lc.prototype.qc,lc.prototype.getVariantTracks=lc.prototype.rc,lc.prototype.cancelTrickPlay=lc.prototype.$c,lc.prototype.trickPlay=lc.prototype.Bd,lc.prototype.getPlaybackRate=lc.prototype.ib,lc.prototype.isBuffering=lc.prototype.tf,lc.prototype.getKeyStatuses=lc.prototype.Od,lc.prototype.getActiveSessionsMetadata=lc.prototype.jf,lc.prototype.getExpiration=lc.prototype.gd,lc.prototype.drmInfo=lc.prototype.drmInfo,lc.prototype.keySystem=lc.prototype.keySystem,lc.prototype.isFullyLoaded=lc.prototype.pi,lc.prototype.goToLive=lc.prototype.li,lc.prototype.seekRange=lc.prototype.Qb,lc.prototype.isAudioOnly=lc.prototype.oi,lc.prototype.isInProgress=lc.prototype.uc,lc.prototype.isLive=lc.prototype.U,lc.prototype.getAdManager=lc.prototype.xg,lc.prototype.getAssetUri=lc.prototype.Mc,lc.prototype.getNetworkingEngine=lc.prototype.Ab,lc.prototype.getMediaElement=lc.prototype.Yh,lc.prototype.getManifestType=lc.prototype.lf,lc.prototype.getLoadMode=lc.prototype.Bg,lc.prototype.resetConfiguration=lc.prototype.Ri,lc.prototype.getBufferFullness=lc.prototype.yg,lc.prototype.getNonDefaultConfiguration=lc.prototype.Dg,lc.prototype.getConfiguration=lc.prototype.getConfiguration,lc.prototype.configure=lc.prototype.configure,lc.prototype.releaseAllMutexes=lc.prototype.Ni,lc.prototype.destroyAllPreloads=lc.prototype.Te,lc.prototype.preload=lc.prototype.preload,lc.prototype.detachAndSavePreload=lc.prototype.tg,lc.prototype.unloadAndSavePreload=lc.prototype.ej,lc.prototype.load=lc.prototype.load,lc.prototype.updateStartTime=lc.prototype.ij,lc.prototype.unload=lc.prototype.ic,lc.prototype.detach=lc.prototype.detach,lc.prototype.attachCanvas=lc.prototype.Ch,lc.prototype.attach=lc.prototype.Tb,lc.probeSupport=function(e){var t,n,i,r,a,o,s;return e=void 0===e||e,P((function(u){switch(u.g){case 1:if(t={},!e){u.u(2);break}return w(u,function(){var e,t,n,i,r,a,o,s,u,c,d,h,f,p,g,m,v,y,b,x,k,I,M,C,D,R,L;return P((function(N){if(1==N.g){for(e="org.w3.clearkey com.widevine.alpha com.widevine.alpha.experiment com.microsoft.playready com.microsoft.playready.hardware com.microsoft.playready.recommendation com.chromecast.playready com.apple.fps.1_0 com.apple.fps".split(" "),n={"com.widevine.alpha":t=["SW_SECURE_CRYPTO","SW_SECURE_DECODE","HW_SECURE_CRYPTO","HW_SECURE_DECODE","HW_SECURE_ALL"],"com.widevine.alpha.experiment":t,"com.microsoft.playready.recommendation":["150","2000","3000"]},a={videoCapabilities:i=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],audioCapabilities:r=[{contentType:'audio/mp4; codecs="mp4a.40.2"'},{contentType:'audio/webm; codecs="opus"'}],initDataTypes:["cenc","sinf","skd","keyids"]},o=[null,"cenc","cbcs","cbcs-1-9"],s=new Map,u=function(e,t){var n,i,r,a,o,u,l,c;return P((function(d){switch(d.g){case 1:return S(d,2),w(d,t.createMediaKeys(),4);case 4:A(d,3);break;case 2:return E(d),d.return();case 3:i=!!(n=t.getConfiguration().sessionTypes)&&n.includes("persistent-license"),Xe()&&(i=!1),r=t.getConfiguration().videoCapabilities,a=t.getConfiguration().audioCapabilities,o={persistentState:i,encryptionSchemes:[],videoRobustnessLevels:[],audioRobustnessLevels:[]},s.has(e)&&s.get(e)?o=s.get(e):s.set(e,o),(u=r[0].encryptionScheme)&&!o.encryptionSchemes.includes(u)&&o.encryptionSchemes.push(u),(l=r[0].robustness)&&!o.videoRobustnessLevels.includes(l)&&o.videoRobustnessLevels.push(l),(c=a[0].robustness)&&!o.audioRobustnessLevels.includes(c)&&o.audioRobustnessLevels.push(c),T(d)}}))},c=function(e,t,n,i){var r,o,s,c,d,h,f,p,g,m;return P((function(v){switch(v.g){case 1:for(S(v,2),r=kt(a),o=l(r.videoCapabilities),s=o.next();!s.done;s=o.next())(c=s.value).encryptionScheme=t,c.robustness=n;for(d=l(r.audioCapabilities),h=d.next();!h.done;h=d.next())(f=h.value).encryptionScheme=t,f.robustness=i;return(p=kt(r)).persistentState="required",p.sessionTypes=["persistent-license"],g=[p,r],w(v,Ki(1,navigator.requestMediaKeySystemAccess(e,g)),4);case 4:return m=v.h,w(v,u(e,m),5);case 5:A(v,0);break;case 2:E(v),T(v)}}))},d=function(e,t,n,a){var o,s,l;return P((function(c){switch(c.g){case 1:return S(c,2),o={type:"media-source",video:{contentType:i[0].contentType,width:640,height:480,bitrate:1,framerate:1},audio:{contentType:r[0].contentType,channels:2,bitrate:1,samplerate:1},keySystemConfiguration:{keySystem:e,video:{encryptionScheme:t,robustness:n},audio:{encryptionScheme:t,robustness:a}}},w(c,Ki(1,navigator.mediaCapabilities.decodingInfo(o)),4);case 4:return s=c.h,l=s.keySystemAccess,w(c,u(e,l),5);case 5:A(c,0);break;case 2:E(c),T(c)}}))},h=l(e),f=h.next();!f.done;f=h.next())p=f.value,s.set(p,null);for(g=[],m=l(o),v=m.next();!v.done;v=m.next())for(y=v.value,b=l(e),x=b.next();!x.done;x=b.next())"org.w3.clearkey"===(k=x.value)&&et()||(g.push(c(k,y,"","")),g.push(d(k,y,"","")));for(I=l(e),M=I.next();!M.done;M=I.next())for(C=M.value,D=l(n[C]||[]),R=D.next();!R.done;R=D.next())L=R.value,g.push(c(C,null,L,"")),g.push(c(C,null,"",L)),g.push(d(C,null,L,"")),g.push(d(C,null,"",L));return w(N,Promise.all(g),2)}return N.return(va(s))}))}(),3);case 3:t=u.h;case 2:var d={};if(Fe())for(var h in co)d[h]=!0;for(var f=(h=l(["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"])).next();!f.done;f=h.next())d[f=f.value]=Fe()?!!co[f]:Ve(f);for(n=d,d={},f=(h=l(h='video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hev1.1.6.L93.90",video/mp4; codecs="hvc1.1.6.L93.90",video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",video/mp4; codecs="av01.0.01M.08",video/mp4; codecs="dvh1.05.01",video/mp4; codecs="dvh1.20.01",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="ac-4.02.01.01",audio/mp4; codecs="opus",audio/mp4; codecs="flac",audio/mp4; codecs="dtsc",audio/mp4; codecs="dtse",audio/mp4; codecs="dtsx",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="vp09.00.10.08",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").concat(c(ji)))).next();!f.done;f=h.next()){d[f=f.value]=!!Ui(f)||(Fe()?ne(f)||!!On(f):Ve(f));var p=f.split(";")[0];d[p]=d[p]||d[f]}return i=d,w(u,st(),4);case 4:for(s in r=u.h,a={manifest:n,media:i,drm:t,hardwareResolution:r},o=ld)a[s]=o[s]();return u.return(a)}}))},lc.isBrowserSupported=function(){if(e.Promise||W("A Promise implementation or polyfill is required"),!(e.Promise&&e.Uint8Array&&Array.prototype.forEach)||rt("Trident/"))return!1;var t=et();return!(t&&9>t||!(e.MediaKeys&&e.navigator&&e.navigator.requestMediaKeySystemAccess&&e.MediaKeySystemAccess&&e.MediaKeySystemAccess.prototype.getConfiguration))&&(!!Fe()||Ve("application/x-mpegurl"))},lc.setAdManagerFactory=function(e){cd=e},lc.registerSupportPlugin=function(e,t){ld[e]=t},lc.prototype.destroy=lc.prototype.destroy;var rd=0,ad=1,od=2,sd=3;lc.LoadMode={DESTROYED:rd,NOT_LOADED:ad,MEDIA_SOURCE:od,SRC_EQUALS:sd},lc.version="v4.12.5";var ud=["4","12"];le=new function(e){this.g=e,this.i=se,this.h=ue}(new ae(Number(ud[0]),Number(ud[1])));var ld={},cd=null;function dd(){this.g=[],this.i=this.l=this.j=this.h=0}function hd(e){return e.g.length?e.g.reduce((function(e,t){return e+t}),0)/e.g.length:0}function fd(e,t,n){var i=this;this.g=e,this.h=t,this.j=n,this.i=!1,this.l=this.h.getVolume(),this.m=new Z,this.m.D(this.h,google.ima.AdEvent.Type.PAUSED,(function(){i.i=!0})),this.m.D(this.h,google.ima.AdEvent.Type.RESUMED,(function(){i.i=!1}))}function pd(){}function gd(e,t){var n=[],i=0;null!=t&&(i=t);for(var r=(e=l(Nt(e,"Ad"))).next();!r.done;r=e.next())if((r=_t(r.value,"InLine"))&&(r=_t(r,"Creatives")))for(var a=(r=l(Nt(r,"Creative"))).next();!a.done;a=r.next()){var o=_t(a.value,"Linear");if(o&&(a=null,o.attributes.skipoffset&&(a=At(o.attributes.skipoffset),isNaN(a)&&(a=null)),o=_t(o,"MediaFiles"))){var s=Nt(o,"MediaFile");for(o=s,(s=s.filter((function(e){return"streaming"==e.attributes.delivery}))).length&&(o=s),s=(o=l(o=o.sort((function(e,t){return(parseInt(t.attributes.height,10)||0)-(parseInt(e.attributes.height,10)||0)})))).next();!s.done;s=o.next()){var u=jt(s=s.value);if(u){n.push({id:null,startTime:i,endTime:null,uri:u,mimeType:s.attributes.type||null,isSkippable:null!=a,skipOffset:a,skipFor:null,canJump:!1,resumeOffset:0,playoutLimit:null,once:!0,pre:null==t,post:1/0==t,timelineRange:!1});break}}}}return n}function md(t,n,i,r,a){var o=this;this.s=t,this.i=n,this.F=!1,this.A=this.o=null,this.G=NaN,this.l=a,this.j=null,this.h=new Z,google.ima.settings.setLocale(i),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(!0),this.C=new google.ima.AdDisplayContainer(this.s,this.i),this.C.initialize(),this.m=new google.ima.AdsLoader(this.C),this.m.getSettings().setPlayerType("shaka-player"),this.m.getSettings().setPlayerVersion("v4.12.5"),this.g=null,this.B=r||new google.ima.AdsRenderingSettings,this.h.D(this.m,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,(function(t){!function(t,n){if(t.l(new Jr("ads-loaded",(new Map).set("loadTime",Date.now()/1e3-t.G))),t.o.customPlayheadTracker){var i={currentTime:t.i.currentTime};t.g=n.getAdsManager(i,t.B),t.i.muted?t.g.setVolume(0):t.g.setVolume(t.i.volume),t.h.D(t.i,"timeupdate",(function(){t.i.duration&&(i.currentTime=t.i.currentTime)})),t.h.D(t.i,"volumechange",(function(){t.j&&(t.j.setVolume(t.i.volume),t.i.muted&&t.j.setMuted(!0))}))}else t.g=n.getAdsManager(t.i,t.B);t.l(new Jr("ima-ad-manager-loaded",(new Map).set("imaAdManager",t.g)));var r=t.g.getCuePoints();if(r.length){n=[];for(var a=(r=l(r)).next();!a.done;a=r.next())n.push({start:a.value,end:null});t.l(new Jr("ad-cue-points-changed",(new Map).set("cuepoints",n)))}!function(e){function t(t,n){t=(new Map).set("originalEvent",t),e.l(new Jr(n,t))}e.h.D(e.g,google.ima.AdErrorEvent.Type.AD_ERROR,(function(t){vd(e,t)})),e.h.D(e.g,google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,(function(t){bd(e,t)})),e.h.D(e.g,google.ima.AdEvent.Type.STARTED,(function(t){bd(e,t)})),e.h.D(e.g,google.ima.AdEvent.Type.FIRST_QUARTILE,(function(e){t(e,"ad-first-quartile")})),e.h.D(e.g,google.ima.AdEvent.Type.MIDPOINT,(function(e){t(e,"ad-midpoint")})),e.h.D(e.g,google.ima.AdEvent.Type.THIRD_QUARTILE,(function(e){t(e,"ad-third-quartile")})),e.h.D(e.g,google.ima.AdEvent.Type.COMPLETE,(function(e){t(e,"ad-complete")})),e.h.D(e.g,google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,(function(t){wd(e,t)})),e.h.D(e.g,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,(function(t){wd(e,t)})),e.h.D(e.g,google.ima.AdEvent.Type.SKIPPED,(function(e){t(e,"ad-skipped")})),e.h.D(e.g,google.ima.AdEvent.Type.VOLUME_CHANGED,(function(e){t(e,"ad-volume-changed")})),e.h.D(e.g,google.ima.AdEvent.Type.VOLUME_MUTED,(function(e){t(e,"ad-muted")})),e.h.D(e.g,google.ima.AdEvent.Type.PAUSED,(function(n){e.j&&(e.j.i=!0,t(n,"ad-paused"))})),e.h.D(e.g,google.ima.AdEvent.Type.RESUMED,(function(n){e.j&&(e.j.i=!1,t(n,"ad-resumed"))})),e.h.D(e.g,google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,(function(n){e.j&&t(n,"ad-skip-state-changed")})),e.h.D(e.g,google.ima.AdEvent.Type.CLICK,(function(e){t(e,"ad-clicked")})),e.h.D(e.g,google.ima.AdEvent.Type.AD_PROGRESS,(function(e){t(e,"ad-progress")})),e.h.D(e.g,google.ima.AdEvent.Type.AD_BUFFERING,(function(e){t(e,"ad-buffering")})),e.h.D(e.g,google.ima.AdEvent.Type.IMPRESSION,(function(e){t(e,"ad-impression")})),e.h.D(e.g,google.ima.AdEvent.Type.DURATION_CHANGE,(function(e){t(e,"ad-duration-changed")})),e.h.D(e.g,google.ima.AdEvent.Type.USER_CLOSE,(function(e){t(e,"ad-closed")})),e.h.D(e.g,google.ima.AdEvent.Type.LOADED,(function(e){t(e,"ad-loaded")})),e.h.D(e.g,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,(function(e){t(e,"all-ads-completed")})),e.h.D(e.g,google.ima.AdEvent.Type.LINEAR_CHANGED,(function(e){t(e,"ad-linear-changed")})),e.h.D(e.g,google.ima.AdEvent.Type.AD_METADATA,(function(e){t(e,"ad-metadata")})),e.h.D(e.g,google.ima.AdEvent.Type.LOG,(function(e){t(e,"ad-recoverable-error")})),e.h.D(e.g,google.ima.AdEvent.Type.AD_BREAK_READY,(function(e){t(e,"ad-break-ready")})),e.h.D(e.g,google.ima.AdEvent.Type.INTERACTION,(function(e){t(e,"ad-interaction")}))}(t);try{t.g.init(t.i.offsetWidth,t.i.offsetHeight,yd(t)?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL),t.h.D(t.i,"loadeddata",(function(){t.g.resize(t.i.offsetWidth,t.i.offsetHeight,yd(t)?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)})),"ResizeObserver"in e?(t.A=new ResizeObserver((function(){t.g.resize(t.i.offsetWidth,t.i.offsetHeight,yd(t)?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)})),t.A.observe(t.i)):t.h.D(document,"fullscreenchange",(function(){t.g.resize(t.i.offsetWidth,t.i.offsetHeight,yd(t)?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)})),t.F||t.o.skipPlayDetection?t.g.start():t.h.pa(t.i,"play",(function(){t.F=!0,t.g.start()}))}catch(e){wd(t,null)}}(o,t)})),this.h.D(this.m,google.ima.AdErrorEvent.Type.AD_ERROR,(function(e){vd(o,e)})),this.h.D(this.i,"ended",(function(){o.m.contentComplete()})),this.h.pa(this.i,"play",(function(){o.F=!0}))}function vd(e,t){t.getError(),t=(new Map).set("originalEvent",t),e.l(new Jr("ad-error",t)),wd(e,null),e.l(new Jr("ad-cue-points-changed",(new Map).set("cuepoints",[])))}function yd(e){return document.fullscreenEnabled?!!document.fullscreenElement:!!(e=e.i).webkitSupportsFullscreen&&e.webkitDisplayingFullscreen}function bd(e,t){var n=t.getAd();n?(e.j=new fd(n,e.g,e.i),t.type!=google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED||e.o.supportsMultipleMediaElements||e.l(new Jr("ad-content-pause-requested")),t=(new Map).set("ad",e.j).set("sdkAdObject",n).set("originalEvent",t),e.l(new Jr("ad-started",t)),e.j.isLinear()&&(e.s.setAttribute("ad-active","true"),e.o.customPlayheadTracker||e.i.pause(),e.i.muted?((t=e.j).l=e.i.volume,t.h.setVolume(0)):e.j.setVolume(e.i.volume))):W("The IMA SDK fired a "+t.type+" event with no associated ad. Unable to play ad!")}function wd(e,t){t&&t.type==google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED&&!e.o.supportsMultipleMediaElements&&e.l(new Jr("ad-content-resume-requested")),e.l(new Jr("ad-stopped",(new Map).set("originalEvent",t))),e.j&&e.j.isLinear()&&(e.s.removeAttribute("ad-active"),e.o.customPlayheadTracker||e.i.ended||e.i.play())}function Td(e,t,n,i,r,a,o,s){this.g=e,this.i=(this.h=t)?n||0:n,this.j=i,this.o=r,this.s=a,this.l=o,this.m=s}function Sd(e,t,n,i){function r(){if(!a.H&&a.l&&!a.B.Ia()){a.l=a.h.currentTime,a.m&&!a.m.pre&&!a.m.post&&a.l<a.m.startTime&&(a.m=null);var e=Ed(a);e&&kd(a,e,1,1,Date.now())}}var a=this;if(this.M=null,this.G=e,this.B=t,this.h=n,this.F=null,this.s=!0,this.o=this.h,this.i=i,this.I=new Set,this.C=new Set,this.A=new Map,this.g=new lc,Md(this),this.K=new Z,this.j=new Z,this.H=!1,this.m=this.l=null,this.K.D(this.h,"timeupdate",(function(){if(!(a.H||a.l||a.B.Ia())){a.l=a.h.currentTime;var e=Ed(a,!0);e&&kd(a,e,1,1,Date.now())}})),this.K.D(this.h,"ended",(function(){r()})),this.L=new Be(r),"requestVideoFrameCallback"in this.h&&!it()){var o=this.h,s=function(){r(),o.requestVideoFrameCallback(s)};o.requestVideoFrameCallback(s)}else this.L.Ra(.025);this.O=new Be((function(){var e,t,n,i,r,o,s,u,c,d,h;return P((function(f){switch(f.g){case 1:if(!a.C.size||null==a.l){f.u(0);break}if((e=a.B.Bg())==rd||e==ad)return f.return();t=!1,n=Array.from(a.C),i=a.B.Qb(),r=l(n),o=r.next();case 3:if(o.done){f.u(5);break}if((s=o.value)==a.m){f.u(4);break}if(u=s.endTime||s.startTime,!(1<=i.start-u)){0<(c=s.startTime-a.l)&&10>=c&&(a.A.has(s)||a.A.set(s,a.g.preload(s.uri,null,s.mimeType||void 0))),f.u(4);break}if(!a.A.has(s)){f.u(7);break}return w(f,a.A.get(s),8);case 8:(d=f.h)&&d.destroy(),a.A.delete(s);case 7:h=JSON.stringify(s),a.I.has(h)&&a.I.delete(h),a.C.delete(s),t=!0;case 4:o=r.next(),f.u(3);break;case 5:t&&Id(a),T(f)}}))})).Ra(1)}function xd(e){if(e.G&&e.M&&!e.H){var t=e.M.supportsMultipleMediaElements,n=e.h;n.webkitSupportsFullscreen&&n.webkitDisplayingFullscreen&&(t=!1),e.s==t&&(e.s=!t,e.s?(e.o=e.h,e.F&&(e.F.parentElement&&e.G.removeChild(e.F),e.F=null)):(e.F||((t=document.createElement(e.h.tagName)).autoplay=!0,t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.width="100%",t.style.height="100%",t.style.backgroundColor="rgb(0, 0, 0)",t.setAttribute("playsinline",""),e.F=t),e.o=e.F))}}function Ad(e,t){for(var n=!1,i=(t=l(t)).next();!i.done;i=t.next()){var r=(i=i.value).id||JSON.stringify(i);if(!e.I.has(r)){if(n=!0,e.I.add(r),e.C.add(i),r=!1,i.pre&&null==e.l)r=!0;else if(0!=i.startTime||i.canJump){if(null!=e.l){var a=i.startTime-e.l;0<a&&10>=a&&(r=!0)}}else r=!0;r&&(e.A.has(i)||e.A.set(i,e.g.preload(i.uri,null,i.mimeType||void 0)))}}n&&Id(e)}function Ed(e,t,n){t=void 0!==t&&t,n=void 0===n?null:n;var i=0,r=null;if(e.C.size&&null!=e.l){var a=e.h.ended,o=Array.from(e.C).sort((function(e,t){return t.startTime-e.startTime})),s=o;for(s=t?o.filter((function(e){return e.pre})):a?o.filter((function(e){return e.post})):o.filter((function(e){return!e.pre&&!e.post})),s=(o=l(s)).next();!s.done;s=o.next()){s=s.value;var u=!1;if(t)u=s.pre;else if(a)u=s.post;else if(!s.pre&&!s.post){var c=e.l-Math.round(1e3*s.startTime)/1e3;0<c&&(1>=c||!s.canJump)&&(u=!(null==n&&e.m&&!e.m.pre&&!e.m.post&&e.m.startTime>=s.startTime))}u&&(!e.m||s.startTime>=e.m.startTime)&&(i==(n||0)?r=s:r&&!s.canJump&&.001<Math.round(1e3*s.startTime)/1e3-Math.round(1e3*r.startTime)/1e3&&(r=s,i=0),i++)}}return r}function kd(e,t,n,i,r,a){var o,s,u,l,c,d,h,f,p,g,m,v,y,b,x,k;a=void 0===a?0:a,P((function(I){switch(I.g){case 1:if(xd(e),e.m=t,o=Date.now(),!e.o.parentElement&&e.G&&e.G.appendChild(e.o),1==i&&1==n&&(n=Array.from(e.C).filter((function(e){return t.pre?e.pre==t.pre:t.post?e.post==t.post:.001>Math.abs(e.startTime-t.startTime)})).length),t.once&&(a++,e.C.delete(t),Id(e)),e.H=!0,!e.s||1!=i){I.u(2);break}return e.i(new Jr("ad-content-pause-requested",(new Map).set("saveLivePosition",!0))),s=new Gr,u=function(t){return P((function(n){if(1==n.g)return"detach"!=t.state?n.u(0):it()?w(n,new Promise((function(e){return new Be(e).$(.1)})),3):n.u(3);s.resolve(),e.j.cb(e.B,"onstatechange",u),T(n)}))},e.j.D(e.B,"onstatechange",u),w(I,s,2);case 2:return e.s||(e.h.pause(),null!=t.resumeOffset&&0!=t.resumeOffset&&(e.h.currentTime+=t.resumeOffset)),l=!1,c=null,d=function(){if(!e.s&&null==t.resumeOffset)if(t.timelineRange&&t.endTime&&1/0!=t.endTime)e.h.currentTime!=t.endTime&&(e.h.currentTime=t.endTime);else{var n=Date.now();e.h.currentTime+=(n-r)/1e3,r=n}},h=function(){var o,s;return P((function(u){if(1==u.g)return d(),c&&c.stop(),(o=Ed(e,t.pre,i-a))?(e.i(new Jr("ad-stopped")),e.j.Va(),kd(e,o,n,++i,r,a),u.u(0)):(t.post&&(e.l=null,e.m=null),e.s?w(u,e.g.detach(),4):w(u,e.g.ic(),4));e.s&&(null==(s=t.resumeOffset)&&(s=t.timelineRange&&t.endTime&&1/0!=t.endTime?t.endTime-(e.l||0):(Date.now()-r)/1e3),e.i(new Jr("ad-content-resume-requested",(new Map).set("offset",s)))),e.i(new Jr("ad-stopped")),e.j.Va(),e.H=!1,e.s?Id(e):(d(),e.h.ended||e.h.play()),xd(e),T(u)}))},f=function(t){return P((function(n){return l?n.return():(l=!0,e.i(new Jr("ad-error",(new Map).set("originalEvent",t))),w(n,h(),0))}))},p=function(){return P((function(t){if(1==t.g)return l?t.return():(l=!0,w(t,h(),2));e.i(new Jr("ad-complete")),T(t)}))},g=function(){return P((function(t){return l?t.return():(l=!0,e.i(new Jr("ad-skipped")),w(t,h(),0))}))},m=new Td(e.o,t.isSkippable,t.skipOffset,t.skipFor,g,n,i,!e.s),e.s||(m.setMuted(e.h.muted),m.setVolume(e.h.volume)),e.i(new Jr("ad-started",(new Map).set("ad",m))),(v=m.canSkipNow())&&e.i(new Jr("ad-skip-state-changed")),e.j.pa(e.g,"error",f),e.j.D(e.o,"timeupdate",(function(){if(e.o.duration){var t=m.canSkipNow();v!=t&&0<m.getRemainingTime()&&0<m.getDuration()&&e.i(new Jr("ad-skip-state-changed")),v=t}})),e.j.pa(e.g,"firstquartile",(function(){d(),e.i(new Jr("ad-first-quartile"))})),e.j.pa(e.g,"midpoint",(function(){d(),e.i(new Jr("ad-midpoint"))})),e.j.pa(e.g,"thirdquartile",(function(){d(),e.i(new Jr("ad-third-quartile"))})),e.j.pa(e.g,"complete",p),e.j.D(e.o,"play",(function(){e.i(new Jr("ad-resumed"))})),e.j.D(e.o,"pause",(function(){var t=e.g.getConfiguration();e.o.currentTime>=t.playRangeEnd?p():e.i(new Jr("ad-paused"))})),e.j.D(e.o,"volumechange",(function(){e.o.muted?e.i(new Jr("ad-muted")):e.i(new Jr("ad-volume-changed"))})),S(I,4),Md(e),t.startTime&&t.endTime&&1/0!=t.endTime&&t.startTime!=t.endTime&&0<(y=t.endTime-t.startTime)&&e.g.configure("playRangeEnd",y),t.playoutLimit&&(c=new Be((function(){m.skip()})).$(t.playoutLimit),e.g.configure("playRangeEnd",t.playoutLimit)),w(I,e.g.Tb(e.o),6);case 6:return e.A.has(t)?w(I,e.A.get(t),10):w(I,e.g.load(t.uri,null,t.mimeType||void 0),8);case 10:return b=I.h,e.A.delete(t),w(I,b?e.g.load(b):e.g.load(t.uri,null,t.mimeType||void 0),8);case 8:t.playoutLimit&&(c&&c.stop(),c=new Be((function(){m.skip()})).$(t.playoutLimit)),x=(Date.now()-o)/1e3,e.i(new Jr("ads-loaded",(new Map).set("loadTime",x))),e.s&&e.h.play(),A(I,0);break;case 4:k=E(I),f(k),T(I)}}))}function Id(e){for(var t=[],n=l(e.C),i=n.next(),r={};!i.done;r={Sb:void 0},i=n.next())i=i.value,r.Sb={start:i.startTime,end:null},i.pre?(r.Sb.start=0,r.Sb.end=null):i.post?(r.Sb.start=-1,r.Sb.end=null):i.timelineRange&&(r.Sb.end=i.endTime),t.find(function(e){return function(t){return e.Sb.start==t.start&&e.Sb.end==t.end}}(r))||t.push(r.Sb);e.i(new Jr("ad-cue-points-changed",(new Map).set("cuepoints",t)))}function Md(e){e.g.configure(e.B.Dg()),e.g.configure("ads.disableHLSInterstitial",!0),e.g.configure("ads.disableDASHInterstitial",!0);var t=e.g.Ab();t.og(),t.pg(),ra(e.B.Ab(),t)}function Cd(e,t,n){var i,r;return P((function(a){return 1==a.g?(i=aa([t],{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4}),w(a,e.B.Ab().request(7,i,n).promise,2)):(r=a.h,a.return(r.data))}))}function Dd(e,t,n,i,r){this.h=e,this.j=At(this.h.skipOffset),this.g=r,this.i=t,this.l=n,this.o=i,this.m=!1}function Rd(e,t,n,i){this.B=e,this.K=t,this.h=n,this.l=null,this.S=NaN,this.i=i,this.I=!1,this.A=null,this.j=[],this.M=[],this.L=this.C=this.g=null,this.F=new Map,this.m=[],this.s=[],this.G="",this.O=!0,this.H="",this.o=new Z}function Pd(e,t){var n,i,r,a,o,s,u,l;P((function(c){return 1==c.g?t.staticResource?(n=Ld(t),e.F.get(n)?c.return():(i={type:9},r=aa([t.staticResource],{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4}),a=e.K.request(7,r,i),S(c,2),e.F.set(n,[]),w(c,a.promise,4))):c.return():2!=c.g?(o=c.h,s=dt(o.data),u=JSON.parse(s),l=u.apps,e.F.set(n,l),A(c,0)):(E(c),e.F.delete(n),void T(c))}))}function Ld(e){return[e.adId,e.adParameters,e.adSystem,e.adTitle,e.creativeAdId,e.creativeId,e.creativeSequence,e.height,e.width,e.staticResource].join("")}function Nd(e){var t=e.h.currentTime;if(0!=t&&null==e.A){for(var n,i,r=l(e.j),a=r.next();!a.done;a=r.next())for(var o=l((a=a.value).ads),s=o.next();!s.done;s=o.next())if(s=s.value,i){if(s.startTimeInSeconds<t&&s.startTimeInSeconds>i.startTimeInSeconds+i.durationInSeconds){i=s,n=a;break}}else s.startTimeInSeconds<t&&(i=s,n=a);n&&i&&!e.M.includes(i.adId)&&(e.A=t,e.h.currentTime=n.startTimeInSeconds)}}function jd(e){if(e.h.duration&&(e.g||e.j.length)){var t=e.h.currentTime,n=!1;if(e.g){n=!0;var i=e.C,r=i.startTimeInSeconds+.5*i.durationInSeconds,a=i.startTimeInSeconds+.75*i.durationInSeconds;t>=i.startTimeInSeconds+.25*i.durationInSeconds&&!e.s.includes("firstQuartile")?(e.s.push("firstQuartile"),_d(e,"firstQuartile")):t>=r&&!e.s.includes("midpoint")?(e.s.push("midpoint"),_d(e,"midpoint")):t>=a&&!e.s.includes("thirdQuartile")&&(e.s.push("thirdQuartile"),_d(e,"thirdQuartile")),i=e.g.getRemainingTime(),r=e.g.getDuration(),e.g.canSkipNow()&&0<i&&0<r&&_d(e,"skipStateChanged"),0<r&&(0>=i||i>r)&&Od(e)}if(!e.g||!e.g.isLinear()){e:for(i=l(e.j),r=i.next();!r.done&&(r=r.value,!e.g||!e.g.isLinear());r=i.next())for(a=0;a<r.ads.length;a++){var o=r.ads[a],s=o.startTimeInSeconds+o.durationInSeconds;if(o.startTimeInSeconds<=t&&s>t){if(e.M.includes(o.adId)){if(e.h.ended)continue;e.h.currentTime=s;break e}Od(e),e.L=r,e.g=new Dd(o,a+1,r.ads.length,!0,e.h),e.C=o,0===a&&_d(e,"breakStart"),Ud(e);break}}if(!e.g)for(r=(i=l(e.j)).next();!r.done&&(r=r.value,!e.g);r=i.next())for(a=0;a<r.nonLinearAdsList.length;a++)if((o=r.nonLinearAdsList[a]).nonLinearAdList.length){s=r.startTimeInSeconds;var u=e.F.get(Ld(o.nonLinearAdList[0]));if(s<=t&&u&&u.length){Od(e),s=e;for(var c=(u=l(u)).next();!c.done;c=u.next())if((c=c.value).data.source.length){var d=document.createElement("img");d.src=c.data.source[0].url,d.style.top=(c.placeholder.top||0)+"%",d.style.height=100-(c.placeholder.top||0)+"%",d.style.left=(c.placeholder.left||0)+"%",d.style.maxWidth=100-(c.placeholder.left||0)+"%",d.style.objectFit="contain",d.style.position="absolute",s.B.appendChild(d)}e.L=r,e.g=new Dd(o,a+1,r.ads.length,!1,e.h),e.C=o,0===a&&_d(e,"breakStart"),Ud(e);break}}n&&!e.g&&(t=e.h.currentTime,e.A&&e.A>t&&(e.h.currentTime=e.A),e.A=null)}}}function Od(e){if(e.g){for(;e.B.lastChild;)e.B.removeChild(e.B.firstChild);e.I||e.M.push(e.C.adId);var t=e.g.m;_d(e,void 0!==t&&t?"skip":"complete");for(var n=(t=l(e.m)).next();!n.done;n=t.next())n=n.value,e.o.cb(n.target,n.type,n.listener);e.m=[],e.s=[],(t=e.g.getPositionInSequence())===(n=e.g.getSequenceLength())&&_d(e,"breakEnd"),e.g=null,e.C=null,e.L=null}}function Ud(e){var t=!1;e.h.paused?t=!0:(_d(e,"impression"),_d(e,"start")),e.m.push({target:e.h,type:"volumechange",listener:function(){e.h.muted&&_d(e,"mute")}}),e.m.push({target:e.h,type:"volumechange",listener:function(){e.h.muted||_d(e,"unmute")}}),e.m.push({target:e.h,type:"play",listener:function(){t?(_d(e,"impression"),_d(e,"start"),t=!1):_d(e,"resume")}}),e.m.push({target:e.h,type:"pause",listener:function(){_d(e,"pause")}});for(var n=l(e.m),i=n.next();!i.done;i=n.next())i=i.value,e.o.D(i.target,i.type,i.listener)}function _d(e,t){var n=e.C.trackingEvents.find((function(e){return e.eventType==t}));if(n||(n=e.L.adBreakTrackingEvents.find((function(e){return e.eventType==t}))),n)for(var i={type:10},r=(n=l(n.beaconUrls)).next();!r.done;r=n.next())(r=r.value)&&""!=r&&((r=aa([r],{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4})).method="POST",e.K.request(7,r,i));switch(t){case"impression":e.i(new Jr("ad-impression"));break;case"start":e.i(new Jr("ad-started",(new Map).set("ad",e.g)));break;case"mute":e.i(new Jr("ad-muted"));break;case"unmute":e.i(new Jr("ad-volume-changed"));break;case"resume":e.i(new Jr("ad-resumed"));break;case"pause":e.i(new Jr("ad-paused"));break;case"firstQuartile":e.i(new Jr("ad-first-quartile"));break;case"midpoint":e.i(new Jr("ad-midpoint"));break;case"thirdQuartile":e.i(new Jr("ad-third-quartile"));break;case"complete":e.i(new Jr("ad-complete")),e.i(new Jr("ad-stopped"));break;case"skip":e.i(new Jr("ad-skipped")),e.i(new Jr("ad-stopped"));break;case"breakStart":e.B.setAttribute("ad-active","true");break;case"breakEnd":e.B.removeAttribute("ad-active");break;case"skipStateChanged":e.i(new Jr("ad-skip-state-changed"))}}function Bd(e,t){this.g=e,this.i=null,this.h=t}function Fd(e,t,n,i){var r=this;this.s=e,this.l=t,this.j=null,this.F=NaN,this.i=i,this.G=!1,this.A=this.m=this.o=null,this.B="",this.C=[],this.h=new Z,(e=new google.ima.dai.api.UiSettings).setLocale(n),this.g=new google.ima.dai.api.StreamManager(this.l,this.s,e),this.i(new Jr("ima-stream-manager-loaded",(new Map).set("imaStreamManager",this.g))),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.LOADED,(function(e){!function(e,t){e.i(new Jr("ads-loaded",(new Map).set("loadTime",Date.now()/1e3-e.F))),t=t.getStreamData().url,e.j.resolve(t),e.j=null,e.G||e.h.D(e.l,"seeked",(function(){var t=e.l.currentTime;if(0!=t){e.g.streamTimeForContentTime(t);var n=e.g.previousCuePointForStreamTime(t);n&&!n.played&&(e.o=t,e.l.currentTime=n.start)}}))}(r,e)})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.ERROR,(function(){r.B.length?r.j.resolve(r.B):r.j.reject("IMA Stream request returned an error and there was no backup asset uri provided."),r.j=null})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED,(function(){})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.STARTED,(function(e){e=e.getAd(),r.m=new Bd(e,r.l),r.A&&(r.m.i=r.A),r.i(new Jr("ad-started",(new Map).set("ad",r.m))),r.s.setAttribute("ad-active","true")})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED,(function(){r.s.removeAttribute("ad-active");var e=r.l.currentTime;r.o&&r.o>e&&(r.l.currentTime=r.o,r.o=null)})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.AD_PROGRESS,(function(e){r.A=e.getStreamData().adProgressData,r.m&&(r.m.i=r.A)})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.FIRST_QUARTILE,(function(){r.i(new Jr("ad-first-quartile"))})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.MIDPOINT,(function(){r.i(new Jr("ad-midpoint"))})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.THIRD_QUARTILE,(function(){r.i(new Jr("ad-third-quartile"))})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.COMPLETE,(function(){r.i(new Jr("ad-complete")),r.i(new Jr("ad-stopped")),r.s.removeAttribute("ad-active"),r.m=null})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.SKIPPED,(function(){r.i(new Jr("ad-skipped")),r.i(new Jr("ad-stopped"))})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.CUEPOINTS_CHANGED,(function(e){var t=e.getStreamData();e=[];for(var n=(t=l(t.cuepoints)).next();!n.done;n=t.next())n=n.value,e.push({start:n.start,end:n.end});r.C=e,r.i(new Jr("ad-cue-points-changed",(new Map).set("cuepoints",e)))}))}function Vd(){Zr.call(this),this.g=this.i=this.j=this.h=null,this.m=new dd,this.o=navigator.language,this.l=null}function Hd(e,t){if(t&&t.type)switch(t.type){case"ads-loaded":e.m.g.push(t.loadTime);break;case"ad-started":e.m.h++;break;case"ad-complete":e.m.j++;break;case"ad-skipped":e.m.l++;break;case"ad-error":e.m.i++}e.dispatchEvent(t)}function Gd(e){return JSON.stringify(e,(function(e,t){if("function"!=typeof t){if(t instanceof Event||t instanceof Jr){var n={};for(i in t)(e=t[i])&&"object"==typeof e?"detail"==i&&(n[i]=e):i in Event||(n[i]=e);return n}if(t instanceof Error){var i=new Set(["name","message","stack"]);for(n in t)i.add(n);for(e=(n=l(Object.getOwnPropertyNames(t))).next();!e.done;e=n.next())i.add(e.value);for(n={},e=(i=l(i)).next();!e.done;e=i.next())n[e=e.value]=t[e];t={__type__:"Error",contents:n}}else if(t instanceof TimeRanges){for(i={__type__:"TimeRanges",length:t.length,start:[],end:[]},n=(t=l(Eo(t))).next();!n.done;n=t.next())e=(n=n.value).end,i.start.push(n.start),i.end.push(e);t=i}else t=ArrayBuffer.isView(t)&&1===t.BYTES_PER_ELEMENT?{__type__:"Uint8Array",entries:Array.from(t)}:"number"==typeof t?isNaN(t)?"NaN":isFinite(t)?t:0>t?"-Infinity":"Infinity":t;return t}}))}function Kd(e){return JSON.parse(e,(function(e,t){if("NaN"==t)var n=NaN;else if("-Infinity"==t)n=-1/0;else if("Infinity"==t)n=1/0;else if(t&&"object"==typeof t&&"TimeRanges"==t.__type__)n=function(e){return{length:e.length,start:function(t){return e.start[t]},end:function(t){return e.end[t]}}}(t);else if(t&&"object"==typeof t&&"Uint8Array"==t.__type__)n=new Uint8Array(t.entries);else if(t&&"object"==typeof t&&"Error"==t.__type__){for(n in e=t.contents,t=Error(e.message),e)t[n]=e[n];n=t}else n=t;return n}))}(i=fd.prototype).needsSkipUI=function(){return!1},i.isClientRendering=function(){return!0},i.isUsingAnotherMediaElement=function(){return!0},i.getDuration=function(){return this.g.getDuration()},i.getMinSuggestedDuration=function(){return this.g.getMinSuggestedDuration()},i.getRemainingTime=function(){return this.h.getRemainingTime()},i.isPaused=function(){return this.i},i.isSkippable=function(){return 0<=this.g.getSkipTimeOffset()},i.getTimeUntilSkippable=function(){var e=this.g.getSkipTimeOffset();return e=this.getRemainingTime()-e,Math.max(e,0)},i.canSkipNow=function(){return this.h.getAdSkippableState()},i.skip=function(){return this.h.skip()},i.pause=function(){return this.h.pause()},i.play=function(){return this.h.resume()},i.getVolume=function(){return this.h.getVolume()},i.setVolume=function(e){return this.j.volume=e,this.h.setVolume(e)},i.isMuted=function(){return 0==this.h.getVolume()},i.isLinear=function(){return this.g.isLinear()},i.resize=function(e,t){var n=!1,i=this.j;document.fullscreenEnabled?n=!!document.fullscreenElement:i.webkitSupportsFullscreen&&(n=i.webkitDisplayingFullscreen),this.h.resize(e,t,n?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)},i.setMuted=function(e){(this.j.muted=e)?(this.l=this.getVolume(),this.h.setVolume(0)):this.h.setVolume(this.l)},i.getSequenceLength=function(){var e=this.g.getAdPodInfo();return null==e?1:e.getTotalAds()},i.getPositionInSequence=function(){var e=this.g.getAdPodInfo();return null==e?1:e.getAdPosition()},i.getTitle=function(){return this.g.getTitle()},i.getDescription=function(){return this.g.getDescription()},i.getVastMediaBitrate=function(){return this.g.getVastMediaBitrate()},i.getVastMediaHeight=function(){return this.g.getVastMediaHeight()},i.getVastMediaWidth=function(){return this.g.getVastMediaWidth()},i.getAdId=function(){return this.g.getAdId()},i.getCreativeAdId=function(){return this.g.getCreativeAdId()},i.getAdvertiserName=function(){return this.g.getAdvertiserName()},i.getMediaUrl=function(){return this.g.getMediaUrl()},i.getTimeOffset=function(){var e=this.g.getAdPodInfo();return null==e?0:e.getTimeOffset()},i.getPodIndex=function(){var e=this.g.getAdPodInfo();return null==e?0:e.getPodIndex()},i.release=function(){this.h=this.g=null},F("shaka.ads.ClientSideAd",fd),fd.prototype.release=fd.prototype.release,fd.prototype.getPodIndex=fd.prototype.getPodIndex,fd.prototype.getTimeOffset=fd.prototype.getTimeOffset,fd.prototype.getMediaUrl=fd.prototype.getMediaUrl,fd.prototype.getAdvertiserName=fd.prototype.getAdvertiserName,fd.prototype.getCreativeAdId=fd.prototype.getCreativeAdId,fd.prototype.getAdId=fd.prototype.getAdId,fd.prototype.getVastMediaWidth=fd.prototype.getVastMediaWidth,fd.prototype.getVastMediaHeight=fd.prototype.getVastMediaHeight,fd.prototype.getVastMediaBitrate=fd.prototype.getVastMediaBitrate,fd.prototype.getDescription=fd.prototype.getDescription,fd.prototype.getTitle=fd.prototype.getTitle,fd.prototype.getPositionInSequence=fd.prototype.getPositionInSequence,fd.prototype.getSequenceLength=fd.prototype.getSequenceLength,fd.prototype.setMuted=fd.prototype.setMuted,fd.prototype.resize=fd.prototype.resize,fd.prototype.isLinear=fd.prototype.isLinear,fd.prototype.isMuted=fd.prototype.isMuted,fd.prototype.setVolume=fd.prototype.setVolume,fd.prototype.getVolume=fd.prototype.getVolume,fd.prototype.play=fd.prototype.play,fd.prototype.pause=fd.prototype.pause,fd.prototype.skip=fd.prototype.skip,fd.prototype.canSkipNow=fd.prototype.canSkipNow,fd.prototype.getTimeUntilSkippable=fd.prototype.getTimeUntilSkippable,fd.prototype.isSkippable=fd.prototype.isSkippable,fd.prototype.isPaused=fd.prototype.isPaused,fd.prototype.getRemainingTime=fd.prototype.getRemainingTime,fd.prototype.getMinSuggestedDuration=fd.prototype.getMinSuggestedDuration,fd.prototype.getDuration=fd.prototype.getDuration,fd.prototype.isUsingAnotherMediaElement=fd.prototype.isUsingAnotherMediaElement,fd.prototype.isClientRendering=fd.prototype.isClientRendering,fd.prototype.needsSkipUI=fd.prototype.needsSkipUI,F("shaka.ads.Utils",pd),pd.ADS_LOADED="ads-loaded",pd.AD_STARTED="ad-started",pd.AD_FIRST_QUARTILE="ad-first-quartile",pd.AD_MIDPOINT="ad-midpoint",pd.AD_THIRD_QUARTILE="ad-third-quartile",pd.AD_COMPLETE="ad-complete",pd.AD_STOPPED="ad-stopped",pd.AD_SKIPPED="ad-skipped",pd.AD_VOLUME_CHANGED="ad-volume-changed",pd.AD_MUTED="ad-muted",pd.AD_PAUSED="ad-paused",pd.AD_RESUMED="ad-resumed",pd.AD_SKIP_STATE_CHANGED="ad-skip-state-changed",pd.CUEPOINTS_CHANGED="ad-cue-points-changed",pd.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded",pd.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded",pd.AD_CLICKED="ad-clicked",pd.AD_PROGRESS="ad-progress",pd.AD_BUFFERING="ad-buffering",pd.AD_IMPRESSION="ad-impression",pd.AD_DURATION_CHANGED="ad-duration-changed",pd.AD_CLOSED="ad-closed",pd.AD_LOADED="ad-loaded",pd.ALL_ADS_COMPLETED="all-ads-completed",pd.AD_LINEAR_CHANGED="ad-linear-changed",pd.AD_METADATA="ad-metadata",pd.AD_RECOVERABLE_ERROR="ad-recoverable-error",pd.AD_ERROR="ad-error",pd.AD_BREAK_READY="ad-break-ready",pd.AD_INTERACTION="ad-interaction",pd.AD_CONTENT_PAUSE_REQUESTED="ad-content-pause-requested",pd.AD_CONTENT_RESUME_REQUESTED="ad-content-resume-requested",pd.AD_CONTENT_ATTACH_REQUESTED="ad-content-attach-requested",md.prototype.configure=function(e){this.o=e},md.prototype.stop=function(){this.g&&this.g.stop(),this.s&&Mo(this.s)},md.prototype.release=function(){this.stop(),this.A&&this.A.disconnect(),this.h&&this.h.release(),this.g&&this.g.destroy(),this.m.destroy(),this.C.destroy()},(i=Td.prototype).needsSkipUI=function(){return!0},i.isClientRendering=function(){return!0},i.isUsingAnotherMediaElement=function(){return this.m},i.getDuration=function(){var e=this.g.duration;return isNaN(e)?-1:e},i.getMinSuggestedDuration=function(){return this.getDuration()},i.getRemainingTime=function(){var e=this.g.duration;return isNaN(e)?-1:e-this.g.currentTime},i.isPaused=function(){return this.g.paused},i.isSkippable=function(){return this.h&&null!=this.j?this.getDuration()-this.getRemainingTime()<this.i+this.j:this.h},i.getTimeUntilSkippable=function(){if(this.isSkippable()){var e=this.getRemainingTime()+this.i-this.getDuration();return Math.max(e,0)}return Math.max(this.getRemainingTime(),0)},i.canSkipNow=function(){return this.h&&0==this.getTimeUntilSkippable()},i.skip=function(){this.canSkipNow()&&this.o()},i.pause=function(){return this.g.pause()},i.play=function(){return this.g.play()},i.getVolume=function(){return this.g.volume},i.setVolume=function(e){this.g.volume=e},i.isMuted=function(){return this.g.muted},i.isLinear=function(){return!0},i.resize=function(){},i.setMuted=function(e){this.g.muted=e},i.getSequenceLength=function(){return this.s},i.getPositionInSequence=function(){return this.l},i.getTitle=function(){return""},i.getDescription=function(){return""},i.getVastMediaBitrate=function(){return 0},i.getVastMediaHeight=function(){return 0},i.getVastMediaWidth=function(){return 0},i.getAdId=function(){return""},i.getCreativeAdId=function(){return""},i.getAdvertiserName=function(){return""},i.getMediaUrl=function(){return null},i.getTimeOffset=function(){return 0},i.getPodIndex=function(){return 0},i.release=function(){this.g=null},F("shaka.ads.InterstitialAd",Td),Td.prototype.release=Td.prototype.release,Td.prototype.getPodIndex=Td.prototype.getPodIndex,Td.prototype.getTimeOffset=Td.prototype.getTimeOffset,Td.prototype.getMediaUrl=Td.prototype.getMediaUrl,Td.prototype.getAdvertiserName=Td.prototype.getAdvertiserName,Td.prototype.getCreativeAdId=Td.prototype.getCreativeAdId,Td.prototype.getAdId=Td.prototype.getAdId,Td.prototype.getVastMediaWidth=Td.prototype.getVastMediaWidth,Td.prototype.getVastMediaHeight=Td.prototype.getVastMediaHeight,Td.prototype.getVastMediaBitrate=Td.prototype.getVastMediaBitrate,Td.prototype.getDescription=Td.prototype.getDescription,Td.prototype.getTitle=Td.prototype.getTitle,Td.prototype.getPositionInSequence=Td.prototype.getPositionInSequence,Td.prototype.getSequenceLength=Td.prototype.getSequenceLength,Td.prototype.setMuted=Td.prototype.setMuted,Td.prototype.resize=Td.prototype.resize,Td.prototype.isLinear=Td.prototype.isLinear,Td.prototype.isMuted=Td.prototype.isMuted,Td.prototype.setVolume=Td.prototype.setVolume,Td.prototype.getVolume=Td.prototype.getVolume,Td.prototype.play=Td.prototype.play,Td.prototype.pause=Td.prototype.pause,Td.prototype.skip=Td.prototype.skip,Td.prototype.canSkipNow=Td.prototype.canSkipNow,Td.prototype.getTimeUntilSkippable=Td.prototype.getTimeUntilSkippable,Td.prototype.isSkippable=Td.prototype.isSkippable,Td.prototype.isPaused=Td.prototype.isPaused,Td.prototype.getRemainingTime=Td.prototype.getRemainingTime,Td.prototype.getMinSuggestedDuration=Td.prototype.getMinSuggestedDuration,Td.prototype.getDuration=Td.prototype.getDuration,Td.prototype.isUsingAnotherMediaElement=Td.prototype.isUsingAnotherMediaElement,Td.prototype.isClientRendering=Td.prototype.isClientRendering,Td.prototype.needsSkipUI=Td.prototype.needsSkipUI,Sd.prototype.configure=function(e){this.M=e,xd(this)},Sd.prototype.stop=function(){this.j&&this.j.Va(),this.I.clear(),this.C.clear(),this.g.Te(),this.A.clear(),this.g.detach(),this.H=!1,this.m=this.l=null},Sd.prototype.release=function(){this.stop(),this.K&&this.K.release(),this.j&&this.j.release(),this.G&&Mo(this.G),this.L&&(this.L.stop(),this.L=null),this.O&&(this.O.stop(),this.O=null),this.g.destroy()},Sd.prototype.addAdUrlInterstitial=function(e){var t,n,i,r,a,o,s,u,d,h=this;return P((function(f){switch(f.g){case 1:return w(f,Cd(h,e,t={type:12}),2);case 2:if(n=f.h,!(i=Ct(n,"VAST,vmap:VMAP")))throw new De(2,10,10007);if(r=[],"VAST"==i.tagName){r=gd(i,h.l),f.u(3);break}if("vmap:VMAP"!=i.tagName){f.u(3);break}for(var p=[],g=l(Nt(i,"vmap:AdBreak")),m=g.next();!m.done;m=g.next()){var v=m.value,y=v.attributes.timeOffset;y&&(m=null,m="start"==y?0:"end"==y?1/0:At(y),(v=_t(v,"vmap:AdSource"))&&(v=_t(v,"vmap:AdTagURI"))&&(v=jt(v))&&p.push({time:m,uri:v}))}a=l(p),o=a.next();case 5:if(o.done){f.u(3);break}return s=o.value,w(f,Cd(h,s.uri,t),8);case 8:if(u=f.h,!(d=Ct(u,"VAST")))throw new De(2,10,10007);r.push.apply(r,c(gd(d,s.time))),o=a.next(),f.u(5);break;case 3:Ad(h,r),T(f)}}))},(i=Dd.prototype).needsSkipUI=function(){return!0},i.isClientRendering=function(){return!1},i.isUsingAnotherMediaElement=function(){return!1},i.getDuration=function(){return this.h.durationInSeconds},i.getMinSuggestedDuration=function(){return this.getDuration()},i.getRemainingTime=function(){return this.h.startTimeInSeconds+this.h.durationInSeconds-this.g.currentTime},i.isPaused=function(){return this.g.paused},i.isSkippable=function(){return"number"==typeof this.j},i.getTimeUntilSkippable=function(){if("number"!=typeof this.j)return this.getRemainingTime();var e=this.getRemainingTime()+this.j-this.getDuration();return Math.max(e,0)},i.canSkipNow=function(){return 0==this.getTimeUntilSkippable()},i.skip=function(){this.m=!0,this.g.currentTime+=this.getRemainingTime()},i.pause=function(){return this.g.pause()},i.play=function(){return this.g.play()},i.getVolume=function(){return this.g.volume},i.setVolume=function(e){this.g.volume=e},i.isMuted=function(){return this.g.muted},i.isLinear=function(){return this.o},i.resize=function(){},i.setMuted=function(e){this.g.muted=e},i.getSequenceLength=function(){return this.l?this.l:1},i.getPositionInSequence=function(){return this.i?this.i:1},i.getTitle=function(){return this.h.adTitle},i.getDescription=function(){return""},i.getVastMediaBitrate=function(){return 0},i.getVastMediaHeight=function(){return 0},i.getVastMediaWidth=function(){return 0},i.getAdId=function(){return this.h.adId},i.getCreativeAdId=function(){return this.h.creativeId},i.getAdvertiserName=function(){return""},i.getMediaUrl=function(){return null},i.getTimeOffset=function(){return 0},i.getPodIndex=function(){return 0},i.release=function(){this.l=this.i=this.g=this.h=null},F("shaka.ads.MediaTailorAd",Dd),Dd.prototype.release=Dd.prototype.release,Dd.prototype.getPodIndex=Dd.prototype.getPodIndex,Dd.prototype.getTimeOffset=Dd.prototype.getTimeOffset,Dd.prototype.getMediaUrl=Dd.prototype.getMediaUrl,Dd.prototype.getAdvertiserName=Dd.prototype.getAdvertiserName,Dd.prototype.getCreativeAdId=Dd.prototype.getCreativeAdId,Dd.prototype.getAdId=Dd.prototype.getAdId,Dd.prototype.getVastMediaWidth=Dd.prototype.getVastMediaWidth,Dd.prototype.getVastMediaHeight=Dd.prototype.getVastMediaHeight,Dd.prototype.getVastMediaBitrate=Dd.prototype.getVastMediaBitrate,Dd.prototype.getDescription=Dd.prototype.getDescription,Dd.prototype.getTitle=Dd.prototype.getTitle,Dd.prototype.getPositionInSequence=Dd.prototype.getPositionInSequence,Dd.prototype.getSequenceLength=Dd.prototype.getSequenceLength,Dd.prototype.setMuted=Dd.prototype.setMuted,Dd.prototype.resize=Dd.prototype.resize,Dd.prototype.isLinear=Dd.prototype.isLinear,Dd.prototype.isMuted=Dd.prototype.isMuted,Dd.prototype.setVolume=Dd.prototype.setVolume,Dd.prototype.getVolume=Dd.prototype.getVolume,Dd.prototype.play=Dd.prototype.play,Dd.prototype.pause=Dd.prototype.pause,Dd.prototype.skip=Dd.prototype.skip,Dd.prototype.canSkipNow=Dd.prototype.canSkipNow,Dd.prototype.getTimeUntilSkippable=Dd.prototype.getTimeUntilSkippable,Dd.prototype.isSkippable=Dd.prototype.isSkippable,Dd.prototype.isPaused=Dd.prototype.isPaused,Dd.prototype.getRemainingTime=Dd.prototype.getRemainingTime,Dd.prototype.getMinSuggestedDuration=Dd.prototype.getMinSuggestedDuration,Dd.prototype.getDuration=Dd.prototype.getDuration,Dd.prototype.isUsingAnotherMediaElement=Dd.prototype.isUsingAnotherMediaElement,Dd.prototype.isClientRendering=Dd.prototype.isClientRendering,Dd.prototype.needsSkipUI=Dd.prototype.needsSkipUI,Rd.prototype.stop=function(){for(var e=l(this.m),t=e.next();!t.done;t=e.next())t=t.value,this.o.cb(t.target,t.type,t.listener);Od(this),this.m=[],this.s=[],this.G="",this.O=!0,this.H="",this.A=null,this.j=[],this.M=[],this.F.clear()},Rd.prototype.release=function(){this.stop(),this.o&&this.o.release()},Rd.prototype.onManifestUpdated=function(e){this.I=e,""!=this.G&&(function(e,t,n){var i,r,a,o,s,u,c,d,h,f,p,g,m,v,y,b;P((function(x){if(1==x.g)return i={type:8},r=aa([t],{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4}),a=e.K.request(7,r,i),S(x,2),w(x,a.promise,4);if(2!=x.g){if(o=x.h,s=[],u=dt(o.data),0<(c=JSON.parse(u)).avails.length){if(JSON.stringify(e.j)!=JSON.stringify(c.avails)){for(e.j=c.avails,d=l(e.j),h=d.next();!h.done;h=d.next())for(f=h.value,p=l(f.nonLinearAdsList),g=p.next();!g.done;g=p.next())for(m=g.value,v=l(m.nonLinearAdList),y=v.next();!y.done;y=v.next())b=y.value,Pd(e,b);s=e.getCuePoints(),e.i(new Jr("ad-cue-points-changed",(new Map).set("cuepoints",s)))}}else e.j.length&&e.i(new Jr("ad-cue-points-changed",(new Map).set("cuepoints",s))),Od(e),e.j=[];return n&&(e.I||0<s.length)&&function(e){jd(e),e.I||(Nd(e),e.o.D(e.h,"seeked",(function(){Nd(e)})),e.o.D(e.h,"ended",(function(){Od(e)}))),e.o.D(e.h,"timeupdate",(function(){jd(e)}))}(e),A(x,0)}E(x),T(x)}))}(this,this.G,this.O),this.O=!1)},Rd.prototype.getCuePoints=function(){for(var e=[],t=l(this.j),n=t.next();!n.done;n=t.next())for(var i=(n=l(n.value.ads)).next();!i.done;i=n.next())i=i.value,e.push({start:i.startTimeInSeconds,end:i.startTimeInSeconds+i.durationInSeconds});return e},(i=Bd.prototype).needsSkipUI=function(){return!0},i.isClientRendering=function(){return!1},i.isUsingAnotherMediaElement=function(){return!1},i.getDuration=function(){return this.i?this.i.duration:-1},i.getMinSuggestedDuration=function(){return this.getDuration()},i.getRemainingTime=function(){return this.i?this.i.duration-this.i.currentTime:-1},i.isPaused=function(){return this.h.paused},i.isSkippable=function(){return this.g.isSkippable()},i.getTimeUntilSkippable=function(){var e=this.g.getSkipTimeOffset();return e=this.getRemainingTime()-e,Math.max(e,0)},i.canSkipNow=function(){return 0==this.getTimeUntilSkippable()},i.skip=function(){this.h.currentTime+=this.getRemainingTime()},i.pause=function(){return this.h.pause()},i.play=function(){return this.h.play()},i.getVolume=function(){return this.h.volume},i.setVolume=function(e){this.h.volume=e},i.isMuted=function(){return this.h.muted},i.isLinear=function(){return!0},i.resize=function(){},i.setMuted=function(e){this.h.muted=e},i.getSequenceLength=function(){var e=this.g.getAdPodInfo();return null==e?1:e.getTotalAds()},i.getPositionInSequence=function(){var e=this.g.getAdPodInfo();return null==e?1:e.getAdPosition()},i.getTitle=function(){return this.g.getTitle()},i.getDescription=function(){return this.g.getDescription()},i.getVastMediaBitrate=function(){return 0},i.getVastMediaHeight=function(){return this.g.getVastMediaHeight()},i.getVastMediaWidth=function(){return this.g.getVastMediaWidth()},i.getAdId=function(){return this.g.getAdId()},i.getCreativeAdId=function(){return this.g.getCreativeAdId()},i.getAdvertiserName=function(){return this.g.getAdvertiserName()},i.getMediaUrl=function(){return null},i.getTimeOffset=function(){var e=this.g.getAdPodInfo();return null==e?0:e.getTimeOffset()},i.getPodIndex=function(){var e=this.g.getAdPodInfo();return null==e?0:e.getPodIndex()},i.release=function(){this.h=this.i=this.g=null},F("shaka.ads.ServerSideAd",Bd),Bd.prototype.release=Bd.prototype.release,Bd.prototype.getPodIndex=Bd.prototype.getPodIndex,Bd.prototype.getTimeOffset=Bd.prototype.getTimeOffset,Bd.prototype.getMediaUrl=Bd.prototype.getMediaUrl,Bd.prototype.getAdvertiserName=Bd.prototype.getAdvertiserName,Bd.prototype.getCreativeAdId=Bd.prototype.getCreativeAdId,Bd.prototype.getAdId=Bd.prototype.getAdId,Bd.prototype.getVastMediaWidth=Bd.prototype.getVastMediaWidth,Bd.prototype.getVastMediaHeight=Bd.prototype.getVastMediaHeight,Bd.prototype.getVastMediaBitrate=Bd.prototype.getVastMediaBitrate,Bd.prototype.getDescription=Bd.prototype.getDescription,Bd.prototype.getTitle=Bd.prototype.getTitle,Bd.prototype.getPositionInSequence=Bd.prototype.getPositionInSequence,Bd.prototype.getSequenceLength=Bd.prototype.getSequenceLength,Bd.prototype.setMuted=Bd.prototype.setMuted,Bd.prototype.resize=Bd.prototype.resize,Bd.prototype.isLinear=Bd.prototype.isLinear,Bd.prototype.isMuted=Bd.prototype.isMuted,Bd.prototype.setVolume=Bd.prototype.setVolume,Bd.prototype.getVolume=Bd.prototype.getVolume,Bd.prototype.play=Bd.prototype.play,Bd.prototype.pause=Bd.prototype.pause,Bd.prototype.skip=Bd.prototype.skip,Bd.prototype.canSkipNow=Bd.prototype.canSkipNow,Bd.prototype.getTimeUntilSkippable=Bd.prototype.getTimeUntilSkippable,Bd.prototype.isSkippable=Bd.prototype.isSkippable,Bd.prototype.isPaused=Bd.prototype.isPaused,Bd.prototype.getRemainingTime=Bd.prototype.getRemainingTime,Bd.prototype.getMinSuggestedDuration=Bd.prototype.getMinSuggestedDuration,Bd.prototype.getDuration=Bd.prototype.getDuration,Bd.prototype.isUsingAnotherMediaElement=Bd.prototype.isUsingAnotherMediaElement,Bd.prototype.isClientRendering=Bd.prototype.isClientRendering,Bd.prototype.needsSkipUI=Bd.prototype.needsSkipUI,(i=Fd.prototype).configure=function(){},i.stop=function(){this.B="",this.o=null,this.C=[]},i.release=function(){this.stop(),this.h&&this.h.release()},i.onCueMetadataChange=function(e){if(e.key&&e.data){var t={};t[e.key]=e.data,this.g.onTimedMetadata(t)}},i.getCuePoints=function(){return this.C},m(Vd,Zr),(i=Vd.prototype).setLocale=function(e){this.o=e},i.configure=function(e){this.l=e,this.h&&this.h.configure(this.l),this.j&&this.j.configure(this.l),this.g&&this.g.configure(this.l)},i.initInterstitial=function(e,t,n){var i=this;this.h&&this.h.release(),this.h=new Sd(e,t,n,(function(e){return Hd(i,e)})),this.h.configure(this.l)},i.initClientSide=function(t,n,i){var r=this;if(!e.google||!google.ima||!google.ima.AdsLoader)throw new De(2,10,1e4);this.j&&this.j.release(),this.j=new md(t,n,this.o,i,(function(e){return Hd(r,e)})),this.j.configure(this.l)},i.release=function(){this.h&&(this.h.release(),this.h=null),this.j&&(this.j.release(),this.j=null),this.i&&(this.i.release(),this.i=null),this.g&&(this.g.release(),this.g=null),Zr.prototype.release.call(this)},i.onAssetUnload=function(){this.h&&this.h.stop(),this.j&&this.j.stop(),this.i&&this.i.stop(),this.g&&this.g.stop(),this.dispatchEvent(new Jr("ad-stopped")),this.dispatchEvent(new Jr("ad-content-attach-requested")),this.m=new dd},i.requestClientSideAds=function(e){if(!this.j)throw new De(1,10,10001);var t=this.j;t.g&&t.g.destroy(),t.m&&t.m.contentComplete(),t.G=Date.now()/1e3,t.m.requestAds(e)},i.updateClientSideAdsRenderingSettings=function(e){if(!this.j)throw new De(1,10,10001);var t=this.j;t.B=e,t.g&&t.g.updateAdsRenderingSettings(t.B)},i.initMediaTailor=function(e,t,n){var i=this;this.i&&this.i.release(),this.i=new Rd(e,t,n,(function(e){return Hd(i,e)}))},i.requestMediaTailorStream=function(e,t,n){if(!this.i)throw new De(1,10,10005);var i=this.i;return n=void 0===n?"":n,i.l?e=Promise.reject(new De(1,10,10004)):(i.l=new Gr,function(e,t,n){var i,r,a,o,s,u,l,c,d,h,f,p;P((function(g){if(1==g.g)return i={type:7},(r=aa([t],{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4})).method="POST",n&&(a=JSON.stringify(n),r.body=pt(a)),o=e.K.request(7,r,i),S(g,2),w(g,o.promise,4);if(2!=g.g){if(s=g.h,u=dt(s.data),!(l=JSON.parse(u)).manifestUrl||!l.trackingUrl)throw Error("Insufficient data from MediaTailor.");return c=new Gn(t),d=new Gn(l.trackingUrl),e.G=c.resolve(d).toString(),h=Date.now()/1e3,f=h-e.S,e.i(new Jr("ads-loaded",(new Map).set("loadTime",f))),p=new Gn(l.manifestUrl),e.l.resolve(c.resolve(p).toString()),e.l=null,A(g,0)}if(E(g),!e.H.length)return e.l.reject("MediaTailor request returned an error and there was no backup asset uri provided."),e.l=null,g.return();e.l.resolve(e.H),e.l=null,T(g)}))}(i,e,t),i.H=n||"",i.S=Date.now()/1e3,e=i.l),e},i.addMediaTailorTrackingUrl=function(e){if(!this.i)throw new De(1,10,10005);var t=this.i;t.G=e,t.i(new Jr("ads-loaded",(new Map).set("loadTime",0)))},i.initServerSide=function(t,n){var i=this;if(!e.google||!google.ima||!google.ima.dai)throw new De(2,10,10002);this.g&&this.g.release(),this.g=new Fd(t,n,this.o,(function(e){return Hd(i,e)})),this.g.configure(this.l)},i.requestServerSideStream=function(e,t){if(t=void 0===t?"":t,!this.g)throw new De(1,10,10003);e.adTagParameters||(e.adTagParameters={});var n=e.adTagParameters;return(n.mpt||n.mpv)&&W('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overriden.'),e.adTagParameters.mpt="shaka-player",e.adTagParameters.mpv="v4.12.5",(n=this.g).j?e=Promise.reject(new De(1,10,10004)):(e instanceof google.ima.dai.api.LiveStreamRequest&&(n.G=!0),n.j=new Gr,n.g.requestStream(e),n.B=t||"",n.F=Date.now()/1e3,e=n.j),e},i.replaceServerSideAdTagParameters=function(e){if(!this.g)throw new De(1,10,10003);(e.mpt||e.mpv)&&W('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overriden.'),e.mpt="Shaka Player",e.mpv="v4.12.5",this.g.g.replaceAdTagParameters(e)},i.getServerSideCuePoints=function(){return oe("AdManager.getServerSideCuePoints","Please use getCuePoints function."),this.getCuePoints()},i.getCuePoints=function(){var e=[];return this.g&&(e=e.concat(this.g.getCuePoints())),this.i&&(e=e.concat(this.i.getCuePoints())),e},i.getStats=function(){var e=this.m;return{loadTimes:e.g,averageLoadTime:hd(e),started:e.h,playedCompletely:e.j,skipped:e.l,errors:e.i}},i.onManifestUpdated=function(e){this.i&&this.i.onManifestUpdated(e)},i.onDashTimedMetadata=function(e){this.g&&"urn:google:dai:2018"==e.schemeIdUri&&this.g.g.processMetadata(e.schemeIdUri,e.eventNode?e.eventNode.attributes.messageData:null,e.startTime)},i.onHlsTimedMetadata=function(e,t){this.g&&this.g.g.processMetadata("ID3",e.data,t)},i.onCueMetadataChange=function(e){this.g&&this.g.onCueMetadataChange(e)},i.onHLSInterstitialMetadata=function(e,t,n){this.l&&this.l.disableHLSInterstitial||(this.h||this.initInterstitial(null,e,t),this.h&&function(e,t){var n;P((function(i){if(1==i.g)return Md(e),w(i,function(e,t){var n,i,r,a,o,s,u,l,c,d,h,f,p,g,m,v,y,b,T,x,k,I,M,C,D,R,L,N,j,O,U,_,B,F,V,H,G,K,X,q,z;return P((function(P){switch(P.g){case 1:if(n=[],!t)return P.return(n);if(i=t.values.find((function(e){return"X-ASSET-URI"==e.key})),r=t.values.find((function(e){return"X-ASSET-LIST"==e.key})),!i&&!r)return P.return(n);if(a=null,(o=t.values.find((function(e){return"ID"==e.key})))&&(a=o.data),s=null==a?Math.floor(10*t.startTime)/10:t.startTime,(u=t.endTime)&&1/0!=t.endTime&&"number"==typeof t.endTime&&(u=null==a?Math.floor(10*t.endTime)/10:t.endTime),l=t.values.find((function(e){return"X-RESTRICT"==e.key})),d=c=!0,l&&l.data&&(h=l.data,c=!h.includes("SKIP"),d=!h.includes("JUMP")),f=c?0:null,(p=t.values.find((function(e){return"X-ENABLE-SKIP-AFTER"==e.key})))&&(g=p.data,f=parseFloat(g),isNaN(f)&&(f=c?0:null)),m=null,(v=t.values.find((function(e){return"X-ENABLE-SKIP-FOR"==e.key})))&&(y=v.data,m=parseFloat(y),isNaN(f)&&(m=null)),b=null,(T=t.values.find((function(e){return"X-RESUME-OFFSET"==e.key})))&&(x=T.data,b=parseFloat(x),isNaN(b)&&(b=null)),k=null,(I=t.values.find((function(e){return"X-PLAYOUT-LIMIT"==e.key})))&&(M=I.data,k=parseFloat(M),isNaN(k)&&(k=null)),R=D=C=!1,(L=t.values.find((function(e){return"CUE"==e.key})))&&(N=L.data,C=N.includes("ONCE"),D=N.includes("PRE"),R=N.includes("POST")),j=!1,(O=t.values.find((function(e){return"X-TIMELINE-OCCUPIES"==e.key})))?(U=O.data,j=U.includes("RANGE")):!T&&e.B.U()&&(j=!D&&!R),i){if(!(_=i.data))return P.return(n);n.push({id:a,startTime:s,endTime:u,uri:_,mimeType:null,isSkippable:c,skipOffset:f,skipFor:m,canJump:d,resumeOffset:b,playoutLimit:k,once:C,pre:D,post:R,timelineRange:j}),P.u(2);break}if(!r){P.u(2);break}return(B=r.data)?(S(P,4),w(P,Cd(e,B,{type:11}),6)):P.return(n);case 6:for(F=P.h,V=dt(F),H=JSON.parse(V),(G=H["SKIP-CONTROL"])&&("number"==typeof(K=G["ENABLE-SKIP-AFTER"])&&(f=parseFloat(K),isNaN(K)&&(f=c?0:null)),"number"==typeof(X=G["ENABLE-SKIP-FOR"])&&(m=parseFloat(X),isNaN(X)&&(m=null))),q=0;q<H.ASSETS.length;q++)(z=H.ASSETS[q]).URI&&n.push({id:a+"_asset_"+q,startTime:s,endTime:u,uri:z.URI,mimeType:null,isSkippable:c,skipOffset:f,skipFor:m,canJump:d,resumeOffset:b,playoutLimit:k,once:C,pre:D,post:R,timelineRange:j});A(P,2);break;case 4:E(P);case 2:return P.return(n)}}))}(e,t),2);(n=i.h).length?Ad(e,n):W("Unsupported HLS interstitial",t),T(i)}))}(this.h,n))},i.onDASHInterstitialMetadata=function(e,t,n){if(!(this.l&&this.l.disableDASHInterstitial||"urn:mpeg:dash:event:alternativeMPD:2022"!=n.schemeIdUri)&&(this.h||this.initInterstitial(null,e,t),this.h)){e=this.h;for(var i=(t=l(n.eventNode.children)).next();!i.done;i=t.next()){var r=i.value;if("AlternativeMPD"==r.tagName&&(i=r.attributes.uri,r=r.attributes.mode,i)){var a=i,o=r;break}}a?(t="replace"==o,o="insert"==o,(t||o)&&Ad(e,[{id:n.id,startTime:n.startTime,endTime:n.endTime,uri:a,mimeType:null,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!0,resumeOffset:o?0:null,playoutLimit:null,once:!1,pre:!1,post:!1,timelineRange:t&&!o}])):W("Unsupported MPD alternate",n)}},i.addCustomInterstitial=function(e){if(!this.h)throw new De(1,10,10006);Ad(this.h,[e])},i.addAdUrlInterstitial=function(e){if(!this.h)throw new De(1,10,10006);return this.h.addAdUrlInterstitial(e)},F("shaka.ads.AdManager",Vd),Vd.prototype.addAdUrlInterstitial=Vd.prototype.addAdUrlInterstitial,Vd.prototype.addCustomInterstitial=Vd.prototype.addCustomInterstitial,Vd.prototype.onDASHInterstitialMetadata=Vd.prototype.onDASHInterstitialMetadata,Vd.prototype.onHLSInterstitialMetadata=Vd.prototype.onHLSInterstitialMetadata,Vd.prototype.onCueMetadataChange=Vd.prototype.onCueMetadataChange,Vd.prototype.onHlsTimedMetadata=Vd.prototype.onHlsTimedMetadata,Vd.prototype.onDashTimedMetadata=Vd.prototype.onDashTimedMetadata,Vd.prototype.onManifestUpdated=Vd.prototype.onManifestUpdated,Vd.prototype.getStats=Vd.prototype.getStats,Vd.prototype.getCuePoints=Vd.prototype.getCuePoints,Vd.prototype.getServerSideCuePoints=Vd.prototype.getServerSideCuePoints,Vd.prototype.replaceServerSideAdTagParameters=Vd.prototype.replaceServerSideAdTagParameters,Vd.prototype.requestServerSideStream=Vd.prototype.requestServerSideStream,Vd.prototype.initServerSide=Vd.prototype.initServerSide,Vd.prototype.addMediaTailorTrackingUrl=Vd.prototype.addMediaTailorTrackingUrl,Vd.prototype.requestMediaTailorStream=Vd.prototype.requestMediaTailorStream,Vd.prototype.initMediaTailor=Vd.prototype.initMediaTailor,Vd.prototype.updateClientSideAdsRenderingSettings=Vd.prototype.updateClientSideAdsRenderingSettings,Vd.prototype.requestClientSideAds=Vd.prototype.requestClientSideAds,Vd.prototype.onAssetUnload=Vd.prototype.onAssetUnload,Vd.prototype.release=Vd.prototype.release,Vd.prototype.initClientSide=Vd.prototype.initClientSide,Vd.prototype.initInterstitial=Vd.prototype.initInterstitial,Vd.prototype.configure=Vd.prototype.configure,Vd.prototype.setLocale=Vd.prototype.setLocale,Vd.ADS_LOADED="ads-loaded",Vd.AD_STARTED="ad-started",Vd.AD_FIRST_QUARTILE="ad-first-quartile",Vd.AD_MIDPOINT="ad-midpoint",Vd.AD_THIRD_QUARTILE="ad-third-quartile",Vd.AD_COMPLETE="ad-complete",Vd.AD_STOPPED="ad-stopped",Vd.AD_SKIPPED="ad-skipped",Vd.AD_VOLUME_CHANGED="ad-volume-changed",Vd.AD_MUTED="ad-muted",Vd.AD_PAUSED="ad-paused",Vd.AD_RESUMED="ad-resumed",Vd.AD_SKIP_STATE_CHANGED="ad-skip-state-changed",Vd.CUEPOINTS_CHANGED="ad-cue-points-changed",Vd.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded",Vd.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded",Vd.AD_CLICKED="ad-clicked",Vd.AD_PROGRESS="ad-progress",Vd.AD_BUFFERING="ad-buffering",Vd.AD_IMPRESSION="ad-impression",Vd.AD_DURATION_CHANGED="ad-duration-changed",Vd.AD_CLOSED="ad-closed",Vd.AD_LOADED="ad-loaded",Vd.ALL_ADS_COMPLETED="all-ads-completed",Vd.AD_LINEAR_CHANGED="ad-linear-changed",Vd.AD_METADATA="ad-metadata",Vd.AD_RECOVERABLE_ERROR="ad-recoverable-error",Vd.AD_ERROR="ad-error",Vd.AD_BREAK_READY="ad-break-ready",Vd.AD_INTERACTION="ad-interaction",Vd.AD_CONTENT_PAUSE_REQUESTED="ad-content-pause-requested",Vd.AD_CONTENT_RESUME_REQUESTED="ad-content-resume-requested",Vd.AD_CONTENT_ATTACH_REQUESTED="ad-content-attach-requested",cd=function(){return new Vd};var Xd="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),qd="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),zd=["loop","playbackRate"],Wd=["pause","play"],Yd={getAssetUri:2,getAudioLanguages:4,getAudioLanguagesAndRoles:4,getBufferFullness:1,getBufferedInfo:2,getExpiration:2,getKeyStatuses:2,getPlaybackRate:2,getTextLanguages:4,getTextLanguagesAndRoles:4,getImageTracks:2,getThumbnails:2,isAudioOnly:10,isBuffering:1,isInProgress:1,isLive:10,isTextTrackVisible:1,keySystem:10,seekRange:1,getLoadMode:10,getManifestType:10,isFullyLoaded:1},Jd={getConfiguration:4,getStats:5,getTextTracks:2,getVariantTracks:2},$d={getPlayheadTimeAsDate:1,getPresentationStartTimeAsDate:20,getSegmentAvailabilityDuration:20},Qd=[["getConfiguration","configure"]],Zd=[["isTextTrackVisible","setTextTrackVisibility"]],eh="addChaptersTrack addTextTrackAsync addThumbnailsTrack cancelTrickPlay configure getChapters getChaptersTracks resetConfiguration retryStreaming selectAudioLanguage selectTextLanguage selectTextTrack selectVariantTrack selectVariantsByLabel setTextTrackVisibility trickPlay updateStartTime goToLive".split(" "),th=["attach","attachCanvas","detach","load","unload"];function nh(e,t,n,i,r,a,o){var s=this;this.G=e,this.K=o,this.l=new Be(t),this.L=n,this.s=!1,this.A=i,this.F=r,this.M=a,this.h=this.m=!1,this.I="",this.o=null,this.B=function(){return oh(s)},this.C=function(e,t){switch((e=Kd(t)).type){case"event":var n=e.targetName,i=$r(e.event);s.A(n,i);break;case"update":for(i in n=e.update)for(var r in e=s.g[i]||{},n[i])e[r]=n[i][r];s.s&&(s.L(),s.s=!1);break;case"asyncComplete":if(i=e.id,r=e.error,e=s.i[i],delete s.i[i],e)if(r){for(n in i=new De(r.severity,r.category,r.code),r)i[n]=r[n];e.reject(i)}else e.resolve()}},this.g={video:{},player:{}},this.H=0,this.i={},this.j=null,fh.add(this)}function ih(e,t){var n=e.M();dh=t,t.addUpdateListener(e.B),t.addMessageListener("urn:x-cast:com.google.shaka.v2",e.C),oh(e),uh(e,{type:"init",initState:n,appData:e.o}),e.j.resolve()}function rh(e,t){var n=8003;switch(t.code){case"cancel":n=8004;break;case"timeout":n=8005;break;case"receiver_unavailable":n=8006}e.j.reject(new De(2,8,n,t))}function ah(e){var t=dh;t.removeUpdateListener(e.B),t.removeMessageListener("urn:x-cast:com.google.shaka.v2",e.C)}function oh(e){var t=!!dh&&"connected"==dh.status;if(e.h&&!t){for(var n in e.F(),e.g)e.g[n]={};sh(e)}e.h=t,e.I=t?dh.receiver.friendlyName:"",e.l.hc()}function sh(e){for(var t in e.i){var n=e.i[t];delete e.i[t],n.reject(new De(1,7,7e3))}}function uh(e,t){t=Gd(t);var n=dh;try{n.sendMessage("urn:x-cast:com.google.shaka.v2",t,(function(){}),J)}catch(i){throw t=new De(2,8,8005,i),n=new Jr("error",(new Map).set("detail",t)),e.A("player",n),e.Lc(),t}}(i=nh.prototype).destroy=function(){return fh.delete(this),sh(this),dh&&ah(this),this.l&&(this.l.stop(),this.l=null),this.F=this.A=null,this.h=this.m=!1,this.C=this.B=this.j=this.i=this.g=this.o=null,Promise.resolve()},i.jb=function(){return this.h},i.Jf=function(){return this.I},i.init=function(){if(this.G.length)if(e.chrome&&chrome.cast&&chrome.cast.isAvailable){this.m=!0,this.l.hc();var t=new chrome.cast.SessionRequest(this.G,[],null,this.K,null);t=new chrome.cast.ApiConfig(t,(function(e){for(var t=l(fh),n=t.next();!n.done;n=t.next()){var i=e;(n=n.value).j=new Gr,n.s=!0,ih(n,i)}}),(function(e){for(var t=l(fh),n=t.next();!n.done;n=t.next())n=n.value,ch="available"==e,n.l.hc()}),"origin_scoped"),chrome.cast.initialize(t,(function(){}),(function(){})),ch&&this.l.$(lh),(t=dh)&&t.status!=chrome.cast.SessionStatus.STOPPED?(this.j=new Gr,this.s=!0,ih(this,t)):dh=null}else e.__onGCastApiAvailable!==ph&&(hh=e.__onGCastApiAvailable||null,e.__onGCastApiAvailable=ph)},i.Rf=function(e){this.o=e,this.h&&uh(this,{type:"appData",appData:this.o})},i.cast=function(){var e=this;return P((function(t){if(!e.m)throw new De(1,8,8e3);if(!ch)throw new De(1,8,8001);if(e.h)throw new De(1,8,8002);return e.j=new Gr,chrome.cast.requestSession((function(t){return ih(e,t)}),(function(t){return rh(e,t)})),w(t,e.j,0)}))},i.Lc=function(){if(this.h){if(sh(this),dh){ah(this);try{dh.stop((function(){}),(function(){}))}catch(e){}dh=null}oh(this)}},i.get=function(e,t){var n=this;if("video"==e){if(Wd.includes(t))return function(){return n.Xg.apply(n,[e,t].concat(c(L.apply(0,arguments))))}}else if("player"==e){if($d[t]&&!this.get("player","isLive")())return function(){};if(eh.includes(t))return function(){return n.Xg.apply(n,[e,t].concat(c(L.apply(0,arguments))))};if(th.includes(t))return function(){return n.Oi.apply(n,[e,t].concat(c(L.apply(0,arguments))))};if(Yd[t]||Jd[t])return function(){return n.g[e][t]}}return this.g[e][t]},i.set=function(e,t,n){this.g[e][t]=n,uh(this,{type:"set",targetName:e,property:t,value:n})},i.Xg=function(e,t){uh(this,{type:"call",targetName:e,methodName:t,args:L.apply(2,arguments)})},i.Oi=function(e,t){var n=L.apply(2,arguments),i=new Gr,r=this.H.toString();this.H++,this.i[r]=i;try{uh(this,{type:"asyncCall",targetName:e,methodName:t,args:n,id:r})}catch(e){i.reject(e)}return i};var lh=.02,ch=!1,dh=null,hh=null,fh=new Set;function ph(t){if(hh?e.__onGCastApiAvailable=hh:delete e.__onGCastApiAvailable,hh=null,t)for(var n=l(fh),i=n.next();!i.done;i=n.next())i.value.init();"function"==typeof e.__onGCastApiAvailable&&e.__onGCastApiAvailable(t)}function gh(e,t,n,i){i=void 0!==i&&i,Zr.call(this);var r=this;this.i=e,this.h=t,this.m=this.o=this.j=this.s=this.l=null,this.C=n,this.B=i,this.A=new Map,this.g=new nh(n,(function(){return yh(r)}),(function(){return bh(r)}),(function(e,t){return Sh(r,e,t)}),(function(){return wh(r)}),(function(){return vh(r)}),i),function(e){e.g.init(),e.m=new Z;for(var t=l(Xd),n=t.next();!n.done;n=t.next())e.m.D(e.i,n.value,(function(t){e.g.jb()||(t=$r(t),e.j.dispatchEvent(t))}));for(var i in Qr)e.m.D(e.h,Qr[i],(function(t){e.g.jb()||e.o.dispatchEvent(t)}));for(var r in e.l={},t={},e.i)(t={pd:t.pd}).pd=r,Object.defineProperty(e.l,t.pd,{configurable:!1,enumerable:!0,get:function(t){return function(){return Th(e,t.pd)}}(t),set:function(t){return function(n){var i=t.pd;e.g.jb()?e.g.set("video",i,n):e.i[i]=n}}(t)});e.s={},mh(e,(function(t){Object.defineProperty(e.s,t,{configurable:!1,enumerable:!0,get:function(){return function(e,t){if(e.A.has(t)&&(t=e.A.get(t)),"addEventListener"==t)return function(t,n,i){return e.o.addEventListener(t,n,i)};if("removeEventListener"==t)return function(t,n,i){return e.o.removeEventListener(t,n,i)};if("getMediaElement"==t)return function(){return e.l};if("getSharedConfiguration"==t)return e.g.get("player","getConfiguration");if("getNetworkingEngine"==t)return function(){return e.h.Ab()};if("getDrmEngine"==t)return function(){return e.h.C};if("getAdManager"==t)return function(){return e.h.xg()};if("setVideoContainer"==t)return function(t){return e.h.kh(t)};if(e.g.jb()){if("getManifest"==t||"drmInfo"==t)return function(){return W(t+"() does not work while casting!"),null};if("attach"==t||"detach"==t)return function(){return W(t+"() does not work while casting!"),Promise.resolve()}}return e.g.jb()&&0==Object.keys(e.g.g.video).length&&(Yd[t]||Jd[t])||!e.g.jb()?e.h[t].bind(e.h):e.g.get("player",t)}(e,t)}})})),function(e){var t=new Map;mh(e,(function(n,i){t.has(i)?(i=t.get(i),n.length<i.length?e.A.set(n,i):e.A.set(i,n)):t.set(i,n)}))}(e),e.j=new Zr,e.j.re=e.l,e.o=new Zr,e.o.re=e.s}(this)}function mh(e,t){function n(e){return"constructor"!=e&&"function"==typeof r[e]&&!a.has(e)}var i,r=e.h,a=new Set;for(i in r)n(i)&&(a.add(i),t(i,r[i]));for(e=Object.getPrototypeOf(r),i=Object.getPrototypeOf({});e&&e!=i;){for(var o=l(Object.getOwnPropertyNames(e)),s=o.next();!s.done;s=o.next())n(s=s.value)&&(a.add(s),t(s,r[s]));e=Object.getPrototypeOf(e)}}function vh(e){var t={video:{},player:{},playerAfterLoad:{},manifest:e.h.Mc(),startTime:null};e.i.pause();for(var n=l(zd),i=n.next();!i.done;i=n.next())i=i.value,t.video[i]=e.i[i];for(e.i.ended||(t.startTime=e.i.currentTime),i=(n=l(Qd)).next();!i.done;i=n.next()){var r=i.value;i=r[1],r=e.h[r[0]](),t.player[i]=r}for(i=(n=l(Zd)).next();!i.done;i=n.next())i=(r=i.value)[1],r=e.h[r[0]](),t.playerAfterLoad[i]=r;return t}function yh(e){var t=new Jr("caststatuschanged");e.dispatchEvent(t)}function bh(e){var t=new Jr(e.l.paused?"pause":"play");e.j.dispatchEvent(t)}function wh(e){for(var t=l(Qd),n=t.next();!n.done;n=t.next()){var i=n.value;n=i[1],i=e.g.get("player",i[0])(),e.h[n](i)}var r=e.g.get("player","getAssetUri")();i=e.g.get("video","ended"),t=Promise.resolve();var a,o=e.i.autoplay;n=null,i||(n=e.g.get("video","currentTime")),(i=e.g.get("player","getTextTracks")())&&i.length&&(a=i.find((function(e){return e.active})));var s=e.g.get("player","isTextTrackVisible")();r&&(e.i.autoplay=!1,t=e.h.load(r,n));var u={};for(i=(n=l(zd)).next();!i.done;i=n.next())i=i.value,u[i]=e.g.get("video",i);t.then((function(){if(e.i){for(var t=l(zd),n=t.next();!n.done;n=t.next())n=n.value,e.i[n]=u[n];for(n=(t=l(Zd)).next();!n.done;n=t.next()){var i=n.value;n=i[1],i=e.g.get("player",i[0])(),e.h[n](i)}e.h.hh(s),a&&e.h.Pf(a.language,a.roles,a.forced),e.i.autoplay=o,r&&e.i.play()}}),(function(t){t=new Jr("error",t=(new Map).set("detail",t)),e.h.dispatchEvent(t)}))}function Th(e,t){if("addEventListener"==t)return function(t,n,i){return e.j.addEventListener(t,n,i)};if("removeEventListener"==t)return function(t,n,i){return e.j.removeEventListener(t,n,i)};if(e.g.jb()&&0==Object.keys(e.g.g.video).length){var n=e.i[t];if("function"!=typeof n)return n}return e.g.jb()?e.g.get("video",t):("function"==typeof(t=e.i[t])&&(t=t.bind(e.i)),t)}function Sh(e,t,n){e.g.jb()&&("video"==t?e.j.dispatchEvent(n):"player"==t&&e.o.dispatchEvent(n))}function xh(e,t,n,i){Zr.call(this);var r=this;this.g=e,this.h=t,this.j=new Z,this.H={video:e,player:t},this.F=n||function(){},this.I=i||function(e){return e},this.i=null,this.G=!1,this.o=!0,this.m=0,this.B=!1,this.A=!0,this.s=this.l=null,this.C=new Be((function(){Ih(r)})),function(e){var t=cast.receiver.CastReceiverManager.getInstance();t.onSenderConnected=function(){return Ah(e)},t.onSenderDisconnected=function(){return Ah(e)},t.onSystemVolumeChanged=function(){var t=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();t&&Rh(e,{type:"update",update:{video:{volume:t.level,muted:t.muted}}},e.l),Rh(e,{type:"event",targetName:"video",event:{type:"volumechange"}},e.l)},e.s=t.getCastMessageBus("urn:x-cast:com.google.cast.media"),e.s.onMessage=function(t){return function(e,t){var n=Kd(t.data);switch(n.type){case"PLAY":e.g.play(),Ph(e);break;case"PAUSE":e.g.pause(),Ph(e);break;case"SEEK":t=n.currentTime;var i=n.resumeState;null!=t&&(e.g.currentTime=Number(t)),i&&"PLAYBACK_START"==i?(e.g.play(),Ph(e)):i&&"PLAYBACK_PAUSE"==i&&(e.g.pause(),Ph(e));break;case"STOP":e.h.ic().then((function(){e.h&&Ph(e)}));break;case"GET_STATUS":Ch(e,Number(n.requestId));break;case"VOLUME":t=(i=n.volume).level,i=i.muted;var r=e.g.volume,a=e.g.muted;null!=t&&(e.g.volume=Number(t)),null!=i&&(e.g.muted=i),r==e.g.volume&&a==e.g.muted||Ph(e);break;case"LOAD":e.m=0,e.B=!1,e.A=!1,t=n.media,i=n.currentTime,r=e.I(t.contentId),a=n.autoplay||!0,e.F(t.customData),a&&(e.g.autoplay=!0),e.h.load(r,i).then((function(){e.h&&Ch(e)})).catch((function(t){var i="LOAD_FAILED";7==t.category&&7e3==t.code&&(i="LOAD_CANCELLED"),Rh(e,{requestId:Number(n.requestId),type:i},e.s)}));break;default:Rh(e,{requestId:Number(n.requestId),type:"INVALID_REQUEST",reason:"INVALID_COMMAND"},e.s)}}(e,t)},e.l=t.getCastMessageBus("urn:x-cast:com.google.shaka.v2"),e.l.onMessage=function(t){return function(e,t){var n=Kd(t.data);switch(n.type){case"init":e.m=0,e.B=!1,e.A=!0,function(e,t,n){var i,r,a,o,s,u,l,c,d,h;P((function(f){switch(f.g){case 1:for(i in t.player)r=t.player[i],e.h[i](r);return e.F(n),a=e.g.autoplay,t.manifest?(e.g.autoplay=!1,S(f,5),w(f,e.h.load(t.manifest,t.startTime),7)):w(f,Promise.resolve(),3);case 7:A(f,3);break;case 5:return o=E(f),s=(new Map).set("detail",o),u=new Jr("error",s),e.h&&e.h.dispatchEvent(u),f.return();case 3:if(!e.h)return f.return();for(l in t.video)c=t.video[l],e.g[l]=c;for(d in t.playerAfterLoad)h=t.playerAfterLoad[d],e.h[d](h);e.g.autoplay=a,t.manifest&&(e.g.play(),Ph(e)),T(f)}}))}(e,n.initState,n.appData),Ih(e);break;case"appData":e.F(n.appData);break;case"set":var i=n.targetName,r=n.property;if(n=n.value,"video"==i){if(t=cast.receiver.CastReceiverManager.getInstance(),"volume"==r){t.setSystemVolumeLevel(n);break}if("muted"==r){t.setSystemVolumeMuted(n);break}}e.H[i][r]=n;break;case"call":(i=e.H[n.targetName])[n.methodName].apply(i,n.args);break;case"asyncCall":i=n.targetName,r=n.methodName,"player"==i&&"load"==r&&(e.m=0,e.B=!1);var a=n.id,o=t.senderId;n=(t=e.H[i])[r].apply(t,n.args),"player"==i&&"load"==r&&(n=n.then((function(){e.A=!0}))),n.then((function(){return Dh(e,o,a,null)}),(function(t){return Dh(e,o,a,t)}))}}(e,t)},t.start();for(var n=(t=l(Xd)).next();!n.done;n=t.next())e.j.D(e.g,n.value,(function(t){return kh(e,"video",t)}));for(var i in Qr)e.j.D(e.h,Qr[i],(function(t){return kh(e,"player",t)}));e.j.D(e.g,"loadeddata",(function(){e.B=!0})),e.j.D(e.h,"loading",(function(){e.o=!1,Eh(e)})),e.j.D(e.g,"playing",(function(){e.o=!1,Eh(e)})),e.j.D(e.g,"pause",(function(){Eh(e)})),e.j.D(e.h,"unloading",(function(){e.o=!0,Eh(e)})),e.j.D(e.g,"ended",(function(){new Be((function(){e.g&&e.g.ended&&(e.o=!0,Eh(e))})).$(Nh)}))}(this)}function Ah(e){e.m=0,e.A=!0,e.G=0!=cast.receiver.CastReceiverManager.getInstance().getSenders().length,Eh(e)}function Eh(e){var t;P((function(n){return 1==n.g?w(n,Promise.resolve(),2):e.h?(t=new Jr("caststatuschanged"),e.dispatchEvent(t),Mh(e)||Ph(e),void T(n)):n.return()}))}function kh(e,t,n){e.h&&(Ih(e),Rh(e,{type:"event",targetName:t,event:n},e.l))}function Ih(e){e.C.$(Lh);for(var t={video:{},player:{}},n=l(qd),i=n.next();!i.done;i=n.next())i=i.value,t.video[i]=e.g[i];if(e.h.U())for(var r in $d)0==e.m%$d[r]&&(t.player[r]=e.h[r]());for(var a in Yd)0==e.m%Yd[a]&&(t.player[a]=e.h[a]());for(var o in(n=cast.receiver.CastReceiverManager.getInstance().getSystemVolume())&&(t.video.volume=n.level,t.video.muted=n.muted),Rh(e,{type:"update",update:t},e.l),Jd)0==e.m%Jd[o]&&((t={player:{}}).player[o]=e.h[o](),Rh(e,{type:"update",update:t},e.l));e.B&&(e.m+=1),Mh(e)}function Mh(e){return!(!e.A||!e.g.duration&&!e.h.U()||(Ch(e),e.A=!1,0))}function Ch(e,t){var n={contentId:e.h.Mc(),streamType:e.h.U()?"LIVE":"BUFFERED",contentType:""};e.h.U()||(n.duration=e.g.duration),e.i&&(n.metadata=e.i),Ph(e,void 0===t?0:t,n)}function Dh(e,t,n,i){e.h&&Rh(e,{type:"asyncComplete",id:n,error:i},e.l,t)}function Rh(e,t,n,i){e.G&&(e=Gd(t),i?n.getCastChannel(i).send(e):n.broadcast(e))}function Ph(e,t,n){n=void 0===n?null:n;var i={mediaSessionId:0,playbackRate:e.g.playbackRate,playerState:e.o?jh:e.h.tf()?Uh:e.g.paused?_h:Oh,currentTime:e.g.currentTime,supportedMediaCommands:63,volume:{level:e.g.volume,muted:e.g.muted}};n&&(i.media=n),Rh(e,{requestId:void 0===t?0:t,type:"MEDIA_STATUS",status:[i]},e.s)}m(gh,Zr),(i=gh.prototype).destroy=function(e){return e&&this.g.Lc(),this.m&&(this.m.release(),this.m=null),e=[],this.h&&(e.push(this.h.destroy()),this.h=null),this.g&&(e.push(this.g.destroy()),this.g=null),this.s=this.l=this.i=null,Zr.prototype.release.call(this),Promise.all(e)},i.ji=function(){return this.l},i.Zh=function(){return this.s},i.Dh=function(){return this.g.m&&ch},i.jb=function(){return this.g.jb()},i.Jf=function(){return this.g.Jf()},i.cast=function(){var e=this;return P((function(t){return 1==t.g?w(t,e.g.cast(),2):e.h?w(t,e.h.ic(),0):t.return()}))},i.Rf=function(e){this.g.Rf(e)},i.dj=function(){var e;(e=this.g).h&&chrome.cast.requestSession((function(t){return ih(e,t)}),(function(t){return rh(e,t)}))},i.Lc=function(){this.g.Lc()},i.Eh=function(e,t){t=void 0!==t&&t;var n=this;return P((function(i){if(1==i.g)return e==n.C&&t==n.B?i.return():(n.C=e,n.B=t,n.g.Lc(),w(i,n.g.destroy(),2));n.g=null,n.g=new nh(e,(function(){return yh(n)}),(function(){return bh(n)}),(function(e,t){return Sh(n,e,t)}),(function(){return wh(n)}),(function(){return vh(n)}),t),n.g.init(),T(i)}))},F("shaka.cast.CastProxy",gh),gh.prototype.changeReceiverId=gh.prototype.Eh,gh.prototype.forceDisconnect=gh.prototype.Lc,gh.prototype.suggestDisconnect=gh.prototype.dj,gh.prototype.setAppData=gh.prototype.Rf,gh.prototype.cast=gh.prototype.cast,gh.prototype.receiverName=gh.prototype.Jf,gh.prototype.isCasting=gh.prototype.jb,gh.prototype.canCast=gh.prototype.Dh,gh.prototype.getPlayer=gh.prototype.Zh,gh.prototype.getVideo=gh.prototype.ji,gh.prototype.destroy=gh.prototype.destroy,m(xh,Zr),(i=xh.prototype).isConnected=function(){return this.G},i.ri=function(){return this.o},i.$i=function(e){this.i=e},i.Gh=function(){this.i=null},i.aj=function(e){this.i||(this.i={metadataType:cast.receiver.media.MetadataType.GENERIC}),this.i.title=e},i.Zi=function(e){this.i||(this.i={metadataType:cast.receiver.media.MetadataType.GENERIC}),this.i.images=[{url:e}]},i.Yi=function(e){this.i||(this.i={}),this.i.artist=e,this.i.metadataType=cast.receiver.media.MetadataType.MUSIC_TRACK},i.destroy=function(){var e,t=this;return P((function(n){if(1==n.g)return t.j&&(t.j.release(),t.j=null),e=[],t.h&&(e.push(t.h.destroy()),t.h=null),t.C&&(t.C.stop(),t.C=null),t.g=null,t.H=null,t.F=null,t.G=!1,t.o=!0,t.l=null,t.s=null,Zr.prototype.release.call(t),w(n,Promise.all(e),2);cast.receiver.CastReceiverManager.getInstance().stop(),T(n)}))},F("shaka.cast.CastReceiver",xh),xh.prototype.destroy=xh.prototype.destroy,xh.prototype.setContentArtist=xh.prototype.Yi,xh.prototype.setContentImage=xh.prototype.Zi,xh.prototype.setContentTitle=xh.prototype.aj,xh.prototype.clearContentMetadata=xh.prototype.Gh,xh.prototype.setContentMetadata=xh.prototype.$i,xh.prototype.isIdle=xh.prototype.ri,xh.prototype.isConnected=xh.prototype.isConnected;var Lh=.5,Nh=5,jh="IDLE",Oh="PLAYING",Uh="BUFFERING",_h="PAUSED";function Bh(e,t,n,i,r){if(i>=r)return null;for(var a=-1,o=-1,s=0;s<n.length;s++)if(n[s].some((function(e){return null!=e&&""!=e.g.trim()}))){a=s;break}for(s=n.length-1;0<=s;s--)if(n[s].some((function(e){return null!=e&&""!=e.g.trim()}))){o=s;break}if(-1===a||-1===o)return null;for(var u=s=!1,l="white",c="black",d=Fh(i,r,s,u,l,c);a<=o;a++){for(var h=n[a],f=-1,p=-1,g=0;g<h.length;g++)if(null!=h[g]&&""!==h[g].g.trim()){f=g;break}for(g=h.length-1;0<=g;g--)if(null!=h[g]&&""!==h[g].g.trim()){p=g;break}if(-1===f||-1===p)h=Vh(i,r),e.nestedCues.push(h);else{for(;f<=p;f++)if(g=h[f]){var m=g.l,v=g.i,y=g.j,b=g.h;m==s&&v==u&&y==l&&b==c||(d.payload&&e.nestedCues.push(d),d=Fh(i,r,m,v,y,b),s=m,u=v,l=y,c=b),d.payload+=g.g}else d.payload+=" ";d.payload&&e.nestedCues.push(d),a!==o&&(d=Vh(i,r),e.nestedCues.push(d)),d=Fh(i,r,s,u,l,c)}}return e.nestedCues.length?{cue:e,stream:t}:null}function Fh(e,t,n,i,r,a){return e=new un(e,t,""),n&&e.textDecoration.push(Pn),i&&(e.fontStyle=Dn),e.color=r,e.backgroundColor=a,e}function Vh(e,t){return(e=new un(e,t,"")).lineBreak=!0,e}function Hh(e,t,n,i,r){this.g=e,this.l=t,this.i=n,this.h=i,this.j=r}function Gh(e,t){this.i=[],this.g=1,this.h=0,this.C=e,this.B=t,this.j=this.m=!1,this.l="white",this.o="black",this.s=this.A=null,Xh(this)}function Kh(e,t,n){var i="CC"+(1+(e.C<<1|e.B)),r=new un(t,n,"");r.lineInterpretation=1;var a=Zh.get(e.g);return a&&(r.line=a),null!=e.s&&null!=e.A&&(r.position=10+Math.min(70,10*e.s)+2.5*e.A),(t=Bh(r,i,e.i,t,n))&&15<e.g+t.cue.nestedCues.length-3&&(a=Zh.get(e.g+3-t.cue.nestedCues.length))&&(r.line=a),t}function Xh(e){Wh(e,0,15),e.g=1}function qh(e,t,n){if(!(32>n||127<n)){var i="";switch(t){case 0:i=Yh.has(n)?Yh.get(n):String.fromCharCode(n);break;case 1:i=Jh.get(n);break;case 2:e.i[e.g].pop(),i=$h.get(n);break;case 3:e.i[e.g].pop(),i=Qh.get(n)}i&&e.i[e.g].push(new Hh(i,e.m,e.j,e.o,e.l))}}function zh(e,t,n,i){if(!(0>n||0>t))if(t>=n)for(--i;0<=i;i--)e.i[t+i]=e.i[n+i].map((function(e){return e}));else for(var r=0;r<i;r++)e.i[t+r]=e.i[n+r].map((function(e){return e}))}function Wh(e,t,n){for(var i=0;i<=n;i++)e.i[t+i]=[]}var Yh=new Map([[39,"’"],[42,"á"],[92,"é"],[92,"é"],[94,"í"],[95,"ó"],[96,"ú"],[123,"ç"],[124,"÷"],[125,"Ñ"],[126,"ñ"],[127,"█"]]),Jh=new Map([[48,"®"],[49,"°"],[50,"½"],[51,"¿"],[52,"™"],[53,"¢"],[54,"£"],[55,"♪"],[56,"à"],[57," "],[58,"è"],[59,"â"],[60,"ê"],[61,"î"],[62,"ô"],[63,"û"]]),$h=new Map([[32,"Á"],[33,"É"],[34,"Ó"],[35,"Ú"],[36,"Ü"],[37,"ü"],[38,"‘"],[39,"¡"],[40,"*"],[41,"'"],[42,"─"],[43,"©"],[44,"℠"],[45,"·"],[46,"“"],[47,"”"],[48,"À"],[49,"Â"],[50,"Ç"],[51,"È"],[52,"Ê"],[53,"Ë"],[54,"ë"],[55,"Î"],[56,"Ï"],[57,"ï"],[58,"Ô"],[59,"Ù"],[60,"ù"],[61,"Û"],[62,"«"],[63,"»"]]),Qh=new Map([[32,"Ã"],[33,"ã"],[34,"Í"],[35,"Ì"],[36,"ì"],[37,"Ò"],[38,"ò"],[39,"Õ"],[40,"õ"],[41,"{"],[42,"}"],[43,"\\"],[44,"^"],[45,"_"],[46,"|"],[47,"~"],[48,"Ä"],[49,"ä"],[50,"Ö"],[51,"ö"],[52,"ß"],[53,"¥"],[54,"¤"],[55,"│"],[56,"Å"],[57,"å"],[58,"Ø"],[59,"ø"],[60,"┌"],[61,"┐"],[62,"└"],[63,"┘"]]),Zh=new Map([[1,10],[2,15.33],[3,20.66],[4,26],[5,31.33],[6,36.66],[7,42],[8,47.33],[9,52.66],[10,58],[11,63.33],[12,68.66],[13,74],[14,79.33],[15,84.66]]);function ef(e,t){this.h=0,this.o=new Gh(e,t),this.i=new Gh(e,t),this.g=this.j=new Gh(e,t),this.l=0,this.m=null}function tf(e,t,n){e.g=e.i;var i=e.g,r=null;return 3!==e.h&&4!==e.h&&(r=Kh(i,e.l,n),(n=e.i).g=0<n.h?n.h:0,Wh(n,0,15),(n=e.j).g=0<n.h?n.h:0,Wh(n,0,15),i.g=15),e.h=3,i.h=t,r}function nf(e){e.h=1,e.g=e.j,e.g.h=0}function rf(e){Y("Cea608DataChannel","CEA-608 text mode entered, but is unsupported"),e.g=e.o,e.h=4}var af="black green blue cyan red yellow magenta black".split(" "),of="white green blue cyan red yellow magenta white_italics".split(" ");function sf(e,t){this.I=t,this.M=e,this.K=this.l=!1,this.m=this.o=this.G=this.L=this.H=0,this.F=2,this.i=[],this.g=this.h=this.j=0,this.C=this.A=!1,this.B="white",this.s="black",uf(this)}function uf(e){e.i=[];for(var t=0;16>t;t++)e.i.push(lf())}function lf(){for(var e=[],t=0;42>t;t++)e.push(null);return e}function cf(e,t){df(e)&&(e.i[e.h][e.g]=new Hh(t,e.C,e.A,e.s,e.B),e.g++)}function df(e){var t=e.g<e.m&&0<=e.g;return e.h<e.o&&0<=e.h&&t}function hf(e,t,n){var i=new un(e.j,t,"");i.textAlign=0===e.F?"left":1===e.F?"right":mn;var r=i.region;switch(e.I&&(r.id+="svc"+e.I),r.id+="win"+e.M,r.height=e.o,r.width=e.m,r.heightUnits=2,r.widthUnits=2,r.viewportAnchorX=e.H,r.viewportAnchorY=e.L,r.viewportAnchorUnits=e.K?Ae:2,e.G){case 0:r.regionAnchorX=0,r.regionAnchorY=0;break;case 1:r.regionAnchorX=50,r.regionAnchorY=0;break;case 2:r.regionAnchorX=100,r.regionAnchorY=0;break;case 3:r.regionAnchorX=0,r.regionAnchorY=50;break;case 4:r.regionAnchorX=50,r.regionAnchorY=50;break;case 5:r.regionAnchorX=100,r.regionAnchorY=50;break;case 6:r.regionAnchorX=0,r.regionAnchorY=100;break;case 7:r.regionAnchorX=50,r.regionAnchorY=100;break;case 8:r.regionAnchorX=100,r.regionAnchorY=100}return(n=Bh(i,"svc"+n,e.i,e.j,t))&&(e.j=t),n}function ff(){this.i=[],this.h=null,this.g=0}function pf(e,t){3===t.type?(e.g=2*(63&t.value)-1,e.h=[]):e.h&&(0<e.g&&(e.h.push(t),e.g--),0===e.g&&(e.i.push(new gf(e.h)),e.h=null,e.g=0))}function gf(e){this.g=0,this.h=e}function mf(e){if(!e.sa())throw new De(2,2,3e3);return e.h[e.g++]}function vf(e){this.i=e,this.h=[null,null,null,null,null,null,null,null],this.g=null}function yf(e,t,n,i){if(128<=n&&135>=n)i=7&n,e.h[i]&&(e.g=e.h[i]);else{if(136===n){n=mf(t).value,t=null;for(var r=(n=l(bf(e,n))).next();!r.done;r=n.next())(r=e.h[r.value]).isVisible()&&(t=hf(r,i,e.i)),uf(r);return t}if(137===n)for(n=(t=l(bf(e,t=mf(t).value))).next();!n.done;n=t.next())(n=e.h[n.value]).isVisible()||(n.j=i),n.display();else{if(138===n){for(n=mf(t).value,t=null,r=(n=l(bf(e,n))).next();!r.done;r=n.next())(r=e.h[r.value]).isVisible()&&(t=hf(r,i,e.i)),r.l=!1;return t}if(139===n){for(n=mf(t).value,t=null,r=(n=l(bf(e,n))).next();!r.done;r=n.next())(r=e.h[r.value]).isVisible()?t=hf(r,i,e.i):r.j=i,r.l=!r.l;return t}if(140===n)return wf(e,t=mf(t).value,i);if(143===n)return i=wf(e,255,i),Tf(e),i;if(144===n)t.skip(1),i=mf(t).value,e.g&&(e.g.A=0<(128&i),e.g.C=0<(64&i));else if(145===n)i=mf(t).value,n=mf(t).value,t.skip(1),e.g&&(t=Sf((48&n)>>4,(12&n)>>2,3&n),e.g.B=Sf((48&i)>>4,(12&i)>>2,3&i),e.g.s=t);else if(146===n)i=mf(t).value,t=mf(t).value,e.g&&((e=e.g).h=15&i,e.g=63&t);else if(151===n)t.skip(1),t.skip(1),i=mf(t).value,t.skip(1),e.g&&(e.g.F=3&i);else if(152<=n&&159>=n){if(n=(15&n)-8,!(r=null!==e.h[n])){var a=new sf(n,e.i);a.j=i,e.h[n]=a}i=mf(t).value,a=mf(t).value;var o=mf(t).value,s=mf(t).value,u=mf(t).value;t=mf(t).value,r&&!(7&t)||((t=e.h[n]).h=0,t.g=0,t.C=!1,t.A=!1,t.B="white",t.s="black"),(t=e.h[n]).l=0<(32&i),t.L=127&a,t.H=o,t.G=(240&s)>>4,t.K=0<(128&a),t.o=1+(15&s),t.m=1+(63&u),e.g=e.h[n]}}}return null}function bf(e,t){for(var n=[],i=0;8>i;i++)!(1&~t)&&e.h[i]&&n.push(i),t>>=1;return n}function wf(e,t,n){for(var i=null,r=(t=l(bf(e,t))).next();!r.done;r=t.next()){r=r.value;var a=e.h[r];a.isVisible()&&(i=hf(a,n,e.i)),e.h[r]=null}return i}function Tf(e){e.g=null,e.h=[null,null,null,null,null,null,null,null]}function Sf(e,t,n){var i={0:0,1:0,2:1,3:1};return Af[(e=i[e])<<2|(t=i[t])<<1|(n=i[n])]}sf.prototype.isVisible=function(){return this.l},sf.prototype.display=function(){this.l=!0},gf.prototype.sa=function(){return this.g<this.h.length},gf.prototype.ya=function(){return this.g},gf.prototype.skip=function(e){if(this.g+e>this.h.length)throw new De(2,2,3e3);this.g+=e};var xf=new Map([[32," "],[33," "],[37,"…"],[42,"Š"],[44,"Œ"],[48,"█"],[49,"‘"],[50,"’"],[51,"“"],[52,"”"],[53,"•"],[57,"™"],[58,"š"],[60,"œ"],[61,"℠"],[63,"Ÿ"],[118,"⅛"],[119,"⅜"],[120,"⅝"],[121,"⅞"],[122,"│"],[123,"┐"],[124,"└"],[125,"─"],[126,"┘"],[127,"┌"]]),Af="black blue green cyan red magenta yellow white".split(" ");function Ef(){this.h=[],this.g=[],this.i=new ff,this.l=0,this.m=new Map([["CC1",new ef(0,0)],["CC2",new ef(0,1)],["CC3",new ef(1,0)],["CC4",new ef(1,1)]]),this.s=this.o=0,this.j=new Map,this.B=!0,this.A=new Set,kf(this)}function kf(e){e.o=0,e.s=0;for(var t=l(e.m.values()),n=t.next();!n.done;n=t.next())(n=n.value).h=0,n.g=n.j,n.m=null,Xh(n.i),Xh(n.j),Xh(n.o);e.B=!0}function If(e,t){var n=t.type;if(16==(112&t.gb)){var i=t.gb>>3&1;0===n?e.o=i:e.s=i}if(i="CC"+(1+(n<<1|(n?e.s:e.o))),n=e.m.get(i),255===t.gb&&255===t.Eb||!t.gb&&!t.Eb||!Cf(t.gb)||!Cf(t.Eb))return 45<=++e.l&&kf(e),null;e.l=0,t.gb&=127,t.Eb&=127;var r=t.gb;if(1<=r&&15>=r||!t.gb&&!t.Eb)return null;if(r=null,16==(112&t.gb))e:{if(e.A.add(i),i=t.gb,e=t.Eb,n.m===(i<<8|e))n.m=null;else if(n.m=i<<8|e,16==(240&i)&&64==(192&e)){t=[11,11,1,2,3,4,12,13,14,15,5,6,7,8,9,10][(7&i)<<1|e>>5&1],i="white",r=!1;var a=null,o=95<e?e-96:e-64;13>=o?i=of[Math.floor(o/2)]:15>=o?r=!0:a=Math.floor((o-16)/2),e=!(1&~e),4!==n.h&&(o=n.g,3===n.h&&t!==o.g&&(zh(o,n=1+t-o.h,1+o.g-o.h,o.h),Wh(o,0,n-1),Wh(o,t+1,15-t)),o.g=t,o.m=e,o.j=r,o.l=i,o.s=a,o.o="black")}else if(17==(247&i)&&32==(240&e))n.g.m=!1,n.g.j=!1,n.g.l="white",qh(n.g,0,32),i=!1,"white_italics"===(t=of[(14&e)>>1])&&(t="white",i=!0),n.g.m=!(1&~e),n.g.j=i,n.g.l=t;else if(16==(247&i)&&32==(240&e)||23==(247&i)&&45==(255&e))t="black",!(7&i)&&(t=af[(14&e)>>1]),n.g.o=t;else if(17==(247&i)&&48==(240&e))qh(n.g,1,e);else if(18==(246&i)&&32==(224&e))qh(n.g,1&i?3:2,e);else{if(20==(246&i)&&32==(240&e)){switch(e=t.pts,i=null,t.Eb){case 32:nf(n);break;case 33:(n=n.g).i[n.g].pop();break;case 37:i=tf(n,2,e);break;case 38:i=tf(n,3,e);break;case 39:i=tf(n,4,e);break;case 40:qh(n.g,0,32);break;case 41:n.h=2,n.g=n.i,n.g.h=0,n.l=e;break;case 42:Xh(n.o),rf(n);break;case 43:rf(n);break;case 44:t=n.i,i=null,4!==n.h&&(i=Kh(t,n.l,e)),Wh(t,0,15);break;case 45:t=n.g,3!==n.h?i=null:(i=Kh(t,n.l,e),zh(t,(r=t.g-t.h+1)-1,r,t.h),Wh(t,0,r-1),Wh(t,t.g,15-t.g),n.l=e);break;case 46:Wh(n.j,0,15);break;case 47:t=null,4!==n.h&&(t=Kh(n.i,n.l,e)),i=n.j,n.j=n.i,n.i=i,nf(n),n.l=e,i=t}r=i;break e}(23==i||31==i)&&33<=e&&35>=e&&(n.g.A=e-32)}r=null}else e=t.Eb,qh(n.g,0,t.gb),qh(n.g,0,e);return r}function Mf(e,t){var n=[];try{for(;t.sa();){var i=mf(t).value,r=(224&i)>>5,a=31&i;if(7===r&&0!=a&&(r=63&mf(t).value),0!=r){e.A.add("svc"+r),e.j.has(r)||e.j.set(r,new vf(r));for(var o=e.j.get(r),s=t.ya();t.ya()-s<a;){r=o;var u=t,l=mf(u),c=l.value,d=l.pts;if(16===c&&(c=c<<16|mf(u).value),0<=c&&31>=c){var h=c,f=d;if((u=r).g){var p=u.g;switch(r=null,h){case 8:!df(p)||0>=p.g&&0>=p.h||(0>=p.g?(p.g=p.m-1,p.h--):p.g--,p.i[p.h][p.g]=null);break;case 13:if(p.isVisible()&&(r=hf(p,f,u.i)),p.h+1>=p.o){for(u=p,h=0,f=1;16>f;f++,h++)u.i[h]=u.i[f];for(f=0;1>f;f++,h++)u.i[h]=lf()}else p.h++;p.g=0;break;case 14:p.isVisible()&&(r=hf(p,f,u.i)),p.i[p.h]=lf(),p.g=0;break;case 12:p.isVisible()&&(r=hf(p,f,u.i)),uf(p),(u=p).h=0,u.g=0}var g=r}else g=null}else if(128<=c&&159>=c)g=yf(r,u,c,d);else{if(4096<=c&&4127>=c)r=u,8<=(u=255&c)&&15>=u?r.skip(1):16<=u&&23>=u?r.skip(2):24<=u&&31>=u&&r.skip(3);else if(4224<=c&&4255>=c)r=u,128<=(u=255&c)&&135>=u?r.skip(4):136<=u&&143>=u&&r.skip(5);else if(32<=c&&127>=c)u=c,r.g&&cf(r.g,127===u?"♪":String.fromCharCode(u));else if(160<=c&&255>=c)r.g&&cf(r.g,String.fromCharCode(c));else if(4128<=c&&4223>=c){if(u=255&c,r.g)if(xf.has(u)){var m=xf.get(u);cf(r.g,m)}else cf(r.g,"_")}else 4256<=c&&4351>=c&&r.g&&cf(r.g,160!=(255&c)?"_":"[CC]");g=null}(r=g)&&n.push(r)}}}}catch(e){if(!(e instanceof De&&3e3===e.code))throw e;Y("CEA708_INVALID_DATA","Buffer read out of bounds / invalid CEA-708 Data.")}return n}function Cf(e){for(var t=0;e;)t^=1&e,e>>=1;return 1===t}function Df(e){for(var t=[],n=e,i=e=0;i<n.length;)2==e&&3==n[i]?(e=0,(n=[].concat(c(n))).splice(i,1),n=new Uint8Array(n)):0==n[i]?e++:e=0,i++;for(e=n,i=0;i<e.length;){for(n=0;255==e[i];)n+=255,i++;n+=e[i++];for(var r=0;255==e[i];)r+=255,i++;r+=e[i++],4==n&&t.push(e.subarray(i,i+r)),i+=r}return t}function Rf(){this.j=new Map,this.i=this.h=0,this.g=Lf}function Pf(e,t,n,i,r,a,o,s,u){var d=0,h=a,f=s.map((function(e){return e.Zg}));for((f=[].concat.apply([],c(f))).length&&(h=f[0].sampleSize||a),t.skip(o+s[0].Ih);t.sa();){o=t.P();var p=t.T(),g=null;switch(g=!1,s=1,e.g){case Nf:g=6==(g=31&p);break;case jf:s=2,t.skip(1),g=39==(g=p>>1&63)||40==g;break;case Of:s=2,t.skip(1),g=23==(g=p>>1&63)||24==g;break;default:return}if(g)for(p=0,d<f.length&&(p=f[d].me||0),p=(n+p)/i,g=(s=l(Df(t.vb(o-s)))).next();!g.done;g=s.next())u.push({packet:g.value,pts:p});else try{t.skip(o-s)}catch(e){break}0==(h-=o+4)&&(n=d<f.length?n+(f[d].Of||r):n+r,h=++d<f.length&&f[d].sampleSize||a)}}Ef.prototype.clear=function(){this.l=0,this.h=[],this.g=[];var e=this.i;e.i=[],e.h=[],e.g=0,kf(this);for(var t=(e=l(this.j.values())).next();!t.done;t=e.next())Tf(t.value)},Ef.prototype.extract=function(e,t){if(this.B){for(var n=l(this.m.values()),i=n.next();!i.done;i=n.next())i.value.l=t;this.B=!1}if(!(8>(e=new ya(e,0)).getLength())&&181===e.T()&&49===e.ma()&&1195456820===e.P()&&3===e.T()&&64&(n=e.T()))for(n&=31,e.skip(1),i=0;i<n;i++){var r=e.T(),a=(4&r)>>2,o=e.T(),s=e.T();a&&(0==(r&=3)||1===r?this.h.push({pts:t,type:r,gb:o,Eb:s,order:this.h.length}):(this.g.push({pts:t,type:r,value:o,order:this.g.length}),this.g.push({pts:t,type:2,value:s,order:this.g.length})))}},Ef.prototype.decode=function(){function e(e,t){return e.pts-t.pts||e.order-t.order}var t=[];this.h.sort(e),this.g.sort(e);for(var n=l(this.h),i=n.next();!i.done;i=n.next())(i=If(this,i.value))&&t.push(i);for(i=(n=l(this.g)).next();!i.done;i=n.next())pf(this.i,i.value);for(i=(n=l(this.i.i)).next();!i.done;i=n.next())i=Mf(this,i.value),t.push.apply(t,c(i));return this.i.i=[],this.h=[],this.g=[],t},Ef.prototype.getStreams=function(){return Array.from(this.A)},F("shaka.cea.CeaDecoder",Ef),Se=function(){return new Ef},Rf.prototype.init=function(e){function t(e){(e=e.name)in Uf&&(n.g=Uf[e])}var n=this,i=[],r=[];if((new Ta).box("moov",Sa).box("mvex",Sa).R("trex",(function(e){var t=e.reader;t.skip(4),t.skip(4),e=t.P(),t=t.P(),n.h=e,n.i=t})).box("trak",Sa).R("tkhd",(function(e){var t=e.reader;1==(e=e.version)?(t.skip(8),t.skip(8)):(t.skip(4),t.skip(4));var n=t.P();1==e?t.skip(8):t.skip(4),t.skip(4),t.skip(8),t.skip(2),t.skip(2),t.skip(2),t.skip(2),t.skip(36),t.ma(),t.ma(),t.ma(),t.ma(),i.push(n)})).box("mdia",Sa).R("mdhd",(function(e){e=_o(e.reader,e.version),r.push(e.timescale)})).box("minf",Sa).box("stbl",Sa).R("stsd",xa).box("avc1",t).box("avc3",t).box("dvav",t).box("dva1",t).box("hev1",t).box("hvc1",t).box("dvh1",t).box("dvhe",t).box("vvc1",t).box("vvi1",t).box("dvc1",t).box("dvi1",t).box("encv",Aa).box("sinf",Sa).box("frma",(function(e){(e=Vo(e.reader).codec)in Uf&&(n.g=Uf[e])})).parse(e,!0),!i.length||!r.length||i.length!=r.length)throw new De(2,2,2010);this.g==Lf&&W("Unable to determine bitstream format for CEA parsing!"),i.forEach((function(e,t){n.j.set(e,r[t])}))},Rf.prototype.parse=function(e){var t=this;if(this.g==Lf)return[];var n=[],i=0,r=[];return(new Ta).box("moof",(function(e){i=e.start,r=[],Sa(e)})).box("traf",(function(e){r.push({baseMediaDecodeTime:null,ed:t.h,Ld:t.i,Sg:[],timescale:9e4}),Sa(e)})).R("trun",(function(e){var t=r[r.length-1];e=Bo(e.reader,e.version,e.flags),t.Sg.push(e)})).R("tfhd",(function(e){var n=r[r.length-1];e=Oo(e.reader,e.flags),n.ed=e.ed||t.h,n.Ld=e.Ld||t.i,e=e.trackId,t.j.has(e)&&(n.timescale=t.j.get(e))})).R("tfdt",(function(e){var t=r[r.length-1];e=Uo(e.reader,e.version),t.baseMediaDecodeTime=e.baseMediaDecodeTime})).box("mdat",(function(e){for(var a=i-e.start-8,o=e.reader.ya(),s=l(r),u=s.next();!u.done;u=s.next()){if(null===(u=u.value).baseMediaDecodeTime)throw W("Unable to find base media decode time for CEA captions!"),new De(2,2,2010);e.reader.seek(o),Pf(t,e.reader,u.baseMediaDecodeTime,u.timescale,u.ed,u.Ld,a,u.Sg,n)}})).parse(e,!1),n},F("shaka.cea.Mp4CeaParser",Rf);var Lf=0,Nf=1,jf=2,Of=3,Uf={avc1:Nf,avc3:Nf,dvav:Nf,dva1:Nf,hev1:jf,hvc1:jf,dvh1:jf,dvhe:jf,vvc1:Of,vvi1:Of,dvc1:Of,dvi1:Of};function _f(){this.g=null}function Bf(t,n,i){var r=function(e){for(var t=[],n=(e=l(e)).next();!n.done;n=e.next())(n=Vf(n.value))&&t.push(n);return t}(t),a=null;t=[];var o=[],s=null,u=new Set(r.map((function(e){return e.keyId})));u.delete(null);var c="cenc";if(1<u.size)throw new De(2,4,4010);if(!n){if(1<(o=r.filter((function(e){return"urn:mpeg:dash:sea:2012"==e.Wc}))).length)throw new De(2,4,4050);o.length&&(s=function(t){if(!e.crypto||!e.crypto.subtle)throw W("Web Crypto API is not available to decrypt AES-128. (Web Crypto only exists in secure origins like https)"),new De(2,4,4042);var n=Bt(t.node,"urn:mpeg:dash:schema:sea:2012","SegmentEncryption");if(!n)throw new De(2,4,4051);if("urn:mpeg:dash:sea:aes128-cbc:2013"!=n.attributes.schemeIdUri)throw new De(2,4,4051);if(!(n=Bt(t.node,"urn:mpeg:dash:schema:sea:2012","CryptoPeriod")))throw new De(2,4,4051);if(t=n.attributes.IV,n=vt(n.attributes.keyUriTemplate),!t||!n)throw new De(2,4,4051);if(16!=(t=li(t.substr(2))).byteLength)throw new De(2,4,4048);return{wi:n,iv:t}}(o[0])),(o=r.find((function(e){return"urn:mpeg:dash:mp4protection:2011"==e.Wc})))&&o.encryptionScheme&&(c=o.encryptionScheme),(o=r.filter((function(e){return"urn:mpeg:dash:mp4protection:2011"==e.Wc?(a=e.init||a,!1):"urn:mpeg:dash:sea:2012"!=e.Wc}))).length&&(t=function(e,t,n,i,r){for(var a=[],o=(n=l(n)).next();!o.done;o=n.next()){var s=i[(o=o.value).Wc];if(s){var u;if((u=Bt(o.node,"urn:microsoft:playready","pro"))&&jt(u)){u=ui(u=jt(u));var c=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);u=[{initData:La(u,c,new Set,0),initDataType:"cenc",keyId:o.keyId}]}else u=null;if(c=null,"urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e"===o.Wc){c=o;var d=r;if(0==d.size)c=null;else{var h=new Uint8Array([16,119,239,236,192,178,77,2,172,227,60,30,82,226,251,75]);c=[{initData:La(new Uint8Array([]),h,d,1),initDataType:"cenc",keyId:c.keyId}]}}u=fi(s,t,o.init||e||u||c),(s=Gf.get(s))&&(u.licenseServerUri=s(o)),a.push(u)}}return a}(a,c,o,i,u),0==t.length&&(t=[fi("",c,a)]))}if(r.length&&!s&&(n||!o.length))for(t=[],i=(n=l(Object.values(i))).next();!i.done;i=n.next())"org.w3.clearkey"!=(i=i.value)&&t.push(fi(i,c,a));if(u=Array.from(u)[0]||null)for(n=(c=l(t)).next();!n.done;n=c.next())for(i=(n=l(n.value.initData)).next();!i.done;i=n.next())i.value.keyId=u;return{rg:u,kk:a,drmInfos:t,Je:s,wg:!0}}function Ff(e){var t=Bt(e.node,"https://dashif.org/CPS","Laurl");return t&&(t=jt(t))?t:(e=Bt(e.node,"urn:microsoft:playready","pro"))&&jt(e)?(e=function(e){var t=0,n=ve(e),i=n.getUint32(t,!0);if(i!=e.byteLength)return[];e:{for(e=t+6,t=[];e<n.byteLength-1;){i=n.getUint16(e,!0),e+=2;var r=n.getUint16(e,!0);if(e+=2,1&r||r+e>n.byteLength){n=[];break e}var a=ge(n,e,r);t.push({type:i,value:a}),e+=r}n=t}return n}(e=ui(e=jt(e))).filter((function(e){return e.type===Hf}))[0],e&&(e=Dt(e=ht(e.value,!0),"WRMHEADER"))?function(e){for(var t=(e=l(Ut(e,"DATA"))).next();!t.done;t=e.next())if((t=t.value).children)for(var n=(t=l(t.children)).next();!n.done;n=t.next())if("LA_URL"==(n=n.value).tagName)return jt(n);return""}(e):""):""}function Vf(e){var t=e.attributes.schemeIdUri,n=Vt(e,"urn:mpeg:cenc:2013","default_KID"),i=Ht(e,"urn:mpeg:cenc:2013","pssh").map(Ot),r=e.attributes.value;if(!t)return null;if(t=t.toLowerCase(),n&&(n=n.replace(/-/g,"").toLowerCase()).includes(" "))throw new De(2,4,4009);var a=[];try{a=i.map((function(e){return{initDataType:"cenc",initData:ui(e),keyId:null}}))}catch(e){throw new De(2,4,4007)}return{node:e,Wc:t,keyId:n,init:0<a.length?a:null,encryptionScheme:r}}Te["video/mp4"]=function(){return new Rf},_f.prototype.init=function(){},_f.prototype.parse=function(e){this.g?this.g.clearData():this.g=new ns;var t=[];if(!os(e=ge(e)))return t;var n=(e=this.g.parse(e)).fd(),i=e.Rd();switch(e=[],n.video){case"avc":e.push(6);break;case"hvc":e.push(39),e.push(40)}if(!e.length)return t;for(i=(n=l(i)).next();!i.done;i=n.next())if(i=i.value,e.includes(i.type)&&null!=i.time)for(var r=l(Df(i.data)),a=r.next();!a.done;a=r.next())t.push({packet:a.value,pts:i.time});return t},F("shaka.cea.TsCeaParser",_f),Te["video/mp2t"]=function(){return new _f};var Hf=1,Gf=(new Map).set("com.apple.fps",(function(e){if(ot())throw new De(2,4,4054);return(e=Bt(e.node,"https://dashif.org/CPS","Laurl"))&&(e=jt(e))?e:""})).set("com.widevine.alpha",(function(e){var t=Bt(e.node,"https://dashif.org/CPS","Laurl");return t&&(t=jt(t))?t:(e=Bt(e.node,"urn:microsoft","laurl"))&&vt(e.attributes.licenseUrl)||""})).set("com.microsoft.playready",Ff).set("com.microsoft.playready.recommendation",Ff).set("com.microsoft.playready.software",Ff).set("com.microsoft.playready.hardware",Ff).set("org.w3.clearkey",(function(e){var t=Bt(e.node,"https://dashif.org/CPS","Laurl");return t&&(t=jt(t))?t:(e=Bt(e.node,"http://dashif.org/guidelines/clearKey","Laurl"))&&"EME-1.0"===e.attributes.Lic_type&&e&&(e=jt(e))?e:""}));function Kf(t,n,i,r,a,o){var s={RepresentationID:n,Number:i,SubNumber:r,Bandwidth:a,Time:o};return t.replace(/\$(RepresentationID|Number|SubNumber|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,(function(t,n,i,r){if("$$"==t)return"$";var a=s[n];if(null==a)return t;switch("RepresentationID"==n&&i&&(i=void 0),"Time"==n&&"bigint"!=typeof a&&(.2<=Math.abs(a-Math.round(a))&&W("Calculated $Time$ values must be close to integers"),a=Math.round(a)),r){case void 0:case"d":case"i":case"u":t=a.toString();break;case"o":t=a.toString(8);break;case"x":t=a.toString(16);break;case"X":t=a.toString(16).toUpperCase();break;default:t=a.toString()}return i=e.parseInt(i,10)||1,Array(Math.max(0,i-t.length)+1).join("0")+t}))}function Xf(e,t){var n=zf(e,t,"timescale"),i=1;n&&(i=Wt(n)||1),(n=Wt((n=zf(e,t,"duration"))||""))&&(n/=i);var r=zf(e,t,"startNumber"),a=Number(zf(e,t,"presentationTimeOffset"))||0,o=Yt(r||"");if(null!=r&&null!=o||(o=1),r=null,t=Wf(e,t,"SegmentTimeline")){t=Nt(t,"S"),r=i,e=e.ka.duration||1/0;for(var s=o,u=[],l=-a,c=0;c<t.length;++c){var d=t[c],h=t[c+1],f=Ft(d,"t",Yt),p=Ft(d,"d",Yt),g=Ft(d,"r",zt);if(d=Ft(d,"k",zt)||0,null!=f&&(f-=a),p){if(f=null!=f?f:l,0>(g=g||0))if(h){if(null==(h=Ft(h,"t",Yt)))break;if(f>=h)break;g=Math.ceil((h-f)/p)-1}else{if(1/0==e)break;if(f/r>=e)break;g=Math.ceil((e*r-f)/p)-1}for(0<u.length&&f!=l&&(u[u.length-1].end=f/r),h=0;h<=g;++h)l=f+p,u.push({start:f/r,end:l/r,dg:f,Cb:d,Wi:u.length+s}),f=l}}r=u}return{timescale:i,Qa:n,zd:o,Pb:a/i||0,cg:a,timeline:r}}function qf(e,t){return[t(e.J),t(e.ha),t(e.oa)].filter(Gi)}function zf(e,t,n){t=qf(e,t),e=null;for(var i=(t=l(t)).next();!i.done&&!(e=i.value.attributes[n]);i=t.next());return e}function Wf(e,t,n){t=qf(e,t),e=null;for(var i=(t=l(t)).next();!i.done&&!(e=_t(i.value,n));i=t.next());return e}function Yf(e,t,n,i,r,a){if(a=void 0===a?0:a,Vt(e,"http://www.w3.org/1999/xlink","href")){var o=function(e,t,n,i,r,a){for(var o=Vt(e,"http://www.w3.org/1999/xlink","href"),s=Vt(e,"http://www.w3.org/1999/xlink","actuate")||"onRequest",u=l(Object.keys(e.attributes)),c=u.next();!c.done;c=u.next()){var d=(c=c.value).split(":"),h=Rt("http://www.w3.org/1999/xlink");d[0]==h&&delete e.attributes[c]}if(5<=a)return Xr(new De(2,4,4028));if("onLoad"!=s)return Xr(new De(2,4,4027));var f=hi([i],[o]);return r.request(0,aa(f,t)).Ca((function(i){if(!(i=Ct(i.data,e.tagName)))return Xr(new De(2,4,4001,o));for(e.children=[];i.children.length;){var s=i.children.shift();e.children.push(s)}for(var u=(s=l(Object.keys(i.attributes))).next();!u.done;u=s.next())u=u.value,e.attributes[u]=i.attributes[u];return Yf(e,t,n,f[0],r,a+1)}))}(e,t,n,i,r,a);return n&&(o=o.Ca(void 0,(function(){return Yf(e,t,n,i,r,a)}))),o}o=[];for(var s=l(Lt(e)),u=s.next(),c={};!u.done;c={ad:void 0},u=s.next())c.ad=u.value,"urn:mpeg:dash:resolve-to-zero:2013"==Vt(c.ad,"http://www.w3.org/1999/xlink","href")?e.children=e.children.filter(function(e){return function(t){return t!==e.ad}}(c)):"SegmentTimeline"!=c.ad.tagName&&o.push(Yf(c.ad,t,n,i,r,a));return Yr(o).Ca((function(){return e}))}function Jf(e){this.h=ve(e),this.g=new ya(this.h,0)}function $f(e){var t=Qf(e);if(7<t.length)throw new De(2,3,3002);for(var n=0,i=(t=l(t)).next();!i.done;i=t.next())n=256*n+i.value;t=Qf(e);e:{for(var r=(i=l(Zf)).next();!r.done;r=i.next())if(fe(t,new Uint8Array(r.value))){i=!0;break e}i=!1}if(i)t=e.h.byteLength-e.g.ya();else{if(8==t.length&&224&t[1])throw new De(2,3,3001);for(r=i=0;r<t.length;r++){var a=t[r];i=0==r?a&(1<<8-t.length)-1:256*i+a}t=i}return t=e.g.ya()+t<=e.h.byteLength?t:e.h.byteLength-e.g.ya(),i=ve(e.h,e.g.ya(),t),e.g.skip(t),new ep(n,i)}function Qf(e){var t=e.g.ya(),n=e.g.T();if(0==n)throw new De(2,3,3002);return n=8-Math.floor(Math.log2(n)),e.g.skip(n-1),ge(e.h,t,n)}Jf.prototype.sa=function(){return this.g.sa()};var Zf=[[255],[127,255],[63,255,255],[31,255,255,255],[15,255,255,255,255],[7,255,255,255,255,255],[3,255,255,255,255,255,255],[1,255,255,255,255,255,255,255]];function ep(e,t){this.id=e,this.g=t}function tp(e){if(8<e.g.byteLength)throw new De(2,3,3002);if(8==e.g.byteLength&&224&e.g.getUint8(0))throw new De(2,3,3001);for(var t=0,n=0;n<e.g.byteLength;n++)t=256*t+e.g.getUint8(n);return t}function np(e){var t=new Jf(e.g);if(179!=(e=$f(t)).id)throw new De(2,3,3013);if(e=tp(e),183!=(t=$f(t)).id)throw new De(2,3,3012);t=new Jf(t.g);for(var n=0;t.sa();){var i=$f(t);if(241==i.id){n=tp(i);break}}return{hj:e,Mi:n}}function ip(e,t,n){if(!(t=Wf(e,t,"Initialization")))return null;var i=e.J.Oa(),r=t.attributes.sourceURL;r&&(i=hi(i,[vt(r)],e.ob())),r=0;var a=null;return(t=Ft(t,"range",qt))&&(r=t.start,a=t.end),(n=new go((function(){return i}),r,a,up(e),null,null,n)).codecs=e.J.codecs,n.mimeType=e.J.mimeType,n}function rp(e,t,n,i,r,a,o){var s,u,c,d,h,f,p,g,m,v,y,b,T,S,x,A,E,k;return P((function(I){if(1==I.g)return s=e.presentationTimeline,u=!e.xb||!e.ka.uf,c=e.ka.start,d=e.ka.duration,h=e.J.mimeType.split("/")[1],p=null,g=[(f=t)(i,r,a,!1),"webm"==h?f(n.N(),n.Ja,n.va,!0):null],f=null,w(I,Promise.all(g),2);if(m=I.h,v=m[0],y=m[1]||null,T=c-o,S=c,x=d?c+d:1/0,"mp4"==h)var M=function(e,t,n,i,r,a,o){var s,u=(new Ta).R("sidx",(function(e){s=function(e,t,n,i,r,a,o){var s=[];o.reader.skip(4);var u=o.reader.P();if(0==u)throw new De(2,3,3005);if(0==o.version)var l=o.reader.P(),c=o.reader.P();else l=o.reader.Vc(),c=o.reader.Vc();o.reader.skip(2);var d=o.reader.ma();for(e=e+o.size+c,c=0;c<d;c++){var h=o.reader.P(),f=(2147483648&h)>>>31;h&=2147483647;var p=o.reader.P();if(o.reader.skip(4),1==f)throw new De(2,3,3006);s.push(new vo(l/u+n,(l+p)/u+n,(function(){return a}),e,e+h-1,t,n,i,r)),l+=p,e+=h}return o.parser.stop(),s}(t,i,r,a,o,n,e)}));if(e&&u.parse(e),s)return s;throw new De(2,3,3004)}(v,r,i,n,T,S,x);else{M=v;var C=new Jf(y);if(440786851!=$f(C).id)throw new De(2,3,3008);var D=$f(C);if(408125543!=D.id)throw new De(2,3,3009);C=D.g.byteOffset,D=new Jf(D.g);for(var R=null;D.sa();){var P=$f(D);if(357149030==P.id){R=P;break}}if(!R)throw new De(2,3,3010);for(R=new Jf(R.g),P=1e6,D=null;R.sa();){var L=$f(R);if(2807729==L.id)P=tp(L);else if(17545==L.id)if(4==L.g.byteLength)D=L.g.getFloat32(0);else{if(8!=L.g.byteLength)throw new De(2,3,3003);D=L.g.getFloat64(0)}}if(null==D)throw new De(2,3,3011);if(D*=R=P/1e9,475249515!=(M=$f(new Jf(M))).id)throw new De(2,3,3007);M=function(e,t,n,i,r,a,o,s,u){function l(){return r}var c=[];e=new Jf(e.g);for(var d=null,h=null;e.sa();){var f=$f(e);if(187==f.id){var p=np(f);p&&(f=n*p.hj,p=t+p.Mi,null!=d&&c.push(new vo(d+o,f+o,l,h,p-1,a,o,s,u)),d=f,h=p)}}return null!=d&&c.push(new vo(d+o,i+o,l,h,null,a,o,s,u)),c}(M,C,R,D,i,n,T,S,x)}for(A=l(b=M),E=A.next();!E.done;E=A.next())(k=E.value).codecs=e.J.codecs,k.mimeType=e.J.mimeType,k.bandwidth=e.bandwidth;return s.vd(b),p=new Zs(b),u&&p.Kc(S,x,!0),I.return(p)}))}function ap(e){return e.Yc}function op(e){var t=Wf(e,ap,"RepresentationIndex");return e=qt((e=zf(e,ap,"indexRange"))||""),t&&(e=Ft(t,"range",qt,e)),e}function sp(e,t){var n=e.J.mimeType.split("/")[1];if(e.J.contentType!=yi&&"mp4"!=n&&"webm"!=n)throw new De(2,4,4006);if("webm"==n&&!t)throw new De(2,4,4005)}function up(e){var t=e.J;return{bandwidth:e.bandwidth,audioSamplingRate:t.audioSamplingRate,codecs:t.codecs,contentType:t.contentType,frameRate:t.frameRate||null,height:t.height||null,mimeType:t.mimeType,channelsCount:t.ce,pixelAspectRatio:t.pixelAspectRatio||null,width:t.width||null,label:e.ha.label||null,roles:e.roles||null,language:e.ha.language||null}}function lp(e){return e.Rb}function cp(t,n,i,r,a,o,s,u,c){c||t.J.Ud||(t.J.Ud=zf(t,dp,"initialization"));var d=t.J.Ud?function(e,t){var n=e.J.Ud;if(n||(n=zf(e,dp,"initialization")),!n)return null;n=vt(n);var i=e.J.id,r=e.bandwidth||null,a=e.J.Oa,o=e.ob;return t=new go((function(){var e=Kf(n,i,null,null,r,null);return hi(a(),[e],o())}),0,null,up(e),null,null,t),t.codecs=e.J.codecs,t.mimeType=e.J.mimeType,t}(t,s):null,h=function(e){var t=Xf(e,dp),n=zf(e,dp,"media"),i=zf(e,dp,"index"),r=zf(e,dp,"k"),a=0;return r&&(a=parseInt(r,10)),{Qa:t.Qa,timescale:t.timescale,zd:t.zd,Pb:t.Pb,cg:t.cg,timeline:t.timeline,cc:n&&vt(n),md:i,mimeType:e.J.mimeType,codecs:e.J.codecs,bandwidth:e.bandwidth,Di:a}}(t);!function(e){var t=e.md?1:0;if(t+=e.timeline?1:0,0==(t+=e.Qa?1:0))throw new De(2,4,4002);if(1!=t&&(e.md&&(e.timeline=null),e.Qa=null),!e.md&&!e.cc)throw new De(2,4,4002)}(h);var f=It(t);if(h.md)return sp(t,d),{nc:function(){var e=Kf(h.md,f.J.id,null,null,f.bandwidth||null,null);return e=hi(f.J.Oa(),[e]),rp(f,n,d,e,0,null,h.Pb)}};if(h.Qa)return r||"image"===t.ha.contentType||"text"===t.ha.contentType||(i=t.ka.start,r=t.oa.id,c=t.ka.duration,r=(r=null!=r&&o[r]||c)?i+r:1/0,t.presentationTimeline.Bf(h.Qa),t.presentationTimeline.Qg(i,r)),{nc:function(){return function(t,n,i,r,a,o,s,u){function c(i){var a=(i-y)*v,s=a+n.Pb,l=a+p;a=l+v;var c=Math.min(a,h()),d=[],f=n.Di;if(f)for(var g=(c-l)/f,m={},k=0;k<f;m={mh:void 0},k++){var I=l+g*k,M=I+g;m.mh=k+1,(m=new vo(I,M,function(t){return function(){var n=s*b;return"BigInt"in e&&n>Number.MAX_SAFE_INTEGER&&(n=BigInt(s)*BigInt(b)),n=Kf(w,S,i,t.mh,T,n),hi(x(),[n],A())}}(m),0,null,r,E,p,h(),[],"",null,null,bo,o)).codecs=t.J.codecs,m.mimeType=t.J.mimeType,0==u?0<k&&m.Pc():0!=k%u&&m.Pc(),d.push(m)}return(l=new vo(l,c,(function(){if(f)return[];var t=s*b;return"BigInt"in e&&t>Number.MAX_SAFE_INTEGER&&(t=BigInt(s)*BigInt(b)),t=Kf(w,S,i,null,T,t),hi(x(),[t],A())}),0,null,r,E,p,h(),d,"",null,null,bo,o,0<d.length)).codecs=t.J.codecs,l.mimeType=t.J.mimeType,l.bandwidth=t.bandwidth,l.j=a,l}function d(){var e=[Math.max(f.qb(),p),Math.min(f.Yb(),h())].map((function(e){return e-p}));return e=[Math.ceil(e[0]/v),Math.ceil(e[1]/v)-1],t.J.Wa&&e[1]++,e.map((function(e){return e+y}))}function h(){var e=null!=g&&a[g]||m;return e?p+e:1/0}var f=t.presentationTimeline,p=t.ka.start,g=t.oa.id,m=t.ka.duration,v=n.Qa,y=n.zd,b=n.timescale,w=n.cc,T=t.bandwidth||null,S=t.J.id,x=t.J.Oa,A=t.ob,E=p-n.Pb,k=d();i=t.xb?Math.max(k[0],k[1]-i+1):k[0],s=s||k[1],k=[];for(var I=i;I<=s;++I){var M=c(I);k.push(M)}var C=new Zs(k);if(k=f.Yb()<h(),I=f.U(),k||I){var D=Math.max(i,s+1);i=v,t.J.Wa&&(i=.1),C.ue(i,(function(){var e=f.qb();C.Ha(e);var t=l(d());t.next(),t=t.next().value;for(var n=[];D<=t;){var i=c(D);n.push(i),D++}return e>h()&&!n.length?null:n}))}return Promise.resolve(C)}(f,h,a,d,o,s,u,t.J.oe)}};var p=null;r=r=null,t.oa.id&&t.J.id&&(r=i[r=t.oa.id+","+t.J.id])&&(p=r.segmentIndex);var g=t.ka.start,m=t.ka.duration?g+t.ka.duration:1/0,v=!(t.xb&&t.ka.uf);return p?(fp(i=p,h,g,m,v,d),i.Ha(t.presentationTimeline.qb())):p=new hp(h,t.J.id,t.bandwidth,t.J.Oa,t.ob,g,m,d,v,s,t.J.oe),h.timeline&&"image"!==t.ha.contentType&&"text"!==t.ha.contentType&&t.presentationTimeline.Rg(h.timeline,g),r&&t.xb&&(r.segmentIndex=p),{nc:function(){return p instanceof hp&&0==p.getNumReferences()&&fp(p,h,g,m,v,d),Promise.resolve(p)}}}function dp(e){return e.ec}function hp(e,t,n,i,r,a,o,s,u,l,c){Zs.call(this,[]),this.h=e,this.F=t,this.B=n,this.C=i,this.H=r,this.j=a,this.l=o,this.s=s,this.A=l,this.G=c,u&&pp(this)}function fp(e,t,n,i,r,a){if(function(e,t){if(e.s!==t){e.s=t;for(var n=(e=l(e.g)).next();!n.done;n=e.next())(n=n.value)&&yo(n,t)}}(e,a),e.h){if(n=e.h.timeline,e.h.cc!==t.cc&&(e.h.cc=t.cc),n.length){var o=n[n.length-1];t=t.timeline.filter((function(e){return e.end>o.end}))}else t=t.timeline.slice();0<t.length&&e.h.timeline.push.apply(e.h.timeline,c(t)),e.l!==i&&(e.l=i)}else e.h=t,e.j=n,e.l=i;r&&pp(e)}function pp(e){if(!e.o){for(var t=e.h.timeline;t.length&&t[t.length-1].start>=e.l;)t.pop();e.Ha(e.j)}}function gp(e,t,n,i,r,a,o,s){return e=Kf(e,t,n,a,i||null,r),hi(o(),[e],s()).map((function(e){return e.toString()}))}function mp(e){this.o=null,this.A=e,this.G=new ea,this.i=[],this.h=null,this.m=[],this.B=null,this.F=[],this.C=300,this.l=new Map,this.j=new Map,this.g=null,this.s="UNKNOWN"}function vp(e,t){var n,i,r,a,o,s,u;return P((function(l){return 1==l.g?(n=hi(e.i,[yp(e,t)]),i=aa(n,e.o.retryParameters),r=e.A.networkingEngine.request(8,i),ta(e.G,r),S(l,2),w(l,r.promise,4)):2!=l.g?(a=l.h,o=dt(a.data),1==(s=JSON.parse(o)).VERSION&&function(e,t,n){null!=e.g&&(e.g.stop(),e.g=null);var i=t["RELOAD-URI"]||n;e.g=new Be((function(){vp(e,i)})),(n=t.TTL)&&(e.C=n),e.g.$(e.C),e.m=t["PATHWAY-PRIORITY"]||[],e.F=t["PATHWAY-CLONES"]||[]}(e,s,a.uri),A(l,0)):(u=E(l))&&7001==u.code?l.return():(null!=e.g&&(e.g.stop(),e.g=null),e.g=new Be((function(){vp(e,t)})),e.g.$(e.C),void T(l))}))}function yp(e,t){if(!e.m.length)return t;t=new Gn(t);var n=e.B||e.m[0],i=Math.round(e.A.getBandwidthEstimate()),r=t.g;return"DASH"==e.s?(r.add("_DASH_pathway",n),r.add("_DASH_throughput",String(i))):"HLS"==e.s&&(r.add("_HLS_pathway",n),r.add("_HLS_throughput",String(i))),ri(r)&&zn(t,r),t.toString()}function bp(e,t,n,i){var r=e.l.get(t);r||(r=new Map),r.set(n,i),e.l.set(t,r)}function wp(e,t,n){n=void 0!==n&&n,t=e.l.get(t)||new Map;for(var i=[],r=l(e.m),a=r.next(),o={};!a.done;o={Tc:void 0},a=r.next())if(o.Tc=a.value,a=t.get(o.Tc))i.push({Hf:o.Tc,location:a});else if(a=e.F.find(function(e){return function(t){return t.Aj==e.Tc}}(o))){var s=t.get(a["BASE-ID"]);s&&(a["URI-REPLACEMENT"].uh?(Xn(s=new Gn(s),a["URI-REPLACEMENT"].uh),i.push({Hf:o.Tc,location:s.toString()})):i.push({Hf:o.Tc,location:s}))}for(r=Date.now(),a=(o=l(e.j.keys())).next();!a.done;a=o.next())a=a.value,r>(s=e.j.get(a))&&e.j.delete(a);if(i=i.filter((function(t){for(var n=l(e.j.keys()),i=n.next();!i.done;i=n.next())if(i.value.includes(new Gn(t.location).Fb))return!1;return!0})),i.length&&(e.B=i[0].Hf),i=i.map((function(e){return e.location})),!i.length&&e.h)for(o=(r=l(e.h.split(","))).next();!o.done;o=r.next())(o=t.get(o.value))&&(e.B=e.h,i.push(o));if(!i.length)for(r=(t=l(t.values())).next();!r.done;r=t.next())i.push(r.value);return n?i:hi(e.i,i)}function Tp(){this.l=[],this.h=[],this.g=[],this.j=[],this.i=[],this.s=this.o=!1,this.m=new Set}function Sp(e,t){for(var n=[],i=[],r=[],a=[],o=(e=l(e)).next();!o.done;o=e.next()){var s=o.value;o=new Map(s.audioStreams.map((function(e){return[Wp(e),e]})));var u=new Map(s.videoStreams.map((function(e){return[zp(e),e]}))),c=new Map(s.textStreams.map((function(e){return[Yp(e),e]})));if(s=new Map(s.imageStreams.map((function(e){return[Jp(e),e]}))),t){var d=Gp(yi);c.set(Yp(d),d),d=Gp("image"),s.set(Jp(d),d)}n.push(o),i.push(u),r.push(c),a.push(s)}return{lg:n,sh:i,oh:r,Hg:a}}function xp(e){var t,n,i,r,a,o,s,u,c,d,h,f,p,g,m,v,y,b,T,S,x,A,E,k,I,M,C,D,R;return P((function(P){switch(P.g){case 1:if(t=bi,1==e.length)return P.return(e[0]);for(n=e.map((function(e){return new Map(e.filter((function(e){return e.type===t.V})).map((function(e){return[Wp(e),e]})))})),i=e.map((function(e){return new Map(e.filter((function(e){return e.type===t.la})).map((function(e){return[zp(e),e]})))})),r=e.map((function(e){return new Map(e.filter((function(e){return e.type===t.wa})).map((function(e){return[Yp(e),e]})))})),a=e.map((function(e){return new Map(e.filter((function(e){return e.type===t.He})).map((function(e){return[Jp(e),e]})))})),o=l(r),s=o.next();!s.done;s=o.next())u=s.value,c=Hp(t.wa),u.set(Yp(c),c);for(d=l(a),h=d.next();!h.done;h=d.next())f=h.value,p=Hp(t.He),f.set(Jp(p),p);return w(P,Ap(g=new Tp,[],n,0,Cp,Rp,0),2);case 2:return m=P.h,w(P,Ap(g,[],i,0,Cp,Rp,0),3);case 3:return v=P.h,w(P,Ap(g,[],r,0,Cp,Rp,0),4);case 4:return y=P.h,w(P,Ap(g,[],a,0,Cp,Rp,0),5);case 5:if(b=P.h,T=0,v.length&&m.length)for(E=l(m),k=E.next();!k.done;k=E.next())for(I=k.value,M=l(v),C=M.next();!C.done;C=M.next())D=C.value,R=T++,D.variantIds.push(R),I.variantIds.push(R);else for(S=v.concat(m),x=l(S),A=x.next();!A.done;A=x.next())A.value.variantIds=[T++];return P.return(v.concat(m).concat(y).concat(b))}}))}function Ap(e,t,n,i,r,a,o){var s,u,c,d,h,f,p,g,m,v,y,b,T,S,x,A,E,k;return P((function(I){switch(I.g){case 1:for(s=[],u=0;u<n.length;u++)u>=i?s.push(new Set(n[u].values())):s.push(new Set);c=l(t),d=c.next();case 2:if(d.done){I.u(4);break}return h=d.value,w(I,function(e,t,n,i,r,a,o){return P((function(s){return 1==s.g?(Pp(e,n,t,0<o),t.matchedStreams?t.segmentIndex?w(s,Ep(t,i+o),2):s.u(2):s.return(!1)):(Ip(t,i,r,a,o),s.return(!0))}))}(e,h,n,i,a,s,o),5);case 5:if(!I.h)throw new De(2,4,4037);d=c.next(),I.u(2);break;case 4:for(f=l(s),p=f.next();!p.done;p=f.next())for(g=p.value,m=l(g),v=m.next();!v.done;v=m.next())y=v.value,(b=kp(e,y,n,r,a,s))&&t.push(b);for(T=l(s),S=T.next();!S.done;S=T.next())for(x=S.value,A=l(x),E=A.next(),k={};!E.done;k={Wf:void 0},E=A.next())if(k.Wf=E.value,!qp(k.Wf)&&t.some(function(t){return function(n){return jp(e,t.Wf,n)}}(k)))throw new De(2,4,4037);return I.return(t)}}))}function Ep(e,t){var n,i,r,a,o,s;return P((function(u){if(1==u.g){for(n=[],i=e.matchedStreams,r=t;r<i.length;r++)a=i[r],n.push(a.createSegmentIndex()),a.trickModeVideo&&!a.trickModeVideo.segmentIndex&&n.push(a.trickModeVideo.createSegmentIndex());return w(u,Promise.all(n),2)}if(e.segmentIndex instanceof iu)for(o=t;o<i.length;o++)(s=i[o]).segmentIndex&&e.segmentIndex.h.push(s.segmentIndex);T(u)}))}function kp(e,t,n,i,r,a){if(qp(t))return null;var o=i(t);return Pp(e,n,o),o.createSegmentIndex&&(o.createSegmentIndex=function(){return P((function(e){return o.segmentIndex?e.u(0):(o.segmentIndex=new iu,w(e,Ep(o,0),0))}))}),o.matchedStreams&&o.matchedStreams.length?(Ip(o,0,r,a,0),o):null}function Ip(e,t,n,i,r){var a=e.matchedStreams;for(t+=r;t<a.length;t++){var o=a[t];n(e,o);var s=!0;if("audio"==e.type&&0==Ji(e.language,o.language)&&(s=!1),s&&(i[t-r].delete(o),o.fullMimeTypes))for(s=(o=l(o.fullMimeTypes.values())).next();!s.done;s=o.next())e.fullMimeTypes.add(s.value)}}function Mp(e){var t=Object.assign({},e);return t.originalId=null,t.createSegmentIndex=function(){return Promise.resolve()},t.closeSegmentIndex=function(){if(t.segmentIndex&&(t.segmentIndex.release(),t.segmentIndex=null),t.matchedStreams)for(var e=l(t.matchedStreams),n=e.next();!n.done;n=e.next())(n=n.value).segmentIndex&&(n.segmentIndex.release(),n.segmentIndex=null)},t.roles=t.roles.slice(),t.segmentIndex=null,t.emsgSchemeIdUris=[],t.keyIds=new Set,t.closedCaptions=e.closedCaptions?new Map(e.closedCaptions):null,t.trickModeVideo=null,t}function Cp(e){var t=Object.assign({},e);return t.roles=t.roles.slice(),t.keyIds=new Set,t.segments=[],t.variantIds=[],t.closedCaptions=e.closedCaptions?new Map(e.closedCaptions):null,t}function Dp(e,t){function n(e,t){e||(e=[]);for(var n=(t=l(t)).next();!n.done;n=t.next())n=n.value,e.includes(n)||e.push(n);return e}e.roles=n(e.roles,t.roles),t.emsgSchemeIdUris&&(e.emsgSchemeIdUris=n(e.emsgSchemeIdUris,t.emsgSchemeIdUris));for(var i=l(t.keyIds),r=i.next();!r.done;r=i.next())e.keyIds.add(r.value);if(null==e.originalId?e.originalId=t.originalId:(i=t.originalId||"")&&!e.originalId.endsWith(i)&&(e.originalId+=","+i),i=Ne(e.drmInfos,t.drmInfos),t.drmInfos.length&&e.drmInfos.length&&!i.length)throw new De(2,4,4038);if(e.drmInfos=i,e.encrypted=e.encrypted||t.encrypted,t.closedCaptions)for(e.closedCaptions||(e.closedCaptions=new Map),r=(i=l(t.closedCaptions)).next();!r.done;r=i.next()){var a=l(r.value);r=a.next().value,a=a.next().value,e.closedCaptions.set(r,a)}e.bandwidth&&t.bandwidth&&(e.bandwidth=Math.max(e.bandwidth,t.bandwidth)),t.trickModeVideo?(e.trickModeVideo||(e.trickModeVideo=Mp(t.trickModeVideo),e.trickModeVideo.matchedStreams=[],e.trickModeVideo.createSegmentIndex=function(){if(e.trickModeVideo.segmentIndex)return Promise.resolve();for(var t=new iu,n=l(e.trickModeVideo.matchedStreams),i=n.next();!i.done;i=n.next())t.h.push(i.value.segmentIndex);return e.trickModeVideo.segmentIndex=t,Promise.resolve()}),e.trickModeVideo.matchedStreams.push(t.trickModeVideo),Dp(e.trickModeVideo,t.trickModeVideo)):e.trickModeVideo&&(e.trickModeVideo.matchedStreams.push(t),Dp(e.trickModeVideo,t))}function Rp(e,t){var n=e.roles;n||(n=[]);for(var i=l(t.roles),r=i.next();!r.done;r=i.next())r=r.value,n.includes(r)||n.push(r);for(e.roles=n,i=(n=l(t.keyIds)).next();!i.done;i=n.next())e.keyIds.add(i.value);if(e.encrypted=e.encrypted&&t.encrypted,e.segments.push.apply(e.segments,c(t.segments)),t.closedCaptions)for(e.closedCaptions||(e.closedCaptions=new Map),n=(t=l(t.closedCaptions)).next();!n.done;n=t.next())n=(i=l(n.value)).next().value,i=i.next().value,e.closedCaptions.set(n,i)}function Pp(e,t,n,i){i=void 0!==i&&i?n.matchedStreams:[];for(var r=(t=l(t)).next();!r.done;r=t.next()){if(!(r=Lp(e,r.value,n)))return;i.push(r)}n.matchedStreams=i}function Lp(e,t,n){var i={audio:Wp,video:zp,text:Yp,image:Jp}[n.type],r=null,a=i(n);if(t.has(a))r=t.get(a);else{a={audio:function(t,n){return jp(e,t,n)},video:function(t,n){return jp(e,t,n)},text:Op,image:Up}[n.type];for(var o={audio:_p,video:Bp,text:Fp,image:Vp}[n.type],s=l(t.values()),u=s.next();!u.done;u=s.next())!a(n,u=u.value)||n.fastSwitching!=u.fastSwitching||r&&!o(n,r,u)||(r=u)}return e.s&&!qp(r)&&t.delete(i(r)),r}function Np(e,t){return e.mimeType==t.mimeType&&$p(e.codecs)===$p(t.codecs)}function jp(e,t,n){return!(!Np(t,n)&&!e.o||t.drmInfos&&!Le(t.drmInfos,n.drmInfos))}function Op(e,t){return!t.language||e.forced===t.forced&&0!=Ji(e.language,t.language)&&t.kind==e.kind}function Up(){return!0}function _p(e,t,n){var i=Np(e,t),r=Np(e,n);if(i&&!r)return!1;if(!i&&r)return!0;if(i=Ji(e.language,t.language),(r=Ji(e.language,n.language))>i)return!0;if(r<i)return!1;if(t.label!==n.label){if(e.label===t.label)return!1;if(e.label===n.label)return!0}if(e.roles.length){if(i=t.roles.filter((function(t){return e.roles.includes(t)})),(r=n.roles.filter((function(t){return e.roles.includes(t)}))).length>i.length)return!0;if(r.length<i.length)return!1;if(n.roles.length!==t.roles.length)return n.roles.length<t.roles.length}else{if(!n.roles.length&&t.roles.length)return!0;if(n.roles.length&&!t.roles.length)return!1}return!(t.primary||!n.primary)||!(t.primary&&!n.primary)&&((i=Kp(e.channelsCount,t.channelsCount,n.channelsCount))==Qp||i!=eg&&((i=Kp(e.audioSamplingRate,t.audioSamplingRate,n.audioSamplingRate))==Qp||i!=eg&&!(!e.bandwidth||Xp(e.bandwidth,t.bandwidth,n.bandwidth)!=Qp)))}function Bp(e,t,n){var i=Np(e,t),r=Np(e,n);if(i&&!r)return!1;if(!i&&r)return!0;if((i=Kp(e.width*e.height,t.width*t.height,n.width*n.height))==Qp)return!0;if(i==eg)return!1;if(e.frameRate){if((i=Kp(e.frameRate,t.frameRate,n.frameRate))==Qp)return!0;if(i==eg)return!1}return!(!e.bandwidth||Xp(e.bandwidth,t.bandwidth,n.bandwidth)!=Qp)}function Fp(e,t,n){var i=Ji(e.language,t.language),r=Ji(e.language,n.language);if(r>i)return!0;if(r<i)return!1;if(!t.primary&&n.primary)return!0;if(t.primary&&!n.primary)return!1;if(t.label!==n.label){if(e.label===t.label)return!1;if(e.label===n.label)return!0}if(e.roles.length){if(i=t.roles.filter((function(t){return e.roles.includes(t)})),(r=n.roles.filter((function(t){return e.roles.includes(t)}))).length>i.length)return!0;if(r.length<i.length)return!1}else{if(!n.roles.length&&t.roles.length)return!0;if(n.roles.length&&!t.roles.length)return!1}return n.mimeType==e.mimeType&&n.codecs==e.codecs&&(t.mimeType!=e.mimeType||t.codecs!=e.codecs)}function Vp(e,t,n){return Kp(e.width*e.height,t.width*t.height,n.width*n.height)==Qp}function Hp(e){return{id:0,originalId:"",groupId:null,primary:!1,type:e,mimeType:"",codecs:"",language:"",originalLanguage:null,label:null,width:null,height:null,encrypted:!1,keyIds:new Set,segments:[],variantIds:[],roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,external:!1,fastSwitching:!1,isAudioMuxedInVideo:!1}}function Gp(e){return{id:0,originalId:"",groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new Zs([]),mimeType:"",codecs:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"",originalLanguage:null,label:null,type:e,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set,isAudioMuxedInVideo:!1}}function Kp(e,t,n){if(t==e&&e!=n)return eg;if(n==e&&e!=t)return Qp;if(t>e){if(n<=e||n-e<t-e)return Qp;if(n-e>t-e)return eg}else{if(n>e)return eg;if(e-n<e-t)return Qp;if(e-n>e-t)return eg}return Zp}function Xp(e,t,n){return t=Math.abs(e-t),(e=Math.abs(e-n))<t?Qp:t<e?eg:Zp}function qp(e){switch(e.type){case yi:return!e.language;case"image":return!e.tilesLayout;default:return!1}}function zp(e){return JSON.stringify([e.fastSwitching,e.width,e.frameRate,$p(e.codecs),e.mimeType,e.label,e.roles,e.closedCaptions?Array.from(e.closedCaptions.entries()):null,e.bandwidth])}function Wp(e){return JSON.stringify([e.fastSwitching,e.channelsCount,e.language,e.bandwidth,e.label,$p(e.codecs),e.mimeType,e.roles,e.audioSamplingRate,e.primary])}function Yp(e){return JSON.stringify([e.language,e.label,e.codecs,e.mimeType,e.bandwidth,e.roles])}function Jp(e){return JSON.stringify([e.width,e.codecs,e.mimeType])}function $p(e){if(!tg.has(e)){var t=Mi(e);tg.set(e,t)}return tg.get(e)}m(hp,Zs),(i=hp.prototype).getNumReferences=function(){return this.h?this.h.timeline.length:0},i.release=function(){Zs.prototype.release.call(this),this.h=null},i.Ha=function(e){if(this.h){for(var t=0,n=this.h.timeline,i=0;i<n.length&&n[i].end+this.j<=e;i+=1)t+=1;0<t&&(this.h.timeline=n.slice(t),this.g.length>=t&&(this.g=this.g.slice(t)),this.i+=t,0===this.getNumReferences()&&this.release())}},i.find=function(e){if(this.h&&this.h.timeline&&this.h.timeline.length&&e<this.h.timeline[0].start+this.j)return this.i;if(!this.h)return null;var t=this.h.timeline;if(e<this.j||e>=this.l)return null;for(var n=t.length-1,i=0;i<t.length;i++){var r=t[i],a=r.start+this.j;if(r=i<n?t[i+1].start+this.j:1/0===this.l?r.end+this.j:this.l,e>=a&&e<r)return i+this.i}return null},i.get=function(e){var t=this;if(0>(e-=this.i)||e>=this.getNumReferences()||!this.h)return null;var n=this.g[e];if(!n){var i=this.h.timeline[e],r=i.Wi,a=this.h.cg+i.dg;n=this.j-this.h.Pb;var o=this.j+i.end,s=o;e===this.getNumReferences()-1&&1/0!==this.l&&(s=this.l);for(var u=this.h.codecs,l=this.h.mimeType,c=this.h.bandwidth,d=[],h=(i.end-i.start)/i.Cb,f={},p=0;p<i.Cb;f={we:void 0,nh:void 0},p++){var g=i.start+h*p,m=g+h;f.nh=p+1,f.we=null,(f=new vo(this.j+g,this.j+m,function(e){return function(){return t.h?(null==e.we&&(e.we=gp(t.h.cc,t.F,r,t.B,a,e.nh,t.C,t.H)),e.we):[]}}(f),0,null,this.s,n,this.j,this.l,[],"",null,null,bo,this.A)).codecs=u,f.mimeType=l,f.bandwidth=c,0==this.G?0<p&&f.Pc():0!=p%this.G&&f.Pc(),d.push(f)}(n=new vo(this.j+i.start,s,(function(){return 0<i.Cb||!t.h?[]:gp(t.h.cc,t.F,r,t.B,a,null,t.C,t.H)}),0,null,this.s,n,this.j,this.l,d,"",null,null,bo,this.A,0<i.Cb)).codecs=u,n.mimeType=l,n.j=o,n.bandwidth=c,this.g[e]=n}return n},i.yb=function(e){pp(this);for(var t=0;t<this.getNumReferences();t++){var n=this.get(t+this.i);n&&e(n)}},mp.prototype.configure=function(e){this.o=e},mp.prototype.destroy=function(){return this.A=this.o=null,this.i=[],this.h=null,this.m=[],this.F=[],this.l.clear(),null!=this.g&&(this.g.stop(),this.g=null),this.G.destroy()},mp.prototype.setManifestType=function(e){this.s=e},mp.prototype.banLocation=function(e){this.j.set(e,Date.now()+6e4)},(i=Tp.prototype).release=function(){for(var e=l(this.h.concat(this.g,this.j,this.i)),t=e.next();!t.done;t=e.next())(t=t.value).segmentIndex&&t.segmentIndex.release();this.h=[],this.g=[],this.j=[],this.i=[],this.l=[],this.s=this.o=!1,this.m.clear()},i.ii=function(){return this.l},i.mf=function(){return this.j.slice()},i.Rh=function(){return this.i},i.sg=function(e,t){if(e){if("audio"==e.type)for(var n=l(this.h),i=n.next();!i.done;i=n.next())(i=i.value).matchedStreams=i.matchedStreams.filter((function(t){return t!==e}));else if("video"==e.type)for(i=(n=l(this.g)).next();!i.done;i=n.next())(i=i.value).matchedStreams=i.matchedStreams.filter((function(t){return t!==e})),i.trickModeVideo&&(i.trickModeVideo.matchedStreams=i.trickModeVideo.matchedStreams.filter((function(t){return t!==e})));else if(e.type==yi)for(i=(n=l(this.j)).next();!i.done;i=n.next())(i=i.value).matchedStreams=i.matchedStreams.filter((function(t){return t!==e}));else if("image"==e.type)for(i=(n=l(this.i)).next();!i.done;i=n.next())(i=i.value).matchedStreams=i.matchedStreams.filter((function(t){return t!==e}));e.segmentIndex&&e.closeSegmentIndex(),this.m.delete(t)}},i.Ne=function(e,t,n){n=void 0!==n&&n;var i,r,a,o,s,u,c,d,h,f,p,g,m,v,y,b,S,x,A,E,k,I,M,C,D,R,L,N,j,O,U=this;return P((function(P){if(1==P.g){if(i=bi,!t&&1==e.length)return r=Sp(e,!1),a=r.lg,o=r.sh,s=r.oh,u=r.Hg,U.h=Array.from(a[0].values()),U.g=Array.from(o[0].values()),U.j=Array.from(s[0].values()),U.i=Array.from(u[0].values()),P.u(2);for(c=n?U.m.size:0,d=-1,h=0;h<e.length;h++)f=e[h],U.m.has(f.id)||(U.m.add(f.id),-1==d&&(d=h));return-1==d?P.return():(p=Sp(e,!0),g=p.lg,m=p.sh,v=p.oh,y=p.Hg,w(P,Promise.all([Ap(U,U.h,g,d,Mp,Dp,c),Ap(U,U.g,m,d,Mp,Dp,c),Ap(U,U.j,v,d,Mp,Dp,c),Ap(U,U.i,y,d,Mp,Dp,c)]),2))}if(b=0,S=[],U.g.length&&U.h.length)for(M=l(U.h),C=M.next();!C.done;C=M.next())for(D=C.value,R=l(U.g),L=R.next();!L.done;L=R.next())N=L.value,j=Ne(D.drmInfos,N.drmInfos),D.drmInfos.length&&N.drmInfos.length&&!j.length||(O=b++,S.push({id:O,language:D.language,disabledUntilTime:0,primary:D.primary,audio:D,video:N,bandwidth:(D.bandwidth||0)+(N.bandwidth||0),drmInfos:j,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]}));else for(x=U.g.length?U.g:U.h,A=l(x),E=A.next();!E.done;E=A.next())k=E.value,I=b++,S.push({id:I,language:k.language,disabledUntilTime:0,primary:k.primary,audio:k.type==i.V?k:null,video:k.type==i.la?k:null,bandwidth:k.bandwidth||0,drmInfos:k.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});U.l=S,T(P)}))},i.bh=function(e){this.o=e},i.ih=function(e){this.s=e},F("shaka.util.PeriodCombiner",Tp),Tp.prototype.setUseStreamOnce=Tp.prototype.ih,Tp.prototype.setAllowMultiTypeVariants=Tp.prototype.bh,Tp.prototype.combinePeriods=Tp.prototype.Ne,Tp.prototype.deleteStream=Tp.prototype.sg,Tp.prototype.getImageStreams=Tp.prototype.Rh,Tp.prototype.getTextStreams=Tp.prototype.mf,Tp.prototype.getVariants=Tp.prototype.ii;var Qp=1,Zp=0,eg=-1,tg=new Map;function ng(e,t){try{return function(e,t){var n=new DOMParser,i=ig.value()(e);e=null;try{e=n.parseFromString(i,"text/xml")}catch(e){return null}if(!(n=e.documentElement)||n.getElementsByTagName("parsererror").length||n.tagName!=t)return null;if(!("createNodeIterator"in document))return n;for(t=document.createNodeIterator(e,NodeFilter.SHOW_ALL);e=t.nextNode();)if(e instanceof HTMLElement||e instanceof SVGElement)return null;return n}(ft(e),t)}catch(e){return null}}var ig=new Pe((function(){if("undefined"!=typeof trustedTypes){var e=trustedTypes.createPolicy("shaka-player#xml",{createHTML:function(e){return e}});return function(t){return e.createHTML(t)}}return function(e){return e}}));function rg(){var e=this;this.j=this.g=null,this.A=[],this.i=null,this.na=1,this.F=[],this.l={ae:"",type:"",profiles:[],Mb:null,Wa:0,Oa:null,xd:0},this.s=new Map,this.o={},this.B={},this.ja={},this.m=new Tp,this.K=0,this.ra=new G(5),this.L=new Be((function(){e.I&&!e.g.continueLoadingWhenPaused&&(e.G.cb(e.I,"timeupdate"),e.I.paused)?e.G.pa(e.I,"timeupdate",(function(){return yg(e)})):yg(e)})),this.S=new ea,this.O=null,this.C=[],this.da=1/0,this.H=!1,this.h=null,this.M=0,this.ga=!1,this.G=new Z,this.I=null,this.Y=!1,this.aa="",this.fa=function(){return!1},this.Z=[]}function ag(e){var t,n,i,r,a,o,s,u,d,h,f;return P((function(p){return 1==p.g?(t=4,n="MPD",i=function(e){var t=e.l.xd;if(!e.l.ae||!t||!e.F.length)return[];var n=Date.now()/1e3,i=e.F.filter((function(e){return!(e=Yt(e.attributes.ttl))||t+e>n})).map(Ot).filter(Gi);return i.length?hi(e.A,i):[]}(e),r=e.A,i.length?(r=i,n="Patch",t=6):1<e.A.length&&e.h&&(a=wp(e.h,"Location",!0)).length&&(r=a),o=aa(r,e.g.retryParameters),s=Date.now(),w(p,Eg(e,o,0,{type:t}),2)):3!=p.g?(u=p.h,e.j?(u.uri&&u.uri!=u.originalUri&&!e.A.includes(u.uri)&&e.A.unshift(u.uri),d=new Gn(u.uri),e.aa=d.g.toString(),w(p,function(e,t,n,i){var r,a,o,s,u,d,h,f;return P((function(p){if(1==p.g){if(r=t,(a=e.g.dash.manifestPreprocessor)!=dl){if(oe("manifest.dash.manifestPreprocessor configuration","Please Use manifest.dash.manifestPreprocessorTXml instead."),!(o=ng(r,i)))throw new De(2,4,4001,n);a(o),r=pt(o.outerHTML)}if(!(s=Ct(r,i)))throw new De(2,4,4001,n);return(u=e.g.dash.manifestPreprocessorTXml)!=hl&&u(s),"Patch"===i?p.return(function(e,t){var n,i,r,a,o,s,u,d,h,f,p,g,m,v,y,b,S,x,A,E,k,I,M,C;return P((function(D){if(1==D.g){if(n=t.attributes.mpdId,i=Ft(t,"originalPublishTime",Kt),!n||n!==e.l.ae||i!==e.l.xd)throw e.F=[],new De(1,4,4052);for(r=[],a=[],o=new Set,s=l(Lt(t)),u=s.next();!u.done;u=s.next())if(d=u.value,h=Zt(d.attributes.sel||""),f=h[h.length-1],p=Ot(d)||"","MPD"===f.name)if("mediaPresentationDuration"===f.Ub){var R=Xt(Ot(d)||"");if(null!=R){e.l.Mb=R;for(var P=l(e.s.values()),L=P.next();!L.done;L=P.next())L.value.Mb=R}}else if("type"===f.Ub){for(e.i.presentationTimeline.Bc("static"==p),e.l.type=p,P=(R=l(e.s.values())).next();!P.done;P=R.next())P.value.xb="dynamic"==p;"static"==p&&(e.K=-1)}else"publishTime"===f.Ub?e.l.xd=Kt(p)||0:null===f.Ub&&"add"===d.tagName&&a.push(d);else if("PatchLocation"===f.name)en(e.F,d);else if("Period"===f.name)"add"===d.tagName?a.push(d):"remove"===d.tagName&&f.id&&lg(e,f.id);else if("SegmentTemplate"===f.name){if((R=(P=Zt(d.attributes.sel||""))[P.length-1]).Ub){P=cg(e,P),L=Ot(d)||"";for(var N=l(P),j=N.next();!j.done;j=N.next())nn((j=e.s.get(j.value)).J.ec,d.tagName,R.Ub,L);R=P}else R=[];for(g=l(R),m=g.next();!m.done;m=g.next())v=m.value,o.add(v)}else if("SegmentTimeline"===f.name||"S"===f.name){for(R=Zt(d.attributes.sel||""),L=(P=l(R=cg(e,R))).next();!L.done;L=P.next())en(N=Nt(L=Wf(L=e.s.get(L.value),dp,"SegmentTimeline"),"S"),d),L.children=N;for(y=l(R),b=y.next();!b.done;b=y.next())S=b.value,o.add(S)}for(x=l(o),A=x.next();!A.done;A=x.next())E=A.value,dg(e,E);for(k=l(a),I=k.next();!I.done;I=k.next())M=I.value,r.push.apply(r,c(ug(e,M)));return r.length?(e.i.periodCount+=r.length,e.i.gapCount=e.M,w(D,sg(e,r,!0),2)):D.u(2)}"static"==e.l.type&&(C=e.l.Mb,e.i.presentationTimeline.bb(C||1/0)),T(D)}))}(e,s)):e.g.dash.disableXlinkProcessing?p.return(og(e,s,n)):(d=e.g.dash.xlinkFailGracefully,h=Yf(s,e.g.retryParameters,d,n,e.j.networkingEngine),ta(e.S,h),w(p,h.promise,2))}return f=p.h,p.return(og(e,f,n))}))}(e,u.data,u.uri,n),3)):p.return(0)):(h=Date.now(),f=(h-s)/1e3,e.ra.sample(1,f),p.return(f))}))}function og(e,t,n){var i,r,a,o,s,u,c,d,h,f,p,g,m,v,y,b,x,k,I,M,C,D,R,L,N,j,O,U,_,B,F,V,H,G,K,X,q,z,Y,J,$,Q,Z,ee,te,ne,ie,re,ae,oe,se;return P((function(ue){switch(ue.g){case 1:for(e.h&&e.h.l.clear(),i=[n],r=[],a=new Map,o=Nt(t,"Location"),s=l(o),u=s.next();!u.done;u=s.next())c=u.value,d=c.attributes.serviceLocation,(h=Ot(c))&&(f=hi(i,[h])[0],d&&(e.h?bp(e.h,"Location",d,f):a.set(d,f)),r.push(f));if(e.h?0<(p=wp(e.h,"Location",!0)).length&&(i=e.A=p):r.length&&(i=e.A=r),e.l.ae=t.attributes.id||"",e.l.xd=Ft(t,"publishTime",Kt)||0,e.F=Nt(t,"PatchLocation"),g=Promise.resolve(),(m=_t(t,"ContentSteering"))&&e.j)for(v=m.attributes.defaultServiceLocation,e.h?(e.h.i=i,e.h.h=v):(e.h=new mp(e.j),e.h.configure(e.g),e.h.setManifestType("DASH"),e.h.i=i,e.h.h=v,(y=Ot(m))&&(Ft(m,"queryBeforeStart",$t,!1)?g=vp(e.h,y):vp(e.h,y))),b=l(a.keys()),x=b.next();!x.done;x=b.next())k=x.value,I=a.get(k),bp(e.h,"Location",k,I);if(M=Nt(t,"BaseURL"),C=!1,e.h)for(D=l(M),R=D.next();!R.done;R=D.next())L=R.value,N=L.attributes.serviceLocation,j=Ot(L),N&&j&&(bp(e.h,"BaseURL",N,j),C=!0);if(e.Z=null,C&&e.h||(O=M.map(Ot),e.Z=hi(i,O)),U=function(){return e.h&&C?wp(e.h,"BaseURL"):e.Z?e.Z:[]},e.l.Oa=U,_=0,M&&M.length&&(_=Ft(M[0],"availabilityTimeOffset",Jt)||0),e.l.Wa=_,B=e.g.dash.ignoreMinBufferTime,F=0,B||(F=Ft(t,"minBufferTime",Xt)||0),e.K=Ft(t,"minimumUpdatePeriod",Xt,-1),V=Ft(t,"availabilityStartTime",Kt),H=Ft(t,"timeShiftBufferDepth",Xt),G=e.g.dash.ignoreSuggestedPresentationDelay,K=null,G||(K=Ft(t,"suggestedPresentationDelay",Xt)),X=e.g.dash.ignoreMaxSegmentDuration,q=null,X||(q=Ft(t,"maxSegmentDuration",Xt)),z=t.attributes.type||"static",e.i&&e.i.presentationTimeline&&(e.Y=e.i.presentationTimeline.U()&&"static"==z),e.l.type=z,e.i)for(Y=e.i.presentationTimeline,J=l(Object.values(e.o)),$=J.next();!$.done;$=J.next())(Q=$.value).segmentIndex&&Q.segmentIndex.Ha(Y.qb());else Z=e.g.defaultPresentationDelay||1.5*F,Y=new Ls(V,null!=K?K:Z,e.g.dash.autoCorrectDrift);return Y.Bc("static"==z),Y.U()&&!isNaN(e.g.availabilityWindowOverride)&&(H=e.g.availabilityWindowOverride),null==H&&(H=1/0),Y.pe(H),ee=t.attributes.profiles||"",e.l.profiles=ee.split(","),te={xb:"static"!=z,presentationTimeline:Y,oa:null,ka:null,ha:null,J:null,bandwidth:0,pf:!1,Wa:_,Mb:null,profiles:ee.split(","),roles:null,ob:function(){return""}},e.M=0,ne=pg(e,te,U,t,!1),ie=ne.duration,re=ne.periods,("static"!=z||e.Y)&&ne.ug||Y.bb(ie||1/0),e.ga&&!e.H&&e.j.isAutoLowLatencyMode()&&(e.j.enableLowLatencyMode(),e.H=e.j.isLowLatencyMode()),e.H&&Y.dh(e.da),Y.Bf(q||1),w(ue,g,2);case 2:return e.H&&(F=0,ae=null!=K?K:e.g.defaultPresentationDelay,Y.Sf(ae)),e.i?(e.i.periodCount=re.length,e.i.gapCount=e.M,w(ue,sg(e,re,!1),4)):w(ue,e.m.Ne(re,te.xb),6);case 6:if(e.i={presentationTimeline:Y,variants:e.m.l,textStreams:e.m.mf(),imageStreams:e.m.i,offlineSessionIds:[],minBufferTime:F||0,sequenceMode:e.g.dash.sequenceMode,ignoreManifestTimestampsInSegmentsMode:!1,type:"DASH",serviceDescription:hg(t),nextUrl:fg(t),periodCount:re.length,gapCount:e.M,isLowLatency:e.ga,startTime:null},!Y.qh()){ue.u(7);break}return oe=Nt(t,"UTCTiming"),w(ue,function(e,t,n){var i,r,a,o,s,u,c,d;return P((function(h){switch(h.g){case 1:i=n.map((function(e){return{scheme:e.attributes.schemeIdUri,value:e.attributes.value}})),r=e.g.dash.clockSyncUri,!i.length&&r&&i.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:r}),a=l(i),o=a.next();case 2:if(o.done){h.u(4);break}switch(s=o.value,S(h,5),u=s.scheme,c=s.value,u){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":return h.u(7);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":return h.u(8);case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":return d=Date.parse(c),h.return(isNaN(d)?0:d-Date.now());case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":W("NTP UTCTiming scheme is not supported");break;default:W("Unrecognized scheme in UTCTiming element",u)}h.u(9);break;case 7:return w(h,Tg(e,t,c,"HEAD"),10);case 10:return h.return(h.h);case 8:return w(h,Tg(e,t,c,"GET"),11);case 11:return h.return(h.h);case 9:A(h,3);break;case 5:E(h);case 3:o=a.next(),h.u(2);break;case 4:return W("A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!"),h.return(0)}}))}(e,U,oe),8);case 8:if(se=ue.h,!e.j)return ue.return();Y.eh(se);case 7:Y.Xd();case 4:e.j.makeTextStreamsForClosedCaptions(e.i),function(e){for(var t=Object.keys(e.B).filter((function(t){return!e.C.includes(t)})),n=(t=l(t)).next();!n.done;n=t.next()){n=n.value;for(var i=!0,r=l(e.B[n]),a=r.next();!a.done;a=r.next()){a=a.value;var o=e.o[a];o&&(o.segmentIndex&&0!=o.segmentIndex.getNumReferences()?i=!1:(e.m&&e.m.sg(e.o[a],n),delete e.o[a]))}i&&delete e.B[n]}}(e),T(ue)}}))}function sg(e,t,n){var i;return P((function(r){if(1==r.g)return w(r,e.m.Ne(t,!0,n),2);e.i.variants=e.m.l,0<(i=e.m.mf()).length&&(e.i.textStreams=i),e.i.imageStreams=e.m.i,e.j.filter(e.i),T(r)}))}function ug(e,t){return pg(e,{xb:"dynamic"==e.l.type,presentationTimeline:e.i.presentationTimeline,oa:null,ka:null,ha:null,J:null,bandwidth:0,pf:!1,Wa:e.l.Wa,profiles:e.l.profiles,Mb:e.l.Mb,roles:null,ob:function(){return""}},e.l.Oa,t,!0).periods}function lg(e,t){e.i.periodCount--;for(var n=l(e.s.keys()),i=n.next();!i.done;i=n.next())(i=i.value).startsWith(t)&&(Wf(e.s.get(i),dp,"SegmentTimeline").children=[],dg(e,i),e.s.delete(i));e.C=e.C.filter((function(e){return e!==t}))}function cg(e,t){for(var n="",i="",r=-1,a="",o=(t=l(t)).next();!o.done;o=t.next())"Period"===(o=o.value).name?n=o.id:"AdaptationSet"===o.name?(i=o.id,null!==o.position&&(r=o.position)):"Representation"===o.name&&(a=o.id);if(t=[],a)t.push(n+","+a);else if(i)for(r=l(e.s.values()),e=r.next();!e.done;e=r.next())(e=e.value).oa.id===n&&e.ha.id===i&&e.J.id&&t.push(n+","+e.J.id);else if(-1<r)for(i=l(e.s.values()),e=i.next();!e.done;e=i.next())(e=e.value).oa.id===n&&e.ha.position===r&&e.J.id&&t.push(n+","+e.J.id);return t}function dg(e,t){var n=e.s.get(t),i=e.o[t];i.segmentIndex&&i.segmentIndex.Ha(e.i.presentationTimeline.qb());try{var r=cp(n,(function(t,n,i,r){return xg(e,t,n,i,r)}),e.o,!0,e.g.dash.initialSegmentLimit,e.ja,n.J.aesKey,null,!0);i.createSegmentIndex=function(){return P((function(e){if(1==e.g)return i.segmentIndex?e.u(0):w(e,r.nc(),3);i.segmentIndex=e.h,T(e)}))}}catch(e){if((t=n.J.contentType)!=yi&&"application"!=t&&"image"!=t||4002!=e.code)throw e}}function hg(e){var t=_t(e,"ServiceDescription");if(!t)return null;if(e=_t(t,"Latency"),t=_t(t,"PlaybackRate"),!e&&!t)return null;var n={};return e&&("target"in e.attributes&&(n.targetLatency=parseInt(e.attributes.target,10)/1e3),"max"in e.attributes&&(n.maxLatency=parseInt(e.attributes.max,10)/1e3),"min"in e.attributes&&(n.minLatency=parseInt(e.attributes.min,10)/1e3)),t&&("max"in t.attributes&&(n.maxPlaybackRate=parseFloat(t.attributes.max)),"min"in t.attributes&&(n.minPlaybackRate=parseFloat(t.attributes.min))),n}function fg(e){if(!(e=Nt(e,"SupplementalProperty")).length)return null;for(var t=(e=l(e)).next();!t.done;t=e.next())if("urn:mpeg:dash:chaining:2016"==(t=t.value).attributes.schemeIdUri)return t.attributes.value;return null}function pg(e,t,n,i,r){var a=t.Mb;a||(a=Ft(i,"mediaPresentationDuration",Xt),e.l.Mb=a);var o=0;e.i&&e.i.presentationTimeline&&e.Y&&(o=e.i.presentationTimeline.Kb());var s=[],u=o;i=Nt(i,"Period");for(var c=0;c<i.length;c++){var d=i[c],h=i[c+1],f=Ft(d,"start",Xt,u),p=d.attributes.id,g=Ft(d,"duration",Xt);f=0==c&&0==f&&e.Y?o:f;var m=null;if(h){var v=Ft(h,"start",Xt);null!=v&&(m=v-f+o)}else null!=a&&(m=a-f+o);if(v=wi,m&&g&&Math.abs(m-g)>v&&m>g&&e.M++,null==m&&(m=g),!(null!==e.O&&null!==p&&null!==f&&f<e.O)||e.C.includes(p)||c+1==i.length){if(null!==f&&(null===e.O||f>e.O)&&(e.O=f),u=gg(e,t,n,{start:f,duration:m,node:d,uf:null==m||!h}),s.push(u),t.oa.id&&m&&(e.ja[t.oa.id]=m),null==m){u=null;break}u=f+m}}if(r)for(n=(t=l(s)).next();!n.done;n=t.next())n=n.value.id,e.C.includes(n)||e.C.push(n);else e.C=s.map((function(e){return e.id}));return null!=a?{periods:s,duration:a+o,ug:!1}:{periods:s,duration:u,ug:!0}}function gg(t,n,i,r){n.oa=wg(t,r.node,null,i),n.ka=r,n.oa.Wa=n.Wa,n.oa.id||(n.oa.id="__shaka_period_"+r.start);var a=Nt(r.node,"EventStream");i=n.presentationTimeline.qb();for(var o=(a=l(a)).next();!o.done;o=a.next())Sg(t,r.start,r.duration,o.value,i);for(a=(i=l(i=Nt(r.node,"SupplementalProperty"))).next();!a.done;a=i.next())"urn:mpeg:dash:urlparam:2014"==(a=a.value).attributes.schemeIdUri&&(a=vg(t,a))&&(n.ob=a);if(i=Nt(r.node,"AdaptationSet").map((function(i,r){return function(t,n,i,r){function a(e){var i=e.attributes["dvb:fontFamily"];e=e.attributes["dvb:url"],i&&e&&(e=hi(n.ha.Oa(),[e],n.ob()),t.j.addFont(i,e[0]))}function o(e){switch(e){case 1:case 5:case 6:case 7:return"srgb";case 9:return"rec2020";case 11:case 12:return"p3"}}function s(e){switch(e){case 1:case 6:case 13:case 14:case 15:return"SDR";case 16:return"PQ";case 18:return"HLG"}}n.ha=wg(t,r,n.oa,null),n.ha.position=i;var u=!1,d=(i=Nt(r,"Role")).map((function(e){return e.attributes.value})).filter(Gi),h=void 0,f=n.ha.contentType==yi;f&&(h="subtitle");for(var p=(i=l(i)).next();!p.done;p=i.next()){var g=(p=p.value).attributes.schemeIdUri;if(null==g||"urn:mpeg:dash:role:2011"==g)switch(p=p.attributes.value,p){case"main":u=!0;break;case"caption":case"subtitle":h=p}}var m=Nt(r,"EssentialProperty");i=null;var v=!1;p=null,g=!1;for(var y=(m=l(m)).next();!y.done;y=m.next()){var b=(y=y.value).attributes.schemeIdUri;if("http://dashif.org/guidelines/trickmode"==b)i=y.attributes.value;else if("urn:mpeg:mpegB:cicp:TransferCharacteristics"==b)var S=s(parseInt(y.attributes.value,10));else if("urn:mpeg:mpegB:cicp:ColourPrimaries"==b)var x=o(parseInt(y.attributes.value,10));else"urn:mpeg:mpegB:cicp:MatrixCoefficients"!=b&&("urn:mpeg:dash:ssr:2023"==b&&t.g.dash.enableFastSwitching?v=!0:"urn:dvb:dash:fontdownload:2014"==b?a(y):"urn:mpeg:dash:urlparam:2014"==b&&(p=vg(t,y))||(g=!0))}if(g)return null;var A=null;for(m=(g=l(g=Nt(r,"SupplementalProperty"))).next();!m.done;m=g.next())"http://dashif.org/guidelines/last-segment-number"==(y=(m=m.value).attributes.schemeIdUri)?A=parseInt(m.attributes.value,10)-1:"urn:mpeg:mpegB:cicp:TransferCharacteristics"==y?S=s(parseInt(m.attributes.value,10)):"urn:mpeg:mpegB:cicp:ColourPrimaries"==y?x=o(parseInt(m.attributes.value,10)):"urn:dvb:dash:fontdownload:2014"==y?a(m):"urn:mpeg:dash:urlparam:2014"==y&&(p=vg(t,m));p&&(n.ob=p),p=Nt(r,"Accessibility");var E,k=new Map;for(g=(p=l(p)).next();!g.done;g=p.next())if(g=(m=g.value).attributes.schemeIdUri,m=m.attributes.value,"urn:scte:dash:cc:cea-608:2015"!=g||t.g.disableText)if("urn:scte:dash:cc:cea-708:2015"!=g||t.g.disableText)"urn:mpeg:dash:role:2011"==g?null!=m&&(d.push(m),"captions"==m&&(h="caption")):"urn:tva:metadata:cs:AudioPurposeCS:2007"==g&&("1"==m?E="visually impaired":"2"==m&&(E="hard of hearing"));else if(g=1,null!=m)for(y=(m=l(m.split(";"))).next();!y.done;y=m.next()){b=y.value;var I=y=void 0;b.includes("=")?(y="svc"+(b=b.split("="))[0],I=b[1].split(",")[0].split(":").pop()):(y="svc"+g,g++,I=b),k.set(y,Yi(I))}else k.set("svc1","und");else if(g=1,null!=m)for(b=(y=l(m=m.split(";"))).next();!b.done;b=y.next()){I=b.value;var M=b=void 0;I.includes("=")?(b=(I=I.split("="))[0].startsWith("CC")?I[0]:"CC"+I[0],M=I[1]||"und"):(b="CC"+g,2==m.length?g+=2:g++,M=I),k.set(b,Yi(M))}else k.set("CC1","und");var C=Bf(p=Nt(r,"ContentProtection"),t.g.dash.ignoreDrmInfo,t.g.dash.keySystemsByURI),D=Yi(n.ha.language||"und"),R=n.ha.label;if(r=(p=Nt(r,"Representation")).map((function(i){return(i=function(t,n,i,r,a,o,s,u,l,c,d,h){n.J=wg(t,c,n.ha,null);var f=n.J.id;if(t.da=Math.min(t.da,n.J.Wa),t.ga=0<t.da,!function(e){var t=e.Yc?1:0;return t+=e.Rb?1:0,0==(t+=e.ec?1:0)?e.contentType==yi||"application"==e.contentType:(1!=t&&(e.Yc&&(e.Rb=null),e.ec=null),!0)}(n.J))return null;var p=n.ka.start;n.bandwidth=Ft(c,"bandwidth",Wt)||0,n.roles=u;var g,m,v=Nt(c,"SupplementalProperty"),y=Nt(c,"EssentialProperty"),b=null,S=y.find((function(e){return"urn:mpeg:dash:urlparam:2014"==e.attributes.schemeIdUri}));(S||(S=v.find((function(e){return"urn:mpeg:dash:urlparam:2014"==e.attributes.schemeIdUri}))))&&(b=vg(t,S)),b&&(n.ob=b),b=(S=n.J.contentType)==yi||"application"==S,S="image"==S;try{var x=void 0;if(i.Je){var A=n.J.Oa,E=n.ob,k=aa(hi(A(),[i.Je.wi],E()),t.g.retryParameters);x={bitsKey:128,blockCipherMode:"CBC",iv:i.Je.iv,firstMediaSequenceNumber:0,fetchKey:function(){var n,i,r;return P((function(a){if(1==a.g)return w(a,Eg(t,k,6),2);if(3!=a.g){if(!(n=a.h).data||16!=n.data.byteLength)throw new De(2,4,4049);return i={name:"AES-CBC"},r=x,w(a,e.crypto.subtle.importKey("raw",n.data,i,!0,["decrypt"]),3)}r.cryptoKey=a.h,x.fetchKey=void 0,T(a)}))}}}if(n.J.aesKey=x,A=function(e,n,i,r){return xg(t,e,n,i,r)},n.J.Yc)var I=function(e,t,n){var i=Number(zf(e,ap,"presentationTimeOffset"))||0,r=zf(e,ap,"timescale"),a=1;r&&(a=Wt(r)||1);var o=i/a||0,s=ip(e,ap,n);!function(e,t){if(sp(e,t),!op(e))throw new De(2,4,4002)}(e,s);var u=It(e);return{nc:function(){var e=Wf(u,ap,"RepresentationIndex"),n=u.J.Oa();return e&&(e=vt(e.attributes.sourceURL))&&(n=hi(n,[e],u.ob())),e=op(u),rp(u,t,s,n,e.start,e.end,o)}}}(n,A,x);else if(n.J.Rb)I=function(e,t,n){var i=ip(e,lp,n),r=function(e){var t=function(e){return[e.J.Rb,e.ha.Rb,e.oa.Rb].filter(Gi).map((function(e){return Nt(e,"SegmentURL")})).reduce((function(e,t){return 0<e.length?e:t})).map((function(t){return t.attributes.indexRange&&!e.pf&&(e.pf=!0),{Ci:vt(t.attributes.media),start:(t=Ft(t,"mediaRange",qt,{start:0,end:null})).start,end:t.end}}))}(e),n=(e=Xf(e,lp)).zd;0==n&&(n=1);var i=0;return e.Qa?i=e.Qa*(n-1):e.timeline&&0<e.timeline.length&&(i=e.timeline[0].start),{Qa:e.Qa,startTime:i,zd:n,Pb:e.Pb,timeline:e.timeline,Rc:t}}(e);if(!r.Qa&&!r.timeline&&1<r.Rc.length)throw new De(2,4,4002);if(!r.Qa&&!e.ka.duration&&!r.timeline&&1==r.Rc.length)throw new De(2,4,4002);if(r.timeline&&0==r.timeline.length)throw new De(2,4,4002);var a=null,o=null;e.oa.id&&e.J.id&&(o=t[e.oa.id+","+e.J.id])&&(a=o.segmentIndex);var s=function(e,t,n,i,r,a,o,s,u,l){var c=i.Rc.length;i.timeline&&i.timeline.length!=i.Rc.length&&(c=Math.min(i.timeline.length,i.Rc.length));for(var d=e-i.Pb,h=t?e+t:1/0,f=[],p=i.startTime,g={},m=0;m<c;g={ve:void 0,ne:void 0},m++){g.ne=i.Rc[m];var v=p;p=void 0,p=null!=i.Qa?v+i.Qa:i.timeline?i.timeline[m].end:v+t,g.ve=null,(g=new vo(e+v,e+p,function(e){return function(){return null==e.ve&&(e.ve=hi(n(),[e.ne.Ci],l())),e.ve}}(g),g.ne.start,g.ne.end,r,d,e,h,[],"",null,null,bo,a)).codecs=s,g.mimeType=o,g.bandwidth=u,f.push(g)}return f}(e.ka.start,e.ka.duration,e.J.Oa,r,i,n,e.J.mimeType,e.J.codecs,e.bandwidth,e.ob);return t=!a,a?a.td(s,e.presentationTimeline.qb()):a=new Zs(s),e.presentationTimeline.vd(s),e.xb&&e.ka.uf||a.Kc(e.ka.start,e.ka.duration?e.ka.start+e.ka.duration:1/0,t),o&&(o.segmentIndex=a),{nc:function(){return a&&0!=a.getNumReferences()||a.Zd(s),Promise.resolve(a)}}}(n,t.o,x);else if(n.J.ec)I=cp(n,A,t.o,!!t.i,t.g.dash.initialSegmentLimit,t.ja,x,h,!1);else{var M=n.ka.duration||0,C=n.J.Oa,D=n.J.mimeType,R=n.J.codecs;I={nc:function(){var e=tu(p,M,C());return e.yb((function(e){e.mimeType=D,e.codecs=R})),Promise.resolve(e)}}}}catch(e){if((b||S)&&4002==e.code)return null;throw e}if(c=function(e,t,n,i){var r=Bf(e,n,i);if(t.wg)e=1==t.drmInfos.length&&!t.drmInfos[0].keySystem,n=0==r.drmInfos.length,(0==t.drmInfos.length||e&&!n)&&(t.drmInfos=r.drmInfos),t.wg=!1;else if(0<r.drmInfos.length&&(t.drmInfos=t.drmInfos.filter((function(e){return r.drmInfos.some((function(t){return t.keySystem==e.keySystem}))})),0==t.drmInfos.length))throw new De(2,4,4008);return r.rg||t.rg}(c=Nt(c,"ContentProtection"),i,t.g.dash.ignoreDrmInfo,t.g.dash.keySystemsByURI),c=new Set(c?[c]:[]),h=!1,v.some((function(e){return"tag:dolby.com,2018:dash:EC3_ExtensionType:2018"==e.attributes.schemeIdUri&&"JOC"==e.attributes.value}))&&(h=!0),v=!1,b&&(v=u.includes("forced_subtitle")||u.includes("forced-subtitle")),S&&((y=y.find((function(e){return["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"].includes(e.attributes.schemeIdUri)})))&&(g=y.attributes.value),!g))return null;b=n.J.codecs,n.profiles.includes("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&(b.includes("hvc1.2.4.L153.B0")||b.includes("hev1.2.4.L153.B0"))&&(m="PQ"),y=n.J.id?n.oa.id+","+n.J.id:"",t.F.length&&f&&t.s.set(n.oa.id+","+f,function(e){function t(e){return e?((e=It(e)).Yc=null,e.Rb=null,e.ec=an(e.ec),e):null}return(e=It(e)).oa=t(e.oa),e.ha=t(e.ha),e.J=t(e.J),e.ka&&(e.ka=It(e.ka),e.ka.node=null),e}(n));var L=y&&t.o[y]?t.o[y]:{id:t.na++,originalId:n.J.id,groupId:null,createSegmentIndex:function(){return Promise.resolve()},closeSegmentIndex:function(){L.segmentIndex&&(L.segmentIndex.release(),L.segmentIndex=null)},segmentIndex:null,mimeType:n.J.mimeType,codecs:b,frameRate:n.J.frameRate,pixelAspectRatio:n.J.pixelAspectRatio,bandwidth:n.bandwidth,width:n.J.width,height:n.J.height,kind:r,encrypted:0<i.drmInfos.length,drmInfos:i.drmInfos,keyIds:c,language:a,originalLanguage:n.ha.language,label:o,type:n.ha.contentType,primary:s,trickModeVideo:null,emsgSchemeIdUris:n.J.emsgSchemeIdUris,roles:u,forced:v,channelsCount:n.J.ce,audioSamplingRate:n.J.audioSamplingRate,spatialAudio:h,closedCaptions:l,hdr:m,colorGamut:void 0,videoLayout:void 0,tilesLayout:g,accessibilityPurpose:d,external:!1,fastSwitching:!1,fullMimeTypes:new Set([xi(n.J.mimeType,n.J.codecs)]),isAudioMuxedInVideo:!1};return L.createSegmentIndex=function(){var e;return P((function(t){if(1==t.g)return L.segmentIndex?t.u(0):(e=L,w(t,I.nc(),3));e.segmentIndex=t.h,T(t)}))},y&&n.xb&&!t.o[y]&&(n=n.oa.id||"",t.B[n]||(t.B[n]=[]),t.o[y]=L,t.B[n].push(y)),L}(t,n,C,h,D,R,u,d,k,i,E,A))&&(i.hdr=i.hdr||S,i.colorGamut=i.colorGamut||x,i.fastSwitching=v),i})).filter((function(e){return!!e})),0==r.length){if(i="image"==n.ha.contentType,t.g.dash.ignoreEmptyAdaptationSet||f||i)return null;throw new De(2,4,4003)}if(!n.ha.contentType||"application"==n.ha.contentType)for(n.ha.contentType=Ag(r[0].mimeType,r[0].codecs),g=(f=l(r)).next();!g.done;g=f.next())g.value.type=n.ha.contentType;for(f=n.ha.id||"__fake__"+t.na++,m=(g=l(r)).next();!m.done;m=g.next()){for(m=m.value,b=(y=l(C.drmInfos)).next();!b.done;b=y.next())(b=b.value).keyIds=b.keyIds&&m.keyIds?new Set([].concat(c(b.keyIds),c(m.keyIds))):b.keyIds||m.keyIds;m.groupId=f}return p=p.map((function(e){return e.attributes.id})).filter(Gi),{id:f,contentType:n.ha.contentType,language:D,lk:u,streams:r,drmInfos:C.drmInfos,bg:i,Qi:p}}(t,n,r,i)})).filter(Gi),n.xb){for(r=[],o=(a=l(i)).next();!o.done;o=a.next())for(var s=(o=l(o.value.Qi)).next();!s.done;s=o.next())r.push(s.value);if(r.length!=new Set(r).size)throw new De(2,4,4018)}if(r=i.filter((function(e){return!e.bg})),i=i.filter((function(e){return e.bg})),!t.g.disableIFrames)for(a=(i=l(i)).next();!a.done;a=i.next()){o=(a=a.value).bg.split(" ");for(var u=(s=l(r)).next();!u.done;u=s.next())if(u=u.value,o.includes(u.id))for(var d=(u=l(u.streams)).next();!d.done;d=u.next())Sr(d.value,a.streams)}if(i=mg(t.g.disableAudio,r,"audio"),a=mg(t.g.disableVideo,r,"video"),o=mg(t.g.disableText,r,yi),r=mg(t.g.disableThumbnails,r,"image"),0===a.length&&0===i.length)throw new De(2,4,4004);return{id:n.oa.id,audioStreams:i,videoStreams:a,textStreams:o,imageStreams:r}}function mg(e,t,n){return e||!t.length?[]:t.reduce((function(e,t){return t.contentType!=n||e.push.apply(e,c(t.streams)),e}),[])}function vg(e,t){if((t=Bt(t,"urn:mpeg:dash:schema:urlparam:2014","UrlQueryInfo"))&&Ft(t,"useMPDUrlQuery",$t,!1)){var n=t.attributes.queryTemplate;if(n)return function(){return"$querypart$"==n?e.aa:n.split("&").map((function(t){if("$querypart$"==t)return e.aa;var n=/\$query:(.*?)\$/g.exec(t);if(n&&2==n.length){n=n[1];var i=new ni(e.aa).get(n);if(i.length)return n+"="+i[0]}return t})).join("&")}}return null}function yg(e){var t,n;return P((function(i){switch(i.g){case 1:return t=0,S(i,2),w(i,ag(e),4);case 4:t=i.h,A(i,3);break;case 2:if(n=E(i),e.j){if(e.g.raiseFatalErrorOnManifestUpdateRequestFailure)return e.j.onError(n),i.return();n.severity=1,e.j.onError(n)}case 3:if(!e.j)return i.return();e.j.onManifestUpdated(),bg(e,t),T(i)}}))}function bg(e,t){if(!(0>e.K)){var n=e.K;0<=e.g.dash.updatePeriod&&(n=e.g.dash.updatePeriod),e.L.$(Math.max(n-t,K(e.ra)))}}function wg(e,t,n,i){n=n||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,pixelAspectRatio:void 0,ce:null,audioSamplingRate:null,Wa:0,oe:0},i=i||n.Oa;var r,a=t.attributes.id,o=Nt(t,"BaseURL"),s=!1;if(e.h)for(var u=l(o),c=u.next();!c.done;c=u.next()){var d=c.value;c=d.attributes.serviceLocation,d=Ot(d),c&&d&&(bp(e.h,a,c,d),s=!0)}s&&e.h||(r=o.map(Ot)),u=t.attributes.contentType||n.contentType,c=t.attributes.mimeType||n.mimeType,d=[t.attributes.codecs||n.codecs];var h=Vt(t,"urn:scte:dash:scte214-extensions","supplementalCodecs");h&&d.push(h),d=Cu(d).join(","),h=Ft(t,"frameRate",Qt)||n.frameRate;var f=t.attributes.sar||n.pixelAspectRatio,p=function(e,t){t=t.slice();for(var n=(e=l(e)).next();!n.done;n=e.next())n=n.value.attributes.schemeIdUri,t.includes(n)||t.push(n);return t}(Nt(t,"InbandEventStream"),n.emsgSchemeIdUris),g=Nt(t,"AudioChannelConfiguration");g=function(e){for(var t=(e=l(e)).next();!t.done;t=e.next()){var n=(t=t.value).attributes.schemeIdUri;if(n&&(t=t.attributes.value))switch(n){case"urn:mpeg:dash:outputChannelPositionList:2012":return t.trim().split(/ +/).length;case"urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case"urn:dts:dash:audio_channel_configuration:2012":if(!(t=parseInt(t,10)))continue;return t;case"tag:dolby.com,2015:dash:audio_channel_configuration:2015":if(n=[2,1,2,2,2,2,1,2,2,1,1,1,1,2,1,1,2,2],!(t=parseInt(t,16)))continue;for(var i=0,r=0;r<n.length;r++)t&1<<r&&(i+=n[r]);if(i)return i;continue;case"tag:dolby.com,2014:dash:audio_channel_configuration:2011":case"urn:dolby:dash:audio_channel_configuration:2011":if(n=[1,1,1,1,1,2,2,1,1,2,2,2,1,2,1,1].reverse(),!(t=parseInt(t,16)))continue;for(r=i=0;r<n.length;r++)t&1<<r&&(i+=n[r]);if(i)return i;continue;case"urn:mpeg:mpegB:cicp:ChannelConfiguration":if(n=[0,1,2,3,4,5,6,8,2,3,4,7,8,24,8,12,10,12,14,12,14],(t=parseInt(t,10))&&0<t&&t<n.length)return n[t]}}return null}(g)||n.ce;var m=Ft(t,"audioSamplingRate",Yt)||n.audioSamplingRate;u||(u=Ag(c,d));var v=_t(t,"SegmentBase"),y=_t(t,"SegmentTemplate"),b=v&&Ft(v,"availabilityTimeOffset",Jt)||0,w=y&&Ft(y,"availabilityTimeOffset",Jt)||0,T=o&&o.length&&Ft(o[0],"availabilityTimeOffset",Jt)||0;b=n.Wa+T+b+w,w=null,(T=_t(t,"SegmentSequenceProperties"))&&(T=_t(T,"SAP"))&&(w=Ft(T,"cadence",zt)),T=t.attributes.label;var S=Nt(t,"Label");return S&&S.length&&jt(S=S[0])&&(T=jt(S)),{Oa:function(){return hi(i(),o.length?e.h&&s?wp(e.h,a):r||[]:[])},Yc:v||n.Yc,Rb:_t(t,"SegmentList")||n.Rb,ec:y||n.ec,width:Ft(t,"width",Yt)||n.width,height:Ft(t,"height",Yt)||n.height,contentType:u,mimeType:c,codecs:d,frameRate:h,pixelAspectRatio:f,emsgSchemeIdUris:p,id:a,language:t.attributes.lang,ce:g,audioSamplingRate:m,Wa:b,Ud:null,oe:w||n.oe,label:T||null}}function Tg(e,t,n,i){var r,a,o,s,u,l,c;return P((function(d){if(1==d.g)return r=[vt(n)],a=hi(t(),r),(o=aa(a,e.g.retryParameters)).method=i,s=e.j.networkingEngine.request(4,o,{isPreload:e.fa()}),ta(e.S,s),w(d,s.promise,2);if(u=d.h,"HEAD"==i){if(!u.headers||!u.headers.date)return d.return(0);l=u.headers.date}else l=dt(u.data);return c=Date.parse(l),isNaN(c)?d.return(0):d.return(c-Date.now())}))}function Sg(e,t,n,i,r){for(var a=i.attributes.schemeIdUri||"",o=i.attributes.value||"",s=Ft(i,"timescale",Yt)||1,u=Ft(i,"presentationTimeOffset",Yt)||0,c=(i=l(Nt(i,"Event"))).next();!c.done;c=i.next()){var d=Ft(c=c.value,"presentationTime",Yt)||0,h=Ft(c,"duration",Yt)||0;h=(d=Math.max((d-u)/s+t,t))+h/s,null!=n&&(d=Math.min(d,t+n),h=Math.min(h,t+n)),h<r||(c={schemeIdUri:a,value:o,startTime:d,endTime:h,id:c.attributes.id||"",eventElement:rn(c),eventNode:an(c)},e.j.onTimelineRegionAdded(c))}}function xg(e,t,n,i,r){var a,o,s,u;return P((function(l){return 1==l.g?(a=ca,o=r?0:1,s=Ru(t,n,i,e.g.retryParameters),w(l,Eg(e,s,a,{type:o}),2)):(u=l.h,l.return(u.data))}))}function Ag(e,t){return Ui(t=xi(e,t))?yi:e.split("/")[0]}function Eg(e,t,n,i){return i||(i={}),i.isPreload=e.fa(),t=e.j.networkingEngine.request(n,t,i),ta(e.S,t),t.promise}function kg(){}(i=rg.prototype).configure=function(e,t){var n=this.j&&e.dash.updatePeriod!=this.g.dash.updatePeriod&&0<=e.dash.updatePeriod;this.g=e,t&&(this.fa=t),n&&this.i&&this.i.presentationTimeline.U()&&this.L.hc(),this.h&&this.h.configure(this.g),this.m&&(this.m.bh(this.g.dash.multiTypeVariantsAllowed&&ie()),this.m.ih(this.g.dash.useStreamOnceInPeriodFlattening))},i.start=function(e,t){var n,i=this;return P((function(r){if(1==r.g)return i.H=t.isLowLatencyMode(),i.A=[e],i.j=t,w(r,ag(i),2);if(n=r.h,i.j&&bg(i,n),!i.j)throw new De(2,7,7001);return r.return(i.i)}))},i.stop=function(){for(var e=l(Object.values(this.o)),t=e.next();!t.done;t=e.next())(t=t.value).segmentIndex&&t.segmentIndex.release();return this.m&&this.m.release(),this.g=this.j=null,this.A=[],this.i=null,this.o={},this.B={},this.s.clear(),this.l={ae:"",type:"",profiles:[],Mb:null,Wa:0,Oa:null,xd:0},this.m=null,null!=this.L&&(this.L.stop(),this.L=null),this.h&&this.h.destroy(),this.G&&(this.G.release(),this.G=null),this.S.destroy()},i.update=function(){var e,t=this;return P((function(n){return 1==n.g?(S(n,2),w(n,ag(t),4)):2!=n.g?A(n,0):(e=E(n),t.j&&e?(t.j.onError(e),void T(n)):n.return())}))},i.onExpirationUpdated=function(){},i.onInitialVariantChosen=function(e){if(this.i&&this.i.presentationTimeline.U()){var t=e.video||e.audio;if(t&&t.segmentIndex){e=this.i.presentationTimeline.Yb();var n=t.segmentIndex.find(e);null!=n&&(t=t.segmentIndex.get(n))&&(this.K=t.endTime-e,bg(this,0))}}},i.banLocation=function(e){this.h&&this.h.banLocation(e)},i.setMediaElement=function(e){this.I=e},F("shaka.dash.DashParser",rg),co["application/dash+xml"]=function(){return new rg},co["video/vnd.mpeg.dash.mpd"]=function(){return new rg},F("shaka.dependencies",kg),kg.has=function(e){return Cg.has(e)},kg.add=function(e,t){if(!Mg[e])throw Error(e+" is not supported");e==Ig?oe("mux.js","mux.js is no longer used in Shaka Player."):Cg.set(e,(function(){return t}))};var Ig="muxjs",Mg={mk:Ig,ISOBoxer:"ISOBoxer"};kg.Allowed=Mg;var Cg=new Map([["ISOBoxer",function(){return e.ISOBoxer}]]);function Dg(e,t,n){this.type=e,this.X=t,this.segments=n||null}function Rg(e,t,n,i){this.id=e,this.name=t,this.attributes=n,this.value=void 0===i?null:i}function Pg(e,t){return t?e.toString():(t=(new Set).add("AUDIO").add("VIDEO").add("SUBTITLES").add("PATHWAY-ID").add("GROUP-ID").add("URI"),e.toString(t))}function Lg(e,t){return(e=e.attributes.filter((function(e){return e.name==t}))).length?e[0]:null}function Ng(e,t,n){return(e=Lg(e,t))?e.value:n||null}function jg(e,t){if(!(e=Lg(e,t)))throw new De(2,4,4023,t);return e.value}function Og(e,t,n){n=void 0===n?[]:n,this.X=t,this.g=e,this.Cb=n}function Ug(e,t){this.name=e,this.value=t}function _g(e,t){return e.filter((function(e){return e.name==t}))}function Bg(e,t){return e.filter((function(e){return jg(e,"TYPE")==t}))}function Fg(e,t){for(var n=(e=l(e)).next();!n.done;n=e.next())if((n=n.value).name===t)return n;return null}function Vg(e,t,n){return n=void 0===n?0:n,(e=Fg(e,t))?Number(e.value):n}function Hg(e,t,n){return t?Gg(e,[t],n):[]}function Gg(e,t,n){if(!t.length)return[];t=hi(e,t),e=[];for(var i=(t=l(t)).next();!i.done;i=t.next())e.push(Kg(i.value,n));return e}function Kg(e,t){if(!t||!t.size)return e;var n=(e=String(e).replace(/%7B/g,"{").replace(/%7D/g,"}")).match(/{\$\w*}/g);if(n)for(var i=(n=l(n)).next();!i.done;i=n.next()){var r=(i=i.value).slice(2,i.length-1),a=t.get(r);if(!a)throw new De(2,4,4039,r);e=e.replace(i,a)}return e}function Xg(){this.g=0}function qg(e,t){var n=(t=(t=dt(t)).replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim()).split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(n[0]))throw new De(2,4,4015);t=0;for(var i=!0,r=l(n),a=r.next();!a.done;a=r.next())if(a=a.value,/^#(?!EXT)/m.test(a)||i)i=!1;else{if(a=zg(e,a),--e.g,Wg.includes(a.name)){t=1;break}"EXT-X-STREAM-INF"==a.name&&(i=!0)}for(r=[],i=!0,a=0;a<n.length;a++){var o=n[a],s=n[a+1];if(/^#(?!EXT)/m.test(o)||i)i=!1;else{if(o=zg(e,o),Yg.includes(o.name)){if(1!=t)throw new De(2,4,4017);o=n.splice(a,n.length-a),n=[],i=[],a=[],s=null;for(var u=(o=l(o)).next();!u.done;u=o.next())u=u.value,/^(#EXT)/.test(u)?(u=zg(e,u),Wg.includes(u.name)?r.push(u):"EXT-X-MAP"==u.name?s=u:"EXT-X-PART"==u.name?a.push(u):"EXT-X-PRELOAD-HINT"==u.name?"PART"==Ng(u,"TYPE")?a.push(u):"MAP"==Ng(u,"TYPE")&&(u.name="EXT-X-MAP",s=u):i.push(u)):/^#(?!EXT)/m.test(u)||(u=u.trim(),s&&i.push(s),n.push(new Og(u,i,a)),i=[],a=[]);return a.length&&(s&&i.push(s),n.push(new Og("",i,a))),new Dg(t,r,n)}r.push(o),"EXT-X-STREAM-INF"==o.name&&(o.attributes.push(new Ug("URI",s)),i=!0)}}return new Dg(t,r)}function zg(e,t){e=e.g++;var n=t.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!n)throw new De(2,4,4016,t);t=n[1];var i,r=n[2];if(n=[],r){var a;(a=Tt(r=new bt(r),/^([^,=]+)(?:,|$)/g))&&(i=a[1]);for(var o=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;a=Tt(r,o);)n.push(new Ug(a[1],a[2]||a[3])),wt(r)}return new Rg(e,t,n,i)}Rg.prototype.toString=function(e){var t="#"+this.name,n=this.attributes?this.attributes.filter((function(t){return!e||!e.has(t.name)})).map((function(e){return e.name+"="+(isNaN(Number(e.value))?'"'+e.value+'"':e.value)})):[];return this.value&&n.unshift(this.value),0<n.length&&(t+=":"+n.join(",")),t};var Wg="EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-I-FRAMES-ONLY EXT-X-ENDLIST EXT-X-SERVER-CONTROL EXT-X-SKIP EXT-X-PART-INF EXT-X-DATERANGE".split(" "),Yg="EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE EXT-X-MAP EXT-X-GAP".split(" ");function Jg(){}function $g(e){try{var t=Qg(e);return zr({uri:e,originalUri:e,data:t.data,headers:{"content-type":t.contentType}})}catch(e){return Xr(e)}}function Qg(t){var n=t.split(":");if(2>n.length||"data"!=n[0])throw new De(2,1,1004,t);if(2>(n=n.slice(1).join(":").split(",")).length)throw new De(2,1,1004,t);var i=n[0];t=e.decodeURIComponent(n.slice(1).join(",")),n=i.split(";"),i=n[0];var r=!1;return 1<n.length&&"base64"==n[n.length-1]&&(r=!0,n.pop()),{data:r?ui(t):pt(t),contentType:i}}function Zg(){var e=this;this.g=this.h=null,this.C=1,this.A=new Map,this.H=new Map,this.O=new Map,this.O.set("video",new Map),this.O.set("audio",new Map),this.O.set(yi,new Map),this.O.set("image",new Map),this.Na=new Set,this.i=new Map,this.l=null,this.M="",this.Ka=new Xg,this.I=-1,this.ga=1/0,this.fa=this.ac=this.bc=!1,this.B=new Be((function(){e.aa&&!e.g.continueLoadingWhenPaused&&(e.Z.cb(e.aa,"timeupdate"),e.aa.paused)?e.Z.pa(e.aa,"timeupdate",(function(){return jm(e)})):jm(e)})),this.xa=Xm,this.m=null,this.La=0,this.o=1/0,this.Ga=this.Ba=this.Y=0,this.da=new ea,this.F=new Map,this.G=new Map,this.ta=new Map,this.ja=new Map,this.L=new Map,this.ra=new Map,this.na=new Map,this.Ib=this.K=!1,this.Gb=new G(5),this.j=null,this.S=!0,this.Aa=new Set,this.Z=new Z,this.s=this.aa=null,this.Hb=function(){return!1}}function em(e,t){return Om(e)?e.O.get(t.type):t.Yd}function tm(e,t){var n,i,r,a,o,s,u,d,h,f,p,g,m,v,y,b,x,k,I,M,C,D,R,L,N,j,O,U,_,B,F,V,H;return P((function(P){switch(P.g){case 1:if(t.stream.isAudioMuxedInVideo)return P.return();for(n=[],i=l(t.N()),r=i.next();!r.done;r=i.next())a=r.value,o=new Gn(a),s=o.g,t.Id&&(0<=t.sb&&s.add("_HLS_msn",String(t.sb)),0<=t.ub&&s.add("_HLS_part",String(t.ub))),t.Jd&&s.add("_HLS_skip","YES"),ri(s)&&zn(o,s),n.push(o.toString());return S(P,2),w(P,Nm(e,n,!0).promise,4);case 4:u=P.h,A(P,3);break;case 2:throw d=E(P),e.h&&e.h.disableStream(t.stream),d;case 3:if(!t.stream.segmentIndex)return P.return();if(1!=(h=qg(e.Ka,u.data)).type)throw new De(2,4,4017);return(f=u.uri)==u.originalUri||t.N().includes(f)||t.Wg.push(f),p=_g(h.X,"EXT-X-DEFINE"),g=am(e,p,f),m=t.stream,v=em(e,t),w(P,wm(e,h,m.mimeType,t.N,g),5);case 5:for(y=P.h,b=y.keyIds,x=y.drmInfos,function(e,t){return e.size===t.size&&[].concat(c(e)).every((function(e){return t.has(e)}))}(m.keyIds,b)||(m.keyIds=b,m.drmInfos=x,e.h.newDrmInfo(m)),k=Cm(e,h,v,g,t.N,t.type),I=k.segments,(M=k.bandwidth)&&(m.bandwidth=M),C=Iu(m),D=l(I),R=D.next();!R.done;R=D.next())(L=R.value).ba&&(L.ba.Qc=C);m.segmentIndex.td(I,e.l.qb()),I.length&&(N=Vg(h.X,"EXT-X-MEDIA-SEQUENCE",0),O=(j=Fg(h.X,"EXT-X-SKIP"))?Number(Ng(j,"SKIPPED-SEGMENTS")):0,U=ym(N,I),_=U.sb,B=U.ub,t.sb=_+O,t.ub=B,F=v.get(N),m.segmentIndex.Ha(F)),(V=eu(m.segmentIndex))&&(t.xc=V.startTime,H=I[I.length-1],t.Lb=H.endTime),Fg(h.X,"EXT-X-ENDLIST")&&(t.kd=!0),xm(e,h),Mm(e,h.X,m.type,g,t.N),T(P)}}))}function nm(e,t,n){n=void 0!==n&&n;for(var i=-1==e.I,r=l(t),a=r.next();!a.done;a=r.next()){var o=(a=a.value).stream.segmentIndex,s=em(e,a);if(o=eu(o))for(var u=(s=l(s)).next();!u.done;u=s.next()){var c=(u=l(u.value)).next().value;if(u.next().value==o.startTime){i&&(e.I=Math.max(e.I,c)),a.Ue=c;break}}}if(!(0>e.I))for(i=(t=l(t)).next();!i.done;i=t.next())(mm(e,(i=i.value).type)||n)&&(r=i.stream.segmentIndex)&&0<(a=e.I-i.Ue)&&(r.g.splice(0,a),r=eu(r))&&(r=-r.startTime,i.stream.segmentIndex.offset(r),im(e,i,r))}function im(e,t,n){t.xc+=n,t.Lb+=n;for(var i=l(e=em(e,t)),r=i.next();!r.done;r=i.next()){var a=l(r.value);r=a.next().value,a=a.next().value,e.set(r,a+n)}t.N()}function rm(e){if(Om(e)){if(e.xa==zm){for(var t=1/0,n=1/0,i=l(e.i.values()),r=i.next();!r.done;r=i.next())(r=r.value).stream.segmentIndex&&"text"!=r.stream.type&&!r.stream.isAudioMuxedInVideo&&(t=Math.min(t,r.Lb),n=Math.min(n,r.xc));t=t-n||0,isNaN(e.g.availabilityWindowOverride)||(t=e.g.availabilityWindowOverride),e.l.pe(t)}}else e.l.bb(fm(e));if(!e.l.s)for(n=(t=l(e.i.values())).next();!n.done;n=t.next())!(n=n.value).stream.segmentIndex||"audio"!=n.type&&"video"!=n.type||(n=eu(n.stream.segmentIndex))&&n.h&&e.l.fh(n.h);e.l.Xd()}function am(e,t,n){n=new Gn(n).g;for(var i=new Map,r=(t=l(t)).next();!r.done;r=t.next()){var a=r.value,o=Ng(a,"NAME"),s=Ng(a,"VALUE");r=Ng(a,"QUERYPARAM"),a=Ng(a,"IMPORT"),o&&s&&(i.has(o)||i.set(o,s)),r&&(o=n.get(r)[0])&&!i.has(o)&&i.set(r,o),a&&(r=e.A.get(a))&&i.set(a,r)}return i}function om(e){var t=new Set([xi(e.mimeType,e.codecs)]);e.segmentIndex&&e.segmentIndex.yb((function(n){n.mimeType&&t.add(xi(n.mimeType,e.codecs))})),e.fullMimeTypes=t}function sm(e,t,n){for(var i={audio:[],video:[]},r=new Map,a=[],o=!1,s=!1,u=l(t),d=u.next();!d.done;d=u.next()){var h=d.value;d=Ng(h,"AUDIO");var f=Ng(h,"VIDEO"),p=d||f;p&&(a.includes(p)||a.push(p),(h=Ng(h,"PATHWAY-ID"))&&r.set(p,h),d?o=!0:f&&(s=!0))}a.length&&n.length&&function(e,t,n){t=t.filter((function(e){var t=Ng(e,"URI")||"";return"SUBTITLES"!=(e=Ng(e,"TYPE"))&&(""!=t||"AUDIO"==e)}));for(var i={},r=(t=l(t)).next();!r.done;r=t.next()){var a=Pg(r=r.value,!e.j);i[a]?i[a].push(r):i[a]=[r]}for(var o in i)cm(e,i[o],n,!1)}(e,n=n.filter((function(e){return a.includes(jg(e,"GROUP-ID"))})),r),n=(r=a.sort().join(","))&&e.H.has(r)?e.H.get(r):[],o?i.audio.push.apply(i.audio,c(n)):s&&i.video.push.apply(i.video,c(n)),o=!1;var g=t.map((function(e){return jg(e,"URI")}));return d=i.audio.find((function(e){return e&&e.N().find((function(e){return g.includes(e)}))})),n=mi("video",s=um(e,t[0])),(u=mi("audio",s))&&!n?(d="audio",o=0<i.audio.length):!i.audio.length&&!i.video.length&&u&&n?(d="video",s=[[n,u].join()]):i.audio.length&&d?(d="audio",o=!0):d=i.video.length&&!i.audio.length?"audio":"video",o||(e=function(e,t,n,i){for(var r=e.C++,a=[],o=l(t),s=o.next();!s.done;s=o.next()){var u=s.value;s=jg(u,"URI"),u=Ng(u,"PATHWAY-ID"),e.j&&u&&bp(e.j,r,u,s),a.push(s)}if(o=a.sort().join(","),e.i.has(o))return e.i.get(o);e:{if(t=Ng(t[0],"CLOSED-CAPTIONS"),"video"==i){if(e.g.disableText){e.S=!1,t=null;break e}if(t){if("NONE"!=t){t=e.F.get(t);break e}e.S=!1}else if(!t&&e.F.size)for(t=l(e.F.keys()).next();!t.done;){t=e.F.get(t.value);break e}}t=null}return i=hm(e,r,a,n=gi(i,n),i,null,!1,null,null,t,null,!1,null,!1),e.i.set(o,i),i}(e,t,s,d),r&&(e.stream.groupId=r),i[e.stream.type]=[e]),i}function um(e,t){var n=Ng(t,"CODECS")||"";return t=Ng(t,"SUPPLEMENTAL-CODECS"),e.fa=0<n.length,e.fa||e.g.hls.disableCodecGuessing||(n=[],e.g.disableVideo||n.push(e.g.hls.defaultVideoCodec),e.g.disableAudio||n.push(e.g.hls.defaultAudioCodec),n=n.join(",")),e=n.split(/\s*,\s*/),t&&(t=t.split(/\s*,\s*/).map((function(e){return e.split("/")[0]})),e.push.apply(e,c(t))),Cu(e)}function lm(e,t,n,i,r,a,o,s,u,c,d,h){for(var f=l(n),p=f.next();!p.done;p=f.next())Lm(p.value.stream,r,a,o,s,u,null);for(r=e.g.disableAudio,t.length&&!r||(t=[null]),r=e.g.disableVideo,n.length&&!r||(n=[null]),r=[],a=(t=l(t)).next();!a.done;a=t.next())for(a=a.value,s=(o=l(n)).next();!s.done;s=o.next()){var g=s.value;(s=a?a.stream:null)&&(s.drmInfos=c,s.keyIds=d),(u=g?g.stream:null)&&(u.drmInfos=c,u.keyIds=d,e.g.disableIFrames||Sr(u,h)),u&&!s&&(u.bandwidth=i),!u&&s&&(s.bandwidth=i),f=a?a.stream.drmInfos:null,p=g?g.stream.drmInfos:null,g=(g=g?g.N().sort().join(","):"")+" - "+(a?a.N().sort().join(","):""),s&&u&&!Le(f,p)||e.Na.has(g)||(s={id:e.C++,language:s?s.language:"und",disabledUntilTime:0,primary:!!s&&s.primary||!!u&&u.primary,audio:s,video:u,bandwidth:i,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},r.push(s),e.Na.add(g))}return r}function cm(e,t,n,i){i=void 0===i||i;for(var r=[],a=[],o=new Map,s=l(t),u=s.next();!u.done;u=s.next()){var c=u.value;u=i?jg(c,"URI"):Ng(c,"URI")||"shaka://hls-muxed",c=jg(c,"GROUP-ID"),r.push(u),a.push(c),o.set(c,u)}if(i=a.sort().join(","),u=t[0],t="","subtitles"==(s=jg(u,"TYPE").toLowerCase())&&(s=yi),s==yi)t=Ng(u,"CODECS")||"";else for(c=(a=l(a)).next();!c.done;c=a.next())if(c=c.value,e.G.has(c)){t=e.G.get(c);break}if(a=r.sort().join(","),e.i.has(a))return e.i.get(a);if(c=e.C++,e.j)for(var d=(o=l(o)).next();!d.done;d=o.next()){var h=l(d.value);d=h.next().value,h=h.next().value,(d=n.get(d))&&bp(e.j,c,d,h)}n=Ng(u,"LANGUAGE"),o=Ng(u,"NAME"),d="YES"==Ng(u,"DEFAULT"),h="audio"==s&&(h=Ng(u,"CHANNELS"))?parseInt(h.split("/")[0],10):null;var f="audio"==s&&!!(f=Ng(u,"CHANNELS"))&&f.includes("/JOC");return(r=hm(e,c,r,t,s,n,d,o,h,null,Ng(u,"CHARACTERISTICS"),"YES"==Ng(u,"FORCED"),u="audio"==s&&(u=Ng(u,"SAMPLE-RATE"))?parseInt(u,10):null,f)).stream&&(r.stream.groupId=i),e.H.has(i)?e.H.get(i).push(r):e.H.set(i,[r]),e.i.set(a,r),r}function dm(e,t){var n="video",i=jg(t,"URI"),r=Ng(t,"CODECS")||"";if("mjpg"==r&&(n="image"),e.i.has(i))return e.i.get(i);var a=Ng(t,"LANGUAGE"),o=Ng(t,"NAME"),s=Ng(t,"CHARACTERISTICS");return n=hm(e,e.C++,[i],r,n,a,!1,o,null,null,s,!1,null,!1),a=l((r=Ng(t,"RESOLUTION"))?r.split("x"):[null,null]),r=a.next().value,a=a.next().value,n.stream.width=Number(r)||void 0,n.stream.height=Number(a)||void 0,(t=Ng(t,"BANDWIDTH"))&&(n.stream.bandwidth=Number(t)),e.i.set(i,n),n}function hm(e,t,n,i,r,a,o,s,u,c,d,h,f,p){function g(){return e.j&&1<n.length?wp(e.j,t):y.concat(Gg([e.M],n,e.A))}var m=bm(e,i,r,a,o,s,u,c,d,h,f,p);n.includes("shaka://hls-muxed")&&(m.isAudioMuxedInVideo=!0,m.mimeType="video/mp2t",om(m));var v,y=[],b={stream:m,type:r,Wg:y,N:g,xc:0,Lb:0,Yd:new Map,Jd:!1,Id:!1,kd:!1,Ue:-1,sb:-1,ub:-1,zf:!1},x=null;return m.createSegmentIndex=function(){return x||(m.isAudioMuxedInVideo?(m.segmentIndex=new Zs([]),Promise.resolve()):(v=Nm(e,b.N(),!0),x=new Promise((function(t){t(function(t){var n,v,x,k,I,M,C,D,R,L,N,j,O,U,_,B,F,V,H,G,K,X;return P((function(P){switch(P.g){case 1:return n=bi,S(P,2),v=b.N(),w(P,t.promise,4);case 4:if(x=P.h,t.aborted)return P.return();if((k=x.uri)==x.originalUri||v.includes(k)||y.push(k),1!=(I=qg(e.Ka,x.data)).type)throw new De(2,4,4017);return M=_g(I.X,"EXT-X-DEFINE"),C=am(e,M,k),D=!1,(!e.fa&&e.g.hls.disableCodecGuessing||e.S&&r==n.la&&!e.g.hls.disableClosedCaptionsDetection)&&0<I.segments.length&&(e.S=!1,D=!0),R=!e.fa&&e.g.hls.disableCodecGuessing,L=Om(e),w(P,vm(e,0,C,I,g,i,r,a,o,s,u,c,d,h,f,p,void 0,D,R),5);case 5:if(N=P.h,t.aborted)return P.return();if(j=N.stream,Sm(e,I),Om(e)&&!L&&Am(e,I),b.xc=N.xc,b.Lb=N.Lb,b.Jd=N.Jd,b.Id=N.Id,b.kd=N.kd,b.Yd=N.Yd,b.sb=N.sb,b.ub=N.ub,b.zf=!0,m.segmentIndex=j.segmentIndex,m.encrypted=j.encrypted,m.drmInfos=j.drmInfos,m.keyIds=j.keyIds,m.mimeType=j.mimeType,m.bandwidth=m.bandwidth||j.bandwidth,m.codecs=m.codecs||j.codecs,m.closedCaptions=m.closedCaptions||j.closedCaptions,m.width=m.width||j.width,m.height=m.height||j.height,m.hdr=m.hdr||j.hdr,m.colorGamut=m.colorGamut||j.colorGamut,m.frameRate=m.frameRate||j.frameRate,"und"==m.language&&"und"!=j.language&&(m.language=j.language),m.language=m.language||j.language,m.channelsCount=m.channelsCount||j.channelsCount,m.audioSamplingRate=m.audioSamplingRate||j.audioSamplingRate,om(m),m.drmInfos.length&&e.h.newDrmInfo(m),O=!1,(!c&&m.closedCaptions||c&&m.closedCaptions&&c.size!=m.closedCaptions.size)&&(O=!0),e.m&&O&&e.h.makeTextStreamsForClosedCaptions(e.m),r==n.la||r==n.V)for(U=l(e.i.values()),_=U.next();!_.done;_=U.next())(B=_.value).zf||B.type!=r||(B.stream.mimeType=j.mimeType,om(B.stream));r==n.wa&&(F=eu(j.segmentIndex))&&F.ba&&(m.mimeType="application/mp4",om(m)),V=Iu(m),m.segmentIndex.yb((function(e){e.ba&&(e.ba.Qc=V)})),function(e){if(!e.m)return!1;for(var t=[],n=[],i=(e=l(e.m.variants)).next();!i.done;i=e.next())(i=i.value).video&&t.push(i.video),i.audio&&n.push(i.audio);return!(0<t.length&&!t.some((function(e){return e.segmentIndex}))||0<n.length&&!n.some((function(e){return e.segmentIndex})))}(e)&&(e.ac?gm(e,[b]):(e.ac=!0,H=Array.from(e.i.values()),G=H.filter((function(e){return e.stream.segmentIndex})),gm(e,G),rm(e),0<(K=e.o)&&e.B.$(K))),Mm(e,I.X,m.type,C,g),e.m&&(e.m.startTime=e.s),A(P,0);break;case 2:if(X=E(P),m.closeSegmentIndex(),7001===X.code)return P.return();if(!e.h.disableStream(m))throw X;T(P)}}))}(v))}))))},m.closeSegmentIndex=function(){x&&!m.segmentIndex&&v.abort(),m.segmentIndex&&(m.segmentIndex.release(),m.segmentIndex=null),x=null},b}function fm(e){for(var t=1/0,n=(e=l(e.i.values())).next();!n.done;n=e.next())(n=n.value).stream.segmentIndex&&"text"!=n.stream.type&&!n.stream.isAudioMuxedInVideo&&(t=Math.min(t,n.Lb));return t}function pm(e,t){for(var n=[],i=(t=l(t)).next();!i.done;i=t.next())(i=i.value).segmentIndex&&i.segmentIndex.yb((function(e){n.push(e)}));e.l.vd(n)}function gm(e,t){if(!Om(e))for(var n=fm(e),i=l(t),r=i.next();!r.done;r=i.next())r.value.stream.segmentIndex.Kc(0,n);pm(e,t.map((function(e){return e.stream}))),n=Om(e)&&!e.bc,e.g.hls.ignoreManifestProgramDateTime||n?nm(e,t,n):(function(e,t){if(1/0==e.ga)for(var n=(t=l(t)).next();!n.done;n=t.next())null!=(n=eu(n.value.stream.segmentIndex))&&null!=n.h&&(e.ga=Math.min(e.ga,n.h));if(1/0!=(t=e.ga))for(var i=(n=l(e.i.values())).next();!i.done;i=n.next())if(!mm(e,(i=i.value).type)){var r=i.stream.segmentIndex;if(null!=r){var a=eu(r);if(a)if(null==a.h)z("Missing EXT-X-PROGRAM-DATE-TIME for stream",i.N(),"Expect AV sync issues!");else for(im(e,i,a.h-t-a.startTime),r=(i=l(r)).next();!r.done;r=i.next())r.value.Yf(t)}}}(e,t),0<e.g.hls.ignoreManifestProgramDateTimeForTypes.length&&nm(e,t))}function mm(e,t){return!!e.g.hls.ignoreManifestProgramDateTime||e.g.hls.ignoreManifestProgramDateTimeForTypes.includes(t)}function vm(e,t,n,i,r,a,o,s,u,c,d,h,f,p,g,m,v,y,b){var T,x,k,I,M,C,D,R,L,N,j,O,U,_,B,F,V,H,G,K,X,q,z,W,Y,J,$,Q,Z;return y=void 0===y||y,b=void 0===b||b,P((function(t){switch(t.g){case 1:if(T=i.segments||[],x=T.every((function(e){return!!Fg(e.X,"EXT-X-GAP")})),!T.length||x)throw new De(2,4,4053);if(function(e,t){var n=Fg(t.X,"EXT-X-PLAYLIST-TYPE");t=Fg(t.X,"EXT-X-ENDLIST"),t=n&&"VOD"==n.value||t,n=n&&"EVENT"==n.value&&!t,n=!t&&!n,Um(e,t?Xm:n?zm:qm)}(e,i),Om(e)&&xm(e,i),k=Om(e)?e.O.get(o):new Map,I=Cm(e,i,k,n,r,o),M=I.segments,C=I.bandwidth,j=N=L=R=D=null,!(0<M.length&&y)){t.u(2);break}return w(t,function(e,t){var n,i,r,a,o,s,u,c,d,h,f,p,g,m,v,y,b,T,S,x,A,E,k;return P((function(I){switch(I.g){case 1:if(n=Mu(e.g.hls.mediaPlaylistFullMimeType),!t.length)return I.return(n);if(i=Pm(e,t),r=i.segment,a=i.segmentIndex,o=r.N(),s=o[0],u=new Gn(s),c=u.Ua.split(".").pop(),d=Vm[c])return I.return(Mu(d));if(h=ca,p=f=null,!(g=r.ba)){I.u(2);break}return m=Ru(g.N(),g.Zb(),g.Xb(),e.g.retryParameters),w(I,_m(e,m,h,{type:0}).promise,3);case 3:if(v=I.h,f=v.data,!g.aesKey){I.u(4);break}return w(I,Du(f,g.aesKey,0),5);case 5:f=I.h;case 4:(p=v.headers["content-type"])&&(p=p.split(";")[0].toLowerCase());case 2:return y=Ru(r.N(),r.Zb(),r.Xb(),e.g.retryParameters),w(I,_m(e,y,h,{type:1}).promise,6);case 6:if(b=I.h,T=b.data,!r.aesKey){I.u(7);break}return w(I,Du(T,r.aesKey,a),8);case 8:T=I.h;case 7:if((S=b.headers["content-type"])&&(S=S.split(";")[0].toLowerCase()),x="mp4 mp4a m4s m4i m4a m4f cmfa mp4v m4v cmfv fmp4".split(" "),A=["audio/mp4","video/mp4","video/iso.segment"],os(ge(T))){var M=T,C=ge(M),D=(C=(new ns).parse(C)).fd();C=C.nf();var R=[],P=!1,L=!1;switch(D.audio){case"aac":case"aac-loas":R.push("mp4a.40.2"),P=!0;break;case"mp3":R.push("mp4a.40.34"),P=!0;break;case"ac3":R.push("ac-3"),P=!0;break;case"ec3":R.push("ec-3"),P=!0;break;case"opus":R.push("opus"),P=!0}switch(D.video){case"avc":C.codec?R.push(C.codec):R.push("avc1.42E01E"),L=!0;break;case"hvc":C.codec?R.push(C.codec):R.push("hvc1.1.6.L93.90"),L=!0;break;case"av1":R.push("av01.0.01M.08"),L=!0}if(R.length){if(D=P&&!L,P=new Map,L){(L=new we("video/mp2t")).i(M);for(var N=(M=l(L.j())).next();!N.done;N=M.next())N=N.value,P.set(N,N);L.g()}C={type:D?"audio":"video",mimeType:"video/mp2t",codecs:R.join(", "),language:null,height:C.height,width:C.width,channelCount:null,sampleRate:null,closedCaptions:P,Cd:null,colorGamut:null,frameRate:C.frameRate}}else C=null;if(E=C)return I.return(E)}else if((x.includes(c)||A.includes(S)||p&&A.includes(p))&&(k=function(e,t){function n(e){a=e.name;var t=e.reader;t.skip(24);var n=t.ma(),i=t.ma();t.skip(50),f=String(n),h=String(i),e.reader.sa()&&Sa(e)}function i(e){var t=Fo(e.reader);p=t.channelCount,g=t.sampleRate,r(e.name)}function r(e){switch(e=e.toLowerCase()){case"avc1":case"avc3":s.push(e+".42E01E"),c=!0;break;case"hev1":case"hvc1":s.push(e+".1.6.L93.90"),c=!0;break;case"dvh1":case"dvhe":s.push(e+".05.04"),c=!0;break;case"vp09":s.push(e+".00.10.08"),c=!0;break;case"av01":s.push(e+".0.01M.08"),c=!0;break;case"mp4a":o.push("mp4a.40.2"),u=!0;break;case"ac-3":case"ec-3":case"ac-4":case"opus":case"flac":o.push(e),u=!0}}var a,o=[],s=[],u=!1,c=!1,d=null,h=null,f=null,p=null,g=null,m=null,v=null;if((new Ta).box("moov",Sa).box("trak",Sa).box("mdia",Sa).R("mdhd",(function(e){d=_o(e.reader,e.version).language})).box("minf",Sa).box("stbl",Sa).R("stsd",xa).box("mp4a",(function(e){var t=Fo(e.reader);p=t.channelCount,g=t.sampleRate,e.reader.sa()?Sa(e):r(e.name)})).box("esds",(function(e){e=e.reader;for(var t,n,i="mp4a";e.sa();){t=e.T();for(var r=e.T();128&r;)r=e.T();if(3==t)e.ma(),128&(r=e.T())&&e.ma(),64&r&&e.skip(e.T()),32&r&&e.ma();else if(4==t)n=e.T(),e.skip(12);else if(5==t)break}n&&(i+="."+Ho(n),5==t&&e.sa()&&(31==(n=(248&(t=e.T()))>>3)&&e.sa()&&(n=32+((7&t)<<3)+((224&e.T())>>5)),i+="."+n)),o.push(i),u=!0})).box("ac-3",i).box("ec-3",i).box("ac-4",i).box("Opus",i).box("fLaC",i).box("avc1",n).box("avc3",n).box("hev1",n).box("hvc1",n).box("dva1",n).box("dvav",n).box("dvh1",n).box("dvhe",n).box("vp09",n).box("av01",n).box("avcC",(function(e){var t=a||"";switch(a){case"dvav":t="avc3";break;case"dva1":t="avc1"}(e=e.reader).skip(1),e=t+"."+Ho(e.T())+Ho(e.T())+Ho(e.T()),s.push(e),c=!0})).box("hvcC",(function(e){var t=a||"";switch(a){case"dvh1":t="hvc1";break;case"dvhe":t="hev1"}var n=e.reader;n.skip(1);var i=["","A","B","C"][(e=n.T())>>6],r=31&e,o=n.P(),u=(32&e)>>5?"H":"L";e=[n.T(),n.T(),n.T(),n.T(),n.T(),n.T()],n=n.T();for(var l=0,d=0;32>d&&(l|=1&o,31!=d);d++)l<<=1,o>>=1;for(t=t+"."+i+r+"."+Ho(l,!0),t+="."+u+n,i="",r=e.length;r--;)((u=e[r])||i)&&(i="."+u.toString(16).toUpperCase()+i);t+=i,s.push(t),c=!0})).box("dvcC",(function(e){var t=a||"";switch(a){case"hvc1":t="dvh1";break;case"hev1":t="dvhe";break;case"avc1":t="dva1";break;case"avc3":t="dvav";break;case"av01":t="dav1"}var n=e.reader;n.skip(2),e=n.T(),n=n.T(),s.push(t+"."+Go(e>>1&127)+"."+Go(e<<5&32|n>>3&31)),c=!0})).box("dvvC",(function(e){var t=a||"";switch(a){case"hvc1":t="dvh1";break;case"hev1":t="dvhe";break;case"avc1":t="dva1";break;case"avc3":t="dvav";break;case"av01":t="dav1"}var n=e.reader;n.skip(2),e=n.T(),n=n.T(),s.push(t+"."+Go(e>>1&127)+"."+Go(e<<5&32|n>>3&31)),c=!0})).R("vpcC",(function(e){var t=a||"",n=e.reader;e=n.T();var i=n.T();n=n.T()>>4&15,s.push(t+"."+Go(e)+"."+Go(i)+"."+Go(n)),c=!0})).box("av1C",(function(e){var t=a||"";"dav1"===a&&(t="av01");var n=e.reader;n.skip(1);var i=(e=n.T())>>>5,r=(64&(n=n.T()))>>6;s.push(t+"."+i+"."+Go(31&e)+(n>>>7?"H":"M")+"."+Go(2===i&&r?(32&n)>>5?12:10:r?10:8)+"."+((16&n)>>4)+"."+((8&n)>>3)+((4&n)>>2)+(3&n)+"."+Go(1)+"."+Go(1)+"."+Go(1)+".0"),c=!0})).box("enca",Ea).box("encv",Aa).box("sinf",Sa).box("frma",(function(e){r(e=Vo(e.reader).codec)})).box("colr",(function(e){s=s.map((function(t){if(t.startsWith("av01.")){var n=e.reader,i=n.ya(),r=n.vb(4),a=String.fromCharCode(r[0]);if(a+=String.fromCharCode(r[1]),a+=String.fromCharCode(r[2]),"nclx"===(a+=String.fromCharCode(r[3]))){r=n.ma(),a=n.ma();var o=n.ma(),s=n.T()>>7,u=t.split(".");10==u.length&&(u[6]=Go(r),u[7]=Go(a),u[8]=Go(o),u[9]=String(s),t=u.join("."))}n.seek(i)}return t}));var t=function(e){var t=null,n=null,i=e.vb(4),r=String.fromCharCode(i[0]);if(r+=String.fromCharCode(i[1]),r+=String.fromCharCode(i[2]),"nclx"===(r+=String.fromCharCode(i[3]))){switch(e.ma()){case 1:case 5:case 6:case 7:t="srgb";break;case 9:t="rec2020";break;case 11:case 12:t="p3"}switch(i=e.ma(),e.ma(),i){case 1:case 6:case 13:case 14:case 15:n="SDR";break;case 16:n="PQ";break;case 18:n="HLG"}}return{colorGamut:t,Cd:n}}(e.reader),n=t.colorGamut;m=t.Cd,v=n})).parse(e||t,!0),!o.length&&!s.length)return null;var y=u&&!c,b=new Map;if(c){var w=new we("video/mp4");e&&w.init(e);try{w.i(t);for(var T=l(w.j()),S=T.next();!S.done;S=T.next()){var x=S.value;b.set(x,x)}}catch(e){}w.g()}return{type:y?"audio":"video",mimeType:y?"audio/mp4":"video/mp4",codecs:Cu(o.concat(s)).join(", "),language:d,height:h,width:f,channelCount:p,sampleRate:g,closedCaptions:b,Cd:m,colorGamut:v,frameRate:null}}(f,T)))return I.return(k);return S?I.return(Mu(S)):p?I.return(Mu(p)):I.return(n)}}))}(e,M),3);case 3:O=t.h,o=O.type,s=O.language,d=O.channelCount,g=O.sampleRate,e.g.disableText||(h=O.closedCaptions),R=O.height,D=O.width,L=O.Cd,N=O.colorGamut,j=O.frameRate,b&&(v=O.mimeType,a=O.codecs);case 2:if(v){t.u(4);break}return w(t,function(e,t,n,i){var r,a,o,s,u,l,c,d,h,f,p,g,m,v;return P((function(y){switch(y.g){case 1:return r=ca,a=Pm(e,i),2==(o=a.segment).status?y.return(Rm(t)):(s=o.N(),u=new Gn(s[0]),l=u.Ua.split(".").pop(),c=Hm[t],(d=c[l])||(d=Vm[l])||(d=Dm(t,n))?y.return(d):(f=1,p=aa(s,e.g.retryParameters),S(y,2),p.method="HEAD",w(y,_m(e,p,r,{type:f}).promise,4)));case 4:g=y.h,h=g.headers["content-type"],A(y,3);break;case 2:if(!(m=E(y))||1002!=m.code&&1001!=m.code){y.u(3);break}return p.method="GET",w(y,_m(e,p,r,{type:f}).promise,6);case 6:v=y.h,h=v.headers["content-type"];case 3:return h?y.return(h.toLowerCase().split(";")[0]):y.return(Rm(t))}}))}(e,o,a,M),5);case 5:v=t.h;case 4:return w(t,wm(e,i,v,r,n),6);case 6:if(U=t.h,_=U.drmInfos,B=U.keyIds,F=U.encrypted,V=U.zh,F&&!_.length&&!V)throw new De(2,4,4026);return(H=bm(e,a,o,s,u,c,d,h,f,p,g,m)).encrypted=F,H.drmInfos=_,H.keyIds=B,H.mimeType=v,C&&(H.bandwidth=C),om(H),"video"==o&&(D||R||L||N)&&Lm(H,D,R,j,L,null,N),Om(e)&&xm(e,i),G=M[0].startTime,K=M[M.length-1],X=K.endTime,q=new Zs(M),H.segmentIndex=q,W=!!(z=Fg(i.X,"EXT-X-SERVER-CONTROL"))&&null!=Lg(z,"CAN-SKIP-UNTIL"),Y=!!z&&null!=Lg(z,"CAN-BLOCK-RELOAD"),J=Vg(i.X,"EXT-X-MEDIA-SEQUENCE",0),$=ym(J,M),Q=$.sb,Z=$.ub,t.return({stream:H,type:o,Wg:[],N:r,xc:G,Lb:X,Jd:W,Id:Y,kd:!1,Ue:-1,sb:Q,ub:Z,Yd:k,zf:!1})}}))}function ym(e,t){e=e+t.length-1;var n=-1;if(!t.length)return{sb:++e,ub:n};var i=(t=t[t.length-1]).g;return t.g.length?(n=i.length-1,i[i.length-1].isPreload()||(e++,n=0),{sb:e,ub:n}):(e++,t.m&&(n=0),{sb:e,ub:n})}function bm(e,t,n,i,r,a,o,s,u,c,d,h){var f=Dm(n,t)||Rm(n),p=[];if(u)for(var g=(u=l(u.split(","))).next();!g.done;g=u.next())p.push(g.value);return u=void 0,g=null,n==yi?u=p.includes("public.accessibility.transcribes-spoken-dialog")&&p.includes("public.accessibility.describes-music-and-sound")?"caption":"subtitle":p.includes("public.accessibility.describes-video")&&(g="visually impaired"),p.length||"subtitle"!==u||p.push("subtitle"),om(e={id:e.C++,originalId:a,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:f,codecs:t,kind:n==yi?"subtitle":void 0,encrypted:!1,drmInfos:[],keyIds:new Set,language:Yi(i||"und"),originalLanguage:i,label:a,type:n,primary:r,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:void 0,pixelAspectRatio:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:p,forced:c,channelsCount:o,audioSamplingRate:d,spatialAudio:h,closedCaptions:s,hdr:void 0,colorGamut:void 0,videoLayout:void 0,tilesLayout:void 0,accessibilityPurpose:g,external:!1,fastSwitching:!1,fullMimeTypes:new Set,isAudioMuxedInVideo:!1}),e}function wm(e,t,n,i,r){var a,o,s,u,c,d,h,f,p,g,m,v,y,b,T,S,x,A,E,k,I,M,C,D,R,L,N,j;return P((function(P){switch(P.g){case 1:if(a=new Map,t.segments)for(o=l(t.segments),s=o.next();!s.done;s=o.next())if(u=s.value,c=_g(u.X,"EXT-X-KEY"),d=null,c.length)for(d=Em(e,t,u.X,i,r),h=l(c),f=h.next();!f.done;f=h.next())p=f.value,a.set(p,d);m=g=!1,v=[],y=new Set,b=l(a),T=b.next();case 2:if(T.done){P.u(4);break}if(S=T.value,x=l(S),A=x.next().value,E=x.next().value,I=E,"NONE"==(M=jg(k=A,"METHOD"))){P.u(3);break}if(g=!0,C=Ng(k,"KEYFORMAT")||"identity",D=null,Bm(M)){m=!0,P.u(3);break}if("identity"!=C){D=(R=Km[C])?R(k,n):null,P.u(6);break}return w(P,Fm(e,k,n,i,I,r),8);case 8:D=P.h;case 6:if(D){if(D.keyIds)for(L=l(D.keyIds),N=L.next();!N.done;N=L.next())j=N.value,y.add(j);v.push(D)}case 3:T=b.next(),P.u(2);break;case 4:return P.return({drmInfos:v,keyIds:y,encrypted:g,zh:m})}}))}function Tm(t,n,i,r,a){if(!e.crypto||!e.crypto.subtle)throw W("Web Crypto API is not available to decrypt AES. (Web Crypto only exists in secure origins like https)"),new De(2,4,4042);var o=0,s=Ng(n,"IV","");if(s){var u=li(s.substr(2));if(16!=u.byteLength)throw new De(2,4,4048)}else o=Vg(i.X,"EXT-X-MEDIA-SEQUENCE",0);if(i=n.toString()+"-"+o,!t.ja.has(i)){var l={bitsKey:128,blockCipherMode:"CBC",iv:u,firstMediaSequenceNumber:o};switch(jg(n,"METHOD")){case"AES-256":l.bitsKey=256;break;case"AES-256-CTR":l.bitsKey=256,l.blockCipherMode="CTR"}l.fetchKey=function(){var i,o,s,u,c,d;return P((function(h){if(1==h.g)return i=Hg(r(),jg(n,"URI"),a),o=i.sort().join(""),t.L.has(o)||(s=aa(i,t.g.retryParameters),u=_m(t,s,6).promise,t.L.set(o,u)),w(h,t.L.get(o),2);if(3!=h.g){if(!(c=h.h).data||c.data.byteLength!=l.bitsKey/8)throw new De(2,4,4049);return d={name:"CTR"==l.blockCipherMode?"AES-CTR":"AES-CBC",length:l.bitsKey},w(h,e.crypto.subtle.importKey("raw",c.data,d,!0,["decrypt"]),3)}l.cryptoKey=h.h,l.fetchKey=void 0,T(h)}))},t.ja.set(i,l)}return t.ja.get(i)}function Sm(e,t){null==e.s&&(t=Fg(t.X,"EXT-X-START"))&&(e.s=Number(jg(t,"TIME-OFFSET")))}function xm(e,t){var n=1/0,i=t.segments;if(i.length)for(var r=i.length-1;0<=r;){var a=Fg(i[r].X,"EXTINF");if(a){n=Number(a.value.split(",")[0]);break}r--}if(!(i=Fg(t.X,"EXT-X-TARGETDURATION")))throw new De(2,4,4024,"EXT-X-TARGETDURATION");i=Number(i.value),(r=Fg(t.X,"EXT-X-PART-INF"))&&(e.Y=Number(jg(r,"PART-TARGET"))),t=Fg(t.X,"EXT-X-SERVER-CONTROL"),e.K&&e.Y?(e.o=e.Ib?5*e.Y<=n?Math.min(e.Y,e.o):Math.min(n,e.o):Math.min(e.Y,e.o),e.Ga=t?Number(jg(t,"PART-HOLD-BACK")):0):(e.o=Math.min(n,e.o),n=t?Lg(t,"HOLD-BACK"):null,e.Ba=n?Number(n.value):0),e.La=Math.max(i,e.La)}function Am(e,t){var n=0;if(e.g.defaultPresentationDelay)n=e.g.defaultPresentationDelay;else if(e.Ga)n=e.Ga;else if(e.Ba)n=e.Ba;else{var i=t.segments.length,r=e.g.hls.liveSegmentsDelay;for(r>i-2&&(r=Math.max(1,i-2)),r=i-r;r<i;r++){var a=Fg(t.segments[r].X,"EXTINF");n=a?n+Math.ceil(Number(a.value.split(",")[0])):n+e.La}}e.s&&0>e.s&&(n=Math.min(-e.s,n),e.s+=n),e.l.gh(0),e.l.Sf(n),e.l.Bc(!1)}function Em(e,t,n,i,r){var a=Fg(n,"EXT-X-MAP");if(!a)return null;var o=jg(a,"URI"),s=Hg(i(),o,r);if(o=[s.toString(),Ng(a,"BYTERANGE","")].join("-"),!e.ta.has(o)){for(var u=void 0,c=null,d=(n=l(n)).next();!d.done;d=n.next())"EXT-X-KEY"==(d=d.value).name?Bm(jg(d,"METHOD"))&&d.id<a.id&&(u=Tm(e,d,t,i,r)):"EXT-X-BYTERANGE"==d.name&&d.id<a.id&&(c=d);t=function(e,t,n,i){var r=0,a=null;return!(t=Ng(t,"BYTERANGE"))&&n&&(t=n.value),t&&(r=t.split("@"),a=Number(r[0]),a=(r=Number(r[1]))+a-1,i&&((n=a+1-r)%16&&(a+=16-n%16))),new go((function(){return e}),r,a,null,null,null,i)}(s,a,c,u),e.ta.set(o,t)}return e.ta.get(o)}function km(t,n,i,r,a,o,s,u,c){function d(e){e=new Gn(e).Ua.split(".").pop();var t=Hm[s][e];return t||(t=Vm[e]),t}var h=r.X,f=Fg(h,"EXTINF"),p=0,g=0,m=null;r.Cb.length&&(t.m.isLowLatency=!0);var v=null;if(!t.g.hls.ignoreManifestProgramDateTime){var y=Fg(h,"EXT-X-PROGRAM-DATE-TIME");y&&y.value&&(v=Kt(y.value),t.bc=!0)}var b=bo;if(Fg(h,"EXT-X-GAP")&&(t.m.gapCount++,b=2),!f){if(0==r.Cb.length)throw new De(2,4,4024,"EXTINF");if(!t.K)return null}var w=[];y=!1;var T=null,S=!1,x=!1;if(t.K&&r.Cb.length){p=n&&e.ReadableStream&&t.g.hls.allowLowLatencyByteRangeOptimization;for(var A=v,E={},k=0;k<r.Cb.length;E={xe:void 0,fe:void 0},k++){var I=r.Cb[k],M=0==k?i:w[w.length-1],C=0==k?a:M.endTime,D=Number(Ng(I,"DURATION"))||t.Y;if(D){var R=C+D,P=0,L=null;if("EXT-X-PRELOAD-HINT"==I.name?(P=(P=Ng(I,"BYTERANGE-START"))?Number(P):0,(M=Ng(I,"BYTERANGE-LENGTH"))?L=P+Number(M)-1:P&&(L=Number.MAX_SAFE_INTEGER)):(P=(L=l(Im(M,P=Ng(I,"BYTERANGE")))).next().value,L=L.next().value),E.fe=Ng(I,"URI"),E.fe){M=bo,"YES"==Ng(I,"GAP")&&(t.m.gapCount++,M=2,S=!0),E.xe=null;var N=function(e){return function(){return null==e.xe&&(e.xe=Hg(u(),e.fe,o)),e.xe}}(E);p&&0<=P&&null!=L&&(T=N,y=!0),C=new vo(C,R,N,P,L,n,0,0,1/0,[],"",null,A,M,c),"EXT-X-PRELOAD-HINT"==I.name&&(C.Af(),x=!0),"YES"!=Ng(I,"INDEPENDENT")&&0<k&&C.Pc(),(E=d(E.fe))&&(C.mimeType=E,Gm.has(E)&&(C.ba=null)),w.push(C),A&&(A+=D)}}}}if(f){if(0==(f=Number(f.value.split(",")[0])))return null;p=a+f}else{if(!w.length)return null;p=w[w.length-1].endTime}y&&(S||0!=w[0].Ja?(y=!1,T=null):w=[]),(f=Fg(h,"EXT-X-BYTERANGE"))?(g=(m=l(Im(i,f.value))).next().value,m=m.next().value):w.length&&(g=w[0].Ja,m=w[w.length-1].va),i="",f=null,"image"==s&&(i="1x1",h=Fg(h,"EXT-X-TILES"))&&(i=jg(h,"LAYOUT"),(h=Ng(h,"DURATION"))&&(f=Number(h)));var j=null;return n=new vo(a,p,(function(){return T?T():(null==j&&(j=Hg(u(),r.g,o)),j||[])}),g,m,n,0,0,1/0,w,i,f,v,b,c,0<w.length&&!!r.g),(a=d(r.g))&&(n.mimeType=a,Gm.has(a)&&(n.ba=null)),y&&(t.Ib=!0,n.Lg(),x&&n.Af()),n}function Im(e,t){var n=0,i=null;return t&&(n=t.split("@"),t=Number(n[0]),i=(n=n[1]?Number(n[1]):e.va+1)+t-1),[n,i]}function Mm(e,t,n,i,r){if("video"==n||"audio"==n){var a=e.l.m;if(a&&!mm(e,n))for(t=(t=_g(t,"EXT-X-DATERANGE")).sort((function(e,t){return(e=jg(e,"START-DATE"))<(t=jg(t,"START-DATE"))?-1:e>t?1:0})),n=0;n<t.length;n++){var o=t[n];try{var s=jg(o,"ID");if(!e.Aa.has(s)){var u=Kt(jg(o,"START-DATE"));if(!isNaN(u)){var c=Math.max(0,u-a),d=null,h=Ng(o,"END-DATE");if(h){var f=Kt(h);if(!isNaN(f)&&0>(d=f-a))continue}if(null==d){var p=Ng(o,"DURATION")||Ng(o,"PLANNED-DURATION");if(p){var g=parseFloat(p);if(isNaN(g)||(d=c+g),0>u-a+g)continue}}var m=Ng(o,"CLASS")||"com.apple.quicktime.HLS",v="YES"==Ng(o,"END-ON-NEXT");if(null==d&&v){for(var y=n+1;y<t.length;y++)if(m==(Ng(t[y],"CLASS")||"com.apple.quicktime.HLS")){var b=Kt(jg(t[y],"START-DATE"));if(!isNaN(b)&&b&&b>u){d=Math.max(0,b-a);break}}if(null==d)continue}y=["CLASS","START-DATE","END-DATE","DURATION","END-ON-NEXT"];for(var w=[],T=l(o.attributes),S=T.next();!S.done;S=T.next()){var x=S.value;if(!y.includes(x.name)){var A=Kg(x.value,i);"X-ASSET-URI"!=x.name&&"X-ASSET-LIST"!=x.name||(A=Hg(r(),x.value,i)[0]),w.push({key:x.name,description:"",data:A,mimeType:null,pictureType:null})}}1<w.length&&e.h.onMetadata(m,c,d,w),e.Aa.add(s)}}}catch(e){}}}}function Cm(e,t,n,i,r,a){var o=t.segments,s=void 0,u=Vg(t.X,"EXT-X-DISCONTINUITY-SEQUENCE",-1),c=Vg(t.X,"EXT-X-MEDIA-SEQUENCE",0),d=Fg(t.X,"EXT-X-SKIP"),h=d?Number(Ng(d,"SKIPPED-SEGMENTS")):0,f=c+h,p=0;Om(e)&&n.has(f)&&(p=n.get(f)),0===p&&e.xa==zm&&0<n.size&&!n.has(f)&&null!=e.l.i&&(p=e.l.qb());var g=[],m=null;d=[];for(var v=0;v<o.length;v++){var y=o[v],b=0==v?p:m.endTime;f=c+h+v,Fg(y.X,"EXT-X-DISCONTINUITY")&&u++;for(var w=l(y.X),T=w.next();!T.done;T=w.next())"EXT-X-KEY"==(T=T.value).name&&(s=Bm(jg(T,"METHOD"))?Tm(e,T,t,r,i):void 0);n.set(f,b),w=Em(e,t,y.X,r,i),!e.K&&e.h.isAutoLowLatencyMode()&&(e.h.enableLowLatencyMode(),e.K=e.h.isLowLatencyMode()),(b=km(e,w,m,y,b,i,a,r,s))&&((m=Vg(y.X,"EXT-X-BITRATE"))?d.push({bitrate:m,duration:b.endTime-b.startTime}):d.length&&((m=d.pop()).duration+=b.endTime-b.startTime,d.push(m)),m=b,b.i=u,mm(e,a)&&null!=e.I&&f<e.I||g.push(b))}if(t=void 0,d.length&&(t=d.reduce((function(e,t){return e+t.duration}),0),t=Math.round(d.reduce((function(e,t){return e+t.bitrate*t.duration}),0)/t*1e3)),d=g.some((function(e){return null!=e.h})))for(n={},i=0;i<g.length;n={Nd:void 0,Md:void 0,Fd:void 0,zc:void 0,Ed:void 0},i++)if(n.zc=g[i],null==n.zc.h)for(n.Md=0,n.Nd=i,r=function(e){return function(){var t=g[e.Nd];if(t){if(null!=t.h)return t.h+e.Md;e.Md-=t.endTime-t.startTime,e.Nd+=1}return null}}(n),n.Ed=0,n.Fd=i,o=function(e){return function(){var t=g[e.Fd];if(t){if(t!=e.zc&&(e.Ed+=t.endTime-t.startTime),null!=t.h)return t.h+e.Ed;--e.Fd}return null}}(n);null==n.zc.h;)n.zc.h=o(),null==n.zc.h&&(n.zc.h=r());if(d)for(i=(n=l(g)).next();!i.done;i=n.next())for(i=(r=i.value).h,o=(r=l(r.g)).next();!o.done;o=r.next())(o=o.value).h=i,i+=o.endTime-o.startTime;if(n=e.ga,d&&1/0!=n&&!mm(e,a))for(a=(e=l(g)).next();!a.done;a=e.next())a.value.Yf(n);return{segments:g,bandwidth:t}}function Dm(e,t){if(e==yi){if("vtt"==t||"wvtt"==t)return"text/vtt";if(t&&""!==t)return"application/mp4"}return"image"!=e||t&&"jpeg"!=t?"audio"==e&&"mp4a.40.34"==t?"audio/mpeg":"mjpg"==t?"application/mp4":null:"image/jpeg"}function Rm(e){return e==yi?"text/vtt":Hm[e].mp4}function Pm(e,t){for(var n=t[e=Om(e)?Math.trunc((t.length-1)/2):0];2==n.$b()&&e+1<t.length;)n=t[++e];return{segment:n,segmentIndex:e}}function Lm(e,t,n,i,r,a,o){e&&(e.width=Number(t)||void 0,e.height=Number(n)||void 0,e.frameRate=Number(i)||void 0,e.hdr=r||void 0,e.videoLayout=a||void 0,e.colorGamut=o||void 0)}function Nm(e,t,n){return _m(e,aa(t,e.g.retryParameters),0,{type:n?2:3})}function jm(e){var t,n,i,r,a,o;return P((function(s){switch(s.g){case 1:return e.h?(S(s,2),t=Date.now(),w(s,e.update(),4)):s.return();case 4:n=Date.now(),Om(e)&&(i=(n-t)/1e3,e.Gb.sample(1,i),r=0<e.g.hls.updatePeriod?e.g.hls.updatePeriod:e.o,a=Math.max(0,r-K(e.Gb)),e.B.$(a)),A(s,3);break;case 2:if(o=E(s),!e.h)return s.return();if(e.g.raiseFatalErrorOnManifestUpdateRequestFailure)return e.h.onError(o),s.return();o.severity=1,e.h.onError(o),e.B.$(.1);case 3:if(!e.h)return s.return();e.h.onManifestUpdated(),T(s)}}))}function Om(e){return e.xa!=Xm}function Um(e,t){e.xa=t,e.l&&e.l.Bc(!Om(e)),Om(e)||e.B.stop()}function _m(e,t,n,i){if(!e.da)throw new De(2,7,7001);return i||(i={}),i.isPreload=e.Hb(),t=e.h.networkingEngine.request(n,t,i),ta(e.da,t),t}function Bm(e){return"AES-128"==e||"AES-256"==e||"AES-256-CTR"==e}function Fm(e,t,n,i,r,a){var o,s,u,l,c,d,h,f,p,g,m,v,y;return P((function(b){switch(b.g){case 1:if("video/mp2t"==n)throw new De(2,4,4040);if(ot())throw new De(2,4,4041);if(o=jg(t,"METHOD"),!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(o))return b.return(null);if((s=Hg(i(),jg(t,"URI"),a))[0].startsWith("data:text/plain;base64,")){u=ci(ui(s[0].split("data:text/plain;base64,").pop())),b.u(2);break}return l=s.sort().join(""),e.ra.has(l)||(c=aa(s,e.g.retryParameters),d=_m(e,c,6).promise,e.ra.set(l,d)),w(b,e.ra.get(l),3);case 3:h=b.h,u=ci(h.data);case 2:if(f="00000000000000000000000000000000",!r){b.u(4);break}if(e.na.has(r)){p=e.na.get(r),b.u(5);break}return g=Ru(r.N(),r.Zb(),r.Xb(),e.g.retryParameters),w(b,_m(e,g,ca,{type:0}).promise,6);case 6:m=b.h,p=function(e){var t=null;return(new Ta).box("moov",Sa).box("trak",Sa).box("mdia",Sa).box("minf",Sa).box("stbl",Sa).R("stsd",xa).box("encv",Aa).box("enca",Ea).box("sinf",Sa).box("schi",Sa).R("tenc",(function(e){(e=e.reader).T(),e.T(),e.T(),e.T(),t=ci(e.vb(16))})).parse(e,!0),t}(m.data),e.na.set(r,p);case 5:p&&(f=p);case 4:return(v=new Map).set(f,u),y="cenc","SAMPLE-AES"==o&&(y="cbcs"),b.return(pi(v,y))}}))}F("shaka.net.DataUriPlugin",Jg),Jg.parse=$g,ia("data",$g),(i=Zg.prototype).configure=function(e,t){var n=this.h&&e.hls.updatePeriod!=this.g.hls.updatePeriod&&0<=e.hls.updatePeriod;this.g=e,t&&(this.Hb=t),this.j&&this.j.configure(this.g),n&&this.m&&this.m.presentationTimeline.U()&&this.B.hc()},i.start=function(e,t){var n,i=this;return P((function(r){return 1==r.g?(i.h=t,i.K=t.isLowLatencyMode(),w(r,Nm(i,[e]).promise,2)):3!=r.g?(n=r.h,i.M=n.uri,w(r,function(e,t,n){var i,r,a,o,s,u,d,h,f,p,g,m,v,y,b,T,x,A,k,I,M,C,D,R,L,N,j,O,U,_,B,F,V;return P((function(H){switch(H.g){case 1:return i=bi,r=qg(e.Ka,t),a=_g(r.X,"EXT-X-DEFINE"),o=[],s=[],u=[],e.l=new Ls(null,0),e.l.Bc(!0),d=function(){return[n]},h=null,f=new Map,1==r.type?(e.S=!1,A=_g(r.X,"EXT-X-DEFINE"),f=am(e,A,e.M),h=i.la,k="",I=new Map,w(H,vm(e,e.C++,f,r,d,"",h,k,!0,"Media Playlist",null,I,null,!1,null,!1),7)):(function(e,t){for(var n=new Gn(e.M).g,i=(t=l(t)).next();!i.done;i=t.next()){var r=i.value;i=Ng(r,"NAME");var a=Ng(r,"VALUE");r=Ng(r,"QUERYPARAM"),i&&a&&(e.A.has(i)||e.A.set(i,a)),r&&(i=n.get(r)[0])&&!e.A.has(i)&&e.A.set(r,i)}}(e,a),p=_g(r.X,"EXT-X-MEDIA"),g=_g(r.X,"EXT-X-STREAM-INF"),m=_g(r.X,"EXT-X-IMAGE-STREAM-INF"),v=_g(r.X,"EXT-X-I-FRAME-STREAM-INF"),y=_g(r.X,"EXT-X-SESSION-KEY"),b=_g(r.X,"EXT-X-SESSION-DATA"),T=_g(r.X,"EXT-X-CONTENT-STEERING"),function(e,t){for(var n=(t=l(t)).next();!n.done;n=t.next()){var i=n.value,r=Ng(i,"DATA-ID");n=Ng(i,"URI");var a=Ng(i,"LANGUAGE");i=Ng(i,"VALUE"),r=(new Map).set("id",r),n&&r.set("uri",Hg([e.M],n,e.A)[0]),a&&r.set("language",a),i&&r.set("value",i),n=new Jr("sessiondata",r),e.h&&e.h.onEvent(n)}}(e,b),w(H,function(e,t){var n,i,r,a,o,s;return P((function(u){if(!e.h||!e.g)return u.return();for(i=l(t),r=i.next();!r.done;r=i.next())if(a=r.value,o=Ng(a,"PATHWAY-ID"),s=Ng(a,"SERVER-URI"),o&&s){e.j=new mp(e.h),e.j.configure(e.g),e.j.i=[e.M],e.j.setManifestType("HLS"),e.j.h=o,n=vp(e.j,s);break}return w(u,n,0)}))}(e,T),4));case 4:return function(e,t){for(var n=(t=l(t)).next();!n.done;n=t.next()){var i=n.value,r=Ng(i,"AUDIO");n=Ng(i,"VIDEO");var a=Ng(i,"SUBTITLES");if(i=um(e,i),a){var o=mi(yi,i);e.G.set(a,o),Ie(i,o)}r&&((a=mi("audio",i))||(a=e.g.hls.defaultAudioCodec),e.G.set(r,a)),n&&((r=mi("video",i))||(r=e.g.hls.defaultVideoCodec),e.G.set(n,r))}}(e,g),function(e,t){t=Bg(t,"CLOSED-CAPTIONS"),e.S=0==t.length;for(var n=(t=l(t)).next();!n.done;n=t.next()){var i=n.value,r=Ng(i,"LANGUAGE");n=Yi(r||"und"),r||(r=Ng(i,"NAME"))&&(n=r),r=jg(i,"GROUP-ID"),i=jg(i,"INSTREAM-ID").replace("SERVICE","svc"),e.F.get(r)||e.F.set(r,new Map),e.F.get(r).set(i,n)}}(e,p),x=function(e,t){return t.map((function(t){return"video"!==(t=dm(e,t)).stream.type?null:t.stream})).filter((function(e){return e}))}(e,v),w(H,function(e,t,n,i,r,a,o){var s,u,d,h,f,p,g,m,v,y,b,T,S,x,A,E,k,I,M,C,D,R,L,N,j,O,U,_,B,F,V,H,G,K,X;return P((function(P){switch(P.g){case 1:if(s=[],u=new Set,!(0<n.length)){P.u(2);break}d=l(n),h=d.next();case 3:if(h.done){P.u(2);break}if(f=h.value,p=jg(f,"METHOD"),g=Ng(f,"KEYFORMAT")||"identity",m=null,"NONE"==p){P.u(4);break}if(Bm(p)){v=Hg(r(),jg(f,"URI"),a),y=v.sort().join(""),e.L.has(y)||(b=aa(v,e.g.retryParameters),T=_m(e,b,6).promise,e.L.set(y,T)),P.u(4);break}if("identity"!=g){m=(S=Km[g])?S(f,""):null,P.u(6);break}return w(P,Fm(e,f,"",r,null,a),9);case 9:m=P.h;case 6:if(m){if(m.keyIds)for(x=l(m.keyIds),A=x.next();!A.done;A=x.next())E=A.value,u.add(E);s.push(m)}case 4:h=d.next(),P.u(3);break;case 2:for(k={},I=l(t),M=I.next();!M.done;M=I.next())C=M.value,D=Pg(C,!e.j),k[D]?k[D].push(C):k[D]=[C];for(L in R=[],k)N=k[L],j=N[0],O=Ng(j,"FRAME-RATE"),U=Number(Ng(j,"AVERAGE-BANDWIDTH"))||Number(jg(j,"BANDWIDTH")),_=Ng(j,"RESOLUTION"),B=l(_?_.split("x"):[null,null]),F=B.next().value,V=B.next().value,H=Ng(j,"VIDEO-RANGE"),(G=Ng(j,"REQ-VIDEO-LAYOUT"))&&G.includes(",")&&(K=G.split(",").filter((function(e){return"CH-STEREO"==e||"CH-MONO"==e})),G=K[0]),G=G||"CH-MONO",X=sm(e,N,i),R.push.apply(R,c(lm(e,X.audio,X.video,U,F,V,O,H,G,s,u,o)));return P.return(R.filter((function(e){return null!=e})))}}))}(e,g,y,p,d,e.A,x),5);case 5:return o=H.h,s=function(e,t){var n=Bg(t,"SUBTITLES");t=n.map((function(t){if(e.g.disableText)return null;try{return cm(e,[t],new Map).stream}catch(t){if(e.g.hls.ignoreTextStreamFailures)return null;throw t}}));for(var i=(n=l(n)).next();!i.done;i=n.next()){var r=jg(i.value,"GROUP-ID");if((i=e.G.get(r))&&(r=e.H.get(r)))for(var a=(r=l(r)).next();!a.done;a=r.next())(a=a.value).stream.codecs=i,a.stream.mimeType=Dm(yi,i)||Rm(yi),om(a.stream)}return t.filter((function(e){return e}))}(e,p),w(H,function(e,t,n){var i,r;return P((function(a){return 1==a.g?(i=t.map((function(t){var n,i;return P((function(r){if(1==r.g)return e.g.disableThumbnails?r.return(null):(S(r,2),w(r,function(e,t){var n,i,r,a,o,s,u,l,c,d;return P((function(h){return 1==h.g?(n=jg(t,"URI"),i=Ng(t,"CODECS","jpeg")||"",e.i.has(n)?h.return(e.i.get(n)):(r=Ng(t,"LANGUAGE"),a=Ng(t,"NAME"),o=Ng(t,"CHARACTERISTICS"),s=hm(e,e.C++,[n],i,"image",r,!1,a,null,null,o,!1,null,!1),(u=Ng(t,"RESOLUTION"))?w(h,s.stream.createSegmentIndex(),3):h.u(2))):(2!=h.g&&(l=eu(s.stream.segmentIndex),c=l.tilesLayout)&&(s.stream.width=Number(u.split("x")[0])*Number(c.split("x")[0]),s.stream.height=Number(u.split("x")[1])*Number(c.split("x")[1])),(d=Ng(t,"BANDWIDTH"))&&(s.stream.bandwidth=Number(d)),e.i.set(n,s),h.return(s))}))}(e,t),4));if(2!=r.g)return n=r.h,r.return(n.stream);if(i=E(r),e.g.hls.ignoreImageStreamFailures)return r.return(null);throw i}))})).concat(n.map((function(t){if(e.g.disableThumbnails)return null;try{var n=dm(e,t);return"image"!==n.stream.type?null:n.stream}catch(t){if(e.g.hls.ignoreImageStreamFailures)return null;throw t}}))),w(a,Promise.all(i),2)):(r=a.h,a.return(r.filter((function(e){return e}))))}))}(e,m,v),6);case 6:u=H.h,H.u(3);break;case 7:M=H.h,e.i.set(n,M),M.stream&&(C=Iu(M.stream),M.stream.segmentIndex.yb((function(e){e.ba&&(e.ba.Qc=C)}))),h=M.stream.type,o.push({id:0,language:Yi(k||"und"),disabledUntilTime:0,primary:!0,audio:"audio"==h?M.stream:null,video:"video"==h?M.stream:null,bandwidth:M.stream.bandwidth||0,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});case 3:if(!e.h)throw new De(2,7,7001);if(Sm(e,r),1==r.type&&(Om(e)&&(Am(e,r),D=e.o,e.B.$(D)),R=Array.from(e.i.values()),gm(e,R),rm(e),Mm(e,r.X,h,f,d)),e.m={presentationTimeline:e.l,variants:o,textStreams:s,imageStreams:u,offlineSessionIds:[],minBufferTime:0,sequenceMode:e.g.hls.sequenceMode,ignoreManifestTimestampsInSegmentsMode:e.g.hls.ignoreManifestTimestampsInSegmentsMode,type:"HLS",serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,isLowLatency:!1,startTime:e.s},e.fa||!e.g.hls.disableCodecGuessing){H.u(8);break}for(L=[],N=l(e.m.variants),j=N.next();!j.done;j=N.next())(O=j.value).audio&&""===O.audio.codecs&&L.push(O.audio.createSegmentIndex()),O.video&&""===O.video.codecs&&L.push(O.video.createSegmentIndex());return w(H,Promise.all(L),8);case 8:if(e.h.makeTextStreamsForClosedCaptions(e.m),1==o.length){for(U=[],_=o[0],B=l([_.video,_.audio]),F=B.next();!F.done;F=B.next())(V=F.value)&&!V.segmentIndex&&U.push(V.createSegmentIndex());if(0<U.length)return w(H,Promise.all(U),0)}H.u(0)}}))}(i,n.data,e),3)):r.return(i.m)}))},i.stop=function(){this.B&&(this.B.stop(),this.B=null);var e=[];return this.da&&(e.push(this.da.destroy()),this.da=null),this.g=this.h=null,this.Na.clear(),this.m=null,this.i.clear(),this.H.clear(),this.G.clear(),this.A.clear(),this.ta.clear(),this.ja.clear(),this.L.clear(),this.ra.clear(),this.na.clear(),this.Aa.clear(),this.j&&this.j.destroy(),this.Z&&(this.Z.release(),this.Z=null),Promise.all(e)},i.update=function(){var e,t,n,i,r,a,o,s,u,d,h,f=this;return P((function(p){if(1==p.g){if(!Om(f))return p.return();for(e=[],t=Array.from(f.i.values()),f.o=1/0,f.m.gapCount=0,n=t.filter((function(e){return e.stream.segmentIndex})),i=l(n),r=i.next();!r.done;r=i.next())a=r.value,e.push(tm(f,a));return w(p,Promise.all(e),2)}for(pm(f,n.map((function(e){return e.stream}))),o=n.some((function(e){return 0==e.kd})),n.length&&!o&&(Um(f,Wm.vh),s=n.map((function(e){return e.Lb})),f.l.bb(Math.min.apply(Math,c(s))),f.h.updateDuration()),o&&rm(f),u=l(n),d=u.next();!d.done;d=u.next())(h=d.value).stream.isAudioMuxedInVideo||!h.stream.segmentIndex||eu(h.stream.segmentIndex)||f.h.disableStream(h.stream);T(p)}))},i.onExpirationUpdated=function(){},i.onInitialVariantChosen=function(){},i.banLocation=function(e){this.j&&this.j.banLocation(e)},i.setMediaElement=function(e){this.aa=e},F("shaka.hls.HlsParser",Zg);var Vm={aac:"audio/aac",ac3:"audio/ac3",ec3:"audio/ec3",mp3:"audio/mpeg"},Hm={audio:{mp4:"audio/mp4",mp4a:"audio/mp4",m4s:"audio/mp4",m4i:"audio/mp4",m4a:"audio/mp4",m4f:"audio/mp4",cmfa:"audio/mp4",ts:"video/mp2t",tsa:"video/mp2t"},video:{mp4:"video/mp4",mp4v:"video/mp4",m4s:"video/mp4",m4i:"video/mp4",m4v:"video/mp4",m4f:"video/mp4",cmfv:"video/mp4",ts:"video/mp2t",tsv:"video/mp2t"},text:{mp4:"application/mp4",m4s:"application/mp4",m4i:"application/mp4",m4f:"application/mp4",cmft:"application/mp4",vtt:"text/vtt",webvtt:"text/vtt",ttml:"application/ttml+xml"},image:{jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"}},Gm=new Set(["video/mp2t"].concat(c(ji))),Km={"com.apple.streamingkeydelivery":function(e,t){if("video/mp2t"==t)throw new De(2,4,4040);if(ot())throw new De(2,4,4041);if(t=jg(e,"METHOD"),!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(t))return null;var n="cenc";return"SAMPLE-AES"==t&&(n="cbcs"),fi("com.apple.fps",n,[{initDataType:"sinf",initData:new Uint8Array(0),keyId:null}],jg(e,"URI"))},"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(e){var t=jg(e,"METHOD");if(!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(t))return null;var n="cenc";return"SAMPLE-AES"==t&&(n="cbcs"),n=fi("com.widevine.alpha",n,[{initDataType:"cenc",initData:t=ge((t=Qg((t=jg(e,"URI")).split("?")[0])).data)}]),(e=Ng(e,"KEYID"))&&(n.keyIds=new Set([e.toLowerCase().substr(2)])),n},"com.microsoft.playready":function(e){var t=jg(e,"METHOD");if(!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(t))return null;var n="cenc";return"SAMPLE-AES"==t&&(n="cbcs"),fi("com.microsoft.playready",n,[{initDataType:"cenc",initData:e=La(e=ge((e=Qg((e=jg(e,"URI")).split("?")[0])).data),t=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),new Set,0)}])}},Xm="VOD",qm="EVENT",zm="LIVE",Wm={vh:Xm,uj:qm,Cj:zm};function Ym(e){if(e=Jm(e))e:{for(var t=(e=l(Ut(e,"DATA"))).next();!t.done;t=e.next())if(t=_t(t.value,"LA_URL")){e=jt(t);break e}e=""}else e="";return e}function Jm(e){return(e=function(e){var t=0,n=ve(e),i=n.getUint32(t,!0);if(i!=e.byteLength)return[];e:{for(e=t+6,t=[];e<n.byteLength-1;){i=n.getUint16(e,!0),e+=2;var r=n.getUint16(e,!0);if(e+=2,1&r||r+e>n.byteLength){n=[];break e}var a=ge(n,e,r);t.push({type:i,value:a}),e+=r}n=t}return n}(e=ui(jt(e))).filter((function(e){return e.type===$m}))[0])&&(e=Dt(e=ht(e.value,!0),"WRMHEADER"))?e:null}co["application/x-mpegurl"]=function(){return new Zg},co["application/vnd.apple.mpegurl"]=function(){return new Zg};var $m=1,Qm=(new Map).set("com.microsoft.playready",Ym).set("com.microsoft.playready.recommendation",Ym).set("com.microsoft.playready.software",Ym).set("com.microsoft.playready.hardware",Ym);function Zm(e){if(!cv){cv=!0;var t=new Uint8Array([105,115,111,109]),n=new Uint8Array([97,118,99,49]),i=new Uint8Array([0,0,0,1]);Sv=lv("ftyp",t,i,t,n),t=lv("dref",xv),Av=lv("dinf",t)}this.g=e}function ev(e){for(var t=[],n=l(e.g),i=n.next();!i.done;i=n.next()){var r=t,a=r.push,o=i.value;i=lv;var s=o.id+1,u=o.stream.width||0,d=o.stream.height||0;"audio"==o.type&&(d=u=0);var h=o.duration*o.timescale,f=Math.floor(h/(dv+1));switch(h=Math.floor(h%(dv+1)),s=lv("tkhd",s=new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3].concat(c(sv(s,4)),[0,0,0,0],c(sv(f,4)),c(sv(h,4)),[0,0,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,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0],c(sv(u,2)),[0,0],c(sv(d,2)),[0,0]))),u=lv,f=o.duration*o.timescale,d=Math.floor(f/(dv+1)),f=Math.floor(f%(dv+1)),h=(h=o.stream.language).charCodeAt(0)-96<<10|h.charCodeAt(1)-96<<5|h.charCodeAt(2)-96,d=lv("mdhd",d=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3].concat(c(sv(o.timescale,4)),c(sv(d,4)),c(sv(f,4)),c(sv(h,2)),[0,0]))),f=o,h=new Uint8Array([]),f.type){case"video":h=fv;break;case"audio":h=pv}f=lv("hdlr",h);e:{switch(o.type){case"video":o=lv("minf",lv("vmhd",bv),Av,tv(o));break e;case"audio":o=lv("minf",lv("smhd",wv),Av,tv(o));break e}o=new Uint8Array([])}i=i("trak",s,o=u("mdia",d,f,o)),a.call(r,i)}for(t=di.apply(ai,c(t)),n=lv,i=(a=e.g[0]).duration*a.timescale,r=Math.floor(i/(dv+1)),i=Math.floor(i%(dv+1)),r=lv("mvhd",r=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3].concat(c(sv(a.timescale,4)),c(sv(r,4)),c(sv(i,4)),[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]))),i=[],u=(e=l(e.g)).next();!u.done;u=e.next())s=(o=i).push,u=lv("trex",u=new Uint8Array([0,0,0,0].concat(c(sv(u.value.id+1,4)),[0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]))),s.call(o,u);if(e=lv("mvex",e=di.apply(ai,c(i))),i=[],a.encrypted){for(o=(a=l(a.stream.drmInfos)).next();!o.done;o=a.next())if((o=o.value).initData)for(s=(o=l(o.initData)).next();!s.done;s=o.next())i.push(s.value.initData);a=di.apply(ai,c(i))}else a=new Uint8Array([]);return e=n("moov",r,t,e,a),(t=new Uint8Array(Sv.byteLength+e.byteLength)).set(Sv),t.set(e,Sv.byteLength),t}function tv(e){var t=lv,n=new Uint8Array([]);switch(e.type){case"video":if(e.codecs.includes("avc1")){n=e.stream.width||0;var i=e.stream.height||0;if(0<e.za.byteLength)var r=lv("avcC",e.za);else{r=lv;for(var a=7,o=[],s=[],u=0,l=0,d=0,h=0;h<e.fb.length;h++){var f=uv(e.fb[h]);switch(31&f[0]){case 7:o.push(f),a+=f.length+2;break;case 8:s.push(f),a+=f.length+2}}for(0<o.length&&(u=o[0][1],d=o[0][2],l=o[0][3]),h=0,(a=new Uint8Array(a))[h++]=1,a[h++]=u,a[h++]=d,a[h++]=l,a[h++]=255,a[h++]=224|o.length,u=0;u<o.length;u++)a[h++]=(65280&o[u].length)>>8,a[h++]=255&o[u].length,a.set(o[u],h),h+=o[u].length;for(a[h++]=s.length,o=0;o<s.length;o++)a[h++]=(65280&s[o].length)>>8,a[h++]=255&s[o].length,a.set(s[o],h),h+=s[o].length;r=r("avcC",a)}n=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].concat(c(sv(n,2)),c(sv(i,2)),[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])),i="avc1",s=nv(e),o=new Uint8Array([]),e.encrypted&&(o=rv(e),i="encv"),n=lv(i,n,r,s,o)}else e.codecs.includes("hvc1")&&(i=e.stream.width||0,r=e.stream.height||0,n=new Uint8Array([]),0<e.za.byteLength&&(n=lv("hvcC",e.za)),i=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].concat(c(sv(i,2)),c(sv(r,2)),[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])),r="hvc1",s=nv(e),o=new Uint8Array([]),e.encrypted&&(o=rv(e),r="encv"),n=lv(r,i,n,s,o));break;case"audio":e.codecs.includes("mp3")?e=lv(".mp3",iv(e)):e.codecs.includes("ac-3")?(n=lv("dac3",e.qa),i="ac-3",r=new Uint8Array([]),e.encrypted&&(r=rv(e),i="enca"),e=lv(i,iv(e),n,r)):e.codecs.includes("ec-3")?(n=lv("dec3",e.qa),i="ec-3",r=new Uint8Array([]),e.encrypted&&(r=rv(e),i="enca"),e=lv(i,iv(e),n,r)):e.codecs.includes("opus")?(n=lv("dOps",e.qa),i="Opus",r=new Uint8Array([]),e.encrypted&&(r=rv(e),i="enca"),e=lv(i,iv(e),n,r)):(0<e.qa.byteLength?n=lv("esds",e.qa):(n=lv,i=e.id+1,r=e.stream.channelsCount||2,o=e.stream.audioSamplingRate||44100,u=gi("audio",e.codecs.split(",")),s=(l={96e3:0,88200:1,64e3:2,48e3:3,44100:4,32e3:5,24e3:6,22050:7,16e3:8,12e3:9,11025:10,8e3:11,7350:12})[o],"mp4a.40.5"!==u&&"mp4a.40.29"!==u||(s=l[2*o]),o=parseInt(u.split(".").pop(),10),n=n("esds",i=new Uint8Array([0,0,0,0,3,25].concat(c(sv(i,2)),[0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,o<<3|s>>>1,s<<7|r<<3,6,1,2])))),i="mp4a",r=new Uint8Array([]),e.encrypted&&(r=rv(e),i="enca"),e=lv(i,iv(e),n,r)),n=e}return t("stbl",e=lv("stsd",Tv,n),lv("stts",gv),lv("stsc",mv),lv("stsz",yv),lv("stco",vv))}function nv(e){if(!e.Da&&!e.Fa)return new Uint8Array([]);var t=e.Fa;return lv("pasp",e=new Uint8Array([].concat(c(sv(e.Da,4)),c(sv(t,4)))))}function iv(e){return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.stream.channelsCount||2,0,16,0,0,0,0].concat(c(sv(e.stream.audioSamplingRate||44100,2)),[0,0]))}function rv(e){for(var t=lv,n=e.codecs.substring(0,e.codecs.indexOf(".")),i=0,r=0;r<n.length;r+=1)i|=n.charCodeAt(r)<<8*(n.length-r-1);n=lv("frma",n=new Uint8Array([].concat(c(sv(i,4))))),i=lv("schm",i=new Uint8Array([0,0,0,0,99,101,110,99,0,1,0,0])),r=lv;for(var a=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),o=(e=l(e.stream.drmInfos)).next();!o.done;o=e.next())if((o=o.value)&&o.keyIds&&o.keyIds.size)for(var s=(o=l(o.keyIds)).next();!s.done;s=o.next())a=uv(s.value);return t("sinf",n,i,r("schi",a=lv("tenc",e=new Uint8Array([0,0,0,0,0,0,1,8]),a)))}function av(e){for(var t=[],n=(e=l(e.g)).next();!n.done;n=e.next()){n=n.value;var i,r=t.push,a=r.apply,o=lv,s=new Uint8Array([0,0,0,0].concat(c(sv(n.data?n.data.wb:0,4))));s=lv("mfhd",s);var u=n.data?n.data.ab:[],d=new Uint8Array(4+u.length);for(i=0;i<u.length;i++){var h=u[i].flags;d[i+4]=h.Ya<<4|h.$a<<2|h.Za}var f=(u=lv("sdtp",d)).length+92;d=lv,i=lv("tfhd",i=new Uint8Array([0,0,0,58].concat(c(sv(n.id+1,4)),[0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]))),h=n.data?n.data.baseMediaDecodeTime:0;var p=Math.floor(h%(dv+1));h=lv("tfdt",h=new Uint8Array([1,0,0,0].concat(c(sv(Math.floor(h/(dv+1)),4)),c(sv(p,4)))));var g=f,m=12+16*(p=(f=n.data?n.data.ab:[]).length),v=new Uint8Array(m);for(g+=8+m,v.set(["video"===n.type?1:0,0,15,1].concat(c(sv(p,4)),c(sv(g,4))),0),g=0;g<p;g++){var y=f[g];m=sv(y.duration,4);var b=sv(y.size,4),w=y.flags;y=sv(y.hb,4),v.set([].concat(c(m),c(b),[w.kb<<2|w.Ya,w.$a<<6|w.Za<<4|w.lb,61440&w.Xa,15&w.Xa],c(y)),12+16*g)}o=o("moof",s,u=d("traf",i,h,f=lv("trun",v),u)),a.call(r,t,[o,ov(n)])}return di.apply(ai,c(t))}function ov(e){return e=(e.data?e.data.ab:[]).map((function(e){return e.data})),lv("mdat",e=di.apply(ai,c(e)))}function sv(e,t){var n=[];for(--t;0<=t;t--)n.push(e>>8*t&255);return n}function uv(e){for(var t=new Uint8Array(e.length/2),n=0;n<e.length/2;n+=1)t[n]=parseInt(String(e[2*n]+e[2*n+1]),16);return t}function lv(e){var t=L.apply(1,arguments),n=hv[e];n||(n=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)],hv[e]=n);for(var i=8,r=t.length-1;0<=r;r--)i+=t[r].byteLength;for((r=new Uint8Array(i))[0]=i>>24&255,r[1]=i>>16&255,r[2]=i>>8&255,r[3]=255&i,r.set(n,4),n=0,i=8;n<t.length;n++)r.set(t[n],i),i+=t[n].byteLength;return r}var cv=!1,dv=Math.pow(2,32)-1,hv={},fv=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]),pv=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]),gv=new Uint8Array([0,0,0,0,0,0,0,0]),mv=new Uint8Array([0,0,0,0,0,0,0,0]),vv=new Uint8Array([0,0,0,0,0,0,0,0]),yv=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),bv=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),wv=new Uint8Array([0,0,0,0,0,0,0,0]),Tv=new Uint8Array([0,0,0,0,0,0,0,1]),Sv=new Uint8Array([]),xv=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),Av=new Uint8Array([]);function Ev(){var e=this;this.h=this.g=null,this.l=[],this.j=null,this.s=1,this.i=null,this.C=new G(5),this.o=new Be((function(){!function(e){var t;P((function(n){switch(n.g){case 1:return S(n,2),w(n,kv(e),4);case 4:A(n,3);break;case 2:t=E(n),e.h&&(t.severity=1,e.h.onError(t));case 3:if(!e.h)return n.return();T(n)}}))}(e)})),this.B=new ea,this.m=new Map,this.A=function(){return!1}}function kv(e){var t,n,i,r,a,o,s;return P((function(u){if(1==u.g)return t=aa(e.l,e.g.retryParameters),n=e.h.networkingEngine,i=Date.now(),r=n.request(0,t,{type:5,isPreload:e.A()}),ta(e.B,r),w(u,r.promise,2);if(a=u.h,!e.h)return u.return();a.uri&&!e.l.includes(a.uri)&&e.l.unshift(a.uri);var d=a.uri,h=a.data,f=e.g.mss.manifestPreprocessor;if(f!=dl){if(oe("manifest.mss.manifestPreprocessor configuration","Please Use manifest.mss.manifestPreprocessorTXml instead."),!(h=ng(h,"SmoothStreamingMedia")))throw new De(2,4,4046,d);f(h),h=pt(h.outerHTML)}var p=Ct(h,"SmoothStreamingMedia");if(!p)throw new De(2,4,4046,d);if((d=e.g.mss.manifestPreprocessorTXml)!=hl&&d(p),e.i||(e.i=new Ls(null,0)),d=Ft(p,"IsLive",$t,!1))throw new De(2,4,4047);e.i.Bc(!d),f=Ft(p,"TimeScale",Yt,1e7),h=Ft(p,"DVRWindowLength",Yt),d&&(0===h||isNaN(h))&&(h=1/0);var g,m=Ft(p,"CanSeek",$t,!1);for(0===h&&m&&(h=1/0),m=null,h&&0<h&&(m=h/f),d&&!isNaN(e.g.availabilityWindowOverride)&&(m=e.g.availabilityWindowOverride),null==m&&(m=1/0),e.i.pe(m),h=Ft(p,"Duration",Yt,1/0),d||e.i.bb(h/f),d={variants:[],textStreams:[],timescale:f,duration:h/f},m=Nt(p,"Protection"),f=e.g.mss.keySystemsBySystemId,h=[],g=(m=l(m)).next();!g.done;g=m.next())h=h.concat(Nt(g.value,"ProtectionHeader"));if(h.length){for(m=[],g=0;g<h.length;g++){var v=h[g],y=v.attributes.SystemID.toLowerCase(),b=f[y];if(b){var S=Jm(v);if(S)e:{for(var x=(S=l(Ut(S,"DATA"))).next();!x.done;x=S.next())if(x=_t(x.value,"KID")){S=ui(jt(x)),S=ci(S=new Uint8Array([S[3],S[2],S[1],S[0],S[5],S[4],S[7],S[6]].concat(c(S.slice(8)))));break e}S=null}else S=null;y=fi(b,"cenc",y=[{initData:La(x=ui(jt(v)),y=li(y.replace(/-/g,"")),new Set,0),initDataType:"cenc",keyId:S}]),S&&y.keyIds.add(S),(b=Qm.get(b))&&(y.licenseServerUri=b(v)),m.push(y)}}f=m}else f=[];for(g=f,m=[],f=[],h=[],v=(p=l(p=Nt(p,"StreamIndex"))).next();!v.done;v=p.next()){b=Nt(v=v.value,"QualityLevel"),y=d.timescale,S=d.duration,x=Nt(v,"c");for(var A=[],E=0,k=0;k<x.length;++k){var I=x[k],M=x[k+1],C=Ft(I,"t",Yt),D=Ft(I,"d",Yt);if(I=Ft(I,"r",zt),!D)break;if(C=null!=C?C:E,(I=I||0)&&I--,0>I)if(M){if(null==(M=Ft(M,"t",Yt)))break;if(C>=M)break;I=Math.ceil((M-C)/D)-1}else{if(1/0==S)break;if(C/y>=S)break;I=Math.ceil((S*y-C)/D)-1}for(M=0;M<=I;++M)E=C+D,A.push({start:C/y,end:E/y,dg:C}),C=E}for(y=A,S=(b=l(b)).next();!S.done;S=b.next())(S=Iv(e,v,S.value,y,g,d))&&("audio"!=S.type||e.g.disableAudio?"video"!=S.type||e.g.disableVideo?S.type!=yi||e.g.disableText||h.push(S):f.push(S):m.push(S))}for(p=[],g=(m=l(0<m.length?m:[null])).next();!g.done;g=m.next())for(g=g.value,A=(v=l(0<f.length?f:[null])).next();!A.done;A=v.next())y=(b=p).push,S=e,x=g,A=A.value,k=0,x&&x.bandwidth&&0<x.bandwidth&&(k+=x.bandwidth),A&&A.bandwidth&&0<A.bandwidth&&(k+=A.bandwidth),S={id:S.s++,language:x?x.language:"und",disabledUntilTime:0,primary:!!x&&x.primary||!!A&&A.primary,audio:x,video:A,bandwidth:k,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},y.call(b,S);d.variants=p,d.textStreams=h,e.j?(e.j.variants=d.variants,e.j.textStreams=d.textStreams,e.h.filter(e.j)):(e.j={presentationTimeline:e.i,variants:d.variants,textStreams:d.textStreams,imageStreams:[],offlineSessionIds:[],minBufferTime:0,sequenceMode:e.g.mss.sequenceMode,ignoreManifestTimestampsInSegmentsMode:!1,type:"MSS",serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,isLowLatency:!1,startTime:null},e.i.Xd()),Promise.resolve(),o=Date.now(),s=(o-i)/1e3,e.C.sample(1,s),T(u)}))}function Iv(e,t,n,i,r,a){var o=t.attributes.Type;if("audio"!==o&&"video"!==o&&"text"!==o)return W("Ignoring unrecognized type:",o),null;var s=t.attributes.Language,u=e.s++,c=Ft(n,"Bitrate",Wt),d=Ft(n,"MaxWidth",Wt),h=Ft(n,"MaxHeight",Wt),f=Ft(n,"Channels",Wt),p=Ft(n,"SamplingRate",Wt),g=a.duration;i.length&&(g=i[i.length-1].end-i[0].start);var m=e.i.getDuration();e.i.bb(Math.min(g,m));var v={id:u,originalId:t.attributes.Name||String(u),groupId:null,createSegmentIndex:function(){return Promise.resolve()},closeSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:"",codecs:"",frameRate:void 0,pixelAspectRatio:void 0,bandwidth:c||0,width:d||void 0,height:h||void 0,kind:"",encrypted:0<r.length,drmInfos:r,keyIds:new Set,language:Yi(s||"und"),originalLanguage:s,label:"",type:"",primary:!1,trickModeVideo:null,emsgSchemeIdUris:[],roles:[],forced:!1,channelsCount:f,audioSamplingRate:p,spatialAudio:!1,closedCaptions:null,hdr:void 0,colorGamut:void 0,videoLayout:void 0,tilesLayout:void 0,matchedStreams:[],mssPrivateData:{duration:g,timescale:a.timescale,codecPrivateData:null},accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set,isAudioMuxedInVideo:!1};if((r=t.attributes.Subtype)&&((r=Cv[r])&&v.roles.push(r),"main"===r&&(v.primary=!0)),null!==(r=n.attributes.FourCC)&&""!==r||(r=t.attributes.FourCC),!r)if("audio"===o)r="AAC";else if("video"===o)return W('FourCC is not defined whereas it is required for a QualityLevel element for a StreamIndex of type "video"'),null;if(!Mv.includes(r.toUpperCase()))return W("Codec not supported:",r),null;switch(n=function(e,t,n,i){if(e=e.attributes.CodecPrivateData)return e;if("audio"!==t)return null;t=i.channelsCount||2;var r={96e3:0,88200:1,64e3:2,48e3:3,44100:4,32e3:5,24e3:6,22050:7,16e3:8,12e3:9,11025:10,8e3:11,7350:12};return i=r[e=i.audioSamplingRate||44100],"AACH"===n?(n=new Uint8Array(4),e=r[2*e],n[0]=40|i>>1,n[1]=i<<7|t<<3|e>>1,n[2]=e<<7|8,n[3]=0,(t=new Uint16Array(2))[0]=(n[0]<<8)+n[1],t[1]=(n[2]<<8)+n[3],t[0].toString(16)+t[1].toString(16)):((n=new Uint8Array(2))[0]=16|i>>1,n[1]=i<<7|t<<3,(t=new Uint16Array(1))[0]=(n[0]<<8)+n[1],t[0].toString(16))}(n,o,r,v),v.mssPrivateData.codecPrivateData=n,o){case"audio":if(!n)return W("Quality unsupported without CodecPrivateData",o),null;v.type="audio",v.mimeType="mss/audio/mp4",v.codecs=function(e,t){var n=0;return"AACH"===e&&(n=5),t?0===n&&(n=(248&parseInt(t.substr(0,2),16))>>3):(n=2,"AACH"===e&&(n=5)),"mp4a.40."+n}(r,n);break;case"video":if(!n)return W("Quality unsupported without CodecPrivateData",o),null;v.type="video",v.mimeType="mss/video/mp4",v.codecs=function(e){var t=/00000001[0-9]7/.exec(e);return t.length&&e?"avc1."+e.substr(e.indexOf(t[0])+10,6):""}(n);break;case"text":v.type=yi,v.mimeType="application/mp4",("TTML"===r||"DFXP"===r)&&(v.codecs="stpp")}return v.fullMimeTypes.add(xi(v.mimeType,v.codecs)),v.createSegmentIndex=function(){if(v.segmentIndex)return Promise.resolve();if(e.m.has(v.id))var n=e.m.get(v.id);else n=[],"video"==v.type&&(n=v.mssPrivateData.codecPrivateData.split("00000001").slice(1)),n=ev(new Zm([n={id:v.id,type:v.type,codecs:v.codecs,encrypted:v.encrypted,timescale:v.mssPrivateData.timescale,duration:v.mssPrivateData.duration,fb:n,qa:new Uint8Array([]),za:new Uint8Array([]),Da:0,Fa:0,data:null,stream:v}])),e.m.set(v.id,n);return n=function(e,t,n,i,r){var a=i.attributes.Url.replace("{bitrate}",String(n.bandwidth));i=[];for(var o=(r=l(r)).next(),s={};!o.done;s={se:void 0},o=r.next())s.se=o.value,i.push(new vo(s.se.start,s.se.end,function(t){return function(){return hi(e.l,[a.replace("{start time}",String(t.se.dg))])}}(s),0,null,t,0,0,n.mssPrivateData.duration));return i}(e,new go((function(){return[]}),0,null,Iu(v),v.mssPrivateData.timescale,n),v,t,i),v.segmentIndex=new Zs(n),Promise.resolve()},v.closeSegmentIndex=function(){v.segmentIndex&&(v.segmentIndex.release(),v.segmentIndex=null)},v}(i=Ev.prototype).configure=function(e,t){this.g=e,t&&(this.A=t)},i.start=function(e,t){var n=this;return P((function(i){if(1==i.g)return n.l=[e],n.h=t,w(i,kv(n),2);if(!n.h)throw new De(2,7,7001);return i.return(n.j)}))},i.stop=function(){return this.g=this.h=null,this.l=[],this.j=null,null!=this.o&&(this.o.stop(),this.o=null),this.m.clear(),this.B.destroy()},i.update=function(){var e,t=this;return P((function(n){return 1==n.g?(S(n,2),w(n,kv(t),4)):2!=n.g?A(n,0):(e=E(n),t.h&&e?(t.h.onError(e),void T(n)):n.return())}))},i.onExpirationUpdated=function(){},i.onInitialVariantChosen=function(){},i.banLocation=function(){},i.setMediaElement=function(){},F("shaka.mss.MssParser",Ev);var Mv="AAC AACL AACH AACP AVC1 H264 TTML DFXP".split(" "),Cv={CAPT:"main",SUBT:"alternate",DESC:"main"};function Dv(e,t,n,i,r,a){if(200<=n&&299>=n&&202!=n)return{uri:r||i,originalUri:i,data:t,status:n,headers:e,fromCache:!!e["x-shaka-from-cache"]};var o=null;try{o=ft(t)}catch(e){}throw new De(401==n||403==n?2:1,1,1001,i,n,o,e,a,r||i)}function Rv(){}function Pv(e,t,n,i,r,a){var o=new _v;ma(t.headers).forEach((function(e,t){o.append(t,e)}));var s=new Ov,u={ng:!1,ph:!1};if(e=function(e,t,n,i,r,a,o,s){var u,l,c,d,h,f,p,g,m,v,y,b;return P((function(x){switch(x.g){case 1:return u=jv,l=Uv,f=h=0,p=Date.now(),S(x,2),w(x,u(e,n),4);case 4:if(c=x.h,a(Lv(c.headers)),"HEAD"==n.method){x.u(5);break}return g=c.clone().body.getReader(),v=(m=c.headers.get("Content-Length"))?parseInt(m,10):0,new l({start:function(e){!function t(){var n,i,a,u;return P((function(l){switch(l.g){case 1:return S(l,2),w(l,g.read(),4);case 4:n=l.h,A(l,3);break;case 2:return E(l),l.return();case 3:if(n.done){l.u(5);break}if(h+=n.value.byteLength,!o){l.u(5);break}return w(l,o(n.value),5);case 5:i=Date.now(),a=h-f,(100<i-p&&a>=s||n.done)&&(u=n.done?0:v-h,r(i-p,a,u),f=h,p=i),n.done?e.close():(e.enqueue(n.value),t()),T(l)}}))}()}}),w(x,c.arrayBuffer(),6);case 6:d=x.h;case 5:A(x,3);break;case 2:if(y=E(x),i.ng)throw new De(1,1,7001,e,t);if(i.ph)throw new De(1,1,1003,e,t);throw new De(1,1,1002,e,y,t);case 3:return b=Lv(c.headers),x.return(Dv(b,d,c.status,e,c.url,t))}}))}(e,n,{body:t.body||void 0,headers:o,method:t.method,signal:s.signal,credentials:t.allowCrossSiteCredentials?"include":void 0},u,i,r,t.streamDataCallback,a.minBytesForProgressEvents||0),e=new Kr(e,(function(){return u.ng=!0,s.abort(),Promise.resolve()})),t=t.retryParameters.timeout){var l=new Be((function(){u.ph=!0,s.abort()}));l.$(t/1e3),e.finally((function(){l.stop()}))}return e}function Lv(e){var t={};return e.forEach((function(e,n){t[n.trim()]=e})),t}function Nv(){if(!e.ReadableStream)return!1;try{new ReadableStream({})}catch(e){return!1}return!!e.Response&&!!new Response("").body&&!(!e.fetch||"polyfill"in e.fetch||!e.AbortController)}co["application/vnd.ms-sstr+xml"]=function(){return new Ev},F("shaka.net.HttpFetchPlugin",Rv),Rv.isSupported=Nv,Rv.parse=Pv;var jv=e.fetch,Ov=e.AbortController,Uv=e.ReadableStream,_v=e.Headers;function Bv(){}function Fv(e,t,n,i,r,a){var o=new Hv,s=Date.now(),u=0;return new Kr(new Promise((function(l,c){o.open(t.method,e,!0),o.responseType="arraybuffer",o.timeout=t.retryParameters.timeout,o.withCredentials=t.allowCrossSiteCredentials,o.onabort=function(){c(new De(1,1,7001,e,n))};var d=!1;for(var h in o.onreadystatechange=function(){if(2==o.readyState&&!d){var e=Vv(o);r(e),d=!0}},o.onload=function(t){var r=Vv(o),a=o.response;try{i(Date.now()-s,t.loaded-u,0);var d=Dv(r,a,o.status,e,o.responseURL,n);l(d)}catch(e){c(e)}},o.onerror=function(t){c(new De(1,1,1002,e,t,n))},o.ontimeout=function(){c(new De(1,1,1003,e,n))},o.onprogress=function(e){var t=Date.now(),n=a.minBytesForProgressEvents||0,r=e.loaded-u;(100<t-s&&r>=n||e.lengthComputable&&e.loaded==e.total)&&(i(t-s,r,4==o.readyState?0:e.total-e.loaded),u=e.loaded,s=t)},t.headers)o.setRequestHeader(h.toLowerCase(),t.headers[h]);o.send(t.body)})),(function(){return o.abort(),Promise.resolve()}))}function Vv(e){var t=e.getAllResponseHeaders().trim().split("\r\n");e={};for(var n=(t=l(t)).next();!n.done;n=t.next())e[(n=n.value.split(": "))[0].toLowerCase()]=n.slice(1).join(": ");return e}Nv()&&(ia("http",Pv,2,!0),ia("https",Pv,2,!0),ia("blob",Pv,2,!0)),F("shaka.net.HttpXHRPlugin",Bv),Bv.parse=Fv;var Hv=e.XMLHttpRequest;function Gv(e,t,n,i){this.g=e,this.i=t,this.groupId=n,this.h=i}function Kv(e){return e.N().map((function(e){return"{"+encodeURI(e.split("#xywh=")[0])+"}"})).join("")+":"+e.Ja+":"+e.va}function Xv(e,t){return Ru(e.g.N(),e.g.Ja,e.g.va,t.streaming.retryParameters)}function qv(){this.h=this.j=this.i=0,this.g=new Map,this.l=0}function zv(e,t){e.i+=t;var n=e.l;return e.l++,e.g.set(n,t),n}function Wv(e){var t=this;this.o=e,this.j=new Map,this.i=new fa((function(){return Yv(t).catch((function(){}))})),this.h=[],this.m=function(){},this.l=function(){},this.g=new qv}function Yv(e){var t=e.h.map((function(e){return e()}));return e.h=[],Promise.all(t)}function Jv(e,t,n,i,r,a){pa(e.i);var o=(e.j.get(t)||Promise.resolve()).then((function(){var t,o,s,u,l,c,d;return P((function(h){if(1==h.g)return w(h,function(e,t){var n,i,r,a;return P((function(o){return 1==o.g?(n=ca,i=e.o.request(n,t),r=function(){return i.abort()},e.h.push(r),w(o,i.promise,2)):(a=o.h,Ie(e.h,r),o.return(a.data))}))}(e,n),2);if(t=h.h,e.i.g)throw new De(2,9,7001);if(r)for(u in o=ge(t),(s=new Pa(o)).data)l=Number(u),c=s.data[l],d=s.g[l],e.l(c,d);e.g.close(i,t.byteLength);var f=e.g;return e.m(0==f.i?0:f.j/f.i,e.g.h),h.return(a(t))}))}));e.j.set(t,o)}function $v(e,t){var n=this;this.i=e,this.h=e.objectStore(t),this.g=new Gr,e.onabort=function(e){e.preventDefault(),n.g.reject()},e.onerror=function(e){e.preventDefault(),n.g.reject()},e.oncomplete=function(){n.g.resolve()}}function Qv(e,t){return new Promise((function(n,i){var r=e.h.openCursor();r.onerror=i,r.onsuccess=function(){var e;return P((function(i){if(1==i.g)return null==r.result?(n(),i.return()):(e=r.result,w(i,t(e.key,e.value,e),2));e.continue(),T(i)}))}}))}function Zv(e){this.h=e,this.g=[]}function ey(e,t){return ty(e,t,"readwrite")}function ty(e,t,n){var i=new $v(n=e.h.transaction([t],n),t);return e.g.push(i),i.promise().then((function(){Ie(e.g,i)}),(function(){Ie(e.g,i)})),i}function ny(e,t,n){this.h=new Zv(e),this.i=t,this.g=n}function iy(e){return Promise.reject(new De(2,9,9011,"Cannot add new value to "+e))}function ry(e,t,n,i){t=(e=ey(e.h,t)).store();for(var r=(n=l(n)).next(),a={};!r.done;a={wf:void 0},r=n.next())a.wf=r.value,t.delete(a.wf).onsuccess=function(e){return function(){return i(e.wf)}}(a);return e.promise()}function ay(e,t,n){var i,r,a,o,s,u,c;return P((function(d){if(1==d.g){for(i=ty(e.h,t,"readonly"),r=i.store(),a={},o=[],s=l(n),u=s.next(),c={};!u.done;c={ke:void 0,Vd:void 0},u=s.next())c.Vd=u.value,c.ke=r.get(c.Vd),c.ke.onsuccess=function(e){return function(){null==e.ke.result&&o.push(e.Vd),a[e.Vd]=e.ke.result}}(c);return w(d,i.promise(),2)}if(o.length)throw new De(2,9,9012,"Could not find values for "+o);return d.return(n.map((function(e){return a[e]})))}))}function oy(e){this.g=new Zv(e)}function sy(){this.g=new Map}function uy(e){var t=null;if(e.g.forEach((function(e,n){e.getCells().forEach((function(e,i){e.hasFixedKeySpace()||t||(t={path:{rb:n,Ma:i},Ma:e})}))})),t)return t;throw new De(2,9,9013,"Could not find a cell that supports add-operations")}function ly(e,t,n){if(!(e=e.g.get(t)))throw new De(2,9,9013,"Could not find mechanism with name "+t);if(!(t=e.getCells().get(n)))throw new De(2,9,9013,"Could not find cell with name "+n);return t}function cy(e,t){dy.set(e,t)}ia("http",Fv,1,!0),ia("https",Fv,1,!0),ia("blob",Fv,1,!0),qv.prototype.close=function(e,t){if(this.g.has(e)){var n=this.g.get(e);this.g.delete(e),this.j+=n,this.h+=t}},Wv.prototype.destroy=function(){return this.i.destroy()},$v.prototype.abort=function(){var e=this;return P((function(t){if(1==t.g){try{e.i.abort()}catch(e){}return S(t,2),w(t,e.g,4)}if(2!=t.g)return A(t,0);E(t),T(t)}))},$v.prototype.store=function(){return this.h},$v.prototype.promise=function(){return this.g},Zv.prototype.destroy=function(){return Promise.all(this.g.map((function(e){return e.abort()})))},(i=ny.prototype).destroy=function(){return this.h.destroy()},i.hasFixedKeySpace=function(){return!0},i.addSegments=function(){return iy(this.i)},i.removeSegments=function(e,t){return ry(this,this.i,e,t)},i.getSegments=function(e){var t,n=this;return P((function(i){return 1==i.g?w(i,ay(n,n.i,e),2):(t=i.h,i.return(t.map((function(e){return n.qg(e)}))))}))},i.addManifests=function(){return iy(this.g)},i.updateManifest=function(){return Promise.reject(new De(2,9,9016,"Cannot modify values in "+this.g))},i.updateManifestExpiration=function(e,t){var n=ey(this.h,this.g),i=n.store();return i.get(e).onsuccess=function(n){(n=n.target.result)&&(n.expiration=t,i.put(n,e))},n.promise()},i.removeManifests=function(e,t){return ry(this,this.g,e,t)},i.getManifests=function(e){var t,n=this;return P((function(i){return 1==i.g?w(i,ay(n,n.g,e),2):(t=i.h,i.return(Promise.all(t.map((function(e){return n.cd(e)})))))}))},i.getAllManifests=function(){var e,t,n=this;return P((function(i){return 1==i.g?(e=ty(n.h,n.g,"readonly"),t=new Map,w(i,Qv(e,(function(e,i){var r;return P((function(a){if(1==a.g)return w(a,n.cd(i),2);r=a.h,t.set(e,r),T(a)}))})),2)):3!=i.g?w(i,e.promise(),3):i.return(t)}))},i.qg=function(e){return e},i.cd=function(e){return Promise.resolve(e)},i.add=function(e,t){var n,i,r,a,o,s,u,c=this;return P((function(d){if(1==d.g){for(n=ey(c.h,e),i=n.store(),r=[],a=l(t),o=a.next(),s={};!o.done;s={Lf:void 0},o=a.next())u=o.value,s.Lf=i.add(u),s.Lf.onsuccess=function(e){return function(){r.push(e.Lf.result)}}(s);return w(d,n.promise(),2)}return d.return(r)}))},oy.prototype.destroy=function(){return this.g.destroy()},oy.prototype.getAll=function(){var e,t,n=this;return P((function(i){return 1==i.g?(e=ty(n.g,"session-ids","readonly"),t=[],w(i,Qv(e,(function(e,n){t.push(n)})),2)):3!=i.g?w(i,e.promise(),3):i.return(t)}))},oy.prototype.add=function(e){for(var t=ey(this.g,"session-ids"),n=t.store(),i=(e=l(e)).next();!i.done;i=e.next())n.add(i.value);return t.promise()},oy.prototype.remove=function(e){var t,n=this;return P((function(i){return 1==i.g?w(i,Qv(t=ey(n.g,"session-ids"),(function(t,n,i){e.includes(n.sessionId)&&i.delete()})),2):w(i,t.promise(),0)}))},sy.prototype.destroy=function(){for(var e=[],t=l(this.g.values()),n=t.next();!n.done;n=t.next())e.push(n.value.destroy());return this.g.clear(),Promise.all(e)},sy.prototype.init=function(){var e=this;dy.forEach((function(t,n){(t=t())&&e.g.set(n,t)}));for(var t=[],n=l(this.g.values()),i=n.next();!i.done;i=n.next())t.push(i.value.init());return Promise.all(t)},F("shaka.offline.StorageMuxer",sy),sy.unregister=function(e){dy.delete(e)},sy.register=cy,sy.prototype.destroy=sy.prototype.destroy;var dy=new Map;function hy(){ny.apply(this,arguments)}function fy(e,t){!function(e){var t=e.streams.filter((function(e){return"audio"==e.contentType}));if(e=e.streams.filter((function(e){return"video"==e.contentType})),!t.every((function(e){return e.variantIds}))||!e.every((function(e){return e.variantIds}))){for(var n=l(t),i=n.next();!i.done;i=n.next())i.value.variantIds=[];for(i=(n=l(e)).next();!i.done;i=n.next())i.value.variantIds=[];if(n=0,e.length&&!t.length){i=n++;for(var r=l(e),a=r.next();!a.done;a=r.next())a.value.variantIds.push(i)}if(!e.length&&t.length)for(i=n++,a=(r=l(t)).next();!a.done;a=r.next())a.value.variantIds.push(i);if(e.length&&t.length)for(i=(t=l(t)).next();!i.done;i=t.next())for(i=i.value,a=(r=l(e)).next();!a.done;a=r.next()){a=a.value;var o=n++;i.variantIds.push(o),a.variantIds.push(o)}}}(e);for(var n=l(e.streams),i=n.next();!i.done;i=n.next());return e.streams.map((function(n){return function(e,t,n){var i=e.initSegmentUri?py(e.initSegmentUri):null,r=t+e.presentationTimeOffset,a=t+n;return{id:e.id,originalId:null,groupId:null,primary:e.primary,type:e.contentType,mimeType:e.mimeType,codecs:e.codecs,frameRate:e.frameRate,pixelAspectRatio:void 0,hdr:void 0,colorGamut:void 0,videoLayout:void 0,kind:e.kind,language:e.language,originalLanguage:e.language||null,label:e.label,width:e.width,height:e.height,initSegmentKey:i,encrypted:e.encrypted,keyIds:new Set([e.keyId]),segments:e.segments.map((function(e){var n=py(e.uri);return{startTime:t+e.startTime,endTime:t+e.endTime,dataKey:n,initSegmentKey:i,appendWindowStart:t,appendWindowEnd:a,timestampOffset:r,tilesLayout:"",mimeType:null,codecs:null,thumbnailSprite:null}})),variantIds:e.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0,external:!1,fastSwitching:!1,isAudioMuxedInVideo:!1}}(n,e.startTime,t)}))}function py(e){var t;if((t=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(e))||(t=/^offline:segment\/([0-9]+)$/.exec(e)))return Number(t[1]);throw new De(2,9,9004,"Could not parse uri "+e)}function gy(){ny.apply(this,arguments)}function my(e,t,n){return{id:e.id,originalId:e.originalId,groupId:null,primary:e.primary,type:e.contentType,mimeType:e.mimeType,codecs:e.codecs,frameRate:e.frameRate,pixelAspectRatio:e.pixelAspectRatio,hdr:void 0,colorGamut:void 0,videoLayout:void 0,kind:e.kind,language:e.language,originalLanguage:e.language||null,label:e.label,width:e.width,height:e.height,encrypted:e.encrypted,keyIds:new Set([e.keyId]),segments:e.segments.map((function(i){return{startTime:t+i.startTime,endTime:t+i.endTime,initSegmentKey:e.initSegmentKey,appendWindowStart:t,appendWindowEnd:n,timestampOffset:t-e.presentationTimeOffset,dataKey:i.dataKey,tilesLayout:"",mimeType:null,codecs:null,thumbnailSprite:null}})),variantIds:e.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0,external:!1,fastSwitching:!1,isAudioMuxedInVideo:!1}}function vy(){ny.apply(this,arguments)}function yy(){this.m=this.j=this.i=this.h=this.g=this.l=null}function by(e,t,n,i){this.g=e,this.i=t,this.h=n,this.l=i,this.j=["offline:",e,"/",t,"/",n,"/",i].join("")}function wy(e){if(null==(e=/^offline:([a-z]+)\/([^/]+)\/([^/]+)\/([0-9]+)$/.exec(e)))return null;var t=e[1];if("manifest"!=t&&"segment"!=t)return null;var n=e[2];if(!n)return null;var i=e[3];return i&&null!=t?new by(t,n,i,Number(e[4])):null}function Ty(e,t){this.h=e,this.g=t}function Sy(e,t){var n=new Ls(null,0);n.bb(t.duration);var i=t.streams.filter((function(e){return"audio"==e.type})),r=t.streams.filter((function(e){return"video"==e.type}));i=function(e,t,n,i){for(var r=new Set,a=l(t),o=a.next();!o.done;o=a.next())for(var s=(o=l(o.value.variantIds)).next();!s.done;s=o.next())r.add(s.value);for(o=(a=l(n)).next();!o.done;o=a.next())for(s=(o=l(o.value.variantIds)).next();!s.done;s=o.next())r.add(s.value);for(a=new Map,o=(r=l(r)).next();!o.done;o=r.next())o=o.value,a.set(o,{id:o,language:"",disabledUntilTime:0,primary:!1,audio:null,video:null,bandwidth:0,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});for(r=(t=l(t)).next();!r.done;r=t.next())for(r=xy(e,o=r.value,i),s=(o=l(o.variantIds)).next();!s.done;s=o.next())(s=a.get(s.value)).language=r.language,s.primary=s.primary||r.primary,s.audio=r;for(t=(n=l(n)).next();!t.done;t=n.next())for(t=xy(e,r=t.value,i),o=(r=l(r.variantIds)).next();!o.done;o=r.next())(o=a.get(o.value)).primary=o.primary||t.primary,o.video=t;return a}(e,i,r,n),r=t.streams.filter((function(e){return e.type==yi})).map((function(t){return xy(e,t,n)}));var a=t.streams.filter((function(e){return"image"==e.type})).map((function(t){return xy(e,t,n)})),o=t.drmInfo?[t.drmInfo]:[];if(t.drmInfo)for(var s=l(i.values()),u=s.next();!u.done;u=s.next())(u=u.value).audio&&u.audio.encrypted&&(u.audio.drmInfos=o),u.video&&u.video.encrypted&&(u.video.drmInfos=o);return{presentationTimeline:n,minBufferTime:2,offlineSessionIds:t.sessionIds,variants:Array.from(i.values()),textStreams:r,imageStreams:a,sequenceMode:t.sequenceMode||!1,ignoreManifestTimestampsInSegmentsMode:!1,type:t.type||"UNKNOWN",serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,isLowLatency:!1,startTime:null}}function xy(e,t,n){var i=t.segments.map((function(n){return function(e,t,n){var i=new by("segment",e.h,e.g,t.dataKey);return e=new vo(t.startTime,t.endTime,(function(){return[i.toString()]}),0,null,null!=t.initSegmentKey?function(e,t){var n=new by("segment",e.h,e.g,t);return new go((function(){return[n.toString()]}),0,null)}(e,t.initSegmentKey):null,t.timestampOffset,t.appendWindowStart,t.appendWindowEnd,[],t.tilesLayout||""),e.mimeType=t.mimeType||n.mimeType||"",e.codecs=t.codecs||n.codecs||"",t.thumbnailSprite&&e.qe(t.thumbnailSprite),e}(e,n,t)}));return n.vd(i),{id:t.id,originalId:t.originalId,groupId:t.groupId,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new Zs(i),mimeType:t.mimeType,codecs:t.codecs,width:t.width||void 0,height:t.height||void 0,frameRate:t.frameRate,pixelAspectRatio:t.pixelAspectRatio,hdr:t.hdr,colorGamut:t.colorGamut,videoLayout:t.videoLayout,kind:t.kind,encrypted:t.encrypted,drmInfos:[],keyIds:t.keyIds,language:t.language,originalLanguage:t.originalLanguage||null,label:t.label,type:t.type,primary:t.primary,trickModeVideo:null,emsgSchemeIdUris:null,roles:t.roles,forced:t.forced,channelsCount:t.channelsCount,audioSamplingRate:t.audioSamplingRate,spatialAudio:t.spatialAudio,closedCaptions:t.closedCaptions,tilesLayout:t.tilesLayout,accessibilityPurpose:null,external:t.external,fastSwitching:t.fastSwitching,fullMimeTypes:new Set([xi(t.mimeType,t.codecs)]),isAudioMuxedInVideo:!1}}function Ay(){this.g=null}function Ey(){}function ky(e){var t=wy(e);return e=t&&"manifest"==t.g?zr(e={uri:e,originalUri:e,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}}):t&&"segment"==t.g?function(e,t){var n=new sy;return zr(void 0).Ca((function(){return n.init()})).Ca((function(){return ly(n,t.rb(),t.Ma())})).Ca((function(e){return e.getSegments([t.key()])})).Ca((function(e){return{uri:t,data:e[0].data,headers:{}}})).finally((function(){return n.destroy()}))}(t.key(),t):Xr(new De(2,1,9004,e))}function Iy(e,t,n){var i,r,a,o,s,u;return P((function(c){switch(c.g){case 1:i=[];for(var d=[],h=l(n),f=h.next();!f.done;f=h.next()){f=f.value;for(var p=!1,g=l(d),m=g.next();!m.done;m=g.next())if(My((m=m.value).info,f)){m.sessionIds.push(f.sessionId),p=!0;break}p||d.push({info:f,sessionIds:[f.sessionId]})}r=l(d),a=r.next();case 2:if(a.done){c.u(4);break}return o=a.value,s=function(e,t,n){var i,r;return P((function(a){switch(a.g){case 1:return i=new Na({Nb:t,onError:function(){},ee:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),S(a,2),i.configure(e),w(a,function(e,t,n,i,r,a){var o=new Map;return(r={audioCapabilities:r,videoCapabilities:a,distinctiveIdentifier:"optional",persistentState:"required",sessionTypes:["persistent-license"],label:t}).drmInfos=[{keySystem:t,licenseServerUri:n,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:i,serverCertificateUri:"",initData:null,keyIds:null}],o.set(t,r),Va(e,o,[])}(i,n.info.keySystem,n.info.licenseUri,n.info.serverCertificate,n.info.audioCapabilities,n.info.videoCapabilities),4);case 4:A(a,3);break;case 2:return E(a),w(a,i.destroy(),5);case 5:return a.return([]);case 3:return r=[],w(a,Promise.all(n.sessionIds.map((function(e){return P((function(t){return 1==t.g?(S(t,2),w(t,function(e,t){var n,i,r;return P((function(a){return 1==a.g?w(a,Ka(e,t,{initData:null,initDataType:null}),2):3!=a.g?(n=a.h)?(i=[],(r=e.i.get(n))&&(r.nb=new Gr,i.push(r.nb)),i.push(n.remove()),w(a,Promise.all(i),3)):a.return():(e.i.delete(n),void T(a))}))}(i,e),4)):2!=t.g?(r.push(e),A(t,0)):(E(t),void T(t))}))}))),6);case 6:return w(a,i.destroy(),7);case 7:return a.return(r)}}))}(e,t,o),w(c,s,5);case 5:u=c.h,i=i.concat(u),a=r.next(),c.u(2);break;case 4:return c.return(i)}}))}function My(e,t){function n(e,t){return e.robustness==t.robustness&&e.contentType==t.contentType}return e.keySystem==t.keySystem&&e.licenseUri==t.licenseUri&&Me(e.audioCapabilities,t.audioCapabilities,n)&&Me(e.videoCapabilities,t.videoCapabilities,n)}function Cy(e,t){var n=Sy(new Ty(e.rb(),e.Ma()),t),i=t.appMetadata||{};return n=Dy(n),{offlineUri:e.toString(),originalManifestUri:t.originalManifestUri,duration:t.duration,size:t.size,expiration:t.expiration,tracks:n,appMetadata:i,isIncomplete:t.isIncomplete||!1}}function Dy(e){for(var t=[],n=br(e.variants),i=(n=l(n)).next();!i.done;i=n.next())t.push(dr(i.value));for(n=(e=l(e.textStreams)).next();!n.done;n=e.next())t.push(hr(n.value));return t}function Ry(){this.g={}}function Py(e,t){var n=t.audio,i=t.video;if(n&&!i&&(e.g[n.id]=n.bandwidth||t.bandwidth),!n&&i&&(e.g[i.id]=i.bandwidth||t.bandwidth),n&&i){var r=n.bandwidth||393216,a=i.bandwidth||t.bandwidth-r;0>=a&&(a=t.bandwidth),e.g[n.id]=r,e.g[i.id]=a}}function Ly(e,t){e.g[t.id]=t.bandwidth||2048}function Ny(e,t){return null==(e=e.g[t])&&(e=0),e}function jy(e){var t=this;if(e&&e.constructor!=lc)throw new De(2,9,9008);this.g=this.h=null,e?(this.h=e.g,this.g=e.Ab()):(this.h=ll(),this.g=new na),this.i=[],this.j=[];var n=!e;this.l=new fa((function(){var e,i,r,a,o;return P((function(s){switch(s.g){case 1:return w(s,Promise.all(t.j.map((function(e){return Yv(e)}))),2);case 2:for(e=function(){},i=[],r=l(t.i),a=r.next();!a.done;a=r.next())o=a.value,i.push(o.then(e,e));return w(s,Promise.all(i),3);case 3:if(!n){s.u(4);break}return w(s,t.g.destroy(),4);case 4:t.h=null,t.g=null,T(s)}}))})),this.m=1e9}function Oy(){if(Fe())e:{for(var e=l(dy.values()),t=e.next();!t.done;t=e.next())if(t=(t=t.value)()){t.destroy(),e=!0;break e}e=!1}else e=!1;return e}function Uy(e){var t,n,i;return P((function(r){switch(r.g){case 1:return w(r,(t=new sy).init(),2);case 2:return w(r,uy(t),3);case 3:return n=r.h,i=new by("manifest",n.path.rb,n.path.Ma,e),w(r,t.destroy(),4);case 4:return w(r,(new jy).remove(i.toString()),0)}}))}function _y(e,t,n,i,r,a){var o,s,u,c,d,h,f,p,g,m,v;return P((function(y){switch(y.g){case 1:for(o=!1,S(y,2),s=!0,u=l(n.streams),c=u.next();!c.done;c=u.next())for(d=c.value,h=l(d.segments),f=h.next();!f.done;f=h.next())p=f.value,null!=(g=p.pendingSegmentRefId?i[p.pendingSegmentRefId]:null)&&(p.dataKey=g,p.pendingSegmentRefId=void 0),null!=(g=p.pendingInitSegmentRefId?i[p.pendingInitSegmentRefId]:null)&&(p.initSegmentKey=g,p.pendingInitSegmentRefId=void 0),p.pendingSegmentRefId&&(s=!1),p.pendingInitSegmentRefId&&(s=!1);return n.size+=r,s&&(n.isIncomplete=!1),w(y,e.updateManifest(t,n),4);case 4:o=!0,a(),A(y,0);break;case 2:return m=E(y),w(y,Uy(t),5);case 5:if(o){y.u(6);break}return v=Object.values(i),w(y,e.removeSegments(v,(function(){})),6);case 6:throw m}}))}function By(e){return e.variants.some((function(e){var t=e.audio&&e.audio.encrypted;return e.video&&e.video.encrypted||t}))}function Fy(e){return e.variants.some((function(e){return(e.video?e.video.drmInfos:[]).concat(e.audio?e.audio.drmInfos:[]).some((function(e){return e.initData&&e.initData.length}))}))}function Vy(e,t,n,i){if(t.expiration=n.gd(),n=Fa(n),t.sessionIds=i.offline.usePersistentLicense?n:[],By(e)&&i.offline.usePersistentLicense&&!n.length)throw new De(2,9,9007)}function Hy(e,t){for(var n=[],i=l(e.streams),r=i.next();!r.done;r=i.next())r=r.value,t&&"video"==r.type?n.push({contentType:xi(r.mimeType,r.codecs),robustness:e.drmInfo.videoRobustness}):t||"audio"!=r.type||n.push({contentType:xi(r.mimeType,r.codecs),robustness:e.drmInfo.audioRobustness});return n}function Gy(e,t,n){return P((function(i){return w(i,function(e,t,n,i){var r,a,o;return P((function(s){return 1==s.g?i.drmInfo?(r=function(e){var t=Array.from(e.g.keys());if(!t.length)throw new De(2,9,9e3,"No supported storage mechanisms found");return e.g.get(t[0]).getEmeSessionCell()}(n),a=i.sessionIds.map((function(e){return{sessionId:e,keySystem:i.drmInfo.keySystem,licenseUri:i.drmInfo.licenseServerUri,serverCertificate:i.drmInfo.serverCertificate,audioCapabilities:Hy(i,!1),videoCapabilities:Hy(i,!0)}})),w(s,Iy(t,e,a),2)):s.return():3!=s.g?(o=s.h,w(s,r.remove(o),3)):w(s,r.add(a.filter((function(e){return!o.includes(e.sessionId)}))),0)}))}(e.g,e.h.drm,n,t),0)}))}function Ky(e,t,n){function i(){}var r=function(e){for(var t=new Set,n=(e=l(e.streams)).next();!n.done;n=e.next())for(var i=(n=l(n.value.segments)).next();!i.done;i=n.next())null!=(i=i.value).initSegmentKey&&t.add(i.initSegmentKey),t.add(i.dataKey);return Array.from(t)}(n);return Cy(t,n),Promise.all([e.removeSegments(r,i),e.removeManifests([t.key()],i)])}function Xy(e,t){var n;return P((function(i){switch(i.g){case 1:return S(i,2),w(i,Al(t,e.g,e.h.streaming.retryParameters),4);case 4:n=i.h,A(i,3);break;case 2:E(i);case 3:if(n)return i.return(n);throw new De(1,2,2011,t)}}))}function qy(e,t,n,i,r,a){var o={id:i.id,originalId:i.originalId,groupId:i.groupId,primary:i.primary,type:i.type,mimeType:i.mimeType,codecs:i.codecs,frameRate:i.frameRate,pixelAspectRatio:i.pixelAspectRatio,hdr:i.hdr,colorGamut:i.colorGamut,videoLayout:i.videoLayout,kind:i.kind,language:i.language,originalLanguage:i.originalLanguage,label:i.label,width:i.width||null,height:i.height||null,encrypted:i.encrypted,keyIds:i.keyIds,segments:[],variantIds:[],roles:i.roles,forced:i.forced,channelsCount:i.channelsCount,audioSamplingRate:i.audioSamplingRate,spatialAudio:i.spatialAudio,closedCaptions:i.closedCaptions,tilesLayout:i.tilesLayout,external:i.external,fastSwitching:i.fastSwitching,isAudioMuxedInVideo:i.isAudioMuxedInVideo},s=r.offline.numberOfParallelDownloads,u=0===s?i.id:0;return function(e,t,n){if(null!=(t=e.segmentIndex.find(t)))for(var i=e.segmentIndex.get(t);i;)n(i),i=e.segmentIndex.get(++t)}(i,n.presentationTimeline.qb(),(function(n){var r=Kv(n),l=void 0;if(!a.has(r)){var c=n.endTime-n.startTime;c=Ny(t,i.id)*c,c=zv(e.g,c),a.set(r,new Gv(n,c,u,!1))}n.ba&&(l=Kv(n.ba),a.has(l)||(c=.5*Ny(t,i.id),c=zv(e.g,c),a.set(l,new Gv(n.ba,c,u,!0)))),o.segments.push({pendingInitSegmentRefId:l,initSegmentKey:l?0:null,startTime:n.startTime,endTime:n.endTime,appendWindowStart:n.appendWindowStart,appendWindowEnd:n.appendWindowEnd,timestampOffset:n.timestampOffset,tilesLayout:n.tilesLayout,pendingSegmentRefId:r,dataKey:0,mimeType:n.mimeType,codecs:n.codecs,thumbnailSprite:n.thumbnailSprite}),0!==s&&(u=(u+1)%s)})),o}function zy(e){if(e.l.g)throw new De(2,9,7001)}function Wy(){if(!Oy())throw new De(2,9,9e3)}function Yy(e,t){return P((function(n){return 1==n.g?(e.i.push(t),x(n,2),w(n,t,4)):2!=n.g?n.return(n.h):(k(n),Ie(e.i,t),I(n,0))}))}function Jy(e){for(var t=new Set,n=l(e.variants),i=n.next();!i.done;i=n.next())(i=i.value).audio&&t.add(i.audio),i.video&&t.add(i.video);for(i=(n=l(e.textStreams)).next();!i.done;i=n.next())t.add(i.value);for(n=(e=l(e.imageStreams)).next();!n.done;n=e.next())t.add(n.value);return t}m(hy,ny),hy.prototype.updateManifestExpiration=function(e,t){var n,i,r,a=this;return P((function(o){return n=ey(a.h,a.g),i=n.store(),r=new Gr,i.get(e).onsuccess=function(n){(n=n.target.result)?(n.expiration=t,i.put(n),r.resolve()):r.reject(new De(2,9,9012,"Could not find values for "+e))},w(o,Promise.all([n.promise(),r]),0)}))},hy.prototype.cd=function(e){var t,n,i,r,a,o;return P((function(s){if(1==s.g){for(t=[],n=0;n<e.periods.length;++n)i=n==e.periods.length-1?e.duration:e.periods[n+1].startTime,r=i-e.periods[n].startTime,a=fy(e.periods[n],r),t.push(a);return w(s,xp(t),2)}return o=s.h,s.return({creationTime:0,originalManifestUri:e.originalManifestUri,duration:e.duration,size:e.size,expiration:null==e.expiration?1/0:e.expiration,streams:o,sessionIds:e.sessionIds,drmInfo:e.drmInfo,appMetadata:e.appMetadata,sequenceMode:!1})}))},hy.prototype.qg=function(e){return{data:e.data}},m(gy,ny),gy.prototype.cd=function(e){var t,n,i,r,a,o;return P((function(s){if(1==s.g){for(t=[],n=0;n<e.periods.length;++n){i=n==e.periods.length-1?e.duration:e.periods[n+1].startTime,r=i-e.periods[n].startTime;for(var u=e.periods[n],c=[],d=l(u.streams),h=d.next();!h.done;h=d.next())0!=(h=h.value).variantIds.length&&c.push(my(h,u.startTime,u.startTime+r));a=c,t.push(a)}return w(s,xp(t),2)}return o=s.h,s.return({appMetadata:e.appMetadata,creationTime:0,drmInfo:e.drmInfo,duration:e.duration,expiration:null==e.expiration?1/0:e.expiration,originalManifestUri:e.originalManifestUri,sessionIds:e.sessionIds,size:e.size,streams:o,sequenceMode:!1})}))},m(vy,ny),(i=vy.prototype).hasFixedKeySpace=function(){return!1},i.addSegments=function(e){return this.add(this.i,e)},i.addManifests=function(e){return this.add(this.g,e)},i.updateManifest=function(e,t){return function(e,t,n){var i=(e=ey(e.h,e.g)).store();return i.get(t).onsuccess=function(){i.put(n,t)},e.promise()}(this,e,t)},i.cd=function(e){return null==e.expiration&&(e.expiration=1/0),Promise.resolve(e)},(i=yy.prototype).init=function(){var t=this,n=new Gr,i=!1,r=new Be((function(){i=!0,n.reject(new De(2,9,9017))}));r.$(5);var a=e.indexedDB.open("shaka_offline_db",5);return a.onsuccess=function(){if(!i){var e=a.result;t.l=e;var o=e.objectStoreNames;o=o.contains("manifest")&&o.contains("segment")?new hy(e,"segment","manifest"):null,t.g=o,o=(o=e.objectStoreNames).contains("manifest-v2")&&o.contains("segment-v2")?new gy(e,"segment-v2","manifest-v2"):null,t.h=o,o=(o=e.objectStoreNames).contains("manifest-v3")&&o.contains("segment-v3")?new gy(e,"segment-v3","manifest-v3"):null,t.i=o,o=(o=e.objectStoreNames).contains("manifest-v5")&&o.contains("segment-v5")?new vy(e,"segment-v5","manifest-v5"):null,t.j=o,e=e.objectStoreNames.contains("session-ids")?new oy(e):null,t.m=e,r.stop(),n.resolve()}},a.onupgradeneeded=function(){for(var e=a.result,t=l(["segment-v5","manifest-v5","session-ids"]),n=t.next();!n.done;n=t.next())n=n.value,e.objectStoreNames.contains(n)||e.createObjectStore(n,{autoIncrement:!0})},a.onerror=function(e){i||(n.reject(new De(2,9,9001,a.error)),r.stop(),e.preventDefault())},n},i.destroy=function(){var e=this;return P((function(t){switch(t.g){case 1:if(!e.g){t.u(2);break}return w(t,e.g.destroy(),2);case 2:if(!e.h){t.u(4);break}return w(t,e.h.destroy(),4);case 4:if(!e.i){t.u(6);break}return w(t,e.i.destroy(),6);case 6:if(!e.j){t.u(8);break}return w(t,e.j.destroy(),8);case 8:if(!e.m){t.u(10);break}return w(t,e.m.destroy(),10);case 10:e.l&&e.l.close(),T(t)}}))},i.getCells=function(){var e=new Map;return this.g&&e.set("v1",this.g),this.h&&e.set("v2",this.h),this.i&&e.set("v3",this.i),this.j&&e.set("v5",this.j),e},i.getEmeSessionCell=function(){return this.m},i.erase=function(){var t=this;return P((function(n){switch(n.g){case 1:if(!t.g){n.u(2);break}return w(n,t.g.destroy(),2);case 2:if(!t.h){n.u(4);break}return w(n,t.h.destroy(),4);case 4:if(!t.i){n.u(6);break}return w(n,t.i.destroy(),6);case 6:if(!t.j){n.u(8);break}return w(n,t.j.destroy(),8);case 8:return t.l&&t.l.close(),w(n,function(){var t=new Gr,n=e.indexedDB.deleteDatabase("shaka_offline_db");return n.onblocked=function(){},n.onsuccess=function(){t.resolve()},n.onerror=function(e){t.reject(new De(2,9,9001,n.error)),e.preventDefault()},t}(),10);case 10:return t.l=null,t.g=null,t.h=null,t.i=null,t.j=null,w(n,t.init(),0)}}))},cy("idb",(function(){return(!ze()||ze()&&nt())&&!Ge()&&e.indexedDB?new yy:null})),by.prototype.rb=function(){return this.i},by.prototype.Ma=function(){return this.h},by.prototype.key=function(){return this.l},by.prototype.toString=function(){return this.j},(i=Ay.prototype).configure=function(){},i.start=function(e,t){var n,i,r,a,o,s,u=this;return P((function(l){switch(l.g){case 1:if(n=wy(e),u.g=n,null==n||"manifest"!=n.g)throw new De(2,1,9004,e);return i=new sy,x(l,2),w(l,i.init(),4);case 4:return w(l,ly(i,n.rb(),n.Ma()),5);case 5:return w(l,l.h.getManifests([n.key()]),6);case 6:return r=l.h,a=r[0],o=new Ty(n.rb(),n.Ma()),s=Sy(o,a),t.makeTextStreamsForClosedCaptions(s),l.return(s);case 2:return k(l),w(l,i.destroy(),7);case 7:I(l,0)}}))},i.stop=function(){return Promise.resolve()},i.update=function(){},i.onExpirationUpdated=function(e,t){var n,i,r,a,o,s,u,l=this;return P((function(c){switch(c.g){case 1:return n=l.g,i=new sy,S(c,2,3),w(c,i.init(),5);case 5:return w(c,ly(i,n.rb(),n.Ma()),6);case 6:return w(c,(r=c.h).getManifests([n.key()]),7);case 7:if(a=c.h,o=a[0],s=o.sessionIds.includes(e),u=null==o.expiration||o.expiration>t,!s||!u){c.u(3);break}return w(c,r.updateManifestExpiration(n.key(),t),3);case 3:return k(c),w(c,i.destroy(),10);case 10:I(c,0);break;case 2:E(c),c.u(3)}}))},i.onInitialVariantChosen=function(){},i.banLocation=function(){},i.setMediaElement=function(){},co["application/x-offline-manifest"]=function(){return new Ay},F("shaka.offline.OfflineScheme",Ey),Ey.plugin=ky,ia("offline",ky),(i=jy.prototype).destroy=function(){return this.l.destroy()},i.configure=function(e,t){return 2==arguments.length&&"string"==typeof e&&(e=el(e,t)),cl(this.h,e)},i.getConfiguration=function(){var e=ll();return cl(e,this.h,ll()),e},i.Ab=function(){return this.g},i.store=function(e,t,n,i,r){var a=this,o=this.getConfiguration(),s=new Wv(this.g);return this.j.push(s),t=function(e,t,n,i,r,a,o,s){var u,c,d,h,f,p,g,m,v,y,b,x,M,C,D,R,L,N,j,O,U;return P((function(_){switch(_.g){case 1:return Wy(),c=u=null,d=new sy,p=f=h=null,S(_,2,3),w(_,a(),5);case 5:return u=_.h,w(_,function(e,t,n,i){var r,a,o,s,u;return P((function(l){if(1==l.g)return r=null,a=e.g,o={networkingEngine:a,filter:function(){return Promise.resolve()},makeTextStreamsForClosedCaptions:function(){},onTimelineRegionAdded:function(){},onEvent:function(){},onError:function(e){r=e},isLowLatencyMode:function(){return!1},isAutoLowLatencyMode:function(){return!1},enableLowLatencyMode:function(){},updateDuration:function(){},newDrmInfo:function(){},onManifestUpdated:function(){},getBandwidthEstimate:function(){return i.abr.defaultBandwidthEstimate},onMetadata:function(){},disableStream:function(){},addFont:function(){}},n.configure(i.manifest),zy(e),w(l,n.start(t,o),2);if(3!=l.g)return s=l.h,zy(e),u=Jy(s),w(l,Promise.all(ga(u,(function(e){return e.createSegmentIndex()}))),3);if(zy(e),r)throw r;return l.return(s)}))}(e,t,u,o),6);case 6:if(g=_.h,zy(e),g.presentationTimeline.U()||g.presentationTimeline.uc())throw new De(2,9,9005,t);m=l(i),v=m.next();case 7:if(v.done){_.u(9);break}return y=v.value,w(_,function(e,t,n){var i,r,a,o,s,u,c,d,h,f,p,g,m,v,y;return P((function(b){switch(b.g){case 1:return w(b,Xy(e,t),2);case 2:if("text/vtt"!=(i=b.h))throw new De(1,2,2017,t);return w(b,function(e,t,n){var i,r,a;return P((function(o){return 1==o.g?(i=ca,(r=aa([e],n)).method="GET",w(o,t.request(i,r).promise,2)):(a=o.h,o.return(a.data))}))}(t,e.g,e.h.streaming.retryParameters),3);case 3:if(r=b.h,!(a=Fi[i]))throw new De(2,2,2014,i);for(o=a(),s={periodStart:0,segmentStart:0,segmentEnd:n.presentationTimeline.getDuration(),vttOffset:0},u=ge(r),c=o.parseMedia(u,s,t,[]),d=[],h=l(c),f=h.next(),p={};!f.done;p={ye:void 0,Ic:void 0},f=h.next())p.Ic=f.value,p.ye=null,g=function(e){return function(){return null==e.ye&&(e.ye=hi([t],[e.Ic.payload])),e.ye||[]}}(p),m=new vo(p.Ic.startTime,p.Ic.endTime,g,0,null,null,0,0,1/0),p.Ic.payload.includes("#xywh")&&4===(v=p.Ic.payload.split("#xywh=")[1].split(",")).length&&m.qe({height:parseInt(v[3],10),positionX:parseInt(v[0],10),positionY:parseInt(v[1],10),width:parseInt(v[2],10)}),d.push(m);if(y=i,!d.length){b.u(4);break}return w(b,Al(d[0].N()[0],e.g,e.h.manifest.retryParameters),5);case 5:y=b.h;case 4:return b.return({id:e.m++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new Zs(d),mimeType:y||"",codecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:"image",primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,tilesLayout:"1x1",accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([xi(y||"","")]),isAudioMuxedInVideo:!1})}}))}(e,y,g),10);case 10:b=_.h,g.imageStreams.push(b),zy(e),v=m.next(),_.u(7);break;case 9:x=l(r),M=x.next();case 11:return M.done?w(_,e.Gc(g,(function(e){p=p||e}),o),15):(C=M.value,w(_,function(e,t,n,i,r,a,o){var s;return P((function(u){if(1==u.g)return a?u.u(2):w(u,Xy(e,n),3);if(2!=u.g&&(a=u.h),s={id:e.m++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:tu(0,t.presentationTimeline.getDuration(),[n]),mimeType:a||"",codecs:o||"",kind:r,encrypted:!1,drmInfos:[],keyIds:new Set,language:i,originalLanguage:i,label:null,type:yi,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([xi(a||"",o||"")]),isAudioMuxedInVideo:!1},!Ui(xi(s.mimeType,s.codecs)))throw new De(2,2,2014,a);return u.return(s)}))}(e,g,C.uri,C.language,C.kind,C.mime,C.codecs),14));case 14:D=_.h,g.textStreams.push(D),zy(e),M=x.next(),_.u(11);break;case 15:if(c=_.h,zy(e),p)throw p;return w(_,function(e,t,n){var i,r,a,o,s,u,c,d,h,f,p,g,m,v,y,b,x,k,I,M,C,D,R,L,N,j,O,U,_;return P((function(P){switch(P.g){case 1:return i={width:1/0,height:1/0},function(e,t,n){e.variants=e.variants.filter((function(e){return ir(e,t,n)}))}(e,n.restrictions,i),w(P,rr(t,e,n.offline.usePersistentLicense,n.drm.preferredKeySystems,n.drm.keySystemsMapping),2);case 2:for(r=[],a=n.preferredDecodingAttributes,o=n.preferredVideoCodecs,s=n.preferredAudioCodecs,u=n.preferredTextFormats,nr(e,o,s,a,u),c=l(e.variants),d=c.next();!d.done;d=c.next())h=d.value,r.push(dr(h));for(f=l(e.textStreams),p=f.next();!p.done;p=f.next())g=p.value,r.push(hr(g));for(m=l(e.imageStreams),v=m.next();!v.done;v=m.next())y=v.value,r.push(fr(y));return w(P,n.offline.trackSelectionCallback(r),3);case 3:for(b=P.h,x=e.presentationTimeline.getDuration(),k=0,I=l(b),M=I.next();!M.done;M=I.next())C=M.value,D=C.bandwidth*x/8,k+=D;return S(P,4),w(P,n.offline.downloadSizeCallback(k),6);case 6:if(!P.h)throw new De(2,9,9014);A(P,5);break;case 4:if((R=E(P))instanceof De)throw R;throw new De(2,9,9015);case 5:for(L=new Set,N=new Set,j=new Set,O=l(b),U=O.next();!U.done;U=O.next())"variant"==(_=U.value).type&&L.add(_.id),"text"==_.type&&N.add(_.id),"image"==_.type&&j.add(_.id);e.variants=e.variants.filter((function(e){return L.has(e.id)})),e.textStreams=e.textStreams.filter((function(e){return N.has(e.id)})),e.imageStreams=e.imageStreams.filter((function(e){return j.has(e.id)})),function(e){e.variants.map((function(e){return e.video}));var t=new Set(e.variants.map((function(e){return e.audio})));e=e.textStreams;for(var n=l(t),i=n.next();!i.done;i=n.next())for(var r=(i=l(t)).next();!r.done;r=i.next());for(n=(t=l(e)).next();!n.done;n=t.next())for(i=(n=l(e)).next();!i.done;i=n.next());}(e),T(P)}}))}(g,c,o),16);case 16:return w(_,d.init(),17);case 17:return zy(e),w(_,uy(d),18);case 18:return h=_.h,zy(e),R=function(e,t,n,i,r,a){var o=function(e,t,n){return{offlineUri:null,originalManifestUri:e,duration:t.presentationTimeline.getDuration(),size:0,expiration:1/0,tracks:t=Dy(t),appMetadata:n,isIncomplete:!1}}(n,t,i),s=r.offline.progressCallback;!function(e,t,n){e.m=function(e,t){o.size=t,s(o,e)},e.l=n}(a,0,(function(t,n){u&&r.offline.usePersistentLicense&&c==n&&Ba(e,"cenc",t)}));var u=By(t)&&!Fy(t),c=null;u&&(c=$y.get(e.g.keySystem));for(var d=new Ry,h=l(t.textStreams),f=h.next();!f.done;f=h.next())d.g[f.value.id]=52;for(f=(h=l(t.imageStreams)).next();!f.done;f=h.next())Ly(d,f.value);for(f=(h=l(t.variants)).next();!f.done;f=h.next())Py(d,f.value);return d=function(e,t,n,i){for(var r=new Map,a=Jy(n),o=new Map,s=(a=l(a)).next();!s.done;s=a.next()){var u=qy(e,t,n,s=s.value,i,r);o.set(s.id,u)}for(t=(e=l(n.variants)).next();!t.done;t=e.next())(t=t.value).audio&&o.get(t.audio.id).variantIds.push(t.id),t.video&&o.get(t.video.id).variantIds.push(t.id);return{streams:Array.from(o.values()),ag:Array.from(r.values())}}(a,d,t,r),a=d.streams,d=d.ag,h=e.g,f=r.offline.usePersistentLicense,h&&f&&(h.initData=[]),{xi:{creationTime:Date.now(),originalManifestUri:n,duration:t.presentationTimeline.getDuration(),size:0,expiration:e.gd(),streams:a,sessionIds:f?Fa(e):[],drmInfo:h,appMetadata:i,isIncomplete:!0,sequenceMode:t.sequenceMode,type:t.type},ag:d}}(c,g,t,n,o,s),L=R.xi,N=R.ag,w(_,h.Ma.addManifests([L]),19);case 19:if(j=_.h,zy(e),f=j[0],zy(e),p)throw p;return w(_,function(e,t,n,i,r,a,o,s,u){var c,d,h,f,p,g,m,v,y,b;return P((function(x){switch(x.g){case 1:if(c={},d=0,h=function(t,h){var f,p,g,m,v,y,b;return P((function(S){if(1==S.g){for(f=l(t),p=f.next(),g={};!p.done;g={Jc:void 0},p=f.next())g.Jc=p.value,m=Xv(g.Jc,a),v=g.Jc.i,y=g.Jc.h,b=function(t){return function(n){var i,r,a;return P((function(s){if(1==s.g)return w(s,o.addSegments([{data:n}]),2);i=s.h,zy(e),r=t.Jc.g,a=Kv(r),c[a]=i[0],d+=n.byteLength,T(s)}))}}(g),Jv(r,g.Jc.groupId,m,v,y,b);return w(S,function(e){return P((function(t){return 1==t.g?w(t,Promise.all(e.j.values()),2):t.return(e.g.h)}))}(r),2)}return h?(zy(e),Vy(s,i,u,a),w(S,o.updateManifest(n,i),0)):S.u(0)}))},f=!1,S(x,2),!By(s)||!f||Fy(s)){x.u(4);break}return w(x,h(t.filter((function(e){return e.h})),!0),5);case 5:return zy(e),t=t.filter((function(e){return!e.h})),p=c,g=d,c={},d=0,w(x,_y(o,n,i,p,g,(function(){return zy(e)})),6);case 6:zy(e);case 4:if(f){x.u(7);break}return w(x,h(t,!1),8);case 8:return zy(e),m=c,v=d,c={},d=0,w(x,_y(o,n,i,m,v,(function(){return zy(e)})),9);case 9:zy(e);case 7:A(x,0);break;case 2:return y=E(x),b=Object.values(c),w(x,o.removeSegments(b,(function(){})),10);case 10:throw y}}))}(e,N,f,L,s,o,h.Ma,g,c),20);case 20:return zy(e),Vy(g,L,c,o),w(_,h.Ma.updateManifest(f,L),21);case 21:return zy(e),O=new by("manifest",h.path.rb,h.path.Ma,f),_.return(Cy(O,L));case 3:return k(_),w(_,d.destroy(),22);case 22:if(!u){_.u(23);break}return w(_,u.stop(),23);case 23:if(!c){_.u(25);break}return w(_,c.destroy(),25);case 25:I(_,0);break;case 2:if(U=E(_),null==f){_.u(27);break}return w(_,Uy(f),27);case 27:throw p||U}}))}(this,e,t||{},i||[],r||[],(function(){var t;return P((function(i){return 1==i.g?n?i.u(2):w(i,Al(e,a.g,o.manifest.retryParameters),3):(2!=i.g&&(n=i.h),t=lo(e,n||null),i.return(t()))}))}),o,s),(t=new Kr(t,(function(){return Yv(s)}))).finally((function(){Ie(a.j,s)})),function(e,t){var n=t.promise;return e.i.push(n),t.finally((function(){Ie(e.i,n)}))}(this,t)},i.remove=function(e){return Yy(this,function(e,t){var n,i,r,a,o,s;return P((function(u){switch(u.g){case 1:if(Wy(),null==(n=wy(t))||"manifest"!=n.g)throw new De(2,9,9004,t);return i=n,r=new sy,x(u,2),w(u,r.init(),4);case 4:return w(u,ly(r,i.rb(),i.Ma()),5);case 5:return w(u,(a=u.h).getManifests([i.key()]),6);case 6:return o=u.h,s=o[0],w(u,Promise.all([Gy(e,s,r),Ky(a,i,s)]),2);case 2:return k(u),w(u,r.destroy(),8);case 8:I(u,0)}}))}(this,e))},i.Pi=function(){return Yy(this,function(e){var t,n,i,r,a,o,s,u,c,d;return P((function(h){switch(h.g){case 1:return Wy(),t=e.g,n=e.h.drm,i=new sy,r=!1,x(h,2),w(h,i.init(),4);case 4:a=[],function(e){e.g.forEach((function(e){var t;t=e.getEmeSessionCell(),a.push(t)}))}(i),o=l(a),s=o.next();case 5:if(s.done){h.u(2);break}return w(h,(u=s.value).getAll(),8);case 8:return c=h.h,w(h,Iy(n,t,c),9);case 9:return d=h.h,w(h,u.remove(d),10);case 10:d.length!=c.length&&(r=!0),s=o.next(),h.u(5);break;case 2:return k(h),w(h,i.destroy(),11);case 11:I(h,3);break;case 3:return h.return(!r)}}))}(this))},i.list=function(){return Yy(this,P((function(i){switch(i.g){case 1:return Wy(),e=[],t=new sy,x(i,2),w(i,t.init(),4);case 4:return n=Promise.resolve(),function(e,t){e.g.forEach((function(e,n){e.getCells().forEach((function(e,i){t({rb:n,Ma:i},e)}))}))}(t,(function(t,i){n=n.then((function(){return P((function(n){if(1==n.g)return w(n,i.getAllManifests(),2);n.h.forEach((function(n,i){n=Cy(new by("manifest",t.rb,t.Ma,i),n),e.push(n)})),T(n)}))}))})),w(i,n,2);case 2:return k(i),w(i,t.destroy(),6);case 6:I(i,3);break;case 3:return i.return(e)}})));var e,t,n},i.Gc=function(e,t,n){var i,r=this;return P((function(a){return 1==a.g?((i=new Na({Nb:r.g,onError:t,ee:function(){},onExpirationUpdated:function(){},onEvent:function(){}})).configure(n.drm),w(a,function(e,t,n){return e.ja=!0,e.B=new Map,e.O=n,Oa(e,t)}(i,e.variants,n.offline.usePersistentLicense),2)):3!=a.g?w(a,_a(i),3):a.return(i)}))},F("shaka.offline.Storage",jy),jy.deleteAll=function(){var e;return P((function(t){return 1==t.g?(e=new sy,x(t,2),w(t,function(e){var t,n;return P((function(i){return 1==i.g?(t=Array.from(e.g.values()),(n=0<t.length)||dy.forEach((function(e){(e=e())&&t.push(e)})),w(i,Promise.all(t.map((function(e){return e.erase()}))),2)):n?i.u(0):w(i,Promise.all(t.map((function(e){return e.destroy()}))),0)}))}(e),2)):5!=t.g?(k(t),w(t,e.destroy(),5)):I(t,0)}))},jy.prototype.list=jy.prototype.list,jy.prototype.removeEmeSessions=jy.prototype.Pi,jy.prototype.remove=jy.prototype.remove,jy.prototype.store=jy.prototype.store,jy.prototype.getNetworkingEngine=jy.prototype.Ab,jy.prototype.getConfiguration=jy.prototype.getConfiguration,jy.prototype.configure=jy.prototype.configure,jy.prototype.destroy=jy.prototype.destroy,jy.support=Oy;var $y=(new Map).set("org.w3.clearkey","1077efecc0b24d02ace33c1e52e2fb4b").set("com.widevine.alpha","edef8ba979d64acea3c827dcd51d21ed").set("com.microsoft.playready","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.recommendation","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.software","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.hardware","9a04f07998404286ab92e65be0885f95");function Qy(){}function Zy(e,t){for(e={priority:t||0,callback:e},t=0;t<eb.length;t++)if(eb[t].priority<e.priority)return void eb.splice(t,0,e);eb.push(e)}ld.offline=Oy,F("shaka.polyfill",Qy),Qy.register=Zy,Qy.installAll=function(){for(var e=l(eb),t=e.next();!t.done;t=e.next()){t=t.value;try{t.callback()}catch(e){W("Error installing polyfill!",e)}}};var eb=[];function tb(){}function nb(){if(!Object.getOwnPropertyDescriptor(Element.prototype,"ariaHidden"))for(var e=l(["ariaHidden","ariaLabel","ariaPressed","ariaSelected"]),t=e.next();!t.done;t=e.next())ib(t.value)}function ib(e){var t="aria-"+e.toLowerCase().replace(/^aria/,"");Object.defineProperty(Element.prototype,e,{get:function(){return this.getAttribute(t)},set:function(e){null==e||null==e?this.removeAttribute(t):this.setAttribute(t,e)}})}function rb(){}function ab(){$e()||rt("Sky_STB")||mS()}function ob(){}function sb(){if(e.Document){var t=Element.prototype;t.requestFullscreen=t.requestFullscreen||t.mozRequestFullScreen||t.msRequestFullscreen||t.webkitRequestFullscreen,(t=Document.prototype).exitFullscreen=t.exitFullscreen||t.mozCancelFullScreen||t.msExitFullscreen||t.webkitCancelFullScreen,"fullscreenElement"in document||(Object.defineProperty(document,"fullscreenElement",{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement||document.webkitFullscreenElement}}),Object.defineProperty(document,"fullscreenEnabled",{get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled}})),document.addEventListener("webkitfullscreenchange",ub),document.addEventListener("webkitfullscreenerror",ub),document.addEventListener("mozfullscreenchange",ub),document.addEventListener("mozfullscreenerror",ub),document.addEventListener("MSFullscreenChange",ub),document.addEventListener("MSFullscreenError",ub)}}function ub(e){var t=e.type.replace(/^(webkit|moz|MS)/,"").toLowerCase(),n=document.createEvent("Event");n.initEvent(t,e.bubbles,e.cancelable),e.target.dispatchEvent(n)}function lb(){}function cb(){var e=!0;!ze()||ze()&&nt()||ze()&&rt("Fuchsia")||(e=!1),(Ye()||Je()||$e()||qe()||Ke()||rt("PC=EOS")||Qe()||rt("WPE"))&&(e=!1),e&&navigator.mediaCapabilities||(navigator.mediaCapabilities||(navigator.mediaCapabilities={}),hb=navigator.mediaCapabilities,navigator.mediaCapabilities.decodingInfo=db)}function db(t){var n,i,r,a,o;return P((function(s){switch(s.g){case 1:if(n={supported:!1,powerEfficient:!0,smooth:!0,keySystemAccess:null,configuration:t},i=t.video,r=t.audio,"media-source"!=t.type){if("file"!=t.type)return s.return(n);if(i&&!Ve(i.contentType)||r&&!Ve(r.contentType))return s.return(n);s.u(2);break}if(!Fe())return s.return(n);if(!i){s.u(3);break}return w(s,function(t){var n,i;return P((function(r){return 1==r.g?ze()?w(r,function(t){var n,i,r;return P((function(a){if(1==a.g){if(!(e.cast&&cast.__platform__&&cast.__platform__.canDisplayType))return a.return(ne(t.contentType));switch(n=t.contentType,t.width&&t.height&&(1280<t.width||720<t.height)&&(n+="; width="+t.width+"; height="+t.height),t.framerate&&(24>(i=Math.round(t.framerate))||30<i)&&(n+="; framerate="+t.framerate),t.transferFunction||""){case"":case"srgb":break;case"pq":n+="; eotf=smpte2084";break;case"hlg":n+="; eotf=arib-std-b67";break;default:return a.return(!1)}return r=!1,n in bb?(r=bb[n],a.u(2)):w(a,cast.__platform__.canDisplayType(n),3)}return 2!=a.g&&(r=a.h,bb[n]=r),a.return(r)}))}(t),3):Ke()?(n=t.contentType,t.width&&t.height&&(n+="; width="+t.width,n+="; height="+t.height),t.framerate&&(n+="; framerate="+t.framerate),t.bitrate&&(n+="; bitrate="+t.bitrate),r.return(ne(n))):r.u(2):2!=r.g?(i=r.h,r.return(i)):r.return(ne(t.contentType))}))}(i),4);case 4:if(!s.h)return s.return(n);case 3:if(r){var u=r.contentType;if(ze()&&r.spatialRendering&&(u+="; spatialRendering=true"),!ne(u))return s.return(n)}case 2:return t.keySystemConfiguration?(a=t.keySystemConfiguration,w(s,function(e,t,n){var i,r,a,o,s,u,l,c,d,h,f;return P((function(p){switch(p.g){case 1:if(i=[],r=[],n.audio&&(a={robustness:n.audio.robustness||"",contentType:t.contentType},Ke()&&t.contentType.includes('codecs="ac-3"')&&(a.contentType='audio/mp4; codecs="ec-3"'),n.audio.encryptionScheme&&(a.encryptionScheme=n.audio.encryptionScheme),i.push(a)),n.video&&(o={robustness:n.video.robustness||"",contentType:e.contentType},n.video.encryptionScheme&&(o.encryptionScheme=n.video.encryptionScheme),r.push(o)),s={initDataTypes:[n.initDataType],distinctiveIdentifier:n.distinctiveIdentifier,persistentState:n.persistentState,sessionTypes:n.sessionTypes},i.length&&(s.audioCapabilities=i),r.length&&(s.videoCapabilities=r),u=e?e.contentType:"",l=t?t.contentType:"",c=Di(u)+";"+Ci(u),d=Di(l)+";"+Ci(l),h=n.keySystem,f=null,S(p,2),Ue.has(c+"#"+d+"#"+h)){f=Ue.get(c+"#"+d+"#"+h)||null,p.u(4);break}return w(p,navigator.requestMediaKeySystemAccess(n.keySystem,[s]),5);case 5:f=p.h,Ue.set(c+"#"+d+"#"+h,f);case 4:A(p,3);break;case 2:E(p);case 3:return p.return(f)}}))}(i,r,a),6)):(n.supported=!0,s.return(n));case 6:(o=s.h)&&(n.supported=!0,n.keySystemAccess=o);case 5:return s.return(n)}}))}Qy.Aria=tb,tb.install=nb,Zy(nb),Qy.EncryptionScheme=rb,rb.install=ab,Zy(ab,-2),Qy.Fullscreen=ob,ob.install=sb,Zy(sb),Qy.MediaCapabilities=lb,lb.install=cb;var hb=null;lb.originalMcap=hb;var fb,pb,gb,mb,vb,yb,bb={};function wb(){}function Tb(){var t=et();(e.MediaSource||e.ManagedMediaSource)&&(t&&e.MediaSource?10>=t?e.MediaSource=null:12>=t?(Sb(),xb()):15>=t&&Sb():rt("DT_STB_BCM")?(Sb(),xb()):rt("Tizen 2")||Xe()||rt("Tizen 4")?function(){var t=MediaSource.isTypeSupported.bind(MediaSource);if(MediaSource.isTypeSupported=function(e){return"opus"!=Ci(e)&&t(e)},e.ManagedMediaSource){var n=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);e.ManagedMediaSource.isTypeSupported=function(e){return"opus"!=Ci(e)&&n(e)}}}():rt("WPE")&&(Sb(),xb())),(e.MediaSource||e.ManagedMediaSource)&&function(){if(e.MediaSource){var t=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=function(e){return"mp2t"!=Ii(e)&&t(e)}}if(e.ManagedMediaSource){var n=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);e.ManagedMediaSource.isTypeSupported=function(e){return"mp2t"!=Ii(e)&&n(e)}}}(),e.MediaSource&&MediaSource.isTypeSupported('video/webm; codecs="vp9"')&&!MediaSource.isTypeSupported('video/webm; codecs="vp09.00.10.08"')&&function(){var e=MediaSource.isTypeSupported;qe()||(MediaSource.isTypeSupported=function(t){var n=t.split(/ *; */),i=n.findIndex((function(e){return e.startsWith("codecs=")}));if(0>i)return e(t);var r=n[i].replace("codecs=","").replace(/"/g,"").split(/\s*,\s*/),a=r.findIndex((function(e){return e.startsWith("vp09")}));return 0<=a&&(r[a]="vp9",n[i]='codecs="'+r.join(",")+'"',t=n.join("; ")),e(t)})}()}function Sb(){var e=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var t=e.apply(this,L.apply(0,arguments));return t.abort=function(){},t}}function xb(){var e=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(t,n){return e.call(this,t,n-.001)}}function Ab(){}function Eb(){screen.orientation&&screen.orientation.unlock||(null!=screen.orientation?(void 0===screen.orientation.lock&&(screen.orientation.lock=function(){return Promise.resolve()}),void 0===screen.orientation.unlock&&(screen.orientation.unlock=function(){})):null!=e.orientation&&function(){function t(){switch(e.orientation){case-90:n.type="landscape-secondary",n.angle=270;break;case 0:n.type="portrait-primary",n.angle=0;break;case 90:n.type="landscape-primary",n.angle=90;break;case 180:n.type="portrait-secondary",n.angle=180}}var n=new kb;screen.orientation=n,t(),e.addEventListener("orientationchange",(function(){t();var e=new Jr("change");n.dispatchEvent(e)}))}())}function kb(){Zr.call(this),this.type="",this.angle=0}function Ib(){}function Mb(e,t){try{var n=new Rb(e,t);return Promise.resolve(n)}catch(e){return Promise.reject(e)}}function Cb(e){var t=this.mediaKeys;return t&&t!=e&&Lb(t,null),delete this.mediaKeys,(this.mediaKeys=e)?Lb(e,this):Promise.resolve()}function Db(e){if(ve(e=ge(e.initData)).getUint32(0,!0)+4!=e.byteLength)throw new RangeError("Malformed FairPlay init data");e=pt(e=ht(e.subarray(4),!0));var t=new Event("encrypted");t.initDataType="skd",t.initData=pe(e),this.dispatchEvent(t)}function Rb(e,t){if(this.keySystem=e,e.startsWith("com.apple.fps"))for(t=(e=l(t)).next();!t.done;t=e.next()){var n=t.value;if("required"==n.persistentState)t=null;else{t={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:n.initDataTypes,sessionTypes:["temporary"],label:n.label};var i=!1,r=!1;if(n.audioCapabilities)for(var a=l(n.audioCapabilities),o=a.next();!o.done;o=a.next())(o=o.value).contentType&&(i=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,o.contentType.split(";")[0])&&(t.audioCapabilities.push(o),r=!0));if(n.videoCapabilities)for(a=(n=l(n.videoCapabilities)).next();!a.done;a=n.next())(a=a.value).contentType&&(i=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,a.contentType.split(";")[0])&&(t.videoCapabilities.push(a),r=!0));i||(r=WebKitMediaKeys.isTypeSupported(this.keySystem,"video/mp4")),t=r?t:null}if(t)return void(this.g=t)}throw(e=Error("Unsupported keySystem")).name="NotSupportedError",e.code=DOMException.NOT_SUPPORTED_ERR,e}function Pb(e){this.h=new WebKitMediaKeys(e),this.g=new Z}function Lb(e,t){if(e.g.Va(),!t)return Promise.resolve();e.g.D(t,"webkitneedkey",Db);try{return Bs(t,HTMLMediaElement.HAVE_METADATA,e.g,(function(){t.webkitSetMediaKeys(e.h)})),Promise.resolve()}catch(e){return Promise.reject(e)}}function Nb(e){Zr.call(this),this.i=null,this.l=e,this.g=this.h=null,this.j=new Z,this.sessionId="",this.expiration=NaN,this.closed=new Gr,this.keyStatuses=new Ob}function jb(e,t){var n=e.keyStatuses;n.size=null==t?0:1,n.g=t,t=new Jr("keystatuseschange"),e.dispatchEvent(t)}function Ob(){this.size=0,this.g=void 0}lb.memoizedCanDisplayTypeRequests_=bb,Zy(cb,-1),Qy.MediaSource=wb,wb.install=Tb,Zy(Tb),Qy.Orientation=Ab,Ab.install=Eb,m(kb,Zr),kb.prototype.lock=function(e){function t(e){return screen.lockOrientation?screen.lockOrientation(e):screen.mozLockOrientation?screen.mozLockOrientation(e):!!screen.msLockOrientation&&screen.msLockOrientation(e)}var n=!1;switch(e){case"natural":n=t("default");break;case"any":n=!0,this.unlock();break;default:n=t(e)}return n?Promise.resolve():((e=Error("screen.orientation.lock() is not available on this device")).name="NotSupportedError",e.code=DOMException.NOT_SUPPORTED_ERR,Promise.reject(e))},kb.prototype.unlock=function(){screen.unlockOrientation?screen.unlockOrientation():screen.mozUnlockOrientation?screen.mozUnlockOrientation():screen.msUnlockOrientation&&screen.msUnlockOrientation()},Zy(Eb),Qy.PatchedMediaKeysApple=Ib,Ib.uninstall=function(){fb&&(fb=!1,Object.defineProperty(HTMLMediaElement.prototype,"mediaKeys",pb),HTMLMediaElement.prototype.setMediaKeys=gb,e.MediaKeys=mb,e.MediaKeySystemAccess=vb,navigator.requestMediaKeySystemAccess=yb,pb=yb=gb=vb=mb=null,e.shakaMediaKeysPolyfill="")},Ib.install=function(t){e.HTMLVideoElement&&e.WebKitMediaKeys&&(void 0!==t&&t&&(fb=!0,pb=Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"mediaKeys"),gb=HTMLMediaElement.prototype.setMediaKeys,mb=e.MediaKeys,vb=e.MediaKeySystemAccess,yb=navigator.requestMediaKeySystemAccess),delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Cb,e.MediaKeys=Pb,e.MediaKeySystemAccess=Rb,navigator.requestMediaKeySystemAccess=Mb,e.shakaMediaKeysPolyfill=Ub)},Rb.prototype.createMediaKeys=function(){var e=new Pb(this.keySystem);return Promise.resolve(e)},Rb.prototype.getConfiguration=function(){return this.g},Pb.prototype.createSession=function(e){if("temporary"!=(e=e||"temporary"))throw new TypeError("Session type "+e+" is unsupported on this platform.");return new Nb(this.h,e)},Pb.prototype.setServerCertificate=function(){return Promise.resolve(!1)},Pb.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")},m(Nb,Zr),(i=Nb.prototype).generateRequest=function(e,t){var n=this;this.h=new Gr;try{var i=this.l.createSession("video/mp4",ge(t));this.i=i,this.sessionId=i.sessionId||"",this.j.D(this.i,"webkitkeymessage",(function(e){n.h&&(n.h.resolve(),n.h=null),e=new Jr("message",e=(new Map).set("messageType",null==n.keyStatuses.$b()?"license-request":"license-renewal").set("message",pe(e.message))),n.dispatchEvent(e)})),this.j.D(i,"webkitkeyadded",(function(){n.g&&(jb(n,"usable"),n.g.resolve(),n.g=null)})),this.j.D(i,"webkitkeyerror",(function(){var e=Error("EME PatchedMediaKeysApple key error");if(e.errorCode=n.i.error,null!=n.h)n.h.reject(e),n.h=null;else if(null!=n.g)n.g.reject(e),n.g=null;else switch(n.i.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:jb(n,"output-not-allowed");break;default:jb(n,"internal-error")}})),jb(this,"status-pending")}catch(e){this.h.reject(e)}return this.h},i.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))},i.update=function(e){this.g=new Gr;try{this.i.update(ge(e))}catch(e){this.g.reject(e)}return this.g},i.close=function(){try{this.i.close(),this.closed.resolve(),this.j.Va()}catch(e){this.closed.reject(e)}return this.closed},i.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))},(i=Ob.prototype).$b=function(){return this.g},i.forEach=function(e){this.g&&e(this.g,Oe.value())},i.get=function(e){if(this.has(e))return this.g},i.has=function(e){var t=Oe.value();return!(!this.g||!fe(e,t))},i.entries=function(){},i.keys=function(){},i.values=function(){};var Ub="apple";function _b(){}function Bb(){e.MediaKeys&&(!MediaKeys.prototype.setServerCertificate||Xe()||rt("Tizen 4")||rt("Tizen 5.0")||qe()&&38===We())&&(MediaKeys.prototype.setServerCertificate=Fb)}function Fb(){return Promise.resolve(!1)}function Vb(){}function Hb(){!e.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(navigator.requestMediaKeySystemAccess=Gb,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Kb,e.MediaKeys=Xb,e.MediaKeySystemAccess=qb,e.shakaMediaKeysPolyfill=zb)}function Gb(){return Promise.reject(Error("The key system specified is not supported."))}function Kb(e){return null==e?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}function Xb(){throw new TypeError("Illegal constructor.")}function qb(){throw this.keySystem="",new TypeError("Illegal constructor.")}Qy.PatchedMediaKeysCert=_b,_b.install=Bb,Zy(Bb),Qy.PatchedMediaKeysNop=Vb,Vb.install=Hb,Xb.prototype.createSession=function(){},Xb.prototype.setServerCertificate=function(){},Xb.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")},qb.prototype.getConfiguration=function(){},qb.prototype.createMediaKeys=function(){};var zb="nop";function Wb(){}function Yb(){if(!(!e.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)uw="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;navigator.requestMediaKeySystemAccess=$b,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Qb,e.MediaKeys=ew,e.MediaKeySystemAccess=Zb,e.shakaMediaKeysPolyfill=lw}}function Jb(e){return uw?uw+e.charAt(0).toUpperCase()+e.slice(1):e}function $b(e,t){try{var n=new Zb(e,t);return Promise.resolve(n)}catch(e){return Promise.reject(e)}}function Qb(e){var t=this.mediaKeys;return t&&t!=e&&tw(t,null),delete this.mediaKeys,(this.mediaKeys=e)&&tw(e,this),Promise.resolve()}function Zb(e,t){this.g=this.keySystem=e;var n=!1;"org.w3.clearkey"==e&&(this.g="webkit-org.w3.clearkey",n=!1);var i=!1,r=document.getElementsByTagName("video");r=r.length?r[0]:document.createElement("video");for(var a=(t=l(t)).next();!a.done;a=t.next()){var o={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:(a=a.value).initDataTypes,sessionTypes:["temporary"],label:a.label},s=!1;if(a.audioCapabilities)for(var u=l(a.audioCapabilities),c=u.next();!c.done;c=u.next())(c=c.value).contentType&&(s=!0,r.canPlayType(c.contentType.split(";")[0],this.g)&&(o.audioCapabilities.push(c),i=!0));if(a.videoCapabilities)for(c=(u=l(a.videoCapabilities)).next();!c.done;c=u.next())(c=c.value).contentType&&(s=!0,r.canPlayType(c.contentType,this.g)&&(o.videoCapabilities.push(c),i=!0));if(s||(i=r.canPlayType("video/mp4",this.g)||r.canPlayType("video/webm",this.g)),"required"==a.persistentState&&(n?(o.persistentState="required",o.sessionTypes=["persistent-license"]):i=!1),i)return void(this.h=o)}throw n="Unsupported keySystem","org.w3.clearkey"!=e&&"com.widevine.alpha"!=e||(n="None of the requested configurations were supported."),(e=Error(n)).name="NotSupportedError",e.code=DOMException.NOT_SUPPORTED_ERR,e}function ew(e){this.l=e,this.h=null,this.g=new Z,this.i=[],this.j=new Map}function tw(e,t){e.h=t,e.g.Va();var n=uw;t&&(e.g.D(t,n+"needkey",(function(t){var n=new CustomEvent("encrypted");n.initDataType="cenc",n.initData=pe(t.initData),e.h.dispatchEvent(n)})),e.g.D(t,n+"keymessage",(function(t){var n=nw(e,t.sessionId);n&&(t=new Jr("message",t=(new Map).set("messageType",null==n.keyStatuses.$b()?"licenserequest":"licenserenewal").set("message",t.message)),n.h&&(n.h.resolve(),n.h=null),n.dispatchEvent(t))})),e.g.D(t,n+"keyadded",(function(t){(t=nw(e,t.sessionId))&&t.ready()})),e.g.D(t,n+"keyerror",(function(t){var n=nw(e,t.sessionId);if(n){var i=Error("EME v0.1b key error"),r=t.errorCode;r.systemCode=t.systemCode,i.errorCode=r,!t.sessionId&&n.h?(45==t.systemCode&&(i.message="Unsupported session type."),n.h.reject(i),n.h=null):t.sessionId&&n.g?(n.g.reject(i),n.g=null):(i=t.systemCode,t.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?ow(n,"output-restricted"):ow(n,1==i?"expired":"internal-error"))}})))}function nw(e,t){var n=e.j.get(t);return n||((n=e.i.shift())?(n.sessionId=t,e.j.set(t,n),n):null)}function iw(e,t,n){Zr.call(this),this.j=e,this.m=!1,this.g=this.h=null,this.i=t,this.l=n,this.sessionId="",this.expiration=NaN,this.closed=new Gr,this.keyStatuses=new sw}function rw(e,t,n){if(e.m)return Promise.reject(Error("The session is already initialized."));e.m=!0;try{if("persistent-license"==e.l)if(n)var i=ge(pt("LOAD_SESSION|"+n));else{var r=pt("PERSISTENT|");i=di(r,t)}else i=ge(t)}catch(e){return Promise.reject(e)}e.h=new Gr;var a=Jb("generateKeyRequest");try{e.j[a](e.i,i)}catch(t){if("InvalidStateError"!=t.name)return e.h=null,Promise.reject(t);new Be((function(){try{e.j[a](e.i,i)}catch(t){e.h.reject(t),e.h=null}})).$(.01)}return e.h}function aw(e,t,n){if(e.g)e.g.then((function(){return aw(e,t,n)})).catch((function(){return aw(e,t,n)}));else{if(e.g=t,"webkit-org.w3.clearkey"==e.i){var i=dt(n),r=JSON.parse(i);"oct"!=r.keys[0].kty&&(e.g.reject(Error("Response is not a valid JSON Web Key Set.")),e.g=null),i=ui(r.keys[0].k),r=ui(r.keys[0].kid)}else i=ge(n),r=null;var a=Jb("addKey");try{e.j[a](e.i,i,r,e.sessionId)}catch(t){e.g.reject(t),e.g=null}}}function ow(e,t){var n=e.keyStatuses;n.size=null==t?0:1,n.g=t,t=new Jr("keystatuseschange"),e.dispatchEvent(t)}function sw(){this.size=0,this.g=void 0}Zy(Hb,-10),Qy.PatchedMediaKeysWebkit=Wb,Wb.install=Yb,Zb.prototype.createMediaKeys=function(){var e=new ew(this.g);return Promise.resolve(e)},Zb.prototype.getConfiguration=function(){return this.h},ew.prototype.createSession=function(e){if("temporary"!=(e=e||"temporary")&&"persistent-license"!=e)throw new TypeError("Session type "+e+" is unsupported on this platform.");var t=this.h||document.createElement("video");return t.src||(t.src="about:blank"),e=new iw(t,this.l,e),this.i.push(e),e},ew.prototype.setServerCertificate=function(){return Promise.resolve(!1)},ew.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")},m(iw,Zr),(i=iw.prototype).ready=function(){ow(this,"usable"),this.g&&this.g.resolve(),this.g=null},i.generateRequest=function(e,t){return rw(this,t,null)},i.load=function(e){return"persistent-license"==this.l?rw(this,null,e):Promise.reject(Error("Not a persistent session."))},i.update=function(e){var t=new Gr;return aw(this,t,e),t},i.close=function(){if("persistent-license"!=this.l){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var e=Jb("cancelKeyRequest");try{this.j[e](this.i,this.sessionId)}catch(e){}}return this.closed.resolve(),this.closed},i.remove=function(){return"persistent-license"!=this.l?Promise.reject(Error("Not a persistent session.")):this.close()},(i=sw.prototype).$b=function(){return this.g},i.forEach=function(e){this.g&&e(this.g,Oe.value())},i.get=function(e){if(this.has(e))return this.g},i.has=function(e){var t=Oe.value();return!(!this.g||!fe(e,t))},i.entries=function(){},i.keys=function(){},i.values=function(){};var uw="",lw="webkit";function cw(){}function dw(){if(e.HTMLVideoElement){var t=HTMLVideoElement.prototype;t.requestPictureInPicture&&document.exitPictureInPicture||!t.webkitSupportsPresentationMode||(document.pictureInPictureEnabled=!0,document.pictureInPictureElement=null,t.requestPictureInPicture=fw,Object.defineProperty(t,"disablePictureInPicture",{get:gw,set:mw,enumerable:!0,configurable:!0}),document.exitPictureInPicture=pw,document.addEventListener("webkitpresentationmodechanged",hw,!0))}}function hw(e){if("picture-in-picture"==(e=e.target).webkitPresentationMode){document.pictureInPictureElement=e;var t=new Event("enterpictureinpicture");e.dispatchEvent(t)}else document.pictureInPictureElement==e&&(document.pictureInPictureElement=null),t=new Event("leavepictureinpicture"),e.dispatchEvent(t)}function fw(){return this.webkitSupportsPresentationMode("picture-in-picture")?(this.webkitSetPresentationMode("picture-in-picture"),document.pictureInPictureElement=this,Promise.resolve()):Promise.reject(Error("PiP not allowed by video element"))}function pw(){var e=document.pictureInPictureElement;return e?(e.webkitSetPresentationMode("inline"),document.pictureInPictureElement=null,Promise.resolve()):Promise.reject(Error("No picture in picture element found"))}function gw(){return!!this.hasAttribute("disablePictureInPicture")||!this.webkitSupportsPresentationMode("picture-in-picture")}function mw(e){e?this.setAttribute("disablePictureInPicture",""):this.removeAttribute("disablePictureInPicture")}function vw(){}function yw(){e.crypto&&("randomUUID"in e.crypto||(e.crypto.randomUUID=bw))}function bw(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.substr(t.lastIndexOf("/")+1)}function ww(){}function Tw(){var e=Symbol.prototype;"description"in e||Object.defineProperty(e,"description",{get:Sw})}function Sw(){var e=/\((.*)\)/.exec(this.toString());return e?e[1]:void 0}function xw(){}function Aw(){if(e.HTMLMediaElement){var t=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var e=t.apply(this);return e&&e.catch((function(){})),e}}}function Ew(){}function kw(){if(e.HTMLVideoElement){var t=HTMLVideoElement.prototype;!t.getVideoPlaybackQuality&&("webkitDroppedFrameCount"in t||qe()&&38===We())&&(t.getVideoPlaybackQuality=Iw)}}function Iw(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}function Mw(){}function Cw(){if(!e.VTTCue&&e.TextTrackCue){var t=null,n=TextTrackCue.length;if(3==n)t=Dw;else if(6==n)t=Rw;else{try{var i=!!Dw(1,2,"")}catch(e){i=!1}i&&(t=Dw)}t&&(e.VTTCue=function(e,n,i){return t(e,n,i)})}}function Dw(t,n,i){return new e.TextTrackCue(t,n,i)}function Rw(t,n,i){return new e.TextTrackCue(t+"-"+n+"-"+i,t,n,i)}function Pw(){}Zy(Yb),Qy.PiPWebkit=cw,cw.install=dw,Zy(dw),Qy.RandomUUID=vw,vw.install=yw,Zy(yw),Qy.Symbol=ww,ww.install=Tw,Zy(Tw),Qy.VideoPlayPromise=xw,xw.install=Aw,Zy(Aw),Qy.VideoPlaybackQuality=Ew,Ew.install=kw,Zy(kw),Qy.VTTCue=Mw,Mw.install=Cw,Zy(Cw),Pw.prototype.parseInit=function(){},Pw.prototype.setSequenceMode=function(){},Pw.prototype.setManifestType=function(){},Pw.prototype.parseMedia=function(e,t){for(var n=null,i=[],r=(e=l(e=dt(e).split(/\r?\n/))).next();!r.done;r=e.next())if((r=r.value)&&!/^\s+$/.test(r)&&(r=Lw.exec(r))){var a=Nw.exec(r[1]);r=new un(a=60*parseInt(a[1],10)+parseFloat(a[2].replace(",",".")),t.segmentEnd?t.segmentEnd:a+2,r[2]),n&&(n.endTime=a,i.push(n)),n=r}return n&&i.push(n),i},F("shaka.text.LrcTextParser",Pw),Pw.prototype.parseMedia=Pw.prototype.parseMedia,Pw.prototype.setManifestType=Pw.prototype.setManifestType,Pw.prototype.setSequenceMode=Pw.prototype.setSequenceMode,Pw.prototype.parseInit=Pw.prototype.parseInit;var Lw=/^\[(\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?)\](.*)/,Nw=/^(\d+):(\d{1,2}(?:[.,]\d{1,3})?)$/;function jw(){}function Ow(e,t,n,i,r,a,o,s,u,c,d,h,f){var p=c;if(Pt(e)){if(!d)return null;var g={tagName:"span",children:[jt(e)],attributes:{},parent:null}}else g=e;for(var m=null,v=l(cT),y=v.next();!y.done&&!(m=Kw(g,"backgroundImage",i,"#",y.value)[0]);y=v.next());v=null;var b=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/;if((y=Gt(g,cT,"backgroundImage"))&&b.test(y)){if((v=parseInt(y.split(":").pop(),10)-1)>=f.length)return null;v=f[v]}else h&&y&&!y.startsWith("#")&&(b=new Gn(h),y=new Gn(y),(y=b.resolve(y).toString())&&(v=y));if(("p"==e.tagName||m||v)&&(d=!0),e=d,y="default"==(g.attributes["xml:space"]||(s?"default":"preserve")),s=[],!(b=g.children.every(Pt)))for(var w=l(g.children),T=w.next();!T.done;T=w.next())(T=Ow(T.value,t,n,i,r,a,o,y,u,g,d,h,f))&&s.push(T);if(i=null!=c,h=jt(g),h=g.children.length&&h&&/\S/.test(h),!((w=g.attributes.begin||g.attributes.end||g.attributes.dur)||h||"br"==g.tagName||0!=s.length||i&&!y))return null;for(h=(f=qw(g,n)).start,f=f.end;p&&p.tagName&&"tt"!=p.tagName;)h=(f=Xw(p,n,h,f)).start,f=f.end,p=p.parent;if(null==h&&(h=0),h+=t.periodStart,f=null==f?1/0:f+t.periodStart,h=Math.max(h,t.segmentStart),f=Math.min(f,t.segmentEnd),!w&&0<s.length)for(h=1/0,f=0,n=(t=l(s)).next();!n.done;n=t.next())n=n.value,h=Math.min(h,n.startTime),f=Math.max(f,n.endTime);if("br"==g.tagName)return(r=new un(h,f,"")).lineBreak=!0,r;if(t="",b&&(t=vt(jt(g)||""),y&&(t=t.replace(/\s+/g," "))),(t=new un(h,f,t)).nestedCues=s,d||(t.isContainer=!0),u&&(t.cellResolution=u),u=Kw(g,"region",a,"")[0],g.attributes.region&&u&&u.attributes["xml:id"]){var S=u.attributes["xml:id"];t.region=o.filter((function(e){return e.id==S}))[0]}return o=u,c&&i&&!g.attributes.region&&!g.attributes.style&&(o=Kw(c,"region",a,"")[0]),function(e,t,n,i,r,a,o,s){if("rtl"==Fw(t,n,a,"direction",o=o||s)&&(e.direction="rtl"),"tb"==(s=Fw(t,n,a,"writingMode",o))||"tblr"==s?e.writingMode="vertical-lr":"tbrl"==s?e.writingMode="vertical-rl":"rltb"==s||"rl"==s?e.direction="rtl":s&&(e.direction=wn),(s=Fw(t,n,a,"textAlign",!0))?(e.positionAlign=sT[s],e.lineAlign=oT[s],e.textAlign=vn[s.toUpperCase()]):e.textAlign=mn,(s=Fw(t,n,a,"displayAlign",!0))&&(e.displayAlign=bn[s.toUpperCase()]),(s=Fw(t,n,a,"color",o))&&(e.color=_w(s)),(s=Fw(t,n,a,"backgroundColor",o))&&(e.backgroundColor=_w(s)),(s=Fw(t,n,a,"border",o))&&(e.border=s),s=Fw(t,n,a,"fontFamily",o))switch(s){case"monospaceSerif":e.fontFamily="Courier New,Liberation Mono,Courier,monospace";break;case"proportionalSansSerif":e.fontFamily="Arial,Helvetica,Liberation Sans,sans-serif";break;case"sansSerif":e.fontFamily="sans-serif";break;case"monospaceSansSerif":e.fontFamily="Consolas,monospace";break;case"proportionalSerif":e.fontFamily="serif";break;default:e.fontFamily=s.split(",").filter((function(e){return"default"!=e})).join(",")}switch((s=Fw(t,n,a,"fontWeight",o))&&"bold"==s&&(e.fontWeight=Mn),s=Fw(t,n,a,"wrapOption",o),e.wrapLine=!s||"noWrap"!=s,(s=Fw(t,n,a,"lineHeight",o))&&s.match(Qw)&&(e.lineHeight=s),(s=Fw(t,n,a,"fontSize",o))&&(s.match(Qw)||s.match($w))&&(e.fontSize=s),(s=Fw(t,n,a,"fontStyle",o))&&(e.fontStyle=Rn[s.toUpperCase()]),i?(r=i.attributes.imageType||i.attributes.imagetype,s=i.attributes.encoding,i=jt(i).trim(),"PNG"==r&&"Base64"==s&&i&&(e.backgroundImage="data:image/png;base64,"+i)):r&&(e.backgroundImage=r),(i=Fw(t,n,a,"textOutline",o))&&((i=i.split(" "))[0].match(Qw)?e.textStrokeColor=e.color:(e.textStrokeColor=_w(i[0]),i.shift()),i[0]&&i[0].match(Qw)?e.textStrokeWidth=i[0]:e.textStrokeColor=""),(i=Fw(t,n,a,"letterSpacing",o))&&i.match(Qw)&&(e.letterSpacing=i),(i=Fw(t,n,a,"linePadding",o))&&i.match(Qw)&&(e.linePadding=i),(i=Fw(t,n,a,"opacity",o))&&(e.opacity=parseFloat(i)),(i=Vw(n,a,"textDecoration"))&&Bw(e,i),(i=Hw(t,a,"textDecoration"))&&Bw(e,i),(i=Fw(t,n,a,"textCombine",o))&&(e.textCombineUpright=i),Fw(t,n,a,"ruby",o)){case"container":e.rubyTag="ruby";break;case"text":e.rubyTag="rt"}}(t,g,o,m,v,r,e,0==s.length),t}function Uw(e,t,n){var i=new xe,r=e.attributes["xml:id"];if(!r)return null;i.id=r,r=null,n&&(r=Jw.exec(n)||Zw.exec(n)),n=r?Number(r[1]):null,r=r?Number(r[2]):null;var a,o=Vw(e,t,"extent");if(o){var s=(a=Jw.exec(o))||Zw.exec(o);null!=s&&(i.width=Number(s[1]),i.height=Number(s[2]),a||(null!=n&&(i.width=100*i.width/n),null!=r&&(i.height=100*i.height/r)),i.widthUnits=a||null!=n?Ae:0,i.heightUnits=a||null!=r?Ae:0)}return(e=Vw(e,t,"origin"))&&null!=(s=(a=Jw.exec(e))||Zw.exec(e))&&(i.viewportAnchorX=Number(s[1]),i.viewportAnchorY=Number(s[2]),a?o||(i.width=100-i.viewportAnchorX,i.widthUnits=Ae,i.height=100-i.viewportAnchorY,i.heightUnits=Ae):(null!=r&&(i.viewportAnchorY=100*i.viewportAnchorY/r),null!=n&&(i.viewportAnchorX=100*i.viewportAnchorX/n)),i.viewportAnchorUnits=a||null!=n?Ae:0),i}function _w(e){var t=e.match(/rgba\(([^)]+)\)/);return t&&4==(t=t[1].split(",")).length?(t[3]=String(Number(t[3])/255),"rgba("+t.join(",")+")"):e}function Bw(e,t){for(var n=(t=l(t.split(" "))).next();!n.done;n=t.next())switch(n.value){case"underline":e.textDecoration.includes(Pn)||e.textDecoration.push(Pn);break;case"noUnderline":e.textDecoration.includes(Pn)&&Ie(e.textDecoration,Pn);break;case"lineThrough":e.textDecoration.includes("lineThrough")||e.textDecoration.push("lineThrough");break;case"noLineThrough":e.textDecoration.includes("lineThrough")&&Ie(e.textDecoration,"lineThrough");break;case"overline":e.textDecoration.includes("overline")||e.textDecoration.push("overline");break;case"noOverline":e.textDecoration.includes("overline")&&Ie(e.textDecoration,"overline")}}function Fw(e,t,n,i,r){return r=void 0===r||r,(e=Hw(e,n,i))?e:r?Vw(t,n,i):null}function Vw(e,t,n){return e?Gt(e,lT,n)||Gw(e,t,n):null}function Hw(e,t,n){return Gt(e,lT,n)||Gw(e,t,n)}function Gw(e,t,n){e=Kw(e,"style",t,"");for(var i=null,r=0;r<e.length;r++){var a=Vt(e[r],"urn:ebu:tt:style",n);a||(a=Gt(e[r],lT,n)),a||(a=Hw(e[r],t,n)),a&&(i=a)}return i}function Kw(e,t,n,i,r){var a=[];if(!e||1>n.length)return a;var o=e;for(e=null;!e&&!(e=r?Vt(o,r,t):o.attributes[t])&&(o=o.parent););if(t=e)for(r=(t=l(t.split(" "))).next();!r.done;r=t.next())for(r=r.value,o=(e=l(n)).next();!o.done;o=e.next())if(i+(o=o.value).attributes["xml:id"]==r){a.push(o);break}return a}function Xw(e,t,n,i){return e=qw(e,t),null==n?n=e.start:null!=e.start&&(n+=e.start),null==i?i=e.end:null!=e.start&&(i+=e.start),{start:n,end:i}}function qw(e,t){var n=zw(e.attributes.begin,t),i=zw(e.attributes.end,t);return e=zw(e.attributes.dur,t),null==i&&null!=e&&(i=n+e),{start:n,end:i}}function zw(e,t){var n=null;if(eT.test(e)){e=eT.exec(e),n=Number(e[1]);var i=Number(e[2]),r=Number(e[3]),a=Number(e[4]);n=(r+=(a+=(Number(e[5])||0)/t.h)/t.frameRate)+60*i+3600*n}else if(tT.test(e))n=Ww(tT,e);else if(nT.test(e))n=Ww(nT,e);else if(iT.test(e))e=iT.exec(e),n=Number(e[1])/t.frameRate;else if(rT.test(e))e=rT.exec(e),n=Number(e[1])/t.g;else if(aT.test(e))n=Ww(aT,e);else if(e)throw new De(2,2,2001,"Could not parse cue time range in TTML");return n}function Ww(e,t){return null==(e=e.exec(t))||""==e[0]?null:(Number(e[4])||0)/1e3+(Number(e[3])||0)+60*(Number(e[2])||0)+3600*(Number(e[1])||0)}function Yw(e,t,n,i){this.frameRate=Number(e)||30,this.h=Number(t)||1,this.g=Number(i),0==this.g&&(this.g=e?this.frameRate*this.h:1),n&&(e=/^(\d+) (\d+)$/g.exec(n))&&(this.frameRate*=Number(e[1])/Number(e[2]))}Fi["application/x-subtitle-lrc"]=function(){return new Pw},jw.prototype.parseInit=function(){},jw.prototype.setSequenceMode=function(){},jw.prototype.setManifestType=function(){},jw.prototype.parseMedia=function(e,t,n,i){var r=dt(e);if(e=[],""==r)return e;var a=Dt(r,"tt",!0);if(!a)throw new De(2,2,2005,"Failed to parse TTML.");if(!(r=Ut(a,"body")[0]))return[];var o=Gt(a,uT,"frameRate"),s=Gt(a,uT,"subFrameRate"),u=Gt(a,uT,"frameRateMultiplier"),c=Gt(a,uT,"tickRate"),d=Gt(a,uT,"cellResolution"),h=a.attributes["xml:space"]||"default",f=Gt(a,lT,"extent");if("default"!=h&&"preserve"!=h)throw new De(2,2,2005,"Invalid xml:space value: "+h);h="default"==h,o=new Yw(o,s,u,c),d=function(e){return e&&(e=/^(\d+) (\d+)$/.exec(e))?{lc:parseInt(e[1],10),rows:parseInt(e[2],10)}:null}(d),s=((s=Ut(a,"metadata")[0])?s.children:[]).filter((function(e){return"\n"!=e})),u=Ut(a,"style"),c=[];for(var p=l(a=Ut(a,"region")),g=p.next();!g.done;g=p.next())(g=Uw(g.value,u,f))&&c.push(g);if(Nt(r,"p").length)throw new De(2,2,2001,"<p> can only be inside <div> in TTML");for(p=(f=l(Nt(r,"div"))).next();!p.done;p=f.next())if(Nt(p.value,"span").length)throw new De(2,2,2001,"<span> can only be inside <p> in TTML");return(t=Ow(r,t,o,s,u,a,c,h,d,null,!1,n,i))&&(t.backgroundColor||(t.backgroundColor="transparent"),e.push(t)),e},F("shaka.text.TtmlTextParser",jw),jw.prototype.parseMedia=jw.prototype.parseMedia,jw.prototype.setManifestType=jw.prototype.setManifestType,jw.prototype.setSequenceMode=jw.prototype.setSequenceMode,jw.prototype.parseInit=jw.prototype.parseInit;var Jw=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,$w=/^(\d{1,4}(?:\.\d+)?|100)%$/,Qw=/^(\d+px|\d+em|\d*\.?\d+c)$/,Zw=/^(\d+)px (\d+)px$/,eT=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,tT=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,nT=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,iT=/^(\d*(?:\.\d*)?)f$/,rT=/^(\d*(?:\.\d*)?)t$/,aT=RegExp("^(?:(\\d*(?:\\.\\d*)?)h)?(?:(\\d*(?:\\.\\d*)?)m)?(?:(\\d*(?:\\.\\d*)?)s)?(?:(\\d*(?:\\.\\d*)?)ms)?$"),oT={left:xn,center:"center",right:"end",start:xn,end:"end"},sT={left:"line-left",center:"center",right:"line-right"},uT=["http://www.w3.org/ns/ttml#parameter","http://www.w3.org/2006/10/ttaf1#parameter"],lT=["http://www.w3.org/ns/ttml#styling","http://www.w3.org/2006/10/ttaf1#styling"],cT=["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt","http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];function dT(){this.g=new jw}function hT(){this.g="UNKNOWN"}function fT(e,t,n){var i;(i=/^align:(start|middle|center|end|left|right)$/.exec(t))?(t=i[1],e.textAlign="middle"==t?mn:vn[t.toUpperCase()]):(i=/^vertical:(lr|rl)$/.exec(t))?e.writingMode="lr"==i[1]?"vertical-lr":"vertical-rl":(i=/^size:([\d.]+)%$/.exec(t))?e.size=Number(i[1]):(i=/^position:([\d.]+)%(?:,(line-left|line-right|middle|center|start|end|auto))?$/.exec(t))?(e.position=Number(i[1]),i[2]&&(t=i[2],e.positionAlign="line-left"==t||"start"==t?"line-left":"line-right"==t||"end"==t?"line-right":"center"==t||"middle"==t?"center":gn)):(i=/^region:(.*)$/.exec(t))?(t=function(e,t){return e=e.filter((function(e){return e.id==t})),e.length?e[0]:null}(n,i[1]))&&(e.region=t):(n=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(t))?(e.lineInterpretation=1,e.line=Number(n[1]),n[2]&&(e.lineAlign=An[n[2].toUpperCase()])):(n=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(t))&&(e.lineInterpretation=Sn,e.line=Number(n[1]),n[2]&&(e.lineAlign=An[n[2].toUpperCase()]))}function pT(){this.g=null}function gT(e,t,n){var i,r,a;return(new Ta).box("payl",ka((function(e){i=dt(e)}))).box("iden",ka((function(e){r=dt(e)}))).box("sttg",ka((function(e){a=dt(e)}))).parse(e),i?function(e,t,n,i,r){if(dn(e=new un(i,r,e)),t&&(e.id=t),n)for(n=St(t=new bt(n));n;)fT(e,n,[]),wt(t),n=St(t);return e}(i,r,a,t,n):null}function mT(){}function vT(){this.g=new hT}function yT(e){var t="WEBVTT\n\n";if(""==e)return t;for(var n=(e=l((e=(e=e.replace(/\r+/g,"")).trim()).split("\n\n"))).next();!n.done;n=e.next())(n=n.value.split(/\n/))[0].match(/\d+/)&&n.shift(),n[0]=n[0].replace(/,/g,"."),t+=n.join("\n").replace(/{b}/g,"<b>").replace(/{\/b}/g,"</b>").replace(/{i}/g,"<i>").replace(/{\/i}/g,"</i>").replace(/{u}/g,"<u>").replace(/{\/u}/g,"</u>")+"\n\n";return t}function bT(){}function wT(e,t){var n=t.Fontname;if(n&&(e.fontFamily=n),(n=t.Fontsize)&&(e.fontSize=n+"px"),(n=t.PrimaryColour)&&(n=TT(n))&&(e.color=n),(n=t.BackColour)&&(n=TT(n))&&(e.backgroundColor=n),t.Bold&&(e.fontWeight=Mn),t.Italic&&(e.fontStyle=Dn),t.Underline&&e.textDecoration.push(Pn),(n=t.Spacing)&&(e.letterSpacing=n+"px"),n=t.Alignment)switch(parseInt(n,10)){case 1:e.displayAlign=yn,e.textAlign="start";break;case 2:e.displayAlign=yn,e.textAlign=mn;break;case 3:e.displayAlign=yn,e.textAlign="end";break;case 5:e.displayAlign="before",e.textAlign="start";break;case 6:e.displayAlign="before",e.textAlign=mn;break;case 7:e.displayAlign="before",e.textAlign="end";break;case 9:e.displayAlign="center",e.textAlign="start";break;case 10:e.displayAlign="center",e.textAlign=mn;break;case 11:e.displayAlign="center",e.textAlign="end"}(t=t.AlphaLevel)&&(e.opacity=parseFloat(t))}function TT(e){return 0<=(e=parseInt(e.replace("&H",""),16))?"rgba("+(255&e)+","+(e>>8&255)+","+(e>>16&255)+","+(e>>24&255^255)/255+")":null}function ST(e){return 3600*((e=kT.exec(e))[1]?parseInt(e[1].replace(":",""),10):0)+60*parseInt(e[2],10)+parseFloat(e[3])}Fi["application/ttml+xml"]=function(){return new jw},dT.prototype.parseInit=function(e){var t=!1;if((new Ta).box("moov",Sa).box("trak",Sa).box("mdia",Sa).box("minf",Sa).box("stbl",Sa).R("stsd",xa).box("stpp",(function(e){t=!0,e.parser.stop()})).parse(e),!t)throw new De(2,2,2007)},dT.prototype.setSequenceMode=function(){},dT.prototype.setManifestType=function(){},dT.prototype.parseMedia=function(e,t,n){var i=this,r=!1,a=[],o=[];if((new Ta).box("moof",Sa).box("traf",Sa).R("subs",(function(e){o=[];for(var t=e.reader,n=t.P(),i=0;i<n;i++){t.P();for(var r=t.ma(),a=0;a<r;a++)1==e.version?o.push(t.P()):o.push(t.ma()),t.T(),t.T(),t.P()}})).box("mdat",ka((function(e){if(r=!0,o.length){for(var s=ge(e,0,o[0]),u=[],l=o[0],c=1;c<o.length;c++){var d=ge(e,l,o[c]);d=oi(d),u.push("data:image/png;base64,"+d),l+=o[c]}a=a.concat(i.g.parseMedia(s,t,n,u))}else a=a.concat(i.g.parseMedia(e,t,n,[]))}))).parse(e,!1),!r)throw new De(2,2,2007);return a},F("shaka.text.Mp4TtmlParser",dT),dT.prototype.parseMedia=dT.prototype.parseMedia,dT.prototype.setManifestType=dT.prototype.setManifestType,dT.prototype.setSequenceMode=dT.prototype.setSequenceMode,dT.prototype.parseInit=dT.prototype.parseInit,Fi['application/mp4; codecs="stpp"']=function(){return new dT},Fi['application/mp4; codecs="stpp.ttml"']=function(){return new dT},Fi['application/mp4; codecs="stpp.ttml.im1i"']=function(){return new dT},Fi['application/mp4; codecs="stpp.ttml.im1t"']=function(){return new dT},Fi['application/mp4; codecs="stpp.ttml.im2i"']=function(){return new dT},Fi['application/mp4; codecs="stpp.ttml.im2t"']=function(){return new dT},Fi['application/mp4; codecs="stpp.ttml.etd1"']=function(){return new dT},Fi['application/mp4; codecs="stpp.ttml.etd1|im1t"']=function(){return new dT},Fi['application/mp4; codecs="stpp.ttml.im1t|etd1"']=function(){return new dT},Fi['application/mp4; codecs="stpp.TTML.im1t"']=function(){return new dT},hT.prototype.parseInit=function(){},hT.prototype.setSequenceMode=function(){},hT.prototype.setManifestType=function(e){this.g=e},hT.prototype.parseMedia=function(e,t){var n=(e=(e=dt(e)).replace(/\r\n|\r(?=[^\n]|$)/gm,"\n")).split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(n[0]))throw new De(2,2,2e3);if(e=t.vttOffset,"HLS"==this.g)if(n[0].includes("X-TIMESTAMP-MAP")){var i=n[0];if(e=i.match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),i=i.match(/MPEGTS:(\d+)/m),!e||!i)throw new De(2,2,2e3);if(null==(e=At(e[1])))throw new De(2,2,2e3);i=Number(i[1]);for(var r=t.segmentStart-t.periodStart;95443.7176888889<=r;)r-=95443.7176888889,i+=8589934592;e=t.periodStart+i/9e4-e}else t.periodStart&&t.vttOffset==t.periodStart&&(e=0);for(t=[],r=(i=l(n[0].split("\n"))).next();!r.done;r=i.next())if(r=r.value,/^Region:/.test(r)){r=new bt(r);var a=new xe;St(r),wt(r);for(var o=St(r);o;){var s=a,u=o;(o=/^id=(.*)$/.exec(u))?s.id=o[1]:(o=/^width=(\d{1,2}|100)%$/.exec(u))?s.width=Number(o[1]):(o=/^lines=(\d+)$/.exec(u))?(s.height=Number(o[1]),s.heightUnits=2):(o=/^regionanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(u))?(s.regionAnchorX=Number(o[1]),s.regionAnchorY=Number(o[2])):(o=/^viewportanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(u))?(s.viewportAnchorX=Number(o[1]),s.viewportAnchorY=Number(o[2])):/^scroll=up$/.exec(u)&&(s.scroll="up"),wt(r),o=St(r)}t.push(a)}for(hn(i=new Map),r=[],a=(n=l(n.slice(1))).next();!a.done;a=n.next()){if((1!=(a=a.value.split("\n")).length||a[0])&&!/^NOTE($|[ \t])/.test(a[0])&&"STYLE"==a[0]){for(s=[],o=-1,u=1;u<a.length;u++)a[u].includes("::cue")&&(s.push([]),o=s.length-1),-1!=o&&(s[o].push(a[u]),a[u].includes("}")&&(o=-1));for(o=(s=l(s)).next();!o.done;o=s.next()){var c=o.value;o="global",(u=c[0].match(/\((.*)\)/))&&(o=u.pop()),u=c.slice(1,-1),c[0].includes("}")&&(c=/\{(.*?)\}/.exec(c[0]))&&(u=c[1].split(";")),(c=i.get(o))||(c=new un(0,0,""));for(var d=!1,h=0;h<u.length;h++){var f=/^\s*([^:]+):\s*(.*)/.exec(u[h]);if(f){var p=f[2].trim().replace(";","");switch(f[1].trim()){case"background-color":case"background":d=!0,c.backgroundColor=p;break;case"color":d=!0,c.color=p;break;case"font-family":d=!0,c.fontFamily=p;break;case"font-size":d=!0,c.fontSize=p;break;case"font-weight":(700<=parseInt(p,10)||"bold"==p)&&(d=!0,c.fontWeight=Mn);break;case"font-style":switch(p){case"normal":d=!0,c.fontStyle=Cn;break;case"italic":d=!0,c.fontStyle=Dn;break;case"oblique":d=!0,c.fontStyle="oblique"}break;case"opacity":d=!0,c.opacity=parseFloat(p);break;case"text-combine-upright":d=!0,c.textCombineUpright=p;break;case"text-shadow":d=!0,c.textShadow=p;break;case"white-space":d=!0,c.wrapLine="noWrap"!=p}}}d&&i.set(o,c)}}if(d=e,1==(c=a).length&&!c[0]||/^NOTE($|[ \t])/.test(c[0])||"STYLE"==c[0]||"REGION"==c[0])a=null;else if(a=null,c[0].includes("--\x3e")||(a=c[0],c.splice(0,1)),o=xt(s=new bt(c[0])),h=Tt(s,/[ \t]+--\x3e[ \t]+/g),u=xt(s),null==o||null==h||null==u)W("Failed to parse VTT time code. Cue skipped:",a,c),a=null;else{for(o+=d,u+=d,d=c.slice(1).join("\n").trim(),i.has("global")?((c=i.get("global").clone()).startTime=o,c.endTime=u,c.payload=d):c=new un(o,u,d),wt(s),o=St(s);o;)fT(c,o,t),wt(s),o=St(s);dn(c,i),null!=a&&(c.id=a),a=c}a&&r.push(a)}return r},F("shaka.text.VttTextParser",hT),hT.prototype.parseMedia=hT.prototype.parseMedia,hT.prototype.setManifestType=hT.prototype.setManifestType,hT.prototype.setSequenceMode=hT.prototype.setSequenceMode,hT.prototype.parseInit=hT.prototype.parseInit,Fi["text/vtt"]=function(){return new hT},Fi['text/vtt; codecs="vtt"']=function(){return new hT},Fi['text/vtt; codecs="wvtt"']=function(){return new hT},pT.prototype.parseInit=function(e){var t=this,n=!1;if((new Ta).box("moov",Sa).box("trak",Sa).box("mdia",Sa).R("mdhd",(function(e){e=_o(e.reader,e.version),t.g=e.timescale})).box("minf",Sa).box("stbl",Sa).R("stsd",xa).box("wvtt",(function(){n=!0})).parse(e),!this.g)throw new De(2,2,2008);if(!n)throw new De(2,2,2008)},pT.prototype.setSequenceMode=function(){},pT.prototype.setManifestType=function(){},pT.prototype.parseMedia=function(e,t){if(!e.length)return[];if(!this.g)throw new De(2,2,2008);var n,i=0,r=[],a=[],o=!1,s=!1,u=!1,c=null;if((new Ta).box("moof",Sa).box("traf",Sa).R("tfdt",(function(e){o=!0,i=Uo(e.reader,e.version).baseMediaDecodeTime})).R("tfhd",(function(e){c=Oo(e.reader,e.flags).ed})).R("trun",(function(e){s=!0,r=Bo(e.reader,e.version,e.flags).Zg})).box("mdat",ka((function(e){u=!0,n=e}))).parse(e,!1),!u&&!o&&!s)throw new De(2,2,2008);e=i;for(var d=new ya(n,0),h=l(r),f=h.next();!f.done;f=h.next()){var p=(f=f.value).Of||c,g=f.me?i+f.me:e;e=g+(p||0);var m=0;do{var v=d.P();m+=v;var y=null;"vttc"==Ma(d.P())?8<v&&(y=d.vb(v-8)):d.skip(v-8),p&&y&&(v=gT(y,t.periodStart+g/this.g,t.periodStart+e/this.g),a.push(v))}while(f.sampleSize&&m<f.sampleSize)}return a.filter(Gi)},F("shaka.text.Mp4VttParser",pT),pT.prototype.parseMedia=pT.prototype.parseMedia,pT.prototype.setManifestType=pT.prototype.setManifestType,pT.prototype.setSequenceMode=pT.prototype.setSequenceMode,pT.prototype.parseInit=pT.prototype.parseInit,Fi['application/mp4; codecs="wvtt"']=function(){return new pT},mT.prototype.parseInit=function(){},mT.prototype.setSequenceMode=function(){},mT.prototype.setManifestType=function(){},mT.prototype.parseMedia=function(e){var t=dt(e).replace(/\r+/g,"");if(e=[],""==(t=t.trim()))return e;for(var n=(t=l(t.split("\n\n"))).next();!n.done;n=t.next()){var i=new bt((n=n.value.split("\n"))[0]),r=xt(i),a=Tt(i,/,/g);if(i=xt(i),null==r||null==a||null==i)throw new De(2,2,2001,"Could not parse cue time range in SubViewer");e.push(new un(r,i,n.slice(1).join("\n").trim()))}return e},F("shaka.text.SbvTextParser",mT),mT.prototype.parseMedia=mT.prototype.parseMedia,mT.prototype.setManifestType=mT.prototype.setManifestType,mT.prototype.setSequenceMode=mT.prototype.setSequenceMode,mT.prototype.parseInit=mT.prototype.parseInit,Fi["text/x-subviewer"]=function(){return new mT},vT.prototype.parseInit=function(){},vT.prototype.setSequenceMode=function(){},vT.prototype.setManifestType=function(){},vT.prototype.parseMedia=function(e,t,n){return e=ge(pt(e=yT(e=dt(e)))),this.g.parseMedia(e,t,n,[])},F("shaka.text.SrtTextParser",vT),vT.srt2webvtt=yT,vT.prototype.parseMedia=vT.prototype.parseMedia,vT.prototype.setManifestType=vT.prototype.setManifestType,vT.prototype.setSequenceMode=vT.prototype.setSequenceMode,vT.prototype.parseInit=vT.prototype.parseInit,Fi["text/srt"]=function(){return new vT},bT.prototype.parseInit=function(){},bT.prototype.setSequenceMode=function(){},bT.prototype.setManifestType=function(){},bT.prototype.parseMedia=function(e){var t="",n="",i=null,r=null;for(r=(e=l(r=dt(e).split(/\r?\n\s*\r?\n/))).next();!r.done;r=e.next()){var a=r.value;r=a,(a=xT.exec(a))&&(i=a[1],r=a[2]),"V4 Styles"==i||"V4+ Styles"==i?(t=r,t=n?t+"\n"+r:r):"Events"==i&&(n=n?n+"\n"+r:r)}for(i=[],r=null,e=(t=l(t.split(/\r?\n/))).next();!e.done;e=t.next())if(e=e.value,!/^\s*;/.test(e)&&(a=AT.exec(e)))if(e=a[1].trim(),a=a[2].trim(),"Format"==e)r=a.split(ET);else if("Style"==e){e=a.split(ET),a={};for(var o=0;o<r.length&&o<e.length;o++)a[r[o]]=e[o];i.push(a)}for(r=[],t=null,a=(n=l(n.split(/\r?\n/))).next(),e={};!a.done;e={lh:void 0},a=n.next())if(a=a.value,!/^\s*;/.test(a)&&(o=AT.exec(a)))if(a=o[1].trim(),o=o[2].trim(),"Format"==a)t=o.split(ET);else if("Dialogue"==a){o=o.split(ET),a={};for(var s=0;s<t.length&&s<o.length;s++)a[t[s]]=o[s];o=new un(s=ST(a.Start),ST(a.End),o.slice(t.length-1).join(",").replace(/\\N/g,"\n").replace(/\{[^}]+\}/g,"")),e.lh=a.Style,(e=i.find(function(e){return function(t){return t.Name==e.lh}}(e)))&&wT(o,e),r.push(o)}return r},F("shaka.text.SsaTextParser",bT),bT.prototype.parseMedia=bT.prototype.parseMedia,bT.prototype.setManifestType=bT.prototype.setManifestType,bT.prototype.setSequenceMode=bT.prototype.setSequenceMode,bT.prototype.parseInit=bT.prototype.parseInit;var xT=/^\s*\[([^\]]+)\]\r?\n([\s\S]*)/,AT=/^\s*([^:]+):\s*(.*)/,ET=/\s*,\s*/,kT=/^(\d+:)?(\d{1,2}):(\d{1,2}(?:[.]\d{1,3})?)?$/;function IT(e,t){var n=1&e[t+1]?7:9;return t+n<=e.length&&0<(e=((3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5)-n)?{Sd:n,ea:e}:null}function MT(e,t){var n=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],i=(60&e[t+2])>>>2;if(i>n.length-1)return null;var r=1+((192&e[t+2])>>>6),a=(1&e[t+2])<<2;return a|=(192&e[t+3])>>>6,{sampleRate:n[i],channelCount:a,codec:"mp4a.40."+r}}function CT(e,t){if(t+1<e.length&&255===e[t]&&240==(246&e[t+1])){var n=1&e[t+1]?7:9;if(t+n>=e.length)return!1;var i=(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5;return!(i<=n)&&((t+=i)===e.length||t+1<e.length&&255===e[t]&&240==(246&e[t+1]))}return!1}function DT(e){this.i=e,this.h=0,this.g=new Map}function RT(e,t){if(t+8>e.length||11!==e[t]||119!==e[t+1])return null;var n=e[t+4]>>6;if(3<=n)return null;var i=63&e[t+4],r=2*[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][3*i+n];if(t+r>e.length)return null;var a=e[t+6]>>5,o=0;2===a?o+=2:(1&a&&1!==a&&(o+=2),4&a&&(o+=2)),o=(e[t+6]<<8|e[t+7])>>12-o&1;var s=7&e[t+5];return e=new Uint8Array([n<<6|e[t+5]>>3<<1|s>>2,(3&s)<<6|a<<3|o<<2|i>>4,i<<4&224]),{sampleRate:[48e3,44100,32e3][n],channelCount:[2,1,2,3,3,4,4,5][a]+o,qa:e,ea:r}}function PT(e,t){if(11===e[t]&&119===e[t+1]){var n,i,r=0,a=5;for(t+=a;0<a;){i=e[t];var o=Math.min(a,8),s=8-o;n=(i&(n=4278190080>>>24+s<<s))>>s,r=r?r<<o|n:n,t+=1,a-=o}if(16>r)return!0}return!1}function LT(e){this.i=e,this.h=0,this.g=new Map}function NT(e,t){if(t+8>e.length||2935!=(e[t]<<8|e[t+1]))return null;var n=new Ko(e.subarray(t+2));qo(n,2),qo(n,3);var i=zo(n,11)+1<<1,r=zo(n,2);if(3==r){r=[24e3,22060,16e3][r=zo(n,2)];var a=3}else r=[48e3,44100,32e3][r],a=zo(n,2);var o=zo(n,3),s=zo(n,1);return n=zo(n,5),t+i>e.byteLength?null:(e=Math.floor(i*r/(16*[1,2,3,6][a])),e=new Uint8Array([(8160&e)>>5,(31&e)<<3,r<<6|n<<1,o<<1|s,0]),{sampleRate:r,channelCount:[2,1,2,3,3,4,4,5][o]+s,qa:e,ea:i})}function jT(e){this.i=e,this.h=0,this.g=new Map}function OT(e){for(var t=!1,n=[],i=e.find((function(e){return 7==e.type})),r=!1,a=(e=l(e)).next();!a.done;a=e.next()){var o=!1;switch((a=a.value).type){case 1:o=r=!0;var s=a.data;i&&4<s.length&&(2===(s=ts(new Ko(s)))||4===s||7===s||9===s)&&(t=!0);break;case 5:t=o=r=!0;break;case 6:case 7:case 8:case 12:o=!0;break;case 9:r=o=!0;break;default:o=!1}r&&o&&(o=a.fullData.byteLength,(s=new Uint8Array(4))[0]=o>>24&255,s[1]=o>>16&255,s[2]=o>>8&255,s[3]=255&o,n.push(s),n.push(a.fullData))}return n.length?{data:di.apply(ai,c(n)),nd:t}:null}Fi["text/x-ssa"]=function(){return new bT},(i=DT.prototype).destroy=function(){this.g.clear()},i.isSupported=function(e){return"audio/aac"==e.toLowerCase().split(";")[0]&&ne(this.convertCodecs("audio",e))},i.convertCodecs=function(e,t){return"audio/aac"==t.toLowerCase().split(";")[0]?'audio/mp4; codecs="'+(Ri(t)||"mp4a.40.2")+'"':t},i.getOriginalMimeType=function(){return this.i},i.transmux=function(e,t,n,i){for(var r=ge(e),a=jo(r),o=a.length;o<r.length&&!CT(r,o);o++);if(e=1e3*n.endTime,(a=No(a)).length&&n&&(a=a.find((function(e){return"com.apple.streaming.transportStreamTimestamp"===e.description})))&&(e=a.data),!(a=MT(r,o)))return Promise.reject(new De(2,3,3018,n?n.N()[0]:null));t.audioSamplingRate=a.sampleRate,t.channelsCount=a.channelCount;for(var s=[];o<r.length;){var u=IT(r,o);if(!u)return Promise.reject(new De(2,3,3018,n?n.N()[0]:null));var l=u.Sd+u.ea;o+l<=r.length&&s.push({data:r.subarray(o+u.Sd,o+l),size:u.ea,duration:1024,hb:0,flags:{kb:0,$a:0,Za:0,Xa:0,Ya:2,lb:0}}),o+=l}return r=a.sampleRate,e=Math.floor(e*r/1e3),i=new Zm([i={id:t.id,type:"audio",codecs:a.codec,encrypted:t.encrypted&&0<t.drmInfos.length,timescale:r,duration:i,fb:[],qa:new Uint8Array([]),za:new Uint8Array([]),Da:0,Fa:0,data:{wb:this.h,baseMediaDecodeTime:e,ab:s},stream:t}]),n=t.id+"_"+n.i,this.g.has(n)?t=this.g.get(n):(t=ev(i),this.g.set(n,t)),n=av(i),this.h++,t=di(t,n),Promise.resolve(t)},F("shaka.transmuxer.AacTransmuxer",DT),DT.prototype.transmux=DT.prototype.transmux,DT.prototype.getOriginalMimeType=DT.prototype.getOriginalMimeType,DT.prototype.convertCodecs=DT.prototype.convertCodecs,DT.prototype.isSupported=DT.prototype.isSupported,DT.prototype.destroy=DT.prototype.destroy,jn("audio/aac",(function(){return new DT("audio/aac")}),_n),(i=LT.prototype).destroy=function(){this.g.clear()},i.isSupported=function(e){return"audio/ac3"==e.toLowerCase().split(";")[0]&&ne(this.convertCodecs("audio",e))},i.convertCodecs=function(e,t){return"audio/ac3"==t.toLowerCase().split(";")[0]?'audio/mp4; codecs="ac-3"':t},i.getOriginalMimeType=function(){return this.i},i.transmux=function(e,t,n,i){for(var r=jo(e=ge(e)),a=r.length;a<e.length&&!PT(e,a);a++);var o=1e3*n.endTime;(r=No(r)).length&&n&&(r=r.find((function(e){return"com.apple.streaming.transportStreamTimestamp"===e.description})))&&(o=r.data),r=0;for(var s=new Uint8Array([]),u=[];a<e.length;){var l=RT(e,a);if(!l)return Promise.reject(new De(2,3,3018,n?n.N()[0]:null));t.audioSamplingRate=l.sampleRate,t.channelsCount=l.channelCount,r=l.sampleRate,s=l.qa,u.push({data:e.subarray(a,a+l.ea),size:l.ea,duration:1536,hb:0,flags:{kb:0,$a:0,Za:0,Xa:0,Ya:2,lb:0}}),a+=l.ea}return e=Math.floor(o*r/1e3),i=new Zm([i={id:t.id,type:"audio",codecs:"ac-3",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:r,duration:i,fb:[],qa:s,za:new Uint8Array([]),Da:0,Fa:0,data:{wb:this.h,baseMediaDecodeTime:e,ab:u},stream:t}]),n=t.id+"_"+n.i,this.g.has(n)?t=this.g.get(n):(t=ev(i),this.g.set(n,t)),n=av(i),this.h++,t=di(t,n),Promise.resolve(t)},F("shaka.transmuxer.Ac3Transmuxer",LT),LT.prototype.transmux=LT.prototype.transmux,LT.prototype.getOriginalMimeType=LT.prototype.getOriginalMimeType,LT.prototype.convertCodecs=LT.prototype.convertCodecs,LT.prototype.isSupported=LT.prototype.isSupported,LT.prototype.destroy=LT.prototype.destroy,jn("audio/ac3",(function(){return new LT("audio/ac3")}),_n),(i=jT.prototype).destroy=function(){this.g.clear()},i.isSupported=function(e){return"audio/ec3"==e.toLowerCase().split(";")[0]&&ne(this.convertCodecs("audio",e))},i.convertCodecs=function(e,t){return"audio/ec3"==t.toLowerCase().split(";")[0]?'audio/mp4; codecs="ec-3"':t},i.getOriginalMimeType=function(){return this.i},i.transmux=function(e,t,n,i){for(var r=jo(e=ge(e)),a=r.length;a<e.length&&2935!=(e[a]<<8|e[a+1]);a++);var o=1e3*n.endTime;(r=No(r)).length&&n&&(r=r.find((function(e){return"com.apple.streaming.transportStreamTimestamp"===e.description})))&&(o=r.data),r=0;for(var s=new Uint8Array([]),u=[];a<e.length;){var l=NT(e,a);if(!l)return Promise.reject(new De(2,3,3018,n?n.N()[0]:null));t.audioSamplingRate=l.sampleRate,t.channelsCount=l.channelCount,r=l.sampleRate,s=l.qa,u.push({data:e.subarray(a,a+l.ea),size:l.ea,duration:1536,hb:0,flags:{kb:0,$a:0,Za:0,Xa:0,Ya:2,lb:0}}),a+=l.ea}return e=Math.floor(o*r/1e3),i=new Zm([i={id:t.id,type:"audio",codecs:"ec-3",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:r,duration:i,fb:[],qa:s,za:new Uint8Array([]),Da:0,Fa:0,data:{wb:this.h,baseMediaDecodeTime:e,ab:u},stream:t}]),n=t.id+"_"+n.i,this.g.has(n)?t=this.g.get(n):(t=ev(i),this.g.set(n,t)),n=av(i),this.h++,t=di(t,n),Promise.resolve(t)},F("shaka.transmuxer.Ec3Transmuxer",jT),jT.prototype.transmux=jT.prototype.transmux,jT.prototype.getOriginalMimeType=jT.prototype.getOriginalMimeType,jT.prototype.convertCodecs=jT.prototype.convertCodecs,jT.prototype.isSupported=jT.prototype.isSupported,jT.prototype.destroy=jT.prototype.destroy,jn("audio/ec3",(function(){return new jT("audio/ec3")}),_n);var UT=[100,110,122,244,44,83,86,118,128,138,139,134];function _T(e,t){var n=e[t+1]>>3&3,i=e[t+1]>>1&3,r=e[t+2]>>4&15,a=e[t+2]>>2&3;if(1!==n&&0!==r&&15!==r&&3!==a){var o=e[t+3]>>6;r=1e3*VT[14*(3===n?3-i:3===i?3:4)+r-1],a=HT[3*(3===n?0:2===n?1:2)+a],n=GT[n][i];var s=KT[i],u=Math.floor(n*r/a+(e[t+2]>>1&1))*s,l=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);return(l=l?parseInt(l[1],10):0)&&87>=l&&2===i&&224e3<=r&&0===o&&(e[t+3]|=128),{sampleRate:a,channelCount:3===o?1:2,ea:u,Ti:8*n*s}}return null}function BT(e,t){return!(255!==e[t]||224&~e[t+1]||!(6&e[t+1]))}function FT(e,t){if(t+1<e.length&&BT(e,t)){var n=_T(e,t),i=4;return n&&n.ea&&(i=n.ea),(t+=i)===e.length||t+1<e.length&&BT(e,t)}return!1}var VT=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],HT=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],GT=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],KT=[0,1,1,4];function XT(e){this.i=e,this.h=0,this.g=new Map}function qT(e){this.h=e,this.g=null}function zT(e){this.h=e,(this.g=Cg.get("ISOBoxer")())&&function(e){function t(){this._procFullBox(),1&this.flags&&(this._procField("AlgorithmID","uint",24),this._procField("IV_size","uint",8),this._procFieldArray("KID",16,"uint",8)),this._procField("sample_count","uint",32),this._procEntries("entry",this.sample_count,(function(e){this._procEntryField(e,"InitializationVector","data",8),2&this.flags&&(this._procEntryField(e,"NumberOfEntries","uint",16),this._procSubEntries(e,"clearAndCryptedData",e.NumberOfEntries,(function(e){this._procEntryField(e,"BytesOfClearData","uint",16),this._procEntryField(e,"BytesOfEncryptedData","uint",32)})))}))}e.g.addBoxProcessor("saio",(function(){this._procFullBox(),1&this.flags&&(this._procField("aux_info_type","uint",32),this._procField("aux_info_type_parameter","uint",32)),this._procField("entry_count","uint",32),this._procFieldArray("offset",this.entry_count,"uint",1===this.version?64:32)})),e.g.addBoxProcessor("saiz",(function(){this._procFullBox(),1&this.flags&&(this._procField("aux_info_type","uint",32),this._procField("aux_info_type_parameter","uint",32)),this._procField("default_sample_info_size","uint",8),this._procField("sample_count","uint",32),0===this.default_sample_info_size&&this._procFieldArray("sample_info_size",this.sample_count,"uint",8)})),e.g.addBoxProcessor("senc",t),e.g.addBoxProcessor("uuid",(function(){for(var e=!0,n=0;16>n;n++)this.usertype[n]!==YT[n]&&(e=!1);e&&(this._parsing&&(this.type="sepiff"),t.call(this))}))}(this)}function WT(e,t){for(var n=8,i=0;i<e.boxes.length&&e.boxes[i].type!==t;i++)n+=e.boxes[i].size;return n}(i=XT.prototype).destroy=function(){this.g.clear()},i.isSupported=function(e){return"audio/mpeg"==e.toLowerCase().split(";")[0]&&ne(this.convertCodecs("audio",e))},i.convertCodecs=function(e,t){return"audio/mpeg"==t.toLowerCase().split(";")[0]?'audio/mp4; codecs="mp3"':t},i.getOriginalMimeType=function(){return this.i},i.transmux=function(e,t,n,i){for(var r=ge(e),a=jo(r).length;a<r.length&&!FT(r,a);a++);var o;for(e=[];a<r.length;){var s=_T(r,a);if(!s)return Promise.reject(new De(2,3,3018,n?n.N()[0]:null));o||(o=s),a+s.ea<=r.length&&e.push({data:r.subarray(a,a+s.ea),size:s.ea,duration:1152,hb:0,flags:{kb:0,$a:0,Za:0,Xa:0,Ya:2,lb:0}}),a+=s.ea}return o?(r=9e4*o.Ti/o.sampleRate*this.h,i=new Zm([i={id:t.id,type:"audio",codecs:"mp3",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:o.sampleRate,duration:i,fb:[],qa:new Uint8Array([]),za:new Uint8Array([]),Da:0,Fa:0,data:{wb:this.h,baseMediaDecodeTime:r,ab:e},stream:t}]),n=t.id+"_"+n.i,this.g.has(n)?t=this.g.get(n):(t=ev(i),this.g.set(n,t)),n=av(i),this.h++,t=di(t,n),Promise.resolve(t)):Promise.reject(new De(2,3,3018,n?n.N()[0]:null))},F("shaka.transmuxer.Mp3Transmuxer",XT),XT.prototype.transmux=XT.prototype.transmux,XT.prototype.getOriginalMimeType=XT.prototype.getOriginalMimeType,XT.prototype.convertCodecs=XT.prototype.convertCodecs,XT.prototype.isSupported=XT.prototype.isSupported,XT.prototype.destroy=XT.prototype.destroy,jn("audio/mpeg",(function(){return new XT("audio/mpeg")}),_n),(i=qT.prototype).destroy=function(){},i.isSupported=function(e){if("video/mp2t"!=e.toLowerCase().split(";")[0])return!1;var t=Ri(e).split(","),n=mi("audio",t);return t=mi("video",t),!(!n||t||"mp3"!=Mi(n))&&ne(this.convertCodecs("audio",e))},i.convertCodecs=function(e,t){return"video/mp2t"==t.toLowerCase().split(";")[0]?"audio/mpeg":t},i.getOriginalMimeType=function(){return this.h},i.transmux=function(e,t,n,i,r){if(this.g?this.g.clearData():this.g=new ns,e=ge(e),"mp3"!=(e=this.g.parse(e)).fd().audio||"audio"!=r)return Promise.reject(new De(2,3,3018,n?n.N()[0]:null));for(n=new Uint8Array([]),r=l(e.Wb()),e=r.next();!e.done;e=r.next())if(e=e.value.data)for(t=0;t<e.length;)(i=_T(e,t))?(t+i.ea<=e.length&&(n=di(n,e.subarray(t,t+i.ea))),t+=i.ea):t++;return Promise.resolve(n)},F("shaka.transmuxer.MpegTsTransmuxer",qT),qT.prototype.transmux=qT.prototype.transmux,qT.prototype.getOriginalMimeType=qT.prototype.getOriginalMimeType,qT.prototype.convertCodecs=qT.prototype.convertCodecs,qT.prototype.isSupported=qT.prototype.isSupported,qT.prototype.destroy=qT.prototype.destroy,jn("video/mp2t",(function(){return new qT("video/mp2t")}),Bn),(i=zT.prototype).destroy=function(){},i.isSupported=function(e,t){var n=e.startsWith("mss/");return!(!this.g||!n)&&(t?ne(this.convertCodecs(t,e)):(t=this.convertCodecs("audio",e),e=this.convertCodecs("video",e),ne(t)||ne(e)))},i.convertCodecs=function(e,t){return t.replace("mss/","")},i.getOriginalMimeType=function(){return this.h},i.transmux=function(e,t,n){if(!n)return Promise.resolve(ge(e));if(!t.mssPrivateData)return Promise.reject(new De(2,3,3020,n?n.N()[0]:null));try{var i,r=this.g.parseBuffer(e),a=r.fetch("tfhd");a.track_ID=t.id+1;var o=r.fetch("tfdt"),s=r.fetch("traf");null===o&&((o=this.g.createFullBox("tfdt",s,a)).version=1,o.flags=0,o.baseMediaDecodeTime=Math.floor(n.startTime*t.mssPrivateData.timescale));var u=r.fetch("trun"),l=r.fetch("tfxd");l&&l._parent.boxes.splice(l._parent.boxes.indexOf(l),1);var c=r.fetch("tfrf");c&&c._parent.boxes.splice(c._parent.boxes.indexOf(c),1);var d=r.fetch("sepiff");if(null!==d){d.type="senc",d.usertype=void 0;var h=r.fetch("saio");if(null===h){(h=this.g.createFullBox("saio",s)).version=0,h.flags=0,h.entry_count=1,h.offset=[0];var f=this.g.createFullBox("saiz",s);if(f.version=0,f.flags=0,f.sample_count=d.sample_count,f.default_sample_info_size=0,f.sample_info_size=[],2&d.flags)for(i=0;i<d.sample_count;i+=1)f.sample_info_size[i]=10+6*d.entry[i].NumberOfEntries;else f.default_sample_info_size=8}}a.flags&=16777214,a.flags|=131072,u.flags|=1;var p=r.fetch("moof");u.data_offset=p.getLength()+8;var g=r.fetch("saio");null!==g&&(g.offset[0]=WT(p,"traf")+WT(s,"senc")+16);var m=ge(r.write());return Promise.resolve(m)}catch(e){return e instanceof De?Promise.reject(e):Promise.reject(new De(2,3,3022,n?n.N()[0]:null))}},F("shaka.transmuxer.MssTransmuxer",zT),zT.prototype.transmux=zT.prototype.transmux,zT.prototype.getOriginalMimeType=zT.prototype.getOriginalMimeType,zT.prototype.convertCodecs=zT.prototype.convertCodecs,zT.prototype.isSupported=zT.prototype.isSupported,zT.prototype.destroy=zT.prototype.destroy;var YT=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);function JT(e){this.l=e,this.g=0,this.i=new Map,this.h=this.j=null}jn("mss/audio/mp4",(function(){return new zT("mss/audio/mp4")}),_n),jn("mss/video/mp4",(function(){return new zT("mss/video/mp4")}),_n),(i=JT.prototype).destroy=function(){this.i.clear(),this.h&&this.h.destroy()},i.isSupported=function(e,t){if("video/mp2t"!=e.toLowerCase().split(";")[0])return!1;var n=e;t&&(n=this.convertCodecs(t,e));var i=Ri(n).split(",");return n=mi("audio",i),i=mi("video",i),!(n&&(n=Mi(n),!ZT.includes(n))||i&&(n=Mi(i),!eS.includes(n)))&&(t?ne(this.convertCodecs(t,e)):(t=this.convertCodecs("audio",e),e=this.convertCodecs("video",e),ne(t)||ne(e)))},i.convertCodecs=function(e,t){return"video/mp2t"==t.toLowerCase().split(";")[0]?(t=Ri(t).replace("mp4a.40.34","mp3").split(",").map((function(e){return lr(e,"audio/mp4")})).map(cr).join(","),"audio"==e?'audio/mp4; codecs="'+t+'"':'video/mp4; codecs="'+t+'"'):t},i.getOriginalMimeType=function(){return this.l},i.transmux=function(e,t,n,i,r){var a=ge(e);if("audio"==r&&!os(a)){for(var o=jo(a),s=o.length;s<a.length;s++)if(FT(a,s))return Promise.reject(new De(2,3,3018,n?n.N()[0]:null));for(s=o.length;s<a.length;s++)if(CT(a,s))return this.h||(this.h=new DT("audio/aac")),this.h.transmux(e,t,n,i,r);return Promise.reject(new De(2,3,3018,n?n.N()[0]:null))}this.j?this.j.clearData():this.j=new ns;var u=this.j.parse(a),d=[],h=u.fd();try{var f=null;if("video"==r){switch(h.video){case"avc":var p=[],g=null,m=[],v=u.sc();if(!v.length)throw new De(2,3,3023,n?n.N()[0]:null);for(var y=0;y<v.length;y++){var b=v[y],w=b.nalus;m.push.apply(m,c(w));var T,S=OT(w);if(S)null==g&&(g=b.dts),T=y+1<v.length?(v[y+1].dts||0)-(b.dts||0):1<v.length?(b.dts||0)-(v[y-1].dts||0):9e4*(n.endTime-n.startTime),p.push({data:S.data,size:S.data.byteLength,duration:T,hb:Math.round((b.pts||0)-(b.dts||0)),flags:{kb:0,$a:0,Za:0,Xa:0,Ya:S.nd?2:1,lb:S.nd?0:1}})}var x=function(e){if(!e.length)return null;var t=e.find((function(e){return 7==e.type}));if(e=e.find((function(e){return 8==e.type})),!t||!e)return null;var n=new Ko(t.data),i=Zo(n);if(Zo(n),Zo(n),Yo(n),UT.includes(i)&&(3===(i=Jo(n))&&qo(n,1),Yo(n),Yo(n),qo(n,1),Qo(n))){i=3!==i?8:12;for(var r=0;r<i;r++)Qo(n)&&es(n,6>r?16:64)}if(Yo(n),0===(i=Jo(n)))Jo(n);else if(1===i)for(qo(n,1),Yo(n),Yo(n),i=Jo(n),r=0;r<i;r++)Yo(n);Yo(n),qo(n,1);var a=Jo(n),o=Jo(n),s=zo(n,1);0===s&&qo(n,1),qo(n,1);var u=0,l=0,d=0,h=0;if(Qo(n)&&(u=Jo(n),l=Jo(n),d=Jo(n),h=Jo(n)),r=i=1,Qo(n)&&Qo(n)){var f=Zo(n);0<f&&16>=f?(i=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][f-1],r=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][f-1]):255===f&&(i=zo(n,16),r=zo(n,16))}return n=(2-s)*(o+1)*16-2*d-2*h,a=16*(a+1)-2*u-2*l,u=[],t=t.fullData,u.push(t.byteLength>>>8&255),u.push(255&t.byteLength),u=u.concat.apply(u,c(t)),t=[],e=e.fullData,t.push(e.byteLength>>>8&255),t.push(255&e.byteLength),t=t.concat.apply(t,c(e)),{height:n,width:a,za:e=new Uint8Array([1,u[3],u[4],u[5],255,225].concat(u,[1],t)),Da:i,Fa:r}}(m);if(!x||null==g)throw new De(2,3,3018,n?n.N()[0]:null);t.height=x.height,t.width=x.width,f={id:t.id,type:"video",codecs:"avc1",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:9e4,duration:i,fb:[],qa:new Uint8Array([]),za:x.za,Da:x.Da,Fa:x.Fa,data:{wb:this.g,baseMediaDecodeTime:g,ab:p},stream:t};break;case"hvc":var A=[],E=null,k=[],I=u.sc();if(!I.length)throw new De(2,3,3023,n?n.N()[0]:null);for(var M=0;M<I.length;M++){var C=I[M],D=C.nalus;k.push.apply(k,c(D));for(var R=!1,P=[],L=!1,N=l(D),j=N.next();!j.done;j=N.next()){var O=j.value;switch(O.type){case 1:case 0:var U=L=!0;break;case 19:case 20:case 21:R=U=L=!0;break;case 32:case 33:case 34:case 39:case 40:U=!0;break;case 35:L=U=!0;break;default:U=!1}if(L&&U){var _=O.fullData.byteLength,B=new Uint8Array(4);B[0]=_>>24&255,B[1]=_>>16&255,B[2]=_>>8&255,B[3]=255&_,P.push(B),P.push(O.fullData)}}var F,V=P.length?{data:di.apply(ai,c(P)),nd:R}:null;if(V)null==E&&null!=C.dts&&(E=C.dts),F=M+1<I.length?(I[M+1].dts||0)-(C.dts||0):1<I.length?(C.dts||0)-(I[M-1].dts||0):9e4*(n.endTime-n.startTime),A.push({data:V.data,size:V.data.byteLength,duration:F,hb:Math.round((C.pts||0)-(C.dts||0)),flags:{kb:0,$a:0,Za:0,Xa:0,Ya:V.nd?2:1,lb:V.nd?0:1}})}var H=function(e){if(!e.length)return null;var t=e.find((function(e){return 32==e.type})),n=e.find((function(e){return 33==e.type})),i=e.find((function(e){return 34==e.type}));if(!t||!n||!i)return null;var r=function(e){var t=new Ko(e,!0);return Zo(t),Zo(t),zo(t,4),zo(t,2),zo(t,6),{Cf:(e=zo(t,3))+1,Zf:t=Qo(t)}}(t.fullData);e=function(e){Zo(e=new Ko(e,!0)),Zo(e);var t=0,n=0,i=0,r=0;zo(e,4);var a=zo(e,3);Qo(e);for(var o=zo(e,2),s=zo(e,1),u=zo(e,5),l=Zo(e),c=Zo(e),d=Zo(e),h=Zo(e),f=Zo(e),p=Zo(e),g=Zo(e),m=Zo(e),v=Zo(e),y=Zo(e),b=Zo(e),w=[],T=[],S=0;S<a;S++)w.push(Qo(e)),T.push(Qo(e));if(0<a)for(S=a;8>S;S++)zo(e,2);for(S=0;S<a;S++)w[S]&&zo(e,88),T[S]&&Zo(e);Jo(e),3==(w=Jo(e))&&zo(e,1),T=Jo(e),S=Jo(e),Qo(e)&&(t+=Jo(e),n+=Jo(e),i+=Jo(e),r+=Jo(e));var x=Jo(e),A=Jo(e),E=Jo(e);if(Qo(e))for(var k=0;k<=a;k++)Jo(e),Jo(e),Jo(e);else Jo(e),Jo(e),Jo(e);if(Jo(e),Jo(e),Jo(e),Jo(e),Jo(e),Jo(e),Qo(e)&&Qo(e))for(k=0;4>k;k++)for(var I=0;I<(3===k?2:6);I++)if(Qo(e)){var M=Math.min(64,1<<4+(k<<1));1<k&&$o(e);for(var C=0;C<M;C++)$o(e)}else Jo(e);for(Qo(e),Qo(e),Qo(e)&&(Zo(e),Jo(e),Jo(e),Qo(e)),k=Jo(e),M=I=0;M<k;M++)if(C=!1,0!==M&&(C=Qo(e)),C){M===k&&Jo(e),Qo(e),Jo(e);for(var D=C=0;D<=I;D++){var R=Qo(e),P=!1;R||(P=Qo(e)),(R||P)&&C++}I=C}else{for(I=(D=Jo(e))+(C=Jo(e)),R=0;R<D;R++)Jo(e),Qo(e);for(D=0;D<C;D++)Jo(e),Qo(e)}if(Qo(e))for(k=Jo(e),I=0;I<k;I++){for(M=0;M<E+4;M++)zo(e,1);zo(e,1)}if(k=E=1,I=0,Qo(e),Qo(e),Qo(e)){if(Qo(e)&&(C=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],D=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1],0<(M=Zo(e))&&16>=M?(E=C[M-1],k=D[M-1]):255===M&&(E=zo(e,16),k=zo(e,16))),Qo(e)&&Qo(e),Qo(e)&&(zo(e,3),Qo(e),Qo(e)&&(Zo(e),Zo(e),Zo(e))),Qo(e)&&(Jo(e),Jo(e)),Qo(e),Qo(e),Qo(e),(M=Qo(e))&&(Jo(e),Jo(e),Jo(e),Jo(e)),Qo(e)&&(zo(e,32),zo(e,32),Qo(e)&&Jo(e),Qo(e)))for(D=!1,M=Qo(e),C=Qo(e),(M||C)&&((D=Qo(e))&&(Zo(e),zo(e,5),Qo(e),zo(e,5)),zo(e,4),zo(e,4),D&&zo(e,4),zo(e,5),zo(e,5),zo(e,5)),R=0;R<=a;R++){var L=!0;P=1,Qo(e)||(L=Qo(e));var N=!1;if(L?Jo(e):N=Qo(e),N||(P=Jo(e)+1),M){for(L=0;L<P;L++)Jo(e),Jo(e),D&&(Jo(e),Jo(e));Qo(e)}if(C){for(L=0;L<P;L++)Jo(e),Jo(e),D&&(Jo(e),Jo(e));Qo(e)}}Qo(e)&&(Qo(e),Qo(e),Qo(e),I=Jo(e),Jo(e),Jo(e),Jo(e),Jo(e))}return{af:b,gf:o,hf:s,ff:u,bf:l,cf:c,df:d,ef:h,Ve:f,We:p,Xe:g,Ye:m,Ze:v,$e:y,$d:I,Oe:0,Me:w,Le:x,Ke:A,width:T-(t+n)*(1===w||2===w?2:1),height:S-(i+r)*(1===w?2:1),Vi:E,Ui:k}}(n.fullData);var a=function(e){var t=new Ko(e,!0);Zo(t),Zo(t),Jo(t),Jo(t),Qo(t),Qo(t),zo(t,3),Qo(t),Qo(t),Jo(t),Jo(t),$o(t),Qo(t),Qo(t),Qo(t)&&Jo(t),$o(t),$o(t),Qo(t),Qo(t),Qo(t),Qo(t),e=Qo(t);var n=1;return(t=Qo(t))&&e?n=0:t?n=3:e&&(n=2),{Ff:n}}(i.fullData);return t=function(e,t,n,i){var r=new Uint8Array(23+(5+e.byteLength)+(5+t.byteLength)+(5+n.byteLength));return r[0]=1,r[1]=(3&i.gf)<<6|(i.hf?1:0)<<5|31&i.ff,r[2]=i.bf,r[3]=i.cf,r[4]=i.df,r[5]=i.ef,r[6]=i.Ve,r[7]=i.We,r[8]=i.Xe,r[9]=i.Ye,r[10]=i.Ze,r[11]=i.$e,r[12]=i.af,r[13]=240|(3840&i.$d)>>8,r[14]=255&i.$d,r[15]=252|3&i.Ff,r[16]=252|3&i.Me,r[17]=248|7&i.Le,r[18]=248|7&i.Ke,r[19]=0,r[20]=0,r[21]=(3&i.Oe)<<6|(7&i.Cf)<<3|(i.Zf?1:0)<<2|3,r[22]=3,r[23]=160,r[24]=0,r[25]=1,r[26]=(65280&e.byteLength)>>8,r[27]=255&e.byteLength,r.set(e,28),r[23+(5+e.byteLength)]=161,r[e.byteLength+29]=0,r[e.byteLength+30]=1,r[e.byteLength+31]=(65280&t.byteLength)>>8,r[e.byteLength+32]=255&t.byteLength,r.set(t,e.byteLength+33),r[23+(e.byteLength+10+t.byteLength)]=162,r[e.byteLength+10+t.byteLength+24]=0,r[e.byteLength+10+t.byteLength+25]=1,r[e.byteLength+10+t.byteLength+26]=(65280&n.byteLength)>>8,r[e.byteLength+10+t.byteLength+27]=255&n.byteLength,r.set(n,e.byteLength+10+t.byteLength+28),r}(t.fullData,n.fullData,i.fullData,{Cf:r.Cf,Zf:r.Zf,gf:e.gf,hf:e.hf,af:e.af,ff:e.ff,bf:e.bf,cf:e.cf,df:e.df,ef:e.ef,Ve:e.Ve,We:e.We,Xe:e.Xe,Ye:e.Ye,Ze:e.Ze,$e:e.$e,Oe:e.Oe,$d:e.$d,Me:e.Me,Le:e.Le,Ke:e.Ke,Ff:a.Ff}),{height:e.height,width:e.width,za:t,Da:e.Vi,Fa:e.Ui}}(k);if(!H||null==E)throw new De(2,3,3018,n?n.N()[0]:null);t.height=H.height,t.width=H.width,f={id:t.id,type:"video",codecs:"hvc1",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:9e4,duration:i,fb:[],qa:new Uint8Array([]),za:H.za,Da:H.Da,Fa:H.Fa,data:{wb:this.g,baseMediaDecodeTime:E,ab:A},stream:t}}f&&(d.push(f),f=null)}if("audio"==r){switch(h.audio){case"aac":for(var G,K=[],X=null,q=l(u.Wb()),z=q.next();!z.done;z=q.next()){var W=z.value,Y=W.data;if(Y){var J=0;if(!(G=MT(Y,J)))throw new De(2,3,3018,n?n.N()[0]:null);for(t.audioSamplingRate=G.sampleRate,t.channelsCount=G.channelCount,null==X&&null!==W.pts&&(X=W.pts);J<Y.length;){var $=IT(Y,J);if($){var Q=$.Sd+$.ea;J+Q<=Y.length&&K.push({data:Y.subarray(J+$.Sd,J+Q),size:$.ea,duration:1024,hb:0,flags:{kb:0,$a:0,Za:0,Xa:0,Ya:2,lb:0}}),J+=Q}else J++}}}if(!G||null==X){if(!u.sc().length)throw new De(2,3,3018,n?n.N()[0]:null);X=9e4*n.startTime;var Z=mi("audio",t.codecs.split(","));if(!Z||!t.channelsCount||!t.audioSamplingRate)throw new De(2,3,3018,n?n.N()[0]:null);G={sampleRate:t.audioSamplingRate,channelCount:t.channelsCount,codec:Z};var ee=function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t||3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null}(Z,t.channelsCount);if(!ee)throw new De(2,3,3018,n?n.N()[0]:null);for(var te=X+9e4*(n.endTime-n.startTime),ne=X;ne<te;)K.push({data:ee,size:ee.byteLength,duration:1024,hb:0,flags:{kb:0,$a:0,Za:0,Xa:0,Ya:2,lb:0}}),ne+=1024/G.sampleRate*9e4}var ie=G.sampleRate,re=X/9e4*ie;f={id:t.id,type:"audio",codecs:G.codec,encrypted:t.encrypted&&0<t.drmInfos.length,timescale:ie,duration:i,fb:[],qa:new Uint8Array([]),za:new Uint8Array([]),Da:0,Fa:0,data:{wb:this.g,baseMediaDecodeTime:re,ab:K},stream:t};break;case"ac3":for(var ae=[],oe=0,se=new Uint8Array([]),ue=null,le=l(u.Wb()),ce=le.next();!ce.done;ce=le.next()){var de=ce.value,he=de.data;null==ue&&null!==de.pts&&(ue=de.pts);for(var fe=0;fe<he.length;){var pe=RT(he,fe);pe?(t.audioSamplingRate=pe.sampleRate,t.channelsCount=pe.channelCount,oe=pe.sampleRate,se=pe.qa,ae.push({data:he.subarray(fe,fe+pe.ea),size:pe.ea,duration:1536,hb:0,flags:{kb:0,$a:0,Za:0,Xa:0,Ya:2,lb:0}}),fe+=pe.ea):fe++}}if(0==oe||0==se.byteLength||null==ue)throw new De(2,3,3018,n?n.N()[0]:null);var me=ue/9e4*oe;f={id:t.id,type:"audio",codecs:"ac-3",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:oe,duration:i,fb:[],qa:se,za:new Uint8Array([]),Da:0,Fa:0,data:{wb:this.g,baseMediaDecodeTime:me,ab:ae},stream:t};break;case"ec3":for(var ve=[],ye=0,be=new Uint8Array([]),we=null,Te=l(u.Wb()),Se=Te.next();!Se.done;Se=Te.next()){var xe=Se.value,Ae=xe.data;null==we&&null!==xe.pts&&(we=xe.pts);for(var Ee=0;Ee<Ae.length;){var ke=NT(Ae,Ee);ke?(t.audioSamplingRate=ke.sampleRate,t.channelsCount=ke.channelCount,ye=ke.sampleRate,be=ke.qa,ve.push({data:Ae.subarray(Ee,Ee+ke.ea),size:ke.ea,duration:1536,hb:0,flags:{kb:0,$a:0,Za:0,Xa:0,Ya:2,lb:0}}),Ee+=ke.ea):Ee++}}if(0==ye||0==be.byteLength||null==we)throw new De(2,3,3018,n?n.N()[0]:null);var Ie=we/9e4*ye;f={id:t.id,type:"audio",codecs:"ec-3",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:ye,duration:i,fb:[],qa:be,za:new Uint8Array([]),Da:0,Fa:0,data:{wb:this.g,baseMediaDecodeTime:Ie,ab:ve},stream:t};break;case"mp3":for(var Me,Ce=[],Re=null,Pe=l(u.Wb()),Le=Pe.next();!Le.done;Le=Pe.next()){var Ne=Le.value,je=Ne.data;if(je){null==Re&&null!==Ne.pts&&(Re=Ne.pts);for(var Oe=0;Oe<je.length;){var Ue=_T(je,Oe);Ue?(Me||(Me=Ue),Oe+Ue.ea<=je.length&&Ce.push({data:je.subarray(Oe,Oe+Ue.ea),size:Ue.ea,duration:1152,hb:0,flags:{kb:0,$a:0,Za:0,Xa:0,Ya:2,lb:0}}),Oe+=Ue.ea):Oe++}}}if(!Me||null==Re)throw new De(2,3,3018,n?n.N()[0]:null);var _e=Me.sampleRate,Be=Re/9e4*_e;f={id:t.id,type:"audio",codecs:"mp3",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:_e,duration:i,fb:[],qa:new Uint8Array([]),za:new Uint8Array([]),Da:0,Fa:0,data:{wb:this.g,baseMediaDecodeTime:Be,ab:Ce},stream:t};break;case"opus":var Fe=[],Ve=null,He=u.F;if(!He)throw new De(2,3,3018,n?n.N()[0]:null);var Ge=[];switch(He.Fh){case 1:case 2:Ge=[0];break;case 0:Ge=[255,1,1,0,1];break;case 128:Ge=[255,2,0,0,1];break;case 3:Ge=[1,2,1,0,2,1];break;case 4:Ge=[1,2,2,0,1,2,3];break;case 5:Ge=[1,3,2,0,4,1,2,3];break;case 6:Ge=[1,4,2,0,4,1,2,3,5];break;case 7:Ge=[1,4,2,0,4,1,2,3,5,6];break;case 8:Ge=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:Ge=[1,1,2,0,1];break;case 131:Ge=[1,1,3,0,1,2];break;case 132:Ge=[1,1,4,0,1,2,3];break;case 133:Ge=[1,1,5,0,1,2,3,4];break;case 134:Ge=[1,1,6,0,1,2,3,4,5];break;case 135:Ge=[1,1,7,0,1,2,3,4,5,6];break;case 136:Ge=[1,1,8,0,1,2,3,4,5,6,7]}for(var Ke=new Uint8Array([0,He.channelCount,0,0,He.sampleRate>>>24&255,He.sampleRate>>>17&255,He.sampleRate>>>8&255,He.sampleRate>>>0&255,0,0].concat(c(Ge))),Xe=He.sampleRate,qe=l(u.Wb()),ze=qe.next();!ze.done;ze=qe.next()){var We=ze.value,Ye=We.data;null==Ve&&null!==We.pts&&(Ve=We.pts);for(var Je=0;Je<Ye.length;){for(var $e=!!(16&Ye[Je+1]),Qe=!!(8&Ye[Je+1]),Ze=Je+2,et=0;255===Ye[Ze];)et+=255,Ze+=1;et+=Ye[Ze],Ze+=1,Ze+=$e?2:0,Ze+=Qe?2:0;var tt=Ye.slice(Ze,Ze+et);Fe.push({data:tt,size:tt.byteLength,duration:960,hb:0,flags:{kb:0,$a:0,Za:0,Xa:0,Ya:2,lb:0}}),Je=Ze+et}}if(0==Ke.byteLength||null==Ve)throw new De(2,3,3018,n?n.N()[0]:null);t.audioSamplingRate=He.sampleRate,t.channelsCount=He.channelCount;var nt=Ve/9e4*Xe;f={id:t.id,type:"audio",codecs:"opus",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:Xe,duration:i,fb:[],qa:Ke,za:new Uint8Array([]),Da:0,Fa:0,data:{wb:this.g,baseMediaDecodeTime:nt,ab:Fe},stream:t}}f&&(d.push(f),f=null)}}catch(e){return e&&3023==e.code?Promise.resolve(new Uint8Array([])):Promise.reject(e)}if(!d.length)return Promise.reject(new De(2,3,3018,n?n.N()[0]:null));var it=new Zm(d),rt=t.id+"_"+n.i;if(this.i.has(rt))var at=this.i.get(rt);else at=ev(it),this.i.set(rt,at);var ot=av(it);this.g++;var st=di(at,ot);return Promise.resolve(st)},F("shaka.transmuxer.TsTransmuxer",JT),JT.prototype.transmux=JT.prototype.transmux,JT.prototype.getOriginalMimeType=JT.prototype.getOriginalMimeType,JT.prototype.convertCodecs=JT.prototype.convertCodecs,JT.prototype.isSupported=JT.prototype.isSupported,JT.prototype.destroy=JT.prototype.destroy;var $T,QT,ZT=["aac","ac-3","ec-3","mp3","opus"],eS=["avc","hevc"];function tS(){}function nS(){$T||navigator.emeEncryptionSchemePolyfilled?console.debug("EmeEncryptionSchemePolyfill: Already installed."):navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration?($T=navigator.requestMediaKeySystemAccess,console.debug("EmeEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.requestMediaKeySystemAccess=iS,navigator.emeEncryptionSchemePolyfilled=!0):console.debug("EmeEncryptionSchemePolyfill: EME not found")}function iS(e,t){var n,i=this;return P((function(r){return 1==r.g?(console.assert(i==navigator,'bad "this" for requestMediaKeySystemAccess'),w(r,$T.call(i,e,t),2)):fS(n=r.h)?(console.debug("EmeEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.requestMediaKeySystemAccess=$T,r.return(n)):(console.debug("EmeEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support."),navigator.requestMediaKeySystemAccess=rS,r.return(rS.call(i,e,t)))}))}function rS(e,t){var n,i,r,a,o,s,u,c,d,h,f,p,g=this;return P((function(m){if(1==m.g){for(console.assert(g==navigator,'bad "this" for requestMediaKeySystemAccess'),n=hS(e),i=[],r=l(t),a=r.next();!a.done;a=r.next())o=a.value,s=aS(o.videoCapabilities,n),u=aS(o.audioCapabilities,n),o.videoCapabilities&&o.videoCapabilities.length&&!s.length||o.audioCapabilities&&o.audioCapabilities.length&&!u.length||((c=Object.assign({},o)).videoCapabilities=s,c.audioCapabilities=u,i.push(c));if(!i.length)throw(d=Error("Unsupported keySystem or supportedConfigurations.")).name="NotSupportedError",d.code=DOMException.NOT_SUPPORTED_ERR,d;return w(m,$T.call(g,e,i),2)}return h=m.h,p=f=null,i[0]&&(i[0].videoCapabilities&&(f=i[0].videoCapabilities[0].encryptionScheme),i[0].audioCapabilities&&(p=i[0].audioCapabilities[0].encryptionScheme)),m.return(new dS(h,f,p))}))}function aS(e,t){return e?e.filter((function(e){return pS(e.encryptionScheme,t)})):e}function oS(){}function sS(){QT||navigator.mediaCapabilitiesEncryptionSchemePolyfilled?console.debug("McEncryptionSchemePolyfill: Already installed."):navigator.mediaCapabilities?(QT=navigator.mediaCapabilities.decodingInfo,console.debug("McEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=uS,navigator.mediaCapabilitiesEncryptionSchemePolyfilled=!0):console.debug("McEncryptionSchemePolyfill: MediaCapabilities not found")}function uS(e){var t,n,i=this;return P((function(r){switch(r.g){case 1:return console.assert(i==navigator.mediaCapabilities,'bad "this" for decodingInfo'),w(r,QT.call(i,e),2);case 2:if(t=r.h,!e.keySystemConfiguration)return r.return(t);if((n=t.keySystemAccess)&&fS(n))return console.debug("McEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.mediaCapabilities.decodingInfo=QT,r.return(t);if(console.debug("McEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=lS,n){r.u(3);break}return w(r,cS(e),4);case 4:return t.keySystemAccess=r.h,r.return(t);case 3:return r.return(lS.call(i,e))}}))}function lS(e){var t,n,i,r,a,o,s,u=this;return P((function(l){switch(l.g){case 1:return console.assert(u==navigator.mediaCapabilities,'bad "this" for decodingInfo'),n=t=null,!e.keySystemConfiguration||(i=e.keySystemConfiguration,r=i.keySystem,n=i.audio&&i.audio.encryptionScheme,t=i.video&&i.video.encryptionScheme,a=hS(r),o={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:e},pS(n,a)&&pS(t,a))?w(l,QT.call(u,e),2):l.return(o);case 2:if((s=l.h).keySystemAccess){s.keySystemAccess=new dS(s.keySystemAccess,t,n),l.u(3);break}if(!e.keySystemConfiguration){l.u(3);break}return w(l,cS(e),5);case 5:s.keySystemAccess=l.h;case 3:return l.return(s)}}))}function cS(e){var t,n;return P((function(i){if(1==i.g){var r=e.keySystemConfiguration,a=[],o=[];return r.audio&&a.push({robustness:r.audio.robustness||"",contentType:e.audio.contentType,encryptionScheme:r.audio.encryptionScheme}),r.video&&o.push({robustness:r.video.robustness||"",contentType:e.video.contentType,encryptionScheme:r.video.encryptionScheme}),r={initDataTypes:r.initDataType?[r.initDataType]:[],distinctiveIdentifier:r.distinctiveIdentifier,persistentState:r.persistentState,sessionTypes:r.sessionTypes},a.length&&(r.audioCapabilities=a),o.length&&(r.videoCapabilities=o),t=r,w(i,navigator.requestMediaKeySystemAccess(e.keySystemConfiguration.keySystem,[t]),2)}return n=i.h,i.return(n)}))}function dS(e,t,n){this.g=e,this.i=t||null,this.h=n||null,this.keySystem=e.keySystem}function hS(e){return e.startsWith("com.widevine")||e.startsWith("com.microsoft")||e.startsWith("com.chromecast")||e.startsWith("com.adobe")||e.startsWith("org.w3")?"cenc":e.startsWith("com.apple")?"cbcs":(console.warn("EmeEncryptionSchemePolyfill: Unknown key system:",e,"Please contribute!"),null)}function fS(e){var t=(e=e.getConfiguration()).audioCapabilities&&e.audioCapabilities[0];return!(!(e=e.videoCapabilities&&e.videoCapabilities[0]||t)||void 0===e.encryptionScheme)}function pS(e,t){return!e||e==t||!("cbcs"!=e&&"cbcs-1-9"!=e||!(bS||SS||yS))}function gS(){}function mS(){nS(),sS()}jn("video/mp2t",(function(){return new JT("video/mp2t")}),Fn),F("EmeEncryptionSchemePolyfill",tS),tS.install=nS,F("McEncryptionSchemePolyfill",oS),oS.install=sS,dS.prototype.getConfiguration=function(){var e=this.g.getConfiguration();if(e.videoCapabilities)for(var t=l(e.videoCapabilities),n=t.next();!n.done;n=t.next())n.value.encryptionScheme=this.i;if(e.audioCapabilities)for(n=(t=l(e.audioCapabilities)).next();!n.done;n=t.next())n.value.encryptionScheme=this.h;return e},dS.prototype.createMediaKeys=function(){return this.g.createMediaKeys()},F("EncryptionSchemePolyfills",gS),gS.install=mS;var vS,yS=navigator.userAgent.includes("CrKey"),bS=100<=parseInt(navigator.userAgent.split("Firefox/").pop(),10),wS=navigator.userAgent||"";if(wS.includes("Web0S")){var TS=wS.match(/Chrome\/(\d+)/);vS=!!TS&&79<=parseInt(TS[1],10)}else vS=!1;var SS=vS;void 0!==n&&n.exports&&(n.exports=gS)}.call(i,e,e,void 0),i.shaka)t[r]=i.shaka[r]}()}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{ClientAssertionError:()=>L,ConnectReason:()=>k,ShakaPlayer:()=>V,alarmManager:()=>U,auth:()=>E,deviceManager:()=>_,envInfo:()=>R,getClientAssertion:()=>N,getConnectReason:()=>G,getDeviceInfo:()=>q,getPlatformInfo:()=>M,getTriggerEvent:()=>K,init:()=>I,initSequence:()=>S,isRunningE2E:()=>C,lifecycle:()=>j,messageManager:()=>F,platformManager:()=>B,remotePlayer:()=>O,setTimezone:()=>X,shaka:()=>H,showSequence:()=>x,uiReady:()=>D,writeLicenseResponse:()=>P});var e={};n.r(e),n.d(e,{ClientAssertionError:()=>L,ConnectReason:()=>k,ShakaPlayer:()=>V,alarmManager:()=>U,auth:()=>E,deviceManager:()=>_,envInfo:()=>R,getClientAssertion:()=>N,getConnectReason:()=>G,getDeviceInfo:()=>q,getPlatformInfo:()=>M,getTriggerEvent:()=>K,init:()=>I,initSequence:()=>S,isRunningE2E:()=>C,lifecycle:()=>j,messageManager:()=>F,platformManager:()=>B,remotePlayer:()=>O,setTimezone:()=>X,shaka:()=>H,showSequence:()=>x,uiReady:()=>D,writeLicenseResponse:()=>P});const t="4.3.5";class r{constructor(e){this.logFields=e}debug(...e){console.debug(this.formatLogString(e))}log(...e){console.log(this.formatLogString(e))}info(...e){console.info(this.formatLogString(e))}warn(...e){console.warn(this.formatLogString(e))}error(...e){console.error(this.formatLogString(e))}metrics(e){console.info(`[hs-sdk] [metrics] ${JSON.stringify(e)}`)}withFields(e){return new r({...this.logFields,...e})}formatLogString(e){let t="[hs-sdk] "+e.join(" ");return this.logFields&&(t+=" [log-fields] "+JSON.stringify(this.logFields)),t}}const a=new r({sdkVersion:t});function o(e,...t){return console.log(`Called "${e}" with args:`,...t||[],"This feature is only supported E2E."),Promise.resolve()}class s extends EventTarget{ConnectReason=Object.freeze({UNKNOWN:"unknown",INITIAL_CONNECTION:"initial_connection",APPLICATION_RELOAD:"reload_app",UI_RELEASE:"ui_release",UI_TERMINATION:"ui_termination",WEBRTC_ERROR:"webrtc_error",UI_WATCHDOG:"ui_watchdog"});UiState=Object.freeze({UNKNOWN:"unknown",FOREGROUND:"foreground",IN_TRANSITION_TO_FOREGROUND:"inTransitionToForeground",BACKGROUND:"background",IN_TRANSITION_TO_BACKGROUND:"inTransitionToBackground"});configure(e){o("lifecycle.configure",e)}getConfiguration(){return{autoBackground:{enabled:!1,timeout:{playing:0,idle:0}}}}get state(){return this._state=this.UiState.UNKNOWN,this._state}get connectReason(){return this.ConnectReason.UNKNOWN}get triggerEvent(){return{}}set autoBackground(e){o("lifecycle.autoBackground",e)}get autoBackground(){return!1}set autoBackgroundDelay(e){o("lifecycle.autoBackgroundDelay",e)}get autoBackgroundDelay(){return 0}set autoBackgroundOnUIDelay(e){o("lifecycle.autoBackgroundOnUIDelay",e)}get autoBackgroundOnUIDelay(){return 0}getState(){a.warn("lifecycle getState is not supported if NOT running e2e")}moveToForeground(){return o("lifecycle.moveToForeground")}moveToBackground(){return o("lifecycle.moveToBackground")}switchTenant(e){return o("lifecycle.switchTenant",e)}exitApplication(){return o("lifecycle.exitApplication")}disconnect(){return o("lifecycle.disconnect")}addEventListener(e,t,n){super.addEventListener(e,t,n)}removeEventListener(e,t,n){super.removeEventListener(e,t,n)}}class u extends EventTarget{get deviceInfo(){return a.log("getDeviceInfo running locally, returning dummy info"),{deviceId:"123456789",modelNumber:"ABC",connectionId:"dummy",community:"LocalDev",tenant:"XXXXXX",clientIp:"0.0.0.0",countryCode:"XX",connectionType:"simulator"}}reboot(){return o("DeviceManager.reboot")}clearWifi(){return o("DeviceManager.clearWifi")}sendDataToDevice(e){return o("DeviceManager.sendDataToDevice",e)}async factoryReset(e=!0){return o("DeviceManager.factoryReset",e)}async getWifiInfo(){return Promise.resolve({})}}class l extends EventTarget{get appConfig(){return{}}setTimezone(e){o("PlatformManager.setTimezone",e)}}class c extends EventTarget{addEventListener(e,t){o("AlarmManager.addEventListener",e,t)}removeEventListener(e,t){o("AlarmManager.removeEventListener",e,t)}addAlarm(e,t,n="",i=0,r=0){o("AlarmManager.addAlarm",e,t,n,i,r)}deleteAlarm(e){o("AlarmManager.deleteAlarm",e)}deleteAllAlarms(){o("AlarmManager.deleteAllAlarms")}getActiveAlarms(){return o("AlarmManager.getActiveAlarms")}}class d extends EventTarget{async registerGroups(e){return o("MessageManager.registerGroups",e)}}class h extends EventTarget{LoadMode=Object.freeze({NOT_LOADED:"notLoaded",LOADING:"loading",LOADED:"loaded",UNLOADING:"unloading"});getConfiguration(){return{preferredAudioLanguage:"",preferredSubtitlesLanguage:""}}configure(e){o("RemotePlayer.configure",e)}registerVideoElement(e){this.attach(e)}attach(e){o("RemotePlayer.attach",e)}detach(){o("RemotePlayer.detach")}async load(e,t){return o("RemotePlayer.load",e,t)}async play(){return o("RemotePlayer.play")}async pause(){return o("RemotePlayer.pause")}async stop(){return o("RemotePlayer.stop")}getAssetUri(){return""}getLoadMode(){return this.LoadMode.NOT_LOADED}getTextTracks(){return[]}getAudioTracks(){return[]}async selectAudioTrack(e){return o("RemotePlayer.selectAudioTrack",e)}async selectTextTrack(e){return o("RemotePlayer.selectTextTrack",e)}setTextTrackVisibility(e){return o("RemotePlayer.setTextTrackVisibility",e)}setScreenBlackout(e){return o("RemotePlayer.setScreenBlackout",e)}resetScreenBlackout(){return o("RemotePlayer.resetScreenBlackout")}get currentTime(){return 0}set currentTime(e){o("RemotePlayer.currentTime",e)}get duration(){return 0}get textTrackVisibility(){return!1}getPresentationStartTimeAsDate(){return null}async unload(){return o("RemotePlayer.unload")}}var f=n(159);f.util.Error.Category.SENZA_PLAYER_ERROR=50,f.util.Error.Code.SENZA_PLAYER_ERROR=10500;const p={...f};class g extends f.Player{constructor(e,t,n){super(e,t,n)}async attach(e,t=!0){await super.attach(e,t)}async detach(e=!1){return super.detach(e)}async unload(e=!0,t=!1){return super.unload(e,t)}getTextLanguages(){return super.getTextLanguages()}getAudioLanguages(){return super.getAudioLanguages()}selectAudioLanguage(e,t){super.selectAudioLanguage(e,t)}selectTextLanguage(e,t){super.selectTextLanguage(e,t)}setTextTrackVisibility(e){super.setTextTrackVisibility(e)}get isInRemotePlayback(){return!1}async load(e,t,n){return super.load(e,t,n)}async destroy(){return super.destroy()}configure(e){return super.configure(e)}}p.Player=g;const m={BACK:27,HOME:36,LEFT:37,RIGHT:39,UP:38,DOWN:40,ENTER:13},v={root:{top:"5vh",left:"82vw",height:"90vh",fontSize:"16px",width:"16vw",position:"fixed",zIndex:1e4,overflow:"hidden",visibility:"hidden"},item:{backgroundColor:"white",color:"black",fontSize:"12px",display:"flex",padding:"6px",border:"1px solid black",borderTop:"none"},item_key:{borderTopLeftRadius:"6px",borderTopRightRadius:"6px",marginTop:"20px",borderBottom:"3px solid black"},component:{fontWeight:"bold",width:"5vw"},component_key:{fontWeight:"normal",color:"darkgray"},id:{textAlign:"left",fontWeight:"normal",flex:1},id_key:{fontWeight:"bold"},time:{fontVariantNumeric:"tabular-nums",width:"3vw"},time_key:{fontWeight:"bold"}};let y=performance.now();const b=(e,t)=>"key"===t?new Date(e).toLocaleTimeString("en-US",{hour12:!1}):`${(e/1e3).toFixed(2)}s`,w=(e,t,n)=>{Object.entries(e).forEach((([e,i])=>{Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach((r=>{if(n&&n(r))return;const a=i[r];"function"==typeof a&&(i[r]=function(...n){return t(e,r,...n),a.apply(this,n)})}))}))},T=(e,t)=>{e.innerHTML="",t.forEach(((n,i)=>{const r=document.createElement("div");Object.assign(r.style,{...v.item,...v[`item_${n?.component}`]}),["component","id","time"].forEach((e=>{if(n[e]){const t=document.createElement("div");Object.assign(t.style,v[e],v[`${e}_${n.component}`]),t.textContent="time"===e?b(n.time,n.component):n[e],r.appendChild(t)}})),e.appendChild(r),i===t.length-1&&r.scrollIntoView({behavior:"smooth"})}))},S=e=>{if(!e)return void a.error("No components to sequence");let t=document.getElementById("sequence-container");if(t)return;t=(()=>{const e=document.createElement("div");return e.id="sequence-container",Object.assign(e.style,v.root),document.body.appendChild(e),e})();const n=new Proxy([],{set:(e,i,r)=>(e[i]=r,"length"!==i&&T(t,n),!0)});window.printSequence=()=>(e=>{const t=e.map((e=>{const t=e.separator?"\n":"",n=e?.time?` ${b(e.time,e?.component)}`:"";if(e.args){const i=e.args.map((e=>"object"==typeof e?"object":e)).join(", ");return`${t}${e.component}.${e.id}(${i})${n}`}return`\n${e.component}: ${e.id}${n}`}));a.log("sequence:\n",t.join("\n"))})(n),((e,t)=>{t.push({component:"key",id:"BOOT",time:Date.now()}),w(e,((e,n,...i)=>{t.push({component:e,id:n,args:i,time:performance.now()-y})}),(e=>e.startsWith("_")||e.startsWith("get"))),(e=>{window.addEventListener("keydown",(t=>{var n;e.push({component:"key",id:(n=t.keyCode,Object.entries(m).find((([,e])=>e===n))?.[0]||String(n)),time:Date.now()}),y=performance.now()}))})(t),function(e,t){e.remotePlayer.addEventListener("videoelementattached",(()=>{const n=e.remotePlayer._videoElement;n&&!n._devSequenceRateChangeHandler&&(n._devSequenceRateChangeHandler=()=>{t.push({component:"localPlayer",id:"ratechange="+n.playbackRate,time:performance.now()-y})},n.addEventListener("ratechange",n._devSequenceRateChangeHandler)),n&&!n._devSequencePlayingHandler&&(n._devSequencePlayingHandler=()=>{t.push({component:"localPlayer",id:"playing event",time:performance.now()-y})},n.addEventListener("playing",n._devSequencePlayingHandler))})),e.remotePlayer.addEventListener("playing",(()=>{t.push({component:"remotePlayer",id:"playing event",time:performance.now()-y})}))}(e,t),a.log("Sequence initialized.")})(e,n),T(t,n)},x=(e=!0)=>{const t=document.getElementById("sequence-container");t?t.style.visibility=e?"visible":"hidden":a.error("Sequence not initialized")};let A;"undefined"!=typeof document&&document.addEventListener("keydown",(e=>{a.log(`Got ${e.key} key`)}));const E={getToken:async function(){return window.senzaSDKImplementation?window.senzaSDKImplementation.auth.getToken():Promise.resolve(A)},forceTokenUpdate:function(){if(A=null,window.senzaSDKImplementation)return window.senzaSDKImplementation.auth.forceTokenUpdate();a.error("forceTokenUpdate: window.cefQuery is undefined")},getClientAssertion:N},k=Object.freeze({UNKNOWN:"unknown",INITIAL_CONNECTION:"initial_connection",APPLICATION_RELOAD:"reload_app",UI_RELEASE:"ui_release",UI_TERMINATION:"ui_termination",WEBRTC_ERROR:"webrtc_error",UI_WATCHDOG:"ui_watchdog"});async function I(){a.log(`init interface ${t}`),window.senzaSDKImplementation?await window.senzaSDKImplementation.init(t,x,S):o("init"),window.close=()=>{a.warn("window.close is disabled on Senza platform. Use lifecycle.exitApplication() instead.")}}function M(){return window.senzaSDKImplementation?window.senzaSDKImplementation.getPlatformInfo():{version:"X.X.XX-X",pod:"ui-streamer-X.X.XX-X-QWERT-ASDFG-XXX-XXXXXX-XXXXX",podIP:"0.0.0.0",sessionInfo:{userAgent:"SynamediaSenza/XX.YY.ZZ",connectionId:"dummy",deviceId:"123456789",community:"LocalDev",tenant:"XXXXXX",tenantId:"XXXXXX",manifest:{transcontainer:"X.X.XX-X"},settings:{webUI:{backendHeaders:{Authorization:"Bearer dummytoken"}}},homeSessionInfo:{tenantId:"XXXXXX",community:"LocalDev"}}}}function C(){return!("undefined"==typeof window||!window.senzaSDKImplementation)}function D(){if(window.senzaSDKImplementation)return window.senzaSDKImplementation.uiReady();a.error("uiReady: window.cefQuery is undefined")}const R={remoteBrowserIp:window?.diagnostics?.()?.podIP||"127.0.0.1",sdkVersion:t,sdkBackendVersion:window?.senzaSDKImplementation?.version||"N/A"};function P(e,t,n,i){if(window?.senzaSDKImplementation)return window.senzaSDKImplementation.writeLicenseResponse(e,t,n,i);a.error("writeLicenseResponse: window.cefQuery is undefined")}class L extends Error{constructor(e,t){super(t),this.code=e}}function N(){if(window?.senzaSDKImplementation)return window.senzaSDKImplementation.auth.getClientAssertion();a.warn("getClientAssertion is not supported if NOT running e2e")}let j,O,U,_,B,F,V,H;function G(){return j.connectReason}function K(){return j.triggerEvent}function X(e){if(window.cefQuery){const t={message:JSON.stringify({type:"setTimeZone",timezone:e}),waitForResponse:!1,target:"UI-Streamer"};window.cefQuery({request:JSON.stringify(t),persistent:!1,onSuccess:()=>{a.log("timezome is successfully set to",e)},onFailure:(t,n)=>{a.error(`error occurred setting timezone to ${e}: ${t} ${n}`)}})}}function q(){return C()?{deviceId:_.deviceInfo.deviceId,connectionId:_.deviceInfo.connectionId,community:_.deviceInfo.community,tenant:_.deviceInfo.tenant,clientIp:_.deviceInfo.clientIp}:(a.log("getDeviceInfo running locally, returning dummy info"),{deviceId:"123456789",connectionId:"dummy",community:"LocalDev",tenant:"XXXXXX",clientIp:"0.0.0.0"})}C()?(j=window.senzaSDKImplementation.lifecycle,O=window.senzaSDKImplementation.remotePlayer,U=window.senzaSDKImplementation.alarmManager,_=window.senzaSDKImplementation.deviceManager,B=window.senzaSDKImplementation.platformManager,F=window.senzaSDKImplementation.messageManager,V=window.senzaSDKImplementation.ShakaPlayer,H=window.senzaSDKImplementation.shaka):(a.warn("Senza SDK is not running in E2E environment. Some features may not work as expected."),j=new s,O=new h,U=new c,_=new u,B=new l,F=new d,V=g,H=p),"undefined"!=typeof window&&(window.hs=e,window.senza=window.senza||e)})(),i})()));