-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path7420.js
More file actions
1 lines (1 loc) · 383 KB
/
7420.js
File metadata and controls
1 lines (1 loc) · 383 KB
1
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7420],{19421:function(e,t,n){"use strict";n.d(t,{cM:function(){return i},vk:function(){return o},j0:function(){return a},Lq:function(){return s},$b:function(){return u},cg:function(){return l},Fz:function(){return c},dJ:function(){return d},KJ:function(){return f},zF:function(){return h},sg:function(){return p},CQ:function(){return g},Wd:function(){return m},iy:function(){return v},ZV:function(){return y},Ri:function(){return b},a8:function(){return w}});var r=n(59894),i=function(){for(var e,t=new Date,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];(e=console).log.apply(e,["vvv:: "+t.toLocaleString()+": "].concat(r))};function o(e,t,n){return n=n||"0",(e+="").length>=t?e:new Array(t-e.length+1).join(n)+e}function a(e){e=Math.floor(e);var t=Math.floor(e/3600),n=e%3600,r=Math.floor(n/60),i=n%60,o=Math.ceil(i);return r<10&&(r="0"+r),o<10&&(o="0"+o),t<=0?r+":"+o:t+":"+r+":"+o}function s(){return r.gn||r.G6?"safari":r.vU?"chrome":r.un?"edge":r.i7?"chrome":r.w1?"edge":"other"}function u(){return r.KC.toLowerCase().replace(" ","")+r.o3}function l(){return r.BF.toLowerCase().replace(" ","")+r.MM}function c(){return r.gn||r.G6?"fps":"cenc"}function d(e){for(var t,n,r,i,o,a,s,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l="",c=0;c<e.length;)i=(t=e[c++])>>2,o=(3&t)<<4|(n=c<e.length?e[c++]:Number.NaN)>>4,a=(15&n)<<2|(r=c<e.length?e[c++]:Number.NaN)>>6,s=63&r,isNaN(n)?a=s=64:isNaN(r)&&(s=64),l+=u.charAt(i)+u.charAt(o)+u.charAt(a)+u.charAt(s);return l}function f(e){i("extractContentId initData",e);var t=function(e){var t=new Uint16Array(e.buffer);return String.fromCharCode.apply(null,t)}(e).split("://",2)[1].split("?",2)[0];return i("extracted contentId: "+t),t}function h(e,t,n){i(n),"string"==typeof t&&(t=function(e){for(var t=new ArrayBuffer(2*e.length),n=new Uint16Array(t),r=0,i=e.length;r<i;r++)n[r]=e.charCodeAt(r);return n}(t));var r=0,o=new ArrayBuffer(e.byteLength+4+t.byteLength+4+n.byteLength),a=new DataView(o);new Uint8Array(o,r,e.byteLength).set(e),r+=e.byteLength,a.setUint32(r,t.byteLength,!0),r+=4;var s=new Uint16Array(o,r,t.length);return s.set(t),r+=s.byteLength,a.setUint32(r,n.byteLength,!0),r+=4,new Uint8Array(o,r,n.byteLength).set(n),new Uint8Array(o,0,o.byteLength)}function p(e){var t=e.target;i("licenseRequestLoaded request",t);var n=t.session,r=t.responseText.trim();"<ckc>"===r.substr(0,5)&&"</ckc>"===r.substr(-6)&&(r=r.slice(5,-6));var o=function(e){for(var t=window.atob(e),n=t.length,r=new Uint8Array(new ArrayBuffer(n)),i=0;i<n;i++)r[i]=t.charCodeAt(i);return r}(r);n.update(o)}function g(e){return e.split("\n").map((function(e){return e.split(/: */,2)})).filter((function(e){return e[0]})).reduce((function(e,t){return e[t[0]]=t[1],e}),{})}function m(e){return new Date(1e3*e).toTimeString().split(" ")[0].substr(0,5)}function v(e,t){if(e){var n=[];"tc"==t?(n.am="\u4e0a\u5348",n.pm="\u4e0b\u5348"):(n.am="am",n.pm="pm");var r=n.am,i=e.split(" ")[1].split(":"),o=i[0]+":";return parseInt(i[0])>12&&(o=parseInt(i[0])-12+":",parseInt(i[0])-12<10&&(o="0"+o),r=n.pm),12==parseInt(i[0])&&(r=n.pm),""!=o&&(o+=i[1],"tc"==t?o=r+o:o+=r),o}}function y(e,t){var n=(e=new Date(1e3*e)).getHours();"tmr"===t?e.setDate(e.getDate()+1):("ytd"===t||"today"===t&&n<6)&&e.setDate(e.getDate()-1);var r=e.getDate(),i=e.getMonth()+1,o=e.getFullYear();return r=r<10?"0"+r:r.toString(),o+"-"+(i=i<10?"0"+i:i.toString())+"-"+r}function b(e){var t=e.match(/(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)/);return new Date(t[1],parseInt(t[2],10)-1,t[3],t[4],t[5],t[6]).getTime()/1e3}function w(e,t){var n;return n=t?{Accept:"application/json",Authorization:"Bearer "+t}:{Accept:"application/json"},fetch(e,{method:"GET",headers:n}).then((function(e){return e.json()})).then((function(e){if(e)return e})).catch((function(e){i(":: fetchApi error",e)}))}},23415:function(e,t){!function(){var e=window,n={};for(var r in function(e,t,n){var i;function o(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};var s=function(n){n=["object"==typeof globalThis&&globalThis,n,e,"object"==typeof self&&self,"object"==typeof t&&t];for(var r=0;r<n.length;++r){var i=n[r];if(i&&i.Math==Math)return i}throw Error("Cannot find global object")}(this);function u(e,t){if(t)e:{for(var n=s,r=e.split("."),i=0;i<r.length-1;i++){var o=r[i];if(!(o in n))break e;n=n[o]}(o=t(i=n[r=r[r.length-1]]))!=i&&null!=o&&a(n,r,{configurable:!0,writable:!0,value:o})}}function l(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function c(e){var t="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:o(e)}}function d(e){if(!(e instanceof Array)){e=c(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}u("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)+"_",r=0;return function e(i){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(i||"")+"_"+r++,i)}})),u("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 r=s[t[n]];"function"===typeof r&&"function"!=typeof r.prototype[e]&&a(r.prototype,e,{configurable:!0,writable:!0,value:function(){return l(o(this))}})}return e}));var f,h="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)f=Object.setPrototypeOf;else{var p;e:{var g={};try{g.__proto__={a:!0},p=g.a;break e}catch(hm){}p=!1}f=p?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var m=f;function v(e,t){if(e.prototype=h(t.prototype),e.prototype.constructor=e,m)m(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.Fg=t.prototype}function y(){this.s=!1,this.l=null,this.h=void 0,this.g=1,this.j=this.m=0,this.D=this.i=null}function b(e){if(e.s)throw new TypeError("Generator is already running");e.s=!0}function w(e,t){e.i={$d:t,fe:!0},e.g=e.m||e.j}function T(e,t,n){return e.g=n,{value:t}}function x(e){e.g=0}function S(e,t,n){e.m=t,void 0!=n&&(e.j=n)}function E(e){e.m=0,e.j=2}function A(e,t){e.g=t,e.m=0}function k(e){e.m=0;var t=e.i.$d;return e.i=null,t}function I(e){e.D=[e.i],e.m=0,e.j=0}function C(e,t){var n=e.D.splice(0)[0];(n=e.i=e.i||n)?n.fe?e.g=e.m||e.j:void 0!=n.v&&e.j<n.v?(e.g=n.v,e.i=null):e.g=e.j:e.g=t}function M(e){this.g=new y,this.h=e}function D(e,t,n,r){try{var i=t.call(e.g.l,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.s=!1,i;var o=i.value}catch(a){return e.g.l=null,w(e.g,a),R(e)}return e.g.l=null,r.call(e.g,o),R(e)}function R(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.s=!1,{value:t.value,done:!1}}catch(n){e.g.h=void 0,w(e.g,n)}if(e.g.s=!1,e.g.i){if(t=e.g.i,e.g.i=null,t.fe)throw t.$d;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function N(e){this.next=function(t){return b(e.g),e.g.l?t=D(e,e.g.l.next,t,e.g.u):(e.g.u(t),t=R(e)),t},this.throw=function(t){return b(e.g),e.g.l?t=D(e,e.g.l.throw,t,e.g.u):(w(e.g,t),t=R(e)),t},this.return=function(t){return function(e,t){b(e.g);var n=e.g.l;return n?D(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),R(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function P(e,t){var n=new N(new M(t));return m&&e.prototype&&m(n,e.prototype),n}function L(e){return function(e){function t(t){return e.next(t)}function n(t){return e.throw(t)}return new Promise((function(r,i){!function e(o){o.done?r(o.value):Promise.resolve(o.value).then(t,n).then(e,i)}(e.next())}))}(new N(new M(e)))}function j(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _(e,t,n){e instanceof String&&(e=String(e));for(var r=e.length,i=0;i<r;i++){var o=e[i];if(t.call(n,o,i,e))return{ha:i,ze:o}}return{ha:-1,ze:void 0}}function O(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){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}y.prototype.u=function(e){this.h=e},y.prototype.return=function(e){this.i={return:e},this.g=this.j},y.prototype.v=function(e){this.g=e},u("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.s=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(r){t.reject(r)}}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 o=s.setTimeout;n.prototype.i=function(e){o(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(r){this.j(r)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.J),reject:e(this.l)}},t.prototype.J=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.N(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.H(e):this.m(e)}},t.prototype.H=function(e){var t=void 0;try{t=e.then}catch(r){return void this.l(r)}"function"==typeof t?this.S(t,e):this.m(e)},t.prototype.l=function(e){this.u(2,e)},t.prototype.m=function(e){this.u(1,e)},t.prototype.u=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.L(),this.D()},t.prototype.L=function(){var e=this;o((function(){if(e.F()){var t=s.console;"undefined"!==typeof t&&t.error(e.i)}}),1)},t.prototype.F=function(){if(this.s)return!1;var e=s.CustomEvent,t=s.Event,n=s.dispatchEvent;return"undefined"===typeof n||("function"===typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"===typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=s.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.D=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.N=function(e){var t=this.j();e.uc(t.resolve,t.reject)},t.prototype.S=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(r){n.reject(r)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(n){o(n)}}:t}var i,o,a=new t((function(e,t){i=e,o=t}));return this.uc(r(e,i),r(n,o)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.uc=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?a.h(n):this.g.push(n),this.s=!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=c(e),o=r.next();!o.done;o=r.next())i(o.value).uc(t,n)}))},t.all=function(e){var n=c(e),r=n.next();return r.done?i([]):new t((function(e,t){function o(t){return function(n){a[t]=n,0==--s&&e(a)}}var a=[],s=0;do{a.push(void 0),s++,i(r.value).uc(o(a.length-1),t),r=n.next()}while(!r.done)}))},t})),u("WeakMap",(function(e){function t(e){if(this.g=(u+=Math.random()+1).toString(),e){e=c(e);for(var t;!(t=e.next()).done;)t=t.value,this.set(t[0],t[1])}}function n(){}function r(e){var t=typeof e;return"object"===t&&null!==e||"function"===t}function i(e){if(!j(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)&&i(e),t(e))})}if(function(){if(!e||!Object.seal)return!1;try{var t=Object.seal({}),n=Object.seal({}),r=new e([[t,2],[n,3]]);return 2==r.get(t)&&3==r.get(n)&&(r.delete(t),r.set(n,4),!r.has(t)&&4==r.get(n))}catch(i){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(!r(e))throw Error("Invalid WeakMap key");if(i(e),!j(e,s))throw Error("WeakMap key fail: "+e);return e[s][this.g]=t,this},t.prototype.get=function(e){return r(e)&&j(e,s)?e[s][this.g]:void 0},t.prototype.has=function(e){return r(e)&&j(e,s)&&j(e[s],this.g)},t.prototype.delete=function(e){return!!(r(e)&&j(e,s)&&j(e[s],this.g))&&delete e[s][this.g]},t})),u("Map",(function(e){function t(){var e={};return e.Sa=e.next=e.head=e}function n(e,t){var n=e.g;return l((function(){if(n){for(;n.head!=e.g;)n=n.Sa;for(;n.next!=n.head;)return n=n.next,{done:!1,value:t(n)};n=null}return{done:!0,value:void 0}}))}function r(e,t){var n=t&&typeof t;"object"==n||"function"==n?o.has(t)?n=o.get(t):(n=""+ ++a,o.set(t,n)):n="p_"+t;var r=e.h[n];if(r&&j(e.h,n))for(var i=0;i<r.length;i++){var s=r[i];if(t!==t&&s.key!==s.key||t===s.key)return{id:n,list:r,index:i,ga:s}}return{id:n,list:r,index:-1,ga:void 0}}function i(e){if(this.h={},this.g=t(),this.size=0,e){e=c(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(c([[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 r=n.entries(),i=r.next();return!i.done&&i.value[0]==t&&"s"==i.value[1]&&!((i=r.next()).done||4!=i.value[0].x||"t"!=i.value[1]||!r.next().done)}catch(o){return!1}}())return e;var o=new WeakMap;i.prototype.set=function(e,t){var n=r(this,e=0===e?0:e);return n.list||(n.list=this.h[n.id]=[]),n.ga?n.ga.value=t:(n.ga={next:this.g,Sa:this.g.Sa,head:this.g,key:e,value:t},n.list.push(n.ga),this.g.Sa.next=n.ga,this.g.Sa=n.ga,this.size++),this},i.prototype.delete=function(e){return!(!(e=r(this,e)).ga||!e.list)&&(e.list.splice(e.index,1),e.list.length||delete this.h[e.id],e.ga.Sa.next=e.ga.next,e.ga.next.Sa=e.ga.Sa,e.ga.head=null,this.size--,!0)},i.prototype.clear=function(){this.h={},this.g=this.g.Sa=t(),this.size=0},i.prototype.has=function(e){return!!r(this,e).ga},i.prototype.get=function(e){return(e=r(this,e).ga)&&e.value},i.prototype.entries=function(){return n(this,(function(e){return[e.key,e.value]}))},i.prototype.keys=function(){return n(this,(function(e){return e.key}))},i.prototype.values=function(){return n(this,(function(e){return e.value}))},i.prototype.forEach=function(e,t){for(var n,r=this.entries();!(n=r.next()).done;)n=n.value,e.call(t,n[1],n[0],this)},i.prototype[Symbol.iterator]=i.prototype.entries;var a=0;return i})),u("Set",(function(e){function t(e){if(this.g=new Map,e){e=c(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(c([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 r=n.entries(),i=r.next();return!i.done&&i.value[0]==t&&i.value[1]==t&&(!(i=r.next()).done&&i.value[0]!=t&&4==i.value[0].x&&i.value[1]==i.value[0]&&r.next().done)}catch(o){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(r){return e.call(t,r,r,n)}))},t)})),u("Array.prototype.findIndex",(function(e){return e||function(e,t){return _(this,e,t).ha}})),u("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t}})),u("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length,i=t||0;for(0>i&&(i=Math.max(i+r,0));i<r;i++){var o=n[i];if(o===e||Object.is(o,e))return!0}return!1}})),u("String.prototype.includes",(function(e){return e||function(e,t){return-1!==O(this,e,"includes").indexOf(e,t||0)}})),u("Array.prototype.find",(function(e){return e||function(e,t){return _(this,e,t).ze}})),u("String.prototype.startsWith",(function(e){return e||function(e,t){for(var n=O(this,e,"startsWith"),r=n.length,i=e.length,o=Math.max(0,Math.min(0|t,n.length)),a=0;a<i&&o<r;)if(n[o++]!=e[a++])return!1;return a>=i}})),u("Array.prototype.keys",(function(e){return e||function(){return U(this,(function(e){return e}))}}));var F="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)j(r,i)&&(e[i]=r[i])}return e};u("Object.assign",(function(e){return e||F})),u("Array.from",(function(e){return e||function(e,t,n){t=null!=t?t:function(e){return e};var r=[],i="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];if("function"==typeof i){e=i.call(e);for(var o=0;!(i=e.next()).done;)r.push(t.call(n,i.value,o++))}else for(i=e.length,o=0;o<i;o++)r.push(t.call(n,e[o],o));return r}})),u("Array.prototype.values",(function(e){return e||function(){return U(this,(function(e,t){return t}))}})),u("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}))}))}})),u("Array.prototype.entries",(function(e){return e||function(){return U(this,(function(e,t){return[e,t]}))}})),u("String.prototype.repeat",(function(e){return e||function(e){var t=O(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}})),u("Object.values",(function(e){return e||function(e){var t,n=[];for(t in e)j(e,t)&&n.push(e[t]);return n}})),u("Math.log2",(function(e){return e||function(e){return Math.log(e)/Math.LN2}})),u("Object.entries",(function(e){return e||function(e){var t,n=[];for(t in e)j(e,t)&&n.push([t,e[t]]);return n}}));var B=this||self;function V(e,t){var n,r=e.split("."),i=B;r[0]in i||"undefined"==typeof i.execScript||i.execScript("var "+r[0]);for(;r.length&&(n=r.shift());)r.length||void 0===t?i=i[n]&&i[n]!==Object.prototype[n]?i[n]:i[n]={}:i[n]=t}function H(e){this.i=Math.exp(Math.log(.5)/e),this.h=this.g=0}function K(e,t,n){var r=Math.pow(e.i,t);n=n*(1-r)+r*e.g,isNaN(n)||(e.g=n,e.h+=t)}function G(e){return e.g/(1-Math.pow(e.i,e.h))}function q(){this.h=new H(2),this.i=new H(5),this.g=0}function z(){}function X(){}function W(){}function Y(e,t){for(var n=[],r=1;r<arguments.length;++r)n[r-1]=arguments[r];J.has(e)||(J.add(e),W.apply(z,d(n)))}function $(){}q.prototype.getBandwidthEstimate=function(e){return 128e3>this.g?e:Math.min(G(this.h),G(this.i))};var J=new Set;if(e.console&&e.console.log.bind){var Q={},Z=(Q[1]=console.error.bind(console),Q[2]=console.warn.bind(console),Q[3]=console.info.bind(console),Q[4]=console.log.bind(console),Q[5]=console.debug.bind(console),Q[6]=console.debug.bind(console),Q);W=Z[2],X=Z[1]}function ee(e,t){for(var n=[],r=c(e),i=r.next();!i.done;i=r.next())n.push(t(i.value));return n}var te=function e(t){var n;return P(e,(function(e){return 1==e.g&&(n=0),3!=e.g?n<t?T(e,n,3):e.v(0):(n++,e.v(2))}))},ne=function e(t){var n,r,i,o,a,s;return P(e,(function(e){return 1==e.g&&(n=-1,i=r=void 0,o=c(t),a=o.next()),5!=e.g?a.done?-1==n?e.v(0):T(e,{ha:n,Ef:r,item:i,next:void 0},0):(s=a.value,0<=n?T(e,{ha:n,item:i,Ef:r,next:s},5):e.v(5)):(n++,r=i,i=s,a=o.next(),e.v(2))}))};function re(e,t){return!("number"!==typeof e||"number"!==typeof t||!isNaN(e)||!isNaN(t))||e===t}function ie(e,t){var n=e.indexOf(t);-1<n&&e.splice(n,1)}function oe(e,t,n){if(n||(n=re),e.length!=t.length)return!1;t=t.slice();for(var r={},i=(e=c(e)).next();!i.done;r={Tc:r.Tc},i=e.next()){if(r.Tc=i.value,-1==(i=t.findIndex(function(e){return function(t){return n(e.Tc,t)}}(r))))return!1;t[i]=t[t.length-1],t.pop()}return 0==t.length}function ae(e,t,n){if(n||(n=re),e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function se(e,t,n){this.startTime=e,this.direction=pe,this.endTime=t,this.payload=n,this.region=new Ee,this.position=null,this.positionAlign=le,this.size=0,this.textAlign=ce,this.writingMode=ge,this.lineInterpretation=me,this.line=null,this.lineHeight="",this.lineAlign=ve,this.displayAlign=fe,this.fontSize=this.border=this.backgroundImage=this.backgroundColor=this.color="",this.fontWeight=Te,this.fontStyle=xe,this.linePadding=this.letterSpacing=this.fontFamily="",this.opacity=1,this.textDecoration=[],this.wrapLine=!0,this.id="",this.nestedCues=[],this.spacer=this.lineBreak=!1,this.cellResolution={columns:32,rows:15}}function ue(e,t){if(e.startTime!=t.startTime||e.endTime!=t.endTime||e.payload!=t.payload)return!1;for(var n in e)if("startTime"!=n&&"endTime"!=n&&"payload"!=n)if("nestedCues"==n){if(!ae(e.nestedCues,t.nestedCues,ue))return!1}else if("region"==n||"cellResolution"==n){for(var r in e[n])if(e[n][r]!=t[n][r])return!1}else if(Array.isArray(e[n])){if(!ae(e[n],t[n]))return!1}else if(e[n]!=t[n])return!1;return!0}se.prototype.clone=function(){var e,t=new se(0,0,"");for(e in this)t[e]=this[e],t[e]&&t[e].constructor==Array&&(t[e]=t[e].slice());return t},V("shaka.text.Cue",se);var le="auto";se.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:le};var ce="center",de={LEFT:"left",RIGHT:"right",CENTER:ce,START:"start",END:"end"};se.textAlign=de;var fe="after",he={BEFORE:"before",CENTER:"center",AFTER:fe};se.displayAlign=he;var pe="ltr";se.direction={HORIZONTAL_LEFT_TO_RIGHT:pe,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var ge="horizontal-tb";se.writingMode={HORIZONTAL_TOP_TO_BOTTOM:ge,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};var me=0;se.lineInterpretation={LINE_NUMBER:me,PERCENTAGE:1};var ve="start",ye={CENTER:"center",START:ve,END:"end"};se.lineAlign=ye;var be={white:"#FFF",lime:"#0F0",cyan:"#0FF",red:"#F00",yellow:"#FF0",magenta:"#F0F",blue:"#00F",black:"#000"};se.defaultTextColor=be;var we={bg_white:"#FFF",bg_lime:"#0F0",bg_cyan:"#0FF",bg_red:"#F00",bg_yellow:"#FF0",bg_magenta:"#F0F",bg_blue:"#00F",bg_black:"#000"};se.defaultTextBackgroundColor=we;var Te=400;se.fontWeight={NORMAL:Te,BOLD:700};var xe="normal",Se={NORMAL:xe,ITALIC:"italic",OBLIQUE:"oblique"};function Ee(){this.id="",this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0,this.height=this.width=100,this.viewportAnchorUnits=this.widthUnits=this.heightUnits=Ae,this.scroll=ke}se.fontStyle=Se,se.textDecoration={UNDERLINE:"underline",LINE_THROUGH:"lineThrough",OVERLINE:"overline"},V("shaka.text.CueRegion",Ee);var Ae=1;Ee.units={PX:0,PERCENTAGE:Ae,LINES:2};var ke="";function Ie(){}function Ce(e,t){if(!e&&!t)return!0;if(!e||!t||e.byteLength!=t.byteLength)return!1;if(Me(e)==Me(t)&&(e.byteOffset||0)==(t.byteOffset||0))return!0;for(var n=Re(e),r=Re(t),i=c(te(e.byteLength)),o=i.next();!o.done;o=i.next())if(n[o=o.value]!=r[o])return!1;return!0}function Me(e){return e instanceof ArrayBuffer?e:e.buffer}function De(e){return e instanceof ArrayBuffer?e:0==e.byteOffset&&e.byteLength==e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer}function Re(e,t,n){return Pe(e,void 0===t?0:t,n=void 0===n?1/0:n,Uint8Array)}function Ne(e,t,n){return Pe(e,void 0===t?0:t,n=void 0===n?1/0:n,DataView)}function Pe(e,t,n,r){var i=(e.byteOffset||0)+e.byteLength;return t=Math.max(0,Math.min((e.byteOffset||0)+t,i)),new r(Me(e),t,Math.min(t+Math.max(n,0),i)-t)}function Le(e,t){this.g=e,this.h=t}function je(e,t){var n=new Le(4,0),r=Ue,i=r.g,o=n.h-i.h;(0<(n.g-i.g||o)?r.i:r.h)(r.g,n,e,t)}function _e(e,t,n,r){W([n,"has been deprecated and will be removed in",t,". We are currently at version",e,". Additional information:",r].join(" "))}function Oe(e,t,n,r){X([n,"has been deprecated and has been removed in",t,". We are now at version",e,". Additional information:",r].join(""))}Ee.scrollMode={NONE:ke,UP:"up"},V("shaka.util.BufferUtils",Ie),Ie.toDataView=Ne,Ie.toUint8=Re,Ie.toArrayBuffer=De,Ie.equal=Ce,Le.prototype.toString=function(){return"v"+this.g+"."+this.h};var Ue=null;function Fe(e,t){return e.concat(t)}function Be(){}function Ve(e){return null!=e}function He(e){var t=Object.create(e.prototype||Object.prototype);try{var n=e.call(t);n||(je("Factories requiring new","Factories should be plain functions"),n=t)}catch(r){je("Factories requiring new","Factories should be plain functions"),n=new e}return n}function Ke(){}V("shaka.dependencies",Ke),Ke.has=function(e){return qe.has(e)},Ke.add=function(e,t){if(!Ge[e])throw Error(e+" is not supported");qe.set(e,(function(){return t}))};var Ge={muxjs:"muxjs"};Ke.Allowed=Ge;var qe=new Map([["muxjs",function(){return e.muxjs}]]);function ze(e,t,n,r){for(var i=[],o=3;o<arguments.length;++o)i[o-3]=arguments[o];this.severity=e,this.category=t,this.code=n,this.data=i,this.handled=!1}ze.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")},V("shaka.util.Error",ze),ze.Severity={RECOVERABLE:1,CRITICAL:2},ze.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9,ADS:10},ze.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,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,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,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_MASTER_PLAYLIST_NOT_PROVIDED:4022,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,HLS_COULD_NOT_PARSE_SEGMENT_START_TIME:4030,CONTENT_UNSUPPORTED_BY_BROWSER:4032,CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM:4033,HLS_AES_128_ENCRYPTION_NOT_SUPPORTED:4034,HLS_INTERNAL_SKIP_STREAM:4035,NO_VARIANTS:4036,PERIOD_FLATTENING_FAILED:4037,INCONSISTENT_DRM_ACROSS_PERIODS:4038,HLS_VARIABLE_NOT_FOUND:4039,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,LOAD_INTERRUPTED:7e3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,OBJECT_DESTROYED:7003,CONTENT_NOT_LOADED:7004,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,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};var Xe=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;function We(e){var t;e instanceof We?(Ye(this,e.Ea),this.pb=e.pb,this.Ga=e.Ga,$e(this,e.Db),this.ya=e.ya,Je(this,e.g.clone()),this.fb=e.fb):e&&(t=String(e).match(Xe))?(Ye(this,t[1]||"",!0),this.pb=Qe(t[2]||""),this.Ga=Qe(t[3]||"",!0),$e(this,t[4]),this.ya=Qe(t[5]||"",!0),Je(this,t[6]||"",!0),this.fb=Qe(t[7]||"")):this.g=new at(null)}function Ye(e,t,n){e.Ea=n?Qe(t,!0):t,e.Ea&&(e.Ea=e.Ea.replace(/:$/,""))}function $e(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.Db=t}else e.Db=null}function Je(e,t,n){t instanceof at?e.g=t:(n||(t=Ze(t,it)),e.g=new at(t))}function Qe(e,t){return e?t?decodeURI(e):decodeURIComponent(e):""}function Ze(e,t,n){return null!=e?(e=encodeURI(e).replace(t,et),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function et(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}(i=We.prototype).Ea="",i.pb="",i.Ga="",i.Db=null,i.ya="",i.fb="",i.toString=function(){var e=[],t=this.Ea;if(t&&e.push(Ze(t,tt,!0),":"),t=this.Ga){e.push("//");var n=this.pb;n&&e.push(Ze(n,tt,!0),"@"),e.push(encodeURIComponent(t).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(t=this.Db)&&e.push(":",String(t))}return(t=this.ya)&&(this.Ga&&"/"!=t.charAt(0)&&e.push("/"),e.push(Ze(t,"/"==t.charAt(0)?rt:nt,!0))),(t=this.g.toString())&&e.push("?",t),(t=this.fb)&&e.push("#",Ze(t,ot)),e.join("")},i.resolve=function(e){var t=this.clone();"data"===t.Ea&&(t=new We);var n=!!e.Ea;n?Ye(t,e.Ea):n=!!e.pb,n?t.pb=e.pb:n=!!e.Ga,n?t.Ga=e.Ga:n=null!=e.Db;var r=e.ya;if(n)$e(t,e.Db);else if(n=!!e.ya){if("/"!=r.charAt(0))if(this.Ga&&!this.ya)r="/"+r;else{var i=t.ya.lastIndexOf("/");-1!=i&&(r=t.ya.substr(0,i+1)+r)}if(".."==r||"."==r)r="";else if(-1!=r.indexOf("./")||-1!=r.indexOf("/.")){i=0==r.lastIndexOf("/",0),r=r.split("/");for(var o=[],a=0;a<r.length;){var s=r[a++];"."==s?i&&a==r.length&&o.push(""):".."==s?((1<o.length||1==o.length&&""!=o[0])&&o.pop(),i&&a==r.length&&o.push("")):(o.push(s),i=!0)}r=o.join("/")}}return n?t.ya=r:n=""!==e.g.toString(),n?Je(t,e.g.clone()):n=!!e.fb,n&&(t.fb=e.fb),t},i.clone=function(){return new We(this)};var tt=/[#\/\?@]/g,nt=/[#\?:]/g,rt=/[#\?]/g,it=/[#\?@]/g,ot=/#/g;function at(e){this.g=e||null}function st(e,t){if(0==t.length)return e;var n=t.map((function(e){return new We(e)}));return e.map((function(e){return new We(e)})).map((function(e){return n.map((function(t){return e.resolve(t)}))})).reduce(Fe,[]).map((function(e){return e.toString()}))}function ut(e,t){return{keySystem:e,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:t||[],keyIds:new Set}}function lt(e,t){if(1==t.length)return t[0];var n=ct(e,t);if(null!=n)return n;throw new ze(2,4,4025,t)}function ct(e,t){for(var n=c(ht[e]),r=n.next();!r.done;r=n.next()){r=r.value;for(var i=c(t),o=i.next();!o.done;o=i.next())if(o=o.value,r.test(o.trim()))return o.trim()}return e==dt?"":null}(i=at.prototype).va=null,i.wc=null,i.add=function(e,t){if(!this.va&&(this.va={},this.wc=0,this.g))for(var n=this.g.split("&"),r=0;r<n.length;r++){var i=n[r].indexOf("="),o=null;if(0<=i){var a=n[r].substring(0,i);o=n[r].substring(i+1)}else a=n[r];a=decodeURIComponent(a.replace(/\+/g," ")),o=o||"",this.add(a,decodeURIComponent(o.replace(/\+/g," ")))}return this.g=null,(n=this.va.hasOwnProperty(e)&&this.va[e])||(this.va[e]=n=[]),n.push(t),this.wc++,this},i.toString=function(){if(this.g)return this.g;if(!this.va)return"";var e,t=[];for(e in this.va)for(var n=encodeURIComponent(e),r=this.va[e],i=0;i<r.length;i++){var o=n;""!==r[i]&&(o+="="+encodeURIComponent(r[i])),t.push(o)}return this.g=t.join("&")},i.clone=function(){var e=new at;if(e.g=this.g,this.va){var t,n={};for(t in this.va)n[t]=this.va[t].concat();e.va=n,e.wc=this.wc}return e};var dt="text",ft={Na:"video",bb:"audio",aa:dt,Mb:"image",ag:"application"},ht={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av1$/],text:[/^vtt$/,/^wvtt/,/^stpp/]};function pt(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function gt(e){this.h=e,this.g=void 0}function mt(){}function vt(e){return e?(239==(e=Re(e))[0]&&187==e[1]&&191==e[2]&&(e=e.subarray(3)),(e=(new TextDecoder).decode(e)).includes("\ufffd")&&X('Decoded string contains an "unknown character" codepoint. That probably means the UTF8 encoding was incorrect!'),e):""}function yt(e,t,n){if(!e)return"";if(!n&&0!=e.byteLength%2)throw new ze(2,2,2004);var r=Math.floor(e.byteLength/2);n=new Uint16Array(r),e=Ne(e);for(var i=(r=c(te(r))).next();!i.done;i=r.next())n[i=i.value]=e.getUint16(2*i,t);return xt.value()(n)}function bt(e){function t(e){return n.byteLength<=e||32<=n[e]&&126>=n[e]}if(!e)return"";var n=Re(e);if(239==n[0]&&187==n[1]&&191==n[2])return vt(n);if(254==n[0]&&255==n[1])return yt(n.subarray(2),!1);if(255==n[0]&&254==n[1])return yt(n.subarray(2),!0);if(0==n[0]&&0==n[2])return yt(e,!1);if(0==n[1]&&0==n[3])return yt(e,!0);if(t(0)&&t(1)&&t(2)&&t(3))return vt(e);throw new ze(2,2,2003)}function wt(e){return De((new TextEncoder).encode(e))}function Tt(e,t){for(var n=new ArrayBuffer(2*e.length),r=new DataView(n),i=c(ne(e)),o=i.next();!o.done;o=i.next())o=o.value,r.setUint16(2*o.ha,o.item.charCodeAt(0),t);return n}pt.prototype.resolve=function(){},pt.prototype.reject=function(){},gt.prototype.value=function(){return void 0==this.g&&(this.g=this.h()),this.g},V("shaka.util.StringUtils",mt),mt.resetFromCharCode=function(){xt.g=void 0},mt.toUTF16=Tt,mt.toUTF8=wt,mt.fromBytesAutoDetect=bt,mt.fromUTF16=yt,mt.fromUTF8=vt;var xt=new gt((function(){function e(e){try{var t=new Uint8Array(e);return 0<String.fromCharCode.apply(null,t).length}catch(n){return!1}}for(var t={Ua:65536};0<t.Ua;(t={Ua:t.Ua}).Ua/=2)if(e(t.Ua))return function(e){return function(t){for(var n="",r=0;r<t.length;r+=e.Ua)n+=String.fromCharCode.apply(null,t.subarray(r,r+e.Ua));return n}}(t);return null}));function St(){}function Et(e){return e=Re(e),e=xt.value()(e),btoa(e)}function At(e,t){t=void 0==t||t;var n=Et(e).replace(/\+/g,"-").replace(/\//g,"_");return t?n:n.replace(/[=]*$/,"")}function kt(t){var n=e.atob(t.replace(/-/g,"+").replace(/_/g,"/"));t=new Uint8Array(n.length);for(var r=(n=c(ne(n))).next();!r.done;r=n.next())t[(r=r.value).ha]=r.item.charCodeAt(0);return t}function It(t){for(var n=t.length/2,r=new Uint8Array(n),i=(n=c(te(n))).next();!i.done;i=n.next())r[i=i.value]=e.parseInt(t.substr(2*i,2),16);return r}function Ct(e){var t=Re(e);e="";for(var n=(t=c(t)).next();!n.done;n=t.next())1==(n=(n=n.value).toString(16)).length&&(n="0"+n),e+=n;return e}function Mt(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];var r=0,i=c(t);for(n=i.next();!n.done;n=i.next())r+=n.value.byteLength;for(r=new Uint8Array(r),i=0,n=(t=c(t)).next();!n.done;n=t.next())n=n.value,r.set(Re(n),i),i+=n.byteLength;return r}function Dt(){var e=this;this.s=qe.get("muxjs")(),this.g=new this.s.mp4.Transmuxer({keepOriginalTimestamps:!0}),this.h=null,this.m=[],this.j=[],this.i=[],this.l=!1,this.g.on("data",(function(t){e.j=t.captions,e.i=t.metadata,e.m.push(Mt(t.initSegment,t.data))})),this.g.on("done",(function(){var t={data:Mt.apply(St,d(e.m)),captions:e.j,metadata:e.i};e.h.resolve(t),e.l=!1}))}function Rt(e,t){if(!qe.get("muxjs")()||!Nt(e))return!1;if(t)return MediaSource.isTypeSupported(Pt(t,e));var n=Pt("audio",e),r=Pt("video",e);return MediaSource.isTypeSupported(n)||MediaSource.isTypeSupported(r)}function Nt(e){return"mp2t"==e.toLowerCase().split(";")[0].split("/")[1]}function Pt(e,t){var n=t.replace(/mp2t/i,"mp4");"audio"==e&&(n=n.replace("video","audio"));var r=/avc1\.(66|77|100)\.(\d+)/.exec(n);if(r){var i="avc1.",o=r[1],a=Number(r[2]);i=("66"==o?i+"4200":"77"==o?i+"4d00":i+"6400")+(a>>4).toString(16),i+=(15&a).toString(16),n=n.replace(r[0],i)}return n}function Lt(e,t){var n=e;return t&&(n+='; codecs="'+t+'"'),n}function jt(e,t,n){return e=Lt(e,t),qe.get("muxjs")()&&Nt(e)?Pt(n,e):e}function _t(e){var t=(e=e.split("."))[0];return e.pop(),t}function Ot(e){return(e=e.split(/ *; */)).shift(),(e=e.find((function(e){return e.startsWith("codecs=")})))?e.split("=")[1].replace(/^"|"$/g,""):""}function Ut(e){this.s=null,this.i=e,this.j=this.D=0,this.l=1/0,this.h=this.g=null,this.u="",this.m=new Map}function Ft(e){return!(!Ht[e]&&"application/cea-608"!=e&&"application/cea-708"!=e)}function Bt(e,t,n){if(e.u=t,t=e.m.get(t))for(var r=c(t.keys()),i=r.next();!i.done;i=r.next())(i=t.get(i.value).filter((function(e){return e.endTime<=n})))&&e.i.append(i)}function Vt(e,t,n,r,i){for(var o=n+" "+r,a=new Map,s=(t=c(t)).next();!s.done;s=t.next()){var u=s.value;s=u.stream,u=u.cue,a.has(s)||a.set(s,new Map),a.get(s).has(o)||a.get(s).set(o,[]),u.startTime+=i,u.endTime+=i,u.startTime>=e.j&&u.startTime<e.l&&(a.get(s).get(o).push(u),s==e.u&&e.i.append([u]))}for(o=(i=c(a.keys())).next();!o.done;o=i.next())for(o=o.value,e.m.has(o)||e.m.set(o,new Map),s=(t=c(a.get(o).keys())).next();!s.done;s=t.next())s=s.value,u=a.get(o).get(s),e.m.get(o).set(s,u);e.g=null==e.g?Math.max(n,e.j):Math.min(e.g,Math.max(n,e.j)),e.h=Math.max(e.h,Math.min(r,e.l))}V("shaka.util.Uint8ArrayUtils",St),St.concat=Mt,St.toHex=Ct,St.fromHex=It,St.fromBase64=kt,St.toBase64=At,St.toStandardBase64=Et,St.equal=function(e,t){return je("shaka.util.Uint8ArrayUtils.equal","Please use shaka.util.BufferUtils.equal instead."),Ce(e,t)},Dt.prototype.destroy=function(){return this.g.dispose(),this.g=null,Promise.resolve()},(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels"),Ut.prototype.destroy=function(){return this.i=this.s=null,this.m.clear(),Promise.resolve()},Ut.prototype.remove=function(e,t){var n=this;return L((function(r){if(1==r.g)return T(r,Promise.resolve(),2);!n.i||!n.i.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)),x(r)}))},V("shaka.text.TextEngine",Ut),Ut.prototype.destroy=Ut.prototype.destroy,Ut.findParser=function(e){return Ht[e]},Ut.unregisterParser=function(e){delete Ht[e]},Ut.registerParser=function(e,t){Ht[e]=t};var Ht={};function Kt(e,t){return e=zt(e),t=zt(t),e.split("-")[0]==t.split("-")[0]}function Gt(e,t){e=zt(e),t=zt(t);var n=e.split("-"),r=t.split("-");return n[0]==r[0]&&1==n.length&&2==r.length}function qt(e,t){e=zt(e),t=zt(t);var n=e.split("-"),r=t.split("-");return 2==n.length&&2==r.length&&n[0]==r[0]}function zt(e){var t=e.split("-");return e=t[0]||"",t=t[1]||"",e=e.toLowerCase(),e=$t.get(e)||e,(t=t.toUpperCase())?e+"-"+t:e}function Xt(e,t){return e=zt(e),(t=zt(t))==e?4:Gt(t,e)?3:qt(t,e)?2:Gt(e,t)?1:0}function Wt(e){return e.language?zt(e.language):e.audio&&e.audio.language?zt(e.audio.language):e.video&&e.video.language?zt(e.video.language):"und"}function Yt(e,t){for(var n=zt(e),r=new Set,i=c(t),o=i.next();!o.done;o=i.next())r.add(zt(o.value));for(o=(i=c(r)).next();!o.done;o=i.next())if((o=o.value)==n)return o;for(o=(i=c(r)).next();!o.done;o=i.next())if(Gt(o=o.value,n))return o;for(o=(i=c(r)).next();!o.done;o=i.next())if(qt(o=o.value,n))return o;for(o=(r=c(r)).next();!o.done;o=r.next())if(Gt(n,o=o.value))return o;return null}var $t=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 Jt(){this.g={}}function Qt(e,t){for(var n in e.g)t(n,e.g[n])}function Zt(e){this.h=e,this.g=null}function en(e){this.h=e,this.g=null}function tn(){return!(!e.MediaSource||!MediaSource.isTypeSupported)}function nn(e){return""!=ln().canPlayType(e)}function rn(){return un("Tizen")}function on(){return un("CrKey")}function an(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!rn()}function sn(){if(!an())return null;var e=navigator.userAgent.match(/Version\/(\d+)/);return e||(e=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(e[1],10):null}function un(e){return(navigator.userAgent||"").includes(e)}function ln(){return dn||(cn||(cn=new en((function(){dn=null}))),(dn=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(dn=document.createElement("video")),cn.U(1),dn)}(i=Jt.prototype).push=function(e,t){this.g.hasOwnProperty(e)?this.g[e].push(t):this.g[e]=[t]},i.get=function(e){return(e=this.g[e])?e.slice():null},i.remove=function(e,t){e in this.g&&(this.g[e]=this.g[e].filter((function(e){return e!=t})),0==this.g[e].length&&delete this.g[e])},i.size=function(){return Object.keys(this.g).length},i.keys=function(){return Object.keys(this.g)},Zt.prototype.U=function(t){var n=this;this.stop();var r=!0,i=null;return this.g=function(){e.clearTimeout(i),r=!1},i=e.setTimeout((function(){r&&n.h()}),1e3*t),this},Zt.prototype.stop=function(){this.g&&(this.g(),this.g=null)},en.prototype.Hb=function(){return this.stop(),this.h(),this},en.prototype.U=function(e){var t=this;return this.stop(),this.g=new Zt((function(){t.h()})).U(e),this},en.prototype.Ca=function(e){var t=this;return this.stop(),this.g=new Zt((function(){t.g.U(e),t.h()})).U(e),this},en.prototype.stop=function(){this.g&&(this.g.stop(),this.g=null)},V("shaka.util.Timer",en),en.prototype.stop=en.prototype.stop,en.prototype.tickEvery=en.prototype.Ca,en.prototype.tickAfter=en.prototype.U,en.prototype.tickNow=en.prototype.Hb;var cn=null,dn=null;function fn(e,t,n,r,i){var o=e.variants;(t.length||n.length)&&(o=function(e,t,n){for(var r={},i=(t=c(t)).next();!i.done;r={ed:r.ed},i=t.next())if(r.ed=i.value,(i=e.filter(function(e){return function(t){return t.video&&t.video.codecs.startsWith(e.ed)}}(r))).length){e=i;break}for(r={},n=c(n),t=n.next();!t.done;r={Qc:r.Qc},t=n.next())if(r.Qc=t.value,(t=e.filter(function(e){return function(t){return t.audio&&t.audio.codecs.startsWith(e.Qc)}}(r))).length){e=t;break}return e}(o,t,n));var a=function(e,t){for(var n=c(t),r=n.next();!r.done;r=n.next())if((r=r.value)==_n||r==On){if(1==(e=hn(e,r)).size())return e.keys()[0]}else if(r==Un)break;return function(e){var t="",n=1/0;return Qt(e,(function(e,r){for(var i=0,o=0,a=c(r),s=a.next();!s.done;s=a.next())i+=s.value.bandwidth||0,++o;(i/=o)<n&&(t=e,n=i)})),t}(e)}(t=function(e){var t=0,n=new Map,r=e.size();return Qt(e,(function(e,i){for(var o=c(i),a=o.next();!a.done;a=o.next()){var s=(a=a.value).video;if(s&&s.width&&s.height){s=s.width*s.height*(s.frameRate||1),n.has(s)||n.set(s,new Jt);var u=n.get(s);u.push(e,a),u.size()===r&&(t=Math.max(t,s))}}})),t?n.get(t):e}(t=function(e){for(var t=new Jt,n=(e=c(e)).next();!n.done;n=e.next()){var r=pn(n=n.value);t.push(r,n)}return t}(o=Dn(o,r))),i);e.variants=e.variants.filter((function(e){return pn(e)==a}))}function hn(e,t){var n=0,r=new Jt;return Qt(e,(function(e,i){for(var o=0,a=0,s=c(i),u=s.next();!u.done;u=s.next())(u=u.value).decodingInfos.length&&(o+=u.decodingInfos[0][t]?1:0,a++);(o/=a)>n?(r.g={},r.push(e,i),n=o):o==n&&r.push(e,i)})),r}function pn(e){var t="";e.video&&(t=_t(e.video.codecs));var n="";return e.audio&&(n=_t(e.audio.codecs)),t+"-"+n}function gn(e,t,n){function r(e,t,n){return e>=t&&e<=n}var i=e.video;return!(i&&i.width&&i.height&&(!r(i.width,t.minWidth,Math.min(t.maxWidth,n.width))||!r(i.height,t.minHeight,Math.min(t.maxHeight,n.height))||!r(i.width*i.height,t.minPixels,t.maxPixels))||e&&e.video&&e.video.frameRate&&!r(e.video.frameRate,t.minFrameRate,t.maxFrameRate)||!r(e.bandwidth,t.minBandwidth,t.maxBandwidth))}function mn(e,t){return L((function(n){if(1==n.g)return T(n,vn(t,0<t.offlineSessionIds.length),2);wn(e,t),function(e){e.textStreams=e.textStreams.filter((function(e){return Ft(Lt(e.mimeType,e.codecs))}))}(t),function(e){e.imageStreams=e.imageStreams.filter((function(e){var t=["image/svg+xml","image/png","image/jpeg"];return(un("Web0S")||rn()||on())&&t.push("image/webp"),t.includes(e.mimeType)}))}(t),x(n)}))}function vn(e,t){return L((function(n){if(1==n.g)return T(n,yn(e.variants,t,!1),2);e.variants=e.variants.filter((function(e){var t=e.video;return un("Xbox One")&&t&&(t.width&&1920<t.width||t.height&&1080<t.height)&&t.codecs.includes("avc1.")?(Pn(e),!1):((t=e.decodingInfos.some((function(e){return e.supported})))||Pn(e),t)})),x(n)}))}function yn(t,n,r){var i,o,a,s,u,l,d,f,h,p;return L((function(g){if(t.some((function(e){return e.decodingInfos.length})))return g.return();for(i=e.shakaMediaCapabilities,o=[],a=function(e,t){var n;return L((function(r){return 1==r.g?(S(r,2),T(r,i.decodingInfo(t),4)):2!=r.g?(n=r.h,e.decodingInfos.push(n),A(r,0)):(k(r),JSON.stringify(t),void x(r))}))},s=c(t),u=s.next();!u.done;u=s.next())for(l=u.value,d=bn(l,n,r),f=c(d),h=f.next();!h.done;h=f.next())p=h.value,o.push(a(l,p));return T(g,Promise.all(o),0)}))}function bn(e,t,n){var r=e.audio,i=e.video;if(n={type:n?"file":"media-source"},i){var o=i.codecs;if(i.codecs.includes(",")){var a=i.codecs.split(",");o="vp9"==(o=lt("video",a))?"vp09.00.10.08":o,a=lt("audio",a),a=jt(i.mimeType,a,"audio"),n.audio={contentType:a,channels:2,bitrate:e.bandwidth||1,samplerate:1,spatialRendering:!1}}o=jt(i.mimeType,"vp9"==o?"vp09.00.10.08":o,"video"),n.video={contentType:o,width:i.width||1,height:i.height||1,bitrate:i.bandwidth||e.bandwidth||1,framerate:i.frameRate||1}}if(r&&(o="ac-3"==r.codecs.toLowerCase()&&rn()?"ec-3":r.codecs,o=jt(r.mimeType,o,"audio"),n.audio={contentType:o,channels:r.channelsCount||2,bitrate:r.bandwidth||e.bandwidth||1,samplerate:r.audioSamplingRate||1,spatialRendering:r.spatialAudio}),!(a=(e.video?e.video.drmInfos:[]).concat(e.audio?e.audio.drmInfos:[])).length)return[n];e=[],o=new Map;for(var s=(a=c(a)).next();!s.done;s=a.next()){var u=s.value;o.get(u.keySystem)||o.set(u.keySystem,[]),o.get(u.keySystem).push(u)}a=t?"required":"optional",t=t?["persistent-license"]:["temporary"];for(var l=(u=c(o.keys())).next();!l.done;l=u.next()){var d=l.value;l=Object.assign({},n);var f=o.get(d);for(d={keySystem:d,initDataType:"cenc",persistentState:a,distinctiveIdentifier:"optional",sessionTypes:t},s=(f=c(f)).next();!s.done;s=f.next()){if((s=s.value).initData&&s.initData.length){for(var h=new Set,p=c(s.initData),g=p.next();!g.done;g=p.next())h.add(g.value.initDataType);d.initDataType=s.initData[0].initDataType}s.distinctiveIdentifierRequired&&(d.distinctiveIdentifier="required"),s.persistentStateRequired&&(d.persistentState="required"),s.sessionType&&(d.sessionTypes=[s.sessionType]),r&&(d.audio?d.audio.robustness=d.audio.robustness||s.audioRobustness:d.audio={robustness:s.audioRobustness}),i&&(d.video?d.video.robustness=d.video.robustness||s.videoRobustness:d.video={robustness:s.videoRobustness})}l.keySystemConfiguration=d,e.push(l)}return e}function wn(e,t){t.variants=t.variants.filter((function(t){var n=t.audio;return t=t.video,!(n&&e&&e.audio&&!Tn(n,e.audio)||t&&e&&e.video&&!Tn(t,e.video))}))}function Tn(e,t){return e.mimeType==t.mimeType&&e.codecs.split(".")[0]==t.codecs.split(".")[0]}function xn(e){var t=e.audio,n=e.video,r=t?t.codecs:null,i=n?n.codecs:null,o=[];i&&o.push(i),r&&o.push(r);var a=[];n&&a.push(n.mimeType),t&&a.push(t.mimeType),a=a[0]||null;var s=[];t&&s.push(t.kind),n&&s.push(n.kind),s=s[0]||null;var u=new Set;if(t)for(var l=c(t.roles),d=l.next();!d.done;d=l.next())u.add(d.value);if(n)for(d=(l=c(n.roles)).next();!d.done;d=l.next())u.add(d.value);return e={id:e.id,active:!1,type:"variant",bandwidth:e.bandwidth,language:e.language,label:null,kind:s,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,mimeType:a,codecs:o.join(", "),audioCodec:r,videoCodec:i,primary:e.primary,roles:Array.from(u),audioRoles:null,forced:!1,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:null},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),t&&(e.audioId=t.id,e.originalAudioId=t.originalId,e.channelsCount=t.channelsCount,e.audioSamplingRate=t.audioSamplingRate,e.audioBandwidth=t.bandwidth||null,e.label=t.label,e.audioRoles=t.roles),e}function Sn(e){return{id:e.id,active:!1,type:dt,bandwidth:0,language:e.language,label:e.label,kind:e.kind||null,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,mimeType:e.mimeType,codecs:e.codecs||null,audioCodec:null,videoCodec:null,primary:e.primary,roles:e.roles,audioRoles:null,forced:e.forced,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:e.originalId,originalImageId:null}}function En(e){return{id:e.id,active:!1,type:"image",bandwidth:e.bandwidth||0,language:"",label:null,kind:null,width:e.width||null,height:e.height||null,frameRate:null,pixelAspectRatio:null,hdr:null,mimeType:e.mimeType,codecs:null,audioCodec:null,videoCodec:null,primary:!1,roles:[],audioRoles:null,forced:!1,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:e.tilesLayout||null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:e.originalId}}function An(e){return e.__shaka_id||(e.__shaka_id=jn++),e.__shaka_id}function kn(e){var t=Cn(e);return t.active="disabled"!=e.mode,t.type="text",t.originalTextId=e.id,"captions"==e.kind&&(t.mimeType="application/cea-608"),e.kind&&(t.roles=[e.kind]),"forced"==e.kind&&(t.forced=!0),t}function In(e){var t=Cn(e);return t.active=e.enabled,t.type="variant",t.originalAudioId=e.id,"main"==e.kind&&(t.primary=!0),e.kind&&(t.roles=[e.kind],t.audioRoles=[e.kind],t.label=e.label),t}function Cn(e){return{id:An(e),active:!1,type:"",bandwidth:0,language:zt(e.language),label:e.label,kind:e.kind,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,mimeType:null,codecs:null,audioCodec:null,videoCodec:null,primary:!1,roles:[],forced:!1,audioRoles:null,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:null}}function Mn(e){return e.allowedByApplication&&e.allowedByKeySystem}function Dn(e,t){for(var n=e.filter((function(e){return e.audio&&e.audio.channelsCount})),r=new Map,i=(n=c(n)).next();!i.done;i=n.next()){var o=(i=i.value).audio.channelsCount;r.has(o)||r.set(o,[]),r.get(o).push(i)}return 0==(n=Array.from(r.keys())).length?e:(i=n.filter((function(e){return e<=t}))).length?r.get(Math.max.apply(Math,d(i))):r.get(Math.min.apply(Math,d(n)))}function Rn(e,t,n,r){var i=e,o=e.filter((function(e){return e.primary}));o.length&&(i=o);var a=i.length?i[0].language:"";if(i=i.filter((function(e){return e.language==a})),t){var s=Yt(zt(t),e.map((function(e){return e.language})));s&&(i=e.filter((function(e){return zt(e.language)==s})))}if(i=i.filter((function(e){return e.forced==r})),n){if((e=Nn(i,n)).length)return e}else if((e=i.filter((function(e){return 0==e.roles.length}))).length)return e;return(e=i.map((function(e){return e.roles})).reduce(Fe,[])).length?Nn(i,e[0]):i}function Nn(e,t){return e.filter((function(e){return e.roles.includes(t)}))}function Pn(e){var t=[];return e.audio&&t.push(Ln(e.audio)),e.video&&t.push(Ln(e.video)),t.join(", ")}function Ln(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"}var jn=0,_n="smooth",On="powerEfficient",Un="bandwidth";function Fn(){var e=this;this.j=null,this.i=!1,this.g=new q,navigator.connection&&navigator.connection.addEventListener("change",(function(){if(e.o.useNetworkInformation&&e.i){e.g=new q;var t=e.chooseVariant();t&&e.j(t)}})),this.h=[],this.m=1,this.s=!1,this.o=this.l=null}function Bn(e){var t=e.o.defaultBandwidthEstimate;return navigator.connection&&navigator.connection.downlink&&e.o.useNetworkInformation&&(t=1e6*navigator.connection.downlink),t}function Vn(e,t){return e&&(t=t.filter((function(t){return gn(t,e,{width:1/0,height:1/0})}))),t.sort((function(e,t){return e.bandwidth-t.bandwidth}))}function Hn(e,t){this.h=e,this.g=new Set([e]);for(var n=c(t=t||[]),r=n.next();!r.done;r=n.next())this.add(r.value)}function Kn(e,t){var n;if(!(n=!!e.audio!=!!t.audio||!!e.video!=!!t.video||e.language!=t.language)&&(n=e.audio&&t.audio)){n=e.audio;var r=t.audio;n=!((!(!n.channelsCount||!r.channelsCount||2<n.channelsCount||2<r.channelsCount)||n.channelsCount==r.channelsCount)&&Gn(n,r)&&qn(n.roles,r.roles))}return!n&&(n=e.video&&t.video)&&(n=!(Gn(n=e.video,r=t.video)&&qn(n.roles,r.roles))),!n}function Gn(e,t){if(e.mimeType!=t.mimeType)return!1;var n=e.codecs.split(",").map((function(e){return _t(e)})),r=t.codecs.split(",").map((function(e){return _t(e)}));if(n.length!=r.length)return!1;n.sort(),r.sort();for(var i=c(te(n.length)),o=i.next();!o.done;o=i.next())if(n[o=o.value]!=r[o])return!1;return!0}function qn(e,t){var n=new Set(e),r=new Set(t);if(n.delete("main"),r.delete("main"),n.size!=r.size)return!1;for(var i=(n=c(n)).next();!i.done;i=n.next())if(!r.has(i.value))return!1;return!0}function zn(e){this.g=e,this.h=new Xn(e.language,"",e.audio&&e.audio.channelsCount?e.audio.channelsCount:0,"")}function Xn(e,t,n,r){this.i=e,this.j=t,this.g=n,this.h=void 0===r?"":r}function Wn(){this.g=Jn,this.h=(new Map).set(Jn,2).set($n,1)}function Yn(e,t,n){e.h.set(Jn,n).set($n,t)}(i=Fn.prototype).stop=function(){this.j=null,this.i=!1,this.h=[],this.m=1,this.l=null},i.init=function(e){this.j=e},i.chooseVariant=function(){var e=Vn(this.o.restrictions,this.h),t=this.g.getBandwidthEstimate(Bn(this));this.h.length&&!e.length&&(e=[(e=Vn(null,this.h))[0]]);for(var n=e[0]||null,r=(e=c(ne(e))).next();!r.done;r=e.next()){var i=r.value;r=i.item;var o=isNaN(this.m)?1:Math.abs(this.m);i=o*(i.next||{bandwidth:1/0}).bandwidth/this.o.bandwidthUpgradeTarget,t>=o*r.bandwidth/this.o.bandwidthDowngradeTarget&&t<=i&&(n=r)}return this.l=Date.now(),n},i.enable=function(){this.i=!0},i.disable=function(){this.i=!1},i.segmentDownloaded=function(e,t){var n=this.g;if(!(16e3>t)){var r=8e3*t/e,i=e/1e3;n.g+=t,K(n.h,i,r),K(n.i,i,r)}if(null!=this.l&&this.i)e:{if(this.s){if(Date.now()-this.l<1e3*this.o.switchInterval)break e}else{if(!(128e3<=this.g.g))break e;this.s=!0}n=this.chooseVariant(),this.g.getBandwidthEstimate(Bn(this)),n&&this.j(n)}},i.getBandwidthEstimate=function(){return this.g.getBandwidthEstimate(this.o.defaultBandwidthEstimate)},i.setVariants=function(e){this.h=e},i.playbackRateChanged=function(e){this.m=e},i.configure=function(e){this.o=e},V("shaka.abr.SimpleAbrManager",Fn),Fn.prototype.configure=Fn.prototype.configure,Fn.prototype.playbackRateChanged=Fn.prototype.playbackRateChanged,Fn.prototype.setVariants=Fn.prototype.setVariants,Fn.prototype.getBandwidthEstimate=Fn.prototype.getBandwidthEstimate,Fn.prototype.segmentDownloaded=Fn.prototype.segmentDownloaded,Fn.prototype.disable=Fn.prototype.disable,Fn.prototype.enable=Fn.prototype.enable,Fn.prototype.chooseVariant=Fn.prototype.chooseVariant,Fn.prototype.init=Fn.prototype.init,Fn.prototype.stop=Fn.prototype.stop,Hn.prototype.add=function(e){return!!Kn(this.h,e)&&(this.g.add(e),!0)},Hn.prototype.values=function(){return this.g.values()},zn.prototype.create=function(e){var t=this,n=e.filter((function(e){return Kn(t.g,e)}));return n.length?new Hn(n[0],n):this.h.create(e)},Xn.prototype.create=function(e){var t=[];t=function(e,t){var n=Yt(zt(t),e.map((function(e){return Wt(e)})));return n?e.filter((function(e){return n==Wt(e)})):[]}(e,this.i);var n=e.filter((function(e){return e.primary}));for((e=function(e,t){return e.filter((function(e){return!!e.audio&&(t?e.audio.roles.includes(t):0==e.audio.roles.length)}))}(t=t.length?t:n.length?n:e,this.j)).length&&(t=e),this.g&&((e=Dn(t,this.g)).length&&(t=e)),this.h&&((e=function(e,t){return e.filter((function(e){return!!e.audio&&e.audio.label.toLowerCase()==t.toLowerCase()}))}(t,this.h)).length&&(t=e)),e=new Hn(t[0]),n=(t=c(t)).next();!n.done;n=t.next())n=n.value,Kn(e.h,n)&&e.add(n);return e};var $n=0,Jn=1;function Qn(e,t){var n={maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4};this.l=null==e.maxAttempts?n.maxAttempts:e.maxAttempts,this.j=null==e.baseDelay?n.baseDelay:e.baseDelay,this.s=null==e.fuzzFactor?n.fuzzFactor:e.fuzzFactor,this.m=null==e.backoffFactor?n.backoffFactor:e.backoffFactor,this.g=0,this.h=this.j,(this.i=void 0!==t&&t)&&(this.g=1)}function Zn(e){var t,n;return L((function(r){if(1==r.g){if(e.g>=e.l){if(!e.i)throw new ze(2,7,1010);e.g=1,e.h=e.j}return t=e.g,e.g++,0==t?r.return():(n=e.h*(1+(2*Math.random()-1)*e.s),T(r,new Promise((function(e){new en(e).U(n/1e3)})),2))}e.h*=e.m,x(r)}))}function er(e,t){this.promise=e,this.i=t,this.g=!1}function tr(e){return new er(Promise.reject(e),(function(){return Promise.resolve()}))}function nr(){var e=Promise.reject(new ze(2,7,7001));return e.catch((function(){})),new er(e,(function(){return Promise.resolve()}))}function rr(e){return new er(Promise.resolve(e),(function(){return Promise.resolve()}))}function ir(e){return new er(e,(function(){return e.catch((function(){}))}))}function or(e){return new er(Promise.all(e.map((function(e){return e.promise}))),(function(){return Promise.all(e.map((function(e){return e.abort()})))}))}function ar(t,n){for(var r in n=void 0===n?{}:n)Object.defineProperty(this,r,{value:n[r],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 sr(){this.rc=new Jt,this.qc=this}function ur(e){var t=new Set;return function e(n){switch(typeof n){case"undefined":case"boolean":case"number":case"string":case"symbol":case"function":return n;default:if(!n||n.buffer&&n.buffer.constructor==ArrayBuffer)return n;if(t.has(n))return null;var r=n.constructor==Array;if(n.constructor!=Object&&!r)return null;t.add(n);var i,o=r?[]:{};for(i in n)o[i]=e(n[i]);return r&&(o.length=n.length),o}}(e)}function lr(e){var t,n={};for(t in e)n[t]=e[t];return n}function cr(){this.g=[]}function dr(e,t){e.g.push(t.finally((function(){ie(e.g,t)})))}function fr(e){sr.call(this),this.i=!1,this.l=new cr,this.g=new Set,this.h=new Set,this.j=e||null,this.m=!1}function hr(e,t,n,r){n=n||br;var i=wr[e];(!i||n>=i.priority)&&(wr[e]={priority:n,Df:t,Ff:void 0!==r&&r})}function pr(e,t,n){return{uris:e,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:t,licenseRequestType:null,sessionId:null,streamDataCallback:void 0===n?null:n}}function gr(e,t,n,r,i,o,a){e.m&&(n.uris[i]=n.uris[i].replace("http://","https://"));var s=new We(n.uris[i]),u=s.Ea,l=!1;u||(Ye(s,u=(u=location.protocol).slice(0,-1)),n.uris[i]=s.toString()),u=u.toLowerCase();var c=(u=wr[u])?u.Df:null;if(!c)return tr(new ze(2,1,1e3,s));var d,f=u.Ff,h=null,p=null,g=!1;return ir(Zn(r)).ba((function(){if(e.i)return nr();d=Date.now();var r=c(n.uris[i],n,t,(function(n,r,i){h&&h.stop(),p&&p.U(s/1e3),e.j&&t==yr&&(e.j(n,r),l=!0,a.g=i)}));if(!f)return r;var o=n.retryParameters.connectionTimeout;o&&(h=new en((function(){g=!0,r.abort()}))).U(o/1e3);var s=n.retryParameters.stallTimeout;return s&&(p=new en((function(){g=!0,r.abort()}))),r})).ba((function(e){return h&&h.stop(),p&&p.stop(),void 0==e.timeMs&&(e.timeMs=Date.now()-d),{response:e,sf:l}}),(function(s){if(h&&h.stop(),p&&p.stop(),e.i)return nr();if(g&&(s=new ze(1,1,1003,n.uris[i],t)),s instanceof ze){if(7001==s.code)throw s;if(1010==s.code)throw o;if(1==s.severity){var u=new ar("retry",{error:s});return e.dispatchEvent(u),i=(i+1)%n.uris.length,gr(e,t,n,r,i,s,a)}}throw s}))}function mr(){this.g=0}function vr(e,t,n){er.call(this,e,t),this.h=n}er.prototype.abort=function(){return this.g=!0,this.i()},er.prototype.finally=function(e){return this.promise.then((function(){return e(!0)}),(function(){return e(!1)})),this},er.prototype.ba=function(e,t){function n(n){return function(s){if(i.g&&n)o.reject(a);else{var u=n?e:t;u?r=function(e,t,n){try{var r=e(t);return r&&r.promise&&r.abort?(n.resolve(r.promise),function(){return r.abort()}):(n.resolve(r),function(){return Promise.resolve(r).then((function(){}),(function(){}))})}catch(i){return n.reject(i),function(){return Promise.resolve()}}}(u,s,o):(n?o.resolve:o.reject)(s)}}}function r(){return o.reject(a),i.abort()}var i=this,o=new pt,a=new ze(2,7,7001);return this.promise.then(n(!0),n(!1)),new er(o,(function(){return r()}))},V("shaka.util.AbortableOperation",er),er.prototype.chain=er.prototype.ba,er.prototype.finally=er.prototype.finally,er.all=or,er.prototype.abort=er.prototype.abort,er.notAbortable=ir,er.completed=rr,er.aborted=nr,er.failed=tr,ar.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)},ar.prototype.stopImmediatePropagation=function(){this.g=!0},ar.prototype.stopPropagation=function(){},V("shaka.util.FakeEvent",ar),sr.prototype.addEventListener=function(e,t){this.rc.push(e,t)},sr.prototype.removeEventListener=function(e,t){this.rc.remove(e,t)},sr.prototype.dispatchEvent=function(e){var t=this.rc.get(e.type)||[],n=this.rc.get("All");for(n&&(t=t.concat(n)),n=(t=c(t)).next();!n.done;n=t.next()){n=n.value,e.target=this.qc,e.currentTarget=this.qc;try{n.handleEvent?n.handleEvent(e):n.call(this,e)}catch(r){}if(e.g)break}return e.defaultPrevented},cr.prototype.destroy=function(){for(var e=[],t=c(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)},v(fr,sr),(i=fr.prototype).Md=function(e){this.m=e},i.Gf=function(e){this.g.add(e)},i.Xf=function(e){this.g.delete(e)},i.Le=function(){this.g.clear()},i.Hf=function(e){this.h.add(e)},i.Yf=function(e){this.h.delete(e)},i.Me=function(){this.h.clear()},i.destroy=function(){return this.i=!0,this.g.clear(),this.h.clear(),this.l.destroy()},i.request=function(e,t){var n=this,r=new mr;if(this.i){var i=Promise.reject(new ze(2,7,7001));return i.catch((function(){})),new vr(i,(function(){return Promise.resolve()}),r)}t.method=t.method||"GET",t.headers=t.headers||{},t.retryParameters=t.retryParameters?ur(t.retryParameters):{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4},t.uris=ur(t.uris);var o=(i=function(e,t,n){for(var r=rr(void 0),i={},o=(e=c(e.g)).next();!o.done;i={Zc:i.Zc},o=e.next())i.Zc=o.value,r=r.ba(function(e){return function(){return n.body&&(n.body=De(n.body)),e.Zc(t,n)}}(i));return r.ba(void 0,(function(e){if(e instanceof ze&&7001==e.code)throw e;throw new ze(2,1,1006,e)}))}(this,e,t)).ba((function(){return gr(n,e,t,new Qn(t.retryParameters,!1),0,null,r)})),a=o.ba((function(t){return function(e,t,n){for(var r=rr(void 0),i={},o=(e=c(e.h)).next();!o.done;i={$c:i.$c},o=e.next())i.$c=o.value,r=r.ba(function(e){return function(){var r=n.response;return r.data&&(r.data=De(r.data)),e.$c(t,r)}}(i));return r.ba((function(){return n}),(function(e){var t=2;if(e instanceof ze){if(7001==e.code)throw e;t=e.severity}throw new ze(t,1,1007,e)}))}(n,e,t)})),s=Date.now(),u=0;i.promise.then((function(){u=Date.now()-s}),(function(){}));var l=0;o.promise.then((function(){l=Date.now()}),(function(){}));var d=a.ba((function(t){var r=Date.now()-l,i=t.response;return i.timeMs+=u,i.timeMs+=r,t.sf||!n.j||i.fromCache||e!=yr||n.j(i.timeMs,i.data.byteLength),i}),(function(e){throw e&&(e.severity=2),e}));return i=new vr(d.promise,(function(){return d.abort()}),r),dr(this.l,i),i},V("shaka.net.NetworkingEngine",fr),fr.prototype.request=fr.prototype.request,fr.prototype.destroy=fr.prototype.destroy,fr.makeRequest=pr,fr.defaultRetryParameters=function(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4}},fr.prototype.clearAllResponseFilters=fr.prototype.Me,fr.prototype.unregisterResponseFilter=fr.prototype.Yf,fr.prototype.registerResponseFilter=fr.prototype.Hf,fr.prototype.clearAllRequestFilters=fr.prototype.Le,fr.prototype.unregisterRequestFilter=fr.prototype.Xf,fr.prototype.registerRequestFilter=fr.prototype.Gf,fr.unregisterScheme=function(e){delete wr[e]},fr.registerScheme=hr,fr.prototype.setForceHTTPS=fr.prototype.Md,fr.NumBytesRemainingClass=mr,v(vr,er),fr.PendingRequest=vr;var yr=1;fr.RequestType={MANIFEST:0,SEGMENT:yr,LICENSE:2,APP:3,TIMING:4,SERVER_CERTIFICATE:5};var br=3;fr.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:br};var wr={};function Tr(e){this.g=!1,this.h=new pt,this.i=e}function xr(e,t){if(e.g){if(t instanceof ze&&7003==t.code)throw t;throw new ze(2,7,7003,t)}}function Sr(){this.g=new Jt}function Er(e,t,n,r){this.target=e,this.type=t,this.listener=n,this.g=function(e,t){if(void 0==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=Ar;if(void 0==t){t=!1;try{var n={},r={get:function(){return t=!0,!1}};Object.defineProperty(n,"passive",r),Object.defineProperty(n,"capture",r),r=function(){},e.addEventListener("test",r,n),e.removeEventListener("test",r,n)}catch(i){t=!1}Ar=t}return t||!1}(e)?t:t.capture||!1}(e,r),this.target.addEventListener(t,n,this.g)}Tr.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=Sr.prototype).release=function(){this.nb(),this.g=null},i.A=function(e,t,n,r){this.g&&(e=new Er(e,t,n,r),this.g.push(t,e))},i.wa=function(e,t,n,r){var i=this;this.A(e,t,(function r(o){i.Da(e,t,r),n(o)}),r)},i.Da=function(e,t,n){if(this.g)for(var r=this.g.get(t)||[],i=(r=c(r)).next();!i.done;i=r.next())(i=i.value).target!=e||n!=i.listener&&n||(i.Da(),this.g.remove(t,i))},i.nb=function(){if(this.g){var e,t=this.g,n=[];for(e in t.g)n.push.apply(n,d(t.g[e]));for(n=(t=c(n)).next();!n.done;n=t.next())n.value.Da();this.g.g={}}},V("shaka.util.EventManager",Sr),Sr.prototype.removeAll=Sr.prototype.nb,Sr.prototype.unlisten=Sr.prototype.Da,Sr.prototype.listenOnce=Sr.prototype.wa,Sr.prototype.listen=Sr.prototype.A,Sr.prototype.release=Sr.prototype.release,Er.prototype.Da=function(){this.target.removeEventListener(this.type,this.listener,this.g),this.listener=this.target=null,this.g=!1};var Ar=void 0;function kr(){}function Ir(e){return new We(e=bt(e)).Ga}function Cr(e,t,n){function r(e){Ne(o).setUint32(a,e.byteLength,!0),a+=4,o.set(Re(e),a),a+=e.byteLength}if(!n||!n.byteLength)throw new ze(2,6,6015);var i;i="string"==typeof t?Tt(t,!0):t,e=Tt(e=bt(e),!0);var o=new Uint8Array(12+e.byteLength+i.byteLength+n.byteLength),a=0;return r(e),r(i),r(n),o}function Mr(e){for(var t=new Map,n=c(Object.keys(e)),r=n.next();!r.done;r=n.next())r=r.value,t.set(r,e[r]);return t}function Dr(e){var t={};return e.forEach((function(e,n){t[n]=e})),t}function Rr(e,t){if(!e&&!t)return!0;if(e&&!t||t&&!e)return!1;if(e.size!=t.size)return!1;for(var n=c(e),r=n.next();!r.done;r=n.next()){var i=c(r.value);if(r=i.next().value,i=i.next().value,!t.has(r))return!1;if((r=t.get(r))!=i||void 0==r)return!1}return!0}function Nr(e,t){var n=this;t=void 0===t?1:t,this.C=e,this.D=new Set,this.g=this.m=null,this.qa=this.Y=!1,this.F=0,this.i=null,this.h=new Sr,this.j=new Map,this.u=[],this.s=new pt,this.o=null,this.l=function(t){n.s.reject(t),e.onError(t)},this.ra=new Map,this.da=new Map,this.N=new en((function(){return function(e){var t=e.ra,n=e.da;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.l(new ze(2,6,6014)),e.C.Gc(Dr(n))}(n)})),this.J=!1,this.H=[],this.L=!1,this.pa=new en((function(){!function(e){e.j.forEach((function(t,n){var r=t.Cd,i=n.expiration;isNaN(i)&&(i=1/0),i!=r&&(e.C.onExpirationUpdated(n.sessionId,i),t.Cd=i)}))}(n)})).Ca(t),this.s.catch((function(){})),this.I=new Tr((function(){return function(e){return L((function(t){switch(t.g){case 1:return e.h.release(),e.h=null,e.s.reject(),e.pa.stop(),e.pa=null,e.N.stop(),e.N=null,T(t,qr(e),2);case 2:if(!e.g){t.v(3);break}return S(t,4),T(t,e.g.setMediaKeys(null),6);case 6:A(t,5);break;case 4:k(t);case 5:e.g=null;case 3:e.i=null,e.D.clear(),e.m=null,e.u=[],e.o=null,e.l=function(){},e.C=null,e.S=!1,x(t)}}))}(n)})),this.S=!1}function Pr(e,t,n){return e.u=n,e.J=0<n.length,Lr(e,t)}function Lr(t,n){var r,i,o,a,s,u,l,d,f,h,p,g;return L((function(m){if(1==m.g){if(r=function(t){if(0==(t=Mr(t.o.clearKeys)).size)return null;var n=[],r=[];t.forEach((function(e,t){var i=It(t),o=It(e);i={kty:"oct",kid:At(i,!1),k:At(o,!1)},n.push(i),r.push(i.kid)})),t=JSON.stringify({keys:n});var i=JSON.stringify({kids:r});return i=[{initData:Re(wt(i)),initDataType:"keyids"}],{keySystem:"org.w3.clearkey",licenseServerUri:"data:application/json;base64,"+e.btoa(t),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:i,keyIds:new Set(r)}}(t))for(i=c(n),o=i.next();!o.done;o=i.next())(a=o.value).video&&(a.video.drmInfos=[r]),a.audio&&(a.audio.drmInfos=[r]);for((s=n.some((function(e){return!!(e.video&&e.video.drmInfos.length||e.audio&&e.audio.drmInfos.length)})))||(u=Mr(t.o.servers),function(e,t){var n=[];t.forEach((function(e,t){n.push({keySystem:t,licenseServerUri:e,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",initData:[],keyIds:new Set})}));for(var r=c(e),i=r.next();!i.done;i=r.next())(i=i.value).video&&(i.video.drmInfos=n),i.audio&&(i.audio.drmInfos=n)}(n,u)),l=c(n),o=l.next();!o.done;o=l.next())for(d=o.value,f=Xr(d),h=c(f),p=h.next();!p.done;p=h.next())$r(p.value,Mr(t.o.servers),Mr(t.o.advanced||{}));return T(m,yn(n,t.J,t.S),2)}return s||Object.keys(t.o.servers).length?(g=Br(t,void 0,n),m.return(s?g:g.catch((function(){})))):(t.Y=!0,m.return(Promise.resolve()))}))}function jr(e){var t,n;return L((function(r){switch(r.g){case 1:if(!e.m||!e.i)return r.return();if(!e.i.serverCertificateUri||e.i.serverCertificate&&e.i.serverCertificate.length){r.v(2);break}return t=pr([e.i.serverCertificateUri],e.o.retryParameters),S(r,3),T(r,e.C.lb.request(5,t).promise,5);case 5:n=r.h,e.i.serverCertificate=Re(n.data),A(r,4);break;case 3:throw new ze(2,6,6017,k(r));case 4:if(e.I.g)return r.return();case 2:return e.i.serverCertificate&&e.i.serverCertificate.length?(S(r,6),T(r,e.m.setServerCertificate(e.i.serverCertificate),8)):r.return();case 8:A(r,0);break;case 6:throw new ze(2,6,6004,k(r).message)}}))}function _r(e){for(var t=(e.i?e.i.initData:[])||[],n=c(t),r=n.next();!r.done;r=n.next())Or(e,(r=r.value).initDataType,r.initData);for(r=(n=c(e.u)).next();!r.done;r=n.next())Vr(e,r.value);return t.length||e.u.length||e.s.resolve(),e.s}function Or(e,t,n){for(var r=e.j.values(),i=(r=c(r)).next();!i.done;i=r.next())if(Ce(n,i.value.initData)&&!un("Tizen 2"))return;!function(e,t,n,r){try{var i=e.m.createSession(r)}catch(o){return void e.l(new ze(2,6,6005,o.message))}e.h.A(i,"message",(function(t){e.g&&e.o.delayLicenseRequestUntilPlayed&&e.g.paused&&!e.L?e.H.push(t):Kr(e,t)})),e.h.A(i,"keystatuseschange",(function(t){return Gr(e,t)})),e.j.set(i,{initData:n,loaded:!1,Cd:1/0,Ka:null,type:r});try{n=e.o.initDataTransform(n,t,e.i)}catch(o){return t=o,o instanceof ze||(t=new ze(2,6,6016,o)),void e.l(t)}e.o.logLicenseExchange&&At(n),i.generateRequest(t,n).catch((function(t){if(!e.I.g){e.j.delete(i);var n=t.errorCode;if(n&&n.systemCode){var r=n.systemCode;0>r&&(r+=Math.pow(2,32)),r="0x"+r.toString(16)}e.l(new ze(2,6,6006,t.message,t,r))}}))}(e,t,n,e.i.sessionType)}function Ur(e){return!!e&&!!e.match(/^com\.(microsoft|chromecast)\.playready/)}function Fr(e){return e=ee(e=e.j.keys(),(function(e){return e.sessionId})),Array.from(e)}function Br(e,t,n){var r,i,o,a,s,u,l,d,f,h,p,g,m;return L((function(v){switch(v.g){case 1:if(r=new Map,n.length){i=function(e,t,n){for(var r=c(t),i=r.next();!i.done;i=r.next()){var o=c(Xr(i.value));for(i=o.next();!i.done;i=o.next())i=i.value,n.has(i.keySystem)||n.set(i.keySystem,[]),n.get(i.keySystem).push(i)}if(1==n.size&&n.has(""))throw new ze(2,6,6e3);for(r={},e=c(e.o.preferredKeySystems),i=e.next();!i.done;r={Xc:r.Xc},i=e.next())for(r.Xc=i.value,i=(o=c(t)).next();!i.done;i=o.next())if(i=i.value.decodingInfos.find(function(e){return function(t){return t.supported&&null!=t.keySystemAccess&&t.keySystemAccess.keySystem==e.Xc}}(r)))return i.keySystemAccess;for(e=c([!0,!1]),i=e.next();!i.done;i=e.next())for(r=i.value,i=(o=c(t)).next();!i.done;i=o.next()){var a=c(i.value.decodingInfos);for(i=a.next();!i.done;i=a.next()){var s=i.value;if(s.supported&&s.keySystemAccess){var u=c(i=n.get(s.keySystemAccess.keySystem));for(i=u.next();!i.done;i=u.next())if(!!i.value.licenseServerUri==r)return s.keySystemAccess}}}return null}(e,n,r),v.v(2);break}return T(v,function(e,t){var n,r,i,o,a,s,u,l,d,f,h,p,g,m;return L((function(v){switch(v.g){case 1:if(1==t.size&&t.has(""))throw new ze(2,6,6e3);for(r=c(t.values()),i=r.next();!i.done;i=r.next())0==(o=i.value).audioCapabilities.length&&delete o.audioCapabilities,0==o.videoCapabilities.length&&delete o.videoCapabilities;a=c(e.o.preferredKeySystems),s=a.next();case 2:if(s.done){v.v(4);break}if(u=s.value,!t.has(u)){v.v(3);break}return l=t.get(u),S(v,6),T(v,navigator.requestMediaKeySystemAccess(u,[l]),8);case 8:return n=v.h,v.return(n);case 6:k(v);case 7:xr(e.I);case 3:s=a.next(),v.v(2);break;case 4:d=c([!0,!1]),f=d.next();case 9:if(f.done){v.v(11);break}h=f.value,p=c(t.keys()),s=p.next();case 12:if(s.done){f=d.next(),v.v(9);break}if(g=s.value,m=t.get(g),m.drmInfos.some((function(e){return!!e.licenseServerUri}))!=h){v.v(13);break}return S(v,15),T(v,navigator.requestMediaKeySystemAccess(g,[m]),17);case 17:return n=v.h,v.return(n);case 15:k(v);case 16:xr(e.I);case 13:s=p.next(),v.v(12);break;case 11:return v.return(n)}}))}(e,t),3);case 3:i=v.h;case 2:if(!(o=i))throw new ze(2,6,6001);for(xr(e.I),S(v,4),e.D.clear(),a=o.getConfiguration(),s=a.audioCapabilities||[],u=a.videoCapabilities||[],l=c(s),d=l.next();!d.done;d=l.next())f=d.value,e.D.add(f.contentType.toLowerCase());for(h=c(u),d=h.next();!d.done;d=h.next())p=d.value,e.D.add(p.contentType.toLowerCase());if(n.length){var y=o.keySystem,b=r.get(o.keySystem),w=[],x=[],E=[],I=[],C=new Set;Yr(b,w,E,x,I,C);var M=e.J?"persistent-license":"temporary";for(y={keySystem:y,licenseServerUri:w[0],distinctiveIdentifierRequired:b[0].distinctiveIdentifierRequired,persistentStateRequired:b[0].persistentStateRequired,sessionType:b[0].sessionType||M,audioRobustness:b[0].audioRobustness||"",videoRobustness:b[0].videoRobustness||"",serverCertificate:E[0],serverCertificateUri:x[0],initData:I,keyIds:C},w=(b=c(b)).next();!w.done;w=b.next())(w=w.value).distinctiveIdentifierRequired&&(y.distinctiveIdentifierRequired=w.distinctiveIdentifierRequired),w.persistentStateRequired&&(y.persistentStateRequired=w.persistentStateRequired);b=y}else b=o.keySystem,y=t.get(o.keySystem),w=[],x=[],E=[],I=[],C=new Set,Yr(y.drmInfos,w,E,x,I,C),b={keySystem:b,licenseServerUri:w[0],distinctiveIdentifierRequired:"required"==y.distinctiveIdentifier,persistentStateRequired:"required"==y.persistentState,sessionType:y.sessionTypes[0]||"temporary",audioRobustness:(y.audioCapabilities?y.audioCapabilities[0].robustness:"")||"",videoRobustness:(y.videoCapabilities?y.videoCapabilities[0].robustness:"")||"",serverCertificate:E[0],serverCertificateUri:x[0],initData:I,keyIds:C};if(e.i=b,!e.i.licenseServerUri)throw new ze(2,6,6012,e.i.keySystem);return T(v,o.createMediaKeys(),6);case 6:return g=v.h,xr(e.I),e.m=g,e.Y=!0,T(v,jr(e),7);case 7:xr(e.I),A(v,0);break;case 4:if(m=k(v),xr(e.I,m),e.i=null,e.D.clear(),m instanceof ze)throw m;throw new ze(2,6,6002,m.message)}}))}function Vr(e,t){var n,i,o,a,s;return L((function(u){switch(u.g){case 1:try{n=e.m.createSession("persistent-license")}catch(r){return i=new ze(2,6,6005,r.message),e.l(i),u.return(Promise.reject(i))}return e.h.A(n,"message",(function(t){e.g&&e.o.delayLicenseRequestUntilPlayed&&e.g.paused&&!e.L?e.H.push(t):Kr(e,t)})),e.h.A(n,"keystatuseschange",(function(t){return Gr(e,t)})),o={initData:null,loaded:!1,Cd:1/0,Ka:null,type:"persistent-license"},e.j.set(n,o),S(u,2),T(u,n.load(t),4);case 4:return a=u.h,xr(e.I),a?(o.loaded=!0,Wr(e)&&e.s.resolve(),u.return(n)):(e.j.delete(n),e.l(new ze(2,6,6013)),u.return(Promise.resolve()));case 2:s=k(u),xr(e.I,s),e.j.delete(n),e.l(new ze(2,6,6005,s.message));case 3:return u.return(Promise.resolve())}}))}function Hr(e,t,n){return"skd"==t&&(t=n.serverCertificate,e=Cr(e,n=Ir(e),t)),e}function Kr(e,t){var n,r,i,o,a,s,u,l,d,f,h,p;L((function(g){switch(g.g){case 1:return n=t.target,e.o.logLicenseExchange&&At(t.message),r=e.j.get(n),i=e.i.licenseServerUri,o=e.o.advanced[e.i.keySystem],"individualization-request"==t.messageType&&o&&o.individualizationServer&&(i=o.individualizationServer),(a=pr([i],e.o.retryParameters)).body=t.message,a.method="POST",a.licenseRequestType=t.messageType,a.sessionId=n.sessionId,Ur(e.i.keySystem)&&function(e){var t=yt(e.body,!0,!0);if(t.includes("PlayReadyKeyMessage")){for(var n=c((t=(new DOMParser).parseFromString(t,"application/xml")).getElementsByTagName("HttpHeader")),r=n.next();!r.done;r=n.next())r=r.value,e.headers[r.getElementsByTagName("name")[0].textContent]=r.getElementsByTagName("value")[0].textContent;e.body=kt(t.getElementsByTagName("Challenge")[0].textContent)}else e.headers["Content-Type"]="text/xml; charset=utf-8"}(a),s=Date.now(),S(g,2),T(g,e.C.lb.request(2,a).promise,4);case 4:u=g.h,A(g,3);break;case 2:return l=k(g),d=new ze(2,6,6007,l),e.l(d),r&&r.Ka&&r.Ka.reject(d),g.return();case 3:return e.I.g?g.return():(e.F+=(Date.now()-s)/1e3,e.o.logLicenseExchange&&At(u.data),S(g,5),T(g,n.update(u.data),7));case 7:A(g,6);break;case 5:return f=k(g),h=new ze(2,6,6008,f.message),e.l(h),r&&r.Ka&&r.Ka.reject(h),g.return();case 6:p=new ar("drmsessionupdate"),e.C.onEvent(p),r&&(r.Ka&&r.Ka.resolve(),new en((function(){r.loaded=!0,Wr(e)&&e.s.resolve()})).U(Qr)),x(g)}}))}function Gr(e,t){var n=t.target,r=e.j.get(n),i=!1;n.keyStatuses.forEach((function(t,n){if("string"==typeof n){var o=n;n=t,t=o}if(Ur(e.i.keySystem)&&16==n.byteLength&&navigator.userAgent.match(/Edge?\//)){var a=(o=Ne(n)).getUint32(0,!0),s=o.getUint16(4,!0),u=o.getUint16(6,!0);o.setUint32(0,a,!1),o.setUint16(4,s,!1),o.setUint16(6,u,!1)}"status-pending"!=t&&(r.loaded=!0),"expired"==t&&(i=!0),o=Ct(n),e.ra.set(o,t)}));var o=n.expiration-Date.now();(0>o||i&&1e3>o)&&r&&!r.Ka&&(e.j.delete(n),n.close().catch((function(){}))),Wr(e)&&(e.s.resolve(),e.N.U(Zr))}function qr(e){var t;return L((function(n){return t=Array.from(e.j.entries()),e.j.clear(),T(n,Promise.all(t.map((function(t){var n=(t=c(t)).next().value,r=t.next().value;return L((function(t){return 1==t.g?(S(t,2),e.qa||e.u.includes(n.sessionId)||"persistent-license"!==r.type?T(t,function(e){var t;return L((function(n){return 1==n.g?(t=new Promise((function(e,t){new en(t).U(Jr)})),S(n,2),T(n,Promise.race([Promise.all([e.close(),e.closed]),t]),4)):2!=n.g?A(n,0):(k(n),void x(n))}))}(n),5):T(t,n.remove(),5)):2!=t.g?A(t,0):(k(t),void x(t))}))}))),0)}))}function zr(e,t){if(!e.length)return t;if(!t.length)return e;for(var n=[],r=c(e),i=r.next();!i.done;i=r.next()){i=i.value;for(var o=c(t),a=o.next();!a.done;a=o.next())if(a=a.value,i.keySystem==a.keySystem){o=(o=(o=[]).concat(i.initData||[])).concat(a.initData||[]);var s=i.keyIds&&a.keyIds?new Set([].concat(d(i.keyIds),d(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:o,keyIds:s});break}}return n}function Xr(e){return(e.video?e.video.drmInfos:[]).concat(e.audio?e.audio.drmInfos:[])}function Wr(e){return function(e,t){for(var n=c(e),r=n.next();!r.done;r=n.next())if(!t(r.value))return!1;return!0}(e=e.j.values(),(function(e){return e.loaded}))}function Yr(e,t,n,r,i,o){for(var a={},s=(e=c(e)).next();!s.done;a={oa:a.oa},s=e.next()){if(a.oa=s.value,t.includes(a.oa.licenseServerUri)||t.push(a.oa.licenseServerUri),r.includes(a.oa.serverCertificateUri)||r.push(a.oa.serverCertificateUri),a.oa.serverCertificate&&(n.some(function(e){return function(t){return Ce(t,e.oa.serverCertificate)}}(a))||n.push(a.oa.serverCertificate)),a.oa.initData){s={};for(var u=c(a.oa.initData),l=u.next();!l.done;s={kc:s.kc},l=u.next())s.kc=l.value,i.some(function(e){return function(t){var n=e.kc;return!(!t.keyId||t.keyId!=n.keyId)||t.initDataType==n.initDataType&&Ce(t.initData,n.initData)}}(s))||i.push(s.kc)}if(a.oa.keyIds)for(u=(s=c(a.oa.keyIds)).next();!u.done;u=s.next())o.add(u.value)}}function $r(t,n,r){!t.keySystem||"org.w3.clearkey"==t.keySystem&&t.licenseServerUri||(n.size&&(n=n.get(t.keySystem)||"",t.licenseServerUri=n),t.keyIds||(t.keyIds=new Set),(r=r.get(t.keySystem))&&(t.distinctiveIdentifierRequired||(t.distinctiveIdentifierRequired=r.distinctiveIdentifierRequired),t.persistentStateRequired||(t.persistentStateRequired=r.persistentStateRequired),t.videoRobustness||(t.videoRobustness=r.videoRobustness),t.audioRobustness||(t.audioRobustness=r.audioRobustness),t.serverCertificate||(t.serverCertificate=r.serverCertificate),r.sessionType&&(t.sessionType=r.sessionType),t.serverCertificateUri||(t.serverCertificateUri=r.serverCertificateUri)),e.cast&&e.cast.__platform__&&"com.microsoft.playready"==t.keySystem&&(t.keySystem="com.chromecast.playready"))}V("shaka.util.FairPlayUtils",kr),kr.initDataTransform=Cr,kr.defaultGetContentId=Ir,(i=Nr.prototype).destroy=function(){return this.I.destroy()},i.configure=function(e){this.o=e},i.Pb=function(e){var t,n=this;return L((function(r){if(1==r.g)return n.m?(n.g=e,n.h.wa(n.g,"play",(function(){for(var e=c(n.H),t=e.next();!t.done;t=e.next())Kr(n,t.value);n.L=!0,n.H=[]})),"webkitCurrentPlaybackTargetIsWireless"in n.g&&n.h.A(n.g,"webkitcurrentplaybacktargetiswirelesschanged",(function(){return qr(n)})),T(r,n.g.setMediaKeys(n.m).catch((function(e){return Promise.reject(new ze(2,6,6003,e.message))})),2)):(n.h.wa(e,"encrypted",(function(){n.l(new ze(2,6,6010))})),r.return());xr(n.I),_r(n),n.i.initData.length||n.u.length||(t=function(e){return Or(n,e.initDataType,Re(e.initData))},n.h.A(n.g,"encrypted",t)),x(r)}))},i.Tb=function(){for(var e=1/0,t=this.j.keys(),n=(t=c(t)).next();!n.done;n=t.next())n=n.value,isNaN(n.expiration)||(e=Math.min(e,n.expiration));return e},i.zc=function(){return Dr(this.da)};var Jr=1,Qr=5,Zr=.5,ei=new gt((function(){return De(new Uint8Array([0]))}));function ti(){}function ni(e,t,n,r){var i,o,a,s;return L((function(u){if(1==u.g)return r&&(i=oi[r.toLowerCase()])?u.return(i):(o=ii(e))&&(a=ai[o])?u.return(a):r?u.v(2):T(u,ri(e,t,n),3);if(2!=u.g&&(r=u.h)&&(s=oi[r]))return u.return(s);throw new ze(2,4,4e3,e)}))}function ri(e,t,n){var r,i,o;return L((function(a){return 1==a.g?((r=pr([e],n)).method="HEAD",T(a,t.request(0,r).promise,2)):(i=a.h,o=i.headers["content-type"],a.return(o?o.toLowerCase().split(";").shift():""))}))}function ii(e){return 1==(e=new We(e).ya.split("/").pop().split(".")).length?"":e.pop().toLowerCase()}V("shaka.media.ManifestParser",ti),ti.unregisterParserByMime=function(e){delete oi[e]},ti.registerParserByMime=function(e,t){oi[e]=t},ti.registerParserByExtension=function(e,t){ai[e]=t};var oi={},ai={};function si(e,t){this.P=Ne(e),this.h=t==li,this.g=0}function ui(){return new ze(2,3,3e3)}(i=si.prototype).na=function(){return this.g<this.P.byteLength},i.Z=function(){return this.g},i.Ye=function(){return this.P.byteLength},i.$=function(){try{var e=this.P.getUint8(this.g);return this.g+=1,e}catch(t){throw ui()}},i.Eb=function(){try{var e=this.P.getUint16(this.g,this.h);return this.g+=2,e}catch(t){throw ui()}},i.M=function(){try{var e=this.P.getUint32(this.g,this.h);return this.g+=4,e}catch(t){throw ui()}},i.me=function(){try{var e=this.P.getInt32(this.g,this.h);return this.g+=4,e}catch(t){throw ui()}},i.Fb=function(){try{if(this.h)var e=this.P.getUint32(this.g,!0),t=this.P.getUint32(this.g+4,!0);else t=this.P.getUint32(this.g,!1),e=this.P.getUint32(this.g+4,!1)}catch(n){throw ui()}if(2097151<t)throw new ze(2,3,3001);return this.g+=8,t*Math.pow(2,32)+e},i.$a=function(e){if(this.g+e>this.P.byteLength)throw ui();var t=Re(this.P,this.g,e);return this.g+=e,t},i.skip=function(e){if(this.g+e>this.P.byteLength)throw ui();this.g+=e},i.oe=function(e){if(this.g<e)throw ui();this.g-=e},i.seek=function(e){if(0>e||e>this.P.byteLength)throw ui();this.g=e},i.bc=function(){for(var e=this.g;this.na()&&0!=this.P.getUint8(this.g);)this.g+=1;return e=Re(this.P,e,this.g-e),this.g+=1,vt(e)},V("shaka.util.DataViewReader",si),si.prototype.readTerminatedString=si.prototype.bc,si.prototype.seek=si.prototype.seek,si.prototype.rewind=si.prototype.oe,si.prototype.skip=si.prototype.skip,si.prototype.readBytes=si.prototype.$a,si.prototype.readUint64=si.prototype.Fb,si.prototype.readInt32=si.prototype.me,si.prototype.readUint32=si.prototype.M,si.prototype.readUint16=si.prototype.Eb,si.prototype.readUint8=si.prototype.$,si.prototype.getLength=si.prototype.Ye,si.prototype.getPosition=si.prototype.Z,si.prototype.hasMoreData=si.prototype.na;var li=1;function ci(){this.i=[],this.h=[],this.g=!1}function di(e){for(var t=mi(e);e.reader.na()&&!e.parser.g;)e.parser.Ic(e.start+t,e.reader,e.partialOkay)}function fi(e){for(var t=mi(e),n=e.reader.M(),r=(n=c(te(n))).next();!r.done&&(e.parser.Ic(e.start+t,e.reader,e.partialOkay),!e.parser.g);r=n.next());}function hi(e){return function(t){e(t.reader.$a(t.reader.P.byteLength-t.reader.Z()))}}function pi(e){for(var t=0,n=(e=c(e)).next();!n.done;n=e.next())t=t<<8|n.value.charCodeAt(0);return t}function gi(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)}function mi(e){return 8+(e.has64BitSize?8:0)+(null!=e.flags?4:0)}si.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:li},(i=ci.prototype).box=function(e,t){var n=pi(e);return this.i[n]=vi,this.h[n]=t,this},i.T=function(e,t){var n=pi(e);return this.i[n]=yi,this.h[n]=t,this},i.stop=function(){this.g=!0},i.parse=function(e,t,n){for(e=new si(e,0),this.g=!1;e.na()&&!this.g;)this.Ic(0,e,t,n)},i.Ic=function(e,t,n,r){var i=t.Z();if(r&&i+8>t.P.byteLength)this.g=!0;else{var o=t.M(),a=t.M(),s=!1;switch(o){case 0:o=t.P.byteLength-i;break;case 1:if(r&&t.Z()+8>t.P.byteLength)return void(this.g=!0);o=t.Fb(),s=!0}var u=this.h[a];if(u){var l=null,c=null;if(this.i[a]==yi){if(r&&t.Z()+4>t.P.byteLength)return void(this.g=!0);l=(c=t.M())>>>24,c&=16777215}a=i+o,n&&a>t.P.byteLength&&(a=t.P.byteLength),r&&a>t.P.byteLength?this.g=!0:(r=a-t.Z(),u({parser:this,partialOkay:n||!1,version:l,flags:c,reader:t=new si(t=0<r?t.$a(r):new Uint8Array(0),0),size:o,start:i+e,has64BitSize:s}))}else t.skip(Math.min(i+o-t.Z(),t.P.byteLength-t.Z()))}},V("shaka.util.Mp4Parser",ci),ci.headerSize=mi,ci.typeToString=gi,ci.allData=hi,ci.sampleDescription=fi,ci.children=di,ci.prototype.parseNext=ci.prototype.Ic,ci.prototype.parse=ci.prototype.parse,ci.prototype.stop=ci.prototype.stop,ci.prototype.fullBox=ci.prototype.T,ci.prototype.box=ci.prototype.box;var vi=0,yi=1;function bi(e,t,n,r,i){var o=Ti.value(),a=e.subarray(n.start,n.start+n.size),s=Ne(a),u=new Uint8Array(n.size+o.byteLength);for(u.set(a,0),(a=Ne(u)).setUint32(4,i),u.set(o,n.size),i=s.getUint32(4),a.setUint32(n.size+16,i),wi(u,0,u.byteLength),i=new Uint8Array(e.byteLength+u.byteLength),n=un("Xbox One")?n.start:n.start+n.size,o=e.subarray(n),i.set(e.subarray(0,n)),i.set(u,n),i.set(o,n+u.byteLength),r=(e=c(r)).next();!r.done;r=e.next())wi(i,(r=r.value).start,r.size+u.byteLength);return u=Ne(i,t.start),t=mi(t),e=u.getUint32(t),u.setUint32(t,e+1),i}function wi(e,t,n){0!=(t=(e=Ne(e,t)).getUint32(0))&&(1==t?(e.setUint32(8,n>>32),e.setUint32(12,4294967295&n)):e.setUint32(0,n))}var Ti=new gt((function(){return new Uint8Array([0,0,0,80,115,105,110,102,0,0,0,12,102,114,109,97,0,0,0,0,0,0,0,20,115,99,104,109,0,0,0,0,99,101,110,99,0,1,0,0,0,0,0,40,115,99,104,105,0,0,0,32,116,101,110,99,0,0,0,0,0,0,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])}));function xi(e,t,n,r,i){if(r>=i)return null;for(var o=-1,a=-1,s=0;s<n.length;s++)if(n[s].some((function(e){return null!=e&&""!=e.g.trim()}))){o=s;break}for(s=n.length-1;0<=s;s--)if(n[s].some((function(e){return null!=e&&""!=e.g.trim()}))){a=s;break}if(-1===o||-1===a)return null;for(var u=s=!1,l="white",c="black",d=Si(r,i,s,u,l,c);o<=a;o++){for(var f=n[o],h=-1,p=-1,g=0;g<f.length;g++)if(null!=f[g]&&""!==f[g].g.trim()){h=g;break}for(g=f.length-1;0<=g;g--)if(null!=f[g]&&""!==f[g].g.trim()){p=g;break}if(-1===h||-1===p)f=Ei(r,i),e.nestedCues.push(f);else{for(;h<=p;h++)if(g=f[h]){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=Si(r,i,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),o!==a&&(d=Ei(r,i),e.nestedCues.push(d)),d=Si(r,i,s,u,l,c)}}return e.nestedCues.length?{cue:e,stream:t}:null}function Si(e,t,n,r,i,o){return e=new se(e,t,""),n&&e.textDecoration.push("underline"),r&&(e.fontStyle="italic"),e.color=i,e.backgroundColor=o,e}function Ei(e,t){var n=new se(e,t,"");return n.lineBreak=!0,n}function Ai(e,t,n,r,i){this.g=e,this.l=t,this.i=n,this.h=r,this.j=i}function ki(e,t){this.i=[],this.g=1,this.h=0,this.D=e,this.u=t,this.j=this.m=!1,this.l="white",this.s="black",Ci(this)}function Ii(e,t,n){return xi(new se(t,n,""),"CC"+(e.D<<1|e.u+1),e.i,t,n)}function Ci(e){Ri(e,0,15),e.g=1}function Mi(e,t,n){if(!(32>n||127<n)){var r="";switch(t){case Ni:r=_i.has(n)?_i.get(n):String.fromCharCode(n);break;case Pi:r=Oi.get(n);break;case Li:e.i[e.g].pop(),r=Ui.get(n);break;case ji:e.i[e.g].pop(),r=Fi.get(n)}r&&e.i[e.g].push(new Ai(r,e.m,e.j,e.s,e.l))}}function Di(e,t,n,r){if(t>=n)for(--r;0<=r;r--)e.i[t+r]=e.i[n+r].map((function(e){return e}));else for(var i=0;i<r;i++)e.i[t+i]=e.i[n+i].map((function(e){return e}))}function Ri(e,t,n){for(var r=0;r<=n;r++)e.i[t+r]=[]}var Ni=0,Pi=1,Li=2,ji=3,_i=new Map([[39,"\u2019"],[42,"\xe1"],[92,"\xe9"],[92,"\xe9"],[94,"\xed"],[95,"\xf3"],[96,"\xfa"],[123,"\xe7"],[124,"\xf7"],[125,"\xd1"],[126,"\xf1"],[127,"\u2588"]]),Oi=new Map([[48,"\xae"],[49,"\xb0"],[50,"\xbd"],[51,"\xbf"],[52,"\u2122"],[53,"\xa2"],[54,"\xa3"],[55,"\u266a"],[56,"\xe0"],[57,"\u2800"],[58,"\xe8"],[59,"\xe2"],[60,"\xea"],[61,"\xee"],[62,"\xf4"],[63,"\xfb"]]),Ui=new Map([[32,"\xc1"],[33,"\xc9"],[34,"\xd3"],[35,"\xda"],[36,"\xdc"],[37,"\xfc"],[38,"\u2018"],[39,"\xa1"],[40,"*"],[41,"'"],[42,"\u2500"],[43,"\xa9"],[44,"\u2120"],[45,"\xb7"],[46,"\u201c"],[47,"\u201d"],[48,"\xc0"],[49,"\xc2"],[50,"\xc7"],[51,"\xc8"],[52,"\xca"],[53,"\xcb"],[54,"\xeb"],[55,"\xce"],[56,"\xcf"],[57,"\xef"],[58,"\xd4"],[59,"\xd9"],[60,"\xf9"],[61,"\xdb"],[62,"\xab"],[63,"\xbb"]]),Fi=new Map([[32,"\xc3"],[33,"\xe3"],[34,"\xcd"],[35,"\xcc"],[36,"\xec"],[37,"\xd2"],[38,"\xf2"],[39,"\xd5"],[40,"\xf5"],[41,"{"],[42,"}"],[43,"\\"],[44,"^"],[45,"_"],[46,"|"],[47,"~"],[48,"\xc4"],[49,"\xe4"],[50,"\xd6"],[51,"\xf6"],[52,"\xdf"],[53,"\xa5"],[54,"\xa4"],[55,"\u2502"],[56,"\xc5"],[57,"\xe5"],[58,"\xd8"],[59,"\xf8"],[60,"\u250c"],[61,"\u2510"],[62,"\u2514"],[63,"\u2518"]]);function Bi(e,t){this.h=Gi,this.s=new ki(e,t),this.i=new ki(e,t),this.l=new ki(e,t),this.g=this.i,this.j=0,this.m=null}function Vi(e,t,n){e.g=e.i;var r=e.g,i=null;return e.h!==zi&&e.h!==Xi&&(i=Ii(r,e.j,n),(n=e.i).g=0<n.h?n.h:0,Ri(n,0,15),(n=e.l).g=0<n.h?n.h:0,Ri(n,0,15),r.g=15),e.h=zi,r.h=t,i}function Hi(e){e.h=qi,e.g=e.l,e.g.h=0}function Ki(e){Y("Cea608DataChannel","CEA-608 text mode entered, but is unsupported"),e.g=e.s,e.h=Xi}var Gi=0,qi=1,zi=3,Xi=4,Wi="black green blue cyan red yellow magenta black".split(" "),Yi="white green blue cyan red yellow magenta white_italics".split(" ");function $i(){this.l=!1,this.F=this.J=0,this.H=io,this.i=[],this.g=this.h=this.j=0,this.D=this.s=!1,this.u="white",this.m="black",Ji(this)}function Ji(e){e.i=[];for(var t=0;15>t;t++)e.i.push(Qi())}function Qi(){for(var e=[],t=0;42>t;t++)e.push(null);return e}function Zi(e,t){eo(e)&&(e.i[e.h][e.g]=new Ai(t,e.D,e.s,e.m,e.u),e.g++)}function eo(e){var t=e.g<e.F&&0<=e.g;return e.h<e.J&&0<=e.h&&t}function to(e,t,n){var r=new se(e.j,t,"");return r.textAlign=e.H===no?"left":e.H===ro?"right":ce,(n=xi(r,"svc"+n,e.i,e.j,t))&&(e.j=t),n}$i.prototype.isVisible=function(){return this.l};var no=0,ro=1,io=2;function oo(){this.i=[],this.h=null,this.g=0}function ao(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 so(e.h)),e.h=null,e.g=0))}function so(e){this.g=0,this.h=e}function uo(e){if(!e.na())throw new ze(2,2,3e3);return e.h[e.g++]}function lo(e){this.i=e,this.h=[null,null,null,null,null,null,null,null],this.g=null}function co(e,t,n,r){if(128<=n&&135>=n)r=7&n,e.h[r]&&(e.g=e.h[r]);else{if(136===n){n=uo(t).value,t=null;for(var i=(n=c(fo(e,n))).next();!i.done;i=n.next())(i=e.h[i.value]).isVisible()&&(t=to(i,r,e.i)),Ji(i);return t}if(137===n)for(t=uo(t).value,n=(t=c(fo(e,t))).next();!n.done;n=t.next())(n=e.h[n.value]).isVisible()||(n.j=r),n.l=!0;else{if(138===n){for(n=uo(t).value,t=null,i=(n=c(fo(e,n))).next();!i.done;i=n.next())(i=e.h[i.value]).isVisible()&&(t=to(i,r,e.i)),i.l=!1;return t}if(139===n){for(n=uo(t).value,t=null,i=(n=c(fo(e,n))).next();!i.done;i=n.next())(i=e.h[i.value]).isVisible()?t=to(i,r,e.i):i.j=r,i.l=!i.l;return t}if(140===n)return ho(e,t=uo(t).value,r);if(143===n)return r=ho(e,255,r),po(e),r;if(144===n)t.skip(1),r=uo(t).value,e.g&&(e.g.s=0<(128&r),e.g.D=0<(64&r));else if(145===n)r=uo(t).value,n=uo(t).value,t.skip(1),e.g&&(t=go((48&n)>>4,(12&n)>>2,3&n),e.g.u=go((48&r)>>4,(12&r)>>2,3&r),e.g.m=t);else if(146===n)r=uo(t).value,t=uo(t).value,e.g&&((e=e.g).h=15&r,e.g=63&t);else if(151===n)t.skip(1),t.skip(1),r=uo(t).value,t.skip(1),e.g&&(e.g.H=3&r);else if(152<=n&&159>=n){if(n=(15&n)-8,!(i=null!==e.h[n])){var o=new $i;o.j=r,e.h[n]=o}r=uo(t).value,uo(t),uo(t),o=uo(t).value;var a=uo(t).value;t=uo(t).value,i&&0===(7&t)||((t=e.h[n]).h=0,t.g=0,t.D=!1,t.s=!1,t.u="white",t.m="black"),(t=e.h[n]).l=0<(32&r),t.J=1+(15&o),t.F=1+(63&a),e.g=e.h[n]}}}return null}so.prototype.na=function(){return this.g<this.h.length},so.prototype.Z=function(){return this.g},so.prototype.skip=function(e){if(this.g+e>this.h.length)throw new ze(2,2,3e3);this.g+=e};var fo=function e(t,n){var r;return P(e,(function(e){return 1==e.g&&(r=0),5!=e.g?8>r?1===(1&n)&&t.h[r]?T(e,r,5):e.v(5):e.v(0):(n>>=1,r++,e.v(2))}))};function ho(e,t,n){for(var r=null,i=(t=c(fo(e,t))).next();!i.done;i=t.next()){i=i.value;var o=e.h[i];o.isVisible()&&(r=to(o,n,e.i)),e.h[i]=null}return r}function po(e){e.g=null,e.h=[null,null,null,null,null,null,null,null]}function go(e,t,n){var r={0:0,1:0,2:1,3:1};return vo[(e=r[e])<<2|(t=r[t])<<1|(n=r[n])]}var mo=new Map([[32," "],[33,"\xa0"],[37,"\u2026"],[42,"\u0160"],[44,"\u0152"],[48,"\u2588"],[49,"\u2018"],[50,"\u2019"],[51,"\u201c"],[52,"\u201d"],[53,"\u2022"],[57,"\u2122"],[58,"\u0161"],[60,"\u0153"],[61,"\u2120"],[63,"\u0178"],[118,"\u215b"],[119,"\u215c"],[120,"\u215d"],[121,"\u215e"],[122,"\u2502"],[123,"\u2510"],[124,"\u2514"],[125,"\u2500"],[126,"\u2518"],[127,"\u250c"]]),vo="black blue green cyan red magenta yellow white".split(" ");function yo(){this.h=[],this.g=[],this.i=new oo,this.l=0,this.u=new Map([["CC1",new Bi(0,0)],["CC2",new Bi(0,1)],["CC3",new Bi(1,0)],["CC4",new Bi(1,1)]]),this.s=this.m=0,this.j=new Map,bo(this)}function bo(e){e.m=0,e.s=0;for(var t=(e=c(e.u.values())).next();!t.done;t=e.next())(t=t.value).h=2,t.g=t.i,t.m=null,Ci(t.i),Ci(t.l),Ci(t.s)}function wo(e,t){var n=t.type;if(16===(112&t.Aa)){var r=t.Aa>>3&1;0===n?e.m=r:e.s=r}if(n=e.u.get("CC"+(n<<1|(n?e.s:e.m)+1)),255===t.Aa&&255===t.Pa||!t.Aa&&!t.Pa||!xo(t.Aa)||!xo(t.Pa))return 45<=++e.l&&bo(e),null;if(e.l=0,t.Aa&=127,t.Pa&=127,!t.Aa&&!t.Pa)return null;if(r=null,16===(112&t.Aa))e:{var i=t.Aa;if(r=t.Pa,n.m===(i<<8|r))n.m=null;else if(n.m=i<<8|r,16===(240&i)&&64===(192&r)){i=[11,11,1,2,3,4,12,13,14,15,5,6,7,8,9,10][(7&i)<<1|r>>5&1];var o=(30&r)>>1,a="white",s=!1;if(7>o?a=Yi[o]:7===o&&(s=!0),r=1===(1&r),n.h!==Xi){if(o=n.g,n.h===zi&&i!==o.g){var u=1+i-o.h;Di(o,u,1+o.g-o.h,o.h),Ri(o,0,u-1),Ri(o,i+1,15-i)}o.g=i,n.g.m=r,n.g.j=s,n.g.l=a,n.g.s="black"}}else if(17===(247&i)&&32===(240&r))n.g.m=!1,n.g.j=!1,n.g.l="white",Mi(n.g,Ni,32),a=!1,"white_italics"===(i=Yi[(14&r)>>1])&&(i="white",a=!0),n.g.m=1===(1&r),n.g.j=a,n.g.l=i;else if(16===(247&i)&&32===(240&r)||23===(247&i)&&45===(255&r))a="black",0===(7&i)&&(a=Wi[(14&r)>>1]),n.g.s=a;else if(17===(247&i)&&48===(240&r))Mi(n.g,Pi,r);else if(18===(246&i)&&32===(224&r))Mi(n.g,1&i?ji:Li,r);else if(20===(246&i)&&32===(240&r)){switch(r=t.pts,i=null,t.Pa){case 32:Hi(n);break;case 33:(n=n.g).i[n.g].pop();break;case 37:i=Vi(n,2,r);break;case 38:i=Vi(n,3,r);break;case 39:i=Vi(n,4,r);break;case 40:Mi(n.g,Ni,32);break;case 41:n.h=2,n.g=n.i,n.g.h=0,n.j=r;break;case 42:Ci(n.s),Ki(n);break;case 43:Ki(n);break;case 44:i=n.i,a=null,n.h!==Xi&&(a=Ii(i,n.j,r)),Ri(i,0,15),i=a;break;case 45:i=n.g,n.h!==zi?i=null:(a=Ii(i,n.j,r),Di(i,(s=i.g-i.h+1)-1,s,i.h),Ri(i,0,s-1),Ri(i,i.g,15-i.g),n.j=r,i=a);break;case 46:Ri(n.l,0,15);break;case 47:i=null,n.h!==Xi&&(i=Ii(n.i,n.j,r)),a=n.l,n.l=n.i,n.i=a,Hi(n),n.j=r}r=i;break e}r=null}else i=t.Pa,Mi(n.g,Ni,t.Aa),Mi(n.g,Ni,i);return r}function To(e,t){var n=[];try{for(;t.na();){var r=uo(t).value,i=(224&r)>>5,o=31&r;if(7===i&&0!=o&&(i=63&uo(t).value),0!=i){e.j.has(i)||e.j.set(i,new lo(i));for(var a=e.j.get(i),s=t.Z();t.Z()-s<o;){var u=uo(i=t),l=u.value,c=u.pts;if(16===l)l=l<<16|uo(i).value;if(0<=l&&31>=l){var d=c;if(a.g){var f=a.g;switch(i=null,l){case 8:!eo(f)||0>=f.g&&0>=f.h||(0>=f.g?(f.g=f.F-1,f.h--):f.g--,f.i[f.h][f.g]=null);break;case 13:if(f.isVisible()&&(i=to(f,d,a.i)),f.h+1>=f.J){d=f;for(var h=0,p=1;15>p;p++,h++)d.i[h]=d.i[p];for(p=0;1>p;p++,h++)d.i[h]=Qi()}else f.h++;f.g=0;break;case 14:f.isVisible()&&(i=to(f,d,a.i)),f.i[f.h]=Qi(),f.g=0;break;case 12:f.isVisible()&&(i=to(f,d,a.i)),Ji(f),(d=f).h=0,d.g=0}var g=i}else g=null}else if(128<=l&&159>=l)g=co(a,i,l,c);else{if(4096<=l&&4127>=l)8<=(d=255&l)&&15>=d?i.skip(1):16<=d&&23>=d?i.skip(2):24<=d&&31>=d&&i.skip(3);else if(4224<=l&&4255>=l)128<=(d=255&l)&&135>=d?i.skip(4):136<=d&&143>=d&&i.skip(5);else if(32<=l&&127>=l)i=l,a.g&&Zi(a.g,127===i?"\u266a":String.fromCharCode(i));else if(160<=l&&255>=l)a.g&&Zi(a.g,String.fromCharCode(l));else if(4128<=l&&4223>=l){if(i=255&l,a.g)if(mo.has(i)){var m=mo.get(i);Zi(a.g,m)}else Zi(a.g,"_")}else 4256<=l&&4351>=l&&a.g&&Zi(a.g,160!=(255&l)?"_":"[CC]");g=null}(i=g)&&n.push(i)}}}}catch(v){if(!(v instanceof ze&&3e3===v.code))throw v;Y("CEA708_INVALID_DATA","Buffer read out of bounds / invalid CEA-708 Data.")}return n}function xo(e){for(var t=0;e;)t^=1&e,e>>=1;return 1===t}function So(){}var Eo=function e(t,n){var r,i,o,a;return P(e,(function(e){if(1==e.g){for(var t=n,s=0,u=0;u<t.length;)2==s&&3==t[u]?(s=0,(t=[].concat(d(t))).splice(u,1),t=new Uint8Array(t)):0==t[u]?s++:s=0,u++;r=t,i=0}if(4!=e.g){if(!(i<r.length))return e.v(0);for(o=0;255==r[i];)o+=255,i++;for(o+=r[i++],a=0;255==r[i];)a+=255,i++;return a+=r[i++],4!=o?e.v(4):T(e,r.subarray(i,i+a),4)}return i+=a,e.v(2)}))};function Ao(e,t){var n=null,r=null,i=e.M();return 1&t&&e.skip(8),2&t&&e.skip(4),8&t&&(n=e.M()),16&t&&(r=e.M()),{trackId:i,Yd:n,Oe:r}}function ko(e,t){return{hd:1==t?e.Fb():e.M()}}function Io(e,t){return 1==t?(e.skip(8),e.skip(8)):(e.skip(4),e.skip(4)),{timescale:e.M()}}function Co(e,t,n){var r=e.M(),i=[];1&n&&e.skip(4),4&n&&e.skip(4);for(var o=c(te(r)),a=o.next();!a.done;a=o.next())a={Id:null,sampleSize:null,Kc:null},256&n&&(a.Id=e.M()),512&n&&(a.sampleSize=e.M()),1024&n&&e.skip(4),2048&n&&(a.Kc=0==t?e.M():e.me()),i.push(a);return{Eg:r,pe:i}}function Mo(){this.j=new So,this.i=new Map,this.h=this.g=0}function Do(){this.h=new Mo,this.g=new yo}function Ro(e,t){for(var n=e.h.parse(t),r=(n=c(n)).next();!r.done;r=n.next()){var i=r.value,o=Re(i.Cf);if(0<o.length&&(r=e.g,i=i.pts,181===(o=new si(o,0)).$()&&49===o.Eb()&&1195456820===o.M()&&3===o.$())){var a=o.$();if(0!==(64&a)){a&=31,o.skip(1);for(var s=0;s<a;s++){var u=o.$(),l=(4&u)>>2,f=o.$(),h=o.$();l&&(0===(u&=3)||1===u?r.h.push({pts:i,type:u,Aa:f,Pa:h,order:r.h.length}):(r.g.push({pts:i,type:u,value:f,order:r.g.length}),r.g.push({pts:i,type:2,value:h,order:r.g.length})))}}}}return function(e){function t(e,t){return e.pts-t.pts||e.order-t.order}var n=[];e.h.sort(t),e.g.sort(t);for(var r=c(e.h),i=r.next();!i.done;i=r.next())(i=wo(e,i.value))&&n.push(i);for(i=(r=c(e.g)).next();!i.done;i=r.next())ao(e.i,i.value);for(i=(r=c(e.i.i)).next();!i.done;i=r.next())i=To(e,i.value),n.push.apply(n,d(i));return e.i.i=[],e.h=[],e.g=[],n}(e.g)}function No(e){return!e||1==e.length&&1e-6>e.end(0)-e.start(0)?null:e.length?e.end(e.length-1):null}function Po(e,t,n){return n=void 0===n?0:n,!(!e||!e.length||1==e.length&&1e-6>e.end(0)-e.start(0)||t>e.end(e.length-1))&&t+n>=e.start(0)}function Lo(e,t){if(!e||!e.length||1==e.length&&1e-6>e.end(0)-e.start(0))return 0;for(var n=0,r=c(jo(e)),i=r.next();!i.done;i=r.next()){var o=i.value;i=o.start,(o=o.end)>t&&(n+=o-Math.max(i,t))}return n}function jo(e){if(!e)return[];for(var t=[],n=c(te(e.length)),r=n.next();!r.done;r=n.next())r=r.value,t.push({start:e.start(r),end:e.end(r)});return t}function _o(e,t,n,r){var i=this;this.g=e,this.m=n,this.j={},this.J={},this.i=null,this.L=r||function(){},this.l={},this.h=new Sr,this.u={},this.D=t,this.F=new pt,this.s=function(e,t){var n=new MediaSource;return e.h.wa(n,"sourceopen",(function(){URL.revokeObjectURL(e.H),t.resolve()})),e.H=$o(n),e.g.src=e.H,n}(this,this.F),this.I=new Tr((function(){return function(e){var t,n,r,i,o,a,s;return L((function(u){if(1==u.g){for(n in t=[],e.l)for(r=e.l[n],i=r[0],e.l[n]=r.slice(0,1),i&&t.push(i.p.catch(Be)),o=c(r.slice(1)),a=o.next();!a.done;a=o.next())a.value.p.reject(new ze(2,7,7003,void 0));for(s in e.i&&t.push(e.i.destroy()),e.m&&t.push(e.m.destroy()),e.u)t.push(e.u[s].destroy());return T(u,Promise.all(t),2)}e.h&&(e.h.release(),e.h=null),e.g&&(e.g.removeAttribute("src"),e.g.load(),e.g=null),e.s=null,e.i=null,e.m=null,e.j={},e.u={},e.D=null,e.l={},x(u)}))}(i)})),this.H=""}function Oo(e,t){e.i||(e.i=new Ut(e.m)),"application/cea-608"!=t&&"application/cea-708"!=t&&(e.i.s=He(Ht[t]))}function Uo(e){return!e.s||"ended"==e.s.readyState}function Fo(e,t){if(t==dt)var n=e.i.g;else n=!(n=Vo(e,t))||1==n.length&&1e-6>n.end(0)-n.start(0)?null:1==n.length&&0>n.start(0)?0:n.length?n.start(0):null;return n}function Bo(e,t){return t==dt?e.i.h:No(Vo(e,t))}function Vo(e,t){try{return e.j[t].buffered}catch(n){return null}}function Ho(e,t,n,r,i,o){var a,s,u,l,d,f,h,p;return L((function(g){return 1==g.g?t==(a=ft).aa?T(g,function(e,t,n,r){var i,o,a;return L((function(s){return 1==s.g?T(s,Promise.resolve(),2):e.s&&e.i?null==n||null==r?(e.s.parseInit(Re(t)),s.return()):(i={periodStart:e.D,segmentStart:n,segmentEnd:r},o=e.s.parseMedia(Re(t),i),a=o.filter((function(t){return t.startTime>=e.j&&t.startTime<e.l})),e.i.append(a),null==e.g&&(e.g=Math.max(n,e.j)),e.h=Math.min(r,e.l),void x(s)):s.return()}))}(e.i,n,r,i),0):e.u[t]?T(g,function(e,t){e.l=!0,e.h=new pt,e.m=[],e.j=[],e.i=[];var n=Re(t);return e.g.push(n),e.g.flush(),e.l&&e.h.reject(new ze(2,3,3018)),e.h}(e.u[t],n),10):o?(e.i||Oo(e,"text/vtt"),null==r&&null==i?e.D.init(n):(s=Ro(e.D,n)).length&&(u=e.j[a.Na].timestampOffset,Vt(e.i,s,r,i,u)),n=Yo(e,n,r,t),T(g,qo(e,t,(function(){e.j[t].appendBuffer(n)})),0)):(n=Yo(e,n,r,t),T(g,qo(e,t,(function(){e.j[t].appendBuffer(n)})),0)):(l=g.h,e.i||Oo(e,"text/vtt"),l.metadata&&(d=e.j[t].timestampOffset,e.L(l.metadata,d,i)),l.captions&&l.captions.length&&(f=e.j[a.Na].timestampOffset,h=function(e){for(var t=[],n=(e=c(e)).next();!n.done;n=e.next())n=n.value,t.push({stream:n.stream,cue:new se(n.startTime,n.endTime,n.text)});return t}(l.captions),Vt(e.i,h,r,i,f)),p=l.data,p=Yo(e,p,r,t),T(g,qo(e,t,(function(){e.j[t].appendBuffer(p)})),0))}))}function Ko(e,t){return L((function(n){return t==ft.aa?e.i?T(n,e.i.remove(0,1/0),0):n.return():T(n,qo(e,t,(function(){var n=e.s.duration;0>=n?Go(e,t):e.j[t].remove(0,n)})),0)}))}function Go(e,t){var n=e.l[t][0];n&&(n.p.resolve(),Xo(e,t))}function qo(e,t,n){return xr(e.I),n={start:n,p:new pt},e.l[t].push(n),1==e.l[t].length&&Wo(e,t),n.p}function zo(e,t){var n,r,i,o,a;return L((function(s){switch(s.g){case 1:for(i in xr(e.I),n=[],r={},e.j)r.Kb=new pt,o={start:function(e){return function(){return e.Kb.resolve()}}(r),p:r.Kb},e.l[i].push(o),n.push(r.Kb),1==e.l[i].length&&o.start(),r={Kb:r.Kb};return S(s,2),T(s,Promise.all(n),4);case 4:A(s,3);break;case 2:throw k(s);case 3:try{t()}catch(u){throw new ze(2,3,3015,u)}finally{for(a in e.j)Xo(e,a)}x(s)}}))}function Xo(e,t){e.l[t].shift(),Wo(e,t)}function Wo(e,t){var n=e.l[t][0];if(n)try{n.start()}catch(r){"QuotaExceededError"==r.name?n.p.reject(new ze(2,3,3017,t)):n.p.reject(new ze(2,3,3015,r)),Xo(e,t)}}function Yo(e,t,n,r){var i=e.g.mediaKeys;return null==n&&i&&(rn()||un("Xbox One"))&&"mp4"==e.J[r].split(";")[0].split("/")[1]&&(t=function(e){function t(){i=!0}function n(e){o.push(e),di(e)}e=Re(e);var r,i=!1,o=[],a=[];if((new ci).box("moov",n).box("trak",n).box("mdia",n).box("minf",n).box("stbl",n).T("stsd",(function(e){r=e,o.push(e),fi(e)})).T("encv",t).T("enca",t).T("avc1",(function(e){a.push({box:e,Zb:1701733238})})).T("avc3",(function(e){a.push({box:e,Zb:1701733238})})).T("ac-3",(function(e){a.push({box:e,Zb:1701733217})})).T("ec-3",(function(e){a.push({box:e,Zb:1701733217})})).T("mp4a",(function(e){a.push({box:e,Zb:1701733217})})).parse(e),i)return e;if(0==a.length||!r)throw Ct(e),new ze(2,3,3019);a.reverse();for(var s=c(a),u=s.next();!u.done;u=s.next())u=u.value,e=bi(e,r,u.box,o,u.Zb);return e}(t)),t}Mo.prototype.init=function(e){var t=this,n=[],r=[];if((new ci).box("moov",di).box("mvex",di).T("trex",(function(e){var n=e.reader;n.skip(4),n.skip(4),e=n.M(),n=n.M(),t.g=e,t.h=n})).box("trak",di).T("tkhd",(function(e){var t=e.reader;1==e.version?(t.skip(8),t.skip(8)):(t.skip(4),t.skip(4)),e=t.M(),n.push(e)})).box("mdia",di).T("mdhd",(function(e){e=Io(e.reader,e.version),r.push(e.timescale)})).parse(e,!0),!n.length||!r.length||n.length!=r.length)throw new ze(2,2,2010);n.forEach((function(e,n){t.i.set(e,r[n])}))},Mo.prototype.parse=function(e){var t=this,n=[],r=this.g,i=this.h,o=[],a=null,s=9e4;return(new ci).box("moof",di).box("traf",di).T("trun",(function(e){o=Co(e.reader,e.version,e.flags).pe})).T("tfhd",(function(e){e=Ao(e.reader,e.flags),r=e.Yd||t.g,i=e.Oe||t.h,e=e.trackId,t.i.has(e)&&(s=t.i.get(e))})).T("tfdt",(function(e){a=ko(e.reader,e.version).hd})).box("mdat",(function(e){if(null===a)throw new ze(2,2,2010);e=e.reader;var u=a,l=s,d=r,f=i,h=o,p=0,g=f;for(h.length&&(g=h[0].sampleSize||f);e.na();){var m=e.M();if(6==(31&e.$())){var v=0;h.length>p&&(v=h[p].Kc||0),v=(u+v)/l;for(var y=c(Eo(t.j,e.$a(m-1))),b=y.next();!b.done;b=y.next())n.push({Cf:b.value,pts:v})}else e.skip(m-1);0==(g-=m+4)&&(u=h.length>p?u+(h[p].Id||d):u+d,p++,g=h.length>p&&h[p].sampleSize||f)}})).parse(e,!1),n},Do.prototype.init=function(e){this.h.init(e)},(i=_o.prototype).destroy=function(){return this.I.destroy()},i.init=function(e,t){var n,r,i,o,a,s,u,l=this;return L((function(d){if(1==d.g)return n=ft,T(d,l.F,2);for(r={},i=c(e.keys()),o=i.next();!o.done;r={sa:r.sa},o=i.next())r.sa=o.value,a=e.get(r.sa),s=Lt(a.mimeType,a.codecs),r.sa==n.aa?Oo(l,s):(!t&&MediaSource.isTypeSupported(s)||!Rt(s,r.sa)||(l.u[r.sa]=new Dt,s=Pt(r.sa,s)),u=l.s.addSourceBuffer(s),l.h.A(u,"error",function(e){return function(){l.l[e.sa][0].p.reject(new ze(2,3,3014,l.g.error?l.g.error.code:0))}}(r)),l.h.A(u,"updateend",function(e){return function(){return Go(l,e.sa)}}(r)),l.j[r.sa]=u,l.J[r.sa]=s,l.l[r.sa]=[]);x(d)}))},i.xc=function(){var e={total:jo(this.g.buffered),audio:jo(Vo(this,"audio")),video:jo(Vo(this,"video")),text:[]};if(this.i){var t=this.i.g,n=this.i.h;null!=t&&null!=n&&e.text.push({start:t,end:n})}return e},i.remove=function(e,t,n){var r=this;return L((function(i){return T(i,e==ft.aa?r.i.remove(t,n):qo(r,e,(function(){n<=t?Go(r,e):r.j[e].remove(t,n)})),0)}))},i.flush=function(e){var t=this;return L((function(n){return e==ft.aa?n.return():T(n,qo(t,e,(function(){t.g.currentTime-=.001,Go(t,e)})),0)}))},i.endOfStream=function(e){var t=this;return L((function(n){return T(n,zo(t,(function(){Uo(t)||(e?t.s.endOfStream(e):t.s.endOfStream())})),0)}))},i.Ja=function(e){var t=this;return L((function(n){return T(n,zo(t,(function(){t.s.duration=e})),0)}))},i.getDuration=function(){return this.s.duration};var $o=e.URL.createObjectURL;function Jo(e,t,n){this.ma=e,this.ja=t,this.ea=n}function Qo(e,t,n,r,i,o,a,s,u,l,c){l=void 0===l?[]:l,this.startTime=e,this.j=this.endTime=t,this.i=n,this.ja=r,this.ea=i,this.h=o,this.timestampOffset=a,this.appendWindowStart=s,this.appendWindowEnd=u,this.g=l,this.tilesLayout=void 0===c?"":c}function Zo(e,t,n){this.j=e,this.Jc=t,this.m=this.l=1/0,this.g=1,this.h=this.i=null,this.s=0,this.u=!0,this.D=0,this.F=void 0===n||n,this.H=0}function ea(e,t){this.j=e,this.m=na(e),this.g=e.g.currentTime,this.l=Date.now()/1e3,this.h=!1,this.s=t,this.i=function(){}}function ta(e){this.g=e}function na(e){if(e.g.paused||0==e.g.playbackRate||0==e.g.buffered.length)var t=!1;else e:{t=e.g.currentTime;for(var n=(e=c(jo(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 ra(e,t,n,r,i){var o=this;this.g=e,this.D=t,this.o=n,this.u=i,this.h=new Sr,this.s=!1,this.F=e.readyState,this.j=!1,this.i=r,this.m=!1,this.h.A(e,"waiting",(function(){return ia(o)})),this.l=new en((function(){ia(o)})).Ca(.25)}function ia(e){if(0!=e.g.readyState){if(e.g.seeking){if(!e.s)return}else e.s=!1;if(!e.g.paused||0==e.g.currentTime&&(e.g.autoplay||0!=e.g.currentTime)){var t;if(e.g.readyState!=e.F&&(e.j=!1,e.F=e.g.readyState),!(t=!e.i)){var n=(t=e.i).j,r=na(n),i=n.g.currentTime,o=Date.now()/1e3;t.g==i&&t.m==r||(t.l=o,t.g=i,t.m=r,t.h=!1),(r=(i=o-t.l)>=t.s&&r&&!t.h)&&(t.i(t.g,i),t.h=!0,t.g=n.g.currentTime),t=!r}if(t){var a=e.o.smallGapLimit;if(i=e.g.currentTime,!(null==(n=function(e,t,n){return!e||!e.length||1==e.length&&1e-6>e.end(0)-e.start(0)?null:0<=(e=jo(e).findIndex((function(e,r,i){return e.start>t&&(0==r||i[r-1].end-t<=n)})))?e:null}(t=e.g.buffered,i,e.o.gapDetectionThreshold))||0==n&&!e.m||(r=t.start(n),r>=e.D.Qa()))){a=(o=r-i)<=a;var s=!1;.001>o||(a||e.j||(e.j=!0,(i=new ar("largegap",{currentTime:i,gapSize:o})).cancelable=!0,e.u(i),e.o.jumpLargeGaps&&!i.defaultPrevented&&(s=!0)),!a&&!s)||(0!=n&&t.end(n-1),e.g.currentTime=r)}}}}}function oa(e,t,n,r){t==HTMLMediaElement.HAVE_NOTHING||e.readyState>=t?r():(t=aa.value().get(t),n.wa(e,t,r))}Jo.prototype.Wb=function(){return this.ja},Jo.prototype.Sb=function(){return this.ea},V("shaka.media.InitSegmentReference",Jo),Jo.prototype.getEndByte=Jo.prototype.Sb,Jo.prototype.getStartByte=Jo.prototype.Wb,(i=Qo.prototype).ma=function(){return this.i()},i.jf=function(){return this.startTime},i.We=function(){return this.endTime},i.Wb=function(){return this.ja},i.Sb=function(){return this.ea},i.pf=function(){return this.tilesLayout},V("shaka.media.SegmentReference",Qo),Qo.prototype.getTilesLayout=Qo.prototype.pf,Qo.prototype.getEndByte=Qo.prototype.Sb,Qo.prototype.getStartByte=Qo.prototype.Wb,Qo.prototype.getEndTime=Qo.prototype.We,Qo.prototype.getStartTime=Qo.prototype.jf,Qo.prototype.getUris=Qo.prototype.ma,(i=Zo.prototype).getDuration=function(){return this.l},i.bf=function(){return this.g},i.Ja=function(e){this.l=e},i.hf=function(){return this.j},i.ue=function(e){this.s=e},i.fc=function(e){this.u=e},i.Pd=function(e){this.m=e},i.Sf=function(e){this.Jc=e},i.Ve=function(){return this.Jc},i.Bb=function(e){if(0!=e.length){var t=e[e.length-1].endTime;this.zd(e[0].startTime),this.g=e.reduce((function(e,t){return Math.max(e,t.endTime-t.startTime)}),this.g),this.h=Math.max(this.h,t),null!=this.j&&this.F&&(this.j=(Date.now()+this.s)/1e3-this.h-this.g)}},i.zd=function(e){this.i=null==this.i?e:Math.min(this.i,e)},i.yd=function(e){this.g=Math.max(this.g,e)},i.offset=function(e){null!=this.i&&(this.i+=e),null!=this.h&&(this.h+=e)},i.X=function(){return 1/0==this.l&&!this.u},i.kb=function(){return 1/0!=this.l&&!this.u},i.Za=function(){return Math.max(this.D,this.gb()-this.m)},i.ve=function(e){this.D=e},i.gb=function(){return this.X()||this.kb()?Math.min(Math.max(0,(Date.now()+this.s)/1e3-this.g-this.j)+this.H,this.l):this.h||this.l},i.Vb=function(e){var t=Math.max(this.i,this.D);return 1/0==this.m?Math.ceil(1e3*t)/1e3:Math.max(t,Math.min(this.gb()-this.m+e,this.Qa()))},i.yb=function(){return this.Vb(0)},i.Qa=function(){return Math.max(0,this.gb()-(this.X()||this.kb()?this.Jc:0))},i.ye=function(){return!(null==this.j||null!=this.h&&this.F)},i.te=function(e){this.H=e},V("shaka.media.PresentationTimeline",Zo),Zo.prototype.setAvailabilityTimeOffset=Zo.prototype.te,Zo.prototype.usingPresentationStartTime=Zo.prototype.ye,Zo.prototype.getSeekRangeEnd=Zo.prototype.Qa,Zo.prototype.getSeekRangeStart=Zo.prototype.yb,Zo.prototype.getSafeSeekRangeStart=Zo.prototype.Vb,Zo.prototype.getSegmentAvailabilityEnd=Zo.prototype.gb,Zo.prototype.setUserSeekStart=Zo.prototype.ve,Zo.prototype.getSegmentAvailabilityStart=Zo.prototype.Za,Zo.prototype.isInProgress=Zo.prototype.kb,Zo.prototype.isLive=Zo.prototype.X,Zo.prototype.offset=Zo.prototype.offset,Zo.prototype.notifyMaxSegmentDuration=Zo.prototype.yd,Zo.prototype.notifyMinSegmentStartTime=Zo.prototype.zd,Zo.prototype.notifySegments=Zo.prototype.Bb,Zo.prototype.getDelay=Zo.prototype.Ve,Zo.prototype.setDelay=Zo.prototype.Sf,Zo.prototype.setSegmentAvailabilityDuration=Zo.prototype.Pd,Zo.prototype.setStatic=Zo.prototype.fc,Zo.prototype.setClockOffset=Zo.prototype.ue,Zo.prototype.getPresentationStartTime=Zo.prototype.hf,Zo.prototype.setDuration=Zo.prototype.Ja,Zo.prototype.getMaxSegmentDuration=Zo.prototype.bf,Zo.prototype.getDuration=Zo.prototype.getDuration,ea.prototype.release=function(){this.j=null,this.i=function(){}},ra.prototype.release=function(){this.h&&(this.h.release(),this.h=null),null!=this.l&&(this.l.stop(),this.l=null),this.i&&(this.i.release(),this.i=null),this.g=this.D=this.u=null},ra.prototype.Dd=function(){this.m=!0,ia(this)};var aa=new gt((function(){return new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]])}));function sa(e,t,n){var r=this;this.g=e,this.l=t,this.j=n,this.m=!1,this.h=new Sr,this.i=new fa(e),oa(this.g,HTMLMediaElement.HAVE_METADATA,this.h,(function(){ca(r,r.j)}))}function ua(e){return e.m?e.g.currentTime:e.j}function la(e,t){0<e.g.readyState?ha(e.i,t):oa(e.g,HTMLMediaElement.HAVE_METADATA,e.h,(function(){ca(e,e.j)}))}function ca(e,t){.001>Math.abs(e.g.currentTime-t)?da(e):(e.h.wa(e.g,"seeking",(function(){da(e)})),ha(e.i,0==e.g.currentTime?t:e.g.currentTime))}function da(e){e.m=!0,e.h.A(e.g,"seeking",(function(){return e.l()}))}function fa(e){var t=this;this.h=e,this.m=10,this.l=this.j=this.i=0,this.g=new en((function(){0>=t.i||t.h.currentTime!=t.j?t.g.stop():(t.h.currentTime=t.l,t.i--)}))}function ha(e,t){e.j=e.h.currentTime,e.l=t,e.i=e.m,e.h.currentTime=t,e.g.Ca(.1)}function pa(e){var t=this;this.g=e,this.j=!1,this.i=null,this.h=new Sr,oa(this.g,HTMLMediaElement.HAVE_CURRENT_DATA,this.h,(function(){null==t.i||0==t.i?t.j=!0:(t.h.wa(t.g,"seeking",(function(){t.j=!0})),t.g.currentTime=Math.max(0,t.g.currentTime+t.i))}))}function ga(e,t,n,r,i,o){var a=this;this.i=e,this.g=t.presentationTimeline,this.H=t.minBufferTime||0,this.o=n,this.D=i,this.u=null,this.j=new ra(e,t.presentationTimeline,n,function(e,t){if(!t.stallEnabled)return null;var n=t.stallSkip,r=new ea(new ta(e),t.stallThreshold);return function(e,t){e.i=t}(r,(function(){n?e.currentTime+=n:(e.pause(),e.play())})),r}(e,n),o),this.h=new sa(e,(function(){var e=a.j;e.s=!0,e.m=!1,e.j=!1;var t=ua(a.h);return e=va(a,t),.001<Math.abs(e-t)&&(t=Date.now()/1e3,!a.u||a.u<t-1)?(a.u=t,la(a.h,e),e=void 0):(a.D(),e=void 0),e}),function(e,t){return null==t?t=1/0>e.g.getDuration()?e.g.yb():e.g.Qa():0>t&&(t=e.g.Qa()+t),ma(e,ya(e,t))}(this,r)),this.s=new en((function(){if(0!=a.i.readyState&&!a.i.paused){var e=ua(a.h),t=a.g.yb(),n=a.g.Qa();3>n-t&&(t=n-3),e<t&&(e=va(a,e),a.i.currentTime=e)}})).Ca(.25)}function ma(e,t){var n=e.g.getDuration();return t>=n?n-e.o.durationBackoff:t}function va(e,t){var n=Math.max(e.H,e.o.rebufferingGoal),r=e.o.safeSeekOffset,i=e.g.yb(),o=e.g.Qa(),a=e.g.getDuration();3>o-i&&(i=o-3);var s=e.g.Vb(n),u=e.g.Vb(r);return n=e.g.Vb(n+r),t>=a?ma(e,t):t>o?o:t<i?Po(e.i.buffered,u)?u:n:t>=s||Po(e.i.buffered,t)?t:n}function ya(e,t){var n=e.g.yb();return t<n||t>(n=e.g.Qa())?n:t}function ba(e){this.g=e,this.h=null,this.i=0,this.j=!1}function wa(e,t,n){return new ba([new Qo(e,e+t,(function(){return n}),0,null,null,e,e,e+t)])}function Ta(e,t,n){this.i=e,this.h=t,this.g=n}function xa(){ba.call(this,[]),this.l=[]}function Sa(e){var t=this;this.g=e,this.j=!1,this.i=this.g.Bc(),this.h=new en((function(){t.g.ke(.25*t.i)}))}function Ea(e){e.h.stop();var t=e.j?0:e.i;if(0<=t)try{return void(e.g.Bc()!=t&&e.g.Od(t))}catch(n){}e.h.Ca(.25),0!=e.g.Bc()&&e.g.Od(0)}function Aa(e){var t=this;this.h=e,this.g=new Set,this.i=new en((function(){ka(t,!1)})).Ca(.25)}function ka(e,t){for(var n=c(e.g),r=n.next();!r.done;r=n.next()){r=r.value;for(var i=e.h.currentTime,o=t,a=c(r.l.g),s=a.next();!s.done;s=a.next()){s=s.value;var u=r.j.get(s),l=i<s.startTime?Ma:i>s.endTime?Ra:Da;r.j.set(s,l);for(var d=c(r.m),f=d.next();!f.done;f=d.next())(f=f.value).sb==u&&f.rb==l&&f.jb(s,o)}}}function Ia(e){var t=this;this.h=function(){},this.g=new Set,this.j=e,this.i=new en((function(){for(var e=t.j(),n=c(t.g),r=n.next();!r.done;r=n.next())(r=r.value).endTime<e.start&&t.g.delete(r)})).Ca(2)}function Ca(e){var t=this;this.l=e,this.j=new Map,this.g=function(){},this.h=function(){},this.i=function(){},this.m=[{sb:null,rb:Da,jb:function(e,n){return t.g(e,n)}},{sb:Ma,rb:Da,jb:function(e,n){return t.g(e,n)}},{sb:Ra,rb:Da,jb:function(e,n){return t.g(e,n)}},{sb:Da,rb:Ma,jb:function(e,n){return t.h(e,n)}},{sb:Da,rb:Ra,jb:function(e,n){return t.h(e,n)}},{sb:Ma,rb:Ra,jb:function(e,n){return t.i(e,n)}},{sb:Ra,rb:Ma,jb:function(e,n){return t.i(e,n)}}]}sa.prototype.release=function(){this.h&&(this.h.release(),this.h=null),null!=this.i&&(this.i.release(),this.i=null),this.l=function(){},this.g=null},fa.prototype.release=function(){this.g&&(this.g.stop(),this.g=null),this.h=null},pa.prototype.release=function(){this.h&&(this.h.release(),this.h=null),this.g=null},pa.prototype.m=function(e){this.i=this.j?this.i:e},pa.prototype.l=function(){return(this.j?this.g.currentTime:this.i)||0},pa.prototype.F=function(){},ga.prototype.release=function(){this.h&&(this.h.release(),this.h=null),this.j&&(this.j.release(),this.j=null),this.s&&(this.s.stop(),this.s=null),this.i=this.h=this.g=this.o=null,this.D=function(){}},ga.prototype.m=function(e){la(this.h,e)},ga.prototype.l=function(){var e=ua(this.h);return 0<this.i.readyState&&!this.i.paused?ya(this,e):e},ga.prototype.F=function(){this.j.Dd()},(i=ba.prototype).destroy=function(){return je("shaka.media.SegmentIndex","Please use release() instead of destroy()."),this.release(),Promise.resolve()},i.release=function(){this.j||(this.g=[],this.h&&this.h.stop(),this.h=null)},i.vf=function(){this.j=!0},i.find=function(e){for(var t=this.g.length-1,n=t;0<=n;--n){var r=this.g[n],i=n<t?this.g[n+1].startTime:r.endTime;if(e>=r.startTime&&e<i)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.j)for(var t=c(this.g),n=t.next();!n.done;n=t.next())(n=n.value).startTime+=e,n.endTime+=e,n.timestampOffset+=e},i.Ec=function(e){!this.j&&e.length&&(this.g=this.g.filter((function(t){return t.startTime<e[0].startTime})),this.g.push.apply(this.g,d(e)))},i.Ab=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.Ec(e),this.eb(t)},i.eb=function(e){if(!this.j){var t=this.g.length;this.g=this.g.filter((function(t){return t.endTime>e})),this.i+=t-this.g.length}},i.Ya=function(e,t,n){if(n=void 0!==n&&n,!this.j){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&&(e=this.g[this.g.length-1],this.g[this.g.length-1]=new Qo(e.startTime,t,e.i,e.ja,e.ea,e.h,e.timestampOffset,e.appendWindowStart,e.appendWindowEnd,e.g,e.tilesLayout))}},i.Mc=function(e,t){var n=this;this.j||(this.h&&this.h.stop(),this.h=new en((function(){var e=t();e?n.g.push.apply(n.g,d(e)):(n.h.stop(),n.h=null)})),this.h.Ca(e))},ba.prototype[Symbol.iterator]=function(){return this.xb(0)},ba.prototype.xb=function(e){var t=this.find(e);if(null==t)return null;t--;var n=this.get(t+1),r=-1;if(n&&0<n.g.length)for(var i=n.g.length-1;0<=i;--i){var o=n.g[i];if(e>=o.startTime&&e<o.endTime){t++,r=i-1;break}}return new Ta(this,t,r)},V("shaka.media.SegmentIndex",ba),ba.forSingleSegment=wa,ba.prototype.getIteratorForTime=ba.prototype.xb,ba.prototype.updateEvery=ba.prototype.Mc,ba.prototype.fit=ba.prototype.Ya,ba.prototype.evict=ba.prototype.eb,ba.prototype.mergeAndEvict=ba.prototype.Ab,ba.prototype.merge=ba.prototype.Ec,ba.prototype.offset=ba.prototype.offset,ba.prototype.get=ba.prototype.get,ba.prototype.find=ba.prototype.find,ba.prototype.markImmutable=ba.prototype.vf,ba.prototype.release=ba.prototype.release,ba.prototype.destroy=ba.prototype.destroy,Ta.prototype.seek=function(e){return je("shaka.media.SegmentIterator","Please use SegmentIndex.getIteratorForTime instead of seek()."),(e=this.i.xb(e))?(this.h=e.h,this.g=e.g):(this.h=Number.MAX_VALUE,this.g=0),this.next().value},Ta.prototype.current=function(){var e=this.i.get(this.h);return e&&0<e.g.length&&e.ma().length&&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},Ta.prototype.next=function(){var e=this.i.get(this.h);return e&&0<e.g.length?(this.g++,e.ma().length&&this.g==e.g.length&&(this.h++,this.g=0)):(this.h++,this.g=0),{value:e=this.current(),done:!e}},V("shaka.media.SegmentIterator",Ta),Ta.prototype.next=Ta.prototype.next,Ta.prototype.current=Ta.prototype.current,Ta.prototype.seek=Ta.prototype.seek,v(xa,ba),(i=xa.prototype).clone=function(){var e=new xa;return e.l=this.l.slice(),e},i.release=function(){for(var e=c(this.l),t=e.next();!t.done;t=e.next())t.value.release();this.l=[]},i.find=function(e){for(var t=0,n=c(this.l),r=n.next();!r.done;r=n.next()){var i=(r=r.value).find(e);if(null!=i)return i+t;t+=r.i+r.g.length}return null},i.get=function(e){for(var t=0,n=c(this.l),r=n.next();!r.done;r=n.next()){var i=(r=r.value).get(e-t);if(i)return i;t+=r.i+r.g.length}return null},i.offset=function(){},i.Ec=function(){},i.eb=function(){},i.Ab=function(){},i.Ya=function(){},i.Mc=function(){},V("shaka.media.MetaSegmentIndex",xa),xa.prototype.updateEvery=xa.prototype.Mc,xa.prototype.fit=xa.prototype.Ya,xa.prototype.mergeAndEvict=xa.prototype.Ab,xa.prototype.evict=xa.prototype.eb,xa.prototype.merge=xa.prototype.Ec,xa.prototype.offset=xa.prototype.offset,xa.prototype.get=xa.prototype.get,xa.prototype.find=xa.prototype.find,xa.prototype.release=xa.prototype.release,Sa.prototype.release=function(){this.h&&(this.h.stop(),this.h=null),this.g=null},Sa.prototype.set=function(e){this.i=e,Ea(this)},Sa.prototype.yc=function(){return this.g.yc()},Aa.prototype.release=function(){this.i.stop();for(var e=c(this.g),t=e.next();!t.done;t=e.next())t.value.release();this.g.clear()},Ia.prototype.release=function(){this.h=function(){},this.g.clear(),this.i.stop()},Ca.prototype.release=function(){this.l=null,this.j.clear(),this.g=function(){},this.h=function(){},this.i=function(){}};var Ma=1,Da=2,Ra=3;function Na(e,t,n,r,i){return e=pr(e,r,i),0==t&&null==n||(e.headers.Range=n?"bytes="+t+"-"+n:"bytes="+t+"-"),e}function Pa(e,t){var n=this;this.C=t,this.B=e,this.o=null,this.l=1,this.i=this.h=null,this.g=new Map,this.m=!1,this.s=null,this.j=!1,this.I=new Tr((function(){return function(e){var t,n,r,i;return L((function(o){if(1==o.g){for(t=[],n=c(e.g.values()),r=n.next();!r.done;r=n.next())qa(i=r.value),t.push(za(i));return T(o,Promise.all(t),2)}e.g.clear(),e.C=null,e.B=null,e.o=null,x(o)}))}(n)}))}function La(e,t){var n=e.g.get("video");if(n){var r=n.stream;if(r)if(t){var i=r.trickModeVideo;i&&!n.ob&&(Oa(e,i,!1,0,!1),n.ob=r)}else(r=n.ob)&&(n.ob=null,Oa(e,r,!0,0,!1))}}function ja(e,t,n,r,i){n=void 0!==n&&n,r=void 0===r?0:r,i=void 0!==i&&i,e.h=t,e.m&&(t.video&&Oa(e,t.video,n,r,i),t.audio&&Oa(e,t.audio,n,r,i))}function _a(e,t){e.i=t,e.m&&Oa(e,t,!0,0,!1)}function Oa(e,t,n,r,i){var o=e.g.get(t.type);o||t.type!=dt?o&&(o.ob&&(t.trickModeVideo?(o.ob=t,t=t.trickModeVideo):o.ob=null),o.stream!=t||i)&&(t.type==dt&&Oo(e.C.R,Lt(t.mimeType,t.codecs)),o.stream=t,o.ca=null,n&&(o.Qb?o.Pc=!0:o.Ra?(o.qb=!0,o.vc=r,o.Pc=!0):(qa(o),Ka(e,o,!0,r).catch((function(t){e.C&&e.C.onError(t)})))),function(e,t){var n,r;return L((function(i){if(1==i.g)return t.xa?(n=t.stream,r=t.xa,n.segmentIndex?i.v(2):T(i,n.createSegmentIndex(),2)):i.return();if(t.xa!=r||t.stream!=n)return i.return();var o=e.C.Ac(),a=Bo(e.C.R,t.type),s=t.stream.segmentIndex.find(t.Ba?t.Ba.endTime:o),u=null==s?null:t.stream.segmentIndex.get(s);s=u&&u.ea?u.ea-u.ja:null,u&&!s&&(s=(u.endTime-u.startTime)*(t.stream.bandwidth||0)/8),s?((u=u.h)&&(s+=(u.ea?u.ea-u.ja:null)||0),o=8*s/(u=e.C.getBandwidthEstimate())<(a||0)-o-Math.max(e.B.minBufferTime||0,e.o.rebufferingGoal)||t.xa.h.g>s):o=!1,o&&t.xa.abort(),x(i)}))}(e,o).catch((function(t){e.C&&e.C.onError(t)}))):function(e,t){var n,r,i,o;L((function(a){switch(a.g){case 1:return n=ft,S(a,2),T(a,Ko(e.C.R,n.aa),4);case 4:A(a,3);break;case 2:r=k(a),e.C&&e.C.onError(r);case 3:i=Lt(t.mimeType,t.codecs),Oo(e.C.R,i),(e.C.R.m.isTextVisible()||e.o.alwaysStreamText)&&(o=Fa(t),e.g.set(n.aa,o),Ga(e,o,0)),x(a)}}))}(e,t)}function Ua(e,t){t.Qb||t.qb||(t.Ra?(t.qb=!0,t.vc=0):null==Fo(e.C.R,t.type)?null==t.La&&Ga(e,t,0):(qa(t),Ka(e,t,!1,0).catch((function(t){e.C&&e.C.onError(t)}))))}function Fa(e){return{stream:e,type:e.type,ca:null,Ba:null,Dc:null,vd:null,ud:null,td:null,ob:null,endOfStream:!1,Ra:!1,La:null,qb:!1,vc:0,Pc:!1,Qb:!1,Gd:!1,Xb:!1,xa:null}}function Ba(e,t,n,r,i,o){var a;return L((function(s){return 1==s.g?(a=r.closedCaptions&&0<r.closedCaptions.size,null!=r.emsgSchemeIdUris&&0<r.emsgSchemeIdUris.length&&(new ci).T("emsg",(function(t){var n=r.emsgSchemeIdUris;if(0===t.version)var o=t.reader.bc(),a=t.reader.bc(),s=t.reader.M(),u=t.reader.M(),l=t.reader.M(),c=t.reader.M(),d=i.startTime+u/s;else s=t.reader.M(),u=(d=t.reader.Fb()/s+i.timestampOffset)-i.startTime,l=t.reader.M(),c=t.reader.M(),o=t.reader.bc(),a=t.reader.bc();t=t.reader.$a(t.reader.P.byteLength-t.reader.Z()),n.includes(o)&&("urn:mpeg:dash:event:2012"==o?e.C.Bf():(n=new ar(gu,{detail:{startTime:d,endTime:d+l/s,schemeIdUri:o,value:a,timescale:s,presentationTimeDelta:u,eventDuration:l,id:c,messageData:t}}),e.C.onEvent(n)))})).parse(o),T(s,function(e,t,n){var r,i,o;return L((function(a){if(1==a.g)return r=Math.max(e.o.bufferBehind,e.B.presentationTimeline.g),null==(i=Fo(e.C.R,t.type))||.01>=(o=n-i-r)?a.return():T(a,e.C.R.remove(t.type,i,i+o),2);xr(e.I),x(a)}))}(e,t,n),2)):3!=s.g?(xr(e.I),T(s,Ho(e.C.R,t.type,o,i.startTime,i.endTime,a),3)):(xr(e.I),void x(s))}))}function Va(e){return e&&e.type==dt&&("application/cea-608"==e.stream.mimeType||"application/cea-708"==e.stream.mimeType)}function Ha(e,t,n,r){var i,o,a,s;return L((function(u){return 1==u.g?(i=yr,o=Na(n.ma(),n.ja,n.ea,e.o.retryParameters,r),a=e.C.lb.request(i,o),t.xa=a,T(u,a.promise,2)):(s=u.h,t.xa=null,u.return(s.data))}))}function Ka(e,t,n,r){var i,o;return L((function(a){return 1==a.g?(t.qb=!1,t.Pc=!1,t.vc=0,t.Qb=!0,t.Ba=null,t.Dc=null,t.ca=null,r?(i=e.C.Ac(),o=e.C.R.getDuration(),T(a,e.C.R.remove(t.type,i+r,o),3)):T(a,Ko(e.C.R,t.type),4)):3!=a.g?(xr(e.I),n?T(a,e.C.R.flush(t.type),3):a.v(3)):(xr(e.I),t.Qb=!1,t.endOfStream=!1,Ga(e,t,0),void x(a))}))}function Ga(e,t,n){var r=t.type;(r!=dt||e.g.has(r))&&(t.La=new Zt((function(){var n;return L((function(r){return 1==r.g?(S(r,2),T(r,e.$b(t),4)):2!=r.g?A(r,0):(n=k(r),e.C&&e.C.onError(n),void x(r))}))})).U(n))}function qa(e){null!=e.La&&(e.La.stop(),e.La=null)}function za(e){return L((function(t){return e.xa?T(t,e.xa.abort(),0):t.v(0)}))}function Xa(e,t){return L((function(n){if(1==n.g)return T(n,Zn(e.s),2);xr(e.I),e.C.onError(t),t.handled||e.o.failureCallback(t),x(n)}))}function Wa(e,t){var n=lu(),r=this;this.j=t,this.i=e,this.l=n,this.s=null,this.m=[],this.h=this.g=null,this.u=Promise.resolve().then((function(){return function(e){return L((function(t){if(e.I.g)t=t.v(0);else{if(0==e.m.length||e.g&&!e.g.ib)var n=!1;else{e.g&&(e.g.Ha.mb(),e.g=null);var r=(n=e.m.shift()).create(e.l);r?(n.Ha.Cb(),e.g={node:r.node,payload:r.payload,ib:r.ib,Ha:n.Ha}):n.Ha.Hc(),n=!0}n?n=Promise.resolve():e.g?n=function(e){var t,n;return L((function(r){switch(r.g){case 1:return e.i=e.j.df(e.i,e.l,e.g.node,e.g.payload),S(r,2),e.h=e.j.Qe(e.i,e.l,e.g.payload),T(r,e.h.promise,4);case 4:e.h=null,e.i==e.g.node&&(e.g.Ha.Fc(),e.g=null),A(r,0);break;case 2:return 7001==(t=k(r)).code?e.g.Ha.mb():e.g.Ha.onError(t),e.g=null,e.h=null,n=e,T(r,e.j.handleError(e.l,t),5);case 5:n.i=r.h,x(r)}}))}(e):(e.j.Af(e.i),e.s=new pt,n=e.s),t=T(t,n,1)}return t}))}(r)})),this.I=new Tr((function(){return function(e){var t,n;return L((function(r){if(1==r.g)return e.h&&e.h.abort(),$a(e),T(r,e.u,2);for(e.g&&e.g.Ha.mb(),t=c(e.m),n=t.next();!n.done;n=t.next())n.value.Ha.mb();e.g=null,e.m=[],e.j=null,x(r)}))}(r)}))}function Ya(e,t){var n={Cb:function(){},Fc:function(){},mb:function(){},onError:function(){},Hc:function(){},Dg:function(){}};return e.m.push({create:t,Ha:n}),e.h&&e.h.abort(),$a(e),n}function $a(e){e.s&&(e.s.resolve(),e.s=null)}function Ja(e){this.g=null;for(var t=c(Array.from(e.textTracks)),n=t.next();!n.done;n=t.next())(n=n.value).mode="disabled","Shaka Player TextTrack"==n.label&&(this.g=n);this.g||(this.g=e.addTextTrack("subtitles","Shaka Player TextTrack")),this.g.mode="hidden"}function Qa(e){if(e.startTime>=e.endTime)return null;var t=new VTTCue(e.startTime,e.endTime,e.payload);t.lineAlign=e.lineAlign,t.positionAlign=e.positionAlign,e.size&&(t.size=e.size);try{t.align=e.textAlign}catch(n){}return"center"==e.textAlign&&"center"!=t.align&&(t.align="middle"),"vertical-lr"==e.writingMode?t.vertical="lr":"vertical-rl"==e.writingMode&&(t.vertical="rl"),1==e.lineInterpretation&&(t.snapToLines=!1),null!=e.line&&(t.line=e.line),null!=e.position&&(t.position=e.position),t}function Za(e,t){var n=e.mode;e.mode="showing"==n?"showing":"hidden";for(var r=c(Array.from(e.cues)),i=r.next();!i.done;i=r.next())(i=i.value)&&t(i)&&e.removeCue(i);e.mode=n}function es(){}function ts(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function ns(t,n){var r=this;this.m=!1,this.l=[],this.g=t,this.u=n,this.i=document.createElement("div"),this.i.classList.add("shaka-text-container"),this.i.style.textAlign="center",this.i.style.display="flex",this.i.style.flexDirection="column",this.i.style.alignItems="center",this.i.style.justifyContent="flex-end",this.u.appendChild(this.i),this.D=new en((function(){is(r)})).Ca(.25),this.j=new Map,this.h=new Sr,this.h.A(document,"fullscreenchange",(function(){is(r,!0)})),this.s=null,"ResizeObserver"in e&&(this.s=new ResizeObserver((function(){is(r,!0)})),this.s.observe(this.i))}function rs(e,t,n,r,i){for(var o=!1,a=[],s=[],u=(t=c(t)).next();!u.done;u=t.next()){u=u.value;var l=e.j.get(u),d=u.startTime<=r&&u.endTime>r,f=l?l.Ae:null;l&&(a.push(l.Wd),d||(o=!0,e.j.delete(u),l=null)),d&&(s.push(u),l||(os(e,u,i),f=(l=e.j.get(u)).Ae,o=!0)),0<u.nestedCues.length&&f&&rs(e,u.nestedCues,f,r,!0)}if(o){for(i=(r=c(a)).next();!i.done;i=r.next())n.removeChild(i.value);for(s.sort((function(e,t){return e.startTime!=t.startTime?e.startTime-t.startTime:e.endTime-t.endTime})),u=(s=c(s)).next();!u.done;u=s.next())r=e.j.get(u.value),n.appendChild(r.Wd)}}function is(e,t){if(e.i){var n=e.g.currentTime;if((!e.m||void 0!==t&&t)&&0<e.j.size&&(ts(e.i),e.j.clear()),e.m){for(var r=new Map,i=c(e.j.keys()),o=i.next();!o.done;o=i.next())o=o.value,r.set(o,e.j.get(o));rs(e,e.l,e.i,n,!1)}}}function os(e,t,n){var r=n?"span":"div";(t.lineBreak||t.spacer)&&(t.spacer&&je("shaka.extern.Cue","Please use lineBreak instead of spacer."),r="br");var i=document.createElement(r);"br"!=r&&function(e,t,n,r){var i=t.style,o=0==n.nestedCues.length;i.whiteSpace="pre-wrap";var a=n.payload.replace(/\s+$/g,(function(e){return"\xa0".repeat(e.length)}));r?t.textContent=a:a.length&&((i=document.createElement("span")).textContent=a,t.appendChild(i),i=i.style),i.backgroundColor=n.backgroundColor,i.border=n.border,i.color=n.color,i.direction=n.direction,i.opacity=n.opacity,i.paddingLeft=as(n.linePadding,n,e.u),i.paddingRight=as(n.linePadding,n,e.u),n.backgroundImage&&(i.backgroundImage="url('"+n.backgroundImage+"')",i.backgroundRepeat="no-repeat",i.backgroundSize="contain",i.backgroundPosition="center",""==n.backgroundColor&&(i.backgroundColor="transparent")),r?i.display="inline":(i.display="flex",i.flexDirection="column",i.alignItems="center",i.justifyContent="before"==n.displayAlign?"flex-start":"center"==n.displayAlign?"center":"flex-end"),o||(i.margin="0"),i.fontFamily=n.fontFamily,i.fontWeight=n.fontWeight.toString(),i.fontStyle=n.fontStyle,i.letterSpacing=n.letterSpacing,i.fontSize=as(n.fontSize,n,e.u),n.line?1==n.lineInterpretation&&(i.position="absolute",n.writingMode==ge?n.lineAlign==ve?i.top=n.line+"%":"end"==n.lineAlign&&(i.bottom=n.line+"%"):"vertical-lr"==n.writingMode?n.lineAlign==ve?i.left=n.line+"%":"end"==n.lineAlign&&(i.right=n.line+"%"):n.lineAlign==ve?i.right=n.line+"%":"end"==n.lineAlign&&(i.left=n.line+"%")):n.region&&n.region.id&&(!r&&!o||n.backgroundImage)&&(e=n.region.widthUnits==Ae?"%":"px",t=n.region.viewportAnchorUnits==Ae?"%":"px",i.height=n.region.height+(n.region.heightUnits==Ae?"%":"px"),i.width=n.region.width+e,i.position="absolute",i.top=n.region.viewportAnchorY+t,i.left=n.region.viewportAnchorX+t),i.lineHeight=n.lineHeight,n.position&&(n.writingMode==ge?i.paddingLeft=n.position:i.paddingTop=n.position),"line-left"==n.positionAlign?i.cssFloat="left":"line-right"==n.positionAlign&&(i.cssFloat="right"),i.textAlign=n.textAlign,i.textDecoration=n.textDecoration.join(" "),i.writingMode=n.writingMode,"writingMode"in document.documentElement.style&&i.writingMode==n.writingMode||(i.webkitWritingMode=n.writingMode),n.size&&(n.writingMode==ge?i.width=n.size+"%":i.height=n.size+"%")}(e,i,t,n),r=i,!n&&t.nestedCues.length&&((r=document.createElement("span")).classList.add("shaka-text-wrapper"),i.appendChild(r)),e.j.set(t,{Wd:i,Ae:r})}function as(e,t,n){var r=(r=new RegExp(/(\d*\.?\d+)([a-z]+|%+)/).exec(e))?{value:Number(r[1]),Wf:r[2]}:null;if(!r)return e;var i=r.value;switch(r.Wf){case"%":return i/100*n.clientHeight/t.cellResolution.rows+"px";case"c":return n.clientHeight*i/t.cellResolution.rows+"px";default:return e}}function ss(){}function us(e,t,n,r,i){var o,a=i in r,s=!0;for(o in t){var u=i+"."+o,l=a?r[i]:n[o];a||o in n?void 0===t[o]?void 0===l||a?delete e[o]:e[o]=ur(l):l.constructor==Object&&t[o]&&t[o].constructor==Object?(e[o]||(e[o]=ur(l)),u=us(e[o],t[o],l,r,u),s=s&&u):typeof t[o]!=typeof l||null==t[o]||"function"!=typeof t[o]&&t[o].constructor!=l.constructor?(X("Invalid config, wrong type for "+u),s=!1):("function"==typeof n[o]&&n[o].length!=t[o].length&&W("Unexpected number of arguments for "+u),e[o]=t[o]):(X("Invalid config, unrecognized key "+u),s=!1)}return s}function ls(e,t){for(var n={},r=n,i=0,o=0;!(0>(i=e.indexOf(".",i)));)0!=i&&"\\"==e[i-1]||(r[o=e.substring(o,i).replace(/\\\./g,".")]={},r=r[o],o=i+1),i+=1;return r[e.substring(o).replace(/\\\./g,".")]=t,n}function cs(){}function ds(){var e=1/0;navigator.connection&&navigator.connection.saveData&&(e=360);var t={retryParameters:{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4},servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1,initDataTransform:Hr,logLicenseExchange:!1,updateExpirationTime:1,preferredKeySystems:[]},n={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,defaultPresentationDelay:0,dash:{clockSyncUri:"",ignoreDrmInfo:!1,disableXlinkProcessing:!1,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: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:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},manifestPreprocessor:function(e){return e}},hls:{ignoreTextStreamFailures:!1,ignoreImageStreamFailures:!1,useFullSegmentsForStartTime:!1}},r={retryParameters:{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4},failureCallback:function(e){return[e]},rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,ignoreTextStreamFailures:!1,alwaysStreamText:!1,startAtSegmentBoundary:!1,gapDetectionThreshold:.1,smallGapLimit:.5,jumpLargeGaps:!1,durationBackoff:1,forceTransmuxTS:!1,safeSeekOffset:5,stallEnabled:!0,stallThreshold:1,stallSkip:.1,useNativeHlsOnSafari:!0,inaccurateManifestTolerance:2,lowLatencyMode:!1,autoLowLatencyMode:!1,forceHTTPS:!1,preferNativeHls:!1,updateIntervalSeconds:1};(navigator.userAgent.match(/Edge\//)||rn()||on())&&(r.gapDetectionThreshold=.5),(un("Web0S")||rn()||on())&&(r.stallSkip=0);var i={trackSelectionCallback:function(e){return L((function(t){return t.return(e)}))},downloadSizeCallback:function(e){var t;return L((function(n){return 1==n.g?navigator.storage&&navigator.storage.estimate?T(n,navigator.storage.estimate(),3):n.return(!0):(t=n.h,n.return(t.usage+e<.95*t.quota))}))},progressCallback:function(e,t){return[e,t]},usePersistentLicense:!0},o={drm:t,manifest:n,streaming:r,offline:i,abrFactory:function(){return new Fn},abr:{enabled:!0,useNetworkInformation:!0,defaultBandwidthEstimate:1e6,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:e,minPixels:0,maxPixels:1/0,minFrameRate:0,maxFrameRate:1/0,minBandwidth:0,maxBandwidth:1/0}},preferredAudioLanguage:"",preferredTextLanguage:"",preferredVariantRole:"",preferredTextRole:"",preferredAudioChannelCount:2,preferredVideoCodecs:[],preferredAudioCodecs:[],preferForcedSubs:!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},playRangeStart:0,playRangeEnd:1/0,textDisplayFactory:function(){return null}};return i.trackSelectionCallback=function(e){return L((function(t){return t.return(function(e,t){var n=e.filter((function(e){return"variant"==e.type})),r=[],i=Yt(t,n.map((function(e){return e.language})));i&&(r=n.filter((function(e){return zt(e.language)==i}))),0==r.length&&(r=n.filter((function(e){return e.primary}))),0==r.length&&(n.map((function(e){return e.language})),r=n);var o=r.filter((function(e){return e.height&&480>=e.height}));if(o.length&&(o.sort((function(e,t){return t.height-e.height})),r=o.filter((function(e){return e.height==o[0].height}))),n=[],r.length){var a=Math.floor(r.length/2);r.sort((function(e,t){return e.bandwidth-t.bandwidth})),n.push(r[a])}for(r=c(e),a=r.next();!a.done;a=r.next())(a=a.value).type!=dt&&"image"!=a.type||n.push(a);return n}(e,o.preferredAudioLanguage))}))},o}function fs(e,t,n){var r={".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",sessionType:"",serverCertificate:new Uint8Array(0),serverCertificateUri:"",individualizationServer:""}};return us(e,t,n||ds(),r,"")}function hs(){this.g=null,this.h=[]}function ps(e,t){if(null==e.g)e.g={timestamp:Date.now()/1e3,state:t,duration:0};else{var n=Date.now()/1e3;e.g.duration=n-e.g.timestamp,e.g.state!=t&&(e.h.push(e.g),e.g={timestamp:n,state:t,duration:0})}}function gs(e,t){var n=0;e.g&&e.g.state==t&&(n+=e.g.duration);for(var r=c(e.h),i=r.next();!i.done;i=r.next())n+=(i=i.value).state==t?i.duration:0;return n}function ms(){this.i=this.h=null,this.g=[]}function vs(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 ys(){this.s=this.u=this.J=this.F=this.m=this.j=this.H=this.l=this.i=this.L=this.N=this.S=this.D=this.Y=NaN,this.g=new hs,this.h=new ms}function bs(t,n){sr.call(this);var r=this;this.l=_u,this.oc=this.g=null,this.Y=!1,this.h=new Sr,this.fd=this.u=this.Wa=this.B=this.sc=this.s=this.i=this.hc=this.J=this.pc=this.H=this.Fa=this.F=this.L=this.m=this.O=null,this.nd=1e9,this.o=Ls(this),this.md={width:1/0,height:1/0},this.j=null,this.pa=new Xn(this.o.preferredAudioLanguage,this.o.preferredVariantRole,this.o.preferredAudioChannelCount),this.qa=this.o.preferredTextLanguage,this.Nb=this.o.preferredTextRole,this.Xa=this.o.preferForcedSubs,this.gd=[],n&&n(this),this.O=function(e){return new fr((function(t,n){e.u&&e.u.segmentDownloaded(t,n)}))}(this),this.O.Md(this.o.streaming.forceHTTPS),this.D=null,Hu&&(this.D=He(Hu)),this.h.A(e,"online",(function(){r.Hd()})),this.ta={name:"detach"},this.Oa={name:"attach"},this.S={name:"unload"},this.pd={name:"manifest-parser"},this.ld={name:"manifest"},this.ra={name:"media-source"},this.jd={name:"drm-engine"},this.N={name:"load"},this.qd={name:"src-equals-drm-engine"},this.Ma={name:"src-equals"};var i=new Map;i.set(this.Oa,(function(e,t){return ir(function(e,t,n){return null==t.G&&(t.G=n.G,e.h.A(t.G,"error",(function(){var t=Qs(e);t&&$s(e,t)}))),e.g=t.G,Promise.resolve()}(r,e,t))})),i.set(this.ta,(function(e){return e.G&&(r.h.Da(e.G,"error"),e.G=null),r.D&&r.D.release(),r.g=null,ir(e=Promise.resolve())})),i.set(this.S,(function(e){return ir(Ts(r,e))})),i.set(this.ra,(function(e){return ir(e=function(e,t){var n,r,i,o;return L((function(a){if(1==a.g)return n=new Do,r=e.o.textDisplayFactory,i=He(r),e.kd=r,T(a,(o=function(e,t,n,r){return new _o(e,t,n,r)}(t.G,n,i,(function(t,n,r){for(var i=(t=c(t)).next();!i.done;i=t.next())if((i=i.value).data&&i.cueTime&&i.frames){for(var o=i.cueTime+n,a=r,s=c(i.frames),u=s.next();!u.done;u=s.next())xs(e,o,a,"ID3",u.value);e.D&&e.D.onHlsTimedMetadata(i,o)}}))).F,2);e.L=o,x(a)}))}(r,e))})),i.set(this.pd,(function(e,t){return ir(function(e,t,n){var r,i,o,a;return L((function(s){if(1==s.g)return t.mimeType=n.mimeType,t.uri=n.uri,r=t.uri,i=e.O,e.Wa=r,o=e,T(s,ni(r,i,e.o.manifest.retryParameters,t.mimeType),2);o.sc=s.h,e.s=He(e.sc),a=ur(e.o.manifest),n.G&&"AUDIO"===n.G.nodeName&&(a.disableVideo=!0),e.s.configure(a),x(s)}))}(r,e,t))})),i.set(this.ld,(function(e){return function(e,t){var n=t.uri,r=e.O;e.hc=new Ia((function(){return e.cc()})),function(e,t){e.h=t}(e.hc,(function(t){Js(e,Cu,t),e.D&&e.D.onDashTimedMetadata(t)}));var i={networkingEngine:r,filter:function(t){return js(e,t)},makeTextStreamsForClosedCaptions:function(t){return function(e,t){for(var n=new Set,r=c(t.textStreams),i=r.next();!i.done;i=r.next())"application/cea-608"!=(i=i.value).mimeType&&"application/cea-708"!=i.mimeType||n.add(i.originalId);for(r=c(t.variants),i=r.next();!i.done;i=r.next())if((i=i.value.video)&&i.closedCaptions)for(var o=c(i.closedCaptions.keys()),a=o.next();!a.done;a=o.next())if(a=a.value,!n.has(a)){var s=a.startsWith("CC")?"application/cea-608":"application/cea-708",u=new xa;s={id:e.nd++,originalId:a,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:u,mimeType:s,codecs:"",kind:"caption",encrypted:!1,drmInfos:[],keyIds:new Set,language:i.closedCaptions.get(a),label:null,type:dt,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:i.roles,forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null},t.textStreams.push(s),n.add(a)}}(e,t)},onTimelineRegionAdded:function(t){var n=e.hc;e:{for(var r=c(n.g),i=r.next();!i.done;i=r.next())if((i=i.value).schemeIdUri==t.schemeIdUri&&i.id==t.id&&i.startTime==t.startTime&&i.endTime==t.endTime){r=i;break e}r=null}null==r&&(n.g.add(t),n.h(t))},onEvent:function(t){return e.dispatchEvent(t)},onError:function(t){return $s(e,t)},isLowLatencyMode:function(){return e.o.streaming.lowLatencyMode},isAutoLowLatencyMode:function(){return e.o.streaming.autoLowLatencyMode},enableLowLatencyMode:function(){e.configure("streaming.lowLatencyMode",!0)}},o=Date.now()/1e3;return new er(function(){var t,r,a,s;return L((function(u){if(1==u.g)return t=e,T(u,e.s.start(n,i),2);if(t.B=u.h,r=ws(wu),e.dispatchEvent(r),0==e.B.variants.length)throw new ze(2,4,4036);!function(e){function t(e){return e.video&&e.audio||e.video&&e.video.codecs.includes(",")}e.variants.some(t)&&(e.variants=e.variants.filter(t))}(e.B),a=Date.now()/1e3,s=a-o,e.j.H=s,x(u)}))}(),(function(){return e.s.stop()}))}(r,e)})),i.set(this.jd,(function(e){return ir(e=function(e,t){var n,r;return L((function(i){return 1==i.g?(n=Date.now()/1e3,r=!0,e.m=Es(e,{lb:e.O,onError:function(t){$s(e,t)},Gc:function(t){Zs(e,t)},onExpirationUpdated:function(t,n){eu(e,t,n)},onEvent:function(t){e.dispatchEvent(t),t.type==pu&&r&&(r=!1,e.j.j=Date.now()/1e3-n)}}),e.m.configure(e.o.drm),T(i,Pr(e.m,e.B.variants,e.B.offlineSessionIds),2)):3!=i.g?T(i,e.m.Pb(t.G),3):T(i,js(e,e.B),0)}))}(r,e))})),i.set(this.N,(function(e,t){return ir(function(e,t,n){var r,i,o,a,s,u,l,d,f,h;return L((function(p){switch(p.g){case 1:if(t.startTime=n.startTime,r=t.G,i=t.uri,e.Wa=i,e.H=new Sa({Bc:function(){return t.G.playbackRate},yc:function(){return t.G.defaultPlaybackRate},Od:function(e){t.G.playbackRate=e},ke:function(e){t.G.currentTime+=e}}),o=function(){return Fs(e)},a=function(){return Us(e)},e.h.A(r,"playing",o),e.h.A(r,"pause",o),e.h.A(r,"ended",o),e.h.A(r,"ratechange",a),s=e.o.abrFactory,e.u&&e.fd==s||(e.fd=s,e.u=He(s),"function"!=typeof e.u.playbackRateChanged&&(je("AbrManager","Please use an AbrManager with playbackRateChanged function."),e.u.playbackRateChanged=function(){}),e.u.configure(e.o.abr)),e.pa=new Xn(e.o.preferredAudioLanguage,e.o.preferredVariantRole,e.o.preferredAudioChannelCount),e.qa=e.o.preferredTextLanguage,e.Nb=e.o.preferredTextRole,e.Xa=e.o.preferForcedSubs,tu(e.B.presentationTimeline,e.o.playRangeStart,e.o.playRangeEnd),e.u.init((function(t,n,r){e.i&&t!=e.i.h&&Hs(e,t,!0,void 0!==n&&n,void 0===r?0:r)})),e.F=function(e,t){return new ga(e.g,e.B,e.o.streaming,t,(function(){if(e.Fa&&ka(e.Fa,!0),e.i)for(var t=e.i,n=t.C.Ac(),r=t.o.smallGapLimit,i=c(t.g.keys()),o=i.next();!o.done;o=i.next()){o=o.value;var a=t.g.get(o);a.ca=null;var s=t.C.R;if(o==dt?s=null!=(s=s.i).g&&null!=s.h&&(n>=s.g&&n<s.h):s=Po(s=Vo(s,o),n,r),!s&&(null!=Bo(t.C.R,o)&&Ua(t,a),a.xa&&(a.xa.abort(),a.xa=null),o===dt))for((o=t.C.R.D.g).l=0,o.h=[],o.g=[],(a=o.i).i=[],a.h=[],a.g=0,bo(o),a=(o=c(o.j.values())).next();!a.done;a=o.next())po(a.value)}e.J&&ks(e)}),(function(t){return e.dispatchEvent(t)}))}(e,t.startTime),e.Fa=function(e){var t=new Ca(e.hc);!function(e,t,n,r){e.g=t,e.h=n,e.i=r}(t,(function(t){Js(e,Mu,t)}),(function(t){Js(e,Du,t)}),(function(t,n){n||(Js(e,Mu,t),Js(e,Du,t))}));var n=new Aa(e.g);return n.g.add(t),n}(e),u=Math.max(e.B.minBufferTime,e.o.streaming.rebufferingGoal),As(e,u),fn(e.B,e.o.preferredVideoCodecs,e.o.preferredAudioCodecs,e.o.preferredAudioChannelCount,e.o.preferredDecodingAttributes),e.i=function(e){return new Pa(e.B,{Ac:function(){return e.F.l()},getBandwidthEstimate:function(){return e.u.getBandwidthEstimate()},R:e.L,lb:e.O,onError:function(t){return $s(e,t)},onEvent:function(t){return e.dispatchEvent(t)},Bf:function(){e.s&&e.s.update&&e.s.update()},Dd:function(){e.F&&e.F.F(),ks(e)}})}(e),e.i.configure(e.o.streaming),e.l=Ou,e.dispatchEvent(ws(Au)),l=null,e.Cc().find((function(e){return e.active}))){p.v(2);break}if(l=Bs(e)?e.u.chooseVariant():null,Hs(e,l,!0,!1,0),!e.o.streaming.startAtSegmentBoundary){p.v(3);break}return d=e.F.l(),T(p,function(e,t){var n,r,i,o,a;return L((function(s){return 1==s.g?(n=e.audio,r=e.video,i=function(e,t){var n,r;return L((function(i){return 1==i.g?e?T(i,e.createSegmentIndex(),2):i.return(null):(n=e.segmentIndex[Symbol.iterator]().seek(t))?(r=n.startTime,i.return(r)):i.return(null)}))},T(s,i(n,t),2)):3!=s.g?(o=s.h,T(s,i(r,t),3)):null!=(a=s.h)&&null!=o?s.return(Math.max(a,o)):null!=a?s.return(a):null!=o?s.return(o):s.return(t)}))}(l,d),4);case 4:f=p.h,e.F.m(f);case 3:Gs(e,null,xn(l));case 2:return e.hb().find((function(e){return e.active}))||((h=Rn(e.B.textStreams,e.qa,e.Nb,e.Xa)[0]||null)&&vs(e.j.h,h,!0),l&&(h?(l.audio&&function(e,t,n){return e=zt(e.o.preferredTextLanguage),t=zt(t.language),Kt(n=zt(n.language),e)&&!Kt(t,n)}(e,l.audio,h)&&(e.Y=!0),e.Y&&e.L.m.setTextVisibility(!0),Ws(e)):e.Y=!1),h&&(e.o.streaming.alwaysStreamText||e.sd())&&_a(e.i,h)),T(p,e.i.start(),5);case 5:e.o.abr.enabled&&(e.u.enable(),Ys(e)),wn(e.i?e.i.h:null,e.B),ru(e.B),qs(e),Bs(e),e.B.variants.some((function(e){return e.primary})),e.h.wa(r,"loadedmetadata",(function(){e.j.l=Date.now()/1e3-n.Qd})),x(p)}}))}(r,e,t))})),i.set(this.qd,(function(e,t){return ir(function(e,t,n){var r,i,o,a,s,u,l;return L((function(c){return 1==c.g?(r=ft,i=Date.now()/1e3,o=!0,e.m=Es(e,{lb:e.O,onError:function(t){$s(e,t)},Gc:function(t){Zs(e,t)},onExpirationUpdated:function(t,n){eu(e,t,n)},onEvent:function(t){e.dispatchEvent(t),t.type==pu&&o&&(o=!1,e.j.j=Date.now()/1e3-i)}}),e.m.configure(e.o.drm),a=n.uri||"",s=ii(a),"application/x-mpegurl"==(u=Ku[s])&&an()&&(u="application/vnd.apple.mpegurl"),u||(u="video/mp4"),l={id:0,language:"und",primary:!1,audio:null,video:{id:0,originalId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:n.mimeType?n.mimeType.split(";")[0]:u,codecs:n.mimeType?Ot(n.mimeType):"",encrypted:!0,drmInfos:[],keyIds:new Set,language:"und",label:null,type:r.Na,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null},bandwidth:100,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},e.m.S=!0,T(c,Pr(e.m,[l],[]),2)):T(c,e.m.Pb(t.G),0)}))}(r,e,t))})),i.set(this.Ma,(function(e,t){return function(e,t,n){function r(){return Fs(e)}t.uri=n.uri,t.startTime=n.startTime,e.Wa=t.uri,e.F=new pa(t.G),null!=t.startTime&&e.F.m(t.startTime),e.H=new Sa({Bc:function(){return t.G.playbackRate},yc:function(){return t.G.defaultPlaybackRate},Od:function(e){t.G.playbackRate=e},ke:function(e){t.G.currentTime+=e}}),As(e,e.o.streaming.rebufferingGoal),e.h.A(t.G,"playing",r),e.h.A(t.G,"pause",r),e.h.A(t.G,"ended",r),e.h.A(t.G,"ratechange",(function(){return Us(e)})),"none"!=e.g.preload&&e.h.wa(e.g,"loadedmetadata",(function(){e.j.l=Date.now()/1e3-n.Qd})),e.g.audioTracks&&(e.h.A(e.g.audioTracks,"addtrack",(function(){return qs(e)})),e.h.A(e.g.audioTracks,"removetrack",(function(){return qs(e)})),e.h.A(e.g.audioTracks,"change",(function(){return qs(e)}))),e.g.textTracks&&(e.h.A(e.g.textTracks,"addtrack",(function(t){if(t.track)switch(t=t.track,t.kind){case"metadata":!function(e,t){"metadata"==t.kind&&(t.mode="hidden",e.h.A(t,"cuechange",(function(){if(t.activeCues)for(var n=c(t.activeCues),r=n.next();!r.done;r=n.next())r=r.value,xs(e,r.startTime,r.endTime,r.type,r.value),e.D&&e.D.onCueMetadataChange(r.value)})),new en((function(){for(var t=function(e){return Array.from(e.g.textTracks).filter((function(e){return"metadata"==e.kind}))}(e),n=(t=c(t)).next();!n.done;n=t.next())n.value.mode="hidden"})).Hb().U(.5))}(e,t);break;case"chapters":Ss(e,t);break;default:qs(e)}})),e.h.A(e.g.textTracks,"removetrack",(function(){return qs(e)})),e.h.A(e.g.textTracks,"change",(function(){return qs(e)}))),t.G.src=t.uri,(rn()||un("Web0S"))&&t.G.load(),e.l=Uu,e.dispatchEvent(ws(Au));var i=new pt;oa(e.g,HTMLMediaElement.HAVE_METADATA,e.h,(function(){i.resolve()}));var o=!1;return e.gd.push((function(){o=!0})),oa(e.g,HTMLMediaElement.HAVE_CURRENT_DATA,e.h,(function(){return L((function(t){return 1==t.g?o?t.return():(function(e){var t=e.o.preferredAudioLanguage;if(""!=t){e.Jd(t);var n=e.o.preferredVariantRole;""!=n&&e.Jd(t,n)}}(e),Cs(e).find((function(e){return"disabled"!=e.mode}))?t.v(2):T(t,new Promise((function(t){e.h.wa(e.g.textTracks,"change",t),new en(t).U(1)})),2)):o?t.return():(function(e){var t=e.o.preferredTextLanguage,n=e.o.preferForcedSubs;if(""!=t){e.Kd(t,"",n);var r=e.o.preferredTextRole;""!=r&&e.Kd(t,r,n)}}(e),void x(t))}))})),e.g.error?i.reject(Qs(e)):"none"==e.g.preload&&(W('With <video preload="none">, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way, and we cannot provide track info yet. Please do not use preload="none" with Shaka Player.'),i.resolve()),e.h.wa(e.g,"error",(function(){i.reject(Qs(e))})),new er(i,(function(){return i.reject(new ze(2,7,7001)),Promise.resolve()}))}(r,e,t)})),this.da=new Wa(this.ta,{df:function(e,t,n,i){var o=null;return e==r.ta&&(o=n==r.ta?r.ta:r.Oa),e==r.Oa&&(o=n==r.ta||t.G!=i.G?r.ta:n==r.Oa?r.Oa:n==r.ra||n==r.N?r.ra:n==r.Ma?r.qd:null),e==r.ra&&(o=n==r.N&&t.G==i.G?r.pd:r.S),e==r.pd&&(o=uu(r.N,r.ld,r.S,n,t,i)),e==r.ld&&(o=uu(r.N,r.jd,r.S,n,t,i)),e==r.jd&&(o=uu(r.N,r.N,r.S,n,t,i)),e==r.qd&&(o=n==r.Ma&&t.G==i.G?r.Ma:r.S),e!=r.N&&e!=r.Ma||(o=r.S),e==r.S&&(o=i.G&&t.G==i.G?r.Oa:r.ta),o},Qe:function(e,t,n){return r.dispatchEvent(ws(xu,{state:e.name})),i.get(e)(t,n)},handleError:function(e){return L((function(t){return 1==t.g?T(t,Ts(r,e),2):t.return(e.G?r.Oa:r.ta)}))},Af:function(e){r.dispatchEvent(ws(Su,{state:e.name}))}}),t&&this.Pb(t,!0)}function ws(e,t){return new ar(e,t)}function Ts(e,t){var n,r,i,o,a,s,u,l,d;return L((function(f){switch(f.g){case 1:return e.l!=ju&&(e.l=_u),n=e.gd.map((function(e){return e()})),e.gd=[],T(f,Promise.all(n),2);case 2:if(e.dispatchEvent(ws(Nu)),t.mimeType=null,t.startTime=null,t.uri=null,t.G&&(e.h.Da(t.G,"loadedmetadata"),e.h.Da(t.G,"playing"),e.h.Da(t.G,"pause"),e.h.Da(t.G,"ended"),e.h.Da(t.G,"ratechange")),e.Fa&&(e.Fa.release(),e.Fa=null),e.pc&&(e.pc.stop(),e.pc=null),!e.s){f.v(3);break}return T(f,e.s.stop(),4);case 4:e.s=null,e.sc=null;case 3:if(!e.u){f.v(5);break}return T(f,e.u.stop(),5);case 5:if(!e.i){f.v(7);break}return T(f,e.i.destroy(),8);case 8:e.i=null;case 7:if(e.H&&(e.H.release(),e.H=null),e.F&&(e.F.release(),e.F=null),!e.L){f.v(9);break}return T(f,e.L.destroy(),10);case 10:e.L=null;case 9:if(e.D&&e.D.onAssetUnload(),!t.G||!t.G.src){f.v(11);break}return T(f,new Promise((function(e){return new en(e).U(.1)})),12);case 12:for(t.G.removeAttribute("src"),t.G.load();t.G.lastChild;)t.G.removeChild(t.G.firstChild);case 11:if(!e.m){f.v(13);break}return T(f,e.m.destroy(),14);case 14:e.m=null;case 13:if(e.Wa=null,e.J=null,e.B){for(r=c(e.B.variants),i=r.next();!i.done;i=r.next())for(o=i.value,a=c([o.audio,o.video]),s=a.next();!s.done;s=a.next())(u=s.value)&&u.segmentIndex&&u.segmentIndex.release();for(l=c(e.B.textStreams),s=l.next();!s.done;s=l.next())(d=s.value).segmentIndex&&d.segmentIndex.release()}e.B=null,e.j=new ys,e.kd=null,Os(e),x(f)}}))}function xs(e,t,n,r,i){e.dispatchEvent(ws(Tu,{startTime:t,endTime:n,Bg:r,payload:i}))}function Ss(e,t){t&&"chapters"==t.kind&&(t.mode="hidden",new en((function(){for(var t=Ms(e),n=(t=c(t)).next();!n.done;n=t.next())n.value.mode="hidden"})).Hb().U(.5))}function Es(e,t){return new Nr(t,e.o.drm.updateExpirationTime)}function As(e,t){e.J=new Wn,e.J.g=$n,Yn(e.J,t,Math.min(.5,t/2)),Os(e),e.pc=new en((function(){ks(e)})).Ca(.25)}function ks(e){switch(e.l){case Uu:if(e.g.ended)var t=!0;else{var n=No(e.g.buffered);t=null!=n&&n>=e.g.duration-1}break;case Ou:e:if(e.g.ended||Uo(e.L))t=!0;else{if(e.B.presentationTimeline.X()){n=e.B.presentationTimeline.gb();var r=No(e.g.buffered);if(null!=r&&r>=n){t=!0;break e}}t=!1}break;default:t=!1}r=Lo(e.g.buffered,e.g.currentTime);var i=t,o=(n=e.J).h.get(n.g);t=n.g,r=i||r>=o?Jn:$n,n.g=r,t!=r&&Os(e)}function Is(e){if(e.s){var t=ur(e.o.manifest);e.g&&"AUDIO"===e.g.nodeName&&(t.disableVideo=!0),e.s.configure(t)}if(e.m&&e.m.configure(e.o.drm),e.i){e.i.configure(e.o.streaming);try{_s(e,e.B)}catch(o){$s(e,o)}e.u&&Bs(e),!(t=e.i.h)||t.allowedByApplication&&t.allowedByKeySystem||Vs(e)}if(e.O&&e.O.Md(e.o.streaming.forceHTTPS),e.L&&(t=e.o.textDisplayFactory,e.kd!=t)){var n=He(t),r=e.L,i=r.m;r.m=n,i&&(n.setTextVisibility(i.isTextVisible()),i.destroy()),r.i&&(r.i.i=n),e.kd=t,e.i&&((n=(t=e.i).g.get(dt))&&Oa(t,n.stream,!0,0,!0))}e.u&&(e.u.configure(e.o.abr),e.o.abr.enabled?e.u.enable():e.u.disable(),Ys(e)),e.J&&(t=e.o.streaming.rebufferingGoal,e.B&&(t=Math.max(t,e.B.minBufferTime)),Yn(e.J,t,Math.min(.5,t/2))),e.B&&tu(e.B.presentationTimeline,e.o.playRangeStart,e.o.playRangeEnd)}function Cs(e){return Array.from(e.g.textTracks).filter((function(e){return"metadata"!=e.kind&&"chapters"!=e.kind&&"Shaka Player TextTrack"!=e.label}))}function Ms(e){return Array.from(e.g.textTracks).filter((function(e){return"chapters"==e.kind}))}function Ds(e,t){var n,r;return L((function(i){switch(i.g){case 1:return n=ii(t),(r=Gu[n])?i.return(r):(S(i,2),T(i,ri(t,e.O,e.o.streaming.retryParameters),4));case 4:r=i.h,A(i,3);break;case 2:k(i);case 3:if(r)return i.return(r);throw new ze(1,2,2011,n)}}))}function Rs(e,t,n,r,i,o,a){var s,u,l,c;return L((function(d){if(1==d.g)return"text/vtt"!=i||a.length?T(d,Ns(t,e.O,e.o.streaming.retryParameters),3):d.v(2);2!=d.g&&(s=d.h,u=Ps(e,s,i,a),l=new Blob([u],{type:"text/vtt"}),t=$o(l),i="text/vtt"),(c=document.createElement("track")).src=t,c.label=o,c.kind=r,c.srclang=n,e.g.getAttribute("crossorigin")||e.g.setAttribute("crossorigin","anonymous"),e.g.appendChild(c),x(d)}))}function Ns(e,t,n){var r,i,o;return L((function(a){return 1==a.g?(r=yr,(i=pr([e],n)).method="GET",T(a,t.request(r,i).promise,2)):(o=a.h,a.return(o.data))}))}function Ps(e,t,n,r){var i=Ht[n];if(i)return n=i(),e={periodStart:0,segmentStart:0,segmentEnd:e.g.duration},t=Re(t),function(e,t){function n(e){for(var n=e,r=c(t),i=r.next();!i.done;i=r.next())(i=i.value).end&&i.start<e&&(n+=i.end-i.start);return(10>(e=Math.floor(n/3600))?"0":"")+e+":"+(10>(r=Math.floor(n/60%60))?"0":"")+r+":"+(10>(i=Math.floor(n%60))?"0":"")+i+"."+(100>(n=Math.floor(1e3*n%1e3))?10>n?"00":"0":"")+n}function r(e){var t=[],n=700<=e.fontWeight,i="italic"==e.fontStyle,o=e.textDecoration.includes("underline");return n&&t.push("b"),i&&t.push("i"),o&&t.push("u"),n=t.reduce((function(e,t){return e+"<"+t+">"}),""),t=t.reduceRight((function(e,t){return e+"</"+t+">"}),""),e.lineBreak||e.spacer?(e.spacer&&je("shaka.text.Cue","Please use lineBreak instead of spacer."),"\n"):e.nestedCues.length?e.nestedCues.map(r).join(""):n+e.payload+t}for(var i=e.map((function(e){if(e.nestedCues.length){var t=e.clone();return t.nestedCues=[],t.payload=r(e),t}return e})),o="WEBVTT\n\n",a=(i=c(i)).next();!a.done;a=i.next())o+=n((a=a.value).startTime)+" --\x3e "+n(a.endTime)+function(e){var t=[];switch(e.textAlign){case"left":t.push("align:left");break;case"right":t.push("align:right");break;case ce: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(" "):""}(a)+"\n",o+=a.payload+"\n\n";return o}(t=n.parseMedia(t,e),r);throw new ze(2,2,2014,n)}function Ls(e){var t=ds();return t.streaming.failureCallback=function(t){e.X()&&[1001,1002,1003].includes(t.code)&&(t.severity=1,e.Hd())},t.textDisplayFactory=function(){return e.oc?new ns(e.g,e.oc):new Ja(e.g)},t}function js(e,t){return L((function(n){if(1==n.g)return T(n,function(e,t){return L((function(n){if(1==n.g)return T(n,mn(e.i?e.i.h:null,t),2);ru(t),x(n)}))}(e,t),2);_s(e,t),x(n)}))}function _s(e,t){if(e.l!=ju){for(var n=e.o.restrictions,r=e.md,i=!1,o=c(t.variants),a=o.next();!a.done;a=o.next()){var s=(a=a.value).allowedByApplication;a.allowedByApplication=gn(a,n,r),s!=a.allowedByApplication&&(i=!0)}if(i&&e.i&&qs(e),(n=e.m?e.m.i:null)&&e.m.m)for(i=(r=c(t.variants)).next();!i.done;i=r.next())for(o=(i=c(((i=i.value).video?i.video.drmInfos:[]).concat(i.audio?i.audio.drmInfos:[]))).next();!o.done;o=i.next())if((o=o.value).keySystem==n.keySystem)for(a=(o=c(o.initData||[])).next();!a.done;a=o.next())a=a.value,Or(e.m,a.initDataType,a.initData);nu(e,t)}}function Os(e){var t=e.rd();if(e.j&&e.J&&e.F){var n=e.H;n.j=t,Ea(n),Fs(e)}e.dispatchEvent(ws(hu,{buffering:t}))}function Us(e){var t=e.g.playbackRate;0!=t&&(e.H&&e.H.set(t),t=ws(Eu),e.dispatchEvent(t))}function Fs(e){if(e.j&&e.J){var t=e.j.g;e.J.g==$n?ps(t,"buffering"):e.g.paused?ps(t,"paused"):e.g.ended?ps(t,"ended"):ps(t,"playing")}}function Bs(e){try{nu(e,e.B)}catch(n){return $s(e,n),!1}var t=e.B.variants.filter((function(e){return Mn(e)}));return t=e.pa.create(t),e.u.setVariants(Array.from(t.values())),!0}function Vs(e){var t;(t=Bs(e)?e.u.chooseVariant():null)&&Hs(e,t,!0,!0,0)}function Hs(e,t,n,r,i){var o=e.i.h;if(t==o)r&&ja(e.i,t,r,i,!0);else{var a=e.j.h;a.h!=t&&(a.h=t,a.g.push({timestamp:Date.now()/1e3,id:t.id,type:"variant",fromAdaptation:n,bandwidth:t.bandwidth})),ja(e.i,t,r,i),r=null,o&&(r=xn(o)),t=xn(t),n?Gs(e,r,t):zs(e,r,t)}}function Ks(e,t){var n=Array.from(e.g.audioTracks).find((function(e){return e.enabled}));t.enabled=!0,t.id!==n.id&&(n.enabled=!1),zs(e,n=In(n),In(t))}function Gs(e,t,n){iu(e,t=ws(fu,{zf:t,yf:n}))}function qs(e){iu(e,ws(Ru))}function zs(e,t,n){iu(e,t=ws(Pu,{zf:t,yf:n}))}function Xs(e){iu(e,ws(ku))}function Ws(e){iu(e,ws(Iu))}function Ys(e){iu(e,ws(du,{Cg:e.o.abr.enabled}))}function $s(e,t){if(e.l!=ju){var n=ws(mu,{detail:t});e.dispatchEvent(n),n.defaultPrevented&&(t.handled=!0)}}function Js(e,t,n){e.dispatchEvent(ws(t,{detail:{schemeIdUri:n.schemeIdUri,value:n.value,startTime:n.startTime,endTime:n.endTime,id:n.id,eventElement:n.eventElement}}))}function Qs(e){if(!e.g.error)return null;var t=e.g.error.code;if(1==t)return null;var n=e.g.error.msExtendedCode;return n&&(0>n&&(n+=Math.pow(2,32)),n=n.toString(16)),new ze(2,3,3016,t,n,e.g.error.message)}function Zs(e,t){if(e.i){var n=Object.keys(t),r=1==n.length&&"00"==n[0],i=!1;if(n.length)for(var o=(n=c(e.B.variants)).next();!o.done;o=n.next()){var a=[];(o=o.value).audio&&a.push(o.audio),o.video&&a.push(o.video);for(var s=(a=c(a)).next();!s.done;s=a.next()){var u=s.value;if(s=o.allowedByKeySystem,u.keyIds.size){o.allowedByKeySystem=!0;for(var l=(u=c(u.keyIds)).next();!l.done;l=u.next())l=l.value,l=t[r?"00":l],o.allowedByKeySystem=o.allowedByKeySystem&&!!l&&!Bu.includes(l)}s!=o.allowedByKeySystem&&(i=!0)}}i&&Bs(e),(r=e.i.h)&&!r.allowedByKeySystem&&Vs(e),i&&qs(e)}}function eu(e,t,n){e.s&&e.s.onExpirationUpdated&&e.s.onExpirationUpdated(t,n),t=ws(vu),e.dispatchEvent(t)}function tu(e,t,n){0<t&&(e.X()||e.ve(t)),n<(t=e.getDuration())&&(e.X()||e.Ja(n))}function nu(e,t){var n=e.m?e.m.zc():{},r=Object.keys(n);r=r.length&&"00"==r[0];for(var i=!1,o=!1,a=new Set,s=new Set,u=c(t.variants),l=u.next();!l.done;l=u.next()){var d=[];(l=l.value).audio&&d.push(l.audio),l.video&&d.push(l.video);for(var f=(d=c(d)).next();!f.done;f=d.next())if((f=f.value).keyIds.size)for(var h=(f=c(f.keyIds)).next();!h.done;h=f.next()){h=h.value;var p=n[r?"00":h];p?Bu.includes(p)&&s.add(p):a.add(h)}l.allowedByApplication?l.allowedByKeySystem&&(i=!0):o=!0}if(!i)throw new ze(2,4,4012,n={hasAppRestrictions:o,missingKeys:Array.from(a),restrictedKeyStatuses:Array.from(s)})}function ru(e){if(!e.variants.some(Mn))throw new ze(2,4,4032)}function iu(e,t){L((function(n){if(1==n.g)return T(n,Promise.resolve(),2);e.l!=ju&&e.dispatchEvent(t),x(n)}))}function ou(e){for(var t=new Set,n=(e=c(e)).next();!n.done;n=e.next())(n=n.value).language?t.add(zt(n.language)):t.add("und");return t}function au(e){for(var t=new Map,n=new Map,r=(e=c(e)).next();!r.done;r=e.next()){var i="und",o=[];(r=r.value).language&&(i=zt(r.language)),(o="variant"==r.type?r.audioRoles:r.roles)&&o.length||(o=[""]),t.has(i)||t.set(i,new Set);for(var a=(o=c(o)).next();!a.done;a=o.next())a=a.value,t.get(i).add(a),r.label&&(n.has(i)||n.set(i,new Map),n.get(i).set(a,r.label))}var s=[];return t.forEach((function(e,t){for(var r=c(e),i=r.next();!i.done;i=r.next()){i=i.value;var o=null;n.has(t)&&n.get(t).has(i)&&(o=n.get(t).get(i)),s.push({language:t,role:i,label:o})}})),s}function su(){return new ze(2,7,7e3)}function uu(e,t,n,r,i,o){return r==e&&i.G==o.G&&i.uri==o.uri&&i.mimeType==o.mimeType?t:n}function lu(){return{G:null,mimeType:null,startTime:null,Qd:NaN,uri:null}}function cu(e){return new Promise((function(t,n){e.mb=function(){return n(su())},e.Fc=function(){return t()},e.onError=function(e){return n(e)},e.Hc=function(){return n(su())}}))}Pa.prototype.destroy=function(){return this.I.destroy()},Pa.prototype.configure=function(e){this.o=e,this.s=new Qn({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)},Pa.prototype.start=function(){var e=this;return L((function(t){if(1==t.g)return T(t,function(e){var t,n,r,i,o,a,s,u,l,d;return L((function(f){if(1==f.g){if(t=ft,!e.h)throw new ze(2,5,5006);return n=new Map,r=new Set,e.h.audio&&(n.set(t.bb,e.h.audio),r.add(e.h.audio)),e.h.video&&(n.set(t.Na,e.h.video),r.add(e.h.video)),e.i&&(n.set(t.aa,e.i),r.add(e.i)),i=e.C.R,o=e.o.forceTransmuxTS,T(f,i.init(n,o),2)}xr(e.I);var h=e.B.presentationTimeline.getDuration();for(1/0>h?e.C.R.Ja(h):e.C.R.Ja(Math.pow(2,32)),a=c(n.keys()),s=a.next();!s.done;s=a.next())u=s.value,l=n.get(u),e.g.has(u)||(d=Fa(l),e.g.set(u,d),Ga(e,d,0));x(f)}))}(e),2);xr(e.I),e.m=!0,x(t)}))},Pa.prototype.$b=function(t){var n,r,i,o,a,s=this;return L((function(u){switch(u.g){case 1:if(xr(s.I),t.Ra||null==t.La||t.Qb)return u.return();if(t.La=null,!t.qb){u.v(2);break}return T(u,Ka(s,t,t.Pc,t.vc),3);case 3:return u.return();case 2:if(t.stream.segmentIndex){u.v(4);break}return n=t.stream,T(u,t.stream.createSegmentIndex(),5);case 5:if(n!=t.stream)return null==t.La&&Ga(s,t,0),u.return();case 4:S(u,6),null!=(r=function(t,n){if(Va(n))return function(e,t){var n=Bo(e,"video")||0;Bt(e.i,t,n)}(t.C.R,n.stream.originalId||""),null;n.type==dt&&function(e){e.i&&Bt(e.i,"",0)}(t.C.R);var r=t.C.Ac(),i=n.Ba?n.Ba.endTime:r,o=function(e,t,n){return t==dt?null==(e=e.i).h||e.h<n?0:e.h-Math.max(n,e.g):Lo(e=Vo(e,t),n)}(t.C.R,n.type,r),a=Math.max(t.B.minBufferTime||0,t.o.rebufferingGoal,t.o.bufferingGoal)*t.l;if(i>=t.B.presentationTimeline.getDuration())return n.endOfStream=!0,"video"==n.type&&(r=t.g.get(dt))&&Va(r)&&(r.endOfStream=!0),null;if(n.endOfStream=!1,o>=a)return t.o.updateIntervalSeconds/2;if(o=Bo(t.C.R,n.type),!(o=function(e,t,n,r){if(t.ca)return t.ca.current();if(t.Ba||r)return t.ca=t.stream.segmentIndex.xb(t.Ba?t.Ba.endTime:r),t.ca&&t.ca.next().value;e=e.o.inaccurateManifestTolerance,r=Math.max(n-e,0);var i=null;return e&&(t.ca=t.stream.segmentIndex.xb(r),i=t.ca&&t.ca.next().value),i||(t.ca=t.stream.segmentIndex.xb(n),i=t.ca&&t.ca.next().value),i}(t,n,r,o)))return t.o.updateIntervalSeconds;a=1/0;for(var s=Array.from(t.g.values()),u=(s=c(s)).next();!u.done;u=s.next())Va(u=u.value)||u.ca&&!u.ca.current()||(a=Math.min(a,u.Ba?u.Ba.endTime:r));return i>=a+t.B.presentationTimeline.g?t.o.updateIntervalSeconds:(function(t,n,r,i){var o,a,s,u,l,c,d,f,h,p,g;return L((function(m){switch(m.g){case 1:return o=ft,a=n.stream,s=n.ca,n.Ra=!0,S(m,2),T(m,function(e,t,n){var r,i,o,a,s,u,l;return L((function(c){return r=[],i=Math.max(0,n.appendWindowStart-.1),o=n.appendWindowEnd+.01,(a=n.timestampOffset)==t.vd&&i==t.ud&&o==t.td||(s=function(){var n;return L((function(r){if(1==r.g)return S(r,2),t.ud=i,t.td=o,t.vd=a,T(r,function(e,t,n,r,i){return L((function(o){return t==ft.aa?(e.i.D=n,function(e,t,n){e.j=t,e.l=n}(e.i,r,i),o.return()):T(o,Promise.all([qo(e,t,(function(){var n=e.j[t].appendWindowStart,r=e.j[t].appendWindowEnd;e.j[t].abort(),e.j[t].appendWindowStart=n,e.j[t].appendWindowEnd=r,Go(e,t)})),qo(e,t,(function(){var r=n;0>r&&(r+=.001),e.j[t].timestampOffset=r,Go(e,t)})),qo(e,t,(function(){e.j[t].appendWindowStart=0,e.j[t].appendWindowEnd=i,e.j[t].appendWindowStart=r,Go(e,t)}))]),0)}))}(e.C.R,t.type,a,i,o),4);if(2!=r.g)return A(r,0);throw n=k(r),t.ud=null,t.td=null,t.vd=null,n}))},r.push(s())),!function(e,t){return e&&t?e.Wb()==t.Wb()&&e.Sb()==t.Sb()&&ae(e.ma(),t.ma()):e==t}(n.h,t.Dc)&&(t.Dc=n.h)&&(u=Ha(e,t,n.h),l=function(){var n,r,i;return L((function(o){switch(o.g){case 1:return S(o,2),T(o,u,4);case 4:return n=o.h,xr(e.I),r=t.stream.closedCaptions&&0<t.stream.closedCaptions.size,T(o,Ho(e.C.R,t.type,n,null,null,r),5);case 5:A(o,0);break;case 2:throw i=k(o),t.Dc=null,i}}))},r.push(l())),T(c,Promise.all(r),0)}))}(t,n,i),4);case 4:return xr(t.I),t.j?m.return():(u="video/mp4"==a.mimeType||"audio/mp4"==a.mimeType,l=e.ReadableStream,t.o.lowLatencyMode&&l&&u?(d=new Uint8Array(0),f=function(e){var o,s,u;return L((function(l){return xr(t.I),t.j?l.return():(d=function(e,t){var n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(d,e),o=!1,s=0,(new ci).box("mdat",(function(e){s=e.size+e.start,o=!0})).parse(d,!1,!0),o?(u=d.subarray(0,s),d=d.subarray(s),T(l,Ba(t,n,r,a,i,u),0)):l.v(0))}))},T(m,Ha(t,n,i,f),6)):T(m,Ha(t,n,i),7));case 7:return c=m.h,xr(t.I),t.j?m.return():n.qb?(n.Ra=!1,Ga(t,n,0),m.return()):T(m,Ba(t,n,r,a,i,c),6);case 6:if(xr(t.I),t.j)return m.return();n.Ba=i,s.next(),n.Ra=!1,n.Gd=!1,h=t.C.R.xc(),p=h[n.type],JSON.stringify(p),n.qb||t.C.Dd(),Ga(t,n,0),A(m,0);break;case 2:if(g=k(m),xr(t.I,g),t.j)return m.return();if(n.Ra=!1,7001==g.code)n.Ra=!1,n.La=null,Ga(t,n,0),m.v(0);else if(n.type==o.aa&&t.o.ignoreTextStreamFailures)t.g.delete(o.aa),m.v(0);else if(3017==g.code)(function(e,t,n){if(!Array.from(e.g.values()).some((function(e){return e!=t&&e.Gd}))){var r=Math.round(100*e.l);if(20<r)e.l-=.2;else{if(!(4<r))return t.Xb=!0,e.j=!0,void e.C.onError(n);e.l-=.04}t.Gd=!0}Ga(e,t,4)})(t,n,g),m.v(0);else{if(1001!=g.code||!g.data||404!=g.data[1])return n.Xb=!0,g.severity=2,T(m,Xa(t,g),0);n.Ra=!1,n.La=null,Ga(t,n,1),m.v(0)}}}))}(t,n,r,o).catch((function(){})),null)}(s,t))&&(Ga(s,t,r),t.Xb=!1),A(u,7);break;case 6:return i=k(u),T(u,Xa(s,i),8);case 8:return u.return();case 7:if(o=Array.from(s.g.values()),!s.m||!o.every((function(e){return e.endOfStream}))){u.v(0);break}return T(u,s.C.R.endOfStream(),10);case 10:xr(s.I),0!=(a=s.C.R.getDuration())&&a<s.B.presentationTimeline.getDuration()&&s.B.presentationTimeline.Ja(a),x(u)}}))},Wa.prototype.destroy=function(){return this.I.destroy()},(i=Ja.prototype).remove=function(e,t){return!!this.g&&(Za(this.g,(function(n){return n.startTime<t&&n.endTime>e})),!0)},i.append=function(e){function t(e){var n=[],r=700<=e.fontWeight,i="italic"==e.fontStyle,o=e.textDecoration.includes("underline");return r&&n.push("b"),i&&n.push("i"),o&&n.push("u"),r=n.reduce((function(e,t){return e+"<"+t+">"}),""),n=n.reduceRight((function(e,t){return e+"</"+t+">"}),""),e.lineBreak||e.spacer?(e.spacer&&je("shaka.extern.Cue","Please use lineBreak instead of spacer."),"\n"):e.nestedCues.length?e.nestedCues.map(t).join(""):r+e.payload+n}var n=e.map((function(e){if(e.nestedCues.length){var n=e.clone();return n.nestedCues=[],n.payload=t(e),n}return e})),r=[];e=this.g.cues?Array.from(this.g.cues):[];for(var i={},o=(n=c(n)).next();!o.done;i={tb:i.tb},o=n.next())i.tb=o.value,e.some(function(e){return function(t){return t.startTime==e.tb.startTime&&t.endTime==e.tb.endTime&&t.text==e.tb.payload}}(i))||(o=Qa(i.tb))&&r.push(o);for(i=(e=c(e=r.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?r.indexOf(t)-r.indexOf(e):r.indexOf(e)-r.indexOf(t)})))).next();!i.done;i=e.next())this.g.addCue(i.value)},i.destroy=function(){return this.g&&(Za(this.g,(function(){return!0})),this.g.mode="disabled"),this.g=null,Promise.resolve()},i.isTextVisible=function(){return"showing"==this.g.mode},i.setTextVisibility=function(e){this.g.mode=e?"showing":"hidden"},V("shaka.text.SimpleTextDisplayer",Ja),Ja.prototype.setTextVisibility=Ja.prototype.setTextVisibility,Ja.prototype.isTextVisible=Ja.prototype.isTextVisible,Ja.prototype.destroy=Ja.prototype.destroy,Ja.prototype.append=Ja.prototype.append,Ja.prototype.remove=Ja.prototype.remove,V("shaka.util.Dom",es),es.removeAllChildren=ts,(i=ns.prototype).append=function(e){for(var t=[].concat(d(this.l)),n={},r=(e=c(e)).next();!r.done;n={ic:n.ic},r=e.next())n.ic=r.value,t.some(function(e){return function(t){return ue(t,e.ic)}}(n))||this.l.push(n.ic);is(this)},i.destroy=function(){this.u.removeChild(this.i),this.i=null,this.m=!1,this.l=[],this.D&&this.D.stop(),this.j.clear(),this.h&&(this.h.release(),this.h=null),this.s&&(this.s.disconnect(),this.s=null)},i.remove=function(e,t){return!!this.i&&(this.l=this.l.filter((function(n){return n.startTime<e||n.endTime>=t})),is(this),!0)},i.isTextVisible=function(){return this.m},i.setTextVisibility=function(e){this.m=e},V("shaka.text.UITextDisplayer",ns),ns.prototype.setTextVisibility=ns.prototype.setTextVisibility,ns.prototype.isTextVisible=ns.prototype.isTextVisible,ns.prototype.remove=ns.prototype.remove,ns.prototype.destroy=ns.prototype.destroy,ns.prototype.append=ns.prototype.append,V("shaka.text.WebVttGenerator",(function(){})),V("shaka.util.ConfigUtils",ss),ss.convertToConfigObject=ls,ss.mergeConfigObjects=us,V("shaka.util.PlayerConfiguration",cs),cs.mergeConfigObjects=fs,v(bs,sr),(i=bs.prototype).destroy=function(){var e,t=this;return L((function(n){switch(n.g){case 1:return t.l==ju?n.return():(t.l=ju,e=Ya(t.da,(function(){return{node:t.ta,payload:lu(),ib:!1}})),T(n,new Promise((function(t){e.Cb=function(){},e.Fc=function(){t()},e.mb=function(){t()},e.onError=function(){t()},e.Hc=function(){t()}})),2));case 2:return T(n,t.da.destroy(),3);case 3:if(t.h&&(t.h.release(),t.h=null),t.fd=null,t.u=null,t.o=null,t.j=null,t.oc=null,!t.O){n.v(0);break}return T(n,t.O.destroy(),5);case 5:t.O=null,x(n)}}))},i.Pb=function(e,t){if(t=void 0===t||t,this.l==ju)return Promise.reject(su());var n=lu();n.G=e,tn()||(t=!1);var r=t?this.ra:this.Oa,i=Ya(this.da,(function(){return{node:r,payload:n,ib:!1}}));return i.Cb=function(){},cu(i)},i.detach=function(){var e=this;if(this.l==ju)return Promise.reject(su());var t=Ya(this.da,(function(){return{node:e.ta,payload:lu(),ib:!1}}));return t.Cb=function(){},cu(t)},i.Sd=function(e){var t=this;if(e=void 0===e||e,this.l==ju)return Promise.reject(su());tn()||(e=!1);var n=lu(),r=Ya(this.da,(function(r){var i=r.G&&e?t.ra:r.G?t.Oa:t.ta;return n.G=r.G,{node:i,payload:n,ib:!1}}));return r.Cb=function(){},cu(r)},i.load=function(e,t,n){var r=this;if(this.l==ju)return Promise.reject(su());this.dispatchEvent(ws(bu));var i=lu();i.uri=e,i.Qd=Date.now()/1e3,n&&(i.mimeType=n),void 0!==t&&(i.startTime=t);var o=function(e,t){if(!tn())return!0;var n=t.mimeType,r=t.uri||"";if(n||(n=ii(r),n=Ku[n]),n){if(""==(t.G||ln()).canPlayType(n))return!1;if(!tn()||!(n in oi)&&!(ii(r)in ai)||e.o.streaming.preferNativeHls)return!0;if(an())return e.o.streaming.useNativeHlsOnSafari}return!1}(this,i)?this.Ma:this.N,a=Ya(this.da,(function(e){return null==e.G?null:(i.G=e.G,{node:o,payload:i,ib:!0})}));return this.j=new ys,a.Cb=function(){},new Promise((function(e,t){a.Hc=function(){return t(new ze(2,7,7002))},a.Fc=function(){e(),r.dispatchEvent(ws(yu))},a.mb=function(){return t(su())},a.onError=function(e){return t(e)}}))},i.configure=function(e,t){2==arguments.length&&"string"==typeof e&&(e=ls(e,t)),e.manifest&&e.manifest.dash&&"defaultPresentationDelay"in e.manifest.dash&&(je("manifest.dash.defaultPresentationDelay configuration","Please Use manifest.defaultPresentationDelay instead."),e.manifest.defaultPresentationDelay=e.manifest.dash.defaultPresentationDelay,delete e.manifest.dash.defaultPresentationDelay),e.streaming&&e.streaming.lowLatencyMode&&(void 0==e.streaming.inaccurateManifestTolerance&&(e.streaming.inaccurateManifestTolerance=0),void 0==e.streaming.rebufferingGoal&&(e.streaming.rebufferingGoal=.01));var n=fs(this.o,e,Ls(this));return Is(this),n},i.getConfiguration=function(){var e=Ls(this);return fs(e,this.o,Ls(this)),e},i.Te=function(){if(this.g){var e=this.g.buffered.length;e=e?this.g.buffered.end(e-1):0;var t=this.getConfiguration().streaming.bufferingGoal;if(e>=(t=Math.min(this.g.currentTime+t,this.cc().end)))return 1;if(!(e<=this.g.currentTime)&&e<t)return(e-this.g.currentTime)/(t-this.g.currentTime)}return 0},i.Mf=function(){for(var e in this.o)delete this.o[e];fs(this.o,Ls(this),Ls(this)),Is(this)},i.Ze=function(){return this.l},i.cf=function(){return this.g},i.Ub=function(){return this.O},i.od=function(){return this.Wa},i.be=function(){return this.D?this.D:null},i.X=function(){return this.B?this.B.presentationTimeline.X():!(!this.g||!this.g.src)&&1/0==this.g.duration},i.kb=function(){return!!this.B&&this.B.presentationTimeline.kb()},i.tf=function(){if(this.B){var e=this.B.variants;return!!e.length&&!e[0].video}return!(!this.g||!this.g.src)&&(this.g.videoTracks?0==this.g.videoTracks.length:0==this.g.videoHeight)},i.cc=function(){if(this.B){var e=this.B.presentationTimeline;return{start:e.yb(),end:e.Qa()}}return this.g&&this.g.src&&(e=this.g.seekable).length?{start:e.start(0),end:e.end(e.length-1)}:{start:0,end:0}},i.rf=function(){this.X()&&(this.g.currentTime=this.cc().end)},i.keySystem=function(){var e=this.drmInfo();return e?e.keySystem:""},i.drmInfo=function(){return this.m?this.m.i:null},i.Tb=function(){return this.m?this.m.Tb():1/0},i.zc=function(){return this.m?this.m.zc():{}},i.rd=function(){return!!this.J&&this.J.g==$n},i.ef=function(){return this.g?this.H?this.H.i:1:0},i.Vf=function(e){0==e?W("A trick play rate of 0 is unsupported!"):(this.g.paused&&this.g.play(),this.H.set(e),this.l==Ou&&(this.u.playbackRateChanged(e),La(this.i,1<Math.abs(e))))},i.Je=function(){var e=this.H.yc();this.l==Uu&&this.H.set(e),this.l==Ou&&(this.H.set(e),this.u.playbackRateChanged(e),La(this.i,!1))},i.Cc=function(){if(this.B){for(var e=this.i?this.i.h:null,t=[],n=0,r=c(this.B.variants),i=r.next();!i.done;i=r.next())if(Mn(i=i.value)){var o=xn(i);o.active=i==e,o.active||1==n||null==e||i.video!=e.video||i.audio!=e.audio||(o.active=!0),o.active&&n++,t.push(o)}return t}return this.g&&this.g.audioTracks?Array.from(this.g.audioTracks).map((function(e){return In(e)})):[]},i.hb=function(){if(this.B){for(var e=this.i?this.i.i:null,t=[],n=c(this.B.textStreams),r=n.next();!r.done;r=n.next()){var i=Sn(r=r.value);i.active=r==e,t.push(i)}return t}return this.g&&this.g.src&&this.g.textTracks?Cs(this).map((function(e){return kn(e)})):[]},i.Xe=function(){return this.B?this.B.imageStreams.map((function(e){return En(e)})):[]},i.nf=function(e,t){var n,r,i,o,a,s,u,l,c,d,f,h,p,g,m,v,y,b,w=this;return L((function(x){return 1==x.g?w.B?(n=w.B.imageStreams.find((function(t){return t.id==e})))?n.segmentIndex?x.v(3):T(x,n.createSegmentIndex(),3):x.return(null):x.v(2):2!=x.g?null==(r=n.segmentIndex.find(t))?x.return(null):(i=n.segmentIndex.get(r),o=i.tilesLayout||n.tilesLayout,(a=/(\d+)x(\d+)/.exec(o))?(s=n.width||0,u=n.height||0,l=parseInt(a[1],10),c=parseInt(a[2],10),d=s/l,f=u/c,h=l*c,p=i.j-i.startTime,g=p/h,m=i.startTime,y=v=0,1<h&&(b=Math.floor((t-i.startTime)/g),m=i.startTime+b*g,v=b%l*d,y=Math.floor(b/l)*f),x.return({height:f,positionX:v,positionY:y,startTime:m,duration:g,uris:i.ma(),width:d})):x.return(null)):x.return(null)}))},i.re=function(e){if(this.B&&this.i){var t=this.B.textStreams.find((function(t){return t.id==e.id}));t&&t!=this.i.i&&(vs(this.j.h,t,!1),_a(this.i,t),Xs(this),this.qa=t.language)}else if(this.g&&this.g.src&&this.g.textTracks){for(var n=(t=c(t=Cs(this))).next();!n.done;n=t.next())An(n=n.value)==e.id?n.mode=this.Y?"showing":"hidden":n.mode="disabled";Xs(this)}},i.se=function(e,t,n){if(t=void 0!==t&&t,n=void 0===n?0:n,this.B&&this.i){this.o.abr.enabled&&W("Changing tracks while abr manager is enabled will likely result in the selected track being overriden. Consider disabling abr before calling selectVariantTrack().");var r=this.B.variants.find((function(t){return t.id==e.id}));r&&Mn(r)&&(Hs(this,r,!1,t,n),this.pa=new zn(r),Bs(this))}else if(this.g&&this.g.audioTracks)for(n=(t=c(t=Array.from(this.g.audioTracks))).next();!n.done;n=t.next())if(An(n=n.value)==e.id){Ks(this,n);break}},i.Se=function(){return au(this.Cc())},i.mf=function(){return au(this.hb())},i.Re=function(){return Array.from(ou(this.Cc()))},i.lf=function(){return Array.from(ou(this.hb()))},i.Jd=function(e,t){if(this.B&&this.F){this.pa=new Xn(e,t||"",0,"");for(var n=function(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},r=this.i.h,i=this.pa.create(this.B.variants),o=null,a=(i=c(i.values())).next();!a.done;a=i.next())a=a.value,(!o||n(o,r)>n(a,r))&&(o=a);o?(n=xn(o),this.se(n,!0)):Vs(this)}else if(this.g&&this.g.audioTracks){for(i=Array.from(this.g.audioTracks),n=zt(e),o=r=null,a=(i=c(i)).next();!a.done;a=i.next()){var s=In(a=a.value);zt(s.language)==n&&(r=a,t?s.roles.includes(t)&&(o=a):0==s.roles.length&&(o=a))}o?Ks(this,o):r&&Ks(this,r)}},i.Kd=function(e,t,n){if(n=void 0!==n&&n,this.B&&this.F)this.qa=e,this.Nb=t||"",this.Xa=n,(e=Rn(this.B.textStreams,this.qa,this.Nb,this.Xa)[0]||null)&&e!=this.i.i&&(vs(this.j.h,e,!1),this.o.streaming.alwaysStreamText||this.sd())&&(_a(this.i,e),Xs(this));else{var r=zt(e);(e=this.hb().find((function(e){return zt(e.language)==r&&(!t||e.roles.includes(t))&&e.forced==n})))&&this.re(e)}},i.Nf=function(e){if(this.B&&this.F){for(var t=null,n=c(this.B.variants),r=n.next();!r.done;r=n.next())if((r=r.value).audio.label==e){t=r;break}null!=t&&(this.pa=new Xn(t.language,"",0,e),Vs(this))}},i.sd=function(){var e=this.Y;return this.L?this.L.m.isTextVisible():this.g&&this.g.src&&this.g.textTracks?Cs(this).some((function(e){return"showing"==e.mode})):e},i.ce=function(){return this.g&&this.g.src&&this.g.textTracks?Ms(this).map((function(e){return kn(e)})):[]},i.Ue=function(e){var t=zt(e),n=Ms(this).find((function(e){return zt(e.language)==t}));if(!n||!n.cues)return[];e=[];for(var r=(n=c(n.cues)).next();!r.done;r=n.next())r=r.value,e.push({title:r.text,startTime:r.startTime,endTime:r.endTime});return e},i.Tf=function(e){if(e=!!e,this.Y!=e){if(this.Y=e,this.l==Ou)this.L.m.setTextVisibility(e),this.o.streaming.alwaysStreamText||(e?this.i.i||0<(e=Rn(this.B.textStreams,this.qa,this.Nb,this.Xa)).length&&(_a(this.i,e[0]),Xs(this)):function(e){var t=e.g.get(dt);t&&(qa(t),za(t).catch((function(){})),e.g.delete(dt)),e.i=null}(this.i));else if(this.g&&this.g.src&&this.g.textTracks)for(var t=Cs(this),n=(t=c(t)).next();!n.done;n=t.next())"disabled"!=(n=n.value).mode&&(n.mode=e?"showing":"hidden");Ws(this)}},i.gf=function(){if(!this.X())return null;var e=this.da.l,t=0;if(this.F)t=this.F.l();else if(e){if(null==e.startTime)return new Date;t=e.startTime}return this.B?new Date(1e3*(this.B.presentationTimeline.j+t)):this.g&&this.g.getStartDate?(e=this.g.getStartDate(),isNaN(e.getTime())?null:new Date(e.getTime()+1e3*t)):null},i.de=function(){if(!this.X())return null;if(this.B)return new Date(1e3*this.B.presentationTimeline.j);if(this.g&&this.g.getStartDate){var e=this.g.getStartDate();return isNaN(e.getTime())?null:e}return null},i.xc=function(){if(this.l==Ou)return this.L.xc();var e={total:[],audio:[],video:[],text:[]};return this.l==Uu&&(e.total=jo(this.g.buffered)),e},i.getStats=function(){if(this.l!=Ou&&this.l!=Uu)return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,corruptedFrames:NaN,estimatedBandwidth:NaN,completionPercent:NaN,loadLatency:NaN,manifestTimeSeconds:NaN,drmTimeSeconds:NaN,playTime:NaN,pauseTime:NaN,bufferingTime:NaN,licenseTime:NaN,liveLatency:NaN,maxSegmentDuration:NaN,switchHistory:[],stateHistory:[]};Fs(this);var e=this.g,t=e.currentTime/e.duration;if(!isNaN(t)){var n=this.j;t=Math.round(100*t),n.i=isNaN(n.i)?t:Math.max(n.i,t)}e.getVideoPlaybackQuality&&(e=e.getVideoPlaybackQuality(),n=this.j,t=Number(e.totalVideoFrames),n.S=Number(e.droppedVideoFrames),n.N=t,this.j.L=Number(e.corruptedVideoFrames)),this.m?e=(e=this.m).F?e.F:NaN:e=NaN,this.j.m=e,this.l==Ou&&((e=this.i.h)&&(this.j.u=(this.H?this.H.i:1)*e.bandwidth),e&&e.video&&(n=this.j,t=e.video.height||NaN,n.Y=e.video.width||NaN,n.D=t),this.X()&&(e=this.de().valueOf()+1e3*this.cc().end,this.j.F=(Date.now()-e)/1e3),this.B&&this.B.presentationTimeline&&(this.j.J=this.B.presentationTimeline.g),e=this.u.getBandwidthEstimate(),this.j.s=e);var r=this.j;e=r.Y,n=r.D,t=r.u;for(var i=r.N,o=r.S,a=r.L,s=r.s,u=r.i,l=r.l,d=r.H,f=r.j,h=gs(r.g,"playing"),p=gs(r.g,"paused"),g=gs(r.g,"buffering"),m=r.m,v=r.F,y=r.J,b=function(e){function t(e){return{timestamp:e.timestamp,state:e.state,duration:e.duration}}for(var n=[],r=c(e.h),i=r.next();!i.done;i=r.next())n.push(t(i.value));return e.g&&n.push(t(e.g)),n}(r.g),w=[],T=(r=c(r.h.g)).next();!T.done;T=r.next())T=T.value,w.push({timestamp:T.timestamp,id:T.id,type:T.type,fromAdaptation:T.fromAdaptation,bandwidth:T.bandwidth});return{width:e,height:n,streamBandwidth:t,decodedFrames:i,droppedFrames:o,corruptedFrames:a,estimatedBandwidth:s,completionPercent:u,loadLatency:l,manifestTimeSeconds:d,drmTimeSeconds:f,playTime:h,pauseTime:p,bufferingTime:g,licenseTime:m,liveLatency:v,maxSegmentDuration:y,stateHistory:b,switchHistory:w}},i.addTextTrack=function(e,t,n,r,i,o,a){if(a=void 0!==a&&a,je("addTextTrack","Please use an addTextTrackAsync."),this.l!=Ou&&this.l!=Uu)throw new ze(1,7,7004);if(!r){var s=ii(e);if(!(r=Gu[s]))throw new ze(1,2,2011,s)}if(this.l==Uu){if("text/vtt"!=r)throw new ze(1,2,2013,r);if(a&&(n="forced"),(r=document.createElement("track")).src=e,r.label=o||"",r.kind=n,r.srclang=t,this.g.getAttribute("crossorigin")||this.g.setAttribute("crossorigin","anonymous"),this.g.appendChild(r),e=this.hb().find((function(e){return e.language==t&&e.label==(o||"")&&e.kind==n})))return qs(this),e;throw new ze(1,2,2012)}if(1/0==(s=this.B.presentationTimeline.getDuration()))throw new ze(1,4,4033);if(!Ft(Lt((e={id:this.nd++,originalId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:wa(0,s,[e]),mimeType:r||"",codecs:i||"",kind:n,encrypted:!1,drmInfos:[],keyIds:new Set,language:t,label:o||null,type:dt,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!!a,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null}).mimeType,e.codecs)))throw new ze(2,2,2014,r);return this.B.textStreams.push(e),qs(this),Sn(e)},i.Fe=function(e,t,n,r,i,o,a){a=void 0!==a&&a;var s,u,l,c,d,f,h,p,g,m,v=this;return L((function(y){switch(y.g){case 1:if(v.l!=Ou&&v.l!=Uu)throw new ze(1,7,7004);if(r){y.v(2);break}return T(y,Ds(v,e),3);case 3:r=y.h;case 2:if(s=[],v.D)try{s=v.D.getServerSideCuePoints()}catch(b){}if(v.l!=Uu){y.v(4);break}return a&&(n="forced"),T(y,Rs(v,e,t,n,r,o||"",s),5);case 5:if(u=v.hb(),l=u.find((function(e){return e.language==t&&e.label==(o||"")&&e.kind==n})))return qs(v),y.return(l);throw new ze(1,2,2012);case 4:if(c=ft,1/0==(d=v.B.presentationTimeline.getDuration()))throw new ze(1,4,4033);if(!s.length){y.v(6);break}return T(y,Ns(e,v.O,v.o.streaming.retryParameters),7);case 7:f=y.h,h=Ps(v,f,r,s),p=new Blob([h],{type:"text/vtt"}),e=$o(p),r="text/vtt";case 6:if(g={id:v.nd++,originalId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:wa(0,d,[e]),mimeType:r||"",codecs:i||"",kind:n,encrypted:!1,drmInfos:[],keyIds:new Set,language:t,label:o||null,type:c.aa,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!!a,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null},m=Lt(g.mimeType,g.codecs),!Ft(m))throw new ze(2,2,2014,r);return v.B.textStreams.push(g),qs(v),y.return(Sn(g))}}))},i.Ee=function(e,t,n){var r,i,o,a,s,u,l,d=this;return L((function(f){switch(f.g){case 1:if(d.l!=Ou&&d.l!=Uu)throw new ze(1,7,7004);if(n){f.v(2);break}return T(f,Ds(d,e),3);case 3:n=f.h;case 2:if(r=[],d.D)try{r=d.D.getServerSideCuePoints()}catch(h){}return T(f,Rs(d,e,t,"chapters",n,"",r),4);case 4:if(i=d.ce(),o=i.find((function(e){return e.language==t}))){for(a=Ms(d),s=c(a),u=s.next();!u.done;u=s.next())l=u.value,Ss(d,l);return f.return(o)}throw new ze(1,2,2012)}}))},i.Nd=function(e,t){this.md.width=e,this.md.height=t},i.Hd=function(){if(this.l==Ou){var e=this.i;if(e.I.g)e=!1;else if(e.j)e=!1;else{for(var t=c(e.g.values()),n=t.next();!n.done;n=t.next())(n=n.value).Xb&&(n.Xb=!1,Ga(e,n,.1));e=!0}}else e=!1;return e},i.$e=function(){return W("Shaka Player's internal Manifest structure is NOT covered by semantic versioning compatibility guarantees. It may change at any time! Please consider filing a feature request for whatever you use getManifest() for."),this.B},i.af=function(){return this.sc},i.we=function(e){this.oc=e},V("shaka.Player",bs),bs.prototype.setVideoContainer=bs.prototype.we,bs.prototype.getManifestParserFactory=bs.prototype.af,bs.prototype.getManifest=bs.prototype.$e,bs.prototype.retryStreaming=bs.prototype.Hd,bs.prototype.setMaxHardwareResolution=bs.prototype.Nd,bs.prototype.addChaptersTrack=bs.prototype.Ee,bs.prototype.addTextTrackAsync=bs.prototype.Fe,bs.prototype.addTextTrack=bs.prototype.addTextTrack,bs.prototype.getStats=bs.prototype.getStats,bs.prototype.getBufferedInfo=bs.prototype.xc,bs.prototype.getPresentationStartTimeAsDate=bs.prototype.de,bs.prototype.getPlayheadTimeAsDate=bs.prototype.gf,bs.prototype.setTextTrackVisibility=bs.prototype.Tf,bs.prototype.getChapters=bs.prototype.Ue,bs.prototype.getChaptersTracks=bs.prototype.ce,bs.prototype.isTextTrackVisible=bs.prototype.sd,bs.prototype.selectVariantsByLabel=bs.prototype.Nf,bs.prototype.selectTextLanguage=bs.prototype.Kd,bs.prototype.selectAudioLanguage=bs.prototype.Jd,bs.prototype.getTextLanguages=bs.prototype.lf,bs.prototype.getAudioLanguages=bs.prototype.Re,bs.prototype.getTextLanguagesAndRoles=bs.prototype.mf,bs.prototype.getAudioLanguagesAndRoles=bs.prototype.Se,bs.prototype.selectVariantTrack=bs.prototype.se,bs.prototype.selectTextTrack=bs.prototype.re,bs.prototype.getThumbnails=bs.prototype.nf,bs.prototype.getImageTracks=bs.prototype.Xe,bs.prototype.getTextTracks=bs.prototype.hb,bs.prototype.getVariantTracks=bs.prototype.Cc,bs.prototype.cancelTrickPlay=bs.prototype.Je,bs.prototype.trickPlay=bs.prototype.Vf,bs.prototype.getPlaybackRate=bs.prototype.ef,bs.prototype.isBuffering=bs.prototype.rd,bs.prototype.getKeyStatuses=bs.prototype.zc,bs.prototype.getExpiration=bs.prototype.Tb,bs.prototype.drmInfo=bs.prototype.drmInfo,bs.prototype.keySystem=bs.prototype.keySystem,bs.prototype.goToLive=bs.prototype.rf,bs.prototype.seekRange=bs.prototype.cc,bs.prototype.isAudioOnly=bs.prototype.tf,bs.prototype.isInProgress=bs.prototype.kb,bs.prototype.isLive=bs.prototype.X,bs.prototype.getAdManager=bs.prototype.be,bs.prototype.getAssetUri=bs.prototype.od,bs.prototype.getNetworkingEngine=bs.prototype.Ub,bs.prototype.getMediaElement=bs.prototype.cf,bs.prototype.getLoadMode=bs.prototype.Ze,bs.prototype.resetConfiguration=bs.prototype.Mf,bs.prototype.getBufferFullness=bs.prototype.Te,bs.prototype.getConfiguration=bs.prototype.getConfiguration,bs.prototype.configure=bs.prototype.configure,bs.prototype.load=bs.prototype.load,bs.prototype.unload=bs.prototype.Sd,bs.prototype.detach=bs.prototype.detach,bs.prototype.attach=bs.prototype.Pb,bs.probeSupport=function(e){var t,n,r,i,o;return e=void 0===e||e,L((function(a){if(1==a.g)return t={},e?T(a,function(){var e,t,n,r,i,o;return L((function(a){return 1==a.g?(e="org.w3.clearkey com.widevine.alpha com.microsoft.playready com.microsoft.playready.recommendation com.apple.fps.3_0 com.apple.fps.2_0 com.apple.fps.1_0 com.apple.fps com.adobe.primetime".split(" "),n=[{videoCapabilities:t=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],persistentState:"required",sessionTypes:["persistent-license"]},{initDataTypes:["cenc"],videoCapabilities:t}],r=new Map,i=function(e){var t,i,o;return L((function(a){switch(a.g){case 1:return S(a,2),T(a,navigator.requestMediaKeySystemAccess(e,n),4);case 4:return t=a.h,o=!!(i=t.getConfiguration().sessionTypes)&&i.includes("persistent-license"),un("Tizen 3")&&(o=!1),r.set(e,{persistentState:o}),T(a,t.createMediaKeys(),5);case 5:A(a,0);break;case 2:k(a),r.set(e,null),x(a)}}))},o=e.map((function(e){return i(e)})),T(a,Promise.all(o),2)):a.return(Dr(r))}))}(),3):a.v(2);2!=a.g&&(t=a.h);var s={};if(tn()){for(var u in oi)s[u]=!0;for(var l in ai)s[l]=!0}u={mpd:"application/dash+xml",m3u8:"application/x-mpegurl",ism:"application/vnd.ms-sstr+xml"};for(var d=(l=c(["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"])).next();!d.done;d=l.next())s[d=d.value]=tn()?!!oi[d]:nn(d);for(var f in u)s[f]=tn()?!!ai[f]:nn(u[f]);for(n=s,s={},u=(f=c('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",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="opus",audio/mp4; codecs="flac",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(","))).next();!u.done;u=f.next())s[u=u.value]=tn()?!!Ft(u)||(MediaSource.isTypeSupported(u)||Rt(u)):nn(u),s[l=u.split(";")[0]]=s[l]||s[u];for(o in r={manifest:n,media:s,drm:t},i=Vu)r[o]=i[o]();return a.return(r)}))},bs.isBrowserSupported=function(){return true; if(e.Promise||W("A Promise implementation or polyfill is required"),e.TextDecoder&&e.TextEncoder||W("A TextDecoder/TextEncoder implementation or polyfill is required"),!(e.Promise&&e.Uint8Array&&e.TextDecoder&&e.TextEncoder&&Array.prototype.forEach))return!1;var t=navigator.appVersion.includes("Win")&&navigator.platform.includes("Win"),n=navigator.appVersion.includes("Mac")&&navigator.platform.includes("Mac");return!(!t&&!n||un("Trident/"))&&(!((t=sn())&&12>t||!(e.MediaKeys&&e.navigator&&e.navigator.requestMediaKeySystemAccess&&e.MediaKeySystemAccess&&e.MediaKeySystemAccess.prototype.getConfiguration))&&(!!tn()||nn("application/x-mpegurl")))},bs.setAdManagerFactory=function(e){Hu=e},bs.registerSupportPlugin=function(e,t){Vu[e]=t},bs.prototype.destroy=bs.prototype.destroy;var du="abrstatuschanged",fu="adaptation",hu="buffering",pu="drmsessionupdate",gu="emsg",mu="error",vu="expirationupdated",yu="loaded",bu="loading",wu="manifestparsed",Tu="metadata",xu="onstatechange",Su="onstateidle",Eu="ratechange",Au="streaming",ku="textchanged",Iu="texttrackvisibility",Cu="timelineregionadded",Mu="timelineregionenter",Du="timelineregionexit",Ru="trackschanged",Nu="unloading",Pu="variantchanged",Lu={bg:du,cg:fu,dg:hu,eg:pu,gg:gu,Error:mu,hg:vu,ig:"largegap",jg:yu,kg:bu,lg:wu,Metadata:Tu,mg:xu,ng:Su,og:Eu,pg:"sessiondata",qg:Au,rg:ku,sg:Iu,tg:Cu,ug:Mu,vg:Du,wg:Ru,xg:Nu,yg:Pu},ju=0,_u=1,Ou=2,Uu=3;bs.LoadMode={DESTROYED:ju,NOT_LOADED:_u,MEDIA_SOURCE:Ou,SRC_EQUALS:Uu},bs.version="3.2.1-npm-dirty";var Fu=["","2"];Ue=new function(e){this.g=e,this.i=_e,this.h=Oe}(new Le(Number(Fu[0]),Number(Fu[1])));var Bu=["output-restricted","internal-error"],Vu={},Hu=null,Ku={mp4:"video/mp4",m4v:"video/mp4",m4a:"audio/mp4",webm:"video/webm",weba:"audio/webm",mkv:"video/webm",ts:"video/mp2t",ogv:"video/ogg",ogg:"audio/ogg",mpg:"video/mpeg",mpeg:"video/mpeg",m3u8:"application/x-mpegurl",mp3:"audio/mpeg",aac:"audio/aac",flac:"audio/flac",wav:"audio/wav"},Gu={sbv:"text/x-subviewer",srt:"text/srt",vtt:"text/vtt",webvtt:"text/vtt",ttml:"application/ttml+xml",lrc:"application/x-subtitle-lrc",ssa:"text/x-ssa",ass:"text/x-ssa"};function qu(){this.h=[],this.j=this.i=this.g=0}function zu(e,t){var n=this;this.i=e,this.g=t,this.j=!1,this.l=this.g.getVolume(),this.h=new Sr,this.h.A(this.g,google.ima.AdEvent.Type.PAUSED,(function(){n.j=!0})),this.h.A(this.g,google.ima.AdEvent.Type.RESUMED,(function(){n.j=!1}))}function Xu(t,n,r,i){var o=this;this.m=t,this.g=n,this.u=null,this.D=NaN,this.j=i,this.s=null,this.h=new Sr,google.ima.settings.setLocale(r),(t=new google.ima.AdDisplayContainer(this.m,this.g)).initialize(),this.l=new google.ima.AdsLoader(t),this.l.getSettings().setPlayerType("shaka-player"),this.l.getSettings().setPlayerVersion("3.2.1-npm-dirty"),this.i=null,this.h.wa(this.l,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,(function(t){!function(n,r){n.j(new ar("ads-loaded",{loadTime:Date.now()/1e3-n.D})),n.i=r.getAdsManager(n.g),n.j(new ar("ima-ad-manager-loaded",{imaAdManager:n.i}));var i=n.i.getCuePoints();if(i.length){for(var o=[],a=(i=c(i)).next();!a.done;a=i.next())o.push({start:a.value,end:null});n.j(new ar("ad-cue-points-changed",{cuepoints:o}))}!function(e){e.h.A(e.i,google.ima.AdErrorEvent.Type.AD_ERROR,(function(t){Wu(e,t)})),e.h.A(e.i,google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,(function(t){Yu(e,t)})),e.h.A(e.i,google.ima.AdEvent.Type.STARTED,(function(t){Yu(e,t)})),e.h.A(e.i,google.ima.AdEvent.Type.FIRST_QUARTILE,(function(t){e.j(new ar("ad-first-quartile",{originalEvent:t}))})),e.h.A(e.i,google.ima.AdEvent.Type.MIDPOINT,(function(t){e.j(new ar("ad-midpoint",{originalEvent:t}))})),e.h.A(e.i,google.ima.AdEvent.Type.THIRD_QUARTILE,(function(t){e.j(new ar("ad-third-quartile",{originalEvent:t}))})),e.h.A(e.i,google.ima.AdEvent.Type.COMPLETE,(function(t){e.j(new ar("ad-complete",{originalEvent:t}))})),e.h.A(e.i,google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,(function(t){$u(e,t)})),e.h.A(e.i,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,(function(t){$u(e,t)})),e.h.A(e.i,google.ima.AdEvent.Type.SKIPPED,(function(t){e.j(new ar("ad-skipped",{originalEvent:t}))})),e.h.A(e.i,google.ima.AdEvent.Type.VOLUME_CHANGED,(function(t){e.j(new ar("ad-volume-changed",{originalEvent:t}))})),e.h.A(e.i,google.ima.AdEvent.Type.VOLUME_MUTED,(function(t){e.j(new ar("ad-muted",{originalEvent:t}))})),e.h.A(e.i,google.ima.AdEvent.Type.PAUSED,(function(t){e.s.j=!0,e.j(new ar("ad-paused",{originalEvent:t}))})),e.h.A(e.i,google.ima.AdEvent.Type.RESUMED,(function(t){e.s.j=!1,e.j(new ar("ad-resumed",{originalEvent:t}))})),e.h.A(e.i,google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,(function(t){e.j(new ar("ad-skip-state-changed",{originalEvent:t}))})),e.h.A(e.i,google.ima.AdEvent.Type.CLICK,(function(t){e.j(new ar("ad-clicked",{originalEvent:t}))})),e.h.A(e.i,google.ima.AdEvent.Type.AD_PROGRESS,(function(t){e.j(new ar("ad-progress",{originalEvent:t}))})),e.h.A(e.i,google.ima.AdEvent.Type.AD_BUFFERING,(function(t){e.j(new ar("ad-buffering",{originalEvent:t}))})),e.h.A(e.i,google.ima.AdEvent.Type.IMPRESSION,(function(t){e.j(new ar("ad-impression",{originalEvent:t}))})),e.h.A(e.i,google.ima.AdEvent.Type.DURATION_CHANGE,(function(t){e.j(new ar("ad-duration-changed",{originalEvent:t}))})),e.h.A(e.i,google.ima.AdEvent.Type.USER_CLOSE,(function(t){e.j(new ar("ad-closed",{originalEvent:t}))})),e.h.A(e.i,google.ima.AdEvent.Type.LOADED,(function(t){e.j(new ar("ad-loaded",{originalEvent:t}))})),e.h.A(e.i,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,(function(t){e.j(new ar("all-ads-completed",{originalEvent:t}))})),e.h.A(e.i,google.ima.AdEvent.Type.LINEAR_CHANGED,(function(t){e.j(new ar("ad-linear-changed",{originalEvent:t}))})),e.h.A(e.i,google.ima.AdEvent.Type.AD_METADATA,(function(t){e.j(new ar("ad-metadata",{originalEvent:t}))})),e.h.A(e.i,google.ima.AdEvent.Type.LOG,(function(t){e.j(new ar("ad-recoverable-error",{originalEvent:t}))})),e.h.A(e.i,google.ima.AdEvent.Type.AD_BREAK_READY,(function(t){e.j(new ar("ad-break-ready",{originalEvent:t}))})),e.h.A(e.i,google.ima.AdEvent.Type.INTERACTION,(function(t){e.j(new ar("ad-interaction",{originalEvent:t}))}))}(n);try{n.i.init(n.g.offsetWidth,n.g.offsetHeight,document.fullscreenElement?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL),n.h.A(n.g,"loadeddata",(function(){n.i.resize(n.g.offsetWidth,n.g.offsetHeight,document.fullscreenElement?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)})),"ResizeObserver"in e&&(n.u=new ResizeObserver((function(){n.i.resize(n.g.offsetWidth,n.g.offsetHeight,document.fullscreenElement?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)})),n.u.observe(n.g)),n.i.start()}catch(t){$u(n,null)}}(o,t)})),this.h.A(this.l,google.ima.AdErrorEvent.Type.AD_ERROR,(function(e){Wu(o,e)})),this.g.onended=function(){o.l.contentComplete()}}function Wu(e,t){t.getError(),$u(e,null),e.j(new ar("ad-cue-points-changed",{cuepoints:[]}))}function Yu(e,t){var n=t.getAd();e.s=new zu(n,e.i),e.j(new ar("ad-started",{ad:e.s,sdkAdObject:n,originalEvent:t})),e.m.setAttribute("ad-active","true"),e.g.pause()}function $u(e,t){e.j(new ar("ad-stopped",{originalEvent:t})),e.m.removeAttribute("ad-active"),e.g.play()}function Ju(e,t){this.i=e,this.h=null,this.g=t}function Qu(e,t,n,r){var i=this;this.u=e,this.g=t,this.l=null,this.L=NaN,this.j=r,this.J=!1,this.D=this.m=this.s=null,this.F="",this.H=[],this.h=new Sr,(e=new google.ima.dai.api.UiSettings).setLocale(n),this.i=new google.ima.dai.api.StreamManager(this.g,this.u,e),this.j(new ar("ima-stream-manager-loaded",{imaStreamManager:this.i})),this.h.A(this.i,google.ima.dai.api.StreamEvent.Type.LOADED,(function(e){!function(e,t){e.j(new ar("ads-loaded",{loadTime:Date.now()/1e3-e.L}));var n=t.getStreamData().url;e.l.resolve(n),e.l=null,e.J||e.h.A(e.g,"seeked",(function(){var t=e.g.currentTime;if(0!=t){e.i.streamTimeForContentTime(t);var n=e.i.previousCuePointForStreamTime(t);n&&!n.played&&(e.s=t,e.g.currentTime=n.start)}}))}(i,e)})),this.h.A(this.i,google.ima.dai.api.StreamEvent.Type.ERROR,(function(){i.F.length?i.l.resolve(i.F):i.l.reject("IMA Stream request returned an error and there was no backup asset uri provided."),i.l=null})),this.h.A(this.i,google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED,(function(){})),this.h.A(this.i,google.ima.dai.api.StreamEvent.Type.STARTED,(function(e){e=e.getAd(),i.m=new Ju(e,i.g),i.D&&(i.m.h=i.D),i.j(new ar("ad-started",{ad:i.m})),i.u.setAttribute("ad-active","true")})),this.h.A(this.i,google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED,(function(){i.u.removeAttribute("ad-active");var e=i.g.currentTime;i.s&&i.s>e&&(i.g.currentTime=i.s,i.s=null)})),this.h.A(this.i,google.ima.dai.api.StreamEvent.Type.AD_PROGRESS,(function(e){i.D=e.getStreamData().adProgressData,i.m&&(i.m.h=i.D)})),this.h.A(this.i,google.ima.dai.api.StreamEvent.Type.FIRST_QUARTILE,(function(){i.j(new ar("ad-first-quartile"))})),this.h.A(this.i,google.ima.dai.api.StreamEvent.Type.MIDPOINT,(function(){i.j(new ar("ad-midpoint"))})),this.h.A(this.i,google.ima.dai.api.StreamEvent.Type.THIRD_QUARTILE,(function(){i.j(new ar("ad-third-quartile"))})),this.h.A(this.i,google.ima.dai.api.StreamEvent.Type.COMPLETE,(function(){i.j(new ar("ad-complete")),i.j(new ar("ad-stopped")),i.u.removeAttribute("ad-active"),i.m=null})),this.h.A(this.i,google.ima.dai.api.StreamEvent.Type.SKIPPED,(function(){i.j(new ar("ad-skipped")),i.j(new ar("ad-stopped"))})),this.h.A(this.i,google.ima.dai.api.StreamEvent.Type.CUEPOINTS_CHANGED,(function(e){var t=e.getStreamData();e=[];for(var n=(t=c(t.cuepoints)).next();!n.done;n=t.next())n=n.value,e.push({start:n.start,end:n.end});i.H=e,i.j(new ar("ad-cue-points-changed",{cuepoints:e}))}))}function Zu(){sr.call(this),this.g=this.h=null,this.j=new qu,this.i=navigator.language}function el(e){return JSON.stringify(e,(function(e,t){if("function"!=typeof t){if(t instanceof Event||t instanceof ar){var n={};for(i in t){var r=t[i];r&&"object"==typeof r?"detail"==i&&(n[i]=r):i in Event||(n[i]=r)}return n}if(t instanceof Error){var i=new Set(["name","message","stack"]);for(n in t)i.add(n);for(n=(r=c(Object.getOwnPropertyNames(t))).next();!n.done;n=r.next())i.add(n.value);for(r={},n=(i=c(i)).next();!n.done;n=i.next())r[n=n.value]=t[n];i={__type__:"Error",contents:r}}else if(t instanceof TimeRanges)for(i={__type__:"TimeRanges",length:t.length,start:[],end:[]},r=(n=c(jo(t))).next();!r.done;r=n.next()){var o=(r=r.value).end;i.start.push(r.start),i.end.push(o)}else i=t instanceof Uint8Array?{__type__:"Uint8Array",entries:Array.from(t)}:"number"==typeof t?isNaN(t)?"NaN":isFinite(t)?t:0>t?"-Infinity":"Infinity":t;return i}}))}function tl(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__){n=t.contents;var r,i=Error(n.message);for(r in n)i[r]=n[r];n=i}else n=t;return n}))}(i=zu.prototype).getDuration=function(){return this.i.getDuration()},i.getMinSuggestedDuration=function(){return this.i.getMinSuggestedDuration()},i.getRemainingTime=function(){return this.g.getRemainingTime()},i.isPaused=function(){return this.j},i.isSkippable=function(){return 0<=this.i.getSkipTimeOffset()},i.getTimeUntilSkippable=function(){var e=this.i.getSkipTimeOffset();return e=this.getRemainingTime()-e,Math.max(e,0)},i.canSkipNow=function(){return this.g.getAdSkippableState()},i.skip=function(){return this.g.skip()},i.pause=function(){return this.g.pause()},i.play=function(){return this.g.resume()},i.getVolume=function(){return this.g.getVolume()},i.setVolume=function(e){return this.g.setVolume(e)},i.isMuted=function(){return 0==this.g.getVolume()},i.resize=function(e,t){this.g.resize(e,t,document.fullscreenElement?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)},i.setMuted=function(e){e?(this.l=this.getVolume(),this.setVolume(0)):this.setVolume(this.l)},i.getSequenceLength=function(){var e=this.i.getAdPodInfo();return null==e?1:e.getTotalAds()},i.getPositionInSequence=function(){var e=this.i.getAdPodInfo();return null==e?1:e.getAdPosition()},i.release=function(){this.g=this.i=null},V("shaka.ads.ClientSideAd",zu),zu.prototype.release=zu.prototype.release,zu.prototype.getPositionInSequence=zu.prototype.getPositionInSequence,zu.prototype.getSequenceLength=zu.prototype.getSequenceLength,zu.prototype.setMuted=zu.prototype.setMuted,zu.prototype.resize=zu.prototype.resize,zu.prototype.isMuted=zu.prototype.isMuted,zu.prototype.setVolume=zu.prototype.setVolume,zu.prototype.getVolume=zu.prototype.getVolume,zu.prototype.play=zu.prototype.play,zu.prototype.pause=zu.prototype.pause,zu.prototype.skip=zu.prototype.skip,zu.prototype.canSkipNow=zu.prototype.canSkipNow,zu.prototype.getTimeUntilSkippable=zu.prototype.getTimeUntilSkippable,zu.prototype.isSkippable=zu.prototype.isSkippable,zu.prototype.isPaused=zu.prototype.isPaused,zu.prototype.getRemainingTime=zu.prototype.getRemainingTime,zu.prototype.getMinSuggestedDuration=zu.prototype.getMinSuggestedDuration,zu.prototype.getDuration=zu.prototype.getDuration,Xu.prototype.stop=function(){this.i&&this.i.stop(),this.m&&ts(this.m)},Xu.prototype.release=function(){this.stop(),this.u&&this.u.disconnect(),this.h&&this.h.release(),this.i&&this.i.destroy(),this.l.destroy()},(i=Ju.prototype).getDuration=function(){return this.h?this.h.duration:-1},i.getMinSuggestedDuration=function(){return this.getDuration()},i.getRemainingTime=function(){return this.h?this.h.duration-this.h.currentTime:-1},i.isPaused=function(){return this.g.paused},i.isSkippable=function(){return this.i.isSkippable()},i.getTimeUntilSkippable=function(){var e=this.i.getSkipTimeOffset();return e=this.getRemainingTime()-e,Math.max(e,0)},i.canSkipNow=function(){return 0==this.getTimeUntilSkippable()},i.skip=function(){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.resize=function(){},i.setMuted=function(e){this.g.muted=e},i.getSequenceLength=function(){var e=this.i.getAdPodInfo();return null==e?1:e.getTotalAds()},i.getPositionInSequence=function(){var e=this.i.getAdPodInfo();return null==e?1:e.getAdPosition()},i.release=function(){this.g=this.h=this.i=null},V("shaka.ads.ServerSideAd",Ju),Ju.prototype.release=Ju.prototype.release,Ju.prototype.getPositionInSequence=Ju.prototype.getPositionInSequence,Ju.prototype.getSequenceLength=Ju.prototype.getSequenceLength,Ju.prototype.setMuted=Ju.prototype.setMuted,Ju.prototype.resize=Ju.prototype.resize,Ju.prototype.isMuted=Ju.prototype.isMuted,Ju.prototype.setVolume=Ju.prototype.setVolume,Ju.prototype.getVolume=Ju.prototype.getVolume,Ju.prototype.play=Ju.prototype.play,Ju.prototype.pause=Ju.prototype.pause,Ju.prototype.skip=Ju.prototype.skip,Ju.prototype.canSkipNow=Ju.prototype.canSkipNow,Ju.prototype.getTimeUntilSkippable=Ju.prototype.getTimeUntilSkippable,Ju.prototype.isSkippable=Ju.prototype.isSkippable,Ju.prototype.isPaused=Ju.prototype.isPaused,Ju.prototype.getRemainingTime=Ju.prototype.getRemainingTime,Ju.prototype.getMinSuggestedDuration=Ju.prototype.getMinSuggestedDuration,Ju.prototype.getDuration=Ju.prototype.getDuration,Qu.prototype.stop=function(){this.F="",this.s=null,this.H=[]},Qu.prototype.release=function(){this.stop(),this.h&&this.h.release()},Qu.prototype.onCueMetadataChange=function(e){if(e.key&&e.data){var t={};t[e.key]=e.data,this.i.onTimedMetadata(t)}},v(Zu,sr),(i=Zu.prototype).setLocale=function(e){this.i=e},i.initClientSide=function(t,n){var r=this;if(!e.google||!google.ima||!google.ima.AdsLoader)throw new ze(2,10,1e4);this.h&&this.h.release(),this.h=new Xu(t,n,this.i,(function(e){if(e&&e.type)switch(e.type){case"ads-loaded":r.j.h.push(e.loadTime);break;case"ad-started":r.j.g++;break;case"ad-complete":r.j.i++;break;case"ad-skipped":r.j.j++}r.dispatchEvent(e)}))},i.release=function(){this.h&&(this.h.release(),this.h=null),this.g&&(this.g.release(),this.g=null)},i.onAssetUnload=function(){this.h&&this.h.stop(),this.g&&this.g.stop(),this.dispatchEvent(new ar("ad-stopped")),this.j=new qu},i.requestClientSideAds=function(e){if(!this.h)throw new ze(1,10,10001);var t=this.h;t.D=Date.now()/1e3,t.l.requestAds(e)},i.initServerSide=function(t,n){var r=this;if(!e.google||!google.ima||!google.ima.dai)throw new ze(2,10,10002);this.g&&this.g.release(),this.g=new Qu(t,n,this.i,(function(e){if(e&&e.type)switch(e.type){case"ads-loaded":r.j.h.push(e.loadTime);break;case"ad-started":r.j.g++;break;case"ad-complete":r.j.i++;break;case"ad-skipped":r.j.j++}r.dispatchEvent(e)}))},i.requestServerSideStream=function(e,t){if(t=void 0===t?"":t,!this.g)throw new ze(1,10,10003);e.adTagParameters||(e.adTagParameters={});var n=e.adTagParameters;(n.mpt||n.mpv)&&W('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overriden.'),e.adTagParameters.mpt="shaka-player",e.adTagParameters.mpv="3.2.1-npm-dirty";var r=t;return(n=this.g).l?n=Promise.reject(new ze(1,10,10004)):(e instanceof google.ima.dai.api.LiveStreamRequest&&(n.J=!0),n.l=new pt,n.i.requestStream(e),n.F=r||"",n.L=Date.now()/1e3,n=n.l),n},i.replaceServerSideAdTagParameters=function(e){if(!this.g)throw new ze(1,10,10003);(e.mpt||e.mpv)&&W('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overriden.'),e.mpt="Shaka Player",e.mpv="3.2.1-npm-dirty",this.g.i.replaceAdTagParameters(e)},i.getServerSideCuePoints=function(){if(!this.g)throw new ze(1,10,10003);return this.g.H},i.getStats=function(){var e=this.j;return{loadTimes:e.h,started:e.g,playedCompletely:e.i,skipped:e.j}},i.onDashTimedMetadata=function(e){if(this.g&&"urn:google:dai:2018"==e.schemeIdUri){var t=e.schemeIdUri,n=e.eventElement?e.eventElement.getAttribute("messageData"):null;this.g.i.processMetadata(t,n,e.startTime)}},i.onHlsTimedMetadata=function(e,t){this.g&&this.g.i.processMetadata("ID3",e.data,t)},i.onCueMetadataChange=function(e){this.g&&this.g.onCueMetadataChange(e)},V("shaka.ads.AdManager",Zu),Zu.prototype.onCueMetadataChange=Zu.prototype.onCueMetadataChange,Zu.prototype.onHlsTimedMetadata=Zu.prototype.onHlsTimedMetadata,Zu.prototype.onDashTimedMetadata=Zu.prototype.onDashTimedMetadata,Zu.prototype.getStats=Zu.prototype.getStats,Zu.prototype.getServerSideCuePoints=Zu.prototype.getServerSideCuePoints,Zu.prototype.replaceServerSideAdTagParameters=Zu.prototype.replaceServerSideAdTagParameters,Zu.prototype.requestServerSideStream=Zu.prototype.requestServerSideStream,Zu.prototype.initServerSide=Zu.prototype.initServerSide,Zu.prototype.requestClientSideAds=Zu.prototype.requestClientSideAds,Zu.prototype.onAssetUnload=Zu.prototype.onAssetUnload,Zu.prototype.release=Zu.prototype.release,Zu.prototype.initClientSide=Zu.prototype.initClientSide,Zu.prototype.setLocale=Zu.prototype.setLocale,Zu.ADS_LOADED="ads-loaded",Zu.AD_STARTED="ad-started",Zu.AD_FIRST_QUARTILE="ad-first-quartile",Zu.AD_MIDPOINT="ad-midpoint",Zu.AD_THIRD_QUARTILE="ad-third-quartile",Zu.AD_COMPLETE="ad-complete",Zu.AD_STOPPED="ad-stopped",Zu.AD_SKIPPED="ad-skipped",Zu.AD_VOLUME_CHANGED="ad-volume-changed",Zu.AD_MUTED="ad-muted",Zu.AD_PAUSED="ad-paused",Zu.AD_RESUMED="ad-resumed",Zu.AD_SKIP_STATE_CHANGED="ad-skip-state-changed",Zu.CUEPOINTS_CHANGED="ad-cue-points-changed",Zu.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded",Zu.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded",Zu.AD_CLICKED="ad-clicked",Zu.AD_PROGRESS="ad-progress",Zu.AD_BUFFERING="ad-buffering",Zu.AD_IMPRESSION="ad-impression",Zu.AD_DURATION_CHANGED="ad-duration-changed",Zu.AD_CLOSED="ad-closed",Zu.AD_LOADED="ad-loaded",Zu.ALL_ADS_COMPLETED="all-ads-completed",Zu.AD_LINEAR_CHANGED="ad-linear-changed",Zu.AD_METADATA="ad-metadata",Zu.AD_RECOVERABLE_ERROR="ad-recoverable-error",Zu.AD_BREAK_READY="ad-break-ready",Zu.AD_INTERACTION="ad-interaction",Hu=function(){return new Zu};var nl="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),rl="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),il=["loop","playbackRate"],ol=["pause","play"],al={getAssetUri:2,getAudioLanguages:4,getAudioLanguagesAndRoles:4,getBufferFullness:1,getBufferedInfo:2,getConfiguration:4,getExpiration:2,getKeyStatuses:2,getPlaybackRate:2,getTextLanguages:4,getTextLanguagesAndRoles:4,getTextTracks:2,getStats:5,getVariantTracks:2,getImageTracks:2,getThumbnails:2,isAudioOnly:10,isBuffering:1,isInProgress:1,isLive:10,isTextTrackVisible:1,keySystem:10,seekRange:1,getLoadMode:10},sl={getPlayheadTimeAsDate:1,getPresentationStartTimeAsDate:20},ul=[["getConfiguration","configure"]],ll=[["isTextTrackVisible","setTextTrackVisibility"]],cl="addChaptersTrack addTextTrack addTextTrackAsync cancelTrickPlay configure getChapters getChaptersTracks resetConfiguration retryStreaming selectAudioLanguage selectTextLanguage selectTextTrack selectVariantTrack selectVariantsByLabel setTextTrackVisibility trickPlay goToLive".split(" "),dl=["attach","detach","load","unload"];function fl(e,t,n,r,i,o){var a=this;this.L=e,this.j=new en(t),this.da=n,this.D=!1,this.u=r,this.J=i,this.S=o,this.h=this.m=!1,this.Y="",this.s=null,this.F=function(){return vl(a)},this.H=function(e,t){var n=tl(t);switch(n.type){case"event":var r=n.targetName;n=new ar((n=n.event).type,n),a.u(r,n);break;case"update":for(var i in r=n.update)for(var o in n=a.g[i]||{},r[i])n[o]=r[i][o];a.D&&(a.da(),a.D=!1);break;case"asyncComplete":if(i=n.id,n=n.error,o=a.i[i],delete a.i[i],o)if(n){for(r in i=new ze(n.severity,n.category,n.code),n)i[r]=n[r];o.reject(i)}else o.resolve()}},this.g={video:{},player:{}},this.N=0,this.i={},this.l=null,Sl.add(this)}function hl(e,t,n){xl=n,n.addUpdateListener(e.F),n.addMessageListener("urn:x-cast:com.google.shaka.v2",e.H),vl(e),bl(e,{type:"init",initState:t,appData:e.s}),e.l.resolve()}function pl(e,t){var n=8003;switch(t.code){case"cancel":n=8004;break;case"timeout":n=8005;break;case"receiver_unavailable":n=8006}e.l.reject(new ze(2,8,n,t))}function gl(e,t){var n=e.S();e.l=new pt,e.D=!0,hl(e,n,t)}function ml(e){var t=xl;t.removeUpdateListener(e.F),t.removeMessageListener("urn:x-cast:com.google.shaka.v2",e.H)}function vl(e){var t=!!xl&&"connected"==xl.status;if(e.h&&!t){for(var n in e.J(),e.g)e.g[n]={};yl(e)}e.h=t,e.Y=t?xl.receiver.friendlyName:"",e.j.Hb()}function yl(e){for(var t in e.i){var n=e.i[t];delete e.i[t],n.reject(new ze(1,7,7e3))}}function bl(e,t){var n=el(t),r=xl;try{r.sendMessage("urn:x-cast:com.google.shaka.v2",n,(function(){}),$)}catch(i){throw r=new ar("error",{detail:n=new ze(2,8,8005,i)}),e.u("player",r),e.vb(),n}}(i=fl.prototype).destroy=function(){return Sl.delete(this),yl(this),xl&&ml(this),this.j&&(this.j.stop(),this.j=null),this.J=this.u=null,this.h=this.m=!1,this.H=this.F=this.l=this.i=this.g=this.s=null,Promise.resolve()},i.ua=function(){return this.h},i.Fd=function(){return this.Y},i.init=function(){if(this.L.length)if(e.chrome&&chrome.cast&&chrome.cast.isAvailable){this.m=!0,this.j.Hb();var t=new chrome.cast.SessionRequest(this.L);t=new chrome.cast.ApiConfig(t,(function(e){for(var t=c(Sl),n=t.next();!n.done;n=t.next())gl(n.value,e)}),(function(e){for(var t=c(Sl),n=t.next();!n.done;n=t.next())n=n.value,Tl="available"==e,n.j.Hb()}),"origin_scoped"),chrome.cast.initialize(t,(function(){}),(function(){})),Tl&&this.j.U(wl),(t=xl)&&t.status!=chrome.cast.SessionStatus.STOPPED?gl(this,t):xl=null}else e.__onGCastApiAvailable||(e.__onGCastApiAvailable=El),e.__onGCastApiAvailable!=El&&W("A global Cast SDK hook is already installed! Shaka Player will be unable to receive a notification when the Cast SDK is ready.")},i.Ld=function(e){this.s=e,this.h&&bl(this,{type:"appData",appData:this.s})},i.cast=function(e){var t=this;return L((function(n){if(!t.m)throw new ze(1,8,8e3);if(!Tl)throw new ze(1,8,8001);if(t.h)throw new ze(1,8,8002);return t.l=new pt,chrome.cast.requestSession((function(n){return hl(t,e,n)}),(function(e){return pl(t,e)})),T(n,t.l,0)}))},i.vb=function(){if(this.h){if(yl(this),xl){ml(this);try{xl.stop((function(){}),(function(){}))}catch(hm){}xl=null}vl(this)}},i.get=function(e,t){var n=this;if("video"==e){if(ol.includes(t))return function(r){for(var i=[],o=0;o<arguments.length;++o)i[o]=arguments[o];return n.ne.apply(n,[e,t].concat(d(i)))}}else if("player"==e){if(sl[t]&&!this.get("player","isLive")())return function(){};if(cl.includes(t))return function(r){for(var i=[],o=0;o<arguments.length;++o)i[o]=arguments[o];return n.ne.apply(n,[e,t].concat(d(i)))};if(dl.includes(t))return function(r){for(var i=[],o=0;o<arguments.length;++o)i[o]=arguments[o];return n.Jf.apply(n,[e,t].concat(d(i)))};if(al[t])return function(){return n.g[e][t]}}return this.g[e][t]},i.set=function(e,t,n){this.g[e][t]=n,bl(this,{type:"set",targetName:e,property:t,value:n})},i.ne=function(e,t,n){for(var r=[],i=2;i<arguments.length;++i)r[i-2]=arguments[i];bl(this,{type:"call",targetName:e,methodName:t,args:r})},i.Jf=function(e,t,n){for(var r=[],i=2;i<arguments.length;++i)r[i-2]=arguments[i];i=new pt;var o=this.N.toString();this.N++,this.i[o]=i;try{bl(this,{type:"asyncCall",targetName:e,methodName:t,args:r,id:o})}catch(a){i.reject(a)}return i};var wl=.02,Tl=!1,xl=null,Sl=new Set;function El(e){if(e)for(var t=(e=c(Sl)).next();!t.done;t=e.next())t.value.init()}function Al(e,t,n){sr.call(this);var r=this;this.j=e,this.i=t,this.h=this.s=this.l=this.u=this.m=null,this.F=n,this.D=new Map,this.g=new fl(n,(function(){return Cl(r)}),(function(){return Ml(r)}),(function(e,t){return Nl(r,e,t)}),(function(){return Dl(r)}),(function(){return Il(r)})),function(e){e.g.init(),e.h=new Sr;for(var t=c(nl),n=t.next();!n.done;n=t.next())e.h.A(e.j,n.value,(function(t){e.g.ua()||(t=new ar(t.type,t),e.l.dispatchEvent(t))}));for(var r in Lu)e.h.A(e.i,Lu[r],(function(t){e.g.ua()||e.s.dispatchEvent(t)}));for(var i in e.m={},t={},e.j)t.Ib=i,Object.defineProperty(e.m,t.Ib,{configurable:!1,enumerable:!0,get:function(t){return function(){return Rl(e,t.Ib)}}(t),set:function(t){return function(n){var r=t.Ib;e.g.ua()?e.g.set("video",r,n):e.j[r]=n}}(t)}),t={Ib:t.Ib};e.u={},kl(e,(function(t){Object.defineProperty(e.u,t,{configurable:!1,enumerable:!0,get:function(){return function(e,t){if(e.D.has(t)&&(t=e.D.get(t)),"addEventListener"==t)return function(t,n,r){return e.s.addEventListener(t,n,r)};if("removeEventListener"==t)return function(t,n,r){return e.s.removeEventListener(t,n,r)};if("getMediaElement"==t)return function(){return e.m};if("getSharedConfiguration"==t)return e.g.get("player","getConfiguration");if("getNetworkingEngine"==t)return function(){return e.i.Ub()};if("getDrmEngine"==t)return function(){return e.i.m};if("getAdManager"==t)return function(){return e.i.be()};if("setVideoContainer"==t)return function(t){return e.i.we(t)};if(e.g.ua()){if("getManifest"==t||"drmInfo"==t)return function(){return W(t+"() does not work while casting!"),null};if("attach"==t||"detach"==t)return function(){return W(t+"() does not work while casting!"),Promise.resolve()}}return e.g.ua()&&0==Object.keys(e.g.g.video).length&&al[t]||!e.g.ua()?e.i[t].bind(e.i):e.g.get("player",t)}(e,t)}})})),function(e){var t=new Map;kl(e,(function(n,r){if(t.has(r)){var i=t.get(r);n.length<i.length?e.D.set(n,i):e.D.set(i,n)}else t.set(r,n)}))}(e),e.l=new sr,e.l.qc=e.m,e.s=new sr,e.s.qc=e.u}(this)}function kl(e,t){function n(e){return"constructor"!=e&&"function"==typeof r[e]&&!i.has(e)}var r=e.i,i=new Set;for(o in r)n(o)&&(i.add(o),t(o,r[o]));for(var o=Object.getPrototypeOf(r),a=Object.getPrototypeOf({});o&&o!=a;){for(var s=c(Object.getOwnPropertyNames(o)),u=s.next();!u.done;u=s.next())n(u=u.value)&&(i.add(u),t(u,r[u]));o=Object.getPrototypeOf(o)}}function Il(e){var t={video:{},player:{},playerAfterLoad:{},manifest:e.i.od(),startTime:null};e.j.pause();for(var n=c(il),r=n.next();!r.done;r=n.next())r=r.value,t.video[r]=e.j[r];for(e.j.ended||(t.startTime=e.j.currentTime),r=(n=c(ul)).next();!r.done;r=n.next()){var i=r.value;r=i[1],i=e.i[i[0]](),t.player[r]=i}for(r=(n=c(ll)).next();!r.done;r=n.next())r=(i=r.value)[1],i=e.i[i[0]](),t.playerAfterLoad[r]=i;return t}function Cl(e){var t=new ar("caststatuschanged");e.dispatchEvent(t)}function Ml(e){var t=new ar(e.m.paused?"pause":"play");e.l.dispatchEvent(t)}function Dl(e){for(var t=c(ul),n=t.next();!n.done;n=t.next()){var r=n.value;n=r[1],r=e.g.get("player",r[0])(),e.i[n](r)}var i=e.g.get("player","getAssetUri")();n=e.g.get("video","ended"),t=Promise.resolve();var o=e.j.autoplay;r=null,n||(r=e.g.get("video","currentTime")),i&&(e.j.autoplay=!1,t=e.i.load(i,r));var a={};for(r=(n=c(il)).next();!r.done;r=n.next())r=r.value,a[r]=e.g.get("video",r);t.then((function(){if(e.j){for(var t=c(il),n=t.next();!n.done;n=t.next())n=n.value,e.j[n]=a[n];for(n=(t=c(ll)).next();!n.done;n=t.next()){var r=n.value;n=r[1],r=e.g.get("player",r[0])(),e.i[n](r)}e.j.autoplay=o,i&&e.j.play()}}),(function(t){t=new ar(mu,{detail:t}),e.i.dispatchEvent(t)}))}function Rl(e,t){if("addEventListener"==t)return function(t,n,r){return e.l.addEventListener(t,n,r)};if("removeEventListener"==t)return function(t,n,r){return e.l.removeEventListener(t,n,r)};if(e.g.ua()&&0==Object.keys(e.g.g.video).length){var n=e.j[t];if("function"!=typeof n)return n}return e.g.ua()?e.g.get("video",t):("function"==typeof(n=e.j[t])&&(n=n.bind(e.j)),n)}function Nl(e,t,n){e.g.ua()&&("video"==t?e.l.dispatchEvent(n):"player"==t&&e.s.dispatchEvent(n))}function Pl(e,t,n,r){sr.call(this);var i=this;this.g=e,this.i=t,this.h=new Sr,this.N={video:e,player:t},this.H=n||function(){},this.S=r||function(e){return e},this.j=null,this.J=!1,this.s=!0,this.m=0,this.F=!1,this.D=!0,this.u=this.l=null,this.L=new en((function(){Ol(i)})),function(e){var t=cast.receiver.CastReceiverManager.getInstance();t.onSenderConnected=function(){return Ll(e)},t.onSenderDisconnected=function(){return Ll(e)},t.onSystemVolumeChanged=function(){var t=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();t&&Vl(e,{type:"update",update:{video:{volume:t.level,muted:t.muted}}},e.l),Vl(e,{type:"event",targetName:"video",event:{type:"volumechange"}},e.l)},e.u=t.getCastMessageBus("urn:x-cast:com.google.cast.media"),e.u.onMessage=function(t){return function(e,t){var n=tl(t.data);switch(n.type){case"PLAY":e.g.play(),Hl(e);break;case"PAUSE":e.g.pause(),Hl(e);break;case"SEEK":var r=n.currentTime,i=n.resumeState;null!=r&&(e.g.currentTime=Number(r)),i&&"PLAYBACK_START"==i?(e.g.play(),Hl(e)):i&&"PLAYBACK_PAUSE"==i&&(e.g.pause(),Hl(e));break;case"STOP":e.i.Sd().then((function(){e.i&&Hl(e)}));break;case"GET_STATUS":Fl(e,Number(n.requestId));break;case"VOLUME":r=(i=n.volume).level,i=i.muted;var o=e.g.volume,a=e.g.muted;null!=r&&(e.g.volume=Number(r)),null!=i&&(e.g.muted=i),o==e.g.volume&&a==e.g.muted||Hl(e);break;case"LOAD":e.m=0,e.F=!1,e.D=!1,r=n.media,i=n.currentTime,o=e.S(r.contentId),a=n.autoplay||!0,e.H(r.customData),a&&(e.g.autoplay=!0),e.i.load(o,i).then((function(){e.i&&Fl(e)})).catch((function(t){var r="LOAD_FAILED";7==t.category&&7e3==t.code&&(r="LOAD_CANCELLED"),Vl(e,{requestId:Number(n.requestId),type:r},e.u)}));break;default:Vl(e,{requestId:Number(n.requestId),type:"INVALID_REQUEST",reason:"INVALID_COMMAND"},e.u)}}(e,t)},e.l=t.getCastMessageBus("urn:x-cast:com.google.shaka.v2"),e.l.onMessage=function(t){return function(e,t){var n=tl(t.data);switch(n.type){case"init":e.m=0,e.F=!1,e.D=!0,function(e,t,n){var r,i,o,a,s,u,l,c,d;L((function(f){switch(f.g){case 1:for(r in t.player)i=t.player[r],e.i[r](i);return e.H(n),o=e.g.autoplay,t.manifest?(e.g.autoplay=!1,S(f,5),T(f,e.i.load(t.manifest,t.startTime),7)):T(f,Promise.resolve(),3);case 7:A(f,3);break;case 5:return a=k(f),s=new ar(mu,{detail:a}),e.i&&e.i.dispatchEvent(s),f.return();case 3:if(!e.i)return f.return();for(u in t.video)l=t.video[u],e.g[u]=l;for(c in t.playerAfterLoad)d=t.playerAfterLoad[c],e.i[c](d);e.g.autoplay=o,t.manifest&&(e.g.play(),Hl(e)),x(f)}}))}(e,n.initState,n.appData),Ol(e);break;case"appData":e.H(n.appData);break;case"set":var r=n.targetName,i=n.property;if(n=n.value,"video"==r){var o=cast.receiver.CastReceiverManager.getInstance();if("volume"==i){o.setSystemVolumeLevel(n);break}if("muted"==i){o.setSystemVolumeMuted(n);break}}e.N[r][i]=n;break;case"call":(r=e.N[n.targetName])[n.methodName].apply(r,n.args);break;case"asyncCall":r=n.targetName,i=n.methodName,"player"==r&&"load"==i&&(e.m=0,e.F=!1);var a=n.id,s=t.senderId;n=(o=e.N[r])[i].apply(o,n.args),"player"==r&&"load"==i&&(n=n.then((function(){e.D=!0}))),n.then((function(){return Bl(e,s,a,null)}),(function(t){return Bl(e,s,a,t)}))}}(e,t)},t.start();for(var n=(t=c(nl)).next();!n.done;n=t.next())e.h.A(e.g,n.value,(function(t){return _l(e,"video",t)}));for(var r in Lu)e.h.A(e.i,Lu[r],(function(t){return _l(e,"player",t)}));cast.__platform__&&cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160')?e.i.Nd(3840,2160):e.i.Nd(1920,1080),e.h.A(e.g,"loadeddata",(function(){e.F=!0})),e.h.A(e.i,"loading",(function(){e.s=!1,jl(e)})),e.h.A(e.g,"playing",(function(){e.s=!1,jl(e)})),e.h.A(e.g,"pause",(function(){jl(e)})),e.h.A(e.i,"unloading",(function(){e.s=!0,jl(e)})),e.h.A(e.g,"ended",(function(){new en((function(){e.g&&e.g.ended&&(e.s=!0,jl(e))})).U(Gl)}))}(this)}function Ll(e){e.m=0,e.D=!0,e.J=0!=cast.receiver.CastReceiverManager.getInstance().getSenders().length,jl(e)}function jl(e){var t;L((function(n){return 1==n.g?T(n,Promise.resolve(),2):e.i?(t=new ar("caststatuschanged"),e.dispatchEvent(t),Ul(e)||Hl(e),void x(n)):n.return()}))}function _l(e,t,n){e.i&&(Ol(e),Vl(e,{type:"event",targetName:t,event:n},e.l))}function Ol(e){e.L.U(Kl);for(var t={video:{},player:{}},n=c(rl),r=n.next();!r.done;r=n.next())r=r.value,t.video[r]=e.g[r];if(e.i.X())for(var i in sl)0==e.m%sl[i]&&(t.player[i]=e.i[i]());for(var o in al)0==e.m%al[o]&&(t.player[o]=e.i[o]());(n=cast.receiver.CastReceiverManager.getInstance().getSystemVolume())&&(t.video.volume=n.level,t.video.muted=n.muted),e.F&&(e.m+=1),Vl(e,{type:"update",update:t},e.l),Ul(e)}function Ul(e){return!(!e.D||!e.g.duration&&!e.i.X())&&(Fl(e),e.D=!1,!0)}function Fl(e,t){var n={contentId:e.i.od(),streamType:e.i.X()?"LIVE":"BUFFERED",contentType:""};e.i.X()||(n.duration=e.g.duration),e.j&&(n.metadata=e.j),Hl(e,void 0===t?0:t,n)}function Bl(e,t,n,r){e.i&&Vl(e,{type:"asyncComplete",id:n,error:r},e.l,t)}function Vl(e,t,n,r){e.J&&(e=el(t),r?n.getCastChannel(r).send(e):n.broadcast(e))}function Hl(e,t,n){n=void 0===n?null:n;var r={mediaSessionId:0,playbackRate:e.g.playbackRate,playerState:e.s?ql:e.i.rd()?Xl:e.g.paused?Wl:zl,currentTime:e.g.currentTime,supportedMediaCommands:63,volume:{level:e.g.volume,muted:e.g.muted}};n&&(r.media=n),Vl(e,{requestId:void 0===t?0:t,type:"MEDIA_STATUS",status:[r]},e.u)}v(Al,sr),(i=Al.prototype).destroy=function(e){return e&&this.g.vb(),this.h&&(this.h.release(),this.h=null),e=[],this.i&&(e.push(this.i.destroy()),this.i=null),this.g&&(e.push(this.g.destroy()),this.g=null),this.u=this.m=this.j=null,Promise.all(e)},i.qf=function(){return this.m},i.ff=function(){return this.u},i.He=function(){return this.g.m&&Tl},i.ua=function(){return this.g.ua()},i.Fd=function(){return this.g.Fd()},i.cast=function(){var e,t=this;return L((function(n){return 1==n.g?(e=Il(t),T(n,t.g.cast(e),2)):t.i?T(n,t.i.Sd(),0):n.return()}))},i.Ld=function(e){this.g.Ld(e)},i.Uf=function(){!function(e){if(e.h){var t=e.S();chrome.cast.requestSession((function(n){return hl(e,t,n)}),(function(t){return pl(e,t)}))}}(this.g)},i.vb=function(){this.g.vb()},i.Ke=function(e){var t=this;return L((function(n){if(1==n.g)return e==t.F?n.return():(t.F=e,t.g.vb(),T(n,t.g.destroy(),2));t.g=null,t.g=new fl(e,(function(){return Cl(t)}),(function(){return Ml(t)}),(function(e,n){return Nl(t,e,n)}),(function(){return Dl(t)}),(function(){return Il(t)})),t.g.init(),x(n)}))},V("shaka.cast.CastProxy",Al),Al.prototype.changeReceiverId=Al.prototype.Ke,Al.prototype.forceDisconnect=Al.prototype.vb,Al.prototype.suggestDisconnect=Al.prototype.Uf,Al.prototype.setAppData=Al.prototype.Ld,Al.prototype.cast=Al.prototype.cast,Al.prototype.receiverName=Al.prototype.Fd,Al.prototype.isCasting=Al.prototype.ua,Al.prototype.canCast=Al.prototype.He,Al.prototype.getPlayer=Al.prototype.ff,Al.prototype.getVideo=Al.prototype.qf,Al.prototype.destroy=Al.prototype.destroy,v(Pl,sr),(i=Pl.prototype).isConnected=function(){return this.J},i.uf=function(){return this.s},i.Qf=function(e){this.j=e},i.Ne=function(){this.j=null},i.Rf=function(e){this.j||(this.j={metadataType:cast.receiver.media.MetadataType.GENERIC}),this.j.title=e},i.Pf=function(e){this.j||(this.j={metadataType:cast.receiver.media.MetadataType.GENERIC}),this.j.images=[{url:e}]},i.Of=function(e){this.j||(this.j={}),this.j.artist=e,this.j.metadataType=cast.receiver.media.MetadataType.MUSIC_TRACK},i.destroy=function(){var e,t=this;return L((function(n){if(1==n.g)return t.h&&(t.h.release(),t.h=null),e=[],t.i&&(e.push(t.i.destroy()),t.i=null),t.L&&(t.L.stop(),t.L=null),t.g=null,t.N=null,t.H=null,t.J=!1,t.s=!0,t.l=null,t.u=null,T(n,Promise.all(e),2);cast.receiver.CastReceiverManager.getInstance().stop(),x(n)}))},V("shaka.cast.CastReceiver",Pl),Pl.prototype.destroy=Pl.prototype.destroy,Pl.prototype.setContentArtist=Pl.prototype.Of,Pl.prototype.setContentImage=Pl.prototype.Pf,Pl.prototype.setContentTitle=Pl.prototype.Rf,Pl.prototype.clearContentMetadata=Pl.prototype.Ne,Pl.prototype.setContentMetadata=Pl.prototype.Qf,Pl.prototype.isIdle=Pl.prototype.uf,Pl.prototype.isConnected=Pl.prototype.isConnected;var Kl=.5,Gl=5,ql="IDLE",zl="PLAYING",Xl="BUFFERING",Wl="PAUSED";function Yl(e){var t=this;this.g=[],this.h=[],this.data=[],(new ci).box("moov",di).T("pssh",(function(e){if(!(1<e.version)){var n=Re(e.reader.P,-12,e.size);if(t.data.push(n),t.g.push(Ct(e.reader.$a(16))),0<e.version){n=e.reader.M();for(var r=(n=c(te(n))).next();!r.done;r=n.next())r=Ct(e.reader.$a(16)),t.h.push(r)}}})).parse(e)}function $l(e,t){var n=e.length,r=t.length+16+n,i=new Uint8Array(r),o=Ne(i),a=0;return o.setUint32(a,r),a+=4,o.setUint32(a,1886614376),a+=4,o.setUint32(a,0),a+=4,i.set(t,a),a+=t.length,o.setUint32(a,n),i.set(e,a+4),i}function Jl(e,t){var n=Zl(e,t);return 1!=n.length?null:n[0]}function Ql(e,t,n){return 1!=(e=ec(e,t,n)).length?null:e[0]}function Zl(e,t){return Array.from(e.childNodes).filter((function(e){return e instanceof Element&&e.tagName==t}))}function ec(e,t,n){return Array.from(e.childNodes).filter((function(e){return e instanceof Element&&e.localName==n&&e.namespaceURI==t}))}function tc(e,t,n){return e.hasAttributeNS(t,n)?e.getAttributeNS(t,n):null}function nc(e){return Array.from(e.childNodes).every(rc)?e.textContent.trim():null}function rc(e){return e.nodeType==Node.TEXT_NODE||e.nodeType==Node.CDATA_SECTION_NODE}function ic(e,t,n,r){r=void 0===r?null:r;var i=null;return null!=(e=e.getAttribute(t))&&(i=n(e)),null==i?r:i}function oc(e){return e?(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)&&(e+="Z"),e=Date.parse(e),isNaN(e)?null:Math.floor(e/1e3)):null}function ac(e){return e&&(e=/^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(e))?(e=31536e3*Number(e[1]||null)+2592e3*Number(e[2]||null)+86400*Number(e[3]||null)+3600*Number(e[4]||null)+60*Number(e[5]||null)+Number(e[6]||null),isFinite(e)?e:null):null}function sc(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 uc(e){return 0===(e=Number(e))%1?e:null}function lc(e){return 0===(e=Number(e))%1&&0<e?e:null}function cc(e){return 0===(e=Number(e))%1&&0<=e?e:null}function dc(e){return e=Number(e),isNaN(e)?null:e}function fc(e){var t;return e=(t=e.match(/^(\d+)\/(\d+)$/))?Number(t[1])/Number(t[2]):Number(e),isNaN(e)?null:e}function hc(e,t){var n=new DOMParser,r=null;try{r=n.parseFromString(e,"text/xml")}catch(i){return null}return!(n=r.documentElement)||n.getElementsByTagName("parsererror").length||r.documentElement.tagName!=t?null:n}function pc(e,t){try{return hc(vt(e),t)}catch(n){return null}}function gc(e,t,n){var r=function(e){for(var t=[],n=(e=c(e)).next();!n.done;n=e.next())(n=vc(n.value))&&t.push(n);return t}(e),i=null;e=[];var o=[],a=new Set(r.map((function(e){return e.keyId})));if(a.delete(null),1<a.size)throw new ze(2,4,4010);if(t||(o=r.filter((function(e){return"urn:mpeg:dash:mp4protection:2011"!=e.qe||(i=e.init||i,!1)}))).length&&(0==(e=function(e,t,n){for(var r=[],i=(t=c(t)).next();!i.done;i=t.next()){var o=n[(i=i.value).qe];if(o){var a;if(a=Ql(i.node,"urn:microsoft:playready","pro"))a=[{initData:$l(a=kt(a.textContent),new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149])),initDataType:"cenc",keyId:i.keyId}];else a=null;a=ut(o,i.init||e||a),(o=bc.get(o))&&(a.licenseServerUri=o(i)),r.push(a)}}return r}(i,o,n)).length&&(e=[ut("",i)])),r.length&&(t||!o.length))for(e=[],n=(t=c(Object.values(n))).next();!n.done;n=t.next())"org.w3.clearkey"!=(n=n.value)&&e.push(ut(n,i));if(a=Array.from(a)[0]||null)for(n=(t=c(e)).next();!n.done;n=t.next())for(r=(n=c(n.value.initData)).next();!r.done;r=n.next())r.value.keyId=a;return{Xd:a,zg:i,drmInfos:e,ae:!0}}function mc(e){return(e=Ql(e.node,"urn:microsoft:playready","pro"))&&(e=function(e){var t=0,n=Ne(e),r=n.getUint32(t,!0);if(r!=e.byteLength)return[];e:{for(e=t+6,t=[];e<n.byteLength-1;){r=n.getUint16(e,!0),e+=2;var i=n.getUint16(e,!0);if(e+=2,0!=(1&i)||i+e>n.byteLength){n=[];break e}var o=Re(n,e,i);t.push({type:r,value:o}),e+=i}n=t}return n}(e=kt(e.textContent)).filter((function(e){return e.type===yc}))[0])&&(e=hc(e=yt(e.value,!0),"WRMHEADER"))?function(e){for(var t=(e=c(e.getElementsByTagName("DATA"))).next();!t.done;t=e.next())for(var n=(t=c(t.value.childNodes)).next();!n.done;n=t.next())if((n=n.value)instanceof Element&&"LA_URL"==n.tagName)return n.textContent;return""}(e):""}function vc(e){var t=e.getAttribute("schemeIdUri"),n=tc(e,"urn:mpeg:cenc:2013","default_KID"),r=ec(e,"urn:mpeg:cenc:2013","pssh").map(nc);if(!t)return null;if(t=t.toLowerCase(),n&&(n=n.replace(/-/g,"").toLowerCase()).includes(" "))throw new ze(2,4,4009);var i=[];try{i=r.map((function(e){return{initDataType:"cenc",initData:kt(e),keyId:null}}))}catch(o){throw new ze(2,4,4007)}return{node:e,qe:t,keyId:n,init:0<i.length?i:null}}var yc=1,bc=(new Map).set("com.widevine.alpha",(function(e){return(e=Ql(e.node,"urn:microsoft","laurl"))&&e.getAttribute("licenseUrl")||""})).set("com.microsoft.playready",mc).set("com.microsoft.playready.recommendation",mc).set("com.microsoft.playready.software",mc).set("com.microsoft.playready.hardware",mc);function wc(t,n,r,i,o){var a={RepresentationID:n,Number:r,Bandwidth:i,Time:o};return t.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,(function(t,n,r,i){if("$$"==t)return"$";var o=a[n];if(null==o)return t;switch("RepresentationID"==n&&r&&(r=void 0),"Time"==n&&(o=Math.round(o)),i){case void 0:case"d":case"i":case"u":t=o.toString();break;case"o":t=o.toString(8);break;case"x":t=o.toString(16);break;case"X":t=o.toString(16).toUpperCase();break;default:t=o.toString()}return r=e.parseInt(r,10)||1,Array(Math.max(0,r-t.length)+1).join("0")+t}))}function Tc(e,t){var n=xc(e,t,"timescale"),r=1;n&&(r=lc(n)||1);var i=xc(e,t,"duration");n=lc(i||""),"image"==e.K.contentType&&(n=dc(i||"")),n&&(n/=r);var o=xc(e,t,"startNumber");i=Number(xc(e,t,"presentationTimeOffset"))||0;var a=cc(o||"");null!=o&&null!=a||(a=1);var s=Sc(e,t,"SegmentTimeline");if(o=null,s){o=r;var u=e.W.duration||1/0,l=Zl(s,"S");s=[];for(var d=-i,f=(l=c(ne(l))).next();!f.done;f=l.next()){var h=(f=f.value).item,p=f.next,g=ic(h,"t",cc);f=ic(h,"d",cc);var m=ic(h,"r",uc);if(null!=g&&(g-=i),!f)break;if(h=null!=g?g:d,0>(g=m||0))if(p){if(null==(p=ic(p,"t",cc)))break;if(h>=p)break;g=Math.ceil((p-h)/f)-1}else{if(1/0==u)break;if(h/o>=u)break;g=Math.ceil((u*o-h)/f)-1}for(0<s.length&&h!=d&&(s[s.length-1].end=h/o),g=(p=c(te(g+1))).next();!g.done;g=p.next())d=h+f,s.push({start:h/o,end:d/o,Zf:h}),h=d}o=s}return{timescale:r,ia:n,Gb:a,Ta:i/r||0,Td:i,timeline:o}}function xc(e,t,n){return[t(e.K),t(e.ka),t(e.fa)].filter(Ve).map((function(e){return e.getAttribute(n)})).reduce((function(e,t){return e||t}))}function Sc(e,t,n){return[t(e.K),t(e.ka),t(e.fa)].filter(Ve).map((function(e){return Jl(e,n)})).reduce((function(e,t){return e||t}))}function Ec(e,t,n,r,i,o){if(o=void 0===o?0:o,tc(e,"http://www.w3.org/1999/xlink","href")){var a=function(e,t,n,r,i,o){for(var a=tc(e,"http://www.w3.org/1999/xlink","href"),s=tc(e,"http://www.w3.org/1999/xlink","actuate")||"onRequest",u=c(Array.from(e.attributes)),l=u.next();!l.done;l=u.next())"http://www.w3.org/1999/xlink"==(l=l.value).namespaceURI&&e.removeAttributeNS(l.namespaceURI,l.localName);if(5<=o)return tr(new ze(2,4,4028));if("onLoad"!=s)return tr(new ze(2,4,4027));var d=st([r],[a]);return i.request(0,pr(d,t)).ba((function(r){if(!(r=pc(r.data,e.tagName)))return tr(new ze(2,4,4001,a));for(;e.childNodes.length;)e.removeChild(e.childNodes[0]);for(;r.childNodes.length;){var s=r.childNodes[0];r.removeChild(s),e.appendChild(s)}for(s=(r=c(Array.from(r.attributes))).next();!s.done;s=r.next())e.setAttributeNode(s.value.cloneNode(!1));return Ec(e,t,n,d[0],i,o+1)}))}(e,t,n,r,i,o);return n&&(a=a.ba(void 0,(function(){return Ec(e,t,n,r,i,o)}))),a}a=[];for(var s=c(Array.from(e.childNodes)),u=s.next();!u.done;u=s.next())(u=u.value)instanceof Element&&("urn:mpeg:dash:resolve-to-zero:2013"==tc(u,"http://www.w3.org/1999/xlink","href")?e.removeChild(u):"SegmentTimeline"!=u.tagName&&a.push(Ec(u,t,n,r,i,o)));return or(a).ba((function(){return e}))}function Ac(e,t,n,r,i,o,a){var s,u=(new ci).T("sidx",(function(e){s=function(e,t,n,r,i,o,a){var s=[];a.reader.skip(4);var u=a.reader.M();if(0==u)throw new ze(2,3,3005);if(0==a.version)var l=a.reader.M(),d=a.reader.M();else l=a.reader.Fb(),d=a.reader.Fb();a.reader.skip(2);var f=a.reader.Eb();for(e=e+a.size+d,f=c(te(f)),d=f.next();!d.done;d=f.next()){var h=a.reader.M();d=(2147483648&h)>>>31,h&=2147483647;var p=a.reader.M();if(a.reader.skip(4),1==d)throw new ze(2,3,3006);s.push(new Qo(l/u+n,(l+p)/u+n,(function(){return o}),e,e+h-1,t,n,r,i)),l+=p,e+=h}return a.parser.stop(),s}(t,r,i,o,a,n,e)}));if(e&&u.parse(e),s)return s;throw new ze(2,3,3004)}function kc(e){this.h=Ne(e),this.g=new si(this.h,0)}function Ic(e){var t=Cc(e);if(7<t.length)throw new ze(2,3,3002);for(var n=0,r=(t=c(t)).next();!r.done;r=t.next())n=256*n+r.value;t=Cc(e);e:{for(var i=(r=c(Mc)).next();!i.done;i=r.next())if(Ce(t,new Uint8Array(i.value))){r=!0;break e}r=!1}if(r)t=e.h.byteLength-e.g.Z();else{if(8==t.length&&224&t[1])throw new ze(2,3,3001);r=0;for(var o=(i=c(ne(t))).next();!o.done;o=i.next()){var a=(o=o.value).item;r=0==o.ha?a&(1<<8-t.length)-1:256*r+a}t=r}return t=e.g.Z()+t<=e.h.byteLength?t:e.h.byteLength-e.g.Z(),r=Ne(e.h,e.g.Z(),t),e.g.skip(t),new Dc(n,r)}function Cc(e){var t=e.g.Z(),n=e.g.$();if(0==n)throw new ze(2,3,3002);return n=8-Math.floor(Math.log2(n)),e.g.skip(n-1),Re(e.h,t,n)}kc.prototype.na=function(){return this.g.na()};var Mc=[[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 Dc(e,t){this.id=e,this.g=t}function Rc(e){if(8<e.g.byteLength)throw new ze(2,3,3002);if(8==e.g.byteLength&&224&e.g.getUint8(0))throw new ze(2,3,3001);for(var t=0,n=c(te(e.g.byteLength)),r=n.next();!r.done;r=n.next())t=256*t+(r=e.g.getUint8(r.value));return t}function Nc(e){var t=new kc(e.g);if(179!=(e=Ic(t)).id)throw new ze(2,3,3013);if(e=Rc(e),183!=(t=Ic(t)).id)throw new ze(2,3,3012);t=new kc(t.g);for(var n=0;t.na();){var r=Ic(t);if(241==r.id){n=Rc(r);break}}return{$f:e,If:n}}function Pc(e,t){var n=Sc(e,t,"Initialization");if(!n)return null;var r=e.K.za,i=n.getAttribute("sourceURL");i&&(r=st(e.K.za,[i])),i=0;var o=null;return(n=ic(n,"range",sc))&&(i=n.start,o=n.end),new Jo((function(){return r}),i,o)}function Lc(e,t){var n=Number(xc(e,_c,"presentationTimeOffset"))||0,r=xc(e,_c,"timescale"),i=1;r&&(i=lc(r)||1);var o=n/i||0,a=Pc(e,_c);!function(e,t){if(Uc(e,t),!Oc(e))throw new ze(2,4,4002)}(e,a);var s=lr(e);return{wb:function(){var e=Sc(s,_c,"RepresentationIndex"),n=s.K.za;return e&&(e=e.getAttribute("sourceURL"))&&(n=st(s.K.za,[e])),e=Oc(s),jc(s,t,a,n,e.start,e.end,o)}}}function jc(e,t,n,r,i,o,a){var s,u,l,c,d,f,h,p,g,m,v,y,b,w,x;return L((function(S){if(1==S.g)return s=e.presentationTimeline,u=!e.cb||!e.W.ge,l=e.W.start,c=e.W.duration,d=e.K.mimeType.split("/")[1],h=null,p=[(f=t)(r,i,o),"webm"==d?f(n.ma(),n.ja,n.ea):null],f=null,T(S,Promise.all(p),2);if(g=S.h,m=g[0],v=g[1]||null,null,b=l-a,w=l,x=c?l+c:1/0,"mp4"==d)var E=Ac(m,i,r,n,b,w,x);else{if(440786851!=Ic(E=new kc(v)).id)throw new ze(2,3,3008);var A=Ic(E);if(408125543!=A.id)throw new ze(2,3,3009);E=A.g.byteOffset,A=new kc(A.g);for(var k=null;A.na();){var I=Ic(A);if(357149030==I.id){k=I;break}}if(!k)throw new ze(2,3,3010);for(k=new kc(k.g),I=1e6,A=null;k.na();){var C=Ic(k);if(2807729==C.id)I=Rc(C);else if(17545==C.id)if(4==C.g.byteLength)A=C.g.getFloat32(0);else{if(8!=C.g.byteLength)throw new ze(2,3,3003);A=C.g.getFloat64(0)}}if(null==A)throw new ze(2,3,3011);if(A*=k=I/1e9,475249515!=(I=Ic(new kc(m))).id)throw new ze(2,3,3007);E=function(e,t,n,r,i,o,a,s,u){function l(){return i}var c=[];e=new kc(e.g);for(var d=null,f=null;e.na();){var h=Ic(e);if(187==h.id){var p=Nc(h);p&&(h=n*p.$f,p=t+p.If,null!=d&&c.push(new Qo(d+a,h+a,l,f,p-1,o,a,s,u)),d=h,f=p)}}return null!=d&&c.push(new Qo(d+a,r+a,l,f,null,o,a,s,u)),c}(I,E,k,A,r,n,b,w,x)}return y=E,s.Bb(y),h=new ba(y),u&&h.Ya(w,x,!0),S.return(h)}))}function _c(e){return e.dc}function Oc(e){var t=Sc(e,_c,"RepresentationIndex");return e=sc((e=xc(e,_c,"indexRange"))||""),t&&(e=ic(t,"range",sc,e)),e}function Uc(e,t){var n=e.K.mimeType.split("/")[1];if(e.K.contentType!=dt&&"mp4"!=n&&"webm"!=n)throw new ze(2,4,4006);if("webm"==n&&!t)throw new ze(2,4,4005)}function Fc(e,t){var n=Pc(e,Bc),r=function(e){var t=function(e){return[e.K.ab,e.ka.ab,e.fa.ab].filter(Ve).map((function(e){return Zl(e,"SegmentURL")})).reduce((function(e,t){return 0<e.length?e:t})).map((function(t){return t.getAttribute("indexRange")&&!e.ee&&(e.ee=!0),{xf:t.getAttribute("media"),start:(t=ic(t,"mediaRange",sc,{start:0,end:null})).start,end:t.end}}))}(e),n=(e=Tc(e,Bc)).Gb;0==n&&(n=1);var r=0;return e.ia?r=e.ia*(n-1):e.timeline&&0<e.timeline.length&&(r=e.timeline[0].start),{ia:e.ia,startTime:r,Gb:n,Ta:e.Ta,timeline:e.timeline,zb:t}}(e);if(!r.ia&&!r.timeline&&1<r.zb.length)throw new ze(2,4,4002);if(!r.ia&&!e.W.duration&&!r.timeline&&1==r.zb.length)throw new ze(2,4,4002);if(r.timeline&&0==r.timeline.length)throw new ze(2,4,4002);var i=null,o=null;return e.fa.id&&e.K.id&&(o=e.fa.id+","+e.K.id,i=t[o]),n=function(e,t,n,r,i){var o=r.zb.length;r.timeline&&r.timeline.length!=r.zb.length&&(o=Math.min(r.timeline.length,r.zb.length));for(var a=e-r.Ta,s=t?e+t:1/0,u=[],l=r.startTime,d={},f=(o=c(te(o))).next();!f.done;d={Vc:d.Vc},f=o.next()){f=f.value;var h=r.zb[f];d.Vc=st(n,[h.xf]);var p=void 0;p=null!=r.ia?l+r.ia:r.timeline?r.timeline[f].end:l+t,u.push(new Qo(e+l,e+p,function(e){return function(){return e.Vc}}(d),h.start,h.end,i,a,e,s)),l=p}return u}(e.W.start,e.W.duration,e.K.za,r,n),r=!i,i?i.Ab(n,e.presentationTimeline.Za()):(e.presentationTimeline.Bb(n),i=new ba(n),o&&e.cb&&(t[o]=i)),e.cb&&e.W.ge||i.Ya(e.W.start,e.W.duration?e.W.start+e.W.duration:1/0,r),{wb:function(){return Promise.resolve(i)}}}function Bc(e){return e.ab}function Vc(e,t,n,r,i,o){var a=function(e){var t=xc(e,Hc,"initialization");if(!t)return null;var n=e.K.id,r=e.bandwidth||null,i=e.K.za;return new Jo((function(){var e=wc(t,n,null,r,null);return st(i,[e])}),0,null)}(e),s=function(e){var t=Tc(e,Hc),n=xc(e,Hc,"media");return e=xc(e,Hc,"index"),{ia:t.ia,timescale:t.timescale,Gb:t.Gb,Ta:t.Ta,Td:t.Td,timeline:t.timeline,xd:n,Yb:e}}(e);!function(e){var t=e.Yb?1:0;if(t+=e.timeline?1:0,0==(t+=e.ia?1:0))throw new ze(2,4,4002);if(1!=t&&(e.Yb&&(e.timeline=null),e.ia=null),!e.Yb&&!e.xd)throw new ze(2,4,4002)}(s);var u=lr(e);if(s.Yb)return Uc(e,a),{wb:function(){var e=wc(s.Yb,u.K.id,null,u.bandwidth||null,null);return e=st(u.K.za,[e]),jc(u,t,a,e,0,null,s.Ta)}};if(s.ia)return r||(e.presentationTimeline.yd(s.ia),e.presentationTimeline.zd(e.W.start)),{wb:function(){return function(e,t,n,r,i){function o(e){var n=(e-p)*h,i=n+t.Ta,o=n+l;return n=o+h,(o=new Qo(o,Math.min(n,s()),(function(){var t=wc(m,y,e,v,i*g);return st(b,[t])}),0,null,r,w,l,s())).j=n,o}function a(){var e=[Math.max(u.Za(),l),Math.min(u.gb(),s())].map((function(e){return e-l}));return[Math.ceil(e[0]/h),Math.ceil(e[1]/h)-1].map((function(e){return e+p}))}function s(){var e=null!=d&&i[d]||f;return e?l+e:1/0}var u=e.presentationTimeline,l=e.W.start,d=e.fa.id,f=e.W.duration,h=t.ia,p=t.Gb,g=t.timescale,m=t.xd,v=e.bandwidth||null,y=e.K.id,b=e.K.za,w=l-t.Ta,T=a();e=e.cb?Math.max(T[0],T[1]-n+1):T[0],T=T[1],n=[];for(var x=e;x<=T;++x){var S=o(x);n.push(S)}var E=new ba(n);if(n=u.gb()<s(),x=u.X(),n||x){var A=Math.max(e,T+1);E.Mc(h,(function(){var e=u.Za();E.eb(e);var t=c(a());t.next(),t=t.next().value;for(var n=[];A<=t;){var r=o(A);n.push(r),A++}return e>s()&&!n.length?null:n}))}return Promise.resolve(E)}(u,s,i,a,o)}};var l=null;r=null,e.fa.id&&e.K.id&&(r=e.fa.id+","+e.K.id,l=n[r]);var d=function(e,t,n){var r=e.W.start,i=e.W.duration,o=r-t.Ta;i=i?r+i:1/0;for(var a=[],s={},u=c(ne(t.timeline)),l=u.next();!l.done;s={Uc:s.Uc,Yc:s.Yc,bd:s.bd,Rc:s.Rc,dd:s.dd,Sc:s.Sc},l=u.next()){var d=(l=l.value).item,f=d.start,h=d.Zf;d=d.end,s.bd=l.ha+t.Gb,s.dd=h+t.Td,s.Yc=e.K.id,s.Rc=e.bandwidth||null,s.Uc=t.xd,s.Sc=e.K.za,a.push(new Qo(r+f,r+d,function(e){return function(){var t=wc(e.Uc,e.Yc,e.bd,e.Rc||null,e.dd);return st(e.Sc,[t]).map((function(e){return e.toString()}))}}(s),0,null,n,o,r,i))}return a}(u,s,a),f=e.W.start,h=e.W.duration?e.W.start+e.W.duration:1/0,p=1/0!=h;return l?(p&&new ba(d).Ya(f,h,!0),l.Ab(d,e.presentationTimeline.Za())):(e.presentationTimeline.Bb(d),l=new ba(d),r&&e.cb&&(n[r]=l)),p&&l.Ya(f,h),{wb:function(){return Promise.resolve(l)}}}function Hc(e){return e.ec}function Kc(){this.l=[],this.g=[],this.h=[],this.j=[],this.i=[],this.m=new Set}function Gc(e,t,n){var r,i,o,a,s,u,l,d,f,h,p,g,m,v,y,b,w,S,E,A,k,I,C,M,D,R,N,P,j,_,O;return L((function(L){switch(L.g){case 1:if(r=ft,function(e){for(var t=(e=c(e)).next();!t.done;t=e.next()){for(var n=[],r=c((t=t.value).tc),i=r.next();!i.done;i=r.next()){i=i.value;for(var o=!1,a=c(n),s=a.next();!s.done;s=a.next())s=s.value,i.id!=s.id&&i.channelsCount==s.channelsCount&&i.language==s.language&&i.bandwidth==s.bandwidth&&i.label==s.label&&i.codecs==s.codecs&&i.mimeType==s.mimeType&&oe(i.roles,s.roles)&&i.audioSamplingRate==s.audioSamplingRate&&i.primary==s.primary&&(o=!0);o||n.push(i)}t.tc=n}}(t),function(e){for(var t=(e=c(e)).next();!t.done;t=e.next()){for(var n=[],r=c((t=t.value).Oc),i=r.next();!i.done;i=r.next()){i=i.value;for(var o=!1,a=c(n),s=a.next();!s.done;s=a.next())s=s.value,i.id!=s.id&&i.width==s.width&&i.frameRate==s.frameRate&&i.codecs==s.codecs&&i.mimeType==s.mimeType&&i.label==s.label&&oe(i.roles,s.roles)&&Rr(i.closedCaptions,s.closedCaptions)&&i.bandwidth==s.bandwidth&&(o=!0);o||n.push(i)}t.Oc=n}}(t),function(e){for(var t=(e=c(e)).next();!t.done;t=e.next()){for(var n=[],r=c((t=t.value).textStreams),i=r.next();!i.done;i=r.next()){i=i.value;for(var o=!1,a=c(n),s=a.next();!s.done;s=a.next())s=s.value,i.id!=s.id&&i.language==s.language&&i.label==s.label&&i.codecs==s.codecs&&i.mimeType==s.mimeType&&oe(i.roles,s.roles)&&(o=!0);o||n.push(i)}t.textStreams=n}}(t),function(e){for(var t=(e=c(e)).next();!t.done;t=e.next()){for(var n=[],r=c((t=t.value).imageStreams),i=r.next();!i.done;i=r.next()){i=i.value;for(var o=!1,a=c(n),s=a.next();!s.done;s=a.next())s=s.value,i.id!=s.id&&i.width==s.width&&i.codecs==s.codecs&&i.mimeType==s.mimeType&&(o=!0);o||n.push(i)}t.imageStreams=n}}(t),!n&&1==t.length){i=t[0],e.g=i.tc,e.h=i.Oc,e.j=i.textStreams,e.i=i.imageStreams,L.v(2);break}for(o=-1,a=c(ne(t)),s=a.next();!s.done;s=a.next())u=s.value,l=u.ha,d=u.item,e.m.has(d.id)||(e.m.add(d.id),-1==o&&(o=l));if(-1==o)return L.return();for(f=t.map((function(e){return e.tc})),h=t.map((function(e){return e.Oc})),p=t.map((function(e){return e.textStreams})),g=t.map((function(e){return e.imageStreams})),m=c(p),v=m.next();!v.done;v=m.next())v.value.push(ud(r.aa));for(y=c(g),b=y.next();!b.done;b=y.next())b.value.push(ud(r.Mb));return T(L,zc(e.g,f,o,Yc,Jc),3);case 3:return T(L,zc(e.h,h,o,Yc,Jc),4);case 4:return T(L,zc(e.j,p,o,Yc,Jc),5);case 5:return T(L,zc(e.i,g,o,Yc,Jc),2);case 2:if(w=0,S=[],e.h.length&&e.g.length)for(M=c(e.g),D=M.next();!D.done;D=M.next())for(R=D.value,N=c(e.h),P=N.next();!P.done;P=N.next())j=P.value,_=zr(R.drmInfos,j.drmInfos),R.drmInfos.length&&j.drmInfos.length&&!_.length||(O=w++,S.push({id:O,language:R.language,primary:R.primary,audio:R,video:j,bandwidth:(R.bandwidth||0)+(j.bandwidth||0),drmInfos:_,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]}));else for(E=e.h.concat(e.g),A=c(E),k=A.next();!k.done;k=A.next())I=k.value,C=w++,S.push({id:C,language:I.language,primary:I.primary,audio:I.type==r.bb?I:null,video:I.type==r.Na?I:null,bandwidth:I.bandwidth||0,drmInfos:I.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});e.l=S,x(L)}}))}function qc(e){var t,n,r,i,o,a,s,u,l,d,f,h,p,g,m,v,y,b,w,x,S,E,A,k;return L((function(I){switch(I.g){case 1:if(t=ft,1==e.length)return I.return(e[0]);for(n=e.map((function(e){return e.filter((function(e){return e.type==t.bb}))})),r=e.map((function(e){return e.filter((function(e){return e.type==t.Na}))})),i=e.map((function(e){return e.filter((function(e){return e.type==t.aa}))})),o=e.map((function(e){return e.filter((function(e){return e.type==t.Mb}))})),a=c(i),s=a.next();!s.done;s=a.next())s.value.push(sd(t.aa));for(u=c(o),l=u.next();!l.done;l=u.next())l.value.push(sd(t.Mb));return T(I,zc([],n,0,$c,Qc),2);case 2:return d=I.h,T(I,zc([],r,0,$c,Qc),3);case 3:return f=I.h,T(I,zc([],i,0,$c,Qc),4);case 4:return h=I.h,T(I,zc([],o,0,$c,Qc),5);case 5:if(p=I.h,g=0,f.length&&d.length)for(b=c(d),w=b.next();!w.done;w=b.next())for(x=w.value,S=c(f),E=S.next();!E.done;E=S.next())A=E.value,k=g++,A.variantIds.push(k),x.variantIds.push(k);else for(m=f.concat(d),v=c(m),y=v.next();!y.done;y=v.next())y.value.variantIds=[g++];return I.return(f.concat(d).concat(h).concat(p))}}))}function zc(e,t,n,r,i){var o,a,s,u,l,d,f,h,p,g,m,v,y,b,w,x,S,E,A,k,I;return L((function(C){switch(C.g){case 1:for(o=ft,a=[],s=c(ne(t)),u=s.next();!u.done;u=s.next())l=u.value,d=l.ha,f=l.item,d>=n?a.push(new Set(f)):a.push(new Set);h=c(e),p=h.next();case 2:if(p.done){C.v(4);break}return T(C,function(e,t,n,r,i){var o;return L((function(a){return 1==a.g?(o=Zc(t,e))?T(a,Xc(o),2):a.return(!1):(Wc(e,o,n,r,i),a.return(!0))}))}(p.value,t,n,i,a),5);case 5:if(!C.h)throw new ze(2,4,4037);p=h.next(),C.v(2);break;case 4:g=c(a),m=g.next();case 6:if(m.done){C.v(8);break}v=m.value,y=c(v),b=y.next();case 9:if(b.done){m=g.next(),C.v(6);break}return T(C,function(e,t,n,r,i){var o,a;return L((function(s){return 1==s.g?(o=n(e),(a=Zc(t,o))?o.createSegmentIndex?T(s,Xc(a),2):s.v(2):s.return(null)):(Wc(o,a,0,r,i),s.return(o))}))}(b.value,t,r,i,a),12);case 12:(w=C.h)&&e.push(w),b=y.next(),C.v(9);break;case 8:for(x=c(a),m=x.next();!m.done;m=x.next())for(S=m.value,E={},A=c(S),b=A.next();!b.done;E={Va:E.Va},b=A.next())if(E.Va=b.value,k=E.Va.type==o.aa&&!E.Va.language,I=E.Va.type==o.Mb&&!E.Va.tilesLayout,!k&&!I&&e.some(function(e){return function(t){return t.mimeType==e.Va.mimeType&&_t(t.codecs)==_t(e.Va.codecs)}}(E)))throw new ze(2,4,4037);return C.return(e)}}))}function Xc(e){for(var t=[],n=(e=c(e)).next();!n.done;n=e.next())n=n.value,t.push(n.createSegmentIndex()),n.trickModeVideo&&!n.trickModeVideo.segmentIndex&&t.push(n.trickModeVideo.createSegmentIndex());return Promise.all(t)}function Wc(e,t,n,r,i){for(var o=(t=c(ne(t))).next();!o.done;o=t.next()){var a=o.value;if(o=a.ha,a=a.item,o>=n){r(e,a);var s=!0;"audio"==e.type&&0==Xt(e.language,a.language)&&(s=!1),s&&i[o].delete(a)}}}function Yc(e){return(e=Object.assign({},e)).originalId=null,e.createSegmentIndex=function(){return Promise.resolve()},e.segmentIndex=new xa,e.emsgSchemeIdUris=[],e.keyIds=new Set,e.closedCaptions=null,e.trickModeVideo=null,e}function $c(e){return(e=Object.assign({},e)).keyIds=new Set,e.segments=[],e.variantIds=[],e.closedCaptions=null,e}function Jc(e,t){e.roles=Array.from(new Set(e.roles.concat(t.roles))),t.emsgSchemeIdUris&&(e.emsgSchemeIdUris=Array.from(new Set(e.emsgSchemeIdUris.concat(t.emsgSchemeIdUris))));var n=t.keyIds;if(n=new Set([].concat(d(e.keyIds),d(n))),e.keyIds=n,null==e.originalId?e.originalId=t.originalId:e.originalId+=","+(t.originalId||""),n=zr(e.drmInfos,t.drmInfos),t.drmInfos.length&&e.drmInfos.length&&!n.length)throw new ze(2,4,4038);if(e.drmInfos=n,e.encrypted=e.encrypted||t.encrypted,t.closedCaptions){e.closedCaptions||(e.closedCaptions=new Map);for(var r=(n=c(t.closedCaptions)).next();!r.done;r=n.next()){var i=c(r.value);r=i.next().value,i=i.next().value,e.closedCaptions.set(r,i)}}e.segmentIndex.l.push(t.segmentIndex),t.trickModeVideo?(e.trickModeVideo||(e.trickModeVideo=Yc(t.trickModeVideo),e.trickModeVideo.segmentIndex=e.segmentIndex.clone()),Jc(e.trickModeVideo,t.trickModeVideo)):e.trickModeVideo&&Jc(e.trickModeVideo,t)}function Qc(e,t){e.roles=Array.from(new Set(e.roles.concat(t.roles)));var n=t.keyIds;if(n=new Set([].concat(d(e.keyIds),d(n))),e.keyIds=n,e.encrypted=e.encrypted&&t.encrypted,e.segments.push.apply(e.segments,d(t.segments)),t.closedCaptions){e.closedCaptions||(e.closedCaptions=new Map);for(var r=(n=c(t.closedCaptions)).next();!r.done;r=n.next()){var i=c(r.value);r=i.next().value,i=i.next().value,e.closedCaptions.set(r,i)}}}function Zc(e,t){for(var n=[],r=c(e),i=r.next();!i.done;i=r.next()){for(var o=t,a={audio:ed,video:ed,text:td,image:nd}[o.type],s={audio:rd,video:id,text:od,image:ad}[o.type],u=null,l=(i=c(i.value)).next();!l.done;l=i.next())!a(o,l=l.value)||u&&!s(o,u,l)||(u=l);if(!(o=u))return null;n.push(o)}return n}function ed(e,t){var n;if(!(n=t.mimeType!=e.mimeType||_t(t.codecs)!=_t(e.codecs))&&(n=e.drmInfos)){n=e.drmInfos;var r=t.drmInfos;n=!(!n.length||!r.length||0<zr(n,r).length)}return!n}function td(e,t){return!!e.language&&(!t.language||0!=Xt(e.language,t.language)&&t.kind==e.kind)}function nd(e){return!!e.tilesLayout}function rd(e,t,n){if(e.id==n.id)return!0;var r=Xt(e.language,t.language),i=Xt(e.language,n.language);return i>r||!(i<r)&&(!(t.primary||!n.primary)||!(t.primary&&!n.primary)&&(e.roles.length?(r=t.roles.filter((function(t){return e.roles.includes(t)})),(i=n.roles.filter((function(t){return e.roles.includes(t)}))).length>r.length||!(i.length<r.length)&&n.roles.length<t.roles.length):!(n.roles.length||!t.roles.length)||!(n.roles.length&&!t.roles.length)&&((r=ld(e.channelsCount,t.channelsCount,n.channelsCount))==dd||r!=hd&&((r=ld(e.audioSamplingRate,t.audioSamplingRate,n.audioSamplingRate))==dd||r!=hd&&!(!e.bandwidth||cd(e.bandwidth,t.bandwidth,n.bandwidth)!=dd)))))}function id(e,t,n){if(e.id==n.id)return!0;var r=ld(e.width*e.height,t.width*t.height,n.width*n.height);if(r==dd)return!0;if(r==hd)return!1;if(e.frameRate){if((r=ld(e.frameRate,t.frameRate,n.frameRate))==dd)return!0;if(r==hd)return!1}return!(!e.bandwidth||cd(e.bandwidth,t.bandwidth,n.bandwidth)!=dd)}function od(e,t,n){if(e.id==n.id)return!0;var r=Xt(e.language,t.language),i=Xt(e.language,n.language);if(i>r)return!0;if(i<r)return!1;if(!t.primary&&n.primary)return!0;if(t.primary&&!n.primary)return!1;if(e.roles.length){if(r=t.roles.filter((function(t){return e.roles.includes(t)})),(i=n.roles.filter((function(t){return e.roles.includes(t)}))).length>r.length)return!0;if(i.length<r.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 ad(e,t,n){return e.id==n.id||ld(e.width*e.height,t.width*t.height,n.width*n.height)==dd}function sd(e){return{id:0,originalId:"",primary:!1,type:e,mimeType:"",codecs:"",language:"",label:null,width:null,height:null,encrypted:!1,keyIds:new Set,segments:[],variantIds:[],roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null}}function ud(e){return{id:0,originalId:"",createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new ba([]),mimeType:"",codecs:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"",label:null,type:e,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null}}function ld(e,t,n){if(t==e&&e!=n)return hd;if(n==e&&e!=t)return dd;if(t>e){if(n<=e||n-e<t-e)return dd;if(n-e>t-e)return hd}else{if(n>e)return hd;if(e-n<e-t)return dd;if(e-n>e-t)return hd}return fd}function cd(e,t,n){return t=Math.abs(e-t),(e=Math.abs(e-n))<t?dd:t<e?hd:fd}Kc.prototype.release=function(){for(var e=c(this.g.concat(this.h,this.j,this.i)),t=e.next();!t.done;t=e.next())(t=t.value).segmentIndex&&t.segmentIndex.release();this.g=[],this.h=[],this.j=[],this.i=[],this.l=[]};var dd=1,fd=0,hd=-1;function pd(){var e=this;this.C=this.o=null,this.h=[],this.B=null,this.D=1,this.l={},this.H={},this.g=new Kc,this.u=0,this.F=new H(5),this.s=new en((function(){e.$b()})),this.i=new cr,this.j=1/0,this.m=!1}function gd(e){var t,n,r,i,o,a,s;return L((function(u){return 1==u.g?(t=pr(e.h,e.o.retryParameters),n=e.C.networkingEngine,r=Date.now(),i=n.request(0,t),dr(e.i,i),T(u,i.promise,2)):3!=u.g?(o=u.h,e.C?(o.uri&&!e.h.includes(o.uri)&&e.h.unshift(o.uri),T(u,function(e,t,n){var r,i,o,a;return L((function(s){if(1==s.g){if(!(r=pc(t,"MPD")))throw new ze(2,4,4001,n);return e.o.dash.disableXlinkProcessing?s.return(md(e,r,n)):(i=e.o.dash.xlinkFailGracefully,o=Ec(r,e.o.retryParameters,i,n,e.C.networkingEngine),dr(e.i,o),T(s,o.promise,2))}return a=s.h,s.return(md(e,a,n))}))}(e,o.data,o.uri),3)):u.return(0)):(a=Date.now(),s=(a-r)/1e3,K(e.F,1,s),u.return(s))}))}function md(e,t,n){var r,i,o,a,s,u,l,d,f,h,p,g,m,v,y,b,w,E,I,C,M,D,R,N,P,j,_,O;return L((function(U){switch(U.g){case 1:if((r=e.o.dash.manifestPreprocessor)&&r(t),i=[n],0<(o=Zl(t,"Location").map(nc).filter(Ve)).length&&(a=st(i,o),i=e.h=a),s=Zl(t,"BaseURL"),u=s.map(nc),l=st(i,u),d=0,s&&s.length&&(d=ic(s[0],"availabilityTimeOffset",dc)||0),f=e.o.dash.ignoreMinBufferTime,h=0,f||(h=ic(t,"minBufferTime",ac)||0),e.u=ic(t,"minimumUpdatePeriod",ac,-1),p=ic(t,"availabilityStartTime",oc),g=ic(t,"timeShiftBufferDepth",ac),m=e.o.dash.ignoreSuggestedPresentationDelay,v=null,m||(v=ic(t,"suggestedPresentationDelay",ac)),y=e.o.dash.ignoreMaxSegmentDuration,b=null,y||(b=ic(t,"maxSegmentDuration",ac)),w=t.getAttribute("type")||"static",e.B)for(E=e.B.presentationTimeline,I=c(Object.values(e.l)),C=I.next();!C.done;C=I.next())C.value.eb(E.Za());else M=e.o.defaultPresentationDelay||1.5*h,E=new Zo(p,null!=v?v:M,e.o.dash.autoCorrectDrift);D=t.getAttribute("profiles")||"",R={cb:"static"!=w,presentationTimeline:E,fa:null,W:null,ka:null,K:null,bandwidth:0,ee:!1,ub:d,profiles:D.split(",")};for(var F=ic(t,"mediaPresentationDuration",ac),B=[],V=0,H=Zl(t,"Period"),K=(H=c(ne(H))).next();!K.done;K=H.next()){var G=K.value;K=G.item,G=G.next,V=ic(K,"start",ac,V);var q=ic(K,"duration",ac),z=null;if(G){var X=ic(G,"start",ac);null!=X&&(z=X-V)}else null!=F&&(z=F-V);if(null==z&&(z=q),K=vd(e,R,l,{start:V,duration:z,node:K,ge:null==z||!G}),B.push(K),R.fa.id&&z&&(e.H[R.fa.id]=z),null==z){V=null;break}V+=z}return P=(N=null!=F?{periods:B,duration:F,Zd:!1}:{periods:B,duration:V,Zd:!0}).duration,j=N.periods,E.fc("static"==w),"static"!=w&&N.Zd||E.Ja(P||1/0),e.j&&!e.m&&e.C.isAutoLowLatencyMode()&&(e.C.enableLowLatencyMode(),e.m=e.C.isLowLatencyMode()),e.m?E.te(e.j):e.j&&W("Low-latency DASH live stream detected, but low-latency streaming mode is not enabled in Shaka Player. Set streaming.lowLatencyMode configuration to true, and see https://bit.ly/3clctcj for details."),E.X()&&!isNaN(e.o.availabilityWindowOverride)&&(g=e.o.availabilityWindowOverride),null==g&&(g=1/0),E.Pd(g),E.yd(b||1),T(U,Gc(e.g,j,R.cb),2);case 2:if(e.B){e.B.variants=e.g.l,e.B.textStreams=e.g.j,e.B.imageStreams=e.g.i,e.C.filter(e.B),U.v(3);break}if(e.B={presentationTimeline:E,variants:e.g.l,textStreams:e.g.j,imageStreams:e.g.i,offlineSessionIds:[],minBufferTime:h||0},!E.ye()){U.v(3);break}return _=Zl(t,"UTCTiming"),T(U,function(e,t,n){var r,i,o,a,s,u,l,d;return L((function(f){switch(f.g){case 1:r=n.map((function(e){return{scheme:e.getAttribute("schemeIdUri"),value:e.getAttribute("value")}})),i=e.o.dash.clockSyncUri,!r.length&&i&&r.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:i}),o=c(r),a=o.next();case 2:if(a.done){f.v(4);break}switch(s=a.value,S(f,5),u=s.scheme,l=s.value,u){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":return f.v(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 f.v(8);case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":return d=Date.parse(l),f.return(isNaN(d)?0:d-Date.now());case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":W("NTP UTCTiming scheme is not supported");break;default:W("Unrecognized scheme in UTCTiming element",u)}f.v(9);break;case 7:return T(f,Td(e,t,l,"HEAD"),10);case 10:return f.return(f.h);case 8:return T(f,Td(e,t,l,"GET"),11);case 11:return f.return(f.h);case 9:A(f,3);break;case 5:k(f);case 3:a=o.next(),f.v(2);break;case 4:return W("A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!"),f.return(0)}}))}(e,l,_),5);case 5:if(O=U.h,!e.C)return U.return();E.ue(O);case 3:e.C.makeTextStreamsForClosedCaptions(e.B),x(U)}}))}function vd(e,t,n,r){t.fa=wd(r.node,null,n),t.W=r,t.fa.ub=t.ub,t.fa.id||(t.fa.id="__shaka_period_"+r.start);for(var i=(n=c(n=Zl(r.node,"EventStream"))).next();!i.done;i=n.next())xd(e,r.start,r.duration,i.value);if(n=Zl(r.node,"AdaptationSet").map((function(n){return function(e,t,n){t.ka=wd(n,t.fa,null);var r=!1,i=Zl(n,"Role"),o=i.map((function(e){return e.getAttribute("value")})).filter(Ve),a=void 0,s=t.ka.contentType==dt;s&&(a="subtitle");for(var u=(i=c(i)).next();!u.done;u=i.next()){var l=(u=u.value).getAttribute("schemeIdUri");if(null==l||"urn:mpeg:dash:role:2011"==l)switch(u=u.getAttribute("value"),u){case"main":r=!0;break;case"caption":case"subtitle":a=u}}l=Zl(n,"EssentialProperty"),i=null,u=!1;for(var f=(l=c(l)).next();!f.done;f=l.next())"http://dashif.org/guidelines/trickmode"==(f=f.value).getAttribute("schemeIdUri")?i=f.getAttribute("value"):u=!0;l=Zl(n,"Accessibility");var h=new Map;for(l=c(l),f=l.next();!f.done;f=l.next()){var p=f.value;if(f=p.getAttribute("schemeIdUri"),p=p.getAttribute("value"),"urn:scte:dash:cc:cea-608:2015"==f)if(f=1,null!=p)for(var g=c(p=p.split(";")),m=g.next();!m.done;m=g.next()){var v=m.value,y=m=void 0;v.includes("=")?(m=(v=v.split("="))[0].startsWith("CC")?v[0]:"CC"+v[0],y=v[1]||"und"):(m="CC"+f,2==p.length?f+=2:f++,y=v),h.set(m,zt(y))}else h.set("CC1","und");else if("urn:scte:dash:cc:cea-708:2015"==f)if(f=1,null!=p)for(m=(p=c(p.split(";"))).next();!m.done;m=p.next())v=g=void 0,(m=m.value).includes("=")?(g="svc"+(m=m.split("="))[0],v=m[1].split(",")[0].split(":").pop()):(g="svc"+f,f++,v=m),h.set(g,zt(v));else h.set("svc1","und");else"urn:mpeg:dash:role:2011"==f&&null!=p&&(o.push(p),"captions"==p&&(a="caption"))}if(u)return null;var b=gc(u=Zl(n,"ContentProtection"),e.o.dash.ignoreDrmInfo,e.o.dash.keySystemsByURI),w=zt(n.getAttribute("lang")||"und"),S=n.getAttribute("label");if((u=Zl(n,"Label"))&&u.length&&((u=u[0]).textContent&&(S=u.textContent)),u=Zl(n,"Representation"),0==(n=u.map((function(n){return function(e,t,n,r,i,o,a,s,u,l){if(t.K=wd(l,t.ka,null),e.j=Math.min(e.j,t.K.ub),!function(e){var t=e.dc?1:0;return t+=e.ab?1:0,0==(t+=e.ec?1:0)?e.contentType==dt||"application"==e.contentType:(1!=t&&(e.dc&&(e.ab=null),e.ec=null),!0)}(t.K))return null;var c=t.W.start;t.bandwidth=ic(l,"bandwidth",lc)||0;var d=t.K.contentType,f=d==dt||"application"==d;d="image"==d;try{var h=function(t,n,r){return function(e,t,n,r){var i,o,a,s,u;return L((function(l){return 1==l.g?(i=yr,o=Na(t,n,r,e.o.retryParameters),a=e.C.networkingEngine,s=a.request(i,o),dr(e.i,s),T(l,s.promise,2)):(u=l.h,l.return(u.data))}))}(e,t,n,r)};if(t.K.dc)var p=Lc(t,h);else if(t.K.ab)p=Fc(t,e.l);else if(t.K.ec)p=Vc(t,h,e.l,!!e.B,e.o.dash.initialSegmentLimit,e.H);else{var g=t.K.za,m=t.W.duration||0;p={wb:function(){return Promise.resolve(wa(c,m,g))}}}}catch(E){if((f||d)&&4002==E.code)return null;throw E}h=function(e,t,n,r){var i=gc(e,n,r);if(t.ae)e=1==t.drmInfos.length&&!t.drmInfos[0].keySystem,n=0==i.drmInfos.length,(0==t.drmInfos.length||e&&!n)&&(t.drmInfos=i.drmInfos),t.ae=!1;else if(0<i.drmInfos.length&&(t.drmInfos=t.drmInfos.filter((function(e){return i.drmInfos.some((function(t){return t.keySystem==e.keySystem}))})),0==t.drmInfos.length))throw new ze(2,4,4008);return i.Xd||t.Xd}(h=Zl(l,"ContentProtection"),n,e.o.dash.ignoreDrmInfo,e.o.dash.keySystemsByURI),h=new Set(h?[h]:[]);var v=!1;Zl(l,"SupplementalProperty").some((function(e){return"tag:dolby.com,2018:dash:EC3_ExtensionType:2018"==e.getAttribute("schemeIdUri")&&"JOC"==e.getAttribute("value")}))&&(t.K.mimeType="audio/eac3-joc",v=!0);var y,b,w=!1;if(f&&(w=s.includes("forced_subtitle")),d&&((l=Zl(l,"EssentialProperty").find((function(e){return["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"].includes(e.getAttribute("schemeIdUri"))})))&&(y=l.getAttribute("value")),!y))return null;l=t.K.codecs,t.profiles.includes("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&(l.includes("hvc1.2.4.L153.B0")||l.includes("hev1.2.4.L153.B0"))&&(b="PQ");var S={id:e.D++,originalId:t.K.id,createSegmentIndex:function(){var e;return L((function(t){if(1==t.g)return S.segmentIndex?t.v(0):(e=S,T(t,p.wb(),3));e.segmentIndex=t.h,x(t)}))},segmentIndex:null,mimeType:t.K.mimeType,codecs:t.K.codecs,frameRate:t.K.frameRate,pixelAspectRatio:t.K.pixelAspectRatio,bandwidth:t.bandwidth,width:t.K.width,height:t.K.height,kind:r,encrypted:0<n.drmInfos.length,drmInfos:n.drmInfos,keyIds:h,language:i,label:o,type:t.ka.contentType,primary:a,trickModeVideo:null,emsgSchemeIdUris:t.K.emsgSchemeIdUris,roles:s,forced:w,channelsCount:t.K.Bd,audioSamplingRate:t.K.audioSamplingRate,spatialAudio:v,closedCaptions:u,hdr:b,tilesLayout:y};return S}(e,t,b,a,w,S,r,o,h,n)})).filter((function(e){return!!e}))).length){if(i="image"==t.ka.contentType,e.o.dash.ignoreEmptyAdaptationSet||s||i)return null;throw new ze(2,4,4003)}if(!t.ka.contentType||"application"==t.ka.contentType)for(t.ka.contentType=Sd(n[0].mimeType,n[0].codecs),s=c(n),l=s.next();!l.done;l=s.next())l.value.type=t.ka.contentType;for(s=c(n),l=s.next();!l.done;l=s.next())for(l=l.value,p=(f=c(b.drmInfos)).next();!p.done;p=f.next())(p=p.value).keyIds=p.keyIds&&l.keyIds?new Set([].concat(d(p.keyIds),d(l.keyIds))):p.keyIds||l.keyIds;return s=u.map((function(e){return e.getAttribute("id")})).filter(Ve),{id:t.ka.id||"__fake__"+e.D++,contentType:t.ka.contentType,language:w,Ag:r,streams:n,drmInfos:b.drmInfos,Rd:i,Lf:s}}(e,t,n)})).filter(Ve),t.cb){r=[];for(var o=(i=c(n)).next();!o.done;o=i.next())for(var a=(o=c(o.value.Lf)).next();!a.done;a=o.next())r.push(a.value);if(r.length!=new Set(r).size)throw new ze(2,4,4018)}for(r=n.filter((function(e){return!e.Rd})),i=(n=c(n=n.filter((function(e){return e.Rd})))).next();!i.done;i=n.next()){o=(i=i.value).Rd.split(" ");for(var s=(a=c(r)).next();!s.done;s=a.next()){var u=s.value;if(o.includes(u.id)){s={};for(var l=(u=c(u.streams)).next();!l.done;s={nc:s.nc},l=u.next())s.nc=l.value,s.nc.trickModeVideo=i.streams.find(function(e){return function(t){return _t(e.nc.codecs)==_t(t.codecs)}}(s))}}}if(i=e.o.disableAudio?[]:yd(r,"audio"),a=e.o.disableVideo?[]:yd(r,"video"),o=e.o.disableText?[]:yd(r,dt),n=e.o.disableThumbnails?[]:yd(r,"image"),!a.length&&!i.length)throw new ze(2,4,4004);for(r=[],s=(i=c(i)).next();!s.done;s=i.next())r.push.apply(r,d(s.value.streams));for(i=[],s=(a=c(a)).next();!s.done;s=a.next())i.push.apply(i,d(s.value.streams));for(a=[],s=(o=c(o)).next();!s.done;s=o.next())a.push.apply(a,d(s.value.streams));for(o=[],s=(n=c(n)).next();!s.done;s=n.next())o.push.apply(o,d(s.value.streams));return{id:t.fa.id,tc:r,Oc:i,textStreams:a,imageStreams:o}}function yd(e,t){return e.filter((function(e){return e.contentType==t}))}function bd(e,t){0>e.u||e.s.U(Math.max(3,e.u-t,G(e.F)))}function wd(e,t,n){t=t||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,pixelAspectRatio:void 0,Bd:null,audioSamplingRate:null,ub:0},n=n||t.za;for(var r=Zl(e,"BaseURL"),i=r.map(nc),o=e.getAttribute("contentType")||t.contentType,a=e.getAttribute("mimeType")||t.mimeType,s=e.getAttribute("codecs")||t.codecs,u=ic(e,"frameRate",fc)||t.frameRate,l=e.getAttribute("sar")||t.pixelAspectRatio,d=Zl(e,"InbandEventStream"),f=t.emsgSchemeIdUris.slice(),h=(d=c(d)).next();!h.done;h=d.next())h=h.value.getAttribute("schemeIdUri"),f.includes(h)||f.push(h);d=function(e){for(var t=(e=c(e)).next();!t.done;t=e.next()){var n=t.value;if((t=n.getAttribute("schemeIdUri"))&&(n=n.getAttribute("value")))switch(t){case"urn:mpeg:dash:outputChannelPositionList:2012":return n.trim().split(/ +/).length;case"urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case"urn:dts:dash:audio_channel_configuration:2012":if(!(t=parseInt(n,10)))continue;return t;case"tag:dolby.com,2014:dash:audio_channel_configuration:2011":case"urn:dolby:dash:audio_channel_configuration:2011":if(!(t=parseInt(n,16)))continue;for(e=0;t;)1&t&&++e,t>>=1;return e;case"urn:mpeg:mpegB:cicp:ChannelConfiguration":if(t=[0,1,2,3,4,5,6,8,2,3,4,7,8,24,8,12,10,12,14,12,14],(n=parseInt(n,10))&&0<n&&n<t.length)return t[n]}}return null}(d=Zl(e,"AudioChannelConfiguration"))||t.Bd,h=ic(e,"audioSamplingRate",cc)||t.audioSamplingRate,o||(o=Sd(a,s));var p=Jl(e,"SegmentBase"),g=Jl(e,"SegmentTemplate"),m=p&&ic(p,"availabilityTimeOffset",dc)||0,v=g&&ic(g,"availabilityTimeOffset",dc)||0;return r=r&&r.length&&ic(r[0],"availabilityTimeOffset",dc)||0,r=t.ub+r+m+v,{za:st(n,i),dc:p||t.dc,ab:Jl(e,"SegmentList")||t.ab,ec:g||t.ec,width:ic(e,"width",cc)||t.width,height:ic(e,"height",cc)||t.height,contentType:o,mimeType:a,codecs:s,frameRate:u,pixelAspectRatio:l,emsgSchemeIdUris:f,id:e.getAttribute("id"),Bd:d,audioSamplingRate:h,ub:r}}function Td(e,t,n,r){var i,o,a,s,u,l;return L((function(c){if(1==c.g)return i=st(t,[n]),(o=pr(i,e.o.retryParameters)).method=r,a=e.C.networkingEngine.request(4,o),dr(e.i,a),T(c,a.promise,2);if(s=c.h,"HEAD"==r){if(!s.headers||!s.headers.date)return c.return(0);u=s.headers.date}else u=vt(s.data);return l=Date.parse(u),isNaN(l)?c.return(0):c.return(l-Date.now())}))}function xd(e,t,n,r){for(var i=r.getAttribute("schemeIdUri")||"",o=r.getAttribute("value")||"",a=ic(r,"timescale",cc)||1,s=(r=c(Zl(r,"Event"))).next();!s.done;s=r.next()){var u=ic(s=s.value,"presentationTime",cc)||0,l=ic(s,"duration",cc)||0;l=(u=u/a+t)+l/a,null!=n&&(u=Math.min(u,t+n),l=Math.min(l,t+n)),s={schemeIdUri:i,value:o,startTime:u,endTime:l,id:s.getAttribute("id")||"",eventElement:s},e.C.onTimelineRegionAdded(s)}}function Sd(e,t){return Ft(Lt(e,t))?dt:e.split("/")[0]}function Ed(e,t,n,r){this.g=e,this.type=t,this.V=n,this.segments=r||null}function Ad(e,t,n,r){this.id=e,this.name=t,this.g=n,this.value=void 0===r?null:r}function kd(e,t,n){return(e=e.getAttribute(t))?e.value:n||null}function Id(e,t){var n=e.getAttribute(t);if(!n)throw new ze(2,4,4023,t);return n.value}function Cd(e,t,n){n=void 0===n?[]:n,this.V=t,this.g=e,this.h=n}function Md(e,t){this.name=e,this.value=t}function Dd(e,t){return e.filter((function(e){return e.name==t}))}function Rd(e,t){return e.filter((function(e){return Id(e,"TYPE")==t}))}function Nd(e,t){var n=Dd(e,t);return n.length?n[0]:null}function Pd(e,t,n){return n=void 0===n?0:n,(e=Nd(e,t))?Number(e.value):n}function Ld(e){this.h=e,this.g=0}function jd(e){_d(e,/[ \t]+/gm)}function _d(e,t){t.lastIndex=e.g;var n=t.exec(e.h);return n=null==n?null:{position:n.index,length:n[0].length,results:n},e.g==e.h.length||null==n||n.position!=e.g?null:(e.g+=n.length,n.results)}function Od(e){return e.g==e.h.length?null:(e=_d(e,/[^ \t\n]*/gm))?e[0]:null}function Ud(){this.g=0}function Fd(e,t,n){var r=(t=(t=vt(t)).replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim()).split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(r[0]))throw new ze(2,4,4015);t=0;for(var i=!0,o=c(r),a=o.next();!a.done;a=o.next())if(a=a.value,/^#(?!EXT)/m.test(a)||i)i=!1;else{if(a=Bd(e.g++,a),--e.g,Vd.includes(a.name)){t=1;break}"EXT-X-STREAM-INF"==a.name&&(i=!0)}o=[],i=!0;for(var s=(a=c(ne(r))).next();!s.done;s=a.next()){var u=s.value;s=u.ha;var l=u.item;if(u=u.next,/^#(?!EXT)/m.test(l)||i)i=!1;else{if(l=Bd(e.g++,l),Hd.includes(l.name)){if(1!=t)throw new ze(2,4,4017);u=r.splice(s,r.length-s),r=n,i=[],a=[],s=[],l=null;for(var d=(u=c(u)).next();!d.done;d=u.next())d=d.value,/^(#EXT)/.test(d)?(d=Bd(e.g++,d),Vd.includes(d.name)?o.push(d):"EXT-X-MAP"==d.name?l=d:"EXT-X-PART"==d.name?s.push(d):"EXT-X-PRELOAD-HINT"==d.name?"PART"==kd(d,"TYPE")?s.push(d):"MAP"==kd(d,"TYPE")&&(d.name="EXT-X-MAP",l=d):a.push(d)):/^#(?!EXT)/m.test(d)||(d=st([r],[d.trim()])[0],l&&a.push(l),i.push(new Cd(d,a,s)),a=[],s=[]);return s.length&&(l&&a.push(l),i.push(new Cd("",a,s))),new Ed(n,t,o,i)}o.push(l),"EXT-X-STREAM-INF"==l.name&&(l.g.push(new Md("URI",u)),i=!0)}}return new Ed(n,t,o)}function Bd(e,t){var n=t.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!n)throw new ze(2,4,4016,t);var r,i=n[1],o=n[2];if(n=[],o){var a;(a=_d(o=new Ld(o),/^([^,=]+)(?:,|$)/g))&&(r=a[1]);for(var s=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;a=_d(o,s);)n.push(new Md(a[1],a[2]||a[3]))}return new Ad(e,i,n,r)}(i=pd.prototype).configure=function(e){this.o=e},i.start=function(e,t){var n,r=this;return L((function(i){if(1==i.g)return r.m=t.isLowLatencyMode(),r.h=[e],r.C=t,T(i,gd(r),2);if(n=i.h,r.C&&bd(r,n),!r.C)throw new ze(2,7,7001);return i.return(r.B)}))},i.stop=function(){for(var e=c(Object.values(this.l)),t=e.next();!t.done;t=e.next())t.value.release();return this.g&&this.g.release(),this.o=this.C=null,this.h=[],this.B=null,this.l={},this.g=null,null!=this.s&&(this.s.stop(),this.s=null),this.i.destroy()},i.update=function(){var e,t=this;return L((function(n){return 1==n.g?(S(n,2),T(n,gd(t),4)):2!=n.g?A(n,0):(e=k(n),t.C&&e?(t.C.onError(e),void x(n)):n.return())}))},i.onExpirationUpdated=function(){},i.$b=function(){var e,t,n=this;return L((function(r){switch(r.g){case 1:return e=0,S(r,2),T(r,gd(n),4);case 4:e=r.h,A(r,3);break;case 2:t=k(r),n.C&&(t.severity=1,n.C.onError(t));case 3:if(!n.C)return r.return();bd(n,e),x(r)}}))},V("shaka.dash.DashParser",pd),ai.mpd=function(){return new pd},oi["application/dash+xml"]=function(){return new pd},oi["video/vnd.mpeg.dash.mpd"]=function(){return new pd},Ad.prototype.toString=function(){var e="#"+this.name,t=this.g?this.g.map((function(e){return e.name+"="+(isNaN(Number(e.value))?'"'+e.value+'"':e.value)})):[];return this.value&&t.unshift(this.value),0<t.length&&(e+=":"+t.join(",")),e},Ad.prototype.getAttribute=function(e){var t=this.g.filter((function(t){return t.name==e}));return t.length?t[0]:null};var Vd="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".split(" "),Hd="EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE EXT-X-MAP".split(" ");function Kd(){}function Gd(e){try{var t=qd(e);return rr({uri:e,le:e,data:t.data,headers:{"content-type":t.contentType}})}catch(n){return tr(n)}}function qd(t){var n=t.split(":");if(2>n.length||"data"!=n[0])throw new ze(2,1,1004,t);if(2>(n=n.slice(1).join(":").split(",")).length)throw new ze(2,1,1004,t);var r=n[0];t=e.decodeURIComponent(n.slice(1).join(",")),n=r.split(";"),r=n[0];var i=!1;return 1<n.length&&"base64"==n[n.length-1]&&(i=!0,n.pop()),{data:i?kt(t):wt(t),contentType:r}}function zd(){var e=this;this.o=this.C=null,this.Ma=1,this.l=new Map,this.s=new Map,this.Fa=new Set,this.g=new Map,this.h=null,this.L="",this.Y=new Ud,this.ra=0,this.u=new en((function(){e.$b()})),this.j=hf,this.B=null,this.pa=0,this.F=1/0,this.S=this.Xa=0,this.D=new cr,this.qa=[],this.J=new Map,this.Wa=!1,this.m=new Map,this.N=null,this.da=new Map,this.H=new Map,this.i=!1}function Xd(e,t){var n,r,i,o,a,s,u,l,c,d,f,h;return L((function(p){if(1==p.g)return n=mf,r=t.De,i=new We(r),e.i&&t.Ie&&Je(i,new at("_HLS_skip=YES")),T(p,lf(e,pr([i.toString()],e.o.retryParameters),0),2);if(3!=p.g){if(o=p.h,1!=(a=Fd(e.Y,o.data,o.uri)).type)throw new ze(2,4,4017);return s=Dd(a.V,"EXT-X-DEFINE"),u=Wd(e,s),l=t.stream,T(p,rf(e,t.Nc,a,l.type,l.mimeType,t.wd,u,t.Pe),3)}c=p.h,l.segmentIndex.Ab(c,e.h.Za()),c.length&&(d=Pd(a.V,"EXT-X-MEDIA-SEQUENCE",0),f=t.wd.get(d),l.segmentIndex.eb(f)),h=c[c.length-1],Nd(a.V,"EXT-X-ENDLIST")&&(uf(e,n.Ce),e.h.Ja(h.endTime)),x(p)}))}function Wd(e,t){for(var n=new Map,r=c(t),i=r.next();!i.done;i=r.next()){var o=i.value;i=kd(o,"NAME");var a=kd(o,"VALUE");o=kd(o,"IMPORT"),i&&a&&n.set(i,a),o&&(i=e.l.get(o))&&n.set(o,i)}return n}function Yd(e,t){var n=[];e.o.disableVideo||n.push("avc1.42E01E"),e.o.disableAudio||n.push("mp4a.40.2");var r=kd(t,"CODECS",n.join(",")).split(/\s*,\s*/);n=new Set;for(var i=[],o=(r=c(r)).next();!o.done;o=r.next()){var a=_t(o=o.value);n.has(a)||(i.push(o),n.add(a))}return i}function $d(e){return zt(e=kd(e,"LANGUAGE")||"und")}function Jd(e,t){var n,r,i,o,a,s,u,l,c,d,f,h,p;return L((function(g){if(1==g.g){n=Id(t,"GROUP-ID"),r="";var m=Id(t,"TYPE").toLowerCase();return"subtitles"==m&&(m=dt),(i=m)!=dt&&n&&e.m.has(n)&&(r=e.m.get(n)),o=sf(Id(t,"URI"),e.l),e.g.has(o)?g.return(e.g.get(o)):(a=$d(t),s=kd(t,"NAME"),u=t.getAttribute("DEFAULT"),l="YES"==u,m="audio"==i&&(m=kd(t,"CHANNELS"))?parseInt(m.split("/")[0],10):null,c=m,m="audio"==i&&(!!(m=kd(t,"CHANNELS"))&&m.includes("/JOC")),d=m,f=kd(t,"CHARACTERISTICS"),h=kd(t,"FORCED"),T(g,Qd(e,o,r,i,a,l,s,c,null,f,"YES"==h,d),2))}return p=g.h,e.s.has(n)?e.s.get(n).push(p):e.s.set(n,[p]),null==p?g.return(null):e.g.has(o)?g.return(e.g.get(o)):(e.g.set(o,p),g.return(p))}))}function Qd(e,t,n,r,i,o,a,s,u,l,f,h){var p,g,m,v,y,b,w,x,E,I,C,M,D,R,N,P,j,_,O,U,F,B,V,H,K,G,q,z,X,Y,$,J,Q,Z,ee,te,ne,re,ie;return L((function(oe){switch(oe.g){case 1:return p=st([e.L],[t])[0],T(oe,lf(e,pr([p],e.o.retryParameters),0),2);case 2:if(g=oe.h,p=g.uri,1!=(m=Fd(e.Y,g.data,p)).type)throw new ze(2,4,4017);if(v=[],m.segments)for(y=c(m.segments),b=y.next();!b.done;b=y.next())w=b.value,x=Dd(w.V,"EXT-X-KEY"),v.push.apply(v,d(x));for(E=!1,I=[],C=new Set,M=c(v),D=M.next();!D.done;D=M.next())if(R=D.value,"NONE"!=(N=Id(R,"METHOD"))){if(E=!0,"AES-128"==N)return e.Wa=!0,oe.return(null);if(P=Id(R,"KEYFORMAT"),_=(j=ff[P])?j(R):null){if(_.keyIds)for(O=c(_.keyIds),U=O.next();!U.done;U=O.next())F=U.value,C.add(F);I.push(_)}}if(E&&!I.length)throw new ze(2,4,4026);return B=Dd(m.V,"EXT-X-DEFINE"),V=Wd(e,B),function(e,t){var n=Nd(t.V,"EXT-X-PLAYLIST-TYPE"),r=Nd(t.V,"EXT-X-ENDLIST");if(r=n&&"VOD"==n.value||r,n=n&&"EVENT"==n.value&&!r,n=!r&&!n,r)uf(e,hf);else{if(uf(e,n?gf:pf),!(r=Nd(t.V,"EXT-X-TARGETDURATION")))throw new ze(2,4,4024,"EXT-X-TARGETDURATION");r=Number(r.value),n=Nd(t.V,"EXT-X-PART-INF"),e.i&&n?(e.Xa=Number(Id(n,"PART-TARGET")),e.F=Math.min(e.Xa,e.F),n=Nd(t.V,"EXT-X-SERVER-CONTROL"),e.S=n?Number(Id(n,"PART-HOLD-BACK")):0):e.F=Math.min(r,e.F),e.pa=Math.max(r,e.pa)}}(e,m),T(oe,function(e,t,n,r,i){var o,a,s,u,l,c,d,f,h,p,g;return L((function(m){return 1==m.g?(o=ft,a=yr,s=sf(r.segments[0].g,i),u=new We(s),l=u.ya.split(".").pop(),c=df[t],(d=c[l])?m.return(d):t==o.aa?n&&"vtt"!=n&&"wvtt"!=n?m.return("application/mp4"):m.return("text/vtt"):t!=o.Mb||n&&"jpeg"!=n?((f=pr([s],e.o.retryParameters)).method="HEAD",T(m,lf(e,f,a),2)):m.return("image/jpeg")):(h=m.h,(p=h.headers["content-type"])?m.return(p.split(";")[0]):(g=c.mp4,m.return(g)))}))}(e,r,n,m,V),3);case 3:return H=oe.h,cf.includes(H)&&(n=""),K=new Map,G=new Map,S(oe,4),T(oe,rf(e,t,m,r,H,K,V,G),6);case 6:q=oe.h,A(oe,5);break;case 4:if(4035==(z=k(oe)).code)return W("Skipping unsupported HLS stream",H,t),oe.return(null);throw z;case 5:if(X=q[0].startTime,Y=q[q.length-1].endTime,$=new ba(q),J=r==dt?"subtitle":void 0,Q=[],l)for(Z=c(l.split(",")),ee=Z.next();!ee.done;ee=Z.next())te=ee.value,Q.push(te);return re=!!(ne=Nd(m.V,"EXT-X-SERVER-CONTROL"))&&null!=ne.getAttribute("CAN-SKIP-UNTIL"),ie={id:e.Ma++,originalId:a,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:$,mimeType:H,codecs:n,kind:J,encrypted:E,drmInfos:I,keyIds:C,language:i,label:a,type:r,primary:o,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:void 0,pixelAspectRatio:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:Q,forced:f,channelsCount:s,audioSamplingRate:null,spatialAudio:h,closedCaptions:u,hdr:void 0,tilesLayout:void 0},oe.return({stream:ie,Nc:t,De:p,je:X,wf:Y,wd:K,Pe:G,Ie:re})}}))}function Zd(e,t,n,r){return(n=Nd(n,"EXT-X-MAP"))?(t=[r=sf(st([t],[Id(n,"URI")])[0],r),kd(n,"BYTERANGE","")].join("-"),e.da.has(t)||(n=function(e,t){var n=0,r=null,i=kd(t,"BYTERANGE");return i&&(n=i.split("@"),r=Number(n[0]),n=Number(n[1]),r=n+r-1),new Jo((function(){return[e]}),n,r)}(r,n),e.da.set(t,n)),e.da.get(t)):null}function ef(e,t,n,r,i,o,a,s,u){var l=r.V,d=sf(r.g,a),f=Nd(l,"EXTINF"),h=a=0,p=null,g=[];if(e.i&&r.h.length){e={};for(var m=(r=c(ne(r.h))).next();!m.done;e={Wc:e.Wc},m=r.next()){var v=(m=m.value).ha;m=m.item;var y=0==v?n:g[g.length-1];v=0==v?i:y.endTime;var b=Number(kd(m,"DURATION"));b=v+b;var w=0,T=null;"EXT-X-PRELOAD-HINT"==m.name?w=(y=kd(m,"BYTERANGE-START"))?Number(y):0:(w=(y=c(tf(y,w=kd(m,"BYTERANGE")))).next().value,T=y.next().value),m=kd(m,"URI"),e.Wc=st([s],[m])[0],g.push(new Qo(v,b,function(e){return function(){return[e.Wc]}}(e),w,T,t,o,0,1/0))}}else if(!f)throw new ze(2,4,4024,"EXTINF");return a=f?i+Number(f.value.split(",")[0]):g[g.length-1].endTime,(s=Nd(l,"EXT-X-BYTERANGE"))?(h=(p=c(tf(n,s.value))).next().value,p=p.next().value):g.length&&(h=g[0].ja,p=g[g.length-1].ea),n="","image"==u&&(n="1x1",(u=Nd(l,"EXT-X-TILES"))&&(n=Id(u,"LAYOUT"))),new Qo(i,a,(function(){return d.length?[d]:[]}),h,p,t,o,0,1/0,g,n)}function tf(e,t){var n=0,r=null;return t&&(n=t.split("@"),r=Number(n[0]),r=(n=n[1]?Number(n[1]):e.ea+1)+r-1),[n,r]}function nf(e){if(e.h){for(var t=c(e.qa),n=t.next();!n.done;n=t.next())e.h.Bb(n.value);e.qa=[]}}function rf(e,t,n,r,i,o,a,s){var u,l,d,f,h,p,g,m,v,y,b,w,x,S,E,A,k,I,C,M;return L((function(D){switch(D.g){case 1:if(u=n.segments,d=Pd(n.V,"EXT-X-MEDIA-SEQUENCE",0),h=(f=Nd(n.V,"EXT-X-SKIP"))?Number(kd(f,"SKIPPED-SEGMENTS")):0,p=d+h,e.j!=hf&&o.has(p)){g=o.get(p),D.v(2);break}if(null!=e.N){D.v(3);break}return l=Zd(e,n.g,u[0].V,a),m=e,T(D,af(e,t,l,i,p,!1,u[0],a,r),4);case 4:m.N=D.h;case 3:g=e.N;case 2:if(u[0].g.split("/").pop(),v=Pd(n.V,"EXT-X-DISCONTINUITY-SEQUENCE"),e.i&&(s.has(v)||s.set(v,p),h))for(;s.has(v+1)&&s.get(v+1)<p;)v++;y=e.H.get(v)||0,b=[],w=c(function(e){return ne(e)}(u)),x=w.next();case 5:if(x.done){D.v(7);break}if(S=x.value,E=S.ha,A=S.item,k=b[b.length-1],I=0==E?g:k.endTime,p=d+h+E,o.set(p,I),l=Zd(e,n.g,A.V,a),!Nd(A.V,"EXT-X-DISCONTINUITY")){D.v(8);break}return v++,s.set(v,p),T(D,function(e,t,n,r,i,o,a,s,u,l){var c,d;return L((function(f){return 1==f.g?(c=0,e.H.has(t)?(c=e.H.get(t),f.v(2)):T(f,af(e,n,r,i,o,!0,a,s,l),3)):(2!=f.g&&(d=f.h,c=u-d,e.H.set(t,c)),f.return(c))}))}(e,v,t,l,i,p,A,a,I,r),9);case 9:y=D.h;case 8:!e.i&&e.C.isAutoLowLatencyMode()&&(e.C.enableLowLatencyMode(),e.i=e.C.isLowLatencyMode()),C=Nd(A.V,"EXTINF"),e.i||C?(M=ef(e,l,k,A,I,y,a,n.g,r),b.push(M)):e.i||W("Low-latency HLS 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."),x=w.next(),D.v(5);break;case 7:return e.qa.push(b),nf(e),D.return(b)}}))}function of(e,t){var n,r,i,o,a,s;return L((function(u){switch(u.g){case 1:return n=yr,r=Na(t.ma(),t.ja,t.ea,e.o.retryParameters),e.o.hls.useFullSegmentsForStartTime?u.return(lf(e,r,n)):(i=Na(t.ma(),t.ja,t.ja+2048-1,e.o.retryParameters),S(u,2),T(u,lf(e,i,n),4));case 4:return o=u.h,u.return(o);case 2:if(7001==(a=k(u)).code)throw a;return W("Unable to fetch the starting part of HLS segment! Falling back to a full segment request, which is expensive! Your server should support Range requests and CORS preflights.",i.uris[0]),T(u,lf(e,r,n),5);case 5:return s=u.h,u.return(s)}}))}function af(e,t,n,r,i,o,a,s,u){var l,c,d,f,h,p,g,m;return L((function(v){switch(v.g){case 1:if(l=ef(e,n,null,a,0,0,s,"",u),e.B&&!o&&(c=e.g.get(t),void 0!=(d=c.wd.get(i))))return v.return(d);if(r=r.toLowerCase(),cf.includes(r))throw W("Raw formats are not yet supported. Skipping "+r),new ze(1,4,4035);if("video/webm"==r)throw W("WebM in HLS is not yet supported. Skipping."),new ze(1,4,4035);if("video/mp4"!=r&&"audio/mp4"!=r){v.v(2);break}return f=[of(e,l)],n&&f.push(of(e,n)),T(v,Promise.all(f),3);case 3:return h=v.h,p=h[0],g=h[1]||h[0],v.return(function(e,t,n,r){var i=0;if((new ci).box("moov",di).box("trak",di).box("mdia",di).T("mdhd",(function(e){i=Io(e.reader,e.version).timescale,e.parser.stop()})).parse(r,!0),!i)throw new ze(2,4,4030,e,t);var o=0,a=!1;if((new ci).box("moof",di).box("traf",di).T("tfdt",(function(e){o=ko(e.reader,e.version).hd/i,a=!0,e.parser.stop()})).parse(n,!0),!a)throw new ze(2,4,4030,e,t);return o}(t,p.uri,p.data,g.data));case 2:if("video/mp2t"!=r){v.v(4);break}return T(v,of(e,l),5);case 5:return m=v.h,v.return(function(e,t,n){function r(){o.seek(a+188),71!=(s=o.$())&&(o.seek(a+192),s=o.$()),71!=s&&(o.seek(a+204),s=o.$()),71!=s&&i(),o.oe(1)}function i(){throw new ze(2,4,4030,e,t)}var o=new si(n,0),a=0,s=0;for(n=Math.min(o.P.byteLength-188,940);;){if(a=o.Z(),71!=(s=o.$())){if(0<n){--n;continue}i()}n=0;var u=o.Eb();if(8191==(8191&u))r();else if(16384&u){if(0!=(u=(48&o.$())>>4)&&2!=u||i(),3==u&&(u=o.$(),o.skip(u)),1==o.M()>>8)return o.skip(3),0!=(n=o.$()>>6)&&1!=n||i(),0==o.$()&&i(),(1073741824*((14&(n=o.$()))>>1)+((65534&(u=o.Eb()))<<14|(65534&o.Eb())>>1))/9e4;r()}else r()}}(t,m.uri,m.data));case 4:throw new ze(2,4,4030,t)}}))}function sf(e,t){var n=String(e).replace(/%7B/g,"{").replace(/%7D/g,"}"),r=n.match(/{\$\w*}/g);if(r)for(var i=(r=c(r)).next();!i.done;i=r.next()){var o=(i=i.value).slice(2,i.length-1),a=t.get(o);if(!a)throw new ze(2,4,4039,o);n=n.replace(i,a)}return n}function uf(e,t){e.j=t,e.h&&e.h.fc(e.j==hf),e.j!=hf||e.u.stop()}function lf(e,t,n){if(!e.D)throw new ze(2,7,7001);return t=e.C.networkingEngine.request(n,t),dr(e.D,t),t.promise}V("shaka.net.DataUriPlugin",Kd),Kd.parse=Gd,hr("data",Gd),(i=zd.prototype).configure=function(e){this.o=e},i.start=function(e,t){var n,r,i=this;return L((function(o){return 1==o.g?(i.C=t,i.i=t.isLowLatencyMode(),T(o,lf(i,pr([e],i.o.retryParameters),0),2)):3!=o.g?(n=o.h,i.L=n.uri,T(o,function(e,t){var n,r,i,o,a,s,u,l,d,f,h,p,g,m,v,y,b,w,E,A,I,C,M,D,R,N;return L((function(P){switch(P.g){case 1:if(0!=(n=Fd(e.Y,t,e.L)).type)throw new ze(2,4,4022);for(var j=c(Dd(n.V,"EXT-X-DEFINE")),_=j.next();!_.done;_=j.next()){var O=_.value;_=kd(O,"NAME"),O=kd(O,"VALUE"),_&&O&&(e.l.has(_)||e.l.set(_,O))}for(r=Dd(n.V,"EXT-X-MEDIA"),i=Dd(n.V,"EXT-X-STREAM-INF"),o=Dd(n.V,"EXT-X-IMAGE-STREAM-INF"),_=(j=c(i)).next();!_.done;_=j.next()){var U=_.value;O=kd(U,"AUDIO"),_=kd(U,"VIDEO");var F=kd(U,"SUBTITLES");if(U=Yd(e,U),F){var B=ct(dt,U);e.m.set(F,B),ie(U,B)}O&&(F=lt("audio",U),e.m.set(O,F)),_&&(O=lt("video",U),e.m.set(_,O))}for(a=Dd(n.V,"EXT-X-SESSION-DATA"),s=c(a),u=s.next();!u.done;u=s.next())l=u.value,d=kd(l,"DATA-ID"),f=kd(l,"URI"),h=kd(l,"LANGUAGE"),p=kd(l,"VALUE"),g={id:d},f&&(g.uri=st([e.L],[f])[0]),h&&(g.language=h),p&&(g.value=p),m=new ar("sessiondata",g),e.C&&e.C.onEvent(m);return T(P,function(e,t){var n;return L((function(r){return 1==r.g?(t=t.filter((function(e){var t=kd(e,"URI")||"";return"SUBTITLES"!=kd(e,"TYPE")&&""!=t}))).length?T(r,Jd(e,t[0]),2):r.v(2):(n=t.slice(1).map((function(t){return Jd(e,t)})),T(r,Promise.all(n),0))}))}(e,r),2);case 2:for(_=(j=c(j=Rd(r,"CLOSED-CAPTIONS"))).next();!_.done;_=j.next())_=$d(F=_.value),O=Id(F,"GROUP-ID"),F=Id(F,"INSTREAM-ID"),e.J.get(O)||e.J.set(O,new Map),e.J.get(O).set(F,_);return T(P,function(e,t){var n,r,i;return L((function(o){return 1==o.g?(n=t.map((function(t){var n,r,i,o,a,s,u,l;return L((function(d){if(1==d.g)return n=kd(t,"FRAME-RATE"),r=Number(kd(t,"AVERAGE-BANDWIDTH"))||Number(Id(t,"BANDWIDTH")),i=kd(t,"RESOLUTION"),o=c(i?i.split("x"):[null,null]),a=o.next().value,s=o.next().value,u=kd(t,"VIDEO-RANGE"),T(d,function(e,t){var n,r,i,o,a,s,u,l,d,f,h,p,g,m;return L((function(v){if(1==v.g)return n=ft,r=Yd(e,t),i=kd(t,"AUDIO"),o=kd(t,"VIDEO"),s=(a=i||o)&&e.s.has(a)?e.s.get(a):[],u={audio:i?s:[],video:o?s:[]},d=!1,f=Id(t,"URI"),h=u.audio.find((function(e){return e&&e.Nc==f})),p=ct(n.Na,r),(g=ct(n.bb,r))&&!p?l=n.bb:!s.length&&g&&p?(l=n.Na,r=[[p,g].join()]):u.audio.length&&h?(l=n.bb,d=!0):l=u.video.length?n.bb:n.Na,d?v.v(2):T(v,function(e,t,n,r){var i,o,a,s;return L((function(u){if(1==u.g){if(i=sf(Id(t,"URI"),e.l),e.g.has(i))return u.return(e.g.get(i));var l=kd(t,"CLOSED-CAPTIONS");return o="video"==r&&l&&"NONE"!=l?e.J.get(l):null,a=lt(r,n),T(u,Qd(e,i,a,r,"und",!1,null,null,o,null,!1,!1),2)}return null==(s=u.h)?u.return(null):e.g.has(i)?u.return(e.g.get(i)):(e.g.set(i,s),u.return(s))}))}(e,t,r,l),3);if(2!=v.g&&(m=v.h),m)u[m.stream.type]=[m];else if(null===m)return v.return(null);return function(e){for(var t=(e=c(e.audio.concat(e.video))).next();!t.done;t=e.next())if(t=t.value){var n=t.stream.codecs.split(",");n=n.filter((function(e){return"mp4a.40.34"!=e})),t.stream.codecs=n.join(",")}}(u),v.return(u)}))}(e,t),2);if(l=d.h){for(var f=d.return,h=l.audio,p=l.video,g=c(p),m=g.next();!m.done;m=g.next())(m=m.value.stream)&&(m.width=Number(a)||void 0,m.height=Number(s)||void 0,m.frameRate=Number(n)||void 0,m.hdr=u||void 0);for(g=e.o.disableAudio,h.length&&!g||(h=[null]),g=e.o.disableVideo,p.length&&!g||(p=[null]),g=[],m=(h=c(h)).next();!m.done;m=h.next()){m=m.value;for(var v=c(p),y=v.next();!y.done;y=v.next()){var b=y.value;y=m?m.stream:null;var w=b?b.stream:null,x=m?m.stream.drmInfos:null,S=b?b.stream.drmInfos:null;b=(b?b.Nc:"")+" - "+(m?m.Nc:""),y&&w&&x.length&&S.length&&!(0<zr(x,S).length)||e.Fa.has(b)||(y={id:e.Ma++,language:y?y.language:"und",primary:!!y&&y.primary||!!w&&w.primary,audio:y,video:w,bandwidth:r,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},g.push(y),e.Fa.add(b))}}d=f.call(d,g)}else d=d.return([]);return d}))})),T(o,Promise.all(n),2)):(r=o.h,i=(i=r.reduce(Fe,[])).filter((function(e){return null!=e})),o.return(i))}))}(e,i),3);case 3:return v=P.h,T(P,function(e,t){var n,r,i,o,a,s,u,l,d,f,h;return L((function(p){if(1==p.g)return n=Rd(t,"SUBTITLES"),r=n.map((function(t){var n,r;return L((function(i){if(1==i.g)return e.o.disableText?i.return(null):(S(i,2),T(i,Jd(e,t),4));if(2!=i.g)return n=i.h,i.return(n.stream);if(r=k(i),e.o.hls.ignoreTextStreamFailures)return i.return(null);throw r}))})),T(p,Promise.all(r),2);for(i=p.h,o=c(n),a=o.next();!a.done;a=o.next())if(s=a.value,u=Id(s,"GROUP-ID"),(l=e.m.get(u))&&(d=e.s.get(u)))for(f=c(d),h=f.next();!h.done;h=f.next())h.value.stream.codecs=l;return p.return(i.filter((function(e){return e})))}))}(e,r),4);case 4:return y=P.h,T(P,function(e,t){var n,r;return L((function(i){return 1==i.g?(n=t.map((function(t){var n,r;return L((function(i){if(1==i.g)return e.o.disableThumbnails?i.return(null):(S(i,2),T(i,function(e,t){var n,r,i,o,a,s;return L((function(u){return 1==u.g?(n=sf(Id(t,"URI"),e.l),r=kd(t,"CODECS","jpeg")||"",e.g.has(n)?u.return(e.g.get(n)):(i=$d(t),o=kd(t,"NAME"),a=kd(t,"CHARACTERISTICS"),T(u,Qd(e,n,r,"image",i,!1,o,null,null,a,!1,!1),2))):null==(s=u.h)?u.return(null):e.g.has(n)?u.return(e.g.get(n)):(e.g.set(n,s),u.return(s))}))}(e,t),4));if(2!=i.g)return n=i.h,i.return(n.stream);if(r=k(i),e.o.hls.ignoreImageStreamFailures)return i.return(null);throw r}))})),T(i,Promise.all(n),2)):(r=i.h,i.return(r.filter((function(e){return e}))))}))}(e,o),5);case 5:if(b=P.h,!e.C)throw new ze(2,7,7001);if(e.Wa&&0==v.length)throw new ze(2,4,4034);for(E=w=1/0,A=c(e.g.values()),I=A.next();!I.done;I=A.next())C=I.value,w=Math.min(w,C.je),"text"!=C.stream.type&&(E=Math.min(E,C.wf-C.je));if(e.j!=hf?(e.h=new Zo(0,e.o.defaultPresentationDelay?e.o.defaultPresentationDelay:e.S?e.S:3*e.pa),e.h.fc(!1)):(e.h=new Zo(null,0),e.h.fc(!0)),nf(e),e.j!=hf)e.ra=e.F,M=mf,e.j==M.Be&&(D=e.h.Jc,isNaN(e.o.availabilityWindowOverride)||(D=e.o.availabilityWindowOverride),e.h.Pd(D));else for(e.h.Ja(E),e.h.offset(-w),R=c(e.g.values()),I=R.next();!I.done;I=R.next())(N=I.value).stream.segmentIndex.offset(-w),N.stream.segmentIndex.Ya(0,E);e.B={presentationTimeline:e.h,variants:v,textStreams:y,imageStreams:b,offlineSessionIds:[],minBufferTime:0},e.C.makeTextStreamsForClosedCaptions(e.B),x(P)}}))}(i,n.data),3)):(0<(r=i.ra)&&i.u.U(r),o.return(i.B))}))},i.stop=function(){this.u&&(this.u.stop(),this.u=null);var e=[];return this.D&&(e.push(this.D.destroy()),this.D=null),this.o=this.C=null,this.Fa.clear(),this.B=null,this.g.clear(),this.s.clear(),this.m.clear(),this.l.clear(),Promise.all(e)},i.update=function(){var e,t,n,r=this;return L((function(i){if(1==i.g)return r.j==hf?i.return():(e=[],r.N=null,(t=Array.from(r.g.values())).length?T(i,Xd(r,t[0]),2):i.v(2));for(n=1;n<t.length;n++)e.push(Xd(r,t[n]));return T(i,Promise.all(e),0)}))},i.onExpirationUpdated=function(){},i.$b=function(){var e,t,n=this;return L((function(r){return 1==r.g?n.C?(S(r,2),T(r,n.update(),4)):r.return():2!=r.g?(e=n.ra,n.u.U(e),A(r,0)):(t=k(r),n.C?(t.severity=1,n.C.onError(t),n.u.U(.1),void x(r)):r.return())}))},V("shaka.hls.HlsParser",zd);var cf=["audio/aac","audio/ac3","audio/ec3","audio/mpeg"],df={audio:{mp4:"audio/mp4",mp4a:"audio/mp4",m4s:"audio/mp4",m4i:"audio/mp4",m4a:"audio/mp4",m4f:"audio/mp4",cmfa:"audio/mp4",ts:"video/mp2t",aac:"audio/aac",ac3:"audio/ac3",ec3:"audio/ec3",mp3:"audio/mpeg"},video:{mp4:"video/mp4",mp4v:"video/mp4",m4s:"video/mp4",m4i:"video/mp4",m4v:"video/mp4",m4f:"video/mp4",cmfv:"video/mp4",ts:"video/mp2t"},text:{mp4:"application/mp4",m4s:"application/mp4",m4i:"application/mp4",m4f:"application/mp4",cmft:"application/mp4",vtt:"text/vtt",ttml:"application/ttml+xml"},image:{jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"}},ff={"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(e){var t=Id(e,"METHOD");return["SAMPLE-AES","SAMPLE-AES-CTR"].includes(t)?(t=ut("com.widevine.alpha",[{initDataType:"cenc",initData:t=Re((t=qd(t=Id(e,"URI"))).data)}]),(e=kd(e,"KEYID"))&&(t.keyIds=new Set([e.toLowerCase().substr(2)])),t):null},"com.microsoft.playready":function(e){var t=Id(e,"METHOD");return["SAMPLE-AES","SAMPLE-AES-CTR"].includes(t)?ut("com.microsoft.playready",[{initDataType:"cenc",initData:e=$l(e=Re((e=qd(e=Id(e,"URI"))).data),t=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]))}]):null}},hf="VOD",pf="EVENT",gf="LIVE",mf={Ce:hf,fg:pf,Be:gf};function vf(e,t,n,r,i,o){if(200<=n&&299>=n&&202!=n)return{uri:i||r,le:r,data:t,headers:e,fromCache:!!e["x-shaka-from-cache"]};i=null;try{i=bt(t)}catch(a){}throw new ze(401==n||403==n?2:1,1,1001,r,n,i,e,o)}function yf(){}function bf(e,t,n,r){var i=new Ef;Mr(t.headers).forEach((function(e,t){i.append(t,e)}));var o=new xf,a={Ud:!1,xe:!1};if(e=new er(e=function(e,t,n,r,i,o){var a,s,u,l,c,d,f,h,p,g,m,v;return L((function(y){switch(y.g){case 1:return a=Tf,s=Sf,d=c=0,f=Date.now(),S(y,2),T(y,a(e,n),4);case 4:return u=y.h,h=u.clone().body.getReader(),g=(p=u.headers.get("Content-Length"))?parseInt(p,10):0,new s({start:function(e){function t(){var n,r;return L((function(a){switch(a.g){case 1:return S(a,2),T(a,h.read(),4);case 4:n=a.h,A(a,3);break;case 2:return k(a),a.return();case 3:if(n.done){a.v(5);break}if(c+=n.value.byteLength,!o){a.v(5);break}return T(a,o(n.value),5);case 5:(100<(r=Date.now())-f||n.done)&&(i(r-f,c-d,g-c),d=c,f=r),n.done?e.close():(e.enqueue(n.value),t()),x(a)}}))}t()}}),T(y,u.arrayBuffer(),5);case 5:l=y.h,A(y,3);break;case 2:if(m=k(y),r.Ud)throw new ze(1,1,7001,e,t);if(r.xe)throw new ze(1,1,1003,e,t);throw new ze(1,1,1002,e,m,t);case 3:return v={},u.headers.forEach((function(e,t){v[t.trim()]=e})),y.return(vf(v,l,u.status,e,u.url,t))}}))}(e,n,{body:t.body||void 0,headers:i,method:t.method,signal:o.signal,credentials:t.allowCrossSiteCredentials?"include":void 0},a,r,t.streamDataCallback),(function(){return a.Ud=!0,o.abort(),Promise.resolve()})),t=t.retryParameters.timeout){var s=new en((function(){a.xe=!0,o.abort()}));s.U(t/1e3),e.finally((function(){s.stop()}))}return e}function wf(){if(!e.ReadableStream)return!1;try{new ReadableStream({})}catch(hm){return!1}return!(!e.fetch||!e.AbortController)}ai.m3u8=function(){return new zd},oi["application/x-mpegurl"]=function(){return new zd},oi["application/vnd.apple.mpegurl"]=function(){return new zd},V("shaka.net.HttpFetchPlugin",yf),yf.isSupported=wf,yf.parse=bf;var Tf=e.fetch,xf=e.AbortController,Sf=e.ReadableStream,Ef=e.Headers;function Af(){}function kf(e,t,n,r){var i=new If,o=Date.now(),a=0;return new er(new Promise((function(s,u){for(var l in i.open(t.method,e,!0),i.responseType="arraybuffer",i.timeout=t.retryParameters.timeout,i.withCredentials=t.allowCrossSiteCredentials,i.onabort=function(){u(new ze(1,1,7001,e,n))},i.onload=function(t){for(var r=(t=t.target).getAllResponseHeaders().trim().split("\r\n"),i={},o=(r=c(r)).next();!o.done;o=r.next())i[(o=o.value.split(": "))[0].toLowerCase()]=o.slice(1).join(": ");try{var a=vf(i,t.response,t.status,e,t.responseURL,n);s(a)}catch(l){u(l)}},i.onerror=function(t){u(new ze(1,1,1002,e,t,n))},i.ontimeout=function(){u(new ze(1,1,1003,e,n))},i.onprogress=function(e){var t=Date.now();(100<t-o||e.lengthComputable&&e.loaded==e.total)&&(r(t-o,e.loaded-a,e.total-e.loaded),a=e.loaded,o=t)},t.headers)i.setRequestHeader(l.toLowerCase(),t.headers[l]);i.send(t.body)})),(function(){return i.abort(),Promise.resolve()}))}wf()&&(hr("http",bf,2,!0),hr("https",bf,2,!0)),V("shaka.net.HttpXHRPlugin",Af),Af.parse=kf;var If=e.XMLHttpRequest;function Cf(){this.h=this.j=this.i=0,this.g=new Map,this.l=0}function Mf(e){var t=this;this.O=e,this.g=new Map,this.I=new Tr((function(){return Df(t).catch((function(){}))})),this.h=[],this.ie=function(){},this.he=function(){},this.Ob=new Cf}function Df(e){var t=e.h.map((function(e){return e()}));return e.h=[],Promise.all(t)}function Rf(e,t,n,r,i,o){xr(e.I);var a=function(e,t){e.i+=t;var n=e.l;return e.l++,e.g.set(n,t),n}(e.Ob,r);return r=(e.g.get(t)||Promise.resolve()).then((function(){var t,r,s,u,l,c,d;return L((function(f){if(1==f.g)return T(f,function(e,t){var n,r,i,o;return L((function(a){return 1==a.g?(n=yr,r=e.O.request(n,t),i=function(){return r.abort()},e.h.push(i),T(a,r.promise,2)):(o=a.h,ie(e.h,i),a.return(o.data))}))}(e,n),2);if(t=f.h,e.I.g)throw new ze(2,9,7001);if(i)for(u in r=Re(t),(s=new Yl(r)).data)l=Number(u),c=s.data[l],d=s.g[l],e.he(c,d);e.Ob.close(a,t.byteLength);var h=e.Ob;return e.ie(0==h.i?0:h.j/h.i,e.Ob.h),f.return(o(t))}))})),e.g.set(t,r),r}function Nf(e,t){var n=this;this.i=e,this.h=e.objectStore(t),this.g=new pt,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 Pf(e,t){return new Promise((function(n,r){var i=e.h.openCursor();i.onerror=r,i.onsuccess=function(){var e;return L((function(r){if(1==r.g)return null==i.result?(n(),r.return()):(e=i.result,T(r,t(e.key,e.value,e),2));e.continue(),x(r)}))}}))}function Lf(e){this.h=e,this.g=[]}function jf(e,t){return _f(e,t,"readwrite")}function _f(e,t,n){var r=new Nf(n=e.h.transaction([t],n),t);return e.g.push(r),r.promise().then((function(){ie(e.g,r)}),(function(){ie(e.g,r)})),r}function Of(e,t,n){this.g=new Lf(e),this.i=t,this.h=n}function Uf(e){return Promise.reject(new ze(2,9,9011,"Cannot add new value to "+e))}function Ff(e,t,n,r){t=(e=jf(e.g,t)).store();for(var i={},o=(n=c(n)).next();!o.done;i={lc:i.lc},o=n.next())i.lc=o.value,t.delete(i.lc).onsuccess=function(e){return function(){return r(e.lc)}}(i);return e.promise()}function Bf(e,t,n){var r,i,o,a,s,u,l;return L((function(d){if(1==d.g){for(r=_f(e.g,t,"readonly"),i=r.store(),o={},a=[],s={},u=c(n),l=u.next();!l.done;s={Lb:s.Lb,Jb:s.Jb},l=u.next())s.Jb=l.value,s.Lb=i.get(s.Jb),s.Lb.onsuccess=function(e){return function(){void 0==e.Lb.result&&a.push(e.Jb),o[e.Jb]=e.Lb.result}}(s);return T(d,r.promise(),2)}if(a.length)throw new ze(2,9,9012,"Could not find values for "+a);return d.return(n.map((function(e){return o[e]})))}))}function Vf(e){this.g=new Lf(e)}function Hf(){this.g=new Map}function Kf(e,t,n){if(!(e=e.g.get(t)))throw new ze(2,9,9013,"Could not find mechanism with name "+t);if(!(t=e.getCells().get(n)))throw new ze(2,9,9013,"Could not find cell with name "+n);return t}function Gf(e,t){qf.set(e,t)}hr("http",kf,1,!0),hr("https",kf,1,!0),Cf.prototype.close=function(e,t){if(this.g.has(e)){var n=this.g.get(e);this.g.delete(e),this.j+=n,this.h+=t}},Mf.prototype.destroy=function(){return this.I.destroy()},Nf.prototype.abort=function(){var e=this;return L((function(t){if(1==t.g){try{e.i.abort()}catch(n){}return S(t,2),T(t,e.g,4)}if(2!=t.g)return A(t,0);k(t),x(t)}))},Nf.prototype.store=function(){return this.h},Nf.prototype.promise=function(){return this.g},Lf.prototype.destroy=function(){return Promise.all(this.g.map((function(e){return e.abort()})))},(i=Of.prototype).destroy=function(){return this.g.destroy()},i.hasFixedKeySpace=function(){return!0},i.addSegments=function(){return Uf(this.i)},i.removeSegments=function(e,t){return Ff(this,this.i,e,t)},i.getSegments=function(e){var t,n=this;return L((function(r){return 1==r.g?T(r,Bf(n,n.i,e),2):(t=r.h,r.return(t.map((function(e){return n.Vd(e)}))))}))},i.addManifests=function(){return Uf(this.h)},i.updateManifestExpiration=function(e,t){var n=jf(this.g,this.h),r=n.store();return r.get(e).onsuccess=function(n){(n=n.target.result)&&(n.expiration=t,r.put(n,e))},n.promise()},i.removeManifests=function(e,t){return Ff(this,this.h,e,t)},i.getManifests=function(e){var t,n=this;return L((function(r){return 1==r.g?T(r,Bf(n,n.h,e),2):(t=r.h,r.return(Promise.all(t.map((function(e){return n.Rb(e)})))))}))},i.getAllManifests=function(){var e,t,n=this;return L((function(r){return 1==r.g?(e=_f(n.g,n.h,"readonly"),t=new Map,T(r,Pf(e,(function(e,r){var i;return L((function(o){if(1==o.g)return T(o,n.Rb(r),2);i=o.h,t.set(e,i),x(o)}))})),2)):3!=r.g?T(r,e.promise(),3):r.return(t)}))},i.Vd=function(e){return e},i.Rb=function(e){return Promise.resolve(e)},i.add=function(e,t){var n,r,i,o,a,s,u,l=this;return L((function(d){if(1==d.g){for(n=jf(l.g,e),r=n.store(),i=[],o={},a=c(t),s=a.next();!s.done;o={mc:o.mc},s=a.next())u=s.value,o.mc=r.add(u),o.mc.onsuccess=function(e){return function(){i.push(e.mc.result)}}(o);return T(d,n.promise(),2)}return d.return(i)}))},Vf.prototype.destroy=function(){return this.g.destroy()},Vf.prototype.getAll=function(){var e,t,n=this;return L((function(r){return 1==r.g?(e=_f(n.g,"session-ids","readonly"),t=[],T(r,Pf(e,(function(e,n){t.push(n)})),2)):3!=r.g?T(r,e.promise(),3):r.return(t)}))},Vf.prototype.add=function(e){for(var t=jf(this.g,"session-ids"),n=t.store(),r=(e=c(e)).next();!r.done;r=e.next())n.add(r.value);return t.promise()},Vf.prototype.remove=function(e){var t,n=this;return L((function(r){return 1==r.g?T(r,Pf(t=jf(n.g,"session-ids"),(function(t,n,r){e.includes(n.sessionId)&&r.delete()})),2):T(r,t.promise(),0)}))},Hf.prototype.destroy=function(){for(var e=[],t=c(this.g.values()),n=t.next();!n.done;n=t.next())e.push(n.value.destroy());return this.g.clear(),Promise.all(e)},Hf.prototype.init=function(){var e=this;qf.forEach((function(t,n){var r=t();r&&e.g.set(n,r)}));for(var t=[],n=c(this.g.values()),r=n.next();!r.done;r=n.next())t.push(r.value.init());return Promise.all(t)},V("shaka.offline.StorageMuxer",Hf),Hf.unregister=function(e){qf.delete(e)},Hf.register=Gf,Hf.prototype.destroy=Hf.prototype.destroy;var qf=new Map;function zf(){Of.apply(this,arguments)}function Xf(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=c(t),r=n.next();!r.done;r=n.next())r.value.variantIds=[];for(r=(n=c(e)).next();!r.done;r=n.next())r.value.variantIds=[];if(n=0,e.length&&!t.length){var i=n++,o=c(e);for(r=o.next();!r.done;r=o.next())r.value.variantIds.push(i)}if(!e.length&&t.length)for(i=n++,r=(o=c(t)).next();!r.done;r=o.next())r.value.variantIds.push(i);if(e.length&&t.length)for(r=(t=c(t)).next();!r.done;r=t.next())for(r=r.value,o=(i=c(e)).next();!o.done;o=i.next()){o=o.value;var a=n++;r.variantIds.push(a),o.variantIds.push(a)}}}(e);for(var n=c(e.streams),r=n.next();!r.done;r=n.next());return e.streams.map((function(n){return function(e,t,n){var r=e.initSegmentUri?Wf(e.initSegmentUri):null,i=t+e.presentationTimeOffset,o=t+n;return{id:e.id,originalId:null,primary:e.primary,type:e.contentType,mimeType:e.mimeType,codecs:e.codecs,frameRate:e.frameRate,pixelAspectRatio:void 0,hdr:void 0,kind:e.kind,language:e.language,label:e.label,width:e.width,height:e.height,initSegmentKey:r,encrypted:e.encrypted,keyIds:new Set([e.keyId]),segments:e.segments.map((function(e){var n=Wf(e.uri);return{startTime:t+e.startTime,endTime:t+e.endTime,dataKey:n,initSegmentKey:r,appendWindowStart:t,appendWindowEnd:o,timestampOffset:i,tilesLayout:""}})),variantIds:e.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0}}(n,e.startTime,t)}))}function Wf(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 ze(2,9,9004,"Could not parse uri "+e)}function Yf(){Of.apply(this,arguments)}function $f(e,t,n){return{id:e.id,originalId:e.originalId,primary:e.primary,type:e.contentType,mimeType:e.mimeType,codecs:e.codecs,frameRate:e.frameRate,pixelAspectRatio:e.pixelAspectRatio,hdr:void 0,kind:e.kind,language:e.language,label:e.label,width:e.width,height:e.height,encrypted:e.encrypted,keyIds:new Set([e.keyId]),segments:e.segments.map((function(r){return{startTime:t+r.startTime,endTime:t+r.endTime,initSegmentKey:e.initSegmentKey,appendWindowStart:t,appendWindowEnd:n,timestampOffset:t-e.presentationTimeOffset,dataKey:r.dataKey,tilesLayout:""}})),variantIds:e.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0}}function Jf(){Of.apply(this,arguments)}function Qf(){this.m=this.j=this.i=this.h=this.g=this.l=null}function Zf(e,t,n,r){this.g=e,this.i=t,this.h=n,this.l=r,this.j=["offline:",e,"/",t,"/",n,"/",r].join("")}function eh(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 r=e[3];return r&&null!=t?new Zf(t,n,r,Number(e[4])):null}function th(e,t){this.h=e,this.g=t}function nh(e,t){var n=new Zo(null,0);n.Ja(t.duration);var r=t.streams.filter((function(e){return"audio"==e.type})),i=t.streams.filter((function(e){return"video"==e.type}));r=function(e,t,n,r){for(var i=new Set,o=c(t),a=o.next();!a.done;a=o.next()){var s=c(a.value.variantIds);for(a=s.next();!a.done;a=s.next())i.add(a.value)}for(o=c(n),a=o.next();!a.done;a=o.next())for(a=(s=c(a.value.variantIds)).next();!a.done;a=s.next())i.add(a.value);for(o=new Map,i=c(i),a=i.next();!a.done;a=i.next())a=a.value,o.set(a,{id:a,language:"",primary:!1,audio:null,video:null,bandwidth:0,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});for(t=c(t),i=t.next();!i.done;i=t.next())for(a=rh(e,i=i.value,r),i=(s=c(i.variantIds)).next();!i.done;i=s.next())(i=o.get(i.value)).language=a.language,i.primary=i.primary||a.primary,i.audio=a;for(n=c(n),t=n.next();!t.done;t=n.next())for(t=rh(e,i=t.value,r),i=(a=c(i.variantIds)).next();!i.done;i=a.next())(i=o.get(i.value)).primary=i.primary||t.primary,i.video=t;return o}(e,r,i,n),i=t.streams.filter((function(e){return e.type==dt})).map((function(t){return rh(e,t,n)}));var o=t.streams.filter((function(e){return"image"==e.type})).map((function(t){return rh(e,t,n)})),a=t.drmInfo?[t.drmInfo]:[];if(t.drmInfo)for(var s=c(r.values()),u=s.next();!u.done;u=s.next())(u=u.value).audio&&u.audio.encrypted&&(u.audio.drmInfos=a),u.video&&u.video.encrypted&&(u.video.drmInfos=a);return{presentationTimeline:n,minBufferTime:2,offlineSessionIds:t.sessionIds,variants:Array.from(r.values()),textStreams:i,imageStreams:o}}function rh(e,t,n){var r=t.segments.map((function(t){return function(e,t){var n=new Zf("segment",e.h,e.g,t.dataKey);return new Qo(t.startTime,t.endTime,(function(){return[n.toString()]}),0,null,null!=t.initSegmentKey?function(e,t){var n=new Zf("segment",e.h,e.g,t);return new Jo((function(){return[n.toString()]}),0,null)}(e,t.initSegmentKey):null,t.timestampOffset,t.appendWindowStart,t.appendWindowEnd,[],t.tilesLayout||"")}(e,t)}));return n.Bb(r),{id:t.id,originalId:t.originalId,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new ba(r),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,kind:t.kind,encrypted:t.encrypted,drmInfos:[],keyIds:t.keyIds,language:t.language,label:t.label,type:t.type,primary:t.primary,trickModeVideo:null,emsgSchemeIdUris:null,roles:t.roles,forced:t.forced,channelsCount:t.channelsCount,audioSamplingRate:t.audioSamplingRate,spatialAudio:t.spatialAudio,closedCaptions:t.closedCaptions,tilesLayout:t.tilesLayout}}function ih(){this.g=null}function oh(){}function ah(e){var t=eh(e);return t&&"manifest"==t.g?e=rr(e={uri:e,le:e,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}}):e=t&&"segment"==t.g?function(e,t){var n=new Hf;return rr(void 0).ba((function(){return n.init()})).ba((function(){return Kf(n,t.Ia(),t.la())})).ba((function(e){return e.getSegments([t.key()])})).ba((function(e){return{uri:t,data:e[0].data,headers:{}}})).finally((function(){return n.destroy()}))}(t.key(),t):tr(new ze(2,1,9004,e)),e}function sh(e,t,n){var r,i,o,a,s,u;return L((function(l){switch(l.g){case 1:r=[];for(var d=[],f=c(n),h=f.next();!h.done;h=f.next()){h=h.value;for(var p=!1,g=c(d),m=g.next();!m.done;m=g.next())if(uh((m=m.value).info,h)){m.sessionIds.push(h.sessionId),p=!0;break}p||d.push({info:h,sessionIds:[h.sessionId]})}i=c(d),o=i.next();case 2:if(o.done){l.v(4);break}return a=o.value,s=function(e,t,n){var r,i;return L((function(o){switch(o.g){case 1:return r=new Nr({lb:t,onError:function(){},Gc:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),S(o,2),r.configure(e),T(o,function(e,t,n,r,i,o){var a=new Map;return(i={audioCapabilities:i,videoCapabilities:o,distinctiveIdentifier:"optional",persistentState:"required",sessionTypes:["persistent-license"],label:t}).drmInfos=[{keySystem:t,licenseServerUri:n,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:r,serverCertificateUri:"",initData:null,keyIds:null}],a.set(t,i),Br(e,a,[])}(r,n.info.keySystem,n.info.licenseUri,n.info.serverCertificate,n.info.audioCapabilities,n.info.videoCapabilities),4);case 4:A(o,3);break;case 2:return k(o),T(o,r.destroy(),5);case 5:return o.return([]);case 3:return S(o,6),T(o,jr(r),8);case 8:A(o,7);break;case 6:return k(o),T(o,r.destroy(),9);case 9:return o.return([]);case 7:return i=[],T(o,Promise.all(n.sessionIds.map((function(e){return L((function(t){return 1==t.g?(S(t,2),T(t,function(e,t){var n,r,i;return L((function(o){return 1==o.g?T(o,Vr(e,t),2):3!=o.g?(n=o.h)?(r=[],(i=e.j.get(n))&&(i.Ka=new pt,r.push(i.Ka)),r.push(n.remove()),T(o,Promise.all(r),3)):o.return():(e.j.delete(n),void x(o))}))}(r,e),4)):2!=t.g?(i.push(e),A(t,0)):(k(t),void x(t))}))}))),10);case 10:return T(o,r.destroy(),11);case 11:return o.return(i)}}))}(e,t,a),T(l,s,5);case 5:u=l.h,r=r.concat(u),o=i.next(),l.v(2);break;case 4:return l.return(r)}}))}function uh(e,t){function n(e,t){return e.robustness==t.robustness&&e.contentType==t.contentType}return e.keySystem==t.keySystem&&e.licenseUri==t.licenseUri&&oe(e.audioCapabilities,t.audioCapabilities,n)&&oe(e.videoCapabilities,t.videoCapabilities,n)}function lh(e,t){var n=nh(new th(e.Ia(),e.la()),t),r=t.appMetadata||{};return n=ch(n),{offlineUri:e.toString(),originalManifestUri:t.originalManifestUri,duration:t.duration,size:t.size,expiration:t.expiration,tracks:n,appMetadata:r}}function ch(e){for(var t=[],n=function(e){return e.filter((function(e){return Mn(e)}))}(e.variants),r=(n=c(n)).next();!r.done;r=n.next())t.push(xn(r.value));for(n=(e=c(e.textStreams)).next();!n.done;n=e.next())t.push(Sn(n.value));return t}function dh(){this.g={}}function fh(e,t){var n=e.g[t];return null==n&&(n=0),n}function hh(e){var t=this;if(e&&e.constructor!=bs)throw new ze(2,9,9008);this.O=this.o=null,e?(this.o=e.o,this.O=e.Ub()):(this.o=ds(),this.O=new fr),this.Lc=[],this.ac=[],this.Ed=[];var n=!e;this.I=new Tr((function(){var e,r,i,o,a;return L((function(s){switch(s.g){case 1:return T(s,Promise.all(t.Ed.map((function(e){return Df(e)}))),2);case 2:for(e=function(){},r=[],i=c(t.ac),o=i.next();!o.done;o=i.next())a=o.value,r.push(a.then(e,e));return T(s,Promise.all(r),3);case 3:if(!n){s.v(4);break}return T(s,t.O.destroy(),4);case 4:t.o=null,t.O=null,x(s)}}))}))}function ph(){if(tn())e:{for(var e=c(qf.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 gh(e,t){for(var n=[],r=c(e.streams),i=r.next();!i.done;i=r.next())i=i.value,t&&"video"==i.type?n.push({contentType:Lt(i.mimeType,i.codecs),robustness:e.drmInfo.videoRobustness}):t||"audio"!=i.type||n.push({contentType:Lt(i.mimeType,i.codecs),robustness:e.drmInfo.audioRobustness});return n}function mh(e,t,n){return L((function(r){return T(r,function(e,t,n,r){var i,o,a;return L((function(s){return 1==s.g?r.drmInfo?(i=function(e){var t=Array.from(e.g.keys());if(!t.length)throw new ze(2,9,9e3,"No supported storage mechanisms found");return e.g.get(t[0]).getEmeSessionCell()}(n),o=r.sessionIds.map((function(e){return{sessionId:e,keySystem:r.drmInfo.keySystem,licenseUri:r.drmInfo.licenseServerUri,serverCertificate:r.drmInfo.serverCertificate,audioCapabilities:gh(r,!1),videoCapabilities:gh(r,!0)}})),T(s,sh(t,e,o),2)):s.return():3!=s.g?(a=s.h,T(s,i.remove(a),3)):T(s,i.add(o.filter((function(e){return!a.includes(e.sessionId)}))),0)}))}(e.O,e.o.drm,n,t),0)}))}function vh(e,t,n){function r(){}var i=function(e){for(var t=[],n=(e=c(e.streams)).next();!n.done;n=e.next())for(var r=(n=c(n.value.segments)).next();!r.done;r=n.next())null!=(r=r.value).initSegmentKey&&t.push(r.initSegmentKey),t.push(r.dataKey);return t}(n);return lh(t,n),Promise.all([e.removeSegments(i,r),e.removeManifests([t.key()],r)])}function yh(e,t,n,r,i,o,a,s,u){var l={id:o.id,originalId:o.originalId,primary:o.primary,type:o.type,mimeType:o.mimeType,codecs:o.codecs,frameRate:o.frameRate,pixelAspectRatio:o.pixelAspectRatio,hdr:o.hdr,kind:o.kind,language:o.language,label:o.label,width:o.width||null,height:o.height||null,encrypted:o.encrypted,keyIds:o.keyIds,segments:[],variantIds:[],roles:o.roles,forced:o.forced,channelsCount:o.channelsCount,audioSamplingRate:o.audioSamplingRate,spatialAudio:o.spatialAudio,closedCaptions:o.closedCaptions,tilesLayout:o.tilesLayout},c=o.id;return function(e,t,n){if(null!=(t=e.segmentIndex.find(t)))for(var r=e.segmentIndex.get(t);r;)n(r),r=e.segmentIndex.get(++t)}(o,i.presentationTimeline.Za(),(function(i){var d=function(e,t,n,r,i,o,a,s,u){return u.has(a)?u.get(a):(s=Na(a.ma(),a.ja,a.ea,s.streaming.retryParameters),t=Rf(t,n,s,.5*fh(o,r),!0,(function(t){var n;return L((function(r){return 1==r.g?T(r,i.addSegments([{data:t}]),2):(n=r.h,e.Lc.push(n[0]),r.return(n[0]))}))})),u.set(a,t),t)}(e,t,c,o.id,n,r,i.h,a,s),f=function(e,t,n,r,i,o,a,s,u){var l=[a.ma()[0],a.ja,a.ea].join("-");return u.has(l)?u.get(l):(s=Na(a.ma(),a.ja,a.ea,s.streaming.retryParameters),t=Rf(t,n,s,function(e,t,n){return n=n.endTime-n.startTime,fh(e,t)*n}(o,r,a),!1,(function(t){var n;return L((function(r){return 1==r.g?T(r,i.addSegments([{data:t}]),2):(n=r.h,e.Lc.push(n[0]),r.return(n[0]))}))})),u.set(l,t),t)}(e,t,c,o.id,n,r,i,a,u);!function(e,t,n){xr(e.I);var r=(e.g.get(t)||Promise.resolve()).then((function(){return L((function(e){return T(e,n(),0)}))}));e.g.set(t,r)}(t,c,(function(){var e,t;return L((function(n){return 1==n.g?T(n,d,2):3!=n.g?(e=n.h,T(n,f,3)):(t=n.h,l.segments.push({initSegmentKey:e,startTime:i.startTime,endTime:i.endTime,appendWindowStart:i.appendWindowStart,appendWindowEnd:i.appendWindowEnd,timestampOffset:i.timestampOffset,tilesLayout:i.tilesLayout,dataKey:t}),void x(n))}))}))})),l}function bh(e){if(e.I.g)throw new ze(2,9,7001)}function wh(){if(!ph())throw new ze(2,9,9e3)}function Th(e,t){return L((function(n){return 1==n.g?(e.ac.push(t),E(n),T(n,t,4)):2!=n.g?n.return(n.h):(I(n),ie(e.ac,t),C(n,0))}))}function xh(e){for(var t=new Set,n=c(e.textStreams),r=n.next();!r.done;r=n.next())t.add(r.value);for(r=(n=c(e.imageStreams)).next();!r.done;r=n.next())t.add(r.value);for(n=(e=c(e.variants)).next();!n.done;n=e.next())(n=n.value).audio&&t.add(n.audio),n.video&&t.add(n.video);return t}v(zf,Of),zf.prototype.updateManifestExpiration=function(e,t){var n,r,i,o=this;return L((function(a){return n=jf(o.g,o.h),r=n.store(),i=new pt,r.get(e).onsuccess=function(n){(n=n.target.result)?(n.expiration=t,r.put(n),i.resolve()):i.reject(new ze(2,9,9012,"Could not find values for "+e))},T(a,Promise.all([n.promise(),i]),0)}))},zf.prototype.Rb=function(e){var t,n,r,i,o,a;return L((function(s){if(1==s.g){for(t=[],n=0;n<e.periods.length;++n)r=n==e.periods.length-1?e.duration:e.periods[n+1].startTime,i=r-e.periods[n].startTime,o=Xf(e.periods[n],i),t.push(o);return T(s,qc(t),2)}return a=s.h,s.return({creationTime:0,originalManifestUri:e.originalManifestUri,duration:e.duration,size:e.size,expiration:null==e.expiration?1/0:e.expiration,streams:a,sessionIds:e.sessionIds,drmInfo:e.drmInfo,appMetadata:e.appMetadata})}))},zf.prototype.Vd=function(e){return{data:e.data}},v(Yf,Of),Yf.prototype.Rb=function(e){var t,n,r,i,o,a;return L((function(s){if(1==s.g){for(t=[],n=0;n<e.periods.length;++n){r=n==e.periods.length-1?e.duration:e.periods[n+1].startTime,i=r-e.periods[n].startTime;for(var u=e.periods[n],l=[],d=c(u.streams),f=d.next();!f.done;f=d.next())0!=(f=f.value).variantIds.length&&l.push($f(f,u.startTime,u.startTime+i));o=l,t.push(o)}return T(s,qc(t),2)}return a=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:a})}))},v(Jf,Of),Jf.prototype.hasFixedKeySpace=function(){return!1},Jf.prototype.addSegments=function(e){return this.add(this.i,e)},Jf.prototype.addManifests=function(e){return this.add(this.h,e)},Jf.prototype.Rb=function(e){return null==e.expiration&&(e.expiration=1/0),Promise.resolve(e)},(i=Qf.prototype).init=function(){var t=this,n=new pt,r=e.indexedDB.open("shaka_offline_db",5);return r.onsuccess=function(){var e=r.result;t.l=e;var i=e.objectStoreNames;i=i.contains("manifest")&&i.contains("segment")?new zf(e,"segment","manifest"):null,t.g=i,i=(i=e.objectStoreNames).contains("manifest-v2")&&i.contains("segment-v2")?new Yf(e,"segment-v2","manifest-v2"):null,t.h=i,i=(i=e.objectStoreNames).contains("manifest-v3")&&i.contains("segment-v3")?new Yf(e,"segment-v3","manifest-v3"):null,t.i=i,i=(i=e.objectStoreNames).contains("manifest-v5")&&i.contains("segment-v5")?new Jf(e,"segment-v5","manifest-v5"):null,t.j=i,e=e.objectStoreNames.contains("session-ids")?new Vf(e):null,t.m=e,n.resolve()},r.onupgradeneeded=function(){for(var e=r.result,t=c(["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})},r.onerror=function(e){n.reject(new ze(2,9,9001,r.error)),e.preventDefault()},n},i.destroy=function(){var e=this;return L((function(t){switch(t.g){case 1:if(!e.g){t.v(2);break}return T(t,e.g.destroy(),2);case 2:if(!e.h){t.v(4);break}return T(t,e.h.destroy(),4);case 4:if(!e.i){t.v(6);break}return T(t,e.i.destroy(),6);case 6:if(!e.j){t.v(8);break}return T(t,e.j.destroy(),8);case 8:if(!e.m){t.v(10);break}return T(t,e.m.destroy(),10);case 10:e.l&&e.l.close(),x(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 L((function(n){switch(n.g){case 1:if(!t.g){n.v(2);break}return T(n,t.g.destroy(),2);case 2:if(!t.h){n.v(4);break}return T(n,t.h.destroy(),4);case 4:if(!t.i){n.v(6);break}return T(n,t.i.destroy(),6);case 6:if(!t.j){n.v(8);break}return T(n,t.j.destroy(),8);case 8:return t.l&&t.l.close(),T(n,function(){var t=new pt,n=e.indexedDB.deleteDatabase("shaka_offline_db");return n.onblocked=function(){},n.onsuccess=function(){t.resolve()},n.onerror=function(e){t.reject(new ze(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,T(n,t.init(),0)}}))},Gf("idb",(function(){return on()||!e.indexedDB?null:new Qf})),Zf.prototype.Ia=function(){return this.i},Zf.prototype.la=function(){return this.h},Zf.prototype.key=function(){return this.l},Zf.prototype.toString=function(){return this.j},(i=ih.prototype).configure=function(){},i.start=function(e,t){var n,r,i,o,a,s,u=this;return L((function(l){switch(l.g){case 1:if(n=eh(e),u.g=n,null==n||"manifest"!=n.g)throw new ze(2,1,9004,e);return r=new Hf,E(l),T(l,r.init(),4);case 4:return T(l,Kf(r,n.Ia(),n.la()),5);case 5:return T(l,l.h.getManifests([n.key()]),6);case 6:return i=l.h,o=i[0],a=new th(n.Ia(),n.la()),s=nh(a,o),t.makeTextStreamsForClosedCaptions(s),l.return(s);case 2:return I(l),T(l,r.destroy(),7);case 7:C(l,0)}}))},i.stop=function(){return Promise.resolve()},i.update=function(){},i.onExpirationUpdated=function(e,t){var n,r,i,o,a,s,u,l=this;return L((function(c){switch(c.g){case 1:return n=l.g,r=new Hf,S(c,2,3),T(c,r.init(),5);case 5:return T(c,Kf(r,n.Ia(),n.la()),6);case 6:return T(c,(i=c.h).getManifests([n.key()]),7);case 7:if(o=c.h,a=o[0],s=a.sessionIds.includes(e),u=void 0==a.expiration||a.expiration>t,!s||!u){c.v(3);break}return T(c,i.updateManifestExpiration(n.key(),t),3);case 3:return I(c),T(c,r.destroy(),10);case 10:C(c,0);break;case 2:k(c),c.v(3)}}))},oi["application/x-offline-manifest"]=function(){return new ih},V("shaka.offline.OfflineScheme",oh),oh.plugin=ah,hr("offline",ah),(i=hh.prototype).destroy=function(){return this.I.destroy()},i.configure=function(e,t){return 2==arguments.length&&"string"==typeof e&&(e=ls(e,t)),e.manifest&&e.manifest.dash&&"defaultPresentationDelay"in e.manifest.dash&&(je("manifest.dash.defaultPresentationDelay configuration","Please Use manifest.defaultPresentationDelay instead."),e.manifest.defaultPresentationDelay=e.manifest.dash.defaultPresentationDelay,delete e.manifest.dash.defaultPresentationDelay),fs(this.o,e)},i.getConfiguration=function(){var e=ds();return fs(e,this.o,ds()),e},i.Ub=function(){return this.O},i.store=function(e,t,n){var r=this,i=this.getConfiguration(),o=new Mf(this.O);this.Ed.push(o);var a=new er(t=function(e,t,n,r,i,o){var a,s,u,l,d,f,h,p,g,m;return L((function(v){switch(v.g){case 1:return wh(),s=a=null,u=new Hf,d=l=null,S(v,2,3),T(v,r(),5);case 5:return a=v.h,T(v,function(e,t,n,r){var i,o,a,s,u;return L((function(l){if(1==l.g)return i=null,o=e.O,a={networkingEngine:o,filter:function(){return Promise.resolve()},makeTextStreamsForClosedCaptions:function(){},onTimelineRegionAdded:function(){},onEvent:function(){},onError:function(e){i=e},isLowLatencyMode:function(){return!1},isAutoLowLatencyMode:function(){return!1},enableLowLatencyMode:function(){}},n.configure(r.manifest),bh(e),T(l,n.start(t,a),2);if(3!=l.g)return s=l.h,bh(e),u=xh(s),T(l,Promise.all(ee(u,(function(e){return e.createSegmentIndex()}))),3);if(bh(e),i)throw i;return l.return(s)}))}(e,t,a,i),6);case 6:if(f=v.h,bh(e),!(!f.presentationTimeline.X()&&!f.presentationTimeline.kb()))throw new ze(2,9,9005,t);return T(v,function(e,t,n,r){var i;return L((function(o){switch(o.g){case 1:return(i=new Nr({lb:e.O,onError:n,Gc:function(){},onExpirationUpdated:function(){},onEvent:function(){}})).configure(r.drm),T(o,function(e,t,n){return e.qa=!0,e.u=[],e.J=n,Lr(e,t)}(i,t.variants,r.offline.usePersistentLicense),2);case 2:return T(o,jr(i),3);case 3:return T(o,_r(i),4);case 4:return o.return(i)}}))}(e,f,(function(e){d=d||e}),i),7);case 7:if(s=v.h,bh(e),d)throw d;return T(v,function(e,t){var n,r,i,o,a,s,u,l,d,f,h,p,g,m,v,y,b,w,E,I,C,M,D,R,N,P,j,_;return L((function(L){switch(L.g){case 1:for(n={width:1/0,height:1/0},function(e,t,n){e.variants=e.variants.filter((function(e){return gn(e,t,n)}))}(e,t.restrictions,n),vn(e,t.offline.usePersistentLicense),r=[],i=t.preferredAudioChannelCount,o=t.preferredDecodingAttributes,a=t.preferredVideoCodecs,s=t.preferredAudioCodecs,fn(e,a,s,i,o),u=c(e.variants),l=u.next();!l.done;l=u.next())d=l.value,r.push(xn(d));for(f=c(e.textStreams),h=f.next();!h.done;h=f.next())p=h.value,r.push(Sn(p));for(g=c(e.imageStreams),m=g.next();!m.done;m=g.next())v=m.value,r.push(En(v));return T(L,t.offline.trackSelectionCallback(r),2);case 2:for(y=L.h,b=e.presentationTimeline.getDuration(),w=0,E=c(y),I=E.next();!I.done;I=E.next())C=I.value,M=C.bandwidth*b/8,w+=M;return S(L,3),T(L,t.offline.downloadSizeCallback(w),5);case 5:if(!L.h)throw new ze(2,9,9014);A(L,4);break;case 3:if((D=k(L))instanceof ze)throw D;throw new ze(2,9,9015);case 4:for(R=new Set,N=new Set,P=new Set,j=c(y),I=j.next();!I.done;I=j.next())"variant"==(_=I.value).type&&R.add(_.id),"text"==_.type&&N.add(_.id),"image"==_.type&&P.add(_.id);e.variants=e.variants.filter((function(e){return R.has(e.id)})),e.textStreams=e.textStreams.filter((function(e){return N.has(e.id)})),e.imageStreams=e.imageStreams.filter((function(e){return P.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=c(t),r=n.next();!r.done;r=n.next())for(var i=(r=c(t)).next();!i.done;i=r.next());for(t=c(e),n=t.next();!n.done;n=t.next())for(r=(n=c(e)).next();!r.done;r=n.next());}(e),x(L)}}))}(f,i),8);case 8:return T(v,u.init(),9);case 9:return bh(e),T(v,function(e){var t=null;if(e.g.forEach((function(e,n){e.getCells().forEach((function(e,r){e.hasFixedKeySpace()||t||(t={path:{Ia:n,la:r},la:e})}))})),t)return t;throw new ze(2,9,9013,"Could not find a cell that supports add-operations")}(u),10);case 10:return l=v.h,bh(e),T(v,function(e,t,n,r,i,o,a,s){var u,l,d,f,h,p,g,m,v,y;return L((function(b){switch(b.g){case 1:return u=function(e,t,n){return{offlineUri:null,originalManifestUri:e,duration:t.presentationTimeline.getDuration(),size:0,expiration:1/0,tracks:t=ch(t),appMetadata:n}}(i,r,o),l=a.offline.progressCallback,function(e,t,n){e.ie=t,e.he=n}(s,(function(e,t){u.size=t,l(u,e)}),(function(e,t){h&&a.offline.usePersistentLicense&&p==t&&Or(n,"cenc",e)})),d=r.variants.some((function(e){var t=e.audio&&e.audio.encrypted;return e.video&&e.video.encrypted||t})),f=r.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}))})),p=null,(h=d&&!f)&&(g=n.i,p=Sh.get(g.keySystem)),E(b),v=m=function(e,t,n,r,i,o,a,s){for(var u=new dh,l=c(i.variants),d=l.next();!d.done;d=l.next()){var f=u,h=(d=d.value).audio,p=d.video;if(h&&!p&&(f.g[h.id]=h.bandwidth||d.bandwidth),!h&&p&&(f.g[p.id]=p.bandwidth||d.bandwidth),h&&p){var g=h.bandwidth||393216,m=p.bandwidth||d.bandwidth-g;0>=m&&(m=d.bandwidth),f.g[h.id]=g,f.g[p.id]=m}}for(l=c(i.textStreams),f=l.next();!f.done;f=l.next())u.g[f.value.id]=52;for(l=c(i.imageStreams),f=l.next();!f.done;f=l.next())f=f.value,u.g[f.id]=f.bandwidth||2048;for((f=new Map).set(null,Promise.resolve(null)),d=new Map,h=xh(i),l=new Map,h=c(h),p=h.next();!p.done;p=h.next())g=yh(e,t,n,u,i,p=p.value,s,f,d),l.set(p.id,g);for(e=c(i.variants),d=e.next();!d.done;d=e.next())(t=d.value).audio&&l.get(t.audio.id).variantIds.push(t.id),t.video&&l.get(t.video.id).variantIds.push(t.id);return e=Array.from(l.values()),s=s.offline.usePersistentLicense,(t=r.i)&&s&&(t.initData=[]),{creationTime:Date.now(),originalManifestUri:o,duration:i.presentationTimeline.getDuration(),size:0,expiration:r.Tb(),streams:e,sessionIds:s?Fr(r):[],drmInfo:t,appMetadata:a}}(e,s,t,n,r,i,o,a),T(b,function(e){return L((function(t){return 1==t.g?T(t,Promise.all(e.g.values()),2):t.return(e.Ob.h)}))}(s),4);case 4:if(v.size=b.h,m.expiration=n.Tb(),y=Fr(n),m.sessionIds=a.offline.usePersistentLicense?y:[],d&&a.offline.usePersistentLicense&&!y.length)throw new ze(2,9,9007);return b.return(m);case 2:return I(b),T(b,s.destroy(),5);case 5:C(b,0)}}))}(e,l.la,s,f,t,n,i,o),11);case 11:if(h=v.h,bh(e),d)throw d;return T(v,l.la.addManifests([h]),12);case 12:return p=v.h,bh(e),g=new Zf("manifest",l.path.Ia,l.path.la,p[0]),v.return(lh(g,h));case 3:return I(v),e.Lc=[],T(v,u.destroy(),13);case 13:if(!a){v.v(14);break}return T(v,a.stop(),14);case 14:if(!s){v.v(16);break}return T(v,s.destroy(),16);case 16:C(v,0);break;case 2:if(m=k(v),!l){v.v(18);break}return T(v,l.la.removeSegments(e.Lc,(function(){})),18);case 18:throw d||m}}))}(this,e,t||{},(function(){var t;return L((function(o){return 1==o.g?T(o,ni(e,r.O,i.manifest.retryParameters,n||null),2):(t=o.h,o.return(He(t)))}))}),i,o),(function(){return Df(o)}));return a.finally((function(){ie(r.Ed,o)})),a.then=function(e){return je("shaka.offline.Storage.store.then","Storage operations now return a shaka.util.AbortableOperation, rather than a promise. Please update to conform to this new API; you can use the |chain| method instead."),a.promise.then(e)},function(e,t){var n=t.promise;return e.ac.push(n),t.finally((function(){ie(e.ac,n)}))}(this,a)},i.kf=function(){return je("shaka.offline.Storage.getStoreInProgress","Multiple concurrent downloads are now supported."),!1},i.remove=function(e){return Th(this,function(e,t){var n,r,i,o,a,s;return L((function(u){switch(u.g){case 1:if(wh(),null==(n=eh(t))||"manifest"!=n.g)throw new ze(2,9,9004,t);return r=n,i=new Hf,E(u),T(u,i.init(),4);case 4:return T(u,Kf(i,r.Ia(),r.la()),5);case 5:return T(u,(o=u.h).getManifests([r.key()]),6);case 6:return a=u.h,s=a[0],T(u,Promise.all([mh(e,s,i),vh(o,r,s)]),2);case 2:return I(u),T(u,i.destroy(),8);case 8:C(u,0)}}))}(this,e))},i.Kf=function(){return Th(this,function(e){var t,n,r,i,o,a,s,u,l,d;return L((function(f){switch(f.g){case 1:return wh(),t=e.O,n=e.o.drm,r=new Hf,i=!1,E(f),T(f,r.init(),4);case 4:o=[],function(e,t){e.g.forEach((function(e){t(e.getEmeSessionCell())}))}(r,(function(e){return o.push(e)})),a=c(o),s=a.next();case 5:if(s.done){f.v(2);break}return T(f,(u=s.value).getAll(),8);case 8:return l=f.h,T(f,sh(n,t,l),9);case 9:return d=f.h,T(f,u.remove(d),10);case 10:d.length!=l.length&&(i=!0),s=a.next(),f.v(5);break;case 2:return I(f),T(f,r.destroy(),11);case 11:C(f,3);break;case 3:return f.return(!i)}}))}(this))},i.list=function(){return Th(this,function(){var e,t,n;return L((function(r){switch(r.g){case 1:return wh(),e=[],t=new Hf,E(r),T(r,t.init(),4);case 4:return n=Promise.resolve(),function(e,t){e.g.forEach((function(e,n){e.getCells().forEach((function(e,r){t({Ia:n,la:r},e)}))}))}(t,(function(t,r){n=n.then((function(){return L((function(n){if(1==n.g)return T(n,r.getAllManifests(),2);n.h.forEach((function(n,r){var i=lh(new Zf("manifest",t.Ia,t.la,r),n);e.push(i)})),x(n)}))}))})),T(r,n,2);case 2:return I(r),T(r,t.destroy(),6);case 6:C(r,3);break;case 3:return r.return(e)}}))}())},V("shaka.offline.Storage",hh),hh.deleteAll=function(){var e;return L((function(t){return 1==t.g?(e=new Hf,E(t),T(t,function(e){var t,n;return L((function(r){return 1==r.g?(t=Array.from(e.g.values()),(n=0<t.length)||qf.forEach((function(e){(e=e())&&t.push(e)})),T(r,Promise.all(t.map((function(e){return e.erase()}))),2)):n?r.v(0):T(r,Promise.all(t.map((function(e){return e.destroy()}))),0)}))}(e),2)):5!=t.g?(I(t),T(t,e.destroy(),5)):C(t,0)}))},hh.prototype.list=hh.prototype.list,hh.prototype.removeEmeSessions=hh.prototype.Kf,hh.prototype.remove=hh.prototype.remove,hh.prototype.getStoreInProgress=hh.prototype.kf,hh.prototype.store=hh.prototype.store,hh.prototype.getNetworkingEngine=hh.prototype.Ub,hh.prototype.getConfiguration=hh.prototype.getConfiguration,hh.prototype.configure=hh.prototype.configure,hh.prototype.destroy=hh.prototype.destroy,hh.support=ph;var Sh=(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.adobe.primetime","f239e769efa348509c16a903c6932efb");function Eh(){}function Ah(e,t){for(var n={priority:t||0,Ge:e},r=c(ne(kh)),i=r.next();!i.done;i=r.next()){var o=(i=i.value).ha;if(i.item.priority<n.priority)return void kh.splice(o,0,n)}kh.push(n)}Vu.offline=ph,V("shaka.polyfill",Eh),Eh.register=Ah,Eh.installAll=function(){for(var e=c(kh),t=e.next();!t.done;t=e.next()){t=t.value;try{t.Ge()}catch(n){W("Error installing polyfill!",n)}}};var kh=[];function Ih(){}function Ch(){if(!Object.getOwnPropertyDescriptor(Element.prototype,"ariaHidden"))for(var e=c(["ariaHidden","ariaLabel","ariaPressed","ariaSelected"]),t=e.next();!t.done;t=e.next())Mh(t.value)}function Mh(e){var t="aria-"+e.toLowerCase().replace(/^aria/,"");Object.defineProperty(Element.prototype,e,{get:function(){return this.getAttribute(t)},set:function(e){null==e||void 0==e?this.removeAttribute(t):this.setAttribute(t,e)}})}function Dh(){}function Rh(){fm()}function Nh(){}function Ph(){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",Lh),document.addEventListener("webkitfullscreenerror",Lh),document.addEventListener("mozfullscreenchange",Lh),document.addEventListener("mozfullscreenerror",Lh),document.addEventListener("MSFullscreenChange",Lh),document.addEventListener("MSFullscreenError",Lh)}}function Lh(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 jh(){}function _h(){}function Oh(){}function Uh(){(on()||an()||!navigator.mediaCapabilities)&&(navigator.mediaCapabilities||(navigator.mediaCapabilities={}),navigator.mediaCapabilities.decodingInfo=Fh),e.shakaMediaCapabilities=navigator.mediaCapabilities}function Fh(e){var t,n,r,i,o,a,s,u,l,c,d,f;return L((function(h){switch(h.g){case 1:if(t={supported:!1,powerEfficient:!0,smooth:!0,keySystemAccess:null,configuration:e},!e)return h.return(t);if("media-source"==e.type){if(!tn()||e.video&&(n=e.video.contentType,!MediaSource.isTypeSupported(n))||e.audio&&(r=e.audio.contentType,!MediaSource.isTypeSupported(r)))return h.return(t)}else{if("file"!=e.type)return h.return(t);if(e.video&&(i=e.video.contentType,!nn(i))||e.audio&&(o=e.audio.contentType,!nn(o)))return h.return(t)}return e.keySystemConfiguration?(a=e.keySystemConfiguration,s=[],u=[],a.audio&&(l={robustness:a.audio.robustness||"",contentType:e.audio.contentType},s.push(l)),a.video&&(c={robustness:a.video.robustness||"",contentType:e.video.contentType},u.push(c)),d={initDataTypes:[a.initDataType],distinctiveIdentifier:a.distinctiveIdentifier,persistentState:a.persistentState,sessionTypes:a.sessionTypes},s.length&&(d.audioCapabilities=s),u.length&&(d.videoCapabilities=u),S(h,3),T(h,navigator.requestMediaKeySystemAccess(a.keySystem,[d]),5)):(t.supported=!0,h.return(Promise.resolve(t)));case 5:f=h.h,A(h,4);break;case 3:k(h);case 4:f&&(t.supported=!0,t.keySystemAccess=f);case 2:return h.return(t)}}))}function Bh(){}function Vh(){var t=sn();e.MediaSource&&(e.cast&&cast.__platform__&&cast.__platform__.canDisplayType?function(){var e=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(t){var n=t.split(/ *; */);return n.shift(),n.some((function(e){return e.startsWith("codecs=")}))?cast.__platform__.canDisplayType(t):e(t)}}():t?(function(){var e=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(t){return"mp2t"!=t.split(/ *; */)[0].split("/")[1].toLowerCase()&&e(t)}}(),12>=t?(Hh(),function(){var e=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(t,n){return e.call(this,t,n-.001)}}()):Hh()):(un("Tizen 2")||un("Tizen 3")||un("Tizen 4"))&&function(){var e=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(t){return"opus"!=_t(t)&&e(t)}}()),e.MediaSource&&MediaSource.isTypeSupported('video/webm; codecs="vp9"')&&!MediaSource.isTypeSupported('video/webm; codecs="vp09.00.10.08"')&&function(){var e=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(t){var n=t.split(/ *; */),r=n.findIndex((function(e){return e.startsWith("codecs=")}));if(0>r)return e(t);var i=n[r].replace("codecs=","").replace(/"/g,"").split(/\s*,\s*/),o=i.findIndex((function(e){return e.startsWith("vp09")}));return 0<=o&&(i[o]="vp9",n[r]='codecs="'+i.join(",")+'"',t=n.join("; ")),e(t)}}()}function Hh(){var e=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(t){for(var n=[],r=0;r<arguments.length;++r)n[r]=arguments[r];return(n=e.apply(this,n)).abort=function(){},n}}function Kh(){}function Gh(){screen.orientation||void 0!=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 qh;screen.orientation=n,t(),e.addEventListener("orientationchange",(function(){t();var e=new ar("change",{});n.dispatchEvent(e)}))}()}function qh(){sr.call(this),this.type="",this.angle=0}function zh(){}function Xh(){e.HTMLVideoElement&&e.WebKitMediaKeys&&(delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Yh,e.MediaKeys=Qh,e.MediaKeySystemAccess=Jh,navigator.requestMediaKeySystemAccess=Wh)}function Wh(e,t){try{var n=new Jh(e,t);return Promise.resolve(n)}catch(r){return Promise.reject(r)}}function Yh(e){var t=this.mediaKeys;return t&&t!=e&&Zh(t,null),delete this.mediaKeys,(this.mediaKeys=e)?Zh(e,this):Promise.resolve()}function $h(e){if(Ne(e=Re(e.initData)).getUint32(0,!0)+4!=e.byteLength)throw new RangeError("Malformed FairPlay init data");e=wt(e=yt(e.subarray(4),!0));var t=new Event("encrypted");t.initDataType="skd",t.initData=De(e),this.dispatchEvent(t)}function Jh(e,t){if(this.keySystem=e,e.startsWith("com.apple.fps"))for(var n=c(t),r=n.next();!r.done;r=n.next()){var i=r.value;if("required"==i.persistentState)r=null;else{r={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:i.initDataTypes,sessionTypes:["temporary"],label:i.label};var o=!1,a=!1;if(i.audioCapabilities)for(var s=c(i.audioCapabilities),u=s.next();!u.done;u=s.next())(u=u.value).contentType&&(o=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,u.contentType.split(";")[0])&&(r.audioCapabilities.push(u),a=!0));if(i.videoCapabilities)for(u=(i=c(i.videoCapabilities)).next();!u.done;u=i.next())(s=u.value).contentType&&(o=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,s.contentType.split(";")[0])&&(r.videoCapabilities.push(s),a=!0));o||(a=WebKitMediaKeys.isTypeSupported(this.keySystem,"video/mp4")),r=a?r:null}if(r)return void(this.g=r)}throw(n=Error("Unsupported keySystem")).name="NotSupportedError",n.code=DOMException.NOT_SUPPORTED_ERR,n}function Qh(e){this.g=new WebKitMediaKeys(e),this.h=new Sr}function Zh(e,t){if(e.h.nb(),!t)return Promise.resolve();e.h.A(t,"webkitneedkey",$h);try{return oa(t,HTMLMediaElement.HAVE_METADATA,e.h,(function(){t.webkitSetMediaKeys(e.g)})),Promise.resolve()}catch(n){return Promise.reject(n)}}function ep(e){sr.call(this),this.j=null,this.l=e,this.i=this.g=null,this.h=new Sr,this.sessionId="",this.expiration=NaN,this.closed=new pt,this.keyStatuses=new np}function tp(e,t){var n=e.keyStatuses;n.size=void 0==t?0:1,n.g=t,n=new ar("keystatuseschange"),e.dispatchEvent(n)}function np(){this.size=0,this.g=void 0}function rp(){}function ip(){!e.HTMLVideoElement||!e.MSMediaKeys||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,e.MediaKeys=lp,e.MediaKeySystemAccess=sp,navigator.requestMediaKeySystemAccess=op,HTMLMediaElement.prototype.setMediaKeys=up)}function op(e,t){try{var n=new sp(e,t);return Promise.resolve(n)}catch(r){return Promise.reject(r)}}function ap(e){if(e.initData){var t=new CustomEvent("encrypted");t.initDataType="cenc",t.initData=De(function(e){if(!e)return e;var t=new Yl(e);if(1>=t.data.length)return e;e=[];for(var n={},r=(t=c(t.data)).next();!r.done;n={jc:n.jc},r=t.next())n.jc=r.value,e.some(function(e){return function(t){return Ce(t,e.jc)}}(n))||e.push(n.jc);return Mt.apply(St,d(e))}(e.initData)),this.dispatchEvent(t)}}function sp(e,t){this.keySystem=e;for(var n=!1,r=c(t),i=r.next();!i.done;i=r.next()){var o={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:(i=i.value).initDataTypes,sessionTypes:["temporary"],label:i.label},a=!1;if(i.audioCapabilities)for(var s=c(i.audioCapabilities),u=s.next();!u.done;u=s.next())(u=u.value).contentType&&(a=!0,MSMediaKeys.isTypeSupported(this.keySystem,u.contentType.split(";")[0])&&(o.audioCapabilities.push(u),n=!0));if(i.videoCapabilities)for(u=(s=c(i.videoCapabilities)).next();!u.done;u=s.next())(u=u.value).contentType&&(a=!0,MSMediaKeys.isTypeSupported(this.keySystem,u.contentType.split(";")[0])&&(o.videoCapabilities.push(u),n=!0));if(a||(n=MSMediaKeys.isTypeSupported(this.keySystem,"video/mp4")),"required"==i.persistentState&&(n=!1),n)return void(this.g=o)}throw(n=Error("Unsupported keySystem")).name="NotSupportedError",n.code=DOMException.NOT_SUPPORTED_ERR,n}function up(e){var t=this.mediaKeys;return t&&t!=e&&cp(t,null),delete this.mediaKeys,(this.mediaKeys=e)?cp(e,this):Promise.resolve()}function lp(e){this.g=new MSMediaKeys(e),this.h=new Sr}function cp(e,t){if(e.h.nb(),!t)return Promise.resolve();e.h.A(t,"msneedkey",ap);try{return oa(t,HTMLMediaElement.HAVE_METADATA,e.h,(function(){t.msSetMediaKeys(e.g)})),Promise.resolve()}catch(n){return Promise.reject(n)}}function dp(e){sr.call(this),this.j=null,this.l=e,this.i=this.g=null,this.h=new Sr,this.sessionId="",this.expiration=NaN,this.closed=new pt,this.keyStatuses=new hp}function fp(e,t){var n=e.keyStatuses;n.size=void 0==t?0:1,n.g=t,n=new ar("keystatuseschange"),e.dispatchEvent(n)}function hp(){this.size=0,this.g=void 0}function pp(){}function gp(){!e.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(navigator.requestMediaKeySystemAccess=mp,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=vp,e.MediaKeys=yp,e.MediaKeySystemAccess=bp)}function mp(){return Promise.reject(Error("The key system specified is not supported."))}function vp(e){return null==e?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}function yp(){throw new TypeError("Illegal constructor.")}function bp(){throw this.keySystem="",new TypeError("Illegal constructor.")}function wp(){}function Tp(){if(!(!e.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)Lp="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;navigator.requestMediaKeySystemAccess=Sp,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Ep,e.MediaKeys=kp,e.MediaKeySystemAccess=Ap}}function xp(e){return Lp?Lp+e.charAt(0).toUpperCase()+e.slice(1):e}function Sp(e,t){try{var n=new Ap(e,t);return Promise.resolve(n)}catch(r){return Promise.reject(r)}}function Ep(e){var t=this.mediaKeys;return t&&t!=e&&Ip(t,null),delete this.mediaKeys,(this.mediaKeys=e)&&Ip(e,this),Promise.resolve()}function Ap(e,t){this.g=this.keySystem=e;var n=!1;"org.w3.clearkey"==e&&(this.g="webkit-org.w3.clearkey",n=!1);var r=!1,i=document.getElementsByTagName("video");i=i.length?i[0]:document.createElement("video");for(var o=c(t),a=o.next();!a.done;a=o.next()){var s={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:(a=a.value).initDataTypes,sessionTypes:["temporary"],label:a.label},u=!1;if(a.audioCapabilities)for(var l=c(a.audioCapabilities),d=l.next();!d.done;d=l.next())(d=d.value).contentType&&(u=!0,i.canPlayType(d.contentType.split(";")[0],this.g)&&(s.audioCapabilities.push(d),r=!0));if(a.videoCapabilities)for(d=(l=c(a.videoCapabilities)).next();!d.done;d=l.next())(d=d.value).contentType&&(u=!0,i.canPlayType(d.contentType,this.g)&&(s.videoCapabilities.push(d),r=!0));if(u||(r=i.canPlayType("video/mp4",this.g)||i.canPlayType("video/webm",this.g)),"required"==a.persistentState&&(n?(s.persistentState="required",s.sessionTypes=["persistent-license"]):r=!1),r)return void(this.h=s)}throw n="Unsupported keySystem","org.w3.clearkey"!=e&&"com.widevine.alpha"!=e||(n="None of the requested configurations were supported."),(n=Error(n)).name="NotSupportedError",n.code=DOMException.NOT_SUPPORTED_ERR,n}function kp(e){this.l=e,this.g=null,this.h=new Sr,this.i=[],this.j=new Map}function Ip(e,t){e.g=t,e.h.nb();var n=Lp;t&&(e.h.A(t,n+"needkey",(function(t){var n=new CustomEvent("encrypted");n.initDataType="cenc",n.initData=De(t.initData),e.g.dispatchEvent(n)})),e.h.A(t,n+"keymessage",(function(t){var n=Cp(e,t.sessionId);n&&(t=new ar("message",{messageType:void 0==n.keyStatuses.g?"licenserequest":"licenserenewal",message:t.message}),n.h&&(n.h.resolve(),n.h=null),n.dispatchEvent(t))})),e.h.A(t,n+"keyadded",(function(t){(t=Cp(e,t.sessionId))&&(Np(t,"usable"),t.g&&t.g.resolve(),t.g=null)})),e.h.A(t,n+"keyerror",(function(t){var n=Cp(e,t.sessionId);n&&n.handleError(t)})))}function Cp(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 Mp(e,t,n){sr.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 pt,this.keyStatuses=new Pp}function Dp(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 r=Re(wt("LOAD_SESSION|"+n));else{var i=wt("PERSISTENT|");r=Mt(i,t)}else r=Re(t)}catch(a){return Promise.reject(a)}e.h=new pt;var o=xp("generateKeyRequest");try{e.j[o](e.i,r)}catch(a){if("InvalidStateError"!=a.name)return e.h=null,Promise.reject(a);new en((function(){try{e.j[o](e.i,r)}catch(t){e.h.reject(t),e.h=null}})).U(.01)}return e.h}function Rp(e,t,n){if(e.g)e.g.then((function(){return Rp(e,t,n)})).catch((function(){return Rp(e,t,n)}));else{if(e.g=t,"webkit-org.w3.clearkey"==e.i){var r=vt(n),i=JSON.parse(r);"oct"!=i.keys[0].kty&&(e.g.reject(Error("Response is not a valid JSON Web Key Set.")),e.g=null),r=kt(i.keys[0].k),i=kt(i.keys[0].kid)}else r=Re(n),i=null;var o=xp("addKey");try{e.j[o](e.i,r,i,e.sessionId)}catch(a){e.g.reject(a),e.g=null}}}function Np(e,t){var n=e.keyStatuses;n.size=void 0==t?0:1,n.g=t,n=new ar("keystatuseschange"),e.dispatchEvent(n)}function Pp(){this.size=0,this.g=void 0}Eh.Aria=Ih,Ih.install=Ch,Ah(Ch),Eh.EncryptionScheme=Dh,Dh.install=Rh,Ah(Rh,-2),Eh.Fullscreen=Nh,Nh.install=Ph,Ah(Ph),Eh.MathRound=jh,jh.install=_h,Ah(_h),Eh.MediaCapabilities=Oh,Oh.install=Uh,Ah(Uh,-1),Eh.MediaSource=Bh,Bh.install=Vh,Ah(Vh),Eh.Orientation=Kh,Kh.install=Gh,v(qh,sr),qh.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))},qh.prototype.unlock=function(){screen.unlockOrientation?screen.unlockOrientation():screen.mozUnlockOrientation?screen.mozUnlockOrientation():screen.msUnlockOrientation&&screen.msUnlockOrientation()},Ah(Gh),Eh.PatchedMediaKeysApple=zh,zh.install=Xh,Jh.prototype.createMediaKeys=function(){var e=new Qh(this.keySystem);return Promise.resolve(e)},Jh.prototype.getConfiguration=function(){return this.g},Qh.prototype.createSession=function(e){if("temporary"!=(e=e||"temporary"))throw new TypeError("Session type "+e+" is unsupported on this platform.");return new ep(this.g,e)},Qh.prototype.setServerCertificate=function(){return Promise.resolve(!1)},v(ep,sr),(i=ep.prototype).generateRequest=function(e,t){var n=this;this.g=new pt;try{var r=this.l.createSession("video/mp4",Re(t));this.j=r,this.sessionId=r.sessionId||"",this.h.A(this.j,"webkitkeymessage",(function(e){n.g&&(n.g.resolve(),n.g=null),e=new ar("message",{messageType:void 0==n.keyStatuses.g?"license-request":"license-renewal",message:De(e.message)}),n.dispatchEvent(e)})),this.h.A(r,"webkitkeyadded",(function(){n.i&&(tp(n,"usable"),n.i.resolve(),n.i=null)})),this.h.A(r,"webkitkeyerror",(function(){var e=Error("EME PatchedMediaKeysApple key error");if(e.errorCode=n.j.error,null!=n.g)n.g.reject(e),n.g=null;else if(null!=n.i)n.i.reject(e),n.i=null;else switch(n.j.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:tp(n,"output-not-allowed");break;default:tp(n,"internal-error")}})),tp(this,"status-pending")}catch(i){this.g.reject(i)}return this.g},i.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))},i.update=function(e){this.i=new pt;try{this.j.update(Re(e))}catch(t){this.i.reject(t)}return this.i},i.close=function(){try{this.j.close(),this.closed.resolve(),this.h.nb()}catch(hm){this.closed.reject(hm)}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=np.prototype).forEach=function(e){this.g&&e(this.g,ei.value())},i.get=function(e){if(this.has(e))return this.g},i.has=function(e){var t=ei.value();return!(!this.g||!Ce(e,t))},i.entries=function(){},i.keys=function(){},i.values=function(){},Ah(Xh),Eh.PatchedMediaKeysMs=rp,rp.install=ip,sp.prototype.createMediaKeys=function(){var e=new lp(this.keySystem);return Promise.resolve(e)},sp.prototype.getConfiguration=function(){return this.g},lp.prototype.createSession=function(e){if("temporary"!=(e=e||"temporary"))throw new TypeError("Session type "+e+" is unsupported on this platform.");return new dp(this.g,e)},lp.prototype.setServerCertificate=function(){return Promise.resolve(!1)},v(dp,sr),(i=dp.prototype).generateRequest=function(e,t){var n=this;this.g=new pt;try{this.j=this.l.createSession("video/mp4",Re(t),null),this.h.A(this.j,"mskeymessage",(function(e){n.g&&(n.g.resolve(),n.g=null),e=new ar("message",{messageType:void 0==n.keyStatuses.g?"license-request":"license-renewal",message:De(e.message)}),n.dispatchEvent(e)})),this.h.A(this.j,"mskeyadded",(function(){n.g?(fp(n,"usable"),n.g.resolve(),n.g=null):n.i&&(fp(n,"usable"),n.i.resolve(),n.i=null)})),this.h.A(this.j,"mskeyerror",(function(){var e=Error("EME PatchedMediaKeysMs key error");if(e.errorCode=n.j.error,null!=n.g)n.g.reject(e),n.g=null;else if(null!=n.i)n.i.reject(e),n.i=null;else switch(n.j.error.code){case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:fp(n,"output-not-allowed");break;default:fp(n,"internal-error")}})),fp(this,"status-pending")}catch(r){this.g.reject(r)}return this.g},i.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))},i.update=function(e){this.i=new pt;try{this.j.update(Re(e))}catch(t){this.i.reject(t)}return this.i},i.close=function(){try{this.j.close(),this.closed.resolve(),this.h.nb()}catch(hm){this.closed.reject(hm)}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=hp.prototype).forEach=function(e){this.g&&e(this.g,ei.value())},i.get=function(e){if(this.has(e))return this.g},i.has=function(e){var t=ei.value();return!(!this.g||!Ce(e,t))},i.entries=function(){},i.keys=function(){},i.values=function(){},Ah(ip),Eh.PatchedMediaKeysNop=pp,pp.install=gp,yp.prototype.createSession=function(){},yp.prototype.setServerCertificate=function(){},bp.prototype.getConfiguration=function(){},bp.prototype.createMediaKeys=function(){},Ah(gp,-10),Eh.PatchedMediaKeysWebkit=wp,wp.install=Tp,Ap.prototype.createMediaKeys=function(){var e=new kp(this.g);return Promise.resolve(e)},Ap.prototype.getConfiguration=function(){return this.h},kp.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.g||document.createElement("video");return t.src||(t.src="about:blank"),e=new Mp(t,this.l,e),this.i.push(e),e},kp.prototype.setServerCertificate=function(){return Promise.resolve(!1)},v(Mp,sr),(i=Mp.prototype).handleError=function(e){var t=Error("EME v0.1b key error"),n=e.errorCode;n.systemCode=e.systemCode,t.errorCode=n,!e.sessionId&&this.h?(45==e.systemCode&&(t.message="Unsupported session type."),this.h.reject(t),this.h=null):e.sessionId&&this.g?(this.g.reject(t),this.g=null):(t=e.systemCode,e.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?Np(this,"output-restricted"):Np(this,1==t?"expired":"internal-error"))},i.generateRequest=function(e,t){return Dp(this,t,null)},i.load=function(e){return"persistent-license"==this.l?Dp(this,null,e):Promise.reject(Error("Not a persistent session."))},i.update=function(e){var t=new pt;return Rp(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=xp("cancelKeyRequest");try{this.j[e](this.i,this.sessionId)}catch(t){}}return this.closed.resolve(),this.closed},i.remove=function(){return"persistent-license"!=this.l?Promise.reject(Error("Not a persistent session.")):this.close()},(i=Pp.prototype).forEach=function(e){this.g&&e(this.g,ei.value())},i.get=function(e){if(this.has(e))return this.g},i.has=function(e){var t=ei.value();return!(!this.g||!Ce(e,t))},i.entries=function(){},i.keys=function(){},i.values=function(){};var Lp="";function jp(){}function _p(){if(e.HTMLVideoElement){var t=HTMLVideoElement.prototype;t.requestPictureInPicture&&document.exitPictureInPicture||!t.webkitSupportsPresentationMode||(document.pictureInPictureEnabled=!0,document.pictureInPictureElement=null,t.requestPictureInPicture=Up,Object.defineProperty(t,"disablePictureInPicture",{get:Bp,set:Vp,enumerable:!0,configurable:!0}),document.exitPictureInPicture=Fp,document.addEventListener("webkitpresentationmodechanged",Op,!0))}}function Op(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 Up(){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 Fp(){var e=document.pictureInPictureElement;return e?(e.webkitSetPresentationMode("inline"),document.pictureInPictureElement=null,Promise.resolve()):Promise.reject(Error("No picture in picture element found"))}function Bp(){return!!this.hasAttribute("disablePictureInPicture")||!this.webkitSupportsPresentationMode("picture-in-picture")}function Vp(e){e?this.setAttribute("disablePictureInPicture",""):this.removeAttribute("disablePictureInPicture")}function Hp(){}function Kp(){navigator.storage&&navigator.storage.estimate||!navigator.webkitTemporaryStorage||!navigator.webkitTemporaryStorage.queryUsageAndQuota||("storage"in navigator||(navigator.storage={}),navigator.storage.estimate=Gp)}function Gp(){return new Promise((function(e,t){navigator.webkitTemporaryStorage.queryUsageAndQuota((function(t,n){e({usage:t,quota:n})}),t)}))}function qp(){}function zp(){if(e.HTMLMediaElement){var t=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var e=t.apply(this);return e&&e.catch((function(){})),e}}}function Xp(){}function Wp(){if(e.HTMLVideoElement){var t=HTMLVideoElement.prototype;!t.getVideoPlaybackQuality&&"webkitDroppedFrameCount"in t&&(t.getVideoPlaybackQuality=Yp)}}function Yp(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}function $p(){}function Jp(){if(!e.VTTCue&&e.TextTrackCue){var t=null,n=TextTrackCue.length;if(3==n)t=Qp;else if(6==n)t=Zp;else{try{var r=!!Qp(1,2,"")}catch(i){r=!1}r&&(t=Qp)}t&&(e.VTTCue=function(e,n,r){return t(e,n,r)})}}function Qp(t,n,r){return new e.TextTrackCue(t,n,r)}function Zp(t,n,r){return new e.TextTrackCue(t+"-"+n+"-"+r,t,n,r)}function eg(){}Ah(Tp),Eh.PiPWebkit=jp,jp.install=_p,Ah(_p),Eh.StorageEstimate=Hp,Hp.install=Kp,Ah(Kp),Eh.VideoPlayPromise=qp,qp.install=zp,Ah(zp),Eh.VideoPlaybackQuality=Xp,Xp.install=Wp,Ah(Wp),Eh.VTTCue=$p,$p.install=Jp,Ah(Jp),eg.prototype.parseInit=function(){},eg.prototype.parseMedia=function(e,t){for(var n=null,r=[],i=vt(e).split(/\r?\n/),o=(i=c(i)).next();!o.done;o=i.next())if((o=o.value)&&!/^\s+$/.test(o)&&(o=tg.exec(o))){var a=ng.exec(o[1]);o=new se(a=60*parseInt(a[1],10)+parseFloat(a[2].replace(",",".")),t.segmentEnd?t.segmentEnd:a+2,o[2]),n&&(n.endTime=a,r.push(n)),n=o}return n&&r.push(n),r},V("shaka.text.LrcTextParser",eg),eg.prototype.parseMedia=eg.prototype.parseMedia,eg.prototype.parseInit=eg.prototype.parseInit;var tg=/^\[(\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?)\](.*)/,ng=/^(\d+):(\d{1,2}(?:[.,]\d{1,3})?)$/;function rg(){}function ig(e,t,n,r,i,o,a,s,u,l){var d=e.parentNode;if(e.nodeType==Node.TEXT_NODE){var f=document.createElement("span");f.textContent=e.textContent,e=f}f="default"==(e.getAttribute("xml:space")||(s?"default":"preserve"));var h=Array.from(e.childNodes).every((function(e){return e.nodeType==Node.TEXT_NODE}));if(s=[],!h)for(var p=c(e.childNodes),g=p.next();!g.done;g=p.next())(g=ig(g.value,t,n,r,i,o,a,f,!0,l))&&s.push(g);p=/\S/.test(e.textContent);var m=e.hasAttribute("begin")||e.hasAttribute("end")||e.hasAttribute("dur");if(!(m||p||"br"==e.tagName||0!=s.length||u&&!f))return null;for(p=(g=fg(e,n)).start,g=g.end;d&&d.nodeType==Node.ELEMENT_NODE&&"tt"!=d.tagName;)p=(g=dg(d,n,p,g)).start,g=g.end,d=d.parentNode;if(null==p&&(p=0),p+=t,g=null==g?1/0:g+t,!m&&0<s.length)for(p=1/0,g=0,n=(t=c(s)).next();!n.done;n=t.next())n=n.value,p=Math.min(p,n.startTime),g=Math.max(g,n.endTime);if("br"==e.tagName)return(r=new se(p,g,"")).lineBreak=!0,r;if(t="",h&&(t=e.textContent,f&&(t=(t=t.trim()).replace(/\s+/g," "))),(f=new se(p,g,t)).nestedCues=s,l&&(f.cellResolution=l),(o=cg(e,"region",o,"")[0])&&o.getAttribute("xml:id")){var v=o.getAttribute("xml:id");f.region=a.filter((function(e){return e.id==v}))[0]}for(a=null,h=(l=c(Cg)).next();!h.done&&!(a=cg(e,"backgroundImage",r,"#",h.value)[0]);h=l.next());return function(e,t,n,r,i,o,a){"rtl"==ag(t,n,i,"direction",o=o||a)&&(e.direction="rtl"),"tb"==(a=ag(t,n,i,"writingMode",o))||"tblr"==a?e.writingMode="vertical-lr":"tbrl"==a?e.writingMode="vertical-rl":"rltb"==a||"rl"==a?e.direction="rtl":a&&(e.direction=pe),(a=ag(t,n,i,"textAlign",o))?(e.positionAlign=Ig[a],e.lineAlign=kg[a],e.textAlign=de[a.toUpperCase()]):e.textAlign="start",(a=ag(t,n,i,"displayAlign",o))&&(e.displayAlign=he[a.toUpperCase()]);(a=ag(t,n,i,"color",o))&&(e.color=a);(a=ag(t,n,i,"backgroundColor",o))&&(e.backgroundColor=a);(a=ag(t,n,i,"border",o))&&(e.border=a);(a=ag(t,n,i,"fontFamily",o))&&(e.fontFamily=a);(a=ag(t,n,i,"fontWeight",o))&&"bold"==a&&(e.fontWeight=700),a=ag(t,n,i,"wrapOption",o),e.wrapLine=!a||"noWrap"!=a,(a=ag(t,n,i,"lineHeight",o))&&a.match(yg)&&(e.lineHeight=a),(a=ag(t,n,i,"fontSize",o))&&(a.match(yg)||a.match(vg))&&(e.fontSize=a),(a=ag(t,n,i,"fontStyle",o))&&(e.fontStyle=Se[a.toUpperCase()]);if(r){a=r.getAttribute("imageType")||r.getAttribute("imagetype");var s=r.getAttribute("encoding");r=r.textContent.trim(),"PNG"==a&&"Base64"==s&&r&&(e.backgroundImage="data:image/png;base64,"+r)}(r=ag(t,n,i,"letterSpacing",o))&&r.match(yg)&&(e.letterSpacing=r),(r=ag(t,n,i,"linePadding",o))&&r.match(yg)&&(e.linePadding=r),(o=ag(t,n,i,"opacity",o))&&(e.opacity=parseFloat(o));(n=sg(n,i,"textDecoration"))&&og(e,n),(t=ug(t,i,"textDecoration"))&&og(e,t)}(f,e,o,a,i,u,0==s.length),f}function og(e,t){for(var n=c(t.split(" ")),r=n.next();!r.done;r=n.next())switch(r.value){case"underline":e.textDecoration.includes("underline")||e.textDecoration.push("underline");break;case"noUnderline":e.textDecoration.includes("underline")&&ie(e.textDecoration,"underline");break;case"lineThrough":e.textDecoration.includes("lineThrough")||e.textDecoration.push("lineThrough");break;case"noLineThrough":e.textDecoration.includes("lineThrough")&&ie(e.textDecoration,"lineThrough");break;case"overline":e.textDecoration.includes("overline")||e.textDecoration.push("overline");break;case"noOverline":e.textDecoration.includes("overline")&&ie(e.textDecoration,"overline")}}function ag(e,t,n,r,i){return i=void 0===i||i,(e=ug(e,n,r))?e:i?sg(t,n,r):null}function sg(e,t,n){if(!e)return null;var r=tc(e,"http://www.w3.org/ns/ttml#styling",n);return r||lg(e,t,n)}function ug(e,t,n){var r=tc(e,"http://www.w3.org/ns/ttml#styling",n);return r||lg(e,t,n)}function lg(e,t,n){e=cg(e,"style",t,"");for(var r=null,i=0;i<e.length;i++){var o=tc(e[i],"urn:ebu:tt:style",n);o||(o=tc(e[i],"http://www.w3.org/ns/ttml#styling",n)),o||(o=ug(e[i],t,n)),o&&(r=o)}return r}function cg(e,t,n,r,i){var o=[];if(!e||1>n.length)return o;var a=e;for(e=null;a&&!(e=i?tc(a,i,t):a.getAttribute(t))&&(a=a.parentNode)instanceof Element;);if(t=e)for(i=(t=c(t.split(" "))).next();!i.done;i=t.next())for(i=i.value,a=(e=c(n)).next();!a.done;a=e.next())if(r+(a=a.value).getAttribute("xml:id")==i){o.push(a);break}return o}function dg(e,t,n,r){return e=fg(e,t),null==n?n=e.start:null!=e.start&&(n+=e.start),null==r?r=e.end:null!=e.start&&(r+=e.start),{start:n,end:r}}function fg(e,t){var n=hg(e.getAttribute("begin"),t),r=hg(e.getAttribute("end"),t),i=hg(e.getAttribute("dur"),t);return null==r&&null!=i&&(r=n+i),{start:n,end:r}}function hg(e,t){var n=null;if(wg.test(e)){n=wg.exec(e);var r=Number(n[1]),i=Number(n[2]),o=Number(n[3]),a=Number(n[4]);n=(o+=(a+=(Number(n[5])||0)/t.h)/t.frameRate)+60*i+3600*r}else if(Tg.test(e))n=pg(Tg,e);else if(xg.test(e))n=pg(xg,e);else if(Sg.test(e))n=Sg.exec(e),n=Number(n[1])/t.frameRate;else if(Eg.test(e))n=Eg.exec(e),n=Number(n[1])/t.g;else if(Ag.test(e))n=pg(Ag,e);else if(e)throw new ze(2,2,2001,"Could not parse cue time range in TTML");return n}function pg(e,t){var n=e.exec(t);return null==n||""==n[0]?null:(Number(n[4])||0)/1e3+(Number(n[3])||0)+60*(Number(n[2])||0)+3600*(Number(n[1])||0)}function gg(e,t,n,r){this.frameRate=Number(e)||30,this.h=Number(t)||1,this.g=Number(r),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]))}Ht["application/x-subtitle-lrc"]=function(){return new eg},rg.prototype.parseInit=function(){},rg.prototype.parseMedia=function(e,t){var n=vt(e),r=[],i=new DOMParser,o=null;if(""==n)return r;try{o=i.parseFromString(n,"text/xml")}catch(w){throw new ze(2,2,2005,"Failed to parse TTML.")}if(o){if(n=o.getElementsByTagName("parsererror")[0])throw new ze(2,2,2005,n.textContent);var a=o.getElementsByTagName("tt")[0];if(!a)throw new ze(2,2,2005,"TTML does not contain <tt> tag.");if(!(i=a.getElementsByTagName("body")[0]))return[];n=tc(a,"http://www.w3.org/ns/ttml#parameter","frameRate");var s=tc(a,"http://www.w3.org/ns/ttml#parameter","subFrameRate"),u=tc(a,"http://www.w3.org/ns/ttml#parameter","frameRateMultiplier"),l=tc(a,"http://www.w3.org/ns/ttml#parameter","tickRate"),d=tc(a,"http://www.w3.org/ns/ttml#parameter","cellResolution");o=a.getAttribute("xml:space")||"default";var f=tc(a,"http://www.w3.org/ns/ttml#styling","extent");if("default"!=o&&"preserve"!=o)throw new ze(2,2,2005,"Invalid xml:space value: "+o);o="default"==o,n=new gg(n,s,u,l),d=d&&(d=/^(\d+) (\d+)$/.exec(d))?{columns:parseInt(d[1],10),rows:parseInt(d[2],10)}:null,s=(s=a.getElementsByTagName("metadata")[0])?function(e){return Array.from(e.childNodes).filter((function(e){return e instanceof Element}))}(s):[],u=Array.from(a.getElementsByTagName("style")),l=[];for(var h=c(a=Array.from(a.getElementsByTagName("region"))),p=h.next();!p.done;p=h.next()){var g=p.value;p=new Ee;var m=g.getAttribute("xml:id");if(m){p.id=m;var v,y,b=null;f&&(b=mg.exec(f)||bg.exec(f)),m=b?Number(b[1]):null,b=b?Number(b[2]):null,(v=sg(g,u,"extent"))&&(null!=(v=(y=mg.exec(v))||bg.exec(v))&&(p.width=Number(v[1]),p.height=Number(v[2]),y||(null!=m&&(p.width=100*p.width/m),null!=b&&(p.height=100*p.height/b)),p.widthUnits=y||null!=m?Ae:0,p.heightUnits=y||null!=b?Ae:0)),(g=sg(g,u,"origin"))&&(null!=(v=(y=mg.exec(g))||bg.exec(g))&&(p.viewportAnchorX=Number(v[1]),p.viewportAnchorY=Number(v[2]),y||(null!=b&&(p.viewportAnchorY=100*p.viewportAnchorY/b),null!=m&&(p.viewportAnchorX=100*p.viewportAnchorX/m)),p.viewportAnchorUnits=y||null!=m?Ae:0))}else p=null;p&&l.push(p)}if(Zl(i,"p").length)throw new ze(2,2,2001,"<p> can only be inside <div> in TTML");for(f=(i=c(Zl(i,"div"))).next();!f.done;f=i.next()){if(Zl(f=f.value,"span").length)throw new ze(2,2,2001,"<span> can only be inside <p> in TTML");if((h=Zl(f,"p"))&&h.length)for(h=(f=c(h)).next();!h.done;h=f.next())(h=ig(h.value,t.periodStart,n,s,u,a,l,o,!1,d))&&r.push(h);else(f=ig(f,t.periodStart,n,s,u,a,l,o,!1,d))&&r.push(f)}}return r},V("shaka.text.TtmlTextParser",rg),rg.prototype.parseMedia=rg.prototype.parseMedia,rg.prototype.parseInit=rg.prototype.parseInit;var mg=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,vg=/^(\d{1,2}(?:\.\d+)?|100)%$/,yg=/^(\d+px|\d+em|\d*\.?\d+c)$/,bg=/^(\d+)px (\d+)px$/,wg=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Tg=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,xg=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,Sg=/^(\d*(?:\.\d*)?)f$/,Eg=/^(\d*(?:\.\d*)?)t$/,Ag=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,kg={left:ve,center:"center",right:"end",start:ve,end:"end"},Ig={left:"line-left",center:"center",right:"line-right"},Cg=["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt","http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];function Mg(){this.s=new rg}function Dg(){}function Rg(e){for(var t=c(Object.entries(be)),n=t.next();!n.done;n=t.next()){var r=c(n.value);n=r.next().value,r=r.next().value;var i=new se(0,0,"");i.color=r,e.set(n,i)}for(n=(t=c(Object.entries(we))).next();!n.done;n=t.next())n=(r=c(n.value)).next().value,r=r.next().value,(i=new se(0,0,"")).backgroundColor=r,e.set(n,i)}function Ng(e,t,n){0===n.size&&Rg(n);var r=hc("<span>"+(e=function(e){for(var t=[],n=-1,r="",i=0;i<e.length;i++)if("/"===e[i]){var o=e.indexOf(">",i);if(o<=i)return e;o=e.substring(i+1,o);var a=t.pop();if(!o||!a)return e;if(a===o)r+="/"+o+">";else{if(!a.startsWith("c.")||"c"!==o)return e;r+="/"+a+">"}i+=o.length+1}else"<"===e[i]?n=i+1:">"===e[i]&&0<n&&(t.push(e.substr(n,i-n)),n=-1),r+=e[i];return r}(e))+"</span>","span");if(r){var i=[];if(1==(r=r.childNodes).length){var o=r[0];if(o.nodeType==Node.TEXT_NODE||o.nodeType==Node.CDATA_SECTION_NODE)return void(t.payload=e)}for(r=(e=c(r)).next();!r.done;r=e.next())Lg(r.value,t,i,n);t.nestedCues=i}else t.payload=e}function Pg(e,t){return e&&0<e.length?e:t}function Lg(e,t,n,r){var i=t.clone();if(e.nodeType===Node.ELEMENT_NODE&&e.nodeName)for(var o=c(e.nodeName.split(/[ .]+/)),a=o.next();!a.done;a=o.next()){if(a=a.value,r.has(a)){var s=r.get(a);s&&(i.backgroundColor=Pg(s.backgroundColor,i.backgroundColor),i.color=Pg(s.color,i.color),i.fontFamily=Pg(s.fontFamily,i.fontFamily),i.fontSize=Pg(s.fontSize,i.fontSize),i.fontWeight=s.fontWeight,i.fontStyle=s.fontStyle,i.opacity=s.opacity,i.wrapLine=s.wrapLine)}switch(a){case"b":i.fontWeight=700;break;case"i":i.fontStyle="italic";break;case"u":i.textDecoration.push("underline")}}if(rc(e))for(o=!0,r=c(e.textContent.split("\n")),e=r.next();!e.done;e=r.next())e=e.value,o||((o=t.clone()).lineBreak=!0,n.push(o)),0<e.length&&((o=i.clone()).payload=e,n.push(o)),o=!1;else for(e=(t=c(e.childNodes)).next();!e.done;e=t.next())Lg(e.value,i,n,r)}function jg(e,t,n){var r;(r=/^align:(start|middle|center|end|left|right)$/.exec(t))?(t=r[1],e.textAlign="middle"==t?ce:de[t.toUpperCase()]):(r=/^vertical:(lr|rl)$/.exec(t))?e.writingMode="lr"==r[1]?"vertical-lr":"vertical-rl":(r=/^size:([\d.]+)%$/.exec(t))?e.size=Number(r[1]):(r=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(t))?(e.position=Number(r[1]),r[2]&&(t=r[2],e.positionAlign="line-left"==t||"start"==t?"line-left":"line-right"==t||"end"==t?"line-right":"center")):(r=/^region:(.*)$/.exec(t))?(t=function(e,t){var n=e.filter((function(e){return e.id==t}));return n.length?n[0]:null}(n,r[1]))&&(e.region=t):(n=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(t))?(e.lineInterpretation=1,e.line=Number(n[1]),n[2]&&(e.lineAlign=ye[n[2].toUpperCase()])):(n=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(t))&&(e.lineInterpretation=me,e.line=Number(n[1]),n[2]&&(e.lineAlign=ye[n[2].toUpperCase()]))}function _g(e){if(null==(e=_d(e,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g)))return null;var t=Number(e[2]),n=Number(e[3]);return 59<t||59<n?null:Number(e[4])/1e3+n+60*t+3600*(Number(e[1])||0)}function Og(){this.g=null}function Ug(e,t,n){var r,i,o;return(new ci).box("payl",hi((function(e){r=vt(e)}))).box("iden",hi((function(e){i=vt(e)}))).box("sttg",hi((function(e){o=vt(e)}))).parse(e),r?function(e,t,n,r,i){if(r=new se(r,i,""),Ng(e,r,new Map),t&&(r.id=t),n)for(e=new Ld(n),t=Od(e);t;)jg(r,t,[]),jd(e),t=Od(e);return r}(r,i,o,t,n):null}function Fg(){}function Bg(e){if(null==(e=_d(e,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g)))return null;var t=Number(e[2]),n=Number(e[3]);return 59<t||59<n?null:Number(e[4])/1e3+n+60*t+3600*(Number(e[1])||0)}function Vg(){this.s=new Dg}function Hg(e){var t="WEBVTT\n\n";if(""==e)return t;for(var n=(e=c((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")+"\n\n";return t}function Kg(){}function Gg(e,t){var n=t.Fontname;if(n&&(e.fontFamily=n),(n=t.Fontsize)&&(e.fontSize=n+"px"),(n=t.PrimaryColour)&&(n=qg(n))&&(e.color=n),(n=t.BackColour)&&(n=qg(n))&&(e.backgroundColor=n),t.Bold&&(e.fontWeight=700),t.Italic&&(e.fontStyle="italic"),t.Underline&&e.textDecoration.push("underline"),(n=t.Spacing)&&(e.letterSpacing=n+"px"),n=t.Alignment)switch(parseInt(n,10)){case 1:e.displayAlign=fe,e.textAlign="start";break;case 2:e.displayAlign=fe,e.textAlign=ce;break;case 3:e.displayAlign=fe,e.textAlign="end";break;case 5:e.displayAlign="before",e.textAlign="start";break;case 6:e.displayAlign="before",e.textAlign=ce;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=ce;break;case 11:e.displayAlign="center",e.textAlign="end"}(n=t.AlphaLevel)&&(e.opacity=parseFloat(n))}function qg(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 zg(e){return 3600*((e=Qg.exec(e))[1]?parseInt(e[1].replace(":",""),10):0)+60*parseInt(e[2],10)+parseFloat(e[3])}Ht["application/ttml+xml"]=function(){return new rg},Mg.prototype.parseInit=function(e){var t=!1;if((new ci).box("moov",di).box("trak",di).box("mdia",di).box("minf",di).box("stbl",di).T("stsd",fi).box("stpp",(function(e){t=!0,e.parser.stop()})).parse(e),!t)throw new ze(2,2,2007)},Mg.prototype.parseMedia=function(e,t){var n=this,r=!1,i=[];if((new ci).box("mdat",hi((function(e){r=!0,i=i.concat(n.s.parseMedia(e,t))}))).parse(e,!1),!r)throw new ze(2,2,2007);return i},V("shaka.text.Mp4TtmlParser",Mg),Mg.prototype.parseMedia=Mg.prototype.parseMedia,Mg.prototype.parseInit=Mg.prototype.parseInit,Ht['application/mp4; codecs="stpp"']=function(){return new Mg},Ht['application/mp4; codecs="stpp.ttml.im1t"']=function(){return new Mg},Ht['application/mp4; codecs="stpp.TTML.im1t"']=function(){return new Mg},Dg.prototype.parseInit=function(){},Dg.prototype.parseMedia=function(e,t){var n=vt(e),r=(n=n.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n")).split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(r[0]))throw new ze(2,2,2e3);if(n=t.periodStart,r[0].includes("X-TIMESTAMP-MAP")){var i=r[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),o=r[0].match(/MPEGTS:(\d+)/m);if(i&&o){if(null==(n=_g(new Ld(i[1]))))throw new ze(2,2,2e3);for(o=Number(o[1]),i=t.segmentStart;95443.7176888889<=i;)i-=95443.7176888889,o+=8589934592;n=t.periodStart+o/9e4-n}}o=[];for(var a=(i=c(r[0].split("\n"))).next();!a.done;a=i.next())if(a=a.value,/^Region:/.test(a)){a=new Ld(a);var s=new Ee;Od(a),jd(a);for(var u=Od(a);u;){var l=s,d=u;(u=/^id=(.*)$/.exec(d))?l.id=u[1]:(u=/^width=(\d{1,2}|100)%$/.exec(d))?l.width=Number(u[1]):(u=/^lines=(\d+)$/.exec(d))?(l.height=Number(u[1]),l.heightUnits=2):(u=/^regionanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(d))?(l.regionAnchorX=Number(u[1]),l.regionAnchorY=Number(u[2])):(u=/^viewportanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(d))?(l.viewportAnchorX=Number(u[1]),l.viewportAnchorY=Number(u[2])):/^scroll=up$/.exec(d)&&(l.scroll="up"),jd(a),u=Od(a)}o.push(s)}for(Rg(i=new Map),a=[],s=(r=c(r.slice(1))).next();!s.done;s=r.next()){if((1!=(s=s.value.split("\n")).length||s[0])&&!/^NOTE($|[ \t])/.test(s[0])&&"STYLE"==s[0]&&s[1].includes("::cue")){l="global",(u=s[1].match(/\((.*)\)/))&&(l=u.pop()),u=s.slice(2,-1),s[1].includes("}")&&(d=/\{(.*?)\}/.exec(s[1]))&&(u=d[1].split(";")),d=new se(0,0,"");for(var f=!1,h=0;h<u.length;h++){var p=/^\s*([^:]+):\s*(.*)/.exec(u[h]);if(p){var g=p[2].trim().replace(";","");switch(p[1].trim()){case"background-color":f=!0,d.backgroundColor=g;break;case"color":f=!0,d.color=g;break;case"font-family":f=!0,d.fontFamily=g;break;case"font-size":f=!0,d.fontSize=g;break;case"font-weight":700<=parseInt(g,10)&&(f=!0,d.fontWeight=700);break;case"font-style":switch(g){case"normal":f=!0,d.fontStyle=xe;break;case"italic":f=!0,d.fontStyle="italic";break;case"oblique":f=!0,d.fontStyle="oblique"}break;case"opacity":f=!0,d.opacity=parseFloat(g);break;case"white-space":f=!0,d.wrapLine="noWrap"!=g}}}f&&i.set(l,d)}if(h=n,1==s.length&&!s[0]||/^NOTE($|[ \t])/.test(s[0])||"STYLE"==s[0])s=null;else{if(l=null,s[0].includes("--\x3e")||(l=s[0],s.splice(0,1)),d=_g(u=new Ld(s[0])),p=_d(u,/[ \t]+--\x3e[ \t]+/g),f=_g(u),null==d||null==p||null==f)throw new ze(2,2,2001,"Could not parse cue time range in WebVTT");for(d+=h,f+=h,h=s.slice(1).join("\n").trim(),i.has("global")?((s=i.get("global").clone()).startTime=d,s.endTime=f,s.payload=""):s=new se(d,f,""),Ng(h,s,i),jd(u),d=Od(u);d;)jg(s,d,o),jd(u),d=Od(u);null!=l&&(s.id=l)}s&&a.push(s)}return a},V("shaka.text.VttTextParser",Dg),Dg.prototype.parseMedia=Dg.prototype.parseMedia,Dg.prototype.parseInit=Dg.prototype.parseInit,Ht["text/vtt"]=function(){return new Dg},Ht['text/vtt; codecs="vtt"']=function(){return new Dg},Ht['text/vtt; codecs="wvtt"']=function(){return new Dg},Og.prototype.parseInit=function(e){var t=this,n=!1;if((new ci).box("moov",di).box("trak",di).box("mdia",di).T("mdhd",(function(e){e=Io(e.reader,e.version),t.g=e.timescale})).box("minf",di).box("stbl",di).T("stsd",fi).box("wvtt",(function(){n=!0})).parse(e),!this.g)throw new ze(2,2,2008);if(!n)throw new ze(2,2,2008)},Og.prototype.parseMedia=function(e,t){if(!this.g)throw new ze(2,2,2008);var n,r=0,i=[],o=[],a=!1,s=!1,u=!1,l=null;if((new ci).box("moof",di).box("traf",di).T("tfdt",(function(e){a=!0,r=ko(e.reader,e.version).hd})).T("tfhd",(function(e){l=Ao(e.reader,e.flags).Yd})).T("trun",(function(e){s=!0,i=Co(e.reader,e.version,e.flags).pe})).box("mdat",hi((function(e){u=!0,n=e}))).parse(e,!1),!u&&!a&&!s)throw new ze(2,2,2008);for(var d=r,f=new si(n,0),h=c(i),p=h.next();!p.done;p=h.next()){var g=(p=p.value).Id||l,m=p.Kc?r+p.Kc:d;d=m+(g||0);var v=0;do{var y=f.M();v+=y;var b=null;"vttc"==gi(f.M())?8<y&&(b=f.$a(y-8)):f.skip(y-8),g&&b&&(y=Ug(b,t.periodStart+m/this.g,t.periodStart+d/this.g),o.push(y))}while(p.sampleSize&&v<p.sampleSize)}return o.filter(Ve)},V("shaka.text.Mp4VttParser",Og),Og.prototype.parseMedia=Og.prototype.parseMedia,Og.prototype.parseInit=Og.prototype.parseInit,Ht['application/mp4; codecs="wvtt"']=function(){return new Og},Fg.prototype.parseInit=function(){},Fg.prototype.parseMedia=function(e){var t=vt(e).replace(/\r+/g,"");if(e=[],""==(t=t.trim()))return e;for(var n=(t=c(t.split("\n\n"))).next();!n.done;n=t.next()){var r=new Ld((n=n.value.split("\n"))[0]),i=Bg(r),o=_d(r,/,/g);if(r=Bg(r),null==i||null==o||null==r)throw new ze(2,2,2001,"Could not parse cue time range in SubViewer");e.push(new se(i,r,n.slice(1).join("\n").trim()))}return e},V("shaka.text.SbvTextParser",Fg),Fg.prototype.parseMedia=Fg.prototype.parseMedia,Fg.prototype.parseInit=Fg.prototype.parseInit,Ht["text/x-subviewer"]=function(){return new Fg},Vg.prototype.parseInit=function(){},Vg.prototype.parseMedia=function(e,t){var n=vt(e);return n=Re(wt(n=Hg(n))),this.s.parseMedia(n,t)},V("shaka.text.SrtTextParser",Vg),Vg.srt2webvtt=Hg,Vg.prototype.parseMedia=Vg.prototype.parseMedia,Vg.prototype.parseInit=Vg.prototype.parseInit,Ht["text/srt"]=function(){return new Vg},Kg.prototype.parseInit=function(){},Kg.prototype.parseMedia=function(e){for(var t="",n="",r=(e=c(e=vt(e).split(/\r?\n\s*\r?\n/))).next();!r.done;r=e.next()){var i=Yg.exec(r.value);i&&(r=i[1],i=i[2],"V4 Styles"==r||"V4+ Styles"==r?t=i:"Events"==r&&(n=i))}e=[],r=null;for(var o=(t=c(t.split(/\r?\n/))).next();!o.done;o=t.next())if(i=o.value,!/^\s*;/.test(i)&&(o=$g.exec(i)))if(i=o[1].trim(),o=o[2].trim(),"Format"==i)r=o.split(Jg);else if("Style"==i){i=o.split(Jg),o={};for(var a=0;a<r.length&&a<i.length;a++)o[r[a]]=i[a];e.push(o)}for(r=[],t=null,i={},o=(n=c(n.split(/\r?\n/))).next();!o.done;i={cd:i.cd},o=n.next())if(o=o.value,!/^\s*;/.test(o)&&(a=$g.exec(o)))if(o=a[1].trim(),a=a[2].trim(),"Format"==o)t=a.split(Jg);else if("Dialogue"==o){a=a.split(Jg),o={};for(var s=0;s<t.length&&s<a.length;s++)o[t[s]]=a[s];a=new se(s=zg(o.Start),zg(o.End),a.slice(t.length-1).join(",").replace(/\\N/g,"\n").replace(/\{[^}]+\}/g,"")),i.cd=o.Style,(o=e.find(function(e){return function(t){return t.Name==e.cd}}(i)))&&Gg(a,o),r.push(a)}return r},V("shaka.text.SsaTextParser",Kg),Kg.prototype.parseMedia=Kg.prototype.parseMedia,Kg.prototype.parseInit=Kg.prototype.parseInit;var Xg,Wg,Yg=/^\s*\[([^\]]+)\]\r?\n([\s\S]*)/,$g=/^\s*([^:]+):\s*(.*)/,Jg=/\s*,\s*/,Qg=/^(\d+:)?(\d{1,2}):(\d{1,2}(?:[.]\d{1,3})?)?$/;function Zg(){}function em(){Xg?console.debug("EmeEncryptionSchemePolyfill: Already installed."):navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration?(Xg=navigator.requestMediaKeySystemAccess,console.debug("EmeEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.requestMediaKeySystemAccess=tm):console.debug("EmeEncryptionSchemePolyfill: EME not found")}function tm(e,t){var n,r=this;return L((function(i){return 1==i.g?(console.assert(r==navigator,'bad "this" for requestMediaKeySystemAccess'),T(i,Xg.call(r,e,t),2)):cm(n=i.h)?(console.debug("EmeEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.requestMediaKeySystemAccess=Xg,i.return(n)):(console.debug("EmeEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support."),navigator.requestMediaKeySystemAccess=nm,i.return(nm.call(r,e,t)))}))}function nm(e,t){var n,r,i,o,a,s,u,l,d,f,h=this;return L((function(p){if(1==p.g){for(console.assert(h==navigator,'bad "this" for requestMediaKeySystemAccess'),n=lm(e),r=[],i=c(t),o=i.next();!o.done;o=i.next())a=o.value,s=rm(a.videoCapabilities,n),u=rm(a.audioCapabilities,n),a.videoCapabilities&&a.videoCapabilities.length&&!s.length||a.audioCapabilities&&a.audioCapabilities.length&&!u.length||((l=Object.assign({},a)).videoCapabilities=s,l.audioCapabilities=u,r.push(l));if(!r.length)throw(d=Error("Unsupported keySystem or supportedConfigurations.")).name="NotSupportedError",d.code=DOMException.NOT_SUPPORTED_ERR,d;return T(p,Xg.call(h,e,r),2)}return f=p.h,p.return(new um(f,n))}))}function rm(e,t){return e?e.filter((function(e){return!e.encryptionScheme||e.encryptionScheme==t})):e}function im(){}function om(){Wg?console.debug("McEncryptionSchemePolyfill: Already installed."):navigator.mediaCapabilities?(Wg=navigator.mediaCapabilities.decodingInfo,console.debug("McEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=am):console.debug("McEncryptionSchemePolyfill: MediaCapabilities not found")}function am(e){var t,n,r=this;return L((function(i){return 1==i.g?(console.assert(r==navigator.mediaCapabilities,'bad "this" for decodingInfo'),T(i,Wg.call(r,e),2)):(t=i.h,e.keySystemConfiguration?(n=t.keySystemAccess)&&cm(n)?(console.debug("McEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.mediaCapabilities.decodingInfo=Wg,i.return(t)):(console.debug("McEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=sm,i.return(sm.call(r,e))):i.return(t))}))}function sm(e){var t,n,r,i,o,a,s,u,l,c=this;return L((function(d){switch(d.g){case 1:return console.assert(c==navigator.mediaCapabilities,'bad "this" for decodingInfo'),t=null,e.keySystemConfiguration&&(n=e.keySystemConfiguration,r=n.keySystem,i=n.audio&&n.audio.encryptionScheme,o=n.video&&n.video.encryptionScheme,t=lm(r),a={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:e},i&&i!=t||o&&o!=t)?d.return(a):T(d,Wg.call(c,e),2);case 2:if((s=d.h).keySystemAccess){s.keySystemAccess=new um(s.keySystemAccess,t),d.v(3);break}if(!e.keySystemConfiguration){d.v(3);break}var f=e.keySystemConfiguration,h=[],p=[];return f.audio&&h.push({robustness:f.audio.robustness||"",contentType:e.audio.contentType}),f.video&&p.push({robustness:f.video.robustness||"",contentType:e.video.contentType}),f={initDataTypes:f.initDataType?[f.initDataType]:[],distinctiveIdentifier:f.distinctiveIdentifier,persistentState:f.persistentState,sessionTypes:f.sessionTypes},h.length&&(f.audioCapabilities=h),p.length&&(f.videoCapabilities=p),u=f,l=s,T(d,navigator.requestMediaKeySystemAccess(e.keySystemConfiguration.keySystem,[u]),5);case 5:l.keySystemAccess=d.h;case 3:return d.return(s)}}))}function um(e,t){this.h=e,this.g=t,this.keySystem=e.keySystem}function lm(e){return e.startsWith("com.widevine")||e.startsWith("com.microsoft")||e.startsWith("com.adobe")||e.startsWith("org.w3")?"cenc":e.startsWith("com.apple")?"cbcs-1-9":(console.warn("EmeEncryptionSchemePolyfill: Unknown key system:",e,"Please contribute!"),null)}function cm(e){var t=(e=e.getConfiguration()).audioCapabilities&&e.audioCapabilities[0];return!(!(e=e.videoCapabilities&&e.videoCapabilities[0]||t)||void 0===e.encryptionScheme)}function dm(){}function fm(){em(),om()}Ht["text/x-ssa"]=function(){return new Kg},V("EmeEncryptionSchemePolyfill",Zg),Zg.install=em,V("McEncryptionSchemePolyfill",im),im.install=om,um.prototype.getConfiguration=function(){var e=this.h.getConfiguration();if(e.videoCapabilities)for(var t=c(e.videoCapabilities),n=t.next();!n.done;n=t.next())n.value.encryptionScheme=this.g;if(e.audioCapabilities)for(n=(t=c(e.audioCapabilities)).next();!n.done;n=t.next())n.value.encryptionScheme=this.g;return e},um.prototype.createMediaKeys=function(){return this.h.createMediaKeys()},V("EncryptionSchemePolyfills",dm),dm.install=fm,"undefined"!==typeof n&&n.exports&&(n.exports=dm)}.call(n,e,e,void 0),n.shaka)t[r]=n.shaka[r]}()}}]);