senza-sdk 4.4.4 → 4.4.6

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 p;e:{var f={};try{f.__proto__={a:!0},p=f.a;break e}catch(e){}p=!1}d=p?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.zm=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={Sh:t,di:!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 x(e,t,n){e.m=t,null!=n&&(e.j=n)}function S(e,t){e.m=0,e.j=t||0}function A(e,t,n){e.g=t,e.m=n||0}function k(e,t){return e.m=t||0,t=e.i.Sh,e.i=null,t}function E(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.di?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 C(e){this.g=new v,this.h=e}function M(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.di)throw t.Sh;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function P(e){this.next=function(t){return y(e.g),e.g.l?t=M(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=M(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?M(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 R(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 P(new C(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 O(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 j(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+""}function U(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{ai:r,v:a}}return{ai:-1,v:void 0}}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.Le(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.Le(i(e,r),i(n,a)),o},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.Le=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).Le(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).Le(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.sc=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.sc;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],sc:this[1].sc,head:this[1],key:e,value:t},n.list.push(n.entry),this[1].sc.next=n.entry,this[1].sc=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.sc.next=e.entry.next,e.entry.next.sc=e.entry.sc,e.entry.head=null,this.size--,0))},r.prototype.clear=function(){this[0]={},this[1]=this[1].sc=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.values",(function(e){return e||function(){return O(this,(function(e,t){return t}))}})),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.keys",(function(e){return e||function(){return O(this,(function(e){return e}))}})),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!==j(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("Array.prototype.findIndex",(function(e){return e||function(e,t){return U(this,e,t).ai}})),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 U(this,e,t).v}})),s("String.prototype.startsWith",(function(e){return e||function(e,t){var n=j(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 O(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=j(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=j(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(e){this.g=Math.exp(Math.log(.5)/e),this.i=this.h=0}function H(e){return e.h/(1-Math.pow(e.g,e.i))}function K(){this.h=new V(2),this.j=new V(5),this.g=0,this.i=128e3,this.l=16e3}function G(){}function z(){}function q(){}function X(e){var t=L.apply(1,arguments);Y.has(e)||(Y.add(e),q.apply(G,c(t)))}function W(){}V.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)},K.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)},K.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)}},K.prototype.getBandwidthEstimate=function(e){return this.g<this.i?e:Math.min(H(this.h),H(this.j))};var Y=new Set;function J(){this.g=new Map}function $(){this.g=new J}function Q(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=Z;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}Z=t}return t||!1}(e)?t:t.capture||!1}(e,i),this.target.addEventListener(t,n,this.g)}e.console&&((new Map).set(1,(function(){return console.error.apply(console,c(L.apply(0,arguments)))})).set(2,(function(){return console.warn.apply(console,c(L.apply(0,arguments)))})).set(3,(function(){return console.info.apply(console,c(L.apply(0,arguments)))})).set(4,(function(){return console.log.apply(console,c(L.apply(0,arguments)))})).set(5,(function(){return console.debug.apply(console,c(L.apply(0,arguments)))})).set(6,(function(){return console.debug.apply(console,c(L.apply(0,arguments)))})),q=function(){return console.warn.apply(console,c(L.apply(0,arguments)))},z=function(){console.error.apply(console,c(L.apply(0,arguments)))}),(i=J.prototype).push=function(e,t){this.g.has(e)?this.g.get(e).push(t):this.g.set(e,[t])},i.get=function(e){return this.g.has(e)?this.g.get(e).slice():null},i.remove=function(e,t){if(this.g.has(e)){var n=this.g.get(e).filter((function(e){return e!=t}));this.g.set(e,n),n.length||this.g.delete(e)}},i.forEach=function(e){this.g.forEach((function(t,n){e(n,t)}))},i.size=function(){return this.g.size},i.keys=function(){return Array.from(this.g.keys())},(i=$.prototype).release=function(){this.Ra(),this.g=null},i.D=function(e,t,n,i){this.g&&(e=new Q(e,t,n,i),this.g.push(t,e))},i.Aa=function(e,t,n,i){var r=this;this.D(e,t,(function i(a){r.Ja(e,t,i),n(a)}),i)},i.Ja=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.Ja(),this.g.remove(t,r))},i.Ra=function(){if(this.g){for(var e=[],t=l(this.g.g.values()),n=t.next();!n.done;n=t.next())e.push.apply(e,c(n.value));for(t=(e=l(e)).next();!t.done;t=e.next())t.value.Ja();this.g.g.clear()}},F("shaka.util.EventManager",$),$.prototype.removeAll=$.prototype.Ra,$.prototype.unlisten=$.prototype.Ja,$.prototype.listenOnce=$.prototype.Aa,$.prototype.listen=$.prototype.D,$.prototype.release=$.prototype.release,Q.prototype.Ja=function(){this.target.removeEventListener(this.type,this.listener,this.g),this.listener=this.target=null,this.g=!1};var Z=void 0;function ee(e){this.h=e,this.g=void 0}function te(){return re.value()}F("shaka.config.AutoShowText",{NEVER:0,ALWAYS:1,IF_PREFERRED_TEXT_LANGUAGE:2,IF_SUBTITLES_MAY_BE_NEEDED:3}),ee.prototype.value=function(){return void 0===this.g&&(this.g=this.h()),this.g};var ne=null,ie=null,re=new ee((function(){var e=void 0;return ne&&(e=ne()),!e&&ie&&(e=ie()),e}));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){q([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,ce=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");function de(e){var t;e instanceof de?(he(this,e.cc),this.ed=e.ed,pe(this,e.Cb),fe(this,e.vd),this.ob=e.ob,ge(this,e.g.clone()),this.Nc=e.Nc):e&&(t=String(e).match(ce))?(he(this,t[1]||"",!0),this.ed=me(t[2]||""),pe(this,t[3]||"",!0),fe(this,t[4]),this.ob=me(t[5]||"",!0),ge(this,t[6]||"",!0),this.Nc=me(t[7]||"")):this.g=new Ae(null)}function he(e,t,n){e.cc=n?me(t,!0):t,e.cc&&(e.cc=e.cc.replace(/:$/,""))}function pe(e,t,n){e.Cb=n?me(t,!0):t}function fe(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.vd=t}else e.vd=null}function ge(e,t,n){t instanceof Ae?e.g=t:(n||(t=ve(t,xe)),e.g=new Ae(t))}function me(e,t){return e?t?decodeURI(e):decodeURIComponent(e):""}function ve(e,t,n){return null!=e?(e=encodeURI(e).replace(t,ye),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function ye(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}(i=de.prototype).cc="",i.ed="",i.Cb="",i.vd=null,i.ob="",i.Nc="",i.toString=function(){var e=[],t=this.cc;if(t&&e.push(ve(t,be,!0),":"),t=this.Cb){e.push("//");var n=this.ed;n&&e.push(ve(n,be,!0),"@"),e.push(encodeURIComponent(t).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(t=this.vd)&&e.push(":",String(t))}return(t=this.ob)&&(this.Cb&&"/"!=t.charAt(0)&&e.push("/"),e.push(ve(t,"/"==t.charAt(0)?Te:we,!0))),(t=this.g.toString())&&e.push("?",t),(t=this.Nc)&&e.push("#",ve(t,Se)),e.join("")},i.resolve=function(e){var t=this.clone();"data"===t.cc&&(t=new de);var n=!!e.cc;n?he(t,e.cc):n=!!e.ed,n?t.ed=e.ed:n=!!e.Cb,n?pe(t,e.Cb):n=null!=e.vd;var i=e.ob;if(n)fe(t,e.vd);else if(n=!!e.ob){if("/"!=i.charAt(0))if(this.Cb&&!this.ob)i="/"+i;else{var r=t.ob.lastIndexOf("/");-1!=r&&(i=t.ob.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.ob=i:n=""!==e.g.toString(),n?ge(t,e.g.clone()):n=!!e.Nc,n&&(t.Nc=e.Nc),t},i.clone=function(){return new de(this)};var be=/[#\/\?@]/g,we=/[#\?:]/g,Te=/[#\?]/g,xe=/[#\?@]/g,Se=/#/g;function Ae(e){this.g=e||null}function ke(e){if(!e.fb&&(e.fb=new Map,e.Ld=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 Ee(e){return ke(e),e.Ld}function Ie(){}function Ce(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=De(e);t=De(t);for(var i=0;i<e.byteLength;i++)if(n[i]!=t[i])return!1;return!0}function Me(e){return ArrayBuffer.isView(e)?0==e.byteOffset&&e.byteLength==e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer:e}function De(e,t,n){return Le(e,void 0===t?0:t,n=void 0===n?1/0:n,Uint8Array)}function Pe(e,t,n){return Le(e,void 0===t?0:t,n=void 0===n?1/0:n,Uint16Array)}function Re(e,t,n){return Le(e,void 0===t?0:t,n=void 0===n?1/0:n,DataView)}function Le(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 Ne(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,Oe)try{throw Error(this.message||"Shaka Error")}catch(e){this.stack=e.stack}}(i=Ae.prototype).fb=null,i.Ld=null,i.add=function(e,t){ke(this),this.g=null;var n=this.fb.has(e)?this.fb.get(e):null;return n||this.fb.set(e,n=[]),n.push(t),this.Ld++,this},i.set=function(e,t){return ke(this),this.g=null,this.fb.has(e)?this.fb.set(e,[t]):this.add(e,t),this},i.get=function(e){return ke(this),this.fb.get(e)||[]},i.toString=function(){if(this.g)return this.g;if(!this.fb||!this.fb.size)return"";for(var e=[],t=l(this.fb.keys()),n=t.next();!n.done;n=t.next()){var i=n.value;n=encodeURIComponent(i),i=this.fb.get(i);for(var r=0;r<i.length;r++){var a=n;""!==i[r]&&(a+="="+encodeURIComponent(i[r])),e.push(a)}}return this.g=e.join("&")},i.clone=function(){var e=new Ae;if(e.g=this.g,this.fb){for(var t=new Map,n=l(this.fb),i=n.next();!i.done;i=n.next()){var r=l(i.value);i=r.next().value,r=r.next().value,t.set(i,r.concat())}e.fb=t,e.Ld=this.Ld}return e},F("shaka.util.BufferUtils",Ie),Ie.toDataView=Re,Ie.toUint16=Pe,Ie.toUint8=De,Ie.toArrayBuffer=Me,Ie.equal=Ce,Ne.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")},F("shaka.util.Error",Ne);var Oe=!0;function je(){}function Ue(t){if(!t)return"";if(239==(t=De(t))[0]&&187==t[1]&&191==t[2]&&(t=t.subarray(3)),e.TextDecoder&&!te().ph())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 _e(e,t,n){if(!e)return"";if(!n&&0!=e.byteLength%2)throw new Ne(2,2,2004);n=Math.floor(e.byteLength/2);var i=new Uint16Array(n);e=Re(e);for(var r=0;r<n;r++)i[r]=e.getUint16(2*r,t);return He(i)}function Be(e){function t(e){return n.byteLength<=e||9<=n[e]&&126>=n[e]}if(!e)return"";var n=De(e);if(239==n[0]&&187==n[1]&&191==n[2])return Ue(n);if(254==n[0]&&255==n[1])return _e(n.subarray(2),!1);if(255==n[0]&&254==n[1])return _e(n.subarray(2),!0);if(0==n[0]&&0==n[2])return _e(e,!1);if(0==n[1]&&0==n[3])return _e(e,!0);if(t(0)&&t(1)&&t(2)&&t(3))return Ue(e);throw new Ne(2,2,2003)}function Fe(t){if(e.TextEncoder&&!te().ph()){var n=new TextEncoder;return Me(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 Me(n)}function Ve(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 He(e){return Ge.value()(e)}function Ke(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||""}Ne.Severity={RECOVERABLE:1,CRITICAL:2},Ne.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9,ADS:10},Ne.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,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,STREAMING_NOT_ALLOWED:3024,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,CANNOT_ADD_EXTERNAL_CHAPTERS_TO_LIVE_STREAM: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,MISSING_EME_SUPPORT:6020,LOAD_INTERRUPTED:7e3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,OBJECT_DESTROYED:7003,CONTENT_NOT_LOADED:7004,SRC_EQUALS_PRELOAD_NOT_SUPPORTED:7005,PRELOAD_DESTROYED:7006,QUEUE_INDEX_OUT_OF_BOUNDS:7007,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},F("shaka.util.StringUtils",je),je.resetFromCharCode=function(){Ge.g=void 0},je.toUTF16=Ve,je.toUTF8=Fe,je.fromBytesAutoDetect=Be,je.fromUTF16=_e,je.fromUTF8=Ue;var Ge=new ee((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={Hc:65536};0<t.Hc;(t={Hc:t.Hc}).Hc/=2)if(e(t.Hc))return function(e){return function(t){for(var n="",i=0;i<t.length;i+=e.Hc)n+=String.fromCharCode.apply(null,t.subarray(i,i+e.Hc));return n}}(t);return null}));function ze(){}function qe(e){return e=He(De(e)),btoa(e)}function Xe(e,t){return t=null==t||t,e=qe(e).replace(/\+/g,"-").replace(/\//g,"_"),t?e:e.replace(/[=]*$/,"")}function We(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 Ye(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 Je(e){var t=De(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 $e(){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(De(r),n),n+=r.byteLength}return t}function Qe(e,t,n){if(n=void 0===n?"":n,0==t.length)return e;if(1==e.length&&1==t.length){var i=new de(e[0]);return t=new de(t[0]),t=i.resolve(t),n&&ge(t,n),[t.toString()]}t=t.map((function(e){return new de(e)})),i=[];for(var r=(e=l(e)).next();!r.done;r=e.next()){r=new de(r.value);for(var a=l(t),o=a.next();!o.done;o=a.next())o=r.resolve(o.value),n&&ge(o,n),i.push(o.toString())}return i}function Ze(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 et(t,n){n=void 0===n?"cenc":n;var i=[],r=[],a=[];t.forEach((function(e,t){var n=t;22!=n.length&&(n=Xe(Ye(t),!1));var o=e;22!=o.length&&(o=Xe(Ye(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:De(Fe(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 tt(e,t){if(1==t.length)return t[0];if(null!=(e=nt(e,t)))return e;throw new Ne(2,4,4025,t)}function nt(e,t){for(var n=st.get(e),i=(n=l(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==rt?"":null}function it(e,t){for(var n=[],i=(e=l(e=st.get(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}F("shaka.util.Uint8ArrayUtils",ze),ze.concat=$e,ze.toHex=Je,ze.fromHex=Ye,ze.fromBase64=We,ze.toBase64=Xe,ze.toStandardBase64=qe;var rt="text",at={Ca:"video",ea:"audio",Ta:rt,Tf:"image",hl:"application"},ot=1/15,st=(new Map).set("audio",[/^vorbis$/,/^Opus$/,/^opus$/,/^fLaC$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4/,/^dts[cex]$/,/^iamf/,/^mhm[12]/,/^ac3$/,/^eac3$/,/^apac$/]).set("video",[/^avc/,/^hev/,/^hvc/,/^vvc/,/^vvi/,/^vp0?[89]/,/^av01/,/^dvh/,/^dva/,/^dav/]).set("text",[/^vtt$/,/^wvtt/,/^stpp/]);function ut(e,t,n,i){this.g=null,this.l=e,this.i=t,this.m=n,this.o=i,this.j=!1;e:{if("undefined"==typeof libDPIModule&&q("Could not find LCEVC Library dependencies on this page"),"undefined"!=typeof LCEVCdec)this.h=LCEVCdec;else{if("undefined"==typeof LcevcDil){q("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?(q("Could not find LCEVC Library on this page"),e=!1):(this.h.SupportObject.SupportStatus||q(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 lt(e,t,n,i){"video"!==i.type||e.o&&!i.baseOriginalId||e.g&&e.g.appendBuffer(t,"video",i.id,-n,!e.o)}function ct(e){e.g&&e.i.classList.add("shaka-hidden")}function dt(e){return!(!e||"undefined"==typeof LCEVCdec)&&"lvc1"==e.codecs}function ht(t){if(gt.has(t))return gt.get(t);var n=e.ManagedMediaSource||e.MediaSource;return!!n&&(n=n.isTypeSupported(t),gt.set(t,n),n)}function pt(){var t=e.ManagedSourceBuffer||e.SourceBuffer;return!!t&&!!t.prototype&&!!t.prototype.changeType}function ft(){var t=e.ManagedMediaSource||e.MediaSource;return!!(t&&t.prototype&&t.prototype.setLiveSeekableRange&&t.prototype.clearLiveSeekableRange)}ut.prototype.release=function(){this.g&&(this.g.close(),this.g=null)},F("shaka.lcevc.Dec",ut),ut.prototype.release=ut.prototype.release;var gt=new Map;function mt(){}function vt(){}function yt(){}function bt(e){this.h=new Map,this.i=0,this.j=new vt,(e=Tt(e.toLowerCase()))&&(this.j=e()),this.g=new mt,(e=St)&&(this.g=e(),this.h.set(this.i,this.g))}function wt(e,t){xt.set(e,t)}function Tt(e){return xt.get(e)}mt.prototype.extract=function(){},mt.prototype.decode=function(){return[]},mt.prototype.clear=function(){},mt.prototype.getStreams=function(){return[]},vt.prototype.init=function(){},vt.prototype.parse=function(){return[]},(i=yt.prototype).init=function(){},i.vf=function(){},i.Fd=function(){},i.remove=function(){},i.Uf=function(){},F("shaka.media.IClosedCaptionParser",yt),(i=bt.prototype).init=function(e,t,n){if(t=void 0!==t&&t,-1!=(n=void 0===n?-1:n)&&this.i!=n){t=n;var i=this.h.get(t);this.h.set(this.i,this.g),i?this.g=i:((i=St)&&(this.g=i()),this.h.set(t,this.g))}else t||this.Fd();this.j.init(e),-1!=n&&(this.i=n)},i.vf=function(e){for(var t=(e=l(e=this.j.parse(e))).next();!t.done;t=e.next()){var n=De((t=t.value).packet);0<n.length&&this.g.extract(n,t.pts)}return this.g.decode()},i.Fd=function(){this.g.clear()},i.remove=function(e){e=void 0===e?[]:e,e=new Set(e);for(var t=l(this.h.keys()),n=t.next();!n.done;n=t.next())if(n=n.value,!e.has(n)){var i=this.h.get(n);i&&i.clear(),this.h.delete(n)}},i.Uf=function(){return this.g.getStreams()},F("shaka.media.ClosedCaptionParser",bt),bt.findDecoder=function(){return St},bt.unregisterDecoder=function(){St=null},bt.registerDecoder=function(e){St=e},bt.findParser=Tt,bt.unregisterParser=function(e){xt.delete(e)},bt.registerParser=wt;var xt=new Map,St=null;function At(){this.id="",this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0,this.height=this.width=100,this.viewportAnchorUnits=this.widthUnits=this.heightUnits=kt,this.scroll=Et}F("shaka.text.CueRegion",At);var kt=1;At.units={PX:0,PERCENTAGE:kt,LINES:2};var Et="";function It(e,t){return!("number"!=typeof e||"number"!=typeof t||!isNaN(e)||!isNaN(t))||e===t}function Ct(e,t){-1<(t=e.indexOf(t))&&e.splice(t,1)}function Mt(e,t,n){if(n||(n=It),e.length!=t.length)return!1;t=t.slice();for(var i=(e=l(e)).next(),r={};!i.done;r={ei:void 0},i=e.next()){if(r.ei=i.value,-1==(i=t.findIndex(function(e){return function(t){return n(e.ei,t)}}(r))))return!1;t[i]=t[t.length-1],t.pop()}return 0==t.length}function Dt(e,t,n){if(e===t)return!0;if(!e||!t)return e==t;if(n||(n=It),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 Pt(e){this.h=e||"",this.g=0}function Rt(e){Lt(e,/[ \t]+/gm)}function Lt(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 Nt(e){return e.g==e.h.length?null:(e=Lt(e,/[^ \t\n]*/gm))?e[0]:null}function Ot(e){if(null==(e=Lt(e,Ut)))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 jt(e){return e?Ot(new Pt(e)):null}At.scrollMode={NONE:Et,UP:"up"};var Ut=/(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;function _t(){}function Bt(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=Array.isArray(n);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 Ft(e){var t,n={};for(t in e)n[t]=e[t];return n}function Vt(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=Vt(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=Vt(r))&&t.push(i+":"+r);e="{"+t.join(",")+"}"}else e=JSON.stringify(e);return e}function Ht(e,t){var n=void 0!==n&&n;return Kt(e=Be(e),t,n)}function Kt(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 p=e.charCodeAt(i);if(64<p&&91>p||96<p&&123>p){p=n();for(var f=e.charCodeAt(i);f&&39!==f&&34!==f&&!(64<f&&91>f||96<f&&123>f)&&62!==f;)i++,f=e.charCodeAt(i);var g=i+1;if(i=e.indexOf(e[i],g),g=e.slice(g,i),39===f||34===f){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(p.startsWith("xmlns:")){f=g;var m=p.split(":")[1];bn.set(f,m),wn.set(m,f)}"tt"===d&&"xml:space"===p&&"preserve"===g&&(l=!0),h[p]=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(p=u[h])?t&&(p.parent=l):h==d-1&&"\n"==p&&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 Gt(e){return bn.has(e)?bn.get(e):""}function zt(e){return"string"==typeof e}function qt(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 Xt(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 Wt(e){return"string"==typeof e?Ke(e):""===(e=e.children.reduce((function(e,t){return"string"==typeof t?e+t:e}),""))?null:Ke(e)}function Yt(e){return Array.from(e.children).every((function(e){return"string"==typeof e}))?((e=Wt(e))&&(e=e.trim()),e):null}function Jt(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())Jt(i.value,t,n);return n}function $t(e,t){return 1!=(e=Xt(e,t)).length?null:e[0]}function Qt(e,t,n){return 1!=(e=tn(e,t,n)).length?null:e[0]}function Zt(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 en(e,t,n){return t=Gt(t),e.attributes[t+":"+n]||null}function tn(e,t,n){var i=Gt(t);if(t=[],e.children)for(n=i?i+":"+n:n,i=(e=l(e.children)).next();!i.done;i=e.next())(i=i.value)&&i.tagName===n&&t.push(i);return t}function nn(e,t,n){for(var i=(t=l(t)).next();!i.done;i=t.next())if(i=en(e,i.value,n))return i;return null}function rn(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 an(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)?)?$","i").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 on(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 sn(e){return 0==(e=Number(e))%1?e:null}function un(e){return 0==(e=Number(e))%1&&0<e?e:null}function ln(e){return 0==(e=Number(e))%1&&0<=e?e:null}function cn(e){return e=Number(e),isNaN(e)?null:e}function dn(e){return!!e&&"true"===e.toLowerCase()}function hn(e){var t,n=(t=e.match(/^(\d+)\/(\d+)$/))?Number(t[1])/Number(t[2]):Number(e);return isNaN(n)?null:n}function pn(e){for(var t=[],n=(e=l(e=Ke(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,wc:n.split("/@")[1]||null})}else n.startsWith("@")&&t.length&&(t[t.length-1].wc=n.slice(1))}return t}function fn(e,t){var n=pn(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=gn(e,"t",i.t)),null!==i.n&&(n=gn(e,"n",i.n))),null===n?n="prepend"===r?0:e.length:"prepend"===r?--n:"after"===r&&++n,r=t.tagName,(i=i.wc)&&e[n]?mn(e[n],r,i,Yt(t)||""):("remove"!==r&&"replace"!==r||e.splice(n,1),"add"!==r&&"replace"!==r||e.splice.apply(e,[n,0].concat(c(t.children))))}}function gn(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 mn(e,t,n,i){"remove"===t?delete e.attributes[n]:"add"!==t&&"replace"!==t||(e.attributes[n]=i)}function vn(e){var t="",n=e.tagName.split(":");for(var i in 0<n.length&&(t=n[0],t=wn.has(t)?wn.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):vn(i),t.appendChild(n);return t}function yn(e){if(!e)return null;for(var t={tagName:e.tagName,attributes:Ft(e.attributes),children:[],parent:null},n=(e=l(e.children)).next();!n.done;n=e.next())"string"==typeof(n=n.value)||((n=yn(n)).parent=t),t.children.push(n);return t}F("shaka.util.ObjectUtils",_t),_t.alphabeticalKeyOrderStringify=Vt,_t.shallowCloneObject=Ft,_t.cloneObject=Bt;var bn=new Map,wn=new Map;function Tn(e,t,n){this.startTime=e,this.endTime=t,this.payload=n,this.region=new At,this.position=null,this.positionAlign=Cn,this.size=0,this.textAlign=Mn,this.direction=Ln,this.writingMode=Nn,this.lineInterpretation=On,this.line=null,this.lineHeight="",this.lineAlign=jn,this.displayAlign=Pn,this.fontSize=this.border=this.backgroundImage=this.backgroundColor=this.color="",this.fontWeight=Fn,this.fontStyle=Hn,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 xn(e,t){return(e=new Tn(e,t,"")).lineBreak=!0,e}function Sn(e,t){if(e.payload!=t.payload||!(.001>Math.abs(e.startTime-t.startTime)&&.001>Math.abs(e.endTime-t.endTime)))return!1;for(var n in e)if("startTime"!=n&&"endTime"!=n&&"payload"!=n)if("nestedCues"==n){if(!Dt(e.nestedCues,t.nestedCues,Sn))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(!Dt(e[n],t[n]))return!1}else if(e[n]!=t[n])return!1;return!0}function An(e,t){t=void 0===t?new Map:t;var n=e.payload;if(n.includes("<")){0===t.size&&kn(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(qn)&&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=Kt("<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())En(n.value,e,t);else e.payload=Ke(n);else e.payload=Ke(n)}else e.payload=Ke(n)}function kn(e){for(var t=l(Object.entries(_n)),n=t.next();!n.done;n=t.next()){var i=l(n.value);n=i.next().value,i=i.next().value;var r=new Tn(0,0,"");r.color=i,e.set("."+n,r)}for(n=(t=l(Object.entries(Bn))).next();!n.done;n=t.next())n=(i=l(n.value)).next().value,i=i.next().value,(r=new Tn(0,0,"")).backgroundColor=i,e.set("."+n,r)}function En(e,t,n){var i=t.clone();if(i.nestedCues=[],i.payload="",i.rubyTag="",i.line=null,i.region=new At,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=In(o.backgroundColor,s.backgroundColor),s.color=In(o.color,s.color),s.fontFamily=In(o.fontFamily,s.fontFamily),s.fontSize=In(o.fontSize,s.fontSize),s.textShadow=In(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=xn(i.startTime,i.endTime),void t.nestedCues.push(i);case"b":i.fontWeight=Vn;break;case"i":i.fontStyle=Kn;break;case"u":i.textDecoration.push(zn);break;case"font":(a=e.attributes.color)&&(i.color=a);break;case"div":if(!(a=e.attributes.time))break;(a=jt(a))&&(i.startTime=a);break;case"ruby":case"rp":case"rt":i.rubyTag=a}}if(r=e.children,zt(e)||1==r.length&&zt(r[0]))for(n=Wt(e).split("\n"),e=!0,r=(n=l(n)).next();!r.done;r=n.next())r=r.value,e||(e=xn(i.startTime,i.endTime),t.nestedCues.push(e)),0<r.length&&((e=i.clone()).payload=Ke(r),t.nestedCues.push(e)),e=!1;else for(t.nestedCues.push(i),e=(t=l(r)).next();!e.done;e=t.next())En(e.value,i,n)}function In(e,t){return e&&0<e.length?e:t}Tn.prototype.clone=function(){var e,t=new Tn(0,0,"");for(e in this)t[e]=this[e],Array.isArray(t[e])&&(t[e]=t[e].slice());return t},F("shaka.text.Cue",Tn),Tn.parseCuePayload=An,Tn.equal=Sn,Tn.prototype.clone=Tn.prototype.clone;var Cn="auto";Tn.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:Cn};var Mn="center",Dn={LEFT:"left",RIGHT:"right",CENTER:Mn,START:"start",END:"end"};Tn.textAlign=Dn;var Pn="after",Rn={BEFORE:"before",CENTER:"center",AFTER:Pn};Tn.displayAlign=Rn;var Ln="ltr";Tn.direction={HORIZONTAL_LEFT_TO_RIGHT:Ln,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var Nn="horizontal-tb";Tn.writingMode={HORIZONTAL_TOP_TO_BOTTOM:Nn,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};var On=0;Tn.lineInterpretation={LINE_NUMBER:On,PERCENTAGE:1};var jn="start",Un={CENTER:"center",START:jn,END:"end"};Tn.lineAlign=Un;var _n={white:"white",lime:"lime",cyan:"cyan",red:"red",yellow:"yellow",magenta:"magenta",blue:"blue",black:"black"};Tn.defaultTextColor=_n;var Bn={bg_white:"white",bg_lime:"lime",bg_cyan:"cyan",bg_red:"red",bg_yellow:"yellow",bg_magenta:"magenta",bg_blue:"blue",bg_black:"black"};Tn.defaultTextBackgroundColor=Bn;var Fn=400,Vn=700;Tn.fontWeight={NORMAL:Fn,BOLD:Vn};var Hn="normal",Kn="italic",Gn={NORMAL:Hn,ITALIC:Kn,OBLIQUE:"oblique"};Tn.fontStyle=Gn;var zn="underline";Tn.textDecoration={UNDERLINE:zn,LINE_THROUGH:"lineThrough",OVERLINE:"overline"};var qn=/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g;function Xn(){}function Wn(e,t,n){Jn.set(e.toLowerCase().split(";")[0]+"-"+n,{priority:n,wf:t})}function Yn(e,t){for(var n=e.toLowerCase().split(";")[0],i=l([ei,Zn,Qn,$n]),r=i.next();!r.done;r=i.next())if(r=Jn.get(n+"-"+r.value)){var a=r.wf(),o=a.isSupported(e,t);if(a.destroy(),o)return r.wf}return null}Xn.prototype.destroy=function(){},F("shaka.transmuxer.TransmuxerEngine",Xn),Xn.findTransmuxer=Yn,Xn.unregisterTransmuxer=function(e,t){Jn.delete(e.toLowerCase().split(";")[0]+"-"+t)},Xn.registerTransmuxer=Wn,Xn.prototype.destroy=Xn.prototype.destroy;var Jn=new Map,$n=1,Qn=2,Zn=3,ei=4;function ti(){}function ni(e,t){var n=e;return t&&!hi.includes(e)&&(n+='; codecs="'+t+'"'),n}function ii(e,t){return t&&(e+='; codecs="'+t+'"'),e}function ri(e,t,n){var i=ni(e,t);return Yn(t=ii(e,t))?(e=Yn(t))?(n=(e=e()).convertCodecs(n,t),e.destroy()):n=t:n="video/mp2t"!=e&&"audio"==n?i.replace("video","audio"):i,n}function ai(e){return e.split(";")[0].split("/")[1]}function oi(e){var t=di(e);switch(e=t[0].toLowerCase(),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:case"ac3"===e:case"ac-3"===e:return"ac-3";case"mp4a"===e&&"a6"===t:case"eac3"===e:case"ec-3"===e:return"ec-3";case"ac-4"===e:return"ac-4";case"mp4a"===e&&"b2"===t:return"dtsx";case"mp4a"===e&&"a9"===t:return"dtsc";case"vp09"===e:case"vp9"===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 si(e){for(var t=[],n=(e=l(e.split(","))).next();!n.done;n=e.next())n=di(n.value),t.push(n[0]);return t.sort().join(",")}function ui(e){return e.split(";")[0]}function li(e){return(e=e.split(/ *; */)).shift(),(e=e.find((function(e){return e.startsWith("codecs=")})))?e.split("=")[1].replace(/^"|"$/g,""):""}function ci(e){return"application/x-mpegurl"===e||"application/vnd.apple.mpegurl"===e}function di(e){var t=(e=e.split("."))[0];return e.shift(),[t,e.join(".")]}Xn.PluginPriority={FALLBACK:$n,PREFERRED_SECONDARY:Qn,PREFERRED:Zn,APPLICATION:ei},F("shaka.util.MimeUtils",ti),ti.getFullTypeWithAllCodecs=ii,ti.getFullType=ni,(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");var hi=["audio/aac","audio/ac3","audio/ec3","audio/mpeg"];function pi(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 fi(e,t){bi.set(e,t)}function gi(e){return bi.get(e)}function mi(e){return!!bi.has(e)||("application/cea-608"==e||"application/cea-708"==e)&&!!St}function vi(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 yi(e,t,n){t.startTime+=n,t.endTime+=n;for(var i=(t=l(t.nestedCues)).next();!i.done;i=t.next())yi(e,i.value,n)}pi.prototype.destroy=function(){return this.j=this.i=null,this.o.clear(),Promise.resolve()},pi.prototype.remove=function(e,t){var n=this;return R((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",pi),pi.prototype.destroy=pi.prototype.destroy,pi.findParser=gi,pi.unregisterParser=function(e){bi.delete(e)},pi.registerParser=fi;var bi=new Map;function wi(e){this.h=e,this.g=null}function Ti(e){this.h=e,this.g=null}function xi(e,t){return e.concat(t)}function Si(){}function Ai(e){return null!=e}function ki(e,t){return Promise.race([t,new Promise((function(t,n){new Ti(n).ia(e)}))])}function Ei(){}function Ii(e,t){return e=Di(e),t=Di(t),e.split("-")[0]==t.split("-")[0]}function Ci(e,t){return e=Di(e),t=Di(t),e=e.split("-"),t=t.split("-"),e[0]==t[0]&&1==e.length&&2==t.length}function Mi(e,t){return e=Di(e),t=Di(t),e=e.split("-"),t=t.split("-"),2==e.length&&2==t.length&&e[0]==t[0]}function Di(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=Oi.get(t)||t,((n=n.toUpperCase())?t+"-"+n:t)+(e?"-"+e:"")}function Pi(e,t){return e=Di(e),(t=Di(t))==e?4:Ci(t,e)?3:Mi(t,e)?2:Ci(e,t)?1:0}function Ri(e){var t=e.indexOf("-");return e=(e=0<=t?e.substring(0,t):e).toLowerCase(),Oi.get(e)||e}function Li(e){return e.language?Di(e.language):e.audio&&e.audio.language?Di(e.audio.language):e.video&&e.video.language?Di(e.video.language):"und"}function Ni(e,t){e=Di(e);for(var n=new Set,i=(t=l(t)).next();!i.done;i=t.next())n.add(Di(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(Ci(i=i.value,e))return i;for(i=(t=l(n)).next();!i.done;i=t.next())if(Mi(i=i.value,e))return i;for(t=(n=l(n)).next();!t.done;t=n.next())if(Ci(e,t=t.value))return t;return null}wi.prototype.ia=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},wi.prototype.stop=function(){this.g&&(this.g(),this.g=null)},Ti.prototype.Jb=function(){return this.stop(),this.h(),this},Ti.prototype.ia=function(e){var t=this;return this.stop(),this.g=new wi((function(){t.h()})).ia(e),this},Ti.prototype.Fa=function(e){var t=this;return this.stop(),this.g=new wi((function(){t.g.ia(e),t.h()})).ia(e),this},Ti.prototype.stop=function(){this.g&&(this.g.stop(),this.g=null)},F("shaka.util.Timer",Ti),Ti.prototype.stop=Ti.prototype.stop,Ti.prototype.tickEvery=Ti.prototype.Fa,Ti.prototype.tickAfter=Ti.prototype.ia,Ti.prototype.tickNow=Ti.prototype.Jb,F("shaka.util.LanguageUtils",Ei),Ei.findClosestLocale=Ni,Ei.getLocaleForVariant=Li,Ei.getLocaleForText=function(e){return Di(e.language||"und")},Ei.getBase=Ri,Ei.relatedness=Pi,Ei.areSiblings=function(e,t){var n=Ri(e),i=Ri(t);return e!=n&&t!=i&&n==i},Ei.normalize=Di,Ei.isSiblingOf=Mi,Ei.isParentOf=Ci,Ei.areLanguageCompatible=Ii,Ei.areLocaleCompatible=function(e,t){return(e=Di(e))==Di(t)};var Oi=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 ji(){}function Ui(e,t,n,i,r){function a(e){var t=String(e.width||"")+String(e.height||"")+String(Math.round(e.frameRate||0))+(e.hdr||"")+e.fastSwitching;return e.dependencyStream&&(t+=e.dependencyStream.baseOriginalId||""),t}if(r.length){for(var o=e.textStreams,s=(r=l(r)).next(),u={};!s.done;u={xh:void 0},s=r.next())if(u.xh=s.value,(s=o.filter(function(e){return function(t){return!(!t.codecs.startsWith(e.xh)&&!t.mimeType.startsWith(e.xh))}}(u))).length){o=s;break}e.textStreams=o}if(o=e.variants,(t.length||n.length)&&(o=function(e,t,n){for(var i=(t=l(t)).next(),r={};!i.done;r={videoCodec:void 0},i=t.next())if(r.videoCodec=i.value,i=e.filter(function(e){return function(t){return t.video&&t.video.codecs.startsWith(e.videoCodec)}}(r)),i.length){e=i;break}for(t=(n=l(n)).next(),i={};!t.done;i={audioCodec:void 0},t=n.next())if(i.audioCodec=t.value,t=e.filter(function(e){return function(t){return t.audio&&t.audio.codecs.startsWith(e.audioCodec)}}(i)),t.length){e=t;break}return e}(o,t,n)),i.length){for(t=new J,o=(n=l(o)).next();!o.done;o=n.next())o=o.value,t.push(String(o.video.width||0),o);var d=[];t.forEach((function(e,t){e=0;for(var n=[],r=(t=l(t)).next(),a={};!r.done;a={Rf:void 0},r=t.next())a.Rf=r.value,(r=i.filter(function(e){return function(t){return e.Rf.decodingInfos[0][t]}}(a)).length)>e?(e=r,n=[a.Rf]):r==e&&n.push(a.Rf);d.push.apply(d,c(n))})),o=d}for(n=new Set,t=new Set,r=(o=l(o)).next();!r.done;r=o.next())(r=r.value).audio&&n.add(r.audio),r.video&&t.add(r.video);o=Array.from(n).sort((function(e,t){return e.bandwidth-t.bandwidth}));var h,p,f=[];for(n=new Map,r=(o=l(o)).next();!r.done;r=o.next()){if(p=void 0,p=(h=r=r.value).language+(h.channelsCount||0)+(h.audioSamplingRate||0)+h.roles.join(",")+h.label+h.groupId+h.fastSwitching,h.dependencyStream&&(p+=h.dependencyStream.baseOriginalId||""),s=p,(u=n.get(s)||[]).length){var g=u[u.length-1],m=oi(g.codecs),v=oi(r.codecs);m!=v||r.bandwidth&&g.bandwidth&&!(r.bandwidth>g.bandwidth)||(u.push(r),f.push(r.id))}else u.push(r),f.push(r.id);n.set(s,u)}var y={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};o=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=oi(e.codecs),i=oi(t.codecs);if(n!=i)return(y[n]||1)-(y[i]||1)}return e.width-t.width}return e.bandwidth-t.bandwidth})),t=pt();var b=[];for(n=new Map,r=(o=l(o)).next();!r.done;r=o.next()){if(s=a(r=r.value),(u=n.get(s)||[]).length){if(g=u[u.length-1],!t&&(m=oi(g.codecs))!==(v=oi(r.codecs)))continue;(m=oi(g.codecs))!=(v=oi(r.codecs))||r.bandwidth&&g.bandwidth&&!(r.bandwidth>g.bandwidth)||(u.push(r),b.push(r.id))}else u.push(r),b.push(r.id);n.set(s,u)}e.variants=e.variants.filter((function(e){var t=e.audio;return e=e.video,!(t&&!f.includes(t.id)||e&&!b.includes(e.id))}))}function _i(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 Bi(e,t,n,i,r){var a,o;return R((function(s){if(1==s.g)return te().Pi()&&function(e){for(var t=(new Map).set("dvav","avc3").set("dva1","avc1").set("dvhe","hev1").set("dvh1","hvc1").set("dvc1","vvc1").set("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(t)).next();!r.done;r=i.next()){var a=l(r.value);if(r=a.next().value,a=a.next().value,e.codecs.includes(r)){e.codecs=e.codecs.replace(r,a);break}}}}(t.variants),w(s,Hi(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=te(),r="Xbox"===i.Ob();i="MOBILE"===i.La()&&"GECKO"===i.Da();var a=e.video,o=a&&a.width||0,s=a&&a.height||0;return!(r&&a&&(1920<o||1080<s)&&(a.codecs.includes("avc1.")||a.codecs.includes("avc3."))||(r=a&&a.dependencyStream)&&!dt(r)||(e=e.audio,i&&e&&e.encrypted&&e.codecs.toLowerCase().includes("opus")||e&&e.dependencyStream))}(e,a,r);if(!t){var n=[];e.audio&&n.push(ir(e.audio)),e.video&&n.push(ir(e.video))}return t})),T(s)}))}function Fi(e,t){var n,i,r,a,o,s,u;return R((function(c){if(1==c.g){for(n=function(e,t){if(e){var n=Ft(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,Ke:void 0},o=a.next())u=o.value,s.Ke=Vt(u),s.cache=or,s.cache.has(s.Ke)?i=n(i,s.cache.get(s.Ke)):r.push(Vi(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.set(e.Ke,r),i=n(i,r))}}(s)));return w(c,Promise.all(r),2)}i&&e.decodingInfos.push(i),T(c)}))}function Vi(e){var t=[""];e.video&&(t=li(e.video.contentType).split(","));var n=[""];e.audio&&(n=li(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={Mc:void 0},o=a.next())o=o.value,s.Mc=Bt(e),e.video&&(s.Mc.video.contentType=ni(ui(s.Mc.video.contentType),r)),e.audio&&(s.Mc.audio.contentType=ni(ui(s.Mc.audio.contentType),o)),i.push(new Promise(function(e){return function(t,n){("MOBILE"==te().La()?ki(5,navigator.mediaCapabilities.decodingInfo(e.Mc)):navigator.mediaCapabilities.decodingInfo(e.Mc)).then((function(e){t(e)})).catch(n)}}(s)))}return Promise.all(i).catch((function(){return JSON.stringify(e),null}))}function Hi(e,t,n,i){var r,a,o,s,u,c,d,h,p,f,g,m,v,y,b,T,x,S;return R((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.ui=a.value,s=!1,u=l(e),c=u.next();case 5:if(c.done){A.u(7);break}d=c.value,h=Ki(d,t,n).filter((k=o,function(e){return((e=e[0]).keySystemConfiguration&&e.keySystemConfiguration.keySystem)===k.ui})),p=l(h),f=p.next();case 8:if(f.done){A.u(10);break}return g=f.value,w(A,Fi(d,g),9);case 9:f=p.next(),A.u(8);break;case 10:d.decodingInfos.some((function(e){return e.supported}))&&(s=!0),c=u.next(),A.u(5);break;case 7:if(s)return A.return();o={ui: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=Ki(y,t,n).filter((function(e){return!(e=(e=e[0]).keySystemConfiguration&&e.keySystemConfiguration.keySystem)||!i.includes(e)})),T=l(b),x=T.next();case 15:if(x.done){v=m.next(),A.u(12);break}return S=x.value,w(A,Fi(y,S),16);case 16:x=T.next(),A.u(15)}var k}))}function Ki(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=li(u=u.value);if(c.includes(",")&&!i){var d=c.split(","),h=ui(u);c=tt("video",d),h=ri(h,d=Gi(d=tt("audio",d),h),"audio"),o.push({contentType:h,channels:2,bitrate:e.bandwidth||1,samplerate:1,spatialRendering:!1})}if(c=zi(c),u={contentType:ri(ui(u),c,"video"),width:r.width||64,height:r.height||64,bitrate:r.bandwidth||e.bandwidth||1,framerate:r.frameRate||30},r.hdr)switch(r.hdr){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=ri(u=ui(c=u.value),c=Gi(li(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,h=n.get(u),c=new Map,d=(h=l(h)).next();!d.done;d=h.next()){var p=(d=d.value).videoRobustness+","+d.audioRobustness;c.get(p)||c.set(p,[]),c.get(p).push(d)}for(h=(c=l(c.values())).next();!h.done;h=c.next()){h=h.value,d=[];for(var f=(p=l(s)).next();!f.done;f=p.next()){f=Object.assign({},f.value);for(var g={keySystem:u,initDataType:"cenc",persistentState:o,distinctiveIdentifier:"optional",sessionTypes:t},m=l(h),v=m.next();!v.done;v=m.next()){if((v=v.value).initData&&v.initData.length){for(var y=new Set,b=l(v.initData),w=b.next();!w.done;w=b.next())y.add(w.value.initDataType);g.initDataType=v.initData[0].initDataType}v.distinctiveIdentifierRequired&&(g.distinctiveIdentifier="required"),v.persistentStateRequired&&(g.persistentState="required"),v.sessionType&&(g.sessionTypes=[v.sessionType]),i&&(g.audio?(v.encryptionScheme&&(g.audio.encryptionScheme=g.audio.encryptionScheme||v.encryptionScheme),g.audio.robustness=g.audio.robustness||v.audioRobustness):(g.audio={robustness:v.audioRobustness},v.encryptionScheme&&(g.audio.encryptionScheme=v.encryptionScheme)),""==g.audio.robustness&&delete g.audio.robustness),r&&(g.video?(v.encryptionScheme&&(g.video.encryptionScheme=g.video.encryptionScheme||v.encryptionScheme),g.video.robustness=g.video.robustness||v.videoRobustness):(g.video={robustness:v.videoRobustness},v.encryptionScheme&&(g.video.encryptionScheme=v.encryptionScheme)),""==g.video.robustness&&delete g.video.robustness)}f.keySystemConfiguration=g,d.push(f)}e.push(d)}}return e}function Gi(e,t){var n=te();return"flac"==e.toLowerCase()?"WEBKIT"!=n.Da()?"flac":"fLaC":"opus"===e.toLowerCase()?"WEBKIT"!=n.Da()?"opus":"mp4"==ai(t)?"Opus":"opus":"ac-3"==e.toLowerCase()&&n.ee()?"ec-3":e}function zi(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 qi(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=t?t.groupId:null,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),p=h.next();!p.done;p=h.next())d.add(p.value);if(n)for(p=(h=l(n.roles)).next();!p.done;p=h.next())d.add(p.value);if(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:"",audioCodec:a,videoCodec:o,primary:e.primary,roles:Array.from(d),audioRoles:null,forced:!1,videoId:null,audioId:null,audioGroupId:s,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,(i=n.dependencyStream)&&(e.width=i.width||e.width,e.height=i.height||e.height,e.videoCodec=i.codecs||e.videoCodec),o.includes(","))){e.channelsCount=n.channelsCount,e.audioSamplingRate=n.audioSamplingRate,e.spatialAudio=n.spatialAudio,e.originalLanguage=n.originalLanguage,e.audioMimeType=r,n=o.split(",");try{e.videoCodec=tt("video",n),e.audioCodec=tt("audio",n)}catch(e){}}return 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,t=t.dependencyStream)&&(e.audioCodec=t.codecs||e.audioCodec),t=[],e.videoCodec&&t.push(e.videoCodec),e.audioCodec&&t.push(e.audioCodec),e.codecs=t.join(", "),e}function Xi(e){return{id:e.id,active:!1,type:rt,bandwidth:e.bandwidth||0,language:e.language,label:e.label,kind:e.kind||null,mimeType:e.mimeType,codecs:e.codecs||null,primary:e.primary,roles:e.roles,accessibilityPurpose:e.accessibilityPurpose,forced:e.forced,originalTextId:e.originalId,originalLanguage:e.originalLanguage}}function Wi(e){var t=e.width||null,n=e.height||null,i=null;e.segmentIndex&&(i=Pu(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,type:"image",bandwidth:e.bandwidth||0,width:t,height:n,mimeType:e.mimeType,codecs:e.codecs||null,tilesLayout:r||null,originalImageId:e.originalId}}function Yi(e){return e.__shaka_id||(e.__shaka_id=sr++),e.__shaka_id}function Ji(e){var t={id:Yi(e),active:"disabled"!=e.mode,type:rt,bandwidth:0,language:Di(e.language||"und"),label:e.label,kind:e.kind,mimeType:null,codecs:null,primary:!1,roles:[],accessibilityPurpose:null,forced:"forced"==e.kind,originalTextId:e.id,originalLanguage:e.language};return"captions"==e.kind&&(t.mimeType="unknown"),"subtitles"==e.kind&&(t.mimeType="text/vtt"),e.kind&&(t.roles=[e.kind]),t}function $i(e,t){var n=e?e.language:null;if(n={id:Yi(e||t),active:e?e.enabled:t.selected,type:"variant",bandwidth:0,language:Di(n||"und"),label:e?e.label:null,kind:e?e.kind:null,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:!!e&&"main"==e.kind,roles:[],forced:!1,audioRoles:null,videoId:null,audioId:null,audioGroupId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:t?t.id:null,originalAudioId:e?e.id:null,originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:n},e&&e.kind&&(n.roles=[e.kind],n.audioRoles=[e.kind]),e&&e.configuration&&(e.configuration.codec&&(n.audioCodec=e.configuration.codec,n.codecs=n.audioCodec),e.configuration.bitrate&&(n.audioBandwidth=e.configuration.bitrate,n.bandwidth+=n.audioBandwidth),e.configuration.sampleRate&&(n.audioSamplingRate=e.configuration.sampleRate),e.configuration.numberOfChannels&&(n.channelsCount=e.configuration.numberOfChannels)),t&&t.configuration&&(t.configuration.codec&&(n.videoCodec=t.configuration.codec,n.codecs=n.codecs?n.codecs+","+n.videoCodec:n.videoCodec),t.configuration.bitrate&&(n.videoBandwidth=t.configuration.bitrate,n.bandwidth+=n.videoBandwidth),t.configuration.framerate&&(n.frameRate=t.configuration.framerate),t.configuration.width&&(n.width=t.configuration.width),t.configuration.height&&(n.height=t.configuration.height),t.configuration.colorSpace&&t.configuration.colorSpace.transfer))switch(t.configuration.colorSpace.transfer){case"pq":n.hdr="PQ";break;case"hlg":n.hdr="HLG";break;case"bt709":n.hdr="SDR"}return n}function Qi(e){return e.allowedByApplication&&e.allowedByKeySystem&&0==e.disabledUntilTime}function Zi(e){return e.filter((function(e){return Qi(e)}))}function er(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=Ni(Di(t),e.map((function(e){return e.language})));s&&(r=e.filter((function(e){return Di(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(xi,[]),e.length?tr(r,e[0]):r}function tr(e,t){return e.filter((function(e){return e.roles.includes(t)}))}function nr(e,t){t.length&&(t=t.filter((function(t){return oi(e.codecs)==oi(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 ir(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"}function rr(e,t,n){if(0==n.autoShowText)return!1;if(1==n.autoShowText)return!0;var i=Di(n.preferredTextLanguage);return t=Di(t.language),2==n.autoShowText?Ii(t,i):3==n.autoShowText?!!e&&(e=Di(e.language),Ii(t,i)&&!Ii(e,t)):(q("Invalid autoShowText setting!"),!1)}function ar(e){for(var t={id:0,language:"und",disabledUntilTime:0,primary:!1,audio:null,video:null,bandwidth:100,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},n=(e=l(e)).next();!n.done;n=e.next()){var i={id:0,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:(n=n.value)?ui(n):"",codecs:n?li(n):"",encrypted:!0,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:"video",primary:!1,trickModeVideo:null,dependencyStream: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,baseOriginalId:null};i.fullMimeTypes.add(ni(i.mimeType,i.codecs)),n.startsWith("audio/")?(i.type="audio",t.audio=i):t.video=i}return t}F("shaka.util.StreamUtils",ji),ji.meetsRestrictions=_i;var or=new Map,sr=0,ur=(new Map).set("image/svg+xml",!0).set("image/png",!0).set("image/jpeg",!0).set("image/jpg",!0),lr=(new Map).set("image/webp","data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA").set("image/avif","data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=");function cr(){var t=this;this.G=null,this.o=!1,this.m=new K,this.j=new $,navigator.connection&&navigator.connection.addEventListener&&this.j.D(navigator.connection,"change",(function(){if(t.o&&t.g.useNetworkInformation){t.m=new K,t.g&&t.m.configure(t.g.advanced);var e=t.chooseVariant();e&&navigator.onLine&&t.G(e,t.g.clearBufferSwitch,t.g.safeMarginSwitch)}})),this.F=[],this.H=1,this.I=!1,this.h=this.l=this.g=this.s=null,this.A=new Ti((function(){if(t.o&&(t.g.restrictToElementSize||t.g.restrictToScreenSize)){var e=t.chooseVariant();e&&t.G(e,t.g.clearBufferSwitch,t.g.safeMarginSwitch)}})),this.B=e,"documentPictureInPicture"in e&&this.j.D(e.documentPictureInPicture,"enter",(function(){t.B=e.documentPictureInPicture.window,t.A&&t.A.Jb(),t.j.Aa(t.B,"pagehide",(function(){t.B=e,t.A&&t.A.Jb()}))})),this.C=this.i=null}function dr(e){if(!e.I){var t=e.m;if(!(t.g>=t.i))return;e.I=!0,e.s-=1e3*(e.g.switchInterval-e.g.minTimeToSwitch)}Date.now()-e.s<1e3*e.g.switchInterval||(t=e.chooseVariant(),e.getBandwidthEstimate(),t&&e.G(t,e.g.clearBufferSwitch,e.g.safeMarginSwitch))}function hr(e,t,n,i,r){if(e.C){var a=e.C.Yh();a&&(n=n.filter((function(e){return!e.bandwidth||!a||e.bandwidth<=a})))}return t&&(n=n.filter((function(e){return _i(e,t,{width:r,height:i})}))),n.sort((function(e,t){return e.bandwidth-t.bandwidth}))}(i=cr.prototype).stop=function(){this.G=null,this.o=!1,this.F=[],this.H=1,this.l=this.s=null,this.h&&(this.h.disconnect(),this.h=null),this.A.stop(),this.C=this.i=null},i.release=function(){this.j.release(),this.A=null},i.init=function(e){this.G=e},i.chooseVariant=function(){var e=1/0,t=1/0;if(this.g.restrictToScreenSize){var n=this.g.ignoreDevicePixelRatio?1:this.B.devicePixelRatio;e=this.B.screen.height*n,t=this.B.screen.width*n}if(this.h&&this.g.restrictToElementSize){n=this.g.ignoreDevicePixelRatio?1:this.B.devicePixelRatio;var i=this.l.clientHeight,r=this.l.clientWidth;this.i&&document.pictureInPictureElement&&document.pictureInPictureElement==this.l&&(i=this.i.height,r=this.i.width),e=Math.min(e,i*n),t=Math.min(t,r*n)}if((n=this.F.filter((function(e){return e&&!(e.audio&&e.audio.fastSwitching||e.video&&e.video.fastSwitching)}))).length||(n=this.F),i=n,n.length!=this.F.length&&(i=this.F.filter((function(e){return e&&!!(e.audio&&e.audio.fastSwitching||e.video&&e.video.fastSwitching)}))),n=hr(this,this.g.restrictions,i,1/0,1/0),1/0!=e||1/0!=t){for(n=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}))}(n),r=(n=l(n)).next();!r.done;r=n.next())if((r=r.value).height>=e&&r.width>=t){e=r.height,t=r.width;break}n=hr(this,this.g.restrictions,i,e,t)}for(e=this.getBandwidthEstimate(),i.length&&!n.length&&(n=[(n=hr(this,null,i,1/0,1/0))[0]]),t=n[0]||null,i=0;i<n.length;i++){r=n[i];for(var a=isNaN(this.H)?1:Math.abs(this.H),o=a*r.bandwidth/this.g.bandwidthDowngradeTarget,s={bandwidth:1/0},u=i+1;u<n.length;u++)if(r.bandwidth!=n[u].bandwidth){s=n[u];break}a=a*s.bandwidth/this.g.bandwidthUpgradeTarget,e>=o&&e<=a&&(t.bandwidth!=r.bandwidth||t.bandwidth==r.bandwidth&&t.video&&r.video&&(t.video.width<r.video.width||t.video.height<r.video.height))&&(t=r)}return this.s=Date.now(),t},i.enable=function(){this.o=!0},i.disable=function(){this.o=!1},i.segmentDownloaded=function(e,t,n,i){var r=e;this.g.removeLatencyFromFirstPacketTime&&i&&1===i.packetNumber&&i.timeToFirstByte&&(r=e-i.timeToFirstByte),r>=this.g.cacheLoadThreshold&&this.m.sample(r,t),n&&null!=this.s&&this.o&&dr(this)},i.trySuggestStreams=function(){null!=this.s&&this.o&&dr(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.m.getBandwidthEstimate(e),this.C?this.C.getBandwidthEstimate(e):e)},i.setVariants=function(e){this.F=e},i.playbackRateChanged=function(e){this.H=e},i.setMediaElement=function(t){function n(){i.A.ia(pr)}var i=this;this.l=t,this.h&&(this.h.disconnect(),this.h=null),this.l&&"ResizeObserver"in e&&(this.h=new ResizeObserver(n),this.h.observe(this.l)),this.j.D(t,"enterpictureinpicture",(function(e){e.pictureInPictureWindow&&(i.i=e.pictureInPictureWindow,i.j.D(i.i,"resize",n))})),this.j.D(t,"leavepictureinpicture",(function(){i.i&&i.j.Ja(i.i,"resize",n),i.i=null}))},i.setCmsdManager=function(e){this.C=e},i.configure=function(e){this.g=e,this.m&&this.g&&this.m.configure(this.g.advanced)},F("shaka.abr.SimpleAbrManager",cr),cr.prototype.configure=cr.prototype.configure,cr.prototype.setCmsdManager=cr.prototype.setCmsdManager,cr.prototype.setMediaElement=cr.prototype.setMediaElement,cr.prototype.playbackRateChanged=cr.prototype.playbackRateChanged,cr.prototype.setVariants=cr.prototype.setVariants,cr.prototype.getBandwidthEstimate=cr.prototype.getBandwidthEstimate,cr.prototype.trySuggestStreams=cr.prototype.trySuggestStreams,cr.prototype.segmentDownloaded=cr.prototype.segmentDownloaded,cr.prototype.disable=cr.prototype.disable,cr.prototype.enable=cr.prototype.enable,cr.prototype.chooseVariant=cr.prototype.chooseVariant,cr.prototype.init=cr.prototype.init,cr.prototype.release=cr.prototype.release,cr.prototype.stop=cr.prototype.stop;var pr=1;function fr(e,t){if(e===t||!e.length||!t.length)return!0;for(var n=(e=l(e)).next();!n.done;n=e.next()){if(yr(n=n.value))return!0;for(var i=l(t),r=i.next();!r.done;r=i.next())if(r=r.value,n.keySystem===r.keySystem||yr(r))return!0}return!1}function gr(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}yr(i)?n.push(i):yr(a)&&n.push(a)}}return n}function mr(e){return!!e&&!!e.match(/^com\.(microsoft|chromecast)\.playready/)}function vr(e){return!!e&&!!e.match(/^com\.apple\.fps/)}function yr(e){return!!(e=e.licenseServerUri)&&e.startsWith("data:application/json;base64,")}F("shaka.config.CrossBoundaryStrategy",{KEEP:"keep",RESET:"reset",RESET_TO_ENCRYPTED:"reset_to_encrypted",RESET_ON_ENCRYPTION_CHANGE:"RESET_ON_ENCRYPTION_CHANGE"});var br=new ee((function(){return Me(new Uint8Array([0]))})),wr=new Map;function Tr(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 xr(e){var t,n;return R((function(i){if(1==i.g){if(e.g>=e.l){if(!e.i)throw new Ne(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 Ti(e).ia(n/1e3)})),2))}e.h*=e.m,T(i)}))}function Sr(){var e,t,n=new Promise((function(n,i){e=n,t=i}));return n.resolve=e,n.reject=t,n}function Ar(e,t){this.promise=e,this.i=t,this.g=null}function kr(e){return new Ar(Promise.reject(e),(function(){return Promise.resolve()}))}function Er(){var e=Promise.reject(new Ne(2,7,7001));return e.catch((function(){})),new Ar(e,(function(){return Promise.resolve()}))}function Ir(e){return new Ar(Promise.resolve(e),(function(){return Promise.resolve()}))}function Cr(e){return new Ar(e,(function(){return e.catch((function(){}))}))}function Mr(e){return new Ar(Promise.all(e.map((function(e){return e.promise}))),(function(){return Promise.all(e.map((function(e){return e.abort()})))}))}function Dr(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 Pr(e){var t,n=new Dr(e.type);for(t in e)Object.defineProperty(n,t,{value:e[t],writable:!0,enumerable:!0});return n}Sr.prototype.resolve=function(){},Sr.prototype.reject=function(){},Ar.prototype.abort=function(){return this.g||(this.g=this.i()),this.g},Ar.prototype.finally=function(e){return this.promise.then((function(){return e(!0)}),(function(){return e(!1)})),this},Ar.prototype.Va=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 Sr;a.catch((function(){}));var o=new Ne(2,7,7001);return this.promise.then(n(!0),n(!1)),new Ar(a,(function(){return i()}))},o.Object.defineProperties(Ar.prototype,{aborted:{configurable:!0,enumerable:!0,get:function(){return null!==this.g}}}),F("shaka.util.AbortableOperation",Ar),Ar.prototype.chain=Ar.prototype.Va,Ar.prototype.finally=Ar.prototype.finally,Ar.all=Mr,Ar.prototype.abort=Ar.prototype.abort,Ar.notAbortable=Cr,Ar.completed=Ir,Ar.aborted=Er,Ar.failed=kr,Dr.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)},Dr.prototype.stopImmediatePropagation=function(){this.g=!0},Dr.prototype.stopPropagation=function(){},F("shaka.util.FakeEvent",Dr);var Rr={jl:"abrstatuschanged",kl:"adaptation",ll:"audiotrackchanged",ol:"audiotrackschanged",ql:"boundarycrossed",rl:"buffering",ul:"canupdatestarttime",vl:"complete",wl:"currentitemchanged",xl:"downloadcompleted",yl:"downloadfailed",zl:"downloadheadersreceived",Al:"drmsessionupdate",Cl:"emsg",Il:"itemsinserted",Jl:"itemsremoved",Zl:"prft",Error:"error",Dl:"expirationupdated",El:"firstquartile",Fl:"gapjumped",Kl:"keystatuschanged",Ol:"loaded",Pl:"loading",Rl:"manifestparsed",Sl:"manifestupdated",Tl:"mediaqualitychanged",Ul:"mediasourcerecovered",Vl:"metadataadded",Metadata:"metadata",Wl:"midpoint",Xl:"nospatialvideoinfo",Yl:"onstatechange",$l:"ratechange",cm:"segmentappended",dm:"sessiondata",em:"spatialvideoinfo",fm:"stalldetected",gm:"started",hm:"statechanged",im:"streaming",jm:"textchanged",lm:"texttrackvisibility",mm:"thirdquartile",nm:"timelineregionadded",om:"timelineregionenter",pm:"timelineregionexit",qm:"trackschanged",sm:"unloading",um:"variantchanged"};function Lr(){this.Ya=new J,this.ze=this}function Nr(){this.g=[]}function Or(e,t){e.g.push(t.finally((function(){Ct(e.g,t)})))}function jr(e,t,n,i,r,a,o){Lr.call(this),this.i=null,this.j=!1,this.s=new Nr,this.g=new Set,this.h=new Set,this.o=e||null,this.m=t||null,this.A=n||null,this.B=i||null,this.C=r||null,this.G=a||null,this.F=o||null,this.l=new Map}function Ur(e,t,n,i){i=void 0!==i&&i,n=n||zr;var r=qr.get(e);(!r||n>=r.priority)&&qr.set(e,{priority:n,wf:t,Ak:i})}function _r(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 Br(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 Fr(e,t,n,i,r,a,o,s){e.i.forceHTTP&&(n.uris[a]=n.uris[a].replace("https://","http://")),e.i.forceHTTPS&&(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 de(n.uris[a]),l=u.cc,c=!1;l||(he(u,l=(l=location.protocol).slice(0,-1)),n.uris[a]=u.toString()),l=l.toLowerCase();var d=(l=qr.get(l))?l.wf:null;if(!d)return kr(new Ne(2,1,1e3,u));var h=l.Ak;(u=e.l.get(u.Cb))&&(n.headers["common-access-token"]=u);var p,f=null,g=null,m=!1,v=!1;return Cr(xr(r)).Va((function(){if(e.j)return Er();p=Date.now();var r=0;n.requestStartTime=Date.now();var o=d(n.uris[a],n,t,(function(a,o,u){f&&f.stop(),g&&g.ia(l/1e3),e.o&&t==Gr&&(r++,n.packetNumber=r,e.o(a,o,Vr(i),n,i),c=!0,s.g=u)}),(function(i){v=!0,n.timeToFirstByte=Date.now()-n.requestStartTime,e.m&&e.m(i,n,t)}),{minBytesForProgressEvents:e.i.minBytesForProgressEvents});if(!h)return o;var u=n.retryParameters.connectionTimeout;u&&(f=new Ti((function(){m=!0,o.abort()}))).ia(u/1e3);var l=n.retryParameters.stallTimeout;return l&&(g=new Ti((function(){m=!0,o.abort()}))),o})).Va((function(i){f&&f.stop(),g&&g.stop(),null==i.timeMs&&(i.timeMs=Date.now()-p);var r=i.headers["common-access-token"];if(r){var a=new de(i.uri);e.l.set(a.Cb,r)}return r={response:i,$j:c},!v&&e.m&&e.m(i.headers,n,t),e.A&&e.A(n,i),r}),(function(u){if(f&&f.stop(),g&&g.stop(),e.B){var l=null,c=0;u instanceof Ne&&(l=u,1001==u.code&&(c=u.data[1])),e.B(n,l,c,m)}if(e.j)return Er();if(m&&(u=new Ne(1,1,1003,n.uris[a],t)),u instanceof Ne){if(7001==u.code)throw u;if(1010==u.code)throw o;if(1==u.severity){if((l=new Dr("retry",l=(new Map).set("error",u))).cancelable=!0,e.dispatchEvent(l),l.defaultPrevented)throw u;return a=(a+1)%n.uris.length,Fr(e,t,n,i,r,a,u,s)}}throw u}))}function Vr(e){if(e){var t=e.segment;if(e=e.stream,t&&e&&e.fastSwitching&&t.o)return!1}return!0}function Hr(){this.g=0}function Kr(e,t,n){Ar.call(this,e,t),this.h=n}Lr.prototype.addEventListener=function(e,t){this.Ya&&this.Ya.push(e,t)},Lr.prototype.removeEventListener=function(e,t){this.Ya&&this.Ya.remove(e,t)},Lr.prototype.dispatchEvent=function(e){if(!this.Ya)return!0;var t=this.Ya.get(e.type)||[],n=this.Ya.get("All");for(n&&(t=t.concat(n)),n=(t=l(t)).next();!n.done;n=t.next()){n=n.value,e.target=this.ze,e.currentTarget=this.ze;try{n.handleEvent?n.handleEvent(e):n.call(this,e)}catch(e){}if(e.g)break}return e.defaultPrevented},Lr.prototype.release=function(){this.Ya=null},Nr.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(jr,Lr),(i=jr.prototype).configure=function(e){this.i=e},i.Dk=function(e){this.g.add(e)},i.Zk=function(e){this.g.delete(e)},i.kj=function(){this.g.clear()},i.Ek=function(e){this.h.add(e)},i.$k=function(e){this.h.delete(e)},i.lj=function(){this.h.clear()},i.Mh=function(){this.l.clear()},i.destroy=function(){return this.j=!0,this.g.clear(),this.h.clear(),this.l.clear(),Lr.prototype.release.call(this),this.s.destroy()},i.request=function(e,t,n){var i=this,r=new Hr;if(this.j){var a=Promise.reject(new Ne(2,7,7001));return a.catch((function(){})),new Kr(a,(function(){return Promise.resolve()}),r)}t.method=t.method||"GET",t.headers=t.headers||{},t.retryParameters=t.retryParameters?Bt(t.retryParameters):{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4},t.uris=Bt(t.uris),a=function(e,t,n,i){function r(e){a=a.Va((function(){return n.body&&(n.body=Me(n.body)),e(t,n,i)}))}var a=Ir(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.Va(void 0,(function(e){if(e instanceof Ne&&7001==e.code)throw e;throw new Ne(2,1,1006,e)}))}(this,e,t,n);var o=a.Va((function(){return Fr(i,e,t,n,new Tr(t.retryParameters,!1),0,null,r)})),s=o.Va((function(t){return function(e,t,n,i){for(var r=Ir(void 0),a=(e=l(e.h)).next(),o={};!a.done;o={Di:void 0},a=e.next())o.Di=a.value,r=r.Va(function(e){return function(){var r=n.response;return r.data&&(r.data=Me(r.data)),(0,e.Di)(t,r,i)}}(o));return r.Va((function(){return n}),(function(e){var t=2;if(e instanceof Ne){if(7001==e.code)throw e;t=e.severity}throw new Ne(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.Va((function(r){var a=Date.now()-d,o=r.response;return o.timeMs+=c,o.timeMs+=a,r.$j||!i.o||o.fromCache||"HEAD"==t.method||e!=Gr||i.o(o.timeMs,o.data.byteLength,Vr(n),t,n),i.F&&i.F(e,o,n),o}),(function(e){throw e&&(e.severity=2),e}));return a=new Kr(h.promise,(function(){return h.abort()}),r),Or(this.s,a),a},F("shaka.net.NetworkingEngine",jr),jr.prototype.request=jr.prototype.request,jr.prototype.destroy=jr.prototype.destroy,jr.makeRequest=Br,jr.defaultRetryParameters=function(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4}},jr.prototype.clearCommonAccessTokenMap=jr.prototype.Mh,jr.prototype.clearAllResponseFilters=jr.prototype.lj,jr.prototype.unregisterResponseFilter=jr.prototype.$k,jr.prototype.registerResponseFilter=jr.prototype.Ek,jr.prototype.clearAllRequestFilters=jr.prototype.kj,jr.prototype.unregisterRequestFilter=jr.prototype.Zk,jr.prototype.registerRequestFilter=jr.prototype.Dk,jr.unregisterScheme=function(e){qr.delete(e)},jr.registerScheme=Ur,jr.prototype.configure=jr.prototype.configure,jr.NumBytesRemainingClass=Hr,m(Kr,Ar),jr.PendingRequest=Kr;var Gr=1;jr.RequestType={MANIFEST:0,SEGMENT:Gr,LICENSE:2,APP:3,TIMING:4,SERVER_CERTIFICATE:5,KEY:6,ADS:7,CONTENT_STEERING:8},jr.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 zr=3;jr.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:zr};var qr=new Map;function Xr(e){this.g=!1,this.h=new Sr,this.i=e}function Wr(e,t){if(e.g){if(t instanceof Ne&&7003==t.code)throw t;throw new Ne(2,7,7003,t)}}function Yr(e,t){for(var n=[],i=(e=l(e)).next();!i.done;i=e.next())n.push(t(i.value));return n}function Jr(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 $r(e){var t={};return e.forEach((function(e,n){t[n]=e})),t}function Qr(e,t){this.h=Re(e),this.i=t==ea,this.g=0}function Zr(){return new Ne(2,3,3e3)}Xr.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=Qr.prototype).Ga=function(){return this.g<this.h.byteLength},i.Ma=function(){return this.g},i.getLength=function(){return this.h.byteLength},i.X=function(){try{var e=this.h.getUint8(this.g);return this.g+=1,e}catch(e){throw Zr()}},i.Ba=function(){try{var e=this.h.getUint16(this.g,this.i);return this.g+=2,e}catch(e){throw Zr()}},i.T=function(){try{var e=this.h.getUint32(this.g,this.i);return this.g+=4,e}catch(e){throw Zr()}},i.Yg=function(){try{var e=this.h.getInt32(this.g,this.i);return this.g+=4,e}catch(e){throw Zr()}},i.yd=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 Zr()}if(2097151<t)throw new Ne(2,3,3001);return this.g+=8,t*Math.pow(2,32)+e},i.Ub=function(e){if(this.g+e>this.h.byteLength)throw Zr();var t=De(this.h,this.g,e);return this.g+=e,t},i.skip=function(e){if(this.g+e>this.h.byteLength)throw Zr();this.g+=e},i.Ei=function(e){if(this.g<e)throw Zr();this.g-=e},i.seek=function(e){if(0>e||e>this.h.byteLength)throw Zr();this.g=e},i.Vc=function(){for(var e=this.g;this.Ga()&&0!=this.h.getUint8(this.g);)this.g+=1;return e=De(this.h,e,this.g-e),this.g+=1,Ue(e)},F("shaka.util.DataViewReader",Qr),Qr.prototype.readTerminatedString=Qr.prototype.Vc,Qr.prototype.seek=Qr.prototype.seek,Qr.prototype.rewind=Qr.prototype.Ei,Qr.prototype.skip=Qr.prototype.skip,Qr.prototype.readBytes=Qr.prototype.Ub,Qr.prototype.readUint64=Qr.prototype.yd,Qr.prototype.readInt32=Qr.prototype.Yg,Qr.prototype.readUint32=Qr.prototype.T,Qr.prototype.readUint16=Qr.prototype.Ba,Qr.prototype.readUint8=Qr.prototype.X,Qr.prototype.getLength=Qr.prototype.getLength,Qr.prototype.getPosition=Qr.prototype.Ma,Qr.prototype.hasMoreData=Qr.prototype.Ga;var ea=1;function ta(){this.i=new Map,this.h=new Map,this.g=!1}function na(e){for(var t=la(e);e.reader.Ga()&&!e.parser.g;)e.parser.td(e.start+t,e.reader,e.partialOkay,e.stopOnPartial)}function ia(e){for(var t=la(e),n=e.reader.T(),i=0;i<n&&(e.parser.td(e.start+t,e.reader,e.partialOkay,e.stopOnPartial),!e.parser.g);i++);}function ra(e){var t=la(e);for(e.reader.skip(78);e.reader.Ga()&&!e.parser.g;)e.parser.td(e.start+t,e.reader,e.partialOkay,e.stopOnPartial)}function aa(e){var t=la(e);e.reader.skip(8);var n=e.reader.Ba();for(e.reader.skip(6),2==n?e.reader.skip(48):e.reader.skip(12),1==n&&e.reader.skip(16);e.reader.Ga()&&!e.parser.g;)e.parser.td(e.start+t,e.reader,e.partialOkay,e.stopOnPartial)}function oa(e){return function(t){e(t.reader.Ub(t.reader.getLength()-t.reader.Ma()))}}function sa(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 ua(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)}function la(e){return 8+(e.has64BitSize?8:0)+(null!=e.flags?4:0)}Qr.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:ea},(i=ta.prototype).box=function(e,t){return e=sa(e),this.i.set(e,ca),this.h.set(e,t),this},i.R=function(e,t){return e=sa(e),this.i.set(e,da),this.h.set(e,t),this},i.stop=function(){this.g=!0},i.parse=function(e,t,n){for(e=new Qr(e,0),this.g=!1;e.Ga()&&!this.g;)this.td(0,e,t,n)},i.td=function(e,t,n,i){var r=t.Ma();if(i&&r+8>t.getLength())this.g=!0;else{var a=t.T(),o=t.T(),s=ua(o),u=!1;switch(a){case 0:a=t.getLength()-r;break;case 1:if(i&&t.Ma()+8>t.getLength())return void(this.g=!0);a=t.yd(),u=!0}var l=this.h.get(o);if(l){var c=null,d=null;if(this.i.get(o)==da){if(i&&t.Ma()+4>t.getLength())return void(this.g=!0);c=(d=t.T())>>>24,d&=16777215}o=r+a,n&&o>t.getLength()&&(o=t.getLength()),i&&o>t.getLength()?this.g=!0:(o-=t.Ma(),l({name:s,parser:this,partialOkay:n||!1,stopOnPartial:i||!1,version:c,flags:d,reader:t=new Qr(t=0<o?t.Ub(o):new Uint8Array(0),0),size:a,start:r+e,has64BitSize:u}))}else t.skip(Math.min(r+a-t.Ma(),t.getLength()-t.Ma()))}},F("shaka.util.Mp4Parser",ta),ta.headerSize=la,ta.typeToString=ua,ta.allData=oa,ta.audioSampleEntry=aa,ta.visualSampleEntry=ra,ta.sampleDescription=ia,ta.children=na,ta.prototype.parseNext=ta.prototype.td,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 ca=0,da=1;function ha(e){var t=this;this.g=[],this.h=[],this.data=[],(new ta).box("moov",na).box("moof",na).R("pssh",(function(e){if(!(1<e.version)){var n=De(e.reader.h,-12,e.size);if(t.data.push(n),t.g.push(Je(e.reader.Ub(16))),0<e.version){n=e.reader.T();for(var i=0;i<n;i++){var r=Je(e.reader.Ub(16));t.h.push(r)}}}})).parse(e)}function pa(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=Re(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=Ye(n.value),o.set(n,u),u+=n.length;return s.setUint32(u,r),o.set(e,u+4),o}function fa(e){var t=this;this.C=e,this.j=this.A=null,this.na=this.P=!1,this.I=0,this.g=null,this.o=new $,this.i=new Map,this.U=[],this.B=new Map,this.K=!1,this.l=new Sr,this.h=null,this.s=function(n){2==n.severity&&t.l.reject(n),e.onError(n)},this.ba=new Map,this.ka=new Map,this.L=new Ti((function(){return function(e){var t=e.ba,n=e.ka;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 Ne(2,6,6014)),e.C.rf($r(n))}(t)})),this.N=!1,this.M=[],this.W=!1,this.F=new Ti((function(){!function(e){e.i.forEach((function(t,n){var i=t.Tg,r=n.expiration;isNaN(r)&&(r=1/0),r!=i&&(e.C.onExpirationUpdated(n.sessionId,r),t.Tg=r)}))}(t)})),this.l.catch((function(){})),this.m=new Xr((function(){return function(e){return R((function(t){switch(t.g){case 1:return e.o.release(),e.o=null,e.l.reject(),e.F.stop(),e.F=null,e.L.stop(),e.L=null,w(t,Ca(e),2);case 2:if(!e.j){t.u(3);break}return x(t,4),w(t,e.j.setMediaKeys(null),6);case 6:A(t,5);break;case 4:k(t);case 5:e.j=null;case 3:e.g=null,e.A=null,e.B=new Map,e.h=null,e.s=function(){},e.C=null,e.ha=!1,e.H=null,T(t)}}))}(t)})),this.ha=!1,this.G=this.H=null,this.S=function(){return!1}}function ga(e,t,n,i){i=void 0===i||i,e.B=new Map;for(var r=(n=l(n)).next();!r.done;r=n.next())e.B.set(r.value,{initData:null,initDataType:null});for(r=(n=l(e.h.persistentSessionsMetadata)).next();!r.done;r=n.next())r=r.value,e.B.set(r.sessionId,{initData:r.initData,initDataType:r.initDataType});return e.N=0<e.B.size,ma(e,t,i)}function ma(e,t,n){var i,r,a,o,s,u,c,d,h,p,f,g,m,v,y,b,T;return R((function(x){if(1==x.g){for(Ra(e.h.clearKeys,t),i=t.some((function(e){return!!(e.video&&e.video.drmInfos.length||e.audio&&e.audio.drmInfos.length)})),r=Jr(e.h.servers),a=Jr(e.h.advanced||{}),!i&&n&&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,r),o=new WeakSet,s=l(t),u=s.next();!u.done;u=s.next())for(c=u.value,d=Ma(c),h=l(d),p=h.next();!p.done;p=h.next())f=p.value,o.has(f)||(o.add(f),Pa(f,r,a,e.h.keySystemsMapping));for(g=function(t,n){for(var i=[],r=(t=l(t)).next();!r.done;r=t.next()){var o,s=(r=r.value)[n]||a.has(r.keySystem)&&a.get(r.keySystem)[n]||"";if((o=""==s)&&(o=!!(o=r.keySystem)&&!!o.match(/^com\.widevine\.alpha/)),o&&("audioRobustness"==n?s=[e.h.defaultAudioRobustnessForWidevine]:"videoRobustness"==n&&(s=[e.h.defaultVideoRobustnessForWidevine])),"string"==typeof s)i.push(r);else if(Array.isArray(s))for(0===s.length&&(s=[""]),o=(s=l(s)).next();!o.done;o=s.next()){var u={};i.push(Object.assign({},r,(u[n]=o.value,u)))}}return i},m=new WeakSet,v=l(t),y=v.next();!y.done;y=v.next())(b=y.value).video&&!m.has(b.video)&&(b.video.drmInfos=g(b.video.drmInfos,"videoRobustness"),b.video.drmInfos=g(b.video.drmInfos,"audioRobustness"),m.add(b.video)),b.audio&&!m.has(b.audio)&&(b.audio.drmInfos=g(b.audio.drmInfos,"videoRobustness"),b.audio.drmInfos=g(b.audio.drmInfos,"audioRobustness"),m.add(b.audio));return w(x,Hi(t,e.N,e.ha,e.h.preferredKeySystems),2)}return Wr(e.m),i||0<r.size?(T=Ta(e,t),x.return(i?T:T.catch((function(){})))):(e.P=!0,x.return(Promise.resolve()))}))}function va(e){var t;return R((function(n){switch(n.g){case 1:if(e.j.mediaKeys)return n.return();if(!e.H){n.u(2);break}return w(n,e.H,3);case 3:return Wr(e.m),n.return();case 2:return x(n,4),e.H=e.j.setMediaKeys(e.A),w(n,e.H,6);case 6:A(n,5);break;case 4:t=k(n),e.s(new Ne(2,6,6003,t.message));case 5:Wr(e.m),T(n)}}))}function ya(e){var t,n,i,r;return R((function(a){if(1==a.g)return e.B.size?(e.B.forEach((function(t,n){Aa(e,n,t)})),w(a,e.l,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.ba.get(n.value))return!1;return!0}(e))return a.return(e.l);e.K=!1,e.l=new Sr,e.l.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 Da(e)&&e.l.resolve(),a.return(e.l)}))}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(Ce(n,r.value.initData))return;var a=!1;if(e.B.forEach((function(e){!a&&Ce(n,e.initData)&&(a=!0)})),a)return}e.K=!0,0<e.i.size&&Da(e)&&(e.l.resolve(),e.K=!1,e.l=new Sr,e.l.catch((function(){}))),function(e,t,n,i){try{var r=e.A.createSession(i)}catch(t){return void e.s(new Ne(2,6,6005,t.message))}e.o.D(r,"message",(function(t){e.j&&e.h.delayLicenseRequestUntilPlayed&&e.j.paused&&!e.W?e.M.push(t):ka(e,t)})),e.o.D(r,"keystatuseschange",(function(t){return Ea(e,t)})),e.i.set(r,{initData:n,initDataType:t,loaded:!1,Tg:1/0,Kb:null,type:i});try{n=e.h.initDataTransform(n,t,e.g)}catch(n){return t=n,n instanceof Ne||(t=new Ne(2,6,6016,n)),void e.s(t)}e.h.logLicenseExchange&&Xe(n),r.generateRequest(t,n).catch((function(t){if(!e.m.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 Ne(2,6,6006,t.message,t,i))}}))}(e,t,n,e.g.sessionType)}}function wa(e){return e=Yr(e=e.i.keys(),(function(e){return e.sessionId})),Array.from(e)}function Ta(t,n){var i,r,a,o,s,u;return R((function(d){switch(d.g){case 1:if(i=new Map,r=function(e,t,n){for(var i=l(t),r=i.next();!r.done;r=i.next())for(var a=(r=l(Ma(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 Ne(2,6,6e3);(i=e.h.preferredKeySystems).length||1==(r=Jr(e.h.servers)).size&&(i=Array.from(r.keys()));var o=(r=l(i)).next();for(a={};!o.done;a={wi:void 0},o=r.next()){a.wi=o.value;for(var s=(o=l(t)).next();!s.done;s=o.next())if(s=s.value.decodingInfos.find(function(e){return function(t){return t.supported&&null!=t.keySystemAccess&&t.keySystemAccess.keySystem==e.wi}}(a)))return s.keySystemAccess}for(a=(r=l([!0,!1])).next();!a.done;a=r.next())for(a=a.value,s=(o=l(t)).next();!s.done;s=o.next())for(var u=(s=l(s.value.decodingInfos)).next();!u.done;u=s.next())if((u=u.value).supported&&u.keySystemAccess){var c=u.keySystemAccess.keySystem;if(!i.includes(c)){var d=n.get(c);for(!d&&e.h.keySystemsMapping[c]&&(d=n.get(e.h.keySystemsMapping[c])),d=(c=l(d)).next();!d.done;d=c.next())if(!!d.value.licenseServerUri==a)return u.keySystemAccess}}return null}(t,n,i),!r){if(!navigator.requestMediaKeySystemAccess)throw new Ne(2,6,6020);throw new Ne(2,6,6001)}Wr(t.m),x(d,2),r.getConfiguration();var h=a=t.h.keySystemsMapping[r.keySystem]||r.keySystem,p=i.get(a),f=[],g=[],m=[],v=[],y=[],b=new Set,T=new Set;!function(t,n,i,r,a,o,s,u){for(var d=[],h=(t=l(t)).next(),p={};!h.done;p={Ha:void 0},h=t.next()){if(p.Ha=h.value,n.includes(p.Ha.encryptionScheme)||n.push(p.Ha.encryptionScheme),"org.w3.clearkey"==p.Ha.keySystem&&p.Ha.licenseServerUri.startsWith("data:application/json;base64,")?d.includes(p.Ha.licenseServerUri)||d.push(p.Ha.licenseServerUri):i.includes(p.Ha.licenseServerUri)||i.push(p.Ha.licenseServerUri),a.includes(p.Ha.serverCertificateUri)||a.push(p.Ha.serverCertificateUri),p.Ha.serverCertificate&&(r.some(function(e){return function(t){return Ce(t,e.Ha.serverCertificate)}}(p))||r.push(p.Ha.serverCertificate)),p.Ha.initData)for(var f=(h=l(p.Ha.initData)).next(),g={};!f.done;g={Kg:void 0},f=h.next())g.Kg=f.value,o.some(function(e){return function(t){var n=e.Kg;return!(!t.keyId||t.keyId!=n.keyId)||t.initDataType==n.initDataType&&Ce(t.initData,n.initData)}}(g))||o.push(g.Kg);if(p.Ha.keyIds)for(f=(h=l(p.Ha.keyIds)).next();!f.done;f=h.next())s.add(f.value);if(p.Ha.keySystemUris&&u)for(h=(p=l(p.Ha.keySystemUris)).next();!h.done;h=p.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))}}(p,f,g,v,m,y,b,T);var S=t.N?"persistent-license":"temporary";for(h={keySystem:h,encryptionScheme:f[0],licenseServerUri:g[0],distinctiveIdentifierRequired:p[0].distinctiveIdentifierRequired,persistentStateRequired:p[0].persistentStateRequired,sessionType:p[0].sessionType||S,audioRobustness:p[0].audioRobustness||"",videoRobustness:p[0].videoRobustness||"",serverCertificate:v[0],serverCertificateUri:m[0],initData:y,keyIds:b},0<T.size&&(h.keySystemUris=T),T=(p=l(p)).next();!T.done;T=p.next())(T=T.value).distinctiveIdentifierRequired&&(h.distinctiveIdentifierRequired=T.distinctiveIdentifierRequired),T.persistentStateRequired&&(h.persistentStateRequired=T.persistentStateRequired);if(t.g=h,!t.g.licenseServerUri)throw new Ne(2,6,6012,t.g.keySystem);return w(d,r.createMediaKeys(),4);case 4:if(o=d.h,Wr(t.m),t.A=o,""==t.h.minHdcpVersion||!("getStatusForPolicy"in t.A)){d.u(5);break}return x(d,6),w(d,t.A.getStatusForPolicy({minHdcpVersion:t.h.minHdcpVersion}),8);case 8:if("usable"!=d.h)throw new Ne(2,6,6018);Wr(t.m),A(d,5,2);break;case 6:if((s=k(d,2))instanceof Ne)throw s;throw new Ne(2,6,6019,s.message);case 5:return t.P=!0,t.F.Fa(t.h.updateExpirationTime),w(d,function(e){var t,n;return R((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=Br([e.g.serverCertificateUri],e.h.retryParameters),x(i,3),w(i,e.C.pc.request(5,t,{isPreload:e.S()}).promise,5);case 5:n=i.h,e.g.serverCertificate=De(n.data),A(i,4);break;case 3:throw new Ne(2,6,6017,k(i));case 4:if(e.m.g)return i.return();case 2:return e.g.serverCertificate&&e.g.serverCertificate.length?(x(i,6),w(i,e.A.setServerCertificate(e.g.serverCertificate),8)):i.return();case 8:A(i,0);break;case 6:throw new Ne(2,6,6004,k(i).message)}}))}(t),9);case 9:Wr(t.m),A(d,0);break;case 2:if(u=k(d),Wr(t.m,u),t.g=null,u instanceof Ne)throw u;throw new Ne(2,6,6002,u.message)}}))}function xa(e){Da(e)&&e.l.resolve()}function Sa(e,t){new Ti((function(){t.loaded=!0,xa(e)})).ia(Na)}function Aa(e,t,n){var i,r,a,o,s,u,l;return R((function(c){switch(c.g){case 1:try{i=e.A.createSession("persistent-license")}catch(t){return r=new Ne(2,6,6005,t.message),e.s(r),c.return(Promise.reject(r))}return e.o.D(i,"message",(function(t){e.j&&e.h.delayLicenseRequestUntilPlayed&&e.j.paused&&!e.W?e.M.push(t):ka(e,t)})),e.o.D(i,"keystatuseschange",(function(t){return Ea(e,t)})),a={initData:n.initData,initDataType:n.initDataType,loaded:!1,Tg:1/0,Kb:null,type:"persistent-license"},e.i.set(i,a),x(c,2),w(c,i.load(t),4);case 4:return o=c.h,Wr(e.m),o||(e.i.delete(i),s=e.h.persistentSessionOnlinePlayback?1:2,e.s(new Ne(s,6,6013)),a.loaded=!0),Sa(e,a),xa(e),c.return(i);case 2:u=k(c),Wr(e.m,u),e.i.delete(i),l=e.h.persistentSessionOnlinePlayback?1:2,e.s(new Ne(l,6,6005,u.message)),a.loaded=!0,xa(e);case 3:return c.return(Promise.resolve())}}))}function ka(e,t){var n,i,r,a,o,s,u,c,d,h,p,f,g,m;R((function(v){switch(v.g){case 1:if(n=t.target,e.h.logLicenseExchange&&Xe(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=Br([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("org.w3.clearkey"===e.g.keySystem){var y=o,b=e.g;try{var S=Be(y.body);if(S){var E=JSON.parse(S);E.type||(E.type=b.sessionType,y.body=Fe(JSON.stringify(E)))}}catch(e){}}if(mr(e.g.keySystem))if((y=_e(o.body,!0,!0)).includes("PlayReadyKeyMessage")){for(S=(b=l(b=Jt(y=Kt(y,"PlayReadyKeyMessage"),"HttpHeader"))).next();!S.done;S=b.next())S=Jt(E=S.value,"name")[0],E=Jt(E,"value")[0],o.headers[Wt(S)]=Wt(E);y=Jt(y,"Challenge")[0],o.body=We(Wt(y))}else o.headers["Content-Type"]="text/xml; charset=utf-8";return u=Date.now(),x(v,2),d=e.C.pc.request(2,o,{isPreload:e.S()}),e.U.push(d),w(v,d.promise,4);case 4:c=v.h,Ct(e.U,d),A(v,3);break;case 2:return h=k(v),e.m.g||(p=new Ne(2,6,6007,h),1==e.i.size?(e.s(p),i&&i.Kb&&i.Kb.reject(p)):(i&&i.Kb&&i.Kb.reject(p),e.i.delete(n),Da(e)&&(e.l.resolve(),e.L.ia(.1)))),v.return();case 3:return e.m.g?v.return():(e.I+=(Date.now()-u)/1e3,e.h.logLicenseExchange&&Xe(c.data),x(v,5),w(v,n.update(c.data),7));case 7:A(v,6);break;case 5:return f=k(v),g=new Ne(2,6,6008,f.message),e.s(g),i&&i.Kb&&i.Kb.reject(g),v.return();case 6:if(e.m.g)return v.return();m=new Dr("drmsessionupdate"),e.C.onEvent(m),i&&(i.Kb&&i.Kb.resolve(),Sa(e,i)),T(v)}}))}function Ea(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(a=te(),mr(e.g.keySystem)&&16==r.byteLength&&a.fh()){var o=(a=Re(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=Je(r).slice(0,32),e.ba.set(r,t)}));var r=t.expiration-Date.now();(0>r||i&&1e3>r)&&n&&!n.Kb&&(e.i.delete(t),Ia(t)),Da(e)&&(e.l.resolve(),e.L.ia(Oa))}function Ia(e){return R((function(t){return 1==t.g?(x(t,2),w(t,ki(La,Promise.all([e.close().catch((function(){})),e.closed])),4)):2!=t.g?A(t,0):(k(t),void T(t))}))}function Ca(e){var t;return R((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 R((function(t){return 1==t.g?(x(t,2),e.na||e.B.has(n.sessionId)||"persistent-license"!==i.type||e.h.persistentSessionOnlinePlayback?w(t,Ia(n),5):w(t,n.remove(),5)):2!=t.g?A(t,0):(k(t),void T(t))}))}))),0)}))}function Ma(e){return(e.video?e.video.drmInfos:[]).concat(e.audio?e.audio.drmInfos:[])}function Da(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 Pa(t,n,i,r){var a=t.keySystem;!a||"org.w3.clearkey"==a&&t.licenseServerUri||(n.size&&n.get(a)&&(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.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"))}function Ra(e,t){if(0!=(e=Jr(e)).size){e=et(e);for(var n=(t=l(t)).next();!n.done;n=t.next())(n=n.value).video&&(n.video.drmInfos=[e]),n.audio&&(n.audio.drmInfos=[e])}}(i=fa.prototype).destroy=function(){return this.m.destroy()},i.configure=function(e,t){this.h=e,t&&(this.S=t),this.F&&this.P&&this.g&&this.F.Fa(this.h.updateExpirationTime)},i.fc=function(e){var t,n=this;return R((function(i){if(1==i.g)return n.j===e?i.return():n.A?(n.j=e,n.o.Aa(n.j,"play",(function(){for(var e=l(n.M),t=e.next();!t.done;t=e.next())ka(n,t.value);n.W=!0,n.M=[]})),n.j.remote?(n.o.D(n.j.remote,"connect",(function(){return Ca(n)})),n.o.D(n.j.remote,"connecting",(function(){return Ca(n)})),n.o.D(n.j.remote,"disconnect",(function(){return Ca(n)}))):"webkitCurrentPlaybackTargetIsWireless"in n.j&&n.o.D(n.j,"webkitcurrentplaybacktargetiswirelesschanged",(function(){return Ca(n)})),n.G=n.g&&n.g.initData.find((function(e){return 0<e.initData.length}))||null,t=n.g.keySystem,te().Qg(t)||!(n.G||n.B.size||n.h.parseInbandPsshEnabled)?(n.o.D(n.j,"encrypted",(function(e){return function(e,t){return R((function(n){if(1==n.g)return w(n,va(e),2);ba(e,t.initDataType,De(t.initData)),T(n)}))}(n,e)})),i.u(2)):w(i,va(n),2)):(n.o.Aa(e,"encrypted",(function(){n.s(new Ne(2,6,6010))})),i.return());ya(n).catch((function(){})),T(i)}))},i.Eg=function(){var e=this,t=this.i.keys();return t=Yr(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.Pd=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.Te=function(){return $r(this.ka)};var La=1,Na=5,Oa=.5;function ja(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 Ua(e,t){if(e.mimeType!=t.mimeType)return!1;if(e=e.codecs.split(",").map((function(e){return si(e)})),t=t.codecs.split(",").map((function(e){return si(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 _a(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 Ba(){}function Fa(){this.g=Ha,this.i=(new Map).set(Ha,2).set(Va,1),this.h=0}ja.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&&!Ua(n,r))&&_a(n.roles,r.roles)&&n.groupId===r.groupId)}return!n&&(n=i.video&&e.video)&&(i=i.video,n=e.video,n=!((!t||Ua(i,n))&&_a(i.roles,n.roles))),!n&&(this.g.add(e),!0)},ja.prototype.values=function(){return this.g.values()},F("shaka.media.AdaptationSet",ja),F("shaka.config.CodecSwitchingStrategy",{RELOAD:"reload",SMOOTH:"smooth"}),Ba.prototype.create=function(){},Ba.prototype.configure=function(){},Ba.prototype.getConfiguration=function(){},F("shaka.media.AdaptationSetCriteria",Ba);var Va=0,Ha=1;function Ka(e,t,n){this.g=e,this.i=t,this.h=n}function Ga(e,t){return R((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,R((function(r){return 1==r.g?w(r,Bi(e,t,0<t.offlineSessionIds.length,n,i),2):(function(e){e.textStreams=e.textStreams.filter((function(e){return mi(e=ni(e.mimeType,e.codecs))}))}(t),w(r,function(e){var t,n,i,r,a,o,s;return R((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"),ur.has(a)){u.u(5);break}if(!(o=lr.get(a))){ur.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,ur.set(a,s);case 5:ur.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||Ui(t,e.g.preferredVideoCodecs,e.g.preferredAudioCodecs,e.g.preferredDecodingAttributes,e.g.preferredTextFormats),!t.variants.some(Qi))throw new Ne(2,4,4032);return n.return(qa(e,t))}))}function za(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=_i(r,n,e),a!=r.allowedByApplication&&(i=!0)}return i}function qa(e,t){var n=za(e,t);if(t){var i=e.h?e.h.g:null;if(i&&e.h.A){for(var r=new Set,a=l(t.variants),o=a.next();!o.done;o=a.next())(o=o.value).audio&&r.add(o.audio),o.video&&r.add(o.video);for(a=(r=l(r)).next();!a.done;a=r.next())Xa(e,i.keySystem,a.value)}Wa(e,t)}return n}function Xa(e,t,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 Wa(e,t){e=e.h?e.h.Te():{};var n=Object.keys(e);n=n.length&&"00"==n[0];for(var i=!1,r=!1,a=new Set,o=new Set,s=new Set,u=(t=l(t.variants)).next();!u.done;u=t.next())(u=u.value).audio&&s.add(u.audio),u.video&&s.add(u.video),u.allowedByApplication?u.allowedByKeySystem&&(i=!0):r=!0;for(t=(s=l(s)).next();!t.done;t=s.next())if((t=t.value).keyIds.size)for(u=(t=l(t.keyIds)).next();!u.done;u=t.next()){u=u.value;var c=e[n?"00":u];c?Ya.includes(c)&&o.add(c):a.add(u)}if(!i)throw new Ne(2,4,4012,e={hasAppRestrictions:r,missingKeys:Array.from(a),restrictedKeyStatuses:Array.from(o)})}var Ya=["output-restricted","internal-error"];function Ja(){}function $a(e,t){Za.set(e,t)}function Qa(e,t){if(t){var n=Za.get(t.toLowerCase());if(n)return n}throw new Ne(2,4,4e3,e,t)}F("shaka.media.ManifestParser",Ja),Ja.unregisterParserByMime=function(e){Za.delete(e)},Ja.registerParserByMime=$a,Ja.registerParserByExtension=function(){oe("ManifestParser.registerParserByExtension","Please use an ManifestParser with registerParserByMime function.")},Ja.AccessibilityPurpose={tm:"visually impaired",Gl:"hard of hearing",bm:"spoken subtitles"};var Za=new Map;function eo(e,t){var n=null,i=null,r=null,a=null,o=e.T();return 1&t&&(r=e.yd()),2&t&&(a=e.T()),8&t&&(n=e.T()),16&t&&(i=e.T()),{trackId:o,Md:n,Nd:i,gj:r,Fi:a}}function to(e,t){return 1==t?(t=e.T(),e=e.T(),{baseMediaDecodeTime:t*Math.pow(2,32)+e}):{baseMediaDecodeTime:e.T()}}function no(e,t){return 1==t?(e.skip(8),e.skip(8)):(e.skip(4),e.skip(4)),t=e.T(),e.skip(4),e=e.Ba(),{timescale:t,language:String.fromCharCode(96+(e>>10))+String.fromCharCode(96+((960&e)>>5))+String.fromCharCode(96+(31&e))}}function io(e,t,n){var i=e.T(),r=[],a=null;1&n&&(a=e.Yg()),4&n&&e.skip(4);for(var o=0;o<i;o++){var s={hh:null,sampleSize:null,Bf:null};256&n&&(s.hh=e.T()),512&n&&(s.sampleSize=e.T()),1024&n&&e.skip(4),2048&n&&(s.Bf=0==t?e.T():e.Yg()),r.push(s)}return{ym:i,gh:r,mg:a}}function ro(e){e.skip(6),e.skip(2),e.skip(8);var t=e.Ba();return e.skip(2),e.skip(2),e.skip(2),{channelCount:t,sampleRate:e=e.Ba()+e.Ba()/65536}}function ao(e){return{codec:ua(e=e.T())}}function oo(e,t){return t=void 0!==t&&t,e=e.toString(16).toUpperCase(),t?e:("0"+e).slice(-2)}function so(e){return(10>e?"0":"")+e}function uo(e){if(!To){To=!0;var t=new Uint8Array([105,115,111,109]),n=new Uint8Array([97,118,99,49]),i=new Uint8Array([0,0,0,1]);Lo=wo("ftyp",t,i,t,n),t=wo("dref",No),Oo=wo("dinf",t)}this.g=e}function lo(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=wo;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,p=Math.floor(h/(xo+1));switch(h=Math.floor(h%(xo+1)),s=wo("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(vo(s,4)),[0,0,0,0],c(vo(p,4)),c(vo(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(vo(u,2)),[0,0],c(vo(d,2)),[0,0]))),u=wo,p=o.duration*o.timescale,d=Math.floor(p/(xo+1)),p=Math.floor(p%(xo+1)),h=(h=o.stream.language).charCodeAt(0)-96<<10|h.charCodeAt(1)-96<<5|h.charCodeAt(2)-96,d=wo("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(vo(o.timescale,4)),c(vo(d,4)),c(vo(p,4)),c(vo(h,2)),[0,0]))),p=o,h=new Uint8Array([]),p.type){case"video":h=Ao;break;case"audio":h=ko}p=wo("hdlr",h);e:{switch(o.type){case"video":o=wo("minf",wo("vmhd",Do),Oo,co(o));break e;case"audio":o=wo("minf",wo("smhd",Po),Oo,co(o));break e}o=new Uint8Array([])}i=i("trak",s,o=u("mdia",d,p,o)),a.call(r,i)}for(t=$e.apply(ze,c(t)),n=wo,i=(a=e.g[0]).duration*a.timescale,r=Math.floor(i/(xo+1)),i=Math.floor(i%(xo+1)),r=wo("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(vo(a.timescale,4)),c(vo(r,4)),c(vo(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=wo("trex",u=new Uint8Array([0,0,0,0].concat(c(vo(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=wo("mvex",e=$e.apply(ze,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=$e.apply(ze,c(i))}else a=new Uint8Array([]);return e=n("moov",r,t,e,a),(t=new Uint8Array(Lo.byteLength+e.byteLength)).set(Lo),t.set(e,Lo.byteLength),t}function co(e){var t=wo,n="aac";e.codecs.includes("mp3")?n="mp3":e.codecs.includes("ac-3")?n=te().ee()?"ec-3":"ac-3":e.codecs.includes("ec-3")?n="ec-3":e.codecs.includes("opus")&&(n="opus");var i=new Uint8Array([]);switch(e.type){case"video":if(e.codecs.includes("avc1")){if(n=e.stream.width||0,i=e.stream.height||0,0<e.Na.byteLength)var r=wo("avcC",e.Na);else{r=wo;for(var a=7,o=[],s=[],u=0,l=0,d=0,h=0;h<e.Ab.length;h++){var p=yo(e.Ab[h]);switch(31&p[0]){case 7:o.push(p),a+=p.length+2;break;case 8:s.push(p),a+=p.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(vo(n,2)),c(vo(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=ho(e),o=new Uint8Array([]),e.encrypted&&(o=fo(0,e.stream,e.codecs),i="encv"),i=wo(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.Na.byteLength&&(n=wo("hvcC",e.Na)),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(vo(i,2)),c(vo(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=ho(e),o=new Uint8Array([]),e.encrypted&&(o=fo(0,e.stream,e.codecs),r="encv"),i=wo(r,i,n,s,o));break;case"audio":"mp3"==n?e=wo(".mp3",po(e)):"ac-3"==n?(n=wo("dac3",e.Ea),i="ac-3",r=new Uint8Array([]),e.encrypted&&(r=fo(0,e.stream,e.codecs),i="enca"),e=wo(i,po(e),n,r)):"ec-3"==n?(n=wo("dec3",e.Ea),i="ec-3",r=new Uint8Array([]),e.encrypted&&(r=fo(0,e.stream,e.codecs),i="enca"),e=wo(i,po(e),n,r)):"opus"==n?(n=wo("dOps",e.Ea),i="Opus",r=new Uint8Array([]),e.encrypted&&(r=fo(0,e.stream,e.codecs),i="enca"),e=wo(i,po(e),n,r)):(0<e.Ea.byteLength?n=wo("esds",e.Ea):(n=wo,i=e.id+1,r=e.stream.channelsCount||2,o=e.stream.audioSamplingRate||44100,u=tt("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(vo(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=fo(0,e.stream,e.codecs),i="enca"),e=wo(i,po(e),n,r)),i=e}return t("stbl",e=wo("stsd",Ro,i),wo("stts",Eo),wo("stsc",Io),wo("stsz",Mo),wo("stco",Co))}function ho(e){if(!e.Wa&&!e.Xa)return new Uint8Array([]);var t=e.Xa;return wo("pasp",e=new Uint8Array([].concat(c(vo(e.Wa,4)),c(vo(t,4)))))}function po(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(vo(e.stream.audioSamplingRate||44100,2)),[0,0]))}function fo(e,t,n){e=wo,n=wo("frma",n=new Uint8Array([].concat(c(vo(bo(n.split(".")[0]),4)))));var i="cenc",r=t.drmInfos[0];r&&r.encryptionScheme&&(i=r.encryptionScheme),i=wo("schm",i=new Uint8Array([0,0,0,0].concat(c(vo(bo(i),4)),[0,1,0,0]))),r=wo;for(var a=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),o=(t=l(t.drmInfos)).next();!o.done;o=t.next())if((o=o.value)&&o.keyIds&&o.keyIds.size)for(var s=(o=l(o.keyIds)).next();!s.done;s=o.next())a=yo(s.value);return e("sinf",n,i,r("schi",t=wo("tenc",t=new Uint8Array([0,0,0,0,0,0,1,8]),a)))}function go(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=wo,s=new Uint8Array([0,0,0,0].concat(c(vo(n.data?n.data.Vb:0,4))));s=wo("mfhd",s);var u=n.data?n.data.yb:[],d=new Uint8Array(4+u.length);for(i=0;i<u.length;i++){var h=u[i].flags;d[i+4]=h.ib<<4|h.kb<<2|h.jb}var p=(u=wo("sdtp",d)).length+92;d=wo,i=wo("tfhd",i=new Uint8Array([0,0,0,58].concat(c(vo(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 f=Math.floor(h%(xo+1));h=wo("tfdt",h=new Uint8Array([1,0,0,0].concat(c(vo(Math.floor(h/(xo+1)),4)),c(vo(f,4)))));var g=p,m=12+16*(f=(p=n.data?n.data.yb:[]).length),v=new Uint8Array(m);for(g+=8+m,v.set(["video"===n.type?1:0,0,15,1].concat(c(vo(f,4)),c(vo(g,4))),0),g=0;g<f;g++){var y=p[g];m=vo(y.duration,4);var b=vo(y.size,4),w=y.flags;y=vo(y.rb,4),v.set([].concat(c(m),c(b),[w.wb<<2|w.ib,w.kb<<6|w.jb<<4|w.xb,61440&w.hb,15&w.hb],c(y)),12+16*g)}o=o("moof",s,u=d("traf",i,h,p=wo("trun",v),u)),a.call(r,t,[o,mo(n)])}return $e.apply(ze,c(t))}function mo(e){return e=(e.data?e.data.yb:[]).map((function(e){return e.data})),wo("mdat",e=$e.apply(ze,c(e)))}function vo(e,t){var n=[];for(--t;0<=t;t--)n.push(e>>8*t&255);return n}function yo(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 bo(e){for(var t=0,n=0;n<e.length;n+=1)t|=e.charCodeAt(n)<<8*(e.length-n-1);return t}function wo(e){var t=L.apply(1,arguments),n=So.get(e);n||(n=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)],So.set(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 To=!1,xo=Math.pow(2,32)-1,So=new Map,Ao=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]),ko=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]),Eo=new Uint8Array([0,0,0,0,0,0,0,0]),Io=new Uint8Array([0,0,0,0,0,0,0,0]),Co=new Uint8Array([0,0,0,0,0,0,0,0]),Mo=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Do=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),Po=new Uint8Array([0,0,0,0,0,0,0,0]),Ro=new Uint8Array([0,0,0,0,0,0,0,1]),Lo=new Uint8Array([]),No=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),Oo=new Uint8Array([]);function jo(e){function t(e){o.push(e),na(e)}var n,i,r,a,o=[];if((new ta).box("moof",t).box("traf",t).R("tfhd",(function(e){n=e,r=eo(e.reader,e.flags)})).R("trun",(function(e){i=e,a=io(e.reader,e.version,e.flags)})).parse(e),r&&2!==r.Fi){var s=n.start+la(n)+4+(null!==r.gj?8:0),u=Re(e);if(null!==r.Fi)u.setUint32(s,2);else{_o(e,n.start,n.size+4);var c=u.getUint32(n.start+8);u.setUint32(n.start+8,2|c),a&&null!==a.mg&&u.setInt32(i.start+la(i)+4,a.mg+4),c=e.subarray(0,s),u=e.subarray(s),(e=new Uint8Array(e.byteLength+4)).set(c),c=[];for(var d=3;0<=d;d--)c.push(2>>8*d&255);for(e.set(new Uint8Array(c),s),e.set(u,s+4),u=(s=l(o)).next();!u.done;u=s.next())_o(e,(u=u.value).start,u.size+4)}}return e}function Uo(e,t,n,i,r,a){var o=fo(new uo([]),e,i.name),s=t.subarray(i.start,i.start+i.size);for((e=new Uint8Array(i.size+o.byteLength)).set(s,0),Re(e).setUint32(4,a),e.set(o,i.size),_o(e,0,e.byteLength),a=new Uint8Array(t.byteLength+e.byteLength),i=te().$e()?i.start:i.start+i.size,o=t.subarray(i),a.set(t.subarray(0,i)),a.set(e,i),a.set(o,i+e.byteLength),r=(t=l(r)).next();!r.done;r=t.next())_o(a,(r=r.value).start,r.size+e.byteLength);return e=Re(a,n.start),n=la(n),t=e.getUint32(n),e.setUint32(n,t+1),a}function _o(e,t,n){0!=(t=(e=Re(e,t)).getUint32(0))&&(1==t?(e.setUint32(8,n>>32),e.setUint32(12,4294967295&n)):e.setUint32(0,n))}function Bo(e,t,n,i,r,a,o,s){this.O=e,this.startByte=t,this.endByte=n,this.rd=void 0===i?null:i,this.timescale=void 0===r?null:r,this.h=void 0===a?null:a,this.aesKey=void 0===o?null:o,this.g=this.mimeType=this.codecs=null,this.encrypted=void 0!==s&&s}function Fo(e,t){return e===t||(e&&t?e.Bc()==t.Bc()&&e.zc()==t.zc()&&Dt(e.O().sort(),t.O().sort())&&Ce(e.Yb(),t.Yb()):e==t)}function Vo(e,t,n,i,r,a,o,s,u,c,d,h,p,f,g,m){for(c=void 0===c?[]:c,f=void 0===f?Ko:f,this.startTime=e,this.j=this.endTime=t,this.C=n,this.startByte=i,this.endByte=r,this.Y=a,this.timestampOffset=o,this.appendWindowStart=s,this.appendWindowEnd=u,this.g=c,this.tilesLayout=void 0===d?"":d,this.B=void 0===h?null:h,this.h=void 0===p?null:p,this.status=f,this.preload=!1,this.l=!0,this.m=!1,this.aesKey=void 0===g?null:g,this.thumbnailSprite=null,this.i=-1,this.A=void 0!==m&&m,this.F=this.o=!1,t=(e=l(this.g)).next();!t.done;t=e.next())t.value.ki();this.A&&this.g.length&&this.g[this.g.length-1].ji(),this.s=this.bandwidth=this.mimeType=this.codecs=null,this.G=!1}function Ho(e,t){e.Y=t;for(var n=(e=l(e.g)).next();!n.done;n=e.next())Ho(n.value,t)}Bo.prototype.Bc=function(){return this.startByte},Bo.prototype.zc=function(){return this.endByte},Bo.prototype.ge=function(e){this.h=e},Bo.prototype.Yb=function(){return this.h},F("shaka.media.InitSegmentReference",Bo),Bo.prototype.getEndByte=Bo.prototype.zc,Bo.prototype.getStartByte=Bo.prototype.Bc,(i=Vo.prototype).O=function(){return this.C()},i.getStartTime=function(){return this.startTime},i.zj=function(){return this.endTime},i.Bc=function(){return this.startByte},i.zc=function(){return this.endByte},i.Vj=function(){return this.tilesLayout},i.Uj=function(){return this.B},i.Cc=function(){return this.status},i.qk=function(){this.status=Go},i.Pg=function(){this.preload=!0},i.isPreload=function(){return this.preload},i.qd=function(){this.l=!1},i.fk=function(){return this.l},i.ki=function(){this.o=!0},i.hk=function(){return this.o},i.ji=function(){this.F=!0},i.gk=function(){return this.F},i.ii=function(){this.m=!0},i.bk=function(){return this.m},i.Hf=function(e){this.thumbnailSprite=e},i.Sj=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.vh=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.ge=function(e,t){this.s=e,this.G=void 0!==t&&t},i.Yb=function(e){var t=this.s;return(void 0===e||e)&&this.G&&(this.s=null),t},F("shaka.media.SegmentReference",Vo),Vo.prototype.getSegmentData=Vo.prototype.Yb,Vo.prototype.setSegmentData=Vo.prototype.ge,Vo.prototype.syncAgainst=Vo.prototype.vh,Vo.prototype.offset=Vo.prototype.offset,Vo.prototype.getThumbnailSprite=Vo.prototype.Sj,Vo.prototype.setThumbnailSprite=Vo.prototype.Hf,Vo.prototype.hasByterangeOptimization=Vo.prototype.bk,Vo.prototype.markAsByterangeOptimization=Vo.prototype.ii,Vo.prototype.isLastPartial=Vo.prototype.gk,Vo.prototype.markAsLastPartial=Vo.prototype.ji,Vo.prototype.isPartial=Vo.prototype.hk,Vo.prototype.markAsPartial=Vo.prototype.ki,Vo.prototype.isIndependent=Vo.prototype.fk,Vo.prototype.markAsNonIndependent=Vo.prototype.qd,Vo.prototype.isPreload=Vo.prototype.isPreload,Vo.prototype.markAsPreload=Vo.prototype.Pg,Vo.prototype.markAsUnavailable=Vo.prototype.qk,Vo.prototype.getStatus=Vo.prototype.Cc,Vo.prototype.getTileDuration=Vo.prototype.Uj,Vo.prototype.getTilesLayout=Vo.prototype.Vj,Vo.prototype.getEndByte=Vo.prototype.zc,Vo.prototype.getStartByte=Vo.prototype.Bc,Vo.prototype.getEndTime=Vo.prototype.zj,Vo.prototype.getStartTime=Vo.prototype.getStartTime,Vo.prototype.getUris=Vo.prototype.O;var Ko=0,Go=1;function zo(e){return 1==e.length&&1e-4>e.end(0)-e.start(0)}function qo(e){return!e||zo(e)?null:e.length?e.end(e.length-1):null}function Xo(e,t){return!(!e||!e.length||zo(e)||t>e.end(e.length-1))&&t>=e.start(0)}function Wo(e,t){if(!e||!e.length||zo(e))return 0;for(var n=0,i=(e=l(Yo(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 Yo(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 Jo(){}function $o(e,t){var n=document.createElement("source");return n.src=e,n.type=void 0===t?"":t,n}function Qo(e){for(var t=!1,n=e.getElementsByTagName("source"),i=n.length-1;0<=i;--i)e.removeChild(n[i]),t=!0;return e.src&&(e.removeAttribute("src"),t=!0),t}function Zo(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function es(){return ns||(ts||(ts=new Ti((function(){ns=null}))),(ns=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(ns=document.createElement("video")),ts.ia(1),ns)}Vo.Status={il:Ko,rm:Go,Ql:2},F("shaka.util.Dom",Jo),Jo.removeAllChildren=Zo,Jo.clearSourceFromVideo=Qo;var ts=null,ns=null;function is(){}function rs(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 as(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 os(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 ss(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=Ue(De(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=Ue(De(e.data,3+n,a));return o="--\x3e"===i?Ue(De(e.data,4+n+a)):Me(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=Ue(De(e.data,1,i)),e=Ue(De(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=Ue(De(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=Me(e.data.subarray(n.length+1)),t.data=e),t):"T"===e.type[0]?2>e.size||3!==e.data[0]?null:(e=Ue(e.data.subarray(1)).replace(/\0*$/,""),t.data=e,t):"W"===e.type[0]?(e=Ue(e.data).replace(/\0*$/,""),t.data=e,t):e.data?(t.data=Me(e.data),t):null}function us(e){for(var t=0,n=[];rs(e,t);){var i=os(e,t+6);for(e[t+5]>>6&1&&(t+=10),i=(t+=10)+i;t+10<i;){var r=e.subarray(t),a=os(r,4);(a=ss(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}as(e,t)&&(t+=10)}return n}function ls(e,t){for(var n=t=void 0===t?0:t,i=0;rs(e,t);)e[t+5]>>6&1&&(i+=10),i+=10,i+=os(e,t+6),as(e,t+10)&&(i+=10),t+=i;return 0<i?e.subarray(n,n+i):new Uint8Array([])}function cs(e){return new Date(Date.UTC(1900,0,1,0,0,0,0)+e).getTime()}function ds(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=De(t,0,n)}this.i=this.j.byteLength,this.g=this.h=0}function hs(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 Qr(n,0).T(),e.g=8*i,e.i-=i)}function ps(e,t){if(e.g<=t){t-=e.g;var n=Math.floor(t/8);t-=8*n,e.g-=n,hs(e)}e.h<<=t,e.g-=t}function fs(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&&hs(e),0<(n=t-n)?i<<n|fs(e,n):i}function gs(e){var t;for(t=0;t<e.g;++t)if(e.h&2147483648>>>t)return e.h<<=t,e.g-=t,t;return hs(e),t+gs(e)}function ms(e){ps(e,1+gs(e))}function vs(e){return fs(e,gs(e)+1)-1}function ys(e){return 1&(e=vs(e))?1+e>>>1:-1*(e>>>1)}function bs(e){return 1===fs(e,1)}function ws(e){return fs(e,8)}function Ts(e,t){for(var n=8,i=8,r=0;r<t;r++)0!==i&&(i=(n+(i=ys(e))+256)%256),n=0===i?n:i}function xs(e){return ws(e),vs(e),vs(e)}function Ss(){this.H=null,this.I=!1,this.m=this.K=null,this.j=[],this.g=[],this.B=this.C=null,this.i=[],this.h=[],this.F=null,this.l=[],this.A=this.G=this.o=this.s=null}function As(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=Es(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=n.pts!=r?Es(i,e.o):i),e.o=n.dts}return e=t[8]+9,t.byteLength<=e?null:(n.data=t.subarray(e),n)}function ks(e){var t=e.Rc();return 1<t.length&&(e=t[0].pts,t=t[1].pts,!isNaN(t-e))?String(1/(t-e)*9e4):null}function Es(e,t){var n=1;for(e>t&&(n=-1);4294967296<Math.abs(t-e);)e+=8589934592*n;return e}function Is(e){return!(0>Cs(e))}function Cs(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}F("shaka.util.Id3Utils",is),is.getID3Data=ls,is.getID3Frames=us,F("shaka.util.ExpGolomb",ds),(i=Ss.prototype).clearData=function(){this.j=[],this.g=[],this.i=[],this.h=[],this.l=[]},i.Ff=function(e){null!=this.A&&this.A!=e&&(this.o=this.s=null),this.A=e},i.parse=function(e){if(564>e.length)return this;for(var t=Math.max(0,Cs(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.H=(31&e[s+10])<<8|e[s+11];break;case 17:case 8191:break;case this.H:a&&(s+=e[s]+1),o={audio:-1,video:-1,Ye:-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 p=a[d+1]+2;switch(a[d]){case 5:var f=He(a.subarray(d+2,d+p));-1==o.audio&&"Opus"===f?(o.audio=l,o.audioCodec="opus"):-1==o.video&&"AV01"===f&&(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&&(f=null,128===a[d+2]&&(f=a[d+3]),null!=f&&(this.G={channelCount:15&f?15&f:2,jj:f,sampleRate:48e3}))}d+=p,h-=p}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.Ye&&(o.Ye=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.K=a.video,this.m=a.videoCodec),-1!=a.audio&&(this.C=a.audio,this.B=a.audioCodec),-1!=a.Ye&&(this.F=a.Ye),i&&!this.I&&(i=!1,r=t-188),this.I=!0;break;case this.K: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.C: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.F: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.zk=function(e){return oe("TsParser.parseAvcNalus","Please use parseNalus function instead."),this.Vg(e,{Zd:null,state:null})},i.Vg=function(e,t){var n=e.pts?e.pts/9e4:null,i=(e=e.data).byteLength,r=1;"hvc"==this.m&&(r=2);var a=t.state||0,o=a,s=0,u=[],l=-1,c=0;for(-1==a&&(l=0,c="hvc"==this.m?e[0]>>1&63:31&e[0],a=0,s=1);s<i;){var d=e[s++];a?1===a?a=d?0:2:d?1==d?(d=s-a-1,0<=l?u.push({data:e.subarray(l+r,d),fullData:e.subarray(l,d),type:c,time:n,state:null}):(a=u.length?u[u.length-1]:t.Zd)&&(o&&s<=4-o&&a.state&&(a.data=a.data.subarray(0,a.data.byteLength-o),a.fullData=a.fullData.subarray(0,a.fullData.byteLength-o)),0<d&&(d=e.subarray(0,d),a.data=$e(a.data,d),a.fullData=$e(a.fullData,d),a.state=0)),s<i?(c="hvc"==this.m?e[s]>>1&63:31&e[s],l=s,a=0):a=-1):a=0:a=3:a=d?0:1}return 0<=l&&0<=a&&u.push({data:e.subarray(l+r,i),fullData:e.subarray(l,i),type:c,time:n,state:a}),!u.length&&t.Zd&&(n=u.length?u[u.length-1]:t.Zd)&&(n.data=$e(n.data,e),n.fullData=$e(n.fullData,e)),t.state=a,u},i.getMetadata=function(){for(var e=[],t=l(this.l),n=t.next();!n.done;n=t.next())(n=As(this,n=$e.apply(ze,c(n.value))))&&e.push({cueTime:n.pts?n.pts/9e4:null,data:n.data,frames:us(n.data),dts:n.dts,pts:n.pts});return e},i.sb=function(){if(this.i.length&&!this.h.length)for(var e=l(this.i),t=e.next();!t.done;t=e.next()){var n=$e.apply(ze,c(t.value)),i=As(this,n);t=this.h.length?this.h[this.h.length-1]:null,i&&null!=i.pts&&null!=i.dts&&(!t||t.pts!=i.pts&&t.dts!=i.dts)?this.h.push(i):this.h.length&&(n=i?i.data:n)&&((t=this.h.pop()).data=$e(t.data,n),this.h.push(t))}return this.h},i.Rc=function(e){if(e=void 0===e||e,this.j.length&&!this.g.length){for(var t=l(this.j),n=t.next();!n.done;n=t.next()){var i=$e.apply(ze,c(n.value)),r=As(this,i);n=this.g.length?this.g[this.g.length-1]:null,r&&null!=r.pts&&null!=r.dts&&(!n||n.pts!=r.pts&&n.dts!=r.dts)?this.g.push(r):this.g.length&&(i=r?r.data:i)&&((n=this.g.pop()).data=$e(n.data,i),this.g.push(n))}if(e){for(t={Zd:null,state:null},n=[],r=(i=l(this.g)).next();!r.done;r=i.next())(r=r.value).nalus=this.Vg(r,t),r.nalus.length&&(n.push(r),t.Zd=r.nalus[r.nalus.length-1]);this.g=n}}return e?this.g:(e=this.g,this.g=[],e)},i.getStartTime=function(e){if("audio"==e){e=null;var t=this.sb();return t.length&&(e=t[0],e=Math.min(e.dts,e.pts)/9e4),e}return"video"==e?(e=null,(t=this.Rc(!1)).length&&(e=t[0],e=Math.min(e.dts,e.pts)/9e4),e):null},i.Od=function(){return{audio:this.B,video:this.m}},i.Xe=function(){for(var e=[],t=l(this.Rc()),n=t.next();!n.done;n=t.next())e.push.apply(e,c(n.value.nalus));return e},i.Yj=function(){oe("TsParser.getVideoResolution","Please use getVideoInfo function instead.");var e=this.Ig();return{height:e.height,width:e.width}},i.Ig=function(){return"hvc"==this.m?function(e){var t={height:null,width:null,codec:null,frameRate:null},n=e.Xe();if(!n.length)return t;if(!(n=n.find((function(e){return 33==e.type}))))return t;var i=new ds(n.fullData,!0);ws(i),ws(i),fs(i,4);var r=fs(i,3);bs(i);var a=fs(i,2),o=fs(i,1),s=fs(i,5),u=fs(i,32);n=ws(i);for(var l=ws(i),c=ws(i),d=ws(i),h=ws(i),p=ws(i),f=ws(i),g=[],m=[],v=0;v<r;v++)g.push(bs(i)),m.push(bs(i));if(0<r)for(v=r;8>v;v++)fs(i,2);for(v=0;v<r;v++)g[v]&&fs(i,88),m[v]&&ws(i);vs(i),3==(r=vs(i))&&fs(i,1),g=vs(i),m=vs(i);var y=v=0,b=0,w=0;return bs(i)&&(v+=vs(i),y+=vs(i),b+=vs(i),w+=vs(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+f,p&&(a+="."+p.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=ks(e),t}(this):function(e){var t={height:null,width:null,codec:null,frameRate:null},n=e.Xe();if(!n.length)return t;if(!(n=n.find((function(e){return 7==e.type}))))return t;var i=ws(n=new ds(n.data)),r=ws(n),a=ws(n);if(ms(n),Ms.includes(i)){var o=vs(n);if(3===o&&ps(n,1),ms(n),ms(n),ps(n,1),bs(n)){o=3!==o?8:12;for(var s=0;s<o;s++)bs(n)&&Ts(n,6>s?16:64)}}if(ms(n),0===(o=vs(n)))vs(n);else if(1===o)for(ps(n,1),ms(n),ms(n),o=vs(n),s=0;s<o;s++)ms(n);ms(n),ps(n,1),o=vs(n),s=vs(n);var u=fs(n,1);0===u&&ps(n,1),ps(n,1);var l=0,c=0,d=0,h=0;return bs(n)&&(l=vs(n),c=vs(n),d=vs(n),h=vs(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=ks(e),t}(this)},F("shaka.util.TsParser",Ss),Ss.syncOffset=Cs,Ss.probe=Is,Ss.prototype.getVideoInfo=Ss.prototype.Ig,Ss.prototype.getVideoResolution=Ss.prototype.Yj,Ss.prototype.getVideoNalus=Ss.prototype.Xe,Ss.prototype.getCodecs=Ss.prototype.Od,Ss.prototype.getStartTime=Ss.prototype.getStartTime,Ss.prototype.getVideoData=Ss.prototype.Rc,Ss.prototype.getAudioData=Ss.prototype.sb,Ss.prototype.getMetadata=Ss.prototype.getMetadata,Ss.prototype.parseNalus=Ss.prototype.Vg,Ss.prototype.parseAvcNalus=Ss.prototype.zk,Ss.prototype.parse=Ss.prototype.parse,Ss.prototype.setDiscontinuitySequence=Ss.prototype.Ff,Ss.prototype.clearData=Ss.prototype.clearData,Ss.Timescale=9e4;var Ms=[100,110,122,244,44,83,86,118,128,138,139,134];function Ds(e,t,n,i,r){var a=this;this.g=e,this.N=n,this.A=i,this.ha=t,this.l=new Map,this.C=new Map,this.Oa=new Map,this.h=null,this.Ka=!1,this.M=r||null,this.o=new Map,this.s=new $,this.j=new Map,this.I=null,this.K=new Sr,this.za="",this.eb=!1,this.ya=!0,this.L=!1,this.B=this.P=null,this.i=Ps(this,this.K),this.Ya=this.F=!1,this.H=new Xr((function(){return function(e){var t,n,i,r,a,o,s,u,c,d,h,p,f;return R((function(g){if(1==g.g){for(t=[],n=l(e.o),i=n.next();!i.done;i=n.next())for(r=i.value,a=l(r),o=a.next().value,s=a.next().value,u=s[0],c=o,e.o.set(c,s.slice(0,1)),u&&t.push(u.p.catch(Si)),d=l(s.slice(1)),h=d.next();!h.done;h=d.next())h.value.p.reject(new Ne(2,7,7003,void 0));return e.h&&t.push(e.h.destroy()),w(g,Promise.all(t),2)}for(p=l(e.j.values()),f=p.next();!f.done;f=p.next())f.value.destroy();e.s&&(e.s.release(),e.s=null),e.g&&e.B&&e.g.removeChild(e.B),e.g&&e.P&&(e.g.removeChild(e.P),e.g.load(),e.g.disableRemotePlayback=!1),e.g=null,e.P=null,e.B=null,e.A=null,e.i=null,e.h=null,e.ha=null,e.l.clear(),e.Oa.clear(),e.j.clear(),e.I=null,e.o.clear(),e.M=null,e.ba.clear(),e.N=null,T(g)}))}(a)})),this.G=!1,this.W="UNKNOWN",this.Za=this.ab=!1,this.Pa=new Sr,this.m=!1,this.wa=null,this.ba=new Map,this.na=this.S=this.va=this.U=null,this.ka=new Sr,this.g.remote&&(this.L="disconnected"!=this.g.remote.state,this.s.D(this.g.remote,"connect",(function(){a.L="disconnected"!=a.g.remote.state})),this.s.D(this.g.remote,"connecting",(function(){a.L="disconnected"!=a.g.remote.state})),this.s.D(this.g.remote,"disconnect",(function(){a.L="disconnected"!=a.g.remote.state})))}function Ps(t,n){if(t.ya=!0,e.ManagedMediaSource){t.B||(t.g.disableRemotePlayback=!0);var i=new ManagedMediaSource;t.s.D(i,"startstreaming",(function(){t.ya=!0})),t.s.D(i,"endstreaming",(function(){t.ya=!1}))}else i=new MediaSource;return t.s.Aa(i,"sourceopen",(function(){URL.revokeObjectURL(t.za),n.resolve()})),t.s.Aa(t.g,"playing",(function(){t.eb=!0})),t.za=nu(i),t.A.useSourceElements?(t.g.removeAttribute("src"),t.P&&t.g.removeChild(t.P),t.B&&t.g.removeChild(t.B),t.P=$o(t.za),t.g.appendChild(t.P),t.B&&t.g.appendChild(t.B),t.g.load()):t.g.src=t.za,i}function Rs(e,t,n,i){"audio"==t&&i&&(i=Gi(i,n.mimeType));var r=ni(n.mimeType,i);if(t==rt)Ns(e,r,e.G,n.external);else{var a=e.A.forceTransmux;(!ht(r)||!e.G&&hi.includes(r))&&(a=!0);var o=ii(n.mimeType,i);if(a){if(a=nt("audio",(i||"").split(",")),i=nt("video",(i||"").split(",")),a&&i)return e.m=!0,Rs(e,"audio",n,a),void Rs(e,"video",n,i);(i=Yn(o))&&(r=i(),e.j.set(t,r),r=r.convertCodecs(t,o))}o=r+e.A.addExtraFeaturesToSourceBuffer(r),Wr(e.H);try{var s=e.i.addSourceBuffer(o)}catch(t){throw new Ne(2,3,3015,t,"The mediaSource_ status was "+e.i.readyState+" expected 'open'",null)}e.G&&(s.mode=iu),e.s.D(s,"error",(function(){var n=e.o.get(t)[0];n.p.reject(new Ne(2,3,3014,e.g.error?e.g.error.code:0,n.uri))})),e.s.D(s,"updateend",(function(){return Ws(e,t)})),e.l.set(t,s),e.C.set(t,r),e.Oa.set(t,!!n.drmInfos.length)}}function Ls(e){return e.ya&&!e.L&&!e.F}function Ns(e,t,n,i){e.h||(e.h=new pi(e.ha),e.h&&(e.h.A=e.A.modifyCueCallback));var r=e.h;i=i||e.Ka,e=e.W,"application/cea-608"==t||"application/cea-708"==t?r.i=null:(r.i=bi.get(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 Os(e){return!(e.F||e.i&&"ended"!=e.i.readyState)}function js(e){return!(e.F||e.i&&"closed"!=e.i.readyState)}function Us(e,t){return e=e.l.size?t==rt?e.h.g:!(e=Bs(e,t))||zo(e)?null:1==e.length&&0>e.start(0)?0:e.length?e.start(0):null:null}function _s(e,t){return e.l.size?t==rt?e.h.h:qo(Bs(e,t)):null}function Bs(e,t){if(e.F||e.L)return null;try{return e.l.get(t).buffered}catch(n){return e.l.has(t),null}}function Fs(e,t,n,i,r,a,o,s,u,d,h){var p,f,g,m,v,y,b,x,S,A,k,E,I,C,M,D;return o=void 0!==o&&o,s=void 0!==s&&s,u=void 0!==u&&u,d=void 0!==d&&d,R((function(P){switch(P.g){case 1:if(t!=(p=at).Ta){P.u(2);break}if("HLS"!=e.W){P.u(3);break}return w(P,e.Pa,4);case 4:f=P.h,e.h.s=f;case 3:return w(P,function(e,t,n,i,r){var a,o,s,u,c,d,h;return R((function(p){if(1==p.g)return w(p,Promise.resolve(),2);if(!e.i||!e.j)return p.return();if(null==n||null==i)return e.i.parseInit(De(t)),p.return();for(a=e.B?n:e.s,o={periodStart:e.s,segmentStart:n,segmentEnd:i,vttOffset:a},s=e.i.parseMedia(De(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(p)}))}(e.h,n,i?i.startTime:null,i?i.endTime:null,i?i.O()[0]:null),5);case 5:return P.return();case 2:if(d||!e.m){P.u(6);break}return w(P,Fs(e,p.ea,n,i,r,a,o,s,u,!0),7);case 7:return w(P,Fs(e,p.Ca,n,i,r,a,o,s,u,!0),8);case 8:return P.return();case 6:if(!e.l.has(t))return P.return();if(g=e.l.get(t).timestampOffset,m=e.C.get(t),e.j.has(t)&&(m=e.j.get(t).getOriginalMimeType()),i&&(v=function(e,t,n,i,r,a){var o=null,s=[],u=De(n);if(hi.includes(a))(t=us(u)).length&&i&&((n=t.find((function(e){return"com.apple.streaming.transportStreamTimestamp"===e.description})))&&"number"==typeof n.data&&(o=Math.round(n.data)/1e3),e.N.onMetadata([{cueTime:i.startTime,data:u,frames:t,dts:i.startTime,pts:i.startTime}],0,i.endTime));else if(a.includes("/mp4")&&i&&i.Y&&i.Y.timescale){var l=i.Y.timescale;if(!isNaN(l)){var c=null!=r.emsgSchemeIdUris&&0<r.emsgSchemeIdUris.length||e.A.dispatchAllEmsgBoxes,d=0,h=!1;u=new ta,c&&u.R("emsg",(function(t){var n=r.emsgSchemeIdUris;if(0===t.version)var a=t.reader.Vc(),o=t.reader.Vc(),s=t.reader.T(),u=t.reader.T(),l=t.reader.T(),c=t.reader.T(),d=i.startTime+u/s;else s=t.reader.T(),u=(d=t.reader.yd()/s+i.timestampOffset)-i.startTime,l=t.reader.T(),c=t.reader.T(),a=t.reader.Vc(),o=t.reader.Vc();t=t.reader.Ub(t.reader.getLength()-t.reader.Ma()),(n&&n.includes(a)||e.A.dispatchAllEmsgBoxes)&&("urn:mpeg:dash:event:2012"==a?e.N.yk():(n=d+l/s,e.N.wk({startTime:d,endTime:n,schemeIdUri:a,value:o,timescale:s,presentationTimeDelta:u,eventDuration:l,id:c,messageData:t}),("https://aomedia.org/emsg/ID3"==a||"https://developer.apple.com/streaming/emsg-id3"==a)&&(s=us(t)).length&&e.N.onMetadata([{cueTime:d,data:t,frames:s,dts:d,pts:d}],0,n)))})),u.R("prft",(function(t){var n=t.reader,i=t.version;n.T(),t=1e3*(t=n.T())+n.T()/Math.pow(2,32)*1e3,0===i?n=n.T():(i=n.T(),n=n.T(),n=i*Math.pow(2,32)+n),t=cs(t),n=new Dr("prft",n=(new Map).set("detail",{wallClockTime:t,programStartDate:new Date(t-n/l*1e3)})),e.N.onEvent(n)})).box("moof",na).box("traf",na).R("tfdt",(function(e){h||(d=to(e.reader,e.version).baseMediaDecodeTime/l,h=!0,c||e.parser.stop())})).parse(n,!0),h&&0==i.timestampOffset&&(o=d)}}else a.includes("/mp4")||a.includes("/webm")||!Is(u)||(e.ba.has(t)||e.ba.set(t,new Ss),(s=e.ba.get(t)).clearData(),s.Ff(i.i),s.parse(u),null!=(u=s.getStartTime(t))&&(o=u),s=s.getMetadata());return{timestamp:o,metadata:s}}(e,t,n,i,r,m),y=v.timestamp,b=v.metadata,null!=y&&(null==e.U&&t==p.Ca&&(e.U=y,e.va=i.startTime,null!=e.S&&(x=0,e.va==e.na&&(x=e.U-e.S),e.ka.resolve(x))),null==e.S&&t==p.ea&&(e.S=y,e.na=i.startTime,null!=e.U&&(S=0,e.va==e.na&&(S=e.U-e.S),e.ka.resolve(S))),A=y,k=hi,!e.G&&k.includes(e.C.get(t))&&(A=0),E=i.startTime-A,(.001<=Math.abs(g-E)||o||s)&&(!u||0<E||!g)&&(g=E,e.Za&&(Ys(e,t,(function(){return zs(e,t)}),null),Ys(e,t,(function(){return qs(e,t,g)}),null))),(t==p.Ca||!e.l.has(p.Ca))&&e.Pa.resolve(g)),b.length)&&e.N.onMetadata(b,g,i?i.endTime:null),a&&t==p.Ca&&(e.h||Ns(e,"application/cea-608",e.G,!1),e.I||(I=m.split(";",1)[0],e.I=new bt(I)),i?(C=e.I.vf(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,[]),yi(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,C,i.startTime,i.endTime,g):e.I.init(n,s,h)),!e.j.has(t)){P.u(9);break}return w(P,e.j.get(t).transmux(n,r,i,e.i.duration,t),10);case 10:n=P.h;case 9:if(n=function(e,t,n,i,r){if("mp4"!=ai(e.C.get(r)))return n;var a=null===i,o=e.Oa.get(r),s=e.N.Ej(),u=!1;i&&i.Y&&(u=i.Y.encrypted),i=i?i.O()[0]:null;var d=te();return e.A.correctEc3Enca&&a&&"audio"===r&&(n=function(e){e=De(e);var t=null;return(new ta).box("moov",na).box("trak",na).box("mdia",na).box("minf",na).box("stbl",na).R("stsd",ia).box("enca",(function(e){return t=e.reader.h,aa(e)})).box("sinf",na).box("frma",(function(e){e.parser.stop(),"ec-3"===ao(e.reader).codec&&t&&2!==t.getUint16(16)&&t.setUint16(16,2)})).parse(e),e}(n)),e.A.insertFakeEncryptionInInit&&o&&d.fe(s,r)&&(a?n=function(e,t,n){function i(e){h.push({box:e,oi:1701733217})}function r(e){h.push({box:e,oi:1701733238})}function a(e){c=!0,e.parser.stop()}function o(e){d.push(e),na(e)}var s,u=t=De(t),c=!1,d=[],h=[];if((new ta).box("moov",o).box("trak",o).box("mdia",o).box("minf",o).box("stbl",o).R("stsd",(function(e){s=e,d.push(e),ia(e)})).R("encv",a).R("enca",a).R("dvav",r).R("dva1",r).R("dvh1",r).R("dvhe",r).R("dvc1",r).R("dvi1",r).R("hev1",r).R("hvc1",r).R("avc1",r).R("avc3",r).R("ac-3",i).R("ec-3",i).R("ac-4",i).R("Opus",i).R("fLaC",i).R("mp4a",i).parse(t),c)return t;if(0==h.length||!s)throw Je(t),new Ne(2,3,3019,n);h.reverse();for(var p=(n=l(h)).next();!p.done;p=n.next())p=p.value,u=Uo(e,u,s,p.box,d,p.oi);return te().Ai()?((e=new Uint8Array(t.byteLength+u.byteLength)).set(u),e.set(t,u.byteLength),e):u}(t,n,i):!u&&d.Bi(r)&&(n=function(e){e=De(e);var t=[];(new ta).box("mdat",(function(e){t.push(e)})).parse(e);for(var n=[],i=0;i<t.length;i++){var r=t[i-1],a=t[i];n.push(jo(e.subarray(r?r.start+r.size:0,a.start+a.size)))}return $e.apply(ze,c(n))}(n))),a&&d.ee()&&(n=function(e){function t(e){i.push({start:e.start,size:e.size}),na(e)}var n=De(e),i=[];return(new ta).box("moov",t).box("trak",t).box("mdia",t).box("minf",t).box("stbl",t).box("stsd",(function(e){i.push({start:e.start,size:e.size});for(var t=Re(n,e.start),r=0;r<e.size-3;r++){var a=t.getUint32(r);1633889587==a?t.setUint32(r,1700998451):1684103987==a&&t.setUint32(r,1684366131)}})).parse(n),n}(n)),n}(e,r,n,i,t),!i||!e.G||t==p.Ta){P.u(11);break}if(!o&&!s){P.u(11);break}if(M=i.startTime,"HLS"!=e.W||e.m||t!=p.ea||!e.l.has(p.Ca)){P.u(13);break}return w(P,e.ka,14);case 14:D=P.h,.15<Math.abs(D)&&(M-=D);case 13:Ys(e,t,(function(){return zs(e,t)}),null),Ys(e,t,(function(){return qs(e,t,M)}),null);case 11:return w(P,Ys(e,t,(function(){var i=n;e.M&&lt(e.M,i,g,r),e.l.get(t).appendBuffer(i)}),i?i.O()[0]:null),15);case 15:T(P)}}))}function Vs(e,t){var n;return R((function(i){return 1==i.g?t==(n=at).Ta?e.h?w(i,e.h.remove(0,1/0),0):i.return():w(i,Ys(e,t,(function(){return Gs(e,t,0,e.i.duration)}),null),4):e.m?w(i,Ys(e,n.ea,(function(){return Gs(e,n.ea,0,e.i.duration)}),null),0):i.u(0)}))}function Hs(e,t,n,i,r,a,o,s,u){var l,c;return R((function(d){return 1==d.g?t==(l=at).Ta?(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;return R((function(d){return 1==d.g?(a=at,o=tu(e,t,n,i,r),s=o.type,u=o.ec,l=o.nf,(c=r.get(a.ea))&&(e.m=c.isAudioMuxedInVideo),s==ru?(e.j.has(t)&&!u?(e.j.get(t).destroy(),e.j.delete(t)):!e.j.has(t)&&u?e.j.set(t,u):u&&(e.j.has(t)&&e.j.get(t).transmux!==u.transmux?(e.j.get(t).destroy(),e.j.set(t,u)):u.destroy()),d.return(!1)):s==ou?w(d,function(e,t,n,i){return Ys(e,t,(function(){if(t!==rt){if(e.C.get(t),pt()){e.j.has(t)&&(e.j.get(t).destroy(),e.j.delete(t)),i&&e.j.set(t,i);var r=n+e.A.addExtraFeaturesToSourceBuffer(n);e.l.get(t).changeType(r),e.C.set(t,n)}Ws(e,t)}}),null)}(e,t,l,u),3):s!=au?d.u(3):(u&&u.destroy(),w(d,Zs(e,r),3))):d.return(!0)}))}(e,t,o,s,u),2)):(d.h||(c.push(Ys(e,t,(function(){return zs(e,t)}),null)),e.m&&c.push(Ys(e,l.ea,(function(){return zs(e,l.ea)}),null))),a||(c.push(Ys(e,t,(function(){return qs(e,t,n)}),null)),e.m&&c.push(Ys(e,l.ea,(function(){return qs(e,l.ea,n)}),null))),0==i&&1/0==r||(c.push(Ys(e,t,(function(){return Xs(e,t,i,r)}),null)),e.m&&c.push(Ys(e,l.ea,(function(){return Xs(e,l.ea,i,r)}),null))),c.length?w(d,Promise.all(c),0):d.u(0))}))}function Ks(e){R((function(t){return e.H.g||e.g.error||e.L||e.F||Os(e)||js(e)?t.return():w(t,Js(e,(function(){Os(e)||js(e)||e.i.clearLiveSeekableRange()})),0)}))}function Gs(e,t,n,i){i<=n?Ws(e,t):e.l.get(t).remove(n,i)}function zs(e,t){var n=e.l.get(t),i=n.appendWindowStart,r=n.appendWindowEnd;n.abort(),n.appendWindowStart=i,n.appendWindowEnd=r,Ws(e,t)}function qs(e,t,n){0>n&&(n+=.001),e.l.get(t).timestampOffset=n,Ws(e,t)}function Xs(e,t,n,i){var r=e.l.get(t);r.appendWindowEnd===i&&r.appendWindowStart===n||(r.appendWindowStart=0,r.appendWindowEnd=i,r.appendWindowStart=n),Ws(e,t)}function Ws(e,t){if(e.F||e.H.g){var n=e.o.get(t);n&&n.length&&((n=n[0])&&n.p&&n.p.resolve(),e.o.set(t,[]))}else(n=e.o.get(t)[0])&&(n.p.resolve(),$s(e,t))}function Ys(e,t,n,i){return Wr(e.H),n={start:n,p:new Sr,uri:i},e.o.get(t).push(n),1==e.o.get(t).length&&Qs(e,t),n.p}function Js(e,t){var n,i,r,a,o,s,u,c,d,h,p;return R((function(f){switch(f.g){case 1:for(Wr(e.H),n=[],i=Array.from(e.l.keys()),r=l(i),a=r.next(),o={};!a.done;o={ready:void 0},a=r.next())s=a.value,o.ready=new Sr,u={start:function(e){return function(){return e.ready.resolve()}}(o),p:o.ready,uri:null},(c=e.o.get(s)).push(u),n.push(o.ready),1==c.length&&u.start();return x(f,2),w(f,Promise.all(n),4);case 4:A(f,3);break;case 2:throw k(f);case 3:return x(f,5,6),w(f,t(),6);case 6:for(E(f),d=l(i),h=d.next();!h.done;h=d.next())p=h.value,$s(e,p);I(f,0);break;case 5:throw new Ne(2,3,3015,k(f),e.g.error||"No error in the media element",null)}}))}function $s(e,t){e.o.get(t).shift(),Qs(e,t)}function Qs(e,t){var n=e.o.get(t)[0];if(n)try{n.start()}catch(i){"QuotaExceededError"==i.name?n.p.reject(new Ne(2,3,3017,t)):Ls(e)?n.p.reject(new Ne(2,3,3015,i,e.g.error||"No error in the media element",n.uri)):n.p.reject(new Ne(2,3,3024,t)),$s(e,t)}}function Zs(e,t){return Js(e,(function(){return function(e,t){var n,i,r,a,o,s,u,c,d,h,p,f,g,m,v,y,b,T,x;return R((function(A){if(1==A.g){if(e.F||e.L)return A.return();for(n=at,e.F=!0,e.m=!1,i=e.g.currentTime,r=e.g.autoplay,e.g.paused||(e.Ya=!0),e.eb&&(e.g.autoplay=!1),S(A,2),e.s.Ra(),a=l(e.j.values()),o=a.next();!o.done;o=a.next())o.value.destroy();for(s=l(e.l.values()),u=s.next();!u.done;u=s.next()){c=u.value;try{e.i.removeSourceBuffer(c)}catch(e){}}return e.j.clear(),e.l.clear(),d=e.i.duration,e.K=new Sr,e.i=Ps(e,e.K),w(A,e.K,4)}if(2!=A.g){for(!isNaN(d)&&d?e.i.duration=d:!isNaN(e.wa)&&e.wa&&(e.i.duration=e.wa),h=new Sr,p=e.i.sourceBuffers,f=t.size,g=0,m=function(){++g===f&&(h.resolve(),e.s.Ja(p,"addsourcebuffer",m))},e.s.D(p,"addsourcebuffer",m),v=l(t.keys()),y=v.next();!y.done;y=v.next())b=y.value,T=t.get(b),Rs(e,b,T,T.codecs);return(x=t.get(n.ea))&&x.isAudioMuxedInVideo&&(e.m=!0),e.m&&!e.o.has(n.ea)&&e.o.set(n.ea,[]),e.g.currentTime=i,w(A,h,2)}return E(A),e.F=!1,Wr(e.H),e.s.Aa(e.g,"canplaythrough",(function(){e.H.g||(e.g.autoplay=r,e.Ya&&(e.Ya=!1,e.g.play()))})),I(A,0)}))}(e,t)}))}function eu(e,t,n,i){var r=!1,a=nt("audio",(i||"").split(",")),o=nt("video",(i||"").split(",")),s=o;"audio"==t&&(s=a),s||(s=i),i=ni(n,s);var u=ui(e.C.get(t)),l=e.A.forceTransmux;if(!ht(i)||!e.G&&hi.includes(i)?l=!0:l||n==u||(l="WEBKIT"===te().Da()&&hi.includes(n)),l&&(n=Yn(e=ii(n,s)))){var c=n();a&&o&&(r=!0),i=c.convertCodecs(t,e)}return t=oi(li(i)),{ec:c,Xk:r,Jh:ui(i),codec:t,mimeType:i}}function tu(e,t,n,i,r){if(t==rt)return{type:ru,nf:n,ec:null};var a=oi(li(e.C.get(t))),o=ui(e.C.get(t)),s=eu(e,t,n,i),u=s.ec,l=s.Xk,c=s.Jh,d=s.codec;s=s.mimeType;var h=!0;return l&&e.C.has("audio")&&(n=eu(e,"audio",n,i),i=oi(li(e.C.get("audio"))),h=ui(e.C.get("audio")),h=i==n.codec&&h==n.Jh,n.ec&&n.ec.destroy()),a===d&&o===c&&h?{type:ru,nf:s,ec:u}:(a=!0,(e.m&&!r.has("audio")||l&&u&&!e.j.has(t))&&(a=!1),a&&"smooth"===e.A.codecSwitchingStrategy&&pt()?{type:ou,nf:s,ec:u}:(u&&u.destroy(),{type:au,nf:s,ec:null}))}(i=Ds.prototype).destroy=function(){return this.H.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 R((function(h){if(1==h.g)return r=at,w(h,d.K,2);if(3!=h.g)return Os(d)||js(d)?(z("Expected MediaSource to be open during init(); reopening the media source."),d.K=new Sr,d.i=Ps(d,d.K),w(h,d.K,3)):h.u(3);for(d.G=t,d.W=n,d.ab=i,d.Za=!d.G&&"HLS"==d.W&&!d.ab,d.ba.clear(),d.U=null,d.va=null,d.S=null,d.na=null,d.ka=new Sr,a=l(e.keys()),o=a.next();!o.done;o=a.next())s=o.value,u=e.get(s),Rs(d,s,u,u.codecs),d.m?(d.o.set(r.ea,[]),d.o.set(r.Ca,[])):d.o.set(s,[]);(c=e.get(r.ea))&&c.isAudioMuxedInVideo&&(d.m=!0),T(h)}))},i.configure=function(e){this.A=e,this.h&&(this.h.A=e.modifyCueCallback)},i.Nb=function(){var e={total:this.F?[]:Yo(this.g.buffered),audio:Yo(Bs(this,"audio")),video:Yo(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,i){var r,a=this;return R((function(o){return 1==o.g?(e==(r=at).Ca&&a.I&&a.I.remove(i),e==r.Ta?w(o,a.h.remove(t,n),0):n>t?w(o,Ys(a,e,(function(){return Gs(a,e,t,n)}),null),5):o.u(0)):a.m?w(o,Ys(a,r.ea,(function(){return Gs(a,r.ea,t,n)}),null),0):o.u(0)}))},i.flush=function(e){var t,n=this;return R((function(i){return 1==i.g?e==(t=at).Ta?i.return():w(i,Ys(n,e,(function(){n.g.currentTime-=.001,Ws(n,e)}),null),2):n.m?w(i,Ys(n,t.ea,(function(){var e=t.ea;n.g.currentTime-=.001,Ws(n,e)}),null),0):i.u(0)}))},i.endOfStream=function(e){var t=this;return R((function(n){return w(n,Js(t,(function(){Os(t)||js(t)||(e?t.i.endOfStream(e):t.i.endOfStream())})),0)}))},i.pb=function(e){var t=this;return R((function(n){return w(n,Js(t,(function(){if(t.A.durationReductionEmitsUpdateEnd&&e<t.i.duration)for(var n=l(t.l.keys()),i=n.next();!i.done;i=n.next()){i=i.value;var r={start:function(){},p:new Sr,uri:null};t.o.get(i).unshift(r)}t.i.duration=e,t.wa=e})),0)}))},i.getDuration=function(){return this.i.duration};var nu=e.URL.createObjectURL,iu="sequence",ru="none",au="reset",ou="changeType";function su(e,t,n){this.i=e,this.C=t,this.s=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.o=!1,this.m=e}function uu(e,t,n,i){var r=this;this.s=i,this.g=e,this.B=t,this.h=n,this.o=new $,this.l=!1,this.F=e.readyState,this.G=this.C=this.j=0,this.m=function(e){if(!e.h.stallEnabled)return null;var t=e.h.stallThreshold,n=e.h.stallSkip;return new cu(new du(e.g),t,(function(){return R((function(t){if(1==t.g)return Yo(e.g.buffered).length?n?(e.g.currentTime+=n,t.u(2)):w(t,e.g.play(),3):t.return();if(2!=t.g){if(!e.g)return t.return();e.g.pause(),e.g.play()}e.G++,e.s(new Dr("stalldetected")),T(t)}))}))}(this),this.A=!1,this.o.D(e,"waiting",(function(){return lu(r)})),this.i=new Ti((function(){lu(r)})).Fa(this.h.gapJumpTimerTime)}function lu(e){if(0!=e.g.readyState){if(e.g.seeking){if(!e.l)return}else e.l=!1;if(!e.g.paused||e.g.currentTime==e.j&&(e.g.autoplay||e.g.currentTime!=e.j)){var t;if(e.g.readyState!=e.F&&(e.F=e.g.readyState),!(t=!e.m)){var n=(t=e.m).h,i=hu(n),r=n.g.currentTime,a=Date.now()/1e3;t.g==r&&t.m==i||(t.l=a,t.g=r,t.m=i,t.i=!1),(i=(r=a-t.l)>=t.o&&i&&!t.i)&&(t.j&&t.j(t.g,r),t.i=!0,t.g=n.g.currentTime),t=!i}t&&(t=e.g.currentTime,i=function(e,t,n){return e&&e.length&&!zo(e)&&0<=(e=Yo(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.h.gapDetectionThreshold),null==i||0==i&&!e.A||(r=n.start(i),(a=e.h.gapPadding)&&(r=Math.ceil(100*(r+a))/100),r>=e.B.Fb()||.001>r-t||(0!=i&&n.end(i-1),e.g.currentTime=r,t==e.j&&(e.j=r),e.C++,e.s(new Dr("gapjumped")))))}}}function cu(e,t,n){this.h=e,this.m=hu(e),this.g=e.g.currentTime,this.l=Date.now()/1e3,this.i=!1,this.o=t,this.j=n}function du(e){var t=this;this.g=e,this.h=new $,this.i=!1,this.h.D(this.g,"audiofocuspaused",(function(){t.i=!0})),this.h.D(this.g,"audiofocusgranted",(function(){t.i=!1})),this.h.D(this.g,"audiofocuslost",(function(){t.i=!0}))}function hu(e){if(e.g.paused||0==e.g.playbackRate||e.i||0==e.g.buffered.length)var t=!1;else e:{t=e.g.currentTime;for(var n=(e=l(Yo(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 pu(e,t,n,i){t==HTMLMediaElement.HAVE_NOTHING||e.readyState>=t?i():(t=fu.value().get(t),n.Aa(e,t,i))}(i=su.prototype).getDuration=function(){return this.l},i.Hj=function(){return this.h},i.Li=function(e){this.i=e},i.pb=function(e){this.l=e},i.Nj=function(){return this.i},i.Ki=function(e){this.A=e},i.Zc=function(e){e&&!this.B&&(this.I=!0),this.B=e},i.Gf=function(e){this.s=e},i.We=function(){return this.s},i.lh=function(e){this.C=e},i.yj=function(){return this.C},i.si=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.pf(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.o&&(this.i=n-this.g-this.h)}}},i.$d=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.pf(t),this.g=Math.max(this.g,n),null!=this.i&&this.F&&!this.o&&(this.i=i-this.g-this.h)}},i.ri=function(e,t){this.pf(e),1/0==t||this.V()||(this.g=Math.max(this.g,t))},i.Ij=function(){return this.g},i.hf=function(){this.o=!0},i.ik=function(){return this.o},i.mh=function(e){this.m=e},i.Dj=function(){return this.m},i.pf=function(e){null==this.j?this.j=e:this.I||(this.j=Math.min(this.j,e))},i.Rg=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.V=function(){return 1/0==this.l&&!this.B},i.Tc=function(){return 1/0!=this.l&&!this.B},i.Gb=function(){return Math.max(this.H,this.Ac()-this.s)},i.Ni=function(e){this.H=e},i.Ac=function(){return this.V()||this.Tc()?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.Qd=function(e){var t=Math.max(this.j,this.H);return 1/0==this.s?Math.ceil(1e3*t)/1e3:Math.max(t,Math.min(this.Ac()-this.s+e,this.Fb()))},i.Xb=function(){return this.Qd(0)},i.Fb=function(){return Math.max(0,this.Ac()-(this.V()||this.Tc()?this.C:0))},i.Zi=function(){return!(null==this.i||null!=this.g&&this.F)},i.Ji=function(e){this.G=e},i.tj=function(){return this.G},F("shaka.media.PresentationTimeline",su),su.prototype.getAvailabilityTimeOffset=su.prototype.tj,su.prototype.setAvailabilityTimeOffset=su.prototype.Ji,su.prototype.usingPresentationStartTime=su.prototype.Zi,su.prototype.getSeekRangeEnd=su.prototype.Fb,su.prototype.getSeekRangeStart=su.prototype.Xb,su.prototype.getSafeSeekRangeStart=su.prototype.Qd,su.prototype.getSegmentAvailabilityEnd=su.prototype.Ac,su.prototype.setUserSeekStart=su.prototype.Ni,su.prototype.getSegmentAvailabilityStart=su.prototype.Gb,su.prototype.isInProgress=su.prototype.Tc,su.prototype.isLive=su.prototype.V,su.prototype.offset=su.prototype.offset,su.prototype.notifyMaxSegmentDuration=su.prototype.Rg,su.prototype.notifyMinSegmentStartTime=su.prototype.pf,su.prototype.getInitialProgramDateTime=su.prototype.Dj,su.prototype.setInitialProgramDateTime=su.prototype.mh,su.prototype.isStartTimeLocked=su.prototype.ik,su.prototype.lockStartTime=su.prototype.hf,su.prototype.getMaxSegmentEndTime=su.prototype.Ij,su.prototype.notifyPeriodDuration=su.prototype.ri,su.prototype.notifySegments=su.prototype.$d,su.prototype.notifyTimeRange=su.prototype.si,su.prototype.getDelay=su.prototype.yj,su.prototype.setDelay=su.prototype.lh,su.prototype.getSegmentAvailabilityDuration=su.prototype.We,su.prototype.setSegmentAvailabilityDuration=su.prototype.Gf,su.prototype.setStatic=su.prototype.Zc,su.prototype.setClockOffset=su.prototype.Ki,su.prototype.getPresentationStartTime=su.prototype.Nj,su.prototype.setDuration=su.prototype.pb,su.prototype.setPresentationStartTime=su.prototype.Li,su.prototype.getMaxSegmentDuration=su.prototype.Hj,su.prototype.getDuration=su.prototype.getDuration,uu.prototype.release=function(){this.o&&(this.o.release(),this.o=null),null!=this.i&&(this.i.stop(),this.i=null),this.m&&(this.m.release(),this.m=null),this.g=this.B=this.s=null},uu.prototype.tf=function(){this.A=!0,this.i&&this.i.Fa(this.h.gapJumpTimerTime),lu(this)},cu.prototype.release=function(){this.h&&this.h.release(),this.j=this.h=null},du.prototype.release=function(){this.h&&this.h.release(),this.h=null};var fu=new ee((function(){return new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]])}));function gu(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 $,this.i=new wu(e),pu(this.g,HTMLMediaElement.HAVE_METADATA,this.h,(function(){yu(r,r.j())}))}function mu(e){return e.o?e.g.currentTime:e.j()}function vu(e,t){0<e.g.readyState?Tu(e.i,t):pu(e.g,HTMLMediaElement.HAVE_METADATA,e.h,(function(){yu(e,e.j())}))}function yu(e,t){.001>Math.abs(e.g.currentTime-t)?bu(e):(e.h.Aa(e.g,"seeking",(function(){bu(e)})),Tu(e.i,e.g.currentTime&&0!=e.g.currentTime?e.g.currentTime:t))}function bu(e){e.o=!0,e.h.D(e.g,"seeking",(function(){return e.m()})),e.s(e.g.currentTime)}function wu(e){var t=this;this.g=e,this.m=10,this.j=this.l=this.i=0,this.h=new Ti((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 Tu(e,t){e.l=e.g.currentTime,e.j=t,e.i=e.m,e.g.currentTime=t,e.h.Fa(.1)}function xu(e){this.g=e,this.i=!1,this.h=null,this.j=new $}function Su(e){return e.g.getStartDate&&(e=e.g.getStartDate().getTime(),!isNaN(e))?e/1e3:null}function Au(e,t){return 0<(e=e.g.seekable).length&&(t=Math.max(e.start(0),t),t=Math.min(e.end(e.length-1),t)),t}function ku(e,t,n,i,r,a){var o=this;this.h=e,this.g=t.presentationTimeline,this.l=n,this.s=r,this.o=null,this.j=new uu(e,t.presentationTimeline,n,a),this.i=new gu(e,(function(){e:{var e=o.j;e.l=!0,e.A=!1,e.i&&e.i.Fa(e.h.gapJumpTimerTime),lu(e);var t=mu(o.i);if(e=Cu(o,t),!ft()&&.001<Math.abs(e-t)){t=!1;var n=te().Gi();if(n){var i=Date.now()/1e3;(!o.o||o.o<i-n)&&(o.o=i,t=!0)}else t=!0;if(t){vu(o.i,e),e=void 0;break e}}o.s(),e=void 0}return e}),(function(e){var t=o.j;t.g.seeking&&!t.l&&(t.l=!0,t.j=e),t.i&&t.i.Fa(t.h.gapJumpTimerTime),lu(t)}),(function(){return Eu(o,i)})),this.m=new Ti((function(){if(0!=o.h.readyState&&!o.h.paused){var e=mu(o.i),t=o.g.Xb(),n=o.g.Fb();3>n-t&&(t=n-3),e<t&&(e=Cu(o,e),o.h.currentTime=e)}}))}function Eu(e,t){return null==t?t=1/0>e.g.getDuration()?e.g.Xb():e.g.Fb():t instanceof Date?t=t.getTime()/1e3-(e.g.m||e.g.i):0>t&&(t=e.g.Fb()+t),Iu(e,Mu(e,t))}function Iu(e,t){var n=e.g.getDuration();return t>=n?n-e.l.durationBackoff:t}function Cu(e,t){var n=e.l.rebufferingGoal,i=e.l.safeSeekOffset,r=e.g.Xb(),a=e.g.Fb(),o=e.g.getDuration();3>a-r&&(r=a-3);var s=e.g.Qd(n),u=e.g.Qd(i);return n=e.g.Qd(n+i),t>=o?Iu(e,t):t>a?a-e.l.safeSeekEndOffset:t<r?e.g.V()&&e.l.returnToEndOfLiveWindowWhenOutside?a-e.l.safeSeekEndOffset:Xo(e.h.buffered,u)?u:n:t>=s||Xo(e.h.buffered,t)?t:n}function Mu(e,t){var n=e.g.Xb();return t<n?n:t>(e=e.g.Fb())?e:t}function Du(e){this.g=e,this.m=null,this.i=0,this.o=!1}function Pu(e){return e.g[0]||null}function Ru(e,t,n){return new Du([e=new Vo(e,e+t,(function(){return n}),0,null,null,e,e,e+t)])}function Lu(e,t,n,i){this.i=e,this.h=t,this.g=n,this.reverse=i}function Nu(){Du.call(this,[]),this.h=[]}function Ou(e){var t=this;this.g=e,this.j=!1,this.i=this.g.Ve(),this.h=new Ti((function(){t.g.ni(.25*t.i)}))}function ju(e){e.h.stop();var t=e.j?0:e.i;if(0<=t)try{return void(e.g.Ve()!=t&&e.g.nh(t))}catch(e){}e.h.Fa(.25),0!=e.g.Ve()&&e.g.nh(0)}function Uu(e){var t=this;this.j=e,this.h=new $,this.g=new Set,this.i=new Ti((function(){_u(t,!1)})).Jb(),e.paused||this.i.Fa(.25),this.h.D(e,"playing",(function(){t.i.Jb().Fa(.25)})),this.h.D(e,"pause",(function(){t.i.stop()}))}function _u(e,t){for(var n=e.j.currentTime,i=(e=l(e.g)).next();!i.done;i=e.next())i.value.j(n,t)}function Bu(e){Lr.call(this),this.g=new Map,this.h=e}function Fu(e,t,n){return!!((e=e.h()[n])&&0<e.length&&(n=e[e.length-1].end,t>=e[0].start&&t<n))}function Vu(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 Hu(e){Lr.call(this),this.h=new Map,this.i=e,this.g=null}function Ku(e,t){var n=t.schemeIdUri+"_"+t.id+"_"+t.startTime.toFixed(1)+"_"+t.endTime.toFixed(1);e.h.has(n)||(e.h.set(n,t),t=new Dr("regionadd",new Map([["region",t]])),e.dispatchEvent(t),function(e){e.g||(e.g=new Ti((function(){for(var t=e.i(),n=l(e.h),i=n.next();!i.done;i=n.next()){var r=l(i.value);i=r.next().value,(r=r.next().value).endTime<t.start&&(e.h.delete(i),i=new Dr("regionremove",new Map([["region",r]])),e.dispatchEvent(i))}!e.h.size&&e.g&&(e.g.stop(),e.g=null)})).Fa(2))}(e))}function Gu(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 zu(e,t){e.l=t;for(var n=(e=l(e.h.values())).next();!n.done;n=e.next())n.value.g=t}function qu(e,t,n){if(n=void 0!==n&&n,!e.i.segmentIndex)return Promise.resolve();if(e.g||(e.g=e.i.segmentIndex.Wb(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.endByte&&(i=!1),2==n.Cc()&&(i=!1),n.Yb(!1)&&(i=!1),i&&n.Y&&t.push(Xu(e,n.Y)),i&&!e.h.has(n)&&(i=new Zu(e.l),t.push(el(i,n,e.i)),e.h.set(n,i))}return Ju(e),Promise.all(t)}function Xu(e,t){if(!e.i.segmentIndex||t.Yb()||Array.from(e.j.keys()).some((function(e){return Fo(e,t)})))return Promise.resolve();var n=new Zu(e.l),i=el(n,t,e.i);return e.j.set(t,n),i}function Wu(e,t){for(var n=(t=l(t.keys())).next();!n.done;n=t.next())(n=n.value)&&Qu(e,n)}function Yu(e){Wu(e,e.h),Wu(e,e.j),e.g=null}function Ju(e){for(var t=Array.from(e.h.keys()),n=l(e.j.keys()),i=n.next(),r={};!i.done;r={Lg:void 0},i=n.next())r.Lg=i.value,t.some(function(e){return function(t){return Fo(t.Y,e.Lg)}}(r))||Qu(e,r.Lg)}function $u(e,t){e.m=t;for(var n=Array.from(e.h.keys());n.length>t;){var i=n.pop();i&&Qu(e,i)}Ju(e)}function Qu(e,t){var n=e.h;t instanceof Bo&&(n=e.j),e=n.get(t),n.delete(t),e&&e.abort()}function Zu(e){this.g=e,this.ae=this.sh=null}function el(e,t,n){var i=new Uint8Array(0);return e.ae=e.g(t,n,(function(t){return R((function(n){if(1==n.g)return i=0<i.byteLength?$e(i,t):t,e.sh?w(n,e.sh(i),3):n.u(0);i=new Uint8Array(0),T(n)}))})),e.ae.promise.catch((function(e){return e instanceof Ne&&7001==e.code?Promise.resolve():Promise.reject(e)}))}function tl(e){var t=ui(e);return{type:t.split("/")[0],mimeType:t,codecs:e=li(e),language:null,height:null,width:null,channelCount:null,sampleRate:null,closedCaptions:new Map,oe:null,colorGamut:null,frameRate:null}}function nl(e){for(var t=new Set,n=[],i=(e=l(e)).next();!i.done;i=e.next()){var r=si(i=i.value);t.has(r)||(n.push(i),t.add(r))}return t=it("audio",n),i=it("video",n),e=it(rt,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?ht('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 il(t,n,i){var r,a,o,s,u;return R((function(l){if(1==l.g)return(r=n).cryptoKey?l.u(2):w(l,r.fetchKey(),3);if(!(a=r.iv))for(a=De(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 rl(e,t,n,i,r){return e=Br(e,i,r),0==t&&null==n||(e.headers.Range=n?"bytes="+t+"-"+n:"bytes="+t+"-"),e}function al(e,t){var n=this;this.g=t,this.j=e,this.i=null,this.K=new Map,this.C=1,this.A=this.o=null,this.P=0,this.h=new Map,this.I=!1,this.S=null,this.B=!1,this.l=new Xr((function(){return function(e){var t,n,i,r,a,o;return R((function(s){if(1==s.g){for(e.s&&e.s.stop(),e.s=null,e.H&&e.H.stop(),e.H=null,t=[],n=l(e.h.values()),i=n.next();!i.done;i=n.next())Al(r=i.value),t.push(kl(r)),r.$&&(Yu(r.$),r.$=null);for(a=l(e.m.values()),o=a.next();!o.done;o=a.next())Yu(o.value);return w(s,Promise.all(t),2)}e.h.clear(),e.m.clear(),e.g=null,e.j=null,e.i=null,e.G=null,T(s)}))}(n)})),this.M=Date.now()/1e3,this.m=new Map,this.N={projection:null,hfov:null},this.W=0,this.U=1/0,this.F=null,this.L=[],this.s=new Ti((function(){if(n.j&&n.g)if(n.j.presentationTimeline.V()){var e=n.j.presentationTimeline.Xb(),t=n.j.presentationTimeline.Fb();1<t-e?function(e,t,n){R((function(i){return e.H.g||e.g.error||e.L||e.F||Os(e)||js(e)?i.return():w(i,Js(e,(function(){Os(e)||js(e)||e.i.setLiveSeekableRange(t,n)})),0)}))}(n.g.Z,e,t):Ks(n.g.Z)}else Ks(n.g.Z),n.s&&n.s.stop();else n.s&&n.s.stop()})),this.G=null,this.H=new Ti((function(){var e=n.g.video;!e.ended&&n.G&&(e.currentTime=n.G,n.G=null)}))}function ol(e,t){for(var n=0>e.g.ub(),i=l(e.h.values()),r=i.next();!r.done;r=i.next())(r=r.value).sa&&r.sa.Dd(n),r.$&&r.$.Dd(n);for(r=(i=l(e.m.values())).next();!r.done;r=i.next())r.value.Dd(n);(n=e.h.get("video"))&&(i=n.stream)&&(t?(t=i.trickModeVideo)&&!n.Fc&&(ll(e,t,!1,0,!1),n.Fc=i):(t=n.Fc)&&(n.Fc=null,ll(e,t,!0,0,!1)))}function sl(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.o=t,e.I&&(t.video&&ll(e,t.video,n,i,r,a),t.audio&&ll(e,t.audio,n,i,r,a))}function ul(e,t){R((function(n){if(1==n.g)return e.F=null,e.A=t,e.I?t.segmentIndex?n.u(2):w(n,t.createSegmentIndex(),2):n.return();ll(e,t,!0,0,!1),T(n)}))}function ll(e,t,n,i,r,a){var o=e.h.get(t.type);o||t.type!=rt?o&&(o.Fc&&(t.trickModeVideo?(o.Fc=t,t=t.trickModeVideo):o.Fc=null),o.stream!=t||r)&&(e.m.has(t)?o.$=e.m.get(t):o.$&&function(e,t){t&&t!==e.i&&(Yu(e),e.i=t)}(o.$,t),t.type==rt&&o.stream!=t&&(r=ni(t.mimeType,t.codecs),Ns(e.g.Z,r,e.j.sequenceMode,t.external)),!e.m.has(o.stream)&&o.stream.closeSegmentIndex&&(o.Qa?(r="("+o.type+":"+o.stream.id+")",e.K.has(r)||e.K.set(r,o.stream.closeSegmentIndex)):o.stream.closeSegmentIndex()),r=o.stream.isAudioMuxedInVideo!=t.isAudioMuxedInVideo,o.stream=t,o.sa=null,o.ag=!!a,t.dependencyStream?o.yc=hl(e,t.dependencyStream):o.yc=null,r&&(o.mb=null,o.lc=null,o.kc=null,t.isAudioMuxedInVideo&&(t=null,"video"===o.type?t=e.h.get("audio"):"audio"===o.type&&(t=e.h.get("video")),t&&(kl(t).catch((function(){})),t.mb=null,t.lc=null,t.kc=null,dl(e,t),cl(e,t).catch((function(t){e.g&&e.g.onError(t)}))))),n?o.Kc?o.Sf=!0:o.Qa?(o.Ic=!0,o.Oe=i,o.Sf=!0):(Al(o),xl(e,o,!0,i).catch((function(t){e.g&&e.g.onError(t)}))):o.Qa||o.zb||Sl(e,o,0),cl(e,o).catch((function(t){e.g&&e.g.onError(t)}))):function(e,t){var n,i,r,a,o;R((function(s){switch(s.g){case 1:return n=at,e.P++,i=e.P,x(s,2),w(s,Vs(e.g.Z,n.Ta),4);case 4:A(s,3);break;case 2:r=k(s),e.g&&e.g.onError(r);case 3:a=ni(t.mimeType,t.codecs),Ns(e.g.Z,a,e.j.sequenceMode,t.external),(e.g.Z.ha.isTextVisible()||e.i.alwaysStreamText)&&e.P==i&&(o=hl(e,t),e.h.set(n.Ta,o),Sl(e,o,0)),T(s)}}))}(e,t)}function cl(e,t){var n,i,r;return R((function(a){if(1==a.g)return t.Hb?(n=t.stream,i=t.Hb,n.segmentIndex?a.u(2):w(a,n.createSegmentIndex(),2)):a.return();if(4!=a.g)return!(r=n.dependencyStream)||r.segmentIndex?a.u(4):w(a,r.createSegmentIndex(),4);if(t.Hb!=i||t.stream!=n)return a.return();var o=e.g.Qc(),s=_s(e.g.Z,t.type),u=t.stream.segmentIndex.find(t.Ia?t.Ia.endTime:o),l=null==u?null:t.stream.segmentIndex.get(u);u=l&&l.endByte?l.endByte-l.startByte:null,l&&!u&&(u=(l.endTime-l.getStartTime())*(t.stream.bandwidth||0)/8),u?((l=l.Y)&&(u+=(l.endByte?l.endByte-l.startByte:null)||0),o=8*u/(l=e.g.getBandwidthEstimate())<(s||0)-o-e.i.rebufferingGoal||t.Hb.h.g>u):o=!1,o&&t.Hb.abort(),T(a)}))}function dl(e,t){t.Kc||t.Ic||(t.Qa?(t.Ic=!0,t.Oe=0):null==Us(e.g.Z,t.type)?null==t.zb&&Sl(e,t,0):(Al(t),xl(e,t,!1,0).catch((function(t){e.g&&e.g.onError(t)}))))}function hl(e,t){var n={stream:t,type:t.type,sa:null,$:pl(e,t),Ia:null,mb:null,gf:null,lc:null,kc:null,df:null,ef:null,Fc:null,endOfStream:!1,Qa:!1,zb:null,Ic:!1,Oe:0,Sf:!1,Kc:!1,Yc:!0,ag:!1,$g:!1,Sd:!1,Hb:null,yc:null};return t.dependencyStream&&(n.yc=hl(e,t.dependencyStream)),n}function pl(e,t){if("video"===t.type&&e.i.disableVideoPrefetch||"audio"===t.type&&e.i.disableAudioPrefetch||t.type===rt&&("application/cea-608"==t.mimeType||"application/cea-708"==t.mimeType)||t.type===rt&&e.i.disableTextPrefetch)return null;if(e.m.has(t))return e.m.get(t);var n=e.h.get(t.type);return(n=n&&n.$)&&t===n.i?n:0<e.i.segmentPrefetchLimit?new Gu(e.i.segmentPrefetchLimit,t,(function(t,n,i){return Tl(t,n,i||null,e.i.retryParameters,e.g.pc)}),0>e.g.ub()):null}function fl(t,n){var i,r,a,o,s,u,c,d,h;return R((function(p){switch(p.g){case 1:if(Wr(t.l),i=at,n.Qa||null==n.zb||n.Kc)return p.return();if(n.zb=null,!n.Ic){p.u(2);break}return w(p,xl(t,n,n.Sf,n.Oe),3);case 3:return p.return();case 2:if(function(e,t){for(var n=l(e.K.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.K.delete(i))}}(t,n),n.stream.segmentIndex){p.u(4);break}return r=n.stream,x(p,5),w(p,n.stream.createSegmentIndex(),7);case 7:A(p,6);break;case 5:return a=k(p),w(p,El(t,n,a),8);case 8:return p.return();case 6:if(r!=n.stream)return r.closeSegmentIndex&&r.closeSegmentIndex(),n.Qa||n.zb||Sl(t,n,0),p.return();case 4:if(!n.yc){p.u(9);break}if(n.yc.stream.segmentIndex){p.u(9);break}return x(p,11),w(p,n.yc.stream.createSegmentIndex(),13);case 13:A(p,9);break;case 11:k(p);case 9:x(p,14),o=function(t,n){if(bl(n))return function(e,t){var n=_s(e,"video")||0;vi(e.h,t,n)}(t.g.Z,n.stream.originalId||""),null;if(n.type==rt&&function(e){e.h&&vi(e.h,"",0)}(t.g.Z),n.stream.isAudioMuxedInVideo)return null;var i=t.i.updateIntervalSeconds/Math.max(1,Math.abs(t.g.ub()));if(!Ls(t.g.Z)&&n.type!=rt)return i/2;var r=t.g.Qc();if("audio"===n.type)for(var a=l(t.m.keys()),o=a.next();!o.done;o=a.next())(o=t.m.get(o.value)).$a(r,!0),qu(o,r);a=n.Ia?n.Ia.endTime:r;var s=function(e,t,n){return t==rt?null==(e=e.h).h||e.h<n?0:e.h-Math.max(n,e.g):Wo(e=Bs(e,t),n)}(t.g.Z,n.type,r);o=Math.max(1,Math.max(t.i.rebufferingGoal,t.i.bufferingGoal)*t.C);var u=t.j.presentationTimeline.getDuration()-a,c=_s(t.g.Z,n.type);if(1e-6>u&&c)return n.endOfStream=!0,"video"==n.type&&(t=t.h.get(rt))&&bl(t)&&(t.endOfStream=!0),null;if(n.endOfStream=!1,s>=o)return i/2;if(u=!n.sa,c=function(e,t,n,i){if(t.sa)return(n=t.sa.current())&&t.Ia&&.001>Math.abs(t.Ia.startTime-n.startTime)&&(n=t.sa.next().value),n;if(t.Ia||i)return n=t.Ia?t.Ia.endTime:i,e=0>e.g.ub(),t.stream.segmentIndex&&(t.sa=t.stream.segmentIndex.Wb(n,!1,e)),t.sa&&t.sa.next().value;i=e.j.sequenceMode||Cl(e)?0:e.i.inaccurateManifestTolerance;var r=Math.max(n-i,0);e=0>e.g.ub();var a=null;return i&&(t.stream.segmentIndex&&(t.sa=t.stream.segmentIndex.Wb(r,!1,e)),a=t.sa&&t.sa.next().value),a||(t.stream.segmentIndex&&(t.sa=t.stream.segmentIndex.Wb(n,!1,e)),a=t.sa&&t.sa.next().value),a}(t,n,r,c),!c)return i;s=n.mb;var d=c.Y;s&&d&&Fo(d,s)&&(s.g=d.g),s=!1,u&&n.ag&&(s=!0,n.ag=!1),u=1/0;for(var h=(d=l(d=Array.from(t.h.values()))).next();!h.done;h=d.next())bl(h=h.value)||h.sa&&!h.sa.current()||(u=Math.min(u,h.Ia?h.Ia.endTime:r));return a>=u+t.j.presentationTimeline.h?i:(n.$&&n.sa&&!t.m.has(n.stream)&&(n.$.$a(c.startTime+.001),qu(n.$,c.startTime).catch((function(){}))),Cl(t)&&function(e,t,n){if(t.type===rt)return!1;var i=t.mb;if(!i)return!1;var r=n.Y;if(n=i.g!==r.g,"reset_to_encrypted"===e.i.crossBoundaryStrategy&&(i.encrypted||r.encrypted||(n=!1),i.encrypted&&(e.i.crossBoundaryStrategy="keep")),"RESET_ON_ENCRYPTION_CHANGE"===e.i.crossBoundaryStrategy&&i.encrypted==r.encrypted&&(n=!1),n&&t.Yc){var a=e.g.video,o=a.paused;Il(e,!0).then((function(){var t=(new Map).set("oldEncrypted",i.encrypted).set("newEncrypted",r.encrypted);e.g.onEvent(new Dr("boundarycrossed",t)),o||a.play()}))}return n}(t,n,c)||(function(t,n,i,r,a){var o,s,u,c,d,h,p,f,g,m,v,y,b,S,E,I;return R((function(C){switch(C.g){case 1:if(o=at,s=n.stream,u=n.sa,n.Qa=!0,x(C,2),2==r.Cc())throw new Ne(1,1,1011);return w(C,function(e,t,n,i){var r,a,o,s,u,c,d,h,p,f,g,m,v,y,b,T;return R((function(S){switch(S.g){case 1:if(r=at,a=null==t.Ia,o=[],s=Math.max(0,Math.max(n.appendWindowStart,e.W)-.1),u=Math.min(n.appendWindowEnd,e.U)+.1,c=n.codecs||t.stream.codecs,d=si(c),h=ui(n.mimeType||t.stream.mimeType),(p=n.timestampOffset)==t.gf&&s==t.lc&&u==t.kc&&d==t.df&&h==t.ef){S.u(2);break}if(f=t.df&&t.ef&&function(e,t,n,i,r){return(e=tu(e,t,n,i,r)).ec&&e.ec.destroy(),e.type==au}(e.g.Z,t.type,h,c,Dl(e)),!f){S.u(3);break}if(g=null,t.type===r.Ca?g=e.h.get(r.ea):t.type===r.ea&&(g=e.h.get(r.Ca)),!g){S.u(3);break}return w(S,kl(g).catch((function(){})),5);case 5:g.mb=null,g.lc=null,g.kc=null,dl(e,g);case 3:return w(S,ml(e,t,p,s,u,n,d,h),2);case 2:return Fo(n.Y,t.mb)||(t.mb=n.Y,n.l&&n.Y&&(m=wl(e,t,n.Y),v=function(){var a,o,s,u,c,d,h,p,f;return R((function(g){switch(g.g){case 1:return x(g,2),w(g,m,4);case 4:return a=g.h,Wr(e.l),o=null,s=new Map,u={projection:null,hfov:null},(c=new ta).box("moov",na).box("trak",na).box("mdia",na).R("mdhd",(function(e){o=no(e.reader,e.version).timescale})).box("hdlr",(function(e){switch((e=e.reader).skip(8),e.Vc()){case"soun":s.set(r.ea,o);break;case"vide":s.set(r.Ca,o)}o=null})),t.type===r.Ca&&c.box("minf",na).box("stbl",na).R("stsd",ia).box("encv",ra).box("avc1",ra).box("avc3",ra).box("hev1",ra).box("hvc1",ra).box("dvav",ra).box("dva1",ra).box("dvh1",ra).box("dvhe",ra).box("dvc1",ra).box("dvi1",ra).box("vexu",na).box("proj",na).R("prji",(function(e){e=e.reader.Vc(),u.projection=e})).box("hfov",(function(e){e=e.reader.T()/1e3,u.hfov=e})),c.parse(a,!0,!0),t.type===r.Ca&&function(e,t){if(e.N.projection!=t.projection||e.N.hfov!=t.hfov){if(null!=t.projection||null!=t.hfov){var n=(new Map).set("detail",t);n=new Dr("spatialvideoinfo",n)}else n=new Dr("nospatialvideoinfo");n.cancelable=!0,e.g.onEvent(n),e.N=t}}(e,u),s.has(t.type)?n.Y.timescale=s.get(t.type):null!=o&&(n.Y.timescale=o),(d=t.stream.segmentIndex)instanceof Nu&&(h=function(e,t){for(var n=(e=l(e.h)).next();!n.done;n=e.next())if(null!=(n=n.value).find(t))return n.Pe();return-1}(d,n.startTime)),p=t.stream.closedCaptions&&0<t.stream.closedCaptions.size,w(g,e.g.Kh(t.type,a),5);case 5:return w(g,Fs(e.g.Z,t.type,a,null,t.stream,p,t.Yc,i,!1,!1,h),6);case 6:A(g,0);break;case 2:throw f=k(g),t.mb=null,f}}))},y=n.startTime,a&&null!=(b=_s(e.g.Z,t.type))&&(y=b),e.g.xk(y,n.Y),o.push(v()))),T=t.Ia?t.Ia.i:-1,n.i!=T&&o.push(function(e,t,n){var i,r;return R((function(a){return 1==a.g?t==(i=at).Ta?a.return():(t==i.Ca&&(e.Pa=new Sr),!e.G||(r=_s(e,t))&&.15>Math.abs(r-n)?a.return():(Ys(e,t,(function(){return zs(e,t)}),null),e.m&&Ys(e,i.ea,(function(){return zs(e,i.ea)}),null),w(a,Ys(e,t,(function(){return qs(e,t,n)}),null),2))):e.m?w(a,Ys(e,i.ea,(function(){return qs(e,i.ea,n)}),null),0):a.u(0)}))}(e.g.Z,t.type,n.startTime)),w(S,Promise.all(o),0)}}))}(t,n,r,a),4);case 4:return Wr(t.l),t.B?C.return():(c="video/mp4"==s.mimeType||"audio/mp4"==s.mimeType,d=e.ReadableStream,t.i.lowLatencyMode&&t.j.isLowLatency&&d&&c&&("HLS"!=t.j.type||r.m)?(p=new Uint8Array(0),g=f=!1,v=function(e){var o,u,l;return R((function(c){switch(c.g){case 1:if(f)return c.return();if(g=!0,Wr(t.l),t.B)return c.return();if(x(c,2),p=$e(p,e),o=!1,u=0,(new ta).box("mdat",(function(e){u=e.size+e.start,o=!0})).parse(p,!1,!0),!o){c.u(4);break}return l=p.subarray(0,u),p=p.subarray(u),w(c,vl(t,n,i,s,r,l,!0,a),5);case 5:n.$&&n.sa&&qu(n.$,r.startTime,!0);case 4:A(c,0);break;case 2:m=k(c),T(c)}}))},w(C,wl(t,n,r,v),9)):w(C,wl(t,n,r),7));case 7:return h=C.h,Wr(t.l),t.B?C.return():(Wr(t.l),n.Ic?(n.Qa=!1,Sl(t,n,0),C.return()):w(C,vl(t,n,i,s,r,h,!1,a),6));case 9:if(y=C.h,m)throw m;if(g){C.u(10);break}return f=!0,Wr(t.l),t.B?C.return():n.Ic?(n.Qa=!1,Sl(t,n,0),C.return()):w(C,vl(t,n,i,s,r,y,!1,a),10);case 10:n.$&&n.sa&&qu(n.$,r.startTime,!0);case 6:if(Wr(t.l),t.B)return C.return();n.Ia=r,u.next(),n.Qa=!1,n.$g=!1,b=t.g.Z.Nb(),S=b[n.type],JSON.stringify(S),n.Ic||(E=null,n.type===o.Ca?E=t.h.get(o.ea):n.type===o.ea&&(E=t.h.get(o.Ca)),E&&E.type==o.ea?t.g.tf(r,n.stream,E.stream.isAudioMuxedInVideo):t.g.tf(r,n.stream,n.stream.codecs.includes(","))),Al(n),Sl(t,n,0),A(C,0);break;case 2:if(I=k(C),Wr(t.l,I),t.B)return C.return();if(n.Qa=!1,7001==I.code)n.Qa=!1,Al(n),Sl(t,n,0),C.u(0);else{if(n.type!=o.Ta||!t.i.ignoreTextStreamFailures)return 3017==I.code?w(C,function(e,t,n){var i,r,a;return R((function(o){if(1==o.g){if(Array.from(e.h.values()).some((function(e){return e!=t&&e.$g})))return o.u(2);if(i=0===e.i.maxDisabledTime&&1011==n.code?1:e.i.maxDisabledTime,e.g.disableStream(t.stream,i))return o.return();if(e.i.avoidEvictionOnQuotaExceededError)return Sl(e,t,4),o.return();if(20<(r=Math.round(100*e.C)))e.C-=.2;else{if(!(4<r))return t.Sd=!0,e.B=!0,e.g.onError(n),o.return();e.C-=.04}return t.$g=!0,a=e.g.Qc(),w(o,yl(e,t,a),2)}Sl(e,t,4),T(o)}))}(t,n,I),0):(n.Sd=!0,1==I.category&&n.$&&Qu(n.$,r),I.severity=2,w(C,El(t,n,I),0));t.h.delete(o.Ta),C.u(0)}}}))}(t,n,r,c,s).catch((function(){})),n.yc&&gl(t,n.yc,r,o)),null)}(t,n),null!=o&&(Sl(t,n,o),n.Sd=!1),A(p,15);break;case 14:return s=k(p),w(p,El(t,n,s),16);case 16:return p.return();case 15:if(n.type===i.Ta)return p.return();if(u=[n],c=n.type===i.ea?i.Ca:i.ea,(d=t.h.get(c))&&u.push(d),!t.I||!u.every((function(e){return e.endOfStream}))){p.u(0);break}return w(p,t.g.Z.endOfStream(),18);case 18:Wr(t.l),0!=(h=t.g.Z.getDuration())&&h<t.j.presentationTimeline.getDuration()&&t.j.presentationTimeline.pb(h),T(p)}}))}function gl(e,t,n,i){var r,a,o,s,u,l,d,h,p,f;return R((function(g){switch(g.g){case 1:for(r=t.stream,s=(o=(a=r.segmentIndex)&&a.Wb(n))&&o.next().value;s&&e.L.includes(s.startTime);)s=o&&o.next().value;if(!s){g.u(0);break}if(!(u=s.Y)||Fo(u,t.mb)){g.u(3);break}return t.mb=u,x(g,4),w(g,wl(e,t,u),6);case 6:l=g.h;var m=e.g.Z;m.M&&lt(m.M,l,0,r),e.L=[],A(g,3);break;case 4:throw d=k(g),t.mb=null,d;case 3:if(t.Ia&&t.Ia==s){g.u(0);break}return t.Ia=s,x(g,8),w(g,wl(e,t,s),10);case 10:h=g.h,(m=e.g.Z).M&&lt(m.M,h,0,r),e.L.push(s.startTime),A(g,9);break;case 8:throw p=k(g),t.Ia=null,p;case 9:if(f=Math.max.apply(Math,[0].concat(c(e.L))),e.g.Qc()+i>f)return w(g,gl(e,t,s.startTime,i),0);g.u(0)}}))}function ml(e,t,n,i,r,a,o,s){var u,l,c,d,h;return R((function(p){switch(p.g){case 1:if(u=at,l=Dl(e),x(p,2),t.lc=i,t.kc=r,o&&(t.df=o),s&&(t.ef=s),t.gf=n,c=e.j.sequenceMode||"HLS"==e.j.type,d=null,t.type===u.Ca?d=e.h.get(u.ea):t.type===u.ea&&(d=e.h.get(u.Ca)),!(d&&d.stream&&d.stream.isAudioMuxedInVideo)){p.u(4);break}return w(p,Hs(e.g.Z,d.type,n,i,r,c,d.stream.mimeType,d.stream.codecs,l),4);case 4:return w(p,Hs(e.g.Z,t.type,n,i,r,c,a.mimeType||t.stream.mimeType,a.codecs||t.stream.codecs,l),6);case 6:A(p,0);break;case 2:throw h=k(p),t.lc=null,t.kc=null,t.df=null,t.ef=null,t.gf=null,h}}))}function vl(e,t,n,i,r,a,o,s){var u,l,c,d;return o=void 0!==o&&o,s=void 0!==s&&s,R((function(h){switch(h.g){case 1:return u=i.closedCaptions&&0<i.closedCaptions.size,e.i.shouldFixTimestampOffset&&(l="video/mp4"==i.mimeType||"audio/mp4"==i.mimeType,c=null,r.Y&&(c=r.Y.timescale),l&&c&&"video"===i.type&&"DASH"==e.j.type&&(new ta).box("moof",na).box("traf",na).R("tfdt",(function(n){var i,a,o,s,u;return R((function(l){return i=to(n.reader,n.version),(a=i.baseMediaDecodeTime)?(o=-a/c,(Number(t.gf)||0)<o?(s=t.lc,u=t.kc,w(l,ml(e,t,o,s,u,r),0)):l.u(0)):l.return()}))})).parse(a,!1,o)),w(h,yl(e,t,n),2);case 2:return Wr(e.l),d=t.Yc,t.Yc=!1,w(h,e.g.Kh(t.type,a),3);case 3:return w(h,Fs(e.g.Z,t.type,a,r,i,u,d,s,o),4);case 4:Wr(e.l),T(h)}}))}function yl(e,t,n){var i,r,a,o,s,u,c,d,h;return R((function(p){return 1==p.g?((i=t.stream.segmentIndex)instanceof Nu&&(i.$a(e.j.presentationTimeline.Gb()),r=[],function(e){for(var t=(e=l(e.h)).next();!t.done;t=e.next())n=t.value,r.push(n.Pe());var n}(i)),a=Math.max(e.i.bufferBehind*e.C,e.j.presentationTimeline.h),null==(o=Us(e.g.Z,t.type))?(e.F==t&&(e.F=null),p.return()):(s=n-o,u=e.i.evictionGoal,c=e.j.presentationTimeline.Xb(),d=e.j.presentationTimeline.Fb(),h=s-a,d-c>u&&(h=Math.max(s-a,c-u-o)),h<=u?p.return():w(p,e.g.Z.remove(t.type,o,o+h,r),2))):4!=p.g?(Wr(e.l),e.F?w(p,yl(e,e.F,n),4):p.u(0)):(Wr(e.l),void T(p))}))}function bl(e){return e&&e.type==rt&&("application/cea-608"==e.stream.mimeType||"application/cea-708"==e.stream.mimeType)}function wl(e,t,n,i){var r,a,o,s,u;return R((function(l){switch(l.g){case 1:if(r=n.Yb())return l.return(r);if(a=null,t.$){var c=t.$,d=c.h;n instanceof Bo&&(d=c.j),d.has(n)?(c=d.get(n),i&&(c.sh=i),a=c.ae):a=null}return a||(a=Tl(n,t.stream,i||null,e.i.retryParameters,e.g.pc)),o=0,t.sa&&(o=t.sa.h),t.Hb=a,w(l,a.promise,2);case 2:if(s=l.h,t.Hb=null,u=s.data,!n.aesKey){l.u(3);break}return w(l,il(u,n.aesKey,o),4);case 4:u=l.h;case 3:return l.return(u)}}))}function Tl(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=rl(e.O(),e.startByte,e.endByte,i,n)).contentType=t.type,r.request(Gr,e,{type:s,stream:t,segment:o,isPreload:a})}function xl(e,t,n,i){var r,a;return R((function(o){return 1==o.g?(t.Ic=!1,t.Sf=!1,t.Oe=0,t.Kc=!0,t.Ia=null,t.sa=null,t.$&&!e.m.has(t.stream)&&Yu(t.$),i?(r=e.g.Qc(),a=e.g.Z.getDuration(),w(o,e.g.Z.remove(t.type,r+i,a),3)):w(o,Vs(e.g.Z,t.type),4)):3!=o.g?(Wr(e.l),n?w(o,e.g.Z.flush(t.type),3):o.u(3)):(Wr(e.l),t.Kc=!1,t.endOfStream=!1,t.Qa||t.zb||Sl(e,t,0),void T(o))}))}function Sl(e,t,n){var i=t.type;(i!=rt||e.h.has(i))&&(t.zb=new wi((function(){var n;return R((function(i){return 1==i.g?(x(i,2),w(i,fl(e,t),4)):2!=i.g?A(i,0):(n=k(i),e.g&&e.g.onError(n),void T(i))}))})).ia(n))}function Al(e){null!=e.zb&&(e.zb.stop(),e.zb=null)}function kl(e){return R((function(t){return e.Hb?w(t,e.Hb.abort(),0):t.u(0)}))}function El(e,t,n){var i;return R((function(r){if(1==r.g)return 3024==n.code?(t.Qa=!1,Al(t),Sl(e,t,0),r.return()):w(r,xr(e.S),2);if(Wr(e.l),1===n.category&&1003!=n.code){if(t.Fc)return ol(e,!1),r.return();i=0===e.i.maxDisabledTime&&1011==n.code?1:e.i.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.i.failureCallback(n),T(r)}))}function Il(e,t){t=void 0!==t&&t;var n,i,r,a,o,s=void 0===s||s;return R((function(u){if(1==u.g){if(n=Date.now()/1e3,i=e.i.minTimeBetweenRecoveries,!t){if(!e.i.allowMediaSourceRecoveries||n-e.M<i)return u.return(!1);e.M=n}return r=at,(a=e.h.get(r.ea))&&(a.mb=null,a.lc=null,a.kc=null,s&&dl(e,a),kl(a).catch((function(){})),a.sa&&a.sa.dh(),Al(a)),(o=e.h.get(r.Ca))&&(o.mb=null,o.lc=null,o.kc=null,s&&dl(e,o),kl(o).catch((function(){})),o.sa&&o.sa.dh(),Al(o)),w(u,Zs(e.g.Z,Dl(e)),2)}return!o||o.Kc||o.Qa||o.zb||Sl(e,o,0),!a||a.Kc||a.Qa||a.zb||Sl(e,a,0),u.return(!0)}))}function Cl(e){return"keep"!==e.i.crossBoundaryStrategy}function Ml(e){if(Cl(e)){e.H.stop();var t=e.g.Qc(),n=e.h.get("video")||e.h.get("audio");n&&(n=n.mb)&&null!==n.g&&(0>(t=n.g-t)||1<t||(e.G=n.g+.1,e.H.ia(t)))}}function Dl(e,t){t=void 0!==t&&t;var n=new Map;return e.o.audio&&n.set("audio",e.o.audio),e.o.video&&n.set("video",e.o.video),t&&e.A&&n.set(rt,e.A),n}function Pl(){}function Rl(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]=Bt(d):s?e[a]=t[a]:d.constructor==Object&&t[a]&&t[a].constructor==Object?(e[a]||(e[a]=Bt(d)),c=Rl(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?(q("Unexpected number of arguments for "+c),e[a]=t[a]):e[a]=Array.isArray(e[a])?t[a].slice():t[a]:(z("Invalid config, unrecognized key "+c),l=!1)}return l}function Ll(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 Nl(e,t){return e&&t}function Ol(e,t){function n(e){return e&&"object"==typeof e&&!Array.isArray(e)}return e=function e(t,i){return Object.keys(t).reduce((function(r,a){var o=t[a];return i.hasOwnProperty(a)?o instanceof HTMLElement&&i[a]instanceof HTMLElement?o.isEqualNode(i[a])||(r[a]=o):n(o)&&n(i[a])?(o=e(o,i[a]),(0<Object.keys(o).length||!n(o))&&(r[a]=o)):Array.isArray(o)&&Array.isArray(i[a])?Mt(o,i[a])||(r[a]=o):Number.isNaN(o)&&Number.isNaN(i[a])||o!==i[a]&&(r[a]=o):r[a]=o,r}),{})}(e,t),function e(t){for(var i=l(Object.keys(t)),r=i.next();!r.done;r=i.next())if(!(t[r=r.value]instanceof HTMLElement))if(n(t[r])&&0===Object.keys(t[r]).length)delete t[r];else{var a=t[r];Array.isArray(a)&&0===a.length||"function"==typeof t[r]?delete t[r]:n(t[r])&&(e(t[r]),0===Object.keys(t[r]).length&&delete t[r])}}(e),e}function jl(){}function Ul(e){return new de(e=Be(e)).Cb}function _l(e,t,n){function i(e){Re(a).setUint32(o,e.byteLength,!0),o+=4,a.set(De(e),o),o+=e.byteLength}if(!n||!n.byteLength)throw new Ne(2,6,6015);var r;r="string"==typeof t?Ve(t,!0):t,e=Ve(e=Be(e),!0);var a=new Uint8Array(12+e.byteLength+r.byteLength+n.byteLength),o=0;return i(e),i(r),i(n),a}function Bl(e,t,n){return"skd"!==t?e:(t=n.serverCertificate,_l(e,n=Be(e).split("skd://").pop(),t))}function Fl(e,t){2===e&&(e=t.drmInfo)&&vr(e.keySystem)&&(t.headers["Content-Type"]="application/octet-stream")}function Vl(){this.g=null}function Hl(e,t){return e.filter((function(e){return!(e.audio&&e.audio.channelsCount&&e.audio.channelsCount>t)})).sort((function(e,t){return e.audio||t.audio?e.audio?t.audio?(t.audio.channelsCount||0)-(e.audio.channelsCount||0):1:-1:0}))}function Kl(e,t){return e.filter((function(e){return!e.audio||e.audio.codecs==t}))}function Gl(){}function zl(){var t=1/0,n=te();navigator.connection&&navigator.connection.saveData&&(t=360);var i={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(t,n,i){return"apple"===e.shakaMediaKeysPolyfill&&"skd"==n&&(n=i.serverCertificate,t=_l(t,i=Ul(t),n)),t},logLicenseExchange:!1,updateExpirationTime:1,preferredKeySystems:[],keySystemsMapping:{},parseInbandPsshEnabled:!1,minHdcpVersion:"",ignoreDuplicateInitData:!0,defaultAudioRobustnessForWidevine:"SW_SECURE_CRYPTO",defaultVideoRobustnessForWidevine:"SW_SECURE_DECODE"},r="reload",a=!1;pt()&&n.cd()&&(r="smooth",a=!0);var o={trackSelectionCallback:function(e){return R((function(t){return t.return(e)}))},downloadSizeCallback:function(e){var t;return R((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 Nl([e,t])},usePersistentLicense:!0,numberOfParallelDownloads:5},s={drm:i,manifest:a={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,ignoreSupplementalCodecs:!1,updatePeriod:-1,ignoreDrmInfo:!1,dash:{clockSyncUri:"",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","urn:uuid:3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c":"com.huawei.wiseplay"},manifestPreprocessor:Xl,manifestPreprocessorTXml:Wl,sequenceMode:!1,multiTypeVariantsAllowed:a,useStreamOnceInPeriodFlattening:!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:n.bd(),ignoreManifestTimestampsInSegmentsMode:!1,disableCodecGuessing:!1,disableClosedCaptionsDetection:!1,allowLowLatencyByteRangeOptimization:!0,allowRangeRequestsToGuessMimeType:!1},mss:{manifestPreprocessor:Xl,manifestPreprocessorTXml:Wl,sequenceMode:!1,keySystemsBySystemId:{"9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready"}}},streaming:{retryParameters:{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4},failureCallback:function(e){return Nl([e])},rebufferingGoal:0,bufferingGoal:10,bufferBehind:30,evictionGoal:1,ignoreTextStreamFailures:!1,alwaysStreamText:!1,startAtSegmentBoundary:!1,gapDetectionThreshold:.5,gapPadding:0,gapJumpTimerTime:.25,durationBackoff:1,safeSeekOffset:5,safeSeekEndOffset:0,stallEnabled:!0,stallThreshold:1,stallSkip:.1,useNativeHlsForFairPlay:!0,inaccurateManifestTolerance:2,lowLatencyMode:!1,preferNativeDash:!1,preferNativeHls:!1,updateIntervalSeconds:1,observeQualityChanges:!1,maxDisabledTime:30,segmentPrefetchLimit:1,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,preloadNextUrlWindow:30,loadTimeout:30,clearDecodingCache:!1,dontChooseCodecs:!1,shouldFixTimestampOffset:!1,avoidEvictionOnQuotaExceededError:!1,crossBoundaryStrategy:"keep",returnToEndOfLiveWindowWhenOutside:!1},networking:{forceHTTP:!1,forceHTTPS:!1,minBytesForProgressEvents:16e3},mediaSource:{codecSwitchingStrategy:r,addExtraFeaturesToSourceBuffer:function(e){return Nl([e],"")},forceTransmux:!1,insertFakeEncryptionInInit:!0,correctEc3Enca:!1,modifyCueCallback:function(e,t){return Nl([e,t])},dispatchAllEmsgBoxes:!1,useSourceElements:!0,durationReductionEmitsUpdateEnd:!0},offline:o,abrFactory:function(){return new cr},adaptationSetCriteriaFactory:function(){return new(Function.prototype.bind.apply(Vl,[null].concat(c(L.apply(0,arguments)))))},abr:{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:5,minTimeToSwitch:0,preferNetworkInformationBandwidth:!1,removeLatencyFromFirstPacketTime:!0},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,fontScaleFactor:1},textDisplayFactory:function(){return null},cmcd:{enabled:!1,sessionId:"",contentId:"",rtpSafetyFactor:5,useHeaders:!1,includeKeys:[],version:1},cmsd:{enabled:!0,applyMaximumSuggestedBitrate:!0,estimatedThroughputWeightRatio:.5},lcevc:{enabled:!1,dynamicPerformanceScaling:!0,logLevel:0,drawLogo:!1,poster:!0},ads:{customPlayheadTracker:!1,skipPlayDetection:!1,supportsMultipleMediaElements:!0,disableHLSInterstitial:!1,disableDASHInterstitial:!1,allowPreloadOnDomElements:!0,allowStartInMiddleOfInterstitial:!0},ignoreHardwareResolution:!1,queue:{preloadNextUrlWindow:30,repeatMode:0}};return o.trackSelectionCallback=function(e){return R((function(t){return t.return(function(e,t,n){var i=n;"AUTO"==i&&(n=e.some((function(e){return!(!e.hdr||"HLG"!=e.hdr)})),i=tv(n));var r=e.filter((function(e){return!("variant"!=e.type||e.hdr&&e.hdr!=i)}));n=[];var a=Ni(t,r.map((function(e){return e.language})));a&&(n=r.filter((function(e){return Di(e.language)==a}))),0==n.length&&(n=r.filter((function(e){return e.primary}))),0==n.length&&(r.map((function(e){return e.language})),n=r);var o=n.filter((function(e){return e.height&&480>=e.height}));for(o.length&&(o.sort((function(e,t){return t.height-e.height})),n=o.filter((function(e){return e.height==o[0].height}))),t=[],n.length&&(r=Math.floor(n.length/2),n.sort((function(e,t){return e.bandwidth-t.bandwidth})),t.push(n[r])),n=(e=l(e)).next();!n.done;n=e.next())(n=n.value).type!=rt&&"image"!=n.type||t.push(n);return t}(e,s.preferredAudioLanguage,s.preferredVideoHdrLevel))}))},n.Ua(s)}function ql(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 Rl(e,t,n||zl(),i,"")}function Xl(e){return Nl([e],e)}function Wl(e){return Nl([e],e)}function Yl(){this.g=null,this.h=[]}function Jl(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 $l(){this.i=this.h=null,this.g=[]}function Ql(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 Zl(){this.B=this.W=NaN,this.l="",this.j=this.gi=this.s=this.A=this.K=this.C=this.o=this.m=this.I=this.F=this.i=this.S=this.U=this.M=this.N=this.P=NaN,this.L=0,this.G=this.H=NaN,this.g=new Yl,this.h=new $l}function ec(e,t,n){e.W=t,e.B=n}function tc(e,t){e.j=isNaN(e.j)?t:e.j+t}function nc(e,t,n,i){Lr.call(this),this.N=e,this.W=t,this.Oa=i.networkingEngine,this.m=n,this.A=null,this.Ka=0,this.ab=i.hd,this.F=i.nk,this.eb=i.pk,this.g=i.config,this.l=this.G=this.h=null,this.wa=!1,this.H=i.Ck,this.ya=!1,this.i=null,this.na=!1,this.j=this.C=null,this.ha=!1,this.M=new Map,this.za=!1,this.Pa=i.Bk,this.ba=new Zl,this.va=new Sr,this.s=new Sr,this.P=null,this.o=!1,this.ka=i.ej,this.U=this.K=null,this.Za=i.dj,this.S=!1,this.L=[],this.I=[],this.B=!0}function ic(e,t,n){(e=t?e.I:e.L)?e.push(n):n()}function rc(e,t){if(e.P=t,e.S=!0,e.L)for(var n=(t=l(e.L)).next();!n.done;n=t.next())(n=n.value)();e.L=null}function ac(e){if(e.o)throw new Ne(2,7,7003)}function oc(e,t){e.dispatchEvent(new Dr("onstatechange",(new Map).set("state",t)))}function sc(e,t){var n,i,r;return R((function(a){switch(a.g){case 1:return!e.h||e.i?a.return():(oc(e,"drm-engine"),e.Ka=Date.now()/1e3,e.i=e.ab(),e.F.h=e.i,e.i.configure(e.g.drm,(function(){return e.B})),n=Zi(e.h.variants),i=!0,e.h&&e.h.presentationTimeline&&(i=e.h.presentationTimeline.V()),w(a,ga(e.i,n,e.h.offlineSessionIds,i),2));case 2:if(ac(e),!t){a.u(3);break}return w(a,e.i.fc(t),4);case 4:ac(e);case 3:return w(a,Ga(e.F,e.h),5);case 5:if(!a.h){a.u(0);break}return r=new Dr("trackschanged",void 0),w(a,Promise.resolve(),7);case 7:e.dispatchEvent(r),T(a)}}))}function uc(e){var t=Zi(e.h.variants);return t=e.A.create(t),e.j.configure(e.g.abr),e.j.setVariants(Array.from(t.values())),e.j.chooseVariant()}function lc(e,t,n){var i,r,a,o,s;return R((function(u){return 1==u.g?(i=e.g.streaming.segmentPrefetchLimit||2,r=new Gu(i,t,(function(t,n,i){return Tl(t,n,i||null,e.g.streaming.retryParameters,e.Oa,e.B)}),!1),e.M.set(t.id,r),t.segmentIndex?u.u(2):w(u,t.createSegmentIndex(),2)):(a="number"==typeof e.m?e.m:0,o=t.segmentIndex.Wb(a),s=null,o&&((s=o.current())||(s=o.next().value)),s||(s=Pu(t.segmentIndex)),s?n?s.Y?w(u,Xu(r,s.Y),0):u.u(0):w(u,qu(r,s.startTime),0):u.u(0))}))}function cc(e,t){Lr.call(this);var n=this;this.i=e,this.l=t,this.g=new Map,this.m=[{gd:null,fd:pc,Sc:function(e,t){return dc(n,"enter",e,t)}},{gd:hc,fd:pc,Sc:function(e,t){return dc(n,"enter",e,t)}},{gd:fc,fd:pc,Sc:function(e,t){return dc(n,"enter",e,t)}},{gd:pc,fd:hc,Sc:function(e,t){return dc(n,"exit",e,t)}},{gd:pc,fd:fc,Sc:function(e,t){return dc(n,"exit",e,t)}},{gd:hc,fd:fc,Sc:function(e,t){t?dc(n,"skip",e,t):(dc(n,"enter",e,t),dc(n,"exit",e,t))}},{gd:fc,fd:hc,Sc:function(e,t){return dc(n,"skip",e,t)}}],this.h=new $,this.h.D(this.i,"regionremove",(function(e){n.g.delete(e.region)}))}function dc(e,t,n,i){t=new Dr(t,new Map([["region",n],["seeking",i]])),e.dispatchEvent(t)}gu.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},wu.prototype.release=function(){this.h&&(this.h.stop(),this.h=null),this.g=null},(i=xu.prototype).ready=function(){var e=this;pu(this.g,HTMLMediaElement.HAVE_FUTURE_DATA,this.j,(function(){!function(){if(null==e.h||0==e.h&&1/0!=e.g.duration)e.i=!0;else{var t=e.g.currentTime,n=null;if("number"==typeof e.h)n=e.h;else if(e.h instanceof Date){var i=Su(e);null!==i&&(n=e.h.getTime()/1e3-i,n=Au(e,n))}null==n?e.i=!0:(0>n&&(n=Math.max(0,t+n)),t!=n?(e.j.Aa(e.g,"seeking",(function(){e.i=!0})),e.g.currentTime=n):e.i=!0)}}()}))},i.release=function(){this.j&&(this.j.release(),this.j=null),this.g=null},i.Vf=function(e){this.h=this.i?this.h:e},i.De=function(){var e=this.i?this.g.currentTime:this.h;return e instanceof Date&&(e=Au(this,e=e.getTime()/1e3-(Su(this)||0))),e||0},i.Eh=function(){return 0},i.Dh=function(){return 0},i.pi=function(){},i.ci=function(){var e=qo(this.g.buffered);return null!=e&&e>=this.g.duration-1},(i=ku.prototype).ready=function(){this.m.Fa(.25)},i.release=function(){this.i&&(this.i.release(),this.i=null),this.j&&(this.j.release(),this.j=null),this.m&&(this.m.stop(),this.m=null),this.h=this.i=this.g=this.l=null,this.s=function(){}},i.Vf=function(e){vu(this.i,Eu(this,e))},i.De=function(){var e=mu(this.i);return 0<this.h.readyState&&!this.h.paused?Mu(this,e):e},i.Eh=function(){return this.j.G},i.Dh=function(){return this.j.C},i.pi=function(){this.j.tf()},i.ci=function(){if(this.g.V()){var e=this.g.Ac(),t=qo(this.h.buffered);if(null!=t&&t>=e)return!0}return!1},(i=Du.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.rk=function(){this.o=!0},i.Eb=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.kf=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.Yd=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.kf(e),this.$a(t)},i.$a=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.ld=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.startByte,e.endByte,e.Y,e.timestampOffset,e.appendWindowStart,e.appendWindowEnd,e.g,e.tilesLayout,e.B,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.Lf=function(e,t){var n=this;this.o||(this.m&&this.m.stop(),this.m=new Ti((function(){var e=t();e?n.g.push.apply(n.g,c(e)):(n.m.stop(),n.m=null)})),this.m.Fa(e))},Du.prototype[Symbol.iterator]=function(){return this.Wb(0)},Du.prototype.Wb=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 Lu(this,i,a,n)},Du.prototype.Pe=function(){return-1},F("shaka.media.SegmentIndex",Du),Du.forSingleSegment=Ru,Du.prototype.getIteratorForTime=Du.prototype.Wb,Du.prototype.updateEvery=Du.prototype.Lf,Du.prototype.fit=Du.prototype.ld,Du.prototype.evict=Du.prototype.$a,Du.prototype.mergeAndEvict=Du.prototype.Yd,Du.prototype.offset=Du.prototype.offset,Du.prototype.get=Du.prototype.get,Du.prototype.find=Du.prototype.find,Du.prototype.markImmutable=Du.prototype.rk,Du.prototype.release=Du.prototype.release,Du.prototype.getNumEvicted=Du.prototype.getNumEvicted,Du.prototype.getNumReferences=Du.prototype.getNumReferences,(i=Lu.prototype).Dd=function(e){this.reverse=e},i.oj=function(){return this.h},i.current=function(){var e=this.i.get(this.h);return e&&0<e.g.length&&e.A&&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.A&&this.g==e.g.length&&(this.h++,this.g=0)):(this.h++,this.g=0),{value:e=this.current(),done:!e}},i.dh=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",Lu),Lu.prototype.resetToLastIndependent=Lu.prototype.dh,Lu.prototype.next=Lu.prototype.next,Lu.prototype.current=Lu.prototype.current,Lu.prototype.currentPosition=Lu.prototype.oj,Lu.prototype.setReverse=Lu.prototype.Dd,m(Nu,Du),(i=Nu.prototype).clone=function(){var e=new Nu;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.Eb=function(e){for(var t=l(this.h),n=t.next();!n.done;n=t.next())n.value.Eb(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.kf=function(){},i.$a=function(e){for(var t=l(this.h),n=t.next();!n.done;n=t.next())n.value.$a(e);for(;1<this.h.length&&0==this.h[0].getNumReferences();)e=this.h.shift(),this.i+=e.getNumEvicted(),e.release()},i.Yd=function(){},i.ld=function(){},i.Lf=function(){},F("shaka.media.MetaSegmentIndex",Nu),Nu.prototype.updateEvery=Nu.prototype.Lf,Nu.prototype.fit=Nu.prototype.ld,Nu.prototype.mergeAndEvict=Nu.prototype.Yd,Nu.prototype.evict=Nu.prototype.$a,Nu.prototype.merge=Nu.prototype.kf,Nu.prototype.offset=Nu.prototype.offset,Nu.prototype.get=Nu.prototype.get,Nu.prototype.find=Nu.prototype.find,Nu.prototype.forEachTopLevelReference=Nu.prototype.Eb,Nu.prototype.release=Nu.prototype.release,Ou.prototype.release=function(){this.set(this.Pc()),this.h&&(this.h.stop(),this.h=null),this.g=null},Ou.prototype.set=function(e){this.i=e,ju(this)},Ou.prototype.Pc=function(){return this.g.Pc()},Uu.prototype.release=function(){this.h&&(this.h.release(),this.h=null),this.i.stop();for(var e=l(this.g),t=e.next();!t.done;t=e.next())t.value.release();this.g.clear()},m(Bu,Lr),Bu.prototype.release=function(){this.g.clear(),Lr.prototype.release.call(this)},Bu.prototype.j=function(e){for(var t=l(this.g.values()),n=t.next();!n.done;n=t.next()){var i=(n=n.value).lg;e:{for(var r=n.ce,a=r.length-1;0<=a;a--){var o=r[a];if(o.position<=e){r=o.rd;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&&!Dt(i.roles,r.roles),(o||s||i)&&Fu(this,e,r.contentType)&&(n.lg=r,i=new Dr("audiotrackchange",new Map([["quality",r],["position",e]])),this.dispatchEvent(i)),a&&Fu(this,e,r.contentType)&&(n.lg=r,JSON.stringify(r),n=new Dr("qualitychange",new Map([["quality",r],["position",e]])),this.dispatchEvent(n))}},m(Hu,Lr),Hu.prototype.release=function(){this.h.clear(),this.g&&(this.g.stop(),this.g=null),Lr.prototype.release.call(this)},Gu.prototype.$a=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&&Qu(this,i);t&&Ju(this)},Gu.prototype.Dd=function(e){this.o=e,this.g&&this.g.Dd(e)},Zu.prototype.abort=function(){this.ae&&this.ae.abort()},(i=al.prototype).destroy=function(){return this.l.destroy()},i.configure=function(e){if(this.i=e,this.S=new Tr({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.h.get("audio");t&&t.$&&(Yu(t.$),t.$=null);for(var n=(t=l(this.m.keys())).next();!n.done;n=t.next())n=n.value,Yu(this.m.get(n)),this.m.delete(n)}for(e.disableTextPrefetch&&(t=this.h.get(rt))&&t.$&&(Yu(t.$),t.$=null),e.disableVideoPrefetch&&(t=this.h.get("video"))&&t.$&&(Yu(t.$),t.$=null),n=(t=l(this.h.keys())).next();!n.done;n=t.next())(n=this.h.get(n.value)).$?($u(n.$,e.segmentPrefetchLimit),0<e.segmentPrefetchLimit||(Yu(n.$),n.$=null)):0<e.segmentPrefetchLimit&&(n.$=pl(this,n.stream));e.disableAudioPrefetch||function(e){for(var t=e.i.segmentPrefetchLimit,n=e.i.prefetchAudioLanguages,i=l(e.j.variants),r=i.next(),a={};!r.done;a={Mb:void 0},r=i.next())if(a.Mb=r.value,a.Mb.audio)if(e.m.has(a.Mb.audio)){if($u(r=e.m.get(a.Mb.audio),t),!(0<t&&n.some(function(e){return function(t){return Ii(e.Mb.audio.language,t)}}(a)))){var o=e.h.get(a.Mb.audio.type);r!==(o&&o.$)&&Yu(r),e.m.delete(a.Mb.audio)}}else 0>=t||!n.some(function(e){return function(t){return Ii(e.Mb.audio.language,t)}}(a))||!(r=pl(e,a.Mb.audio))||(a.Mb.audio.segmentIndex||a.Mb.audio.createSegmentIndex(),e.m.set(a.Mb.audio,r))}(this)},i.start=function(e){var t=this;return R((function(n){if(1==n.g)return w(n,function(e,t){var n,i,r,a,o,s,u;return R((function(c){if(1==c.g){if(!e.o)throw new Ne(2,5,5006);return n=Dl(e,!0),w(c,e.g.Z.init(n,e.j.sequenceMode,e.j.type,e.j.ignoreManifestTimestampsInSegmentsMode),2)}for(Wr(e.l),e.updateDuration(),i=l(n.keys()),r=i.next();!r.done;r=i.next())a=r.value,o=n.get(a),e.h.has(a)||(s=hl(e,o),t.has(o.id)&&(zu(u=t.get(o.id),(function(t,n,i){return Tl(t,n,i||null,e.i.retryParameters,e.g.pc)})),s.$=u),e.h.set(a,s),Sl(e,s,0));T(c)}))}(t,e||new Map),2);Wr(t.l),t.I=!0,T(n)}))},i.Yc=function(){if(this.g){for(var e=this.g.Qc(),t=l(this.h.keys()),n=t.next();!n.done;n=t.next()){var i=n.value;n=this.h.get(i);var r=this.g.Z;if(!(r=i==rt?null!=(r=r.h).g&&null!=r.h&&e>=r.g&&e<r.h:Xo(r=Bs(r,i),e))){if(this.M=0,n.$&&(n.$.g=null),"audio"===n.type)for(var a=(r=l(this.m.values())).next();!a.done;a=r.next())a.value.g=null;n.sa=null,(null!=_s(this.g.Z,i)||n.Qa)&&dl(this,n),n.Hb&&(n.Hb.abort(),n.Hb=null),i===rt&&(i=this.g.Z).I&&i.I.Fd(),n.Yc=!0}}Cl(this)&&Ml(this)}},i.updateDuration=function(){var e=ft(),t=this.j.presentationTimeline.getDuration();1/0>t?(e&&(this.s&&this.s.stop(),Ks(this.g.Z)),this.g.Z.pb(t)):e?(this.s&&this.s.Fa(.5),this.g.Z.pb(1/0)):this.g.Z.pb(Math.pow(2,32))},F("shaka.util.ConfigUtils",Pl),Pl.getDifferenceFromConfigObjects=Ol,Pl.convertToConfigObject=Ll,Pl.mergeConfigObjects=Rl,F("shaka.config.RepeatMode",{OFF:0,ALL:1,SINGLE:2}),F("shaka.drm.FairPlay",jl),jl.commonFairPlayResponse=function(e,t){if(2===e&&(e=t.originalRequest.drmInfo)&&vr(e.keySystem)){try{var n=Ue(t.data)}catch(e){return}if(e=!1,"<ckc>"===(n=n.trim()).substr(0,5)&&"</ckc>"===n.substr(-6)&&(n=n.slice(5,-6),e=!0),!e)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=Me(We(n)))}},jl.muxFairPlayRequest=function(e,t){Fl(e,t)},jl.expressplayFairPlayRequest=function(e,t){if(2===e){var n=t.drmInfo;n&&vr(n.keySystem)&&Fl(e,t)}},jl.conaxFairPlayRequest=function(e,t){Fl(e,t)},jl.ezdrmFairPlayRequest=function(e,t){Fl(e,t)},jl.verimatrixFairPlayRequest=function(e,t){2===e&&(e=t.drmInfo)&&vr(e.keySystem)&&(e=Xe(e=De(t.body)),t.headers["Content-Type"]="application/x-www-form-urlencoded",t.body=Fe("spc="+e))},jl.muxInitDataTransform=function(e,t,n){return Bl(e,t,n)},jl.expressplayInitDataTransform=function(e,t,n){return Bl(e,t,n)},jl.conaxInitDataTransform=function(t,n,i){if("skd"!==n)return t;n=i.serverCertificate,i=Be(t).split("skd://").pop().split("?").shift(),i=e.atob(i);var r=new ArrayBuffer(2*i.length);r=Pe(r);for(var a=0,o=i.length;a<o;a++)r[a]=i.charCodeAt(a);return _l(t,r,n)},jl.ezdrmInitDataTransform=function(e,t,n){return"skd"!==t?e:(t=n.serverCertificate,_l(e,n=Be(e).split(";").pop(),t))},jl.verimatrixInitDataTransform=function(e,t,n){return Bl(e,t,n)},jl.initDataTransform=_l,jl.defaultGetContentId=Ul,jl.isFairPlaySupported=function(){var e;return R((function(t){return 1==t.g?(e={initDataTypes:["cenc","sinf","skd"],videoCapabilities:[{contentType:'video/mp4; codecs="avc1.42E01E"'}]},x(t,2),w(t,navigator.requestMediaKeySystemAccess("com.apple.fps",[e]),4)):2!=t.g?t.return(!0):(k(t),t.return(!1))}))},Vl.prototype.configure=function(e){this.g=e},Vl.prototype.getConfiguration=function(){return this.g},Vl.prototype.create=function(e){var t;if(this.g.language){var n=function(e,t){var n=Ni(t=Di(t),e.map((function(e){return Li(e)})));return n?e.filter((function(e){return n==Li(e)})):[]}(e,this.g.language);n.length&&(t=n)}t||(t=(t=e.filter((function(e){return e.primary}))).length?t:e),e=function(e,t){return e.filter((function(e){return!!e.audio&&(t?e.audio.roles.includes(t):0==e.audio.roles.length)}))}(t,this.g.role),e.length&&(t=e),this.g.videoLayout&&(e=function(e,t){return e.filter((function(e){return!e.video||!e.video.videoLayout||e.video.videoLayout==t}))}(t,this.g.videoLayout),e.length&&(t=e)),this.g.Ec&&(e=function(e,t){if("AUTO"==t){var n=e.some((function(e){return!(!e.video||!e.video.hdr||"HLG"!=e.video.hdr)}));t=tv(n)}return e.filter((function(e){return!e.video||!e.video.hdr||e.video.hdr==t}))}(t,this.g.Ec),e.length&&(t=e));var i=[this.g.channelCount,this.g.preferredAudioChannelCount];if((e=i.filter((function(e,t){return e&&i.indexOf(e)===t}))).length)for(n=(e=l(e)).next();!n.done;n=e.next())if((n=Hl(t,n.value)).length){t=n;break}this.g.Jc&&(e=function(e,t){return e.filter((function(e){return!(!e.audio||!e.audio.label)&&e.audio.label.toLowerCase()==t.toLowerCase()}))}(t,this.g.Jc),e.length&&(t=e)),this.g.Ed&&(e=function(e,t){return e.filter((function(e){return!(!e.video||!e.video.label)&&e.video.label.toLowerCase()==t.toLowerCase()}))}(t,this.g.Ed),e.length&&(t=e)),e=function(e,t){return e.filter((function(e){return!e.audio||e.audio.spatialAudio==t}))}(t,this.g.spatialAudio),e.length&&(t=e);var r=[this.g.audioCodec,this.g.Gd].concat(c(this.g.preferredAudioCodecs));if((e=r.filter((function(e,t){return e&&r.indexOf(e)===t}))).length)for(n=(e=l(e)).next();!n.done;n=e.next())if((n=Kl(t,n.value)).length){t=n;break}return new ja(t[0],t,!("smooth"==this.g.codecSwitchingStrategy&&pt()))},F("shaka.util.PlayerConfiguration",Gl),Gl.mergeConfigObjects=ql,Gl.createDefaultForLL=function(){return{streaming:{inaccurateManifestTolerance:0,segmentPrefetchLimit:2,updateIntervalSeconds:.1,maxDisabledTime:1,retryParameters:{baseDelay:100}},manifest:{dash:{autoCorrectDrift:!1},retryParameters:{baseDelay:100}},drm:{retryParameters:{baseDelay:100}}}},Gl.createDefault=zl,m(nc,Lr),(i=nc.prototype).getStartTime=function(){return this.m},i.nd=function(){return this.N},i.Fg=function(){return this.h},i.getStats=function(){return this.ba},i.Mj=function(){return this.K?qi(this.K):null},i.Lj=function(){return this.U?Xi(this.U):null},i.start=function(){var t,n=this;R((function(i){switch(i.g){case 1:return w(i,Promise.resolve(),2);case 2:return x(i,3),w(i,function(e){var t,n,i,r,a;return R((function(o){switch(o.g){case 1:if(oc(e,"manifest-parser"),e.l||(e.G=Qa(e.N,e.W),e.l=e.G(),e.l.configure(e.g.manifest,(function(){return e.B}))),t=Date.now()/1e3,oc(e,"manifest"),e.h){o.u(2);break}return w(o,e.l.start(e.N,e.eb),3);case 3:return e.h=o.h,w(o,function(e){var t,n,i,r,a,o;return R((function(s){if(e.A||(e.A=e.g.adaptationSetCriteriaFactory(),e.A.configure({language:e.g.preferredAudioLanguage,role:e.g.preferredVariantRole,channelCount:e.g.preferredAudioChannelCount,Ec:e.g.preferredVideoHdrLevel,spatialAudio:e.g.preferSpatialAudio,videoLayout:e.g.preferredVideoLayout,Jc:e.g.preferredAudioLabel,Ed:e.g.preferredVideoLabel,codecSwitchingStrategy:e.g.mediaSource.codecSwitchingStrategy,audioCodec:"",Gd:"",Fe:0,preferredAudioCodecs:e.g.preferredAudioCodecs,preferredAudioChannelCount:e.g.preferredAudioChannelCount})),e.Za&&(t=e.g.abrFactory,e.C=t,e.j=t(),e.j.configure(e.g.abr)),!(n=uc(e))||1!=e.h.variants.length&&"HLS"!=e.h.type)return s.u(0);for(i=[],r=l([n.video,n.audio]),a=r.next();!a.done;a=r.next())(o=a.value)&&!o.segmentIndex&&i.push(o.createSegmentIndex());return 0<i.length?w(s,Promise.all(i),0):s.u(0)}))}(e),2);case 2:return e.va.resolve(),n=new Dr("manifestparsed",void 0),w(o,Promise.resolve(),5);case 5:if(e.dispatchEvent(n),0==e.h.variants.length)throw new Ne(2,4,4036);if(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),!za(e.F,e.h)){o.u(6);break}return i=new Dr("trackschanged",void 0),w(o,Promise.resolve(),7);case 7:ac(e),e.dispatchEvent(i);case 6:r=Date.now()/1e3,a=r-t,e.ba.I=a,T(o)}}))}(n),5);case 5:if(ac(n),"webkit"===e.shakaMediaKeysPolyfill){i.u(6);break}return w(i,sc(n),7);case 7:ac(n);case 6:if(!n.ka){i.u(8);break}return w(i,function(e){var t,n,i,r;return R((function(a){return(t=uc(e))?(n=e.h.presentationTimeline.V(),i=[],e.K=t,t.video&&i.push(lc(e,t.video,n)),t.audio&&i.push(lc(e,t.audio,n)),(r=er(e.h.textStreams,e.g.preferredTextLanguage,e.g.preferredTextRole,e.g.preferForcedSubs)[0]||null)&&rr(t.audio,r,e.g)&&(i.push(lc(e,r,n)),e.U=r),w(a,Promise.all(i),0)):a.u(0)}))}(n),9);case 9:ac(n);case 8:if(!n.ka||!n.i){i.u(10);break}return w(i,function(e){return R((function(t){return 1==t.g?e.K?w(t,e.l,3):t.u(0):w(t,Promise.all(e.U.map((function(e){return e.promise}))),0)}))}(n.i),11);case 11:ac(n);case 10:n.s.resolve(),A(i,0);break;case 3:(t=k(i))instanceof Ne&&(7001==t.code||7003==t.code)||n.s.reject(t),T(i)}}))},i.dispatchEvent=function(e){return this.P?this.P.dispatchEvent(e):Lr.prototype.dispatchEvent.call(this,e)},i.onError=function(e){2===e.severity&&(this.s.reject(e),this.destroy());var t=(new Map).set("detail",e);t=new Dr("error",t),this.dispatchEvent(t),t.defaultPrevented&&(e.handled=!0)},i.configure=function(e,t){e=Ll(e,t),ql(this.g,e)},i.getConfiguration=function(){return Bt(this.g)},i.fl=function(){return this.s},i.destroy=function(){var e,t,n=this;return R((function(i){switch(i.g){case 1:if(n.o=!0,!n.l||n.wa){i.u(2);break}return w(i,n.l.stop(),2);case 2:if(!n.j||n.ha){i.u(4);break}return w(i,n.j.stop(),4);case 4:if(n.H&&!n.ya&&n.H.release(),!n.i||n.na){i.u(6);break}return w(i,n.i.destroy(),6);case 6:if(0<n.M.size&&!n.za)for(e=l(n.M.values()),t=e.next();!t.done;t=e.next())Yu(t.value);T(i)}}))},F("shaka.media.PreloadManager",nc),nc.prototype.destroy=nc.prototype.destroy,nc.prototype.waitForFinish=nc.prototype.fl,nc.prototype.getPrefetchedTextTrack=nc.prototype.Lj,nc.prototype.getPrefetchedVariantTrack=nc.prototype.Mj,m(cc,Lr),cc.prototype.release=function(){this.i=null,this.g.clear(),this.h.release(),this.h=null,Lr.prototype.release.call(this)},cc.prototype.j=function(e,t){if(!this.l||0!=e){this.l=!1;for(var n=l(this.i.h.values()),i=n.next();!i.done;i=n.next()){i=i.value;var r=this.g.get(i),a=e<i.startTime?hc:e>i.endTime?fc:pc;this.g.set(i,a);for(var o=l(this.m),s=o.next();!s.done;s=o.next())(s=s.value).gd==r&&s.fd==a&&s.Sc(i,t)}}};var hc=1,pc=2,fc=3;function gc(e,t,n){var i,r,a,o,s,u,l;return R((function(c){switch(c.g){case 1:var d=new de(e).ob.split("/").pop().split(".");return i=1==d.length?"":d.pop().toLowerCase(),(r=mc.get(i))?c.return(r):(a=0,o=Br([e],n),x(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=k(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():"")}}))}for(var mc=(new Map).set("mp4","video/mp4").set("m4v","video/mp4").set("m4a","audio/mp4").set("webm","video/webm").set("weba","audio/webm").set("mkv","video/webm").set("ts","video/mp2t").set("ogv","video/ogg").set("ogg","audio/ogg").set("mpg","video/mpeg").set("mpeg","video/mpeg").set("mov","video/quicktime").set("m3u8","application/x-mpegurl").set("mpd","application/dash+xml").set("ism","application/vnd.ms-sstr+xml").set("mp3","audio/mpeg").set("aac","audio/aac").set("flac","audio/flac").set("wav","audio/wav").set("sbv","text/x-subviewer").set("srt","text/srt").set("vtt","text/vtt").set("webvtt","text/vtt").set("ttml","application/ttml+xml").set("lrc","application/x-subtitle-lrc").set("ssa","text/x-ssa").set("ass","text/x-ssa").set("jpeg","image/jpeg").set("jpg","image/jpeg").set("png","image/png").set("svg","image/svg+xml").set("webp","image/webp").set("avif","image/avif").set("html","text/html").set("htm","text/html"),vc={ach:"Lwo",ady:"Адыгэбзэ",af:"Afrikaans","af-NA":"Afrikaans (Namibia)","af-ZA":"Afrikaans (South Africa)",ak:"Tɕɥi",ar:"العربية","ar-AR":"العربية","ar-MA":"العربية","ar-SA":"العربية (السعودية)","ay-BO":"Aymar aru",az:"Azərbaycan dili","az-AZ":"Azərbaycan dili","be-BY":"Беларуская",bg:"Български","bg-BG":"Български",bn:"বাংলা","bn-IN":"বাংলা (ভারত)","bn-BD":"বাংলা(বাংলাদেশ)","bs-BA":"Bosanski",ca:"Català","ca-ES":"Català",cak:"Maya Kaqchikel","ck-US":"ᏣᎳᎩ (tsalagi)",cs:"Čeština","cs-CZ":"Čeština",cy:"Cymraeg","cy-GB":"Cymraeg",da:"Dansk","da-DK":"Dansk",de:"Deutsch","de-AT":"Deutsch (Österreich)","de-DE":"Deutsch (Deutschland)","de-CH":"Deutsch (Schweiz)",dsb:"Dolnoserbšćina",el:"Ελληνικά","el-GR":"Ελληνικά",en:"English","en-GB":"English (UK)","en-AU":"English (Australia)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-IN":"English (India)","en-PI":"English (Pirate)","en-UD":"English (Upside Down)","en-US":"English (US)","en-ZA":"English (South Africa)","en@pirate":"English (Pirate)",eo:"Esperanto","eo-EO":"Esperanto",es:"Español","es-AR":"Español (Argentine)","es-419":"Español (Latinoamérica)","es-CL":"Español (Chile)","es-CO":"Español (Colombia)","es-EC":"Español (Ecuador)","es-ES":"Español (España)","es-LA":"Español (Latinoamérica)","es-NI":"Español (Nicaragua)","es-MX":"Español (México)","es-US":"Español (Estados Unidos)","es-VE":"Español (Venezuela)",et:"eesti keel","et-EE":"Eesti (Estonia)",eu:"Euskara","eu-ES":"Euskara",fa:"فارسی","fa-IR":"فارسی","fb-LT":"Leet Speak",ff:"Fulah",fi:"Suomi","fi-FI":"Suomi","fo-FO":"Føroyskt",fr:"Français","fr-CA":"Français (Canada)","fr-FR":"Français (France)","fr-BE":"Français (Belgique)","fr-CH":"Français (Suisse)","fy-NL":"Frysk",ga:"Gaeilge","ga-IE":"Gaeilge (Gaelic)",gl:"Galego","gl-ES":"Galego","gn-PY":"Avañe'ẽ","gu-IN":"ગુજરાતી","gx-GR":"Ἑλληνική ἀρχαία",he:"עברית‏","he-IL":"עברית‏",hi:"हिन्दी","hi-IN":"हिन्दी",hr:"Hrvatski","hr-HR":"Hrvatski",hsb:"Hornjoserbšćina",ht:"Kreyòl",hu:"Magyar","hu-HU":"Magyar","hy-AM":"Հայերեն",id:"Bahasa Indonesia","id-ID":"Bahasa Indonesia",is:"Íslenska","is-IS":"Íslenska (Iceland)",it:"Italiano","it-IT":"Italiano",ja:"日本語","ja-JP":"日本語","jv-ID":"Basa Jawa","ka-GE":"ქართული","kk-KZ":"Қазақша",km:"ភាសាខ្មែរ","km-KH":"ភាសាខ្មែរ",kab:"Taqbaylit",kn:"ಕನ್ನಡ","kn-IN":"ಕನ್ನಡ (India)",ko:"한국어","ko-KR":"한국어 (韩国)",ku:"Kurdî","ku-TR":"Kurdî",la:"Latin","la-VA":"Latin",lb:"Lëtzebuergesch","li-NL":"Lèmbörgs",lt:"Lietuvių","lt-LT":"Lietuvių",lv:"Latviešu","lv-LV":"Latviešu",mai:"मैथिली, মৈথিলী","mg-MG":"Malagasy",mk:"Македонски","mk-MK":"Македонски (Македонски)",ml:"മലയാളം","ml-IN":"മലയാളം","mn-MN":"Монгол",mr:"मराठी","mr-IN":"मराठी",ms:"Bahasa Melayu","ms-MY":"Bahasa Melayu",mt:"Malti","mt-MT":"Malti",my:"ဗမာစကာ",nb:"Norsk (bokmål)","nb-NO":"Norsk (bokmål)",ne:"नेपाली","ne-NP":"नेपाली",nl:"Nederlands","nl-BE":"Nederlands (België)","nl-NL":"Nederlands (Nederland)","nn-NO":"Norsk (nynorsk)",no:"Norsk",oc:"Occitan","or-IN":"ଓଡ଼ିଆ",pa:"ਪੰਜਾਬੀ","pa-IN":"ਪੰਜਾਬੀ (ਭਾਰਤ ਨੂੰ)",pl:"Polski","pl-PL":"Polski","ps-AF":"پښتو",pt:"Português","pt-BR":"Português (Brasil)","pt-PT":"Português (Portugal)","qu-PE":"Qhichwa","rm-CH":"Rumantsch",ro:"Română","ro-RO":"Română",ru:"Русский","ru-RU":"Русский","sa-IN":"संस्कृतम्","se-NO":"Davvisámegiella","si-LK":"පළාත",sk:"Slovenčina","sk-SK":"Slovenčina (Slovakia)",sl:"Slovenščina","sl-SI":"Slovenščina","so-SO":"Soomaaliga",sq:"Shqip","sq-AL":"Shqip",sr:"Српски","sr-RS":"Српски (Serbia)",su:"Basa Sunda",sv:"Svenska","sv-SE":"Svenska",sw:"Kiswahili","sw-KE":"Kiswahili",ta:"தமிழ்","ta-IN":"தமிழ்",te:"తెలుగు","te-IN":"తెలుగు",tg:"забо́ни тоҷикӣ́","tg-TJ":"тоҷикӣ",th:"ภาษาไทย","th-TH":"ภาษาไทย (ประเทศไทย)",tl:"Filipino","tl-PH":"Filipino",tlh:"tlhIngan-Hol",tr:"Türkçe","tr-TR":"Türkçe","tt-RU":"татарча",uk:"Українська","uk-UA":"Українська",ur:"اردو","ur-PK":"اردو",uz:"O'zbek","uz-UZ":"O'zbek",vi:"Tiếng Việt","vi-VN":"Tiếng Việt","xh-ZA":"isiXhosa",yi:"ייִדיש","yi-DE":"ייִדיש (German)",zh:"中文","zh-HANS":"中文简体","zh-HANT":"中文繁體","zh-CN":"中文(中国)","zh-HK":"中文(香港)","zh-SG":"中文(新加坡)","zh-TW":"中文(台灣)","zu-ZA":"isiZulu"},yc=l(Object.keys(vc)),bc=yc.next();!bc.done;bc=yc.next()){var wc=bc.value;vc[wc.toLowerCase()]=vc[wc]}function Tc(e,t){if(e.lineBreak)return"\n";if(e.nestedCues.length)return e.nestedCues.map((function(t){return Tc(t,e)})).join("");if(!e.payload)return e.payload;var n=[],i=e.fontWeight>=Vn,r=e.fontStyle==Kn,a=e.textDecoration.includes(zn);return i&&n.push(["b"]),r&&n.push(["i"]),a&&n.push(["u"]),""==(r=e.color)&&t&&(r=t.color),i="",(r=xc(r))&&(i+="."+r),""==(r=e.backgroundColor)&&t&&(r=t.backgroundColor),(t=xc(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 xc(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 Sc(e,t){for(var n=[],i=(e=l(Ac(e))).next();!i.done;i=e.next())if((i=i.value).isContainer)n.push.apply(n,c(Sc(i.nestedCues,i)));else{var r=i.clone();r.nestedCues=[],r.payload=Tc(i,t),n.push(r)}return n}function Ac(e){for(var t=[],n=(e=l(e)).next(),i={};!n.done;i={ig:void 0},n=e.next())i.ig=n.value,t.some(function(e){return function(t){return Sn(e.ig,t)}}(i))||t.push(i.ig);return t}function kc(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 Ec(e,t){var n=Sc(t),i=[];t=e.cues?Array.from(e.cues):[];for(var r=(n=l(n)).next(),a={};!r.done;a={pd:void 0},r=n.next())a.pd=r.value,!t.some(function(e){return function(t){return t.startTime==e.pd.startTime&&t.endTime==e.pd.endTime&&t.text==e.pd.payload}}(a))&&a.pd.payload&&(r=kc(a.pd))&&i.push(r);for(n=(t=l(t=i.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?i.indexOf(t)-i.indexOf(e):i.indexOf(e)-i.indexOf(t)})))).next();!n.done;n=t.next())e.addCue(n.value)}function Ic(e,t){var n=!1;"disabled"===e.mode&&(n=!0,e.mode="hidden");for(var i=0;i<e.cues.length;){var r=e.cues[i];t(r)?e.removeCue(r):i++}n&&(e.mode="disabled")}function Cc(e){var t=this;this.i=e,this.l=new $,this.j=null,this.h=new Map,this.g=-1,this.s=!1,this.o=null,this.B=function(){t.l.Ja(t.i,"textchanged",t.m),t.l.Ja(t.j.textTracks,"change",t.A);for(var e=l(t.h.values()),n=e.next();!n.done;n=e.next())n.value.remove();t.h.clear(),t.g=-1,t.j=null},this.m=function(){for(var e=new Map,n=t.i.Dc(),i=(n=l(n)).next();!i.done;i=n.next()){if(i=i.value,t.h.has(i.id)){var r=t.h.get(i.id);i.active||"disabled"===r.track.mode||(r.track.mode="disabled"),t.h.delete(i.id)}else{(r=t.j.ownerDocument.createElement("track")).kind=Mc(i);var a=r,o=void 0;if(i.label)o=i.label;else if(i.language)if(i.language in vc)o=vc[i.language];else{var s=Ri(i.language);s in vc&&(o=vc[s]+" ("+i.language+")")}o||(o=i.originalTextId,i.language&&i.language!==i.originalTextId&&(o+=" ("+i.language+")")),a.label=o,i.language in vc&&(r.srclang=i.language),"CHROMIUM"===te().Da()&&(r.src="data:,WEBVTT"),r.track.mode="disabled",t.j.appendChild(r)}e.set(i.id,r),i.active&&(t.g=i.id)}for(i=(n=l(t.h.values())).next();!i.done;i=n.next())i.value.remove();-1<t.g&&(e.has(t.g)?"disabled"===(n=e.get(t.g).track).mode&&(n.mode=t.s?"showing":"hidden"):t.g=-1),t.h=e},this.A=function(){if(!t.o){var e=t.j;t.o=new Ti((function(){if(t.o=null,t.j===e){var n=-1,i=!1;if(t.h.has(t.g)){var r=t.h.get(t.g);"showing"===r.track.mode?(n=t.g,i=!0):"hidden"===r.track.mode&&(n=t.g)}if(!i)for(r=(i=l(t.h)).next();!r.done;r=i.next()){var a=l(r.value);if(r=a.next().value,"showing"===(a=a.next().value).track.mode){n=r;break}0>n&&"hidden"===a.track.mode&&(n=r)}for(r=(i=l(t.h)).next();!r.done;r=i.next())r=(a=l(r.value)).next().value,a=a.next().value,r!==n&&"disabled"!==a.track.mode&&(a.track.mode="disabled");t.g!==n&&(t.g=n,-1<n&&t.i.jh({id:n})),t.i.oh(-1<n&&"showing"===t.h.get(n).track.mode)}})).ia(0)}},this.l.D(e,"loaded",(function(){return t.enableTextDisplayer()})),this.enableTextDisplayer()}function Mc(e){var t=te();return e.forced&&"WEBKIT"===t.Da()?"forced":"caption"===e.kind||e.roles&&e.roles.some((function(e){return e.includes("transcribes-spoken-dialog")}))&&e.roles.some((function(e){return e.includes("describes-music-and-sound")}))?"captions":"subtitles"}function Dc(e,t){for(oe("SimpleTextDisplayer","Please migrate to NativeTextDisplayer"),this.h=e,this.i=t,this.g=null,t=(e=l(Array.from(this.h.textTracks))).next();!t.done;t=e.next())"metadata"!==(t=t.value).kind&&"chapters"!==t.kind&&(t.mode="disabled",t.label==this.i&&(this.g=t));this.g&&(this.g.mode="hidden")}function Pc(e){e.h&&!e.g&&(e.g=e.h.addTextTrack("subtitles",e.i),e.g.mode="hidden")}function Rc(){}function Lc(t,n){var i=this;this.m=!1,this.h=[],this.j=t,this.o=n,this.B=this.s=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.A=new Ti((function(){i.j.paused||Uc(i)})),Nc(this),this.l=new Map,this.i=new $,this.i.D(document,"fullscreenchange",(function(){Uc(i,!0)})),this.i.D(this.j,"seeking",(function(){Uc(i,!0)})),this.i.D(this.j,"ratechange",(function(){Nc(i)})),this.i.D(this.j,"resize",(function(){var e=i.j,t=e.videoWidth;e=e.videoHeight,i.s=t&&e?t/e:null})),this.C=null,"ResizeObserver"in e&&(this.C=new ResizeObserver((function(){Uc(i,!0)})),this.C.observe(this.g)),this.F=new Map}function Nc(e){e.A&&(e.h.length?e.A.Fa((e.B?e.B.captionsUpdatePeriod:.25)/Math.max(1,Math.abs(e.j.playbackRate))):e.A.stop())}function Oc(e,t){for(;null!=t;){if(t==e.g)return!0;t=t.parentElement}return!1}function jc(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.l.get(u),d=u.startTime<=i&&u.endTime>i,h=c?c.aj:null;c&&(o.push(c.kg),c.Xc&&o.push(c.Xc),d||(a=!0,e.l.delete(u),c=null)),d&&(s.push(u),c?Oc(e,h)||(a=!0):(_c(e,u,r),h=(c=e.l.get(u)).aj,a=!0)),0<u.nestedCues.length&&h&&jc(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.l.get(i.value)).Xc?(i.Xc.contains(n)&&i.Xc.removeChild(n),n.appendChild(i.Xc),i.Xc.appendChild(i.kg)):n.appendChild(i.kg)}}function Uc(e,t){if(e.g){var n=e.j.currentTime;if(!e.m||void 0!==t&&t){for(var i=(t=l(e.F.values())).next();!i.done;i=t.next())Zo(i.value);Zo(e.g),e.l.clear(),e.F.clear()}e.m&&jc(e,e.h,e.g,n,[])}}function _c(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=Bc(n.linePadding,n,e.o),a.paddingRight=Bc(n.linePadding,n,e.o),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.setAttribute("translate","no"),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=Bc(n.fontSize,n,e.o,e.B?e.B.fontScaleFactor:1),null!=(i=n.line)&&((o=n.lineInterpretation)==On&&(o=1,s=16,e.s&&1>e.s&&(s=32),i=0>i?100+i/s*100:i/s*100),1==o&&(a.position="absolute",n.writingMode==Nn?(a.width="100%",n.lineAlign==jn?a.top=i+"%":"end"==n.lineAlign&&(a.bottom=100-i+"%")):"vertical-lr"==n.writingMode?(a.height="100%",n.lineAlign==jn?a.left=i+"%":"end"==n.lineAlign&&(a.right=100-i+"%")):(a.height="100%",n.lineAlign==jn?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!==Cn?n:"left"===e||"start"===e&&t===Ln||"end"===e&&"rtl"===t?"line-left":"right"===e||"start"===e&&"rtl"===t||"end"===e&&t===Ln?"line-right":"center"}(n),"line-left"==e?(a.cssFloat="left",null!==n.position&&(a.position="absolute",n.writingMode==Nn?(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==Nn?(a.right=100-n.position+"%",a.width="auto"):a.bottom=n.position+"%")):null!==n.position&&50!=n.position&&(a.position="absolute",n.writingMode==Nn?(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==Nn?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.s===4/3?2.5:1.9;if(n=o.id+"_"+o.width+"x"+o.height+(o.heightUnits==kt?"%":"px")+"-"+o.viewportAnchorX+"x"+o.viewportAnchorY+(o.viewportAnchorUnits==kt?"%":"px"),e.F.has(n))n=e.F.get(n);else{r=document.createElement("span");var u=o.heightUnits==kt?"%":"px",l=o.widthUnits==kt?"%":"px",c=o.viewportAnchorUnits==kt?"%":"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.s===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.F.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.l.set(t,{kg:a,aj:r,Xc:n})}function Bc(e,t,n,i){i=void 0===i?1:i;var r=(r=new RegExp(/(\d*\.?\d+)([a-z]+|%+)/).exec(e))?{value:Number(r[1]),unit:r[2]}:null;if(!r)return e;switch(e=r.unit,i*=r.value,e){case"%":return i/100*n.clientHeight/t.cellResolution.rows+"px";case"c":return n.clientHeight*i/t.cellResolution.rows+"px";default:return i+e}}function Fc(e,t){this.h=e,this.g=t,this.i=void 0,this.s=!1,this.F=!0,this.l=this.B=!1,this.o=this.m=void 0,this.A=0,this.G=!1,this.C=new $,this.j=null}function Vc(t){return t.g.sessionId||(t.g.sessionId=e.crypto.randomUUID()),{v:t.g.version,sf:t.i,sid:t.g.sessionId,cid:t.g.contentId,mtp:t.h.getBandwidthEstimate()/1e3}}function Hc(e,t,n){n=void 0===n?{}:n;var i=void 0===i?e.g.useHeaders:i;if(e.g.enabled)if(e=function(e,t){t=void 0===t?{}:t,Object.assign(t,Vc(e)),t.pr=e.h.ub();var n=t.ot===Xc||t.ot===Wc;return e.B&&n&&(t.bs=!0,t.su=!0,e.B=!1),null==t.su&&(t.su=e.F),t.v===Jc&&(e.h.V()&&(t.ltc=e.h.Ue()),null!=(n=!e.G&&e.o&&e.m?e.o-(e.A||e.m):void 0)&&(t.msd=n,e.G=!0)),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,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,ltc:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,msd: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=Gc(r[e]))&&(n["CMCD-"+i[e]]=a);return n}(e),Object.keys(i).length&&Object.assign(t.headers,i);else{var r=Gc(e);r&&(t.uris=t.uris.map((function(e){return zc(e,r)})))}}function Kc(e,t){if(!(t=e.h.Nb()[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 Gc(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 zc(e,t){return!t||e.includes("offline:")?e:((e=new de(e)).g.set("CMCD",t),e.toString())}(i=Cc.prototype).configure=function(){},i.remove=function(e,t){return!!this.i&&(this.h.has(this.g)&&Ic(this.h.get(this.g).track,(function(n){return n.startTime<t&&n.endTime>e})),!0)},i.append=function(e){this.h.has(this.g)&&Ec(this.h.get(this.g).track,e)},i.destroy=function(){return this.i&&(this.j&&this.B(),this.i=null),this.l&&(this.l.release(),this.l=null),Promise.resolve()},i.isTextVisible=function(){return this.s},i.setTextVisibility=function(e){if(this.s=e,this.h.has(this.g)){var t=this.h.get(this.g).track;"disabled"!==t.mode&&(e=e?"showing":"hidden",t.mode!==e&&(t.mode=e))}else if(this.i&&3===this.i.m)if(t=Array.from(this.i.h.textTracks).filter((function(e){return["captions","subtitles","forced"].includes(e.kind)})),e){e=null;for(var n=(t=l(t)).next();!n.done;n=t.next()){if("showing"===(n=n.value).mode){e=null;break}e||"hidden"!==n.mode||(e=n)}e&&(e.mode="showing")}else for(t=(e=l(t)).next();!t.done;t=e.next())"showing"===(t=t.value).mode&&(t.mode="hidden")},i.setTextLanguage=function(){},i.enableTextDisplayer=function(){!this.j&&this.i&&2===this.i.m&&(this.j=this.i.h,this.l.Aa(this.i,"unloading",this.B),this.l.D(this.i,"textchanged",this.m),this.l.D(this.j.textTracks,"change",this.A),this.m())},F("shaka.text.NativeTextDisplayer",Cc),Cc.prototype.enableTextDisplayer=Cc.prototype.enableTextDisplayer,Cc.prototype.setTextLanguage=Cc.prototype.setTextLanguage,Cc.prototype.setTextVisibility=Cc.prototype.setTextVisibility,Cc.prototype.isTextVisible=Cc.prototype.isTextVisible,Cc.prototype.destroy=Cc.prototype.destroy,Cc.prototype.append=Cc.prototype.append,Cc.prototype.remove=Cc.prototype.remove,Cc.prototype.configure=Cc.prototype.configure,(i=Dc.prototype).configure=function(){},i.remove=function(e,t){return!!this.g&&(Ic(this.g,(function(n){return n.startTime<t&&n.endTime>e})),!0)},i.append=function(e){this.g&&Ec(this.g,e)},i.destroy=function(){return this.g&&(Ic(this.g,(function(){return!0})),this.g.mode="disabled"),this.g=this.h=null,Promise.resolve()},i.isTextVisible=function(){return!!this.g&&"showing"==this.g.mode},i.setTextVisibility=function(e){e&&!this.g&&Pc(this),this.g&&(this.g.mode=e?"showing":"hidden")},i.setTextLanguage=function(){},i.enableTextDisplayer=function(){Pc(this)},F("shaka.text.SimpleTextDisplayer",Dc),Dc.prototype.enableTextDisplayer=Dc.prototype.enableTextDisplayer,Dc.prototype.setTextLanguage=Dc.prototype.setTextLanguage,Dc.prototype.setTextVisibility=Dc.prototype.setTextVisibility,Dc.prototype.isTextVisible=Dc.prototype.isTextVisible,Dc.prototype.destroy=Dc.prototype.destroy,Dc.prototype.append=Dc.prototype.append,Dc.prototype.remove=Dc.prototype.remove,Dc.prototype.configure=Dc.prototype.configure,(i=Rc.prototype).configure=function(){},i.remove=function(){},i.append=function(){},i.destroy=function(){},i.isTextVisible=function(){return!1},i.setTextVisibility=function(){},i.setTextLanguage=function(){},i.enableTextDisplayer=function(){},F("shaka.text.StubTextDisplayer",Rc),Rc.prototype.enableTextDisplayer=Rc.prototype.enableTextDisplayer,Rc.prototype.setTextLanguage=Rc.prototype.setTextLanguage,Rc.prototype.setTextVisibility=Rc.prototype.setTextVisibility,Rc.prototype.isTextVisible=Rc.prototype.isTextVisible,Rc.prototype.destroy=Rc.prototype.destroy,Rc.prototype.append=Rc.prototype.append,Rc.prototype.remove=Rc.prototype.remove,Rc.prototype.configure=Rc.prototype.configure,(i=Lc.prototype).configure=function(e){this.B=e,Nc(this),Uc(this,!0)},i.append=function(e){for(var t=[].concat(c(this.h)),n=(e=l(Ac(e))).next(),i={};!n.done;i={jg:void 0},n=e.next())i.jg=n.value,t.some(function(e){return function(t){return Sn(t,e.jg)}}(i))||this.h.push(i.jg);this.h.length&&Nc(this),Uc(this)},i.destroy=function(){return this.g?(this.g.parentElement&&this.o.removeChild(this.g),this.g=null,this.m=!1,this.h=[],this.A&&(this.A.stop(),this.A=null),this.l.clear(),this.i&&(this.i.release(),this.i=null),this.C&&(this.C.disconnect(),this.C=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})),Uc(this,n>this.h.length),this.h.length||Nc(this),!0},i.isTextVisible=function(){return this.m},i.setTextVisibility=function(e){(this.m=e)?(this.g.parentElement||this.o.appendChild(this.g),Uc(this,!0)):this.g.parentElement&&this.o.removeChild(this.g)},i.setTextLanguage=function(e){e&&"und"!=e?this.g.setAttribute("lang",e):this.g.setAttribute("lang","")},i.enableTextDisplayer=function(){},F("shaka.text.UITextDisplayer",Lc),Lc.prototype.enableTextDisplayer=Lc.prototype.enableTextDisplayer,Lc.prototype.setTextLanguage=Lc.prototype.setTextLanguage,Lc.prototype.setTextVisibility=Lc.prototype.setTextVisibility,Lc.prototype.isTextVisible=Lc.prototype.isTextVisible,Lc.prototype.remove=Lc.prototype.remove,Lc.prototype.destroy=Lc.prototype.destroy,Lc.prototype.append=Lc.prototype.append,Lc.prototype.configure=Lc.prototype.configure,F("shaka.text.WebVttGenerator",(function(){})),Fc.prototype.setMediaElement=function(e){this.j=e,function(e){e.C.Aa(e.j,"play",(function(){e.m||(e.m=Date.now())})),e.C.Aa(e.j,"playing",(function(){e.o||(e.o=Date.now())}))}(this)},Fc.prototype.configure=function(e){this.g=e};var qc="a",Xc="v",Wc="av",Yc="tt",Jc=2,$c="d",Qc="ld",Zc="h",ed="lh";function td(e){this.h=e,this.g=null}function nd(e){return!e||"false"!==e.toLowerCase()&&(/^[-0-9]/.test(e)?parseInt(e,10):e.replace(/["]+/g,""))}F("shaka.util.CmcdManager.StreamingFormat",{DASH:$c,Ml:Qc,HLS:Zc,Nl:ed,am:"s",OTHER:"o"}),(i=td.prototype).configure=function(e){this.h=e},i.Yh=function(){return this.h.enabled&&this.h.applyMaximumSuggestedBitrate&&this.g&&this.g.has(rd)?1e3*this.g.get(rd):null},i.Wh=function(){return this.h.enabled&&this.g&&this.g.has(id)?1e3*this.g.get(id):null},i.Oj=function(){return this.h.enabled&&this.g&&this.g.has(ad)?this.g.get(ad):null},i.Pj=function(){return this.h.enabled&&this.g&&this.g.has(od)?this.g.get(od):null},i.getBandwidthEstimate=function(e){var t=this.Wh();if(!t)return e;var n=this.h.estimatedThroughputWeightRatio;return 0<n&&1>=n?e*(1-n)+t*n:e},F("shaka.util.CmsdManager",td),td.prototype.getBandwidthEstimate=td.prototype.getBandwidthEstimate,td.prototype.getRoundTripTime=td.prototype.Pj,td.prototype.getResponseDelay=td.prototype.Oj,td.prototype.getEstimatedThroughput=td.prototype.Wh,td.prototype.getMaxBitrate=td.prototype.Yh;var id="etp",rd="mb",ad="rd",od="rtt";function sd(){this.g=null,this.h=[]}function ud(e,t){return R((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 ld(t,n,i){n=void 0===n?null:n,Lr.call(this);var r=this;this.m=hh,this.h=null,this.we=n,this.ba=!1,this.Be=new $,this.pe=new $,this.j=new $,this.bc=new $,this.wd=new $,this.F=this.G=this.C=this.I=null,this.Ce=0,this.ka=new sd,this.N=this.ha=this.W=this.i=this.qc=this.H=this.l=this.le=this.S=this.Gh=this.va=this.L=this.ab=this.ya=this.me=this.P=this.Ka=this.K=this.Zb=null,this.Oa=!1,this.Za=this.s=null,this.ve=1e9,this.Ae=[],this.eb=[],this.Wf=-1,this.g=Ud(this),this.Yf={streaming:{inaccurateManifestTolerance:0,segmentPrefetchLimit:2,updateIntervalSeconds:.1,maxDisabledTime:1,retryParameters:{baseDelay:100}},manifest:{dash:{autoCorrectDrift:!1},retryParameters:{baseDelay:100}},drm:{retryParameters:{baseDelay:100}}},this.U=null,this.Ee=-1,this.$b=null,this.wa={width:1/0,height:1/0},this.ue=new Ka(this.g,this.wa,null),this.ye=[],this.A=null,this.M=this.g.adaptationSetCriteriaFactory(),this.M.configure({language:this.g.preferredAudioLanguage,role:this.g.preferredVariantRole,channelCount:0,Ec:this.g.preferredVideoHdrLevel,spatialAudio:this.g.preferSpatialAudio,videoLayout:this.g.preferredVideoLayout,Jc:this.g.preferredAudioLabel,Ed:this.g.preferredVideoLabel,codecSwitchingStrategy:this.g.mediaSource.codecSwitchingStrategy,audioCodec:"",Gd:"",Fe:0,preferredAudioCodecs:this.g.preferredAudioCodecs,preferredAudioChannelCount:this.g.preferredAudioChannelCount}),this.xd=this.g.preferredTextLanguage,this.se=this.g.preferredTextRole,this.re=this.g.preferForcedSubs,this.qe=[],i&&i(this),this.L=function(e){return new Fc({getBandwidthEstimate:function(){return e.s?e.s.getBandwidthEstimate():NaN},Nb:function(){return e.Nb()},getCurrentTime:function(){return e.h?e.h.currentTime:0},ub:function(){return e.ub()},Pb:function(){return e.Pb()},Qb:function(){return e.Qb()},V:function(){return e.V()},Ue:function(){return e.Ue()}},e.g.cmcd)}(this),this.va=new td(this.g.cmsd),this.I=Ad(this),this.zd=this.na=this.za=this.B=null,this.$f=!1,this.Xf=[],this.Zf=new Ti((function(){return R((function(e){return 1==e.g?r.na?w(e,r.fc(r.zd,!0),3):e.u(0):4!=e.g?w(e,r.load(r.na),4):(r.$f?r.zd.pause():r.zd.play(),r.na=null,r.$f=!1,void T(e))}))})),vh&&(this.B=vh(),this.B.configure(this.g.ads),this.wd.D(this.B,"ad-content-pause-requested",(function(e){var t;return R((function(n){if(1==n.g)return r.Zf.stop(),r.na?n.u(0):(r.zd=r.h,r.$f=r.Wd(),t=e.saveLivePosition||!1,w(n,r.Qh(!0,t),3));r.na=n.h,T(n)}))})),this.wd.D(this.B,"ad-content-resume-requested",(function(e){if(e=e.offset||0,r.na){var t=r.na;t.m&&e&&("number"==typeof t.m?t.m+=e:t.m.setTime(t.m.getTime()+1e3*e))}r.Zf.ia(.1)})),this.wd.D(this.B,"ad-content-attach-requested",(function(){return R((function(e){return r.h||!r.zd?e.u(0):w(e,r.fc(r.zd,!0),0)}))}))),yh&&(this.za=yh(this),this.za.configure(this.g.queue)),this.Be.D(e,"online",(function(){nh(r),r.eh()})),this.xe=new Ti((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.xe.stop(),t&&Gd(r,!1,void 0,!1,!1)})),this.Pa=null,t&&(oe("Player w/ mediaElement","Please migrate from initializing Player with a mediaElement; use the attach method instead."),this.fc(t,!0)),this.o=null}function cd(e){null!=e.S&&(ct(e.S),e.S.release(),e.S=null)}function dd(e,t){return new Dr(e,t)}function hd(e,t){mh.set(e,t)}function pd(e,t){e.dispatchEvent(dd("onstatechange",(new Map).set("state",t)))}function fd(e,t){var n;return R((function(i){return 1==i.g?(n=++e.Ce,w(i,ud(e.ka,t),2)):n!=e.Ce?(e.ka.release(),i.return(!0)):i.return(!1)}))}function gd(e,t){var n,i;return t=void 0!==t&&t,R((function(r){if(1==r.g)return n=null,e.i&&e.H&&e.qc&&e.W&&e.g?(i=e.h.currentTime,e.V()&&!t&&(i=null),w(r,vd(e,e.W,i,e.ha,e.g,!0,!1,!1),3)):r.u(2);if(2!=r.g){n=r.h,e.ye.push(n),e.H&&e.H.setMediaElement&&e.H.setMediaElement(null);var a=n,o=e.H,s=e.qc;a.h=e.i,a.l=o,a.G=s,n.A=e.M,n.start(),e.i=null,e.H=null,e.qc=null,e.s=null,e.Za=null}return r.return(n)}))}function md(e,t,n,i,r,a){var o,s,u,l;return r=void 0!==r&&r,R((function(c){return 1==c.g?i?c.u(2):w(c,yd(e,t),3):(2!=c.g&&(i=c.h),function(e,t){if(!ev(te()))return!0;if(t){if(""==(e.h||es()).canPlayType(t))return!1;if(!ev(te())||!Za.has(t))return!0;if(ci(t))return"WEBKIT"===te().Da()&&(e.g.drm.servers["com.apple.fps"]||e.g.drm.servers["com.apple.fps.1_0"])?e.g.streaming.useNativeHlsForFairPlay:e.g.streaming.preferNativeHls;if("application/dash+xml"===t||"video/vnd.mpeg.dash.mpd"===t)return e.g.streaming.preferNativeDash}return!1}(e,i)?c.return(null):(o=a||e.g,s=!1,u=!0,r&&(e.s&&e.Za==o.abrFactory&&(u=!1),e.h&&"AUDIO"===e.h.nodeName&&(s=!0)),l=vd(e,t,n,i||null,o,!r,s,u),l=r?l.then((function(e){return e.B=!1,e})):l.then((function(t){return e.ye.push(t),t})),c.return(l)))}))}function vd(e,t,n,i,r,a,o,s){var u,c,d,h,p,f,g,m,v,y,b,x;return a=void 0===a||a,o=void 0!==o&&o,s=void 0===s||s,R((function(S){return 1==S.g?(u=null,c=Bt(r),o&&(c.manifest.disableVideo=!0),d=function(){return u.S&&u.o?null:u},h=function(){return d()?d().getConfiguration():e.g},1/0!=e.wa.width||1/0!=e.wa.height||e.g.ignoreHardwareResolution?S.u(2):w(S,te().ic(),3)):(2!=S.g&&(p=S.h,e.wa.width=p.width,e.wa.height=p.height),f=new Ka(c,e.wa,null),g={networkingEngine:e.I,filter:function(e){var t;return R((function(n){return 1==n.g?w(n,Ga(f,e),2):4!=n.g?n.h?(t=dd("trackschanged"),w(n,Promise.resolve(),4)):n.u(0):(u.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 Nu,c=r.closedCaptions.get(o);s={id:e.ve++,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:rt,primary:!1,trickModeVideo:null,dependencyStream: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([ni(s,"")]),isAudioMuxedInVideo:!1,baseOriginalId:null},t.textStreams.push(s),n.add(o)}}(e,t)},onTimelineRegionAdded:function(e){Ku(u.H,e)},onEvent:function(e){return u.dispatchEvent(e)},onError:function(e){return u.onError(e)},isLowLatencyMode:function(){return h().streaming.lowLatencyMode},updateDuration:function(){e.l&&u.S&&e.l.updateDuration()},newDrmInfo:function(e){var t=u.i,n=t?t.g:null;n&&t.A&&Xa(f,n.keySystem,e)},onManifestUpdated:function(){var t=(new Map).set("isLive",e.V());u.dispatchEvent(dd("manifestupdated",t)),ic(u,!1,(function(){e.B&&e.B.onManifestUpdated(e.V())}))},getBandwidthEstimate:function(){return e.s.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.B)&&e.B.onHLSInterstitialMetadata(e,e.h,t),t=(r=l(r)).next();for(var o={};!t.done;o={Xg:void 0},t=r.next())o.Xg=t.value,"ID"!=o.Xg.name&&ic(u,!1,function(t){return function(){Sd(e,n,i,a,t.Xg)}}(o))},disableStream:function(t){return e.disableStream(t,e.g.streaming.maxDisabledTime)},addFont:function(t,n){return e.addFont(t,n)}},(m=new Hu((function(){return e.Sa()}))).addEventListener("regionadd",(function(t){var n=t.region;rh(e,"timelineregionadded",n,u),ic(u,!1,(function(){e.B&&(e.B.onDashTimedMetadata(n),e.B.onDASHInterstitialMetadata(e,e.h,n))}))})),v=null,c.streaming.observeQualityChanges&&((v=new Bu((function(){return e.Nb()}))).addEventListener("qualitychange",(function(t){ah(e,t.quality,t.position)})),v.addEventListener("audiotrackchange",(function(t){ah(e,t.quality,t.position,!0)}))),y=!0,b={pc:e.I,onError:function(e){return u.onError(e)},rf:function(t){ic(u,!0,(function(){if(e.C){var n=t,i=dd("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){r=e.keySystem();for(var o=Jr(e.g.drm.clearKeys),s=l(e.i.variants),u=s.next();!u.done;u=s.next()){var c=[];(u=u.value).audio&&c.push(u.audio),u.video&&c.push(u.video);for(var d=(c=l(c)).next();!d.done;d=c.next()){var h=d.value;if(d=u.allowedByKeySystem,h.keyIds.size)if(h.drmInfos.length&&!o.size){for(var p=(h=l(h.drmInfos)).next();!p.done;p=h.next())if((p=p.value).keyIds.size&&p.keySystem==r){u.allowedByKeySystem=!0;for(var f=(p=l(p.keyIds)).next();!f.done;f=p.next())f=f.value,((f=n[i?"00":f])||e.C.G)&&(u.allowedByKeySystem=u.allowedByKeySystem&&!!f&&!Ya.includes(f))}}else for(u.allowedByKeySystem=!0,p=(h=l(h.keyIds)).next();!p.done;p=h.next())p=p.value,((p=n[i?"00":p])||e.C.G)&&(u.allowedByKeySystem=u.allowedByKeySystem&&!!p&&!Ya.includes(p));d!=u.allowedByKeySystem&&(a=!0)}}}a&&(Wd(e),!Kd(e))||(n=e.l.o)&&!n.allowedByKeySystem&&Gd(e)}}))},onExpirationUpdated:function(e,t){var n=dd("expirationupdated");u.dispatchEvent(n),(n=u.l)&&n.onExpirationUpdated&&n.onExpirationUpdated(e,t)},onEvent:function(t){u.dispatchEvent(t),"drmsessionupdate"==t.type&&y&&(y=!1,t=Date.now()/1e3-u.Ka,(e.A||u.getStats()).m=t,e.S&&ct(e.S))}},x=Ad(e,d),_r(e.I,x),u=new nc(t,i,n,{config:c,pk:g,Ck:m,Bk:v,hd:function(){return e.hd(b)},nk:f,networkingEngine:x,ej:a,dj:s}),s||function(e,t,n){e.j=t,e.C=n}(u,e.s,e.Za),S.return(u))}))}function yd(e,t){var n,i;return R((function(r){return 1==r.g?(n=e.g.manifest.retryParameters,w(r,gc(t,e.I,n),2)):("application/x-mpegurl"==(i=r.h)&&"WEBKIT"===te().Da()&&(i="application/vnd.apple.mpegurl"),r.return(i))}))}function bd(e){var t=e.g.textDisplayFactory;if(e.Fh!==t){var n=e.o;e.o=t(),e.o.configure?e.o.configure(e.g.textDisplayer):oe("Text displayer w/ configure",'Text displayer should have a "configure" method!'),e.o.setTextLanguage||oe("Text displayer w/ setTextLanguage",'Text displayer should have a "setTextLanguage" method!'),n?(e.o.setTextVisibility(n.isTextVisible()),n.destroy().catch((function(){}))):e.o.setTextVisibility(e.ba),e.G&&function(e,t){e.ha=t,e.h&&(e.h.j=t)}(e.G,e.o),e.Fh=t,e.l&&function(e){var t=e.h.get(rt);t&&ll(e,t.stream,!0,0,!0)}(e.l)}else e.o&&e.o.configure&&e.o.configure(e.g.textDisplayer)}function wd(e){var t,n,i;return R((function(r){if(1==r.g)return te(),pd(e,"media-source"),e.g.mediaSource.useSourceElements&&Qo(e.h),bd(e),t=function(e,t,n,i,r){return new Ds(e,t,n,r,i)}(e.h,e.o,{Ej: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())Sd(e,a,o,"org.id3",u.value);e.B&&e.B.onHlsTimedMetadata(r,a)}},wk:function(t){e.ab&&Ku(e.ab,{schemeIdUri:t.schemeIdUri,startTime:t.startTime,endTime:t.endTime,id:String(t.id),emsg:t})},onEvent:function(t){return e.dispatchEvent(t)},yk:function(){e.H&&e.H.update&&e.H.update()}},e.S,e.g.mediaSource),n=e.g.manifest,i=n.segmentRelativeVttTiming,t.Ka=i,w(r,t.K,2);e.G=t,T(r)}))}function Td(e,t,n){function i(){return Fd(e)}if(e.j.D(t,"playing",i),e.j.D(t,"pause",i),e.j.D(t,"ended",i),e.j.D(t,"ratechange",(function(){var t=e.h.playbackRate;0!=t&&(e.K&&(e.K.set(t),e.m==ph&&e.s.playbackRateChanged(t),Bd(e,t)),t=dd("ratechange"),e.dispatchEvent(t))})),t.remote&&(e.j.D(t.remote,"connect",(function(){e.l&&"connected"==t.remote.state&&Qd(e),Wd(e)})),e.j.D(t.remote,"connecting",(function(){return Wd(e)})),e.j.D(t.remote,"disconnect",(function(){return R((function(n){if(1==n.g)return e.l&&"disconnected"==t.remote.state?w(n,Il(e.l),3):n.u(2);2!=n.g&&Qd(e),Wd(e),T(n)}))}))),t.audioTracks&&(e.j.D(t.audioTracks,"addtrack",(function(){return Wd(e)})),e.j.D(t.audioTracks,"removetrack",(function(){return Wd(e)})),e.j.D(t.audioTracks,"change",(function(){return Wd(e)}))),t.videoTracks&&(e.j.D(t.videoTracks,"addtrack",(function(){return Wd(e)})),e.j.D(t.videoTracks,"removetrack",(function(){return Wd(e)})),e.j.D(t.videoTracks,"change",(function(){return Wd(e)}))),t.textTracks){var r=function(){e.m===fh&&e.o instanceof Cc&&Qd(e),Wd(e)};e.j.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.j.D(t,"cuechange",(function(){if(t.activeCues)for(var n=l(t.activeCues),i=n.next();!i.done;i=n.next())i=i.value,Sd(e,i.startTime,i.endTime,i.type,i.value),e.B&&e.B.onCueMetadataChange(i.value);if(t.cues){n=[];for(var r=(i=l(t.cues)).next(),a={};!r.done;a={xc:void 0},r=i.next())a.xc=r.value,"com.apple.quicktime.HLS"==a.xc.type&&null!=a.xc.startTime&&(r=n.find(function(e){return function(t){return t.startTime==e.xc.startTime&&t.endTime==e.xc.endTime}}(a)),r||(r={startTime:a.xc.startTime,endTime:a.xc.endTime,values:[]},n.push(r)),r.values.push(a.xc.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.B&&(i.values.push({key:"CUE",description:"",data:0!=i.startTime||e.V()?"ONCE":"ONCE,PRE",mimeType:null,pictureType:null}),e.B.onHLSInterstitialMetadata(e,e.h,i))}}));var n=new Ti((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"})).Jb().ia(.5);e.qe.push((function(){n.stop()}))}}(e,t);break;case"chapters":!function(e,t){if(t&&"chapters"==t.kind){t.mode="hidden";var n=new Ti((function(){t.mode="hidden"})).Jb().ia(.5);e.qe.push((function(){n.stop()}))}}(e,t);break;default:r()}})),e.j.D(t.textTracks,"removetrack",r),e.j.D(t.textTracks,"change",r),"keep"!==e.g.streaming.crossBoundaryStrategy&&(e.j.D(t,"waiting",(function(){e.l&&Ml(e.l)})),e.j.D(t,"timeupdate",(function(){e.l&&Ml(e.l)})))}"none"!=t.preload&&e.j.Aa(t,"loadedmetadata",(function(){e.A.F=Date.now()/1e3-n}))}function xd(e,t,n){t=(new Map).set("startTime",t.startTime).set("endTime",t.endTime).set("metadataType",t.schemeIdUri).set("payload",t.payload),e.dispatchEvent(dd(n,t))}function Sd(e,t,n,i,r){e.ya&&((t={schemeIdUri:i,startTime:t,endTime:n||1/0,id:"",payload:r}).id=JSON.stringify(t),Ku(e.ya,t))}function Ad(e,t){function n(n){t()?t().dispatchEvent(n):e.dispatchEvent(n)}function i(e){t()?ic(t(),!0,e):e()}t||(t=function(){return null});var r=new jr((function(n,i,r,a,o){var s=t()?t().j:e.s;s&&s.segmentDownloaded(n,i,r,a,o)}),(function(t,r,a){n(dd("downloadheadersreceived",r=(new Map).set("headers",t).set("request",r).set("requestType",a))),i((function(){if(e.va){var n=e.va;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],nd(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],nd(l[1]))}var c=s}catch(e){c=null}c&&(n.g=c)}}}}))}),(function(e,t){n(dd("downloadcompleted",e=(new Map).set("request",e).set("response",t)))}),(function(e,t,i,r){n(dd("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.L,a=r;if(a=void 0===a?{}:a,i.g.enabled)if("HEAD"===n.method)Hc(i,n);else switch(t){case 0:try{if(i.g.enabled){if(a.type){e:{switch(a.type){case 4:var o=i.l?Qc:$c;break e;case 3:case 2:o=i.l?ed:Zc;break e;case 5:o="s";break e}o=void 0}i.i=o}Hc(i,n,{ot:"m",su:!i.s})}}catch(e){X("CMCD_MANIFEST_ERROR","Could not generate manifest CMCD data.",e)}break;case Gr:try{if(i.g.enabled){var s=n.uris[0],u=a.segment;o=0,u&&(o=u.endTime-u.startTime);var c={d:1e3*o,st:i.h.V()?"l":"v"};c.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(",")?Wc:Xc;if("audio"==t)return qc;if("text"==t)return"application/mp4"===e.mimeType?Yc:"c"}}(a);var d=c.ot===Xc||c.ot===qc||c.ot===Wc||c.ot===Yc,h=a.stream;if(h){var p=i.h.ub();if(d&&(c.bl=function(e,t){if(!(t=e.h.Nb()[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,h.type),c.ot!==Yc)){var f=Kc(i,h.type);c.dl=p?f/Math.abs(p):f}if(h.bandwidth&&(c.br=h.bandwidth/1e3),h.segmentIndex&&u){var g=h.segmentIndex.Wb(u.endTime,!0,0>p);if(g){var m=g.next().value;if(m&&m!=u){if(s&&!Dt(u.O(),m.O())){var v=m.O()[0],y=new URL(v),b=new URL(s);if(y.origin!==b.origin)var w=v;else{for(var T=y.pathname.split("/").slice(1),x=b.pathname.split("/").slice(1,-1);T[0]===x[0];)T.shift(),x.shift();for(;x.length;)x.shift(),T.unshift("..");w=T.join("/")}c.nor=w}if((m.startByte||m.endByte)&&(u.startByte!=m.startByte||u.endByte!=m.endByte)){var S=m.startByte+"-";m.endByte&&(S+=m.endByte),c.nrr=S}}}var A=i.h.ub()||1,k=Kc(i,h.type)||500,E=h.bandwidth,I=E?E*(u.endTime-u.startTime)/1e3/(k/A/1e3)*i.g.rtpSafetyFactor:NaN;isNaN(I)||(c.rtp=I)}}d&&c.ot!==Yc&&(c.tb=function(e,t){var n=e.h.Qb();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 Xc:return e.videoBandwidth||NaN;case qc:return e.audioBandwidth||NaN;default:return e.bandwidth}}(i,c.ot)/1e3),Hc(i,n,c)}}catch(e){X("CMCD_SEGMENT_ERROR","Could not generate segment CMCD data.",e)}break;case 2:case 5:case 6:Hc(i,n,{ot:"k"});break;case 4:Hc(i,n,{ot:"o"})}}))}),(function(n,i,r,a){(n=t()?t().l: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&&(tc(r,i),0===n&&(r.gi=i))}}));return r.configure(e.g.networking),r}function kd(e,t,n){e.P=new Fa,e.P.g=Va,Ed(e),_d(e),e.Ka=new Ti((function(){Id(e)})),e.g.streaming.rebufferingGoal&&e.Ka.Fa(.25),e.j.D(t,"waiting",(function(){return Id(e)})),e.j.D(t,"canplaythrough",(function(){return Id(e)})),e.j.D(t,"playing",(function(){return Id(e)})),e.j.D(t,"seeked",(function(){return Id(e)})),n&&(e.j.D(t,"stalled",(function(){return Id(e)})),e.j.D(t,"progress",(function(){return Id(e)})),e.j.D(t,"timeupdate",(function(){return Id(e)})))}function Ed(e){var t=e.g.streaming.rebufferingGoal;e.P.i.set(Ha,Math.min(.5,t/2)).set(Va,t)}function Id(e){var t=!!e.G&&Os(e.G),n=e.Wd()||t||e.F.ci(),i=Wo(e.h.buffered,e.h.currentTime),r=(t=e.P).i.get(t.g),a=t.g;n=n||i>=r&&0<i?Ha:Va,t.g=n,(a=a!=n)&&n===Ha&&(t.h=Date.now()),a&&_d(e)}function Cd(e){if(e.ue=new Ka(e.g,e.wa,e.C),e.H){var t=Bt(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.l){e.l.configure(e.g.streaming);try{e.m!=dh&&qa(e.ue,e.i)&&Wd(e)}catch(t){ih(e,t)}e.s&&Kd(e),!(t=e.l.o)||t.allowedByApplication&&t.allowedByKeySystem||Gd(e)}e.I&&e.I.configure(e.g.networking),e.G&&(e.G.configure(e.g.mediaSource),e.G.Ka=e.g.manifest.segmentRelativeVttTiming),e.o&&bd(e),e.s&&(e.s.configure(e.g.abr),e.g.abr.enabled?e.s.enable():e.s.disable(),eh(e)),e.P&&Ed(e),e.Ka&&(e.g.streaming.rebufferingGoal?e.Ka.Fa(.25):e.Ka.stop()),e.i&&sh(e.i.presentationTimeline,e.g.playRangeStart,e.g.playRangeEnd),e.B&&e.B.configure(e.g.ads),e.L&&e.L.configure(e.g.cmcd),e.va&&e.va.configure(e.g.cmsd),e.za&&e.za.configure(e.g.queue)}function Md(e){return e&&(e=/(\d+)x(\d+)/.exec(e))?{Lc:parseInt(e[1],10),rows:parseInt(e[2],10)}:null}function Dd(e,t){var n,i;return R((function(r){return 1==r.g?e.m!=ph&&e.m!=fh?r.return(null):(n=e.Ae,e.i&&(n=e.i.imageStreams),(i=n[0])?(null!=t&&(i=n.find((function(e){return e.id==t}))),i?i.segmentIndex?r.u(2):w(r,i.createSegmentIndex(),2):r.return(null)):r.return(null)):r.return(i)}))}function Pd(e,t,n,i){var r=t.width||0,a=t.height||0,o=r/i.Lc,s=a/i.rows,u=i.Lc*i.rows,l=e.j-e.startTime;l=e.B||l/u;var c=e.startTime,d=0,h=0;return 1<u&&(h=Math.floor((n-e.startTime)/l),c=e.startTime+h*l,d=h%i.Lc*o,h=Math.floor(h/i.Lc)*s),i=!1,(n=e.thumbnailSprite)&&(i=!0,s=n.height,d=n.positionX,h=n.positionY,o=n.width),{segment:e,imageHeight:a,imageWidth:r,height:s,positionX:d,positionY:h,startTime:c,duration:l,uris:e.O(),startByte:e.Bc(),endByte:e.zc(),width:o,sprite:i,mimeType:e.mimeType||t.mimeType,codecs:e.codecs||t.codecs}}function Rd(e,t){e.j.D(t,"cuechange",(function(){e.o.remove(0,Math.max(0,e.h.currentTime-e.g.streaming.bufferBehind));for(var n={periodStart:0,segmentStart:0,segmentEnd:e.h.duration,vttOffset:0},i=[],r=Array.from(t.activeCues||[]),a=(r=l(r)).next();!a.done;a=r.next()){if(1/0===(a=a.value).endTime||a.endTime<a.startTime)a=null;else{var o=new Tn(a.startTime,a.endTime,a.text);o.line="number"==typeof a.line?a.line:null,a.lineAlign&&(o.lineAlign=a.lineAlign),o.lineInterpretation=a.snapToLines?On:1,o.position="number"==typeof a.position?a.position:null,a.positionAlign&&(o.positionAlign=a.positionAlign),o.size=a.size,o.textAlign=a.align,"lr"===a.vertical?o.writingMode="vertical-lr":"rl"===a.vertical&&(o.writingMode="vertical-rl"),a.region&&(o.region.id=a.region.id,o.region.height=a.region.lines,o.region.heightUnits=2,o.region.regionAnchorX=a.region.regionAnchorX,o.region.regionAnchorY=a.region.regionAnchorY,o.region.scroll=a.region.scroll,o.region.viewportAnchorX=a.region.viewportAnchorX,o.region.viewportAnchorY=a.region.viewportAnchorY,o.region.viewportAnchorUnits=kt,o.region.width=a.region.width,o.region.widthUnits=kt),An(o),a=o}a&&((o=e.g.mediaSource.modifyCueCallback)&&o(a,null,n),i.push(a))}e.o.append(i)})),t.mode=document.pictureInPictureElement?"showing":"hidden"}function Ld(e){return Array.from(e.h.textTracks).filter((function(e){return"metadata"!=e.kind&&"chapters"!=e.kind&&"Shaka Player TextTrack"!=e.label}))}function Nd(e,t){var n;return R((function(i){switch(i.g){case 1:return x(i,2),w(i,gc(t,e.I,e.g.streaming.retryParameters),4);case 4:n=i.h,A(i,3);break;case 2:k(i);case 3:if(n)return i.return(n);throw new Ne(1,2,2011,t)}}))}function Od(e,t,n,i){var r,a,o;return R((function(s){if(1==s.g){r=Gr,(a=Br([t],i)).method="GET";var u=e.L;try{u.g.enabled&&Hc(u,a,{ot:"c",su:!0})}catch(e){X("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 jd(e,t,n,i){var r=gi(n);if(r)return n=r(),e={periodStart:0,segmentStart:0,segmentEnd:e.h.duration,vttOffset:0},t=De(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=Sc(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 Ne(2,2,2014,n)}function Ud(e){var t=zl();return t.streaming.failureCallback=function(t){if(e.V()){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.eh(n))}},t.textDisplayFactory=function(){var t=te();return e.we&&(document.fullscreenEnabled||"WEBKIT"!==t.Da())?new Lc(e.h,e.we):"track"in document.createElement("track")?new Cc(e):new Rc},t}function _d(e){var t=e.Mg();if(e.A&&e.P&&e.F){if(0==e.g.streaming.rebufferingGoal){var n=e.K;n.j=!1,ju(n)}else(n=e.K).j=t,ju(n);if(e.L&&(n=e.L,t||n.s||(n.s=!0),n.s&&t&&(n.B=!0),n.F=t),Fd(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.U&&(e.U=Math.min(e.U+ ++e.Ee*r,n-i))}}t=(new Map).set("buffering",t),e.dispatchEvent(dd("buffering",t))}function Bd(e,t){e.bc.Ra(),e.bc.D(e.h,"timeupdate",(function(){var n=e.h.currentTime,i=e.Sa(),r=e.V(),a=r?e.g.streaming.safeSeekOffset:0;0<t?(!r||1<=t)&&Math.floor(n)>=Math.floor(i.end)&&e.Id():Math.floor(n)<=Math.floor(i.start+a)&&e.Id()}))}function Fd(e){if(e.A&&e.P){var t=e.A.g,n="playing";e.P.g==Va?n="buffering":e.Wd()?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(dd("statechanged",n)))}}function Vd(e){var t=e.h.playbackRate,n=e.V();if(e.g.streaming.vodDynamicPlaybackRate&&!n){var i=e.g.streaming.vodDynamicPlaybackRateLowBufferRate,r=e.Vh();r<=e.g.streaming.vodDynamicPlaybackRateBufferRatio?t!=i&&e.ke(i,!1):1==r&&t!==e.K.Pc()&&e.Id()}if(n&&(n=e.Sa(),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.U||"number"!=typeof o||(e.U=o);var d=e.g.streaming.liveSync.dynamicTargetLatency.maxAttempts;r&&e.$b&&null!==e.U&&"number"==typeof o&&e.Ee<d&&Date.now()-e.$b>1e3*a&&(a=e.g.streaming.liveSync.dynamicTargetLatency.minLatency,e.U=Math.max(e.U-(o-a)/2,a+i),e.$b=Date.now()),r&&null!==e.U&&(s=e.U+i,u=e.U-i),o=n.end-e.h.currentTime,i=0,e.m==fh&&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.P.h,n&&!c&&(c=e.g.streaming.liveSync.minPlaybackRate),n&&c&&a<=r?t!=c&&e.ke(c,!1):null!=s&&l&&o-i>s?(t!=l&&e.ke(l,!1),e.$b=null):null!=u&&c&&o-i<u?(t!=c&&e.ke(c,!1),e.$b=null):t!==e.K.Pc()&&(e.Id(),e.$b=Date.now())}}function Hd(e){if(e.h){var t=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.Wf<t)&&(e.Wf=t,!0)},n=e.Sa();if(n=0<(n=n.end-n.start)?e.h.currentTime/n:0,!isNaN(n)){if(t(0,n*=100))var i=dd("started");else t(25,n)?i=dd("firstquartile"):t(50,n)?i=dd("midpoint"):t(75,n)?i=dd("thirdquartile"):((t(100,n)||100<n)&&(i=dd("complete")),e.g&&1/0!=e.g.playRangeEnd&&e.Wd()&&e.h.pause());i&&e.dispatchEvent(i)}}}function Kd(e){try{Wa(e.ue,e.i)}catch(t){return ih(e,t),!1}var t=Zi(e.i.variants);return t=e.M.create(t),e.s.setVariants(Array.from(t.values())),!0}function Gd(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=Kd(e)?e.s.chooseVariant():null)&&zd(e,a,r,t,n,i)}function zd(e,t,n,i,r,a){a=void 0!==a&&a;var o=e.l.o;if(t==o)i&&sl(e.l,t,i,r,!0);else{var s=e.A.h;if(s.h!=t&&(s.h=t,s.g.push({timestamp:Date.now()/1e3,id:t.id,type:"variant",fromAdaptation:n,bandwidth:t.bandwidth})),sl(e.l,t,i,r,a,n),i=null,o&&(i=qi(o)),(o=qi(t)).active=!0,e.S&&(r=e.S,t=t.video)){switch(t.dependencyStream&&(t=t.dependencyStream),a=0,s=-1,t.mimeType){case"video/webm":a=1;break;case"video/mp4":a=2}switch(e.Xh()){case"DASH":s=1;break;case"HLS":s=0}r.g&&(r.g.setLevelSwitching(t.id,!0),r.g.setContainerFormat(a),r.j||r.g.setStreamingFormat(s))}n?uh(e,n=dd("adaptation",n=(new Map).set("oldTrack",i).set("newTrack",o))):Yd(e,i,o),Jd(e,i,o)}}function qd(e,t){var n=Array.from(e.h.audioTracks).find((function(e){return e.enabled}));if(t.enabled=!0,n){t.id!==n.id&&(n.enabled=!1);var i=Xd(e);Yd(e,n=$i(n,i),t=$i(t,i)),Jd(e,n,t)}}function Xd(e){return e.h&&e.h.videoTracks?Array.from(e.h.videoTracks).find((function(e){return e.selected})):null}function Wd(e){uh(e,dd("trackschanged")),$d(e)}function Yd(e,t,n){uh(e,t=dd("variantchanged",t=(new Map).set("oldTrack",t).set("newTrack",n)))}function Jd(e,t,n){var i=!1;t&&t.audioId==n.audioId&&t.audioGroupId==n.audioGroupId||(i=!0),i&&$d(e)}function $d(e){uh(e,dd("audiotrackschanged"))}function Qd(e){uh(e,dd("textchanged"))}function Zd(e){uh(e,dd("texttrackvisibility"))}function eh(e){e.g.abr.enabled||nh(e),uh(e,dd("abrstatuschanged",(new Map).set("newStatus",e.g.abr.enabled)))}function th(e){var t=e.Dc().find((function(e){return e.active}));t&&e.o&&e.o.setTextLanguage&&e.o.setTextLanguage(t.language)}function nh(e,t){if(t=void 0===t||t,e.m==ph){e.xe.stop();for(var n=l(e.i.variants),i=n.next();!i.done;i=n.next())i.value.disabledUntilTime=0;t&&Kd(e)}}function ih(e,t){var n,i,r,a;return R((function(o){switch(o.g){case 1:if(e.m==dh)return o.return();if(1===t.severity&&e.A.L++,n=!0,!(e.Oa&&e.i&&e.l)||3016!=t.code&&3014!=t.code&&3015!=t.code&&3024!=t.code&&3018!=t.code){o.u(2);break}return"WEBKIT"===te().Da()&&3016==t.code?o.return():(x(o,3),w(o,Il(e.l),5));case 5:i=o.h,n=!i,i&&(r=dd("mediasourcerecovered"),e.dispatchEvent(r)),A(o,2);break;case 3:k(o),n=!0;case 2:if(!n)return o.return();2===t.severity&&nh(e,!1),a=dd("error",(new Map).set("detail",t)),e.dispatchEvent(a),a.defaultPrevented&&(t.handled=!0),T(o)}}))}function rh(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,timescale:n.timescale,eventElement:n.eventElement,eventNode:n.eventNode}),i.dispatchEvent(dd(t,e))}function ah(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(dd(i?"audiotrackchanged":"mediaqualitychanged",t))}function oh(e,t){if(t=void 0===t||t,!e.h.error)return t?new Ne(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 Ne(2,3,3016,n,t,e.h.error.message)):null}function sh(e,t,n){0<t&&(e.V()||e.Ni(t)),n<(t=e.getDuration())&&(e.V()||e.pb(n))}function uh(e,t){R((function(n){if(1==n.g)return w(n,Promise.resolve(),2);e.m!=dh&&e.dispatchEvent(t),T(n)}))}function lh(e){for(var t=new Set,n=(e=l(e)).next();!n.done;n=e.next())(n=n.value).language?t.add(Di(n.language)):t.add("und");return t}function ch(e){for(var t=new Map,n=new Map,i=0;i<e.length;i++){var r=e[i],a="und",o=[];r.language&&(a=Di(r.language)),(o="variant"==r.type?r.audioRoles:r.roles)&&o.length||(o=[""]),t.has(a)||t.set(a,new Set);for(var s=(o=l(o)).next();!s.done;s=o.next())s=s.value,t.get(a).add(s),r.label&&(n.has(a)||n.set(a,new Map),n.get(a).set(s,r.label))}var u=[];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)),u.push({language:t,role:i,label:r})}})),u}sd.prototype.release=function(){0<this.h.length?this.h.shift()():this.g=null},m(ld,Lr),(i=ld.prototype).destroy=function(){var e,t=this;return R((function(n){switch(n.g){case 1:return t.m==dh?n.return():(cd(t),e=t.detach(),t.m=dh,w(n,e,2));case 2:return w(n,t.ng(),3);case 3:if(t.Be&&(t.Be.release(),t.Be=null),t.pe&&(t.pe.release(),t.pe=null),t.j&&(t.j.release(),t.j=null),t.bc&&(t.bc.release(),t.bc=null),t.wd&&(t.wd.release(),t.wd=null),t.Za=null,t.g=null,t.A=null,t.we=null,t.L=null,t.va=null,!t.I){n.u(4);break}return w(n,t.I.destroy(),5);case 5:t.I=null;case 4:t.s&&(t.s.release(),t.s=null),t.za&&(t.za.destroy(),t.za=null),Lr.prototype.release.call(t),T(n)}}))},i.fc=function(e,t){t=void 0===t||t;var n,i,r,a=this;return R((function(o){switch(o.g){case 1:if(a.m==dh)throw new Ne(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,fd(a,"attach"),4);case 4:if(o.h)return o.return();if(x(o,5,6),n||(pd(a,"attach"),i=function(){var e=oh(a,!1);e&&ih(a,e)},a.pe.D(e,"error",i),a.h=e,a.L&&a.L.setMediaElement(e)),te(),!t||!ev()||a.G){o.u(6);break}return w(o,wd(a),6);case 6:E(o),a.ka.release(),I(o,0);break;case 5:return r=k(o),w(o,a.detach(),10);case 10:throw r}}))},i.fj=function(e){this.Gh=e},i.detach=function(e){e=void 0!==e&&e;var t=this;return R((function(n){if(1==n.g){if(t.m==dh)throw new Ne(2,7,7e3);return w(n,t.vc(!1,e),2)}if(3!=n.g)return w(n,fd(t,"detach"),3);if(n.h)return n.return();try{t.h&&(t.pe.Ra(),t.h=null),pd(t,"detach"),t.B&&!e&&t.B.release()}finally{t.ka.release()}T(n)}))},i.vc=function(t,n){t=void 0===t||t,n=void 0!==n&&n;var i,r,a,o,s,u,c,d,h,p,f,g,m,v=this;return R((function(y){switch(y.g){case 1:return v.m!=dh&&(v.m=hh),w(y,fd(v,"unload"),2);case 2:return y.h?y.return():(S(y,3),v.Oa=!1,pd(v,"unload"),cd(v),i=v.qe.map((function(e){return e()})),v.qe=[],w(y,Promise.all(i),5));case 5:if(v.dispatchEvent(dd("unloading")),v.me&&(v.me.release(),v.me=null),v.ya&&(v.ya.release(),v.ya=null),v.ab&&(v.ab.release(),v.ab=null),v.h&&(v.j.Ra(),v.bc.Ra()),v.xe.stop(),v.Zb&&(v.Zb.release(),v.Zb=null),v.Ka&&(v.Ka.stop(),v.Ka=null),!v.H){y.u(6);break}return w(y,v.H.stop(),7);case 7:v.H=null,v.qc=null;case 6:if(!v.s){y.u(8);break}return w(y,v.s.stop(),8);case 8:if(!v.l){y.u(10);break}return w(y,v.l.destroy(),11);case 11:v.l=null;case 10:if(v.K&&(v.K.release(),v.K=null),v.F&&(v.F.release(),v.F=null),"webkit"!==e.shakaMediaKeysPolyfill||!v.C){y.u(12);break}return w(y,v.C.destroy(),13);case 13:v.C=null;case 12:if(!v.G){y.u(14);break}return w(y,v.G.destroy(),15);case 15:v.G=null;case 14:if(v.B&&!n&&v.B.onAssetUnload(),v.na&&!n&&(v.na.destroy(),v.na=null),n||v.Zf.stop(),v.L&&function(e){e.s=!1,e.F=!0,e.B=!1,e.l=!1,e.m=0,e.o=0,e.A=0,e.G=!1,e.j=null,e.C.Ra()}(v.L),v.va&&(v.va.g=null),!v.o){y.u(16);break}return w(y,v.o.destroy(),17);case 17:v.o=null;case 16:if(v.ba=!1,v.h){for(r=l(v.Xf),a=r.next();!a.done;a=r.next())(o=a.value).src.startsWith("blob:")&&URL.revokeObjectURL(o.src),o.remove();v.Xf=[],Qo(v.h)&&v.h.load()}if(!v.C){y.u(18);break}return w(y,v.C.destroy(),19);case 19:v.C=null;case 18:if(v.Pa&&v.W!=v.Pa.nd()&&(v.Pa.o||v.Pa.destroy(),v.Pa=null),v.W=null,v.ha=null,v.P=null,v.i){for(s=l(v.i.variants),u=s.next();!u.done;u=s.next())for(c=u.value,d=l([c.audio,c.video]),h=d.next();!h.done;h=d.next())(p=h.value)&&p.segmentIndex&&p.segmentIndex.release();for(f=l(v.i.textStreams),g=f.next();!g.done;g=f.next())(m=g.value).segmentIndex&&m.segmentIndex.release()}v.g&&v.g.streaming.clearDecodingCache&&(or.clear(),wr.clear()),v.i=null,v.A=new Zl,v.Fh=null,v.$b=null,v.U=null,v.Ee=-1,v.Ae=[],v.eb=[],v.Wf=-1,v.I&&v.I.Mh(),_d(v);case 3:E(y),v.ka.release(),I(y,4);break;case 4:if(te(),t&&ev()&&!v.G&&v.h)return w(y,wd(v),0);y.u(0)}}))},i.cl=function(e){this.N=e},i.load=function(t,n,i){n=void 0===n?null:n;var r,a,o,s,u,c,d,h,p,f,g,m,v,y,b=this;return R((function(A){switch(A.g){case 1:if(b.m==dh)throw new Ne(2,7,7e3);if(r=null,a="",t instanceof nc){if(t.o)throw new Ne(2,7,7006);a=(r=t).nd()||""}else a=t||"";return w(A,ud(b.ka,"load"),2);case 2:if(b.ka.release(),!b.h)throw new Ne(2,7,7002);if(!b.W){A.u(3);break}return b.W=a,w(A,b.vc(!1),3);case 3:if(o=++b.Ce,s=function(){return R((function(e){if(1==e.g)return b.Ce==o?e.u(0):r?w(e,r.destroy(),3):e.u(3);throw new Ne(2,7,7e3)}))},u=function(e,t){return R((function(n){switch(n.g){case 1:return S(n,2),w(n,ud(b.ka,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&&b.g&&(r.g=b.g);case 2:E(n),b.ka.release(),I(n,0)}}))},x(A,5,6),null==n&&r&&(n=r.getStartTime()),b.N=n,b.Oa=!1,b.dispatchEvent(dd("loading")),r){i=r.W,A.u(8);break}if(i){A.u(8);break}return w(A,u((function(){return R((function(e){if(1==e.g)return w(e,yd(b,a),2);i=e.h,T(e)}))}),"guessMimeType_"),8);case 8:if(c=!!r,r){rc(r,b),b.A=r.getStats(),A.u(11);break}return w(A,md(b,a,n,i,!0,b.g),12);case 12:(r=A.h)?(r.B=!1,rc(r,b),b.A=r.getStats(),r.start(),r.s.catch((function(){}))):b.A=new Zl;case 11:return d=!r,h=Date.now()/1e3,b.A=r?r.getStats():new Zl,b.W=a,b.ha=i||null,_d(b),p=function(){var e=b.Nb(),t={start:0,end:0};if(e.total.length){t.start=1/0;for(var n=(e=l(e.total)).next();!n.done;n=e.next())(n=n.value).start<t.start&&(t.start=n.start),n.end>t.end&&(t.end=n.end)}return t},b.ya=new Hu(p),b.ya.addEventListener("regionadd",(function(e){xd(b,e.region,"metadataadded")})),d?w(A,u((function(){return R((function(e){return w(e,function(e,t){var n,i,r;return R((function(a){return 1==a.g?(n=Date.now()/1e3,i=!0,e.C=e.hd({pc:e.I,onError:function(t){ih(e,t)},rf:function(){},onExpirationUpdated:function(){var t=dd("expirationupdated");e.dispatchEvent(t)},onEvent:function(t){e.dispatchEvent(t),"drmsessionupdate"==t.type&&i&&(i=!1,e.A.m=Date.now()/1e3-n)}}),e.C.configure(e.g.drm),r=ar([t]),e.C.ha=!0,w(a,ga(e.C,[r],[]),2)):w(a,e.C.fc(e.h),0)}))}(b,i),0)}))}),"initializeSrcEqualsDrmInner_"),23):(b.ab=new Hu(p),w(A,u((function(){return R((function(e){if(1==e.g)return w(e,Promise.race([r.va,r.s]),2);b.qc=r.G;var t=r;t.wa=!0,b.H=t.l,b.i=r.Fg(),T(e)}))}),"waitForFinish"),15));case 15:if(b.G){A.u(16);break}return w(A,u((function(){return R((function(e){return w(e,wd(b),0)}))}),"initializeMediaSourceEngineInner_"),16);case 16:return b.i&&b.i.textStreams.length&&(b.o.enableTextDisplayer?b.o.enableTextDisplayer():oe("Text displayer w/ enableTextDisplayer",'Text displayer should have a "enableTextDisplayer" method!')),w(A,u((function(){return R((function(e){return w(e,r.s,0)}))}),"waitForFinish"),18);case 18:if(b.g=r.getConfiguration(),b.ue=r.F,b.H&&b.H.setMediaElement&&b.h&&b.H.setMediaElement(b.h),b.me=function(e){return e.ya=!0,e.H}(r),b.le=r.Pa,(f=r.A)&&(b.M=f),c&&b.h&&"AUDIO"===b.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}))}(b),b.configure("manifest.disableVideo",!0)),r.i){A.u(19);break}return w(A,u((function(){return R((function(e){return w(e,sc(r,b.h),0)}))}),"drmEngine_.init"),19);case 19:return b.C=function(e){return e.na=!0,e.i}(r),w(A,u((function(){return R((function(e){return w(e,b.C.fc(b.h),0)}))}),"drmEngine_.attach"),21);case 21:return!(g=r.C)||b.Za&&b.Za==g||(b.s=function(e){return e.ha=!0,e.j}(r),b.Za=r.C,"function"!=typeof b.s.setMediaElement&&(oe("AbrManager w/o setMediaElement","Please use an AbrManager with setMediaElement function."),b.s.setMediaElement=function(){}),"function"!=typeof b.s.setCmsdManager&&(oe("AbrManager w/o setCmsdManager","Please use an AbrManager with setCmsdManager function."),b.s.setCmsdManager=function(){}),"function"!=typeof b.s.trySuggestStreams&&(oe("AbrManager w/o trySuggestStreams","Please use an AbrManager with trySuggestStreams function."),b.s.trySuggestStreams=function(){})),m=function(e){return e.za=!0,e.M}(r),v=r.K,w(A,u((function(){return R((function(t){return w(t,function(t,n,i,r){var a,o,s,u,c,d,h,p,f,g,m,v,y,b,x,S,A,k,E,I,C,M,D,P,L,N,O;return R((function(j){switch(j.g){case 1:pd(t,"load"),a=t.h,t.K=new Ou({Ve:function(){return a.playbackRate},Pc:function(){return a.defaultPlaybackRate},nh:function(e){a.playbackRate=e},ni:function(e){a.currentTime+=e}}),Td(t,a,n),"onchange"in e.screen&&t.j.D(e.screen,"change",(function(){if(t.M.getConfiguration){var e=t.M.getConfiguration();"AUTO"==e.Ec?Kd(t):"AUTO"==t.g.preferredVideoHdrLevel&&t.g.abr.enabled&&(e.Ec="AUTO",t.M.configure(e),Kd(t))}})),o=!1,s=l(t.i.variants);for(u=s.next();!u.done;u=s.next())c=u.value,(d=c.video&&c.video.dependencyStream)&&(o=dt(d));!function(e,t,n){n||t.lcevc.enabled?(cd(e),null==e.S&&(e.S=new ut(e.h,e.Gh,t.lcevc,n),e.G&&(e.G.M=e.S))):cd(e)}(t,t.g,o),t.xd=t.g.preferredTextLanguage,t.se=t.g.preferredTextRole,t.re=t.g.preferForcedSubs,sh(t.i.presentationTimeline,t.g.playRangeStart,t.g.playRangeEnd),t.s.init((function(e,n,i){t.i&&t.l&&e!=t.l.o&&zd(t,e,!0,void 0!==n&&n,void 0===i?0:i)})),t.s.setMediaElement(a),t.s.setCmsdManager(t.va),t.l=function(e){return new al(e.i,{Qc:function(){return e.F?e.F.De():0},getBandwidthEstimate:function(){return e.s.getBandwidthEstimate()},ub:function(){return e.ub()},video:e.h,Z:e.G,pc:e.I,onError:function(t){return ih(e,t)},onEvent:function(t){return e.dispatchEvent(t)},tf:function(t,n,i){var r=t.startTime;if(t=t.endTime,(n=n.type)!=rt){if(e.F){e.F.pi();var a=Us(e.G,n);!e.V()&&e.h.paused&&!e.h.seeking&&null!=a&&0<a&&e.F.De()<a&&e.F.Vf(a)}Id(e)}i=(new Map).set("start",r).set("end",t).set("contentType",n).set("isMuxed",i),e.dispatchEvent(dd("segmentappended",i))},xk:function(t,n){(n=n.rd)&&e.le&&function(e,t,n){var i=function(e,t){var n=e.g.get(t);return n||(n={ce:[],lg: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.ce;t.ce=r.filter((function(e,t){return!(e.position<=n&&t+1<r.length&&r[t+1].position<=n||e.position>=i)}))}else t.ce=[]}(e,i),e={rd:t,position:n},0<=(t=(i=i.ce).findIndex((function(e){return e.position>=n})))?i.splice(t,i[t].position==n?1:0,e):i.push(e)}(e.le,n,t)},Kh:function(t,n){var i=e.C;if(i.h.parseInbandPsshEnabled&&!i.G&&["audio","video"].includes(t)){t=new ha(De(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.l}}else i=Promise.resolve();return i},disableStream:function(t,n){return e.disableStream(t,n)}})}(t),t.l.configure(t.g.streaming),t.m=ph,t.dispatchEvent(dd("streaming")),h=i;case 2:for((f=t.l.o)||h||(h=Kd(t)?t.s.chooseVariant():null),g=[],m=l([(p=f||h).video,p.audio]),v=m.next();!v.done;v=m.next())(y=v.value)&&!y.segmentIndex&&(g.push(y.createSegmentIndex()),y.dependencyStream&&g.push(y.dependencyStream.createSegmentIndex()));if(!(0<g.length)){j.u(4);break}return w(j,Promise.all(g),4);case 4:if(!p||0!=p.disabledUntilTime){j.u(2);break}if(t.H&&t.H.onInitialVariantChosen&&t.H.onInitialVariantChosen(p),t.i.isLowLatency&&(t.g.streaming.lowLatencyMode?t.configure(t.Yf):q("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.")),t.L&&(function(e,t){e.l=t,e.l?e.i==$c?e.i=Qc:e.i==Zc&&(e.i=ed):e.i==Qc?e.i=$c:e.i==ed&&(e.i=Zc)}(t.L,t.i.isLowLatency&&t.g.streaming.lowLatencyMode),function(e,t){if(e.g&&e.g.enabled&&e.g.version==Jc&&e.j&&e.j.autoplay){var n=e.j.play();n&&n.then((function(){e.A=t})).catch((function(){e.A=0}))}}(t.L,1e3*n)),sh(t.i.presentationTimeline,t.g.playRangeStart,t.g.playRangeEnd),function(e,t,n){e.j.presentationTimeline.V()||(e.W=t,e.U=n)}(t.l,t.g.playRangeStart,t.g.playRangeEnd),t.Oa=!0,t.dispatchEvent(dd("canupdatestarttime")),b=function(e){t.F=function(e,t){return new ku(e.h,e.i,e.g.streaming,t,(function(){e.Zb&&_u(e.Zb,!0),e.l&&e.l.Yc(),e.P&&Id(e)}),(function(t){return e.dispatchEvent(t)}))}(t,e),t.Zb=function(e,t){var n=e.V()||"number"==typeof t&&0<t;(t=new cc(e.me,n)).addEventListener("enter",(function(t){rh(e,"timelineregionenter",t.region)})),t.addEventListener("exit",(function(t){rh(e,"timelineregionexit",t.region)})),t.addEventListener("skip",(function(t){var n=t.region;t.seeking||(rh(e,"timelineregionenter",n),rh(e,"timelineregionexit",n))}));var i=new cc(e.ya,n);i.addEventListener("enter",(function(t){xd(e,t.region,"metadata")})),(n=new cc(e.ab,n)).addEventListener("enter",(function(t){t=(new Map).set("detail",t.region.emsg),e.dispatchEvent(dd("emsg",t))}));var r=new Uu(e.h);return r.g.add(t),r.g.add(i),r.g.add(n),e.le&&r.g.add(e.le),r}(t,e),kd(t,a,!1)},t.g.streaming.startAtSegmentBoundary||(null==(x=t.N)&&t.i.startTime&&(x=t.i.startTime),b(x)),f){j.u(7);break}if(!t.g.streaming.startAtSegmentBoundary){j.u(8);break}return S=t.i.presentationTimeline,t.N instanceof Date&&(k=S.m||S.i,null!=(E=t.N.getTime()/1e3-k)&&(A=E)),null==A&&(A="number"==typeof t.N?t.N:t.h.currentTime),null==t.N&&t.i.startTime&&(A=t.i.startTime),I=S.Xb(),C=S.Fb(),A<I?A=I:A>C&&(A=C),w(j,function(e,t){var n,i,r,a,o;return R((function(s){return 1==s.g?(n=e.audio,i=e.video,r=function(e,t){var n,i,r;return R((function(a){return 1==a.g?e?e.segmentIndex?a.u(2):w(a,e.createSegmentIndex(),2):a.return(null):(i=(n=e.segmentIndex.Wb(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)}))}(h,A),9);case 9:M=j.h,b(M);case 8:zd(t,h,!0,!1,0);case 7:return t.F.ready(),t.Dc().find((function(e){return e.active}))||((D=er(t.i.textStreams,t.xd,t.se,t.re)[0]||null)&&Ql(t.A.h,D,!0),h&&(D?(rr(h.audio,D,t.g)&&(t.ba=!0),t.ba&&t.o.setTextVisibility(!0)):(t.ba=!1,t.o.setTextVisibility(!1)),Zd(t)),D&&(t.g.streaming.alwaysStreamText||t.Ng())&&(ul(t.l,D),th(t))),w(j,t.l.start(r),10);case 10:t.g.abr.enabled&&(t.s.enable(),eh(t)),Wd(t),Kd(t),t.i.variants.some((function(e){return e.primary})),((P=t.V())&&(t.g.streaming.liveSync&&t.g.streaming.liveSync.enabled||t.i.serviceDescription||t.g.streaming.liveSync.panicMode)||t.g.streaming.vodDynamicPlaybackRate)&&(L=function(){return Vd(t)},t.j.D(a,"timeupdate",L)),P||(N=function(){return Hd(t)},t.j.D(a,"timeupdate",N),Hd(t),t.i.nextUrl&&(0<t.g.streaming.preloadNextUrlWindow&&(O=function(){var e;return R((function(n){if(1==n.g)return e=t.Sa().end-t.h.currentTime,!isNaN(e)&&e<=t.g.streaming.preloadNextUrlWindow?(t.j.Ja(a,"timeupdate",O),w(n,t.preload(t.i.nextUrl),4)):n.u(0);t.Pa=n.h,T(n)}))},t.j.D(a,"timeupdate",O)),t.j.D(a,"ended",(function(){t.load(t.Pa||t.i.nextUrl)})))),t.B&&t.B.onManifestUpdated(P),T(j)}}))}(b,h,v,m),0)}))}),"loadInner_"),22);case 22:!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),b.ha&&te().Wi()&&ci(b.ha)&&function(t,n,i){t.g&&e.ManagedMediaSource&&t.i&&t.A.useSourceElements&&(t.B&&t.g.removeChild(t.B),t.B=$o(n,i),t.g.appendChild(t.B),t.g.disableRemotePlayback=!1)}(b.G,b.W,b.ha),A.u(14);break;case 23:return w(A,u((function(){return R((function(e){return w(e,function(e,t,n){var i,r,a,o,s,u,c,d,h,p,f,g;return R((function(m){switch(m.g){case 1:if(pd(e,"src-equals"),i=e.h,e.F=new xu(i),r=!1,e.qe.push((function(){r=!0})),e.dispatchEvent(dd("canupdatestarttime")),null!=e.N&&e.F.Vf(e.N),e.Zb=function(e,t){(t=new cc(e.ya,t instanceof Date||0<t)).addEventListener("enter",(function(t){xd(e,t.region,"metadata")}));var n=new Uu(e.h);return n.g.add(t),n}(e,e.N||0),e.K=new Ou({Ve:function(){return i.playbackRate},Pc:function(){return i.defaultPlaybackRate},nh:function(e){i.playbackRate=e},ni:function(e){i.currentTime+=e}}),kd(e,i,!0),i.textTracks&&(bd(e),a=function(t){if(!(e.o instanceof Cc)){var n=Ld(e).find((function(e){return"disabled"!==e.mode}));n&&(n.mode=t?"showing":"hidden"),e.o instanceof Dc&&(n=function(e){return Array.from(e.h.textTracks).find((function(e){return"Shaka Player TextTrack"==e.label}))}(e))&&(n.mode=!t&&e.o.isTextVisible()?"showing":"hidden")}},e.j.D(i,"enterpictureinpicture",(function(){return a(!0)})),e.j.D(i,"leavepictureinpicture",(function(){return a(!1)})),i.remote?(e.j.D(i.remote,"connect",(function(){return a(!1)})),e.j.D(i.remote,"connecting",(function(){return a(!1)})),e.j.D(i.remote,"disconnect",(function(){return a(!1)}))):"webkitCurrentPlaybackTargetIsWireless"in i&&e.j.D(i,"webkitcurrentplaybacktargetiswirelesschanged",(function(){return a(!1)})),(o=i).webkitSupportsFullscreen&&e.j.D(o,"webkitpresentationmodechanged",(function(){return a("inline"!==o.webkitPresentationMode)}))),Td(e,i,t),s=function(e,t,n){try{if(!e.g.enabled)return t;var i=Vc(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=qc;break e;case"video/webm":case"video/mp4":case"video/mpeg":case"video/mp2t":r=Wc;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,zc(t,Gc(i))}catch(e){return X("CMCD_SRC_ERROR","Could not generate src CMCD data.",e),t}}(e.L,e.W,n),!s.includes("#t=")&&(0<e.g.playRangeStart||isFinite(e.g.playRangeEnd))&&(s+="#t=",0<e.g.playRangeStart&&(s+=e.g.playRangeStart),isFinite(e.g.playRangeEnd)&&(s+=","+e.g.playRangeEnd)),!e.G){m.u(2);break}return w(m,e.G.destroy(),3);case 3:e.G=null;case 2:return Qo(i),i.src=s,"TV"==(u=te()).La()&&i.load(),"none"!=i.preload&&!i.autoplay&&ci(n)&&"WEBKIT"===u.Da()&&i.load(),e.m=fh,e.dispatchEvent(dd("streaming")),c=new Sr,pu(i,HTMLMediaElement.HAVE_METADATA,e.j,(function(){e.F.ready(),e.ha&&ci(e.ha)||c.resolve()})),d=function(){return new Promise((function(t){var n=new Ti(t);e.j.D(i.textTracks,"change",(function(){return n.ia(.5)})),n.ia(.5)}))},pu(i,HTMLMediaElement.HAVE_CURRENT_DATA,e.j,(function(){var t,n,i,a,o;return R((function(s){if(1==s.g)return w(s,d(),2);if(r)return s.return();if(function(e){var t=e.g.preferredAudioLanguage;""!=t&&e.Hi(t,e.g.preferredVariantRole)}(e),(t=Ld(e)).some((function(e){return"showing"===e.mode}))&&(e.ba=!0,e.o.setTextVisibility(!0)),!(e.o instanceof Cc))for(t.length&&(e.o.enableTextDisplayer?e.o.enableTextDisplayer():oe("Text displayer w/ enableTextDisplayer",'Text displayer should have a "enableTextDisplayer" method')),n=!1,i=l(t),a=i.next();!a.done;a=i.next())"disabled"!==(o=a.value).mode&&(n?(o.mode="disabled",q("Found more than one enabled text track, disabling it",o)):(Rd(e,o),n=!0));!function(e){var t=e.g.preferredTextLanguage;""!=t&&e.ih(t,e.g.preferredTextRole,e.g.preferForcedSubs)}(e),e.ha&&ci(e.ha)&&c.resolve(),T(s)}))})),i.error?c.reject(oh(e)):"none"==i.preload&&(q('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.'),c.resolve()),e.j.Aa(i,"error",(function(){c.reject(oh(e))})),w(m,ki(e.g.streaming.loadTimeout,c),4);case 4:((h=e.V())&&(e.g.streaming.liveSync&&e.g.streaming.liveSync.enabled||e.g.streaming.liveSync.panicMode)||e.g.streaming.vodDynamicPlaybackRate)&&(p=function(){return Vd(e)},e.j.D(i,"timeupdate",p)),h||(f=function(){return Hd(e)},e.j.D(i,"timeupdate",f),Hd(e)),e.B&&(e.B.onManifestUpdated(h),h&&(g=e.Sa().end,e.j.D(i,"progress",(function(){var t=e.Sa().end;g!=t&&(e.B.onManifestUpdated(e.V()),g=t)})))),e.Oa=!0,T(m)}}))}(b,h,i),0)}))}),"srcEqualsInner_"),14);case 14:b.dispatchEvent(dd("loaded"));case 6:if(E(A),!r){A.u(25);break}return w(A,r.destroy(),25);case 25:b.Pa=null,I(A,0);break;case 5:if(!(y=k(A))||7e3==y.code){A.u(27);break}return w(A,b.vc(!1),27);case 27:throw y}}))},i.Yk=function(e,t){e=void 0===e||e,t=void 0!==t&&t;var n,i=this;return R((function(r){return 1==r.g?w(r,gd(i),2):3!=r.g?(n=r.h,w(r,i.vc(e,t),3)):r.return(n)}))},i.Qh=function(e,t){e=void 0!==e&&e,t=void 0!==t&&t;var n,i=this;return R((function(r){return 1==r.g?w(r,gd(i,t),2):3!=r.g?(n=r.h,w(r,i.detach(e),3)):r.return(n)}))},i.preload=function(e,t,n,i){t=void 0===t?null:t;var r,a,o=this;return R((function(s){return 1==s.g?(ql(r=Ud(o),i||o.g,Ud(o)),w(s,md(o,e,t,n,!1,r),2)):((a=s.h)?a.start():ih(o,new Ne(2,7,7005)),s.return(a))}))},i.ng=function(){var e,t,n,i,r=this;return R((function(a){for(e=[],t=l(r.ye),n=t.next();!n.done;n=t.next())(i=n.value).o||e.push(i.destroy());return r.ye=[],w(a,Promise.all(e),0)}))},i.Gk=function(){for(var e=this.ka;e.g;)e.release()},i.hd=function(e){return new fa(e)},i.configure=function(e,t){if(2==arguments.length&&"string"==typeof e&&(e=Ll(e,t)),e.streaming&&"forceTransmuxTS"in e.streaming&&(oe("streaming.forceTransmuxTS configuration","Please Use mediaSource.forceTransmux instead."),e.mediaSource=e.mediaSource||{},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=e.mediaSource||{},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.");var n=te();e.streaming.preferNativeHls=e.streaming.useNativeHlsOnSafari&&"WEBKIT"===n.Da(),delete e.streaming.useNativeHlsOnSafari}if(e.streaming&&"boolean"==typeof e.streaming.liveSync&&(oe("streaming.liveSync","Please Use streaming.liveSync.enabled instead."),n=e.streaming.liveSync,e.streaming.liveSync={},e.streaming.liveSync.enabled=n),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}if(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=e.mediaSource||{},e.mediaSource.dispatchAllEmsgBoxes=e.streaming.dispatchAllEmsgBoxes,delete e.streaming.dispatchAllEmsgBoxes),e.streaming&&"autoLowLatencyMode"in e.streaming&&(oe("streaming.autoLowLatencyMode configuration","Please Use streaming.lowLatencyMode instead."),e.streaming.lowLatencyMode=e.streaming.autoLowLatencyMode,delete e.streaming.autoLowLatencyMode),e.manifest&&e.manifest.dash&&"ignoreSupplementalCodecs"in e.manifest.dash&&(oe("manifest.dash.ignoreSupplementalCodecs configuration","Please Use manifest.ignoreSupplementalCodecs instead."),e.manifest.ignoreSupplementalCodecs=e.manifest.dash.ignoreSupplementalCodecs,delete e.manifest.dash.ignoreSupplementalCodecs),e.manifest&&e.manifest.hls&&"ignoreSupplementalCodecs"in e.manifest.hls&&(oe("manifest.hls.ignoreSupplementalCodecs configuration","Please Use manifest.ignoreSupplementalCodecs instead."),e.manifest.ignoreSupplementalCodecs=e.manifest.hls.ignoreSupplementalCodecs,delete e.manifest.hls.ignoreSupplementalCodecs),e.manifest&&e.manifest.dash&&"updatePeriod"in e.manifest.dash&&(oe("manifest.dash.updatePeriod configuration","Please Use manifest.updatePeriod instead."),e.manifest.updatePeriod=e.manifest.dash.updatePeriod,delete e.manifest.dash.updatePeriod),e.manifest&&e.manifest.hls&&"updatePeriod"in e.manifest.hls&&(oe("manifest.hls.updatePeriod configuration","Please Use manifest.updatePeriod instead."),e.manifest.updatePeriod=e.manifest.hls.updatePeriod,delete e.manifest.hls.updatePeriod),e.manifest&&e.manifest.dash&&"ignoreDrmInfo"in e.manifest.dash&&(oe("manifest.dash.ignoreDrmInfo configuration","Please Use manifest.ignoreDrmInfo instead."),e.manifest.ignoreDrmInfo=e.manifest.dash.ignoreDrmInfo,delete e.manifest.dash.ignoreDrmInfo),e.drm&&e.drm.advanced){for(var a in n=!1,e.drm.advanced){var o=e.drm.advanced[a];i=o.videoRobustness,o=o.audioRobustness,"videoRobustness"in e.drm.advanced[a]&&!Array.isArray(e.drm.advanced[a].videoRobustness)&&(e.drm.advanced[a].videoRobustness=[i],n=!0),"audioRobustness"in e.drm.advanced[a]&&!Array.isArray(e.drm.advanced[a].audioRobustness)&&(e.drm.advanced[a].audioRobustness=[o],n=!0)}n&&oe("AdvancedDrmConfiguration's videoRobustness and audioRobustness","These properties are no longer strings but array of strings, please update your usage of these properties.")}return e.streaming&&"forceHTTP"in e.streaming&&(oe("streaming.forceHTTP configuration","Please Use networking.forceHTTP instead."),e.networking=e.networking||{},e.networking.forceHTTP=e.streaming.forceHTTP,delete e.streaming.forceHTTP),e.streaming&&"forceHTTPS"in e.streaming&&(oe("streaming.forceHTTPS configuration","Please Use networking.forceHTTP instead."),e.networking=e.networking||{},e.networking.forceHTTPS=e.streaming.forceHTTPS,delete e.streaming.forceHTTPS),e.streaming&&"minBytesForProgressEvents"in e.streaming&&(oe("streaming.minBytesForProgressEvents configuration","Please Use networking.minBytesForProgressEvents instead."),e.networking=e.networking||{},e.networking.minBytesForProgressEvents=e.streaming.minBytesForProgressEvents,delete e.streaming.minBytesForProgressEvents),a=ql(this.g,e,Ud(this)),Cd(this),a},i.nj=function(e){this.Yf=e},i.getConfiguration=function(){var e=Ud(this);return ql(e,this.g,Ud(this)),e},i.xj=function(){return this.Yf},i.Zh=function(){return ql(Ud(this),this.g,Ud(this)),Ol(this.g,Ud(this))},i.Vh=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.Sa().end)))return 1;if(!(e<=this.h.currentTime)&&e<t)return(e-this.h.currentTime)/(t-this.h.currentTime)}return 0},i.Ci=function(){for(var e in this.g)delete this.g[e];ql(this.g,Ud(this),Ud(this)),Cd(this)},i.Fj=function(){return this.m},i.Xh=function(){return this.i?this.i.type:null},i.Jj=function(){return this.h},i.Pb=function(){return this.I},i.nd=function(){return this.W},i.Uh=function(){return this.B?this.B:null},i.$h=function(){return this.za?this.za:null},i.V=function(){return this.i&&!this.ua()?this.i.presentationTimeline.V():!(!this.h||!this.h.src&&!this.ua())&&1/0==this.h.duration},i.Tc=function(){return!!this.i&&this.i.presentationTimeline.Tc()},i.ck=function(){if(this.i&&!this.ua()){var e=this.i.variants;return!!e.length&&!e[0].video}return!(!this.h||!this.h.src&&!this.ua())&&(this.h.videoTracks?0==this.h.videoTracks.length:0==this.h.videoHeight)},i.jk=function(){if(this.i&&!this.ua()){var e=this.i.variants;return!(!e.length||(e=e[0]).audio||!e.video||e.video.codecs.includes(","))}return!(!this.h||!this.h.src&&!this.ua()||!this.h.audioTracks)&&0==this.h.audioTracks.length},i.Sa=function(){if(this.i&&!this.ua()){if(!this.Oa&&"HLS"==this.i.type)return{start:0,end:0};var e=this.i.presentationTimeline;return{start:e.Xb(),end:e.Fb()}}if(this.h&&(this.h.src||this.ua())&&(e=this.h.seekable)&&e.length){var t=this.g?this.g.playRangeStart:0;t=Math.max(e.start(0),t);var n=this.g?this.g.playRangeEnd:1/0;return{start:t,end:e=Math.min(e.end(e.length-1),n)}}return{start:0,end:0}},i.Zj=function(){this.V()&&(this.h.currentTime=this.Sa().end)},i.dk=function(){return this.Oa},i.keySystem=function(){var e=this.drmInfo();return e?e.keySystem:""},i.drmInfo=function(){return this.C?this.C.g:null},i.Pd=function(){return this.C?this.C.Pd():1/0},i.Eg=function(){return this.C?this.C.Eg():[]},i.Te=function(){return this.C?this.C.Te():{}},i.Mg=function(){return this.P?this.P.g==Va:!!this.W},i.ub=function(){return this.h?this.K?this.K.i:1:0},i.Ch=function(e){this.m==ph&&this.l&&ol(this.l,e)},i.ke=function(e,t){t=void 0===t||t,0==e?q("A trick play rate of 0 is unsupported!"):(this.K.set(e),this.m==ph&&(this.s.playbackRateChanged(e),this.Ch(t&&1!=e)),Bd(this,e))},i.Id=function(){var e=this.K.Pc();this.m==fh&&this.K.set(e),this.m==ph&&(this.K.set(e),this.s.playbackRateChanged(e),this.Ch(!1)),this.bc.Ra()},i.Qb=function(){if(this.i&&!this.ua()){for(var e=this.l?this.l.o:null,t=[],n=0,i=l(this.i.variants),r=i.next();!r.done;r=i.next())if(Qi(r=r.value)){var a=qi(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}if(this.h&&this.h.audioTracks){var o=Xd(this);return(e=Array.from(this.h.audioTracks)).length?e.map((function(e){return $i(e,o)})):o?[$i(null,o)]:[]}return[]},i.Dc=function(){if(this.i){if(this.ua())return[];for(var e=this.l?this.l.A:null,t=[],n=l(this.i.textStreams),i=n.next();!i.done;i=n.next()){var r=Xi(i=i.value);r.active=i==e,t.push(r)}return t}return this.h&&this.h.src&&this.h.textTracks?Ld(this).map((function(e){return Ji(e)})):[]},i.Cj=function(){var e=this.Ae;return this.i&&(e=this.i.imageStreams),e.map((function(e){return Wi(e)}))},i.qj=function(e){var t,n,i=this;return R((function(r){return 1==r.g?w(r,Dd(i,e),2):(t=r.h)?(n=[],t.segmentIndex.Eb((function(e){var i=Md(e.tilesLayout||t.tilesLayout);if(i)for(var r=i.rows*i.Lc,a=e.j-e.startTime,o=0;o<r;o++){var s=Pd(e,t,e.startTime+a*o/r,i);n.push(s)}})),t.closeSegmentIndex&&t.closeSegmentIndex(),r.return(n)):r.return(null)}))},i.Tj=function(e,t){var n,i,r,a,o=this;return R((function(s){return 1==s.g?w(s,Dd(o,e),2):(n=s.h)?null==(i=n.segmentIndex.find(t))?s.return(null):(r=n.segmentIndex.get(i),(a=Md(r.tilesLayout||n.tilesLayout))?s.return(Pd(r,n,t,a)):s.return(null)):s.return(null)}))},i.jh=function(e){var t,n=this;this.i&&this.F&&((t=n.i.textStreams.find((function(t){return t.id==e.id})))&&t!=n.l.A&&(Ql(n.A.h,t,!1),ul(n.l,t),Qd(n),th(n),n.xd=t.language),!this.ua())||function(){if(n.h&&n.h.textTracks){var t=Ld(n),i=t.find((function(t){return Yi(t)===e.id}));if(i){if(n.o instanceof Cc)for(var r=(t=l(t)).next();!r.done;r=t.next()){var a=(r=r.value)===i?n.ba?"showing":"hidden":"disabled";r.mode!==a&&(r.mode=a)}else(t=t.find((function(e){return"disabled"!==e.mode})))!==i&&(t&&(t.mode="disabled",n.j.Ja(t,"cuechange"),n.o.remove(0,1/0)),i&&Rd(n,i));Qd(n),th(n)}}}()},i.Ef=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&&Qi(r)){var a=i.l.o;i.g.abr.enabled&&(a.video!=r.video||a.audio&&r.audio&&a.audio.language==r.audio.language&&a.audio.channelsCount==r.audio.channelsCount&&a.audio.label==r.audio.label)&&q("Changing tracks while abr manager is enabled will likely result in the selected track being overridden. Consider disabling abr before calling selectVariantTrack()."),i.ua()?zd(i,r,!1,!1,0):zd(i,r,!1,t||!1,n||0),i.M.configure({language:r.language,role:r.audio&&r.audio.roles&&r.audio.roles[0]||"",channelCount:r.audio&&r.audio.channelsCount?r.audio.channelsCount:0,Ec:r.video&&r.video.hdr?r.video.hdr:"",spatialAudio:!(!r.audio||!r.audio.spatialAudio)&&r.audio.spatialAudio,videoLayout:r.video&&r.video.videoLayout?r.video.videoLayout:"",Jc:r.audio&&r.audio.label?r.audio.label:"",Ed:"",codecSwitchingStrategy:i.g.mediaSource.codecSwitchingStrategy,audioCodec:r.audio&&r.audio.codecs?r.audio.codecs:"",Gd:a.audio&&a.audio.codecs?a.audio.codecs:"",Fe:a.audio&&a.audio.channelsCount?a.audio.channelsCount:0,preferredAudioCodecs:i.g.preferredAudioCodecs,preferredAudioChannelCount:i.g.preferredAudioChannelCount}),Kd(i)}}(),!this.ua())||function(){if(e.originalAudioId&&i.h&&i.h.audioTracks)for(var t=Array.from(i.h.audioTracks),n=(t=l(t)).next();!n.done;n=t.next())if(Yi(n=n.value)==e.id){qd(i,n);break}}()},i.Ok=function(e,t){var n,i=this;t=void 0===t?0:t,this.i&&this.F&&((n=i.M.getConfiguration()).audioCodec=e.codecs||"",n.Jc=e.label||"",n.channelCount=e.channelsCount||0,n.language=e.language,n.role=e.roles[0]||"",n.spatialAudio=e.spatialAudio,i.M.configure(n),Gd(i,!0,t,!1,!1),!this.ua())||function(){if(i.h&&i.h.audioTracks){for(var t=Di(e.language),n=Array.from(i.h.audioTracks),r=null,a=(n=l(n)).next();!a.done;a=n.next()){var o=(a=a.value).language||"und";if(a.label==e.label&&Di(o)==t&&a.kind==e.roles[0]){r=a;break}}r&&qd(i,r)}}()},i.getAudioTracks=function(){if(this.i&&!this.ua()){var e=this.Qb();if(!e.length)return[];var t=e.find((function(e){return e.active}));if(!t)return[];var n=e;if(this.m!=ph||this.ua()||(n=e.filter((function(e){return e.originalVideoId===t.originalVideoId&&e.audioCodec}))),!n.length)return[];e=new Map;for(var i=(n=l(n)).next();!i.done;i=n.next()){var r=(i=i.value).originalAudioId;r||null==i.audioId||(r=String(i.audioId)),r&&e.set(r,{active:i.active,language:i.language,label:i.label,mimeType:i.audioMimeType,codecs:i.audioCodec,primary:i.primary,roles:i.audioRoles||[],accessibilityPurpose:i.accessibilityPurpose,channelsCount:i.channelsCount,audioSamplingRate:i.audioSamplingRate,spatialAudio:i.spatialAudio,originalLanguage:i.originalLanguage})}return Array.from(e.values())}return this.h&&this.h.audioTracks?Array.from(this.h.audioTracks).map((function(e){var t=e.language;return t={active:e.enabled,language:Di(t||"und"),label:e.label,mimeType:null,codecs:null,primary:"main"==e.kind,roles:[],accessibilityPurpose:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,originalLanguage:t},e.kind&&t.roles.push(e.kind),e.configuration&&(e.configuration.codec&&(t.codecs=e.configuration.codec),e.configuration.sampleRate&&(t.audioSamplingRate=e.configuration.sampleRate),e.configuration.numberOfChannels&&(t.channelsCount=e.configuration.numberOfChannels)),t})):[]},i.Qk=function(e,t,n){t=void 0!==t&&t,n=void 0===n?0:n;var i=this.Qb();if(i.length){var r=i.find((function(e){return e.active}));r&&(i=i.find((function(t){return t.audioId===r.audioId&&(t.videoBandwidth||t.bandwidth)==e.bandwidth&&t.width==e.width&&t.height==e.height&&t.frameRate==e.frameRate&&t.pixelAspectRatio==e.pixelAspectRatio&&t.hdr==e.hdr&&t.colorGamut==e.colorGamut&&t.videoLayout==e.videoLayout&&t.videoMimeType==e.mimeType&&t.videoCodec==e.codecs})))&&!i.active&&this.Ef(i,t,n)}},i.getVideoTracks=function(){if(this.m==fh||this.ua())return[];var e=this.Qb();if(!e.length)return[];var t=e.find((function(e){return e.active}));if(!t)return[];var n=e.filter((function(e){return e.originalAudioId===t.originalAudioId&&e.audioId===t.audioId&&e.audioGroupId===t.audioGroupId&&e.videoCodec}));if(!n.length)return[];e=new Map;for(var i=(n=l(n)).next();!i.done;i=n.next()){var r=(i=i.value).originalVideoId;r||null==i.videoId||(r=String(i.videoId)),r&&e.set(r,{active:i.active,bandwidth:i.videoBandwidth||i.bandwidth,width:i.width,height:i.height,frameRate:i.frameRate,pixelAspectRatio:i.pixelAspectRatio,hdr:i.hdr,colorGamut:i.colorGamut,videoLayout:i.videoLayout,mimeType:i.videoMimeType,codecs:i.videoCodec})}return Array.from(e.values())},i.sj=function(){return ch(this.Qb())},i.Rj=function(){return ch(this.Dc())},i.rj=function(){return Array.from(lh(this.Qb()))},i.Qj=function(){return Array.from(lh(this.Dc()))},i.Hi=function(e,t,n,i,r,a,o){var s=this;n=void 0===n?0:n,i=void 0===i?0:i,r=void 0===r?"":r,a=void 0!==a&&a,o=void 0===o?"":o,this.i&&this.F&&(function(){function u(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}var c=s.l.o;s.M=s.g.adaptationSetCriteriaFactory(),s.M.configure({language:e,role:t||"",channelCount:n||0,Ec:"",spatialAudio:a||!1,videoLayout:"",Jc:o||"",Ed:"",codecSwitchingStrategy:s.g.mediaSource.codecSwitchingStrategy,audioCodec:r||"",Gd:c.audio&&c.audio.codecs?c.audio.codecs:"",Fe:c.audio&&c.audio.channelsCount?c.audio.channelsCount:0,preferredAudioCodecs:s.g.preferredAudioCodecs,preferredAudioChannelCount:s.g.preferredAudioChannelCount});for(var d=s.M.create(s.i.variants),h=null,p=(d=l(d.values())).next();!p.done;p=d.next())Qi(p=p.value)&&(!h||u(h,c)>u(p,c))&&(h=p);h!=c&&(h?(c=qi(h),s.Ef(c,!0,i||0)):Gd(s))}(),!this.ua())||function(){if(s.h&&s.h.audioTracks){var n=er(s.Qb(),e,t||"",!1)[0];n&&s.Ef(n)}}()},i.ih=function(e,t,n){var i,r=this;n=void 0!==n&&n,this.i&&this.F&&(function(){r.xd=e,r.se=t||"",r.re=n||!1;var i=er(r.i.textStreams,r.xd,r.se,r.re)[0]||null;i&&i!=r.l.A&&(Ql(r.A.h,i,!1),r.g.streaming.alwaysStreamText||r.Ng())&&(ul(r.l,i),Qd(r),th(r))}(),!this.ua())||(i=er(r.Dc(),e,t||"",n||!1)[0])&&r.jh(i)},i.Pk=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.M=i.g.adaptationSetCriteriaFactory(),i.M.configure({language:r.language,role:"",channelCount:0,Ec:"",spatialAudio:!1,videoLayout:"",Ed:"",Jc:e,codecSwitchingStrategy:i.g.mediaSource.codecSwitchingStrategy,audioCodec:"",Gd:"",Fe:0,preferredAudioCodecs:i.g.preferredAudioCodecs,preferredAudioChannelCount:i.g.preferredAudioChannelCount}),Gd(i,t,n))}(),!this.ua())||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&&qd(i,n)}}()},i.Ng=function(){var e=this.ba;return this.o?this.o.isTextVisible():e},i.wj=function(){return this.eb.map((function(e){return Xi(e)}))},i.uj=function(e){if(oe("getChapters","Please use an getChaptersAsync."),!this.eb.length)return[];var t=Di(e);if(!(e=this.eb.filter((function(e){return Di(e.language)==t}))).length)return[];for(var n=[],i=new Set,r=(e=l(e)).next();!r.done;r=e.next())(r=r.value).segmentIndex&&r.segmentIndex.Eb((function(e){var t=e.O()[0],r=e.startTime+"-"+e.endTime+"-"+t;e={id:r,title:t,startTime:e.startTime,endTime:e.endTime},i.has(r)||(n.push(e),i.add(r))}));return n},i.vj=function(e){var t,n,i,r,a,o,s,u=this;return R((function(c){switch(c.g){case 1:if(!u.eb.length)return c.return([]);if(t=Di(e),!(n=u.eb.filter((function(e){return Di(e.language)==t}))).length)return c.return([]);i=[],r=new Set,a=l(n),o=a.next();case 2:if(o.done){c.u(4);break}if((s=o.value).segmentIndex){c.u(5);break}return w(c,s.createSegmentIndex(),5);case 5:s.segmentIndex.Eb((function(e){var t=e.O()[0],n=e.startTime+"-"+e.endTime+"-"+t;e={id:n,title:t,startTime:e.startTime,endTime:e.endTime},r.has(n)||(i.push(e),r.add(n))})),o=a.next(),c.u(2);break;case 4:return c.return(i)}}))},i.oh=function(e){e=!!e,this.ba!=e&&(this.ba=e,this.m==ph?(this.o.setTextVisibility(e),this.g.streaming.alwaysStreamText||(e?this.l.A||0<(e=er(this.i.textStreams,this.xd,this.se,this.re)).length&&(ul(this.l,e[0]),Qd(this),th(this)):function(e){var t=e.h.get(rt);t&&(Al(t),kl(t).catch((function(){})),e.F=e.h.get(rt),e.h.delete(rt),t.stream&&t.stream.closeSegmentIndex&&t.stream.closeSegmentIndex()),e.A=null}(this.l))):this.h&&this.h.src&&this.h.textTracks&&this.o.setTextVisibility(e),Zd(this))},i.Kj=function(){if(this.F)var e=this.F.De();else{if(null==this.N)return new Date;if(this.N instanceof Date)return this.N;e=this.N}if(this.i&&!this.ua()){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.Gg=function(){if(this.i&&!this.ua()){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.We=function(){return this.V()&&this.i?this.i.presentationTimeline.We():null},i.Nb=function(){if(this.m==ph)return this.G.Nb();var e={total:[],audio:[],video:[],text:[]};return this.m==fh&&(e.total=Yo(this.h.buffered)),e},i.Ue=function(){if(!this.h||!this.h.currentTime)return null;var e=this.Gg().getTime()+1e3*this.h.currentTime;return Math.floor(Date.now()-e)},i.getStats=function(){if(this.m!=ph&&this.m!=fh)return{width:NaN,height:NaN,currentCodecs:"",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:[]};Fd(this);var e=this.h,t=e.currentTime/e.duration;if(isNaN(t)||this.V()||function(e,t){e.i=isNaN(e.i)?t:Math.max(e.i,t)}(this.A,Math.round(100*t)),this.F&&(this.A.S=this.F.Dh(),this.A.U=this.F.Eh()),e.getVideoPlaybackQuality&&(t=e.getVideoPlaybackQuality(),function(e,t,n){e.P=t,e.N=n}(this.A,Number(t.droppedVideoFrames),Number(t.totalVideoFrames)),this.A.M=Number(t.corruptedVideoFrames)),this.A.o=this.C?function(e){return e.I?e.I:NaN}(this.C):NaN,ec(this.A,e.videoWidth||NaN,e.videoHeight||NaN),this.A.l="",this.V()&&null!=this.Gg()&&(e=this.Ue()||0,this.A.C=e/1e3),t=this.Qb().find((function(e){return e.active})),e=this.Dc().find((function(e){return e.active})),t){if(t.bandwidth){var n=this.K?this.K.i:1,i=n*t.bandwidth;e&&e.bandwidth&&(i+=n*e.bandwidth),this.A.A=i}t.width&&t.height&&ec(this.A,t.width||NaN,t.height||NaN),t=t.codecs,e&&(t+=","+(e.codecs||e.mimeType)),t&&(this.A.l=t)}return this.m!=ph||this.ua()||(this.i&&(this.A.H=this.i.periodCount,this.A.G=this.i.gapCount,this.i.presentationTimeline&&(this.A.K=this.i.presentationTimeline.h)),e=this.s.getBandwidthEstimate(),this.A.s=e),this.m==fh&&tc(this.A,NaN),function(e){for(var t=e.W,n=e.B,i=e.l,r=e.A,a=e.N,o=e.P,s=e.M,u=e.U,c=e.S,d=e.s,h=e.i,p=e.F,f=e.I,g=e.m,m=Jl(e.g,"playing"),v=Jl(e.g,"paused"),y=Jl(e.g,"buffering"),b=e.o,w=e.C,T=e.K,x=e.gi,S=e.j,A=e.L,k=e.H,E=e.G,I=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}(e.g),C=[],M=(e=l(e.h.g)).next();!M.done;M=e.next())M=M.value,C.push({timestamp:M.timestamp,id:M.id,type:M.type,fromAdaptation:M.fromAdaptation,bandwidth:M.bandwidth});return{width:t,height:n,currentCodecs:i,streamBandwidth:r,decodedFrames:a,droppedFrames:o,corruptedFrames:s,stallsDetected:u,gapsJumped:c,estimatedBandwidth:d,completionPercent:h,loadLatency:p,manifestTimeSeconds:f,drmTimeSeconds:g,playTime:m,pauseTime:v,bufferingTime:y,licenseTime:b,liveLatency:w,maxSegmentDuration:T,manifestSizeBytes:x,bytesDownloaded:S,nonFatalErrorCount:A,manifestPeriodCount:k,manifestGapCount:E,stateHistory:I,switchHistory:C}}(this.A)},i.Hd=function(e,t,n,i,r,a,o){o=void 0!==o&&o;var s,u,l,c,d,h,p,f,g,m,v=this;return R((function(y){switch(y.g){case 1:if(v.m!=ph&&v.m!=fh)throw new Ne(1,7,7004);if("subtitles"!=n&&"captions"!=n&&q("Using a kind value different of `subtitles` or `captions` can cause unwanted issues."),i){y.u(2);break}return w(y,Nd(v,e),3);case 3:i=y.h;case 2:if(s=[],v.B&&(s=v.B.getCuePoints()),v.m!=fh){y.u(4);break}return u=te(),o&&"WEBKIT"===u.Da()&&(n="forced"),w(y,function(e,t,n,i,r,a,o){var s,u,l,c;return R((function(d){if(1==d.g)return"text/vtt"!=r||o.length?w(d,Od(e,t,e.I,e.g.streaming.retryParameters),3):d.u(2);2!=d.g&&(s=d.h,u=jd(e,s,r,o),l=new Blob([u],{type:"text/vtt"}),t=nu(l),r="text/vtt"),c=document.createElement("track");var h=e.L,p=t;try{if(h.g.enabled){var f=Vc(h);f.ot="c",f.su=!0;var g=zc(p,Gc(f))}else g=p}catch(e){X("CMCD_TEXT_TRACK_ERROR","Could not generate text track CMCD data.",e),g=p}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),e.Xf.push(c),d.return(c)}))}(v,e,t,n,i,a||"",s),5);case 5:if((l=y.h).track)return Wd(v),y.return(Ji(l.track));throw new Ne(1,2,2012);case 4:if(c=at,d=v.Sa(),h=d.end-d.start,v.i&&(h=v.i.presentationTimeline.getDuration()),1/0==h)throw new Ne(1,4,4033);if(!s.length){y.u(6);break}return w(y,Od(v,e,v.I,v.g.streaming.retryParameters),7);case 7:p=y.h,f=jd(v,p,i,s),g=new Blob([f],{type:"text/vtt"}),e=nu(g),i="text/vtt";case 6:if(m={id:v.ve++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:Ru(0,h,[e]),mimeType:i||"",codecs:r||"",kind:n,encrypted:!1,drmInfos:[],keyIds:new Set,language:t,originalLanguage:t,label:a||null,type:c.Ta,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!!o,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([ni(i||"",r||"")]),isAudioMuxedInVideo:!1,baseOriginalId:null},!mi(ni(m.mimeType,m.codecs)))throw new Ne(2,2,2014,i);return v.i.textStreams.push(m),Wd(v),y.return(Xi(m))}}))},i.He=function(e,t){var n,i,r,a,o,s,u,c,d,h,p,f,g,m,v,y,b,T,x=this;return R((function(S){switch(S.g){case 1:if(x.m!=ph&&x.m!=fh)throw new Ne(1,7,7004);if(t){S.u(2);break}return w(S,Nd(x,e),3);case 3:t=S.h;case 2:if("text/vtt"!=t)throw new Ne(1,2,2017,e);if(n=at,i=x.Sa(),r=i.end-i.start,x.i&&(r=x.i.presentationTimeline.getDuration()),1/0==r)throw new Ne(1,4,4045);return w(S,Od(x,e,x.I,x.g.streaming.retryParameters),4);case 4:if(a=S.h,!(o=gi(t)))throw new Ne(2,2,2014,t);for(s=o(),u={periodStart:0,segmentStart:0,segmentEnd:r,vttOffset:0},c=De(a),d=s.parseMedia(c,u,e,[]),h=[],p=l(d),f=p.next(),g={};!f.done;g={Qf:void 0,jd:void 0},f=p.next())g.jd=f.value,g.Qf=null,m=function(t){return function(){return null==t.Qf&&(t.Qf=Qe([e],[t.jd.payload])),t.Qf||[]}}(g),v=new Vo(g.jd.startTime,g.jd.endTime,m,0,null,null,0,0,1/0),g.jd.payload.includes("#xywh")&&4===(y=g.jd.payload.split("#xywh=")[1].split(",")).length&&v.Hf({height:parseInt(y[3],10),positionX:parseInt(y[0],10),positionY:parseInt(y[1],10),width:parseInt(y[2],10)}),h.push(v);if(b=t,!h.length){S.u(5);break}return w(S,gc(h[0].O()[0],x.I,x.g.manifest.retryParameters),6);case 6:b=S.h;case 5:return T={id:x.ve++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new Du(h),mimeType:b||"",codecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:n.Tf,primary:!1,trickModeVideo:null,dependencyStream: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([ni(b||"","")]),isAudioMuxedInVideo:!1,baseOriginalId:null},x.m==fh?x.Ae.push(T):x.i.imageStreams.push(T),Wd(x),S.return(Wi(T))}}))},i.Ge=function(e,t,n){var i,r,a,o,s,u,c,d,h,p,f,g,m,v,y,b=this;return R((function(T){switch(T.g){case 1:if(b.m!=ph&&b.m!=fh)throw new Ne(1,7,7004);if(n){T.u(2);break}return w(T,Nd(b,e),3);case 3:n=T.h;case 2:if(i=at,r=b.Sa(),a=r.end-r.start,b.i&&(a=b.i.presentationTimeline.getDuration()),1/0==a)throw new Ne(1,4,4054);return w(T,Od(b,e,b.I,b.g.streaming.retryParameters),4);case 4:if(o=T.h,!(s=gi(n)))throw new Ne(2,2,2014,n);for(u=s(),c={periodStart:0,segmentStart:0,segmentEnd:a,vttOffset:0},d=De(o),h=u.parseMedia(d,c,e,[]),p=[],f=l(h),g=f.next(),m={};!g.done;m={Qe:void 0},g=f.next())m.Qe=g.value,v=new Vo(m.Qe.startTime,m.Qe.endTime,function(e){return function(){return[e.Qe.payload]}}(m),0,null,null,0,0,1/0),p.push(v);return y={id:b.ve++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new Du(p),mimeType:"text/plain",codecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:t,originalLanguage:t,label:null,type:i.Ta,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([ni("text/plain","")]),isAudioMuxedInVideo:!1,baseOriginalId:null},b.eb.push(y),Wd(b),T.return(Xi(y))}}))},i.Vk=function(e,t){this.wa.width=e,this.wa.height=t},i.eh=function(e){if(this.m==ph){var t=this.l;if(e=void 0===e?.1:e,t.l.g)t=!1;else if(t.B)t=!1;else{for(var n=l(t.h.values()),i=n.next();!i.done;i=n.next())!(i=i.value).Sd||i.Qa||i.zb||(i.Sd=!1,Sl(t,i,e));t=!0}}else t=!1;return t},i.Fg=function(){return q("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.Gj=function(){return this.qc},i.Aj=function(){var e={video:null,audio:null,text:null};if(this.m!=ph)return e;for(var t=this.l.o,n=this.h.currentTime,i=(t=l([t.video,t.audio,this.l.A])).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==rt&&(e.text=r)}return e},i.Oi=function(e){this.we=e},i.disableStream=function(e,t){if(!this.g.abr.enabled||this.m===dh||!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.xe.Fa(1),t=this.Nb().video.reduce((function(e,t){return e+t.end-t.start}),0),Gd(this,!1,t,!0,!1),0))}return!1},i.addFont=function(t,n){return function(t,n){var i,r,a,o,s;return R((function(u){if(1==u.g)return"fonts"in document&&"FontFace"in e?w(u,document.fonts.ready,2):u.return();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)}))}(t,n)},i.ua=function(){return!(!this.h||!this.h.remote)&&"disconnected"!=this.h.remote.state},i.Wd=function(){return!(this.h&&!this.h.ended)||this.Oa&&!this.V()&&this.h.currentTime>=this.Sa().end},F("shaka.Player",ld),ld.prototype.isEnded=ld.prototype.Wd,ld.prototype.isRemotePlayback=ld.prototype.ua,ld.prototype.addFont=ld.prototype.addFont,ld.prototype.setVideoContainer=ld.prototype.Oi,ld.prototype.getFetchedPlaybackInfo=ld.prototype.Aj,ld.prototype.getManifestParserFactory=ld.prototype.Gj,ld.prototype.getManifest=ld.prototype.Fg,ld.prototype.retryStreaming=ld.prototype.eh,ld.prototype.setMaxHardwareResolution=ld.prototype.Vk,ld.prototype.addChaptersTrack=ld.prototype.Ge,ld.prototype.addThumbnailsTrack=ld.prototype.He,ld.prototype.addTextTrackAsync=ld.prototype.Hd,ld.prototype.getStats=ld.prototype.getStats,ld.prototype.getBufferedInfo=ld.prototype.Nb,ld.prototype.getSegmentAvailabilityDuration=ld.prototype.We,ld.prototype.getPresentationStartTimeAsDate=ld.prototype.Gg,ld.prototype.getPlayheadTimeAsDate=ld.prototype.Kj,ld.prototype.setTextTrackVisibility=ld.prototype.oh,ld.prototype.getChaptersAsync=ld.prototype.vj,ld.prototype.getChapters=ld.prototype.uj,ld.prototype.getChaptersTracks=ld.prototype.wj,ld.prototype.isTextTrackVisible=ld.prototype.Ng,ld.prototype.selectVariantsByLabel=ld.prototype.Pk,ld.prototype.selectTextLanguage=ld.prototype.ih,ld.prototype.selectAudioLanguage=ld.prototype.Hi,ld.prototype.getTextLanguages=ld.prototype.Qj,ld.prototype.getAudioLanguages=ld.prototype.rj,ld.prototype.getTextLanguagesAndRoles=ld.prototype.Rj,ld.prototype.getAudioLanguagesAndRoles=ld.prototype.sj,ld.prototype.getVideoTracks=ld.prototype.getVideoTracks,ld.prototype.selectVideoTrack=ld.prototype.Qk,ld.prototype.getAudioTracks=ld.prototype.getAudioTracks,ld.prototype.selectAudioTrack=ld.prototype.Ok,ld.prototype.selectVariantTrack=ld.prototype.Ef,ld.prototype.selectTextTrack=ld.prototype.jh,ld.prototype.getThumbnails=ld.prototype.Tj,ld.prototype.getAllThumbnails=ld.prototype.qj,ld.prototype.getImageTracks=ld.prototype.Cj,ld.prototype.getTextTracks=ld.prototype.Dc,ld.prototype.getVariantTracks=ld.prototype.Qb,ld.prototype.cancelTrickPlay=ld.prototype.Id,ld.prototype.trickPlay=ld.prototype.ke,ld.prototype.useTrickPlayTrackIfAvailable=ld.prototype.Ch,ld.prototype.getPlaybackRate=ld.prototype.ub,ld.prototype.isBuffering=ld.prototype.Mg,ld.prototype.getKeyStatuses=ld.prototype.Te,ld.prototype.getActiveSessionsMetadata=ld.prototype.Eg,ld.prototype.getExpiration=ld.prototype.Pd,ld.prototype.drmInfo=ld.prototype.drmInfo,ld.prototype.keySystem=ld.prototype.keySystem,ld.prototype.isFullyLoaded=ld.prototype.dk,ld.prototype.goToLive=ld.prototype.Zj,ld.prototype.seekRange=ld.prototype.Sa,ld.prototype.isVideoOnly=ld.prototype.jk,ld.prototype.isAudioOnly=ld.prototype.ck,ld.prototype.isInProgress=ld.prototype.Tc,ld.prototype.isLive=ld.prototype.V,ld.prototype.getQueueManager=ld.prototype.$h,ld.prototype.getAdManager=ld.prototype.Uh,ld.prototype.getAssetUri=ld.prototype.nd,ld.prototype.getNetworkingEngine=ld.prototype.Pb,ld.prototype.getMediaElement=ld.prototype.Jj,ld.prototype.getManifestType=ld.prototype.Xh,ld.prototype.getLoadMode=ld.prototype.Fj,ld.prototype.resetConfiguration=ld.prototype.Ci,ld.prototype.getBufferFullness=ld.prototype.Vh,ld.prototype.getNonDefaultConfiguration=ld.prototype.Zh,ld.prototype.getConfigurationForLowLatency=ld.prototype.xj,ld.prototype.getConfiguration=ld.prototype.getConfiguration,ld.prototype.configurationForLowLatency=ld.prototype.nj,ld.prototype.configure=ld.prototype.configure,ld.prototype.releaseAllMutexes=ld.prototype.Gk,ld.prototype.destroyAllPreloads=ld.prototype.ng,ld.prototype.preload=ld.prototype.preload,ld.prototype.detachAndSavePreload=ld.prototype.Qh,ld.prototype.unloadAndSavePreload=ld.prototype.Yk,ld.prototype.load=ld.prototype.load,ld.prototype.updateStartTime=ld.prototype.cl,ld.prototype.unload=ld.prototype.vc,ld.prototype.detach=ld.prototype.detach,ld.prototype.attachCanvas=ld.prototype.fj,ld.prototype.attach=ld.prototype.fc,ld.probeSupport=function(t){var n,i,r,a,o;return t=void 0===t||t,R((function(s){switch(s.g){case 1:if(n={},!t){s.u(2);break}return w(s,function(){var t,n,i,r,a,o,s,u,c,d,h,p,f,g,m,v,y,b,S,E,I,C,M,D,P,L,N,O,j,U,_,B,F,V;return R((function(H){if(1==H.g){if(t="org.w3.clearkey com.widevine.alpha com.widevine.alpha.experiment com.microsoft.playready com.microsoft.playready.hardware com.microsoft.playready.recommendation com.microsoft.playready.recommendation.3000 com.microsoft.playready.recommendation.3000.clearlead com.chromecast.playready com.apple.fps.1_0 com.apple.fps com.huawei.wiseplay".split(" "),!(e.MediaKeys&&e.navigator&&e.navigator.requestMediaKeySystemAccess&&e.MediaKeySystemAccess&&e.MediaKeySystemAccess.prototype.getConfiguration)){for(n={},i=l(t),r=i.next();!r.done;r=i.next())a=r.value,n[a]=null;return H.return(n)}for(o="1.0 1.1 1.2 1.3 1.4 2.0 2.1 2.2 2.3".split(" "),u={"com.widevine.alpha":s=["SW_SECURE_CRYPTO","SW_SECURE_DECODE","HW_SECURE_CRYPTO","HW_SECURE_DECODE","HW_SECURE_ALL"],"com.widevine.alpha.experiment":s,"com.microsoft.playready.recommendation":["150","2000","3000"]},h={videoCapabilities:c=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],audioCapabilities:d=[{contentType:'audio/mp4; codecs="mp4a.40.2"'},{contentType:'audio/webm; codecs="opus"'}],initDataTypes:["cenc","sinf","skd","keyids"]},p=[null,"cenc","cbcs"],f=new Map,g=te(),m=function(e,t){var n,i,r,a,s,u,c,d,h,p,m,v,y;return R((function(b){switch(b.g){case 1:return x(b,2),w(b,t.createMediaKeys(),5);case 5:n=b.h;case 4:A(b,3);break;case 2:return k(b),b.return();case 3:if(r=!!(i=t.getConfiguration().sessionTypes)&&i.includes("persistent-license"),g.mi()&&(r=!1),a=t.getConfiguration().videoCapabilities,s=t.getConfiguration().audioCapabilities,u={persistentState:r,encryptionSchemes:[],videoRobustnessLevels:[],audioRobustnessLevels:[],minHdcpVersions:[]},f.has(e)&&f.get(e)?u=f.get(e):f.set(e,u),(c=a[0].encryptionScheme)&&!u.encryptionSchemes.includes(c)&&u.encryptionSchemes.push(c),(d=a[0].robustness)&&!u.videoRobustnessLevels.includes(d)&&u.videoRobustnessLevels.push(d),(h=s[0].robustness)&&!u.audioRobustnessLevels.includes(h)&&u.audioRobustnessLevels.push(h),"getStatusForPolicy"in n){for(p=[],m=l(o),v=m.next(),y={};!v.done;y={Td:void 0},v=m.next())y.Td=v.value,u.minHdcpVersions.includes(y.Td)||p.push(n.getStatusForPolicy({minHdcpVersion:y.Td}).then(function(e){return function(t){"usable"!=t||u.minHdcpVersions.includes(e.Td)||u.minHdcpVersions.push(e.Td)}}(y)));return w(b,Promise.all(p),0)}b.u(0)}}))},v=function(e,t,n,i){var r,a,o,s,u,c,d,p,f,g;return R((function(v){switch(v.g){case 1:for(x(v,2),r=Bt(h),a=l(r.videoCapabilities),o=a.next();!o.done;o=a.next())(s=o.value).encryptionScheme=t,s.robustness=n;for(u=l(r.audioCapabilities),c=u.next();!c.done;c=u.next())(d=c.value).encryptionScheme=t,d.robustness=i;return(p=Bt(r)).persistentState="required",p.sessionTypes=["persistent-license"],f=[p,r],"MOBILE"==te().La()?w(v,ki(5,navigator.requestMediaKeySystemAccess(e,f)),7):w(v,navigator.requestMediaKeySystemAccess(e,f),6);case 6:g=v.h,v.u(5);break;case 7:g=v.h;case 5:return w(v,m(e,g),8);case 8:A(v,0);break;case 2:k(v),T(v)}}))},y=function(e,t,n,i){var r,a,o;return R((function(s){switch(s.g){case 1:return x(s,2),r={type:"media-source",video:{contentType:c[0].contentType,width:640,height:480,bitrate:1,framerate:1},audio:{contentType:d[0].contentType,channels:2,bitrate:1,samplerate:1},keySystemConfiguration:{keySystem:e,video:{encryptionScheme:t,robustness:n},audio:{encryptionScheme:t,robustness:i}}},"MOBILE"==te().La()?w(s,ki(5,navigator.mediaCapabilities.decodingInfo(r)),7):w(s,navigator.mediaCapabilities.decodingInfo(r),6);case 6:a=s.h,s.u(5);break;case 7:a=s.h;case 5:return o=a.keySystemAccess,w(s,m(e,o),8);case 8:A(s,0);break;case 2:k(s),T(s)}}))},b=l(t),S=b.next();!S.done;S=b.next())E=S.value,f.set(E,null);for(I=function(e){return"WEBKIT"!==te().Da()||"org.w3.clearkey"!==e},C=[],M=l(p),D=M.next();!D.done;D=M.next())for(P=D.value,L=l(t),N=L.next();!N.done;N=L.next())O=N.value,I(O)&&(C.push(v(O,P,"","")),C.push(y(O,P,"","")));for(j=l(t),U=j.next();!U.done;U=j.next())for(_=U.value,B=l(u[_]||[]),F=B.next();!F.done;F=B.next())V=F.value,I(_)&&(C.push(v(_,null,V,"")),C.push(v(_,null,"",V)),C.push(y(_,null,V,"")),C.push(y(_,null,"",V)));return w(H,Promise.all(C),2)}return H.return($r(f))}))}(),3);case 3:n=s.h;case 2:return i=function(){var e={};if(te(),ev())for(var t=l(Za.keys()),n=t.next();!n.done;n=t.next())e[n.value]=!0;for(n=(t=l(["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"])).next();!n.done;n=t.next())e[n=n.value]=ev()?Za.has(n):""!=es().canPlayType(n);return e}(),r=function(){var e='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",audio/mp4; codecs="apac.31.00",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(hi)),t={};te();for(var n=(e=l(e)).next();!n.done;n=e.next()){mi(n=n.value)?t[n]=!0:t[n]=ev()?ht(n)||!!Yn(n):""!=es().canPlayType(n);var i=n.split(";")[0];t[i]=t[i]||t[n]}return t}(),w(s,te().ic(),4);case 4:return a=s.h,o={manifest:i,media:r,drm:n,hardwareResolution:a},mh.forEach((function(e,t){o[t]=e()})),s.return(o)}}))},ld.isBrowserSupported=function(){return e.Promise||q("A Promise implementation or polyfill is required"),!(!(e.Promise&&e.Uint8Array&&Array.prototype.forEach)||(navigator.userAgent||"").includes("Trident/")||(te(),!ev()&&""==es().canPlayType("application/x-mpegurl")))},ld.setQueueManagerFactory=function(e){yh=e},ld.setAdManagerFactory=function(e){vh=e},ld.registerSupportPlugin=hd,ld.prototype.destroy=ld.prototype.destroy;var dh=0,hh=1,ph=2,fh=3;ld.LoadMode={DESTROYED:dh,NOT_LOADED:hh,MEDIA_SOURCE:ph,SRC_EQUALS:fh},ld.version="v4.15.8";var gh=["4","15"];le=new function(e){this.g=e,this.i=se,this.h=ue}(new ae(Number(gh[0]),Number(gh[1])));var mh=new Map,vh=null,yh=null;function bh(){this.g=[],this.i=this.m=this.l=this.j=this.h=0}function wh(e){return e.g.length?e.g.reduce((function(e,t){return e+t}),0)/e.g.length:0}function Th(e,t,n){var i=this;this.g=e,this.h=t,this.m=n,this.i=!1,this.j=this.h.getVolume(),this.l=new $,this.l.D(this.h,google.ima.AdEvent.Type.PAUSED,(function(){i.i=!0})),this.l.D(this.h,google.ima.AdEvent.Type.RESUMED,(function(){i.i=!1}))}function xh(){}function Sh(e,t){for(var n=[],i=(e=l(Xt(e,"Ad"))).next();!i.done;i=e.next())if((i=$t(i.value,"InLine"))&&(i=$t(i,"Creatives")))for(var r=(i=l(Xt(i,"Creative"))).next();!r.done;r=i.next()){var a=$t(r=r.value,"Linear");if(a&&Ah(n,t,a),r=$t(r,"NonLinearAds"))for(var o=(r=l(r=Xt(r,"NonLinear"))).next();!o.done;o=r.next())e:{a=n;var s=t,u=o.value,c=$t(u,"StaticResource");if(c)o=c.attributes.creativeType;else{if(!(c=$t(u,"HTMLResource")))break e;o="text/html"}if(c=Yt(c)){"text/html"===o&&(c="data:text/html;charset=UTF-8,"+encodeURIComponent(c));var d=Zt(u,"width",sn)||Zt(u,"expandedWidth",sn),h=Zt(u,"height",sn)||Zt(u,"expandedHeight",sn);if(d||h){var p=null;(u=u.attributes.minSuggestedDuration)&&(p=jt(u)),u=0,null!=s&&(u=s),a.push({id:null,groupId:null,startTime:u,endTime:null,uri:c,mimeType:o,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!1,resumeOffset:0,playoutLimit:p,once:!0,pre:null==s,post:1/0==s,timelineRange:!1,loop:!1,overlay:{viewport:{x:0,y:0},topLeft:{x:0,y:0},size:{x:d||0,y:h||0}},displayOnBackground:!1,currentVideo:null,background:null})}}}}return n}function Ah(e,t,n){var i=0;null!=t&&(i=t);var r=null;if(n.attributes.skipoffset&&(r=jt(n.attributes.skipoffset),isNaN(r)&&(r=null)),n=$t(n,"MediaFiles")){var a=Xt(n,"MediaFile");for(n=a,(a=a.filter((function(e){return"streaming"==e.attributes.delivery}))).length&&(n=a),n=n.sort((function(e,t){return(parseInt(t.attributes.height,10)||0)-(parseInt(e.attributes.height,10)||0)})),a=(n=l(n)).next();!a.done;a=n.next())if(!(a=a.value).attributes.apiFramework){var o=Yt(a);if(o){e.push({id:null,groupId:null,startTime:i,endTime:null,uri:o,mimeType:a.attributes.type||null,isSkippable:null!=r,skipOffset:r,skipFor:null,canJump:!1,resumeOffset:0,playoutLimit:null,once:!0,pre:null==t,post:1/0==t,timelineRange:!1,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null});break}}}}function kh(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 $,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.15.8"),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 Dr("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 Dr("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 Dr("ad-cue-points-changed",(new Map).set("cuepoints",n)))}!function(e){function t(t,n){t=(new Map).set("originalEvent",t),e.l(new Dr(n,t))}e.h.D(e.g,google.ima.AdErrorEvent.Type.AD_ERROR,(function(t){Eh(e,t)})),e.h.D(e.g,google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,(function(t){Ih(e,t)})),e.h.D(e.g,google.ima.AdEvent.Type.STARTED,(function(t){Ih(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){Ch(e,t)})),e.h.D(e.g,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,(function(t){Ch(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),t.h.D(t.i,"loadeddata",(function(){t.g.resize(t.i.offsetWidth,t.i.offsetHeight)})),"ResizeObserver"in e?(t.A=new ResizeObserver((function(){t.g.resize(t.i.offsetWidth,t.i.offsetHeight)})),t.A.observe(t.i)):t.h.D(document,"fullscreenchange",(function(){t.g.resize(t.i.offsetWidth,t.i.offsetHeight)})),t.F||t.o.skipPlayDetection?t.g.start():t.h.Aa(t.i,"play",(function(){t.F=!0,t.g.start()}))}catch(e){Ch(t,null)}}(o,t)})),this.h.D(this.m,google.ima.AdErrorEvent.Type.AD_ERROR,(function(e){Eh(o,e)})),this.h.D(this.i,"ended",(function(){o.m.contentComplete()})),this.h.Aa(this.i,"play",(function(){o.F=!0}))}function Eh(e,t){t.getError(),t=(new Map).set("originalEvent",t),e.l(new Dr("ad-error",t)),Ch(e,null),e.l(new Dr("ad-cue-points-changed",(new Map).set("cuepoints",[])))}function Ih(e,t){var n=t.getAd();n?(e.j=new Th(n,e.g,e.i),t.type!=google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED||e.o.supportsMultipleMediaElements||e.l(new Dr("ad-content-pause-requested")),t=(new Map).set("ad",e.j).set("sdkAdObject",n).set("originalEvent",t),e.l(new Dr("ad-started",t)),e.j.isLinear()&&(e.s.setAttribute("ad-active","true"),e.o.customPlayheadTracker||e.i.pause(),e.i.muted?((t=e.j).j=e.i.volume,t.h.setVolume(0)):e.j.setVolume(e.i.volume))):q("The IMA SDK fired a "+t.type+" event with no associated ad. Unable to play ad!")}function Ch(e,t){t&&t.type==google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED&&!e.o.supportsMultipleMediaElements&&e.l(new Dr("ad-content-resume-requested")),e.l(new Dr("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 Mh(e,t,n,i,r,a){this.g=e,this.i=t,this.j=(this.h=t.isSkippable)?t.skipOffset||0:t.skipOffset,this.l=t.skipFor,this.A=n,this.o=i,this.m=r,this.s=a,this.B=t.overlay}function Dh(e,t,n){this.g=e,this.j=t,this.h=n,this.i=null==e.overlay}function Ph(e,t,n,i){var r=this;this.M=null,this.B=e,this.C=t,this.g=n,this.G=null,this.A=!0,this.h=this.g,this.i=i,this.U=new Set,this.H=new Set,this.F=new Map,this.L=new Map,this.j=new ld,Fh(this),this.I=new $,this.l=new $,this.K=!1,this.ha=this.o=this.s=this.m=null,this.ka=!1,this.P=-1,this.ba=function(){if(!r.K&&r.m&&!r.C.ua()){r.m=r.g.currentTime;var e=Oh(r);e&&jh(r,e,1,1,Date.now())}},this.W=function(){if(!(r.K||r.m||r.C.ua())){r.m=r.g.currentTime;var e=Oh(r,!0);e&&jh(r,e,1,1,Date.now())}},this.na=function(){if(!r.K&&r.m&&!r.C.ua()){var e=r.g.currentTime;r.s&&!r.s.pre&&!r.s.post&&e<(r.s.endTime||r.s.startTime)&&(r.s=null)}},this.S=new Ti(this.ba),this.N=new Ti((function(){var e,t,n,i,a,o,s,u,c,d,h;return R((function(p){switch(p.g){case 1:if(!r.H.size||null==r.m){p.u(0);break}if((e=r.C.m)==dh||e==hh)return p.return();t=!1,n=Array.from(r.H),i=r.C.Sa(),a=l(n),o=a.next();case 3:if(o.done){p.u(5);break}if((s=o.value)==r.s){p.u(4);break}if(u=s.endTime||s.startTime,!(1<=i.start-u)){0<(c=s.startTime-r.m)&&10>=c&&(!r.F.has(s)&&Hh(s)&&r.F.set(s,r.j.preload(s.uri,null,s.mimeType||void 0)),Gh(r,s)),p.u(4);break}if(!r.F.has(s)){p.u(7);break}return w(p,r.F.get(s),8);case 8:(d=p.h)&&d.destroy(),r.F.delete(s);case 7:zh(r,s),h=JSON.stringify(s),r.U.has(h)&&r.U.delete(h),r.H.delete(s),Rh(r),s.overlay||(t=!0);case 4:o=a.next(),p.u(3);break;case 5:t&&Bh(r),T(p)}}))})),this.configure(this.C.getConfiguration().ads)}function Rh(e){e.ka&&!e.H.size&&(e.I.Ja(e.g,"playing",e.W),e.I.Ja(e.g,"timeupdate",e.W),e.I.Ja(e.g,"seeked",e.na),e.I.Ja(e.g,"ended",e.ba),-1!=e.P&&(e.g.cancelVideoFrameCallback(e.P),e.P=-1),e.S&&e.S.stop(),e.N&&e.N.stop(),e.ka=!1)}function Lh(e){if(e.B&&e.M&&!e.K){var t=e.M.supportsMultipleMediaElements,n=e.g;n.webkitPresentationMode&&"inline"!==n.webkitPresentationMode&&(t=!1),e.A==t&&(e.A=!t,e.A?(e.h=e.g,e.G&&(e.G.parentElement&&e.B.removeChild(e.G),e.G=null)):(e.G||((t=document.createElement(e.g.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.display="none",t.setAttribute("playsinline",""),e.G=t),e.h=e.G))}else e.A=!0}function Nh(e,t){var n,i,r,a,o,s,u,c;R((function(d){switch(d.g){case 1:n=!1,i=l(t),r=i.next();case 2:if(r.done){d.u(4);break}if(!(a=r.value).uri){q("Missing URL in interstitial",a),d.u(3);break}if(a.mimeType){d.u(5);break}return x(d,6),o=e.j.Pb(),w(d,gc(a.uri,o,e.C.getConfiguration().streaming.retryParameters),8);case 8:a.mimeType=d.h,A(d,5);break;case 6:k(d);case 5:if(s=a.id||JSON.stringify(a),e.U.has(s)){d.u(3);break}a.loop&&!a.overlay&&q("Loop is only supported in overlay interstitials",a),a.overlay||(n=!0),e.U.add(s),e.H.add(a),u=!1,a.pre&&null==e.m?u=!0:0!=a.startTime||a.canJump?null!=e.m&&0<(c=a.startTime-e.m)&&10>=c&&(u=!0):u=!0,u&&(!e.F.has(a)&&Hh(a)&&e.F.set(a,e.j.preload(a.uri,null,a.mimeType||void 0)),Gh(e,a));case 3:r=i.next(),d.u(2);break;case 4:n&&Bh(e),function(e){if(!e.ka&&e.H.size){if(e.I.D(e.g,"playing",e.W),e.I.D(e.g,"timeupdate",e.W),e.I.D(e.g,"seeked",e.na),e.I.D(e.g,"ended",e.ba),"requestVideoFrameCallback"in e.g&&!Kh()){var t=e.g,n=function(){-1!=e.P&&(e.ba(),-1!=e.P&&(e.P=t.requestVideoFrameCallback(n)))};e.P=t.requestVideoFrameCallback(n)}else e.S.Fa(.025);e.N&&e.N.Fa(1),e.ka=!0}}(e),T(d)}}))}function Oh(e,t,n){t=void 0!==t&&t,n=void 0===n?null:n;var i=0,r=null;if(e.H.size&&null!=e.m){var a=e.g.ended,o=Array.from(e.H).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.m-Math.round(1e3*s.startTime)/1e3,d=1;e.M.allowStartInMiddleOfInterstitial&&s.endTime&&1/0!=s.endTime&&(d=s.endTime-s.startTime),0<c&&(c<=d||!s.canJump)&&(u=!(null==n&&e.s&&!e.s.pre&&!e.s.post&&e.s.startTime>=s.startTime))}u&&(!e.s||s.startTime>=e.s.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 jh(e,t,n,i,r,a){a=void 0===a?0:a,e.s=t,Lh(e),e.A||!e.B||e.h.parentElement||e.B.appendChild(e.h),1==i&&1==n&&(n=Array.from(e.H).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.H.delete(t),Rh(e),t.overlay||Bh(e)),t.mimeType&&(t.mimeType.startsWith("image/")||"text/html"===t.mimeType)?t.overlay?function(e,t,n,i,r){function a(){e.o&&(e.o.stop(),e.o=null),e.B.removeChild(u),_h(e,t),e.i(new Dr("ad-stopped")),e.l.Ra();var a=Oh(e,t.pre,i-r);a?jh(e,a,n,++i,Date.now(),r):e.K=!1}e.K=!0;var o=t.overlay,s="text/html"==t.mimeType?"iframe":"img",u=document.createElement(s);u.style.objectFit="contain",u.style.position="absolute",u.style.border="none",Uh(e,t),e.i(new Dr("ad-started",(new Map).set("ad",new Dh(t,n,i)))),"iframe"==s?u.src=t.uri:(u.src=t.uri,u.onerror=function(t){e.i(new Dr("ad-error",(new Map).set("originalEvent",t))),a()});var l=o.viewport,c=o.topLeft;o=o.size,0==l.x&&0==l.y?(u.width=t.overlay.size.x,u.height=t.overlay.size.y,u.style.bottom="10%",u.style.left="0",u.style.right="0",u.style.width="100%",t.overlay.size.y||"iframe"!=s||(u.style.height="auto")):(u.style.height=o.y/l.y*100+"%",u.style.left=c.x/l.x*100+"%",u.style.top=c.y/l.y*100+"%",u.style.width=o.x/l.x*100+"%"),e.B.appendChild(u);var d=Date.now();e.o&&e.o.stop(),e.o=new Ti((function(){t.playoutLimit&&(Date.now()-d)/1e3>t.playoutLimit||t.endTime&&e.g.currentTime>t.endTime?(e.i(new Dr("ad-complete")),a()):e.g.currentTime<t.startTime&&(e.i(new Dr("ad-skipped")),a())})),t.playoutLimit&&!t.endTime?e.o.ia(t.playoutLimit):t.endTime&&e.o.Fa(.025),e.l.D(e.g,"seeked",(function(){var n=e.g.currentTime;(n<t.startTime||t.endTime&&n>t.endTime)&&(e.o&&e.o.stop(),e.i(new Dr("ad-skipped")),a())}))}(e,t,n,i,a):q("Unsupported interstitial",t):e.A&&t.overlay?q("Unsupported interstitial",t):function(e,t,n,i,r,a){var o,s,u,l,c,d,h,p,f,g,m,v,y,b,S,E,I,C,M,D;R((function(P){switch(P.g){case 1:if(o=Date.now(),e.K=!0,s=!1,u=function(){if(!e.A&&!t.overlay&&null==t.resumeOffset)if(t.timelineRange&&t.endTime&&1/0!=t.endTime)e.g.currentTime!=t.endTime&&(e.g.currentTime=t.endTime);else{var n=Date.now();e.g.currentTime+=(n-r)/1e3,r=n}},l=function(o){var s,l;return R((function(c){if(1==c.g){if(u(),s=Oh(e,t.pre,i-a),o&&t.groupId)for(;s&&s.groupId==t.groupId;)i++,s=Oh(e,t.pre,i-a);return e.o&&(!t.groupId||s&&s.groupId!=t.groupId)&&(e.o.stop(),e.o=null),_h(e,t),s&&!s.overlay?c.u(2):(t.post&&(e.m=null,e.s=null),e.A?w(c,e.j.detach(),4):w(c,e.j.vc(),4))}2!=c.g&&(e.A&&(null==(l=t.resumeOffset)&&(l=t.timelineRange&&t.endTime&&1/0!=t.endTime?t.endTime-(e.m||0):(Date.now()-r)/1e3),e.i(new Dr("ad-content-resume-requested",(new Map).set("offset",l)))),e.i(new Dr("ad-stopped")),e.l.Ra(),e.K=!1,e.A?Bh(e):(e.h.style.display="none",u(),e.g.ended||e.g.play())),Lh(e),s&&(e.i(new Dr("ad-stopped")),e.l.Ra(),jh(e,s,n,++i,r,a)),T(c)}))},c=function(t){return R((function(n){return s?n.return():(s=!0,e.i(new Dr("ad-error",(new Map).set("originalEvent",t))),w(n,l(!1),0))}))},d=function(){return R((function(t){if(1==t.g)return s?t.return():(s=!0,w(t,l(!1),2));e.i(new Dr("ad-complete")),T(t)}))},e.ha=function(){return R((function(t){return s?t.return():(s=!0,e.i(new Dr("ad-skipped")),w(t,l(!0),0))}))},h=new Mh(e.h,t,e.ha,n,i,!e.A),e.A||(h.setMuted(e.g.muted),h.setVolume(e.g.volume)),e.i(new Dr("ad-started",(new Map).set("ad",h))),(p=h.canSkipNow())&&e.i(new Dr("ad-skip-state-changed")),e.l.Aa(e.j,"error",c),e.l.D(e.h,"timeupdate",(function(){if(e.h.duration){var t=h.canSkipNow();p!=t&&0<h.getRemainingTime()&&0<h.getDuration()&&e.i(new Dr("ad-skip-state-changed")),p=t}})),e.l.Aa(e.j,"firstquartile",(function(){u(),e.i(new Dr("ad-first-quartile"))})),e.l.Aa(e.j,"midpoint",(function(){u(),e.i(new Dr("ad-midpoint"))})),e.l.Aa(e.j,"thirdquartile",(function(){u(),e.i(new Dr("ad-third-quartile"))})),e.l.Aa(e.j,"complete",d),e.l.D(e.h,"play",(function(){e.i(new Dr("ad-resumed"))})),e.l.D(e.h,"pause",(function(){var t=e.j.getConfiguration();e.h.currentTime>=t.playRangeEnd?d():e.i(new Dr("ad-paused"))})),e.l.D(e.h,"volumechange",(function(){e.h.muted?e.i(new Dr("ad-muted")):e.i(new Dr("ad-volume-changed"))})),!e.A||1!=i){P.u(2);break}return e.i(new Dr("ad-content-pause-requested",(new Map).set("saveLivePosition",!0))),f=new Sr,g=function(t){return R((function(n){if(1==n.g)return"detach"!=t.state?n.u(0):Kh()?w(n,new Promise((function(e){return new Ti(e).ia(.1)})),3):n.u(3);f.resolve(),e.l.Ja(e.C,"onstatechange",g),T(n)}))},e.l.D(e.C,"onstatechange",g),w(P,f,2);case 2:return Uh(e,t),e.A||(e.h.style.display="",t.overlay?(e.h.loop=t.loop,m=t.overlay.viewport,v=t.overlay.topLeft,y=t.overlay.size,e.h.style.height=y.y/m.y*100+"%",e.h.style.left=v.x/m.x*100+"%",e.h.style.top=v.y/m.y*100+"%",e.h.style.width=y.x/m.x*100+"%"):(e.g.pause(),null!=t.resumeOffset&&0!=t.resumeOffset&&(e.g.currentTime+=t.resumeOffset),e.h.loop=!1,e.h.style.height="100%",e.h.style.left="0",e.h.style.top="0",e.h.style.width="100%")),x(P,4),Fh(e),t.startTime&&t.endTime&&1/0!=t.endTime&&t.startTime!=t.endTime&&0<(b=t.endTime-t.startTime)&&e.j.configure("playRangeEnd",b),t.playoutLimit&&!e.o&&(e.o=new Ti((function(){e.ha()})).ia(t.playoutLimit),e.j.configure("playRangeEnd",t.playoutLimit)),w(P,e.j.fc(e.h),6);case 6:return S=null,e.M.allowStartInMiddleOfInterstitial&&null!=e.m&&(E=e.m-t.startTime,.25<Math.abs(E)&&(S=E)),e.F.has(t)?w(P,e.F.get(t),10):w(P,e.j.load(t.uri,S,t.mimeType||void 0),8);case 10:return I=P.h,e.F.delete(t),w(P,I?e.j.load(I):e.j.load(t.uri,S,t.mimeType||void 0),8);case 8:e.h.play(),C=(Date.now()-o)/1e3,e.i(new Dr("ads-loaded",(new Map).set("loadTime",C))),e.A&&e.g.play(),t.overlay&&(M=function(){var n=e.g.currentTime-t.startTime;.1<Math.abs(n-e.h.currentTime)&&(e.h.currentTime=n)},e.l.Aa(e.h,"playing",M),e.l.D(e.g,"seeking",M),e.l.D(e.g,"seeked",(function(){var n=e.g.currentTime;(n<t.startTime||t.endTime&&n>t.endTime)&&e.ha()}))),A(P,0);break;case 4:if(D=k(P),!e.K)return P.return();c(D),T(P)}}))}(e,t,n,i,r,a)}function Uh(e,t){if(t.displayOnBackground&&(e.g.style.zIndex="1"),null!=t.currentVideo){var n=t.currentVideo;e.g.style.transformOrigin="top left";var i=!0,r=[],a=n.topLeft.x/n.viewport.x*100;0<a&&100>=a&&(r.push("translateX("+a+"%)"),i=!1),0<(a=n.topLeft.y/n.viewport.y*100)&&100>=a&&(r.push("translateY("+a+"%)"),i=!1),1>(a=n.size.x/n.viewport.x)&&r.push("scaleX("+a+")"),n=n.size.y/n.viewport.y,1>a&&r.push("scaleY("+n+")"),r.length&&(e.g.style.transform=r.join(" ")),i&&(e.g.style.transition="transform 250ms")}e.B&&(e.B.style.pointerEvents="none",t.background&&(e.B.style.background=t.background)),e.G&&(e.G.style.background=t.overlay?"":"rgb(0, 0, 0)")}function _h(e,t){t&&!t.displayOnBackground||(e.g.style.zIndex=""),t&&null==t.currentVideo||(e.g.style.transformOrigin="",e.g.style.transition="",e.g.style.transform=""),e.B&&(e.B.style.pointerEvents="",!t||t.background)&&(e.B.style.background=""),e.G&&(e.G.style.background="")}function Bh(e){for(var t=[],n=l(e.H),i=n.next(),r={};!i.done;r={uc:void 0},i=n.next())(i=i.value).overlay||(r.uc={start:i.startTime,end:null},i.pre?(r.uc.start=0,r.uc.end=null):i.post?(r.uc.start=-1,r.uc.end=null):i.timelineRange&&(r.uc.end=i.endTime),t.find(function(e){return function(t){return e.uc.start==t.start&&e.uc.end==t.end}}(r))||t.push(r.uc));e.i(new Dr("ad-cue-points-changed",(new Map).set("cuepoints",t)))}function Fh(e){e.j.configure(e.C.Zh()),e.j.configure("ads.disableHLSInterstitial",!0),e.j.configure("ads.disableDASHInterstitial",!0),e.j.configure("playRangeEnd",1/0),_r(e.C.Pb(),e.j.Pb())}function Vh(e,t,n){var i,r;return R((function(a){return 1==a.g?(i=Br([t],{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4}),w(a,e.C.Pb().request(7,i,n).promise,2)):(r=a.h,a.return(r.data))}))}function Hh(e){return!(e=e.mimeType)||!e.startsWith("image/")&&"text/html"!==e}function Kh(){var e=te().La();return"TV"==e||"CONSOLE"==e||"CAST"==e}function Gh(e,t){if(!(e.L.has(t)||e.M&&!e.M.allowPreloadOnDomElements)){var n=function(e){var t=document.createElement("link");return t.rel="preload",t.href=e,t.as="image",document.head.appendChild(t),t},i=[];if(t.background){var r=t.background.match(/url\(('|")?([^'"()]+)('|")\)?/);r&&i.push(n(r[2]))}t.mimeType.startsWith("image/")&&i.push(n(t.uri)),e.L.set(t,i)}}function zh(e,t){if(e.L.has(t)){for(var n=e.L.get(t),i=(n=l(n)).next();!i.done;i=n.next())(i=i.value).parentNode.removeChild(i);e.L.delete(t)}}function qh(e,t,n,i,r){this.h=e,this.j=jt(this.h.skipOffset),this.g=r,this.i=t,this.l=n,this.o=i,this.m=!1}function Xh(e,t,n,i){this.B=e,this.K=t,this.h=n,this.l=null,this.P=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.N=!0,this.H="",this.o=new $}function Wh(e,t){var n,i,r,a,o,s,u,l;R((function(c){return 1==c.g?t.staticResource?(n=Yh(t),e.F.get(n)?c.return():(i={type:9},r=Br([t.staticResource],{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4}),a=e.K.request(7,r,i),x(c,2),e.F.set(n,[]),w(c,a.promise,4))):c.return():2!=c.g?(o=c.h,s=Ue(o.data),u=JSON.parse(s),l=u.apps,e.F.set(n,l),A(c,0)):(k(c),e.F.delete(n),void T(c))}))}function Yh(e){return[e.adId,e.adParameters,e.adSystem,e.adTitle,e.creativeAdId,e.creativeId,e.creativeSequence,e.height,e.width,e.staticResource].join("")}function Jh(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 $h(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"),ep(e,"firstQuartile")):t>=r&&!e.s.includes("midpoint")?(e.s.push("midpoint"),ep(e,"midpoint")):t>=a&&!e.s.includes("thirdQuartile")&&(e.s.push("thirdQuartile"),ep(e,"thirdQuartile")),i=e.g.getRemainingTime(),r=e.g.getDuration(),e.g.canSkipNow()&&0<i&&0<r&&ep(e,"skipStateChanged"),0<r&&(0>=i||i>r)&&Qh(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}Qh(e),e.L=r,e.g=new qh(o,a+1,r.ads.length,!0,e.h),e.C=o,0===a&&ep(e,"breakStart"),Zh(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(Yh(o.nonLinearAdList[0]));if(s<=t&&u&&u.length){Qh(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 qh(o,a+1,r.ads.length,!1,e.h),e.C=o,0===a&&ep(e,"breakStart"),Zh(e);break}}n&&!e.g&&(t=e.h.currentTime,e.A&&e.A>t&&(e.h.currentTime=e.A),e.A=null)}}}function Qh(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;ep(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.Ja(n.target,n.type,n.listener);e.m=[],e.s=[],(t=e.g.getPositionInSequence())===(n=e.g.getSequenceLength())&&ep(e,"breakEnd"),e.g=null,e.C=null,e.L=null}}function Zh(e){var t=!1;e.h.paused?t=!0:(ep(e,"impression"),ep(e,"start")),e.m.push({target:e.h,type:"volumechange",listener:function(){e.h.muted&&ep(e,"mute")}}),e.m.push({target:e.h,type:"volumechange",listener:function(){e.h.muted||ep(e,"unmute")}}),e.m.push({target:e.h,type:"play",listener:function(){t?(ep(e,"impression"),ep(e,"start"),t=!1):ep(e,"resume")}}),e.m.push({target:e.h,type:"pause",listener:function(){ep(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 ep(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=Br([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 Dr("ad-impression"));break;case"start":e.i(new Dr("ad-started",(new Map).set("ad",e.g)));break;case"mute":e.i(new Dr("ad-muted"));break;case"unmute":e.i(new Dr("ad-volume-changed"));break;case"resume":e.i(new Dr("ad-resumed"));break;case"pause":e.i(new Dr("ad-paused"));break;case"firstQuartile":e.i(new Dr("ad-first-quartile"));break;case"midpoint":e.i(new Dr("ad-midpoint"));break;case"thirdQuartile":e.i(new Dr("ad-third-quartile"));break;case"complete":e.i(new Dr("ad-complete")),e.i(new Dr("ad-stopped"));break;case"skip":e.i(new Dr("ad-skipped")),e.i(new Dr("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 Dr("ad-skip-state-changed"))}}function tp(e,t){this.g=e,this.i=null,this.h=t}function np(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 $,(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 Dr("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 Dr("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 tp(e,r.l),r.A&&(r.m.i=r.A),r.i(new Dr("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 Dr("ad-first-quartile"))})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.MIDPOINT,(function(){r.i(new Dr("ad-midpoint"))})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.THIRD_QUARTILE,(function(){r.i(new Dr("ad-third-quartile"))})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.COMPLETE,(function(){r.i(new Dr("ad-complete")),r.i(new Dr("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 Dr("ad-skipped")),r.i(new Dr("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 Dr("ad-cue-points-changed",(new Map).set("cuepoints",e)))}))}function ip(){Lr.call(this),this.h=this.i=this.j=this.g=null,this.m=new bh,this.o=navigator.language,this.l=null}function rp(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++;var n=t.ad;n&&!n.isLinear()&&e.m.j++;break;case"ad-complete":e.m.l++;break;case"ad-skipped":e.m.m++;break;case"ad-error":e.m.i++}e.dispatchEvent(t)}function ap(e){return JSON.stringify(e,(function(e,t){if("function"!=typeof t){if(t instanceof Event||t instanceof Dr){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(Yo(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 op(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=Th.prototype).needsSkipUI=function(){return!1},i.isClientRendering=function(){return!0},i.hasCustomClick=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.m.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){this.h.resize(e,t)},i.setMuted=function(e){(this.m.muted=e)?(this.j=this.getVolume(),this.h.setVolume(0)):this.h.setVolume(this.j)},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.getVastAdId=function(){return""},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",Th),Th.prototype.release=Th.prototype.release,Th.prototype.getPodIndex=Th.prototype.getPodIndex,Th.prototype.getTimeOffset=Th.prototype.getTimeOffset,Th.prototype.getMediaUrl=Th.prototype.getMediaUrl,Th.prototype.getAdvertiserName=Th.prototype.getAdvertiserName,Th.prototype.getCreativeAdId=Th.prototype.getCreativeAdId,Th.prototype.getAdId=Th.prototype.getAdId,Th.prototype.getVastAdId=Th.prototype.getVastAdId,Th.prototype.getVastMediaWidth=Th.prototype.getVastMediaWidth,Th.prototype.getVastMediaHeight=Th.prototype.getVastMediaHeight,Th.prototype.getVastMediaBitrate=Th.prototype.getVastMediaBitrate,Th.prototype.getDescription=Th.prototype.getDescription,Th.prototype.getTitle=Th.prototype.getTitle,Th.prototype.getPositionInSequence=Th.prototype.getPositionInSequence,Th.prototype.getSequenceLength=Th.prototype.getSequenceLength,Th.prototype.setMuted=Th.prototype.setMuted,Th.prototype.resize=Th.prototype.resize,Th.prototype.isLinear=Th.prototype.isLinear,Th.prototype.isMuted=Th.prototype.isMuted,Th.prototype.setVolume=Th.prototype.setVolume,Th.prototype.getVolume=Th.prototype.getVolume,Th.prototype.play=Th.prototype.play,Th.prototype.pause=Th.prototype.pause,Th.prototype.skip=Th.prototype.skip,Th.prototype.canSkipNow=Th.prototype.canSkipNow,Th.prototype.getTimeUntilSkippable=Th.prototype.getTimeUntilSkippable,Th.prototype.isSkippable=Th.prototype.isSkippable,Th.prototype.isPaused=Th.prototype.isPaused,Th.prototype.getRemainingTime=Th.prototype.getRemainingTime,Th.prototype.getMinSuggestedDuration=Th.prototype.getMinSuggestedDuration,Th.prototype.getDuration=Th.prototype.getDuration,Th.prototype.isUsingAnotherMediaElement=Th.prototype.isUsingAnotherMediaElement,Th.prototype.hasCustomClick=Th.prototype.hasCustomClick,Th.prototype.isClientRendering=Th.prototype.isClientRendering,Th.prototype.needsSkipUI=Th.prototype.needsSkipUI,F("shaka.ads.Utils",xh),xh.ADS_LOADED="ads-loaded",xh.AD_STARTED="ad-started",xh.AD_FIRST_QUARTILE="ad-first-quartile",xh.AD_MIDPOINT="ad-midpoint",xh.AD_THIRD_QUARTILE="ad-third-quartile",xh.AD_COMPLETE="ad-complete",xh.AD_STOPPED="ad-stopped",xh.AD_SKIPPED="ad-skipped",xh.AD_VOLUME_CHANGED="ad-volume-changed",xh.AD_MUTED="ad-muted",xh.AD_PAUSED="ad-paused",xh.AD_RESUMED="ad-resumed",xh.AD_SKIP_STATE_CHANGED="ad-skip-state-changed",xh.CUEPOINTS_CHANGED="ad-cue-points-changed",xh.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded",xh.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded",xh.AD_CLICKED="ad-clicked",xh.AD_PROGRESS="ad-progress",xh.AD_BUFFERING="ad-buffering",xh.AD_IMPRESSION="ad-impression",xh.AD_DURATION_CHANGED="ad-duration-changed",xh.AD_CLOSED="ad-closed",xh.AD_LOADED="ad-loaded",xh.ALL_ADS_COMPLETED="all-ads-completed",xh.AD_LINEAR_CHANGED="ad-linear-changed",xh.AD_METADATA="ad-metadata",xh.AD_RECOVERABLE_ERROR="ad-recoverable-error",xh.AD_ERROR="ad-error",xh.AD_BREAK_READY="ad-break-ready",xh.AD_INTERACTION="ad-interaction",xh.AD_CONTENT_PAUSE_REQUESTED="ad-content-pause-requested",xh.AD_CONTENT_RESUME_REQUESTED="ad-content-resume-requested",xh.AD_CONTENT_ATTACH_REQUESTED="ad-content-attach-requested",kh.prototype.configure=function(e){this.o=e},kh.prototype.stop=function(){this.g&&this.g.stop(),this.s&&Zo(this.s)},kh.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=Mh.prototype).needsSkipUI=function(){return!0},i.isClientRendering=function(){return!0},i.hasCustomClick=function(){return!1},i.isUsingAnotherMediaElement=function(){return this.s},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.l?this.getDuration()-this.getRemainingTime()<this.j+this.l:this.h},i.getTimeUntilSkippable=function(){if(this.isSkippable()){var e=this.getRemainingTime()+this.j-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.A()},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 null==this.B},i.resize=function(){},i.setMuted=function(e){this.g.muted=e},i.getSequenceLength=function(){return this.o},i.getPositionInSequence=function(){return this.m},i.getTitle=function(){return""},i.getDescription=function(){return""},i.getVastMediaBitrate=function(){return 0},i.getVastMediaHeight=function(){return 0},i.getVastMediaWidth=function(){return 0},i.getVastAdId=function(){return""},i.getAdId=function(){return this.i.id||""},i.getCreativeAdId=function(){return""},i.getAdvertiserName=function(){return""},i.getMediaUrl=function(){return this.i.uri},i.getTimeOffset=function(){return 0},i.getPodIndex=function(){return 0},i.release=function(){this.g=null},F("shaka.ads.InterstitialAd",Mh),Mh.prototype.release=Mh.prototype.release,Mh.prototype.getPodIndex=Mh.prototype.getPodIndex,Mh.prototype.getTimeOffset=Mh.prototype.getTimeOffset,Mh.prototype.getMediaUrl=Mh.prototype.getMediaUrl,Mh.prototype.getAdvertiserName=Mh.prototype.getAdvertiserName,Mh.prototype.getCreativeAdId=Mh.prototype.getCreativeAdId,Mh.prototype.getAdId=Mh.prototype.getAdId,Mh.prototype.getVastAdId=Mh.prototype.getVastAdId,Mh.prototype.getVastMediaWidth=Mh.prototype.getVastMediaWidth,Mh.prototype.getVastMediaHeight=Mh.prototype.getVastMediaHeight,Mh.prototype.getVastMediaBitrate=Mh.prototype.getVastMediaBitrate,Mh.prototype.getDescription=Mh.prototype.getDescription,Mh.prototype.getTitle=Mh.prototype.getTitle,Mh.prototype.getPositionInSequence=Mh.prototype.getPositionInSequence,Mh.prototype.getSequenceLength=Mh.prototype.getSequenceLength,Mh.prototype.setMuted=Mh.prototype.setMuted,Mh.prototype.resize=Mh.prototype.resize,Mh.prototype.isLinear=Mh.prototype.isLinear,Mh.prototype.isMuted=Mh.prototype.isMuted,Mh.prototype.setVolume=Mh.prototype.setVolume,Mh.prototype.getVolume=Mh.prototype.getVolume,Mh.prototype.play=Mh.prototype.play,Mh.prototype.pause=Mh.prototype.pause,Mh.prototype.skip=Mh.prototype.skip,Mh.prototype.canSkipNow=Mh.prototype.canSkipNow,Mh.prototype.getTimeUntilSkippable=Mh.prototype.getTimeUntilSkippable,Mh.prototype.isSkippable=Mh.prototype.isSkippable,Mh.prototype.isPaused=Mh.prototype.isPaused,Mh.prototype.getRemainingTime=Mh.prototype.getRemainingTime,Mh.prototype.getMinSuggestedDuration=Mh.prototype.getMinSuggestedDuration,Mh.prototype.getDuration=Mh.prototype.getDuration,Mh.prototype.isUsingAnotherMediaElement=Mh.prototype.isUsingAnotherMediaElement,Mh.prototype.hasCustomClick=Mh.prototype.hasCustomClick,Mh.prototype.isClientRendering=Mh.prototype.isClientRendering,Mh.prototype.needsSkipUI=Mh.prototype.needsSkipUI,(i=Dh.prototype).needsSkipUI=function(){return!0},i.isClientRendering=function(){return!0},i.hasCustomClick=function(){return!1},i.isUsingAnotherMediaElement=function(){return!1},i.getDuration=function(){return-1},i.getMinSuggestedDuration=function(){return this.getDuration()},i.getRemainingTime=function(){return-1},i.isPaused=function(){return!1},i.isSkippable=function(){return!1},i.getTimeUntilSkippable=function(){return 0},i.canSkipNow=function(){return!1},i.skip=function(){},i.pause=function(){},i.play=function(){},i.getVolume=function(){return 1},i.setVolume=function(){},i.isMuted=function(){return!1},i.isLinear=function(){return this.i},i.resize=function(){},i.setMuted=function(){},i.getSequenceLength=function(){return this.j},i.getPositionInSequence=function(){return this.h},i.getTitle=function(){return""},i.getDescription=function(){return""},i.getVastMediaBitrate=function(){return 0},i.getVastMediaHeight=function(){return 0},i.getVastMediaWidth=function(){return 0},i.getVastAdId=function(){return""},i.getAdId=function(){return this.g.id||""},i.getCreativeAdId=function(){return""},i.getAdvertiserName=function(){return""},i.getMediaUrl=function(){return this.g.uri},i.getTimeOffset=function(){return 0},i.getPodIndex=function(){return 0},i.release=function(){},F("shaka.ads.InterstitialStaticAd",Dh),Dh.prototype.release=Dh.prototype.release,Dh.prototype.getPodIndex=Dh.prototype.getPodIndex,Dh.prototype.getTimeOffset=Dh.prototype.getTimeOffset,Dh.prototype.getMediaUrl=Dh.prototype.getMediaUrl,Dh.prototype.getAdvertiserName=Dh.prototype.getAdvertiserName,Dh.prototype.getCreativeAdId=Dh.prototype.getCreativeAdId,Dh.prototype.getAdId=Dh.prototype.getAdId,Dh.prototype.getVastAdId=Dh.prototype.getVastAdId,Dh.prototype.getVastMediaWidth=Dh.prototype.getVastMediaWidth,Dh.prototype.getVastMediaHeight=Dh.prototype.getVastMediaHeight,Dh.prototype.getVastMediaBitrate=Dh.prototype.getVastMediaBitrate,Dh.prototype.getDescription=Dh.prototype.getDescription,Dh.prototype.getTitle=Dh.prototype.getTitle,Dh.prototype.getPositionInSequence=Dh.prototype.getPositionInSequence,Dh.prototype.getSequenceLength=Dh.prototype.getSequenceLength,Dh.prototype.setMuted=Dh.prototype.setMuted,Dh.prototype.resize=Dh.prototype.resize,Dh.prototype.isLinear=Dh.prototype.isLinear,Dh.prototype.isMuted=Dh.prototype.isMuted,Dh.prototype.setVolume=Dh.prototype.setVolume,Dh.prototype.getVolume=Dh.prototype.getVolume,Dh.prototype.play=Dh.prototype.play,Dh.prototype.pause=Dh.prototype.pause,Dh.prototype.skip=Dh.prototype.skip,Dh.prototype.canSkipNow=Dh.prototype.canSkipNow,Dh.prototype.getTimeUntilSkippable=Dh.prototype.getTimeUntilSkippable,Dh.prototype.isSkippable=Dh.prototype.isSkippable,Dh.prototype.isPaused=Dh.prototype.isPaused,Dh.prototype.getRemainingTime=Dh.prototype.getRemainingTime,Dh.prototype.getMinSuggestedDuration=Dh.prototype.getMinSuggestedDuration,Dh.prototype.getDuration=Dh.prototype.getDuration,Dh.prototype.isUsingAnotherMediaElement=Dh.prototype.isUsingAnotherMediaElement,Dh.prototype.hasCustomClick=Dh.prototype.hasCustomClick,Dh.prototype.isClientRendering=Dh.prototype.isClientRendering,Dh.prototype.needsSkipUI=Dh.prototype.needsSkipUI,(i=Ph.prototype).configure=function(e){this.M=e,Lh(this)},i.stop=function(){if(this.l&&this.l.Ra(),this.U.clear(),this.H.clear(),this.j.ng(),this.F.size)for(var e=Array.from(this.F.values()),t=(e=l(e)).next();!t.done;t=e.next())(t=t.value)&&t.then((function(e){e&&e.destroy()}));if(this.F.clear(),this.L.size)for(t=(e=l(e=Array.from(this.L.keys()))).next();!t.done;t=e.next())zh(this,t.value);this.L.clear(),this.j.detach(),this.K=!1,this.s=this.m=null,this.A=!0,this.h=this.g,this.G=null,_h(this),Rh(this),this.B&&Zo(this.B),this.o&&(this.o.stop(),this.o=null)},i.release=function(){this.stop(),this.I&&this.I.release(),this.l&&this.l.release(),this.S&&(this.S.stop(),this.S=null),this.N&&(this.N.stop(),this.N=null),this.j.destroy()},i.od=function(){return this.j},i.addAdUrlInterstitial=function(e){var t,n,i,r,a,o,s,u,d,h=this;return R((function(p){switch(p.g){case 1:return w(p,Vh(h,e,t={type:12}),2);case 2:if(n=p.h,!(i=Ht(n,"VAST,vmap:VMAP")))throw new Ne(2,10,10007);if(r=[],"VAST"==i.tagName){r=Sh(i,h.m),p.u(3);break}if("vmap:VMAP"!=i.tagName){p.u(3);break}for(var f=[],g=l(Xt(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:jt(y),(v=$t(v,"vmap:AdSource"))&&(v=$t(v,"vmap:AdTagURI"))&&(v=Wt(v))&&f.push({time:m,uri:v}))}a=l(f),o=a.next();case 5:if(o.done){p.u(3);break}return s=o.value,w(p,Vh(h,s.uri,t),8);case 8:if(u=p.h,!(d=Ht(u,"VAST")))throw new Ne(2,10,10007);r.push.apply(r,c(Sh(d,s.time))),o=a.next(),p.u(5);break;case 3:Nh(h,r),T(p)}}))},(i=qh.prototype).needsSkipUI=function(){return!0},i.isClientRendering=function(){return!1},i.hasCustomClick=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.getVastAdId=function(){return this.h.vastAdId||""},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",qh),qh.prototype.release=qh.prototype.release,qh.prototype.getPodIndex=qh.prototype.getPodIndex,qh.prototype.getTimeOffset=qh.prototype.getTimeOffset,qh.prototype.getMediaUrl=qh.prototype.getMediaUrl,qh.prototype.getAdvertiserName=qh.prototype.getAdvertiserName,qh.prototype.getCreativeAdId=qh.prototype.getCreativeAdId,qh.prototype.getAdId=qh.prototype.getAdId,qh.prototype.getVastAdId=qh.prototype.getVastAdId,qh.prototype.getVastMediaWidth=qh.prototype.getVastMediaWidth,qh.prototype.getVastMediaHeight=qh.prototype.getVastMediaHeight,qh.prototype.getVastMediaBitrate=qh.prototype.getVastMediaBitrate,qh.prototype.getDescription=qh.prototype.getDescription,qh.prototype.getTitle=qh.prototype.getTitle,qh.prototype.getPositionInSequence=qh.prototype.getPositionInSequence,qh.prototype.getSequenceLength=qh.prototype.getSequenceLength,qh.prototype.setMuted=qh.prototype.setMuted,qh.prototype.resize=qh.prototype.resize,qh.prototype.isLinear=qh.prototype.isLinear,qh.prototype.isMuted=qh.prototype.isMuted,qh.prototype.setVolume=qh.prototype.setVolume,qh.prototype.getVolume=qh.prototype.getVolume,qh.prototype.play=qh.prototype.play,qh.prototype.pause=qh.prototype.pause,qh.prototype.skip=qh.prototype.skip,qh.prototype.canSkipNow=qh.prototype.canSkipNow,qh.prototype.getTimeUntilSkippable=qh.prototype.getTimeUntilSkippable,qh.prototype.isSkippable=qh.prototype.isSkippable,qh.prototype.isPaused=qh.prototype.isPaused,qh.prototype.getRemainingTime=qh.prototype.getRemainingTime,qh.prototype.getMinSuggestedDuration=qh.prototype.getMinSuggestedDuration,qh.prototype.getDuration=qh.prototype.getDuration,qh.prototype.isUsingAnotherMediaElement=qh.prototype.isUsingAnotherMediaElement,qh.prototype.hasCustomClick=qh.prototype.hasCustomClick,qh.prototype.isClientRendering=qh.prototype.isClientRendering,qh.prototype.needsSkipUI=qh.prototype.needsSkipUI,Xh.prototype.stop=function(){for(var e=l(this.m),t=e.next();!t.done;t=e.next())t=t.value,this.o.Ja(t.target,t.type,t.listener);Qh(this),this.m=[],this.s=[],this.G="",this.N=!0,this.H="",this.A=null,this.j=[],this.M=[],this.F.clear()},Xh.prototype.release=function(){this.stop(),this.o&&this.o.release()},Xh.prototype.onManifestUpdated=function(e){this.I=e,""!=this.G&&(function(e,t,n){var i,r,a,o,s,u,c,d,h,p,f,g,m,v,y,b;R((function(S){if(1==S.g)return i={type:8},r=Br([t],{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4}),a=e.K.request(7,r,i),x(S,2),w(S,a.promise,4);if(2!=S.g){if(o=S.h,s=[],u=Ue(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(p=h.value,f=l(p.nonLinearAdsList),g=f.next();!g.done;g=f.next())for(m=g.value,v=l(m.nonLinearAdList),y=v.next();!y.done;y=v.next())b=y.value,Wh(e,b);s=e.getCuePoints(),e.i(new Dr("ad-cue-points-changed",(new Map).set("cuepoints",s)))}}else e.j.length&&e.i(new Dr("ad-cue-points-changed",(new Map).set("cuepoints",s))),Qh(e),e.j=[];return n&&(e.I||0<s.length)&&function(e){$h(e),e.I||(Jh(e),e.o.D(e.h,"seeked",(function(){Jh(e)})),e.o.D(e.h,"ended",(function(){Qh(e)}))),e.o.D(e.h,"timeupdate",(function(){$h(e)}))}(e),A(S,0)}k(S),T(S)}))}(this,this.G,this.N),this.N=!1)},Xh.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=tp.prototype).needsSkipUI=function(){return!0},i.isClientRendering=function(){return!1},i.hasCustomClick=function(){return!0},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.getVastAdId=function(){return""},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",tp),tp.prototype.release=tp.prototype.release,tp.prototype.getPodIndex=tp.prototype.getPodIndex,tp.prototype.getTimeOffset=tp.prototype.getTimeOffset,tp.prototype.getMediaUrl=tp.prototype.getMediaUrl,tp.prototype.getAdvertiserName=tp.prototype.getAdvertiserName,tp.prototype.getCreativeAdId=tp.prototype.getCreativeAdId,tp.prototype.getAdId=tp.prototype.getAdId,tp.prototype.getVastAdId=tp.prototype.getVastAdId,tp.prototype.getVastMediaWidth=tp.prototype.getVastMediaWidth,tp.prototype.getVastMediaHeight=tp.prototype.getVastMediaHeight,tp.prototype.getVastMediaBitrate=tp.prototype.getVastMediaBitrate,tp.prototype.getDescription=tp.prototype.getDescription,tp.prototype.getTitle=tp.prototype.getTitle,tp.prototype.getPositionInSequence=tp.prototype.getPositionInSequence,tp.prototype.getSequenceLength=tp.prototype.getSequenceLength,tp.prototype.setMuted=tp.prototype.setMuted,tp.prototype.resize=tp.prototype.resize,tp.prototype.isLinear=tp.prototype.isLinear,tp.prototype.isMuted=tp.prototype.isMuted,tp.prototype.setVolume=tp.prototype.setVolume,tp.prototype.getVolume=tp.prototype.getVolume,tp.prototype.play=tp.prototype.play,tp.prototype.pause=tp.prototype.pause,tp.prototype.skip=tp.prototype.skip,tp.prototype.canSkipNow=tp.prototype.canSkipNow,tp.prototype.getTimeUntilSkippable=tp.prototype.getTimeUntilSkippable,tp.prototype.isSkippable=tp.prototype.isSkippable,tp.prototype.isPaused=tp.prototype.isPaused,tp.prototype.getRemainingTime=tp.prototype.getRemainingTime,tp.prototype.getMinSuggestedDuration=tp.prototype.getMinSuggestedDuration,tp.prototype.getDuration=tp.prototype.getDuration,tp.prototype.isUsingAnotherMediaElement=tp.prototype.isUsingAnotherMediaElement,tp.prototype.hasCustomClick=tp.prototype.hasCustomClick,tp.prototype.isClientRendering=tp.prototype.isClientRendering,tp.prototype.needsSkipUI=tp.prototype.needsSkipUI,(i=np.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(ip,Lr),(i=ip.prototype).setLocale=function(e){this.o=e},i.configure=function(e){this.l=e,this.g&&this.g.configure(this.l),this.j&&this.j.configure(this.l),this.h&&this.h.configure(this.l)},i.initInterstitial=function(e,t,n){var i=this;this.g&&this.g.release(),this.g=new Ph(e,t,n,(function(e){return rp(i,e)})),this.g.configure(this.l)},i.initClientSide=function(t,n,i){var r=this;if(!e.google||!google.ima||!google.ima.AdsLoader)throw new Ne(2,10,1e4);this.j&&this.j.release(),this.j=new kh(t,n,this.o,i,(function(e){return rp(r,e)})),this.j.configure(this.l)},i.release=function(){this.g&&(this.g.release(),this.g=null),this.j&&(this.j.release(),this.j=null),this.i&&(this.i.release(),this.i=null),this.h&&(this.h.release(),this.h=null),Lr.prototype.release.call(this)},i.onAssetUnload=function(){this.g&&this.g.stop(),this.j&&this.j.stop(),this.i&&this.i.stop(),this.h&&this.h.stop(),this.dispatchEvent(new Dr("ad-stopped")),this.dispatchEvent(new Dr("ad-content-attach-requested")),this.m=new bh},i.requestClientSideAds=function(e){if(!this.j)throw new Ne(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 Ne(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 Xh(e,t,n,(function(e){return rp(i,e)}))},i.requestMediaTailorStream=function(e,t,n){if(!this.i)throw new Ne(1,10,10005);var i=this.i;return n=void 0===n?"":n,i.l?e=Promise.reject(new Ne(1,10,10004)):(i.l=new Sr,function(e,t,n){var i,r,a,o,s,u,l,c,d,h,p,f;R((function(g){if(1==g.g)return i={type:7},(r=Br([t],{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4})).method="POST",n&&(a=JSON.stringify(n),r.body=Fe(a)),o=e.K.request(7,r,i),x(g,2),w(g,o.promise,4);if(2!=g.g){if(s=g.h,u=Ue(s.data),!(l=JSON.parse(u)).manifestUrl||!l.trackingUrl)throw Error("Insufficient data from MediaTailor.");return c=new de(t),d=new de(l.trackingUrl),e.G=c.resolve(d).toString(),h=Date.now()/1e3,p=h-e.P,e.i(new Dr("ads-loaded",(new Map).set("loadTime",p))),f=new de(l.manifestUrl),e.l.resolve(c.resolve(f).toString()),e.l=null,A(g,0)}if(k(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.P=Date.now()/1e3,e=i.l),e},i.addMediaTailorTrackingUrl=function(e){if(!this.i)throw new Ne(1,10,10005);var t=this.i;t.G=e,t.i(new Dr("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 Ne(2,10,10002);this.h&&this.h.release(),this.h=new np(t,n,this.o,(function(e){return rp(i,e)})),this.h.configure(this.l)},i.requestServerSideStream=function(e,t){if(t=void 0===t?"":t,!this.h)throw new Ne(1,10,10003);e.adTagParameters||(e.adTagParameters={});var n=e.adTagParameters;return(n.mpt||n.mpv)&&q('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 overridden.'),e.adTagParameters.mpt="shaka-player",e.adTagParameters.mpv="v4.15.8",(n=this.h).j?e=Promise.reject(new Ne(1,10,10004)):(e instanceof google.ima.dai.api.LiveStreamRequest&&(n.G=!0),n.j=new Sr,n.g.requestStream(e),n.B=t||"",n.F=Date.now()/1e3,e=n.j),e},i.replaceServerSideAdTagParameters=function(e){if(!this.h)throw new Ne(1,10,10003);(e.mpt||e.mpv)&&q('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 overridden.'),e.mpt="Shaka Player",e.mpv="v4.15.8",this.h.g.replaceAdTagParameters(e)},i.getServerSideCuePoints=function(){return oe("AdManager.getServerSideCuePoints","Please use getCuePoints function."),this.getCuePoints()},i.getCuePoints=function(){var e=[];return this.h&&(e=e.concat(this.h.getCuePoints())),this.i&&(e=e.concat(this.i.getCuePoints())),e},i.getStats=function(){var e=this.m;return{loadTimes:e.g,averageLoadTime:wh(e),started:e.h,overlayAds:e.j,playedCompletely:e.l,skipped:e.m,errors:e.i}},i.onManifestUpdated=function(e){this.i&&this.i.onManifestUpdated(e)},i.onDashTimedMetadata=function(e){this.h&&"urn:google:dai:2018"==e.schemeIdUri&&this.h.g.processMetadata(e.schemeIdUri,e.eventNode?e.eventNode.attributes.messageData:null,e.startTime)},i.onHlsTimedMetadata=function(e,t){this.h&&this.h.g.processMetadata("ID3",e.data,t)},i.onCueMetadataChange=function(e){this.h&&this.h.onCueMetadataChange(e)},i.onHLSInterstitialMetadata=function(e,t,n){this.l&&this.l.disableHLSInterstitial||(this.g||this.initInterstitial(null,e,t),this.g&&function(e,t){var n;R((function(i){if(1==i.g)return Fh(e),w(i,function(e,t){var n,i,r,a,o,s,u,l,c,d,h,p,f,g,m,v,y,b,T,S,E,I,C,M,D,P,L,N,O,j,U,_,B,F,V,H,K,G,z,q,X;return R((function(R){switch(R.g){case 1:if(n=[],!t)return R.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 R.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")),p=c?0:null,(f=t.values.find((function(e){return"X-ENABLE-SKIP-AFTER"==e.key})))&&(g=f.data,p=parseFloat(g),isNaN(p)&&(p=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(p)&&(m=null)),b=null,(T=t.values.find((function(e){return"X-RESUME-OFFSET"==e.key})))&&(S=T.data,b=parseFloat(S),isNaN(b)&&(b=null)),E=null,(I=t.values.find((function(e){return"X-PLAYOUT-LIMIT"==e.key})))&&(C=I.data,E=parseFloat(C),isNaN(E)&&(E=null)),P=D=M=!1,(L=t.values.find((function(e){return"CUE"==e.key})))&&(N=L.data,M=N.includes("ONCE"),D=N.includes("PRE"),P=N.includes("POST")),O=!1,(j=t.values.find((function(e){return"X-TIMELINE-OCCUPIES"==e.key})))?(U=j.data,O=U.includes("RANGE")):!T&&e.C.V()&&(O=!D&&!P),i){if(!(_=i.data))return R.return(n);n.push({id:a,groupId:null,startTime:s,endTime:u,uri:_,mimeType:null,isSkippable:c,skipOffset:p,skipFor:m,canJump:d,resumeOffset:b,playoutLimit:E,once:M,pre:D,post:P,timelineRange:O,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null}),R.u(2);break}if(!r){R.u(2);break}return(B=r.data)?(x(R,4),w(R,Vh(e,B,{type:11}),6)):R.return(n);case 6:for(F=R.h,V=Ue(F),H=JSON.parse(V),(K=H["SKIP-CONTROL"])&&("number"==typeof(G=K["ENABLE-SKIP-AFTER"])&&(p=parseFloat(G),isNaN(G)&&(p=c?0:null)),"number"==typeof(z=K["ENABLE-SKIP-FOR"])&&(m=parseFloat(z),isNaN(z)&&(m=null))),q=0;q<H.ASSETS.length;q++)(X=H.ASSETS[q]).URI&&n.push({id:a+"_shaka_asset_"+q,groupId:a,startTime:s,endTime:u,uri:X.URI,mimeType:null,isSkippable:c,skipOffset:p,skipFor:m,canJump:d,resumeOffset:b,playoutLimit:E,once:M,pre:D,post:P,timelineRange:O,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null});A(R,2);break;case 4:k(R);case 2:return R.return(n)}}))}(e,t),2);(n=i.h).length?Nh(e,n):q("Unsupported HLS interstitial",t),T(i)}))}(this.g,n))},i.onDASHInterstitialMetadata=function(e,t,n){if(!this.l||!this.l.disableDASHInterstitial){var i=n.schemeIdUri;if("urn:mpeg:dash:event:alternativeMPD:insert:2025"==i||"urn:mpeg:dash:event:alternativeMPD:replace:2025"==i){if(this.g||this.initInterstitial(null,e,t),this.g&&(e=this.g,t="urn:mpeg:dash:event:alternativeMPD:replace:2025"==n.schemeIdUri,i="urn:mpeg:dash:event:alternativeMPD:insert:2025"==n.schemeIdUri,t||i)){for(var r,a=n.startTime,o=n.endTime,s=null,u=0,c=l(n.eventNode.children),d=c.next();!d.done;d=c.next())if("AlternativeMPD"==(d=d.value).tagName){if(d=d.attributes.uri){r=d;break}}else if("InsertPresentation"==d.tagName||"ReplacePresentation"==d.tagName){var h=d.attributes.url;if(h){r=h,(c=Zt(d,"maxDuration",sn))&&(s=c/n.timescale),(c=Zt(d,"returnOffset",sn))&&(u=c/n.timescale),t&&u&&(o=a+u);break}}r&&Nh(e,[{id:n.id,groupId:null,startTime:a,endTime:o,uri:r,mimeType:null,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!0,resumeOffset:i?u:null,playoutLimit:s,once:!1,pre:!1,post:!1,timelineRange:t&&!i,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null}])}}else("urn:mpeg:dash:event:2012"==i||"urn:scte:dash:scte214-events"==i)&&n.eventNode&&$t(n.eventNode,"OverlayEvent")&&(this.g||this.initInterstitial(null,e,t),this.g&&function(e,t){var n=$t(t.eventNode,"OverlayEvent"),i=n.attributes.uri,r=n.attributes.mimeType,a="true"==n.attributes.loop,o=Zt(n,"z",sn);if(i&&0!=o){var s=null,u=$t(n,"Background");if(u){var l=u.attributes.uri;s=l?"center / contain no-repeat url('"+l+"')":Yt(u)}u=1920,l=1080;var c=$t(n,"Viewport");if(c){if(null==(u=Zt(c,"x",sn)))return;if(null==(l=Zt(c,"y",sn)))return}var d={viewport:{x:u,y:l},topLeft:{x:0,y:0},size:{x:u,y:l}},h=$t(n,"Overlay");if(c&&h){var p=$t(h,"TopLeft"),f=$t(h,"Size");if(p&&f){if(null==(h=Zt(p,"x",sn)))return;if(null==(p=Zt(p,"y",sn)))return;var g=Zt(f,"x",sn);if(null==g)return;if(null==(f=Zt(f,"y",sn)))return;d.topLeft.x=h,d.topLeft.y=p,d.size.x=g,d.size.y=f}}if(h=null,n=$t(n,"Squeeze"),c&&n&&(f=$t(n,"TopLeft"),n=$t(n,"Size"),f&&n)){if(null==(c=Zt(f,"x",sn)))return;if(null==(h=Zt(f,"y",sn)))return;if(null==(f=Zt(n,"x",sn)))return;if(null==(n=Zt(n,"y",sn)))return;h={viewport:{x:u,y:l},topLeft:{x:c,y:h},size:{x:f,y:n}}}Nh(e,[{id:t.id,groupId:null,startTime:t.startTime,endTime:t.endTime,uri:i,mimeType:r,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!0,resumeOffset:null,playoutLimit:null,once:!1,pre:!1,post:!1,timelineRange:!0,loop:a,overlay:d,displayOnBackground:-1==o,currentVideo:h,background:s}])}}(this.g,n))}},i.addCustomInterstitial=function(e){if(!this.g)throw new Ne(1,10,10006);Nh(this.g,[e])},i.addAdUrlInterstitial=function(e){if(!this.g)throw new Ne(1,10,10006);return this.g.addAdUrlInterstitial(e)},i.getInterstitialPlayer=function(){if(!this.g)throw new Ne(1,10,10006);return this.g.od()},F("shaka.ads.AdManager",ip),ip.prototype.getInterstitialPlayer=ip.prototype.getInterstitialPlayer,ip.prototype.addAdUrlInterstitial=ip.prototype.addAdUrlInterstitial,ip.prototype.addCustomInterstitial=ip.prototype.addCustomInterstitial,ip.prototype.onDASHInterstitialMetadata=ip.prototype.onDASHInterstitialMetadata,ip.prototype.onHLSInterstitialMetadata=ip.prototype.onHLSInterstitialMetadata,ip.prototype.onCueMetadataChange=ip.prototype.onCueMetadataChange,ip.prototype.onHlsTimedMetadata=ip.prototype.onHlsTimedMetadata,ip.prototype.onDashTimedMetadata=ip.prototype.onDashTimedMetadata,ip.prototype.onManifestUpdated=ip.prototype.onManifestUpdated,ip.prototype.getStats=ip.prototype.getStats,ip.prototype.getCuePoints=ip.prototype.getCuePoints,ip.prototype.getServerSideCuePoints=ip.prototype.getServerSideCuePoints,ip.prototype.replaceServerSideAdTagParameters=ip.prototype.replaceServerSideAdTagParameters,ip.prototype.requestServerSideStream=ip.prototype.requestServerSideStream,ip.prototype.initServerSide=ip.prototype.initServerSide,ip.prototype.addMediaTailorTrackingUrl=ip.prototype.addMediaTailorTrackingUrl,ip.prototype.requestMediaTailorStream=ip.prototype.requestMediaTailorStream,ip.prototype.initMediaTailor=ip.prototype.initMediaTailor,ip.prototype.updateClientSideAdsRenderingSettings=ip.prototype.updateClientSideAdsRenderingSettings,ip.prototype.requestClientSideAds=ip.prototype.requestClientSideAds,ip.prototype.onAssetUnload=ip.prototype.onAssetUnload,ip.prototype.release=ip.prototype.release,ip.prototype.initClientSide=ip.prototype.initClientSide,ip.prototype.initInterstitial=ip.prototype.initInterstitial,ip.prototype.configure=ip.prototype.configure,ip.prototype.setLocale=ip.prototype.setLocale,ip.ADS_LOADED="ads-loaded",ip.AD_STARTED="ad-started",ip.AD_FIRST_QUARTILE="ad-first-quartile",ip.AD_MIDPOINT="ad-midpoint",ip.AD_THIRD_QUARTILE="ad-third-quartile",ip.AD_COMPLETE="ad-complete",ip.AD_STOPPED="ad-stopped",ip.AD_SKIPPED="ad-skipped",ip.AD_VOLUME_CHANGED="ad-volume-changed",ip.AD_MUTED="ad-muted",ip.AD_PAUSED="ad-paused",ip.AD_RESUMED="ad-resumed",ip.AD_SKIP_STATE_CHANGED="ad-skip-state-changed",ip.CUEPOINTS_CHANGED="ad-cue-points-changed",ip.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded",ip.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded",ip.AD_CLICKED="ad-clicked",ip.AD_PROGRESS="ad-progress",ip.AD_BUFFERING="ad-buffering",ip.AD_IMPRESSION="ad-impression",ip.AD_DURATION_CHANGED="ad-duration-changed",ip.AD_CLOSED="ad-closed",ip.AD_LOADED="ad-loaded",ip.ALL_ADS_COMPLETED="all-ads-completed",ip.AD_LINEAR_CHANGED="ad-linear-changed",ip.AD_METADATA="ad-metadata",ip.AD_RECOVERABLE_ERROR="ad-recoverable-error",ip.AD_ERROR="ad-error",ip.AD_BREAK_READY="ad-break-ready",ip.AD_INTERACTION="ad-interaction",ip.AD_CONTENT_PAUSE_REQUESTED="ad-content-pause-requested",ip.AD_CONTENT_RESUME_REQUESTED="ad-content-resume-requested",ip.AD_CONTENT_ATTACH_REQUESTED="ad-content-attach-requested",vh=function(){return new ip};var sp="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),up="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),lp=["loop","playbackRate"],cp=["pause","play"],dp=(new Map).set("getAssetUri",2).set("getAudioLanguages",4).set("getAudioLanguagesAndRoles",4).set("getBufferFullness",1).set("getBufferedInfo",2).set("getExpiration",2).set("getKeyStatuses",2).set("getPlaybackRate",2).set("getTextLanguages",4).set("getTextLanguagesAndRoles",4).set("isAudioOnly",10).set("isBuffering",1).set("isInProgress",1).set("isLive",10).set("isTextTrackVisible",1).set("isVideoOnly",10).set("keySystem",10).set("seekRange",1).set("getLoadMode",10).set("getManifestType",10).set("isFullyLoaded",1).set("isEnded",1),hp=(new Map).set("getConfiguration",4).set("getConfigurationForLowLatency",4).set("getStats",5).set("getAudioTracks",2).set("getChaptersTracks",2).set("getImageTracks",2).set("getVideoTracks",2).set("getTextTracks",2).set("getVariantTracks",2),pp=(new Map).set("getPlayheadTimeAsDate",1).set("getPresentationStartTimeAsDate",20).set("getSegmentAvailabilityDuration",20),fp=[["getConfiguration","configure","getConfigurationForLowLatency","configurationForLowLatency"]],gp=[["isTextTrackVisible","setTextTrackVisibility"]],mp="cancelTrickPlay configure configurationForLowLatency getChapters resetConfiguration retryStreaming selectAudioLanguage selectAudioTrack selectTextLanguage selectTextTrack selectVariantTrack selectVariantsByLabel selectVideoTrack setTextTrackVisibility trickPlay updateStartTime goToLive useTrickPlayTrackIfAvailable".split(" "),vp="addChaptersTrack addTextTrackAsync addThumbnailsTrack getAllThumbnails getChaptersAsync getThumbnails attach attachCanvas detach load unload".split(" ");function yp(e,t,n,i,r,a,o){var s=this;this.G=e,this.K=o,this.l=new Ti(t),this.L=n,this.s=!1,this.A=i,this.F=r,this.M=a,this.i=this.m=!1,this.I="",this.o=null,this.B=function(){return xp(s)},this.C=function(e,t){switch((e=op(t)).type){case"event":var n=e.targetName,i=Pr(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(r=e.id,i=e.error,t=e.res,e=s.h.get(r),s.h.delete(r),e)if(i){for(n in r=new Ne(i.severity,i.category,i.code),i)r[n]=i[n];e.reject(r)}else e.resolve(t)}},this.g={video:{},player:{}},this.H=0,this.h=new Map,this.j=null,Mp.add(this)}function bp(e,t){var n=e.M();Ip=t,t.addUpdateListener(e.B),t.addMessageListener("urn:x-cast:com.google.shaka.v2",e.C),xp(e),Ap(e,{type:"init",initState:n,appData:e.o}),e.j.resolve()}function wp(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 Ne(2,8,n,t))}function Tp(e){var t=Ip;t.removeUpdateListener(e.B),t.removeMessageListener("urn:x-cast:com.google.shaka.v2",e.C)}function xp(e){var t=!!Ip&&"connected"==Ip.status;if(e.i&&!t){for(var n in e.F(),e.g)e.g[n]={};Sp(e)}e.i=t,e.I=t?Ip.receiver.friendlyName:"",e.l.Jb()}function Sp(e){if(e.h)for(var t=l(e.h.keys()),n=t.next();!n.done;n=t.next()){n=n.value;var i=e.h.get(n);e.h.delete(n),i.reject(new Ne(1,7,7e3))}}function Ap(e,t){t=ap(t);var n=Ip;try{n.sendMessage("urn:x-cast:com.google.shaka.v2",t,(function(){}),W)}catch(i){throw t=new Ne(2,8,8005,i),n=new Dr("error",(new Map).set("detail",t)),e.A("player",n),e.md(),t}}(i=yp.prototype).destroy=function(){return Mp.delete(this),Sp(this),Ip&&Tp(this),this.l&&(this.l.stop(),this.l=null),this.F=this.A=null,this.i=this.m=!1,this.C=this.B=this.j=this.h=this.g=this.o=null,Promise.resolve()},i.vb=function(){return this.i},i.Zg=function(){return this.I},i.init=function(){if(this.G.length)if(e.chrome&&chrome.cast&&chrome.cast.isAvailable){this.m=!0,this.l.Jb();var t=new chrome.cast.SessionRequest(this.G,[],null,this.K,null);t=new chrome.cast.ApiConfig(t,(function(e){for(var t=l(Mp),n=t.next();!n.done;n=t.next()){var i=e;(n=n.value).j=new Sr,n.s=!0,bp(n,i)}}),(function(e){for(var t=l(Mp),n=t.next();!n.done;n=t.next())n=n.value,Ep="available"==e,n.l.Jb()}),"origin_scoped"),chrome.cast.initialize(t,(function(){}),(function(){})),Ep&&this.l.ia(kp),(t=Ip)&&t.status!=chrome.cast.SessionStatus.STOPPED?(this.j=new Sr,this.s=!0,bp(this,t)):Ip=null}else e.__onGCastApiAvailable!==Dp&&(Cp=e.__onGCastApiAvailable||null,e.__onGCastApiAvailable=Dp)},i.kh=function(e){this.o=e,this.i&&Ap(this,{type:"appData",appData:this.o})},i.cast=function(){var e=this;return R((function(t){if(!e.m)throw new Ne(1,8,8e3);if(!Ep)throw new Ne(1,8,8001);if(e.i)throw new Ne(1,8,8002);return e.j=new Sr,chrome.cast.requestSession((function(t){return bp(e,t)}),(function(t){return wp(e,t)})),w(t,e.j,0)}))},i.md=function(){if(this.i){if(Sp(this),Ip){Tp(this);try{Ip.stop((function(){}),(function(){}))}catch(e){}Ip=null}xp(this)}},i.get=function(e,t){var n=this;if("video"==e){if(cp.includes(t))return function(){return n.zi.apply(n,[e,t].concat(c(L.apply(0,arguments))))}}else if("player"==e){if(pp.has(t)&&!this.get("player","isLive")())return function(){};if(mp.includes(t))return function(){return n.zi.apply(n,[e,t].concat(c(L.apply(0,arguments))))};if(vp.includes(t))return function(){return n.Hk.apply(n,[e,t].concat(c(L.apply(0,arguments))))};if(dp.has(t)||hp.has(t))return function(){return n.g[e][t]}}return this.g[e][t]},i.set=function(e,t,n){this.g[e][t]=n,Ap(this,{type:"set",targetName:e,property:t,value:n})},i.zi=function(e,t){Ap(this,{type:"call",targetName:e,methodName:t,args:L.apply(2,arguments)})},i.Hk=function(e,t){var n=L.apply(2,arguments),i=new Sr,r=this.H.toString();this.H++,this.h.set(r,i);try{Ap(this,{type:"asyncCall",targetName:e,methodName:t,args:n,id:r})}catch(e){i.reject(e)}return i};var kp=.02,Ep=!1,Ip=null,Cp=null,Mp=new Set;function Dp(t){if(Cp?e.__onGCastApiAvailable=Cp:delete e.__onGCastApiAvailable,Cp=null,t)for(var n=l(Mp),i=n.next();!i.done;i=n.next())i.value.init();"function"==typeof e.__onGCastApiAvailable&&e.__onGCastApiAvailable(t)}function Pp(t,n,i,r){r=void 0!==r&&r,Lr.call(this);var a=this;this.i=t,this.h=n,this.l=this.o=this.m=this.s=this.j=null,this.H=i,this.G=r,this.C=[],this.B=[],this.A=[],this.F=new Map,this.g=null,e.chrome?(this.g=new yp(i,(function(){return Np(a)}),(function(){return Op(a)}),(function(e,t){return Bp(a,e,t)}),(function(){return jp(a)}),(function(){return Lp(a)}),r),function(e){e.g.init(),e.l=new $;for(var t=l(sp),n=t.next();!n.done;n=t.next())e.l.D(e.i,n.value,(function(t){e.g.vb()||(t=Pr(t),e.m.dispatchEvent(t))}));for(var i in Rr)e.l.D(e.h,Rr[i],(function(t){e.g.vb()||e.o.dispatchEvent(t)}));for(var r in e.j={},t={},e.i)(t={Xd:t.Xd}).Xd=r,Object.defineProperty(e.j,t.Xd,{configurable:!1,enumerable:!0,get:function(t){return function(){return Up(e,t.Xd)}}(t),set:function(t){return function(n){var i=t.Xd;e.g.vb()?e.g.set("video",i,n):e.i[i]=n}}(t)});e.s={},Rp(e,(function(t){Object.defineProperty(e.s,t,{configurable:!1,enumerable:!0,get:function(){return _p(e,t)}})})),function(e){var t=new Map;Rp(e,(function(n,i){t.has(i)?(i=t.get(i),n.length<i.length?e.F.set(n,i):e.F.set(i,n)):t.set(i,n)}))}(e),e.m=new Lr,e.m.ze=e.j,e.o=new Lr,e.o.ze=e.s,e.l.D(e.h,"unloading",(function(){e.g&&e.g.vb()||Fp(e)}))}(this)):(this.j=this.i,this.s=this.h)}function Rp(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 Lp(e){var t={video:{},player:{},playerAfterLoad:{},manifest:e.h.nd(),startTime:null,addThumbnailsTrackCalls:e.C,addTextTrackAsyncCalls:e.B,addChaptersTrackCalls:e.A};e.i.pause();for(var n=l(lp),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(fp)).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(gp)).next();!i.done;i=n.next())i=(r=i.value)[1],r=e.h[r[0]](),t.playerAfterLoad[i]=r;return t}function Np(e){var t=new Dr("caststatuschanged");e.dispatchEvent(t)}function Op(e){var t=new Dr(e.j.paused?"pause":"play");e.m.dispatchEvent(t)}function jp(e){for(var t=l(fp),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.C,a=e.B,o=e.A;Fp(e);var s=e.g.get("player","getAssetUri")();i=e.g.get("video","ended"),t=Promise.resolve();var u,d=e.i.autoplay;n=null,i||(n=e.g.get("video","currentTime")),(i=e.g.get("player","getTextTracks")())&&i.length&&(u=i.find((function(e){return e.active})));var h=e.g.get("player","isTextTrackVisible")();s&&(e.i.autoplay=!1,t=e.h.load(s,n));var p={};for(i=(n=l(lp)).next();!i.done;i=n.next())i=i.value,p[i]=e.g.get("video",i);t.then((function(){if(e.i){for(var t=l(r),n=t.next();!n.done;n=t.next()){var i;n=n.value,(i=e.od()).He.apply(i,c(n))}for(i=(t=l(a)).next();!i.done;i=t.next()){var f;i=i.value,(f=e.od()).Hd.apply(f,c(i))}for(t=(f=l(o)).next();!t.done;t=f.next()){var g;t=t.value,(g=e.od()).Ge.apply(g,c(t))}for(f=(g=l(lp)).next();!f.done;f=g.next())f=f.value,e.i[f]=p[f];for(f=(g=l(gp)).next();!f.done;f=g.next())f=(t=f.value)[1],t=e.g.get("player",t[0])(),e.h[f](t);e.h.oh(h),u&&e.h.ih(u.language,u.roles,u.forced),e.i.autoplay=d,s&&e.i.play()}}),(function(t){t=new Dr("error",t=(new Map).set("detail",t)),e.h.dispatchEvent(t)}))}function Up(e,t){if("addEventListener"==t)return function(t,n,i){return e.m.addEventListener(t,n,i)};if("removeEventListener"==t)return function(t,n,i){return e.m.removeEventListener(t,n,i)};if(e.g.vb()&&0==Object.keys(e.g.g.video).length){var n=e.i[t];if("function"!=typeof n)return n}return e.g.vb()?e.g.get("video",t):("function"==typeof(t=e.i[t])&&(t=t.bind(e.i)),t)}function _p(e,t,n){if(n=void 0!==n&&n,e.F.has(t)&&(t=e.F.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.j};if("getSharedConfiguration"==t)return e.g.get("player","getConfiguration");if("getNetworkingEngine"==t)return function(){return e.h.Pb()};if("getDrmEngine"==t)return function(){return e.h.C};if("getAdManager"==t)return function(){return e.h.Uh()};if("getQueueManager"==t)return function(){return e.h.$h()};if("setVideoContainer"==t)return function(t){return e.h.Oi(t)};if(!n){if("addThumbnailsTrack"==t)return function(){var n=L.apply(0,arguments);return e.C.push(n),_p(e,t,!0).apply(null,c(n))};if("addTextTrackAsync"==t)return function(){var n=L.apply(0,arguments);return e.B.push(n),_p(e,t,!0).apply(null,c(n))};if("addChaptersTrack"==t)return function(){var n=L.apply(0,arguments);return e.A.push(n),_p(e,t,!0).apply(null,c(n))}}if(e.g.vb()){if("getManifest"==t||"drmInfo"==t)return function(){return q(t+"() does not work while casting!"),null};if("attach"==t||"detach"==t)return function(){return q(t+"() does not work while casting!"),Promise.resolve()};if("getChapters"==t)return function(){return q(t+"() does not work while casting!"),[]}}return e.g.vb()&&0==Object.keys(e.g.g.video).length&&(dp.has(t)||hp.has(t))||!e.g.vb()?e.h[t].bind(e.h):e.g.get("player",t)}function Bp(e,t,n){e.g.vb()&&("video"==t?e.m.dispatchEvent(n):"player"==t&&("unloading"==n.type&&Fp(e),e.o.dispatchEvent(n)))}function Fp(e){e.C=[],e.B=[],e.A=[]}function Vp(e,t,n,i){Lr.call(this);var r=this;this.h=e,this.g=t,this.j=new $,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 Ti((function(){zp(r)})),function(e){var t=cast.receiver.CastReceiverManager.getInstance();t.onSenderConnected=function(){return Hp(e)},t.onSenderDisconnected=function(){return Hp(e)},t.onSystemVolumeChanged=function(){var t=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();t&&Yp(e,{type:"update",update:{video:{volume:t.level,muted:t.muted}}},e.l),Yp(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=op(t.data);switch(n.type){case"PLAY":e.h.play(),Jp(e);break;case"PAUSE":e.h.pause(),Jp(e);break;case"SEEK":t=n.currentTime;var i=n.resumeState;null!=t&&(e.h.currentTime=Number(t)),i&&"PLAYBACK_START"==i?(e.h.play(),Jp(e)):i&&"PLAYBACK_PAUSE"==i&&(e.h.pause(),Jp(e));break;case"STOP":e.g.vc().then((function(){e.g&&Jp(e)}));break;case"GET_STATUS":Xp(e,Number(n.requestId));break;case"VOLUME":t=(i=n.volume).level,i=i.muted;var r=e.h.volume,a=e.h.muted;null!=t&&(e.h.volume=Number(t)),null!=i&&(e.h.muted=i),r==e.h.volume&&a==e.h.muted||Jp(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.h.autoplay=!0),e.g.load(r,i).then((function(){e.g&&Xp(e)})).catch((function(t){var i="LOAD_FAILED";7==t.category&&7e3==t.code&&(i="LOAD_CANCELLED"),Yp(e,{requestId:Number(n.requestId),type:i},e.s)}));break;default:Yp(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=op(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,d,h,p,f,g,m,v,y,b,S,E,I,C;R((function(M){switch(M.g){case 1:for(i in t.player)r=t.player[i],e.g[i](r);return e.F(n),a=e.h.autoplay,t.manifest?(e.h.autoplay=!1,x(M,5),w(M,e.g.load(t.manifest,t.startTime),7)):w(M,Promise.resolve(),3);case 7:if(t.addThumbnailsTrackCalls)for(o=l(t.addThumbnailsTrackCalls),s=o.next();!s.done;s=o.next())u=s.value,e.g.He.apply(e.g,c(u));if(t.addTextTrackAsyncCalls)for(d=l(t.addTextTrackAsyncCalls),h=d.next();!h.done;h=d.next())p=h.value,e.g.Hd.apply(e.g,c(p));if(t.addChaptersTrackCalls)for(f=l(t.addChaptersTrackCalls),g=f.next();!g.done;g=f.next())m=g.value,e.g.Ge.apply(e.g,c(m));A(M,3);break;case 5:return v=k(M),y=(new Map).set("detail",v),b=new Dr("error",y),e.g&&e.g.dispatchEvent(b),M.return();case 3:if(!e.g)return M.return();for(S in t.video)E=t.video[S],e.h[S]=E;for(I in t.playerAfterLoad)C=t.playerAfterLoad[I],e.g[I](C);e.h.autoplay=a,t.manifest&&(e.h.play(),Jp(e)),T(M)}}))}(e,n.initState,n.appData),zp(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(t){return Wp(e,o,a,null,t)}),(function(t){return Wp(e,o,a,t,null)}))}}(e,t)},t.start();for(var n=(t=l(sp)).next();!n.done;n=t.next())e.j.D(e.h,n.value,(function(t){return Gp(e,"video",t)}));for(var i in Rr)e.j.D(e.g,Rr[i],(function(t){return Gp(e,"player",t)}));e.j.D(e.h,"loadeddata",(function(){e.B=!0})),e.j.D(e.g,"loading",(function(){e.o=!1,Kp(e)})),e.j.D(e.h,"playing",(function(){e.o=!1,Kp(e)})),e.j.D(e.h,"pause",(function(){Kp(e)})),e.j.D(e.g,"unloading",(function(){e.o=!0,Kp(e)})),e.j.D(e.h,"ended",(function(){new Ti((function(){e.h&&e.h.ended&&(e.o=!0,Kp(e))})).ia(Qp)}))}(this)}function Hp(e){e.m=0,e.A=!0,e.G=0!=cast.receiver.CastReceiverManager.getInstance().getSenders().length,Kp(e)}function Kp(e){var t;R((function(n){return 1==n.g?w(n,Promise.resolve(),2):e.g?(t=new Dr("caststatuschanged"),e.dispatchEvent(t),qp(e)||Jp(e),void T(n)):n.return()}))}function Gp(e,t,n){e.g&&(zp(e),Yp(e,{type:"event",targetName:t,event:n},e.l))}function zp(e){e.C.ia($p);for(var t={video:{},player:{}},n=l(up),i=n.next();!i.done;i=n.next())i=i.value,t.video[i]=e.h[i];e.g.V()&&pp.forEach((function(n,i){0==e.m%n&&(t.player[i]=e.g[i]())})),dp.forEach((function(n,i){0==e.m%n&&(t.player[i]=e.g[i]())})),(n=cast.receiver.CastReceiverManager.getInstance().getSystemVolume())&&(t.video.volume=n.level,t.video.muted=n.muted),Yp(e,{type:"update",update:t},e.l),hp.forEach((function(t,n){0==e.m%t&&((t={player:{}}).player[n]=e.g[n](),Yp(e,{type:"update",update:t},e.l))})),e.B&&(e.m+=1),qp(e)}function qp(e){return!(!e.A||!e.h.duration&&!e.g.V()||(Xp(e),e.A=!1,0))}function Xp(e,t){var n={contentId:e.g.nd(),streamType:e.g.V()?"LIVE":"BUFFERED",contentType:""};e.g.V()||(n.duration=e.h.duration),e.i&&(n.metadata=e.i),Jp(e,void 0===t?0:t,n)}function Wp(e,t,n,i,r){e.g&&Yp(e,{type:"asyncComplete",id:n,error:i,res:r},e.l,t)}function Yp(e,t,n,i){e.G&&(e=ap(t),i?n.getCastChannel(i).send(e):n.broadcast(e))}function Jp(e,t,n){n=void 0===n?null:n;var i={mediaSessionId:0,playbackRate:e.h.playbackRate,playerState:e.o?Zp:e.g.Mg()?tf:e.h.paused?nf:ef,currentTime:e.h.currentTime,supportedMediaCommands:63,volume:{level:e.h.volume,muted:e.h.muted}};n&&(i.media=n),Yp(e,{requestId:void 0===t?0:t,type:"MEDIA_STATUS",status:[i]},e.s)}m(Pp,Lr),(i=Pp.prototype).destroy=function(e){return this.g&&void 0!==e&&e&&this.g.md(),this.l&&(this.l.release(),this.l=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.j=this.i=null,Lr.prototype.release.call(this),Promise.all(e)},i.Xj=function(){return this.j},i.od=function(){return this.s},i.hj=function(){return!!this.g&&this.g.m&&Ep},i.vb=function(){return!!this.g&&this.g.vb()},i.Zg=function(){return this.g?this.g.Zg():""},i.cast=function(){var e=this;return R((function(t){return 1==t.g?e.g?w(t,e.g.cast(),2):t.return():e.h?w(t,e.h.vc(),0):t.return()}))},i.kh=function(e){this.g&&this.g.kh(e)},i.Wk=function(){var e;this.g&&(e=this.g).i&&chrome.cast.requestSession((function(t){return bp(e,t)}),(function(t){return wp(e,t)}))},i.md=function(){this.g&&this.g.md()},i.ij=function(e,t){t=void 0!==t&&t;var n=this;return R((function(i){if(1==i.g)return e==n.H&&t==n.G?i.return():(n.H=e,n.G=t,n.g?(n.g.md(),w(i,n.g.destroy(),2)):i.return());n.g=null,n.g=new yp(e,(function(){return Np(n)}),(function(){return Op(n)}),(function(e,t){return Bp(n,e,t)}),(function(){return jp(n)}),(function(){return Lp(n)}),t),n.g.init(),T(i)}))},F("shaka.cast.CastProxy",Pp),Pp.prototype.changeReceiverId=Pp.prototype.ij,Pp.prototype.forceDisconnect=Pp.prototype.md,Pp.prototype.suggestDisconnect=Pp.prototype.Wk,Pp.prototype.setAppData=Pp.prototype.kh,Pp.prototype.cast=Pp.prototype.cast,Pp.prototype.receiverName=Pp.prototype.Zg,Pp.prototype.isCasting=Pp.prototype.vb,Pp.prototype.canCast=Pp.prototype.hj,Pp.prototype.getPlayer=Pp.prototype.od,Pp.prototype.getVideo=Pp.prototype.Xj,Pp.prototype.destroy=Pp.prototype.destroy,m(Vp,Lr),(i=Vp.prototype).isConnected=function(){return this.G},i.ek=function(){return this.o},i.Tk=function(e){this.i=e},i.mj=function(){this.i=null},i.Uk=function(e){this.i||(this.i={metadataType:cast.receiver.media.MetadataType.GENERIC}),this.i.title=e},i.Sk=function(e){this.i||(this.i={metadataType:cast.receiver.media.MetadataType.GENERIC}),this.i.images=[{url:e}]},i.Rk=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 R((function(n){if(1==n.g)return t.j&&(t.j.release(),t.j=null),e=[],t.g&&(e.push(t.g.destroy()),t.g=null),t.C&&(t.C.stop(),t.C=null),t.h=null,t.H=null,t.F=null,t.G=!1,t.o=!0,t.l=null,t.s=null,Lr.prototype.release.call(t),w(n,Promise.all(e),2);cast.receiver.CastReceiverManager.getInstance().stop(),T(n)}))},F("shaka.cast.CastReceiver",Vp),Vp.prototype.destroy=Vp.prototype.destroy,Vp.prototype.setContentArtist=Vp.prototype.Rk,Vp.prototype.setContentImage=Vp.prototype.Sk,Vp.prototype.setContentTitle=Vp.prototype.Uk,Vp.prototype.clearContentMetadata=Vp.prototype.mj,Vp.prototype.setContentMetadata=Vp.prototype.Tk,Vp.prototype.isIdle=Vp.prototype.ek,Vp.prototype.isConnected=Vp.prototype.isConnected;var $p=.5,Qp=5,Zp="IDLE",ef="PLAYING",tf="BUFFERING",nf="PAUSED";function rf(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=af(i,r,s,u,l,c);a<=o;a++){for(var h=n[a],p=-1,f=-1,g=0;g<h.length;g++)if(null!=h[g]&&""!==h[g].g.trim()){p=g;break}for(g=h.length-1;0<=g;g--)if(null!=h[g]&&""!==h[g].g.trim()){f=g;break}if(-1===p||-1===f)h=of(i,r),e.nestedCues.push(h);else{for(;p<=f;p++)if(g=h[p]){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=af(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=of(i,r),e.nestedCues.push(d)),d=af(i,r,s,u,l,c)}}return e.nestedCues.length?{cue:e,stream:t}:null}function af(e,t,n,i,r,a){return e=new Tn(e,t,""),n&&e.textDecoration.push(zn),i&&(e.fontStyle=Kn),e.color=r,e.backgroundColor=a,e}function of(e,t){return(e=new Tn(e,t,"")).lineBreak=!0,e}function sf(e,t,n,i,r){this.g=e,this.l=t,this.i=n,this.h=i,this.j=r}function uf(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,cf(this)}function lf(e,t,n){var i="CC"+(1+(e.C<<1|e.B)),r=new Tn(t,n,"");r.lineInterpretation=1;var a=yf.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=rf(r,i,e.i,t,n))&&15<e.g+t.cue.nestedCues.length-3&&(a=yf.get(e.g+3-t.cue.nestedCues.length))&&(r.line=a),t}function cf(e){pf(e,0,15),e.g=1}function df(e,t,n){if(!(32>n||127<n)){var i="";switch(t){case 0:i=ff.has(n)?ff.get(n):String.fromCharCode(n);break;case 1:i=gf.get(n);break;case 2:e.i[e.g].pop(),i=mf.get(n);break;case 3:e.i[e.g].pop(),i=vf.get(n)}i&&e.i[e.g].push(new sf(i,e.m,e.j,e.o,e.l))}}function hf(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 pf(e,t,n){for(var i=0;i<=n;i++)e.i[t+i]=[]}var ff=new Map([[39,"’"],[42,"á"],[92,"é"],[92,"é"],[94,"í"],[95,"ó"],[96,"ú"],[123,"ç"],[124,"÷"],[125,"Ñ"],[126,"ñ"],[127,"█"]]),gf=new Map([[48,"®"],[49,"°"],[50,"½"],[51,"¿"],[52,"™"],[53,"¢"],[54,"£"],[55,"♪"],[56,"à"],[57," "],[58,"è"],[59,"â"],[60,"ê"],[61,"î"],[62,"ô"],[63,"û"]]),mf=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,"»"]]),vf=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,"┘"]]),yf=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 bf(e,t){this.h=0,this.o=new uf(e,t),this.i=new uf(e,t),this.g=this.j=new uf(e,t),this.l=0,this.m=null}function wf(e,t,n){e.g=e.i;var i=e.g,r=null;return 3!==e.h&&4!==e.h&&(r=lf(i,e.l,n),(n=e.i).g=0<n.h?n.h:0,pf(n,0,15),(n=e.j).g=0<n.h?n.h:0,pf(n,0,15),i.g=15),e.h=3,i.h=t,r}function Tf(e){e.h=1,e.g=e.j,e.g.h=0}function xf(e){X("Cea608DataChannel","CEA-608 text mode entered, but is unsupported"),e.g=e.o,e.h=4}var Sf="black green blue cyan red yellow magenta black".split(" "),Af="white green blue cyan red yellow magenta white_italics".split(" ");function kf(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",Ef(this)}function Ef(e){e.i=[];for(var t=0;16>t;t++)e.i.push(If())}function If(){for(var e=[],t=0;42>t;t++)e.push(null);return e}function Cf(e,t){Mf(e)&&(e.i[e.h][e.g]=new sf(t,e.C,e.A,e.s,e.B),e.g++)}function Mf(e){var t=e.g<e.m&&0<=e.g;return e.h<e.o&&0<=e.h&&t}function Df(e,t,n){var i=new Tn(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?kt: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=rf(i,"svc"+n,e.i,e.j,t))&&(e.j=t),n}function Pf(){this.i=[],this.h=null,this.g=0}function Rf(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 Lf(e.h)),e.h=null,e.g=0))}function Lf(e){this.g=0,this.h=e}function Nf(e){if(!e.Ga())throw new Ne(2,2,3e3);return e.h[e.g++]}function Of(e){this.i=e,this.h=[null,null,null,null,null,null,null,null],this.g=null}function jf(e,t,n,i){if(!e.g)return[];if(24==n)return n=[n=Nf(t).value,i=Nf(t).value].map((function(e){return("0"+(255&e).toString(16)).slice(-2)})).join(""),Cf(e.g,String.fromCharCode(parseInt(n,16))),[];t=e.g;var r=null;switch(n){case 8:!Mf(t)||0>=t.g&&0>=t.h||(0>=t.g?(t.g=t.m-1,t.h--):t.g--,t.i[t.h][t.g]=null);break;case 13:t.isVisible()&&(r=Df(t,i,e.i)),t.h+1>=t.o?function(e){for(var t=0,n=1;16>n;n++,t++)e.i[t]=e.i[n];for(n=0;1>n;n++,t++)e.i[t]=If()}(t):t.h++,t.g=0;break;case 14:t.isVisible()&&(r=Df(t,i,e.i)),t.i[t.h]=If(),t.g=0;break;case 12:t.isVisible()&&(r=Df(t,i,e.i)),Ef(t),t.h=0,t.g=0}return r?[r]:[]}function Uf(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=Nf(t).value,t=[];for(var r=(n=l(_f(e,n))).next();!r.done;r=n.next()){if((r=e.h[r.value]).isVisible()){var a=Df(r,i,e.i);a&&t.push(a)}Ef(r)}return t}if(137===n)for(n=(t=l(_f(e,t=Nf(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=Nf(t).value,t=null,r=(n=l(_f(e,n))).next();!r.done;r=n.next())(r=e.h[r.value]).isVisible()&&(t=Df(r,i,e.i)),r.l=!1;return t?[t]:[]}if(139===n){for(n=Nf(t).value,t=null,r=(n=l(_f(e,n))).next();!r.done;r=n.next())(r=e.h[r.value]).isVisible()?t=Df(r,i,e.i):r.j=i,r.l=!r.l;return t?[t]:[]}if(140===n)return Bf(e,t=Nf(t).value,i);if(143===n)return i=Bf(e,255,i),Ff(e),i;if(144===n)t.skip(1),i=Nf(t).value,e.g&&(e.g.A=0<(128&i),e.g.C=0<(64&i));else if(145===n)i=Nf(t).value,n=Nf(t).value,t.skip(1),e.g&&(t=Vf((48&n)>>4,(12&n)>>2,3&n),e.g.B=Vf((48&i)>>4,(12&i)>>2,3&i),e.g.s=t);else if(146===n)i=Nf(t).value,t=Nf(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=Nf(t).value,t.skip(1),e.g&&(e.g.F=3&i);else if(152<=n&&159>=n){n=(15&n)-8,(r=null!==e.h[n])||((a=new kf(n,e.i)).j=i,e.h[n]=a),i=Nf(t).value,a=Nf(t).value;var o=Nf(t).value,s=Nf(t).value,u=Nf(t).value;t=Nf(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[]}function _f(e,t){for(var n=[],i=0;8>i;i++)!(1&~t)&&e.h[i]&&n.push(i),t>>=1;return n}function Bf(e,t,n){for(var i=[],r=(t=l(_f(e,t))).next();!r.done;r=t.next()){r=r.value;var a=e.h[r];a.isVisible()&&(a=Df(a,n,e.i))&&i.push(a),e.h[r]=null}return i}function Ff(e){e.g=null,e.h=[null,null,null,null,null,null,null,null]}function Vf(e,t,n){var i={0:0,1:0,2:1,3:1};return Kf[(e=i[e])<<2|(t=i[t])<<1|(n=i[n])]}kf.prototype.isVisible=function(){return this.l},kf.prototype.display=function(){this.l=!0},Lf.prototype.Ga=function(){return this.g<this.h.length},Lf.prototype.Ma=function(){return this.g},Lf.prototype.skip=function(e){if(this.g+e>this.h.length)throw new Ne(2,2,3e3);this.g+=e},Lf.prototype.Ei=function(e){if(0>this.g-e)throw new Ne(2,2,3e3);this.g-=e};var Hf=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,"┌"]]),Kf="black blue green cyan red magenta yellow white".split(" ");function Gf(){this.h=[],this.g=[],this.i=new Pf,this.l=0,this.m=new Map([["CC1",new bf(0,0)],["CC2",new bf(0,1)],["CC3",new bf(1,0)],["CC4",new bf(1,1)]]),this.s=this.o=0,this.j=new Map,this.B=!0,this.A=new Set,zf(this)}function zf(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,cf(n.i),cf(n.j),cf(n.o);e.B=!0}function qf(e,t){var n=t.type;if(16==(112&t.Bb)){var i=t.Bb>>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.Bb&&255===t.hc||!t.Bb&&!t.hc||!Wf(t.Bb)||!Wf(t.hc))return 45<=++e.l&&zf(e),null;e.l=0,t.Bb&=127,t.hc&=127;var r=t.Bb;if(1<=r&&15>=r||!t.Bb&&!t.hc)return null;if(r=null,16==(112&t.Bb))e:{if(e.A.add(i),i=t.Bb,e=t.hc,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=Af[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&&(hf(o,n=1+t-o.h,1+o.g-o.h,o.h),pf(o,0,n-1),pf(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",df(n.g,0,32),i=!1,"white_italics"===(t=Af[(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=Sf[(14&e)>>1]),n.g.o=t;else if(17==(247&i)&&48==(240&e))df(n.g,1,e);else if(18==(246&i)&&32==(224&e))df(n.g,1&i?3:2,e);else{if(20==(246&i)&&32==(240&e)){switch(e=t.pts,i=null,t.hc){case 32:Tf(n);break;case 33:(n=n.g).i[n.g].pop();break;case 37:i=wf(n,2,e);break;case 38:i=wf(n,3,e);break;case 39:i=wf(n,4,e);break;case 40:df(n.g,0,32);break;case 41:n.h=2,n.g=n.i,n.g.h=0,n.l=e;break;case 42:cf(n.o),xf(n);break;case 43:xf(n);break;case 44:t=n.i,i=null,4!==n.h&&(i=lf(t,n.l,e)),pf(t,0,15);break;case 45:t=n.g,3!==n.h?i=null:(i=lf(t,n.l,e),hf(t,(r=t.g-t.h+1)-1,r,t.h),pf(t,0,r-1),pf(t,t.g,15-t.g),n.l=e);break;case 46:pf(n.j,0,15);break;case 47:t=null,4!==n.h&&(t=lf(n.i,n.l,e)),i=n.j,n.j=n.i,n.i=i,Tf(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.hc,df(n.g,0,t.Bb),df(n.g,0,e);return r}function Xf(e,t){var n=[];try{for(;t.Ga();){var i=Nf(t).value,r=(224&i)>>5,a=31&i;if(7===r&&0!=a&&(r=63&Nf(t).value),0!=r){e.A.add("svc"+r),e.j.has(r)||e.j.set(r,new Of(r));for(var o=e.j.get(r),s=t.Ma();t.Ma()-s<a;){r=o;var u=t,l=Nf(u),d=l.value,h=l.pts;if(16===d&&(d=d<<16|Nf(u).value),0<=d&&31>=d)var p=jf(r,u,d,h);else if(128<=d&&159>=d)p=Uf(r,u,d,h);else{if(4096<=d&&4127>=d)r=u,8<=(u=255&d)&&15>=u?r.skip(1):16<=u&&23>=u?r.skip(2):24<=u&&31>=u&&r.skip(3);else if(4224<=d&&4255>=d)r=u,128<=(u=255&d)&&135>=u?r.skip(4):136<=u&&143>=u&&r.skip(5);else if(32<=d&&127>=d)u=d,r.g&&Cf(r.g,127===u?"♪":String.fromCharCode(u));else if(160<=d&&255>=d)r.g&&Cf(r.g,String.fromCharCode(d));else if(4128<=d&&4223>=d){if(u=255&d,r.g)if(Hf.has(u)){var f=Hf.get(u);Cf(r.g,f)}else Cf(r.g,"_")}else 4256<=d&&4351>=d&&r.g&&Cf(r.g,160!=(255&d)?"_":"[CC]");p=[]}n.push.apply(n,c(p))}}}}catch(e){if(!(e instanceof Ne&&3e3===e.code))throw e;X("CEA708_INVALID_DATA","Buffer read out of bounds / invalid CEA-708 Data.")}return n}function Wf(e){for(var t=0;e;)t^=1&e,e>>=1;return 1===t}function Yf(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 Jf(){this.j=new Map,this.i=this.h=0,this.g=Qf}function $f(e,t,n,i,r,a,o,s,u){var d=0,h=a,p=s.map((function(e){return e.gh}));for((p=[].concat.apply([],c(p))).length&&(h=p[0].sampleSize||a),t.skip(o+s[0].mg);t.Ga();){o=t.T();var f=t.X(),g=null;switch(g=!1,s=1,e.g){case Zf:g=6==(g=31&f);break;case eg:s=2,t.skip(1),g=39==(g=f>>1&63)||40==g;break;case tg:s=2,t.skip(1),g=23==(g=f>>1&63)||24==g;break;default:return}if(g)for(f=0,d<p.length&&(f=p[d].Bf||0),f=(n+f)/i,g=(s=l(Yf(t.Ub(o-s)))).next();!g.done;g=s.next())u.push({packet:g.value,pts:f});else try{t.skip(o-s)}catch(e){break}0==(h-=o+4)&&(n=d<p.length?n+(p[d].hh||r):n+r,h=++d<p.length&&p[d].sampleSize||a)}}Gf.prototype.clear=function(){this.l=0,this.h=[],this.g=[];var e=this.i;e.i=[],e.h=[],e.g=0,zf(this);for(var t=(e=l(this.j.values())).next();!t.done;t=e.next())Ff(t.value)},Gf.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 Qr(e,0)).getLength())&&181===e.X()&&49===e.Ba()&&1195456820===e.T()&&3===e.X()&&64&(n=e.X()))for(n&=31,e.skip(1),i=0;i<n;i++){var r=e.X(),a=(4&r)>>2,o=e.X(),s=e.X();a&&(0==(r&=3)||1===r?this.h.push({pts:t,type:r,Bb:o,hc: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})))}},Gf.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=qf(this,i.value))&&t.push(i);for(i=(n=l(this.g)).next();!i.done;i=n.next())Rf(this.i,i.value);for(i=(n=l(this.i.i)).next();!i.done;i=n.next())i=Xf(this,i.value),t.push.apply(t,c(i));return this.i.i=[],this.h=[],this.g=[],t},Gf.prototype.getStreams=function(){return Array.from(this.A)},F("shaka.cea.CeaDecoder",Gf),St=function(){return new Gf},Jf.prototype.init=function(e){function t(e){e=e.name,ng.has(e)&&(n.g=ng.get(e))}var n=this,i=[],r=[];if((new ta).box("moov",na).box("mvex",na).R("trex",(function(e){var t=e.reader;t.skip(4),t.skip(4),e=t.T(),t=t.T(),n.h=e,n.i=t})).box("trak",na).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.T();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.Ba(),t.Ba(),t.Ba(),t.Ba(),i.push(n)})).box("mdia",na).R("mdhd",(function(e){e=no(e.reader,e.version),r.push(e.timescale)})).box("minf",na).box("stbl",na).R("stsd",ia).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",ra).box("sinf",na).box("frma",(function(e){e=ao(e.reader).codec,ng.has(e)&&(n.g=ng.get(e))})).parse(e,!0,!0),!i.length||!r.length||i.length!=r.length)throw new Ne(2,2,2010);this.g==Qf&&q("Unable to determine bitstream format for CEA parsing!"),i.forEach((function(e,t){n.j.set(e,r[t])}))},Jf.prototype.parse=function(e){var t=this;if(this.g==Qf)return[];var n=[],i=0,r=[];return(new ta).box("moof",(function(e){i=e.start,r=[],na(e)})).box("traf",(function(e){r.push({baseMediaDecodeTime:null,Md:t.h,Nd:t.i,ti:[],timescale:9e4}),na(e)})).R("trun",(function(e){var t=r[r.length-1];e=io(e.reader,e.version,e.flags),t.ti.push(e)})).R("tfhd",(function(e){var n=r[r.length-1];e=eo(e.reader,e.flags),n.Md=e.Md||t.h,n.Nd=e.Nd||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=to(e.reader,e.version),t.baseMediaDecodeTime=e.baseMediaDecodeTime})).box("mdat",(function(e){for(var a=i-e.start-8,o=e.reader.Ma(),s=l(r),u=s.next();!u.done;u=s.next())null===(u=u.value).baseMediaDecodeTime?q("Unable to find base media decode time for CEA captions!"):(e.reader.seek(o),$f(t,e.reader,u.baseMediaDecodeTime,u.timescale,u.Md,u.Nd,a,u.ti,n))})).parse(e,!1,!0),n},F("shaka.cea.Mp4CeaParser",Jf);var Qf=0,Zf=1,eg=2,tg=3,ng=(new Map).set("avc1",Zf).set("avc3",Zf).set("dvav",Zf).set("dva1",Zf).set("hev1",eg).set("hvc1",eg).set("dvh1",eg).set("dvhe",eg).set("vvc1",tg).set("vvi1",tg).set("dvc1",tg).set("dvi1",tg);function ig(){this.g=null}function rg(e){return(e=function(e){var t=0,n=Re(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=De(n,e,r);t.push({type:i,value:a}),e+=r}n=t}return n}(e=We(Wt(e))).filter((function(e){return e.type===og}))[0])&&(e=Kt(e=_e(e.value,!0),"WRMHEADER"))?e:null}function ag(e){try{var t=rg(e);if(t)e:{for(var n=l(Jt(t,"DATA")),i=n.next();!i.done;i=n.next()){var r=i.value;if(r.children)for(var a=l(r.children),o=a.next();!o.done;o=a.next()){var s=o.value;if("LA_URL"==s.tagName){var u=Wt(s);break e}}}u=""}else u="";return u}catch(e){return""}}wt("video/mp4",(function(){return new Jf})),ig.prototype.init=function(){},ig.prototype.parse=function(e){this.g?this.g.clearData():this.g=new Ss;var t=[];if(!Is(e=De(e)))return t;var n=(e=this.g.parse(e)).Od(),i=e.Xe();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(Yf(i.data)),a=r.next();!a.done;a=r.next())t.push({packet:a.value,pts:i.time});return t},F("shaka.cea.TsCeaParser",ig),wt("video/mp2t",(function(){return new ig}));var og=1;function sg(t,n,i){var r=function(e){for(var t=[],n=(e=l(e)).next();!n.done;n=e.next())(n=lg(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 Ne(2,4,4010);if(!n){if(1<(o=r.filter((function(e){return"urn:mpeg:dash:sea:2012"==e.Bd}))).length)throw new Ne(2,4,4050);o.length&&(s=function(t){if(!e.crypto||!e.crypto.subtle)throw q("Web Crypto API is not available to decrypt AES-128. (Web Crypto only exists in secure origins like https)"),new Ne(2,4,4042);var n=Qt(t.node,"urn:mpeg:dash:schema:sea:2012","SegmentEncryption");if(!n)throw new Ne(2,4,4051);if("urn:mpeg:dash:sea:aes128-cbc:2013"!=n.attributes.schemeIdUri)throw new Ne(2,4,4051);if(!(n=Qt(t.node,"urn:mpeg:dash:schema:sea:2012","CryptoPeriod")))throw new Ne(2,4,4051);if(t=n.attributes.IV,n=Ke(n.attributes.keyUriTemplate),!t||!n)throw new Ne(2,4,4051);if(16!=(t=Ye(t.substr(2))).byteLength)throw new Ne(2,4,4048);return{kk:n,iv:t}}(o[0])),(o=r.find((function(e){return"urn:mpeg:dash:mp4protection:2011"==e.Bd})))&&o.encryptionScheme&&(c=o.encryptionScheme),(o=r.filter((function(e){return"urn:mpeg:dash:mp4protection:2011"==e.Bd?(a=e.init||a,!1):"urn:mpeg:dash:sea:2012"!=e.Bd}))).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).Bd];if(s){var u;if((u=Qt(o.node,"urn:microsoft:playready","pro"))&&Wt(u)){u=We(u=Wt(u));var c=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);u=[{initData:pa(u,c,new Set,0),initDataType:"cenc",keyId:o.keyId}]}else u=null;if(c=null,"urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e"===o.Bd){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:pa(new Uint8Array([]),h,d,1),initDataType:"cenc",keyId:c.keyId}]}}u=Ze(s,t,o.init||e||u||c),(s=cg.get(s))&&(u.licenseServerUri=s(o)),a.push(u)}}return a}(a,c,o,i,u),0==t.length&&(t=[Ze("",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(Ze(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{Oh:u,vm:a,drmInfos:t,cg:s,Th:!0}}function ug(e){var t=Qt(e.node,"https://dashif.org/CPS","Laurl");if(t&&(t=Wt(t)))return t;if((t=Qt(e.node,"urn:microsoft:playready","pro"))&&Wt(t))return ag(t);if((e=Qt(e.node,"urn:mpeg:cenc:2013","pssh"))&&(e=Wt(e))){t=We(e),e=8;var n=(t=Re(t)).getUint8(e);return e+=20,0<n&&(e+=4+16*t.getUint32(e)),ag(e=Kt("<pro>"+(e=qe(e=De(t,e+4)))+"</pro>"))}return""}function lg(e){var t=e.attributes.schemeIdUri,n=en(e,"urn:mpeg:cenc:2013","default_KID"),i=tn(e,"urn:mpeg:cenc:2013","pssh").map(Yt),r=e.attributes.value;if(!t)return null;if(t=t.toLowerCase(),n&&(n=n.replace(/-/g,"").toLowerCase()).includes(" "))throw new Ne(2,4,4009);var a=[];try{a=i.map((function(e){return{initDataType:"cenc",initData:We(e),keyId:null}}))}catch(e){throw new Ne(2,4,4007)}return{node:e,Bd:t,keyId:n,init:0<a.length?a:null,encryptionScheme:r}}var cg=(new Map).set("com.apple.fps",(function(t){if("apple"===e.shakaMediaKeysPolyfill)throw new Ne(2,4,4054);return(t=Qt(t.node,"https://dashif.org/CPS","Laurl"))&&(t=Wt(t))?t:""})).set("com.widevine.alpha",(function(e){var t=Qt(e.node,"https://dashif.org/CPS","Laurl");return t&&(t=Wt(t))?t:(e=Qt(e.node,"urn:microsoft","laurl"))&&Ke(e.attributes.licenseUrl)||""})).set("com.microsoft.playready",ug).set("com.microsoft.playready.recommendation",ug).set("com.microsoft.playready.software",ug).set("com.microsoft.playready.hardware",ug).set("org.w3.clearkey",(function(e){var t=Qt(e.node,"https://dashif.org/CPS","Laurl");return t&&(t=Wt(t))?t:(e=Qt(e.node,"http://dashif.org/guidelines/clearKey","Laurl"))&&"EME-1.0"===e.attributes.Lic_type&&e&&(e=Wt(e))?e:""}));function dg(t,n,i,r,a,o){var s=(new Map).set("RepresentationID",n).set("Number",i).set("SubNumber",r).set("Bandwidth",a).set("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.get(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))&&q("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 hg(e,t){var n=fg(e,t,"timescale"),i=1;n&&(i=un(n)||1);var r=(n=un((n=fg(e,t,"duration"))||""))?n/i:null,a=fg(e,t,"startNumber"),o=Number(fg(e,t,"presentationTimeOffset"))||0,s=ln(a||"");if(null!=a&&null!=s||(s=1),a=null,t=gg(e,t,"SegmentTimeline")){t=Xt(t,"S"),a=i,e=e.ma.duration||1/0;for(var u=s,l=[],c=-o,d=0;d<t.length;++d){var h=t[d],p=t[d+1],f=Zt(h,"t",ln),g=Zt(h,"d",ln),m=Zt(h,"r",sn);if(h=Zt(h,"k",sn)||0,null!=f&&(f-=o),g){if(f=null!=f?f:c,0>(m=m||0))if(p){if(null==(p=Zt(p,"t",ln)))break;if(f>=p)break;m=Math.ceil((p-f)/g)-1}else{if(1/0==e)break;if(f/a>=e)break;m=Math.ceil((e*a-f)/g)-1}for(0<l.length&&f!=c&&(l[l.length-1].end=f/a),p=0;p<=m;++p)c=f+g,l.push({start:f/a,end:c/a,Bh:f,rc:h,Nk:l.length+u}),f=c}}a=l}return{timescale:i,Kf:n,gb:r,ie:s,Ib:o/i||0,dd:o,timeline:a}}function pg(e,t){return[t(e.J),t(e.oa),t(e.ra)].filter(Ai)}function fg(e,t,n){t=pg(e,t),e=null;for(var i=(t=l(t)).next();!i.done&&!(e=i.value.attributes[n]);i=t.next());return e}function gg(e,t,n){t=pg(e,t),e=null;for(var i=(t=l(t)).next();!i.done&&!(e=$t(i.value,n));i=t.next());return e}function mg(e,t,n,i,r,a){if(a=void 0===a?0:a,en(e,"http://www.w3.org/1999/xlink","href")){var o=function(e,t,n,i,r,a){for(var o=en(e,"http://www.w3.org/1999/xlink","href"),s=en(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=Gt("http://www.w3.org/1999/xlink");d[0]==h&&delete e.attributes[c]}if(5<=a)return kr(new Ne(2,4,4028));if("onLoad"!=s)return kr(new Ne(2,4,4027));var p=Qe([i],[o]);return r.request(0,Br(p,t)).Va((function(i){if(!(i=Ht(i.data,e.tagName)))return kr(new Ne(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 mg(e,t,n,p[0],r,a+1)}))}(e,t,n,i,r,a);return n&&(o=o.Va(void 0,(function(){return mg(e,t,n,i,r,a)}))),o}o=[];for(var s=l(qt(e)),u=s.next(),c={};!u.done;c={Jd:void 0},u=s.next())c.Jd=u.value,"urn:mpeg:dash:resolve-to-zero:2013"==en(c.Jd,"http://www.w3.org/1999/xlink","href")?e.children=e.children.filter(function(e){return function(t){return t!==e.Jd}}(c)):"SegmentTimeline"!=c.Jd.tagName&&o.push(mg(c.Jd,t,n,i,r,a));return Mr(o).Va((function(){return e}))}function vg(e){this.h=Re(e),this.g=new Qr(this.h,0)}function yg(e){var t=bg(e);if(7<t.length)throw new Ne(2,3,3002);for(var n=0,i=(t=l(t)).next();!i.done;i=t.next())n=256*n+i.value;t=bg(e);e:{for(var r=(i=l(wg)).next();!r.done;r=i.next())if(Ce(t,new Uint8Array(r.value))){i=!0;break e}i=!1}if(i)t=e.h.byteLength-e.g.Ma();else{if(8==t.length&&224&t[1])throw new Ne(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.Ma()+t<=e.h.byteLength?t:e.h.byteLength-e.g.Ma(),i=Re(e.h,e.g.Ma(),t),e.g.skip(t),new Tg(n,i)}function bg(e){var t=e.g.Ma(),n=e.g.X();if(0==n)throw new Ne(2,3,3002);return n=8-Math.floor(Math.log2(n)),e.g.skip(n-1),De(e.h,t,n)}vg.prototype.Ga=function(){return this.g.Ga()};var wg=[[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 Tg(e,t){this.id=e,this.g=t}function xg(e){if(8<e.g.byteLength)throw new Ne(2,3,3002);if(8==e.g.byteLength&&224&e.g.getUint8(0))throw new Ne(2,3,3001);for(var t=0,n=0;n<e.g.byteLength;n++)t=256*t+e.g.getUint8(n);return t}function Sg(e){var t=new vg(e.g);if(179!=(e=yg(t)).id)throw new Ne(2,3,3013);if(e=xg(e),183!=(t=yg(t)).id)throw new Ne(2,3,3012);t=new vg(t.g);for(var n=0;t.Ga();){var i=yg(t);if(241==i.id){n=xg(i);break}}return{al:e,Fk:n}}function Ag(e,t,n){if(!(t=gg(e,t,"Initialization")))return null;var i=e.J.cb(),r=t.attributes.sourceURL;r&&(i=Qe(i,[Ke(r)],e.Lb())),r=0;var a=null;return(t=Zt(t,"range",on))&&(r=t.start,a=t.end),(n=new Bo((function(){return i}),r,a,Mg(e),null,null,n,e.oa.encrypted)).codecs=e.J.codecs,n.mimeType=e.J.mimeType,e.ma&&!e.ma.bf&&(n.g=e.ma.start+e.ma.duration),n}function kg(e,t,n,i,r,a,o){var s,u,c,d,h,p,f,g,m,v,y,b,T,x,S,A,k,E;return R((function(I){if(1==I.g)return s=e.presentationTimeline,u=!e.Db||!e.ma.bf,c=e.ma.start,d=e.ma.duration,h=e.J.mimeType.split("/")[1],f=null,g=[(p=t)(i,r,a,!1),"webm"==h?p(n.O(),n.startByte,n.endByte,!0):null],p=null,w(I,Promise.all(g),2);if(m=I.h,v=m[0],y=m[1]||null,T=c-o,x=c,S=d?c+d:1/0,"mp4"==h)var C=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.T();if(0==u)throw new Ne(2,3,3005);if(0==o.version)var l=o.reader.T(),c=o.reader.T();else l=o.reader.yd(),c=o.reader.yd();o.reader.skip(2);var d=o.reader.Ba();for(e=e+o.size+c,c=0;c<d;c++){var h=o.reader.T(),p=(2147483648&h)>>>31;h&=2147483647;var f=o.reader.T();if(o.reader.skip(4),1==p)throw new Ne(2,3,3006);s.push(new Vo(l/u+n,(l+f)/u+n,(function(){return a}),e,e+h-1,t,n,i,r)),l+=f,e+=h}return o.parser.stop(),s}(t,i,r,a,o,n,e)}));if(e&&u.parse(e),s)return s;throw new Ne(2,3,3004)}(v,r,i,n,T,x,S);else{C=v;var M=new vg(y);if(440786851!=yg(M).id)throw new Ne(2,3,3008);var D=yg(M);if(408125543!=D.id)throw new Ne(2,3,3009);M=D.g.byteOffset,D=new vg(D.g);for(var P=null;D.Ga();){var R=yg(D);if(357149030==R.id){P=R;break}}if(!P)throw new Ne(2,3,3010);for(P=new vg(P.g),R=1e6,D=null;P.Ga();){var L=yg(P);if(2807729==L.id)R=xg(L);else if(17545==L.id)if(4==L.g.byteLength)D=L.g.getFloat32(0);else{if(8!=L.g.byteLength)throw new Ne(2,3,3003);D=L.g.getFloat64(0)}}if(null==D)throw new Ne(2,3,3011);if(D*=P=R/1e9,475249515!=(C=yg(new vg(C))).id)throw new Ne(2,3,3007);C=function(e,t,n,i,r,a,o,s,u){function l(){return r}var c=[];e=new vg(e.g);for(var d=null,h=null;e.Ga();){var p=yg(e);if(187==p.id){var f=Sg(p);f&&(p=n*f.al,f=t+f.Fk,null!=d&&c.push(new Vo(d+o,p+o,l,h,f-1,a,o,s,u)),d=p,h=f)}}return null!=d&&c.push(new Vo(d+o,i+o,l,h,null,a,o,s,u)),c}(C,M,P,D,i,n,T,x,S)}for(A=l(b=C),k=A.next();!k.done;k=A.next())(E=k.value).codecs=e.J.codecs,E.mimeType=e.J.mimeType,E.bandwidth=e.bandwidth;return s.$d(b),f=new Du(b),u&&f.ld(x,S,!0),I.return(f)}))}function Eg(e){return e.Cd}function Ig(e){var t=gg(e,Eg,"RepresentationIndex");return e=on((e=fg(e,Eg,"indexRange"))||""),t&&(e=Zt(t,"range",on,e)),e}function Cg(e,t){var n=e.J.mimeType.split("/")[1];if(e.J.contentType!=rt&&"mp4"!=n&&"webm"!=n)throw new Ne(2,4,4006);if("webm"==n&&!t)throw new Ne(2,4,4005)}function Mg(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.qf,pixelAspectRatio:t.pixelAspectRatio||null,width:t.width||null,label:e.oa.label||null,roles:e.roles||null,language:e.oa.language||null}}function Dg(e){return e.tc}function Pg(t,n,i,r,a,o,s,u,c,d){c||t.J.Ze||(t.J.Ze=fg(t,Rg,"initialization"));var h=t.J.Ze?function(e,t){var n=e.J.Ze;if(n||(n=fg(e,Rg,"initialization")),!n)return null;n=Ke(n);var i=e.J.originalId,r=e.bandwidth||null,a=e.J.cb,o=e.Lb;return t=new Bo((function(){var e=dg(n,i,null,null,r,null);return Qe(a(),[e],o())}),0,null,Mg(e),null,null,t,e.oa.encrypted),t.codecs=e.J.codecs,t.mimeType=e.J.mimeType,e.ma&&!e.ma.bf&&(t.g=e.ma.start+e.ma.duration),t}(t,s):null,p=function(e){var t=hg(e,Rg),n=fg(e,Rg,"media"),i=fg(e,Rg,"index"),r=fg(e,Rg,"k"),a=0;return r&&(a=parseInt(r,10)),{Kf:t.Kf,gb:t.gb,timescale:t.timescale,ie:t.ie,Ib:t.Ib,dd:t.dd,timeline:t.timeline,ac:n&&Ke(n),Vd:i,mimeType:e.J.mimeType,codecs:e.J.codecs,bandwidth:e.bandwidth,vk:a}}(t);!function(e){var t=e.Vd?1:0;if(t+=e.timeline?1:0,0==(t+=e.gb?1:0))throw new Ne(2,4,4002);if(1!=t&&(e.Vd&&(e.timeline=null),e.Kf=null,e.gb=null),!e.Vd&&!e.ac)throw new Ne(2,4,4002)}(p);var f=Ft(t);if(p.Vd)return Cg(t,h),{endTime:-1,timeline:-1,Oc:function(){var e=dg(p.Vd,f.J.originalId,null,null,f.bandwidth||null,null);return e=Qe(f.J.cb(),[e]),kg(f,n,h,e,0,null,p.Ib)},timescale:p.timescale};if(p.gb)return r||"image"===t.oa.contentType||"text"===t.oa.contentType||(r=t.ma.start,d=t.ra.id,i=t.ma.duration,d=(d=null!=d&&o.get(d)||i)?r+d:1/0,t.presentationTimeline.Rg(p.gb),t.presentationTimeline.ri(r,d)),{endTime:-1,timeline:-1,Oc:function(){return function(t,n,i,r,a,o,s,u){function c(i){var a=i-y,s=a*v,l=n.Kf,c=a*l;"BigInt"in e&&c>Number.MAX_SAFE_INTEGER&&(c=BigInt(a)*BigInt(l)),a=(s+=f)+v,l=Math.min(a,h());var d=[],p=n.vk;if(p)for(var g=(l-s)/p,m={},k=0;k<p;m={Ri:void 0},k++){var E=s+g*k,I=E+g;m.Ri=k,(m=new Vo(E,I,function(e){return function(){var t=dg(b,T,i,e.Ri,w,c);return Qe(x(),[t],S())}}(m),0,null,r,A,f,h(),[],"",null,null,Ko,o)).codecs=t.J.codecs,m.mimeType=t.J.mimeType,0==u?0<k&&m.qd():0!=k%u&&m.qd(),d.push(m)}return(s=new Vo(s,l,(function(){if(p)return[];var e=dg(b,T,i,null,w,c);return Qe(x(),[e],S())}),0,null,r,A,f,h(),d,"",null,null,Ko,o,0<d.length)).codecs=t.J.codecs,s.mimeType=t.J.mimeType,s.bandwidth=t.bandwidth,s.j=a,s}function d(){var e=[Math.max(p.Gb(),f),Math.min(p.Ac(),h())].map((function(e){return e-f}));return e=[Math.ceil(e[0]/v),Math.ceil(e[1]/v)-1],t.J.qb&&e[1]++,e.map((function(e){return e+y}))}function h(){var e=null!=g&&a.get(g)||m;return e?f+e:1/0}var p=t.presentationTimeline,f=t.ma.start,g=t.ra.id,m=t.ma.duration,v=n.gb,y=n.ie,b=n.ac,w=t.bandwidth||null,T=t.J.originalId,x=t.J.cb,S=t.Lb,A=f-n.Ib,k=d();i=t.Db?Math.max(k[0],k[1]-i+1):k[0],s=s||k[1],k=[];for(var E=i;E<=s;++E){var I=c(E);k.push(I)}var C=new Du(k);if(k=p.Ac()<h(),E=p.V(),k||E){var M=Math.max(i,s+1);i=v,t.J.qb&&(i=.1),C.Lf(i,(function(){var e=p.Gb();C.$a(e);var t=l(d());t.next(),t=t.next().value;for(var n=[];M<=t;){var i=c(M);n.push(i),M++}return e>h()&&!n.length?null:n}))}return Promise.resolve(C)}(f,p,a,h,o,s,u,t.J.Df)},timescale:p.timescale};var g=null;r=r=null,t.ra.id&&t.J.id&&(r=t.ra.id+","+t.J.id,r=i.get(r))&&(g=r.segmentIndex);var m=t.ma.start,v=t.ma.duration?m+t.ma.duration:1/0;if(g)Ng(d=g,p,m,v,h,t.Db),d.$a(t.presentationTimeline.Gb());else{if(i=0,c=-1,null!=t.ra.id&&null!=t.J.id){var y=d.get(t.ra.id);if(y)c=y.timeline;else for(y=(d=l(d.values())).next();!y.done;y=d.next()){if(y=y.value,Math.abs(p.Ib-y.endTime)<=ot&&y.ah.includes(t.J.id)){c=y.timeline;break}y.timeline>=i&&(i=y.timeline+1)}}-1==c&&(c=i),g=new Lg(t.Db,p,t.J.originalId,t.bandwidth,t.J.cb,t.Lb,m,v,h,s,t.J.Df,c)}return p.timeline&&"image"!==t.oa.contentType&&"text"!==t.oa.contentType&&t.presentationTimeline.si(g.h?g.h.timeline:[],m),r&&t.Db&&(r.segmentIndex=g),r=(r=(r=p.timeline)&&r[r.length-1])?r.end+p.Ib:-1,d=-1,g instanceof Lg&&(d=g.Pe()),{endTime:r,timeline:d,Oc:function(){return g instanceof Lg&&0==g.getNumReferences()&&Ng(g,p,m,v,h,t.Db),Promise.resolve(g)},timescale:p.timescale}}function Rg(e){return e.Gc}function Lg(e,t,n,i,r,a,o,s,u,l,c,d){Du.call(this,[]),this.C=e,this.h=t,this.G=n,this.B=i,this.F=r,this.I=a,this.j=o,this.l=s,this.s=u,this.A=l,this.H=c,this.K=d,Og(this)}function Ng(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)&&Ho(n,t)}}(e,r),e.C=a,e.h){if(e.h.dd!==t.dd&&(e.h.timeline=t.timeline,e.h.dd=t.dd,e.h.Ib=t.Ib),e.h.ac!==t.ac&&(e.h.ac=t.ac),(n=e.h.timeline).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;Og(e)}function Og(e){if(e.h&&!e.o){for(var t=[],n=l(e.h.timeline),i=n.next();!i.done;i=n.next())(i=i.value).start>=e.l||0>=i.end||t.push(i);e.h.timeline=t,e.$a(e.j)}}function jg(e,t,n,i,r,a,o,s){return e=dg(e,t,n,a,i||null,r),Qe(o(),[e],s()).map((function(e){return e.toString()}))}function Ug(e){this.o=null,this.A=e,this.G=new Nr,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 _g(e,t){var n,i,r,a,o,s,u;return R((function(l){return 1==l.g?(n=Qe(e.i,[Bg(e,t)]),i=Br(n,e.o.retryParameters),r=e.A.networkingEngine.request(8,i),Or(e.G,r),x(l,2),w(l,r.promise,4)):2!=l.g?(a=l.h,o=Ue(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 Ti((function(){_g(e,i)})),(n=t.TTL)&&(e.C=n),e.g.ia(e.C),e.m=t["PATHWAY-PRIORITY"]||[],e.F=t["PATHWAY-CLONES"]||[]}(e,s,a.uri),A(l,0)):(u=k(l))&&7001==u.code?l.return():(null!=e.g&&(e.g.stop(),e.g=null),e.g=new Ti((function(){_g(e,t)})),e.g.ia(e.C),void T(l))}))}function Bg(e,t){if(!e.m.length)return t;t=new de(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))),Ee(r)&&ge(t,r),t.toString()}function Fg(e,t,n,i){var r=e.l.get(t);r||(r=new Map),r.set(n,i),e.l.set(t,r)}function Vg(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={ud:void 0},a=r.next())if(o.ud=a.value,a=t.get(o.ud))i.push({Wg:o.ud,location:a});else if(a=e.F.find(function(e){return function(t){return t.Hl==e.ud}}(o))){var s=t.get(a["BASE-ID"]);s&&(a["URI-REPLACEMENT"].bj?(pe(s=new de(s),a["URI-REPLACEMENT"].bj),i.push({Wg:o.ud,location:s.toString()})):i.push({Wg:o.ud,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 de(t.location).Cb))return!1;return!0})),i.length&&(e.B=i[0].Wg),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:Qe(e.i,i)}function Hg(){this.l=[],this.h=[],this.g=[],this.j=[],this.i=[],this.s=this.o=!1,this.m=new Set}function Kg(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[mm(e),e]})));var u=new Map(s.videoStreams.map((function(e){return[gm(e),e]}))),c=new Map(s.textStreams.map((function(e){return[vm(e),e]})));if(s=new Map(s.imageStreams.map((function(e){return[ym(e),e]}))),t){var d=cm(rt);c.set(vm(d),d),d=cm("image"),s.set(ym(d),d)}n.push(o),i.push(u),r.push(c),a.push(s)}return{Ih:n,$i:i,Xi:r,bi:a}}function Gg(e){var t,n,i,r,a,o,s,u,c,d,h,p,f,g,m,v,y,b,T,x,S,A,k,E,I,C,M,D,P;return R((function(R){switch(R.g){case 1:if(t=at,1==e.length)return R.return(e[0]);for(n=e.map((function(e){return new Map(e.filter((function(e){return e.type===t.ea})).map((function(e){return[mm(e),e]})))})),i=e.map((function(e){return new Map(e.filter((function(e){return e.type===t.Ca})).map((function(e){return[gm(e),e]})))})),r=e.map((function(e){return new Map(e.filter((function(e){return e.type===t.Ta})).map((function(e){return[vm(e),e]})))})),a=e.map((function(e){return new Map(e.filter((function(e){return e.type===t.Tf})).map((function(e){return[ym(e),e]})))})),o=l(r),s=o.next();!s.done;s=o.next())u=s.value,c=lm(t.Ta),u.set(vm(c),c);for(d=l(a),h=d.next();!h.done;h=d.next())p=h.value,f=lm(t.Tf),p.set(ym(f),f);return w(R,zg(g=new Hg,[],n,0,Jg,Qg,0),2);case 2:return m=R.h,w(R,zg(g,[],i,0,Jg,Qg,0),3);case 3:return v=R.h,w(R,zg(g,[],r,0,Jg,Qg,0),4);case 4:return y=R.h,w(R,zg(g,[],a,0,Jg,Qg,0),5);case 5:if(b=R.h,T=0,v.length&&m.length)for(k=l(m),E=k.next();!E.done;E=k.next())for(I=E.value,C=l(v),M=C.next();!M.done;M=C.next())D=M.value,P=T++,D.variantIds.push(P),I.variantIds.push(P);else for(x=v.concat(m),S=l(x),A=S.next();!A.done;A=S.next())A.value.variantIds=[T++];return R.return(v.concat(m).concat(y).concat(b))}}))}function zg(e,t,n,i,r,a,o){var s,u,c,d,h,p,f,g,m,v,y,b,T,x,S,A,k,E;return R((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 R((function(s){return 1==s.g?(Zg(e,n,t,0<o),t.matchedStreams?t.segmentIndex?w(s,qg(t,i+o),2):s.u(2):s.return(!1)):(Wg(t,i,r,a,o),s.return(!0))}))}(e,h,n,i,a,s,o),5);case 5:if(!I.h)throw new Ne(2,4,4037);d=c.next(),I.u(2);break;case 4:for(p=l(s),f=p.next();!f.done;f=p.next())for(g=f.value,m=l(g),v=m.next();!v.done;v=m.next())y=v.value,(b=Xg(e,y,n,r,a,s))&&t.push(b);for(T=l(s),x=T.next();!x.done;x=T.next())for(S=x.value,A=l(S),k=A.next(),E={};!k.done;E={qh:void 0},k=A.next())if(E.qh=k.value,!fm(E.qh)&&t.some(function(t){return function(n){return nm(e,t.qh,n)}}(E)))throw new Ne(2,4,4037);return I.return(t)}}))}function qg(e,t){var n,i,r,a,o,s;return R((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()),a.dependencyStream&&!a.dependencyStream.segmentIndex&&n.push(a.dependencyStream.createSegmentIndex());return w(u,Promise.all(n),2)}if(e.segmentIndex instanceof Nu)for(o=t;o<i.length;o++)(s=i[o]).segmentIndex&&e.segmentIndex.h.push(s.segmentIndex);T(u)}))}function Xg(e,t,n,i,r,a){if(fm(t))return null;var o=i(t);return Zg(e,n,o),o.createSegmentIndex&&(o.createSegmentIndex=function(){return R((function(e){return o.segmentIndex?e.u(0):(o.segmentIndex=new Nu,w(e,qg(o,0),0))}))}),o.matchedStreams&&o.matchedStreams.length?(Wg(o,0,r,a,0),o):null}function Wg(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==Pi(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 Yg(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(e.keyIds),t.closedCaptions=e.closedCaptions?new Map(e.closedCaptions):null,t.trickModeVideo=null,t.dependencyStream=null,t}function Jg(e){var t=Object.assign({},e);return t.roles=t.roles.slice(),t.keyIds=new Set(e.keyIds),t.segments=[],t.variantIds=[],t.closedCaptions=e.closedCaptions?new Map(e.closedCaptions):null,t}function $g(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=gr(e.drmInfos,t.drmInfos),t.drmInfos.length&&e.drmInfos.length&&!i.length)throw new Ne(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=Yg(t.trickModeVideo),e.trickModeVideo.matchedStreams=[],e.trickModeVideo.createSegmentIndex=function(){if(e.trickModeVideo.segmentIndex)return Promise.resolve();for(var t=new Nu,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),$g(e.trickModeVideo,t.trickModeVideo)):e.trickModeVideo&&(e.trickModeVideo.matchedStreams.push(t),$g(e.trickModeVideo,t)),t.dependencyStream?(e.dependencyStream||(e.dependencyStream=Yg(t.dependencyStream),e.dependencyStream.matchedStreams=[],e.dependencyStream.createSegmentIndex=function(){if(e.dependencyStream.segmentIndex)return Promise.resolve();for(var t=new Nu,n=l(e.dependencyStream.matchedStreams),i=n.next();!i.done;i=n.next())t.h.push(i.value.segmentIndex);return e.dependencyStream.segmentIndex=t,Promise.resolve()}),e.dependencyStream.matchedStreams.push(t.dependencyStream),$g(e.dependencyStream,t.dependencyStream)):e.dependencyStream&&(e.dependencyStream.matchedStreams.push(t),$g(e.dependencyStream,t))}function Qg(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 Zg(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=em(e,r.value,n)))return;i.push(r)}n.matchedStreams=i}function em(e,t,n){var i={audio:mm,video:gm,text:vm,image:ym}[n.type],r=null,a=i(n);if(t.has(a))r=t.get(a);else{a={audio:function(t,n){return nm(e,t,n)},video:function(t,n){return nm(e,t,n)},text:im,image:rm}[n.type];for(var o={audio:am,video:om,text:sm,image:um}[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&&!fm(r)&&t.delete(i(r)),r}function tm(e,t){return e.mimeType==t.mimeType&&bm(e.codecs)===bm(t.codecs)}function nm(e,t,n){return!(!tm(t,n)&&!e.o||t.drmInfos&&!fr(t.drmInfos,n.drmInfos))}function im(e,t){return!t.language||e.forced===t.forced&&0!=Pi(e.language,t.language)&&t.kind==e.kind}function rm(){return!0}function am(e,t,n){var i=hm(e,t,n);if(i===wm)return!0;if(i===xm)return!1;i=Pi(e.language,t.language);var r=Pi(e.language,n.language);if(r>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=dm(e.channelsCount,t.channelsCount,n.channelsCount))==wm||i!=xm&&((i=dm(e.audioSamplingRate,t.audioSamplingRate,n.audioSamplingRate))==wm||i!=xm&&!(!e.bandwidth||pm(e.bandwidth,t.bandwidth,n.bandwidth)!=wm)))}function om(e,t,n){var i=hm(e,t,n);if(i===wm)return!0;if(i===xm)return!1;if((i=dm(e.width*e.height,t.width*t.height,n.width*n.height))==wm)return!0;if(i==xm)return!1;if(e.frameRate){if((i=dm(e.frameRate,t.frameRate,n.frameRate))==wm)return!0;if(i==xm)return!1}return!(!e.bandwidth||pm(e.bandwidth,t.bandwidth,n.bandwidth)!=wm)}function sm(e,t,n){var i=Pi(e.language,t.language),r=Pi(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 um(e,t,n){return dm(e.width*e.height,t.width*t.height,n.width*n.height)==wm}function lm(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,baseOriginalId:null}}function cm(e){return{id:0,originalId:"",groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new Du([]),mimeType:"",codecs:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"",originalLanguage:null,label:null,type:e,primary:!1,trickModeVideo:null,dependencyStream: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,baseOriginalId:null}}function dm(e,t,n){if(t==e&&e!=n)return xm;if(n==e&&e!=t)return wm;if(t>e){if(n<=e||n-e<t-e)return wm;if(n-e>t-e)return xm}else{if(n>e)return xm;if(e-n<e-t)return wm;if(e-n>e-t)return xm}return Tm}function hm(e,t,n){var i=e.mimeType===t.mimeType&&e.codecs===t.codecs,r=e.mimeType===n.mimeType&&e.codecs===n.codecs;return i&&!r?xm:!i&&r?wm:(t=tm(e,t),e=tm(e,n),t&&!e?xm:!t&&e?wm:Tm)}function pm(e,t,n){return t=Math.abs(e-t),(e=Math.abs(e-n))<t?wm:t<e?xm:Tm}function fm(e){switch(e.type){case rt:return!e.language;case"image":return!e.tilesLayout;default:return!1}}function gm(e){return JSON.stringify([e.fastSwitching,e.width,e.frameRate,e.codecs,e.mimeType,e.label,e.roles,e.closedCaptions?Array.from(e.closedCaptions.entries()):null,e.bandwidth,e.dependencyStream?e.dependencyStream.baseOriginalId:null,Array.from(e.keyIds)])}function mm(e){return JSON.stringify([e.fastSwitching,e.channelsCount,e.language,e.bandwidth,e.label,e.codecs,e.mimeType,e.roles,e.audioSamplingRate,e.primary,e.dependencyStream?e.dependencyStream.baseOriginalId:null,Array.from(e.keyIds)])}function vm(e){return JSON.stringify([e.language,e.label,e.codecs,e.mimeType,e.bandwidth,e.roles])}function ym(e){return JSON.stringify([e.width,e.codecs,e.mimeType])}function bm(e){if(!Sm.has(e)){var t=oi(e);Sm.set(e,t)}return Sm.get(e)}m(Lg,Du),(i=Lg.prototype).getNumReferences=function(){return this.h?this.h.timeline.length:0},i.release=function(){Du.prototype.release.call(this),this.h=null},i.$a=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=(n=this.h.timeline[e]).Nk,r=n.Bh+this.h.dd,a=this.j-this.h.Ib,o=this.j+n.end,s=o;e===this.getNumReferences()-1&&1/0!==this.l&&(s=this.C&&.1<Math.abs(s-this.l)?Math.min(s,this.l):this.l);var u=this.h.codecs,l=this.h.mimeType,c=this.h.bandwidth,d=[],h=!1;if(n.rc&&this.h&&this.h.ac&&(h=this.h.ac.includes("$SubNumber$")),h){h=(n.end-n.start)/n.rc;for(var p={},f=0;f<n.rc;p={Nf:void 0,Si:void 0},f++){var g=n.start+h*f,m=g+h;p.Si=f,p.Nf=null,(p=new Vo(this.j+g,this.j+m,function(e){return function(){return t.h?(null==e.Nf&&(e.Nf=jg(t.h.ac,t.G,i,t.B,r,e.Si,t.F,t.I)),e.Nf):[]}}(p),0,null,this.s,a,this.j,this.l,[],"",null,null,Ko,this.A)).codecs=u,p.mimeType=l,p.bandwidth=c,0==this.H?0<f&&p.qd():0!=f%this.H&&p.qd(),d.push(p)}}(n=new Vo(this.j+n.start,s,(function(){return 0<d.length||!t.h?[]:jg(t.h.ac,t.G,i,t.B,r,null,t.F,t.I)}),0,null,this.s,a,this.j,this.l,d,"",null,null,Ko,this.A,0<d.length)).codecs=u,n.mimeType=l,n.j=o,n.bandwidth=c,this.g[e]=n}return n},i.Eb=function(e){Og(this);for(var t=0;t<this.getNumReferences();t++){var n=this.get(t+this.i);n&&e(n)}},i.Pe=function(){return this.K},Ug.prototype.configure=function(e){this.o=e},Ug.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()},Ug.prototype.setManifestType=function(e){this.s=e},Ug.prototype.banLocation=function(e){this.j.set(e,Date.now()+6e4)},(i=Hg.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.Wj=function(){return this.l},i.Hg=function(){return this.j.slice()},i.Bj=function(){return this.i},i.Ph=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}))),i.dependencyStream&&(i.dependencyStream.matchedStreams=i.dependencyStream.matchedStreams.filter((function(t){return t!==e})));else if(e.type==rt)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.gg=function(e,t,n){n=void 0!==n&&n;var i,r,a,o,s,u,c,d,h,p,f,g,m,v,y,b,x,S,A,k,E,I,C,M,D,P,L,N,O,j,U,_,B=this;return R((function(R){if(1==R.g){if(i=at,!t&&1==e.length)return r=Kg(e,!1),a=r.Ih,o=r.$i,s=r.Xi,u=r.bi,B.h=Array.from(a[0].values()),B.g=Array.from(o[0].values()),B.j=Array.from(s[0].values()),B.i=Array.from(u[0].values()),R.u(2);for(c=n?B.m.size:0,d=-1,h=0;h<e.length;h++)p=e[h],B.m.has(p.id)||(B.m.add(p.id),-1==d&&(d=h));return-1==d?R.return():(f=Kg(e,!0),g=f.Ih,m=f.$i,v=f.Xi,y=f.bi,w(R,Promise.all([zg(B,B.h,g,d,Yg,$g,c),zg(B,B.g,m,d,Yg,$g,c),zg(B,B.j,v,d,Yg,$g,c),zg(B,B.i,y,d,Yg,$g,c)]),2))}if(b=0,x=[],B.g.length&&B.h.length)for(M=l(B.h),D=M.next();!D.done;D=M.next())for(P=D.value,L=l(B.g),N=L.next();!N.done;N=L.next())O=N.value,j=gr(P.drmInfos,O.drmInfos),P.drmInfos.length&&O.drmInfos.length&&!j.length||(U=(P.bandwidth||0)+(O.bandwidth||0),P.dependencyStream&&(U+=P.dependencyStream.bandwidth||0),O.dependencyStream&&(U+=O.dependencyStream.bandwidth||0),_=b++,x.push({id:_,language:P.language,disabledUntilTime:0,primary:P.primary,audio:P,video:O,bandwidth:U,drmInfos:j,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]}));else for(S=B.g.length?B.g:B.h,A=l(S),k=A.next();!k.done;k=A.next())E=k.value,I=b++,C=E.bandwidth||0,E.dependencyStream&&(C+=E.dependencyStream.bandwidth||0),x.push({id:I,language:E.language,disabledUntilTime:0,primary:E.primary,audio:E.type==i.ea?E:null,video:E.type==i.Ca?E:null,bandwidth:C,drmInfos:E.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});B.l=x,T(R)}))},i.Ii=function(e){this.o=e},i.Mi=function(e){this.s=e},F("shaka.util.PeriodCombiner",Hg),Hg.prototype.setUseStreamOnce=Hg.prototype.Mi,Hg.prototype.setAllowMultiTypeVariants=Hg.prototype.Ii,Hg.prototype.combinePeriods=Hg.prototype.gg,Hg.prototype.deleteStream=Hg.prototype.Ph,Hg.prototype.getImageStreams=Hg.prototype.Bj,Hg.prototype.getTextStreams=Hg.prototype.Hg,Hg.prototype.getVariants=Hg.prototype.Wj;var wm=1,Tm=0,xm=-1,Sm=new Map;function Am(e,t){try{return function(e,t){var n=new DOMParser,i=km.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}(Be(e),t)}catch(e){return null}}var km=new ee((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 Em(){var e=this;this.j=this.g=null,this.A=[],this.h=null,this.za=1,this.G=[],this.l={mf:"",type:"",profiles:[],nc:null,qb:0,cb:null,be:0},this.s=new Map,this.B=new Map,this.o=new Map,this.C=new Map,this.wa=new Map,this.m=new Hg,this.K=0,this.ya=new V(5),this.L=new Ti((function(){e.I&&!e.g.continueLoadingWhenPaused&&(e.H.Ja(e.I,"timeupdate"),e.I.paused)?e.H.Aa(e.I,"timeupdate",(function(){return Vm(e)})):Vm(e)})),this.P=new Nr,this.N=null,this.F=[],this.ha=1/0,this.va=!1,this.i=null,this.M=0,this.S=!1,this.H=new $,this.I=null,this.U=!1,this.ba="",this.na=function(){return!1},this.W=[],this.ka=new Set}function Im(e){var t,n,i,r,a,o,s,u,d,h,p;return R((function(f){return 1==f.g?(t=4,n="MPD",i=function(e){var t=e.l.be;if(!e.l.mf||!t||!e.G.length)return[];var n=Date.now()/1e3,i=e.G.filter((function(e){return!(e=ln(e.attributes.ttl))||t+e>n})).map(Yt).filter(Ai);return i.length?Qe(e.A,i):[]}(e),r=e.A,i.length?(r=i,n="Patch",t=6):1<e.A.length&&e.i&&(a=Vg(e.i,"Location",!0)).length&&(r=a),o=Br(r,e.g.retryParameters),s=Date.now(),w(f,Wm(e,o,0,{type:t}),2)):3!=f.g?(u=f.h,e.j?(u.uri&&u.uri!=u.originalUri&&!e.A.includes(u.uri)&&e.A.unshift(u.uri),d=new de(u.uri),e.ba=d.g.toString(),w(f,function(e,t,n,i){var r,a,o,s,u,d,h,p;return R((function(f){if(1==f.g){if(r=t,(a=e.g.dash.manifestPreprocessor)!=Xl){if(oe("manifest.dash.manifestPreprocessor configuration","Please Use manifest.dash.manifestPreprocessorTXml instead."),!(o=Am(r,i)))throw new Ne(2,4,4001,n);a(o),r=Fe(o.outerHTML)}if(!(s=Ht(r,i)))throw new Ne(2,4,4001,n);return(u=e.g.dash.manifestPreprocessorTXml)!=Wl&&u(s),"Patch"===i?f.return(function(e,t){var n,i,r,a,o,s,u,d,h,p,f,g,m,v,y,b,x,S,A,k,E,I,C,M;return R((function(D){if(1==D.g){if(n=t.attributes.mpdId,i=Zt(t,"originalPublishTime",rn),!n||n!==e.l.mf||i!==e.l.be)throw e.G=[],new Ne(1,4,4052);for(r=[],a=[],o=new Set,s=l(qt(t)),u=s.next();!u.done;u=s.next())if(d=u.value,h=pn(d.attributes.sel||""),p=h[h.length-1],f=Yt(d)||"","MPD"===p.name)if("mediaPresentationDuration"===p.wc){var P=an(Yt(d)||"");if(null!=P){e.l.nc=P;for(var R=l(e.s.values()),L=R.next();!L.done;L=R.next())L.value.nc=P}}else if("type"===p.wc){for(e.h.presentationTimeline.Zc("static"==f),e.l.type=f,R=(P=l(e.s.values())).next();!R.done;R=P.next())R.value.Db="dynamic"==f;"static"==f&&(e.K=-1)}else"publishTime"===p.wc?e.l.be=rn(f)||0:null===p.wc&&"add"===d.tagName&&a.push(d);else if("PatchLocation"===p.name)fn(e.G,d);else if("Period"===p.name)"add"===d.tagName?a.push(d):"remove"===d.tagName&&p.id&&Pm(e,p.id);else if("SegmentTemplate"===p.name){if((P=(R=pn(d.attributes.sel||""))[R.length-1]).wc){R=Rm(e,R),L=Yt(d)||"";for(var N=l(R),O=N.next();!O.done;O=N.next())mn((O=e.s.get(O.value)).J.Gc,d.tagName,P.wc,L);P=R}else P=[];for(g=l(P),m=g.next();!m.done;m=g.next())v=m.value,o.add(v)}else if("SegmentTimeline"===p.name||"S"===p.name){for(P=pn(d.attributes.sel||""),L=(R=l(P=Rm(e,P))).next();!L.done;L=R.next())fn(N=Xt(L=gg(L=e.s.get(L.value),Rg,"SegmentTimeline"),"S"),d),L.children=N;for(y=l(P),b=y.next();!b.done;b=y.next())x=b.value,o.add(x)}for(S=l(o),A=S.next();!A.done;A=S.next())k=A.value,Lm(e,k);for(E=l(a),I=E.next();!I.done;I=E.next())C=I.value,r.push.apply(r,c(Dm(e,C)));return r.length?(e.h.periodCount+=r.length,e.h.gapCount=e.M,w(D,Mm(e,r,!0),2)):D.u(2)}"static"==e.l.type&&(M=e.l.nc,e.h.presentationTimeline.pb(M||1/0)),T(D)}))}(e,s)):e.g.dash.disableXlinkProcessing?f.return(Cm(e,s,n)):(d=e.g.dash.xlinkFailGracefully,h=mg(s,e.g.retryParameters,d,n,e.j.networkingEngine),Or(e.P,h),w(f,h.promise,2))}return p=f.h,f.return(Cm(e,p,n))}))}(e,u.data,u.uri,n),3)):f.return(0)):(h=Date.now(),p=(h-s)/1e3,e.ya.sample(1,p),e.ka.clear(),f.return(p))}))}function Cm(e,t,n){var i,r,a,o,s,u,d,h,p,f,g,m,v,y,b,S,E,I,C,M,D,P,L,N,O,j,U,_,B,F,V,H,K,G,z,X,W,Y,J,$,Q,Z,ee,te,ne,ie,re,ae,oe,se,ue,le,ce,de;return R((function(he){switch(he.g){case 1:for(e.i&&e.i.l.clear(),i=[n],r=[],a=new Map,o=Xt(t,"Location"),s=l(o),u=s.next();!u.done;u=s.next())d=u.value,h=d.attributes.serviceLocation,(p=Yt(d))&&(f=Qe(i,[p])[0],h&&(e.i?Fg(e.i,"Location",h,f):a.set(h,f)),r.push(f));if(e.i?0<(g=Vg(e.i,"Location",!0)).length&&(i=e.A=g):r.length&&(i=e.A=r),e.l.mf=t.attributes.id||"",e.l.be=Zt(t,"publishTime",rn)||0,e.G=Xt(t,"PatchLocation"),m=Promise.resolve(),(v=$t(t,"ContentSteering"))&&e.j)for(y=v.attributes.defaultServiceLocation,e.i?(e.i.i=i,e.i.h=y):(e.i=new Ug(e.j),e.i.configure(e.g),e.i.setManifestType("DASH"),e.i.i=i,e.i.h=y,(b=Yt(v))&&(Zt(v,"queryBeforeStart",dn,!1)?m=_g(e.i,b):_g(e.i,b))),S=l(a.keys()),E=S.next();!E.done;E=S.next())I=E.value,C=a.get(I),Fg(e.i,"Location",I,C);if(M=Xt(t,"BaseURL"),D=!1,e.i)for(P=l(M),L=P.next();!L.done;L=P.next())N=L.value,O=N.attributes.serviceLocation,j=Yt(N),O&&j&&(Fg(e.i,"BaseURL",O,j),D=!0);if(e.W.splice(0),D&&e.i||(U=M.map(Yt),e.W.push.apply(e.W,c(Qe(i,U)))),_=e.i,B=e.W,F=function(){return _&&D?Vg(_,"BaseURL"):B.slice()},e.l.cb=F,V=0,M&&M.length&&(V=Zt(M[0],"availabilityTimeOffset",cn)||0),e.l.qb=V,e.K=Zt(t,"minimumUpdatePeriod",an,-1),H=Zt(t,"availabilityStartTime",rn),K=Zt(t,"timeShiftBufferDepth",an),G=e.g.dash.ignoreSuggestedPresentationDelay,z=null,G||(z=Zt(t,"suggestedPresentationDelay",an)),X=e.g.dash.ignoreMaxSegmentDuration,W=null,X||(W=Zt(t,"maxSegmentDuration",an)),Y=t.attributes.type||"static",e.h&&e.h.presentationTimeline&&(e.U=e.h.presentationTimeline.V()&&"static"==Y),e.l.type=Y,e.h)for(J=e.h.presentationTimeline,$=J.Gb(),Q=l(e.o.values()),Z=Q.next();!Z.done;Z=Q.next())(ee=Z.value).segmentIndex&&ee.segmentIndex.$a($);else te=e.g.dash.ignoreMinBufferTime,ne=0,te||(ne=Zt(t,"minBufferTime",an)||0),ie=null!=z?Math.min(z,K||1/0):0<e.g.defaultPresentationDelay?e.g.defaultPresentationDelay:Math.min(1.5*ne,K||1/0),J=new su(H,ie,e.g.dash.autoCorrectDrift);return J.Zc("static"==Y),J.V()&&!isNaN(e.g.availabilityWindowOverride)&&(K=e.g.availabilityWindowOverride),null==K&&(K=1/0),J.Gf(K),re=t.attributes.profiles||"",e.l.profiles=re.split(","),ae={Db:"static"!=Y,presentationTimeline:J,ra:null,ma:null,oa:null,J:null,bandwidth:0,Jg:!1,qb:V,nc:null,profiles:re.split(","),roles:null,Lb:function(){return""}},w(he,m,2);case 2:return e.M=0,oe=jm(e,ae,F,t,!1),se=oe.duration,ue=oe.periods,("static"!=Y||e.U)&&oe.Rh||J.pb(se||1/0),e.S&&e.va&&J.Ji(e.ha),J.Rg(W||1),e.S&&e.va&&(le=null!=z?z:e.g.defaultPresentationDelay,J.lh(le)),e.h?(e.h.periodCount=ue.length,e.h.gapCount=e.M,w(he,Mm(e,ue,!1),4)):w(he,e.m.gg(ue,ae.Db),6);case 6:if(e.h={presentationTimeline:J,variants:e.m.l,textStreams:e.m.Hg(),imageStreams:e.m.i,offlineSessionIds:[],sequenceMode:e.g.dash.sequenceMode,ignoreManifestTimestampsInSegmentsMode:!1,type:"DASH",serviceDescription:Nm(t),nextUrl:Om(t),periodCount:ue.length,gapCount:e.M,isLowLatency:e.S,startTime:null},!J.Zi()){he.u(7);break}return ce=Xt(t,"UTCTiming"),w(he,function(e,t,n){var i,r,a,o,s,u,c,d;return R((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,x(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":q("NTP UTCTiming scheme is not supported");break;default:q("Unrecognized scheme in UTCTiming element",u)}h.u(9);break;case 7:return w(h,Gm(e,t,c,"HEAD"),10);case 10:return h.return(h.h);case 8:return w(h,Gm(e,t,c,"GET"),11);case 11:return h.return(h.h);case 9:A(h,3);break;case 5:k(h);case 3:o=a.next(),h.u(2);break;case 4:return q("A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!"),h.return(0)}}))}(e,F,ce),8);case 8:if(de=he.h,!e.j)return he.return();J.Ki(de);case 7:J.hf(),e.m&&!e.h.presentationTimeline.V()&&e.m.release();case 4:e.j.makeTextStreamsForClosedCaptions(e.h),function(e){for(var t=Array.from(e.C.keys()).filter((function(t){return!e.F.includes(t)})),n=(t=l(t)).next();!n.done;n=t.next()){n=n.value;for(var i=!0,r=l(e.C.get(n)),a=r.next();!a.done;a=r.next()){a=a.value;var o=e.o.get(a);o&&(o.segmentIndex&&0!=o.segmentIndex.getNumReferences()?i=!1:(e.m&&e.m.Ph(o,n),e.o.delete(a)))}i&&e.C.delete(n)}}(e),function(e,t){t=new Set(t.map((function(e){return e.id})));for(var n=l(e.B.keys()),i=n.next();!i.done;i=n.next())i=i.value,t.has(i)||e.B.delete(i)}(e,ue),T(he)}}))}function Mm(e,t,n){var i;return R((function(r){if(1==r.g)return w(r,e.m.gg(t,!0,n),2);e.h.variants=e.m.l,0<(i=e.m.Hg()).length&&(e.h.textStreams=i),e.h.imageStreams=e.m.i,e.j.filter(e.h),T(r)}))}function Dm(e,t){return jm(e,{Db:"dynamic"==e.l.type,presentationTimeline:e.h.presentationTimeline,ra:null,ma:null,oa:null,J:null,bandwidth:0,Jg:!1,qb:e.l.qb,profiles:e.l.profiles,nc:e.l.nc,roles:null,Lb:function(){return""}},e.l.cb,t,!0).periods}function Pm(e,t){e.h.periodCount--;for(var n=l(e.s.keys()),i=n.next();!i.done;i=n.next())(i=i.value).startsWith(t)&&(gg(e.s.get(i),Rg,"SegmentTimeline").children=[],Lm(e,i),e.s.delete(i));e.F=e.F.filter((function(e){return e!==t}))}function Rm(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).ra.id===n&&e.oa.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).ra.id===n&&e.oa.position===r&&e.J.id&&t.push(n+","+e.J.id);return t}function Lm(e,t){var n=e.s.get(t),i=e.o.get(t);i.segmentIndex&&i.segmentIndex.$a(e.h.presentationTimeline.Gb());try{var r=Pg(n,(function(t,n,i,r){return qm(e,t,n,i,r)}),e.o,!0,e.g.dash.initialSegmentLimit,e.wa,n.J.aesKey,null,!0,e.B);i.createSegmentIndex=function(){return R((function(e){if(1==e.g)return i.segmentIndex?e.u(0):w(e,r.Oc(),3);i.segmentIndex=e.h,T(e)}))}}catch(e){if((t=n.J.contentType)!=rt&&"application"!=t&&"image"!=t||4002!=e.code)throw e}}function Nm(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 Om(e){if(!(e=Xt(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 jm(e,t,n,i,r){var a=t.nc;a||(a=Zt(i,"mediaPresentationDuration",an),e.l.nc=a);var o=0;e.h&&e.h.presentationTimeline&&e.U&&(o=e.h.presentationTimeline.Xb());var s=[],u=o;i=Xt(i,"Period");for(var c=0;c<i.length;c++){var d=i[c],h=i[c+1],p=Zt(d,"start",an,u),f=d.attributes.id,g=Zt(d,"duration",an);p=0==c&&0==p&&e.U?o:p;var m=null;if(h){var v=Zt(h,"start",an);null!=v&&(m=v-p+o)}else null!=a&&(m=a-p+o);if(v=ot,m&&g&&Math.abs(m-g)>v&&m>g&&e.M++,null==m&&(m=g),!(null!==e.N&&null!==f&&null!==p&&p<e.N)||e.F.includes(f)||c+1==i.length){if(null!==p&&(null===e.N||p>e.N)&&(e.N=p),u=Um(e,t,n,{start:p,duration:m,node:d,bf:null==m||!h}),s.push(u),t.ra.id&&m&&e.wa.set(t.ra.id,m),null==m){u=null;break}u=p+m}}if(r)for(n=(t=l(s)).next();!n.done;n=t.next())n=n.value.id,e.F.includes(n)||e.F.push(n);else e.F=s.map((function(e){return e.id}));return null!=a?{periods:s,duration:a+o,Rh:!1}:{periods:s,duration:u,Rh:!0}}function Um(e,t,n,i){t.ra=Km(e,i.node,null,n),t.ma=i,t.ra.qb=t.qb,t.ra.id||(t.ra.id="__shaka_period_"+i.start);var r=Xt(i.node,"EventStream");n=t.presentationTimeline.Gb();for(var a=(r=l(r)).next();!a.done;a=r.next())zm(e,i.start,i.duration,a.value,n);for(r=(n=l(n=Xt(i.node,"SupplementalProperty"))).next();!r.done;r=n.next())"urn:mpeg:dash:urlparam:2014"==(r=r.value).attributes.schemeIdUri&&(r=Fm(e,r))&&(t.Lb=r);if(n=Xt(i.node,"AdaptationSet").map((function(n,i){return Bm(e,t,i,n)})).filter(Ai),t.Db){r=[];for(var o=(a=l(n)).next();!o.done;o=a.next())for(var s=(o=l(o.value.Jk)).next();!s.done;s=o.next())r.push(s.value);if(r.length!=new Set(r).size)throw new Ne(2,4,4018)}for(r=new Map,o=(a=l(n)).next();!o.done;o=a.next())for(s=(o=l(o.value.pj)).next();!s.done;s=o.next()){var u=l(s.value);s=u.next().value,u=u.next().value,r.set(s,u)}if(r.size)for(a=null,s=(o=l(n)).next();!s.done;s=o.next()){u=[];for(var d=l((s=s.value).streams),h=d.next(),p={};!h.done;p={rh:void 0},h=d.next())if(p.rh=h.value,r.has(p.rh.originalId)){a||(a=Xt(i.node,"AdaptationSet").map((function(n,i){return Bm(e,t,i,n)})).filter(Ai));for(var f=(h=l(a)).next();!f.done;f=h.next())(f=f.value.streams.find(function(e){return function(t){return t.originalId==e.rh.originalId}}(p)))&&(f.dependencyStream=r.get(f.originalId),f.originalId+=f.dependencyStream.originalId,u.push(f))}u.length&&s.streams.push.apply(s.streams,c(u))}if(i=n.filter((function(e){return!e.Ah})),n=n.filter((function(e){return e.Ah})),!e.g.disableIFrames)for(r=(n=l(n)).next();!r.done;r=n.next())for(a=(r=r.value).Ah.split(" "),s=(o=l(i)).next();!s.done;s=o.next())if(s=s.value,a.includes(s.id))for(u=(s=l(s.streams)).next();!u.done;u=s.next())nr(u.value,r.streams);if(n=_m(e.g.disableAudio,i,"audio"),r=_m(e.g.disableVideo,i,"video"),a=_m(e.g.disableText,i,rt),i=_m(e.g.disableThumbnails,i,"image"),0===r.length&&0===n.length)throw new Ne(2,4,4004);return{id:t.ra.id,audioStreams:n,videoStreams:r,textStreams:a,imageStreams:i}}function _m(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 Bm(t,n,i,r){function a(e){var i=e.attributes["dvb:fontFamily"];e=e.attributes["dvb:url"],i&&e&&(e=Qe(n.oa.cb(),[e],n.Lb()),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.oa=Km(t,r,n.ra,null),n.oa.position=i;var u=!1,d=(i=Xt(r,"Role")).map((function(e){return e.attributes.value})).filter(Ai),h=void 0,p=n.oa.contentType==rt;p&&(h="subtitle");for(var f=(i=l(i)).next();!f.done;f=i.next()){var g=(f=f.value).attributes.schemeIdUri;if(null==g||"urn:mpeg:dash:role:2011"==g)switch(f=f.attributes.value,f){case"main":u=!0;break;case"caption":case"subtitle":h=f}}var m=Xt(r,"EssentialProperty");i=null;var v=!1;f=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 x=s(parseInt(y.attributes.value,10));else if("urn:mpeg:mpegB:cicp:ColourPrimaries"==b)var S=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&&(f=Fm(t,y))||(g=!0))}if(g)return null;var A=null;for(m=(g=l(g=Xt(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?x=s(parseInt(m.attributes.value,10)):"urn:mpeg:mpegB:cicp:ColourPrimaries"==y?S=o(parseInt(m.attributes.value,10)):"urn:dvb:dash:fontdownload:2014"==y?a(m):"urn:mpeg:dash:urlparam:2014"==y&&(f=Fm(t,m));f&&(n.Lb=f),f=Xt(r,"Accessibility");var k,E=new Map;for(g=(f=l(f)).next();!g.done;g=f.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?k="visually impaired":"2"==m?k="hard of hearing":"9"==m&&(k="spoken subtitles"));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),E.set(y,Di(I))}else E.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 C=b=void 0;I.includes("=")?(b=(I=I.split("="))[0].startsWith("CC")?I[0]:"CC"+I[0],C=I[1]||"und"):(b="CC"+g,2==m.length?g+=2:g++,C=I),E.set(b,Di(C))}else E.set("CC1","und");var M=sg(f=Xt(r,"ContentProtection"),t.g.ignoreDrmInfo,t.g.dash.keySystemsByURI);n.oa.encrypted=0<f.length;var D=Di(n.oa.language||"und"),P=n.oa.label,L=new Map;if(r=Xt(r,"Representation"),!t.g.ignoreSupplementalCodecs){for(f=[],m=(g=l(r)).next();!m.done;m=g.next())(m=en(y=m.value,"urn:scte:dash:scte214-extensions","supplementalCodecs"))&&((y=Bt(y)).attributes.codecs=m.split(" ").join(","),y.attributes.id&&(y.attributes.supplementalId=y.attributes.id+"_supplementalCodecs"),f.push(y));r.push.apply(r,c(f))}if(f=r.map((function(i){var r=function(t,n,i,r,a,o,s,u,l,c,d,h){n.J=Km(t,c,n.oa,null);var p=n.J.id;if(t.ha=Math.min(t.ha,n.J.qb),t.S=0<t.ha,!function(e){var t=e.Cd?1:0;return t+=e.tc?1:0,0==(t+=e.Gc?1:0)?e.contentType==rt||"application"==e.contentType:(1!=t&&(e.Cd&&(e.tc=null),e.Gc=null),!0)}(n.J))return null;var f=n.ma.start;n.bandwidth=Zt(c,"bandwidth",un)||0,n.roles=u;var g=Xt(c,"SupplementalProperty"),m=Xt(c,"EssentialProperty"),v=Xt(c,"ContentProtection");c=null;var y,b,x=m.find((function(e){return"urn:mpeg:dash:urlparam:2014"==e.attributes.schemeIdUri}));(x||(x=g.find((function(e){return"urn:mpeg:dash:urlparam:2014"==e.attributes.schemeIdUri}))))&&(c=Fm(t,x)),c&&(n.Lb=c),c=(x=n.J.contentType)==rt||"application"==x,x="image"==x,v.length&&(n.oa.encrypted=!0);try{var S=void 0;if(i.cg){var A=n.J.cb,k=n.Lb,E=Br(Qe(A(),[i.cg.kk],k()),t.g.retryParameters);S={bitsKey:128,blockCipherMode:"CBC",iv:i.cg.iv,firstMediaSequenceNumber:0,fetchKey:function(){var n,i,r;return R((function(a){if(1==a.g)return w(a,Wm(t,E,6),2);if(3!=a.g){if(!(n=a.h).data||16!=n.data.byteLength)throw new Ne(2,4,4049);return i={name:"AES-CBC"},r=S,w(a,e.crypto.subtle.importKey("raw",n.data,i,!0,["decrypt"]),3)}r.cryptoKey=a.h,S.fetchKey=void 0,T(a)}))}}}if(n.J.aesKey=S,A=function(e,n,i,r){return qm(t,e,n,i,r)},n.J.Cd)var I=function(e,t,n){var i=Number(fg(e,Eg,"presentationTimeOffset"))||0,r=fg(e,Eg,"timescale"),a=1;r&&(a=un(r)||1);var o=i/a||0,s=Ag(e,Eg,n);!function(e,t){if(Cg(e,t),!Ig(e))throw new Ne(2,4,4002)}(e,s);var u=Ft(e);return{endTime:-1,timeline:-1,Oc:function(){var e=gg(u,Eg,"RepresentationIndex"),n=u.J.cb();return e&&(e=Ke(e.attributes.sourceURL))&&(n=Qe(n,[e],u.Lb())),e=Ig(u),kg(u,t,s,n,e.start,e.end,o)},timescale:a}}(n,A,S);else if(n.J.tc)I=function(e,t,n){var i=Ag(e,Dg,n),r=function(e){var t=function(e){return[e.J.tc,e.oa.tc,e.ra.tc].filter(Ai).map((function(e){return Xt(e,"SegmentURL")})).reduce((function(e,t){return 0<e.length?e:t})).map((function(t){return t.attributes.indexRange&&!e.Jg&&(e.Jg=!0),{tk:Ke(t.attributes.media),start:(t=Zt(t,"mediaRange",on,{start:0,end:null})).start,end:t.end}}))}(e),n=(e=hg(e,Dg)).ie;0==n&&(n=1);var i=0;return e.gb?i=e.gb*(n-1):e.timeline&&0<e.timeline.length&&(i=e.timeline[0].start),{gb:e.gb,startTime:i,ie:n,Ib:e.Ib,timescale:e.timescale,timeline:e.timeline,sd:t}}(e);if(!r.gb&&!r.timeline&&1<r.sd.length)throw new Ne(2,4,4002);if(!r.gb&&!e.ma.duration&&!r.timeline&&1==r.sd.length)throw new Ne(2,4,4002);if(r.timeline&&0==r.timeline.length)throw new Ne(2,4,4002);var a=null,o=null;e.ra.id&&e.J.id&&(o=t.get(e.ra.id+","+e.J.id))&&(a=o.segmentIndex);var s=function(e,t,n,i,r,a,o,s,u,l){var c=i.sd.length;i.timeline&&i.timeline.length!=i.sd.length&&(c=Math.min(i.timeline.length,i.sd.length));for(var d=e-i.Ib,h=t?e+t:1/0,p=[],f=i.startTime,g={},m=0;m<c;g={Mf:void 0,Cf:void 0},m++){g.Cf=i.sd[m];var v=f;f=void 0,f=null!=i.gb?v+i.gb:i.timeline?i.timeline[m].end:v+t,g.Mf=null,(g=new Vo(e+v,e+f,function(e){return function(){return null==e.Mf&&(e.Mf=Qe(n(),[e.Cf.tk],l())),e.Mf}}(g),g.Cf.start,g.Cf.end,r,d,e,h,[],"",null,null,Ko,a)).codecs=s,g.mimeType=o,g.bandwidth=u,p.push(g)}return p}(e.ma.start,e.ma.duration,e.J.cb,r,i,n,e.J.mimeType,e.J.codecs,e.bandwidth,e.Lb);return t=!a,a?a.Yd(s,e.presentationTimeline.Gb()):a=new Du(s),e.presentationTimeline.$d(s),e.Db&&e.ma.bf||a.ld(e.ma.start,e.ma.duration?e.ma.start+e.ma.duration:1/0,t),o&&(o.segmentIndex=a),{endTime:-1,timeline:-1,Oc:function(){return a&&0!=a.getNumReferences()||a.kf(s),Promise.resolve(a)},timescale:r.timescale}}(n,t.o,S);else if(n.J.Gc)I=Pg(n,A,t.o,!!t.h,t.g.dash.initialSegmentLimit,t.wa,S,h,!1,t.B);else{var C=n.ma.duration||0,M=n.J.cb,D=n.J.mimeType,P=n.J.codecs;I={endTime:-1,timeline:-1,Oc:function(){var e=Ru(f,C,M());return e.Eb((function(e){e.mimeType=D,e.codecs=P})),Promise.resolve(e)},timescale:1}}}catch(e){if((c||x)&&4002==e.code)return null;throw e}if(h=function(e,t,n,i){var r=sg(e,n,i);if(t.Th)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.Th=!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 Ne(2,4,4008);return r.Oh||t.Oh}(v,i,t.g.ignoreDrmInfo,t.g.dash.keySystemsByURI),h=new Set(h?[h]:[]),v=!1,g.some((function(e){return"tag:dolby.com,2018:dash:EC3_ExtensionType:2018"==e.attributes.schemeIdUri&&"JOC"==e.attributes.value}))&&(v=!0),g=!1,c&&(g=u.includes("forced_subtitle")||u.includes("forced-subtitle")),x&&((m=m.find((function(e){return["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"].includes(e.attributes.schemeIdUri)})))&&(y=m.attributes.value),!y))return null;c=n.J.codecs,n.profiles.includes("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&(c.includes("hvc1.2.4.L153.B0")||c.includes("hev1.2.4.L153.B0"))&&(b="PQ"),m=n.J.id?n.ra.id+","+n.J.id:"",t.G.length&&p&&t.s.set(n.ra.id+","+p,function(e){function t(e){return e?((e=Ft(e)).Cd=null,e.tc=null,e.Gc=yn(e.Gc),e.yf=null,e):null}return(e=Ft(e)).ra=t(e.ra),e.oa=t(e.oa),e.J=t(e.J),e.ma&&(e.ma=Ft(e.ma),e.ma.node=null),e}(n)),n.J.yf&&function(e,t,n,i){if(!e.ka.has(t)){e.ka.add(t);var r,a=Zt(t,"presentationTime",ln)||0,o=$t(t,"UTCTiming");(r=o&&o.attributes.schemeIdUri)&&(r=!("urn:mpeg:dash:utc:http-ntp:2014"===(o=o.attributes.schemeIdUri)||"urn:mpeg:dash:utc:ntp:2014"===o||"urn:mpeg:dash:utc:sntp:2014"===o)),t=r?1e3*(Zt(t,"wallClockTime",rn)||0):cs(t=Zt(t,"wallClockTime",ln)||0),a=(n=new Date(t-a/n.timescale*1e3)).getTime()/1e3,isNaN(a)||(i.o||i.mh(a),i=new Dr("prft",i=(new Map).set("detail",{wallClockTime:t,programStartDate:n})),e.j.onEvent(i))}}(t,n.J.yf,I,n.presentationTimeline),-1!=I.endTime&&null!=n.ra.id&&null!=n.J.id&&((p=t.B.get(n.ra.id))?(p.endTime=I.endTime,p.ah.includes(n.J.id)||p.ah.push(n.J.id),t.B.set(n.ra.id,p)):t.B.set(n.ra.id,{endTime:I.endTime,timeline:I.timeline,ah:[n.J.id]}));var L=m&&t.o.has(m)?t.o.get(m):{id:t.za++,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:c,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:h,language:a,originalLanguage:n.oa.language,label:o,type:n.oa.contentType,primary:s,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:n.J.emsgSchemeIdUris,roles:u,forced:g,channelsCount:n.J.qf,audioSamplingRate:n.J.audioSamplingRate,spatialAudio:v,closedCaptions:l,hdr:b,colorGamut:void 0,videoLayout:void 0,tilesLayout:y,accessibilityPurpose:d,external:!1,fastSwitching:!1,fullMimeTypes:new Set([ni(n.J.mimeType,n.J.codecs)]),isAudioMuxedInVideo:!1,baseOriginalId:null};return L.createSegmentIndex=function(){var e;return R((function(t){if(1==t.g)return L.segmentIndex?t.u(0):(e=L,w(t,I.Oc(),3));e.segmentIndex=t.h,T(t)}))},m&&n.Db&&!t.o.has(m)&&(n=n.ra.id||"",t.C.has(n)||t.C.set(n,[]),t.o.set(m,L),t.C.get(n).push(m)),L}(t,n,M,h,D,P,u,d,E,i,k,A);return r&&(r.hdr=r.hdr||x,r.colorGamut=r.colorGamut||S,r.fastSwitching=v,i=i.attributes.dependencyId)?(r.baseOriginalId=i,L.set(i,r),null):r})).filter((function(e){return!!e})),0==f.length&&0==L.size){if(i="image"==n.oa.contentType,t.g.dash.ignoreEmptyAdaptationSet||p||i)return null;throw new Ne(2,4,4003)}if(!n.oa.contentType||"application"==n.oa.contentType)for(n.oa.contentType=Xm(f[0].mimeType,f[0].codecs),g=(p=l(f)).next();!g.done;g=p.next())g.value.type=n.oa.contentType;for(p=n.oa.id||"__fake__"+t.za++,m=(g=l(f)).next();!m.done;m=g.next()){for(m=m.value,b=(y=l(M.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=p}return r=r.map((function(e){return e.attributes.supplementalId||e.attributes.id})).filter(Ai),{id:p,contentType:n.oa.contentType,language:D,wm:u,streams:f,drmInfos:M.drmInfos,Ah:i,Jk:r,pj:L}}function Fm(e,t){if((t=Qt(t,"urn:mpeg:dash:schema:urlparam:2014","UrlQueryInfo"))&&Zt(t,"useMPDUrlQuery",dn,!1)){var n=t.attributes.queryTemplate;if(n)return function(){return"$querypart$"==n?e.ba:n.split("&").map((function(t){if("$querypart$"==t)return e.ba;var n=/\$query:(.*?)\$/g.exec(t);if(n&&2==n.length){n=n[1];var i=new Ae(e.ba).get(n);if(i.length)return n+"="+i[0]}return t})).join("&")}}return null}function Vm(e){var t,n;return R((function(i){switch(i.g){case 1:return t=0,x(i,2),w(i,Im(e),4);case 4:t=i.h,A(i,3);break;case 2:if(n=k(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(),Hm(e,t),T(i)}}))}function Hm(e,t){if(!(0>e.K)){var n=e.K;0<=e.g.updatePeriod&&(n=e.g.updatePeriod),e.L.ia(Math.max(n-t,H(e.ya)))}}function Km(e,t,n,i){n=n||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,pixelAspectRatio:void 0,qf:null,audioSamplingRate:null,qb:0,Df:1,encrypted:!1},i=i||n.cb;var r,a=t.attributes.id,o=t.attributes.supplementalId,s=Xt(t,"BaseURL"),u=!1;if(e.i)for(var c=l(s),d=c.next();!d.done;d=c.next()){var h=d.value;d=h.attributes.serviceLocation,h=Yt(h),d&&h&&(Fg(e.i,a,d,h),u=!0)}u&&e.i||(r=s.map(Yt));var p=e.i;e=t.attributes.contentType||n.contentType,c=t.attributes.mimeType||n.mimeType,d=nl([t.attributes.codecs||n.codecs]).join(","),h=Zt(t,"frameRate",hn)||n.frameRate;var f=t.attributes.sar||n.pixelAspectRatio,g=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}(Xt(t,"InbandEventStream"),n.emsgSchemeIdUris),m=Xt(t,"AudioChannelConfiguration");m=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}(m)||n.qf;var v=Zt(t,"audioSamplingRate",ln)||n.audioSamplingRate;e||(e=Xm(c,d));var y=$t(t,"SegmentBase"),b=$t(t,"SegmentTemplate"),w=y&&Zt(y,"availabilityTimeOffset",cn)||0,T=b&&Zt(b,"availabilityTimeOffset",cn)||0,x=s&&s.length&&Zt(s[0],"availabilityTimeOffset",cn)||0;w=n.qb+x+w+T,T=null,(x=$t(t,"SegmentSequenceProperties"))&&(x=$t(x,"SAP"))&&(T=Zt(x,"cadence",sn)),x=t.attributes.label;var S=Xt(t,"Label");return S&&S.length&&Wt(S=S[0])&&(x=Wt(S)),{cb:function(){return Qe(i(),s.length?p&&u?Vg(p,a):r||[]:[])},Cd:y||n.Cd,tc:$t(t,"SegmentList")||n.tc,Gc:b||n.Gc,yf:$t(t,"ProducerReferenceTime")||n.yf,width:Zt(t,"width",ln)||n.width,height:Zt(t,"height",ln)||n.height,contentType:e,mimeType:c,codecs:d,frameRate:h,pixelAspectRatio:f,emsgSchemeIdUris:g,id:o||a,originalId:a,language:t.attributes.lang,qf:m,audioSamplingRate:v,qb:w,Ze:null,Df:T||n.Df,label:x||null,encrypted:!1}}function Gm(e,t,n,i){var r,a,o,s,u,l,c;return R((function(d){if(1==d.g)return r=[Ke(n)],a=Qe(t(),r),(o=Br(a,e.g.retryParameters)).method=i,s=e.j.networkingEngine.request(4,o,{isPreload:e.na()}),Or(e.P,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=Ue(u.data);return c=Date.parse(l),isNaN(c)?d.return(0):d.return(c-Date.now())}))}function zm(e,t,n,i,r){for(var a=i.attributes.schemeIdUri||"",o=i.attributes.value||"",s=Zt(i,"timescale",ln)||1,u=Zt(i,"presentationTimeOffset",ln)||0,c=(i=l(Xt(i,"Event"))).next();!c.done;c=i.next()){var d=Zt(c=c.value,"presentationTime",ln)||0,h=Zt(c,"duration",ln)||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||"",timescale:s,eventElement:vn(c),eventNode:yn(c)},e.j.onTimelineRegionAdded(c))}}function qm(e,t,n,i,r){var a,o,s,u;return R((function(l){return 1==l.g?(a=Gr,o=r?0:1,s=rl(t,n,i,e.g.retryParameters),w(l,Wm(e,s,a,{type:o}),2)):(u=l.h,l.return(u.data))}))}function Xm(e,t){return mi(t=ni(e,t))?rt:e.split("/")[0]}function Wm(e,t,n,i){return i||(i={}),i.isPreload=e.na(),t=e.j.networkingEngine.request(n,t,i),Or(e.P,t),t.promise}function Ym(){}(i=Em.prototype).configure=function(e,t){var n=this.j&&e.updatePeriod!=this.g.updatePeriod&&0<=e.updatePeriod;this.g=e,t&&(this.na=t),n&&this.h&&this.h.presentationTimeline.V()&&this.L.Jb(),this.i&&this.i.configure(this.g),this.m&&(this.m.Ii(this.g.dash.multiTypeVariantsAllowed&&pt()),this.m.Mi(this.g.dash.useStreamOnceInPeriodFlattening))},i.start=function(e,t){var n,i=this;return R((function(r){if(1==r.g)return i.va=t.isLowLatencyMode(),i.A=[e],i.j=t,w(r,Im(i),2);if(n=r.h,i.j&&Hm(i,n),!i.j)throw new Ne(2,7,7001);return r.return(i.h)}))},i.stop=function(){for(var e=l(this.o.values()),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.h=null,this.o.clear(),this.C.clear(),this.s.clear(),this.B.clear(),this.l={mf:"",type:"",profiles:[],nc:null,qb:0,cb:null,be:0},this.m=null,null!=this.L&&(this.L.stop(),this.L=null),this.i&&this.i.destroy(),this.H&&(this.H.release(),this.H=null),this.ka.clear(),this.P.destroy()},i.update=function(){var e,t=this;return R((function(n){return 1==n.g?(x(n,2),w(n,Im(t),4)):2!=n.g?A(n,0):(e=k(n),t.j&&e?(t.j.onError(e),void T(n)):n.return())}))},i.onExpirationUpdated=function(){},i.onInitialVariantChosen=function(e){if(this.h&&this.h.presentationTimeline.V()){var t=e.video||e.audio;if(t&&t.segmentIndex){e=this.h.presentationTimeline.Ac();var n=t.segmentIndex.find(e);null!=n&&(t=t.segmentIndex.get(n))&&(this.K=t.endTime-e,Hm(this,0))}}},i.banLocation=function(e){this.i&&this.i.banLocation(e)},i.setMediaElement=function(e){this.I=e},F("shaka.dash.DashParser",Em),$a("application/dash+xml",(function(){return new Em})),$a("video/vnd.mpeg.dash.mpd",(function(){return new Em})),F("shaka.dependencies",Ym),Ym.has=function(e){return Qm.has(e)},Ym.add=function(e,t){if(!$m[e])throw Error(e+" is not supported");e==Jm?oe("mux.js","mux.js is no longer used in Shaka Player."):Qm.set(e,(function(){return t}))};var Jm="muxjs",$m={xm:Jm,ISOBoxer:"ISOBoxer"};Ym.Allowed=$m;var Qm=new Map([["ISOBoxer",function(){return e.ISOBoxer}]]);function Zm(){this.j=new ee((function(){return["Oculus","Quest"].some((function(e){return navigator.userAgent.includes(e.toLowerCase())}))?"VR":navigator.userAgent.match(/Smart( ?|_)TV/i)||navigator.userAgent.match(/Android ?TV/i)?"TV":navigator.userAgentData?navigator.userAgentData.mobile?"MOBILE":"DESKTOP":/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)?"MOBILE":navigator.userAgentData&&navigator.userAgentData.platform?"android"==navigator.userAgentData.platform.toLowerCase()?"MOBILE":"DESKTOP":navigator.userAgent.includes("Android")?"MOBILE":"DESKTOP"})),this.l=new ee((function(){return navigator.vendor.includes("Apple")&&(navigator.userAgent.includes("Version/")||navigator.userAgent.includes("OS/"))?"WEBKIT":navigator.userAgent.includes("Edge/")?"EDGE":navigator.userAgent.includes("Chrome/")?"CHROMIUM":navigator.userAgent.includes("Firefox/")?"GECKO":"UNKNOWN"}))}function ev(){var t=e.ManagedMediaSource||e.MediaSource;return!(!t||!t.isTypeSupported)}function tv(t){return te(),void 0!==e.matchMedia&&e.matchMedia("(color-gamut: p3)").matches?t?"HLG":"PQ":"SDR"}function nv(){Zm.call(this),this.g=new ee((function(){var e=navigator.userAgent.match(/Version\/(\d+)/);return e||(e=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(e[1],10):null})),this.h=new ee((function(){return/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||1<navigator.maxTouchPoints?"xr"in navigator?"APPLE_VR":"MOBILE":"xr"in navigator?"APPLE_VR":"DESKTOP"}))}function iv(){if(!rv())throw Error("Not a Chromecast device!");Zm.call(this),this.h=new ee((function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/);return e?parseInt(e[1],10):null})),this.g=new ee((function(){var e=navigator.userAgentData&&navigator.userAgentData.platform||navigator.userAgent;return(e=e.toLowerCase()).includes("android")?av:e.includes("fuchsia")?ov:sv}))}function rv(){return navigator.userAgent.includes("CrKey")&&!navigator.userAgent.includes("VIZIO SmartCast")}(i=Zm.prototype).dc=function(){return!!navigator.mediaCapabilities},i.La=function(){return this.j.value()},i.Da=function(){return this.l.value()},i.fe=function(){return!1},i.Ai=function(){return!1},i.$e=function(){return!1},i.Bi=function(){return!1},i.ee=function(){return!1},i.bd=function(){return!0},i.cd=function(){return!0},i.je=function(){return!0},i.Gi=function(){return 0},i.ic=function(){return Promise.resolve({width:1/0,height:1/0})},i.Pi=function(){return!1},i.ph=function(){return!1},i.Ua=function(e){var t=this.La();return"TV"!==t&&"CONSOLE"!==t&&"CAST"!==t||(e.ads.customPlayheadTracker=!0,e.ads.skipPlayDetection=!0,e.ads.supportsMultipleMediaElements=!1),e},i.uh=function(){return!!e.indexedDB},i.xi=function(){return[]},i.Wi=function(){return!1},i.li=function(){return!1},i.fh=function(){return!1},i.If=function(){return!0},i.mi=function(){return!1},i.Vi=function(){return!0},i.$c=function(){return!1},i.Qg=function(e){return"com.apple.fps"===e},i.toString=function(){return"Device: "+this.Ob()+" v"+this.xa()+"; Type: "+this.La()},m(nv,Zm),(i=nv.prototype).xa=function(){return this.g.value()},i.Ob=function(){return"Apple Browser"},i.La=function(){return this.h.value()},i.Da=function(){return"WEBKIT"},i.dc=function(){return!1},i.fe=function(e,t){return"audio"===t},i.$e=function(){return!0},i.Bi=function(e){return"audio"===e},i.Ua=function(e){return Zm.prototype.Ua.call(this,e),e.abr.minTimeToSwitch=.5,e},i.Wi=function(){return!0},(navigator.vendor||"").includes("Apple")&&(/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||1<navigator.maxTouchPoints||navigator.userAgentData&&navigator.userAgentData.platform&&"macos"==navigator.userAgentData.platform.toLowerCase()||navigator.platform&&navigator.platform.toLowerCase().includes("mac"))&&(ne=function(){return new nv}),m(iv,Zm),(i=iv.prototype).xa=function(){return this.h.value()},i.Ob=function(){return"Chromecast with "+this.g.value()},i.La=function(){return"CAST"},i.Da=function(){return"CHROMIUM"},i.dc=function(){return Zm.prototype.dc.call(this)&&this.g.value()!==sv},i.cd=function(){return this.g.value()!==sv},i.Gi=function(){switch(this.g.value()){case av:return 0;case ov:return 3;default:return 1}},i.ic=function(){var t,n,i,r;return R((function(a){switch(a.g){case 1:if(t=e.cast&&cast.__platform__&&cast.__platform__.canDisplayType,n={width:1280,height:720},x(a,2),!(i=t)){a.u(4);break}return w(a,cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160'),5);case 5:i=a.h;case 4:if(i){n.width=3840,n.height=2160,a.u(6);break}if(!(r=t)){a.u(7);break}return w(a,cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=1920; height=1080'),8);case 8:r=a.h;case 7:r&&(n.width=1920,n.height=1080);case 6:A(a,3);break;case 2:z("Failed to check canDisplayType:",k(a));case 3:return a.return(n)}}))},i.Ua=function(e){return Zm.prototype.Ua.call(this,e),e.streaming.stallSkip=0,e},i.uh=function(){return!1},i.$c=function(){return!0};var av="Android",ov="Fuchsia",sv="Linux";function uv(){Zm.call(this);var e=this;this.i=new ee((function(){var e=navigator.userAgent.match(/(Chrome|Firefox)\/(\d+)/);return e?parseInt(e[2],10):null})),this.g=new ee((function(){return navigator.userAgent.match(/Edge?\//)?"Edge":navigator.userAgent.includes("Chrome")?"Chrome":navigator.userAgent.includes("Firefox")?"Firefox":"Unknown"})),this.h=new ee((function(){return navigator.userAgentData&&navigator.userAgentData.platform?"windows"==navigator.userAgentData.platform.toLowerCase():!!navigator.platform&&navigator.platform.toLowerCase().includes("win32")})),this.o=new ee((function(){return!navigator.userAgent.match(/Edge?\//)||!e.h.value()})),this.m=new ee((function(){return navigator.userAgent.includes("sony.hbbtv.tv")}))}function lv(){Zm.apply(this,arguments)}function cv(){Zm.call(this),this.g=new ee((function(){var e=navigator.userAgent.match(/PlayStation (\d+)/);return e?parseInt(e[1],10):null}))}function dv(){Zm.call(this);var e=navigator.userAgent.match(/Tizen (\d+).(\d+)/);this.g=e?parseInt(e[1],10):null,this.h=e?parseInt(e[2],10):null}function hv(){Zm.apply(this,arguments)}function pv(){Zm.call(this),this.h=new ee((function(){return navigator.userAgent.includes("DT_STB_BCM")})),this.g=new ee((function(){if(navigator.userAgent.includes("DT_STB_BCM"))return 11;var e=navigator.userAgent.match(/Version\/(\d+)/);return e||(e=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(e[1],10):null}))}function fv(){Zm.call(this),this.g=function(){var e=null,t=navigator.userAgent.match(/Chrome\/(\d+)/);switch(t&&(e=parseInt(t[1],10)),e){case 38:return 3;case 53:return 4;case 68:return 5;case 79:return 6;case 87:return 22;case 94:return 23;case 108:return 24;case 120:return 25;default:return null}}()}function gv(){Zm.call(this),this.g=navigator.userAgent.includes("Edge/");var e=navigator.userAgent.match(/Edge?\/(\d+)/);this.h=e?parseInt(e[1],10):null}function mv(){var e=null;try{e="undefined"!=typeof Windows?Windows:chrome.webview.hostObjects.sync.Windows}catch(e){}return e}function vv(e,t,n){this.type=e,this.aa=t,this.segments=n||null}function yv(e,t,n,i){this.id=e,this.name=t,this.attributes=n,this.value=void 0===i?null:i}function bv(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 wv(e,t){return(e=e.attributes.filter((function(e){return e.name==t}))).length?e[0]:null}function Tv(e,t,n){return(e=wv(e,t))?e.value:n||null}function xv(e,t){if(!(e=wv(e,t)))throw new Ne(2,4,4023,t);return e.value}function Sv(e,t,n){n=void 0===n?[]:n,this.aa=t,this.g=e,this.rc=n}function Av(e,t){this.name=e,this.value=t}function kv(e,t){return e.filter((function(e){return e.name==t}))}function Ev(e,t){return e.filter((function(e){return xv(e,"TYPE")==t}))}function Iv(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 Cv(e,t,n){return n=void 0===n?0:n,(e=Iv(e,t))?Number(e.value):n}function Mv(e,t,n){return t?Dv(e,[t],n):[]}function Dv(e,t,n){if(!t.length)return[];var i=t;return n&&n.size&&(i=t.map((function(e){return Pv(e,n)}))),Qe(e,i)}function Pv(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 Ne(2,4,4039,r);e=e.replace(i,a)}return e}function Rv(){this.g=0}function Lv(e,t){var n=(t=(t=Ue(t)).replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim()).split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(n[0]))throw new Ne(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=Nv(e,a),--e.g,Ov.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=Nv(e,o),jv.includes(o.name)){if(1!=t)throw new Ne(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=Nv(e,u),Ov.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"==Tv(u,"TYPE")?a.push(u):"MAP"==Tv(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 Sv(u,i,a)),i=[],a=[]);return a.length&&(s&&i.push(s),n.push(new Sv("",i,a))),new vv(t,r,n)}r.push(o),"EXT-X-STREAM-INF"==o.name&&(o.attributes.push(new Av("URI",s)),i=!0)}}return new vv(t,r)}function Nv(e,t){e=e.g++;var n=t.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!n)throw new Ne(2,4,4016,t);t=n[1];var i,r=n[2];if(n=[],r){var a;(a=Lt(r=new Pt(r),/^([^,=]+)(?:,|$)/g))&&(i=a[1]);for(var o=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;a=Lt(r,o);)n.push(new Av(a[1],a[2]||a[3])),Rt(r)}return new yv(e,t,n,i)}rv()&&(ne=function(){return new iv}),m(uv,Zm),(i=uv.prototype).xa=function(){return this.i.value()},i.Ob=function(){return this.g.value()},i.fe=function(e){return!!mr(e)&&"Edge"===this.g.value()&&this.h.value()},i.Ai=function(){return"Edge"===this.g.value()&&this.h.value()},i.$e=function(){return"Edge"===this.g.value()&&this.h.value()},i.cd=function(){return this.o.value()},i.Ua=function(e){if(Zm.prototype.Ua.call(this,e),this.h.value())switch(this.g.value()){case"Firefox":e.drm.keySystemsMapping={"com.microsoft.playready":"com.microsoft.playready.recommendation"};break;case"Chrome":e.drm.keySystemsMapping={"com.microsoft.playready":"com.microsoft.playready.recommendation.3000","com.microsoft.playready.recommendation":"com.microsoft.playready.recommendation.3000"}}return e},i.fh=function(){return"Edge"===this.g.value()||this.m.value()},i.$c=function(){if("GECKO"===this.Da()){var e=this.xa();return null!==e?100<=e:Zm.prototype.$c.call(this)}return Zm.prototype.$c.call(this)},i.Qg=function(e){return"GECKO"===this.Da()?e.startsWith("com.microsoft.playready.recommendation"):Zm.prototype.Qg.call(this,e)},ie=function(){return new uv},m(lv,Zm),(i=lv.prototype).xa=function(){return null},i.Ob=function(){return"Hisense"},i.La=function(){return"TV"},i.dc=function(){return!1},i.ic=function(){var t={width:1920,height:1080},n=null;if(e.Hisense_Get4KSupportState)try{n=e.Hisense_Get4KSupportState()}catch(e){}return null==n&&(n=navigator.userAgent.includes("UHD")),n&&(t.width=3840,t.height=2160),Promise.resolve(t)},i.Ua=function(e){return Zm.prototype.Ua.call(this,e),e.streaming.stallSkip=0,e},(navigator.userAgent.includes("Hisense")||navigator.userAgent.includes("VIDAA"))&&(ne=function(){return new lv}),m(cv,Zm),(i=cv.prototype).Ob=function(){return"PlayStation"},i.La=function(){return"CONSOLE"},i.Da=function(){return"WEBKIT"},i.xa=function(){return this.g.value()},i.dc=function(){return!1},i.bd=function(){return!1},i.cd=function(){return!1},i.ph=function(){return 4===this.xa()},i.ic=function(){var t,n,i,r;return R((function(a){switch(a.g){case 1:return t={width:1920,height:1080},n=!1,x(a,2),w(a,e.msdk.device.getDisplayInfo(),4);case 4:i=a.h,n="4K"===i.resolution,A(a,3);break;case 2:return k(a),x(a,5),w(a,e.msdk.device.getDisplayInfoImmediate(),7);case 7:r=a.h,n="4K"===r.resolution,A(a,3);break;case 5:q("PlayStation: Failed to get the display info:",k(a));case 3:return n&&(t.width=3840,t.height=2160),a.return(t)}}))},i.Ua=function(e){return Zm.prototype.Ua.call(this,e),4===this.xa()&&e.drm.preferredKeySystems.push("com.microsoft.playready"),e.streaming.clearDecodingCache=!0,e},i.fh=function(){return 4===this.xa()},i.If=function(){return 4!==this.xa()},navigator.userAgent.includes("PlayStation")&&(ne=function(){return new cv}),m(dv,Zm),(i=dv.prototype).xa=function(){return this.g},i.Ob=function(){return"Tizen"},i.Da=function(){return"CHROMIUM"},i.La=function(){return"TV"},i.fe=function(){return!0},i.ee=function(){return 3===this.xa()},i.dc=function(){return!1},i.bd=function(){var e=this.xa();return null!==e?4<=e:Zm.prototype.bd.call(this)},i.cd=function(){return!1},i.je=function(){return this.g&&this.h?5===this.g?5<=this.h:5<this.g:Zm.prototype.je.call(this)},i.ic=function(){var t=e.devicePixelRatio;t={width:1920<e.screen.width*t?3840:1920,height:1080<e.screen.height*t?2160:1080};try{if(webapis.systeminfo&&webapis.systeminfo.getMaxVideoResolution){var n=webapis.systeminfo.getMaxVideoResolution();t.width=n.width,t.height=n.height}else 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){q("Tizen: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(t)},i.Ua=function(e){return Zm.prototype.Ua.call(this,e),e.drm.ignoreDuplicateInitData=2!==this.xa(),3===this.xa()&&(e.streaming.crossBoundaryStrategy="reset_to_encrypted"),e.streaming.shouldFixTimestampOffset=!0,e.streaming.stallSkip=0,e.streaming.gapPadding=2,e},i.xi=function(){var e=[];return null!==this.g&&5>this.g&&e.push("opus"),e},i.li=function(){return!0},i.mi=function(){return 3===this.xa()},navigator.userAgent.includes("Tizen")&&(ne=function(){return new dv}),m(hv,Zm),hv.prototype.xa=function(){return null},hv.prototype.Ob=function(){return"Vizio"},hv.prototype.La=function(){return"TV"},hv.prototype.dc=function(){return!1},navigator.userAgent.includes("VIZIO SmartCast")&&(ne=function(){return new hv}),m(pv,Zm),(i=pv.prototype).xa=function(){return this.g.value()},i.Ob=function(){return"WebKit STB"},i.La=function(){return"TV"},i.Da=function(){return"WEBKIT"},i.dc=function(){return!1},i.bd=function(){var e=this.g.value();return null===e||15<=e},i.ic=function(){return Promise.resolve({width:e.screen.width*e.devicePixelRatio,height:e.screen.height*e.devicePixelRatio})},i.If=function(){return!this.h.value()},(navigator.userAgent.includes("DT_STB_BCM")||navigator.userAgent.includes("DT_STB_BCM")||!(!(navigator.vendor||"").includes("Apple")||/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||1<navigator.maxTouchPoints||navigator.userAgentData&&navigator.userAgentData.platform&&"macos"==navigator.userAgentData.platform.toLowerCase()||navigator.platform&&navigator.platform.toLowerCase().includes("mac")))&&(ne=function(){return new pv}),m(fv,Zm),(i=fv.prototype).xa=function(){return this.g},i.Ob=function(){return"WebOS"},i.La=function(){return"TV"},i.Da=function(){return"CHROMIUM"},i.dc=function(){return!1},i.bd=function(){var e=this.xa();return null!==e?3<e:Zm.prototype.bd.call(this)},i.cd=function(){var e=this.xa();return null!==e?6<e:Zm.prototype.cd.call(this)},i.je=function(){var e=this.xa();return null!==e?3<e:Zm.prototype.je.call(this)},i.ic=function(){var t={width:1920,height:1080};try{var n=JSON.parse(e.PalmSystem.deviceInfo);t.width=Math.max(1920,n.screenWidth),t.height=Math.max(1080,n.screenHeight)}catch(e){q("WebOS: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(t)},i.Ua=function(e){return Zm.prototype.Ua.call(this,e),3===this.xa()&&(e.streaming.crossBoundaryStrategy="reset"),e.streaming.shouldFixTimestampOffset=!0,e.streaming.stallSkip=0,e},i.Vi=function(){return!1},i.$c=function(){var e=this.xa();return null!==e?6<=e:Zm.prototype.$c.call(this)},navigator.userAgent.includes("Web0S")&&(ne=function(){return new fv}),m(gv,Zm),(i=gv.prototype).xa=function(){return this.h},i.Ob=function(){return"Xbox"},i.La=function(){return"CONSOLE"},i.Da=function(){return this.g?"EDGE":"CHROMIUM"},i.fe=function(){return!0},i.$e=function(){return!0},i.Pi=function(){return this.g},i.ic=function(){var e={width:1920,height:1080},t=mv();if(t)try{var n=new t.Media.Protection.ProtectionCapabilities,i=t.Media.Protection.ProtectionCapabilityResult;t=null;do{t=n.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(t===i.maybe);t===i.probably&&(e.width=3840,e.height=2160)}catch(e){q("Xbox: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(e)},i.Ua=function(e){return Zm.prototype.Ua.call(this,e),e.drm.parseInbandPsshEnabled=this.g,e.drm.preferredKeySystems.push("com.microsoft.playready"),this.g&&(e.streaming.gapPadding=.01),e},i.uh=function(){return!1},(navigator.userAgent.includes("Xbox One")||null!==mv())&&(ne=function(){return new gv}),yv.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 Ov="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(" "),jv="EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE EXT-X-MAP EXT-X-GAP EXT-X-TILES".split(" ");function Uv(){}function _v(e,t){try{var n=Bv(e);return Ir({uri:e,originalUri:e,data:n.data,headers:{"content-type":n.contentType},originalRequest:t})}catch(e){return kr(e)}}function Bv(t){var n=t.split(":");if(2>n.length||"data"!=n[0])throw new Ne(2,1,1004,t);if(2>(n=n.slice(1).join(":").split(",")).length)throw new Ne(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?We(t):Fe(t),contentType:i}}function Fv(){var t=this;this.g=this.h=null,this.G=1,this.A=new Map,this.K=new Map,this.B=new Map,this.B.set("video",new Map),this.B.set("audio",new Map),this.B.set(rt,new Map),this.B.set("image",new Map),this.$b=(new Map).set("com.apple.streamingkeydelivery",(function(n,i,r){return function(t,n,i,r){var a,o,s,u,l;return R((function(c){if(1==c.g){if("video/mp2t"==i)throw new Ne(2,4,4040);if("apple"===e.shakaMediaKeysPolyfill)throw new Ne(2,4,4041);if(a=xv(n,"METHOD"),!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(a))return c.return(null);o="cenc","SAMPLE-AES"==a&&(o="cbcs"),s=xv(n,"URI"),u=Ze("com.apple.fps",o,[{initDataType:"sinf",initData:new Uint8Array(0),keyId:null}],s);var d=new de(s).Cb.replace(/-/g,"").toLowerCase();return(l=32===d.length&&/^[0-9a-f]+$/.test(d)?d:null)||!r?c.u(2):w(c,My(t,r),3)}return 2!=c.g&&(l=c.h),l&&u.keyIds.add(l),c.return(u)}))}(t,n,i,r)})).set("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",(function(e){var t=xv(e,"METHOD");if(["SAMPLE-AES","SAMPLE-AES-CTR"].includes(t)){var n="cenc";"SAMPLE-AES"==t&&(n="cbcs"),n=Ze("com.widevine.alpha",n,[{initDataType:"cenc",initData:t=De((t=Bv((t=xv(e,"URI")).split("?")[0])).data)}]),(e=Tv(e,"KEYID"))&&n.keyIds.add(e.toLowerCase().substr(2)),e=Promise.resolve(n)}else e=Promise.resolve(null);return e})).set("com.microsoft.playready",(function(e){var t=xv(e,"METHOD");if(["SAMPLE-AES","SAMPLE-AES-CTR"].includes(t)){var n="cenc";"SAMPLE-AES"==t&&(n="cbcs"),n=Ze("com.microsoft.playready",n,[{initDataType:"cenc",initData:t=pa(e=De((e=Bv((e=xv(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)}]),(e=Kt(["<PLAYREADY>",Xe(e),"</PLAYREADY>"].join("\n")))&&(n.licenseServerUri=ag(e)),n=Promise.resolve(n)}else n=Promise.resolve(null);return n})).set("urn:uuid:3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c",(function(e){var t=xv(e,"METHOD");if(["SAMPLE-AES","SAMPLE-AES-CTR"].includes(t)){var n="cenc";"SAMPLE-AES"==t&&(n="cbcs"),n=Ze("com.huawei.wiseplay",n,[{initDataType:"cenc",initData:t=De((t=Bv((t=xv(e,"URI")).split("?")[0])).data)}]),(e=Tv(e,"KEYID"))&&n.keyIds.add(e.toLowerCase().substr(2)),e=Promise.resolve(n)}else e=Promise.resolve(null);return e})),this.ab=new Set,this.i=new Map,this.l=null,this.F="",this.Ya=new Rv,this.L=-1,this.ha=1/0,this.ba=this.qc=this.Za=!1,this.C=new Ti((function(){t.U&&!t.g.continueLoadingWhenPaused&&(t.S.Ja(t.U,"timeupdate"),t.U.paused)?t.S.Aa(t.U,"timeupdate",(function(){return Sy(t)})):Sy(t)})),this.za=Uy,this.m=null,this.Pa=0,this.o=1/0,this.Oa=this.Ka=this.P=0,this.W=new Nr,this.H=new Map,this.I=new Map,this.ya=new Map,this.na=new Map,this.M=new Map,this.va=new Map,this.wa=new Map,this.bc=this.ka=!1,this.eb=new V(5),this.j=null,this.N=!0,this.S=new $,this.s=this.U=null,this.Zb=function(){return!1}}function Vv(e,t){return Ay(e)?e.B.get(t.type):t.jf}function Hv(e,t){var n,i,r,a,o,s,u,d,h,p,f,g,m,v,y,b,S,E,I,C,M,D,P,L,N,O,j,U,_,B,F,V,H,K,G;return R((function(R){switch(R.g){case 1:if(t.stream.isAudioMuxedInVideo)return R.return();for(n=[],i=l(t.O()),r=i.next();!r.done;r=i.next())a=r.value,o=new de(a),s=o.g,t.Me&&(0<=t.Sb&&s.add("_HLS_msn",String(t.Sb)),0<=t.Tb&&s.add("_HLS_part",String(t.Tb))),t.Ne&&s.add("_HLS_skip","YES"),Ee(s)&&ge(o,me(s.toString())),n.push(o.toString());return x(R,2),w(R,xy(e,n,!0).promise,4);case 4:u=R.h,A(R,3);break;case 2:throw d=k(R),e.h&&e.h.disableStream(t.stream),d;case 3:if(!t.stream.segmentIndex)return R.return();if(1!=(h=Lv(e.Ya,u.data)).type)throw new Ne(2,4,4017);return(p=u.uri)==u.originalUri||t.O().includes(p)||t.zf.push(p),f=kv(h.aa,"EXT-X-DEFINE"),g=Xv(e,f,p),m=t.stream,v=Vv(e,t),w(R,uy(e,h,m.mimeType,t.O,g),5);case 5:for(y=R.h,b=y.keyIds,S=y.drmInfos,E=y.encrypted,I=y.Hh,m.encrypted||!E||I||(m.encrypted=!0),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=S,e.h.newDrmInfo(m)),C=vy(e,h,v,g,t.O,t.type),M=C.segments,(D=C.bandwidth)&&(m.bandwidth=D),P=Vu(m),L=l(M),N=L.next();!N.done;N=L.next())(O=N.value).Y&&(O.Y.rd=P);m.segmentIndex.Yd(M,e.l.Gb()),M.length&&(j=Cv(h.aa,"EXT-X-MEDIA-SEQUENCE",0),_=(U=Iv(h.aa,"EXT-X-SKIP"))?Number(Tv(U,"SKIPPED-SEGMENTS")):0,B=oy(j,M),F=B.Sb,V=B.Tb,t.Sb=F+_,t.Tb=V,H=v.get(j),m.segmentIndex.$a(H)),(K=Pu(m.segmentIndex))&&(t.Uc=K.startTime,G=M[M.length-1],t.mc=G.endTime),Iv(h.aa,"EXT-X-ENDLIST")&&(t.Rd=!0),dy(e,h),my(e,h.aa,m.type,g,t.O),T(R)}}))}function Kv(e,t,n){n=void 0!==n&&n;for(var i=-1==e.L,r=l(t),a=r.next();!a.done;a=r.next()){var o=(a=a.value).stream.segmentIndex,s=Vv(e,a);if(o=Pu(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.L=Math.max(e.L,c)),a.og=c;break}}}if(!(0>e.L))for(i=(t=l(t)).next();!i.done;i=t.next())(ry(e,(i=i.value).type)||n)&&(r=i.stream.segmentIndex)&&0<(a=e.L-i.og)&&(r.g.splice(0,a),r=Pu(r))&&(r=-r.startTime,i.stream.segmentIndex.offset(r),Gv(e,i,r))}function Gv(e,t,n){if(!(.001>Math.abs(n))){t.Uc+=n,t.mc+=n;for(var i=l(e=Vv(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.O()}}function zv(e,t,n){var i,r,a,o,s;return R((function(u){switch(u.g){case 1:return t?(i=Gr,r=rl(t.O(),t.Bc(),t.zc(),e.g.retryParameters),w(u,Ey(e,r,i,{type:t instanceof Vo?1:0}).promise,2)):u.return({mimeType:null,data:null});case 2:if(a=u.h,o=a.data,!t.aesKey){u.u(3);break}return w(u,il(o,t.aesKey,n),4);case 4:o=u.h;case 3:return t instanceof Vo?t.ge(o,!0):t.ge(o),(s=a.headers["content-type"])&&(s=s.split(";")[0].toLowerCase()),u.return({mimeType:s,data:o})}}))}function qv(e){if(Ay(e)){if(e.za==By){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.mc),n=Math.min(n,r.Uc));t=t-n||0,isNaN(e.g.availabilityWindowOverride)||(t=e.g.availabilityWindowOverride),e.l.Gf(t)}}else e.l.pb(ty(e));if(!e.l.o)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=Pu(n.stream.segmentIndex))&&n.h&&e.l.mh(n.h);e.l.hf()}function Xv(e,t,n){n=new de(n).g;for(var i=new Map,r=(t=l(t)).next();!r.done;r=t.next()){var a=r.value,o=Tv(a,"NAME"),s=Tv(a,"VALUE");r=Tv(a,"QUERYPARAM"),a=Tv(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 Wv(e){var t=new Set([ni(e.mimeType,e.codecs)]);e.segmentIndex&&e.segmentIndex.Eb((function(n){n.mimeType&&t.add(ni(n.mimeType,e.codecs))})),e.fullMimeTypes=t}function Yv(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=Tv(h,"AUDIO");var p=Tv(h,"VIDEO"),f=d||p;f&&(a.includes(f)||a.push(f),(h=Tv(h,"PATHWAY-ID"))&&r.set(f,h),d?o=!0:p&&(s=!0))}a.length&&n.length&&function(e,t,n){t=t.filter((function(e){var t=Tv(e,"URI")||"";return"SUBTITLES"!=(e=Tv(e,"TYPE"))&&(""!=t||"AUDIO"==e)}));for(var i={},r=(t=l(t)).next();!r.done;r=t.next()){var a=bv(r=r.value,!e.j);i[a]?i[a].push(r):i[a]=[r]}for(var o in i)Qv(e,i[o],n,!1)}(e,n=n.filter((function(e){return a.includes(xv(e,"GROUP-ID"))})),r),n=(r=a.sort().join(","))&&e.K.has(r)?e.K.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 xv(e,"URI")}));return d=i.audio.find((function(e){return e&&e.O().find((function(e){return g.includes(e)}))})),n=nt("video",s=Jv(e,t[0])),(u=nt("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.G++,a=[],o=l(t),s=o.next();!s.done;s=o.next()){var u=s.value;s=xv(u,"URI"),u=Tv(u,"PATHWAY-ID"),e.j&&u&&Fg(e.j,r,u,s),a.push(s)}if(o=a.sort().join(",")+n.sort().join(","),e.i.has(o))return e.i.get(o);s=a.join(",");e:{if(t=Tv(t[0],"CLOSED-CAPTIONS"),"video"==i){if(e.g.disableText){e.N=!1,t=null;break e}if(t){if("NONE"!=t){t=e.H.get(t);break e}e.N=!1}else if(!t&&e.H.size)for(t=l(e.H.keys()).next();!t.done;){t=e.H.get(t.value);break e}}t=null}return i=ey(e,r,a,n=tt(i,n),i,null,!1,s,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 Jv(e,t){return t=Tv(t,"CODECS")||"",e.ba=0<t.length,e.ba||e.g.hls.disableCodecGuessing||(t=[],e.g.disableVideo||t.push(e.g.hls.defaultVideoCodec),e.g.disableAudio||t.push(e.g.hls.defaultAudioCodec),t=t.join(",")),nl(t.split(/\s*,\s*/))}function $v(e,t,n,i,r,a,o,s,u,c,d,h){for(var p=l(n),f=p.next();!f.done;f=p.next())Ty(f.value.stream,r,a,o,s,u,null);for(r=e.g.disableVideo,n.length&&!r||(n=[null]),r&&(t=t.filter((function(e){return!e.stream.isAudioMuxedInVideo}))),r=e.g.disableAudio,t.length&&!r||(t=[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||nr(u,h)),u&&!s&&(u.bandwidth=i),!u&&s&&(s.bandwidth=i),p=a?a.stream.drmInfos:null,f=g?g.stream.drmInfos:null,g=g?g.O().sort().join(","):"";var m=a?a.O().sort().join(","):"",v=[];s&&s.codecs&&v.push(s.codecs),u&&u.codecs&&v.push(u.codecs),g=[g,m,v.sort()].join("-"),s&&u&&!fr(p,f)||e.ab.has(g)||(s={id:e.G++,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.ab.add(g))}return r}function Qv(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?xv(c,"URI"):Tv(c,"URI")||"shaka://hls-muxed",c=xv(c,"GROUP-ID"),r.push(u),a.push(c),o.set(c,u)}if(i=a.sort().join(","),u=t[0],t="","subtitles"==(s=xv(u,"TYPE").toLowerCase())&&(s=rt),s==rt)t=Tv(u,"CODECS")||"";else for(c=(a=l(a)).next();!c.done;c=a.next())if(c=c.value,e.I.has(c)){t=e.I.get(c);break}if(a=r.sort().join(","),e.i.has(a))return e.i.get(a);if(c=e.G++,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))&&Fg(e.j,c,d,h)}var p;return n=Tv(u,"LANGUAGE"),o=Tv(u,"NAME"),d="YES"==Tv(u,"DEFAULT"),h="audio"==s&&(h=Tv(u,"CHANNELS"))?parseInt(h.split("/")[0],10):null,p=!("audio"!=s||!(p=Tv(u,"CHANNELS")))&&(2==(p=p.split("/")).length&&("JOC"===p[1]||p[1].includes("ATMOS"))),(r=ey(e,c,r,t,s,n,d,o,h,null,Tv(u,"CHARACTERISTICS"),"YES"==Tv(u,"FORCED"),u="audio"==s&&(u=Tv(u,"SAMPLE-RATE"))?parseInt(u,10):null,p)).stream&&(r.stream.groupId=i),e.K.has(i)?e.K.get(i).push(r):e.K.set(i,[r]),e.i.set(a,r),r}function Zv(e,t){var n="video",i=xv(t,"URI"),r=Tv(t,"CODECS")||"";if("mjpg"==r&&(n="image"),e.i.has(i))return e.i.get(i);var a=Tv(t,"LANGUAGE"),o=Tv(t,"NAME"),s=Tv(t,"CHARACTERISTICS");return n=ey(e,e.G++,[i],r,n,a,!1,o,null,null,s,!1,null,!1),a=l((r=Tv(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=Tv(t,"BANDWIDTH"))&&(n.stream.bandwidth=Number(t)),e.i.set(i,n),n}function ey(e,t,n,i,r,a,o,s,u,c,d,h,p,f){function g(){return e.j&&1<n.length?Vg(e.j,t):y.zf.concat(Dv([e.F],n,e.A))}var m=sy(e,i,r,a,o,s,u,c,d,h,p,f);n.includes("shaka://hls-muxed")&&(m.isAudioMuxedInVideo=!0,m.mimeType="video/mp2t",Wv(m));var v,y={stream:m,type:r,zf:[],Uc:0,mc:0,jf:new Map,Ne:!1,Me:!1,Rd:!1,og:-1,Sb:-1,Tb:-1,O:g},b=null;return m.createSegmentIndex=function(){return b||(m.isAudioMuxedInVideo?(m.segmentIndex=new Du([]),Promise.resolve()):(v=xy(e,y.O(),!0),b=new Promise((function(t){t(function(t){var n,v,b,S,E,I,C,M,D,P,L,N,O,j,U,_,B,F;return R((function(R){switch(R.g){case 1:return n=at,x(R,2),w(R,t.promise,4);case 4:if(v=R.h,t.aborted)return R.return();if((b=v.uri)!=v.originalUri&&(y.O().includes(b)||y.zf.push(b)),1!=(S=Lv(e.Ya,v.data)).type)throw new Ne(2,4,4017);return E=kv(S.aa,"EXT-X-DEFINE"),I=Xv(e,E,b),C=!1,(!e.ba&&e.g.hls.disableCodecGuessing||e.N&&r==n.Ca&&!e.g.hls.disableClosedCaptionsDetection)&&0<S.segments.length&&(e.N=!1,C=!0),M=!e.ba&&e.g.hls.disableCodecGuessing,D=Ay(e),w(R,ay(e,0,I,S,g,i,r,a,o,s,u,c,d,h,p,f,void 0,C,M),5);case 5:if(P=R.h,t.aborted)return R.return();L=P.stream,cy(e,S),Ay(e)&&!D&&hy(e,S),y.Uc=P.Uc,y.mc=P.mc,y.Ne=P.Ne,y.Me=P.Me,y.Rd=P.Rd,y.jf=P.jf,y.Sb=P.Sb,y.Tb=P.Tb,m.segmentIndex=L.segmentIndex,m.encrypted=L.encrypted,m.drmInfos=L.drmInfos,m.keyIds=L.keyIds,m.mimeType=L.mimeType,m.bandwidth=m.bandwidth||L.bandwidth,m.codecs=m.codecs||L.codecs,m.closedCaptions=m.closedCaptions||L.closedCaptions,m.width=m.width||L.width,m.height=m.height||L.height,m.hdr=m.hdr||L.hdr,m.colorGamut=m.colorGamut||L.colorGamut,m.frameRate=m.frameRate||L.frameRate,"und"==m.language&&"und"!=L.language&&(m.language=L.language),m.language=m.language||L.language,m.channelsCount=m.channelsCount||L.channelsCount,m.audioSamplingRate=m.audioSamplingRate||L.audioSamplingRate,Wv(m),m.drmInfos.length&&e.h.newDrmInfo(m),N=!1,(!c&&m.closedCaptions||c&&m.closedCaptions&&c.size!=m.closedCaptions.size)&&(N=!0),e.m&&N&&e.h.makeTextStreamsForClosedCaptions(e.m),r==n.Ta&&(O=Pu(L.segmentIndex))&&O.Y&&(m.mimeType="application/mp4",Wv(m)),j=Vu(m),m.segmentIndex.Eb((function(e){e.Y&&(e.Y.rd=j)})),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.qc?iy(e,[y]):(e.qc=!0,U=Array.from(e.i.values()),_=U.filter((function(e){return e.stream.segmentIndex})),iy(e,_),qv(e),0<(B=e.o)&&e.C.ia(B))),my(e,S.aa,m.type,I,g),e.m&&(e.m.startTime=e.s),A(R,0);break;case 2:if(F=k(R),m.closeSegmentIndex(),7001===F.code)return R.return();if(!e.h.disableStream(m))throw F;T(R)}}))}(v))}))))},m.closeSegmentIndex=function(){b&&!m.segmentIndex&&v.abort(),m.segmentIndex&&(m.segmentIndex.release(),m.segmentIndex=null),b=null},y}function ty(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.mc));return t}function ny(e,t){for(var n=[],i=(t=l(t)).next();!i.done;i=t.next())(i=i.value).segmentIndex&&i.segmentIndex.Eb((function(e){n.push(e)}));e.l.$d(n)}function iy(e,t){if(!Ay(e))for(var n=ty(e),i=l(t),r=i.next();!r.done;r=i.next())r.value.stream.segmentIndex.ld(0,n);ny(e,t.map((function(e){return e.stream}))),n=(i=Array.from(e.i.values()).filter((function(e){return e.stream.segmentIndex}))).some((function(e){return"audio"==e.stream.type})),r=i.some((function(e){return"video"==e.stream.type})),i=Ay(e)&&!e.Za,n=!Ay(e)&&e.Za&&!(n&&r),e.g.hls.ignoreManifestProgramDateTime||i||n?Kv(e,t,i):(function(e,t){if(1/0==e.ha)for(var n=(t=l(t)).next();!n.done;n=t.next())null!=(n=Pu(n.value.stream.segmentIndex))&&null!=n.h&&(e.ha=Math.min(e.ha,n.h));if(1/0!=(t=e.ha))for(var i=(n=l(e.i.values())).next();!i.done;i=n.next())if(!ry(e,(i=i.value).type)){var r=i.stream.segmentIndex;if(null!=r){var a=Pu(r);if(a)if(null==a.h)z("Missing EXT-X-PROGRAM-DATE-TIME for stream",i.O(),"Expect AV sync issues!");else for(Gv(e,i,a.h-t-a.startTime),r=(i=l(r)).next();!r.done;r=i.next())r.value.vh(t)}}}(e,t),0<e.g.hls.ignoreManifestProgramDateTimeForTypes.length&&Kv(e,t))}function ry(e,t){return!!e.g.hls.ignoreManifestProgramDateTime||e.g.hls.ignoreManifestProgramDateTimeForTypes.includes(t)}function ay(e,t,n,i,r,a,o,s,u,c,d,h,p,f,g,m,v,y,b){var T,S,E,I,C,M,D,P,L,N,O,j,U,_,B,F,V,H,K,G,z,q,X,W,Y,J,$,Q,Z;return y=void 0===y||y,b=void 0===b||b,R((function(t){switch(t.g){case 1:if(T=i.segments||[],S=T.every((function(e){return!!Iv(e.aa,"EXT-X-GAP")})),!T.length||S)throw new Ne(2,4,4053);if(function(e,t){var n=Iv(t.aa,"EXT-X-PLAYLIST-TYPE");t=Iv(t.aa,"EXT-X-ENDLIST"),t=n&&"VOD"==n.value||t,n=n&&"EVENT"==n.value&&!t,n=!t&&!n,ky(e,t?Uy:n?By:_y)}(e,i),Ay(e)&&dy(e,i),E=Ay(e)?e.B.get(o):new Map,I=vy(e,i,E,n,r,o),C=I.segments,M=I.bandwidth,O=N=L=P=D=null,!(0<C.length&&y)){t.u(2);break}return w(t,function(e,t){var n,i,r,a,o,s,u,c,d,h,p,f,g,m,v,y,b,T;return R((function(x){if(1==x.g)return n=tl(e.g.hls.mediaPlaylistFullMimeType),t.length?(i=wy(e,t),r=i.segment,a=i.segmentIndex,o=r.O(),s=o[0],u=new de(s),c=u.ob.split(".").pop(),(d=Dy.get(c))?x.return(tl(d)):w(x,Promise.all([zv(e,r.Y,0),zv(e,r,a)]),2)):x.return(n);if(h=x.h,p=h[1].mimeType,f=h[0].data,g=h[1].data,m="mp4 mp4a m4s m4i m4a m4f cmfa mp4v m4v cmfv fmp4".split(" "),v=["audio/mp4","video/mp4","video/iso.segment"],!(y=r.Y||v.includes(p))&&Is(De(g))){var S=g,A=e.g.disableAudio,k=e.g.disableVideo,E=e.g.disableText,I=De(S),C=(new Ss).parse(I),M=C.Od();I=C.Ig();var D=[],P=!1,R=!1;if(!A)switch(M.audio){case"aac":case"aac-loas":C.sb().length&&(D.push("mp4a.40.2"),P=!0);break;case"mp3":C.sb().length&&(D.push("mp4a.40.34"),P=!0);break;case"ac3":C.sb().length&&(D.push("ac-3"),P=!0);break;case"ec3":C.sb().length&&(D.push("ec-3"),P=!0);break;case"opus":C.sb().length&&(D.push("opus"),P=!0)}if(!k)switch(M.video){case"avc":I.codec?D.push(I.codec):D.push("avc1.42E01E"),R=!0;break;case"hvc":I.codec?D.push(I.codec):D.push("hvc1.1.6.L93.90"),R=!0;break;case"av1":D.push("av01.0.01M.08"),R=!0}if(D.length){if(A=P&&!R,k=new Map,R&&!E){for((E=new bt("video/mp2t")).vf(S),R=(S=l(E.Uf())).next();!R.done;R=S.next())R=R.value,k.set(R,R);E.Fd()}I={type:A?"audio":"video",mimeType:"video/mp2t",codecs:D.join(", "),language:null,height:I.height,width:I.width,channelCount:null,sampleRate:null,closedCaptions:k,oe:null,colorGamut:null,frameRate:I.frameRate}}else I=null;if(b=I)return x.return(b)}else if((y||m.includes(c))&&(T=function(e,t,n){function i(e){o=e.name;var t=e.reader;t.skip(24);var n=t.Ba(),i=t.Ba();t.skip(50),f=String(n),p=String(i),e.reader.Ga()&&na(e)}function r(e){var t=ro(e.reader);g=t.channelCount,m=t.sampleRate,a(e.name)}function a(e){switch(e=e.toLowerCase()){case"avc1":case"avc3":u.push(e+".42E01E"),d=!0;break;case"hev1":case"hvc1":u.push(e+".1.6.L93.90"),d=!0;break;case"dvh1":case"dvhe":u.push(e+".05.04"),d=!0;break;case"vp09":u.push(e+".00.10.08"),d=!0;break;case"av01":u.push(e+".0.01M.08"),d=!0;break;case"mp4a":s.push("mp4a.40.2"),c=!0;break;case"ac-3":case"ec-3":case"ac-4":case"opus":case"flac":s.push(e),c=!0;break;case"apac":s.push("apac.31.00"),c=!0}}var o,s=[],u=[],c=!1,d=!1,h=null,p=null,f=null,g=null,m=null,v=null,y=null;if((new ta).box("moov",na).box("trak",na).box("mdia",na).R("mdhd",(function(e){h=no(e.reader,e.version).language})).box("minf",na).box("stbl",na).R("stsd",ia).box("mp4a",(function(e){var t=ro(e.reader);g=t.channelCount,m=t.sampleRate,e.reader.Ga()?na(e):a(e.name)})).box("esds",(function(e){e=e.reader;for(var t,n,i="mp4a";e.Ga();){t=e.X();for(var r=e.X();128&r;)r=e.X();if(3==t)e.Ba(),128&(r=e.X())&&e.Ba(),64&r&&e.skip(e.X()),32&r&&e.Ba();else if(4==t)n=e.X(),e.skip(12);else if(5==t)break}n&&(i+="."+oo(n),5==t&&e.Ga()&&(31==(n=(248&(t=e.X()))>>3)&&e.Ga()&&(n=32+((7&t)<<3)+((224&e.X())>>5)),i+="."+n)),s.push(i),c=!0})).box("ac-3",r).box("ec-3",r).box("ac-4",r).box("Opus",r).box("fLaC",r).box("apac",r).box("avc1",i).box("avc3",i).box("hev1",i).box("hvc1",i).box("dva1",i).box("dvav",i).box("dvh1",i).box("dvhe",i).box("vp09",i).box("av01",i).box("avcC",(function(e){var t=o||"";switch(o){case"dvav":t="avc3";break;case"dva1":t="avc1"}(e=e.reader).skip(1),e=t+"."+oo(e.X())+oo(e.X())+oo(e.X()),u.push(e),d=!0})).box("hvcC",(function(e){var t=o||"";switch(o){case"dvh1":t="hvc1";break;case"dvhe":t="hev1"}var n=e.reader;n.skip(1);var i=["","A","B","C"][(e=n.X())>>6],r=31&e,a=n.T(),s=(32&e)>>5?"H":"L";e=[n.X(),n.X(),n.X(),n.X(),n.X(),n.X()],n=n.X();for(var l=0,c=0;32>c&&(l|=1&a,31!=c);c++)l<<=1,a>>=1;for(t=t+"."+i+r+"."+oo(l,!0),t+="."+s+n,i="",r=e.length;r--;)((s=e[r])||i)&&(i="."+s.toString(16).toUpperCase()+i);t+=i,u.push(t),d=!0})).box("dvcC",(function(e){var t=o||"";switch(o){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.X(),n=n.X(),u.push(t+"."+so(e>>1&127)+"."+so(e<<5&32|n>>3&31)),d=!0})).box("dvvC",(function(e){var t=o||"";switch(o){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.X(),n=n.X(),u.push(t+"."+so(e>>1&127)+"."+so(e<<5&32|n>>3&31)),d=!0})).R("vpcC",(function(e){var t=o||"",n=e.reader;e=n.X();var i=n.X();n=n.X()>>4&15,u.push(t+"."+so(e)+"."+so(i)+"."+so(n)),d=!0})).box("av1C",(function(e){var t=o||"";"dav1"===o&&(t="av01");var n=e.reader;n.skip(1);var i=(e=n.X())>>>5,r=(64&(n=n.X()))>>6;u.push(t+"."+i+"."+so(31&e)+(n>>>7?"H":"M")+"."+so(2===i&&r?(32&n)>>5?12:10:r?10:8)+"."+((16&n)>>4)+"."+((8&n)>>3)+((4&n)>>2)+(3&n)+"."+so(1)+"."+so(1)+"."+so(1)+".0"),d=!0})).box("enca",aa).box("encv",ra).box("sinf",na).box("frma",(function(e){a(e=ao(e.reader).codec)})).box("colr",(function(e){u=u.map((function(t){if(t.startsWith("av01.")){var n=e.reader,i=n.Ma(),r=n.Ub(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.Ba(),a=n.Ba();var o=n.Ba(),s=n.X()>>7,u=t.split(".");10==u.length&&(u[6]=so(r),u[7]=so(a),u[8]=so(o),u[9]=String(s),t=u.join("."))}n.seek(i)}return t}));var t=function(e){var t=null,n=null,i=e.Ub(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.Ba()){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.Ba(),e.Ba(),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,oe:n}}(e.reader),n=t.colorGamut;v=t.oe,y=n})).parse(e||t,!0,!0),!s.length&&!u.length)return null;var b=c&&!d,w=new Map;if(d&&!n){n=new bt("video/mp4"),e&&n.init(e);try{n.vf(t);for(var T=l(n.Uf()),x=T.next();!x.done;x=T.next()){var S=x.value;w.set(S,S)}}catch(e){}n.Fd()}return{type:b?"audio":"video",mimeType:b?"audio/mp4":"video/mp4",codecs:nl(s.concat(u)).join(", "),language:h,height:p,width:f,channelCount:g,sampleRate:m,closedCaptions:w,oe:v,colorGamut:y,frameRate:null}}(f,g,e.g.disableText)))return x.return(T);return p?x.return(tl(p)):x.return(n)}))}(e,C),3);case 3:j=t.h,o!=j.type&&Ay(e)&&(e.B.set(j.type,e.B.get(o)),e.B.set(o,new Map)),o=j.type,s=j.language,d=j.channelCount,g=j.sampleRate,e.g.disableText||(h=j.closedCaptions),P=j.height,D=j.width,L=j.oe,N=j.colorGamut,O=j.frameRate,b&&(v=j.mimeType,a=j.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,p,f,g,m;return R((function(v){switch(v.g){case 1:return r=Gr,a=wy(e,i),2==(o=a.segment).status?v.return(by(t)):(s=o.O(),u=new de(s[0]),l=u.ob.split(".").pop(),c=Oy.get(t),(d=c.get(l))||(d=Dy.get(l))||(d=yy(t,n))?v.return(d):(p=1,f=Br(s,e.g.retryParameters),x(v,2),f.method="HEAD",w(v,Ey(e,f,r,{type:p}).promise,4)));case 4:g=v.h,h=g.headers["content-type"],A(v,3);break;case 2:if(!(m=k(v))||1002!=m.code&&1001!=m.code){v.u(3);break}return f.method="GET",e.g.hls.allowRangeRequestsToGuessMimeType&&(f.headers.Range="bytes=0-0"),w(v,Ey(e,f,r,{type:p}).promise,6);case 6:g=v.h,h=g.headers["content-type"];case 3:if(!h){v.u(7);break}if("application/octet-stream"!=(d=h.toLowerCase().split(";")[0])){v.u(8);break}if(g.data.byteLength){v.u(9);break}return f.method="GET",w(v,Ey(e,f,r,{type:p}).promise,10);case 10:g=v.h;case 9:Is(De(g.data))&&(d="video/mp2t");case 8:if("application/octet-stream"!=d)return v.return(d);case 7:return v.return(by(t))}}))}(e,o,a,C),5);case 5:v=t.h,o!=rt||a||"application/mp4"!=v||!C[0]||C[0].Y||(v="text/vtt");case 4:return w(t,uy(e,i,v,r,n),6);case 6:if(U=t.h,_=U.drmInfos,B=U.keyIds,F=U.encrypted,V=U.Hh,F&&!_.length&&!V)throw new Ne(2,4,4026);return(H=sy(e,a,o,s,u,c,d,h,p,f,g,m)).encrypted=F&&!V,H.drmInfos=_,H.keyIds=B,H.mimeType=v,M&&(H.bandwidth=M),Wv(H),"video"==o&&(D||P||L||N)&&Ty(H,D,P,O,L,null,N),Ay(e)&&dy(e,i),K=C[0].startTime,G=C[C.length-1],z=G.endTime,q=new Du(C),H.segmentIndex=q,W=!!(X=Iv(i.aa,"EXT-X-SERVER-CONTROL"))&&null!=wv(X,"CAN-SKIP-UNTIL"),Y=!!X&&null!=wv(X,"CAN-BLOCK-RELOAD"),J=Cv(i.aa,"EXT-X-MEDIA-SEQUENCE",0),$=oy(J,C),Q=$.Sb,Z=$.Tb,t.return({stream:H,type:o,zf:[],O:r,Uc:K,mc:z,Ne:W,Me:Y,Rd:!1,og:-1,Sb:Q,Tb:Z,jf:E})}}))}function oy(e,t){e=e+t.length-1;var n=-1;if(!t.length)return{Sb:++e,Tb: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,Tb:n}):(e++,t.m&&(n=0),{Sb:e,Tb:n})}function sy(e,t,n,i,r,a,o,s,u,c,d,h){var p=yy(n,t)||by(n),f=[];if(u)for(var g=(u=l(u.split(","))).next();!g.done;g=u.next())f.push(g.value);return u=void 0,g=null,n==rt?u=f.includes("public.accessibility.transcribes-spoken-dialog")&&f.includes("public.accessibility.describes-music-and-sound")?"caption":"subtitle":f.includes("public.accessibility.describes-video")&&(g="visually impaired"),f.length||"subtitle"!==u||f.push("subtitle"),Wv(e={id:e.G++,originalId:a,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:p,codecs:t,kind:n==rt?"subtitle":void 0,encrypted:!1,drmInfos:[],keyIds:new Set,language:Di(i||"und"),originalLanguage:i,label:a,type:n,primary:r,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,frameRate:void 0,pixelAspectRatio:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:f,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,baseOriginalId:null}),e}function uy(e,t,n,i,r){var a,o,s,u,c,d,h,p,f,g,m,v,y,b,T,x,S,A,k,E,I,C,M,D,P,L,N,O,j;return R((function(R){switch(R.g){case 1:if(a=new Map,!e.g.ignoreDrmInfo&&t.segments)for(o=l(t.segments),s=o.next();!s.done;s=o.next())if(u=s.value,c=kv(u.aa,"EXT-X-KEY"),d=null,c.length)for(d=py(e,t,u.aa,i,r),h=l(c),p=h.next();!p.done;p=h.next())f=p.value,a.set(f,d);m=g=!1,v=[],y=new Set,b=l(a),T=b.next();case 2:if(T.done){R.u(4);break}if(x=T.value,S=l(x),A=S.next().value,k=S.next().value,I=k,"NONE"==(C=xv(E=A,"METHOD"))){R.u(3);break}if(g=!0,M=Tv(E,"KEYFORMAT")||"identity",D=null,Iy(C)){m=!0,R.u(3);break}if("identity"==M)return w(R,Cy(e,E,n,i,I,r),11);if(!(P=e.$b.get(M))){L=null,R.u(9);break}return w(R,P(E,n,I),10);case 10:L=R.h;case 9:D=L,R.u(6);break;case 11:D=R.h;case 6:if(D){if(D.keyIds)for(N=l(D.keyIds),O=N.next();!O.done;O=N.next())j=O.value,y.add(j);v.push(D)}case 3:T=b.next(),R.u(2);break;case 4:return R.return({drmInfos:v,keyIds:y,encrypted:g,Hh:m})}}))}function ly(t,n,i,r,a){if(!e.crypto||!e.crypto.subtle)throw q("Web Crypto API is not available to decrypt AES. (Web Crypto only exists in secure origins like https)"),new Ne(2,4,4042);var o=0,s=Tv(n,"IV","");if(s){var u=Ye(s.substr(2));if(16!=u.byteLength)throw new Ne(2,4,4048)}else o=Cv(i.aa,"EXT-X-MEDIA-SEQUENCE",0);var l=Mv(r(),xv(n,"URI"),a),c=l.sort().join("");if(i=n.toString()+"-"+o+"-"+c,!t.na.has(i)){var d={bitsKey:128,blockCipherMode:"CBC",iv:u,firstMediaSequenceNumber:o};switch(xv(n,"METHOD")){case"AES-256":d.bitsKey=256;break;case"AES-256-CTR":d.bitsKey=256,d.blockCipherMode="CTR"}d.fetchKey=function(){var n,i,r,a;return R((function(o){if(1==o.g)return t.M.has(c)||(n=Br(l,t.g.retryParameters),i=Ey(t,n,6).promise,t.M.set(c,i)),w(o,t.M.get(c),2);if(3!=o.g){if(!(r=o.h).data||r.data.byteLength!=d.bitsKey/8)throw new Ne(2,4,4049);return a={name:"CTR"==d.blockCipherMode?"AES-CTR":"AES-CBC",length:d.bitsKey},w(o,e.crypto.subtle.importKey("raw",r.data,a,!0,["decrypt"]),3)}d.cryptoKey=o.h,d.fetchKey=void 0,T(o)}))},t.na.set(i,d)}return t.na.get(i)}function cy(e,t){null==e.s&&(t=Iv(t.aa,"EXT-X-START"))&&(e.s=Number(xv(t,"TIME-OFFSET")))}function dy(e,t){var n=1/0,i=t.segments;if(i.length)for(var r=i.length-1;0<=r;){var a=Iv(i[r].aa,"EXTINF");if(a){n=Number(a.value.split(",")[0]);break}r--}if(!(i=Iv(t.aa,"EXT-X-TARGETDURATION")))throw new Ne(2,4,4024,"EXT-X-TARGETDURATION");i=Number(i.value),(r=Iv(t.aa,"EXT-X-PART-INF"))&&(e.P=Number(xv(r,"PART-TARGET"))),t=Iv(t.aa,"EXT-X-SERVER-CONTROL"),e.ka&&e.P?(e.o=e.bc?5*e.P<=n?Math.min(e.P,e.o):Math.min(n,e.o):Math.min(e.P,e.o),e.Oa=t?Number(xv(t,"PART-HOLD-BACK")):0):(e.o=Math.min(n,e.o),n=t?wv(t,"HOLD-BACK"):null,e.Ka=n?Number(n.value):0),e.Pa=Math.max(i,e.Pa)}function hy(e,t){var n=0;if(e.g.defaultPresentationDelay)n=e.g.defaultPresentationDelay;else if(e.Oa)n=e.Oa;else if(e.Ka)n=e.Ka;else for(var i=t.segments.length,r=i-Math.min(i,e.g.hls.liveSegmentsDelay);r<i;r++){var a=Iv(t.segments[r].aa,"EXTINF");n=a?n+Number(a.value.split(",")[0]):n+e.Pa}e.s&&0>e.s&&(n=Math.min(-e.s,n),e.s+=n),e.l.Li(0),e.l.lh(n),e.l.Zc(!1)}function py(e,t,n,i,r){var a=Iv(n,"EXT-X-MAP");if(!a)return null;var o=xv(a,"URI"),s=Mv(i(),o,r);if(o=[s.toString(),Tv(a,"BYTERANGE","")].join("-"),!e.ya.has(o)){for(var u=void 0,c=null,d=!1,h=(n=l(n)).next();!h.done;h=n.next())"EXT-X-KEY"==(h=h.value).name?Iy(d=xv(h,"METHOD"))&&h.id<a.id?(d=!1,u=ly(e,h,t,i,r)):d="NONE"!=d:"EXT-X-BYTERANGE"==h.name&&h.id<a.id&&(c=h);t=function(e,t,n,i,r){var a=0,o=null;return!(t=Tv(t,"BYTERANGE"))&&n&&(t=n.value),t&&(a=t.split("@"),o=Number(a[0]),o=(a=Number(a[1]))+o-1,i&&((n=o+1-a)%16&&(o+=16-n%16))),new Bo((function(){return e}),a,o,null,null,null,i,r)}(s,a,c,u,d),e.ya.set(o,t)}return e.ya.get(o)}function fy(t,n,i,r,a,o,s,u,c){function d(e){e=new de(e).ob.split(".").pop();var t=Oy.get(s).get(e);return t||(t=Dy.get(e)),t}var h=r.aa,p=Iv(h,"EXTINF"),f=0,g=0,m=null;r.rc.length&&(t.m.isLowLatency=!0);var v=null;if(!t.g.hls.ignoreManifestProgramDateTime){var y=Iv(h,"EXT-X-PROGRAM-DATE-TIME");y&&y.value&&(v=rn(y.value),t.Za=!0)}var b=Ko;if(Iv(h,"EXT-X-GAP")&&(t.m.gapCount++,b=2),!p){if(0==r.rc.length)throw new Ne(2,4,4024,"EXTINF");if(!t.ka)return null}var w=[];y=!1;var T=null,x=!1,S=!1;if(t.ka&&r.rc.length){f=n&&e.ReadableStream&&t.g.hls.allowLowLatencyByteRangeOptimization;for(var A=v,k={},E=0;E<r.rc.length;k={Of:void 0,uf:void 0},E++){var I=r.rc[E],C=0==E?i:w[w.length-1],M=0==E?a:C.endTime,D=Number(Tv(I,"DURATION"))||t.P;if(D){var P=M+D,R=0,L=null;if("EXT-X-PRELOAD-HINT"==I.name?(R=(R=Tv(I,"BYTERANGE-START"))?Number(R):0,(C=Tv(I,"BYTERANGE-LENGTH"))?L=R+Number(C)-1:R&&(L=Number.MAX_SAFE_INTEGER)):(R=(L=l(gy(C,R=Tv(I,"BYTERANGE")))).next().value,L=L.next().value),k.uf=Tv(I,"URI"),k.uf){C=Ko,"YES"==Tv(I,"GAP")&&(t.m.gapCount++,C=2,x=!0),k.Of=null;var N=function(e){return function(){return null==e.Of&&(e.Of=Mv(u(),e.uf,o)),e.Of}}(k);f&&0<=R&&null!=L&&(T=N,y=!0),M=new Vo(M,P,N,R,L,n,0,0,1/0,[],"",null,A,C,c),"EXT-X-PRELOAD-HINT"==I.name&&(M.Pg(),S=!0),"YES"!=Tv(I,"INDEPENDENT")&&0<E&&M.qd(),(k=d(k.uf))&&(M.mimeType=k,jy.has(k)&&(M.Y=null)),w.push(M),A&&(A+=D)}}}}if(p){if(0==(p=Number(p.value.split(",")[0])))return null;f=a+p}else{if(!w.length)return null;f=w[w.length-1].endTime}y&&(x||0!=w[0].startByte?(y=!1,T=null):w=[]),(p=Iv(h,"EXT-X-BYTERANGE"))?(g=(m=l(gy(i,p.value))).next().value,m=m.next().value):w.length&&(g=w[0].startByte,m=w[w.length-1].endByte),i="",p=null,"image"==s&&(i="1x1",h=Iv(h,"EXT-X-TILES"))&&(i=xv(h,"LAYOUT"),(h=Tv(h,"DURATION"))&&(p=Number(h)));var O=null;return n=new Vo(a,f,(function(){return T?T():(null==O&&(O=Mv(u(),r.g,o)),O||[])}),g,m,n,0,0,1/0,w,i,p,v,b,c,0<w.length&&!!r.g),(a=d(r.g))&&(n.mimeType=a,jy.has(a)&&(n.Y=null)),y&&(t.bc=!0,n.ii(),S&&n.Pg()),n}function gy(e,t){var n=0,i=null;return t&&(n=t.split("@"),t=Number(n[0]),i=(n=n[1]?Number(n[1]):e.endByte+1)+t-1),[n,i]}function my(e,t,n,i,r){if("video"==n||"audio"==n){var a=e.l.m;if(a&&!ry(e,n))for(t=(t=kv(t,"EXT-X-DATERANGE")).filter((function(e){return null!=wv(e,"START-DATE")})).sort((function(e,t){return(e=xv(e,"START-DATE"))<(t=xv(t,"START-DATE"))?-1:e>t?1:0})),n=0;n<t.length;n++){var o=t[n];try{var s=rn(xv(o,"START-DATE"));if(!isNaN(s)){var u=Math.max(0,s-a),c=null,d=Tv(o,"END-DATE");if(d){var h=rn(d);if(!isNaN(h)&&0>(c=h-a))continue}if(null==c){var p=Tv(o,"DURATION")||Tv(o,"PLANNED-DURATION");if(p){var f=parseFloat(p);if(isNaN(f)||(c=u+f),0>s-a+f)continue}}var g=Tv(o,"CLASS")||"com.apple.quicktime.HLS",m="YES"==Tv(o,"END-ON-NEXT");if(null==c&&m){for(var v=n+1;v<t.length;v++)if(g==(Tv(t[v],"CLASS")||"com.apple.quicktime.HLS")){var y=rn(xv(t[v],"START-DATE"));if(!isNaN(y)&&y&&y>s){c=Math.max(0,y-a);break}}if(null==c)continue}v=["CLASS","START-DATE","END-DATE","DURATION","END-ON-NEXT"];for(var b=[],w=l(o.attributes),T=w.next();!T.done;T=w.next()){var x=T.value;if(!v.includes(x.name)){var S=Pv(x.value,i);"X-ASSET-URI"!=x.name&&"X-ASSET-LIST"!=x.name||(S=Mv(r(),x.value,i)[0]),b.push({key:x.name,description:"",data:S,mimeType:null,pictureType:null})}}1<b.length&&e.h.onMetadata(g,u,c,b)}}catch(e){}}}}function vy(e,t,n,i,r,a){var o=t.segments,s=void 0,u=Cv(t.aa,"EXT-X-DISCONTINUITY-SEQUENCE",-1),c=Cv(t.aa,"EXT-X-MEDIA-SEQUENCE",0),d=Iv(t.aa,"EXT-X-SKIP"),h=d?Number(Tv(d,"SKIPPED-SEGMENTS")):0,p=c+h,f=0;Ay(e)&&n.has(p)&&(f=n.get(p)),0===f&&e.za==By&&0<n.size&&!n.has(p)&&null!=e.l.i&&(f=e.l.Gb());var g=[],m=null;d=[];for(var v=0;v<o.length;v++){var y=o[v],b=0==v?f:m.endTime;p=c+h+v,Iv(y.aa,"EXT-X-DISCONTINUITY")&&(u++,m&&m.Y&&(m.Y.g=b));for(var w=l(y.aa),T=w.next();!T.done;T=w.next())"EXT-X-KEY"==(T=T.value).name&&(s=Iy(xv(T,"METHOD"))?ly(e,T,t,r,i):void 0);n.set(p,b),(b=fy(e,w=py(e,t,y.aa,r,i),m,y,b,i,a,r,s))&&((m=Cv(y.aa,"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,ry(e,a)&&null!=e.L&&p<e.L||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={Se:void 0,Re:void 0,Je:void 0,Wc:void 0,Ie:void 0},i++)if(n.Wc=g[i],null==n.Wc.h)for(n.Re=0,n.Se=i,r=function(e){return function(){var t=g[e.Se];if(t){if(null!=t.h)return t.h+e.Re;e.Re-=t.endTime-t.startTime,e.Se+=1}return null}}(n),n.Ie=0,n.Je=i,o=function(e){return function(){var t=g[e.Je];if(t){if(t!=e.Wc&&(e.Ie+=t.endTime-t.startTime),null!=t.h)return t.h+e.Ie;--e.Je}return null}}(n);null==n.Wc.h;)n.Wc.h=o(),null==n.Wc.h&&(n.Wc.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.ha,d&&1/0!=n&&!ry(e,a))for(a=(e=l(g)).next();!a.done;a=e.next())a.value.vh(n);return{segments:g,bandwidth:t}}function yy(e,t){if(e==rt){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 by(e){return e==rt?"text/vtt":Oy.get(e).get("mp4")}function wy(e,t){for(var n=t[e=Ay(e)?Math.trunc((t.length-1)/2):0];2==n.Cc()&&e+1<t.length;)n=t[++e];return{segment:n,segmentIndex:e}}function Ty(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 xy(e,t,n){return Ey(e,Br(t,e.g.retryParameters),0,{type:n?2:3})}function Sy(e){var t,n,i,r,a,o;return R((function(s){switch(s.g){case 1:return e.h?(x(s,2),t=Date.now(),w(s,e.update(),4)):s.return();case 4:n=Date.now(),Ay(e)&&(i=(n-t)/1e3,e.eb.sample(1,i),r=0<e.g.updatePeriod?e.g.updatePeriod:e.o,a=Math.max(0,r-H(e.eb)),e.C.ia(a)),A(s,3);break;case 2:if(o=k(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.C.ia(.1);case 3:if(!e.h)return s.return();e.h.onManifestUpdated(),T(s)}}))}function Ay(e){return e.za!=Uy}function ky(e,t){e.za=t,e.l&&e.l.Zc(!Ay(e)),Ay(e)||e.C.stop()}function Ey(e,t,n,i){if(!e.W)throw new Ne(2,7,7001);return i||(i={}),i.isPreload=e.Zb(),t=e.h.networkingEngine.request(n,t,i),Or(e.W,t),t}function Iy(e){return"AES-128"==e||"AES-256"==e||"AES-256-CTR"==e}function Cy(t,n,i,r,a,o){var s,u,l,c,d,h,p,f,g,m,v;return R((function(y){switch(y.g){case 1:if("video/mp2t"==i)throw new Ne(2,4,4040);if("apple"===e.shakaMediaKeysPolyfill)throw new Ne(2,4,4041);if(s=xv(n,"METHOD"),!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(s))return y.return(null);if((u=Mv(r(),xv(n,"URI"),o))[0].startsWith("data:text/plain;base64,")){l=Je(We(u[0].split("data:text/plain;base64,").pop())),y.u(2);break}return c=u.sort().join(""),t.va.has(c)||(d=Br(u,t.g.retryParameters),h=Ey(t,d,6).promise,t.va.set(c,h)),w(y,t.va.get(c),3);case 3:p=y.h,l=Je(p.data);case 2:if(f="00000000000000000000000000000000",!a){y.u(4);break}return w(y,My(t,a),5);case 5:(g=y.h)&&(f=g);case 4:return(m=new Map).set(f,l),v="cenc","SAMPLE-AES"==s&&(v="cbcs"),y.return(et(m,v))}}))}function My(e,t){var n,i,r;return R((function(a){return 1==a.g?(n=null,e.wa.has(t)?(n=e.wa.get(t),a.u(2)):(i=rl(t.O(),t.Bc(),t.zc(),e.g.retryParameters),w(a,Ey(e,i,Gr,{type:0}).promise,3))):(2!=a.g&&(r=a.h,t.ge(r.data),n=function(e){var t=null;return(new ta).box("moov",na).box("trak",na).box("mdia",na).box("minf",na).box("stbl",na).R("stsd",ia).box("encv",ra).box("enca",aa).box("sinf",na).box("schi",na).R("tenc",(function(e){(e=e.reader).X(),e.X(),e.X(),e.X(),t=Je(e.Ub(16))})).parse(e,!0),t}(r.data),e.wa.set(t,n)),a.return(n))}))}F("shaka.net.DataUriPlugin",Uv),Uv.parse=_v,Ur("data",_v),(i=Fv.prototype).configure=function(e,t){var n=this.h&&e.updatePeriod!=this.g.updatePeriod&&0<=e.updatePeriod;this.g=e,t&&(this.Zb=t),this.j&&this.j.configure(this.g),n&&this.m&&this.m.presentationTimeline.V()&&this.C.Jb()},i.start=function(e,t){var n,i=this;return R((function(r){return 1==r.g?(i.h=t,i.ka=t.isLowLatencyMode(),w(r,xy(i,[e]).promise,2)):3!=r.g?(n=r.h,i.F=n.uri,w(r,function(e,t){var n,i,r,a,o,s,u,d,h,p,f,g,m,v,y,b,S,A,E,I,C,M,D,P,L,N,O,j,U,_,B,F,V,H,K,G,z,q,X,W,Y,J,$;return R((function(Q){switch(Q.g){case 1:return n=at,i=Lv(e.Ya,t),r=kv(i.aa,"EXT-X-DEFINE"),a=[],o=[],s=[],e.l=new su(null,0),e.l.Zc(!0),u=function(){return[e.F]},d=null,h=new Map,1==i.type?(e.N=!1,F=kv(i.aa,"EXT-X-DEFINE"),h=Xv(e,F,e.F),d=n.Ca,V="",H=new Map,w(Q,ay(e,e.G++,h,i,u,"",d,V,!0,"Media Playlist",null,H,null,!1,null,!1),7)):(function(e,t){for(var n=new de(e.F).g,i=(t=l(t)).next();!i.done;i=t.next()){var r=i.value;i=Tv(r,"NAME");var a=Tv(r,"VALUE");r=Tv(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,r),p=kv(i.aa,"EXT-X-MEDIA"),f=kv(i.aa,"EXT-X-STREAM-INF"),g=kv(i.aa,"EXT-X-IMAGE-STREAM-INF"),m=kv(i.aa,"EXT-X-I-FRAME-STREAM-INF"),v=kv(i.aa,"EXT-X-SESSION-KEY"),y=kv(i.aa,"EXT-X-SESSION-DATA"),b=kv(i.aa,"EXT-X-CONTENT-STEERING"),function(e,t){for(var n=(t=l(t)).next();!n.done;n=t.next()){var i=n.value,r=Tv(i,"DATA-ID");n=Tv(i,"URI");var a=Tv(i,"LANGUAGE");i=Tv(i,"VALUE"),r=(new Map).set("id",r),n&&r.set("uri",Mv([e.F],n,e.A)[0]),a&&r.set("language",a),i&&r.set("value",i),n=new Dr("sessiondata",r),e.h&&e.h.onEvent(n)}}(e,y),w(Q,function(e,t){var n,i,r,a,o,s;return R((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=Tv(a,"PATHWAY-ID"),s=Tv(a,"SERVER-URI"),o&&s){e.j=new Ug(e.h),e.j.configure(e.g),e.j.i=[e.F],e.j.setManifestType("HLS"),e.j.h=o,n=_g(e.j,s);break}return w(u,n,0)}))}(e,b),4));case 4:if(!e.g.ignoreSupplementalCodecs){for(S=[],A=l(f),E=A.next(),I={};!E.done;I={Ti:void 0},E=A.next())C=E.value,(M=Tv(C,"SUPPLEMENTAL-CODECS"))&&(I.Ti=M.split(/\s*,\s*/).map((function(e){return e.split("/")[0]})),D=C.attributes.map(function(e){return function(t){var n=t.name,i=t.value;return"CODECS"==n&&(i=e.Ti.join(","),1<(t=t.value.split(",")).length&&(t=nt("audio",t))&&(i+=","+t)),new Av(n,i)}}(I)),S.push(new yv(C.id,C.name,D,null)));for(f.push.apply(f,c(S)),P=[],L=l(m),N=L.next(),O={};!N.done;O={Ui:void 0},N=L.next())j=N.value,(U=Tv(j,"SUPPLEMENTAL-CODECS"))&&(O.Ui=U.split(/\s*,\s*/).map((function(e){return e.split("/")[0]})),_=j.attributes.map(function(e){return function(t){var n=t.name;return t=t.value,"CODECS"==n&&(t=e.Ui.join(",")),new Av(n,t)}}(O)),P.push(new yv(j.id,j.name,_,null)));m.push.apply(m,c(P))}return function(e,t){for(var n=(t=l(t)).next();!n.done;n=t.next()){var i=n.value,r=Tv(i,"AUDIO");n=Tv(i,"VIDEO");var a=Tv(i,"SUBTITLES");if(i=Jv(e,i),a){var o=nt(rt,i);e.I.set(a,o),Ct(i,o)}r&&((a=nt("audio",i))||(a=e.g.hls.defaultAudioCodec),e.I.set(r,a)),n&&((r=nt("video",i))||(r=e.g.hls.defaultVideoCodec),e.I.set(n,r))}}(e,f),function(e,t){t=Ev(t,"CLOSED-CAPTIONS"),e.N=0==t.length;for(var n=(t=l(t)).next();!n.done;n=t.next()){var i=n.value,r=Tv(i,"LANGUAGE");n=Di(r||"und"),r||(r=Tv(i,"NAME"))&&(n=r),r=xv(i,"GROUP-ID"),i=xv(i,"INSTREAM-ID").replace("SERVICE","svc"),e.H.get(r)||e.H.set(r,new Map),e.H.get(r).set(i,n)}}(e,p),B=function(e,t){return t.map((function(t){return"video"!==(t=Zv(e,t)).stream.type?null:t.stream})).filter((function(e){return e}))}(e,m),w(Q,function(e,t,n,i,r,a,o){var s,u,d,h,p,f,g,m,v,y,b,T,x,S,A,k,E,I,C,M,D,P,L,N,O,j,U,_,B,F,V,H,K,G,z,q;return R((function(R){switch(R.g){case 1:if(s=[],u=new Set,e.g.ignoreDrmInfo||!(0<n.length)){R.u(2);break}d=l(n),h=d.next();case 3:if(h.done){R.u(2);break}if(p=h.value,f=xv(p,"METHOD"),g=Tv(p,"KEYFORMAT")||"identity",m=null,"NONE"==f){R.u(4);break}if(Iy(f)){v=Mv(r(),xv(p,"URI"),a),y=v.sort().join(""),e.M.has(y)||(b=Br(v,e.g.retryParameters),T=Ey(e,b,6).promise,e.M.set(y,T)),R.u(4);break}if("identity"==g)return w(R,Cy(e,p,"",r,null,a),12);if(!(x=e.$b.get(g))){S=null,R.u(10);break}return w(R,x(p,"",null),11);case 11:S=R.h;case 10:m=S,R.u(6);break;case 12:m=R.h;case 6:if(m){if(m.keyIds)for(A=l(m.keyIds),k=A.next();!k.done;k=A.next())E=k.value,u.add(E);s.push(m)}case 4:h=d.next(),R.u(3);break;case 2:for(I={},C=l(t),M=C.next();!M.done;M=C.next())D=M.value,P=bv(D,!e.j),I[P]?I[P].push(D):I[P]=[D];for(N in L=[],I)O=I[N],j=O[0],U=Tv(j,"FRAME-RATE"),_=Number(Tv(j,"AVERAGE-BANDWIDTH"))||Number(xv(j,"BANDWIDTH")),B=Tv(j,"RESOLUTION"),F=l(B?B.split("x"):[null,null]),V=F.next().value,H=F.next().value,K=Tv(j,"VIDEO-RANGE"),(G=Tv(j,"REQ-VIDEO-LAYOUT"))&&G.includes(",")&&(z=G.split(",").filter((function(e){return"CH-STEREO"==e||"CH-MONO"==e})),G=z[0]),G=G||"CH-MONO",q=Yv(e,O,i),L.push.apply(L,c($v(e,q.audio,q.video,_,V,H,U,K,G,s,u,o)));return R.return(L.filter((function(e){return null!=e})))}}))}(e,f,v,p,u,e.A,B),5);case 5:return a=Q.h,o=function(e,t){var n=Ev(t,"SUBTITLES");t=n.map((function(t){if(e.g.disableText)return null;try{return Qv(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=xv(i.value,"GROUP-ID");if((i=e.I.get(r))&&(r=e.K.get(r)))for(var a=(r=l(r)).next();!a.done;a=r.next())(a=a.value).stream.codecs=i,a.stream.mimeType=yy(rt,i)||by(rt),Wv(a.stream)}return t.filter((function(e){return e}))}(e,p),w(Q,function(e,t,n){var i,r;return R((function(a){return 1==a.g?(i=t.map((function(t){var n,i;return R((function(r){if(1==r.g)return e.g.disableThumbnails?r.return(null):(x(r,2),w(r,function(e,t){var n,i,r,a,o,s,u,l,c,d;return R((function(h){return 1==h.g?(n=xv(t,"URI"),i=Tv(t,"CODECS","jpeg")||"",e.i.has(n)?h.return(e.i.get(n)):(r=Tv(t,"LANGUAGE"),a=Tv(t,"NAME"),o=Tv(t,"CHARACTERISTICS"),s=ey(e,e.G++,[n],i,"image",r,!1,a,null,null,o,!1,null,!1),(u=Tv(t,"RESOLUTION"))?w(h,s.stream.createSegmentIndex(),3):h.u(2))):(2!=h.g&&(l=Pu(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=Tv(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=k(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=Zv(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,g,m),6);case 6:s=Q.h,Q.u(3);break;case 7:K=Q.h,e.i.set(e.F,K),K.stream&&(G=Vu(K.stream),K.stream.segmentIndex.Eb((function(e){e.Y&&(e.Y.rd=G)}))),d=K.stream.type,z=!0,(e.g.disableAudio&&"audio"==K.type||e.g.disableVideo&&"video"==K.type&&!K.stream.codecs.includes(","))&&(z=!1),z&&a.push({id:0,language:Di(V||"und"),disabledUntilTime:0,primary:!0,audio:"audio"==K.type?K.stream:null,video:"video"==K.type?K.stream:null,bandwidth:K.stream.bandwidth||0,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});case 3:if(!e.h)throw new Ne(2,7,7001);if(cy(e,i),1==i.type&&(Ay(e)&&(hy(e,i),q=e.o,e.C.ia(q)),X=Array.from(e.i.values()),iy(e,X),qv(e),my(e,i.aa,d,h,u)),e.m={presentationTimeline:e.l,variants:a,textStreams:o,imageStreams:s,offlineSessionIds:[],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.ba||!e.g.hls.disableCodecGuessing){Q.u(8);break}for(W=[],Y=l(e.m.variants),J=Y.next();!J.done;J=Y.next())($=J.value).audio&&""===$.audio.codecs&&W.push($.audio.createSegmentIndex()),$.video&&""===$.video.codecs&&W.push($.video.createSegmentIndex());return w(Q,Promise.all(W),8);case 8:e.h.makeTextStreamsForClosedCaptions(e.m),T(Q)}}))}(i,n.data),3)):r.return(i.m)}))},i.stop=function(){this.C&&(this.C.stop(),this.C=null);var e=[];return this.W&&(e.push(this.W.destroy()),this.W=null),this.g=this.h=null,this.ab.clear(),this.m=null,this.i.clear(),this.K.clear(),this.I.clear(),this.A.clear(),this.ya.clear(),this.na.clear(),this.M.clear(),this.va.clear(),this.wa.clear(),this.j&&this.j.destroy(),this.S&&(this.S.release(),this.S=null),Promise.all(e)},i.update=function(){var e,t,n,i,r,a,o,s,u,d,h,p=this;return R((function(f){if(1==f.g){if(!Ay(p))return f.return();for(e=[],t=Array.from(p.i.values()),p.o=1/0,p.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(Hv(p,a));return w(f,Promise.all(e),2)}for(ny(p,n.map((function(e){return e.stream}))),o=n.some((function(e){return 0==e.Rd})),n.length&&!o&&(ky(p,Fy.cj),s=n.map((function(e){return e.mc})),p.l.pb(Math.min.apply(Math,c(s))),p.h.updateDuration()),o&&qv(p),u=l(n),d=u.next();!d.done;d=u.next())(h=d.value).stream.isAudioMuxedInVideo||!h.stream.segmentIndex||Pu(h.stream.segmentIndex)||p.h.disableStream(h.stream);T(f)}))},i.onExpirationUpdated=function(){},i.onInitialVariantChosen=function(){},i.banLocation=function(e){this.j&&this.j.banLocation(e)},i.setMediaElement=function(e){this.U=e},F("shaka.hls.HlsParser",Fv);var Dy=(new Map).set("aac","audio/aac").set("ac3","audio/ac3").set("ec3","audio/ec3").set("mp3","audio/mpeg"),Py=(new Map).set("mp4","audio/mp4").set("mp4a","audio/mp4").set("m4s","audio/mp4").set("m4i","audio/mp4").set("m4a","audio/mp4").set("m4f","audio/mp4").set("cmfa","audio/mp4").set("ts","video/mp2t").set("tsa","video/mp2t"),Ry=(new Map).set("mp4","video/mp4").set("mp4v","video/mp4").set("m4s","video/mp4").set("m4i","video/mp4").set("m4v","video/mp4").set("m4f","video/mp4").set("cmfv","video/mp4").set("ts","video/mp2t").set("tsv","video/mp2t"),Ly=(new Map).set("mp4","application/mp4").set("m4s","application/mp4").set("m4i","application/mp4").set("m4f","application/mp4").set("cmft","application/mp4").set("vtt","text/vtt").set("webvtt","text/vtt").set("ttml","application/ttml+xml"),Ny=(new Map).set("jpg","image/jpeg").set("png","image/png").set("svg","image/svg+xml").set("webp","image/webp").set("avif","image/avif"),Oy=(new Map).set("audio",Py).set("video",Ry).set("text",Ly).set("image",Ny),jy=new Set(["video/mp2t"].concat(c(hi))),Uy="VOD",_y="EVENT",By="LIVE",Fy={cj:Uy,Bl:_y,Ll:By};function Vy(e){return ag(e)}$a("application/x-mpegurl",(function(){return new Fv})),$a("application/vnd.apple.mpegurl",(function(){return new Fv}));var Hy=(new Map).set("com.microsoft.playready",Vy).set("com.microsoft.playready.recommendation",Vy).set("com.microsoft.playready.software",Vy).set("com.microsoft.playready.hardware",Vy);function Ky(){var e=this;this.h=this.g=null,this.l=[],this.j=null,this.s=1,this.i=null,this.C=new V(5),this.o=new Ti((function(){!function(e){var t;R((function(n){switch(n.g){case 1:return x(n,2),w(n,Gy(e),4);case 4:A(n,3);break;case 2:t=k(n),e.h&&(t.severity=1,e.h.onError(t));case 3:if(!e.h)return n.return();T(n)}}))}(e)})),this.B=new Nr,this.m=new Map,this.A=function(){return!1}}function Gy(e){var t,n,i,r,a,o,s;return R((function(u){if(1==u.g)return t=Br(e.l,e.g.retryParameters),n=e.h.networkingEngine,i=Date.now(),r=n.request(0,t,{type:5,isPreload:e.A()}),Or(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,p=e.g.mss.manifestPreprocessor;if(p!=Xl){if(oe("manifest.mss.manifestPreprocessor configuration","Please Use manifest.mss.manifestPreprocessorTXml instead."),!(h=Am(h,"SmoothStreamingMedia")))throw new Ne(2,4,4046,d);p(h),h=Fe(h.outerHTML)}var f=Ht(h,"SmoothStreamingMedia");if(!f)throw new Ne(2,4,4046,d);if((d=e.g.mss.manifestPreprocessorTXml)!=Wl&&d(f),e.i||(e.i=new su(null,0)),d=Zt(f,"IsLive",dn,!1))throw new Ne(2,4,4047);e.i.Zc(!d),p=Zt(f,"TimeScale",ln,1e7),h=Zt(f,"DVRWindowLength",ln),d&&(0===h||isNaN(h))&&(h=1/0);var g,m=Zt(f,"CanSeek",dn,!1);for(0===h&&m&&(h=1/0),m=null,h&&0<h&&(m=h/p),d&&!isNaN(e.g.availabilityWindowOverride)&&(m=e.g.availabilityWindowOverride),null==m&&(m=1/0),e.i.Gf(m),h=Zt(f,"Duration",ln,1/0),d||e.i.pb(h/p),d={variants:[],textStreams:[],timescale:p,duration:h/p},m=Xt(f,"Protection"),p=e.g.mss.keySystemsBySystemId,h=[],g=(m=l(m)).next();!g.done;g=m.next())h=h.concat(Xt(g.value,"ProtectionHeader"));if(h.length){for(m=[],g=0;g<h.length;g++){var v=h[g],y=v.attributes.SystemID.toLowerCase(),b=p[y];if(b){var x;e:{if(x=rg(v))for(var S=(x=l(Jt(x,"DATA"))).next();!S.done;S=x.next())if(S=$t(S.value,"KID")){x=We(Wt(S)),x=Je(x=new Uint8Array([x[3],x[2],x[1],x[0],x[5],x[4],x[7],x[6]].concat(c(x.slice(8)))));break e}x=null}y=Ze(b,"cenc",y=[{initData:pa(S=We(Wt(v)),y=Ye(y.replace(/-/g,"")),new Set,0),initDataType:"cenc",keyId:x}]),x&&y.keyIds.add(x),(b=Hy.get(b))&&(y.licenseServerUri=b(v)),m.push(y)}}p=m}else p=[];for(g=p,m=[],p=[],h=[],v=(f=l(f=Xt(f,"StreamIndex"))).next();!v.done;v=f.next()){b=Xt(v=v.value,"QualityLevel"),y=d.timescale,x=d.duration,S=Xt(v,"c");for(var A=[],k=0,E=0;E<S.length;++E){var I=S[E],C=S[E+1],M=Zt(I,"t",ln),D=Zt(I,"d",ln);if(I=Zt(I,"r",sn),!D)break;if(M=null!=M?M:k,(I=I||0)&&I--,0>I)if(C){if(null==(C=Zt(C,"t",ln)))break;if(M>=C)break;I=Math.ceil((C-M)/D)-1}else{if(1/0==x)break;if(M/y>=x)break;I=Math.ceil((x*y-M)/D)-1}for(C=0;C<=I;++C)k=M+D,A.push({start:M/y,end:k/y,Bh:M}),M=k}for(y=A,x=(b=l(b)).next();!x.done;x=b.next())(x=zy(e,v,x.value,y,g,d))&&("audio"!=x.type||e.g.disableAudio?"video"!=x.type||e.g.disableVideo?x.type!=rt||e.g.disableText||h.push(x):p.push(x):m.push(x))}for(f=[],g=(m=l(0<m.length?m:[null])).next();!g.done;g=m.next())for(g=g.value,A=(v=l(0<p.length?p:[null])).next();!A.done;A=v.next())y=(b=f).push,x=e,S=g,A=A.value,E=0,S&&S.bandwidth&&0<S.bandwidth&&(E+=S.bandwidth),A&&A.bandwidth&&0<A.bandwidth&&(E+=A.bandwidth),x={id:x.s++,language:S?S.language:"und",disabledUntilTime:0,primary:!!S&&S.primary||!!A&&A.primary,audio:S,video:A,bandwidth:E,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},y.call(b,x);d.variants=f,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:[],sequenceMode:e.g.mss.sequenceMode,ignoreManifestTimestampsInSegmentsMode:!1,type:"MSS",serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,isLowLatency:!1,startTime:null},e.i.hf()),Promise.resolve(),o=Date.now(),s=(o-i)/1e3,e.C.sample(1,s),T(u)}))}function zy(e,t,n,i,r,a){var o=t.attributes.Type;if("audio"!==o&&"video"!==o&&"text"!==o)return q("Ignoring unrecognized type:",o),null;var s=t.attributes.Language,u=e.s++,c=Zt(n,"Bitrate",un),d=Zt(n,"MaxWidth",un),h=Zt(n,"MaxHeight",un),p=Zt(n,"Channels",un),f=Zt(n,"SamplingRate",un),g=a.duration;i.length&&(g=i[i.length-1].end-i[0].start);var m=e.i.getDuration();e.i.pb(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:Di(s||"und"),originalLanguage:s,label:"",type:"",primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:[],roles:[],forced:!1,channelsCount:p,audioSamplingRate:f,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,baseOriginalId:null};if((r=t.attributes.Subtype)&&((r=Xy.get(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 q('FourCC is not defined whereas it is required for a QualityLevel element for a StreamIndex of type "video"'),null;if(!qy.includes(r.toUpperCase()))return q("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 q("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 q("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=rt,v.mimeType="application/mp4",("TTML"===r||"DFXP"===r)&&(v.codecs="stpp")}return v.fullMimeTypes.add(ni(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=lo(new uo([n={id:v.id,type:v.type,codecs:v.codecs,encrypted:v.encrypted,timescale:v.mssPrivateData.timescale,duration:v.mssPrivateData.duration,Ab:n,Ea:new Uint8Array([]),Na:new Uint8Array([]),Wa:0,Xa: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={Jf:void 0},o=r.next())s.Jf=o.value,i.push(new Vo(s.Jf.start,s.Jf.end,function(t){return function(){return Qe(e.l,[a.replace("{start time}",String(t.Jf.Bh))])}}(s),0,null,t,0,0,n.mssPrivateData.duration));return i}(e,new Bo((function(){return[]}),0,null,Vu(v),v.mssPrivateData.timescale,n,null,v.encrypted),v,t,i),v.segmentIndex=new Du(n),Promise.resolve()},v.closeSegmentIndex=function(){v.segmentIndex&&(v.segmentIndex.release(),v.segmentIndex=null)},v}(i=Ky.prototype).configure=function(e,t){this.g=e,t&&(this.A=t)},i.start=function(e,t){var n=this;return R((function(i){if(1==i.g)return n.l=[e],n.h=t,w(i,Gy(n),2);if(!n.h)throw new Ne(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 R((function(n){return 1==n.g?(x(n,2),w(n,Gy(t),4)):2!=n.g?A(n,0):(e=k(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",Ky);var qy="AAC AACL AACH AACP AVC1 H264 TTML DFXP".split(" "),Xy=(new Map).set("CAPT","main").set("SUBT","alternate").set("DESC","main");function Wy(e,t,n,i,r,a,o){if(200<=n&&299>=n&&202!=n||304==n)return{uri:r||i,originalUri:i,data:t,status:n,headers:e,fromCache:!!e["x-shaka-from-cache"],originalRequest:a};a=null;try{a=Be(t)}catch(e){}throw new Ne(401==n||403==n?2:1,1,1001,i,n,a,e,o,r||i)}function Yy(){}function Jy(e,t,n,i,r,a){var o=new tb;Jr(t.headers).forEach((function(e,t){o.append(t,e)}));var s=new Zy,u={Lh:!1,Yi:!1};if(e=function(e,t,n,i,r,a,o,s,u){var l,c,d,h,p,f,g,m,v,y,b,S,E,I;return R((function(C){switch(C.g){case 1:return l=Qy,c=eb,h=new ArrayBuffer(0),f=p=0,g={},m=Date.now(),x(C,2),w(C,l(e,i),4);case 4:if(d=C.h,g=function(e){var t={};return e.forEach((function(e,n){t[n.trim()]=e})),t}(d.headers),o(g),"HEAD"==i.method){C.u(5);break}return y=(v=d.headers.get("Content-Length"))?parseInt(v,10):0,d.body?(b=d.clone().body.getReader(),new c({start:function(e){!function t(){var n,i,r,o;return R((function(l){switch(l.g){case 1:return x(l,2),w(l,b.read(),4);case 4:n=l.h,A(l,3);break;case 2:return k(l),l.return();case 3:if(n.done){l.u(5);break}if(p+=n.value.byteLength,!s){l.u(5);break}return w(l,s(n.value),5);case 5:i=Date.now(),r=p-f,(100<i-m&&r>=u||n.done)&&(o=n.done?0:y-p,a(i-m,r,o),f=p,m=i),n.done?e.close():(e.enqueue(n.value),t()),T(l)}}))}()}}),w(C,d.arrayBuffer(),8)):w(C,d.arrayBuffer(),9);case 8:h=C.h,C.u(5);break;case 9:h=C.h,S=Date.now(),a(S-m,h.byteLength,0);case 5:t.headers.Range&&2==(E=t.headers.Range.replace("bytes=","").split("-").filter((function(e){return e})).map((function(e){return parseInt(e,10)}))).length&&h.byteLength!=E[1]-E[0]+1&&q("Payload length does not match range requested bytes",t,d),A(C,3);break;case 2:if(I=k(C),r.Lh)throw new Ne(1,1,7001,e,n);if(r.Yi)throw new Ne(1,1,1003,e,n);throw new Ne(1,1,1002,e,I,n);case 3:return C.return(Wy(g,h,d.status,e,d.url,t,n))}}))}(e,t,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 Ar(e,(function(){return u.Lh=!0,s.abort(),Promise.resolve()})),t=t.retryParameters.timeout){var l=new Ti((function(){u.Yi=!0,s.abort()}));l.ia(t/1e3),e.finally((function(){l.stop()}))}return e}function $y(){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)}$a("application/vnd.ms-sstr+xml",(function(){return new Ky})),F("shaka.net.HttpFetchPlugin",Yy),Yy.isSupported=$y,Yy.parse=Jy;var Qy=e.fetch,Zy=e.AbortController,eb=e.ReadableStream,tb=e.Headers;function nb(){}function ib(e,t,n,i,r,a){var o=new rb,s=Date.now(),u=0;return new Ar(new Promise((function(c,d){o.open(t.method,e,!0),o.responseType="arraybuffer",o.timeout=t.retryParameters.timeout,o.withCredentials=t.allowCrossSiteCredentials;var h={};for(var p in o.onabort=function(){d(new Ne(1,1,7001,e,n))},o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.HEADERS_RECEIVED){for(var e=o.getAllResponseHeaders().trim().split("\r\n"),t={},n=(e=l(e)).next();!n.done;n=e.next())t[(n=n.value.split(": "))[0].toLowerCase()]=n.slice(1).join(": ");r(h=t)}},o.onload=function(r){var a=o.response;try{i(Date.now()-s,r.loaded-u,0);var l=Wy(h,a,o.status,e,o.responseURL,t,n);c(l)}catch(e){d(e)}},o.onerror=function(t){d(new Ne(1,1,1002,e,t,n))},o.ontimeout=function(){d(new Ne(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(p.toLowerCase(),t.headers[p]);o.send(t.body)})),(function(){return o.abort(),Promise.resolve()}))}$y()&&(Ur("http",Jy,2,!0),Ur("https",Jy,2,!0),Ur("blob",Jy,2,!0)),F("shaka.net.HttpXHRPlugin",nb),nb.parse=ib;var rb=e.XMLHttpRequest;function ab(e,t,n,i,r){this.g=e,this.i=t,this.groupId=n,this.h=i,this.j=r}function ob(e){var t=e.Yb(!1);return t?Xe(t):e.O().map((function(e){return"{"+encodeURI(e.split("#xywh=")[0])+"}"})).join("")+":"+e.startByte+":"+e.endByte}function sb(e,t){return rl(e.g.O(),e.g.startByte,e.g.endByte,t.streaming.retryParameters)}function ub(){this.g=this.j=this.i=0,this.h=new Map,this.l=0}function lb(e,t){e.i+=t;var n=e.l;return e.l++,e.h.set(n,t),n}function cb(e){return 0==e.i?0:e.j/e.i}function db(e){var t=this;this.s=e,this.i=new Map,this.h=new Xr((function(){return hb(t).catch((function(){}))})),this.j=[],this.o=function(){},this.m=function(){},this.g=new ub,this.l=!1}function hb(e){e.l=!0;var t=e.j.map((function(e){return e()}));return e.j=[],Promise.all(t)}function pb(e,t,n,i,r,a){Wr(e.h);var o=(e.i.get(t)||Promise.resolve()).then((function(){if(e.h.g)throw new Ne(2,9,7001);if(r){var t=De(n);for(var o in(t=new ha(t)).data){var s=Number(o);e.m(t.data[s],t.g[s])}}return e.g.close(i,n.byteLength),e.o(cb(e.g),e.g.g),a(n)}));e.i.set(t,o)}function fb(e,t){var n=this;this.i=e,this.h=e.objectStore(t),this.g=new Sr,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 gb(e,t){return new Promise((function(n,i){var r=e.h.openCursor();r.onerror=i,r.onsuccess=function(){var e;return R((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 mb(e){this.h=e,this.g=[]}function vb(e,t){return yb(e,t,"readwrite")}function yb(e,t,n){var i=new fb(n=e.h.transaction([t],n),t);return e.g.push(i),i.promise().then((function(){Ct(e.g,i)}),(function(){Ct(e.g,i)})),i}function bb(e,t,n){this.h=new mb(e),this.i=t,this.g=n}function wb(e){return Promise.reject(new Ne(2,9,9011,"Cannot add new value to "+e))}function Tb(e,t,n,i){t=(e=vb(e.h,t)).store();for(var r=(n=l(n)).next(),a={};!r.done;a={Og:void 0},r=n.next())a.Og=r.value,t.delete(a.Og).onsuccess=function(e){return function(){return i(e.Og)}}(a);return e.promise()}function xb(e,t,n){var i,r,a,o,s,u,c;return R((function(d){if(1==d.g){for(i=yb(e.h,t,"readonly"),r=i.store(),a={},o=[],s=l(n),u=s.next(),c={};!u.done;c={Af:void 0,cf:void 0},u=s.next())c.cf=u.value,c.Af=r.get(c.cf),c.Af.onsuccess=function(e){return function(){null==e.Af.result&&o.push(e.cf),a[e.cf]=e.Af.result}}(c);return w(d,i.promise(),2)}if(o.length)throw new Ne(2,9,9012,"Could not find values for "+o);return d.return(n.map((function(e){return a[e]})))}))}function Sb(e){this.g=new mb(e)}function Ab(){this.g=new Map}function kb(e){var t=null;if(e.g.forEach((function(e,n){e.getCells().forEach((function(e,i){e.hasFixedKeySpace()||t||(t={path:{Rb:n,bb:i},bb:e})}))})),t)return t;throw new Ne(2,9,9013,"Could not find a cell that supports add-operations")}function Eb(e,t,n){if(!(e=e.g.get(t)))throw new Ne(2,9,9013,"Could not find mechanism with name "+t);if(!(t=e.getCells().get(n)))throw new Ne(2,9,9013,"Could not find cell with name "+n);return t}function Ib(e,t){Cb.set(e,t)}Ur("http",ib,1,!0),Ur("https",ib,1,!0),Ur("blob",ib,1,!0),ub.prototype.close=function(e,t){if(this.h.has(e)){var n=this.h.get(e);this.h.delete(e),this.j+=n,this.g+=t}},db.prototype.destroy=function(){return this.h.destroy()},db.prototype.queue=function(e,t,n,i,r){var a=this;Wr(this.h);var o=(this.i.get(e)||Promise.resolve()).then((function(){var e,o,s,u,l,c,d;return R((function(h){if(1==h.g)return w(h,function(e,t){var n,i,r,a;return R((function(o){return 1==o.g?(n=Gr,i=e.s.request(n,t),r=function(){return i.abort()},e.j.push(r),w(o,i.promise,2)):(a=o.h,Ct(e.j,r),o.return(a.data))}))}(a,t),2);if(e=h.h,a.h.g)throw new Ne(2,9,7001);if(i)for(u in o=De(e),(s=new ha(o)).data)l=Number(u),c=s.data[l],d=s.g[l],a.m(c,d);return a.g.close(n,e.byteLength),a.o(cb(a.g),a.g.g),h.return(r(e))}))}));return this.i.set(e,o),o},fb.prototype.abort=function(){var e=this;return R((function(t){if(1==t.g){try{e.i.abort()}catch(e){}return x(t,2),w(t,e.g,4)}if(2!=t.g)return A(t,0);k(t),T(t)}))},fb.prototype.store=function(){return this.h},fb.prototype.promise=function(){return this.g},mb.prototype.destroy=function(){return Promise.all(this.g.map((function(e){return e.abort()})))},(i=bb.prototype).destroy=function(){return this.h.destroy()},i.hasFixedKeySpace=function(){return!0},i.addSegments=function(){return wb(this.i)},i.removeSegments=function(e,t){return Tb(this,this.i,e,t)},i.getSegments=function(e){var t,n=this;return R((function(i){return 1==i.g?w(i,xb(n,n.i,e),2):(t=i.h,i.return(t.map((function(e){return n.Nh(e)}))))}))},i.addManifests=function(){return wb(this.g)},i.updateManifest=function(){return Promise.reject(new Ne(2,9,9016,"Cannot modify values in "+this.g))},i.updateManifestExpiration=function(e,t){var n=vb(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 Tb(this,this.g,e,t)},i.getManifests=function(e){var t,n=this;return R((function(i){return 1==i.g?w(i,xb(n,n.g,e),2):(t=i.h,i.return(Promise.all(t.map((function(e){return n.Kd(e)})))))}))},i.getAllManifests=function(){var e,t,n=this;return R((function(i){return 1==i.g?(e=yb(n.h,n.g,"readonly"),t=new Map,w(i,gb(e,(function(e,i){var r;return R((function(a){if(1==a.g)return w(a,n.Kd(i),2);r=a.h,t.set(e,r),T(a)}))})),2)):3!=i.g?w(i,e.promise(),3):i.return(t)}))},i.Nh=function(e){return e},i.Kd=function(e){return Promise.resolve(e)},i.add=function(e,t){var n,i,r,a,o,s,u,c=this;return R((function(d){if(1==d.g){for(n=vb(c.h,e),i=n.store(),r=[],a=l(t),o=a.next(),s={};!o.done;s={bh:void 0},o=a.next())u=o.value,s.bh=i.add(u),s.bh.onsuccess=function(e){return function(){r.push(e.bh.result)}}(s);return w(d,n.promise(),2)}return d.return(r)}))},Sb.prototype.destroy=function(){return this.g.destroy()},Sb.prototype.getAll=function(){var e,t,n=this;return R((function(i){return 1==i.g?(e=yb(n.g,"session-ids","readonly"),t=[],w(i,gb(e,(function(e,n){t.push(n)})),2)):3!=i.g?w(i,e.promise(),3):i.return(t)}))},Sb.prototype.add=function(e){for(var t=vb(this.g,"session-ids"),n=t.store(),i=(e=l(e)).next();!i.done;i=e.next())n.add(i.value);return t.promise()},Sb.prototype.remove=function(e){var t,n=this;return R((function(i){return 1==i.g?w(i,gb(t=vb(n.g,"session-ids"),(function(t,n,i){e.includes(n.sessionId)&&i.delete()})),2):w(i,t.promise(),0)}))},Ab.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)},Ab.prototype.init=function(){var e=this;Cb.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",Ab),Ab.unregister=function(e){Cb.delete(e)},Ab.register=Ib,Ab.prototype.destroy=Ab.prototype.destroy;var Cb=new Map;function Mb(){bb.apply(this,arguments)}function Db(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?Pb(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=Pb(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 Pb(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 Ne(2,9,9004,"Could not parse uri "+e)}function Rb(){bb.apply(this,arguments)}function Lb(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 Nb(){bb.apply(this,arguments)}function Ob(){this.m=this.j=this.i=this.h=this.g=this.l=null}m(Mb,bb),Mb.prototype.updateManifestExpiration=function(e,t){var n,i,r,a=this;return R((function(o){return n=vb(a.h,a.g),i=n.store(),r=new Sr,i.get(e).onsuccess=function(n){(n=n.target.result)?(n.expiration=t,i.put(n),r.resolve()):r.reject(new Ne(2,9,9012,"Could not find values for "+e))},w(o,Promise.all([n.promise(),r]),0)}))},Mb.prototype.Kd=function(e){var t,n,i,r,a,o;return R((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=Db(e.periods[n],r),t.push(a);return w(s,Gg(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})}))},Mb.prototype.Nh=function(e){return{data:e.data}},m(Rb,bb),Rb.prototype.Kd=function(e){var t,n,i,r,a,o;return R((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(Lb(h,u.startTime,u.startTime+r));a=c,t.push(a)}return w(s,Gg(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(Nb,bb),(i=Nb.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=vb(e.h,e.g)).store();return i.get(t).onsuccess=function(){i.put(n,t)},e.promise()}(this,e,t)},i.Kd=function(e){return null==e.expiration&&(e.expiration=1/0),Promise.resolve(e)},(i=Ob.prototype).init=function(){var t=this,n=new Sr,i=!1,r=new Ti((function(){i=!0,n.reject(new Ne(2,9,9017))}));"number"==typeof jb&&0<jb&&r.ia(jb);var a=e.indexedDB.open("shaka_offline_db",5);return a.onsuccess=function(){if(!i){r.stop();var e=a.result;t.l=e;var o=e.objectStoreNames;o=o.contains("manifest")&&o.contains("segment")?new Mb(e,"segment","manifest"):null,t.g=o,o=(o=e.objectStoreNames).contains("manifest-v2")&&o.contains("segment-v2")?new Rb(e,"segment-v2","manifest-v2"):null,t.h=o,o=(o=e.objectStoreNames).contains("manifest-v3")&&o.contains("segment-v3")?new Rb(e,"segment-v3","manifest-v3"):null,t.i=o,o=(o=e.objectStoreNames).contains("manifest-v5")&&o.contains("segment-v5")?new Nb(e,"segment-v5","manifest-v5"):null,t.j=o,e=e.objectStoreNames.contains("session-ids")?new Sb(e):null,t.m=e,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||(r.stop(),n.reject(new Ne(2,9,9001,a.error)),e.preventDefault())},n},i.destroy=function(){var e=this;return R((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 R((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 Sr,n=e.indexedDB.deleteDatabase("shaka_offline_db");return n.onblocked=function(){},n.onsuccess=function(){t.resolve()},n.onerror=function(e){t.reject(new Ne(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)}}))};var jb=5;function Ub(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 _b(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 Ub(t,n,i,Number(e[4])):null}function Bb(e,t){this.h=e,this.g=t}function Fb(e,t){var n=new su(null,0);n.pb(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=Vb(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=Vb(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==rt})).map((function(t){return Vb(e,t,n)}));var a=t.streams.filter((function(e){return"image"==e.type})).map((function(t){return Vb(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,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 Vb(e,t,n){var i=t.segments.map((function(n){return function(e,t,n){var i=new Ub("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 Ub("segment",e.h,e.g,t);return new Bo((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.Hf(t.thumbnailSprite),e}(e,n,t)}));return n.$d(i),{id:t.id,originalId:t.originalId,groupId:t.groupId,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new Du(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,dependencyStream:null,emsgSchemeIdUris:null,roles:t.roles,forced:t.forced,channelsCount:t.channelsCount,audioSamplingRate:t.audioSamplingRate,spatialAudio:t.spatialAudio,closedCaptions:t.closedCaptions,tilesLayout:t.tilesLayout,mssPrivateData:t.mssPrivateData,accessibilityPurpose:null,external:t.external,fastSwitching:t.fastSwitching,fullMimeTypes:new Set([ni(t.mimeType,t.codecs)]),isAudioMuxedInVideo:!1,baseOriginalId:null}}function Hb(){this.g=null}function Kb(){}function Gb(e,t){var n=_b(e);return e=n&&"manifest"==n.g?Ir(e={uri:e,originalUri:e,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"},originalRequest:t}):n&&"segment"==n.g?function(e,t,n){var i=new Ab;return Ir(void 0).Va((function(){return i.init()})).Va((function(){return Eb(i,t.Rb(),t.bb())})).Va((function(e){return e.getSegments([t.key()])})).Va((function(e){return{uri:t,data:e[0].data,headers:{},originalRequest:n}})).finally((function(){return i.destroy()}))}(n.key(),n,t):kr(new Ne(2,1,9004,e)),e}function zb(e,t,n){var i,r,a,o,s,u;return R((function(c){switch(c.g){case 1:i=[];for(var d=[],h=l(n),p=h.next();!p.done;p=h.next()){p=p.value;for(var f=!1,g=l(d),m=g.next();!m.done;m=g.next())if(qb((m=m.value).info,p)){m.sessionIds.push(p.sessionId),f=!0;break}f||d.push({info:p,sessionIds:[p.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 R((function(a){switch(a.g){case 1:return i=new fa({pc:t,onError:function(){},rf:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),x(a,2),i.configure(e),w(a,function(e,t,n,i,r,a){function o(e){return(e=Ze(t,e,null)).licenseServerUri=n,e.serverCertificate=i,e.persistentStateRequired=!0,e.sessionType="persistent-license",e}var s=[];return a.length&&s.push(a[0].contentType),r.length&&s.push(r[0].contentType),(s=ar(s)).video&&(a=o(a[0].encryptionScheme||""),s.video.drmInfos.push(a)),s.audio&&(r=o(r[0].encryptionScheme||""),s.audio.drmInfos.push(r)),Ta(e,[s])}(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 k(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 R((function(t){return 1==t.g?(x(t,2),w(t,function(e,t){var n,i,r;return R((function(a){return 1==a.g?w(a,Aa(e,t,{initData:null,initDataType:null}),2):3!=a.g?(n=a.h)?(i=[],(r=e.i.get(n))&&(r.Kb=new Sr,i.push(r.Kb)),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)):(k(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 qb(e,t){function n(e,t){return e.robustness==t.robustness&&e.contentType==t.contentType}return e.keySystem==t.keySystem&&e.licenseUri==t.licenseUri&&Mt(e.audioCapabilities,t.audioCapabilities,n)&&Mt(e.videoCapabilities,t.videoCapabilities,n)}function Xb(e,t){var n=Fb(new Bb(e.Rb(),e.bb()),t),i=t.appMetadata||{};return n=Wb(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 Wb(e){for(var t=[],n=Zi(e.variants),i=(n=l(n)).next();!i.done;i=n.next())t.push(qi(i.value));for(n=(e=l(e.textStreams)).next();!n.done;n=e.next())t.push(Xi(n.value));return t}function Yb(){this.g=new Map}function Jb(e,t){var n=t.audio,i=t.video;if(n&&!i&&e.g.set(n.id,n.bandwidth||t.bandwidth),!n&&i&&e.g.set(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.set(n.id,r),e.g.set(i.id,a)}}function $b(e,t){e.g.set(t.id,t.bandwidth||2048)}function Qb(e,t){return null==(e=e.g.get(t))&&(e=0),e}function Zb(e){var t=this;if(e&&e.constructor!=ld)throw new Ne(2,9,9008);this.g=this.h=null,e?(this.h=e.g,this.g=e.Pb()):(this.h=zl(),this.g=new jr,this.g.configure(this.h.networking)),this.i=[],this.l=[];var n=!e;this.j=new Xr((function(){var e,i,r,a,o;return R((function(s){switch(s.g){case 1:return w(s,Promise.all(t.l.map((function(e){return hb(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 ew(){if(ev(te()))e:{for(var e=l(Cb.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 tw(e){var t,n,i;return R((function(r){switch(r.g){case 1:return w(r,(t=new Ab).init(),2);case 2:return w(r,kb(t),3);case 3:return n=r.h,i=new Ub("manifest",n.path.Rb,n.path.bb,e),w(r,t.destroy(),4);case 4:return w(r,(new Zb).remove(i.toString()),0)}}))}function nw(e,t,n,i,r,a){var o,s,u,c,d,h,p,f,g,m,v;return R((function(y){switch(y.g){case 1:for(o=!1,x(y,2),s=!0,u=l(n.streams),c=u.next();!c.done;c=u.next())for(d=c.value,h=l(d.segments),p=h.next();!p.done;p=h.next())f=p.value,null!=(g=f.pendingSegmentRefId?i[f.pendingSegmentRefId]:null)&&(f.dataKey=g,f.pendingSegmentRefId=void 0),null!=(g=f.pendingInitSegmentRefId?i[f.pendingInitSegmentRefId]:null)&&(f.initSegmentKey=g,f.pendingInitSegmentRefId=void 0),f.pendingSegmentRefId&&(s=!1),f.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=k(y),w(y,tw(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 iw(e){return e.variants.some((function(e){var t=e.audio&&e.audio.encrypted;return e.video&&e.video.encrypted||t}))}function rw(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 aw(e,t,n,i){if(t.expiration=n.Pd(),n=wa(n),t.sessionIds=i?n:[],iw(e)&&i&&!n.length)throw new Ne(2,9,9007)}function ow(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:ni(r.mimeType,r.codecs),robustness:e.drmInfo.videoRobustness}):t||"audio"!=r.type||n.push({contentType:ni(r.mimeType,r.codecs),robustness:e.drmInfo.audioRobustness});return n}function sw(e,t,n){return R((function(i){return w(i,function(e,t,n,i){var r,a,o;return R((function(s){return 1==s.g?i.drmInfo?(r=function(e){var t=Array.from(e.g.keys());if(!t.length)throw new Ne(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:ow(i,!1),videoCapabilities:ow(i,!0)}})),w(s,zb(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 uw(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 Xb(t,n),Promise.all([e.removeSegments(r,i),e.removeManifests([t.key()],i)])}function lw(e,t){var n;return R((function(i){switch(i.g){case 1:return x(i,2),w(i,gc(t,e.g,e.h.streaming.retryParameters),4);case 4:n=i.h,A(i,3);break;case 2:k(i);case 3:if(n)return i.return(n);throw new Ne(1,2,2011,t)}}))}function cw(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,mssPrivateData:i.mssPrivateData,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,t),i=e.segmentIndex.get(++t)}(i,n.presentationTimeline.Gb(),(function(n,r){var l=ob(n),c=void 0;if(!a.has(l)){var d=n.endTime-n.startTime;d=Qb(t,i.id)*d,d=lb(e.g,d),a.set(l,new ab(n,d,u,!1,r))}n.Y&&(c=ob(n.Y),a.has(c)||(d=.5*Qb(t,i.id),d=lb(e.g,d),a.set(c,new ab(n.Y,d,u,!0,r)))),o.segments.push({pendingInitSegmentRefId:c,initSegmentKey:c?0:null,startTime:n.startTime,endTime:n.endTime,appendWindowStart:n.appendWindowStart,appendWindowEnd:n.appendWindowEnd,timestampOffset:n.timestampOffset,tilesLayout:n.tilesLayout,pendingSegmentRefId:l,dataKey:0,mimeType:n.mimeType,codecs:n.codecs,thumbnailSprite:n.thumbnailSprite}),0!==s&&(u=(u+1)%s)})),o}function dw(e){if(e.j.g)throw new Ne(2,9,7001)}function hw(){if(!ew())throw new Ne(2,9,9e3)}function pw(e,t){return R((function(n){return 1==n.g?(e.i.push(t),S(n,2),w(n,t,4)):2!=n.g?n.return(n.h):(E(n),Ct(e.i,t),I(n,0))}))}function fw(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}F("shaka.offline.indexeddb.StorageMechanismOpenTimeout",jb),Ib("idb",(function(){return te().uh()?new Ob:null})),Ub.prototype.Rb=function(){return this.i},Ub.prototype.bb=function(){return this.h},Ub.prototype.key=function(){return this.l},Ub.prototype.toString=function(){return this.j},(i=Hb.prototype).configure=function(){},i.start=function(e,t){var n,i,r,a,o,s,u=this;return R((function(l){switch(l.g){case 1:if(n=_b(e),u.g=n,null==n||"manifest"!=n.g)throw new Ne(2,1,9004,e);return i=new Ab,S(l,2),w(l,i.init(),4);case 4:return w(l,Eb(i,n.Rb(),n.bb()),5);case 5:return w(l,l.h.getManifests([n.key()]),6);case 6:return r=l.h,a=r[0],o=new Bb(n.Rb(),n.bb()),s=Fb(o,a),t.makeTextStreamsForClosedCaptions(s),l.return(s);case 2:return E(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 R((function(c){switch(c.g){case 1:return n=l.g,i=new Ab,x(c,2,3),w(c,i.init(),5);case 5:return w(c,Eb(i,n.Rb(),n.bb()),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 E(c),w(c,i.destroy(),10);case 10:I(c,0);break;case 2:k(c),c.u(3)}}))},i.onInitialVariantChosen=function(){},i.banLocation=function(){},i.setMediaElement=function(){},$a("application/x-offline-manifest",(function(){return new Hb})),F("shaka.offline.OfflineScheme",Kb),Kb.plugin=Gb,Ur("offline",Gb),(i=Zb.prototype).destroy=function(){return this.j.destroy()},i.configure=function(e,t){return 2==arguments.length&&"string"==typeof e&&(e=Ll(e,t)),ql(this.h,e)},i.getConfiguration=function(){var e=zl();return ql(e,this.h,zl()),e},i.Pb=function(){return this.g},i.store=function(e,t,n,i,r){var a=this,o=this.getConfiguration(),s=new db(this.g);return this.l.push(s),t=function(e,t,n,i,r,a,o,s){var u,c,d,h,p,f,g,m,v,y,b,S,C,M,D,P,L,N,O,j,U,_,B;return R((function(F){switch(F.g){case 1:return hw(),c=u=null,d=new Ab,f=p=h=null,x(F,2,3),w(F,a(),5);case 5:return u=F.h,w(F,function(e,t,n,i){var r,a,o,s,u;return R((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},updateDuration:function(){},newDrmInfo:function(){},onManifestUpdated:function(){},getBandwidthEstimate:function(){return i.abr.defaultBandwidthEstimate},onMetadata:function(){},disableStream:function(){},addFont:function(){}},n.configure(i.manifest),dw(e),w(l,n.start(t,o),2);if(3!=l.g)return s=l.h,dw(e),u=fw(s),w(l,Promise.all(Yr(u,(function(e){return e.createSegmentIndex()}))),3);if(dw(e),r)throw r;return l.return(s)}))}(e,t,u,o),6);case 6:if(g=F.h,dw(e),g.presentationTimeline.V()||g.presentationTimeline.Tc())throw new Ne(2,9,9005,t);m=l(i),v=m.next();case 7:if(v.done){F.u(9);break}return y=v.value,w(F,function(e,t,n){var i,r,a,o,s,u,c,d,h,p,f,g,m,v,y;return R((function(b){switch(b.g){case 1:return w(b,lw(e,t),2);case 2:if("text/vtt"!=(i=b.h))throw new Ne(1,2,2017,t);return w(b,function(e,t,n){var i,r,a;return R((function(o){return 1==o.g?(i=Gr,(r=Br([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=gi(i)))throw new Ne(2,2,2014,i);for(o=a(),s={periodStart:0,segmentStart:0,segmentEnd:n.presentationTimeline.getDuration(),vttOffset:0},u=De(r),c=o.parseMedia(u,s,t,[]),d=[],h=l(c),p=h.next(),f={};!p.done;f={Pf:void 0,kd:void 0},p=h.next())f.kd=p.value,f.Pf=null,g=function(e){return function(){return null==e.Pf&&(e.Pf=Qe([t],[e.kd.payload])),e.Pf||[]}}(f),m=new Vo(f.kd.startTime,f.kd.endTime,g,0,null,null,0,0,1/0),f.kd.payload.includes("#xywh")&&4===(v=f.kd.payload.split("#xywh=")[1].split(",")).length&&m.Hf({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,gc(d[0].O()[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 Du(d),mimeType:y||"",codecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:"image",primary:!1,trickModeVideo:null,dependencyStream: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([ni(y||"","")]),isAudioMuxedInVideo:!1,baseOriginalId:null})}}))}(e,y,g),10);case 10:b=F.h,g.imageStreams.push(b),dw(e),v=m.next(),F.u(7);break;case 9:S=l(r),C=S.next();case 11:return C.done?(Ra(o.drm.clearKeys,g.variants),P=g.variants.some((function(e){if(e.audio)for(var t=l(e.audio.drmInfos),n=t.next();!n.done;n=t.next())if(n.value.licenseServerUri.startsWith("data:"))return!0;if(e.video)for(t=(e=l(e.video.drmInfos)).next();!t.done;t=e.next())if(t.value.licenseServerUri.startsWith("data:"))return!0;return!1})),L=o.offline.usePersistentLicense,P&&(L=!1),w(F,e.hd(g,(function(e){f=f||e}),o,L),15)):(M=C.value,w(F,function(e,t,n,i,r,a,o){var s;return R((function(u){if(1==u.g)return a?u.u(2):w(u,lw(e,n),3);if(2!=u.g&&(a=u.h),s={id:e.m++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:Ru(0,t.presentationTimeline.getDuration(),[n]),mimeType:a||"",codecs:o||"",kind:r,encrypted:!1,drmInfos:[],keyIds:new Set,language:i,originalLanguage:i,label:null,type:rt,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([ni(a||"",o||"")]),isAudioMuxedInVideo:!1,baseOriginalId:null},!mi(ni(s.mimeType,s.codecs)))throw new Ne(2,2,2014,a);return u.return(s)}))}(e,g,M.uri,M.language,M.kind,M.mime,M.codecs),14));case 14:D=F.h,g.textStreams.push(D),dw(e),C=S.next(),F.u(11);break;case 15:if(c=F.h,dw(e),f)throw f;return w(F,function(e,t,n,i){var r,a,o,s,u,c,d,h,p,f,g,m,v,y,b,S,E,I,C,M,D,P,L,N,O,j,U,_,B;return R((function(R){switch(R.g){case 1:return r={width:1/0,height:1/0},function(e,t,n){e.variants=e.variants.filter((function(e){return _i(e,t,n)}))}(e,n.restrictions,r),w(R,Bi(t,e,i,n.drm.preferredKeySystems,n.drm.keySystemsMapping),2);case 2:for(a=[],o=n.preferredDecodingAttributes,s=n.preferredVideoCodecs,u=n.preferredAudioCodecs,c=n.preferredTextFormats,Ui(e,s,u,o,c),d=l(e.variants),h=d.next();!h.done;h=d.next())p=h.value,a.push(qi(p));for(f=l(e.textStreams),g=f.next();!g.done;g=f.next())m=g.value,a.push(Xi(m));for(v=l(e.imageStreams),y=v.next();!y.done;y=v.next())b=y.value,a.push(Wi(b));return w(R,n.offline.trackSelectionCallback(a),3);case 3:for(S=R.h,E=e.presentationTimeline.getDuration(),I=0,C=l(S),M=C.next();!M.done;M=C.next())D=M.value,P=D.bandwidth*E/8,I+=P;return x(R,4),w(R,n.offline.downloadSizeCallback(I),6);case 6:if(!R.h)throw new Ne(2,9,9014);A(R,5);break;case 4:if((L=k(R))instanceof Ne)throw L;throw new Ne(2,9,9015);case 5:for(N=new Set,O=new Set,j=new Set,U=l(S),_=U.next();!_.done;_=U.next())"variant"==(B=_.value).type&&N.add(B.id),"text"==B.type&&O.add(B.id),"image"==B.type&&j.add(B.id);e.variants=e.variants.filter((function(e){return N.has(e.id)})),e.textStreams=e.textStreams.filter((function(e){return O.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(R)}}))}(g,c,o,L),16);case 16:return w(F,d.init(),17);case 17:return dw(e),w(F,kb(d),18);case 18:return h=F.h,dw(e),N=function(e,t,n,i,r,a,o){var s=function(e,t,n){return{offlineUri:null,originalManifestUri:e,duration:t.presentationTimeline.getDuration(),size:0,expiration:1/0,tracks:t=Wb(t),appMetadata:n,isIncomplete:!1}}(n,t,i),u=r.offline.progressCallback;!function(e,t,n){e.o=function(e,t){s.size=t,u(s,e)},e.m=n}(a,0,(function(t,n){c&&o&&d==n&&ba(e,"cenc",t)}));var c=iw(t)&&!rw(t),d=null;c&&(d=gw.get(e.g.keySystem));for(var h=new Yb,p=l(t.textStreams),f=p.next();!f.done;f=p.next())h.g.set(f.value.id,52);for(f=(p=l(t.imageStreams)).next();!f.done;f=p.next())$b(h,f.value);for(f=(p=l(t.variants)).next();!f.done;f=p.next())Jb(h,f.value);return a=function(e,t,n,i){for(var r=new Map,a=fw(n),o=new Map,s=(a=l(a)).next();!s.done;s=a.next()){var u=cw(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()),yh:Array.from(r.values())}}(a,h,t,r),r=a.streams,a=a.yh,(h=e.g)&&o&&(h.initData=[]),{lk:{creationTime:Date.now(),originalManifestUri:n,duration:t.presentationTimeline.getDuration(),size:0,expiration:e.Pd(),streams:r,sessionIds:o?wa(e):[],drmInfo:h,appMetadata:i,isIncomplete:!0,sequenceMode:t.sequenceMode,type:t.type},yh:a}}(c,g,t,n,o,s,L),O=N.lk,j=N.yh,w(F,h.bb.addManifests([O]),19);case 19:if(U=F.h,dw(e),p=U[0],dw(e),f)throw f;return w(F,function(e,t,n,i,r,a,o,s,u,c){var d,h,p,f,g,m,v,y,b,S,E;return R((function(I){switch(I.g){case 1:if(d={},h=0,p=function(){if(e.j.g||r.l)throw new Ne(2,9,7001)},f=function(e,t){var f,g,m,v,y,b,x,S,A;return R((function(k){if(1==k.g){for(f=l(e),g=f.next(),m={};!g.done;m={jc:void 0},g=f.next())m.jc=g.value,p(),v=sb(m.jc,a),y=m.jc.i,b=m.jc.h,x=function(e){return function(t){var n,i,r,a;return R((function(s){switch(s.g){case 1:if(n=e.jc.g,i=n.Yb(!1),!n.aesKey||i){s.u(2);break}return w(s,il(t,n.aesKey,e.jc.j),3);case 3:t=s.h;case 2:return r=ob(n),w(s,o.addSegments([{data:t}]),4);case 4:a=s.h,p(),d[r]=a[0],h+=t.byteLength,T(s)}}))}}(m),S=m.jc.g,(A=S.Yb(!1))?pb(r,m.jc.groupId,A,y,b,x):r.queue(m.jc.groupId,v,y,b,x);return w(k,function(e){return R((function(t){return 1==t.g?w(t,Promise.all(e.i.values()),2):t.return(e.g.g)}))}(r),2)}return p(),!t||r.l?k.u(0):(aw(s,i,u,c),w(k,o.updateManifest(n,i),0))}))},g=!1,x(I,2),!iw(s)||!g||rw(s)){I.u(4);break}return w(I,f(t.filter((function(e){return e.h})),!0),5);case 5:return p(),t=t.filter((function(e){return!e.h})),m=d,v=h,d={},h=0,w(I,nw(o,n,i,m,v,(function(){return dw(e)})),6);case 6:p();case 4:if(g){I.u(7);break}return w(I,f(t,!1),8);case 8:return p(),y=d,b=h,d={},h=0,w(I,nw(o,n,i,y,b,(function(){return p()})),9);case 9:p();case 7:A(I,0);break;case 2:return S=k(I),E=Object.values(d),w(I,o.removeSegments(E,(function(){})),10);case 10:throw S}}))}(e,j,p,O,s,o,h.bb,g,c,L),20);case 20:return dw(e),aw(g,O,c,L),w(F,h.bb.updateManifest(p,O),21);case 21:return dw(e),_=new Ub("manifest",h.path.Rb,h.path.bb,p),F.return(Xb(_,O));case 3:return E(F),w(F,d.destroy(),22);case 22:if(!u){F.u(23);break}return w(F,u.stop(),23);case 23:if(!c){F.u(25);break}return w(F,c.destroy(),25);case 25:I(F,0);break;case 2:if(B=k(F),null==p){F.u(27);break}return w(F,tw(p),27);case 27:throw f||B}}))}(this,e,t||{},i||[],r||[],(function(){var t;return R((function(i){return 1==i.g?n?i.u(2):w(i,gc(e,a.g,o.manifest.retryParameters),3):(2!=i.g&&(n=i.h),t=Qa(e,n||null),i.return(t()))}))}),o,s),(t=new Ar(t,(function(){return hb(s)}))).finally((function(){Ct(a.l,s)})),function(e,t){var n=t.promise;return e.i.push(n),t.finally((function(){Ct(e.i,n)}))}(this,t)},i.remove=function(e){return pw(this,function(e,t){var n,i,r,a,o,s;return R((function(u){switch(u.g){case 1:if(hw(),null==(n=_b(t))||"manifest"!=n.g)throw new Ne(2,9,9004,t);return i=n,r=new Ab,S(u,2),w(u,r.init(),4);case 4:return w(u,Eb(r,i.Rb(),i.bb()),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([sw(e,s,r),uw(a,i,s)]),2);case 2:return E(u),w(u,r.destroy(),8);case 8:I(u,0)}}))}(this,e))},i.Ik=function(){return pw(this,function(e){var t,n,i,r,a,o,s,u,c,d;return R((function(h){switch(h.g){case 1:return hw(),t=e.g,n=e.h.drm,i=new Ab,r=!1,S(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,zb(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 E(h),w(h,i.destroy(),11);case 11:I(h,3);break;case 3:return h.return(!r)}}))}(this))},i.list=function(){return pw(this,R((function(i){switch(i.g){case 1:return hw(),e=[],t=new Ab,S(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,bb:i},e)}))}))}(t,(function(t,i){n=n.then((function(){return R((function(n){if(1==n.g)return w(n,i.getAllManifests(),2);n.h.forEach((function(n,i){n=Xb(new Ub("manifest",t.Rb,t.bb,i),n),e.push(n)})),T(n)}))}))})),w(i,n,2);case 2:return E(i),w(i,t.destroy(),6);case 6:I(i,3);break;case 3:return i.return(e)}})));var e,t,n},i.hd=function(e,t,n,i){var r,a=this;return R((function(o){return 1==o.g?((r=new fa({pc:a.g,onError:t,rf:function(){},onExpirationUpdated:function(){},onEvent:function(){}})).configure(n.drm),w(o,function(e,t,n){return e.na=!0,e.B=new Map,e.N=n,ma(e,t,!1)}(r,e.variants,i),2)):3!=o.g?w(o,ya(r),3):o.return(r)}))},F("shaka.offline.Storage",Zb),Zb.deleteAll=function(){var e;return R((function(t){return 1==t.g?(e=new Ab,S(t,2),w(t,function(e){var t,n;return R((function(i){return 1==i.g?(t=Array.from(e.g.values()),(n=0<t.length)||Cb.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?(E(t),w(t,e.destroy(),5)):I(t,0)}))},Zb.prototype.list=Zb.prototype.list,Zb.prototype.removeEmeSessions=Zb.prototype.Ik,Zb.prototype.remove=Zb.prototype.remove,Zb.prototype.store=Zb.prototype.store,Zb.prototype.getNetworkingEngine=Zb.prototype.Pb,Zb.prototype.getConfiguration=Zb.prototype.getConfiguration,Zb.prototype.configure=Zb.prototype.configure,Zb.prototype.destroy=Zb.prototype.destroy,Zb.support=ew;var gw=(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").set("com.huawei.wiseplay","3d5e6d359b9a41e8b843dd3c6e72c42c");function mw(){}function vw(e,t){for(e={priority:t||0,callback:e},t=0;t<ww.length;t++)if(ww[t].priority<e.priority)return void ww.splice(t,0,e);ww.push(e)}hd("offline",ew),F("shaka.polyfill",mw),mw.register=vw,mw.installAll=function(){for(var e=l(ww),t=e.next();!t.done;t=e.next()){t=t.value;try{t.callback()}catch(e){q("Error installing polyfill!",e)}}};var yw,bw,ww=[];function Tw(){}function xw(){if(!Object.getOwnPropertyDescriptor(Element.prototype,"ariaHidden"))for(var e=l(["ariaHidden","ariaLabel","ariaPressed","ariaSelected"]),t=e.next();!t.done;t=e.next())Sw(t.value)}function Sw(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 Aw(e,t,n){this.g=e,this.i=t||null,this.h=n||null,this.keySystem=e.keySystem}function kw(e){return e.startsWith("com.apple")?"cbcs":e.startsWith("com.widevine")||e.startsWith("com.microsoft")||e.startsWith("com.chromecast")||e.startsWith("org.w3")||e.startsWith("com.huawei")?"cenc":(q("EmeEncryptionSchemePolyfill: Unknown key system:",e,"Please contribute!"),null)}function Ew(e){if(!e)return!1;var t=(e=e.getConfiguration()).audioCapabilities&&e.audioCapabilities[0];return!(!(e=e.videoCapabilities&&e.videoCapabilities[0]||t)||void 0===e.encryptionScheme)}function Iw(e,t){return!(e&&e!=t&&("cbcs"!=e&&"cbcs-1-9"!=e||!te().$c()))}function Cw(){}function Mw(){te().If()&&!yw&&!navigator.emeEncryptionSchemePolyfilled&&navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration&&(yw=navigator.requestMediaKeySystemAccess,navigator.requestMediaKeySystemAccess=Dw,navigator.emeEncryptionSchemePolyfilled=!0)}function Dw(e,t){var n,i=this;return R((function(r){return 1==r.g?w(r,yw.call(i,e,t),2):Ew(n=r.h)?(navigator.requestMediaKeySystemAccess=yw,r.return(n)):(navigator.requestMediaKeySystemAccess=Pw,r.return(Pw.call(i,e,t)))}))}function Pw(e,t){var n,i,r,a,o,s,u,c,d,h,p,f,g=this;return R((function(m){if(1==m.g){for(n=kw(e),i=[],r=l(t),a=r.next();!a.done;a=r.next())o=a.value,s=Rw(o.videoCapabilities,n),u=Rw(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,yw.call(g,e,i),2)}return h=m.h,f=p=null,i[0]&&(i[0].videoCapabilities&&(p=i[0].videoCapabilities[0].encryptionScheme),i[0].audioCapabilities&&(f=i[0].audioCapabilities[0].encryptionScheme)),m.return(new Aw(h,p,f))}))}function Rw(e,t){return e?e.filter((function(e){return Iw(e.encryptionScheme,t)})):e}function Lw(){}function Nw(){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",Ow),document.addEventListener("webkitfullscreenerror",Ow),document.addEventListener("mozfullscreenchange",Ow),document.addEventListener("mozfullscreenerror",Ow),document.addEventListener("MSFullscreenChange",Ow),document.addEventListener("MSFullscreenError",Ow)}}function Ow(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 jw(){}function Uw(){te().If()&&!bw&&!navigator.mediaCapabilitiesEncryptionSchemePolyfilled&&navigator.mediaCapabilities&&(bw=navigator.mediaCapabilities.decodingInfo,navigator.mediaCapabilities.decodingInfo=_w,navigator.mediaCapabilitiesEncryptionSchemePolyfilled=!0)}function _w(e){var t,n,i=this;return R((function(r){switch(r.g){case 1:return w(r,bw.call(i,e),2);case 2:if(!(t=r.h).supported||!e.keySystemConfiguration)return r.return(t);if(Ew(n=t.keySystemAccess))return navigator.mediaCapabilities.decodingInfo=bw,r.return(t);if(navigator.mediaCapabilities.decodingInfo=Bw,n){r.u(3);break}return w(r,Fw(e),4);case 4:return t.keySystemAccess=r.h,r.return(t);case 3:return r.return(Bw.call(i,e))}}))}function Bw(e){var t,n,i,r,a,o,s,u=this;return R((function(l){switch(l.g){case 1:return n=t=null,!e.keySystemConfiguration||(i=e.keySystemConfiguration,r=i.keySystem,n=i.audio&&i.audio.encryptionScheme,t=i.video&&i.video.encryptionScheme,a=kw(r),o={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:e},Iw(n,a)&&Iw(t,a))?w(l,bw.call(u,e),2):l.return(o);case 2:if((s=l.h).keySystemAccess){s.keySystemAccess=new Aw(s.keySystemAccess,t,n),l.u(3);break}if(!e.keySystemConfiguration){l.u(3);break}return w(l,Fw(e),5);case 5:s.keySystemAccess=l.h;case 3:return l.return(s)}}))}function Fw(e){var t,n;return R((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 Vw(){}function Hw(){te().dc()||(navigator.mediaCapabilities||(navigator.mediaCapabilities={}),Vw.originalMcap=navigator.mediaCapabilities,navigator.mediaCapabilities.decodingInfo=Kw)}function Kw(t){var n,i,r,a,o,s,u;return R((function(l){switch(l.g){case 1:if(n={supported:!1,powerEfficient:!0,smooth:!0,keySystemAccess:null,configuration:t},te(),i=t.video,r=t.audio,"media-source"!=t.type){if("file"!=t.type)return l.return(n);if(i&&(a=i.contentType,""==es().canPlayType(a))||r&&(o=r.contentType,""==es().canPlayType(o)))return l.return(n);l.u(2);break}if(!ev())return l.return(n);if(!i){l.u(3);break}return w(l,function(t){var n;return R((function(i){return 1==i.g?"CAST"!==te().La()?i.u(2):w(i,function(t){var n,i,r,a;return R((function(o){if(1==o.g){if(!(e.cast&&cast.__platform__&&cast.__platform__.canDisplayType))return o.return(ht(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 o.return(!1)}return r=!1,(a=Jw).has(n)?(r=a.get(n),o.u(2)):w(o,cast.__platform__.canDisplayType(n),3)}return 2!=o.g&&(r=o.h,a.set(n,r)),o.return(r)}))}(t),3):2!=i.g?(n=i.h,i.return(n)):i.return(ht(t.contentType))}))}(i),4);case 4:if(!l.h)return l.return(n);case 3:if(r){var c=te().La(),d=r.contentType;if("CAST"===c&&r.spatialRendering&&(d+="; spatialRendering=true"),!ht(d))return l.return(n)}case 2:return t.keySystemConfiguration?(s=t.keySystemConfiguration,w(l,function(e,t,n){var i,r,a,o,s,u,l,c,d,h,p;return R((function(f){switch(f.g){case 1:if(i=[],r=[],n.audio&&(a={robustness:n.audio.robustness||"",contentType:t.contentType},te().li()&&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=ui(u)+";"+si(u),d=ui(l)+";"+si(l),h=n.keySystem,p=null,x(f,2),wr.has(c+"#"+d+"#"+h)){p=wr.get(c+"#"+d+"#"+h)||null,f.u(4);break}return w(f,navigator.requestMediaKeySystemAccess(n.keySystem,[s]),5);case 5:p=f.h,wr.set(c+"#"+d+"#"+h,p);case 4:A(f,3);break;case 2:k(f);case 3:return f.return(p)}}))}(i,r,s),6)):(n.supported=!0,l.return(n));case 6:(u=l.h)&&(n.supported=!0,n.keySystemAccess=u);case 5:return l.return(n)}}))}mw.Aria=Tw,Tw.install=xw,vw(xw),Aw.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},Aw.prototype.createMediaKeys=function(){return this.g.createMediaKeys()},mw.EmeEncryptionScheme=Cw,Cw.install=Mw,vw(Mw),mw.Fullscreen=Lw,Lw.install=Nw,vw(Nw),mw.MCapEncryptionScheme=jw,jw.install=Uw,vw(Uw,-2),mw.MediaCapabilities=Vw,Vw.install=Hw,Vw.originalMcap=null;var Gw,zw,qw,Xw,Ww,Yw,Jw=new Map;function $w(){}function Qw(){var t=te(),n="WEBKIT"===t.Da()?t.xa():null;for((e.MediaSource||e.ManagedMediaSource)&&n&&e.MediaSource&&(12>=n?(Zw(),function(){var e=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(t,n){return e.call(this,t,n-.001)}}()):15>=n&&Zw()),n=(t=l(t.xi())).next();!n.done;n=t.next())eT(n.value);(e.MediaSource||e.ManagedMediaSource)&&function(){if(e.MediaSource){var t=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=function(e){return"mp2t"!=ai(e)&&t(e)}}if(e.ManagedMediaSource){var n=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);e.ManagedMediaSource.isTypeSupported=function(e){return"mp2t"!=ai(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;te().Vi()&&(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 Zw(){var e=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var t=e.apply(this,L.apply(0,arguments));return t.abort=function(){},t}}function eT(t){var n=MediaSource.isTypeSupported.bind(MediaSource);if(MediaSource.isTypeSupported=function(e){return si(e)!=t&&n(e)},e.ManagedMediaSource){var i=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);e.ManagedMediaSource.isTypeSupported=function(e){return si(e)!=t&&i(e)}}}function tT(){}function nT(){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 iT;screen.orientation=n,t(),e.addEventListener("orientationchange",(function(){t();var e=new Dr("change");n.dispatchEvent(e)}))}())}function iT(){Lr.call(this),this.type="",this.angle=0}function rT(){}function aT(t){e.HTMLVideoElement&&e.WebKitMediaKeys&&e.shakaMediaKeysPolyfill!=gT&&(void 0!==t&&t&&(Gw=!0,zw=Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"mediaKeys"),qw=HTMLMediaElement.prototype.setMediaKeys,Xw=e.MediaKeys,Ww=e.MediaKeySystemAccess,Yw=navigator.requestMediaKeySystemAccess),delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=sT,e.MediaKeys=cT,e.MediaKeySystemAccess=lT,navigator.requestMediaKeySystemAccess=oT,e.shakaMediaKeysPolyfill=gT,or.clear(),wr.clear())}function oT(e,t){try{var n=new lT(e,t);return Promise.resolve(n)}catch(e){return Promise.reject(e)}}function sT(e){var t=this.mediaKeys;return t&&t!=e&&dT(t,null),delete this.mediaKeys,(this.mediaKeys=e)?dT(e,this):Promise.resolve()}function uT(e){if(Re(e=De(e.initData)).getUint32(0,!0)+4!=e.byteLength)throw new RangeError("Malformed FairPlay init data");e=Fe(e=_e(e.subarray(4),!0));var t=new Event("encrypted");t.initDataType="skd",t.initData=Me(e),this.dispatchEvent(t)}function lT(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 cT(e){this.h=new WebKitMediaKeys(e),this.g=new $}function dT(e,t){if(e.g.Ra(),!t)return Promise.resolve();e.g.D(t,"webkitneedkey",uT);try{return pu(t,HTMLMediaElement.HAVE_METADATA,e.g,(function(){t.webkitSetMediaKeys(e.h)})),Promise.resolve()}catch(e){return Promise.reject(e)}}function hT(e){Lr.call(this),this.i=null,this.l=e,this.g=this.h=null,this.j=new $,this.sessionId="",this.expiration=NaN,this.closed=new Sr,this.keyStatuses=new fT}function pT(e,t){var n=e.keyStatuses;n.size=null==t?0:1,n.g=t,t=new Dr("keystatuseschange"),e.dispatchEvent(t)}function fT(){this.size=0,this.g=void 0}vw(Hw,-1),mw.MediaSource=$w,$w.install=Qw,vw(Qw),mw.Orientation=tT,tT.install=nT,m(iT,Lr),iT.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))},iT.prototype.unlock=function(){screen.unlockOrientation?screen.unlockOrientation():screen.mozUnlockOrientation?screen.mozUnlockOrientation():screen.msUnlockOrientation&&screen.msUnlockOrientation()},vw(nT),mw.PatchedMediaKeysApple=rT,rT.uninstall=function(){e.shakaMediaKeysPolyfill==gT&&Gw&&(Gw=!1,Object.defineProperty(HTMLMediaElement.prototype,"mediaKeys",zw),HTMLMediaElement.prototype.setMediaKeys=qw,e.MediaKeys=Xw,e.MediaKeySystemAccess=Ww,navigator.requestMediaKeySystemAccess=Yw,zw=Yw=qw=Ww=Xw=null,e.shakaMediaKeysPolyfill="",or.clear(),wr.clear())},rT.install=aT,lT.prototype.createMediaKeys=function(){var e=new cT(this.keySystem);return Promise.resolve(e)},lT.prototype.getConfiguration=function(){return this.g},cT.prototype.createSession=function(e){if("temporary"!=(e=e||"temporary"))throw new TypeError("Session type "+e+" is unsupported on this platform.");return new hT(this.h,e)},cT.prototype.setServerCertificate=function(){return Promise.resolve(!1)},cT.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")},m(hT,Lr),(i=hT.prototype).generateRequest=function(e,t){var n=this;this.h=new Sr;try{var i=this.l.createSession("video/mp4",De(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 Dr("message",e=(new Map).set("messageType",null==n.keyStatuses.Cc()?"license-request":"license-renewal").set("message",Me(e.message))),n.dispatchEvent(e)})),this.j.D(i,"webkitkeyadded",(function(){n.g&&(pT(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:pT(n,"output-not-allowed");break;default:pT(n,"internal-error")}})),pT(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 Sr;try{this.i.update(De(e))}catch(e){this.g.reject(e)}return this.g},i.close=function(){try{this.i.close(),this.closed.resolve(),this.j.Ra()}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=fT.prototype).Cc=function(){return this.g},i.forEach=function(e){this.g&&e(this.g,br.value())},i.get=function(e){if(this.has(e))return this.g},i.has=function(e){var t=br.value();return!(!this.g||!Ce(e,t))},i.entries=function(){},i.keys=function(){},i.values=function(){};var gT="apple";function mT(){}function vT(){if(e.MediaKeys){var t=te();MediaKeys.prototype.setServerCertificate&&t.je()||(MediaKeys.prototype.setServerCertificate=yT)}}function yT(){return Promise.resolve(!1)}function bT(){}function wT(){if(!(!e.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)LT="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;navigator.requestMediaKeySystemAccess=xT,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=ST,e.MediaKeys=kT,e.MediaKeySystemAccess=AT,e.shakaMediaKeysPolyfill=NT}}function TT(e){return LT?LT+e.charAt(0).toUpperCase()+e.slice(1):e}function xT(e,t){try{var n=new AT(e,t);return Promise.resolve(n)}catch(e){return Promise.reject(e)}}function ST(e){var t=this.mediaKeys;return t&&t!=e&&ET(t,null),delete this.mediaKeys,(this.mediaKeys=e)&&ET(e,this),Promise.resolve()}function AT(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 kT(e){this.l=e,this.h=null,this.g=new $,this.i=[],this.j=new Map}function ET(e,t){e.h=t,e.g.Ra();var n=LT;t&&(e.g.D(t,n+"needkey",(function(t){var n=new CustomEvent("encrypted");n.initDataType="cenc",n.initData=Me(t.initData),e.h.dispatchEvent(n)})),e.g.D(t,n+"keymessage",(function(t){var n=IT(e,t.sessionId);n&&(t=new Dr("message",t=(new Map).set("messageType",null==n.keyStatuses.Cc()?"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=IT(e,t.sessionId))&&t.ready()})),e.g.D(t,n+"keyerror",(function(t){var n=IT(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?PT(n,"output-restricted"):PT(n,1==i?"expired":"internal-error"))}})))}function IT(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 CT(e,t,n){Lr.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 Sr,this.keyStatuses=new RT}function MT(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=De(Fe("LOAD_SESSION|"+n));else{var r=Fe("PERSISTENT|");i=$e(r,t)}else i=De(t)}catch(e){return Promise.reject(e)}e.h=new Sr;var a=TT("generateKeyRequest");try{e.j[a](e.i,i)}catch(t){if("InvalidStateError"!=t.name)return e.h=null,Promise.reject(t);new Ti((function(){try{e.j[a](e.i,i)}catch(t){e.h.reject(t),e.h=null}})).ia(.01)}return e.h}function DT(e,t,n){if(e.g)e.g.then((function(){return DT(e,t,n)})).catch((function(){return DT(e,t,n)}));else{if(e.g=t,"webkit-org.w3.clearkey"==e.i){var i=Ue(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=We(r.keys[0].k),r=We(r.keys[0].kid)}else i=De(n),r=null;var a=TT("addKey");try{e.j[a](e.i,i,r,e.sessionId)}catch(t){e.g.reject(t),e.g=null}}}function PT(e,t){var n=e.keyStatuses;n.size=null==t?0:1,n.g=t,t=new Dr("keystatuseschange"),e.dispatchEvent(t)}function RT(){this.size=0,this.g=void 0}vw((function(){e.HTMLVideoElement&&e.WebKitMediaKeys&&(navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||aT())})),mw.PatchedMediaKeysCert=mT,mT.install=vT,vw(vT),mw.PatchedMediaKeysWebkit=bT,bT.install=wT,AT.prototype.createMediaKeys=function(){var e=new kT(this.g);return Promise.resolve(e)},AT.prototype.getConfiguration=function(){return this.h},kT.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 CT(t,this.l,e),this.i.push(e),e},kT.prototype.setServerCertificate=function(){return Promise.resolve(!1)},kT.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")},m(CT,Lr),(i=CT.prototype).ready=function(){PT(this,"usable"),this.g&&this.g.resolve(),this.g=null},i.generateRequest=function(e,t){return MT(this,t,null)},i.load=function(e){return"persistent-license"==this.l?MT(this,null,e):Promise.reject(Error("Not a persistent session."))},i.update=function(e){var t=new Sr;return DT(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=TT("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=RT.prototype).Cc=function(){return this.g},i.forEach=function(e){this.g&&e(this.g,br.value())},i.get=function(e){if(this.has(e))return this.g},i.has=function(e){var t=br.value();return!(!this.g||!Ce(e,t))},i.entries=function(){},i.keys=function(){},i.values=function(){};var LT="",NT="webkit";function OT(){}function jT(){if(e.HTMLVideoElement){var t=HTMLVideoElement.prototype;t.requestPictureInPicture&&document.exitPictureInPicture||!t.webkitSupportsPresentationMode||(document.pictureInPictureEnabled=!0,document.pictureInPictureElement=null,t.requestPictureInPicture=_T,Object.defineProperty(t,"disablePictureInPicture",{get:FT,set:VT,enumerable:!0,configurable:!0}),document.exitPictureInPicture=BT,document.addEventListener("webkitpresentationmodechanged",UT,!0))}}function UT(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 _T(){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 BT(){var e=document.pictureInPictureElement;return e?(e.webkitSetPresentationMode("inline"),document.pictureInPictureElement=null,Promise.resolve()):Promise.reject(Error("No picture in picture element found"))}function FT(){return!!this.hasAttribute("disablePictureInPicture")||!this.webkitSupportsPresentationMode("picture-in-picture")}function VT(e){e?this.setAttribute("disablePictureInPicture",""):this.removeAttribute("disablePictureInPicture")}function HT(){}function KT(){e.crypto&&("randomUUID"in e.crypto||(e.crypto.randomUUID=GT))}function GT(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.substr(t.lastIndexOf("/")+1)}function zT(){}function qT(){var e=Symbol.prototype;"description"in e||Object.defineProperty(e,"description",{get:XT})}function XT(){var e=/\((.*)\)/.exec(this.toString());return e?e[1]:void 0}function WT(){}function YT(){for(var e=l([Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,Int8Array,Int16Array,Int32Array,Float32Array,Float64Array]),t=e.next();!t.done;t=e.next())(t=t.value).prototype.indexOf||(t.prototype.indexOf=JT),t.prototype.lastIndexOf||(t.prototype.lastIndexOf=$T),t.prototype.includes||(t.prototype.includes=QT)}function JT(e,t){return Array.prototype.indexOf.call(this,e,t)}function $T(e,t){return Array.prototype.lastIndexOf.call(this,e,t)}function QT(e,t){return-1!==this.indexOf(e,t)}function ZT(){}function ex(){if(e.HTMLMediaElement){var t=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var e=t.apply(this);return e&&e.catch((function(){})),e}}}function tx(){}function nx(){if(e.HTMLVideoElement){var t=HTMLVideoElement.prototype;!t.getVideoPlaybackQuality&&("webkitDroppedFrameCount"in t||"number"==typeof es().webkitDroppedFrameCount)&&(t.getVideoPlaybackQuality=ix)}}function ix(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}function rx(){}function ax(){if(!e.VTTCue&&e.TextTrackCue){var t=null,n=TextTrackCue.length;if(3==n)t=ox;else if(6==n)t=sx;else{try{var i=!!ox(1,2,"")}catch(e){i=!1}i&&(t=ox)}t&&(e.VTTCue=function(e,n,i){return t(e,n,i)})}}function ox(t,n,i){return new e.TextTrackCue(t,n,i)}function sx(t,n,i){return new e.TextTrackCue(t+"-"+n+"-"+i,t,n,i)}function ux(e){Lr.call(this),this.h=e,this.l=null,this.g=[],this.i=-1,this.j=null,this.m=new $}function lx(){}vw(wT),mw.PiPWebkit=OT,OT.install=jT,vw(jT),mw.RandomUUID=HT,HT.install=KT,vw(KT),mw.Symbol=zT,zT.install=qT,vw(qT),mw.TypedArray=WT,WT.install=YT,vw(YT),mw.VideoPlayPromise=ZT,ZT.install=ex,vw(ex),mw.VideoPlaybackQuality=tx,tx.install=nx,vw(nx),mw.VTTCue=rx,rx.install=ax,vw(ax),m(ux,Lr),(i=ux.prototype).destroy=function(){var e=this;return R((function(t){if(1==t.g)return w(t,e.removeAllItems(),2);e.h=null,e.m&&(e.m.release(),e.m=null),Lr.prototype.release.call(e),T(t)}))},i.configure=function(e){this.l=e},i.getConfiguration=function(){return this.l},i.getCurrentItem=function(){return this.g.length&&0<=this.i&&this.i<this.g.length?this.g[this.i]:null},i.getCurrentItemIndex=function(){return this.i},i.getItems=function(){return this.g.slice()},i.insertItems=function(e){this.g.push.apply(this.g,c(e)),this.dispatchEvent(new Dr("itemsinserted"))},i.removeAllItems=function(){var e=this;return R((function(t){switch(t.g){case 1:if(e.m.Ra(),!(e.g.length&&0<=e.i)){t.u(2);break}return w(t,e.h.vc(),2);case 2:if(!e.j){t.u(4);break}if(e.j.xf.o){t.u(5);break}return w(t,e.j.xf.destroy(),5);case 5:e.j=null;case 4:e.g=[],e.i=-1,e.dispatchEvent(new Dr("itemsremoved")),T(t)}}))},i.playItem=function(e){var t,n,i,r,a,o,s,u,c,d,h,p,f,g,m=this;return R((function(v){if(1==v.g){if(m.m.Ra(),!m.g.length||e>=m.g.length)throw new Ne(2,7,7007);return t=m.g[e],m.i!=e&&(m.i=e,m.dispatchEvent(new Dr("currentitemchanged"))),n=m.h.h,0<(i=m.l?m.l.preloadNextUrlWindow:0)&&(r=!1,m.m.D(n,"timeupdate",(function(){var e,t,a,o;return R((function(s){switch(s.g){case 1:if(m.j||1>=m.g.length||r||m.h.V()||!n.duration)return s.return();if(e=m.h.Sa().end-n.currentTime,isNaN(e)){s.u(0);break}if(!(e<=i)){s.u(0);break}if(t=m.l&&m.l.repeatMode,a=null,m.i+1<m.g.length?a=m.g[m.i+1]:1==t&&(a=m.g[0]),!a){s.u(0);break}return r=!0,o=null,x(s,5),w(s,m.h.preload(a.manifestUri,a.startTime,a.mimeType,a.config),7);case 7:o=s.h,A(s,6);break;case 5:k(s),o=null;case 6:m.j={item:a,xf:o},r=!1,T(s)}}))}))),m.m.D(m.h,"complete",(function(){var e=m.l&&m.l.repeatMode,t=!1;if(2==e)t=!0;else{var i=m.i+1;i<m.g.length?m.playItem(i):1==e&&(1==m.g.length?t=!0:m.playItem(0))}t&&(n.paused?(n.currentTime=m.h.Sa().start,n.play()):m.m.D(n,"paused",(function(){n.currentTime=m.h.Sa().start,n.play()})))})),t.config&&(m.h.Ci(),m.h.configure(t.config)),a=t.manifestUri,m.j&&m.j.item==t&&m.j.xf&&(a=m.j.xf),w(v,m.h.load(a,t.startTime,t.mimeType),2)}if(m.j=null,t.extraText)for(o=l(t.extraText),s=o.next();!s.done;s=o.next())(u=s.value).mime?m.h.Hd(u.uri,u.language,u.kind,u.mime,u.codecs):m.h.Hd(u.uri,u.language,u.kind);if(t.extraThumbnail)for(c=l(t.extraThumbnail),d=c.next();!d.done;d=c.next())h=d.value,m.h.He(h);if(t.extraChapter)for(p=l(t.extraChapter),f=p.next();!f.done;f=p.next())g=f.value,m.h.Ge(g.uri,g.language,g.mime);T(v)}))},F("shaka.queue.QueueManager",ux),ux.prototype.playItem=ux.prototype.playItem,ux.prototype.removeAllItems=ux.prototype.removeAllItems,ux.prototype.insertItems=ux.prototype.insertItems,ux.prototype.getItems=ux.prototype.getItems,ux.prototype.getCurrentItemIndex=ux.prototype.getCurrentItemIndex,ux.prototype.getCurrentItem=ux.prototype.getCurrentItem,ux.prototype.getConfiguration=ux.prototype.getConfiguration,ux.prototype.configure=ux.prototype.configure,ux.prototype.destroy=ux.prototype.destroy,yh=function(e){return new ux(e)},lx.prototype.parseInit=function(){},lx.prototype.setSequenceMode=function(){},lx.prototype.setManifestType=function(){},lx.prototype.parseMedia=function(e,t){for(var n=null,i=[],r=(e=l(e=Ue(e).split(/\r?\n/))).next();!r.done;r=e.next())if((r=r.value)&&!/^\s+$/.test(r)&&(r=cx.exec(r))){var a=dx.exec(r[1]);r=new Tn(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",lx),lx.prototype.parseMedia=lx.prototype.parseMedia,lx.prototype.setManifestType=lx.prototype.setManifestType,lx.prototype.setSequenceMode=lx.prototype.setSequenceMode,lx.prototype.parseInit=lx.prototype.parseInit;var cx=/^\[(\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?)\](.*)/,dx=/^(\d+):(\d{1,2}(?:[.,]\d{1,3})?)$/;function hx(){}function px(e,t,n,i,r,a,o,s,u,c,d,h,p){var f=c;if(zt(e)){if(!d)return null;var g={tagName:"span",children:[Wt(e)],attributes:{},parent:null}}else g=e;for(var m=null,v=l(Vx),y=v.next();!y.done&&!(m=Tx(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=nn(g,Vx,"backgroundImage"))&&b.test(y)){if((v=parseInt(y.split(":").pop(),10)-1)>=p.length)return null;v=p[v]}else h&&y&&!y.startsWith("#")&&(b=new de(h),y=new de(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(zt)))for(var w=l(g.children),T=w.next();!T.done;T=w.next())(T=px(T.value,t,n,i,r,a,o,y,u,g,d,h,p))&&s.push(T);if(i=null!=c,h=Wt(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=(p=Sx(g,n)).start,p=p.end;f&&f.tagName&&"tt"!=f.tagName;)h=(p=xx(f,n,h,p)).start,p=p.end,f=f.parent;if(null==h&&(h=0),h+=t.periodStart,p=null==p?1/0:p+t.periodStart,h=Math.max(h,t.segmentStart),p=Math.min(p,t.segmentEnd),!w&&0<s.length)for(h=1/0,p=0,n=(t=l(s)).next();!n.done;n=t.next())n=n.value,h=Math.min(h,n.startTime),p=Math.max(p,n.endTime);if("br"==g.tagName)return(r=new Tn(h,p,"")).lineBreak=!0,r;if(t="",b&&(t=Ke(Wt(g)||""),y&&(t=t.replace(/\s+/g," "))),(t=new Tn(h,p,t)).nestedCues=s,d||(t.isContainer=!0),u&&(t.cellResolution=u),u=Tx(g,"region",a,"")[0],g.attributes.region&&u&&u.attributes["xml:id"]){var x=u.attributes["xml:id"];t.region=o.filter((function(e){return e.id==x}))[0]}return o=u,c&&i&&!g.attributes.region&&!g.attributes.style&&(o=Tx(c,"region",a,"")[0]),function(e,t,n,i,r,a,o,s){if("rtl"==vx(t,n,a,"direction",o=o||s)&&(e.direction="rtl"),"tb"==(s=vx(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=Ln),(s=vx(t,n,a,"textAlign",!0))?(e.positionAlign=_x.get(s),e.lineAlign=Ux.get(s),e.textAlign=Dn[s.toUpperCase()]):e.textAlign=Mn,(s=vx(t,n,a,"displayAlign",!0))&&(e.displayAlign=Rn[s.toUpperCase()]),(s=vx(t,n,a,"color",o))&&(e.color=gx(s)),(s=vx(t,n,a,"backgroundColor",o))&&(e.backgroundColor=gx(s)),(s=vx(t,n,a,"border",o))&&(e.border=s),s=vx(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=vx(t,n,a,"fontWeight",o))&&"bold"==s&&(e.fontWeight=Vn),s=vx(t,n,a,"wrapOption",o),e.wrapLine=!s||"noWrap"!=s,(s=vx(t,n,a,"lineHeight",o))&&s.match(Mx)&&(e.lineHeight=s),(s=vx(t,n,a,"fontSize",o))&&(s.match(Mx)||s.match(Cx))&&(e.fontSize=s),(s=vx(t,n,a,"fontStyle",o))&&(e.fontStyle=Gn[s.toUpperCase()]),i?(r=i.attributes.imageType||i.attributes.imagetype,s=i.attributes.encoding,i=Wt(i).trim(),"PNG"==r&&"Base64"==s&&i&&(e.backgroundImage="data:image/png;base64,"+i)):r&&(e.backgroundImage=r),(i=vx(t,n,a,"textOutline",o))&&((i=i.split(" "))[0].match(Mx)?e.textStrokeColor=e.color:(e.textStrokeColor=gx(i[0]),i.shift()),i[0]&&i[0].match(Mx)?e.textStrokeWidth=i[0]:e.textStrokeColor=""),(i=vx(t,n,a,"letterSpacing",o))&&i.match(Mx)&&(e.letterSpacing=i),(i=vx(t,n,a,"linePadding",o))&&i.match(Mx)&&(e.linePadding=i),(i=vx(t,n,a,"opacity",o))&&(e.opacity=parseFloat(i)),(i=yx(n,a,"textDecoration"))&&mx(e,i),(i=bx(t,a,"textDecoration"))&&mx(e,i),(i=vx(t,n,a,"textCombine",o))&&(e.textCombineUpright=i),vx(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 fx(e,t,n){var i=new At,r=e.attributes["xml:id"];if(!r)return null;i.id=r,r=null,n&&(r=Ix.exec(n)||Dx.exec(n)),n=r?Number(r[1]):null,r=r?Number(r[2]):null;var a,o=yx(e,t,"extent");if(o){var s=(a=Ix.exec(o))||Dx.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?kt:0,i.heightUnits=a||null!=r?kt:0)}return(e=yx(e,t,"origin"))&&null!=(s=(a=Ix.exec(e))||Dx.exec(e))&&(i.viewportAnchorX=Number(s[1]),i.viewportAnchorY=Number(s[2]),a?o||(i.width=100-i.viewportAnchorX,i.widthUnits=kt,i.height=100-i.viewportAnchorY,i.heightUnits=kt):(null!=r&&(i.viewportAnchorY=100*i.viewportAnchorY/r),null!=n&&(i.viewportAnchorX=100*i.viewportAnchorX/n)),i.viewportAnchorUnits=a||null!=n?kt:0),i}function gx(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 mx(e,t){for(var n=(t=l(t.split(" "))).next();!n.done;n=t.next())switch(n.value){case"underline":e.textDecoration.includes(zn)||e.textDecoration.push(zn);break;case"noUnderline":e.textDecoration.includes(zn)&&Ct(e.textDecoration,zn);break;case"lineThrough":e.textDecoration.includes("lineThrough")||e.textDecoration.push("lineThrough");break;case"noLineThrough":e.textDecoration.includes("lineThrough")&&Ct(e.textDecoration,"lineThrough");break;case"overline":e.textDecoration.includes("overline")||e.textDecoration.push("overline");break;case"noOverline":e.textDecoration.includes("overline")&&Ct(e.textDecoration,"overline")}}function vx(e,t,n,i,r){return r=void 0===r||r,(e=bx(e,n,i))?e:r?yx(t,n,i):null}function yx(e,t,n){return e?nn(e,Fx,n)||wx(e,t,n):null}function bx(e,t,n){return nn(e,Fx,n)||wx(e,t,n)}function wx(e,t,n){e=Tx(e,"style",t,"");for(var i=null,r=0;r<e.length;r++){var a=en(e[r],"urn:ebu:tt:style",n);a||(a=nn(e[r],Fx,n)),a||(a=bx(e[r],t,n)),a&&(i=a)}return i}function Tx(e,t,n,i,r){var a=[];if(!e||1>n.length)return a;var o=e;for(e=null;!e&&!(e=r?en(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 xx(e,t,n,i){return e=Sx(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 Sx(e,t){var n=Ax(e.attributes.begin,t),i=Ax(e.attributes.end,t);return e=Ax(e.attributes.dur,t),null==i&&null!=e&&(i=n+e),{start:n,end:i}}function Ax(e,t){var n=null;if(Px.test(e)){e=Px.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(Rx.test(e))n=kx(Rx,e);else if(Lx.test(e))n=kx(Lx,e);else if(Nx.test(e))e=Nx.exec(e),n=Number(e[1])/t.frameRate;else if(Ox.test(e))e=Ox.exec(e),n=Number(e[1])/t.g;else if(jx.test(e))n=kx(jx,e);else if(e)throw new Ne(2,2,2001,"Could not parse cue time range in TTML");return n}function kx(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 Ex(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 lx})),hx.prototype.parseInit=function(){},hx.prototype.setSequenceMode=function(){},hx.prototype.setManifestType=function(){},hx.prototype.parseMedia=function(e,t,n,i){var r=Ue(e);if(e=[],""==r)return e;var a=Kt(r,"tt",!0);if(!a)throw new Ne(2,2,2005,"Failed to parse TTML.");if(!(r=Jt(a,"body")[0]))return[];var o=nn(a,Bx,"frameRate"),s=nn(a,Bx,"subFrameRate"),u=nn(a,Bx,"frameRateMultiplier"),c=nn(a,Bx,"tickRate"),d=nn(a,Bx,"cellResolution"),h=a.attributes["xml:space"]||"default",p=nn(a,Fx,"extent");if("default"!=h&&"preserve"!=h)throw new Ne(2,2,2005,"Invalid xml:space value: "+h);h="default"==h,o=new Ex(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=Jt(a,"metadata")[0])?s.children:[]).filter((function(e){return"\n"!=e})),u=Jt(a,"style"),c=[];for(var f=l(a=Jt(a,"region")),g=f.next();!g.done;g=f.next())(g=fx(g.value,u,p))&&c.push(g);if(Xt(r,"p").length)throw new Ne(2,2,2001,"<p> can only be inside <div> in TTML");for(f=(p=l(Xt(r,"div"))).next();!f.done;f=p.next())if(Xt(f.value,"span").length)throw new Ne(2,2,2001,"<span> can only be inside <p> in TTML");return(t=px(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",hx),hx.prototype.parseMedia=hx.prototype.parseMedia,hx.prototype.setManifestType=hx.prototype.setManifestType,hx.prototype.setSequenceMode=hx.prototype.setSequenceMode,hx.prototype.parseInit=hx.prototype.parseInit;var Ix=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,Cx=/^(\d{1,4}(?:\.\d+)?|100)%$/,Mx=/^(\d+px|\d+em|\d*\.?\d+c)$/,Dx=/^(\d+)px (\d+)px$/,Px=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Rx=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,Lx=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,Nx=/^(\d*(?:\.\d*)?)f$/,Ox=/^(\d*(?:\.\d*)?)t$/,jx=RegExp("^(?:(\\d*(?:\\.\\d*)?)h)?(?:(\\d*(?:\\.\\d*)?)m)?(?:(\\d*(?:\\.\\d*)?)s)?(?:(\\d*(?:\\.\\d*)?)ms)?$"),Ux=(new Map).set("left",jn).set("center","center").set("right","end").set("start",jn).set("end","end"),_x=(new Map).set("left","line-left").set("center","center").set("right","line-right"),Bx=["http://www.w3.org/ns/ttml#parameter","http://www.w3.org/2006/10/ttaf1#parameter"],Fx=["http://www.w3.org/ns/ttml#styling","http://www.w3.org/2006/10/ttaf1#styling"],Vx=["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt","http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];function Hx(){this.g=new hx}function Kx(){this.g="UNKNOWN"}function Gx(e,t,n){var i;(i=/^align:(start|middle|center|end|left|right)$/.exec(t))?(t=i[1],e.textAlign="middle"==t?Mn:Dn[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":Cn)):(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=Un[n[2].toUpperCase()])):(n=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(t))&&(e.lineInterpretation=On,e.line=Number(n[1]),n[2]&&(e.lineAlign=Un[n[2].toUpperCase()]))}function zx(){this.g=null}function qx(e,t,n){var i,r,a;return(new ta).box("payl",oa((function(e){i=Ue(e)}))).box("iden",oa((function(e){r=Ue(e)}))).box("sttg",oa((function(e){a=Ue(e)}))).parse(e),i?function(e,t,n,i,r){if(An(e=new Tn(i,r,e)),t&&(e.id=t),n)for(n=Nt(t=new Pt(n));n;)Gx(e,n,[]),Rt(t),n=Nt(t);return e}(i,r,a,t,n):null}function Xx(){}function Wx(){this.g=new Kx}function Yx(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 Jx(){}function $x(e,t){var n=t.Fontname;if(n&&(e.fontFamily=n),(n=t.Fontsize)&&(e.fontSize=n+"px"),(n=t.PrimaryColour)&&(n=Qx(n))&&(e.color=n),(n=t.BackColour)&&(n=Qx(n))&&(e.backgroundColor=n),t.Bold&&(e.fontWeight=Vn),t.Italic&&(e.fontStyle=Kn),t.Underline&&e.textDecoration.push(zn),(n=t.Spacing)&&(e.letterSpacing=n+"px"),n=t.Alignment)switch(parseInt(n,10)){case 1:e.displayAlign=Pn,e.textAlign="start";break;case 2:e.displayAlign=Pn,e.textAlign=Mn;break;case 3:e.displayAlign=Pn,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 Qx(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 Zx(e){return 3600*((e=iS.exec(e))[1]?parseInt(e[1].replace(":",""),10):0)+60*parseInt(e[2],10)+parseFloat(e[3])}fi("application/ttml+xml",(function(){return new hx})),Hx.prototype.parseInit=function(e){var t=!1;if((new ta).box("moov",na).box("trak",na).box("mdia",na).box("minf",na).box("stbl",na).R("stsd",ia).box("stpp",(function(e){t=!0,e.parser.stop()})).parse(e),!t)throw new Ne(2,2,2007)},Hx.prototype.setSequenceMode=function(){},Hx.prototype.setManifestType=function(){},Hx.prototype.parseMedia=function(e,t,n){var i=[],r=null,a=[],o=new Map,s=[];if((new ta).box("moof",na).box("traf",na).R("tfhd",(function(e){r=eo(e.reader,e.flags).Nd})).R("trun",(function(e){for(var t=(e=l((e=io(e.reader,e.version,e.flags)).gh)).next();!t.done;t=e.next())s.push(t.value.sampleSize||r||0)})).R("subs",(function(e){for(var t=e.reader,n=t.T(),i=-1,r=0;r<n;r++){var a=t.T();i+=a,a=t.Ba();for(var s=[],u=0;u<a;u++)1==e.version?s.push(t.T()):s.push(t.Ba()),t.X(),t.X(),t.T();o.set(i,s)}})).box("mdat",oa((function(e){a.push(e)}))).parse(e,!1),0==a.length)throw new Ne(2,2,2007);for(var u=$e.apply(ze,c(a)),d=0,h=0;h<s.length;h++){var p=De(u,d,s[h]);d+=s[h];var f=o.get(h);if(f&&f.length){p=De(p,0,f[0]);for(var g=[],m=f[0],v=1;v<f.length;v++){var y=De(e,m,f[v]);y=qe(y),g.push("data:image/png;base64,"+y),m+=f[v]}i=i.concat(this.g.parseMedia(p,t,n,g))}else i=i.concat(this.g.parseMedia(p,t,n,[]))}return i},F("shaka.text.Mp4TtmlParser",Hx),Hx.prototype.parseMedia=Hx.prototype.parseMedia,Hx.prototype.setManifestType=Hx.prototype.setManifestType,Hx.prototype.setSequenceMode=Hx.prototype.setSequenceMode,Hx.prototype.parseInit=Hx.prototype.parseInit,fi('application/mp4; codecs="stpp"',(function(){return new Hx})),fi('application/mp4; codecs="stpp.ttml"',(function(){return new Hx})),fi('application/mp4; codecs="stpp.ttml.im1i"',(function(){return new Hx})),fi('application/mp4; codecs="stpp.ttml.im1t"',(function(){return new Hx})),fi('application/mp4; codecs="stpp.ttml.im2i"',(function(){return new Hx})),fi('application/mp4; codecs="stpp.ttml.im2t"',(function(){return new Hx})),fi('application/mp4; codecs="stpp.ttml.etd1"',(function(){return new Hx})),fi('application/mp4; codecs="stpp.ttml.etd1|im1t"',(function(){return new Hx})),fi('application/mp4; codecs="stpp.ttml.im1t|etd1"',(function(){return new Hx})),fi('application/mp4; codecs="stpp.TTML.im1t"',(function(){return new Hx})),Kx.prototype.parseInit=function(){},Kx.prototype.setSequenceMode=function(){},Kx.prototype.setManifestType=function(e){this.g=e},Kx.prototype.parseMedia=function(e,t){var n=(e=(e=Ue(e)).replace(/\r\n|\r(?=[^\n]|$)/gm,"\n")).split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(n[0]))throw new Ne(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 Ne(2,2,2e3);if(null==(e=jt(e[1])))throw new Ne(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 Pt(r);var a=new At;Nt(r),Rt(r);for(var o=Nt(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"),Rt(r),o=Nt(r)}t.push(a)}for(kn(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 Tn(0,0,""));for(var d=!1,h=0;h<u.length;h++){var p=/^\s*([^:]+):\s*(.*)/.exec(u[h]);if(p){var f=p[2].trim().replace(";","");switch(p[1].trim()){case"background-color":case"background":d=!0,c.backgroundColor=f;break;case"color":d=!0,c.color=f;break;case"font-family":d=!0,c.fontFamily=f;break;case"font-size":d=!0,c.fontSize=f;break;case"font-weight":(700<=parseInt(f,10)||"bold"==f)&&(d=!0,c.fontWeight=Vn);break;case"font-style":switch(f){case"normal":d=!0,c.fontStyle=Hn;break;case"italic":d=!0,c.fontStyle=Kn;break;case"oblique":d=!0,c.fontStyle="oblique"}break;case"opacity":d=!0,c.opacity=parseFloat(f);break;case"text-combine-upright":d=!0,c.textCombineUpright=f;break;case"text-shadow":d=!0,c.textShadow=f;break;case"white-space":d=!0,c.wrapLine="noWrap"!=f}}}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=Ot(s=new Pt(c[0])),h=Lt(s,/[ \t]+--\x3e[ \t]+/g),u=Ot(s),null==o||null==h||null==u)q("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 Tn(o,u,d),Rt(s),o=Nt(s);o;)Gx(c,o,t),Rt(s),o=Nt(s);An(c,i),null!=a&&(c.id=a),a=c}a&&r.push(a)}return r},F("shaka.text.VttTextParser",Kx),Kx.prototype.parseMedia=Kx.prototype.parseMedia,Kx.prototype.setManifestType=Kx.prototype.setManifestType,Kx.prototype.setSequenceMode=Kx.prototype.setSequenceMode,Kx.prototype.parseInit=Kx.prototype.parseInit,fi("text/vtt",(function(){return new Kx})),fi('text/vtt; codecs="vtt"',(function(){return new Kx})),fi('text/vtt; codecs="wvtt"',(function(){return new Kx})),zx.prototype.parseInit=function(e){var t=this,n=!1;if((new ta).box("moov",na).box("trak",na).box("mdia",na).R("mdhd",(function(e){e=no(e.reader,e.version),t.g=e.timescale})).box("minf",na).box("stbl",na).R("stsd",ia).box("wvtt",(function(){n=!0})).parse(e),!this.g)throw new Ne(2,2,2008);if(!n)throw new Ne(2,2,2008)},zx.prototype.setSequenceMode=function(){},zx.prototype.setManifestType=function(){},zx.prototype.parseMedia=function(e,t){if(!e.length)return[];if(!this.g)throw new Ne(2,2,2008);var n,i=0,r=[],a=[],o=!1,s=!1,u=!1,c=null;if((new ta).box("moof",na).box("traf",na).R("tfdt",(function(e){o=!0,i=to(e.reader,e.version).baseMediaDecodeTime})).R("tfhd",(function(e){c=eo(e.reader,e.flags).Md})).R("trun",(function(e){s=!0,r=io(e.reader,e.version,e.flags).gh})).box("mdat",oa((function(e){u=!0,n=e}))).parse(e,!1),!u&&!o&&!s)throw new Ne(2,2,2008);e=i;for(var d=new Qr(n,0),h=l(r),p=h.next();!p.done;p=h.next()){var f=(p=p.value).hh||c,g=p.Bf?i+p.Bf:e;e=g+(f||0);var m=0;do{var v=d.T();m+=v;var y=null;"vttc"==ua(d.T())?8<v&&(y=d.Ub(v-8)):d.skip(v-8),f&&y&&(v=qx(y,t.periodStart+g/this.g,t.periodStart+e/this.g),a.push(v))}while(p.sampleSize&&m<p.sampleSize)}return a.filter(Ai)},F("shaka.text.Mp4VttParser",zx),zx.prototype.parseMedia=zx.prototype.parseMedia,zx.prototype.setManifestType=zx.prototype.setManifestType,zx.prototype.setSequenceMode=zx.prototype.setSequenceMode,zx.prototype.parseInit=zx.prototype.parseInit,fi('application/mp4; codecs="wvtt"',(function(){return new zx})),Xx.prototype.parseInit=function(){},Xx.prototype.setSequenceMode=function(){},Xx.prototype.setManifestType=function(){},Xx.prototype.parseMedia=function(e){var t=Ue(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 Pt((n=n.value.split("\n"))[0]),r=Ot(i),a=Lt(i,/,/g);if(i=Ot(i),null==r||null==a||null==i)throw new Ne(2,2,2001,"Could not parse cue time range in SubViewer");e.push(new Tn(r,i,n.slice(1).join("\n").trim()))}return e},F("shaka.text.SbvTextParser",Xx),Xx.prototype.parseMedia=Xx.prototype.parseMedia,Xx.prototype.setManifestType=Xx.prototype.setManifestType,Xx.prototype.setSequenceMode=Xx.prototype.setSequenceMode,Xx.prototype.parseInit=Xx.prototype.parseInit,fi("text/x-subviewer",(function(){return new Xx})),Wx.prototype.parseInit=function(){},Wx.prototype.setSequenceMode=function(){},Wx.prototype.setManifestType=function(){},Wx.prototype.parseMedia=function(e,t,n){return e=De(Fe(e=Yx(e=Ue(e)))),this.g.parseMedia(e,t,n,[])},F("shaka.text.SrtTextParser",Wx),Wx.srt2webvtt=Yx,Wx.prototype.parseMedia=Wx.prototype.parseMedia,Wx.prototype.setManifestType=Wx.prototype.setManifestType,Wx.prototype.setSequenceMode=Wx.prototype.setSequenceMode,Wx.prototype.parseInit=Wx.prototype.parseInit,fi("text/srt",(function(){return new Wx})),Jx.prototype.parseInit=function(){},Jx.prototype.setSequenceMode=function(){},Jx.prototype.setManifestType=function(){},Jx.prototype.parseMedia=function(e){var t="",n="",i=null,r=null;for(r=(e=l(r=Ue(e).split(/\r?\n\s*\r?\n/))).next();!r.done;r=e.next()){var a=r.value;r=a,(a=eS.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=tS.exec(e)))if(e=a[1].trim(),a=a[2].trim(),"Format"==e)r=a.split(nS);else if("Style"==e){e=a.split(nS),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={Qi:void 0},a=n.next())if(a=a.value,!/^\s*;/.test(a)&&(o=tS.exec(a)))if(a=o[1].trim(),o=o[2].trim(),"Format"==a)t=o.split(nS);else if("Dialogue"==a){o=o.split(nS),a={};for(var s=0;s<t.length&&s<o.length;s++)a[t[s]]=o[s];o=new Tn(s=Zx(a.Start),Zx(a.End),o.slice(t.length-1).join(",").replace(/\\N/g,"\n").replace(/\{[^}]+\}/g,"")),e.Qi=a.Style,(e=i.find(function(e){return function(t){return t.Name==e.Qi}}(e)))&&$x(o,e),r.push(o)}return r},F("shaka.text.SsaTextParser",Jx),Jx.prototype.parseMedia=Jx.prototype.parseMedia,Jx.prototype.setManifestType=Jx.prototype.setManifestType,Jx.prototype.setSequenceMode=Jx.prototype.setSequenceMode,Jx.prototype.parseInit=Jx.prototype.parseInit;var eS=/^\s*\[([^\]]+)\]\r?\n([\s\S]*)/,tS=/^\s*([^:]+):\s*(.*)/,nS=/\s*,\s*/,iS=/^(\d+:)?(\d{1,2}):(\d{1,2}(?:[.]\d{1,3})?)?$/;function rS(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)?{Ud:n,qa:e}:null}function aS(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 oS(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 sS(e){this.j=e,this.h=0,this.g=new Map,this.i=null}function uS(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,Ea:e,qa:r}}function lS(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 cS(e){this.j=e,this.h=0,this.g=new Map,this.i=null}function dS(e,t){if(t+8>e.length||2935!=(e[t]<<8|e[t+1]))return null;var n=new ds(e.subarray(t+2));ps(n,2),ps(n,3);var i=fs(n,11)+1<<1,r=fs(n,2);if(3==r){r=[24e3,22060,16e3][r=fs(n,2)];var a=3}else r=[48e3,44100,32e3][r],a=fs(n,2);var o=fs(n,3),s=fs(n,1);return n=fs(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,Ea:e,qa:i})}function hS(e){this.j=e,this.h=0,this.g=new Map,this.i=null}fi("text/x-ssa",(function(){return new Jx})),(i=sS.prototype).destroy=function(){this.g.clear()},i.isSupported=function(e){return"audio/aac"==e.toLowerCase().split(";")[0]&&ht(this.convertCodecs("audio",e))},i.convertCodecs=function(e,t){return"audio/aac"==t.toLowerCase().split(";")[0]?'audio/mp4; codecs="'+(li(t)||"mp4a.40.2")+'"':t},i.getOriginalMimeType=function(){return this.j},i.transmux=function(e,t,n,i){for(var r=De(e),a=ls(r),o=a.length;o<r.length&&!oS(r,o);o++);if(e=1e3*n.endTime,(a=us(a)).length&&n&&(a=a.find((function(e){return"com.apple.streaming.transportStreamTimestamp"===e.description})))&&(e=a.data),!(a=aS(r,o)))return Promise.reject(new Ne(2,3,3018,n?n.O()[0]:null));t.audioSamplingRate=a.sampleRate,t.channelsCount=a.channelCount;for(var s=[];o<r.length;){var u=rS(r,o);if(!u)return Promise.reject(new Ne(2,3,3018,n?n.O()[0]:null));var l=u.Ud+u.qa;o+l<=r.length&&s.push({data:r.subarray(o+u.Ud,o+l),size:u.qa,duration:1024,rb:0,flags:{wb:0,kb:0,jb:0,hb:0,ib:2,xb:0}}),o+=l}return r=a.sampleRate,e=Math.floor(e*r/1e3),i=new uo([i={id:t.id,type:"audio",codecs:a.codec,encrypted:t.encrypted&&0<t.drmInfos.length,timescale:r,duration:i,Ab:[],Ea:new Uint8Array([]),Na:new Uint8Array([]),Wa:0,Xa:0,data:{Vb:this.h,baseMediaDecodeTime:e,yb:s},stream:t}]),n=t.id+"_"+n.i,this.g.has(n)?t=this.g.get(n):(t=lo(i),this.g.set(n,t)),n=this.i!==t,i=go(i),this.i=t,this.h++,n?(t=$e(t,i),Promise.resolve(t)):Promise.resolve(i)},F("shaka.transmuxer.AacTransmuxer",sS),sS.prototype.transmux=sS.prototype.transmux,sS.prototype.getOriginalMimeType=sS.prototype.getOriginalMimeType,sS.prototype.convertCodecs=sS.prototype.convertCodecs,sS.prototype.isSupported=sS.prototype.isSupported,sS.prototype.destroy=sS.prototype.destroy,Wn("audio/aac",(function(){return new sS("audio/aac")}),$n),(i=cS.prototype).destroy=function(){this.g.clear()},i.isSupported=function(e){return"audio/ac3"==e.toLowerCase().split(";")[0]&&ht(this.convertCodecs("audio",e))},i.convertCodecs=function(e,t){return"audio/ac3"==t.toLowerCase().split(";")[0]?te().ee()?'audio/mp4; codecs="ec-3"':'audio/mp4; codecs="ac-3"':t},i.getOriginalMimeType=function(){return this.j},i.transmux=function(e,t,n,i){for(var r=ls(e=De(e)),a=r.length;a<e.length&&!lS(e,a);a++);var o=1e3*n.endTime;(r=us(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=uS(e,a);if(!l)return Promise.reject(new Ne(2,3,3018,n?n.O()[0]:null));t.audioSamplingRate=l.sampleRate,t.channelsCount=l.channelCount,r=l.sampleRate,s=l.Ea,u.push({data:e.subarray(a,a+l.qa),size:l.qa,duration:1536,rb:0,flags:{wb:0,kb:0,jb:0,hb:0,ib:2,xb:0}}),a+=l.qa}return e=Math.floor(o*r/1e3),i=new uo([i={id:t.id,type:"audio",codecs:"ac-3",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:r,duration:i,Ab:[],Ea:s,Na:new Uint8Array([]),Wa:0,Xa:0,data:{Vb:this.h,baseMediaDecodeTime:e,yb:u},stream:t}]),n=t.id+"_"+n.i,this.g.has(n)?t=this.g.get(n):(t=lo(i),this.g.set(n,t)),n=this.i!==t,i=go(i),this.i=t,this.h++,n?(t=$e(t,i),Promise.resolve(t)):Promise.resolve(i)},F("shaka.transmuxer.Ac3Transmuxer",cS),cS.prototype.transmux=cS.prototype.transmux,cS.prototype.getOriginalMimeType=cS.prototype.getOriginalMimeType,cS.prototype.convertCodecs=cS.prototype.convertCodecs,cS.prototype.isSupported=cS.prototype.isSupported,cS.prototype.destroy=cS.prototype.destroy,Wn("audio/ac3",(function(){return new cS("audio/ac3")}),$n),(i=hS.prototype).destroy=function(){this.g.clear()},i.isSupported=function(e){return"audio/ec3"==e.toLowerCase().split(";")[0]&&ht(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.j},i.transmux=function(e,t,n,i){for(var r=ls(e=De(e)),a=r.length;a<e.length&&2935!=(e[a]<<8|e[a+1]);a++);var o=1e3*n.endTime;(r=us(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=dS(e,a);if(!l)return Promise.reject(new Ne(2,3,3018,n?n.O()[0]:null));t.audioSamplingRate=l.sampleRate,t.channelsCount=l.channelCount,r=l.sampleRate,s=l.Ea,u.push({data:e.subarray(a,a+l.qa),size:l.qa,duration:1536,rb:0,flags:{wb:0,kb:0,jb:0,hb:0,ib:2,xb:0}}),a+=l.qa}return e=Math.floor(o*r/1e3),i=new uo([i={id:t.id,type:"audio",codecs:"ec-3",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:r,duration:i,Ab:[],Ea:s,Na:new Uint8Array([]),Wa:0,Xa:0,data:{Vb:this.h,baseMediaDecodeTime:e,yb:u},stream:t}]),n=t.id+"_"+n.i,this.g.has(n)?t=this.g.get(n):(t=lo(i),this.g.set(n,t)),n=this.i!==t,i=go(i),this.i=t,this.h++,n?(t=$e(t,i),Promise.resolve(t)):Promise.resolve(i)},F("shaka.transmuxer.Ec3Transmuxer",hS),hS.prototype.transmux=hS.prototype.transmux,hS.prototype.getOriginalMimeType=hS.prototype.getOriginalMimeType,hS.prototype.convertCodecs=hS.prototype.convertCodecs,hS.prototype.isSupported=hS.prototype.isSupported,hS.prototype.destroy=hS.prototype.destroy,Wn("audio/ec3",(function(){return new hS("audio/ec3")}),$n);var pS=[100,110,122,244,44,83,86,118,128,138,139,134];function fS(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*vS[14*(3===n?3-i:3===i?3:4)+r-1],a=yS[3*(3===n?0:2===n?1:2)+a],n=bS[n][i];var s=wS[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,qa:u,Kk:8*n*s}}return null}function gS(e,t){return!(255!==e[t]||224&~e[t+1]||!(6&e[t+1]))}function mS(e,t){if(t+1<e.length&&gS(e,t)){var n=fS(e,t),i=4;return n&&n.qa&&(i=n.qa),(t+=i)===e.length||t+1<e.length&&gS(e,t)}return!1}var vS=[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],yS=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],bS=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],wS=[0,1,1,4];function TS(e){this.j=e,this.h=0,this.g=new Map,this.i=null}function xS(e){this.h=e,this.g=null}function SS(e){this.h=e,(this.g=Qm.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]!==kS[n]&&(e=!1);e&&(this._parsing&&(this.type="sepiff"),t.call(this))}))}(this)}function AS(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=TS.prototype).destroy=function(){this.g.clear()},i.isSupported=function(e){return"audio/mpeg"==e.toLowerCase().split(";")[0]&&ht(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.j},i.transmux=function(e,t,n,i){for(var r=De(e),a=ls(r).length;a<r.length&&!mS(r,a);a++);var o;for(e=[];a<r.length;){var s=fS(r,a);if(!s)return Promise.reject(new Ne(2,3,3018,n?n.O()[0]:null));o||(o=s),a+s.qa<=r.length&&e.push({data:r.subarray(a,a+s.qa),size:s.qa,duration:1152,rb:0,flags:{wb:0,kb:0,jb:0,hb:0,ib:2,xb:0}}),a+=s.qa}return o?(r=9e4*o.Kk/o.sampleRate*this.h,i=new uo([i={id:t.id,type:"audio",codecs:"mp3",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:o.sampleRate,duration:i,Ab:[],Ea:new Uint8Array([]),Na:new Uint8Array([]),Wa:0,Xa:0,data:{Vb:this.h,baseMediaDecodeTime:r,yb:e},stream:t}]),n=t.id+"_"+n.i,this.g.has(n)?t=this.g.get(n):(t=lo(i),this.g.set(n,t)),n=this.i!==t,i=go(i),this.i=t,this.h++,n?(t=$e(t,i),Promise.resolve(t)):Promise.resolve(i)):Promise.reject(new Ne(2,3,3018,n?n.O()[0]:null))},F("shaka.transmuxer.Mp3Transmuxer",TS),TS.prototype.transmux=TS.prototype.transmux,TS.prototype.getOriginalMimeType=TS.prototype.getOriginalMimeType,TS.prototype.convertCodecs=TS.prototype.convertCodecs,TS.prototype.isSupported=TS.prototype.isSupported,TS.prototype.destroy=TS.prototype.destroy,Wn("audio/mpeg",(function(){return new TS("audio/mpeg")}),$n),(i=xS.prototype).destroy=function(){},i.isSupported=function(e){if("video/mp2t"!=e.toLowerCase().split(";")[0])return!1;var t=li(e).split(","),n=nt("audio",t);return t=nt("video",t),!(!n||t||"mp3"!=oi(n))&&ht(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 Ss,this.g.Ff(n.i),e=De(e),"mp3"!=(e=this.g.parse(e)).Od().audio||"audio"!=r)return Promise.reject(new Ne(2,3,3018,n?n.O()[0]:null));for(n=new Uint8Array([]),r=l(e.sb()),e=r.next();!e.done;e=r.next())if(e=e.value.data)for(t=0;t<e.length;)(i=fS(e,t))?(t+i.qa<=e.length&&(n=$e(n,e.subarray(t,t+i.qa))),t+=i.qa):t++;return Promise.resolve(n)},F("shaka.transmuxer.MpegTsTransmuxer",xS),xS.prototype.transmux=xS.prototype.transmux,xS.prototype.getOriginalMimeType=xS.prototype.getOriginalMimeType,xS.prototype.convertCodecs=xS.prototype.convertCodecs,xS.prototype.isSupported=xS.prototype.isSupported,xS.prototype.destroy=xS.prototype.destroy,Wn("video/mp2t",(function(){return new xS("video/mp2t")}),Qn),(i=SS.prototype).destroy=function(){},i.isSupported=function(e,t){var n=e.startsWith("mss/");return!(!this.g||!n)&&(t?ht(this.convertCodecs(t,e)):(t=this.convertCodecs("audio",e),e=this.convertCodecs("video",e),ht(t)||ht(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(De(e));if(!t.mssPrivateData)return Promise.reject(new Ne(2,3,3020,n?n.O()[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 p=this.g.createFullBox("saiz",s);if(p.version=0,p.flags=0,p.sample_count=d.sample_count,p.default_sample_info_size=0,p.sample_info_size=[],2&d.flags)for(i=0;i<d.sample_count;i+=1)p.sample_info_size[i]=10+6*d.entry[i].NumberOfEntries;else p.default_sample_info_size=8}}a.flags&=16777214,a.flags|=131072,u.flags|=1;var f=r.fetch("moof");u.data_offset=f.getLength()+8;var g=r.fetch("saio");null!==g&&(g.offset[0]=AS(f,"traf")+AS(s,"senc")+16);var m=De(r.write());return Promise.resolve(m)}catch(e){return e instanceof Ne?Promise.reject(e):Promise.reject(new Ne(2,3,3022,n?n.O()[0]:null))}},F("shaka.transmuxer.MssTransmuxer",SS),SS.prototype.transmux=SS.prototype.transmux,SS.prototype.getOriginalMimeType=SS.prototype.getOriginalMimeType,SS.prototype.convertCodecs=SS.prototype.convertCodecs,SS.prototype.isSupported=SS.prototype.isSupported,SS.prototype.destroy=SS.prototype.destroy;var kS=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);function ES(e){this.m=e,this.g=0,this.j=new Map,this.l=this.i=this.h=null}Wn("mss/audio/mp4",(function(){return new SS("mss/audio/mp4")}),$n),Wn("mss/video/mp4",(function(){return new SS("mss/video/mp4")}),$n),(i=ES.prototype).destroy=function(){this.j.clear(),this.i&&this.i.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=li(n).split(",");return n=nt("audio",i),i=nt("video",i),!(n&&(n=oi(n),!IS.includes(n))||i&&(n=oi(i),!CS.includes(n)))&&(t?ht(this.convertCodecs(t,e)):(t=this.convertCodecs("audio",e),e=this.convertCodecs("video",e),ht(t)||ht(e)))},i.convertCodecs=function(e,t){return"video/mp2t"==t.toLowerCase().split(";")[0]?(t=li(t).replace("mp4a.40.34","mp3").split(",").map((function(e){return Gi(e,"audio/mp4")})).map(zi).join(","),"audio"==e?'audio/mp4; codecs="'+t+'"':'video/mp4; codecs="'+t+'"'):t},i.getOriginalMimeType=function(){return this.m},i.transmux=function(e,t,n,i,r){var a=De(e);if("audio"==r&&!Is(a)){for(var o=ls(a),s=o.length;s<a.length;s++)if(mS(a,s))return Promise.reject(new Ne(2,3,3018,n?n.O()[0]:null));for(s=o.length;s<a.length;s++)if(oS(a,s))return this.i||(this.i=new sS("audio/aac")),this.i.transmux(e,t,n,i,r);return Promise.reject(new Ne(2,3,3018,n?n.O()[0]:null))}this.h?this.h.clearData():this.h=new Ss,this.h.Ff(n.i);var u=this.h.parse(a),d=[],h=u.Od();try{var p=null;if("video"==r){switch(h.video){case"avc":var f=[],g=null,m=u.Rc(),v=function(e){function t(e){r={data:new Uint8Array([]),frame:!1,isKeyframe:!1,pts:e.pts,dts:e.dts,nalus:[]}}function n(){if(r&&r.nalus.length&&r.frame){for(var e=[],t=l(r.nalus),n=t.next();!n.done;n=t.next()){var a=(n=n.value).fullData.byteLength,o=new Uint8Array(4);o[0]=a>>24&255,o[1]=a>>16&255,o[2]=a>>8&255,o[3]=255&a,e.push(o),e.push(n.fullData)}r.data=$e.apply(ze,c(e)),i.push(r)}}for(var i=[],r=null,a=!1,o=0;o<e.length;o++){var s=e[o],u=s.nalus,d=!1;r&&u.length&&!a&&(n(),t(s));for(var h=(u=l(s.nalus)).next();!h.done;h=u.next()){var p=!1;switch((h=h.value).type){case 1:var f=!1;p=!0;var g=h.data;d&&4<g.length&&(2===(g=xs(new ds(g)))||4===g||7===g||9===g)&&(f=!0),f&&r&&r.frame&&!r.isKeyframe&&(n(),r=null),r||t(s),r.frame=!0,r.isKeyframe=f;break;case 5:p=!0,r&&r.frame&&!r.isKeyframe&&(n(),r=null),r||t(s),r.frame=!0,r.isKeyframe=!0;break;case 6:case 8:case 12:p=!0;break;case 7:d=p=!0;break;case 9:a=p=!0,r&&r.frame&&(n(),r=null),r||t(s);break;default:p=!1}r&&p&&r.nalus.push(h)}}return n(),i}(m);if(!v.length)throw new Ne(2,3,3023,n?n.O()[0]:null);for(var y=0;y<v.length;y++){var b,w=v[y];null==g&&(g=w.dts),b=y+1<v.length?(v[y+1].dts||0)-(w.dts||0):1<v.length?(w.dts||0)-(v[y-1].dts||0):9e4*(n.endTime-n.startTime),f.push({data:w.data,size:w.data.byteLength,duration:b,rb:Math.round((w.pts||0)-(w.dts||0)),flags:{wb:0,kb:0,jb:0,hb:0,ib:w.isKeyframe?2:1,xb:w.isKeyframe?0:1}})}for(var T=[],x=l(m),S=x.next();!S.done;S=x.next())T.push.apply(T,c(S.value.nalus));var A=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 ds(t.data),i=ws(n);if(ws(n),ws(n),ms(n),pS.includes(i)&&(3===(i=vs(n))&&ps(n,1),ms(n),ms(n),ps(n,1),bs(n))){i=3!==i?8:12;for(var r=0;r<i;r++)bs(n)&&Ts(n,6>r?16:64)}if(ms(n),0===(i=vs(n)))vs(n);else if(1===i)for(ps(n,1),ms(n),ms(n),i=vs(n),r=0;r<i;r++)ms(n);ms(n),ps(n,1);var a=vs(n),o=vs(n),s=fs(n,1);0===s&&ps(n,1),ps(n,1);var u=0,l=0,d=0,h=0;if(bs(n)&&(u=vs(n),l=vs(n),d=vs(n),h=vs(n)),r=i=1,bs(n)&&bs(n)){var p=ws(n);0<p&&16>=p?(i=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][p-1],r=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][p-1]):255===p&&(i=fs(n,16),r=fs(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,Na:e=new Uint8Array([1,u[3],u[4],u[5],255,225].concat(u,[1],t)),Wa:i,Xa:r}}(T);if(!A||null==g)throw new Ne(2,3,3018,n?n.O()[0]:null);t.height=A.height,t.width=A.width,p={id:t.id,type:"video",codecs:"avc1",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:9e4,duration:i,Ab:[],Ea:new Uint8Array([]),Na:A.Na,Wa:A.Wa,Xa:A.Xa,data:{Vb:this.g,baseMediaDecodeTime:g,yb:f},stream:t};break;case"hvc":var k=[],E=null,I=[],C=u.Rc();if(!C.length)throw new Ne(2,3,3023,n?n.O()[0]:null);for(var M=0;M<C.length;M++){var D=C[M],P=D.nalus;I.push.apply(I,c(P));for(var R=!1,L=[],N=!1,O=l(P),j=O.next();!j.done;j=O.next()){var U=j.value;switch(U.type){case 1:case 0:var _=N=!0;break;case 19:case 20:case 21:R=_=N=!0;break;case 32:case 33:case 34:case 39:case 40:_=!0;break;case 35:N=_=!0;break;default:_=!1}if(N&&_){var B=U.fullData.byteLength,F=new Uint8Array(4);F[0]=B>>24&255,F[1]=B>>16&255,F[2]=B>>8&255,F[3]=255&B,L.push(F),L.push(U.fullData)}}var V,H=L.length?{data:$e.apply(ze,c(L)),isKeyframe:R}:null;if(H)null==E&&null!=D.dts&&(E=D.dts),V=M+1<C.length?(C[M+1].dts||0)-(D.dts||0):1<C.length?(D.dts||0)-(C[M-1].dts||0):9e4*(n.endTime-n.startTime),k.push({data:H.data,size:H.data.byteLength,duration:V,rb:Math.round((D.pts||0)-(D.dts||0)),flags:{wb:0,kb:0,jb:0,hb:0,ib:H.isKeyframe?2:1,xb:H.isKeyframe?0:1}})}var K=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 ds(e,!0);return ws(t),ws(t),fs(t,4),fs(t,2),fs(t,6),{Sg:(e=fs(t,3))+1,wh:t=bs(t)}}(t.fullData);e=function(e){ws(e=new ds(e,!0)),ws(e);var t=0,n=0,i=0,r=0;fs(e,4);var a=fs(e,3);bs(e);for(var o=fs(e,2),s=fs(e,1),u=fs(e,5),l=ws(e),c=ws(e),d=ws(e),h=ws(e),p=ws(e),f=ws(e),g=ws(e),m=ws(e),v=ws(e),y=ws(e),b=ws(e),w=[],T=[],x=0;x<a;x++)w.push(bs(e)),T.push(bs(e));if(0<a)for(x=a;8>x;x++)fs(e,2);for(x=0;x<a;x++)w[x]&&fs(e,88),T[x]&&ws(e);vs(e),3==(w=vs(e))&&fs(e,1),T=vs(e),x=vs(e),bs(e)&&(t+=vs(e),n+=vs(e),i+=vs(e),r+=vs(e));var S=vs(e),A=vs(e),k=vs(e);if(bs(e))for(var E=0;E<=a;E++)vs(e),vs(e),vs(e);else vs(e),vs(e),vs(e);if(vs(e),vs(e),vs(e),vs(e),vs(e),vs(e),bs(e)&&bs(e))for(E=0;4>E;E++)for(var I=0;I<(3===E?2:6);I++)if(bs(e)){var C=Math.min(64,1<<4+(E<<1));1<E&&ys(e);for(var M=0;M<C;M++)ys(e)}else vs(e);for(bs(e),bs(e),bs(e)&&(ws(e),vs(e),vs(e),bs(e)),E=vs(e),C=I=0;C<E;C++)if(M=!1,0!==C&&(M=bs(e)),M){C===E&&vs(e),bs(e),vs(e);for(var D=M=0;D<=I;D++){var P=bs(e),R=!1;P||(R=bs(e)),(P||R)&&M++}I=M}else{for(I=(D=vs(e))+(M=vs(e)),P=0;P<D;P++)vs(e),bs(e);for(D=0;D<M;D++)vs(e),bs(e)}if(bs(e))for(E=vs(e),I=0;I<E;I++){for(C=0;C<k+4;C++)fs(e,1);fs(e,1)}if(E=k=1,I=0,bs(e),bs(e),bs(e)){if(bs(e)&&(M=[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<(C=ws(e))&&16>=C?(k=M[C-1],E=D[C-1]):255===C&&(k=fs(e,16),E=fs(e,16))),bs(e)&&bs(e),bs(e)&&(fs(e,3),bs(e),bs(e)&&(ws(e),ws(e),ws(e))),bs(e)&&(vs(e),vs(e)),bs(e),bs(e),bs(e),(C=bs(e))&&(vs(e),vs(e),vs(e),vs(e)),bs(e)&&(fs(e,32),fs(e,32),bs(e)&&vs(e),bs(e)))for(D=!1,C=bs(e),M=bs(e),(C||M)&&((D=bs(e))&&(ws(e),fs(e,5),bs(e),fs(e,5)),fs(e,4),fs(e,4),D&&fs(e,4),fs(e,5),fs(e,5),fs(e,5)),P=0;P<=a;P++){var L=!0;R=1,bs(e)||(L=bs(e));var N=!1;if(L?vs(e):N=bs(e),N||(R=vs(e)+1),C){for(L=0;L<R;L++)vs(e),vs(e),D&&(vs(e),vs(e));bs(e)}if(M){for(L=0;L<R;L++)vs(e),vs(e),D&&(vs(e),vs(e));bs(e)}}bs(e)&&(bs(e),bs(e),bs(e),I=vs(e),vs(e),vs(e),vs(e),vs(e))}return{wg:b,Cg:o,Dg:s,Bg:u,xg:l,yg:c,zg:d,Ag:h,pg:p,qg:f,rg:g,sg:m,ug:v,vg:y,lf:I,hg:0,fg:w,eg:S,dg:A,width:T-(t+n)*(1===w||2===w?2:1),height:x-(i+r)*(1===w?2:1),Mk:k,Lk:E}}(n.fullData);var a=function(e){var t=new ds(e,!0);ws(t),ws(t),vs(t),vs(t),bs(t),bs(t),fs(t,3),bs(t),bs(t),vs(t),vs(t),ys(t),bs(t),bs(t),bs(t)&&vs(t),ys(t),ys(t),bs(t),bs(t),bs(t),bs(t),e=bs(t);var n=1;return(t=bs(t))&&e?n=0:t?n=3:e&&(n=2),{Ug: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.Cg)<<6|(i.Dg?1:0)<<5|31&i.Bg,r[2]=i.xg,r[3]=i.yg,r[4]=i.zg,r[5]=i.Ag,r[6]=i.pg,r[7]=i.qg,r[8]=i.rg,r[9]=i.sg,r[10]=i.ug,r[11]=i.vg,r[12]=i.wg,r[13]=240|(3840&i.lf)>>8,r[14]=255&i.lf,r[15]=252|3&i.Ug,r[16]=252|3&i.fg,r[17]=248|7&i.eg,r[18]=248|7&i.dg,r[19]=0,r[20]=0,r[21]=(3&i.hg)<<6|(7&i.Sg)<<3|(i.wh?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,{Sg:r.Sg,wh:r.wh,Cg:e.Cg,Dg:e.Dg,wg:e.wg,Bg:e.Bg,xg:e.xg,yg:e.yg,zg:e.zg,Ag:e.Ag,pg:e.pg,qg:e.qg,rg:e.rg,sg:e.sg,ug:e.ug,vg:e.vg,hg:e.hg,lf:e.lf,fg:e.fg,eg:e.eg,dg:e.dg,Ug:a.Ug}),{height:e.height,width:e.width,Na:t,Wa:e.Mk,Xa:e.Lk}}(I);if(!K||null==E)throw new Ne(2,3,3018,n?n.O()[0]:null);t.height=K.height,t.width=K.width,p={id:t.id,type:"video",codecs:"hvc1",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:9e4,duration:i,Ab:[],Ea:new Uint8Array([]),Na:K.Na,Wa:K.Wa,Xa:K.Xa,data:{Vb:this.g,baseMediaDecodeTime:E,yb:k},stream:t}}p&&(d.push(p),p=null)}if("audio"==r){switch(h.audio){case"aac":for(var G,z=[],q=null,X=null,W=null,Y=l(u.sb()),J=Y.next();!J.done;J=Y.next()){var $=J.value,Q=$.data;if(Q){var Z=0;if(-1==X&&W)Q=$e(W,$.data),X=null;else if(null!=X&&W){Z=Math.max(0,X);var ee=$e(W,Q.subarray(0,Z));z.push({data:ee,size:ee.byteLength,duration:1024,rb:0,flags:{wb:0,kb:0,jb:0,hb:0,ib:2,xb:0}}),X=W=null}if(!(G=aS(Q,Z)))throw new Ne(2,3,3018,n?n.O()[0]:null);for(t.audioSamplingRate=G.sampleRate,t.channelsCount=G.channelCount,null==q&&null!==$.pts&&(q=$.pts);Z<Q.length;){var te=rS(Q,Z);if(!te){W=Q.subarray(Z,Q.length),X=-1;break}var ne=te.Ud+te.qa;0!=(X=Math.max(0,Z+ne-Q.length))?W=Q.subarray(Z+te.Ud,Z+ne):Z+ne<=Q.length&&z.push({data:Q.subarray(Z+te.Ud,Z+ne),size:te.qa,duration:1024,rb:0,flags:{wb:0,kb:0,jb:0,hb:0,ib:2,xb:0}}),Z+=ne}}}if(!G||null==q){if(!u.Rc().length)throw new Ne(2,3,3018,n?n.O()[0]:null);q=9e4*n.startTime;var ie=nt("audio",t.codecs.split(","));if(!ie||!t.channelsCount||!t.audioSamplingRate)throw new Ne(2,3,3018,n?n.O()[0]:null);G={sampleRate:t.audioSamplingRate,channelCount:t.channelsCount,codec:ie};var re=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}(ie,t.channelsCount);if(!re)throw new Ne(2,3,3018,n?n.O()[0]:null);for(var ae=q+9e4*(n.endTime-n.startTime),oe=q;oe<ae;)z.push({data:re,size:re.byteLength,duration:1024,rb:0,flags:{wb:0,kb:0,jb:0,hb:0,ib:2,xb:0}}),oe+=1024/G.sampleRate*9e4}var se=G.sampleRate,ue=q/9e4*se;p={id:t.id,type:"audio",codecs:G.codec,encrypted:t.encrypted&&0<t.drmInfos.length,timescale:se,duration:i,Ab:[],Ea:new Uint8Array([]),Na:new Uint8Array([]),Wa:0,Xa:0,data:{Vb:this.g,baseMediaDecodeTime:ue,yb:z},stream:t};break;case"ac3":for(var le=[],ce=0,de=new Uint8Array([]),he=null,pe=l(u.sb()),fe=pe.next();!fe.done;fe=pe.next()){var ge=fe.value,me=ge.data;null==he&&null!==ge.pts&&(he=ge.pts);for(var ve=0;ve<me.length;){var ye=uS(me,ve);ye?(t.audioSamplingRate=ye.sampleRate,t.channelsCount=ye.channelCount,ce=ye.sampleRate,de=ye.Ea,le.push({data:me.subarray(ve,ve+ye.qa),size:ye.qa,duration:1536,rb:0,flags:{wb:0,kb:0,jb:0,hb:0,ib:2,xb:0}}),ve+=ye.qa):ve++}}if(0==ce||0==de.byteLength||null==he)throw new Ne(2,3,3018,n?n.O()[0]:null);var be=he/9e4*ce;p={id:t.id,type:"audio",codecs:"ac-3",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:ce,duration:i,Ab:[],Ea:de,Na:new Uint8Array([]),Wa:0,Xa:0,data:{Vb:this.g,baseMediaDecodeTime:be,yb:le},stream:t};break;case"ec3":for(var we=[],Te=0,xe=new Uint8Array([]),Se=null,Ae=l(u.sb()),ke=Ae.next();!ke.done;ke=Ae.next()){var Ee=ke.value,Ie=Ee.data;null==Se&&null!==Ee.pts&&(Se=Ee.pts);for(var Ce=0;Ce<Ie.length;){var Me=dS(Ie,Ce);Me?(t.audioSamplingRate=Me.sampleRate,t.channelsCount=Me.channelCount,Te=Me.sampleRate,xe=Me.Ea,we.push({data:Ie.subarray(Ce,Ce+Me.qa),size:Me.qa,duration:1536,rb:0,flags:{wb:0,kb:0,jb:0,hb:0,ib:2,xb:0}}),Ce+=Me.qa):Ce++}}if(0==Te||0==xe.byteLength||null==Se)throw new Ne(2,3,3018,n?n.O()[0]:null);var Pe=Se/9e4*Te;p={id:t.id,type:"audio",codecs:"ec-3",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:Te,duration:i,Ab:[],Ea:xe,Na:new Uint8Array([]),Wa:0,Xa:0,data:{Vb:this.g,baseMediaDecodeTime:Pe,yb:we},stream:t};break;case"mp3":for(var Re,Le=[],Oe=null,je=l(u.sb()),Ue=je.next();!Ue.done;Ue=je.next()){var _e=Ue.value,Be=_e.data;if(Be){null==Oe&&null!==_e.pts&&(Oe=_e.pts);for(var Fe=0;Fe<Be.length;){var Ve=fS(Be,Fe);Ve?(Re||(Re=Ve),Fe+Ve.qa<=Be.length&&Le.push({data:Be.subarray(Fe,Fe+Ve.qa),size:Ve.qa,duration:1152,rb:0,flags:{wb:0,kb:0,jb:0,hb:0,ib:2,xb:0}}),Fe+=Ve.qa):Fe++}}}if(!Re||null==Oe)throw new Ne(2,3,3018,n?n.O()[0]:null);var He=Re.sampleRate,Ke=Oe/9e4*He;p={id:t.id,type:"audio",codecs:"mp3",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:He,duration:i,Ab:[],Ea:new Uint8Array([]),Na:new Uint8Array([]),Wa:0,Xa:0,data:{Vb:this.g,baseMediaDecodeTime:Ke,yb:Le},stream:t};break;case"opus":var Ge=[],qe=null,Xe=u.G;if(!Xe)throw new Ne(2,3,3018,n?n.O()[0]:null);var We=[];switch(Xe.jj){case 1:case 2:We=[0];break;case 0:We=[255,1,1,0,1];break;case 128:We=[255,2,0,0,1];break;case 3:We=[1,2,1,0,2,1];break;case 4:We=[1,2,2,0,1,2,3];break;case 5:We=[1,3,2,0,4,1,2,3];break;case 6:We=[1,4,2,0,4,1,2,3,5];break;case 7:We=[1,4,2,0,4,1,2,3,5,6];break;case 8:We=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:We=[1,1,2,0,1];break;case 131:We=[1,1,3,0,1,2];break;case 132:We=[1,1,4,0,1,2,3];break;case 133:We=[1,1,5,0,1,2,3,4];break;case 134:We=[1,1,6,0,1,2,3,4,5];break;case 135:We=[1,1,7,0,1,2,3,4,5,6];break;case 136:We=[1,1,8,0,1,2,3,4,5,6,7]}for(var Ye=new Uint8Array([0,Xe.channelCount,0,0,Xe.sampleRate>>>24&255,Xe.sampleRate>>>17&255,Xe.sampleRate>>>8&255,Xe.sampleRate>>>0&255,0,0].concat(c(We))),Je=Xe.sampleRate,Qe=l(u.sb()),Ze=Qe.next();!Ze.done;Ze=Qe.next()){var et=Ze.value,tt=et.data;null==qe&&null!==et.pts&&(qe=et.pts);for(var it=0;it<tt.length;){for(var rt=!!(16&tt[it+1]),at=!!(8&tt[it+1]),ot=it+2,st=0;255===tt[ot];)st+=255,ot+=1;st+=tt[ot],ot+=1,ot+=rt?2:0,ot+=at?2:0;var ut=tt.slice(ot,ot+st);Ge.push({data:ut,size:ut.byteLength,duration:960,rb:0,flags:{wb:0,kb:0,jb:0,hb:0,ib:2,xb:0}}),it=ot+st}}if(0==Ye.byteLength||null==qe)throw new Ne(2,3,3018,n?n.O()[0]:null);t.audioSamplingRate=Xe.sampleRate,t.channelsCount=Xe.channelCount;var lt=qe/9e4*Je;p={id:t.id,type:"audio",codecs:"opus",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:Je,duration:i,Ab:[],Ea:Ye,Na:new Uint8Array([]),Wa:0,Xa:0,data:{Vb:this.g,baseMediaDecodeTime:lt,yb:Ge},stream:t}}p&&(d.push(p),p=null)}}catch(e){return e&&3023==e.code?Promise.resolve(new Uint8Array([])):Promise.reject(e)}if(!d.length)return Promise.reject(new Ne(2,3,3018,n?n.O()[0]:null));var ct=new uo(d),dt=t.id+"_"+n.i;if(this.j.has(dt))var ht=this.j.get(dt);else ht=lo(ct),this.j.set(dt,ht);var pt=this.l!==ht,ft=go(ct);if(this.l=ht,this.g++,pt){var gt=$e(ht,ft);return Promise.resolve(gt)}return Promise.resolve(ft)},F("shaka.transmuxer.TsTransmuxer",ES),ES.prototype.transmux=ES.prototype.transmux,ES.prototype.getOriginalMimeType=ES.prototype.getOriginalMimeType,ES.prototype.convertCodecs=ES.prototype.convertCodecs,ES.prototype.isSupported=ES.prototype.isSupported,ES.prototype.destroy=ES.prototype.destroy;var IS=["aac","ac-3","ec-3","mp3","opus"],CS=["avc","hevc"];function MS(){}Wn("video/mp2t",(function(){return new ES("video/mp2t")}),Zn),m(MS,jl),F("shaka.util.FairPlayUtils",MS)}.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:()=>K,alarmManager:()=>_,auth:()=>E,deviceManager:()=>B,displayManager:()=>F,envInfo:()=>R,getClientAssertion:()=>O,getConnectReason:()=>z,getPlatformInfo:()=>M,getTriggerEvent:()=>q,init:()=>C,initSequence:()=>S,isRunningE2E:()=>D,lifecycle:()=>j,messageManager:()=>H,platformManager:()=>V,remotePlayer:()=>U,setTimezone:()=>X,shaka:()=>G,showSequence:()=>A,uiReady:()=>P,writeLicenseResponse:()=>L});var e={};n.r(e),n.d(e,{ClientAssertionError:()=>N,ConnectReason:()=>I,ShakaPlayer:()=>K,alarmManager:()=>_,auth:()=>E,deviceManager:()=>B,displayManager:()=>F,envInfo:()=>R,getClientAssertion:()=>O,getConnectReason:()=>z,getPlatformInfo:()=>M,getTriggerEvent:()=>q,init:()=>C,initSequence:()=>S,isRunningE2E:()=>D,lifecycle:()=>j,messageManager:()=>H,platformManager:()=>V,remotePlayer:()=>U,setTimezone:()=>X,shaka:()=>G,showSequence:()=>A,uiReady:()=>P,writeLicenseResponse:()=>L});const t="4.4.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)}}class u extends EventTarget{get deviceInfo(){return a.log("get of deviceInfo 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{DisplayConnectionStatus=Object.freeze({CONNECTED:"connected",DISCONNECTED:"disconnected",UNKNOWN:"unknown"});DisplaySelectedStatus=Object.freeze({ACTIVE:"active",INACTIVE:"inactive",UNKNOWN:"unknown"});connection=this.DisplayConnectionStatus.DISCONNECTED;selected;resolution;framerate;security;make;model}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 p extends EventTarget{LoadMode=Object.freeze({NOT_LOADED:"notLoaded",LOADING:"loading",LOADED:"loaded",UNLOADING:"unloading"});AccessibilityPurposeCode={NONE:"",VISUALLY_IMPAIRED:"1",HARD_OF_HEARING:"2",SPOKEN_SUBTITLES:"9"};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 selectAudioLanguage(e,t="",n=this.AccessibilityPurposeCode.NONE){return o("RemotePlayer.selectAudioLanguage",e,t,n)}async selectTextTrack(e){return o("RemotePlayer.selectTextTrack",e)}async selectTextLanguage(e,t="",n=this.AccessibilityPurposeCode.NONE){return o("RemotePlayer.selectTextLanguage",e,t,n)}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 g={...f};class m 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)}}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)})}))}))},x=(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"})}))},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,y.root),document.body.appendChild(e),e})();const n=new Proxy([],{set:(e,i,r)=>(e[i]=r,"length"!==i&&x(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),x(t,n)},A=(e=!0)=>{const t=document.getElementById("sequence-container");t?t.style.visibility=e?"visible":"hidden":a.error("Sequence not initialized")};let k;"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(k)},forceTokenUpdate:function(){if(k=null,window.senzaSDKImplementation)return window.senzaSDKImplementation.auth.forceTokenUpdate();a.error("forceTokenUpdate: window.cefQuery is undefined")},getClientAssertion:O},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 C(){a.log(`init interface ${t}`),window.senzaSDKImplementation?await window.senzaSDKImplementation.init(t,A,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 D(){return!("undefined"==typeof window||!window.senzaSDKImplementation)}function P(){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 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 O(){if(window?.senzaSDKImplementation)return window.senzaSDKImplementation.auth.getClientAssertion();a.warn("getClientAssertion is not supported if NOT running e2e")}let j,U,_,B,F,V,H,K,G;function z(){return j.connectReason}function q(){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}`)}})}}D()?(j=window.senzaSDKImplementation.lifecycle,U=window.senzaSDKImplementation.remotePlayer,_=window.senzaSDKImplementation.alarmManager,B=window.senzaSDKImplementation.deviceManager,F=window.senzaSDKImplementation.displayManager,V=window.senzaSDKImplementation.platformManager,H=window.senzaSDKImplementation.messageManager,K=window.senzaSDKImplementation.ShakaPlayer,G=window.senzaSDKImplementation.shaka):(a.warn("Senza SDK is not running in E2E environment. Some features may not work as expected."),j=new s,U=new p,_=new d,B=new u,F=new l,V=new c,H=new h,K=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 p;e:{var f={};try{f.__proto__={a:!0},p=f.a;break e}catch(e){}p=!1}d=p?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.zm=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={Sh:t,di:!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 x(e,t,n){e.m=t,null!=n&&(e.j=n)}function S(e,t){e.m=0,e.j=t||0}function A(e,t,n){e.g=t,e.m=n||0}function k(e,t){return e.m=t||0,t=e.i.Sh,e.i=null,t}function E(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.di?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 C(e){this.g=new v,this.h=e}function M(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.di)throw t.Sh;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function P(e){this.next=function(t){return y(e.g),e.g.l?t=M(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=M(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?M(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 R(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 P(new C(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 O(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 j(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+""}function U(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{ai:r,v:a}}return{ai:-1,v:void 0}}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.Le(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.Le(i(e,r),i(n,a)),o},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.Le=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).Le(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).Le(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.sc=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.sc;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],sc:this[1].sc,head:this[1],key:e,value:t},n.list.push(n.entry),this[1].sc.next=n.entry,this[1].sc=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.sc.next=e.entry.next,e.entry.next.sc=e.entry.sc,e.entry.head=null,this.size--,0))},r.prototype.clear=function(){this[0]={},this[1]=this[1].sc=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.values",(function(e){return e||function(){return O(this,(function(e,t){return t}))}})),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.keys",(function(e){return e||function(){return O(this,(function(e){return e}))}})),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!==j(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("Array.prototype.findIndex",(function(e){return e||function(e,t){return U(this,e,t).ai}})),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 U(this,e,t).v}})),s("String.prototype.startsWith",(function(e){return e||function(e,t){var n=j(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 O(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=j(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=j(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(e){this.g=Math.exp(Math.log(.5)/e),this.i=this.h=0}function H(e){return e.h/(1-Math.pow(e.g,e.i))}function K(){this.h=new V(2),this.j=new V(5),this.g=0,this.i=128e3,this.l=16e3}function G(){}function z(){}function q(){}function X(e){var t=L.apply(1,arguments);Y.has(e)||(Y.add(e),q.apply(G,c(t)))}function W(){}V.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)},K.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)},K.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)}},K.prototype.getBandwidthEstimate=function(e){return this.g<this.i?e:Math.min(H(this.h),H(this.j))};var Y=new Set;function J(){this.g=new Map}function $(){this.g=new J}function Q(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=Z;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}Z=t}return t||!1}(e)?t:t.capture||!1}(e,i),this.target.addEventListener(t,n,this.g)}e.console&&((new Map).set(1,(function(){return console.error.apply(console,c(L.apply(0,arguments)))})).set(2,(function(){return console.warn.apply(console,c(L.apply(0,arguments)))})).set(3,(function(){return console.info.apply(console,c(L.apply(0,arguments)))})).set(4,(function(){return console.log.apply(console,c(L.apply(0,arguments)))})).set(5,(function(){return console.debug.apply(console,c(L.apply(0,arguments)))})).set(6,(function(){return console.debug.apply(console,c(L.apply(0,arguments)))})),q=function(){return console.warn.apply(console,c(L.apply(0,arguments)))},z=function(){console.error.apply(console,c(L.apply(0,arguments)))}),(i=J.prototype).push=function(e,t){this.g.has(e)?this.g.get(e).push(t):this.g.set(e,[t])},i.get=function(e){return this.g.has(e)?this.g.get(e).slice():null},i.remove=function(e,t){if(this.g.has(e)){var n=this.g.get(e).filter((function(e){return e!=t}));this.g.set(e,n),n.length||this.g.delete(e)}},i.forEach=function(e){this.g.forEach((function(t,n){e(n,t)}))},i.size=function(){return this.g.size},i.keys=function(){return Array.from(this.g.keys())},(i=$.prototype).release=function(){this.Ra(),this.g=null},i.D=function(e,t,n,i){this.g&&(e=new Q(e,t,n,i),this.g.push(t,e))},i.Aa=function(e,t,n,i){var r=this;this.D(e,t,(function i(a){r.Ja(e,t,i),n(a)}),i)},i.Ja=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.Ja(),this.g.remove(t,r))},i.Ra=function(){if(this.g){for(var e=[],t=l(this.g.g.values()),n=t.next();!n.done;n=t.next())e.push.apply(e,c(n.value));for(t=(e=l(e)).next();!t.done;t=e.next())t.value.Ja();this.g.g.clear()}},F("shaka.util.EventManager",$),$.prototype.removeAll=$.prototype.Ra,$.prototype.unlisten=$.prototype.Ja,$.prototype.listenOnce=$.prototype.Aa,$.prototype.listen=$.prototype.D,$.prototype.release=$.prototype.release,Q.prototype.Ja=function(){this.target.removeEventListener(this.type,this.listener,this.g),this.listener=this.target=null,this.g=!1};var Z=void 0;function ee(e){this.h=e,this.g=void 0}function te(){return re.value()}F("shaka.config.AutoShowText",{NEVER:0,ALWAYS:1,IF_PREFERRED_TEXT_LANGUAGE:2,IF_SUBTITLES_MAY_BE_NEEDED:3}),ee.prototype.value=function(){return void 0===this.g&&(this.g=this.h()),this.g};var ne=null,ie=null,re=new ee((function(){var e=void 0;return ne&&(e=ne()),!e&&ie&&(e=ie()),e}));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){q([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,ce=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");function de(e){var t;e instanceof de?(he(this,e.cc),this.ed=e.ed,pe(this,e.Cb),fe(this,e.vd),this.ob=e.ob,ge(this,e.g.clone()),this.Nc=e.Nc):e&&(t=String(e).match(ce))?(he(this,t[1]||"",!0),this.ed=me(t[2]||""),pe(this,t[3]||"",!0),fe(this,t[4]),this.ob=me(t[5]||"",!0),ge(this,t[6]||"",!0),this.Nc=me(t[7]||"")):this.g=new Ae(null)}function he(e,t,n){e.cc=n?me(t,!0):t,e.cc&&(e.cc=e.cc.replace(/:$/,""))}function pe(e,t,n){e.Cb=n?me(t,!0):t}function fe(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.vd=t}else e.vd=null}function ge(e,t,n){t instanceof Ae?e.g=t:(n||(t=ve(t,xe)),e.g=new Ae(t))}function me(e,t){return e?t?decodeURI(e):decodeURIComponent(e):""}function ve(e,t,n){return null!=e?(e=encodeURI(e).replace(t,ye),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function ye(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}(i=de.prototype).cc="",i.ed="",i.Cb="",i.vd=null,i.ob="",i.Nc="",i.toString=function(){var e=[],t=this.cc;if(t&&e.push(ve(t,be,!0),":"),t=this.Cb){e.push("//");var n=this.ed;n&&e.push(ve(n,be,!0),"@"),e.push(encodeURIComponent(t).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(t=this.vd)&&e.push(":",String(t))}return(t=this.ob)&&(this.Cb&&"/"!=t.charAt(0)&&e.push("/"),e.push(ve(t,"/"==t.charAt(0)?Te:we,!0))),(t=this.g.toString())&&e.push("?",t),(t=this.Nc)&&e.push("#",ve(t,Se)),e.join("")},i.resolve=function(e){var t=this.clone();"data"===t.cc&&(t=new de);var n=!!e.cc;n?he(t,e.cc):n=!!e.ed,n?t.ed=e.ed:n=!!e.Cb,n?pe(t,e.Cb):n=null!=e.vd;var i=e.ob;if(n)fe(t,e.vd);else if(n=!!e.ob){if("/"!=i.charAt(0))if(this.Cb&&!this.ob)i="/"+i;else{var r=t.ob.lastIndexOf("/");-1!=r&&(i=t.ob.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.ob=i:n=""!==e.g.toString(),n?ge(t,e.g.clone()):n=!!e.Nc,n&&(t.Nc=e.Nc),t},i.clone=function(){return new de(this)};var be=/[#\/\?@]/g,we=/[#\?:]/g,Te=/[#\?]/g,xe=/[#\?@]/g,Se=/#/g;function Ae(e){this.g=e||null}function ke(e){if(!e.fb&&(e.fb=new Map,e.Ld=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 Ee(e){return ke(e),e.Ld}function Ie(){}function Ce(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=De(e);t=De(t);for(var i=0;i<e.byteLength;i++)if(n[i]!=t[i])return!1;return!0}function Me(e){return ArrayBuffer.isView(e)?0==e.byteOffset&&e.byteLength==e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer:e}function De(e,t,n){return Le(e,void 0===t?0:t,n=void 0===n?1/0:n,Uint8Array)}function Pe(e,t,n){return Le(e,void 0===t?0:t,n=void 0===n?1/0:n,Uint16Array)}function Re(e,t,n){return Le(e,void 0===t?0:t,n=void 0===n?1/0:n,DataView)}function Le(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 Ne(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,Oe)try{throw Error(this.message||"Shaka Error")}catch(e){this.stack=e.stack}}(i=Ae.prototype).fb=null,i.Ld=null,i.add=function(e,t){ke(this),this.g=null;var n=this.fb.has(e)?this.fb.get(e):null;return n||this.fb.set(e,n=[]),n.push(t),this.Ld++,this},i.set=function(e,t){return ke(this),this.g=null,this.fb.has(e)?this.fb.set(e,[t]):this.add(e,t),this},i.get=function(e){return ke(this),this.fb.get(e)||[]},i.toString=function(){if(this.g)return this.g;if(!this.fb||!this.fb.size)return"";for(var e=[],t=l(this.fb.keys()),n=t.next();!n.done;n=t.next()){var i=n.value;n=encodeURIComponent(i),i=this.fb.get(i);for(var r=0;r<i.length;r++){var a=n;""!==i[r]&&(a+="="+encodeURIComponent(i[r])),e.push(a)}}return this.g=e.join("&")},i.clone=function(){var e=new Ae;if(e.g=this.g,this.fb){for(var t=new Map,n=l(this.fb),i=n.next();!i.done;i=n.next()){var r=l(i.value);i=r.next().value,r=r.next().value,t.set(i,r.concat())}e.fb=t,e.Ld=this.Ld}return e},F("shaka.util.BufferUtils",Ie),Ie.toDataView=Re,Ie.toUint16=Pe,Ie.toUint8=De,Ie.toArrayBuffer=Me,Ie.equal=Ce,Ne.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")},F("shaka.util.Error",Ne);var Oe=!0;function je(){}function Ue(t){if(!t)return"";if(239==(t=De(t))[0]&&187==t[1]&&191==t[2]&&(t=t.subarray(3)),e.TextDecoder&&!te().ph())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 _e(e,t,n){if(!e)return"";if(!n&&0!=e.byteLength%2)throw new Ne(2,2,2004);n=Math.floor(e.byteLength/2);var i=new Uint16Array(n);e=Re(e);for(var r=0;r<n;r++)i[r]=e.getUint16(2*r,t);return He(i)}function Be(e){function t(e){return n.byteLength<=e||9<=n[e]&&126>=n[e]}if(!e)return"";var n=De(e);if(239==n[0]&&187==n[1]&&191==n[2])return Ue(n);if(254==n[0]&&255==n[1])return _e(n.subarray(2),!1);if(255==n[0]&&254==n[1])return _e(n.subarray(2),!0);if(0==n[0]&&0==n[2])return _e(e,!1);if(0==n[1]&&0==n[3])return _e(e,!0);if(t(0)&&t(1)&&t(2)&&t(3))return Ue(e);throw new Ne(2,2,2003)}function Fe(t){if(e.TextEncoder&&!te().ph()){var n=new TextEncoder;return Me(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 Me(n)}function Ve(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 He(e){return Ge.value()(e)}function Ke(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||""}Ne.Severity={RECOVERABLE:1,CRITICAL:2},Ne.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9,ADS:10},Ne.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,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,STREAMING_NOT_ALLOWED:3024,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,CANNOT_ADD_EXTERNAL_CHAPTERS_TO_LIVE_STREAM: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,MISSING_EME_SUPPORT:6020,LOAD_INTERRUPTED:7e3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,OBJECT_DESTROYED:7003,CONTENT_NOT_LOADED:7004,SRC_EQUALS_PRELOAD_NOT_SUPPORTED:7005,PRELOAD_DESTROYED:7006,QUEUE_INDEX_OUT_OF_BOUNDS:7007,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},F("shaka.util.StringUtils",je),je.resetFromCharCode=function(){Ge.g=void 0},je.toUTF16=Ve,je.toUTF8=Fe,je.fromBytesAutoDetect=Be,je.fromUTF16=_e,je.fromUTF8=Ue;var Ge=new ee((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={Hc:65536};0<t.Hc;(t={Hc:t.Hc}).Hc/=2)if(e(t.Hc))return function(e){return function(t){for(var n="",i=0;i<t.length;i+=e.Hc)n+=String.fromCharCode.apply(null,t.subarray(i,i+e.Hc));return n}}(t);return null}));function ze(){}function qe(e){return e=He(De(e)),btoa(e)}function Xe(e,t){return t=null==t||t,e=qe(e).replace(/\+/g,"-").replace(/\//g,"_"),t?e:e.replace(/[=]*$/,"")}function We(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 Ye(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 Je(e){var t=De(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 $e(){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(De(r),n),n+=r.byteLength}return t}function Qe(e,t,n){if(n=void 0===n?"":n,0==t.length)return e;if(1==e.length&&1==t.length){var i=new de(e[0]);return t=new de(t[0]),t=i.resolve(t),n&&ge(t,n),[t.toString()]}t=t.map((function(e){return new de(e)})),i=[];for(var r=(e=l(e)).next();!r.done;r=e.next()){r=new de(r.value);for(var a=l(t),o=a.next();!o.done;o=a.next())o=r.resolve(o.value),n&&ge(o,n),i.push(o.toString())}return i}function Ze(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 et(t,n){n=void 0===n?"cenc":n;var i=[],r=[],a=[];t.forEach((function(e,t){var n=t;22!=n.length&&(n=Xe(Ye(t),!1));var o=e;22!=o.length&&(o=Xe(Ye(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:De(Fe(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 tt(e,t){if(1==t.length)return t[0];if(null!=(e=nt(e,t)))return e;throw new Ne(2,4,4025,t)}function nt(e,t){for(var n=st.get(e),i=(n=l(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==rt?"":null}function it(e,t){for(var n=[],i=(e=l(e=st.get(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}F("shaka.util.Uint8ArrayUtils",ze),ze.concat=$e,ze.toHex=Je,ze.fromHex=Ye,ze.fromBase64=We,ze.toBase64=Xe,ze.toStandardBase64=qe;var rt="text",at={Ca:"video",ea:"audio",Ta:rt,Tf:"image",hl:"application"},ot=1/15,st=(new Map).set("audio",[/^vorbis$/,/^Opus$/,/^opus$/,/^fLaC$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4/,/^dts[cex]$/,/^iamf/,/^mhm[12]/,/^ac3$/,/^eac3$/,/^apac$/]).set("video",[/^avc/,/^hev/,/^hvc/,/^vvc/,/^vvi/,/^vp0?[89]/,/^av01/,/^dvh/,/^dva/,/^dav/]).set("text",[/^vtt$/,/^wvtt/,/^stpp/]);function ut(e,t,n,i){this.g=null,this.l=e,this.i=t,this.m=n,this.o=i,this.j=!1;e:{if("undefined"==typeof libDPIModule&&q("Could not find LCEVC Library dependencies on this page"),"undefined"!=typeof LCEVCdec)this.h=LCEVCdec;else{if("undefined"==typeof LcevcDil){q("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?(q("Could not find LCEVC Library on this page"),e=!1):(this.h.SupportObject.SupportStatus||q(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 lt(e,t,n,i){"video"!==i.type||e.o&&!i.baseOriginalId||e.g&&e.g.appendBuffer(t,"video",i.id,-n,!e.o)}function ct(e){e.g&&e.i.classList.add("shaka-hidden")}function dt(e){return!(!e||"undefined"==typeof LCEVCdec)&&"lvc1"==e.codecs}function ht(t){if(gt.has(t))return gt.get(t);var n=e.ManagedMediaSource||e.MediaSource;return!!n&&(n=n.isTypeSupported(t),gt.set(t,n),n)}function pt(){var t=e.ManagedSourceBuffer||e.SourceBuffer;return!!t&&!!t.prototype&&!!t.prototype.changeType}function ft(){var t=e.ManagedMediaSource||e.MediaSource;return!!(t&&t.prototype&&t.prototype.setLiveSeekableRange&&t.prototype.clearLiveSeekableRange)}ut.prototype.release=function(){this.g&&(this.g.close(),this.g=null)},F("shaka.lcevc.Dec",ut),ut.prototype.release=ut.prototype.release;var gt=new Map;function mt(){}function vt(){}function yt(){}function bt(e){this.h=new Map,this.i=0,this.j=new vt,(e=Tt(e.toLowerCase()))&&(this.j=e()),this.g=new mt,(e=St)&&(this.g=e(),this.h.set(this.i,this.g))}function wt(e,t){xt.set(e,t)}function Tt(e){return xt.get(e)}mt.prototype.extract=function(){},mt.prototype.decode=function(){return[]},mt.prototype.clear=function(){},mt.prototype.getStreams=function(){return[]},vt.prototype.init=function(){},vt.prototype.parse=function(){return[]},(i=yt.prototype).init=function(){},i.vf=function(){},i.Fd=function(){},i.remove=function(){},i.Uf=function(){},F("shaka.media.IClosedCaptionParser",yt),(i=bt.prototype).init=function(e,t,n){if(t=void 0!==t&&t,-1!=(n=void 0===n?-1:n)&&this.i!=n){t=n;var i=this.h.get(t);this.h.set(this.i,this.g),i?this.g=i:((i=St)&&(this.g=i()),this.h.set(t,this.g))}else t||this.Fd();this.j.init(e),-1!=n&&(this.i=n)},i.vf=function(e){for(var t=(e=l(e=this.j.parse(e))).next();!t.done;t=e.next()){var n=De((t=t.value).packet);0<n.length&&this.g.extract(n,t.pts)}return this.g.decode()},i.Fd=function(){this.g.clear()},i.remove=function(e){e=void 0===e?[]:e,e=new Set(e);for(var t=l(this.h.keys()),n=t.next();!n.done;n=t.next())if(n=n.value,!e.has(n)){var i=this.h.get(n);i&&i.clear(),this.h.delete(n)}},i.Uf=function(){return this.g.getStreams()},F("shaka.media.ClosedCaptionParser",bt),bt.findDecoder=function(){return St},bt.unregisterDecoder=function(){St=null},bt.registerDecoder=function(e){St=e},bt.findParser=Tt,bt.unregisterParser=function(e){xt.delete(e)},bt.registerParser=wt;var xt=new Map,St=null;function At(){this.id="",this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0,this.height=this.width=100,this.viewportAnchorUnits=this.widthUnits=this.heightUnits=kt,this.scroll=Et}F("shaka.text.CueRegion",At);var kt=1;At.units={PX:0,PERCENTAGE:kt,LINES:2};var Et="";function It(e,t){return!("number"!=typeof e||"number"!=typeof t||!isNaN(e)||!isNaN(t))||e===t}function Ct(e,t){-1<(t=e.indexOf(t))&&e.splice(t,1)}function Mt(e,t,n){if(n||(n=It),e.length!=t.length)return!1;t=t.slice();for(var i=(e=l(e)).next(),r={};!i.done;r={ei:void 0},i=e.next()){if(r.ei=i.value,-1==(i=t.findIndex(function(e){return function(t){return n(e.ei,t)}}(r))))return!1;t[i]=t[t.length-1],t.pop()}return 0==t.length}function Dt(e,t,n){if(e===t)return!0;if(!e||!t)return e==t;if(n||(n=It),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 Pt(e){this.h=e||"",this.g=0}function Rt(e){Lt(e,/[ \t]+/gm)}function Lt(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 Nt(e){return e.g==e.h.length?null:(e=Lt(e,/[^ \t\n]*/gm))?e[0]:null}function Ot(e){if(null==(e=Lt(e,Ut)))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 jt(e){return e?Ot(new Pt(e)):null}At.scrollMode={NONE:Et,UP:"up"};var Ut=/(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;function _t(){}function Bt(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=Array.isArray(n);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 Ft(e){var t,n={};for(t in e)n[t]=e[t];return n}function Vt(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=Vt(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=Vt(r))&&t.push(i+":"+r);e="{"+t.join(",")+"}"}else e=JSON.stringify(e);return e}function Ht(e,t){var n=void 0!==n&&n;return Kt(e=Be(e),t,n)}function Kt(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 p=e.charCodeAt(i);if(64<p&&91>p||96<p&&123>p){p=n();for(var f=e.charCodeAt(i);f&&39!==f&&34!==f&&!(64<f&&91>f||96<f&&123>f)&&62!==f;)i++,f=e.charCodeAt(i);var g=i+1;if(i=e.indexOf(e[i],g),g=e.slice(g,i),39===f||34===f){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(p.startsWith("xmlns:")){f=g;var m=p.split(":")[1];bn.set(f,m),wn.set(m,f)}"tt"===d&&"xml:space"===p&&"preserve"===g&&(l=!0),h[p]=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(p=u[h])?t&&(p.parent=l):h==d-1&&"\n"==p&&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 Gt(e){return bn.has(e)?bn.get(e):""}function zt(e){return"string"==typeof e}function qt(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 Xt(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 Wt(e){return"string"==typeof e?Ke(e):""===(e=e.children.reduce((function(e,t){return"string"==typeof t?e+t:e}),""))?null:Ke(e)}function Yt(e){return Array.from(e.children).every((function(e){return"string"==typeof e}))?((e=Wt(e))&&(e=e.trim()),e):null}function Jt(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())Jt(i.value,t,n);return n}function $t(e,t){return 1!=(e=Xt(e,t)).length?null:e[0]}function Qt(e,t,n){return 1!=(e=tn(e,t,n)).length?null:e[0]}function Zt(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 en(e,t,n){return t=Gt(t),e.attributes[t+":"+n]||null}function tn(e,t,n){var i=Gt(t);if(t=[],e.children)for(n=i?i+":"+n:n,i=(e=l(e.children)).next();!i.done;i=e.next())(i=i.value)&&i.tagName===n&&t.push(i);return t}function nn(e,t,n){for(var i=(t=l(t)).next();!i.done;i=t.next())if(i=en(e,i.value,n))return i;return null}function rn(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 an(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)?)?$","i").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 on(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 sn(e){return 0==(e=Number(e))%1?e:null}function un(e){return 0==(e=Number(e))%1&&0<e?e:null}function ln(e){return 0==(e=Number(e))%1&&0<=e?e:null}function cn(e){return e=Number(e),isNaN(e)?null:e}function dn(e){return!!e&&"true"===e.toLowerCase()}function hn(e){var t,n=(t=e.match(/^(\d+)\/(\d+)$/))?Number(t[1])/Number(t[2]):Number(e);return isNaN(n)?null:n}function pn(e){for(var t=[],n=(e=l(e=Ke(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,wc:n.split("/@")[1]||null})}else n.startsWith("@")&&t.length&&(t[t.length-1].wc=n.slice(1))}return t}function fn(e,t){var n=pn(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=gn(e,"t",i.t)),null!==i.n&&(n=gn(e,"n",i.n))),null===n?n="prepend"===r?0:e.length:"prepend"===r?--n:"after"===r&&++n,r=t.tagName,(i=i.wc)&&e[n]?mn(e[n],r,i,Yt(t)||""):("remove"!==r&&"replace"!==r||e.splice(n,1),"add"!==r&&"replace"!==r||e.splice.apply(e,[n,0].concat(c(t.children))))}}function gn(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 mn(e,t,n,i){"remove"===t?delete e.attributes[n]:"add"!==t&&"replace"!==t||(e.attributes[n]=i)}function vn(e){var t="",n=e.tagName.split(":");for(var i in 0<n.length&&(t=n[0],t=wn.has(t)?wn.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):vn(i),t.appendChild(n);return t}function yn(e){if(!e)return null;for(var t={tagName:e.tagName,attributes:Ft(e.attributes),children:[],parent:null},n=(e=l(e.children)).next();!n.done;n=e.next())"string"==typeof(n=n.value)||((n=yn(n)).parent=t),t.children.push(n);return t}F("shaka.util.ObjectUtils",_t),_t.alphabeticalKeyOrderStringify=Vt,_t.shallowCloneObject=Ft,_t.cloneObject=Bt;var bn=new Map,wn=new Map;function Tn(e,t,n){this.startTime=e,this.endTime=t,this.payload=n,this.region=new At,this.position=null,this.positionAlign=Cn,this.size=0,this.textAlign=Mn,this.direction=Ln,this.writingMode=Nn,this.lineInterpretation=On,this.line=null,this.lineHeight="",this.lineAlign=jn,this.displayAlign=Pn,this.fontSize=this.border=this.backgroundImage=this.backgroundColor=this.color="",this.fontWeight=Fn,this.fontStyle=Hn,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 xn(e,t){return(e=new Tn(e,t,"")).lineBreak=!0,e}function Sn(e,t){if(e.payload!=t.payload||!(.001>Math.abs(e.startTime-t.startTime)&&.001>Math.abs(e.endTime-t.endTime)))return!1;for(var n in e)if("startTime"!=n&&"endTime"!=n&&"payload"!=n)if("nestedCues"==n){if(!Dt(e.nestedCues,t.nestedCues,Sn))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(!Dt(e[n],t[n]))return!1}else if(e[n]!=t[n])return!1;return!0}function An(e,t){t=void 0===t?new Map:t;var n=e.payload;if(n.includes("<")){0===t.size&&kn(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(qn)&&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=Kt("<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())En(n.value,e,t);else e.payload=Ke(n);else e.payload=Ke(n)}else e.payload=Ke(n)}function kn(e){for(var t=l(Object.entries(_n)),n=t.next();!n.done;n=t.next()){var i=l(n.value);n=i.next().value,i=i.next().value;var r=new Tn(0,0,"");r.color=i,e.set("."+n,r)}for(n=(t=l(Object.entries(Bn))).next();!n.done;n=t.next())n=(i=l(n.value)).next().value,i=i.next().value,(r=new Tn(0,0,"")).backgroundColor=i,e.set("."+n,r)}function En(e,t,n){var i=t.clone();if(i.nestedCues=[],i.payload="",i.rubyTag="",i.line=null,i.region=new At,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=In(o.backgroundColor,s.backgroundColor),s.color=In(o.color,s.color),s.fontFamily=In(o.fontFamily,s.fontFamily),s.fontSize=In(o.fontSize,s.fontSize),s.textShadow=In(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=xn(i.startTime,i.endTime),void t.nestedCues.push(i);case"b":i.fontWeight=Vn;break;case"i":i.fontStyle=Kn;break;case"u":i.textDecoration.push(zn);break;case"font":(a=e.attributes.color)&&(i.color=a);break;case"div":if(!(a=e.attributes.time))break;(a=jt(a))&&(i.startTime=a);break;case"ruby":case"rp":case"rt":i.rubyTag=a}}if(r=e.children,zt(e)||1==r.length&&zt(r[0]))for(n=Wt(e).split("\n"),e=!0,r=(n=l(n)).next();!r.done;r=n.next())r=r.value,e||(e=xn(i.startTime,i.endTime),t.nestedCues.push(e)),0<r.length&&((e=i.clone()).payload=Ke(r),t.nestedCues.push(e)),e=!1;else for(t.nestedCues.push(i),e=(t=l(r)).next();!e.done;e=t.next())En(e.value,i,n)}function In(e,t){return e&&0<e.length?e:t}Tn.prototype.clone=function(){var e,t=new Tn(0,0,"");for(e in this)t[e]=this[e],Array.isArray(t[e])&&(t[e]=t[e].slice());return t},F("shaka.text.Cue",Tn),Tn.parseCuePayload=An,Tn.equal=Sn,Tn.prototype.clone=Tn.prototype.clone;var Cn="auto";Tn.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:Cn};var Mn="center",Dn={LEFT:"left",RIGHT:"right",CENTER:Mn,START:"start",END:"end"};Tn.textAlign=Dn;var Pn="after",Rn={BEFORE:"before",CENTER:"center",AFTER:Pn};Tn.displayAlign=Rn;var Ln="ltr";Tn.direction={HORIZONTAL_LEFT_TO_RIGHT:Ln,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var Nn="horizontal-tb";Tn.writingMode={HORIZONTAL_TOP_TO_BOTTOM:Nn,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};var On=0;Tn.lineInterpretation={LINE_NUMBER:On,PERCENTAGE:1};var jn="start",Un={CENTER:"center",START:jn,END:"end"};Tn.lineAlign=Un;var _n={white:"white",lime:"lime",cyan:"cyan",red:"red",yellow:"yellow",magenta:"magenta",blue:"blue",black:"black"};Tn.defaultTextColor=_n;var Bn={bg_white:"white",bg_lime:"lime",bg_cyan:"cyan",bg_red:"red",bg_yellow:"yellow",bg_magenta:"magenta",bg_blue:"blue",bg_black:"black"};Tn.defaultTextBackgroundColor=Bn;var Fn=400,Vn=700;Tn.fontWeight={NORMAL:Fn,BOLD:Vn};var Hn="normal",Kn="italic",Gn={NORMAL:Hn,ITALIC:Kn,OBLIQUE:"oblique"};Tn.fontStyle=Gn;var zn="underline";Tn.textDecoration={UNDERLINE:zn,LINE_THROUGH:"lineThrough",OVERLINE:"overline"};var qn=/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g;function Xn(){}function Wn(e,t,n){Jn.set(e.toLowerCase().split(";")[0]+"-"+n,{priority:n,wf:t})}function Yn(e,t){for(var n=e.toLowerCase().split(";")[0],i=l([ei,Zn,Qn,$n]),r=i.next();!r.done;r=i.next())if(r=Jn.get(n+"-"+r.value)){var a=r.wf(),o=a.isSupported(e,t);if(a.destroy(),o)return r.wf}return null}Xn.prototype.destroy=function(){},F("shaka.transmuxer.TransmuxerEngine",Xn),Xn.findTransmuxer=Yn,Xn.unregisterTransmuxer=function(e,t){Jn.delete(e.toLowerCase().split(";")[0]+"-"+t)},Xn.registerTransmuxer=Wn,Xn.prototype.destroy=Xn.prototype.destroy;var Jn=new Map,$n=1,Qn=2,Zn=3,ei=4;function ti(){}function ni(e,t){var n=e;return t&&!hi.includes(e)&&(n+='; codecs="'+t+'"'),n}function ii(e,t){return t&&(e+='; codecs="'+t+'"'),e}function ri(e,t,n){var i=ni(e,t);return Yn(t=ii(e,t))?(e=Yn(t))?(n=(e=e()).convertCodecs(n,t),e.destroy()):n=t:n="video/mp2t"!=e&&"audio"==n?i.replace("video","audio"):i,n}function ai(e){return e.split(";")[0].split("/")[1]}function oi(e){var t=di(e);switch(e=t[0].toLowerCase(),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:case"ac3"===e:case"ac-3"===e:return"ac-3";case"mp4a"===e&&"a6"===t:case"eac3"===e:case"ec-3"===e:return"ec-3";case"ac-4"===e:return"ac-4";case"mp4a"===e&&"b2"===t:return"dtsx";case"mp4a"===e&&"a9"===t:return"dtsc";case"vp09"===e:case"vp9"===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 si(e){for(var t=[],n=(e=l(e.split(","))).next();!n.done;n=e.next())n=di(n.value),t.push(n[0]);return t.sort().join(",")}function ui(e){return e.split(";")[0]}function li(e){return(e=e.split(/ *; */)).shift(),(e=e.find((function(e){return e.startsWith("codecs=")})))?e.split("=")[1].replace(/^"|"$/g,""):""}function ci(e){return"application/x-mpegurl"===e||"application/vnd.apple.mpegurl"===e}function di(e){var t=(e=e.split("."))[0];return e.shift(),[t,e.join(".")]}Xn.PluginPriority={FALLBACK:$n,PREFERRED_SECONDARY:Qn,PREFERRED:Zn,APPLICATION:ei},F("shaka.util.MimeUtils",ti),ti.getFullTypeWithAllCodecs=ii,ti.getFullType=ni,(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");var hi=["audio/aac","audio/ac3","audio/ec3","audio/mpeg"];function pi(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 fi(e,t){bi.set(e,t)}function gi(e){return bi.get(e)}function mi(e){return!!bi.has(e)||("application/cea-608"==e||"application/cea-708"==e)&&!!St}function vi(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 yi(e,t,n){t.startTime+=n,t.endTime+=n;for(var i=(t=l(t.nestedCues)).next();!i.done;i=t.next())yi(e,i.value,n)}pi.prototype.destroy=function(){return this.j=this.i=null,this.o.clear(),Promise.resolve()},pi.prototype.remove=function(e,t){var n=this;return R((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",pi),pi.prototype.destroy=pi.prototype.destroy,pi.findParser=gi,pi.unregisterParser=function(e){bi.delete(e)},pi.registerParser=fi;var bi=new Map;function wi(e){this.h=e,this.g=null}function Ti(e){this.h=e,this.g=null}function xi(e,t){return e.concat(t)}function Si(){}function Ai(e){return null!=e}function ki(e,t){return Promise.race([t,new Promise((function(t,n){new Ti(n).ia(e)}))])}function Ei(){}function Ii(e,t){return e=Di(e),t=Di(t),e.split("-")[0]==t.split("-")[0]}function Ci(e,t){return e=Di(e),t=Di(t),e=e.split("-"),t=t.split("-"),e[0]==t[0]&&1==e.length&&2==t.length}function Mi(e,t){return e=Di(e),t=Di(t),e=e.split("-"),t=t.split("-"),2==e.length&&2==t.length&&e[0]==t[0]}function Di(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=Oi.get(t)||t,((n=n.toUpperCase())?t+"-"+n:t)+(e?"-"+e:"")}function Pi(e,t){return e=Di(e),(t=Di(t))==e?4:Ci(t,e)?3:Mi(t,e)?2:Ci(e,t)?1:0}function Ri(e){var t=e.indexOf("-");return e=(e=0<=t?e.substring(0,t):e).toLowerCase(),Oi.get(e)||e}function Li(e){return e.language?Di(e.language):e.audio&&e.audio.language?Di(e.audio.language):e.video&&e.video.language?Di(e.video.language):"und"}function Ni(e,t){e=Di(e);for(var n=new Set,i=(t=l(t)).next();!i.done;i=t.next())n.add(Di(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(Ci(i=i.value,e))return i;for(i=(t=l(n)).next();!i.done;i=t.next())if(Mi(i=i.value,e))return i;for(t=(n=l(n)).next();!t.done;t=n.next())if(Ci(e,t=t.value))return t;return null}wi.prototype.ia=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},wi.prototype.stop=function(){this.g&&(this.g(),this.g=null)},Ti.prototype.Jb=function(){return this.stop(),this.h(),this},Ti.prototype.ia=function(e){var t=this;return this.stop(),this.g=new wi((function(){t.h()})).ia(e),this},Ti.prototype.Fa=function(e){var t=this;return this.stop(),this.g=new wi((function(){t.g.ia(e),t.h()})).ia(e),this},Ti.prototype.stop=function(){this.g&&(this.g.stop(),this.g=null)},F("shaka.util.Timer",Ti),Ti.prototype.stop=Ti.prototype.stop,Ti.prototype.tickEvery=Ti.prototype.Fa,Ti.prototype.tickAfter=Ti.prototype.ia,Ti.prototype.tickNow=Ti.prototype.Jb,F("shaka.util.LanguageUtils",Ei),Ei.findClosestLocale=Ni,Ei.getLocaleForVariant=Li,Ei.getLocaleForText=function(e){return Di(e.language||"und")},Ei.getBase=Ri,Ei.relatedness=Pi,Ei.areSiblings=function(e,t){var n=Ri(e),i=Ri(t);return e!=n&&t!=i&&n==i},Ei.normalize=Di,Ei.isSiblingOf=Mi,Ei.isParentOf=Ci,Ei.areLanguageCompatible=Ii,Ei.areLocaleCompatible=function(e,t){return(e=Di(e))==Di(t)};var Oi=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 ji(){}function Ui(e,t,n,i,r){function a(e){var t=String(e.width||"")+String(e.height||"")+String(Math.round(e.frameRate||0))+(e.hdr||"")+e.fastSwitching;return e.dependencyStream&&(t+=e.dependencyStream.baseOriginalId||""),t}if(r.length){for(var o=e.textStreams,s=(r=l(r)).next(),u={};!s.done;u={xh:void 0},s=r.next())if(u.xh=s.value,(s=o.filter(function(e){return function(t){return!(!t.codecs.startsWith(e.xh)&&!t.mimeType.startsWith(e.xh))}}(u))).length){o=s;break}e.textStreams=o}if(o=e.variants,(t.length||n.length)&&(o=function(e,t,n){for(var i=(t=l(t)).next(),r={};!i.done;r={videoCodec:void 0},i=t.next())if(r.videoCodec=i.value,i=e.filter(function(e){return function(t){return t.video&&t.video.codecs.startsWith(e.videoCodec)}}(r)),i.length){e=i;break}for(t=(n=l(n)).next(),i={};!t.done;i={audioCodec:void 0},t=n.next())if(i.audioCodec=t.value,t=e.filter(function(e){return function(t){return t.audio&&t.audio.codecs.startsWith(e.audioCodec)}}(i)),t.length){e=t;break}return e}(o,t,n)),i.length){for(t=new J,o=(n=l(o)).next();!o.done;o=n.next())o=o.value,t.push(String(o.video.width||0),o);var d=[];t.forEach((function(e,t){e=0;for(var n=[],r=(t=l(t)).next(),a={};!r.done;a={Rf:void 0},r=t.next())a.Rf=r.value,(r=i.filter(function(e){return function(t){return e.Rf.decodingInfos[0][t]}}(a)).length)>e?(e=r,n=[a.Rf]):r==e&&n.push(a.Rf);d.push.apply(d,c(n))})),o=d}for(n=new Set,t=new Set,r=(o=l(o)).next();!r.done;r=o.next())(r=r.value).audio&&n.add(r.audio),r.video&&t.add(r.video);o=Array.from(n).sort((function(e,t){return e.bandwidth-t.bandwidth}));var h,p,f=[];for(n=new Map,r=(o=l(o)).next();!r.done;r=o.next()){if(p=void 0,p=(h=r=r.value).language+(h.channelsCount||0)+(h.audioSamplingRate||0)+h.roles.join(",")+h.label+h.groupId+h.fastSwitching,h.dependencyStream&&(p+=h.dependencyStream.baseOriginalId||""),s=p,(u=n.get(s)||[]).length){var g=u[u.length-1],m=oi(g.codecs),v=oi(r.codecs);m!=v||r.bandwidth&&g.bandwidth&&!(r.bandwidth>g.bandwidth)||(u.push(r),f.push(r.id))}else u.push(r),f.push(r.id);n.set(s,u)}var y={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};o=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=oi(e.codecs),i=oi(t.codecs);if(n!=i)return(y[n]||1)-(y[i]||1)}return e.width-t.width}return e.bandwidth-t.bandwidth})),t=pt();var b=[];for(n=new Map,r=(o=l(o)).next();!r.done;r=o.next()){if(s=a(r=r.value),(u=n.get(s)||[]).length){if(g=u[u.length-1],!t&&(m=oi(g.codecs))!==(v=oi(r.codecs)))continue;(m=oi(g.codecs))!=(v=oi(r.codecs))||r.bandwidth&&g.bandwidth&&!(r.bandwidth>g.bandwidth)||(u.push(r),b.push(r.id))}else u.push(r),b.push(r.id);n.set(s,u)}e.variants=e.variants.filter((function(e){var t=e.audio;return e=e.video,!(t&&!f.includes(t.id)||e&&!b.includes(e.id))}))}function _i(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 Bi(e,t,n,i,r){var a,o;return R((function(s){if(1==s.g)return te().Pi()&&function(e){for(var t=(new Map).set("dvav","avc3").set("dva1","avc1").set("dvhe","hev1").set("dvh1","hvc1").set("dvc1","vvc1").set("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(t)).next();!r.done;r=i.next()){var a=l(r.value);if(r=a.next().value,a=a.next().value,e.codecs.includes(r)){e.codecs=e.codecs.replace(r,a);break}}}}(t.variants),w(s,Hi(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=te(),r="Xbox"===i.Ob();i="MOBILE"===i.La()&&"GECKO"===i.Da();var a=e.video,o=a&&a.width||0,s=a&&a.height||0;return!(r&&a&&(1920<o||1080<s)&&(a.codecs.includes("avc1.")||a.codecs.includes("avc3."))||(r=a&&a.dependencyStream)&&!dt(r)||(e=e.audio,i&&e&&e.encrypted&&e.codecs.toLowerCase().includes("opus")||e&&e.dependencyStream))}(e,a,r);if(!t){var n=[];e.audio&&n.push(ir(e.audio)),e.video&&n.push(ir(e.video))}return t})),T(s)}))}function Fi(e,t){var n,i,r,a,o,s,u;return R((function(c){if(1==c.g){for(n=function(e,t){if(e){var n=Ft(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,Ke:void 0},o=a.next())u=o.value,s.Ke=Vt(u),s.cache=or,s.cache.has(s.Ke)?i=n(i,s.cache.get(s.Ke)):r.push(Vi(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.set(e.Ke,r),i=n(i,r))}}(s)));return w(c,Promise.all(r),2)}i&&e.decodingInfos.push(i),T(c)}))}function Vi(e){var t=[""];e.video&&(t=li(e.video.contentType).split(","));var n=[""];e.audio&&(n=li(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={Mc:void 0},o=a.next())o=o.value,s.Mc=Bt(e),e.video&&(s.Mc.video.contentType=ni(ui(s.Mc.video.contentType),r)),e.audio&&(s.Mc.audio.contentType=ni(ui(s.Mc.audio.contentType),o)),i.push(new Promise(function(e){return function(t,n){("MOBILE"==te().La()?ki(5,navigator.mediaCapabilities.decodingInfo(e.Mc)):navigator.mediaCapabilities.decodingInfo(e.Mc)).then((function(e){t(e)})).catch(n)}}(s)))}return Promise.all(i).catch((function(){return JSON.stringify(e),null}))}function Hi(e,t,n,i){var r,a,o,s,u,c,d,h,p,f,g,m,v,y,b,T,x,S;return R((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.ui=a.value,s=!1,u=l(e),c=u.next();case 5:if(c.done){A.u(7);break}d=c.value,h=Ki(d,t,n).filter((k=o,function(e){return((e=e[0]).keySystemConfiguration&&e.keySystemConfiguration.keySystem)===k.ui})),p=l(h),f=p.next();case 8:if(f.done){A.u(10);break}return g=f.value,w(A,Fi(d,g),9);case 9:f=p.next(),A.u(8);break;case 10:d.decodingInfos.some((function(e){return e.supported}))&&(s=!0),c=u.next(),A.u(5);break;case 7:if(s)return A.return();o={ui: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=Ki(y,t,n).filter((function(e){return!(e=(e=e[0]).keySystemConfiguration&&e.keySystemConfiguration.keySystem)||!i.includes(e)})),T=l(b),x=T.next();case 15:if(x.done){v=m.next(),A.u(12);break}return S=x.value,w(A,Fi(y,S),16);case 16:x=T.next(),A.u(15)}var k}))}function Ki(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=li(u=u.value);if(c.includes(",")&&!i){var d=c.split(","),h=ui(u);c=tt("video",d),h=ri(h,d=Gi(d=tt("audio",d),h),"audio"),o.push({contentType:h,channels:2,bitrate:e.bandwidth||1,samplerate:1,spatialRendering:!1})}if(c=zi(c),u={contentType:ri(ui(u),c,"video"),width:r.width||64,height:r.height||64,bitrate:r.bandwidth||e.bandwidth||1,framerate:r.frameRate||30},r.hdr)switch(r.hdr){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=ri(u=ui(c=u.value),c=Gi(li(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,h=n.get(u),c=new Map,d=(h=l(h)).next();!d.done;d=h.next()){var p=(d=d.value).videoRobustness+","+d.audioRobustness;c.get(p)||c.set(p,[]),c.get(p).push(d)}for(h=(c=l(c.values())).next();!h.done;h=c.next()){h=h.value,d=[];for(var f=(p=l(s)).next();!f.done;f=p.next()){f=Object.assign({},f.value);for(var g={keySystem:u,initDataType:"cenc",persistentState:o,distinctiveIdentifier:"optional",sessionTypes:t},m=l(h),v=m.next();!v.done;v=m.next()){if((v=v.value).initData&&v.initData.length){for(var y=new Set,b=l(v.initData),w=b.next();!w.done;w=b.next())y.add(w.value.initDataType);g.initDataType=v.initData[0].initDataType}v.distinctiveIdentifierRequired&&(g.distinctiveIdentifier="required"),v.persistentStateRequired&&(g.persistentState="required"),v.sessionType&&(g.sessionTypes=[v.sessionType]),i&&(g.audio?(v.encryptionScheme&&(g.audio.encryptionScheme=g.audio.encryptionScheme||v.encryptionScheme),g.audio.robustness=g.audio.robustness||v.audioRobustness):(g.audio={robustness:v.audioRobustness},v.encryptionScheme&&(g.audio.encryptionScheme=v.encryptionScheme)),""==g.audio.robustness&&delete g.audio.robustness),r&&(g.video?(v.encryptionScheme&&(g.video.encryptionScheme=g.video.encryptionScheme||v.encryptionScheme),g.video.robustness=g.video.robustness||v.videoRobustness):(g.video={robustness:v.videoRobustness},v.encryptionScheme&&(g.video.encryptionScheme=v.encryptionScheme)),""==g.video.robustness&&delete g.video.robustness)}f.keySystemConfiguration=g,d.push(f)}e.push(d)}}return e}function Gi(e,t){var n=te();return"flac"==e.toLowerCase()?"WEBKIT"!=n.Da()?"flac":"fLaC":"opus"===e.toLowerCase()?"WEBKIT"!=n.Da()?"opus":"mp4"==ai(t)?"Opus":"opus":"ac-3"==e.toLowerCase()&&n.ee()?"ec-3":e}function zi(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 qi(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=t?t.groupId:null,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),p=h.next();!p.done;p=h.next())d.add(p.value);if(n)for(p=(h=l(n.roles)).next();!p.done;p=h.next())d.add(p.value);if(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:"",audioCodec:a,videoCodec:o,primary:e.primary,roles:Array.from(d),audioRoles:null,forced:!1,videoId:null,audioId:null,audioGroupId:s,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,(i=n.dependencyStream)&&(e.width=i.width||e.width,e.height=i.height||e.height,e.videoCodec=i.codecs||e.videoCodec),o.includes(","))){e.channelsCount=n.channelsCount,e.audioSamplingRate=n.audioSamplingRate,e.spatialAudio=n.spatialAudio,e.originalLanguage=n.originalLanguage,e.audioMimeType=r,n=o.split(",");try{e.videoCodec=tt("video",n),e.audioCodec=tt("audio",n)}catch(e){}}return 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,t=t.dependencyStream)&&(e.audioCodec=t.codecs||e.audioCodec),t=[],e.videoCodec&&t.push(e.videoCodec),e.audioCodec&&t.push(e.audioCodec),e.codecs=t.join(", "),e}function Xi(e){return{id:e.id,active:!1,type:rt,bandwidth:e.bandwidth||0,language:e.language,label:e.label,kind:e.kind||null,mimeType:e.mimeType,codecs:e.codecs||null,primary:e.primary,roles:e.roles,accessibilityPurpose:e.accessibilityPurpose,forced:e.forced,originalTextId:e.originalId,originalLanguage:e.originalLanguage}}function Wi(e){var t=e.width||null,n=e.height||null,i=null;e.segmentIndex&&(i=Pu(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,type:"image",bandwidth:e.bandwidth||0,width:t,height:n,mimeType:e.mimeType,codecs:e.codecs||null,tilesLayout:r||null,originalImageId:e.originalId}}function Yi(e){return e.__shaka_id||(e.__shaka_id=sr++),e.__shaka_id}function Ji(e){var t={id:Yi(e),active:"disabled"!=e.mode,type:rt,bandwidth:0,language:Di(e.language||"und"),label:e.label,kind:e.kind,mimeType:null,codecs:null,primary:!1,roles:[],accessibilityPurpose:null,forced:"forced"==e.kind,originalTextId:e.id,originalLanguage:e.language};return"captions"==e.kind&&(t.mimeType="unknown"),"subtitles"==e.kind&&(t.mimeType="text/vtt"),e.kind&&(t.roles=[e.kind]),t}function $i(e,t){var n=e?e.language:null;if(n={id:Yi(e||t),active:e?e.enabled:t.selected,type:"variant",bandwidth:0,language:Di(n||"und"),label:e?e.label:null,kind:e?e.kind:null,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:!!e&&"main"==e.kind,roles:[],forced:!1,audioRoles:null,videoId:null,audioId:null,audioGroupId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:t?t.id:null,originalAudioId:e?e.id:null,originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:n},e&&e.kind&&(n.roles=[e.kind],n.audioRoles=[e.kind]),e&&e.configuration&&(e.configuration.codec&&(n.audioCodec=e.configuration.codec,n.codecs=n.audioCodec),e.configuration.bitrate&&(n.audioBandwidth=e.configuration.bitrate,n.bandwidth+=n.audioBandwidth),e.configuration.sampleRate&&(n.audioSamplingRate=e.configuration.sampleRate),e.configuration.numberOfChannels&&(n.channelsCount=e.configuration.numberOfChannels)),t&&t.configuration&&(t.configuration.codec&&(n.videoCodec=t.configuration.codec,n.codecs=n.codecs?n.codecs+","+n.videoCodec:n.videoCodec),t.configuration.bitrate&&(n.videoBandwidth=t.configuration.bitrate,n.bandwidth+=n.videoBandwidth),t.configuration.framerate&&(n.frameRate=t.configuration.framerate),t.configuration.width&&(n.width=t.configuration.width),t.configuration.height&&(n.height=t.configuration.height),t.configuration.colorSpace&&t.configuration.colorSpace.transfer))switch(t.configuration.colorSpace.transfer){case"pq":n.hdr="PQ";break;case"hlg":n.hdr="HLG";break;case"bt709":n.hdr="SDR"}return n}function Qi(e){return e.allowedByApplication&&e.allowedByKeySystem&&0==e.disabledUntilTime}function Zi(e){return e.filter((function(e){return Qi(e)}))}function er(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=Ni(Di(t),e.map((function(e){return e.language})));s&&(r=e.filter((function(e){return Di(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(xi,[]),e.length?tr(r,e[0]):r}function tr(e,t){return e.filter((function(e){return e.roles.includes(t)}))}function nr(e,t){t.length&&(t=t.filter((function(t){return oi(e.codecs)==oi(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 ir(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"}function rr(e,t,n){if(0==n.autoShowText)return!1;if(1==n.autoShowText)return!0;var i=Di(n.preferredTextLanguage);return t=Di(t.language),2==n.autoShowText?Ii(t,i):3==n.autoShowText?!!e&&(e=Di(e.language),Ii(t,i)&&!Ii(e,t)):(q("Invalid autoShowText setting!"),!1)}function ar(e){for(var t={id:0,language:"und",disabledUntilTime:0,primary:!1,audio:null,video:null,bandwidth:100,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},n=(e=l(e)).next();!n.done;n=e.next()){var i={id:0,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:(n=n.value)?ui(n):"",codecs:n?li(n):"",encrypted:!0,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:"video",primary:!1,trickModeVideo:null,dependencyStream: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,baseOriginalId:null};i.fullMimeTypes.add(ni(i.mimeType,i.codecs)),n.startsWith("audio/")?(i.type="audio",t.audio=i):t.video=i}return t}F("shaka.util.StreamUtils",ji),ji.meetsRestrictions=_i;var or=new Map,sr=0,ur=(new Map).set("image/svg+xml",!0).set("image/png",!0).set("image/jpeg",!0).set("image/jpg",!0),lr=(new Map).set("image/webp","data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA").set("image/avif","data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=");function cr(){var t=this;this.G=null,this.o=!1,this.m=new K,this.j=new $,navigator.connection&&navigator.connection.addEventListener&&this.j.D(navigator.connection,"change",(function(){if(t.o&&t.g.useNetworkInformation){t.m=new K,t.g&&t.m.configure(t.g.advanced);var e=t.chooseVariant();e&&navigator.onLine&&t.G(e,t.g.clearBufferSwitch,t.g.safeMarginSwitch)}})),this.F=[],this.H=1,this.I=!1,this.h=this.l=this.g=this.s=null,this.A=new Ti((function(){if(t.o&&(t.g.restrictToElementSize||t.g.restrictToScreenSize)){var e=t.chooseVariant();e&&t.G(e,t.g.clearBufferSwitch,t.g.safeMarginSwitch)}})),this.B=e,"documentPictureInPicture"in e&&this.j.D(e.documentPictureInPicture,"enter",(function(){t.B=e.documentPictureInPicture.window,t.A&&t.A.Jb(),t.j.Aa(t.B,"pagehide",(function(){t.B=e,t.A&&t.A.Jb()}))})),this.C=this.i=null}function dr(e){if(!e.I){var t=e.m;if(!(t.g>=t.i))return;e.I=!0,e.s-=1e3*(e.g.switchInterval-e.g.minTimeToSwitch)}Date.now()-e.s<1e3*e.g.switchInterval||(t=e.chooseVariant(),e.getBandwidthEstimate(),t&&e.G(t,e.g.clearBufferSwitch,e.g.safeMarginSwitch))}function hr(e,t,n,i,r){if(e.C){var a=e.C.Yh();a&&(n=n.filter((function(e){return!e.bandwidth||!a||e.bandwidth<=a})))}return t&&(n=n.filter((function(e){return _i(e,t,{width:r,height:i})}))),n.sort((function(e,t){return e.bandwidth-t.bandwidth}))}(i=cr.prototype).stop=function(){this.G=null,this.o=!1,this.F=[],this.H=1,this.l=this.s=null,this.h&&(this.h.disconnect(),this.h=null),this.A.stop(),this.C=this.i=null},i.release=function(){this.j.release(),this.A=null},i.init=function(e){this.G=e},i.chooseVariant=function(){var e=1/0,t=1/0;if(this.g.restrictToScreenSize){var n=this.g.ignoreDevicePixelRatio?1:this.B.devicePixelRatio;e=this.B.screen.height*n,t=this.B.screen.width*n}if(this.h&&this.g.restrictToElementSize){n=this.g.ignoreDevicePixelRatio?1:this.B.devicePixelRatio;var i=this.l.clientHeight,r=this.l.clientWidth;this.i&&document.pictureInPictureElement&&document.pictureInPictureElement==this.l&&(i=this.i.height,r=this.i.width),e=Math.min(e,i*n),t=Math.min(t,r*n)}if((n=this.F.filter((function(e){return e&&!(e.audio&&e.audio.fastSwitching||e.video&&e.video.fastSwitching)}))).length||(n=this.F),i=n,n.length!=this.F.length&&(i=this.F.filter((function(e){return e&&!!(e.audio&&e.audio.fastSwitching||e.video&&e.video.fastSwitching)}))),n=hr(this,this.g.restrictions,i,1/0,1/0),1/0!=e||1/0!=t){for(n=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}))}(n),r=(n=l(n)).next();!r.done;r=n.next())if((r=r.value).height>=e&&r.width>=t){e=r.height,t=r.width;break}n=hr(this,this.g.restrictions,i,e,t)}for(e=this.getBandwidthEstimate(),i.length&&!n.length&&(n=[(n=hr(this,null,i,1/0,1/0))[0]]),t=n[0]||null,i=0;i<n.length;i++){r=n[i];for(var a=isNaN(this.H)?1:Math.abs(this.H),o=a*r.bandwidth/this.g.bandwidthDowngradeTarget,s={bandwidth:1/0},u=i+1;u<n.length;u++)if(r.bandwidth!=n[u].bandwidth){s=n[u];break}a=a*s.bandwidth/this.g.bandwidthUpgradeTarget,e>=o&&e<=a&&(t.bandwidth!=r.bandwidth||t.bandwidth==r.bandwidth&&t.video&&r.video&&(t.video.width<r.video.width||t.video.height<r.video.height))&&(t=r)}return this.s=Date.now(),t},i.enable=function(){this.o=!0},i.disable=function(){this.o=!1},i.segmentDownloaded=function(e,t,n,i){var r=e;this.g.removeLatencyFromFirstPacketTime&&i&&1===i.packetNumber&&i.timeToFirstByte&&(r=e-i.timeToFirstByte),r>=this.g.cacheLoadThreshold&&this.m.sample(r,t),n&&null!=this.s&&this.o&&dr(this)},i.trySuggestStreams=function(){null!=this.s&&this.o&&dr(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.m.getBandwidthEstimate(e),this.C?this.C.getBandwidthEstimate(e):e)},i.setVariants=function(e){this.F=e},i.playbackRateChanged=function(e){this.H=e},i.setMediaElement=function(t){function n(){i.A.ia(pr)}var i=this;this.l=t,this.h&&(this.h.disconnect(),this.h=null),this.l&&"ResizeObserver"in e&&(this.h=new ResizeObserver(n),this.h.observe(this.l)),this.j.D(t,"enterpictureinpicture",(function(e){e.pictureInPictureWindow&&(i.i=e.pictureInPictureWindow,i.j.D(i.i,"resize",n))})),this.j.D(t,"leavepictureinpicture",(function(){i.i&&i.j.Ja(i.i,"resize",n),i.i=null}))},i.setCmsdManager=function(e){this.C=e},i.configure=function(e){this.g=e,this.m&&this.g&&this.m.configure(this.g.advanced)},F("shaka.abr.SimpleAbrManager",cr),cr.prototype.configure=cr.prototype.configure,cr.prototype.setCmsdManager=cr.prototype.setCmsdManager,cr.prototype.setMediaElement=cr.prototype.setMediaElement,cr.prototype.playbackRateChanged=cr.prototype.playbackRateChanged,cr.prototype.setVariants=cr.prototype.setVariants,cr.prototype.getBandwidthEstimate=cr.prototype.getBandwidthEstimate,cr.prototype.trySuggestStreams=cr.prototype.trySuggestStreams,cr.prototype.segmentDownloaded=cr.prototype.segmentDownloaded,cr.prototype.disable=cr.prototype.disable,cr.prototype.enable=cr.prototype.enable,cr.prototype.chooseVariant=cr.prototype.chooseVariant,cr.prototype.init=cr.prototype.init,cr.prototype.release=cr.prototype.release,cr.prototype.stop=cr.prototype.stop;var pr=1;function fr(e,t){if(e===t||!e.length||!t.length)return!0;for(var n=(e=l(e)).next();!n.done;n=e.next()){if(yr(n=n.value))return!0;for(var i=l(t),r=i.next();!r.done;r=i.next())if(r=r.value,n.keySystem===r.keySystem||yr(r))return!0}return!1}function gr(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}yr(i)?n.push(i):yr(a)&&n.push(a)}}return n}function mr(e){return!!e&&!!e.match(/^com\.(microsoft|chromecast)\.playready/)}function vr(e){return!!e&&!!e.match(/^com\.apple\.fps/)}function yr(e){return!!(e=e.licenseServerUri)&&e.startsWith("data:application/json;base64,")}F("shaka.config.CrossBoundaryStrategy",{KEEP:"keep",RESET:"reset",RESET_TO_ENCRYPTED:"reset_to_encrypted",RESET_ON_ENCRYPTION_CHANGE:"RESET_ON_ENCRYPTION_CHANGE"});var br=new ee((function(){return Me(new Uint8Array([0]))})),wr=new Map;function Tr(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 xr(e){var t,n;return R((function(i){if(1==i.g){if(e.g>=e.l){if(!e.i)throw new Ne(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 Ti(e).ia(n/1e3)})),2))}e.h*=e.m,T(i)}))}function Sr(){var e,t,n=new Promise((function(n,i){e=n,t=i}));return n.resolve=e,n.reject=t,n}function Ar(e,t){this.promise=e,this.i=t,this.g=null}function kr(e){return new Ar(Promise.reject(e),(function(){return Promise.resolve()}))}function Er(){var e=Promise.reject(new Ne(2,7,7001));return e.catch((function(){})),new Ar(e,(function(){return Promise.resolve()}))}function Ir(e){return new Ar(Promise.resolve(e),(function(){return Promise.resolve()}))}function Cr(e){return new Ar(e,(function(){return e.catch((function(){}))}))}function Mr(e){return new Ar(Promise.all(e.map((function(e){return e.promise}))),(function(){return Promise.all(e.map((function(e){return e.abort()})))}))}function Dr(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 Pr(e){var t,n=new Dr(e.type);for(t in e)Object.defineProperty(n,t,{value:e[t],writable:!0,enumerable:!0});return n}Sr.prototype.resolve=function(){},Sr.prototype.reject=function(){},Ar.prototype.abort=function(){return this.g||(this.g=this.i()),this.g},Ar.prototype.finally=function(e){return this.promise.then((function(){return e(!0)}),(function(){return e(!1)})),this},Ar.prototype.Va=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 Sr;a.catch((function(){}));var o=new Ne(2,7,7001);return this.promise.then(n(!0),n(!1)),new Ar(a,(function(){return i()}))},o.Object.defineProperties(Ar.prototype,{aborted:{configurable:!0,enumerable:!0,get:function(){return null!==this.g}}}),F("shaka.util.AbortableOperation",Ar),Ar.prototype.chain=Ar.prototype.Va,Ar.prototype.finally=Ar.prototype.finally,Ar.all=Mr,Ar.prototype.abort=Ar.prototype.abort,Ar.notAbortable=Cr,Ar.completed=Ir,Ar.aborted=Er,Ar.failed=kr,Dr.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)},Dr.prototype.stopImmediatePropagation=function(){this.g=!0},Dr.prototype.stopPropagation=function(){},F("shaka.util.FakeEvent",Dr);var Rr={jl:"abrstatuschanged",kl:"adaptation",ll:"audiotrackchanged",ol:"audiotrackschanged",ql:"boundarycrossed",rl:"buffering",ul:"canupdatestarttime",vl:"complete",wl:"currentitemchanged",xl:"downloadcompleted",yl:"downloadfailed",zl:"downloadheadersreceived",Al:"drmsessionupdate",Cl:"emsg",Il:"itemsinserted",Jl:"itemsremoved",Zl:"prft",Error:"error",Dl:"expirationupdated",El:"firstquartile",Fl:"gapjumped",Kl:"keystatuschanged",Ol:"loaded",Pl:"loading",Rl:"manifestparsed",Sl:"manifestupdated",Tl:"mediaqualitychanged",Ul:"mediasourcerecovered",Vl:"metadataadded",Metadata:"metadata",Wl:"midpoint",Xl:"nospatialvideoinfo",Yl:"onstatechange",$l:"ratechange",cm:"segmentappended",dm:"sessiondata",em:"spatialvideoinfo",fm:"stalldetected",gm:"started",hm:"statechanged",im:"streaming",jm:"textchanged",lm:"texttrackvisibility",mm:"thirdquartile",nm:"timelineregionadded",om:"timelineregionenter",pm:"timelineregionexit",qm:"trackschanged",sm:"unloading",um:"variantchanged"};function Lr(){this.Ya=new J,this.ze=this}function Nr(){this.g=[]}function Or(e,t){e.g.push(t.finally((function(){Ct(e.g,t)})))}function jr(e,t,n,i,r,a,o){Lr.call(this),this.i=null,this.j=!1,this.s=new Nr,this.g=new Set,this.h=new Set,this.o=e||null,this.m=t||null,this.A=n||null,this.B=i||null,this.C=r||null,this.G=a||null,this.F=o||null,this.l=new Map}function Ur(e,t,n,i){i=void 0!==i&&i,n=n||zr;var r=qr.get(e);(!r||n>=r.priority)&&qr.set(e,{priority:n,wf:t,Ak:i})}function _r(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 Br(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 Fr(e,t,n,i,r,a,o,s){e.i.forceHTTP&&(n.uris[a]=n.uris[a].replace("https://","http://")),e.i.forceHTTPS&&(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 de(n.uris[a]),l=u.cc,c=!1;l||(he(u,l=(l=location.protocol).slice(0,-1)),n.uris[a]=u.toString()),l=l.toLowerCase();var d=(l=qr.get(l))?l.wf:null;if(!d)return kr(new Ne(2,1,1e3,u));var h=l.Ak;(u=e.l.get(u.Cb))&&(n.headers["common-access-token"]=u);var p,f=null,g=null,m=!1,v=!1;return Cr(xr(r)).Va((function(){if(e.j)return Er();p=Date.now();var r=0;n.requestStartTime=Date.now();var o=d(n.uris[a],n,t,(function(a,o,u){f&&f.stop(),g&&g.ia(l/1e3),e.o&&t==Gr&&(r++,n.packetNumber=r,e.o(a,o,Vr(i),n,i),c=!0,s.g=u)}),(function(i){v=!0,n.timeToFirstByte=Date.now()-n.requestStartTime,e.m&&e.m(i,n,t)}),{minBytesForProgressEvents:e.i.minBytesForProgressEvents});if(!h)return o;var u=n.retryParameters.connectionTimeout;u&&(f=new Ti((function(){m=!0,o.abort()}))).ia(u/1e3);var l=n.retryParameters.stallTimeout;return l&&(g=new Ti((function(){m=!0,o.abort()}))),o})).Va((function(i){f&&f.stop(),g&&g.stop(),null==i.timeMs&&(i.timeMs=Date.now()-p);var r=i.headers["common-access-token"];if(r){var a=new de(i.uri);e.l.set(a.Cb,r)}return r={response:i,$j:c},!v&&e.m&&e.m(i.headers,n,t),e.A&&e.A(n,i),r}),(function(u){if(f&&f.stop(),g&&g.stop(),e.B){var l=null,c=0;u instanceof Ne&&(l=u,1001==u.code&&(c=u.data[1])),e.B(n,l,c,m)}if(e.j)return Er();if(m&&(u=new Ne(1,1,1003,n.uris[a],t)),u instanceof Ne){if(7001==u.code)throw u;if(1010==u.code)throw o;if(1==u.severity){if((l=new Dr("retry",l=(new Map).set("error",u))).cancelable=!0,e.dispatchEvent(l),l.defaultPrevented)throw u;return a=(a+1)%n.uris.length,Fr(e,t,n,i,r,a,u,s)}}throw u}))}function Vr(e){if(e){var t=e.segment;if(e=e.stream,t&&e&&e.fastSwitching&&t.o)return!1}return!0}function Hr(){this.g=0}function Kr(e,t,n){Ar.call(this,e,t),this.h=n}Lr.prototype.addEventListener=function(e,t){this.Ya&&this.Ya.push(e,t)},Lr.prototype.removeEventListener=function(e,t){this.Ya&&this.Ya.remove(e,t)},Lr.prototype.dispatchEvent=function(e){if(!this.Ya)return!0;var t=this.Ya.get(e.type)||[],n=this.Ya.get("All");for(n&&(t=t.concat(n)),n=(t=l(t)).next();!n.done;n=t.next()){n=n.value,e.target=this.ze,e.currentTarget=this.ze;try{n.handleEvent?n.handleEvent(e):n.call(this,e)}catch(e){}if(e.g)break}return e.defaultPrevented},Lr.prototype.release=function(){this.Ya=null},Nr.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(jr,Lr),(i=jr.prototype).configure=function(e){this.i=e},i.Dk=function(e){this.g.add(e)},i.Zk=function(e){this.g.delete(e)},i.kj=function(){this.g.clear()},i.Ek=function(e){this.h.add(e)},i.$k=function(e){this.h.delete(e)},i.lj=function(){this.h.clear()},i.Mh=function(){this.l.clear()},i.destroy=function(){return this.j=!0,this.g.clear(),this.h.clear(),this.l.clear(),Lr.prototype.release.call(this),this.s.destroy()},i.request=function(e,t,n){var i=this,r=new Hr;if(this.j){var a=Promise.reject(new Ne(2,7,7001));return a.catch((function(){})),new Kr(a,(function(){return Promise.resolve()}),r)}t.method=t.method||"GET",t.headers=t.headers||{},t.retryParameters=t.retryParameters?Bt(t.retryParameters):{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4},t.uris=Bt(t.uris),a=function(e,t,n,i){function r(e){a=a.Va((function(){return n.body&&(n.body=Me(n.body)),e(t,n,i)}))}var a=Ir(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.Va(void 0,(function(e){if(e instanceof Ne&&7001==e.code)throw e;throw new Ne(2,1,1006,e)}))}(this,e,t,n);var o=a.Va((function(){return Fr(i,e,t,n,new Tr(t.retryParameters,!1),0,null,r)})),s=o.Va((function(t){return function(e,t,n,i){for(var r=Ir(void 0),a=(e=l(e.h)).next(),o={};!a.done;o={Di:void 0},a=e.next())o.Di=a.value,r=r.Va(function(e){return function(){var r=n.response;return r.data&&(r.data=Me(r.data)),(0,e.Di)(t,r,i)}}(o));return r.Va((function(){return n}),(function(e){var t=2;if(e instanceof Ne){if(7001==e.code)throw e;t=e.severity}throw new Ne(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.Va((function(r){var a=Date.now()-d,o=r.response;return o.timeMs+=c,o.timeMs+=a,r.$j||!i.o||o.fromCache||"HEAD"==t.method||e!=Gr||i.o(o.timeMs,o.data.byteLength,Vr(n),t,n),i.F&&i.F(e,o,n),o}),(function(e){throw e&&(e.severity=2),e}));return a=new Kr(h.promise,(function(){return h.abort()}),r),Or(this.s,a),a},F("shaka.net.NetworkingEngine",jr),jr.prototype.request=jr.prototype.request,jr.prototype.destroy=jr.prototype.destroy,jr.makeRequest=Br,jr.defaultRetryParameters=function(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4}},jr.prototype.clearCommonAccessTokenMap=jr.prototype.Mh,jr.prototype.clearAllResponseFilters=jr.prototype.lj,jr.prototype.unregisterResponseFilter=jr.prototype.$k,jr.prototype.registerResponseFilter=jr.prototype.Ek,jr.prototype.clearAllRequestFilters=jr.prototype.kj,jr.prototype.unregisterRequestFilter=jr.prototype.Zk,jr.prototype.registerRequestFilter=jr.prototype.Dk,jr.unregisterScheme=function(e){qr.delete(e)},jr.registerScheme=Ur,jr.prototype.configure=jr.prototype.configure,jr.NumBytesRemainingClass=Hr,m(Kr,Ar),jr.PendingRequest=Kr;var Gr=1;jr.RequestType={MANIFEST:0,SEGMENT:Gr,LICENSE:2,APP:3,TIMING:4,SERVER_CERTIFICATE:5,KEY:6,ADS:7,CONTENT_STEERING:8},jr.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 zr=3;jr.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:zr};var qr=new Map;function Xr(e){this.g=!1,this.h=new Sr,this.i=e}function Wr(e,t){if(e.g){if(t instanceof Ne&&7003==t.code)throw t;throw new Ne(2,7,7003,t)}}function Yr(e,t){for(var n=[],i=(e=l(e)).next();!i.done;i=e.next())n.push(t(i.value));return n}function Jr(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 $r(e){var t={};return e.forEach((function(e,n){t[n]=e})),t}function Qr(e,t){this.h=Re(e),this.i=t==ea,this.g=0}function Zr(){return new Ne(2,3,3e3)}Xr.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=Qr.prototype).Ga=function(){return this.g<this.h.byteLength},i.Ma=function(){return this.g},i.getLength=function(){return this.h.byteLength},i.X=function(){try{var e=this.h.getUint8(this.g);return this.g+=1,e}catch(e){throw Zr()}},i.Ba=function(){try{var e=this.h.getUint16(this.g,this.i);return this.g+=2,e}catch(e){throw Zr()}},i.T=function(){try{var e=this.h.getUint32(this.g,this.i);return this.g+=4,e}catch(e){throw Zr()}},i.Yg=function(){try{var e=this.h.getInt32(this.g,this.i);return this.g+=4,e}catch(e){throw Zr()}},i.yd=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 Zr()}if(2097151<t)throw new Ne(2,3,3001);return this.g+=8,t*Math.pow(2,32)+e},i.Ub=function(e){if(this.g+e>this.h.byteLength)throw Zr();var t=De(this.h,this.g,e);return this.g+=e,t},i.skip=function(e){if(this.g+e>this.h.byteLength)throw Zr();this.g+=e},i.Ei=function(e){if(this.g<e)throw Zr();this.g-=e},i.seek=function(e){if(0>e||e>this.h.byteLength)throw Zr();this.g=e},i.Vc=function(){for(var e=this.g;this.Ga()&&0!=this.h.getUint8(this.g);)this.g+=1;return e=De(this.h,e,this.g-e),this.g+=1,Ue(e)},F("shaka.util.DataViewReader",Qr),Qr.prototype.readTerminatedString=Qr.prototype.Vc,Qr.prototype.seek=Qr.prototype.seek,Qr.prototype.rewind=Qr.prototype.Ei,Qr.prototype.skip=Qr.prototype.skip,Qr.prototype.readBytes=Qr.prototype.Ub,Qr.prototype.readUint64=Qr.prototype.yd,Qr.prototype.readInt32=Qr.prototype.Yg,Qr.prototype.readUint32=Qr.prototype.T,Qr.prototype.readUint16=Qr.prototype.Ba,Qr.prototype.readUint8=Qr.prototype.X,Qr.prototype.getLength=Qr.prototype.getLength,Qr.prototype.getPosition=Qr.prototype.Ma,Qr.prototype.hasMoreData=Qr.prototype.Ga;var ea=1;function ta(){this.i=new Map,this.h=new Map,this.g=!1}function na(e){for(var t=la(e);e.reader.Ga()&&!e.parser.g;)e.parser.td(e.start+t,e.reader,e.partialOkay,e.stopOnPartial)}function ia(e){for(var t=la(e),n=e.reader.T(),i=0;i<n&&(e.parser.td(e.start+t,e.reader,e.partialOkay,e.stopOnPartial),!e.parser.g);i++);}function ra(e){var t=la(e);for(e.reader.skip(78);e.reader.Ga()&&!e.parser.g;)e.parser.td(e.start+t,e.reader,e.partialOkay,e.stopOnPartial)}function aa(e){var t=la(e);e.reader.skip(8);var n=e.reader.Ba();for(e.reader.skip(6),2==n?e.reader.skip(48):e.reader.skip(12),1==n&&e.reader.skip(16);e.reader.Ga()&&!e.parser.g;)e.parser.td(e.start+t,e.reader,e.partialOkay,e.stopOnPartial)}function oa(e){return function(t){e(t.reader.Ub(t.reader.getLength()-t.reader.Ma()))}}function sa(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 ua(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)}function la(e){return 8+(e.has64BitSize?8:0)+(null!=e.flags?4:0)}Qr.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:ea},(i=ta.prototype).box=function(e,t){return e=sa(e),this.i.set(e,ca),this.h.set(e,t),this},i.R=function(e,t){return e=sa(e),this.i.set(e,da),this.h.set(e,t),this},i.stop=function(){this.g=!0},i.parse=function(e,t,n){for(e=new Qr(e,0),this.g=!1;e.Ga()&&!this.g;)this.td(0,e,t,n)},i.td=function(e,t,n,i){var r=t.Ma();if(i&&r+8>t.getLength())this.g=!0;else{var a=t.T(),o=t.T(),s=ua(o),u=!1;switch(a){case 0:a=t.getLength()-r;break;case 1:if(i&&t.Ma()+8>t.getLength())return void(this.g=!0);a=t.yd(),u=!0}var l=this.h.get(o);if(l){var c=null,d=null;if(this.i.get(o)==da){if(i&&t.Ma()+4>t.getLength())return void(this.g=!0);c=(d=t.T())>>>24,d&=16777215}o=r+a,n&&o>t.getLength()&&(o=t.getLength()),i&&o>t.getLength()?this.g=!0:(o-=t.Ma(),l({name:s,parser:this,partialOkay:n||!1,stopOnPartial:i||!1,version:c,flags:d,reader:t=new Qr(t=0<o?t.Ub(o):new Uint8Array(0),0),size:a,start:r+e,has64BitSize:u}))}else t.skip(Math.min(r+a-t.Ma(),t.getLength()-t.Ma()))}},F("shaka.util.Mp4Parser",ta),ta.headerSize=la,ta.typeToString=ua,ta.allData=oa,ta.audioSampleEntry=aa,ta.visualSampleEntry=ra,ta.sampleDescription=ia,ta.children=na,ta.prototype.parseNext=ta.prototype.td,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 ca=0,da=1;function ha(e){var t=this;this.g=[],this.h=[],this.data=[],(new ta).box("moov",na).box("moof",na).R("pssh",(function(e){if(!(1<e.version)){var n=De(e.reader.h,-12,e.size);if(t.data.push(n),t.g.push(Je(e.reader.Ub(16))),0<e.version){n=e.reader.T();for(var i=0;i<n;i++){var r=Je(e.reader.Ub(16));t.h.push(r)}}}})).parse(e)}function pa(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=Re(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=Ye(n.value),o.set(n,u),u+=n.length;return s.setUint32(u,r),o.set(e,u+4),o}function fa(e){var t=this;this.C=e,this.j=this.A=null,this.na=this.P=!1,this.I=0,this.g=null,this.o=new $,this.i=new Map,this.U=[],this.B=new Map,this.K=!1,this.l=new Sr,this.h=null,this.s=function(n){2==n.severity&&t.l.reject(n),e.onError(n)},this.ba=new Map,this.ka=new Map,this.L=new Ti((function(){return function(e){var t=e.ba,n=e.ka;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 Ne(2,6,6014)),e.C.rf($r(n))}(t)})),this.N=!1,this.M=[],this.W=!1,this.F=new Ti((function(){!function(e){e.i.forEach((function(t,n){var i=t.Tg,r=n.expiration;isNaN(r)&&(r=1/0),r!=i&&(e.C.onExpirationUpdated(n.sessionId,r),t.Tg=r)}))}(t)})),this.l.catch((function(){})),this.m=new Xr((function(){return function(e){return R((function(t){switch(t.g){case 1:return e.o.release(),e.o=null,e.l.reject(),e.F.stop(),e.F=null,e.L.stop(),e.L=null,w(t,Ca(e),2);case 2:if(!e.j){t.u(3);break}return x(t,4),w(t,e.j.setMediaKeys(null),6);case 6:A(t,5);break;case 4:k(t);case 5:e.j=null;case 3:e.g=null,e.A=null,e.B=new Map,e.h=null,e.s=function(){},e.C=null,e.ha=!1,e.H=null,T(t)}}))}(t)})),this.ha=!1,this.G=this.H=null,this.S=function(){return!1}}function ga(e,t,n,i){i=void 0===i||i,e.B=new Map;for(var r=(n=l(n)).next();!r.done;r=n.next())e.B.set(r.value,{initData:null,initDataType:null});for(r=(n=l(e.h.persistentSessionsMetadata)).next();!r.done;r=n.next())r=r.value,e.B.set(r.sessionId,{initData:r.initData,initDataType:r.initDataType});return e.N=0<e.B.size,ma(e,t,i)}function ma(e,t,n){var i,r,a,o,s,u,c,d,h,p,f,g,m,v,y,b,T;return R((function(x){if(1==x.g){for(Ra(e.h.clearKeys,t),i=t.some((function(e){return!!(e.video&&e.video.drmInfos.length||e.audio&&e.audio.drmInfos.length)})),r=Jr(e.h.servers),a=Jr(e.h.advanced||{}),!i&&n&&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,r),o=new WeakSet,s=l(t),u=s.next();!u.done;u=s.next())for(c=u.value,d=Ma(c),h=l(d),p=h.next();!p.done;p=h.next())f=p.value,o.has(f)||(o.add(f),Pa(f,r,a,e.h.keySystemsMapping));for(g=function(t,n){for(var i=[],r=(t=l(t)).next();!r.done;r=t.next()){var o,s=(r=r.value)[n]||a.has(r.keySystem)&&a.get(r.keySystem)[n]||"";if((o=""==s)&&(o=!!(o=r.keySystem)&&!!o.match(/^com\.widevine\.alpha/)),o&&("audioRobustness"==n?s=[e.h.defaultAudioRobustnessForWidevine]:"videoRobustness"==n&&(s=[e.h.defaultVideoRobustnessForWidevine])),"string"==typeof s)i.push(r);else if(Array.isArray(s))for(0===s.length&&(s=[""]),o=(s=l(s)).next();!o.done;o=s.next()){var u={};i.push(Object.assign({},r,(u[n]=o.value,u)))}}return i},m=new WeakSet,v=l(t),y=v.next();!y.done;y=v.next())(b=y.value).video&&!m.has(b.video)&&(b.video.drmInfos=g(b.video.drmInfos,"videoRobustness"),b.video.drmInfos=g(b.video.drmInfos,"audioRobustness"),m.add(b.video)),b.audio&&!m.has(b.audio)&&(b.audio.drmInfos=g(b.audio.drmInfos,"videoRobustness"),b.audio.drmInfos=g(b.audio.drmInfos,"audioRobustness"),m.add(b.audio));return w(x,Hi(t,e.N,e.ha,e.h.preferredKeySystems),2)}return Wr(e.m),i||0<r.size?(T=Ta(e,t),x.return(i?T:T.catch((function(){})))):(e.P=!0,x.return(Promise.resolve()))}))}function va(e){var t;return R((function(n){switch(n.g){case 1:if(e.j.mediaKeys)return n.return();if(!e.H){n.u(2);break}return w(n,e.H,3);case 3:return Wr(e.m),n.return();case 2:return x(n,4),e.H=e.j.setMediaKeys(e.A),w(n,e.H,6);case 6:A(n,5);break;case 4:t=k(n),e.s(new Ne(2,6,6003,t.message));case 5:Wr(e.m),T(n)}}))}function ya(e){var t,n,i,r;return R((function(a){if(1==a.g)return e.B.size?(e.B.forEach((function(t,n){Aa(e,n,t)})),w(a,e.l,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.ba.get(n.value))return!1;return!0}(e))return a.return(e.l);e.K=!1,e.l=new Sr,e.l.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 Da(e)&&e.l.resolve(),a.return(e.l)}))}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(Ce(n,r.value.initData))return;var a=!1;if(e.B.forEach((function(e){!a&&Ce(n,e.initData)&&(a=!0)})),a)return}e.K=!0,0<e.i.size&&Da(e)&&(e.l.resolve(),e.K=!1,e.l=new Sr,e.l.catch((function(){}))),function(e,t,n,i){try{var r=e.A.createSession(i)}catch(t){return void e.s(new Ne(2,6,6005,t.message))}e.o.D(r,"message",(function(t){e.j&&e.h.delayLicenseRequestUntilPlayed&&e.j.paused&&!e.W?e.M.push(t):ka(e,t)})),e.o.D(r,"keystatuseschange",(function(t){return Ea(e,t)})),e.i.set(r,{initData:n,initDataType:t,loaded:!1,Tg:1/0,Kb:null,type:i});try{n=e.h.initDataTransform(n,t,e.g)}catch(n){return t=n,n instanceof Ne||(t=new Ne(2,6,6016,n)),void e.s(t)}e.h.logLicenseExchange&&Xe(n),r.generateRequest(t,n).catch((function(t){if(!e.m.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 Ne(2,6,6006,t.message,t,i))}}))}(e,t,n,e.g.sessionType)}}function wa(e){return e=Yr(e=e.i.keys(),(function(e){return e.sessionId})),Array.from(e)}function Ta(t,n){var i,r,a,o,s,u;return R((function(d){switch(d.g){case 1:if(i=new Map,r=function(e,t,n){for(var i=l(t),r=i.next();!r.done;r=i.next())for(var a=(r=l(Ma(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 Ne(2,6,6e3);(i=e.h.preferredKeySystems).length||1==(r=Jr(e.h.servers)).size&&(i=Array.from(r.keys()));var o=(r=l(i)).next();for(a={};!o.done;a={wi:void 0},o=r.next()){a.wi=o.value;for(var s=(o=l(t)).next();!s.done;s=o.next())if(s=s.value.decodingInfos.find(function(e){return function(t){return t.supported&&null!=t.keySystemAccess&&t.keySystemAccess.keySystem==e.wi}}(a)))return s.keySystemAccess}for(a=(r=l([!0,!1])).next();!a.done;a=r.next())for(a=a.value,s=(o=l(t)).next();!s.done;s=o.next())for(var u=(s=l(s.value.decodingInfos)).next();!u.done;u=s.next())if((u=u.value).supported&&u.keySystemAccess){var c=u.keySystemAccess.keySystem;if(!i.includes(c)){var d=n.get(c);for(!d&&e.h.keySystemsMapping[c]&&(d=n.get(e.h.keySystemsMapping[c])),d=(c=l(d)).next();!d.done;d=c.next())if(!!d.value.licenseServerUri==a)return u.keySystemAccess}}return null}(t,n,i),!r){if(!navigator.requestMediaKeySystemAccess)throw new Ne(2,6,6020);throw new Ne(2,6,6001)}Wr(t.m),x(d,2),r.getConfiguration();var h=a=t.h.keySystemsMapping[r.keySystem]||r.keySystem,p=i.get(a),f=[],g=[],m=[],v=[],y=[],b=new Set,T=new Set;!function(t,n,i,r,a,o,s,u){for(var d=[],h=(t=l(t)).next(),p={};!h.done;p={Ha:void 0},h=t.next()){if(p.Ha=h.value,n.includes(p.Ha.encryptionScheme)||n.push(p.Ha.encryptionScheme),"org.w3.clearkey"==p.Ha.keySystem&&p.Ha.licenseServerUri.startsWith("data:application/json;base64,")?d.includes(p.Ha.licenseServerUri)||d.push(p.Ha.licenseServerUri):i.includes(p.Ha.licenseServerUri)||i.push(p.Ha.licenseServerUri),a.includes(p.Ha.serverCertificateUri)||a.push(p.Ha.serverCertificateUri),p.Ha.serverCertificate&&(r.some(function(e){return function(t){return Ce(t,e.Ha.serverCertificate)}}(p))||r.push(p.Ha.serverCertificate)),p.Ha.initData)for(var f=(h=l(p.Ha.initData)).next(),g={};!f.done;g={Kg:void 0},f=h.next())g.Kg=f.value,o.some(function(e){return function(t){var n=e.Kg;return!(!t.keyId||t.keyId!=n.keyId)||t.initDataType==n.initDataType&&Ce(t.initData,n.initData)}}(g))||o.push(g.Kg);if(p.Ha.keyIds)for(f=(h=l(p.Ha.keyIds)).next();!f.done;f=h.next())s.add(f.value);if(p.Ha.keySystemUris&&u)for(h=(p=l(p.Ha.keySystemUris)).next();!h.done;h=p.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))}}(p,f,g,v,m,y,b,T);var S=t.N?"persistent-license":"temporary";for(h={keySystem:h,encryptionScheme:f[0],licenseServerUri:g[0],distinctiveIdentifierRequired:p[0].distinctiveIdentifierRequired,persistentStateRequired:p[0].persistentStateRequired,sessionType:p[0].sessionType||S,audioRobustness:p[0].audioRobustness||"",videoRobustness:p[0].videoRobustness||"",serverCertificate:v[0],serverCertificateUri:m[0],initData:y,keyIds:b},0<T.size&&(h.keySystemUris=T),T=(p=l(p)).next();!T.done;T=p.next())(T=T.value).distinctiveIdentifierRequired&&(h.distinctiveIdentifierRequired=T.distinctiveIdentifierRequired),T.persistentStateRequired&&(h.persistentStateRequired=T.persistentStateRequired);if(t.g=h,!t.g.licenseServerUri)throw new Ne(2,6,6012,t.g.keySystem);return w(d,r.createMediaKeys(),4);case 4:if(o=d.h,Wr(t.m),t.A=o,""==t.h.minHdcpVersion||!("getStatusForPolicy"in t.A)){d.u(5);break}return x(d,6),w(d,t.A.getStatusForPolicy({minHdcpVersion:t.h.minHdcpVersion}),8);case 8:if("usable"!=d.h)throw new Ne(2,6,6018);Wr(t.m),A(d,5,2);break;case 6:if((s=k(d,2))instanceof Ne)throw s;throw new Ne(2,6,6019,s.message);case 5:return t.P=!0,t.F.Fa(t.h.updateExpirationTime),w(d,function(e){var t,n;return R((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=Br([e.g.serverCertificateUri],e.h.retryParameters),x(i,3),w(i,e.C.pc.request(5,t,{isPreload:e.S()}).promise,5);case 5:n=i.h,e.g.serverCertificate=De(n.data),A(i,4);break;case 3:throw new Ne(2,6,6017,k(i));case 4:if(e.m.g)return i.return();case 2:return e.g.serverCertificate&&e.g.serverCertificate.length?(x(i,6),w(i,e.A.setServerCertificate(e.g.serverCertificate),8)):i.return();case 8:A(i,0);break;case 6:throw new Ne(2,6,6004,k(i).message)}}))}(t),9);case 9:Wr(t.m),A(d,0);break;case 2:if(u=k(d),Wr(t.m,u),t.g=null,u instanceof Ne)throw u;throw new Ne(2,6,6002,u.message)}}))}function xa(e){Da(e)&&e.l.resolve()}function Sa(e,t){new Ti((function(){t.loaded=!0,xa(e)})).ia(Na)}function Aa(e,t,n){var i,r,a,o,s,u,l;return R((function(c){switch(c.g){case 1:try{i=e.A.createSession("persistent-license")}catch(t){return r=new Ne(2,6,6005,t.message),e.s(r),c.return(Promise.reject(r))}return e.o.D(i,"message",(function(t){e.j&&e.h.delayLicenseRequestUntilPlayed&&e.j.paused&&!e.W?e.M.push(t):ka(e,t)})),e.o.D(i,"keystatuseschange",(function(t){return Ea(e,t)})),a={initData:n.initData,initDataType:n.initDataType,loaded:!1,Tg:1/0,Kb:null,type:"persistent-license"},e.i.set(i,a),x(c,2),w(c,i.load(t),4);case 4:return o=c.h,Wr(e.m),o||(e.i.delete(i),s=e.h.persistentSessionOnlinePlayback?1:2,e.s(new Ne(s,6,6013)),a.loaded=!0),Sa(e,a),xa(e),c.return(i);case 2:u=k(c),Wr(e.m,u),e.i.delete(i),l=e.h.persistentSessionOnlinePlayback?1:2,e.s(new Ne(l,6,6005,u.message)),a.loaded=!0,xa(e);case 3:return c.return(Promise.resolve())}}))}function ka(e,t){var n,i,r,a,o,s,u,c,d,h,p,f,g,m;R((function(v){switch(v.g){case 1:if(n=t.target,e.h.logLicenseExchange&&Xe(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=Br([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("org.w3.clearkey"===e.g.keySystem){var y=o,b=e.g;try{var S=Be(y.body);if(S){var E=JSON.parse(S);E.type||(E.type=b.sessionType,y.body=Fe(JSON.stringify(E)))}}catch(e){}}if(mr(e.g.keySystem))if((y=_e(o.body,!0,!0)).includes("PlayReadyKeyMessage")){for(S=(b=l(b=Jt(y=Kt(y,"PlayReadyKeyMessage"),"HttpHeader"))).next();!S.done;S=b.next())S=Jt(E=S.value,"name")[0],E=Jt(E,"value")[0],o.headers[Wt(S)]=Wt(E);y=Jt(y,"Challenge")[0],o.body=We(Wt(y))}else o.headers["Content-Type"]="text/xml; charset=utf-8";return u=Date.now(),x(v,2),d=e.C.pc.request(2,o,{isPreload:e.S()}),e.U.push(d),w(v,d.promise,4);case 4:c=v.h,Ct(e.U,d),A(v,3);break;case 2:return h=k(v),e.m.g||(p=new Ne(2,6,6007,h),1==e.i.size?(e.s(p),i&&i.Kb&&i.Kb.reject(p)):(i&&i.Kb&&i.Kb.reject(p),e.i.delete(n),Da(e)&&(e.l.resolve(),e.L.ia(.1)))),v.return();case 3:return e.m.g?v.return():(e.I+=(Date.now()-u)/1e3,e.h.logLicenseExchange&&Xe(c.data),x(v,5),w(v,n.update(c.data),7));case 7:A(v,6);break;case 5:return f=k(v),g=new Ne(2,6,6008,f.message),e.s(g),i&&i.Kb&&i.Kb.reject(g),v.return();case 6:if(e.m.g)return v.return();m=new Dr("drmsessionupdate"),e.C.onEvent(m),i&&(i.Kb&&i.Kb.resolve(),Sa(e,i)),T(v)}}))}function Ea(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(a=te(),mr(e.g.keySystem)&&16==r.byteLength&&a.fh()){var o=(a=Re(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=Je(r).slice(0,32),e.ba.set(r,t)}));var r=t.expiration-Date.now();(0>r||i&&1e3>r)&&n&&!n.Kb&&(e.i.delete(t),Ia(t)),Da(e)&&(e.l.resolve(),e.L.ia(Oa))}function Ia(e){return R((function(t){return 1==t.g?(x(t,2),w(t,ki(La,Promise.all([e.close().catch((function(){})),e.closed])),4)):2!=t.g?A(t,0):(k(t),void T(t))}))}function Ca(e){var t;return R((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 R((function(t){return 1==t.g?(x(t,2),e.na||e.B.has(n.sessionId)||"persistent-license"!==i.type||e.h.persistentSessionOnlinePlayback?w(t,Ia(n),5):w(t,n.remove(),5)):2!=t.g?A(t,0):(k(t),void T(t))}))}))),0)}))}function Ma(e){return(e.video?e.video.drmInfos:[]).concat(e.audio?e.audio.drmInfos:[])}function Da(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 Pa(t,n,i,r){var a=t.keySystem;!a||"org.w3.clearkey"==a&&t.licenseServerUri||(n.size&&n.get(a)&&(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.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"))}function Ra(e,t){if(0!=(e=Jr(e)).size){e=et(e);for(var n=(t=l(t)).next();!n.done;n=t.next())(n=n.value).video&&(n.video.drmInfos=[e]),n.audio&&(n.audio.drmInfos=[e])}}(i=fa.prototype).destroy=function(){return this.m.destroy()},i.configure=function(e,t){this.h=e,t&&(this.S=t),this.F&&this.P&&this.g&&this.F.Fa(this.h.updateExpirationTime)},i.fc=function(e){var t,n=this;return R((function(i){if(1==i.g)return n.j===e?i.return():n.A?(n.j=e,n.o.Aa(n.j,"play",(function(){for(var e=l(n.M),t=e.next();!t.done;t=e.next())ka(n,t.value);n.W=!0,n.M=[]})),n.j.remote?(n.o.D(n.j.remote,"connect",(function(){return Ca(n)})),n.o.D(n.j.remote,"connecting",(function(){return Ca(n)})),n.o.D(n.j.remote,"disconnect",(function(){return Ca(n)}))):"webkitCurrentPlaybackTargetIsWireless"in n.j&&n.o.D(n.j,"webkitcurrentplaybacktargetiswirelesschanged",(function(){return Ca(n)})),n.G=n.g&&n.g.initData.find((function(e){return 0<e.initData.length}))||null,t=n.g.keySystem,te().Qg(t)||!(n.G||n.B.size||n.h.parseInbandPsshEnabled)?(n.o.D(n.j,"encrypted",(function(e){return function(e,t){return R((function(n){if(1==n.g)return w(n,va(e),2);ba(e,t.initDataType,De(t.initData)),T(n)}))}(n,e)})),i.u(2)):w(i,va(n),2)):(n.o.Aa(e,"encrypted",(function(){n.s(new Ne(2,6,6010))})),i.return());ya(n).catch((function(){})),T(i)}))},i.Eg=function(){var e=this,t=this.i.keys();return t=Yr(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.Pd=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.Te=function(){return $r(this.ka)};var La=1,Na=5,Oa=.5;function ja(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 Ua(e,t){if(e.mimeType!=t.mimeType)return!1;if(e=e.codecs.split(",").map((function(e){return si(e)})),t=t.codecs.split(",").map((function(e){return si(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 _a(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 Ba(){}function Fa(){this.g=Ha,this.i=(new Map).set(Ha,2).set(Va,1),this.h=0}ja.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&&!Ua(n,r))&&_a(n.roles,r.roles)&&n.groupId===r.groupId)}return!n&&(n=i.video&&e.video)&&(i=i.video,n=e.video,n=!((!t||Ua(i,n))&&_a(i.roles,n.roles))),!n&&(this.g.add(e),!0)},ja.prototype.values=function(){return this.g.values()},F("shaka.media.AdaptationSet",ja),F("shaka.config.CodecSwitchingStrategy",{RELOAD:"reload",SMOOTH:"smooth"}),Ba.prototype.create=function(){},Ba.prototype.configure=function(){},Ba.prototype.getConfiguration=function(){},F("shaka.media.AdaptationSetCriteria",Ba);var Va=0,Ha=1;function Ka(e,t,n){this.g=e,this.i=t,this.h=n}function Ga(e,t){return R((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,R((function(r){return 1==r.g?w(r,Bi(e,t,0<t.offlineSessionIds.length,n,i),2):(function(e){e.textStreams=e.textStreams.filter((function(e){return mi(e=ni(e.mimeType,e.codecs))}))}(t),w(r,function(e){var t,n,i,r,a,o,s;return R((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"),ur.has(a)){u.u(5);break}if(!(o=lr.get(a))){ur.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,ur.set(a,s);case 5:ur.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||Ui(t,e.g.preferredVideoCodecs,e.g.preferredAudioCodecs,e.g.preferredDecodingAttributes,e.g.preferredTextFormats),!t.variants.some(Qi))throw new Ne(2,4,4032);return n.return(qa(e,t))}))}function za(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=_i(r,n,e),a!=r.allowedByApplication&&(i=!0)}return i}function qa(e,t){var n=za(e,t);if(t){var i=e.h?e.h.g:null;if(i&&e.h.A){for(var r=new Set,a=l(t.variants),o=a.next();!o.done;o=a.next())(o=o.value).audio&&r.add(o.audio),o.video&&r.add(o.video);for(a=(r=l(r)).next();!a.done;a=r.next())Xa(e,i.keySystem,a.value)}Wa(e,t)}return n}function Xa(e,t,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 Wa(e,t){e=e.h?e.h.Te():{};var n=Object.keys(e);n=n.length&&"00"==n[0];for(var i=!1,r=!1,a=new Set,o=new Set,s=new Set,u=(t=l(t.variants)).next();!u.done;u=t.next())(u=u.value).audio&&s.add(u.audio),u.video&&s.add(u.video),u.allowedByApplication?u.allowedByKeySystem&&(i=!0):r=!0;for(t=(s=l(s)).next();!t.done;t=s.next())if((t=t.value).keyIds.size)for(u=(t=l(t.keyIds)).next();!u.done;u=t.next()){u=u.value;var c=e[n?"00":u];c?Ya.includes(c)&&o.add(c):a.add(u)}if(!i)throw new Ne(2,4,4012,e={hasAppRestrictions:r,missingKeys:Array.from(a),restrictedKeyStatuses:Array.from(o)})}var Ya=["output-restricted","internal-error"];function Ja(){}function $a(e,t){Za.set(e,t)}function Qa(e,t){if(t){var n=Za.get(t.toLowerCase());if(n)return n}throw new Ne(2,4,4e3,e,t)}F("shaka.media.ManifestParser",Ja),Ja.unregisterParserByMime=function(e){Za.delete(e)},Ja.registerParserByMime=$a,Ja.registerParserByExtension=function(){oe("ManifestParser.registerParserByExtension","Please use an ManifestParser with registerParserByMime function.")},Ja.AccessibilityPurpose={tm:"visually impaired",Gl:"hard of hearing",bm:"spoken subtitles"};var Za=new Map;function eo(e,t){var n=null,i=null,r=null,a=null,o=e.T();return 1&t&&(r=e.yd()),2&t&&(a=e.T()),8&t&&(n=e.T()),16&t&&(i=e.T()),{trackId:o,Md:n,Nd:i,gj:r,Fi:a}}function to(e,t){return 1==t?(t=e.T(),e=e.T(),{baseMediaDecodeTime:t*Math.pow(2,32)+e}):{baseMediaDecodeTime:e.T()}}function no(e,t){return 1==t?(e.skip(8),e.skip(8)):(e.skip(4),e.skip(4)),t=e.T(),e.skip(4),e=e.Ba(),{timescale:t,language:String.fromCharCode(96+(e>>10))+String.fromCharCode(96+((960&e)>>5))+String.fromCharCode(96+(31&e))}}function io(e,t,n){var i=e.T(),r=[],a=null;1&n&&(a=e.Yg()),4&n&&e.skip(4);for(var o=0;o<i;o++){var s={hh:null,sampleSize:null,Bf:null};256&n&&(s.hh=e.T()),512&n&&(s.sampleSize=e.T()),1024&n&&e.skip(4),2048&n&&(s.Bf=0==t?e.T():e.Yg()),r.push(s)}return{ym:i,gh:r,mg:a}}function ro(e){e.skip(6),e.skip(2),e.skip(8);var t=e.Ba();return e.skip(2),e.skip(2),e.skip(2),{channelCount:t,sampleRate:e=e.Ba()+e.Ba()/65536}}function ao(e){return{codec:ua(e=e.T())}}function oo(e,t){return t=void 0!==t&&t,e=e.toString(16).toUpperCase(),t?e:("0"+e).slice(-2)}function so(e){return(10>e?"0":"")+e}function uo(e){if(!To){To=!0;var t=new Uint8Array([105,115,111,109]),n=new Uint8Array([97,118,99,49]),i=new Uint8Array([0,0,0,1]);Lo=wo("ftyp",t,i,t,n),t=wo("dref",No),Oo=wo("dinf",t)}this.g=e}function lo(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=wo;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,p=Math.floor(h/(xo+1));switch(h=Math.floor(h%(xo+1)),s=wo("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(vo(s,4)),[0,0,0,0],c(vo(p,4)),c(vo(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(vo(u,2)),[0,0],c(vo(d,2)),[0,0]))),u=wo,p=o.duration*o.timescale,d=Math.floor(p/(xo+1)),p=Math.floor(p%(xo+1)),h=(h=o.stream.language).charCodeAt(0)-96<<10|h.charCodeAt(1)-96<<5|h.charCodeAt(2)-96,d=wo("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(vo(o.timescale,4)),c(vo(d,4)),c(vo(p,4)),c(vo(h,2)),[0,0]))),p=o,h=new Uint8Array([]),p.type){case"video":h=Ao;break;case"audio":h=ko}p=wo("hdlr",h);e:{switch(o.type){case"video":o=wo("minf",wo("vmhd",Do),Oo,co(o));break e;case"audio":o=wo("minf",wo("smhd",Po),Oo,co(o));break e}o=new Uint8Array([])}i=i("trak",s,o=u("mdia",d,p,o)),a.call(r,i)}for(t=$e.apply(ze,c(t)),n=wo,i=(a=e.g[0]).duration*a.timescale,r=Math.floor(i/(xo+1)),i=Math.floor(i%(xo+1)),r=wo("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(vo(a.timescale,4)),c(vo(r,4)),c(vo(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=wo("trex",u=new Uint8Array([0,0,0,0].concat(c(vo(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=wo("mvex",e=$e.apply(ze,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=$e.apply(ze,c(i))}else a=new Uint8Array([]);return e=n("moov",r,t,e,a),(t=new Uint8Array(Lo.byteLength+e.byteLength)).set(Lo),t.set(e,Lo.byteLength),t}function co(e){var t=wo,n="aac";e.codecs.includes("mp3")?n="mp3":e.codecs.includes("ac-3")?n=te().ee()?"ec-3":"ac-3":e.codecs.includes("ec-3")?n="ec-3":e.codecs.includes("opus")&&(n="opus");var i=new Uint8Array([]);switch(e.type){case"video":if(e.codecs.includes("avc1")){if(n=e.stream.width||0,i=e.stream.height||0,0<e.Na.byteLength)var r=wo("avcC",e.Na);else{r=wo;for(var a=7,o=[],s=[],u=0,l=0,d=0,h=0;h<e.Ab.length;h++){var p=yo(e.Ab[h]);switch(31&p[0]){case 7:o.push(p),a+=p.length+2;break;case 8:s.push(p),a+=p.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(vo(n,2)),c(vo(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=ho(e),o=new Uint8Array([]),e.encrypted&&(o=fo(0,e.stream,e.codecs),i="encv"),i=wo(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.Na.byteLength&&(n=wo("hvcC",e.Na)),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(vo(i,2)),c(vo(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=ho(e),o=new Uint8Array([]),e.encrypted&&(o=fo(0,e.stream,e.codecs),r="encv"),i=wo(r,i,n,s,o));break;case"audio":"mp3"==n?e=wo(".mp3",po(e)):"ac-3"==n?(n=wo("dac3",e.Ea),i="ac-3",r=new Uint8Array([]),e.encrypted&&(r=fo(0,e.stream,e.codecs),i="enca"),e=wo(i,po(e),n,r)):"ec-3"==n?(n=wo("dec3",e.Ea),i="ec-3",r=new Uint8Array([]),e.encrypted&&(r=fo(0,e.stream,e.codecs),i="enca"),e=wo(i,po(e),n,r)):"opus"==n?(n=wo("dOps",e.Ea),i="Opus",r=new Uint8Array([]),e.encrypted&&(r=fo(0,e.stream,e.codecs),i="enca"),e=wo(i,po(e),n,r)):(0<e.Ea.byteLength?n=wo("esds",e.Ea):(n=wo,i=e.id+1,r=e.stream.channelsCount||2,o=e.stream.audioSamplingRate||44100,u=tt("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(vo(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=fo(0,e.stream,e.codecs),i="enca"),e=wo(i,po(e),n,r)),i=e}return t("stbl",e=wo("stsd",Ro,i),wo("stts",Eo),wo("stsc",Io),wo("stsz",Mo),wo("stco",Co))}function ho(e){if(!e.Wa&&!e.Xa)return new Uint8Array([]);var t=e.Xa;return wo("pasp",e=new Uint8Array([].concat(c(vo(e.Wa,4)),c(vo(t,4)))))}function po(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(vo(e.stream.audioSamplingRate||44100,2)),[0,0]))}function fo(e,t,n){e=wo,n=wo("frma",n=new Uint8Array([].concat(c(vo(bo(n.split(".")[0]),4)))));var i="cenc",r=t.drmInfos[0];r&&r.encryptionScheme&&(i=r.encryptionScheme),i=wo("schm",i=new Uint8Array([0,0,0,0].concat(c(vo(bo(i),4)),[0,1,0,0]))),r=wo;for(var a=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),o=(t=l(t.drmInfos)).next();!o.done;o=t.next())if((o=o.value)&&o.keyIds&&o.keyIds.size)for(var s=(o=l(o.keyIds)).next();!s.done;s=o.next())a=yo(s.value);return e("sinf",n,i,r("schi",t=wo("tenc",t=new Uint8Array([0,0,0,0,0,0,1,8]),a)))}function go(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=wo,s=new Uint8Array([0,0,0,0].concat(c(vo(n.data?n.data.Vb:0,4))));s=wo("mfhd",s);var u=n.data?n.data.yb:[],d=new Uint8Array(4+u.length);for(i=0;i<u.length;i++){var h=u[i].flags;d[i+4]=h.ib<<4|h.kb<<2|h.jb}var p=(u=wo("sdtp",d)).length+92;d=wo,i=wo("tfhd",i=new Uint8Array([0,0,0,58].concat(c(vo(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 f=Math.floor(h%(xo+1));h=wo("tfdt",h=new Uint8Array([1,0,0,0].concat(c(vo(Math.floor(h/(xo+1)),4)),c(vo(f,4)))));var g=p,m=12+16*(f=(p=n.data?n.data.yb:[]).length),v=new Uint8Array(m);for(g+=8+m,v.set(["video"===n.type?1:0,0,15,1].concat(c(vo(f,4)),c(vo(g,4))),0),g=0;g<f;g++){var y=p[g];m=vo(y.duration,4);var b=vo(y.size,4),w=y.flags;y=vo(y.rb,4),v.set([].concat(c(m),c(b),[w.wb<<2|w.ib,w.kb<<6|w.jb<<4|w.xb,61440&w.hb,15&w.hb],c(y)),12+16*g)}o=o("moof",s,u=d("traf",i,h,p=wo("trun",v),u)),a.call(r,t,[o,mo(n)])}return $e.apply(ze,c(t))}function mo(e){return e=(e.data?e.data.yb:[]).map((function(e){return e.data})),wo("mdat",e=$e.apply(ze,c(e)))}function vo(e,t){var n=[];for(--t;0<=t;t--)n.push(e>>8*t&255);return n}function yo(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 bo(e){for(var t=0,n=0;n<e.length;n+=1)t|=e.charCodeAt(n)<<8*(e.length-n-1);return t}function wo(e){var t=L.apply(1,arguments),n=So.get(e);n||(n=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)],So.set(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 To=!1,xo=Math.pow(2,32)-1,So=new Map,Ao=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]),ko=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]),Eo=new Uint8Array([0,0,0,0,0,0,0,0]),Io=new Uint8Array([0,0,0,0,0,0,0,0]),Co=new Uint8Array([0,0,0,0,0,0,0,0]),Mo=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Do=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),Po=new Uint8Array([0,0,0,0,0,0,0,0]),Ro=new Uint8Array([0,0,0,0,0,0,0,1]),Lo=new Uint8Array([]),No=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),Oo=new Uint8Array([]);function jo(e){function t(e){o.push(e),na(e)}var n,i,r,a,o=[];if((new ta).box("moof",t).box("traf",t).R("tfhd",(function(e){n=e,r=eo(e.reader,e.flags)})).R("trun",(function(e){i=e,a=io(e.reader,e.version,e.flags)})).parse(e),r&&2!==r.Fi){var s=n.start+la(n)+4+(null!==r.gj?8:0),u=Re(e);if(null!==r.Fi)u.setUint32(s,2);else{_o(e,n.start,n.size+4);var c=u.getUint32(n.start+8);u.setUint32(n.start+8,2|c),a&&null!==a.mg&&u.setInt32(i.start+la(i)+4,a.mg+4),c=e.subarray(0,s),u=e.subarray(s),(e=new Uint8Array(e.byteLength+4)).set(c),c=[];for(var d=3;0<=d;d--)c.push(2>>8*d&255);for(e.set(new Uint8Array(c),s),e.set(u,s+4),u=(s=l(o)).next();!u.done;u=s.next())_o(e,(u=u.value).start,u.size+4)}}return e}function Uo(e,t,n,i,r,a){var o=fo(new uo([]),e,i.name),s=t.subarray(i.start,i.start+i.size);for((e=new Uint8Array(i.size+o.byteLength)).set(s,0),Re(e).setUint32(4,a),e.set(o,i.size),_o(e,0,e.byteLength),a=new Uint8Array(t.byteLength+e.byteLength),i=te().$e()?i.start:i.start+i.size,o=t.subarray(i),a.set(t.subarray(0,i)),a.set(e,i),a.set(o,i+e.byteLength),r=(t=l(r)).next();!r.done;r=t.next())_o(a,(r=r.value).start,r.size+e.byteLength);return e=Re(a,n.start),n=la(n),t=e.getUint32(n),e.setUint32(n,t+1),a}function _o(e,t,n){0!=(t=(e=Re(e,t)).getUint32(0))&&(1==t?(e.setUint32(8,n>>32),e.setUint32(12,4294967295&n)):e.setUint32(0,n))}function Bo(e,t,n,i,r,a,o,s){this.O=e,this.startByte=t,this.endByte=n,this.rd=void 0===i?null:i,this.timescale=void 0===r?null:r,this.h=void 0===a?null:a,this.aesKey=void 0===o?null:o,this.g=this.mimeType=this.codecs=null,this.encrypted=void 0!==s&&s}function Fo(e,t){return e===t||(e&&t?e.Bc()==t.Bc()&&e.zc()==t.zc()&&Dt(e.O().sort(),t.O().sort())&&Ce(e.Yb(),t.Yb()):e==t)}function Vo(e,t,n,i,r,a,o,s,u,c,d,h,p,f,g,m){for(c=void 0===c?[]:c,f=void 0===f?Ko:f,this.startTime=e,this.j=this.endTime=t,this.C=n,this.startByte=i,this.endByte=r,this.Y=a,this.timestampOffset=o,this.appendWindowStart=s,this.appendWindowEnd=u,this.g=c,this.tilesLayout=void 0===d?"":d,this.B=void 0===h?null:h,this.h=void 0===p?null:p,this.status=f,this.preload=!1,this.l=!0,this.m=!1,this.aesKey=void 0===g?null:g,this.thumbnailSprite=null,this.i=-1,this.A=void 0!==m&&m,this.F=this.o=!1,t=(e=l(this.g)).next();!t.done;t=e.next())t.value.ki();this.A&&this.g.length&&this.g[this.g.length-1].ji(),this.s=this.bandwidth=this.mimeType=this.codecs=null,this.G=!1}function Ho(e,t){e.Y=t;for(var n=(e=l(e.g)).next();!n.done;n=e.next())Ho(n.value,t)}Bo.prototype.Bc=function(){return this.startByte},Bo.prototype.zc=function(){return this.endByte},Bo.prototype.ge=function(e){this.h=e},Bo.prototype.Yb=function(){return this.h},F("shaka.media.InitSegmentReference",Bo),Bo.prototype.getEndByte=Bo.prototype.zc,Bo.prototype.getStartByte=Bo.prototype.Bc,(i=Vo.prototype).O=function(){return this.C()},i.getStartTime=function(){return this.startTime},i.zj=function(){return this.endTime},i.Bc=function(){return this.startByte},i.zc=function(){return this.endByte},i.Vj=function(){return this.tilesLayout},i.Uj=function(){return this.B},i.Cc=function(){return this.status},i.qk=function(){this.status=Go},i.Pg=function(){this.preload=!0},i.isPreload=function(){return this.preload},i.qd=function(){this.l=!1},i.fk=function(){return this.l},i.ki=function(){this.o=!0},i.hk=function(){return this.o},i.ji=function(){this.F=!0},i.gk=function(){return this.F},i.ii=function(){this.m=!0},i.bk=function(){return this.m},i.Hf=function(e){this.thumbnailSprite=e},i.Sj=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.vh=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.ge=function(e,t){this.s=e,this.G=void 0!==t&&t},i.Yb=function(e){var t=this.s;return(void 0===e||e)&&this.G&&(this.s=null),t},F("shaka.media.SegmentReference",Vo),Vo.prototype.getSegmentData=Vo.prototype.Yb,Vo.prototype.setSegmentData=Vo.prototype.ge,Vo.prototype.syncAgainst=Vo.prototype.vh,Vo.prototype.offset=Vo.prototype.offset,Vo.prototype.getThumbnailSprite=Vo.prototype.Sj,Vo.prototype.setThumbnailSprite=Vo.prototype.Hf,Vo.prototype.hasByterangeOptimization=Vo.prototype.bk,Vo.prototype.markAsByterangeOptimization=Vo.prototype.ii,Vo.prototype.isLastPartial=Vo.prototype.gk,Vo.prototype.markAsLastPartial=Vo.prototype.ji,Vo.prototype.isPartial=Vo.prototype.hk,Vo.prototype.markAsPartial=Vo.prototype.ki,Vo.prototype.isIndependent=Vo.prototype.fk,Vo.prototype.markAsNonIndependent=Vo.prototype.qd,Vo.prototype.isPreload=Vo.prototype.isPreload,Vo.prototype.markAsPreload=Vo.prototype.Pg,Vo.prototype.markAsUnavailable=Vo.prototype.qk,Vo.prototype.getStatus=Vo.prototype.Cc,Vo.prototype.getTileDuration=Vo.prototype.Uj,Vo.prototype.getTilesLayout=Vo.prototype.Vj,Vo.prototype.getEndByte=Vo.prototype.zc,Vo.prototype.getStartByte=Vo.prototype.Bc,Vo.prototype.getEndTime=Vo.prototype.zj,Vo.prototype.getStartTime=Vo.prototype.getStartTime,Vo.prototype.getUris=Vo.prototype.O;var Ko=0,Go=1;function zo(e){return 1==e.length&&1e-4>e.end(0)-e.start(0)}function qo(e){return!e||zo(e)?null:e.length?e.end(e.length-1):null}function Xo(e,t){return!(!e||!e.length||zo(e)||t>e.end(e.length-1))&&t>=e.start(0)}function Wo(e,t){if(!e||!e.length||zo(e))return 0;for(var n=0,i=(e=l(Yo(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 Yo(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 Jo(){}function $o(e,t){var n=document.createElement("source");return n.src=e,n.type=void 0===t?"":t,n}function Qo(e){for(var t=!1,n=e.getElementsByTagName("source"),i=n.length-1;0<=i;--i)e.removeChild(n[i]),t=!0;return e.src&&(e.removeAttribute("src"),t=!0),t}function Zo(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function es(){return ns||(ts||(ts=new Ti((function(){ns=null}))),(ns=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(ns=document.createElement("video")),ts.ia(1),ns)}Vo.Status={il:Ko,rm:Go,Ql:2},F("shaka.util.Dom",Jo),Jo.removeAllChildren=Zo,Jo.clearSourceFromVideo=Qo;var ts=null,ns=null;function is(){}function rs(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 as(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 os(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 ss(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=Ue(De(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=Ue(De(e.data,3+n,a));return o="--\x3e"===i?Ue(De(e.data,4+n+a)):Me(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=Ue(De(e.data,1,i)),e=Ue(De(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=Ue(De(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=Me(e.data.subarray(n.length+1)),t.data=e),t):"T"===e.type[0]?2>e.size||3!==e.data[0]?null:(e=Ue(e.data.subarray(1)).replace(/\0*$/,""),t.data=e,t):"W"===e.type[0]?(e=Ue(e.data).replace(/\0*$/,""),t.data=e,t):e.data?(t.data=Me(e.data),t):null}function us(e){for(var t=0,n=[];rs(e,t);){var i=os(e,t+6);for(e[t+5]>>6&1&&(t+=10),i=(t+=10)+i;t+10<i;){var r=e.subarray(t),a=os(r,4);(a=ss(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}as(e,t)&&(t+=10)}return n}function ls(e,t){for(var n=t=void 0===t?0:t,i=0;rs(e,t);)e[t+5]>>6&1&&(i+=10),i+=10,i+=os(e,t+6),as(e,t+10)&&(i+=10),t+=i;return 0<i?e.subarray(n,n+i):new Uint8Array([])}function cs(e){return new Date(Date.UTC(1900,0,1,0,0,0,0)+e).getTime()}function ds(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=De(t,0,n)}this.i=this.j.byteLength,this.g=this.h=0}function hs(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 Qr(n,0).T(),e.g=8*i,e.i-=i)}function ps(e,t){if(e.g<=t){t-=e.g;var n=Math.floor(t/8);t-=8*n,e.g-=n,hs(e)}e.h<<=t,e.g-=t}function fs(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&&hs(e),0<(n=t-n)?i<<n|fs(e,n):i}function gs(e){var t;for(t=0;t<e.g;++t)if(e.h&2147483648>>>t)return e.h<<=t,e.g-=t,t;return hs(e),t+gs(e)}function ms(e){ps(e,1+gs(e))}function vs(e){return fs(e,gs(e)+1)-1}function ys(e){return 1&(e=vs(e))?1+e>>>1:-1*(e>>>1)}function bs(e){return 1===fs(e,1)}function ws(e){return fs(e,8)}function Ts(e,t){for(var n=8,i=8,r=0;r<t;r++)0!==i&&(i=(n+(i=ys(e))+256)%256),n=0===i?n:i}function xs(e){return ws(e),vs(e),vs(e)}function Ss(){this.H=null,this.I=!1,this.m=this.K=null,this.j=[],this.g=[],this.B=this.C=null,this.i=[],this.h=[],this.F=null,this.l=[],this.A=this.G=this.o=this.s=null}function As(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=Es(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=n.pts!=r?Es(i,e.o):i),e.o=n.dts}return e=t[8]+9,t.byteLength<=e?null:(n.data=t.subarray(e),n)}function ks(e){var t=e.Rc();return 1<t.length&&(e=t[0].pts,t=t[1].pts,!isNaN(t-e))?String(1/(t-e)*9e4):null}function Es(e,t){var n=1;for(e>t&&(n=-1);4294967296<Math.abs(t-e);)e+=8589934592*n;return e}function Is(e){return!(0>Cs(e))}function Cs(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}F("shaka.util.Id3Utils",is),is.getID3Data=ls,is.getID3Frames=us,F("shaka.util.ExpGolomb",ds),(i=Ss.prototype).clearData=function(){this.j=[],this.g=[],this.i=[],this.h=[],this.l=[]},i.Ff=function(e){null!=this.A&&this.A!=e&&(this.o=this.s=null),this.A=e},i.parse=function(e){if(564>e.length)return this;for(var t=Math.max(0,Cs(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.H=(31&e[s+10])<<8|e[s+11];break;case 17:case 8191:break;case this.H:a&&(s+=e[s]+1),o={audio:-1,video:-1,Ye:-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 p=a[d+1]+2;switch(a[d]){case 5:var f=He(a.subarray(d+2,d+p));-1==o.audio&&"Opus"===f?(o.audio=l,o.audioCodec="opus"):-1==o.video&&"AV01"===f&&(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&&(f=null,128===a[d+2]&&(f=a[d+3]),null!=f&&(this.G={channelCount:15&f?15&f:2,jj:f,sampleRate:48e3}))}d+=p,h-=p}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.Ye&&(o.Ye=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.K=a.video,this.m=a.videoCodec),-1!=a.audio&&(this.C=a.audio,this.B=a.audioCodec),-1!=a.Ye&&(this.F=a.Ye),i&&!this.I&&(i=!1,r=t-188),this.I=!0;break;case this.K: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.C: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.F: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.zk=function(e){return oe("TsParser.parseAvcNalus","Please use parseNalus function instead."),this.Vg(e,{Zd:null,state:null})},i.Vg=function(e,t){var n=e.pts?e.pts/9e4:null,i=(e=e.data).byteLength,r=1;"hvc"==this.m&&(r=2);var a=t.state||0,o=a,s=0,u=[],l=-1,c=0;for(-1==a&&(l=0,c="hvc"==this.m?e[0]>>1&63:31&e[0],a=0,s=1);s<i;){var d=e[s++];a?1===a?a=d?0:2:d?1==d?(d=s-a-1,0<=l?u.push({data:e.subarray(l+r,d),fullData:e.subarray(l,d),type:c,time:n,state:null}):(a=u.length?u[u.length-1]:t.Zd)&&(o&&s<=4-o&&a.state&&(a.data=a.data.subarray(0,a.data.byteLength-o),a.fullData=a.fullData.subarray(0,a.fullData.byteLength-o)),0<d&&(d=e.subarray(0,d),a.data=$e(a.data,d),a.fullData=$e(a.fullData,d),a.state=0)),s<i?(c="hvc"==this.m?e[s]>>1&63:31&e[s],l=s,a=0):a=-1):a=0:a=3:a=d?0:1}return 0<=l&&0<=a&&u.push({data:e.subarray(l+r,i),fullData:e.subarray(l,i),type:c,time:n,state:a}),!u.length&&t.Zd&&(n=u.length?u[u.length-1]:t.Zd)&&(n.data=$e(n.data,e),n.fullData=$e(n.fullData,e)),t.state=a,u},i.getMetadata=function(){for(var e=[],t=l(this.l),n=t.next();!n.done;n=t.next())(n=As(this,n=$e.apply(ze,c(n.value))))&&e.push({cueTime:n.pts?n.pts/9e4:null,data:n.data,frames:us(n.data),dts:n.dts,pts:n.pts});return e},i.sb=function(){if(this.i.length&&!this.h.length)for(var e=l(this.i),t=e.next();!t.done;t=e.next()){var n=$e.apply(ze,c(t.value)),i=As(this,n);t=this.h.length?this.h[this.h.length-1]:null,i&&null!=i.pts&&null!=i.dts&&(!t||t.pts!=i.pts&&t.dts!=i.dts)?this.h.push(i):this.h.length&&(n=i?i.data:n)&&((t=this.h.pop()).data=$e(t.data,n),this.h.push(t))}return this.h},i.Rc=function(e){if(e=void 0===e||e,this.j.length&&!this.g.length){for(var t=l(this.j),n=t.next();!n.done;n=t.next()){var i=$e.apply(ze,c(n.value)),r=As(this,i);n=this.g.length?this.g[this.g.length-1]:null,r&&null!=r.pts&&null!=r.dts&&(!n||n.pts!=r.pts&&n.dts!=r.dts)?this.g.push(r):this.g.length&&(i=r?r.data:i)&&((n=this.g.pop()).data=$e(n.data,i),this.g.push(n))}if(e){for(t={Zd:null,state:null},n=[],r=(i=l(this.g)).next();!r.done;r=i.next())(r=r.value).nalus=this.Vg(r,t),r.nalus.length&&(n.push(r),t.Zd=r.nalus[r.nalus.length-1]);this.g=n}}return e?this.g:(e=this.g,this.g=[],e)},i.getStartTime=function(e){if("audio"==e){e=null;var t=this.sb();return t.length&&(e=t[0],e=Math.min(e.dts,e.pts)/9e4),e}return"video"==e?(e=null,(t=this.Rc(!1)).length&&(e=t[0],e=Math.min(e.dts,e.pts)/9e4),e):null},i.Od=function(){return{audio:this.B,video:this.m}},i.Xe=function(){for(var e=[],t=l(this.Rc()),n=t.next();!n.done;n=t.next())e.push.apply(e,c(n.value.nalus));return e},i.Yj=function(){oe("TsParser.getVideoResolution","Please use getVideoInfo function instead.");var e=this.Ig();return{height:e.height,width:e.width}},i.Ig=function(){return"hvc"==this.m?function(e){var t={height:null,width:null,codec:null,frameRate:null},n=e.Xe();if(!n.length)return t;if(!(n=n.find((function(e){return 33==e.type}))))return t;var i=new ds(n.fullData,!0);ws(i),ws(i),fs(i,4);var r=fs(i,3);bs(i);var a=fs(i,2),o=fs(i,1),s=fs(i,5),u=fs(i,32);n=ws(i);for(var l=ws(i),c=ws(i),d=ws(i),h=ws(i),p=ws(i),f=ws(i),g=[],m=[],v=0;v<r;v++)g.push(bs(i)),m.push(bs(i));if(0<r)for(v=r;8>v;v++)fs(i,2);for(v=0;v<r;v++)g[v]&&fs(i,88),m[v]&&ws(i);vs(i),3==(r=vs(i))&&fs(i,1),g=vs(i),m=vs(i);var y=v=0,b=0,w=0;return bs(i)&&(v+=vs(i),y+=vs(i),b+=vs(i),w+=vs(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+f,p&&(a+="."+p.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=ks(e),t}(this):function(e){var t={height:null,width:null,codec:null,frameRate:null},n=e.Xe();if(!n.length)return t;if(!(n=n.find((function(e){return 7==e.type}))))return t;var i=ws(n=new ds(n.data)),r=ws(n),a=ws(n);if(ms(n),Ms.includes(i)){var o=vs(n);if(3===o&&ps(n,1),ms(n),ms(n),ps(n,1),bs(n)){o=3!==o?8:12;for(var s=0;s<o;s++)bs(n)&&Ts(n,6>s?16:64)}}if(ms(n),0===(o=vs(n)))vs(n);else if(1===o)for(ps(n,1),ms(n),ms(n),o=vs(n),s=0;s<o;s++)ms(n);ms(n),ps(n,1),o=vs(n),s=vs(n);var u=fs(n,1);0===u&&ps(n,1),ps(n,1);var l=0,c=0,d=0,h=0;return bs(n)&&(l=vs(n),c=vs(n),d=vs(n),h=vs(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=ks(e),t}(this)},F("shaka.util.TsParser",Ss),Ss.syncOffset=Cs,Ss.probe=Is,Ss.prototype.getVideoInfo=Ss.prototype.Ig,Ss.prototype.getVideoResolution=Ss.prototype.Yj,Ss.prototype.getVideoNalus=Ss.prototype.Xe,Ss.prototype.getCodecs=Ss.prototype.Od,Ss.prototype.getStartTime=Ss.prototype.getStartTime,Ss.prototype.getVideoData=Ss.prototype.Rc,Ss.prototype.getAudioData=Ss.prototype.sb,Ss.prototype.getMetadata=Ss.prototype.getMetadata,Ss.prototype.parseNalus=Ss.prototype.Vg,Ss.prototype.parseAvcNalus=Ss.prototype.zk,Ss.prototype.parse=Ss.prototype.parse,Ss.prototype.setDiscontinuitySequence=Ss.prototype.Ff,Ss.prototype.clearData=Ss.prototype.clearData,Ss.Timescale=9e4;var Ms=[100,110,122,244,44,83,86,118,128,138,139,134];function Ds(e,t,n,i,r){var a=this;this.g=e,this.N=n,this.A=i,this.ha=t,this.l=new Map,this.C=new Map,this.Oa=new Map,this.h=null,this.Ka=!1,this.M=r||null,this.o=new Map,this.s=new $,this.j=new Map,this.I=null,this.K=new Sr,this.za="",this.eb=!1,this.ya=!0,this.L=!1,this.B=this.P=null,this.i=Ps(this,this.K),this.Ya=this.F=!1,this.H=new Xr((function(){return function(e){var t,n,i,r,a,o,s,u,c,d,h,p,f;return R((function(g){if(1==g.g){for(t=[],n=l(e.o),i=n.next();!i.done;i=n.next())for(r=i.value,a=l(r),o=a.next().value,s=a.next().value,u=s[0],c=o,e.o.set(c,s.slice(0,1)),u&&t.push(u.p.catch(Si)),d=l(s.slice(1)),h=d.next();!h.done;h=d.next())h.value.p.reject(new Ne(2,7,7003,void 0));return e.h&&t.push(e.h.destroy()),w(g,Promise.all(t),2)}for(p=l(e.j.values()),f=p.next();!f.done;f=p.next())f.value.destroy();e.s&&(e.s.release(),e.s=null),e.g&&e.B&&e.g.removeChild(e.B),e.g&&e.P&&(e.g.removeChild(e.P),e.g.load(),e.g.disableRemotePlayback=!1),e.g=null,e.P=null,e.B=null,e.A=null,e.i=null,e.h=null,e.ha=null,e.l.clear(),e.Oa.clear(),e.j.clear(),e.I=null,e.o.clear(),e.M=null,e.ba.clear(),e.N=null,T(g)}))}(a)})),this.G=!1,this.W="UNKNOWN",this.Za=this.ab=!1,this.Pa=new Sr,this.m=!1,this.wa=null,this.ba=new Map,this.na=this.S=this.va=this.U=null,this.ka=new Sr,this.g.remote&&(this.L="disconnected"!=this.g.remote.state,this.s.D(this.g.remote,"connect",(function(){a.L="disconnected"!=a.g.remote.state})),this.s.D(this.g.remote,"connecting",(function(){a.L="disconnected"!=a.g.remote.state})),this.s.D(this.g.remote,"disconnect",(function(){a.L="disconnected"!=a.g.remote.state})))}function Ps(t,n){if(t.ya=!0,e.ManagedMediaSource){t.B||(t.g.disableRemotePlayback=!0);var i=new ManagedMediaSource;t.s.D(i,"startstreaming",(function(){t.ya=!0})),t.s.D(i,"endstreaming",(function(){t.ya=!1}))}else i=new MediaSource;return t.s.Aa(i,"sourceopen",(function(){URL.revokeObjectURL(t.za),n.resolve()})),t.s.Aa(t.g,"playing",(function(){t.eb=!0})),t.za=nu(i),t.A.useSourceElements?(t.g.removeAttribute("src"),t.P&&t.g.removeChild(t.P),t.B&&t.g.removeChild(t.B),t.P=$o(t.za),t.g.appendChild(t.P),t.B&&t.g.appendChild(t.B),t.g.load()):t.g.src=t.za,i}function Rs(e,t,n,i){"audio"==t&&i&&(i=Gi(i,n.mimeType));var r=ni(n.mimeType,i);if(t==rt)Ns(e,r,e.G,n.external);else{var a=e.A.forceTransmux;(!ht(r)||!e.G&&hi.includes(r))&&(a=!0);var o=ii(n.mimeType,i);if(a){if(a=nt("audio",(i||"").split(",")),i=nt("video",(i||"").split(",")),a&&i)return e.m=!0,Rs(e,"audio",n,a),void Rs(e,"video",n,i);(i=Yn(o))&&(r=i(),e.j.set(t,r),r=r.convertCodecs(t,o))}o=r+e.A.addExtraFeaturesToSourceBuffer(r),Wr(e.H);try{var s=e.i.addSourceBuffer(o)}catch(t){throw new Ne(2,3,3015,t,"The mediaSource_ status was "+e.i.readyState+" expected 'open'",null)}e.G&&(s.mode=iu),e.s.D(s,"error",(function(){var n=e.o.get(t)[0];n.p.reject(new Ne(2,3,3014,e.g.error?e.g.error.code:0,n.uri))})),e.s.D(s,"updateend",(function(){return Ws(e,t)})),e.l.set(t,s),e.C.set(t,r),e.Oa.set(t,!!n.drmInfos.length)}}function Ls(e){return e.ya&&!e.L&&!e.F}function Ns(e,t,n,i){e.h||(e.h=new pi(e.ha),e.h&&(e.h.A=e.A.modifyCueCallback));var r=e.h;i=i||e.Ka,e=e.W,"application/cea-608"==t||"application/cea-708"==t?r.i=null:(r.i=bi.get(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 Os(e){return!(e.F||e.i&&"ended"!=e.i.readyState)}function js(e){return!(e.F||e.i&&"closed"!=e.i.readyState)}function Us(e,t){return e=e.l.size?t==rt?e.h.g:!(e=Bs(e,t))||zo(e)?null:1==e.length&&0>e.start(0)?0:e.length?e.start(0):null:null}function _s(e,t){return e.l.size?t==rt?e.h.h:qo(Bs(e,t)):null}function Bs(e,t){if(e.F||e.L)return null;try{return e.l.get(t).buffered}catch(n){return e.l.has(t),null}}function Fs(e,t,n,i,r,a,o,s,u,d,h){var p,f,g,m,v,y,b,x,S,A,k,E,I,C,M,D;return o=void 0!==o&&o,s=void 0!==s&&s,u=void 0!==u&&u,d=void 0!==d&&d,R((function(P){switch(P.g){case 1:if(t!=(p=at).Ta){P.u(2);break}if("HLS"!=e.W){P.u(3);break}return w(P,e.Pa,4);case 4:f=P.h,e.h.s=f;case 3:return w(P,function(e,t,n,i,r){var a,o,s,u,c,d,h;return R((function(p){if(1==p.g)return w(p,Promise.resolve(),2);if(!e.i||!e.j)return p.return();if(null==n||null==i)return e.i.parseInit(De(t)),p.return();for(a=e.B?n:e.s,o={periodStart:e.s,segmentStart:n,segmentEnd:i,vttOffset:a},s=e.i.parseMedia(De(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(p)}))}(e.h,n,i?i.startTime:null,i?i.endTime:null,i?i.O()[0]:null),5);case 5:return P.return();case 2:if(d||!e.m){P.u(6);break}return w(P,Fs(e,p.ea,n,i,r,a,o,s,u,!0),7);case 7:return w(P,Fs(e,p.Ca,n,i,r,a,o,s,u,!0),8);case 8:return P.return();case 6:if(!e.l.has(t))return P.return();if(g=e.l.get(t).timestampOffset,m=e.C.get(t),e.j.has(t)&&(m=e.j.get(t).getOriginalMimeType()),i&&(v=function(e,t,n,i,r,a){var o=null,s=[],u=De(n);if(hi.includes(a))(t=us(u)).length&&i&&((n=t.find((function(e){return"com.apple.streaming.transportStreamTimestamp"===e.description})))&&"number"==typeof n.data&&(o=Math.round(n.data)/1e3),e.N.onMetadata([{cueTime:i.startTime,data:u,frames:t,dts:i.startTime,pts:i.startTime}],0,i.endTime));else if(a.includes("/mp4")&&i&&i.Y&&i.Y.timescale){var l=i.Y.timescale;if(!isNaN(l)){var c=null!=r.emsgSchemeIdUris&&0<r.emsgSchemeIdUris.length||e.A.dispatchAllEmsgBoxes,d=0,h=!1;u=new ta,c&&u.R("emsg",(function(t){var n=r.emsgSchemeIdUris;if(0===t.version)var a=t.reader.Vc(),o=t.reader.Vc(),s=t.reader.T(),u=t.reader.T(),l=t.reader.T(),c=t.reader.T(),d=i.startTime+u/s;else s=t.reader.T(),u=(d=t.reader.yd()/s+i.timestampOffset)-i.startTime,l=t.reader.T(),c=t.reader.T(),a=t.reader.Vc(),o=t.reader.Vc();t=t.reader.Ub(t.reader.getLength()-t.reader.Ma()),(n&&n.includes(a)||e.A.dispatchAllEmsgBoxes)&&("urn:mpeg:dash:event:2012"==a?e.N.yk():(n=d+l/s,e.N.wk({startTime:d,endTime:n,schemeIdUri:a,value:o,timescale:s,presentationTimeDelta:u,eventDuration:l,id:c,messageData:t}),("https://aomedia.org/emsg/ID3"==a||"https://developer.apple.com/streaming/emsg-id3"==a)&&(s=us(t)).length&&e.N.onMetadata([{cueTime:d,data:t,frames:s,dts:d,pts:d}],0,n)))})),u.R("prft",(function(t){var n=t.reader,i=t.version;n.T(),t=1e3*(t=n.T())+n.T()/Math.pow(2,32)*1e3,0===i?n=n.T():(i=n.T(),n=n.T(),n=i*Math.pow(2,32)+n),t=cs(t),n=new Dr("prft",n=(new Map).set("detail",{wallClockTime:t,programStartDate:new Date(t-n/l*1e3)})),e.N.onEvent(n)})).box("moof",na).box("traf",na).R("tfdt",(function(e){h||(d=to(e.reader,e.version).baseMediaDecodeTime/l,h=!0,c||e.parser.stop())})).parse(n,!0),h&&0==i.timestampOffset&&(o=d)}}else a.includes("/mp4")||a.includes("/webm")||!Is(u)||(e.ba.has(t)||e.ba.set(t,new Ss),(s=e.ba.get(t)).clearData(),s.Ff(i.i),s.parse(u),null!=(u=s.getStartTime(t))&&(o=u),s=s.getMetadata());return{timestamp:o,metadata:s}}(e,t,n,i,r,m),y=v.timestamp,b=v.metadata,null!=y&&(null==e.U&&t==p.Ca&&(e.U=y,e.va=i.startTime,null!=e.S&&(x=0,e.va==e.na&&(x=e.U-e.S),e.ka.resolve(x))),null==e.S&&t==p.ea&&(e.S=y,e.na=i.startTime,null!=e.U&&(S=0,e.va==e.na&&(S=e.U-e.S),e.ka.resolve(S))),A=y,k=hi,!e.G&&k.includes(e.C.get(t))&&(A=0),E=i.startTime-A,(.001<=Math.abs(g-E)||o||s)&&(!u||0<E||!g)&&(g=E,e.Za&&(Ys(e,t,(function(){return zs(e,t)}),null),Ys(e,t,(function(){return qs(e,t,g)}),null))),(t==p.Ca||!e.l.has(p.Ca))&&e.Pa.resolve(g)),b.length)&&e.N.onMetadata(b,g,i?i.endTime:null),a&&t==p.Ca&&(e.h||Ns(e,"application/cea-608",e.G,!1),e.I||(I=m.split(";",1)[0],e.I=new bt(I)),i?(C=e.I.vf(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,[]),yi(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,C,i.startTime,i.endTime,g):e.I.init(n,s,h)),!e.j.has(t)){P.u(9);break}return w(P,e.j.get(t).transmux(n,r,i,e.i.duration,t),10);case 10:n=P.h;case 9:if(n=function(e,t,n,i,r){if("mp4"!=ai(e.C.get(r)))return n;var a=null===i,o=e.Oa.get(r),s=e.N.Ej(),u=!1;i&&i.Y&&(u=i.Y.encrypted),i=i?i.O()[0]:null;var d=te();return e.A.correctEc3Enca&&a&&"audio"===r&&(n=function(e){e=De(e);var t=null;return(new ta).box("moov",na).box("trak",na).box("mdia",na).box("minf",na).box("stbl",na).R("stsd",ia).box("enca",(function(e){return t=e.reader.h,aa(e)})).box("sinf",na).box("frma",(function(e){e.parser.stop(),"ec-3"===ao(e.reader).codec&&t&&2!==t.getUint16(16)&&t.setUint16(16,2)})).parse(e),e}(n)),e.A.insertFakeEncryptionInInit&&o&&d.fe(s,r)&&(a?n=function(e,t,n){function i(e){h.push({box:e,oi:1701733217})}function r(e){h.push({box:e,oi:1701733238})}function a(e){c=!0,e.parser.stop()}function o(e){d.push(e),na(e)}var s,u=t=De(t),c=!1,d=[],h=[];if((new ta).box("moov",o).box("trak",o).box("mdia",o).box("minf",o).box("stbl",o).R("stsd",(function(e){s=e,d.push(e),ia(e)})).R("encv",a).R("enca",a).R("dvav",r).R("dva1",r).R("dvh1",r).R("dvhe",r).R("dvc1",r).R("dvi1",r).R("hev1",r).R("hvc1",r).R("avc1",r).R("avc3",r).R("ac-3",i).R("ec-3",i).R("ac-4",i).R("Opus",i).R("fLaC",i).R("mp4a",i).parse(t),c)return t;if(0==h.length||!s)throw Je(t),new Ne(2,3,3019,n);h.reverse();for(var p=(n=l(h)).next();!p.done;p=n.next())p=p.value,u=Uo(e,u,s,p.box,d,p.oi);return te().Ai()?((e=new Uint8Array(t.byteLength+u.byteLength)).set(u),e.set(t,u.byteLength),e):u}(t,n,i):!u&&d.Bi(r)&&(n=function(e){e=De(e);var t=[];(new ta).box("mdat",(function(e){t.push(e)})).parse(e);for(var n=[],i=0;i<t.length;i++){var r=t[i-1],a=t[i];n.push(jo(e.subarray(r?r.start+r.size:0,a.start+a.size)))}return $e.apply(ze,c(n))}(n))),a&&d.ee()&&(n=function(e){function t(e){i.push({start:e.start,size:e.size}),na(e)}var n=De(e),i=[];return(new ta).box("moov",t).box("trak",t).box("mdia",t).box("minf",t).box("stbl",t).box("stsd",(function(e){i.push({start:e.start,size:e.size});for(var t=Re(n,e.start),r=0;r<e.size-3;r++){var a=t.getUint32(r);1633889587==a?t.setUint32(r,1700998451):1684103987==a&&t.setUint32(r,1684366131)}})).parse(n),n}(n)),n}(e,r,n,i,t),!i||!e.G||t==p.Ta){P.u(11);break}if(!o&&!s){P.u(11);break}if(M=i.startTime,"HLS"!=e.W||e.m||t!=p.ea||!e.l.has(p.Ca)){P.u(13);break}return w(P,e.ka,14);case 14:D=P.h,.15<Math.abs(D)&&(M-=D);case 13:Ys(e,t,(function(){return zs(e,t)}),null),Ys(e,t,(function(){return qs(e,t,M)}),null);case 11:return w(P,Ys(e,t,(function(){var i=n;e.M&&lt(e.M,i,g,r),e.l.get(t).appendBuffer(i)}),i?i.O()[0]:null),15);case 15:T(P)}}))}function Vs(e,t){var n;return R((function(i){return 1==i.g?t==(n=at).Ta?e.h?w(i,e.h.remove(0,1/0),0):i.return():w(i,Ys(e,t,(function(){return Gs(e,t,0,e.i.duration)}),null),4):e.m?w(i,Ys(e,n.ea,(function(){return Gs(e,n.ea,0,e.i.duration)}),null),0):i.u(0)}))}function Hs(e,t,n,i,r,a,o,s,u){var l,c;return R((function(d){return 1==d.g?t==(l=at).Ta?(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;return R((function(d){return 1==d.g?(a=at,o=tu(e,t,n,i,r),s=o.type,u=o.ec,l=o.nf,(c=r.get(a.ea))&&(e.m=c.isAudioMuxedInVideo),s==ru?(e.j.has(t)&&!u?(e.j.get(t).destroy(),e.j.delete(t)):!e.j.has(t)&&u?e.j.set(t,u):u&&(e.j.has(t)&&e.j.get(t).transmux!==u.transmux?(e.j.get(t).destroy(),e.j.set(t,u)):u.destroy()),d.return(!1)):s==ou?w(d,function(e,t,n,i){return Ys(e,t,(function(){if(t!==rt){if(e.C.get(t),pt()){e.j.has(t)&&(e.j.get(t).destroy(),e.j.delete(t)),i&&e.j.set(t,i);var r=n+e.A.addExtraFeaturesToSourceBuffer(n);e.l.get(t).changeType(r),e.C.set(t,n)}Ws(e,t)}}),null)}(e,t,l,u),3):s!=au?d.u(3):(u&&u.destroy(),w(d,Zs(e,r),3))):d.return(!0)}))}(e,t,o,s,u),2)):(d.h||(c.push(Ys(e,t,(function(){return zs(e,t)}),null)),e.m&&c.push(Ys(e,l.ea,(function(){return zs(e,l.ea)}),null))),a||(c.push(Ys(e,t,(function(){return qs(e,t,n)}),null)),e.m&&c.push(Ys(e,l.ea,(function(){return qs(e,l.ea,n)}),null))),0==i&&1/0==r||(c.push(Ys(e,t,(function(){return Xs(e,t,i,r)}),null)),e.m&&c.push(Ys(e,l.ea,(function(){return Xs(e,l.ea,i,r)}),null))),c.length?w(d,Promise.all(c),0):d.u(0))}))}function Ks(e){R((function(t){return e.H.g||e.g.error||e.L||e.F||Os(e)||js(e)?t.return():w(t,Js(e,(function(){Os(e)||js(e)||e.i.clearLiveSeekableRange()})),0)}))}function Gs(e,t,n,i){i<=n?Ws(e,t):e.l.get(t).remove(n,i)}function zs(e,t){var n=e.l.get(t),i=n.appendWindowStart,r=n.appendWindowEnd;n.abort(),n.appendWindowStart=i,n.appendWindowEnd=r,Ws(e,t)}function qs(e,t,n){0>n&&(n+=.001),e.l.get(t).timestampOffset=n,Ws(e,t)}function Xs(e,t,n,i){var r=e.l.get(t);r.appendWindowEnd===i&&r.appendWindowStart===n||(r.appendWindowStart=0,r.appendWindowEnd=i,r.appendWindowStart=n),Ws(e,t)}function Ws(e,t){if(e.F||e.H.g){var n=e.o.get(t);n&&n.length&&((n=n[0])&&n.p&&n.p.resolve(),e.o.set(t,[]))}else(n=e.o.get(t)[0])&&(n.p.resolve(),$s(e,t))}function Ys(e,t,n,i){return Wr(e.H),n={start:n,p:new Sr,uri:i},e.o.get(t).push(n),1==e.o.get(t).length&&Qs(e,t),n.p}function Js(e,t){var n,i,r,a,o,s,u,c,d,h,p;return R((function(f){switch(f.g){case 1:for(Wr(e.H),n=[],i=Array.from(e.l.keys()),r=l(i),a=r.next(),o={};!a.done;o={ready:void 0},a=r.next())s=a.value,o.ready=new Sr,u={start:function(e){return function(){return e.ready.resolve()}}(o),p:o.ready,uri:null},(c=e.o.get(s)).push(u),n.push(o.ready),1==c.length&&u.start();return x(f,2),w(f,Promise.all(n),4);case 4:A(f,3);break;case 2:throw k(f);case 3:return x(f,5,6),w(f,t(),6);case 6:for(E(f),d=l(i),h=d.next();!h.done;h=d.next())p=h.value,$s(e,p);I(f,0);break;case 5:throw new Ne(2,3,3015,k(f),e.g.error||"No error in the media element",null)}}))}function $s(e,t){e.o.get(t).shift(),Qs(e,t)}function Qs(e,t){var n=e.o.get(t)[0];if(n)try{n.start()}catch(i){"QuotaExceededError"==i.name?n.p.reject(new Ne(2,3,3017,t)):Ls(e)?n.p.reject(new Ne(2,3,3015,i,e.g.error||"No error in the media element",n.uri)):n.p.reject(new Ne(2,3,3024,t)),$s(e,t)}}function Zs(e,t){return Js(e,(function(){return function(e,t){var n,i,r,a,o,s,u,c,d,h,p,f,g,m,v,y,b,T,x;return R((function(A){if(1==A.g){if(e.F||e.L)return A.return();for(n=at,e.F=!0,e.m=!1,i=e.g.currentTime,r=e.g.autoplay,e.g.paused||(e.Ya=!0),e.eb&&(e.g.autoplay=!1),S(A,2),e.s.Ra(),a=l(e.j.values()),o=a.next();!o.done;o=a.next())o.value.destroy();for(s=l(e.l.values()),u=s.next();!u.done;u=s.next()){c=u.value;try{e.i.removeSourceBuffer(c)}catch(e){}}return e.j.clear(),e.l.clear(),d=e.i.duration,e.K=new Sr,e.i=Ps(e,e.K),w(A,e.K,4)}if(2!=A.g){for(!isNaN(d)&&d?e.i.duration=d:!isNaN(e.wa)&&e.wa&&(e.i.duration=e.wa),h=new Sr,p=e.i.sourceBuffers,f=t.size,g=0,m=function(){++g===f&&(h.resolve(),e.s.Ja(p,"addsourcebuffer",m))},e.s.D(p,"addsourcebuffer",m),v=l(t.keys()),y=v.next();!y.done;y=v.next())b=y.value,T=t.get(b),Rs(e,b,T,T.codecs);return(x=t.get(n.ea))&&x.isAudioMuxedInVideo&&(e.m=!0),e.m&&!e.o.has(n.ea)&&e.o.set(n.ea,[]),e.g.currentTime=i,w(A,h,2)}return E(A),e.F=!1,Wr(e.H),e.s.Aa(e.g,"canplaythrough",(function(){e.H.g||(e.g.autoplay=r,e.Ya&&(e.Ya=!1,e.g.play()))})),I(A,0)}))}(e,t)}))}function eu(e,t,n,i){var r=!1,a=nt("audio",(i||"").split(",")),o=nt("video",(i||"").split(",")),s=o;"audio"==t&&(s=a),s||(s=i),i=ni(n,s);var u=ui(e.C.get(t)),l=e.A.forceTransmux;if(!ht(i)||!e.G&&hi.includes(i)?l=!0:l||n==u||(l="WEBKIT"===te().Da()&&hi.includes(n)),l&&(n=Yn(e=ii(n,s)))){var c=n();a&&o&&(r=!0),i=c.convertCodecs(t,e)}return t=oi(li(i)),{ec:c,Xk:r,Jh:ui(i),codec:t,mimeType:i}}function tu(e,t,n,i,r){if(t==rt)return{type:ru,nf:n,ec:null};var a=oi(li(e.C.get(t))),o=ui(e.C.get(t)),s=eu(e,t,n,i),u=s.ec,l=s.Xk,c=s.Jh,d=s.codec;s=s.mimeType;var h=!0;return l&&e.C.has("audio")&&(n=eu(e,"audio",n,i),i=oi(li(e.C.get("audio"))),h=ui(e.C.get("audio")),h=i==n.codec&&h==n.Jh,n.ec&&n.ec.destroy()),a===d&&o===c&&h?{type:ru,nf:s,ec:u}:(a=!0,(e.m&&!r.has("audio")||l&&u&&!e.j.has(t))&&(a=!1),a&&"smooth"===e.A.codecSwitchingStrategy&&pt()?{type:ou,nf:s,ec:u}:(u&&u.destroy(),{type:au,nf:s,ec:null}))}(i=Ds.prototype).destroy=function(){return this.H.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 R((function(h){if(1==h.g)return r=at,w(h,d.K,2);if(3!=h.g)return Os(d)||js(d)?(z("Expected MediaSource to be open during init(); reopening the media source."),d.K=new Sr,d.i=Ps(d,d.K),w(h,d.K,3)):h.u(3);for(d.G=t,d.W=n,d.ab=i,d.Za=!d.G&&"HLS"==d.W&&!d.ab,d.ba.clear(),d.U=null,d.va=null,d.S=null,d.na=null,d.ka=new Sr,a=l(e.keys()),o=a.next();!o.done;o=a.next())s=o.value,u=e.get(s),Rs(d,s,u,u.codecs),d.m?(d.o.set(r.ea,[]),d.o.set(r.Ca,[])):d.o.set(s,[]);(c=e.get(r.ea))&&c.isAudioMuxedInVideo&&(d.m=!0),T(h)}))},i.configure=function(e){this.A=e,this.h&&(this.h.A=e.modifyCueCallback)},i.Nb=function(){var e={total:this.F?[]:Yo(this.g.buffered),audio:Yo(Bs(this,"audio")),video:Yo(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,i){var r,a=this;return R((function(o){return 1==o.g?(e==(r=at).Ca&&a.I&&a.I.remove(i),e==r.Ta?w(o,a.h.remove(t,n),0):n>t?w(o,Ys(a,e,(function(){return Gs(a,e,t,n)}),null),5):o.u(0)):a.m?w(o,Ys(a,r.ea,(function(){return Gs(a,r.ea,t,n)}),null),0):o.u(0)}))},i.flush=function(e){var t,n=this;return R((function(i){return 1==i.g?e==(t=at).Ta?i.return():w(i,Ys(n,e,(function(){n.g.currentTime-=.001,Ws(n,e)}),null),2):n.m?w(i,Ys(n,t.ea,(function(){var e=t.ea;n.g.currentTime-=.001,Ws(n,e)}),null),0):i.u(0)}))},i.endOfStream=function(e){var t=this;return R((function(n){return w(n,Js(t,(function(){Os(t)||js(t)||(e?t.i.endOfStream(e):t.i.endOfStream())})),0)}))},i.pb=function(e){var t=this;return R((function(n){return w(n,Js(t,(function(){if(t.A.durationReductionEmitsUpdateEnd&&e<t.i.duration)for(var n=l(t.l.keys()),i=n.next();!i.done;i=n.next()){i=i.value;var r={start:function(){},p:new Sr,uri:null};t.o.get(i).unshift(r)}t.i.duration=e,t.wa=e})),0)}))},i.getDuration=function(){return this.i.duration};var nu=e.URL.createObjectURL,iu="sequence",ru="none",au="reset",ou="changeType";function su(e,t,n){this.i=e,this.C=t,this.s=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.o=!1,this.m=e}function uu(e,t,n,i){var r=this;this.s=i,this.g=e,this.B=t,this.h=n,this.o=new $,this.l=!1,this.F=e.readyState,this.G=this.C=this.j=0,this.m=function(e){if(!e.h.stallEnabled)return null;var t=e.h.stallThreshold,n=e.h.stallSkip;return new cu(new du(e.g),t,(function(){return R((function(t){if(1==t.g)return Yo(e.g.buffered).length?n?(e.g.currentTime+=n,t.u(2)):w(t,e.g.play(),3):t.return();if(2!=t.g){if(!e.g)return t.return();e.g.pause(),e.g.play()}e.G++,e.s(new Dr("stalldetected")),T(t)}))}))}(this),this.A=!1,this.o.D(e,"waiting",(function(){return lu(r)})),this.i=new Ti((function(){lu(r)})).Fa(this.h.gapJumpTimerTime)}function lu(e){if(0!=e.g.readyState){if(e.g.seeking){if(!e.l)return}else e.l=!1;if(!e.g.paused||e.g.currentTime==e.j&&(e.g.autoplay||e.g.currentTime!=e.j)){var t;if(e.g.readyState!=e.F&&(e.F=e.g.readyState),!(t=!e.m)){var n=(t=e.m).h,i=hu(n),r=n.g.currentTime,a=Date.now()/1e3;t.g==r&&t.m==i||(t.l=a,t.g=r,t.m=i,t.i=!1),(i=(r=a-t.l)>=t.o&&i&&!t.i)&&(t.j&&t.j(t.g,r),t.i=!0,t.g=n.g.currentTime),t=!i}t&&(t=e.g.currentTime,i=function(e,t,n){return e&&e.length&&!zo(e)&&0<=(e=Yo(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.h.gapDetectionThreshold),null==i||0==i&&!e.A||(r=n.start(i),(a=e.h.gapPadding)&&(r=Math.ceil(100*(r+a))/100),r>=e.B.Fb()||.001>r-t||(0!=i&&n.end(i-1),e.g.currentTime=r,t==e.j&&(e.j=r),e.C++,e.s(new Dr("gapjumped")))))}}}function cu(e,t,n){this.h=e,this.m=hu(e),this.g=e.g.currentTime,this.l=Date.now()/1e3,this.i=!1,this.o=t,this.j=n}function du(e){var t=this;this.g=e,this.h=new $,this.i=!1,this.h.D(this.g,"audiofocuspaused",(function(){t.i=!0})),this.h.D(this.g,"audiofocusgranted",(function(){t.i=!1})),this.h.D(this.g,"audiofocuslost",(function(){t.i=!0}))}function hu(e){if(e.g.paused||0==e.g.playbackRate||e.i||0==e.g.buffered.length)var t=!1;else e:{t=e.g.currentTime;for(var n=(e=l(Yo(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 pu(e,t,n,i){t==HTMLMediaElement.HAVE_NOTHING||e.readyState>=t?i():(t=fu.value().get(t),n.Aa(e,t,i))}(i=su.prototype).getDuration=function(){return this.l},i.Hj=function(){return this.h},i.Li=function(e){this.i=e},i.pb=function(e){this.l=e},i.Nj=function(){return this.i},i.Ki=function(e){this.A=e},i.Zc=function(e){e&&!this.B&&(this.I=!0),this.B=e},i.Gf=function(e){this.s=e},i.We=function(){return this.s},i.lh=function(e){this.C=e},i.yj=function(){return this.C},i.si=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.pf(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.o&&(this.i=n-this.g-this.h)}}},i.$d=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.pf(t),this.g=Math.max(this.g,n),null!=this.i&&this.F&&!this.o&&(this.i=i-this.g-this.h)}},i.ri=function(e,t){this.pf(e),1/0==t||this.V()||(this.g=Math.max(this.g,t))},i.Ij=function(){return this.g},i.hf=function(){this.o=!0},i.ik=function(){return this.o},i.mh=function(e){this.m=e},i.Dj=function(){return this.m},i.pf=function(e){null==this.j?this.j=e:this.I||(this.j=Math.min(this.j,e))},i.Rg=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.V=function(){return 1/0==this.l&&!this.B},i.Tc=function(){return 1/0!=this.l&&!this.B},i.Gb=function(){return Math.max(this.H,this.Ac()-this.s)},i.Ni=function(e){this.H=e},i.Ac=function(){return this.V()||this.Tc()?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.Qd=function(e){var t=Math.max(this.j,this.H);return 1/0==this.s?Math.ceil(1e3*t)/1e3:Math.max(t,Math.min(this.Ac()-this.s+e,this.Fb()))},i.Xb=function(){return this.Qd(0)},i.Fb=function(){return Math.max(0,this.Ac()-(this.V()||this.Tc()?this.C:0))},i.Zi=function(){return!(null==this.i||null!=this.g&&this.F)},i.Ji=function(e){this.G=e},i.tj=function(){return this.G},F("shaka.media.PresentationTimeline",su),su.prototype.getAvailabilityTimeOffset=su.prototype.tj,su.prototype.setAvailabilityTimeOffset=su.prototype.Ji,su.prototype.usingPresentationStartTime=su.prototype.Zi,su.prototype.getSeekRangeEnd=su.prototype.Fb,su.prototype.getSeekRangeStart=su.prototype.Xb,su.prototype.getSafeSeekRangeStart=su.prototype.Qd,su.prototype.getSegmentAvailabilityEnd=su.prototype.Ac,su.prototype.setUserSeekStart=su.prototype.Ni,su.prototype.getSegmentAvailabilityStart=su.prototype.Gb,su.prototype.isInProgress=su.prototype.Tc,su.prototype.isLive=su.prototype.V,su.prototype.offset=su.prototype.offset,su.prototype.notifyMaxSegmentDuration=su.prototype.Rg,su.prototype.notifyMinSegmentStartTime=su.prototype.pf,su.prototype.getInitialProgramDateTime=su.prototype.Dj,su.prototype.setInitialProgramDateTime=su.prototype.mh,su.prototype.isStartTimeLocked=su.prototype.ik,su.prototype.lockStartTime=su.prototype.hf,su.prototype.getMaxSegmentEndTime=su.prototype.Ij,su.prototype.notifyPeriodDuration=su.prototype.ri,su.prototype.notifySegments=su.prototype.$d,su.prototype.notifyTimeRange=su.prototype.si,su.prototype.getDelay=su.prototype.yj,su.prototype.setDelay=su.prototype.lh,su.prototype.getSegmentAvailabilityDuration=su.prototype.We,su.prototype.setSegmentAvailabilityDuration=su.prototype.Gf,su.prototype.setStatic=su.prototype.Zc,su.prototype.setClockOffset=su.prototype.Ki,su.prototype.getPresentationStartTime=su.prototype.Nj,su.prototype.setDuration=su.prototype.pb,su.prototype.setPresentationStartTime=su.prototype.Li,su.prototype.getMaxSegmentDuration=su.prototype.Hj,su.prototype.getDuration=su.prototype.getDuration,uu.prototype.release=function(){this.o&&(this.o.release(),this.o=null),null!=this.i&&(this.i.stop(),this.i=null),this.m&&(this.m.release(),this.m=null),this.g=this.B=this.s=null},uu.prototype.tf=function(){this.A=!0,this.i&&this.i.Fa(this.h.gapJumpTimerTime),lu(this)},cu.prototype.release=function(){this.h&&this.h.release(),this.j=this.h=null},du.prototype.release=function(){this.h&&this.h.release(),this.h=null};var fu=new ee((function(){return new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]])}));function gu(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 $,this.i=new wu(e),pu(this.g,HTMLMediaElement.HAVE_METADATA,this.h,(function(){yu(r,r.j())}))}function mu(e){return e.o?e.g.currentTime:e.j()}function vu(e,t){0<e.g.readyState?Tu(e.i,t):pu(e.g,HTMLMediaElement.HAVE_METADATA,e.h,(function(){yu(e,e.j())}))}function yu(e,t){.001>Math.abs(e.g.currentTime-t)?bu(e):(e.h.Aa(e.g,"seeking",(function(){bu(e)})),Tu(e.i,e.g.currentTime&&0!=e.g.currentTime?e.g.currentTime:t))}function bu(e){e.o=!0,e.h.D(e.g,"seeking",(function(){return e.m()})),e.s(e.g.currentTime)}function wu(e){var t=this;this.g=e,this.m=10,this.j=this.l=this.i=0,this.h=new Ti((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 Tu(e,t){e.l=e.g.currentTime,e.j=t,e.i=e.m,e.g.currentTime=t,e.h.Fa(.1)}function xu(e){this.g=e,this.i=!1,this.h=null,this.j=new $}function Su(e){return e.g.getStartDate&&(e=e.g.getStartDate().getTime(),!isNaN(e))?e/1e3:null}function Au(e,t){return 0<(e=e.g.seekable).length&&(t=Math.max(e.start(0),t),t=Math.min(e.end(e.length-1),t)),t}function ku(e,t,n,i,r,a){var o=this;this.h=e,this.g=t.presentationTimeline,this.l=n,this.s=r,this.o=null,this.j=new uu(e,t.presentationTimeline,n,a),this.i=new gu(e,(function(){e:{var e=o.j;e.l=!0,e.A=!1,e.i&&e.i.Fa(e.h.gapJumpTimerTime),lu(e);var t=mu(o.i);if(e=Cu(o,t),!ft()&&.001<Math.abs(e-t)){t=!1;var n=te().Gi();if(n){var i=Date.now()/1e3;(!o.o||o.o<i-n)&&(o.o=i,t=!0)}else t=!0;if(t){vu(o.i,e),e=void 0;break e}}o.s(),e=void 0}return e}),(function(e){var t=o.j;t.g.seeking&&!t.l&&(t.l=!0,t.j=e),t.i&&t.i.Fa(t.h.gapJumpTimerTime),lu(t)}),(function(){return Eu(o,i)})),this.m=new Ti((function(){if(0!=o.h.readyState&&!o.h.paused){var e=mu(o.i),t=o.g.Xb(),n=o.g.Fb();3>n-t&&(t=n-3),e<t&&(e=Cu(o,e),o.h.currentTime=e)}}))}function Eu(e,t){return null==t?t=1/0>e.g.getDuration()?e.g.Xb():e.g.Fb():t instanceof Date?t=t.getTime()/1e3-(e.g.m||e.g.i):0>t&&(t=e.g.Fb()+t),Iu(e,Mu(e,t))}function Iu(e,t){var n=e.g.getDuration();return t>=n?n-e.l.durationBackoff:t}function Cu(e,t){var n=e.l.rebufferingGoal,i=e.l.safeSeekOffset,r=e.g.Xb(),a=e.g.Fb(),o=e.g.getDuration();3>a-r&&(r=a-3);var s=e.g.Qd(n),u=e.g.Qd(i);return n=e.g.Qd(n+i),t>=o?Iu(e,t):t>a?a-e.l.safeSeekEndOffset:t<r?e.g.V()&&e.l.returnToEndOfLiveWindowWhenOutside?a-e.l.safeSeekEndOffset:Xo(e.h.buffered,u)?u:n:t>=s||Xo(e.h.buffered,t)?t:n}function Mu(e,t){var n=e.g.Xb();return t<n?n:t>(e=e.g.Fb())?e:t}function Du(e){this.g=e,this.m=null,this.i=0,this.o=!1}function Pu(e){return e.g[0]||null}function Ru(e,t,n){return new Du([e=new Vo(e,e+t,(function(){return n}),0,null,null,e,e,e+t)])}function Lu(e,t,n,i){this.i=e,this.h=t,this.g=n,this.reverse=i}function Nu(){Du.call(this,[]),this.h=[]}function Ou(e){var t=this;this.g=e,this.j=!1,this.i=this.g.Ve(),this.h=new Ti((function(){t.g.ni(.25*t.i)}))}function ju(e){e.h.stop();var t=e.j?0:e.i;if(0<=t)try{return void(e.g.Ve()!=t&&e.g.nh(t))}catch(e){}e.h.Fa(.25),0!=e.g.Ve()&&e.g.nh(0)}function Uu(e){var t=this;this.j=e,this.h=new $,this.g=new Set,this.i=new Ti((function(){_u(t,!1)})).Jb(),e.paused||this.i.Fa(.25),this.h.D(e,"playing",(function(){t.i.Jb().Fa(.25)})),this.h.D(e,"pause",(function(){t.i.stop()}))}function _u(e,t){for(var n=e.j.currentTime,i=(e=l(e.g)).next();!i.done;i=e.next())i.value.j(n,t)}function Bu(e){Lr.call(this),this.g=new Map,this.h=e}function Fu(e,t,n){return!!((e=e.h()[n])&&0<e.length&&(n=e[e.length-1].end,t>=e[0].start&&t<n))}function Vu(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 Hu(e){Lr.call(this),this.h=new Map,this.i=e,this.g=null}function Ku(e,t){var n=t.schemeIdUri+"_"+t.id+"_"+t.startTime.toFixed(1)+"_"+t.endTime.toFixed(1);e.h.has(n)||(e.h.set(n,t),t=new Dr("regionadd",new Map([["region",t]])),e.dispatchEvent(t),function(e){e.g||(e.g=new Ti((function(){for(var t=e.i(),n=l(e.h),i=n.next();!i.done;i=n.next()){var r=l(i.value);i=r.next().value,(r=r.next().value).endTime<t.start&&(e.h.delete(i),i=new Dr("regionremove",new Map([["region",r]])),e.dispatchEvent(i))}!e.h.size&&e.g&&(e.g.stop(),e.g=null)})).Fa(2))}(e))}function Gu(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 zu(e,t){e.l=t;for(var n=(e=l(e.h.values())).next();!n.done;n=e.next())n.value.g=t}function qu(e,t,n){if(n=void 0!==n&&n,!e.i.segmentIndex)return Promise.resolve();if(e.g||(e.g=e.i.segmentIndex.Wb(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.endByte&&(i=!1),2==n.Cc()&&(i=!1),n.Yb(!1)&&(i=!1),i&&n.Y&&t.push(Xu(e,n.Y)),i&&!e.h.has(n)&&(i=new Zu(e.l),t.push(el(i,n,e.i)),e.h.set(n,i))}return Ju(e),Promise.all(t)}function Xu(e,t){if(!e.i.segmentIndex||t.Yb()||Array.from(e.j.keys()).some((function(e){return Fo(e,t)})))return Promise.resolve();var n=new Zu(e.l),i=el(n,t,e.i);return e.j.set(t,n),i}function Wu(e,t){for(var n=(t=l(t.keys())).next();!n.done;n=t.next())(n=n.value)&&Qu(e,n)}function Yu(e){Wu(e,e.h),Wu(e,e.j),e.g=null}function Ju(e){for(var t=Array.from(e.h.keys()),n=l(e.j.keys()),i=n.next(),r={};!i.done;r={Lg:void 0},i=n.next())r.Lg=i.value,t.some(function(e){return function(t){return Fo(t.Y,e.Lg)}}(r))||Qu(e,r.Lg)}function $u(e,t){e.m=t;for(var n=Array.from(e.h.keys());n.length>t;){var i=n.pop();i&&Qu(e,i)}Ju(e)}function Qu(e,t){var n=e.h;t instanceof Bo&&(n=e.j),e=n.get(t),n.delete(t),e&&e.abort()}function Zu(e){this.g=e,this.ae=this.sh=null}function el(e,t,n){var i=new Uint8Array(0);return e.ae=e.g(t,n,(function(t){return R((function(n){if(1==n.g)return i=0<i.byteLength?$e(i,t):t,e.sh?w(n,e.sh(i),3):n.u(0);i=new Uint8Array(0),T(n)}))})),e.ae.promise.catch((function(e){return e instanceof Ne&&7001==e.code?Promise.resolve():Promise.reject(e)}))}function tl(e){var t=ui(e);return{type:t.split("/")[0],mimeType:t,codecs:e=li(e),language:null,height:null,width:null,channelCount:null,sampleRate:null,closedCaptions:new Map,oe:null,colorGamut:null,frameRate:null}}function nl(e){for(var t=new Set,n=[],i=(e=l(e)).next();!i.done;i=e.next()){var r=si(i=i.value);t.has(r)||(n.push(i),t.add(r))}return t=it("audio",n),i=it("video",n),e=it(rt,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?ht('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 il(t,n,i){var r,a,o,s,u;return R((function(l){if(1==l.g)return(r=n).cryptoKey?l.u(2):w(l,r.fetchKey(),3);if(!(a=r.iv))for(a=De(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 rl(e,t,n,i,r){return e=Br(e,i,r),0==t&&null==n||(e.headers.Range=n?"bytes="+t+"-"+n:"bytes="+t+"-"),e}function al(e,t){var n=this;this.g=t,this.j=e,this.i=null,this.K=new Map,this.C=1,this.A=this.o=null,this.P=0,this.h=new Map,this.I=!1,this.S=null,this.B=!1,this.l=new Xr((function(){return function(e){var t,n,i,r,a,o;return R((function(s){if(1==s.g){for(e.s&&e.s.stop(),e.s=null,e.H&&e.H.stop(),e.H=null,t=[],n=l(e.h.values()),i=n.next();!i.done;i=n.next())Al(r=i.value),t.push(kl(r)),r.$&&(Yu(r.$),r.$=null);for(a=l(e.m.values()),o=a.next();!o.done;o=a.next())Yu(o.value);return w(s,Promise.all(t),2)}e.h.clear(),e.m.clear(),e.g=null,e.j=null,e.i=null,e.G=null,T(s)}))}(n)})),this.M=Date.now()/1e3,this.m=new Map,this.N={projection:null,hfov:null},this.W=0,this.U=1/0,this.F=null,this.L=[],this.s=new Ti((function(){if(n.j&&n.g)if(n.j.presentationTimeline.V()){var e=n.j.presentationTimeline.Xb(),t=n.j.presentationTimeline.Fb();1<t-e?function(e,t,n){R((function(i){return e.H.g||e.g.error||e.L||e.F||Os(e)||js(e)?i.return():w(i,Js(e,(function(){Os(e)||js(e)||e.i.setLiveSeekableRange(t,n)})),0)}))}(n.g.Z,e,t):Ks(n.g.Z)}else Ks(n.g.Z),n.s&&n.s.stop();else n.s&&n.s.stop()})),this.G=null,this.H=new Ti((function(){var e=n.g.video;!e.ended&&n.G&&(e.currentTime=n.G,n.G=null)}))}function ol(e,t){for(var n=0>e.g.ub(),i=l(e.h.values()),r=i.next();!r.done;r=i.next())(r=r.value).sa&&r.sa.Dd(n),r.$&&r.$.Dd(n);for(r=(i=l(e.m.values())).next();!r.done;r=i.next())r.value.Dd(n);(n=e.h.get("video"))&&(i=n.stream)&&(t?(t=i.trickModeVideo)&&!n.Fc&&(ll(e,t,!1,0,!1),n.Fc=i):(t=n.Fc)&&(n.Fc=null,ll(e,t,!0,0,!1)))}function sl(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.o=t,e.I&&(t.video&&ll(e,t.video,n,i,r,a),t.audio&&ll(e,t.audio,n,i,r,a))}function ul(e,t){R((function(n){if(1==n.g)return e.F=null,e.A=t,e.I?t.segmentIndex?n.u(2):w(n,t.createSegmentIndex(),2):n.return();ll(e,t,!0,0,!1),T(n)}))}function ll(e,t,n,i,r,a){var o=e.h.get(t.type);o||t.type!=rt?o&&(o.Fc&&(t.trickModeVideo?(o.Fc=t,t=t.trickModeVideo):o.Fc=null),o.stream!=t||r)&&(e.m.has(t)?o.$=e.m.get(t):o.$&&function(e,t){t&&t!==e.i&&(Yu(e),e.i=t)}(o.$,t),t.type==rt&&o.stream!=t&&(r=ni(t.mimeType,t.codecs),Ns(e.g.Z,r,e.j.sequenceMode,t.external)),!e.m.has(o.stream)&&o.stream.closeSegmentIndex&&(o.Qa?(r="("+o.type+":"+o.stream.id+")",e.K.has(r)||e.K.set(r,o.stream.closeSegmentIndex)):o.stream.closeSegmentIndex()),r=o.stream.isAudioMuxedInVideo!=t.isAudioMuxedInVideo,o.stream=t,o.sa=null,o.ag=!!a,t.dependencyStream?o.yc=hl(e,t.dependencyStream):o.yc=null,r&&(o.mb=null,o.lc=null,o.kc=null,t.isAudioMuxedInVideo&&(t=null,"video"===o.type?t=e.h.get("audio"):"audio"===o.type&&(t=e.h.get("video")),t&&(kl(t).catch((function(){})),t.mb=null,t.lc=null,t.kc=null,dl(e,t),cl(e,t).catch((function(t){e.g&&e.g.onError(t)}))))),n?o.Kc?o.Sf=!0:o.Qa?(o.Ic=!0,o.Oe=i,o.Sf=!0):(Al(o),xl(e,o,!0,i).catch((function(t){e.g&&e.g.onError(t)}))):o.Qa||o.zb||Sl(e,o,0),cl(e,o).catch((function(t){e.g&&e.g.onError(t)}))):function(e,t){var n,i,r,a,o;R((function(s){switch(s.g){case 1:return n=at,e.P++,i=e.P,x(s,2),w(s,Vs(e.g.Z,n.Ta),4);case 4:A(s,3);break;case 2:r=k(s),e.g&&e.g.onError(r);case 3:a=ni(t.mimeType,t.codecs),Ns(e.g.Z,a,e.j.sequenceMode,t.external),(e.g.Z.ha.isTextVisible()||e.i.alwaysStreamText)&&e.P==i&&(o=hl(e,t),e.h.set(n.Ta,o),Sl(e,o,0)),T(s)}}))}(e,t)}function cl(e,t){var n,i,r;return R((function(a){if(1==a.g)return t.Hb?(n=t.stream,i=t.Hb,n.segmentIndex?a.u(2):w(a,n.createSegmentIndex(),2)):a.return();if(4!=a.g)return!(r=n.dependencyStream)||r.segmentIndex?a.u(4):w(a,r.createSegmentIndex(),4);if(t.Hb!=i||t.stream!=n)return a.return();var o=e.g.Qc(),s=_s(e.g.Z,t.type),u=t.stream.segmentIndex.find(t.Ia?t.Ia.endTime:o),l=null==u?null:t.stream.segmentIndex.get(u);u=l&&l.endByte?l.endByte-l.startByte:null,l&&!u&&(u=(l.endTime-l.getStartTime())*(t.stream.bandwidth||0)/8),u?((l=l.Y)&&(u+=(l.endByte?l.endByte-l.startByte:null)||0),o=8*u/(l=e.g.getBandwidthEstimate())<(s||0)-o-e.i.rebufferingGoal||t.Hb.h.g>u):o=!1,o&&t.Hb.abort(),T(a)}))}function dl(e,t){t.Kc||t.Ic||(t.Qa?(t.Ic=!0,t.Oe=0):null==Us(e.g.Z,t.type)?null==t.zb&&Sl(e,t,0):(Al(t),xl(e,t,!1,0).catch((function(t){e.g&&e.g.onError(t)}))))}function hl(e,t){var n={stream:t,type:t.type,sa:null,$:pl(e,t),Ia:null,mb:null,gf:null,lc:null,kc:null,df:null,ef:null,Fc:null,endOfStream:!1,Qa:!1,zb:null,Ic:!1,Oe:0,Sf:!1,Kc:!1,Yc:!0,ag:!1,$g:!1,Sd:!1,Hb:null,yc:null};return t.dependencyStream&&(n.yc=hl(e,t.dependencyStream)),n}function pl(e,t){if("video"===t.type&&e.i.disableVideoPrefetch||"audio"===t.type&&e.i.disableAudioPrefetch||t.type===rt&&("application/cea-608"==t.mimeType||"application/cea-708"==t.mimeType)||t.type===rt&&e.i.disableTextPrefetch)return null;if(e.m.has(t))return e.m.get(t);var n=e.h.get(t.type);return(n=n&&n.$)&&t===n.i?n:0<e.i.segmentPrefetchLimit?new Gu(e.i.segmentPrefetchLimit,t,(function(t,n,i){return Tl(t,n,i||null,e.i.retryParameters,e.g.pc)}),0>e.g.ub()):null}function fl(t,n){var i,r,a,o,s,u,c,d,h;return R((function(p){switch(p.g){case 1:if(Wr(t.l),i=at,n.Qa||null==n.zb||n.Kc)return p.return();if(n.zb=null,!n.Ic){p.u(2);break}return w(p,xl(t,n,n.Sf,n.Oe),3);case 3:return p.return();case 2:if(function(e,t){for(var n=l(e.K.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.K.delete(i))}}(t,n),n.stream.segmentIndex){p.u(4);break}return r=n.stream,x(p,5),w(p,n.stream.createSegmentIndex(),7);case 7:A(p,6);break;case 5:return a=k(p),w(p,El(t,n,a),8);case 8:return p.return();case 6:if(r!=n.stream)return r.closeSegmentIndex&&r.closeSegmentIndex(),n.Qa||n.zb||Sl(t,n,0),p.return();case 4:if(!n.yc){p.u(9);break}if(n.yc.stream.segmentIndex){p.u(9);break}return x(p,11),w(p,n.yc.stream.createSegmentIndex(),13);case 13:A(p,9);break;case 11:k(p);case 9:x(p,14),o=function(t,n){if(bl(n))return function(e,t){var n=_s(e,"video")||0;vi(e.h,t,n)}(t.g.Z,n.stream.originalId||""),null;if(n.type==rt&&function(e){e.h&&vi(e.h,"",0)}(t.g.Z),n.stream.isAudioMuxedInVideo)return null;var i=t.i.updateIntervalSeconds/Math.max(1,Math.abs(t.g.ub()));if(!Ls(t.g.Z)&&n.type!=rt)return i/2;var r=t.g.Qc();if("audio"===n.type)for(var a=l(t.m.keys()),o=a.next();!o.done;o=a.next())(o=t.m.get(o.value)).$a(r,!0),qu(o,r);a=n.Ia?n.Ia.endTime:r;var s=function(e,t,n){return t==rt?null==(e=e.h).h||e.h<n?0:e.h-Math.max(n,e.g):Wo(e=Bs(e,t),n)}(t.g.Z,n.type,r);o=Math.max(1,Math.max(t.i.rebufferingGoal,t.i.bufferingGoal)*t.C);var u=t.j.presentationTimeline.getDuration()-a,c=_s(t.g.Z,n.type);if(1e-6>u&&c)return n.endOfStream=!0,"video"==n.type&&(t=t.h.get(rt))&&bl(t)&&(t.endOfStream=!0),null;if(n.endOfStream=!1,s>=o)return i/2;if(u=!n.sa,c=function(e,t,n,i){if(t.sa)return(n=t.sa.current())&&t.Ia&&.001>Math.abs(t.Ia.startTime-n.startTime)&&(n=t.sa.next().value),n;if(t.Ia||i)return n=t.Ia?t.Ia.endTime:i,e=0>e.g.ub(),t.stream.segmentIndex&&(t.sa=t.stream.segmentIndex.Wb(n,!1,e)),t.sa&&t.sa.next().value;i=e.j.sequenceMode||Cl(e)?0:e.i.inaccurateManifestTolerance;var r=Math.max(n-i,0);e=0>e.g.ub();var a=null;return i&&(t.stream.segmentIndex&&(t.sa=t.stream.segmentIndex.Wb(r,!1,e)),a=t.sa&&t.sa.next().value),a||(t.stream.segmentIndex&&(t.sa=t.stream.segmentIndex.Wb(n,!1,e)),a=t.sa&&t.sa.next().value),a}(t,n,r,c),!c)return i;s=n.mb;var d=c.Y;s&&d&&Fo(d,s)&&(s.g=d.g),s=!1,u&&n.ag&&(s=!0,n.ag=!1),u=1/0;for(var h=(d=l(d=Array.from(t.h.values()))).next();!h.done;h=d.next())bl(h=h.value)||h.sa&&!h.sa.current()||(u=Math.min(u,h.Ia?h.Ia.endTime:r));return a>=u+t.j.presentationTimeline.h?i:(n.$&&n.sa&&!t.m.has(n.stream)&&(n.$.$a(c.startTime+.001),qu(n.$,c.startTime).catch((function(){}))),Cl(t)&&function(e,t,n){if(t.type===rt)return!1;var i=t.mb;if(!i)return!1;var r=n.Y;if(n=i.g!==r.g,"reset_to_encrypted"===e.i.crossBoundaryStrategy&&(i.encrypted||r.encrypted||(n=!1),i.encrypted&&(e.i.crossBoundaryStrategy="keep")),"RESET_ON_ENCRYPTION_CHANGE"===e.i.crossBoundaryStrategy&&i.encrypted==r.encrypted&&(n=!1),n&&t.Yc){var a=e.g.video,o=a.paused;Il(e,!0).then((function(){var t=(new Map).set("oldEncrypted",i.encrypted).set("newEncrypted",r.encrypted);e.g.onEvent(new Dr("boundarycrossed",t)),o||a.play()}))}return n}(t,n,c)||(function(t,n,i,r,a){var o,s,u,c,d,h,p,f,g,m,v,y,b,S,E,I;return R((function(C){switch(C.g){case 1:if(o=at,s=n.stream,u=n.sa,n.Qa=!0,x(C,2),2==r.Cc())throw new Ne(1,1,1011);return w(C,function(e,t,n,i){var r,a,o,s,u,c,d,h,p,f,g,m,v,y,b,T;return R((function(S){switch(S.g){case 1:if(r=at,a=null==t.Ia,o=[],s=Math.max(0,Math.max(n.appendWindowStart,e.W)-.1),u=Math.min(n.appendWindowEnd,e.U)+.1,c=n.codecs||t.stream.codecs,d=si(c),h=ui(n.mimeType||t.stream.mimeType),(p=n.timestampOffset)==t.gf&&s==t.lc&&u==t.kc&&d==t.df&&h==t.ef){S.u(2);break}if(f=t.df&&t.ef&&function(e,t,n,i,r){return(e=tu(e,t,n,i,r)).ec&&e.ec.destroy(),e.type==au}(e.g.Z,t.type,h,c,Dl(e)),!f){S.u(3);break}if(g=null,t.type===r.Ca?g=e.h.get(r.ea):t.type===r.ea&&(g=e.h.get(r.Ca)),!g){S.u(3);break}return w(S,kl(g).catch((function(){})),5);case 5:g.mb=null,g.lc=null,g.kc=null,dl(e,g);case 3:return w(S,ml(e,t,p,s,u,n,d,h),2);case 2:return Fo(n.Y,t.mb)||(t.mb=n.Y,n.l&&n.Y&&(m=wl(e,t,n.Y),v=function(){var a,o,s,u,c,d,h,p,f;return R((function(g){switch(g.g){case 1:return x(g,2),w(g,m,4);case 4:return a=g.h,Wr(e.l),o=null,s=new Map,u={projection:null,hfov:null},(c=new ta).box("moov",na).box("trak",na).box("mdia",na).R("mdhd",(function(e){o=no(e.reader,e.version).timescale})).box("hdlr",(function(e){switch((e=e.reader).skip(8),e.Vc()){case"soun":s.set(r.ea,o);break;case"vide":s.set(r.Ca,o)}o=null})),t.type===r.Ca&&c.box("minf",na).box("stbl",na).R("stsd",ia).box("encv",ra).box("avc1",ra).box("avc3",ra).box("hev1",ra).box("hvc1",ra).box("dvav",ra).box("dva1",ra).box("dvh1",ra).box("dvhe",ra).box("dvc1",ra).box("dvi1",ra).box("vexu",na).box("proj",na).R("prji",(function(e){e=e.reader.Vc(),u.projection=e})).box("hfov",(function(e){e=e.reader.T()/1e3,u.hfov=e})),c.parse(a,!0,!0),t.type===r.Ca&&function(e,t){if(e.N.projection!=t.projection||e.N.hfov!=t.hfov){if(null!=t.projection||null!=t.hfov){var n=(new Map).set("detail",t);n=new Dr("spatialvideoinfo",n)}else n=new Dr("nospatialvideoinfo");n.cancelable=!0,e.g.onEvent(n),e.N=t}}(e,u),s.has(t.type)?n.Y.timescale=s.get(t.type):null!=o&&(n.Y.timescale=o),(d=t.stream.segmentIndex)instanceof Nu&&(h=function(e,t){for(var n=(e=l(e.h)).next();!n.done;n=e.next())if(null!=(n=n.value).find(t))return n.Pe();return-1}(d,n.startTime)),p=t.stream.closedCaptions&&0<t.stream.closedCaptions.size,w(g,e.g.Kh(t.type,a),5);case 5:return w(g,Fs(e.g.Z,t.type,a,null,t.stream,p,t.Yc,i,!1,!1,h),6);case 6:A(g,0);break;case 2:throw f=k(g),t.mb=null,f}}))},y=n.startTime,a&&null!=(b=_s(e.g.Z,t.type))&&(y=b),e.g.xk(y,n.Y),o.push(v()))),T=t.Ia?t.Ia.i:-1,n.i!=T&&o.push(function(e,t,n){var i,r;return R((function(a){return 1==a.g?t==(i=at).Ta?a.return():(t==i.Ca&&(e.Pa=new Sr),!e.G||(r=_s(e,t))&&.15>Math.abs(r-n)?a.return():(Ys(e,t,(function(){return zs(e,t)}),null),e.m&&Ys(e,i.ea,(function(){return zs(e,i.ea)}),null),w(a,Ys(e,t,(function(){return qs(e,t,n)}),null),2))):e.m?w(a,Ys(e,i.ea,(function(){return qs(e,i.ea,n)}),null),0):a.u(0)}))}(e.g.Z,t.type,n.startTime)),w(S,Promise.all(o),0)}}))}(t,n,r,a),4);case 4:return Wr(t.l),t.B?C.return():(c="video/mp4"==s.mimeType||"audio/mp4"==s.mimeType,d=e.ReadableStream,t.i.lowLatencyMode&&t.j.isLowLatency&&d&&c&&("HLS"!=t.j.type||r.m)?(p=new Uint8Array(0),g=f=!1,v=function(e){var o,u,l;return R((function(c){switch(c.g){case 1:if(f)return c.return();if(g=!0,Wr(t.l),t.B)return c.return();if(x(c,2),p=$e(p,e),o=!1,u=0,(new ta).box("mdat",(function(e){u=e.size+e.start,o=!0})).parse(p,!1,!0),!o){c.u(4);break}return l=p.subarray(0,u),p=p.subarray(u),w(c,vl(t,n,i,s,r,l,!0,a),5);case 5:n.$&&n.sa&&qu(n.$,r.startTime,!0);case 4:A(c,0);break;case 2:m=k(c),T(c)}}))},w(C,wl(t,n,r,v),9)):w(C,wl(t,n,r),7));case 7:return h=C.h,Wr(t.l),t.B?C.return():(Wr(t.l),n.Ic?(n.Qa=!1,Sl(t,n,0),C.return()):w(C,vl(t,n,i,s,r,h,!1,a),6));case 9:if(y=C.h,m)throw m;if(g){C.u(10);break}return f=!0,Wr(t.l),t.B?C.return():n.Ic?(n.Qa=!1,Sl(t,n,0),C.return()):w(C,vl(t,n,i,s,r,y,!1,a),10);case 10:n.$&&n.sa&&qu(n.$,r.startTime,!0);case 6:if(Wr(t.l),t.B)return C.return();n.Ia=r,u.next(),n.Qa=!1,n.$g=!1,b=t.g.Z.Nb(),S=b[n.type],JSON.stringify(S),n.Ic||(E=null,n.type===o.Ca?E=t.h.get(o.ea):n.type===o.ea&&(E=t.h.get(o.Ca)),E&&E.type==o.ea?t.g.tf(r,n.stream,E.stream.isAudioMuxedInVideo):t.g.tf(r,n.stream,n.stream.codecs.includes(","))),Al(n),Sl(t,n,0),A(C,0);break;case 2:if(I=k(C),Wr(t.l,I),t.B)return C.return();if(n.Qa=!1,7001==I.code)n.Qa=!1,Al(n),Sl(t,n,0),C.u(0);else{if(n.type!=o.Ta||!t.i.ignoreTextStreamFailures)return 3017==I.code?w(C,function(e,t,n){var i,r,a;return R((function(o){if(1==o.g){if(Array.from(e.h.values()).some((function(e){return e!=t&&e.$g})))return o.u(2);if(i=0===e.i.maxDisabledTime&&1011==n.code?1:e.i.maxDisabledTime,e.g.disableStream(t.stream,i))return o.return();if(e.i.avoidEvictionOnQuotaExceededError)return Sl(e,t,4),o.return();if(20<(r=Math.round(100*e.C)))e.C-=.2;else{if(!(4<r))return t.Sd=!0,e.B=!0,e.g.onError(n),o.return();e.C-=.04}return t.$g=!0,a=e.g.Qc(),w(o,yl(e,t,a),2)}Sl(e,t,4),T(o)}))}(t,n,I),0):(n.Sd=!0,1==I.category&&n.$&&Qu(n.$,r),I.severity=2,w(C,El(t,n,I),0));t.h.delete(o.Ta),C.u(0)}}}))}(t,n,r,c,s).catch((function(){})),n.yc&&gl(t,n.yc,r,o)),null)}(t,n),null!=o&&(Sl(t,n,o),n.Sd=!1),A(p,15);break;case 14:return s=k(p),w(p,El(t,n,s),16);case 16:return p.return();case 15:if(n.type===i.Ta)return p.return();if(u=[n],c=n.type===i.ea?i.Ca:i.ea,(d=t.h.get(c))&&u.push(d),!t.I||!u.every((function(e){return e.endOfStream}))){p.u(0);break}return w(p,t.g.Z.endOfStream(),18);case 18:Wr(t.l),0!=(h=t.g.Z.getDuration())&&h<t.j.presentationTimeline.getDuration()&&t.j.presentationTimeline.pb(h),T(p)}}))}function gl(e,t,n,i){var r,a,o,s,u,l,d,h,p,f;return R((function(g){switch(g.g){case 1:for(r=t.stream,s=(o=(a=r.segmentIndex)&&a.Wb(n))&&o.next().value;s&&e.L.includes(s.startTime);)s=o&&o.next().value;if(!s){g.u(0);break}if(!(u=s.Y)||Fo(u,t.mb)){g.u(3);break}return t.mb=u,x(g,4),w(g,wl(e,t,u),6);case 6:l=g.h;var m=e.g.Z;m.M&&lt(m.M,l,0,r),e.L=[],A(g,3);break;case 4:throw d=k(g),t.mb=null,d;case 3:if(t.Ia&&t.Ia==s){g.u(0);break}return t.Ia=s,x(g,8),w(g,wl(e,t,s),10);case 10:h=g.h,(m=e.g.Z).M&&lt(m.M,h,0,r),e.L.push(s.startTime),A(g,9);break;case 8:throw p=k(g),t.Ia=null,p;case 9:if(f=Math.max.apply(Math,[0].concat(c(e.L))),e.g.Qc()+i>f)return w(g,gl(e,t,s.startTime,i),0);g.u(0)}}))}function ml(e,t,n,i,r,a,o,s){var u,l,c,d,h;return R((function(p){switch(p.g){case 1:if(u=at,l=Dl(e),x(p,2),t.lc=i,t.kc=r,o&&(t.df=o),s&&(t.ef=s),t.gf=n,c=e.j.sequenceMode||"HLS"==e.j.type,d=null,t.type===u.Ca?d=e.h.get(u.ea):t.type===u.ea&&(d=e.h.get(u.Ca)),!(d&&d.stream&&d.stream.isAudioMuxedInVideo)){p.u(4);break}return w(p,Hs(e.g.Z,d.type,n,i,r,c,d.stream.mimeType,d.stream.codecs,l),4);case 4:return w(p,Hs(e.g.Z,t.type,n,i,r,c,a.mimeType||t.stream.mimeType,a.codecs||t.stream.codecs,l),6);case 6:A(p,0);break;case 2:throw h=k(p),t.lc=null,t.kc=null,t.df=null,t.ef=null,t.gf=null,h}}))}function vl(e,t,n,i,r,a,o,s){var u,l,c,d;return o=void 0!==o&&o,s=void 0!==s&&s,R((function(h){switch(h.g){case 1:return u=i.closedCaptions&&0<i.closedCaptions.size,e.i.shouldFixTimestampOffset&&(l="video/mp4"==i.mimeType||"audio/mp4"==i.mimeType,c=null,r.Y&&(c=r.Y.timescale),l&&c&&"video"===i.type&&"DASH"==e.j.type&&(new ta).box("moof",na).box("traf",na).R("tfdt",(function(n){var i,a,o,s,u;return R((function(l){return i=to(n.reader,n.version),(a=i.baseMediaDecodeTime)?(o=-a/c,(Number(t.gf)||0)<o?(s=t.lc,u=t.kc,w(l,ml(e,t,o,s,u,r),0)):l.u(0)):l.return()}))})).parse(a,!1,o)),w(h,yl(e,t,n),2);case 2:return Wr(e.l),d=t.Yc,t.Yc=!1,w(h,e.g.Kh(t.type,a),3);case 3:return w(h,Fs(e.g.Z,t.type,a,r,i,u,d,s,o),4);case 4:Wr(e.l),T(h)}}))}function yl(e,t,n){var i,r,a,o,s,u,c,d,h;return R((function(p){return 1==p.g?((i=t.stream.segmentIndex)instanceof Nu&&(i.$a(e.j.presentationTimeline.Gb()),r=[],function(e){for(var t=(e=l(e.h)).next();!t.done;t=e.next())n=t.value,r.push(n.Pe());var n}(i)),a=Math.max(e.i.bufferBehind*e.C,e.j.presentationTimeline.h),null==(o=Us(e.g.Z,t.type))?(e.F==t&&(e.F=null),p.return()):(s=n-o,u=e.i.evictionGoal,c=e.j.presentationTimeline.Xb(),d=e.j.presentationTimeline.Fb(),h=s-a,d-c>u&&(h=Math.max(s-a,c-u-o)),h<=u?p.return():w(p,e.g.Z.remove(t.type,o,o+h,r),2))):4!=p.g?(Wr(e.l),e.F?w(p,yl(e,e.F,n),4):p.u(0)):(Wr(e.l),void T(p))}))}function bl(e){return e&&e.type==rt&&("application/cea-608"==e.stream.mimeType||"application/cea-708"==e.stream.mimeType)}function wl(e,t,n,i){var r,a,o,s,u;return R((function(l){switch(l.g){case 1:if(r=n.Yb())return l.return(r);if(a=null,t.$){var c=t.$,d=c.h;n instanceof Bo&&(d=c.j),d.has(n)?(c=d.get(n),i&&(c.sh=i),a=c.ae):a=null}return a||(a=Tl(n,t.stream,i||null,e.i.retryParameters,e.g.pc)),o=0,t.sa&&(o=t.sa.h),t.Hb=a,w(l,a.promise,2);case 2:if(s=l.h,t.Hb=null,u=s.data,!n.aesKey){l.u(3);break}return w(l,il(u,n.aesKey,o),4);case 4:u=l.h;case 3:return l.return(u)}}))}function Tl(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=rl(e.O(),e.startByte,e.endByte,i,n)).contentType=t.type,r.request(Gr,e,{type:s,stream:t,segment:o,isPreload:a})}function xl(e,t,n,i){var r,a;return R((function(o){return 1==o.g?(t.Ic=!1,t.Sf=!1,t.Oe=0,t.Kc=!0,t.Ia=null,t.sa=null,t.$&&!e.m.has(t.stream)&&Yu(t.$),i?(r=e.g.Qc(),a=e.g.Z.getDuration(),w(o,e.g.Z.remove(t.type,r+i,a),3)):w(o,Vs(e.g.Z,t.type),4)):3!=o.g?(Wr(e.l),n?w(o,e.g.Z.flush(t.type),3):o.u(3)):(Wr(e.l),t.Kc=!1,t.endOfStream=!1,t.Qa||t.zb||Sl(e,t,0),void T(o))}))}function Sl(e,t,n){var i=t.type;(i!=rt||e.h.has(i))&&(t.zb=new wi((function(){var n;return R((function(i){return 1==i.g?(x(i,2),w(i,fl(e,t),4)):2!=i.g?A(i,0):(n=k(i),e.g&&e.g.onError(n),void T(i))}))})).ia(n))}function Al(e){null!=e.zb&&(e.zb.stop(),e.zb=null)}function kl(e){return R((function(t){return e.Hb?w(t,e.Hb.abort(),0):t.u(0)}))}function El(e,t,n){var i;return R((function(r){if(1==r.g)return 3024==n.code?(t.Qa=!1,Al(t),Sl(e,t,0),r.return()):w(r,xr(e.S),2);if(Wr(e.l),1===n.category&&1003!=n.code){if(t.Fc)return ol(e,!1),r.return();i=0===e.i.maxDisabledTime&&1011==n.code?1:e.i.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.i.failureCallback(n),T(r)}))}function Il(e,t){t=void 0!==t&&t;var n,i,r,a,o,s=void 0===s||s;return R((function(u){if(1==u.g){if(n=Date.now()/1e3,i=e.i.minTimeBetweenRecoveries,!t){if(!e.i.allowMediaSourceRecoveries||n-e.M<i)return u.return(!1);e.M=n}return r=at,(a=e.h.get(r.ea))&&(a.mb=null,a.lc=null,a.kc=null,s&&dl(e,a),kl(a).catch((function(){})),a.sa&&a.sa.dh(),Al(a)),(o=e.h.get(r.Ca))&&(o.mb=null,o.lc=null,o.kc=null,s&&dl(e,o),kl(o).catch((function(){})),o.sa&&o.sa.dh(),Al(o)),w(u,Zs(e.g.Z,Dl(e)),2)}return!o||o.Kc||o.Qa||o.zb||Sl(e,o,0),!a||a.Kc||a.Qa||a.zb||Sl(e,a,0),u.return(!0)}))}function Cl(e){return"keep"!==e.i.crossBoundaryStrategy}function Ml(e){if(Cl(e)){e.H.stop();var t=e.g.Qc(),n=e.h.get("video")||e.h.get("audio");n&&(n=n.mb)&&null!==n.g&&(0>(t=n.g-t)||1<t||(e.G=n.g+.1,e.H.ia(t)))}}function Dl(e,t){t=void 0!==t&&t;var n=new Map;return e.o.audio&&n.set("audio",e.o.audio),e.o.video&&n.set("video",e.o.video),t&&e.A&&n.set(rt,e.A),n}function Pl(){}function Rl(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]=Bt(d):s?e[a]=t[a]:d.constructor==Object&&t[a]&&t[a].constructor==Object?(e[a]||(e[a]=Bt(d)),c=Rl(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?(q("Unexpected number of arguments for "+c),e[a]=t[a]):e[a]=Array.isArray(e[a])?t[a].slice():t[a]:(z("Invalid config, unrecognized key "+c),l=!1)}return l}function Ll(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 Nl(e,t){return e&&t}function Ol(e,t){function n(e){return e&&"object"==typeof e&&!Array.isArray(e)}return e=function e(t,i){return Object.keys(t).reduce((function(r,a){var o=t[a];return i.hasOwnProperty(a)?o instanceof HTMLElement&&i[a]instanceof HTMLElement?o.isEqualNode(i[a])||(r[a]=o):n(o)&&n(i[a])?(o=e(o,i[a]),(0<Object.keys(o).length||!n(o))&&(r[a]=o)):Array.isArray(o)&&Array.isArray(i[a])?Mt(o,i[a])||(r[a]=o):Number.isNaN(o)&&Number.isNaN(i[a])||o!==i[a]&&(r[a]=o):r[a]=o,r}),{})}(e,t),function e(t){for(var i=l(Object.keys(t)),r=i.next();!r.done;r=i.next())if(!(t[r=r.value]instanceof HTMLElement))if(n(t[r])&&0===Object.keys(t[r]).length)delete t[r];else{var a=t[r];Array.isArray(a)&&0===a.length||"function"==typeof t[r]?delete t[r]:n(t[r])&&(e(t[r]),0===Object.keys(t[r]).length&&delete t[r])}}(e),e}function jl(){}function Ul(e){return new de(e=Be(e)).Cb}function _l(e,t,n){function i(e){Re(a).setUint32(o,e.byteLength,!0),o+=4,a.set(De(e),o),o+=e.byteLength}if(!n||!n.byteLength)throw new Ne(2,6,6015);var r;r="string"==typeof t?Ve(t,!0):t,e=Ve(e=Be(e),!0);var a=new Uint8Array(12+e.byteLength+r.byteLength+n.byteLength),o=0;return i(e),i(r),i(n),a}function Bl(e,t,n){return"skd"!==t?e:(t=n.serverCertificate,_l(e,n=Be(e).split("skd://").pop(),t))}function Fl(e,t){2===e&&(e=t.drmInfo)&&vr(e.keySystem)&&(t.headers["Content-Type"]="application/octet-stream")}function Vl(){this.g=null}function Hl(e,t){return e.filter((function(e){return!(e.audio&&e.audio.channelsCount&&e.audio.channelsCount>t)})).sort((function(e,t){return e.audio||t.audio?e.audio?t.audio?(t.audio.channelsCount||0)-(e.audio.channelsCount||0):1:-1:0}))}function Kl(e,t){return e.filter((function(e){return!e.audio||e.audio.codecs==t}))}function Gl(){}function zl(){var t=1/0,n=te();navigator.connection&&navigator.connection.saveData&&(t=360);var i={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(t,n,i){return"apple"===e.shakaMediaKeysPolyfill&&"skd"==n&&(n=i.serverCertificate,t=_l(t,i=Ul(t),n)),t},logLicenseExchange:!1,updateExpirationTime:1,preferredKeySystems:[],keySystemsMapping:{},parseInbandPsshEnabled:!1,minHdcpVersion:"",ignoreDuplicateInitData:!0,defaultAudioRobustnessForWidevine:"SW_SECURE_CRYPTO",defaultVideoRobustnessForWidevine:"SW_SECURE_DECODE"},r="reload",a=!1;pt()&&n.cd()&&(r="smooth",a=!0);var o={trackSelectionCallback:function(e){return R((function(t){return t.return(e)}))},downloadSizeCallback:function(e){var t;return R((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 Nl([e,t])},usePersistentLicense:!0,numberOfParallelDownloads:5},s={drm:i,manifest:a={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,ignoreSupplementalCodecs:!1,updatePeriod:-1,ignoreDrmInfo:!1,dash:{clockSyncUri:"",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","urn:uuid:3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c":"com.huawei.wiseplay"},manifestPreprocessor:Xl,manifestPreprocessorTXml:Wl,sequenceMode:!1,multiTypeVariantsAllowed:a,useStreamOnceInPeriodFlattening:!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:n.bd(),ignoreManifestTimestampsInSegmentsMode:!1,disableCodecGuessing:!1,disableClosedCaptionsDetection:!1,allowLowLatencyByteRangeOptimization:!0,allowRangeRequestsToGuessMimeType:!1},mss:{manifestPreprocessor:Xl,manifestPreprocessorTXml:Wl,sequenceMode:!1,keySystemsBySystemId:{"9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready"}}},streaming:{retryParameters:{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4},failureCallback:function(e){return Nl([e])},rebufferingGoal:0,bufferingGoal:10,bufferBehind:30,evictionGoal:1,ignoreTextStreamFailures:!1,alwaysStreamText:!1,startAtSegmentBoundary:!1,gapDetectionThreshold:.5,gapPadding:0,gapJumpTimerTime:.25,durationBackoff:1,safeSeekOffset:5,safeSeekEndOffset:0,stallEnabled:!0,stallThreshold:1,stallSkip:.1,useNativeHlsForFairPlay:!0,inaccurateManifestTolerance:2,lowLatencyMode:!1,preferNativeDash:!1,preferNativeHls:!1,updateIntervalSeconds:1,observeQualityChanges:!1,maxDisabledTime:30,segmentPrefetchLimit:1,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,preloadNextUrlWindow:30,loadTimeout:30,clearDecodingCache:!1,dontChooseCodecs:!1,shouldFixTimestampOffset:!1,avoidEvictionOnQuotaExceededError:!1,crossBoundaryStrategy:"keep",returnToEndOfLiveWindowWhenOutside:!1},networking:{forceHTTP:!1,forceHTTPS:!1,minBytesForProgressEvents:16e3},mediaSource:{codecSwitchingStrategy:r,addExtraFeaturesToSourceBuffer:function(e){return Nl([e],"")},forceTransmux:!1,insertFakeEncryptionInInit:!0,correctEc3Enca:!1,modifyCueCallback:function(e,t){return Nl([e,t])},dispatchAllEmsgBoxes:!1,useSourceElements:!0,durationReductionEmitsUpdateEnd:!0},offline:o,abrFactory:function(){return new cr},adaptationSetCriteriaFactory:function(){return new(Function.prototype.bind.apply(Vl,[null].concat(c(L.apply(0,arguments)))))},abr:{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:5,minTimeToSwitch:0,preferNetworkInformationBandwidth:!1,removeLatencyFromFirstPacketTime:!0},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,fontScaleFactor:1},textDisplayFactory:function(){return null},cmcd:{enabled:!1,sessionId:"",contentId:"",rtpSafetyFactor:5,useHeaders:!1,includeKeys:[],version:1},cmsd:{enabled:!0,applyMaximumSuggestedBitrate:!0,estimatedThroughputWeightRatio:.5},lcevc:{enabled:!1,dynamicPerformanceScaling:!0,logLevel:0,drawLogo:!1,poster:!0},ads:{customPlayheadTracker:!1,skipPlayDetection:!1,supportsMultipleMediaElements:!0,disableHLSInterstitial:!1,disableDASHInterstitial:!1,allowPreloadOnDomElements:!0,allowStartInMiddleOfInterstitial:!0},ignoreHardwareResolution:!1,queue:{preloadNextUrlWindow:30,repeatMode:0}};return o.trackSelectionCallback=function(e){return R((function(t){return t.return(function(e,t,n){var i=n;"AUTO"==i&&(n=e.some((function(e){return!(!e.hdr||"HLG"!=e.hdr)})),i=tv(n));var r=e.filter((function(e){return!("variant"!=e.type||e.hdr&&e.hdr!=i)}));n=[];var a=Ni(t,r.map((function(e){return e.language})));a&&(n=r.filter((function(e){return Di(e.language)==a}))),0==n.length&&(n=r.filter((function(e){return e.primary}))),0==n.length&&(r.map((function(e){return e.language})),n=r);var o=n.filter((function(e){return e.height&&480>=e.height}));for(o.length&&(o.sort((function(e,t){return t.height-e.height})),n=o.filter((function(e){return e.height==o[0].height}))),t=[],n.length&&(r=Math.floor(n.length/2),n.sort((function(e,t){return e.bandwidth-t.bandwidth})),t.push(n[r])),n=(e=l(e)).next();!n.done;n=e.next())(n=n.value).type!=rt&&"image"!=n.type||t.push(n);return t}(e,s.preferredAudioLanguage,s.preferredVideoHdrLevel))}))},n.Ua(s)}function ql(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 Rl(e,t,n||zl(),i,"")}function Xl(e){return Nl([e],e)}function Wl(e){return Nl([e],e)}function Yl(){this.g=null,this.h=[]}function Jl(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 $l(){this.i=this.h=null,this.g=[]}function Ql(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 Zl(){this.B=this.W=NaN,this.l="",this.j=this.gi=this.s=this.A=this.K=this.C=this.o=this.m=this.I=this.F=this.i=this.S=this.U=this.M=this.N=this.P=NaN,this.L=0,this.G=this.H=NaN,this.g=new Yl,this.h=new $l}function ec(e,t,n){e.W=t,e.B=n}function tc(e,t){e.j=isNaN(e.j)?t:e.j+t}function nc(e,t,n,i){Lr.call(this),this.N=e,this.W=t,this.Oa=i.networkingEngine,this.m=n,this.A=null,this.Ka=0,this.ab=i.hd,this.F=i.nk,this.eb=i.pk,this.g=i.config,this.l=this.G=this.h=null,this.wa=!1,this.H=i.Ck,this.ya=!1,this.i=null,this.na=!1,this.j=this.C=null,this.ha=!1,this.M=new Map,this.za=!1,this.Pa=i.Bk,this.ba=new Zl,this.va=new Sr,this.s=new Sr,this.P=null,this.o=!1,this.ka=i.ej,this.U=this.K=null,this.Za=i.dj,this.S=!1,this.L=[],this.I=[],this.B=!0}function ic(e,t,n){(e=t?e.I:e.L)?e.push(n):n()}function rc(e,t){if(e.P=t,e.S=!0,e.L)for(var n=(t=l(e.L)).next();!n.done;n=t.next())(n=n.value)();e.L=null}function ac(e){if(e.o)throw new Ne(2,7,7003)}function oc(e,t){e.dispatchEvent(new Dr("onstatechange",(new Map).set("state",t)))}function sc(e,t){var n,i,r;return R((function(a){switch(a.g){case 1:return!e.h||e.i?a.return():(oc(e,"drm-engine"),e.Ka=Date.now()/1e3,e.i=e.ab(),e.F.h=e.i,e.i.configure(e.g.drm,(function(){return e.B})),n=Zi(e.h.variants),i=!0,e.h&&e.h.presentationTimeline&&(i=e.h.presentationTimeline.V()),w(a,ga(e.i,n,e.h.offlineSessionIds,i),2));case 2:if(ac(e),!t){a.u(3);break}return w(a,e.i.fc(t),4);case 4:ac(e);case 3:return w(a,Ga(e.F,e.h),5);case 5:if(!a.h){a.u(0);break}return r=new Dr("trackschanged",void 0),w(a,Promise.resolve(),7);case 7:e.dispatchEvent(r),T(a)}}))}function uc(e){var t=Zi(e.h.variants);return t=e.A.create(t),e.j.configure(e.g.abr),e.j.setVariants(Array.from(t.values())),e.j.chooseVariant()}function lc(e,t,n){var i,r,a,o,s;return R((function(u){return 1==u.g?(i=e.g.streaming.segmentPrefetchLimit||2,r=new Gu(i,t,(function(t,n,i){return Tl(t,n,i||null,e.g.streaming.retryParameters,e.Oa,e.B)}),!1),e.M.set(t.id,r),t.segmentIndex?u.u(2):w(u,t.createSegmentIndex(),2)):(a="number"==typeof e.m?e.m:0,o=t.segmentIndex.Wb(a),s=null,o&&((s=o.current())||(s=o.next().value)),s||(s=Pu(t.segmentIndex)),s?n?s.Y?w(u,Xu(r,s.Y),0):u.u(0):w(u,qu(r,s.startTime),0):u.u(0))}))}function cc(e,t){Lr.call(this);var n=this;this.i=e,this.l=t,this.g=new Map,this.m=[{gd:null,fd:pc,Sc:function(e,t){return dc(n,"enter",e,t)}},{gd:hc,fd:pc,Sc:function(e,t){return dc(n,"enter",e,t)}},{gd:fc,fd:pc,Sc:function(e,t){return dc(n,"enter",e,t)}},{gd:pc,fd:hc,Sc:function(e,t){return dc(n,"exit",e,t)}},{gd:pc,fd:fc,Sc:function(e,t){return dc(n,"exit",e,t)}},{gd:hc,fd:fc,Sc:function(e,t){t?dc(n,"skip",e,t):(dc(n,"enter",e,t),dc(n,"exit",e,t))}},{gd:fc,fd:hc,Sc:function(e,t){return dc(n,"skip",e,t)}}],this.h=new $,this.h.D(this.i,"regionremove",(function(e){n.g.delete(e.region)}))}function dc(e,t,n,i){t=new Dr(t,new Map([["region",n],["seeking",i]])),e.dispatchEvent(t)}gu.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},wu.prototype.release=function(){this.h&&(this.h.stop(),this.h=null),this.g=null},(i=xu.prototype).ready=function(){var e=this;pu(this.g,HTMLMediaElement.HAVE_FUTURE_DATA,this.j,(function(){!function(){if(null==e.h||0==e.h&&1/0!=e.g.duration)e.i=!0;else{var t=e.g.currentTime,n=null;if("number"==typeof e.h)n=e.h;else if(e.h instanceof Date){var i=Su(e);null!==i&&(n=e.h.getTime()/1e3-i,n=Au(e,n))}null==n?e.i=!0:(0>n&&(n=Math.max(0,t+n)),t!=n?(e.j.Aa(e.g,"seeking",(function(){e.i=!0})),e.g.currentTime=n):e.i=!0)}}()}))},i.release=function(){this.j&&(this.j.release(),this.j=null),this.g=null},i.Vf=function(e){this.h=this.i?this.h:e},i.De=function(){var e=this.i?this.g.currentTime:this.h;return e instanceof Date&&(e=Au(this,e=e.getTime()/1e3-(Su(this)||0))),e||0},i.Eh=function(){return 0},i.Dh=function(){return 0},i.pi=function(){},i.ci=function(){var e=qo(this.g.buffered);return null!=e&&e>=this.g.duration-1},(i=ku.prototype).ready=function(){this.m.Fa(.25)},i.release=function(){this.i&&(this.i.release(),this.i=null),this.j&&(this.j.release(),this.j=null),this.m&&(this.m.stop(),this.m=null),this.h=this.i=this.g=this.l=null,this.s=function(){}},i.Vf=function(e){vu(this.i,Eu(this,e))},i.De=function(){var e=mu(this.i);return 0<this.h.readyState&&!this.h.paused?Mu(this,e):e},i.Eh=function(){return this.j.G},i.Dh=function(){return this.j.C},i.pi=function(){this.j.tf()},i.ci=function(){if(this.g.V()){var e=this.g.Ac(),t=qo(this.h.buffered);if(null!=t&&t>=e)return!0}return!1},(i=Du.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.rk=function(){this.o=!0},i.Eb=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.kf=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.Yd=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.kf(e),this.$a(t)},i.$a=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.ld=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.startByte,e.endByte,e.Y,e.timestampOffset,e.appendWindowStart,e.appendWindowEnd,e.g,e.tilesLayout,e.B,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.Lf=function(e,t){var n=this;this.o||(this.m&&this.m.stop(),this.m=new Ti((function(){var e=t();e?n.g.push.apply(n.g,c(e)):(n.m.stop(),n.m=null)})),this.m.Fa(e))},Du.prototype[Symbol.iterator]=function(){return this.Wb(0)},Du.prototype.Wb=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 Lu(this,i,a,n)},Du.prototype.Pe=function(){return-1},F("shaka.media.SegmentIndex",Du),Du.forSingleSegment=Ru,Du.prototype.getIteratorForTime=Du.prototype.Wb,Du.prototype.updateEvery=Du.prototype.Lf,Du.prototype.fit=Du.prototype.ld,Du.prototype.evict=Du.prototype.$a,Du.prototype.mergeAndEvict=Du.prototype.Yd,Du.prototype.offset=Du.prototype.offset,Du.prototype.get=Du.prototype.get,Du.prototype.find=Du.prototype.find,Du.prototype.markImmutable=Du.prototype.rk,Du.prototype.release=Du.prototype.release,Du.prototype.getNumEvicted=Du.prototype.getNumEvicted,Du.prototype.getNumReferences=Du.prototype.getNumReferences,(i=Lu.prototype).Dd=function(e){this.reverse=e},i.oj=function(){return this.h},i.current=function(){var e=this.i.get(this.h);return e&&0<e.g.length&&e.A&&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.A&&this.g==e.g.length&&(this.h++,this.g=0)):(this.h++,this.g=0),{value:e=this.current(),done:!e}},i.dh=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",Lu),Lu.prototype.resetToLastIndependent=Lu.prototype.dh,Lu.prototype.next=Lu.prototype.next,Lu.prototype.current=Lu.prototype.current,Lu.prototype.currentPosition=Lu.prototype.oj,Lu.prototype.setReverse=Lu.prototype.Dd,m(Nu,Du),(i=Nu.prototype).clone=function(){var e=new Nu;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.Eb=function(e){for(var t=l(this.h),n=t.next();!n.done;n=t.next())n.value.Eb(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.kf=function(){},i.$a=function(e){for(var t=l(this.h),n=t.next();!n.done;n=t.next())n.value.$a(e);for(;1<this.h.length&&0==this.h[0].getNumReferences();)e=this.h.shift(),this.i+=e.getNumEvicted(),e.release()},i.Yd=function(){},i.ld=function(){},i.Lf=function(){},F("shaka.media.MetaSegmentIndex",Nu),Nu.prototype.updateEvery=Nu.prototype.Lf,Nu.prototype.fit=Nu.prototype.ld,Nu.prototype.mergeAndEvict=Nu.prototype.Yd,Nu.prototype.evict=Nu.prototype.$a,Nu.prototype.merge=Nu.prototype.kf,Nu.prototype.offset=Nu.prototype.offset,Nu.prototype.get=Nu.prototype.get,Nu.prototype.find=Nu.prototype.find,Nu.prototype.forEachTopLevelReference=Nu.prototype.Eb,Nu.prototype.release=Nu.prototype.release,Ou.prototype.release=function(){this.set(this.Pc()),this.h&&(this.h.stop(),this.h=null),this.g=null},Ou.prototype.set=function(e){this.i=e,ju(this)},Ou.prototype.Pc=function(){return this.g.Pc()},Uu.prototype.release=function(){this.h&&(this.h.release(),this.h=null),this.i.stop();for(var e=l(this.g),t=e.next();!t.done;t=e.next())t.value.release();this.g.clear()},m(Bu,Lr),Bu.prototype.release=function(){this.g.clear(),Lr.prototype.release.call(this)},Bu.prototype.j=function(e){for(var t=l(this.g.values()),n=t.next();!n.done;n=t.next()){var i=(n=n.value).lg;e:{for(var r=n.ce,a=r.length-1;0<=a;a--){var o=r[a];if(o.position<=e){r=o.rd;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&&!Dt(i.roles,r.roles),(o||s||i)&&Fu(this,e,r.contentType)&&(n.lg=r,i=new Dr("audiotrackchange",new Map([["quality",r],["position",e]])),this.dispatchEvent(i)),a&&Fu(this,e,r.contentType)&&(n.lg=r,JSON.stringify(r),n=new Dr("qualitychange",new Map([["quality",r],["position",e]])),this.dispatchEvent(n))}},m(Hu,Lr),Hu.prototype.release=function(){this.h.clear(),this.g&&(this.g.stop(),this.g=null),Lr.prototype.release.call(this)},Gu.prototype.$a=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&&Qu(this,i);t&&Ju(this)},Gu.prototype.Dd=function(e){this.o=e,this.g&&this.g.Dd(e)},Zu.prototype.abort=function(){this.ae&&this.ae.abort()},(i=al.prototype).destroy=function(){return this.l.destroy()},i.configure=function(e){if(this.i=e,this.S=new Tr({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.h.get("audio");t&&t.$&&(Yu(t.$),t.$=null);for(var n=(t=l(this.m.keys())).next();!n.done;n=t.next())n=n.value,Yu(this.m.get(n)),this.m.delete(n)}for(e.disableTextPrefetch&&(t=this.h.get(rt))&&t.$&&(Yu(t.$),t.$=null),e.disableVideoPrefetch&&(t=this.h.get("video"))&&t.$&&(Yu(t.$),t.$=null),n=(t=l(this.h.keys())).next();!n.done;n=t.next())(n=this.h.get(n.value)).$?($u(n.$,e.segmentPrefetchLimit),0<e.segmentPrefetchLimit||(Yu(n.$),n.$=null)):0<e.segmentPrefetchLimit&&(n.$=pl(this,n.stream));e.disableAudioPrefetch||function(e){for(var t=e.i.segmentPrefetchLimit,n=e.i.prefetchAudioLanguages,i=l(e.j.variants),r=i.next(),a={};!r.done;a={Mb:void 0},r=i.next())if(a.Mb=r.value,a.Mb.audio)if(e.m.has(a.Mb.audio)){if($u(r=e.m.get(a.Mb.audio),t),!(0<t&&n.some(function(e){return function(t){return Ii(e.Mb.audio.language,t)}}(a)))){var o=e.h.get(a.Mb.audio.type);r!==(o&&o.$)&&Yu(r),e.m.delete(a.Mb.audio)}}else 0>=t||!n.some(function(e){return function(t){return Ii(e.Mb.audio.language,t)}}(a))||!(r=pl(e,a.Mb.audio))||(a.Mb.audio.segmentIndex||a.Mb.audio.createSegmentIndex(),e.m.set(a.Mb.audio,r))}(this)},i.start=function(e){var t=this;return R((function(n){if(1==n.g)return w(n,function(e,t){var n,i,r,a,o,s,u;return R((function(c){if(1==c.g){if(!e.o)throw new Ne(2,5,5006);return n=Dl(e,!0),w(c,e.g.Z.init(n,e.j.sequenceMode,e.j.type,e.j.ignoreManifestTimestampsInSegmentsMode),2)}for(Wr(e.l),e.updateDuration(),i=l(n.keys()),r=i.next();!r.done;r=i.next())a=r.value,o=n.get(a),e.h.has(a)||(s=hl(e,o),t.has(o.id)&&(zu(u=t.get(o.id),(function(t,n,i){return Tl(t,n,i||null,e.i.retryParameters,e.g.pc)})),s.$=u),e.h.set(a,s),Sl(e,s,0));T(c)}))}(t,e||new Map),2);Wr(t.l),t.I=!0,T(n)}))},i.Yc=function(){if(this.g){for(var e=this.g.Qc(),t=l(this.h.keys()),n=t.next();!n.done;n=t.next()){var i=n.value;n=this.h.get(i);var r=this.g.Z;if(!(r=i==rt?null!=(r=r.h).g&&null!=r.h&&e>=r.g&&e<r.h:Xo(r=Bs(r,i),e))){if(this.M=0,n.$&&(n.$.g=null),"audio"===n.type)for(var a=(r=l(this.m.values())).next();!a.done;a=r.next())a.value.g=null;n.sa=null,(null!=_s(this.g.Z,i)||n.Qa)&&dl(this,n),n.Hb&&(n.Hb.abort(),n.Hb=null),i===rt&&(i=this.g.Z).I&&i.I.Fd(),n.Yc=!0}}Cl(this)&&Ml(this)}},i.updateDuration=function(){var e=ft(),t=this.j.presentationTimeline.getDuration();1/0>t?(e&&(this.s&&this.s.stop(),Ks(this.g.Z)),this.g.Z.pb(t)):e?(this.s&&this.s.Fa(.5),this.g.Z.pb(1/0)):this.g.Z.pb(Math.pow(2,32))},F("shaka.util.ConfigUtils",Pl),Pl.getDifferenceFromConfigObjects=Ol,Pl.convertToConfigObject=Ll,Pl.mergeConfigObjects=Rl,F("shaka.config.RepeatMode",{OFF:0,ALL:1,SINGLE:2}),F("shaka.drm.FairPlay",jl),jl.commonFairPlayResponse=function(e,t){if(2===e&&(e=t.originalRequest.drmInfo)&&vr(e.keySystem)){try{var n=Ue(t.data)}catch(e){return}if(e=!1,"<ckc>"===(n=n.trim()).substr(0,5)&&"</ckc>"===n.substr(-6)&&(n=n.slice(5,-6),e=!0),!e)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=Me(We(n)))}},jl.muxFairPlayRequest=function(e,t){Fl(e,t)},jl.expressplayFairPlayRequest=function(e,t){if(2===e){var n=t.drmInfo;n&&vr(n.keySystem)&&Fl(e,t)}},jl.conaxFairPlayRequest=function(e,t){Fl(e,t)},jl.ezdrmFairPlayRequest=function(e,t){Fl(e,t)},jl.verimatrixFairPlayRequest=function(e,t){2===e&&(e=t.drmInfo)&&vr(e.keySystem)&&(e=Xe(e=De(t.body)),t.headers["Content-Type"]="application/x-www-form-urlencoded",t.body=Fe("spc="+e))},jl.muxInitDataTransform=function(e,t,n){return Bl(e,t,n)},jl.expressplayInitDataTransform=function(e,t,n){return Bl(e,t,n)},jl.conaxInitDataTransform=function(t,n,i){if("skd"!==n)return t;n=i.serverCertificate,i=Be(t).split("skd://").pop().split("?").shift(),i=e.atob(i);var r=new ArrayBuffer(2*i.length);r=Pe(r);for(var a=0,o=i.length;a<o;a++)r[a]=i.charCodeAt(a);return _l(t,r,n)},jl.ezdrmInitDataTransform=function(e,t,n){return"skd"!==t?e:(t=n.serverCertificate,_l(e,n=Be(e).split(";").pop(),t))},jl.verimatrixInitDataTransform=function(e,t,n){return Bl(e,t,n)},jl.initDataTransform=_l,jl.defaultGetContentId=Ul,jl.isFairPlaySupported=function(){var e;return R((function(t){return 1==t.g?(e={initDataTypes:["cenc","sinf","skd"],videoCapabilities:[{contentType:'video/mp4; codecs="avc1.42E01E"'}]},x(t,2),w(t,navigator.requestMediaKeySystemAccess("com.apple.fps",[e]),4)):2!=t.g?t.return(!0):(k(t),t.return(!1))}))},Vl.prototype.configure=function(e){this.g=e},Vl.prototype.getConfiguration=function(){return this.g},Vl.prototype.create=function(e){var t;if(this.g.language){var n=function(e,t){var n=Ni(t=Di(t),e.map((function(e){return Li(e)})));return n?e.filter((function(e){return n==Li(e)})):[]}(e,this.g.language);n.length&&(t=n)}t||(t=(t=e.filter((function(e){return e.primary}))).length?t:e),e=function(e,t){return e.filter((function(e){return!!e.audio&&(t?e.audio.roles.includes(t):0==e.audio.roles.length)}))}(t,this.g.role),e.length&&(t=e),this.g.videoLayout&&(e=function(e,t){return e.filter((function(e){return!e.video||!e.video.videoLayout||e.video.videoLayout==t}))}(t,this.g.videoLayout),e.length&&(t=e)),this.g.Ec&&(e=function(e,t){if("AUTO"==t){var n=e.some((function(e){return!(!e.video||!e.video.hdr||"HLG"!=e.video.hdr)}));t=tv(n)}return e.filter((function(e){return!e.video||!e.video.hdr||e.video.hdr==t}))}(t,this.g.Ec),e.length&&(t=e));var i=[this.g.channelCount,this.g.preferredAudioChannelCount];if((e=i.filter((function(e,t){return e&&i.indexOf(e)===t}))).length)for(n=(e=l(e)).next();!n.done;n=e.next())if((n=Hl(t,n.value)).length){t=n;break}this.g.Jc&&(e=function(e,t){return e.filter((function(e){return!(!e.audio||!e.audio.label)&&e.audio.label.toLowerCase()==t.toLowerCase()}))}(t,this.g.Jc),e.length&&(t=e)),this.g.Ed&&(e=function(e,t){return e.filter((function(e){return!(!e.video||!e.video.label)&&e.video.label.toLowerCase()==t.toLowerCase()}))}(t,this.g.Ed),e.length&&(t=e)),e=function(e,t){return e.filter((function(e){return!e.audio||e.audio.spatialAudio==t}))}(t,this.g.spatialAudio),e.length&&(t=e);var r=[this.g.audioCodec,this.g.Gd].concat(c(this.g.preferredAudioCodecs));if((e=r.filter((function(e,t){return e&&r.indexOf(e)===t}))).length)for(n=(e=l(e)).next();!n.done;n=e.next())if((n=Kl(t,n.value)).length){t=n;break}return new ja(t[0],t,!("smooth"==this.g.codecSwitchingStrategy&&pt()))},F("shaka.util.PlayerConfiguration",Gl),Gl.mergeConfigObjects=ql,Gl.createDefaultForLL=function(){return{streaming:{inaccurateManifestTolerance:0,segmentPrefetchLimit:2,updateIntervalSeconds:.1,maxDisabledTime:1,retryParameters:{baseDelay:100}},manifest:{dash:{autoCorrectDrift:!1},retryParameters:{baseDelay:100}},drm:{retryParameters:{baseDelay:100}}}},Gl.createDefault=zl,m(nc,Lr),(i=nc.prototype).getStartTime=function(){return this.m},i.nd=function(){return this.N},i.Fg=function(){return this.h},i.getStats=function(){return this.ba},i.Mj=function(){return this.K?qi(this.K):null},i.Lj=function(){return this.U?Xi(this.U):null},i.start=function(){var t,n=this;R((function(i){switch(i.g){case 1:return w(i,Promise.resolve(),2);case 2:return x(i,3),w(i,function(e){var t,n,i,r,a;return R((function(o){switch(o.g){case 1:if(oc(e,"manifest-parser"),e.l||(e.G=Qa(e.N,e.W),e.l=e.G(),e.l.configure(e.g.manifest,(function(){return e.B}))),t=Date.now()/1e3,oc(e,"manifest"),e.h){o.u(2);break}return w(o,e.l.start(e.N,e.eb),3);case 3:return e.h=o.h,w(o,function(e){var t,n,i,r,a,o;return R((function(s){if(e.A||(e.A=e.g.adaptationSetCriteriaFactory(),e.A.configure({language:e.g.preferredAudioLanguage,role:e.g.preferredVariantRole,channelCount:e.g.preferredAudioChannelCount,Ec:e.g.preferredVideoHdrLevel,spatialAudio:e.g.preferSpatialAudio,videoLayout:e.g.preferredVideoLayout,Jc:e.g.preferredAudioLabel,Ed:e.g.preferredVideoLabel,codecSwitchingStrategy:e.g.mediaSource.codecSwitchingStrategy,audioCodec:"",Gd:"",Fe:0,preferredAudioCodecs:e.g.preferredAudioCodecs,preferredAudioChannelCount:e.g.preferredAudioChannelCount})),e.Za&&(t=e.g.abrFactory,e.C=t,e.j=t(),e.j.configure(e.g.abr)),!(n=uc(e))||1!=e.h.variants.length&&"HLS"!=e.h.type)return s.u(0);for(i=[],r=l([n.video,n.audio]),a=r.next();!a.done;a=r.next())(o=a.value)&&!o.segmentIndex&&i.push(o.createSegmentIndex());return 0<i.length?w(s,Promise.all(i),0):s.u(0)}))}(e),2);case 2:return e.va.resolve(),n=new Dr("manifestparsed",void 0),w(o,Promise.resolve(),5);case 5:if(e.dispatchEvent(n),0==e.h.variants.length)throw new Ne(2,4,4036);if(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),!za(e.F,e.h)){o.u(6);break}return i=new Dr("trackschanged",void 0),w(o,Promise.resolve(),7);case 7:ac(e),e.dispatchEvent(i);case 6:r=Date.now()/1e3,a=r-t,e.ba.I=a,T(o)}}))}(n),5);case 5:if(ac(n),"webkit"===e.shakaMediaKeysPolyfill){i.u(6);break}return w(i,sc(n),7);case 7:ac(n);case 6:if(!n.ka){i.u(8);break}return w(i,function(e){var t,n,i,r;return R((function(a){return(t=uc(e))?(n=e.h.presentationTimeline.V(),i=[],e.K=t,t.video&&i.push(lc(e,t.video,n)),t.audio&&i.push(lc(e,t.audio,n)),(r=er(e.h.textStreams,e.g.preferredTextLanguage,e.g.preferredTextRole,e.g.preferForcedSubs)[0]||null)&&rr(t.audio,r,e.g)&&(i.push(lc(e,r,n)),e.U=r),w(a,Promise.all(i),0)):a.u(0)}))}(n),9);case 9:ac(n);case 8:if(!n.ka||!n.i){i.u(10);break}return w(i,function(e){return R((function(t){return 1==t.g?e.K?w(t,e.l,3):t.u(0):w(t,Promise.all(e.U.map((function(e){return e.promise}))),0)}))}(n.i),11);case 11:ac(n);case 10:n.s.resolve(),A(i,0);break;case 3:(t=k(i))instanceof Ne&&(7001==t.code||7003==t.code)||n.s.reject(t),T(i)}}))},i.dispatchEvent=function(e){return this.P?this.P.dispatchEvent(e):Lr.prototype.dispatchEvent.call(this,e)},i.onError=function(e){2===e.severity&&(this.s.reject(e),this.destroy());var t=(new Map).set("detail",e);t=new Dr("error",t),this.dispatchEvent(t),t.defaultPrevented&&(e.handled=!0)},i.configure=function(e,t){e=Ll(e,t),ql(this.g,e)},i.getConfiguration=function(){return Bt(this.g)},i.fl=function(){return this.s},i.destroy=function(){var e,t,n=this;return R((function(i){switch(i.g){case 1:if(n.o=!0,!n.l||n.wa){i.u(2);break}return w(i,n.l.stop(),2);case 2:if(!n.j||n.ha){i.u(4);break}return w(i,n.j.stop(),4);case 4:if(n.H&&!n.ya&&n.H.release(),!n.i||n.na){i.u(6);break}return w(i,n.i.destroy(),6);case 6:if(0<n.M.size&&!n.za)for(e=l(n.M.values()),t=e.next();!t.done;t=e.next())Yu(t.value);T(i)}}))},F("shaka.media.PreloadManager",nc),nc.prototype.destroy=nc.prototype.destroy,nc.prototype.waitForFinish=nc.prototype.fl,nc.prototype.getPrefetchedTextTrack=nc.prototype.Lj,nc.prototype.getPrefetchedVariantTrack=nc.prototype.Mj,m(cc,Lr),cc.prototype.release=function(){this.i=null,this.g.clear(),this.h.release(),this.h=null,Lr.prototype.release.call(this)},cc.prototype.j=function(e,t){if(!this.l||0!=e){this.l=!1;for(var n=l(this.i.h.values()),i=n.next();!i.done;i=n.next()){i=i.value;var r=this.g.get(i),a=e<i.startTime?hc:e>i.endTime?fc:pc;this.g.set(i,a);for(var o=l(this.m),s=o.next();!s.done;s=o.next())(s=s.value).gd==r&&s.fd==a&&s.Sc(i,t)}}};var hc=1,pc=2,fc=3;function gc(e,t,n){var i,r,a,o,s,u,l;return R((function(c){switch(c.g){case 1:var d=new de(e).ob.split("/").pop().split(".");return i=1==d.length?"":d.pop().toLowerCase(),(r=mc.get(i))?c.return(r):(a=0,o=Br([e],n),x(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=k(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():"")}}))}for(var mc=(new Map).set("mp4","video/mp4").set("m4v","video/mp4").set("m4a","audio/mp4").set("webm","video/webm").set("weba","audio/webm").set("mkv","video/webm").set("ts","video/mp2t").set("ogv","video/ogg").set("ogg","audio/ogg").set("mpg","video/mpeg").set("mpeg","video/mpeg").set("mov","video/quicktime").set("m3u8","application/x-mpegurl").set("mpd","application/dash+xml").set("ism","application/vnd.ms-sstr+xml").set("mp3","audio/mpeg").set("aac","audio/aac").set("flac","audio/flac").set("wav","audio/wav").set("sbv","text/x-subviewer").set("srt","text/srt").set("vtt","text/vtt").set("webvtt","text/vtt").set("ttml","application/ttml+xml").set("lrc","application/x-subtitle-lrc").set("ssa","text/x-ssa").set("ass","text/x-ssa").set("jpeg","image/jpeg").set("jpg","image/jpeg").set("png","image/png").set("svg","image/svg+xml").set("webp","image/webp").set("avif","image/avif").set("html","text/html").set("htm","text/html"),vc={ach:"Lwo",ady:"Адыгэбзэ",af:"Afrikaans","af-NA":"Afrikaans (Namibia)","af-ZA":"Afrikaans (South Africa)",ak:"Tɕɥi",ar:"العربية","ar-AR":"العربية","ar-MA":"العربية","ar-SA":"العربية (السعودية)","ay-BO":"Aymar aru",az:"Azərbaycan dili","az-AZ":"Azərbaycan dili","be-BY":"Беларуская",bg:"Български","bg-BG":"Български",bn:"বাংলা","bn-IN":"বাংলা (ভারত)","bn-BD":"বাংলা(বাংলাদেশ)","bs-BA":"Bosanski",ca:"Català","ca-ES":"Català",cak:"Maya Kaqchikel","ck-US":"ᏣᎳᎩ (tsalagi)",cs:"Čeština","cs-CZ":"Čeština",cy:"Cymraeg","cy-GB":"Cymraeg",da:"Dansk","da-DK":"Dansk",de:"Deutsch","de-AT":"Deutsch (Österreich)","de-DE":"Deutsch (Deutschland)","de-CH":"Deutsch (Schweiz)",dsb:"Dolnoserbšćina",el:"Ελληνικά","el-GR":"Ελληνικά",en:"English","en-GB":"English (UK)","en-AU":"English (Australia)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-IN":"English (India)","en-PI":"English (Pirate)","en-UD":"English (Upside Down)","en-US":"English (US)","en-ZA":"English (South Africa)","en@pirate":"English (Pirate)",eo:"Esperanto","eo-EO":"Esperanto",es:"Español","es-AR":"Español (Argentine)","es-419":"Español (Latinoamérica)","es-CL":"Español (Chile)","es-CO":"Español (Colombia)","es-EC":"Español (Ecuador)","es-ES":"Español (España)","es-LA":"Español (Latinoamérica)","es-NI":"Español (Nicaragua)","es-MX":"Español (México)","es-US":"Español (Estados Unidos)","es-VE":"Español (Venezuela)",et:"eesti keel","et-EE":"Eesti (Estonia)",eu:"Euskara","eu-ES":"Euskara",fa:"فارسی","fa-IR":"فارسی","fb-LT":"Leet Speak",ff:"Fulah",fi:"Suomi","fi-FI":"Suomi","fo-FO":"Føroyskt",fr:"Français","fr-CA":"Français (Canada)","fr-FR":"Français (France)","fr-BE":"Français (Belgique)","fr-CH":"Français (Suisse)","fy-NL":"Frysk",ga:"Gaeilge","ga-IE":"Gaeilge (Gaelic)",gl:"Galego","gl-ES":"Galego","gn-PY":"Avañe'ẽ","gu-IN":"ગુજરાતી","gx-GR":"Ἑλληνική ἀρχαία",he:"עברית‏","he-IL":"עברית‏",hi:"हिन्दी","hi-IN":"हिन्दी",hr:"Hrvatski","hr-HR":"Hrvatski",hsb:"Hornjoserbšćina",ht:"Kreyòl",hu:"Magyar","hu-HU":"Magyar","hy-AM":"Հայերեն",id:"Bahasa Indonesia","id-ID":"Bahasa Indonesia",is:"Íslenska","is-IS":"Íslenska (Iceland)",it:"Italiano","it-IT":"Italiano",ja:"日本語","ja-JP":"日本語","jv-ID":"Basa Jawa","ka-GE":"ქართული","kk-KZ":"Қазақша",km:"ភាសាខ្មែរ","km-KH":"ភាសាខ្មែរ",kab:"Taqbaylit",kn:"ಕನ್ನಡ","kn-IN":"ಕನ್ನಡ (India)",ko:"한국어","ko-KR":"한국어 (韩国)",ku:"Kurdî","ku-TR":"Kurdî",la:"Latin","la-VA":"Latin",lb:"Lëtzebuergesch","li-NL":"Lèmbörgs",lt:"Lietuvių","lt-LT":"Lietuvių",lv:"Latviešu","lv-LV":"Latviešu",mai:"मैथिली, মৈথিলী","mg-MG":"Malagasy",mk:"Македонски","mk-MK":"Македонски (Македонски)",ml:"മലയാളം","ml-IN":"മലയാളം","mn-MN":"Монгол",mr:"मराठी","mr-IN":"मराठी",ms:"Bahasa Melayu","ms-MY":"Bahasa Melayu",mt:"Malti","mt-MT":"Malti",my:"ဗမာစကာ",nb:"Norsk (bokmål)","nb-NO":"Norsk (bokmål)",ne:"नेपाली","ne-NP":"नेपाली",nl:"Nederlands","nl-BE":"Nederlands (België)","nl-NL":"Nederlands (Nederland)","nn-NO":"Norsk (nynorsk)",no:"Norsk",oc:"Occitan","or-IN":"ଓଡ଼ିଆ",pa:"ਪੰਜਾਬੀ","pa-IN":"ਪੰਜਾਬੀ (ਭਾਰਤ ਨੂੰ)",pl:"Polski","pl-PL":"Polski","ps-AF":"پښتو",pt:"Português","pt-BR":"Português (Brasil)","pt-PT":"Português (Portugal)","qu-PE":"Qhichwa","rm-CH":"Rumantsch",ro:"Română","ro-RO":"Română",ru:"Русский","ru-RU":"Русский","sa-IN":"संस्कृतम्","se-NO":"Davvisámegiella","si-LK":"පළාත",sk:"Slovenčina","sk-SK":"Slovenčina (Slovakia)",sl:"Slovenščina","sl-SI":"Slovenščina","so-SO":"Soomaaliga",sq:"Shqip","sq-AL":"Shqip",sr:"Српски","sr-RS":"Српски (Serbia)",su:"Basa Sunda",sv:"Svenska","sv-SE":"Svenska",sw:"Kiswahili","sw-KE":"Kiswahili",ta:"தமிழ்","ta-IN":"தமிழ்",te:"తెలుగు","te-IN":"తెలుగు",tg:"забо́ни тоҷикӣ́","tg-TJ":"тоҷикӣ",th:"ภาษาไทย","th-TH":"ภาษาไทย (ประเทศไทย)",tl:"Filipino","tl-PH":"Filipino",tlh:"tlhIngan-Hol",tr:"Türkçe","tr-TR":"Türkçe","tt-RU":"татарча",uk:"Українська","uk-UA":"Українська",ur:"اردو","ur-PK":"اردو",uz:"O'zbek","uz-UZ":"O'zbek",vi:"Tiếng Việt","vi-VN":"Tiếng Việt","xh-ZA":"isiXhosa",yi:"ייִדיש","yi-DE":"ייִדיש (German)",zh:"中文","zh-HANS":"中文简体","zh-HANT":"中文繁體","zh-CN":"中文(中国)","zh-HK":"中文(香港)","zh-SG":"中文(新加坡)","zh-TW":"中文(台灣)","zu-ZA":"isiZulu"},yc=l(Object.keys(vc)),bc=yc.next();!bc.done;bc=yc.next()){var wc=bc.value;vc[wc.toLowerCase()]=vc[wc]}function Tc(e,t){if(e.lineBreak)return"\n";if(e.nestedCues.length)return e.nestedCues.map((function(t){return Tc(t,e)})).join("");if(!e.payload)return e.payload;var n=[],i=e.fontWeight>=Vn,r=e.fontStyle==Kn,a=e.textDecoration.includes(zn);return i&&n.push(["b"]),r&&n.push(["i"]),a&&n.push(["u"]),""==(r=e.color)&&t&&(r=t.color),i="",(r=xc(r))&&(i+="."+r),""==(r=e.backgroundColor)&&t&&(r=t.backgroundColor),(t=xc(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 xc(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 Sc(e,t){for(var n=[],i=(e=l(Ac(e))).next();!i.done;i=e.next())if((i=i.value).isContainer)n.push.apply(n,c(Sc(i.nestedCues,i)));else{var r=i.clone();r.nestedCues=[],r.payload=Tc(i,t),n.push(r)}return n}function Ac(e){for(var t=[],n=(e=l(e)).next(),i={};!n.done;i={ig:void 0},n=e.next())i.ig=n.value,t.some(function(e){return function(t){return Sn(e.ig,t)}}(i))||t.push(i.ig);return t}function kc(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 Ec(e,t){var n=Sc(t),i=[];t=e.cues?Array.from(e.cues):[];for(var r=(n=l(n)).next(),a={};!r.done;a={pd:void 0},r=n.next())a.pd=r.value,!t.some(function(e){return function(t){return t.startTime==e.pd.startTime&&t.endTime==e.pd.endTime&&t.text==e.pd.payload}}(a))&&a.pd.payload&&(r=kc(a.pd))&&i.push(r);for(n=(t=l(t=i.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?i.indexOf(t)-i.indexOf(e):i.indexOf(e)-i.indexOf(t)})))).next();!n.done;n=t.next())e.addCue(n.value)}function Ic(e,t){var n=!1;"disabled"===e.mode&&(n=!0,e.mode="hidden");for(var i=0;i<e.cues.length;){var r=e.cues[i];t(r)?e.removeCue(r):i++}n&&(e.mode="disabled")}function Cc(e){var t=this;this.i=e,this.l=new $,this.j=null,this.h=new Map,this.g=-1,this.s=!1,this.o=null,this.B=function(){t.l.Ja(t.i,"textchanged",t.m),t.l.Ja(t.j.textTracks,"change",t.A);for(var e=l(t.h.values()),n=e.next();!n.done;n=e.next())n.value.remove();t.h.clear(),t.g=-1,t.j=null},this.m=function(){for(var e=new Map,n=t.i.Dc(),i=(n=l(n)).next();!i.done;i=n.next()){if(i=i.value,t.h.has(i.id)){var r=t.h.get(i.id);i.active||"disabled"===r.track.mode||(r.track.mode="disabled"),t.h.delete(i.id)}else{(r=t.j.ownerDocument.createElement("track")).kind=Mc(i);var a=r,o=void 0;if(i.label)o=i.label;else if(i.language)if(i.language in vc)o=vc[i.language];else{var s=Ri(i.language);s in vc&&(o=vc[s]+" ("+i.language+")")}o||(o=i.originalTextId,i.language&&i.language!==i.originalTextId&&(o+=" ("+i.language+")")),a.label=o,i.language in vc&&(r.srclang=i.language),"CHROMIUM"===te().Da()&&(r.src="data:,WEBVTT"),r.track.mode="disabled",t.j.appendChild(r)}e.set(i.id,r),i.active&&(t.g=i.id)}for(i=(n=l(t.h.values())).next();!i.done;i=n.next())i.value.remove();-1<t.g&&(e.has(t.g)?"disabled"===(n=e.get(t.g).track).mode&&(n.mode=t.s?"showing":"hidden"):t.g=-1),t.h=e},this.A=function(){if(!t.o){var e=t.j;t.o=new Ti((function(){if(t.o=null,t.j===e){var n=-1,i=!1;if(t.h.has(t.g)){var r=t.h.get(t.g);"showing"===r.track.mode?(n=t.g,i=!0):"hidden"===r.track.mode&&(n=t.g)}if(!i)for(r=(i=l(t.h)).next();!r.done;r=i.next()){var a=l(r.value);if(r=a.next().value,"showing"===(a=a.next().value).track.mode){n=r;break}0>n&&"hidden"===a.track.mode&&(n=r)}for(r=(i=l(t.h)).next();!r.done;r=i.next())r=(a=l(r.value)).next().value,a=a.next().value,r!==n&&"disabled"!==a.track.mode&&(a.track.mode="disabled");t.g!==n&&(t.g=n,-1<n&&t.i.jh({id:n})),t.i.oh(-1<n&&"showing"===t.h.get(n).track.mode)}})).ia(0)}},this.l.D(e,"loaded",(function(){return t.enableTextDisplayer()})),this.enableTextDisplayer()}function Mc(e){var t=te();return e.forced&&"WEBKIT"===t.Da()?"forced":"caption"===e.kind||e.roles&&e.roles.some((function(e){return e.includes("transcribes-spoken-dialog")}))&&e.roles.some((function(e){return e.includes("describes-music-and-sound")}))?"captions":"subtitles"}function Dc(e,t){for(oe("SimpleTextDisplayer","Please migrate to NativeTextDisplayer"),this.h=e,this.i=t,this.g=null,t=(e=l(Array.from(this.h.textTracks))).next();!t.done;t=e.next())"metadata"!==(t=t.value).kind&&"chapters"!==t.kind&&(t.mode="disabled",t.label==this.i&&(this.g=t));this.g&&(this.g.mode="hidden")}function Pc(e){e.h&&!e.g&&(e.g=e.h.addTextTrack("subtitles",e.i),e.g.mode="hidden")}function Rc(){}function Lc(t,n){var i=this;this.m=!1,this.h=[],this.j=t,this.o=n,this.B=this.s=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.A=new Ti((function(){i.j.paused||Uc(i)})),Nc(this),this.l=new Map,this.i=new $,this.i.D(document,"fullscreenchange",(function(){Uc(i,!0)})),this.i.D(this.j,"seeking",(function(){Uc(i,!0)})),this.i.D(this.j,"ratechange",(function(){Nc(i)})),this.i.D(this.j,"resize",(function(){var e=i.j,t=e.videoWidth;e=e.videoHeight,i.s=t&&e?t/e:null})),this.C=null,"ResizeObserver"in e&&(this.C=new ResizeObserver((function(){Uc(i,!0)})),this.C.observe(this.g)),this.F=new Map}function Nc(e){e.A&&(e.h.length?e.A.Fa((e.B?e.B.captionsUpdatePeriod:.25)/Math.max(1,Math.abs(e.j.playbackRate))):e.A.stop())}function Oc(e,t){for(;null!=t;){if(t==e.g)return!0;t=t.parentElement}return!1}function jc(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.l.get(u),d=u.startTime<=i&&u.endTime>i,h=c?c.aj:null;c&&(o.push(c.kg),c.Xc&&o.push(c.Xc),d||(a=!0,e.l.delete(u),c=null)),d&&(s.push(u),c?Oc(e,h)||(a=!0):(_c(e,u,r),h=(c=e.l.get(u)).aj,a=!0)),0<u.nestedCues.length&&h&&jc(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.l.get(i.value)).Xc?(i.Xc.contains(n)&&i.Xc.removeChild(n),n.appendChild(i.Xc),i.Xc.appendChild(i.kg)):n.appendChild(i.kg)}}function Uc(e,t){if(e.g){var n=e.j.currentTime;if(!e.m||void 0!==t&&t){for(var i=(t=l(e.F.values())).next();!i.done;i=t.next())Zo(i.value);Zo(e.g),e.l.clear(),e.F.clear()}e.m&&jc(e,e.h,e.g,n,[])}}function _c(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=Bc(n.linePadding,n,e.o),a.paddingRight=Bc(n.linePadding,n,e.o),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.setAttribute("translate","no"),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=Bc(n.fontSize,n,e.o,e.B?e.B.fontScaleFactor:1),null!=(i=n.line)&&((o=n.lineInterpretation)==On&&(o=1,s=16,e.s&&1>e.s&&(s=32),i=0>i?100+i/s*100:i/s*100),1==o&&(a.position="absolute",n.writingMode==Nn?(a.width="100%",n.lineAlign==jn?a.top=i+"%":"end"==n.lineAlign&&(a.bottom=100-i+"%")):"vertical-lr"==n.writingMode?(a.height="100%",n.lineAlign==jn?a.left=i+"%":"end"==n.lineAlign&&(a.right=100-i+"%")):(a.height="100%",n.lineAlign==jn?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!==Cn?n:"left"===e||"start"===e&&t===Ln||"end"===e&&"rtl"===t?"line-left":"right"===e||"start"===e&&"rtl"===t||"end"===e&&t===Ln?"line-right":"center"}(n),"line-left"==e?(a.cssFloat="left",null!==n.position&&(a.position="absolute",n.writingMode==Nn?(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==Nn?(a.right=100-n.position+"%",a.width="auto"):a.bottom=n.position+"%")):null!==n.position&&50!=n.position&&(a.position="absolute",n.writingMode==Nn?(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==Nn?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.s===4/3?2.5:1.9;if(n=o.id+"_"+o.width+"x"+o.height+(o.heightUnits==kt?"%":"px")+"-"+o.viewportAnchorX+"x"+o.viewportAnchorY+(o.viewportAnchorUnits==kt?"%":"px"),e.F.has(n))n=e.F.get(n);else{r=document.createElement("span");var u=o.heightUnits==kt?"%":"px",l=o.widthUnits==kt?"%":"px",c=o.viewportAnchorUnits==kt?"%":"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.s===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.F.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.l.set(t,{kg:a,aj:r,Xc:n})}function Bc(e,t,n,i){i=void 0===i?1:i;var r=(r=new RegExp(/(\d*\.?\d+)([a-z]+|%+)/).exec(e))?{value:Number(r[1]),unit:r[2]}:null;if(!r)return e;switch(e=r.unit,i*=r.value,e){case"%":return i/100*n.clientHeight/t.cellResolution.rows+"px";case"c":return n.clientHeight*i/t.cellResolution.rows+"px";default:return i+e}}function Fc(e,t){this.h=e,this.g=t,this.i=void 0,this.s=!1,this.F=!0,this.l=this.B=!1,this.o=this.m=void 0,this.A=0,this.G=!1,this.C=new $,this.j=null}function Vc(t){return t.g.sessionId||(t.g.sessionId=e.crypto.randomUUID()),{v:t.g.version,sf:t.i,sid:t.g.sessionId,cid:t.g.contentId,mtp:t.h.getBandwidthEstimate()/1e3}}function Hc(e,t,n){n=void 0===n?{}:n;var i=void 0===i?e.g.useHeaders:i;if(e.g.enabled)if(e=function(e,t){t=void 0===t?{}:t,Object.assign(t,Vc(e)),t.pr=e.h.ub();var n=t.ot===Xc||t.ot===Wc;return e.B&&n&&(t.bs=!0,t.su=!0,e.B=!1),null==t.su&&(t.su=e.F),t.v===Jc&&(e.h.V()&&(t.ltc=e.h.Ue()),null!=(n=!e.G&&e.o&&e.m?e.o-(e.A||e.m):void 0)&&(t.msd=n,e.G=!0)),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,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,ltc:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,msd: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=Gc(r[e]))&&(n["CMCD-"+i[e]]=a);return n}(e),Object.keys(i).length&&Object.assign(t.headers,i);else{var r=Gc(e);r&&(t.uris=t.uris.map((function(e){return zc(e,r)})))}}function Kc(e,t){if(!(t=e.h.Nb()[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 Gc(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 zc(e,t){return!t||e.includes("offline:")?e:((e=new de(e)).g.set("CMCD",t),e.toString())}(i=Cc.prototype).configure=function(){},i.remove=function(e,t){return!!this.i&&(this.h.has(this.g)&&Ic(this.h.get(this.g).track,(function(n){return n.startTime<t&&n.endTime>e})),!0)},i.append=function(e){this.h.has(this.g)&&Ec(this.h.get(this.g).track,e)},i.destroy=function(){return this.i&&(this.j&&this.B(),this.i=null),this.l&&(this.l.release(),this.l=null),Promise.resolve()},i.isTextVisible=function(){return this.s},i.setTextVisibility=function(e){if(this.s=e,this.h.has(this.g)){var t=this.h.get(this.g).track;"disabled"!==t.mode&&(e=e?"showing":"hidden",t.mode!==e&&(t.mode=e))}else if(this.i&&3===this.i.m)if(t=Array.from(this.i.h.textTracks).filter((function(e){return["captions","subtitles","forced"].includes(e.kind)})),e){e=null;for(var n=(t=l(t)).next();!n.done;n=t.next()){if("showing"===(n=n.value).mode){e=null;break}e||"hidden"!==n.mode||(e=n)}e&&(e.mode="showing")}else for(t=(e=l(t)).next();!t.done;t=e.next())"showing"===(t=t.value).mode&&(t.mode="hidden")},i.setTextLanguage=function(){},i.enableTextDisplayer=function(){!this.j&&this.i&&2===this.i.m&&(this.j=this.i.h,this.l.Aa(this.i,"unloading",this.B),this.l.D(this.i,"textchanged",this.m),this.l.D(this.j.textTracks,"change",this.A),this.m())},F("shaka.text.NativeTextDisplayer",Cc),Cc.prototype.enableTextDisplayer=Cc.prototype.enableTextDisplayer,Cc.prototype.setTextLanguage=Cc.prototype.setTextLanguage,Cc.prototype.setTextVisibility=Cc.prototype.setTextVisibility,Cc.prototype.isTextVisible=Cc.prototype.isTextVisible,Cc.prototype.destroy=Cc.prototype.destroy,Cc.prototype.append=Cc.prototype.append,Cc.prototype.remove=Cc.prototype.remove,Cc.prototype.configure=Cc.prototype.configure,(i=Dc.prototype).configure=function(){},i.remove=function(e,t){return!!this.g&&(Ic(this.g,(function(n){return n.startTime<t&&n.endTime>e})),!0)},i.append=function(e){this.g&&Ec(this.g,e)},i.destroy=function(){return this.g&&(Ic(this.g,(function(){return!0})),this.g.mode="disabled"),this.g=this.h=null,Promise.resolve()},i.isTextVisible=function(){return!!this.g&&"showing"==this.g.mode},i.setTextVisibility=function(e){e&&!this.g&&Pc(this),this.g&&(this.g.mode=e?"showing":"hidden")},i.setTextLanguage=function(){},i.enableTextDisplayer=function(){Pc(this)},F("shaka.text.SimpleTextDisplayer",Dc),Dc.prototype.enableTextDisplayer=Dc.prototype.enableTextDisplayer,Dc.prototype.setTextLanguage=Dc.prototype.setTextLanguage,Dc.prototype.setTextVisibility=Dc.prototype.setTextVisibility,Dc.prototype.isTextVisible=Dc.prototype.isTextVisible,Dc.prototype.destroy=Dc.prototype.destroy,Dc.prototype.append=Dc.prototype.append,Dc.prototype.remove=Dc.prototype.remove,Dc.prototype.configure=Dc.prototype.configure,(i=Rc.prototype).configure=function(){},i.remove=function(){},i.append=function(){},i.destroy=function(){},i.isTextVisible=function(){return!1},i.setTextVisibility=function(){},i.setTextLanguage=function(){},i.enableTextDisplayer=function(){},F("shaka.text.StubTextDisplayer",Rc),Rc.prototype.enableTextDisplayer=Rc.prototype.enableTextDisplayer,Rc.prototype.setTextLanguage=Rc.prototype.setTextLanguage,Rc.prototype.setTextVisibility=Rc.prototype.setTextVisibility,Rc.prototype.isTextVisible=Rc.prototype.isTextVisible,Rc.prototype.destroy=Rc.prototype.destroy,Rc.prototype.append=Rc.prototype.append,Rc.prototype.remove=Rc.prototype.remove,Rc.prototype.configure=Rc.prototype.configure,(i=Lc.prototype).configure=function(e){this.B=e,Nc(this),Uc(this,!0)},i.append=function(e){for(var t=[].concat(c(this.h)),n=(e=l(Ac(e))).next(),i={};!n.done;i={jg:void 0},n=e.next())i.jg=n.value,t.some(function(e){return function(t){return Sn(t,e.jg)}}(i))||this.h.push(i.jg);this.h.length&&Nc(this),Uc(this)},i.destroy=function(){return this.g?(this.g.parentElement&&this.o.removeChild(this.g),this.g=null,this.m=!1,this.h=[],this.A&&(this.A.stop(),this.A=null),this.l.clear(),this.i&&(this.i.release(),this.i=null),this.C&&(this.C.disconnect(),this.C=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})),Uc(this,n>this.h.length),this.h.length||Nc(this),!0},i.isTextVisible=function(){return this.m},i.setTextVisibility=function(e){(this.m=e)?(this.g.parentElement||this.o.appendChild(this.g),Uc(this,!0)):this.g.parentElement&&this.o.removeChild(this.g)},i.setTextLanguage=function(e){e&&"und"!=e?this.g.setAttribute("lang",e):this.g.setAttribute("lang","")},i.enableTextDisplayer=function(){},F("shaka.text.UITextDisplayer",Lc),Lc.prototype.enableTextDisplayer=Lc.prototype.enableTextDisplayer,Lc.prototype.setTextLanguage=Lc.prototype.setTextLanguage,Lc.prototype.setTextVisibility=Lc.prototype.setTextVisibility,Lc.prototype.isTextVisible=Lc.prototype.isTextVisible,Lc.prototype.remove=Lc.prototype.remove,Lc.prototype.destroy=Lc.prototype.destroy,Lc.prototype.append=Lc.prototype.append,Lc.prototype.configure=Lc.prototype.configure,F("shaka.text.WebVttGenerator",(function(){})),Fc.prototype.setMediaElement=function(e){this.j=e,function(e){e.C.Aa(e.j,"play",(function(){e.m||(e.m=Date.now())})),e.C.Aa(e.j,"playing",(function(){e.o||(e.o=Date.now())}))}(this)},Fc.prototype.configure=function(e){this.g=e};var qc="a",Xc="v",Wc="av",Yc="tt",Jc=2,$c="d",Qc="ld",Zc="h",ed="lh";function td(e){this.h=e,this.g=null}function nd(e){return!e||"false"!==e.toLowerCase()&&(/^[-0-9]/.test(e)?parseInt(e,10):e.replace(/["]+/g,""))}F("shaka.util.CmcdManager.StreamingFormat",{DASH:$c,Ml:Qc,HLS:Zc,Nl:ed,am:"s",OTHER:"o"}),(i=td.prototype).configure=function(e){this.h=e},i.Yh=function(){return this.h.enabled&&this.h.applyMaximumSuggestedBitrate&&this.g&&this.g.has(rd)?1e3*this.g.get(rd):null},i.Wh=function(){return this.h.enabled&&this.g&&this.g.has(id)?1e3*this.g.get(id):null},i.Oj=function(){return this.h.enabled&&this.g&&this.g.has(ad)?this.g.get(ad):null},i.Pj=function(){return this.h.enabled&&this.g&&this.g.has(od)?this.g.get(od):null},i.getBandwidthEstimate=function(e){var t=this.Wh();if(!t)return e;var n=this.h.estimatedThroughputWeightRatio;return 0<n&&1>=n?e*(1-n)+t*n:e},F("shaka.util.CmsdManager",td),td.prototype.getBandwidthEstimate=td.prototype.getBandwidthEstimate,td.prototype.getRoundTripTime=td.prototype.Pj,td.prototype.getResponseDelay=td.prototype.Oj,td.prototype.getEstimatedThroughput=td.prototype.Wh,td.prototype.getMaxBitrate=td.prototype.Yh;var id="etp",rd="mb",ad="rd",od="rtt";function sd(){this.g=null,this.h=[]}function ud(e,t){return R((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 ld(t,n,i){n=void 0===n?null:n,Lr.call(this);var r=this;this.m=hh,this.h=null,this.we=n,this.ba=!1,this.Be=new $,this.pe=new $,this.j=new $,this.bc=new $,this.wd=new $,this.F=this.G=this.C=this.I=null,this.Ce=0,this.ka=new sd,this.N=this.ha=this.W=this.i=this.qc=this.H=this.l=this.le=this.S=this.Gh=this.va=this.L=this.ab=this.ya=this.me=this.P=this.Ka=this.K=this.Zb=null,this.Oa=!1,this.Za=this.s=null,this.ve=1e9,this.Ae=[],this.eb=[],this.Wf=-1,this.g=Ud(this),this.Yf={streaming:{inaccurateManifestTolerance:0,segmentPrefetchLimit:2,updateIntervalSeconds:.1,maxDisabledTime:1,retryParameters:{baseDelay:100}},manifest:{dash:{autoCorrectDrift:!1},retryParameters:{baseDelay:100}},drm:{retryParameters:{baseDelay:100}}},this.U=null,this.Ee=-1,this.$b=null,this.wa={width:1/0,height:1/0},this.ue=new Ka(this.g,this.wa,null),this.ye=[],this.A=null,this.M=this.g.adaptationSetCriteriaFactory(),this.M.configure({language:this.g.preferredAudioLanguage,role:this.g.preferredVariantRole,channelCount:0,Ec:this.g.preferredVideoHdrLevel,spatialAudio:this.g.preferSpatialAudio,videoLayout:this.g.preferredVideoLayout,Jc:this.g.preferredAudioLabel,Ed:this.g.preferredVideoLabel,codecSwitchingStrategy:this.g.mediaSource.codecSwitchingStrategy,audioCodec:"",Gd:"",Fe:0,preferredAudioCodecs:this.g.preferredAudioCodecs,preferredAudioChannelCount:this.g.preferredAudioChannelCount}),this.xd=this.g.preferredTextLanguage,this.se=this.g.preferredTextRole,this.re=this.g.preferForcedSubs,this.qe=[],i&&i(this),this.L=function(e){return new Fc({getBandwidthEstimate:function(){return e.s?e.s.getBandwidthEstimate():NaN},Nb:function(){return e.Nb()},getCurrentTime:function(){return e.h?e.h.currentTime:0},ub:function(){return e.ub()},Pb:function(){return e.Pb()},Qb:function(){return e.Qb()},V:function(){return e.V()},Ue:function(){return e.Ue()}},e.g.cmcd)}(this),this.va=new td(this.g.cmsd),this.I=Ad(this),this.zd=this.na=this.za=this.B=null,this.$f=!1,this.Xf=[],this.Zf=new Ti((function(){return R((function(e){return 1==e.g?r.na?w(e,r.fc(r.zd,!0),3):e.u(0):4!=e.g?w(e,r.load(r.na),4):(r.$f?r.zd.pause():r.zd.play(),r.na=null,r.$f=!1,void T(e))}))})),vh&&(this.B=vh(),this.B.configure(this.g.ads),this.wd.D(this.B,"ad-content-pause-requested",(function(e){var t;return R((function(n){if(1==n.g)return r.Zf.stop(),r.na?n.u(0):(r.zd=r.h,r.$f=r.Wd(),t=e.saveLivePosition||!1,w(n,r.Qh(!0,t),3));r.na=n.h,T(n)}))})),this.wd.D(this.B,"ad-content-resume-requested",(function(e){if(e=e.offset||0,r.na){var t=r.na;t.m&&e&&("number"==typeof t.m?t.m+=e:t.m.setTime(t.m.getTime()+1e3*e))}r.Zf.ia(.1)})),this.wd.D(this.B,"ad-content-attach-requested",(function(){return R((function(e){return r.h||!r.zd?e.u(0):w(e,r.fc(r.zd,!0),0)}))}))),yh&&(this.za=yh(this),this.za.configure(this.g.queue)),this.Be.D(e,"online",(function(){nh(r),r.eh()})),this.xe=new Ti((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.xe.stop(),t&&Gd(r,!1,void 0,!1,!1)})),this.Pa=null,t&&(oe("Player w/ mediaElement","Please migrate from initializing Player with a mediaElement; use the attach method instead."),this.fc(t,!0)),this.o=null}function cd(e){null!=e.S&&(ct(e.S),e.S.release(),e.S=null)}function dd(e,t){return new Dr(e,t)}function hd(e,t){mh.set(e,t)}function pd(e,t){e.dispatchEvent(dd("onstatechange",(new Map).set("state",t)))}function fd(e,t){var n;return R((function(i){return 1==i.g?(n=++e.Ce,w(i,ud(e.ka,t),2)):n!=e.Ce?(e.ka.release(),i.return(!0)):i.return(!1)}))}function gd(e,t){var n,i;return t=void 0!==t&&t,R((function(r){if(1==r.g)return n=null,e.i&&e.H&&e.qc&&e.W&&e.g?(i=e.h.currentTime,e.V()&&!t&&(i=null),w(r,vd(e,e.W,i,e.ha,e.g,!0,!1,!1),3)):r.u(2);if(2!=r.g){n=r.h,e.ye.push(n),e.H&&e.H.setMediaElement&&e.H.setMediaElement(null);var a=n,o=e.H,s=e.qc;a.h=e.i,a.l=o,a.G=s,n.A=e.M,n.start(),e.i=null,e.H=null,e.qc=null,e.s=null,e.Za=null}return r.return(n)}))}function md(e,t,n,i,r,a){var o,s,u,l;return r=void 0!==r&&r,R((function(c){return 1==c.g?i?c.u(2):w(c,yd(e,t),3):(2!=c.g&&(i=c.h),function(e,t){if(!ev(te()))return!0;if(t){if(""==(e.h||es()).canPlayType(t))return!1;if(!ev(te())||!Za.has(t))return!0;if(ci(t))return"WEBKIT"===te().Da()&&(e.g.drm.servers["com.apple.fps"]||e.g.drm.servers["com.apple.fps.1_0"])?e.g.streaming.useNativeHlsForFairPlay:e.g.streaming.preferNativeHls;if("application/dash+xml"===t||"video/vnd.mpeg.dash.mpd"===t)return e.g.streaming.preferNativeDash}return!1}(e,i)?c.return(null):(o=a||e.g,s=!1,u=!0,r&&(e.s&&e.Za==o.abrFactory&&(u=!1),e.h&&"AUDIO"===e.h.nodeName&&(s=!0)),l=vd(e,t,n,i||null,o,!r,s,u),l=r?l.then((function(e){return e.B=!1,e})):l.then((function(t){return e.ye.push(t),t})),c.return(l)))}))}function vd(e,t,n,i,r,a,o,s){var u,c,d,h,p,f,g,m,v,y,b,x;return a=void 0===a||a,o=void 0!==o&&o,s=void 0===s||s,R((function(S){return 1==S.g?(u=null,c=Bt(r),o&&(c.manifest.disableVideo=!0),d=function(){return u.S&&u.o?null:u},h=function(){return d()?d().getConfiguration():e.g},1/0!=e.wa.width||1/0!=e.wa.height||e.g.ignoreHardwareResolution?S.u(2):w(S,te().ic(),3)):(2!=S.g&&(p=S.h,e.wa.width=p.width,e.wa.height=p.height),f=new Ka(c,e.wa,null),g={networkingEngine:e.I,filter:function(e){var t;return R((function(n){return 1==n.g?w(n,Ga(f,e),2):4!=n.g?n.h?(t=dd("trackschanged"),w(n,Promise.resolve(),4)):n.u(0):(u.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 Nu,c=r.closedCaptions.get(o);s={id:e.ve++,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:rt,primary:!1,trickModeVideo:null,dependencyStream: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([ni(s,"")]),isAudioMuxedInVideo:!1,baseOriginalId:null},t.textStreams.push(s),n.add(o)}}(e,t)},onTimelineRegionAdded:function(e){Ku(u.H,e)},onEvent:function(e){return u.dispatchEvent(e)},onError:function(e){return u.onError(e)},isLowLatencyMode:function(){return h().streaming.lowLatencyMode},updateDuration:function(){e.l&&u.S&&e.l.updateDuration()},newDrmInfo:function(e){var t=u.i,n=t?t.g:null;n&&t.A&&Xa(f,n.keySystem,e)},onManifestUpdated:function(){var t=(new Map).set("isLive",e.V());u.dispatchEvent(dd("manifestupdated",t)),ic(u,!1,(function(){e.B&&e.B.onManifestUpdated(e.V())}))},getBandwidthEstimate:function(){return e.s.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.B)&&e.B.onHLSInterstitialMetadata(e,e.h,t),t=(r=l(r)).next();for(var o={};!t.done;o={Xg:void 0},t=r.next())o.Xg=t.value,"ID"!=o.Xg.name&&ic(u,!1,function(t){return function(){Sd(e,n,i,a,t.Xg)}}(o))},disableStream:function(t){return e.disableStream(t,e.g.streaming.maxDisabledTime)},addFont:function(t,n){return e.addFont(t,n)}},(m=new Hu((function(){return e.Sa()}))).addEventListener("regionadd",(function(t){var n=t.region;rh(e,"timelineregionadded",n,u),ic(u,!1,(function(){e.B&&(e.B.onDashTimedMetadata(n),e.B.onDASHInterstitialMetadata(e,e.h,n))}))})),v=null,c.streaming.observeQualityChanges&&((v=new Bu((function(){return e.Nb()}))).addEventListener("qualitychange",(function(t){ah(e,t.quality,t.position)})),v.addEventListener("audiotrackchange",(function(t){ah(e,t.quality,t.position,!0)}))),y=!0,b={pc:e.I,onError:function(e){return u.onError(e)},rf:function(t){ic(u,!0,(function(){if(e.C){var n=t,i=dd("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){r=e.keySystem();for(var o=Jr(e.g.drm.clearKeys),s=l(e.i.variants),u=s.next();!u.done;u=s.next()){var c=[];(u=u.value).audio&&c.push(u.audio),u.video&&c.push(u.video);for(var d=(c=l(c)).next();!d.done;d=c.next()){var h=d.value;if(d=u.allowedByKeySystem,h.keyIds.size)if(h.drmInfos.length&&!o.size){for(var p=(h=l(h.drmInfos)).next();!p.done;p=h.next())if((p=p.value).keyIds.size&&p.keySystem==r){u.allowedByKeySystem=!0;for(var f=(p=l(p.keyIds)).next();!f.done;f=p.next())f=f.value,((f=n[i?"00":f])||e.C.G)&&(u.allowedByKeySystem=u.allowedByKeySystem&&!!f&&!Ya.includes(f))}}else for(u.allowedByKeySystem=!0,p=(h=l(h.keyIds)).next();!p.done;p=h.next())p=p.value,((p=n[i?"00":p])||e.C.G)&&(u.allowedByKeySystem=u.allowedByKeySystem&&!!p&&!Ya.includes(p));d!=u.allowedByKeySystem&&(a=!0)}}}a&&(Wd(e),!Kd(e))||(n=e.l.o)&&!n.allowedByKeySystem&&Gd(e)}}))},onExpirationUpdated:function(e,t){var n=dd("expirationupdated");u.dispatchEvent(n),(n=u.l)&&n.onExpirationUpdated&&n.onExpirationUpdated(e,t)},onEvent:function(t){u.dispatchEvent(t),"drmsessionupdate"==t.type&&y&&(y=!1,t=Date.now()/1e3-u.Ka,(e.A||u.getStats()).m=t,e.S&&ct(e.S))}},x=Ad(e,d),_r(e.I,x),u=new nc(t,i,n,{config:c,pk:g,Ck:m,Bk:v,hd:function(){return e.hd(b)},nk:f,networkingEngine:x,ej:a,dj:s}),s||function(e,t,n){e.j=t,e.C=n}(u,e.s,e.Za),S.return(u))}))}function yd(e,t){var n,i;return R((function(r){return 1==r.g?(n=e.g.manifest.retryParameters,w(r,gc(t,e.I,n),2)):("application/x-mpegurl"==(i=r.h)&&"WEBKIT"===te().Da()&&(i="application/vnd.apple.mpegurl"),r.return(i))}))}function bd(e){var t=e.g.textDisplayFactory;if(e.Fh!==t){var n=e.o;e.o=t(),e.o.configure?e.o.configure(e.g.textDisplayer):oe("Text displayer w/ configure",'Text displayer should have a "configure" method!'),e.o.setTextLanguage||oe("Text displayer w/ setTextLanguage",'Text displayer should have a "setTextLanguage" method!'),n?(e.o.setTextVisibility(n.isTextVisible()),n.destroy().catch((function(){}))):e.o.setTextVisibility(e.ba),e.G&&function(e,t){e.ha=t,e.h&&(e.h.j=t)}(e.G,e.o),e.Fh=t,e.l&&function(e){var t=e.h.get(rt);t&&ll(e,t.stream,!0,0,!0)}(e.l)}else e.o&&e.o.configure&&e.o.configure(e.g.textDisplayer)}function wd(e){var t,n,i;return R((function(r){if(1==r.g)return te(),pd(e,"media-source"),e.g.mediaSource.useSourceElements&&Qo(e.h),bd(e),t=function(e,t,n,i,r){return new Ds(e,t,n,r,i)}(e.h,e.o,{Ej: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())Sd(e,a,o,"org.id3",u.value);e.B&&e.B.onHlsTimedMetadata(r,a)}},wk:function(t){e.ab&&Ku(e.ab,{schemeIdUri:t.schemeIdUri,startTime:t.startTime,endTime:t.endTime,id:String(t.id),emsg:t})},onEvent:function(t){return e.dispatchEvent(t)},yk:function(){e.H&&e.H.update&&e.H.update()}},e.S,e.g.mediaSource),n=e.g.manifest,i=n.segmentRelativeVttTiming,t.Ka=i,w(r,t.K,2);e.G=t,T(r)}))}function Td(e,t,n){function i(){return Fd(e)}if(e.j.D(t,"playing",i),e.j.D(t,"pause",i),e.j.D(t,"ended",i),e.j.D(t,"ratechange",(function(){var t=e.h.playbackRate;0!=t&&(e.K&&(e.K.set(t),e.m==ph&&e.s.playbackRateChanged(t),Bd(e,t)),t=dd("ratechange"),e.dispatchEvent(t))})),t.remote&&(e.j.D(t.remote,"connect",(function(){e.l&&"connected"==t.remote.state&&Qd(e),Wd(e)})),e.j.D(t.remote,"connecting",(function(){return Wd(e)})),e.j.D(t.remote,"disconnect",(function(){return R((function(n){if(1==n.g)return e.l&&"disconnected"==t.remote.state?w(n,Il(e.l),3):n.u(2);2!=n.g&&Qd(e),Wd(e),T(n)}))}))),t.audioTracks&&(e.j.D(t.audioTracks,"addtrack",(function(){return Wd(e)})),e.j.D(t.audioTracks,"removetrack",(function(){return Wd(e)})),e.j.D(t.audioTracks,"change",(function(){return Wd(e)}))),t.videoTracks&&(e.j.D(t.videoTracks,"addtrack",(function(){return Wd(e)})),e.j.D(t.videoTracks,"removetrack",(function(){return Wd(e)})),e.j.D(t.videoTracks,"change",(function(){return Wd(e)}))),t.textTracks){var r=function(){e.m===fh&&e.o instanceof Cc&&Qd(e),Wd(e)};e.j.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.j.D(t,"cuechange",(function(){if(t.activeCues)for(var n=l(t.activeCues),i=n.next();!i.done;i=n.next())i=i.value,Sd(e,i.startTime,i.endTime,i.type,i.value),e.B&&e.B.onCueMetadataChange(i.value);if(t.cues){n=[];for(var r=(i=l(t.cues)).next(),a={};!r.done;a={xc:void 0},r=i.next())a.xc=r.value,"com.apple.quicktime.HLS"==a.xc.type&&null!=a.xc.startTime&&(r=n.find(function(e){return function(t){return t.startTime==e.xc.startTime&&t.endTime==e.xc.endTime}}(a)),r||(r={startTime:a.xc.startTime,endTime:a.xc.endTime,values:[]},n.push(r)),r.values.push(a.xc.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.B&&(i.values.push({key:"CUE",description:"",data:0!=i.startTime||e.V()?"ONCE":"ONCE,PRE",mimeType:null,pictureType:null}),e.B.onHLSInterstitialMetadata(e,e.h,i))}}));var n=new Ti((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"})).Jb().ia(.5);e.qe.push((function(){n.stop()}))}}(e,t);break;case"chapters":!function(e,t){if(t&&"chapters"==t.kind){t.mode="hidden";var n=new Ti((function(){t.mode="hidden"})).Jb().ia(.5);e.qe.push((function(){n.stop()}))}}(e,t);break;default:r()}})),e.j.D(t.textTracks,"removetrack",r),e.j.D(t.textTracks,"change",r),"keep"!==e.g.streaming.crossBoundaryStrategy&&(e.j.D(t,"waiting",(function(){e.l&&Ml(e.l)})),e.j.D(t,"timeupdate",(function(){e.l&&Ml(e.l)})))}"none"!=t.preload&&e.j.Aa(t,"loadedmetadata",(function(){e.A.F=Date.now()/1e3-n}))}function xd(e,t,n){t=(new Map).set("startTime",t.startTime).set("endTime",t.endTime).set("metadataType",t.schemeIdUri).set("payload",t.payload),e.dispatchEvent(dd(n,t))}function Sd(e,t,n,i,r){e.ya&&((t={schemeIdUri:i,startTime:t,endTime:n||1/0,id:"",payload:r}).id=JSON.stringify(t),Ku(e.ya,t))}function Ad(e,t){function n(n){t()?t().dispatchEvent(n):e.dispatchEvent(n)}function i(e){t()?ic(t(),!0,e):e()}t||(t=function(){return null});var r=new jr((function(n,i,r,a,o){var s=t()?t().j:e.s;s&&s.segmentDownloaded(n,i,r,a,o)}),(function(t,r,a){n(dd("downloadheadersreceived",r=(new Map).set("headers",t).set("request",r).set("requestType",a))),i((function(){if(e.va){var n=e.va;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],nd(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],nd(l[1]))}var c=s}catch(e){c=null}c&&(n.g=c)}}}}))}),(function(e,t){n(dd("downloadcompleted",e=(new Map).set("request",e).set("response",t)))}),(function(e,t,i,r){n(dd("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.L,a=r;if(a=void 0===a?{}:a,i.g.enabled)if("HEAD"===n.method)Hc(i,n);else switch(t){case 0:try{if(i.g.enabled){if(a.type){e:{switch(a.type){case 4:var o=i.l?Qc:$c;break e;case 3:case 2:o=i.l?ed:Zc;break e;case 5:o="s";break e}o=void 0}i.i=o}Hc(i,n,{ot:"m",su:!i.s})}}catch(e){X("CMCD_MANIFEST_ERROR","Could not generate manifest CMCD data.",e)}break;case Gr:try{if(i.g.enabled){var s=n.uris[0],u=a.segment;o=0,u&&(o=u.endTime-u.startTime);var c={d:1e3*o,st:i.h.V()?"l":"v"};c.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(",")?Wc:Xc;if("audio"==t)return qc;if("text"==t)return"application/mp4"===e.mimeType?Yc:"c"}}(a);var d=c.ot===Xc||c.ot===qc||c.ot===Wc||c.ot===Yc,h=a.stream;if(h){var p=i.h.ub();if(d&&(c.bl=function(e,t){if(!(t=e.h.Nb()[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,h.type),c.ot!==Yc)){var f=Kc(i,h.type);c.dl=p?f/Math.abs(p):f}if(h.bandwidth&&(c.br=h.bandwidth/1e3),h.segmentIndex&&u){var g=h.segmentIndex.Wb(u.endTime,!0,0>p);if(g){var m=g.next().value;if(m&&m!=u){if(s&&!Dt(u.O(),m.O())){var v=m.O()[0],y=new URL(v),b=new URL(s);if(y.origin!==b.origin)var w=v;else{for(var T=y.pathname.split("/").slice(1),x=b.pathname.split("/").slice(1,-1);T[0]===x[0];)T.shift(),x.shift();for(;x.length;)x.shift(),T.unshift("..");w=T.join("/")}c.nor=w}if((m.startByte||m.endByte)&&(u.startByte!=m.startByte||u.endByte!=m.endByte)){var S=m.startByte+"-";m.endByte&&(S+=m.endByte),c.nrr=S}}}var A=i.h.ub()||1,k=Kc(i,h.type)||500,E=h.bandwidth,I=E?E*(u.endTime-u.startTime)/1e3/(k/A/1e3)*i.g.rtpSafetyFactor:NaN;isNaN(I)||(c.rtp=I)}}d&&c.ot!==Yc&&(c.tb=function(e,t){var n=e.h.Qb();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 Xc:return e.videoBandwidth||NaN;case qc:return e.audioBandwidth||NaN;default:return e.bandwidth}}(i,c.ot)/1e3),Hc(i,n,c)}}catch(e){X("CMCD_SEGMENT_ERROR","Could not generate segment CMCD data.",e)}break;case 2:case 5:case 6:Hc(i,n,{ot:"k"});break;case 4:Hc(i,n,{ot:"o"})}}))}),(function(n,i,r,a){(n=t()?t().l: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&&(tc(r,i),0===n&&(r.gi=i))}}));return r.configure(e.g.networking),r}function kd(e,t,n){e.P=new Fa,e.P.g=Va,Ed(e),_d(e),e.Ka=new Ti((function(){Id(e)})),e.g.streaming.rebufferingGoal&&e.Ka.Fa(.25),e.j.D(t,"waiting",(function(){return Id(e)})),e.j.D(t,"canplaythrough",(function(){return Id(e)})),e.j.D(t,"playing",(function(){return Id(e)})),e.j.D(t,"seeked",(function(){return Id(e)})),n&&(e.j.D(t,"stalled",(function(){return Id(e)})),e.j.D(t,"progress",(function(){return Id(e)})),e.j.D(t,"timeupdate",(function(){return Id(e)})))}function Ed(e){var t=e.g.streaming.rebufferingGoal;e.P.i.set(Ha,Math.min(.5,t/2)).set(Va,t)}function Id(e){var t=!!e.G&&Os(e.G),n=e.Wd()||t||e.F.ci(),i=Wo(e.h.buffered,e.h.currentTime),r=(t=e.P).i.get(t.g),a=t.g;n=n||i>=r&&0<i?Ha:Va,t.g=n,(a=a!=n)&&n===Ha&&(t.h=Date.now()),a&&_d(e)}function Cd(e){if(e.ue=new Ka(e.g,e.wa,e.C),e.H){var t=Bt(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.l){e.l.configure(e.g.streaming);try{e.m!=dh&&qa(e.ue,e.i)&&Wd(e)}catch(t){ih(e,t)}e.s&&Kd(e),!(t=e.l.o)||t.allowedByApplication&&t.allowedByKeySystem||Gd(e)}e.I&&e.I.configure(e.g.networking),e.G&&(e.G.configure(e.g.mediaSource),e.G.Ka=e.g.manifest.segmentRelativeVttTiming),e.o&&bd(e),e.s&&(e.s.configure(e.g.abr),e.g.abr.enabled?e.s.enable():e.s.disable(),eh(e)),e.P&&Ed(e),e.Ka&&(e.g.streaming.rebufferingGoal?e.Ka.Fa(.25):e.Ka.stop()),e.i&&sh(e.i.presentationTimeline,e.g.playRangeStart,e.g.playRangeEnd),e.B&&e.B.configure(e.g.ads),e.L&&e.L.configure(e.g.cmcd),e.va&&e.va.configure(e.g.cmsd),e.za&&e.za.configure(e.g.queue)}function Md(e){return e&&(e=/(\d+)x(\d+)/.exec(e))?{Lc:parseInt(e[1],10),rows:parseInt(e[2],10)}:null}function Dd(e,t){var n,i;return R((function(r){return 1==r.g?e.m!=ph&&e.m!=fh?r.return(null):(n=e.Ae,e.i&&(n=e.i.imageStreams),(i=n[0])?(null!=t&&(i=n.find((function(e){return e.id==t}))),i?i.segmentIndex?r.u(2):w(r,i.createSegmentIndex(),2):r.return(null)):r.return(null)):r.return(i)}))}function Pd(e,t,n,i){var r=t.width||0,a=t.height||0,o=r/i.Lc,s=a/i.rows,u=i.Lc*i.rows,l=e.j-e.startTime;l=e.B||l/u;var c=e.startTime,d=0,h=0;return 1<u&&(h=Math.floor((n-e.startTime)/l),c=e.startTime+h*l,d=h%i.Lc*o,h=Math.floor(h/i.Lc)*s),i=!1,(n=e.thumbnailSprite)&&(i=!0,s=n.height,d=n.positionX,h=n.positionY,o=n.width),{segment:e,imageHeight:a,imageWidth:r,height:s,positionX:d,positionY:h,startTime:c,duration:l,uris:e.O(),startByte:e.Bc(),endByte:e.zc(),width:o,sprite:i,mimeType:e.mimeType||t.mimeType,codecs:e.codecs||t.codecs}}function Rd(e,t){e.j.D(t,"cuechange",(function(){e.o.remove(0,Math.max(0,e.h.currentTime-e.g.streaming.bufferBehind));for(var n={periodStart:0,segmentStart:0,segmentEnd:e.h.duration,vttOffset:0},i=[],r=Array.from(t.activeCues||[]),a=(r=l(r)).next();!a.done;a=r.next()){if(1/0===(a=a.value).endTime||a.endTime<a.startTime)a=null;else{var o=new Tn(a.startTime,a.endTime,a.text);o.line="number"==typeof a.line?a.line:null,a.lineAlign&&(o.lineAlign=a.lineAlign),o.lineInterpretation=a.snapToLines?On:1,o.position="number"==typeof a.position?a.position:null,a.positionAlign&&(o.positionAlign=a.positionAlign),o.size=a.size,o.textAlign=a.align,"lr"===a.vertical?o.writingMode="vertical-lr":"rl"===a.vertical&&(o.writingMode="vertical-rl"),a.region&&(o.region.id=a.region.id,o.region.height=a.region.lines,o.region.heightUnits=2,o.region.regionAnchorX=a.region.regionAnchorX,o.region.regionAnchorY=a.region.regionAnchorY,o.region.scroll=a.region.scroll,o.region.viewportAnchorX=a.region.viewportAnchorX,o.region.viewportAnchorY=a.region.viewportAnchorY,o.region.viewportAnchorUnits=kt,o.region.width=a.region.width,o.region.widthUnits=kt),An(o),a=o}a&&((o=e.g.mediaSource.modifyCueCallback)&&o(a,null,n),i.push(a))}e.o.append(i)})),t.mode=document.pictureInPictureElement?"showing":"hidden"}function Ld(e){return Array.from(e.h.textTracks).filter((function(e){return"metadata"!=e.kind&&"chapters"!=e.kind&&"Shaka Player TextTrack"!=e.label}))}function Nd(e,t){var n;return R((function(i){switch(i.g){case 1:return x(i,2),w(i,gc(t,e.I,e.g.streaming.retryParameters),4);case 4:n=i.h,A(i,3);break;case 2:k(i);case 3:if(n)return i.return(n);throw new Ne(1,2,2011,t)}}))}function Od(e,t,n,i){var r,a,o;return R((function(s){if(1==s.g){r=Gr,(a=Br([t],i)).method="GET";var u=e.L;try{u.g.enabled&&Hc(u,a,{ot:"c",su:!0})}catch(e){X("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 jd(e,t,n,i){var r=gi(n);if(r)return n=r(),e={periodStart:0,segmentStart:0,segmentEnd:e.h.duration,vttOffset:0},t=De(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=Sc(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 Ne(2,2,2014,n)}function Ud(e){var t=zl();return t.streaming.failureCallback=function(t){if(e.V()){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.eh(n))}},t.textDisplayFactory=function(){var t=te();return e.we&&(document.fullscreenEnabled||"WEBKIT"!==t.Da())?new Lc(e.h,e.we):"track"in document.createElement("track")?new Cc(e):new Rc},t}function _d(e){var t=e.Mg();if(e.A&&e.P&&e.F){if(0==e.g.streaming.rebufferingGoal){var n=e.K;n.j=!1,ju(n)}else(n=e.K).j=t,ju(n);if(e.L&&(n=e.L,t||n.s||(n.s=!0),n.s&&t&&(n.B=!0),n.F=t),Fd(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.U&&(e.U=Math.min(e.U+ ++e.Ee*r,n-i))}}t=(new Map).set("buffering",t),e.dispatchEvent(dd("buffering",t))}function Bd(e,t){e.bc.Ra(),e.bc.D(e.h,"timeupdate",(function(){var n=e.h.currentTime,i=e.Sa(),r=e.V(),a=r?e.g.streaming.safeSeekOffset:0;0<t?(!r||1<=t)&&Math.floor(n)>=Math.floor(i.end)&&e.Id():Math.floor(n)<=Math.floor(i.start+a)&&e.Id()}))}function Fd(e){if(e.A&&e.P){var t=e.A.g,n="playing";e.P.g==Va?n="buffering":e.Wd()?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(dd("statechanged",n)))}}function Vd(e){var t=e.h.playbackRate,n=e.V();if(e.g.streaming.vodDynamicPlaybackRate&&!n){var i=e.g.streaming.vodDynamicPlaybackRateLowBufferRate,r=e.Vh();r<=e.g.streaming.vodDynamicPlaybackRateBufferRatio?t!=i&&e.ke(i,!1):1==r&&t!==e.K.Pc()&&e.Id()}if(n&&(n=e.Sa(),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.U||"number"!=typeof o||(e.U=o);var d=e.g.streaming.liveSync.dynamicTargetLatency.maxAttempts;r&&e.$b&&null!==e.U&&"number"==typeof o&&e.Ee<d&&Date.now()-e.$b>1e3*a&&(a=e.g.streaming.liveSync.dynamicTargetLatency.minLatency,e.U=Math.max(e.U-(o-a)/2,a+i),e.$b=Date.now()),r&&null!==e.U&&(s=e.U+i,u=e.U-i),o=n.end-e.h.currentTime,i=0,e.m==fh&&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.P.h,n&&!c&&(c=e.g.streaming.liveSync.minPlaybackRate),n&&c&&a<=r?t!=c&&e.ke(c,!1):null!=s&&l&&o-i>s?(t!=l&&e.ke(l,!1),e.$b=null):null!=u&&c&&o-i<u?(t!=c&&e.ke(c,!1),e.$b=null):t!==e.K.Pc()&&(e.Id(),e.$b=Date.now())}}function Hd(e){if(e.h){var t=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.Wf<t)&&(e.Wf=t,!0)},n=e.Sa();if(n=0<(n=n.end-n.start)?e.h.currentTime/n:0,!isNaN(n)){if(t(0,n*=100))var i=dd("started");else t(25,n)?i=dd("firstquartile"):t(50,n)?i=dd("midpoint"):t(75,n)?i=dd("thirdquartile"):((t(100,n)||100<n)&&(i=dd("complete")),e.g&&1/0!=e.g.playRangeEnd&&e.Wd()&&e.h.pause());i&&e.dispatchEvent(i)}}}function Kd(e){try{Wa(e.ue,e.i)}catch(t){return ih(e,t),!1}var t=Zi(e.i.variants);return t=e.M.create(t),e.s.setVariants(Array.from(t.values())),!0}function Gd(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=Kd(e)?e.s.chooseVariant():null)&&zd(e,a,r,t,n,i)}function zd(e,t,n,i,r,a){a=void 0!==a&&a;var o=e.l.o;if(t==o)i&&sl(e.l,t,i,r,!0);else{var s=e.A.h;if(s.h!=t&&(s.h=t,s.g.push({timestamp:Date.now()/1e3,id:t.id,type:"variant",fromAdaptation:n,bandwidth:t.bandwidth})),sl(e.l,t,i,r,a,n),i=null,o&&(i=qi(o)),(o=qi(t)).active=!0,e.S&&(r=e.S,t=t.video)){switch(t.dependencyStream&&(t=t.dependencyStream),a=0,s=-1,t.mimeType){case"video/webm":a=1;break;case"video/mp4":a=2}switch(e.Xh()){case"DASH":s=1;break;case"HLS":s=0}r.g&&(r.g.setLevelSwitching(t.id,!0),r.g.setContainerFormat(a),r.j||r.g.setStreamingFormat(s))}n?uh(e,n=dd("adaptation",n=(new Map).set("oldTrack",i).set("newTrack",o))):Yd(e,i,o),Jd(e,i,o)}}function qd(e,t){var n=Array.from(e.h.audioTracks).find((function(e){return e.enabled}));if(t.enabled=!0,n){t.id!==n.id&&(n.enabled=!1);var i=Xd(e);Yd(e,n=$i(n,i),t=$i(t,i)),Jd(e,n,t)}}function Xd(e){return e.h&&e.h.videoTracks?Array.from(e.h.videoTracks).find((function(e){return e.selected})):null}function Wd(e){uh(e,dd("trackschanged")),$d(e)}function Yd(e,t,n){uh(e,t=dd("variantchanged",t=(new Map).set("oldTrack",t).set("newTrack",n)))}function Jd(e,t,n){var i=!1;t&&t.audioId==n.audioId&&t.audioGroupId==n.audioGroupId||(i=!0),i&&$d(e)}function $d(e){uh(e,dd("audiotrackschanged"))}function Qd(e){uh(e,dd("textchanged"))}function Zd(e){uh(e,dd("texttrackvisibility"))}function eh(e){e.g.abr.enabled||nh(e),uh(e,dd("abrstatuschanged",(new Map).set("newStatus",e.g.abr.enabled)))}function th(e){var t=e.Dc().find((function(e){return e.active}));t&&e.o&&e.o.setTextLanguage&&e.o.setTextLanguage(t.language)}function nh(e,t){if(t=void 0===t||t,e.m==ph){e.xe.stop();for(var n=l(e.i.variants),i=n.next();!i.done;i=n.next())i.value.disabledUntilTime=0;t&&Kd(e)}}function ih(e,t){var n,i,r,a;return R((function(o){switch(o.g){case 1:if(e.m==dh)return o.return();if(1===t.severity&&e.A.L++,n=!0,!(e.Oa&&e.i&&e.l)||3016!=t.code&&3014!=t.code&&3015!=t.code&&3024!=t.code&&3018!=t.code){o.u(2);break}return"WEBKIT"===te().Da()&&3016==t.code?o.return():(x(o,3),w(o,Il(e.l),5));case 5:i=o.h,n=!i,i&&(r=dd("mediasourcerecovered"),e.dispatchEvent(r)),A(o,2);break;case 3:k(o),n=!0;case 2:if(!n)return o.return();2===t.severity&&nh(e,!1),a=dd("error",(new Map).set("detail",t)),e.dispatchEvent(a),a.defaultPrevented&&(t.handled=!0),T(o)}}))}function rh(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,timescale:n.timescale,eventElement:n.eventElement,eventNode:n.eventNode}),i.dispatchEvent(dd(t,e))}function ah(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(dd(i?"audiotrackchanged":"mediaqualitychanged",t))}function oh(e,t){if(t=void 0===t||t,!e.h.error)return t?new Ne(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 Ne(2,3,3016,n,t,e.h.error.message)):null}function sh(e,t,n){0<t&&(e.V()||e.Ni(t)),n<(t=e.getDuration())&&(e.V()||e.pb(n))}function uh(e,t){R((function(n){if(1==n.g)return w(n,Promise.resolve(),2);e.m!=dh&&e.dispatchEvent(t),T(n)}))}function lh(e){for(var t=new Set,n=(e=l(e)).next();!n.done;n=e.next())(n=n.value).language?t.add(Di(n.language)):t.add("und");return t}function ch(e){for(var t=new Map,n=new Map,i=0;i<e.length;i++){var r=e[i],a="und",o=[];r.language&&(a=Di(r.language)),(o="variant"==r.type?r.audioRoles:r.roles)&&o.length||(o=[""]),t.has(a)||t.set(a,new Set);for(var s=(o=l(o)).next();!s.done;s=o.next())s=s.value,t.get(a).add(s),r.label&&(n.has(a)||n.set(a,new Map),n.get(a).set(s,r.label))}var u=[];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)),u.push({language:t,role:i,label:r})}})),u}sd.prototype.release=function(){0<this.h.length?this.h.shift()():this.g=null},m(ld,Lr),(i=ld.prototype).destroy=function(){var e,t=this;return R((function(n){switch(n.g){case 1:return t.m==dh?n.return():(cd(t),e=t.detach(),t.m=dh,w(n,e,2));case 2:return w(n,t.ng(),3);case 3:if(t.Be&&(t.Be.release(),t.Be=null),t.pe&&(t.pe.release(),t.pe=null),t.j&&(t.j.release(),t.j=null),t.bc&&(t.bc.release(),t.bc=null),t.wd&&(t.wd.release(),t.wd=null),t.Za=null,t.g=null,t.A=null,t.we=null,t.L=null,t.va=null,!t.I){n.u(4);break}return w(n,t.I.destroy(),5);case 5:t.I=null;case 4:t.s&&(t.s.release(),t.s=null),t.za&&(t.za.destroy(),t.za=null),Lr.prototype.release.call(t),T(n)}}))},i.fc=function(e,t){t=void 0===t||t;var n,i,r,a=this;return R((function(o){switch(o.g){case 1:if(a.m==dh)throw new Ne(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,fd(a,"attach"),4);case 4:if(o.h)return o.return();if(x(o,5,6),n||(pd(a,"attach"),i=function(){var e=oh(a,!1);e&&ih(a,e)},a.pe.D(e,"error",i),a.h=e,a.L&&a.L.setMediaElement(e)),te(),!t||!ev()||a.G){o.u(6);break}return w(o,wd(a),6);case 6:E(o),a.ka.release(),I(o,0);break;case 5:return r=k(o),w(o,a.detach(),10);case 10:throw r}}))},i.fj=function(e){this.Gh=e},i.detach=function(e){e=void 0!==e&&e;var t=this;return R((function(n){if(1==n.g){if(t.m==dh)throw new Ne(2,7,7e3);return w(n,t.vc(!1,e),2)}if(3!=n.g)return w(n,fd(t,"detach"),3);if(n.h)return n.return();try{t.h&&(t.pe.Ra(),t.h=null),pd(t,"detach"),t.B&&!e&&t.B.release()}finally{t.ka.release()}T(n)}))},i.vc=function(t,n){t=void 0===t||t,n=void 0!==n&&n;var i,r,a,o,s,u,c,d,h,p,f,g,m,v=this;return R((function(y){switch(y.g){case 1:return v.m!=dh&&(v.m=hh),w(y,fd(v,"unload"),2);case 2:return y.h?y.return():(S(y,3),v.Oa=!1,pd(v,"unload"),cd(v),i=v.qe.map((function(e){return e()})),v.qe=[],w(y,Promise.all(i),5));case 5:if(v.dispatchEvent(dd("unloading")),v.me&&(v.me.release(),v.me=null),v.ya&&(v.ya.release(),v.ya=null),v.ab&&(v.ab.release(),v.ab=null),v.h&&(v.j.Ra(),v.bc.Ra()),v.xe.stop(),v.Zb&&(v.Zb.release(),v.Zb=null),v.Ka&&(v.Ka.stop(),v.Ka=null),!v.H){y.u(6);break}return w(y,v.H.stop(),7);case 7:v.H=null,v.qc=null;case 6:if(!v.s){y.u(8);break}return w(y,v.s.stop(),8);case 8:if(!v.l){y.u(10);break}return w(y,v.l.destroy(),11);case 11:v.l=null;case 10:if(v.K&&(v.K.release(),v.K=null),v.F&&(v.F.release(),v.F=null),"webkit"!==e.shakaMediaKeysPolyfill||!v.C){y.u(12);break}return w(y,v.C.destroy(),13);case 13:v.C=null;case 12:if(!v.G){y.u(14);break}return w(y,v.G.destroy(),15);case 15:v.G=null;case 14:if(v.B&&!n&&v.B.onAssetUnload(),v.na&&!n&&(v.na.destroy(),v.na=null),n||v.Zf.stop(),v.L&&function(e){e.s=!1,e.F=!0,e.B=!1,e.l=!1,e.m=0,e.o=0,e.A=0,e.G=!1,e.j=null,e.C.Ra()}(v.L),v.va&&(v.va.g=null),!v.o){y.u(16);break}return w(y,v.o.destroy(),17);case 17:v.o=null;case 16:if(v.ba=!1,v.h){for(r=l(v.Xf),a=r.next();!a.done;a=r.next())(o=a.value).src.startsWith("blob:")&&URL.revokeObjectURL(o.src),o.remove();v.Xf=[],Qo(v.h)&&v.h.load()}if(!v.C){y.u(18);break}return w(y,v.C.destroy(),19);case 19:v.C=null;case 18:if(v.Pa&&v.W!=v.Pa.nd()&&(v.Pa.o||v.Pa.destroy(),v.Pa=null),v.W=null,v.ha=null,v.P=null,v.i){for(s=l(v.i.variants),u=s.next();!u.done;u=s.next())for(c=u.value,d=l([c.audio,c.video]),h=d.next();!h.done;h=d.next())(p=h.value)&&p.segmentIndex&&p.segmentIndex.release();for(f=l(v.i.textStreams),g=f.next();!g.done;g=f.next())(m=g.value).segmentIndex&&m.segmentIndex.release()}v.g&&v.g.streaming.clearDecodingCache&&(or.clear(),wr.clear()),v.i=null,v.A=new Zl,v.Fh=null,v.$b=null,v.U=null,v.Ee=-1,v.Ae=[],v.eb=[],v.Wf=-1,v.I&&v.I.Mh(),_d(v);case 3:E(y),v.ka.release(),I(y,4);break;case 4:if(te(),t&&ev()&&!v.G&&v.h)return w(y,wd(v),0);y.u(0)}}))},i.cl=function(e){this.N=e},i.load=function(t,n,i){n=void 0===n?null:n;var r,a,o,s,u,c,d,h,p,f,g,m,v,y,b=this;return R((function(A){switch(A.g){case 1:if(b.m==dh)throw new Ne(2,7,7e3);if(r=null,a="",t instanceof nc){if(t.o)throw new Ne(2,7,7006);a=(r=t).nd()||""}else a=t||"";return w(A,ud(b.ka,"load"),2);case 2:if(b.ka.release(),!b.h)throw new Ne(2,7,7002);if(!b.W){A.u(3);break}return b.W=a,w(A,b.vc(!1),3);case 3:if(o=++b.Ce,s=function(){return R((function(e){if(1==e.g)return b.Ce==o?e.u(0):r?w(e,r.destroy(),3):e.u(3);throw new Ne(2,7,7e3)}))},u=function(e,t){return R((function(n){switch(n.g){case 1:return S(n,2),w(n,ud(b.ka,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&&b.g&&(r.g=b.g);case 2:E(n),b.ka.release(),I(n,0)}}))},x(A,5,6),null==n&&r&&(n=r.getStartTime()),b.N=n,b.Oa=!1,b.dispatchEvent(dd("loading")),r){i=r.W,A.u(8);break}if(i){A.u(8);break}return w(A,u((function(){return R((function(e){if(1==e.g)return w(e,yd(b,a),2);i=e.h,T(e)}))}),"guessMimeType_"),8);case 8:if(c=!!r,r){rc(r,b),b.A=r.getStats(),A.u(11);break}return w(A,md(b,a,n,i,!0,b.g),12);case 12:(r=A.h)?(r.B=!1,rc(r,b),b.A=r.getStats(),r.start(),r.s.catch((function(){}))):b.A=new Zl;case 11:return d=!r,h=Date.now()/1e3,b.A=r?r.getStats():new Zl,b.W=a,b.ha=i||null,_d(b),p=function(){var e=b.Nb(),t={start:0,end:0};if(e.total.length){t.start=1/0;for(var n=(e=l(e.total)).next();!n.done;n=e.next())(n=n.value).start<t.start&&(t.start=n.start),n.end>t.end&&(t.end=n.end)}return t},b.ya=new Hu(p),b.ya.addEventListener("regionadd",(function(e){xd(b,e.region,"metadataadded")})),d?w(A,u((function(){return R((function(e){return w(e,function(e,t){var n,i,r;return R((function(a){return 1==a.g?(n=Date.now()/1e3,i=!0,e.C=e.hd({pc:e.I,onError:function(t){ih(e,t)},rf:function(){},onExpirationUpdated:function(){var t=dd("expirationupdated");e.dispatchEvent(t)},onEvent:function(t){e.dispatchEvent(t),"drmsessionupdate"==t.type&&i&&(i=!1,e.A.m=Date.now()/1e3-n)}}),e.C.configure(e.g.drm),r=ar([t]),e.C.ha=!0,w(a,ga(e.C,[r],[]),2)):w(a,e.C.fc(e.h),0)}))}(b,i),0)}))}),"initializeSrcEqualsDrmInner_"),23):(b.ab=new Hu(p),w(A,u((function(){return R((function(e){if(1==e.g)return w(e,Promise.race([r.va,r.s]),2);b.qc=r.G;var t=r;t.wa=!0,b.H=t.l,b.i=r.Fg(),T(e)}))}),"waitForFinish"),15));case 15:if(b.G){A.u(16);break}return w(A,u((function(){return R((function(e){return w(e,wd(b),0)}))}),"initializeMediaSourceEngineInner_"),16);case 16:return b.i&&b.i.textStreams.length&&(b.o.enableTextDisplayer?b.o.enableTextDisplayer():oe("Text displayer w/ enableTextDisplayer",'Text displayer should have a "enableTextDisplayer" method!')),w(A,u((function(){return R((function(e){return w(e,r.s,0)}))}),"waitForFinish"),18);case 18:if(b.g=r.getConfiguration(),b.ue=r.F,b.H&&b.H.setMediaElement&&b.h&&b.H.setMediaElement(b.h),b.me=function(e){return e.ya=!0,e.H}(r),b.le=r.Pa,(f=r.A)&&(b.M=f),c&&b.h&&"AUDIO"===b.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}))}(b),b.configure("manifest.disableVideo",!0)),r.i){A.u(19);break}return w(A,u((function(){return R((function(e){return w(e,sc(r,b.h),0)}))}),"drmEngine_.init"),19);case 19:return b.C=function(e){return e.na=!0,e.i}(r),w(A,u((function(){return R((function(e){return w(e,b.C.fc(b.h),0)}))}),"drmEngine_.attach"),21);case 21:return!(g=r.C)||b.Za&&b.Za==g||(b.s=function(e){return e.ha=!0,e.j}(r),b.Za=r.C,"function"!=typeof b.s.setMediaElement&&(oe("AbrManager w/o setMediaElement","Please use an AbrManager with setMediaElement function."),b.s.setMediaElement=function(){}),"function"!=typeof b.s.setCmsdManager&&(oe("AbrManager w/o setCmsdManager","Please use an AbrManager with setCmsdManager function."),b.s.setCmsdManager=function(){}),"function"!=typeof b.s.trySuggestStreams&&(oe("AbrManager w/o trySuggestStreams","Please use an AbrManager with trySuggestStreams function."),b.s.trySuggestStreams=function(){})),m=function(e){return e.za=!0,e.M}(r),v=r.K,w(A,u((function(){return R((function(t){return w(t,function(t,n,i,r){var a,o,s,u,c,d,h,p,f,g,m,v,y,b,x,S,A,k,E,I,C,M,D,P,L,N,O;return R((function(j){switch(j.g){case 1:pd(t,"load"),a=t.h,t.K=new Ou({Ve:function(){return a.playbackRate},Pc:function(){return a.defaultPlaybackRate},nh:function(e){a.playbackRate=e},ni:function(e){a.currentTime+=e}}),Td(t,a,n),"onchange"in e.screen&&t.j.D(e.screen,"change",(function(){if(t.M.getConfiguration){var e=t.M.getConfiguration();"AUTO"==e.Ec?Kd(t):"AUTO"==t.g.preferredVideoHdrLevel&&t.g.abr.enabled&&(e.Ec="AUTO",t.M.configure(e),Kd(t))}})),o=!1,s=l(t.i.variants);for(u=s.next();!u.done;u=s.next())c=u.value,(d=c.video&&c.video.dependencyStream)&&(o=dt(d));!function(e,t,n){n||t.lcevc.enabled?(cd(e),null==e.S&&(e.S=new ut(e.h,e.Gh,t.lcevc,n),e.G&&(e.G.M=e.S))):cd(e)}(t,t.g,o),t.xd=t.g.preferredTextLanguage,t.se=t.g.preferredTextRole,t.re=t.g.preferForcedSubs,sh(t.i.presentationTimeline,t.g.playRangeStart,t.g.playRangeEnd),t.s.init((function(e,n,i){t.i&&t.l&&e!=t.l.o&&zd(t,e,!0,void 0!==n&&n,void 0===i?0:i)})),t.s.setMediaElement(a),t.s.setCmsdManager(t.va),t.l=function(e){return new al(e.i,{Qc:function(){return e.F?e.F.De():0},getBandwidthEstimate:function(){return e.s.getBandwidthEstimate()},ub:function(){return e.ub()},video:e.h,Z:e.G,pc:e.I,onError:function(t){return ih(e,t)},onEvent:function(t){return e.dispatchEvent(t)},tf:function(t,n,i){var r=t.startTime;if(t=t.endTime,(n=n.type)!=rt){if(e.F){e.F.pi();var a=Us(e.G,n);!e.V()&&e.h.paused&&!e.h.seeking&&null!=a&&0<a&&e.F.De()<a&&e.F.Vf(a)}Id(e)}i=(new Map).set("start",r).set("end",t).set("contentType",n).set("isMuxed",i),e.dispatchEvent(dd("segmentappended",i))},xk:function(t,n){(n=n.rd)&&e.le&&function(e,t,n){var i=function(e,t){var n=e.g.get(t);return n||(n={ce:[],lg: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.ce;t.ce=r.filter((function(e,t){return!(e.position<=n&&t+1<r.length&&r[t+1].position<=n||e.position>=i)}))}else t.ce=[]}(e,i),e={rd:t,position:n},0<=(t=(i=i.ce).findIndex((function(e){return e.position>=n})))?i.splice(t,i[t].position==n?1:0,e):i.push(e)}(e.le,n,t)},Kh:function(t,n){var i=e.C;if(i.h.parseInbandPsshEnabled&&!i.G&&["audio","video"].includes(t)){t=new ha(De(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.l}}else i=Promise.resolve();return i},disableStream:function(t,n){return e.disableStream(t,n)}})}(t),t.l.configure(t.g.streaming),t.m=ph,t.dispatchEvent(dd("streaming")),h=i;case 2:for((f=t.l.o)||h||(h=Kd(t)?t.s.chooseVariant():null),g=[],m=l([(p=f||h).video,p.audio]),v=m.next();!v.done;v=m.next())(y=v.value)&&!y.segmentIndex&&(g.push(y.createSegmentIndex()),y.dependencyStream&&g.push(y.dependencyStream.createSegmentIndex()));if(!(0<g.length)){j.u(4);break}return w(j,Promise.all(g),4);case 4:if(!p||0!=p.disabledUntilTime){j.u(2);break}if(t.H&&t.H.onInitialVariantChosen&&t.H.onInitialVariantChosen(p),t.i.isLowLatency&&(t.g.streaming.lowLatencyMode?t.configure(t.Yf):q("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.")),t.L&&(function(e,t){e.l=t,e.l?e.i==$c?e.i=Qc:e.i==Zc&&(e.i=ed):e.i==Qc?e.i=$c:e.i==ed&&(e.i=Zc)}(t.L,t.i.isLowLatency&&t.g.streaming.lowLatencyMode),function(e,t){if(e.g&&e.g.enabled&&e.g.version==Jc&&e.j&&e.j.autoplay){var n=e.j.play();n&&n.then((function(){e.A=t})).catch((function(){e.A=0}))}}(t.L,1e3*n)),sh(t.i.presentationTimeline,t.g.playRangeStart,t.g.playRangeEnd),function(e,t,n){e.j.presentationTimeline.V()||(e.W=t,e.U=n)}(t.l,t.g.playRangeStart,t.g.playRangeEnd),t.Oa=!0,t.dispatchEvent(dd("canupdatestarttime")),b=function(e){t.F=function(e,t){return new ku(e.h,e.i,e.g.streaming,t,(function(){e.Zb&&_u(e.Zb,!0),e.l&&e.l.Yc(),e.P&&Id(e)}),(function(t){return e.dispatchEvent(t)}))}(t,e),t.Zb=function(e,t){var n=e.V()||"number"==typeof t&&0<t;(t=new cc(e.me,n)).addEventListener("enter",(function(t){rh(e,"timelineregionenter",t.region)})),t.addEventListener("exit",(function(t){rh(e,"timelineregionexit",t.region)})),t.addEventListener("skip",(function(t){var n=t.region;t.seeking||(rh(e,"timelineregionenter",n),rh(e,"timelineregionexit",n))}));var i=new cc(e.ya,n);i.addEventListener("enter",(function(t){xd(e,t.region,"metadata")})),(n=new cc(e.ab,n)).addEventListener("enter",(function(t){t=(new Map).set("detail",t.region.emsg),e.dispatchEvent(dd("emsg",t))}));var r=new Uu(e.h);return r.g.add(t),r.g.add(i),r.g.add(n),e.le&&r.g.add(e.le),r}(t,e),kd(t,a,!1)},t.g.streaming.startAtSegmentBoundary||(null==(x=t.N)&&t.i.startTime&&(x=t.i.startTime),b(x)),f){j.u(7);break}if(!t.g.streaming.startAtSegmentBoundary){j.u(8);break}return S=t.i.presentationTimeline,t.N instanceof Date&&(k=S.m||S.i,null!=(E=t.N.getTime()/1e3-k)&&(A=E)),null==A&&(A="number"==typeof t.N?t.N:t.h.currentTime),null==t.N&&t.i.startTime&&(A=t.i.startTime),I=S.Xb(),C=S.Fb(),A<I?A=I:A>C&&(A=C),w(j,function(e,t){var n,i,r,a,o;return R((function(s){return 1==s.g?(n=e.audio,i=e.video,r=function(e,t){var n,i,r;return R((function(a){return 1==a.g?e?e.segmentIndex?a.u(2):w(a,e.createSegmentIndex(),2):a.return(null):(i=(n=e.segmentIndex.Wb(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)}))}(h,A),9);case 9:M=j.h,b(M);case 8:zd(t,h,!0,!1,0);case 7:return t.F.ready(),t.Dc().find((function(e){return e.active}))||((D=er(t.i.textStreams,t.xd,t.se,t.re)[0]||null)&&Ql(t.A.h,D,!0),h&&(D?(rr(h.audio,D,t.g)&&(t.ba=!0),t.ba&&t.o.setTextVisibility(!0)):(t.ba=!1,t.o.setTextVisibility(!1)),Zd(t)),D&&(t.g.streaming.alwaysStreamText||t.Ng())&&(ul(t.l,D),th(t))),w(j,t.l.start(r),10);case 10:t.g.abr.enabled&&(t.s.enable(),eh(t)),Wd(t),Kd(t),t.i.variants.some((function(e){return e.primary})),((P=t.V())&&(t.g.streaming.liveSync&&t.g.streaming.liveSync.enabled||t.i.serviceDescription||t.g.streaming.liveSync.panicMode)||t.g.streaming.vodDynamicPlaybackRate)&&(L=function(){return Vd(t)},t.j.D(a,"timeupdate",L)),P||(N=function(){return Hd(t)},t.j.D(a,"timeupdate",N),Hd(t),t.i.nextUrl&&(0<t.g.streaming.preloadNextUrlWindow&&(O=function(){var e;return R((function(n){if(1==n.g)return e=t.Sa().end-t.h.currentTime,!isNaN(e)&&e<=t.g.streaming.preloadNextUrlWindow?(t.j.Ja(a,"timeupdate",O),w(n,t.preload(t.i.nextUrl),4)):n.u(0);t.Pa=n.h,T(n)}))},t.j.D(a,"timeupdate",O)),t.j.D(a,"ended",(function(){t.load(t.Pa||t.i.nextUrl)})))),t.B&&t.B.onManifestUpdated(P),T(j)}}))}(b,h,v,m),0)}))}),"loadInner_"),22);case 22:!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),b.ha&&te().Wi()&&ci(b.ha)&&function(t,n,i){t.g&&e.ManagedMediaSource&&t.i&&t.A.useSourceElements&&(t.B&&t.g.removeChild(t.B),t.B=$o(n,i),t.g.appendChild(t.B),t.g.disableRemotePlayback=!1)}(b.G,b.W,b.ha),A.u(14);break;case 23:return w(A,u((function(){return R((function(e){return w(e,function(e,t,n){var i,r,a,o,s,u,c,d,h,p,f,g;return R((function(m){switch(m.g){case 1:if(pd(e,"src-equals"),i=e.h,e.F=new xu(i),r=!1,e.qe.push((function(){r=!0})),e.dispatchEvent(dd("canupdatestarttime")),null!=e.N&&e.F.Vf(e.N),e.Zb=function(e,t){(t=new cc(e.ya,t instanceof Date||0<t)).addEventListener("enter",(function(t){xd(e,t.region,"metadata")}));var n=new Uu(e.h);return n.g.add(t),n}(e,e.N||0),e.K=new Ou({Ve:function(){return i.playbackRate},Pc:function(){return i.defaultPlaybackRate},nh:function(e){i.playbackRate=e},ni:function(e){i.currentTime+=e}}),kd(e,i,!0),i.textTracks&&(bd(e),a=function(t){if(!(e.o instanceof Cc)){var n=Ld(e).find((function(e){return"disabled"!==e.mode}));n&&(n.mode=t?"showing":"hidden"),e.o instanceof Dc&&(n=function(e){return Array.from(e.h.textTracks).find((function(e){return"Shaka Player TextTrack"==e.label}))}(e))&&(n.mode=!t&&e.o.isTextVisible()?"showing":"hidden")}},e.j.D(i,"enterpictureinpicture",(function(){return a(!0)})),e.j.D(i,"leavepictureinpicture",(function(){return a(!1)})),i.remote?(e.j.D(i.remote,"connect",(function(){return a(!1)})),e.j.D(i.remote,"connecting",(function(){return a(!1)})),e.j.D(i.remote,"disconnect",(function(){return a(!1)}))):"webkitCurrentPlaybackTargetIsWireless"in i&&e.j.D(i,"webkitcurrentplaybacktargetiswirelesschanged",(function(){return a(!1)})),(o=i).webkitSupportsFullscreen&&e.j.D(o,"webkitpresentationmodechanged",(function(){return a("inline"!==o.webkitPresentationMode)}))),Td(e,i,t),s=function(e,t,n){try{if(!e.g.enabled)return t;var i=Vc(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=qc;break e;case"video/webm":case"video/mp4":case"video/mpeg":case"video/mp2t":r=Wc;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,zc(t,Gc(i))}catch(e){return X("CMCD_SRC_ERROR","Could not generate src CMCD data.",e),t}}(e.L,e.W,n),!s.includes("#t=")&&(0<e.g.playRangeStart||isFinite(e.g.playRangeEnd))&&(s+="#t=",0<e.g.playRangeStart&&(s+=e.g.playRangeStart),isFinite(e.g.playRangeEnd)&&(s+=","+e.g.playRangeEnd)),!e.G){m.u(2);break}return w(m,e.G.destroy(),3);case 3:e.G=null;case 2:return Qo(i),i.src=s,"TV"==(u=te()).La()&&i.load(),"none"!=i.preload&&!i.autoplay&&ci(n)&&"WEBKIT"===u.Da()&&i.load(),e.m=fh,e.dispatchEvent(dd("streaming")),c=new Sr,pu(i,HTMLMediaElement.HAVE_METADATA,e.j,(function(){e.F.ready(),e.ha&&ci(e.ha)||c.resolve()})),d=function(){return new Promise((function(t){var n=new Ti(t);e.j.D(i.textTracks,"change",(function(){return n.ia(.5)})),n.ia(.5)}))},pu(i,HTMLMediaElement.HAVE_CURRENT_DATA,e.j,(function(){var t,n,i,a,o;return R((function(s){if(1==s.g)return w(s,d(),2);if(r)return s.return();if(function(e){var t=e.g.preferredAudioLanguage;""!=t&&e.Hi(t,e.g.preferredVariantRole)}(e),(t=Ld(e)).some((function(e){return"showing"===e.mode}))&&(e.ba=!0,e.o.setTextVisibility(!0)),!(e.o instanceof Cc))for(t.length&&(e.o.enableTextDisplayer?e.o.enableTextDisplayer():oe("Text displayer w/ enableTextDisplayer",'Text displayer should have a "enableTextDisplayer" method')),n=!1,i=l(t),a=i.next();!a.done;a=i.next())"disabled"!==(o=a.value).mode&&(n?(o.mode="disabled",q("Found more than one enabled text track, disabling it",o)):(Rd(e,o),n=!0));!function(e){var t=e.g.preferredTextLanguage;""!=t&&e.ih(t,e.g.preferredTextRole,e.g.preferForcedSubs)}(e),e.ha&&ci(e.ha)&&c.resolve(),T(s)}))})),i.error?c.reject(oh(e)):"none"==i.preload&&(q('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.'),c.resolve()),e.j.Aa(i,"error",(function(){c.reject(oh(e))})),w(m,ki(e.g.streaming.loadTimeout,c),4);case 4:((h=e.V())&&(e.g.streaming.liveSync&&e.g.streaming.liveSync.enabled||e.g.streaming.liveSync.panicMode)||e.g.streaming.vodDynamicPlaybackRate)&&(p=function(){return Vd(e)},e.j.D(i,"timeupdate",p)),h||(f=function(){return Hd(e)},e.j.D(i,"timeupdate",f),Hd(e)),e.B&&(e.B.onManifestUpdated(h),h&&(g=e.Sa().end,e.j.D(i,"progress",(function(){var t=e.Sa().end;g!=t&&(e.B.onManifestUpdated(e.V()),g=t)})))),e.Oa=!0,T(m)}}))}(b,h,i),0)}))}),"srcEqualsInner_"),14);case 14:b.dispatchEvent(dd("loaded"));case 6:if(E(A),!r){A.u(25);break}return w(A,r.destroy(),25);case 25:b.Pa=null,I(A,0);break;case 5:if(!(y=k(A))||7e3==y.code){A.u(27);break}return w(A,b.vc(!1),27);case 27:throw y}}))},i.Yk=function(e,t){e=void 0===e||e,t=void 0!==t&&t;var n,i=this;return R((function(r){return 1==r.g?w(r,gd(i),2):3!=r.g?(n=r.h,w(r,i.vc(e,t),3)):r.return(n)}))},i.Qh=function(e,t){e=void 0!==e&&e,t=void 0!==t&&t;var n,i=this;return R((function(r){return 1==r.g?w(r,gd(i,t),2):3!=r.g?(n=r.h,w(r,i.detach(e),3)):r.return(n)}))},i.preload=function(e,t,n,i){t=void 0===t?null:t;var r,a,o=this;return R((function(s){return 1==s.g?(ql(r=Ud(o),i||o.g,Ud(o)),w(s,md(o,e,t,n,!1,r),2)):((a=s.h)?a.start():ih(o,new Ne(2,7,7005)),s.return(a))}))},i.ng=function(){var e,t,n,i,r=this;return R((function(a){for(e=[],t=l(r.ye),n=t.next();!n.done;n=t.next())(i=n.value).o||e.push(i.destroy());return r.ye=[],w(a,Promise.all(e),0)}))},i.Gk=function(){for(var e=this.ka;e.g;)e.release()},i.hd=function(e){return new fa(e)},i.configure=function(e,t){if(2==arguments.length&&"string"==typeof e&&(e=Ll(e,t)),e.streaming&&"forceTransmuxTS"in e.streaming&&(oe("streaming.forceTransmuxTS configuration","Please Use mediaSource.forceTransmux instead."),e.mediaSource=e.mediaSource||{},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=e.mediaSource||{},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.");var n=te();e.streaming.preferNativeHls=e.streaming.useNativeHlsOnSafari&&"WEBKIT"===n.Da(),delete e.streaming.useNativeHlsOnSafari}if(e.streaming&&"boolean"==typeof e.streaming.liveSync&&(oe("streaming.liveSync","Please Use streaming.liveSync.enabled instead."),n=e.streaming.liveSync,e.streaming.liveSync={},e.streaming.liveSync.enabled=n),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}if(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=e.mediaSource||{},e.mediaSource.dispatchAllEmsgBoxes=e.streaming.dispatchAllEmsgBoxes,delete e.streaming.dispatchAllEmsgBoxes),e.streaming&&"autoLowLatencyMode"in e.streaming&&(oe("streaming.autoLowLatencyMode configuration","Please Use streaming.lowLatencyMode instead."),e.streaming.lowLatencyMode=e.streaming.autoLowLatencyMode,delete e.streaming.autoLowLatencyMode),e.manifest&&e.manifest.dash&&"ignoreSupplementalCodecs"in e.manifest.dash&&(oe("manifest.dash.ignoreSupplementalCodecs configuration","Please Use manifest.ignoreSupplementalCodecs instead."),e.manifest.ignoreSupplementalCodecs=e.manifest.dash.ignoreSupplementalCodecs,delete e.manifest.dash.ignoreSupplementalCodecs),e.manifest&&e.manifest.hls&&"ignoreSupplementalCodecs"in e.manifest.hls&&(oe("manifest.hls.ignoreSupplementalCodecs configuration","Please Use manifest.ignoreSupplementalCodecs instead."),e.manifest.ignoreSupplementalCodecs=e.manifest.hls.ignoreSupplementalCodecs,delete e.manifest.hls.ignoreSupplementalCodecs),e.manifest&&e.manifest.dash&&"updatePeriod"in e.manifest.dash&&(oe("manifest.dash.updatePeriod configuration","Please Use manifest.updatePeriod instead."),e.manifest.updatePeriod=e.manifest.dash.updatePeriod,delete e.manifest.dash.updatePeriod),e.manifest&&e.manifest.hls&&"updatePeriod"in e.manifest.hls&&(oe("manifest.hls.updatePeriod configuration","Please Use manifest.updatePeriod instead."),e.manifest.updatePeriod=e.manifest.hls.updatePeriod,delete e.manifest.hls.updatePeriod),e.manifest&&e.manifest.dash&&"ignoreDrmInfo"in e.manifest.dash&&(oe("manifest.dash.ignoreDrmInfo configuration","Please Use manifest.ignoreDrmInfo instead."),e.manifest.ignoreDrmInfo=e.manifest.dash.ignoreDrmInfo,delete e.manifest.dash.ignoreDrmInfo),e.drm&&e.drm.advanced){for(var a in n=!1,e.drm.advanced){var o=e.drm.advanced[a];i=o.videoRobustness,o=o.audioRobustness,"videoRobustness"in e.drm.advanced[a]&&!Array.isArray(e.drm.advanced[a].videoRobustness)&&(e.drm.advanced[a].videoRobustness=[i],n=!0),"audioRobustness"in e.drm.advanced[a]&&!Array.isArray(e.drm.advanced[a].audioRobustness)&&(e.drm.advanced[a].audioRobustness=[o],n=!0)}n&&oe("AdvancedDrmConfiguration's videoRobustness and audioRobustness","These properties are no longer strings but array of strings, please update your usage of these properties.")}return e.streaming&&"forceHTTP"in e.streaming&&(oe("streaming.forceHTTP configuration","Please Use networking.forceHTTP instead."),e.networking=e.networking||{},e.networking.forceHTTP=e.streaming.forceHTTP,delete e.streaming.forceHTTP),e.streaming&&"forceHTTPS"in e.streaming&&(oe("streaming.forceHTTPS configuration","Please Use networking.forceHTTP instead."),e.networking=e.networking||{},e.networking.forceHTTPS=e.streaming.forceHTTPS,delete e.streaming.forceHTTPS),e.streaming&&"minBytesForProgressEvents"in e.streaming&&(oe("streaming.minBytesForProgressEvents configuration","Please Use networking.minBytesForProgressEvents instead."),e.networking=e.networking||{},e.networking.minBytesForProgressEvents=e.streaming.minBytesForProgressEvents,delete e.streaming.minBytesForProgressEvents),a=ql(this.g,e,Ud(this)),Cd(this),a},i.nj=function(e){this.Yf=e},i.getConfiguration=function(){var e=Ud(this);return ql(e,this.g,Ud(this)),e},i.xj=function(){return this.Yf},i.Zh=function(){return ql(Ud(this),this.g,Ud(this)),Ol(this.g,Ud(this))},i.Vh=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.Sa().end)))return 1;if(!(e<=this.h.currentTime)&&e<t)return(e-this.h.currentTime)/(t-this.h.currentTime)}return 0},i.Ci=function(){for(var e in this.g)delete this.g[e];ql(this.g,Ud(this),Ud(this)),Cd(this)},i.Fj=function(){return this.m},i.Xh=function(){return this.i?this.i.type:null},i.Jj=function(){return this.h},i.Pb=function(){return this.I},i.nd=function(){return this.W},i.Uh=function(){return this.B?this.B:null},i.$h=function(){return this.za?this.za:null},i.V=function(){return this.i&&!this.ua()?this.i.presentationTimeline.V():!(!this.h||!this.h.src&&!this.ua())&&1/0==this.h.duration},i.Tc=function(){return!!this.i&&this.i.presentationTimeline.Tc()},i.ck=function(){if(this.i&&!this.ua()){var e=this.i.variants;return!!e.length&&!e[0].video}return!(!this.h||!this.h.src&&!this.ua())&&(this.h.videoTracks?0==this.h.videoTracks.length:0==this.h.videoHeight)},i.jk=function(){if(this.i&&!this.ua()){var e=this.i.variants;return!(!e.length||(e=e[0]).audio||!e.video||e.video.codecs.includes(","))}return!(!this.h||!this.h.src&&!this.ua()||!this.h.audioTracks)&&0==this.h.audioTracks.length},i.Sa=function(){if(this.i&&!this.ua()){if(!this.Oa&&"HLS"==this.i.type)return{start:0,end:0};var e=this.i.presentationTimeline;return{start:e.Xb(),end:e.Fb()}}if(this.h&&(this.h.src||this.ua())&&(e=this.h.seekable)&&e.length){var t=this.g?this.g.playRangeStart:0;t=Math.max(e.start(0),t);var n=this.g?this.g.playRangeEnd:1/0;return{start:t,end:e=Math.min(e.end(e.length-1),n)}}return{start:0,end:0}},i.Zj=function(){this.V()&&(this.h.currentTime=this.Sa().end)},i.dk=function(){return this.Oa},i.keySystem=function(){var e=this.drmInfo();return e?e.keySystem:""},i.drmInfo=function(){return this.C?this.C.g:null},i.Pd=function(){return this.C?this.C.Pd():1/0},i.Eg=function(){return this.C?this.C.Eg():[]},i.Te=function(){return this.C?this.C.Te():{}},i.Mg=function(){return this.P?this.P.g==Va:!!this.W},i.ub=function(){return this.h?this.K?this.K.i:1:0},i.Ch=function(e){this.m==ph&&this.l&&ol(this.l,e)},i.ke=function(e,t){t=void 0===t||t,0==e?q("A trick play rate of 0 is unsupported!"):(this.K.set(e),this.m==ph&&(this.s.playbackRateChanged(e),this.Ch(t&&1!=e)),Bd(this,e))},i.Id=function(){var e=this.K.Pc();this.m==fh&&this.K.set(e),this.m==ph&&(this.K.set(e),this.s.playbackRateChanged(e),this.Ch(!1)),this.bc.Ra()},i.Qb=function(){if(this.i&&!this.ua()){for(var e=this.l?this.l.o:null,t=[],n=0,i=l(this.i.variants),r=i.next();!r.done;r=i.next())if(Qi(r=r.value)){var a=qi(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}if(this.h&&this.h.audioTracks){var o=Xd(this);return(e=Array.from(this.h.audioTracks)).length?e.map((function(e){return $i(e,o)})):o?[$i(null,o)]:[]}return[]},i.Dc=function(){if(this.i){if(this.ua())return[];for(var e=this.l?this.l.A:null,t=[],n=l(this.i.textStreams),i=n.next();!i.done;i=n.next()){var r=Xi(i=i.value);r.active=i==e,t.push(r)}return t}return this.h&&this.h.src&&this.h.textTracks?Ld(this).map((function(e){return Ji(e)})):[]},i.Cj=function(){var e=this.Ae;return this.i&&(e=this.i.imageStreams),e.map((function(e){return Wi(e)}))},i.qj=function(e){var t,n,i=this;return R((function(r){return 1==r.g?w(r,Dd(i,e),2):(t=r.h)?(n=[],t.segmentIndex.Eb((function(e){var i=Md(e.tilesLayout||t.tilesLayout);if(i)for(var r=i.rows*i.Lc,a=e.j-e.startTime,o=0;o<r;o++){var s=Pd(e,t,e.startTime+a*o/r,i);n.push(s)}})),t.closeSegmentIndex&&t.closeSegmentIndex(),r.return(n)):r.return(null)}))},i.Tj=function(e,t){var n,i,r,a,o=this;return R((function(s){return 1==s.g?w(s,Dd(o,e),2):(n=s.h)?null==(i=n.segmentIndex.find(t))?s.return(null):(r=n.segmentIndex.get(i),(a=Md(r.tilesLayout||n.tilesLayout))?s.return(Pd(r,n,t,a)):s.return(null)):s.return(null)}))},i.jh=function(e){var t,n=this;this.i&&this.F&&((t=n.i.textStreams.find((function(t){return t.id==e.id})))&&t!=n.l.A&&(Ql(n.A.h,t,!1),ul(n.l,t),Qd(n),th(n),n.xd=t.language),!this.ua())||function(){if(n.h&&n.h.textTracks){var t=Ld(n),i=t.find((function(t){return Yi(t)===e.id}));if(i){if(n.o instanceof Cc)for(var r=(t=l(t)).next();!r.done;r=t.next()){var a=(r=r.value)===i?n.ba?"showing":"hidden":"disabled";r.mode!==a&&(r.mode=a)}else(t=t.find((function(e){return"disabled"!==e.mode})))!==i&&(t&&(t.mode="disabled",n.j.Ja(t,"cuechange"),n.o.remove(0,1/0)),i&&Rd(n,i));Qd(n),th(n)}}}()},i.Ef=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&&Qi(r)){var a=i.l.o;i.g.abr.enabled&&(a.video!=r.video||a.audio&&r.audio&&a.audio.language==r.audio.language&&a.audio.channelsCount==r.audio.channelsCount&&a.audio.label==r.audio.label)&&q("Changing tracks while abr manager is enabled will likely result in the selected track being overridden. Consider disabling abr before calling selectVariantTrack()."),i.ua()?zd(i,r,!1,!1,0):zd(i,r,!1,t||!1,n||0),i.M.configure({language:r.language,role:r.audio&&r.audio.roles&&r.audio.roles[0]||"",channelCount:r.audio&&r.audio.channelsCount?r.audio.channelsCount:0,Ec:r.video&&r.video.hdr?r.video.hdr:"",spatialAudio:!(!r.audio||!r.audio.spatialAudio)&&r.audio.spatialAudio,videoLayout:r.video&&r.video.videoLayout?r.video.videoLayout:"",Jc:r.audio&&r.audio.label?r.audio.label:"",Ed:"",codecSwitchingStrategy:i.g.mediaSource.codecSwitchingStrategy,audioCodec:r.audio&&r.audio.codecs?r.audio.codecs:"",Gd:a.audio&&a.audio.codecs?a.audio.codecs:"",Fe:a.audio&&a.audio.channelsCount?a.audio.channelsCount:0,preferredAudioCodecs:i.g.preferredAudioCodecs,preferredAudioChannelCount:i.g.preferredAudioChannelCount}),Kd(i)}}(),!this.ua())||function(){if(e.originalAudioId&&i.h&&i.h.audioTracks)for(var t=Array.from(i.h.audioTracks),n=(t=l(t)).next();!n.done;n=t.next())if(Yi(n=n.value)==e.id){qd(i,n);break}}()},i.Ok=function(e,t){var n,i=this;t=void 0===t?0:t,this.i&&this.F&&((n=i.M.getConfiguration()).audioCodec=e.codecs||"",n.Jc=e.label||"",n.channelCount=e.channelsCount||0,n.language=e.language,n.role=e.roles[0]||"",n.spatialAudio=e.spatialAudio,i.M.configure(n),Gd(i,!0,t,!1,!1),!this.ua())||function(){if(i.h&&i.h.audioTracks){for(var t=Di(e.language),n=Array.from(i.h.audioTracks),r=null,a=(n=l(n)).next();!a.done;a=n.next()){var o=(a=a.value).language||"und";if(a.label==e.label&&Di(o)==t&&a.kind==e.roles[0]){r=a;break}}r&&qd(i,r)}}()},i.getAudioTracks=function(){if(this.i&&!this.ua()){var e=this.Qb();if(!e.length)return[];var t=e.find((function(e){return e.active}));if(!t)return[];var n=e;if(this.m!=ph||this.ua()||(n=e.filter((function(e){return e.originalVideoId===t.originalVideoId&&e.audioCodec}))),!n.length)return[];e=new Map;for(var i=(n=l(n)).next();!i.done;i=n.next()){var r=(i=i.value).originalAudioId;r||null==i.audioId||(r=String(i.audioId)),r&&e.set(r,{active:i.active,language:i.language,label:i.label,mimeType:i.audioMimeType,codecs:i.audioCodec,primary:i.primary,roles:i.audioRoles||[],accessibilityPurpose:i.accessibilityPurpose,channelsCount:i.channelsCount,audioSamplingRate:i.audioSamplingRate,spatialAudio:i.spatialAudio,originalLanguage:i.originalLanguage})}return Array.from(e.values())}return this.h&&this.h.audioTracks?Array.from(this.h.audioTracks).map((function(e){var t=e.language;return t={active:e.enabled,language:Di(t||"und"),label:e.label,mimeType:null,codecs:null,primary:"main"==e.kind,roles:[],accessibilityPurpose:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,originalLanguage:t},e.kind&&t.roles.push(e.kind),e.configuration&&(e.configuration.codec&&(t.codecs=e.configuration.codec),e.configuration.sampleRate&&(t.audioSamplingRate=e.configuration.sampleRate),e.configuration.numberOfChannels&&(t.channelsCount=e.configuration.numberOfChannels)),t})):[]},i.Qk=function(e,t,n){t=void 0!==t&&t,n=void 0===n?0:n;var i=this.Qb();if(i.length){var r=i.find((function(e){return e.active}));r&&(i=i.find((function(t){return t.audioId===r.audioId&&(t.videoBandwidth||t.bandwidth)==e.bandwidth&&t.width==e.width&&t.height==e.height&&t.frameRate==e.frameRate&&t.pixelAspectRatio==e.pixelAspectRatio&&t.hdr==e.hdr&&t.colorGamut==e.colorGamut&&t.videoLayout==e.videoLayout&&t.videoMimeType==e.mimeType&&t.videoCodec==e.codecs})))&&!i.active&&this.Ef(i,t,n)}},i.getVideoTracks=function(){if(this.m==fh||this.ua())return[];var e=this.Qb();if(!e.length)return[];var t=e.find((function(e){return e.active}));if(!t)return[];var n=e.filter((function(e){return e.originalAudioId===t.originalAudioId&&e.audioId===t.audioId&&e.audioGroupId===t.audioGroupId&&e.videoCodec}));if(!n.length)return[];e=new Map;for(var i=(n=l(n)).next();!i.done;i=n.next()){var r=(i=i.value).originalVideoId;r||null==i.videoId||(r=String(i.videoId)),r&&e.set(r,{active:i.active,bandwidth:i.videoBandwidth||i.bandwidth,width:i.width,height:i.height,frameRate:i.frameRate,pixelAspectRatio:i.pixelAspectRatio,hdr:i.hdr,colorGamut:i.colorGamut,videoLayout:i.videoLayout,mimeType:i.videoMimeType,codecs:i.videoCodec})}return Array.from(e.values())},i.sj=function(){return ch(this.Qb())},i.Rj=function(){return ch(this.Dc())},i.rj=function(){return Array.from(lh(this.Qb()))},i.Qj=function(){return Array.from(lh(this.Dc()))},i.Hi=function(e,t,n,i,r,a,o){var s=this;n=void 0===n?0:n,i=void 0===i?0:i,r=void 0===r?"":r,a=void 0!==a&&a,o=void 0===o?"":o,this.i&&this.F&&(function(){function u(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}var c=s.l.o;s.M=s.g.adaptationSetCriteriaFactory(),s.M.configure({language:e,role:t||"",channelCount:n||0,Ec:"",spatialAudio:a||!1,videoLayout:"",Jc:o||"",Ed:"",codecSwitchingStrategy:s.g.mediaSource.codecSwitchingStrategy,audioCodec:r||"",Gd:c.audio&&c.audio.codecs?c.audio.codecs:"",Fe:c.audio&&c.audio.channelsCount?c.audio.channelsCount:0,preferredAudioCodecs:s.g.preferredAudioCodecs,preferredAudioChannelCount:s.g.preferredAudioChannelCount});for(var d=s.M.create(s.i.variants),h=null,p=(d=l(d.values())).next();!p.done;p=d.next())Qi(p=p.value)&&(!h||u(h,c)>u(p,c))&&(h=p);h!=c&&(h?(c=qi(h),s.Ef(c,!0,i||0)):Gd(s))}(),!this.ua())||function(){if(s.h&&s.h.audioTracks){var n=er(s.Qb(),e,t||"",!1)[0];n&&s.Ef(n)}}()},i.ih=function(e,t,n){var i,r=this;n=void 0!==n&&n,this.i&&this.F&&(function(){r.xd=e,r.se=t||"",r.re=n||!1;var i=er(r.i.textStreams,r.xd,r.se,r.re)[0]||null;i&&i!=r.l.A&&(Ql(r.A.h,i,!1),r.g.streaming.alwaysStreamText||r.Ng())&&(ul(r.l,i),Qd(r),th(r))}(),!this.ua())||(i=er(r.Dc(),e,t||"",n||!1)[0])&&r.jh(i)},i.Pk=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.M=i.g.adaptationSetCriteriaFactory(),i.M.configure({language:r.language,role:"",channelCount:0,Ec:"",spatialAudio:!1,videoLayout:"",Ed:"",Jc:e,codecSwitchingStrategy:i.g.mediaSource.codecSwitchingStrategy,audioCodec:"",Gd:"",Fe:0,preferredAudioCodecs:i.g.preferredAudioCodecs,preferredAudioChannelCount:i.g.preferredAudioChannelCount}),Gd(i,t,n))}(),!this.ua())||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&&qd(i,n)}}()},i.Ng=function(){var e=this.ba;return this.o?this.o.isTextVisible():e},i.wj=function(){return this.eb.map((function(e){return Xi(e)}))},i.uj=function(e){if(oe("getChapters","Please use an getChaptersAsync."),!this.eb.length)return[];var t=Di(e);if(!(e=this.eb.filter((function(e){return Di(e.language)==t}))).length)return[];for(var n=[],i=new Set,r=(e=l(e)).next();!r.done;r=e.next())(r=r.value).segmentIndex&&r.segmentIndex.Eb((function(e){var t=e.O()[0],r=e.startTime+"-"+e.endTime+"-"+t;e={id:r,title:t,startTime:e.startTime,endTime:e.endTime},i.has(r)||(n.push(e),i.add(r))}));return n},i.vj=function(e){var t,n,i,r,a,o,s,u=this;return R((function(c){switch(c.g){case 1:if(!u.eb.length)return c.return([]);if(t=Di(e),!(n=u.eb.filter((function(e){return Di(e.language)==t}))).length)return c.return([]);i=[],r=new Set,a=l(n),o=a.next();case 2:if(o.done){c.u(4);break}if((s=o.value).segmentIndex){c.u(5);break}return w(c,s.createSegmentIndex(),5);case 5:s.segmentIndex.Eb((function(e){var t=e.O()[0],n=e.startTime+"-"+e.endTime+"-"+t;e={id:n,title:t,startTime:e.startTime,endTime:e.endTime},r.has(n)||(i.push(e),r.add(n))})),o=a.next(),c.u(2);break;case 4:return c.return(i)}}))},i.oh=function(e){e=!!e,this.ba!=e&&(this.ba=e,this.m==ph?(this.o.setTextVisibility(e),this.g.streaming.alwaysStreamText||(e?this.l.A||0<(e=er(this.i.textStreams,this.xd,this.se,this.re)).length&&(ul(this.l,e[0]),Qd(this),th(this)):function(e){var t=e.h.get(rt);t&&(Al(t),kl(t).catch((function(){})),e.F=e.h.get(rt),e.h.delete(rt),t.stream&&t.stream.closeSegmentIndex&&t.stream.closeSegmentIndex()),e.A=null}(this.l))):this.h&&this.h.src&&this.h.textTracks&&this.o.setTextVisibility(e),Zd(this))},i.Kj=function(){if(this.F)var e=this.F.De();else{if(null==this.N)return new Date;if(this.N instanceof Date)return this.N;e=this.N}if(this.i&&!this.ua()){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.Gg=function(){if(this.i&&!this.ua()){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.We=function(){return this.V()&&this.i?this.i.presentationTimeline.We():null},i.Nb=function(){if(this.m==ph)return this.G.Nb();var e={total:[],audio:[],video:[],text:[]};return this.m==fh&&(e.total=Yo(this.h.buffered)),e},i.Ue=function(){if(!this.h||!this.h.currentTime)return null;var e=this.Gg().getTime()+1e3*this.h.currentTime;return Math.floor(Date.now()-e)},i.getStats=function(){if(this.m!=ph&&this.m!=fh)return{width:NaN,height:NaN,currentCodecs:"",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:[]};Fd(this);var e=this.h,t=e.currentTime/e.duration;if(isNaN(t)||this.V()||function(e,t){e.i=isNaN(e.i)?t:Math.max(e.i,t)}(this.A,Math.round(100*t)),this.F&&(this.A.S=this.F.Dh(),this.A.U=this.F.Eh()),e.getVideoPlaybackQuality&&(t=e.getVideoPlaybackQuality(),function(e,t,n){e.P=t,e.N=n}(this.A,Number(t.droppedVideoFrames),Number(t.totalVideoFrames)),this.A.M=Number(t.corruptedVideoFrames)),this.A.o=this.C?function(e){return e.I?e.I:NaN}(this.C):NaN,ec(this.A,e.videoWidth||NaN,e.videoHeight||NaN),this.A.l="",this.V()&&null!=this.Gg()&&(e=this.Ue()||0,this.A.C=e/1e3),t=this.Qb().find((function(e){return e.active})),e=this.Dc().find((function(e){return e.active})),t){if(t.bandwidth){var n=this.K?this.K.i:1,i=n*t.bandwidth;e&&e.bandwidth&&(i+=n*e.bandwidth),this.A.A=i}t.width&&t.height&&ec(this.A,t.width||NaN,t.height||NaN),t=t.codecs,e&&(t+=","+(e.codecs||e.mimeType)),t&&(this.A.l=t)}return this.m!=ph||this.ua()||(this.i&&(this.A.H=this.i.periodCount,this.A.G=this.i.gapCount,this.i.presentationTimeline&&(this.A.K=this.i.presentationTimeline.h)),e=this.s.getBandwidthEstimate(),this.A.s=e),this.m==fh&&tc(this.A,NaN),function(e){for(var t=e.W,n=e.B,i=e.l,r=e.A,a=e.N,o=e.P,s=e.M,u=e.U,c=e.S,d=e.s,h=e.i,p=e.F,f=e.I,g=e.m,m=Jl(e.g,"playing"),v=Jl(e.g,"paused"),y=Jl(e.g,"buffering"),b=e.o,w=e.C,T=e.K,x=e.gi,S=e.j,A=e.L,k=e.H,E=e.G,I=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}(e.g),C=[],M=(e=l(e.h.g)).next();!M.done;M=e.next())M=M.value,C.push({timestamp:M.timestamp,id:M.id,type:M.type,fromAdaptation:M.fromAdaptation,bandwidth:M.bandwidth});return{width:t,height:n,currentCodecs:i,streamBandwidth:r,decodedFrames:a,droppedFrames:o,corruptedFrames:s,stallsDetected:u,gapsJumped:c,estimatedBandwidth:d,completionPercent:h,loadLatency:p,manifestTimeSeconds:f,drmTimeSeconds:g,playTime:m,pauseTime:v,bufferingTime:y,licenseTime:b,liveLatency:w,maxSegmentDuration:T,manifestSizeBytes:x,bytesDownloaded:S,nonFatalErrorCount:A,manifestPeriodCount:k,manifestGapCount:E,stateHistory:I,switchHistory:C}}(this.A)},i.Hd=function(e,t,n,i,r,a,o){o=void 0!==o&&o;var s,u,l,c,d,h,p,f,g,m,v=this;return R((function(y){switch(y.g){case 1:if(v.m!=ph&&v.m!=fh)throw new Ne(1,7,7004);if("subtitles"!=n&&"captions"!=n&&q("Using a kind value different of `subtitles` or `captions` can cause unwanted issues."),i){y.u(2);break}return w(y,Nd(v,e),3);case 3:i=y.h;case 2:if(s=[],v.B&&(s=v.B.getCuePoints()),v.m!=fh){y.u(4);break}return u=te(),o&&"WEBKIT"===u.Da()&&(n="forced"),w(y,function(e,t,n,i,r,a,o){var s,u,l,c;return R((function(d){if(1==d.g)return"text/vtt"!=r||o.length?w(d,Od(e,t,e.I,e.g.streaming.retryParameters),3):d.u(2);2!=d.g&&(s=d.h,u=jd(e,s,r,o),l=new Blob([u],{type:"text/vtt"}),t=nu(l),r="text/vtt"),c=document.createElement("track");var h=e.L,p=t;try{if(h.g.enabled){var f=Vc(h);f.ot="c",f.su=!0;var g=zc(p,Gc(f))}else g=p}catch(e){X("CMCD_TEXT_TRACK_ERROR","Could not generate text track CMCD data.",e),g=p}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),e.Xf.push(c),d.return(c)}))}(v,e,t,n,i,a||"",s),5);case 5:if((l=y.h).track)return Wd(v),y.return(Ji(l.track));throw new Ne(1,2,2012);case 4:if(c=at,d=v.Sa(),h=d.end-d.start,v.i&&(h=v.i.presentationTimeline.getDuration()),1/0==h)throw new Ne(1,4,4033);if(!s.length){y.u(6);break}return w(y,Od(v,e,v.I,v.g.streaming.retryParameters),7);case 7:p=y.h,f=jd(v,p,i,s),g=new Blob([f],{type:"text/vtt"}),e=nu(g),i="text/vtt";case 6:if(m={id:v.ve++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:Ru(0,h,[e]),mimeType:i||"",codecs:r||"",kind:n,encrypted:!1,drmInfos:[],keyIds:new Set,language:t,originalLanguage:t,label:a||null,type:c.Ta,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!!o,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([ni(i||"",r||"")]),isAudioMuxedInVideo:!1,baseOriginalId:null},!mi(ni(m.mimeType,m.codecs)))throw new Ne(2,2,2014,i);return v.i.textStreams.push(m),Wd(v),y.return(Xi(m))}}))},i.He=function(e,t){var n,i,r,a,o,s,u,c,d,h,p,f,g,m,v,y,b,T,x=this;return R((function(S){switch(S.g){case 1:if(x.m!=ph&&x.m!=fh)throw new Ne(1,7,7004);if(t){S.u(2);break}return w(S,Nd(x,e),3);case 3:t=S.h;case 2:if("text/vtt"!=t)throw new Ne(1,2,2017,e);if(n=at,i=x.Sa(),r=i.end-i.start,x.i&&(r=x.i.presentationTimeline.getDuration()),1/0==r)throw new Ne(1,4,4045);return w(S,Od(x,e,x.I,x.g.streaming.retryParameters),4);case 4:if(a=S.h,!(o=gi(t)))throw new Ne(2,2,2014,t);for(s=o(),u={periodStart:0,segmentStart:0,segmentEnd:r,vttOffset:0},c=De(a),d=s.parseMedia(c,u,e,[]),h=[],p=l(d),f=p.next(),g={};!f.done;g={Qf:void 0,jd:void 0},f=p.next())g.jd=f.value,g.Qf=null,m=function(t){return function(){return null==t.Qf&&(t.Qf=Qe([e],[t.jd.payload])),t.Qf||[]}}(g),v=new Vo(g.jd.startTime,g.jd.endTime,m,0,null,null,0,0,1/0),g.jd.payload.includes("#xywh")&&4===(y=g.jd.payload.split("#xywh=")[1].split(",")).length&&v.Hf({height:parseInt(y[3],10),positionX:parseInt(y[0],10),positionY:parseInt(y[1],10),width:parseInt(y[2],10)}),h.push(v);if(b=t,!h.length){S.u(5);break}return w(S,gc(h[0].O()[0],x.I,x.g.manifest.retryParameters),6);case 6:b=S.h;case 5:return T={id:x.ve++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new Du(h),mimeType:b||"",codecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:n.Tf,primary:!1,trickModeVideo:null,dependencyStream: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([ni(b||"","")]),isAudioMuxedInVideo:!1,baseOriginalId:null},x.m==fh?x.Ae.push(T):x.i.imageStreams.push(T),Wd(x),S.return(Wi(T))}}))},i.Ge=function(e,t,n){var i,r,a,o,s,u,c,d,h,p,f,g,m,v,y,b=this;return R((function(T){switch(T.g){case 1:if(b.m!=ph&&b.m!=fh)throw new Ne(1,7,7004);if(n){T.u(2);break}return w(T,Nd(b,e),3);case 3:n=T.h;case 2:if(i=at,r=b.Sa(),a=r.end-r.start,b.i&&(a=b.i.presentationTimeline.getDuration()),1/0==a)throw new Ne(1,4,4054);return w(T,Od(b,e,b.I,b.g.streaming.retryParameters),4);case 4:if(o=T.h,!(s=gi(n)))throw new Ne(2,2,2014,n);for(u=s(),c={periodStart:0,segmentStart:0,segmentEnd:a,vttOffset:0},d=De(o),h=u.parseMedia(d,c,e,[]),p=[],f=l(h),g=f.next(),m={};!g.done;m={Qe:void 0},g=f.next())m.Qe=g.value,v=new Vo(m.Qe.startTime,m.Qe.endTime,function(e){return function(){return[e.Qe.payload]}}(m),0,null,null,0,0,1/0),p.push(v);return y={id:b.ve++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new Du(p),mimeType:"text/plain",codecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:t,originalLanguage:t,label:null,type:i.Ta,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([ni("text/plain","")]),isAudioMuxedInVideo:!1,baseOriginalId:null},b.eb.push(y),Wd(b),T.return(Xi(y))}}))},i.Vk=function(e,t){this.wa.width=e,this.wa.height=t},i.eh=function(e){if(this.m==ph){var t=this.l;if(e=void 0===e?.1:e,t.l.g)t=!1;else if(t.B)t=!1;else{for(var n=l(t.h.values()),i=n.next();!i.done;i=n.next())!(i=i.value).Sd||i.Qa||i.zb||(i.Sd=!1,Sl(t,i,e));t=!0}}else t=!1;return t},i.Fg=function(){return q("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.Gj=function(){return this.qc},i.Aj=function(){var e={video:null,audio:null,text:null};if(this.m!=ph)return e;for(var t=this.l.o,n=this.h.currentTime,i=(t=l([t.video,t.audio,this.l.A])).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==rt&&(e.text=r)}return e},i.Oi=function(e){this.we=e},i.disableStream=function(e,t){if(!this.g.abr.enabled||this.m===dh||!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.xe.Fa(1),t=this.Nb().video.reduce((function(e,t){return e+t.end-t.start}),0),Gd(this,!1,t,!0,!1),0))}return!1},i.addFont=function(t,n){return function(t,n){var i,r,a,o,s;return R((function(u){if(1==u.g)return"fonts"in document&&"FontFace"in e?w(u,document.fonts.ready,2):u.return();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)}))}(t,n)},i.ua=function(){return!(!this.h||!this.h.remote)&&"disconnected"!=this.h.remote.state},i.Wd=function(){return!(this.h&&!this.h.ended)||this.Oa&&!this.V()&&this.h.currentTime>=this.Sa().end},F("shaka.Player",ld),ld.prototype.isEnded=ld.prototype.Wd,ld.prototype.isRemotePlayback=ld.prototype.ua,ld.prototype.addFont=ld.prototype.addFont,ld.prototype.setVideoContainer=ld.prototype.Oi,ld.prototype.getFetchedPlaybackInfo=ld.prototype.Aj,ld.prototype.getManifestParserFactory=ld.prototype.Gj,ld.prototype.getManifest=ld.prototype.Fg,ld.prototype.retryStreaming=ld.prototype.eh,ld.prototype.setMaxHardwareResolution=ld.prototype.Vk,ld.prototype.addChaptersTrack=ld.prototype.Ge,ld.prototype.addThumbnailsTrack=ld.prototype.He,ld.prototype.addTextTrackAsync=ld.prototype.Hd,ld.prototype.getStats=ld.prototype.getStats,ld.prototype.getBufferedInfo=ld.prototype.Nb,ld.prototype.getSegmentAvailabilityDuration=ld.prototype.We,ld.prototype.getPresentationStartTimeAsDate=ld.prototype.Gg,ld.prototype.getPlayheadTimeAsDate=ld.prototype.Kj,ld.prototype.setTextTrackVisibility=ld.prototype.oh,ld.prototype.getChaptersAsync=ld.prototype.vj,ld.prototype.getChapters=ld.prototype.uj,ld.prototype.getChaptersTracks=ld.prototype.wj,ld.prototype.isTextTrackVisible=ld.prototype.Ng,ld.prototype.selectVariantsByLabel=ld.prototype.Pk,ld.prototype.selectTextLanguage=ld.prototype.ih,ld.prototype.selectAudioLanguage=ld.prototype.Hi,ld.prototype.getTextLanguages=ld.prototype.Qj,ld.prototype.getAudioLanguages=ld.prototype.rj,ld.prototype.getTextLanguagesAndRoles=ld.prototype.Rj,ld.prototype.getAudioLanguagesAndRoles=ld.prototype.sj,ld.prototype.getVideoTracks=ld.prototype.getVideoTracks,ld.prototype.selectVideoTrack=ld.prototype.Qk,ld.prototype.getAudioTracks=ld.prototype.getAudioTracks,ld.prototype.selectAudioTrack=ld.prototype.Ok,ld.prototype.selectVariantTrack=ld.prototype.Ef,ld.prototype.selectTextTrack=ld.prototype.jh,ld.prototype.getThumbnails=ld.prototype.Tj,ld.prototype.getAllThumbnails=ld.prototype.qj,ld.prototype.getImageTracks=ld.prototype.Cj,ld.prototype.getTextTracks=ld.prototype.Dc,ld.prototype.getVariantTracks=ld.prototype.Qb,ld.prototype.cancelTrickPlay=ld.prototype.Id,ld.prototype.trickPlay=ld.prototype.ke,ld.prototype.useTrickPlayTrackIfAvailable=ld.prototype.Ch,ld.prototype.getPlaybackRate=ld.prototype.ub,ld.prototype.isBuffering=ld.prototype.Mg,ld.prototype.getKeyStatuses=ld.prototype.Te,ld.prototype.getActiveSessionsMetadata=ld.prototype.Eg,ld.prototype.getExpiration=ld.prototype.Pd,ld.prototype.drmInfo=ld.prototype.drmInfo,ld.prototype.keySystem=ld.prototype.keySystem,ld.prototype.isFullyLoaded=ld.prototype.dk,ld.prototype.goToLive=ld.prototype.Zj,ld.prototype.seekRange=ld.prototype.Sa,ld.prototype.isVideoOnly=ld.prototype.jk,ld.prototype.isAudioOnly=ld.prototype.ck,ld.prototype.isInProgress=ld.prototype.Tc,ld.prototype.isLive=ld.prototype.V,ld.prototype.getQueueManager=ld.prototype.$h,ld.prototype.getAdManager=ld.prototype.Uh,ld.prototype.getAssetUri=ld.prototype.nd,ld.prototype.getNetworkingEngine=ld.prototype.Pb,ld.prototype.getMediaElement=ld.prototype.Jj,ld.prototype.getManifestType=ld.prototype.Xh,ld.prototype.getLoadMode=ld.prototype.Fj,ld.prototype.resetConfiguration=ld.prototype.Ci,ld.prototype.getBufferFullness=ld.prototype.Vh,ld.prototype.getNonDefaultConfiguration=ld.prototype.Zh,ld.prototype.getConfigurationForLowLatency=ld.prototype.xj,ld.prototype.getConfiguration=ld.prototype.getConfiguration,ld.prototype.configurationForLowLatency=ld.prototype.nj,ld.prototype.configure=ld.prototype.configure,ld.prototype.releaseAllMutexes=ld.prototype.Gk,ld.prototype.destroyAllPreloads=ld.prototype.ng,ld.prototype.preload=ld.prototype.preload,ld.prototype.detachAndSavePreload=ld.prototype.Qh,ld.prototype.unloadAndSavePreload=ld.prototype.Yk,ld.prototype.load=ld.prototype.load,ld.prototype.updateStartTime=ld.prototype.cl,ld.prototype.unload=ld.prototype.vc,ld.prototype.detach=ld.prototype.detach,ld.prototype.attachCanvas=ld.prototype.fj,ld.prototype.attach=ld.prototype.fc,ld.probeSupport=function(t){var n,i,r,a,o;return t=void 0===t||t,R((function(s){switch(s.g){case 1:if(n={},!t){s.u(2);break}return w(s,function(){var t,n,i,r,a,o,s,u,c,d,h,p,f,g,m,v,y,b,S,E,I,C,M,D,P,L,N,O,j,U,_,B,F,V;return R((function(H){if(1==H.g){if(t="org.w3.clearkey com.widevine.alpha com.widevine.alpha.experiment com.microsoft.playready com.microsoft.playready.hardware com.microsoft.playready.recommendation com.microsoft.playready.recommendation.3000 com.microsoft.playready.recommendation.3000.clearlead com.chromecast.playready com.apple.fps.1_0 com.apple.fps com.huawei.wiseplay".split(" "),!(e.MediaKeys&&e.navigator&&e.navigator.requestMediaKeySystemAccess&&e.MediaKeySystemAccess&&e.MediaKeySystemAccess.prototype.getConfiguration)){for(n={},i=l(t),r=i.next();!r.done;r=i.next())a=r.value,n[a]=null;return H.return(n)}for(o="1.0 1.1 1.2 1.3 1.4 2.0 2.1 2.2 2.3".split(" "),u={"com.widevine.alpha":s=["SW_SECURE_CRYPTO","SW_SECURE_DECODE","HW_SECURE_CRYPTO","HW_SECURE_DECODE","HW_SECURE_ALL"],"com.widevine.alpha.experiment":s,"com.microsoft.playready.recommendation":["150","2000","3000"]},h={videoCapabilities:c=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],audioCapabilities:d=[{contentType:'audio/mp4; codecs="mp4a.40.2"'},{contentType:'audio/webm; codecs="opus"'}],initDataTypes:["cenc","sinf","skd","keyids"]},p=[null,"cenc","cbcs"],f=new Map,g=te(),m=function(e,t){var n,i,r,a,s,u,c,d,h,p,m,v,y;return R((function(b){switch(b.g){case 1:return x(b,2),w(b,t.createMediaKeys(),5);case 5:n=b.h;case 4:A(b,3);break;case 2:return k(b),b.return();case 3:if(r=!!(i=t.getConfiguration().sessionTypes)&&i.includes("persistent-license"),g.mi()&&(r=!1),a=t.getConfiguration().videoCapabilities,s=t.getConfiguration().audioCapabilities,u={persistentState:r,encryptionSchemes:[],videoRobustnessLevels:[],audioRobustnessLevels:[],minHdcpVersions:[]},f.has(e)&&f.get(e)?u=f.get(e):f.set(e,u),(c=a[0].encryptionScheme)&&!u.encryptionSchemes.includes(c)&&u.encryptionSchemes.push(c),(d=a[0].robustness)&&!u.videoRobustnessLevels.includes(d)&&u.videoRobustnessLevels.push(d),(h=s[0].robustness)&&!u.audioRobustnessLevels.includes(h)&&u.audioRobustnessLevels.push(h),"getStatusForPolicy"in n){for(p=[],m=l(o),v=m.next(),y={};!v.done;y={Td:void 0},v=m.next())y.Td=v.value,u.minHdcpVersions.includes(y.Td)||p.push(n.getStatusForPolicy({minHdcpVersion:y.Td}).then(function(e){return function(t){"usable"!=t||u.minHdcpVersions.includes(e.Td)||u.minHdcpVersions.push(e.Td)}}(y)));return w(b,Promise.all(p),0)}b.u(0)}}))},v=function(e,t,n,i){var r,a,o,s,u,c,d,p,f,g;return R((function(v){switch(v.g){case 1:for(x(v,2),r=Bt(h),a=l(r.videoCapabilities),o=a.next();!o.done;o=a.next())(s=o.value).encryptionScheme=t,s.robustness=n;for(u=l(r.audioCapabilities),c=u.next();!c.done;c=u.next())(d=c.value).encryptionScheme=t,d.robustness=i;return(p=Bt(r)).persistentState="required",p.sessionTypes=["persistent-license"],f=[p,r],"MOBILE"==te().La()?w(v,ki(5,navigator.requestMediaKeySystemAccess(e,f)),7):w(v,navigator.requestMediaKeySystemAccess(e,f),6);case 6:g=v.h,v.u(5);break;case 7:g=v.h;case 5:return w(v,m(e,g),8);case 8:A(v,0);break;case 2:k(v),T(v)}}))},y=function(e,t,n,i){var r,a,o;return R((function(s){switch(s.g){case 1:return x(s,2),r={type:"media-source",video:{contentType:c[0].contentType,width:640,height:480,bitrate:1,framerate:1},audio:{contentType:d[0].contentType,channels:2,bitrate:1,samplerate:1},keySystemConfiguration:{keySystem:e,video:{encryptionScheme:t,robustness:n},audio:{encryptionScheme:t,robustness:i}}},"MOBILE"==te().La()?w(s,ki(5,navigator.mediaCapabilities.decodingInfo(r)),7):w(s,navigator.mediaCapabilities.decodingInfo(r),6);case 6:a=s.h,s.u(5);break;case 7:a=s.h;case 5:return o=a.keySystemAccess,w(s,m(e,o),8);case 8:A(s,0);break;case 2:k(s),T(s)}}))},b=l(t),S=b.next();!S.done;S=b.next())E=S.value,f.set(E,null);for(I=function(e){return"WEBKIT"!==te().Da()||"org.w3.clearkey"!==e},C=[],M=l(p),D=M.next();!D.done;D=M.next())for(P=D.value,L=l(t),N=L.next();!N.done;N=L.next())O=N.value,I(O)&&(C.push(v(O,P,"","")),C.push(y(O,P,"","")));for(j=l(t),U=j.next();!U.done;U=j.next())for(_=U.value,B=l(u[_]||[]),F=B.next();!F.done;F=B.next())V=F.value,I(_)&&(C.push(v(_,null,V,"")),C.push(v(_,null,"",V)),C.push(y(_,null,V,"")),C.push(y(_,null,"",V)));return w(H,Promise.all(C),2)}return H.return($r(f))}))}(),3);case 3:n=s.h;case 2:return i=function(){var e={};if(te(),ev())for(var t=l(Za.keys()),n=t.next();!n.done;n=t.next())e[n.value]=!0;for(n=(t=l(["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"])).next();!n.done;n=t.next())e[n=n.value]=ev()?Za.has(n):""!=es().canPlayType(n);return e}(),r=function(){var e='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",audio/mp4; codecs="apac.31.00",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(hi)),t={};te();for(var n=(e=l(e)).next();!n.done;n=e.next()){mi(n=n.value)?t[n]=!0:t[n]=ev()?ht(n)||!!Yn(n):""!=es().canPlayType(n);var i=n.split(";")[0];t[i]=t[i]||t[n]}return t}(),w(s,te().ic(),4);case 4:return a=s.h,o={manifest:i,media:r,drm:n,hardwareResolution:a},mh.forEach((function(e,t){o[t]=e()})),s.return(o)}}))},ld.isBrowserSupported=function(){return e.Promise||q("A Promise implementation or polyfill is required"),!(!(e.Promise&&e.Uint8Array&&Array.prototype.forEach)||(navigator.userAgent||"").includes("Trident/")||(te(),!ev()&&""==es().canPlayType("application/x-mpegurl")))},ld.setQueueManagerFactory=function(e){yh=e},ld.setAdManagerFactory=function(e){vh=e},ld.registerSupportPlugin=hd,ld.prototype.destroy=ld.prototype.destroy;var dh=0,hh=1,ph=2,fh=3;ld.LoadMode={DESTROYED:dh,NOT_LOADED:hh,MEDIA_SOURCE:ph,SRC_EQUALS:fh},ld.version="v4.15.8";var gh=["4","15"];le=new function(e){this.g=e,this.i=se,this.h=ue}(new ae(Number(gh[0]),Number(gh[1])));var mh=new Map,vh=null,yh=null;function bh(){this.g=[],this.i=this.m=this.l=this.j=this.h=0}function wh(e){return e.g.length?e.g.reduce((function(e,t){return e+t}),0)/e.g.length:0}function Th(e,t,n){var i=this;this.g=e,this.h=t,this.m=n,this.i=!1,this.j=this.h.getVolume(),this.l=new $,this.l.D(this.h,google.ima.AdEvent.Type.PAUSED,(function(){i.i=!0})),this.l.D(this.h,google.ima.AdEvent.Type.RESUMED,(function(){i.i=!1}))}function xh(){}function Sh(e,t){for(var n=[],i=(e=l(Xt(e,"Ad"))).next();!i.done;i=e.next())if((i=$t(i.value,"InLine"))&&(i=$t(i,"Creatives")))for(var r=(i=l(Xt(i,"Creative"))).next();!r.done;r=i.next()){var a=$t(r=r.value,"Linear");if(a&&Ah(n,t,a),r=$t(r,"NonLinearAds"))for(var o=(r=l(r=Xt(r,"NonLinear"))).next();!o.done;o=r.next())e:{a=n;var s=t,u=o.value,c=$t(u,"StaticResource");if(c)o=c.attributes.creativeType;else{if(!(c=$t(u,"HTMLResource")))break e;o="text/html"}if(c=Yt(c)){"text/html"===o&&(c="data:text/html;charset=UTF-8,"+encodeURIComponent(c));var d=Zt(u,"width",sn)||Zt(u,"expandedWidth",sn),h=Zt(u,"height",sn)||Zt(u,"expandedHeight",sn);if(d||h){var p=null;(u=u.attributes.minSuggestedDuration)&&(p=jt(u)),u=0,null!=s&&(u=s),a.push({id:null,groupId:null,startTime:u,endTime:null,uri:c,mimeType:o,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!1,resumeOffset:0,playoutLimit:p,once:!0,pre:null==s,post:1/0==s,timelineRange:!1,loop:!1,overlay:{viewport:{x:0,y:0},topLeft:{x:0,y:0},size:{x:d||0,y:h||0}},displayOnBackground:!1,currentVideo:null,background:null})}}}}return n}function Ah(e,t,n){var i=0;null!=t&&(i=t);var r=null;if(n.attributes.skipoffset&&(r=jt(n.attributes.skipoffset),isNaN(r)&&(r=null)),n=$t(n,"MediaFiles")){var a=Xt(n,"MediaFile");for(n=a,(a=a.filter((function(e){return"streaming"==e.attributes.delivery}))).length&&(n=a),n=n.sort((function(e,t){return(parseInt(t.attributes.height,10)||0)-(parseInt(e.attributes.height,10)||0)})),a=(n=l(n)).next();!a.done;a=n.next())if(!(a=a.value).attributes.apiFramework){var o=Yt(a);if(o){e.push({id:null,groupId:null,startTime:i,endTime:null,uri:o,mimeType:a.attributes.type||null,isSkippable:null!=r,skipOffset:r,skipFor:null,canJump:!1,resumeOffset:0,playoutLimit:null,once:!0,pre:null==t,post:1/0==t,timelineRange:!1,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null});break}}}}function kh(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 $,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.15.8"),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 Dr("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 Dr("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 Dr("ad-cue-points-changed",(new Map).set("cuepoints",n)))}!function(e){function t(t,n){t=(new Map).set("originalEvent",t),e.l(new Dr(n,t))}e.h.D(e.g,google.ima.AdErrorEvent.Type.AD_ERROR,(function(t){Eh(e,t)})),e.h.D(e.g,google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,(function(t){Ih(e,t)})),e.h.D(e.g,google.ima.AdEvent.Type.STARTED,(function(t){Ih(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){Ch(e,t)})),e.h.D(e.g,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,(function(t){Ch(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),t.h.D(t.i,"loadeddata",(function(){t.g.resize(t.i.offsetWidth,t.i.offsetHeight)})),"ResizeObserver"in e?(t.A=new ResizeObserver((function(){t.g.resize(t.i.offsetWidth,t.i.offsetHeight)})),t.A.observe(t.i)):t.h.D(document,"fullscreenchange",(function(){t.g.resize(t.i.offsetWidth,t.i.offsetHeight)})),t.F||t.o.skipPlayDetection?t.g.start():t.h.Aa(t.i,"play",(function(){t.F=!0,t.g.start()}))}catch(e){Ch(t,null)}}(o,t)})),this.h.D(this.m,google.ima.AdErrorEvent.Type.AD_ERROR,(function(e){Eh(o,e)})),this.h.D(this.i,"ended",(function(){o.m.contentComplete()})),this.h.Aa(this.i,"play",(function(){o.F=!0}))}function Eh(e,t){t.getError(),t=(new Map).set("originalEvent",t),e.l(new Dr("ad-error",t)),Ch(e,null),e.l(new Dr("ad-cue-points-changed",(new Map).set("cuepoints",[])))}function Ih(e,t){var n=t.getAd();n?(e.j=new Th(n,e.g,e.i),t.type!=google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED||e.o.supportsMultipleMediaElements||e.l(new Dr("ad-content-pause-requested")),t=(new Map).set("ad",e.j).set("sdkAdObject",n).set("originalEvent",t),e.l(new Dr("ad-started",t)),e.j.isLinear()&&(e.s.setAttribute("ad-active","true"),e.o.customPlayheadTracker||e.i.pause(),e.i.muted?((t=e.j).j=e.i.volume,t.h.setVolume(0)):e.j.setVolume(e.i.volume))):q("The IMA SDK fired a "+t.type+" event with no associated ad. Unable to play ad!")}function Ch(e,t){t&&t.type==google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED&&!e.o.supportsMultipleMediaElements&&e.l(new Dr("ad-content-resume-requested")),e.l(new Dr("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 Mh(e,t,n,i,r,a){this.g=e,this.i=t,this.j=(this.h=t.isSkippable)?t.skipOffset||0:t.skipOffset,this.l=t.skipFor,this.A=n,this.o=i,this.m=r,this.s=a,this.B=t.overlay}function Dh(e,t,n){this.g=e,this.j=t,this.h=n,this.i=null==e.overlay}function Ph(e,t,n,i){var r=this;this.M=null,this.B=e,this.C=t,this.g=n,this.G=null,this.A=!0,this.h=this.g,this.i=i,this.U=new Set,this.H=new Set,this.F=new Map,this.L=new Map,this.j=new ld,Fh(this),this.I=new $,this.l=new $,this.K=!1,this.ha=this.o=this.s=this.m=null,this.ka=!1,this.P=-1,this.ba=function(){if(!r.K&&r.m&&!r.C.ua()){r.m=r.g.currentTime;var e=Oh(r);e&&jh(r,e,1,1,Date.now())}},this.W=function(){if(!(r.K||r.m||r.C.ua())){r.m=r.g.currentTime;var e=Oh(r,!0);e&&jh(r,e,1,1,Date.now())}},this.na=function(){if(!r.K&&r.m&&!r.C.ua()){var e=r.g.currentTime;r.s&&!r.s.pre&&!r.s.post&&e<(r.s.endTime||r.s.startTime)&&(r.s=null)}},this.S=new Ti(this.ba),this.N=new Ti((function(){var e,t,n,i,a,o,s,u,c,d,h;return R((function(p){switch(p.g){case 1:if(!r.H.size||null==r.m){p.u(0);break}if((e=r.C.m)==dh||e==hh)return p.return();t=!1,n=Array.from(r.H),i=r.C.Sa(),a=l(n),o=a.next();case 3:if(o.done){p.u(5);break}if((s=o.value)==r.s){p.u(4);break}if(u=s.endTime||s.startTime,!(1<=i.start-u)){0<(c=s.startTime-r.m)&&10>=c&&(!r.F.has(s)&&Hh(s)&&r.F.set(s,r.j.preload(s.uri,null,s.mimeType||void 0)),Gh(r,s)),p.u(4);break}if(!r.F.has(s)){p.u(7);break}return w(p,r.F.get(s),8);case 8:(d=p.h)&&d.destroy(),r.F.delete(s);case 7:zh(r,s),h=JSON.stringify(s),r.U.has(h)&&r.U.delete(h),r.H.delete(s),Rh(r),s.overlay||(t=!0);case 4:o=a.next(),p.u(3);break;case 5:t&&Bh(r),T(p)}}))})),this.configure(this.C.getConfiguration().ads)}function Rh(e){e.ka&&!e.H.size&&(e.I.Ja(e.g,"playing",e.W),e.I.Ja(e.g,"timeupdate",e.W),e.I.Ja(e.g,"seeked",e.na),e.I.Ja(e.g,"ended",e.ba),-1!=e.P&&(e.g.cancelVideoFrameCallback(e.P),e.P=-1),e.S&&e.S.stop(),e.N&&e.N.stop(),e.ka=!1)}function Lh(e){if(e.B&&e.M&&!e.K){var t=e.M.supportsMultipleMediaElements,n=e.g;n.webkitPresentationMode&&"inline"!==n.webkitPresentationMode&&(t=!1),e.A==t&&(e.A=!t,e.A?(e.h=e.g,e.G&&(e.G.parentElement&&e.B.removeChild(e.G),e.G=null)):(e.G||((t=document.createElement(e.g.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.display="none",t.setAttribute("playsinline",""),e.G=t),e.h=e.G))}else e.A=!0}function Nh(e,t){var n,i,r,a,o,s,u,c;R((function(d){switch(d.g){case 1:n=!1,i=l(t),r=i.next();case 2:if(r.done){d.u(4);break}if(!(a=r.value).uri){q("Missing URL in interstitial",a),d.u(3);break}if(a.mimeType){d.u(5);break}return x(d,6),o=e.j.Pb(),w(d,gc(a.uri,o,e.C.getConfiguration().streaming.retryParameters),8);case 8:a.mimeType=d.h,A(d,5);break;case 6:k(d);case 5:if(s=a.id||JSON.stringify(a),e.U.has(s)){d.u(3);break}a.loop&&!a.overlay&&q("Loop is only supported in overlay interstitials",a),a.overlay||(n=!0),e.U.add(s),e.H.add(a),u=!1,a.pre&&null==e.m?u=!0:0!=a.startTime||a.canJump?null!=e.m&&0<(c=a.startTime-e.m)&&10>=c&&(u=!0):u=!0,u&&(!e.F.has(a)&&Hh(a)&&e.F.set(a,e.j.preload(a.uri,null,a.mimeType||void 0)),Gh(e,a));case 3:r=i.next(),d.u(2);break;case 4:n&&Bh(e),function(e){if(!e.ka&&e.H.size){if(e.I.D(e.g,"playing",e.W),e.I.D(e.g,"timeupdate",e.W),e.I.D(e.g,"seeked",e.na),e.I.D(e.g,"ended",e.ba),"requestVideoFrameCallback"in e.g&&!Kh()){var t=e.g,n=function(){-1!=e.P&&(e.ba(),-1!=e.P&&(e.P=t.requestVideoFrameCallback(n)))};e.P=t.requestVideoFrameCallback(n)}else e.S.Fa(.025);e.N&&e.N.Fa(1),e.ka=!0}}(e),T(d)}}))}function Oh(e,t,n){t=void 0!==t&&t,n=void 0===n?null:n;var i=0,r=null;if(e.H.size&&null!=e.m){var a=e.g.ended,o=Array.from(e.H).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.m-Math.round(1e3*s.startTime)/1e3,d=1;e.M.allowStartInMiddleOfInterstitial&&s.endTime&&1/0!=s.endTime&&(d=s.endTime-s.startTime),0<c&&(c<=d||!s.canJump)&&(u=!(null==n&&e.s&&!e.s.pre&&!e.s.post&&e.s.startTime>=s.startTime))}u&&(!e.s||s.startTime>=e.s.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 jh(e,t,n,i,r,a){a=void 0===a?0:a,e.s=t,Lh(e),e.A||!e.B||e.h.parentElement||e.B.appendChild(e.h),1==i&&1==n&&(n=Array.from(e.H).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.H.delete(t),Rh(e),t.overlay||Bh(e)),t.mimeType&&(t.mimeType.startsWith("image/")||"text/html"===t.mimeType)?t.overlay?function(e,t,n,i,r){function a(){e.o&&(e.o.stop(),e.o=null),e.B.removeChild(u),_h(e,t),e.i(new Dr("ad-stopped")),e.l.Ra();var a=Oh(e,t.pre,i-r);a?jh(e,a,n,++i,Date.now(),r):e.K=!1}e.K=!0;var o=t.overlay,s="text/html"==t.mimeType?"iframe":"img",u=document.createElement(s);u.style.objectFit="contain",u.style.position="absolute",u.style.border="none",Uh(e,t),e.i(new Dr("ad-started",(new Map).set("ad",new Dh(t,n,i)))),"iframe"==s?u.src=t.uri:(u.src=t.uri,u.onerror=function(t){e.i(new Dr("ad-error",(new Map).set("originalEvent",t))),a()});var l=o.viewport,c=o.topLeft;o=o.size,0==l.x&&0==l.y?(u.width=t.overlay.size.x,u.height=t.overlay.size.y,u.style.bottom="10%",u.style.left="0",u.style.right="0",u.style.width="100%",t.overlay.size.y||"iframe"!=s||(u.style.height="auto")):(u.style.height=o.y/l.y*100+"%",u.style.left=c.x/l.x*100+"%",u.style.top=c.y/l.y*100+"%",u.style.width=o.x/l.x*100+"%"),e.B.appendChild(u);var d=Date.now();e.o&&e.o.stop(),e.o=new Ti((function(){t.playoutLimit&&(Date.now()-d)/1e3>t.playoutLimit||t.endTime&&e.g.currentTime>t.endTime?(e.i(new Dr("ad-complete")),a()):e.g.currentTime<t.startTime&&(e.i(new Dr("ad-skipped")),a())})),t.playoutLimit&&!t.endTime?e.o.ia(t.playoutLimit):t.endTime&&e.o.Fa(.025),e.l.D(e.g,"seeked",(function(){var n=e.g.currentTime;(n<t.startTime||t.endTime&&n>t.endTime)&&(e.o&&e.o.stop(),e.i(new Dr("ad-skipped")),a())}))}(e,t,n,i,a):q("Unsupported interstitial",t):e.A&&t.overlay?q("Unsupported interstitial",t):function(e,t,n,i,r,a){var o,s,u,l,c,d,h,p,f,g,m,v,y,b,S,E,I,C,M,D;R((function(P){switch(P.g){case 1:if(o=Date.now(),e.K=!0,s=!1,u=function(){if(!e.A&&!t.overlay&&null==t.resumeOffset)if(t.timelineRange&&t.endTime&&1/0!=t.endTime)e.g.currentTime!=t.endTime&&(e.g.currentTime=t.endTime);else{var n=Date.now();e.g.currentTime+=(n-r)/1e3,r=n}},l=function(o){var s,l;return R((function(c){if(1==c.g){if(u(),s=Oh(e,t.pre,i-a),o&&t.groupId)for(;s&&s.groupId==t.groupId;)i++,s=Oh(e,t.pre,i-a);return e.o&&(!t.groupId||s&&s.groupId!=t.groupId)&&(e.o.stop(),e.o=null),_h(e,t),s&&!s.overlay?c.u(2):(t.post&&(e.m=null,e.s=null),e.A?w(c,e.j.detach(),4):w(c,e.j.vc(),4))}2!=c.g&&(e.A&&(null==(l=t.resumeOffset)&&(l=t.timelineRange&&t.endTime&&1/0!=t.endTime?t.endTime-(e.m||0):(Date.now()-r)/1e3),e.i(new Dr("ad-content-resume-requested",(new Map).set("offset",l)))),e.i(new Dr("ad-stopped")),e.l.Ra(),e.K=!1,e.A?Bh(e):(e.h.style.display="none",u(),e.g.ended||e.g.play())),Lh(e),s&&(e.i(new Dr("ad-stopped")),e.l.Ra(),jh(e,s,n,++i,r,a)),T(c)}))},c=function(t){return R((function(n){return s?n.return():(s=!0,e.i(new Dr("ad-error",(new Map).set("originalEvent",t))),w(n,l(!1),0))}))},d=function(){return R((function(t){if(1==t.g)return s?t.return():(s=!0,w(t,l(!1),2));e.i(new Dr("ad-complete")),T(t)}))},e.ha=function(){return R((function(t){return s?t.return():(s=!0,e.i(new Dr("ad-skipped")),w(t,l(!0),0))}))},h=new Mh(e.h,t,e.ha,n,i,!e.A),e.A||(h.setMuted(e.g.muted),h.setVolume(e.g.volume)),e.i(new Dr("ad-started",(new Map).set("ad",h))),(p=h.canSkipNow())&&e.i(new Dr("ad-skip-state-changed")),e.l.Aa(e.j,"error",c),e.l.D(e.h,"timeupdate",(function(){if(e.h.duration){var t=h.canSkipNow();p!=t&&0<h.getRemainingTime()&&0<h.getDuration()&&e.i(new Dr("ad-skip-state-changed")),p=t}})),e.l.Aa(e.j,"firstquartile",(function(){u(),e.i(new Dr("ad-first-quartile"))})),e.l.Aa(e.j,"midpoint",(function(){u(),e.i(new Dr("ad-midpoint"))})),e.l.Aa(e.j,"thirdquartile",(function(){u(),e.i(new Dr("ad-third-quartile"))})),e.l.Aa(e.j,"complete",d),e.l.D(e.h,"play",(function(){e.i(new Dr("ad-resumed"))})),e.l.D(e.h,"pause",(function(){var t=e.j.getConfiguration();e.h.currentTime>=t.playRangeEnd?d():e.i(new Dr("ad-paused"))})),e.l.D(e.h,"volumechange",(function(){e.h.muted?e.i(new Dr("ad-muted")):e.i(new Dr("ad-volume-changed"))})),!e.A||1!=i){P.u(2);break}return e.i(new Dr("ad-content-pause-requested",(new Map).set("saveLivePosition",!0))),f=new Sr,g=function(t){return R((function(n){if(1==n.g)return"detach"!=t.state?n.u(0):Kh()?w(n,new Promise((function(e){return new Ti(e).ia(.1)})),3):n.u(3);f.resolve(),e.l.Ja(e.C,"onstatechange",g),T(n)}))},e.l.D(e.C,"onstatechange",g),w(P,f,2);case 2:return Uh(e,t),e.A||(e.h.style.display="",t.overlay?(e.h.loop=t.loop,m=t.overlay.viewport,v=t.overlay.topLeft,y=t.overlay.size,e.h.style.height=y.y/m.y*100+"%",e.h.style.left=v.x/m.x*100+"%",e.h.style.top=v.y/m.y*100+"%",e.h.style.width=y.x/m.x*100+"%"):(e.g.pause(),null!=t.resumeOffset&&0!=t.resumeOffset&&(e.g.currentTime+=t.resumeOffset),e.h.loop=!1,e.h.style.height="100%",e.h.style.left="0",e.h.style.top="0",e.h.style.width="100%")),x(P,4),Fh(e),t.startTime&&t.endTime&&1/0!=t.endTime&&t.startTime!=t.endTime&&0<(b=t.endTime-t.startTime)&&e.j.configure("playRangeEnd",b),t.playoutLimit&&!e.o&&(e.o=new Ti((function(){e.ha()})).ia(t.playoutLimit),e.j.configure("playRangeEnd",t.playoutLimit)),w(P,e.j.fc(e.h),6);case 6:return S=null,e.M.allowStartInMiddleOfInterstitial&&null!=e.m&&(E=e.m-t.startTime,.25<Math.abs(E)&&(S=E)),e.F.has(t)?w(P,e.F.get(t),10):w(P,e.j.load(t.uri,S,t.mimeType||void 0),8);case 10:return I=P.h,e.F.delete(t),w(P,I?e.j.load(I):e.j.load(t.uri,S,t.mimeType||void 0),8);case 8:e.h.play(),C=(Date.now()-o)/1e3,e.i(new Dr("ads-loaded",(new Map).set("loadTime",C))),e.A&&e.g.play(),t.overlay&&(M=function(){var n=e.g.currentTime-t.startTime;.1<Math.abs(n-e.h.currentTime)&&(e.h.currentTime=n)},e.l.Aa(e.h,"playing",M),e.l.D(e.g,"seeking",M),e.l.D(e.g,"seeked",(function(){var n=e.g.currentTime;(n<t.startTime||t.endTime&&n>t.endTime)&&e.ha()}))),A(P,0);break;case 4:if(D=k(P),!e.K)return P.return();c(D),T(P)}}))}(e,t,n,i,r,a)}function Uh(e,t){if(t.displayOnBackground&&(e.g.style.zIndex="1"),null!=t.currentVideo){var n=t.currentVideo;e.g.style.transformOrigin="top left";var i=!0,r=[],a=n.topLeft.x/n.viewport.x*100;0<a&&100>=a&&(r.push("translateX("+a+"%)"),i=!1),0<(a=n.topLeft.y/n.viewport.y*100)&&100>=a&&(r.push("translateY("+a+"%)"),i=!1),1>(a=n.size.x/n.viewport.x)&&r.push("scaleX("+a+")"),n=n.size.y/n.viewport.y,1>a&&r.push("scaleY("+n+")"),r.length&&(e.g.style.transform=r.join(" ")),i&&(e.g.style.transition="transform 250ms")}e.B&&(e.B.style.pointerEvents="none",t.background&&(e.B.style.background=t.background)),e.G&&(e.G.style.background=t.overlay?"":"rgb(0, 0, 0)")}function _h(e,t){t&&!t.displayOnBackground||(e.g.style.zIndex=""),t&&null==t.currentVideo||(e.g.style.transformOrigin="",e.g.style.transition="",e.g.style.transform=""),e.B&&(e.B.style.pointerEvents="",!t||t.background)&&(e.B.style.background=""),e.G&&(e.G.style.background="")}function Bh(e){for(var t=[],n=l(e.H),i=n.next(),r={};!i.done;r={uc:void 0},i=n.next())(i=i.value).overlay||(r.uc={start:i.startTime,end:null},i.pre?(r.uc.start=0,r.uc.end=null):i.post?(r.uc.start=-1,r.uc.end=null):i.timelineRange&&(r.uc.end=i.endTime),t.find(function(e){return function(t){return e.uc.start==t.start&&e.uc.end==t.end}}(r))||t.push(r.uc));e.i(new Dr("ad-cue-points-changed",(new Map).set("cuepoints",t)))}function Fh(e){e.j.configure(e.C.Zh()),e.j.configure("ads.disableHLSInterstitial",!0),e.j.configure("ads.disableDASHInterstitial",!0),e.j.configure("playRangeEnd",1/0),_r(e.C.Pb(),e.j.Pb())}function Vh(e,t,n){var i,r;return R((function(a){return 1==a.g?(i=Br([t],{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4}),w(a,e.C.Pb().request(7,i,n).promise,2)):(r=a.h,a.return(r.data))}))}function Hh(e){return!(e=e.mimeType)||!e.startsWith("image/")&&"text/html"!==e}function Kh(){var e=te().La();return"TV"==e||"CONSOLE"==e||"CAST"==e}function Gh(e,t){if(!(e.L.has(t)||e.M&&!e.M.allowPreloadOnDomElements)){var n=function(e){var t=document.createElement("link");return t.rel="preload",t.href=e,t.as="image",document.head.appendChild(t),t},i=[];if(t.background){var r=t.background.match(/url\(('|")?([^'"()]+)('|")\)?/);r&&i.push(n(r[2]))}t.mimeType.startsWith("image/")&&i.push(n(t.uri)),e.L.set(t,i)}}function zh(e,t){if(e.L.has(t)){for(var n=e.L.get(t),i=(n=l(n)).next();!i.done;i=n.next())(i=i.value).parentNode.removeChild(i);e.L.delete(t)}}function qh(e,t,n,i,r){this.h=e,this.j=jt(this.h.skipOffset),this.g=r,this.i=t,this.l=n,this.o=i,this.m=!1}function Xh(e,t,n,i){this.B=e,this.K=t,this.h=n,this.l=null,this.P=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.N=!0,this.H="",this.o=new $}function Wh(e,t){var n,i,r,a,o,s,u,l;R((function(c){return 1==c.g?t.staticResource?(n=Yh(t),e.F.get(n)?c.return():(i={type:9},r=Br([t.staticResource],{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4}),a=e.K.request(7,r,i),x(c,2),e.F.set(n,[]),w(c,a.promise,4))):c.return():2!=c.g?(o=c.h,s=Ue(o.data),u=JSON.parse(s),l=u.apps,e.F.set(n,l),A(c,0)):(k(c),e.F.delete(n),void T(c))}))}function Yh(e){return[e.adId,e.adParameters,e.adSystem,e.adTitle,e.creativeAdId,e.creativeId,e.creativeSequence,e.height,e.width,e.staticResource].join("")}function Jh(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 $h(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"),ep(e,"firstQuartile")):t>=r&&!e.s.includes("midpoint")?(e.s.push("midpoint"),ep(e,"midpoint")):t>=a&&!e.s.includes("thirdQuartile")&&(e.s.push("thirdQuartile"),ep(e,"thirdQuartile")),i=e.g.getRemainingTime(),r=e.g.getDuration(),e.g.canSkipNow()&&0<i&&0<r&&ep(e,"skipStateChanged"),0<r&&(0>=i||i>r)&&Qh(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}Qh(e),e.L=r,e.g=new qh(o,a+1,r.ads.length,!0,e.h),e.C=o,0===a&&ep(e,"breakStart"),Zh(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(Yh(o.nonLinearAdList[0]));if(s<=t&&u&&u.length){Qh(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 qh(o,a+1,r.ads.length,!1,e.h),e.C=o,0===a&&ep(e,"breakStart"),Zh(e);break}}n&&!e.g&&(t=e.h.currentTime,e.A&&e.A>t&&(e.h.currentTime=e.A),e.A=null)}}}function Qh(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;ep(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.Ja(n.target,n.type,n.listener);e.m=[],e.s=[],(t=e.g.getPositionInSequence())===(n=e.g.getSequenceLength())&&ep(e,"breakEnd"),e.g=null,e.C=null,e.L=null}}function Zh(e){var t=!1;e.h.paused?t=!0:(ep(e,"impression"),ep(e,"start")),e.m.push({target:e.h,type:"volumechange",listener:function(){e.h.muted&&ep(e,"mute")}}),e.m.push({target:e.h,type:"volumechange",listener:function(){e.h.muted||ep(e,"unmute")}}),e.m.push({target:e.h,type:"play",listener:function(){t?(ep(e,"impression"),ep(e,"start"),t=!1):ep(e,"resume")}}),e.m.push({target:e.h,type:"pause",listener:function(){ep(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 ep(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=Br([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 Dr("ad-impression"));break;case"start":e.i(new Dr("ad-started",(new Map).set("ad",e.g)));break;case"mute":e.i(new Dr("ad-muted"));break;case"unmute":e.i(new Dr("ad-volume-changed"));break;case"resume":e.i(new Dr("ad-resumed"));break;case"pause":e.i(new Dr("ad-paused"));break;case"firstQuartile":e.i(new Dr("ad-first-quartile"));break;case"midpoint":e.i(new Dr("ad-midpoint"));break;case"thirdQuartile":e.i(new Dr("ad-third-quartile"));break;case"complete":e.i(new Dr("ad-complete")),e.i(new Dr("ad-stopped"));break;case"skip":e.i(new Dr("ad-skipped")),e.i(new Dr("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 Dr("ad-skip-state-changed"))}}function tp(e,t){this.g=e,this.i=null,this.h=t}function np(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 $,(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 Dr("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 Dr("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 tp(e,r.l),r.A&&(r.m.i=r.A),r.i(new Dr("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 Dr("ad-first-quartile"))})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.MIDPOINT,(function(){r.i(new Dr("ad-midpoint"))})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.THIRD_QUARTILE,(function(){r.i(new Dr("ad-third-quartile"))})),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.COMPLETE,(function(){r.i(new Dr("ad-complete")),r.i(new Dr("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 Dr("ad-skipped")),r.i(new Dr("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 Dr("ad-cue-points-changed",(new Map).set("cuepoints",e)))}))}function ip(){Lr.call(this),this.h=this.i=this.j=this.g=null,this.m=new bh,this.o=navigator.language,this.l=null}function rp(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++;var n=t.ad;n&&!n.isLinear()&&e.m.j++;break;case"ad-complete":e.m.l++;break;case"ad-skipped":e.m.m++;break;case"ad-error":e.m.i++}e.dispatchEvent(t)}function ap(e){return JSON.stringify(e,(function(e,t){if("function"!=typeof t){if(t instanceof Event||t instanceof Dr){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(Yo(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 op(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=Th.prototype).needsSkipUI=function(){return!1},i.isClientRendering=function(){return!0},i.hasCustomClick=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.m.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){this.h.resize(e,t)},i.setMuted=function(e){(this.m.muted=e)?(this.j=this.getVolume(),this.h.setVolume(0)):this.h.setVolume(this.j)},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.getVastAdId=function(){return""},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",Th),Th.prototype.release=Th.prototype.release,Th.prototype.getPodIndex=Th.prototype.getPodIndex,Th.prototype.getTimeOffset=Th.prototype.getTimeOffset,Th.prototype.getMediaUrl=Th.prototype.getMediaUrl,Th.prototype.getAdvertiserName=Th.prototype.getAdvertiserName,Th.prototype.getCreativeAdId=Th.prototype.getCreativeAdId,Th.prototype.getAdId=Th.prototype.getAdId,Th.prototype.getVastAdId=Th.prototype.getVastAdId,Th.prototype.getVastMediaWidth=Th.prototype.getVastMediaWidth,Th.prototype.getVastMediaHeight=Th.prototype.getVastMediaHeight,Th.prototype.getVastMediaBitrate=Th.prototype.getVastMediaBitrate,Th.prototype.getDescription=Th.prototype.getDescription,Th.prototype.getTitle=Th.prototype.getTitle,Th.prototype.getPositionInSequence=Th.prototype.getPositionInSequence,Th.prototype.getSequenceLength=Th.prototype.getSequenceLength,Th.prototype.setMuted=Th.prototype.setMuted,Th.prototype.resize=Th.prototype.resize,Th.prototype.isLinear=Th.prototype.isLinear,Th.prototype.isMuted=Th.prototype.isMuted,Th.prototype.setVolume=Th.prototype.setVolume,Th.prototype.getVolume=Th.prototype.getVolume,Th.prototype.play=Th.prototype.play,Th.prototype.pause=Th.prototype.pause,Th.prototype.skip=Th.prototype.skip,Th.prototype.canSkipNow=Th.prototype.canSkipNow,Th.prototype.getTimeUntilSkippable=Th.prototype.getTimeUntilSkippable,Th.prototype.isSkippable=Th.prototype.isSkippable,Th.prototype.isPaused=Th.prototype.isPaused,Th.prototype.getRemainingTime=Th.prototype.getRemainingTime,Th.prototype.getMinSuggestedDuration=Th.prototype.getMinSuggestedDuration,Th.prototype.getDuration=Th.prototype.getDuration,Th.prototype.isUsingAnotherMediaElement=Th.prototype.isUsingAnotherMediaElement,Th.prototype.hasCustomClick=Th.prototype.hasCustomClick,Th.prototype.isClientRendering=Th.prototype.isClientRendering,Th.prototype.needsSkipUI=Th.prototype.needsSkipUI,F("shaka.ads.Utils",xh),xh.ADS_LOADED="ads-loaded",xh.AD_STARTED="ad-started",xh.AD_FIRST_QUARTILE="ad-first-quartile",xh.AD_MIDPOINT="ad-midpoint",xh.AD_THIRD_QUARTILE="ad-third-quartile",xh.AD_COMPLETE="ad-complete",xh.AD_STOPPED="ad-stopped",xh.AD_SKIPPED="ad-skipped",xh.AD_VOLUME_CHANGED="ad-volume-changed",xh.AD_MUTED="ad-muted",xh.AD_PAUSED="ad-paused",xh.AD_RESUMED="ad-resumed",xh.AD_SKIP_STATE_CHANGED="ad-skip-state-changed",xh.CUEPOINTS_CHANGED="ad-cue-points-changed",xh.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded",xh.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded",xh.AD_CLICKED="ad-clicked",xh.AD_PROGRESS="ad-progress",xh.AD_BUFFERING="ad-buffering",xh.AD_IMPRESSION="ad-impression",xh.AD_DURATION_CHANGED="ad-duration-changed",xh.AD_CLOSED="ad-closed",xh.AD_LOADED="ad-loaded",xh.ALL_ADS_COMPLETED="all-ads-completed",xh.AD_LINEAR_CHANGED="ad-linear-changed",xh.AD_METADATA="ad-metadata",xh.AD_RECOVERABLE_ERROR="ad-recoverable-error",xh.AD_ERROR="ad-error",xh.AD_BREAK_READY="ad-break-ready",xh.AD_INTERACTION="ad-interaction",xh.AD_CONTENT_PAUSE_REQUESTED="ad-content-pause-requested",xh.AD_CONTENT_RESUME_REQUESTED="ad-content-resume-requested",xh.AD_CONTENT_ATTACH_REQUESTED="ad-content-attach-requested",kh.prototype.configure=function(e){this.o=e},kh.prototype.stop=function(){this.g&&this.g.stop(),this.s&&Zo(this.s)},kh.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=Mh.prototype).needsSkipUI=function(){return!0},i.isClientRendering=function(){return!0},i.hasCustomClick=function(){return!1},i.isUsingAnotherMediaElement=function(){return this.s},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.l?this.getDuration()-this.getRemainingTime()<this.j+this.l:this.h},i.getTimeUntilSkippable=function(){if(this.isSkippable()){var e=this.getRemainingTime()+this.j-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.A()},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 null==this.B},i.resize=function(){},i.setMuted=function(e){this.g.muted=e},i.getSequenceLength=function(){return this.o},i.getPositionInSequence=function(){return this.m},i.getTitle=function(){return""},i.getDescription=function(){return""},i.getVastMediaBitrate=function(){return 0},i.getVastMediaHeight=function(){return 0},i.getVastMediaWidth=function(){return 0},i.getVastAdId=function(){return""},i.getAdId=function(){return this.i.id||""},i.getCreativeAdId=function(){return""},i.getAdvertiserName=function(){return""},i.getMediaUrl=function(){return this.i.uri},i.getTimeOffset=function(){return 0},i.getPodIndex=function(){return 0},i.release=function(){this.g=null},F("shaka.ads.InterstitialAd",Mh),Mh.prototype.release=Mh.prototype.release,Mh.prototype.getPodIndex=Mh.prototype.getPodIndex,Mh.prototype.getTimeOffset=Mh.prototype.getTimeOffset,Mh.prototype.getMediaUrl=Mh.prototype.getMediaUrl,Mh.prototype.getAdvertiserName=Mh.prototype.getAdvertiserName,Mh.prototype.getCreativeAdId=Mh.prototype.getCreativeAdId,Mh.prototype.getAdId=Mh.prototype.getAdId,Mh.prototype.getVastAdId=Mh.prototype.getVastAdId,Mh.prototype.getVastMediaWidth=Mh.prototype.getVastMediaWidth,Mh.prototype.getVastMediaHeight=Mh.prototype.getVastMediaHeight,Mh.prototype.getVastMediaBitrate=Mh.prototype.getVastMediaBitrate,Mh.prototype.getDescription=Mh.prototype.getDescription,Mh.prototype.getTitle=Mh.prototype.getTitle,Mh.prototype.getPositionInSequence=Mh.prototype.getPositionInSequence,Mh.prototype.getSequenceLength=Mh.prototype.getSequenceLength,Mh.prototype.setMuted=Mh.prototype.setMuted,Mh.prototype.resize=Mh.prototype.resize,Mh.prototype.isLinear=Mh.prototype.isLinear,Mh.prototype.isMuted=Mh.prototype.isMuted,Mh.prototype.setVolume=Mh.prototype.setVolume,Mh.prototype.getVolume=Mh.prototype.getVolume,Mh.prototype.play=Mh.prototype.play,Mh.prototype.pause=Mh.prototype.pause,Mh.prototype.skip=Mh.prototype.skip,Mh.prototype.canSkipNow=Mh.prototype.canSkipNow,Mh.prototype.getTimeUntilSkippable=Mh.prototype.getTimeUntilSkippable,Mh.prototype.isSkippable=Mh.prototype.isSkippable,Mh.prototype.isPaused=Mh.prototype.isPaused,Mh.prototype.getRemainingTime=Mh.prototype.getRemainingTime,Mh.prototype.getMinSuggestedDuration=Mh.prototype.getMinSuggestedDuration,Mh.prototype.getDuration=Mh.prototype.getDuration,Mh.prototype.isUsingAnotherMediaElement=Mh.prototype.isUsingAnotherMediaElement,Mh.prototype.hasCustomClick=Mh.prototype.hasCustomClick,Mh.prototype.isClientRendering=Mh.prototype.isClientRendering,Mh.prototype.needsSkipUI=Mh.prototype.needsSkipUI,(i=Dh.prototype).needsSkipUI=function(){return!0},i.isClientRendering=function(){return!0},i.hasCustomClick=function(){return!1},i.isUsingAnotherMediaElement=function(){return!1},i.getDuration=function(){return-1},i.getMinSuggestedDuration=function(){return this.getDuration()},i.getRemainingTime=function(){return-1},i.isPaused=function(){return!1},i.isSkippable=function(){return!1},i.getTimeUntilSkippable=function(){return 0},i.canSkipNow=function(){return!1},i.skip=function(){},i.pause=function(){},i.play=function(){},i.getVolume=function(){return 1},i.setVolume=function(){},i.isMuted=function(){return!1},i.isLinear=function(){return this.i},i.resize=function(){},i.setMuted=function(){},i.getSequenceLength=function(){return this.j},i.getPositionInSequence=function(){return this.h},i.getTitle=function(){return""},i.getDescription=function(){return""},i.getVastMediaBitrate=function(){return 0},i.getVastMediaHeight=function(){return 0},i.getVastMediaWidth=function(){return 0},i.getVastAdId=function(){return""},i.getAdId=function(){return this.g.id||""},i.getCreativeAdId=function(){return""},i.getAdvertiserName=function(){return""},i.getMediaUrl=function(){return this.g.uri},i.getTimeOffset=function(){return 0},i.getPodIndex=function(){return 0},i.release=function(){},F("shaka.ads.InterstitialStaticAd",Dh),Dh.prototype.release=Dh.prototype.release,Dh.prototype.getPodIndex=Dh.prototype.getPodIndex,Dh.prototype.getTimeOffset=Dh.prototype.getTimeOffset,Dh.prototype.getMediaUrl=Dh.prototype.getMediaUrl,Dh.prototype.getAdvertiserName=Dh.prototype.getAdvertiserName,Dh.prototype.getCreativeAdId=Dh.prototype.getCreativeAdId,Dh.prototype.getAdId=Dh.prototype.getAdId,Dh.prototype.getVastAdId=Dh.prototype.getVastAdId,Dh.prototype.getVastMediaWidth=Dh.prototype.getVastMediaWidth,Dh.prototype.getVastMediaHeight=Dh.prototype.getVastMediaHeight,Dh.prototype.getVastMediaBitrate=Dh.prototype.getVastMediaBitrate,Dh.prototype.getDescription=Dh.prototype.getDescription,Dh.prototype.getTitle=Dh.prototype.getTitle,Dh.prototype.getPositionInSequence=Dh.prototype.getPositionInSequence,Dh.prototype.getSequenceLength=Dh.prototype.getSequenceLength,Dh.prototype.setMuted=Dh.prototype.setMuted,Dh.prototype.resize=Dh.prototype.resize,Dh.prototype.isLinear=Dh.prototype.isLinear,Dh.prototype.isMuted=Dh.prototype.isMuted,Dh.prototype.setVolume=Dh.prototype.setVolume,Dh.prototype.getVolume=Dh.prototype.getVolume,Dh.prototype.play=Dh.prototype.play,Dh.prototype.pause=Dh.prototype.pause,Dh.prototype.skip=Dh.prototype.skip,Dh.prototype.canSkipNow=Dh.prototype.canSkipNow,Dh.prototype.getTimeUntilSkippable=Dh.prototype.getTimeUntilSkippable,Dh.prototype.isSkippable=Dh.prototype.isSkippable,Dh.prototype.isPaused=Dh.prototype.isPaused,Dh.prototype.getRemainingTime=Dh.prototype.getRemainingTime,Dh.prototype.getMinSuggestedDuration=Dh.prototype.getMinSuggestedDuration,Dh.prototype.getDuration=Dh.prototype.getDuration,Dh.prototype.isUsingAnotherMediaElement=Dh.prototype.isUsingAnotherMediaElement,Dh.prototype.hasCustomClick=Dh.prototype.hasCustomClick,Dh.prototype.isClientRendering=Dh.prototype.isClientRendering,Dh.prototype.needsSkipUI=Dh.prototype.needsSkipUI,(i=Ph.prototype).configure=function(e){this.M=e,Lh(this)},i.stop=function(){if(this.l&&this.l.Ra(),this.U.clear(),this.H.clear(),this.j.ng(),this.F.size)for(var e=Array.from(this.F.values()),t=(e=l(e)).next();!t.done;t=e.next())(t=t.value)&&t.then((function(e){e&&e.destroy()}));if(this.F.clear(),this.L.size)for(t=(e=l(e=Array.from(this.L.keys()))).next();!t.done;t=e.next())zh(this,t.value);this.L.clear(),this.j.detach(),this.K=!1,this.s=this.m=null,this.A=!0,this.h=this.g,this.G=null,_h(this),Rh(this),this.B&&Zo(this.B),this.o&&(this.o.stop(),this.o=null)},i.release=function(){this.stop(),this.I&&this.I.release(),this.l&&this.l.release(),this.S&&(this.S.stop(),this.S=null),this.N&&(this.N.stop(),this.N=null),this.j.destroy()},i.od=function(){return this.j},i.addAdUrlInterstitial=function(e){var t,n,i,r,a,o,s,u,d,h=this;return R((function(p){switch(p.g){case 1:return w(p,Vh(h,e,t={type:12}),2);case 2:if(n=p.h,!(i=Ht(n,"VAST,vmap:VMAP")))throw new Ne(2,10,10007);if(r=[],"VAST"==i.tagName){r=Sh(i,h.m),p.u(3);break}if("vmap:VMAP"!=i.tagName){p.u(3);break}for(var f=[],g=l(Xt(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:jt(y),(v=$t(v,"vmap:AdSource"))&&(v=$t(v,"vmap:AdTagURI"))&&(v=Wt(v))&&f.push({time:m,uri:v}))}a=l(f),o=a.next();case 5:if(o.done){p.u(3);break}return s=o.value,w(p,Vh(h,s.uri,t),8);case 8:if(u=p.h,!(d=Ht(u,"VAST")))throw new Ne(2,10,10007);r.push.apply(r,c(Sh(d,s.time))),o=a.next(),p.u(5);break;case 3:Nh(h,r),T(p)}}))},(i=qh.prototype).needsSkipUI=function(){return!0},i.isClientRendering=function(){return!1},i.hasCustomClick=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.getVastAdId=function(){return this.h.vastAdId||""},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",qh),qh.prototype.release=qh.prototype.release,qh.prototype.getPodIndex=qh.prototype.getPodIndex,qh.prototype.getTimeOffset=qh.prototype.getTimeOffset,qh.prototype.getMediaUrl=qh.prototype.getMediaUrl,qh.prototype.getAdvertiserName=qh.prototype.getAdvertiserName,qh.prototype.getCreativeAdId=qh.prototype.getCreativeAdId,qh.prototype.getAdId=qh.prototype.getAdId,qh.prototype.getVastAdId=qh.prototype.getVastAdId,qh.prototype.getVastMediaWidth=qh.prototype.getVastMediaWidth,qh.prototype.getVastMediaHeight=qh.prototype.getVastMediaHeight,qh.prototype.getVastMediaBitrate=qh.prototype.getVastMediaBitrate,qh.prototype.getDescription=qh.prototype.getDescription,qh.prototype.getTitle=qh.prototype.getTitle,qh.prototype.getPositionInSequence=qh.prototype.getPositionInSequence,qh.prototype.getSequenceLength=qh.prototype.getSequenceLength,qh.prototype.setMuted=qh.prototype.setMuted,qh.prototype.resize=qh.prototype.resize,qh.prototype.isLinear=qh.prototype.isLinear,qh.prototype.isMuted=qh.prototype.isMuted,qh.prototype.setVolume=qh.prototype.setVolume,qh.prototype.getVolume=qh.prototype.getVolume,qh.prototype.play=qh.prototype.play,qh.prototype.pause=qh.prototype.pause,qh.prototype.skip=qh.prototype.skip,qh.prototype.canSkipNow=qh.prototype.canSkipNow,qh.prototype.getTimeUntilSkippable=qh.prototype.getTimeUntilSkippable,qh.prototype.isSkippable=qh.prototype.isSkippable,qh.prototype.isPaused=qh.prototype.isPaused,qh.prototype.getRemainingTime=qh.prototype.getRemainingTime,qh.prototype.getMinSuggestedDuration=qh.prototype.getMinSuggestedDuration,qh.prototype.getDuration=qh.prototype.getDuration,qh.prototype.isUsingAnotherMediaElement=qh.prototype.isUsingAnotherMediaElement,qh.prototype.hasCustomClick=qh.prototype.hasCustomClick,qh.prototype.isClientRendering=qh.prototype.isClientRendering,qh.prototype.needsSkipUI=qh.prototype.needsSkipUI,Xh.prototype.stop=function(){for(var e=l(this.m),t=e.next();!t.done;t=e.next())t=t.value,this.o.Ja(t.target,t.type,t.listener);Qh(this),this.m=[],this.s=[],this.G="",this.N=!0,this.H="",this.A=null,this.j=[],this.M=[],this.F.clear()},Xh.prototype.release=function(){this.stop(),this.o&&this.o.release()},Xh.prototype.onManifestUpdated=function(e){this.I=e,""!=this.G&&(function(e,t,n){var i,r,a,o,s,u,c,d,h,p,f,g,m,v,y,b;R((function(S){if(1==S.g)return i={type:8},r=Br([t],{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4}),a=e.K.request(7,r,i),x(S,2),w(S,a.promise,4);if(2!=S.g){if(o=S.h,s=[],u=Ue(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(p=h.value,f=l(p.nonLinearAdsList),g=f.next();!g.done;g=f.next())for(m=g.value,v=l(m.nonLinearAdList),y=v.next();!y.done;y=v.next())b=y.value,Wh(e,b);s=e.getCuePoints(),e.i(new Dr("ad-cue-points-changed",(new Map).set("cuepoints",s)))}}else e.j.length&&e.i(new Dr("ad-cue-points-changed",(new Map).set("cuepoints",s))),Qh(e),e.j=[];return n&&(e.I||0<s.length)&&function(e){$h(e),e.I||(Jh(e),e.o.D(e.h,"seeked",(function(){Jh(e)})),e.o.D(e.h,"ended",(function(){Qh(e)}))),e.o.D(e.h,"timeupdate",(function(){$h(e)}))}(e),A(S,0)}k(S),T(S)}))}(this,this.G,this.N),this.N=!1)},Xh.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=tp.prototype).needsSkipUI=function(){return!0},i.isClientRendering=function(){return!1},i.hasCustomClick=function(){return!0},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.getVastAdId=function(){return""},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",tp),tp.prototype.release=tp.prototype.release,tp.prototype.getPodIndex=tp.prototype.getPodIndex,tp.prototype.getTimeOffset=tp.prototype.getTimeOffset,tp.prototype.getMediaUrl=tp.prototype.getMediaUrl,tp.prototype.getAdvertiserName=tp.prototype.getAdvertiserName,tp.prototype.getCreativeAdId=tp.prototype.getCreativeAdId,tp.prototype.getAdId=tp.prototype.getAdId,tp.prototype.getVastAdId=tp.prototype.getVastAdId,tp.prototype.getVastMediaWidth=tp.prototype.getVastMediaWidth,tp.prototype.getVastMediaHeight=tp.prototype.getVastMediaHeight,tp.prototype.getVastMediaBitrate=tp.prototype.getVastMediaBitrate,tp.prototype.getDescription=tp.prototype.getDescription,tp.prototype.getTitle=tp.prototype.getTitle,tp.prototype.getPositionInSequence=tp.prototype.getPositionInSequence,tp.prototype.getSequenceLength=tp.prototype.getSequenceLength,tp.prototype.setMuted=tp.prototype.setMuted,tp.prototype.resize=tp.prototype.resize,tp.prototype.isLinear=tp.prototype.isLinear,tp.prototype.isMuted=tp.prototype.isMuted,tp.prototype.setVolume=tp.prototype.setVolume,tp.prototype.getVolume=tp.prototype.getVolume,tp.prototype.play=tp.prototype.play,tp.prototype.pause=tp.prototype.pause,tp.prototype.skip=tp.prototype.skip,tp.prototype.canSkipNow=tp.prototype.canSkipNow,tp.prototype.getTimeUntilSkippable=tp.prototype.getTimeUntilSkippable,tp.prototype.isSkippable=tp.prototype.isSkippable,tp.prototype.isPaused=tp.prototype.isPaused,tp.prototype.getRemainingTime=tp.prototype.getRemainingTime,tp.prototype.getMinSuggestedDuration=tp.prototype.getMinSuggestedDuration,tp.prototype.getDuration=tp.prototype.getDuration,tp.prototype.isUsingAnotherMediaElement=tp.prototype.isUsingAnotherMediaElement,tp.prototype.hasCustomClick=tp.prototype.hasCustomClick,tp.prototype.isClientRendering=tp.prototype.isClientRendering,tp.prototype.needsSkipUI=tp.prototype.needsSkipUI,(i=np.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(ip,Lr),(i=ip.prototype).setLocale=function(e){this.o=e},i.configure=function(e){this.l=e,this.g&&this.g.configure(this.l),this.j&&this.j.configure(this.l),this.h&&this.h.configure(this.l)},i.initInterstitial=function(e,t,n){var i=this;this.g&&this.g.release(),this.g=new Ph(e,t,n,(function(e){return rp(i,e)})),this.g.configure(this.l)},i.initClientSide=function(t,n,i){var r=this;if(!e.google||!google.ima||!google.ima.AdsLoader)throw new Ne(2,10,1e4);this.j&&this.j.release(),this.j=new kh(t,n,this.o,i,(function(e){return rp(r,e)})),this.j.configure(this.l)},i.release=function(){this.g&&(this.g.release(),this.g=null),this.j&&(this.j.release(),this.j=null),this.i&&(this.i.release(),this.i=null),this.h&&(this.h.release(),this.h=null),Lr.prototype.release.call(this)},i.onAssetUnload=function(){this.g&&this.g.stop(),this.j&&this.j.stop(),this.i&&this.i.stop(),this.h&&this.h.stop(),this.dispatchEvent(new Dr("ad-stopped")),this.dispatchEvent(new Dr("ad-content-attach-requested")),this.m=new bh},i.requestClientSideAds=function(e){if(!this.j)throw new Ne(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 Ne(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 Xh(e,t,n,(function(e){return rp(i,e)}))},i.requestMediaTailorStream=function(e,t,n){if(!this.i)throw new Ne(1,10,10005);var i=this.i;return n=void 0===n?"":n,i.l?e=Promise.reject(new Ne(1,10,10004)):(i.l=new Sr,function(e,t,n){var i,r,a,o,s,u,l,c,d,h,p,f;R((function(g){if(1==g.g)return i={type:7},(r=Br([t],{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4})).method="POST",n&&(a=JSON.stringify(n),r.body=Fe(a)),o=e.K.request(7,r,i),x(g,2),w(g,o.promise,4);if(2!=g.g){if(s=g.h,u=Ue(s.data),!(l=JSON.parse(u)).manifestUrl||!l.trackingUrl)throw Error("Insufficient data from MediaTailor.");return c=new de(t),d=new de(l.trackingUrl),e.G=c.resolve(d).toString(),h=Date.now()/1e3,p=h-e.P,e.i(new Dr("ads-loaded",(new Map).set("loadTime",p))),f=new de(l.manifestUrl),e.l.resolve(c.resolve(f).toString()),e.l=null,A(g,0)}if(k(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.P=Date.now()/1e3,e=i.l),e},i.addMediaTailorTrackingUrl=function(e){if(!this.i)throw new Ne(1,10,10005);var t=this.i;t.G=e,t.i(new Dr("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 Ne(2,10,10002);this.h&&this.h.release(),this.h=new np(t,n,this.o,(function(e){return rp(i,e)})),this.h.configure(this.l)},i.requestServerSideStream=function(e,t){if(t=void 0===t?"":t,!this.h)throw new Ne(1,10,10003);e.adTagParameters||(e.adTagParameters={});var n=e.adTagParameters;return(n.mpt||n.mpv)&&q('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 overridden.'),e.adTagParameters.mpt="shaka-player",e.adTagParameters.mpv="v4.15.8",(n=this.h).j?e=Promise.reject(new Ne(1,10,10004)):(e instanceof google.ima.dai.api.LiveStreamRequest&&(n.G=!0),n.j=new Sr,n.g.requestStream(e),n.B=t||"",n.F=Date.now()/1e3,e=n.j),e},i.replaceServerSideAdTagParameters=function(e){if(!this.h)throw new Ne(1,10,10003);(e.mpt||e.mpv)&&q('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 overridden.'),e.mpt="Shaka Player",e.mpv="v4.15.8",this.h.g.replaceAdTagParameters(e)},i.getServerSideCuePoints=function(){return oe("AdManager.getServerSideCuePoints","Please use getCuePoints function."),this.getCuePoints()},i.getCuePoints=function(){var e=[];return this.h&&(e=e.concat(this.h.getCuePoints())),this.i&&(e=e.concat(this.i.getCuePoints())),e},i.getStats=function(){var e=this.m;return{loadTimes:e.g,averageLoadTime:wh(e),started:e.h,overlayAds:e.j,playedCompletely:e.l,skipped:e.m,errors:e.i}},i.onManifestUpdated=function(e){this.i&&this.i.onManifestUpdated(e)},i.onDashTimedMetadata=function(e){this.h&&"urn:google:dai:2018"==e.schemeIdUri&&this.h.g.processMetadata(e.schemeIdUri,e.eventNode?e.eventNode.attributes.messageData:null,e.startTime)},i.onHlsTimedMetadata=function(e,t){this.h&&this.h.g.processMetadata("ID3",e.data,t)},i.onCueMetadataChange=function(e){this.h&&this.h.onCueMetadataChange(e)},i.onHLSInterstitialMetadata=function(e,t,n){this.l&&this.l.disableHLSInterstitial||(this.g||this.initInterstitial(null,e,t),this.g&&function(e,t){var n;R((function(i){if(1==i.g)return Fh(e),w(i,function(e,t){var n,i,r,a,o,s,u,l,c,d,h,p,f,g,m,v,y,b,T,S,E,I,C,M,D,P,L,N,O,j,U,_,B,F,V,H,K,G,z,q,X;return R((function(R){switch(R.g){case 1:if(n=[],!t)return R.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 R.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")),p=c?0:null,(f=t.values.find((function(e){return"X-ENABLE-SKIP-AFTER"==e.key})))&&(g=f.data,p=parseFloat(g),isNaN(p)&&(p=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(p)&&(m=null)),b=null,(T=t.values.find((function(e){return"X-RESUME-OFFSET"==e.key})))&&(S=T.data,b=parseFloat(S),isNaN(b)&&(b=null)),E=null,(I=t.values.find((function(e){return"X-PLAYOUT-LIMIT"==e.key})))&&(C=I.data,E=parseFloat(C),isNaN(E)&&(E=null)),P=D=M=!1,(L=t.values.find((function(e){return"CUE"==e.key})))&&(N=L.data,M=N.includes("ONCE"),D=N.includes("PRE"),P=N.includes("POST")),O=!1,(j=t.values.find((function(e){return"X-TIMELINE-OCCUPIES"==e.key})))?(U=j.data,O=U.includes("RANGE")):!T&&e.C.V()&&(O=!D&&!P),i){if(!(_=i.data))return R.return(n);n.push({id:a,groupId:null,startTime:s,endTime:u,uri:_,mimeType:null,isSkippable:c,skipOffset:p,skipFor:m,canJump:d,resumeOffset:b,playoutLimit:E,once:M,pre:D,post:P,timelineRange:O,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null}),R.u(2);break}if(!r){R.u(2);break}return(B=r.data)?(x(R,4),w(R,Vh(e,B,{type:11}),6)):R.return(n);case 6:for(F=R.h,V=Ue(F),H=JSON.parse(V),(K=H["SKIP-CONTROL"])&&("number"==typeof(G=K["ENABLE-SKIP-AFTER"])&&(p=parseFloat(G),isNaN(G)&&(p=c?0:null)),"number"==typeof(z=K["ENABLE-SKIP-FOR"])&&(m=parseFloat(z),isNaN(z)&&(m=null))),q=0;q<H.ASSETS.length;q++)(X=H.ASSETS[q]).URI&&n.push({id:a+"_shaka_asset_"+q,groupId:a,startTime:s,endTime:u,uri:X.URI,mimeType:null,isSkippable:c,skipOffset:p,skipFor:m,canJump:d,resumeOffset:b,playoutLimit:E,once:M,pre:D,post:P,timelineRange:O,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null});A(R,2);break;case 4:k(R);case 2:return R.return(n)}}))}(e,t),2);(n=i.h).length?Nh(e,n):q("Unsupported HLS interstitial",t),T(i)}))}(this.g,n))},i.onDASHInterstitialMetadata=function(e,t,n){if(!this.l||!this.l.disableDASHInterstitial){var i=n.schemeIdUri;if("urn:mpeg:dash:event:alternativeMPD:insert:2025"==i||"urn:mpeg:dash:event:alternativeMPD:replace:2025"==i){if(this.g||this.initInterstitial(null,e,t),this.g&&(e=this.g,t="urn:mpeg:dash:event:alternativeMPD:replace:2025"==n.schemeIdUri,i="urn:mpeg:dash:event:alternativeMPD:insert:2025"==n.schemeIdUri,t||i)){for(var r,a=n.startTime,o=n.endTime,s=null,u=0,c=l(n.eventNode.children),d=c.next();!d.done;d=c.next())if("AlternativeMPD"==(d=d.value).tagName){if(d=d.attributes.uri){r=d;break}}else if("InsertPresentation"==d.tagName||"ReplacePresentation"==d.tagName){var h=d.attributes.url;if(h){r=h,(c=Zt(d,"maxDuration",sn))&&(s=c/n.timescale),(c=Zt(d,"returnOffset",sn))&&(u=c/n.timescale),t&&u&&(o=a+u);break}}r&&Nh(e,[{id:n.id,groupId:null,startTime:a,endTime:o,uri:r,mimeType:null,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!0,resumeOffset:i?u:null,playoutLimit:s,once:!1,pre:!1,post:!1,timelineRange:t&&!i,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null}])}}else("urn:mpeg:dash:event:2012"==i||"urn:scte:dash:scte214-events"==i)&&n.eventNode&&$t(n.eventNode,"OverlayEvent")&&(this.g||this.initInterstitial(null,e,t),this.g&&function(e,t){var n=$t(t.eventNode,"OverlayEvent"),i=n.attributes.uri,r=n.attributes.mimeType,a="true"==n.attributes.loop,o=Zt(n,"z",sn);if(i&&0!=o){var s=null,u=$t(n,"Background");if(u){var l=u.attributes.uri;s=l?"center / contain no-repeat url('"+l+"')":Yt(u)}u=1920,l=1080;var c=$t(n,"Viewport");if(c){if(null==(u=Zt(c,"x",sn)))return;if(null==(l=Zt(c,"y",sn)))return}var d={viewport:{x:u,y:l},topLeft:{x:0,y:0},size:{x:u,y:l}},h=$t(n,"Overlay");if(c&&h){var p=$t(h,"TopLeft"),f=$t(h,"Size");if(p&&f){if(null==(h=Zt(p,"x",sn)))return;if(null==(p=Zt(p,"y",sn)))return;var g=Zt(f,"x",sn);if(null==g)return;if(null==(f=Zt(f,"y",sn)))return;d.topLeft.x=h,d.topLeft.y=p,d.size.x=g,d.size.y=f}}if(h=null,n=$t(n,"Squeeze"),c&&n&&(f=$t(n,"TopLeft"),n=$t(n,"Size"),f&&n)){if(null==(c=Zt(f,"x",sn)))return;if(null==(h=Zt(f,"y",sn)))return;if(null==(f=Zt(n,"x",sn)))return;if(null==(n=Zt(n,"y",sn)))return;h={viewport:{x:u,y:l},topLeft:{x:c,y:h},size:{x:f,y:n}}}Nh(e,[{id:t.id,groupId:null,startTime:t.startTime,endTime:t.endTime,uri:i,mimeType:r,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!0,resumeOffset:null,playoutLimit:null,once:!1,pre:!1,post:!1,timelineRange:!0,loop:a,overlay:d,displayOnBackground:-1==o,currentVideo:h,background:s}])}}(this.g,n))}},i.addCustomInterstitial=function(e){if(!this.g)throw new Ne(1,10,10006);Nh(this.g,[e])},i.addAdUrlInterstitial=function(e){if(!this.g)throw new Ne(1,10,10006);return this.g.addAdUrlInterstitial(e)},i.getInterstitialPlayer=function(){if(!this.g)throw new Ne(1,10,10006);return this.g.od()},F("shaka.ads.AdManager",ip),ip.prototype.getInterstitialPlayer=ip.prototype.getInterstitialPlayer,ip.prototype.addAdUrlInterstitial=ip.prototype.addAdUrlInterstitial,ip.prototype.addCustomInterstitial=ip.prototype.addCustomInterstitial,ip.prototype.onDASHInterstitialMetadata=ip.prototype.onDASHInterstitialMetadata,ip.prototype.onHLSInterstitialMetadata=ip.prototype.onHLSInterstitialMetadata,ip.prototype.onCueMetadataChange=ip.prototype.onCueMetadataChange,ip.prototype.onHlsTimedMetadata=ip.prototype.onHlsTimedMetadata,ip.prototype.onDashTimedMetadata=ip.prototype.onDashTimedMetadata,ip.prototype.onManifestUpdated=ip.prototype.onManifestUpdated,ip.prototype.getStats=ip.prototype.getStats,ip.prototype.getCuePoints=ip.prototype.getCuePoints,ip.prototype.getServerSideCuePoints=ip.prototype.getServerSideCuePoints,ip.prototype.replaceServerSideAdTagParameters=ip.prototype.replaceServerSideAdTagParameters,ip.prototype.requestServerSideStream=ip.prototype.requestServerSideStream,ip.prototype.initServerSide=ip.prototype.initServerSide,ip.prototype.addMediaTailorTrackingUrl=ip.prototype.addMediaTailorTrackingUrl,ip.prototype.requestMediaTailorStream=ip.prototype.requestMediaTailorStream,ip.prototype.initMediaTailor=ip.prototype.initMediaTailor,ip.prototype.updateClientSideAdsRenderingSettings=ip.prototype.updateClientSideAdsRenderingSettings,ip.prototype.requestClientSideAds=ip.prototype.requestClientSideAds,ip.prototype.onAssetUnload=ip.prototype.onAssetUnload,ip.prototype.release=ip.prototype.release,ip.prototype.initClientSide=ip.prototype.initClientSide,ip.prototype.initInterstitial=ip.prototype.initInterstitial,ip.prototype.configure=ip.prototype.configure,ip.prototype.setLocale=ip.prototype.setLocale,ip.ADS_LOADED="ads-loaded",ip.AD_STARTED="ad-started",ip.AD_FIRST_QUARTILE="ad-first-quartile",ip.AD_MIDPOINT="ad-midpoint",ip.AD_THIRD_QUARTILE="ad-third-quartile",ip.AD_COMPLETE="ad-complete",ip.AD_STOPPED="ad-stopped",ip.AD_SKIPPED="ad-skipped",ip.AD_VOLUME_CHANGED="ad-volume-changed",ip.AD_MUTED="ad-muted",ip.AD_PAUSED="ad-paused",ip.AD_RESUMED="ad-resumed",ip.AD_SKIP_STATE_CHANGED="ad-skip-state-changed",ip.CUEPOINTS_CHANGED="ad-cue-points-changed",ip.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded",ip.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded",ip.AD_CLICKED="ad-clicked",ip.AD_PROGRESS="ad-progress",ip.AD_BUFFERING="ad-buffering",ip.AD_IMPRESSION="ad-impression",ip.AD_DURATION_CHANGED="ad-duration-changed",ip.AD_CLOSED="ad-closed",ip.AD_LOADED="ad-loaded",ip.ALL_ADS_COMPLETED="all-ads-completed",ip.AD_LINEAR_CHANGED="ad-linear-changed",ip.AD_METADATA="ad-metadata",ip.AD_RECOVERABLE_ERROR="ad-recoverable-error",ip.AD_ERROR="ad-error",ip.AD_BREAK_READY="ad-break-ready",ip.AD_INTERACTION="ad-interaction",ip.AD_CONTENT_PAUSE_REQUESTED="ad-content-pause-requested",ip.AD_CONTENT_RESUME_REQUESTED="ad-content-resume-requested",ip.AD_CONTENT_ATTACH_REQUESTED="ad-content-attach-requested",vh=function(){return new ip};var sp="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),up="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),lp=["loop","playbackRate"],cp=["pause","play"],dp=(new Map).set("getAssetUri",2).set("getAudioLanguages",4).set("getAudioLanguagesAndRoles",4).set("getBufferFullness",1).set("getBufferedInfo",2).set("getExpiration",2).set("getKeyStatuses",2).set("getPlaybackRate",2).set("getTextLanguages",4).set("getTextLanguagesAndRoles",4).set("isAudioOnly",10).set("isBuffering",1).set("isInProgress",1).set("isLive",10).set("isTextTrackVisible",1).set("isVideoOnly",10).set("keySystem",10).set("seekRange",1).set("getLoadMode",10).set("getManifestType",10).set("isFullyLoaded",1).set("isEnded",1),hp=(new Map).set("getConfiguration",4).set("getConfigurationForLowLatency",4).set("getStats",5).set("getAudioTracks",2).set("getChaptersTracks",2).set("getImageTracks",2).set("getVideoTracks",2).set("getTextTracks",2).set("getVariantTracks",2),pp=(new Map).set("getPlayheadTimeAsDate",1).set("getPresentationStartTimeAsDate",20).set("getSegmentAvailabilityDuration",20),fp=[["getConfiguration","configure","getConfigurationForLowLatency","configurationForLowLatency"]],gp=[["isTextTrackVisible","setTextTrackVisibility"]],mp="cancelTrickPlay configure configurationForLowLatency getChapters resetConfiguration retryStreaming selectAudioLanguage selectAudioTrack selectTextLanguage selectTextTrack selectVariantTrack selectVariantsByLabel selectVideoTrack setTextTrackVisibility trickPlay updateStartTime goToLive useTrickPlayTrackIfAvailable".split(" "),vp="addChaptersTrack addTextTrackAsync addThumbnailsTrack getAllThumbnails getChaptersAsync getThumbnails attach attachCanvas detach load unload".split(" ");function yp(e,t,n,i,r,a,o){var s=this;this.G=e,this.K=o,this.l=new Ti(t),this.L=n,this.s=!1,this.A=i,this.F=r,this.M=a,this.i=this.m=!1,this.I="",this.o=null,this.B=function(){return xp(s)},this.C=function(e,t){switch((e=op(t)).type){case"event":var n=e.targetName,i=Pr(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(r=e.id,i=e.error,t=e.res,e=s.h.get(r),s.h.delete(r),e)if(i){for(n in r=new Ne(i.severity,i.category,i.code),i)r[n]=i[n];e.reject(r)}else e.resolve(t)}},this.g={video:{},player:{}},this.H=0,this.h=new Map,this.j=null,Mp.add(this)}function bp(e,t){var n=e.M();Ip=t,t.addUpdateListener(e.B),t.addMessageListener("urn:x-cast:com.google.shaka.v2",e.C),xp(e),Ap(e,{type:"init",initState:n,appData:e.o}),e.j.resolve()}function wp(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 Ne(2,8,n,t))}function Tp(e){var t=Ip;t.removeUpdateListener(e.B),t.removeMessageListener("urn:x-cast:com.google.shaka.v2",e.C)}function xp(e){var t=!!Ip&&"connected"==Ip.status;if(e.i&&!t){for(var n in e.F(),e.g)e.g[n]={};Sp(e)}e.i=t,e.I=t?Ip.receiver.friendlyName:"",e.l.Jb()}function Sp(e){if(e.h)for(var t=l(e.h.keys()),n=t.next();!n.done;n=t.next()){n=n.value;var i=e.h.get(n);e.h.delete(n),i.reject(new Ne(1,7,7e3))}}function Ap(e,t){t=ap(t);var n=Ip;try{n.sendMessage("urn:x-cast:com.google.shaka.v2",t,(function(){}),W)}catch(i){throw t=new Ne(2,8,8005,i),n=new Dr("error",(new Map).set("detail",t)),e.A("player",n),e.md(),t}}(i=yp.prototype).destroy=function(){return Mp.delete(this),Sp(this),Ip&&Tp(this),this.l&&(this.l.stop(),this.l=null),this.F=this.A=null,this.i=this.m=!1,this.C=this.B=this.j=this.h=this.g=this.o=null,Promise.resolve()},i.vb=function(){return this.i},i.Zg=function(){return this.I},i.init=function(){if(this.G.length)if(e.chrome&&chrome.cast&&chrome.cast.isAvailable){this.m=!0,this.l.Jb();var t=new chrome.cast.SessionRequest(this.G,[],null,this.K,null);t=new chrome.cast.ApiConfig(t,(function(e){for(var t=l(Mp),n=t.next();!n.done;n=t.next()){var i=e;(n=n.value).j=new Sr,n.s=!0,bp(n,i)}}),(function(e){for(var t=l(Mp),n=t.next();!n.done;n=t.next())n=n.value,Ep="available"==e,n.l.Jb()}),"origin_scoped"),chrome.cast.initialize(t,(function(){}),(function(){})),Ep&&this.l.ia(kp),(t=Ip)&&t.status!=chrome.cast.SessionStatus.STOPPED?(this.j=new Sr,this.s=!0,bp(this,t)):Ip=null}else e.__onGCastApiAvailable!==Dp&&(Cp=e.__onGCastApiAvailable||null,e.__onGCastApiAvailable=Dp)},i.kh=function(e){this.o=e,this.i&&Ap(this,{type:"appData",appData:this.o})},i.cast=function(){var e=this;return R((function(t){if(!e.m)throw new Ne(1,8,8e3);if(!Ep)throw new Ne(1,8,8001);if(e.i)throw new Ne(1,8,8002);return e.j=new Sr,chrome.cast.requestSession((function(t){return bp(e,t)}),(function(t){return wp(e,t)})),w(t,e.j,0)}))},i.md=function(){if(this.i){if(Sp(this),Ip){Tp(this);try{Ip.stop((function(){}),(function(){}))}catch(e){}Ip=null}xp(this)}},i.get=function(e,t){var n=this;if("video"==e){if(cp.includes(t))return function(){return n.zi.apply(n,[e,t].concat(c(L.apply(0,arguments))))}}else if("player"==e){if(pp.has(t)&&!this.get("player","isLive")())return function(){};if(mp.includes(t))return function(){return n.zi.apply(n,[e,t].concat(c(L.apply(0,arguments))))};if(vp.includes(t))return function(){return n.Hk.apply(n,[e,t].concat(c(L.apply(0,arguments))))};if(dp.has(t)||hp.has(t))return function(){return n.g[e][t]}}return this.g[e][t]},i.set=function(e,t,n){this.g[e][t]=n,Ap(this,{type:"set",targetName:e,property:t,value:n})},i.zi=function(e,t){Ap(this,{type:"call",targetName:e,methodName:t,args:L.apply(2,arguments)})},i.Hk=function(e,t){var n=L.apply(2,arguments),i=new Sr,r=this.H.toString();this.H++,this.h.set(r,i);try{Ap(this,{type:"asyncCall",targetName:e,methodName:t,args:n,id:r})}catch(e){i.reject(e)}return i};var kp=.02,Ep=!1,Ip=null,Cp=null,Mp=new Set;function Dp(t){if(Cp?e.__onGCastApiAvailable=Cp:delete e.__onGCastApiAvailable,Cp=null,t)for(var n=l(Mp),i=n.next();!i.done;i=n.next())i.value.init();"function"==typeof e.__onGCastApiAvailable&&e.__onGCastApiAvailable(t)}function Pp(t,n,i,r){r=void 0!==r&&r,Lr.call(this);var a=this;this.i=t,this.h=n,this.l=this.o=this.m=this.s=this.j=null,this.H=i,this.G=r,this.C=[],this.B=[],this.A=[],this.F=new Map,this.g=null,e.chrome?(this.g=new yp(i,(function(){return Np(a)}),(function(){return Op(a)}),(function(e,t){return Bp(a,e,t)}),(function(){return jp(a)}),(function(){return Lp(a)}),r),function(e){e.g.init(),e.l=new $;for(var t=l(sp),n=t.next();!n.done;n=t.next())e.l.D(e.i,n.value,(function(t){e.g.vb()||(t=Pr(t),e.m.dispatchEvent(t))}));for(var i in Rr)e.l.D(e.h,Rr[i],(function(t){e.g.vb()||e.o.dispatchEvent(t)}));for(var r in e.j={},t={},e.i)(t={Xd:t.Xd}).Xd=r,Object.defineProperty(e.j,t.Xd,{configurable:!1,enumerable:!0,get:function(t){return function(){return Up(e,t.Xd)}}(t),set:function(t){return function(n){var i=t.Xd;e.g.vb()?e.g.set("video",i,n):e.i[i]=n}}(t)});e.s={},Rp(e,(function(t){Object.defineProperty(e.s,t,{configurable:!1,enumerable:!0,get:function(){return _p(e,t)}})})),function(e){var t=new Map;Rp(e,(function(n,i){t.has(i)?(i=t.get(i),n.length<i.length?e.F.set(n,i):e.F.set(i,n)):t.set(i,n)}))}(e),e.m=new Lr,e.m.ze=e.j,e.o=new Lr,e.o.ze=e.s,e.l.D(e.h,"unloading",(function(){e.g&&e.g.vb()||Fp(e)}))}(this)):(this.j=this.i,this.s=this.h)}function Rp(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 Lp(e){var t={video:{},player:{},playerAfterLoad:{},manifest:e.h.nd(),startTime:null,addThumbnailsTrackCalls:e.C,addTextTrackAsyncCalls:e.B,addChaptersTrackCalls:e.A};e.i.pause();for(var n=l(lp),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(fp)).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(gp)).next();!i.done;i=n.next())i=(r=i.value)[1],r=e.h[r[0]](),t.playerAfterLoad[i]=r;return t}function Np(e){var t=new Dr("caststatuschanged");e.dispatchEvent(t)}function Op(e){var t=new Dr(e.j.paused?"pause":"play");e.m.dispatchEvent(t)}function jp(e){for(var t=l(fp),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.C,a=e.B,o=e.A;Fp(e);var s=e.g.get("player","getAssetUri")();i=e.g.get("video","ended"),t=Promise.resolve();var u,d=e.i.autoplay;n=null,i||(n=e.g.get("video","currentTime")),(i=e.g.get("player","getTextTracks")())&&i.length&&(u=i.find((function(e){return e.active})));var h=e.g.get("player","isTextTrackVisible")();s&&(e.i.autoplay=!1,t=e.h.load(s,n));var p={};for(i=(n=l(lp)).next();!i.done;i=n.next())i=i.value,p[i]=e.g.get("video",i);t.then((function(){if(e.i){for(var t=l(r),n=t.next();!n.done;n=t.next()){var i;n=n.value,(i=e.od()).He.apply(i,c(n))}for(i=(t=l(a)).next();!i.done;i=t.next()){var f;i=i.value,(f=e.od()).Hd.apply(f,c(i))}for(t=(f=l(o)).next();!t.done;t=f.next()){var g;t=t.value,(g=e.od()).Ge.apply(g,c(t))}for(f=(g=l(lp)).next();!f.done;f=g.next())f=f.value,e.i[f]=p[f];for(f=(g=l(gp)).next();!f.done;f=g.next())f=(t=f.value)[1],t=e.g.get("player",t[0])(),e.h[f](t);e.h.oh(h),u&&e.h.ih(u.language,u.roles,u.forced),e.i.autoplay=d,s&&e.i.play()}}),(function(t){t=new Dr("error",t=(new Map).set("detail",t)),e.h.dispatchEvent(t)}))}function Up(e,t){if("addEventListener"==t)return function(t,n,i){return e.m.addEventListener(t,n,i)};if("removeEventListener"==t)return function(t,n,i){return e.m.removeEventListener(t,n,i)};if(e.g.vb()&&0==Object.keys(e.g.g.video).length){var n=e.i[t];if("function"!=typeof n)return n}return e.g.vb()?e.g.get("video",t):("function"==typeof(t=e.i[t])&&(t=t.bind(e.i)),t)}function _p(e,t,n){if(n=void 0!==n&&n,e.F.has(t)&&(t=e.F.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.j};if("getSharedConfiguration"==t)return e.g.get("player","getConfiguration");if("getNetworkingEngine"==t)return function(){return e.h.Pb()};if("getDrmEngine"==t)return function(){return e.h.C};if("getAdManager"==t)return function(){return e.h.Uh()};if("getQueueManager"==t)return function(){return e.h.$h()};if("setVideoContainer"==t)return function(t){return e.h.Oi(t)};if(!n){if("addThumbnailsTrack"==t)return function(){var n=L.apply(0,arguments);return e.C.push(n),_p(e,t,!0).apply(null,c(n))};if("addTextTrackAsync"==t)return function(){var n=L.apply(0,arguments);return e.B.push(n),_p(e,t,!0).apply(null,c(n))};if("addChaptersTrack"==t)return function(){var n=L.apply(0,arguments);return e.A.push(n),_p(e,t,!0).apply(null,c(n))}}if(e.g.vb()){if("getManifest"==t||"drmInfo"==t)return function(){return q(t+"() does not work while casting!"),null};if("attach"==t||"detach"==t)return function(){return q(t+"() does not work while casting!"),Promise.resolve()};if("getChapters"==t)return function(){return q(t+"() does not work while casting!"),[]}}return e.g.vb()&&0==Object.keys(e.g.g.video).length&&(dp.has(t)||hp.has(t))||!e.g.vb()?e.h[t].bind(e.h):e.g.get("player",t)}function Bp(e,t,n){e.g.vb()&&("video"==t?e.m.dispatchEvent(n):"player"==t&&("unloading"==n.type&&Fp(e),e.o.dispatchEvent(n)))}function Fp(e){e.C=[],e.B=[],e.A=[]}function Vp(e,t,n,i){Lr.call(this);var r=this;this.h=e,this.g=t,this.j=new $,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 Ti((function(){zp(r)})),function(e){var t=cast.receiver.CastReceiverManager.getInstance();t.onSenderConnected=function(){return Hp(e)},t.onSenderDisconnected=function(){return Hp(e)},t.onSystemVolumeChanged=function(){var t=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();t&&Yp(e,{type:"update",update:{video:{volume:t.level,muted:t.muted}}},e.l),Yp(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=op(t.data);switch(n.type){case"PLAY":e.h.play(),Jp(e);break;case"PAUSE":e.h.pause(),Jp(e);break;case"SEEK":t=n.currentTime;var i=n.resumeState;null!=t&&(e.h.currentTime=Number(t)),i&&"PLAYBACK_START"==i?(e.h.play(),Jp(e)):i&&"PLAYBACK_PAUSE"==i&&(e.h.pause(),Jp(e));break;case"STOP":e.g.vc().then((function(){e.g&&Jp(e)}));break;case"GET_STATUS":Xp(e,Number(n.requestId));break;case"VOLUME":t=(i=n.volume).level,i=i.muted;var r=e.h.volume,a=e.h.muted;null!=t&&(e.h.volume=Number(t)),null!=i&&(e.h.muted=i),r==e.h.volume&&a==e.h.muted||Jp(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.h.autoplay=!0),e.g.load(r,i).then((function(){e.g&&Xp(e)})).catch((function(t){var i="LOAD_FAILED";7==t.category&&7e3==t.code&&(i="LOAD_CANCELLED"),Yp(e,{requestId:Number(n.requestId),type:i},e.s)}));break;default:Yp(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=op(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,d,h,p,f,g,m,v,y,b,S,E,I,C;R((function(M){switch(M.g){case 1:for(i in t.player)r=t.player[i],e.g[i](r);return e.F(n),a=e.h.autoplay,t.manifest?(e.h.autoplay=!1,x(M,5),w(M,e.g.load(t.manifest,t.startTime),7)):w(M,Promise.resolve(),3);case 7:if(t.addThumbnailsTrackCalls)for(o=l(t.addThumbnailsTrackCalls),s=o.next();!s.done;s=o.next())u=s.value,e.g.He.apply(e.g,c(u));if(t.addTextTrackAsyncCalls)for(d=l(t.addTextTrackAsyncCalls),h=d.next();!h.done;h=d.next())p=h.value,e.g.Hd.apply(e.g,c(p));if(t.addChaptersTrackCalls)for(f=l(t.addChaptersTrackCalls),g=f.next();!g.done;g=f.next())m=g.value,e.g.Ge.apply(e.g,c(m));A(M,3);break;case 5:return v=k(M),y=(new Map).set("detail",v),b=new Dr("error",y),e.g&&e.g.dispatchEvent(b),M.return();case 3:if(!e.g)return M.return();for(S in t.video)E=t.video[S],e.h[S]=E;for(I in t.playerAfterLoad)C=t.playerAfterLoad[I],e.g[I](C);e.h.autoplay=a,t.manifest&&(e.h.play(),Jp(e)),T(M)}}))}(e,n.initState,n.appData),zp(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(t){return Wp(e,o,a,null,t)}),(function(t){return Wp(e,o,a,t,null)}))}}(e,t)},t.start();for(var n=(t=l(sp)).next();!n.done;n=t.next())e.j.D(e.h,n.value,(function(t){return Gp(e,"video",t)}));for(var i in Rr)e.j.D(e.g,Rr[i],(function(t){return Gp(e,"player",t)}));e.j.D(e.h,"loadeddata",(function(){e.B=!0})),e.j.D(e.g,"loading",(function(){e.o=!1,Kp(e)})),e.j.D(e.h,"playing",(function(){e.o=!1,Kp(e)})),e.j.D(e.h,"pause",(function(){Kp(e)})),e.j.D(e.g,"unloading",(function(){e.o=!0,Kp(e)})),e.j.D(e.h,"ended",(function(){new Ti((function(){e.h&&e.h.ended&&(e.o=!0,Kp(e))})).ia(Qp)}))}(this)}function Hp(e){e.m=0,e.A=!0,e.G=0!=cast.receiver.CastReceiverManager.getInstance().getSenders().length,Kp(e)}function Kp(e){var t;R((function(n){return 1==n.g?w(n,Promise.resolve(),2):e.g?(t=new Dr("caststatuschanged"),e.dispatchEvent(t),qp(e)||Jp(e),void T(n)):n.return()}))}function Gp(e,t,n){e.g&&(zp(e),Yp(e,{type:"event",targetName:t,event:n},e.l))}function zp(e){e.C.ia($p);for(var t={video:{},player:{}},n=l(up),i=n.next();!i.done;i=n.next())i=i.value,t.video[i]=e.h[i];e.g.V()&&pp.forEach((function(n,i){0==e.m%n&&(t.player[i]=e.g[i]())})),dp.forEach((function(n,i){0==e.m%n&&(t.player[i]=e.g[i]())})),(n=cast.receiver.CastReceiverManager.getInstance().getSystemVolume())&&(t.video.volume=n.level,t.video.muted=n.muted),Yp(e,{type:"update",update:t},e.l),hp.forEach((function(t,n){0==e.m%t&&((t={player:{}}).player[n]=e.g[n](),Yp(e,{type:"update",update:t},e.l))})),e.B&&(e.m+=1),qp(e)}function qp(e){return!(!e.A||!e.h.duration&&!e.g.V()||(Xp(e),e.A=!1,0))}function Xp(e,t){var n={contentId:e.g.nd(),streamType:e.g.V()?"LIVE":"BUFFERED",contentType:""};e.g.V()||(n.duration=e.h.duration),e.i&&(n.metadata=e.i),Jp(e,void 0===t?0:t,n)}function Wp(e,t,n,i,r){e.g&&Yp(e,{type:"asyncComplete",id:n,error:i,res:r},e.l,t)}function Yp(e,t,n,i){e.G&&(e=ap(t),i?n.getCastChannel(i).send(e):n.broadcast(e))}function Jp(e,t,n){n=void 0===n?null:n;var i={mediaSessionId:0,playbackRate:e.h.playbackRate,playerState:e.o?Zp:e.g.Mg()?tf:e.h.paused?nf:ef,currentTime:e.h.currentTime,supportedMediaCommands:63,volume:{level:e.h.volume,muted:e.h.muted}};n&&(i.media=n),Yp(e,{requestId:void 0===t?0:t,type:"MEDIA_STATUS",status:[i]},e.s)}m(Pp,Lr),(i=Pp.prototype).destroy=function(e){return this.g&&void 0!==e&&e&&this.g.md(),this.l&&(this.l.release(),this.l=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.j=this.i=null,Lr.prototype.release.call(this),Promise.all(e)},i.Xj=function(){return this.j},i.od=function(){return this.s},i.hj=function(){return!!this.g&&this.g.m&&Ep},i.vb=function(){return!!this.g&&this.g.vb()},i.Zg=function(){return this.g?this.g.Zg():""},i.cast=function(){var e=this;return R((function(t){return 1==t.g?e.g?w(t,e.g.cast(),2):t.return():e.h?w(t,e.h.vc(),0):t.return()}))},i.kh=function(e){this.g&&this.g.kh(e)},i.Wk=function(){var e;this.g&&(e=this.g).i&&chrome.cast.requestSession((function(t){return bp(e,t)}),(function(t){return wp(e,t)}))},i.md=function(){this.g&&this.g.md()},i.ij=function(e,t){t=void 0!==t&&t;var n=this;return R((function(i){if(1==i.g)return e==n.H&&t==n.G?i.return():(n.H=e,n.G=t,n.g?(n.g.md(),w(i,n.g.destroy(),2)):i.return());n.g=null,n.g=new yp(e,(function(){return Np(n)}),(function(){return Op(n)}),(function(e,t){return Bp(n,e,t)}),(function(){return jp(n)}),(function(){return Lp(n)}),t),n.g.init(),T(i)}))},F("shaka.cast.CastProxy",Pp),Pp.prototype.changeReceiverId=Pp.prototype.ij,Pp.prototype.forceDisconnect=Pp.prototype.md,Pp.prototype.suggestDisconnect=Pp.prototype.Wk,Pp.prototype.setAppData=Pp.prototype.kh,Pp.prototype.cast=Pp.prototype.cast,Pp.prototype.receiverName=Pp.prototype.Zg,Pp.prototype.isCasting=Pp.prototype.vb,Pp.prototype.canCast=Pp.prototype.hj,Pp.prototype.getPlayer=Pp.prototype.od,Pp.prototype.getVideo=Pp.prototype.Xj,Pp.prototype.destroy=Pp.prototype.destroy,m(Vp,Lr),(i=Vp.prototype).isConnected=function(){return this.G},i.ek=function(){return this.o},i.Tk=function(e){this.i=e},i.mj=function(){this.i=null},i.Uk=function(e){this.i||(this.i={metadataType:cast.receiver.media.MetadataType.GENERIC}),this.i.title=e},i.Sk=function(e){this.i||(this.i={metadataType:cast.receiver.media.MetadataType.GENERIC}),this.i.images=[{url:e}]},i.Rk=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 R((function(n){if(1==n.g)return t.j&&(t.j.release(),t.j=null),e=[],t.g&&(e.push(t.g.destroy()),t.g=null),t.C&&(t.C.stop(),t.C=null),t.h=null,t.H=null,t.F=null,t.G=!1,t.o=!0,t.l=null,t.s=null,Lr.prototype.release.call(t),w(n,Promise.all(e),2);cast.receiver.CastReceiverManager.getInstance().stop(),T(n)}))},F("shaka.cast.CastReceiver",Vp),Vp.prototype.destroy=Vp.prototype.destroy,Vp.prototype.setContentArtist=Vp.prototype.Rk,Vp.prototype.setContentImage=Vp.prototype.Sk,Vp.prototype.setContentTitle=Vp.prototype.Uk,Vp.prototype.clearContentMetadata=Vp.prototype.mj,Vp.prototype.setContentMetadata=Vp.prototype.Tk,Vp.prototype.isIdle=Vp.prototype.ek,Vp.prototype.isConnected=Vp.prototype.isConnected;var $p=.5,Qp=5,Zp="IDLE",ef="PLAYING",tf="BUFFERING",nf="PAUSED";function rf(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=af(i,r,s,u,l,c);a<=o;a++){for(var h=n[a],p=-1,f=-1,g=0;g<h.length;g++)if(null!=h[g]&&""!==h[g].g.trim()){p=g;break}for(g=h.length-1;0<=g;g--)if(null!=h[g]&&""!==h[g].g.trim()){f=g;break}if(-1===p||-1===f)h=of(i,r),e.nestedCues.push(h);else{for(;p<=f;p++)if(g=h[p]){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=af(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=of(i,r),e.nestedCues.push(d)),d=af(i,r,s,u,l,c)}}return e.nestedCues.length?{cue:e,stream:t}:null}function af(e,t,n,i,r,a){return e=new Tn(e,t,""),n&&e.textDecoration.push(zn),i&&(e.fontStyle=Kn),e.color=r,e.backgroundColor=a,e}function of(e,t){return(e=new Tn(e,t,"")).lineBreak=!0,e}function sf(e,t,n,i,r){this.g=e,this.l=t,this.i=n,this.h=i,this.j=r}function uf(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,cf(this)}function lf(e,t,n){var i="CC"+(1+(e.C<<1|e.B)),r=new Tn(t,n,"");r.lineInterpretation=1;var a=yf.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=rf(r,i,e.i,t,n))&&15<e.g+t.cue.nestedCues.length-3&&(a=yf.get(e.g+3-t.cue.nestedCues.length))&&(r.line=a),t}function cf(e){pf(e,0,15),e.g=1}function df(e,t,n){if(!(32>n||127<n)){var i="";switch(t){case 0:i=ff.has(n)?ff.get(n):String.fromCharCode(n);break;case 1:i=gf.get(n);break;case 2:e.i[e.g].pop(),i=mf.get(n);break;case 3:e.i[e.g].pop(),i=vf.get(n)}i&&e.i[e.g].push(new sf(i,e.m,e.j,e.o,e.l))}}function hf(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 pf(e,t,n){for(var i=0;i<=n;i++)e.i[t+i]=[]}var ff=new Map([[39,"’"],[42,"á"],[92,"é"],[92,"é"],[94,"í"],[95,"ó"],[96,"ú"],[123,"ç"],[124,"÷"],[125,"Ñ"],[126,"ñ"],[127,"█"]]),gf=new Map([[48,"®"],[49,"°"],[50,"½"],[51,"¿"],[52,"™"],[53,"¢"],[54,"£"],[55,"♪"],[56,"à"],[57," "],[58,"è"],[59,"â"],[60,"ê"],[61,"î"],[62,"ô"],[63,"û"]]),mf=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,"»"]]),vf=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,"┘"]]),yf=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 bf(e,t){this.h=0,this.o=new uf(e,t),this.i=new uf(e,t),this.g=this.j=new uf(e,t),this.l=0,this.m=null}function wf(e,t,n){e.g=e.i;var i=e.g,r=null;return 3!==e.h&&4!==e.h&&(r=lf(i,e.l,n),(n=e.i).g=0<n.h?n.h:0,pf(n,0,15),(n=e.j).g=0<n.h?n.h:0,pf(n,0,15),i.g=15),e.h=3,i.h=t,r}function Tf(e){e.h=1,e.g=e.j,e.g.h=0}function xf(e){X("Cea608DataChannel","CEA-608 text mode entered, but is unsupported"),e.g=e.o,e.h=4}var Sf="black green blue cyan red yellow magenta black".split(" "),Af="white green blue cyan red yellow magenta white_italics".split(" ");function kf(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",Ef(this)}function Ef(e){e.i=[];for(var t=0;16>t;t++)e.i.push(If())}function If(){for(var e=[],t=0;42>t;t++)e.push(null);return e}function Cf(e,t){Mf(e)&&(e.i[e.h][e.g]=new sf(t,e.C,e.A,e.s,e.B),e.g++)}function Mf(e){var t=e.g<e.m&&0<=e.g;return e.h<e.o&&0<=e.h&&t}function Df(e,t,n){var i=new Tn(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?kt: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=rf(i,"svc"+n,e.i,e.j,t))&&(e.j=t),n}function Pf(){this.i=[],this.h=null,this.g=0}function Rf(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 Lf(e.h)),e.h=null,e.g=0))}function Lf(e){this.g=0,this.h=e}function Nf(e){if(!e.Ga())throw new Ne(2,2,3e3);return e.h[e.g++]}function Of(e){this.i=e,this.h=[null,null,null,null,null,null,null,null],this.g=null}function jf(e,t,n,i){if(!e.g)return[];if(24==n)return n=[n=Nf(t).value,i=Nf(t).value].map((function(e){return("0"+(255&e).toString(16)).slice(-2)})).join(""),Cf(e.g,String.fromCharCode(parseInt(n,16))),[];t=e.g;var r=null;switch(n){case 8:!Mf(t)||0>=t.g&&0>=t.h||(0>=t.g?(t.g=t.m-1,t.h--):t.g--,t.i[t.h][t.g]=null);break;case 13:t.isVisible()&&(r=Df(t,i,e.i)),t.h+1>=t.o?function(e){for(var t=0,n=1;16>n;n++,t++)e.i[t]=e.i[n];for(n=0;1>n;n++,t++)e.i[t]=If()}(t):t.h++,t.g=0;break;case 14:t.isVisible()&&(r=Df(t,i,e.i)),t.i[t.h]=If(),t.g=0;break;case 12:t.isVisible()&&(r=Df(t,i,e.i)),Ef(t),t.h=0,t.g=0}return r?[r]:[]}function Uf(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=Nf(t).value,t=[];for(var r=(n=l(_f(e,n))).next();!r.done;r=n.next()){if((r=e.h[r.value]).isVisible()){var a=Df(r,i,e.i);a&&t.push(a)}Ef(r)}return t}if(137===n)for(n=(t=l(_f(e,t=Nf(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=Nf(t).value,t=null,r=(n=l(_f(e,n))).next();!r.done;r=n.next())(r=e.h[r.value]).isVisible()&&(t=Df(r,i,e.i)),r.l=!1;return t?[t]:[]}if(139===n){for(n=Nf(t).value,t=null,r=(n=l(_f(e,n))).next();!r.done;r=n.next())(r=e.h[r.value]).isVisible()?t=Df(r,i,e.i):r.j=i,r.l=!r.l;return t?[t]:[]}if(140===n)return Bf(e,t=Nf(t).value,i);if(143===n)return i=Bf(e,255,i),Ff(e),i;if(144===n)t.skip(1),i=Nf(t).value,e.g&&(e.g.A=0<(128&i),e.g.C=0<(64&i));else if(145===n)i=Nf(t).value,n=Nf(t).value,t.skip(1),e.g&&(t=Vf((48&n)>>4,(12&n)>>2,3&n),e.g.B=Vf((48&i)>>4,(12&i)>>2,3&i),e.g.s=t);else if(146===n)i=Nf(t).value,t=Nf(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=Nf(t).value,t.skip(1),e.g&&(e.g.F=3&i);else if(152<=n&&159>=n){n=(15&n)-8,(r=null!==e.h[n])||((a=new kf(n,e.i)).j=i,e.h[n]=a),i=Nf(t).value,a=Nf(t).value;var o=Nf(t).value,s=Nf(t).value,u=Nf(t).value;t=Nf(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[]}function _f(e,t){for(var n=[],i=0;8>i;i++)!(1&~t)&&e.h[i]&&n.push(i),t>>=1;return n}function Bf(e,t,n){for(var i=[],r=(t=l(_f(e,t))).next();!r.done;r=t.next()){r=r.value;var a=e.h[r];a.isVisible()&&(a=Df(a,n,e.i))&&i.push(a),e.h[r]=null}return i}function Ff(e){e.g=null,e.h=[null,null,null,null,null,null,null,null]}function Vf(e,t,n){var i={0:0,1:0,2:1,3:1};return Kf[(e=i[e])<<2|(t=i[t])<<1|(n=i[n])]}kf.prototype.isVisible=function(){return this.l},kf.prototype.display=function(){this.l=!0},Lf.prototype.Ga=function(){return this.g<this.h.length},Lf.prototype.Ma=function(){return this.g},Lf.prototype.skip=function(e){if(this.g+e>this.h.length)throw new Ne(2,2,3e3);this.g+=e},Lf.prototype.Ei=function(e){if(0>this.g-e)throw new Ne(2,2,3e3);this.g-=e};var Hf=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,"┌"]]),Kf="black blue green cyan red magenta yellow white".split(" ");function Gf(){this.h=[],this.g=[],this.i=new Pf,this.l=0,this.m=new Map([["CC1",new bf(0,0)],["CC2",new bf(0,1)],["CC3",new bf(1,0)],["CC4",new bf(1,1)]]),this.s=this.o=0,this.j=new Map,this.B=!0,this.A=new Set,zf(this)}function zf(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,cf(n.i),cf(n.j),cf(n.o);e.B=!0}function qf(e,t){var n=t.type;if(16==(112&t.Bb)){var i=t.Bb>>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.Bb&&255===t.hc||!t.Bb&&!t.hc||!Wf(t.Bb)||!Wf(t.hc))return 45<=++e.l&&zf(e),null;e.l=0,t.Bb&=127,t.hc&=127;var r=t.Bb;if(1<=r&&15>=r||!t.Bb&&!t.hc)return null;if(r=null,16==(112&t.Bb))e:{if(e.A.add(i),i=t.Bb,e=t.hc,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=Af[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&&(hf(o,n=1+t-o.h,1+o.g-o.h,o.h),pf(o,0,n-1),pf(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",df(n.g,0,32),i=!1,"white_italics"===(t=Af[(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=Sf[(14&e)>>1]),n.g.o=t;else if(17==(247&i)&&48==(240&e))df(n.g,1,e);else if(18==(246&i)&&32==(224&e))df(n.g,1&i?3:2,e);else{if(20==(246&i)&&32==(240&e)){switch(e=t.pts,i=null,t.hc){case 32:Tf(n);break;case 33:(n=n.g).i[n.g].pop();break;case 37:i=wf(n,2,e);break;case 38:i=wf(n,3,e);break;case 39:i=wf(n,4,e);break;case 40:df(n.g,0,32);break;case 41:n.h=2,n.g=n.i,n.g.h=0,n.l=e;break;case 42:cf(n.o),xf(n);break;case 43:xf(n);break;case 44:t=n.i,i=null,4!==n.h&&(i=lf(t,n.l,e)),pf(t,0,15);break;case 45:t=n.g,3!==n.h?i=null:(i=lf(t,n.l,e),hf(t,(r=t.g-t.h+1)-1,r,t.h),pf(t,0,r-1),pf(t,t.g,15-t.g),n.l=e);break;case 46:pf(n.j,0,15);break;case 47:t=null,4!==n.h&&(t=lf(n.i,n.l,e)),i=n.j,n.j=n.i,n.i=i,Tf(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.hc,df(n.g,0,t.Bb),df(n.g,0,e);return r}function Xf(e,t){var n=[];try{for(;t.Ga();){var i=Nf(t).value,r=(224&i)>>5,a=31&i;if(7===r&&0!=a&&(r=63&Nf(t).value),0!=r){e.A.add("svc"+r),e.j.has(r)||e.j.set(r,new Of(r));for(var o=e.j.get(r),s=t.Ma();t.Ma()-s<a;){r=o;var u=t,l=Nf(u),d=l.value,h=l.pts;if(16===d&&(d=d<<16|Nf(u).value),0<=d&&31>=d)var p=jf(r,u,d,h);else if(128<=d&&159>=d)p=Uf(r,u,d,h);else{if(4096<=d&&4127>=d)r=u,8<=(u=255&d)&&15>=u?r.skip(1):16<=u&&23>=u?r.skip(2):24<=u&&31>=u&&r.skip(3);else if(4224<=d&&4255>=d)r=u,128<=(u=255&d)&&135>=u?r.skip(4):136<=u&&143>=u&&r.skip(5);else if(32<=d&&127>=d)u=d,r.g&&Cf(r.g,127===u?"♪":String.fromCharCode(u));else if(160<=d&&255>=d)r.g&&Cf(r.g,String.fromCharCode(d));else if(4128<=d&&4223>=d){if(u=255&d,r.g)if(Hf.has(u)){var f=Hf.get(u);Cf(r.g,f)}else Cf(r.g,"_")}else 4256<=d&&4351>=d&&r.g&&Cf(r.g,160!=(255&d)?"_":"[CC]");p=[]}n.push.apply(n,c(p))}}}}catch(e){if(!(e instanceof Ne&&3e3===e.code))throw e;X("CEA708_INVALID_DATA","Buffer read out of bounds / invalid CEA-708 Data.")}return n}function Wf(e){for(var t=0;e;)t^=1&e,e>>=1;return 1===t}function Yf(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 Jf(){this.j=new Map,this.i=this.h=0,this.g=Qf}function $f(e,t,n,i,r,a,o,s,u){var d=0,h=a,p=s.map((function(e){return e.gh}));for((p=[].concat.apply([],c(p))).length&&(h=p[0].sampleSize||a),t.skip(o+s[0].mg);t.Ga();){o=t.T();var f=t.X(),g=null;switch(g=!1,s=1,e.g){case Zf:g=6==(g=31&f);break;case eg:s=2,t.skip(1),g=39==(g=f>>1&63)||40==g;break;case tg:s=2,t.skip(1),g=23==(g=f>>1&63)||24==g;break;default:return}if(g)for(f=0,d<p.length&&(f=p[d].Bf||0),f=(n+f)/i,g=(s=l(Yf(t.Ub(o-s)))).next();!g.done;g=s.next())u.push({packet:g.value,pts:f});else try{t.skip(o-s)}catch(e){break}0==(h-=o+4)&&(n=d<p.length?n+(p[d].hh||r):n+r,h=++d<p.length&&p[d].sampleSize||a)}}Gf.prototype.clear=function(){this.l=0,this.h=[],this.g=[];var e=this.i;e.i=[],e.h=[],e.g=0,zf(this);for(var t=(e=l(this.j.values())).next();!t.done;t=e.next())Ff(t.value)},Gf.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 Qr(e,0)).getLength())&&181===e.X()&&49===e.Ba()&&1195456820===e.T()&&3===e.X()&&64&(n=e.X()))for(n&=31,e.skip(1),i=0;i<n;i++){var r=e.X(),a=(4&r)>>2,o=e.X(),s=e.X();a&&(0==(r&=3)||1===r?this.h.push({pts:t,type:r,Bb:o,hc: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})))}},Gf.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=qf(this,i.value))&&t.push(i);for(i=(n=l(this.g)).next();!i.done;i=n.next())Rf(this.i,i.value);for(i=(n=l(this.i.i)).next();!i.done;i=n.next())i=Xf(this,i.value),t.push.apply(t,c(i));return this.i.i=[],this.h=[],this.g=[],t},Gf.prototype.getStreams=function(){return Array.from(this.A)},F("shaka.cea.CeaDecoder",Gf),St=function(){return new Gf},Jf.prototype.init=function(e){function t(e){e=e.name,ng.has(e)&&(n.g=ng.get(e))}var n=this,i=[],r=[];if((new ta).box("moov",na).box("mvex",na).R("trex",(function(e){var t=e.reader;t.skip(4),t.skip(4),e=t.T(),t=t.T(),n.h=e,n.i=t})).box("trak",na).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.T();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.Ba(),t.Ba(),t.Ba(),t.Ba(),i.push(n)})).box("mdia",na).R("mdhd",(function(e){e=no(e.reader,e.version),r.push(e.timescale)})).box("minf",na).box("stbl",na).R("stsd",ia).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",ra).box("sinf",na).box("frma",(function(e){e=ao(e.reader).codec,ng.has(e)&&(n.g=ng.get(e))})).parse(e,!0,!0),!i.length||!r.length||i.length!=r.length)throw new Ne(2,2,2010);this.g==Qf&&q("Unable to determine bitstream format for CEA parsing!"),i.forEach((function(e,t){n.j.set(e,r[t])}))},Jf.prototype.parse=function(e){var t=this;if(this.g==Qf)return[];var n=[],i=0,r=[];return(new ta).box("moof",(function(e){i=e.start,r=[],na(e)})).box("traf",(function(e){r.push({baseMediaDecodeTime:null,Md:t.h,Nd:t.i,ti:[],timescale:9e4}),na(e)})).R("trun",(function(e){var t=r[r.length-1];e=io(e.reader,e.version,e.flags),t.ti.push(e)})).R("tfhd",(function(e){var n=r[r.length-1];e=eo(e.reader,e.flags),n.Md=e.Md||t.h,n.Nd=e.Nd||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=to(e.reader,e.version),t.baseMediaDecodeTime=e.baseMediaDecodeTime})).box("mdat",(function(e){for(var a=i-e.start-8,o=e.reader.Ma(),s=l(r),u=s.next();!u.done;u=s.next())null===(u=u.value).baseMediaDecodeTime?q("Unable to find base media decode time for CEA captions!"):(e.reader.seek(o),$f(t,e.reader,u.baseMediaDecodeTime,u.timescale,u.Md,u.Nd,a,u.ti,n))})).parse(e,!1,!0),n},F("shaka.cea.Mp4CeaParser",Jf);var Qf=0,Zf=1,eg=2,tg=3,ng=(new Map).set("avc1",Zf).set("avc3",Zf).set("dvav",Zf).set("dva1",Zf).set("hev1",eg).set("hvc1",eg).set("dvh1",eg).set("dvhe",eg).set("vvc1",tg).set("vvi1",tg).set("dvc1",tg).set("dvi1",tg);function ig(){this.g=null}function rg(e){return(e=function(e){var t=0,n=Re(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=De(n,e,r);t.push({type:i,value:a}),e+=r}n=t}return n}(e=We(Wt(e))).filter((function(e){return e.type===og}))[0])&&(e=Kt(e=_e(e.value,!0),"WRMHEADER"))?e:null}function ag(e){try{var t=rg(e);if(t)e:{for(var n=l(Jt(t,"DATA")),i=n.next();!i.done;i=n.next()){var r=i.value;if(r.children)for(var a=l(r.children),o=a.next();!o.done;o=a.next()){var s=o.value;if("LA_URL"==s.tagName){var u=Wt(s);break e}}}u=""}else u="";return u}catch(e){return""}}wt("video/mp4",(function(){return new Jf})),ig.prototype.init=function(){},ig.prototype.parse=function(e){this.g?this.g.clearData():this.g=new Ss;var t=[];if(!Is(e=De(e)))return t;var n=(e=this.g.parse(e)).Od(),i=e.Xe();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(Yf(i.data)),a=r.next();!a.done;a=r.next())t.push({packet:a.value,pts:i.time});return t},F("shaka.cea.TsCeaParser",ig),wt("video/mp2t",(function(){return new ig}));var og=1;function sg(t,n,i){var r=function(e){for(var t=[],n=(e=l(e)).next();!n.done;n=e.next())(n=lg(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 Ne(2,4,4010);if(!n){if(1<(o=r.filter((function(e){return"urn:mpeg:dash:sea:2012"==e.Bd}))).length)throw new Ne(2,4,4050);o.length&&(s=function(t){if(!e.crypto||!e.crypto.subtle)throw q("Web Crypto API is not available to decrypt AES-128. (Web Crypto only exists in secure origins like https)"),new Ne(2,4,4042);var n=Qt(t.node,"urn:mpeg:dash:schema:sea:2012","SegmentEncryption");if(!n)throw new Ne(2,4,4051);if("urn:mpeg:dash:sea:aes128-cbc:2013"!=n.attributes.schemeIdUri)throw new Ne(2,4,4051);if(!(n=Qt(t.node,"urn:mpeg:dash:schema:sea:2012","CryptoPeriod")))throw new Ne(2,4,4051);if(t=n.attributes.IV,n=Ke(n.attributes.keyUriTemplate),!t||!n)throw new Ne(2,4,4051);if(16!=(t=Ye(t.substr(2))).byteLength)throw new Ne(2,4,4048);return{kk:n,iv:t}}(o[0])),(o=r.find((function(e){return"urn:mpeg:dash:mp4protection:2011"==e.Bd})))&&o.encryptionScheme&&(c=o.encryptionScheme),(o=r.filter((function(e){return"urn:mpeg:dash:mp4protection:2011"==e.Bd?(a=e.init||a,!1):"urn:mpeg:dash:sea:2012"!=e.Bd}))).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).Bd];if(s){var u;if((u=Qt(o.node,"urn:microsoft:playready","pro"))&&Wt(u)){u=We(u=Wt(u));var c=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);u=[{initData:pa(u,c,new Set,0),initDataType:"cenc",keyId:o.keyId}]}else u=null;if(c=null,"urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e"===o.Bd){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:pa(new Uint8Array([]),h,d,1),initDataType:"cenc",keyId:c.keyId}]}}u=Ze(s,t,o.init||e||u||c),(s=cg.get(s))&&(u.licenseServerUri=s(o)),a.push(u)}}return a}(a,c,o,i,u),0==t.length&&(t=[Ze("",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(Ze(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{Oh:u,vm:a,drmInfos:t,cg:s,Th:!0}}function ug(e){var t=Qt(e.node,"https://dashif.org/CPS","Laurl");if(t&&(t=Wt(t)))return t;if((t=Qt(e.node,"urn:microsoft:playready","pro"))&&Wt(t))return ag(t);if((e=Qt(e.node,"urn:mpeg:cenc:2013","pssh"))&&(e=Wt(e))){t=We(e),e=8;var n=(t=Re(t)).getUint8(e);return e+=20,0<n&&(e+=4+16*t.getUint32(e)),ag(e=Kt("<pro>"+(e=qe(e=De(t,e+4)))+"</pro>"))}return""}function lg(e){var t=e.attributes.schemeIdUri,n=en(e,"urn:mpeg:cenc:2013","default_KID"),i=tn(e,"urn:mpeg:cenc:2013","pssh").map(Yt),r=e.attributes.value;if(!t)return null;if(t=t.toLowerCase(),n&&(n=n.replace(/-/g,"").toLowerCase()).includes(" "))throw new Ne(2,4,4009);var a=[];try{a=i.map((function(e){return{initDataType:"cenc",initData:We(e),keyId:null}}))}catch(e){throw new Ne(2,4,4007)}return{node:e,Bd:t,keyId:n,init:0<a.length?a:null,encryptionScheme:r}}var cg=(new Map).set("com.apple.fps",(function(t){if("apple"===e.shakaMediaKeysPolyfill)throw new Ne(2,4,4054);return(t=Qt(t.node,"https://dashif.org/CPS","Laurl"))&&(t=Wt(t))?t:""})).set("com.widevine.alpha",(function(e){var t=Qt(e.node,"https://dashif.org/CPS","Laurl");return t&&(t=Wt(t))?t:(e=Qt(e.node,"urn:microsoft","laurl"))&&Ke(e.attributes.licenseUrl)||""})).set("com.microsoft.playready",ug).set("com.microsoft.playready.recommendation",ug).set("com.microsoft.playready.software",ug).set("com.microsoft.playready.hardware",ug).set("org.w3.clearkey",(function(e){var t=Qt(e.node,"https://dashif.org/CPS","Laurl");return t&&(t=Wt(t))?t:(e=Qt(e.node,"http://dashif.org/guidelines/clearKey","Laurl"))&&"EME-1.0"===e.attributes.Lic_type&&e&&(e=Wt(e))?e:""}));function dg(t,n,i,r,a,o){var s=(new Map).set("RepresentationID",n).set("Number",i).set("SubNumber",r).set("Bandwidth",a).set("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.get(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))&&q("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 hg(e,t){var n=fg(e,t,"timescale"),i=1;n&&(i=un(n)||1);var r=(n=un((n=fg(e,t,"duration"))||""))?n/i:null,a=fg(e,t,"startNumber"),o=Number(fg(e,t,"presentationTimeOffset"))||0,s=ln(a||"");if(null!=a&&null!=s||(s=1),a=null,t=gg(e,t,"SegmentTimeline")){t=Xt(t,"S"),a=i,e=e.ma.duration||1/0;for(var u=s,l=[],c=-o,d=0;d<t.length;++d){var h=t[d],p=t[d+1],f=Zt(h,"t",ln),g=Zt(h,"d",ln),m=Zt(h,"r",sn);if(h=Zt(h,"k",sn)||0,null!=f&&(f-=o),g){if(f=null!=f?f:c,0>(m=m||0))if(p){if(null==(p=Zt(p,"t",ln)))break;if(f>=p)break;m=Math.ceil((p-f)/g)-1}else{if(1/0==e)break;if(f/a>=e)break;m=Math.ceil((e*a-f)/g)-1}for(0<l.length&&f!=c&&(l[l.length-1].end=f/a),p=0;p<=m;++p)c=f+g,l.push({start:f/a,end:c/a,Bh:f,rc:h,Nk:l.length+u}),f=c}}a=l}return{timescale:i,Kf:n,gb:r,ie:s,Ib:o/i||0,dd:o,timeline:a}}function pg(e,t){return[t(e.J),t(e.oa),t(e.ra)].filter(Ai)}function fg(e,t,n){t=pg(e,t),e=null;for(var i=(t=l(t)).next();!i.done&&!(e=i.value.attributes[n]);i=t.next());return e}function gg(e,t,n){t=pg(e,t),e=null;for(var i=(t=l(t)).next();!i.done&&!(e=$t(i.value,n));i=t.next());return e}function mg(e,t,n,i,r,a){if(a=void 0===a?0:a,en(e,"http://www.w3.org/1999/xlink","href")){var o=function(e,t,n,i,r,a){for(var o=en(e,"http://www.w3.org/1999/xlink","href"),s=en(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=Gt("http://www.w3.org/1999/xlink");d[0]==h&&delete e.attributes[c]}if(5<=a)return kr(new Ne(2,4,4028));if("onLoad"!=s)return kr(new Ne(2,4,4027));var p=Qe([i],[o]);return r.request(0,Br(p,t)).Va((function(i){if(!(i=Ht(i.data,e.tagName)))return kr(new Ne(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 mg(e,t,n,p[0],r,a+1)}))}(e,t,n,i,r,a);return n&&(o=o.Va(void 0,(function(){return mg(e,t,n,i,r,a)}))),o}o=[];for(var s=l(qt(e)),u=s.next(),c={};!u.done;c={Jd:void 0},u=s.next())c.Jd=u.value,"urn:mpeg:dash:resolve-to-zero:2013"==en(c.Jd,"http://www.w3.org/1999/xlink","href")?e.children=e.children.filter(function(e){return function(t){return t!==e.Jd}}(c)):"SegmentTimeline"!=c.Jd.tagName&&o.push(mg(c.Jd,t,n,i,r,a));return Mr(o).Va((function(){return e}))}function vg(e){this.h=Re(e),this.g=new Qr(this.h,0)}function yg(e){var t=bg(e);if(7<t.length)throw new Ne(2,3,3002);for(var n=0,i=(t=l(t)).next();!i.done;i=t.next())n=256*n+i.value;t=bg(e);e:{for(var r=(i=l(wg)).next();!r.done;r=i.next())if(Ce(t,new Uint8Array(r.value))){i=!0;break e}i=!1}if(i)t=e.h.byteLength-e.g.Ma();else{if(8==t.length&&224&t[1])throw new Ne(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.Ma()+t<=e.h.byteLength?t:e.h.byteLength-e.g.Ma(),i=Re(e.h,e.g.Ma(),t),e.g.skip(t),new Tg(n,i)}function bg(e){var t=e.g.Ma(),n=e.g.X();if(0==n)throw new Ne(2,3,3002);return n=8-Math.floor(Math.log2(n)),e.g.skip(n-1),De(e.h,t,n)}vg.prototype.Ga=function(){return this.g.Ga()};var wg=[[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 Tg(e,t){this.id=e,this.g=t}function xg(e){if(8<e.g.byteLength)throw new Ne(2,3,3002);if(8==e.g.byteLength&&224&e.g.getUint8(0))throw new Ne(2,3,3001);for(var t=0,n=0;n<e.g.byteLength;n++)t=256*t+e.g.getUint8(n);return t}function Sg(e){var t=new vg(e.g);if(179!=(e=yg(t)).id)throw new Ne(2,3,3013);if(e=xg(e),183!=(t=yg(t)).id)throw new Ne(2,3,3012);t=new vg(t.g);for(var n=0;t.Ga();){var i=yg(t);if(241==i.id){n=xg(i);break}}return{al:e,Fk:n}}function Ag(e,t,n){if(!(t=gg(e,t,"Initialization")))return null;var i=e.J.cb(),r=t.attributes.sourceURL;r&&(i=Qe(i,[Ke(r)],e.Lb())),r=0;var a=null;return(t=Zt(t,"range",on))&&(r=t.start,a=t.end),(n=new Bo((function(){return i}),r,a,Mg(e),null,null,n,e.oa.encrypted)).codecs=e.J.codecs,n.mimeType=e.J.mimeType,e.ma&&!e.ma.bf&&(n.g=e.ma.start+e.ma.duration),n}function kg(e,t,n,i,r,a,o){var s,u,c,d,h,p,f,g,m,v,y,b,T,x,S,A,k,E;return R((function(I){if(1==I.g)return s=e.presentationTimeline,u=!e.Db||!e.ma.bf,c=e.ma.start,d=e.ma.duration,h=e.J.mimeType.split("/")[1],f=null,g=[(p=t)(i,r,a,!1),"webm"==h?p(n.O(),n.startByte,n.endByte,!0):null],p=null,w(I,Promise.all(g),2);if(m=I.h,v=m[0],y=m[1]||null,T=c-o,x=c,S=d?c+d:1/0,"mp4"==h)var C=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.T();if(0==u)throw new Ne(2,3,3005);if(0==o.version)var l=o.reader.T(),c=o.reader.T();else l=o.reader.yd(),c=o.reader.yd();o.reader.skip(2);var d=o.reader.Ba();for(e=e+o.size+c,c=0;c<d;c++){var h=o.reader.T(),p=(2147483648&h)>>>31;h&=2147483647;var f=o.reader.T();if(o.reader.skip(4),1==p)throw new Ne(2,3,3006);s.push(new Vo(l/u+n,(l+f)/u+n,(function(){return a}),e,e+h-1,t,n,i,r)),l+=f,e+=h}return o.parser.stop(),s}(t,i,r,a,o,n,e)}));if(e&&u.parse(e),s)return s;throw new Ne(2,3,3004)}(v,r,i,n,T,x,S);else{C=v;var M=new vg(y);if(440786851!=yg(M).id)throw new Ne(2,3,3008);var D=yg(M);if(408125543!=D.id)throw new Ne(2,3,3009);M=D.g.byteOffset,D=new vg(D.g);for(var P=null;D.Ga();){var R=yg(D);if(357149030==R.id){P=R;break}}if(!P)throw new Ne(2,3,3010);for(P=new vg(P.g),R=1e6,D=null;P.Ga();){var L=yg(P);if(2807729==L.id)R=xg(L);else if(17545==L.id)if(4==L.g.byteLength)D=L.g.getFloat32(0);else{if(8!=L.g.byteLength)throw new Ne(2,3,3003);D=L.g.getFloat64(0)}}if(null==D)throw new Ne(2,3,3011);if(D*=P=R/1e9,475249515!=(C=yg(new vg(C))).id)throw new Ne(2,3,3007);C=function(e,t,n,i,r,a,o,s,u){function l(){return r}var c=[];e=new vg(e.g);for(var d=null,h=null;e.Ga();){var p=yg(e);if(187==p.id){var f=Sg(p);f&&(p=n*f.al,f=t+f.Fk,null!=d&&c.push(new Vo(d+o,p+o,l,h,f-1,a,o,s,u)),d=p,h=f)}}return null!=d&&c.push(new Vo(d+o,i+o,l,h,null,a,o,s,u)),c}(C,M,P,D,i,n,T,x,S)}for(A=l(b=C),k=A.next();!k.done;k=A.next())(E=k.value).codecs=e.J.codecs,E.mimeType=e.J.mimeType,E.bandwidth=e.bandwidth;return s.$d(b),f=new Du(b),u&&f.ld(x,S,!0),I.return(f)}))}function Eg(e){return e.Cd}function Ig(e){var t=gg(e,Eg,"RepresentationIndex");return e=on((e=fg(e,Eg,"indexRange"))||""),t&&(e=Zt(t,"range",on,e)),e}function Cg(e,t){var n=e.J.mimeType.split("/")[1];if(e.J.contentType!=rt&&"mp4"!=n&&"webm"!=n)throw new Ne(2,4,4006);if("webm"==n&&!t)throw new Ne(2,4,4005)}function Mg(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.qf,pixelAspectRatio:t.pixelAspectRatio||null,width:t.width||null,label:e.oa.label||null,roles:e.roles||null,language:e.oa.language||null}}function Dg(e){return e.tc}function Pg(t,n,i,r,a,o,s,u,c,d){c||t.J.Ze||(t.J.Ze=fg(t,Rg,"initialization"));var h=t.J.Ze?function(e,t){var n=e.J.Ze;if(n||(n=fg(e,Rg,"initialization")),!n)return null;n=Ke(n);var i=e.J.originalId,r=e.bandwidth||null,a=e.J.cb,o=e.Lb;return t=new Bo((function(){var e=dg(n,i,null,null,r,null);return Qe(a(),[e],o())}),0,null,Mg(e),null,null,t,e.oa.encrypted),t.codecs=e.J.codecs,t.mimeType=e.J.mimeType,e.ma&&!e.ma.bf&&(t.g=e.ma.start+e.ma.duration),t}(t,s):null,p=function(e){var t=hg(e,Rg),n=fg(e,Rg,"media"),i=fg(e,Rg,"index"),r=fg(e,Rg,"k"),a=0;return r&&(a=parseInt(r,10)),{Kf:t.Kf,gb:t.gb,timescale:t.timescale,ie:t.ie,Ib:t.Ib,dd:t.dd,timeline:t.timeline,ac:n&&Ke(n),Vd:i,mimeType:e.J.mimeType,codecs:e.J.codecs,bandwidth:e.bandwidth,vk:a}}(t);!function(e){var t=e.Vd?1:0;if(t+=e.timeline?1:0,0==(t+=e.gb?1:0))throw new Ne(2,4,4002);if(1!=t&&(e.Vd&&(e.timeline=null),e.Kf=null,e.gb=null),!e.Vd&&!e.ac)throw new Ne(2,4,4002)}(p);var f=Ft(t);if(p.Vd)return Cg(t,h),{endTime:-1,timeline:-1,Oc:function(){var e=dg(p.Vd,f.J.originalId,null,null,f.bandwidth||null,null);return e=Qe(f.J.cb(),[e]),kg(f,n,h,e,0,null,p.Ib)},timescale:p.timescale};if(p.gb)return r||"image"===t.oa.contentType||"text"===t.oa.contentType||(r=t.ma.start,d=t.ra.id,i=t.ma.duration,d=(d=null!=d&&o.get(d)||i)?r+d:1/0,t.presentationTimeline.Rg(p.gb),t.presentationTimeline.ri(r,d)),{endTime:-1,timeline:-1,Oc:function(){return function(t,n,i,r,a,o,s,u){function c(i){var a=i-y,s=a*v,l=n.Kf,c=a*l;"BigInt"in e&&c>Number.MAX_SAFE_INTEGER&&(c=BigInt(a)*BigInt(l)),a=(s+=f)+v,l=Math.min(a,h());var d=[],p=n.vk;if(p)for(var g=(l-s)/p,m={},k=0;k<p;m={Ri:void 0},k++){var E=s+g*k,I=E+g;m.Ri=k,(m=new Vo(E,I,function(e){return function(){var t=dg(b,T,i,e.Ri,w,c);return Qe(x(),[t],S())}}(m),0,null,r,A,f,h(),[],"",null,null,Ko,o)).codecs=t.J.codecs,m.mimeType=t.J.mimeType,0==u?0<k&&m.qd():0!=k%u&&m.qd(),d.push(m)}return(s=new Vo(s,l,(function(){if(p)return[];var e=dg(b,T,i,null,w,c);return Qe(x(),[e],S())}),0,null,r,A,f,h(),d,"",null,null,Ko,o,0<d.length)).codecs=t.J.codecs,s.mimeType=t.J.mimeType,s.bandwidth=t.bandwidth,s.j=a,s}function d(){var e=[Math.max(p.Gb(),f),Math.min(p.Ac(),h())].map((function(e){return e-f}));return e=[Math.ceil(e[0]/v),Math.ceil(e[1]/v)-1],t.J.qb&&e[1]++,e.map((function(e){return e+y}))}function h(){var e=null!=g&&a.get(g)||m;return e?f+e:1/0}var p=t.presentationTimeline,f=t.ma.start,g=t.ra.id,m=t.ma.duration,v=n.gb,y=n.ie,b=n.ac,w=t.bandwidth||null,T=t.J.originalId,x=t.J.cb,S=t.Lb,A=f-n.Ib,k=d();i=t.Db?Math.max(k[0],k[1]-i+1):k[0],s=s||k[1],k=[];for(var E=i;E<=s;++E){var I=c(E);k.push(I)}var C=new Du(k);if(k=p.Ac()<h(),E=p.V(),k||E){var M=Math.max(i,s+1);i=v,t.J.qb&&(i=.1),C.Lf(i,(function(){var e=p.Gb();C.$a(e);var t=l(d());t.next(),t=t.next().value;for(var n=[];M<=t;){var i=c(M);n.push(i),M++}return e>h()&&!n.length?null:n}))}return Promise.resolve(C)}(f,p,a,h,o,s,u,t.J.Df)},timescale:p.timescale};var g=null;r=r=null,t.ra.id&&t.J.id&&(r=t.ra.id+","+t.J.id,r=i.get(r))&&(g=r.segmentIndex);var m=t.ma.start,v=t.ma.duration?m+t.ma.duration:1/0;if(g)Ng(d=g,p,m,v,h,t.Db),d.$a(t.presentationTimeline.Gb());else{if(i=0,c=-1,null!=t.ra.id&&null!=t.J.id){var y=d.get(t.ra.id);if(y)c=y.timeline;else for(y=(d=l(d.values())).next();!y.done;y=d.next()){if(y=y.value,Math.abs(p.Ib-y.endTime)<=ot&&y.ah.includes(t.J.id)){c=y.timeline;break}y.timeline>=i&&(i=y.timeline+1)}}-1==c&&(c=i),g=new Lg(t.Db,p,t.J.originalId,t.bandwidth,t.J.cb,t.Lb,m,v,h,s,t.J.Df,c)}return p.timeline&&"image"!==t.oa.contentType&&"text"!==t.oa.contentType&&t.presentationTimeline.si(g.h?g.h.timeline:[],m),r&&t.Db&&(r.segmentIndex=g),r=(r=(r=p.timeline)&&r[r.length-1])?r.end+p.Ib:-1,d=-1,g instanceof Lg&&(d=g.Pe()),{endTime:r,timeline:d,Oc:function(){return g instanceof Lg&&0==g.getNumReferences()&&Ng(g,p,m,v,h,t.Db),Promise.resolve(g)},timescale:p.timescale}}function Rg(e){return e.Gc}function Lg(e,t,n,i,r,a,o,s,u,l,c,d){Du.call(this,[]),this.C=e,this.h=t,this.G=n,this.B=i,this.F=r,this.I=a,this.j=o,this.l=s,this.s=u,this.A=l,this.H=c,this.K=d,Og(this)}function Ng(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)&&Ho(n,t)}}(e,r),e.C=a,e.h){if(e.h.dd!==t.dd&&(e.h.timeline=t.timeline,e.h.dd=t.dd,e.h.Ib=t.Ib),e.h.ac!==t.ac&&(e.h.ac=t.ac),(n=e.h.timeline).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;Og(e)}function Og(e){if(e.h&&!e.o){for(var t=[],n=l(e.h.timeline),i=n.next();!i.done;i=n.next())(i=i.value).start>=e.l||0>=i.end||t.push(i);e.h.timeline=t,e.$a(e.j)}}function jg(e,t,n,i,r,a,o,s){return e=dg(e,t,n,a,i||null,r),Qe(o(),[e],s()).map((function(e){return e.toString()}))}function Ug(e){this.o=null,this.A=e,this.G=new Nr,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 _g(e,t){var n,i,r,a,o,s,u;return R((function(l){return 1==l.g?(n=Qe(e.i,[Bg(e,t)]),i=Br(n,e.o.retryParameters),r=e.A.networkingEngine.request(8,i),Or(e.G,r),x(l,2),w(l,r.promise,4)):2!=l.g?(a=l.h,o=Ue(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 Ti((function(){_g(e,i)})),(n=t.TTL)&&(e.C=n),e.g.ia(e.C),e.m=t["PATHWAY-PRIORITY"]||[],e.F=t["PATHWAY-CLONES"]||[]}(e,s,a.uri),A(l,0)):(u=k(l))&&7001==u.code?l.return():(null!=e.g&&(e.g.stop(),e.g=null),e.g=new Ti((function(){_g(e,t)})),e.g.ia(e.C),void T(l))}))}function Bg(e,t){if(!e.m.length)return t;t=new de(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))),Ee(r)&&ge(t,r),t.toString()}function Fg(e,t,n,i){var r=e.l.get(t);r||(r=new Map),r.set(n,i),e.l.set(t,r)}function Vg(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={ud:void 0},a=r.next())if(o.ud=a.value,a=t.get(o.ud))i.push({Wg:o.ud,location:a});else if(a=e.F.find(function(e){return function(t){return t.Hl==e.ud}}(o))){var s=t.get(a["BASE-ID"]);s&&(a["URI-REPLACEMENT"].bj?(pe(s=new de(s),a["URI-REPLACEMENT"].bj),i.push({Wg:o.ud,location:s.toString()})):i.push({Wg:o.ud,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 de(t.location).Cb))return!1;return!0})),i.length&&(e.B=i[0].Wg),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:Qe(e.i,i)}function Hg(){this.l=[],this.h=[],this.g=[],this.j=[],this.i=[],this.s=this.o=!1,this.m=new Set}function Kg(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[mm(e),e]})));var u=new Map(s.videoStreams.map((function(e){return[gm(e),e]}))),c=new Map(s.textStreams.map((function(e){return[vm(e),e]})));if(s=new Map(s.imageStreams.map((function(e){return[ym(e),e]}))),t){var d=cm(rt);c.set(vm(d),d),d=cm("image"),s.set(ym(d),d)}n.push(o),i.push(u),r.push(c),a.push(s)}return{Ih:n,$i:i,Xi:r,bi:a}}function Gg(e){var t,n,i,r,a,o,s,u,c,d,h,p,f,g,m,v,y,b,T,x,S,A,k,E,I,C,M,D,P;return R((function(R){switch(R.g){case 1:if(t=at,1==e.length)return R.return(e[0]);for(n=e.map((function(e){return new Map(e.filter((function(e){return e.type===t.ea})).map((function(e){return[mm(e),e]})))})),i=e.map((function(e){return new Map(e.filter((function(e){return e.type===t.Ca})).map((function(e){return[gm(e),e]})))})),r=e.map((function(e){return new Map(e.filter((function(e){return e.type===t.Ta})).map((function(e){return[vm(e),e]})))})),a=e.map((function(e){return new Map(e.filter((function(e){return e.type===t.Tf})).map((function(e){return[ym(e),e]})))})),o=l(r),s=o.next();!s.done;s=o.next())u=s.value,c=lm(t.Ta),u.set(vm(c),c);for(d=l(a),h=d.next();!h.done;h=d.next())p=h.value,f=lm(t.Tf),p.set(ym(f),f);return w(R,zg(g=new Hg,[],n,0,Jg,Qg,0),2);case 2:return m=R.h,w(R,zg(g,[],i,0,Jg,Qg,0),3);case 3:return v=R.h,w(R,zg(g,[],r,0,Jg,Qg,0),4);case 4:return y=R.h,w(R,zg(g,[],a,0,Jg,Qg,0),5);case 5:if(b=R.h,T=0,v.length&&m.length)for(k=l(m),E=k.next();!E.done;E=k.next())for(I=E.value,C=l(v),M=C.next();!M.done;M=C.next())D=M.value,P=T++,D.variantIds.push(P),I.variantIds.push(P);else for(x=v.concat(m),S=l(x),A=S.next();!A.done;A=S.next())A.value.variantIds=[T++];return R.return(v.concat(m).concat(y).concat(b))}}))}function zg(e,t,n,i,r,a,o){var s,u,c,d,h,p,f,g,m,v,y,b,T,x,S,A,k,E;return R((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 R((function(s){return 1==s.g?(Zg(e,n,t,0<o),t.matchedStreams?t.segmentIndex?w(s,qg(t,i+o),2):s.u(2):s.return(!1)):(Wg(t,i,r,a,o),s.return(!0))}))}(e,h,n,i,a,s,o),5);case 5:if(!I.h)throw new Ne(2,4,4037);d=c.next(),I.u(2);break;case 4:for(p=l(s),f=p.next();!f.done;f=p.next())for(g=f.value,m=l(g),v=m.next();!v.done;v=m.next())y=v.value,(b=Xg(e,y,n,r,a,s))&&t.push(b);for(T=l(s),x=T.next();!x.done;x=T.next())for(S=x.value,A=l(S),k=A.next(),E={};!k.done;E={qh:void 0},k=A.next())if(E.qh=k.value,!fm(E.qh)&&t.some(function(t){return function(n){return nm(e,t.qh,n)}}(E)))throw new Ne(2,4,4037);return I.return(t)}}))}function qg(e,t){var n,i,r,a,o,s;return R((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()),a.dependencyStream&&!a.dependencyStream.segmentIndex&&n.push(a.dependencyStream.createSegmentIndex());return w(u,Promise.all(n),2)}if(e.segmentIndex instanceof Nu)for(o=t;o<i.length;o++)(s=i[o]).segmentIndex&&e.segmentIndex.h.push(s.segmentIndex);T(u)}))}function Xg(e,t,n,i,r,a){if(fm(t))return null;var o=i(t);return Zg(e,n,o),o.createSegmentIndex&&(o.createSegmentIndex=function(){return R((function(e){return o.segmentIndex?e.u(0):(o.segmentIndex=new Nu,w(e,qg(o,0),0))}))}),o.matchedStreams&&o.matchedStreams.length?(Wg(o,0,r,a,0),o):null}function Wg(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==Pi(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 Yg(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(e.keyIds),t.closedCaptions=e.closedCaptions?new Map(e.closedCaptions):null,t.trickModeVideo=null,t.dependencyStream=null,t}function Jg(e){var t=Object.assign({},e);return t.roles=t.roles.slice(),t.keyIds=new Set(e.keyIds),t.segments=[],t.variantIds=[],t.closedCaptions=e.closedCaptions?new Map(e.closedCaptions):null,t}function $g(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=gr(e.drmInfos,t.drmInfos),t.drmInfos.length&&e.drmInfos.length&&!i.length)throw new Ne(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=Yg(t.trickModeVideo),e.trickModeVideo.matchedStreams=[],e.trickModeVideo.createSegmentIndex=function(){if(e.trickModeVideo.segmentIndex)return Promise.resolve();for(var t=new Nu,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),$g(e.trickModeVideo,t.trickModeVideo)):e.trickModeVideo&&(e.trickModeVideo.matchedStreams.push(t),$g(e.trickModeVideo,t)),t.dependencyStream?(e.dependencyStream||(e.dependencyStream=Yg(t.dependencyStream),e.dependencyStream.matchedStreams=[],e.dependencyStream.createSegmentIndex=function(){if(e.dependencyStream.segmentIndex)return Promise.resolve();for(var t=new Nu,n=l(e.dependencyStream.matchedStreams),i=n.next();!i.done;i=n.next())t.h.push(i.value.segmentIndex);return e.dependencyStream.segmentIndex=t,Promise.resolve()}),e.dependencyStream.matchedStreams.push(t.dependencyStream),$g(e.dependencyStream,t.dependencyStream)):e.dependencyStream&&(e.dependencyStream.matchedStreams.push(t),$g(e.dependencyStream,t))}function Qg(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 Zg(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=em(e,r.value,n)))return;i.push(r)}n.matchedStreams=i}function em(e,t,n){var i={audio:mm,video:gm,text:vm,image:ym}[n.type],r=null,a=i(n);if(t.has(a))r=t.get(a);else{a={audio:function(t,n){return nm(e,t,n)},video:function(t,n){return nm(e,t,n)},text:im,image:rm}[n.type];for(var o={audio:am,video:om,text:sm,image:um}[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&&!fm(r)&&t.delete(i(r)),r}function tm(e,t){return e.mimeType==t.mimeType&&bm(e.codecs)===bm(t.codecs)}function nm(e,t,n){return!(!tm(t,n)&&!e.o||t.drmInfos&&!fr(t.drmInfos,n.drmInfos))}function im(e,t){return!t.language||e.forced===t.forced&&0!=Pi(e.language,t.language)&&t.kind==e.kind}function rm(){return!0}function am(e,t,n){var i=hm(e,t,n);if(i===wm)return!0;if(i===xm)return!1;i=Pi(e.language,t.language);var r=Pi(e.language,n.language);if(r>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=dm(e.channelsCount,t.channelsCount,n.channelsCount))==wm||i!=xm&&((i=dm(e.audioSamplingRate,t.audioSamplingRate,n.audioSamplingRate))==wm||i!=xm&&!(!e.bandwidth||pm(e.bandwidth,t.bandwidth,n.bandwidth)!=wm)))}function om(e,t,n){var i=hm(e,t,n);if(i===wm)return!0;if(i===xm)return!1;if((i=dm(e.width*e.height,t.width*t.height,n.width*n.height))==wm)return!0;if(i==xm)return!1;if(e.frameRate){if((i=dm(e.frameRate,t.frameRate,n.frameRate))==wm)return!0;if(i==xm)return!1}return!(!e.bandwidth||pm(e.bandwidth,t.bandwidth,n.bandwidth)!=wm)}function sm(e,t,n){var i=Pi(e.language,t.language),r=Pi(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 um(e,t,n){return dm(e.width*e.height,t.width*t.height,n.width*n.height)==wm}function lm(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,baseOriginalId:null}}function cm(e){return{id:0,originalId:"",groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new Du([]),mimeType:"",codecs:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"",originalLanguage:null,label:null,type:e,primary:!1,trickModeVideo:null,dependencyStream: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,baseOriginalId:null}}function dm(e,t,n){if(t==e&&e!=n)return xm;if(n==e&&e!=t)return wm;if(t>e){if(n<=e||n-e<t-e)return wm;if(n-e>t-e)return xm}else{if(n>e)return xm;if(e-n<e-t)return wm;if(e-n>e-t)return xm}return Tm}function hm(e,t,n){var i=e.mimeType===t.mimeType&&e.codecs===t.codecs,r=e.mimeType===n.mimeType&&e.codecs===n.codecs;return i&&!r?xm:!i&&r?wm:(t=tm(e,t),e=tm(e,n),t&&!e?xm:!t&&e?wm:Tm)}function pm(e,t,n){return t=Math.abs(e-t),(e=Math.abs(e-n))<t?wm:t<e?xm:Tm}function fm(e){switch(e.type){case rt:return!e.language;case"image":return!e.tilesLayout;default:return!1}}function gm(e){return JSON.stringify([e.fastSwitching,e.width,e.frameRate,e.codecs,e.mimeType,e.label,e.roles,e.closedCaptions?Array.from(e.closedCaptions.entries()):null,e.bandwidth,e.dependencyStream?e.dependencyStream.baseOriginalId:null,Array.from(e.keyIds)])}function mm(e){return JSON.stringify([e.fastSwitching,e.channelsCount,e.language,e.bandwidth,e.label,e.codecs,e.mimeType,e.roles,e.audioSamplingRate,e.primary,e.dependencyStream?e.dependencyStream.baseOriginalId:null,Array.from(e.keyIds)])}function vm(e){return JSON.stringify([e.language,e.label,e.codecs,e.mimeType,e.bandwidth,e.roles])}function ym(e){return JSON.stringify([e.width,e.codecs,e.mimeType])}function bm(e){if(!Sm.has(e)){var t=oi(e);Sm.set(e,t)}return Sm.get(e)}m(Lg,Du),(i=Lg.prototype).getNumReferences=function(){return this.h?this.h.timeline.length:0},i.release=function(){Du.prototype.release.call(this),this.h=null},i.$a=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=(n=this.h.timeline[e]).Nk,r=n.Bh+this.h.dd,a=this.j-this.h.Ib,o=this.j+n.end,s=o;e===this.getNumReferences()-1&&1/0!==this.l&&(s=this.C&&.1<Math.abs(s-this.l)?Math.min(s,this.l):this.l);var u=this.h.codecs,l=this.h.mimeType,c=this.h.bandwidth,d=[],h=!1;if(n.rc&&this.h&&this.h.ac&&(h=this.h.ac.includes("$SubNumber$")),h){h=(n.end-n.start)/n.rc;for(var p={},f=0;f<n.rc;p={Nf:void 0,Si:void 0},f++){var g=n.start+h*f,m=g+h;p.Si=f,p.Nf=null,(p=new Vo(this.j+g,this.j+m,function(e){return function(){return t.h?(null==e.Nf&&(e.Nf=jg(t.h.ac,t.G,i,t.B,r,e.Si,t.F,t.I)),e.Nf):[]}}(p),0,null,this.s,a,this.j,this.l,[],"",null,null,Ko,this.A)).codecs=u,p.mimeType=l,p.bandwidth=c,0==this.H?0<f&&p.qd():0!=f%this.H&&p.qd(),d.push(p)}}(n=new Vo(this.j+n.start,s,(function(){return 0<d.length||!t.h?[]:jg(t.h.ac,t.G,i,t.B,r,null,t.F,t.I)}),0,null,this.s,a,this.j,this.l,d,"",null,null,Ko,this.A,0<d.length)).codecs=u,n.mimeType=l,n.j=o,n.bandwidth=c,this.g[e]=n}return n},i.Eb=function(e){Og(this);for(var t=0;t<this.getNumReferences();t++){var n=this.get(t+this.i);n&&e(n)}},i.Pe=function(){return this.K},Ug.prototype.configure=function(e){this.o=e},Ug.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()},Ug.prototype.setManifestType=function(e){this.s=e},Ug.prototype.banLocation=function(e){this.j.set(e,Date.now()+6e4)},(i=Hg.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.Wj=function(){return this.l},i.Hg=function(){return this.j.slice()},i.Bj=function(){return this.i},i.Ph=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}))),i.dependencyStream&&(i.dependencyStream.matchedStreams=i.dependencyStream.matchedStreams.filter((function(t){return t!==e})));else if(e.type==rt)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.gg=function(e,t,n){n=void 0!==n&&n;var i,r,a,o,s,u,c,d,h,p,f,g,m,v,y,b,x,S,A,k,E,I,C,M,D,P,L,N,O,j,U,_,B=this;return R((function(R){if(1==R.g){if(i=at,!t&&1==e.length)return r=Kg(e,!1),a=r.Ih,o=r.$i,s=r.Xi,u=r.bi,B.h=Array.from(a[0].values()),B.g=Array.from(o[0].values()),B.j=Array.from(s[0].values()),B.i=Array.from(u[0].values()),R.u(2);for(c=n?B.m.size:0,d=-1,h=0;h<e.length;h++)p=e[h],B.m.has(p.id)||(B.m.add(p.id),-1==d&&(d=h));return-1==d?R.return():(f=Kg(e,!0),g=f.Ih,m=f.$i,v=f.Xi,y=f.bi,w(R,Promise.all([zg(B,B.h,g,d,Yg,$g,c),zg(B,B.g,m,d,Yg,$g,c),zg(B,B.j,v,d,Yg,$g,c),zg(B,B.i,y,d,Yg,$g,c)]),2))}if(b=0,x=[],B.g.length&&B.h.length)for(M=l(B.h),D=M.next();!D.done;D=M.next())for(P=D.value,L=l(B.g),N=L.next();!N.done;N=L.next())O=N.value,j=gr(P.drmInfos,O.drmInfos),P.drmInfos.length&&O.drmInfos.length&&!j.length||(U=(P.bandwidth||0)+(O.bandwidth||0),P.dependencyStream&&(U+=P.dependencyStream.bandwidth||0),O.dependencyStream&&(U+=O.dependencyStream.bandwidth||0),_=b++,x.push({id:_,language:P.language,disabledUntilTime:0,primary:P.primary,audio:P,video:O,bandwidth:U,drmInfos:j,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]}));else for(S=B.g.length?B.g:B.h,A=l(S),k=A.next();!k.done;k=A.next())E=k.value,I=b++,C=E.bandwidth||0,E.dependencyStream&&(C+=E.dependencyStream.bandwidth||0),x.push({id:I,language:E.language,disabledUntilTime:0,primary:E.primary,audio:E.type==i.ea?E:null,video:E.type==i.Ca?E:null,bandwidth:C,drmInfos:E.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});B.l=x,T(R)}))},i.Ii=function(e){this.o=e},i.Mi=function(e){this.s=e},F("shaka.util.PeriodCombiner",Hg),Hg.prototype.setUseStreamOnce=Hg.prototype.Mi,Hg.prototype.setAllowMultiTypeVariants=Hg.prototype.Ii,Hg.prototype.combinePeriods=Hg.prototype.gg,Hg.prototype.deleteStream=Hg.prototype.Ph,Hg.prototype.getImageStreams=Hg.prototype.Bj,Hg.prototype.getTextStreams=Hg.prototype.Hg,Hg.prototype.getVariants=Hg.prototype.Wj;var wm=1,Tm=0,xm=-1,Sm=new Map;function Am(e,t){try{return function(e,t){var n=new DOMParser,i=km.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}(Be(e),t)}catch(e){return null}}var km=new ee((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 Em(){var e=this;this.j=this.g=null,this.A=[],this.h=null,this.za=1,this.G=[],this.l={mf:"",type:"",profiles:[],nc:null,qb:0,cb:null,be:0},this.s=new Map,this.B=new Map,this.o=new Map,this.C=new Map,this.wa=new Map,this.m=new Hg,this.K=0,this.ya=new V(5),this.L=new Ti((function(){e.I&&!e.g.continueLoadingWhenPaused&&(e.H.Ja(e.I,"timeupdate"),e.I.paused)?e.H.Aa(e.I,"timeupdate",(function(){return Vm(e)})):Vm(e)})),this.P=new Nr,this.N=null,this.F=[],this.ha=1/0,this.va=!1,this.i=null,this.M=0,this.S=!1,this.H=new $,this.I=null,this.U=!1,this.ba="",this.na=function(){return!1},this.W=[],this.ka=new Set}function Im(e){var t,n,i,r,a,o,s,u,d,h,p;return R((function(f){return 1==f.g?(t=4,n="MPD",i=function(e){var t=e.l.be;if(!e.l.mf||!t||!e.G.length)return[];var n=Date.now()/1e3,i=e.G.filter((function(e){return!(e=ln(e.attributes.ttl))||t+e>n})).map(Yt).filter(Ai);return i.length?Qe(e.A,i):[]}(e),r=e.A,i.length?(r=i,n="Patch",t=6):1<e.A.length&&e.i&&(a=Vg(e.i,"Location",!0)).length&&(r=a),o=Br(r,e.g.retryParameters),s=Date.now(),w(f,Wm(e,o,0,{type:t}),2)):3!=f.g?(u=f.h,e.j?(u.uri&&u.uri!=u.originalUri&&!e.A.includes(u.uri)&&e.A.unshift(u.uri),d=new de(u.uri),e.ba=d.g.toString(),w(f,function(e,t,n,i){var r,a,o,s,u,d,h,p;return R((function(f){if(1==f.g){if(r=t,(a=e.g.dash.manifestPreprocessor)!=Xl){if(oe("manifest.dash.manifestPreprocessor configuration","Please Use manifest.dash.manifestPreprocessorTXml instead."),!(o=Am(r,i)))throw new Ne(2,4,4001,n);a(o),r=Fe(o.outerHTML)}if(!(s=Ht(r,i)))throw new Ne(2,4,4001,n);return(u=e.g.dash.manifestPreprocessorTXml)!=Wl&&u(s),"Patch"===i?f.return(function(e,t){var n,i,r,a,o,s,u,d,h,p,f,g,m,v,y,b,x,S,A,k,E,I,C,M;return R((function(D){if(1==D.g){if(n=t.attributes.mpdId,i=Zt(t,"originalPublishTime",rn),!n||n!==e.l.mf||i!==e.l.be)throw e.G=[],new Ne(1,4,4052);for(r=[],a=[],o=new Set,s=l(qt(t)),u=s.next();!u.done;u=s.next())if(d=u.value,h=pn(d.attributes.sel||""),p=h[h.length-1],f=Yt(d)||"","MPD"===p.name)if("mediaPresentationDuration"===p.wc){var P=an(Yt(d)||"");if(null!=P){e.l.nc=P;for(var R=l(e.s.values()),L=R.next();!L.done;L=R.next())L.value.nc=P}}else if("type"===p.wc){for(e.h.presentationTimeline.Zc("static"==f),e.l.type=f,R=(P=l(e.s.values())).next();!R.done;R=P.next())R.value.Db="dynamic"==f;"static"==f&&(e.K=-1)}else"publishTime"===p.wc?e.l.be=rn(f)||0:null===p.wc&&"add"===d.tagName&&a.push(d);else if("PatchLocation"===p.name)fn(e.G,d);else if("Period"===p.name)"add"===d.tagName?a.push(d):"remove"===d.tagName&&p.id&&Pm(e,p.id);else if("SegmentTemplate"===p.name){if((P=(R=pn(d.attributes.sel||""))[R.length-1]).wc){R=Rm(e,R),L=Yt(d)||"";for(var N=l(R),O=N.next();!O.done;O=N.next())mn((O=e.s.get(O.value)).J.Gc,d.tagName,P.wc,L);P=R}else P=[];for(g=l(P),m=g.next();!m.done;m=g.next())v=m.value,o.add(v)}else if("SegmentTimeline"===p.name||"S"===p.name){for(P=pn(d.attributes.sel||""),L=(R=l(P=Rm(e,P))).next();!L.done;L=R.next())fn(N=Xt(L=gg(L=e.s.get(L.value),Rg,"SegmentTimeline"),"S"),d),L.children=N;for(y=l(P),b=y.next();!b.done;b=y.next())x=b.value,o.add(x)}for(S=l(o),A=S.next();!A.done;A=S.next())k=A.value,Lm(e,k);for(E=l(a),I=E.next();!I.done;I=E.next())C=I.value,r.push.apply(r,c(Dm(e,C)));return r.length?(e.h.periodCount+=r.length,e.h.gapCount=e.M,w(D,Mm(e,r,!0),2)):D.u(2)}"static"==e.l.type&&(M=e.l.nc,e.h.presentationTimeline.pb(M||1/0)),T(D)}))}(e,s)):e.g.dash.disableXlinkProcessing?f.return(Cm(e,s,n)):(d=e.g.dash.xlinkFailGracefully,h=mg(s,e.g.retryParameters,d,n,e.j.networkingEngine),Or(e.P,h),w(f,h.promise,2))}return p=f.h,f.return(Cm(e,p,n))}))}(e,u.data,u.uri,n),3)):f.return(0)):(h=Date.now(),p=(h-s)/1e3,e.ya.sample(1,p),e.ka.clear(),f.return(p))}))}function Cm(e,t,n){var i,r,a,o,s,u,d,h,p,f,g,m,v,y,b,S,E,I,C,M,D,P,L,N,O,j,U,_,B,F,V,H,K,G,z,X,W,Y,J,$,Q,Z,ee,te,ne,ie,re,ae,oe,se,ue,le,ce,de;return R((function(he){switch(he.g){case 1:for(e.i&&e.i.l.clear(),i=[n],r=[],a=new Map,o=Xt(t,"Location"),s=l(o),u=s.next();!u.done;u=s.next())d=u.value,h=d.attributes.serviceLocation,(p=Yt(d))&&(f=Qe(i,[p])[0],h&&(e.i?Fg(e.i,"Location",h,f):a.set(h,f)),r.push(f));if(e.i?0<(g=Vg(e.i,"Location",!0)).length&&(i=e.A=g):r.length&&(i=e.A=r),e.l.mf=t.attributes.id||"",e.l.be=Zt(t,"publishTime",rn)||0,e.G=Xt(t,"PatchLocation"),m=Promise.resolve(),(v=$t(t,"ContentSteering"))&&e.j)for(y=v.attributes.defaultServiceLocation,e.i?(e.i.i=i,e.i.h=y):(e.i=new Ug(e.j),e.i.configure(e.g),e.i.setManifestType("DASH"),e.i.i=i,e.i.h=y,(b=Yt(v))&&(Zt(v,"queryBeforeStart",dn,!1)?m=_g(e.i,b):_g(e.i,b))),S=l(a.keys()),E=S.next();!E.done;E=S.next())I=E.value,C=a.get(I),Fg(e.i,"Location",I,C);if(M=Xt(t,"BaseURL"),D=!1,e.i)for(P=l(M),L=P.next();!L.done;L=P.next())N=L.value,O=N.attributes.serviceLocation,j=Yt(N),O&&j&&(Fg(e.i,"BaseURL",O,j),D=!0);if(e.W.splice(0),D&&e.i||(U=M.map(Yt),e.W.push.apply(e.W,c(Qe(i,U)))),_=e.i,B=e.W,F=function(){return _&&D?Vg(_,"BaseURL"):B.slice()},e.l.cb=F,V=0,M&&M.length&&(V=Zt(M[0],"availabilityTimeOffset",cn)||0),e.l.qb=V,e.K=Zt(t,"minimumUpdatePeriod",an,-1),H=Zt(t,"availabilityStartTime",rn),K=Zt(t,"timeShiftBufferDepth",an),G=e.g.dash.ignoreSuggestedPresentationDelay,z=null,G||(z=Zt(t,"suggestedPresentationDelay",an)),X=e.g.dash.ignoreMaxSegmentDuration,W=null,X||(W=Zt(t,"maxSegmentDuration",an)),Y=t.attributes.type||"static",e.h&&e.h.presentationTimeline&&(e.U=e.h.presentationTimeline.V()&&"static"==Y),e.l.type=Y,e.h)for(J=e.h.presentationTimeline,$=J.Gb(),Q=l(e.o.values()),Z=Q.next();!Z.done;Z=Q.next())(ee=Z.value).segmentIndex&&ee.segmentIndex.$a($);else te=e.g.dash.ignoreMinBufferTime,ne=0,te||(ne=Zt(t,"minBufferTime",an)||0),ie=null!=z?Math.min(z,K||1/0):0<e.g.defaultPresentationDelay?e.g.defaultPresentationDelay:Math.min(1.5*ne,K||1/0),J=new su(H,ie,e.g.dash.autoCorrectDrift);return J.Zc("static"==Y),J.V()&&!isNaN(e.g.availabilityWindowOverride)&&(K=e.g.availabilityWindowOverride),null==K&&(K=1/0),J.Gf(K),re=t.attributes.profiles||"",e.l.profiles=re.split(","),ae={Db:"static"!=Y,presentationTimeline:J,ra:null,ma:null,oa:null,J:null,bandwidth:0,Jg:!1,qb:V,nc:null,profiles:re.split(","),roles:null,Lb:function(){return""}},w(he,m,2);case 2:return e.M=0,oe=jm(e,ae,F,t,!1),se=oe.duration,ue=oe.periods,("static"!=Y||e.U)&&oe.Rh||J.pb(se||1/0),e.S&&e.va&&J.Ji(e.ha),J.Rg(W||1),e.S&&e.va&&(le=null!=z?z:e.g.defaultPresentationDelay,J.lh(le)),e.h?(e.h.periodCount=ue.length,e.h.gapCount=e.M,w(he,Mm(e,ue,!1),4)):w(he,e.m.gg(ue,ae.Db),6);case 6:if(e.h={presentationTimeline:J,variants:e.m.l,textStreams:e.m.Hg(),imageStreams:e.m.i,offlineSessionIds:[],sequenceMode:e.g.dash.sequenceMode,ignoreManifestTimestampsInSegmentsMode:!1,type:"DASH",serviceDescription:Nm(t),nextUrl:Om(t),periodCount:ue.length,gapCount:e.M,isLowLatency:e.S,startTime:null},!J.Zi()){he.u(7);break}return ce=Xt(t,"UTCTiming"),w(he,function(e,t,n){var i,r,a,o,s,u,c,d;return R((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,x(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":q("NTP UTCTiming scheme is not supported");break;default:q("Unrecognized scheme in UTCTiming element",u)}h.u(9);break;case 7:return w(h,Gm(e,t,c,"HEAD"),10);case 10:return h.return(h.h);case 8:return w(h,Gm(e,t,c,"GET"),11);case 11:return h.return(h.h);case 9:A(h,3);break;case 5:k(h);case 3:o=a.next(),h.u(2);break;case 4:return q("A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!"),h.return(0)}}))}(e,F,ce),8);case 8:if(de=he.h,!e.j)return he.return();J.Ki(de);case 7:J.hf(),e.m&&!e.h.presentationTimeline.V()&&e.m.release();case 4:e.j.makeTextStreamsForClosedCaptions(e.h),function(e){for(var t=Array.from(e.C.keys()).filter((function(t){return!e.F.includes(t)})),n=(t=l(t)).next();!n.done;n=t.next()){n=n.value;for(var i=!0,r=l(e.C.get(n)),a=r.next();!a.done;a=r.next()){a=a.value;var o=e.o.get(a);o&&(o.segmentIndex&&0!=o.segmentIndex.getNumReferences()?i=!1:(e.m&&e.m.Ph(o,n),e.o.delete(a)))}i&&e.C.delete(n)}}(e),function(e,t){t=new Set(t.map((function(e){return e.id})));for(var n=l(e.B.keys()),i=n.next();!i.done;i=n.next())i=i.value,t.has(i)||e.B.delete(i)}(e,ue),T(he)}}))}function Mm(e,t,n){var i;return R((function(r){if(1==r.g)return w(r,e.m.gg(t,!0,n),2);e.h.variants=e.m.l,0<(i=e.m.Hg()).length&&(e.h.textStreams=i),e.h.imageStreams=e.m.i,e.j.filter(e.h),T(r)}))}function Dm(e,t){return jm(e,{Db:"dynamic"==e.l.type,presentationTimeline:e.h.presentationTimeline,ra:null,ma:null,oa:null,J:null,bandwidth:0,Jg:!1,qb:e.l.qb,profiles:e.l.profiles,nc:e.l.nc,roles:null,Lb:function(){return""}},e.l.cb,t,!0).periods}function Pm(e,t){e.h.periodCount--;for(var n=l(e.s.keys()),i=n.next();!i.done;i=n.next())(i=i.value).startsWith(t)&&(gg(e.s.get(i),Rg,"SegmentTimeline").children=[],Lm(e,i),e.s.delete(i));e.F=e.F.filter((function(e){return e!==t}))}function Rm(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).ra.id===n&&e.oa.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).ra.id===n&&e.oa.position===r&&e.J.id&&t.push(n+","+e.J.id);return t}function Lm(e,t){var n=e.s.get(t),i=e.o.get(t);i.segmentIndex&&i.segmentIndex.$a(e.h.presentationTimeline.Gb());try{var r=Pg(n,(function(t,n,i,r){return qm(e,t,n,i,r)}),e.o,!0,e.g.dash.initialSegmentLimit,e.wa,n.J.aesKey,null,!0,e.B);i.createSegmentIndex=function(){return R((function(e){if(1==e.g)return i.segmentIndex?e.u(0):w(e,r.Oc(),3);i.segmentIndex=e.h,T(e)}))}}catch(e){if((t=n.J.contentType)!=rt&&"application"!=t&&"image"!=t||4002!=e.code)throw e}}function Nm(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 Om(e){if(!(e=Xt(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 jm(e,t,n,i,r){var a=t.nc;a||(a=Zt(i,"mediaPresentationDuration",an),e.l.nc=a);var o=0;e.h&&e.h.presentationTimeline&&e.U&&(o=e.h.presentationTimeline.Xb());var s=[],u=o;i=Xt(i,"Period");for(var c=0;c<i.length;c++){var d=i[c],h=i[c+1],p=Zt(d,"start",an,u),f=d.attributes.id,g=Zt(d,"duration",an);p=0==c&&0==p&&e.U?o:p;var m=null;if(h){var v=Zt(h,"start",an);null!=v&&(m=v-p+o)}else null!=a&&(m=a-p+o);if(v=ot,m&&g&&Math.abs(m-g)>v&&m>g&&e.M++,null==m&&(m=g),!(null!==e.N&&null!==f&&null!==p&&p<e.N)||e.F.includes(f)||c+1==i.length){if(null!==p&&(null===e.N||p>e.N)&&(e.N=p),u=Um(e,t,n,{start:p,duration:m,node:d,bf:null==m||!h}),s.push(u),t.ra.id&&m&&e.wa.set(t.ra.id,m),null==m){u=null;break}u=p+m}}if(r)for(n=(t=l(s)).next();!n.done;n=t.next())n=n.value.id,e.F.includes(n)||e.F.push(n);else e.F=s.map((function(e){return e.id}));return null!=a?{periods:s,duration:a+o,Rh:!1}:{periods:s,duration:u,Rh:!0}}function Um(e,t,n,i){t.ra=Km(e,i.node,null,n),t.ma=i,t.ra.qb=t.qb,t.ra.id||(t.ra.id="__shaka_period_"+i.start);var r=Xt(i.node,"EventStream");n=t.presentationTimeline.Gb();for(var a=(r=l(r)).next();!a.done;a=r.next())zm(e,i.start,i.duration,a.value,n);for(r=(n=l(n=Xt(i.node,"SupplementalProperty"))).next();!r.done;r=n.next())"urn:mpeg:dash:urlparam:2014"==(r=r.value).attributes.schemeIdUri&&(r=Fm(e,r))&&(t.Lb=r);if(n=Xt(i.node,"AdaptationSet").map((function(n,i){return Bm(e,t,i,n)})).filter(Ai),t.Db){r=[];for(var o=(a=l(n)).next();!o.done;o=a.next())for(var s=(o=l(o.value.Jk)).next();!s.done;s=o.next())r.push(s.value);if(r.length!=new Set(r).size)throw new Ne(2,4,4018)}for(r=new Map,o=(a=l(n)).next();!o.done;o=a.next())for(s=(o=l(o.value.pj)).next();!s.done;s=o.next()){var u=l(s.value);s=u.next().value,u=u.next().value,r.set(s,u)}if(r.size)for(a=null,s=(o=l(n)).next();!s.done;s=o.next()){u=[];for(var d=l((s=s.value).streams),h=d.next(),p={};!h.done;p={rh:void 0},h=d.next())if(p.rh=h.value,r.has(p.rh.originalId)){a||(a=Xt(i.node,"AdaptationSet").map((function(n,i){return Bm(e,t,i,n)})).filter(Ai));for(var f=(h=l(a)).next();!f.done;f=h.next())(f=f.value.streams.find(function(e){return function(t){return t.originalId==e.rh.originalId}}(p)))&&(f.dependencyStream=r.get(f.originalId),f.originalId+=f.dependencyStream.originalId,u.push(f))}u.length&&s.streams.push.apply(s.streams,c(u))}if(i=n.filter((function(e){return!e.Ah})),n=n.filter((function(e){return e.Ah})),!e.g.disableIFrames)for(r=(n=l(n)).next();!r.done;r=n.next())for(a=(r=r.value).Ah.split(" "),s=(o=l(i)).next();!s.done;s=o.next())if(s=s.value,a.includes(s.id))for(u=(s=l(s.streams)).next();!u.done;u=s.next())nr(u.value,r.streams);if(n=_m(e.g.disableAudio,i,"audio"),r=_m(e.g.disableVideo,i,"video"),a=_m(e.g.disableText,i,rt),i=_m(e.g.disableThumbnails,i,"image"),0===r.length&&0===n.length)throw new Ne(2,4,4004);return{id:t.ra.id,audioStreams:n,videoStreams:r,textStreams:a,imageStreams:i}}function _m(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 Bm(t,n,i,r){function a(e){var i=e.attributes["dvb:fontFamily"];e=e.attributes["dvb:url"],i&&e&&(e=Qe(n.oa.cb(),[e],n.Lb()),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.oa=Km(t,r,n.ra,null),n.oa.position=i;var u=!1,d=(i=Xt(r,"Role")).map((function(e){return e.attributes.value})).filter(Ai),h=void 0,p=n.oa.contentType==rt;p&&(h="subtitle");for(var f=(i=l(i)).next();!f.done;f=i.next()){var g=(f=f.value).attributes.schemeIdUri;if(null==g||"urn:mpeg:dash:role:2011"==g)switch(f=f.attributes.value,f){case"main":u=!0;break;case"caption":case"subtitle":h=f}}var m=Xt(r,"EssentialProperty");i=null;var v=!1;f=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 x=s(parseInt(y.attributes.value,10));else if("urn:mpeg:mpegB:cicp:ColourPrimaries"==b)var S=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&&(f=Fm(t,y))||(g=!0))}if(g)return null;var A=null;for(m=(g=l(g=Xt(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?x=s(parseInt(m.attributes.value,10)):"urn:mpeg:mpegB:cicp:ColourPrimaries"==y?S=o(parseInt(m.attributes.value,10)):"urn:dvb:dash:fontdownload:2014"==y?a(m):"urn:mpeg:dash:urlparam:2014"==y&&(f=Fm(t,m));f&&(n.Lb=f),f=Xt(r,"Accessibility");var k,E=new Map;for(g=(f=l(f)).next();!g.done;g=f.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?k="visually impaired":"2"==m?k="hard of hearing":"9"==m&&(k="spoken subtitles"));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),E.set(y,Di(I))}else E.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 C=b=void 0;I.includes("=")?(b=(I=I.split("="))[0].startsWith("CC")?I[0]:"CC"+I[0],C=I[1]||"und"):(b="CC"+g,2==m.length?g+=2:g++,C=I),E.set(b,Di(C))}else E.set("CC1","und");var M=sg(f=Xt(r,"ContentProtection"),t.g.ignoreDrmInfo,t.g.dash.keySystemsByURI);n.oa.encrypted=0<f.length;var D=Di(n.oa.language||"und"),P=n.oa.label,L=new Map;if(r=Xt(r,"Representation"),!t.g.ignoreSupplementalCodecs){for(f=[],m=(g=l(r)).next();!m.done;m=g.next())(m=en(y=m.value,"urn:scte:dash:scte214-extensions","supplementalCodecs"))&&((y=Bt(y)).attributes.codecs=m.split(" ").join(","),y.attributes.id&&(y.attributes.supplementalId=y.attributes.id+"_supplementalCodecs"),f.push(y));r.push.apply(r,c(f))}if(f=r.map((function(i){var r=function(t,n,i,r,a,o,s,u,l,c,d,h){n.J=Km(t,c,n.oa,null);var p=n.J.id;if(t.ha=Math.min(t.ha,n.J.qb),t.S=0<t.ha,!function(e){var t=e.Cd?1:0;return t+=e.tc?1:0,0==(t+=e.Gc?1:0)?e.contentType==rt||"application"==e.contentType:(1!=t&&(e.Cd&&(e.tc=null),e.Gc=null),!0)}(n.J))return null;var f=n.ma.start;n.bandwidth=Zt(c,"bandwidth",un)||0,n.roles=u;var g=Xt(c,"SupplementalProperty"),m=Xt(c,"EssentialProperty"),v=Xt(c,"ContentProtection");c=null;var y,b,x=m.find((function(e){return"urn:mpeg:dash:urlparam:2014"==e.attributes.schemeIdUri}));(x||(x=g.find((function(e){return"urn:mpeg:dash:urlparam:2014"==e.attributes.schemeIdUri}))))&&(c=Fm(t,x)),c&&(n.Lb=c),c=(x=n.J.contentType)==rt||"application"==x,x="image"==x,v.length&&(n.oa.encrypted=!0);try{var S=void 0;if(i.cg){var A=n.J.cb,k=n.Lb,E=Br(Qe(A(),[i.cg.kk],k()),t.g.retryParameters);S={bitsKey:128,blockCipherMode:"CBC",iv:i.cg.iv,firstMediaSequenceNumber:0,fetchKey:function(){var n,i,r;return R((function(a){if(1==a.g)return w(a,Wm(t,E,6),2);if(3!=a.g){if(!(n=a.h).data||16!=n.data.byteLength)throw new Ne(2,4,4049);return i={name:"AES-CBC"},r=S,w(a,e.crypto.subtle.importKey("raw",n.data,i,!0,["decrypt"]),3)}r.cryptoKey=a.h,S.fetchKey=void 0,T(a)}))}}}if(n.J.aesKey=S,A=function(e,n,i,r){return qm(t,e,n,i,r)},n.J.Cd)var I=function(e,t,n){var i=Number(fg(e,Eg,"presentationTimeOffset"))||0,r=fg(e,Eg,"timescale"),a=1;r&&(a=un(r)||1);var o=i/a||0,s=Ag(e,Eg,n);!function(e,t){if(Cg(e,t),!Ig(e))throw new Ne(2,4,4002)}(e,s);var u=Ft(e);return{endTime:-1,timeline:-1,Oc:function(){var e=gg(u,Eg,"RepresentationIndex"),n=u.J.cb();return e&&(e=Ke(e.attributes.sourceURL))&&(n=Qe(n,[e],u.Lb())),e=Ig(u),kg(u,t,s,n,e.start,e.end,o)},timescale:a}}(n,A,S);else if(n.J.tc)I=function(e,t,n){var i=Ag(e,Dg,n),r=function(e){var t=function(e){return[e.J.tc,e.oa.tc,e.ra.tc].filter(Ai).map((function(e){return Xt(e,"SegmentURL")})).reduce((function(e,t){return 0<e.length?e:t})).map((function(t){return t.attributes.indexRange&&!e.Jg&&(e.Jg=!0),{tk:Ke(t.attributes.media),start:(t=Zt(t,"mediaRange",on,{start:0,end:null})).start,end:t.end}}))}(e),n=(e=hg(e,Dg)).ie;0==n&&(n=1);var i=0;return e.gb?i=e.gb*(n-1):e.timeline&&0<e.timeline.length&&(i=e.timeline[0].start),{gb:e.gb,startTime:i,ie:n,Ib:e.Ib,timescale:e.timescale,timeline:e.timeline,sd:t}}(e);if(!r.gb&&!r.timeline&&1<r.sd.length)throw new Ne(2,4,4002);if(!r.gb&&!e.ma.duration&&!r.timeline&&1==r.sd.length)throw new Ne(2,4,4002);if(r.timeline&&0==r.timeline.length)throw new Ne(2,4,4002);var a=null,o=null;e.ra.id&&e.J.id&&(o=t.get(e.ra.id+","+e.J.id))&&(a=o.segmentIndex);var s=function(e,t,n,i,r,a,o,s,u,l){var c=i.sd.length;i.timeline&&i.timeline.length!=i.sd.length&&(c=Math.min(i.timeline.length,i.sd.length));for(var d=e-i.Ib,h=t?e+t:1/0,p=[],f=i.startTime,g={},m=0;m<c;g={Mf:void 0,Cf:void 0},m++){g.Cf=i.sd[m];var v=f;f=void 0,f=null!=i.gb?v+i.gb:i.timeline?i.timeline[m].end:v+t,g.Mf=null,(g=new Vo(e+v,e+f,function(e){return function(){return null==e.Mf&&(e.Mf=Qe(n(),[e.Cf.tk],l())),e.Mf}}(g),g.Cf.start,g.Cf.end,r,d,e,h,[],"",null,null,Ko,a)).codecs=s,g.mimeType=o,g.bandwidth=u,p.push(g)}return p}(e.ma.start,e.ma.duration,e.J.cb,r,i,n,e.J.mimeType,e.J.codecs,e.bandwidth,e.Lb);return t=!a,a?a.Yd(s,e.presentationTimeline.Gb()):a=new Du(s),e.presentationTimeline.$d(s),e.Db&&e.ma.bf||a.ld(e.ma.start,e.ma.duration?e.ma.start+e.ma.duration:1/0,t),o&&(o.segmentIndex=a),{endTime:-1,timeline:-1,Oc:function(){return a&&0!=a.getNumReferences()||a.kf(s),Promise.resolve(a)},timescale:r.timescale}}(n,t.o,S);else if(n.J.Gc)I=Pg(n,A,t.o,!!t.h,t.g.dash.initialSegmentLimit,t.wa,S,h,!1,t.B);else{var C=n.ma.duration||0,M=n.J.cb,D=n.J.mimeType,P=n.J.codecs;I={endTime:-1,timeline:-1,Oc:function(){var e=Ru(f,C,M());return e.Eb((function(e){e.mimeType=D,e.codecs=P})),Promise.resolve(e)},timescale:1}}}catch(e){if((c||x)&&4002==e.code)return null;throw e}if(h=function(e,t,n,i){var r=sg(e,n,i);if(t.Th)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.Th=!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 Ne(2,4,4008);return r.Oh||t.Oh}(v,i,t.g.ignoreDrmInfo,t.g.dash.keySystemsByURI),h=new Set(h?[h]:[]),v=!1,g.some((function(e){return"tag:dolby.com,2018:dash:EC3_ExtensionType:2018"==e.attributes.schemeIdUri&&"JOC"==e.attributes.value}))&&(v=!0),g=!1,c&&(g=u.includes("forced_subtitle")||u.includes("forced-subtitle")),x&&((m=m.find((function(e){return["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"].includes(e.attributes.schemeIdUri)})))&&(y=m.attributes.value),!y))return null;c=n.J.codecs,n.profiles.includes("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&(c.includes("hvc1.2.4.L153.B0")||c.includes("hev1.2.4.L153.B0"))&&(b="PQ"),m=n.J.id?n.ra.id+","+n.J.id:"",t.G.length&&p&&t.s.set(n.ra.id+","+p,function(e){function t(e){return e?((e=Ft(e)).Cd=null,e.tc=null,e.Gc=yn(e.Gc),e.yf=null,e):null}return(e=Ft(e)).ra=t(e.ra),e.oa=t(e.oa),e.J=t(e.J),e.ma&&(e.ma=Ft(e.ma),e.ma.node=null),e}(n)),n.J.yf&&function(e,t,n,i){if(!e.ka.has(t)){e.ka.add(t);var r,a=Zt(t,"presentationTime",ln)||0,o=$t(t,"UTCTiming");(r=o&&o.attributes.schemeIdUri)&&(r=!("urn:mpeg:dash:utc:http-ntp:2014"===(o=o.attributes.schemeIdUri)||"urn:mpeg:dash:utc:ntp:2014"===o||"urn:mpeg:dash:utc:sntp:2014"===o)),t=r?1e3*(Zt(t,"wallClockTime",rn)||0):cs(t=Zt(t,"wallClockTime",ln)||0),a=(n=new Date(t-a/n.timescale*1e3)).getTime()/1e3,isNaN(a)||(i.o||i.mh(a),i=new Dr("prft",i=(new Map).set("detail",{wallClockTime:t,programStartDate:n})),e.j.onEvent(i))}}(t,n.J.yf,I,n.presentationTimeline),-1!=I.endTime&&null!=n.ra.id&&null!=n.J.id&&((p=t.B.get(n.ra.id))?(p.endTime=I.endTime,p.ah.includes(n.J.id)||p.ah.push(n.J.id),t.B.set(n.ra.id,p)):t.B.set(n.ra.id,{endTime:I.endTime,timeline:I.timeline,ah:[n.J.id]}));var L=m&&t.o.has(m)?t.o.get(m):{id:t.za++,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:c,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:h,language:a,originalLanguage:n.oa.language,label:o,type:n.oa.contentType,primary:s,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:n.J.emsgSchemeIdUris,roles:u,forced:g,channelsCount:n.J.qf,audioSamplingRate:n.J.audioSamplingRate,spatialAudio:v,closedCaptions:l,hdr:b,colorGamut:void 0,videoLayout:void 0,tilesLayout:y,accessibilityPurpose:d,external:!1,fastSwitching:!1,fullMimeTypes:new Set([ni(n.J.mimeType,n.J.codecs)]),isAudioMuxedInVideo:!1,baseOriginalId:null};return L.createSegmentIndex=function(){var e;return R((function(t){if(1==t.g)return L.segmentIndex?t.u(0):(e=L,w(t,I.Oc(),3));e.segmentIndex=t.h,T(t)}))},m&&n.Db&&!t.o.has(m)&&(n=n.ra.id||"",t.C.has(n)||t.C.set(n,[]),t.o.set(m,L),t.C.get(n).push(m)),L}(t,n,M,h,D,P,u,d,E,i,k,A);return r&&(r.hdr=r.hdr||x,r.colorGamut=r.colorGamut||S,r.fastSwitching=v,i=i.attributes.dependencyId)?(r.baseOriginalId=i,L.set(i,r),null):r})).filter((function(e){return!!e})),0==f.length&&0==L.size){if(i="image"==n.oa.contentType,t.g.dash.ignoreEmptyAdaptationSet||p||i)return null;throw new Ne(2,4,4003)}if(!n.oa.contentType||"application"==n.oa.contentType)for(n.oa.contentType=Xm(f[0].mimeType,f[0].codecs),g=(p=l(f)).next();!g.done;g=p.next())g.value.type=n.oa.contentType;for(p=n.oa.id||"__fake__"+t.za++,m=(g=l(f)).next();!m.done;m=g.next()){for(m=m.value,b=(y=l(M.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=p}return r=r.map((function(e){return e.attributes.supplementalId||e.attributes.id})).filter(Ai),{id:p,contentType:n.oa.contentType,language:D,wm:u,streams:f,drmInfos:M.drmInfos,Ah:i,Jk:r,pj:L}}function Fm(e,t){if((t=Qt(t,"urn:mpeg:dash:schema:urlparam:2014","UrlQueryInfo"))&&Zt(t,"useMPDUrlQuery",dn,!1)){var n=t.attributes.queryTemplate;if(n)return function(){return"$querypart$"==n?e.ba:n.split("&").map((function(t){if("$querypart$"==t)return e.ba;var n=/\$query:(.*?)\$/g.exec(t);if(n&&2==n.length){n=n[1];var i=new Ae(e.ba).get(n);if(i.length)return n+"="+i[0]}return t})).join("&")}}return null}function Vm(e){var t,n;return R((function(i){switch(i.g){case 1:return t=0,x(i,2),w(i,Im(e),4);case 4:t=i.h,A(i,3);break;case 2:if(n=k(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(),Hm(e,t),T(i)}}))}function Hm(e,t){if(!(0>e.K)){var n=e.K;0<=e.g.updatePeriod&&(n=e.g.updatePeriod),e.L.ia(Math.max(n-t,H(e.ya)))}}function Km(e,t,n,i){n=n||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,pixelAspectRatio:void 0,qf:null,audioSamplingRate:null,qb:0,Df:1,encrypted:!1},i=i||n.cb;var r,a=t.attributes.id,o=t.attributes.supplementalId,s=Xt(t,"BaseURL"),u=!1;if(e.i)for(var c=l(s),d=c.next();!d.done;d=c.next()){var h=d.value;d=h.attributes.serviceLocation,h=Yt(h),d&&h&&(Fg(e.i,a,d,h),u=!0)}u&&e.i||(r=s.map(Yt));var p=e.i;e=t.attributes.contentType||n.contentType,c=t.attributes.mimeType||n.mimeType,d=nl([t.attributes.codecs||n.codecs]).join(","),h=Zt(t,"frameRate",hn)||n.frameRate;var f=t.attributes.sar||n.pixelAspectRatio,g=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}(Xt(t,"InbandEventStream"),n.emsgSchemeIdUris),m=Xt(t,"AudioChannelConfiguration");m=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}(m)||n.qf;var v=Zt(t,"audioSamplingRate",ln)||n.audioSamplingRate;e||(e=Xm(c,d));var y=$t(t,"SegmentBase"),b=$t(t,"SegmentTemplate"),w=y&&Zt(y,"availabilityTimeOffset",cn)||0,T=b&&Zt(b,"availabilityTimeOffset",cn)||0,x=s&&s.length&&Zt(s[0],"availabilityTimeOffset",cn)||0;w=n.qb+x+w+T,T=null,(x=$t(t,"SegmentSequenceProperties"))&&(x=$t(x,"SAP"))&&(T=Zt(x,"cadence",sn)),x=t.attributes.label;var S=Xt(t,"Label");return S&&S.length&&Wt(S=S[0])&&(x=Wt(S)),{cb:function(){return Qe(i(),s.length?p&&u?Vg(p,a):r||[]:[])},Cd:y||n.Cd,tc:$t(t,"SegmentList")||n.tc,Gc:b||n.Gc,yf:$t(t,"ProducerReferenceTime")||n.yf,width:Zt(t,"width",ln)||n.width,height:Zt(t,"height",ln)||n.height,contentType:e,mimeType:c,codecs:d,frameRate:h,pixelAspectRatio:f,emsgSchemeIdUris:g,id:o||a,originalId:a,language:t.attributes.lang,qf:m,audioSamplingRate:v,qb:w,Ze:null,Df:T||n.Df,label:x||null,encrypted:!1}}function Gm(e,t,n,i){var r,a,o,s,u,l,c;return R((function(d){if(1==d.g)return r=[Ke(n)],a=Qe(t(),r),(o=Br(a,e.g.retryParameters)).method=i,s=e.j.networkingEngine.request(4,o,{isPreload:e.na()}),Or(e.P,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=Ue(u.data);return c=Date.parse(l),isNaN(c)?d.return(0):d.return(c-Date.now())}))}function zm(e,t,n,i,r){for(var a=i.attributes.schemeIdUri||"",o=i.attributes.value||"",s=Zt(i,"timescale",ln)||1,u=Zt(i,"presentationTimeOffset",ln)||0,c=(i=l(Xt(i,"Event"))).next();!c.done;c=i.next()){var d=Zt(c=c.value,"presentationTime",ln)||0,h=Zt(c,"duration",ln)||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||"",timescale:s,eventElement:vn(c),eventNode:yn(c)},e.j.onTimelineRegionAdded(c))}}function qm(e,t,n,i,r){var a,o,s,u;return R((function(l){return 1==l.g?(a=Gr,o=r?0:1,s=rl(t,n,i,e.g.retryParameters),w(l,Wm(e,s,a,{type:o}),2)):(u=l.h,l.return(u.data))}))}function Xm(e,t){return mi(t=ni(e,t))?rt:e.split("/")[0]}function Wm(e,t,n,i){return i||(i={}),i.isPreload=e.na(),t=e.j.networkingEngine.request(n,t,i),Or(e.P,t),t.promise}function Ym(){}(i=Em.prototype).configure=function(e,t){var n=this.j&&e.updatePeriod!=this.g.updatePeriod&&0<=e.updatePeriod;this.g=e,t&&(this.na=t),n&&this.h&&this.h.presentationTimeline.V()&&this.L.Jb(),this.i&&this.i.configure(this.g),this.m&&(this.m.Ii(this.g.dash.multiTypeVariantsAllowed&&pt()),this.m.Mi(this.g.dash.useStreamOnceInPeriodFlattening))},i.start=function(e,t){var n,i=this;return R((function(r){if(1==r.g)return i.va=t.isLowLatencyMode(),i.A=[e],i.j=t,w(r,Im(i),2);if(n=r.h,i.j&&Hm(i,n),!i.j)throw new Ne(2,7,7001);return r.return(i.h)}))},i.stop=function(){for(var e=l(this.o.values()),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.h=null,this.o.clear(),this.C.clear(),this.s.clear(),this.B.clear(),this.l={mf:"",type:"",profiles:[],nc:null,qb:0,cb:null,be:0},this.m=null,null!=this.L&&(this.L.stop(),this.L=null),this.i&&this.i.destroy(),this.H&&(this.H.release(),this.H=null),this.ka.clear(),this.P.destroy()},i.update=function(){var e,t=this;return R((function(n){return 1==n.g?(x(n,2),w(n,Im(t),4)):2!=n.g?A(n,0):(e=k(n),t.j&&e?(t.j.onError(e),void T(n)):n.return())}))},i.onExpirationUpdated=function(){},i.onInitialVariantChosen=function(e){if(this.h&&this.h.presentationTimeline.V()){var t=e.video||e.audio;if(t&&t.segmentIndex){e=this.h.presentationTimeline.Ac();var n=t.segmentIndex.find(e);null!=n&&(t=t.segmentIndex.get(n))&&(this.K=t.endTime-e,Hm(this,0))}}},i.banLocation=function(e){this.i&&this.i.banLocation(e)},i.setMediaElement=function(e){this.I=e},F("shaka.dash.DashParser",Em),$a("application/dash+xml",(function(){return new Em})),$a("video/vnd.mpeg.dash.mpd",(function(){return new Em})),F("shaka.dependencies",Ym),Ym.has=function(e){return Qm.has(e)},Ym.add=function(e,t){if(!$m[e])throw Error(e+" is not supported");e==Jm?oe("mux.js","mux.js is no longer used in Shaka Player."):Qm.set(e,(function(){return t}))};var Jm="muxjs",$m={xm:Jm,ISOBoxer:"ISOBoxer"};Ym.Allowed=$m;var Qm=new Map([["ISOBoxer",function(){return e.ISOBoxer}]]);function Zm(){this.j=new ee((function(){return["Oculus","Quest"].some((function(e){return navigator.userAgent.includes(e.toLowerCase())}))?"VR":navigator.userAgent.match(/Smart( ?|_)TV/i)||navigator.userAgent.match(/Android ?TV/i)?"TV":navigator.userAgentData?navigator.userAgentData.mobile?"MOBILE":"DESKTOP":/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)?"MOBILE":navigator.userAgentData&&navigator.userAgentData.platform?"android"==navigator.userAgentData.platform.toLowerCase()?"MOBILE":"DESKTOP":navigator.userAgent.includes("Android")?"MOBILE":"DESKTOP"})),this.l=new ee((function(){return navigator.vendor.includes("Apple")&&(navigator.userAgent.includes("Version/")||navigator.userAgent.includes("OS/"))?"WEBKIT":navigator.userAgent.includes("Edge/")?"EDGE":navigator.userAgent.includes("Chrome/")?"CHROMIUM":navigator.userAgent.includes("Firefox/")?"GECKO":"UNKNOWN"}))}function ev(){var t=e.ManagedMediaSource||e.MediaSource;return!(!t||!t.isTypeSupported)}function tv(t){return te(),void 0!==e.matchMedia&&e.matchMedia("(color-gamut: p3)").matches?t?"HLG":"PQ":"SDR"}function nv(){Zm.call(this),this.g=new ee((function(){var e=navigator.userAgent.match(/Version\/(\d+)/);return e||(e=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(e[1],10):null})),this.h=new ee((function(){return/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||1<navigator.maxTouchPoints?"xr"in navigator?"APPLE_VR":"MOBILE":"xr"in navigator?"APPLE_VR":"DESKTOP"}))}function iv(){if(!rv())throw Error("Not a Chromecast device!");Zm.call(this),this.h=new ee((function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/);return e?parseInt(e[1],10):null})),this.g=new ee((function(){var e=navigator.userAgentData&&navigator.userAgentData.platform||navigator.userAgent;return(e=e.toLowerCase()).includes("android")?av:e.includes("fuchsia")?ov:sv}))}function rv(){return navigator.userAgent.includes("CrKey")&&!navigator.userAgent.includes("VIZIO SmartCast")}(i=Zm.prototype).dc=function(){return!!navigator.mediaCapabilities},i.La=function(){return this.j.value()},i.Da=function(){return this.l.value()},i.fe=function(){return!1},i.Ai=function(){return!1},i.$e=function(){return!1},i.Bi=function(){return!1},i.ee=function(){return!1},i.bd=function(){return!0},i.cd=function(){return!0},i.je=function(){return!0},i.Gi=function(){return 0},i.ic=function(){return Promise.resolve({width:1/0,height:1/0})},i.Pi=function(){return!1},i.ph=function(){return!1},i.Ua=function(e){var t=this.La();return"TV"!==t&&"CONSOLE"!==t&&"CAST"!==t||(e.ads.customPlayheadTracker=!0,e.ads.skipPlayDetection=!0,e.ads.supportsMultipleMediaElements=!1),e},i.uh=function(){return!!e.indexedDB},i.xi=function(){return[]},i.Wi=function(){return!1},i.li=function(){return!1},i.fh=function(){return!1},i.If=function(){return!0},i.mi=function(){return!1},i.Vi=function(){return!0},i.$c=function(){return!1},i.Qg=function(e){return"com.apple.fps"===e},i.toString=function(){return"Device: "+this.Ob()+" v"+this.xa()+"; Type: "+this.La()},m(nv,Zm),(i=nv.prototype).xa=function(){return this.g.value()},i.Ob=function(){return"Apple Browser"},i.La=function(){return this.h.value()},i.Da=function(){return"WEBKIT"},i.dc=function(){return!1},i.fe=function(e,t){return"audio"===t},i.$e=function(){return!0},i.Bi=function(e){return"audio"===e},i.Ua=function(e){return Zm.prototype.Ua.call(this,e),e.abr.minTimeToSwitch=.5,e},i.Wi=function(){return!0},(navigator.vendor||"").includes("Apple")&&(/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||1<navigator.maxTouchPoints||navigator.userAgentData&&navigator.userAgentData.platform&&"macos"==navigator.userAgentData.platform.toLowerCase()||navigator.platform&&navigator.platform.toLowerCase().includes("mac"))&&(ne=function(){return new nv}),m(iv,Zm),(i=iv.prototype).xa=function(){return this.h.value()},i.Ob=function(){return"Chromecast with "+this.g.value()},i.La=function(){return"CAST"},i.Da=function(){return"CHROMIUM"},i.dc=function(){return Zm.prototype.dc.call(this)&&this.g.value()!==sv},i.cd=function(){return this.g.value()!==sv},i.Gi=function(){switch(this.g.value()){case av:return 0;case ov:return 3;default:return 1}},i.ic=function(){var t,n,i,r;return R((function(a){switch(a.g){case 1:if(t=e.cast&&cast.__platform__&&cast.__platform__.canDisplayType,n={width:1280,height:720},x(a,2),!(i=t)){a.u(4);break}return w(a,cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160'),5);case 5:i=a.h;case 4:if(i){n.width=3840,n.height=2160,a.u(6);break}if(!(r=t)){a.u(7);break}return w(a,cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=1920; height=1080'),8);case 8:r=a.h;case 7:r&&(n.width=1920,n.height=1080);case 6:A(a,3);break;case 2:z("Failed to check canDisplayType:",k(a));case 3:return a.return(n)}}))},i.Ua=function(e){return Zm.prototype.Ua.call(this,e),e.streaming.stallSkip=0,e},i.uh=function(){return!1},i.$c=function(){return!0};var av="Android",ov="Fuchsia",sv="Linux";function uv(){Zm.call(this);var e=this;this.i=new ee((function(){var e=navigator.userAgent.match(/(Chrome|Firefox)\/(\d+)/);return e?parseInt(e[2],10):null})),this.g=new ee((function(){return navigator.userAgent.match(/Edge?\//)?"Edge":navigator.userAgent.includes("Chrome")?"Chrome":navigator.userAgent.includes("Firefox")?"Firefox":"Unknown"})),this.h=new ee((function(){return navigator.userAgentData&&navigator.userAgentData.platform?"windows"==navigator.userAgentData.platform.toLowerCase():!!navigator.platform&&navigator.platform.toLowerCase().includes("win32")})),this.o=new ee((function(){return!navigator.userAgent.match(/Edge?\//)||!e.h.value()})),this.m=new ee((function(){return navigator.userAgent.includes("sony.hbbtv.tv")}))}function lv(){Zm.apply(this,arguments)}function cv(){Zm.call(this),this.g=new ee((function(){var e=navigator.userAgent.match(/PlayStation (\d+)/);return e?parseInt(e[1],10):null}))}function dv(){Zm.call(this);var e=navigator.userAgent.match(/Tizen (\d+).(\d+)/);this.g=e?parseInt(e[1],10):null,this.h=e?parseInt(e[2],10):null}function hv(){Zm.apply(this,arguments)}function pv(){Zm.call(this),this.h=new ee((function(){return navigator.userAgent.includes("DT_STB_BCM")})),this.g=new ee((function(){if(navigator.userAgent.includes("DT_STB_BCM"))return 11;var e=navigator.userAgent.match(/Version\/(\d+)/);return e||(e=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(e[1],10):null}))}function fv(){Zm.call(this),this.g=function(){var e=null,t=navigator.userAgent.match(/Chrome\/(\d+)/);switch(t&&(e=parseInt(t[1],10)),e){case 38:return 3;case 53:return 4;case 68:return 5;case 79:return 6;case 87:return 22;case 94:return 23;case 108:return 24;case 120:return 25;default:return null}}()}function gv(){Zm.call(this),this.g=navigator.userAgent.includes("Edge/");var e=navigator.userAgent.match(/Edge?\/(\d+)/);this.h=e?parseInt(e[1],10):null}function mv(){var e=null;try{e="undefined"!=typeof Windows?Windows:chrome.webview.hostObjects.sync.Windows}catch(e){}return e}function vv(e,t,n){this.type=e,this.aa=t,this.segments=n||null}function yv(e,t,n,i){this.id=e,this.name=t,this.attributes=n,this.value=void 0===i?null:i}function bv(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 wv(e,t){return(e=e.attributes.filter((function(e){return e.name==t}))).length?e[0]:null}function Tv(e,t,n){return(e=wv(e,t))?e.value:n||null}function xv(e,t){if(!(e=wv(e,t)))throw new Ne(2,4,4023,t);return e.value}function Sv(e,t,n){n=void 0===n?[]:n,this.aa=t,this.g=e,this.rc=n}function Av(e,t){this.name=e,this.value=t}function kv(e,t){return e.filter((function(e){return e.name==t}))}function Ev(e,t){return e.filter((function(e){return xv(e,"TYPE")==t}))}function Iv(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 Cv(e,t,n){return n=void 0===n?0:n,(e=Iv(e,t))?Number(e.value):n}function Mv(e,t,n){return t?Dv(e,[t],n):[]}function Dv(e,t,n){if(!t.length)return[];var i=t;return n&&n.size&&(i=t.map((function(e){return Pv(e,n)}))),Qe(e,i)}function Pv(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 Ne(2,4,4039,r);e=e.replace(i,a)}return e}function Rv(){this.g=0}function Lv(e,t){var n=(t=(t=Ue(t)).replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim()).split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(n[0]))throw new Ne(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=Nv(e,a),--e.g,Ov.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=Nv(e,o),jv.includes(o.name)){if(1!=t)throw new Ne(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=Nv(e,u),Ov.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"==Tv(u,"TYPE")?a.push(u):"MAP"==Tv(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 Sv(u,i,a)),i=[],a=[]);return a.length&&(s&&i.push(s),n.push(new Sv("",i,a))),new vv(t,r,n)}r.push(o),"EXT-X-STREAM-INF"==o.name&&(o.attributes.push(new Av("URI",s)),i=!0)}}return new vv(t,r)}function Nv(e,t){e=e.g++;var n=t.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!n)throw new Ne(2,4,4016,t);t=n[1];var i,r=n[2];if(n=[],r){var a;(a=Lt(r=new Pt(r),/^([^,=]+)(?:,|$)/g))&&(i=a[1]);for(var o=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;a=Lt(r,o);)n.push(new Av(a[1],a[2]||a[3])),Rt(r)}return new yv(e,t,n,i)}rv()&&(ne=function(){return new iv}),m(uv,Zm),(i=uv.prototype).xa=function(){return this.i.value()},i.Ob=function(){return this.g.value()},i.fe=function(e){return!!mr(e)&&"Edge"===this.g.value()&&this.h.value()},i.Ai=function(){return"Edge"===this.g.value()&&this.h.value()},i.$e=function(){return"Edge"===this.g.value()&&this.h.value()},i.cd=function(){return this.o.value()},i.Ua=function(e){if(Zm.prototype.Ua.call(this,e),this.h.value())switch(this.g.value()){case"Firefox":e.drm.keySystemsMapping={"com.microsoft.playready":"com.microsoft.playready.recommendation"};break;case"Chrome":e.drm.keySystemsMapping={"com.microsoft.playready":"com.microsoft.playready.recommendation.3000","com.microsoft.playready.recommendation":"com.microsoft.playready.recommendation.3000"}}return e},i.fh=function(){return"Edge"===this.g.value()||this.m.value()},i.$c=function(){if("GECKO"===this.Da()){var e=this.xa();return null!==e?100<=e:Zm.prototype.$c.call(this)}return Zm.prototype.$c.call(this)},i.Qg=function(e){return"GECKO"===this.Da()?e.startsWith("com.microsoft.playready.recommendation"):Zm.prototype.Qg.call(this,e)},ie=function(){return new uv},m(lv,Zm),(i=lv.prototype).xa=function(){return null},i.Ob=function(){return"Hisense"},i.La=function(){return"TV"},i.dc=function(){return!1},i.ic=function(){var t={width:1920,height:1080},n=null;if(e.Hisense_Get4KSupportState)try{n=e.Hisense_Get4KSupportState()}catch(e){}return null==n&&(n=navigator.userAgent.includes("UHD")),n&&(t.width=3840,t.height=2160),Promise.resolve(t)},i.Ua=function(e){return Zm.prototype.Ua.call(this,e),e.streaming.stallSkip=0,e},(navigator.userAgent.includes("Hisense")||navigator.userAgent.includes("VIDAA"))&&(ne=function(){return new lv}),m(cv,Zm),(i=cv.prototype).Ob=function(){return"PlayStation"},i.La=function(){return"CONSOLE"},i.Da=function(){return"WEBKIT"},i.xa=function(){return this.g.value()},i.dc=function(){return!1},i.bd=function(){return!1},i.cd=function(){return!1},i.ph=function(){return 4===this.xa()},i.ic=function(){var t,n,i,r;return R((function(a){switch(a.g){case 1:return t={width:1920,height:1080},n=!1,x(a,2),w(a,e.msdk.device.getDisplayInfo(),4);case 4:i=a.h,n="4K"===i.resolution,A(a,3);break;case 2:return k(a),x(a,5),w(a,e.msdk.device.getDisplayInfoImmediate(),7);case 7:r=a.h,n="4K"===r.resolution,A(a,3);break;case 5:q("PlayStation: Failed to get the display info:",k(a));case 3:return n&&(t.width=3840,t.height=2160),a.return(t)}}))},i.Ua=function(e){return Zm.prototype.Ua.call(this,e),4===this.xa()&&e.drm.preferredKeySystems.push("com.microsoft.playready"),e.streaming.clearDecodingCache=!0,e},i.fh=function(){return 4===this.xa()},i.If=function(){return 4!==this.xa()},navigator.userAgent.includes("PlayStation")&&(ne=function(){return new cv}),m(dv,Zm),(i=dv.prototype).xa=function(){return this.g},i.Ob=function(){return"Tizen"},i.Da=function(){return"CHROMIUM"},i.La=function(){return"TV"},i.fe=function(){return!0},i.ee=function(){return 3===this.xa()},i.dc=function(){return!1},i.bd=function(){var e=this.xa();return null!==e?4<=e:Zm.prototype.bd.call(this)},i.cd=function(){return!1},i.je=function(){return this.g&&this.h?5===this.g?5<=this.h:5<this.g:Zm.prototype.je.call(this)},i.ic=function(){var t=e.devicePixelRatio;t={width:1920<e.screen.width*t?3840:1920,height:1080<e.screen.height*t?2160:1080};try{if(webapis.systeminfo&&webapis.systeminfo.getMaxVideoResolution){var n=webapis.systeminfo.getMaxVideoResolution();t.width=n.width,t.height=n.height}else 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){q("Tizen: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(t)},i.Ua=function(e){return Zm.prototype.Ua.call(this,e),e.drm.ignoreDuplicateInitData=2!==this.xa(),3===this.xa()&&(e.streaming.crossBoundaryStrategy="reset_to_encrypted"),e.streaming.shouldFixTimestampOffset=!0,e.streaming.stallSkip=0,e.streaming.gapPadding=2,e},i.xi=function(){var e=[];return null!==this.g&&5>this.g&&e.push("opus"),e},i.li=function(){return!0},i.mi=function(){return 3===this.xa()},navigator.userAgent.includes("Tizen")&&(ne=function(){return new dv}),m(hv,Zm),hv.prototype.xa=function(){return null},hv.prototype.Ob=function(){return"Vizio"},hv.prototype.La=function(){return"TV"},hv.prototype.dc=function(){return!1},navigator.userAgent.includes("VIZIO SmartCast")&&(ne=function(){return new hv}),m(pv,Zm),(i=pv.prototype).xa=function(){return this.g.value()},i.Ob=function(){return"WebKit STB"},i.La=function(){return"TV"},i.Da=function(){return"WEBKIT"},i.dc=function(){return!1},i.bd=function(){var e=this.g.value();return null===e||15<=e},i.ic=function(){return Promise.resolve({width:e.screen.width*e.devicePixelRatio,height:e.screen.height*e.devicePixelRatio})},i.If=function(){return!this.h.value()},(navigator.userAgent.includes("DT_STB_BCM")||navigator.userAgent.includes("DT_STB_BCM")||!(!(navigator.vendor||"").includes("Apple")||/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||1<navigator.maxTouchPoints||navigator.userAgentData&&navigator.userAgentData.platform&&"macos"==navigator.userAgentData.platform.toLowerCase()||navigator.platform&&navigator.platform.toLowerCase().includes("mac")))&&(ne=function(){return new pv}),m(fv,Zm),(i=fv.prototype).xa=function(){return this.g},i.Ob=function(){return"WebOS"},i.La=function(){return"TV"},i.Da=function(){return"CHROMIUM"},i.dc=function(){return!1},i.bd=function(){var e=this.xa();return null!==e?3<e:Zm.prototype.bd.call(this)},i.cd=function(){var e=this.xa();return null!==e?6<e:Zm.prototype.cd.call(this)},i.je=function(){var e=this.xa();return null!==e?3<e:Zm.prototype.je.call(this)},i.ic=function(){var t={width:1920,height:1080};try{var n=JSON.parse(e.PalmSystem.deviceInfo);t.width=Math.max(1920,n.screenWidth),t.height=Math.max(1080,n.screenHeight)}catch(e){q("WebOS: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(t)},i.Ua=function(e){return Zm.prototype.Ua.call(this,e),3===this.xa()&&(e.streaming.crossBoundaryStrategy="reset"),e.streaming.shouldFixTimestampOffset=!0,e.streaming.stallSkip=0,e},i.Vi=function(){return!1},i.$c=function(){var e=this.xa();return null!==e?6<=e:Zm.prototype.$c.call(this)},navigator.userAgent.includes("Web0S")&&(ne=function(){return new fv}),m(gv,Zm),(i=gv.prototype).xa=function(){return this.h},i.Ob=function(){return"Xbox"},i.La=function(){return"CONSOLE"},i.Da=function(){return this.g?"EDGE":"CHROMIUM"},i.fe=function(){return!0},i.$e=function(){return!0},i.Pi=function(){return this.g},i.ic=function(){var e={width:1920,height:1080},t=mv();if(t)try{var n=new t.Media.Protection.ProtectionCapabilities,i=t.Media.Protection.ProtectionCapabilityResult;t=null;do{t=n.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(t===i.maybe);t===i.probably&&(e.width=3840,e.height=2160)}catch(e){q("Xbox: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(e)},i.Ua=function(e){return Zm.prototype.Ua.call(this,e),e.drm.parseInbandPsshEnabled=this.g,e.drm.preferredKeySystems.push("com.microsoft.playready"),this.g&&(e.streaming.gapPadding=.01),e},i.uh=function(){return!1},(navigator.userAgent.includes("Xbox One")||null!==mv())&&(ne=function(){return new gv}),yv.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 Ov="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(" "),jv="EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE EXT-X-MAP EXT-X-GAP EXT-X-TILES".split(" ");function Uv(){}function _v(e,t){try{var n=Bv(e);return Ir({uri:e,originalUri:e,data:n.data,headers:{"content-type":n.contentType},originalRequest:t})}catch(e){return kr(e)}}function Bv(t){var n=t.split(":");if(2>n.length||"data"!=n[0])throw new Ne(2,1,1004,t);if(2>(n=n.slice(1).join(":").split(",")).length)throw new Ne(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?We(t):Fe(t),contentType:i}}function Fv(){var t=this;this.g=this.h=null,this.G=1,this.A=new Map,this.K=new Map,this.B=new Map,this.B.set("video",new Map),this.B.set("audio",new Map),this.B.set(rt,new Map),this.B.set("image",new Map),this.$b=(new Map).set("com.apple.streamingkeydelivery",(function(n,i,r){return function(t,n,i,r){var a,o,s,u,l;return R((function(c){if(1==c.g){if("video/mp2t"==i)throw new Ne(2,4,4040);if("apple"===e.shakaMediaKeysPolyfill)throw new Ne(2,4,4041);if(a=xv(n,"METHOD"),!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(a))return c.return(null);o="cenc","SAMPLE-AES"==a&&(o="cbcs"),s=xv(n,"URI"),u=Ze("com.apple.fps",o,[{initDataType:"sinf",initData:new Uint8Array(0),keyId:null}],s);var d=new de(s).Cb.replace(/-/g,"").toLowerCase();return(l=32===d.length&&/^[0-9a-f]+$/.test(d)?d:null)||!r?c.u(2):w(c,My(t,r),3)}return 2!=c.g&&(l=c.h),l&&u.keyIds.add(l),c.return(u)}))}(t,n,i,r)})).set("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",(function(e){var t=xv(e,"METHOD");if(["SAMPLE-AES","SAMPLE-AES-CTR"].includes(t)){var n="cenc";"SAMPLE-AES"==t&&(n="cbcs"),n=Ze("com.widevine.alpha",n,[{initDataType:"cenc",initData:t=De((t=Bv((t=xv(e,"URI")).split("?")[0])).data)}]),(e=Tv(e,"KEYID"))&&n.keyIds.add(e.toLowerCase().substr(2)),e=Promise.resolve(n)}else e=Promise.resolve(null);return e})).set("com.microsoft.playready",(function(e){var t=xv(e,"METHOD");if(["SAMPLE-AES","SAMPLE-AES-CTR"].includes(t)){var n="cenc";"SAMPLE-AES"==t&&(n="cbcs"),n=Ze("com.microsoft.playready",n,[{initDataType:"cenc",initData:t=pa(e=De((e=Bv((e=xv(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)}]),(e=Kt(["<PLAYREADY>",Xe(e),"</PLAYREADY>"].join("\n")))&&(n.licenseServerUri=ag(e)),n=Promise.resolve(n)}else n=Promise.resolve(null);return n})).set("urn:uuid:3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c",(function(e){var t=xv(e,"METHOD");if(["SAMPLE-AES","SAMPLE-AES-CTR"].includes(t)){var n="cenc";"SAMPLE-AES"==t&&(n="cbcs"),n=Ze("com.huawei.wiseplay",n,[{initDataType:"cenc",initData:t=De((t=Bv((t=xv(e,"URI")).split("?")[0])).data)}]),(e=Tv(e,"KEYID"))&&n.keyIds.add(e.toLowerCase().substr(2)),e=Promise.resolve(n)}else e=Promise.resolve(null);return e})),this.ab=new Set,this.i=new Map,this.l=null,this.F="",this.Ya=new Rv,this.L=-1,this.ha=1/0,this.ba=this.qc=this.Za=!1,this.C=new Ti((function(){t.U&&!t.g.continueLoadingWhenPaused&&(t.S.Ja(t.U,"timeupdate"),t.U.paused)?t.S.Aa(t.U,"timeupdate",(function(){return Sy(t)})):Sy(t)})),this.za=Uy,this.m=null,this.Pa=0,this.o=1/0,this.Oa=this.Ka=this.P=0,this.W=new Nr,this.H=new Map,this.I=new Map,this.ya=new Map,this.na=new Map,this.M=new Map,this.va=new Map,this.wa=new Map,this.bc=this.ka=!1,this.eb=new V(5),this.j=null,this.N=!0,this.S=new $,this.s=this.U=null,this.Zb=function(){return!1}}function Vv(e,t){return Ay(e)?e.B.get(t.type):t.jf}function Hv(e,t){var n,i,r,a,o,s,u,d,h,p,f,g,m,v,y,b,S,E,I,C,M,D,P,L,N,O,j,U,_,B,F,V,H,K,G;return R((function(R){switch(R.g){case 1:if(t.stream.isAudioMuxedInVideo)return R.return();for(n=[],i=l(t.O()),r=i.next();!r.done;r=i.next())a=r.value,o=new de(a),s=o.g,t.Me&&(0<=t.Sb&&s.add("_HLS_msn",String(t.Sb)),0<=t.Tb&&s.add("_HLS_part",String(t.Tb))),t.Ne&&s.add("_HLS_skip","YES"),Ee(s)&&ge(o,me(s.toString())),n.push(o.toString());return x(R,2),w(R,xy(e,n,!0).promise,4);case 4:u=R.h,A(R,3);break;case 2:throw d=k(R),e.h&&e.h.disableStream(t.stream),d;case 3:if(!t.stream.segmentIndex)return R.return();if(1!=(h=Lv(e.Ya,u.data)).type)throw new Ne(2,4,4017);return(p=u.uri)==u.originalUri||t.O().includes(p)||t.zf.push(p),f=kv(h.aa,"EXT-X-DEFINE"),g=Xv(e,f,p),m=t.stream,v=Vv(e,t),w(R,uy(e,h,m.mimeType,t.O,g),5);case 5:for(y=R.h,b=y.keyIds,S=y.drmInfos,E=y.encrypted,I=y.Hh,m.encrypted||!E||I||(m.encrypted=!0),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=S,e.h.newDrmInfo(m)),C=vy(e,h,v,g,t.O,t.type),M=C.segments,(D=C.bandwidth)&&(m.bandwidth=D),P=Vu(m),L=l(M),N=L.next();!N.done;N=L.next())(O=N.value).Y&&(O.Y.rd=P);m.segmentIndex.Yd(M,e.l.Gb()),M.length&&(j=Cv(h.aa,"EXT-X-MEDIA-SEQUENCE",0),_=(U=Iv(h.aa,"EXT-X-SKIP"))?Number(Tv(U,"SKIPPED-SEGMENTS")):0,B=oy(j,M),F=B.Sb,V=B.Tb,t.Sb=F+_,t.Tb=V,H=v.get(j),m.segmentIndex.$a(H)),(K=Pu(m.segmentIndex))&&(t.Uc=K.startTime,G=M[M.length-1],t.mc=G.endTime),Iv(h.aa,"EXT-X-ENDLIST")&&(t.Rd=!0),dy(e,h),my(e,h.aa,m.type,g,t.O),T(R)}}))}function Kv(e,t,n){n=void 0!==n&&n;for(var i=-1==e.L,r=l(t),a=r.next();!a.done;a=r.next()){var o=(a=a.value).stream.segmentIndex,s=Vv(e,a);if(o=Pu(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.L=Math.max(e.L,c)),a.og=c;break}}}if(!(0>e.L))for(i=(t=l(t)).next();!i.done;i=t.next())(ry(e,(i=i.value).type)||n)&&(r=i.stream.segmentIndex)&&0<(a=e.L-i.og)&&(r.g.splice(0,a),r=Pu(r))&&(r=-r.startTime,i.stream.segmentIndex.offset(r),Gv(e,i,r))}function Gv(e,t,n){if(!(.001>Math.abs(n))){t.Uc+=n,t.mc+=n;for(var i=l(e=Vv(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.O()}}function zv(e,t,n){var i,r,a,o,s;return R((function(u){switch(u.g){case 1:return t?(i=Gr,r=rl(t.O(),t.Bc(),t.zc(),e.g.retryParameters),w(u,Ey(e,r,i,{type:t instanceof Vo?1:0}).promise,2)):u.return({mimeType:null,data:null});case 2:if(a=u.h,o=a.data,!t.aesKey){u.u(3);break}return w(u,il(o,t.aesKey,n),4);case 4:o=u.h;case 3:return t instanceof Vo?t.ge(o,!0):t.ge(o),(s=a.headers["content-type"])&&(s=s.split(";")[0].toLowerCase()),u.return({mimeType:s,data:o})}}))}function qv(e){if(Ay(e)){if(e.za==By){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.mc),n=Math.min(n,r.Uc));t=t-n||0,isNaN(e.g.availabilityWindowOverride)||(t=e.g.availabilityWindowOverride),e.l.Gf(t)}}else e.l.pb(ty(e));if(!e.l.o)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=Pu(n.stream.segmentIndex))&&n.h&&e.l.mh(n.h);e.l.hf()}function Xv(e,t,n){n=new de(n).g;for(var i=new Map,r=(t=l(t)).next();!r.done;r=t.next()){var a=r.value,o=Tv(a,"NAME"),s=Tv(a,"VALUE");r=Tv(a,"QUERYPARAM"),a=Tv(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 Wv(e){var t=new Set([ni(e.mimeType,e.codecs)]);e.segmentIndex&&e.segmentIndex.Eb((function(n){n.mimeType&&t.add(ni(n.mimeType,e.codecs))})),e.fullMimeTypes=t}function Yv(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=Tv(h,"AUDIO");var p=Tv(h,"VIDEO"),f=d||p;f&&(a.includes(f)||a.push(f),(h=Tv(h,"PATHWAY-ID"))&&r.set(f,h),d?o=!0:p&&(s=!0))}a.length&&n.length&&function(e,t,n){t=t.filter((function(e){var t=Tv(e,"URI")||"";return"SUBTITLES"!=(e=Tv(e,"TYPE"))&&(""!=t||"AUDIO"==e)}));for(var i={},r=(t=l(t)).next();!r.done;r=t.next()){var a=bv(r=r.value,!e.j);i[a]?i[a].push(r):i[a]=[r]}for(var o in i)Qv(e,i[o],n,!1)}(e,n=n.filter((function(e){return a.includes(xv(e,"GROUP-ID"))})),r),n=(r=a.sort().join(","))&&e.K.has(r)?e.K.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 xv(e,"URI")}));return d=i.audio.find((function(e){return e&&e.O().find((function(e){return g.includes(e)}))})),n=nt("video",s=Jv(e,t[0])),(u=nt("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.G++,a=[],o=l(t),s=o.next();!s.done;s=o.next()){var u=s.value;s=xv(u,"URI"),u=Tv(u,"PATHWAY-ID"),e.j&&u&&Fg(e.j,r,u,s),a.push(s)}if(o=a.sort().join(",")+n.sort().join(","),e.i.has(o))return e.i.get(o);s=a.join(",");e:{if(t=Tv(t[0],"CLOSED-CAPTIONS"),"video"==i){if(e.g.disableText){e.N=!1,t=null;break e}if(t){if("NONE"!=t){t=e.H.get(t);break e}e.N=!1}else if(!t&&e.H.size)for(t=l(e.H.keys()).next();!t.done;){t=e.H.get(t.value);break e}}t=null}return i=ey(e,r,a,n=tt(i,n),i,null,!1,s,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 Jv(e,t){return t=Tv(t,"CODECS")||"",e.ba=0<t.length,e.ba||e.g.hls.disableCodecGuessing||(t=[],e.g.disableVideo||t.push(e.g.hls.defaultVideoCodec),e.g.disableAudio||t.push(e.g.hls.defaultAudioCodec),t=t.join(",")),nl(t.split(/\s*,\s*/))}function $v(e,t,n,i,r,a,o,s,u,c,d,h){for(var p=l(n),f=p.next();!f.done;f=p.next())Ty(f.value.stream,r,a,o,s,u,null);for(r=e.g.disableVideo,n.length&&!r||(n=[null]),r&&(t=t.filter((function(e){return!e.stream.isAudioMuxedInVideo}))),r=e.g.disableAudio,t.length&&!r||(t=[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||nr(u,h)),u&&!s&&(u.bandwidth=i),!u&&s&&(s.bandwidth=i),p=a?a.stream.drmInfos:null,f=g?g.stream.drmInfos:null,g=g?g.O().sort().join(","):"";var m=a?a.O().sort().join(","):"",v=[];s&&s.codecs&&v.push(s.codecs),u&&u.codecs&&v.push(u.codecs),g=[g,m,v.sort()].join("-"),s&&u&&!fr(p,f)||e.ab.has(g)||(s={id:e.G++,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.ab.add(g))}return r}function Qv(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?xv(c,"URI"):Tv(c,"URI")||"shaka://hls-muxed",c=xv(c,"GROUP-ID"),r.push(u),a.push(c),o.set(c,u)}if(i=a.sort().join(","),u=t[0],t="","subtitles"==(s=xv(u,"TYPE").toLowerCase())&&(s=rt),s==rt)t=Tv(u,"CODECS")||"";else for(c=(a=l(a)).next();!c.done;c=a.next())if(c=c.value,e.I.has(c)){t=e.I.get(c);break}if(a=r.sort().join(","),e.i.has(a))return e.i.get(a);if(c=e.G++,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))&&Fg(e.j,c,d,h)}var p;return n=Tv(u,"LANGUAGE"),o=Tv(u,"NAME"),d="YES"==Tv(u,"DEFAULT"),h="audio"==s&&(h=Tv(u,"CHANNELS"))?parseInt(h.split("/")[0],10):null,p=!("audio"!=s||!(p=Tv(u,"CHANNELS")))&&(2==(p=p.split("/")).length&&("JOC"===p[1]||p[1].includes("ATMOS"))),(r=ey(e,c,r,t,s,n,d,o,h,null,Tv(u,"CHARACTERISTICS"),"YES"==Tv(u,"FORCED"),u="audio"==s&&(u=Tv(u,"SAMPLE-RATE"))?parseInt(u,10):null,p)).stream&&(r.stream.groupId=i),e.K.has(i)?e.K.get(i).push(r):e.K.set(i,[r]),e.i.set(a,r),r}function Zv(e,t){var n="video",i=xv(t,"URI"),r=Tv(t,"CODECS")||"";if("mjpg"==r&&(n="image"),e.i.has(i))return e.i.get(i);var a=Tv(t,"LANGUAGE"),o=Tv(t,"NAME"),s=Tv(t,"CHARACTERISTICS");return n=ey(e,e.G++,[i],r,n,a,!1,o,null,null,s,!1,null,!1),a=l((r=Tv(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=Tv(t,"BANDWIDTH"))&&(n.stream.bandwidth=Number(t)),e.i.set(i,n),n}function ey(e,t,n,i,r,a,o,s,u,c,d,h,p,f){function g(){return e.j&&1<n.length?Vg(e.j,t):y.zf.concat(Dv([e.F],n,e.A))}var m=sy(e,i,r,a,o,s,u,c,d,h,p,f);n.includes("shaka://hls-muxed")&&(m.isAudioMuxedInVideo=!0,m.mimeType="video/mp2t",Wv(m));var v,y={stream:m,type:r,zf:[],Uc:0,mc:0,jf:new Map,Ne:!1,Me:!1,Rd:!1,og:-1,Sb:-1,Tb:-1,O:g},b=null;return m.createSegmentIndex=function(){return b||(m.isAudioMuxedInVideo?(m.segmentIndex=new Du([]),Promise.resolve()):(v=xy(e,y.O(),!0),b=new Promise((function(t){t(function(t){var n,v,b,S,E,I,C,M,D,P,L,N,O,j,U,_,B,F;return R((function(R){switch(R.g){case 1:return n=at,x(R,2),w(R,t.promise,4);case 4:if(v=R.h,t.aborted)return R.return();if((b=v.uri)!=v.originalUri&&(y.O().includes(b)||y.zf.push(b)),1!=(S=Lv(e.Ya,v.data)).type)throw new Ne(2,4,4017);return E=kv(S.aa,"EXT-X-DEFINE"),I=Xv(e,E,b),C=!1,(!e.ba&&e.g.hls.disableCodecGuessing||e.N&&r==n.Ca&&!e.g.hls.disableClosedCaptionsDetection)&&0<S.segments.length&&(e.N=!1,C=!0),M=!e.ba&&e.g.hls.disableCodecGuessing,D=Ay(e),w(R,ay(e,0,I,S,g,i,r,a,o,s,u,c,d,h,p,f,void 0,C,M),5);case 5:if(P=R.h,t.aborted)return R.return();L=P.stream,cy(e,S),Ay(e)&&!D&&hy(e,S),y.Uc=P.Uc,y.mc=P.mc,y.Ne=P.Ne,y.Me=P.Me,y.Rd=P.Rd,y.jf=P.jf,y.Sb=P.Sb,y.Tb=P.Tb,m.segmentIndex=L.segmentIndex,m.encrypted=L.encrypted,m.drmInfos=L.drmInfos,m.keyIds=L.keyIds,m.mimeType=L.mimeType,m.bandwidth=m.bandwidth||L.bandwidth,m.codecs=m.codecs||L.codecs,m.closedCaptions=m.closedCaptions||L.closedCaptions,m.width=m.width||L.width,m.height=m.height||L.height,m.hdr=m.hdr||L.hdr,m.colorGamut=m.colorGamut||L.colorGamut,m.frameRate=m.frameRate||L.frameRate,"und"==m.language&&"und"!=L.language&&(m.language=L.language),m.language=m.language||L.language,m.channelsCount=m.channelsCount||L.channelsCount,m.audioSamplingRate=m.audioSamplingRate||L.audioSamplingRate,Wv(m),m.drmInfos.length&&e.h.newDrmInfo(m),N=!1,(!c&&m.closedCaptions||c&&m.closedCaptions&&c.size!=m.closedCaptions.size)&&(N=!0),e.m&&N&&e.h.makeTextStreamsForClosedCaptions(e.m),r==n.Ta&&(O=Pu(L.segmentIndex))&&O.Y&&(m.mimeType="application/mp4",Wv(m)),j=Vu(m),m.segmentIndex.Eb((function(e){e.Y&&(e.Y.rd=j)})),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.qc?iy(e,[y]):(e.qc=!0,U=Array.from(e.i.values()),_=U.filter((function(e){return e.stream.segmentIndex})),iy(e,_),qv(e),0<(B=e.o)&&e.C.ia(B))),my(e,S.aa,m.type,I,g),e.m&&(e.m.startTime=e.s),A(R,0);break;case 2:if(F=k(R),m.closeSegmentIndex(),7001===F.code)return R.return();if(!e.h.disableStream(m))throw F;T(R)}}))}(v))}))))},m.closeSegmentIndex=function(){b&&!m.segmentIndex&&v.abort(),m.segmentIndex&&(m.segmentIndex.release(),m.segmentIndex=null),b=null},y}function ty(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.mc));return t}function ny(e,t){for(var n=[],i=(t=l(t)).next();!i.done;i=t.next())(i=i.value).segmentIndex&&i.segmentIndex.Eb((function(e){n.push(e)}));e.l.$d(n)}function iy(e,t){if(!Ay(e))for(var n=ty(e),i=l(t),r=i.next();!r.done;r=i.next())r.value.stream.segmentIndex.ld(0,n);ny(e,t.map((function(e){return e.stream}))),n=(i=Array.from(e.i.values()).filter((function(e){return e.stream.segmentIndex}))).some((function(e){return"audio"==e.stream.type})),r=i.some((function(e){return"video"==e.stream.type})),i=Ay(e)&&!e.Za,n=!Ay(e)&&e.Za&&!(n&&r),e.g.hls.ignoreManifestProgramDateTime||i||n?Kv(e,t,i):(function(e,t){if(1/0==e.ha)for(var n=(t=l(t)).next();!n.done;n=t.next())null!=(n=Pu(n.value.stream.segmentIndex))&&null!=n.h&&(e.ha=Math.min(e.ha,n.h));if(1/0!=(t=e.ha))for(var i=(n=l(e.i.values())).next();!i.done;i=n.next())if(!ry(e,(i=i.value).type)){var r=i.stream.segmentIndex;if(null!=r){var a=Pu(r);if(a)if(null==a.h)z("Missing EXT-X-PROGRAM-DATE-TIME for stream",i.O(),"Expect AV sync issues!");else for(Gv(e,i,a.h-t-a.startTime),r=(i=l(r)).next();!r.done;r=i.next())r.value.vh(t)}}}(e,t),0<e.g.hls.ignoreManifestProgramDateTimeForTypes.length&&Kv(e,t))}function ry(e,t){return!!e.g.hls.ignoreManifestProgramDateTime||e.g.hls.ignoreManifestProgramDateTimeForTypes.includes(t)}function ay(e,t,n,i,r,a,o,s,u,c,d,h,p,f,g,m,v,y,b){var T,S,E,I,C,M,D,P,L,N,O,j,U,_,B,F,V,H,K,G,z,q,X,W,Y,J,$,Q,Z;return y=void 0===y||y,b=void 0===b||b,R((function(t){switch(t.g){case 1:if(T=i.segments||[],S=T.every((function(e){return!!Iv(e.aa,"EXT-X-GAP")})),!T.length||S)throw new Ne(2,4,4053);if(function(e,t){var n=Iv(t.aa,"EXT-X-PLAYLIST-TYPE");t=Iv(t.aa,"EXT-X-ENDLIST"),t=n&&"VOD"==n.value||t,n=n&&"EVENT"==n.value&&!t,n=!t&&!n,ky(e,t?Uy:n?By:_y)}(e,i),Ay(e)&&dy(e,i),E=Ay(e)?e.B.get(o):new Map,I=vy(e,i,E,n,r,o),C=I.segments,M=I.bandwidth,O=N=L=P=D=null,!(0<C.length&&y)){t.u(2);break}return w(t,function(e,t){var n,i,r,a,o,s,u,c,d,h,p,f,g,m,v,y,b,T;return R((function(x){if(1==x.g)return n=tl(e.g.hls.mediaPlaylistFullMimeType),t.length?(i=wy(e,t),r=i.segment,a=i.segmentIndex,o=r.O(),s=o[0],u=new de(s),c=u.ob.split(".").pop(),(d=Dy.get(c))?x.return(tl(d)):w(x,Promise.all([zv(e,r.Y,0),zv(e,r,a)]),2)):x.return(n);if(h=x.h,p=h[1].mimeType,f=h[0].data,g=h[1].data,m="mp4 mp4a m4s m4i m4a m4f cmfa mp4v m4v cmfv fmp4".split(" "),v=["audio/mp4","video/mp4","video/iso.segment"],!(y=r.Y||v.includes(p))&&Is(De(g))){var S=g,A=e.g.disableAudio,k=e.g.disableVideo,E=e.g.disableText,I=De(S),C=(new Ss).parse(I),M=C.Od();I=C.Ig();var D=[],P=!1,R=!1;if(!A)switch(M.audio){case"aac":case"aac-loas":C.sb().length&&(D.push("mp4a.40.2"),P=!0);break;case"mp3":C.sb().length&&(D.push("mp4a.40.34"),P=!0);break;case"ac3":C.sb().length&&(D.push("ac-3"),P=!0);break;case"ec3":C.sb().length&&(D.push("ec-3"),P=!0);break;case"opus":C.sb().length&&(D.push("opus"),P=!0)}if(!k)switch(M.video){case"avc":I.codec?D.push(I.codec):D.push("avc1.42E01E"),R=!0;break;case"hvc":I.codec?D.push(I.codec):D.push("hvc1.1.6.L93.90"),R=!0;break;case"av1":D.push("av01.0.01M.08"),R=!0}if(D.length){if(A=P&&!R,k=new Map,R&&!E){for((E=new bt("video/mp2t")).vf(S),R=(S=l(E.Uf())).next();!R.done;R=S.next())R=R.value,k.set(R,R);E.Fd()}I={type:A?"audio":"video",mimeType:"video/mp2t",codecs:D.join(", "),language:null,height:I.height,width:I.width,channelCount:null,sampleRate:null,closedCaptions:k,oe:null,colorGamut:null,frameRate:I.frameRate}}else I=null;if(b=I)return x.return(b)}else if((y||m.includes(c))&&(T=function(e,t,n){function i(e){o=e.name;var t=e.reader;t.skip(24);var n=t.Ba(),i=t.Ba();t.skip(50),f=String(n),p=String(i),e.reader.Ga()&&na(e)}function r(e){var t=ro(e.reader);g=t.channelCount,m=t.sampleRate,a(e.name)}function a(e){switch(e=e.toLowerCase()){case"avc1":case"avc3":u.push(e+".42E01E"),d=!0;break;case"hev1":case"hvc1":u.push(e+".1.6.L93.90"),d=!0;break;case"dvh1":case"dvhe":u.push(e+".05.04"),d=!0;break;case"vp09":u.push(e+".00.10.08"),d=!0;break;case"av01":u.push(e+".0.01M.08"),d=!0;break;case"mp4a":s.push("mp4a.40.2"),c=!0;break;case"ac-3":case"ec-3":case"ac-4":case"opus":case"flac":s.push(e),c=!0;break;case"apac":s.push("apac.31.00"),c=!0}}var o,s=[],u=[],c=!1,d=!1,h=null,p=null,f=null,g=null,m=null,v=null,y=null;if((new ta).box("moov",na).box("trak",na).box("mdia",na).R("mdhd",(function(e){h=no(e.reader,e.version).language})).box("minf",na).box("stbl",na).R("stsd",ia).box("mp4a",(function(e){var t=ro(e.reader);g=t.channelCount,m=t.sampleRate,e.reader.Ga()?na(e):a(e.name)})).box("esds",(function(e){e=e.reader;for(var t,n,i="mp4a";e.Ga();){t=e.X();for(var r=e.X();128&r;)r=e.X();if(3==t)e.Ba(),128&(r=e.X())&&e.Ba(),64&r&&e.skip(e.X()),32&r&&e.Ba();else if(4==t)n=e.X(),e.skip(12);else if(5==t)break}n&&(i+="."+oo(n),5==t&&e.Ga()&&(31==(n=(248&(t=e.X()))>>3)&&e.Ga()&&(n=32+((7&t)<<3)+((224&e.X())>>5)),i+="."+n)),s.push(i),c=!0})).box("ac-3",r).box("ec-3",r).box("ac-4",r).box("Opus",r).box("fLaC",r).box("apac",r).box("avc1",i).box("avc3",i).box("hev1",i).box("hvc1",i).box("dva1",i).box("dvav",i).box("dvh1",i).box("dvhe",i).box("vp09",i).box("av01",i).box("avcC",(function(e){var t=o||"";switch(o){case"dvav":t="avc3";break;case"dva1":t="avc1"}(e=e.reader).skip(1),e=t+"."+oo(e.X())+oo(e.X())+oo(e.X()),u.push(e),d=!0})).box("hvcC",(function(e){var t=o||"";switch(o){case"dvh1":t="hvc1";break;case"dvhe":t="hev1"}var n=e.reader;n.skip(1);var i=["","A","B","C"][(e=n.X())>>6],r=31&e,a=n.T(),s=(32&e)>>5?"H":"L";e=[n.X(),n.X(),n.X(),n.X(),n.X(),n.X()],n=n.X();for(var l=0,c=0;32>c&&(l|=1&a,31!=c);c++)l<<=1,a>>=1;for(t=t+"."+i+r+"."+oo(l,!0),t+="."+s+n,i="",r=e.length;r--;)((s=e[r])||i)&&(i="."+s.toString(16).toUpperCase()+i);t+=i,u.push(t),d=!0})).box("dvcC",(function(e){var t=o||"";switch(o){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.X(),n=n.X(),u.push(t+"."+so(e>>1&127)+"."+so(e<<5&32|n>>3&31)),d=!0})).box("dvvC",(function(e){var t=o||"";switch(o){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.X(),n=n.X(),u.push(t+"."+so(e>>1&127)+"."+so(e<<5&32|n>>3&31)),d=!0})).R("vpcC",(function(e){var t=o||"",n=e.reader;e=n.X();var i=n.X();n=n.X()>>4&15,u.push(t+"."+so(e)+"."+so(i)+"."+so(n)),d=!0})).box("av1C",(function(e){var t=o||"";"dav1"===o&&(t="av01");var n=e.reader;n.skip(1);var i=(e=n.X())>>>5,r=(64&(n=n.X()))>>6;u.push(t+"."+i+"."+so(31&e)+(n>>>7?"H":"M")+"."+so(2===i&&r?(32&n)>>5?12:10:r?10:8)+"."+((16&n)>>4)+"."+((8&n)>>3)+((4&n)>>2)+(3&n)+"."+so(1)+"."+so(1)+"."+so(1)+".0"),d=!0})).box("enca",aa).box("encv",ra).box("sinf",na).box("frma",(function(e){a(e=ao(e.reader).codec)})).box("colr",(function(e){u=u.map((function(t){if(t.startsWith("av01.")){var n=e.reader,i=n.Ma(),r=n.Ub(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.Ba(),a=n.Ba();var o=n.Ba(),s=n.X()>>7,u=t.split(".");10==u.length&&(u[6]=so(r),u[7]=so(a),u[8]=so(o),u[9]=String(s),t=u.join("."))}n.seek(i)}return t}));var t=function(e){var t=null,n=null,i=e.Ub(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.Ba()){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.Ba(),e.Ba(),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,oe:n}}(e.reader),n=t.colorGamut;v=t.oe,y=n})).parse(e||t,!0,!0),!s.length&&!u.length)return null;var b=c&&!d,w=new Map;if(d&&!n){n=new bt("video/mp4"),e&&n.init(e);try{n.vf(t);for(var T=l(n.Uf()),x=T.next();!x.done;x=T.next()){var S=x.value;w.set(S,S)}}catch(e){}n.Fd()}return{type:b?"audio":"video",mimeType:b?"audio/mp4":"video/mp4",codecs:nl(s.concat(u)).join(", "),language:h,height:p,width:f,channelCount:g,sampleRate:m,closedCaptions:w,oe:v,colorGamut:y,frameRate:null}}(f,g,e.g.disableText)))return x.return(T);return p?x.return(tl(p)):x.return(n)}))}(e,C),3);case 3:j=t.h,o!=j.type&&Ay(e)&&(e.B.set(j.type,e.B.get(o)),e.B.set(o,new Map)),o=j.type,s=j.language,d=j.channelCount,g=j.sampleRate,e.g.disableText||(h=j.closedCaptions),P=j.height,D=j.width,L=j.oe,N=j.colorGamut,O=j.frameRate,b&&(v=j.mimeType,a=j.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,p,f,g,m;return R((function(v){switch(v.g){case 1:return r=Gr,a=wy(e,i),2==(o=a.segment).status?v.return(by(t)):(s=o.O(),u=new de(s[0]),l=u.ob.split(".").pop(),c=Oy.get(t),(d=c.get(l))||(d=Dy.get(l))||(d=yy(t,n))?v.return(d):(p=1,f=Br(s,e.g.retryParameters),x(v,2),f.method="HEAD",w(v,Ey(e,f,r,{type:p}).promise,4)));case 4:g=v.h,h=g.headers["content-type"],A(v,3);break;case 2:if(!(m=k(v))||1002!=m.code&&1001!=m.code){v.u(3);break}return f.method="GET",e.g.hls.allowRangeRequestsToGuessMimeType&&(f.headers.Range="bytes=0-0"),w(v,Ey(e,f,r,{type:p}).promise,6);case 6:g=v.h,h=g.headers["content-type"];case 3:if(!h){v.u(7);break}if("application/octet-stream"!=(d=h.toLowerCase().split(";")[0])){v.u(8);break}if(g.data.byteLength){v.u(9);break}return f.method="GET",w(v,Ey(e,f,r,{type:p}).promise,10);case 10:g=v.h;case 9:Is(De(g.data))&&(d="video/mp2t");case 8:if("application/octet-stream"!=d)return v.return(d);case 7:return v.return(by(t))}}))}(e,o,a,C),5);case 5:v=t.h,o!=rt||a||"application/mp4"!=v||!C[0]||C[0].Y||(v="text/vtt");case 4:return w(t,uy(e,i,v,r,n),6);case 6:if(U=t.h,_=U.drmInfos,B=U.keyIds,F=U.encrypted,V=U.Hh,F&&!_.length&&!V)throw new Ne(2,4,4026);return(H=sy(e,a,o,s,u,c,d,h,p,f,g,m)).encrypted=F&&!V,H.drmInfos=_,H.keyIds=B,H.mimeType=v,M&&(H.bandwidth=M),Wv(H),"video"==o&&(D||P||L||N)&&Ty(H,D,P,O,L,null,N),Ay(e)&&dy(e,i),K=C[0].startTime,G=C[C.length-1],z=G.endTime,q=new Du(C),H.segmentIndex=q,W=!!(X=Iv(i.aa,"EXT-X-SERVER-CONTROL"))&&null!=wv(X,"CAN-SKIP-UNTIL"),Y=!!X&&null!=wv(X,"CAN-BLOCK-RELOAD"),J=Cv(i.aa,"EXT-X-MEDIA-SEQUENCE",0),$=oy(J,C),Q=$.Sb,Z=$.Tb,t.return({stream:H,type:o,zf:[],O:r,Uc:K,mc:z,Ne:W,Me:Y,Rd:!1,og:-1,Sb:Q,Tb:Z,jf:E})}}))}function oy(e,t){e=e+t.length-1;var n=-1;if(!t.length)return{Sb:++e,Tb: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,Tb:n}):(e++,t.m&&(n=0),{Sb:e,Tb:n})}function sy(e,t,n,i,r,a,o,s,u,c,d,h){var p=yy(n,t)||by(n),f=[];if(u)for(var g=(u=l(u.split(","))).next();!g.done;g=u.next())f.push(g.value);return u=void 0,g=null,n==rt?u=f.includes("public.accessibility.transcribes-spoken-dialog")&&f.includes("public.accessibility.describes-music-and-sound")?"caption":"subtitle":f.includes("public.accessibility.describes-video")&&(g="visually impaired"),f.length||"subtitle"!==u||f.push("subtitle"),Wv(e={id:e.G++,originalId:a,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:p,codecs:t,kind:n==rt?"subtitle":void 0,encrypted:!1,drmInfos:[],keyIds:new Set,language:Di(i||"und"),originalLanguage:i,label:a,type:n,primary:r,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,frameRate:void 0,pixelAspectRatio:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:f,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,baseOriginalId:null}),e}function uy(e,t,n,i,r){var a,o,s,u,c,d,h,p,f,g,m,v,y,b,T,x,S,A,k,E,I,C,M,D,P,L,N,O,j;return R((function(R){switch(R.g){case 1:if(a=new Map,!e.g.ignoreDrmInfo&&t.segments)for(o=l(t.segments),s=o.next();!s.done;s=o.next())if(u=s.value,c=kv(u.aa,"EXT-X-KEY"),d=null,c.length)for(d=py(e,t,u.aa,i,r),h=l(c),p=h.next();!p.done;p=h.next())f=p.value,a.set(f,d);m=g=!1,v=[],y=new Set,b=l(a),T=b.next();case 2:if(T.done){R.u(4);break}if(x=T.value,S=l(x),A=S.next().value,k=S.next().value,I=k,"NONE"==(C=xv(E=A,"METHOD"))){R.u(3);break}if(g=!0,M=Tv(E,"KEYFORMAT")||"identity",D=null,Iy(C)){m=!0,R.u(3);break}if("identity"==M)return w(R,Cy(e,E,n,i,I,r),11);if(!(P=e.$b.get(M))){L=null,R.u(9);break}return w(R,P(E,n,I),10);case 10:L=R.h;case 9:D=L,R.u(6);break;case 11:D=R.h;case 6:if(D){if(D.keyIds)for(N=l(D.keyIds),O=N.next();!O.done;O=N.next())j=O.value,y.add(j);v.push(D)}case 3:T=b.next(),R.u(2);break;case 4:return R.return({drmInfos:v,keyIds:y,encrypted:g,Hh:m})}}))}function ly(t,n,i,r,a){if(!e.crypto||!e.crypto.subtle)throw q("Web Crypto API is not available to decrypt AES. (Web Crypto only exists in secure origins like https)"),new Ne(2,4,4042);var o=0,s=Tv(n,"IV","");if(s){var u=Ye(s.substr(2));if(16!=u.byteLength)throw new Ne(2,4,4048)}else o=Cv(i.aa,"EXT-X-MEDIA-SEQUENCE",0);var l=Mv(r(),xv(n,"URI"),a),c=l.sort().join("");if(i=n.toString()+"-"+o+"-"+c,!t.na.has(i)){var d={bitsKey:128,blockCipherMode:"CBC",iv:u,firstMediaSequenceNumber:o};switch(xv(n,"METHOD")){case"AES-256":d.bitsKey=256;break;case"AES-256-CTR":d.bitsKey=256,d.blockCipherMode="CTR"}d.fetchKey=function(){var n,i,r,a;return R((function(o){if(1==o.g)return t.M.has(c)||(n=Br(l,t.g.retryParameters),i=Ey(t,n,6).promise,t.M.set(c,i)),w(o,t.M.get(c),2);if(3!=o.g){if(!(r=o.h).data||r.data.byteLength!=d.bitsKey/8)throw new Ne(2,4,4049);return a={name:"CTR"==d.blockCipherMode?"AES-CTR":"AES-CBC",length:d.bitsKey},w(o,e.crypto.subtle.importKey("raw",r.data,a,!0,["decrypt"]),3)}d.cryptoKey=o.h,d.fetchKey=void 0,T(o)}))},t.na.set(i,d)}return t.na.get(i)}function cy(e,t){null==e.s&&(t=Iv(t.aa,"EXT-X-START"))&&(e.s=Number(xv(t,"TIME-OFFSET")))}function dy(e,t){var n=1/0,i=t.segments;if(i.length)for(var r=i.length-1;0<=r;){var a=Iv(i[r].aa,"EXTINF");if(a){n=Number(a.value.split(",")[0]);break}r--}if(!(i=Iv(t.aa,"EXT-X-TARGETDURATION")))throw new Ne(2,4,4024,"EXT-X-TARGETDURATION");i=Number(i.value),(r=Iv(t.aa,"EXT-X-PART-INF"))&&(e.P=Number(xv(r,"PART-TARGET"))),t=Iv(t.aa,"EXT-X-SERVER-CONTROL"),e.ka&&e.P?(e.o=e.bc?5*e.P<=n?Math.min(e.P,e.o):Math.min(n,e.o):Math.min(e.P,e.o),e.Oa=t?Number(xv(t,"PART-HOLD-BACK")):0):(e.o=Math.min(n,e.o),n=t?wv(t,"HOLD-BACK"):null,e.Ka=n?Number(n.value):0),e.Pa=Math.max(i,e.Pa)}function hy(e,t){var n=0;if(e.g.defaultPresentationDelay)n=e.g.defaultPresentationDelay;else if(e.Oa)n=e.Oa;else if(e.Ka)n=e.Ka;else for(var i=t.segments.length,r=i-Math.min(i,e.g.hls.liveSegmentsDelay);r<i;r++){var a=Iv(t.segments[r].aa,"EXTINF");n=a?n+Number(a.value.split(",")[0]):n+e.Pa}e.s&&0>e.s&&(n=Math.min(-e.s,n),e.s+=n),e.l.Li(0),e.l.lh(n),e.l.Zc(!1)}function py(e,t,n,i,r){var a=Iv(n,"EXT-X-MAP");if(!a)return null;var o=xv(a,"URI"),s=Mv(i(),o,r);if(o=[s.toString(),Tv(a,"BYTERANGE","")].join("-"),!e.ya.has(o)){for(var u=void 0,c=null,d=!1,h=(n=l(n)).next();!h.done;h=n.next())"EXT-X-KEY"==(h=h.value).name?Iy(d=xv(h,"METHOD"))&&h.id<a.id?(d=!1,u=ly(e,h,t,i,r)):d="NONE"!=d:"EXT-X-BYTERANGE"==h.name&&h.id<a.id&&(c=h);t=function(e,t,n,i,r){var a=0,o=null;return!(t=Tv(t,"BYTERANGE"))&&n&&(t=n.value),t&&(a=t.split("@"),o=Number(a[0]),o=(a=Number(a[1]))+o-1,i&&((n=o+1-a)%16&&(o+=16-n%16))),new Bo((function(){return e}),a,o,null,null,null,i,r)}(s,a,c,u,d),e.ya.set(o,t)}return e.ya.get(o)}function fy(t,n,i,r,a,o,s,u,c){function d(e){e=new de(e).ob.split(".").pop();var t=Oy.get(s).get(e);return t||(t=Dy.get(e)),t}var h=r.aa,p=Iv(h,"EXTINF"),f=0,g=0,m=null;r.rc.length&&(t.m.isLowLatency=!0);var v=null;if(!t.g.hls.ignoreManifestProgramDateTime){var y=Iv(h,"EXT-X-PROGRAM-DATE-TIME");y&&y.value&&(v=rn(y.value),t.Za=!0)}var b=Ko;if(Iv(h,"EXT-X-GAP")&&(t.m.gapCount++,b=2),!p){if(0==r.rc.length)throw new Ne(2,4,4024,"EXTINF");if(!t.ka)return null}var w=[];y=!1;var T=null,x=!1,S=!1;if(t.ka&&r.rc.length){f=n&&e.ReadableStream&&t.g.hls.allowLowLatencyByteRangeOptimization;for(var A=v,k={},E=0;E<r.rc.length;k={Of:void 0,uf:void 0},E++){var I=r.rc[E],C=0==E?i:w[w.length-1],M=0==E?a:C.endTime,D=Number(Tv(I,"DURATION"))||t.P;if(D){var P=M+D,R=0,L=null;if("EXT-X-PRELOAD-HINT"==I.name?(R=(R=Tv(I,"BYTERANGE-START"))?Number(R):0,(C=Tv(I,"BYTERANGE-LENGTH"))?L=R+Number(C)-1:R&&(L=Number.MAX_SAFE_INTEGER)):(R=(L=l(gy(C,R=Tv(I,"BYTERANGE")))).next().value,L=L.next().value),k.uf=Tv(I,"URI"),k.uf){C=Ko,"YES"==Tv(I,"GAP")&&(t.m.gapCount++,C=2,x=!0),k.Of=null;var N=function(e){return function(){return null==e.Of&&(e.Of=Mv(u(),e.uf,o)),e.Of}}(k);f&&0<=R&&null!=L&&(T=N,y=!0),M=new Vo(M,P,N,R,L,n,0,0,1/0,[],"",null,A,C,c),"EXT-X-PRELOAD-HINT"==I.name&&(M.Pg(),S=!0),"YES"!=Tv(I,"INDEPENDENT")&&0<E&&M.qd(),(k=d(k.uf))&&(M.mimeType=k,jy.has(k)&&(M.Y=null)),w.push(M),A&&(A+=D)}}}}if(p){if(0==(p=Number(p.value.split(",")[0])))return null;f=a+p}else{if(!w.length)return null;f=w[w.length-1].endTime}y&&(x||0!=w[0].startByte?(y=!1,T=null):w=[]),(p=Iv(h,"EXT-X-BYTERANGE"))?(g=(m=l(gy(i,p.value))).next().value,m=m.next().value):w.length&&(g=w[0].startByte,m=w[w.length-1].endByte),i="",p=null,"image"==s&&(i="1x1",h=Iv(h,"EXT-X-TILES"))&&(i=xv(h,"LAYOUT"),(h=Tv(h,"DURATION"))&&(p=Number(h)));var O=null;return n=new Vo(a,f,(function(){return T?T():(null==O&&(O=Mv(u(),r.g,o)),O||[])}),g,m,n,0,0,1/0,w,i,p,v,b,c,0<w.length&&!!r.g),(a=d(r.g))&&(n.mimeType=a,jy.has(a)&&(n.Y=null)),y&&(t.bc=!0,n.ii(),S&&n.Pg()),n}function gy(e,t){var n=0,i=null;return t&&(n=t.split("@"),t=Number(n[0]),i=(n=n[1]?Number(n[1]):e.endByte+1)+t-1),[n,i]}function my(e,t,n,i,r){if("video"==n||"audio"==n){var a=e.l.m;if(a&&!ry(e,n))for(t=(t=kv(t,"EXT-X-DATERANGE")).filter((function(e){return null!=wv(e,"START-DATE")})).sort((function(e,t){return(e=xv(e,"START-DATE"))<(t=xv(t,"START-DATE"))?-1:e>t?1:0})),n=0;n<t.length;n++){var o=t[n];try{var s=rn(xv(o,"START-DATE"));if(!isNaN(s)){var u=Math.max(0,s-a),c=null,d=Tv(o,"END-DATE");if(d){var h=rn(d);if(!isNaN(h)&&0>(c=h-a))continue}if(null==c){var p=Tv(o,"DURATION")||Tv(o,"PLANNED-DURATION");if(p){var f=parseFloat(p);if(isNaN(f)||(c=u+f),0>s-a+f)continue}}var g=Tv(o,"CLASS")||"com.apple.quicktime.HLS",m="YES"==Tv(o,"END-ON-NEXT");if(null==c&&m){for(var v=n+1;v<t.length;v++)if(g==(Tv(t[v],"CLASS")||"com.apple.quicktime.HLS")){var y=rn(xv(t[v],"START-DATE"));if(!isNaN(y)&&y&&y>s){c=Math.max(0,y-a);break}}if(null==c)continue}v=["CLASS","START-DATE","END-DATE","DURATION","END-ON-NEXT"];for(var b=[],w=l(o.attributes),T=w.next();!T.done;T=w.next()){var x=T.value;if(!v.includes(x.name)){var S=Pv(x.value,i);"X-ASSET-URI"!=x.name&&"X-ASSET-LIST"!=x.name||(S=Mv(r(),x.value,i)[0]),b.push({key:x.name,description:"",data:S,mimeType:null,pictureType:null})}}1<b.length&&e.h.onMetadata(g,u,c,b)}}catch(e){}}}}function vy(e,t,n,i,r,a){var o=t.segments,s=void 0,u=Cv(t.aa,"EXT-X-DISCONTINUITY-SEQUENCE",-1),c=Cv(t.aa,"EXT-X-MEDIA-SEQUENCE",0),d=Iv(t.aa,"EXT-X-SKIP"),h=d?Number(Tv(d,"SKIPPED-SEGMENTS")):0,p=c+h,f=0;Ay(e)&&n.has(p)&&(f=n.get(p)),0===f&&e.za==By&&0<n.size&&!n.has(p)&&null!=e.l.i&&(f=e.l.Gb());var g=[],m=null;d=[];for(var v=0;v<o.length;v++){var y=o[v],b=0==v?f:m.endTime;p=c+h+v,Iv(y.aa,"EXT-X-DISCONTINUITY")&&(u++,m&&m.Y&&(m.Y.g=b));for(var w=l(y.aa),T=w.next();!T.done;T=w.next())"EXT-X-KEY"==(T=T.value).name&&(s=Iy(xv(T,"METHOD"))?ly(e,T,t,r,i):void 0);n.set(p,b),(b=fy(e,w=py(e,t,y.aa,r,i),m,y,b,i,a,r,s))&&((m=Cv(y.aa,"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,ry(e,a)&&null!=e.L&&p<e.L||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={Se:void 0,Re:void 0,Je:void 0,Wc:void 0,Ie:void 0},i++)if(n.Wc=g[i],null==n.Wc.h)for(n.Re=0,n.Se=i,r=function(e){return function(){var t=g[e.Se];if(t){if(null!=t.h)return t.h+e.Re;e.Re-=t.endTime-t.startTime,e.Se+=1}return null}}(n),n.Ie=0,n.Je=i,o=function(e){return function(){var t=g[e.Je];if(t){if(t!=e.Wc&&(e.Ie+=t.endTime-t.startTime),null!=t.h)return t.h+e.Ie;--e.Je}return null}}(n);null==n.Wc.h;)n.Wc.h=o(),null==n.Wc.h&&(n.Wc.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.ha,d&&1/0!=n&&!ry(e,a))for(a=(e=l(g)).next();!a.done;a=e.next())a.value.vh(n);return{segments:g,bandwidth:t}}function yy(e,t){if(e==rt){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 by(e){return e==rt?"text/vtt":Oy.get(e).get("mp4")}function wy(e,t){for(var n=t[e=Ay(e)?Math.trunc((t.length-1)/2):0];2==n.Cc()&&e+1<t.length;)n=t[++e];return{segment:n,segmentIndex:e}}function Ty(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 xy(e,t,n){return Ey(e,Br(t,e.g.retryParameters),0,{type:n?2:3})}function Sy(e){var t,n,i,r,a,o;return R((function(s){switch(s.g){case 1:return e.h?(x(s,2),t=Date.now(),w(s,e.update(),4)):s.return();case 4:n=Date.now(),Ay(e)&&(i=(n-t)/1e3,e.eb.sample(1,i),r=0<e.g.updatePeriod?e.g.updatePeriod:e.o,a=Math.max(0,r-H(e.eb)),e.C.ia(a)),A(s,3);break;case 2:if(o=k(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.C.ia(.1);case 3:if(!e.h)return s.return();e.h.onManifestUpdated(),T(s)}}))}function Ay(e){return e.za!=Uy}function ky(e,t){e.za=t,e.l&&e.l.Zc(!Ay(e)),Ay(e)||e.C.stop()}function Ey(e,t,n,i){if(!e.W)throw new Ne(2,7,7001);return i||(i={}),i.isPreload=e.Zb(),t=e.h.networkingEngine.request(n,t,i),Or(e.W,t),t}function Iy(e){return"AES-128"==e||"AES-256"==e||"AES-256-CTR"==e}function Cy(t,n,i,r,a,o){var s,u,l,c,d,h,p,f,g,m,v;return R((function(y){switch(y.g){case 1:if("video/mp2t"==i)throw new Ne(2,4,4040);if("apple"===e.shakaMediaKeysPolyfill)throw new Ne(2,4,4041);if(s=xv(n,"METHOD"),!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(s))return y.return(null);if((u=Mv(r(),xv(n,"URI"),o))[0].startsWith("data:text/plain;base64,")){l=Je(We(u[0].split("data:text/plain;base64,").pop())),y.u(2);break}return c=u.sort().join(""),t.va.has(c)||(d=Br(u,t.g.retryParameters),h=Ey(t,d,6).promise,t.va.set(c,h)),w(y,t.va.get(c),3);case 3:p=y.h,l=Je(p.data);case 2:if(f="00000000000000000000000000000000",!a){y.u(4);break}return w(y,My(t,a),5);case 5:(g=y.h)&&(f=g);case 4:return(m=new Map).set(f,l),v="cenc","SAMPLE-AES"==s&&(v="cbcs"),y.return(et(m,v))}}))}function My(e,t){var n,i,r;return R((function(a){return 1==a.g?(n=null,e.wa.has(t)?(n=e.wa.get(t),a.u(2)):(i=rl(t.O(),t.Bc(),t.zc(),e.g.retryParameters),w(a,Ey(e,i,Gr,{type:0}).promise,3))):(2!=a.g&&(r=a.h,t.ge(r.data),n=function(e){var t=null;return(new ta).box("moov",na).box("trak",na).box("mdia",na).box("minf",na).box("stbl",na).R("stsd",ia).box("encv",ra).box("enca",aa).box("sinf",na).box("schi",na).R("tenc",(function(e){(e=e.reader).X(),e.X(),e.X(),e.X(),t=Je(e.Ub(16))})).parse(e,!0),t}(r.data),e.wa.set(t,n)),a.return(n))}))}F("shaka.net.DataUriPlugin",Uv),Uv.parse=_v,Ur("data",_v),(i=Fv.prototype).configure=function(e,t){var n=this.h&&e.updatePeriod!=this.g.updatePeriod&&0<=e.updatePeriod;this.g=e,t&&(this.Zb=t),this.j&&this.j.configure(this.g),n&&this.m&&this.m.presentationTimeline.V()&&this.C.Jb()},i.start=function(e,t){var n,i=this;return R((function(r){return 1==r.g?(i.h=t,i.ka=t.isLowLatencyMode(),w(r,xy(i,[e]).promise,2)):3!=r.g?(n=r.h,i.F=n.uri,w(r,function(e,t){var n,i,r,a,o,s,u,d,h,p,f,g,m,v,y,b,S,A,E,I,C,M,D,P,L,N,O,j,U,_,B,F,V,H,K,G,z,q,X,W,Y,J,$;return R((function(Q){switch(Q.g){case 1:return n=at,i=Lv(e.Ya,t),r=kv(i.aa,"EXT-X-DEFINE"),a=[],o=[],s=[],e.l=new su(null,0),e.l.Zc(!0),u=function(){return[e.F]},d=null,h=new Map,1==i.type?(e.N=!1,F=kv(i.aa,"EXT-X-DEFINE"),h=Xv(e,F,e.F),d=n.Ca,V="",H=new Map,w(Q,ay(e,e.G++,h,i,u,"",d,V,!0,"Media Playlist",null,H,null,!1,null,!1),7)):(function(e,t){for(var n=new de(e.F).g,i=(t=l(t)).next();!i.done;i=t.next()){var r=i.value;i=Tv(r,"NAME");var a=Tv(r,"VALUE");r=Tv(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,r),p=kv(i.aa,"EXT-X-MEDIA"),f=kv(i.aa,"EXT-X-STREAM-INF"),g=kv(i.aa,"EXT-X-IMAGE-STREAM-INF"),m=kv(i.aa,"EXT-X-I-FRAME-STREAM-INF"),v=kv(i.aa,"EXT-X-SESSION-KEY"),y=kv(i.aa,"EXT-X-SESSION-DATA"),b=kv(i.aa,"EXT-X-CONTENT-STEERING"),function(e,t){for(var n=(t=l(t)).next();!n.done;n=t.next()){var i=n.value,r=Tv(i,"DATA-ID");n=Tv(i,"URI");var a=Tv(i,"LANGUAGE");i=Tv(i,"VALUE"),r=(new Map).set("id",r),n&&r.set("uri",Mv([e.F],n,e.A)[0]),a&&r.set("language",a),i&&r.set("value",i),n=new Dr("sessiondata",r),e.h&&e.h.onEvent(n)}}(e,y),w(Q,function(e,t){var n,i,r,a,o,s;return R((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=Tv(a,"PATHWAY-ID"),s=Tv(a,"SERVER-URI"),o&&s){e.j=new Ug(e.h),e.j.configure(e.g),e.j.i=[e.F],e.j.setManifestType("HLS"),e.j.h=o,n=_g(e.j,s);break}return w(u,n,0)}))}(e,b),4));case 4:if(!e.g.ignoreSupplementalCodecs){for(S=[],A=l(f),E=A.next(),I={};!E.done;I={Ti:void 0},E=A.next())C=E.value,(M=Tv(C,"SUPPLEMENTAL-CODECS"))&&(I.Ti=M.split(/\s*,\s*/).map((function(e){return e.split("/")[0]})),D=C.attributes.map(function(e){return function(t){var n=t.name,i=t.value;return"CODECS"==n&&(i=e.Ti.join(","),1<(t=t.value.split(",")).length&&(t=nt("audio",t))&&(i+=","+t)),new Av(n,i)}}(I)),S.push(new yv(C.id,C.name,D,null)));for(f.push.apply(f,c(S)),P=[],L=l(m),N=L.next(),O={};!N.done;O={Ui:void 0},N=L.next())j=N.value,(U=Tv(j,"SUPPLEMENTAL-CODECS"))&&(O.Ui=U.split(/\s*,\s*/).map((function(e){return e.split("/")[0]})),_=j.attributes.map(function(e){return function(t){var n=t.name;return t=t.value,"CODECS"==n&&(t=e.Ui.join(",")),new Av(n,t)}}(O)),P.push(new yv(j.id,j.name,_,null)));m.push.apply(m,c(P))}return function(e,t){for(var n=(t=l(t)).next();!n.done;n=t.next()){var i=n.value,r=Tv(i,"AUDIO");n=Tv(i,"VIDEO");var a=Tv(i,"SUBTITLES");if(i=Jv(e,i),a){var o=nt(rt,i);e.I.set(a,o),Ct(i,o)}r&&((a=nt("audio",i))||(a=e.g.hls.defaultAudioCodec),e.I.set(r,a)),n&&((r=nt("video",i))||(r=e.g.hls.defaultVideoCodec),e.I.set(n,r))}}(e,f),function(e,t){t=Ev(t,"CLOSED-CAPTIONS"),e.N=0==t.length;for(var n=(t=l(t)).next();!n.done;n=t.next()){var i=n.value,r=Tv(i,"LANGUAGE");n=Di(r||"und"),r||(r=Tv(i,"NAME"))&&(n=r),r=xv(i,"GROUP-ID"),i=xv(i,"INSTREAM-ID").replace("SERVICE","svc"),e.H.get(r)||e.H.set(r,new Map),e.H.get(r).set(i,n)}}(e,p),B=function(e,t){return t.map((function(t){return"video"!==(t=Zv(e,t)).stream.type?null:t.stream})).filter((function(e){return e}))}(e,m),w(Q,function(e,t,n,i,r,a,o){var s,u,d,h,p,f,g,m,v,y,b,T,x,S,A,k,E,I,C,M,D,P,L,N,O,j,U,_,B,F,V,H,K,G,z,q;return R((function(R){switch(R.g){case 1:if(s=[],u=new Set,e.g.ignoreDrmInfo||!(0<n.length)){R.u(2);break}d=l(n),h=d.next();case 3:if(h.done){R.u(2);break}if(p=h.value,f=xv(p,"METHOD"),g=Tv(p,"KEYFORMAT")||"identity",m=null,"NONE"==f){R.u(4);break}if(Iy(f)){v=Mv(r(),xv(p,"URI"),a),y=v.sort().join(""),e.M.has(y)||(b=Br(v,e.g.retryParameters),T=Ey(e,b,6).promise,e.M.set(y,T)),R.u(4);break}if("identity"==g)return w(R,Cy(e,p,"",r,null,a),12);if(!(x=e.$b.get(g))){S=null,R.u(10);break}return w(R,x(p,"",null),11);case 11:S=R.h;case 10:m=S,R.u(6);break;case 12:m=R.h;case 6:if(m){if(m.keyIds)for(A=l(m.keyIds),k=A.next();!k.done;k=A.next())E=k.value,u.add(E);s.push(m)}case 4:h=d.next(),R.u(3);break;case 2:for(I={},C=l(t),M=C.next();!M.done;M=C.next())D=M.value,P=bv(D,!e.j),I[P]?I[P].push(D):I[P]=[D];for(N in L=[],I)O=I[N],j=O[0],U=Tv(j,"FRAME-RATE"),_=Number(Tv(j,"AVERAGE-BANDWIDTH"))||Number(xv(j,"BANDWIDTH")),B=Tv(j,"RESOLUTION"),F=l(B?B.split("x"):[null,null]),V=F.next().value,H=F.next().value,K=Tv(j,"VIDEO-RANGE"),(G=Tv(j,"REQ-VIDEO-LAYOUT"))&&G.includes(",")&&(z=G.split(",").filter((function(e){return"CH-STEREO"==e||"CH-MONO"==e})),G=z[0]),G=G||"CH-MONO",q=Yv(e,O,i),L.push.apply(L,c($v(e,q.audio,q.video,_,V,H,U,K,G,s,u,o)));return R.return(L.filter((function(e){return null!=e})))}}))}(e,f,v,p,u,e.A,B),5);case 5:return a=Q.h,o=function(e,t){var n=Ev(t,"SUBTITLES");t=n.map((function(t){if(e.g.disableText)return null;try{return Qv(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=xv(i.value,"GROUP-ID");if((i=e.I.get(r))&&(r=e.K.get(r)))for(var a=(r=l(r)).next();!a.done;a=r.next())(a=a.value).stream.codecs=i,a.stream.mimeType=yy(rt,i)||by(rt),Wv(a.stream)}return t.filter((function(e){return e}))}(e,p),w(Q,function(e,t,n){var i,r;return R((function(a){return 1==a.g?(i=t.map((function(t){var n,i;return R((function(r){if(1==r.g)return e.g.disableThumbnails?r.return(null):(x(r,2),w(r,function(e,t){var n,i,r,a,o,s,u,l,c,d;return R((function(h){return 1==h.g?(n=xv(t,"URI"),i=Tv(t,"CODECS","jpeg")||"",e.i.has(n)?h.return(e.i.get(n)):(r=Tv(t,"LANGUAGE"),a=Tv(t,"NAME"),o=Tv(t,"CHARACTERISTICS"),s=ey(e,e.G++,[n],i,"image",r,!1,a,null,null,o,!1,null,!1),(u=Tv(t,"RESOLUTION"))?w(h,s.stream.createSegmentIndex(),3):h.u(2))):(2!=h.g&&(l=Pu(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=Tv(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=k(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=Zv(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,g,m),6);case 6:s=Q.h,Q.u(3);break;case 7:K=Q.h,e.i.set(e.F,K),K.stream&&(G=Vu(K.stream),K.stream.segmentIndex.Eb((function(e){e.Y&&(e.Y.rd=G)}))),d=K.stream.type,z=!0,(e.g.disableAudio&&"audio"==K.type||e.g.disableVideo&&"video"==K.type&&!K.stream.codecs.includes(","))&&(z=!1),z&&a.push({id:0,language:Di(V||"und"),disabledUntilTime:0,primary:!0,audio:"audio"==K.type?K.stream:null,video:"video"==K.type?K.stream:null,bandwidth:K.stream.bandwidth||0,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});case 3:if(!e.h)throw new Ne(2,7,7001);if(cy(e,i),1==i.type&&(Ay(e)&&(hy(e,i),q=e.o,e.C.ia(q)),X=Array.from(e.i.values()),iy(e,X),qv(e),my(e,i.aa,d,h,u)),e.m={presentationTimeline:e.l,variants:a,textStreams:o,imageStreams:s,offlineSessionIds:[],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.ba||!e.g.hls.disableCodecGuessing){Q.u(8);break}for(W=[],Y=l(e.m.variants),J=Y.next();!J.done;J=Y.next())($=J.value).audio&&""===$.audio.codecs&&W.push($.audio.createSegmentIndex()),$.video&&""===$.video.codecs&&W.push($.video.createSegmentIndex());return w(Q,Promise.all(W),8);case 8:e.h.makeTextStreamsForClosedCaptions(e.m),T(Q)}}))}(i,n.data),3)):r.return(i.m)}))},i.stop=function(){this.C&&(this.C.stop(),this.C=null);var e=[];return this.W&&(e.push(this.W.destroy()),this.W=null),this.g=this.h=null,this.ab.clear(),this.m=null,this.i.clear(),this.K.clear(),this.I.clear(),this.A.clear(),this.ya.clear(),this.na.clear(),this.M.clear(),this.va.clear(),this.wa.clear(),this.j&&this.j.destroy(),this.S&&(this.S.release(),this.S=null),Promise.all(e)},i.update=function(){var e,t,n,i,r,a,o,s,u,d,h,p=this;return R((function(f){if(1==f.g){if(!Ay(p))return f.return();for(e=[],t=Array.from(p.i.values()),p.o=1/0,p.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(Hv(p,a));return w(f,Promise.all(e),2)}for(ny(p,n.map((function(e){return e.stream}))),o=n.some((function(e){return 0==e.Rd})),n.length&&!o&&(ky(p,Fy.cj),s=n.map((function(e){return e.mc})),p.l.pb(Math.min.apply(Math,c(s))),p.h.updateDuration()),o&&qv(p),u=l(n),d=u.next();!d.done;d=u.next())(h=d.value).stream.isAudioMuxedInVideo||!h.stream.segmentIndex||Pu(h.stream.segmentIndex)||p.h.disableStream(h.stream);T(f)}))},i.onExpirationUpdated=function(){},i.onInitialVariantChosen=function(){},i.banLocation=function(e){this.j&&this.j.banLocation(e)},i.setMediaElement=function(e){this.U=e},F("shaka.hls.HlsParser",Fv);var Dy=(new Map).set("aac","audio/aac").set("ac3","audio/ac3").set("ec3","audio/ec3").set("mp3","audio/mpeg"),Py=(new Map).set("mp4","audio/mp4").set("mp4a","audio/mp4").set("m4s","audio/mp4").set("m4i","audio/mp4").set("m4a","audio/mp4").set("m4f","audio/mp4").set("cmfa","audio/mp4").set("ts","video/mp2t").set("tsa","video/mp2t"),Ry=(new Map).set("mp4","video/mp4").set("mp4v","video/mp4").set("m4s","video/mp4").set("m4i","video/mp4").set("m4v","video/mp4").set("m4f","video/mp4").set("cmfv","video/mp4").set("ts","video/mp2t").set("tsv","video/mp2t"),Ly=(new Map).set("mp4","application/mp4").set("m4s","application/mp4").set("m4i","application/mp4").set("m4f","application/mp4").set("cmft","application/mp4").set("vtt","text/vtt").set("webvtt","text/vtt").set("ttml","application/ttml+xml"),Ny=(new Map).set("jpg","image/jpeg").set("png","image/png").set("svg","image/svg+xml").set("webp","image/webp").set("avif","image/avif"),Oy=(new Map).set("audio",Py).set("video",Ry).set("text",Ly).set("image",Ny),jy=new Set(["video/mp2t"].concat(c(hi))),Uy="VOD",_y="EVENT",By="LIVE",Fy={cj:Uy,Bl:_y,Ll:By};function Vy(e){return ag(e)}$a("application/x-mpegurl",(function(){return new Fv})),$a("application/vnd.apple.mpegurl",(function(){return new Fv}));var Hy=(new Map).set("com.microsoft.playready",Vy).set("com.microsoft.playready.recommendation",Vy).set("com.microsoft.playready.software",Vy).set("com.microsoft.playready.hardware",Vy);function Ky(){var e=this;this.h=this.g=null,this.l=[],this.j=null,this.s=1,this.i=null,this.C=new V(5),this.o=new Ti((function(){!function(e){var t;R((function(n){switch(n.g){case 1:return x(n,2),w(n,Gy(e),4);case 4:A(n,3);break;case 2:t=k(n),e.h&&(t.severity=1,e.h.onError(t));case 3:if(!e.h)return n.return();T(n)}}))}(e)})),this.B=new Nr,this.m=new Map,this.A=function(){return!1}}function Gy(e){var t,n,i,r,a,o,s;return R((function(u){if(1==u.g)return t=Br(e.l,e.g.retryParameters),n=e.h.networkingEngine,i=Date.now(),r=n.request(0,t,{type:5,isPreload:e.A()}),Or(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,p=e.g.mss.manifestPreprocessor;if(p!=Xl){if(oe("manifest.mss.manifestPreprocessor configuration","Please Use manifest.mss.manifestPreprocessorTXml instead."),!(h=Am(h,"SmoothStreamingMedia")))throw new Ne(2,4,4046,d);p(h),h=Fe(h.outerHTML)}var f=Ht(h,"SmoothStreamingMedia");if(!f)throw new Ne(2,4,4046,d);if((d=e.g.mss.manifestPreprocessorTXml)!=Wl&&d(f),e.i||(e.i=new su(null,0)),d=Zt(f,"IsLive",dn,!1))throw new Ne(2,4,4047);e.i.Zc(!d),p=Zt(f,"TimeScale",ln,1e7),h=Zt(f,"DVRWindowLength",ln),d&&(0===h||isNaN(h))&&(h=1/0);var g,m=Zt(f,"CanSeek",dn,!1);for(0===h&&m&&(h=1/0),m=null,h&&0<h&&(m=h/p),d&&!isNaN(e.g.availabilityWindowOverride)&&(m=e.g.availabilityWindowOverride),null==m&&(m=1/0),e.i.Gf(m),h=Zt(f,"Duration",ln,1/0),d||e.i.pb(h/p),d={variants:[],textStreams:[],timescale:p,duration:h/p},m=Xt(f,"Protection"),p=e.g.mss.keySystemsBySystemId,h=[],g=(m=l(m)).next();!g.done;g=m.next())h=h.concat(Xt(g.value,"ProtectionHeader"));if(h.length){for(m=[],g=0;g<h.length;g++){var v=h[g],y=v.attributes.SystemID.toLowerCase(),b=p[y];if(b){var x;e:{if(x=rg(v))for(var S=(x=l(Jt(x,"DATA"))).next();!S.done;S=x.next())if(S=$t(S.value,"KID")){x=We(Wt(S)),x=Je(x=new Uint8Array([x[3],x[2],x[1],x[0],x[5],x[4],x[7],x[6]].concat(c(x.slice(8)))));break e}x=null}y=Ze(b,"cenc",y=[{initData:pa(S=We(Wt(v)),y=Ye(y.replace(/-/g,"")),new Set,0),initDataType:"cenc",keyId:x}]),x&&y.keyIds.add(x),(b=Hy.get(b))&&(y.licenseServerUri=b(v)),m.push(y)}}p=m}else p=[];for(g=p,m=[],p=[],h=[],v=(f=l(f=Xt(f,"StreamIndex"))).next();!v.done;v=f.next()){b=Xt(v=v.value,"QualityLevel"),y=d.timescale,x=d.duration,S=Xt(v,"c");for(var A=[],k=0,E=0;E<S.length;++E){var I=S[E],C=S[E+1],M=Zt(I,"t",ln),D=Zt(I,"d",ln);if(I=Zt(I,"r",sn),!D)break;if(M=null!=M?M:k,(I=I||0)&&I--,0>I)if(C){if(null==(C=Zt(C,"t",ln)))break;if(M>=C)break;I=Math.ceil((C-M)/D)-1}else{if(1/0==x)break;if(M/y>=x)break;I=Math.ceil((x*y-M)/D)-1}for(C=0;C<=I;++C)k=M+D,A.push({start:M/y,end:k/y,Bh:M}),M=k}for(y=A,x=(b=l(b)).next();!x.done;x=b.next())(x=zy(e,v,x.value,y,g,d))&&("audio"!=x.type||e.g.disableAudio?"video"!=x.type||e.g.disableVideo?x.type!=rt||e.g.disableText||h.push(x):p.push(x):m.push(x))}for(f=[],g=(m=l(0<m.length?m:[null])).next();!g.done;g=m.next())for(g=g.value,A=(v=l(0<p.length?p:[null])).next();!A.done;A=v.next())y=(b=f).push,x=e,S=g,A=A.value,E=0,S&&S.bandwidth&&0<S.bandwidth&&(E+=S.bandwidth),A&&A.bandwidth&&0<A.bandwidth&&(E+=A.bandwidth),x={id:x.s++,language:S?S.language:"und",disabledUntilTime:0,primary:!!S&&S.primary||!!A&&A.primary,audio:S,video:A,bandwidth:E,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},y.call(b,x);d.variants=f,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:[],sequenceMode:e.g.mss.sequenceMode,ignoreManifestTimestampsInSegmentsMode:!1,type:"MSS",serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,isLowLatency:!1,startTime:null},e.i.hf()),Promise.resolve(),o=Date.now(),s=(o-i)/1e3,e.C.sample(1,s),T(u)}))}function zy(e,t,n,i,r,a){var o=t.attributes.Type;if("audio"!==o&&"video"!==o&&"text"!==o)return q("Ignoring unrecognized type:",o),null;var s=t.attributes.Language,u=e.s++,c=Zt(n,"Bitrate",un),d=Zt(n,"MaxWidth",un),h=Zt(n,"MaxHeight",un),p=Zt(n,"Channels",un),f=Zt(n,"SamplingRate",un),g=a.duration;i.length&&(g=i[i.length-1].end-i[0].start);var m=e.i.getDuration();e.i.pb(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:Di(s||"und"),originalLanguage:s,label:"",type:"",primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:[],roles:[],forced:!1,channelsCount:p,audioSamplingRate:f,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,baseOriginalId:null};if((r=t.attributes.Subtype)&&((r=Xy.get(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 q('FourCC is not defined whereas it is required for a QualityLevel element for a StreamIndex of type "video"'),null;if(!qy.includes(r.toUpperCase()))return q("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 q("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 q("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=rt,v.mimeType="application/mp4",("TTML"===r||"DFXP"===r)&&(v.codecs="stpp")}return v.fullMimeTypes.add(ni(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=lo(new uo([n={id:v.id,type:v.type,codecs:v.codecs,encrypted:v.encrypted,timescale:v.mssPrivateData.timescale,duration:v.mssPrivateData.duration,Ab:n,Ea:new Uint8Array([]),Na:new Uint8Array([]),Wa:0,Xa: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={Jf:void 0},o=r.next())s.Jf=o.value,i.push(new Vo(s.Jf.start,s.Jf.end,function(t){return function(){return Qe(e.l,[a.replace("{start time}",String(t.Jf.Bh))])}}(s),0,null,t,0,0,n.mssPrivateData.duration));return i}(e,new Bo((function(){return[]}),0,null,Vu(v),v.mssPrivateData.timescale,n,null,v.encrypted),v,t,i),v.segmentIndex=new Du(n),Promise.resolve()},v.closeSegmentIndex=function(){v.segmentIndex&&(v.segmentIndex.release(),v.segmentIndex=null)},v}(i=Ky.prototype).configure=function(e,t){this.g=e,t&&(this.A=t)},i.start=function(e,t){var n=this;return R((function(i){if(1==i.g)return n.l=[e],n.h=t,w(i,Gy(n),2);if(!n.h)throw new Ne(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 R((function(n){return 1==n.g?(x(n,2),w(n,Gy(t),4)):2!=n.g?A(n,0):(e=k(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",Ky);var qy="AAC AACL AACH AACP AVC1 H264 TTML DFXP".split(" "),Xy=(new Map).set("CAPT","main").set("SUBT","alternate").set("DESC","main");function Wy(e,t,n,i,r,a,o){if(200<=n&&299>=n&&202!=n||304==n)return{uri:r||i,originalUri:i,data:t,status:n,headers:e,fromCache:!!e["x-shaka-from-cache"],originalRequest:a};a=null;try{a=Be(t)}catch(e){}throw new Ne(401==n||403==n?2:1,1,1001,i,n,a,e,o,r||i)}function Yy(){}function Jy(e,t,n,i,r,a){var o=new tb;Jr(t.headers).forEach((function(e,t){o.append(t,e)}));var s=new Zy,u={Lh:!1,Yi:!1};if(e=function(e,t,n,i,r,a,o,s,u){var l,c,d,h,p,f,g,m,v,y,b,S,E,I;return R((function(C){switch(C.g){case 1:return l=Qy,c=eb,h=new ArrayBuffer(0),f=p=0,g={},m=Date.now(),x(C,2),w(C,l(e,i),4);case 4:if(d=C.h,g=function(e){var t={};return e.forEach((function(e,n){t[n.trim()]=e})),t}(d.headers),o(g),"HEAD"==i.method){C.u(5);break}return y=(v=d.headers.get("Content-Length"))?parseInt(v,10):0,d.body?(b=d.clone().body.getReader(),new c({start:function(e){!function t(){var n,i,r,o;return R((function(l){switch(l.g){case 1:return x(l,2),w(l,b.read(),4);case 4:n=l.h,A(l,3);break;case 2:return k(l),l.return();case 3:if(n.done){l.u(5);break}if(p+=n.value.byteLength,!s){l.u(5);break}return w(l,s(n.value),5);case 5:i=Date.now(),r=p-f,(100<i-m&&r>=u||n.done)&&(o=n.done?0:y-p,a(i-m,r,o),f=p,m=i),n.done?e.close():(e.enqueue(n.value),t()),T(l)}}))}()}}),w(C,d.arrayBuffer(),8)):w(C,d.arrayBuffer(),9);case 8:h=C.h,C.u(5);break;case 9:h=C.h,S=Date.now(),a(S-m,h.byteLength,0);case 5:t.headers.Range&&2==(E=t.headers.Range.replace("bytes=","").split("-").filter((function(e){return e})).map((function(e){return parseInt(e,10)}))).length&&h.byteLength!=E[1]-E[0]+1&&q("Payload length does not match range requested bytes",t,d),A(C,3);break;case 2:if(I=k(C),r.Lh)throw new Ne(1,1,7001,e,n);if(r.Yi)throw new Ne(1,1,1003,e,n);throw new Ne(1,1,1002,e,I,n);case 3:return C.return(Wy(g,h,d.status,e,d.url,t,n))}}))}(e,t,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 Ar(e,(function(){return u.Lh=!0,s.abort(),Promise.resolve()})),t=t.retryParameters.timeout){var l=new Ti((function(){u.Yi=!0,s.abort()}));l.ia(t/1e3),e.finally((function(){l.stop()}))}return e}function $y(){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)}$a("application/vnd.ms-sstr+xml",(function(){return new Ky})),F("shaka.net.HttpFetchPlugin",Yy),Yy.isSupported=$y,Yy.parse=Jy;var Qy=e.fetch,Zy=e.AbortController,eb=e.ReadableStream,tb=e.Headers;function nb(){}function ib(e,t,n,i,r,a){var o=new rb,s=Date.now(),u=0;return new Ar(new Promise((function(c,d){o.open(t.method,e,!0),o.responseType="arraybuffer",o.timeout=t.retryParameters.timeout,o.withCredentials=t.allowCrossSiteCredentials;var h={};for(var p in o.onabort=function(){d(new Ne(1,1,7001,e,n))},o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.HEADERS_RECEIVED){for(var e=o.getAllResponseHeaders().trim().split("\r\n"),t={},n=(e=l(e)).next();!n.done;n=e.next())t[(n=n.value.split(": "))[0].toLowerCase()]=n.slice(1).join(": ");r(h=t)}},o.onload=function(r){var a=o.response;try{i(Date.now()-s,r.loaded-u,0);var l=Wy(h,a,o.status,e,o.responseURL,t,n);c(l)}catch(e){d(e)}},o.onerror=function(t){d(new Ne(1,1,1002,e,t,n))},o.ontimeout=function(){d(new Ne(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(p.toLowerCase(),t.headers[p]);o.send(t.body)})),(function(){return o.abort(),Promise.resolve()}))}$y()&&(Ur("http",Jy,2,!0),Ur("https",Jy,2,!0),Ur("blob",Jy,2,!0)),F("shaka.net.HttpXHRPlugin",nb),nb.parse=ib;var rb=e.XMLHttpRequest;function ab(e,t,n,i,r){this.g=e,this.i=t,this.groupId=n,this.h=i,this.j=r}function ob(e){var t=e.Yb(!1);return t?Xe(t):e.O().map((function(e){return"{"+encodeURI(e.split("#xywh=")[0])+"}"})).join("")+":"+e.startByte+":"+e.endByte}function sb(e,t){return rl(e.g.O(),e.g.startByte,e.g.endByte,t.streaming.retryParameters)}function ub(){this.g=this.j=this.i=0,this.h=new Map,this.l=0}function lb(e,t){e.i+=t;var n=e.l;return e.l++,e.h.set(n,t),n}function cb(e){return 0==e.i?0:e.j/e.i}function db(e){var t=this;this.s=e,this.i=new Map,this.h=new Xr((function(){return hb(t).catch((function(){}))})),this.j=[],this.o=function(){},this.m=function(){},this.g=new ub,this.l=!1}function hb(e){e.l=!0;var t=e.j.map((function(e){return e()}));return e.j=[],Promise.all(t)}function pb(e,t,n,i,r,a){Wr(e.h);var o=(e.i.get(t)||Promise.resolve()).then((function(){if(e.h.g)throw new Ne(2,9,7001);if(r){var t=De(n);for(var o in(t=new ha(t)).data){var s=Number(o);e.m(t.data[s],t.g[s])}}return e.g.close(i,n.byteLength),e.o(cb(e.g),e.g.g),a(n)}));e.i.set(t,o)}function fb(e,t){var n=this;this.i=e,this.h=e.objectStore(t),this.g=new Sr,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 gb(e,t){return new Promise((function(n,i){var r=e.h.openCursor();r.onerror=i,r.onsuccess=function(){var e;return R((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 mb(e){this.h=e,this.g=[]}function vb(e,t){return yb(e,t,"readwrite")}function yb(e,t,n){var i=new fb(n=e.h.transaction([t],n),t);return e.g.push(i),i.promise().then((function(){Ct(e.g,i)}),(function(){Ct(e.g,i)})),i}function bb(e,t,n){this.h=new mb(e),this.i=t,this.g=n}function wb(e){return Promise.reject(new Ne(2,9,9011,"Cannot add new value to "+e))}function Tb(e,t,n,i){t=(e=vb(e.h,t)).store();for(var r=(n=l(n)).next(),a={};!r.done;a={Og:void 0},r=n.next())a.Og=r.value,t.delete(a.Og).onsuccess=function(e){return function(){return i(e.Og)}}(a);return e.promise()}function xb(e,t,n){var i,r,a,o,s,u,c;return R((function(d){if(1==d.g){for(i=yb(e.h,t,"readonly"),r=i.store(),a={},o=[],s=l(n),u=s.next(),c={};!u.done;c={Af:void 0,cf:void 0},u=s.next())c.cf=u.value,c.Af=r.get(c.cf),c.Af.onsuccess=function(e){return function(){null==e.Af.result&&o.push(e.cf),a[e.cf]=e.Af.result}}(c);return w(d,i.promise(),2)}if(o.length)throw new Ne(2,9,9012,"Could not find values for "+o);return d.return(n.map((function(e){return a[e]})))}))}function Sb(e){this.g=new mb(e)}function Ab(){this.g=new Map}function kb(e){var t=null;if(e.g.forEach((function(e,n){e.getCells().forEach((function(e,i){e.hasFixedKeySpace()||t||(t={path:{Rb:n,bb:i},bb:e})}))})),t)return t;throw new Ne(2,9,9013,"Could not find a cell that supports add-operations")}function Eb(e,t,n){if(!(e=e.g.get(t)))throw new Ne(2,9,9013,"Could not find mechanism with name "+t);if(!(t=e.getCells().get(n)))throw new Ne(2,9,9013,"Could not find cell with name "+n);return t}function Ib(e,t){Cb.set(e,t)}Ur("http",ib,1,!0),Ur("https",ib,1,!0),Ur("blob",ib,1,!0),ub.prototype.close=function(e,t){if(this.h.has(e)){var n=this.h.get(e);this.h.delete(e),this.j+=n,this.g+=t}},db.prototype.destroy=function(){return this.h.destroy()},db.prototype.queue=function(e,t,n,i,r){var a=this;Wr(this.h);var o=(this.i.get(e)||Promise.resolve()).then((function(){var e,o,s,u,l,c,d;return R((function(h){if(1==h.g)return w(h,function(e,t){var n,i,r,a;return R((function(o){return 1==o.g?(n=Gr,i=e.s.request(n,t),r=function(){return i.abort()},e.j.push(r),w(o,i.promise,2)):(a=o.h,Ct(e.j,r),o.return(a.data))}))}(a,t),2);if(e=h.h,a.h.g)throw new Ne(2,9,7001);if(i)for(u in o=De(e),(s=new ha(o)).data)l=Number(u),c=s.data[l],d=s.g[l],a.m(c,d);return a.g.close(n,e.byteLength),a.o(cb(a.g),a.g.g),h.return(r(e))}))}));return this.i.set(e,o),o},fb.prototype.abort=function(){var e=this;return R((function(t){if(1==t.g){try{e.i.abort()}catch(e){}return x(t,2),w(t,e.g,4)}if(2!=t.g)return A(t,0);k(t),T(t)}))},fb.prototype.store=function(){return this.h},fb.prototype.promise=function(){return this.g},mb.prototype.destroy=function(){return Promise.all(this.g.map((function(e){return e.abort()})))},(i=bb.prototype).destroy=function(){return this.h.destroy()},i.hasFixedKeySpace=function(){return!0},i.addSegments=function(){return wb(this.i)},i.removeSegments=function(e,t){return Tb(this,this.i,e,t)},i.getSegments=function(e){var t,n=this;return R((function(i){return 1==i.g?w(i,xb(n,n.i,e),2):(t=i.h,i.return(t.map((function(e){return n.Nh(e)}))))}))},i.addManifests=function(){return wb(this.g)},i.updateManifest=function(){return Promise.reject(new Ne(2,9,9016,"Cannot modify values in "+this.g))},i.updateManifestExpiration=function(e,t){var n=vb(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 Tb(this,this.g,e,t)},i.getManifests=function(e){var t,n=this;return R((function(i){return 1==i.g?w(i,xb(n,n.g,e),2):(t=i.h,i.return(Promise.all(t.map((function(e){return n.Kd(e)})))))}))},i.getAllManifests=function(){var e,t,n=this;return R((function(i){return 1==i.g?(e=yb(n.h,n.g,"readonly"),t=new Map,w(i,gb(e,(function(e,i){var r;return R((function(a){if(1==a.g)return w(a,n.Kd(i),2);r=a.h,t.set(e,r),T(a)}))})),2)):3!=i.g?w(i,e.promise(),3):i.return(t)}))},i.Nh=function(e){return e},i.Kd=function(e){return Promise.resolve(e)},i.add=function(e,t){var n,i,r,a,o,s,u,c=this;return R((function(d){if(1==d.g){for(n=vb(c.h,e),i=n.store(),r=[],a=l(t),o=a.next(),s={};!o.done;s={bh:void 0},o=a.next())u=o.value,s.bh=i.add(u),s.bh.onsuccess=function(e){return function(){r.push(e.bh.result)}}(s);return w(d,n.promise(),2)}return d.return(r)}))},Sb.prototype.destroy=function(){return this.g.destroy()},Sb.prototype.getAll=function(){var e,t,n=this;return R((function(i){return 1==i.g?(e=yb(n.g,"session-ids","readonly"),t=[],w(i,gb(e,(function(e,n){t.push(n)})),2)):3!=i.g?w(i,e.promise(),3):i.return(t)}))},Sb.prototype.add=function(e){for(var t=vb(this.g,"session-ids"),n=t.store(),i=(e=l(e)).next();!i.done;i=e.next())n.add(i.value);return t.promise()},Sb.prototype.remove=function(e){var t,n=this;return R((function(i){return 1==i.g?w(i,gb(t=vb(n.g,"session-ids"),(function(t,n,i){e.includes(n.sessionId)&&i.delete()})),2):w(i,t.promise(),0)}))},Ab.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)},Ab.prototype.init=function(){var e=this;Cb.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",Ab),Ab.unregister=function(e){Cb.delete(e)},Ab.register=Ib,Ab.prototype.destroy=Ab.prototype.destroy;var Cb=new Map;function Mb(){bb.apply(this,arguments)}function Db(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?Pb(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=Pb(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 Pb(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 Ne(2,9,9004,"Could not parse uri "+e)}function Rb(){bb.apply(this,arguments)}function Lb(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 Nb(){bb.apply(this,arguments)}function Ob(){this.m=this.j=this.i=this.h=this.g=this.l=null}m(Mb,bb),Mb.prototype.updateManifestExpiration=function(e,t){var n,i,r,a=this;return R((function(o){return n=vb(a.h,a.g),i=n.store(),r=new Sr,i.get(e).onsuccess=function(n){(n=n.target.result)?(n.expiration=t,i.put(n),r.resolve()):r.reject(new Ne(2,9,9012,"Could not find values for "+e))},w(o,Promise.all([n.promise(),r]),0)}))},Mb.prototype.Kd=function(e){var t,n,i,r,a,o;return R((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=Db(e.periods[n],r),t.push(a);return w(s,Gg(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})}))},Mb.prototype.Nh=function(e){return{data:e.data}},m(Rb,bb),Rb.prototype.Kd=function(e){var t,n,i,r,a,o;return R((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(Lb(h,u.startTime,u.startTime+r));a=c,t.push(a)}return w(s,Gg(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(Nb,bb),(i=Nb.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=vb(e.h,e.g)).store();return i.get(t).onsuccess=function(){i.put(n,t)},e.promise()}(this,e,t)},i.Kd=function(e){return null==e.expiration&&(e.expiration=1/0),Promise.resolve(e)},(i=Ob.prototype).init=function(){var t=this,n=new Sr,i=!1,r=new Ti((function(){i=!0,n.reject(new Ne(2,9,9017))}));"number"==typeof jb&&0<jb&&r.ia(jb);var a=e.indexedDB.open("shaka_offline_db",5);return a.onsuccess=function(){if(!i){r.stop();var e=a.result;t.l=e;var o=e.objectStoreNames;o=o.contains("manifest")&&o.contains("segment")?new Mb(e,"segment","manifest"):null,t.g=o,o=(o=e.objectStoreNames).contains("manifest-v2")&&o.contains("segment-v2")?new Rb(e,"segment-v2","manifest-v2"):null,t.h=o,o=(o=e.objectStoreNames).contains("manifest-v3")&&o.contains("segment-v3")?new Rb(e,"segment-v3","manifest-v3"):null,t.i=o,o=(o=e.objectStoreNames).contains("manifest-v5")&&o.contains("segment-v5")?new Nb(e,"segment-v5","manifest-v5"):null,t.j=o,e=e.objectStoreNames.contains("session-ids")?new Sb(e):null,t.m=e,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||(r.stop(),n.reject(new Ne(2,9,9001,a.error)),e.preventDefault())},n},i.destroy=function(){var e=this;return R((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 R((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 Sr,n=e.indexedDB.deleteDatabase("shaka_offline_db");return n.onblocked=function(){},n.onsuccess=function(){t.resolve()},n.onerror=function(e){t.reject(new Ne(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)}}))};var jb=5;function Ub(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 _b(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 Ub(t,n,i,Number(e[4])):null}function Bb(e,t){this.h=e,this.g=t}function Fb(e,t){var n=new su(null,0);n.pb(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=Vb(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=Vb(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==rt})).map((function(t){return Vb(e,t,n)}));var a=t.streams.filter((function(e){return"image"==e.type})).map((function(t){return Vb(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,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 Vb(e,t,n){var i=t.segments.map((function(n){return function(e,t,n){var i=new Ub("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 Ub("segment",e.h,e.g,t);return new Bo((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.Hf(t.thumbnailSprite),e}(e,n,t)}));return n.$d(i),{id:t.id,originalId:t.originalId,groupId:t.groupId,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new Du(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,dependencyStream:null,emsgSchemeIdUris:null,roles:t.roles,forced:t.forced,channelsCount:t.channelsCount,audioSamplingRate:t.audioSamplingRate,spatialAudio:t.spatialAudio,closedCaptions:t.closedCaptions,tilesLayout:t.tilesLayout,mssPrivateData:t.mssPrivateData,accessibilityPurpose:null,external:t.external,fastSwitching:t.fastSwitching,fullMimeTypes:new Set([ni(t.mimeType,t.codecs)]),isAudioMuxedInVideo:!1,baseOriginalId:null}}function Hb(){this.g=null}function Kb(){}function Gb(e,t){var n=_b(e);return e=n&&"manifest"==n.g?Ir(e={uri:e,originalUri:e,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"},originalRequest:t}):n&&"segment"==n.g?function(e,t,n){var i=new Ab;return Ir(void 0).Va((function(){return i.init()})).Va((function(){return Eb(i,t.Rb(),t.bb())})).Va((function(e){return e.getSegments([t.key()])})).Va((function(e){return{uri:t,data:e[0].data,headers:{},originalRequest:n}})).finally((function(){return i.destroy()}))}(n.key(),n,t):kr(new Ne(2,1,9004,e)),e}function zb(e,t,n){var i,r,a,o,s,u;return R((function(c){switch(c.g){case 1:i=[];for(var d=[],h=l(n),p=h.next();!p.done;p=h.next()){p=p.value;for(var f=!1,g=l(d),m=g.next();!m.done;m=g.next())if(qb((m=m.value).info,p)){m.sessionIds.push(p.sessionId),f=!0;break}f||d.push({info:p,sessionIds:[p.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 R((function(a){switch(a.g){case 1:return i=new fa({pc:t,onError:function(){},rf:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),x(a,2),i.configure(e),w(a,function(e,t,n,i,r,a){function o(e){return(e=Ze(t,e,null)).licenseServerUri=n,e.serverCertificate=i,e.persistentStateRequired=!0,e.sessionType="persistent-license",e}var s=[];return a.length&&s.push(a[0].contentType),r.length&&s.push(r[0].contentType),(s=ar(s)).video&&(a=o(a[0].encryptionScheme||""),s.video.drmInfos.push(a)),s.audio&&(r=o(r[0].encryptionScheme||""),s.audio.drmInfos.push(r)),Ta(e,[s])}(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 k(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 R((function(t){return 1==t.g?(x(t,2),w(t,function(e,t){var n,i,r;return R((function(a){return 1==a.g?w(a,Aa(e,t,{initData:null,initDataType:null}),2):3!=a.g?(n=a.h)?(i=[],(r=e.i.get(n))&&(r.Kb=new Sr,i.push(r.Kb)),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)):(k(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 qb(e,t){function n(e,t){return e.robustness==t.robustness&&e.contentType==t.contentType}return e.keySystem==t.keySystem&&e.licenseUri==t.licenseUri&&Mt(e.audioCapabilities,t.audioCapabilities,n)&&Mt(e.videoCapabilities,t.videoCapabilities,n)}function Xb(e,t){var n=Fb(new Bb(e.Rb(),e.bb()),t),i=t.appMetadata||{};return n=Wb(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 Wb(e){for(var t=[],n=Zi(e.variants),i=(n=l(n)).next();!i.done;i=n.next())t.push(qi(i.value));for(n=(e=l(e.textStreams)).next();!n.done;n=e.next())t.push(Xi(n.value));return t}function Yb(){this.g=new Map}function Jb(e,t){var n=t.audio,i=t.video;if(n&&!i&&e.g.set(n.id,n.bandwidth||t.bandwidth),!n&&i&&e.g.set(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.set(n.id,r),e.g.set(i.id,a)}}function $b(e,t){e.g.set(t.id,t.bandwidth||2048)}function Qb(e,t){return null==(e=e.g.get(t))&&(e=0),e}function Zb(e){var t=this;if(e&&e.constructor!=ld)throw new Ne(2,9,9008);this.g=this.h=null,e?(this.h=e.g,this.g=e.Pb()):(this.h=zl(),this.g=new jr,this.g.configure(this.h.networking)),this.i=[],this.l=[];var n=!e;this.j=new Xr((function(){var e,i,r,a,o;return R((function(s){switch(s.g){case 1:return w(s,Promise.all(t.l.map((function(e){return hb(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 ew(){if(ev(te()))e:{for(var e=l(Cb.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 tw(e){var t,n,i;return R((function(r){switch(r.g){case 1:return w(r,(t=new Ab).init(),2);case 2:return w(r,kb(t),3);case 3:return n=r.h,i=new Ub("manifest",n.path.Rb,n.path.bb,e),w(r,t.destroy(),4);case 4:return w(r,(new Zb).remove(i.toString()),0)}}))}function nw(e,t,n,i,r,a){var o,s,u,c,d,h,p,f,g,m,v;return R((function(y){switch(y.g){case 1:for(o=!1,x(y,2),s=!0,u=l(n.streams),c=u.next();!c.done;c=u.next())for(d=c.value,h=l(d.segments),p=h.next();!p.done;p=h.next())f=p.value,null!=(g=f.pendingSegmentRefId?i[f.pendingSegmentRefId]:null)&&(f.dataKey=g,f.pendingSegmentRefId=void 0),null!=(g=f.pendingInitSegmentRefId?i[f.pendingInitSegmentRefId]:null)&&(f.initSegmentKey=g,f.pendingInitSegmentRefId=void 0),f.pendingSegmentRefId&&(s=!1),f.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=k(y),w(y,tw(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 iw(e){return e.variants.some((function(e){var t=e.audio&&e.audio.encrypted;return e.video&&e.video.encrypted||t}))}function rw(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 aw(e,t,n,i){if(t.expiration=n.Pd(),n=wa(n),t.sessionIds=i?n:[],iw(e)&&i&&!n.length)throw new Ne(2,9,9007)}function ow(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:ni(r.mimeType,r.codecs),robustness:e.drmInfo.videoRobustness}):t||"audio"!=r.type||n.push({contentType:ni(r.mimeType,r.codecs),robustness:e.drmInfo.audioRobustness});return n}function sw(e,t,n){return R((function(i){return w(i,function(e,t,n,i){var r,a,o;return R((function(s){return 1==s.g?i.drmInfo?(r=function(e){var t=Array.from(e.g.keys());if(!t.length)throw new Ne(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:ow(i,!1),videoCapabilities:ow(i,!0)}})),w(s,zb(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 uw(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 Xb(t,n),Promise.all([e.removeSegments(r,i),e.removeManifests([t.key()],i)])}function lw(e,t){var n;return R((function(i){switch(i.g){case 1:return x(i,2),w(i,gc(t,e.g,e.h.streaming.retryParameters),4);case 4:n=i.h,A(i,3);break;case 2:k(i);case 3:if(n)return i.return(n);throw new Ne(1,2,2011,t)}}))}function cw(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,mssPrivateData:i.mssPrivateData,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,t),i=e.segmentIndex.get(++t)}(i,n.presentationTimeline.Gb(),(function(n,r){var l=ob(n),c=void 0;if(!a.has(l)){var d=n.endTime-n.startTime;d=Qb(t,i.id)*d,d=lb(e.g,d),a.set(l,new ab(n,d,u,!1,r))}n.Y&&(c=ob(n.Y),a.has(c)||(d=.5*Qb(t,i.id),d=lb(e.g,d),a.set(c,new ab(n.Y,d,u,!0,r)))),o.segments.push({pendingInitSegmentRefId:c,initSegmentKey:c?0:null,startTime:n.startTime,endTime:n.endTime,appendWindowStart:n.appendWindowStart,appendWindowEnd:n.appendWindowEnd,timestampOffset:n.timestampOffset,tilesLayout:n.tilesLayout,pendingSegmentRefId:l,dataKey:0,mimeType:n.mimeType,codecs:n.codecs,thumbnailSprite:n.thumbnailSprite}),0!==s&&(u=(u+1)%s)})),o}function dw(e){if(e.j.g)throw new Ne(2,9,7001)}function hw(){if(!ew())throw new Ne(2,9,9e3)}function pw(e,t){return R((function(n){return 1==n.g?(e.i.push(t),S(n,2),w(n,t,4)):2!=n.g?n.return(n.h):(E(n),Ct(e.i,t),I(n,0))}))}function fw(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}F("shaka.offline.indexeddb.StorageMechanismOpenTimeout",jb),Ib("idb",(function(){return te().uh()?new Ob:null})),Ub.prototype.Rb=function(){return this.i},Ub.prototype.bb=function(){return this.h},Ub.prototype.key=function(){return this.l},Ub.prototype.toString=function(){return this.j},(i=Hb.prototype).configure=function(){},i.start=function(e,t){var n,i,r,a,o,s,u=this;return R((function(l){switch(l.g){case 1:if(n=_b(e),u.g=n,null==n||"manifest"!=n.g)throw new Ne(2,1,9004,e);return i=new Ab,S(l,2),w(l,i.init(),4);case 4:return w(l,Eb(i,n.Rb(),n.bb()),5);case 5:return w(l,l.h.getManifests([n.key()]),6);case 6:return r=l.h,a=r[0],o=new Bb(n.Rb(),n.bb()),s=Fb(o,a),t.makeTextStreamsForClosedCaptions(s),l.return(s);case 2:return E(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 R((function(c){switch(c.g){case 1:return n=l.g,i=new Ab,x(c,2,3),w(c,i.init(),5);case 5:return w(c,Eb(i,n.Rb(),n.bb()),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 E(c),w(c,i.destroy(),10);case 10:I(c,0);break;case 2:k(c),c.u(3)}}))},i.onInitialVariantChosen=function(){},i.banLocation=function(){},i.setMediaElement=function(){},$a("application/x-offline-manifest",(function(){return new Hb})),F("shaka.offline.OfflineScheme",Kb),Kb.plugin=Gb,Ur("offline",Gb),(i=Zb.prototype).destroy=function(){return this.j.destroy()},i.configure=function(e,t){return 2==arguments.length&&"string"==typeof e&&(e=Ll(e,t)),ql(this.h,e)},i.getConfiguration=function(){var e=zl();return ql(e,this.h,zl()),e},i.Pb=function(){return this.g},i.store=function(e,t,n,i,r){var a=this,o=this.getConfiguration(),s=new db(this.g);return this.l.push(s),t=function(e,t,n,i,r,a,o,s){var u,c,d,h,p,f,g,m,v,y,b,S,C,M,D,P,L,N,O,j,U,_,B;return R((function(F){switch(F.g){case 1:return hw(),c=u=null,d=new Ab,f=p=h=null,x(F,2,3),w(F,a(),5);case 5:return u=F.h,w(F,function(e,t,n,i){var r,a,o,s,u;return R((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},updateDuration:function(){},newDrmInfo:function(){},onManifestUpdated:function(){},getBandwidthEstimate:function(){return i.abr.defaultBandwidthEstimate},onMetadata:function(){},disableStream:function(){},addFont:function(){}},n.configure(i.manifest),dw(e),w(l,n.start(t,o),2);if(3!=l.g)return s=l.h,dw(e),u=fw(s),w(l,Promise.all(Yr(u,(function(e){return e.createSegmentIndex()}))),3);if(dw(e),r)throw r;return l.return(s)}))}(e,t,u,o),6);case 6:if(g=F.h,dw(e),g.presentationTimeline.V()||g.presentationTimeline.Tc())throw new Ne(2,9,9005,t);m=l(i),v=m.next();case 7:if(v.done){F.u(9);break}return y=v.value,w(F,function(e,t,n){var i,r,a,o,s,u,c,d,h,p,f,g,m,v,y;return R((function(b){switch(b.g){case 1:return w(b,lw(e,t),2);case 2:if("text/vtt"!=(i=b.h))throw new Ne(1,2,2017,t);return w(b,function(e,t,n){var i,r,a;return R((function(o){return 1==o.g?(i=Gr,(r=Br([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=gi(i)))throw new Ne(2,2,2014,i);for(o=a(),s={periodStart:0,segmentStart:0,segmentEnd:n.presentationTimeline.getDuration(),vttOffset:0},u=De(r),c=o.parseMedia(u,s,t,[]),d=[],h=l(c),p=h.next(),f={};!p.done;f={Pf:void 0,kd:void 0},p=h.next())f.kd=p.value,f.Pf=null,g=function(e){return function(){return null==e.Pf&&(e.Pf=Qe([t],[e.kd.payload])),e.Pf||[]}}(f),m=new Vo(f.kd.startTime,f.kd.endTime,g,0,null,null,0,0,1/0),f.kd.payload.includes("#xywh")&&4===(v=f.kd.payload.split("#xywh=")[1].split(",")).length&&m.Hf({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,gc(d[0].O()[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 Du(d),mimeType:y||"",codecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:"image",primary:!1,trickModeVideo:null,dependencyStream: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([ni(y||"","")]),isAudioMuxedInVideo:!1,baseOriginalId:null})}}))}(e,y,g),10);case 10:b=F.h,g.imageStreams.push(b),dw(e),v=m.next(),F.u(7);break;case 9:S=l(r),C=S.next();case 11:return C.done?(Ra(o.drm.clearKeys,g.variants),P=g.variants.some((function(e){if(e.audio)for(var t=l(e.audio.drmInfos),n=t.next();!n.done;n=t.next())if(n.value.licenseServerUri.startsWith("data:"))return!0;if(e.video)for(t=(e=l(e.video.drmInfos)).next();!t.done;t=e.next())if(t.value.licenseServerUri.startsWith("data:"))return!0;return!1})),L=o.offline.usePersistentLicense,P&&(L=!1),w(F,e.hd(g,(function(e){f=f||e}),o,L),15)):(M=C.value,w(F,function(e,t,n,i,r,a,o){var s;return R((function(u){if(1==u.g)return a?u.u(2):w(u,lw(e,n),3);if(2!=u.g&&(a=u.h),s={id:e.m++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:Ru(0,t.presentationTimeline.getDuration(),[n]),mimeType:a||"",codecs:o||"",kind:r,encrypted:!1,drmInfos:[],keyIds:new Set,language:i,originalLanguage:i,label:null,type:rt,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([ni(a||"",o||"")]),isAudioMuxedInVideo:!1,baseOriginalId:null},!mi(ni(s.mimeType,s.codecs)))throw new Ne(2,2,2014,a);return u.return(s)}))}(e,g,M.uri,M.language,M.kind,M.mime,M.codecs),14));case 14:D=F.h,g.textStreams.push(D),dw(e),C=S.next(),F.u(11);break;case 15:if(c=F.h,dw(e),f)throw f;return w(F,function(e,t,n,i){var r,a,o,s,u,c,d,h,p,f,g,m,v,y,b,S,E,I,C,M,D,P,L,N,O,j,U,_,B;return R((function(R){switch(R.g){case 1:return r={width:1/0,height:1/0},function(e,t,n){e.variants=e.variants.filter((function(e){return _i(e,t,n)}))}(e,n.restrictions,r),w(R,Bi(t,e,i,n.drm.preferredKeySystems,n.drm.keySystemsMapping),2);case 2:for(a=[],o=n.preferredDecodingAttributes,s=n.preferredVideoCodecs,u=n.preferredAudioCodecs,c=n.preferredTextFormats,Ui(e,s,u,o,c),d=l(e.variants),h=d.next();!h.done;h=d.next())p=h.value,a.push(qi(p));for(f=l(e.textStreams),g=f.next();!g.done;g=f.next())m=g.value,a.push(Xi(m));for(v=l(e.imageStreams),y=v.next();!y.done;y=v.next())b=y.value,a.push(Wi(b));return w(R,n.offline.trackSelectionCallback(a),3);case 3:for(S=R.h,E=e.presentationTimeline.getDuration(),I=0,C=l(S),M=C.next();!M.done;M=C.next())D=M.value,P=D.bandwidth*E/8,I+=P;return x(R,4),w(R,n.offline.downloadSizeCallback(I),6);case 6:if(!R.h)throw new Ne(2,9,9014);A(R,5);break;case 4:if((L=k(R))instanceof Ne)throw L;throw new Ne(2,9,9015);case 5:for(N=new Set,O=new Set,j=new Set,U=l(S),_=U.next();!_.done;_=U.next())"variant"==(B=_.value).type&&N.add(B.id),"text"==B.type&&O.add(B.id),"image"==B.type&&j.add(B.id);e.variants=e.variants.filter((function(e){return N.has(e.id)})),e.textStreams=e.textStreams.filter((function(e){return O.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(R)}}))}(g,c,o,L),16);case 16:return w(F,d.init(),17);case 17:return dw(e),w(F,kb(d),18);case 18:return h=F.h,dw(e),N=function(e,t,n,i,r,a,o){var s=function(e,t,n){return{offlineUri:null,originalManifestUri:e,duration:t.presentationTimeline.getDuration(),size:0,expiration:1/0,tracks:t=Wb(t),appMetadata:n,isIncomplete:!1}}(n,t,i),u=r.offline.progressCallback;!function(e,t,n){e.o=function(e,t){s.size=t,u(s,e)},e.m=n}(a,0,(function(t,n){c&&o&&d==n&&ba(e,"cenc",t)}));var c=iw(t)&&!rw(t),d=null;c&&(d=gw.get(e.g.keySystem));for(var h=new Yb,p=l(t.textStreams),f=p.next();!f.done;f=p.next())h.g.set(f.value.id,52);for(f=(p=l(t.imageStreams)).next();!f.done;f=p.next())$b(h,f.value);for(f=(p=l(t.variants)).next();!f.done;f=p.next())Jb(h,f.value);return a=function(e,t,n,i){for(var r=new Map,a=fw(n),o=new Map,s=(a=l(a)).next();!s.done;s=a.next()){var u=cw(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()),yh:Array.from(r.values())}}(a,h,t,r),r=a.streams,a=a.yh,(h=e.g)&&o&&(h.initData=[]),{lk:{creationTime:Date.now(),originalManifestUri:n,duration:t.presentationTimeline.getDuration(),size:0,expiration:e.Pd(),streams:r,sessionIds:o?wa(e):[],drmInfo:h,appMetadata:i,isIncomplete:!0,sequenceMode:t.sequenceMode,type:t.type},yh:a}}(c,g,t,n,o,s,L),O=N.lk,j=N.yh,w(F,h.bb.addManifests([O]),19);case 19:if(U=F.h,dw(e),p=U[0],dw(e),f)throw f;return w(F,function(e,t,n,i,r,a,o,s,u,c){var d,h,p,f,g,m,v,y,b,S,E;return R((function(I){switch(I.g){case 1:if(d={},h=0,p=function(){if(e.j.g||r.l)throw new Ne(2,9,7001)},f=function(e,t){var f,g,m,v,y,b,x,S,A;return R((function(k){if(1==k.g){for(f=l(e),g=f.next(),m={};!g.done;m={jc:void 0},g=f.next())m.jc=g.value,p(),v=sb(m.jc,a),y=m.jc.i,b=m.jc.h,x=function(e){return function(t){var n,i,r,a;return R((function(s){switch(s.g){case 1:if(n=e.jc.g,i=n.Yb(!1),!n.aesKey||i){s.u(2);break}return w(s,il(t,n.aesKey,e.jc.j),3);case 3:t=s.h;case 2:return r=ob(n),w(s,o.addSegments([{data:t}]),4);case 4:a=s.h,p(),d[r]=a[0],h+=t.byteLength,T(s)}}))}}(m),S=m.jc.g,(A=S.Yb(!1))?pb(r,m.jc.groupId,A,y,b,x):r.queue(m.jc.groupId,v,y,b,x);return w(k,function(e){return R((function(t){return 1==t.g?w(t,Promise.all(e.i.values()),2):t.return(e.g.g)}))}(r),2)}return p(),!t||r.l?k.u(0):(aw(s,i,u,c),w(k,o.updateManifest(n,i),0))}))},g=!1,x(I,2),!iw(s)||!g||rw(s)){I.u(4);break}return w(I,f(t.filter((function(e){return e.h})),!0),5);case 5:return p(),t=t.filter((function(e){return!e.h})),m=d,v=h,d={},h=0,w(I,nw(o,n,i,m,v,(function(){return dw(e)})),6);case 6:p();case 4:if(g){I.u(7);break}return w(I,f(t,!1),8);case 8:return p(),y=d,b=h,d={},h=0,w(I,nw(o,n,i,y,b,(function(){return p()})),9);case 9:p();case 7:A(I,0);break;case 2:return S=k(I),E=Object.values(d),w(I,o.removeSegments(E,(function(){})),10);case 10:throw S}}))}(e,j,p,O,s,o,h.bb,g,c,L),20);case 20:return dw(e),aw(g,O,c,L),w(F,h.bb.updateManifest(p,O),21);case 21:return dw(e),_=new Ub("manifest",h.path.Rb,h.path.bb,p),F.return(Xb(_,O));case 3:return E(F),w(F,d.destroy(),22);case 22:if(!u){F.u(23);break}return w(F,u.stop(),23);case 23:if(!c){F.u(25);break}return w(F,c.destroy(),25);case 25:I(F,0);break;case 2:if(B=k(F),null==p){F.u(27);break}return w(F,tw(p),27);case 27:throw f||B}}))}(this,e,t||{},i||[],r||[],(function(){var t;return R((function(i){return 1==i.g?n?i.u(2):w(i,gc(e,a.g,o.manifest.retryParameters),3):(2!=i.g&&(n=i.h),t=Qa(e,n||null),i.return(t()))}))}),o,s),(t=new Ar(t,(function(){return hb(s)}))).finally((function(){Ct(a.l,s)})),function(e,t){var n=t.promise;return e.i.push(n),t.finally((function(){Ct(e.i,n)}))}(this,t)},i.remove=function(e){return pw(this,function(e,t){var n,i,r,a,o,s;return R((function(u){switch(u.g){case 1:if(hw(),null==(n=_b(t))||"manifest"!=n.g)throw new Ne(2,9,9004,t);return i=n,r=new Ab,S(u,2),w(u,r.init(),4);case 4:return w(u,Eb(r,i.Rb(),i.bb()),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([sw(e,s,r),uw(a,i,s)]),2);case 2:return E(u),w(u,r.destroy(),8);case 8:I(u,0)}}))}(this,e))},i.Ik=function(){return pw(this,function(e){var t,n,i,r,a,o,s,u,c,d;return R((function(h){switch(h.g){case 1:return hw(),t=e.g,n=e.h.drm,i=new Ab,r=!1,S(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,zb(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 E(h),w(h,i.destroy(),11);case 11:I(h,3);break;case 3:return h.return(!r)}}))}(this))},i.list=function(){return pw(this,R((function(i){switch(i.g){case 1:return hw(),e=[],t=new Ab,S(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,bb:i},e)}))}))}(t,(function(t,i){n=n.then((function(){return R((function(n){if(1==n.g)return w(n,i.getAllManifests(),2);n.h.forEach((function(n,i){n=Xb(new Ub("manifest",t.Rb,t.bb,i),n),e.push(n)})),T(n)}))}))})),w(i,n,2);case 2:return E(i),w(i,t.destroy(),6);case 6:I(i,3);break;case 3:return i.return(e)}})));var e,t,n},i.hd=function(e,t,n,i){var r,a=this;return R((function(o){return 1==o.g?((r=new fa({pc:a.g,onError:t,rf:function(){},onExpirationUpdated:function(){},onEvent:function(){}})).configure(n.drm),w(o,function(e,t,n){return e.na=!0,e.B=new Map,e.N=n,ma(e,t,!1)}(r,e.variants,i),2)):3!=o.g?w(o,ya(r),3):o.return(r)}))},F("shaka.offline.Storage",Zb),Zb.deleteAll=function(){var e;return R((function(t){return 1==t.g?(e=new Ab,S(t,2),w(t,function(e){var t,n;return R((function(i){return 1==i.g?(t=Array.from(e.g.values()),(n=0<t.length)||Cb.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?(E(t),w(t,e.destroy(),5)):I(t,0)}))},Zb.prototype.list=Zb.prototype.list,Zb.prototype.removeEmeSessions=Zb.prototype.Ik,Zb.prototype.remove=Zb.prototype.remove,Zb.prototype.store=Zb.prototype.store,Zb.prototype.getNetworkingEngine=Zb.prototype.Pb,Zb.prototype.getConfiguration=Zb.prototype.getConfiguration,Zb.prototype.configure=Zb.prototype.configure,Zb.prototype.destroy=Zb.prototype.destroy,Zb.support=ew;var gw=(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").set("com.huawei.wiseplay","3d5e6d359b9a41e8b843dd3c6e72c42c");function mw(){}function vw(e,t){for(e={priority:t||0,callback:e},t=0;t<ww.length;t++)if(ww[t].priority<e.priority)return void ww.splice(t,0,e);ww.push(e)}hd("offline",ew),F("shaka.polyfill",mw),mw.register=vw,mw.installAll=function(){for(var e=l(ww),t=e.next();!t.done;t=e.next()){t=t.value;try{t.callback()}catch(e){q("Error installing polyfill!",e)}}};var yw,bw,ww=[];function Tw(){}function xw(){if(!Object.getOwnPropertyDescriptor(Element.prototype,"ariaHidden"))for(var e=l(["ariaHidden","ariaLabel","ariaPressed","ariaSelected"]),t=e.next();!t.done;t=e.next())Sw(t.value)}function Sw(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 Aw(e,t,n){this.g=e,this.i=t||null,this.h=n||null,this.keySystem=e.keySystem}function kw(e){return e.startsWith("com.apple")?"cbcs":e.startsWith("com.widevine")||e.startsWith("com.microsoft")||e.startsWith("com.chromecast")||e.startsWith("org.w3")||e.startsWith("com.huawei")?"cenc":(q("EmeEncryptionSchemePolyfill: Unknown key system:",e,"Please contribute!"),null)}function Ew(e){if(!e)return!1;var t=(e=e.getConfiguration()).audioCapabilities&&e.audioCapabilities[0];return!(!(e=e.videoCapabilities&&e.videoCapabilities[0]||t)||void 0===e.encryptionScheme)}function Iw(e,t){return!(e&&e!=t&&("cbcs"!=e&&"cbcs-1-9"!=e||!te().$c()))}function Cw(){}function Mw(){te().If()&&!yw&&!navigator.emeEncryptionSchemePolyfilled&&navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration&&(yw=navigator.requestMediaKeySystemAccess,navigator.requestMediaKeySystemAccess=Dw,navigator.emeEncryptionSchemePolyfilled=!0)}function Dw(e,t){var n,i=this;return R((function(r){return 1==r.g?w(r,yw.call(i,e,t),2):Ew(n=r.h)?(navigator.requestMediaKeySystemAccess=yw,r.return(n)):(navigator.requestMediaKeySystemAccess=Pw,r.return(Pw.call(i,e,t)))}))}function Pw(e,t){var n,i,r,a,o,s,u,c,d,h,p,f,g=this;return R((function(m){if(1==m.g){for(n=kw(e),i=[],r=l(t),a=r.next();!a.done;a=r.next())o=a.value,s=Rw(o.videoCapabilities,n),u=Rw(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,yw.call(g,e,i),2)}return h=m.h,f=p=null,i[0]&&(i[0].videoCapabilities&&(p=i[0].videoCapabilities[0].encryptionScheme),i[0].audioCapabilities&&(f=i[0].audioCapabilities[0].encryptionScheme)),m.return(new Aw(h,p,f))}))}function Rw(e,t){return e?e.filter((function(e){return Iw(e.encryptionScheme,t)})):e}function Lw(){}function Nw(){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",Ow),document.addEventListener("webkitfullscreenerror",Ow),document.addEventListener("mozfullscreenchange",Ow),document.addEventListener("mozfullscreenerror",Ow),document.addEventListener("MSFullscreenChange",Ow),document.addEventListener("MSFullscreenError",Ow)}}function Ow(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 jw(){}function Uw(){te().If()&&!bw&&!navigator.mediaCapabilitiesEncryptionSchemePolyfilled&&navigator.mediaCapabilities&&(bw=navigator.mediaCapabilities.decodingInfo,navigator.mediaCapabilities.decodingInfo=_w,navigator.mediaCapabilitiesEncryptionSchemePolyfilled=!0)}function _w(e){var t,n,i=this;return R((function(r){switch(r.g){case 1:return w(r,bw.call(i,e),2);case 2:if(!(t=r.h).supported||!e.keySystemConfiguration)return r.return(t);if(Ew(n=t.keySystemAccess))return navigator.mediaCapabilities.decodingInfo=bw,r.return(t);if(navigator.mediaCapabilities.decodingInfo=Bw,n){r.u(3);break}return w(r,Fw(e),4);case 4:return t.keySystemAccess=r.h,r.return(t);case 3:return r.return(Bw.call(i,e))}}))}function Bw(e){var t,n,i,r,a,o,s,u=this;return R((function(l){switch(l.g){case 1:return n=t=null,!e.keySystemConfiguration||(i=e.keySystemConfiguration,r=i.keySystem,n=i.audio&&i.audio.encryptionScheme,t=i.video&&i.video.encryptionScheme,a=kw(r),o={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:e},Iw(n,a)&&Iw(t,a))?w(l,bw.call(u,e),2):l.return(o);case 2:if((s=l.h).keySystemAccess){s.keySystemAccess=new Aw(s.keySystemAccess,t,n),l.u(3);break}if(!e.keySystemConfiguration){l.u(3);break}return w(l,Fw(e),5);case 5:s.keySystemAccess=l.h;case 3:return l.return(s)}}))}function Fw(e){var t,n;return R((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 Vw(){}function Hw(){te().dc()||(navigator.mediaCapabilities||(navigator.mediaCapabilities={}),Vw.originalMcap=navigator.mediaCapabilities,navigator.mediaCapabilities.decodingInfo=Kw)}function Kw(t){var n,i,r,a,o,s,u;return R((function(l){switch(l.g){case 1:if(n={supported:!1,powerEfficient:!0,smooth:!0,keySystemAccess:null,configuration:t},te(),i=t.video,r=t.audio,"media-source"!=t.type){if("file"!=t.type)return l.return(n);if(i&&(a=i.contentType,""==es().canPlayType(a))||r&&(o=r.contentType,""==es().canPlayType(o)))return l.return(n);l.u(2);break}if(!ev())return l.return(n);if(!i){l.u(3);break}return w(l,function(t){var n;return R((function(i){return 1==i.g?"CAST"!==te().La()?i.u(2):w(i,function(t){var n,i,r,a;return R((function(o){if(1==o.g){if(!(e.cast&&cast.__platform__&&cast.__platform__.canDisplayType))return o.return(ht(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 o.return(!1)}return r=!1,(a=Jw).has(n)?(r=a.get(n),o.u(2)):w(o,cast.__platform__.canDisplayType(n),3)}return 2!=o.g&&(r=o.h,a.set(n,r)),o.return(r)}))}(t),3):2!=i.g?(n=i.h,i.return(n)):i.return(ht(t.contentType))}))}(i),4);case 4:if(!l.h)return l.return(n);case 3:if(r){var c=te().La(),d=r.contentType;if("CAST"===c&&r.spatialRendering&&(d+="; spatialRendering=true"),!ht(d))return l.return(n)}case 2:return t.keySystemConfiguration?(s=t.keySystemConfiguration,w(l,function(e,t,n){var i,r,a,o,s,u,l,c,d,h,p;return R((function(f){switch(f.g){case 1:if(i=[],r=[],n.audio&&(a={robustness:n.audio.robustness||"",contentType:t.contentType},te().li()&&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=ui(u)+";"+si(u),d=ui(l)+";"+si(l),h=n.keySystem,p=null,x(f,2),wr.has(c+"#"+d+"#"+h)){p=wr.get(c+"#"+d+"#"+h)||null,f.u(4);break}return w(f,navigator.requestMediaKeySystemAccess(n.keySystem,[s]),5);case 5:p=f.h,wr.set(c+"#"+d+"#"+h,p);case 4:A(f,3);break;case 2:k(f);case 3:return f.return(p)}}))}(i,r,s),6)):(n.supported=!0,l.return(n));case 6:(u=l.h)&&(n.supported=!0,n.keySystemAccess=u);case 5:return l.return(n)}}))}mw.Aria=Tw,Tw.install=xw,vw(xw),Aw.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},Aw.prototype.createMediaKeys=function(){return this.g.createMediaKeys()},mw.EmeEncryptionScheme=Cw,Cw.install=Mw,vw(Mw),mw.Fullscreen=Lw,Lw.install=Nw,vw(Nw),mw.MCapEncryptionScheme=jw,jw.install=Uw,vw(Uw,-2),mw.MediaCapabilities=Vw,Vw.install=Hw,Vw.originalMcap=null;var Gw,zw,qw,Xw,Ww,Yw,Jw=new Map;function $w(){}function Qw(){var t=te(),n="WEBKIT"===t.Da()?t.xa():null;for((e.MediaSource||e.ManagedMediaSource)&&n&&e.MediaSource&&(12>=n?(Zw(),function(){var e=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(t,n){return e.call(this,t,n-.001)}}()):15>=n&&Zw()),n=(t=l(t.xi())).next();!n.done;n=t.next())eT(n.value);(e.MediaSource||e.ManagedMediaSource)&&function(){if(e.MediaSource){var t=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=function(e){return"mp2t"!=ai(e)&&t(e)}}if(e.ManagedMediaSource){var n=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);e.ManagedMediaSource.isTypeSupported=function(e){return"mp2t"!=ai(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;te().Vi()&&(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 Zw(){var e=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var t=e.apply(this,L.apply(0,arguments));return t.abort=function(){},t}}function eT(t){var n=MediaSource.isTypeSupported.bind(MediaSource);if(MediaSource.isTypeSupported=function(e){return si(e)!=t&&n(e)},e.ManagedMediaSource){var i=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);e.ManagedMediaSource.isTypeSupported=function(e){return si(e)!=t&&i(e)}}}function tT(){}function nT(){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 iT;screen.orientation=n,t(),e.addEventListener("orientationchange",(function(){t();var e=new Dr("change");n.dispatchEvent(e)}))}())}function iT(){Lr.call(this),this.type="",this.angle=0}function rT(){}function aT(t){e.HTMLVideoElement&&e.WebKitMediaKeys&&e.shakaMediaKeysPolyfill!=gT&&(void 0!==t&&t&&(Gw=!0,zw=Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"mediaKeys"),qw=HTMLMediaElement.prototype.setMediaKeys,Xw=e.MediaKeys,Ww=e.MediaKeySystemAccess,Yw=navigator.requestMediaKeySystemAccess),delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=sT,e.MediaKeys=cT,e.MediaKeySystemAccess=lT,navigator.requestMediaKeySystemAccess=oT,e.shakaMediaKeysPolyfill=gT,or.clear(),wr.clear())}function oT(e,t){try{var n=new lT(e,t);return Promise.resolve(n)}catch(e){return Promise.reject(e)}}function sT(e){var t=this.mediaKeys;return t&&t!=e&&dT(t,null),delete this.mediaKeys,(this.mediaKeys=e)?dT(e,this):Promise.resolve()}function uT(e){if(Re(e=De(e.initData)).getUint32(0,!0)+4!=e.byteLength)throw new RangeError("Malformed FairPlay init data");e=Fe(e=_e(e.subarray(4),!0));var t=new Event("encrypted");t.initDataType="skd",t.initData=Me(e),this.dispatchEvent(t)}function lT(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 cT(e){this.h=new WebKitMediaKeys(e),this.g=new $}function dT(e,t){if(e.g.Ra(),!t)return Promise.resolve();e.g.D(t,"webkitneedkey",uT);try{return pu(t,HTMLMediaElement.HAVE_METADATA,e.g,(function(){t.webkitSetMediaKeys(e.h)})),Promise.resolve()}catch(e){return Promise.reject(e)}}function hT(e){Lr.call(this),this.i=null,this.l=e,this.g=this.h=null,this.j=new $,this.sessionId="",this.expiration=NaN,this.closed=new Sr,this.keyStatuses=new fT}function pT(e,t){var n=e.keyStatuses;n.size=null==t?0:1,n.g=t,t=new Dr("keystatuseschange"),e.dispatchEvent(t)}function fT(){this.size=0,this.g=void 0}vw(Hw,-1),mw.MediaSource=$w,$w.install=Qw,vw(Qw),mw.Orientation=tT,tT.install=nT,m(iT,Lr),iT.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))},iT.prototype.unlock=function(){screen.unlockOrientation?screen.unlockOrientation():screen.mozUnlockOrientation?screen.mozUnlockOrientation():screen.msUnlockOrientation&&screen.msUnlockOrientation()},vw(nT),mw.PatchedMediaKeysApple=rT,rT.uninstall=function(){e.shakaMediaKeysPolyfill==gT&&Gw&&(Gw=!1,Object.defineProperty(HTMLMediaElement.prototype,"mediaKeys",zw),HTMLMediaElement.prototype.setMediaKeys=qw,e.MediaKeys=Xw,e.MediaKeySystemAccess=Ww,navigator.requestMediaKeySystemAccess=Yw,zw=Yw=qw=Ww=Xw=null,e.shakaMediaKeysPolyfill="",or.clear(),wr.clear())},rT.install=aT,lT.prototype.createMediaKeys=function(){var e=new cT(this.keySystem);return Promise.resolve(e)},lT.prototype.getConfiguration=function(){return this.g},cT.prototype.createSession=function(e){if("temporary"!=(e=e||"temporary"))throw new TypeError("Session type "+e+" is unsupported on this platform.");return new hT(this.h,e)},cT.prototype.setServerCertificate=function(){return Promise.resolve(!1)},cT.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")},m(hT,Lr),(i=hT.prototype).generateRequest=function(e,t){var n=this;this.h=new Sr;try{var i=this.l.createSession("video/mp4",De(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 Dr("message",e=(new Map).set("messageType",null==n.keyStatuses.Cc()?"license-request":"license-renewal").set("message",Me(e.message))),n.dispatchEvent(e)})),this.j.D(i,"webkitkeyadded",(function(){n.g&&(pT(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:pT(n,"output-not-allowed");break;default:pT(n,"internal-error")}})),pT(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 Sr;try{this.i.update(De(e))}catch(e){this.g.reject(e)}return this.g},i.close=function(){try{this.i.close(),this.closed.resolve(),this.j.Ra()}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=fT.prototype).Cc=function(){return this.g},i.forEach=function(e){this.g&&e(this.g,br.value())},i.get=function(e){if(this.has(e))return this.g},i.has=function(e){var t=br.value();return!(!this.g||!Ce(e,t))},i.entries=function(){},i.keys=function(){},i.values=function(){};var gT="apple";function mT(){}function vT(){if(e.MediaKeys){var t=te();MediaKeys.prototype.setServerCertificate&&t.je()||(MediaKeys.prototype.setServerCertificate=yT)}}function yT(){return Promise.resolve(!1)}function bT(){}function wT(){if(!(!e.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)LT="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;navigator.requestMediaKeySystemAccess=xT,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=ST,e.MediaKeys=kT,e.MediaKeySystemAccess=AT,e.shakaMediaKeysPolyfill=NT}}function TT(e){return LT?LT+e.charAt(0).toUpperCase()+e.slice(1):e}function xT(e,t){try{var n=new AT(e,t);return Promise.resolve(n)}catch(e){return Promise.reject(e)}}function ST(e){var t=this.mediaKeys;return t&&t!=e&&ET(t,null),delete this.mediaKeys,(this.mediaKeys=e)&&ET(e,this),Promise.resolve()}function AT(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 kT(e){this.l=e,this.h=null,this.g=new $,this.i=[],this.j=new Map}function ET(e,t){e.h=t,e.g.Ra();var n=LT;t&&(e.g.D(t,n+"needkey",(function(t){var n=new CustomEvent("encrypted");n.initDataType="cenc",n.initData=Me(t.initData),e.h.dispatchEvent(n)})),e.g.D(t,n+"keymessage",(function(t){var n=IT(e,t.sessionId);n&&(t=new Dr("message",t=(new Map).set("messageType",null==n.keyStatuses.Cc()?"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=IT(e,t.sessionId))&&t.ready()})),e.g.D(t,n+"keyerror",(function(t){var n=IT(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?PT(n,"output-restricted"):PT(n,1==i?"expired":"internal-error"))}})))}function IT(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 CT(e,t,n){Lr.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 Sr,this.keyStatuses=new RT}function MT(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=De(Fe("LOAD_SESSION|"+n));else{var r=Fe("PERSISTENT|");i=$e(r,t)}else i=De(t)}catch(e){return Promise.reject(e)}e.h=new Sr;var a=TT("generateKeyRequest");try{e.j[a](e.i,i)}catch(t){if("InvalidStateError"!=t.name)return e.h=null,Promise.reject(t);new Ti((function(){try{e.j[a](e.i,i)}catch(t){e.h.reject(t),e.h=null}})).ia(.01)}return e.h}function DT(e,t,n){if(e.g)e.g.then((function(){return DT(e,t,n)})).catch((function(){return DT(e,t,n)}));else{if(e.g=t,"webkit-org.w3.clearkey"==e.i){var i=Ue(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=We(r.keys[0].k),r=We(r.keys[0].kid)}else i=De(n),r=null;var a=TT("addKey");try{e.j[a](e.i,i,r,e.sessionId)}catch(t){e.g.reject(t),e.g=null}}}function PT(e,t){var n=e.keyStatuses;n.size=null==t?0:1,n.g=t,t=new Dr("keystatuseschange"),e.dispatchEvent(t)}function RT(){this.size=0,this.g=void 0}vw((function(){e.HTMLVideoElement&&e.WebKitMediaKeys&&(navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||aT())})),mw.PatchedMediaKeysCert=mT,mT.install=vT,vw(vT),mw.PatchedMediaKeysWebkit=bT,bT.install=wT,AT.prototype.createMediaKeys=function(){var e=new kT(this.g);return Promise.resolve(e)},AT.prototype.getConfiguration=function(){return this.h},kT.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 CT(t,this.l,e),this.i.push(e),e},kT.prototype.setServerCertificate=function(){return Promise.resolve(!1)},kT.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")},m(CT,Lr),(i=CT.prototype).ready=function(){PT(this,"usable"),this.g&&this.g.resolve(),this.g=null},i.generateRequest=function(e,t){return MT(this,t,null)},i.load=function(e){return"persistent-license"==this.l?MT(this,null,e):Promise.reject(Error("Not a persistent session."))},i.update=function(e){var t=new Sr;return DT(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=TT("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=RT.prototype).Cc=function(){return this.g},i.forEach=function(e){this.g&&e(this.g,br.value())},i.get=function(e){if(this.has(e))return this.g},i.has=function(e){var t=br.value();return!(!this.g||!Ce(e,t))},i.entries=function(){},i.keys=function(){},i.values=function(){};var LT="",NT="webkit";function OT(){}function jT(){if(e.HTMLVideoElement){var t=HTMLVideoElement.prototype;t.requestPictureInPicture&&document.exitPictureInPicture||!t.webkitSupportsPresentationMode||(document.pictureInPictureEnabled=!0,document.pictureInPictureElement=null,t.requestPictureInPicture=_T,Object.defineProperty(t,"disablePictureInPicture",{get:FT,set:VT,enumerable:!0,configurable:!0}),document.exitPictureInPicture=BT,document.addEventListener("webkitpresentationmodechanged",UT,!0))}}function UT(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 _T(){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 BT(){var e=document.pictureInPictureElement;return e?(e.webkitSetPresentationMode("inline"),document.pictureInPictureElement=null,Promise.resolve()):Promise.reject(Error("No picture in picture element found"))}function FT(){return!!this.hasAttribute("disablePictureInPicture")||!this.webkitSupportsPresentationMode("picture-in-picture")}function VT(e){e?this.setAttribute("disablePictureInPicture",""):this.removeAttribute("disablePictureInPicture")}function HT(){}function KT(){e.crypto&&("randomUUID"in e.crypto||(e.crypto.randomUUID=GT))}function GT(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.substr(t.lastIndexOf("/")+1)}function zT(){}function qT(){var e=Symbol.prototype;"description"in e||Object.defineProperty(e,"description",{get:XT})}function XT(){var e=/\((.*)\)/.exec(this.toString());return e?e[1]:void 0}function WT(){}function YT(){for(var e=l([Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,Int8Array,Int16Array,Int32Array,Float32Array,Float64Array]),t=e.next();!t.done;t=e.next())(t=t.value).prototype.indexOf||(t.prototype.indexOf=JT),t.prototype.lastIndexOf||(t.prototype.lastIndexOf=$T),t.prototype.includes||(t.prototype.includes=QT)}function JT(e,t){return Array.prototype.indexOf.call(this,e,t)}function $T(e,t){return Array.prototype.lastIndexOf.call(this,e,t)}function QT(e,t){return-1!==this.indexOf(e,t)}function ZT(){}function ex(){if(e.HTMLMediaElement){var t=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var e=t.apply(this);return e&&e.catch((function(){})),e}}}function tx(){}function nx(){if(e.HTMLVideoElement){var t=HTMLVideoElement.prototype;!t.getVideoPlaybackQuality&&("webkitDroppedFrameCount"in t||"number"==typeof es().webkitDroppedFrameCount)&&(t.getVideoPlaybackQuality=ix)}}function ix(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}function rx(){}function ax(){if(!e.VTTCue&&e.TextTrackCue){var t=null,n=TextTrackCue.length;if(3==n)t=ox;else if(6==n)t=sx;else{try{var i=!!ox(1,2,"")}catch(e){i=!1}i&&(t=ox)}t&&(e.VTTCue=function(e,n,i){return t(e,n,i)})}}function ox(t,n,i){return new e.TextTrackCue(t,n,i)}function sx(t,n,i){return new e.TextTrackCue(t+"-"+n+"-"+i,t,n,i)}function ux(e){Lr.call(this),this.h=e,this.l=null,this.g=[],this.i=-1,this.j=null,this.m=new $}function lx(){}vw(wT),mw.PiPWebkit=OT,OT.install=jT,vw(jT),mw.RandomUUID=HT,HT.install=KT,vw(KT),mw.Symbol=zT,zT.install=qT,vw(qT),mw.TypedArray=WT,WT.install=YT,vw(YT),mw.VideoPlayPromise=ZT,ZT.install=ex,vw(ex),mw.VideoPlaybackQuality=tx,tx.install=nx,vw(nx),mw.VTTCue=rx,rx.install=ax,vw(ax),m(ux,Lr),(i=ux.prototype).destroy=function(){var e=this;return R((function(t){if(1==t.g)return w(t,e.removeAllItems(),2);e.h=null,e.m&&(e.m.release(),e.m=null),Lr.prototype.release.call(e),T(t)}))},i.configure=function(e){this.l=e},i.getConfiguration=function(){return this.l},i.getCurrentItem=function(){return this.g.length&&0<=this.i&&this.i<this.g.length?this.g[this.i]:null},i.getCurrentItemIndex=function(){return this.i},i.getItems=function(){return this.g.slice()},i.insertItems=function(e){this.g.push.apply(this.g,c(e)),this.dispatchEvent(new Dr("itemsinserted"))},i.removeAllItems=function(){var e=this;return R((function(t){switch(t.g){case 1:if(e.m.Ra(),!(e.g.length&&0<=e.i)){t.u(2);break}return w(t,e.h.vc(),2);case 2:if(!e.j){t.u(4);break}if(e.j.xf.o){t.u(5);break}return w(t,e.j.xf.destroy(),5);case 5:e.j=null;case 4:e.g=[],e.i=-1,e.dispatchEvent(new Dr("itemsremoved")),T(t)}}))},i.playItem=function(e){var t,n,i,r,a,o,s,u,c,d,h,p,f,g,m=this;return R((function(v){if(1==v.g){if(m.m.Ra(),!m.g.length||e>=m.g.length)throw new Ne(2,7,7007);return t=m.g[e],m.i!=e&&(m.i=e,m.dispatchEvent(new Dr("currentitemchanged"))),n=m.h.h,0<(i=m.l?m.l.preloadNextUrlWindow:0)&&(r=!1,m.m.D(n,"timeupdate",(function(){var e,t,a,o;return R((function(s){switch(s.g){case 1:if(m.j||1>=m.g.length||r||m.h.V()||!n.duration)return s.return();if(e=m.h.Sa().end-n.currentTime,isNaN(e)){s.u(0);break}if(!(e<=i)){s.u(0);break}if(t=m.l&&m.l.repeatMode,a=null,m.i+1<m.g.length?a=m.g[m.i+1]:1==t&&(a=m.g[0]),!a){s.u(0);break}return r=!0,o=null,x(s,5),w(s,m.h.preload(a.manifestUri,a.startTime,a.mimeType,a.config),7);case 7:o=s.h,A(s,6);break;case 5:k(s),o=null;case 6:m.j={item:a,xf:o},r=!1,T(s)}}))}))),m.m.D(m.h,"complete",(function(){var e=m.l&&m.l.repeatMode,t=!1;if(2==e)t=!0;else{var i=m.i+1;i<m.g.length?m.playItem(i):1==e&&(1==m.g.length?t=!0:m.playItem(0))}t&&(n.paused?(n.currentTime=m.h.Sa().start,n.play()):m.m.D(n,"paused",(function(){n.currentTime=m.h.Sa().start,n.play()})))})),t.config&&(m.h.Ci(),m.h.configure(t.config)),a=t.manifestUri,m.j&&m.j.item==t&&m.j.xf&&(a=m.j.xf),w(v,m.h.load(a,t.startTime,t.mimeType),2)}if(m.j=null,t.extraText)for(o=l(t.extraText),s=o.next();!s.done;s=o.next())(u=s.value).mime?m.h.Hd(u.uri,u.language,u.kind,u.mime,u.codecs):m.h.Hd(u.uri,u.language,u.kind);if(t.extraThumbnail)for(c=l(t.extraThumbnail),d=c.next();!d.done;d=c.next())h=d.value,m.h.He(h);if(t.extraChapter)for(p=l(t.extraChapter),f=p.next();!f.done;f=p.next())g=f.value,m.h.Ge(g.uri,g.language,g.mime);T(v)}))},F("shaka.queue.QueueManager",ux),ux.prototype.playItem=ux.prototype.playItem,ux.prototype.removeAllItems=ux.prototype.removeAllItems,ux.prototype.insertItems=ux.prototype.insertItems,ux.prototype.getItems=ux.prototype.getItems,ux.prototype.getCurrentItemIndex=ux.prototype.getCurrentItemIndex,ux.prototype.getCurrentItem=ux.prototype.getCurrentItem,ux.prototype.getConfiguration=ux.prototype.getConfiguration,ux.prototype.configure=ux.prototype.configure,ux.prototype.destroy=ux.prototype.destroy,yh=function(e){return new ux(e)},lx.prototype.parseInit=function(){},lx.prototype.setSequenceMode=function(){},lx.prototype.setManifestType=function(){},lx.prototype.parseMedia=function(e,t){for(var n=null,i=[],r=(e=l(e=Ue(e).split(/\r?\n/))).next();!r.done;r=e.next())if((r=r.value)&&!/^\s+$/.test(r)&&(r=cx.exec(r))){var a=dx.exec(r[1]);r=new Tn(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",lx),lx.prototype.parseMedia=lx.prototype.parseMedia,lx.prototype.setManifestType=lx.prototype.setManifestType,lx.prototype.setSequenceMode=lx.prototype.setSequenceMode,lx.prototype.parseInit=lx.prototype.parseInit;var cx=/^\[(\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?)\](.*)/,dx=/^(\d+):(\d{1,2}(?:[.,]\d{1,3})?)$/;function hx(){}function px(e,t,n,i,r,a,o,s,u,c,d,h,p){var f=c;if(zt(e)){if(!d)return null;var g={tagName:"span",children:[Wt(e)],attributes:{},parent:null}}else g=e;for(var m=null,v=l(Vx),y=v.next();!y.done&&!(m=Tx(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=nn(g,Vx,"backgroundImage"))&&b.test(y)){if((v=parseInt(y.split(":").pop(),10)-1)>=p.length)return null;v=p[v]}else h&&y&&!y.startsWith("#")&&(b=new de(h),y=new de(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(zt)))for(var w=l(g.children),T=w.next();!T.done;T=w.next())(T=px(T.value,t,n,i,r,a,o,y,u,g,d,h,p))&&s.push(T);if(i=null!=c,h=Wt(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=(p=Sx(g,n)).start,p=p.end;f&&f.tagName&&"tt"!=f.tagName;)h=(p=xx(f,n,h,p)).start,p=p.end,f=f.parent;if(null==h&&(h=0),h+=t.periodStart,p=null==p?1/0:p+t.periodStart,h=Math.max(h,t.segmentStart),p=Math.min(p,t.segmentEnd),!w&&0<s.length)for(h=1/0,p=0,n=(t=l(s)).next();!n.done;n=t.next())n=n.value,h=Math.min(h,n.startTime),p=Math.max(p,n.endTime);if("br"==g.tagName)return(r=new Tn(h,p,"")).lineBreak=!0,r;if(t="",b&&(t=Ke(Wt(g)||""),y&&(t=t.replace(/\s+/g," "))),(t=new Tn(h,p,t)).nestedCues=s,d||(t.isContainer=!0),u&&(t.cellResolution=u),u=Tx(g,"region",a,"")[0],g.attributes.region&&u&&u.attributes["xml:id"]){var x=u.attributes["xml:id"];t.region=o.filter((function(e){return e.id==x}))[0]}return o=u,c&&i&&!g.attributes.region&&!g.attributes.style&&(o=Tx(c,"region",a,"")[0]),function(e,t,n,i,r,a,o,s){if("rtl"==vx(t,n,a,"direction",o=o||s)&&(e.direction="rtl"),"tb"==(s=vx(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=Ln),(s=vx(t,n,a,"textAlign",!0))?(e.positionAlign=_x.get(s),e.lineAlign=Ux.get(s),e.textAlign=Dn[s.toUpperCase()]):e.textAlign=Mn,(s=vx(t,n,a,"displayAlign",!0))&&(e.displayAlign=Rn[s.toUpperCase()]),(s=vx(t,n,a,"color",o))&&(e.color=gx(s)),(s=vx(t,n,a,"backgroundColor",o))&&(e.backgroundColor=gx(s)),(s=vx(t,n,a,"border",o))&&(e.border=s),s=vx(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=vx(t,n,a,"fontWeight",o))&&"bold"==s&&(e.fontWeight=Vn),s=vx(t,n,a,"wrapOption",o),e.wrapLine=!s||"noWrap"!=s,(s=vx(t,n,a,"lineHeight",o))&&s.match(Mx)&&(e.lineHeight=s),(s=vx(t,n,a,"fontSize",o))&&(s.match(Mx)||s.match(Cx))&&(e.fontSize=s),(s=vx(t,n,a,"fontStyle",o))&&(e.fontStyle=Gn[s.toUpperCase()]),i?(r=i.attributes.imageType||i.attributes.imagetype,s=i.attributes.encoding,i=Wt(i).trim(),"PNG"==r&&"Base64"==s&&i&&(e.backgroundImage="data:image/png;base64,"+i)):r&&(e.backgroundImage=r),(i=vx(t,n,a,"textOutline",o))&&((i=i.split(" "))[0].match(Mx)?e.textStrokeColor=e.color:(e.textStrokeColor=gx(i[0]),i.shift()),i[0]&&i[0].match(Mx)?e.textStrokeWidth=i[0]:e.textStrokeColor=""),(i=vx(t,n,a,"letterSpacing",o))&&i.match(Mx)&&(e.letterSpacing=i),(i=vx(t,n,a,"linePadding",o))&&i.match(Mx)&&(e.linePadding=i),(i=vx(t,n,a,"opacity",o))&&(e.opacity=parseFloat(i)),(i=yx(n,a,"textDecoration"))&&mx(e,i),(i=bx(t,a,"textDecoration"))&&mx(e,i),(i=vx(t,n,a,"textCombine",o))&&(e.textCombineUpright=i),vx(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 fx(e,t,n){var i=new At,r=e.attributes["xml:id"];if(!r)return null;i.id=r,r=null,n&&(r=Ix.exec(n)||Dx.exec(n)),n=r?Number(r[1]):null,r=r?Number(r[2]):null;var a,o=yx(e,t,"extent");if(o){var s=(a=Ix.exec(o))||Dx.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?kt:0,i.heightUnits=a||null!=r?kt:0)}return(e=yx(e,t,"origin"))&&null!=(s=(a=Ix.exec(e))||Dx.exec(e))&&(i.viewportAnchorX=Number(s[1]),i.viewportAnchorY=Number(s[2]),a?o||(i.width=100-i.viewportAnchorX,i.widthUnits=kt,i.height=100-i.viewportAnchorY,i.heightUnits=kt):(null!=r&&(i.viewportAnchorY=100*i.viewportAnchorY/r),null!=n&&(i.viewportAnchorX=100*i.viewportAnchorX/n)),i.viewportAnchorUnits=a||null!=n?kt:0),i}function gx(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 mx(e,t){for(var n=(t=l(t.split(" "))).next();!n.done;n=t.next())switch(n.value){case"underline":e.textDecoration.includes(zn)||e.textDecoration.push(zn);break;case"noUnderline":e.textDecoration.includes(zn)&&Ct(e.textDecoration,zn);break;case"lineThrough":e.textDecoration.includes("lineThrough")||e.textDecoration.push("lineThrough");break;case"noLineThrough":e.textDecoration.includes("lineThrough")&&Ct(e.textDecoration,"lineThrough");break;case"overline":e.textDecoration.includes("overline")||e.textDecoration.push("overline");break;case"noOverline":e.textDecoration.includes("overline")&&Ct(e.textDecoration,"overline")}}function vx(e,t,n,i,r){return r=void 0===r||r,(e=bx(e,n,i))?e:r?yx(t,n,i):null}function yx(e,t,n){return e?nn(e,Fx,n)||wx(e,t,n):null}function bx(e,t,n){return nn(e,Fx,n)||wx(e,t,n)}function wx(e,t,n){e=Tx(e,"style",t,"");for(var i=null,r=0;r<e.length;r++){var a=en(e[r],"urn:ebu:tt:style",n);a||(a=nn(e[r],Fx,n)),a||(a=bx(e[r],t,n)),a&&(i=a)}return i}function Tx(e,t,n,i,r){var a=[];if(!e||1>n.length)return a;var o=e;for(e=null;!e&&!(e=r?en(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 xx(e,t,n,i){return e=Sx(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 Sx(e,t){var n=Ax(e.attributes.begin,t),i=Ax(e.attributes.end,t);return e=Ax(e.attributes.dur,t),null==i&&null!=e&&(i=n+e),{start:n,end:i}}function Ax(e,t){var n=null;if(Px.test(e)){e=Px.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(Rx.test(e))n=kx(Rx,e);else if(Lx.test(e))n=kx(Lx,e);else if(Nx.test(e))e=Nx.exec(e),n=Number(e[1])/t.frameRate;else if(Ox.test(e))e=Ox.exec(e),n=Number(e[1])/t.g;else if(jx.test(e))n=kx(jx,e);else if(e)throw new Ne(2,2,2001,"Could not parse cue time range in TTML");return n}function kx(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 Ex(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 lx})),hx.prototype.parseInit=function(){},hx.prototype.setSequenceMode=function(){},hx.prototype.setManifestType=function(){},hx.prototype.parseMedia=function(e,t,n,i){var r=Ue(e);if(e=[],""==r)return e;var a=Kt(r,"tt",!0);if(!a)throw new Ne(2,2,2005,"Failed to parse TTML.");if(!(r=Jt(a,"body")[0]))return[];var o=nn(a,Bx,"frameRate"),s=nn(a,Bx,"subFrameRate"),u=nn(a,Bx,"frameRateMultiplier"),c=nn(a,Bx,"tickRate"),d=nn(a,Bx,"cellResolution"),h=a.attributes["xml:space"]||"default",p=nn(a,Fx,"extent");if("default"!=h&&"preserve"!=h)throw new Ne(2,2,2005,"Invalid xml:space value: "+h);h="default"==h,o=new Ex(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=Jt(a,"metadata")[0])?s.children:[]).filter((function(e){return"\n"!=e})),u=Jt(a,"style"),c=[];for(var f=l(a=Jt(a,"region")),g=f.next();!g.done;g=f.next())(g=fx(g.value,u,p))&&c.push(g);if(Xt(r,"p").length)throw new Ne(2,2,2001,"<p> can only be inside <div> in TTML");for(f=(p=l(Xt(r,"div"))).next();!f.done;f=p.next())if(Xt(f.value,"span").length)throw new Ne(2,2,2001,"<span> can only be inside <p> in TTML");return(t=px(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",hx),hx.prototype.parseMedia=hx.prototype.parseMedia,hx.prototype.setManifestType=hx.prototype.setManifestType,hx.prototype.setSequenceMode=hx.prototype.setSequenceMode,hx.prototype.parseInit=hx.prototype.parseInit;var Ix=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,Cx=/^(\d{1,4}(?:\.\d+)?|100)%$/,Mx=/^(\d+px|\d+em|\d*\.?\d+c)$/,Dx=/^(\d+)px (\d+)px$/,Px=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Rx=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,Lx=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,Nx=/^(\d*(?:\.\d*)?)f$/,Ox=/^(\d*(?:\.\d*)?)t$/,jx=RegExp("^(?:(\\d*(?:\\.\\d*)?)h)?(?:(\\d*(?:\\.\\d*)?)m)?(?:(\\d*(?:\\.\\d*)?)s)?(?:(\\d*(?:\\.\\d*)?)ms)?$"),Ux=(new Map).set("left",jn).set("center","center").set("right","end").set("start",jn).set("end","end"),_x=(new Map).set("left","line-left").set("center","center").set("right","line-right"),Bx=["http://www.w3.org/ns/ttml#parameter","http://www.w3.org/2006/10/ttaf1#parameter"],Fx=["http://www.w3.org/ns/ttml#styling","http://www.w3.org/2006/10/ttaf1#styling"],Vx=["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt","http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];function Hx(){this.g=new hx}function Kx(){this.g="UNKNOWN"}function Gx(e,t,n){var i;(i=/^align:(start|middle|center|end|left|right)$/.exec(t))?(t=i[1],e.textAlign="middle"==t?Mn:Dn[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":Cn)):(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=Un[n[2].toUpperCase()])):(n=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(t))&&(e.lineInterpretation=On,e.line=Number(n[1]),n[2]&&(e.lineAlign=Un[n[2].toUpperCase()]))}function zx(){this.g=null}function qx(e,t,n){var i,r,a;return(new ta).box("payl",oa((function(e){i=Ue(e)}))).box("iden",oa((function(e){r=Ue(e)}))).box("sttg",oa((function(e){a=Ue(e)}))).parse(e),i?function(e,t,n,i,r){if(An(e=new Tn(i,r,e)),t&&(e.id=t),n)for(n=Nt(t=new Pt(n));n;)Gx(e,n,[]),Rt(t),n=Nt(t);return e}(i,r,a,t,n):null}function Xx(){}function Wx(){this.g=new Kx}function Yx(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 Jx(){}function $x(e,t){var n=t.Fontname;if(n&&(e.fontFamily=n),(n=t.Fontsize)&&(e.fontSize=n+"px"),(n=t.PrimaryColour)&&(n=Qx(n))&&(e.color=n),(n=t.BackColour)&&(n=Qx(n))&&(e.backgroundColor=n),t.Bold&&(e.fontWeight=Vn),t.Italic&&(e.fontStyle=Kn),t.Underline&&e.textDecoration.push(zn),(n=t.Spacing)&&(e.letterSpacing=n+"px"),n=t.Alignment)switch(parseInt(n,10)){case 1:e.displayAlign=Pn,e.textAlign="start";break;case 2:e.displayAlign=Pn,e.textAlign=Mn;break;case 3:e.displayAlign=Pn,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 Qx(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 Zx(e){return 3600*((e=iS.exec(e))[1]?parseInt(e[1].replace(":",""),10):0)+60*parseInt(e[2],10)+parseFloat(e[3])}fi("application/ttml+xml",(function(){return new hx})),Hx.prototype.parseInit=function(e){var t=!1;if((new ta).box("moov",na).box("trak",na).box("mdia",na).box("minf",na).box("stbl",na).R("stsd",ia).box("stpp",(function(e){t=!0,e.parser.stop()})).parse(e),!t)throw new Ne(2,2,2007)},Hx.prototype.setSequenceMode=function(){},Hx.prototype.setManifestType=function(){},Hx.prototype.parseMedia=function(e,t,n){var i=[],r=null,a=[],o=new Map,s=[];if((new ta).box("moof",na).box("traf",na).R("tfhd",(function(e){r=eo(e.reader,e.flags).Nd})).R("trun",(function(e){for(var t=(e=l((e=io(e.reader,e.version,e.flags)).gh)).next();!t.done;t=e.next())s.push(t.value.sampleSize||r||0)})).R("subs",(function(e){for(var t=e.reader,n=t.T(),i=-1,r=0;r<n;r++){var a=t.T();i+=a,a=t.Ba();for(var s=[],u=0;u<a;u++)1==e.version?s.push(t.T()):s.push(t.Ba()),t.X(),t.X(),t.T();o.set(i,s)}})).box("mdat",oa((function(e){a.push(e)}))).parse(e,!1),0==a.length)throw new Ne(2,2,2007);for(var u=$e.apply(ze,c(a)),d=0,h=0;h<s.length;h++){var p=De(u,d,s[h]);d+=s[h];var f=o.get(h);if(f&&f.length){p=De(p,0,f[0]);for(var g=[],m=f[0],v=1;v<f.length;v++){var y=De(e,m,f[v]);y=qe(y),g.push("data:image/png;base64,"+y),m+=f[v]}i=i.concat(this.g.parseMedia(p,t,n,g))}else i=i.concat(this.g.parseMedia(p,t,n,[]))}return i},F("shaka.text.Mp4TtmlParser",Hx),Hx.prototype.parseMedia=Hx.prototype.parseMedia,Hx.prototype.setManifestType=Hx.prototype.setManifestType,Hx.prototype.setSequenceMode=Hx.prototype.setSequenceMode,Hx.prototype.parseInit=Hx.prototype.parseInit,fi('application/mp4; codecs="stpp"',(function(){return new Hx})),fi('application/mp4; codecs="stpp.ttml"',(function(){return new Hx})),fi('application/mp4; codecs="stpp.ttml.im1i"',(function(){return new Hx})),fi('application/mp4; codecs="stpp.ttml.im1t"',(function(){return new Hx})),fi('application/mp4; codecs="stpp.ttml.im2i"',(function(){return new Hx})),fi('application/mp4; codecs="stpp.ttml.im2t"',(function(){return new Hx})),fi('application/mp4; codecs="stpp.ttml.etd1"',(function(){return new Hx})),fi('application/mp4; codecs="stpp.ttml.etd1|im1t"',(function(){return new Hx})),fi('application/mp4; codecs="stpp.ttml.im1t|etd1"',(function(){return new Hx})),fi('application/mp4; codecs="stpp.TTML.im1t"',(function(){return new Hx})),Kx.prototype.parseInit=function(){},Kx.prototype.setSequenceMode=function(){},Kx.prototype.setManifestType=function(e){this.g=e},Kx.prototype.parseMedia=function(e,t){var n=(e=(e=Ue(e)).replace(/\r\n|\r(?=[^\n]|$)/gm,"\n")).split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(n[0]))throw new Ne(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 Ne(2,2,2e3);if(null==(e=jt(e[1])))throw new Ne(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 Pt(r);var a=new At;Nt(r),Rt(r);for(var o=Nt(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"),Rt(r),o=Nt(r)}t.push(a)}for(kn(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 Tn(0,0,""));for(var d=!1,h=0;h<u.length;h++){var p=/^\s*([^:]+):\s*(.*)/.exec(u[h]);if(p){var f=p[2].trim().replace(";","");switch(p[1].trim()){case"background-color":case"background":d=!0,c.backgroundColor=f;break;case"color":d=!0,c.color=f;break;case"font-family":d=!0,c.fontFamily=f;break;case"font-size":d=!0,c.fontSize=f;break;case"font-weight":(700<=parseInt(f,10)||"bold"==f)&&(d=!0,c.fontWeight=Vn);break;case"font-style":switch(f){case"normal":d=!0,c.fontStyle=Hn;break;case"italic":d=!0,c.fontStyle=Kn;break;case"oblique":d=!0,c.fontStyle="oblique"}break;case"opacity":d=!0,c.opacity=parseFloat(f);break;case"text-combine-upright":d=!0,c.textCombineUpright=f;break;case"text-shadow":d=!0,c.textShadow=f;break;case"white-space":d=!0,c.wrapLine="noWrap"!=f}}}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=Ot(s=new Pt(c[0])),h=Lt(s,/[ \t]+--\x3e[ \t]+/g),u=Ot(s),null==o||null==h||null==u)q("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 Tn(o,u,d),Rt(s),o=Nt(s);o;)Gx(c,o,t),Rt(s),o=Nt(s);An(c,i),null!=a&&(c.id=a),a=c}a&&r.push(a)}return r},F("shaka.text.VttTextParser",Kx),Kx.prototype.parseMedia=Kx.prototype.parseMedia,Kx.prototype.setManifestType=Kx.prototype.setManifestType,Kx.prototype.setSequenceMode=Kx.prototype.setSequenceMode,Kx.prototype.parseInit=Kx.prototype.parseInit,fi("text/vtt",(function(){return new Kx})),fi('text/vtt; codecs="vtt"',(function(){return new Kx})),fi('text/vtt; codecs="wvtt"',(function(){return new Kx})),zx.prototype.parseInit=function(e){var t=this,n=!1;if((new ta).box("moov",na).box("trak",na).box("mdia",na).R("mdhd",(function(e){e=no(e.reader,e.version),t.g=e.timescale})).box("minf",na).box("stbl",na).R("stsd",ia).box("wvtt",(function(){n=!0})).parse(e),!this.g)throw new Ne(2,2,2008);if(!n)throw new Ne(2,2,2008)},zx.prototype.setSequenceMode=function(){},zx.prototype.setManifestType=function(){},zx.prototype.parseMedia=function(e,t){if(!e.length)return[];if(!this.g)throw new Ne(2,2,2008);var n,i=0,r=[],a=[],o=!1,s=!1,u=!1,c=null;if((new ta).box("moof",na).box("traf",na).R("tfdt",(function(e){o=!0,i=to(e.reader,e.version).baseMediaDecodeTime})).R("tfhd",(function(e){c=eo(e.reader,e.flags).Md})).R("trun",(function(e){s=!0,r=io(e.reader,e.version,e.flags).gh})).box("mdat",oa((function(e){u=!0,n=e}))).parse(e,!1),!u&&!o&&!s)throw new Ne(2,2,2008);e=i;for(var d=new Qr(n,0),h=l(r),p=h.next();!p.done;p=h.next()){var f=(p=p.value).hh||c,g=p.Bf?i+p.Bf:e;e=g+(f||0);var m=0;do{var v=d.T();m+=v;var y=null;"vttc"==ua(d.T())?8<v&&(y=d.Ub(v-8)):d.skip(v-8),f&&y&&(v=qx(y,t.periodStart+g/this.g,t.periodStart+e/this.g),a.push(v))}while(p.sampleSize&&m<p.sampleSize)}return a.filter(Ai)},F("shaka.text.Mp4VttParser",zx),zx.prototype.parseMedia=zx.prototype.parseMedia,zx.prototype.setManifestType=zx.prototype.setManifestType,zx.prototype.setSequenceMode=zx.prototype.setSequenceMode,zx.prototype.parseInit=zx.prototype.parseInit,fi('application/mp4; codecs="wvtt"',(function(){return new zx})),Xx.prototype.parseInit=function(){},Xx.prototype.setSequenceMode=function(){},Xx.prototype.setManifestType=function(){},Xx.prototype.parseMedia=function(e){var t=Ue(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 Pt((n=n.value.split("\n"))[0]),r=Ot(i),a=Lt(i,/,/g);if(i=Ot(i),null==r||null==a||null==i)throw new Ne(2,2,2001,"Could not parse cue time range in SubViewer");e.push(new Tn(r,i,n.slice(1).join("\n").trim()))}return e},F("shaka.text.SbvTextParser",Xx),Xx.prototype.parseMedia=Xx.prototype.parseMedia,Xx.prototype.setManifestType=Xx.prototype.setManifestType,Xx.prototype.setSequenceMode=Xx.prototype.setSequenceMode,Xx.prototype.parseInit=Xx.prototype.parseInit,fi("text/x-subviewer",(function(){return new Xx})),Wx.prototype.parseInit=function(){},Wx.prototype.setSequenceMode=function(){},Wx.prototype.setManifestType=function(){},Wx.prototype.parseMedia=function(e,t,n){return e=De(Fe(e=Yx(e=Ue(e)))),this.g.parseMedia(e,t,n,[])},F("shaka.text.SrtTextParser",Wx),Wx.srt2webvtt=Yx,Wx.prototype.parseMedia=Wx.prototype.parseMedia,Wx.prototype.setManifestType=Wx.prototype.setManifestType,Wx.prototype.setSequenceMode=Wx.prototype.setSequenceMode,Wx.prototype.parseInit=Wx.prototype.parseInit,fi("text/srt",(function(){return new Wx})),Jx.prototype.parseInit=function(){},Jx.prototype.setSequenceMode=function(){},Jx.prototype.setManifestType=function(){},Jx.prototype.parseMedia=function(e){var t="",n="",i=null,r=null;for(r=(e=l(r=Ue(e).split(/\r?\n\s*\r?\n/))).next();!r.done;r=e.next()){var a=r.value;r=a,(a=eS.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=tS.exec(e)))if(e=a[1].trim(),a=a[2].trim(),"Format"==e)r=a.split(nS);else if("Style"==e){e=a.split(nS),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={Qi:void 0},a=n.next())if(a=a.value,!/^\s*;/.test(a)&&(o=tS.exec(a)))if(a=o[1].trim(),o=o[2].trim(),"Format"==a)t=o.split(nS);else if("Dialogue"==a){o=o.split(nS),a={};for(var s=0;s<t.length&&s<o.length;s++)a[t[s]]=o[s];o=new Tn(s=Zx(a.Start),Zx(a.End),o.slice(t.length-1).join(",").replace(/\\N/g,"\n").replace(/\{[^}]+\}/g,"")),e.Qi=a.Style,(e=i.find(function(e){return function(t){return t.Name==e.Qi}}(e)))&&$x(o,e),r.push(o)}return r},F("shaka.text.SsaTextParser",Jx),Jx.prototype.parseMedia=Jx.prototype.parseMedia,Jx.prototype.setManifestType=Jx.prototype.setManifestType,Jx.prototype.setSequenceMode=Jx.prototype.setSequenceMode,Jx.prototype.parseInit=Jx.prototype.parseInit;var eS=/^\s*\[([^\]]+)\]\r?\n([\s\S]*)/,tS=/^\s*([^:]+):\s*(.*)/,nS=/\s*,\s*/,iS=/^(\d+:)?(\d{1,2}):(\d{1,2}(?:[.]\d{1,3})?)?$/;function rS(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)?{Ud:n,qa:e}:null}function aS(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 oS(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 sS(e){this.j=e,this.h=0,this.g=new Map,this.i=null}function uS(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,Ea:e,qa:r}}function lS(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 cS(e){this.j=e,this.h=0,this.g=new Map,this.i=null}function dS(e,t){if(t+8>e.length||2935!=(e[t]<<8|e[t+1]))return null;var n=new ds(e.subarray(t+2));ps(n,2),ps(n,3);var i=fs(n,11)+1<<1,r=fs(n,2);if(3==r){r=[24e3,22060,16e3][r=fs(n,2)];var a=3}else r=[48e3,44100,32e3][r],a=fs(n,2);var o=fs(n,3),s=fs(n,1);return n=fs(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,Ea:e,qa:i})}function hS(e){this.j=e,this.h=0,this.g=new Map,this.i=null}fi("text/x-ssa",(function(){return new Jx})),(i=sS.prototype).destroy=function(){this.g.clear()},i.isSupported=function(e){return"audio/aac"==e.toLowerCase().split(";")[0]&&ht(this.convertCodecs("audio",e))},i.convertCodecs=function(e,t){return"audio/aac"==t.toLowerCase().split(";")[0]?'audio/mp4; codecs="'+(li(t)||"mp4a.40.2")+'"':t},i.getOriginalMimeType=function(){return this.j},i.transmux=function(e,t,n,i){for(var r=De(e),a=ls(r),o=a.length;o<r.length&&!oS(r,o);o++);if(e=1e3*n.endTime,(a=us(a)).length&&n&&(a=a.find((function(e){return"com.apple.streaming.transportStreamTimestamp"===e.description})))&&(e=a.data),!(a=aS(r,o)))return Promise.reject(new Ne(2,3,3018,n?n.O()[0]:null));t.audioSamplingRate=a.sampleRate,t.channelsCount=a.channelCount;for(var s=[];o<r.length;){var u=rS(r,o);if(!u)return Promise.reject(new Ne(2,3,3018,n?n.O()[0]:null));var l=u.Ud+u.qa;o+l<=r.length&&s.push({data:r.subarray(o+u.Ud,o+l),size:u.qa,duration:1024,rb:0,flags:{wb:0,kb:0,jb:0,hb:0,ib:2,xb:0}}),o+=l}return r=a.sampleRate,e=Math.floor(e*r/1e3),i=new uo([i={id:t.id,type:"audio",codecs:a.codec,encrypted:t.encrypted&&0<t.drmInfos.length,timescale:r,duration:i,Ab:[],Ea:new Uint8Array([]),Na:new Uint8Array([]),Wa:0,Xa:0,data:{Vb:this.h,baseMediaDecodeTime:e,yb:s},stream:t}]),n=t.id+"_"+n.i,this.g.has(n)?t=this.g.get(n):(t=lo(i),this.g.set(n,t)),n=this.i!==t,i=go(i),this.i=t,this.h++,n?(t=$e(t,i),Promise.resolve(t)):Promise.resolve(i)},F("shaka.transmuxer.AacTransmuxer",sS),sS.prototype.transmux=sS.prototype.transmux,sS.prototype.getOriginalMimeType=sS.prototype.getOriginalMimeType,sS.prototype.convertCodecs=sS.prototype.convertCodecs,sS.prototype.isSupported=sS.prototype.isSupported,sS.prototype.destroy=sS.prototype.destroy,Wn("audio/aac",(function(){return new sS("audio/aac")}),$n),(i=cS.prototype).destroy=function(){this.g.clear()},i.isSupported=function(e){return"audio/ac3"==e.toLowerCase().split(";")[0]&&ht(this.convertCodecs("audio",e))},i.convertCodecs=function(e,t){return"audio/ac3"==t.toLowerCase().split(";")[0]?te().ee()?'audio/mp4; codecs="ec-3"':'audio/mp4; codecs="ac-3"':t},i.getOriginalMimeType=function(){return this.j},i.transmux=function(e,t,n,i){for(var r=ls(e=De(e)),a=r.length;a<e.length&&!lS(e,a);a++);var o=1e3*n.endTime;(r=us(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=uS(e,a);if(!l)return Promise.reject(new Ne(2,3,3018,n?n.O()[0]:null));t.audioSamplingRate=l.sampleRate,t.channelsCount=l.channelCount,r=l.sampleRate,s=l.Ea,u.push({data:e.subarray(a,a+l.qa),size:l.qa,duration:1536,rb:0,flags:{wb:0,kb:0,jb:0,hb:0,ib:2,xb:0}}),a+=l.qa}return e=Math.floor(o*r/1e3),i=new uo([i={id:t.id,type:"audio",codecs:"ac-3",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:r,duration:i,Ab:[],Ea:s,Na:new Uint8Array([]),Wa:0,Xa:0,data:{Vb:this.h,baseMediaDecodeTime:e,yb:u},stream:t}]),n=t.id+"_"+n.i,this.g.has(n)?t=this.g.get(n):(t=lo(i),this.g.set(n,t)),n=this.i!==t,i=go(i),this.i=t,this.h++,n?(t=$e(t,i),Promise.resolve(t)):Promise.resolve(i)},F("shaka.transmuxer.Ac3Transmuxer",cS),cS.prototype.transmux=cS.prototype.transmux,cS.prototype.getOriginalMimeType=cS.prototype.getOriginalMimeType,cS.prototype.convertCodecs=cS.prototype.convertCodecs,cS.prototype.isSupported=cS.prototype.isSupported,cS.prototype.destroy=cS.prototype.destroy,Wn("audio/ac3",(function(){return new cS("audio/ac3")}),$n),(i=hS.prototype).destroy=function(){this.g.clear()},i.isSupported=function(e){return"audio/ec3"==e.toLowerCase().split(";")[0]&&ht(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.j},i.transmux=function(e,t,n,i){for(var r=ls(e=De(e)),a=r.length;a<e.length&&2935!=(e[a]<<8|e[a+1]);a++);var o=1e3*n.endTime;(r=us(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=dS(e,a);if(!l)return Promise.reject(new Ne(2,3,3018,n?n.O()[0]:null));t.audioSamplingRate=l.sampleRate,t.channelsCount=l.channelCount,r=l.sampleRate,s=l.Ea,u.push({data:e.subarray(a,a+l.qa),size:l.qa,duration:1536,rb:0,flags:{wb:0,kb:0,jb:0,hb:0,ib:2,xb:0}}),a+=l.qa}return e=Math.floor(o*r/1e3),i=new uo([i={id:t.id,type:"audio",codecs:"ec-3",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:r,duration:i,Ab:[],Ea:s,Na:new Uint8Array([]),Wa:0,Xa:0,data:{Vb:this.h,baseMediaDecodeTime:e,yb:u},stream:t}]),n=t.id+"_"+n.i,this.g.has(n)?t=this.g.get(n):(t=lo(i),this.g.set(n,t)),n=this.i!==t,i=go(i),this.i=t,this.h++,n?(t=$e(t,i),Promise.resolve(t)):Promise.resolve(i)},F("shaka.transmuxer.Ec3Transmuxer",hS),hS.prototype.transmux=hS.prototype.transmux,hS.prototype.getOriginalMimeType=hS.prototype.getOriginalMimeType,hS.prototype.convertCodecs=hS.prototype.convertCodecs,hS.prototype.isSupported=hS.prototype.isSupported,hS.prototype.destroy=hS.prototype.destroy,Wn("audio/ec3",(function(){return new hS("audio/ec3")}),$n);var pS=[100,110,122,244,44,83,86,118,128,138,139,134];function fS(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*vS[14*(3===n?3-i:3===i?3:4)+r-1],a=yS[3*(3===n?0:2===n?1:2)+a],n=bS[n][i];var s=wS[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,qa:u,Kk:8*n*s}}return null}function gS(e,t){return!(255!==e[t]||224&~e[t+1]||!(6&e[t+1]))}function mS(e,t){if(t+1<e.length&&gS(e,t)){var n=fS(e,t),i=4;return n&&n.qa&&(i=n.qa),(t+=i)===e.length||t+1<e.length&&gS(e,t)}return!1}var vS=[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],yS=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],bS=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],wS=[0,1,1,4];function TS(e){this.j=e,this.h=0,this.g=new Map,this.i=null}function xS(e){this.h=e,this.g=null}function SS(e){this.h=e,(this.g=Qm.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]!==kS[n]&&(e=!1);e&&(this._parsing&&(this.type="sepiff"),t.call(this))}))}(this)}function AS(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=TS.prototype).destroy=function(){this.g.clear()},i.isSupported=function(e){return"audio/mpeg"==e.toLowerCase().split(";")[0]&&ht(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.j},i.transmux=function(e,t,n,i){for(var r=De(e),a=ls(r).length;a<r.length&&!mS(r,a);a++);var o;for(e=[];a<r.length;){var s=fS(r,a);if(!s)return Promise.reject(new Ne(2,3,3018,n?n.O()[0]:null));o||(o=s),a+s.qa<=r.length&&e.push({data:r.subarray(a,a+s.qa),size:s.qa,duration:1152,rb:0,flags:{wb:0,kb:0,jb:0,hb:0,ib:2,xb:0}}),a+=s.qa}return o?(r=9e4*o.Kk/o.sampleRate*this.h,i=new uo([i={id:t.id,type:"audio",codecs:"mp3",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:o.sampleRate,duration:i,Ab:[],Ea:new Uint8Array([]),Na:new Uint8Array([]),Wa:0,Xa:0,data:{Vb:this.h,baseMediaDecodeTime:r,yb:e},stream:t}]),n=t.id+"_"+n.i,this.g.has(n)?t=this.g.get(n):(t=lo(i),this.g.set(n,t)),n=this.i!==t,i=go(i),this.i=t,this.h++,n?(t=$e(t,i),Promise.resolve(t)):Promise.resolve(i)):Promise.reject(new Ne(2,3,3018,n?n.O()[0]:null))},F("shaka.transmuxer.Mp3Transmuxer",TS),TS.prototype.transmux=TS.prototype.transmux,TS.prototype.getOriginalMimeType=TS.prototype.getOriginalMimeType,TS.prototype.convertCodecs=TS.prototype.convertCodecs,TS.prototype.isSupported=TS.prototype.isSupported,TS.prototype.destroy=TS.prototype.destroy,Wn("audio/mpeg",(function(){return new TS("audio/mpeg")}),$n),(i=xS.prototype).destroy=function(){},i.isSupported=function(e){if("video/mp2t"!=e.toLowerCase().split(";")[0])return!1;var t=li(e).split(","),n=nt("audio",t);return t=nt("video",t),!(!n||t||"mp3"!=oi(n))&&ht(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 Ss,this.g.Ff(n.i),e=De(e),"mp3"!=(e=this.g.parse(e)).Od().audio||"audio"!=r)return Promise.reject(new Ne(2,3,3018,n?n.O()[0]:null));for(n=new Uint8Array([]),r=l(e.sb()),e=r.next();!e.done;e=r.next())if(e=e.value.data)for(t=0;t<e.length;)(i=fS(e,t))?(t+i.qa<=e.length&&(n=$e(n,e.subarray(t,t+i.qa))),t+=i.qa):t++;return Promise.resolve(n)},F("shaka.transmuxer.MpegTsTransmuxer",xS),xS.prototype.transmux=xS.prototype.transmux,xS.prototype.getOriginalMimeType=xS.prototype.getOriginalMimeType,xS.prototype.convertCodecs=xS.prototype.convertCodecs,xS.prototype.isSupported=xS.prototype.isSupported,xS.prototype.destroy=xS.prototype.destroy,Wn("video/mp2t",(function(){return new xS("video/mp2t")}),Qn),(i=SS.prototype).destroy=function(){},i.isSupported=function(e,t){var n=e.startsWith("mss/");return!(!this.g||!n)&&(t?ht(this.convertCodecs(t,e)):(t=this.convertCodecs("audio",e),e=this.convertCodecs("video",e),ht(t)||ht(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(De(e));if(!t.mssPrivateData)return Promise.reject(new Ne(2,3,3020,n?n.O()[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 p=this.g.createFullBox("saiz",s);if(p.version=0,p.flags=0,p.sample_count=d.sample_count,p.default_sample_info_size=0,p.sample_info_size=[],2&d.flags)for(i=0;i<d.sample_count;i+=1)p.sample_info_size[i]=10+6*d.entry[i].NumberOfEntries;else p.default_sample_info_size=8}}a.flags&=16777214,a.flags|=131072,u.flags|=1;var f=r.fetch("moof");u.data_offset=f.getLength()+8;var g=r.fetch("saio");null!==g&&(g.offset[0]=AS(f,"traf")+AS(s,"senc")+16);var m=De(r.write());return Promise.resolve(m)}catch(e){return e instanceof Ne?Promise.reject(e):Promise.reject(new Ne(2,3,3022,n?n.O()[0]:null))}},F("shaka.transmuxer.MssTransmuxer",SS),SS.prototype.transmux=SS.prototype.transmux,SS.prototype.getOriginalMimeType=SS.prototype.getOriginalMimeType,SS.prototype.convertCodecs=SS.prototype.convertCodecs,SS.prototype.isSupported=SS.prototype.isSupported,SS.prototype.destroy=SS.prototype.destroy;var kS=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);function ES(e){this.m=e,this.g=0,this.j=new Map,this.l=this.i=this.h=null}Wn("mss/audio/mp4",(function(){return new SS("mss/audio/mp4")}),$n),Wn("mss/video/mp4",(function(){return new SS("mss/video/mp4")}),$n),(i=ES.prototype).destroy=function(){this.j.clear(),this.i&&this.i.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=li(n).split(",");return n=nt("audio",i),i=nt("video",i),!(n&&(n=oi(n),!IS.includes(n))||i&&(n=oi(i),!CS.includes(n)))&&(t?ht(this.convertCodecs(t,e)):(t=this.convertCodecs("audio",e),e=this.convertCodecs("video",e),ht(t)||ht(e)))},i.convertCodecs=function(e,t){return"video/mp2t"==t.toLowerCase().split(";")[0]?(t=li(t).replace("mp4a.40.34","mp3").split(",").map((function(e){return Gi(e,"audio/mp4")})).map(zi).join(","),"audio"==e?'audio/mp4; codecs="'+t+'"':'video/mp4; codecs="'+t+'"'):t},i.getOriginalMimeType=function(){return this.m},i.transmux=function(e,t,n,i,r){var a=De(e);if("audio"==r&&!Is(a)){for(var o=ls(a),s=o.length;s<a.length;s++)if(mS(a,s))return Promise.reject(new Ne(2,3,3018,n?n.O()[0]:null));for(s=o.length;s<a.length;s++)if(oS(a,s))return this.i||(this.i=new sS("audio/aac")),this.i.transmux(e,t,n,i,r);return Promise.reject(new Ne(2,3,3018,n?n.O()[0]:null))}this.h?this.h.clearData():this.h=new Ss,this.h.Ff(n.i);var u=this.h.parse(a),d=[],h=u.Od();try{var p=null;if("video"==r){switch(h.video){case"avc":var f=[],g=null,m=u.Rc(),v=function(e){function t(e){r={data:new Uint8Array([]),frame:!1,isKeyframe:!1,pts:e.pts,dts:e.dts,nalus:[]}}function n(){if(r&&r.nalus.length&&r.frame){for(var e=[],t=l(r.nalus),n=t.next();!n.done;n=t.next()){var a=(n=n.value).fullData.byteLength,o=new Uint8Array(4);o[0]=a>>24&255,o[1]=a>>16&255,o[2]=a>>8&255,o[3]=255&a,e.push(o),e.push(n.fullData)}r.data=$e.apply(ze,c(e)),i.push(r)}}for(var i=[],r=null,a=!1,o=0;o<e.length;o++){var s=e[o],u=s.nalus,d=!1;r&&u.length&&!a&&(n(),t(s));for(var h=(u=l(s.nalus)).next();!h.done;h=u.next()){var p=!1;switch((h=h.value).type){case 1:var f=!1;p=!0;var g=h.data;d&&4<g.length&&(2===(g=xs(new ds(g)))||4===g||7===g||9===g)&&(f=!0),f&&r&&r.frame&&!r.isKeyframe&&(n(),r=null),r||t(s),r.frame=!0,r.isKeyframe=f;break;case 5:p=!0,r&&r.frame&&!r.isKeyframe&&(n(),r=null),r||t(s),r.frame=!0,r.isKeyframe=!0;break;case 6:case 8:case 12:p=!0;break;case 7:d=p=!0;break;case 9:a=p=!0,r&&r.frame&&(n(),r=null),r||t(s);break;default:p=!1}r&&p&&r.nalus.push(h)}}return n(),i}(m);if(!v.length)throw new Ne(2,3,3023,n?n.O()[0]:null);for(var y=0;y<v.length;y++){var b,w=v[y];null==g&&(g=w.dts),b=y+1<v.length?(v[y+1].dts||0)-(w.dts||0):1<v.length?(w.dts||0)-(v[y-1].dts||0):9e4*(n.endTime-n.startTime),f.push({data:w.data,size:w.data.byteLength,duration:b,rb:Math.round((w.pts||0)-(w.dts||0)),flags:{wb:0,kb:0,jb:0,hb:0,ib:w.isKeyframe?2:1,xb:w.isKeyframe?0:1}})}for(var T=[],x=l(m),S=x.next();!S.done;S=x.next())T.push.apply(T,c(S.value.nalus));var A=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 ds(t.data),i=ws(n);if(ws(n),ws(n),ms(n),pS.includes(i)&&(3===(i=vs(n))&&ps(n,1),ms(n),ms(n),ps(n,1),bs(n))){i=3!==i?8:12;for(var r=0;r<i;r++)bs(n)&&Ts(n,6>r?16:64)}if(ms(n),0===(i=vs(n)))vs(n);else if(1===i)for(ps(n,1),ms(n),ms(n),i=vs(n),r=0;r<i;r++)ms(n);ms(n),ps(n,1);var a=vs(n),o=vs(n),s=fs(n,1);0===s&&ps(n,1),ps(n,1);var u=0,l=0,d=0,h=0;if(bs(n)&&(u=vs(n),l=vs(n),d=vs(n),h=vs(n)),r=i=1,bs(n)&&bs(n)){var p=ws(n);0<p&&16>=p?(i=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][p-1],r=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][p-1]):255===p&&(i=fs(n,16),r=fs(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,Na:e=new Uint8Array([1,u[3],u[4],u[5],255,225].concat(u,[1],t)),Wa:i,Xa:r}}(T);if(!A||null==g)throw new Ne(2,3,3018,n?n.O()[0]:null);t.height=A.height,t.width=A.width,p={id:t.id,type:"video",codecs:"avc1",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:9e4,duration:i,Ab:[],Ea:new Uint8Array([]),Na:A.Na,Wa:A.Wa,Xa:A.Xa,data:{Vb:this.g,baseMediaDecodeTime:g,yb:f},stream:t};break;case"hvc":var k=[],E=null,I=[],C=u.Rc();if(!C.length)throw new Ne(2,3,3023,n?n.O()[0]:null);for(var M=0;M<C.length;M++){var D=C[M],P=D.nalus;I.push.apply(I,c(P));for(var R=!1,L=[],N=!1,O=l(P),j=O.next();!j.done;j=O.next()){var U=j.value;switch(U.type){case 1:case 0:var _=N=!0;break;case 19:case 20:case 21:R=_=N=!0;break;case 32:case 33:case 34:case 39:case 40:_=!0;break;case 35:N=_=!0;break;default:_=!1}if(N&&_){var B=U.fullData.byteLength,F=new Uint8Array(4);F[0]=B>>24&255,F[1]=B>>16&255,F[2]=B>>8&255,F[3]=255&B,L.push(F),L.push(U.fullData)}}var V,H=L.length?{data:$e.apply(ze,c(L)),isKeyframe:R}:null;if(H)null==E&&null!=D.dts&&(E=D.dts),V=M+1<C.length?(C[M+1].dts||0)-(D.dts||0):1<C.length?(D.dts||0)-(C[M-1].dts||0):9e4*(n.endTime-n.startTime),k.push({data:H.data,size:H.data.byteLength,duration:V,rb:Math.round((D.pts||0)-(D.dts||0)),flags:{wb:0,kb:0,jb:0,hb:0,ib:H.isKeyframe?2:1,xb:H.isKeyframe?0:1}})}var K=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 ds(e,!0);return ws(t),ws(t),fs(t,4),fs(t,2),fs(t,6),{Sg:(e=fs(t,3))+1,wh:t=bs(t)}}(t.fullData);e=function(e){ws(e=new ds(e,!0)),ws(e);var t=0,n=0,i=0,r=0;fs(e,4);var a=fs(e,3);bs(e);for(var o=fs(e,2),s=fs(e,1),u=fs(e,5),l=ws(e),c=ws(e),d=ws(e),h=ws(e),p=ws(e),f=ws(e),g=ws(e),m=ws(e),v=ws(e),y=ws(e),b=ws(e),w=[],T=[],x=0;x<a;x++)w.push(bs(e)),T.push(bs(e));if(0<a)for(x=a;8>x;x++)fs(e,2);for(x=0;x<a;x++)w[x]&&fs(e,88),T[x]&&ws(e);vs(e),3==(w=vs(e))&&fs(e,1),T=vs(e),x=vs(e),bs(e)&&(t+=vs(e),n+=vs(e),i+=vs(e),r+=vs(e));var S=vs(e),A=vs(e),k=vs(e);if(bs(e))for(var E=0;E<=a;E++)vs(e),vs(e),vs(e);else vs(e),vs(e),vs(e);if(vs(e),vs(e),vs(e),vs(e),vs(e),vs(e),bs(e)&&bs(e))for(E=0;4>E;E++)for(var I=0;I<(3===E?2:6);I++)if(bs(e)){var C=Math.min(64,1<<4+(E<<1));1<E&&ys(e);for(var M=0;M<C;M++)ys(e)}else vs(e);for(bs(e),bs(e),bs(e)&&(ws(e),vs(e),vs(e),bs(e)),E=vs(e),C=I=0;C<E;C++)if(M=!1,0!==C&&(M=bs(e)),M){C===E&&vs(e),bs(e),vs(e);for(var D=M=0;D<=I;D++){var P=bs(e),R=!1;P||(R=bs(e)),(P||R)&&M++}I=M}else{for(I=(D=vs(e))+(M=vs(e)),P=0;P<D;P++)vs(e),bs(e);for(D=0;D<M;D++)vs(e),bs(e)}if(bs(e))for(E=vs(e),I=0;I<E;I++){for(C=0;C<k+4;C++)fs(e,1);fs(e,1)}if(E=k=1,I=0,bs(e),bs(e),bs(e)){if(bs(e)&&(M=[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<(C=ws(e))&&16>=C?(k=M[C-1],E=D[C-1]):255===C&&(k=fs(e,16),E=fs(e,16))),bs(e)&&bs(e),bs(e)&&(fs(e,3),bs(e),bs(e)&&(ws(e),ws(e),ws(e))),bs(e)&&(vs(e),vs(e)),bs(e),bs(e),bs(e),(C=bs(e))&&(vs(e),vs(e),vs(e),vs(e)),bs(e)&&(fs(e,32),fs(e,32),bs(e)&&vs(e),bs(e)))for(D=!1,C=bs(e),M=bs(e),(C||M)&&((D=bs(e))&&(ws(e),fs(e,5),bs(e),fs(e,5)),fs(e,4),fs(e,4),D&&fs(e,4),fs(e,5),fs(e,5),fs(e,5)),P=0;P<=a;P++){var L=!0;R=1,bs(e)||(L=bs(e));var N=!1;if(L?vs(e):N=bs(e),N||(R=vs(e)+1),C){for(L=0;L<R;L++)vs(e),vs(e),D&&(vs(e),vs(e));bs(e)}if(M){for(L=0;L<R;L++)vs(e),vs(e),D&&(vs(e),vs(e));bs(e)}}bs(e)&&(bs(e),bs(e),bs(e),I=vs(e),vs(e),vs(e),vs(e),vs(e))}return{wg:b,Cg:o,Dg:s,Bg:u,xg:l,yg:c,zg:d,Ag:h,pg:p,qg:f,rg:g,sg:m,ug:v,vg:y,lf:I,hg:0,fg:w,eg:S,dg:A,width:T-(t+n)*(1===w||2===w?2:1),height:x-(i+r)*(1===w?2:1),Mk:k,Lk:E}}(n.fullData);var a=function(e){var t=new ds(e,!0);ws(t),ws(t),vs(t),vs(t),bs(t),bs(t),fs(t,3),bs(t),bs(t),vs(t),vs(t),ys(t),bs(t),bs(t),bs(t)&&vs(t),ys(t),ys(t),bs(t),bs(t),bs(t),bs(t),e=bs(t);var n=1;return(t=bs(t))&&e?n=0:t?n=3:e&&(n=2),{Ug: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.Cg)<<6|(i.Dg?1:0)<<5|31&i.Bg,r[2]=i.xg,r[3]=i.yg,r[4]=i.zg,r[5]=i.Ag,r[6]=i.pg,r[7]=i.qg,r[8]=i.rg,r[9]=i.sg,r[10]=i.ug,r[11]=i.vg,r[12]=i.wg,r[13]=240|(3840&i.lf)>>8,r[14]=255&i.lf,r[15]=252|3&i.Ug,r[16]=252|3&i.fg,r[17]=248|7&i.eg,r[18]=248|7&i.dg,r[19]=0,r[20]=0,r[21]=(3&i.hg)<<6|(7&i.Sg)<<3|(i.wh?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,{Sg:r.Sg,wh:r.wh,Cg:e.Cg,Dg:e.Dg,wg:e.wg,Bg:e.Bg,xg:e.xg,yg:e.yg,zg:e.zg,Ag:e.Ag,pg:e.pg,qg:e.qg,rg:e.rg,sg:e.sg,ug:e.ug,vg:e.vg,hg:e.hg,lf:e.lf,fg:e.fg,eg:e.eg,dg:e.dg,Ug:a.Ug}),{height:e.height,width:e.width,Na:t,Wa:e.Mk,Xa:e.Lk}}(I);if(!K||null==E)throw new Ne(2,3,3018,n?n.O()[0]:null);t.height=K.height,t.width=K.width,p={id:t.id,type:"video",codecs:"hvc1",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:9e4,duration:i,Ab:[],Ea:new Uint8Array([]),Na:K.Na,Wa:K.Wa,Xa:K.Xa,data:{Vb:this.g,baseMediaDecodeTime:E,yb:k},stream:t}}p&&(d.push(p),p=null)}if("audio"==r){switch(h.audio){case"aac":for(var G,z=[],q=null,X=null,W=null,Y=l(u.sb()),J=Y.next();!J.done;J=Y.next()){var $=J.value,Q=$.data;if(Q){var Z=0;if(-1==X&&W)Q=$e(W,$.data),X=null;else if(null!=X&&W){Z=Math.max(0,X);var ee=$e(W,Q.subarray(0,Z));z.push({data:ee,size:ee.byteLength,duration:1024,rb:0,flags:{wb:0,kb:0,jb:0,hb:0,ib:2,xb:0}}),X=W=null}if(!(G=aS(Q,Z)))throw new Ne(2,3,3018,n?n.O()[0]:null);for(t.audioSamplingRate=G.sampleRate,t.channelsCount=G.channelCount,null==q&&null!==$.pts&&(q=$.pts);Z<Q.length;){var te=rS(Q,Z);if(!te){W=Q.subarray(Z,Q.length),X=-1;break}var ne=te.Ud+te.qa;0!=(X=Math.max(0,Z+ne-Q.length))?W=Q.subarray(Z+te.Ud,Z+ne):Z+ne<=Q.length&&z.push({data:Q.subarray(Z+te.Ud,Z+ne),size:te.qa,duration:1024,rb:0,flags:{wb:0,kb:0,jb:0,hb:0,ib:2,xb:0}}),Z+=ne}}}if(!G||null==q){if(!u.Rc().length)throw new Ne(2,3,3018,n?n.O()[0]:null);q=9e4*n.startTime;var ie=nt("audio",t.codecs.split(","));if(!ie||!t.channelsCount||!t.audioSamplingRate)throw new Ne(2,3,3018,n?n.O()[0]:null);G={sampleRate:t.audioSamplingRate,channelCount:t.channelsCount,codec:ie};var re=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}(ie,t.channelsCount);if(!re)throw new Ne(2,3,3018,n?n.O()[0]:null);for(var ae=q+9e4*(n.endTime-n.startTime),oe=q;oe<ae;)z.push({data:re,size:re.byteLength,duration:1024,rb:0,flags:{wb:0,kb:0,jb:0,hb:0,ib:2,xb:0}}),oe+=1024/G.sampleRate*9e4}var se=G.sampleRate,ue=q/9e4*se;p={id:t.id,type:"audio",codecs:G.codec,encrypted:t.encrypted&&0<t.drmInfos.length,timescale:se,duration:i,Ab:[],Ea:new Uint8Array([]),Na:new Uint8Array([]),Wa:0,Xa:0,data:{Vb:this.g,baseMediaDecodeTime:ue,yb:z},stream:t};break;case"ac3":for(var le=[],ce=0,de=new Uint8Array([]),he=null,pe=l(u.sb()),fe=pe.next();!fe.done;fe=pe.next()){var ge=fe.value,me=ge.data;null==he&&null!==ge.pts&&(he=ge.pts);for(var ve=0;ve<me.length;){var ye=uS(me,ve);ye?(t.audioSamplingRate=ye.sampleRate,t.channelsCount=ye.channelCount,ce=ye.sampleRate,de=ye.Ea,le.push({data:me.subarray(ve,ve+ye.qa),size:ye.qa,duration:1536,rb:0,flags:{wb:0,kb:0,jb:0,hb:0,ib:2,xb:0}}),ve+=ye.qa):ve++}}if(0==ce||0==de.byteLength||null==he)throw new Ne(2,3,3018,n?n.O()[0]:null);var be=he/9e4*ce;p={id:t.id,type:"audio",codecs:"ac-3",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:ce,duration:i,Ab:[],Ea:de,Na:new Uint8Array([]),Wa:0,Xa:0,data:{Vb:this.g,baseMediaDecodeTime:be,yb:le},stream:t};break;case"ec3":for(var we=[],Te=0,xe=new Uint8Array([]),Se=null,Ae=l(u.sb()),ke=Ae.next();!ke.done;ke=Ae.next()){var Ee=ke.value,Ie=Ee.data;null==Se&&null!==Ee.pts&&(Se=Ee.pts);for(var Ce=0;Ce<Ie.length;){var Me=dS(Ie,Ce);Me?(t.audioSamplingRate=Me.sampleRate,t.channelsCount=Me.channelCount,Te=Me.sampleRate,xe=Me.Ea,we.push({data:Ie.subarray(Ce,Ce+Me.qa),size:Me.qa,duration:1536,rb:0,flags:{wb:0,kb:0,jb:0,hb:0,ib:2,xb:0}}),Ce+=Me.qa):Ce++}}if(0==Te||0==xe.byteLength||null==Se)throw new Ne(2,3,3018,n?n.O()[0]:null);var Pe=Se/9e4*Te;p={id:t.id,type:"audio",codecs:"ec-3",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:Te,duration:i,Ab:[],Ea:xe,Na:new Uint8Array([]),Wa:0,Xa:0,data:{Vb:this.g,baseMediaDecodeTime:Pe,yb:we},stream:t};break;case"mp3":for(var Re,Le=[],Oe=null,je=l(u.sb()),Ue=je.next();!Ue.done;Ue=je.next()){var _e=Ue.value,Be=_e.data;if(Be){null==Oe&&null!==_e.pts&&(Oe=_e.pts);for(var Fe=0;Fe<Be.length;){var Ve=fS(Be,Fe);Ve?(Re||(Re=Ve),Fe+Ve.qa<=Be.length&&Le.push({data:Be.subarray(Fe,Fe+Ve.qa),size:Ve.qa,duration:1152,rb:0,flags:{wb:0,kb:0,jb:0,hb:0,ib:2,xb:0}}),Fe+=Ve.qa):Fe++}}}if(!Re||null==Oe)throw new Ne(2,3,3018,n?n.O()[0]:null);var He=Re.sampleRate,Ke=Oe/9e4*He;p={id:t.id,type:"audio",codecs:"mp3",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:He,duration:i,Ab:[],Ea:new Uint8Array([]),Na:new Uint8Array([]),Wa:0,Xa:0,data:{Vb:this.g,baseMediaDecodeTime:Ke,yb:Le},stream:t};break;case"opus":var Ge=[],qe=null,Xe=u.G;if(!Xe)throw new Ne(2,3,3018,n?n.O()[0]:null);var We=[];switch(Xe.jj){case 1:case 2:We=[0];break;case 0:We=[255,1,1,0,1];break;case 128:We=[255,2,0,0,1];break;case 3:We=[1,2,1,0,2,1];break;case 4:We=[1,2,2,0,1,2,3];break;case 5:We=[1,3,2,0,4,1,2,3];break;case 6:We=[1,4,2,0,4,1,2,3,5];break;case 7:We=[1,4,2,0,4,1,2,3,5,6];break;case 8:We=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:We=[1,1,2,0,1];break;case 131:We=[1,1,3,0,1,2];break;case 132:We=[1,1,4,0,1,2,3];break;case 133:We=[1,1,5,0,1,2,3,4];break;case 134:We=[1,1,6,0,1,2,3,4,5];break;case 135:We=[1,1,7,0,1,2,3,4,5,6];break;case 136:We=[1,1,8,0,1,2,3,4,5,6,7]}for(var Ye=new Uint8Array([0,Xe.channelCount,0,0,Xe.sampleRate>>>24&255,Xe.sampleRate>>>17&255,Xe.sampleRate>>>8&255,Xe.sampleRate>>>0&255,0,0].concat(c(We))),Je=Xe.sampleRate,Qe=l(u.sb()),Ze=Qe.next();!Ze.done;Ze=Qe.next()){var et=Ze.value,tt=et.data;null==qe&&null!==et.pts&&(qe=et.pts);for(var it=0;it<tt.length;){for(var rt=!!(16&tt[it+1]),at=!!(8&tt[it+1]),ot=it+2,st=0;255===tt[ot];)st+=255,ot+=1;st+=tt[ot],ot+=1,ot+=rt?2:0,ot+=at?2:0;var ut=tt.slice(ot,ot+st);Ge.push({data:ut,size:ut.byteLength,duration:960,rb:0,flags:{wb:0,kb:0,jb:0,hb:0,ib:2,xb:0}}),it=ot+st}}if(0==Ye.byteLength||null==qe)throw new Ne(2,3,3018,n?n.O()[0]:null);t.audioSamplingRate=Xe.sampleRate,t.channelsCount=Xe.channelCount;var lt=qe/9e4*Je;p={id:t.id,type:"audio",codecs:"opus",encrypted:t.encrypted&&0<t.drmInfos.length,timescale:Je,duration:i,Ab:[],Ea:Ye,Na:new Uint8Array([]),Wa:0,Xa:0,data:{Vb:this.g,baseMediaDecodeTime:lt,yb:Ge},stream:t}}p&&(d.push(p),p=null)}}catch(e){return e&&3023==e.code?Promise.resolve(new Uint8Array([])):Promise.reject(e)}if(!d.length)return Promise.reject(new Ne(2,3,3018,n?n.O()[0]:null));var ct=new uo(d),dt=t.id+"_"+n.i;if(this.j.has(dt))var ht=this.j.get(dt);else ht=lo(ct),this.j.set(dt,ht);var pt=this.l!==ht,ft=go(ct);if(this.l=ht,this.g++,pt){var gt=$e(ht,ft);return Promise.resolve(gt)}return Promise.resolve(ft)},F("shaka.transmuxer.TsTransmuxer",ES),ES.prototype.transmux=ES.prototype.transmux,ES.prototype.getOriginalMimeType=ES.prototype.getOriginalMimeType,ES.prototype.convertCodecs=ES.prototype.convertCodecs,ES.prototype.isSupported=ES.prototype.isSupported,ES.prototype.destroy=ES.prototype.destroy;var IS=["aac","ac-3","ec-3","mp3","opus"],CS=["avc","hevc"];function MS(){}Wn("video/mp2t",(function(){return new ES("video/mp2t")}),Zn),m(MS,jl),F("shaka.util.FairPlayUtils",MS)}.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:()=>K,alarmManager:()=>_,auth:()=>E,deviceManager:()=>B,displayManager:()=>F,envInfo:()=>R,getClientAssertion:()=>O,getConnectReason:()=>z,getPlatformInfo:()=>M,getTriggerEvent:()=>q,init:()=>C,initSequence:()=>S,isRunningE2E:()=>D,lifecycle:()=>j,messageManager:()=>H,platformManager:()=>V,remotePlayer:()=>U,setTimezone:()=>X,shaka:()=>G,showSequence:()=>A,uiReady:()=>P,writeLicenseResponse:()=>L});var e={};n.r(e),n.d(e,{ClientAssertionError:()=>N,ConnectReason:()=>I,ShakaPlayer:()=>K,alarmManager:()=>_,auth:()=>E,deviceManager:()=>B,displayManager:()=>F,envInfo:()=>R,getClientAssertion:()=>O,getConnectReason:()=>z,getPlatformInfo:()=>M,getTriggerEvent:()=>q,init:()=>C,initSequence:()=>S,isRunningE2E:()=>D,lifecycle:()=>j,messageManager:()=>H,platformManager:()=>V,remotePlayer:()=>U,setTimezone:()=>X,shaka:()=>G,showSequence:()=>A,uiReady:()=>P,writeLicenseResponse:()=>L});const t="4.4.6";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}},autoSuspend:{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")}moveToSuspended(){return o("lifecycle.moveToSuspended")}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("get of deviceInfo 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{DisplayConnectionStatus=Object.freeze({CONNECTED:"connected",DISCONNECTED:"disconnected",UNKNOWN:"unknown"});DisplaySelectedStatus=Object.freeze({ACTIVE:"active",INACTIVE:"inactive",UNKNOWN:"unknown"});connection=this.DisplayConnectionStatus.DISCONNECTED;selected;resolution;framerate;security;make;model}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 p extends EventTarget{LoadMode=Object.freeze({NOT_LOADED:"notLoaded",LOADING:"loading",LOADED:"loaded",UNLOADING:"unloading"});AccessibilityPurposeCode={NONE:"",VISUALLY_IMPAIRED:"1",HARD_OF_HEARING:"2",SPOKEN_SUBTITLES:"9"};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 selectAudioLanguage(e,t="",n=this.AccessibilityPurposeCode.NONE){return o("RemotePlayer.selectAudioLanguage",e,t,n)}async selectTextTrack(e){return o("RemotePlayer.selectTextTrack",e)}async selectTextLanguage(e,t="",n=this.AccessibilityPurposeCode.NONE){return o("RemotePlayer.selectTextLanguage",e,t,n)}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 g={...f};class m 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)}}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)})}))}))},x=(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"})}))},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,y.root),document.body.appendChild(e),e})();const n=new Proxy([],{set:(e,i,r)=>(e[i]=r,"length"!==i&&x(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),x(t,n)},A=(e=!0)=>{const t=document.getElementById("sequence-container");t?t.style.visibility=e?"visible":"hidden":a.error("Sequence not initialized")};let k;"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(k)},forceTokenUpdate:function(){if(k=null,window.senzaSDKImplementation)return window.senzaSDKImplementation.auth.forceTokenUpdate();a.error("forceTokenUpdate: window.cefQuery is undefined")},getClientAssertion:O},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 C(){a.log(`init interface ${t}`),window.senzaSDKImplementation?await window.senzaSDKImplementation.init(t,A,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 D(){return!("undefined"==typeof window||!window.senzaSDKImplementation)}function P(){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 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 O(){if(window?.senzaSDKImplementation)return window.senzaSDKImplementation.auth.getClientAssertion();a.warn("getClientAssertion is not supported if NOT running e2e")}let j,U,_,B,F,V,H,K,G;function z(){return j.connectReason}function q(){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}`)}})}}D()?(j=window.senzaSDKImplementation.lifecycle,U=window.senzaSDKImplementation.remotePlayer,_=window.senzaSDKImplementation.alarmManager,B=window.senzaSDKImplementation.deviceManager,F=window.senzaSDKImplementation.displayManager,V=window.senzaSDKImplementation.platformManager,H=window.senzaSDKImplementation.messageManager,K=window.senzaSDKImplementation.ShakaPlayer,G=window.senzaSDKImplementation.shaka):(a.warn("Senza SDK is not running in E2E environment. Some features may not work as expected."),j=new s,U=new p,_=new d,B=new u,F=new l,V=new c,H=new h,K=m,G=g),"undefined"!=typeof window&&(window.hs=e,window.senza=window.senza||e)})(),i})()));