UNPKG

shaka-player

Version:
1,413 lines • 629 kB
/*
 @license
 Shaka Player
 Copyright 2016 Google LLC
 SPDX-License-Identifier: Apache-2.0
*/
(function(){var innerGlobal=typeof window!="undefined"?window:global;var exportTo={};(function(window,global,module){/*
 @license
 Shaka Player
 Copyright 2016 Google LLC
 SPDX-License-Identifier: Apache-2.0
*/
var q,aa=typeof Object.create=="function"?Object.create:function(a){function b(){}b.prototype=a;return new b},ba=typeof Object.defineProperties=="function"?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};
function ca(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");}var ea=ca(this),fa="Int8 Uint8 Uint8Clamped Int16 Uint16 Int32 Uint32 Float32 Float64".split(" ");ea.BigInt64Array&&(fa.push("BigInt64"),fa.push("BigUint64"));
function ha(a,b){if(b)for(var c=0;c<fa.length;c++)ia(fa[c]+"Array.prototype."+a,b)}function ja(a,b){b&&ia(a,b)}function ia(a,b){var c=ea;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))return;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&b!=null&&ba(c,a,{configurable:!0,writable:!0,value:b})}var la;
if(typeof Object.setPrototypeOf=="function")la=Object.setPrototypeOf;else{var ma;a:{var na={a:!0},oa={};try{oa.__proto__=na;ma=oa.a;break a}catch(a){}ma=!1}la=ma?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var qa=la;
function ra(a,b){a.prototype=aa(b.prototype);a.prototype.constructor=a;if(qa)qa(a,b);else for(var c in b)if(c!="prototype")if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.zm=b.prototype}function sa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}
function r(a){var b=typeof Symbol!="undefined"&&Symbol.iterator&&a[Symbol.iterator];if(b)return b.call(a);if(typeof a.length=="number")return{next:sa(a)};throw Error(String(a)+" is not an iterable or ArrayLike");}function F(a){if(!(a instanceof Array)){a=r(a);for(var b,c=[];!(b=a.next()).done;)c.push(b.value);a=c}return a}function ta(a){if(!(a instanceof Object))throw new TypeError("Iterator result "+a+" is not an object");}
function ua(){this.I=!1;this.D=null;this.j=void 0;this.i=1;this.C=this.H=0;this.N=this.A=null}function wa(a){if(a.I)throw new TypeError("Generator is already running");a.I=!0}ua.prototype.L=function(a){this.j=a};function xa(a,b){a.A={jh:b,Gh:!0};a.i=a.H||a.C}ua.prototype.getNextAddressJsc=function(){return this.i};ua.prototype.getYieldResultJsc=function(){return this.j};ua.prototype.return=function(a){this.A={return:a};this.i=this.C};ua.prototype["return"]=ua.prototype.return;
ua.prototype.P=function(a){this.A={B:a};this.i=this.C};ua.prototype.jumpThroughFinallyBlocks=ua.prototype.P;ua.prototype.h=function(a,b){this.i=b;return{value:a}};ua.prototype.yield=ua.prototype.h;ua.prototype.U=function(a,b){a=r(a);var c=a.next();ta(c);if(c.done)this.j=c.value,this.i=b;else return this.D=a,this.h(c.value,b)};ua.prototype.yieldAll=ua.prototype.U;ua.prototype.B=function(a){this.i=a};ua.prototype.jumpTo=ua.prototype.B;ua.prototype.l=function(){this.i=0};ua.prototype.jumpToEnd=ua.prototype.l;
ua.prototype.o=function(a,b){this.H=a;b!=void 0&&(this.C=b)};ua.prototype.setCatchFinallyBlocks=ua.prototype.o;ua.prototype.K=function(a){this.H=0;this.C=a||0};ua.prototype.setFinallyBlock=ua.prototype.K;ua.prototype.u=function(a,b){this.i=a;this.H=b||0};ua.prototype.leaveTryBlock=ua.prototype.u;ua.prototype.m=function(a){this.H=a||0;a=this.A.jh;this.A=null;return a};ua.prototype.enterCatchBlock=ua.prototype.m;
ua.prototype.F=function(a,b,c){c?this.N[c]=this.A:this.N=[this.A];this.H=a||0;this.C=b||0};ua.prototype.enterFinallyBlock=ua.prototype.F;ua.prototype.G=function(a,b){b=this.N.splice(b||0)[0];(b=this.A=this.A||b)?b.Gh?this.i=this.H||this.C:b.B!=void 0&&this.C<b.B?(this.i=b.B,this.A=null):this.i=this.C:this.i=a};ua.prototype.leaveFinallyBlock=ua.prototype.G;ua.prototype.O=function(a){return new ya(a)};ua.prototype.forIn=ua.prototype.O;
function ya(a){this.j=a;this.h=[];for(var b in a)this.h.push(b);this.h.reverse()}ya.prototype.i=function(){for(;this.h.length>0;){var a=this.h.pop();if(a in this.j)return a}return null};ya.prototype.getNext=ya.prototype.i;function za(a){this.h=new ua;this.i=a}function Ba(a,b){wa(a.h);var c=a.h.D;if(c)return Ca(a,"return"in c?c["return"]:function(d){return{value:d,done:!0}},b,a.h.return);a.h.return(b);return Da(a)}
function Ca(a,b,c,d){try{var e=b.call(a.h.D,c);ta(e);if(!e.done)return a.h.I=!1,e;var f=e.value}catch(g){return a.h.D=null,xa(a.h,g),Da(a)}a.h.D=null;d.call(a.h,f);return Da(a)}function Da(a){for(;a.h.i;)try{var b=a.i(a.h);if(b)return a.h.I=!1,{value:b.value,done:!1}}catch(c){a.h.j=void 0,xa(a.h,c)}a.h.I=!1;if(a.h.A){b=a.h.A;a.h.A=null;if(b.Gh)throw b.jh;return{value:b.return,done:!0}}return{value:void 0,done:!0}}
function Fa(a){this.next=function(b){wa(a.h);a.h.D?b=Ca(a,a.h.D.next,b,a.h.L):(a.h.L(b),b=Da(a));return b};this.throw=function(b){wa(a.h);a.h.D?b=Ca(a,a.h.D["throw"],b,a.h.L):(xa(a.h,b),b=Da(a));return b};this.return=function(b){return Ba(a,b)};this[Symbol.iterator]=function(){return this}}function Ga(a){function b(d){return a.next(d)}function c(d){return a.throw(d)}return new Promise(function(d,e){function f(g){g.done?d(g.value):Promise.resolve(g.value).then(b,c).then(f,e)}f(a.next())})}
function H(a){return Ga(new Fa(new za(a)))}function Ha(){for(var a=Number(this),b=[],c=a;c<arguments.length;c++)b[c-a]=arguments[c];return b}ja("Symbol",function(a){function b(f){if(this instanceof b)throw new TypeError("Symbol is not a constructor");return new c(d+(f||"")+"_"+e++,f)}function c(f,g){this.h=f;ba(this,"description",{configurable:!0,writable:!0,value:g})}if(a)return a;c.prototype.toString=function(){return this.h};var d="jscomp_symbol_"+(Math.random()*1E9>>>0)+"_",e=0;return b});
ja("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");ba(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return Ia(sa(this))}});return a});function Ia(a){a={next:a};a[Symbol.iterator]=function(){return this};return a}
ja("Promise",function(a){function b(g){this.i=0;this.j=void 0;this.h=[];this.u=!1;var h=this.l();try{g(h.resolve,h.reject)}catch(k){h.reject(k)}}function c(){this.h=null}function d(g){return g instanceof b?g:new b(function(h){h(g)})}if(a)return a;c.prototype.i=function(g){if(this.h==null){this.h=[];var h=this;this.j(function(){h.m()})}this.h.push(g)};var e=ea.setTimeout;c.prototype.j=function(g){e(g,0)};c.prototype.m=function(){for(;this.h&&this.h.length;){var g=this.h;this.h=[];for(var h=0;h<g.length;++h){var k=
g[h];g[h]=null;try{k()}catch(l){this.l(l)}}}this.h=null};c.prototype.l=function(g){this.j(function(){throw g;})};b.prototype.l=function(){function g(l){return function(m){k||(k=!0,l.call(h,m))}}var h=this,k=!1;return{resolve:g(this.G),reject:g(this.m)}};b.prototype.G=function(g){if(g===this)this.m(new TypeError("A Promise cannot resolve to itself"));else if(g instanceof b)this.I(g);else{a:switch(typeof g){case "object":var h=g!=null;break a;case "function":h=!0;break a;default:h=!1}h?this.F(g):this.o(g)}};
b.prototype.F=function(g){var h=void 0;try{h=g.then}catch(k){this.m(k);return}typeof h=="function"?this.K(h,g):this.o(g)};b.prototype.m=function(g){this.A(2,g)};b.prototype.o=function(g){this.A(1,g)};b.prototype.A=function(g,h){if(this.i!=0)throw Error("Cannot settle("+g+", "+h+"): Promise already settled in state"+this.i);this.i=g;this.j=h;this.i===2&&this.H();this.C()};b.prototype.H=function(){var g=this;e(function(){if(g.D()){var h=ea.console;typeof h!=="undefined"&&h.error(g.j)}},1)};b.prototype.D=
function(){if(this.u)return!1;var g=ea.CustomEvent,h=ea.Event,k=ea.dispatchEvent;if(typeof k==="undefined")return!0;typeof g==="function"?g=new g("unhandledrejection",{cancelable:!0}):typeof h==="function"?g=new h("unhandledrejection",{cancelable:!0}):(g=ea.document.createEvent("CustomEvent"),g.initCustomEvent("unhandledrejection",!1,!0,g));g.promise=this;g.reason=this.j;return k(g)};b.prototype.C=function(){if(this.h!=null){for(var g=0;g<this.h.length;++g)f.i(this.h[g]);this.h=null}};var f=new c;
b.prototype.I=function(g){var h=this.l();g.me(h.resolve,h.reject)};b.prototype.K=function(g,h){var k=this.l();try{g.call(h,k.resolve,k.reject)}catch(l){k.reject(l)}};b.prototype.then=function(g,h){function k(p,t){return typeof p=="function"?function(u){try{l(p(u))}catch(v){m(v)}}:t}var l,m,n=new b(function(p,t){l=p;m=t});this.me(k(g,l),k(h,m));return n};b.prototype.catch=function(g){return this.then(void 0,g)};b.prototype.me=function(g,h){function k(){switch(l.i){case 1:g(l.j);break;case 2:h(l.j);
break;default:throw Error("Unexpected state: "+l.i);}}var l=this;this.h==null?f.i(k):this.h.push(k);this.u=!0};b.resolve=d;b.reject=function(g){return new b(function(h,k){k(g)})};b.race=function(g){return new b(function(h,k){for(var l=r(g),m=l.next();!m.done;m=l.next())d(m.value).me(h,k)})};b.all=function(g){var h=r(g),k=h.next();return k.done?d([]):new b(function(l,m){function n(u){return function(v){p[u]=v;t--;t==0&&l(p)}}var p=[],t=0;do p.push(void 0),t++,d(k.value).me(n(p.length-1),m),k=h.next();
while(!k.done)})};return b});function Ja(a,b){return Object.prototype.hasOwnProperty.call(a,b)}
ja("WeakMap",function(a){function b(k){this.h=(h+=Math.random()+1).toString();if(k){k=r(k);for(var l;!(l=k.next()).done;)l=l.value,this.set(l[0],l[1])}}function c(){}function d(k){var l=typeof k;return l==="object"&&k!==null||l==="function"}function e(k){if(!Ja(k,g)){var l=new c;ba(k,g,{value:l})}}function f(k){var l=Object[k];l&&(Object[k]=function(m){if(m instanceof c)return m;Object.isExtensible(m)&&e(m);return l(m)})}if(function(){if(!a||!Object.seal)return!1;try{var k=Object.seal({}),l=Object.seal({}),
m=new a([[k,2],[l,3]]);if(m.get(k)!=2||m.get(l)!=3)return!1;m.delete(k);m.set(l,4);return!m.has(k)&&m.get(l)==4}catch(n){return!1}}())return a;var g="$jscomp_hidden_"+Math.random();f("freeze");f("preventExtensions");f("seal");var h=0;b.prototype.set=function(k,l){if(!d(k))throw Error("Invalid WeakMap key");e(k);if(!Ja(k,g))throw Error("WeakMap key fail: "+k);k[g][this.h]=l;return this};b.prototype.get=function(k){return d(k)&&Ja(k,g)?k[g][this.h]:void 0};b.prototype.has=function(k){return d(k)&&Ja(k,
g)&&Ja(k[g],this.h)};b.prototype.delete=function(k){return d(k)&&Ja(k,g)&&Ja(k[g],this.h)?delete k[g][this.h]:!1};return b});
ja("Map",function(a){function b(){var h={};return h.Tb=h.next=h.head=h}function c(h,k){var l=h[1];return Ia(function(){if(l){for(;l.head!=h[1];)l=l.Tb;for(;l.next!=l.head;)return l=l.next,{done:!1,value:k(l)};l=null}return{done:!0,value:void 0}})}function d(h,k){var l=k&&typeof k;l=="object"||l=="function"?f.has(k)?l=f.get(k):(l=""+ ++g,f.set(k,l)):l="p_"+k;var m=h[0][l];if(m&&Ja(h[0],l))for(h=0;h<m.length;h++){var n=m[h];if(k!==k&&n.key!==n.key||k===n.key)return{id:l,list:m,index:h,entry:n}}return{id:l,
list:m,index:-1,entry:void 0}}function e(h){this[0]={};this[1]=b();this.size=0;if(h){h=r(h);for(var k;!(k=h.next()).done;)k=k.value,this.set(k[0],k[1])}}if(function(){if(!a||typeof a!="function"||!a.prototype.entries||typeof Object.seal!="function")return!1;try{var h=Object.seal({x:4}),k=new a(r([[h,"s"]]));if(k.get(h)!="s"||k.size!=1||k.get({x:4})||k.set({x:4},"t")!=k||k.size!=2)return!1;var l=k.entries(),m=l.next();if(m.done||m.value[0]!=h||m.value[1]!="s")return!1;m=l.next();return m.done||m.value[0].x!=
4||m.value[1]!="t"||!l.next().done?!1:!0}catch(n){return!1}}())return a;var f=new WeakMap;e.prototype.set=function(h,k){h=h===0?0:h;var l=d(this,h);l.list||(l.list=this[0][l.id]=[]);l.entry?l.entry.value=k:(l.entry={next:this[1],Tb:this[1].Tb,head:this[1],key:h,value:k},l.list.push(l.entry),this[1].Tb.next=l.entry,this[1].Tb=l.entry,this.size++);return this};e.prototype.delete=function(h){h=d(this,h);return h.entry&&h.list?(h.list.splice(h.index,1),h.list.length||delete this[0][h.id],h.entry.Tb.next=
h.entry.next,h.entry.next.Tb=h.entry.Tb,h.entry.head=null,this.size--,!0):!1};e.prototype.clear=function(){this[0]={};this[1]=this[1].Tb=b();this.size=0};e.prototype.has=function(h){return!!d(this,h).entry};e.prototype.get=function(h){return(h=d(this,h).entry)&&h.value};e.prototype.entries=function(){return c(this,function(h){return[h.key,h.value]})};e.prototype.keys=function(){return c(this,function(h){return h.key})};e.prototype.values=function(){return c(this,function(h){return h.value})};e.prototype.forEach=
function(h,k){for(var l=this.entries(),m;!(m=l.next()).done;)m=m.value,h.call(k,m[1],m[0],this)};e.prototype[Symbol.iterator]=e.prototype.entries;var g=0;return e});
ja("Set",function(a){function b(c){this.h=new Map;if(c){c=r(c);for(var d;!(d=c.next()).done;)this.add(d.value)}this.size=this.h.size}if(function(){if(!a||typeof a!="function"||!a.prototype.entries||typeof Object.seal!="function")return!1;try{var c=Object.seal({x:4}),d=new a(r([c]));if(!d.has(c)||d.size!=1||d.add(c)!=d||d.size!=1||d.add({x:4})!=d||d.size!=2)return!1;var e=d.entries(),f=e.next();if(f.done||f.value[0]!=c||f.value[1]!=c)return!1;f=e.next();return f.done||f.value[0]==c||f.value[0].x!=
4||f.value[1]!=f.value[0]?!1:e.next().done}catch(g){return!1}}())return a;b.prototype.add=function(c){c=c===0?0:c;this.h.set(c,c);this.size=this.h.size;return this};b.prototype.delete=function(c){c=this.h.delete(c);this.size=this.h.size;return c};b.prototype.clear=function(){this.h.clear();this.size=0};b.prototype.has=function(c){return this.h.has(c)};b.prototype.entries=function(){return this.h.entries()};b.prototype.values=function(){return this.h.values()};b.prototype.keys=b.prototype.values;b.prototype[Symbol.iterator]=
b.prototype.values;b.prototype.forEach=function(c,d){var e=this;this.h.forEach(function(f){return c.call(d,f,f,e)})};return b});function Ka(a,b,c){a instanceof String&&(a=String(a));for(var d=a.length,e=0;e<d;e++){var f=a[e];if(b.call(c,f,e,a))return{Bh:e,v:f}}return{Bh:-1,v:void 0}}ja("Array.prototype.findIndex",function(a){return a?a:function(b,c){return Ka(this,b,c).Bh}});
function La(a,b){a instanceof String&&(a+="");var c=0,d=!1,e={next:function(){if(!d&&c<a.length){var f=c++;return{value:b(f,a[f]),done:!1}}d=!0;return{done:!0,value:void 0}}};e[Symbol.iterator]=function(){return e};return e}ja("Array.prototype.values",function(a){return a?a:function(){return La(this,function(b,c){return c})}});
ja("Array.from",function(a){return a?a:function(b,c,d){c=c!=null?c:function(h){return h};var e=[],f=typeof Symbol!="undefined"&&Symbol.iterator&&b[Symbol.iterator];if(typeof f=="function"){b=f.call(b);for(var g=0;!(f=b.next()).done;)e.push(c.call(d,f.value,g++))}else for(f=b.length,g=0;g<f;g++)e.push(c.call(d,b[g],g));return e}});ja("Array.prototype.keys",function(a){return a?a:function(){return La(this,function(b){return b})}});
ja("Object.is",function(a){return a?a:function(b,c){return b===c?b!==0||1/b===1/c:b!==b&&c!==c}});ja("Array.prototype.includes",function(a){return a?a:function(b,c){var d=this;d instanceof String&&(d=String(d));var e=d.length;c=c||0;for(c<0&&(c=Math.max(c+e,0));c<e;c++){var f=d[c];if(f===b||Object.is(f,b))return!0}return!1}});
function Ma(a,b,c){if(a==null)throw new TypeError("The 'this' value for String.prototype."+c+" must not be null or undefined");if(b instanceof RegExp)throw new TypeError("First argument to String.prototype."+c+" must not be a regular expression");return a+""}ja("String.prototype.includes",function(a){return a?a:function(b,c){return Ma(this,b,"includes").indexOf(b,c||0)!==-1}});
ja("String.fromCodePoint",function(a){return a?a:function(b){for(var c="",d=0;d<arguments.length;d++){var e=Number(arguments[d]);if(e<0||e>1114111||e!==Math.floor(e))throw new RangeError("invalid_code_point "+e);e<=65535?c+=String.fromCharCode(e):(e-=65536,c+=String.fromCharCode(e>>>10&1023|55296),c+=String.fromCharCode(e&1023|56320))}return c}});
ja("String.prototype.startsWith",function(a){return a?a:function(b,c){var d=Ma(this,b,"startsWith"),e=d.length,f=b.length;c=Math.max(0,Math.min(c|0,d.length));for(var g=0;g<f&&c<e;)if(d[c++]!=b[g++])return!1;return g>=f}});
ja("WeakSet",function(a){function b(c){this.h=new WeakMap;if(c){c=r(c);for(var d;!(d=c.next()).done;)this.add(d.value)}}if(function(){if(!a||!Object.seal)return!1;try{var c=Object.seal({}),d=Object.seal({}),e=new a([c]);if(!e.has(c)||e.has(d))return!1;e.delete(c);e.add(d);return!e.has(c)&&e.has(d)}catch(f){return!1}}())return a;b.prototype.add=function(c){this.h.set(c,!0);return this};b.prototype.has=function(c){return this.h.has(c)};b.prototype.delete=function(c){return this.h.delete(c)};return b});
ja("Array.prototype.find",function(a){return a?a:function(b,c){return Ka(this,b,c).v}});ja("Object.entries",function(a){return a?a:function(b){var c=[],d;for(d in b)Ja(b,d)&&c.push([d,b[d]]);return c}});var Na=typeof Object.assign=="function"?Object.assign:function(a,b){if(a==null)throw new TypeError("No nullish arg");a=Object(a);for(var c=1;c<arguments.length;c++){var d=arguments[c];if(d)for(var e in d)Ja(d,e)&&(a[e]=d[e])}return a};ja("Object.assign",function(a){return a||Na});
ja("Math.clz32",function(a){return a?a:function(b){b=Number(b)>>>0;if(b===0)return 32;var c=0;(b&4294901760)===0&&(b<<=16,c+=16);(b&4278190080)===0&&(b<<=8,c+=8);(b&4026531840)===0&&(b<<=4,c+=4);(b&3221225472)===0&&(b<<=2,c+=2);(b&2147483648)===0&&c++;return c}});ja("String.prototype.repeat",function(a){return a?a:function(b){var c=Ma(this,null,"repeat");if(b<0||b>1342177279)throw new RangeError("Invalid count value");b|=0;for(var d="";b;)if(b&1&&(d+=c),b>>>=1)c+=c;return d}});
ja("Object.values",function(a){return a?a:function(b){var c=[],d;for(d in b)Ja(b,d)&&c.push(b[d]);return c}});ja("Promise.withResolvers",function(a){return a?a:function(){var b,c;return{promise:new Promise(function(d,e){b=d;c=e}),resolve:b,reject:c}}});ja("Promise.prototype.finally",function(a){return a?a:function(b){return this.then(function(c){return Promise.resolve(b()).then(function(){return c})},function(c){return Promise.resolve(b()).then(function(){throw c;})})}});
ja("Array.prototype.entries",function(a){return a?a:function(){return La(this,function(b,c){return[b,c]})}});ja("Number.isFinite",function(a){return a?a:function(b){return typeof b!=="number"?!1:!isNaN(b)&&b!==Infinity&&b!==-Infinity}});ja("Math.log2",function(a){return a?a:function(b){return Math.log(b)/Math.LN2}});ja("Number.EPSILON",function(){return 2.220446049250313E-16});ja("Number.MAX_SAFE_INTEGER",function(){return 9007199254740991});
ja("String.prototype.endsWith",function(a){return a?a:function(b,c){var d=Ma(this,b,"endsWith");c===void 0&&(c=d.length);c=Math.max(0,Math.min(c|0,d.length));for(var e=b.length;e>0&&c>0;)if(d[--c]!=b[--e])return!1;return e<=0}});ja("Number.isNaN",function(a){return a?a:function(b){return typeof b==="number"&&isNaN(b)}});
ja("Array.prototype.fill",function(a){return a?a:function(b,c,d){var e=this.length||0;c<0&&(c=Math.max(0,e+c));if(d==null||d>e)d=e;d=Number(d);d<0&&(d=Math.max(0,e+d));for(c=Number(c||0);c<d;c++)this[c]=b;return this}});ha("fill",function(a){return a?a:Array.prototype.fill});ja("String.prototype.trimLeft",function(a){function b(){return this.replace(/^[\s\xa0]+/,"")}return a||b});ja("String.prototype.trimStart",function(a){return a||String.prototype.trimLeft});
ja("Number.isInteger",function(a){return a?a:function(b){return Number.isFinite(b)?b===Math.floor(b):!1}});/*

 Copyright The Closure Library Authors.
 SPDX-License-Identifier: Apache-2.0
*/
var Oa=this||self;function I(a,b){a=a.split(".");var c=Oa;a[0]in c||typeof c.execScript=="undefined"||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||b===void 0?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};var shaka={};function Pa(a){this.j=Math.log(.5);this.h=Math.exp(this.j/a);this.l=this.i=0}Pa.prototype.sample=function(a,b){var c=Math.pow(this.h,a);b=b*(1-c)+c*this.i;isNaN(b)||(this.i=b,this.l+=a)};function Qa(a){return a.i/(1-Math.pow(a.h,a.l))};function Ra(){this.i=new Pa(2);this.l=new Pa(5);this.h=0;this.j=128E3;this.m=16E3}Ra.prototype.configure=function(a){this.j=a.minTotalBytes;this.m=a.minBytes;var b=this.i;b.h=Math.exp(b.j/a.fastHalfLife);b=this.l;b.h=Math.exp(b.j/a.slowHalfLife)};Ra.prototype.sample=function(a,b){if(!(b<this.m)){var c=8E3*b/a;a/=1E3;this.h+=b;this.i.sample(a,c);this.l.sample(a,c)}};Ra.prototype.getBandwidthEstimate=function(a){return this.h<this.j?a:Math.min(Qa(this.i),Qa(this.l))};function Sa(){}function Ta(){}function Ua(){}function Wa(a){var b=Ha.apply(1,arguments);Xa.has(a)||(Xa.add(a),Ua.apply(Sa,F(b)))}function Za(){}function $a(){}function ab(){}var Xa=new Set;
self.console&&((new Map).set(1,function(){return console.error.apply(console,F(Ha.apply(0,arguments)))}).set(2,function(){return console.warn.apply(console,F(Ha.apply(0,arguments)))}).set(3,function(){return console.info.apply(console,F(Ha.apply(0,arguments)))}).set(4,function(){return console.log.apply(console,F(Ha.apply(0,arguments)))}).set(5,function(){return console.debug.apply(console,F(Ha.apply(0,arguments)))}).set(6,function(){return console.debug.apply(console,F(Ha.apply(0,arguments)))}),
Ua=function(){return console.warn.apply(console,F(Ha.apply(0,arguments)))},Ta=function(){console.error.apply(console,F(Ha.apply(0,arguments)))});function bb(a,b){return typeof a==="number"&&typeof b==="number"&&isNaN(a)&&isNaN(b)?!0:a===b}function cb(a,b){b=a.indexOf(b);b>-1&&a.splice(b,1)}function db(a,b){var c;c||(c=bb);if(a.length!=b.length)return!1;b=b.slice();a=r(a);for(var d=a.next(),e={};!d.done;e={Lh:void 0},d=a.next()){e.Lh=d.value;d=b.findIndex(function(f){return function(g){return c(f.Lh,g)}}(e));if(d==-1)return!1;b[d]=b[b.length-1];b.pop()}return b.length==0}
function eb(a,b){var c=[],d=[];a=r(a);for(var e=a.next();!e.done;e=a.next())e=e.value,b(e)?c.push(e):d.push(e);return[c,d]}function fb(a,b){for(var c=0,d=a.length;c<d;){var e=c+d>>>1;b(a[e])?c=e+1:d=e}return c}function gb(a,b,c){if(a===b)return!0;if(!a||!b)return a==b;c||(c=bb);if(a.length!=b.length)return!1;for(var d=0;d<a.length;d++)if(!c(a[d],b[d]))return!1;return!0};function hb(){this.h=new Map}q=hb.prototype;q.push=function(a,b){this.h.getOrInsertComputed(a,function(){return[]}).push(b)};q.get=function(a){return this.h.has(a)?this.h.get(a).slice():null};q.remove=function(a,b){if(this.h.has(a)){var c=this.h.get(a).filter(function(d){return d!=b});this.h.set(a,c);c.length||this.h.delete(a)}};q.forEach=function(a){this.h.forEach(function(b,c){a(c,b)})};q.size=function(){return this.h.size};q.keys=function(){return Array.from(this.h.keys())};function ib(){this.h=new hb}q=ib.prototype;q.release=function(){this.Sa();this.h=null};q.J=function(a,b,c,d){this.h&&(a=new jb(a,b,c,d),this.h.push(b,a))};q.Ma=function(a,b,c,d){function e(g){f.mb(a,b,e);c(g)}var f=this;this.J(a,b,e,d)};q.Fb=function(a,b,c,d){if(this.h){b=r(b);for(var e=b.next();!e.done;e=b.next())this.J(a,e.value,c,d)}};
q.lk=function(a,b,c,d){var e=this;if(this.h)for(var f=!1,g=function(l){if(!f){f=!0;for(var m=r(b),n=m.next();!n.done;n=m.next())e.mb(a,n.value,g);c(l)}},h=r(b),k=h.next();!k.done;k=h.next())this.J(a,k.value,g,d)};q.mb=function(a,b,c){if(this.h){var d=this.h.get(b)||[];d=r(d);for(var e=d.next();!e.done;e=d.next())e=e.value,e.target!=a||c!=e.listener&&c||(e.mb(),this.h.remove(b,e))}};q.cl=function(a,b,c){if(this.h){b=r(b);for(var d=b.next();!d.done;d=b.next())this.mb(a,d.value,c)}};
q.Sa=function(){if(this.h){for(var a=[],b=r(this.h.h.values()),c=b.next();!c.done;c=b.next())a.push.apply(a,F(c.value));a=r(a);for(b=a.next();!b.done;b=a.next())b.value.mb();this.h.h.clear()}};I("shaka.util.EventManager",ib);ib.prototype.removeAll=ib.prototype.Sa;ib.prototype.unlistenMulti=ib.prototype.cl;ib.prototype.unlisten=ib.prototype.mb;ib.prototype.listenOnceMulti=ib.prototype.lk;ib.prototype.listenMulti=ib.prototype.Fb;ib.prototype.listenOnce=ib.prototype.Ma;ib.prototype.listen=ib.prototype.J;
ib.prototype.release=ib.prototype.release;function jb(a,b,c,d){this.target=a;this.type=b;this.listener=c;this.h=kb(a,d);this.target.addEventListener(b,c,this.h)}jb.prototype.mb=function(){this.target.removeEventListener(this.type,this.listener,this.h);this.listener=this.target=null;this.h=!1};function kb(a,b){if(b==void 0)return!1;if(typeof b=="boolean")return b;var c=new Set(["passive","capture"]);Object.keys(b).filter(function(d){return!c.has(d)});return lb(a)?b:b.capture||!1}
function lb(a){var b=mb;if(b==void 0){b=!1;try{var c={},d={get:function(){b=!0;return!1}};Object.defineProperty(c,"passive",d);Object.defineProperty(c,"capture",d);d=function(){};a.addEventListener("test",d,c);a.removeEventListener("test",d,c)}catch(e){b=!1}mb=b}return b||!1}var mb=void 0;function ob(a){this.i=a;this.h=void 0}ob.prototype.value=function(){this.h===void 0&&(this.h=this.i());return this.h};function R(){return pb.value()}var qb=null,rb=null,pb=new ob(function(){var a=void 0;qb&&(a=qb());!a&&rb&&(a=rb());return a});function sb(){}function tb(a,b){if(!a&&!b)return!0;if(!a||!b||a.byteLength!=b.byteLength)return!1;if((ArrayBuffer.isView(a)?a.buffer:a)==(ArrayBuffer.isView(b)?b.buffer:b)&&(a.byteOffset||0)==(b.byteOffset||0))return!0;var c=S(a);b=S(b);for(var d=0;d<a.byteLength;d++)if(c[d]!=b[d])return!1;return!0}function ub(a){return ArrayBuffer.isView(a)?a.byteOffset==0&&a.byteLength==a.buffer.byteLength?a.buffer:(new Uint8Array(a)).buffer:a}
function S(a,b,c){c=c===void 0?Infinity:c;return xb(a,b===void 0?0:b,c,Uint8Array)}function yb(a,b,c){c=c===void 0?Infinity:c;return xb(a,b===void 0?0:b,c,Uint16Array)}function zb(a,b,c){c=c===void 0?Infinity:c;return xb(a,b===void 0?0:b,c,DataView)}
function xb(a,b,c,d){var e=ArrayBuffer.isView(a)?a.buffer:a,f=1;"BYTES_PER_ELEMENT"in d&&(f=d.BYTES_PER_ELEMENT);var g=((a.byteOffset||0)+a.byteLength)/f;a=Math.floor(Math.max(0,Math.min(((a.byteOffset||0)+b)/f,g)));return new d(e,a,Math.floor(Math.min(a+Math.max(c,0),g))-a)}I("shaka.util.BufferUtils",sb);sb.toDataView=zb;sb.toUint16=yb;sb.toUint8=S;sb.toArrayBuffer=ub;sb.equal=tb;function T(a,b,c){var d=Ha.apply(3,arguments);this.severity=a;this.category=b;this.code=c;this.data=d;this.handled=!1;this.message="Shaka Error "+this.code;if(Ab)try{throw Error(this.message||"Shaka Error");}catch(e){this.stack=e.stack}}T.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null,"  ")};function Bb(a){var b=a.code,c=a.msExtendedCode;c&&(c<0&&(c+=4294967296),c=c.toString(16));return{code:b,nj:c,message:a.message}}I("shaka.util.Error",T);var Ab=!0;
T.Severity={RECOVERABLE:1,CRITICAL:2};T.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9,ADS:10};
T.Code={UNSUPPORTED_SCHEME:1E3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,ATTEMPTS_EXHAUSTED:1010,SEGMENT_MISSING:1011,INVALID_TEXT_HEADER:2E3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,UNABLE_TO_EXTRACT_CUE_START_TIME:2009,INVALID_MP4_CEA:2010,TEXT_COULD_NOT_GUESS_MIME_TYPE:2011,
CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS:2012,TEXT_ONLY_WEBVTT_SRC_EQUALS:2013,MISSING_TEXT_PLUGIN:2014,UNSUPPORTED_EXTERNAL_THUMBNAILS_URI:2017,BUFFER_READ_OUT_OF_BOUNDS:3E3,JS_INTEGER_OVERFLOW:3001,EBML_OVERFLOW:3002,EBML_BAD_FLOATING_POINT_SIZE:3003,MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005,MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,
WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,TRANSMUXING_FAILED:3018,CONTENT_TRANSFORMATION_FAILED:3019,TRANSMUXING_NO_VIDEO_DATA:3023,STREAMING_NOT_ALLOWED:3024,BUFFER_WRITE_OUT_OF_BOUNDS:3025,UNABLE_TO_GUESS_MANIFEST_TYPE:4E3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,DASH_WEBM_MISSING_INIT:4005,
DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,RESTRICTIONS_CANNOT_BE_MET:4012,HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,DASH_UNSUPPORTED_XLINK_ACTUATE:4027,
DASH_XLINK_DEPTH_LIMIT:4028,CONTENT_UNSUPPORTED_BY_BROWSER:4032,CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM:4033,NO_VARIANTS:4036,PERIOD_FLATTENING_FAILED:4037,INCONSISTENT_DRM_ACROSS_PERIODS:4038,HLS_VARIABLE_NOT_FOUND:4039,HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED:4040,HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED:4041,NO_WEB_CRYPTO_API:4042,CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_LIVE_STREAM:4045,AES_128_INVALID_IV_LENGTH:4048,AES_128_INVALID_KEY_LENGTH:4049,DASH_CONFLICTING_AES_128:4050,DASH_UNSUPPORTED_AES_128:4051,
DASH_INVALID_PATCH:4052,HLS_EMPTY_MEDIA_PLAYLIST:4053,DASH_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED:4054,CANNOT_ADD_EXTERNAL_CHAPTERS_TO_LIVE_STREAM:4055,WEBTRANSPORT_NOT_AVAILABLE:4056,WEBTRANSPORT_INITIALIZATION_FAILED:4057,MSF_VOD_CONTENT_NOT_SUPPORTED:4058,HLS_INVALID_KEY_IV_FOR_GCM:4059,HLS_INVALID_GCM_SEGMENT:4060,DASH_UNSUPPORTED_ESSENTIAL_PROPERTY:4063,MSF_CATALOG_TIMEOUT:4064,MSF_CONNECTION_CLOSED:4065,MSF_SUBSCRIBE_FAILED:4066,MSF_UNSUPPORTED_COMPRESSION:4067,MSF_UNSUPPORTED_CATALOG_VERSION:4068,
MKV_INVALID_FILE:4069,MKV_MISSING_INDEX:4070,MKV_NO_SUPPORTED_TRACKS:4071,STREAMING_ENGINE_STARTUP_INVALID_STATE:5006,NO_RECOGNIZED_KEY_SYSTEMS:6E3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,
EXPIRED:6014,SERVER_CERTIFICATE_REQUIRED:6015,INIT_DATA_TRANSFORM_ERROR:6016,SERVER_CERTIFICATE_REQUEST_FAILED:6017,MIN_HDCP_VERSION_NOT_MATCH:6018,ERROR_CHECKING_HDCP_VERSION:6019,MISSING_EME_SUPPORT:6020,LOAD_INTERRUPTED:7E3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,OBJECT_DESTROYED:7003,CONTENT_NOT_LOADED:7004,SRC_EQUALS_PRELOAD_NOT_SUPPORTED:7005,PRELOAD_DESTROYED:7006,QUEUE_INDEX_OUT_OF_BOUNDS:7007,CAST_API_UNAVAILABLE:8E3,NO_CAST_RECEIVERS:8001,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,
CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,STORAGE_NOT_SUPPORTED:9E3,INDEXED_DB_ERROR:9001,DEPRECATED_OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,NEW_KEY_OPERATION_NOT_SUPPORTED:9011,KEY_NOT_FOUND:9012,MISSING_STORAGE_CELL:9013,STORAGE_LIMIT_REACHED:9014,DOWNLOAD_SIZE_CALLBACK_ERROR:9015,MODIFY_OPERATION_NOT_SUPPORTED:9016,
INDEXED_DB_INIT_TIMED_OUT:9017,CS_IMA_SDK_MISSING:1E4,SS_IMA_SDK_MISSING:10002,CURRENT_DAI_REQUEST_NOT_FINISHED:10004,VAST_INVALID_XML:10007,CS_AD_CONTAINER_MISSING:10008,SS_AD_CONTAINER_MISSING:10009,MEDIATAILOR_REQUEST_FAILED:10010};function Cb(){}
function Db(a){if(!a)return"";a=S(a);a[0]==239&&a[1]==187&&a[2]==191&&(a=a.subarray(3));if(self.TextDecoder&&!R().Cg())return a=(new TextDecoder).decode(a),a.includes("\ufffd")&&Ta('Decoded string contains an "unknown character" codepoint.  That probably means the UTF8 encoding was incorrect!'),a;for(var b="",c=0;c<a.length;++c){var d=65533;(a[c]&128)==0?d=a[c]:a.length>=c+2&&(a[c]&224)==192&&(a[c+1]&192)==128?(d=(a[c]&31)<<6|a[c+1]&63,c+=1):a.length>=c+3&&(a[c]&240)==224&&(a[c+1]&192)==128&&(a[c+
2]&192)==128?(d=(a[c]&15)<<12|(a[c+1]&63)<<6|a[c+2]&63,c+=2):a.length>=c+4&&(a[c]&241)==240&&(a[c+1]&192)==128&&(a[c+2]&192)==128&&(a[c+3]&192)==128&&(d=(a[c]&7)<<18|(a[c+1]&63)<<12|(a[c+2]&63)<<6|a[c+3]&63,c+=3);if(d<=65535)b+=String.fromCharCode(d);else{d-=65536;var e=d&1023;b+=String.fromCharCode(55296+(d>>10));b+=String.fromCharCode(56320+e)}}return b}
function Eb(a,b,c){if(!a)return"";if(!c&&a.byteLength%2!=0)throw new T(2,2,2004);c=Math.floor(a.byteLength/2);var d=new Uint16Array(c);a=zb(a);for(var e=0;e<c;e++)d[e]=a.getUint16(e*2,b);return Fb.value()(d)}
function Gb(a){function b(d){return c.byteLength<=d||c[d]>=9&&c[d]<=126}if(!a)return"";var c=S(a);if(c[0]==239&&c[1]==187&&c[2]==191)return Db(c);if(c[0]==254&&c[1]==255)return Eb(c.subarray(2),!1);if(c[0]==255&&c[1]==254)return Eb(c.subarray(2),!0);if(c[0]==0&&c[2]==0)return Eb(a,!1);if(c[1]==0&&c[3]==0)return Eb(a,!0);if(b(0)&&b(1)&&b(2)&&b(3))return Db(a);throw new T(2,2,2003);}
function Hb(a){if(self.TextEncoder&&!R().Cg()){var b=new TextEncoder;return ub(b.encode(a))}a=encodeURIComponent(a);a=unescape(a);b=new Uint8Array(a.length);for(var c=0;c<a.length;c++)b[c]=a[c].charCodeAt(0);return ub(b)}function Ib(a,b){for(var c=new ArrayBuffer(a.length*2),d=new DataView(c),e=0;e<a.length;++e)d.setUint16(e*2,a.charCodeAt(e),b);return c}
function Jb(a){var b={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&apos;":"'","&nbsp;":"\u00a0","&lrm;":"\u200e","&rlm;":"\u200f"},c=/&(?:amp|lt|gt|quot|apos|nbsp|lrm|rlm|#[xX]?[0-9a-fA-F]+);/g,d=RegExp(c.source);return a&&d.test(a)?a.replace(c,function(e){return e[1]=="#"?(e=e[2]=="x"||e[2]=="X"?parseInt(e.substring(3),16):parseInt(e.substring(2),10),e>=0&&e<=1114111?String.fromCodePoint(e):""):b[e]||"'"}):a||""}I("shaka.util.StringUtils",Cb);Cb.resetFromCharCode=function(){Fb.h=void 0};
Cb.toUTF16=Ib;Cb.toUTF8=Hb;Cb.fromBytesAutoDetect=Gb;Cb.fromUTF16=Eb;Cb.fromUTF8=Db;var Fb=new ob(function(){function a(c){try{var d=new Uint8Array(c);return String.fromCharCode.apply(null,d).length>0}catch(e){return!1}}for(var b={uc:65536};b.uc>0;b={uc:b.uc},b.uc/=2)if(a(b.uc))return function(c){return function(d){for(var e="",f=0;f<d.length;f+=c.uc)e+=String.fromCharCode.apply(null,d.subarray(f,f+c.uc));return e}}(b);return null});function Kb(){}function Lb(a){a=S(a);return Uint8Array.prototype.toBase64?a.toBase64({alphabet:"base64",omitPadding:!1}):(a=Fb.value()(a),btoa(a))}function Mb(a,b){b=b==void 0?!0:b;return Uint8Array.prototype.toBase64?S(a).toBase64({alphabet:"base64url",omitPadding:!b}):(a=Lb(a).replace(/\+/g,"-").replace(/\//g,"_"),b?a:a.replace(/[=]*$/,""))}
function Nb(a){if(!("fromBase64"in Uint8Array)){a=self.atob(a.replace(/-/g,"+").replace(/_/g,"/"));for(var b=new Uint8Array(a.length),c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b}a=a.replace(/\s+/g,"");return Uint8Array.fromBase64(a,{alphabet:/[-_]/.test(a)?"base64url":"base64"})}function Ob(a){if(!("fromHex"in Uint8Array)){for(var b=a.length/2,c=new Uint8Array(b),d=0;d<b;d++)c[d]=parseInt(a.substr(d*2,2),16);return c}return Uint8Array.fromHex(a)}
function Pb(a){var b=S(a);if(!Uint8Array.prototype.toHex){a="";b=r(b);for(var c=b.next();!c.done;c=b.next())c=c.value,c=c.toString(16),c.length==1&&(c="0"+c),a+=c;return a}return b.toHex()}function Qb(){var a=Ha.apply(0,arguments);return Rb(a,0,a.length)}
function Rb(a,b,c){b=b===void 0?0:b;c=c===void 0?a.length:c;for(var d=0,e=b;e<c;++e)d+=a[e].byteLength;d=new Uint8Array(d);for(e=0;b<c;++b){var f=a[b];ArrayBuffer.isView(f)&&f.BYTES_PER_ELEMENT===1?d.set(f,e):d.set(S(f),e);e+=f.byteLength}return d}function Sb(a){for(var b=new Uint8Array(a.length),c=0,d=0,e=0;e<a.length;e++){var f=a[e];c>=2&&f==3?c=0:(b[d++]=f,f==0?c++:c=0)}return b.subarray(0,d)}I("shaka.util.Uint8ArrayUtils",Kb);Kb.concat=Qb;Kb.toHex=Pb;Kb.fromHex=Ob;Kb.fromBase64=Nb;
Kb.toBase64=Mb;Kb.toStandardBase64=Lb;function Tb(a,b){if(a===b||!a.length||!b.length)return!0;a=r(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;if(Ub(c))return!0;for(var d=r(b),e=d.next();!e.done;e=d.next())if(e=e.value,c.keySystem===e.keySystem||Ub(e))return!0}return!1}
function Vb(a,b){if(!a.length)return b;if(!b.length)return a;var c=[];a=r(a);for(var d=a.next();!d.done;d=a.next()){d=d.value;for(var e=r(b),f=e.next();!f.done;f=e.next())if(f=f.value,d.keySystem==f.keySystem){e=new Map;for(var g=r((d.initData||[]).concat(f.initData||[])),h=g.next();!h.done;h=g.next())h=h.value,e.set(h.keyId,h);e=Array.from(e.values());g=d.keyIds&&f.keyIds?new Set([].concat(F(d.keyIds),F(f.keyIds))):d.keyIds||f.keyIds;c.push({keySystem:d.keySystem,licenseServerUri:d.licenseServerUri||
f.licenseServerUri,distinctiveIdentifierRequired:d.distinctiveIdentifierRequired||f.distinctiveIdentifierRequired,persistentStateRequired:d.persistentStateRequired||f.persistentStateRequired,videoRobustness:d.videoRobustness||f.videoRobustness,audioRobustness:d.audioRobustness||f.audioRobustness,serverCertificate:d.serverCertificate||f.serverCertificate,serverCertificateUri:d.serverCertificateUri||f.serverCertificateUri,initData:e,keyIds:g});break}else Ub(d)?c.push(d):Ub(f)&&c.push(f)}return c}
function Wb(a){return a?a.keySystem:""}function Yb(a){return a==="org.w3.clearkey"}function Zb(a){return a?!!a.match(/^com\.widevine\.alpha/):!1}function $b(a){return a?!!a.match(/^com\.(microsoft|chromecast)\.playready/):!1}function ac(a){return a?!!a.match(/^com\.apple\.fps/):!1}function Ub(a){return(a=a.licenseServerUri)?a.startsWith("data:application/json;base64,"):!1}function bc(a,b,c,d){d=[].concat(F(new Set(d))).sort().join("#");return a+"#"+b+"#"+c+"#"+d}
function cc(){var a=!1,b=!0;a=a===void 0?!1:a;b=b===void 0?!1:b;var c={"1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","e2719d58-a985-b3c9-781a-b030af78d30e":"org.w3.clearkey","edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready","94ce86fb-07ff-4f43-adb8-93d2fa968ca2":"com.apple.fps","3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c":"com.huawei.wiseplay"};if(!a&&!b)return c;
var d={},e;for(e in c){var f=c[e],g=e;b?g="urn:uuid:"+e:a&&(g=e.replace(/-/g,""));d[g]=f}return d}function dc(a){return a.length===22?a:Mb(Ob(a),!1)}var ec=new ob(function(){return ub(new Uint8Array([0]))}),fc=new Map;function hc(){}function ic(a,b){a=jc(a);b=jc(b);return a.split("-")[0]==b.split("-")[0]}function kc(a,b){a=jc(a);b=jc(b);a=a.split("-");b=b.split("-");return a[0]==b[0]&&a.length==1&&b.length==2}function lc(a,b){a=jc(a);b=jc(b);a=a.split("-");b=b.split("-");return a.length==2&&b.length==2&&a[0]==b[0]}
function jc(a){a=r(a.split("-x-"));var b=a.next().value;b=b===void 0?"":b;a=a.next().value;a=a===void 0?"":a;var c=r(b.split("-"));b=c.next().value;b=b===void 0?"":b;c=c.next().value;c=c===void 0?"":c;a=a?"x-"+a:"";b=b.toLowerCase();b=mc.get(b)||b;c=c.toUpperCase();return(c?b+"-"+c:b)+(a?"-"+a:"")}function nc(a,b){a=jc(a);b=jc(b);return b==a?4:kc(b,a)?3:lc(b,a)?2:kc(a,b)?1:0}function oc(a){var b=a.indexOf("-");a=b>=0?a.substring(0,b):a;a=a.toLowerCase();return a=mc.get(a)||a}
function pc(a){return a.language?jc(a.language):a.audio&&a.audio.language?jc(a.audio.language):a.video&&a.video.language?jc(a.video.language):"und"}
function qc(a,b){a=jc(a);var c=new Set;b=r(b);for(var d=b.next();!d.done;d=b.next())c.add(jc(d.value));b=r(c);for(d=b.next();!d.done;d=b.next())if(d=d.value,d==a)return d;b=r(c);for(d=b.next();!d.done;d=b.next())if(d=d.value,kc(d,a))return d;b=r(c);for(d=b.next();!d.done;d=b.next())if(d=d.value,lc(d,a))return d;c=r(c);for(b=c.next();!b.done;b=c.next())if(b=b.value,kc(a,b))return b;return null}I("shaka.util.LanguageUtils",hc);hc.findClosestLocale=qc;hc.getLocaleForVariant=pc;
hc.getLocaleForText=function(a){return jc(a.language||"und")};hc.getBase=oc;hc.relatedness=nc;hc.areSiblings=function(a,b){var c=oc(a),d=oc(b);return a!=c&&b!=d&&c==d};hc.normalize=jc;hc.isSiblingOf=lc;hc.isParentOf=kc;hc.areLanguageCompatible=ic;hc.areLocaleCompatible=function(a,b){a=jc(a);b=jc(b);return a==b};
var mc=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 rc(a,b,c){b={keySystem:a,encryptionScheme:b,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:c||[],keyIds:new Set,mediaTypes:void 0};!c&&ac(a)&&b.initData.push({initDataType:"sinf",initData:new Uint8Array(0),keyId:null});return b}
function sc(a){var b=b===void 0?"cenc":b;var c=[],d=[],e=[],f=new Map;a.forEach(function(h,k){var l=dc(k);h=dc(h);var m={kty:"oct",kid:l,k:h};c.push(m);d.push(m.kid);e.push(k);f.set(l,h)});a=JSON.stringify({keys:c});var g=JSON.stringify({kids:d});g=[{initData:S(Hb(g)),initDataType:"keyids"}];return{keySystem:"org.w3.clearkey",encryptionScheme:b,licenseServerUri:"data:application/json;base64,"+window.btoa(a),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",
serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:g,keyIds:new Set(e),clearKeys:f}}function tc(a,b){if(b.length==1)return b[0];a=uc(a,b);if(a!=null)return a;throw new T(2,4,4025,b);}function uc(a,b){var c=vc.get(a);c=r(c);for(var d=c.next();!d.done;d=c.next()){d=d.value;for(var e=r(b),f=e.next();!f.done;f=e.next())if(f=f.value,d.test(f.trim()))return f.trim()}return a==wc?"":null}
function xc(a,b){if(a){var c=1;a=a.split(";");for(var d=r(a),e=d.next();!e.done;e=d.next()){var f=e.value;f.includes("=")?(f=f.split("="),e=f[0].startsWith("CC")?f[0]:"CC"+f[0],f=f[1]||"und"):(e="CC"+c,c+=a.length==2?2:1);b.set(e,jc(f))}}else b.set("CC1","und")}
function yc(a,b){if(a){var c=1;a=r(a.split(";"));for(var d=a.next();!d.done;d=a.next()){var e=d.value;e.includes("=")?(e=e.split("="),d="svc"+e[0],e=e[1].split(",")[0].split(":").pop()):(d="svc"+c,c++);b.set(d,jc(e))}}else b.set("svc1","und")}function zc(a,b){var c=[];a=vc.get(a);a=r(a);for(var d=a.next();!d.done;d=a.next()){d=d.value;for(var e=r(b),f=e.next();!f.done;f=e.next())f=f.value,d.test(f.trim())&&c.push(f.trim())}return c}
var wc="text",Ac={oa:"video",X:"audio",Xa:wc,Ui:"image",vl:"application",Si:"chapter"},Bc=1/15,vc=(new Map).set("audio",[/^vorbis$/,/^Opus$/,/^opus$/,/^fLaC$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4/,/^dts[cehx]?$/,/^iamf/,/^mhm[12]/,/^ac3$/,/^eac3$/,/^apac$/]).set("video",[/^avc/,/^hev/,/^hvc/,/^vvc/,/^vvi/,/^vp0?[89]/,/^av0[12]/,/^mp2v/,/^dvh/,/^dva/,/^dav/]).set("text",[/^vtt$/,/^wvtt/,/^stpp/]);function Cc(a,b,c,d){this.h=null;this.m=a;this.j=b;this.o=c;this.l=d;typeof libDPIModule==="undefined"&&Ua("Could not find LCEVC Library dependencies on this page");typeof LCEVCdec!=="undefined"?(this.i=LCEVCdec,typeof this.i.SupportObject==="undefined"?(Ua("Could not find LCEVC Library on this page"),a=!1):(this.i.SupportObject.SupportStatus||Ua(this.i.SupportObject.SupportError),a=typeof this.i!=="undefined"&&typeof libDPIModule!=="undefined"&&this.j instanceof HTMLCanvasElement&&this.i.SupportObject.SupportStatus)):
(Ua("Could not find LCEVC Library on this page"),a=!1);a&&!this.h&&this.i.SupportObject.webGLSupport(this.j)&&(this.j.classList.remove("shaka-hidden"),this.h=new this.i.LCEVCdec(this.m,this.j,this.o))}function Dc(a,b,c,d){d.type!=="video"||a.l&&!Ec(d)||a.h&&a.h.appendBuffer(b,"video",d.id,-c,!a.l)}function Fc(a){a.h&&a.j.classList.add("shaka-hidden")}Cc.prototype.release=function(){this.h&&(this.h.close(),this.h=null)};function Ec(a){return a&&typeof LCEVCdec!=="undefined"?a.codecs=="lvc1":!1}
I("shaka.lcevc.Dec",Cc);Cc.prototype.release=Cc.prototype.release;function Gc(){}function Hc(a,b){Ic.set(a,b)}function Jc(){var a={};R();if(Kc())for(var b=r(Ic.keys()),c=b.next();!c.done;c=b.next())a[c.value]=!0;b=r(["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","audio/x-mpegurl"]);for(c=b.next();!c.done;c=b.next())c=c.value,a[c]=Kc()?Ic.has(c):Lc().canPlayType(c)!="";return a}function Mc(a,b){if(b){var c=Ic.get(b);if(c)return c}throw new T(2,4,4E3,a,b);}I("shaka.media.ManifestParser",Gc);Gc.unregisterParserByMime=function(a){Ic.delete(a)};
Gc.registerParserByMime=Hc;Gc.AccessibilityPurpose={$l:"visually impaired",El:"hard of hearing",Vl:"spoken subtitles"};var Ic=new Map;function Nc(){}q=Nc.prototype;q.extract=function(){};q.extractRaw608=function(){};q.decode=function(){return[]};q.clear=function(){};q.getStreams=function(){return[]};function Oc(){}Oc.prototype.init=function(){};Oc.prototype.parse=function(){return[]};function Pc(a){this.i=new Map;this.j=0;this.l=new Oc;if(a=Qc(a.toLowerCase()))this.l=a();this.h=new Nc;if(a=Rc)this.h=a(),this.i.set(this.j,this.h)}Pc.prototype.init=function(a,b,c){b=b===void 0?!1:b;c=c===void 0?-1:c;c!=-1&&this.j!=c?Sc(this,c):b||this.h.clear();this.l.init(a);c!=-1&&(this.j=c)};
function Tc(a,b){b=a.l.parse(b);b=r(b);for(var c=b.next();!c.done;c=b.next()){c=c.value;var d=S(c.packet);if(d.length>0)switch(c.format){case Uc:a.h.extract(d,c.pts);break;case Vc:a.h.extractRaw608(d,c.pts)}}return a.h.decode()}function Sc(a,b){a.i.set(a.j,a.h);a.h=a.i.getOrInsertComputed(b,function(){var c=Rc;return c?c():a.h})}
Pc.prototype.remove=function(a){a=a===void 0?[]:a;a=new Set(a);for(var b=r(this.i.keys()),c=b.next();!c.done;c=b.next())if(c=c.value,!a.has(c)){var d=this.i.get(c);d&&d.clear();this.i.delete(c)}};function Wc(a,b){Xc.set(a,b)}function Qc(a){return Xc.get(a)}I("shaka.media.ClosedCaptionParser",Pc);Pc.findDecoder=function(){return Rc};Pc.unregisterDecoder=function(){Rc=null};Pc.registerDecoder=function(a){Rc=a};Pc.findParser=Qc;Pc.unregisterParser=function(a){Xc.delete(a)};Pc.registerParser=Wc;
var Xc=new Map,Rc=null,Uc="sei",Vc="raw608";function Yc(){this.id="";this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0;this.height=this.width=100;this.viewportAnchorUnits=this.widthUnits=this.heightUnits=Zc;this.scroll=$c;this.backgroundColor="";this.opacity=1;this.overflow=this.padding="";this.zIndex=null}
Yc.prototype.clone=function(){var a=new Yc;a.id=this.id;a.viewportAnchorX=this.viewportAnchorX;a.viewportAnchorY=this.viewportAnchorY;a.regionAnchorX=this.regionAnchorX;a.regionAnchorY=this.regionAnchorY;a.width=this.width;a.height=this.height;a.heightUnits=this.heightUnits;a.widthUnits=this.widthUnits;a.viewportAnchorUnits=this.viewportAnchorUnits;a.scroll=this.scroll;a.backgroundColor=this.backgroundColor;a.opacity=this.opacity;a.padding=this.padding;a.overflow=this.overflow;a.zIndex=this.zIndex;
return a};I("shaka.text.CueRegion",Yc);Yc.prototype.clone=Yc.prototype.clone;var Zc=1;Yc.units={PX:0,PERCENTAGE:Zc,LINES:2};var $c="";Yc.scrollMode={NONE:$c,UP:"up"};function ad(a){this.i=a||"";this.h=0}function bd(a,b){for(var c=cd(a);c;)b(c),dd(a,/[ \t]+/gm),c=cd(a)}function dd(a,b){b.lastIndex=a.h;b=b.exec(a.i);b=b==null?null:{position:b.index,length:b[0].length,results:b};if(a.h==a.i.length||b==null||b.position!=a.h)return null;a.h+=b.length;return b.results}function cd(a){return a.h==a.i.length?null:(a=dd(a,/[^ \t\n]*/gm))?a[0]:null}
function ed(a){a=dd(a,fd);if(a==null)return null;var b=Number(a[2]),c=Number(a[3]);return b>59||c>59?null:(Number(a[6])||0)/1E3+c+b*60+(Number(a[1])||0)*3600}function gd(a){return a?ed(new ad(a)):null}var fd=/(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;function hd(){}function id(a){function b(d){switch(typeof d){case "undefined":case "boolean":case "number":case "string":case "symbol":case "function":return d;default:if(!d||ArrayBuffer.isView(d))return d;if(c.has(d))return null;var e=Array.isArray(d);if(d.constructor!=Object&&!e)return null;c.add(d);var f=e?[]:{},g;for(g in d)f[g]=b(d[g]);e&&(f.length=d.length);return f}}var c=new WeakSet;return b(a)}function jd(a){var b={},c;for(c in a)b[c]=a[c];return b}
function kd(a){if(Array.isArray(a)){for(var b=[],c=0;c<a.length;c++){var d=c.toString(),e=a[c];e!==void 0&&(e=kd(e))&&b.push(d+":"+e)}a="["+b.join(",")+"]"}else if(typeof a=="function")a="";else if(a instanceof Object){c=Object.keys(a);c.sort();b=[];c=r(c);for(d=c.next();!d.done;d=c.next())e=d.value,d=JSON.stringify(e),e=a[e],e!==void 0&&(e=kd(e))&&b.push(d+":"+e);a="{"+b.join(",")+"}"}else a=JSON.stringify(a);return a}I("shaka.util.ObjectUtils",hd);hd.alphabeticalKeyOrderStringify=kd;
hd.shallowCloneObject=jd;hd.cloneObject=id;/*
 @license
 tXml
 Copyright 2015 Tobias Nickel
 SPDX-License-Identifier: MIT
*/
function ld(a,b){var c=c===void 0?!1:c;a=Gb(a);return md(a,b,c)}function md(a,b,c){a=nd(a,c===void 0?!1:c);if(!b&&a.length)return a[0];var d=b.split(",");return(b=a.find(function(e){return d.includes(e.tagName)}))?b:null}function od(a){return pd.has(a)?pd.get(a):""}
function nd(a,b){function c(h,k){k=k===void 0?!1:k;for(var l=[];a[e];)if(a.charCodeAt(e)==60){if(a.charCodeAt(e+1)===47){k=e+2;e=a.indexOf(">",e);k=a.substring(k,e);var m=k.indexOf(h);if(m==-1){var n=h.indexOf(".");n>0&&(m=k.indexOf(h.substring(0,n)))}if(m==-1)throw h=a.substring(0,e).split("\n"),Error("Unexpected close tag\nLine: "+(h.length-1)+"\nColumn: "+(h[h.length-1].length+1)+"\nChar: "+a[e]);e+1&&(e+=1);break}else if(a.charCodeAt(e+1)===33){if(a.charCodeAt(e+2)==45){for(;e!==-1&&(a.charCodeAt(e)!==
62||a.charCodeAt(e-1)!=45||a.charCodeAt(e-2)!=45||e==-1);)e=a.indexOf(">",e+1);e===-1&&(e=a.length)}else if(a.charCodeAt(e+2)===91&&a.charCodeAt(e+8)===91&&a.substr(e+3,5).toLowerCase()==="cdata"){m=a.indexOf("]]\x3e",e);m==-1?(l.push(a.substr(e+9)),e=a.length):(l.push(a.substring(e+9,m)),e=m+3);continue}e++;continue}if(f>512)throw Error("XML is too deeply nested");f++;a:{n=k;e++;var p=d(),t={};for(m=[];a.charCodeAt(e)!==62&&a[e];){var u=a.charCodeAt(e);if(u>64&&u<91||u>96&&u<123){u=d();for(var v=
a.charCodeAt(e);v&&v!==39&&v!==34&&!(v>64&&v<91||v>96&&v<123)&&v!==62;)e++,v=a.charCodeAt(e);var w=e+1;e=a.indexOf(a[e],w);w=(" "+a.slice(w,e)).slice(1);if(v===39||v===34){if(e===-1){n={tagName:p,attributes:t,children:m,parent:null};if(b)for(p=0;p<m.length;p++)typeof m[p]!=="string"&&(m[p].parent=n);m=n;break a}}else w=null,e--;if(u.startsWith("xmlns:")){v=w;var x=u.split(":")[1];pd.set(v,x);qd.set(x,v)}t[u]=w}e++}g.push(t);b:if(u=p,w=u.indexOf(":"),u=w<0?"":u.substring(0,w),u=="xml")u="http://www.w3.org/XML/1998/namespace";
else{w=u?"xmlns:"+u:"xmlns";for(v=g.length-1;v>=0;--v)if(x=g[v][w],x!=null){u=x||(u?null:"");break b}u=u?null:""}if(t["xml:space"]=="preserve"||t["xml:space"]=="default")n=t["xml:space"]=="preserve";a.charCodeAt(e-1)!==47?(e++,m=c(p,n)):e++;g.pop();n={tagName:p,attributes:t,children:m,parent:null};rd.set(n,u);p=m.length;for(t=0;t<p;t++)u=m[t],typeof u!=="string"?b&&(u.parent=n):t==p-1&&u=="\n"&&m.pop();m=n}f--;l.push(m);if(typeof m==="string")break;m.tagName[0]==="?"&&m.children&&(l.push.apply(l,
F(m.children)),m.children=[])}else m=e,e=a.indexOf("<",e)-1,e===-2&&(e=a.length),m=(" "+a.slice(m,e+1)).slice(1),k?m.length>0&&l.push(m):l.length&&m.length==1&&m[0]=="\n"?l.push(m):m.trim().length>0&&l.push(m),e++;return l}function d(){for(var h=e;"\r\n\t>/= ".indexOf(a[e])===-1&&a[e];)e++;return(" "+a.slice(h,e)).slice(1)}var e=0,f=0,g=[];return c("")}function sd(a){return typeof a==="string"}
function td(a){var b=[];if(!a.children)return[];a=r(a.children);for(var c=a.next();!c.done;c=a.next())c=c.value,typeof c!=="string"&&b.push(c);return b}function ud(a,b){var c=[];if(!a.children)return[];a=r(a.children);for(var d=a.next();!d.done;d=a.next())d=d.value,d.tagName===b&&c.push(d);return c}function vd(a){if(typeof a==="string")return Jb(a);var b=[];a=r(a.children);for(var c=a.next();!c.done;c=a.next())c=c.value,typeof c==="string"&&b.push(c);b=b.join("");return b===""?null:Jb(b)}
function wd(a){for(var b=r(a.children),c=b.next();!c.done;c=b.next())if(typeof c.value!=="string")return null;(a=vd(a))&&(a=a.trim());return a}function xd(a,b,c){c=c===void 0?[]:c;a.tagName===b&&c.push(a);if(a.children){a=r(a.children);for(var d=a.next();!d.done;d=a.next())xd(d.value,b,c)}return c}function yd(a,b,c,d){d=d===void 0?[]:d;zd(a,b,c)&&d.push(a);a=r(td(a));for(var e=a.next();!e.done;e=a.next())yd(e.value,b,c,d);return d}
function zd(a,b,c){if(typeof a=="string")return!1;var d=a.tagName.indexOf(":");if(a.tagName.substring(d+1)!=c)return!1;c=rd.get(a);if(c===void 0){for(var e=d<0?"xmlns":"xmlns:"+a.tagName.substring(0,d);a;a=a.parent)if(a.attributes[e]!=null){c=a.attributes[e];break}c===void 0&&(c=d<0?"":null);d>=0&&c==""&&(c=null)}return c!=null&&(typeof b=="string"?c==b:b.includes(c))}function Ad(a,b){a=ud(a,b);return a.length!=1?null:a[0]}function Bd(a,b,c){a=Cd(a,b,c);return a.length!=1?null:a[0]}
function Dd(a,b,c,d){d=d===void 0?null:d;var e=null;a=a.attributes[b];a==null||a===""&&d!==null||(e=c(a));return e==null?d:e}function Ed(a,b,c){b=od(b);return a.attributes[b+":"+c]||null}function Cd(a,b,c){return td(a).filter(function(d){return zd(d,b,c)})}function Fd(a,b,c){b=r(b);for(var d=b.next();!d.done;d=b.next())if(d=Ed(a,d.value,c))return d;return null}function Gd(a){if(!a)return null;/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(a)&&(a+="Z");a=Date.parse(a);return isNaN(a)?null:a/1E3}
function Hd(a){if(!a)return null;a=RegExp("^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$","i").exec(a);if(!a)return null;a=31536E3*Number(a[1]||null)+2592E3*Number(a[2]||null)+86400*Number(a[3]||null)+3600*Number(a[4]||null)+60*Number(a[5]||null)+Number(a[6]||null);return isFinite(a)?a:null}
function Id(a){var b=/([0-9]+)-([0-9]+)/.exec(a);if(!b)return null;a=Number(b[1]);if(!isFinite(a))return null;b=Number(b[2]);return isFinite(b)?{start:a,end:b}:null}function Jd(a){a=Number(a);return a%1===0?a:null}function Kd(a){a=Number(a);return a%1===0&&a>0?a:null}function Ld(a){a=Number(a);return a%1===0&&a>=0?a:null}function Md(a){a=Number(a);return isNaN(a)?null:a}function Nd(a){return a.split(/\s+/).filter(function(b){return b.length>0})}
function Od(a){return a?a.toLowerCase()==="true":!1}function Pd(a){var b;var c=(b=a.match(/^(\d+)\/(\d+)$/))?Number(b[1])/Number(b[2]):Number(a);return isNaN(c)?null:c}
function Qd(a){var b=[];a=Jb(a).split(/\/+(?=(?:[^'"]*['"][^'"]*['"])*[^'"]*$)/);a=r(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=c.match(/^([\w]+)/);if(d){var e=c.match(/(@id='(.*?)')/),f=c.match(/(@t='(\d+)')/),g=c.match(/(@n='(\d+)')/),h=c.match(/\[(\d+)\]/);b.push({name:d[0],id:e?e[0].match(/'(.*?)'/)[0].replace(/'/gm,""):null,t:f?Number(f[0].match(/'(.*?)'/)[0].replace(/'/gm,"")):null,n:g?Number(g[0].match(/'(.*?)'/)[0].replace(/'/gm,"")):null,position:h?Number(h[1])-1:null,Wb:c.split("/@")[1]||
null})}else c.startsWith("@")&&b.length&&(b[b.length-1].Wb=c.slice(1))}return b}
function Rd(a,b){var c=Qd(b.attributes.sel||"");if(c.length){var d=c[c.length-1],e=b.attributes.pos||null;c=d.position;c==null&&(d.t!==null&&(c=Sd(a,"t",d.t)),d.n!==null&&(c=Sd(a,"n",d.n)));c===null?c=e==="prepend"?0:a.length:e==="prepend"?--c:e==="after"&&++c;e=b.tagName;(d=d.Wb)&&a[c]?Td(a[c],e,d,wd(b)||""):(e!=="remove"&&e!=="replace"||a.splice(c,1),e!=="add"&&e!=="replace"||a.splice.apply(a,[c,0].concat(F(b.children))))}}
function Sd(a,b,c){var d=0;a=r(a);for(var e=a.next();!e.done;e=a.next()){if(Number(e.value.attributes[b])===c)return d;d++}return null}function Td(a,b,c,d){if(b==="remove")delete a.attributes[c];else if(b==="add"||b==="replace")a.attributes[c]=d}
function Ud(a){if(!a)return null;var b={tagName:a.tagName,attributes:jd(a.attributes),children:[],parent:null};if(rd.has(a)){var c;rd.set(b,(c=rd.get(a))!=null?c:null)}a=r(a.children);for(c=a.next();!c.done;c=a.next())c=c.value,typeof c==="string"?b.children.push(c):(c=Ud(c),c.parent=b,b.children.push(c));return b}var pd=new Map,qd=new Map,rd=new WeakMap;function Vd(a,b,c){this.startTime=a;this.endTime=b;this.payload=c;this.region=new Yc;this.position=null;this.positionAlign=Wd;this.size=0;this.textAlign=Xd;this.direction=Yd;this.writingMode=Zd;this.lineInterpretation=$d;this.line=null;this.lineHeight="";this.lineAlign=ae;this.displayAlign=be;this.fontSize=this.border=this.backgroundImage=this.backgroundColor=this.color="";this.fontWeight=ce;this.fontStyle=de;this.linePadding=this.letterSpacing=this.fontFamily="";this.opacity=1;this.visibility=this.textCombineUpright=
"";this.textDecoration=[];this.textStrokeWidth=this.textStrokeColor=this.textShadow="";this.wrapLine=!0;this.id="";this.nestedCues=[];this.lineBreak=this.isContainer=!1;this.rubyTag=null;this.cellResolution={columns:32,rows:15}}function ee(a,b){a=new Vd(a,b,"");a.lineBreak=!0;return a}
Vd.prototype.clone=function(){function a(d){if(d===null||typeof d!=="object")return d;if(Array.isArray(d))return d.map(a);if(d instanceof Vd)return d.clone();if(d instanceof Yc)return d.clone();var e={},f;for(f in d)e[f]=a(d[f]);return e}var b=new Vd(0,0,""),c;for(c in this)b[c]=a(this[c]);return b};
function fe(a,b){if(a.payload!=b.payload||!(Math.abs(a.startTime-b.startTime)<.001&&Math.abs(a.endTime-b.endTime)<.001))return!1;for(var c in a)if(c!="startTime"&&c!="endTime"&&c!="payload")if(c=="nestedCues"){if(!gb(a.nestedCues,b.nestedCues,fe))return!1}else if(c=="region"||c=="cellResolution")for(var d in a[c]){if(a[c][d]!=b[c][d])return!1}else if(Array.isArray(a[c])){if(!gb(a[c],b[c]))return!1}else if(a[c]!=b[c])return!1;return!0}
function ge(a,b){b=b===void 0?new Map:b;var c=a.payload;if(c.includes("<")){b.size===0&&he(b);var d=c;c=[];for(var e=-1,f=0;f<d.length;f++)d[f]==="<"?e=f+1:d[f]===">"&&e>0&&(e=d.substr(e,f-e),e.match(ie)&&c.push(e),e=-1);c=r(c);for(f=c.next();!f.done;f=c.next())f=f.value,d=d.replace("<"+f+">",'<div time="'+f+'">'),d+="</div>";a:{f=d;e=[];var g=-1;c="";d=!1;for(var h=0;h<f.length;h++)if(f[h]==="/"){var k=f.indexOf(">",h);if(k===-1){c=f;break a}if((k=f.substring(h+1,k))&&k=="v"){d=!0;var l=null;e.length&&
(l=e[e.length-1]);if(l){if(l===k)c+="/"+k+">";else{if(!l.startsWith("v")){c+=f[h];continue}c+="/"+l+">"}h+=k.length+1}else c+=f[h]}else c+=f[h]}else f[h]==="<"?(g=h+1,f[g]!="v"&&(g=-1)):f[h]===">"&&g>0&&(e.push(f.substr(g,h-g)),g=-1),c+=f[h];f=r(e);for(e=f.next();!e.done;e=f.next())e=e.value,g=e.replace(" ",".voice-"),c=c.replace("<"+e+">","<"+g+">"),c=c.replace("</"+e+">","</"+g+">"),d||(c+="</"+g+">")}c=le(c);a.payload="";d="<span>"+c.replace(/\n/g,"<br />")+"</span>";try{var m=md(d,"span")}catch(n){}if(m)if(m=
m.children,m.length!=1||m[0].tagName)for(m=r(m),c=m.next();!c.done;c=m.next())me(c.value,a,b);else a.payload=Jb(c);else a.payload=Jb(c)}else a.payload=Jb(c)}function he(a){for(var b=r(Object.entries(ne)),c=b.next();!c.done;c=b.next()){var d=r(c.value);c=d.next().value;d=d.next().value;var e=new Vd(0,0,"");e.color=d;a.set("."+c,e)}b=r(Object.entries(oe));for(c=b.next();!c.done;c=b.next())d=r(c.value),c=d.next().value,d=d.next().value,e=new Vd(0,0,""),e.backgroundColor=d,a.set("."+c,e)}
function le(a){var b={"< ":""," >":" &gt;"},c=/(< +>|<\s|\s>)/g,d=RegExp(c.source);return a&&d.test(a)?a.replace(c,function(e){return b[e]||""}):a||""}
function me(a,b,c){var d=b.clone();d.nestedCues=[];d.payload="";d.rubyTag="";d.line=null;d.region=new Yc;d.position=null;d.size=0;d.textAlign=Xd;if(a.tagName)for(var e=r(a.tagName.split(/(?=[ .])+/g)),f=e.next();!f.done;f=e.next()){var g=f=f.value;if(g.startsWith(".voice-")){var h=g.split("-").pop();g='v[voice="'+h+'"]';c.has(g)||(g="v[voice="+h+"]")}c.has(g)&&(h=d,g=c.get(g))&&(h.backgroundColor=g.backgroundColor||h.backgroundColor,h.color=g.color||h.color,h.fontFamily=g.fontFamily||h.fontFamily,
h.fontSize=g.fontSize||h.fontSize,h.textShadow=g.textShadow||h.textShadow,h.fontWeight=g.fontWeight,h.fontStyle=g.fontStyle,h.opacity=g.opacity,h.rubyTag=g.rubyTag,h.textCombineUpright=g.textCombineUpright,h.wrapLine=g.wrapLine);switch(f){case "br":d=ee(d.startTime,d.endTime);b.nestedCues.push(d);return;case "b":d.fontWeight=pe;break;case "i":d.fontStyle=qe;break;case "u":d.textDecoration.push(re);break;case "font":if(f=a.attributes.color)d.color=f;break;case "div":f=a.attributes.time;if(!f)break;
if(f=gd(f))d.startTime=f;break;case "ruby":case "rp":case "rt":d.rubyTag=f}}e=a.children;if(sd(a)||e.length==1&&sd(e[0]))for(c=vd(a).split("\n"),a=!0,c=r(c),e=c.next();!e.done;e=c.next())e=e.value,a||(a=ee(d.startTime,d.endTime),b.nestedCues.push(a)),e.length>0&&(a=d.clone(),a.payload=Jb(e),b.nestedCues.push(a)),a=!1;else for(b.nestedCues.push(d),b=r(e),a=b.next();!a.done;a=b.next())me(a.value,d,c)}I("shaka.text.Cue",Vd);Vd.parseCuePayload=ge;Vd.equal=fe;Vd.prototype.clone=Vd.prototype.clone;
var Wd="auto";Vd.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:Wd};var Xd="center",se={LEFT:"left",RIGHT:"right",CENTER:Xd,START:"start",END:"end"};Vd.textAlign=se;var be="after",te={BEFORE:"before",CENTER:"center",AFTER:be};Vd.displayAlign=te;var Yd="ltr";Vd.direction={HORIZONTAL_LEFT_TO_RIGHT:Yd,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var Zd="horizontal-tb";Vd.writingMode={HORIZONTAL_TOP_TO_BOTTOM:Zd,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};
var $d=0;Vd.lineInterpretation={LINE_NUMBER:$d,PERCENTAGE:1};var ae="start",ue={CENTER:"center",START:ae,END:"end"};Vd.lineAlign=ue;var ne={white:"white",lime:"lime",cyan:"cyan",red:"red",yellow:"yellow",magenta:"magenta",blue:"blue",black:"black"};Vd.defaultTextColor=ne;var oe={bg_white:"white",bg_lime:"lime",bg_cyan:"cyan",bg_red:"red",bg_yellow:"yellow",bg_magenta:"magenta",bg_blue:"blue",bg_black:"black"};Vd.defaultTextBackgroundColor=oe;var ce=400,pe=700;Vd.fontWeight={NORMAL:ce,BOLD:pe};
var de="normal",qe="italic",ve={NORMAL:de,ITALIC:qe,OBLIQUE:"oblique"};Vd.fontStyle=ve;var re="underline";Vd.textDecoration={UNDERLINE:re,LINE_THROUGH:"line-through",OVERLINE:"overline"};var ie=/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g;function we(){}we.prototype.destroy=function(){};function xe(a,b){for(var c=r(ye),d=c.next();!d.done;d=c.next()){a:{var e=a;d=d.value;d=d===void 0?null:d;e=ze(e);d=r(d!==null?[d]:ye);for(var f=d.next();!f.done;f=d.next())if(f=Ae.get(e+"-"+f.value)){e=f.Ve;break a}e=null}if(e){d=void 0;try{d=e()}catch(g){continue}f=!1;try{f=d.isSupported(a,b)}catch(g){}finally{d.destroy()}if(f)return e}}return null}
function Be(a,b){a=ze(a);for(var c=r(ye),d=c.next();!d.done;d=c.next()){d=d.value;var e=Ae.get(a+"-"+d);if(e&&e.Ve===b)return d}return null}function ze(a){return a.toLowerCase().split(";")[0]}I("shaka.transmuxer.TransmuxerEngine",we);we.findTransmuxer=xe;we.unregisterTransmuxer=function(a,b){Ae.delete(ze(a)+"-"+b)};we.registerTransmuxer=function(a,b,c){Ae.set(ze(a)+"-"+c,{priority:c,Ve:b})};we.prototype.destroy=we.prototype.destroy;var Ae=new Map;
we.PluginPriority={FALLBACK:1,PREFERRED_SECONDARY:2,PREFERRED:3,APPLICATION:4};var ye=[4,3,2,1];function Ce(){}function De(a,b){var c=a;b&&!Ee.includes(a)&&(c+='; codecs="'+b+'"');return c}function Fe(a,b){b&&(a+='; codecs="'+b+'"');return a}function Ge(a,b,c){var d=De(a,b);b=Fe(a,b);xe(b)?(a=xe(b))?(a=a(),c=a.convertCodecs(c,b),a.destroy()):c=b:c=a!="video/mp2t"&&c=="audio"?d.replace("video","audio"):d;return c}function He(a){return a.split(";")[0].split("/")[1]}
function Ie(a){var b=Je(a);a=b[0].toLowerCase();b=b[1].toLowerCase();switch(!0){case a==="mp4a"&&b==="69":case a==="mp4a"&&b==="6b":case a==="mp4a"&&b==="40.34":return"mp3";case a==="mp4a"&&b==="66":case a==="mp4a"&&b==="67":case a==="mp4a"&&b==="68":case a==="mp4a"&&b==="40.2":case a==="mp4a"&&b==="40.02":case a==="mp4a"&&b==="40.5":case a==="mp4a"&&b==="40.05":case a==="mp4a"&&b==="40.29":case a==="mp4a"&&b==="40.42":return"aac";case a==="mp4a"&&b==="a5":case a==="ac3":case a==="ac-3":return"ac-3";
case a==="mp4a"&&b==="a6":case a==="eac3":case a==="ec-3":return"ec-3";case a==="ac-4":return"ac-4";case a==="mp4a"&&b==="b2":return"dtsx";case a==="mp4a"&&b==="a9":return"dtsc";case a==="vp09":case a==="vp9":return"vp9";case a==="avc1":case a==="avc3":return"avc";case a==="hvc1":case a==="hev1":return"hevc";case a==="vvc1":case a==="vvi1":return"vvc";case a==="dvh1":case a==="dvhe":return b&&b.startsWith("05")?"dovi-p5":"dovi-hevc";case a==="dvav":case a==="dva1":return"dovi-avc";case a==="dav1":return"dovi-av1";
case a==="dvc1":case a==="dvi1":return"dovi-vvc";case a==="lvc1":return"lcevc"}return a}function Ke(a){var b=[];a=r(a.split(","));for(var c=a.next();!c.done;c=a.next())c=Je(c.value),b.push(c[0]);return b.sort().join(",")}function Le(a){return a.split(";")[0]}function Me(a){a=a.split(/ *; */);a.shift();return(a=a.find(function(b){return b.startsWith("codecs=")}))?a.split("=")[1].replace(/^"|"$/g,""):""}
function Ne(a){return a==="application/x-mpegurl"||a==="application/vnd.apple.mpegurl"||a==="audio/x-mpegurl"}function Oe(a,b){var c=R(),d=a.toLowerCase();return d=="flac"?c.Ba()!="WEBKIT"?"flac":"fLaC":d==="opus"?c.Ba()!="WEBKIT"?"opus":He(b)=="mp4"?"Opus":"opus":d=="ac-3"&&c.ug()?"ec-3":a}function Pe(a,b){a=a.split(",").map(function(d){return d.trim()});var c=uc("audio",a);return a.map(function(d){return d==c?Oe(d,b):Qe(d)}).join(",")}
function Qe(a){if(a.includes("avc1")){var b=a.split(".");if(b.length==3)return a=b.shift()+".",a+=parseInt(b.shift(),10).toString(16),a+=("000"+parseInt(b.shift(),10).toString(16)).slice(-4)}else if(a=="vp9")return"vp09.00.41.08";return a}function Je(a){a=a.split(".");var b=a[0];a.shift();return[b,a.join(".")]}I("shaka.util.MimeUtils",Ce);Ce.getFullTypeWithAllCodecs=Fe;Ce.getFullType=De;
(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");var Re="application/cea-608",Se="application/cea-708",Ee=["audio/aac","audio/ac3","audio/ec3","audio/mpeg"];function Te(a,b){this.m=null;this.l=a;this.F=b===void 0?"UNKNOWN":b;this.D=this.K=this.I=!1;this.u=new Map;this.j=new Map;this.A=0;this.C=Infinity;this.i=this.h=null;this.H="";this.G=function(){};this.o=new Map}function Ue(a,b){Ve.set(a,b)}function We(a){return Ve.get(a)}function Xe(a){return Ve.has(a)?!0:a==Re||a==Se?!!Rc:!1}Te.prototype.destroy=function(){this.l=this.m=null;this.u.clear();this.j.clear();this.o.clear();return Promise.resolve()};
function Ye(a,b,c,d,e,f){f=f===void 0?-1:f;var g,h,k,l,m,n,p,t,u;return H(function(v){if(v.i==1)return a.D||a.u.has(f)?v.h(Promise.resolve(),2):(g=a.j.get(f)||[],g.push({buffer:b,startTime:c,endTime:d,uri:e,kj:f}),a.j.set(f,g),v.return());if(!a.m||!a.l)return v.return();if(c==null||d==null)return a.m.parseInit(S(b)),v.return();h=a.D?0:a.u.get(f);k=a.I||a.D?c:a.u.get(f);l={periodStart:h,segmentStart:c,segmentEnd:d,vttOffset:k,isMpegTs:a.K};m=a.m.parseMedia(S(b),l,e,[]);n=r(m);for(p=n.next();!p.done;p=
n.next())t=p.value,a.G(t,e||null,l);u=m.filter(function(w){return w.startTime>=a.A&&w.startTime<a.C});a.l.append(u);a.h==null&&(a.h=Math.max(c,a.A));a.i=Math.min(d,a.C);v.l()})}
Te.prototype.remove=function(a,b,c){c=c===void 0?!1:c;var d=this,e,f,g,h,k,l,m,n;return H(function(p){if(p.i==1)return p.h(Promise.resolve(),2);if(a>=b||c&&(Ze(d,a,b),d.H===""))return p.return();e=function(t){return t.startTime<b&&t.endTime>a};f=r(d.j.keys());for(g=f.next();!g.done;g=f.next()){h=g.value;k=d.j.get(h);l=[];for(m=0;m<k.length;m++)n=k[m],e(n)||l.push(n);d.j.set(h,l)}d.l&&d.l.remove(a,b)&&d.h!=null&&(b<=d.h||a>=d.i||(a<=d.h&&b>=d.i?d.h=d.i=null:a<=d.h&&b<d.i?d.h=b:a>d.h&&b>=d.i&&(d.i=
a)),$e(d));p.l()})};function af(a,b,c){c=c===void 0?-1:c;(!a.u.has(c)||a.F!=="HLS"||a.F==="HLS"&&c===-1&&a.u.get(c)===0)&&a.u.set(c,b);b=a.j.get(c)||[];for(var d=0;d<b.length;d++){var e=b[d];Ye(a,e.buffer,e.startTime,e.endTime,e.uri,e.kj)}a.j.set(c,[])}function bf(a,b){a.K=b}function cf(a,b,c){a.A=b;a.C=c}function df(a,b,c){a.H=b;if(b=a.o.get(b))b=b.filter(function(d){return d.endTime<=c}),b.length&&a.l.append(b)}
function ef(a,b,c){b.startTime+=c;b.endTime+=c;b=r(b.nestedCues);for(var d=b.next();!d.done;d=b.next())ef(a,d.value,c)}
function ff(a,b,c){var d=new Map;b=r(b);for(var e=b.next();!e.done;e=b.next()){var f=e.value;e=f.stream;f=f.cue;d.getOrInsert(e,[]);ef(a,f,c);f.startTime>=a.A&&f.startTime<a.C&&(d.get(e).push(f),e==a.H&&a.l.append([f]))}c=r(d.keys());for(b=c.next();!b.done;b=c.next())for(e=b.value,b=a.o.getOrInsertComputed(e,function(){return[]}),e=r(d.get(e)),f=e.next();!f.done;f=e.next())b.push(f.value);$e(a)}
function Ze(a,b,c){for(var d=r(a.o.keys()),e=d.next();!e.done;e=d.next()){e=e.value;var f=a.o.get(e);f=f.filter(function(g){return g.startTime<b||g.endTime>=c});a.o.set(e,f)}}
function $e(a){for(var b=Infinity,c=-Infinity,d=r(a.o.values()),e=d.next();!e.done;e=d.next()){e=r(e.value);for(var f=e.next();!f.done;f=e.next())f=f.value,b=Math.min(b,f.startTime),c=Math.max(c,f.endTime)}b!==Infinity&&c!==-Infinity&&(a.h=a.h==null?Math.max(b,a.A):Math.min(a.h,Math.max(b,a.A)),a.i=Math.max(a.i,Math.min(c,a.C)))}I("shaka.text.TextEngine",Te);Te.prototype.destroy=Te.prototype.destroy;Te.findParser=We;Te.unregisterParser=function(a){Ve.delete(a)};Te.registerParser=Ue;var Ve=new Map;function gf(a){this.i=a;this.h=null}gf.prototype.eb=function(){this.stop();this.i();return this};gf.prototype.ka=function(a){var b=this;this.stop();hf(this,function(){b.i()},a);return this};gf.prototype.Ka=function(a){this.stop();jf(this,a);return this};gf.prototype.stop=function(){var a;(a=this.h)==null||a.call(this);this.h=null};function hf(a,b,c){var d=!0,e=null;a.h=function(){clearTimeout(e);d=!1};e=setTimeout(function(){d&&b()},c*1E3)}function jf(a,b){hf(a,function(){jf(a,b);a.i()},b)}
I("shaka.util.Timer",gf);gf.prototype.stop=gf.prototype.stop;gf.prototype.tickEvery=gf.prototype.Ka;gf.prototype.tickAfter=gf.prototype.ka;gf.prototype.tickNow=gf.prototype.eb;function kf(a){return a!=null}function lf(a,b){return Promise.race([b,new Promise(function(c,d){(new gf(d)).ka(a)})])}function mf(a){return new Promise(function(b){(new gf(b)).ka(a)})};function nf(){}
function of(a,b,c,d,e){if(e.length){var f=a.textStreams;e=r(e);for(var g=e.next(),h={};!g.done;h={Fg:void 0},g=e.next())if(h.Fg=g.value,g=f.filter(function(u){return function(v){return v.codecs.startsWith(u.Fg)||v.mimeType.startsWith(u.Fg)?!0:!1}}(h)),g.length){f=g;break}a.textStreams=f}f=a.variants;if(b.length||c.length)f=pf(f,b,c);if(d.length){b=new hb;f=r(f);for(c=f.next();!c.done;c=f.next())c=c.value,b.push(String(c.video.width||0),c);var k=[];b.forEach(function(u,v){u=0;var w=[];v=r(v);for(var x=
v.next(),y={};!x.done;y={pf:void 0},x=v.next())y.pf=x.value,x=d.filter(function(z){return function(D){return z.pf.decodingInfos[0][D]}}(y)).length,x>u?(u=x,w=[y.pf]):x==u&&w.push(y.pf);k.push.apply(k,F(w))});f=k}b=new Set;c=r(f);for(e=c.next();!e.done;e=c.next())e=e.value,e.video&&b.add(e.video);if(b.size){var l={vp8:1,avc:1,"dovi-avc":.95,vp9:.9,vp09:.9,hevc:.85,"dovi-hevc":.8,"dovi-p5":.75,av01:.7,"dovi-av1":.65,vvc:.6};e=Array.from(b).sort(function(u,v){return u.bandwidth&&v.bandwidth&&u.bandwidth!=
v.bandwidth?u.bandwidth-v.bandwidth:u.width!=v.width?u.width-v.width:u.codecs&&v.codecs?(u=Ie(u.codecs),v=Ie(v.codecs),(l[u]||1)-(l[v]||1)):0});var m=[];b=new Map;c=function(u){var v=[String(u.width||""),String(u.height||""),String(Math.round(u.frameRate||0)),u.hdr||"",u.fastSwitching];u.dependencyStream&&v.push(u.dependencyStream.baseOriginalId||"");u.roles&&v.push(u.roles.sort().join("_"));return v.join(";")};e=r(e);for(g=e.next();!g.done;g=e.next()){g=g.value;h=c(g);var n=b.get(h)||[];if(n.length){var p=
Ie(n[n.length-1].codecs),t=Ie(g.codecs);p==t&&(n.push(g),m.push(g.id))}else n.push(g),m.push(g.id);b.set(h,n)}a.variants=f.filter(function(u){return(u=u.video)&&!m.includes(u.id)?!1:!0})}else a.variants=f}
function pf(a,b,c){b=r(b);for(var d=b.next(),e={};!d.done;e={Pi:void 0},d=b.next())if(e.Pi=d.value,d=a.filter(function(f){return function(g){return g.video&&g.video.codecs.startsWith(f.Pi)}}(e)),d.length){a=d;break}c=r(c);b=c.next();for(d={};!b.done;d={Ug:void 0},b=c.next())if(d.Ug=b.value,b=a.filter(function(f){return function(g){return g.audio&&g.audio.codecs.startsWith(f.Ug)}}(d)),b.length){a=b;break}return a}
function qf(a,b,c){function d(g,h,k){return g>=h&&g<=k}if(a&&a.video&&a.video.width&&a.video.height){var e=a.video.width,f=a.video.height;f>e&&(f=r([f,e]),e=f.next().value,f=f.next().value);if(!d(e,b.minWidth,Math.min(b.maxWidth,c.width))||!d(f,b.minHeight,Math.min(b.maxHeight,c.height))||!d(e*f,b.minPixels,b.maxPixels))return!1}return a&&a.video&&a.video.frameRate&&!d(a.video.frameRate,b.minFrameRate,b.maxFrameRate)||a&&a.audio&&a.audio.channelsCount&&!d(a.audio.channelsCount,b.minChannelsCount,
b.maxChannelsCount)||!d(a.bandwidth,b.minBandwidth,b.maxBandwidth)?!1:!0}function rf(a,b,c,d){c=c===void 0?[]:c;d=d===void 0?{}:d;return H(function(e){if(e.i==1)return e.h(sf(a,b,b.offlineSessionIds.length>0,c,d),2);tf(b);return e.h(xf(b),0)})}
function sf(a,b,c,d,e){var f,g;return H(function(h){if(h.i==1)return R().Di()&&yf(b.variants),h.h(zf(b.variants,c,!1,d),2);f=null;a&&(g=a.Nb())&&(f=g.keySystem);b.variants=b.variants.filter(function(k){var l=Af(k,f,e);if(!l){var m=[];k.audio&&m.push(Bf(k.audio));k.video&&m.push(Bf(k.video))}return l});h.l()})}
function yf(a){var b=(new Map).set("dvav","avc3").set("dva1","avc1").set("dvhe","hev1").set("dvh1","hvc1").set("dvc1","vvc1").set("dvi1","vvi1"),c=new Set;a=r(a);for(var d=a.next();!d.done;d=a.next())d=d.value,d.video&&c.add(d.video);c=r(c);for(a=c.next();!a.done;a=c.next()){a=a.value;d=r(b);for(var e=d.next();!e.done;e=d.next()){var f=r(e.value);e=f.next().value;f=f.next().value;if(a.codecs.includes(e)){a.codecs=a.codecs.replace(e,f);break}}}}
function Af(a,b,c){if(!a.decodingInfos.some(function(k){return!k.supported||b&&(k=k.keySystemAccess)&&(c[k.keySystem]||k.keySystem)!=b?!1:!0}))return!1;var d=R(),e=d.ib()==="Xbox";d=d.Ia()==="MOBILE"&&d.Ba()==="GECKO";var f=a.video,g=f&&f.width||0,h=f&&f.height||0;if(e&&f&&(g>1920||h>1080)&&(f.codecs.includes("avc1.")||f.codecs.includes("avc3."))||(e=f&&f.dependencyStream)&&!Ec(e))return!1;a=a.audio;return d&&a&&a.encrypted&&a.codecs.toLowerCase().includes("opus")||a&&a.dependencyStream?!1:!0}
function Cf(a,b){var c,d,e,f,g,h,k;return H(function(l){if(l.i==1){c=function(m,n){if(m){var p=jd(m);p.supported=m.supported&&n.supported;p.powerEfficient=m.powerEfficient&&n.powerEfficient;p.smooth=m.smooth&&n.smooth;n.keySystemAccess&&!p.keySystemAccess&&(p.keySystemAccess=n.keySystemAccess);return p}return n};d=null;e=[];f=r(b);g=f.next();for(h={};!g.done;h={cache:void 0,le:void 0},g=f.next())k=g.value,h.le=kd(k),h.cache=Df,h.cache.has(h.le)?d=c(d,h.cache.get(h.le)):e.push(Ef(k).then(function(m){return function(n){var p=
null;n=r(n||[]);for(var t=n.next();!t.done;t=n.next())p=c(p,t.value);p&&(m.cache.set(m.le,p),d=c(d,p))}}(h)));return l.h(Promise.all(e),2)}d&&a.decodingInfos.push(d);l.l()})}
function Ef(a){var b=[""];a.video&&(b=Me(a.video.contentType).split(","));var c=[""];a.audio&&(c=Me(a.audio.contentType).split(","));var d=[];b=r(b);for(var e=b.next();!e.done;e=b.next()){e=e.value;for(var f=r(c),g=f.next(),h={};!g.done;h={vc:void 0},g=f.next())g=g.value,h.vc=id(a),a.video&&(h.vc.video.contentType=De(Le(h.vc.video.contentType),e)),a.audio&&(h.vc.audio.contentType=De(Le(h.vc.audio.contentType),g)),d.push(new Promise(function(k){return function(l,m){(R().Ia()=="MOBILE"?lf(5,navigator.mediaCapabilities.decodingInfo(k.vc)):
navigator.mediaCapabilities.decodingInfo(k.vc)).then(function(n){l(n)}).catch(m)}}(h)))}return Promise.all(d).catch(function(){JSON.stringify(a);return null})}
function zf(a,b,c,d){var e,f,g,h,k,l,m,n,p,t,u,v,w,x,y,z,D,A,B;return H(function(E){switch(E.i){case 1:if(e=a.some(function(C){return C.decodingInfos.length}))return E.return();f=r(d);g=f.next();h={};case 2:if(g.done){E.B(4);break}h.bi=g.value;k=!1;l=r(a);m=l.next();case 5:if(m.done){E.B(7);break}n=m.value;p=Ff(n,b,c).filter(function(C){return function(G){G=G[0];G=G.keySystemConfiguration&&G.keySystemConfiguration.keySystem;return!G||G===C.bi}}(h));t=r(p);u=t.next();case 8:if(u.done){E.B(10);break}v=
u.value;return E.h(Cf(n,v),9);case 9:u=t.next();E.B(8);break;case 10:n.decodingInfos.some(function(C){return C.supported})&&(k=!0);m=l.next();E.B(5);break;case 7:if(k)return E.return();h={bi:void 0};g=f.next();E.B(2);break;case 4:w=r(a),x=w.next();case 12:if(x.done){E.B(0);break}y=x.value;z=Ff(y,b,c).filter(function(C){C=C[0];C=C.keySystemConfiguration&&C.keySystemConfiguration.keySystem;return!C||!d.includes(C)});D=r(z);A=D.next();case 15:if(A.done){x=w.next();E.B(12);break}B=A.value;return E.h(Cf(y,
B),16);case 16:A=D.next(),E.B(15)}})}
function Ff(a,b,c){var d=a.audio,e=a.video,f=[],g=[];if(e)for(var h=r(e.fullMimeTypes),k=h.next();!k.done;k=h.next()){k=k.value;var l=Me(k);if(l.includes(",")&&!d){var m=l.split(","),n=Le(k);l=tc("video",m);m=tc("audio",m);m=Oe(m,n);n=Ge(n,m,"audio");g.push({contentType:n,channels:2,bitrate:a.bandwidth||1,samplerate:1,spatialRendering:!1})}l=Qe(l);k={contentType:Ge(Le(k),l,"video"),width:e.width||64,height:e.height||64,bitrate:e.bandwidth||a.bandwidth||1,framerate:e.frameRate||30};if(e.hdr)switch(e.hdr){case "PQ":k.transferFunction=
"pq";break;case "HLG":k.transferFunction="hlg"}e.colorGamut&&(k.colorGamut=e.colorGamut);f.push(k)}if(d)for(h=r(d.fullMimeTypes),k=h.next();!k.done;k=h.next())l=k.value,k=Le(l),l=Oe(Me(l),k),k=Ge(k,l,"audio"),g.push({contentType:k,channels:d.channelsCount||2,bitrate:d.bandwidth||a.bandwidth||1,samplerate:d.audioSamplingRate||1,spatialRendering:d.spatialAudio});h=[];f.length==0&&f.push(null);g.length==0&&g.push(null);f=r(f);for(k=f.next();!k.done;k=f.next())for(k=k.value,l=r(g),n=l.next();!n.done;n=
l.next())n=n.value,m={type:c?"file":"media-source"},k&&(m.video=k),n&&(m.audio=n),h.push(m);g=(a.video?a.video.drmInfos:[]).concat(a.audio?a.audio.drmInfos:[]);if(!g.length)return[h];a=[];c=new Map;g=r(g);for(f=g.next();!f.done;f=g.next())f=f.value,c.get(f.keySystem)||c.set(f.keySystem,[]),c.get(f.keySystem).push(f);g=b?"required":"optional";b=b?["persistent-license"]:["temporary"];f=r(c.keys());for(k=f.next();!k.done;k=f.next()){k=k.value;n=c.get(k);l=new Map;n=r(n);for(m=n.next();!m.done;m=n.next()){m=
m.value;var p=m.videoRobustness+","+m.audioRobustness;l.get(p)||l.set(p,[]);l.get(p).push(m)}l=r(l.values());for(n=l.next();!n.done;n=l.next()){n=n.value;m=[];p=r(h);for(var t=p.next();!t.done;t=p.next()){t=Object.assign({},t.value);for(var u={keySystem:k,initDataType:"cenc",persistentState:g,distinctiveIdentifier:"optional",sessionTypes:b},v=r(n),w=v.next();!w.done;w=v.next()){w=w.value;if(w.initData&&w.initData.length){for(var x=new Set,y=r(w.initData),z=y.next();!z.done;z=y.next())x.add(z.value.initDataType);
u.initDataType=w.initData[0].initDataType}w.distinctiveIdentifierRequired&&(u.distinctiveIdentifier="required");w.persistentStateRequired&&(u.persistentState="required");w.sessionType&&(u.sessionTypes=[w.sessionType]);d&&(u.audio?(w.encryptionScheme&&(u.audio.encryptionScheme=u.audio.encryptionScheme||w.encryptionScheme),u.audio.robustness=u.audio.robustness||w.audioRobustness):(u.audio={robustness:w.audioRobustness},w.encryptionScheme&&(u.audio.encryptionScheme=w.encryptionScheme)),u.audio.robustness==
""&&delete u.audio.robustness);e&&(u.video?(w.encryptionScheme&&(u.video.encryptionScheme=u.video.encryptionScheme||w.encryptionScheme),u.video.robustness=u.video.robustness||w.videoRobustness):(u.video={robustness:w.videoRobustness},w.encryptionScheme&&(u.video.encryptionScheme=w.encryptionScheme)),u.video.robustness==""&&delete u.video.robustness)}t.keySystemConfiguration=u;m.push(t)}a.push(m)}}return a}
function tf(a){a.textStreams=a.textStreams.filter(function(b){b=De(b.mimeType,b.codecs);return Xe(b)})}
function xf(a){var b,c,d,e,f,g,h,k;return H(function(l){switch(l.i){case 1:b=[],c=r(a.imageStreams),d=c.next();case 2:if(d.done){l.B(4);break}e=d.value;f=e.mimeType;f=="application/mp4"&&e.codecs=="mjpg"&&(f="image/jpg");if(Gf.has(f)){l.B(5);break}g=Hf.get(f);if(!g){Gf.set(f,!1);l.B(5);break}return l.h(If(g),7);case 7:h=l.j,Gf.set(f,h);case 5:(k=Gf.get(f))&&b.push(e);d=c.next();l.B(2);break;case 4:a.imageStreams=b,l.l()}})}
function If(a){return new Promise(function(b){var c=new Image;c.src=a;"decode"in c?c.decode().then(function(){b(!0)}).catch(function(){b(!1)}):c.onload=c.onerror=function(){b(c.height===2)}})}
function Jf(a){var b=a.audio,c=a.video,d=b?b.mimeType:null,e=c?c.mimeType:null,f=b?b.codecs:null,g=c?c.codecs:null,h=b?b.groupId:null,k=[];c&&k.push(c.mimeType);b&&k.push(b.mimeType);k=k[0]||null;var l=[];b&&l.push(b.kind);c&&l.push(c.kind);l=l[0]||null;var m=new Set;if(b)for(var n=r(b.roles),p=n.next();!p.done;p=n.next())m.add(p.value);if(c)for(n=r(c.roles),p=n.next();!p.done;p=n.next())m.add(p.value);a={id:a.id,active:!1,type:"variant",bandwidth:a.bandwidth,language:a.language,label:null,videoLabel:null,
kind:l,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:k,audioMimeType:d,videoMimeType:e,codecs:"",audioCodec:f,videoCodec:g,primary:a.primary,roles:Array.from(m),audioRoles:null,videoRoles:null,audioLanguage:null,videoLanguage:null,forced:!1,videoId:null,audioId:null,audioGroupId:h,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,
originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:null};if(c){a.videoId=c.id;a.originalVideoId=c.originalId;a.width=c.width||null;a.height=c.height||null;a.frameRate=c.frameRate||null;a.pixelAspectRatio=c.pixelAspectRatio||null;a.videoBandwidth=c.bandwidth||null;a.hdr=c.hdr||null;a.colorGamut=c.colorGamut||null;a.videoLayout=c.videoLayout||null;a.videoRoles=c.roles;a.videoLanguage=c.language||null;a.videoLabel=c.label;if(d=c.dependencyStream)a.width=d.width||a.width,
a.height=d.height||a.height,a.videoCodec=d.codecs||a.videoCodec,a.pixelAspectRatio=d.pixelAspectRatio||a.pixelAspectRatio,a.videoBandwidth&&d.bandwidth&&(a.videoBandwidth+=d.bandwidth);if(g.includes(",")){a.channelsCount=c.channelsCount;a.audioSamplingRate=c.audioSamplingRate;a.spatialAudio=c.spatialAudio;a.originalLanguage=c.originalLanguage;a.audioMimeType=e;e=g.split(",");try{a.videoCodec=tc("video",e),a.audioCodec=tc("audio",e)}catch(t){}}}b&&(a.audioId=b.id,a.originalAudioId=b.originalId,a.channelsCount=
b.channelsCount,a.audioSamplingRate=b.audioSamplingRate,a.audioBandwidth=b.bandwidth||null,a.spatialAudio=b.spatialAudio,a.label=b.label,a.audioRoles=b.roles,a.audioLanguage=b.language||null,a.accessibilityPurpose=b.accessibilityPurpose,a.originalLanguage=b.originalLanguage,e=b.dependencyStream)&&(a.audioCodec=e.codecs||a.audioCodec,a.audioBandwidth&&e.bandwidth&&(a.audioBandwidth+=e.bandwidth));c&&!a.videoBandwidth&&(b?a.audioBandwidth&&(a.videoBandwidth=a.bandwidth-a.audioBandwidth):a.videoBandwidth=
a.bandwidth);b&&!a.audioBandwidth&&(c?a.videoBandwidth&&(a.audioBandwidth=a.bandwidth-a.videoBandwidth):a.audioBandwidth=a.bandwidth);b=[];a.videoCodec&&b.push(a.videoCodec);a.audioCodec&&b.push(a.audioCodec);a.codecs=b.join(", ");return a}
function Kf(a){return{id:a.id,active:!1,type:wc,bandwidth:a.bandwidth||0,language:a.language,label:a.label,kind:a.kind||null,mimeType:a.mimeType,codecs:a.codecs||null,primary:a.primary,roles:a.roles,accessibilityPurpose:a.accessibilityPurpose,forced:a.forced,originalTextId:a.originalId,originalLanguage:a.originalLanguage}}
function Lf(a){var b=a.width||null,c=a.height||null,d=null;a.segmentIndex&&(d=a.segmentIndex.If());var e=a.tilesLayout;d&&(e=d.tilesLayout||e);e&&b!=null&&(b/=Number(e.split("x")[0]));e&&c!=null&&(c/=Number(e.split("x")[1]));return{id:a.id,type:"image",bandwidth:a.bandwidth||0,width:b,height:c,mimeType:a.mimeType,codecs:a.codecs||null,tilesLayout:e||null,originalImageId:a.originalId}}function Mf(a){return{id:a.id,type:"chapter",bandwidth:a.bandwidth||0,language:a.language}}
function Nf(a){a.__shaka_id==void 0&&(a.__shaka_id=Of++);return a.__shaka_id}function Pf(a,b){b=b===void 0?!1:b;b={id:Nf(a),active:b&&a.mode!="disabled",type:wc,bandwidth:0,language:jc(a.language||"und"),label:a.label,kind:a.kind,mimeType:null,codecs:null,primary:!1,roles:[],accessibilityPurpose:null,forced:a.kind=="forced",originalTextId:a.id,originalLanguage:a.language};a.kind=="captions"&&(b.mimeType="unknown");a.kind=="subtitles"&&(b.mimeType="text/vtt");a.kind&&(b.roles=[a.kind]);return b}
function Qf(a,b){var c=a?a.language:null;c={id:Nf(a||b),active:a?a.enabled:b.selected,type:"variant",bandwidth:0,language:jc(c||"und"),label:a?a.label:null,videoLabel:null,kind:a?a.kind:null,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:null,audioMimeType:null,videoMimeType:null,codecs:null,audioCodec:null,videoCodec:null,primary:a?a.kind=="main":!1,roles:[],forced:!1,audioRoles:null,videoRoles:null,audioLanguage:a?jc(a.language||"und"):
null,videoLanguage:b?jc(b.language||"und"):null,videoId:null,audioId:null,audioGroupId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:b?b.id:null,originalAudioId:a?a.id:null,originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:c};a&&a.kind&&(c.roles=[a.kind],c.audioRoles=[a.kind]);a&&a.configuration&&(a.configuration.codec&&(c.audioCodec=a.configuration.codec,c.codecs=c.audioCodec),
a.configuration.bitrate&&(c.audioBandwidth=a.configuration.bitrate,c.bandwidth+=c.audioBandwidth),a.configuration.sampleRate&&(c.audioSamplingRate=a.configuration.sampleRate),a.configuration.numberOfChannels&&(c.channelsCount=a.configuration.numberOfChannels));if(b&&b.configuration&&(b.configuration.codec&&(c.videoCodec=b.configuration.codec,c.codecs=c.codecs?c.codecs+(","+c.videoCodec):c.videoCodec),b.configuration.bitrate&&(c.videoBandwidth=b.configuration.bitrate,c.bandwidth+=c.videoBandwidth),
b.configuration.framerate&&(c.frameRate=b.configuration.framerate),b.configuration.width&&(c.width=b.configuration.width),b.configuration.height&&(c.height=b.configuration.height),b.configuration.colorSpace&&b.configuration.colorSpace.transfer))switch(b.configuration.colorSpace.transfer){case "pq":c.hdr="PQ";break;case "hlg":c.hdr="HLG";break;case "bt709":c.hdr="SDR"}return c}function Rf(a){return a.allowedByApplication&&a.allowedByKeySystem&&a.disabledUntilTime==0}
function Sf(a){return a.filter(function(b){return Rf(b)})}
function Tf(a,b,c,d){if(!b)return[];var e=a,f=a.filter(function(k){return k.primary});f.length&&(e=f);var g=e.length?e[0].language:"";e=e.filter(function(k){return k.language==g});if(b){var h=qc(jc(b),a.map(function(k){return k.language}));if(h)e=a.filter(function(k){return jc(k.language)==h});else return[]}e=e.filter(function(k){return k.forced==d});if(c)return Uf(e,c);a=e.filter(function(k){return k.roles.length==0});if(a.length)return a;a=e.map(function(k){return k.roles}).reduce(function(k,l){return k.concat(l)},
[]);return a.length?Uf(e,a[0]):e}function Vf(a,b){b=r(b);for(var c=b.next();!c.done;c=b.next())if(c=c.value,c.language&&(c=Tf(a,c.language,c.role||"",c.forced||!1),c.length))return c;return[]}function Uf(a,b){return a.filter(function(c){return c.roles.includes(b)})}function Wf(a){var b=[];a.audio&&b.push(a.audio);a.video&&b.push(a.video);return b}
function Xf(a,b){b.length&&(b=b.filter(function(c){return Ie(a.codecs)==Ie(c.codecs)}).sort(function(c,d){return c.bandwidth&&d.bandwidth&&c.bandwidth!=d.bandwidth?c.bandwidth-d.bandwidth:(c.width||0)-(d.width||0)}),a.trickModeVideo=b[0],b.length>1&&(b=b.find(function(c){return a.width==c.width&&a.height==c.height})))&&(a.trickModeVideo=b)}
function Bf(a){return a.type=="audio"?"type=audio codecs="+a.codecs+" bandwidth="+a.bandwidth+" channelsCount="+a.channelsCount+" audioSamplingRate="+a.audioSamplingRate:a.type=="video"?"type=video codecs="+a.codecs+" bandwidth="+a.bandwidth+" frameRate="+a.frameRate+" width="+a.width+" height="+a.height:"unexpected stream type"}
function Yf(a){var b={id:0,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:"",codecs:"",supplementalCodecs:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"",originalLanguage:null,label:null,type:"",primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],accessibilityPurpose:null,forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set,
isAudioMuxedInVideo:!1,baseOriginalId:null,isIframe:!1,preselection:null};Object.assign(b,a);b.mimeType&&b.fullMimeTypes.add(De(b.mimeType,b.codecs));return b}
function Zf(a){var b={id:0,language:"und",disabledUntilTime:0,primary:!1,audio:null,video:null,bandwidth:100,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]};a=r(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=Yf({mimeType:c?Le(c):"",codecs:c?Me(c):"",encrypted:!0,language:"und",type:"video"});c.startsWith("audio/")?(d.type="audio",b.audio=d):b.video=d}return b}I("shaka.util.StreamUtils",nf);nf.meetsRestrictions=qf;
var Df=new Map,Of=0,Gf=(new Map).set("image/svg+xml",!0).set("image/png",!0).set("image/jpeg",!0).set("image/jpg",!0),Hf=(new Map).set("image/webp","data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA").set("image/avif","data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=");function $f(){var a=this;this.N=this.H=null;this.u=!1;this.A=new Ra;this.j=new ib;navigator.connection&&navigator.connection.addEventListener&&this.j.J(navigator.connection,"change",function(){a.h.useNetworkInformation&&navigator.onLine&&(a.A=new Ra,a.h&&a.A.configure(a.h.advanced),a.trySuggestStreams())});this.o=[];this.I=1;this.P=!1;this.m=this.i=this.h=this.C=null;this.D=new gf(function(){if(a.u&&(a.h.restrictToElementSize||a.h.restrictToScreenSize)){var b=a.chooseVariant();b&&a.H&&a.H(b,a.h.clearBufferSwitch,
a.h.safeMarginSwitch)}});this.F=window;"documentPictureInPicture"in window&&this.j.J(window.documentPictureInPicture,"enter",function(){a.F=window.documentPictureInPicture.window;a.D&&a.D.eb();a.j.Ma(a.F,"pagehide",function(){a.F=window;a.D&&a.D.eb()})});this.O=this.G=this.l=null;this.L=this.K=0}q=$f.prototype;q.stop=function(){this.H=null;this.u=!1;this.o=[];this.I=1;this.i=this.C=null;var a;(a=this.m)==null||a.disconnect();this.m=null;var b;(b=this.D)==null||b.stop();this.G=this.l=null;ag(this)};
q.release=function(){this.stop();this.j.release();this.D=null};q.init=function(a,b){this.H=a;this.N=b};
q.chooseVariant=function(a){a=a===void 0?!1:a;var b=Infinity,c=Infinity;this.h.restrictToScreenSize&&(c=this.h.ignoreDevicePixelRatio?1:this.F.devicePixelRatio,b=this.F.screen.height*c,c*=this.F.screen.width);if(this.m&&this.h.restrictToElementSize){var d=this.h.ignoreDevicePixelRatio?1:this.F.devicePixelRatio,e=this.i.clientHeight,f=this.i.clientWidth;this.l&&document.pictureInPictureElement&&document.pictureInPictureElement==this.i&&(e=this.l.height,f=this.l.width);b=Math.min(b,e*d);c=Math.min(c,
f*d)}e=this.o.filter(function(l){return l&&!(l.audio&&l.audio.fastSwitching||l.video&&l.video.fastSwitching)});e.length||(e=this.o);d=e;a&&e.length!=this.o.length&&(d=this.o.filter(function(l){return l&&(l.audio&&l.audio.fastSwitching||l.video&&l.video.fastSwitching?!0:!1)}));a=bg(this,this.h.restrictions,d,Infinity,Infinity);if(b!=Infinity||c!=Infinity){a=cg(a);a=r(a);for(e=a.next();!e.done;e=a.next())if(e=e.value,e.height>=b&&e.width>=c){b=e.height;c=e.width;break}a=bg(this,this.h.restrictions,
d,b,c)}b=this.getBandwidthEstimate();d.length&&!a.length&&(a=bg(this,null,d,Infinity,Infinity),a=[a[0]]);c=a[0]||null;for(d=0;d<a.length;d++){e=a[d];var g=isNaN(this.I)?1:Math.abs(this.I);f=g*e.bandwidth/this.h.bandwidthDowngradeTarget;for(var h={bandwidth:Infinity},k=d+1;k<a.length;k++)if(e.bandwidth!=a[k].bandwidth){h=a[k];break}g=g*h.bandwidth/this.h.bandwidthUpgradeTarget;c&&e&&b>=f&&b<=g&&(c.bandwidth!=e.bandwidth||c.bandwidth==e.bandwidth&&c.video&&e.video&&(c.video.width<e.video.width||c.video.height<
e.video.height))&&(c=e)}this.C=Date.now();return c};q.enable=function(){this.u=!0;dg(this);this.o.length&&this.trySuggestStreams()};q.disable=function(){this.u=!1};q.segmentDownloaded=function(a,b,c){a>=this.h.cacheLoadThreshold&&this.A.sample(a,b);c&&this.C!=null&&this.u&&eg(this)};q.trySuggestStreams=function(){this.u&&(this.C=Date.now(),eg(this,!0))};
q.getBandwidthEstimate=function(){var a=this.h.defaultBandwidthEstimate;navigator.connection&&navigator.connection.downlink&&this.h.useNetworkInformation&&(a=navigator.connection.downlink*1E6);if(navigator.connection&&navigator.connection.downlink&&this.h.useNetworkInformation&&this.h.preferNetworkInformationBandwidth)return a;a=this.A.getBandwidthEstimate(a);return this.G?this.G.getBandwidthEstimate(a):a};q.setVariants=function(a){if(db(a,this.o))return!1;this.o=a;return!0};
q.playbackRateChanged=function(a){this.I=a};q.setMediaElement=function(a){function b(){c.D.ka(fg)}var c=this;this.i=a;this.m&&(this.m.disconnect(),this.m=null);this.i&&"ResizeObserver"in window&&(this.m=new ResizeObserver(b),this.m.observe(this.i));this.j.J(a,"enterpictureinpicture",function(d){d.pictureInPictureWindow&&(c.l=d.pictureInPictureWindow,c.j.J(c.l,"resize",b))});this.j.J(a,"leavepictureinpicture",function(){c.l&&c.j.mb(c.l,"resize",b);c.l=null});gg(this)};
q.setCmsdManager=function(a){this.G=a};q.configure=function(a){this.h=a;this.A&&this.h&&this.A.configure(this.h.advanced);gg(this)};function eg(a,b){if(b===void 0||!b){if(!a.P){b=a.A;if(!(b.h>=b.j))return;a.P=!0;a.C-=(a.h.switchInterval-a.h.minTimeToSwitch)*1E3}if(Date.now()-a.C<a.h.switchInterval*1E3)return}b=a.chooseVariant();a.getBandwidthEstimate();b&&a.H&&(a.H(b,a.h.clearBufferSwitch,a.h.safeMarginSwitch),dg(a))}
function bg(a,b,c,d,e){if(a.G){var f=a.G.uh();f&&(c=c.filter(function(g){return g.bandwidth&&f?g.bandwidth<=f:!0}))}b&&(c=c.filter(function(g){return qf(g,b,{width:e,height:d})}));return c.sort(function(g,h){return g.bandwidth-h.bandwidth})}function cg(a){var b=[];a=r(a);for(var c=a.next();!c.done;c=a.next())(c=c.value)&&(c=c.video)&&c.height&&c.width&&b.push({height:c.height,width:c.width});return b.sort(function(d,e){return d.width-e.width})}
function gg(a){ag(a);var b=a.i;a.h.droppedFrames&&b!=null&&b.getVideoPlaybackQuality&&(dg(a),hg(a),a.O=(new gf(function(){if(!a.i.paused&&a.u&&a.h.droppedFrames){var c=a.i.getVideoPlaybackQuality(),d=c.droppedVideoFrames;c=c.totalVideoFrames;if((isNaN(a.I)?1:Math.abs(a.I))>1||!c)a.K=d,a.L=c;else{var e=d-a.K,f=c-a.L;a.K=d;a.L=c;e/f>=a.h.advanced.droppedFramesThreshold&&a.N&&a.N("video",a.h.advanced.droppedFramesBanDuration)}}})).Ka(a.h.advanced.droppedFramesInterval))}
function ag(a){a.j.mb(a.i,"resize");var b;(b=a.O)==null||b.stop();a.O=null}function dg(a){var b=a.i;a.h.droppedFrames&&(b==null?0:b.getVideoPlaybackQuality)&&(b=b.getVideoPlaybackQuality(),a.K=b.droppedVideoFrames,a.L=b.totalVideoFrames)}function hg(a){a.j.J(a.i,"resize",function(){dg(a)})}I("shaka.abr.SimpleAbrManager",$f);$f.prototype.configure=$f.prototype.configure;$f.prototype.setCmsdManager=$f.prototype.setCmsdManager;$f.prototype.setMediaElement=$f.prototype.setMediaElement;
$f.prototype.playbackRateChanged=$f.prototype.playbackRateChanged;$f.prototype.setVariants=$f.prototype.setVariants;$f.prototype.getBandwidthEstimate=$f.prototype.getBandwidthEstimate;$f.prototype.trySuggestStreams=$f.prototype.trySuggestStreams;$f.prototype.segmentDownloaded=$f.prototype.segmentDownloaded;$f.prototype.disable=$f.prototype.disable;$f.prototype.enable=$f.prototype.enable;$f.prototype.chooseVariant=$f.prototype.chooseVariant;$f.prototype.init=$f.prototype.init;
$f.prototype.release=$f.prototype.release;$f.prototype.stop=$f.prototype.stop;var fg=1;function ig(a,b,c,d,e,f){f=f===void 0?!1:f;if(d>=e)return null;for(var g=-1,h=-1,k=0;k<c.length;k++)c[k].some(function(E){return E!=null&&E.h.trim()!=""})&&(g===-1&&(g=k),h=k);if(g===-1||h===-1)return null;for(var l=k=!1,m="white",n="black",p=d,t=jg(d,e,k,l,m,n);g<=h;g++){for(var u=c[g],v=-1,w=-1,x=0;x<u.length;x++)u[x]!=null&&u[x].h.trim()!==""&&(v===-1&&(v=x),w=x);if(v===-1||w===-1)u=kg(d,e),a.nestedCues.push(u);else{for(;v<=w;v++)if(x=u[v]){var y=x.m,z=x.j,D=x.l,A=x.i,B=x.o;B=f&&B!=null&&B>d?B:
d;if(y!=k||z!=l||D!=m||A!=n||B!=p)t.payload&&a.nestedCues.push(t),t=jg(B,e,y,z,D,A),k=y,l=z,m=D,n=A,p=B;t.payload+=x.h}else t.payload+=" ";t.payload&&a.nestedCues.push(t);g!==h&&(p=kg(d,e),a.nestedCues.push(p));p=d;t=jg(d,e,k,l,m,n)}}return a.nestedCues.length?{cue:a,stream:b}:null}function jg(a,b,c,d,e,f){a=new Vd(a,b,"");c&&a.textDecoration.push(re);d&&(a.fontStyle=qe);a.color=e;a.backgroundColor=f;return a}function kg(a,b){a=new Vd(a,b,"");a.lineBreak=!0;return a}
function lg(a,b){switch(a){case mg:return b==6;case ng:return b==39||b==40;case og:return b==23||b==24;default:return!1}}var mg=0,ng=1,og=2;function pg(a,b,c,d,e,f){this.h=a;this.m=b;this.j=c;this.i=d;this.l=e;this.o=f===void 0?null:f};function qg(a,b){this.j=[];this.h=1;this.i=0;this.F=a;this.D=b;this.m=this.u=!1;this.o="white";this.C="black";this.A=this.l=null;rg(this)}function sg(a,b,c,d){d=d===void 0?!1:d;var e="CC"+((a.F<<1|a.D)+1),f=new Vd(b,c,"");f.lineInterpretation=1;var g=a.j.findIndex(function(h){return h.some(function(k){return k.h.trim()!=""})});if(g=tg.get(g))f.line=g;a.A!=null&&a.l!=null&&(f.position=10+Math.min(70,a.A*10)+a.l*2.5);return ig(f,e,a.j,b,c,d)}function rg(a){ug(a,0,15);a.h=1;a.l=null;a.A=null}
function vg(a,b,c,d){d=d===void 0?null:d;if(!(c<32||c>127)){var e="";switch(b){case 0:e=wg.has(c)?wg.get(c):String.fromCharCode(c);break;case 1:e=xg.get(c);break;case 2:a.j[a.h].pop();e=yg.get(c);break;case 3:a.j[a.h].pop(),e=zg.get(c)}e&&a.j[a.h].push(new pg(e,a.u,a.m,a.C,a.o,d))}}function Ag(a,b,c,d){if(!(c<0||b<0))if(b>=c)for(--d;d>=0;d--)a.j[b+d]=a.j[c+d].map(function(f){return f});else for(var e=0;e<d;e++)a.j[b+e]=a.j[c+e].map(function(f){return f})}
function ug(a,b,c){for(var d=0;d<=c;d++)a.j[b+d]=[]}
var wg=new Map([[39,"\u2019"],[42,"\u00e1"],[92,"\u00e9"],[94,"\u00ed"],[95,"\u00f3"],[96,"\u00fa"],[123,"\u00e7"],[124,"\u00f7"],[125,"\u00d1"],[126,"\u00f1"],[127,"\u2588"]]),xg=new Map([[48,"\u00ae"],[49,"\u00b0"],[50,"\u00bd"],[51,"\u00bf"],[52,"\u2122"],[53,"\u00a2"],[54,"\u00a3"],[55,"\u266a"],[56,"\u00e0"],[57," "],[58,"\u00e8"],[59,"\u00e2"],[60,"\u00ea"],[61,"\u00ee"],[62,"\u00f4"],[63,"\u00fb"]]),yg=new Map([[32,"\u00c1"],[33,"\u00c9"],[34,"\u00d3"],[35,"\u00da"],[36,"\u00dc"],[37,"\u00fc"],
[38,"\u2018"],[39,"\u00a1"],[40,"*"],[41,"'"],[42,"\u2500"],[43,"\u00a9"],[44,"\u2120"],[45,"\u00b7"],[46,"\u201c"],[47,"\u201d"],[48,"\u00c0"],[49,"\u00c2"],[50,"\u00c7"],[51,"\u00c8"],[52,"\u00ca"],[53,"\u00cb"],[54,"\u00eb"],[55,"\u00ce"],[56,"\u00cf"],[57,"\u00ef"],[58,"\u00d4"],[59,"\u00d9"],[60,"\u00f9"],[61,"\u00db"],[62,"\u00ab"],[63,"\u00bb"]]),zg=new Map([[32,"\u00c3"],[33,"\u00e3"],[34,"\u00cd"],[35,"\u00cc"],[36,"\u00ec"],[37,"\u00d2"],[38,"\u00f2"],[39,"\u00d5"],[40,"\u00f5"],[41,"{"],
[42,"}"],[43,"\\"],[44,"^"],[45,"_"],[46,"|"],[47,"~"],[48,"\u00c4"],[49,"\u00e4"],[50,"\u00d6"],[51,"\u00f6"],[52,"\u00df"],[53,"\u00a5"],[54,"\u00a4"],[55,"\u2502"],[56,"\u00c5"],[57,"\u00e5"],[58,"\u00d8"],[59,"\u00f8"],[60,"\u250c"],[61,"\u2510"],[62,"\u2514"],[63,"\u2518"]]),tg=new Map([[1,10],[2,15.33],[3,20.66],[4,26],[5,31.33],[6,36.66],[7,42],[8,47.33],[9,52.66],[10,58],[11,63.33],[12,68.66],[13,74],[14,79.33],[15,84.66]]);function Bg(a,b){this.i=0;this.u=new qg(a,b);this.j=new qg(a,b);this.h=this.l=new qg(a,b);this.m=0;this.o=null}function Cg(a,b,c){a.h=a.j;var d=a.h,e=null;a.i!==3&&a.i!==4&&(e=sg(d,a.m,c,a.i===2),c=a.j,c.h=c.i>0?c.i:0,ug(c,0,15),c=a.l,c.h=c.i>0?c.i:0,ug(c,0,15),d.h=15);a.i=3;d.i=b;return e}function Dg(a){a.i=1;a.h=a.l;a.h.i=0}function Eg(a){Wa("Cea608DataChannel","CEA-608 text mode entered, but is unsupported");a.h=a.u;a.i=4}var Fg="black green blue cyan red yellow magenta black".split(" "),Gg="white green blue cyan red yellow magenta white_italics".split(" ");function Hg(a,b){this.K=b;this.O=a;this.L=this.m=!1;this.o=this.u=this.H=this.N=this.I=0;this.G=2;this.j=[];this.h=this.i=this.l=0;this.F=this.C=!1;this.D="white";this.A="black";Ig(this)}function Ig(a){a.j=[];for(var b=0;b<16;b++)a.j.push(Jg())}function Jg(){for(var a=[],b=0;b<42;b++)a.push(null);return a}function Kg(a,b){Lg(a)&&(a.j[a.i][a.h]=new pg(b,a.F,a.C,a.A,a.D),a.h++)}function Lg(a){var b=a.h<a.o&&a.h>=0;return a.i<a.u&&a.i>=0&&b}Hg.prototype.isVisible=function(){return this.m};
function Mg(a,b,c){var d=new Vd(a.l,b,"");d.textAlign=a.G===0?"left":a.G===1?"right":Xd;var e=d.region;a.K&&(e.id+="svc"+a.K);e.id+="win"+a.O;e.height=a.u;e.width=a.o;e.heightUnits=2;e.widthUnits=2;e.viewportAnchorX=a.I;e.viewportAnchorY=a.N;e.viewportAnchorUnits=a.L?Zc:2;switch(a.H){case 0:e.regionAnchorX=0;e.regionAnchorY=0;break;case 1:e.regionAnchorX=50;e.regionAnchorY=0;break;case 2:e.regionAnchorX=100;e.regionAnchorY=0;break;case 3:e.regionAnchorX=0;e.regionAnchorY=50;break;case 4:e.regionAnchorX=
50;e.regionAnchorY=50;break;case 5:e.regionAnchorX=100;e.regionAnchorY=50;break;case 6:e.regionAnchorX=0;e.regionAnchorY=100;break;case 7:e.regionAnchorX=50;e.regionAnchorY=100;break;case 8:e.regionAnchorX=100,e.regionAnchorY=100}if(c=ig(d,"svc"+c,a.j,a.l,b))a.l=b;return c}Hg.prototype.display=function(){this.m=!0};function Ng(){this.j=[];this.i=null;this.h=0}function Og(a,b){b.type===3?(a.h=(b.value&63)*2-1,a.i=[]):a.i&&(a.h>0&&(a.i.push(b),a.h--),a.h===0&&(a.j.push(new Pg(a.i)),a.i=null,a.h=0))}function Pg(a){this.h=0;this.i=a}Pg.prototype.Va=function(){return this.h<this.i.length};Pg.prototype.va=function(){return this.h};function Qg(a){if(!a.Va())throw new T(2,2,3E3);return a.i[a.h++]}Pg.prototype.skip=function(a){if(this.h+a>this.i.length)throw new T(2,2,3E3);this.h+=a};
Pg.prototype.ki=function(a){if(this.h-a<0)throw new T(2,2,3E3);this.h-=a};function Rg(a){this.j=a;this.i=[null,null,null,null,null,null,null,null];this.h=null}
function Sg(a,b){var c=Qg(b),d=c.value;c=c.pts;if(d===16){var e=Qg(b);d=d<<16|e.value}if(d>=0&&d<=31){e=d;if(e==24)c=Qg(b).value,b=Qg(b).value,a.h&&Kg(a.h,String.fromCharCode(c<<8|b)),a=[];else if(a.h){b=a.h;d=null;switch(e){case 8:!Lg(b)||b.h<=0&&b.i<=0||(b.h<=0?(b.h=b.o-1,b.i--):b.h--,b.j[b.i][b.h]=null);break;case 13:b.isVisible()&&(d=Mg(b,c,a.j));if(b.i+1>=b.u){a=0;for(c=1;c<16;c++,a++)b.j[a]=b.j[c];for(c=0;c<1;c++,a++)b.j[a]=Jg()}else b.i++;b.h=0;break;case 14:b.isVisible()&&(d=Mg(b,c,a.j));
b.j[b.i]=Jg();b.h=0;break;case 12:b.isVisible()&&(d=Mg(b,c,a.j)),Ig(b),b.i=0,b.h=0}a=d?[d]:[]}else a=[];return a}if(d>=128&&d<=159)return Tg(a,b,d,c);d>=4096&&d<=4127?(a=d&255,a>=8&&a<=15?b.skip(1):a>=16&&a<=23?b.skip(2):a>=24&&a<=31&&b.skip(3)):d>=4224&&d<=4255?(a=d&255,a>=128&&a<=135?b.skip(4):a>=136&&a<=143&&b.skip(5)):d>=32&&d<=127?(b=d,a.h&&(b===127?Kg(a.h,"\u266a"):Kg(a.h,String.fromCharCode(b)))):d>=160&&d<=255?a.h&&Kg(a.h,String.fromCharCode(d)):d>=4128&&d<=4223?(b=d&255,a.h&&(Ug.has(b)?(b=
Ug.get(b),Kg(a.h,b)):Kg(a.h,"_"))):d>=4256&&d<=4351&&a.h&&((d&255)!=160?Kg(a.h,"_"):Kg(a.h,"[CC]"));return[]}
function Tg(a,b,c,d){if(c>=128&&c<=135)d=c&7,a.i[d]&&(a.h=a.i[d]);else{if(c===136){c=Qg(b).value;b=[];c=r(Vg(a,c));for(var e=c.next();!e.done;e=c.next()){e=a.i[e.value];if(e.isVisible()){var f=Mg(e,d,a.j);f&&b.push(f)}Ig(e)}return b}if(c===137)for(b=Qg(b).value,b=r(Vg(a,b)),c=b.next();!c.done;c=b.next())c=a.i[c.value],c.isVisible()||(c.l=d),c.display();else{if(c===138){c=Qg(b).value;b=null;c=r(Vg(a,c));for(e=c.next();!e.done;e=c.next())e=a.i[e.value],e.isVisible()&&(b=Mg(e,d,a.j)),e.m=!1;return b?
[b]:[]}if(c===139){c=Qg(b).value;b=null;c=r(Vg(a,c));for(e=c.next();!e.done;e=c.next())e=a.i[e.value],e.isVisible()?b=Mg(e,d,a.j):e.l=d,e.m=!e.m;return b?[b]:[]}if(c===140)return b=Qg(b).value,Wg(a,b,d);if(c===143)return d=Wg(a,255,d),Xg(a),d;if(c===144)b.skip(1),d=Qg(b).value,a.h&&(a.h.C=(d&128)>0,a.h.F=(d&64)>0);else if(c===145)d=Qg(b).value,c=Qg(b).value,b.skip(1),a.h&&(b=Yg((c&48)>>4,(c&12)>>2,c&3,c>>6),a.h.D=Yg((d&48)>>4,(d&12)>>2,d&3,d>>6),a.h.A=b);else if(c===146)d=Qg(b).value,b=Qg(b).value,
a.h&&(a=a.h,a.i=d&15,a.h=b&63);else if(c===151)b.skip(1),b.skip(1),d=Qg(b).value,b.skip(1),a.h&&(a.h.G=d&3);else if(c>=152&&c<=159){c=(c&15)-8;e=a.i[c]!==null;e||(f=new Hg(c,a.j),f.l=d,a.i[c]=f);d=Qg(b).value;f=Qg(b).value;var g=Qg(b).value,h=Qg(b).value,k=Qg(b).value;b=Qg(b).value;e&&(b&7)===0||(b=a.i[c],b.i=0,b.h=0,b.F=!1,b.C=!1,b.D="white",b.A="black");b=a.i[c];b.m=(d&32)>0;b.N=f&127;b.I=g;b.H=(h&240)>>4;b.L=(f&128)>0;b.u=(h&15)+1;b.o=(k&63)+1;a.h=a.i[c]}}}return[]}
function Vg(a,b){for(var c=[],d=0;d<8;d++)(b&1)===1&&a.i[d]&&c.push(d),b>>=1;return c}function Wg(a,b,c){var d=[];b=r(Vg(a,b));for(var e=b.next();!e.done;e=b.next()){e=e.value;var f=a.i[e];f.isVisible()&&(f=Mg(f,c,a.j))&&d.push(f);a.i[e]=null}return d}function Xg(a){a.h=null;a.i=[null,null,null,null,null,null,null,null]}function Yg(a,b,c,d){d=d===void 0?0:d;return d===3?"rgba(0, 0, 0, 0)":d===2?"rgba("+(a>>1)*255+", "+(b>>1)*255+", "+((c>>1)*255+", 0.5)"):Zg[a>>1<<2|b>>1<<1|c>>1]}
var Ug=new Map([[32," "],[33,"\u00a0"],[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"]]),Zg="black blue green cyan red magenta yellow white".split(" ");function $g(a,b){this.i=zb(a);this.j=b==ah;this.h=0}q=$g.prototype;q.Va=function(){return this.h<this.i.byteLength};q.va=function(){return this.h};q.Na=function(){return this.i.byteLength};q.Ja=function(){try{var a=this.i.getUint8(this.h);this.h+=1;return a}catch(b){throw bh();}};q.kb=function(){try{var a=this.i.getUint16(this.h,this.j);this.h+=2;return a}catch(b){throw bh();}};q.R=function(){try{var a=this.i.getUint32(this.h,this.j);this.h+=4;return a}catch(b){throw bh();}};
q.mg=function(){try{var a=this.i.getInt32(this.h,this.j);this.h+=4;return a}catch(b){throw bh();}};q.jd=function(){try{if(this.j){var a=this.i.getUint32(this.h,!0);var b=this.i.getUint32(this.h+4,!0)}else b=this.i.getUint32(this.h,!1),a=this.i.getUint32(this.h+4,!1)}catch(c){throw bh();}if(b>2097151)throw new T(2,3,3001);this.h+=8;return b*4294967296+a};q.Ea=function(a,b){if(this.h+a>this.i.byteLength)throw bh();var c=S(this.i,this.h,a);this.h+=a;return b?new Uint8Array(c):c};
q.skip=function(a){if(a<0||this.h+a>this.i.byteLength)throw bh();this.h+=a};q.ki=function(a){if(a<0||this.h<a)throw bh();this.h-=a};q.seek=function(a){if(a<0||a>this.i.byteLength)throw bh();this.h=a};q.hd=function(){for(var a=this.h;this.Va()&&this.i.getUint8(this.h)!=0;)this.h+=1;a=S(this.i,a,this.h-a);this.h+=1;return Db(a)};function bh(){return new T(2,3,3E3)}I("shaka.util.DataViewReader",$g);$g.prototype.readTerminatedString=$g.prototype.hd;$g.prototype.seek=$g.prototype.seek;
$g.prototype.rewind=$g.prototype.ki;$g.prototype.skip=$g.prototype.skip;$g.prototype.readBytes=$g.prototype.Ea;$g.prototype.readUint64=$g.prototype.jd;$g.prototype.readInt32=$g.prototype.mg;$g.prototype.readUint32=$g.prototype.R;$g.prototype.readUint16=$g.prototype.kb;$g.prototype.readUint8=$g.prototype.Ja;$g.prototype.getLength=$g.prototype.Na;$g.prototype.getPosition=$g.prototype.va;$g.prototype.hasMoreData=$g.prototype.Va;var ah=1;$g.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:ah};function ch(){this.h=[];this.i=[];this.j=new Ng;this.l=0;this.m=new Map([["CC1",new Bg(0,0)],["CC2",new Bg(0,1)],["CC3",new Bg(1,0)],["CC4",new Bg(1,1)]]);this.u=this.o=0;this.D=new Map;this.C=!0;this.A=new Set;dh(this)}q=ch.prototype;q.clear=function(){this.l=0;this.h=[];this.i=[];var a=this.j;a.j=[];a.i=null;a.h=0;dh(this);a=r(this.D.values());for(var b=a.next();!b.done;b=a.next())Xg(b.value)};
function dh(a){a.o=0;a.u=0;for(var b=r(a.m.values()),c=b.next();!c.done;c=b.next())c=c.value,c.i=0,c.h=c.l,c.o=null,rg(c.j),rg(c.l),rg(c.u);a.C=!0}
q.extract=function(a,b){if(this.C){for(var c=r(this.m.values()),d=c.next();!d.done;d=c.next())d.value.m=b;this.C=!1}a=new $g(a,0);if(!(a.Na()<8)&&a.Ja()===181&&a.kb()===49&&a.R()===1195456820&&a.Ja()===3&&(c=a.Ja(),(c&64)!==0))for(c&=31,a.skip(1),d=0;d<c;d++){var e=a.Ja(),f=(e&4)>>2,g=a.Ja(),h=a.Ja();f&&(e&=3,e===0||e===1?this.h.push({pts:b,type:e,gb:g,Cb:h,order:this.h.length}):(this.i.push({pts:b,type:e,value:g,order:this.i.length}),this.i.push({pts:b,type:2,value:h,order:this.i.length})))}};
q.extractRaw608=function(a,b){for(var c=0;c+1<a.length;c+=2)this.h.push({pts:b,type:0,gb:a[c],Cb:a[c+1],order:this.h.length})};
q.decode=function(){function a(e,f){return e.pts-f.pts||e.order-f.order}var b=[];this.h.sort(a);this.i.sort(a);for(var c=r(this.h),d=c.next();!d.done;d=c.next())(d=eh(this,d.value))&&b.push(d);c=r(this.i);for(d=c.next();!d.done;d=c.next())Og(this.j,d.value);c=r(this.j.j);for(d=c.next();!d.done;d=c.next())d=fh(this,d.value),b.push.apply(b,F(d));this.j.j=[];this.h=[];this.i=[];return b};
function eh(a,b){var c=b.type;if((b.gb&112)===16){var d=b.gb>>3&1;c===0?a.o=d:a.u=d}var e="CC"+((c<<1|(c?a.u:a.o))+1);c=a.m.get(e);if(b.gb===255&&b.Cb===255||!b.gb&&!b.Cb||!gh(b.gb)||!gh(b.Cb))return++a.l>=45&&dh(a),null;a.l=0;b.gb&=127;b.Cb&=127;d=b.gb;if(d>=1&&d<=15||!b.gb&&!b.Cb)return null;d=null;if((b.gb&112)===16)a:{a.A.add(e),d=b.gb;a=b.Cb;e=b.pts;if(c.o===(d<<8|a))c.o=null;else if(c.o=d<<8|a,(d&240)===16&&(a&192)===64){b=[11,11,1,2,3,4,12,13,14,15,5,6,7,8,9,10][(d&7)<<1|a>>5&1];d="white";
e=!1;var f=null;var g=a>95?a-96:a-64;g<=13?d=Gg[Math.floor(g/2)]:g<=15?e=!0:f=Math.floor((g-16)/2);a=(a&1)===1;c.i!==4&&(g=c.h,c.i===3&&b!==g.h&&(c=1+b-g.i,Ag(g,c,1+g.h-g.i,g.i),ug(g,0,c-1),ug(g,b+1,15-b)),g.h=b,g.u=a,g.m=e,g.o=d,g.A=f,g.l=null,g.C="black")}else if((d&247)===17&&(a&240)===32)c.h.u=!1,c.h.m=!1,c.h.o="white",vg(c.h,0,32,e),b=!1,d=Gg[(a&14)>>1],d==="white_italics"&&(d="white",b=!0),c.h.u=(a&1)===1,c.h.m=b,c.h.o=d;else if((d&247)===16&&(a&240)===32||(d&247)===23&&(a&255)===45)b="black",
(d&7)===0&&(b=Fg[(a&14)>>1]),c.h.C=b;else if((d&247)===17&&(a&240)===48)vg(c.h,1,a,e);else if((d&246)===18&&(a&224)===32)vg(c.h,d&1?3:2,a,e);else{if((d&246)===20&&(a&240)===32){a=b.pts;d=null;switch(b.Cb){case 32:Dg(c);break;case 33:c=c.h;c.j[c.h].pop();break;case 37:d=Cg(c,2,a);break;case 38:d=Cg(c,3,a);break;case 39:d=Cg(c,4,a);break;case 40:vg(c.h,0,32,a);break;case 41:c.i=2;c.h=c.j;c.h.i=0;c.m=a;break;case 42:rg(c.u);Eg(c);break;case 43:Eg(c);break;case 44:b=c.j;d=null;c.i!==4&&(d=sg(b,c.m,a,
c.i===2||c.i===3));ug(b,0,15);break;case 45:b=c.h;c.i!==3?d=null:(d=sg(b,c.m,a,!0),e=b.h-b.i+1,Ag(b,e-1,e,b.i),ug(b,0,e-1),ug(b,b.h,15-b.h),c.m=a);break;case 46:ug(c.l,0,15);break;case 47:b=null,c.i!==4&&(b=sg(c.j,c.m,a,c.i===2||c.i===3)),d=c.l,c.l=c.j,c.j=d,Dg(c),c.m=a,d=b}break a}(d==23||d==31)&&a>=33&&a<=35&&(c.h.l=a-32)}d=null}else a=b.Cb,e=b.pts,vg(c.h,0,b.gb,e),vg(c.h,0,a,e);return d}
function fh(a,b){var c=[];try{for(;b.Va();){var d=Qg(b).value,e=(d&224)>>5,f=d&31;e===7&&f!=0&&(e=Qg(b).value&63);if(e!=0){a.A.add("svc"+e);for(var g=a.D.getOrInsertComputed(e,function(l){return new Rg(l)}),h=b.va();b.va()-h<f;){var k=Sg(g,b);c.push.apply(c,F(k))}}}}catch(l){if(l instanceof T&&l.code===3E3)Wa("CEA708_INVALID_DATA","Buffer read out of bounds / invalid CEA-708 Data.");else throw l;}return c}function gh(a){for(var b=0;a;)b^=a&1,a>>=1;return b===1}q.getStreams=function(){return Array.from(this.A)};
I("shaka.cea.CeaDecoder",ch);Rc=function(){return new ch};function hh(a){var b=[];a=Sb(a);for(var c=0;c<a.length;){for(var d=0;a[c]==255;)d+=255,c++;d+=a[c++];for(var e=0;a[c]==255;)e+=255,c++;e+=a[c++];d==4&&b.push(a.subarray(c,c+e));c+=e}return b};function ih(){this.j=new Map;this.i=new Map;this.h=!1}q=ih.prototype;q.box=function(a,b){a=jh(a);this.j.set(a,kh);this.i.set(a,b);return this};q.ma=function(a,b){a=r(a);for(var c=a.next();!c.done;c=a.next())this.box(c.value,b);return this};q.S=function(a,b){a=jh(a);this.j.set(a,lh);this.i.set(a,b);return this};q.nh=function(a,b){a=r(a);for(var c=a.next();!c.done;c=a.next())this.S(c.value,b);return this};q.stop=function(){this.h=!0};
q.parse=function(a,b,c){a=new $g(a,0);for(this.h=!1;a.Va()&&!this.h;)this.ed(0,a,b,c)};
q.ed=function(a,b,c,d){var e=b.va();if(d&&e+8>b.Na())this.h=!0;else{var f=b.R(),g=b.R(),h=mh(g),k=!1;switch(f){case 0:f=b.Na()-e;break;case 1:if(d&&b.va()+8>b.Na()){this.h=!0;return}f=b.jd();k=!0}var l=this.i.get(g);if(l){var m=null,n=null;if(this.j.get(g)==lh){if(d&&b.va()+4>b.Na()){this.h=!0;return}n=b.R();m=n>>>24;n&=16777215}g=e+f;c&&g>b.Na()&&(g=b.Na());d&&g>b.Na()?this.h=!0:(g-=b.va(),b=g>0?b.Ea(g,!1):new Uint8Array(0),b=new $g(b,0),l({name:h,parser:this,partialOkay:c||!1,stopOnPartial:d||!1,
version:m,flags:n,reader:b,size:f,start:e+a,has64BitSize:k}))}else b.skip(Math.max(0,Math.min(e+f-b.va(),b.Na()-b.va())))}};function nh(a){for(var b=oh(a);a.reader.Va()&&!a.parser.h;)a.parser.ed(a.start+b,a.reader,a.partialOkay,a.stopOnPartial)}function sh(a){for(var b=oh(a),c=a.reader.R(),d=0;d<c&&(a.parser.ed(a.start+b,a.reader,a.partialOkay,a.stopOnPartial),!a.parser.h);d++);}
function th(a){var b=oh(a);for(a.reader.skip(78);a.reader.Va()&&!a.parser.h;)a.parser.ed(a.start+b,a.reader,a.partialOkay,a.stopOnPartial)}function uh(a){var b=oh(a);a.reader.skip(8);var c=a.reader.kb();a.reader.skip(6);c==2?a.reader.skip(48):a.reader.skip(12);for(c==1&&a.reader.skip(16);a.reader.Va()&&!a.parser.h;)a.parser.ed(a.start+b,a.reader,a.partialOkay,a.stopOnPartial)}function vh(a,b){return function(c){a(c.reader.Ea(c.reader.Na()-c.reader.va(),b))}}
function jh(a){var b=0;a=r(a);for(var c=a.next();!c.done;c=a.next())b=b<<8|c.value.charCodeAt(0);return b}function mh(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}function oh(a){return 8+(a.has64BitSize?8:0)+(a.flags!=null?4:0)}I("shaka.util.Mp4Parser",ih);ih.headerSize=oh;ih.typeToString=mh;ih.allData=vh;ih.audioSampleEntry=uh;ih.visualSampleEntry=th;ih.sampleDescription=sh;ih.children=nh;ih.prototype.parseNext=ih.prototype.ed;ih.prototype.parse=ih.prototype.parse;
ih.prototype.stop=ih.prototype.stop;ih.prototype.fullBoxes=ih.prototype.nh;ih.prototype.fullBox=ih.prototype.S;ih.prototype.boxes=ih.prototype.ma;ih.prototype.box=ih.prototype.box;var kh=0,lh=1,wh=["moov","trak","mdia","minf","stbl"],xh=["moof","traf"],yh=["av01","dav1"],zh=[].concat(F(["avc1","avc3","dvav","dva1"]),F(["hev1","hvc1","dvh1","dvhe"])),Ah=[].concat(F(zh),F(["vvc1","vvi1","dvc1","dvi1"])),Bh="ac-3 ec-3 ac-4 Opus fLaC apac iamf".split(" ");function Ch(a,b){for(var c=0,d=0;d<8&&!(b+d>=a.byteLength);d++){var e=a[b+d];c+=(e&127)*Math.pow(2,d*7);if(!(e&128))return{value:c,size:d+1}}return null};function Dh(a,b){var c=null,d=null,e=null,f=null,g=a.R();b&1&&(e=a.jd());b&2&&(f=a.R());b&8&&(c=a.R());b&16&&(d=a.R());return{trackId:g,Zb:c,$b:d,Vg:e,zg:f}}function Eh(a,b){return b==1?(b=a.R(),a=a.R(),{wb:b*4294967296+a}):{wb:a.R()}}function Fh(a,b){b==1?(a.skip(8),a.skip(8)):(a.skip(4),a.skip(4));b=a.R();a.skip(4);a=a.kb();return{timescale:b,language:String.fromCharCode((a>>10)+96)+String.fromCharCode(((a&960)>>5)+96)+String.fromCharCode((a&31)+96)}}
function Gh(a,b,c){var d=a.R(),e=[],f=null;c&1&&(f=a.mg());c&4&&a.skip(4);for(var g=0;g<d;g++){var h={Gc:null,sampleSize:null,$e:null};c&256&&(h.Gc=a.R());c&512&&(h.sampleSize=a.R());c&1024&&a.skip(4);c&2048&&(h.$e=b==0?a.R():a.mg());e.push(h)}return{sampleCount:d,Fc:e,Xb:f}}
function Hh(a,b){b==1?(a.skip(8),a.skip(8)):(a.skip(4),a.skip(4));var c=a.R();b==1?a.skip(8):a.skip(4);a.skip(4);a.skip(8);a.skip(2);a.skip(2);a.skip(2);a.skip(2);a.skip(36);b=a.kb()+a.kb()/16;a=a.kb()+a.kb()/16;return{trackId:c,width:b,height:a}}function Ih(a){a=a.R();return{codec:mh(a)}}function Jh(a,b){a.Ja();var c=a.Ja(),d=b>=1?c>>4&15:0;b=b>=1?c&15:0;c=a.Ja();var e=a.Ja(),f=a.Ea(16,!1);f=Pb(f);var g=null;c===1&&e===0&&(g=a.Ja(),g=a.Ea(g,!0));return{defaultKID:f,om:c,ij:e,ve:d,we:b,Yb:g}}
function Kh(a){for(a=String(a);a.length<2;)a="0"+a;return a}function Lh(a,b,c,d){var e=!!(b&2);b&1&&(a.skip(3),c=a.Ja(),a.skip(16),c===0&&(d=a.Ja(),d=a.Ea(d,!0)));b=a.R();for(var f=[],g=0;g<b;g++){var h=d;if(c>0)h=a.Ea(c,!0);else if(!h)throw Error("SENC specifies IV size 0 but no constant IV is available.");var k=new Uint8Array(16);k.set(h.subarray(0,Math.min(h.length,16)),0);h=null;if(e){var l=a.kb();h=[];for(var m=0;m<l;m++)h.push({Ed:a.kb(),bc:a.R()})}f.push({iv:k,Ii:h})}return{li:f}};function Mh(){this.l=new Map;this.j=this.i=0;this.m=null;this.h=Nh}
Mh.prototype.init=function(a){function b(g){g=g.name;Oh.has(g)&&(c.h=Oh.get(g))}var c=this,d=[],e=[],f=null;(new ih).ma([].concat(F(wh),["mvex"]),nh).S("trex",function(g){var h=g.reader;h.skip(4);h.skip(4);g=h.R();h=h.R();c.i=g;c.j=h}).S("tkhd",function(g){g=Hh(g.reader,g.version);f=g.trackId;d.push(g.trackId)}).S("mdhd",function(g){g=Fh(g.reader,g.version);e.push(g.timescale)}).S("stsd",sh).ma(Ah,b).ma(yh,b).box("encv",th).box("sinf",nh).box("frma",function(g){g=Ih(g.reader).codec;Oh.has(g)&&(c.h=
Oh.get(g))}).box("c608",function(){c.h=Ph;c.m=f}).parse(a,!0,!0);if(!d.length||!e.length||d.length!=e.length)throw new T(2,2,2010);this.h==Nh&&Ua("Unable to determine bitstream format for CEA parsing!");d.forEach(function(g,h){c.l.set(g,e[h])})};
Mh.prototype.parse=function(a){var b=this;if(this.h==Nh)return[];var c=[],d=0,e=[];(new ih).box("moof",function(f){d=f.start;e=[];nh(f)}).box("traf",function(f){e.push({trackId:null,wb:null,Zb:b.i,$b:b.j,hg:[],timescale:9E4});nh(f)}).S("trun",function(f){var g=e[e.length-1];f=Gh(f.reader,f.version,f.flags);g.hg.push(f)}).S("tfhd",function(f){var g=e[e.length-1];f=Dh(f.reader,f.flags);g.trackId=f.trackId;g.Zb=f.Zb||b.i;g.$b=f.$b||b.j;f=f.trackId;b.l.has(f)&&(g.timescale=b.l.get(f))}).S("tfdt",function(f){var g=
e[e.length-1];f=Eh(f.reader,f.version);g.wb=f.wb}).box("mdat",function(f){for(var g=d-f.start-8,h=f.reader.va(),k=r(e),l=k.next();!l.done;l=k.next()){var m=l.value;if(b.h!=Ph||m.trackId===b.m)if(m.wb===null)Ua("Unable to find base media decode time for CEA captions!");else if(f.reader.seek(h),b.h===Ph){l=f.reader;var n=m.timescale,p=m.Zb,t=m.$b,u=m.wb,v=r(m.hg);for(m=v.next();!m.done;m=v.next()){m=m.value;m.Xb!=null&&l.seek(g+m.Xb);m=r(m.Fc);for(var w=m.next();!w.done;w=m.next()){w=w.value;var x=
u/n,y=l.Ea(w.sampleSize||t,!1);c.push({packet:y,pts:x,format:Vc});u+=w.Gc||p}}}else a:for(l=b,n=f.reader,p=m.timescale,t=m.Zb,u=m.$b,v=m.wb,m=r(m.hg),w=m.next();!w.done;w=m.next())for(w=w.value,w.Xb!=null&&n.seek(g+w.Xb),w=r(w.Fc),x=w.next();!x.done;x=w.next()){x=x.value;y=(v+(x.$e||0))/p;var z=x.sampleSize||u;if(l.h==Qh)try{var D=n.Ea(z,!1);z=[];for(var A=0;A<D.byteLength;){var B=A,E=D[A++];if(E&128)break;var C=(E&120)>>3,G=(E&2)!=0;if((E&4)!=0){if(A>=D.byteLength)break;A++}if(G){var K=Ch(D,A);if(!K)break;
var L=K.value;A+=K.size}else L=D.byteLength-A;G=A+L;if(G>D.byteLength)break;z.push({type:C,data:D.subarray(A,G),fullData:D.subarray(B,G)});A=G}for(var N=r(z),J=N.next();!J.done;J=N.next()){var O=J.value;if(O.type==5){var M=Ch(O.data,0);M&&M.value==4&&c.push({packet:O.data.subarray(M.size),pts:y,format:Uc})}}}catch(P){break a}else for(;z>0&&n.Va();){A=n.R();C=n.Ja();B=1;switch(l.h){case Rh:C&=31;C=lg(mg,C);break;case Sh:case Th:B=2;n.skip(1);C=C>>1&63;C=lg(l.h===Sh?ng:og,C);break;default:break a}if(C)for(B=
n.Ea(A-B,!1),B=r(hh(B)),C=B.next();!C.done;C=B.next())c.push({packet:C.value,pts:y,format:Uc});else try{n.skip(A-B)}catch(P){break a}z-=A+4}v+=x.Gc||t}}}).parse(a,!1,!0);return c};I("shaka.cea.Mp4CeaParser",Mh);var Nh=0,Rh=1,Sh=2,Th=3,Ph=4,Qh=5,Oh=(new Map).set("avc1",Rh).set("avc3",Rh).set("dvav",Rh).set("dva1",Rh).set("hev1",Sh).set("hvc1",Sh).set("dvh1",Sh).set("dvhe",Sh).set("vvc1",Th).set("vvi1",Th).set("dvc1",Th).set("dvi1",Th).set("av01",Qh).set("dav1",Qh);Wc("video/mp4",function(){return new Mh});function Uh(){}function Vh(a,b){var c=Wh.get(b)||[];b=[];c=r(c);for(var d=c.next();!d.done;d=c.next())d=d.value,b.push.apply(b,F(d().parse(a)));a=new Set;c=[];b=r(b);for(d=b.next();!d.done;d=b.next())d=d.value,a.has(d.key)||(a.add(d.key),c.push(d));return c}function Xh(a){a=Wh.get(a);return a!=null&&a.length>0}function Yh(a,b){Wh.has(a)||Wh.set(a,[]);Wh.get(a).push(b)}I("shaka.metadata.Metadata",Uh);Uh.unregisterParserByMime=function(a){Wh.delete(a)};Uh.registerParserByMime=Yh;Uh.supports=Xh;
Uh.getMetadataFrames=Vh;var Wh=new Map;function Zh(){}function $h(a,b){return b+10<=a.length&&a[b]===73&&a[b+1]===68&&a[b+2]===51&&a[b+3]<255&&a[b+4]<255&&a[b+6]<128&&a[b+7]<128&&a[b+8]<128&&a[b+9]<128?!0:!1}function ai(a,b){return b+10<=a.length&&a[b]===51&&a[b+1]===68&&a[b+2]===73&&a[b+3]<255&&a[b+4]<255&&a[b+6]<128&&a[b+7]<128&&a[b+8]<128&&a[b+9]<128?!0:!1}function bi(a,b){var c=(a[b]&127)<<21;c|=(a[b+1]&127)<<14;c|=(a[b+2]&127)<<7;return c|=a[b+3]&127}
function ci(a,b){switch(b){case 0:return Array.from(a).map(function(c){return String.fromCharCode(c)}).join("");case 1:return Gb(a);case 2:return Eb(a,!1);case 3:return Db(a);default:return""}}function di(a){return a===1||a===2?2:1}function ei(a,b,c){c=c===void 0?0:c;if(b===1||b===2){for(b=c;b+1<a.length;b+=2)if(a[b]===0&&a[b+1]===0)return b;return-1}return a.indexOf(0,c)}
function fi(a){var b={key:a.type,description:"",data:"",mimeType:null,pictureType:null};if(a.type==="APIC"){if(a.size<2)return null;var c=a.data[0],d=a.data.subarray(1).indexOf(0);if(d===-1)return null;var e=Db(S(a.data,1,d)),f=a.data[2+d],g=3+d;d=ei(a.data,c,g);if(d===-1)return null;g=ci(a.data.subarray(g,d),c);c=d+di(c);var h;e==="--\x3e"?h=Db(a.data.subarray(c)):h=ub(a.data.subarray(c));b.mimeType=e;b.pictureType=f;b.description=g;b.data=h;return b}if(a.type==="COMM"){if(a.size<5)return null;h=
a.data[0];e=Db(a.data.subarray(1,4)).replace(/\0/g,"");c=ei(a.data,h,4);if(c===-1)return null;f=ci(a.data.subarray(4,c),h);a=ci(a.data.subarray(c+di(h)),h).replace(/\0*$/,"");b.description=f||e;b.data=a;return b}if(a.type==="TXXX"){if(a.size<2)return null;f=a.data[0];h=ei(a.data,f,1);if(h===-1)return null;e=ci(a.data.subarray(1,h),f);a=ci(a.data.subarray(h+di(f)),f).replace(/^\ufeff/,"").replace(/\0*$/,"");b.description=e;b.data=a;return b}if(a.type==="WXXX"){if(a.size<2)return null;f=a.data[0];h=
ei(a.data,f,1);if(h===-1)return null;e=ci(a.data.subarray(1,h),f);a=Db(a.data.subarray(h+di(f))).replace(/\0*$/,"");b.description=e;b.data=a;return b}if(a.type==="PRIV"){if(a.size<2)return null;e=a.data.indexOf(0);if(e===-1)return null;e=Db(S(a.data,0,e));b.description=e;e=="com.apple.streaming.transportStreamTimestamp"?(e=a.data.subarray(e.length+1),a=e[3]&1,e=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7],e/=45,a&&(e+=4.772185884E7),b.data=e):(a=ub(a.data.subarray(e.length+1)),b.data=a);return b}if(a.type===
"UFID"){e=a.data.indexOf(0);if(e===-1)return null;f=Db(S(a.data,0,e));b.description=f;b.data=ub(a.data.subarray(e+1));return b}if(a.type[0]==="T"){if(a.size<2)return null;a=ci(a.data.subarray(1),a.data[0]).replace(/\0+$/,"").split("\x00").map(function(k){return k.replace(/^\ufeff/,"")}).filter(function(k){return k.length>0}).join(" / ");b.data=a;return b}return a.type[0]==="W"?(a=Db(a.data).replace(/\0*$/,""),b.data=a,b):a.data?(b.data=ub(a.data),b):null}
function gi(a){for(var b=0,c=[];$h(a,b);){var d=a[b+3],e=bi(a,b+6);a[b+5]>>6&1&&(b+=10);b+=10;for(e=b+e;b+10<e&&a[b]!==0;){var f=a.subarray(b);if(d>=4)var g=bi(f,4);else g=f[4]<<24,g|=f[5]<<16,g|=f[6]<<8,g|=f[7],g>>>=0;f={type:String.fromCharCode(f[0],f[1],f[2],f[3]),size:g,data:f.subarray(10,10+g)};(g=fi(f))&&c.push(g);b+=f.size+10}ai(a,b)&&(b+=10)}return c}
function hi(a,b){for(var c=b=b===void 0?0:b,d=0;$h(a,b);)a[b+5]>>6&1&&(d+=10),d+=10,d+=bi(a,b+6),ai(a,b+10)&&(d+=10),b+=d;return d>0?a.subarray(c,c+d):new Uint8Array([])}Zh.prototype.parse=function(a){return gi(a)};I("shaka.metadata.Id3Utils",Zh);Zh.prototype.parse=Zh.prototype.parse;Zh.getID3Data=hi;Zh.getID3Frames=gi;for(var ii=r(Ee),ji=ii.next();!ji.done;ji=ii.next())Yh(ji.value,function(){return new Zh});/*

 Copyright Brightcove, Inc.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
*/
function ki(a,b){this.l=a;if(b===void 0?0:b)this.l=Sb(a);this.j=this.l.byteLength;this.h=this.i=0}function li(a){var b=a.l.byteLength-a.j,c=Math.min(4,a.j);if(c!==0){for(var d=0,e=0;e<c;e++)d=d<<8|a.l[b+e];a.i=d<<(4-c)*8;a.h=c*8;a.j-=c}}function mi(a,b){if(a.h<=b){b-=a.h;var c=Math.floor(b/8);b-=c*8;a.h-=c;li(a)}a.i<<=b;a.h-=b}function ni(a,b){var c=Math.min(a.h,b),d=a.i>>>32-c;a.h-=c;a.h>0?a.i<<=c:a.j>0&&li(a);c=b-c;return c>0?d<<c|ni(a,c):d}
function oi(a){for(var b=0;a.h===0;){if(a.j===0)return b;li(a)}for(;;){var c=Math.clz32(a.i);c>a.h&&(c=a.h);b+=c;a.i<<=c;a.h-=c;if(a.h>0||a.j===0)break;li(a)}return b}function pi(a){mi(a,1+oi(a))}function qi(a){var b=oi(a);return ni(a,b+1)-1}function ri(a){return ni(a,1)===1}function si(a,b){for(var c=8,d=8,e=0;e<b;e++)d!==0&&(d=qi(a),d=(c+(1&d?1+d>>>1:-1*(d>>>1))+256)%256),c=d===0?c:d}I("shaka.util.ExpGolomb",ki);function ti(){this.N=null;this.O=!1;this.j=this.H=null;this.u=[];this.m=[];this.h=[];this.I=this.F=null;this.o=[];this.l=[];this.i=[];this.G=null;this.C=[];this.A=[];this.L=this.K=this.D=null}q=ti.prototype;q.clearData=function(){this.u=[];this.m=[];this.h=[];this.o=[];this.l=[];this.i=[];this.C=[];this.A=[]};q.si=function(a){this.L!=null&&this.L!=a&&(this.D=null);this.L=a};
q.parse=function(a){if(a.length<564)return this;for(var b=Math.max(0,ui(a)),c=a.length-(a.length+b)%188,d=!1,e=b;e<c;e+=188)if(a[e]==71){var f=!!(a[e+1]&64),g=((a[e+1]&31)<<8)+a[e+2];if((a[e+3]&48)>>4>1){var h=e+5+a[e+4];if(h==e+188)continue}else h=e+4;switch(g){case 0:f&&(h+=a[h]+1);this.N=(a[h+10]&31)<<8|a[h+11];break;case 17:case 8191:break;case this.N:f&&(h+=a[h]+1);f=a;g={audio:-1,video:-1,Zc:-1,audioCodec:"",videoCodec:""};var k=h+3+((f[h+1]&15)<<8|f[h+2])-4;for(h+=12+((f[h+10]&15)<<8|f[h+11]);h<
k;){var l=(f[h+1]&31)<<8|f[h+2],m=(f[h+3]&15)<<8|f[h+4];switch(f[h]){case 6:if(m>0)for(var n=h+5,p=m;p>2;){var t=f[n+1]+2;switch(f[n]){case 5:var u=n+2;u=f[u]<<24|f[u+1]<<16|f[u+2]<<8|f[u+3];g.audio==-1&&u===1332770163?(g.audio=l,g.audioCodec="opus"):g.video==-1&&u===1096167473&&(g.video=l,g.videoCodec="av1");break;case 106:g.audio==-1&&(g.audio=l,g.audioCodec="ac3");break;case 122:g.audio==-1&&(g.audio=l,g.audioCodec="ec3");break;case 124:g.audio==-1&&(g.audio=l,g.audioCodec="aac");break;case 128:g.videoCodec==
"av1"&&t>=5&&(this.K=f.subarray(n+2,n+5))}n+=t;p-=t}break;case 15:g.audio==-1&&(g.audio=l,g.audioCodec="aac");break;case 17:g.audio==-1&&(g.audio=l,g.audioCodec="aac-loas");break;case 21:g.Zc==-1&&(g.Zc=l);break;case 27:g.video==-1&&(g.video=l,g.videoCodec="avc");break;case 3:case 4:g.audio==-1&&(g.audio=l,g.audioCodec="mp3");break;case 36:g.video==-1&&(g.video=l,g.videoCodec="hvc");break;case 129:g.audio==-1&&(g.audio=l,g.audioCodec="ac3");break;case 132:case 135:g.audio==-1&&(g.audio=l,g.audioCodec=
"ec3")}h+=m+5}f=g;f.video!=-1&&(this.H=f.video,this.j=f.videoCodec);f.audio!=-1&&(this.F=f.audio,this.I=f.audioCodec);f.Zc!=-1&&(this.G=f.Zc);h=[f.video,f.audio,f.Zc];f.video==-1&&h.includes(this.H)&&(this.j=this.H=null);f.audio==-1&&h.includes(this.F)&&(this.I=this.F=null);f.Zc==-1&&h.includes(this.G)&&(this.G=null);d&&!this.O&&(d=!1,e=b-188);this.O=!0;break;case this.H:h=a.subarray(h,e+188);f?(this.m.push(this.u.length),this.u.push(h)):this.m.length&&this.u.push(h);break;case this.F:h=a.subarray(h,
e+188);f?(this.l.push(this.o.length),this.o.push(h)):this.l.length&&this.o.push(h);break;case this.G:h=a.subarray(h,e+188);f?(this.A.push(this.C.length),this.C.push(h)):this.A.length&&this.C.push(h);break;default:d=!0}}return this};function vi(a,b,c){return Rb(a,b[c],c+1<b.length?b[c+1]:a.length)}
function wi(a,b,c){if(b.byteLength<9||(b[0]<<16|b[1]<<8|b[2])!==1)return null;var d=b[4]<<8|b[5];if(d&&d>c-6)return null;var e=null,f=null,g=b[7];if(b.byteLength<xi(b))return null;if(g&192){e=(b[9]&14)*536870912+(b[10]&255)*4194304+(b[11]&254)*16384+(b[12]&255)*128+(b[13]&254)/2;var h=null;g&64&&(h=(b[14]&14)*536870912+(b[15]&255)*4194304+(b[16]&254)*16384+(b[17]&255)*128+(b[18]&254)/2,e=yi(e,h));a.D==null&&(a.D=e);e=yi(e,a.D);f=a.D=e;h!=null&&(f=yi(h,e))}a=b[8]+9;return c<=a?null:{packetLength:d,
Ek:a,pts:e,dts:f}}function zi(a,b){return(a=wi(a,b,b.byteLength))?{data:b.subarray(a.Ek),packetLength:a.packetLength,pts:a.pts,dts:a.dts,nalus:[]}:null}
q.$h=function(a,b){var c=a.pts?a.pts/9E4:null;a=a.data;var d=a.byteLength,e=1;this.j=="hvc"&&(e=2);var f=b.state||0,g=f,h=0,k=[],l=-1,m=0,n=this.j==="hvc";f==-1&&(l=0,m=n?a[0]>>1&63:a[0]&31,f=0,h=1);for(;h<d;){var p=a[h++];if(f)if(f===1)f=p?0:2;else if(p)if(p==1){p=h-f-1;if(l>=0)k.push({data:a.subarray(l+e,p),fullData:a.subarray(l,p),type:m,time:c,state:null});else if(f=k.length?k[k.length-1]:b.Pe)g&&h<=4-g&&f.state&&(f.data=f.data.subarray(0,f.data.byteLength-g),f.fullData=f.fullData.subarray(0,
f.fullData.byteLength-g)),p>0&&(p=a.subarray(0,p),f.data=Qb(f.data,p),f.fullData=Qb(f.fullData,p),f.state=0);h<d?(m=n?a[h]>>1&63:a[h]&31,l=h,f=0):f=-1}else f=0;else f=3;else f=p?0:1}l>=0&&f>=0&&k.push({data:a.subarray(l+e,d),fullData:a.subarray(l,d),type:m,time:c,state:f});!k.length&&b.Pe&&(c=k.length?k[k.length-1]:b.Pe)&&(c.data=Qb(c.data,a),c.fullData=Qb(c.fullData,a));b.state=f;return k};
q.getMetadata=function(){for(var a=[],b=0;b<this.A.length;b++){var c=vi(this.C,this.A,b);(c=zi(this,c))&&a.push({cueTime:c.pts?c.pts/9E4:null,data:c.data,frames:gi(c.data),dts:c.dts,pts:c.pts})}return a};
q.oh=function(){if(this.l.length&&!this.i.length)for(var a=0;a<this.l.length;a++){var b=vi(this.o,this.l,a),c=zi(this,b),d=this.i.length?this.i[this.i.length-1]:null;c&&c.pts!=null&&c.dts!=null&&(!d||d.pts!=c.pts&&d.dts!=c.dts)?this.i.push(c):this.i.length&&(b=c?c.data:b)&&(d=this.i[this.i.length-1],d.data=Qb(d.data,b))}return this.i};
q.De=function(a){a=a===void 0?!0:a;if(this.m.length&&!this.h.length){for(var b=0;b<this.m.length;b++){var c=vi(this.u,this.m,b),d=zi(this,c),e=this.h.length?this.h[this.h.length-1]:null;d&&d.pts!=null&&d.dts!=null&&(!e||e.pts!=d.pts&&e.dts!=d.dts)?this.h.push(d):this.h.length&&(c=d?d.data:c)&&(e=this.h[this.h.length-1],e.data=Qb(e.data,c))}if(a&&this.j!="av1"){b={Pe:null,state:null};e=[];c=r(this.h);for(d=c.next();!d.done;d=c.next())d=d.value,d.nalus=this.$h(d,b),d.nalus.length&&(e.push(d),b.Pe=d.nalus[d.nalus.length-
1]);this.h=e}}return a?this.h:(a=this.h,this.h=[],a)};function Ai(a,b){if(b=="audio"){b=a.o;var c=a.l}else if(b=="video")b=a.u,c=a.m;else return null;for(var d=0;d<c.length;d++){var e=c[d],f=d+1<c.length?c[d+1]:b.length,g=b[e];if(g){for(var h=0,k=e;k<f;k++)h+=b[k].byteLength;e=g.byteLength>=9&&g.byteLength>=xi(g)?g:Rb(b,e,f);if(h=wi(a,e,h))if(h=Bi(h),h!=null)return h}}return null}function xi(a){a=a[7];return a&64?19:a&192?14:9}
function Bi(a){return a.pts==null||a.dts==null?null:Math.min(a.dts,a.pts)/9E4}q.getStartTime=function(a){if(a=="audio")a=this.oh();else if(a=="video")a=this.De(!1);else return null;return a.length?Bi(a[0]):null};q.qh=function(){return{audio:this.I,video:this.j}};q.Ee=function(){for(var a=[],b=r(this.De()),c=b.next();!c.done;c=b.next())a.push.apply(a,F(c.value.nalus));return a};
q.$j=function(){if(this.j=="hvc")var a=Ci(this);else if(this.j=="av1"){if(a={height:null,width:null,codec:null,frameRate:Di(this)},this.K){var b=new Uint8Array(4);b.set(this.K);var c=new $g(b,0);c.skip(1);b=c.Ja();c=c.Ja();var d=b>>>5,e=(c&64)>>6;b="av01."+d+"."+Kh(b&31)+(c>>>7?"H":"M")+"."+Kh(d===2&&e?(c&32)>>5?12:10:e?10:8)+"."+((c&16)>>4)+"."+((c&8)>>3)+((c&4)>>2)+(c&3)+"."+Kh(1)+"."+Kh(1)+"."+Kh(1)+".0";a.codec=b}}else a=Ei(this);return a};
function Di(a){var b=a.De();return b.length>1&&(a=b[0].pts,b=b[1].pts,!isNaN(b-a))?Math.abs(1/(b-a)*9E4):null}
function Ei(a){var b={height:null,width:null,codec:null,frameRate:null},c=a.Ee();if(!c.length)return b;c=c.find(function(t){return t.type==7});if(!c)return b;c=new ki(c.data);var d=ni(c,8),e=ni(c,8),f=ni(c,8);pi(c);if(Fi.includes(d)){var g=qi(c);g===3&&mi(c,1);pi(c);pi(c);mi(c,1);if(ri(c)){g=g!==3?8:12;for(var h=0;h<g;h++)ri(c)&&(h<6?si(c,16):si(c,64))}}pi(c);g=qi(c);if(g===0)qi(c);else if(g===1)for(mi(c,1),pi(c),pi(c),g=qi(c),h=0;h<g;h++)pi(c);pi(c);mi(c,1);g=qi(c);h=qi(c);var k=ni(c,1);k===0&&mi(c,
1);mi(c,1);var l=0,m=0,n=0,p=0;ri(c)&&(l=qi(c),m=qi(c),n=qi(c),p=qi(c));b.height=String((2-k)*(h+1)*16-n*2-p*2);b.width=String((g+1)*16-l*2-m*2);b.codec="avc1."+("0"+d.toString(16).toUpperCase()).slice(-2)+("0"+e.toString(16).toUpperCase()).slice(-2)+("0"+f.toString(16).toUpperCase()).slice(-2);b.frameRate=Di(a);return b}
function Ci(a){var b={height:null,width:null,codec:null,frameRate:null},c=a.Ee();if(!c.length)return b;c=c.find(function(A){return A.type==33});if(!c)return b;var d=new ki(c.fullData,!0);ni(d,8);ni(d,8);ni(d,4);var e=ni(d,3);ri(d);var f=ni(d,2);c=ni(d,1);for(var g=ni(d,5),h=ni(d,32),k=ni(d,8),l=ni(d,8),m=ni(d,8),n=ni(d,8),p=ni(d,8),t=ni(d,8),u=ni(d,8),v=[],w=[],x=0;x<e;x++)v.push(ri(d)),w.push(ri(d));if(e>0)for(x=e;x<8;x++)ni(d,2);for(x=0;x<e;x++)v[x]&&ni(d,88),w[x]&&ni(d,8);qi(d);e=qi(d);e==3&&ni(d,
1);v=qi(d);w=qi(d);var y=x=0,z=0,D=0;ri(d)&&(x+=qi(d),y+=qi(d),z+=qi(d),D+=qi(d));b.width=String(v-(x+y)*(e===1||e===2?2:1));b.height=String(w-(z+D)*(e===1?2:1));d=function(A){for(var B=0,E=0;E<32;E++)B|=(A>>E&1)<<31-E;return B>>>0}(h);f="hvc1"+("."+["","A","B","C"][f]+g);f+="."+d.toString(16).toUpperCase();f+="."+(c==1?"H":"L")+u;t&&(f+="."+t.toString(16).toUpperCase());p&&(f+="."+p.toString(16).toUpperCase());n&&(f+="."+n.toString(16).toUpperCase());m&&(f+="."+m.toString(16).toUpperCase());l&&(f+=
"."+l.toString(16).toUpperCase());k&&(f+="."+k.toString(16).toUpperCase());b.codec=f;b.frameRate=Di(a);return b}function yi(a,b){var c=1;for(a>b&&(c=-1);Math.abs(b-a)>4294967296;)a+=c*8589934592;return a}function Gi(a){return ui(a)<0?!1:!0}function ui(a){for(var b=Math.min(1E3,a.length-564),c=0;c<b;){if(a[c]==71&&a[c+188]==71&&a[c+376]==71)return c;var d=a.indexOf(71,c+1);c=d>=0&&d<b?d:c+1}return-1}I("shaka.util.TsParser",ti);ti.syncOffset=ui;ti.probe=Gi;ti.prototype.getVideoInfo=ti.prototype.$j;
ti.prototype.getVideoNalus=ti.prototype.Ee;ti.prototype.getCodecs=ti.prototype.qh;ti.prototype.getStartTime=ti.prototype.getStartTime;ti.prototype.getVideoData=ti.prototype.De;ti.prototype.getAudioData=ti.prototype.oh;ti.prototype.getMetadata=ti.prototype.getMetadata;ti.prototype.parseNalus=ti.prototype.$h;ti.prototype.parse=ti.prototype.parse;ti.prototype.setDiscontinuitySequence=ti.prototype.si;ti.prototype.clearData=ti.prototype.clearData;ti.Timescale=9E4;
var Fi=[100,110,122,244,44,83,86,118,128,138,139,134];function Hi(){this.h=null}Hi.prototype.init=function(){};Hi.prototype.parse=function(a){this.h?this.h.clearData():this.h=new ti;var b=[];a=S(a);if(!Gi(a))return b;var c=this.h.parse(a);a=null;switch(c.qh().video){case "avc":a=mg;break;case "hvc":a=ng}if(a==null)return b;c=c.Ee();c=r(c);for(var d=c.next();!d.done;d=c.next())if(d=d.value,d.time!=null&&lg(a,d.type))for(var e=r(hh(d.data)),f=e.next();!f.done;f=e.next())b.push({packet:f.value,pts:d.time,format:Uc});return b};
I("shaka.cea.TsCeaParser",Hi);Wc("video/mp2t",function(){return new Hi});function Ii(a,b){if(b+1<a.length&&a[b]===255&&(a[b+1]&246)===240){var c=a[b+1]&1?7:9;if(b+c>=a.length)return!1;var d=(a[b+3]&3)<<11|a[b+4]<<3|(a[b+5]&224)>>>5;if(d<=c)return!1;b+=d;return b===a.length||b+1<a.length&&a[b]===255&&(a[b+1]&246)===240}return!1};function Ji(a,b){if(!(b+1<a.length&&Ki(a,b)))return null;var c=a[b+1]>>3&3,d=a[b+1]>>1&3,e=a[b+2]>>4&15,f=a[b+2]>>2&3;if(c!==1&&e!==0&&e!==15&&f!==3){var g=a[b+3]>>6;e=Li[(c===3?3-d:d===3?3:4)*14+e-1]*1E3;f=Mi[(c===3?0:c===2?1:2)*3+f];var h=Ni[c][d],k=Oi[d];c=h*8*k;h=Math.floor(h*e/f+(a[b+2]>>1&1))*k;if(!h||!c||!f)return null;(k=(k=(navigator.userAgent||"").match(/Chrome\/(\d+)/i))?parseInt(k[1],10):0)&&k<=87&&d===2&&e>=224E3&&g===0&&(a[b+3]|=128);return{sampleRate:f,channelCount:g===3?1:2,mh:h,wm:c}}return null}
function Ki(a,b){return a[b]===255&&(a[b+1]&224)===224&&(a[b+1]&6)!==0}var Li=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],Mi=[44100,48E3,32E3,22050,24E3,16E3,11025,12E3,8E3],Ni=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Oi=[0,1,1,4];new Uint8Array([79,112,117,115,72,101,97,100]);I("shaka.config.CharacterEdgeStyle",{DEFAULT:0,NONE:1,DROP_SHADOW:2,RAISED:3,DEPRESSED:4,OUTLINE:5});I("shaka.config.CodecSwitchingStrategy",{RELOAD:"reload",SMOOTH:"smooth"});I("shaka.config.CrossBoundaryStrategy",{KEEP:"keep",RESET:"reset",RESET_TO_ENCRYPTED:"reset_to_encrypted",RESET_ON_ENCRYPTION_CHANGE:"RESET_ON_ENCRYPTION_CHANGE"});I("shaka.config.FontFamily",{DEFAULT:"",MONOSPACED_SERIF:'"Courier New", Courier, "Nimbus Mono L", "Cutive Mono", monospace',PROPORTIONAL_SERIF:'"Times New Roman", Times, Georgia, Cambria, "PT Serif Caption", serif',MONOSPACED_SANS_SERIF:'"Deja Vu Sans Mono", "Lucida Console", Monaco, Consolas, "PT Mono", monospace',PROPORTIONAL_SANS_SERIF:'Roboto, Arial, Helvetica, Verdana, "PT Sans Caption", sans-serif'});I("shaka.config.MsfVersion",{AUTO:"auto",DRAFT_18:"draft-18",DRAFT_20:"draft-20",DRAFT_21:"draft-21",DRAFT_22:"draft-22"});I("shaka.config.PositionArea",{DEFAULT:0,TOP_LEFT:1,TOP_CENTER:2,TOP_RIGHT:3,CENTER_LEFT:4,CENTER:5,CENTER_RIGHT:6,BOTTOM_LEFT:7,BOTTOM_CENTER:8,BOTTOM_RIGHT:9});I("shaka.config.RepeatMode",{OFF:0,ALL:1,SINGLE:2});function Pi(a){var b=this;this.h=[];this.data=[];(new ih).ma(["moov","moof"],nh).S("pssh",function(c){if(!(c.version>1)){var d=S(c.reader.i,-12,c.size);b.data.push(d);c=c.reader.Ea(16,!1);b.h.push(Pb(c))}}).parse(a)}
function Qi(a,b,c,d){var e=a.length,f=12+b.length+4+e;d>0&&(f+=4+16*c.size);var g=new Uint8Array(f),h=zb(g),k=0;h.setUint32(k,f);k+=4;h.setUint32(k,1886614376);k+=4;d<1?h.setUint32(k,0):h.setUint32(k,16777216);k+=4;g.set(b,k);k+=b.length;if(d>0)for(h.setUint32(k,c.size),k+=4,b=r(c),c=b.next();!c.done;c=b.next())c=Ob(c.value),g.set(c,k),k+=c.length;h.setUint32(k,e);g.set(a,k+4);return g};function Ri(a){var b=0,c=zb(a),d=c.getUint32(b,!0);if(d!=a.byteLength)return[];a:{a=b+4+2;for(b=[];a<c.byteLength-1;){d=c.getUint16(a,!0);a+=2;var e=c.getUint16(a,!0);a+=2;if((e&1)!=0||e+a>c.byteLength){c=[];break a}var f=S(c,a,e);b.push({type:d,value:f});a+=e}c=b}return c}function Si(a){a=Ri(a).find(function(b){return b.type===Ti});if(!a)return null;a=Eb(a.value,!0);return(a=md(a,"WRMHEADER"))?a:null}
function Ui(a){try{var b=Si(a);if(b)a:{for(var c=r(xd(b,"DATA")),d=c.next();!d.done;d=c.next()){var e=d.value;if(e.children)for(var f=r(e.children),g=f.next();!g.done;g=f.next()){var h=g.value;if(h.tagName=="LA_URL"){var k=vd(h);break a}}}k=""}else k="";return k}catch(l){return""}}var Ti=1;function Vi(){this.h=new Map}Vi.prototype.release=function(){this.h.clear()};
function Wi(a,b,c,d){var e=Xi(a,b),f=null;a=[];var g=[];b=null;var h=new Set(e.map(function(l){return l.keyId}));h.delete(null);var k="cenc";if(h.size>1)throw new T(2,4,4010);if(!c){g=e.filter(function(l){return l.ld=="urn:mpeg:dash:sea:2012"});if(g.length>1)throw new T(2,4,4050);g.length&&(b=Yi(g[0]));(g=e.find(function(l){return l.ld=="urn:mpeg:dash:mp4protection:2011"}))&&g.encryptionScheme&&(k=g.encryptionScheme);g=e.filter(function(l){return l.ld=="urn:mpeg:dash:mp4protection:2011"?(f=l.init||
f,!1):l.ld!="urn:mpeg:dash:sea:2012"});g.length&&(a=Zi(f,k,g,d,h),a.length==0&&(a=[rc("",k,f)]))}if(e.length&&!b&&(c||!g.length))for(a=[],c=r(Object.values(d)),d=c.next();!d.done;d=c.next())d=d.value,Yb(d)||(d=rc(d,k,f),a.push(d));if(h=Array.from(h)[0]||null)for(k=r(a),c=k.next();!c.done;c=k.next())for(c=r(c.value.initData),d=c.next();!d.done;d=c.next())d.value.keyId=h;return{ah:h,nm:f,drmInfos:a,yf:b,kh:!0}}
function $i(a,b,c,d,e){var f=Wi(a,b,d,e);if(c.kh){a=c.drmInfos.length==1&&!c.drmInfos[0].keySystem;b=f.drmInfos.length==0;if(c.drmInfos.length==0||a&&!b)c.drmInfos=f.drmInfos;c.kh=!1}else if(f.drmInfos.length>0&&(c.drmInfos=c.drmInfos.filter(function(g){return f.drmInfos.some(function(h){return h.keySystem==g.keySystem})}),c.drmInfos.length==0))throw new T(2,4,4008);return f.ah||c.ah}
function aj(a){var b=Bd(a.node,bj,"Laurl");if(b&&(b=vd(b)))return b;if((b=Bd(a.node,"urn:microsoft:playready","pro"))&&vd(b))return a=Nb(vd(b)),Ui(a);if(a=Bd(a.node,"urn:mpeg:cenc:2013","pssh"))if(a=vd(a)){b=Nb(a);a=8;b=zb(b);var c=b.getUint8(a);a+=20;c>0&&(a+=4+16*b.getUint32(a));a=S(b,a+4);return Ui(a)}return""}
function Zi(a,b,c,d,e){var f=[];c=r(c);for(var g=c.next();!g.done;g=c.next()){g=g.value;var h=d[g.ld];if(h){var k;if((k=Bd(g.node,"urn:microsoft:playready","pro"))&&vd(k)){k=vd(k);k=Nb(k);var l=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);k=[{initData:Qi(k,l,new Set,0),initDataType:"cenc",keyId:g.keyId}]}else k=null;l=null;if(g.ld==="urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e"){l=g;var m=e;if(m.size==0)l=null;else{var n=new Uint8Array([16,119,239,236,192,178,77,2,
172,227,60,30,82,226,251,75]),p=new Uint8Array([]);l=[{initData:Qi(p,n,m,1),initDataType:"cenc",keyId:l.keyId}]}}k=rc(h,b,g.init||a||k||l);if(h=cj.get(h))k.licenseServerUri=h(g);a:{if(g=Bd(g.node,bj,"Certurl"))if(g=vd(g))break a;g=""}k.serverCertificateUri=g;f.push(k)}}return f}function Xi(a,b){var c=[];b=r(b);for(var d=b.next();!d.done;d=b.next())(d=dj(a,d.value))&&c.push(d);return c}
function dj(a,b){var c=b.attributes.schemeIdUri,d=Ed(b,"urn:mpeg:cenc:2013","default_KID"),e=Cd(b,"urn:mpeg:cenc:2013","pssh").map(wd),f=b.attributes.value;if(!c)return null;c=c.toLowerCase();if(d&&(d=d.replace(/-/g,"").toLowerCase(),d.includes(" ")))throw new T(2,4,4009);var g=[];try{g=e.map(function(h){return{initDataType:"cenc",initData:a.h.getOrInsertComputed(h,function(){return Nb(h)}),keyId:null}})}catch(h){throw new T(2,4,4007);}return{node:b,ld:c,keyId:d,init:g.length>0?g:null,encryptionScheme:f}}
function Yi(a){if(!window.crypto||!window.crypto.subtle)throw Ua("Web Crypto API is not available to decrypt AES-128. (Web Crypto only exists in secure origins like https)"),new T(2,4,4042);var b=Bd(a.node,"urn:mpeg:dash:schema:sea:2012","SegmentEncryption");if(!b)throw new T(2,4,4051);if(b.attributes.schemeIdUri!="urn:mpeg:dash:sea:aes128-cbc:2013")throw new T(2,4,4051);b=Bd(a.node,"urn:mpeg:dash:schema:sea:2012","CryptoPeriod");if(!b)throw new T(2,4,4051);a=b.attributes.IV;b=Jb(b.attributes.keyUriTemplate);
if(!a||!b)throw new T(2,4,4051);a=Ob(a.substr(2));if(a.byteLength!=16)throw new T(2,4,4048);return{jk:b,iv:a}}
var cj=(new Map).set("com.apple.fps",function(a){if("apple"===window.shakaMediaKeysPolyfill)throw new T(2,4,4054);if(a=Bd(a.node,bj,"Laurl"))if(a=vd(a))return a;return""}).set("com.widevine.alpha",function(a){var b=Bd(a.node,bj,"Laurl");return b&&(b=vd(b))?b:(a=Bd(a.node,"urn:microsoft","laurl"))?Jb(a.attributes.licenseUrl)||"":""}).set("com.microsoft.playready",aj).set("com.microsoft.playready.recommendation",aj).set("com.microsoft.playready.software",aj).set("com.microsoft.playready.hardware",aj).set("org.w3.clearkey",
function(a){var b=Bd(a.node,bj,"Laurl");return b&&(b=vd(b))?b:(a=Bd(a.node,"http://dashif.org/guidelines/clearKey","Laurl"))&&a.attributes.Lic_type==="EME-1.0"&&a&&(a=vd(a))?a:""}),bj="https://dashif.org/CPS";function ej(a,b){var c=fj();this.u=a.maxAttempts==null?c.maxAttempts:a.maxAttempts;this.o=a.baseDelay==null?c.baseDelay:a.baseDelay;this.C=a.fuzzFactor==null?c.fuzzFactor:a.fuzzFactor;this.A=a.backoffFactor==null?c.backoffFactor:a.backoffFactor;this.h=0;this.i=this.o;this.m=b===void 0?!1:b;this.l=this.j=null;this.m&&(this.h=1)}
ej.prototype.attempt=function(){var a=this,b,c,d;return H(function(e){if(e.i==1){if(a.h>=a.u)if(a.m)a.h=1,a.i=a.o;else throw new T(2,7,1010);b=a.h;a.h++;if(b==0)return e.return();c=a.i*(1+(Math.random()*2-1)*a.C);d=Promise.withResolvers();a.j=d;a.l=gj(c,function(){a.j=null;a.l=null;d.resolve()});return e.h(d.promise,2)}a.i*=a.A;e.l()})};ej.prototype.stop=function(){var a;(a=this.l)==null||a.stop();this.l=null;var b;(b=this.j)==null||b.reject(new T(2,7,7001));this.j=null};
function fj(){return{maxAttempts:2,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:3E4,stallTimeout:5E3,connectionTimeout:1E4}}function gj(a,b){b=new gf(b);b.ka(a/1E3);return b};function hj(a,b){this.promise=a;this.j=b;this.h=null}function ij(a){return new hj(Promise.reject(a),function(){return Promise.resolve()})}function jj(){var a=Promise.reject(new T(2,7,7001));a.catch(function(){});return new hj(a,function(){return Promise.resolve()})}function kj(a){return new hj(Promise.resolve(a),function(){return Promise.resolve()})}ea.Object.defineProperties(hj.prototype,{aborted:{configurable:!0,enumerable:!0,get:function(){return this.h!==null}}});
hj.prototype.abort=function(){this.h||(this.h=this.j());return this.h};function lj(a){return new hj(Promise.all(a.map(function(b){return b.promise})),function(){return Promise.all(a.map(function(b){return b.abort()}))})}hj.prototype.finally=function(a){this.promise.then(function(){return a(!0)},function(){return a(!1)});return this};
hj.prototype.$a=function(a,b){function c(g){return function(h){if(e.h&&g)f.reject(new T(2,7,7001));else{var k=g?a:b;k?d=mj(k,h,f):(g?f.resolve:f.reject)(h)}}}function d(){f.reject(new T(2,7,7001));return e.abort()}var e=this,f=Promise.withResolvers();f.promise.catch(function(){});this.promise.then(c(!0),c(!1));return new hj(f.promise,function(){return d()})};
function mj(a,b,c){try{var d=a(b);if(d&&d.promise&&d.abort)return c.resolve(d.promise),function(){return d.abort()};c.resolve(d);return function(){return Promise.resolve(d).then(function(){},function(){})}}catch(e){return c.reject(e),function(){return Promise.resolve()}}}I("shaka.util.AbortableOperation",hj);hj.prototype.chain=hj.prototype.$a;hj.prototype["finally"]=hj.prototype.finally;hj.all=lj;hj.prototype.abort=hj.prototype.abort;hj.notAbortable=function(a){return new hj(a,function(){return a.catch(function(){})})};
hj.completed=kj;hj.aborted=jj;hj.failed=ij;function nj(a,b){if(b)if(b instanceof Map)for(var c=r(b.keys()),d=c.next();!d.done;d=c.next())d=d.value,Object.defineProperty(this,d,{value:b.get(d),writable:!0,enumerable:!0});else for(c in b)Object.defineProperty(this,c,{value:b[c],writable:!0,enumerable:!0});this.defaultPrevented=this.cancelable=this.bubbles=!1;this.timeStamp=window.performance&&window.performance.now?window.performance.now():Date.now();this.type=a;this.isTrusted=!1;this.target=this.currentTarget=null;this.h=!1}
nj.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)};nj.prototype.stopImmediatePropagation=function(){this.h=!0};nj.prototype.stopPropagation=function(){};I("shaka.util.FakeEvent",nj);function oj(){this.mc=new hb;this.Qg=this}oj.prototype.addEventListener=function(a,b){this.mc&&this.mc.push(a,b)};oj.prototype.removeEventListener=function(a,b){this.mc&&this.mc.remove(a,b)};oj.prototype.dispatchEvent=function(a){if(!this.mc)return!0;var b=this.mc.get(a.type)||[],c=this.mc.get("__shaka_all_events__");c&&(b=b.concat(c));b=r(b);for(c=b.next();!c.done;c=b.next()){c=c.value;a.target=this.Qg;a.currentTarget=this.Qg;try{c.handleEvent?c.handleEvent(a):c.call(this,a)}catch(d){}if(a.h)break}return a.defaultPrevented};
oj.prototype.release=function(){this.mc=null};function pj(){this.h=[]}function qj(a,b){a.h.push(b.finally(function(){cb(a.h,b)}))}pj.prototype.destroy=function(){for(var a=[],b=r(this.h),c=b.next();!c.done;c=b.next())c=c.value,c.promise.catch(function(){}),a.push(c.abort());this.h=[];return Promise.all(a)};function rj(a,b,c){c=c===void 0?"":c;if(b.length==0)return a;var d=[];a=r(a);for(var e=a.next();!e.done;e=a.next()){e=e.value;for(var f=r(b),g=f.next();!g.done;g=f.next()){g=new URL(g.value,e);if(c){var h=c.replace(/^[?&]/,""),k=g.search.replace(/^\?/,"");g.search=k?k+"&"+h:h}d.push(g.toString())}}return d}function sj(a){try{var b=(new URL(a)).protocol.slice(0,-1);if(b&&a.toLowerCase().startsWith(b+":"))return b}catch(c){}return(a=a.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):/))?a[1].toLowerCase():""}
function tj(a){try{var b=(new URL(a)).hostname;if(b)return b}catch(c){}return(a=a.match(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\/([^/?#]*)/))?a[1]:""}function uj(a,b){a=new URL(a);a.hostname=b;return a.toString()}function vj(a,b){b=b==null?void 0:b();if(!b)return a;a=new URL(a);b=b.replace(/^[?&]/,"").split("&").filter(function(c){return c});wj(a,b);return a.toString()}
function wj(a,b){function c(f){return f.split("=")[0]}var d=new Set(b.map(c)),e=a.search.replace(/^\?/,"").split("&").filter(function(f){return f&&!d.has(c(f))});a.search=e.concat(b).join("&")};function xj(a,b,c,d,e,f,g){oj.call(this);this.j=null;this.l=!1;this.A=new pj;this.h=new Set;this.i=new Set;this.u=a||null;this.o=b||null;this.C=c||null;this.D=d||null;this.F=e||null;this.H=f||null;this.G=g||null;this.m=new Map}ra(xj,oj);q=xj.prototype;q.configure=function(a){this.j=a};function yj(a,b,c,d){d=d===void 0?!1:d;c=c||zj;var e=Aj.get(a);(!e||c>=e.priority)&&Aj.set(a,{priority:c,Ve:b,Fk:d})}
function Bj(a,b){for(var c=r(a.h),d=c.next();!d.done;d=c.next())b.h.add(d.value);a=r(a.i);for(c=a.next();!c.done;c=a.next())b.i.add(c.value)}q.Ik=function(a){this.h.add(a)};q.hl=function(a){this.h.delete(a)};q.cj=function(){this.h.clear()};q.Jk=function(a){this.i.add(a)};q.il=function(a){this.i.delete(a)};q.dj=function(){this.i.clear()};q.Zg=function(){this.m.clear()};
function Cj(a,b,c){return{uris:a,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:b,licenseRequestType:null,sessionId:null,drmInfo:null,initData:null,initDataType:null,streamDataCallback:c===void 0?null:c,attempt:0}}q.destroy=function(){this.l=!0;this.h.clear();this.i.clear();this.m.clear();oj.prototype.release.call(this);return this.A.destroy()};
q.request=function(a,b,c){var d=this,e=new Dj;if(this.l){var f=Promise.reject(new T(2,7,7001));f.catch(function(){});return new Ej(f,function(){return Promise.resolve()},e)}b.method=b.method||"GET";b.headers=b.headers||{};f=id(b.headers);b.retryParameters=b.retryParameters?id(b.retryParameters):fj();b.uris=id(b.uris);b.attempt=0;f=Fj(this,a,b,c,new ej(b.retryParameters,!1),null,e,f);var g=f.$a(function(l){return Gj(d,a,l,c)}),h=0;f.promise.then(function(){h=Date.now()},function(){});var k=g.$a(function(l){var m=
l.response;m.timeMs+=Date.now()-h;l.ck||!d.u||m.fromCache||b.method=="HEAD"||a!=Hj||d.u(m.timeMs,m.data.byteLength,Ij(c),b,c);d.G&&d.G(a,m,c);return m},function(l){l&&(l.severity=2);throw l;});e=new Ej(k.promise,function(){return k.abort()},e);qj(this.A,e);return e};
function Jj(a,b,c,d){function e(h){f=f.$a(function(){c.body&&(c.body=ub(c.body));return h(b,c,d)})}var f=kj(void 0);a.F&&e(a.F);a=r(a.h);for(var g=a.next();!g.done;g=a.next())e(g.value);return f.$a(void 0,function(h){if(h instanceof T&&h.code==7001)throw h;throw new T(2,1,1006,h);})}
function Fj(a,b,c,d,e,f,g,h){var k=c.attempt%c.uris.length;c.headers=id(h);var l=Jj(a,b,c,d),m=Date.now(),n=0;l.promise.then(function(){n=Date.now()-m},function(){});if(!sj(c.uris[k]))try{c.uris[k]=(new URL(c.uris[k],typeof document!="undefined"&&document.baseURI||location.href)).toString()}catch(A){}a.j.forceHTTP&&(c.uris[k]=c.uris[k].replace("https://","http://"));a.j.forceHTTPS&&(c.uris[k]=c.uris[k].replace("http://","https://"));k>0&&a.H&&a.H(b,d,c.uris[k],c.uris[k-1]);var p=!1,t=sj(c.uris[k]),
u=(t=Aj.get(t))?t.Ve:null;if(!u)return ij(new T(2,1,1E3,c.uris[k]));var v=t.Fk;(t=a.m.get(tj(c.uris[k])))&&(c.headers[a.j.commonAccessTokenHeaderName]=t);var w=null,x=null,y=!1,z=!1,D;return l.$a(function(){var A=e.attempt();return new hj(A,function(){e.stop();return A.catch(function(){})})}).$a(function(){if(a.l)return jj();D=Date.now();var A=0;c.requestStartTime=Date.now();var B=u(c.uris[k],c,b,function(G,K,L){w&&w.stop();x&&x.ka(C/1E3);a.u&&b==Hj&&(A++,c.packetNumber=A,a.u(G,K,Ij(d),c,d),p=!0,
g.h=L)},function(G){z=!0;c.timeToFirstByte=Date.now()-c.requestStartTime;a.o&&a.o(G,c,b)},{minBytesForProgressEvents:a.j.minBytesForProgressEvents});if(!v)return B;var E=c.retryParameters.connectionTimeout;E&&(w=new gf(function(){y=!0;B.abort()}),w.ka(E/1E3));var C=c.retryParameters.stallTimeout;C&&(x=new gf(function(){y=!0;B.abort()}));return B}).$a(function(A){w&&w.stop();x&&x.stop();A.timeMs==void 0&&(A.timeMs=Date.now()-D,A.timeMs+=n);var B=A.headers[a.j.commonAccessTokenHeaderName];B&&a.m.set(tj(A.uri),
B);B={response:A,ck:p};!z&&a.o&&a.o(A.headers,c,b);a.C&&a.C(b,c,d,A);return B},function(A){w&&w.stop();x&&x.stop();if(a.D){var B=null,E=0;A instanceof T&&(B=A,A.code==1001&&(E=A.data[1]));a.D(b,c,d,B,E,y)}if(a.l)return jj();y&&(A=new T(1,1,1003,c.uris[k],b));if(A instanceof T){if(A.code==7001)throw A;if(A.code==1010)throw f;if(A.severity==1){B=(new Map).set("error",A);B=new nj("retry",B);B.cancelable=!0;a.dispatchEvent(B);if(B.defaultPrevented)throw A;++c.attempt;return Fj(a,b,c,d,e,A,g,h)}}throw A;
})}function Gj(a,b,c,d){var e=kj(void 0);a=r(a.i);for(var f=a.next(),g={};!f.done;g={ji:void 0},f=a.next())g.ji=f.value,e=e.$a(function(h){return function(){var k=c.response;k.data&&(k.data=ub(k.data));return(0,h.ji)(b,k,d)}}(g));return e.$a(function(){return c},function(h){var k=2;if(h instanceof T){if(h.code==7001)throw h;k=h.severity}throw new T(k,1,1007,h);})}function Ij(a){if(a){var b=a.segment;a=a.stream;if(b&&a&&a.fastSwitching&&b.Bc())return!1}return!0}I("shaka.net.NetworkingEngine",xj);
xj.prototype.request=xj.prototype.request;xj.prototype.destroy=xj.prototype.destroy;xj.makeRequest=Cj;xj.defaultRetryParameters=function(){return fj()};xj.prototype.clearCommonAccessTokenMap=xj.prototype.Zg;xj.prototype.clearAllResponseFilters=xj.prototype.dj;xj.prototype.unregisterResponseFilter=xj.prototype.il;xj.prototype.registerResponseFilter=xj.prototype.Jk;xj.prototype.clearAllRequestFilters=xj.prototype.cj;xj.prototype.unregisterRequestFilter=xj.prototype.hl;
xj.prototype.registerRequestFilter=xj.prototype.Ik;xj.unregisterScheme=function(a){Aj.delete(a)};xj.registerScheme=yj;xj.prototype.configure=xj.prototype.configure;function Dj(){this.h=0}xj.NumBytesRemainingClass=Dj;function Ej(a,b,c){hj.call(this,a,b);this.i=c}ra(Ej,hj);xj.PendingRequest=Ej;var Hj=1,Kj={MANIFEST:0,SEGMENT:Hj,LICENSE:2,APP:3,TIMING:4,SERVER_CERTIFICATE:5,KEY:6,ADS:7,CONTENT_STEERING:8,CMCD:9,SESSION_DATA:10,FINGERPRINT:11,PLAYLIST:12,EVENT_CALLBACK:13};xj.RequestType=Kj;
xj.AdvancedRequestType={INIT_SEGMENT:0,MEDIA_SEGMENT:1,MEDIA_PLAYLIST:2,MASTER_PLAYLIST:3,MPD:4,MPD_PATCH:6,MEDIATAILOR_SESSION_INFO:7,MEDIATAILOR_TRACKING_INFO:8,MEDIATAILOR_STATIC_RESOURCE:9,MEDIATAILOR_TRACKING_EVENT:10,INTERSTITIAL_ASSET_LIST:11,INTERSTITIAL_AD_URL:12,TRACKING_EVENT:13,XLINK:14,LINKED_MPD:15};var zj=3;xj.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:zj};var Aj=new Map;function Lj(a,b,c,d,e,f){var g=(new Map).set("RepresentationID",b).set("Number",c).set("SubNumber",d).set("Bandwidth",e).set("Time",f);return a.replace(/\$(RepresentationID|Number|SubNumber|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,function(h,k,l,m){if(h=="$$")return"$";var n=g.get(k);if(n==null)return h;k=="RepresentationID"&&l&&(l=void 0);k=="Time"&&typeof n!="bigint"&&(Math.abs(n-Math.round(n))>=.2&&Ua("Calculated $Time$ values must be close to integers"),n=Math.round(n));switch(m){case void 0:case "d":case "i":case "u":h=
n.toString();break;case "o":h=n.toString(8);break;case "x":h=n.toString(16);break;case "X":h=n.toString(16).toUpperCase();break;default:h=n.toString()}l=window.parseInt(l,10)||1;return Array(Math.max(0,l-h.length)+1).join("0")+h})}
function Mj(a,b){var c=Nj(a,b,"timescale"),d=1;c&&(d=Kd(c)||1);c=Nj(a,b,"duration");var e=(c=Kd(c||""))?c/d:null,f=Nj(a,b,"startNumber"),g=Number(Nj(a,b,"presentationTimeOffset"))||0,h=Ld(f||"");if(f==null||h==null)h=1;f=Nj(a,b,"endNumber");f=f==null?null:Ld(f);var k=null,l=Oj(a,b,"SegmentTimeline");if(l){b=[];k=new Map;var m=ud(l,"Pattern");m=r(m);for(var n=m.next();!n.done;n=m.next()){n=n.value;var p=n.attributes.id;p&&k.set(p,n)}l=ud(l,"S");if(k.size)for(l=r(l),m=l.next();!m.done;m=l.next())m=
Pj(m.value,k),b.push.apply(b,F(m));else b=l;k=d;a=a.aa.duration||Infinity;l=h;m=[];var t=-g;for(n=0;n<b.length;++n){var u=b[n],v=b[n+1],w=Dd(u,"t",Ld);p=Dd(u,"d",Ld);var x=Dd(u,"r",Jd);u=Dd(u,"k",Jd)||0;w!=null&&(w-=g);if(p){w=w!=null?w:t;x=x||0;if(x<0)if(v){v=Dd(v,"t",Ld);if(v==null)break;else if(w>=v)break;x=Math.ceil((v-w)/p)-1}else{if(a==Infinity)break;else if(w/k>=a)break;x=Math.ceil((a*k-w)/p)-1}m.length>0&&w!=t&&(m[m.length-1].end=w/k);for(v=0;v<=x;++v)t=w+p,m.push({start:w/k,jf:w,end:t/k,
Jg:t,ig:u,Qk:m.length+l}),w=t}}k=m}return{timescale:d,hf:c,ab:e,Vd:h,xe:f,Hb:g/d||0,Lc:g,timeline:k}}
function Pj(a,b){var c=a.attributes.p;if(!c)return[a];if(!b.has(c))return[];b=b.get(c);c=ud(b,"P");if(!c.length)return[];b=[];c=r(c);for(var d=c.next();!d.done;d=c.next()){var e=d.value;d=Number(e.attributes.d);e=Number(e.attributes.r||0);if(Number.isFinite(d)&&!(d<=0))for(var f=0;f<=e;f++)b.push(d)}if(!b.length)return[];c=Number(a.attributes.pE||0);d=Number(a.attributes.r||0)+1;e=Number(a.attributes.k||1);f=[];a=Number(a.attributes.t||0);for(var g=b.length,h=0;h<d;h++){var k=b[(c+h)%g],l={tagName:"S",
attributes:{t:String(a),d:String(k)},children:[],parent:null};e>1&&(l.attributes.k=String(e));f.push(l);a+=k}return f}function Qj(a,b){return[b(a.M),b(a.ha),b(a.Da)].filter(kf)}function Nj(a,b,c){b=Qj(a,b);a=null;b=r(b);for(var d=b.next();!d.done&&!(a=d.value.attributes[c]);d=b.next());return a}function Oj(a,b,c){b=Qj(a,b);a=null;b=r(b);for(var d=b.next();!d.done&&!(a=Ad(d.value,c));d=b.next());return a}
function Rj(a,b,c,d){for(var e=[],f=r(ud(a,"Period")),g=f.next(),h={};!g.done;h={gd:void 0,Ld:void 0},g=f.next())if(h.gd=g.value,g=Ad(h.gd,"ImportedMPD")){h.Ld=g;g=void 0;var k=(g=wd(h.Ld))==null?void 0:g.trim();k?(g=(new URL(k,b)).toString(),h=d.request(0,Cj([g],c),{type:15}).$a(function(l){return function(m){var n=null;try{n=ld(m.data,"MPD")}catch(u){}var p=n?Ad(n,"Period"):null,t;if(t=n&&p)t=n,(t.attributes.type||"static")!=="static"||ud(t,"Period").length!==1?t=!0:(t=Gd(t.attributes.availabilityEndTime||
""),t=t!=null&&t*1E3<Date.now()),t=!t;t?Sj(l.gd,n,p,m.uri):Tj(a,l.gd,l.Ld);return a}}(h),function(l){return function(){Tj(a,l.gd,l.Ld);return a}}(h)),e.push(h)):Tj(a,h.gd,h.Ld)}return e.length?lj(e).$a(function(){return a}):kj(a)}function Tj(a,b,c){b.children=b.children.filter(function(d){return d!==c});Uj(b)||(a.children=a.children.filter(function(d){return d!==b}))}function Uj(a){return ud(a,"AdaptationSet").length?!0:Hd(a.attributes.duration||"")===0}
function Sj(a,b,c,d){for(var e=new Set(["id","start","duration"]),f=r(Object.keys(a.attributes)),g=f.next();!g.done;g=f.next())g=g.value,e.has(g)||g.includes(":")||delete a.attributes[g];var h=new Set(["ServiceDescription","SupplementalProperty","EssentialProperty","EventStream","RequestParam"]);f=td(a).filter(function(m){return h.has(m.tagName)||m.tagName.includes(":")});e=td(c).filter(function(m){return m.tagName!=="BaseURL"}).concat(ud(b,"SupplementalProperty"),ud(b,"EssentialProperty"));var k=
new Set;g=r(e);for(var l=g.next();!l.done;l=g.next())l=Vj(l.value),l!=null&&k.add(l);f=f.filter(function(m){m=Vj(m);return m==null||!k.has(m)});b=Wj(b,c,d).map(function(m){return{tagName:"BaseURL",attributes:{},children:[m],parent:a}});d=r(e);for(g=d.next();!g.done;g=d.next())g.value.parent=a;a.children=b.concat(e,f);if(c=c.attributes.duration)(b=a.attributes.duration)?(b=Hd(b),d=Hd(c),b!=null&&d!=null&&d<b&&(a.attributes.duration=c)):a.attributes.duration=c}
function Vj(a){switch(a.tagName){case "ServiceDescription":return"ServiceDescription:"+(a.attributes.id||"");case "SupplementalProperty":case "EssentialProperty":case "EventStream":return a.tagName+":"+(a.attributes.schemeIdUri||"")+":"+(a.attributes.value||"");default:return null}}function Wj(a,b,c){function d(e){var f=[];e=r(ud(e,"BaseURL"));for(var g=e.next();!g.done;g=e.next())(g=wd(g.value))&&f.push(g);return f}c=[c];a=d(a);a.length&&(c=rj(c,a));b=d(b);b.length&&(c=rj(c,b));return c}
function Xj(a,b,c,d,e,f){for(var g=Ed(a,Yj,"href"),h=Ed(a,Yj,"actuate")||"onRequest",k=r(Object.keys(a.attributes)),l=k.next();!l.done;l=k.next()){l=l.value;var m=l.split(":"),n=od(Yj);m[0]==n&&delete a.attributes[l]}if(f>=5)return ij(new T(2,4,4028));if(h!="onLoad")return ij(new T(2,4,4027));var p=rj([d],[g]);return e.request(0,Cj(p,b),{type:14}).$a(function(t){t=ld(t.data,a.tagName);if(!t)return ij(new T(2,4,4001,g));for(a.children=[];t.children.length;){var u=t.children.shift();a.children.push(u)}u=
r(Object.keys(t.attributes));for(var v=u.next();!v.done;v=u.next())v=v.value,a.attributes[v]=t.attributes[v];return Zj(a,b,c,p[0],e,f+1)})}
function Zj(a,b,c,d,e,f){f=f===void 0?0:f;var g=new Set(["MPD","Period","AdaptationSet","Representation","SegmentList"]);if(Ed(a,Yj,"href"))return g=Xj(a,b,c,d,e,f),c&&(g=g.$a(void 0,function(){return Zj(a,b,c,d,e,f)})),g;for(var h=[],k=r(td(a)),l=k.next(),m={};!l.done;m={Dd:void 0},l=k.next())m.Dd=l.value,Ed(m.Dd,Yj,"href")=="urn:mpeg:dash:resolve-to-zero:2013"?a.children=a.children.filter(function(n){return function(p){return p!==n.Dd}}(m)):g.has(m.Dd.tagName)&&h.push(Zj(m.Dd,b,c,d,e,f));return lj(h).$a(function(){return a})}
function ak(a){return ud(a,"EssentialProperty").map(bk)}function ck(a){return ud(a,"SupplementalProperty").map(bk)}function dk(a,b,c){return a.find(function(d){return d.schemeIdUri==b&&(c==void 0||d.value==c)})||null}function bk(a){return{schemeIdUri:a.attributes.schemeIdUri,value:a.attributes.value,id:a.attributes.id,element:a}}var Yj="http://www.w3.org/1999/xlink";function ek(a,b,c,d,e,f,g,h){this.Oa=a;this.startByte=b;this.endByte=c;this.ag=d===void 0?null:d;this.timescale=e===void 0?null:e;this.i=f===void 0?null:f;this.aesKey=g===void 0?null:g;this.h=this.mimeType=this.codecs=null;this.encrypted=h===void 0?!1:h}ek.prototype.jc=function(){return this.startByte};ek.prototype.ec=function(){return this.endByte};ek.prototype.zi=function(a){this.i=a};ek.prototype.yc=function(){return this.i};
function fk(a,b){return a===b?!0:a&&b?a.jc()==b.jc()&&a.ec()==b.ec()&&gb(a.Oa().sort(),b.Oa().sort())&&tb(a.yc(),b.yc()):a==b}I("shaka.media.InitSegmentReference",ek);ek.prototype.getEndByte=ek.prototype.ec;ek.prototype.getStartByte=ek.prototype.jc;
function V(a,b,c,d,e,f,g,h,k,l,m,n,p,t,u,v){l=l===void 0?[]:l;t=t===void 0?gk:t;this.startTime=a;this.i=this.endTime=b;this.G=c;this.startByte=d;this.endByte=e;this.initSegmentReference=f;this.l=g;this.F=h;this.D=k;this.h=l;this.tilesLayout=m===void 0?"":m;this.C=n===void 0?null:n;this.A=p===void 0?null:p;this.status=t;this.preload=!1;this.j=!0;this.u=!1;this.aesKey=u===void 0?null:u;this.thumbnailSprite=null;this.discontinuitySequence=-1;this.m=v===void 0?!1:v;this.Od=this.I=!1;a=r(this.h);for(b=
a.next();!b.done;b=a.next())b.value.Ph();this.m&&this.h.length&&this.h[this.h.length-1].Oh();this.o=this.bandwidth=this.mimeType=this.codecs=null;this.K=!1;this.H=null}q=V.prototype;q.Oa=function(){return this.G()};q.getStartTime=function(){return this.startTime};q.Dj=function(){return this.endTime};q.jc=function(){return this.startByte};q.ec=function(){return this.endByte};
function hk(a){if(a.endByte)return a.endByte+1-a.startByte;if(a.bandwidth){var b=a.bandwidth*(a.endTime-a.startTime);if(!isNaN(b)&&b>0)return b}if(a.h.length>0&&a.m)for(a=r(a.h),a=a.next();!a.done;a=a.next()){hk(a.value);break}return null}q.Yj=function(){return this.tilesLayout};q.Xj=function(){return this.C};q.kc=function(){return this.status};q.tk=function(){this.status=ik};q.rk=function(){this.preload=!0};q.isPreload=function(){return this.preload};q.Qd=function(){this.j=!1};q.fk=function(){return this.j};
q.Ph=function(){this.I=!0};q.Bc=function(){return this.I};q.Oh=function(){this.Od=!0};q.gk=function(){return this.Od};q.qk=function(){this.u=!0};q.dk=function(){return this.u};q.Ai=function(a){this.thumbnailSprite=a};q.Vj=function(){return this.thumbnailSprite};q.offset=function(a){this.startTime+=a;this.endTime+=a;this.i+=a;for(var b=r(this.h),c=b.next();!c.done;c=b.next())c=c.value,c.startTime+=a,c.endTime+=a,c.i+=a};
q.$k=function(a){this.A==null?Ta("Sync attempted without sync time!"):(a=this.A-a-this.startTime,Math.abs(a)>=.001&&this.offset(a))};q.zi=function(a,b){this.o=a;this.K=b===void 0?!1:b};q.yc=function(a){var b=this.o;(a===void 0||a)&&this.K&&(this.o=null);return b};function jk(a,b){a.initSegmentReference=b;a=r(a.h);for(var c=a.next();!c.done;c=a.next())jk(c.value,b)}q.ui=function(a){this.H=a};q.getMetadata=function(){return this.H};I("shaka.media.SegmentReference",V);V.prototype.getMetadata=V.prototype.getMetadata;
V.prototype.setMetadata=V.prototype.ui;V.prototype.getSegmentData=V.prototype.yc;V.prototype.setSegmentData=V.prototype.zi;V.prototype.syncAgainst=V.prototype.$k;V.prototype.offset=V.prototype.offset;V.prototype.getThumbnailSprite=V.prototype.Vj;V.prototype.setThumbnailSprite=V.prototype.Ai;V.prototype.hasByterangeOptimization=V.prototype.dk;V.prototype.markAsByterangeOptimization=V.prototype.qk;V.prototype.isLastPartial=V.prototype.gk;V.prototype.markAsLastPartial=V.prototype.Oh;
V.prototype.isPartial=V.prototype.Bc;V.prototype.markAsPartial=V.prototype.Ph;V.prototype.isIndependent=V.prototype.fk;V.prototype.markAsNonIndependent=V.prototype.Qd;V.prototype.isPreload=V.prototype.isPreload;V.prototype.markAsPreload=V.prototype.rk;V.prototype.markAsUnavailable=V.prototype.tk;V.prototype.getStatus=V.prototype.kc;V.prototype.getTileDuration=V.prototype.Xj;V.prototype.getTilesLayout=V.prototype.Yj;V.prototype.getEndByte=V.prototype.ec;V.prototype.getStartByte=V.prototype.jc;
V.prototype.getEndTime=V.prototype.Dj;V.prototype.getStartTime=V.prototype.getStartTime;V.prototype.getUris=V.prototype.Oa;var gk=0,ik=1;V.Status={wl:gk,Yl:ik,Gl:2};function kk(a,b,c,d,e,f,g,h){var k,l=(new ih).S("sidx",function(m){k=lk(b,d,e,f,g,c,m,h)});a&&l.parse(a);if(k)return k;throw new T(2,3,3004);}
function lk(a,b,c,d,e,f,g,h){h=h===void 0?!1:h;var k=[];g.reader.skip(4);var l=g.reader.R();if(l==0)throw new T(2,3,3005);if(g.version==0){var m=g.reader.R();var n=g.reader.R()}else m=g.reader.jd(),n=g.reader.jd();g.reader.skip(2);var p=g.reader.kb();a=(h?-g.size:a)+g.size+n;for(h=0;h<p;h++){var t=g.reader.R();n=(t&2147483648)>>>31;t&=2147483647;var u=g.reader.R();g.reader.skip(4);if(n==1)throw new T(2,3,3006);k.push(new V(m/l+c,(m+u)/l+c,function(){return f},a,a+t-1,b,c,d,e));m+=u;a+=t}g.parser.stop();
return k};function tk(a){this.i=zb(a);this.h=new $g(this.i,0)}tk.prototype.Va=function(){return this.h.Va()};tk.prototype.va=function(){return this.h.va()};
function uk(a){var b=vk(a);if(b.length>7)throw new T(2,3,3002);var c=0;b=r(b);for(var d=b.next();!d.done;d=b.next())c=256*c+d.value;b=vk(a);a:{d=r(wk);for(var e=d.next();!e.done;e=d.next())if(tb(b,new Uint8Array(e.value))){d=!0;break a}d=!1}if(d)d=a.i.byteLength-a.h.va(),b=Infinity;else{if(b.length==8&&b[1]&224)throw new T(2,3,3001);for(e=d=0;e<b.length;e++){var f=b[e];d=e==0?f&(1<<8-b.length)-1:256*d+f}b=d}d=a.h.va()+d<=a.i.byteLength?d:a.i.byteLength-a.h.va();e=zb(a.i,a.h.va(),d);a.h.skip(d);return new xk(c,
e,b)}function vk(a){var b=a.h.va(),c=a.h.Ja();if(c==0)throw new T(2,3,3002);c=8-Math.floor(Math.log2(c));a.h.skip(c-1);return S(a.i,b,c)}var wk=[[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 xk(a,b,c){this.id=a;this.h=b;this.i=c===void 0?b.byteLength:c}xk.prototype.Bc=function(){return this.i!=Infinity&&this.i>this.h.byteLength};
function yk(a){if(a.h.byteLength>8)throw new T(2,3,3002);if(a.h.byteLength==8&&a.h.getUint8(0)&224)throw new T(2,3,3001);for(var b=0,c=0;c<a.h.byteLength;c++){var d=a.h.getUint8(c);b=256*b+d}return b};function zk(a,b,c,d,e,f,g){b=new tk(b);if(uk(b).id!=440786851)throw new T(2,3,3008);var h=uk(b);if(h.id!=408125543)throw new T(2,3,3009);b=h.h.byteOffset;h=new tk(h.h);for(var k=null;h.Va();){var l=uk(h);if(l.id==357149030){k=l;break}}if(!k)throw new T(2,3,3010);k=new tk(k.h);l=1E6;for(h=null;k.Va();){var m=uk(k);if(m.id==2807729)l=yk(m);else if(m.id==17545)if(m.h.byteLength==4)h=m.h.getFloat32(0);else if(m.h.byteLength==8)h=m.h.getFloat64(0);else throw new T(2,3,3003);}if(h==null)throw new T(2,3,
3011);k=l/1E9;h*=k;a=uk(new tk(a));if(a.id!=475249515)throw new T(2,3,3007);return Ak(a,b,k,h,c,d,e,f,g)}function Ak(a,b,c,d,e,f,g,h,k){function l(){return e}var m=[];a=new tk(a.h);for(var n=null,p=null;a.Va();){var t=uk(a);if(t.id==187){var u=Bk(t);u&&(t=c*u.jl,u=b+u.Kk,n!=null&&m.push(new V(n+g,t+g,l,p,u-1,f,g,h,k)),n=t,p=u)}}n!=null&&m.push(new V(n+g,d+g,l,p,null,f,g,h,k));return m}
function Bk(a){var b=new tk(a.h);a=uk(b);if(a.id!=179)throw new T(2,3,3013);a=yk(a);b=uk(b);if(b.id!=183)throw new T(2,3,3012);b=new tk(b.h);for(var c=0;b.Va();){var d=uk(b);if(d.id==241){c=yk(d);break}}return{jl:a,Kk:c}};function Ck(a){this.h=a;this.o=null;this.j=0;this.u=!1}q=Ck.prototype;q.getNumReferences=function(){return this.h.length};q.getNumEvicted=function(){return this.j};q.release=function(){this.u||(this.h=[],this.o&&this.o.stop(),this.o=null)};q.vk=function(){this.u=!0};q.cc=function(a){for(var b=r(this.h),c=b.next();!c.done;c=b.next())a(c.value)};q.If=function(){return this.h[0]||null};
q.find=function(a){var b=this.h.length-1;if(b<0)return null;if(a<this.h[0].startTime)return this.j;var c=fb(this.h,function(e){return e.startTime<=a})-1;if(c<0)return null;var d=this.h[c];b=c<b?this.h[c+1].startTime:d.endTime;return a>=d.startTime&&a<b?c+this.j:null};q.get=function(a){if(this.h.length==0)return null;a-=this.j;return a<0||a>=this.h.length?null:this.h[a]};q.offset=function(a){if(!this.u)for(var b=r(this.h),c=b.next();!c.done;c=b.next())c.value.offset(a)};
q.Me=function(a){if(!this.u&&a.length){var b=Math.round(a[0].startTime*1E3)/1E3,c=fb(this.h,function(d){return Math.round(d.startTime*1E3)/1E3<b});this.h.length=c;this.h.push.apply(this.h,F(a))}};q.Ne=function(a,b){for(var c=Math.max(b,this.h.length>0?this.h[0].startTime:-Infinity),d=0;d<a.length&&a[d].endTime<=c;)d++;d>0&&(a=a.slice(d));this.Me(a);this.Ua(b)};q.Ua=function(a){if(!this.u){var b=fb(this.h,function(c){return c.endTime<=a});b>0&&(this.j+=b,this.h=this.h.slice(b))}};
q.Jd=function(a,b,c){c=c===void 0?!1:c;if(!this.u){for(;this.h.length;)if(this.h[this.h.length-1].startTime>=b)this.h.pop();else break;var d=fb(this.h,function(e){return e.endTime<=a});d>0&&(c||(this.j+=d),this.h=this.h.slice(d));this.h.length!=0&&(c=this.h[this.h.length-1],b=new V(c.startTime,b,c.G,c.startByte,c.endByte,c.initSegmentReference,c.l,c.F,c.D,c.h,c.tilesLayout,c.C,c.A,c.status,c.aesKey),b.mimeType=c.mimeType,b.codecs=c.codecs,b.discontinuitySequence=c.discontinuitySequence,this.h[this.h.length-
1]=b)}};q.kf=function(a,b){var c=this;this.u||(this.o&&this.o.stop(),this.o=new gf(function(){var d=b();d?c.h.push.apply(c.h,F(d)):(c.o.stop(),c.o=null)}),this.o.Ka(a))};Ck.prototype[Symbol.iterator]=function(){return this.jb(0)};
Ck.prototype.jb=function(a,b,c){b=b===void 0?!1:b;c=c===void 0?!1:c;var d=this.find(a);if(d==null)return null;var e=this.get(d);c?d++:d--;var f=-1;if(e&&e.h.length>0)for(var g=e.h.length-1;g>=0;--g){var h=e.h[g];if(a>=h.startTime&&a<h.endTime){if(!b){for(;g&&!h.j;)g--,h=e.h[g];if(!h.j)return Ta("No independent partial segment found!"),null}c?d--:d++;f=g-1;break}}return new Dk(this,d,f,c)};Ck.prototype.qe=function(){return-1};
function Ek(a,b,c){a=new V(a,a+b,function(){return c},0,null,null,a,a,a+b);return new Ck([a])}I("shaka.media.SegmentIndex",Ck);Ck.forSingleSegment=Ek;Ck.prototype.getIteratorForTime=Ck.prototype.jb;Ck.prototype.updateEvery=Ck.prototype.kf;Ck.prototype.fit=Ck.prototype.Jd;Ck.prototype.evict=Ck.prototype.Ua;Ck.prototype.mergeAndEvict=Ck.prototype.Ne;Ck.prototype.offset=Ck.prototype.offset;Ck.prototype.get=Ck.prototype.get;Ck.prototype.find=Ck.prototype.find;Ck.prototype.markImmutable=Ck.prototype.vk;
Ck.prototype.release=Ck.prototype.release;Ck.prototype.getNumEvicted=Ck.prototype.getNumEvicted;Ck.prototype.getNumReferences=Ck.prototype.getNumReferences;function Dk(a,b,c,d){this.j=a;this.i=b;this.h=c;this.reverse=d}q=Dk.prototype;q.nd=function(a){this.reverse=a};q.hj=function(){return this.i};q.current=function(){var a=this.j.get(this.i);a&&a.h.length>0&&a.m&&this.h>=a.h.length&&(this.i++,this.h=0,a=this.j.get(this.i));return a&&a.h.length>0?a.h[this.h]:a};
q.next=function(){var a=this.j.get(this.i);this.reverse?a&&a.h.length>0?(this.h--,this.h<0&&(this.i--,this.h=(a=this.j.get(this.i))&&a.h.length>0?a.h.length-1:0)):(this.i--,this.h=0):a&&a.h.length>0?(this.h++,a.m&&this.h==a.h.length&&(this.i++,this.h=0)):(this.i++,this.h=0);a=this.current();return{value:a,done:!a}};q.vg=function(){var a=this.current();if(a&&a.Bc()&&!a.j&&(a=this.j.get(this.i))&&a.h.length>0)for(var b=a.h[this.h];b.j&&!(this.h<=0);)this.h--,b=a.h[this.h]};
I("shaka.media.SegmentIterator",Dk);Dk.prototype.resetToLastIndependent=Dk.prototype.vg;Dk.prototype.next=Dk.prototype.next;Dk.prototype.current=Dk.prototype.current;Dk.prototype.currentPosition=Dk.prototype.hj;Dk.prototype.setReverse=Dk.prototype.nd;function Fk(){Ck.call(this,[]);this.i=[]}ra(Fk,Ck);q=Fk.prototype;q.clone=function(){var a=new Fk;a.i=this.i.slice();a.j=this.j;return a};q.release=function(){this.i=[]};q.cc=function(a){for(var b=r(this.i),c=b.next();!c.done;c=b.next())c.value.cc(a)};
function Gk(a,b){a=r(a.i);for(var c=a.next();!c.done;c=a.next())b(c.value)}q.find=function(a){for(var b=this.j,c=r(this.i),d=c.next();!d.done;d=c.next()){d=d.value;var e=d.find(a);if(e!=null)return e+b;b+=d.getNumEvicted()+d.getNumReferences()}return null};function Hk(a,b){a=r(a.i);for(var c=a.next();!c.done;c=a.next())if(c=c.value,c.find(b)!=null)return c.qe();return-1}
q.get=function(a){for(var b=this.j,c=r(this.i),d=c.next();!d.done;d=c.next()){d=d.value;var e=d.get(a-b);if(e)return e;e=d.getNumReferences();b+=d.getNumEvicted()+e}return null};q.offset=function(){};q.Me=function(){};q.Ua=function(a){if(this.i.length){var b=this.i[0];b.Ua(a);b.getNumReferences()==0&&(this.i.shift(),this.j+=b.getNumEvicted(),b.release(),this.Ua(a))}};q.Ne=function(){};q.Jd=function(){};q.kf=function(){};I("shaka.media.MetaSegmentIndex",Fk);Fk.prototype.updateEvery=Fk.prototype.kf;
Fk.prototype.fit=Fk.prototype.Jd;Fk.prototype.mergeAndEvict=Fk.prototype.Ne;Fk.prototype.evict=Fk.prototype.Ua;Fk.prototype.merge=Fk.prototype.Me;Fk.prototype.offset=Fk.prototype.offset;Fk.prototype.get=Fk.prototype.get;Fk.prototype.find=Fk.prototype.find;Fk.prototype.forEachTopLevelReference=Fk.prototype.cc;Fk.prototype.release=Fk.prototype.release;function Ik(a,b,c){b=Oj(a,b,"Initialization");if(!b)return null;var d=a.M.Ya(),e=b.attributes.sourceURL;e&&(d=rj(d,[Jb(e)],a.urlParams()));e=0;var f=null;if(b=Dd(b,"range",Id))e=b.start,f=b.end;c=new ek(function(){return d},e,f,Jk(a),null,null,c,a.ha.encrypted);c.codecs=a.M.codecs;c.mimeType=a.M.mimeType;a.aa&&!a.aa.He&&(c.h=a.aa.start+a.aa.duration);return c}
function Kk(a,b,c){var d=Number(Nj(a,Lk,"presentationTimeOffset"))||0,e=Nj(a,Lk,"timescale"),f=1;e&&(f=Kd(e)||1);var g=d/f||0,h=Ik(a,Lk,c);Mk(a,h);var k=jd(a);return{endTime:-1,timeline:-1,xc:function(){var l=Oj(k,Lk,"RepresentationIndex");var m=k.M.Ya();l&&(l=Jb(l.attributes.sourceURL))&&(m=rj(m,[l],k.urlParams()));l=Nk(k);return Ok(k,b,h,m,l.start,l.end,g)},timescale:f,initSegmentReference:h}}
function Ok(a,b,c,d,e,f,g){var h,k,l,m,n,p,t,u,v,w,x,y,z,D,A,B,E,C,G,K;return H(function(L){if(L.i==1)return h=a.presentationTimeline,k=!a.hb||!a.aa.He,l=a.aa.start,m=a.aa.duration,n=a.M.mimeType.split("/")[1],p=b,t=null,u=[p(d,e,f,!1),n=="webm"?p(c.Oa(),c.startByte,c.endByte,!0):null],p=null,L.h(Promise.all(u),2);v=L.j;w=v[0];x=v[1]||null;y=null;z=l-g;D=l;A=m?l+m:Infinity;B=a.M.Ya();E=B.length!=d.length||B.some(function(N,J){return N!=d[J]});y=n=="mp4"?kk(w,e,B,c,z,D,A,E):zk(w,x,B,c,z,D,A);C=r(y);
for(G=C.next();!G.done;G=C.next())K=G.value,K.codecs=a.M.codecs,K.mimeType=a.M.mimeType,K.bandwidth=a.bandwidth;h.fg(y);t=new Ck(y);k&&t.Jd(D,A,!0);return L.return(t)})}function Lk(a){return a.md}function Nk(a){var b=Oj(a,Lk,"RepresentationIndex");a=Nj(a,Lk,"indexRange");a=Id(a||"");b&&(a=Dd(b,"range",Id,a));return a}function Mk(a,b){Pk(a,b);if(!Nk(a))throw new T(2,4,4002);}
function Pk(a,b){var c=a.M.mimeType.split("/")[1];if(a.M.contentType!=wc&&c!="mp4"&&c!="webm")throw new T(2,4,4006);if(c=="webm"&&!b)throw new T(2,4,4005);}
function Jk(a){var b=a.M;return{bandwidth:a.bandwidth,audioSamplingRate:b.audioSamplingRate,codecs:b.codecs,contentType:b.contentType,frameRate:b.frameRate||null,height:b.height||null,mimeType:b.mimeType,channelsCount:b.Se,pixelAspectRatio:b.pixelAspectRatio||null,width:b.width||null,label:a.ha.label||null,roles:a.roles||null,language:a.ha.language||null}};function Qk(a,b,c){var d=Ik(a,Rk,c),e=Sk(a);if(!e.ab&&!e.timeline&&e.bd.length>1)throw new T(2,4,4002);if(!e.ab&&!a.aa.duration&&!e.timeline&&e.bd.length==1)throw new T(2,4,4002);if(e.timeline&&e.timeline.length==0)throw new T(2,4,4002);var f=null,g=null;a.Da.id&&a.M.id&&(g=b.get(a.Da.id+","+a.M.id))&&(f=g.segmentIndex);var h=Tk(a.aa.start,a.aa.duration,a.M.Ya,e,d,c,a.M.mimeType,a.M.codecs,a.bandwidth,a.urlParams);b=!f;f?(c=a.presentationTimeline.Ob(),f.Ne(h,c)):f=new Ck(h);a.presentationTimeline.fg(h);
a.hb&&a.aa.He||f.Jd(a.aa.start,a.aa.duration?a.aa.start+a.aa.duration:Infinity,b);g&&(g.segmentIndex=f);return{endTime:-1,timeline:-1,xc:function(){f&&f.getNumReferences()!=0||f.Me(h);return Promise.resolve(f)},timescale:e.timescale,initSegmentReference:d}}function Rk(a){return a.Ub}
function Sk(a){var b=Uk(a);a=Mj(a,Rk);var c=a.Vd;c==0&&(c=1);var d=0;a.ab?d=a.ab*(c-1):a.timeline&&a.timeline.length>0&&(d=a.timeline[0].start);return{ab:a.ab,startTime:d,Vd:c,Hb:a.Hb,timescale:a.timescale,timeline:a.timeline,bd:b}}
function Tk(a,b,c,d,e,f,g,h,k,l){var m=d.bd.length;d.timeline&&d.timeline.length!=d.bd.length&&(m=Math.min(d.timeline.length,d.bd.length));for(var n=a-d.Hb,p=b?a+b:Infinity,t=[],u=d.startTime,v={},w=0;w<m;v={lf:void 0,bf:void 0},w++){v.bf=d.bd[w];var x=u;u=void 0;u=d.ab!=null?x+d.ab:d.timeline?d.timeline[w].end:x+b;v.lf=null;v=new V(a+x,a+u,function(y){return function(){y.lf==null&&(y.lf=rj(c(),[y.bf.wk],l()));return y.lf}}(v),v.bf.start,v.bf.end,e,n,a,p,[],"",null,null,gk,f);v.codecs=h;v.mimeType=
g;v.bandwidth=k;t.push(v)}return t}function Uk(a){return[a.M.Ub,a.ha.Ub,a.Da.Ub].filter(kf).map(function(b){return ud(b,"SegmentURL")}).reduce(function(b,c){return b.length>0?b:c}).map(function(b){b.attributes.indexRange&&!a.Tf&&(a.Tf=!0);var c=Jb(b.attributes.media);b=Dd(b,"mediaRange",Id,{start:0,end:null});return{wk:c,start:b.start,end:b.end}})};function Vk(a,b,c,d,e,f,g,h,k,l){k||a.M.Fe||(a.M.Fe=Nj(a,Wk,"initialization"));var m=a.M.Fe?Xk(a,g):null,n=Yk(a);Zk(n);var p=jd(a);if(n.Md)return Pk(a,m),{endTime:-1,timeline:-1,xc:function(){var x=Lj(n.Md,p.M.originalId,null,null,p.bandwidth||null,null);x=rj(p.M.Ya(),[x]);return Ok(p,b,m,x,0,null,n.Hb)},timescale:n.timescale,initSegmentReference:m};if(n.ab)return d||a.ha.contentType==="image"||a.ha.contentType==="text"||(d=a.aa.start,l=a.Da.id,c=a.aa.duration,l=(l=l!=null&&f.get(l)||c)?d+l:Infinity,
a.presentationTimeline.eg(n.ab),a.presentationTimeline.Wh(d,l)),{endTime:-1,timeline:-1,xc:function(){return $k(p,n,e,m,f,g,h,a.M.cf)},timescale:n.timescale,initSegmentReference:m};var t=null;d=d=null;a.Da.id&&a.M.id&&(d=a.Da.id+","+a.M.id,d=c.get(d))&&(t=d.segmentIndex);var u=a.aa.start,v=a.aa.duration?u+a.aa.duration:Infinity;if(t)l=t,al(l,n,u,v,m,a.hb),c=a.presentationTimeline.Ob(),l.Ua(c);else{c=0;k=-1;if(a.Da.id!=null&&a.M.id!=null){var w=l.get(a.Da.id);if(w)k=w.timeline;else for(l=r(l.values()),
w=l.next();!w.done;w=l.next())if(w=w.value,Math.abs(n.Hb-w.endTime)<=Bc&&w.rg.includes(a.M.id)){k=w.timeline;break}else w.timeline>=c&&(c=w.timeline+1)}k==-1&&(k=c);t=new bl(a.hb,n,a.M.originalId,a.bandwidth,a.M.Ya,a.urlParams,u,v,m,g,a.M.cf,k)}n.timeline&&a.ha.contentType!=="image"&&a.ha.contentType!=="text"&&a.presentationTimeline.Xh(t.i?t.i.timeline:[],u);d&&a.hb&&(d.segmentIndex=t);d=(d=(d=n.timeline)&&d[d.length-1])?d.end+n.Hb:-1;l=-1;t instanceof bl&&(l=t.qe());return{endTime:d,timeline:l,xc:function(){t instanceof
bl&&t.getNumReferences()==0&&al(t,n,u,v,m,a.hb);return Promise.resolve(t)},timescale:n.timescale,initSegmentReference:m}}function Wk(a){return a.tc}function Yk(a){var b=Mj(a,Wk),c=Nj(a,Wk,"media"),d=Nj(a,Wk,"index"),e=Nj(a,Wk,"k"),f=0;e&&(f=parseInt(e,10));return{hf:b.hf,ab:b.ab,timescale:b.timescale,Vd:b.Vd,xe:b.xe,Hb:b.Hb,Lc:b.Lc,timeline:b.timeline,Gb:c&&Jb(c),Md:d,mimeType:a.M.mimeType,codecs:a.M.codecs,bandwidth:a.bandwidth,zk:f}}
function Zk(a){var b=a.Md?1:0;b+=a.timeline?1:0;b+=a.ab?1:0;if(b==0)throw new T(2,4,4002);b!=1&&(a.Md&&(a.timeline=null),a.hf=null,a.ab=null);if(!a.Md&&!a.Gb)throw new T(2,4,4002);}
function $k(a,b,c,d,e,f,g,h){function k(N){var J=N-w,O=J*v,M=b.hf,P=J*M;"BigInt"in window&&P>Number.MAX_SAFE_INTEGER&&(P=BigInt(J)*BigInt(M));O+=p;J=O+v;M=Math.min(J,m());N==b.xe&&m()-J<v&&(M=m());var U=[],Q=b.zk;if(Q)for(var da=(M-O)/Q,Z={},ka=0;ka<Q;Z={Gi:void 0},ka++){var va=O+da*ka,Ea=va+da;Z.Gi=ka;Z=new V(va,Ea,function(pa){return function(){var Aa=Lj(x,z,N,pa.Gi,y,P);return rj(D(),[Aa],A())}}(Z),0,null,d,B,p,m(),[],"",null,null,gk,f);Z.codecs=a.M.codecs;Z.mimeType=a.M.mimeType;h==0?ka>0&&Z.Qd():
ka%h!=0&&Z.Qd();U.push(Z)}O=new V(O,M,function(){if(Q)return[];var pa=Lj(x,z,N,null,y,P);return rj(D(),[pa],A())},0,null,d,B,p,m(),U,"",null,null,gk,f,U.length>0);O.codecs=a.M.codecs;O.mimeType=a.M.mimeType;O.bandwidth=a.bandwidth;O.i=J;return O}function l(){var N=[Math.max(n.Ob(),p),Math.min(n.hc(),m())].map(function(J){return J-p});N=[Math.ceil(N[0]/v),Math.ceil(N[1]/v)-1];a.M.fb&&N[1]++;return N.map(function(J){return J+w})}function m(){var N=t!=null&&e.get(t)||u;return N?p+N:Infinity}var n=a.presentationTimeline,
p=a.aa.start,t=a.Da.id,u=a.aa.duration,v=b.ab,w=b.Vd,x=b.Gb,y=a.bandwidth||null,z=a.M.originalId,D=a.M.Ya,A=a.urlParams,B=p-b.Hb,E=l(),C,G=Math.min((C=b.xe)!=null?C:Infinity,g||Infinity);g=Math.min(E[1],G);c=a.hb?Math.max(E[0],g-c+1):E[0];var K=new cl(c,g,w,p,v,k);E=n.hc()<m()&&g<G;C=n.isLive();if(E||C){var L=Math.max(c,g+1);g=v;a.M.fb&&(g=.1);K.kf(g,function(){var N=n.Ob();K.Ua(N);var J=r(l());J.next();J=J.next().value;J=Math.min(J,G);for(var O=[];L<=J;){var M=k(L);O.push(M);L++}return N>m()&&!O.length?
null:O})}return Promise.resolve(K)}function Xk(a,b){var c=a.M.Fe;c||(c=Nj(a,Wk,"initialization"));if(!c)return null;c=Jb(c);var d=a.M.originalId,e=a.bandwidth||null,f=a.M.Ya,g=a.urlParams;b=new ek(function(){var h=Lj(c,d,null,null,e,null);return rj(f(),[h],g())},0,null,Jk(a),null,null,b,a.ha.encrypted);b.codecs=a.M.codecs;b.mimeType=a.M.mimeType;a.aa&&!a.aa.He&&(b.h=a.aa.start+a.aa.duration);return b}
function cl(a,b,c,d,e,f){Ck.call(this,Array(Math.max(0,b-a+1)));this.i=a;this.A=c;this.l=d;this.m=e;this.C=f}ra(cl,Ck);q=cl.prototype;
q.find=function(a){var b=this.h.length-1;if(b<0)return null;var c=this.get(this.j);if(!c)return null;if(a<c.startTime)return this.j;c=Math.floor((a-this.l)/this.m)+this.A-this.i;var d=c>this.j+b,e=this.get(c);(d||e&&a<e.startTime)&&c--;(d=this.get(c+1))&&d.startTime<=a&&c++;if(c<this.j)return null;d=this.get(c);if(!d)return null;b=(b=c-this.j<b?this.get(c+1):null)?b.startTime:d.endTime;return a>=d.startTime&&a<b?c:null};
q.get=function(a){var b=a-this.j;if(b<0||b>=this.h.length)return null;var c=this.h[b];c||(c=this.C(this.i+a),this.h[b]=c);return c};q.If=function(){return this.get(this.j)};q.cc=function(a){for(var b=0;b<this.h.length;b++){var c=this.get(b+this.j);c&&a(c)}};
q.Ua=function(a){if(!this.u){var b=this.h.length-1;if(!(b<0)){var c=this.get(this.j);!c||c.endTime>a||(a=(b=this.get(this.j+b))&&b.endTime<=a?this.h.length:Math.max(0,Math.min(this.h.length,Math.floor((a-this.l)/this.m+this.A-1)-(this.i+this.j)+1)),a>0&&(this.j+=a,this.h=this.h.slice(a)))}}};function bl(a,b,c,d,e,f,g,h,k,l,m,n){Ck.call(this,[]);this.F=a;this.i=b;this.I=c;this.D=d;this.H=e;this.L=f;this.l=g;this.m=h;this.A=k;this.C=l;this.K=m;this.N=n;this.G=-Infinity;dl(this)}ra(bl,Ck);q=bl.prototype;
q.getNumReferences=function(){return this.i?this.i.timeline.length:0};q.release=function(){Ck.prototype.release.call(this);this.i=null};q.Ua=function(a){if(this.i){var b=this.i.timeline;if(b){for(var c=0;c<b.length&&b[c].end+this.l<=a;)c++;c>0&&(this.G=b[c-1].end,this.i.timeline=b.slice(c),this.h.length>=c&&(this.h=this.h.slice(c)),this.j+=c,this.getNumReferences()===0&&this.release())}}};
function al(a,b,c,d,e,f){el(a,e);a.F=f;if(a.i){if(a.i.Lc!==b.Lc)for(c=b.Lc-a.i.Lc,e=0;e<b.timeline.length;e++)f=b.timeline[e],f.jf+=c,f.Jg+=c,f.start=(f.jf+c)/b.timescale,f.end=(f.Jg+c)/b.timescale;a.i.Gb!==b.Gb&&(a.i.Gb=b.Gb);c=a.i.timeline;if(c.length){var g=c[c.length-1];b=b.timeline.filter(function(h){return h.end>g.end})}else b=b.timeline.slice();b.length>0&&a.i.timeline.push.apply(a.i.timeline,F(b));a.m!==d&&(a.m=d)}else a.i=b,a.l=c,a.m=d;dl(a)}
function el(a,b){if(a.A!==b){a.A=b;a=r(a.h);for(var c=a.next();!c.done;c=a.next())(c=c.value)&&jk(c,b)}}function dl(a){if(a.i&&!a.u){for(var b=[],c=r(a.i.timeline),d=c.next();!d.done;d=c.next())d=d.value,d.start>=a.m||d.end<=0||d.end<=a.G||b.push(d);a.i.timeline=b;a.Ua(a.l)}}
q.find=function(a){var b=this;if(this.i&&this.i.timeline&&this.i.timeline.length&&a<this.i.timeline[0].start+this.l)return this.j;if(!this.i)return null;var c=this.i.timeline;if(a<this.l||a>=this.m)return null;var d=c.length-1,e=fb(c,function(h){return h.start+b.l<=a})-1;if(e<0)return null;var f=c[e],g=f.start+this.l;c=e<d?c[e+1].start+this.l:this.m===Infinity?f.end+this.l:this.m;return a>=g&&a<c?e+this.j:null};
q.get=function(a){var b=this;a-=this.j;if(a<0||a>=this.getNumReferences()||!this.i)return null;var c=this.h[a];if(!c){c=this.i.timeline[a];var d=c.Qk,e=c.jf+this.i.Lc,f=this.l-this.i.Hb,g=this.l+c.end,h=g;a===this.getNumReferences()-1&&this.m!==Infinity&&(h=this.F&&Math.abs(h-this.m)>.1?Math.min(h,this.m):this.m);var k=this.i.codecs,l=this.i.mimeType,m=this.i.bandwidth,n=[],p=!1;c.ig&&this.i&&this.i.Gb&&(p=this.i.Gb.includes("$SubNumber$"));if(p){p=(c.end-c.start)/c.ig;for(var t={},u=0;u<c.ig;t={mf:void 0,
Hi:void 0},u++){var v=c.start+p*u,w=v+p;t.Hi=u;t.mf=null;t=new V(this.l+v,this.l+w,function(x){return function(){if(!b.i)return[];if(x.mf==null){var y=b.H;var z=b.L,D=Lj(b.i.Gb,b.I,d,x.Hi,b.D||null,e);y=rj(y(),[D],z());x.mf=y}return x.mf}}(t),0,null,this.A,f,this.l,this.m,[],"",null,null,gk,this.C);t.codecs=k;t.mimeType=l;t.bandwidth=m;this.K==0?u>0&&t.Qd():u%this.K!=0&&t.Qd();n.push(t)}}c=new V(this.l+c.start,h,function(){if(n.length>0||!b.i)var x=[];else{x=b.H;var y=b.L,z=Lj(b.i.Gb,b.I,d,null,b.D||
null,e);x=rj(x(),[z],y())}return x},0,null,this.A,f,this.l,this.m,n,"",null,null,gk,this.C,n.length>0);c.codecs=k;c.mimeType=l;c.i=g;c.bandwidth=m;this.h[a]=c}return c};q.cc=function(a){dl(this);for(var b=0;b<this.getNumReferences();b++){var c=this.get(b+this.j);c&&a(c)}};q.qe=function(){return this.N};function fl(a,b){var c=null,d=!1,e=!1;a=r(ud(a,"ServiceDescription"));for(var f=a.next();!f.done;f=a.next()){f=f.value;var g=ud(f,"Scope"),h=g.some(function(k){return gl.includes(k.attributes.schemeIdUri)});if(!g.length||h)if(!d&&(g=hl(f))&&(c=c||{clientDataReporting:null},Object.assign(c,g),d=!0),!e&&(f=il(f,b))&&(c=c||{clientDataReporting:null},c.clientDataReporting=f,e=!0),d&&e)break}return c}
function hl(a){var b=Ad(a,"Latency"),c=Ad(a,"PlaybackRate");if(!b&&!c)return null;a={};if(b){var d=Dd(b,"target",Jd);d!=null&&(a.targetLatency=d/1E3);d=Dd(b,"max",Jd);d!=null&&(a.maxLatency=d/1E3);b=Dd(b,"min",Jd);b!=null&&(a.minLatency=b/1E3)}c&&(b=Dd(c,"max",Md),b!=null&&(a.maxPlaybackRate=b),c=Dd(c,"min",Md),c!=null&&(a.minPlaybackRate=c));return a}
function il(a,b){a=r(ud(a,"ClientDataReporting"));for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=ud(c,"CMCDParameters")[0]||null,e=c.attributes.schemeIdUri||(d?d.attributes.schemeIdUri:null)||"";if(e=="urn:mpeg:dash:cta-5004:2023")return{schemeIdUri:e,serviceLocations:Dd(c,"serviceLocations",Nd),adaptationSets:Dd(c,"adaptationSets",Nd),serviceLocationBaseUris:b,cmcdParameters:d?jl(d):null}}return null}
function jl(a){var b=Math.min(Dd(a,"version",Kd,1),2),c=Dd(a,"mode",function(f){return f=="query"||f=="header"?f:null},"query"),d=Dd(a,"includeInRequests",kl,["segment"]),e=Dd(a,"keys",Nd);e&&e.length||(e=null);return{version:b,mode:c,includeInRequests:d,keys:e,contentId:Dd(a,"contentID",ll),sessionId:Dd(a,"sessionID",ll)}}function kl(a){var b=[];a=r(Nd(a));for(var c=a.next();!c.done;c=a.next())c=c.value,c.includes(":")||ml.includes(c)&&b.push(c);return b}
function ll(a){a=a.trim();return!a.length||a.length>64?null:a}var gl=["urn:dvb:dash:lowlatency:scope:2019"],ml="segment init xlink mpd callback chaining fallback sbd steering mpdpatch altmpd mpdlink *".split(" ");function X(a,b,c,d){this.j=a;this.I=b;this.u=this.o=Infinity;this.i=d===void 0?1:d;this.h=this.m=null;this.F=0;this.C=!0;this.N=!1;this.K=0;this.H=c===void 0?!0:c;this.L=!1;this.D=0;this.A=!1;this.l=a;this.G=[]}q=X.prototype;q.getDuration=function(){return this.o};q.Jj=function(){return this.i};q.Vk=function(a){this.j=a};q.Vb=function(a){this.o=a;a!=Infinity&&(this.u=Infinity)};q.Qj=function(){return this.j};q.pi=function(a){this.F=a};q.Bg=function(a){a&&!this.C&&(this.N=!0);if(this.C=a)this.u=Infinity};
q.xi=function(a){this.isLive()&&(this.u=a)};q.Ce=function(){return this.u};q.Tk=function(a){this.L=a};q.ri=function(a){this.I=a};q.Cj=function(){return this.I};q.Xh=function(a,b){if(a.length!=0){var c=(Date.now()+this.F)/1E3;a=a.filter(function(e){return e.start+b<c});if(a.length!=0){var d=a[a.length-1].end+b;this.Re(a[0].start+b);this.i=a.reduce(function(e,f){return Math.max(e,f.end-f.start)},this.i);this.h=Math.max(this.h,d);this.j!=null&&this.H&&!this.A&&(this.j=c-this.h-this.i)}}};
q.fg=function(a){if(a.length!=0){var b=a[0].startTime,c=a[0].endTime,d=(Date.now()+this.F)/1E3;a=r(a);for(var e=a.next();!e.done;e=a.next())e=e.value,d<e.startTime||(b=Math.min(b,e.startTime),c=Math.max(c,e.endTime),this.i=Math.max(this.i,e.endTime-e.startTime));this.Re(b);this.h=Math.max(this.h,c);this.j!=null&&this.H&&!this.A&&(this.j=d-this.h-this.i)}};q.Wh=function(a,b){this.Re(a);b==Infinity||this.isLive()||(this.h=Math.max(this.h,b))};q.Kj=function(){return this.h};q.Mh=function(){this.A=!0};
q.ik=function(){return this.A};q.ti=function(a){this.l=a};q.Hj=function(){return this.l};q.Wk=function(a){this.G=a};q.Pf=function(a){if(!this.G.length)return null;for(var b=this.G[0],c=r(this.G),d=c.next();!d.done;d=c.next())if(d=d.value,d.start<=a)b=d;else break;return b};q.xh=function(a){var b=this.Pf(a);return b?b.ai+(a-b.start):this.l==null?null:this.l+a};q.Re=function(a){this.m==null?this.m=a:this.N||(this.m=Math.min(this.m,a))};q.eg=function(a){this.i=Math.max(this.i,a)};
q.offset=function(a){this.m!=null&&(this.m+=a);this.h!=null&&(this.h+=a)};q.isLive=function(){return this.o==Infinity&&!this.C};q.ad=function(){return this.o!=Infinity&&!this.C};q.na=function(){return!this.C};q.Ob=function(){var a=this.hc()-this.u;return Math.max(this.K,a)};q.Ci=function(a){this.K=a};q.hc=function(){return this.na()?Math.min(Math.max(0,(Date.now()+this.F)/1E3-this.i-this.j)+this.D,this.L&&this.h!=null?this.h+this.i+this.D:Infinity,this.o):this.h?Math.min(this.h,this.o):this.o};
q.Kd=function(a){var b=Math.max(this.m,this.K);if(this.u==Infinity)return Math.ceil(b*1E3)/1E3;var c=this.hc()-this.u;a=Math.min(c+a,this.ob());return Math.max(b,a)};q.yb=function(){return this.Kd(0)};q.ob=function(){var a=this.na()?this.I:0;return Math.max(0,this.hc()-a)};q.Oi=function(){return this.j==null||this.h!=null&&this.H?!1:!0};q.oi=function(a){this.D=a};q.yj=function(){return this.D};I("shaka.media.PresentationTimeline",X);X.prototype.getAvailabilityTimeOffset=X.prototype.yj;
X.prototype.setAvailabilityTimeOffset=X.prototype.oi;X.prototype.usingPresentationStartTime=X.prototype.Oi;X.prototype.getSeekRangeEnd=X.prototype.ob;X.prototype.getSeekRangeStart=X.prototype.yb;X.prototype.getSafeSeekRangeStart=X.prototype.Kd;X.prototype.getSegmentAvailabilityEnd=X.prototype.hc;X.prototype.setUserSeekStart=X.prototype.Ci;X.prototype.getSegmentAvailabilityStart=X.prototype.Ob;X.prototype.isDynamic=X.prototype.na;X.prototype.isInProgress=X.prototype.ad;X.prototype.isLive=X.prototype.isLive;
X.prototype.offset=X.prototype.offset;X.prototype.notifyMaxSegmentDuration=X.prototype.eg;X.prototype.notifyMinSegmentStartTime=X.prototype.Re;X.prototype.getProgramDateTimeForTime=X.prototype.xh;X.prototype.getProgramDateTimeRegionForTime=X.prototype.Pf;X.prototype.setProgramDateTimeRegions=X.prototype.Wk;X.prototype.getInitialProgramDateTime=X.prototype.Hj;X.prototype.setInitialProgramDateTime=X.prototype.ti;X.prototype.isStartTimeLocked=X.prototype.ik;X.prototype.lockStartTime=X.prototype.Mh;
X.prototype.getMaxSegmentEndTime=X.prototype.Kj;X.prototype.notifyPeriodDuration=X.prototype.Wh;X.prototype.notifySegments=X.prototype.fg;X.prototype.notifyTimeRange=X.prototype.Xh;X.prototype.getDelay=X.prototype.Cj;X.prototype.setDelay=X.prototype.ri;X.prototype.setClampLiveEdgeToSegments=X.prototype.Tk;X.prototype.getSegmentAvailabilityDuration=X.prototype.Ce;X.prototype.setSegmentAvailabilityDuration=X.prototype.xi;X.prototype.setStatic=X.prototype.Bg;X.prototype.setClockOffset=X.prototype.pi;
X.prototype.getPresentationStartTime=X.prototype.Qj;X.prototype.setDuration=X.prototype.Vb;X.prototype.setPresentationStartTime=X.prototype.Vk;X.prototype.getMaxSegmentDuration=X.prototype.Jj;X.prototype.getDuration=X.prototype.getDuration;function nl(a){return ol.getOrInsertComputed(a,function(){var b,c;return(c=(b=self.ManagedMediaSource||self.MediaSource)==null?void 0:b.isTypeSupported(a))!=null?c:!1})}function pl(){var a=self.ManagedMediaSource||self.MediaSource;return a&&a.prototype?!!a.prototype.setLiveSeekableRange&&!!a.prototype.clearLiveSeekableRange:!1}var ol=new Map;function ql(a){a=S(a);var b=hi(a).length;if(b+1<a.length&&Ki(a,b)){var c=Ji(a,b);var d=4;c&&c.mh&&(d=c.mh);c=b+d;c=c===a.length||c+1<a.length&&Ki(a,c)}else c=!1;if(c)a="audio/mpeg";else if(Ii(a,b))a="audio/aac";else{a:{c=b;if(a[c]===11&&a[c+1]===119){d=0;var e=5;c+=e;for(var f,g;e>0;){g=a[c];var h=Math.min(e,8),k=8-h;f=4278190080>>>24+k<<k;f=(g&f)>>k;d=d?d<<h|f:f;c+=1;e-=h}if(d<16){c=!0;break a}}c=!1}a=c?"audio/ac3":(a[b]<<8|a[b+1]<<0)===2935?"audio/ec3":null}return a}
function rl(a){var b=new Set,c=[];a=r(a);for(var d=a.next();!d.done;d=a.next()){d=d.value;var e=Ke(d);b.has(e)||(c.push(d),b.add(e))}b=zc("audio",c);d=zc("video",c);a=zc(wc,c);d=sl(d);b=b.concat(d).concat(a);return c.length&&!b.length?c:b}
function sl(a){if(a.length<=1)return a;var b=a.find(function(c){return c.startsWith("dvav.")||c.startsWith("dva1.")||c.startsWith("dvh1.")||c.startsWith("dvhe.")||c.startsWith("dav1.")||c.startsWith("dvc1.")||c.startsWith("dvi1.")});return b?nl('video/mp4; codecs="'+b+'"')?[b]:a.filter(function(c){return c!=b}):a}
function tl(a){var b=null;(new ih).ma([].concat(F(wh),["sinf","schi"]),nh).S("stsd",sh).box("encv",th).box("enca",uh).S("tenc",function(c){b=Jh(c.reader,c.version).defaultKID}).parse(a,!0);return b}
function ul(a,b,c){var d,e,f,g,h,k,l,m,n;return H(function(p){if(p.i==1)return d=b,d.cryptoKey?p.B(2):p.h(d.fetchKey(),3);if(b.blockCipherMode=="GCM"&&b.bitsKey==256){e=S(a);if(e.byteLength<32)throw new T(2,4,4060);f=e.slice(0,16);g=e.slice(16);h={name:"AES-GCM",iv:f,tagLength:128};return p.return(window.crypto.subtle.decrypt(h,d.cryptoKey,g))}k=d.iv;if(!k)for(k=S(new ArrayBuffer(16)),l=d.firstMediaSequenceNumber+c,m=k.byteLength-1;m>=0;m--)k[m]=l&255,l>>=8;b.blockCipherMode=="CBC"?n={name:"AES-CBC",
iv:k}:n={name:"AES-CTR",counter:k,length:64};return p.return(window.crypto.subtle.decrypt(n,d.cryptoKey,a))})};function vl(a,b,c){var d,e,f,g,h,k;return H(function(l){switch(l.i){case 1:var m;a:{var n=a.length;for(var p=0;p<a.length;p++){var t=a.charCodeAt(p);if(t===63||t===35){n=p;break}}for(p=n-1;p>=0;p--){t=a.charCodeAt(p);if(t===46){if(p+1<n){n=a.slice(p+1,n).toLowerCase();break a}break}if(t===47)break}n=""}if(d=(m=wl.get(n))!=null?m:"")return l.return(d);e=0;f=Cj([a],c);l.o(2);f.method="HEAD";return l.h(b.request(e,f).promise,4);case 4:g=l.j;d=g.headers["content-type"];l.u(3);break;case 2:h=l.m();if(!h||
h.code!=1002&&h.code!=1001){l.B(3);break}f.method="GET";return l.h(b.request(e,f).promise,6);case 6:k=l.j,d=k.headers["content-type"];case 3:return l.return(d?d.toLowerCase().split(";").shift():"")}})}function xl(a,b,c,d,e){a=Cj(a,d,e);if(b!=0||c!=null)a.headers.Range=c?"bytes="+b+"-"+c:"bytes="+b+"-";return a}
var wl=(new Map).set("mp4","video/mp4").set("m4v","video/mp4").set("m4a","audio/mp4").set("cmfv","video/mp4").set("cmfa","audio/mp4").set("webm","video/webm").set("weba","audio/webm").set("mkv","video/webm").set("ts","video/mp2t").set("ogv","video/ogg").set("ogg","audio/ogg").set("opus","audio/opus").set("mpg","video/mpeg").set("mpeg","video/mpeg").set("mov","video/quicktime").set("m3u8","application/x-mpegurl").set("mpd","application/dash+xml").set("mp3","audio/mpeg").set("aac","audio/aac").set("flac",
"audio/flac").set("wav","audio/wav").set("srt","text/srt").set("vtt","text/vtt").set("webvtt","text/vtt").set("ttml","application/ttml+xml").set("jpeg","image/jpeg").set("jpg","image/jpeg").set("png","image/png").set("svg","image/svg+xml").set("webp","image/webp").set("avif","image/avif").set("html","text/html").set("htm","text/html");function yl(a){this.u=null;this.C=a;this.H=new pj;this.l=[];this.i=null;this.o=[];this.D=null;this.G=[];this.F=300;this.m=new Map;this.j=new Map;this.h=null;this.A="UNKNOWN"}yl.prototype.configure=function(a){this.u=a};yl.prototype.destroy=function(){this.C=this.u=null;this.l=[];this.i=null;this.o=[];this.G=[];this.m.clear();this.h!=null&&(this.h.stop(),this.h=null);return this.H.destroy()};yl.prototype.setManifestType=function(a){this.A=a};
function zl(a,b){var c,d,e,f,g,h,k;return H(function(l){if(l.i==1)return c=rj(a.l,[Al(a,b)]),d=Cj(c,a.u.retryParameters),e=a.C.networkingEngine.request(8,d),qj(a.H,e),l.o(2),l.h(e.promise,4);if(l.i!=2)return f=l.j,g=Db(f.data),h=JSON.parse(g),h.VERSION==1&&Bl(a,h,f.uri),l.u(0);if((k=l.m())&&k.code==7001)return l.return();a.h!=null&&(a.h.stop(),a.h=null);a.h=new gf(function(){zl(a,b)});a.h.ka(a.F);l.l()})}
function Al(a,b){if(!a.o.length)return b;var c=new Map,d=a.D||a.o[0],e=Math.round(a.C.getBandwidthEstimate());a.A=="DASH"?(c.set("_DASH_pathway",d),c.set("_DASH_throughput",String(e))):a.A=="HLS"&&(c.set("_HLS_pathway",d),c.set("_HLS_throughput",String(e)));if(c.size){a=new URL(b);b=[];c=r(c.entries());for(d=c.next();!d.done;d=c.next())e=r(d.value),d=e.next().value,e=e.next().value,b.push(encodeURIComponent(d)+"="+encodeURIComponent(e));wj(a,b);a=a.toString()}else a=b;return a}
function Bl(a,b,c){a.h!=null&&(a.h.stop(),a.h=null);var d=b["RELOAD-URI"]||c;a.h=new gf(function(){zl(a,d)});if(c=b.TTL)a.F=c;a.h.ka(a.F);a.o=b["PATHWAY-PRIORITY"]||[];a.G=b["PATHWAY-CLONES"]||[]}function Cl(a,b,c,d){var e=a.m.get(b);e||(e=new Map);e.set(c,d);a.m.set(b,e)}yl.prototype.banLocation=function(a){this.j.set(a,Date.now()+6E4)};
function Dl(a,b,c){c=c===void 0?!1:c;b=a.m.get(b)||new Map;for(var d=[],e=r(a.o),f=e.next(),g={};!f.done;g={fd:void 0},f=e.next())if(g.fd=f.value,f=b.get(g.fd))d.push({jg:g.fd,location:f});else if(f=a.G.find(function(k){return function(l){return l.Fl==k.fd}}(g))){var h=b.get(f["BASE-ID"]);h&&(f["URI-REPLACEMENT"].Ti?(f=uj(h,f["URI-REPLACEMENT"].Ti),d.push({jg:g.fd,location:f})):d.push({jg:g.fd,location:h}))}e=Date.now();g=r(a.j.keys());for(f=g.next();!f.done;f=g.next())f=f.value,h=a.j.get(f),e>h&&
a.j.delete(f);d=d.filter(function(k){k=tj(k.location);for(var l=r(a.j.keys()),m=l.next();!m.done;m=l.next())if(m.value.includes(k))return!1;return!0});d.length&&(a.D=d[0].jg);d=d.map(function(k){return k.location});if(!d.length&&a.i)for(e=r(a.i.split(",")),g=e.next();!g.done;g=e.next())if(g=b.get(g.value))a.D=a.i,d.push(g);if(!d.length)for(b=r(b.values()),e=b.next();!e.done;e=b.next())d.push(e.value);return c?d:rj(a.l,d)};function El(){this.m=[];this.i=[];this.h=[];this.l=[];this.j=[];this.u=!1;this.o=new Set;this.A=(new Map).set("audio",this.i).set("video",this.h).set(wc,this.l).set("image",this.j)}q=El.prototype;q.release=function(){for(var a=r(this.i.concat(this.h,this.l,this.j)),b=a.next();!b.done;b=a.next())b=b.value,b.segmentIndex&&b.segmentIndex.release();this.i=[];this.h=[];this.l=[];this.j=[];this.m=[];this.u=!1;this.o.clear();this.A.clear()};q.Zj=function(){return this.m};q.Rf=function(){return this.l.slice()};
q.Fj=function(){return this.j};q.dh=function(a,b){if(a){var c=this.A.get(a.type)||[];c=r(c);for(var d=c.next();!d.done;d=c.next()){d=d.value;Fl(d,a);d=Gl(d);d=r(d);for(var e=d.next();!e.done;e=d.next())Fl(e.value,a)}a.segmentIndex&&a.closeSegmentIndex();this.o.delete(b)}};function Fl(a,b){var c;a.matchedStreams=(c=a.matchedStreams)==null?void 0:c.filter(function(d){return d!==b})}function Hl(a,b){return new Map(a.map(function(c){return[b(c),c]}))}
function Il(a,b){var c=[],d=[],e=[],f=[];a=r(a);for(var g=a.next();!g.done;g=a.next()){var h=g.value;g=Hl(h.audioStreams,Jl);var k=Hl(h.videoStreams,Kl),l=Hl(h.textStreams,Ll);h=Hl(h.imageStreams,Ml);if(b){var m=Nl(wc);l.set(Ll(m),m);m=Nl("image");h.set(Ml(m),m)}c.push(g);d.push(k);e.push(l);f.push(h)}return{zf:c,Lg:d,Gg:e,Sf:f}}
q.Cf=function(a,b,c){c=c===void 0?!1:c;var d=this,e,f,g,h,k,l,m,n,p,t,u,v,w,x,y,z,D,A,B,E,C,G,K,L,N,J,O,M,P,U,Q,da;return H(function(Z){switch(Z.i){case 1:e=Ac;if(!b&&a.length==1){f=Il(a,!1);g=f.zf;h=f.Lg;k=f.Gg;l=f.Sf;d.i=Array.from(g[0].values());d.h=Array.from(h[0].values());d.l=Array.from(k[0].values());d.j=Array.from(l[0].values());Z.B(2);break}m=c?d.o.size:0;n=-1;for(p=0;p<a.length;p++)t=a[p],d.o.has(t.id)||(d.o.add(t.id),n==-1&&(n=p));if(n!=-1){Z.B(3);break}return Z.h(Ol(d,a),4);case 4:return Z.return();
case 3:return u=Il(a,!0),v=u.zf,w=u.Lg,x=u.Gg,y=u.Sf,Z.h(Promise.all([Pl(d,d.i,v,n,m),Pl(d,d.h,w,n,m),Pl(d,d.l,x,n,m),Pl(d,d.j,y,n,m)]),2);case 2:z=0;D=[];if(d.h.length&&d.i.length)for(L=r(d.i),N=L.next();!N.done;N=L.next())for(J=N.value,O=r(d.h),M=O.next();!M.done;M=O.next())P=M.value,U=Vb(J.drmInfos,P.drmInfos),J.drmInfos.length&&P.drmInfos.length&&!U.length||(Q=(J.bandwidth||0)+(P.bandwidth||0),J.dependencyStream&&(Q+=J.dependencyStream.bandwidth||0),P.dependencyStream&&(Q+=P.dependencyStream.bandwidth||
0),da=z++,D.push({id:da,language:J.language,disabledUntilTime:0,primary:J.primary,audio:J,video:P,bandwidth:Q,drmInfos:U,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]}));else for(A=d.h.length?d.h:d.i,B=r(A),E=B.next();!E.done;E=B.next())C=E.value,G=z++,K=C.bandwidth||0,C.dependencyStream&&(K+=C.dependencyStream.bandwidth||0),D.push({id:G,language:C.language,disabledUntilTime:0,primary:C.primary,audio:C.type==e.X?C:null,video:C.type==e.oa?C:null,bandwidth:K,drmInfos:C.drmInfos,allowedByApplication:!0,
allowedByKeySystem:!0,decodingInfos:[]});d.m=D;Z.l()}})};
function Ol(a,b){var c,d,e,f,g,h,k,l,m,n,p,t,u,v,w,x,y,z;return H(function(D){switch(D.i){case 1:c=Il(b,!1),d=[{Te:a.i,df:c.zf},{Te:a.h,df:c.Lg},{Te:a.l,df:c.Gg},{Te:a.j,df:c.Sf}],e=r(d),f=e.next();case 2:if(f.done){D.B(0);break}h=g=f.value;k=h.Te;l=h.df;m=r(k);n=m.next();case 5:if(n.done){f=e.next();D.B(2);break}p=n.value;t=p.matchedStreams;if(!t){D.B(6);break}u=r(l);v=u.next();case 8:if(v.done){D.B(6);break}w=v.value;x=Ql(a,w,p);if(!x||t.includes(x)){D.B(9);break}y=t.length;t.push(x);D.o(11);if(!p.segmentIndex){D.B(13);
break}return D.h(Rl(p,y),13);case 13:D.u(12);break;case 11:throw z=D.m(),t.pop(),z;case 12:Sl(p,x);case 9:v=u.next();D.B(8);break;case 6:n=m.next(),D.B(5)}})}
function Pl(a,b,c,d,e){var f=Tl,g=Sl,h,k,l,m,n,p,t,u,v,w,x,y,z,D,A,B,E,C,G,K;return H(function(L){switch(L.i){case 1:h=[];for(k=0;k<c.length;k++)k>=d?h.push(new Set(c[k].values())):h.push(new Set);l=r(b);m=l.next();case 2:if(m.done){L.B(4);break}n=m.value;return L.h(Ul(a,n,c,d,g,h,e),5);case 5:p=L.j;if(!p)throw new T(2,4,4037);m=l.next();L.B(2);break;case 4:t=r(h);for(u=t.next();!u.done;u=t.next())for(v=u.value,w=r(v),x=w.next();!x.done;x=w.next())y=x.value,(z=Vl(a,b,y,c,f,g,h))&&b.push(z);D=r(h);
for(A=D.next();!A.done;A=D.next())for(B=A.value,E=r(B),C=E.next(),G={};!C.done;G={Dg:void 0},C=E.next())if(G.Dg=C.value,!Wl(G.Dg)&&(K=b.some(function(N){return function(J){return Xl(N.Dg,J)}}(G))))throw new T(2,4,4037);return L.return(b)}})}function Ul(a,b,c,d,e,f,g){return H(function(h){if(h.i==1)return Yl(a,c,b,g>0),b.matchedStreams?b.segmentIndex?h.h(Rl(b,d+g),2):h.B(2):h.return(!1);Zl(b,d,e,f,g);return h.return(!0)})}
function Rl(a,b){var c,d,e,f,g,h,k,l,m,n;return H(function(p){if(p.i==1){c=[];d=a.matchedStreams;for(e=b;e<d.length;e++)for(f=d[e],c.push(f.createSegmentIndex()),g=Gl(f),h=r(g),k=h.next();!k.done;k=h.next())l=k.value,l.segmentIndex||c.push(l.createSegmentIndex());return p.h(Promise.all(c),2)}if(a.segmentIndex instanceof Fk)for(m=b;m<d.length;m++)n=d[m],n.segmentIndex&&a.segmentIndex.i.push(n.segmentIndex);p.l()})}
function Vl(a,b,c,d,e,f,g){if(Wl(c))return null;var h=e(c);Yl(a,d,h);h.createSegmentIndex&&(h.createSegmentIndex=function(){return H(function(k){if(h.segmentIndex)return k.B(0);h.segmentIndex=new Fk;return k.h(Rl(h,0),0)})},h.closeSegmentIndex=function(){h.segmentIndex&&(h.segmentIndex.release(),h.segmentIndex=null);if(h.matchedStreams)for(var k=r(h.matchedStreams),l=k.next();!l.done;l=k.next()){l=l.value;var m;if(m=l.segmentIndex){a:{m=r(b);for(var n=m.next();!n.done;n=m.next())if(n=n.value,n!==
h&&n.segmentIndex&&n.matchedStreams&&n.matchedStreams.includes(l)){m=!0;break a}m=!1}m=!m}m&&(l.segmentIndex.release(),l.segmentIndex=null)}});if(!h.matchedStreams||!h.matchedStreams.length)return null;Zl(h,0,f,g,0);return h}
function Zl(a,b,c,d,e){var f=a.matchedStreams;for(b+=e;b<f.length;b++){var g=f[b];c(a,g);var h=!0;a.type=="audio"&&nc(a.language,g.language)==0&&(h=!1);if(h&&((h=d[b-e])&&h.delete(g),g.fullMimeTypes))for(g=r(g.fullMimeTypes.values()),h=g.next();!h.done;h=g.next())a.fullMimeTypes.add(h.value)}}
function Tl(a){var b=Object.assign({},a);b.originalId=null;b.createSegmentIndex=function(){return Promise.resolve()};b.closeSegmentIndex=function(){};b.roles=b.roles.slice();b.segmentIndex=null;b.emsgSchemeIdUris=[];b.keyIds=new Set(a.keyIds);b.closedCaptions=a.closedCaptions?new Map(a.closedCaptions):null;b.trickModeVideo=null;b.dependencyStream=null;return b}function $l(a,b){a||(a=[]);b=r(b);for(var c=b.next();!c.done;c=b.next())c=c.value,a.includes(c)||a.push(c);return a}
function Sl(a,b){a.roles=$l(a.roles,b.roles);b.emsgSchemeIdUris&&(a.emsgSchemeIdUris=$l(a.emsgSchemeIdUris,b.emsgSchemeIdUris));for(var c=r(b.keyIds),d=c.next();!d.done;d=c.next())a.keyIds.add(d.value);a.originalId==null?a.originalId=b.originalId:(c=b.originalId||"")&&!a.originalId.endsWith(c)&&(a.originalId+=","+c);c=Vb(a.drmInfos,b.drmInfos);if(b.drmInfos.length&&a.drmInfos.length&&!c.length)throw new T(2,4,4038);a.drmInfos=c;a.encrypted=a.encrypted||b.encrypted;if(b.closedCaptions)for(a.closedCaptions||
(a.closedCaptions=new Map),c=r(b.closedCaptions),d=c.next();!d.done;d=c.next()){var e=r(d.value);d=e.next().value;e=e.next().value;a.closedCaptions.set(d,e)}a.bandwidth&&b.bandwidth&&(a.bandwidth=Math.max(a.bandwidth,b.bandwidth));c=r(am);for(d=c.next();!d.done;d=c.next())bm(a,b,d.value)}
function bm(a,b,c){var d=b[c]||null,e=a[c]||null;d?(e||(e=Tl(d),e.matchedStreams=[],e.createSegmentIndex=function(){var f,g,h,k;return H(function(l){switch(l.i){case 1:if(e.segmentIndex)return l.return();f=new Fk;g=r(e.matchedStreams);h=g.next();case 2:if(h.done){l.B(4);break}k=h.value;if(k.segmentIndex){l.B(5);break}return l.h(k.createSegmentIndex(),5);case 5:f.i.push(k.segmentIndex);h=g.next();l.B(2);break;case 4:e.segmentIndex=f,l.l()}})},a[c]=e),e.matchedStreams.push(d),Sl(e,d)):e&&(e.matchedStreams.push(b),
Sl(e,b))}function Yl(a,b,c,d){d=(d===void 0?0:d)?c.matchedStreams:[];b=r(b);for(var e=b.next();!e.done;e=b.next()){e=Ql(a,e.value,c);if(!e)return;d.push(e)}c.matchedStreams=d}
function Ql(a,b,c){var d={audio:Jl,video:Kl,text:Ll,image:Ml}[c.type],e=null,f=d(c);if(b.has(f))e=b.get(f);else{f={audio:function(l,m){return Xl(l,m)},video:function(l,m){return Xl(l,m)},text:cm,image:dm}[c.type];for(var g={audio:em,video:fm,text:gm,image:hm}[c.type],h=r(b.values()),k=h.next();!k.done;k=h.next())k=k.value,!f(c,k)||c.fastSwitching!=k.fastSwitching||e&&!g(c,e,k)||(e=k)}a.u&&!Wl(e)&&b.delete(d(e));return e}
function im(a,b){return a.mimeType!=b.mimeType?!1:jm(a.codecs)===jm(b.codecs)}q.Bi=function(a){this.u=a};function Xl(a,b){return a.drmInfos&&!Tb(a.drmInfos,b.drmInfos)?!1:!0}function cm(a,b){return b.language?a.forced!==b.forced||nc(a.language,b.language)==0?!1:!0:!0}function dm(){return!0}
function em(a,b,c){var d=km(a,b,c);if(d===lm)return!0;if(d===mm)return!1;d=nc(a.language,b.language);var e=nc(a.language,c.language);if(e>d)return!0;if(e<d)return!1;if(b.label!==c.label){if(a.label===b.label)return!1;if(a.label===c.label)return!0}if(a.roles.length){d=b.roles.filter(function(f){return a.roles.includes(f)});e=c.roles.filter(function(f){return a.roles.includes(f)});if(e.length>d.length)return!0;if(e.length<d.length)return!1;if(c.roles.length!==b.roles.length)return c.roles.length<b.roles.length}else{if(!c.roles.length&&
b.roles.length)return!0;if(c.roles.length&&!b.roles.length)return!1}if(!b.primary&&c.primary)return!0;if(b.primary&&!c.primary)return!1;d=nm(a.channelsCount,b.channelsCount,c.channelsCount);if(d==lm)return!0;if(d==mm)return!1;d=nm(a.audioSamplingRate,b.audioSamplingRate,c.audioSamplingRate);return d==lm?!0:d==mm?!1:a.bandwidth&&om(a.bandwidth,b.bandwidth,c.bandwidth)==lm?!0:!1}
function fm(a,b,c){var d=km(a,b,c);if(d===lm)return!0;if(d===mm)return!1;d=nm(a.width*a.height,b.width*b.height,c.width*c.height);if(d==lm)return!0;if(d==mm)return!1;if(a.frameRate){d=nm(a.frameRate,b.frameRate,c.frameRate);if(d==lm)return!0;if(d==mm)return!1}return a.bandwidth&&om(a.bandwidth,b.bandwidth,c.bandwidth)==lm?!0:!1}
function gm(a,b,c){var d=nc(a.language,b.language),e=nc(a.language,c.language);if(e>d)return!0;if(e<d)return!1;d=b.kind==a.kind;if((e=c.kind==a.kind)&&!d)return!0;if(!e&&d)return!1;if(!b.primary&&c.primary)return!0;if(b.primary&&!c.primary)return!1;if(b.label!==c.label){if(a.label===b.label)return!1;if(a.label===c.label)return!0}if(a.roles.length){d=b.roles.filter(function(f){return a.roles.includes(f)});e=c.roles.filter(function(f){return a.roles.includes(f)});if(e.length>d.length)return!0;if(e.length<
d.length)return!1}else{if(!c.roles.length&&b.roles.length)return!0;if(c.roles.length&&!b.roles.length)return!1}return c.mimeType!=a.mimeType||c.codecs!=a.codecs||b.mimeType==a.mimeType&&b.codecs==a.codecs?!1:!0}function hm(a,b,c){return nm(a.width*a.height,b.width*b.height,c.width*c.height)==lm?!0:!1}function Nl(a){return Yf({originalId:"",segmentIndex:new Ck([]),type:a})}
function nm(a,b,c){if(b==a&&a!=c)return mm;if(c==a&&a!=b)return lm;if(b>a){if(c<=a||c-a<b-a)return lm;if(c-a>b-a)return mm}else{if(c>a)return mm;if(a-c<a-b)return lm;if(a-c>a-b)return mm}return pm}function km(a,b,c){var d=a.mimeType===b.mimeType&&a.codecs===b.codecs,e=a.mimeType===c.mimeType&&a.codecs===c.codecs;if(d&&!e)return mm;if(!d&&e)return lm;b=im(a,b);a=im(a,c);return b&&!a?mm:!b&&a?lm:pm}function om(a,b,c){b=Math.abs(a-b);a=Math.abs(a-c);return a<b?lm:b<a?mm:pm}
function Wl(a){switch(a.type){case wc:return!a.language;case "image":return!a.tilesLayout;default:return!1}}function Kl(a){var b,c;return qm([a.fastSwitching,a.width,a.frameRate,a.codecs,a.mimeType,a.label,a.roles,a.closedCaptions?Array.from(a.closedCaptions.entries()):null,a.bandwidth,(c=(b=a.dependencyStream)==null?void 0:b.baseOriginalId)!=null?c:a.baseOriginalId,Array.from(a.keyIds)])}
function Jl(a){var b,c;return qm([a.fastSwitching,a.channelsCount,a.language,a.bandwidth,a.label,a.codecs,a.mimeType,a.roles,a.audioSamplingRate,a.primary,(c=(b=a.dependencyStream)==null?void 0:b.baseOriginalId)!=null?c:a.baseOriginalId,Array.from(a.keyIds)])}function Ll(a){return qm([a.language,a.label,a.codecs,a.mimeType,a.bandwidth,a.roles])}function Ml(a){return qm([a.width,a.codecs,a.mimeType])}function qm(a){return JSON.stringify(a)}
function jm(a){return rm.getOrInsertComputed(a,function(){return Ie(a)})}function Gl(a){for(var b=[],c=r(am),d=c.next();!d.done;d=c.next())(d=a[d.value])&&b.push(d);return b}I("shaka.util.PeriodCombiner",El);El.prototype.setUseStreamOnce=El.prototype.Bi;El.prototype.combinePeriods=El.prototype.Cf;El.prototype.deleteStream=El.prototype.dh;El.prototype.getImageStreams=El.prototype.Fj;El.prototype.getTextStreams=El.prototype.Rf;El.prototype.getVariants=El.prototype.Zj;
var am=["trickModeVideo","dependencyStream"],lm=1,pm=0,mm=-1,rm=new Map;function sm(){}function tm(a){a=Gb(a);return tj(a)}function um(a,b,c){function d(h){zb(f).setUint32(g,h.byteLength,!0);g+=4;f.set(S(h),g);g+=h.byteLength}if(!c||!c.byteLength)throw new T(2,6,6015);var e;typeof b=="string"?e=Ib(b,!0):e=b;a=Gb(a);a=Ib(a,!0);var f=new Uint8Array(12+a.byteLength+e.byteLength+c.byteLength),g=0;d(a);d(e);d(c);return f}function vm(a,b,c){if(b!=="skd")return a;b=c.serverCertificate;c=Gb(a).split("skd://").pop();return um(a,c,b)}
function wm(a,b){a!==2||b.attempt>0||(a=b.drmInfo)&&ac(a.keySystem)&&(b.headers["Content-Type"]="application/octet-stream")}I("shaka.drm.FairPlay",sm);
sm.commonFairPlayResponse=function(a,b){if(a===2&&(a=b.originalRequest.drmInfo)&&ac(a.keySystem)){try{var c=Db(b.data)}catch(e){return}a=!1;c=c.trim();c.substr(0,5)==="<ckc>"&&c.substr(-6)==="</ckc>"&&(c=c.slice(5,-6),a=!0);if(!a)try{var d=JSON.parse(c);d.ckc&&(c=d.ckc,a=!0);d.CkcMessage&&(c=d.CkcMessage,a=!0);d.License&&(c=d.License,a=!0)}catch(e){}a&&(b.data=ub(Nb(c)))}};
sm.gumletFairPlayRequest=function(a,b){a!==2||b.attempt>0||(a=b.drmInfo)&&ac(a.keySystem)&&b.body&&(a=S(b.body),a=Mb(a),b.body=Hb(JSON.stringify({ym:a})),b.headers["Content-Type"]="application/json")};sm.muxFairPlayRequest=function(a,b){wm(a,b)};sm.expressplayFairPlayRequest=function(a,b){wm(a,b)};sm.conaxFairPlayRequest=function(a,b){wm(a,b)};sm.ezdrmFairPlayRequest=function(a,b){wm(a,b)};
sm.verimatrixFairPlayRequest=function(a,b){a!==2||b.attempt>0||(a=b.drmInfo)&&ac(a.keySystem)&&(a=S(b.body),a=Mb(a),b.headers["Content-Type"]="application/x-www-form-urlencoded",b.body=Hb("spc="+a))};sm.muxInitDataTransform=function(a,b,c){return vm(a,b,c)};sm.expressplayInitDataTransform=function(a,b,c){return vm(a,b,c)};
sm.conaxInitDataTransform=function(a,b,c){if(b!=="skd")return a;b=c.serverCertificate;c=Gb(a).split("skd://").pop().split("?").shift();c=window.atob(c);var d=new ArrayBuffer(c.length*2);d=yb(d);for(var e=0,f=c.length;e<f;e++)d[e]=c.charCodeAt(e);return um(a,d,b)};sm.ezdrmInitDataTransform=function(a,b,c){if(b!=="skd")return a;b=c.serverCertificate;c=Gb(a).split(";").pop();return um(a,c,b)};sm.verimatrixInitDataTransform=function(a,b,c){return vm(a,b,c)};sm.initDataTransform=um;
sm.defaultGetContentId=tm;sm.isFairPlaySupported=function(){var a;return H(function(b){if(b.i==1)return a={initDataTypes:["cenc","sinf","skd"],videoCapabilities:[{contentType:'video/mp4; codecs="avc1.42E01E"'}]},b.o(2),b.h(navigator.requestMediaKeySystemAccess("com.apple.fps",[a]),4);if(b.i!=2)return b.return(!0);b.m();return b.return(!1)})};function xm(a,b,c){c=c===void 0?!0:c;this.i=a;this.h=new Set([a]);b=b||[];a=r(b);for(b=a.next();!b.done;b=a.next())this.add(b.value,c)}xm.prototype.add=function(a,b){return ym(this.i,a,b===void 0?!0:b)?(this.h.add(a),!0):!1};function ym(a,b,c){return!!a.audio!=!!b.audio||!!a.video!=!!b.video||a.language!=b.language||a.audio&&b.audio&&!zm(a.audio,b.audio,c)||a.video&&b.video&&!Am(a.video,b.video,c)?!1:!0}xm.prototype.values=function(){return this.h.values()};
function Bm(a,b){if(!a.audio||!b.audio)return a.audio==b.audio;if(a.audio==b.audio)return!0;var c=!a.audio.channelsCount||!b.audio.channelsCount||a.audio.channelsCount==b.audio.channelsCount;return a.language==b.language&&a.audio.label==b.audio.label&&c&&a.audio.spatialAudio==b.audio.spatialAudio&&a.audio.groupId==b.audio.groupId&&Ie(a.audio.codecs)==Ie(b.audio.codecs)&&db(a.audio.roles,b.audio.roles)}
function Cm(a,b){return a.video&&b.video?(a.video.label||"")==(b.video.label||"")&&(a.video.language||"")==(b.video.language||"")&&db(a.video.roles,b.video.roles):!a.video==!b.video}
function Dm(a,b,c){function d(p){return(p.channelsCount||0)*2+(p.spatialAudio?1:0)}var e=a[0];if(!e||!e.audio||a.some(function(p){return!p.audio||!p.audio.channelsCount}))return[];var f=Math.min.apply(Math,F(a.map(function(p){return d(p.audio)}))),g=new Set(a.map(function(p){var t;return(t=p.video)==null?void 0:t.hdr})),h=new Set(a.map(function(p){var t;return(t=p.video)==null?void 0:t.videoLayout})),k=new Map;b=r(b);for(var l=b.next();!l.done;l=b.next()){l=l.value;var m=l.audio;a.includes(l)||!m||
!m.channelsCount||d(m)>=f||l.language!=e.language||m.label!=e.audio.label||!db(m.roles,e.audio.roles)||c&&!Em(e.audio,m)||Cm(e,l)&&(!e.video||!l.video||g.has(l.video.hdr)&&h.has(l.video.videoLayout)&&Am(e.video,l.video,c))&&k.getOrInsertComputed(d(m),function(){return[]}).push(l)}c=Ie(e.audio.codecs);e=[];var n=Math.min.apply(Math,F(a.map(function(p){return p.bandwidth})));a=Array.from(k.keys()).sort(function(p,t){return t-p});a=r(a);g=a.next();for(f={};!g.done;f={wc:void 0,ye:void 0},g=a.next()){g=
k.get(g.value);f.wc=new Map;h=r(g);for(b=h.next();!b.done;b=h.next())b=Ie(b.value.audio.codecs),f.wc.set(b,f.wc.getOrInsert(b,0)+1);f.ye=c;f.wc.has(f.ye)||(f.ye=Array.from(f.wc.keys()).reduce(function(p){return function(t,u){return p.wc.get(u)>p.wc.get(t)?u:t}}(f)));f=g.filter(function(p){return function(t){return Ie(t.audio.codecs)==p.ye&&t.bandwidth<n}}(f));f.length&&(e.push.apply(e,F(f)),n=Math.min.apply(Math,F(f.map(function(p){return p.bandwidth}))))}return e}
function zm(a,b,c){if(!a.channelsCount||!b.channelsCount){if(a.channelsCount!=b.channelsCount&&Ie(a.codecs)!=Ie(b.codecs))return!1}else if((a.channelsCount>2||b.channelsCount>2)&&a.channelsCount!=b.channelsCount)return!1;return a.spatialAudio!==b.spatialAudio||c&&!Em(a,b)||!db(a.roles,b.roles)||a.groupId!==b.groupId?!1:!0}function Am(a,b,c){return c&&!Em(a,b)||!db(a.roles,b.roles)?!1:!0}
function Em(a,b){if(a.mimeType!=b.mimeType)return!1;a=a.codecs.split(",").map(function(c){return Ke(c)});b=b.codecs.split(",").map(function(c){return Ke(c)});return db(a,b)}I("shaka.media.AdaptationSet",xm);function Fm(){this.i=this.h=null}Fm.prototype.configure=function(a){this.h=a};Fm.prototype.getConfiguration=function(){return this.h};
Fm.prototype.create=function(a){a=Gm(a,this.h.preferredAudio,this.h.audioCodec,this.h.activeAudioCodec);a:for(var b=r(this.h.preferredVideo),c=b.next();!c.done;c=b.next()){c=c.value;var d=a;if(c.role&&(d=Hm(d,c.role),!d.length))continue;if(c.language&&(d=Im(d,c.language),!d.length))continue;if(c.label&&(d=Jm(d,c.label),!d.length))continue;if(c.hdrLevel&&(d=Km(d,c.hdrLevel),!d.length))continue;if(c.layout&&(d=Lm(d,c.layout),!d.length))continue;if(c.codec)if(c=Mm(d,c.codec),c.length)d=c;else continue;
if(d.length){a=d;break a}}b=R();c=this.h.keySystem;b=!(this.h.codecSwitchingStrategy=="smooth"&&b.cb(c));c=Nm(a,b);return this.i=new xm(c,a,b)};Fm.prototype.getLastAdaptationSet=function(){return this.i};
function Nm(a,b){function c(m){return a.filter(function(n){return ym(m,n,!0)}).length}function d(m){var n=m.video.codecs.split(",").map(function(p){return Ke(p)}).sort();return m.video.mimeType+";"+n.join(",")}var e=a[0];if(!b||!e.video)return e;b=e;for(var f=c(e),g=new Set([d(e)]),h=r(a),k=h.next();!k.done;k=h.next())if(k=k.value,k.video&&!g.has(d(k))&&ym(e,k,!1)&&(!e.audio||!k.audio||zm(e.audio,k.audio,!0))){g.add(d(k));var l=c(k);l>f&&(b=k,f=l)}return b}
function Gm(a,b,c,d){b=r(b);for(var e=b.next(),f={};!e.done;f={Tc:void 0},e=b.next()){e=e.value;var g=a;if(e.language&&(g=Om(g,e.language),!g.length))continue;if(e.role&&(g=Pm(g,e.role),!g.length))continue;if(e.label&&(g=Qm(g,e.label),!g.length))continue;if(e.channelCount&&(g=Rm(g,e.channelCount),!g.length))continue;f.Tc=[];e.codec&&f.Tc.push(e.codec);c&&f.Tc.push(c);d&&f.Tc.push(d);var h=f.Tc.filter(function(m){return function(n,p){return m.Tc.indexOf(n)===p}}(f));if(h.length){f=!1;h=r(h);for(var k=
h.next();!k.done;k=h.next())if(k=k.value,k=Sm(g,k,k!=e.codec),k.length){g=k;f=!0;break}if(!f&&e.codec)continue}if(e.spatialAudio!==void 0)if(e=Tm(g,e.spatialAudio),e.length)g=e;else continue;if(g.length)return g}var l=[];c&&l.push(c);d&&l.push(d);c=l.filter(function(m,n){return l.indexOf(m)===n});if(c.length)for(c=r(c),d=c.next();!d.done;d=c.next())if(d=Sm(a,d.value,!0),d.length){a=d;break}c=a.filter(function(m){return m.primary});return c.length?c:a}
function Om(a,b){b=jc(b);var c=qc(b,a.map(function(d){return pc(d)}));return c?a.filter(function(d){return c==pc(d)}):[]}function Pm(a,b){return a.filter(function(c){return c.audio?b?c.audio.roles.includes(b):c.audio.roles.length==0:!1})}function Hm(a,b){return a.filter(function(c){return c.video?b?c.video.roles.includes(b):c.video.roles.length==0:!1})}function Im(a,b){var c=jc(b);return a.filter(function(d){return d.video&&d.video.language?jc(d.video.language)==c:!1})}
function Qm(a,b){return a.filter(function(c){return c.audio&&c.audio.label?c.audio.label.toLowerCase()==b.toLowerCase():!1})}function Jm(a,b){return a.filter(function(c){return c.video&&c.video.label?c.video.label.toLowerCase()==b.toLowerCase():!1})}function Rm(a,b){return a.filter(function(c){return c.audio&&c.audio.channelsCount&&c.audio.channelsCount>b?!1:!0}).sort(function(c,d){return c.audio||d.audio?c.audio?d.audio?(d.audio.channelsCount||0)-(c.audio.channelsCount||0):1:-1:0})}
function Km(a,b){if(b=="AUTO"){var c=a.some(function(d){return d.video&&d.video.hdr&&d.video.hdr=="HLG"?!0:!1});b=R().fc(c)}return a.filter(function(d){return d.video&&d.video.hdr&&d.video.hdr!=b?!1:!0})}function Lm(a,b){return a.filter(function(c){return c.video&&c.video.videoLayout&&c.video.videoLayout!=b?!1:!0})}function Tm(a,b){return a.filter(function(c){return c.audio&&c.audio.spatialAudio!=b?!1:!0})}
function Sm(a,b,c){var d=c?Ie(b):b;return a.filter(function(e){return e.audio?(c?Ie(e.audio.codecs):e.audio.codecs)==d:!0})}function Mm(a,b){return a.filter(function(c){return c.video&&c.video.codecs!=b?!1:!0})};function Um(){}
function Vm(a,b,c,d,e){var f=e in d,g=new Set(["__proto__","constructor","prototype"]);var h=f?c.constructor==Object&&Object.keys(d).length==0:c.constructor==Object&&Object.keys(c).length==0;for(var k=f||h,l=!0,m=r(Object.keys(b)),n=m.next();!n.done;n=m.next()){n=n.value;var p=e+"."+n,t=f?d[e]:c[n];g.has(n)?(Ta("Invalid config, dangerous key "+p),l=!1):k||n in c?b[n]===void 0?t===void 0||k?delete a[n]:a[n]=id(t):h?a[n]=b[n]:t.constructor==Object&&b[n]&&b[n].constructor==Object?(a[n]||(a[n]=id(t)),
n=Vm(a[n],b[n],t,d,p),l=l&&n):typeof b[n]!=typeof t||b[n]==null||typeof b[n]!="function"&&b[n].constructor!=t.constructor?(Ta("Invalid config, wrong type for "+p),l=!1):typeof c[n]=="function"&&c[n].length!=b[n].length?(Ua("Unexpected number of arguments for "+p),a[n]=b[n]):a[n]=Array.isArray(a[n])?b[n].slice():b[n]:(Ta("Invalid config, unrecognized key "+p),l=!1)}return l}
function Wm(a,b){for(var c={},d=c,e=0,f=0;;){e=a.indexOf(".",e);if(e<0)break;if(e==0||a[e-1]!="\\")f=a.substring(f,e).replace(/\\\./g,"."),d[f]={},d=d[f],f=e+1;e+=1}d[a.substring(f).replace(/\\\./g,".")]=b;return c}function Xm(a,b){return a&&b}
function Ym(a,b){function c(f){for(var g=r(Object.keys(f)),h=g.next();!h.done;h=g.next())h=h.value,f[h]instanceof HTMLElement||(e(f[h])&&Object.keys(f[h]).length===0?delete f[h]:typeof f[h]=="function"?delete f[h]:e(f[h])&&(c(f[h]),Object.keys(f[h]).length===0&&delete f[h]))}function d(f,g){return Object.keys(f).reduce(function(h,k){var l=f[k];if(g.hasOwnProperty(k))if(l instanceof HTMLElement&&g[k]instanceof HTMLElement)l.isEqualNode(g[k])||(h[k]=l);else if(e(l)&&e(g[k])){if(l=d(l,g[k]),Object.keys(l).length>
0||!e(l))h[k]=l}else Array.isArray(l)&&Array.isArray(g[k])?gb(l,g[k])||(h[k]=l):Number.isNaN(l)&&Number.isNaN(g[k])||l!==g[k]&&(h[k]=l);else h[k]=l;return h},{})}function e(f){return f&&typeof f==="object"&&!Array.isArray(f)}a=d(a,b);c(a);return a}I("shaka.util.ConfigUtils",Um);Um.getDifferenceFromConfigObjects=Ym;Um.convertToConfigObject=Wm;Um.mergeConfigObjects=Vm;function Zm(){}
function $m(){var a=Infinity,b=R();navigator.connection&&navigator.connection.saveData&&(a=360);var c={retryParameters:fj(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1,persistentSessionOnlinePlayback:!1,persistentSessionsMetadata:[],keepDrmEngineOnDetach:!1,initDataTransform:function(g,h,k){"apple"===window.shakaMediaKeysPolyfill&&h=="skd"&&(h=k.serverCertificate,k=tm(g),g=um(g,k,h));return g},logLicenseExchange:!1,updateExpirationTime:1,preferredKeySystems:[],keySystemsMapping:{},
parseInbandPsshEnabled:!1,minHdcpVersion:"",ignoreDuplicateInitData:!0,defaultAudioRobustnessForWidevine:"SW_SECURE_CRYPTO",defaultVideoRobustnessForWidevine:"SW_SECURE_DECODE",renewalIntervalSec:0,failureCallback:function(g){return Xm([g])}},d="reload";b.cb("")&&(d="smooth");var e={trackSelectionCallback:function(g){return H(function(h){return h.return(g)})},downloadSizeCallback:function(g){var h;return H(function(k){if(k.i==1)return navigator.storage&&navigator.storage.estimate?k.h(navigator.storage.estimate(),
3):k.return(!0);h=k.j;return k.return(h.usage+g<h.quota*.95)})},progressCallback:function(g,h){return Xm([g,h])},usePersistentLicense:!0,numberOfParallelDownloads:5},f={drm:c,manifest:{retryParameters:fj(),availabilityWindowOverride:NaN,disableAudio:!1,disableVideo:!1,disableText:!1,disableThumbnails:!1,disableIFrames:!1,disableChapters:!1,defaultPresentationDelay:0,segmentRelativeVttTiming:!1,raiseFatalErrorOnManifestUpdateRequestFailure:!1,continueLoadingWhenPaused:!0,ignoreSupplementalCodecs:!1,
updatePeriod:-1,ignoreDrmInfo:!1,enableAudioGroups:!0,dash:{clockSyncUri:"",xlinkFailGracefully:!1,ignoreMinBufferTime:!1,autoCorrectDrift:!0,initialSegmentLimit:1E3,ignoreSuggestedPresentationDelay:!1,ignoreEmptyAdaptationSet:!1,ignoreMaxSegmentDuration:!1,keySystemsByURI:cc(),manifestPreprocessorTXml:an,sequenceMode:!1,useStreamOnceInPeriodFlattening:!1,enableFastSwitching:!0},hls:{ignoreTextStreamFailures:!1,ignoreImageStreamFailures:!1,defaultAudioCodec:"mp4a.40.2",defaultVideoCodec:"avc1.42E01E",
ignoreManifestProgramDateTime:!1,ignoreManifestProgramDateTimeForTypes:[],mediaPlaylistFullMimeType:'video/mp2t; codecs="avc1.42E01E, mp4a.40.2"',liveSegmentsDelay:3,sequenceMode:!1,ignoreManifestTimestampsInSegmentsMode:!1,disableCodecGuessing:!1,disableClosedCaptionsDetection:!1,allowLowLatencyByteRangeOptimization:!0,allowRangeRequestsToGuessMimeType:!1,chaptersUri:""},msf:{fingerprintUri:"",namespaces:[],authorizationToken:"",version:"auto",catalogPreprocessor:bn}},streaming:{retryParameters:fj(),
failureCallback:function(g){return Xm([g])},rebufferingGoal:0,bufferingGoal:10,bufferBehind:30,evictionGoal:1,ignoreTextStreamFailures:!1,startAtSegmentBoundary:!1,gapDetectionThreshold:.5,gapPadding:0,gapJumpTimerTime:.25,durationBackoff:1,safeSeekOffset:5,safeSeekEndOffset:0,stallEnabled:!0,stallThreshold:1,stallSkip:.1,useNativeHlsForFairPlay:!1,inaccurateManifestTolerance:2,lowLatencyMode:!0,preferNativeDash:!1,preferNativeHls:!1,fallbackToNativeHlsOnMseError:!1,updateIntervalSeconds:1,observeQualityChanges:!1,
maxDisabledTime:30,segmentPrefetchLimit:1,prefetchAudioLanguages:[],disableAudioPrefetch:!1,disableTextPrefetch:!1,disableVideoPrefetch:!1,liveSync:{enabled:!1,targetLatency:.5,targetLatencyTolerance:.5,maxPlaybackRate:1.1,minPlaybackRate:.95,panicMode:!1,panicThreshold:60,dynamicTargetLatency:{enabled:!1,stabilityThreshold:60,rebufferIncrement:.5,maxAttempts:10,maxLatency:4,minLatency:1}},allowMediaSourceRecoveries:!0,minTimeBetweenRecoveries:5,vodDynamicPlaybackRate:!1,vodDynamicPlaybackRateLowBufferRate:.95,
vodDynamicPlaybackRateBufferRatio:.5,preloadNextUrlWindow:30,loadTimeout:30,clearDecodingCache:!1,dontChooseCodecs:!1,shouldFixTimestampOffset:!1,avoidEvictionOnQuotaExceededError:!1,crossBoundaryStrategy:"keep",returnToEndOfLiveWindowWhenOutside:!1,stopFetchingOnPause:!1,clampAppendWindowToDuration:!1,processSrcEqualMetadata:!0},networking:{forceHTTP:!1,forceHTTPS:!1,minBytesForProgressEvents:16E3,commonAccessTokenHeaderName:"cta-common-access-token"},mediaSource:{codecSwitchingStrategy:d,addExtraFeaturesToSourceBuffer:function(g){return Xm([g],
"")},forceTransmux:!1,insertFakeEncryptionInInit:!0,correctEc3Enca:!1,modifyCueCallback:function(g,h,k){return Xm([g,h,k])},modifyPreselectionSegmentCallback:function(g){return g},dispatchAllEmsgBoxes:!1,useSourceElements:!0,durationReductionEmitsUpdateEnd:!0,transmuxWorkerUrl:"",repairIFrames:!0},offline:e,abrFactory:function(){return new $f},adaptationSetCriteriaFactory:function(){return new (Function.prototype.bind.apply(Fm,[null].concat(F(Ha.apply(0,arguments)))))},abr:{enabled:!0,useNetworkInformation:!0,
defaultBandwidthEstimate:1E6,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:a,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity,minChannelsCount:0,maxChannelsCount:Infinity},advanced:{minTotalBytes:128E3,minBytes:16E3,fastHalfLife:2,slowHalfLife:5,droppedFramesThreshold:.15,droppedFramesInterval:2,droppedFramesBanDuration:30},restrictToElementSize:!1,restrictToScreenSize:!1,
ignoreDevicePixelRatio:!1,clearBufferSwitch:!1,safeMarginSwitch:0,cacheLoadThreshold:5,minTimeToSwitch:0,preferNetworkInformationBandwidth:!1,droppedFrames:!0,allowAudioFallback:!0},preferredAudio:[{language:"",role:"",label:"",channelCount:2,codec:""}],preferredText:[],preferredVideo:[{label:"",role:"",language:"",codec:"",hdrLevel:"AUTO",layout:""}],preferredDecodingAttributes:[],restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minFrameRate:0,
maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity,minChannelsCount:0,maxChannelsCount:Infinity},playRangeStart:0,playRangeEnd:Infinity,textDisplayer:{fontScaleFactor:1,positionArea:0,fontFamily:"",fontColor:"",fontOpacity:NaN,backgroundColor:"",backgroundOpacity:NaN,characterEdgeStyle:0,subtitleDelay:0,suspendRenderingWhenHidden:!0},textDisplayFactory:function(){return null},cmcd:{enabled:!1,sessionId:"",contentId:"",rtpSafetyFactor:5,useHeaders:!1,includeKeys:[],includeInRequests:[],version:1,
eventTargets:[],applyParametersFromManifest:!0},cmsd:{enabled:!0,applyMaximumSuggestedBitrate:!0,estimatedThroughputWeightRatio:.5},lcevc:{enabled:!1,dynamicPerformanceScaling:!0,logLevel:0,drawLogo:!1,poster:!0},ads:{customPlayheadTracker:!1,skipPlayDetection:!1,supportsMultipleMediaElements:!0,disableHLSInterstitial:!1,disableDASHInterstitial:!1,disableSVTA:!1,allowPreloadOnDomElements:!0,allowStartInMiddleOfInterstitial:!0,disableTrackingEvents:!1,disableSnapback:!1,interstitialPreloadAheadTime:10,
interstitialCooldown:0,disablePlayedLinearAdSkip:!1,disableTrackingForPlayedLinearAds:!1},ignoreHardwareResolution:!1,queue:{preloadNextUrlWindow:Infinity,preloadPrevItem:!0,repeatMode:0,autoPlayNext:!0},accessibility:{handleForcedSubtitlesAutomatically:!0,speechToText:{enabled:!1,maxTextLength:140,processLocally:!1,languagesToTranslate:[]}}};e.trackSelectionCallback=function(g){var h,k;return H(function(l){h=f.preferredAudio.map(function(m){return m.language}).filter(Boolean);k=f.preferredVideo[0]&&
f.preferredVideo[0].hdrLevel||"";return l.return(cn(g,h,k))})};return b.Ta(f)}function dn(){return{streaming:{inaccurateManifestTolerance:0,segmentPrefetchLimit:2,updateIntervalSeconds:.1,maxDisabledTime:1,retryParameters:{baseDelay:100}},manifest:{dash:{autoCorrectDrift:!1},retryParameters:{baseDelay:100}},drm:{retryParameters:{baseDelay:100}}}}
function en(a,b,c){var d={".drm.keySystemsMapping":"",".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:[],audioRobustness:[],sessionType:"",serverCertificate:new Uint8Array(0),serverCertificateUri:"",individualizationServer:"",headers:{}}};return Vm(a,b,c||$m(),d,"")}
function fn(a){var b=a.preferredAudio[0],c=a.preferredVideo[0],d;a.language=(d=b==null?void 0:b.language)!=null?d:"";var e;a.role=(e=b==null?void 0:b.role)!=null?e:"";var f;a.channelCount=(f=b==null?void 0:b.channelCount)!=null?f:2;var g;a.spatialAudio=(g=b==null?void 0:b.spatialAudio)!=null?g:!1;var h;a.audioLabel=(h=b==null?void 0:b.label)!=null?h:"";var k;a.videoRole=(k=c==null?void 0:c.role)!=null?k:"";var l;a.hdrLevel=(l=c==null?void 0:c.hdrLevel)!=null?l:"";var m;a.videoLayout=(m=c==null?void 0:
c.layout)!=null?m:"";var n;a.videoLabel=(n=c==null?void 0:c.label)!=null?n:"";a.preferredAudioCodecs=a.preferredAudio.map(function(t){return t.codec}).filter(Boolean);var p;a.preferredAudioChannelCount=(p=b==null?void 0:b.channelCount)!=null?p:2}
function cn(a,b,c){var d=c;d=="AUTO"&&(c=a.some(function(l){return l.hdr&&l.hdr=="HLG"?!0:!1}),d=R().fc(c));var e=a.filter(function(l){return l.type!="variant"||l.hdr&&l.hdr!=d?!1:!0});c=[];var f=e.map(function(l){return l.language}),g=null;b=r(b);for(var h=b.next();!h.done&&!(g=qc(h.value,f));h=b.next());g&&(c=e.filter(function(l){return jc(l.language)==g}));c.length==0&&(c=e.filter(function(l){return l.primary}));c.length==0&&(e.map(function(l){return l.language}),c=e);var k=c.filter(function(l){return l.height&&
l.height<=480});k.length&&(k.sort(function(l,m){return m.height-l.height}),c=k.filter(function(l){return l.height==k[0].height}));b=[];c.length&&(e=Math.floor(c.length/2),c.sort(function(l,m){return l.bandwidth-m.bandwidth}),b.push(c[e]));a=r(a);for(c=a.next();!c.done;c=a.next())c=c.value,c.type!=wc&&c.type!="image"&&c.type!="chapter"||b.push(c);return b}function an(a){return Xm([a],a)}function bn(a){return Xm([a],a)}I("shaka.util.PlayerConfiguration",Zm);Zm.mergeConfigObjects=en;
Zm.createDefaultForLL=dn;Zm.createDefault=$m;function gn(a){if(a.tagName.split(":").pop()=="Binary")return a=vd(a),a=(a||"").replace(/\s/g,""),!a||a.length%4||!/^[A-Za-z0-9+/]+={0,2}$/.test(a)?null:Nb(a);a=r(a.children);for(var b=a.next();!b.done;b=a.next())if(b=b.value,typeof b!="string"&&(b=gn(b)))return b;return null}var hn=["urn:scte:scte35:2013:xml","urn:scte:scte35:2014:xml+bin","urn:scte:scte35:2013:xml+bin","urn:scte:scte35:2013:bin"];function jn(a){return(new Date(Date.UTC(1900,0,1,0,0,0,0)+a)).getTime()};function kn(){var a=this;this.l=this.h=null;this.C=[];this.i=null;this.Qa=1;this.H=[];this.m={Oe:"",type:"",profiles:[],Rb:null,fb:0,Ya:null,Td:0};this.A=new Map;this.D=new Map;this.G=new Map;this.u=new Map;this.P=new Map;this.ra=[];this.Z=new Map;this.La=new Map;this.o=new El;this.W=0;this.Pa=new Pa(5);this.N=new gf(function(){if(a.K&&!a.h.continueLoadingWhenPaused&&(a.I.mb(a.K,"timeupdate"),a.K.paused)){a.I.Ma(a.K,"timeupdate",function(){return ln(a)});return}ln(a)});this.L=new pj;this.V=null;this.F=
[];this.ia=Infinity;this.Aa=!1;this.j=null;this.O=0;this.$=!1;this.I=new ib;this.K=null;this.U=!1;this.ya="";this.Ga=this.Ra=null;this.za=function(){return!1};this.ea=[];this.qa=new Set;this.ua=new Vi}q=kn.prototype;q.configure=function(a,b){var c=this.l&&a.updatePeriod!=this.h.updatePeriod&&a.updatePeriod>=0;this.h=a;b&&(this.za=b);c&&this.i&&this.i.presentationTimeline.isLive()&&this.N.eb();this.j&&this.j.configure(this.h);this.o&&this.o.Bi(this.h.dash.useStreamOnceInPeriodFlattening)};
q.start=function(a,b){var c=this,d;return H(function(e){if(e.i==1)return c.Aa=b.isLowLatencyMode(),c.C=[a],c.l=b,e.h(mn(c),2);d=e.j;c.l&&nn(c,d);if(!c.l)throw new T(2,7,7001);return e.return(c.i)})};
q.stop=function(){for(var a=r(this.u.values()),b=a.next();!b.done;b=a.next())b=b.value,b.segmentIndex&&b.segmentIndex.release();this.o&&this.o.release();this.h=this.l=null;this.C=[];this.i=null;this.u.clear();this.P.clear();this.ra=[];this.Z.clear();this.A.clear();this.D.clear();this.G.clear();this.m={Oe:"",type:"",profiles:[],Rb:null,fb:0,Ya:null,Td:0};this.o=null;this.N!=null&&(this.N.stop(),this.N=null);this.j&&this.j.destroy();this.I&&(this.I.release(),this.I=null);this.qa.clear();this.ua.release();
return this.L.destroy()};q.update=function(){var a=this,b;return H(function(c){if(c.i==1)return c.o(2),c.h(mn(a),4);if(c.i!=2)return c.u(0);b=c.m();if(!a.l||!b)return c.return();a.l.onError(b);c.l()})};q.onExpirationUpdated=function(){};q.onInitialVariantChosen=function(a){if(this.i&&this.i.presentationTimeline.isLive()){var b=a.video||a.audio;if(b&&b.segmentIndex){a=this.i.presentationTimeline.hc();var c=b.segmentIndex.find(a);c!=null&&(b=b.segmentIndex.get(c))&&(this.W=b.endTime-a,nn(this,0))}}};
q.banLocation=function(a){this.j&&this.j.banLocation(a)};q.setMediaElement=function(a){this.K=a};
function mn(a){var b,c,d,e,f,g,h,k,l,m,n;return H(function(p){if(p.i==1)return b=4,c="MPD",d=on(a),e=a.C,d.length?(e=d.map(function(t){return vj(t,a.Ra)}),c="Patch",b=6):(a.C.length>1&&a.j&&(f=Dl(a.j,"Location",!0),f.length&&(e=f)),a.Ga&&(e=e.map(function(t){return vj(t,a.Ga)}))),g=Cj(e,a.h.retryParameters),h=Date.now(),p.h(pn(a,g,0,{type:b}),2);if(p.i!=3){k=p.j;if(!a.l)return p.return(0);k.uri&&k.uri!=k.originalUri&&!a.C.includes(k.uri)&&a.C.unshift(k.uri);l=new URL(k.uri);a.ya=l.searchParams.toString();
return p.h(qn(a,k.data,k.uri,c),3)}m=Date.now();n=(m-h)/1E3;a.Pa.sample(1,n);a.qa.clear();return p.return(n)})}
function qn(a,b,c,d){var e,f,g,h,k,l,m,n;return H(function(p){switch(p.i){case 1:e=ld(b,d);if(!e)throw new T(2,4,4001,c);f=a.h.dash.manifestPreprocessorTXml;g=an;f!=g&&f(e);if(d==="Patch")return p.return(rn(a,e));h=e;a:{var t=r(ud(h,"Period"));for(var u=t.next();!u.done;u=t.next())if(Ad(u.value,"ImportedMPD")){t=!0;break a}t=!1}if(!t){p.B(2);break}k=Rj(h,c,a.h.retryParameters,a.l.networkingEngine);qj(a.L,k);return p.h(k.promise,3);case 3:h=p.j;case 2:a:{if(h.attributes["xmlns:xlink"]===Yj){t=new Set(["Period",
"AdaptationSet","SegmentList"]);u=new Set(["MPD","Period","AdaptationSet","Representation","SegmentList"]);for(var v=[h];v.length;){var w=v.pop();if(t.has(w.tagName)&&Ed(w,Yj,"href")){t=!0;break a}w=r(td(w));for(var x=w.next();!x.done;x=w.next())x=x.value,u.has(x.tagName)&&v.push(x)}}t=!1}if(!t)return p.return(sn(a,h,c));l=a.h.dash.xlinkFailGracefully;m=Zj(h,a.h.retryParameters,l,c,a.l.networkingEngine);qj(a.L,m);return p.h(m.promise,4);case 4:return n=p.j,p.return(sn(a,n,c))}})}
function sn(a,b,c){var d,e,f,g,h,k,l,m,n,p,t,u,v,w,x,y,z,D,A,B,E,C,G,K,L,N,J,O,M,P,U,Q,da,Z,ka,va,Ea,pa,Aa,Va,Ya,vb,W,uf,wb,Kp,je,Lp,mk,ph,vf,nb,Mp,nk,qh,ok,Np,pk,qk,Ux,rk,wf,Op,Pp,sk,Qp,Rp,Sp,rh,Tp,ke,Up,Vp,Wp,Xp,Yp,Zp;return H(function(Xb){switch(Xb.i){case 1:a.j&&a.j.m.clear();tn(b);d=[c];e=[];f=new Map;g=[];h=ud(b,"Location");k=r(h);for(l=k.next();!l.done;l=k.next())if(m=l.value,n=m.attributes.serviceLocation,p=wd(m))t=rj(d,[p])[0],n&&(g.push({serviceLocation:n,uri:t}),a.j?Cl(a.j,"Location",n,
t):f.set(n,t)),e.push(t);a.j?(u=Dl(a.j,"Location",!0),u.length>0&&(d=a.C=u)):e.length&&(d=a.C=e);a.m.Oe=b.attributes.id||"";a.m.Td=Dd(b,"publishTime",Gd)||0;a.H=ud(b,"PatchLocation");a.Ra=un(a,b,"mpdpatch")||null;a.Ga=un(a,b,"mpd")||null;v=Promise.resolve();if((w=Ad(b,"ContentSteering"))&&a.l){x=w.attributes.defaultServiceLocation;if(a.j)a.j.l=d,a.j.i=x;else if(a.j=new yl(a.l),a.j.configure(a.h),a.j.setManifestType("DASH"),a.j.l=d,a.j.i=x,y=wd(w))y=vj(y,un(a,b,"steering")),(z=Dd(w,"queryBeforeStart",
Od,!1))?v=zl(a.j,y):zl(a.j,y);D=r(f.keys());for(A=D.next();!A.done;A=D.next())B=A.value,E=f.get(B),Cl(a.j,"Location",B,E)}C=ud(b,"BaseURL");G=r(C);for(K=G.next();!K.done;K=G.next())if(L=K.value,N=L.attributes.serviceLocation,J=wd(L),N&&J)for(O=rj(d,[J]),M=r(O),P=M.next();!P.done;P=M.next())U=P.value,g.push({serviceLocation:N,uri:U});Q=!1;if(a.j)for(da=r(C),Z=da.next();!Z.done;Z=da.next())ka=Z.value,va=ka.attributes.serviceLocation,Ea=wd(ka),va&&Ea&&(Cl(a.j,"BaseURL",va,Ea),Q=!0);a.ea.splice(0);Q&&
a.j||(pa=C.map(wd),a.ea.push.apply(a.ea,F(rj(d,pa))));Aa=a.j;Va=a.ea;Ya=vn;vb=Ya.call(kn,Aa,Q,Va);a.m.Ya=vb;W=0;C&&C.length&&(W=Dd(C[0],"availabilityTimeOffset",Md)||0);a.m.fb=W;a.W=Dd(b,"minimumUpdatePeriod",Hd,-1);uf=Dd(b,"availabilityStartTime",Gd);wb=Dd(b,"timeShiftBufferDepth",Hd);Kp=a.h.dash.ignoreSuggestedPresentationDelay;je=null;Kp||(je=Dd(b,"suggestedPresentationDelay",Hd));Lp=a.h.dash.ignoreMaxSegmentDuration;mk=null;Lp||(mk=Dd(b,"maxSegmentDuration",Hd));ph=b.attributes.type||"static";
vf=ph=="static"||ph=="list";a.i&&a.i.presentationTimeline&&(a.U=a.i.presentationTimeline.isLive()&&vf);a.m.type=ph;if(a.i)for(nb=a.i.presentationTimeline,Mp=nb.Ob(),nk=r(a.u.values()),qh=nk.next();!qh.done;qh=nk.next())ok=qh.value,ok.segmentIndex&&ok.segmentIndex.Ua(Mp);else Np=a.h.dash.ignoreMinBufferTime,pk=0,Np||(pk=Dd(b,"minBufferTime",Hd)||0),qk=0,qk=je!=null?Math.min(je,wb||Infinity):a.h.defaultPresentationDelay>0?a.h.defaultPresentationDelay:Math.min(pk*1.5,wb||Infinity),nb=new X(uf,qk,a.h.dash.autoCorrectDrift);
nb.Bg(vf);(Ux=nb.isLive())&&!isNaN(a.h.availabilityWindowOverride)&&(wb=a.h.availabilityWindowOverride);wb==null&&(wb=Infinity);nb.xi(wb);rk=b.attributes.profiles||"";a.m.profiles=rk.split(",");wf={hb:!vf,presentationTimeline:nb,Da:null,aa:null,ha:null,M:null,bandwidth:0,Tf:!1,fb:W,Rb:null,profiles:rk.split(","),roles:null,urlParams:wn,name:""};return Xb.h(v,2);case 2:Op=ak(b);Pp=ck(b);sk=function(Xx){return xn.has(Xx.schemeIdUri)};if(Qp=Op.find(sk)||Pp.find(sk))if(Rp=yn(a,Qp.element))wf.urlParams=
Rp;if(Sp=un(a,b,"segment"))wf.urlParams=Sp;a.O=0;rh=zn(a,wf,vb,b,!1);Tp=rh.duration;ke=rh.periods;(vf&&!a.U||!rh.hh)&&nb.Vb(Tp||Infinity);a.$&&a.Aa&&nb.oi(a.ia);nb.eg(mk||1);a.$&&a.Aa&&(Up=je!=null?je:a.h.defaultPresentationDelay,nb.ri(Up));return Xb.h(An(a),3);case 3:if(!a.l)return Xb.return();if(!a.i)return Xb.h(a.o.Cf(ke,wf.hb),7);a.i.periodCount=ke.length;a.i.gapCount=a.O;a.i.serviceDescription=fl(b,g);return Xb.h(Bn(a,ke,!1),5);case 7:a.i={presentationTimeline:nb,variants:a.o.m,textStreams:a.o.Rf(),
imageStreams:a.o.j,chapterStreams:[],offlineSessionIds:[],sequenceMode:a.h.dash.sequenceMode,ignoreManifestTimestampsInSegmentsMode:!1,type:"DASH",serviceDescription:fl(b,g),nextUrl:Cn(a,b),periodCount:ke.length,gapCount:a.O,isLowLatency:a.$,startTime:null};if(!nb.Oi()){Xb.B(8);break}Vp=ud(b,"UTCTiming");return Xb.h(Dn(a,vb,Vp),9);case 9:Wp=Xb.j;if(!a.l)return Xb.return();nb.pi(Wp);case 8:if(nb.Mh(),a.o&&!a.i.presentationTimeline.isLive()&&a.o.release(),Xp=Ad(b,"ProgramInformation"))Yp=(new Map).set("detail",
Xp),Zp=new nj("programinformation",Yp),a.l.onEvent(Zp);case 5:a.l.makeTextStreamsForClosedCaptions(a.i),En(a),Fn(a,ke),Xb.l()}})}function Bn(a,b,c){var d;return H(function(e){if(e.i==1)return e.h(a.o.Cf(b,!0,c),2);a.i.variants=a.o.m;d=a.o.Rf();d.length>0&&(a.i.textStreams=d);a.i.imageStreams=a.o.j;a.l.filter(a.i);e.l()})}
function rn(a,b){var c,d,e,f,g,h,k,l,m,n,p,t,u,v,w,x,y,z,D,A,B,E,C,G,K,L,N;return H(function(J){if(J.i==1){c=b.attributes.mpdId;d=Dd(b,"originalPublishTime",Gd);if(!c||c!==a.m.Oe||d!==a.m.Td)throw a.H=[],new T(1,4,4052);e=[];f=[];g=new Set;h=r(td(b));for(k=h.next();!k.done;k=h.next())if(l=k.value,m=Qd(l.attributes.sel||""),n=m[m.length-1],p=wd(l)||"",n.name==="MPD")if(n.Wb==="mediaPresentationDuration"){t=wd(l)||"";var O=Hd(t);if(O!=null){a.m.Rb=O;for(var M=r(a.A.values()),P=M.next();!P.done;P=M.next())P.value.Rb=
O}}else if(n.Wb==="type"){a.i.presentationTimeline.Bg(p=="static");a.m.type=p;O=r(a.A.values());for(M=O.next();!M.done;M=O.next())M.value.hb=p=="dynamic";p=="static"&&(a.W=-1)}else n.Wb==="publishTime"?a.m.Td=Gd(p)||0:n.Wb===null&&l.tagName==="add"&&f.push(l);else if(n.name==="PatchLocation")Rd(a.H,l);else if(n.name==="Period")l.tagName==="add"?f.push(l):l.tagName==="remove"&&n.id&&Gn(a,n.id);else if(n.name==="SegmentTemplate"){M=Qd(l.attributes.sel||"");O=M[M.length-1];if(O.Wb){M=Hn(a,M);P=wd(l)||
"";for(var U=r(M),Q=U.next();!Q.done;Q=U.next())Q=a.A.get(Q.value),Td(Q.M.tc,l.tagName,O.Wb,P);O=M}else O=[];u=O;v=r(u);for(w=v.next();!w.done;w=v.next())x=w.value,g.add(x)}else if(n.name==="SegmentTimeline"||n.name==="S"){O=Qd(l.attributes.sel||"");O=Hn(a,O);M=r(O);for(P=M.next();!P.done;P=M.next())P=a.A.get(P.value),P=Oj(P,Wk,"SegmentTimeline"),U=ud(P,"S"),Rd(U,l),P.children=U;y=O;z=r(y);for(D=z.next();!D.done;D=z.next())A=D.value,g.add(A)}B=r(g);for(E=B.next();!E.done;E=B.next())C=E.value,In(a,
C);G=r(f);for(K=G.next();!K.done;K=G.next())L=K.value,e.push.apply(e,F(zn(a,{hb:a.m.type=="dynamic",presentationTimeline:a.i.presentationTimeline,Da:null,aa:null,ha:null,M:null,bandwidth:0,Tf:!1,fb:a.m.fb,profiles:a.m.profiles,Rb:a.m.Rb,roles:null,urlParams:wn,name:""},a.m.Ya,L,!0).periods));if(!e.length)return J.B(2);a.i.periodCount+=e.length;a.i.gapCount=a.O;return J.h(An(a),3)}if(J.i!=2)return a.l?J.h(Bn(a,e,!0),2):J.return();a.m.type=="static"&&(N=a.m.Rb,a.i.presentationTimeline.Vb(N||Infinity));
J.l()})}function Gn(a,b){a.i.periodCount--;for(var c=r(a.A.keys()),d=c.next();!d.done;d=c.next())if(d=d.value,d.startsWith(b)){var e=a.A.get(d);Oj(e,Wk,"SegmentTimeline").children=[];In(a,d);a.A.delete(d)}a.F=a.F.filter(function(f){return f!==b});a.G.delete(b)}
function Hn(a,b){var c="",d="",e=-1,f="";b=r(b);for(var g=b.next();!g.done;g=b.next())g=g.value,g.name==="Period"?c=g.id:g.name==="AdaptationSet"?(d=g.id,g.position!==null&&(e=g.position)):g.name==="Representation"&&(f=g.id);b=[];if(f)b.push(c+","+f);else if(d)for(e=r(a.A.values()),a=e.next();!a.done;a=e.next())a=a.value,a.Da.id===c&&a.ha.id===d&&a.M.id&&b.push(c+","+a.M.id);else if(e>-1)for(d=r(a.A.values()),a=d.next();!a.done;a=d.next())a=a.value,a.Da.id===c&&a.ha.position===e&&a.M.id&&b.push(c+
","+a.M.id);return b}function In(a,b){var c=a.A.get(b),d=a.u.get(b);d.segmentIndex&&d.segmentIndex.Ua(a.i.presentationTimeline.Ob());try{var e=Vk(c,function(f,g,h,k){return Jn(a,f,g,h,k)},a.u,!0,a.h.dash.initialSegmentLimit,a.La,c.M.aesKey,null,!0,a.D);d.createSegmentIndex=function(){return H(function(f){if(f.i==1)return d.segmentIndex?f.B(0):f.h(e.xc(),3);d.segmentIndex=f.j;f.l()})}}catch(f){if(b=c.M.contentType,b!=wc&&b!="application"&&b!="image"||f.code!=4002)throw f;}}
function tn(a){var b=ak(a);if(b.length){a=new Map;var c=0;b=r(b);for(var d=b.next();!d.done;d=b.next()){d=d.value;var e=d.id!=null?"id:"+d.id:"no-id:"+c++;a.getOrInsert(e,[]).push(d)}a=r(a.values());for(c=a.next();!c.done;c=a.next())if(c=c.value,!c.some(function(f){return Kn.has(f.schemeIdUri)}))throw new T(2,4,4063,c.map(function(f){return f.schemeIdUri}));}}function Cn(a,b){var c=ck(b);return(c=dk(c,"urn:mpeg:dash:chaining:2016"))&&c.value?vj(c.value,un(a,b,"chaining")):null}
function zn(a,b,c,d,e){var f=b.Rb;f||(f=Dd(d,"mediaPresentationDuration",Hd),a.m.Rb=f);var g=0;a.i&&a.i.presentationTimeline&&a.U&&(g=a.i.presentationTimeline.yb());var h=[],k=g;d=ud(d,"Period");var l=b.hb;l||a.G.clear();for(var m=0,n=l&&!e?new Set(a.F.slice(1,-1)):null,p=0;p<d.length;p++){var t=d[p],u=d[p+1],v=Dd(t,"start",Hd,null),w=t.attributes.id,x=Dd(t,"duration",Hd);p==0&&a.U&&(m=g-(v||0));v==null?v=k:a.U&&(v+=m);var y=null;if(u){var z=Dd(u,"start",Hd);z!=null&&(y=z-v+g)}else f!=null&&(y=f-
v+g);z=Bc;y&&x&&Math.abs(y-x)>z&&y>x&&a.O++;y==null&&(y=x);if(!(a.V!==null&&w!=null&&v!==null&&v<a.V)||a.F.includes(w)||p+1==d.length){v!==null&&(a.V===null||v>a.V)&&(a.V=v);k={start:v,duration:y,node:t,He:y==null||!u};t=null;u=p>0&&p<d.length-1;l&&n&&u&&!e&&(w!=null||(w="__shaka_period_"+v),n.has(w)&&(w=a.G.get(w))&&(t=w));t||(t=Ln(a,b,c,k),l&&t.id&&a.G.set(t.id,t));h.push(t);t.id&&y&&a.La.set(t.id,y);if(y==null){k=null;break}k=v+y}}l&&!e&&Mn(a,h);if(e)for(b=r(h),c=b.next();!c.done;c=b.next())c=
c.value.id,a.F.includes(c)||a.F.push(c);else a.F=h.map(function(D){return D.id});return f!=null?{periods:h,duration:f+g,hh:!1}:{periods:h,duration:k,hh:!0}}function Mn(a,b){b=new Set(b.map(function(e){return e.id}));for(var c=r(Array.from(a.G.keys())),d=c.next();!d.done;d=c.next())d=d.value,b.has(d)||a.G.delete(d)}
function En(a){var b=Array.from(a.P.keys()).filter(function(h){return!a.F.includes(h)});b=r(b);for(var c=b.next();!c.done;c=b.next()){c=c.value;for(var d=!0,e=r(a.P.get(c)),f=e.next();!f.done;f=e.next()){f=f.value;var g=a.u.get(f);g&&(g.segmentIndex&&g.segmentIndex.getNumReferences()!=0?d=!1:(a.o&&a.o.dh(g,c),a.u.delete(f)))}d&&a.P.delete(c)}}function Fn(a,b){b=new Set(b.map(function(e){return e.id}));for(var c=r(a.D.keys()),d=c.next();!d.done;d=c.next())d=d.value,b.has(d)||a.D.delete(d)}
function Ln(a,b,c,d){b.Da=Nn(a,d.node,null,c);b.aa=d;b.Da.fb=b.fb;b.Da.id||(b.Da.id="__shaka_period_"+d.start);var e=ud(d.node,"EventStream");c=b.presentationTimeline.Ob();e=r(e);for(var f=e.next();!f.done;f=e.next())On(a,d.start,d.duration,f.value,c);c=ck(d.node);c=r(c);for(e=c.next();!e.done;e=c.next())if(e=e.value,xn.has(e.schemeIdUri)&&(e=yn(a,e.element)))b.urlParams=e;if(c=un(a,d.node,"segment"))b.urlParams=c;var g=ud(d.node,"AdaptationSet").map(function(p,t){return Pn(a,b,t,p)}).filter(kf);
if(b.hb){c=new Set;for(f=e=0;f<g.length;f++)for(var h=g[f].Nk,k=0;k<h.length;k++)c.add(h[k]),e++;if(e!=c.size)throw new T(2,4,4018);}var l=new Map;c=r(g);for(e=c.next();!e.done;e=c.next())for(e=r(e.value.jj),f=e.next();!f.done;f=e.next())h=r(f.value),f=h.next().value,h=h.next().value,l.set(f,h);if(l.size){c=new Map;for(e=0;e<g.length;e++)for(f=g[e].streams,h=0;h<f.length;h++)l.has(f[h].originalId)&&(c.has(e)||c.set(e,[]),c.get(e).push(f[h].originalId));if(c.size){var m=ud(d.node,"AdaptationSet");
e=b.name;b.name="dependencyStream";c.forEach(function(p,t){var u=m[t];if(u&&(u=Pn(a,b,t,u))){for(var v=[],w={},x=0;x<p.length;w={Zh:void 0},x++)if(w.Zh=p[x],w=u.streams.find(function(z){return function(D){return D.originalId==z.Zh}}(w))){var y=l.get(w.originalId||"");w.dependencyStream=y;w.originalId+=y.originalId;w.baseOriginalId=y.baseOriginalId;v.push(w)}v.length&&g[t].streams.push.apply(g[t].streams,F(v))}});b.name=e}}g=Qn(a,b,d,g);d=r(eb(g,function(p){return!!p.Ig}));c=d.next().value;d=d.next().value;
e=r(c);for(f=e.next();!f.done;f=e.next())for(f=r(f.value.streams),h=f.next();!h.done;h=f.next())h.value.isIframe=!0;if(!a.h.disableIFrames)for(c=r(c),e=c.next();!e.done;e=c.next())for(e=e.value,f=e.Ig.split(" "),h=r(d),k=h.next();!k.done;k=h.next())if(k=k.value,f.includes(k.id)){k=r(k.streams);for(var n=k.next();!n.done;n=k.next())Xf(n.value,e.streams)}c=Rn(a.h.disableAudio,d,"audio");e=Rn(a.h.disableVideo,d,"video");f=Rn(a.h.disableText,d,wc);d=Rn(a.h.disableThumbnails,d,"image");if(e.length===0&&
c.length===0)throw new T(2,4,4004);return{id:b.Da.id,audioStreams:c,videoStreams:e,textStreams:f,imageStreams:d}}function Rn(a,b,c){return a||!b.length?[]:b.reduce(function(d,e){if(e.contentType!=c)return d;d.push.apply(d,F(e.streams));return d},[])}
function Qn(a,b,c,d){c=c.node;for(var e=[],f=r(ud(c,"Preselection")),g=f.next();!g.done;g=f.next()){g=g.value;var h=g.attributes.preselectionComponents;h&&e.push({id:g.attributes.id||"1",tag:g.attributes.tag||null,Fd:h.trim().split(/\s+/),node:g})}f=r(d);for(g=f.next();!g.done;g=f.next())for(g=r(g.value.lg),h=g.next();!h.done;h=g.next())h=h.value,h.Fd.length&&e.push({id:h.tag||"1",tag:h.tag,Fd:h.Fd,node:null});if(!e.length&&!d.some(function(u){return u.lg.length}))return d;c=ud(c,"AdaptationSet");
var k=new Set,l=new Map;e=r(e);f=e.next();for(g={};!f.done;g={Kb:void 0},f=e.next())if(f=f.value,h=[].concat(F(new Set(f.Fd))).map(function(u){return d.find(function(v){return v.id==u})}),!h.some(function(u){return!u})&&h.length==1&&(g.Kb=h[0],!g.Kb.Ig&&g.Kb.contentType=="audio"))if(k.add(g.Kb.id),h=f.node){var m=c.findIndex(function(u){return function(v){return v.attributes.id==u.Kb.id}}(g));if(!(m<0)){var n=b.name;b.name="preselection_"+f.id;m=Pn(a,b,m,c[m]);b.name=n;if(m){n=r(m.streams);for(var p=
n.next();!p.done;p=n.next())Sn(p.value,f.id,h);if(l.has(g.Kb.id)){var t;(t=l.get(g.Kb.id)).push.apply(t,F(m.streams))}else l.set(g.Kb.id,m.streams)}}}else for(g=r(g.Kb.streams),h=g.next();!h.done;h=g.next())h=h.value,h.preselection||(h.preselection={id:f.id,tag:f.tag});return d.filter(function(u){var v=l.get(u.id),w=u.lg.some(function(x){return x.mj});return v?(u.streams=w?v:u.streams.concat(v),!0):w&&!k.has(u.id)?!1:!0})}
function Sn(a,b,c){a.preselection={id:b,tag:c.attributes.tag||null};b="_preselection_"+b;a.originalId&&a.originalId.endsWith(b)||(a.originalId=(a.originalId||"")+b);a.groupId&&!a.groupId.endsWith(b)&&(a.groupId+=b);if(b=c.attributes.lang)a.language=jc(b),a.originalLanguage=b;if(b=c.attributes.codecs)a.codecs=b,a.fullMimeTypes=new Set([De(a.mimeType,b)]);if(b=Tn(c))a.label=b;if(b=Un(ud(c,"AudioChannelConfiguration")))a.channelsCount=b;b=Vn(c);b.yg.length&&(a.roles=b.yg,a.primary=b.Yf);c=r(ud(c,"Accessibility"));
for(b=c.next();!b.done;b=c.next())if(b=b.value,b.attributes.schemeIdUri=="urn:tva:metadata:cs:AudioPurposeCS:2007"&&(b=Wn(b.attributes.value)))a.accessibilityPurpose=b}
function Pn(a,b,c,d){function e(J,O){var M=null,P=[];if(J){var U=J.lastIndexOf(",");U>=0&&(M=J.substring(0,U).trim(),P=J.substring(U+1).trim().split(/\s+/).filter(function(Q){return Q.length>0}))}x.push({tag:M,Fd:P,mj:O})}function f(J){var O=J.attributes["dvb:fontFamily"];J=J.attributes["dvb:url"];O&&J&&(J=rj(b.ha.Ya(),[J],b.urlParams()),a.l.addFont(O,J[0]))}function g(J){switch(J){case 1:case 5:case 6:case 7:return"srgb";case 9:return"rec2020";case 11:case 12:return"p3"}}function h(J){switch(J){case 1:case 6:case 13:case 14:case 15:return"SDR";
case 16:return"PQ";case 18:return"HLG"}}b.ha=Nn(a,d,b.Da,null);b.ha.position=c;c=Vn(d);var k=c.Yf,l=c.yg,m=c.kind,n=b.ha.contentType==wc;n&&m===void 0&&(m="subtitle");var p=ak(d),t=ck(d);c=null;var u=!1,v=null,w=!1,x=[];p=r(p);for(var y=p.next();!y.done;y=p.next()){y=y.value;var z=y.schemeIdUri;if(Kn.has(z))if(z=="http://dashif.org/guidelines/trickmode")c=y.value;else if(z=="urn:mpeg:mpegB:cicp:TransferCharacteristics")var D=h(parseInt(y.value,10));else if(z=="urn:mpeg:mpegB:cicp:ColourPrimaries")var A=
g(parseInt(y.value,10));else z=="urn:mpeg:dash:ssr:2023"?a.h.dash.enableFastSwitching?u=!0:w=!0:z=="urn:dvb:dash:fontdownload:2014"?f(y.element):z=="urn:mpeg:dash:preselection:2016"?e(y.value,!0):xn.has(z)&&((v=yn(a,y.element))||(w=!0));else w=!0}if(w)return null;var B=null;t=r(t);for(w=t.next();!w.done;w=t.next())w=w.value,p=w.schemeIdUri,p=="http://dashif.org/guidelines/last-segment-number"?B=parseInt(w.value,10)-1:p=="urn:mpeg:mpegB:cicp:TransferCharacteristics"?D=h(parseInt(w.value,10)):p=="urn:mpeg:mpegB:cicp:ColourPrimaries"?
A=g(parseInt(w.value,10)):p=="urn:dvb:dash:fontdownload:2014"?f(w.element):p=="urn:mpeg:dash:preselection:2016"?e(w.value,!1):xn.has(p)&&(v=yn(a,w.element));(t=un(a,d,"segment"))&&(v=t);v&&(b.urlParams=v);v=ud(d,"Accessibility");var E=new Map,C;v=r(v);for(t=v.next();!t.done;t=v.next())(w=t.value,t=w.attributes.schemeIdUri,w=w.attributes.value,t!="urn:scte:dash:cc:cea-608:2015"||a.h.disableText)?t!="urn:scte:dash:cc:cea-708:2015"||a.h.disableText?t=="urn:mpeg:dash:role:2011"?w!=null&&(l.push(w),w==
"captions"&&(m="caption")):t=="urn:tva:metadata:cs:AudioPurposeCS:2007"&&(t=Wn(w))&&(C=t):yc(w,E):xc(w,E);v=ud(d,"ContentProtection");var G=Wi(a.ua,v,a.h.ignoreDrmInfo,a.h.dash.keySystemsByURI);b.ha.encrypted=v.length>0;var K=jc(b.ha.language||"und"),L=b.ha.label,N=new Map;d=ud(d,"Representation");if(!a.h.ignoreSupplementalCodecs){v=[];t=r(d);for(w=t.next();!w.done;w=t.next())if(p=w.value,w=Ed(p,"urn:scte:dash:scte214-extensions","supplementalCodecs"))p=id(p),p.attributes.codecs=w.split(" ").join(","),
p.attributes.id&&(p.attributes.supplementalId=p.attributes.id+"_supplementalCodecs"),v.push(p);d.push.apply(d,F(v))}v=d.map(function(J){var O=Xn(a,b,G,m,K,L,k,l,E,J,C,B);return O&&(O.hdr=O.hdr||D,O.colorGamut=O.colorGamut||A,O.fastSwitching=u,J=J.attributes.dependencyId)?(O.baseOriginalId=J,N.set(J,O),null):O}).filter(function(J){return!!J});if(v.length==0&&N.size==0){c=b.ha.contentType=="image";if(a.h.dash.ignoreEmptyAdaptationSet||n||c)return null;throw new T(2,4,4003);}if(!b.ha.contentType||b.ha.contentType==
"application")for(b.ha.contentType=Yn(v[0].mimeType,v[0].codecs),n=r(v),t=n.next();!t.done;t=n.next())t.value.type=b.ha.contentType;n=b.ha.id||"__fake__"+a.Qa++;t=r(v);for(w=t.next();!w.done;w=t.next()){w=w.value;p=r(G.drmInfos);for(y=p.next();!y.done;y=p.next())y=y.value,y.keyIds=y.keyIds&&w.keyIds?new Set([].concat(F(y.keyIds),F(w.keyIds))):y.keyIds||w.keyIds;a.h.enableAudioGroups&&(w.groupId=n)}d=d.map(function(J){return J.attributes.supplementalId||J.attributes.id}).filter(kf);return{id:n,contentType:b.ha.contentType,
language:K,Yf:k,streams:v,drmInfos:G.drmInfos,Ig:c,Nk:d,jj:N,lg:x}}function yn(a,b){return(b=Bd(b,"urn:mpeg:dash:schema:urlparam:2014","UrlQueryInfo")||Bd(b,"urn:mpeg:dash:schema:urlparam:2016","ExtUrlQueryInfo"))?Zn(a,b):null}function un(a,b,c){var d;b=r(ud(b,"RequestParam"));for(var e=b.next();!e.done;e=b.next()){e=e.value;var f=(e.attributes.includeInRequests||"segment").split(/\s+/);(f.includes(c)||f.includes("*"))&&(e=Zn(a,e))&&(d=e)}return d}
function Zn(a,b){var c=Dd(b,"useMPDUrlQuery",Od,!1),d=Jb(b.attributes.queryString||""),e=Jb(b.attributes.queryTemplate||"");return e&&(c||d)?function(){var f=[];c&&a.ya&&f.push(a.ya);d&&f.push(d);var g=f.join("&");if(e=="$querypart$")return g;var h;return e.split("&").map(function(k){if(k=="$querypart$")return g;var l=/\$query:(.*?)\$/.exec(k);return l?(k=l[1],h||(h=new URLSearchParams(g)),(l=h.get(k))?k+"="+l:""):k.replace(/\$\$|\$[^$]+\$/g,function(m){return m==="$$"?"$":""})}).filter(Boolean).join("&")}:
null}
function Xn(a,b,c,d,e,f,g,h,k,l,m,n){function p(da){return xn.has(da.schemeIdUri)}var t=b.Da.id;b.M=Nn(a,l,b.ha,null);var u=b.M.id;a.ia=Math.min(a.ia,b.M.fb);a.$=a.ia>0;if(!$n(b.M))return null;var v=b.aa.start;b.bandwidth=Dd(l,"bandwidth",Kd)||0;b.roles=h;var w=ak(l),x=ck(l),y=ud(l,"ContentProtection"),z=null,D=w.find(p)||x.find(p);D&&(z=yn(a,D.element));(l=un(a,l,"segment"))&&(z=l);z&&(b.urlParams=z);l=b.M.contentType;z=l==wc||l=="application";l=l=="image";y.length&&(b.ha.encrypted=!0);try{var A=void 0;
if(c.yf){var B=b.M.Ya,E=b.urlParams,C=rj(B(),[c.yf.jk],E()),G=Cj(C,a.h.retryParameters);A={bitsKey:128,blockCipherMode:"CBC",iv:c.yf.iv,firstMediaSequenceNumber:0,fetchKey:function(){var da,Z,ka;return H(function(va){if(va.i==1)return va.h(pn(a,G,6),2);if(va.i!=3){da=va.j;if(!da.data||da.data.byteLength!=16)throw new T(2,4,4049);Z={name:"AES-CBC"};ka=A;return va.h(window.crypto.subtle.importKey("raw",da.data,Z,!0,["decrypt"]),3)}ka.cryptoKey=va.j;A.fetchKey=void 0;va.l()})}}}b.M.aesKey=A;B=function(da,
Z,ka,va){return Jn(a,da,Z,ka,va)};if(b.M.md)var K=Kk(b,B,A);else if(b.M.Ub)K=Qk(b,a.u,A);else if(b.M.tc)K=Vk(b,B,a.u,!!a.i,a.h.dash.initialSegmentLimit,a.La,A,n,!1,a.D);else{var L=b.aa.duration||0,N=b.M.Ya,J=b.M.mimeType,O=b.M.codecs;K={endTime:-1,timeline:-1,xc:function(){var da=Ek(v,L,N());da.cc(function(Z){Z.mimeType=J;Z.codecs=O});return Promise.resolve(da)},timescale:1,initSegmentReference:null}}}catch(da){if((z||l)&&da.code==4002)return null;throw da;}n=$i(a.ua,y,c,a.h.ignoreDrmInfo,a.h.dash.keySystemsByURI);
n=new Set(n?[n]:[]);y=dk(x,"tag:dolby.com,2018:dash:EC3_ExtensionType:2018","JOC")!=null;x=dk(x,"tag:dolby.com,2016:dash:virtualized_content:2016","1")!=null;x=y||x;y=!1;z&&(y=h.includes("forced_subtitle")||h.includes("forced-subtitle"));h.length||d!=="subtitle"||h.push("subtitle");if(l){var M=["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"];if(w=w.find(function(da){return M.includes(da.schemeIdUri)}))var P=w.value;if(!P)return null}var U;w=b.M.codecs;b.profiles.includes("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&
(w.includes("hvc1.2.4.L153.B0")||w.includes("hev1.2.4.L153.B0"))&&(U="PQ");(z=u?t+","+u:"")&&b.name&&(z+=b.name);a.H.length&&z&&a.A.set(z,ao(b));b.M.We&&bo(a,b.M.We,K,b.presentationTimeline);K.endTime!=-1&&t!=null&&u!=null&&((l=a.D.get(t))?(l.endTime=K.endTime,l.rg.includes(u)||l.rg.push(u),a.D.set(t,l)):a.D.set(t,{endTime:K.endTime,timeline:K.timeline,rg:[u]}));var Q=z&&a.u.has(z)?a.u.get(z):{id:a.Qa++,originalId:u,groupId:null,createSegmentIndex:function(){return Promise.resolve()},closeSegmentIndex:function(){Q.segmentIndex&&
(Q.segmentIndex.release(),Q.segmentIndex=null)},segmentIndex:null,mimeType:b.M.mimeType,codecs:w,supplementalCodecs:b.M.supplementalCodecs,frameRate:b.M.frameRate,pixelAspectRatio:b.M.pixelAspectRatio,bandwidth:b.bandwidth,width:b.M.width,height:b.M.height,kind:d,encrypted:c.drmInfos.length>0,drmInfos:c.drmInfos,keyIds:n,language:e,originalLanguage:b.ha.language,label:f,type:b.ha.contentType,primary:g,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:b.M.emsgSchemeIdUris,roles:h,forced:y,
channelsCount:b.M.Se,audioSamplingRate:b.M.audioSamplingRate,spatialAudio:x,closedCaptions:k,hdr:U,colorGamut:void 0,videoLayout:void 0,tilesLayout:P,accessibilityPurpose:m,external:!1,fastSwitching:!1,fullMimeTypes:new Set([De(b.M.mimeType,b.M.codecs)]),isAudioMuxedInVideo:!1,baseOriginalId:null,isIframe:!1,preselection:null};Q.createSegmentIndex=function(){var da;return H(function(Z){if(Z.i==1){if(Q.segmentIndex)return Z.B(0);da=Q;return Z.h(K.xc(),3)}da.segmentIndex=Z.j;Z.l()})};z&&b.hb&&!a.u.has(z)&&
(a.u.set(z,Q),a.P.getOrInsertComputed(t||"",function(){return[]}).push(z));(b=K.initSegmentReference)&&(!Q.encrypted||Q.keyIds.size||Q.type!="audio"&&Q.type!="video"?0:Q.mimeType.includes("mp4"))&&a.ra.push({stream:Q,initSegmentReference:b});return Q}
function An(a){var b;return H(function(c){b=a.ra;a.ra=[];return b.length?c.h(Promise.all(b.map(function(d){var e,f,g,h,k,l,m,n;return H(function(p){if(p.i==1)return p.h(co(a,d.initSegmentReference),2);e=p.j;if(!e)return p.return();eo(d.stream,e);if(a.i)for(f=r(a.i.variants),g=f.next();!g.done;g=f.next())for(h=g.value,k=Wf(h),l=r(k),m=l.next();!m.done;m=l.next())n=m.value,n.id==d.stream.id&&eo(n,e);p.l()})})),0):c.return()})}
function eo(a,b){a.keyIds.add(b);a=r(a.drmInfos);for(var c=a.next();!c.done;c=a.next())c.value.keyIds.add(b)}function co(a,b){var c=b.Oa().join("")+"-"+b.jc()+"-"+b.ec(),d=a.Z.get(c);if(d)return d;b=fo(a,b).catch(function(){a.Z.delete(c);return null});a.Z.set(c,b);return b}
function fo(a,b){var c,d;return H(function(e){switch(e.i){case 1:return e.h(Jn(a,b.Oa(),b.jc(),b.ec(),!0),2);case 2:c=e.j;if(!b.aesKey){e.B(3);break}return e.h(ul(c,b.aesKey,0),4);case 4:c=e.j;case 3:return d=tl(c),d=="00000000000000000000000000000000"?e.return(null):e.return(d)}})}
function bo(a,b,c,d){if(!a.qa.has(b)){a.qa.add(b);var e=Dd(b,"presentationTime",Ld)||0,f=Ad(b,"UTCTiming"),g;if(g=f&&f.attributes.schemeIdUri)f=f.attributes.schemeIdUri,g=!(f==="urn:mpeg:dash:utc:http-ntp:2014"||f==="urn:mpeg:dash:utc:ntp:2014"||f==="urn:mpeg:dash:utc:sntp:2014");g?b=(Dd(b,"wallClockTime",Gd)||0)*1E3:(b=Dd(b,"wallClockTime",Ld)||0,b=jn(b));c=new Date(b-e/c.timescale*1E3);e=c.getTime()/1E3;isNaN(e)||(d.A||d.ti(e),d=(new Map).set("detail",{wallClockTime:b,programStartDate:c}),d=new nj("prft",
d),a.l.onEvent(d))}}function ao(a){function b(c){if(!c)return null;c=jd(c);c.md=null;c.Ub=null;c.tc=Ud(c.tc);c.We=null;return c}a=jd(a);a.Da=b(a.Da);a.ha=b(a.ha);a.M=b(a.M);a.aa&&(a.aa=jd(a.aa),a.aa.node=null);return a}
function ln(a){var b,c;return H(function(d){switch(d.i){case 1:return b=0,d.o(2),d.h(mn(a),4);case 4:b=d.j;d.u(3);break;case 2:if(c=d.m(),a.l){if(a.h.raiseFatalErrorOnManifestUpdateRequestFailure)return a.l.onError(c),d.return();c.severity=1;a.l.onError(c)}case 3:if(!a.l)return d.return();a.l.onManifestUpdated();nn(a,b);d.l()}})}function nn(a,b){if(!(a.W<0)){var c=a.W;a.h.updatePeriod>=0&&(c=a.h.updatePeriod);a.N.ka(Math.max(c-b,Qa(a.Pa)))}}
function Nn(a,b,c,d){c=c||{contentType:"",mimeType:"",codecs:"",supplementalCodecs:"",emsgSchemeIdUris:[],frameRate:void 0,pixelAspectRatio:void 0,Se:null,audioSamplingRate:null,fb:0,cf:1,encrypted:!1};d=d||c.Ya;var e=b.attributes.id,f=b.attributes.supplementalId,g=ud(b,"BaseURL"),h,k=!1;if(a.j)for(var l=r(g),m=l.next();!m.done;m=l.next()){var n=m.value;m=n.attributes.serviceLocation;n=wd(n);m&&n&&(Cl(a.j,e,m,n),k=!0)}k&&a.j||(h=g.map(wd));var p=a.j;a=b.attributes.contentType||c.contentType;l=b.attributes.mimeType||
c.mimeType;m=rl([b.attributes.codecs||c.codecs]).join(",");n=[Ed(b,"urn:scte:dash:scte214-extensions","supplementalCodecs")||c.supplementalCodecs];n=rl(n).join(",");var t=Dd(b,"frameRate",Pd)||c.frameRate,u=b.attributes.sar||c.pixelAspectRatio,v=go(ud(b,"InbandEventStream"),c.emsgSchemeIdUris),w=ud(b,"AudioChannelConfiguration");w=Un(w)||c.Se;var x=Dd(b,"audioSamplingRate",Ld)||c.audioSamplingRate;a||(a=Yn(l,m));var y=Ad(b,"SegmentBase"),z=Ad(b,"SegmentTemplate"),D=y?Dd(y,"availabilityTimeOffset",
Md)||0:0,A=z?Dd(z,"availabilityTimeOffset",Md)||0:0,B=g&&g.length?Dd(g[0],"availabilityTimeOffset",Md)||0:0;D=c.fb+B+D+A;A=null;(B=Ad(b,"SegmentSequenceProperties"))&&(B=Dd(B,"cadence",Kd))&&(A=B);B=Tn(b);return{Ya:function(){return rj(d(),g.length?p&&k?Dl(p,e):h?h:[]:[])},md:y||c.md,Ub:Ad(b,"SegmentList")||c.Ub,tc:z||c.tc,We:Ad(b,"ProducerReferenceTime")||c.We,width:Dd(b,"width",Ld)||c.width,height:Dd(b,"height",Ld)||c.height,contentType:a,mimeType:l,codecs:m,supplementalCodecs:n.split(" ").join(","),
frameRate:t,pixelAspectRatio:u,emsgSchemeIdUris:v,id:f||e,originalId:e,language:b.attributes.lang,Se:w,audioSamplingRate:x,fb:D,Fe:null,cf:A||c.cf,label:B||null,encrypted:!1}}function go(a,b){b=b.slice();a=r(a);for(var c=a.next();!c.done;c=a.next())c=c.value.attributes.schemeIdUri,b.includes(c)||b.push(c);return b}
function Un(a){a=r(a);for(var b=a.next();!b.done;b=a.next()){b=b.value;var c=b.attributes.schemeIdUri;if(c&&(b=b.attributes.value))switch(c){case "urn:mpeg:dash:outputChannelPositionList:2012":return b.trim().split(/ +/).length;case "urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case "urn:dts:dash:audio_channel_configuration:2012":b=parseInt(b,10);if(!b)continue;return b;case "tag:dolby.com,2015:dash:audio_channel_configuration:2015":c=[2,1,2,2,2,2,1,2,2,1,1,1,1,2,1,1,2,2];b=parseInt(b,
16);if(!b)continue;for(var d=0,e=0;e<c.length;e++)b&1<<e&&(d+=c[e]);if(d)return d;continue;case "tag:dolby.com,2014:dash:audio_channel_configuration:2011":case "urn:dolby:dash:audio_channel_configuration:2011":c=[1,1,1,1,1,2,2,1,1,2,2,2,1,2,1,1].reverse();b=parseInt(b,16);if(!b)continue;for(e=d=0;e<c.length;e++)b&1<<e&&(d+=c[e]);if(d)return d;continue;case "urn:mpeg:mpegB:cicp:ChannelConfiguration":if(c=[0,1,2,3,4,5,6,8,2,3,4,7,8,24,8,12,10,12,14,12,14],(b=parseInt(b,10))&&b>0&&b<c.length)return c[b]}}return null}
function Vn(a){a=ud(a,"Role");for(var b=!1,c=void 0,d=r(a),e=d.next();!e.done;e=d.next()){e=e.value;var f=e.attributes.schemeIdUri;if(f==null||f=="urn:mpeg:dash:role:2011")switch(e=e.attributes.value,e){case "main":b=!0;break;case "caption":case "subtitle":c=e}}return{yg:a.map(function(g){return g.attributes.value}).filter(kf).filter(function(g){return g!==c}),Yf:b,kind:c}}function Tn(a){var b=a.attributes.label;(a=ud(a,"Label"))&&a.length&&(a=a[0],vd(a)&&(b=vd(a)));return b||null}
function Wn(a){switch(a){case "1":return"visually impaired";case "2":return"hard of hearing";case "9":return"spoken subtitles";default:return null}}function $n(a){var b=a.md?1:0;b+=a.Ub?1:0;b+=a.tc?1:0;if(b==0)return a.contentType==wc||a.contentType=="application"?!0:!1;b!=1&&(a.md&&(a.Ub=null),a.tc=null);return!0}
function ho(a,b,c,d){var e,f,g,h,k,l,m;return H(function(n){if(n.i==1)return e=[Jb(c)],f=rj(b(),e),g=Cj(f,a.h.retryParameters),g.method=d,h=a.l.networkingEngine.request(4,g,{isPreload:a.za()}),qj(a.L,h),n.h(h.promise,2);k=n.j;if(d=="HEAD"){if(!k.headers||!k.headers.date)return n.return(0);l=k.headers.date}else l=Db(k.data);m=Date.parse(l);return isNaN(m)?n.return(0):n.return(m-Date.now())})}
function Dn(a,b,c){var d,e,f,g,h,k,l,m;return H(function(n){switch(n.i){case 1:d=c.map(function(p){return{scheme:p.attributes.schemeIdUri,value:p.attributes.value}}),e=a.h.dash.clockSyncUri,!d.length&&e&&d.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:e}),f=r(d),g=f.next();case 2:if(g.done){n.B(4);break}h=g.value;n.o(5);k=h.scheme;l=h.value;switch(k){case "urn:mpeg:dash:utc:http-head:2014":case "urn:mpeg:dash:utc:http-head:2012":return n.B(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 n.B(8);
case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":return m=Date.parse(l),n.return(isNaN(m)?0:m-Date.now());case "urn:mpeg:dash:utc:http-ntp:2014":case "urn:mpeg:dash:utc:ntp:2014":case "urn:mpeg:dash:utc:sntp:2014":Ua("NTP UTCTiming scheme is not supported");break;default:Ua("Unrecognized scheme in UTCTiming element",k)}n.B(9);break;case 7:return n.h(ho(a,b,l,"HEAD"),10);case 10:return n.return(n.j);case 8:return n.h(ho(a,b,l,"GET"),11);case 11:return n.return(n.j);case 9:n.u(3);
break;case 5:n.m();case 3:g=f.next();n.B(2);break;case 4:return Ua("A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!"),n.return(0)}})}
function On(a,b,c,d,e){var f=d.attributes.schemeIdUri||"",g=d.attributes.value||"",h=Dd(d,"timescale",Ld)||1,k=Dd(d,"presentationTimeOffset",Ld)||0,l;f==="urn:mpeg:dash:event:alternativeMPD:insert:2025"||f==="urn:mpeg:dash:event:alternativeMPD:replace:2025"?l="altmpd":f==="urn:mpeg:dash:event:callback:2015"&&(l="callback");l=l?un(a,d,l):void 0;d=r(ud(d,"Event"));for(var m=d.next();!m.done;m=d.next()){m=m.value;var n=Dd(m,"presentationTime",Ld)||0,p=Dd(m,"duration",Ld)||0;n=Math.max((n-k)/h+b,b);p=
n+p/h;c!=null&&(n=Math.min(n,b+c),p=Math.min(p,b+c));if(!(p<e)&&(m={schemeIdUri:f,value:g,startTime:n,endTime:p,id:m.attributes.id||"",timescale:h,eventNode:Ud(m),urlParams:l},a.l.onTimelineRegionAdded(m),hn.includes(m.schemeIdUri.trim())?(p={schemeIdUri:m.schemeIdUri,startTime:m.startTime,endTime:m.endTime,id:m.id,source:"dash",kind:"",data:null,node:null},m.eventNode&&(p.data=gn(m.eventNode),p.data||(p.node=m.eventNode)),m=p):m=null,m))a.l.onScte35Event(m)}}
function Jn(a,b,c,d,e){var f,g,h,k;return H(function(l){if(l.i==1)return f=Hj,g=e?0:1,h=xl(b,c,d,a.l.getStreamingRetryParameters()),l.h(pn(a,h,f,{type:g}),2);k=l.j;return l.return(k.data)})}function Yn(a,b){b=De(a,b);return Xe(b)?wc:a.split("/")[0]}function pn(a,b,c,d){d||(d={});d.isPreload=a.za();b=a.l.networkingEngine.request(c,b,d);qj(a.L,b);return b.promise}
function on(a){var b=a.m.Td;if(!a.m.Oe||!b||!a.H.length)return[];var c=Date.now()/1E3,d=a.H.filter(function(e){e=Ld(e.attributes.ttl);return!e||b+e>c}).map(wd).filter(kf);return d.length?rj(a.C,d):[]}function wn(){return""}function vn(a,b,c){return function(){return a&&b?Dl(a,"BaseURL"):c.slice()}}I("shaka.dash.DashParser",kn);var xn=new Set(["urn:mpeg:dash:urlparam:2014","urn:mpeg:dash:urlparam:2016"]),Kn=new Set("http://dashif.org/guidelines/trickmode http://dashif.org/thumbnail_tile http://dashif.org/guidelines/thumbnail_tile urn:mpeg:mpegB:cicp:TransferCharacteristics urn:mpeg:mpegB:cicp:ColourPrimaries urn:mpeg:mpegB:cicp:MatrixCoefficients urn:mpeg:dash:ssr:2023 urn:mpeg:dash:preselection:2016 urn:dvb:dash:fontdownload:2014 urn:mpeg:dash:urlparam:2014 urn:mpeg:dash:urlparam:2016 urn:mpeg:dash:urlparam:2025 urn:mpeg:dash:pattern:2024".split(" "));
Hc("application/dash+xml",function(){return new kn});Hc("video/vnd.mpeg.dash.mpd",function(){return new kn});function io(a,b){this.h=a;this.i=b}io.prototype.toString=function(){return"v"+this.h+"."+this.i};function jo(a,b){var c=new io(6,0),d=ko,e=d.h,f=c.i-e.i;((c.h-e.h||f)>0?d.j:d.i)(d.h,c,a,b)}function lo(a,b,c,d){Ua([c,"has been deprecated and will be removed in",b,". We are currently at version",a,". Additional information:",d].join(" "))}function mo(a,b,c,d){Ta([c,"has been deprecated and has been removed in",b,". We are now at version",a,". Additional information:",d].join(" "))}var ko=null;function no(){}function oo(a,b){var c=document.createElement("source");c.src=a;c.type=b===void 0?"":b;return c}function po(a){for(var b=!1,c=a.getElementsByTagName("source"),d=c.length-1;d>=0;--d)a.removeChild(c[d]),b=!0;a.src&&(a.removeAttribute("src"),b=!0);return b}function qo(a){for(;a.firstChild;)a.removeChild(a.firstChild)}
function Lc(){if(ro)return ro;so||(so=new gf(function(){ro=null}));(ro=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(ro=document.createElement("video"));so.ka(1);return ro}
function to(a,b){var c,d,e,f,g;return H(function(h){if(h.i==1)return"fonts"in document&&"FontFace"in window?h.h(document.fonts.ready,2):h.return();if(!("entries"in document.fonts))return h.return();c=function(k){k=k.entries();for(var l=[],m=k.next();m.done===!1;)l.push(m.value),m=k.next();return l};d=r(c(document.fonts));for(e=d.next();!e.done;e=d.next())if(f=e.value,f.family===a&&f.display==="swap")return h.return();g=new FontFace(a,"url("+b+")",{display:"swap"});document.fonts.add(g);h.l()})}
function uo(a,b,c){a.J(document,"fullscreenchange",function(){c(!!document.fullscreenElement)});b&&((b.webkitPresentationMode||b.webkitSupportsFullscreen)&&a.J(b,"webkitpresentationmodechanged",function(){b.webkitPresentationMode?c(b.webkitPresentationMode!=="inline"):b.webkitSupportsFullscreen&&c(b.webkitDisplayingFullscreen)}),a.J(b,"enterpictureinpicture",function(){c(!0)}),a.J(b,"leavepictureinpicture",function(){c(!1)}));"documentPictureInPicture"in window&&a.J(window.documentPictureInPicture,
"enter",function(d){c(!0);a.Ma(d.window,"pagehide",function(){c(!1)})})}I("shaka.util.Dom",no);no.removeAllChildren=qo;no.clearSourceFromVideo=po;var so=null,ro=null;function vo(){this.l=new ob(function(){for(var a=navigator.userAgent.toLowerCase(),b=r([{type:"VR",og:/oculus|quest/},{type:"TV",og:/smart[ _]?tv|android ?tv/},{type:"MOBILE",og:/iphone|ipad|ipod|android/}]),c=b.next();!c.done;c=b.next())if(c=c.value,c.og.test(a))return c.type;a=navigator.userAgentData;var d;b=(a==null?void 0:(d=a.platform)==null?void 0:d.toLowerCase())||"";if(a){if(a.mobile)return"MOBILE";if(b.includes("android"))return"TV"}return"DESKTOP"});this.m=new ob(function(){var a=navigator.userAgent;
return navigator.vendor.includes("Apple")&&(a.includes("Version/")||a.includes("OS/"))?"WEBKIT":a.includes("Edge/")?"EDGE":a.includes("Chrome/")?"CHROMIUM":a.includes("Firefox/")?"GECKO":"UNKNOWN"})}function Kc(){var a=window.ManagedMediaSource||window.MediaSource;return a&&a.isTypeSupported?!0:!1}q=vo.prototype;q.Ib=function(){return!!navigator.mediaCapabilities};q.Ia=function(){return this.l.value()};q.Ba=function(){return this.m.value()};q.kd=function(){return!1};q.sg=function(){return!1};
q.Ge=function(){return!1};q.ii=function(){return!1};q.ug=function(){return!1};q.Ye=function(){return!1};q.cb=function(){var a=window.ManagedSourceBuffer||window.SourceBuffer;return!!a&&!!a.prototype&&!!a.prototype.changeType};q.Wd=function(){return!0};q.mi=function(){return 0};q.Db=function(){return Promise.resolve({width:Infinity,height:Infinity})};q.Di=function(){return!1};q.Cg=function(){return!1};
q.Ta=function(a){var b=this.Ia();if(b==="TV"||b==="CONSOLE"||b==="CAST")a.ads.customPlayheadTracker=!0,a.ads.skipPlayDetection=!0,a.ads.supportsMultipleMediaElements=!1;b==="TV"&&(a.textDisplayer.suspendRenderingWhenHidden=!1);return a};q.ei=function(){return[]};q.fc=function(a){return window.matchMedia!==void 0&&(window.matchMedia("(color-gamut: p3)").matches||window.matchMedia("(dynamic-range: high)").matches)?a?"HLG":"PQ":"SDR"};q.Ki=function(){return!1};q.Qh=function(){return!1};q.Ze=function(){return!1};
q.ef=function(){return!0};q.Rh=function(){return!1};q.Ji=function(){return!0};q.Jc=function(){return!1};q.cg=function(a){return a==="com.apple.fps"};q.od=function(){return!0};function wo(a,b){a=a.Ia();return["DESKTOP","MOBILE","VR","APPLE_VR"].includes(a)?b.remote:null}q.pd=function(){return typeof Worker!=="undefined"};q.Ah=function(){return!0};q.dg=function(){return!1};q.toString=function(){return"Device: "+this.ib()+" v"+this.sa()+"; Type: "+this.Ia()};function xo(){vo.call(this);this.h=new ob(function(){var a=navigator.userAgent.match(/Version\/(\d+)(?:\.(\d+))?/);a||(a=navigator.userAgent.match(/OS (\d+)(?:_(\d+))?/));return a?[parseInt(a[1],10),parseInt(a[2]||"0",10)]:[0,0]});this.i=new ob(function(){return/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||navigator.maxTouchPoints>1?"xr"in navigator?"APPLE_VR":"MOBILE":"xr"in navigator?"APPLE_VR":"DESKTOP"})}ra(xo,vo);q=xo.prototype;q.sa=function(){return this.h.value()[0]};q.ib=function(){return"Apple Browser"};
q.Ia=function(){return this.i.value()};q.Ba=function(){return"WEBKIT"};q.Ib=function(){return!1};q.kd=function(a,b){return!yo(this)&&b==="audio"};q.Ge=function(){return!yo(this)};q.ii=function(a){return!yo(this)&&a==="audio"};q.Ta=function(a){vo.prototype.Ta.call(this,a);a.streaming.fallbackToNativeHlsOnMseError=!0;a.abr.minTimeToSwitch=.5;a.streaming.inaccurateManifestTolerance=0;return a};q.Ki=function(){return!0};q.od=function(){return!1};q.Ah=function(){return!1};q.Ye=function(){return!0};
q.dg=function(){return!0};function yo(a){a=a.h.value();return a[0]>=27?!0:a[0]===26&&a[1]>=4}(navigator.vendor||"").includes("Apple")&&(/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||navigator.maxTouchPoints>1||navigator.userAgentData&&navigator.userAgentData.platform&&navigator.userAgentData.platform.toLowerCase()=="macos"||navigator.platform&&navigator.platform.toLowerCase().includes("mac"))&&(qb=function(){return new xo});function zo(){if(!Ao())throw Error("Not a Chromecast device!");vo.call(this);this.i=new ob(function(){var a=navigator.userAgent.match(/Chrome\/(\d+)/);return a?parseInt(a[1],10):null});this.h=new ob(function(){var a=navigator.userAgentData&&navigator.userAgentData.platform||navigator.userAgent;a=a.toLowerCase();return a.includes("android")?Bo:a.includes("fuchsia")?Co:Do})}ra(zo,vo);q=zo.prototype;q.sa=function(){return this.i.value()};q.ib=function(){return"Chromecast with "+this.h.value()};
q.Ia=function(){return"CAST"};q.Ba=function(){return"CHROMIUM"};q.Ib=function(){return vo.prototype.Ib.call(this)&&this.h.value()!==Do};q.cb=function(a){return vo.prototype.cb.call(this,a)&&this.h.value()!==Do};q.mi=function(){switch(this.h.value()){case Bo:return 0;case Co:return 3;default:return 1}};
q.Db=function(){var a,b,c,d,e;return H(function(f){switch(f.i){case 1:a=window.cast&&cast.__platform__&&cast.__platform__.canDisplayType;b={width:1280,height:720};f.o(2);if(!(c=a)){f.B(4);break}return f.h(cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160'),5);case 5:c=f.j;case 4:if(c){b.width=3840;b.height=2160;f.B(6);break}if(!(d=a)){f.B(7);break}return f.h(cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=1920; height=1080'),8);case 8:d=
f.j;case 7:d&&(b.width=1920,b.height=1080);case 6:f.u(3);break;case 2:e=f.m(),Ta("Failed to check canDisplayType:",e);case 3:return f.return(b)}})};q.Ta=function(a){vo.prototype.Ta.call(this,a);a.streaming.stallSkip=0;return a};q.Jc=function(){return!0};q.Ye=function(){return this.h.value()===Do};function Ao(){return navigator.userAgent.includes("CrKey")&&!navigator.userAgent.includes("VIZIO SmartCast")}var Bo="Android",Co="Fuchsia",Do="Linux";Ao()&&(qb=function(){return new zo});function Eo(){vo.call(this);this.j=new ob(function(){var a=navigator.userAgent.match(/Edge?\/(\d+)/);return a||(a=navigator.userAgent.match(/OPR\/(\d+)/))?parseInt(a[1],10):(a=navigator.userAgent.match(/(Chrome|Firefox)\/(\d+)/))?parseInt(a[2],10):null});this.h=new ob(function(){return navigator.userAgent.match(/Edge?\//)?"Edge":navigator.userAgent.includes("OPR/")?"Opera":navigator.userAgent.includes("Chrome")?"Chrome":navigator.userAgent.includes("Firefox")?"Firefox":"Unknown"});this.u=new ob(function(){return navigator.userAgentData&&
navigator.userAgentData.platform?navigator.userAgentData.platform.toLowerCase()=="macos":navigator.platform?navigator.platform.toLowerCase().includes("mac"):!1});this.i=new ob(function(){return navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform.toLowerCase()=="windows":navigator.platform?navigator.platform.toLowerCase().includes("win32"):!1});this.A=new ob(function(){return navigator.userAgent.includes("sony.hbbtv.tv")});this.o=new ob(function(){return navigator.userAgentData&&
navigator.userAgentData.platform?navigator.userAgentData.platform.toLowerCase()=="android":navigator.userAgent.includes("Android")?!0:!1})}ra(Eo,vo);q=Eo.prototype;q.sa=function(){return this.j.value()};q.ib=function(){return this.h.value()};q.kd=function(a){return $b(a)?this.i.value():!1};q.sg=function(a){return $b(a)||this.h.value()==="Edge"?this.i.value():!1};q.od=function(){return this.h.value()==="Opera"&&this.u.value()?!1:vo.prototype.od.call(this)};
q.Ge=function(a){return $b(a)||this.h.value()==="Edge"?this.i.value():!1};q.cb=function(a){return this.i.value()&&$b(a)?!1:vo.prototype.cb.call(this,a)};
q.Ta=function(a){vo.prototype.Ta.call(this,a);if(this.i.value())switch(this.h.value()){case "Firefox":a.drm.keySystemsMapping={"com.microsoft.playready":"com.microsoft.playready.recommendation"};break;case "Opera":case "Chrome":a.drm.keySystemsMapping={"com.microsoft.playready":"com.microsoft.playready.recommendation.3000","com.microsoft.playready.recommendation":"com.microsoft.playready.recommendation.3000"}}this.o.value()&&(a.drm.defaultAudioRobustnessForWidevine="SW_SECURE_CRYPTO",a.drm.defaultVideoRobustnessForWidevine=
"SW_SECURE_CRYPTO");return a};q.Ze=function(){return this.h.value()==="Edge"||this.A.value()};q.Jc=function(){if(this.Ba()==="GECKO"){var a=this.sa();return a!==null?a>=100:vo.prototype.Jc.call(this)}return vo.prototype.Jc.call(this)};q.cg=function(a){return this.Ba()==="GECKO"?$b(a):vo.prototype.cg.call(this,a)};rb=function(){return new Eo};function Fo(){vo.apply(this,arguments)}ra(Fo,vo);q=Fo.prototype;q.sa=function(){return null};q.ib=function(){return"Hisense"};q.Ia=function(){return"TV"};q.Ib=function(){return!1};q.cb=function(){return!1};q.Db=function(){var a={width:1920,height:1080},b=null;if(window.Hisense_Get4KSupportState)try{b=window.Hisense_Get4KSupportState()}catch(c){}b==null&&(b=navigator.userAgent.includes("UHD"));b&&(a.width=3840,a.height=2160);return Promise.resolve(a)};
q.Ta=function(a){vo.prototype.Ta.call(this,a);a.streaming.stallSkip=0;return a};q.pd=function(){return!1};if(navigator.userAgent.includes("Hisense")||navigator.userAgent.includes("VIDAA"))qb=function(){return new Fo};function Go(){vo.call(this);this.h=new ob(function(){var a=navigator.userAgent.match(/PlayStation (\d+)/);return a?parseInt(a[1],10):null})}ra(Go,vo);q=Go.prototype;q.ib=function(){return"PlayStation"};q.Ia=function(){return"CONSOLE"};q.Ba=function(){return"WEBKIT"};q.sa=function(){return this.h.value()};q.Ib=function(){return!1};q.cb=function(){return!1};q.Cg=function(){return this.sa()===4};
q.Db=function(){var a,b,c,d,e;return H(function(f){switch(f.i){case 1:return a={width:1920,height:1080},b=!1,f.o(2),f.h(window.msdk.device.getDisplayInfo(),4);case 4:c=f.j;b=c.resolution==="4K";f.u(3);break;case 2:return f.m(),f.o(5),f.h(window.msdk.device.getDisplayInfoImmediate(),7);case 7:d=f.j;b=d.resolution==="4K";f.u(3);break;case 5:e=f.m(),Ua("PlayStation: Failed to get the display info:",e);case 3:return b&&(a.width=3840,a.height=2160),f.return(a)}})};
q.Ta=function(a){vo.prototype.Ta.call(this,a);this.sa()===4&&a.drm.preferredKeySystems.push("com.microsoft.playready");a.streaming.clearDecodingCache=!0;return a};q.Ze=function(){return this.sa()===4};q.ef=function(){return this.sa()!==4};navigator.userAgent.includes("PlayStation")&&(qb=function(){return new Go});function Ho(){vo.apply(this,arguments)}ra(Ho,vo);q=Ho.prototype;q.sa=function(){return null};q.ib=function(){return"TitanOS"};q.Ia=function(){return"TV"};q.Db=function(){var a={width:1920,height:1080};try{SmartTvA_API.hasCapability("UHD")?(a.width=3840,a.height=2160):SmartTvA_API.hasCapability("FHD")?(a.width=1920,a.height=1080):(a.width=1280,a.height=720)}catch(b){Ua("Titan OS: Error detecting screen size, default screen size 1920x1080.",b)}return Promise.resolve(a)};
q.fc=function(a){try{if(SmartTvA_API.hasCapability("HDR","HDR10")||SmartTvA_API.hasCapability("HDR","DV"))return a?"HLG":"PQ"}catch(b){return Ua("Titan OS: Error checking HDR support",b),vo.prototype.fc.call(this,a)}return"SDR"};navigator.userAgent.includes("TitanOS")&&(qb=function(){return new Ho});function Io(){vo.apply(this,arguments)}ra(Io,vo);q=Io.prototype;q.sa=function(){return null};q.ib=function(){return"TiVoOS"};q.Ia=function(){return"TV"};q.Ba=function(){return"CHROMIUM"};q.cb=function(){return!1};navigator.userAgent.includes("TiVoOS")&&(qb=function(){return new Io});function Jo(){vo.call(this);var a=navigator.userAgent.match(/Tizen (\d+).(\d+)/);this.h=a?parseInt(a[1],10):null;this.i=a?parseInt(a[2],10):null}ra(Jo,vo);q=Jo.prototype;q.sa=function(){return this.h};q.ib=function(){return"Tizen"};q.Ba=function(){return"CHROMIUM"};q.Ia=function(){return"TV"};q.kd=function(){return!0};q.ug=function(){return this.sa()===3};q.Ib=function(){return!1};q.cb=function(){return!1};q.Wd=function(){return this.h&&this.i?this.h===5?this.i>=5:this.h>5:vo.prototype.Wd.call(this)};
q.Db=function(){var a=window.devicePixelRatio;a={width:window.screen.width*a>1920?3840:1920,height:window.screen.height*a>1080?2160:1080};try{if(webapis.systeminfo&&webapis.systeminfo.getMaxVideoResolution){var b=webapis.systeminfo.getMaxVideoResolution();a.width=b.width;a.height=b.height}else webapis.productinfo.is8KPanelSupported&&webapis.productinfo.is8KPanelSupported()?(a.width=7680,a.height=4320):webapis.productinfo.isUdPanelSupported&&webapis.productinfo.isUdPanelSupported()&&(a.width=3840,
a.height=2160)}catch(c){Ua("Tizen: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(a)};q.Ta=function(a){vo.prototype.Ta.call(this,a);a.drm.ignoreDuplicateInitData=this.sa()!==2;this.sa()===3&&(a.streaming.crossBoundaryStrategy="reset_to_encrypted");a.streaming.shouldFixTimestampOffset=!0;a.streaming.stallSkip=0;a.streaming.gapPadding=2;return a};q.ei=function(){var a=[];this.h!==null&&this.h<5&&a.push("opus");return a};
q.fc=function(a){try{if(webapis.avinfo.isHdrTvSupport())return a?"HLG":"PQ"}catch(b){return vo.prototype.fc.call(this,a)}return"SDR"};q.Qh=function(){return!0};q.Rh=function(){return this.sa()===3};q.pd=function(){var a=this.sa();return a!==null&&a<3?!1:vo.prototype.pd.call(this)};navigator.userAgent.includes("Tizen")&&(qb=function(){return new Jo});function Ko(){vo.apply(this,arguments)}ra(Ko,vo);q=Ko.prototype;q.sa=function(){return null};q.ib=function(){return"Vizio"};q.Ia=function(){return"TV"};q.Ib=function(){return!1};q.Ye=function(){return!0};navigator.userAgent.includes("VIZIO SmartCast")&&(qb=function(){return new Ko});function Lo(){vo.call(this);this.j=new ob(function(){return navigator.userAgent.includes("DT_STB_BCM")||navigator.userAgent.includes("Sky_STB")});this.i=new ob(function(){return navigator.userAgent.includes("SOPOpenBrowser")});this.h=new ob(function(){if(navigator.userAgent.includes("DT_STB_BCM"))return 11;var a=navigator.userAgent.match(/Version\/(\d+)/);return a?parseInt(a[1],10):(a=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(a[1],10):null})}ra(Lo,vo);q=Lo.prototype;q.sa=function(){return this.h.value()};
q.ib=function(){return"WebKit STB"};q.Ia=function(){return"TV"};q.Ba=function(){return"WEBKIT"};q.Ib=function(){return!1};q.kd=function(){return this.i.value()};q.Db=function(){return Promise.resolve({width:window.screen.width*window.devicePixelRatio,height:window.screen.height*window.devicePixelRatio})};q.ef=function(){return!this.j.value()};q.od=function(){return!1};q.dg=function(){return!0};
if(navigator.userAgent.includes("PlayStation")?0:navigator.userAgent.includes("SOPOpenBrowser")||navigator.userAgent.includes("DT_STB_BCM")||navigator.userAgent.includes("Sky_STB")||!(!(navigator.vendor||"").includes("Apple")||/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||navigator.maxTouchPoints>1||navigator.userAgentData&&navigator.userAgentData.platform&&navigator.userAgentData.platform.toLowerCase()=="macos"||navigator.platform&&navigator.platform.toLowerCase().includes("mac")))qb=function(){return new Lo};function Mo(){vo.call(this);var a=this;this.i=No();this.h=null;try{var b=new PalmServiceBridge;b.onservicecallback=function(c){c=JSON.parse(c);var d,e,f,g;a.h=(g=(f=(d=c.configs)==null?void 0:d["tv.model.supportHDR"])!=null?f:(e=c.configs)==null?void 0:e["tv.config.supportDolbyHDRContents"])!=null?g:!1};b.call("luna://com.webos.service.config/getConfigs",JSON.stringify({configNames:["tv.model.supportHDR","tv.config.supportDolbyHDRContents"]}))}catch(c){Ua("WebOS: getConfigs call failed",c)}}
ra(Mo,vo);q=Mo.prototype;q.sa=function(){return this.i};q.ib=function(){return"WebOS"};q.Ia=function(){return"TV"};q.Ba=function(){return"CHROMIUM"};q.Ib=function(){return!1};q.cb=function(){return!1};q.Wd=function(){var a=this.sa();return a!==null?a>3:vo.prototype.Wd.call(this)};q.Db=function(){var a={width:1920,height:1080};try{var b=JSON.parse(window.PalmSystem.deviceInfo);a.width=Math.max(1920,b.screenWidth);a.height=Math.max(1080,b.screenHeight)}catch(c){Ua("WebOS: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(a)};
q.Ta=function(a){vo.prototype.Ta.call(this,a);this.sa()===3&&(a.streaming.crossBoundaryStrategy="reset");a.streaming.shouldFixTimestampOffset=!0;a.streaming.stallSkip=0;return a};q.fc=function(a){return this.h==null?(Ua("WebOS: getConfigs call haven't finished"),vo.prototype.fc.call(this,a)):this.h?a?"HLG":"PQ":"SDR"};
function No(){var a=null,b=navigator.userAgent.match(/Chrome\/(\d+)/);b&&(a=parseInt(b[1],10));switch(a){case 38:return 3;case 53:return 4;case 68:return 5;case 79:return 6;case 87:return 22;case 94:return 23;case 108:return 24;case 120:return 25;case 132:return 26;default:return null}}q.Ji=function(){return!1};q.Jc=function(){var a=this.sa();return a!==null?a>=6:vo.prototype.Jc.call(this)};q.pd=function(){var a=this.sa();return a!==null&&a<4?!1:vo.prototype.pd.call(this)};
if(navigator.userAgent.includes("Web0S")){var Oo=new Mo;qb=function(){return Oo}};function Po(){vo.call(this);this.h=navigator.userAgent.includes("Edge/");var a=navigator.userAgent.match(/Edge?\/(\d+)/);this.i=a?parseInt(a[1],10):null}ra(Po,vo);q=Po.prototype;q.sa=function(){return this.i};q.ib=function(){return"Xbox"};q.Ia=function(){return"CONSOLE"};q.Ba=function(){return this.h?"EDGE":"CHROMIUM"};q.kd=function(){return!0};q.sg=function(){return!0};q.Ge=function(){return!0};q.Di=function(){return this.h};
q.Db=function(){var a={width:1920,height:1080},b=Qo();if(b)try{var c=new b.Media.Protection.ProtectionCapabilities,d=b.Media.Protection.ProtectionCapabilityResult;b=null;do b=c.isTypeSupported('video/mp4;codecs="hvc1,mp4a";features="decode-res-x=3840,decode-res-y=2160,decode-bitrate=20000,decode-fps=30,decode-bpc=10,display-res-x=3840,display-res-y=2160,display-bpc=8"',"com.microsoft.playready.recommendation");while(b===d.maybe);b===d.probably&&(a.width=3840,a.height=2160)}catch(e){Ua("Xbox: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(a)};
q.Ta=function(a){vo.prototype.Ta.call(this,a);a.drm.parseInbandPsshEnabled=this.h;a.drm.preferredKeySystems.push("com.microsoft.playready");this.h&&(a.streaming.gapPadding=.01);return a};q.Ze=function(){return!0};function Qo(){var a=null;try{a=typeof Windows!=="undefined"?Windows:chrome.webview.hostObjects.sync.Windows}catch(b){}return a}if(navigator.userAgent.includes("Xbox One")||Qo()!==null)qb=function(){return new Po};function Ro(a){this.h=!1;this.i=Promise.withResolvers();this.j=a}Ro.prototype.destroy=function(){var a=this;if(this.h)return this.i.promise;this.h=!0;return this.j().then(function(){a.i.resolve()},function(){a.i.resolve()})};function So(a,b){if(a.h){if(b instanceof T&&b.code==7003)throw b;throw new T(2,7,7003,b);}};function To(a,b){var c=[];a=r(a);for(var d=a.next();!d.done;d=a.next())c.push(b(d.value));return c}function Uo(a,b){a=r(a);for(var c=a.next();!c.done;c=a.next())if(!b(c.value))return!1;return!0};function Vo(a){for(var b=new Map,c=r(Object.keys(a)),d=c.next();!d.done;d=c.next())d=d.value,b.set(d,a[d]);return b}function Wo(a){var b={};a.forEach(function(c,d){b[d]=c});return b};function Xo(a){var b=this;this.F=a;this.u=this.A=null;this.U=!1;this.K=0;this.h=null;this.C=new ib;this.j=new Map;this.W=[];this.D=new Map;this.L=!1;this.m=Promise.withResolvers();this.i=null;this.o=function(c){c.severity==2&&b.m.reject(c);a.onError(c)};this.Z=new Map;this.ea=new Map;this.N=new gf(function(){return Yo(b)});this.$=!1;this.O=[];this.ia=!1;this.G=new gf(function(){Zo(b)});this.m.promise.catch(function(){});this.l=new Ro(function(){return $o(b)});this.P=!1;this.H=this.I=null;this.V=function(){return!1}}
q=Xo.prototype;q.destroy=function(){return this.l.destroy()};
function $o(a){var b;return H(function(c){switch(c.i){case 1:return a.C.release(),a.C=null,a.m.reject(),a.G.stop(),a.G=null,a.N.stop(),a.N=null,c.h(ap(a),2);case 2:if(!a.u){c.B(3);break}if(!a.A){c.B(4);break}c.o(5);return c.h(a.u.setMediaKeys(null),7);case 7:c.u(4);break;case 5:b=c.m(),Ua("DrmEngine.destroyNow_ exception",b);case 4:a.u=null;case 3:a.h=null,a.A=null,a.D=new Map,a.i=null,a.o=function(){},a.F=null,a.P=!1,a.I=null,c.l()}})}
q.configure=function(a,b){this.i=a;b&&(this.V=b);this.G&&this.U&&this.h&&this.G.Ka(this.i.updateExpirationTime)};function bp(a,b,c,d){d=d===void 0?!0:d;a.D=new Map;c=r(c);for(var e=c.next();!e.done;e=c.next())a.D.set(e.value,{initData:null,initDataType:null});c=r(a.i.persistentSessionsMetadata);for(e=c.next();!e.done;e=c.next())e=e.value,a.D.set(e.sessionId,{initData:e.initData,initDataType:e.initDataType});a.$=a.D.size>0;return cp(a,b,d)}
function cp(a,b,c){var d,e,f,g,h,k,l,m,n,p,t,u,v,w,x,y,z,D;return H(function(A){if(A.i==1){dp(a.i.clearKeys,b);d=b.some(function(B){return B.video&&B.video.drmInfos.length||B.audio&&B.audio.drmInfos.length?!0:!1});e=Vo(a.i.servers);f=Vo(a.i.advanced||{});!d&&c&&ep(b,e);g=new WeakSet;h=r(b);for(k=h.next();!k.done;k=h.next())for(l=k.value,m=fp(l),n=r(m),p=n.next();!p.done;p=n.next())t=p.value,g.has(t)||(g.add(t),gp(t,e,f,a.i.keySystemsMapping));u=function(B,E){var C=[];B=r(B);for(var G=B.next();!G.done;G=
B.next()){G=G.value;var K=G[E]||f.has(G.keySystem)&&f.get(G.keySystem)[E]||"";K==""&&Zb(G.keySystem)&&(E=="audioRobustness"?K=[a.i.defaultAudioRobustnessForWidevine]:E=="videoRobustness"&&(K=[a.i.defaultVideoRobustnessForWidevine]));if(typeof K==="string")C.push(G);else if(Array.isArray(K)){K.length===0&&(K=[""]);K=r(K);for(var L=K.next();!L.done;L=K.next()){var N={};C.push(Object.assign({},G,(N[E]=L.value,N)))}}}return C};v=new WeakSet;w=r(b);for(x=w.next();!x.done;x=w.next())y=x.value,y.video&&
!v.has(y.video)&&(y.video.drmInfos=u(y.video.drmInfos,"videoRobustness"),y.video.drmInfos=u(y.video.drmInfos,"audioRobustness"),v.add(y.video)),y.audio&&!v.has(y.audio)&&(y.audio.drmInfos=u(y.audio.drmInfos,"videoRobustness"),y.audio.drmInfos=u(y.audio.drmInfos,"audioRobustness"),v.add(y.audio));return A.h(zf(b,a.$,a.P,a.i.preferredKeySystems),2)}So(a.l);z=d||e.size>0;if(!z)return a.U=!0,A.return(Promise.resolve());D=hp(a,b);return A.return(d?D:D.catch(function(){}))})}
function ip(a){var b;return H(function(c){switch(c.i){case 1:if(a.u.mediaKeys)return c.return();if(!a.I){c.B(2);break}return c.h(a.I,3);case 3:return So(a.l),c.return();case 2:return c.o(4),a.I=a.u.setMediaKeys(a.A),c.h(a.I,6);case 6:c.u(5);break;case 4:b=c.m(),a.o(new T(2,6,6003,b.message));case 5:So(a.l),c.l()}})}function jp(a,b){return H(function(c){if(c.i==1)return c.h(ip(a),2);kp(a,b.initDataType,S(b.initData));c.l()})}
q.ub=function(a){var b=this,c,d,e,f;return H(function(g){if(g.i==1){if(b.u===a)return g.return();if(!b.A)return b.C.Ma(a,"encrypted",function(){b.o(new T(2,6,6010))}),g.return();c=R();b.u=a;b.i.delayLicenseRequestUntilPlayed&&b.C.Ma(b.u,"play",function(){for(var h=r(b.O),k=h.next();!k.done;k=h.next())lp(b,k.value);b.ia=!0;b.O=[]});(d=wo(c,b.u))?b.C.Fb(d,["connect","connecting","disconnect"],function(){ap(b)}):"webkitCurrentPlaybackTargetIsWireless"in b.u&&b.C.J(b.u,"webkitcurrentplaybacktargetiswirelesschanged",
function(){return ap(b)});b.H=b.h?b.h.initData.find(function(h){return h.initData.length>0})||null:null;e=b.h.keySystem;return(f=c.cg(e))||!b.H&&b.h.keySystem==="com.apple.fps"&&!b.D.size?g.B(2):g.h(ip(b),2)}mp(b).catch(function(){});!f&&(b.H||b.D.size||b.i.parseInbandPsshEnabled)||b.C.J(b.u,"encrypted",function(h){return jp(b,h)});g.l()})};
function np(a){var b,c,d,e,f;return H(function(g){switch(g.i){case 1:if(!a.A||!a.h)return g.return();if(!a.h.serverCertificateUri||a.h.serverCertificate&&a.h.serverCertificate.length){g.B(2);break}b=Cj([a.h.serverCertificateUri],a.i.retryParameters);g.o(3);c=a.F.Dc.request(5,b,{isPreload:a.V()});return g.h(c.promise,5);case 5:d=g.j;a.h.serverCertificate=S(d.data);g.u(4);break;case 3:throw e=g.m(),new T(2,6,6017,e);case 4:if(a.l.h)return g.return();case 2:if(!a.h.serverCertificate||!a.h.serverCertificate.length)return g.return();
g.o(6);return g.h(a.A.setServerCertificate(a.h.serverCertificate),8);case 8:g.u(0);break;case 6:throw f=g.m(),new T(2,6,6004,f.message);}})}
function mp(a){var b,c,d,e,f;return H(function(g){if(g.i==1){if(!a.D.size)return g.B(2);a.D.forEach(function(h,k){op(a,k,h)});return g.h(a.m.promise,3)}if(g.i!=2){b=a.h&&a.h.keyIds||new Set([]);if(b.size>0&&pp(a))return g.return(a.m.promise);a.L=!1;a.m=Promise.withResolvers();a.m.promise.catch(function(){})}c=(a.h?a.h.initData:[])||[];d=r(c);for(e=d.next();!e.done;e=d.next())f=e.value,kp(a,f.initDataType,f.initData);qp(a)&&a.m.resolve();return g.return(a.m.promise)})}
function kp(a,b,c){if(!a.l.h&&c.length){try{c=a.i.initDataTransform(c,b,a.h)}catch(g){b=g;g instanceof T||(b=new T(2,6,6016,g));a.o(b);return}if(a.i.ignoreDuplicateInitData){var d=a.j.values();d=r(d);for(var e=d.next();!e.done;e=d.next())if(tb(c,e.value.initData))return;var f=!1;a.D.forEach(function(g){!f&&tb(c,g.initData)&&(f=!0)});if(f)return}a.L=!0;a.j.size>0&&qp(a)&&(a.m.resolve(),a.L=!1,a.m=Promise.withResolvers(),a.m.promise.catch(function(){}));rp(a,b,c,a.h.sessionType)}}
q.Kf=function(){var a=this,b=this.j.keys();b=To(b,function(c){var d=a.j.get(c);return{sessionId:c.sessionId,sessionType:d.type,initData:d.initData,initDataType:d.initDataType}});return Array.from(b)};q.pg=function(a){var b=this;this.j.forEach(function(c,d){a!=void 0&&d.sessionId!=a||sp(b,d)})};
q.wg=function(a,b){b=b===void 0?.1:b;var c=this,d,e,f,g,h;return H(function(k){switch(k.i){case 1:So(c.l);e=d=null;c.j.forEach(function(l,m){m.sessionId===a.sessionId&&(d=m,e=l)});if(!(d&&e&&c.h&&e.initData&&e.initDataType))return k.return(!1);f=e.initData;g=e.initDataType;if(!(b>0)){k.B(2);break}return k.h(mf(b),2);case 2:return k.o(4),c.j.delete(d),k.h(tp(c,d),6);case 6:h=rp(c,g,f,c.h.sessionType,!1);if(!h)throw new T(2,6,6005,"Failed to create new session for license retry");return k.return(!0);
case 4:return k.m(),k.return(!1)}})};q.Lf=function(){var a=Infinity,b=this.j.keys();b=r(b);for(var c=b.next();!c.done;c=b.next())c=c.value,isNaN(c.expiration)||(a=Math.min(a,c.expiration));return a};function up(a){return a.K?a.K:NaN}q.Nb=function(){return this.h};q.Ae=function(){return Wo(this.ea)};
function hp(a,b){var c,d,e,f,g,h,k;return H(function(l){switch(l.i){case 1:c=new Map;d=vp(a,b,c);if(!d){if(!navigator.requestMediaKeySystemAccess)throw new T(2,6,6020);throw new T(2,6,6001);}So(a.l);l.o(2);d.getConfiguration();e=a.i.keySystemsMapping[d.keySystem]||d.keySystem;a.h=wp(a,e,c.get(e));if(!a.h.licenseServerUri)throw new T(2,6,6012,a.h.keySystem);return l.h(d.createMediaKeys(),4);case 4:f=l.j;So(a.l);a.A=f;if(!(a.i.minHdcpVersion!=""&&"getStatusForPolicy"in a.A)){l.B(5);break}l.o(6);return l.h(a.A.getStatusForPolicy({minHdcpVersion:a.i.minHdcpVersion}),
8);case 8:g=l.j;if(g!="usable")throw new T(2,6,6018);So(a.l);l.u(5,2);break;case 6:h=l.m(2);if(h instanceof T)throw h;throw new T(2,6,6019,h.message);case 5:return a.U=!0,a.G.Ka(a.i.updateExpirationTime),l.h(np(a),9);case 9:So(a.l);l.u(0);break;case 2:k=l.m();So(a.l,k);a.h=null;if(k instanceof T)throw k;throw new T(2,6,6002,k.message);}})}
function vp(a,b,c){for(var d=r(b),e=d.next();!e.done;e=d.next()){e=r(fp(e.value));for(var f=e.next();!f.done;f=e.next())f=f.value,c.getOrInsertComputed(f.keySystem,function(){return[]}).push(f)}if(c.size==1&&c.has(""))throw new T(2,6,6E3);d=a.i.preferredKeySystems;d.length||(e=Vo(a.i.servers),e.size==1&&(d=Array.from(e.keys())));e=r(d);var g=e.next();for(f={};!g.done;f={ci:void 0},g=e.next()){f.ci=g.value;g=r(b);for(var h=g.next();!h.done;h=g.next())if(h=h.value.decodingInfos.find(function(n){return function(p){return p.supported&&
p.keySystemAccess!=null&&p.keySystemAccess.keySystem==n.ci}}(f)))return h.keySystemAccess}e=r([!0,!1]);for(f=e.next();!f.done;f=e.next())for(f=f.value,g=r(b),h=g.next();!h.done;h=g.next()){h=r(h.value.decodingInfos);for(var k=h.next();!k.done;k=h.next())if(k=k.value,k.supported&&k.keySystemAccess){var l=k.keySystemAccess.keySystem;if(!d.includes(l)){var m=c.get(l);!m&&a.i.keySystemsMapping[l]&&(m=c.get(a.i.keySystemsMapping[l]));l=r(m);for(m=l.next();!m.done;m=l.next())if(!!m.value.licenseServerUri==
f)return k.keySystemAccess}}}return null}function xp(a){qp(a)&&a.m.resolve()}function yp(a,b){(new gf(function(){b.loaded=!0;xp(a)})).ka(zp)}
function op(a,b,c){var d,e,f,g,h,k,l;H(function(m){switch(m.i){case 1:try{d=a.A.createSession("persistent-license")}catch(n){return e=new T(2,6,6005,n.message),a.o(e),m.return(Promise.reject(e))}a.C.J(d,"message",function(n){Ap(a)?a.O.push(n):lp(a,n)});a.C.J(d,"keystatuseschange",function(n){return Bp(a,n)});f={initData:c.initData,initDataType:c.initDataType,loaded:!1,gg:Infinity,qb:null,type:"persistent-license",Pd:0,Jh:!1};a.j.set(d,f);m.o(2);return m.h(d.load(b),4);case 4:return g=m.j,So(a.l),
g||(a.j.delete(d),h=a.i.persistentSessionOnlinePlayback?1:2,a.o(new T(h,6,6013)),f.loaded=!0),yp(a,f),xp(a),m.return(d);case 2:k=m.m(),So(a.l,k),a.j.delete(d),l=a.i.persistentSessionOnlinePlayback?1:2,a.o(new T(l,6,6005,k.message)),f.loaded=!0,xp(a);case 3:return m.return(Promise.resolve())}})}
function rp(a,b,c,d,e){e=e===void 0?!1:e;if(a.l.h)return null;try{var f=a.A.createSession(d)}catch(g){return a.o(new T(2,6,6005,g.message)),null}a.C.J(f,"message",function(g){Ap(a)?a.O.push(g):lp(a,g)});a.C.J(f,"keystatuseschange",function(g){return Bp(a,g)});a.j.set(f,{initData:c,initDataType:b,loaded:!1,gg:Infinity,qb:null,type:d,Pd:0,Jh:e});f.closed.then(function(g){if(!a.l.h){var h=a.j.get(f);if(h){var k=f;g=g||"unknown";g!=="unknown"&&(a.j.delete(k),Cp(a,g,h))}}}).catch(function(){});a.i.logLicenseExchange&&
Mb(c);f.generateRequest(b,c).catch(function(g){if(!a.l.h){a.j.delete(f);var h=g.errorCode;if(h&&h.systemCode){var k=h.systemCode;k<0&&(k+=4294967296);k="0x"+k.toString(16)}a.o(new T(2,6,6006,g.message,g,k))}});return f}function Ap(a){return a.u?a.i.delayLicenseRequestUntilPlayed&&a.u.paused&&!a.ia:a.i.delayLicenseRequestUntilPlayed}function Dp(a){return H(function(b){return b.i==1?!a.L||Ap(a)?b.B(0):b.h(a.m.promise,3):b.h(Promise.all(a.W.map(function(c){return c.promise})),0)})}
function lp(a,b){var c,d,e,f,g,h,k,l,m,n,p,t,u,v,w,x,y;H(function(z){switch(z.i){case 1:c=b.target;a.i.logLicenseExchange&&Mb(b.message);d=a.j.get(c);e=a.h.licenseServerUri;f=a.i.advanced[a.h.keySystem];b.messageType=="individualization-request"&&f&&f.individualizationServer&&(e=f.individualizationServer);g=Cj([e],a.i.retryParameters);g.body=b.message;g.method="POST";g.licenseRequestType=b.messageType;g.sessionId=c.sessionId;g.drmInfo=a.h;d&&(g.initData=d.initData,g.initDataType=d.initDataType,d.Jh&&
(g.licenseRequestType="license-renewal"));if(f&&f.headers)for(h in f.headers)g.headers[h]=f.headers[h];if(k=Yb(a.h.keySystem)){var D=g,A=a.h;try{var B=Gb(D.body);if(B){var E=JSON.parse(B);E.type||(E.type=A.sessionType,D.body=Hb(JSON.stringify(E)))}}catch(C){}}if($b(a.h.keySystem))if(D=Eb(g.body,!0,!0),D.includes("PlayReadyKeyMessage")){D=md(D,"PlayReadyKeyMessage");A=xd(D,"HttpHeader");A=r(A);for(B=A.next();!B.done;B=A.next())E=B.value,B=xd(E,"name")[0],E=xd(E,"value")[0],g.headers[vd(B)]=vd(E);D=
xd(D,"Challenge")[0];g.body=Nb(vd(D))}else g.headers["Content-Type"]="text/xml; charset=utf-8";l=Date.now();z.o(2);n=a.F.Dc.request(2,g,{isPreload:a.V()});a.W.push(n);return z.h(n.promise,4);case 4:m=z.j;cb(a.W,n);z.u(3);break;case 2:p=z.m();if(a.l.h)return z.return();t={sessionId:c.sessionId,sessionType:d.type,initData:d.initData,initDataType:d.initDataType};u=new T(2,6,6007,p,t);if(a.i.failureCallback)try{a.i.failureCallback(u)}catch(C){}if(u.handled)return d&&d.qb&&d.qb.reject(u),z.return();a.j.size==
1?(a.o(u),d&&d.qb&&d.qb.reject(u)):(d&&d.qb&&d.qb.reject(u),a.j.delete(c),qp(a)&&(a.m.resolve(),a.N.ka(.1)));return z.return();case 3:if(a.l.h)return z.return();a.K+=(Date.now()-l)/1E3;a.i.logLicenseExchange&&Mb(m.data);k&&Ep(a,m);z.o(5);return z.h(c.update(m.data),7);case 7:d&&(d.Pd=Date.now()/1E3);z.u(6);break;case 5:return w=(v=z.m())&&v.message||String(v),x=new T(2,6,6008,w),a.o(x),d&&d.qb&&d.qb.reject(x),z.return();case 6:if(a.l.h)return z.return();y=new nj("drmsessionupdate");a.F.onEvent(y);
d&&(d.qb&&d.qb.resolve(),yp(a,d));z.l()}})}function Ep(a,b){b=Db(b.data);try{var c=JSON.parse(b),d=new Map(c.keys.map(function(l){var m=l.kid;l=l.k;return[dc(m),dc(l)]}));if(a.h.clearKeys)for(var e=r(d),f=e.next();!f.done;f=e.next()){var g=r(f.value),h=g.next().value,k=g.next().value;a.h.clearKeys.set(h,k)}else a.h.clearKeys=d}catch(l){}}
function Bp(a,b){b=b.target;var c=a.j.get(b),d=!1;b.keyStatuses.forEach(function(f,g){if(typeof g=="string"){var h=g;g=f;f=h}h=R();if($b(a.h.keySystem)&&g.byteLength==16&&h.Ze()){h=zb(g);var k=h.getUint32(0,!0),l=h.getUint16(4,!0),m=h.getUint16(6,!0);h.setUint32(0,k,!1);h.setUint16(4,l,!1);h.setUint16(6,m,!1)}c&&f!="status-pending"&&(c.loaded=!0);f=="expired"&&(d=!0);g=Pb(g).slice(0,32);a.Z.set(g,f)});var e=b.expiration-Date.now();(e<0||d&&e<1E3)&&c&&!c.qb&&(a.j.delete(b),tp(a,b));qp(a)&&(a.m.resolve(),
a.N.ka(Fp))}function Yo(a){var b=a.Z,c=a.ea;c.clear();b.forEach(function(d,e){return c.set(e,d)});b=Array.from(c.values());b.length&&b.every(function(d){return d=="expired"})&&a.o(new T(2,6,6014));a.F.Yh(Wo(c))}
function Gp(){var a,b,c,d,e,f,g,h,k,l,m,n,p,t,u,v,w,x,y,z,D,A,B,E,C,G,K,L;return H(function(N){if(N.i==1){a="org.w3.clearkey com.widevine.alpha com.microsoft.playready com.microsoft.playready.hardware com.microsoft.playready.recommendation com.microsoft.playready.recommendation.3000 com.microsoft.playready.recommendation.3000.clearlead com.chromecast.playready com.apple.fps.1_0 com.apple.fps com.huawei.wiseplay".split(" ");if(!(window.MediaKeys&&window.navigator&&window.navigator.requestMediaKeySystemAccess&&
window.MediaKeySystemAccess&&window.MediaKeySystemAccess.prototype.getConfiguration)){b={};c=r(a);for(d=c.next();!d.done;d=c.next())e=d.value,b[e]=null;return N.return(b)}f="1.0 1.1 1.2 1.3 1.4 2.0 2.1 2.2 2.3".split(" ");g=["SW_SECURE_CRYPTO","SW_SECURE_DECODE","HW_SECURE_CRYPTO","HW_SECURE_DECODE","HW_SECURE_ALL"];h=["150","2000","3000"];k={"com.widevine.alpha":g,"com.widevine.alpha.experiment":g,"com.microsoft.playready.recommendation":h};l=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}];
m=[{contentType:'audio/mp4; codecs="mp4a.40.2"'},{contentType:'audio/webm; codecs="opus"'}];n={videoCapabilities:l,audioCapabilities:m,initDataTypes:["cenc","sinf","skd","keyids"]};p=[null,"cenc","cbcs"];t=new Map;u=R();v=function(J,O,M){var P,U,Q,da,Z,ka,va,Ea,pa,Aa,Va,Ya,vb;return H(function(W){switch(W.i){case 1:return W.o(2),W.h(O.createMediaKeys(),5);case 5:P=W.j;case 4:W.u(3);break;case 2:return W.m(),W.return();case 3:Q=(U=O.getConfiguration().sessionTypes)?U.includes("persistent-license"):
!1;u.Rh()&&(Q=!1);da=O.getConfiguration().videoCapabilities;Z=O.getConfiguration().audioCapabilities;ka={persistentState:Q,encryptionSchemes:[],videoRobustnessLevels:[],audioRobustnessLevels:[],minHdcpVersions:[]};t.get(J)?ka=t.get(J):t.set(J,ka);(va=da[0].encryptionScheme)&&!ka.encryptionSchemes.includes(va)&&ka.encryptionSchemes.push(va);(Ea=da[0].robustness)&&!ka.videoRobustnessLevels.includes(Ea)&&ka.videoRobustnessLevels.push(Ea);(pa=Z[0].robustness)&&!ka.audioRobustnessLevels.includes(pa)&&
ka.audioRobustnessLevels.push(pa);if(!(M&&"getStatusForPolicy"in P)){W.B(0);break}Aa=r(f);Va=Aa.next();case 7:if(Va.done){W.B(0);break}Ya=Va.value;if(ka.minHdcpVersions.includes(Ya)){W.B(8);break}return W.h(P.getStatusForPolicy({minHdcpVersion:Ya}),10);case 10:if(vb=W.j,vb=="usable")ka.minHdcpVersions.includes(Ya)||ka.minHdcpVersions.push(Ya);else{W.B(0);break}case 8:Va=Aa.next(),W.B(7)}})};w=function(J,O,M,P,U){U=U===void 0?!1:U;var Q,da,Z,ka,va,Ea,pa,Aa,Va,Ya,vb;return H(function(W){switch(W.i){case 1:W.o(2);
Q=id(n);da=r(Q.videoCapabilities);for(Z=da.next();!Z.done;Z=da.next())ka=Z.value,ka.encryptionScheme=O,ka.robustness=M;va=r(Q.audioCapabilities);for(Ea=va.next();!Ea.done;Ea=va.next())pa=Ea.value,pa.encryptionScheme=O,pa.robustness=P;Aa=id(Q);Aa.persistentState="required";Aa.sessionTypes=["persistent-license"];Va=[Aa,Q];vb=R();return vb.Ia()=="MOBILE"?W.h(lf(5,navigator.requestMediaKeySystemAccess(J,Va)),7):W.h(navigator.requestMediaKeySystemAccess(J,Va),6);case 6:Ya=W.j;W.B(5);break;case 7:Ya=W.j;
case 5:return W.h(v(J,Ya,U),8);case 8:W.u(0);break;case 2:W.m(),W.l()}})};x=[];y=r(a);for(z=y.next();!z.done;z=y.next()){D=z.value;t.set(D,null);A=!0;B=r(p);for(E=B.next();!E.done;E=B.next())C=E.value,x.push(w(D,C,"","",A)),A=!1;G=r(k[D]||[]);for(K=G.next();!K.done;K=G.next())L=K.value,x.push(w(D,null,L,"")),x.push(w(D,null,"",L))}return N.h(Promise.all(x),2)}return N.return(Wo(t))})}
function tp(a,b){var c,d;return H(function(e){switch(e.i){case 1:return c=null,e.o(2),e.h(lf(Hp,Promise.all([b.close().catch(function(){}),b.closed])),4);case 4:d=e.j;c=d[1];e.u(3);break;case 2:e.m();case 3:c&&c!=="unknown"&&Cp(a,c),e.l()}})}
function Cp(a,b,c){if(b==="internal-error")a.o(new T(2,6,6005,"CDM reported internal error"));else if(b!=="closed-by-application"&&b!=="release-acknowledged"&&b!=="resource-evicted"&&b==="hardware-context-reset"&&c)if(c.initDataType&&c.initData)try{rp(a,c.initDataType,c.initData,c.type)}catch(d){a.o(new T(2,6,6005,"Failed to recreate session after hardware context reset: "+d.message))}else a.o(new T(2,6,6005,"Cannot recreate session after hardware reset: missing metadata"))}
function ap(a){var b;return H(function(c){b=Array.from(a.j.entries());a.j.clear();return c.h(Promise.all(b.map(function(d){d=r(d);var e=d.next().value;var f=d.next().value;return H(function(g){if(g.i==1)return g.o(2),a.D.has(e.sessionId)||f.type!=="persistent-license"||a.i.persistentSessionOnlinePlayback?g.h(tp(a,e),5):g.h(e.remove(),5);if(g.i!=2)return g.u(0);g.m();g.l()})})),0)})}function fp(a){return(a.video?a.video.drmInfos:[]).concat(a.audio?a.audio.drmInfos:[])}
function Zo(a){var b=Date.now()/1E3;a.j.forEach(function(c,d){var e=c.gg,f=d.expiration;isNaN(f)&&(f=Infinity);f!=e&&(a.F.onExpirationUpdated(d.sessionId,f),c.gg=f);a.i.renewalIntervalSec>0&&(e=b-c.Pd,c.Pd>0&&e>=a.i.renewalIntervalSec&&sp(a,d))})}
function sp(a,b){var c,d,e,f,g,h,k,l;H(function(m){switch(m.i){case 1:if(c=a.j.get(b))c.Pd=Date.now()/1E3;if(!a.h)return m.return();d=a.h.keySystem;e=b;f={sessionId:b.sessionId,sessionType:a.h.sessionType,initData:c?c.initData:null,initDataType:c?c.initDataType:null};m.o(2);return ac(d)?(g=Hb("renew"),m.h(b.update(g),5)):$b(d)&&c&&c.initData&&c.initDataType?m.h(Ip(a,b,c),7):(Ua("Manual license renewal is not supported for "+d),m.return());case 7:e=m.j;m.B(5);break;case 5:m.u(3);break;case 2:return m.m(),
m.return();case 3:h=a.j.get(e),k={sessionId:e.sessionId,sessionType:a.h.sessionType,initData:h?h.initData:null,initDataType:h?h.initDataType:null},l=new nj("licenserenewal",(new Map).set("oldSessionMetadata",f).set("newSessionMetadata",k)),a.F.onEvent(l),m.l()}})}
function Ip(a,b,c){var d;return H(function(e){if(e.i==1)return a.j.delete(b),e.h(tp(a,b),2);d=rp(a,c.initDataType,c.initData,a.h.sessionType,!0);if(!d)throw new T(2,6,6005,"Failed to create new session for renewal");return e.return(d)})}function qp(a){a=a.j.values();return Uo(a,function(b){return b.loaded})}function pp(a){for(var b=r(a.h&&a.h.keyIds||new Set([])),c=b.next();!c.done;c=b.next())if(a.Z.get(c.value)!=="usable")return!1;return!0}
function ep(a,b){var c=[];b.forEach(function(d,e){c.push({keySystem:e,licenseServerUri:d,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",initData:[],keyIds:new Set})});a=r(a);for(b=a.next();!b.done;b=a.next())b=b.value,b.video&&(b.video.drmInfos=c),b.audio&&(b.audio.drmInfos=c)}
function wp(a,b,c){var d=[],e=[],f=[],g=[],h=[],k=new Set,l=new Set;Jp(c,d,e,g,f,h,k,l);a=a.$?"persistent-license":"temporary";b={keySystem:b,encryptionScheme:d[0],licenseServerUri:e[0],distinctiveIdentifierRequired:c[0].distinctiveIdentifierRequired,persistentStateRequired:c[0].persistentStateRequired,sessionType:c[0].sessionType||a,audioRobustness:c[0].audioRobustness||"",videoRobustness:c[0].videoRobustness||"",serverCertificate:g[0],serverCertificateUri:f[0],initData:h,keyIds:k,mediaTypes:c[0].mediaTypes};
l.size>0&&(b.keySystemUris=l);c=r(c);for(l=c.next();!l.done;l=c.next())l=l.value,l.distinctiveIdentifierRequired&&(b.distinctiveIdentifierRequired=l.distinctiveIdentifierRequired),l.persistentStateRequired&&(b.persistentStateRequired=l.persistentStateRequired);return b}
function Jp(a,b,c,d,e,f,g,h){var k=[];a=r(a);for(var l=a.next(),m={};!l.done;m={Ha:void 0},l=a.next()){m.Ha=l.value;b.includes(m.Ha.encryptionScheme)||b.push(m.Ha.encryptionScheme);Yb(m.Ha.keySystem)&&m.Ha.licenseServerUri.startsWith("data:application/json;base64,")?k.includes(m.Ha.licenseServerUri)||k.push(m.Ha.licenseServerUri):c.includes(m.Ha.licenseServerUri)||c.push(m.Ha.licenseServerUri);e.includes(m.Ha.serverCertificateUri)||e.push(m.Ha.serverCertificateUri);m.Ha.serverCertificate&&(d.some(function(t){return function(u){return tb(u,
t.Ha.serverCertificate)}}(m))||d.push(m.Ha.serverCertificate));if(m.Ha.initData){l=r(m.Ha.initData);for(var n=l.next(),p={};!n.done;p={Uf:void 0},n=l.next())p.Uf=n.value,f.some(function(t){return function(u){var v=t.Uf;return u.keyId&&u.keyId==v.keyId?!0:u.initDataType==v.initDataType&&tb(u.initData,v.initData)}}(p))||f.push(p.Uf)}if(m.Ha.keyIds)for(l=r(m.Ha.keyIds),n=l.next();!n.done;n=l.next())g.add(n.value);if(m.Ha.keySystemUris&&h)for(m=r(m.Ha.keySystemUris),l=m.next();!l.done;l=m.next())h.add(l.value)}if(k.length==
1)c.push(k[0]);else if(k.length>0){b=[];k=r(k);for(d=k.next();!d.done;d=k.next())d=window.atob(d.value.split("data:application/json;base64,").pop()),d=JSON.parse(d),b.push.apply(b,F(d.keys));k=JSON.stringify({keys:b});c.push("data:application/json;base64,"+window.btoa(k))}}
function gp(a,b,c,d){var e=a.keySystem;if(e&&(!Yb(e)||!Ub(a))){b.size&&b.get(e)&&(b=b.get(e),a.licenseServerUri=b);a.keyIds||(a.keyIds=new Set);if(c=c.get(e))a.distinctiveIdentifierRequired||(a.distinctiveIdentifierRequired=c.distinctiveIdentifierRequired),a.persistentStateRequired||(a.persistentStateRequired=c.persistentStateRequired),a.serverCertificate||(a.serverCertificate=c.serverCertificate),c.sessionType&&(a.sessionType=c.sessionType),a.serverCertificateUri||(a.serverCertificateUri=c.serverCertificateUri);
d[e]&&(a.keySystem=d[e]);window.cast&&window.cast.__platform__&&e=="com.microsoft.playready"&&(a.keySystem="com.chromecast.playready")}}function dp(a,b){a=Vo(a);if(a.size!=0){a=sc(a);b=r(b);for(var c=b.next();!c.done;c=b.next())c=c.value,c.video&&(c.video.drmInfos=[a]),c.audio&&(c.audio.drmInfos=[a])}}var Hp=1,zp=5,Fp=.5;function $p(){this.h=aq;this.l=(new Map).set(aq,2).set(bq,1);this.j=0;this.i=-1}function cq(a,b){var c=a.h!==b;a.h=b;c&&b===aq&&(a.j=Date.now());return c}var bq=0,aq=1;function dq(){this.i=null;this.l=new Map;this.j=this.h=null}function eq(a,b,c,d){var e;return H(function(f){if(f.i==1){e=S(b);if(c)return a.j=e,f.return(fq(e));if(!a.j)return f.return(e);if(a.i===d)return f.B(2);a.i=d;a.h=gq(a.i);return f.h(a.h,3)}f.i!=2&&(a.l=f.j,a.h=null);return f.return(hq(a,e,a.j))})}
dq.prototype.destroy=function(){var a=this;return H(function(b){switch(b.i){case 1:if(!a.h){b.B(2);break}b.o(3);return b.h(a.h,5);case 5:b.u(2);break;case 3:b.m();case 2:a.i=null,a.l.clear(),a.h=null,a.j=null,b.l()}})};
function gq(a){var b,c,d,e,f,g,h,k,l;return H(function(m){if(m.i==1)return b=new Map,a.clearKeys?m.h(Promise.all([].concat(F(a.clearKeys.entries())).map(function(n){var p=r(n);n=p.next().value;p=p.next().value;p=Nb(p);var t=Nb(n);return Promise.all([crypto.subtle.importKey("raw",p,{name:"AES-CBC"},!1,["decrypt","encrypt"]),crypto.subtle.importKey("raw",p,{name:"AES-CTR"},!1,["decrypt"])]).then(function(u){var v=r(u);u=v.next().value;v=v.next().value;return{kk:Pb(t),Bf:u,se:v}})})),2):m.return(b);
c=m.j;d=r(c);for(e=d.next();!e.done;e=d.next())g=f=e.value,h=g.kk,k=g.Bf,l=g.se,b.set(h,{Bf:k,se:l});return m.return(b)})}function hq(a,b,c){var d,e,f,g,h;return H(function(k){if(k.i==1)return d=iq(c),e=jq(b,d),f=e.qj.map(function(l){var m=d.get(l.trackId)||d.values().next().value;return kq(a,l,b,m)}),k.h(Promise.all(f),2);g=k.j;h=[b.slice(0,e.oj)].concat(F(g));return k.return(Qb.apply(Kb,F(h)))})}
function fq(a){function b(h){e.push(function(){d.setUint32(h.start+4,1718773093,!1);c.fill(0,h.start+8,h.start+h.size)})}var c=S(a).slice(),d=zb(c),e=[],f=-1;(new ih).ma(wh,nh).S("stsd",sh).box("encv",function(h){f=h.start;th(h)}).box("enca",function(h){f=h.start;uh(h)}).box("sinf",function(h){b(h);nh(h)}).box("frma",function(h){var k=Ih(h.reader).codec,l=f;l!==-1&&k&&e.push(function(){for(var m=0;m<4;++m)d.setUint8(l+4+m,k.charCodeAt(m))})}).S("sgpd",b).box("pssh",b).parse(c,!0);a=r(e);for(var g=
a.next();!g.done;g=a.next())g=g.value,g();return c}
function iq(a){var b=new Map,c=0;(new ih).ma(["moov","mdia","minf","stbl"],nh).box("trak",function(d){c=0;nh(d)}).S("tkhd",function(d){c=Hh(d.reader,d.version).trackId;b.getOrInsert(c,{defaultKID:"",encryptionScheme:"cenc",Hd:8,Yb:null,ve:0,we:0})}).S("stsd",sh).box("encv",th).box("enca",uh).box("sinf",nh).S("schm",function(d){d=mh(d.reader.R());var e=b.get(c);e&&(e.encryptionScheme=d.toLowerCase())}).box("schi",nh).S("tenc",function(d){d=Jh(d.reader,d.version);var e=b.get(c);e&&(e.defaultKID=d.defaultKID,
e.Hd=d.ij,e.Yb=d.Yb,e.ve=d.ve,e.we=d.we)}).parse(a,!0);return b}
function jq(a,b){function c(g){f&&f.Af.push({start:g.start,size:g.size})}var d=[],e=0,f=null;(new ih).box("moof",function(g){d.length||(e=g.start);f={cd:g.start,Sh:g.size,$f:-1,Zf:-1,ni:null,Li:0,trackId:0,Ni:[],Af:[]};nh(g)}).box("traf",nh).S("tfhd",function(g){f&&(g=Dh(g.reader,g.flags),f.trackId=g.trackId,f.Li=g.$b||0)}).S("trun",function(g){if(f){g=Gh(g.reader,g.version,g.flags);g=r(g.Fc);for(var h=g.next();!h.done;h=g.next())f.Ni.push({size:h.value.sampleSize||f.Li})}}).S("senc",function(g){if(f){var h=
b.get(f.trackId);h&&(f.ni=Lh(g.reader,g.flags,h.Hd,h.Yb));c(g)}}).nh(["saiz","saio","sgpd","sbgp"],c).box("pssh",c).box("mdat",function(g){f&&(f.$f=g.start,f.Zf=g.size,d.push(f),f=null)}).parse(a);return{qj:d,oj:e}}
function kq(a,b,c,d){var e,f,g,h,k,l,m,n,p,t,u,v,w,x,y,z;return H(function(D){if(D.i==1){e=d.defaultKID;f=a.l.get(e);if(!f)return D.return(c.slice(b.cd,b.$f+b.Zf));g=d.encryptionScheme;(h=b.ni)&&d.Hd!==8&&(k=c.subarray(b.cd,b.cd+b.Sh),(new ih).ma(xh,nh).S("senc",function(A){h=Lh(A.reader,A.flags,d.Hd,d.Yb)}).parse(k,!1));l=b.$f+8;m=c.subarray(l,l+b.Zf-8);return D.h(lq(m,b.Ni.map(function(A){return A.size}),h,d,f,g),2)}n=D.j;p=c.slice(b.cd,b.cd+b.Sh);t=zb(p);if(b.Af)for(u=r(b.Af),v=u.next();!v.done;v=
u.next())w=v.value,x=w.start-b.cd,x>=0&&x+w.size<=p.byteLength&&(t.setUint32(x+4,1718773093,!1),p.fill(0,x+8,x+w.size));y=8+n.byteLength;z=new Uint8Array(y);zb(z).setUint32(0,y,!1);z.set([109,100,97,116],4);z.set(n,8);return D.return(Qb(p,z))})}
function lq(a,b,c,d,e,f){var g,h,k,l,m,n,p,t,u,v;return H(function(w){if(w.i==1)return g=new Uint8Array(a.byteLength),h=0,k=b.map(function(x,y){var z=h;h+=x;x=a.subarray(z,z+x);if(c&&c.li[y]){y=c.li[y];var D=d.Hd===16?16:8,A=new Uint8Array(16);A.set(y.iv.slice(0,D),0);return f==="cenc"?mq(x,A,y.Ii,e).then(function(B){return{offset:z,ue:B}}):nq(x,d.Yb||A,y.Ii,d,e).then(function(B){return{offset:z,ue:B}})}return f==="cbcs"&&d.Yb?nq(x,d.Yb,null,d,e).then(function(B){return{offset:z,ue:B}}):Promise.resolve({offset:z,
ue:x})}),w.h(Promise.all(k),2);l=w.j;m=r(l);for(n=m.next();!n.done;n=m.next())t=p=n.value,u=t.offset,v=t.ue,g.set(v,u);return w.return(g)})}
function mq(a,b,c,d){var e,f,g,h,k,l,m,n,p,t;return H(function(u){switch(u.i){case 1:if(c&&c.length){u.B(2);break}e=sb;f=S;return u.h(crypto.subtle.decrypt({name:"AES-CTR",counter:b,length:64},d.se,a),3);case 3:return u.return(f.call(e,u.j));case 2:return g=new Uint8Array(a.byteLength),k=h=0,l=c.map(function(v){var w=h;h+=v.Ed;if(v.bc===0)return Promise.resolve({pe:w,$g:v.Ed,ih:h,lj:0,Hf:null});var x=b.slice();oq(x,k);var y=h;h+=v.bc;k+=Math.ceil(v.bc/16);return crypto.subtle.decrypt({name:"AES-CTR",
counter:x,length:64},d.se,a.subarray(y,y+v.bc)).then(function(z){return{pe:w,$g:v.Ed,ih:y,lj:v.bc,Hf:S(z)}})}),u.h(Promise.all(l),4);case 4:m=u.j;n=r(m);for(p=n.next();!p.done;p=n.next())t=p.value,g.set(a.subarray(t.pe,t.pe+t.$g),t.pe),t.Hf&&g.set(t.Hf,t.ih);return u.return(g)}})}
function nq(a,b,c,d,e){var f,g,h,k,l,m,n,p,t,u,v;return H(function(w){if(w.i==1){f=d.ve;g=d.we;f===0&&(f=1,g=0);h=new Uint8Array(a.byteLength);k=[];l=function(x,y){var z=b,D=x;x+=y;for(y={};D<x;y={Vc:void 0,Ue:void 0,oe:void 0}){var A=Math.min(f*16,x-D);if(A>=16){var B=Math.floor(A/16)*16;y.Vc=D;y.Ue=A-B;y.oe=D+B;k.push(pq(a.subarray(y.Vc,y.Vc+B),z,e.Bf).then(function(E){return function(C){h.set(C,E.Vc);E.Ue>0&&h.set(a.subarray(E.oe,E.oe+E.Ue),E.oe)}}(y)));z=a.slice(y.Vc+B-16,y.Vc+B);D+=B+y.Ue}else h.set(a.subarray(D,
D+A),D),D+=A;y=Math.min(g*16,x-D);y>0&&(h.set(a.subarray(D,D+y),D),D+=y)}};if(c&&c.length)for(m=0,n=r(c),p=n.next();!p.done;p=n.next())t=p.value,u=m,m+=t.Ed,h.set(a.subarray(u,u+t.Ed),u),t.bc>0&&(v=m,m+=t.bc,l(v,t.bc));else l(0,a.byteLength);return w.h(Promise.all(k),2)}return w.return(h)})}
function pq(a,b,c){var d,e,f,g,h,k,l,m;return H(function(n){if(n.i==1){if(!a||!a.byteLength||a.byteLength%16!==0)return n.return(new Uint8Array(0));d=a.byteLength/16;e=a.subarray((d-1)*16,d*16);f=e.map(function(p){return 16^p});g=new Uint8Array(16);return n.h(crypto.subtle.encrypt({name:"AES-CBC",iv:g},c,f),2)}if(n.i!=3)return h=n.j,k=new Uint8Array(h,0,16),l=new Uint8Array(a.byteLength+16),l.set(a,0),l.set(k,a.byteLength),n.h(crypto.subtle.decrypt({name:"AES-CBC",iv:b},c,l),3);m=n.j;return n.return(S(m))})}
function oq(a,b){for(var c=15;c>=8&&b>0;c--)b+=a[c],a[c]=b&255,b>>>=8}function qq(a){if(!a)return!1;var b;return(b=window.crypto)!=null&&b.subtle&&Yb(a.keySystem)?!R().Ah():!1};function rq(a){var b=[];if(!(a.encrypted&&a.drmInfos.length>0))return new Uint8Array([]);a=r(a.drmInfos);for(var c=a.next();!c.done;c=a.next())if(c=c.value,c.initData){c=r(c.initData);for(var d=c.next();!d.done;d=c.next())b.push(d.value.initData)}return Qb.apply(Kb,F(b))}function sq(a,b,c){a[c]=b>>>24&255;a[c+1]=b>>>16&255;a[c+2]=b>>>8&255;a[c+3]=b&255}function tq(a){for(var b=0,c=0;c<a.length;c+=1)b|=a.charCodeAt(c)<<(a.length-c-1)*8;return b}
function uq(a){for(var b=Ha.apply(1,arguments),c=0,d=r(b),e=d.next();!e.done;e=d.next())c+=e.value.byteLength;c=vq(a,c);d=8;for(e=0;e<b.length;e++)c.set(b[e],d),d+=b[e].byteLength;return c}function vq(a,b){var c=wq.get(a);c||(c=[a.charCodeAt(0),a.charCodeAt(1),a.charCodeAt(2),a.charCodeAt(3)],wq.set(a,c));a=8+b;b=new Uint8Array(a);b[0]=a>>24&255;b[1]=a>>16&255;b[2]=a>>8&255;b[3]=a&255;b.set(c,4);return b}
var wq=new Map,xq=new ob(function(){return new Uint8Array([0,0,0,0,0,0,1,8])}),yq=new ob(function(){return new Uint8Array([0,0,0,0,0,0,0,0,0,1,0,0])});function zq(a){a=S(a);var b=null;(new ih).ma(wh,nh).S("stsd",sh).box("enca",function(c){b=c.reader.i;return uh(c)}).box("sinf",nh).box("frma",function(c){c.parser.stop();Ih(c.reader).codec==="ec-3"&&b&&b.getUint16(16)!==2&&b.setUint16(16,2)}).parse(a);return a}function Aq(a){a=S(a);var b=null,c=-1;(new ih).ma(wh,nh).S("stsd",sh).ma(["encv","hvc1"],function(d){b=d.reader.i;c=d.start;return th(d)}).box("dvvC",function(d){d.parser.stop();b.setUint32(d.start-c-4,1718773093)}).parse(a);return a}
function Bq(a,b,c,d){var e=b=S(b),f=!1,g,h=[],k=[];(new ih).ma(wh,function(m){h.push(m);nh(m)}).S("stsd",function(m){g=m;h.push(m);sh(m)}).ma(["encv","enca"],function(m){f=!0;m.parser.stop()}).ma(Ah,function(m){k.push({box:m,Uh:1701733238})}).ma([].concat(F(Bh),["mp4a"]),function(m){k.push({box:m,Uh:1701733217})}).parse(b);if(f)return b;if(k.length==0||!g)throw ab(Pb(b)),new T(2,3,3019,c);k.reverse();c=r(k);for(var l=c.next();!l.done;l=c.next())l=l.value,e=Cq(a,e,g,l.box,h,l.Uh,d);e=Dq(a,e);return R().sg(d)?
(a=new Uint8Array(b.byteLength+e.byteLength),a.set(e),a.set(b,e.byteLength),a):e}function Eq(a){a=S(a);var b=[];(new ih).box("mdat",function(g){b.push(g)}).parse(a);for(var c=[],d=0;d<b.length;d++){var e=b[d-1],f=b[d];c.push(Fq(a.subarray(e?e.start+e.size:0,f.start+f.size)))}return Qb.apply(Kb,F(c))}
function Fq(a){var b,c,d,e,f=[];(new ih).ma(xh,function(m){f.push(m);nh(m)}).S("tfhd",function(m){b=m;d=Dh(m.reader,m.flags)}).S("trun",function(m){c=m;e=Gh(m.reader,m.version,m.flags)}).parse(a);if(d&&d.zg!==2){var g=b.start+oh(b)+4+(d.Vg!==null?8:0),h=zb(a);if(d.zg!==null)h.setUint32(g,2);else{Gq(a,b.start,b.size+4);var k=h.getUint32(b.start+8);h.setUint32(b.start+8,k|2);e&&e.Xb!==null&&h.setInt32(c.start+oh(c)+4,e.Xb+4);k=a.subarray(0,g);h=a.subarray(g);a=new Uint8Array(a.byteLength+4);a.set(k);
k=[];for(var l=3;l>=0;l--)k.push(2>>8*l&255);a.set(new Uint8Array(k),g);a.set(h,g+4);g=r(f);for(h=g.next();!h.done;h=g.next())h=h.value,Gq(a,h.start,h.size+4)}}return a}
function Cq(a,b,c,d,e,f,g){var h=d.name.split(".")[0];var k=vq("frma",4);sq(k,tq(h),8);h="cenc";var l=a.drmInfos[0];l&&l.encryptionScheme&&(h=l.encryptionScheme);l=yq.value();sq(l,tq(h),4);h=uq("schm",l);l=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);a=r(a.drmInfos);for(var m=a.next();!m.done;m=a.next())if((m=m.value)&&m.keyIds&&m.keyIds.size){m=r(m.keyIds);for(var n=m.next();!n.done;n=m.next()){l=n.value;n=new Uint8Array(l.length/2);for(var p=0;p<l.length/2;p+=1)n[p]=parseInt(String(l[p*2]+
l[p*2+1]),16);l=n}}a=uq("tenc",xq.value(),l);a=uq("schi",a);h=uq("sinf",k,h,a);a=b.subarray(d.start,d.start+d.size);k=new Uint8Array(d.size+h.byteLength);k.set(a,0);zb(k).setUint32(4,f);k.set(h,d.size);Gq(k,0,k.byteLength);f=new Uint8Array(b.byteLength+k.byteLength);d=R().Ge(g)?d.start:d.start+d.size;g=b.subarray(d);f.set(b.subarray(0,d));f.set(k,d);f.set(g,d+k.byteLength);b=r(e);for(e=b.next();!e.done;e=b.next())e=e.value,Gq(f,e.start,e.size+k.byteLength);b=zb(f,c.start);c=oh(c);e=b.getUint32(c);
b.setUint32(c,e+1);return f}function Dq(a,b){a=rq(a);if(a.byteLength===0)return b;var c=0,d=0;(new ih).box("moov",function(h){c=h.start;d=h.size;h.parser.stop()}).parse(b);var e=c+d;Gq(b,c,d+a.byteLength);var f=new Uint8Array(b.byteLength+a.byteLength),g=b.subarray(e);f.set(b.subarray(0,e));f.set(a,e);f.set(g,e+a.byteLength);return f}function Gq(a,b,c){a=zb(a,b);b=a.getUint32(0);b!=0&&(b==1?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))}
function Hq(a){var b=S(a),c=[];(new ih).ma(wh,function(d){c.push({start:d.start,size:d.size});nh(d)}).box("stsd",function(d){c.push({start:d.start,size:d.size});for(var e=zb(b,d.start),f=0;f<d.size-3;f++){var g=e.getUint32(f);g==1633889587?e.setUint32(f,1700998451):g==1684103987&&e.setUint32(f,1684366131)}}).parse(b);return b}
function Iq(a){a=S(a);var b=[],c=[],d=[],e=[],f=!1;(new ih).box("moof",function(B){b.push(B);nh(B)}).box("traf",function(B){c.push(B);nh(B)}).S("tfhd",function(B){d.push(B)}).S("trun",function(B){e.push(B)}).ma(["senc","saiz","saio"],function(){f=!0}).parse(a,!1,!0);if(f||b.length!=1||c.length!=1||d.length!=1||e.length!=1)return a;var g=b[0],h=c[0],k=d[0],l=e[0],m=l.flags,n=Dh(k.reader,k.flags),p=Gh(l.reader,l.version,l.flags);if(n.Vg!=null||!(m&1)||p.Xb==null)return a;var t=g.start+g.size,u=zb(a);
if(t+8>a.byteLength||u.getUint32(t+4)!=1835295092)return a;u=u.getUint32(t);if(u==1)return a;u==0&&(u=a.byteLength-t);var v=a.byteLength-(t+8);if(v>=u-8)return a;for(var w=u=0,x=r(p.Fc),y=x.next();!y.done;y=x.next()){y=y.value;y=y.sampleSize!=null?y.sampleSize:n.$b;if(y==null)return a;if(u+y>v)break;u+=y;w++}if(w!=1||w>=p.sampleCount)return a;x=(m&256)!=0;v=0;y=r(p.Fc);for(var z=y.next();!z.done;z=y.next()){z=z.value;z=x?z.Gc:n.Zb;if(z==null)return a;v+=z}y=oh(l);z=l.start+y+4;z+=4;m&4&&(z+=4);var D=
0;m&256&&(D+=4);m&512&&(D+=4);m&1024&&(D+=4);m&2048&&(D+=4);m=(p.sampleCount-w)*D;D=z+w*D;if(D+m!=t)return a;D=a.slice(0,D);var A=zb(D);A.setUint32(l.start+y,w);A.setInt32(l.start+y+4,p.Xb-m);x?A.setUint32(z,v):(k=k.start+oh(k)+4,n.zg!=null&&(k+=4),A.setUint32(k,v));Gq(D,l.start,l.size-m);Gq(D,h.start,h.size-m);Gq(D,g.start,g.size-m);g=a.slice(t,t+8);Gq(g,0,8+u);return Qb(D,g,a.subarray(t+8,t+8+u))};function Jq(a){return a.length==1&&a.end(0)-a.start(0)<1E-4}function Kq(a){return!a||Jq(a)?null:a.length==1&&a.start(0)<0?0:a.length?a.start(0):null}function Lq(a){return!a||Jq(a)?null:a.length?a.end(a.length-1):null}function Mq(a,b){return!a||!a.length||Jq(a)||b>a.end(a.length-1)?!1:b>=a.start(0)}function Nq(a,b){if(!a||!a.length||Jq(a))return 0;var c=0;a=r(Oq(a));for(var d=a.next();!d.done;d=a.next()){var e=d.value;d=e.start;e=e.end;e>b&&(c+=e-Math.max(d,b))}return c}
function Pq(a,b){if(!a||!a.length||Jq(a))return 0;var c=0;a=r(Oq(a));for(var d=a.next();!d.done;d=a.next()){var e=d.value;d=e.start;e=e.end;d<b&&(c+=Math.min(e,b)-d)}return c}function Qq(a,b,c){if(!a||!a.length||Jq(a))return null;a=Oq(a).findIndex(function(d,e,f){return d.start>b&&(e==0||f[e-1].end-b<=c)});return a>=0?a:null}function Oq(a){if(!a)return[];for(var b=[],c=0;c<a.length;c++)b.push({start:a.start(c),end:a.end(c)});return b};function Rq(a,b,c,d,e,f){var g=this;this.A=d;this.I=e||function(){return a.playbackRate};this.K=f||function(){return[]};this.h=a;this.F=b;this.i=c;this.m=new ib;this.u=!1;this.o=0;this.D=!1;this.H=this.G=0;this.l=Sq(this);this.C=!1;this.m.J(a,"waiting",function(){return Tq(g)});this.j=(new gf(function(){Tq(g)})).Ka(this.i.gapJumpTimerTime)}
Rq.prototype.release=function(){this.m&&(this.m.release(),this.m=null);this.j!=null&&(this.j.stop(),this.j=null);this.l&&(this.l.release(),this.l=null);this.h=this.F=this.A=null};Rq.prototype.dd=function(){this.C=!0;this.j&&this.j.Ka(this.i.gapJumpTimerTime);Tq(this)};
function Tq(a){if(a.h.readyState!=0){if(a.h.seeking){if(!a.u)return}else a.u=!1;if(!a.h.paused||a.h.currentTime==a.o&&(a.h.autoplay||a.h.currentTime!=a.o))if(!a.l||!Uq(a.l)){var b=a.h.currentTime,c=a.h.buffered,d=a.i.gapDetectionThreshold;if(!(a.I()<0)){d=Qq(c,b,d);if(d==null&&a.l&&!Uq(a.l))for(var e=Oq(c),f=0;f<e.length-1;f++)if(Math.abs(b-e[f].end)<.1&&e[f+1].start>e[f].end){d=f+1;break}if(d!=null&&(d!=0||a.C)){if(d>0){var g=c.end(d-1);if(a.K().some(function(h){return g>=h.start-.1&&g<h.end})&&
g-b>.1)return}e=c.start(d);(f=a.i.gapPadding)&&(e=Math.ceil((e+f)*100)/100);f=a.F.ob();e>=f||e-b<.001||(d==0||Za(c.end(d-1)),Vq(a,e),b==a.o&&(a.o=e),a.G++,a.A(new nj("gapjumped")))}}}}}function Vq(a,b){a.D=!0;a.m.Ma(a.h,"seeked",function(){a.D=!1});a.h.currentTime=b}
function Sq(a){if(!a.i.stallEnabled)return null;var b=a.i.stallThreshold,c=a.i.stallSkip;return new Wq(new Xq(a.h),b,function(d,e,f){var g;return H(function(h){if(h.i==1)return g=Oq(a.h.buffered),g.length?c?(a.h.currentTime+=c,h.B(2)):h.h(a.h.play(),3):h.return();if(h.i!=2){if(!a.h)return h.return();a.h.pause();a.h.play()}f==0&&(a.H++,a.A(new nj("stalldetected")));h.l()})})}function Wq(a,b,c){this.j=a;this.A=Yq(a);this.i=a.h.currentTime;this.o=Date.now()/1E3;this.m=this.h=0;this.u=b;this.l=c}
Wq.prototype.release=function(){this.j&&this.j.release();this.l=this.j=null};function Uq(a){var b=a.j,c=Yq(b),d=b.h.currentTime,e=Date.now()/1E3;if(a.i!=d||a.A!=c)a.o=e,a.i=d,a.A=c,a.h=0;d=e-a.o;if(c=d>=a.u&&c&&a.h<3&&(a.h==0||e-a.m>=a.u))a.l&&a.l(a.i,d,a.h),a.h++,a.m=e,a.i=b.h.currentTime;return c}
function Xq(a){var b=this;this.h=a;this.i=new ib;this.j=!1;this.i.J(this.h,"audiofocuspaused",function(){b.j=!0});this.i.J(this.h,"audiofocusgranted",function(){b.j=!1});this.i.J(this.h,"audiofocuslost",function(){b.j=!0})}function Yq(a){if(a.h.paused||a.h.playbackRate==0||a.j||a.h.buffered.length==0)var b=!1;else a:{b=a.h.currentTime;a=r(Oq(a.h.buffered));for(var c=a.next();!c.done;c=a.next())if(c=c.value,!(b<c.start-.1||b>c.end-.5)){b=!0;break a}b=!1}return b}
Xq.prototype.release=function(){this.i&&this.i.release();this.i=null};function Zq(a,b,c){this.i=a;this.j=b;this.h=c}
function $q(a,b){var c,d,e;return H(function(f){if(f.i==1)return f.h(rf(a.h,b,a.i.drm.preferredKeySystems,a.i.drm.keySystemsMapping),2);a.i.streaming.dontChooseCodecs||(c=a.i.preferredVideo.map(function(g){return g.codec}).filter(Boolean),d=a.i.preferredAudio.map(function(g){return g.codec}).filter(Boolean),e=a.i.preferredText.map(function(g){return g.format}).filter(Boolean),of(b,c,d,a.i.preferredDecodingAttributes,e));if(!b.variants.some(Rf))throw new T(2,4,4032);return f.return(ar(a,b))})}
function br(a,b){var c=a.i.restrictions;a=a.j;var d=!1;b=r(b.variants);for(var e=b.next();!e.done;e=b.next()){e=e.value;var f=e.allowedByApplication;e.allowedByApplication=qf(e,c,a);f!=e.allowedByApplication&&(d=!0)}return d}
function ar(a,b){var c=br(a,b);if(b){var d=a.h?a.h.Nb():null;if(d&&a.h.A){for(var e=new Set,f=r(b.variants),g=f.next();!g.done;g=f.next())g=g.value,g.audio&&e.add(g.audio),g.video&&e.add(g.video);e=r(e);for(f=e.next();!f.done;f=e.next())cr(a,d.keySystem,f.value)}dr(a,b)}return c}
function cr(a,b,c){c=r(c.drmInfos);for(var d=c.next();!d.done;d=c.next())if(d=d.value,d.keySystem==b){for(var e=r(d.initData||[]),f=e.next();!f.done;f=e.next())f=f.value,kp(a.h,f.initDataType,f.initData);e=a.h;e.h&&(e.h.mediaTypes!==d.mediaTypes&&(e.h.mediaTypes=d.mediaTypes),Ub(d)&&(e.h=wp(e,e.h.keySystem,[e.h,d])))}}
function dr(a,b){function c(l){if(l&&!h.has(l)&&(h.add(l),l.keyIds.size)){l=r(l.keyIds);for(var m=l.next();!m.done;m=l.next()){m=m.value;var n=d[e?"00":m];n?er.includes(n)&&g.add(n):f.add(m)}}}var d=a.h?a.h.Ae():{};a=Object.keys(d);var e=a.length&&a[0]=="00";a=!1;var f=new Set,g=new Set,h=new WeakSet;b=r(b.variants);for(var k=b.next();!k.done;k=b.next()){k=k.value;if(!k.allowedByApplication)a=!0;else if(k.allowedByKeySystem)return;c(k.audio);c(k.video)}a={hasAppRestrictions:a,missingKeys:Array.from(f),
restrictedKeyStatuses:Array.from(g)};throw new T(2,4,4012,a);}var er=["output-restricted","internal-error"];function fr(a,b,c){this.i=a;this.A=c===void 0?null:c;this.C=b===void 0?"":b;this.j=!1;this.u=0;this.h=new Map;this.l=gr++;this.m=this.o=!1}q=fr.prototype;q.destroy=function(){for(var a=r(this.h.values()),b=a.next();!b.done;b=a.next())b=b.value,b.gf.stop(),b.reject(new T(2,3,3018,"Worker transmuxer destroyed"));this.h.clear();this.m&&(hr&&hr.postMessage({cmd:"destroy",id:this.l}),ir.delete(this.l),this.m=!1,ir.size===0&&hr&&(hr.terminate(),hr=null));this.i.destroy()};
q.isSupported=function(a,b){return this.i.isSupported(a,b)};q.convertCodecs=function(a,b){return this.i.convertCodecs(a,b)};q.getOriginalMimeType=function(){return this.i.getOriginalMimeType()};
q.transmux=function(a,b,c,d,e){var f=this,g,h,k,l,m,n,p,t,u,v,w,x,y,z,D,A,B,E,C;return H(function(G){if(G.i==1){if(f.j)return G.return(f.i.transmux(a,b,c,d,e));if(!f.m){g=jr(f.C);if(!g)return f.j=!0,G.return(f.i.transmux(a,b,c,d,e));ir.set(f.l,f);f.m=!0}h=hr;if(!h)return f.j=!0,G.return(f.i.transmux(a,b,c,d,e));f.o||(k=f.i.getOriginalMimeType(),h.postMessage({cmd:"init",id:f.l,mimeType:k,priority:f.A,typeSupport:Array.from(ol)}),f.o=!0);l=f.u++;m={id:b.id,codecs:b.codecs,channelsCount:b.channelsCount,
audioSamplingRate:b.audioSamplingRate,height:b.height,width:b.width,language:b.language};n=c?{discontinuitySequence:c.discontinuitySequence,startTime:c.startTime,endTime:c.endTime,uris:c.Oa()}:null;p=ub(Qb(a));t=Promise.withResolvers();u=t.promise;v=t.resolve;w=t.reject;x=!1;y=new gf(function(){f.h.has(l)&&(f.h.delete(l),x=f.j=!0,v(null))});y.ka(30);f.h.set(l,{resolve:v,reject:w,gf:y});try{h.postMessage({cmd:"transmux",id:f.l,reqId:l,data:p,streamProps:m,refProps:n,duration:d,contentType:e},[p])}catch(K){return y.stop(),
f.h.delete(l),kr(),G.return(f.i.transmux(a,b,c,d,e))}return G.h(u,2)}z=G.j;if(x||z===null)return Ua("Worker transmux unavailable; falling back to main-thread transmuxing"),G.return(f.i.transmux(a,b,c,d,e));if((D=z.streamMutations)&&Object.keys(D).length>0)for(A=r(Object.keys(D)),B=A.next();!B.done;B=A.next())E=B.value,b[E]=D[E];C=z.output;return C.type==="raw"?G.return(S(C.data)):G.return({data:S(C.data),init:C.init?S(C.init):null})})};I("shaka.transmuxer.TransmuxerProxy",fr);
fr.prototype.transmux=fr.prototype.transmux;fr.prototype.getOriginalMimeType=fr.prototype.getOriginalMimeType;fr.prototype.convertCodecs=fr.prototype.convertCodecs;fr.prototype.isSupported=fr.prototype.isSupported;fr.prototype.destroy=fr.prototype.destroy;var gr=0,hr=null,ir=new Map;
function jr(a){if(hr)return hr;if(!R().pd()||!a)return null;try{var b=new Worker(a);b.addEventListener("message",function(c){c=c.data;var d=c.cmd;if(d==="transmuxed"||d==="error"||d==="unavailable")if(d=ir.get(c.id)){var e=c.cmd;if(e==="unavailable"){d.j=!0;var f=d.h.get(c.reqId);f&&(f.gf.stop(),d.h.delete(c.reqId),f.resolve(null))}else if(e==="transmuxed"||e==="error"){var g=c.reqId;if(f=d.h.get(g))f.gf.stop(),d.h.delete(g),e==="error"?(c=c.error,f.reject(new (Function.prototype.bind.apply(T,[null,
c.severity,c.category,c.code].concat(F(c.data)))))):f.resolve(c)}}});b.addEventListener("error",function(){kr()});return hr=b}catch(c){return null}}function kr(){for(var a=r(ir.values()),b=a.next();!b.done;b=a.next()){b=b.value;b.j=!0;for(var c=r(b.h.values()),d=c.next();!d.done;d=c.next())d=d.value,d.gf.stop(),d.resolve(null);b.h.clear()}hr=null;ir.clear()};function lr(a,b,c){c=c===void 0?Number.EPSILON:c;if(a===b)return!0;a=Math.abs(a-b);return a<=c?!0:c!==Number.EPSILON?Math.abs(a-c)<=Number.EPSILON:!1};function mr(a,b,c,d,e){var f=this;this.h=a;this.F=c;this.o=d;this.qa=b;this.l=new Map;this.D=new Map;this.V=new Map;this.La=new Map;this.i=null;this.Ga=!1;this.H=e||null;this.A=new Map;this.C=new ib;this.m=new Map;this.I=null;this.O=Promise.withResolvers();this.Aa="";this.Bb=!1;this.ya=!0;this.ia=!1;this.L=this.ea=null;this.j=nr(this,this.O);this.Pa=this.K=!1;this.G=new Ro(function(){return or(f)});this.P=!1;this.Z="UNKNOWN";this.u=this.zb=this.Ab=!1;this.za=null;this.Qa=new Map;this.ra=this.W=this.ua=
this.U=null;this.$=Promise.withResolvers();var g=wo(R(),this.h);g&&(this.ia=g.state!="disconnected",this.C.Fb(g,["connect","connecting","disconnect"],function(){f.ia=g.state!="disconnected"}));this.Ra=!1;this.N=new Map}
function nr(a,b){a.ya=!0;if(window.ManagedMediaSource){a.L||(a.h.disableRemotePlayback=!0);var c=new ManagedMediaSource;a.C.J(c,"startstreaming",function(){a.ya=!0});a.C.J(c,"endstreaming",function(){a.ya=!1})}else c=new MediaSource;a.C.Ma(c,"sourceopen",function(){URL.revokeObjectURL(a.Aa);b.resolve()});a.C.Ma(a.h,"playing",function(){a.Bb=!0});a.Aa=pr(c);qr(a);a.o.useSourceElements?(a.ea=oo(a.Aa),a.h.appendChild(a.ea),a.L&&a.h.appendChild(a.L),a.h.load()):a.h.src=a.Aa;return c}
function rr(a,b,c){if(a.h&&window.ManagedMediaSource&&a.j&&a.o.useSourceElements){var d;((d=a.L)==null?void 0:d.parentElement)===a.h&&a.h.removeChild(a.L);a.L=oo(b,c);a.h.appendChild(a.L);a.h.disableRemotePlayback=!1}}
function sr(){var a='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="hvc1.2.20000000.L153.B0",video/mp4; codecs="hvc1.2.4.L120.b0",video/mp4; codecs="hvc1.2.4.L123.b0",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",video/mp4; codecs="av01.0.01M.08",video/mp4; codecs="av01.0.31M.10.0.111.09.16.09.0",video/mp4; codecs="av01.0.31M.10.0.112.09.18.09.0",video/mp4; codecs="dvh1.05.01",video/mp4; codecs="dvh1.08.01",video/mp4; codecs="dav1.10.01",video/mp4; codecs="dvh1.20.01",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="ac-4.02.01.03",audio/mp4; codecs="opus",audio/mp4; codecs="flac",audio/mp4; codecs="mp3",audio/mp4; codecs="mp4a.6B",audio/mp4; codecs="mp4a.69",audio/mp4; codecs="dtsc",audio/mp4; codecs="dtse",audio/mp4; codecs="dtsx",audio/mp4; codecs="apac.31.00",audio/mp4; codecs="iamf.000.000.Opus",audio/mp4; codecs="iamf.000.000.mp4a.40.2",audio/mp4; codecs="iamf.000.000.fLaC",audio/mp4; codecs="iamf.000.000.ipcm",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="vp09.00.10.08",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").concat(F(Ee)),b=
{};R();a=r(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;if(Xe(c))b[c]=!0;else if(Kc()){var d=Le(c),e=Oe(Me(c),d);d=De(d,e);b[c]=nl(d)||(xe(d)?!0:!1)}else b[c]=Lc().canPlayType(c)!="";d=c.split(";")[0];b[d]=b[d]||b[c]}return b}q=mr.prototype;q.destroy=function(){return this.G.destroy()};
function or(a){var b,c,d,e,f,g,h,k,l,m,n,p,t,u,v,w,x,y;return H(function(z){if(z.i==1){b=[];c=r(a.A);for(d=c.next();!d.done;d=c.next())for(e=d.value,f=r(e),g=f.next().value,h=f.next().value,k=h[0],l=g,a.A.set(l,h.slice(0,1)),k&&b.push(k.p.promise.catch(function(){})),m=r(h.slice(1)),n=m.next();!n.done;n=m.next())p=n.value,p.p.reject(new T(2,7,7003,void 0));a.i&&b.push(a.i.destroy());return z.h(Promise.all(b),2)}b=[];t=r(a.m.values());for(u=t.next();!u.done;u=t.next())v=u.value,v.destroy();w=r(a.N.values());
for(x=w.next();!x.done;x=w.next())y=x.value,b.push(y.destroy());a.C&&(a.C.release(),a.C=null);a.h&&(qr(a),a.h.load(),a.h.disableRemotePlayback=!1);a.h=null;a.ea=null;a.L=null;a.o=null;a.j=null;a.i=null;a.qa=null;a.l.clear();a.V.clear();a.La.clear();a.N.clear();a.m.clear();a.I=null;a.A.clear();a.H=null;a.Qa.clear();a.F=null;return z.h(Promise.all(b),0)})}
function qr(a){if(a.h){a.h.removeAttribute("src");var b;((b=a.ea)==null?void 0:b.parentElement)===a.h&&a.h.removeChild(a.ea);var c;((c=a.L)==null?void 0:c.parentElement)===a.h&&a.h.removeChild(a.L)}}
q.init=function(a,b,c,d){b=b===void 0?!1:b;c=c===void 0?"UNKNOWN":c;d=d===void 0?!1:d;var e=this,f,g,h,k,l,m;return H(function(n){if(n.i==1)return f=Ac,n.h(e.O.promise,2);if(n.i!=3){if(!tr(e)&&!ur(e))return n.B(3);Ta("Expected MediaSource to be open during init(); reopening the media source.");e.O=Promise.withResolvers();e.j=nr(e,e.O);return n.h(e.O.promise,3)}e.P=b;e.Z=c;e.Ab=d;e.zb=!e.P&&e.Z=="HLS"&&!e.Ab;e.Qa.clear();e.U=null;e.ua=null;e.W=null;e.ra=null;e.$=Promise.withResolvers();g=r(a.keys());
for(h=g.next();!h.done;h=g.next())k=h.value,l=a.get(k),vr(e,k,l,l.codecs),e.u?(e.A.set(f.X,[]),e.A.set(f.oa,[])):e.A.set(k,[]);(m=a.get(f.X))&&m.isAudioMuxedInVideo&&(e.u=!0);n.l()})};
function vr(a,b,c,d){b=="audio"&&d&&(d=Oe(d,c.mimeType));b=="video"&&d&&c.mimeType=="video/mp4"&&(d=Pe(d,c.mimeType));var e=De(c.mimeType,d);if(b==wc)wr(a,e,c.external);else{var f=nl(e)&&(a.P||!Ee.includes(e)),g=Fe(c.mimeType,d);if(a.o.forceTransmux||!f){var h=xe(g),k=uc("audio",(d||"").split(","));d=uc("video",(d||"").split(","));if(k&&d&&(h||!f)){a.u=!0;vr(a,"audio",c,k);vr(a,"video",c,d);return}h&&(e=new fr(h(),a.o.transmuxWorkerUrl,Be(g,h)),a.m.set(b,e),e=e.convertCodecs(b,g))}g=e+a.o.addExtraFeaturesToSourceBuffer(e);
So(a.G);try{var l=a.j.addSourceBuffer(g)}catch(n){throw new T(2,3,3015,n,"The mediaSource_ status was "+a.j.readyState+" expected 'open'",null);}a.P&&(l.mode=xr);a.C.J(l,"error",function(){var n=a.A.get(b)[0];n.p.reject(new T(2,3,3014,a.h.error?a.h.error.code:0,n.uri))});a.C.J(l,"updateend",function(){return yr(a,b)});a.l.set(b,l);a.D.set(b,e);a.La.set(b,!!c.drmInfos.length);c=a.F.Nb();if(qq(c))a.N.set(b,new dq);else{var m;(m=a.N.get(b))==null||m.destroy();a.N.delete(b)}}}
q.configure=function(a){this.o=a;this.i&&(this.i.G=a.modifyCueCallback)};function zr(a){return a.ya&&!a.ia&&!a.K}function wr(a,b,c){a.i||(a.i=new Te(a.qa,a.Z),a.i&&(a.i.G=a.o.modifyCueCallback));var d=a.i;a=a.Ga;b==Re||b==Se?d.m=null:(d.m=Ve.get(b)(),d.m.setManifestType(d.F),d.I=a,d.D=c)}function tr(a){return a.K?!1:a.j?a.j.readyState=="ended":!0}function ur(a){return a.K?!1:a.j?a.j.readyState=="closed":!0}function Ar(a,b){return a.l.size?b==wc?a.i.h:Kq(Br(a,b)):null}
function Cr(a,b){return a.l.size?b==wc?a.i.i:Lq(Br(a,b)):null}function Dr(a,b,c){if(b==wc)return a=a.i,a.h==null||a.i==null?!1:c>=a.h&&c<a.i;a=Br(a,b);return Mq(a,c)}function Er(a,b,c){if(b==wc)return a=a.i,a.i==null||a.i<c?0:a.i-Math.max(c,a.h);a=Br(a,b);return Nq(a,c)}function Fr(a,b,c){if(b==wc)return a=a.i,a.h==null||a.h>c?0:Math.min(c,a.i)-a.h;a=Br(a,b);return Pq(a,c)}
q.dc=function(){var a={total:this.K?[]:Oq(this.h.buffered),audio:Oq(Br(this,"audio")),video:Oq(Br(this,"video")),text:[]};if(this.i){var b=this.i.h,c=this.i.i;b!=null&&c!=null&&a.text.push({start:b,end:c})}return a};function Br(a,b){if(!Gr(a))return null;try{return a.l.get(b).buffered}catch(c){return a.l.has(b),null}}
function Hr(a,b,c,d,e,f,g){g=g===void 0?!1:g;var h=null,k=[],l=S(c);if(Ee.includes(f)||b=="audio"&&!f.includes("/mp4")&&!f.includes("/webm")&&!Gi(l)&&ql(l))c=gi(l),c.length&&d&&((g=c.find(function(v){return v.description==="com.apple.streaming.transportStreamTimestamp"}))&&typeof g.data=="number"&&(h=Math.round(g.data)/1E3),a.F.onMetadata([{cueTime:d.startTime,data:l,frames:c,dts:d.startTime,pts:d.startTime}],0,d.endTime));else if(f.includes("/mp4")&&d&&d.initSegmentReference){l=new ih;var m=e.emsgSchemeIdUris!=
null&&e.emsgSchemeIdUris.length>0||a.o.dispatchAllEmsgBoxes,n=[];m&&l.S("emsg",function(v){a:{var w=e.emsgSchemeIdUris;if(v.version===0){var x=v.reader.hd();var y=v.reader.hd();var z=v.reader.R();var D=v.reader.R();var A=v.reader.R();var B=v.reader.R();var E=d.startTime+D/z}else z=v.reader.R(),E=v.reader.jd()/z+d.l,D=E-d.startTime,A=v.reader.R(),B=v.reader.R(),x=v.reader.hd(),y=v.reader.hd();v=v.reader.Ea(v.reader.Na()-v.reader.va(),!0);if(w&&w.includes(x)||a.o.dispatchAllEmsgBoxes)if(x=="urn:mpeg:dash:event:2012")a.F.Dk();
else{w=E;if(x!=="https://aomedia.org/emsg/ID3"||A!==4294967295)w+=A/z;z={startTime:E,endTime:w,schemeIdUri:x,value:y,timescale:z,presentationTimeDelta:D,eventDuration:A,id:B,messageData:v};break a}z=null}z&&n.push(z)});var p=d.initSegmentReference.timescale;b=p&&!isNaN(p);var t=0,u=!1;b&&l.S("prft",function(v){var w=v.reader,x=v.version;w.R();v=w.R();var y=w.R();v=v*1E3+y/4294967296*1E3;x===0?w=w.R():(x=w.R(),w=w.R(),w=x*4294967296+w);v=jn(v);w=(new Map).set("detail",{wallClockTime:v,programStartDate:new Date(v-
w/p*1E3)});w=new nj("prft",w);a.F.onEvent(w)}).ma(xh,nh).S("tfdt",function(v){u||(t=Eh(v.reader,v.version).wb/p,u=!0,m||v.parser.stop())});(m||b)&&l.parse(c,!1,g);u&&d.l==0&&(h=t);l=r(n);for(c=l.next();!c.done;c=l.next())Ir(a,c.value,d,h)}else f.includes("/mp4")||f.includes("/webm")||!Gi(l)||(k=a.Qa.getOrInsertComputed(b,function(){return new ti}),k.clearData(),k.si(d.discontinuitySequence),k.parse(l),l=Ai(k,b),l!=null&&(h=l),k=k.getMetadata());return{timestamp:h,metadata:k}}
function Ir(a,b,c,d){var e=lr(b.startTime,c.startTime+b.presentationTimeDelta/b.timescale);d&&a.Z=="HLS"&&!e&&(c=-d+c.startTime,b.startTime+=c,b.endTime+=c);a.F.Ak(b);!b.messageData||b.schemeIdUri!="https://aomedia.org/emsg/ID3"&&b.schemeIdUri!="https://developer.apple.com/streaming/emsg-id3"||(c=gi(b.messageData),c.length&&(d=b.startTime,a.F.onMetadata([{cueTime:d,data:b.messageData,frames:c,dts:d,pts:d}],0,b.endTime)))}
function Jr(a,b,c,d,e,f,g,h,k,l,m){g=g===void 0?!1:g;h=h===void 0?!1:h;k=k===void 0?!1:k;l=l===void 0?!1:l;var n,p,t,u,v,w,x,y,z,D,A,B,E,C,G,K,L,N,J,O,M,P,U,Q,da,Z,ka,va,Ea,pa,Aa,Va,Ya,vb;return H(function(W){switch(W.i){case 1:n=Ac;if(b!=n.Xa){W.B(2);break}return W.h(Ye(a.i,c,d?d.startTime:null,d?d.endTime:null,d?d.Oa()[0]:null,d?d.discontinuitySequence:-1),3);case 3:return W.return({Cc:null});case 2:if(l||!a.u){W.B(4);break}return W.h(Jr(a,n.oa,c,d,e,f,g,h,k,!0,m),5);case 5:return p=W.j,W.h(Jr(a,
n.X,c,d,e,f,g,h,k,!0,m),6);case 6:return t=W.j,W.return(p.Cc!=null?p:t);case 4:if(!a.l.has(b))return W.return({Cc:null});e.preselection&&(u={data:c,preselection:e.preselection,stream:e,contentType:b,isInitSegment:d==null},(v=a.o.modifyPreselectionSegmentCallback(u))&&v.data&&(c=v.data));w=a.V.has(b)?a.V.get(b):a.l.get(b).timestampOffset;x=null;tr(a)&&Kr(a,b,function(){var uf=a.l.get(b);if(tr(a)){var wb=uf.buffered;wb=wb.length?wb.end(wb.length-1):0;uf.remove(wb,wb+.001)}else yr(a,b)},null);y=a.D.get(b);
a.m.has(b)&&(y=a.m.get(b).getOriginalMimeType());if(!d){W.B(7);break}z=Hr(a,b,c,d,e,y,k);D=z.timestamp;A=z.metadata;if(D==null){W.B(8);break}x=D;a.U==null&&b==n.oa&&(a.U=D,a.ua=d.startTime,a.W!=null&&(B=0,a.ua==a.ra&&(B=a.U-a.W),a.$.resolve(B)));a.W==null&&b==n.X&&(a.W=D,a.ra=d.startTime,a.U!=null&&(E=0,a.ua==a.ra&&(E=a.U-a.W),a.$.resolve(E)));G=Lr;K=b==n.X&&a.u&&!a.P&&a.U!=null&&a.l.has(n.oa)&&a.l.get(n.X).mode==G.Vi;if(!K){L=D;N=Ee;!a.P&&N.includes(a.D.get(b))&&(L=0);C=d.startTime-L;W.B(9);break}J=
a.V.has(n.oa)?a.V.get(n.oa):a.l.get(n.oa).timestampOffset;return W.h(a.$.promise,10);case 10:O=W.j,C=J+O;case 9:M=Math.abs(w-C),(M>=.001||g||h)&&(!k||C>0||!w)&&(w=C,a.zb&&(Kr(a,b,function(){return Mr(a,b)},null),Kr(a,b,function(){return Nr(a,b,w)},null))),(P=b==n.oa||!a.l.has(n.oa))&&a.i&&(af(a.i,w,d.discontinuitySequence),bf(a.i,(y||"").includes("mp2t")));case 8:if(A.length)a.F.onMetadata(A,w,d?d.endTime:null);case 7:U=null;if(!a.m.has(b)){W.B(11);break}return W.h(a.m.get(b).transmux(c,e,d,a.j.duration,
b),12);case 12:Q=W.j,ArrayBuffer.isView(Q)?c=Q:(da=Q,da.init!=null&&(U=Z=da.init,Kr(a,b,function(){Or(a,b,Z,w,e,!0)},d?d.Oa()[0]:null)),c=da.data);case 11:f&&b==n.oa&&(a.i||wr(a,Re,!1),a.I||(ka=a.D.get(b)||y,a.I=new Pc(ka.split(";",1)[0])),!U&&d||a.I.init(U||c,h,m),d&&(va=Tc(a.I,c),va.length&&ff(a.i,va,w)));c=Pr(a,e,c,d,b);if(!a.N.has(b)){W.B(13);break}Ea=He(a.D.get(b))=="mp4";pa=a.F.Nb();if(!Ea||!pa){W.B(13);break}Aa=d===null;Va=a.N.get(b);return W.h(eq(Va,c,Aa,pa),15);case 15:c=W.j;case 13:if(!d||
!a.P||b==n.Xa){W.B(16);break}if(!g&&!h){W.B(16);break}Ya=d.startTime;if(a.Z!="HLS"||a.u||b!=n.X||!a.l.has(n.oa)){W.B(18);break}return W.h(a.$.promise,19);case 19:vb=W.j,Math.abs(vb)>.15&&(Ya-=vb);case 18:Kr(a,b,function(){return Mr(a,b)},null),Kr(a,b,function(){return Nr(a,b,Ya)},null);case 16:return W.h(Kr(a,b,function(){Or(a,b,c,w,e,!d)},d?d.Oa()[0]:null),20);case 20:return W.return({Cc:x})}})}function Qr(a,b){var c=Cr(a,"video")||0;df(a.i,b,c)}function Rr(a){a.i&&df(a.i,"",0)}
q.remove=function(a,b,c,d){var e=this,f,g;return H(function(h){return h.i==1?(f=Ac,a==f.oa&&e.I&&(e.I.remove(d),g=e.i.h||0,e.i.remove(g,c,!0)),a==f.Xa?h.h(e.i.remove(b,c),0):c>b?h.h(Kr(e,a,function(){return Sr(e,a,b,c)},null),5):h.B(0)):e.u?h.h(Kr(e,f.X,function(){return Sr(e,f.X,b,c)},null),0):h.B(0)})};
function Tr(a,b){var c;return H(function(d){return d.i==1?(c=Ac,b==c.Xa?a.i?d.h(a.i.remove(0,Infinity),0):d.return():b===c.oa&&a.I&&a.i?d.h(a.i.remove(0,Infinity,!0),4):d.B(4)):d.i!=6?d.h(Kr(a,b,function(){return Sr(a,b,0,a.j.duration)},null),6):a.u?d.h(Kr(a,c.X,function(){return Sr(a,c.X,0,a.j.duration)},null),0):d.B(0)})}
q.flush=function(a){var b=this,c;return H(function(d){return d.i==1?(c=Ac,a==c.Xa?d.return():d.h(Kr(b,a,function(){b.h.currentTime-=.001;yr(b,a)},null),2)):b.u?d.h(Kr(b,c.X,function(){var e=c.X;b.h.currentTime-=.001;yr(b,e)},null),0):d.B(0)})};
function Ur(a,b,c,d,e,f,g,h,k){var l,m,n;return H(function(p){if(p.i==1){l=Ac;if(b==l.Xa)return f||af(a.i,c),cf(a.i,d,e),p.return();m=[];return p.h(Vr(a,b,g,h,k),2)}n=p.j;n||(m.push(Kr(a,b,function(){return Mr(a,b)},null)),a.u&&m.push(Kr(a,l.X,function(){return Mr(a,l.X)},null)));f||(m.push(Kr(a,b,function(){return Nr(a,b,c)},null)),a.u&&m.push(Kr(a,l.X,function(){return Nr(a,l.X,c)},null)));if(d!=0||e!=Infinity)m.push(Kr(a,b,function(){return Wr(a,b,d,e)},null)),a.u&&m.push(Kr(a,l.X,function(){return Wr(a,
l.X,d,e)},null));return m.length?p.h(Promise.all(m),0):p.B(0)})}function Xr(a,b,c){var d,e;return H(function(f){if(f.i==1){d=Ac;if(b==d.Xa||!a.P||(e=Cr(a,b))&&Math.abs(e-c)<.15)return f.return();Kr(a,b,function(){return Mr(a,b)},null);a.u&&Kr(a,d.X,function(){return Mr(a,d.X)},null);return f.h(Kr(a,b,function(){return Nr(a,b,c)},null),2)}return a.u?f.h(Kr(a,d.X,function(){return Nr(a,d.X,c)},null),0):f.B(0)})}
q.endOfStream=function(a){var b=this;return H(function(c){return c.h(Yr(b,function(){tr(b)||ur(b)||(a?b.j.endOfStream(a):b.j.endOfStream())}),0)})};q.Vb=function(a){var b=this;return H(function(c){return c.h(Yr(b,function(){if(b.o.durationReductionEmitsUpdateEnd&&a<b.j.duration)for(var d=r(b.l.keys()),e=d.next();!e.done;e=d.next()){e=e.value;var f={start:function(){},p:Promise.withResolvers(),uri:null};b.A.get(e).unshift(f)}b.j.duration=a;b.za=a}),0)})};q.getDuration=function(){return this.j.duration};
function Zr(a,b,c){H(function(d){if(!Gr(a)||a.j.duration!==Infinity)return d.return();a.Ra=!0;return d.h(Yr(a,function(){Gr(a)&&a.j.duration===Infinity&&a.j.setLiveSeekableRange(b,c)}),0)})}function $r(a){H(function(b){if(!Gr(a)||!a.Ra||a.j.duration!==Infinity)return b.return();a.Ra=!1;return b.h(Yr(a,function(){Gr(a)&&a.j.duration===Infinity&&a.j.clearLiveSeekableRange()}),0)})}
function Or(a,b,c,d,e,f){f=f===void 0?!1:f;S(c).byteLength==0?yr(a,b):(a.H&&Dc(a.H,c,d,e),d=f,d=d===void 0?!1:d,d=(new Map).set("data",c).set("contentType",b).set("isInitData",d),d=new nj("bufferappending",d),a.F.onEvent(d),a.l.get(b).appendBuffer(c))}function Sr(a,b,c,d){if(d<=c)yr(a,b);else{if(a.H){var e=a.H;b==="video"&&e.h&&e.h.flushBuffer(c,d)}a.l.get(b).remove(c,d)}}
function Mr(a,b){var c=a.l.get(b),d=c.appendWindowStart,e=c.appendWindowEnd;c.abort();c.appendWindowStart=d;c.appendWindowEnd=e;yr(a,b)}function Nr(a,b,c){a.V.set(b,c);var d;if(d=c<0)d=R().Ba()==="EDGE";d&&(c+=.001);a.l.get(b).timestampOffset=c;yr(a,b)}function Wr(a,b,c,d){var e=a.l.get(b);if(e.appendWindowEnd!==d||e.appendWindowStart!==c)e.appendWindowStart=0,e.appendWindowEnd=d,e.appendWindowStart=c;yr(a,b)}
function yr(a,b){if(a.K||a.G.h){var c=a.A.get(b);c&&c.length&&((c=c[0])&&c.p&&c.p.resolve(),a.A.set(b,[]))}else if(c=a.A.get(b)[0])c.p.resolve(),as(a,b)}function Kr(a,b,c,d){So(a.G);c={start:c,p:Promise.withResolvers(),uri:d};a.A.get(b).push(c);a.A.get(b).length==1&&bs(a,b);return c.p.promise}
function Yr(a,b){var c,d,e,f,g,h,k,l,m,n,p,t,u,v,w,x,y,z,D;return H(function(A){switch(A.i){case 1:So(a.G);c=[];d=Array.from(a.l.keys());e=new Map;f=r(d);g=f.next();for(h={};!g.done;h={ready:void 0},g=f.next())k=g.value,h.ready=Promise.withResolvers(),l={start:function(B){return function(){return B.ready.resolve()}}(h),p:h.ready,uri:null},m=a.A.get(k),m.push(l),c.push(h.ready.promise),e.set(k,l),m.length==1&&l.start();A.o(2);return A.h(Promise.all(c),4);case 4:A.u(3);break;case 2:n=A.m();if(a.G.h){p=
r(d);for(t=p.next();!t.done;t=p.next())u=t.value,v=a.A.get(u),e.has(u)&&cb(v,e.get(u));return A.return()}throw n;case 3:return A.o(5,6),A.h(b(),6);case 6:A.F();w=r(d);for(x=w.next();!x.done;x=w.next())y=x.value,as(a,y);A.G(0);break;case 5:throw z=A.m(),D=a.h.error?Bb(a.h.error):"No error in the media element",new T(2,3,3015,z,D,null);}})}function as(a,b){a.A.get(b).shift();bs(a,b)}
function bs(a,b){var c=a.A.get(b)[0];if(c)try{c.start()}catch(d){d.name=="QuotaExceededError"?c.p.reject(new T(2,3,3017,b)):zr(a)?c.p.reject(new T(2,3,3015,d,a.h.error?Bb(a.h.error):"No error in the media element",c.uri)):c.p.reject(new T(2,3,3024,b)),as(a,b)}}function cs(a,b){a.qa=b;a.i&&(a.i.l=b)}
function Pr(a,b,c,d,e){if(He(a.D.get(e))!="mp4")return c;var f=d===null,g=a.La.get(e),h=a.F.Be(),k=!1;d&&d.initSegmentReference&&(k=d.initSegmentReference.encrypted);d=d?d.Oa()[0]:null;var l=R();a.o.correctEc3Enca&&f&&e==="audio"&&(c=zq(c));var m;if(m=f)if(l.Ba()!="CHROMIUM")m=!1;else{m=null;var n=navigator.userAgent.match(/Chrome\/(\d+)/);n&&(m=parseInt(n[1],10));m=b.type==="video"&&m!=null&&m<94&&b.supplementalCodecs!=b.codecs&&/dvh1|dvhe/.test(b.supplementalCodecs)}m&&(c=Aq(c));a.o.insertFakeEncryptionInInit&&
g&&l.kd(h,e)&&(f?c=Bq(b,c,d,h):!k&&l.ii(e)&&(c=Eq(c)));f&&l.ug()&&(c=Hq(c));!f&&b.isIframe&&a.o.repairIFrames&&(c=Iq(c));return c}function ds(a,b,c,d){return Kr(a,b,function(){if(b!==wc){a.D.get(b);a.m.has(b)&&(a.m.get(b).destroy(),a.m.delete(b));d&&a.m.set(b,d);var e=c+a.o.addExtraFeaturesToSourceBuffer(c);a.l.get(b).changeType(e);a.D.set(b,c);yr(a,b)}},null)}
function es(a,b){var c,d,e,f,g,h,k,l,m,n,p,t,u,v,w,x,y,z,D,A,B,E,C;return H(function(G){if(G.i==1){if(a.K||a.ia)return G.return();c=Ac;a.K=!0;a.u=!1;d=a.h.currentTime;e=a.h.autoplay;a.h.paused||(a.Pa=!0);a.Bb&&(a.h.autoplay=!1);G.K(2);a.C.Sa();f=r(a.m.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.destroy();k=r(a.N.values());for(l=k.next();!l.done;l=k.next())m=l.value,m.destroy();n=r(a.l.values());for(p=n.next();!p.done;p=n.next()){t=p.value;try{a.j.removeSourceBuffer(t)}catch(K){}}a.m.clear();
a.l.clear();a.V.clear();a.N.clear();u=a.j.duration;a.O=Promise.withResolvers();a.j=nr(a,a.O);return G.h(a.O.promise,4)}if(G.i!=2){!isNaN(u)&&u?a.j.duration=u:!isNaN(a.za)&&a.za&&(a.j.duration=a.za);v=Promise.withResolvers();w=a.j.sourceBuffers;x=b.size;y=0;z=function(){y++;y===x&&(v.resolve(),a.C.mb(w,"addsourcebuffer",z))};a.C.J(w,"addsourcebuffer",z);D=r(b.keys());for(A=D.next();!A.done;A=D.next())B=A.value,E=b.get(B),vr(a,B,E,E.codecs);(C=b.get(c.X))&&C.isAudioMuxedInVideo&&(a.u=!0);a.u&&!a.A.has(c.X)&&
a.A.set(c.X,[]);return G.h(v.promise,2)}G.F();a.K=!1;So(a.G);a.C.Ma(a.h,"loadedmetadata",function(){a.G.h||(a.h.currentTime=d)});a.C.Ma(a.h,"canplaythrough",function(){a.G.h||(a.h.autoplay=e,a.Pa&&(a.Pa=!1,a.h.play()))});return G.G(0)})}function fs(a,b){return Yr(a,function(){return es(a,b)})}
function gs(a,b,c,d){c=="video/mp4"&&(d=Pe(d,c));var e=!1,f=uc("audio",(d||"").split(",")),g=uc("video",(d||"").split(",")),h=g;b=="audio"&&(h=f);h||(h=d);var k=De(c,h),l=Le(a.D.get(b)),m=a.o.forceTransmux;!nl(k)||!a.P&&Ee.includes(k)?m=!0:m||c==l||(m=!R().od()&&Ee.includes(c));if(m&&(h=Fe(c,h),l=xe(h))){var n=new fr(l(),a.o.transmuxWorkerUrl,Be(h,l));f&&g&&(e=!0);k=n.convertCodecs(b,h)}!n&&b==="video"&&f&&(k=De(c,d));a=Ie(Me(k));return{Jb:n,al:e,Wg:Le(k),codec:a,mimeType:k}}
function hs(a,b,c,d,e){if(b==wc)return{type:is,Qe:c,Jb:null};var f=Ie(Me(a.D.get(b))),g=Le(a.D.get(b)),h=gs(a,b,c,d),k=h.Jb,l=h.al,m=h.Wg,n=h.codec;h=h.mimeType;var p=!0;l&&a.D.has("audio")&&(c=gs(a,"audio",c,d),d=Ie(Me(a.D.get("audio"))),p=Le(a.D.get("audio")),p=d==c.codec&&p==c.Wg,c.Jb&&c.Jb.destroy());if(f===n&&g===m&&p)return{type:is,Qe:h,Jb:k};f=!0;if(a.u&&!e.has("audio")||l&&k&&!a.m.has(b))f=!1;b=R();e=a.F.Be();if(f&&a.o.codecSwitchingStrategy==="smooth"&&b.cb(e))return{type:js,Qe:h,Jb:k};k&&
k.destroy();return{type:ks,Qe:h,Jb:null}}
function Vr(a,b,c,d,e){var f,g,h,k,l,m;return H(function(n){if(n.i==1){f=Ac;g=hs(a,b,c,d,e);h=g.type;k=g.Jb;l=g.Qe;if(m=e.get(f.X))a.u=m.isAudioMuxedInVideo;if(h==is)return a.m.has(b)&&!k?(a.m.get(b).destroy(),a.m.delete(b)):!a.m.has(b)&&k?a.m.set(b,k):k&&(a.m.has(b)&&a.m.get(b).transmux!==k.transmux?(a.m.get(b).destroy(),a.m.set(b,k)):k.destroy()),n.return(!1);if(h==js)return n.h(ds(a,b,l,k),3);if(h!=ks)return n.B(3);k&&k.destroy();return n.h(fs(a,e),3)}return n.return(!0)})}
function ls(a,b,c,d,e){a=hs(a,b,c,d,e);a.Jb&&a.Jb.destroy();return a.type==ks}function Gr(a){return!a.j||a.G.h||a.h.error||a.ia||a.K||ur(a)?!1:!0}var pr=window.URL.createObjectURL,xr="sequence",Lr={Sl:xr,Vi:"segments"},is="none",ks="reset",js="changeType";function ms(a){var b=this;this.h=a;this.l=!1;this.i=this.h.Qf();this.j=new gf(function(){b.h.isPaused()||b.h.xk(b.i*.25)})}ms.prototype.release=function(){this.set(this.Wc());this.j&&(this.j.stop(),this.j=null);this.h=null};ms.prototype.set=function(a){this.i=a;ns(this)};ms.prototype.Wc=function(){return this.h.Wc()};function ns(a){a.j.stop();var b=a.l?0:a.i;if(b>=0&&b<=16)try{a.h.Qf()!=b&&a.h.wi(b);return}catch(c){}a.j.Ka(.25);a.h.Qf()!=0&&a.h.wi(0)};function os(a,b,c,d){b==HTMLMediaElement.HAVE_NOTHING||a.readyState>=b?d():(b=ps.value().get(b),c.Ma(a,b,d))}var ps=new ob(function(){return new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]])});function qs(a,b,c,d){var e=this;this.h=a;this.u=b;this.C=c;this.l=null;this.o=function(){e.l==null&&(e.l=d());return e.l};this.m=this.A=!1;this.i=new ib;this.j=new rs(a);os(this.h,HTMLMediaElement.HAVE_METADATA,this.i,function(){ss(e,e.o())})}qs.prototype.release=function(){this.i&&(this.i.release(),this.i=null);this.j!=null&&(this.j.release(),this.j=null);this.u=function(){};this.h=null};function ts(a){return a.A?a.h.currentTime:a.o()}
function us(a,b){a.h.readyState>0?vs(a.j,b):(a.l=b,os(a.h,HTMLMediaElement.HAVE_METADATA,a.i,function(){ss(a,a.o())}))}function ss(a,b){Math.abs(a.h.currentTime-b)<.001?ws(a):(a.i.Ma(a.h,"seeking",function(){ws(a)}),vs(a.j,b))}function ws(a){a.A=!0;a.i.J(a.h,"seeking",function(){(a.m||a.h.ended)&&a.h.paused&&a.h.pause();a.m=!1;a.u()});a.i.J(a.h,"ended",function(){a.m=!0});a.i.J(a.h,"play",function(){a.m=!1});a.C(a.h.currentTime)}
function rs(a){var b=this;this.h=a;this.o=10;this.l=this.m=this.j=0;this.i=new gf(function(){b.j<=0?b.i.stop():b.h.currentTime!=b.m||b.h.currentTime===b.l?b.i.stop():(b.h.currentTime=b.l,b.j--)})}rs.prototype.release=function(){this.i&&(this.i.stop(),this.i=null);this.h=null};function vs(a,b){var c=a.h.ended,d=a.h.paused;a.m=a.h.currentTime;a.l=b;a.j=a.o;a.h.currentTime=b;c&&d&&a.h.pause();a.i.Ka(.1)};function xs(a){this.h=a;this.j=!1;this.i=null;this.l=new ib}q=xs.prototype;q.ready=function(){function a(){if(b.i==null||b.i==0&&b.h.duration!=Infinity)b.j=!0;else{var c=b.h.currentTime,d=null;if(typeof b.i==="number")d=b.i;else if(b.i instanceof Date){var e=ys(b);e!==null&&(d=b.i.getTime()/1E3-e,d=zs(b,d))}d==null?b.j=!0:(d<0&&(d=Math.max(0,c+d)),c!=d?(b.l.Ma(b.h,"seeking",function(){b.j=!0}),b.h.currentTime=d):b.j=!0)}}var b=this;os(this.h,HTMLMediaElement.HAVE_FUTURE_DATA,this.l,function(){a()})};
q.release=function(){this.l&&(this.l.release(),this.l=null);this.h=null};q.qf=function(a){this.i=this.j?this.i:a};q.Bd=function(){var a=this.j?this.h.currentTime:this.i;a instanceof Date&&(a=a.getTime()/1E3-(ys(this)||0),a=zs(this,a));return a||0};q.Og=function(){return 0};q.Mg=function(){return 0};q.Ng=function(){return!1};q.Vh=function(){};q.Dh=function(){var a=Lq(this.h.buffered);return a!=null&&a>=this.h.duration-1};
function ys(a){return a.h.getStartDate&&(a=a.h.getStartDate().getTime(),!isNaN(a))?a/1E3:null}function zs(a,b){a=a.h.seekable;a.length>0&&(b=Math.max(a.start(0),b),b=Math.min(a.end(a.length-1),b));return b}
function As(a,b,c,d,e,f,g,h){var k=this;this.i=a;this.h=b.presentationTimeline;this.m=c;this.A=e;this.u=null;this.D=h||function(){return[]};this.C=g||function(){return a.playbackRate};this.j=new Rq(a,b.presentationTimeline,c,f,g,h);this.l=new qs(a,function(){a:{var l=k.j;l.u=!0;l.C=!1;l.j&&l.j.Ka(l.i.gapJumpTimerTime);Tq(l);var m=ts(k.l);l=Bs(k,m);if(!pl()&&Math.abs(l-m)>.001){m=!1;var n=R().mi();if(n){var p=Date.now()/1E3;if(!k.u||k.u<p-n)k.u=p,m=!0}else m=!0;if(m){us(k.l,l);l=void 0;break a}}k.A();
l=void 0}return l},function(l){var m=k.j;m.h.seeking&&!m.u&&(m.u=!0,m.o=l);m.j&&m.j.Ka(m.i.gapJumpTimerTime);Tq(m)},function(){return Cs(k,d)});this.o=new gf(function(){if(k.i.readyState!=0&&!k.i.paused){var l=ts(k.l),m=k.h.yb(),n=k.h.ob();n-m<3&&(m=n-3);l<m&&(l=Bs(k,l),k.i.currentTime=l)}})}q=As.prototype;q.ready=function(){this.o.Ka(.25)};
q.release=function(){this.l&&(this.l.release(),this.l=null);this.j&&(this.j.release(),this.j=null);this.o&&(this.o.stop(),this.o=null);this.i=this.l=this.h=this.m=null;this.A=function(){}};q.qf=function(a){us(this.l,Cs(this,a))};q.Bd=function(){var a=ts(this.l);return this.i.readyState>0&&!this.i.paused?Ds(this,a):a};q.Og=function(){return this.j.H};q.Mg=function(){return this.j.G};q.Ng=function(){return this.j.D};
function Cs(a,b){b==null?b=a.h.na()?a.h.ob():a.h.yb():b instanceof Date?b=b.getTime()/1E3-(a.h.l||a.h.j):b<0&&(b=a.h.ob()+b);return Es(a,Ds(a,b))}q.Vh=function(){this.j.dd()};q.Dh=function(){if(this.h.na()){var a=this.h.hc(),b=Lq(this.i.buffered);if(b!=null&&b>=a)return!0}return!1};function Es(a,b){var c=a.h.getDuration();return b>=c?c-a.m.durationBackoff:b}
function Bs(a,b){var c=a.m.rebufferingGoal,d=a.m.safeSeekOffset,e=a.h.yb(),f=a.h.ob(),g=a.h.getDuration();f-e<3&&(e=f-3);var h=a.h.Kd(c),k=a.h.Kd(d);c=a.h.Kd(c+d);if(b>=g)return Es(a,b);if(b>f)return f-a.m.safeSeekEndOffset;if(b<e)return a.h.isLive()&&a.m.returnToEndOfLiveWindowWhenOutside?f-a.m.safeSeekEndOffset:Mq(a.i.buffered,k)?k:c;if(a.C()>0)for(e=r(a.D()),f=e.next();!f.done;f=e.next())if(f=f.value,b>=f.start&&b<f.end)return f.end;return b>=h||Mq(a.i.buffered,b)?b:c}
function Ds(a,b){var c=a.h.yb();if(b<c)return c;a=a.h.ob();return b>a?a:b};function Fs(a){var b=this;this.l=a;this.i=new ib;this.h=new Set;this.j=(new gf(function(){Gs(b,!1)})).eb();a.paused||this.j.Ka(.25);this.i.J(a,"playing",function(){b.j.eb().Ka(.25)});this.i.J(a,"pause",function(){b.j.stop()});this.i.J(a,"seeked",function(){b.j.eb();a.paused||b.j.Ka(.25)});this.i.J(a,"ended",function(){Gs(b,!1,a.duration)})}Fs.prototype.release=function(){this.i&&(this.i.release(),this.i=null);this.j.stop();for(var a=r(this.h),b=a.next();!b.done;b=a.next())b.value.release();this.h.clear()};
function Gs(a,b,c){c=isFinite(c)?Number(c):a.l.currentTime;a=r(a.h);for(var d=a.next();!d.done;d=a.next())d.value.l(c,b)};function Hs(a){oj.call(this);this.h=new Map;this.i=a}ra(Hs,oj);Hs.prototype.release=function(){this.h.clear();oj.prototype.release.call(this)};function Is(a,b){var c=a.h.get(b);c||(c={Ud:[],Ff:null,contentType:b},a.h.set(b,c));return c}function Js(a,b,c){var d=Is(a,b.contentType);Ks(a,d);a={ag:b,position:c};d=d.Ud;b=d.findIndex(function(e){return e.position>=c});b>=0?d.splice(b,d[b].position==c?1:0,a):d.push(a)}
Hs.prototype.l=function(a){for(var b=r(this.h.values()),c=b.next();!c.done;c=b.next()){c=c.value;var d=c.Ff;a:{var e=c.Ud;for(var f=e.length-1;f>=0;f--){var g=e[f];if(g.position<=a){e=g.ag;break a}}e=null}f=e&&!(d===e||d&&e&&d.bandwidth==e.bandwidth&&d.audioSamplingRate==e.audioSamplingRate&&d.codecs==e.codecs&&d.contentType==e.contentType&&d.frameRate==e.frameRate&&d.height==e.height&&d.mimeType==e.mimeType&&d.channelsCount==e.channelsCount&&d.pixelAspectRatio==e.pixelAspectRatio&&d.width==e.width);
g=e&&d&&e.label&&d.label&&d.label!==e.label;var h=e&&d&&e.language&&d.language&&d.language!==e.language;d=e&&d&&e.roles&&d.roles&&!gb(d.roles,e.roles);(g||h||d)&&Ls(this,a,e.contentType)&&(c.Ff=e,d=new nj("audiotrackchange",new Map([["quality",e],["position",a]])),this.dispatchEvent(d));f&&Ls(this,a,e.contentType)&&(c.Ff=e,JSON.stringify(e),c=new nj("qualitychange",new Map([["quality",e],["position",a]])),this.dispatchEvent(c))}};
function Ls(a,b,c){return(a=a.i()[c])&&a.length>0&&(c=a[a.length-1].end,b>=a[0].start&&b<c)?!0:!1}function Ks(a,b){if((a=a.i()[b.contentType])&&a.length>0){var c=a[0].start,d=a[a.length-1].end,e=b.Ud;b.Ud=e.filter(function(f,g){return f.position<=c&&g+1<e.length&&e[g+1].position<=c||f.position>=d?!1:!0})}else b.Ud=[]};function Ms(a){oj.call(this);this.h=new Map;this.j=a;this.i=null}ra(Ms,oj);Ms.prototype.release=function(){this.h.clear();this.i&&(this.i.stop(),this.i=null);oj.prototype.release.call(this)};function Ns(a,b){var c=b.schemeIdUri+"_"+b.id+"_"+(b.startTime.toFixed(1)+"_"+b.endTime.toFixed(1));a.h.has(c)||(a.h.set(c,b),b=new nj("regionadd",new Map([["region",b]])),a.dispatchEvent(b),Os(a))}
function Os(a){a.i||(a.i=(new gf(function(){for(var b=a.j(),c=r(a.h),d=c.next();!d.done;d=c.next()){var e=r(d.value);d=e.next().value;e=e.next().value;e.endTime<b.start&&(a.h.delete(d),d=new nj("regionremove",new Map([["region",e]])),a.dispatchEvent(d))}!a.h.size&&a.i&&(a.i.stop(),a.i=null)})).Ka(2))};function Ps(a,b,c,d,e,f,g){function h(k,l){return l.fastSwitching&&k.Bc()&&k.Od?!1:!0}this.o=a;this.j=b;this.m=c;this.h=new Map;this.l=new Map;this.i=null;this.u=d;this.D=e||h;this.A=f||function(){return 1};this.C=g||function(){return!0}}function Qs(a,b){a.m=b;a=r(a.h.values());for(var c=a.next();!c.done;c=a.next())c.value.h=b}
function Rs(a,b,c){c=c===void 0?!1:c;if(!a.j.segmentIndex)return Promise.resolve();a.i||(a.i=a.j.segmentIndex.jb(b,!0,a.u));if(!a.i)return Promise.resolve();c&&a.i.next();b=[];c=Math.abs(a.A());for(c=Math.ceil(a.o*c);a.h.size<c;){var d=a.i.next().value;if(!d)break;var e=!0;d.isPreload()&&d.endByte!=null&&(e=!1);d.kc()==2&&(e=!1);d.yc(!1)&&(e=!1);a.C(d)||(e=!1);e&&d.initSegmentReference&&b.push(Ss(a,d.initSegmentReference));e&&!a.h.has(d)&&(e=new Ts(a.m),b.push(Us(e,d,a.j)),a.h.set(d,e));if(!a.D(d,
a.j))break}Vs(a);return Promise.all(b)}function Ss(a,b){if(!a.j.segmentIndex||b.yc()||Array.from(a.l.keys()).some(function(e){return fk(e,b)}))return Promise.resolve();var c=new Ts(a.m),d=Us(c,b,a.j);a.l.set(b,c);return d}function Ws(a,b){b=r(b.keys());for(var c=b.next();!c.done;c=b.next())(c=c.value)&&Xs(a,c)}function Ys(a,b){b=b===void 0?!0:b;Ws(a,a.h);b&&Ws(a,a.l);a.i=null}
Ps.prototype.Ua=function(a,b){b=b===void 0?!1:b;for(var c=r(this.h.keys()),d=c.next();!d.done;d=c.next())d=d.value,a>d.endTime&&Xs(this,d);b&&Vs(this)};Ps.prototype.nd=function(a){this.u=a;this.i&&this.i.nd(a)};function Vs(a){if(a.h.size)for(var b=Array.from(a.h.keys()),c=r(a.l.keys()),d=c.next(),e={};!d.done;e={Vf:void 0},d=c.next())e.Vf=d.value,b.some(function(f){return function(g){return fk(g.initSegmentReference,f.Vf)}}(e))||Xs(a,e.Vf)}
function Zs(a,b){a.o=b;for(var c=Array.from(a.h.keys());c.length>b;){var d=c.pop();d&&Xs(a,d)}Vs(a)}function $s(a,b){b&&b!==a.j&&(Ys(a),a.j=b)}function Xs(a,b){var c=a.h;b instanceof ek&&(c=a.l);a=c.get(b);c.delete(b);a&&a.abort()}function Ts(a){this.h=a;this.Sd=this.Eg=null}
function Us(a,b,c){var d=[];a.Sd=a.h(b,c,function(e){var f;return H(function(g){if(!a.Eg)return d.push(e),g.return();f=e;d.length>0&&(d.push(e),f=Rb(d),d=[]);return g.h(a.Eg(f),0)})});return a.Sd.promise.catch(function(e){return e instanceof T&&e.code==7001?Promise.resolve():Promise.reject(e)})}Ts.prototype.abort=function(){this.Sd&&this.Sd.abort()};function at(a){this.h=[];this.i=a;this.j=new WeakSet;this.l=new WeakSet}at.prototype.add=function(a,b){if(b<=a)return!1;a={start:a,end:b};b=[];for(var c=r(this.h),d=c.next();!d.done;d=c.next())d=d.value,a.start<=d.end+.001&&d.start<=a.end+.001?a={start:Math.min(a.start,d.start),end:Math.max(a.end,d.end)}:b.push(d);b.push(a);b.sort(function(e,f){return e.start-f.start});this.h=b;this.i.gi();return!0};
at.prototype.remove=function(a,b){if(!(b<=a)){for(var c=[],d=!1,e=r(this.h),f=e.next();!f.done;f=e.next()){f=f.value;var g=lr(a,f.start,.001)?f.start:a,h=lr(b,f.end,.001)?f.end:b;h<=f.start||g>=f.end?c.push(f):(d=!0,g-f.start>.001&&c.push({start:f.start,end:g}),f.end-h>.001&&c.push({start:h,end:f.end}))}d&&(c.sort(function(k,l){return k.start-l.start}),this.h=c,this.i.gi())}};
function bt(a,b){a=r(a.h);for(var c=a.next();!c.done;c=a.next())if(c=c.value,b>c.start-.001&&b<c.end&&!lr(b,c.end,.001))return c;return null}function ct(a,b,c){b=dt(a,b);return!b||c>b.end+.001||!a.j.has(b)?null:b}function dt(a,b){return a.h.length==0||a.i.Fa()<0?null:bt(a,b)}function et(a,b){var c=dt(a,b);return(a=!c||a.i.hk(c.start,c.end)?null:c)?a.end:b}
function ft(a,b,c,d){c=gt(b.start,c,function(e){return[e.startTime]});d=gt(b.end,d,function(e){return[e.startTime,e.endTime]});c==null||d==null?a.l.add(b):ht(a,b,c,d)}function gt(a,b,c){var d=null,e=Infinity;b=r(Array.isArray(b)?b:[b]);for(var f=b.next();!f.done;f=b.next())if(f=f.value){f=r(c(f));for(var g=f.next();!g.done;g=f.next()){g=g.value;var h=Math.abs(g-a);h<=.001&&h<e&&(d=g,e=h)}}return d}
function ht(a,b,c,d){var e=b.start!==c||b.end!==d;b.start=c;b.end=d;a.j.add(b);e&&a.h.sort(function(f,g){return f.start-g.start})};function it(a,b,c){var d=this;this.h=b;this.C=c;this.j=a;this.l=null;this.W=new Map;this.D=1;this.F=this.u=null;this.ea=0;this.i=new Map;this.K=!1;this.qa=null;this.G=!1;this.m=new Ro(function(){return jt(d)});this.Z=Date.now()/1E3;this.ia=!1;this.o=new Map;this.$={projection:null,hfov:null};this.ua=0;this.ra=Infinity;this.I=null;this.V=[];this.U=new ib;this.A=new gf(function(){if(d.j&&d.h){var e=d.j.presentationTimeline,f=d.h.T;f=d.j.type=="HLS"&&e.getDuration()<Infinity&&f.getDuration()==Infinity;
e.na()||f?(e=d.j.presentationTimeline.yb(),f=d.j.presentationTimeline.ob(),f-e>1?Zr(d.h.T,e,f):$r(d.h.T)):($r(d.h.T),d.A&&d.A.stop())}else d.A&&d.A.stop()});this.O=this.H=null;this.N=!1;this.P=new gf(function(){var e=d.h.video;!e.ended&&d.H&&(d.O=d.H,d.N=!0,e.currentTime=d.H,d.H=null)});this.L=new ib}q=it.prototype;q.destroy=function(){return this.m.destroy()};
function jt(a){var b,c,d,e,f,g,h,k,l,m,n;return H(function(p){if(p.i==1){(b=a.A)==null||b.stop();a.A=null;(c=a.U)==null||c.release();a.U=null;(d=a.P)==null||d.stop();a.P=null;(e=a.L)==null||e.release();a.L=null;f=[];g=r(a.i.values());for(h=g.next();!h.done;h=g.next())k=h.value,kt(k),f.push(lt(k)),k.Y&&(Ys(k.Y),k.Y=null);l=r(a.o.values());for(m=l.next();!m.done;m=l.next())n=m.value,Ys(n);return p.h(Promise.all(f),2)}a.i.clear();a.o.clear();a.h=null;a.j=null;a.l=null;a.H=null;p.l()})}
q.configure=function(a){this.l=a;this.qa=new ej({maxAttempts:Math.max(a.retryParameters.maxAttempts,2),baseDelay:a.retryParameters.baseDelay,backoffFactor:a.retryParameters.backoffFactor,fuzzFactor:a.retryParameters.fuzzFactor,timeout:0,stallTimeout:0,connectionTimeout:0},!0);if(a.disableAudioPrefetch){var b=this.i.get("audio");b&&b.Y&&(Ys(b.Y),b.Y=null);b=r(this.o.keys());for(var c=b.next();!c.done;c=b.next())c=c.value,Ys(this.o.get(c)),this.o.delete(c)}a.disableTextPrefetch&&(b=this.i.get(wc))&&
b.Y&&(Ys(b.Y),b.Y=null);a.disableVideoPrefetch&&(b=this.i.get("video"))&&b.Y&&(Ys(b.Y),b.Y=null);b=r(this.i.keys());for(c=b.next();!c.done;c=b.next())c=this.i.get(c.value),c.Y?(Zs(c.Y,a.segmentPrefetchLimit),a.segmentPrefetchLimit>0||(Ys(c.Y),c.Y=null)):a.segmentPrefetchLimit>0&&(c.Y=mt(this,c.stream));a.disableAudioPrefetch||nt(this)};function ot(a,b,c){a.j.presentationTimeline.na()||(a.ua=b,a.ra=c)}
function pt(a,b){a=a.jb(Math.max(0,b-.001));if(!a)return[];b=[];for(var c=0;c<2;c++){var d=a.next().value;if(!d)break;b.push(d)}return b}
function qt(a,b,c){if(!c||a.C.h.length==0)return c;if(a.h.Fa()>=0){var d=bt(a.C,c.startTime),e;if(e=d)e=a.C,e=!(e.j.has(d)||e.l.has(d));if(e){var f,g;(e=(g=(f=a.i.get("video")||a.i.get("audio"))==null?void 0:f.stream.segmentIndex)!=null?g:null)&&ft(a.C,d,pt(e,d.start),pt(e,d.end))}}a=ct(a.C,c.startTime,c.endTime);if(!a)return c;d=b.stream.segmentIndex.jb(a.end);if(!d){for(;b.ba&&b.ba.next().value;);return null}b.ba=d;for(c=d.next().value;c&&c.startTime<a.end&&!lr(c.startTime,a.end,.001);)c=d.next().value;
return c}q.start=function(a){var b=this;return H(function(c){if(c.i==1)return c.h(rt(b,a||new Map),2);So(b.m);b.K=!0;c.l()})};function st(a,b){var c,d,e,f,g,h,k;H(function(l){switch(l.i){case 1:return c=Ac,a.ea++,d=a.ea,l.o(2),l.h(Tr(a.h.T,c.Xa),4);case 4:l.u(3);break;case 2:if(e=l.m(),a.h)a.h.onError(e);case 3:f=De(b.mimeType,b.codecs),wr(a.h.T,f,b.external),g=a.h.T.qa,(h=g.isTextVisible())&&a.ea==d&&(k=tt(a,b),a.i.set(c.Xa,k),ut(a,k,0)),l.l()}})}
function vt(a){var b=a.i.get(wc);b&&(kt(b),lt(b).catch(function(){}),a.I=a.i.get(wc),a.i.delete(wc),b.stream&&b.stream.closeSegmentIndex&&b.stream.closeSegmentIndex());a.F=null}
function wt(a,b){for(var c=a.h.Fa()<0,d=r(a.i.values()),e=d.next();!e.done;e=d.next())e=e.value,e.ba&&e.ba.nd(c),e.Y&&e.Y.nd(c),c&&(e.ba=null,e.endOfStream=!1,e.wa||e.Wa||e.xb||e.sb||ut(a,e,0));d=r(a.o.values());for(e=d.next();!e.done;e=d.next())e.value.nd(c);if(c=a.i.get("video"))if(d=c.stream)if(b)(b=d.trickModeVideo)&&!c.sc&&(xt(a,b,!1,0,!1),c.sc=d);else if(b=c.sc)c.sc=null,xt(a,b,!0,0,!1)}
function yt(a,b,c,d,e,f){c=c===void 0?!1:c;d=d===void 0?0:d;e=e===void 0?!1:e;f=f===void 0?!1:f;a.u=b;a.K&&(b.video&&xt(a,b.video,c,d,e,f),b.audio&&xt(a,b.audio,c,d,e,f))}function zt(a,b){H(function(c){if(c.i==1)return a.I=null,a.F=b,a.K?b.segmentIndex?c.B(2):c.h(b.createSegmentIndex(),2):c.return();xt(a,b,!0,0,!1);c.l()})}function At(a){var b=a.i.get(wc);b&&xt(a,b.stream,!0,0,!0)}
function Bt(a,b){for(var c=r(a.W.entries()),d=c.next();!d.done;d=c.next()){var e=r(d.value);d=e.next().value;e=e.next().value;d.includes(b.type)&&(e(),a.W.delete(d))}}
function xt(a,b,c,d,e,f){var g=a.i.get(b.type);g||b.type!=wc?g&&(g.sc&&(b.trickModeVideo?(g.sc=b,b=b.trickModeVideo):g.sc=null),g.stream!=b||e)&&(a.o.has(b)?g.Y=a.o.get(b):g.Y&&$s(g.Y,b),b.type==wc&&g.stream!=b&&(e=De(b.mimeType,b.codecs),wr(a.h.T,e,b.external)),a.o.has(g.stream)||g.stream.closeSegmentIndex&&(g.wa?a.W.getOrInsert("("+g.type+":"+g.stream.id+")",g.stream.closeSegmentIndex):g.stream.closeSegmentIndex()),e=g.stream.isAudioMuxedInVideo!=b.isAudioMuxedInVideo,g.stream=b,g.ba=null,g.xf=
!!f,b.dependencyStream?g.ac=tt(a,b.dependencyStream):g.ac=null,Ct(a),e&&(g.bb=null,g.Qb=null,g.Pb=null,b.isAudioMuxedInVideo&&(b=null,g.type==="video"?b=a.i.get("audio"):g.type==="audio"&&(b=a.i.get("video")),b&&(lt(b).catch(function(){}),b.bb=null,b.Qb=null,b.Pb=null,Dt(a,b),Et(a,b).catch(function(h){if(a.h)a.h.onError(h)})))),c?g.xb?g.rd=!0:g.wa?(g.sb=!0,g.Sc=d,g.rd=!0):(kt(g),Ft(a,g,!0,d).catch(function(h){if(a.h)a.h.onError(h)})):g.wa||g.Wa||ut(a,g,0),Et(a,g).catch(function(h){if(a.h)a.h.onError(h)})):
st(a,b)}
function Et(a,b){var c,d,e;return H(function(f){if(f.i==1){if(!b.operation)return f.return();c=b.stream;d=b.operation;return c.segmentIndex?f.B(2):f.h(c.createSegmentIndex(),2)}if(f.i!=4)return e=c.dependencyStream,!e||e.segmentIndex?f.B(4):f.h(e.createSegmentIndex(),4);if(b.operation!=d||b.stream!=c)return f.return();var g=a.h.Eb();var h=Cr(a.h.T,b.type),k=Gt(a,b,g);k=b.stream.segmentIndex.find(k);var l=k==null?null:b.stream.segmentIndex.get(k);k=l?hk(l):null;l&&!k&&(k=(l.endTime-l.getStartTime())*(b.stream.bandwidth||
a.u.bandwidth)/8);k?((l=l.initSegmentReference)&&(k+=(l.endByte?l.endByte+1-l.startByte:null)||0),l=a.h.getBandwidthEstimate(),g=k*8/l<(h||0)-g-a.l.rebufferingGoal||b.operation.i.h>k?!0:!1):g=!0;g&&b.operation.abort();f.l()})}
q.Hc=function(){if(this.h){var a=this.h.Eb(),b=this.O!=null&&lr(a,this.O,.1);this.O=null;b||(this.N=!1);for(var c=r(this.i.keys()),d=c.next();!d.done;d=c.next()){var e=d.value;d=this.i.get(e);if(!b&&!Dr(this.h.T,e,a)){this.Z=0;d.Y&&(d.Y.i=null);if(d.type==="audio")for(var f=r(this.o.values()),g=f.next();!g.done;g=f.next())g.value.i=null;d.ba=null;(Cr(this.h.T,e)!=null||d.wa)&&Dt(this,d);d.operation&&(d.operation.abort(),d.operation=null);e===wc&&(e=this.h.T,e.I&&e.I.h.clear());d.Hc=!0}!b||d.xb||d.wa||
d.Wa||ut(this,d,0)}Ht(this)&&It(this)}};function Dt(a,b){b.xb||b.sb||(b.wa?(b.sb=!0,b.Sc=0):Ar(a.h.T,b.type)==null?b.Wa==null&&ut(a,b,0):(kt(b),Ft(a,b,!1,0).catch(function(c){if(a.h)a.h.onError(c)})))}
function rt(a,b){var c,d,e,f,g,h,k,l;return H(function(m){if(m.i==1){if(!a.u)throw new T(2,5,5006);c=Jt(a,!0);d=a.h.T;return m.h(d.init(c,a.j.sequenceMode,a.j.type,a.j.ignoreManifestTimestampsInSegmentsMode),2)}So(a.m);a.updateDuration().catch(function(){});e=r(c.keys());for(f=e.next();!f.done;f=e.next())if(g=f.value,h=c.get(g),!a.i.has(g)){k=tt(a,h);if(l=b.get(h.id))Qs(l,function(n,p,t){return Kt(n,p,t||null,a.l.retryParameters,a.h.Dc)}),k.Y=l;a.i.set(g,k);ut(a,k,0)}Ct(a);m.l()})}
function tt(a,b){var c={stream:b,type:b.type,ba:null,Y:mt(a,b),Ca:null,bb:null,Le:null,Qb:null,Pb:null,Je:null,Ke:null,sc:null,endOfStream:!1,wa:!1,Wa:null,sb:!1,Sc:0,rd:!1,xb:!1,Hc:!0,xf:!1,ng:!1,Yc:!1,operation:null,ac:null};b.dependencyStream&&(c.ac=tt(a,b.dependencyStream));return c}
function mt(a,b){if(a.j.type=="MSF"||b.type==="video"&&a.l.disableVideoPrefetch||b.type==="audio"&&a.l.disableAudioPrefetch||b.type===wc&&(b.mimeType==Re||b.mimeType==Se)||b.type===wc&&a.l.disableTextPrefetch)return null;if(a.o.has(b))return a.o.get(b);var c=a.i.get(b.type);return(c=c&&c.Y)&&b===c.j?c:a.l.segmentPrefetchLimit>0?new Ps(a.l.segmentPrefetchLimit,b,function(d,e,f){return Kt(d,e,f||null,a.l.retryParameters,a.h.Dc)},a.h.Fa()<0,a.h.Zk,a.h.Fa,function(d){var e=a.C,f=d.endTime;d=dt(e,d.startTime);
return!(!d||f>d.end+.001?0:!e.l.has(d))}):null}
function nt(a){for(var b=a.l.segmentPrefetchLimit,c=a.l.prefetchAudioLanguages,d=r(a.j.variants),e=d.next(),f={};!e.done;f={rb:void 0},e=d.next())if(f.rb=e.value,f.rb.audio)if(a.o.has(f.rb.audio)){if(e=a.o.get(f.rb.audio),Zs(e,b),!(b>0&&c.some(function(h){return function(k){return ic(h.rb.audio.language,k)}}(f)))){var g=a.i.get(f.rb.audio.type);e!==(g&&g.Y)&&Ys(e);a.o.delete(f.rb.audio)}}else b<=0||!c.some(function(h){return function(k){return ic(h.rb.audio.language,k)}}(f))||!(e=mt(a,f.rb.audio))||
(f.rb.audio.segmentIndex||f.rb.audio.createSegmentIndex(),a.o.set(f.rb.audio,e))}q.updateDuration=function(){var a=this,b,c;return H(function(d){if(d.i==1)return b=pl(),c=a.j.presentationTimeline.getDuration(),a.U.Sa(),c<Infinity?(b&&(a.A&&a.A.stop(),$r(a.h.T)),d.h(a.h.T.Vb(c),0)):b?d.h(a.h.T.Vb(Infinity),5):(a.h.T.Vb(4294967296),d.B(0));a.A&&(a.A.eb(),a.U.Ma(a.h.video,"timeupdate",function(){a.A.eb().Ka(.5)}));return d.B(0)})};
function Lt(a,b){var c,d,e,f,g,h,k,l,m,n,p,t;return H(function(u){switch(u.i){case 1:So(a.m);c=Ac;if(b.wa||b.Wa==null||b.xb)return u.return();b.Wa=null;if(!b.sb){u.B(2);break}return u.h(Ft(a,b,b.rd,b.Sc),3);case 3:return u.return();case 2:Bt(a,b);if(b.stream.segmentIndex){u.B(4);break}d=b.stream;e=b.stream.codecs;f=b.stream.mimeType;u.o(5);return u.h(b.stream.createSegmentIndex(),7);case 7:u.u(6);break;case 5:return g=u.m(),u.h(Mt(a,b,g),8);case 8:return u.return();case 6:if(b.type!==c.Xa||e==b.stream.codecs&&
f==b.stream.mimeType||(h=De(b.stream.mimeType,b.stream.codecs),wr(a.h.T,h,b.stream.external)),d!=b.stream)return d.closeSegmentIndex&&d.closeSegmentIndex(),b.wa||b.Wa||ut(a,b,0),u.return();case 4:if(!b.ac){u.B(9);break}if(b.ac.stream.segmentIndex){u.B(9);break}u.o(11);return u.h(b.ac.stream.createSegmentIndex(),13);case 13:u.u(9);break;case 11:u.m();case 9:u.o(14);k=Nt(a,b);k!=null&&(ut(a,b,k),b.Yc=!1);u.u(15);break;case 14:return l=u.m(),u.h(Mt(a,b,l),16);case 16:return u.return();case 15:if(b.type===
c.Xa)return u.return();m=[];b.stream&&!b.stream.isAudioMuxedInVideo&&m.push(b);n=b.type===c.X?c.oa:c.X;(p=a.i.get(n))&&p.stream&&!p.stream.isAudioMuxedInVideo&&m.push(p);if(!a.K||!m.every(function(v){return v.endOfStream})){u.B(0);break}return u.h(a.h.T.endOfStream(),18);case 18:So(a.m),t=a.h.T.getDuration(),t!=0&&t<a.j.presentationTimeline.getDuration()&&a.j.presentationTimeline.Vb(t),u.l()}})}
function Nt(a,b){if(Ot(b))return Qr(a.h.T,b.stream.originalId||""),null;b.type==wc&&Rr(a.h.T);if(b.stream.isAudioMuxedInVideo&&b.type=="audio")return null;if(b.type!=wc&&ur(a.h.T))return Pt(a,!0),null;var c=a.l.updateIntervalSeconds/Math.max(1,Math.abs(a.h.Fa()));if(!zr(a.h.T)&&b.type!=wc)return c/2;var d=a.h.Eb(),e=a.h.Fa()<0;if(b.type==="audio")for(var f=r(a.o.keys()),g=f.next();!g.done;g=f.next())g=a.o.get(g.value),g.Ua(d,!0),Rs(g,d);f=Gt(a,b,d);var h=e?Fr(a.h.T,b.type,d):Er(a.h.T,b.type,d);b.type==
"video"&&!a.i.has("audio")&&a.h.T.l.has("audio")&&(g=e?Fr(a.h.T,"audio",d):Er(a.h.T,"audio",d),h=Math.min(h,g));g=Math.max(1,Math.max(a.l.rebufferingGoal,a.l.bufferingGoal)*a.D);var k=a.j.presentationTimeline.na()?Infinity:a.j.presentationTimeline.getDuration()-f,l=Cr(a.h.T,b.type);if(!e&&k<1E-6&&l)return b.endOfStream=!0,b.type=="video"&&((c=a.i.get(wc))&&Ot(c)&&(c.endOfStream=!0),(c=a.i.get("audio"))&&c.stream.isAudioMuxedInVideo&&(c.endOfStream=!0)),null;b.endOfStream=!1;if(e){var m=a.j.presentationTimeline.yb();
if(l!=null&&f<=m+1E-6)return null}if(h>0&&a.l.stopFetchingOnPause&&a.h.video.paused||h>=g)return c/2;m=!b.ba;h=Qt(a,b,d,l);if(!h){if(!a.j.presentationTimeline.na()&&k<1E-6)return b.endOfStream=!0,b.type=="video"&&(c=a.i.get(wc))&&Ot(c)&&(c.endOfStream=!0),null;a=Infinity;(b=b.Ca)&&(a=b.endTime-b.startTime);return Math.min(a/2,c)}k=b.bb;l=h.initSegmentReference;k&&l&&fk(l,k)&&(k.h=l.h);k=!1;m&&b.xf&&(k=!0,b.xf=!1);m=Infinity;l=-Infinity;for(var n=r(a.i.values()),p=n.next();!p.done;p=n.next())p=p.value,
Ot(p)||p.stream.isAudioMuxedInVideo||p.ba&&!p.ba.current()||(p=Gt(a,p,d),m=Math.min(m,p),l=Math.max(l,p));if((e?l-f:f-m)>=Math.max(a.j.presentationTimeline.i,.5))return c;b.Y&&b.ba&&!a.o.has(b.stream)&&(b.Y.Ua(h.startTime+.001),Rs(b.Y,h.startTime).catch(function(){}));if(Ht(a)&&Rt(a,b,h))return null;St(a,b,d,h,k).catch(function(){});b.ac&&Tt(a,b.ac,d,g);return null}function Gt(a,b,c){return b.Ca?a.h.Fa()<0?b.Ca.startTime:et(a.C,b.Ca.endTime):et(a.C,c)}
function Qt(a,b,c,d){if(b.ba){var e=b.ba.current();e&&b.Ca&&(c=b.Ca.endTime,lr(b.Ca.startTime,e.startTime,.002)&&lr(c,e.endTime,.002)&&(e=b.ba.next().value));return qt(a,b,e)}if(b.Ca||d){if(e=a.h.Fa()<0){var f=Ar(a.h.T,b.type);c=b.Ca?b.Ca.startTime:null;c!=null&&(f==null||c<f)&&(f=c);c=f!=null?f-.001:d}else c=b.Ca?b.Ca.endTime:d;b.stream.segmentIndex&&(b.ba=b.stream.segmentIndex.jb(c,!1,e));e=b.ba&&b.ba.next().value;return qt(a,b,e)}f=a.j.sequenceMode||Ht(a)||a.j.type==="MSF"?0:a.l.inaccurateManifestTolerance;
var g=Math.max(c-f,0);d=a.h.T.getDuration();Math.abs(g-d)<1&&(f=1,g=Math.max(c-f,0));var h=a.h.Fa()<0;d=null;f&&(b.stream.segmentIndex&&(b.ba=b.stream.segmentIndex.jb(g,!1,h)),d=b.ba&&b.ba.next().value);d||(b.stream.segmentIndex&&(b.ba=b.stream.segmentIndex.jb(c,!1,h)),d=b.ba&&b.ba.next().value);for(;((e=d)==null?void 0:e.kc())===2;)f=c=void 0,d=(f=(c=b.ba)==null?void 0:c.next().value)!=null?f:null;return d=qt(a,b,d)}
function St(a,b,c,d,e){var f,g,h,k,l,m,n,p,t,u,v,w,x,y,z,D,A,B,E;return H(function(C){switch(C.i){case 1:f=Ac;g=b.stream;h=b.ba;b.wa=!0;C.o(2);if(d.kc()==2)throw new T(1,1,1011);return C.h(Ut(a,b,d,e),4);case 4:So(a.m);if(a.G)return C.return();k=g.mimeType=="video/mp4"||g.mimeType=="audio/mp4";l=window.ReadableStream;m=a.l.lowLatencyMode&&a.j.isLowLatency;n={Cc:null};if(m&&l&&k&&(a.j.type!="HLS"||d.u))return u=new Uint8Array(0),w=v=!1,y=function(G){var K,L,N,J,O;return H(function(M){switch(M.i){case 1:if(v)return M.return();
w=!0;So(a.m);if(a.G)return M.return();M.o(2);u=Qb(u,G);K=!1;L=0;(new ih).box("mdat",function(P){L=P.size+P.start;K=!0}).parse(u,!1,!0);if(!K){M.B(4);break}N=u.subarray(0,L);u=u.subarray(L);return M.h(Vt(a,b,c,g,d,N,!0,e),5);case 5:J=M.j,n.Cc==null&&(n=J),b.Y&&b.ba&&Rs(b.Y,d.startTime,!0);case 4:M.u(0);break;case 2:x=O=M.m(),M.l()}})},C.h(Wt(a,b,d,y),9);p=Wt(a,b,d);return C.h(p,7);case 7:t=C.j;So(a.m);if(a.G)return C.return();So(a.m);return b.sb?(b.wa=!1,ut(a,b,0),C.return()):ct(a.C,d.startTime,d.endTime)?
(b.wa=!1,b.Wa||ut(a,b,0),C.return()):C.h(Vt(a,b,c,g,d,t,!1,e),8);case 8:n=C.j;C.B(6);break;case 9:z=C.j;if(x)throw x;if(w){C.B(10);break}v=!0;So(a.m);return a.G?C.return():b.sb?(b.wa=!1,ut(a,b,0),C.return()):C.h(Vt(a,b,c,g,d,z,!1,e),11);case 11:n=C.j;case 10:b.Y&&b.ba&&Rs(b.Y,d.startTime,!0);case 6:So(a.m);if(a.G)return C.return();b.Ca=d;h.next();b.wa=!1;b.ng=!1;D=a.h.T.dc();A=D[b.type];$a(JSON.stringify(A));b.sb||(B=null,b.type===f.oa?B=a.i.get(f.X):b.type===f.X&&(B=a.i.get(f.oa)),B&&B.type==f.X?
a.h.dd(d,b.stream,B.stream.isAudioMuxedInVideo,!1,n.Cc):a.h.dd(d,b.stream,b.stream.codecs.includes(","),!1,n.Cc));kt(b);ut(a,b,0);C.u(0);break;case 2:E=C.m();So(a.m,E);if(a.G)return C.return();b.wa=!1;E.code!=7001&&E.category!=1||!b.Y||(Xs(b.Y,d),d.initSegmentReference&&Xs(b.Y,d.initSegmentReference));if(E.code==7001)b.wa=!1,kt(b),ut(a,b,0),C.B(0);else if(b.type==f.Xa&&a.l.ignoreTextStreamFailures)a.i.delete(f.Xa),C.B(0);else{if(E.code==3017)return C.h(Xt(a,b,E),0);b.Yc=!0;E.severity=2;return C.h(Mt(a,
b,E),0)}}})}
function Tt(a,b,c,d){var e,f,g,h,k,l,m,n,p,t,u,v,w;return H(function(x){switch(x.i){case 1:e=Ac;f=b.stream;for(k=(h=(g=f.segmentIndex)&&g.jb(c))&&h.next().value;k&&a.V.includes(k.startTime);)k=h&&h.next().value;if(!k){x.B(0);break}l=k.initSegmentReference;if(!l||fk(l,b.bb)){x.B(3);break}b.bb=l;x.o(4);return x.h(Wt(a,b,l),6);case 6:m=x.j;if(!a.h)return x.return();var y=a.h.T;y.H&&Dc(y.H,m,0,f);a.V=[];x.u(3);break;case 4:throw n=x.m(),b.bb=null,n;case 3:if(b.Ca&&b.Ca==k){x.B(0);break}b.Ca=k;x.o(8);
return x.h(Wt(a,b,k),10);case 10:p=x.j;if(!a.h)return x.return();y=a.h.T;y.H&&Dc(y.H,p,0,f);a.V.push(k.startTime);x.u(9);break;case 8:throw t=x.m(),b.Ca=null,t;case 9:if(!a.h)return x.return();b.sb||(u=null,b.type===e.oa?u=a.i.get(e.X):b.type===e.X&&(u=a.i.get(e.oa)),u&&u.type==e.X?a.h.dd(k,b.stream,u.stream.isAudioMuxedInVideo,!0,null):a.h.dd(k,b.stream,b.stream.codecs.includes(","),!0,null));v=Math.max.apply(Math,[0].concat(F(a.V)));w=a.h.Eb();if(w+d>v)return x.h(Tt(a,b,k.startTime,d),0);x.B(0)}})}
function Xt(a,b,c){var d,e,f,g,h,k,l,m,n,p,t;return H(function(u){switch(u.i){case 1:d=!1;e=r(a.i.values());for(f=e.next();!f.done;f=e.next())if(g=f.value,g!=b&&g.ng){d=!0;break}if(d){u.B(2);break}if(a.l.avoidEvictionOnQuotaExceededError){h=Yt(a,c);if(k=a.h.disableStream(b.stream,h))return u.return();ut(a,b,4);return u.return()}l=Math.round(100*a.D);if(l>20){a.D-=.2;u.B(3);break}if(l>4){a.D-=.04;u.B(3);break}m=Yt(a,c);n=a.h.disableStream(b.stream,m);if(!n){b.Yc=!0;a.G=!0;a.h.onError(c);u.B(5);break}a.D=
1;p=a.h.Eb();return u.h(Zt(a,b,p),5);case 5:return u.return();case 3:return b.ng=!0,t=a.h.Eb(),u.h(Zt(a,b,t),2);case 2:ut(a,b,4),u.l()}})}
function Ut(a,b,c,d){var e,f,g,h,k,l,m,n,p,t,u,v,w,x,y,z,D;return H(function(A){switch(A.i){case 1:e=Ac;f=b.Ca==null;g=[];h=Math.max(0,Math.max(c.F,a.ua)-.1);k=Math.min(c.D,a.ra)+.1;a.l.clampAppendWindowToDuration&&(l=a.j.presentationTimeline.getDuration(),l<Infinity&&(k=Math.min(k,l)));m=c.codecs||b.stream.codecs;n=Ke(m);p=Le(c.mimeType||b.stream.mimeType);t=c.l;if(t==b.Le&&h==b.Qb&&k==b.Pb&&n==b.Je&&p==b.Ke){A.B(2);break}u=b.Je&&b.Ke&&ls(a.h.T,b.type,p,m,Jt(a));if(!u){A.B(3);break}v=null;b.type===
e.oa?v=a.i.get(e.X):b.type===e.X&&(v=a.i.get(e.oa));if(!v){A.B(3);break}return A.h(lt(v).catch(function(){}),5);case 5:v.bb=null,v.Qb=null,v.Pb=null,Dt(a,v);case 3:return A.h($t(a,b,t,h,k,c,n,p),2);case 2:return fk(c.initSegmentReference,b.bb)||(b.bb=c.initSegmentReference,c.j&&c.initSegmentReference&&(w=Wt(a,b,c.initSegmentReference),x=function(){var B,E,C,G,K,L,N,J,O,M,P;return H(function(U){switch(U.i){case 1:return U.o(2),U.h(w,4);case 4:return B=U.j,So(a.m),E=null,C=new Map,G={projection:null,
hfov:null},b.stream&&(K=b.stream.videoLayout)&&(L=K.split("/"),L.includes("PROJ-RECT")?G.projection="rect":L.includes("PROJ-EQUI")?G.projection="equi":L.includes("PROJ-HEQU")?G.projection="hequ":L.includes("PROJ-PRIM")?G.projection="prim":L.includes("PROJ-AIV")&&(G.projection="aiv")),N=new ih,N.ma(["moov","trak","mdia"],nh).S("mdhd",function(Q){E=Fh(Q.reader,Q.version).timescale}).S("hdlr",function(Q){Q=Q.reader;Q.skip(4);Q=Q.Ea(4,!1);switch(String.fromCharCode(Q[0],Q[1],Q[2],Q[3])){case "soun":C.set(e.X,
E);break;case "vide":C.set(e.oa,E)}E=null}),b.type!==e.oa||G.projection||N.ma(["minf","stbl"],nh).S("stsd",sh).ma([].concat(F(Ah),["encv"]),th).ma(["vexu","proj"],nh).S("prji",function(Q){Q=Q.reader.hd();G.projection=Q}).box("hfov",function(Q){Q=Q.reader.R()/1E3;G.hfov=Q}),N.parse(B,!0,!0),b.type===e.oa&&au(a,G),C.has(b.type)?c.initSegmentReference.timescale=C.get(b.type):E!=null&&(c.initSegmentReference.timescale=E),J=b.stream.segmentIndex,J instanceof Fk&&(O=Hk(J,c.startTime)),M=b.stream.closedCaptions&&
b.stream.closedCaptions.size>0,U.h(a.h.Xg(b.type,B),5);case 5:return U.h(Jr(a.h.T,b.type,B,null,b.stream,M,b.Hc,d,!1,!1,O),6);case 6:U.u(0);break;case 2:throw P=U.m(),b.bb=null,P;}})},y=c.startTime,f&&(z=Cr(a.h.T,b.type),z!=null&&(y=z)),a.h.Bk(y,c.initSegmentReference),g.push(x()))),D=b.Ca?b.Ca.discontinuitySequence:-1,c.discontinuitySequence!=D&&g.push(Xr(a.h.T,b.type,c.startTime)),A.h(Promise.all(g),0)}})}
function $t(a,b,c,d,e,f,g,h){var k,l,m,n,p;return H(function(t){switch(t.i){case 1:k=Ac;l=Jt(a);t.o(2);b.Qb=d;b.Pb=e;g&&(b.Je=g);h&&(b.Ke=h);b.Le=c;m=a.j.sequenceMode||a.j.type=="HLS";n=null;b.type===k.oa?n=a.i.get(k.X):b.type===k.X&&(n=a.i.get(k.oa));if(!(n&&n.stream&&n.stream.isAudioMuxedInVideo)){t.B(4);break}return t.h(Ur(a.h.T,n.type,c,d,e,m,n.stream.mimeType,n.stream.codecs,l),4);case 4:return t.h(Ur(a.h.T,b.type,c,d,e,m,f.mimeType||b.stream.mimeType,f.codecs||b.stream.codecs,l),6);case 6:t.u(0);
break;case 2:throw p=t.m(),b.Qb=null,b.Pb=null,b.Je=null,b.Ke=null,b.Le=null,p;}})}
function Vt(a,b,c,d,e,f,g,h){g=g===void 0?!1:g;h=h===void 0?!1:h;var k,l,m,n,p,t;return H(function(u){switch(u.i){case 1:return k=d.closedCaptions&&d.closedCaptions.size>0,a.l.shouldFixTimestampOffset&&(l=d.mimeType=="video/mp4"||d.mimeType=="audio/mp4",m=null,e.initSegmentReference&&(m=e.initSegmentReference.timescale),(n=l&&m&&d.type==="video"&&a.j.type=="DASH")&&(new ih).ma(xh,nh).S("tfdt",function(v){var w,x,y,z,D,A;return H(function(B){w=Eh(v.reader,v.version);x=w.wb;if(!x)return B.return();
y=-x/m;z=Number(b.Le)||0;if(!(z<y))return B.B(0);D=b.Qb;A=b.Pb;return B.h($t(a,b,y,D,A,e),0)})}).parse(f,!1,g)),u.h(Zt(a,b,c),2);case 2:return So(a.m),p=b.Hc,b.Hc=!1,u.h(a.h.Xg(b.type,f),3);case 3:return u.h(Jr(a.h.T,b.type,f,e,d,k,p,h,g),4);case 4:return t=u.j,So(a.m),u.return(t)}})}
function Zt(a,b,c){var d,e,f,g,h,k,l,m,n,p;return H(function(t){if(t.i==1){a.I==b&&(a.I=null);d=b.stream.segmentIndex;d instanceof Fk&&(d.Ua(a.j.presentationTimeline.Ob()),e=[],Gk(d,function(u){e.push(u.qe())}));f=Math.max(a.l.bufferBehind*a.D,a.j.presentationTimeline.i);g=Ar(a.h.T,b.type);if(g==null)return t.return();h=c-g;k=a.l.evictionGoal;l=a.j.presentationTimeline.yb();m=a.j.presentationTimeline.ob();n=m-l;p=h-f;n>k&&(p=Math.max(h-f,l-k-g));return p<=k?t.return():t.h(a.h.T.remove(b.type,g,g+
p,e),2)}if(t.i!=4)return So(a.m),a.I?t.h(Zt(a,a.I,c),4):t.B(0);So(a.m);t.l()})}function Ot(a){return a&&a.type==wc&&(a.stream.mimeType==Re||a.stream.mimeType==Se)}
function Wt(a,b,c,d){var e,f,g,h,k;return H(function(l){switch(l.i){case 1:if(e=c.yc())return l.return(e);f=null;if(b.Y){var m=b.Y,n=m.h;c instanceof ek&&(n=m.l);n.has(c)?(m=n.get(c),d&&(m.Eg=d),f=m.Sd):f=null}f||(f=Kt(c,b.stream,d||null,a.l.retryParameters,a.h.Dc));g=0;b.ba&&(g=b.ba.i);b.operation=f;return l.h(f.promise,2);case 2:h=l.j;b.operation=null;k=h.data;if(!c.aesKey){l.B(3);break}return l.h(ul(k,c.aesKey,g),4);case 4:k=l.j;case 3:return l.return(k)}})}
function Kt(a,b,c,d,e,f){f=f===void 0?!1:f;var g=a instanceof V?a:void 0,h=g?1:0;a=xl(a.Oa(),a.startByte,a.endByte,d,c);a.contentType=b.type;return e.request(Hj,a,{type:h,stream:b,segment:g,isPreload:f})}
function Ft(a,b,c,d){var e,f,g;return H(function(h){if(h.i==1)return b.sb=!1,b.rd=!1,b.Sc=0,b.xb=!0,b.Ca=null,b.ba=null,b.Y&&!a.o.has(b.stream)&&Ys(b.Y,c),d?(f=a.h.Eb(),g=a.h.T.getDuration(),h.h(a.h.T.remove(b.type,f+d,g),3)):h.h(Tr(a.h.T,b.type),4);if(h.i!=3){So(a.m);if(!c)return h.B(3);e=R();return e.Ye()?h.h(a.h.T.flush(b.type),3):h.B(3)}So(a.m);b.xb=!1;b.endOfStream=!1;b.wa||b.Wa||ut(a,b,0);h.l()})}
function ut(a,b,c){var d=b.type;if(d!=wc||a.i.has(d))b.Wa=(new gf(function(){var e;return H(function(f){if(f.i==1)return f.o(2),f.h(Lt(a,b),4);if(f.i!=2)return f.u(0);e=f.m();if(a.h)a.h.onError(e);f.l()})})).ka(c)}function kt(a){a.Wa!=null&&(a.Wa.stop(),a.Wa=null)}function lt(a){return H(function(b){return a.operation?b.h(a.operation.abort(),0):b.B(0)})}
function Mt(a,b,c){var d,e,f,g,h,k,l,m,n,p;return H(function(t){switch(t.i){case 1:return c.code==3024?(b.wa=!1,kt(b),ut(a,b,0),t.return()):t.h(a.qa.attempt(),2);case 2:So(a.m);if(c.code!=3015&&c.code!=3014&&(c.category!==1||c.code==1003)){t.B(3);break}if(b.sc)return wt(a,!1),t.return();d=!1;if(c.code!=3015&&c.code!=3014){t.B(4);break}return t.h(Pt(a,!0),5);case 5:d=t.j;e=r(a.i.values());for(f=e.next();!f.done;f=e.next())g=f.value,kt(g);So(a.m);case 4:h=Yt(a,c),k=a.h.disableStream(b.stream,h),c.handled=
k||d,k&&(c.severity=1);case 3:if(c.handled||c.code!=1011){t.B(6);break}l=a.h.Eb();m=Cr(a.h.T,b.type);for(n=Qt(a,b,l,m);((p=n)==null?void 0:p.kc())===2;)b.Ca=n,n=Qt(a,b,l,m);if(!n){t.B(6);break}return t.h(Xr(a.h.T,b.type,n.startTime),8);case 8:return b.wa=!1,b.Yc=!1,kt(b),ut(a,b,0),t.return();case 6:if(!c.handled||c.code!=1011)a.h.onError(c);c.handled||a.l.failureCallback(c);t.l()}})}
function Yt(a,b){return a.l.maxDisabledTime===0&&b.code==1011?1:b.code==3014||b.code==3015?Infinity:a.l.maxDisabledTime}
function Pt(a,b){b=b===void 0?!1:b;var c,d,e,f,g,h;return H(function(k){if(k.i==1){c=Date.now()/1E3;d=a.l.minTimeBetweenRecoveries;if(!b&&(!a.l.allowMediaSourceRecoveries||c-a.Z<d))return k.return(!1);a.Z=c;e=Ac;if(f=a.i.get(e.X))kt(f),f.operation&&(f.operation.abort(),f.operation=null),f.bb=null,f.Qb=null,f.Pb=null,f.wa=!1,f.sb=!1,f.Sc=0,f.rd=!1,f.xb=!1,f.ba&&f.ba.vg();if(g=a.i.get(e.oa))kt(g),g.operation&&(g.operation.abort(),g.operation=null),g.bb=null,g.Qb=null,g.Pb=null,g.wa=!1,g.sb=!1,g.Sc=
0,g.rd=!1,g.xb=!1,g.ba&&g.ba.vg();h=a.h.video.paused;return k.h(fs(a.h.T,Jt(a)),2)}!g||g.xb||g.wa||g.Wa||ut(a,g,0);!f||f.xb||f.wa||f.Wa||ut(a,f,0);h||a.h.video.play();return k.return(!0)})}function au(a,b){if(a.$.projection!=b.projection||a.$.hfov!=b.hfov){if(b.projection!=null||b.hfov!=null){var c=(new Map).set("detail",b);c=new nj("spatialvideoinfo",c)}else c=new nj("nospatialvideoinfo");c.cancelable=!0;a.h.onEvent(c);a.$=b}}
function bu(a){var b=a.l.crossBoundaryStrategy;return b==="reset_to_encrypted"&&a.ia?"keep":b}
function Ht(a){if(bu(a)!=="keep")return!0;var b=R(),c=a.h.Be();if(!b.cb(c))for(b=r(a.i.keys()),c=b.next();!c.done;c=b.next()){if(c=a.i.get(c.value),c.type!==Ac.Xa&&(c=c.stream)&&c.fullMimeTypes&&c.fullMimeTypes.size>1)return!0}else if(!b.od())for(b=r(a.i.keys()),c=b.next();!c.done;c=b.next())if(c=a.i.get(c.value),c.type!==Ac.Xa&&(c=c.stream)&&c.fullMimeTypes&&c.fullMimeTypes.size>1){a=new Set;b=r(c.fullMimeTypes);for(c=b.next();!c.done;c=b.next())a.add(He(c.value));return a.size>1}return!1}
function Ct(a){a.L.Sa();Ht(a)&&a.L.Fb(a.h.video,["waiting","timeupdate"],function(){It(a)})}function It(a){if(Ht(a)){a.P.stop();var b=a.h.Eb(),c=a.i.get("video")||a.i.get("audio");c&&(c=c.bb)&&c.h!==null&&(b=c.h-b,b<-.1||b>1||(a.H=c.h+.1,a.P.ka(Math.max(0,b))))}}
function Rt(a,b,c){if(b.type===wc)return!1;var d=b.bb;if(!d)return!1;var e=c.initSegmentReference,f=d.h!==e.h;c=f;bu(a)==="reset_to_encrypted"&&(d.encrypted||e.encrypted||(c=!1),d.encrypted&&(a.ia=!0));var g=bu(a);g==="RESET_ON_ENCRYPTION_CHANGE"&&d.encrypted==e.encrypted&&(c=!1);if(g==="keep"&&d.mimeType&&e.mimeType){g=Ie(Me(d.mimeType));var h=Ie(Me(e.mimeType));d.mimeType==e.mimeType&&g==h&&(c=!1)}if(f=(g=(a.i.get("video")||a.i.get("audio"))===b)&&f&&a.N)a.N=!1;g&&c&&(f||b.Hc)&&Pt(a,!0).then(function(){var k=
(new Map).set("oldEncrypted",d.encrypted).set("newEncrypted",e.encrypted);a.h.onEvent(new nj("boundarycrossed",k))});return c}function Jt(a,b){function c(f){if(f.fullMimeTypes&&f.fullMimeTypes.size>1&&a.i.has(f.type)){var g=a.i.get(f.type),h=Cr(a.h.T,g.type),k=a.h.Eb();(g=Qt(a,g,k,h))&&g.codecs&&g.mimeType&&(f.codecs=g.codecs,f.mimeType=g.mimeType)}}b=b===void 0?!1:b;var d=new Map,e=a.u.audio;e&&(c(e),d.set("audio",e));if(e=a.u.video)c(e),d.set("video",e);b&&a.F&&d.set(wc,a.F);return d};function cu(){this.h=null;this.i=[]}function du(a,b){var c=0;a.h&&a.h.state==b&&(c+=a.h.duration);a=r(a.i);for(var d=a.next();!d.done;d=a.next())d=d.value,c+=d.state==b?d.duration:0;return c}function eu(a){function b(f){return{timestamp:f.timestamp,state:f.state,duration:f.duration}}for(var c=[],d=r(a.i),e=d.next();!e.done;e=d.next())c.push(b(e.value));a.h&&c.push(b(a.h));return c};function fu(){this.j=this.i=null;this.h=[]}function gu(a,b,c){a.j!=b&&(a.j=b,a.h.push({timestamp:Date.now()/1E3,id:b.id,type:"text",fromAdaptation:c,bandwidth:null}))};function hu(){this.F=this.$=NaN;this.m="";this.j=this.Nh=this.C=this.D=this.N=this.G=this.A=this.o=this.L=this.u=this.H=this.i=this.W=this.Z=this.P=this.U=this.V=NaN;this.O=0;this.I=this.K=NaN;this.h=new cu;this.l=new fu}function iu(a,b,c){a.V=b;a.U=c}function ju(a,b,c){a.$=b;a.F=c}function ku(a,b){a.i=isNaN(a.i)?b:Math.max(a.i,b)}function lu(a,b){b>=0&&(a.A=b)}function mu(a,b){b>=0&&(a.G=b)}function nu(a,b){b>=0&&(a.N=b)}function ou(a,b){a.j=isNaN(a.j)?b:a.j+b}
function pu(a){var b=a.$,c=a.F,d=a.m,e=a.D,f=a.U,g=a.V,h=a.P,k=a.Z,l=a.W,m=a.C,n=a.i,p=a.H,t=a.u,u=a.L,v=a.o,w=du(a.h,"playing"),x=du(a.h,"paused"),y=du(a.h,"buffering"),z=a.A,D=a.G,A=a.N,B=a.Nh,E=a.j,C=a.O,G=a.K,K=a.I,L=eu(a.h),N=[];a=r(a.l.h);for(var J=a.next();!J.done;J=a.next())J=J.value,N.push({timestamp:J.timestamp,id:J.id,type:J.type,fromAdaptation:J.fromAdaptation,bandwidth:J.bandwidth});return{width:b,height:c,currentCodecs:d,streamBandwidth:e,decodedFrames:f,droppedFrames:g,corruptedFrames:h,
stallsDetected:k,gapsJumped:l,estimatedBandwidth:m,completionPercent:n,loadLatency:p,timeToFirstFrame:t,manifestTimeSeconds:u,drmTimeSeconds:v,playTime:w,pauseTime:x,bufferingTime:y,licenseTime:z,liveLatency:D,maxSegmentDuration:A,manifestSizeBytes:B,bytesDownloaded:E,nonFatalErrorCount:C,manifestPeriodCount:G,manifestGapCount:K,stateHistory:L,switchHistory:N}};function qu(a,b,c,d){oj.call(this);this.U=a;this.$=b;this.Ga=d.networkingEngine;this.A=c;this.m=null;this.Aa=0;this.Pa=d.re;this.I=d.nk;this.Qa=d.pk;this.j=d.config;this.o=this.L=this.h=null;this.ra=!1;this.N=d.Hk;this.ua=!1;this.V=d.Pk||new Ms(function(){return{start:0,end:Infinity}});this.za=!1;this.l=null;this.W=!1;this.C=null;this.F=new Map;this.ya=!1;this.La=d.Gk;this.ea=new hu;this.qa=Promise.withResolvers();this.G=Promise.withResolvers();this.Z=null;this.D=!1;this.ia=d.Zi;this.Ra=d.Ck;this.u=
this.i=null;this.K=!1;this.P=[];this.O=[];this.H=!0}ra(qu,oj);function ru(a,b,c){(a=b?a.O:a.P)?a.push(c):c()}function su(a){if(a.O)for(var b=r(a.O),c=b.next();!c.done;c=b.next())c=c.value,c();a.O=null}function tu(a,b){a.Z=b;a.K=!0;if(a.P){b=r(a.P);for(var c=b.next();!c.done;c=b.next())c=c.value,c()}a.P=null}q=qu.prototype;q.getStartTime=function(){return this.A};q.Of=function(){return this.$};q.ze=function(){return this.U};q.Nf=function(){return this.h};function uu(a){a.ua=!0;return a.N}
function vu(a){a.za=!0;return a.V}q.getStats=function(){return this.ea};function wu(a){a.W=!0;return a.l}function xu(a,b){a.l=b;a.I.h=b;a.W=!0}q.Pj=function(){return this.i?Jf(this.i):null};q.Oj=function(){return this.u?Kf(this.u):null};function yu(a){a.ya=!0;return a.F}
q.start=function(){var a=this;(function(){var b;return H(function(c){switch(c.i){case 1:return c.h(Promise.resolve(),2);case 2:return c.o(3),c.h(zu(a),5);case 5:Au(a);if("webkit"===window.shakaMediaKeysPolyfill){c.B(6);break}return c.h(Bu(a),7);case 7:Au(a);case 6:return c.h(Cu(a),8);case 8:Au(a);if(!a.ia){c.B(9);break}return c.h(Du(a),10);case 10:Au(a);case 9:if(!a.ia||!a.l){c.B(11);break}return c.h(Dp(a.l),12);case 12:Au(a);case 11:a.G.resolve();c.u(0);break;case 3:b=c.m(),b instanceof T&&(b.code==
7001||b.code==7003)||a.G.reject(b),c.l()}})})()};q.dispatchEvent=function(a){return this.Z?this.Z.dispatchEvent(a):oj.prototype.dispatchEvent.call(this,a)};q.onError=function(a){a.severity===2&&(this.G.reject(a),this.destroy());var b=(new Map).set("detail",a);b=new nj("error",b);this.dispatchEvent(b);b.defaultPrevented&&(a.handled=!0)};function Au(a){if(a.D)throw new T(2,7,7003);}function Eu(a,b){a.dispatchEvent(new nj("onstatechange",(new Map).set("state",b)))}
function zu(a){var b,c,d,e,f,g;return H(function(h){switch(h.i){case 1:Eu(a,"manifest-parser");a.o||(a.L=Mc(a.U,a.$),a.o=a.L(),a.o.configure(a.j.manifest,function(){return a.H}));b=Date.now()/1E3;Eu(a,"manifest");if(a.h){h.B(2);break}return h.h(a.o.start(a.U,a.Qa),3);case 3:return a.h=h.j,Fu(a.h),a.D||a.Ra(a.h),h.h(Gu(a),2);case 2:return a.qa.resolve(),c=new nj("manifestparsed",void 0),h.h(Promise.resolve(),5);case 5:a.dispatchEvent(c);if(a.h.variants.length==0)throw new T(2,4,4036);Fu(a.h);d=br(a.I,
a.h);if(!d){h.B(6);break}e=new nj("trackschanged",void 0);return h.h(Promise.resolve(),7);case 7:Au(a),a.dispatchEvent(e);case 6:f=Date.now()/1E3,g=f-b,g>=0&&(a.ea.L=g),h.l()}})}
function Bu(a,b){var c,d,e,f,g;return H(function(h){switch(h.i){case 1:if(!a.h||a.l)return h.return();Eu(a,"drm-engine");a.Aa=Date.now()/1E3;a.l=a.Pa();a.I.h=a.l;a.l.configure(a.j.drm,function(){return a.H});c=Sf(a.h.variants);d=!0;a.h&&a.h.presentationTimeline&&(d=a.h.presentationTimeline.na());return h.h(bp(a.l,c,a.h.offlineSessionIds,d),2);case 2:Au(a);if(!b){h.B(3);break}return h.h(a.l.ub(b),4);case 4:Au(a);case 3:return a.m&&(e=a.m.getConfiguration(),e.keySystem=Hu(a),a.m.configure(e)),h.h($q(a.I,
a.h),5);case 5:f=h.j;if(!f){h.B(0);break}g=new nj("trackschanged",void 0);return h.h(Promise.resolve(),7);case 7:a.dispatchEvent(g),h.l()}})}q.configure=function(a,b){a=Wm(a,b);en(this.j,a);Iu(this)};q.getConfiguration=function(){return id(this.j)};
function Gu(a){var b;return H(function(c){a.m||(a.m=a.j.adaptationSetCriteriaFactory(),b={preferredAudio:a.j.preferredAudio,preferredVideo:a.j.preferredVideo,language:"",role:"",videoRole:"",channelCount:0,hdrLevel:"",spatialAudio:!1,videoLayout:"",audioLabel:"",videoLabel:"",preferredAudioCodecs:[],preferredAudioChannelCount:0,codecSwitchingStrategy:a.j.mediaSource.codecSwitchingStrategy,audioCodec:"",activeAudioCodec:"",activeAudioChannelCount:0,keySystem:Hu(a)},fn(b),a.m.configure(b));if(a.i||
!a.h.variants.length||a.h.variants.length!=1&&a.h.type!="HLS")return c.B(0);a.i=Ju(a);return a.i?c.h(Ku(a.i),0):c.B(0)})}function Cu(a){return H(function(b){if(b.i==1)return!a.i||a.h.variants.includes(a.i)?b.B(0):b.h(Lu(a.i),3);a.i=Ju(a);return a.i?b.h(Ku(a.i),0):b.B(0)})}
function Du(a){var b,c,d,e,f;return H(function(g){!a.i&&(b=Ju(a))&&(a.i=b);if(!a.i)return g.B(0);c=a.h.presentationTimeline.isLive();d=[];e=a.i;e.video&&d.push(Mu(a,e.video,c));e.audio&&d.push(Mu(a,e.audio,c));if(f=Nu(a,e))d.push(Mu(a,f,c)),a.u=f;return g.h(Promise.all(d),0)})}
function Ju(a){if(!a.C){var b=a.j.abrFactory;a.C=b();a.C.configure(a.j.abr)}b=a.h.isLowLatency&&a.j.streaming.lowLatencyMode;var c=Sf(a.h.variants);c=a.m.create(c);a.C.setVariants(Array.from(c.values()),b);return a.C.chooseVariant(!0)}function Nu(a,b){var c=null,d=Vf(a.h.textStreams,a.j.preferredText);d.length&&(c=d[0]);!c&&(b==null?0:b.audio)&&a.j.accessibility.handleForcedSubtitlesAutomatically&&(d=Tf(a.h.textStreams,b.audio.language,"",!0),d.length&&(c=d[0]));return c}
function Mu(a,b,c){var d,e,f,g,h;return H(function(k){if(k.i==1)return d=a.j.streaming.segmentPrefetchLimit||2,e=new Ps(d,b,function(l,m,n){return Kt(l,m,n||null,a.j.streaming.retryParameters,a.Ga,a.H)},!1),a.F.set(b.id,e),b.segmentIndex?k.B(2):k.h(b.createSegmentIndex(),2);f=typeof a.A==="number"?a.A:0;(h=(g=b.segmentIndex.jb(f))?g.next().value:null)||(h=b.segmentIndex.If());return h?c?h.initSegmentReference?k.h(Ss(e,h.initSegmentReference),0):k.B(0):k.h(Rs(e,h.startTime),0):k.B(0)})}
function Iu(a){var b,c,d,e,f,g,h,k,l,m,n,p,t;H(function(u){if(u.i==1){if(!a.i)return u.return();b=a.h.presentationTimeline.isLive();c=[];d=function(v){v&&(a.F.has(v.id)&&(Ys(a.F.get(v.id)),a.F.delete(v.id)),v.segmentIndex&&v.closeSegmentIndex&&c.push(v.closeSegmentIndex()))};e=function(){var v=a.i;v=r([v.video,v.audio]);for(var w=v.next();!w.done;w=v.next())d(w.value);a.u=null};f=function(){d(a.u);a.u=null};g=a.m.getConfiguration();h={preferredAudio:a.j.preferredAudio,preferredVideo:a.j.preferredVideo,
language:"",role:"",videoRole:"",channelCount:0,hdrLevel:"",spatialAudio:!1,videoLayout:"",audioLabel:"",videoLabel:"",preferredAudioCodecs:[],preferredAudioChannelCount:0,codecSwitchingStrategy:a.j.mediaSource.codecSwitchingStrategy,audioCodec:"",activeAudioCodec:"",activeAudioChannelCount:0,keySystem:Hu(a)};fn(h);kd(g)!=kd(h)&&(a.m.configure(h),e(),a.i=Ju(a));a.i?(k=Nu(a,a.i))?k!=a.u&&(f(),a.u=k):f():f();return u.h(Promise.all(c),2)}l=[];if(a.i){m=a.i;n=r([m.video,m.audio]);for(p=n.next();!p.done;p=
n.next())t=p.value,l.push(Mu(a,t,b));a.u&&l.push(Mu(a,a.u,b))}return u.h(Promise.all(l),0)})}function Ku(a){var b,c,d,e;return H(function(f){b=[];c=r([a.video,a.audio]);for(d=c.next();!d.done;d=c.next())(e=d.value)&&!e.segmentIndex&&b.push(e.createSegmentIndex());return b.length>0?f.h(Promise.all(b),0):f.B(0)})}
function Lu(a){var b,c,d,e;return H(function(f){b=[];c=r([a.video,a.audio]);for(d=c.next();!d.done;d=c.next())(e=d.value)&&e.segmentIndex&&e.closeSegmentIndex&&b.push(e.closeSegmentIndex());return b.length>0?f.h(Promise.all(b),0):f.B(0)})}q.ll=function(){return this.G.promise};
q.destroy=function(){var a=this,b,c,d;return H(function(e){if(e.i==1)return a.D=!0,!a.o||a.ra?e.B(2):e.h(a.o.stop(),2);if(e.i!=4)return a.C&&a.C.release(),a.N&&!a.ua&&a.N.release(),a.za||a.V.release(),!a.l||a.W?e.B(4):e.h(a.l.destroy(),4);if(a.F.size>0&&!a.ya)for(b=r(a.F.values()),c=b.next();!c.done;c=b.next())d=c.value,Ys(d);e.l()})};function Hu(a){return Wb(a.l?a.l.Nb():null)}
function Fu(a){function b(c){return c.video&&c.audio||c.video&&c.video.codecs.includes(",")}a.variants.some(b)&&(a.variants=a.variants.filter(b))}I("shaka.media.PreloadManager",qu);qu.prototype.destroy=qu.prototype.destroy;qu.prototype.waitForFinish=qu.prototype.ll;qu.prototype.getPrefetchedTextTrack=qu.prototype.Oj;qu.prototype.getPrefetchedVariantTrack=qu.prototype.Pj;function Ou(a){oj.call(this);this.h=a;this.i=null}ra(Ou,oj);Ou.prototype.release=function(){this.h=null;oj.prototype.release.call(this)};Ou.prototype.l=function(a){if(this.h&&(a=this.h.Pf(a))){var b=a.ai-a.start;this.i!=null&&Math.abs(b-this.i)>.5&&this.dispatchEvent(new nj("change",new Map([["programDateTime",new Date(a.ai*1E3)],["timestamp",a.start]])));this.i=b}};function Pu(a,b){oj.call(this);var c=this;this.j=a;this.m=b;this.h=new Map;this.o=[{Oc:null,Nc:Qu,Ac:function(d,e){return Ru(c,"enter",d,e)}},{Oc:Su,Nc:Qu,Ac:function(d,e){return Ru(c,"enter",d,e)}},{Oc:Tu,Nc:Qu,Ac:function(d,e){return Ru(c,"enter",d,e)}},{Oc:Qu,Nc:Su,Ac:function(d,e){return Ru(c,"exit",d,e)}},{Oc:Qu,Nc:Tu,Ac:function(d,e){return Ru(c,"exit",d,e)}},{Oc:Su,Nc:Tu,Ac:function(d,e){e?Ru(c,"skip",d,e):(Ru(c,"enter",d,e),Ru(c,"exit",d,e))}},{Oc:Tu,Nc:Su,Ac:function(d,e){return Ru(c,"skip",
d,e)}}];this.i=new ib;this.i.J(this.j,"regionremove",function(d){c.h.delete(d.region)})}ra(Pu,oj);Pu.prototype.release=function(){this.j=null;this.h.clear();this.i.release();this.i=null;oj.prototype.release.call(this)};
Pu.prototype.l=function(a,b){if(!this.m||a!=0){this.m=!1;for(var c=r(this.j.h.values()),d=c.next();!d.done;d=c.next()){d=d.value;var e=this.h.get(d),f=a<d.startTime?Su:a>d.endTime?Tu:Qu;this.h.set(d,f);for(var g=r(this.o),h=g.next();!h.done;h=g.next())h=h.value,h.Oc==e&&h.Nc==f&&h.Ac(d,b)}}};function Ru(a,b,c,d){b=new nj(b,new Map([["region",c],["seeking",d]]));a.dispatchEvent(b)}var Su=1,Qu=2,Tu=3;function Uu(){}Uu.prototype.parse=function(a){function b(h,k){k&&d.push({key:h,description:"",data:k,mimeType:null,pictureType:null})}function c(h,k){return Db(a.subarray(e+h,e+h+k)).replace(/\0/g,"").trim()}var d=[],e=a.length-128;if(e<0||a[e]!==84||a[e+1]!==65||a[e+2]!==71)return d;b("TIT2",c(3,30));b("TPE1",c(33,30));b("TALB",c(63,30));b("TYER",c(93,4));var f="",g=null;a[e+125]===0?(f=c(97,28),g=a[e+126]):f=c(97,30);b("COMM",f);g!==null&&b("TRCK",String(g));b("TCON",String(a[e+127]));return d};
I("shaka.metadata.Id3V1Utils",Uu);Uu.prototype.parse=Uu.prototype.parse;for(var Vu=r(Ee),Wu=Vu.next();!Wu.done;Wu=Vu.next())Yh(Wu.value,function(){return new Uu});function Xu(){}Xu.prototype.parse=function(a){var b=[];(new ih).ma(["moov","udta"],nh).S("meta",nh).box("ilst",function(c){for(;c.reader.Va()&&!(c.reader.Na()-c.reader.va()<8);){var d=c.reader.R(),e=mh(c.reader.R());if(d<8)break;d=c.reader.Ea(Math.min(d-8,c.reader.Na()-c.reader.va()),!1);(e=e==="----"?Yu(d):Zu(e,d))&&b.push(e)}}).parse(a);return b};
function Yu(a){var b="",c="",d=null;(new ih).S("mean",function(e){b=Db(e.reader.Ea(e.reader.Na()-e.reader.va(),!1))}).S("name",function(e){c=Db(e.reader.Ea(e.reader.Na()-e.reader.va(),!1))}).S("data",function(e){d=$u(e)}).parse(a);return d&&c?{key:c,data:d.data,description:b?"Domain: "+b:"",mimeType:d.mimeType,pictureType:d.pictureType}:null}
function Zu(a,b){var c=av.get(a)||a,d=null;(new ih).S("data",function(e){e=$u(e,a);d={key:c,data:e.data,description:"",mimeType:e.mimeType,pictureType:e.pictureType}}).parse(b);return d}
function $u(a,b){b=b===void 0?"":b;a.reader.skip(4);var c=a.reader.Ea(a.reader.Na()-a.reader.va(),!1);if((b==="trkn"||b==="disk")&&c.length>=6)return a=zb(c),c=a.getUint16(2,!1),a=a.getUint16(4,!1),{data:a>0?c+"/"+a:""+c,mimeType:null,pictureType:null};switch(a.flags){case 13:return{data:ub(c),mimeType:"image/jpeg",pictureType:3};case 14:return{data:ub(c),mimeType:"image/png",pictureType:3};case 21:a=zb(c);switch(c.length){case 1:a=a.getInt8(0);break;case 2:a=a.getInt16(0,!1);break;case 3:a=c[0]<<
16|c[1]<<8|c[2];a&8388608&&(a|=-16777216);break;case 4:a=a.getInt32(0,!1);break;default:for(a=0,c=r(c),b=c.next();!b.done;b=c.next())a=a<<8|b.value}return{data:a,mimeType:null,pictureType:null};default:return{data:Db(c).replace(/\0/g,""),mimeType:null,pictureType:null}}}I("shaka.metadata.IlstUtils",Xu);Xu.prototype.parse=Xu.prototype.parse;
var av=(new Map).set("\u00a9nam","TIT2").set("\u00a9ART","TPE1").set("aART","TPE2").set("\u00a9alb","TALB").set("\u00a9gen","TCON").set("\u00a9day","TDRC").set("\u00a9wrt","TEXT").set("trkn","TRCK").set("disk","TPOS").set("\u00a9cmt","COMM").set("covr","APIC").set("cprt","TCOP").set("\u00a9too","TENC").set("tmpo","TBPM").set("cpil","TCMP");Yh("audio/mp4",function(){return new Xu});function bv(){}
bv.prototype.parse=function(a){if(a.length>=4&&a[0]==102&&a[1]==76&&a[2]==97&&a[3]==67){for(var b=[],c=4;c+4<=a.length;){var d=a[c],e=!!(d&128),f=d&127;d=a[c+1]<<16|a[c+2]<<8|a[c+3];c+=4;if(c+d>a.length)break;var g=a.subarray(c,c+d);f==4&&b.push.apply(b,F(cv(g)));if(f==6){try{var h=new $g(g,0),k=h.R(),l=h.R(),m=Db(h.Ea(l,!0)),n=h.R(),p=Db(h.Ea(n,!0));h.skip(16);var t=h.R(),u=h.Ea(t,!0);var v={key:"APIC",data:ub(u),description:p,mimeType:m,pictureType:k}}catch(w){v=null}(f=v)&&b.push(f)}c+=d;if(e)break}return b}return a.length>=
4&&a[0]==79&&a[1]==103&&a[2]==103&&a[3]==83&&(b=Db(a),c=b.indexOf("OpusTags"),c<0&&(c=b.indexOf("vorbis")),c>=0)?cv(a.subarray(c+8)):[]};function cv(a){var b=[];try{var c=new $g(a,ah),d=c.R();c.skip(d);var e=c.R();for(a=0;a<e;a++){var f=c.R(),g=Db(c.Ea(f,!1)),h=g.indexOf("=");if(!(h<0)){var k=g.substring(0,h).toUpperCase();b.push({key:dv[k]||k,data:g.substring(h+1),description:"",mimeType:null,pictureType:null})}}}catch(l){}return b}I("shaka.metadata.VorbisUtils",bv);bv.prototype.parse=bv.prototype.parse;
var dv={TITLE:"TIT2",ARTIST:"TPE1",ALBUM:"TALB",ALBUMARTIST:"TPE2",TRACKNUMBER:"TRCK",DISCNUMBER:"TPOS",DATE:"TDRC",GENRE:"TCON",COMMENT:"COMM",DESCRIPTION:"TIT3",COPYRIGHT:"TCOP",COMPOSER:"TCOM",LYRICS:"USLT",ISRC:"TSRC"};Yh("audio/flac",function(){return new bv});Yh("audio/ogg",function(){return new bv});Yh("audio/vorbis",function(){return new bv});Yh("audio/opus",function(){return new bv});function ev(a){return a>=200&&a<=299&&a!=202||a==304}function fv(a,b,c,d,e,f,g){if(ev(c))return{uri:e||d,originalUri:d,data:b,status:c,headers:a,fromCache:!!a["x-shaka-from-cache"],originalRequest:f};f=null;try{f=Gb(b)}catch(h){}throw new T(1,1,1001,d,c,f,a,g,e||d);};function gv(){}
function hv(a,b,c,d,e,f){var g=new iv;try{Vo(b.headers).forEach(function(m,n){g.append(n,m)})}catch(m){return ij(new T(1,1,1002,a,m,c))}var h=new jv,k={Yg:!1,Mi:!1};a=kv(a,b,c,{body:b.body||void 0,headers:g,method:b.method,signal:h.signal,credentials:b.allowCrossSiteCredentials?"include":void 0},k,d,e,b.streamDataCallback,f.minBytesForProgressEvents||0);a=new hj(a,function(){k.Yg=!0;h.abort();return Promise.resolve()});if(b=b.retryParameters.timeout){var l=new gf(function(){k.Mi=!0;h.abort()});l.ka(b/
1E3);a.finally(function(){l.stop()})}return a}
function kv(a,b,c,d,e,f,g,h,k){var l,m,n,p,t,u,v,w,x,y,z,D,A,B,E;return H(function(C){switch(C.i){case 1:return l=lv,m=mv,p=new ArrayBuffer(0),u=t=0,v={},w=Date.now(),C.o(2),C.h(l(a,d),4);case 4:n=C.j;v=nv(n.headers);g(v);ev(n.status)||(h=null);if(d.method=="HEAD"){C.B(5);break}y=(x=n.headers.get("Content-Length"))?parseInt(x,10):0;if(!n.body)return C.h(n.arrayBuffer(),9);z=n.clone().body.getReader();D=function(G){function K(){var L,N,J,O;return H(function(M){switch(M.i){case 1:return M.o(2),M.h(z.read(),
4);case 4:L=M.j;M.u(3);break;case 2:return M.m(),M.return();case 3:if(L.done){M.B(5);break}t+=L.value.byteLength;if(!h){M.B(5);break}return M.h(h(L.value),5);case 5:N=Date.now();J=t-u;if(N-w>100&&J>=k||L.done)O=L.done?0:y-t,f(N-w,J,O),u=t,w=N;L.done?G.close():(G.enqueue(L.value),K());M.l()}})}K()};new m({start:D});return C.h(n.arrayBuffer(),8);case 8:p=C.j;C.B(5);break;case 9:p=C.j,A=Date.now(),f(A-w,p.byteLength,0);case 5:b.headers.Range&&(B=b.headers.Range.replace("bytes=","").split("-").filter(function(G){return G}).map(function(G){return parseInt(G,
10)}),B.length==2&&p.byteLength!=B[1]-B[0]+1&&Ua("Payload length does not match range requested bytes",b,n));C.u(3);break;case 2:E=C.m();if(e.Yg)throw new T(1,1,7001,a,c);if(e.Mi)throw new T(1,1,1003,a,c);throw new T(1,1,1002,a,E,c);case 3:return C.return(fv(v,p,n.status,a,n.url,b,c))}})}function nv(a){var b={};a.forEach(function(c,d){b[d.trim()]=c});return b}
function ov(){if(window.ReadableStream)try{new ReadableStream({})}catch(a){return!1}else return!1;if(window.Response){if(!(new Response("")).body)return!1}else return!1;return!(!window.fetch||"polyfill"in window.fetch||!window.AbortController)}I("shaka.net.HttpFetchPlugin",gv);gv.isSupported=ov;gv.parse=hv;var lv=window.fetch,jv=window.AbortController,mv=window.ReadableStream,iv=window.Headers;ov()&&(yj("http",hv,2,!0),yj("https",hv,2,!0),yj("blob",hv,2,!0));function pv(){}
function qv(a,b,c,d,e,f){var g=new rv,h=Date.now(),k=0,l=new Promise(function(m,n){function p(){g.onload=null;g.onerror=null;g.ontimeout=null;g.onabort=null;g.onreadystatechange=null;g.onprogress=null}g.open(b.method,a,!0);g.responseType="arraybuffer";g.timeout=b.retryParameters.timeout;g.withCredentials=b.allowCrossSiteCredentials;var t={};g.onabort=function(){n(new T(1,1,7001,a,c));p()};g.onreadystatechange=function(){if(g.readyState===XMLHttpRequest.HEADERS_RECEIVED){var v=g.getAllResponseHeaders().trim().split("\r\n"),w=
{};v=r(v);for(var x=v.next();!x.done;x=v.next()){x=x.value;var y=x.indexOf(": ");y!==-1&&(w[x.slice(0,y).toLowerCase()]=x.slice(y+2))}t=w;e(t)}};g.onload=function(){var v=g.response;try{var w=fv(t,v,g.status,a,g.responseURL,b,c);m(w)}catch(x){n(x)}p()};g.onerror=function(v){n(new T(1,1,1002,a,v,c));p()};g.ontimeout=function(){n(new T(1,1,1003,a,c));p()};g.onprogress=function(v){var w=Date.now(),x=f.minBytesForProgressEvents||0,y=v.loaded-k;if(w-h>100&&y>=x||v.lengthComputable&&v.loaded==v.total)d(w-
h,y,g.readyState==4?0:v.total-v.loaded),k=v.loaded,h=w};for(var u in b.headers)try{g.setRequestHeader(u.toLowerCase(),b.headers[u])}catch(v){throw new T(1,1,1002,a,v,c);}g.send(b.body)});return new hj(l,function(){g.abort();return Promise.resolve()})}I("shaka.net.HttpXHRPlugin",pv);pv.parse=qv;var rv=window.XMLHttpRequest;yj("http",qv,1,!0);yj("https",qv,1,!0);yj("blob",qv,1,!0);for(var sv={ach:"Lwo",ady:"\u0410\u0434\u044b\u0433\u044d\u0431\u0437\u044d",af:"Afrikaans","af-NA":"Afrikaans (Namibia)","af-ZA":"Afrikaans (South Africa)",ak:"T\u0255\u0265i",ar:"\u0627\u0644\u0639\u0631\u0628\u064a\u0629","ar-AR":"\u0627\u0644\u0639\u0631\u0628\u064a\u0629","ar-MA":"\u0627\u0644\u0639\u0631\u0628\u064a\u0629","ar-SA":"\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (\u0627\u0644\u0633\u0639\u0648\u062f\u064a\u0629)","ay-BO":"Aymar aru",az:"Az\u0259rbaycan dili","az-AZ":"Az\u0259rbaycan dili",
"be-BY":"\u0411\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f",bg:"\u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438","bg-BG":"\u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438",bn:"\u09ac\u09be\u0982\u09b2\u09be","bn-IN":"\u09ac\u09be\u0982\u09b2\u09be (\u09ad\u09be\u09b0\u09a4)","bn-BD":"\u09ac\u09be\u0982\u09b2\u09be(\u09ac\u09be\u0982\u09b2\u09be\u09a6\u09c7\u09b6)","bs-BA":"Bosanski",ca:"Catal\u00e0","ca-ES":"Catal\u00e0",cak:"Maya Kaqchikel","ck-US":"\u13e3\u13b3\u13a9 (tsalagi)",
cs:"\u010ce\u0161tina","cs-CZ":"\u010ce\u0161tina",cy:"Cymraeg","cy-GB":"Cymraeg",da:"Dansk","da-DK":"Dansk",de:"Deutsch","de-AT":"Deutsch (\u00d6sterreich)","de-DE":"Deutsch (Deutschland)","de-CH":"Deutsch (Schweiz)",dsb:"Dolnoserb\u0161\u0107ina",el:"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac","el-GR":"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac",en:"English","en-GB":"English (UK)","en-AU":"English (Australia)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-IN":"English (India)",
"en-PI":"English (Pirate)","en-UD":"English (Upside Down)","en-US":"English (US)","en-ZA":"English (South Africa)","en@pirate":"English (Pirate)",eo:"Esperanto","eo-EO":"Esperanto",es:"Espa\u00f1ol","es-AR":"Espa\u00f1ol (Argentine)","es-419":"Espa\u00f1ol (Latinoam\u00e9rica)","es-CL":"Espa\u00f1ol (Chile)","es-CO":"Espa\u00f1ol (Colombia)","es-EC":"Espa\u00f1ol (Ecuador)","es-ES":"Espa\u00f1ol (Espa\u00f1a)","es-LA":"Espa\u00f1ol (Latinoam\u00e9rica)","es-NI":"Espa\u00f1ol (Nicaragua)","es-MX":"Espa\u00f1ol (M\u00e9xico)",
"es-US":"Espa\u00f1ol (Estados Unidos)","es-VE":"Espa\u00f1ol (Venezuela)",et:"eesti keel","et-EE":"Eesti (Estonia)",eu:"Euskara","eu-ES":"Euskara",fa:"\u0641\u0627\u0631\u0633\u06cc","fa-IR":"\u0641\u0627\u0631\u0633\u06cc","fb-LT":"Leet Speak",ff:"Fulah",fi:"Suomi","fi-FI":"Suomi","fo-FO":"F\u00f8royskt",fr:"Fran\u00e7ais","fr-CA":"Fran\u00e7ais (Canada)","fr-FR":"Fran\u00e7ais (France)","fr-BE":"Fran\u00e7ais (Belgique)","fr-CH":"Fran\u00e7ais (Suisse)","fy-NL":"Frysk",ga:"Gaeilge","ga-IE":"Gaeilge (Gaelic)",
gl:"Galego","gl-ES":"Galego","gn-PY":"Ava\u00f1e'\u1ebd","gu-IN":"\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0","gx-GR":"\u1f19\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ae \u1f00\u03c1\u03c7\u03b1\u03af\u03b1",he:"\u05e2\u05d1\u05e8\u05d9\u05ea\u200f","he-IL":"\u05e2\u05d1\u05e8\u05d9\u05ea\u200f",hi:"\u0939\u093f\u0928\u094d\u0926\u0940","hi-IN":"\u0939\u093f\u0928\u094d\u0926\u0940",hr:"Hrvatski","hr-HR":"Hrvatski",hsb:"Hornjoserb\u0161\u0107ina",ht:"Krey\u00f2l",hu:"Magyar","hu-HU":"Magyar","hy-AM":"\u0540\u0561\u0575\u0565\u0580\u0565\u0576",
id:"Bahasa Indonesia","id-ID":"Bahasa Indonesia",is:"\u00cdslenska","is-IS":"\u00cdslenska (Iceland)",it:"Italiano","it-IT":"Italiano",ja:"\u65e5\u672c\u8a9e","ja-JP":"\u65e5\u672c\u8a9e","jv-ID":"Basa Jawa","ka-GE":"\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8","kk-KZ":"\u049a\u0430\u0437\u0430\u049b\u0448\u0430",km:"\u1797\u17b6\u179f\u17b6\u1781\u17d2\u1798\u17c2\u179a","km-KH":"\u1797\u17b6\u179f\u17b6\u1781\u17d2\u1798\u17c2\u179a",kab:"Taqbaylit",kn:"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1","kn-IN":"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1 (India)",
ko:"\ud55c\uad6d\uc5b4","ko-KR":"\ud55c\uad6d\uc5b4 (\u97e9\u56fd)",ku:"Kurd\u00ee","ku-TR":"Kurd\u00ee",la:"Latin","la-VA":"Latin",lb:"L\u00ebtzebuergesch","li-NL":"L\u00e8mb\u00f6rgs",lt:"Lietuvi\u0173","lt-LT":"Lietuvi\u0173",lv:"Latvie\u0161u","lv-LV":"Latvie\u0161u",mai:"\u092e\u0948\u0925\u093f\u0932\u0940, \u09ae\u09c8\u09a5\u09bf\u09b2\u09c0","mg-MG":"Malagasy",mk:"\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438","mk-MK":"\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438 (\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438)",
ml:"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02","ml-IN":"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02","mn-MN":"\u041c\u043e\u043d\u0433\u043e\u043b",mr:"\u092e\u0930\u093e\u0920\u0940","mr-IN":"\u092e\u0930\u093e\u0920\u0940",ms:"Bahasa Melayu","ms-MY":"Bahasa Melayu",mt:"Malti","mt-MT":"Malti",my:"\u1017\u1019\u102c\u1005\u1000\u102c",nb:"Norsk (bokm\u00e5l)","nb-NO":"Norsk (bokm\u00e5l)",ne:"\u0928\u0947\u092a\u093e\u0932\u0940","ne-NP":"\u0928\u0947\u092a\u093e\u0932\u0940",nl:"Nederlands","nl-BE":"Nederlands (Belgi\u00eb)",
"nl-NL":"Nederlands (Nederland)","nn-NO":"Norsk (nynorsk)",no:"Norsk",oc:"Occitan","or-IN":"\u0b13\u0b21\u0b3c\u0b3f\u0b06",pa:"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40","pa-IN":"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40 (\u0a2d\u0a3e\u0a30\u0a24 \u0a28\u0a42\u0a70)",pl:"Polski","pl-PL":"Polski","ps-AF":"\u067e\u069a\u062a\u0648",pt:"Portugu\u00eas","pt-BR":"Portugu\u00eas (Brasil)","pt-PT":"Portugu\u00eas (Portugal)","qu-PE":"Qhichwa","rm-CH":"Rumantsch",ro:"Rom\u00e2n\u0103","ro-RO":"Rom\u00e2n\u0103",ru:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439",
"ru-RU":"\u0420\u0443\u0441\u0441\u043a\u0438\u0439","sa-IN":"\u0938\u0902\u0938\u094d\u0915\u0943\u0924\u092e\u094d","se-NO":"Davvis\u00e1megiella","si-LK":"\u0db4\u0dc5\u0dcf\u0dad",sk:"Sloven\u010dina","sk-SK":"Sloven\u010dina (Slovakia)",sl:"Sloven\u0161\u010dina","sl-SI":"Sloven\u0161\u010dina","so-SO":"Soomaaliga",sq:"Shqip","sq-AL":"Shqip",sr:"\u0421\u0440\u043f\u0441\u043a\u0438","sr-RS":"\u0421\u0440\u043f\u0441\u043a\u0438 (Serbia)",su:"Basa Sunda",sv:"Svenska","sv-SE":"Svenska",sw:"Kiswahili",
"sw-KE":"Kiswahili",ta:"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd","ta-IN":"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd",te:"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41","te-IN":"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41",tg:"\u0437\u0430\u0431\u043e\u0301\u043d\u0438 \u0442\u043e\u04b7\u0438\u043a\u04e3\u0301","tg-TJ":"\u0442\u043e\u04b7\u0438\u043a\u04e3",th:"\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22","th-TH":"\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22 (\u0e1b\u0e23\u0e30\u0e40\u0e17\u0e28\u0e44\u0e17\u0e22)",tl:"Filipino","tl-PH":"Filipino",
tlh:"tlhIngan-Hol",tr:"T\u00fcrk\u00e7e","tr-TR":"T\u00fcrk\u00e7e","tt-RU":"\u0442\u0430\u0442\u0430\u0440\u0447\u0430",uk:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430","uk-UA":"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430",ur:"\u0627\u0631\u062f\u0648","ur-PK":"\u0627\u0631\u062f\u0648",uz:"O'zbek","uz-UZ":"O'zbek",vi:"Ti\u1ebfng Vi\u1ec7t","vi-VN":"Ti\u1ebfng Vi\u1ec7t","xh-ZA":"isiXhosa",yi:"\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9","yi-DE":"\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9 (German)",
zh:"\u4e2d\u6587","zh-HANS":"\u4e2d\u6587\u7b80\u4f53","zh-HANT":"\u4e2d\u6587\u7e41\u9ad4","zh-CN":"\u4e2d\u6587\uff08\u4e2d\u56fd\uff09","zh-HK":"\u4e2d\u6587\uff08\u9999\u6e2f\uff09","zh-SG":"\u4e2d\u6587\uff08\u65b0\u52a0\u5761\uff09","zh-TW":"\u4e2d\u6587\uff08\u53f0\u7063\uff09","zu-ZA":"isiZulu",ase:"American Sign Language",bfi:"British Sign Language",bzs:"Brazilian Sign Language",csn:"Colombian Sign Language",dse:"Dutch Sign Language",dsl:"Danish Sign Language",fsl:"French Sign Language",
gsg:"German Sign Language",gss:"Greek Sign Language",isg:"Irish Sign Language",ise:"Italian Sign Language",jsl:"Japanese Sign Language",mfs:"Mexican Sign Language",ncs:"Nicaraguan Sign Language",nsl:"Norwegian Sign Language",psr:"Portuguese Sign Language",sfb:"French Belgian Sign Language",sfs:"South African Sign Language",sgg:"Swiss German Sign Language",ssp:"Spanish Sign Language",swl:"Swedish Sign Language",vgt:"Flemish Sign Language"},tv=r(Object.keys(sv)),uv=tv.next();!uv.done;uv=tv.next()){var vv=
uv.value;sv[vv.toLowerCase()]=sv[vv]};function wv(a,b){if(a.lineBreak)return"\n";if(a.nestedCues.length)return a.nestedCues.map(function(g){return wv(g,a)}).join("");if(!a.payload)return a.payload;var c=[],d=a.fontWeight>=pe,e=a.fontStyle==qe,f=a.textDecoration.includes(re);d&&c.push(["b"]);e&&c.push(["i"]);f&&c.push(["u"]);e=a.color;e==""&&b&&(e=b.color);d="";(e=xv(e))&&(d+="."+e);e=a.backgroundColor;e==""&&b&&(e=b.backgroundColor);(b=xv(e))&&(d+=".bg_"+b);d&&c.push(["c",d]);return c.reduceRight(function(g,h){var k=r(h);h=k.next().value;
k=k.next().value;return"<"+h+(k===void 0?"":k)+">"+g+"</"+h+">"},a.payload)}
function xv(a){a=a.toLowerCase();var b=a.replace(/\s/g,"").match(/^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i);b?a="#"+(parseInt(b[1],10)|256).toString(16).slice(1)+(parseInt(b[2],10)|256).toString(16).slice(1)+(parseInt(b[3],10)|256).toString(16).slice(1):a.startsWith("#")&&a.length>7&&(a=a.slice(0,7));switch(a){case "white":case "#fff":case "#ffffff":return"white";case "lime":case "#0f0":case "#00ff00":return"lime";case "cyan":case "#0ff":case "#00ffff":return"cyan";case "red":case "#f00":case "#ff0000":return"red";
case "yellow":case "#ff0":case "#ffff00":return"yellow";case "magenta":case "#f0f":case "#ff00ff":return"magenta";case "blue":case "#00f":case "#0000ff":return"blue";case "black":case "#000":case "#000000":return"black"}return null}
function yv(a){a=a.trim().toLowerCase();zv.has(a)&&(a=zv.get(a));var b=a.match(/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/);if(b){a=b[1];a.length<=4&&(a=a.split("").map(function(g){return g+g}).join(""));b=[];for(var c=0;c<a.length;c+=2)b.push(parseInt(a.slice(c,c+2),16));b.length==3?b.push(1):b[3]/=255;return b}if(a=a.match(/^rgba?\(([^)]*)\)$/)){a=a[1].trim().split(/\s*[,/]\s*|\s+/);if(a.length<3||a.length>4)return null;b=[];for(c=0;c<a.length;c++){var d=a[c],e=d.endsWith("%"),f=Number(e?d.slice(0,
-1):d);if(!d||isNaN(f))return null;c<3?(f=e?f*255/100:f,b.push(Math.min(255,Math.max(0,f)))):(f=e?f/100:f,b.push(Math.min(1,Math.max(0,f))))}b.length==3&&b.push(1);return b}return null}function Av(a,b){return(a=yv(a))?"rgba("+a.slice(0,3).join(", ")+", "+Math.min(1,Math.max(0,b))+")":null}
function Bv(a,b){var c=[];a=r(Cv(a));for(var d=a.next();!d.done;d=a.next())if(d=d.value,d.isContainer)c.push.apply(c,F(Bv(d.nestedCues,d)));else{var e=d.clone();e.nestedCues=[];e.payload=wv(d,b);c.push(e)}return c}function Cv(a){var b=[];a=r(a);for(var c=a.next(),d={};!c.done;d={Df:void 0},c=a.next())d.Df=c.value,b.some(function(e){return function(f){return fe(e.Df,f)}}(d))||b.push(d.Df);return b}
function Dv(a,b){function c(e){for(var f=5381,g=e.length;g;)f=f*33^e.charCodeAt(--g);return(f>>>0).toString()}if(a.startTime>=a.endTime)return null;var d=new VTTCue(a.startTime,a.endTime,a.payload);d.id=c(a.startTime.toString())+c(a.endTime.toString())+c(a.payload);d.lineAlign=a.lineAlign;d.positionAlign=a.positionAlign;a.size&&(d.size=a.size);try{d.align=a.textAlign}catch(e){}a.textAlign=="center"&&d.align!="center"&&(d.align="middle");a.writingMode=="vertical-lr"?d.vertical="lr":a.writingMode==
"vertical-rl"&&(d.vertical="rl");a.lineInterpretation==1&&(d.snapToLines=!1);a.line!=null&&(d.line=a.line);a.position!=null&&(d.position=a.position);b&&(a=Ev(b,a.region))&&(d.region=a);return d}
function Ev(a,b){if(!(window.VTTRegion&&"region"in VTTCue.prototype&&b&&b.id&&b.heightUnits==2&&b.widthUnits==Zc&&b.viewportAnchorUnits==Zc))return null;var c=[b.id,b.width,b.height,b.regionAnchorX,b.regionAnchorY,b.viewportAnchorX,b.viewportAnchorY,b.scroll].join("_"),d=a.get(c);d||(d=new VTTRegion,d.id=b.id,d.width=b.width,d.lines=b.height,d.regionAnchorX=b.regionAnchorX,d.regionAnchorY=b.regionAnchorY,d.viewportAnchorX=b.viewportAnchorX,d.viewportAnchorY=b.viewportAnchorY,d.scroll=b.scroll,a.set(c,
d));return d}
function Fv(a,b,c){var d=Bv(b),e=[];b=a.cues?Array.from(a.cues):[];d=r(d);for(var f=d.next(),g={};!f.done;g={$c:void 0},f=d.next())g.$c=f.value,!b.some(function(h){return function(k){return k.startTime==h.$c.startTime&&k.endTime==h.$c.endTime&&k.text==h.$c.payload}}(g))&&g.$c.payload&&(f=Dv(g.$c,c))&&e.push(f);c=e.slice().sort(function(h,k){return h.startTime!=k.startTime?h.startTime-k.startTime:h.endTime!=k.endTime?h.endTime-k.startTime:h.region&&k.region?e.indexOf(h)-e.indexOf(k):"line"in VTTCue.prototype?
e.indexOf(k)-e.indexOf(h):e.indexOf(h)-e.indexOf(k)});c=r(c);for(b=c.next();!b.done;b=c.next())a.addCue(b.value)}function Gv(a,b){var c=!1;a.mode==="disabled"&&(c=!0,a.mode="hidden");for(var d=0;d<a.cues.length;){var e=a.cues[d];b(e)?a.removeCue(e):d++}c&&(a.mode="disabled")}
function Hv(a){function b(d){d.line=c.line;d.lineAlign=c.lineAlign;d.position=c.position;d.positionAlign=c.positionAlign;d.size=c.size;d.displayAlign=c.displayAlign;d.region=c.region;d=r(d.nestedCues);for(var e=d.next();!e.done;e=d.next())b(e.value)}var c=new Vd(0,0,"");b(a)}
var zv=new Map([["transparent","#0000"],["black","#000"],["silver","#c0c0c0"],["gray","#808080"],["grey","#808080"],["white","#fff"],["maroon","#800000"],["red","#f00"],["purple","#800080"],["fuchsia","#f0f"],["magenta","#f0f"],["green","#008000"],["lime","#0f0"],["olive","#808000"],["yellow","#ff0"],["navy","#000080"],["blue","#00f"],["teal","#008080"],["aqua","#0ff"],["cyan","#0ff"]]);function Iv(a){var b=this;this.i=a;this.u=new ib;this.o=new ib;this.l=this.D=null;this.h=new Map;this.A=new Map;this.j=-1;this.C=!1;this.m=null;this.u.J(a,"loaded",function(){return Jv(b)});Jv(this)}q=Iv.prototype;q.configure=function(a){this.D=a};q.remove=function(a,b){if(!this.i)return!1;var c=Kv(this);c&&Gv(c,function(d){return d.startTime<b&&d.endTime>a});return!0};
q.append=function(a){var b=Kv(this);if(b){var c,d,e=(d=(c=this.D)==null?void 0:c.subtitleDelay)!=null?d:0;a=e!==0?a.map(function(f){f=f.clone();f.startTime=Math.max(0,f.startTime+e);f.endTime=Math.max(0,f.endTime+e);return f}):a;c=this.A.getOrInsert(b,new Map);Fv(b,a,c)}};q.destroy=function(){this.i&&(this.l&&Lv(this),this.i=null);this.A.clear();var a;(a=this.m)==null||a.stop();this.m=null;var b;(b=this.u)==null||b.release();this.u=null;var c;(c=this.o)==null||c.release();this.o=null;return Promise.resolve()};
q.isTextVisible=function(){return this.C};q.setTextVisibility=function(a){this.C=a;var b=Kv(this);b?b.mode!=="disabled"&&(a=a?"showing":"hidden",b.mode!==a&&(b.mode=a)):this.i&&this.i.Mf()===Mv&&Nv(this,a)};q.setTextLanguage=function(){};function Lv(a){var b;(b=a.m)==null||b.stop();a.m=null;var c;(c=a.o)==null||c.Sa();b=r(a.h.values());for(c=b.next();!c.done;c=b.next())c.value.remove();a.h.clear();a.A.clear();a.j=-1;a.l=null}
function Ov(a){var b=new Map,c=a.i.pb();c=r(c);for(var d=c.next();!d.done;d=c.next()){d=d.value;if(a.h.has(d.id)){var e=a;var f=e.h.get(d.id);d.active||f.track.mode==="disabled"||(f.track.mode="disabled");e.h.delete(d.id);e=f}else{e=a;f=e.l.ownerDocument.createElement("track");var g=R();g=d.forced&&g.Ba()==="WEBKIT"?"forced":d.kind==="caption"?"captions":"subtitles";f.kind=g;f.label=Pv(d);var h=void 0;g=d.language?d.language in sv?d.language:(h=oc(d.language))!=null?h:"und":"und";f.srclang=g;f.src=
"data:,WEBVTT";f.track.mode="disabled";e.l.appendChild(f);e=f}b.set(d.id,e);d.active&&(a.j=d.id)}c=r(a.h.values());for(d=c.next();!d.done;d=c.next())d=d.value,a.A.delete(d.track),d.remove();a.h=b;a.j<=-1||(a.h.has(a.j)?(b=a.h.get(a.j).track,b.mode==="disabled"&&(b.mode=a.C?"showing":"hidden")):a.j=-1)}
function Qv(a){if(!a.m){var b=a.l;a.m=(new gf(function(){a.m=null;if(a.l===b){a:{var c=-1;if(a.h.has(a.j)){var d=a.h.get(a.j).track.mode;if(d==="showing"){c=a.j;break a}d==="hidden"&&(c=a.j)}d=r(a.h.keys());for(var e=d.next();!e.done;e=d.next()){e=e.value;var f=a.h.get(e);if(f.track.mode==="showing"){c=e;break a}c<0&&f.track.mode==="hidden"&&(c=e)}}d=a.h.get(c);e=r(a.h.values());for(f=e.next();!f.done;f=e.next())f=f.value,f!==d&&f.track.mode!=="disabled"&&(f.track.mode="disabled");a.j!==c&&(a.j=c,
Rv(a,c))}})).ka(0)}}function Kv(a){return a.h.has(a.j)?a.h.get(a.j).track:null}function Nv(a,b){a=Array.from(a.i.Xc().textTracks).filter(function(c){return["captions","subtitles","forced"].includes(c.kind)});if(b)!a.some(function(c){return c.mode==="showing"})&&(b=a.find(function(c){return c.mode==="hidden"}))&&(b.mode="showing");else for(b=r(a),a=b.next();!a.done;a=b.next())a=a.value,a.mode==="showing"&&(a.mode="hidden")}
function Rv(a,b){if(b>-1){var c=a.i.pb().find(function(d){return d.id===b});if(c){a.i.Ic(c);return}}a.i.Ic(null)}function Jv(a){!a.l&&a.i&&a.i.Mf()===Sv&&(a.l=a.i.Xc(),a.u.Ma(a.i,"unloading",function(){return Lv(a)}),a.o.J(a.i,"textchanged",function(){return Ov(a)}),a.o.J(a.l.textTracks,"change",function(){return Qv(a)}),Ov(a))}
function Pv(a){if(a.label)return a.label;if(a.language){var b=oc(a.language);if(window.Intl&&"DisplayNames"in Intl)try{var c=(new Intl.DisplayNames(a.language,{type:"language",languageDisplay:"standard"})).of(a.language);if(c&&c.toLowerCase()!=a.language.toLowerCase())return c.charAt(0).toUpperCase()+c.slice(1)}catch(e){}if(c=sv[a.language])return c;if(c=b&&sv[b])return b===a.language?c:c+" ("+a.language+")"}var d;b=String((d=a.originalTextId)!=null?d:"");return a.language&&a.language!==a.originalTextId?
b+" ("+a.language+")":b}I("shaka.text.NativeTextDisplayer",Iv);Iv.prototype.setTextLanguage=Iv.prototype.setTextLanguage;Iv.prototype.setTextVisibility=Iv.prototype.setTextVisibility;Iv.prototype.isTextVisible=Iv.prototype.isTextVisible;Iv.prototype.destroy=Iv.prototype.destroy;Iv.prototype.append=Iv.prototype.append;Iv.prototype.remove=Iv.prototype.remove;Iv.prototype.configure=Iv.prototype.configure;var Sv=2,Mv=3;function Tv(a){var b=this;this.m=a;this.u=null;this.l=new ib;this.I=Uv.value();this.h=null;this.A=!1;this.C=new Vv;this.L=new gf(function(){Wv(b)});this.K=1E15;this.G=Xv(this);this.j=[this.G];this.F=this.H=this.i=this.o=null;this.D=new Yv(this.C,this.L,function(c){if(b.A&&b.h){var d=b.u.maxTextLength;if(!(c.length<=d)){for(d=c.length-d;d>0&&c[d-1]!==" ";)d--;c="..."+c.slice(d).trimStart()}var e;(e=b.i)!=null&&e.i&&(e.h||(e.h=document.createElement("span"),e.h.setAttribute("translate","no"),e.h.style.backgroundColor=
"rgba(0,0,0,0.8)",e.h.style.padding="0px 5px",e.h.style.margin="2.5% 5%",e.i.appendChild(e.h)),e.h.textContent=c)}},function(){var c;(c=b.i)!=null&&c.h&&(c.h.textContent="")})}q=Tv.prototype;q.configure=function(a){this.u=a;Zv(this)};q.release=function(){this.o=null;this.l.Sa();$v(this);this.m=null;this.l.release();var a;(a=this.i)==null||a.release();this.h&&this.h.parentElement&&(this.h.remove(),this.h=null)};
q.enable=function(a){var b=this;this.I&&(this.h||(this.h=aw(this)),this.h&&(this.i||(this.i=new bw(this.h)),this.A&&a.id==this.o||(this.A=!0,this.o=a.id,this.l.J(this.m,"audiotrackschanged",function(){Wv(b)}),a=this.m.Xc(),this.l.J(a,"seeking",function(){Wv(b)}),this.l.J(a,"pause",function(){$v(b,!1)}),this.l.J(a,"play",function(){Wv(b)}),a.paused||Wv(this))))};
q.disable=function(){if(this.A){this.A=!1;this.o=null;this.l.Sa();$v(this);var a;(a=this.i)==null||a.release();this.i=null;this.C.release();this.D.release()}};q.isSupported=function(){if(!this.I)return!1;this.h||(this.h=aw(this));return this.h?!0:!1};q.pb=function(){if(!this.isSupported())return[];for(var a=r(this.j),b=a.next();!b.done;b=a.next())b=b.value,b.active=b.id==this.o;return this.j};
function Wv(a){var b,c,d,e,f,g,h,k;H(function(l){switch(l.i){case 1:(b=a.i)!=null&&b.h&&(b.h.textContent="");c=a.m.getAudioTracks();if(!c.length)return l.return();d=cw(a);if(!d)return l.return();e=c.find(function(m){return m.active});f="en";e&&e.language&&e.language!="und"&&(f=e.language);g=a.j.find(function(m){return m.id==a.o});h="";g&&g.language&&g.language!="und"&&(h=g.language);if(!a.D.isActive()||a.H!==f||a.F===h){l.B(2);break}a.F=h;return l.h(dw(a.C,f,h),3);case 3:return l.return();case 2:return $v(a),
l.o(4),l.h(dw(a.C,f,h),6);case 6:l.u(5);break;case 4:if(k=l.m(),k.name=="NotSupportedError")return l.return();case 5:return l.h(a.D.start(d,f,a.u.processLocally),7);case 7:a.H=f,a.F=h,l.l()}})}function $v(a,b){a.D.stop(b===void 0?!0:b)}
function cw(a){var b=a.m.Xc();return b?ew.getOrInsertComputed(b,function(){var c=new (window.AudioContext||window.webkitAudioContext),d=c.createMediaElementSource(b),e=c.createMediaStreamDestination();d.connect(e);d.connect(c.destination);var f=e.stream.getAudioTracks()[0];return{dm:c,xm:d,pm:e,aj:f}}).aj:null}
function aw(a){a=a.m.ud;if(!a)return null;var b=document.createElement("div");b.classList.add("shaka-speech-to-text-container");b.style.textAlign="center";b.style.display="flex";b.style.flexDirection="column";b.style.alignItems="center";b.style.justifyContent="flex-end";a.appendChild(b);return b}
function Zv(a){var b=a.j.map(function(e){return e.language}).filter(function(e){return e});if(!db(a.u.languagesToTranslate,b)&&"Translator"in window){a.j=a.j.filter(function(e){if(e.id==a.G.id||a.u.languagesToTranslate.includes(e.language))return!0;e.id==a.o&&a.disable();return!1});b=r(a.u.languagesToTranslate);for(var c=b.next(),d={};!c.done;d={Xf:void 0},c=b.next())d.Xf=c.value,c=a.j.find(function(e){return function(f){return f.language==e.Xf}}(d)),c||(c=Xv(a),c.language=d.Xf,a.j.push(c));b=new nj("textchanged");
a.m.dispatchEvent(b)}}function Xv(a){return{id:a.K++,active:!1,type:wc,bandwidth:0,language:"",label:null,kind:null,mimeType:null,codecs:null,primary:!1,roles:[],accessibilityPurpose:null,forced:!1,originalTextId:null,originalLanguage:"speech-to-text"}}
var ew=new Map,Uv=new ob(function(){var a=document.body.appendChild(document.createElement("iframe"));var b=a.contentWindow;b=b.SpeechRecognition||b.webkitSpeechRecognition;if(!b)return a.remove(),!1;b=new b;a.remove();try{return b.start(0),b.stop(),!1}catch(c){return c.name=="TypeError"}});function bw(a){this.i=a;this.h=null}bw.prototype.release=function(){this.i&&qo(this.i);this.h=null};function Yv(a,b,c,d){this.o=a;this.j=b;this.A=c;this.u=d;this.i=new ib;this.m=null;this.h=0;this.l=!1}
Yv.prototype.start=function(a,b,c){var d=this,e,f,g,h,k;return H(function(l){switch(l.i){case 1:d.stop();d.h++;e=d.h;d.l=!0;f=window.SpeechRecognition||window.webkitSpeechRecognition;g=new f;d.m=g;g.lang=b;g.continuous=!0;g.interimResults=!0;if(!(c&&"install"in f&&"available"in f)){l.B(2);break}l.o(3);return l.h(f.available({langs:[b],processLocally:!0}),5);case 5:h=l.j;switch(h){case "available":g.processLocally=!0;break;case "downloading":case "downloadable":return l.B(6);default:return l.return()}l.B(7);
break;case 6:return l.h(f.install({langs:[b],processLocally:!0}),8);case 8:g.processLocally=!0;l.B(7);break;case 7:l.u(2);break;case 3:l.m();case 2:if(e!==d.h)return l.return();k=!1;d.i.J(g,"start",function(){e===d.h&&d.j.ka(5)});d.i.J(g,"result",function(m){var n,p,t,u;return H(function(v){if(v.i==1){if(e!==d.h)return v.return();n=m;p="";for(t=n.resultIndex;t<n.results.length;t++)p+=n.results[t][0].transcript;return v.h(fw(d.o,p),2)}u=v.j;if(u===null||e!==d.h)return v.return();d.A(u);d.j.ka(.75);
v.l()})});d.i.J(g,"error",function(m){e===d.h&&(k=!0,d.u(),m.error=="network"&&d.j.ka(30))});d.i.J(g,"end",function(){d.l&&e===d.h&&(k||d.start(a,b,c))});g.start(a);l.l()}})};Yv.prototype.stop=function(a){a=a===void 0?!0:a;this.h++;this.l=!1;this.i.Sa();this.j.stop();this.m&&(this.m.stop(),this.m=null);a&&this.u()};Yv.prototype.release=function(){this.stop();this.o.release()};Yv.prototype.isActive=function(){return this.l};function Vv(){this.i=this.h=null;this.o=this.m=0;this.l=this.j=null}
function dw(a,b,c){var d,e,f;return H(function(g){if(g.i==1){if(a.j===b&&a.l===c&&a.h)return g.return();a.release();a.m++;d=a.m;if(!(c&&b!=c&&"Translator"in window))return g.return();a.i=new AbortController;g.o(2);return g.h(Translator.create({sourceLanguage:b,targetLanguage:c,signal:a.i.signal}),4)}if(g.i!=2){e=g.j;if(d!==a.m)return e.destroy(),g.return();a.h=e;a.j=b;a.l=c;return g.u(0)}f=g.m();if(f.name=="NotSupportedError")throw f;g.l()})}
function fw(a,b){var c,d;return H(function(e){if(e.i==1){if(!a.h)return e.return(b);a.o++;c=a.o;e.o(2);return e.h(a.h.translate(b),4)}if(e.i!=2)return d=e.j,c!==a.o?e.return(null):e.return(d);e.m();return e.return(null)})}Vv.prototype.release=function(){var a;(a=this.i)==null||a.abort();this.i=null;var b;(b=this.h)==null||b.destroy();this.l=this.j=this.h=null};function gw(){}q=gw.prototype;q.configure=function(){};q.remove=function(){};q.append=function(){};q.destroy=function(){};q.isTextVisible=function(){return!1};q.setTextVisibility=function(){};q.setTextLanguage=function(){};I("shaka.text.StubTextDisplayer",gw);gw.prototype.setTextLanguage=gw.prototype.setTextLanguage;gw.prototype.setTextVisibility=gw.prototype.setTextVisibility;gw.prototype.isTextVisible=gw.prototype.isTextVisible;gw.prototype.destroy=gw.prototype.destroy;gw.prototype.append=gw.prototype.append;
gw.prototype.remove=gw.prototype.remove;gw.prototype.configure=gw.prototype.configure;function hw(a){var b=this;this.u=!1;this.j=[];this.V=a;this.l=a.Xc();this.i=a.ud;this.F=null;this.G=!1;this.W=!0;this.C=this.H=this.P=null;this.N=!1;this.h=document.createElement("div");this.h.classList.add("shaka-text-container");this.h.style.textAlign="center";this.h.style.display="flex";this.h.style.flexDirection="column";this.h.style.alignItems="center";this.h.style.justifyContent="flex-end";this.A=new gf(function(){iw(b);jw(b)});jw(this);this.D=new gf(function(){kw(b)});this.o=new Map;this.m=
new ib;this.m.J(document,"fullscreenchange",function(){iw(b,!0)});this.m.J(this.l,"seeking",function(){iw(b,!0);jw(b)});this.m.Fb(this.l,["play","playing","pause","waiting"],function(){jw(b)});this.m.J(this.V,"ratechange",function(){jw(b)});this.m.J(this.l,"resize",function(){var c=b.l,d=c.videoWidth;c=c.videoHeight;d&&c?b.F=d/c:b.F=null});this.U=!1;this.L=null;"ResizeObserver"in window&&(this.L=new ResizeObserver(function(){b.U||(b.U=!0,requestAnimationFrame(function(){b.U=!1;b.h&&b.h.parentElement&&
b.u&&iw(b,!0)}))}),this.L.observe(this.i));this.K=new Map;this.I=new Map;this.O=null;"IntersectionObserver"in window&&(this.O=new IntersectionObserver(function(c){c.length&&(c=c[c.length-1],b.W=c.isIntersecting&&c.intersectionRatio>0,b.D.ka(.25))},{root:null,threshold:[.01]}),this.O.observe(this.i));this.m.J(document,"visibilitychange",function(){b.D.eb()});uo(this.m,this.l,function(){return b.D.eb()});a=this.l;(a.webkitPresentationMode||a.webkitSupportsFullscreen)&&this.m.J(a,"webkitpresentationmodechanged",
function(){b.D.eb()});kw(this)}q=hw.prototype;q.configure=function(a){this.P=a;jw(this);kw(this);iw(this,!0)};q.Xk=function(a,b){this.H=Object.assign({},a);this.C=new Vd(Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,b);iw(this,!0)};q.fj=function(){if(this.H||this.C)this.C=this.H=null,this.N=!1,iw(this,!0)};
q.append=function(a){var b=[].concat(F(this.j));a=r(Cv(a));for(var c=a.next(),d={};!c.done;d={Ef:void 0},c=a.next())d.Ef=c.value,b.some(function(e){return function(f){return fe(f,e.Ef)}}(d))||this.j.push(d.Ef);this.j.length&&jw(this);iw(this)};
q.destroy=function(){if(!this.h)return Promise.resolve();this.h.parentElement&&this.i.removeChild(this.h);this.h=null;this.u=!1;this.j=[];this.C=this.H=null;this.N=!1;var a;(a=this.A)==null||a.stop();this.A=null;var b;(b=this.D)==null||b.stop();this.D=null;this.o.clear();var c;(c=this.m)==null||c.release();this.m=null;var d;(d=this.L)==null||d.disconnect();this.L=null;var e;(e=this.O)==null||e.disconnect();this.O=null;return Promise.resolve()};
q.remove=function(a,b){if(!this.h)return!1;var c=this.j.length;this.j=this.j.filter(function(d){return d.startTime<a||d.endTime>=b});iw(this,c>this.j.length);this.j.length||jw(this);return!0};q.isTextVisible=function(){return this.u};q.setTextVisibility=function(a){(this.u=a)?(this.h.parentElement||this.i.appendChild(this.h),iw(this,!0)):this.h.parentElement&&this.i.removeChild(this.h)};q.setTextLanguage=function(a){a&&a!="und"?this.h.setAttribute("lang",a):this.h.setAttribute("lang","")};
function jw(a){if(a.A)if(!a.j.length||a.G||a.l.paused)a.A.stop();else{var b,c,d=(c=(b=lw(a))==null?void 0:b.subtitleDelay)!=null?c:0;b=a.l.currentTime-d;c=1;d=mw(a,a.j,b);d!=null&&a.l.readyState>=HTMLMediaElement.HAVE_FUTURE_DATA&&(c=Math.min(c,Math.max(0,d-b)));a.A.ka(Math.max(nw,c/(Math.abs(a.V.Fa())||1)))}}
function mw(a,b,c){function d(g){g>c&&(e==null||g<e)&&(e=g)}var e=null;b=r(b);for(var f=b.next();!f.done;f=b.next())f=f.value,d(f.startTime),d(f.endTime),f.nestedCues.length&&(f=mw(a,f.nestedCues,c),f!=null&&d(f));return e}function lw(a){return a.H||a.P}
function kw(a){var b=a.l,c=!1;window.documentPictureInPicture&&window.documentPictureInPicture.window?c=!0:document.pictureInPictureElement===b&&(c=!0);var d=!1;document.fullscreenEnabled&&document.fullscreenElement===a.i?d=!0:b.webkitSupportsFullscreen&&(d=b.webkitDisplayingFullscreen);b=document.visibilityState==="visible";var e,f;(f=(e=a.P)==null?void 0:e.suspendRenderingWhenHidden)!=null&&!f||c||d||b&&a.W?a.G&&(a.G=!1,jw(a),requestAnimationFrame(function(){a.h&&a.h.parentElement&&a.u&&iw(a)})):
a.G||(a.G=!0,a.A&&a.A.stop())}function ow(a,b){for(;b!=null;){if(b==a.h)return!0;b=b.parentElement}return!1}function pw(a,b,c){var d=b,e=a.o.get(b)||null;if(!e&&c&&c.positionArea!=0){c=r(a.o.keys());for(var f=c.next();!f.done;f=c.next())f=f.value,fe(b,f)&&(d=f,e=a.o.get(f))}return{key:d,di:e}}
function qw(a,b,c,d,e){var f=lw(a),g=!1,h=[],k=[],l=new Set;b=r(b);for(var m=b.next();!m.done;m=b.next()){m=m.value;e.push(m);var n=pw(a,m,f),p=n.key;n=n.di;var t=m.startTime<=d&&m.endTime>d,u=n?n.Ri:null;n&&(h.push(n.Gd),n.qc&&h.push(n.qc),t||(g=!0,a.o.delete(p),n=null));t&&(k.push(m),n?ow(a,u)||(g=!0):(rw(a,m,e),l.add(m),n=a.o.get(p),u=n.Ri,g=!0));m.nestedCues.length>0&&u&&qw(a,m.nestedCues,u,d,e);e.pop()}if(g){d=r(h);for(g=d.next();!g.done;g=d.next())g=g.value,g.parentElement&&g.parentElement.removeChild(g);
e.length||k.sort(function(v,w){return v.startTime!=w.startTime?v.startTime-w.startTime:v.endTime-w.endTime});e=new Map;k=r(k);for(d=k.next();!d.done;d=k.next())g=d.value,d=pw(a,g,f).di,d.qc?(d.qc.contains(c)&&d.qc.removeChild(c),c.appendChild(d.qc),d.qc.appendChild(d.Gd),l.has(g)&&g.region.scroll=="up"&&(g=d.qc,e.has(g)||e.set(g,[]),e.get(g).push(d.Gd))):c.appendChild(d.Gd);a=r(e.keys());for(c=a.next();!c.done;c=a.next())c=c.value,sw(c,e.get(c))}}
function tw(a,b,c){return b.some(function(d){return d.startTime<=c&&d.endTime>c&&uw(a,d)})}function uw(a,b){return!!b.payload.replace(/[\u00a0\u200B]/g," ").trim()||!!b.backgroundImage||b.nestedCues.some(function(c){return uw(a,c)})}
function iw(a,b){b=b===void 0?!1:b;if(a.h&&!a.G){var c=lw(a),d,e=(d=c==null?void 0:c.subtitleDelay)!=null?d:0;d=a.l.currentTime-e;e=!!a.C&&(!a.u||!tw(a,a.j,d));e!=a.N&&(b=!0,a.N=e);e&&(b=!0);var f=a.u||e;f?a.h.parentElement||a.i.appendChild(a.h):a.h.parentElement&&a.i.removeChild(a.h);if(!f||b){b=r(a.K.values());for(var g=b.next();!g.done;g=b.next())qo(g.value);qo(a.h);a.o.clear();a.K.clear();a.I.clear()}f&&(b=e&&a.C?[a.C]:a.j,c&&c.positionArea!=0&&(b=b.map(function(h){var k=lw(a);h=h.clone();Hv(h);
h.region=vw.value();switch(k.positionArea){case 1:h.textAlign="left";h.displayAlign="before";break;case 2:h.textAlign=Xd;h.displayAlign="before";break;case 3:h.textAlign="right";h.displayAlign="before";break;case 4:h.textAlign="left";h.displayAlign="center";break;case 5:h.textAlign=Xd;h.displayAlign="center";break;case 6:h.textAlign="right";h.displayAlign="center";break;case 7:h.textAlign="left";h.displayAlign=be;break;case 8:h.textAlign=Xd;h.displayAlign=be;break;case 9:h.textAlign="right",h.displayAlign=
be}return h})),qw(a,b,a.h,d,[]),ww(a))}}function xw(a){var b=a.heightUnits==Zc?"%":"px";a.heightUnits==2&&(b="lines");return a.id+"_"+a.width+"x"+a.height+b+"-"+a.viewportAnchorX+"x"+a.viewportAnchorY+(a.viewportAnchorUnits==Zc?"%":"px")+"-"+a.regionAnchorX+"x"+a.regionAnchorY+"-"+a.backgroundColor+"-"+a.opacity+"-"+a.padding+"-"+a.overflow+"-"+a.zIndex}
function yw(a,b){var c=b.region,d=a.F===4/3?2.5:1.9,e=xw(c);if(a.K.has(e))return a.K.get(e);var f=document.createElement("span"),g=c.heightUnits==Zc?"%":"px",h=c.widthUnits==Zc?"%":"px",k=c.viewportAnchorUnits==Zc?"%":"px";f.id="shaka-text-region---"+e;f.classList.add("shaka-text-region");f.style.position="absolute";var l=c.width;c.widthUnits===2&&(l=c.width*d,h="%");f.style.width=l+h;d=c.heightUnits===2;h="";var m=0;d?(h=lw(a),h=zw(b.fontSize||"1em",b,a.i,h?h.fontScaleFactor:1),m=c.height*1.4,f.style.height=
"calc("+m+" * "+h+")",f.style.lineHeight="1.4"):f.style.height=c.height+g;var n=k;c.viewportAnchorUnits===2?(k=c.viewportAnchorY/75*100,g=c.viewportAnchorX/(a.F===4/3?160:210)*100,n="%"):(k=c.viewportAnchorY,g=c.viewportAnchorX);g-=c.regionAnchorX*l/100;f.style.left=g+n;d?f.style.top="calc("+k+n+" - "+c.regionAnchorY/100*m+" * "+h+")":(k-=c.regionAnchorY*c.height/100,f.style.top=k+n);c.heightUnits!==0&&c.widthUnits!==0&&c.viewportAnchorUnits!==0&&(f.style.left=Math.max(0,Math.min(100-(parseInt(f.style.width.slice(0,
-1),10)||0),g))+"%",d||(f.style.top=Math.max(0,Math.min(100-(parseInt(f.style.height.slice(0,-1),10)||0),k))+"%"));f.style.display="flex";f.style.flexDirection="column";f.style.alignItems="center";f.style.justifyContent=Aw(b.displayAlign);c.backgroundColor&&a.I.set(f,c.backgroundColor);c.opacity!=1&&(f.style.opacity=String(c.opacity));if(c.padding&&!d){f.style.boxSizing="border-box";var p=a.i;f.style.padding=c.padding.split(" ").map(function(t,u){var v=u%2;u=v?c.width:c.height;v=(v?c.widthUnits:c.heightUnits)!=
Zc?100:v?p.clientWidth:p.clientHeight;return t.endsWith("%")?parseFloat(t)*u*v/1E4+"px":t}).join(" ")}c.overflow&&(f.style.overflow=c.overflow);c.zIndex!=null&&(f.style.zIndex=String(c.zIndex),a.h.style.isolation="isolate");c.scroll=="up"&&(f.style.justifyContent="flex-end",f.style.overflow="hidden");a.K.set(e,f);return f}
function ww(a){if(a.I.size){for(var b=[],c=r(a.o.keys()),d=c.next();!d.done;d=c.next())d=d.value,d.nestedCues.length||b.push(a.o.get(d).Gd);c=r(a.I.keys());var e=c.next();for(d={};!e.done;d={Xe:void 0},e=c.next())d.Xe=e.value,e=b.some(function(f){return function(g){return f.Xe.contains(g)}}(d)),d.Xe.style.backgroundColor=e?a.I.get(d.Xe):""}}
function sw(a,b){var c=Array.from(a.childNodes);if(!(c.length<=b.length)){a=0;b=r(b);for(var d=b.next();!d.done;d=b.next())a+=d.value.offsetHeight;if(a)for(c=r(c),b=c.next();!b.done;b=c.next())b=b.value,b.animate&&b.animate([{transform:"translateY("+a+"px)"},{transform:"translateY(0)"}],{duration:433,easing:"ease"})}}
function rw(a,b,c){var d=c.length>1,e=d?"span":"div";b.lineBreak&&(e="br");b.rubyTag&&(e=b.rubyTag);d=!d&&b.nestedCues.length>0;var f=document.createElement(e);e!="br"&&Bw(a,f,b,c,d);c=null;b.region&&b.region.id&&(c=yw(a,b));e=f;d&&(e=document.createElement("span"),e.classList.add("shaka-text-wrapper"),Cw(lw(a))||(e.style.backgroundColor=b.backgroundColor),e.style.lineHeight="normal",f.appendChild(e));a.o.set(b,{Gd:f,Ri:e,qc:c})}
function Dw(a,b,c,d){b=b.color;d&&d.fontColor&&(b=d.fontColor);if(!d||isNaN(d.fontOpacity))return b;if(!b){if(c)return"";b=window.getComputedStyle(a.h).color}return Av(b,d.fontOpacity)||b}function Ew(a,b,c){if(!Cw(c))return a||(b?"rgba(0, 0, 0, 0.8)":"");if(!b)return"";a=c.backgroundColor||a||"rgba(0, 0, 0, 0.8)";return isNaN(c.backgroundOpacity)?a:Av(a,c.backgroundOpacity)||a}function Cw(a){return!!a&&(!!a.backgroundColor||!isNaN(a.backgroundOpacity))}
function Fw(a,b){var c=b?b.characterEdgeStyle:0;if(c!=0){var d=b&&!isNaN(b.fontOpacity)?b.fontOpacity:1;b="rgba(34, 34, 34, "+d+")";var e="rgba(204, 204, 204, "+d+")";d=[];switch(c){case 2:c=r([3,4,5]);for(e=c.next();!e.done;e=c.next())d.push("0.0625em 0.0625em "+(e.value/32+"em ")+b);break;case 3:c=r([1,2,3]);for(e=c.next();!e.done;e=c.next())e=e.value,d.push(e/32+"em "+(e/32+"em ")+b);break;case 4:d.push("0.03125em 0.03125em "+e);d.push("-0.03125em -0.03125em "+b);break;case 5:for(c=0;c<5;c++)d.push("0 0 0.0625em "+
b)}a.textShadow=d.length?d.join(", "):"none";a.webkitTextStrokeWidth="0"}}
function Gw(a,b,c){var d=[],e=c.slice().reverse().find(function(l){return l.textStrokeWidth}),f=e?Hw(Iw(a,e.textStrokeWidth,b)):null;if(f&&f.value>0)for(var g=e.textStrokeColor||Jw(c,function(l){return l.color})||"currentColor",h=0;h<16;h++){var k=h*2*Math.PI/16;d.push((""+Number((f.value*Math.cos(k)).toFixed(3))+f.unit+" "+Number((f.value*Math.sin(k)).toFixed(3))+f.unit+" 0 "+g).trim())}(c=Jw(c,function(l){return l.textShadow}))&&c!="none"&&d.push(Iw(a,c,b));return d.length?d.join(", "):e||c?"none":
""}function Iw(a,b,c){var d=a.i;return b.replace(/(^|[\s,(])(-?\d*\.?\d+)(c|rw|rh)(?=[\s,)]|$)/g,function(e,f,g,h){e=Number(g);g=d.clientHeight*e/100;h=="c"?g=d.clientHeight*e/c.cellResolution.rows:h=="rw"&&(g=d.clientWidth*e/100);return f+g+"px"})}function Kw(a){var b=a.direction,c=a.positionAlign;a=a.textAlign;return c!==Wd?c:a==="left"||a==="start"&&b===Yd||a==="end"&&b==="rtl"?"line-left":a==="right"||a==="start"&&b==="rtl"||a==="end"&&b===Yd?"line-right":"center"}
function Bw(a,b,c,d,e){var f=b.style,g=c.nestedCues.length==0,h=d.length>1,k=lw(a);f.whiteSpace=c.wrapLine?"pre-wrap":"pre";var l=c.payload.replace(/\s+$/g,function(n){return"\u00a0".repeat(n.length)});f.color=Dw(a,c,h,k);f.direction=c.direction;f.opacity=c.opacity;f.paddingLeft=zw(c.linePadding,c,a.i);f.paddingRight=zw(c.linePadding,c,a.i);f.textCombineUpright=c.textCombineUpright;f.visibility=c.visibility;f.textShadow=Gw(a,c,d);Fw(f,k);if(c.backgroundImage)f.backgroundImage="url('"+c.backgroundImage.replace(/['"()\\]/g,
"")+"')",f.backgroundRepeat="no-repeat",f.backgroundSize="contain",f.backgroundPosition="center",c.backgroundColor&&(f.backgroundColor=c.backgroundColor),f.width="100%",f.height="100%";else{if(c.nestedCues.length)var m=b;else m=document.createElement("span"),b.appendChild(m);c.border&&(m.style.border=c.border);!e&&(b=Ew(Jw(d,function(n){return n.backgroundColor}),!!l,k))&&(m.style.backgroundColor=b);l&&(m.setAttribute("translate","no"),m.textContent=l)}if(h&&!d[d.length-1].isContainer)f.display="inline";
else{f.display="flex";f.flexDirection="column";f.alignItems="center";if(c.textAlign=="left"||c.textAlign=="start")f.width="100%",f.alignItems="flex-start";else if(c.textAlign=="right"||c.textAlign=="end")f.width="100%",f.alignItems="flex-end";f.justifyContent=Aw(c.displayAlign)}g||(f.margin="0");f.fontFamily=(k==null?void 0:k.fontFamily)||c.fontFamily;f.fontWeight=c.fontWeight.toString();f.fontStyle=c.fontStyle;f.letterSpacing=c.letterSpacing;d=k?k.fontScaleFactor:1;if(d!==1||c.fontSize)f.fontSize=
zw(c.fontSize||"1em",c,a.i,d);d=c.line;d!=null?(g=c.lineInterpretation,g==$d&&(g=1,h=16,a.F&&a.F<1&&(h=32),d=d<0?100+d/h*100:d/h*100),g==1&&(f.position="absolute",c.writingMode==Zd?(f.width="100%",c.lineAlign==ae?f.top=d+"%":c.lineAlign=="end"&&(f.bottom=100-d+"%")):c.writingMode=="vertical-lr"?(f.height="100%",c.lineAlign==ae?f.left=d+"%":c.lineAlign=="end"&&(f.right=100-d+"%")):(f.height="100%",c.lineAlign==ae?f.right=d+"%":c.lineAlign=="end"&&(f.left=100-d+"%")))):c.writingMode!=Zd&&(f.position=
"absolute",f.top="0",f.height="100%",c.writingMode=="vertical-lr"?f.right="0":f.left="0");f.lineHeight=Iw(a,c.lineHeight,c);a=Kw(c);a=="line-left"?(f.cssFloat="left",c.position!==null&&(f.position="absolute",c.writingMode==Zd?(f.left=c.position+"%",f.width="auto"):f.top=c.position+"%")):a=="line-right"?(f.cssFloat="right",c.position!==null&&(f.position="absolute",c.writingMode==Zd?(f.right=100-c.position+"%",f.width="auto"):f.bottom=c.position+"%")):c.position!==null&&c.position!=50&&(f.position=
"absolute",c.writingMode==Zd?(f.left=c.position+"%",f.width="auto"):f.top=c.position+"%",c.size&&(f.transform="translateX(-50%)"));f.textAlign=c.textAlign;f.textDecoration=c.textDecoration.join(" ");f.writingMode=c.writingMode;"writingMode"in document.documentElement.style&&f.writingMode==c.writingMode||(f.webkitWritingMode=c.writingMode);c.size&&(d=c.position,d==null&&(d=c.textAlign=="left"?0:c.textAlign=="right"?100:50),a=Math.min(c.size,a=="line-left"?100-d:a=="line-right"?d:d<=50?d*2:(100-d)*
2),c.writingMode==Zd?f.width=a+"%":f.height=a+"%")}function Hw(a){return(a=(new RegExp(/(\d*\.?\d+)([a-z]+|%+)/)).exec(a))?{value:Number(a[1]),unit:a[2]}:null}function zw(a,b,c,d){d=d===void 0?1:d;var e=Hw(a);if(!e)return a;a=e.unit;d*=e.value;switch(a){case "%":return d/100*c.clientHeight/b.cellResolution.rows+"px";case "c":return c.clientHeight*d/b.cellResolution.rows+"px";default:return d+a}}function Jw(a,b){for(var c=a.length-1;c>=0;c--){var d=b(a[c]);if(d||d===0)return d}return null}
function Aw(a){switch(a){case "before":return"flex-start";case "center":return"center";default:return"flex-end"}}I("shaka.text.UITextDisplayer",hw);hw.prototype.setTextLanguage=hw.prototype.setTextLanguage;hw.prototype.setTextVisibility=hw.prototype.setTextVisibility;hw.prototype.isTextVisible=hw.prototype.isTextVisible;hw.prototype.remove=hw.prototype.remove;hw.prototype.destroy=hw.prototype.destroy;hw.prototype.append=hw.prototype.append;hw.prototype.clearTextStylePreview=hw.prototype.fj;
hw.prototype.setTextStylePreview=hw.prototype.Xk;hw.prototype.configure=hw.prototype.configure;var nw=1/60,vw=new ob(function(){var a=new Yc;a.id="shaka-custom-region";a.height=90;a.width=90;a.viewportAnchorX=5;a.viewportAnchorY=5;return a});function Lw(a,b){function c(g){var h=[];switch(g.textAlign){case "left":h.push("align:left");break;case "right":h.push("align:right");break;case Xd:h.push("align:middle");break;case "start":h.push("align:start");break;case "end":h.push("align:end")}switch(g.writingMode){case "vertical-lr":h.push("vertical:lr");break;case "vertical-rl":h.push("vertical:rl")}return h.length?" "+h.join(" "):""}function d(g){for(var h=g,k=r(b),l=k.next();!l.done;l=k.next())l=l.value,l.end&&l.start<g&&(h+=l.end-l.start);
g=Math.floor(h/3600);k=Math.floor(h/60%60);l=Math.floor(h%60);h=Math.floor(h*1E3%1E3);return(g<10?"0":"")+g+":"+(k<10?"0":"")+k+":"+(l<10?"0":"")+l+"."+(h<100?h<10?"00":"0":"")+h}var e=Bv(a);a="WEBVTT\n\n";e=r(e);for(var f=e.next();!f.done;f=e.next())f=f.value,a+=d(f.startTime)+" --\x3e "+d(f.endTime)+c(f)+"\n",a+=f.payload+"\n\n";return a}I("shaka.text.WebVttGenerator",function(){});/*
 @license
 Copyright 2024 Streaming Video Technology Alliance
 SPDX-License-Identifier: Apache-2.0
*/
var Mw=["cen","e","h","ts"];var Nw="ab bg bl br bs bsa bsd bsda cdn cid cs d dfa dl ec lab lb ltc msd mtp nor nr ot pb pr pt rtp sf sid sn st sta su tab tb tbl tpb v".split(" ");var Ow="cmsdd cmsds rc smrt ttfb ttfbb ttlb url".split(" ");var Pw="bl br bs cid d dl mtp nor nrr ot pr rtp sf sid st su tb v".split(" ");var Qw=new Map([["ps","sta"],["pr","pr"],["c","cid"],["b","bg"],["bc","br"]]);function Rw(a,b){Array.isArray(a)&&(a=a.map(function(c){return c instanceof Rw?c:new Rw(c)}));this.value=a;this.Sb=b}function Sw(a){this.description=a}function Tw(a,b){var c=Error;a=Array.isArray(a)?JSON.stringify(a):a instanceof Map?"Map{}":a instanceof Set?"Set{}":typeof a==="object"?JSON.stringify(a):String(a);return c('failed to serialize "'+a+'" as '+b,{cause:void 0})}
function Uw(a,b){if(a<0)return-Uw(-a,b);b=Math.pow(10,b);return Math.abs(a*b%1-.5)<Number.EPSILON?(a=Math.floor(a*b),(a%2===0?a:a+1)/b):Math.round(a*b)/b}function Vw(a){if(a<-999999999999999||999999999999999<a)throw Tw(a,"Integer");return a.toString()}var Ww=/[\x00-\x1f\x7f]+/;function Xw(a){a=a.description||a.toString().slice(7,-1);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(a)===!1)throw Tw(a,"Token");return a}
function Yw(a){switch(typeof a){case "number":if(!Number.isFinite(a))throw Tw(a,"Bare Item");if(Number.isInteger(a))a=Vw(a);else{var b=Uw(a,3);if(Math.floor(Math.abs(b)).toString().length>12)throw Tw(a,"Decimal");a=b.toString();a=a.includes(".")?a:a+".0"}return a;case "string":if(Ww.test(a))throw Tw(a,"String");return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"';case "symbol":return Xw(a);case "boolean":if(typeof a!=="boolean")throw Tw(a,"Boolean");return a?"?1":"?0";case "object":if(a instanceof
Date)return"@"+Vw(a.getTime()/1E3);if(a instanceof Uint8Array){if(ArrayBuffer.isView(a)===!1)throw Tw(a,"Byte Sequence");return":"+btoa(String.fromCharCode.apply(String,F(a)))+":"}if(a instanceof Sw)return Xw(a);default:throw Tw(a,"Bare Item");}}function Zw(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw Tw(a,"Key");return a}function $w(a){return a==null?"":Object.entries(a).map(function(b){var c=r(b);b=c.next().value;c=c.next().value;return c===!0?";"+Zw(b):";"+Zw(b)+"="+Yw(c)}).join("")}
function ax(a){return a instanceof Rw?Yw(a.value)+$w(a.Sb):Yw(a)}
function bx(a){var b={Qi:!1};b=b===void 0?{Qi:!0}:b;if(typeof a!=="object"||a==null)throw Tw(a,"Dict");a=a instanceof Map?a.entries():Object.entries(a);b=b.Qi?" ":"";return Array.from(a).map(function(c){c=r(c);var d=c.next().value;c=c.next().value;c instanceof Rw===!1&&(c=new Rw(c));d=Zw(d);c.value===!0?d+=$w(c.Sb):(d+="=",Array.isArray(c.value)?(c="("+c.value.map(ax).join(" ")+")"+$w(c.Sb),c=d+c):c=d+ax(c),d=c);return d}).join(","+b)};function cx(a,b){try{var c=new URL(a)}catch(f){return a}b=new URL(b);if(c.origin!==b.origin)return a;a=c.pathname.split("/").slice(1);b=b.pathname.split("/").slice(1,-1);for(var d=Math.min(a.length,b.length),e=0;e<d&&a[e]===b[e];e++)a.shift(),b.shift();for(;b.length;)b.shift(),a.unshift("..");return a.join("/")+c.search+c.hash};function dx(a){return a instanceof Rw?new Rw(Math.round(a.value),a.Sb):Math.round(a)}function ex(a){return Array.isArray(a)?a.map(dx):dx(a)}function fx(a){if(a)try{var b=URL,c=new URL(a);var d=c.origin+c.pathname.substring(0,c.pathname.lastIndexOf("/")+1);return(new b(d)).href}catch(e){}}
function gx(a,b){if(Array.isArray(a))return a.map(function(d){return gx(d,b)});if(a instanceof Rw&&typeof a.value==="string")return new Rw(gx(a.value,b),a.Sb);var c=fx(b.ke);c&&(a=cx(a,c));return b.version===1?encodeURIComponent(a):a}function hx(a){return a instanceof Rw?new Rw(Math.round(a.value/100)*100,a.Sb):Math.round(a/100)*100}function ix(a){return Array.isArray(a)?a.map(hx):hx(a)}
var jx={br:ex,d:ex,bl:ix,dl:ix,mtp:ix,nor:function(a,b){var c=a;b.version>=2&&(a instanceof Rw&&typeof a.value==="string"?c=new Rw([a]):typeof a==="string"&&(c=[a]));return gx(c,b)},rtp:ix,tb:ex};var kx=new Set("ab bl br bsa bsd bsda lab lb mtp pb tab tb tbl tpb".split(" "));var lx=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;var mx=new Set(Nw);function nx(a){return mx.has(a)||lx.test(a)};var ox=new Set(Ow);var px=new Set(Mw);var qx=new Set(Pw);function rx(a){return qx.has(a)||lx.test(a)};var sx=new Set(["ot","sf","st","e","sta"]);function tx(a){return typeof a==="number"?Number.isFinite(a):a!=null&&a!==""&&a!==!1};var ux={},vx=(ux.event=function(a){return nx(a)||ox.has(a)||px.has(a)},ux.request=nx,ux);function wx(a,b){if(Array.isArray(a)){var c;b&&(c=a.find(function(d){return d&&d.Sb&&d.Sb.ot===b}));c||(c=a[0]);return wx(c)}return a instanceof Rw?a.value:a}
function xx(a){for(var b={},c=r(Object.entries(a)),d=c.next();!d.done;d=c.next()){var e=r(d.value);d=e.next().value;e=e.next().value;e==null?b[d]=e:d==="nor"?(d=(Array.isArray(e)?e:[e])[0],d instanceof Rw?(b.nor=d.value,(d=d.Sb)&&d.r&&(b.nrr=d.r)):b.nor=d):kx.has(d)?b[d]=wx(e,a.ot):b[d]=e}return b}
function yx(a,b){b=b||{};var c={};if(a==null||typeof a!=="object")return c;var d=b.version||a.v||2,e=b.qg||"request";a=d===1?xx(a):a;var f=d===1?rx:vx[e],g=Object.keys(a).filter(f);a.e&&a.e!=="rr"&&(g=g.filter(function(m){return!ox.has(m)}));f=b.filter;typeof f==="function"&&(g=g.filter(f));if(f=e==="event"){var h=a.e;g.includes("e")||h==null||g.push("e");g.includes("ts")||g.push("ts");g.includes("cen")||a.cen==null||h!=="ce"||g.push("cen");(h=h?Qw.get(h):void 0)&&a[h]!=null&&!g.includes(h)&&g.push(h)}if(g.length===
0)return c;d>1&&!g.includes("v")&&g.push("v");e={version:d,qg:e,ke:b.ke};g.sort();g=r(g);for(h=g.next();!h.done;h=g.next()){h=h.value;var k=a[h],l=b.pj&&b.pj[h]||jx[h];typeof l==="function"&&(k=l(k,e));if(h==="v")if(d===1)continue;else k=d;if(h!=="pr"||k!==1||f&&a.e==="pr")if(f&&h==="ts"&&!Number.isFinite(k)&&(k=Date.now()),l=f&&k===!1&&h==="bg"&&a.e==="b",tx(k)||l)sx.has(h)&&typeof k==="string"&&(k=new Sw(k)),c[h]=k}return c};var zx=/[!'()*]/g,Ax=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDFFF]/g;function Bx(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()}function Cx(a){return a.length===2?a:"\ufffd"};function Dx(a,b){var c=a.indexOf("#");c=c===-1?a.length:c;var d=a.indexOf("?");d=d===-1||d>c?c:d;var e=[];if(b){try{var f=encodeURIComponent(b)}catch(k){f=encodeURIComponent(b.replace(Ax,Cx))}b="CMCD="+f.replace(zx,Bx)}else b="";f=!1;for(var g=r(d<c?a.slice(d+1,c).split("&"):[]),h=g.next();!h.done;h=g.next())h=h.value,h==="CMCD"||h.startsWith("CMCD=")?(f=!0,b&&(e.push(b),b="")):e.push(h);if(b)e[e.length-1]===""&&e.pop(),e.push(b);else if(!f)return a;e=e.join("&");return a.slice(0,d)+(e?"?"+e:"")+
a.slice(c)};var Ex={bm:"CMCD-Object",br:"CMCD-Object",d:"CMCD-Object",sm:"CMCD-Object",tm:"CMCD-Object",ot:"CMCD-Object",Am:"CMCD-Object",tb:"CMCD-Object",Cm:"CMCD-Object",bl:"CMCD-Request",jm:"CMCD-Request",qm:"CMCD-Request",dl:"CMCD-Request",ltc:"CMCD-Request",mtp:"CMCD-Request",nor:"CMCD-Request",nrr:"CMCD-Request",vm:"CMCD-Request",sn:"CMCD-Request",Fi:"CMCD-Request",su:"CMCD-Request",Bm:"CMCD-Request",cid:"CMCD-Session",msd:"CMCD-Session",sf:"CMCD-Session",sid:"CMCD-Session",st:"CMCD-Session",v:"CMCD-Session",
bg:"CMCD-Status",bs:"CMCD-Status",fm:"CMCD-Status",gm:"CMCD-Status",hm:"CMCD-Status",im:"CMCD-Status",rm:"CMCD-Status",um:"CMCD-Status",pr:"CMCD-Status",pt:"CMCD-Status",rtp:"CMCD-Status"};function Fx(a){return Object.keys(a).reduce(function(b,c){var d=a[c];d&&d.forEach(function(e){return b[e]=c});return b},{})};function Gx(a,b,c){var d=new Set(b.Mb||[]);return{version:b.version||2,qg:a,filter:function(e){return d.has(e)},ke:c}}function Hx(a,b){if(a===b)return!0;if(a.length!==b.length)return!1;for(var c=0;c<a.length;c++){var d=a[c],e=b[c];if(d!==e){if(typeof d==="number"||typeof e==="number")return!1;var f=e;if(d.value!==f.value)return!1;e=d.params;d=f.params;f=e&&Object.keys(e)[0];var g=d&&Object.keys(d)[0];if(f!==g||f&&g&&e&&d&&e[f]!==d[g])return!1}}return!0}function Ix(a){return a}
for(var Jx=function(){var a=[];Qw.forEach(function(b,c){b==="br"?a.push({event:c,Id:b,Jf:function(d,e){return d===void 0||e===void 0?d===e:Hx(d,e)},Ei:function(d){return d.slice()}}):a.push({event:c,Id:b,Jf:Object.is,Ei:Ix})});return a}(),Kx=new Map,Lx=r(Jx),Mx=Lx.next();!Mx.done;Mx=Lx.next()){var Nx=Mx.value;Kx.set(Nx.event,Nx)}
function Ox(a,b){this.A=performance.timeOrigin||performance.timing&&performance.timing.fetchStart||Date.now()-performance.now();this.h={};var c=a.version||2,d=a.eventTargets||[],e=a.sid||crypto.randomUUID(),f=a.Hg||"query",g=[];d=r(d);for(var h=d.next();!h.done;h=d.next())(h=h.value)&&h.url&&h.events&&h.events.length&&g.push({version:h.version||2,Mb:h.Mb?[].concat(h.Mb):[],url:h.url,events:[].concat(h.events),interval:h.interval!=null?h.interval:30,batchSize:h.batchSize||1});this.i=Object.assign({},
a,{version:c,Hg:f,sid:e,cid:a.cid,Mb:a.Mb,eventTargets:g});this.l=NaN;this.j=new Map;this.o={sn:0,Rd:!1};this.u=b;this.m={};this.h={cid:this.i.cid,sid:this.i.sid,v:this.i.version};a=r(this.i.eventTargets||[]);for(b=a.next();!b.done;b=a.next())this.j.set(b.value,{Wf:void 0,sn:0,Rd:!1,queue:[]})}Ox.prototype.start=function(){var a=this;this.j.forEach(function(b,c){Px(b);if(c.interval!==0&&c.events&&c.events.includes("t")){var d=function(){Qx(a,b,c,"t");Rx(a)};b.Wf=setInterval(d,c.interval*1E3);d()}})};
Ox.prototype.stop=function(a){(a===void 0?0:a)&&this.flush();this.j.forEach(function(b){Px(b)})};Ox.prototype.flush=function(){Rx(this,!0)};function Sx(a,b){b.sid&&b.sid!==a.h.sid&&Tx(a);b.msd&&!isNaN(b.msd)&&(a.l=b.msd);a.h=Object.assign({},a.h,b,{msd:void 0});for(var c=r(Jx),d=c.next();!d.done;d=c.next())d=d.value,d.Id in b&&!d.Jf(a.h[d.Id],a.m[d.Id])&&Vx(a,d.event)}
function Vx(a,b,c){var d=c||{};if(c=Kx.get(b)){var e=c.Id,f=d[e];f!==void 0&&(a.h[e]=f);f=a.h[e];if(f===void 0||c.Jf(f,a.m[e]))return;a.m[e]=c.Ei(f)}a.j.forEach(function(g,h){Qx(a,g,h,b,d)});Rx(a)}function Qx(a,b,c,d,e){e=e||{};c.events&&c.events.includes(d)&&(c=Object.assign({},a.h,e,{e:d,ts:e.ts!=null?e.ts:Date.now(),sn:b.sn++}),isNaN(a.l)||b.Rd||(c.msd=a.l,b.Rd=!0),b.queue.push(c))}
function Wx(a,b,c){var d=b.customData||{};b=Object.assign({},b,{headers:Object.assign({},b.headers||{}),Gf:Object.assign({},d,{cmcd:{}})});if(!a.i.Mb||!a.i.Mb.length||!b.url)return b;c=Object.assign({},a.h,c||{},{sn:a.o.sn++});var e=Gx("request",a.i,b.url);isNaN(a.l)||a.o.Rd||(c.msd=a.l,a.o.Rd=!0);var f=b.Gf.cmcd=yx(c,e);switch(a.i.Hg){case "query":if(a=bx(f))b.url=Dx(b.url,a);break;case "headers":a=Object;c=a.assign;d=b.headers;var g={};var h=e.lm;e={};if(f){var k=Object.keys(f);h=h?Fx(h):{};k=r(k);
for(var l=k.next();!l.done;l=k.next()){l=l.value;var m=Ex[l]||h[l]||"CMCD-Request";(e[m]||(e[m]={}))[l]=f[l]}}f=r(Object.entries(e));for(e=f.next();!e.done;e=f.next())h=r(e.value),e=h.next().value,h=h.next().value,(h=bx(h))&&(g[e]=h);c.call(a,d,g)}return b}
function Rx(a,b){b=b===void 0?!1:b;var c=!1;a.j.forEach(function(d,e){var f=d.queue;if(f.length&&(!(f.length<e.batchSize)||b)){var g=f.splice(0,b?f.length:e.batchSize);Yx(a,e,g).catch(function(){d.queue.unshift.apply(d.queue,F(g))});c=c||f.length>0}});c&&Rx(a)}
function Yx(a,b,c){var d,e,f;return H(function(g){if(g.i==1)return d=Gx("event",b),g.h(a.u({url:b.url,method:"POST",headers:{"Content-Type":"application/cmcd"},body:c.map(function(h){h?(h=yx(h,d),h=bx(h)):h="";return h}).join("\n")+"\n"}),2);e=g.j;f=e.status;if(f===410)Zx(a,b);else if(f===429||f>499&&f<600)throw Error("Event report failed with status "+f);g.l()})}function Px(a){clearInterval(a.Wf);a.Wf=void 0}function Zx(a,b){var c=a.j.get(b);c&&(Px(c),a.j.delete(b))}
function Tx(a){a.j.forEach(function(b){b.sn=0});a.o.sn=0;a.m={}};function $x(a,b,c){b?b?(b=yx(b,c),b=bx(b)):b="":b="";return b?Dx(a,b):a};function ay(a,b){this.i=a;this.G=b;this.D=this.F=null;this.j=by(this);this.o=this.h=this.l=null;this.A=void 0;this.u=new Map;this.m=new ib;this.C=0}ay.prototype.setMediaElement=function(a){this.l=a;cy(this)};ay.prototype.configure=function(a){this.G=a;dy(this)};function ey(a){fy(a);a.F=null;a.D=null;a.o=null;a.A=void 0;a.C=0;a.j=by(a)}
function dy(a){var b=a.j;a.j=by(a);var c;if(c=a.h)c=a.j,c=b.enabled!=c.enabled||b.version!=c.version||b.useHeaders!=c.useHeaders||b.sessionId!=c.sessionId||b.contentId!=c.contentId||b.eventTargets!=c.eventTargets||!gb(b.includeKeys,c.includeKeys);c&&fy(a);cy(a)}
function by(a){var b=a.G,c=a.F;a=a.D;var d=(c=b.applyParametersFromManifest!==!1&&c&&c.cmcdParameters?c:null)?c.cmcdParameters:null,e=d?d.version:b.version,f=b.includeKeys||[];if(d&&d.keys){var g=gy(d.keys,e);g.length?f=g:Wa("CMCD_NO_SUPPORTED_MANIFEST_KEYS","CMCD: the manifest lists no key this player supports at version "+e+"; using the application keys instead.")}return{enabled:!!d||b.enabled,version:e,useHeaders:d?d.mode=="header":b.useHeaders,sessionId:d&&d.sessionId||b.sessionId||a||"",contentId:d&&
d.contentId||b.contentId||"",rtpSafetyFactor:b.rtpSafetyFactor,includeKeys:f,includeInRequests:d?d.includeInRequests:b.includeInRequests||[],eventTargets:b.eventTargets,serviceLocations:c?c.serviceLocations:null,adaptationSets:c?c.adaptationSets:null,serviceLocationBaseUris:c?c.serviceLocationBaseUris:[],rj:!!d}}function fy(a){a.h&&(a.h.stop(!0),a.h=null);a.u.clear();a.m.Sa()}function hy(a,b){a.h&&(a.C=b,a.l&&a.l.autoplay&&(b=a.l.play())&&b.catch(function(){a.C=0}))}
function iy(a,b,c){if(!a.h||!jy(a,"segment"))return b;try{var d=ky(a);a:{switch(c.toLowerCase()){case "audio/mp4":case "audio/webm":case "audio/ogg":case "audio/mpeg":case "audio/aac":case "audio/flac":case "audio/wav":var e="a";break a;case "video/webm":case "video/mp4":case "video/mpeg":case "video/mp2t":e="av";break a;case "application/x-mpegurl":case "application/vnd.apple.mpegurl":case "audio/x-mpegurl":case "application/dash+xml":case "video/vnd.mpeg.dash.mpd":case "application/vnd.ms-sstr+xml":e=
"m";break a}e=void 0}d.ot=e;d.su=!0;return $x(b,d,ly(a,b))}catch(f){return Wa("CMCD_SRC_ERROR","Could not generate src CMCD data.",f),b}}function cy(a){if(!a.h&&a.l&&a.j.enabled){a.j.sessionId||(a.D=window.crypto.randomUUID(),a.j=by(a));var b=my(a.j);a.h=new Ox(b,ny(a));a.h.start();a.A&&Sx(a.h,{sf:a.A,st:a.i.isLive()?"l":"v"});a.o&&Sx(a.h,{Fi:a.o});oy(a)}}
function my(a){var b=a.includeKeys&&a.includeKeys.length?a.includeKeys:py(a.version);b={sid:a.sessionId,cid:a.contentId,Hg:a.useHeaders?"headers":"query",Mb:b,version:a.version===2?2:1};var c=a.eventTargets;c&&c.length&&(b.eventTargets=c.filter(function(d){return d.enabled!==!1&&d.url&&d.events&&d.events.length}).map(function(d){var e=d.includeKeys&&d.includeKeys.length?d.includeKeys:py(d.version||a.version);return{url:d.url,events:d.events,interval:d.interval,batchSize:d.batchSize,Mb:e,version:2}}));
return b}function ny(a){return function(b){var c,d,e,f,g,h;return H(function(k){if(k.i==1)return c=Kj,d=fj(),e=b.url,f=Cj([e],d),f.method=b.method||"POST",f.headers=b.headers||{},f.body=Hb(b.body),k.o(2),g=a.i.N,k.h(g.request(c.zl,f).promise,4);if(k.i!=2)return k.return({status:200});h=k.m();return k.return({status:h&&h.status?h.status:0})})}}function qy(a,b){a.h&&a.o!==b&&(a.o=b,Sx(a.h,{Fi:b}))}
function ry(a,b,c){try{var d={url:b.uris[0],headers:Object.assign({},b.headers||{}),Gf:{}},e=Wx(a.h,d,c),f=e.headers||{},g=Object.keys(d.headers).length;if(Object.keys(f).length>g){b.headers||(b.headers={});for(var h=r(Object.keys(f)),k=h.next();!k.done;k=h.next()){var l=k.value;l in d.headers||(b.headers[l]=f[l])}}var m=e.url;if(m&&m!==d.url)if(b.uris.length===1)b.uris=[m];else{var n=bx(e.Gf.cmcd);b.uris=b.uris.map(function(p){return p.includes("offline:")?p:Dx(p,n)})}}catch(p){Wa("CMCD_REQUEST_ERROR",
"Could not apply CMCD data to request.",p)}}
function sy(a,b,c,d){a=a.j;if(a.serviceLocations&&b!=8){b=ty(c.uris[0],a.serviceLocationBaseUris);if(!b)return Wa("CMCD_UNKNOWN_SERVICE_LOCATION","CMCD: the manifest restricts reporting to service locations "+a.serviceLocations.join(" ")+" but the location of some requests cannot be resolved; they are not decorated."),!1;if(!a.serviceLocations.includes(b))return!1}if(a.adaptationSets&&d.stream){var e=d.stream.groupId;if(!e)return Wa("CMCD_NO_GROUP_ID","CMCD: the manifest restricts reporting to adaptation sets "+a.adaptationSets.join(" ")+
" but some streams have no group id; they are not decorated. For DASH this happens when dash.enableAudioGroups is false."),!1;if(!a.adaptationSets.some(function(f){return e==f||e.startsWith(f+"_preselection_")}))return!1}return!0}function jy(a,b){var c=a.j.includeInRequests,d=c;if(!c.length){if(a.j.rj)return!1;d=uy}return d.includes("*")||b=="init"&&d.includes("segment")?!0:d.includes(b)}
function vy(a){return(a=a.j.eventTargets)?a.some(function(b){return b.enabled!==!1&&b.events&&b.events.includes("rr")}):!1}function ky(a){return{v:a.j.version,sid:a.j.sessionId,cid:a.j.contentId,sf:a.A,mtp:a.i.getBandwidthEstimate()/1E3}}function ly(a,b){var c={};b&&!b.includes("offline:")&&(c.ke=b);a.j.version!=null&&(c.version=a.j.version);c.qg="request";return c}
function oy(a){a.m.J(a.l,"pause",function(){qy(a,"a")});a.m.J(a.l,"playing",function(){qy(a,"p");a.h&&a.C&&(Sx(a.h,{msd:Date.now()-a.C}),a.C=0)});a.m.J(a.l,"seeking",function(){qy(a,"k")});a.m.J(a.l,"ended",function(){qy(a,"e")});a.m.J(a.l,"volumechange",function(){a.h&&a.l&&Vx(a.h,a.l.muted?"m":"um")});a.m.J(a.i,"buffering",function(b){qy(a,b.buffering?"r":"p")});a.m.J(a.i,"adaptation",function(){if(a.h&&a.i){var b=a.i.lc().find(function(c){return c.active});b&&b.bandwidth&&Sx(a.h,{br:[b.bandwidth/
1E3]})}});a.m.J(a.i,"error",function(){qy(a,"f");a.h&&Vx(a.h,"e")});uo(a.m,a.l,function(b){a.h&&Vx(a.h,b?"pe":"pc")});a.m.J(document,"visibilitychange",function(){a.h&&Sx(a.h,{bg:document.hidden})});a.m.J(a.i,"complete",function(){qy(a,"e")})}function wy(a){if(a.type===0)return"i";if(a=a.stream){var b=a.type;if(b=="video")return a.codecs&&a.codecs.includes(",")?"av":"v";if(b=="audio")return"a";if(b=="text")return a.mimeType==="application/mp4"?"tt":"c"}}
function xy(a,b){b=a.i.dc()[b];if(!b.length)return NaN;var c=a.l?a.l.currentTime:0;return(a=b.find(function(d){return d.start<=c&&d.end>=c}))?(a.end-c)*1E3:NaN}function yy(a,b){b=a.i.dc()[b];if(!b.length)return 0;var c=a.l?a.l.currentTime:0;return(a=b.find(function(d){return d.start<=c&&d.end>=c}))?(a.end-c)*1E3:0}
function zy(a,b){var c=a.i.lc();if(!c.length)return NaN;a=c[0];c=r(c);for(var d=c.next();!d.done;d=c.next())d=d.value,d.type==="variant"&&d.bandwidth>a.bandwidth&&(a=d);switch(b){case "v":return a.videoBandwidth||NaN;case "a":return a.audioBandwidth||NaN;default:return a.bandwidth}}function gy(a,b){var c=new Set(py(b)),d=a.filter(function(e){return c.has(e)||lx.test(e)});d.length!=a.length&&Za(a.filter(function(e){return!d.includes(e)}));return d}
function py(a){return a===2?Array.from(new Set([].concat(Nw,Ow,Mw))):[].concat(Pw)}function Ay(a,b){switch(a){case Hj:return b.type==0?"init":"segment";case 0:switch(b.type){case 6:return"mpdpatch";case 14:return"xlink";case 15:return"mpdlink";default:return"mpd"}case 8:return"steering";case 13:return"callback";case 2:case 5:case 6:return"license";case 4:return"timing";default:return null}}
function ty(a,b){var c=null;b=r(b);for(var d=b.next();!d.done;d=b.next())d=d.value,a.startsWith(d.uri)&&(!c||d.uri.length>c.uri.length)&&(c=d);return c?c.serviceLocation:null}var uy="segment init mpd mpdpatch xlink mpdlink license timing".split(" ");I("shaka.util.CmcdManager.StreamingFormat",{DASH:"d",HLS:"h",Ul:"s",OTHER:"o"});
I("shaka.util.CmcdManager.EventType",{yl:"bc",Ml:"ps",Il:"pr",ERROR:"e",Xl:"t",Al:"c",xl:"b",Hl:"m",Zl:"um",Kl:"pe",Jl:"pc",Ql:"rr",ul:"as",rl:"ae",ql:"abs",ol:"abe",Tl:"sk",Bl:"ce"});I("shaka.util.CmcdManager.PlayerState",{Wl:"s",Ll:"p",Rl:"k",Pl:"r",PAUSED:"a",am:"w",Cl:"e",Dl:"f",Ol:"q",Nl:"d"});function By(a){this.i=a;this.h=null}q=By.prototype;q.configure=function(a){this.i=a};q.uh=function(){return this.i.enabled&&this.i.applyMaximumSuggestedBitrate&&this.h&&this.h.has(Cy)?this.h.get(Cy)*1E3:null};q.rh=function(){return this.i.enabled&&this.h&&this.h.has(Dy)?this.h.get(Dy)*1E3:null};q.Sj=function(){return this.i.enabled&&this.h&&this.h.has(Ey)?this.h.get(Ey):null};q.Tj=function(){return this.i.enabled&&this.h&&this.h.has(Fy)?this.h.get(Fy):null};
q.getBandwidthEstimate=function(a){var b=this.rh();if(!b)return a;var c=this.i.estimatedThroughputWeightRatio;return c>0&&c<=1?a*(1-c)+b*c:a};function Gy(a){return a?a.toLowerCase()==="false"?!1:/^[-0-9]/.test(a)?parseInt(a,10):a.replace(/["]+/g,""):!0}I("shaka.util.CmsdManager",By);By.prototype.getBandwidthEstimate=By.prototype.getBandwidthEstimate;By.prototype.getRoundTripTime=By.prototype.Tj;By.prototype.getResponseDelay=By.prototype.Sj;By.prototype.getEstimatedThroughput=By.prototype.rh;
By.prototype.getMaxBitrate=By.prototype.uh;var Dy="etp",Cy="mb",Ey="rd",Fy="rtt";function Hy(){this.h=null;this.i=[]}function Iy(a,b){return H(function(c){if(c.i==1)return a.h?c.h(new Promise(function(d){return a.i.push(d)}),2):c.B(2);a.h=b;c.l()})}Hy.prototype.release=function(){this.i.length>0?this.i.shift()():this.h=null};function Jy(a){this.h=a;this.j=this.i=null}Jy.prototype.start=function(a,b){function c(e,f){d.h&&d.j===c&&a(e,f);d.h&&d.j===c&&!b&&(d.i=d.h.requestVideoFrameCallback(c))}var d=this;b=b===void 0?!1:b;Ky(this);if(!(this.h&&"requestVideoFrameCallback"in this.h))return!1;this.j=c;this.i=this.h.requestVideoFrameCallback(c);return!0};Jy.prototype.release=function(){Ky(this);this.h=null};
function Ky(a){if(a.i!==null){var b,c;(b=a.h)==null||(c=b.cancelVideoFrameCallback)==null||c.call(b,a.i);a.i=null}a.j=null};function Y(a,b,c){b=b===void 0?null:b;oj.call(this);var d=this;this.m=Ly;this.i=null;this.ud=b;this.Pa=!1;this.fe=new ib;this.wd=new ib;this.o=new ib;this.Mc=new ib;this.Pc=new ib;this.G=this.H=this.yd=this.V=this.u=this.N=null;this.Qc=0;this.ua=new Hy;this.l=this.vd=this.ea=this.Sg=this.La=this.K=this.zb=this.Bb=this.ya=this.td=this.Z=this.Ab=this.O=this.Ec=null;this.qa=My(this);this.U=this.W=this.$=this.j=this.sd=this.I=null;this.ra=!1;this.$d=this.A=null;this.ge=1E9;this.ee=[];this.qd=new Map;
this.ce=[];this.rf=-1;this.h=Ny(this);this.uf=dn();this.ia=null;this.je=-1;this.Kc=null;this.Qa={width:Infinity,height:Infinity};this.Zd=new Zq(this.h,this.Qa,null);this.be=[];this.C=null;this.P=this.h.adaptationSetCriteriaFactory();b={preferredAudio:this.h.preferredAudio,preferredVideo:this.h.preferredVideo,language:"",role:"",videoRole:"",channelCount:0,hdrLevel:"",spatialAudio:!1,videoLayout:"",audioLabel:"",videoLabel:"",preferredAudioCodecs:[],preferredAudioChannelCount:0,codecSwitchingStrategy:this.h.mediaSource.codecSwitchingStrategy,
audioCodec:"",activeAudioCodec:"",activeAudioChannelCount:0,keySystem:this.keySystem()};fn(b);this.P.configure(b);this.xd=[];c&&c(this);this.K=new ay(this,this.h.cmcd);this.La=new By(this.h.cmsd);this.N=Oy(this);this.Aa=this.Ga=this.Ra=this.D=null;this.wf=!1;this.tf=[];this.vf=new gf(function(){return H(function(e){if(e.i==1)return d.Ga?e.h(d.ub(d.Aa,!0),3):e.B(0);if(e.i!=4)return e.h(d.load(d.Ga),4);d.wf?d.Aa.pause():d.Aa.play();d.Ga=null;d.wf=!1;e.l()})});Py&&(this.D=Py(this),this.D.configure(this.h.ads),
this.Pc.J(this.D,"ad-content-pause-requested",function(e){var f,g;return H(function(h){if(h.i==1){d.vf.stop();if(d.Ga)return h.B(0);d.Aa=d.i;d.wf=d.Nd();f=e.saveLivePosition||!1;g=!0;d.isLive()&&(g=f);return h.h(d.gh(!0,g),3)}d.Ga=h.j;h.l()})}),this.Pc.J(this.D,"ad-content-resume-requested",function(e){e=e.offset||0;if(d.Ga){var f=d.Ga;f.A&&e&&(typeof f.A==="number"?f.A+=e:f.A.setTime(f.A.getTime()+e*1E3))}d.vf.ka(.1)}),this.Pc.J(this.D,"ad-content-attach-requested",function(){return H(function(e){if(e.i==
1)return d.i||!d.Aa?e.B(0):e.h(d.ub(d.Aa,!0),3);d.Aa=null;e.l()})}));Qy&&(this.Ra=Qy(this),this.Ra.configure(this.h.queue));this.fe.J(window,"online",function(){Ry(d);d.xg()});this.ae=new gf(function(){for(var e=Date.now()/1E3,f=!1,g=!0,h=r(d.j.variants),k=h.next();!k.done;k=h.next())k=k.value,k.disabledUntilTime>0&&k.disabledUntilTime<=e&&(k.disabledUntilTime=0,f=!0),k.disabledUntilTime>0&&(g=!1);g&&d.ae.stop();f&&Sy(d,!1,void 0,!1,!1)});this.L=this.F=this.nc=null;this.zd=new Set;this.za=null;this.Pg=
new pj;this.ie=null;a&&(Ua("Please migrate from initializing Player with a mediaElement; use the attach method instead."),this.ub(a,!0))}ra(Y,oj);function Ty(a){a.ea!=null&&(Fc(a.ea),a.ea.release(),a.ea=null)}function Uy(a,b,c){c||b.lcevc.enabled?(Ty(a),a.ea==null&&(a.ea=new Cc(a.i,a.Sg,b.lcevc,c),a.H&&(a.H.H=a.ea))):Ty(a)}function Vy(a,b){return new nj(a,b)}q=Y.prototype;
q.destroy=function(){var a=this,b;return H(function(c){switch(c.i){case 1:if(a.m==Wy)return c.return();Ty(a);for(var d=a.ua;d.h;)d.release();b=a.detach();a.m=Wy;return c.h(b,2);case 2:if(!a.V){c.B(3);break}return c.h(a.V.destroy(),4);case 4:a.V=null;case 3:return a.yd=null,c.h(a.fh(),5);case 5:a.fe&&(a.fe.release(),a.fe=null);a.wd&&(a.wd.release(),a.wd=null);a.o&&(a.o.release(),a.o=null);a.Mc&&(a.Mc.release(),a.Mc=null);a.Pc&&(a.Pc.release(),a.Pc=null);a.$d=null;a.h=null;a.C=null;a.ud=null;a.K=null;
a.La=null;if(!a.N){c.B(6);break}return c.h(a.N.destroy(),7);case 7:a.N=null;case 6:a.A&&(a.A.release(),a.A=null),a.Ra&&(a.Ra.destroy(),a.Ra=null),a.L&&(a.L.release(),a.L=null),a.za&&(a.za.release(),a.za=null),oj.prototype.release.call(a),c.l()}})};function Xy(a,b){a.dispatchEvent(Vy("onstatechange",(new Map).set("state",b)))}
q.ub=function(a,b){b=b===void 0?!0:b;var c=this,d,e,f;return H(function(g){switch(g.i){case 1:if(c.m==Wy)throw new T(2,7,7E3);d=c.i&&c.i==a;if(!c.i||c.i==a){g.B(2);break}return g.h(c.detach(),2);case 2:return g.h(Yy(c,"attach"),4);case 4:if(g.j)return g.return();g.o(5,6);d||(Xy(c,"attach"),e=function(){var h=Zy(c,!1);h&&$y(c,h)},c.wd.J(a,"error",e),c.i=a,c.K&&c.K.setMediaElement(a));R();if(!b||!Kc()||c.H){g.B(6);break}return g.h(az(c),6);case 6:g.F();c.ua.release();g.G(0);break;case 5:return f=g.m(),
g.h(c.detach(),10);case 10:throw f;}})};q.$i=function(a){this.Sg=a};q.detach=function(a,b){a=a===void 0?!1:a;b=b===void 0?!1:b;var c=this;return H(function(d){if(d.i==1){if(c.m==Wy)throw new T(2,7,7E3);return d.h(c.Yd(!1,a,b),2)}if(d.i!=3)return d.h(Yy(c,"detach"),3);if(d.j)return d.return();try{c.i&&(c.wd.Sa(),c.i=null),Xy(c,"detach"),c.D&&!a&&c.D.release()}finally{c.ua.release()}d.l()})};
function Yy(a,b){var c;return H(function(d){return d.i==1?(c=++a.Qc,d.h(Iy(a.ua,b),2)):c!=a.Qc?(a.ua.release(),d.return(!0)):d.return(!1)})}
q.Yd=function(a,b,c){a=a===void 0?!0:a;b=b===void 0?!1:b;c=c===void 0?!1:c;var d=this,e,f,g,h,k,l,m,n,p,t,u,v,w,x,y,z,D,A;return H(function(B){switch(B.i){case 1:return d.m!=Wy&&(d.m=Ly),B.h(Yy(d,"unload"),2);case 2:if(B.j)return B.return();e=d.h.drm.keepDrmEngineOnDetach&&!!d.u&&!!d.u.Nb();if(!e){B.B(3);break}if(!d.V||d.V==d.u){B.B(4);break}return B.h(d.V.destroy(),4);case 4:d.V=d.u,d.yd=d.$,d.u=null;case 3:return B.K(6),d.ra=!1,Xy(d,"unload"),Ty(d),f=d.xd.map(function(E){return E()}),d.xd=[],B.h(Promise.all(f),
8);case 8:g=(new Map).set("isSwitchingContent",c);d.dispatchEvent(Vy("unloading",g));d.td&&(d.td.release(),d.td=null);d.zb&&(d.zb.release(),d.zb=null);d.ya&&(d.ya.release(),d.ya=null);d.Bb&&(d.Bb.release(),d.Bb=null);d.i&&(d.o.Sa(),d.Mc.Sa());d.ae.stop();d.Ec&&(d.Ec.release(),d.Ec=null);d.Ab&&(d.Ab.stop(),d.Ab=null);if(!d.I){B.B(9);break}return B.h(d.I.stop(),10);case 10:d.I=null,d.sd=null;case 9:d.A&&d.A.stop();if(!d.l){B.B(11);break}return B.h(d.l.destroy(),12);case 12:d.l=null;case 11:d.qa.h=[];
d.O&&(d.O.release(),d.O=null);d.G&&(d.G.release(),d.G=null);if("webkit"!==window.shakaMediaKeysPolyfill||!d.u){B.B(13);break}return B.h(d.u.destroy(),14);case 14:d.u=null;case 13:if(!d.H){B.B(15);break}return B.h(d.H.destroy(),16);case 16:d.H=null;case 15:if(d.D&&!b)d.D.onAssetUnload();d.Ga&&!b&&(d.Ga.destroy(),d.Ga=null);b||d.vf.stop();d.K&&ey(d.K);d.La&&(d.La.h=null);if(!d.F){B.B(17);break}return B.h(d.F.destroy(),18);case 18:d.F=null;case 17:return d.Pa=!1,d.L&&d.L.disable(),d.zd.clear(),d.za&&
(d.za.release(),d.za=null),B.h(d.Pg.destroy(),19);case 19:if(d.i){h=r(d.tf);for(k=h.next();!k.done;k=h.next())l=k.value,l.src.startsWith("blob:")&&URL.revokeObjectURL(l.src),l.remove();d.tf=[];po(d.i)&&d.i.load()}if(!d.u){B.B(20);break}return B.h(d.u.destroy(),21);case 21:d.u=null;case 20:d.nc&&d.$!=d.nc.ze()&&(d.nc.D||d.nc.destroy(),d.nc=null);d.$=null;d.W=null;d.Z=null;if(d.j){m=r(d.j.variants);for(n=m.next();!n.done;n=m.next())for(p=n.value,t=r([p.audio,p.video]),u=t.next();!u.done;u=t.next())(v=
u.value)&&v.segmentIndex&&v.segmentIndex.release();w=r(d.j.textStreams);for(x=w.next();!x.done;x=w.next())y=x.value,y.segmentIndex&&y.segmentIndex.release()}d.h&&d.h.streaming.clearDecodingCache&&(Df.clear(),fc.clear());d.j=null;d.C=new hu;d.Rg=null;d.Kc=null;d.ia=null;d.je=-1;d.ee=[];z=r(d.qd.values());for(D=z.next();!D.done;D=z.next())A=D.value,A.stop();d.qd.clear();d.ce=[];d.rf=-1;d.N&&d.N.Zg();d.ie&&(URL.revokeObjectURL(d.ie),d.ie=null);bz(d);case 6:B.F();d.ua.release();B.G(7);break;case 7:R();
if(a&&Kc()&&!d.H&&d.i)return B.h(az(d),0);B.B(0)}})};q.kl=function(a){this.U=a};q.load=function(a,b,c){b=b===void 0?null:b;var d=this;return H(function(e){return e.h(cz(d,a,b,c),0)})};
function cz(a,b,c,d,e,f){e=e===void 0?!1:e;f=f===void 0?null:f;var g,h,k,l,m,n,p,t,u,v,w,x,y,z,D,A,B,E;return H(function(C){switch(C.i){case 1:if(a.m==Wy)throw new T(2,7,7E3);if(a.i||!a.Aa){C.B(2);break}return C.h(a.ub(a.Aa,!0),3);case 3:a.Aa=null;case 2:g=null;h="";d=(k=d)==null?void 0:k.toLowerCase();if(b instanceof qu){if(b.D)throw new T(2,7,7006);g=b;h=g.ze()||""}else h=b||"";return C.h(Iy(a.ua,"load"),4);case 4:a.ua.release();if(f!=null&&f!=a.Qc)throw new T(2,7,7E3);if(!a.i)throw new T(2,7,7002);
l=a.h.drm.keepDrmEngineOnDetach&&!!a.V&&a.yd===h;if(!a.$){C.B(5);break}a.$=h;return C.h(a.Yd(!1,!1,!0),5);case 5:a.K&&cy(a.K);m=++a.Qc;n=function(){return H(function(G){if(G.i==1)return a.Qc==m?G.B(0):g?G.h(g.destroy(),3):G.B(3);throw new T(2,7,7E3);})};p=function(G,K){return H(function(L){switch(L.i){case 1:return L.K(2),L.h(Iy(a.ua,K),4);case 4:return L.h(n(),5);case 5:return L.h(G(),6);case 6:return L.h(n(),7);case 7:g&&a.h&&(g.j=a.h);case 2:L.F(),a.ua.release(),L.G(0)}})};t=!1;C.o(7,8);c==null&&
g&&(c=g.getStartTime());a.U=c;a.ra=!1;a.$=h;a.dispatchEvent(Vy("loading"));if(g){d=g.Of();C.B(10);break}if(d){C.B(10);break}return C.h(p(function(){return H(function(G){if(G.i==1)return G.h(dz(a,h),2);d=G.j;G.l()})},"guessMimeType_"),10);case 10:u=!!g;if(g||e){g&&(tu(g,a),a.C=g.getStats());C.B(13);break}return C.h(ez(a,h,c,d,!0,a.h),14);case 14:(g=C.j)?(g.H=!1,tu(g,a),a.C=g.getStats(),l&&a.V&&xu(g,a.V),g.start(),g.G.promise.catch(function(){})):a.C=new hu;case 13:v=!g;w=Date.now()/1E3;a.C=g?g.getStats():
new hu;a.W=d||null;bz(a);x=function(){var G=a.i?a.i.buffered:null;return{start:Kq(G)||0,end:Lq(G)||0}};a.ya=new Ms(x);a.ya.addEventListener("regionadd",function(G){fz(a,G.region,"metadataadded")});if(v)return C.h(p(function(){return H(function(G){return G.h(gz(a,d,l),0)})},"initializeSrcEqualsDrmInner_"),28);a.Bb=new Ms(x);return C.h(p(function(){return H(function(G){if(G.i==1)return G.h(Promise.race([g.qa.promise,g.G.promise]),2);a.sd=g.L;var K=g;K.ra=!0;a.I=K.o;a.j=g.Nf();G.l()})},"waitForFinish"),
17);case 17:hz(a);if(a.H){C.B(18);break}return C.h(p(function(){return H(function(G){return G.h(az(a),0)})},"initializeMediaSourceEngineInner_"),18);case 18:return C.h(p(function(){return H(function(G){return G.h(g.G.promise,0)})},"waitForFinish"),20);case 20:a.h=g.getConfiguration();a.Zd=g.I;a.I&&a.I.setMediaElement&&a.i&&a.I.setMediaElement(a.i);a.td=uu(g);a.zb=vu(g);a.vd=g.La;if(y=g.m)a.P=y;u&&a.i&&a.i.nodeName==="AUDIO"&&(iz(a),a.configure("manifest.disableVideo",!0));if(l)return a.u=a.V,a.V=
null,a.yd=null,C.h(p(function(){return H(function(G){return G.h(a.u.ub(a.i),0)})},"drmEngine_.attach"),22);if(g.l){C.B(23);break}return C.h(p(function(){return H(function(G){return G.h(Bu(g,a.i),0)})},"drmEngine_.init"),23);case 23:return a.u=wu(g),C.h(p(function(){return H(function(G){return G.h(a.u.ub(a.i),0)})},"drmEngine_.attach"),22);case 22:return a.P&&(z=a.P.getConfiguration(),z.keySystem=a.keySystem(),a.P.configure(z)),D=a.h.abrFactory,a.A&&a.$d==D||(a.$d=D,a.A&&a.A.release(),a.A=D(),a.A.configure(a.h.abr)),
A=yu(g),B=g.i,C.h(p(function(){return H(function(G){return G.h(jz(a,w,B,A),0)})},"loadInner_"),27);case 27:su(g);a.W&&R().Ki()&&Ne(a.W)&&rr(a.H,a.$,a.W);C.B(16);break;case 28:return C.h(p(function(){return H(function(G){return G.h(kz(a,w,d),0)})},"srcEqualsInner_"),16);case 16:a.dispatchEvent(Vy("loaded"));case 8:C.F();if(!g){C.B(30);break}return C.h(g.destroy(),30);case 30:a.nc=null;C.G(9);break;case 7:E=C.m();if(t=E instanceof T&&!!g&&!e&&a.Qc==m&&lz(a,d,E))c=a.U;if(!E||E.code==7E3){C.B(32);break}return C.h(a.Yd(!1),
32);case 32:if(!t)throw E;C.B(8);break;case 9:if(t)return C.h(cz(a,h,c,d,!0,m+1),0);C.B(0)}})}function iz(a){for(var b=r(a.j.variants),c=b.next();!c.done;c=b.next())c=c.value,c.video&&(c.video.closeSegmentIndex(),c.video=null),c.bandwidth=c.audio&&c.audio.bandwidth?c.audio.bandwidth:0;a.j.variants=a.j.variants.filter(function(d){return d.audio})}
q.fl=function(a,b,c,d){a=a===void 0?!0:a;b=b===void 0?!1:b;c=c===void 0?!1:c;d=d===void 0?!1:d;var e=this,f;return H(function(g){return g.i==1?g.h(mz(e,c),2):g.i!=3?(f=g.j,g.h(e.Yd(a,b,d),3)):g.return(f)})};q.gh=function(a,b,c){a=a===void 0?!1:a;b=b===void 0?!1:b;c=c===void 0?!1:c;var d=this,e;return H(function(f){return f.i==1?f.h(mz(d,b),2):f.i!=3?(e=f.j,f.h(d.detach(a,c),3)):f.return(e)})};
function mz(a,b){b=b===void 0?!1:b;var c,d,e;return H(function(f){if(f.i==1){c=null;if(!(a.j&&a.I&&a.sd&&a.$&&a.h))return f.B(2);d=a.i.currentTime;b||(d=null);return f.h(nz(a,a.$,d,a.W,a.h,!0,!1),3)}if(f.i!=2){c=f.j;a.be.push(c);a.I&&a.I.setMediaElement&&a.I.setMediaElement(null);if(e=a.l?a.l.u:null)c.i=e;var g=c,h=a.I,k=a.sd;g.h=a.j;g.o=h;g.L=k;c.m=a.P;c.start();a.j=null;a.I=null;a.sd=null;a.A=null;a.$d=null}return f.return(c)})}
q.preload=function(a,b,c,d,e){b=b===void 0?null:b;e=e===void 0?!1:e;var f=this,g,h,k,l;return H(function(m){if(m.i==1)return c=(g=c)==null?void 0:g.toLowerCase(),h=Ny(f),en(h,d||f.h,Ny(f)),m.h(ez(f,a,b,c,!1,h),2);if(k=m.j)k.start();else{l=new T(2,7,7005);if(e)throw l;$y(f,l)}return m.return(k)})};q.fh=function(){var a=this,b,c,d,e;return H(function(f){b=[];c=r(a.be);for(d=c.next();!d.done;d=c.next())e=d.value,e.D||b.push(e.destroy());a.be=[];return f.h(Promise.all(b),0)})};
function ez(a,b,c,d,e,f){e=e===void 0?!1:e;var g,h,k,l;return H(function(m){if(m.i==1)return d?m.B(2):m.h(dz(a,b),3);m.i!=2&&(d=m.j);if(g=lz(a,d))return m.return(null);h=f||a.h;k=!1;e&&a.i&&a.i.nodeName==="AUDIO"&&(k=!0);l=nz(a,b,c,d||null,h,!e,k);l=e?l.then(function(n){n.H=!1;return n}):l.then(function(n){a.be.push(n);return n});return m.return(l)})}
function nz(a,b,c,d,e,f,g){f=f===void 0?!0:f;g=g===void 0?!1:g;var h,k,l,m,n,p,t,u,v,w,x,y,z,D,A,B;return H(function(E){if(E.i==1){h=null;k=id(e);g&&(k.manifest.disableVideo=!0);l=function(){return h.K&&h.D?null:h};m=function(){return l()?l().getConfiguration():a.h};if(a.Qa.width!=Infinity||a.Qa.height!=Infinity||a.h.ignoreHardwareResolution)return E.B(2);n=R();return E.h(n.Db(),3)}E.i!=2&&(p=E.j,a.Qa.width=p.width,a.Qa.height=p.height);t=new Zq(k,a.Qa,null);u={networkingEngine:a.N,filter:function(C){var G,
K;return H(function(L){if(L.i==1)return L.h($q(t,C),2);if(L.i!=4){G=L.j;if(!G)return L.B(0);K=Vy("trackschanged");return L.h(Promise.resolve(),4)}h.dispatchEvent(K);L.l()})},makeTextStreamsForClosedCaptions:function(C){for(var G=new Set,K=r(C.textStreams),L=K.next();!L.done;L=K.next())L=L.value,L.mimeType!=Re&&L.mimeType!=Se||G.add(L.originalId);K=r(C.variants);for(L=K.next();!L.done;L=K.next())if((L=L.value.video)&&L.closedCaptions)for(var N=r(L.closedCaptions.keys()),J=N.next();!J.done;J=N.next())if(J=
J.value,!G.has(J)){var O=J.startsWith("CC")?Re:Se,M=new Fk,P=L.closedCaptions.get(J);O=Yf({id:a.ge++,originalId:J,segmentIndex:M,mimeType:O,kind:"caption",language:P,originalLanguage:P,type:wc,roles:L.roles});C.textStreams.push(O);G.add(J)}},onTimelineRegionAdded:function(C){Ns(h.N,C)},onScte35Event:function(C){Ns(h.V,C)},onEvent:function(C){return h.dispatchEvent(C)},onError:function(C){return h.onError(C)},isLowLatencyMode:function(){return m().streaming.lowLatencyMode},updateDuration:function(){a.l&&
h.K&&a.l.updateDuration()},newDrmInfo:function(C){var G=h.l,K=G?G.Nb():null;K&&G.A&&cr(t,K.keySystem,C)},onManifestUpdated:function(){var C=(new Map).set("isLive",a.isLive()).set("isInProgress",a.ad());h.dispatchEvent(Vy("manifestupdated",C));ru(h,!1,function(){if(a.D)a.D.onManifestUpdated(a.na())});h.K&&hz(a)},getBandwidthEstimate:function(){return a.A.getBandwidthEstimate()},onMetadata:function(C,G,K,L){var N=C;if(C=="com.apple.hls.interstitial"||C=="com.apple.hls.overlay")N="com.apple.quicktime.HLS";
var J={type:N,startTime:G,endTime:K,values:L};C=new Promise(function(P){ru(h,!1,function(){return H(function(U){switch(U.i){case 1:if(!a.D){U.B(0);break}if(!a.i){U.B(3);break}U.o(4);return U.h(a.D.onHLSMetadata(J),6);case 6:U.u(3);break;case 4:U.m();case 3:P(),U.l()}})})});L=r(L);for(var O=L.next(),M={};!O.done;M={kg:void 0},O=L.next())M.kg=O.value,M.kg.name!="ID"&&ru(h,!1,function(P){return function(){oz(a,G,K,N,P.kg)}}(M));return C},disableStream:function(C){return a.disableStream(C,a.h.streaming.maxDisabledTime)},
addFont:function(C,G){return a.addFont(C,G)},getStreamingRetryParameters:function(){return a.h.streaming.retryParameters},onSegmentReceived:function(C,G){ru(h,!1,function(){var K;(K=a.A)==null||K.segmentDownloaded(C,G,!0)})}};v=new Ms(function(){return a.Za()});v.addEventListener("regionadd",function(C){var G=C.region;pz(a,"timelineregionadded",G,h);ru(h,!1,function(){if(a.D)a.D.onDASHMetadata(G)})});w=new Ms(function(){return a.Za()});w.addEventListener("regionadd",function(C){h.dispatchEvent(Vy("scte35added",
(new Map).set("detail",C.region)))});x=null;k.streaming.observeQualityChanges&&(x=new Hs(function(){return a.dc()}),x.addEventListener("qualitychange",function(C){qz(a,C.quality,C.position)}),x.addEventListener("audiotrackchange",function(C){qz(a,C.quality,C.position,!0)}));y=!0;z={Dc:a.N,onError:function(C){return h.onError(C)},Yh:function(C){ru(h,!0,function(){a.u&&rz(a,C)})},onExpirationUpdated:function(C,G){var K=Vy("expirationupdated");h.dispatchEvent(K);if((K=h.o)&&K.onExpirationUpdated)K.onExpirationUpdated(C,
G)},onEvent:function(C){h.dispatchEvent(C);if(C.type=="drmsessionupdate"&&y){y=!1;C=Date.now()/1E3-h.Aa;var G=a.C||h.getStats();C>=0&&(G.o=C);a.ea&&Fc(a.ea)}}};D=Oy(a,l);Bj(a.N,D);A=function(){return a.re(z)};B={config:k,pk:u,Hk:v,Pk:w,Gk:x,re:A,nk:t,networkingEngine:D,Zi:f,Ck:function(C){h.K&&hz(a,C)}};h=new qu(b,d,c,B);return E.return(h)})}
function dz(a,b){var c,d,e,f;return H(function(g){if(g.i==1)return c=a.h.manifest.retryParameters,g.h(vl(b,a.N,c),2);d=g.j;Ne(d)?(e=R(),e.Ba()==="WEBKIT"&&(d="application/vnd.apple.mpegurl")):d==="video/quicktime"&&(f=R(),f.Ba()==="CHROMIUM"&&(d="video/mp4"));return g.return(d)})}
function lz(a,b,c){c=c===void 0?null:c;R();if(!c&&!Kc())return!0;if(b){if((a.i||Lc()).canPlayType(b)=="")return!1;if(c)return a.h.streaming.fallbackToNativeHlsOnMseError&&Ne(b)&&(c.code==4040||c.code==4041);if(!Kc(R())||!Ic.has(b))return!0;if(Ne(b))return R().Ba()==="WEBKIT"&&(a.h.drm.servers["com.apple.fps"]||a.h.drm.servers["com.apple.fps.1_0"])?a.h.streaming.useNativeHlsForFairPlay:a.h.streaming.preferNativeHls;if(b==="application/dash+xml"||b==="video/vnd.mpeg.dash.mpd")return a.h.streaming.preferNativeDash}return!1}
function sz(a,b){var c=a.h.textDisplayFactory;a.Rg!==c||(b===void 0?0:b)?(b=a.F,a.F=c(a),a.F.configure(a.h.textDisplayer),b?(a.F.setTextVisibility(b.isTextVisible()),b.destroy().catch(function(){})):a.F.setTextVisibility(a.Pa),a.H&&cs(a.H,a.F),a.Rg=c,a.l&&At(a.l)):a.F&&a.F.configure(a.h.textDisplayer)}
function az(a){var b,c,d;return H(function(e){if(e.i==1)return R(),Xy(a,"media-source"),a.h.mediaSource.useSourceElements&&po(a.i),sz(a),b=tz(a.i,a.F,{Be:function(){return a.keySystem()},onMetadata:function(f,g,h){f=r(f);for(var k=f.next();!k.done;k=f.next())if(k=k.value,k.data&&typeof k.cueTime=="number"&&k.frames){var l=k.cueTime+g,m=h;m&&l>m&&(m=l);for(var n=r(k.frames),p=n.next();!p.done;p=n.next())oz(a,l,m,"org.id3",p.value);if(a.D)a.D.onHlsTimedMetadata(k,l)}},Ak:function(f){a.Bb&&Ns(a.Bb,{schemeIdUri:f.schemeIdUri,
startTime:f.startTime,endTime:f.endTime,id:String(f.id),emsg:f});if(a.zb){if(hn.includes(f.schemeIdUri.trim())){var g={schemeIdUri:f.schemeIdUri,startTime:f.startTime,endTime:f.eventDuration==4294967295?f.startTime:f.endTime,id:String(f.id),source:"emsg",kind:"",data:null,node:null};if(f.messageData&&f.messageData.length)if(f.schemeIdUri.trim().endsWith(":bin"))g.data=f.messageData;else{var h=null;try{b:{var k=Gb(f.messageData);try{for(var l=r(nd(k,!1)||[]),m=l.next();!m.done;m=l.next()){var n=m.value;
if(typeof n!="string"&&!n.tagName.startsWith("?")){h=n;break b}}}catch(p){}h=null}}catch(p){}h&&(g.data=gn(h),g.data||(g.node=h))}f=g}else f=null;f&&Ns(a.zb,f)}},onEvent:function(f){return a.dispatchEvent(f)},Dk:function(){a.I&&a.I.update&&a.I.update()},Nb:function(){return a.drmInfo()}},a.ea,a.h.mediaSource),c=a.h.manifest,d=c.segmentRelativeVttTiming,b.Ga=d,e.h(b.O.promise,2);a.H=b;e.l()})}
function uz(a,b){a.O=new ms({Qf:function(){return b.playbackRate},Wc:function(){return b.defaultPlaybackRate},wi:function(c){b.playbackRate=c},xk:function(c){var d=b.currentTime;if(Mq(b.buffered,d)&&!(b.readyState<=HTMLMediaElement.HAVE_CURRENT_DATA)){var e=d+c,f=a.Za();if(e<f.start)d!==f.start&&(b.currentTime=f.start);else if(e>f.end)d!==f.end&&(b.currentTime=f.end);else{if(c<0)for(c=Oq(b.buffered),d=c.length-1;d>=0;d--)if(e>=c[d].start){e>c[d].end&&(e=Math.max(c[d].start,c[d].end-.5));break}b.currentTime=
e}}},isPaused:function(){return b.paused}})}
function vz(a,b,c){a.o.Fb(b,["playing","pause","ended"],function(){wz(a)});a.o.J(b,"ratechange",function(){xz(a)});var d=wo(R(),b);d&&(a.o.J(d,"connect",function(){a.l&&d.state=="connected"&&yz(a);zz(a)}),a.o.J(d,"connecting",function(){return zz(a)}),a.o.J(d,"disconnect",function(){return H(function(f){if(f.i==1)return a.l&&d.state=="disconnected"?f.h(Pt(a.l),3):f.B(2);f.i!=2&&yz(a);zz(a);f.l()})}));b.audioTracks&&a.o.Fb(b.audioTracks,["addtrack","removetrack","change"],function(){zz(a)});b.videoTracks&&
a.o.Fb(b.videoTracks,["addtrack","removetrack","change"],function(){zz(a)});(b.webkitPresentationMode||b.webkitSupportsFullscreen)&&a.o.J(b,"webkitpresentationmodechanged",function(){a.ud&&sz(a,!0)});if(b.textTracks){var e=function(){a.m===Az&&a.F instanceof Iv&&yz(a);zz(a)};a.o.J(b.textTracks,"addtrack",function(f){if(f.track)switch(f=f.track,f.kind){case "metadata":Bz(a,f);break;case "chapters":Cz(a,f);break;default:e()}});a.o.Fb(b.textTracks,["removetrack","change"],e)}b.preload!="none"&&(a.o.Ma(b,
"loadedmetadata",function(){var f=a.C,g=Date.now()/1E3-c;g>=0&&(f.H=g)}),a.Ch()||(a.za=new Jy(b),a.za.start(function(){a.za.release();a.za=null;var f=a.C,g=Date.now()/1E3-c;g>=0&&(f.u=g)},!0)||a.o.Ma(b,"loadeddata",function(){var f=a.C,g=Date.now()/1E3-c;g>=0&&(f.u=g)})))}
function jz(a,b,c,d){var e,f,g,h,k,l,m,n,p,t,u,v,w,x,y,z,D,A,B,E,C,G,K,L,N,J,O,M,P,U,Q,da,Z,ka,va;return H(function(Ea){switch(Ea.i){case 1:Xy(a,"load");e=a.i;uz(a,e);vz(a,e,b);"onchange"in window.screen&&a.o.J(window.screen,"change",function(){if(a.P.getConfiguration){var pa=a.P.getConfiguration();pa.preferredVideo.some(function(Aa){return Aa.hdrLevel=="AUTO"})?Dz(a):a.h.preferredVideo.some(function(Aa){return Aa.hdrLevel=="AUTO"})&&a.h.abr.enabled&&(pa.preferredVideo=a.h.preferredVideo,fn(pa),a.P.configure(pa),
Dz(a))}});f=!1;g=r(a.j.variants);for(h=g.next();!h.done;h=g.next())k=h.value,(l=k.video&&k.video.dependencyStream)&&(f=Ec(l));Uy(a,a.h,f);Ez(a.j.presentationTimeline,a.h.playRangeStart,a.h.playRangeEnd);a.A.init(function(pa,Aa,Va){a.j&&a.l&&pa!=a.l.u&&Fz(a,pa,!0,Aa===void 0?!1:Aa,Va===void 0?0:Va)},function(pa,Aa){var Va,Ya=(Va=a.l)==null?void 0:Va.u;(pa=Ya&&Ya[pa])&&a.disableStream(pa,Aa)});a.A.setMediaElement(e);a.A.setCmsdManager(a.La);a.l=Gz(a);a.l.configure(a.h.streaming);m=a.qa.h.slice();a.qa.h=
[];n=r(m);for(p=n.next();!p.done;p=n.next())t=p.value,a.Tg(t.start,t.end);a.m=Hz;a.dispatchEvent(Vy("streaming"));u=c;case 2:w=a.l.u;w||(x=Iz(a,!0),c||(u=x));y=[];v=w||u;z=r([v.video,v.audio]);for(D=z.next();!D.done;D=z.next())(A=D.value)&&!A.segmentIndex&&(y.push(A.createSegmentIndex()),A.dependencyStream&&y.push(A.dependencyStream.createSegmentIndex()));if(!(y.length>0)){Ea.B(4);break}return Ea.h(Promise.all(y),4);case 4:if(!v||v.disabledUntilTime!=0){Ea.B(2);break}Dz(a);if(a.I&&a.I.onInitialVariantChosen)a.I.onInitialVariantChosen(v);
a.j.isLowLatency&&(a.h.streaming.lowLatencyMode?a.configure(a.uf):Ua("Low-latency live stream detected, but low-latency streaming mode is not enabled in Shaka Player. Set streaming.lowLatencyMode configuration to true, and see https://bit.ly/3clctcj for details."));a.K&&hy(a.K,b*1E3);Ez(a.j.presentationTimeline,a.h.playRangeStart,a.h.playRangeEnd);ot(a.l,a.h.playRangeStart,a.h.playRangeEnd);return Ea.h(Jz(a),7);case 7:a.ra=!0;a.dispatchEvent(Vy("canupdatestarttime"));B=function(pa){a.G=Kz(a,pa);a.Ec=
Lz(a,pa);Mz(a,e,!1)};a.h.streaming.startAtSegmentBoundary||(E=a.U,E==null&&a.j.startTime&&(E=a.j.startTime),B(E));if(w){Ea.B(8);break}if(!a.h.streaming.startAtSegmentBoundary){Ea.B(9);break}C=a.j.presentationTimeline;a.U instanceof Date&&(K=C.l||C.j,L=a.U.getTime()/1E3-K,L!=null&&(G=L));G==null&&(G=typeof a.U==="number"?a.U:a.isLive()?Infinity:a.i.currentTime);a.U==null&&a.j.startTime&&(G=a.j.startTime);N=C.yb();J=C.ob();G<N?G=N:G>J&&(G=J);return Ea.h(Nz(u,G),10);case 10:O=Ea.j,B(O);case 9:Fz(a,u,
!0,!1,0);case 8:a.G.ready();M=a.pb().find(function(pa){return pa.active});if(!M){if(P=Oz(a,u))gu(a.C.l,P,!0),P?(a.Pa=!0,a.F.setTextVisibility(!0)):(a.Pa=!1,a.F.setTextVisibility(!1));P&&a.Pa&&(zt(a.l,P),Pz(a))}return Ea.h(a.l.start(d),11);case 11:a.h.abr.enabled&&(a.A.enable(),Qz(a));zz(a);a.j.variants.some(function(pa){return pa.primary});U=a.na();Q=a.j.serviceDescription;da=!!Q&&(Q.targetLatency!=null||Q.maxLatency!=null||Q.minLatency!=null||Q.maxPlaybackRate!=null||Q.minPlaybackRate!=null);if(U&&
(a.h.streaming.liveSync&&a.h.streaming.liveSync.enabled||da||a.h.streaming.liveSync.panicMode)||a.h.streaming.vodDynamicPlaybackRate)Z=function(){return Rz(a)},a.o.J(e,"timeupdate",Z);U||(ka=function(){return Sz(a)},a.o.J(e,"timeupdate",ka),Sz(a),a.j.nextUrl&&(a.h.streaming.preloadNextUrlWindow>0&&(va=function(){var pa;return H(function(Aa){if(Aa.i==1){pa=a.Za().end-a.i.currentTime;if(isNaN(pa)||!(pa<=a.h.streaming.preloadNextUrlWindow))return Aa.B(0);a.o.mb(e,"timeupdate",va);return Aa.h(a.preload(a.j.nextUrl),
4)}a.nc=Aa.j;Aa.l()})},a.o.J(e,"timeupdate",va)),a.o.J(e,"ended",function(){a.load(a.nc||a.j.nextUrl)})));if(a.D)a.D.onManifestUpdated(U);Ea.l()}})}
function gz(a,b,c){c=c===void 0?!1:c;var d,e,f;return H(function(g){switch(g.i){case 1:if(!c||!a.V){g.B(2);break}a.u=a.V;a.V=null;a.yd=null;a.u.P=!0;return g.h(a.u.ub(a.i),3);case 3:return g.return();case 2:return d=Date.now()/1E3,e=!0,a.u=a.re({Dc:a.N,onError:function(h){$y(a,h)},Yh:function(){},onExpirationUpdated:function(){var h=Vy("expirationupdated");a.dispatchEvent(h)},onEvent:function(h){a.dispatchEvent(h);if(h.type=="drmsessionupdate"&&e){e=!1;h=a.C;var k=Date.now()/1E3-d;k>=0&&(h.o=k)}}}),
a.u.configure(a.h.drm),f=Zf([b]),a.u.P=!0,g.h(bp(a.u,[f],[]),4);case 4:return g.h(a.u.ub(a.i),0)}})}
function kz(a,b,c){var d,e,f,g,h,k,l,m,n,p,t,u,v,w,x,y,z,D,A,B,E,C,G,K,L,N,J,O;return H(function(M){switch(M.i){case 1:Xy(a,"src-equals");d=a.i;a.G=new xs(d);e=!1;a.xd.push(function(){e=!0});a.dispatchEvent(Vy("canupdatestarttime"));a.U!=null&&a.G.qf(a.U);a.Ec=Tz(a,a.U||0);uz(a,d);Mz(a,d,!0);d.textTracks&&(sz(a),f=function(P){if(!(a.F instanceof Iv)){var U=Uz(a).find(function(Q){return Q.mode!=="disabled"});U&&(U.mode=P?"showing":"hidden")}},a.o.J(d,"enterpictureinpicture",function(){return f(!0)}),
a.o.J(d,"leavepictureinpicture",function(){return f(!1)}),g=R(),(h=wo(g,d))?a.o.Fb(h,["connect","connecting","disconnect"],function(){f(!1)}):"webkitCurrentPlaybackTargetIsWireless"in d&&a.o.J(d,"webkitcurrentplaybacktargetiswirelesschanged",function(){return f(!1)}),k=d,(k.webkitPresentationMode||k.webkitSupportsFullscreen)&&a.o.J(k,"webkitpresentationmodechanged",function(){k.webkitPresentationMode?f(k.webkitPresentationMode!=="inline"):k.webkitSupportsFullscreen&&f(k.webkitDisplayingFullscreen)}));
vz(a,d,b);l=iy(a.K,a.$,c);if(!(a.W&&a.h.streaming.processSrcEqualMetadata&&Xh(a.W))){M.B(2);break}n=!1;p=a.h.streaming.retryParameters;t=Cj([l],p);u=a.N.request(0,t);qj(a.Pg,u);v=function(P){P.request===t&&(P=P.headers,!P["content-length"]||P["icy-br"]||P["icy-description"]||P["icy-genre"]||P["icy-name"]||P["icy-url"])&&(n=!0,u.abort())};a.addEventListener("downloadheadersreceived",v);M.o(3,4);return M.h(u.promise,6);case 6:w=M.j,m=S(w.data),x=new Blob([w.data],{type:a.W}),l=URL.createObjectURL(x),
a.ie=l;case 4:M.F();a.removeEventListener("downloadheadersreceived",v);M.G(2);break;case 3:y=M.m();if(!n)throw y;M.B(4);break;case 2:!l.includes("#t=")&&(a.h.playRangeStart>0||isFinite(a.h.playRangeEnd))&&(l+="#t=",a.h.playRangeStart>0&&(l+=a.h.playRangeStart),isFinite(a.h.playRangeEnd)&&(l+=","+a.h.playRangeEnd));if(!a.H){M.B(7);break}return M.h(a.H.destroy(),8);case 8:a.H=null;case 7:return po(d),d.src=l,z=R(),z.Ia()=="TV"&&d.load(),d.preload!="none"&&!d.autoplay&&Ne(c)&&z.Ba()==="WEBKIT"&&d.load(),
a.m=Az,a.qa.h.length!=0&&(Ua("Skip ranges are not supported for src= playback; ignoring"),a.qa.h=[]),a.dispatchEvent(Vy("streaming")),D=function(){return new Promise(function(P){var U=new gf(P);a.o.J(d.textTracks,"change",function(){return U.ka(.5)});U.ka(.5)})},A=Promise.withResolvers(),os(d,HTMLMediaElement.HAVE_METADATA,a.o,function(){return H(function(P){if(P.i==1)return a.G.ready(),a.W&&Ne(a.W)?P.h(D(),3):(A.resolve(),P.B(0));A.resolve();P.l()})}),os(d,HTMLMediaElement.HAVE_CURRENT_DATA,a.o,
function(){var P,U,Q,da,Z;return H(function(ka){if(ka.i==1)return ka.h(D(),2);if(e)return ka.return();Vz(a);P=Uz(a);P.some(function(va){return va.mode==="showing"})&&(a.Pa=!0,a.F.setTextVisibility(!0));if(!(a.F instanceof Iv))for(U=!1,Q=r(P),da=Q.next();!da.done;da=Q.next())Z=da.value,Z.mode!=="disabled"&&(U?(Z.mode="disabled",Ua("Found more than one enabled text track, disabling it",Z)):(Wz(a,Z),U=!0));Xz(a);ka.l()})}),d.error?A.reject(Zy(a)):d.preload=="none"&&(Ua('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.'),
A.resolve()),a.o.Ma(d,"error",function(){A.reject(Zy(a))}),M.h(lf(a.h.streaming.loadTimeout,A.promise),9);case 9:if((B=a.na())&&(a.h.streaming.liveSync&&a.h.streaming.liveSync.enabled||a.h.streaming.liveSync.panicMode)||a.h.streaming.vodDynamicPlaybackRate)E=function(){return Rz(a)},a.o.J(d,"timeupdate",E);B||(C=function(){return Sz(a)},a.o.J(d,"timeupdate",C),Sz(a));a.D&&(a.D.onManifestUpdated(B),B&&(G=a.Za().end,a.o.J(d,"progress",function(){var P=a.Za().end;G!=P&&(a.D.onManifestUpdated(a.na()),
G=P)})));if(a.W&&m&&(K=Vh(m,a.W),K.length))for(L=a.i.duration,N=r(K),J=N.next();!J.done;J=N.next())O=J.value,oz(a,0,L,"org.id3",O);return M.h(Jz(a),10);case 10:a.ra=!0,M.l()}})}function Vz(a){var b=a.h.preferredAudio;if(b.length&&a.i&&a.i.audioTracks){var c=a.lc();b=r(b);for(var d=b.next();!d.done;d=b.next())if(d=d.value,d.language&&(d=Tf(c,d.language,d.role,!1)[0])){a.Ag(d);break}}}
function Xz(a){var b=a.pb();if(!b.some(function(d){return d.active})){var c=Vf(b,a.h.preferredText);if(c.length)a.Ic(c[0]);else{if(a.i&&a.i.audioTracks&&a.h.accessibility.handleForcedSubtitlesAutomatically&&(c=Array.from(a.i.audioTracks).find(function(d){return d.enabled}))&&(c=Tf(b,c.language,"",!0),c.length)){a.Ic(c[0]);return}a.Ic(null)}}}
function Bz(a,b){if(b.kind=="metadata"){b.mode="hidden";var c=function(){if(b.cues){for(var e=[],f=r(b.cues),g=f.next(),h={};!g.done;h={Lb:void 0},g=f.next())h.Lb=g.value,h.Lb.startTime!=null&&"type"in h.Lb&&(g=e.find(function(k){return function(l){return l.startTime==k.Lb.startTime&&l.endTime==k.Lb.endTime}}(h)),g||(g={type:h.Lb.type,startTime:h.Lb.startTime,endTime:h.Lb.endTime,values:[]},e.push(g)),g.values.push(h.Lb.value));e=r(e);for(f=e.next();!f.done;f=e.next())f=f.value,a.D&&(f.values.some(function(k){return k.key==
"X-ASSET-URI"||k.key=="X-ASSET-LIST"})&&(h=f.startTime==0&&!a.na(),f.values.push({key:"CUE",description:"",data:h?"ONCE,PRE":"ONCE",mimeType:null,pictureType:null})),a.D.onHLSMetadata(f))}};a.o.J(b,"cuechange",function(){if(b.activeCues)for(var e=r(b.activeCues),f=e.next();!f.done;f=e.next())if(f=f.value,oz(a,f.startTime,f.endTime,f.type,f.value),a.D)a.D.onCueMetadataChange(f.value);c()});c();var d=(new gf(function(){var e=Yz(a);e=r(e);for(var f=e.next();!f.done;f=e.next())f.value.mode="hidden"})).eb().ka(.5);
a.xd.push(function(){d.stop()})}}function fz(a,b,c){b=(new Map).set("startTime",b.startTime).set("endTime",b.endTime).set("metadataType",b.schemeIdUri).set("payload",b.payload);a.dispatchEvent(Vy(c,b))}function oz(a,b,c,d,e){a.ya&&(b={schemeIdUri:d,startTime:b,endTime:c||Infinity,id:"",payload:e},b.id=JSON.stringify(b),Ns(a.ya,b))}function Cz(a,b){if(b&&b.kind=="chapters"){b.mode="hidden";var c=(new gf(function(){b.mode="hidden"})).eb().ka(.5);a.xd.push(function(){c.stop()})}}
q.Lk=function(){for(var a=this.ua;a.h;)a.release()};q.re=function(a){return new Xo(a)};
function Oy(a,b){function c(f){b()?b().dispatchEvent(f):a.dispatchEvent(f)}function d(f){b()?ru(b(),!0,f):f()}b||(b=function(){return null});var e=new xj(function(f,g,h,k,l){d(function(){a.A&&a.A.segmentDownloaded(f,g,h,k,l)})},function(f,g,h){g=(new Map).set("headers",f).set("request",g).set("requestType",h);c(Vy("downloadheadersreceived",g));d(function(){if(a.La){var k=a.La;if(k.i.enabled){var l=f["cmsd-static"];if(l)try{var m=new Map,n=l.split(",");for(l=0;l<n.length;l++){var p=n[l].split("=");
m.set(p[0],Gy(p[1]))}}catch(x){}if(m=f["cmsd-dynamic"]){a:{try{var t=new Map,u=m.split(";");for(m=1;m<u.length;m++){var v=u[m].split("=");t.set(v[0],Gy(v[1]))}var w=t;break a}catch(x){w=null;break a}w=void 0}w&&(k.h=w)}}}})},function(f,g,h,k){f=(new Map).set("requestType",f).set("request",g).set("context",h).set("response",k);c(Vy("downloadcompleted",f))},function(f,g,h,k,l,m){f=(new Map).set("requestType",f).set("request",g).set("context",h).set("error",k).set("httpResponseCode",l).set("aborted",
m);c(Vy("downloadfailed",f))},function(f,g,h){d(function(){if(a.K){var k=a.K,l=h;l=l===void 0?{}:l;if(f==0&&l.type){a:{switch(l.type){case 4:var m="d";break a;case 3:case 2:m="h";break a}m=void 0}m&&m!==k.A&&(k.A=m,k.h&&Sx(k.h,{sf:m,st:k.i.isLive()?"l":"v"}))}if(k.h){f==Hj&&(k.u.has(g)&&k.u.delete(g),k.u.set(g,Date.now()));m=l;var n=Ay(f,m);if(n&&jy(k,n)&&sy(k,f,g,m))if(g.method==="HEAD")ry(k,g,{});else switch(f){case 0:ry(k,g,{ot:"m",su:k.o===null});break;case Hj:var p=l,t=g.uris[0];m=p.segment;
l=0;m&&(l=m.endTime-m.startTime);l={d:l*1E3,st:k.i.isLive()?"l":"v"};l.ot=wy(p);n=l.ot==="v"||l.ot==="a"||l.ot==="av"||l.ot==="tt";if(p=p.stream){var u=k.i.Fa();if(n){var v=xy(k,p.type);Number.isFinite(v)&&(l.bl=v);l.ot!=="tt"&&(v=yy(k,p.type),l.dl=u?v/Math.abs(u):v)}p.bandwidth&&(l.br=p.bandwidth/1E3);p.segmentIndex&&m&&((u=p.segmentIndex.jb(m.endTime,!0,u<0))&&(u=u.next().value)&&u!=m&&(t&&!gb(m.Oa(),u.Oa())&&(l.nor=u.Oa()[0]),!u.startByte&&!u.endByte||m.startByte==u.startByte&&m.endByte==u.endByte||
(t=u.startByte+"-",u.endByte&&(t+=u.endByte),l.nrr=t)),t=k.i.Fa()||1,u=yy(k,p.type)||500,m=(p=p.bandwidth)?p*(m.endTime-m.startTime)/1E3/(u/t/1E3)*k.j.rtpSafetyFactor:NaN,Number.isFinite(m)&&(l.rtp=m))}n&&l.ot!=="tt"&&(m=zy(k,l.ot)/1E3,Number.isFinite(m)&&(l.tb=m));k.i.isLive()&&(m=Zz(k.i))&&(l.ltc=m);l.su=k.o===null||k.o==="r";ry(k,g,l);break;case 2:case 5:case 6:ry(k,g,{ot:"k"});break;case 4:ry(k,g,{ot:"o"});break;case 8:case 13:ry(k,g,{ot:"o"})}}}})},function(f,g,h,k){(f=b()?b().o:a.I)&&f.banLocation&&
f.banLocation(k)},function(f,g){if(g.data){var h=g.data.byteLength,k=b()?b().getStats():a.C;k&&(ou(k,h),f===0&&(k.Nh=h));h=a.K;if(h.h&&f===Hj&&(f=h.u.get(g.originalRequest),h.u.delete(g.originalRequest),vy(h)))try{var l=Dx(g.originalUri||g.uri);k={url:l};g.status!=null&&(k.rc=g.status);g.originalRequest&&g.originalRequest.timeToFirstByte!=null&&(k.ttfb=g.originalRequest.timeToFirstByte);g.timeMs!=null&&(k.ttlb=g.timeMs);f!=null&&(k.ts=f);g.headers&&g.headers["CMSD-Static"]&&(k.cmsds=btoa(g.headers["CMSD-Static"]));
g.headers&&g.headers["CMSD-Dynamic"]&&(k.cmsdd=btoa(g.headers["CMSD-Dynamic"]));var m=h.h,n={request:{url:l},status:g.status||0};g=k||{};var p=n.request||{},t=n.status,u=n.resourceTiming||null,v=g.url!=null?g.url:p.url;if(v){var w={url:Dx(v),rc:t};u&&(u.startTime!=null&&(w.ts=Math.round(m.A+u.startTime),u.responseStart!=null&&(w.ttfb=Math.round(u.responseStart-u.startTime))),u.duration!=null&&(w.ttlb=Math.round(u.duration)));var x=p.customData||{};Vx(m,"rr",Object.assign({},x.cmcd!=null?x.cmcd:{},
w,g))}}catch(y){Wa("CMCD_RESPONSE_ERROR","Could not apply CMCD data to response.",y)}}});e.configure(a.h.networking);return e}function Kz(a,b){return new As(a.i,a.j,a.h.streaming,b,function(){a.Ec&&Gs(a.Ec,!a.G.Ng());a.l&&a.l.Hc();a.Z&&$z(a,"seeking")},function(c){return a.dispatchEvent(c)},function(){return a.Fa()},function(){return a.qa.h})}
function Lz(a,b){var c=a.na()||typeof b==="number"&&b>0;b=new Pu(a.td,c);b.addEventListener("enter",function(h){h=h.region;pz(a,"timelineregionenter",h);aA(a,h)});b.addEventListener("exit",function(h){pz(a,"timelineregionexit",h.region)});b.addEventListener("skip",function(h){var k=h.region;h.seeking||(pz(a,"timelineregionenter",k),pz(a,"timelineregionexit",k))});var d=new Pu(a.ya,c);d.addEventListener("enter",function(h){fz(a,h.region,"metadata")});var e=new Pu(a.Bb,c);e.addEventListener("enter",
function(h){h=(new Map).set("detail",h.region.emsg);a.dispatchEvent(Vy("emsg",h))});c=new Pu(a.zb,c);c.addEventListener("enter",function(h){a.dispatchEvent(Vy("scte35enter",(new Map).set("detail",h.region)))});c.addEventListener("exit",function(h){a.dispatchEvent(Vy("scte35exit",(new Map).set("detail",h.region)))});var f=new Ou(a.j.presentationTimeline);f.addEventListener("change",function(h){a.dispatchEvent(Vy("timelinechange",new Map([["programDateTime",h.programDateTime],["timestamp",h.timestamp]])))});
var g=new Fs(a.i);g.h.add(b);g.h.add(d);g.h.add(e);g.h.add(c);g.h.add(f);a.vd&&g.h.add(a.vd);return g}function Tz(a,b){b=new Pu(a.ya,b instanceof Date||b>0);b.addEventListener("enter",function(d){fz(a,d.region,"metadata")});var c=new Fs(a.i);c.h.add(b);return c}
function Mz(a,b,c){a.Z=new $p;cq(a.Z,bq);bA(a);bz(a);a.Ab=new gf(function(){$z(a)});a.h.streaming.rebufferingGoal&&a.Ab.Ka(.25);a.o.J(b,"waiting",function(){return $z(a,"waiting")});a.o.J(b,"canplaythrough",function(){return $z(a,"canplaythrough")});a.o.J(b,"playing",function(){return $z(a,"playing")});a.o.J(b,"seeked",function(){return $z(a,"seeked")});a.o.J(b,"timeupdate",function(){return $z(a,"timeupdate")});c&&(a.o.J(b,"progress",function(){return $z(a,"progress")}),a.o.J(b,"stalled",function(){return $z(a,
"stalled")}))}function bA(a){var b=a.h.streaming.rebufferingGoal;a.Z.l.set(aq,Math.min(.5,b/2)).set(bq,b)}
function $z(a,b){if(a.h.streaming.rebufferingGoal){b=a.H?tr(a.H):!1;b=a.Nd()||b||a.G.Dh();var c=a.Fa()<0?Pq(a.i.buffered,a.i.currentTime):Nq(a.i.buffered,a.i.currentTime),d=a.Z,e=d.l.get(d.h);cq(d,b||c>=e&&c>0?aq:bq)&&bz(a)}else if(b){c=a.Z;d=a.i.currentTime;e=c.i;c.i=d;var f=void 0;switch(b){case "seeking":case "waiting":c.i=-1;f=bq;break;case "canplaythrough":case "playing":case "seeked":f=aq;break;case "timeupdate":e>=0&&d-e>.01&&(f=aq)}f!==void 0&&cq(c,f)&&bz(a)}}
function tz(a,b,c,d,e){return new mr(a,b,c,e,d)}function hz(a,b){b=b===void 0?a.j:b;a.K&&(b=b?b.serviceDescription:null,a=a.K,a.F=b?b.clientDataReporting:null,dy(a))}
function My(a){return new at({gi:function(){var b;if((b=a.l)!=null)for(var c=r(b.i.values()),d=c.next();!d.done;d=c.next())d=d.value,d.wa||d.Wa||ut(b,d,0)},Fa:function(){return a.Fa()},hk:function(b,c){var d,e;if((d=a.l)==null)b=void 0;else a:{var f=d.h.T;d=r(d.i.values());for(var g=d.next();!g.done;g=d.next()){g=g.value;var h=g.stream.segmentIndex;if(h&&(h=h.jb(b)))for(var k=h.next().value;k&&k.startTime<c;){k=(k.startTime+k.endTime)/2;if(k>=b&&k<c&&Dr(f,g.type,k)){b=!0;break a}k=h.next().value}}b=
!1}return(e=b)!=null?e:!1}})}
function Gz(a){return new it(a.j,{Eb:function(){return a.G?a.G.Bd():0},getBandwidthEstimate:function(){return a.A.getBandwidthEstimate()},Fa:function(){return a.Fa()},video:a.i,T:a.H,Dc:a.N,onError:function(b){return $y(a,b)},onEvent:function(b){return a.dispatchEvent(b)},dd:function(b,c,d,e,f){var g=b.startTime,h=b.endTime,k=c.type;if(k!=wc){if(a.G){a.G.Vh();var l=Ar(a.H,k);!a.na()&&a.i.paused&&!a.i.seeking&&!a.H.K&&l!=null&&l>0&&a.G.Bd()<l&&!lr(a.G.Bd(),l,.001)&&a.G.qf(l)}$z(a)}d=(new Map).set("start",
g).set("end",h).set("contentType",k).set("isMuxed",d).set("isDependency",e).set("mediaTimestamp",f);a.dispatchEvent(Vy("segmentappended",d));a.A&&c.fastSwitching&&b.Bc()&&b.Od&&a.A.trySuggestStreams()},Bk:function(b,c){(c=c.ag)&&a.vd&&Js(a.vd,c,b)},Xg:function(b,c){var d=a.u;if(d.i.parseInbandPsshEnabled&&!d.H&&["audio","video"].includes(b)){b=new Pi(S(c));c=0;for(var e=r(b.data),f=e.next();!f.done;f=e.next())c+=f.value.length;if(c==0)d=Promise.resolve();else{c=new Uint8Array(c);e=0;b=r(b.data);for(f=
b.next();!f.done;f=b.next())f=f.value,c.set(f,e),e+=f.length;kp(d,"cenc",c);d=d.m.promise}}else d=Promise.resolve();return d},disableStream:function(b,c){return a.disableStream(b,c)},Zk:function(b,c){return a.h.abr.enabled&&c.fastSwitching&&b.Bc()&&b.Od?!1:!0},Be:function(){return a.keySystem()}},a.qa)}
q.configure=function(a,b){var c=this.getConfiguration();arguments.length==2&&typeof a=="string"&&(a=Wm(a,b));a.manifest&&a.manifest.dash&&"disableXlinkProcessing"in a.manifest.dash&&(jo("manifest.dash.disableXlinkProcessing configuration","It is now automatically detected if the manifest has Xlink."),delete a.manifest.dash.disableXlinkProcessing);a.manifest&&a.manifest.msf&&"useFetchCatalog"in a.manifest.msf&&(jo("manifest.msf.useFetchCatalog configuration","MSF requires the catalog to be retrieved with a SUBSCRIBE that joins the current Group, so it is always subscribed to."),
delete a.manifest.msf.useFetchCatalog);a.manifest&&a.manifest.msf&&"subscribeFilterType"in a.manifest.msf&&(jo("manifest.msf.subscribeFilterType configuration","A subscription at the live edge now always joins the current Group from its first Object."),delete a.manifest.msf.subscribeFilterType);a.textDisplayer&&"captionsUpdatePeriod"in a.textDisplayer&&(jo("textDisplayer.captionsUpdatePeriod configuration","Captions are now updated based on the cue timings, so this configuration is no longer needed."),
delete a.textDisplayer.captionsUpdatePeriod);cA(a);var d=en(this.h,a,Ny(this));dA(this,c);return d};q.gj=function(a){this.uf=a};
function dA(a,b){a.Zd=new Zq(a.h,a.Qa,a.u);if(a.I){var c=id(a.h.manifest);a.i&&a.i.nodeName==="AUDIO"&&(c.disableVideo=!0);a.I.configure(c)}a.u&&a.u.configure(a.h.drm);if(a.l){a.l.configure(a.h.streaming);try{a.m!=Wy&&ar(a.Zd,a.j)&&zz(a)}catch(e){$y(a,e)}a.A&&Dz(a);c=a.l.u;!c||c.allowedByApplication&&c.allowedByKeySystem||Sy(a)}a.N&&a.N.configure(a.h.networking);a.H&&(a.H.configure(a.h.mediaSource),a.H.Ga=a.h.manifest.segmentRelativeVttTiming);a.F&&sz(a);a.A&&(a.A.configure(a.h.abr),a.h.abr.enabled?
a.A.enable():a.A.disable(),Qz(a));a.Z&&bA(a);a.Ab&&(a.h.streaming.rebufferingGoal?a.Ab.Ka(.25):a.Ab.stop());a.j&&Ez(a.j.presentationTimeline,a.h.playRangeStart,a.h.playRangeEnd);a.D&&a.D.configure(a.h.ads);a.K&&a.K.configure(a.h.cmcd);a.La&&a.La.configure(a.h.cmsd);a.Ra&&a.Ra.configure(a.h.queue);c=a.m==Hz||a.m==Az;a.h.accessibility.speechToText.enabled?a.L?a.L.configure(a.h.accessibility.speechToText):(a.L=new Tv(a),a.L.configure(a.h.accessibility.speechToText),c&&yz(a)):a.L&&(a.L.release(),a.L=
null,c&&yz(a));if(a.m==Hz&&a.P.getConfiguration){c=a.P.getConfiguration();var d=!1;kd(b.preferredVideo)!=kd(a.h.preferredVideo)&&(c.preferredVideo=a.h.preferredVideo,d=!0);kd(b.preferredAudio)!=kd(a.h.preferredAudio)&&(c.preferredAudio=a.h.preferredAudio,d=!0);d?(fn(c),a.P.configure(c),Sy(a)):!b.abr.enabled&&a.h.abr.enabled&&(c.preferredVideo=a.h.preferredVideo,fn(c),a.P.configure(c),a.j&&a.A&&Dz(a))}b=Vy("configurationchanged");a.dispatchEvent(b)}
q.getConfiguration=function(){var a=Ny(this);en(a,this.h,Ny(this));return a};q.Bj=function(){return this.uf};q.Mj=function(){var a=Ny(this);en(a,this.h,Ny(this));return Ym(this.h,Ny(this))};q.ph=function(){if(this.i){var a=this.i.buffered.length;a=a?this.i.buffered.end(a-1):0;var b=Math.min(this.i.currentTime+this.h.streaming.bufferingGoal,this.Za().end);if(a>=b)return 1;if(!(a<=this.i.currentTime)&&a<b)return(a-this.i.currentTime)/(b-this.i.currentTime)}return 0};
q.Ok=function(){var a=this.getConfiguration(),b;for(b in this.h)delete this.h[b];en(this.h,Ny(this),Ny(this));dA(this,a)};q.Mf=function(){return this.m};q.sh=function(){return this.j?this.j.type:null};q.Xc=function(){return this.i};q.Lj=function(){return this.N};q.ze=function(){return this.$};q.Of=function(){return this.W};q.uj=function(){var a;return Array.from(((a=this.ya)==null?void 0:a.h.values())||[])};q.tj=function(){var a;return Array.from(((a=this.Bb)==null?void 0:a.h.values())||[])};
q.vj=function(){var a;return Array.from(((a=this.zb)==null?void 0:a.h.values())||[])};q.xj=function(){var a;return Array.from(((a=this.td)==null?void 0:a.h.values())||[])};q.sj=function(){return this.D?this.D:null};q.Rj=function(){return this.Ra?this.Ra:null};q.isLive=function(){return this.j&&!this.xa()?this.j.presentationTimeline.isLive():this.i&&(this.i.src||this.xa())?this.i.duration==Infinity:!1};q.ad=function(){return this.j?this.j.presentationTimeline.ad():!1};
q.na=function(){return this.isLive()||this.ad()};q.Ch=function(){if(this.j&&!this.xa()){var a=this.j.variants;return a.length?a.every(function(b){return!b.video}):!1}return this.i&&(this.i.src||this.xa())?this.i.videoTracks?this.i.videoTracks.length==0:this.i.videoHeight==0:!1};
q.Kh=function(){if(this.j&&!this.xa()){var a=this.j.variants;return a.length?a.every(function(b){return!b.audio&&!!b.video&&!b.video.codecs.includes(",")}):!1}return this.i&&(this.i.src||this.xa())&&this.i.audioTracks?this.i.audioTracks.length==0:!1};
q.Za=function(){if(this.j&&!this.xa()){if(!this.ra&&this.j.type=="HLS")return{start:0,end:0};var a=this.j.presentationTimeline;return{start:a.yb(),end:a.ob()}}if(this.i&&(this.i.src||this.xa())&&(a=this.i.seekable)&&a.length){var b=this.h?this.h.playRangeStart:0;b=Math.max(a.start(0),b);var c=this.h?this.h.playRangeEnd:Infinity;a=Math.min(a.end(a.length-1),c);return{start:b,end:a}}return{start:0,end:0}};q.bk=function(){this.na()&&(this.i.currentTime=this.Za().end)};q.ek=function(){return this.ra};
q.keySystem=function(){return Wb(this.drmInfo())};q.drmInfo=function(){return this.u?this.u.Nb():null};q.Lf=function(){return this.u?this.u.Lf():Infinity};q.Kf=function(){return this.u?this.u.Kf():[]};q.pg=function(a){this.u&&this.u.pg(a)};q.wg=function(a,b){var c=this,d;return H(function(e){return e.i==1?c.u?e.h(c.u.wg(a,b),3):e.B(2):e.i!=2?(d=e.j,e.return(d)):e.return(!1)})};q.Ae=function(){return this.u?this.u.Ae():{}};q.Eh=function(){return this.Z?this.Z.h==bq:!!this.$};
q.Fa=function(){return this.i?this.O?this.O.i:1:0};q.Kg=function(a){this.m==Hz&&this.l&&wt(this.l,a)};q.Tg=function(a,b){if(this.m==Az)return Ua("addSkipRange() is not supported for src= playback; ignoring"),!1;var c;if(c=this.j)c=this.j.sequenceMode||this.j.presentationTimeline.na()?!1:!0,c=!c;return c?!1:this.qa.add(a,b)};q.Mk=function(a,b){this.qa.remove(a,b)};q.ej=function(){this.qa.h=[]};q.Uj=function(){return this.qa.h.map(function(a){return{start:a.start,end:a.end}})};
q.Xd=function(a,b){b=b===void 0?!0:b;if(a==0)Ua("A trick play rate of 0 is unsupported!");else{var c=this.i.playbackRate,d=this.O.i;this.O.set(a);this.m==Hz&&(this.A.playbackRateChanged(a),this.Kg(b&&a!=1));eA(this,a);c===0&&this.i.playbackRate===0&&a!=d&&xz(this)}};q.Cd=function(){var a=this.O.Wc();this.m==Az&&this.O.set(a);this.m==Hz&&(this.O.set(a),this.A.playbackRateChanged(a),this.Kg(!1));this.Mc.Sa()};
q.lc=function(){if(this.j&&!this.xa()){for(var a=this.l?this.l.u:null,b=[],c=0,d=r(this.j.variants),e=d.next();!e.done;e=d.next())if(e=e.value,Rf(e)){var f=Jf(e);f.active=e==a;f.active||c==1||a==null||e.video!=a.video||e.audio!=a.audio||(f.active=!0);f.active&&c++;b.push(f)}return b}if(this.i&&this.i.audioTracks){var g=fA(this);a=Array.from(this.i.audioTracks);return a.length?a.map(function(h){return Qf(h,g)}):g?[Qf(null,g)]:[]}return[]};
q.pb=function(){if(this.j){if(this.xa())return[];for(var a=this.l?this.l.F:null,b=[],c=r(this.j.textStreams),d=c.next();!d.done;d=c.next()){d=d.value;var e=Kf(d);e.active=d==a;b.push(e)}this.L&&b.push.apply(b,F(this.L.pb()));return b}if(this.i&&this.i.src&&this.i.textTracks){a=Uz(this);var f=this.F.isTextVisible();a=a.map(function(g){return Pf(g,f)});this.L&&a.push.apply(a,F(this.L.pb()));return a}return[]};q.Gj=function(){var a=this.ee;this.j&&(a=this.j.imageStreams);return a.map(function(b){return Lf(b)})};
q.wj=function(a){var b=this,c,d;return H(function(e){if(e.i==1)return e.h(gA(b,a),2);c=e.j;if(!c)return e.return(null);d=[];c.segmentIndex.cc(function(f){var g=hA(f.tilesLayout||c.tilesLayout);if(g)for(var h=g.rows*g.columns,k=(f.i-f.startTime)/h,l=0;l<h;l++){var m=iA(f,c,f.startTime+l*k,g);if(!m)break;d.push(m)}});return e.return(d)})};function hA(a){return a?(a=/(\d+)x(\d+)/.exec(a))?{columns:parseInt(a[1],10),rows:parseInt(a[2],10)}:null:null}
q.Wj=function(a,b){var c=this,d,e,f,g;return H(function(h){if(h.i==1)return h.h(gA(c,a),2);d=h.j;if(!d)return h.return(null);e=d.segmentIndex.find(b);if(e==null)return h.return(null);f=d.segmentIndex.get(e);return(g=hA(f.tilesLayout||d.tilesLayout))?h.return(iA(f,d,b,g)):h.return(null)})};
function gA(a,b){var c,d,e;return H(function(f){if(f.i==1){if(a.m!=Hz&&a.m!=Az)return f.return(null);c=a.ee;a.j&&(c=a.j.imageStreams);d=c[0];if(!d)return f.return(null);b!=null&&(d=c.find(function(g){return g.id==b}));return d?d.segmentIndex?f.B(2):f.h(d.createSegmentIndex(),2):f.return(null)}d.closeSegmentIndex&&(a.qd.has(d)||(e=new gf(function(){d&&(d.closeSegmentIndex(),a.qd.delete(d))}),a.qd.set(d,e)),a.qd.get(d).ka(5));return f.return(d)})}
function iA(a,b,c,d){var e=a.Oa();if(!e.length)return null;var f=b.width||0,g=b.height||0,h=f/d.columns,k=g/d.rows,l=d.columns*d.rows,m=a.i-a.startTime;m=a.C||m/l;var n=a.startTime,p=0,t=0;l>1&&(t=Math.floor((c-a.startTime)/m+1E-4),n=a.startTime+t*m,p=t%d.columns*h,t=Math.floor(t/d.columns)*k);if(n>=a.endTime||lr(n,a.endTime,1E-4))return null;d=!1;if(c=a.thumbnailSprite)d=!0,k=c.height,p=c.positionX,t=c.positionY,h=c.width;return{segment:a,imageHeight:g,imageWidth:f,height:k,positionX:p,positionY:t,
startTime:n,duration:m,uris:e,startByte:a.jc(),endByte:a.ec(),width:h,sprite:d,mimeType:a.mimeType||b.mimeType,codecs:a.codecs||b.codecs}}
q.Ic=function(a){var b=this,c=!1;this.L&&a&&(c=this.L.pb().includes(a));this.L&&!c&&this.L.disable();if(!a||c)this.L&&c&&a&&this.L.enable(a),yz(this),jA(this,!1);else{c=function(){var d=b.j.textStreams.find(function(e){return e.id==a.id});d?d!=b.l.F&&(gu(b.C.l,d,!1),zt(b.l,d),yz(b),Pz(b),jA(b,!0)):b.xa()};if(this.j&&this.G&&(c(),!this.xa()))return;(function(){if(b.i&&b.i.textTracks){var d=Uz(b),e=d.find(function(h){return Nf(h)===a.id});if(e){if(b.F instanceof Iv){d=r(d);for(var f=d.next();!f.done;f=
d.next()){f=f.value;var g=f===e?b.Pa?"showing":"hidden":"disabled";f.mode!==g&&(f.mode=g)}}else d=d.find(function(h){return h.mode!=="disabled"}),d!==e&&(d&&(d.mode="disabled",b.o.mb(d,"cuechange"),b.F.remove(0,Infinity)),e&&Wz(b,e));yz(b);Pz(b);jA(b,!0)}}})()}};
function Wz(a,b){a.o.J(b,"cuechange",function(){a.F.remove(0,Math.max(0,a.i.currentTime-a.h.streaming.bufferBehind));var c={periodStart:0,segmentStart:0,segmentEnd:a.i.duration,vttOffset:0,isMpegTs:!1},d=[],e=Array.from(b.activeCues||[]);e=r(e);for(var f=e.next();!f.done;f=e.next()){f=f.value;if(f.endTime===Infinity||f.endTime<f.startTime)f=null;else{var g=new Vd(f.startTime,f.endTime,f.text);g.line=typeof f.line==="number"?f.line:null;f.lineAlign&&(g.lineAlign=f.lineAlign);g.lineInterpretation=f.snapToLines?
$d:1;g.position=typeof f.position==="number"?f.position:null;f.positionAlign&&(g.positionAlign=f.positionAlign);g.size=f.size;g.textAlign=f.align;f.vertical==="lr"?g.writingMode="vertical-lr":f.vertical==="rl"&&(g.writingMode="vertical-rl");f.region&&(g.region.id=f.region.id,g.region.height=f.region.lines,g.region.heightUnits=2,g.region.regionAnchorX=f.region.regionAnchorX,g.region.regionAnchorY=f.region.regionAnchorY,g.region.scroll=f.region.scroll,g.region.viewportAnchorX=f.region.viewportAnchorX,
g.region.viewportAnchorY=f.region.viewportAnchorY,g.region.viewportAnchorUnits=Zc,g.region.width=f.region.width,g.region.widthUnits=Zc);ge(g);f=g}f&&((g=a.h.mediaSource.modifyCueCallback)&&g(f,null,c),d.push(f))}a.F.append(d)});b.mode=document.pictureInPictureElement?"showing":"hidden"}
q.Ag=function(a,b,c){function d(){var f=e.j.variants.find(function(h){return h.id==a.id});if(f){if(Rf(f)){var g=e.l.u;e.h.abr.enabled&&(g.video!=f.video||g.audio&&f.audio&&g.audio.language==f.audio.language&&g.audio.channelsCount==f.audio.channelsCount&&g.audio.label==f.audio.label)&&Ua("Changing tracks while abr manager is enabled will likely result in the selected track being overridden. Consider disabling abr before calling selectVariantTrack().");e.xa()?Fz(e,f,!1,!1,0):Fz(e,f,!1,b||!1,c||0);f=
{preferredAudio:[{language:f.language||"",role:f.audio&&f.audio.roles&&f.audio.roles[0]||"",label:f.audio&&f.audio.label||"",channelCount:f.audio&&f.audio.channelsCount||0,codec:"",spatialAudio:f.audio&&f.audio.spatialAudio?f.audio.spatialAudio:!1}],preferredVideo:[{label:f.video&&f.video.label||"",role:f.video&&f.video.roles&&f.video.roles[0]||"",language:f.video&&f.video.language||"",codec:f.video&&f.video.codecs||"",hdrLevel:f.video&&f.video.hdr||"",layout:f.video&&f.video.videoLayout||""}],language:"",
role:"",videoRole:"",channelCount:0,hdrLevel:"",spatialAudio:!1,videoLayout:"",audioLabel:"",videoLabel:"",preferredAudioCodecs:[],preferredAudioChannelCount:0,codecSwitchingStrategy:e.h.mediaSource.codecSwitchingStrategy,audioCodec:f.audio&&f.audio.codecs?f.audio.codecs:"",activeAudioCodec:g.audio&&g.audio.codecs?g.audio.codecs:"",activeAudioChannelCount:g.audio&&g.audio.channelsCount?g.audio.channelsCount:0,keySystem:e.keySystem()};fn(f);e.P.configure(f);Dz(e)}}else e.xa()}var e=this;b=b===void 0?
!1:b;c=c===void 0?0:c;if(this.j&&this.G&&(d(),!this.xa()))return;(function(){if(a.originalAudioId&&e.i&&e.i.audioTracks){var f=Array.from(e.i.audioTracks);f=r(f);for(var g=f.next();!g.done;g=f.next())if(g=g.value,Nf(g)==a.id){kA(e,g);break}}})()};
q.Rk=function(a,b){function c(){var f=e.P.getConfiguration();f.audioCodec=a.codecs||"";f.preferredAudio=[{language:a.language,role:a.roles[0]||"",label:a.label||"",channelCount:a.channelsCount||0,codec:"",spatialAudio:a.spatialAudio}];var g=e.l.u;if(g=g&&g.audio)f.activeAudioCodec=g.codecs||"",f.activeAudioChannelCount=g.channelsCount||0,d(g.language,a.language);fn(f);e.P.configure(f);Sy(e,!0,b,!1,!1)}function d(f,g){if(f!=g&&e.h.accessibility.handleForcedSubtitlesAutomatically){var h=e.pb(),k=h.find(function(m){return m.active}),
l=k?jc(k.language):null;f=jc(f);g=jc(g);if(!k||l==f&&l!=g&&k.forced)h=Tf(h,g,"",!0),h.length&&e.Ic(h[0])}}var e=this;b=b===void 0?0:b;if(this.j&&this.G&&(c(),!this.xa()))return;(function(){if(e.i&&e.i.audioTracks){var f=jc(a.language),g=Array.from(e.i.audioTracks),h=null,k=null;a.id!=null&&(h=g.find(function(t){return Nf(t)===a.id}));g=r(g);for(var l=g.next();!l.done;l=g.next()){l=l.value;if(!h){var m=l.language||"und",n=l.kind||"",p=a.roles&&a.roles.length?a.roles[0]:"";(l.label||"")==(a.label||
"")&&jc(m)==f&&n==p&&(h=l)}l.enabled&&(k=l)}h&&(k&&d(k.language,h.language),kA(e,h))}})()};
q.getAudioTracks=function(){if(this.j&&!this.xa()){var a=this.lc();if(!a.length)return[];var b=a.find(function(g){return g.active});if(!b)return[];var c=a;if(this.m==Hz&&!this.xa()){var d=lA(this),e=d.get(b.id);c=a.filter(function(g){var h=d.get(g.id);return!!h&&!!e&&Cm(h,e)&&(g.audioCodec||Ee.includes(g.audioMimeType||""))})}if(!c.length)return[];a=new Map;c=r(c);for(b=c.next();!b.done;b=c.next()){var f=b.value;b=[f.language,f.originalLanguage,f.label||"",(f.audioRoles||[]).join(","),f.channelsCount,
f.spatialAudio,f.audioCodec?Ie(f.audioCodec):"",f.accessibilityPurpose||""].join("_");f={active:f.active,language:f.language,label:f.label,mimeType:f.audioMimeType,codecs:f.audioCodec,primary:f.primary,roles:f.audioRoles||[],accessibilityPurpose:f.accessibilityPurpose,channelsCount:f.channelsCount,audioSamplingRate:f.audioSamplingRate,spatialAudio:f.spatialAudio,originalLanguage:f.originalLanguage};a.has(b)?!a.get(b).active&&f.active&&a.set(b,f):a.set(b,f)}return Array.from(a.values())}return this.i&&
this.i.audioTracks?Array.from(this.i.audioTracks).map(function(g){var h=g.language;h={id:Nf(g),active:g.enabled,language:jc(h||"und"),label:g.label,mimeType:null,codecs:null,primary:g.kind=="main",roles:[],accessibilityPurpose:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,originalLanguage:h};g.kind&&(g.kind=="description"&&(h.accessibilityPurpose="visually impaired"),h.roles.push(g.kind));g.configuration&&(g.configuration.codec&&(h.codecs=g.configuration.codec),g.configuration.sampleRate&&
(h.audioSamplingRate=g.configuration.sampleRate),g.configuration.numberOfChannels&&(h.channelsCount=g.configuration.numberOfChannels));return h}):[]};
q.Sk=function(a,b,c){b=b===void 0?!1:b;c=c===void 0?0:c;var d=this.lc();if(d.length){var e=d.find(function(k){return k.active});if(e){d=d.filter(function(k){return(k.videoBandwidth||k.bandwidth)==a.bandwidth&&k.width==a.width&&k.height==a.height&&k.frameRate==a.frameRate&&k.pixelAspectRatio==a.pixelAspectRatio&&k.hdr==a.hdr&&k.colorGamut==a.colorGamut&&k.videoLayout==a.videoLayout&&k.videoMimeType==a.mimeType&&k.videoCodec==a.codecs&&gb(k.videoRoles,a.roles)&&(k.videoLanguage||"und")==(a.language||
"und")&&k.videoLabel==a.label});var f;d.length==1?f=d[0]:f=d.find(function(k){return k.audioId===e.audioId});if(!f&&this.j){var g=lA(this),h=g.get(e.id);f=d.find(function(k){k=g.get(k.id);return!!k&&!!h&&Bm(k,h)})}f&&!f.active&&this.Ag(f,b,c)}}};function lA(a){var b=new Map;a=r(a.j.variants);for(var c=a.next();!c.done;c=a.next())c=c.value,Rf(c)&&b.set(c.id,c);return b}
q.getVideoTracks=function(){if(this.m==Az||this.xa())return[];var a=this.lc();if(!a.length)return[];var b=a.find(function(h){return h.active});if(!b)return[];var c=a;if(!this.Kh()&&this.j){c=lA(this);var d=c.get(b.id);b=[];d&&(b=Array.from(c.values()).filter(function(h){return!!h.video&&Bm(h,d)}));var e=new Set(b.map(function(h){return h.id}));c=a.filter(function(h){return h.active||e.has(h.id)})}if(!c.length)return[];a=new Map;b=r(c);for(c=b.next();!c.done;c=b.next()){var f=c.value;(c=f.originalVideoId)||
f.videoId==null||(c=String(f.videoId));if(c){f={active:f.active,language:f.videoLanguage||"und",bandwidth:f.videoBandwidth||f.bandwidth,width:f.width,height:f.height,frameRate:f.frameRate,pixelAspectRatio:f.pixelAspectRatio,hdr:f.hdr,colorGamut:f.colorGamut,videoLayout:f.videoLayout,mimeType:f.videoMimeType,codecs:f.videoCodec,roles:f.videoRoles||[],label:f.videoLabel};var g=a.get(c);(!g||!g.active&&f.active)&&a.set(c,f)}}return Array.from(a.values())};
q.Aj=function(){var a=this.ce;this.j&&(a=this.j.chapterStreams);a=a.map(function(c){return Mf(c)});var b=mA(this);b.length&&a.push.apply(a,F(b.map(function(c){return{id:Nf(c),type:"chapter",bandwidth:0,language:jc(c.language||"und")}})));return a};
q.zj=function(a){var b=this,c,d,e,f,g,h,k,l,m,n,p,t,u;return H(function(v){switch(v.i){case 1:c=nA(b,a);if(c.length)return v.return(c);d=b.ce;b.j&&(d=b.j.chapterStreams);if(!d.length)return v.return([]);e=jc(a);f=d.filter(function(w){return jc(w.language)==e});if(!f.length)return v.return([]);g=[];h=new Set;k=r(f);l=k.next();m={};case 2:if(l.done){v.B(4);break}n=l.value;if(n.segmentIndex){v.B(5);break}return v.h(n.createSegmentIndex(),5);case 5:m.zc=0;p=void 0;b.isLive()&&((p=b.j)==null?void 0:p.type)===
"HLS"&&(t=b.j.presentationTimeline,u=void 0,m.zc=Math.max(0,(u=t.l)!=null?u:t.j));n.segmentIndex.cc(function(w){return function(x){var y=x.getMetadata();if(y){var z=y.title,D=x.startTime+"-"+x.endTime+"-"+z;w.zc>0&&x.endTime-w.zc<0&&(w.zc=0);x={id:D,title:z,startTime:Math.max(0,x.startTime-w.zc),endTime:Math.max(0,x.endTime-w.zc),images:y.images};h.has(D)||(g.push(x),h.add(D))}}}(m));m={zc:void 0};l=k.next();v.B(2);break;case 4:return v.return(g)}})};
function nA(a,b){a=mA(a);if(!a.length)return[];var c=jc(b),d=a.filter(function(h){return jc(h.language)==c});if(!d||!d.length)return[];b=[];a=new Set;d=r(d);for(var e=d.next();!e.done;e=d.next())if((e=e.value)&&e.cues){e=r(e.cues);for(var f=e.next();!f.done;f=e.next()){var g=f.value;(f=g.id)&&f!=""||(f=g.startTime+"-"+g.endTime+"-"+g.text);g={id:f,title:g.text,startTime:g.startTime,endTime:g.endTime,images:[]};a.has(f)||(b.push(g),a.add(f))}}return b}
function Uz(a){return Array.from(a.i.textTracks).filter(function(b){return b.kind!="metadata"&&b.kind!="chapters"&&b.label!="Shaka Player TextTrack"})}function Yz(a){return Array.from(a.i.textTracks).filter(function(b){return b.kind=="metadata"})}function mA(a){return a.i&&a.i.textTracks?Array.from(a.i.textTracks).filter(function(b){return b.kind=="chapters"}):[]}
function jA(a,b){b=!!b;a.Pa!=b&&(a.Pa=b,a.m==Hz?(a.F.setTextVisibility(b),b?a.l.F||(b=Vf(a.j.textStreams,a.h.preferredText),b.length>0&&(zt(a.l,b[0]),yz(a),Pz(a))):vt(a.l)):a.i&&a.i.src&&a.i.textTracks&&a.F.setTextVisibility(b))}
q.Nj=function(){if(this.G)var a=this.G.Bd();else{if(this.U==null)return new Date;if(this.U instanceof Date)return this.U;a=this.U}if(this.j&&!this.xa()){var b=this.j.presentationTimeline,c=b.xh(a);return c!=null?new Date(c*1E3):new Date((b.j+a)*1E3)}return this.i&&this.i.getStartDate?(b=this.i.getStartDate(),b instanceof Date&&!isNaN(b.getTime())?new Date(b.getTime()+a*1E3):null):null};
q.wh=function(){if(this.j&&!this.xa()){var a=this.j.presentationTimeline;a=a.l||a.j;return a===null?null:new Date(a*1E3)}return this.i&&this.i.getStartDate?(a=this.i.getStartDate(),a instanceof Date&&!isNaN(a.getTime())?a:null):null};q.Ce=function(){return this.isLive()?this.j?this.j.presentationTimeline.Ce():null:null};q.dc=function(){if(this.m==Hz)return this.H.dc();var a={total:[],audio:[],video:[],text:[]};this.m==Az&&(a.total=Oq(this.i.buffered));return a};
function Zz(a){if(!a.i||!a.i.currentTime)return null;var b=a.wh();return b?Math.floor(Date.now()-(b.getTime()+a.i.currentTime*1E3)):null}q.getBandwidthEstimate=function(){return this.A?this.A.getBandwidthEstimate():NaN};
q.getStats=function(){if(this.m!=Hz&&this.m!=Az)return{width:NaN,height:NaN,currentCodecs:"",streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,corruptedFrames:NaN,stallsDetected:NaN,gapsJumped:NaN,estimatedBandwidth:NaN,completionPercent:NaN,loadLatency:NaN,timeToFirstFrame:NaN,manifestTimeSeconds:NaN,drmTimeSeconds:NaN,playTime:NaN,pauseTime:NaN,bufferingTime:NaN,licenseTime:NaN,liveLatency:NaN,maxSegmentDuration:NaN,manifestSizeBytes:NaN,bytesDownloaded:NaN,nonFatalErrorCount:NaN,manifestPeriodCount:NaN,
manifestGapCount:NaN,switchHistory:[],stateHistory:[]};wz(this);var a=this.i,b=a.currentTime/a.duration;isNaN(b)||this.na()||ku(this.C,Math.round(100*b));this.G&&(this.C.W=this.G.Mg(),this.C.Z=this.G.Og());a.getVideoPlaybackQuality&&(b=a.getVideoPlaybackQuality(),iu(this.C,Number(b.droppedVideoFrames),Number(b.totalVideoFrames)),this.C.P=Number(b.corruptedVideoFrames));lu(this.C,this.u?up(this.u):NaN);ju(this.C,a.videoWidth||NaN,a.videoHeight||NaN);this.C.m="";this.na()&&(a=Zz(this),a!=null&&mu(this.C,
a/1E3));b=this.lc().find(function(e){return e.active});a=this.pb().find(function(e){return e.active});if(b){if(b.bandwidth){var c=this.O?this.O.i:1,d=c*b.bandwidth;a&&a.bandwidth&&(d+=c*a.bandwidth);this.C.D=d}b.width&&b.height&&ju(this.C,b.width||NaN,b.height||NaN);b=b.codecs;a&&(b+=","+(a.codecs||a.mimeType));b&&(this.C.m=b)}this.m!=Hz||this.xa()||(this.j&&(this.C.K=this.j.periodCount,this.C.I=this.j.gapCount,this.j.presentationTimeline&&nu(this.C,this.j.presentationTimeline.i)),a=this.A.getBandwidthEstimate(),
this.C.C=a);this.m==Az&&ou(this.C,NaN);return pu(this.C)};
q.Xi=function(a,b,c,d,e,f,g){var h=this;g=g===void 0?!1:g;var k=function(){var l,m,n,p,t,u,v,w,x,y,z,D;return H(function(A){switch(A.i){case 1:if(h.m!=Hz&&h.m!=Az)throw new T(1,7,7004);c!="subtitles"&&c!="captions"&&Ua("Using a kind value different of `subtitles` or `captions` can cause unwanted issues.");if(d){A.B(2);break}return A.h(oA(h,a),3);case 3:d=A.j;case 2:l=[];h.D&&(l=h.D.getCuePoints());if(h.m!=Az){A.B(4);break}m=R();g&&m.Ba()==="WEBKIT"&&(c="forced");return A.h(pA(h,a,b,c,d,f||"",l),5);
case 5:n=A.j;if(n.track)return zz(h),yz(h),A.return(Pf(n.track,h.F.isTextVisible()));throw new T(1,2,2012);case 4:p=Ac;t=h.Za();u=t.end-t.start;h.j&&(u=h.j.presentationTimeline.getDuration());if(u==Infinity)throw new T(1,4,4033);if(!l.length){A.B(6);break}return A.h(qA(h,a),7);case 7:v=A.j,w=rA(h,v,d,l),x=new Blob([w],{type:"text/vtt"}),a=pr(x),d="text/vtt";case 6:y=Yf({id:h.ge++,segmentIndex:Ek(0,u,[a]),mimeType:d||"",codecs:e||"",kind:c,language:b,originalLanguage:b,label:f||null,type:p.Xa,forced:!!g,
external:!0});z=De(y.mimeType,y.codecs);D=Xe(z);if(!D)throw new T(2,2,2014,d);h.j.textStreams.push(y);zz(h);yz(h);return A.return(Kf(y))}})}();this.ra||sA(this,k);return k};
q.Yi=function(a,b){var c=this,d=function(){var e,f,g,h,k,l,m,n,p,t,u,v,w,x,y,z,D,A;return H(function(B){switch(B.i){case 1:if(c.m!=Hz&&c.m!=Az)throw new T(1,7,7004);if(b){B.B(2);break}return B.h(oA(c,a),3);case 3:b=B.j;case 2:if(b!="text/vtt")throw new T(1,2,2017,a);e=Ac;f=c.Za();g=f.end-f.start;c.j&&(g=c.j.presentationTimeline.getDuration());if(g==Infinity)throw new T(1,4,4045);return B.h(qA(c,a),4);case 4:h=B.j;k=We(b);if(!k)throw new T(2,2,2014,b);l=k();m={periodStart:0,segmentStart:0,segmentEnd:g,
vttOffset:0,isMpegTs:!1};n=S(h);p=l.parseMedia(n,m,a,[]);t=[];u=r(p);v=u.next();for(w={};!v.done;w={nf:void 0,Uc:void 0},v=u.next())w.Uc=v.value,w.nf=null,x=function(E){return function(){E.nf==null&&(E.nf=rj([a],[E.Uc.payload]));return E.nf||[]}}(w),y=new V(w.Uc.startTime,w.Uc.endTime,x,0,null,null,0,0,Infinity),w.Uc.payload.includes("#xywh")&&(z=w.Uc.payload.split("#xywh=")[1].split(","),z.length===4&&y.Ai({height:parseInt(z[3],10),positionX:parseInt(z[0],10),positionY:parseInt(z[1],10),width:parseInt(z[2],
10)})),t.push(y);D=b;if(!t.length){B.B(5);break}return B.h(oA(c,t[0].Oa()[0]),6);case 6:D=B.j;case 5:return A=Yf({id:c.ge++,segmentIndex:new Ck(t),mimeType:D||"",kind:"",language:"und",type:e.Ui,tilesLayout:"1x1",external:!0}),c.m==Az?c.ee.push(A):c.j.imageStreams.push(A),zz(c),B.return(Lf(A))}})}();this.ra||sA(this,d);return d};
q.Wi=function(a,b,c){var d=this,e=function(){var f,g,h,k,l,m,n,p,t,u,v,w,x,y,z,D;return H(function(A){switch(A.i){case 1:if(d.m!=Hz&&d.m!=Az)throw new T(1,7,7004);if(c){A.B(2);break}return A.h(oA(d,a),3);case 3:c=A.j;case 2:f=Ac;g=d.Za();h=g.end-g.start;d.j&&(h=d.j.presentationTimeline.getDuration());if(h==Infinity)throw new T(1,4,4055);k=We(c);if(!k)throw new T(2,2,2014,c);return A.h(qA(d,a),4);case 4:l=A.j;m=k();n={periodStart:0,segmentStart:0,segmentEnd:h,vttOffset:0,isMpegTs:!1};p=S(l);t=m.parseMedia(p,
n,a,[]);u=[];v=r(t);for(w=v.next();!w.done;w=v.next())x=w.value,y=new V(x.startTime,x.endTime,function(){return[]},0,null,null,0,0,Infinity),z={title:x.payload,images:[]},y.ui(z),u.push(y);D=Yf({id:d.ge++,segmentIndex:new Ck(u),mimeType:"text/plain",kind:"",language:b,originalLanguage:b,type:f.Si,external:!0});d.m==Hz?d.j.chapterStreams.push(D):d.ce.push(D);zz(d);return A.return(Mf(D))}})}();this.ra||sA(this,e);return e};
function oA(a,b){var c;return H(function(d){switch(d.i){case 1:return d.o(2),d.h(vl(b,a.N,a.h.streaming.retryParameters),4);case 4:c=d.j;d.u(3);break;case 2:d.m();case 3:if(c)return d.return(c);throw new T(1,2,2011,b);}})}
function pA(a,b,c,d,e,f,g){var h,k,l,m;return H(function(n){if(n.i==1)return e!="text/vtt"||g.length?n.h(qA(a,b),3):n.B(2);n.i!=2&&(h=n.j,k=rA(a,h,e,g),l=new Blob([k],{type:"text/vtt"}),b=pr(l),e="text/vtt");m=document.createElement("track");var p=a.K,t=b;if(p.h&&jy(p,"segment"))try{var u=ky(p);u.ot="c";u.su=!0;var v=$x(t,u,ly(p,t))}catch(w){Wa("CMCD_TEXT_TRACK_ERROR","Could not generate text track CMCD data.",w),v=t}else v=t;m.src=v;m.label=f;m.kind=d;m.srclang=c;a.i.getAttribute("crossorigin")||
a.i.setAttribute("crossorigin","anonymous");a.i.appendChild(m);a.tf.push(m);return n.return(m)})}function qA(a,b){var c,d,e,f;return H(function(g){if(g.i==1){c=Hj;d=a.h.streaming.retryParameters;e=Cj([b],d);e.method="GET";var h=a.K;h.h&&jy(h,"segment")&&ry(h,e,{ot:"c",su:!0});return g.h(a.N.request(c,e).promise,2)}f=g.j;return g.return(f.data)})}
function rA(a,b,c,d){var e=We(c);if(e)return c=e(),a={periodStart:0,segmentStart:0,segmentEnd:a.i.duration,vttOffset:0,isMpegTs:!1},b=S(b),b=c.parseMedia(b,a,null,[]),Lw(b,d);throw new T(2,2,2014,c);}q.Uk=function(a,b){this.Qa.width=a;this.Qa.height=b};q.xg=function(a){var b;if(!(b=this.m!=Hz)){b=this.l;a=a===void 0?.1:a;if(b.m.h)b=!1;else if(b.G)b=!1;else{for(var c=r(b.i.values()),d=c.next();!d.done;d=c.next())d=d.value,!d.Yc||d.wa||d.Wa||(d.Yc=!1,ut(b,d,a));b=!0}b=!b}if(b)return!1;Ry(this,!1);return!0};
q.Nf=function(){Ua("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.");return this.j};q.Ij=function(){return this.sd};
q.Ej=function(){var a={video:null,audio:null,text:null};if(this.m!=Hz)return a;var b=this.l.u,c=this.i.currentTime;b=r([b.video,b.audio,this.l.F]);for(var d=b.next();!d.done;d=b.next())if((d=d.value)&&d.segmentIndex){var e=d.segmentIndex.find(c);e=d.segmentIndex.get(e);var f=void 0,g=void 0,h=void 0,k=void 0,l=void 0,m=void 0,n={codecs:(k=(f=e)==null?void 0:f.codecs)!=null?k:d.codecs,mimeType:(l=(g=e)==null?void 0:g.mimeType)!=null?l:d.mimeType,bandwidth:(m=(h=e)==null?void 0:h.bandwidth)!=null?m:
d.bandwidth};d.type=="video"?(n.width=d.width,n.height=d.height,a.video=n):d.type=="audio"?a.audio=n:d.type==wc&&(a.text=n)}return a};
function Ny(a){var b=$m();b.streaming.failureCallback=function(c){if(a.na()){var d=null;c.code==1001||c.code==1002?(d=1,a.h.streaming.lowLatencyMode&&(d=.1)):c.code==1003&&(d=.1);d!=null&&(c.severity=1,a.xg(d))}};b.textDisplayFactory=function(c){if(a.ud){var d=a.i;d=d.webkitDisplayingFullscreen||d.webkitPresentationMode&&d.webkitPresentationMode!="inline"?!1:!0}else d=!1;return d?new hw(c):"track"in document.createElement("track")?new Iv(c):new gw};return b}q.Yk=function(a){this.ud=a};
function Nz(a,b){var c,d,e,f,g;return H(function(h){if(h.i==1)return c=a.audio,d=a.video,e=function(k,l){var m,n,p;return H(function(t){if(t.i==1)return k?k.segmentIndex?t.B(2):t.h(k.createSegmentIndex(),2):t.return(null);n=(m=k.segmentIndex.jb(l))?m.next().value:null;if(!n)return t.return(null);p=n.startTime;return t.return(p)})},h.h(e(c,b),2);if(h.i!=3)return f=h.j,h.h(e(d,b),3);g=h.j;return g!=null&&f!=null?h.return(Math.max(g,f)):g!=null?h.return(g):f!=null?h.return(f):h.return(b)})}
function bz(a){var b=a.Eh();if(a.C&&a.Z&&a.G){if(a.h.streaming.rebufferingGoal==0){var c=a.O;c.l=!1;ns(c)}else c=a.O,c.l=b,ns(c);a.K&&qy(a.K,b?"r":"p");wz(a);c=a.h.streaming.liveSync.dynamicTargetLatency.maxAttempts;if(a.h.streaming.liveSync.dynamicTargetLatency.enabled&&b&&a.je<c){c=a.h.streaming.liveSync.dynamicTargetLatency.maxLatency;var d=a.h.streaming.liveSync.targetLatencyTolerance,e=a.h.streaming.liveSync.dynamicTargetLatency.rebufferIncrement;a.ia&&(a.ia=Math.min(a.ia+ ++a.je*e,c-d))}}b=
(new Map).set("buffering",b);a.dispatchEvent(Vy("buffering",b))}function xz(a){var b=a.i.playbackRate;b==0?(b=a.Fa(),b!==0&&b!==1&&(b=Vy("ratechange"),a.dispatchEvent(b))):(a.O&&(a.O.set(b),a.m==Hz&&a.A.playbackRateChanged(b),eA(a,b)),b=Vy("ratechange"),a.dispatchEvent(b))}
function eA(a,b){a.Mc.Sa();a.Mc.J(a.i,"timeupdate",function(){var c=a.i.currentTime,d=a.Za(),e=a.na(),f=e?a.h.streaming.safeSeekOffset:0;b>0?e&&b>1&&Math.floor(c)>=Math.floor(d.end)&&a.Cd():Math.floor(c)<=Math.floor(d.start+f)&&a.Cd()})}
function wz(a){if(a.C&&a.Z){var b=a.C.h,c="playing";a.Z.h==bq?c="buffering":a.Nd()?c="ended":a.i.paused&&(c="paused");var d=c;if(b.h==null)b.h={timestamp:Date.now()/1E3,state:d,duration:0},b=!0;else{var e=Date.now()/1E3;b.h.duration=e-b.h.timestamp;b.h.state==d?b=!1:(b.i.push(b.h),b.h={timestamp:e,state:d,duration:0},b=!0)}b&&(c=(new Map).set("newstate",c),a.dispatchEvent(Vy("statechanged",c)))}}
function Rz(a){var b=a.i.playbackRate,c=a.na();if(a.h.streaming.vodDynamicPlaybackRate&&!c){var d=a.h.streaming.vodDynamicPlaybackRateLowBufferRate,e=a.ph();e<=a.h.streaming.vodDynamicPlaybackRateBufferRatio?b!=d&&a.Xd(d,!1):e==1&&b!==a.O.Wc()&&a.Cd()}if(c&&(c=a.Za(),Number.isFinite(c.end)&&!(a.i.currentTime<c.start||a.i.paused))){d=a.h.streaming.liveSync.targetLatencyTolerance;e=a.h.streaming.liveSync.dynamicTargetLatency.enabled;var f=a.h.streaming.liveSync.dynamicTargetLatency.stabilityThreshold;
if(a.h.streaming.liveSync&&a.h.streaming.liveSync.enabled){var g=a.h.streaming.liveSync.targetLatency;var h=g+d;var k=Math.max(0,g-d);var l=a.h.streaming.liveSync.maxPlaybackRate;var m=a.h.streaming.liveSync.minPlaybackRate}else a.j&&a.j.serviceDescription&&(g=a.j.serviceDescription.targetLatency,a.j.serviceDescription.targetLatency!=null?h=a.j.serviceDescription.targetLatency+d:a.j.serviceDescription.maxLatency!=null&&(h=a.j.serviceDescription.maxLatency),a.j.serviceDescription.targetLatency!=null?
k=Math.max(0,a.j.serviceDescription.targetLatency-d):a.j.serviceDescription.minLatency!=null&&(k=a.j.serviceDescription.minLatency),l=a.j.serviceDescription.maxPlaybackRate||a.h.streaming.liveSync.maxPlaybackRate,m=a.j.serviceDescription.minPlaybackRate||a.h.streaming.liveSync.minPlaybackRate);a.ia||typeof g!=="number"||(a.ia=g);var n=a.h.streaming.liveSync.dynamicTargetLatency.maxAttempts;e&&a.Kc&&a.ia!==null&&typeof g==="number"&&a.je<n&&Date.now()-a.Kc>f*1E3&&(f=a.h.streaming.liveSync.dynamicTargetLatency.minLatency,
a.ia=Math.max(a.ia-(g-f)/2,f+d),a.Kc=Date.now());e&&a.ia!==null&&(h=a.ia+d,k=a.ia-d);g=c.end-a.i.currentTime;d=0;a.m==Az&&(e=a.i.buffered,e.length>0&&(d=e.end(e.length-1),d=Math.max(l,d-c.end)));c=a.h.streaming.liveSync.panicMode;e=a.h.streaming.liveSync.panicThreshold*1E3;f=Date.now()-a.Z.j;c&&!m&&(m=a.h.streaming.liveSync.minPlaybackRate);c&&m&&f<=e?b!=m&&a.Xd(m,!1):h!=void 0&&l&&g-d>h?(b!=l&&a.Xd(l,!1),a.Kc=null):k!=void 0&&m&&g-d<k?(b!=m&&a.Xd(m,!1),a.Kc=null):b!==a.O.Wc()&&(a.Cd(),a.Kc=Date.now())}}
function tA(a,b,c){return(lr(b,c,.01)||c>b)&&a.rf<b?(a.rf=b,!0):!1}function Sz(a){if(a.i){var b=a.Za();b=b.end-b.start;b=b>0?a.i.currentTime/b:0;if(!isNaN(b)){b*=100;if(tA(a,0,b))var c=Vy("started");else if(tA(a,25,b))c=Vy("firstquartile");else if(tA(a,50,b))c=Vy("midpoint");else if(tA(a,75,b))c=Vy("thirdquartile");else{if(tA(a,100,b)||b>100)c=Vy("complete");a.h&&a.h.playRangeEnd!=Infinity&&a.Nd()&&a.i.pause()}c&&a.dispatchEvent(c)}}}
function Dz(a){try{dr(a.Zd,a.j)}catch(f){return $y(a,f),!1}var b=a.j.isLowLatency&&a.h.streaming.lowLatencyMode,c=Sf(a.j.variants),d=a.P.create(c);d=Array.from(d.values());if(a.h.abr.allowAudioFallback){var e=R();e=!(a.h.mediaSource.codecSwitchingStrategy=="smooth"&&e.cb(a.keySystem()));d.push.apply(d,F(Dm(d,c,e)))}a=a.A.setVariants(d,b);return typeof a=="boolean"?a:!0}
function Iz(a,b){b=b===void 0?!1:b;if(Dz(a)){if(!a.h.abr.enabled){var c=a.P.getLastAdaptationSet();if(c&&(c=Array.from(c.values()),c.length)){var d=a.l.u;if(d&&d.video&&(c=c.find(function(e){return e.video==d.video})))return c}}return a.A.chooseVariant(b)}return null}function Oz(a,b){var c=null,d=Vf(a.j.textStreams,a.h.preferredText);d.length&&(c=d[0]);!c&&b.audio&&a.h.accessibility.handleForcedSubtitlesAutomatically&&(d=Tf(a.j.textStreams,b.audio.language,"",!0),d.length&&(c=d[0]));return c}
function Sy(a,b,c,d,e){b=b===void 0?!0:b;c=c===void 0?0:c;d=d===void 0?!1:d;e=e===void 0?!0:e;var f=Iz(a);f&&Fz(a,f,e,b,c,d)}
function Fz(a,b,c,d,e,f){f=f===void 0?!1:f;var g=a.l.u;if(b==g)d&&yt(a.l,b,d,e,!0);else{var h=a.C.l;h.i!=b&&(h.i=b,h.h.push({timestamp:Date.now()/1E3,id:b.id,type:"variant",fromAdaptation:c,bandwidth:b.bandwidth}));yt(a.l,b,d,e,f,c);d=null;g&&(d=Jf(g));e=Jf(b);e.active=!0;if(a.ea&&(f=a.ea,h=b.video)){h.dependencyStream&&(h=h.dependencyStream);var k=0,l=-1;switch(h.mimeType){case "video/webm":k=1;break;case "video/mp4":k=2}switch(a.sh()){case "DASH":l=1;break;case "HLS":l=0}f.h&&(f.h.setLevelSwitching(h.id,
!0),f.h.setContainerFormat(k),f.h.setStreamingFormat(l))}c?(c=(new Map).set("oldTrack",d).set("newTrack",e),c=Vy("adaptation",c),uA(a,c)):vA(a,d,e);g&&Bm(g,b)&&Cm(g,b)||wA(a)}}function kA(a,b){var c=Array.from(a.i.audioTracks),d=c.find(function(f){return f.enabled});c=r(c);for(var e=c.next();!e.done;e=c.next())e=e.value,e!==b&&(e.enabled=!1);b.enabled=!0;c=fA(a);d=d?Qf(d,c):null;b=Qf(b,c);vA(a,d,b);xA(a,d,b)}
function fA(a){return a.i&&a.i.videoTracks?Array.from(a.i.videoTracks).find(function(b){return b.selected}):null}function zz(a){var b=Vy("trackschanged");uA(a,b);wA(a)}function vA(a,b,c){b=(new Map).set("oldTrack",b).set("newTrack",c);b=Vy("variantchanged",b);uA(a,b)}function xA(a,b,c){var d=!1;b&&b.audioId==c.audioId&&b.audioGroupId==c.audioGroupId||(d=!0);d&&wA(a)}function wA(a){var b=Vy("audiotrackschanged");uA(a,b)}function yz(a){var b=Vy("textchanged");uA(a,b)}
function Qz(a){a.h.abr.enabled||Ry(a);var b=(new Map).set("newStatus",a.h.abr.enabled);uA(a,Vy("abrstatuschanged",b))}function Pz(a){var b=a.pb().find(function(c){return c.active});b&&a.F&&a.F.setTextLanguage(b.language)}function Ry(a,b){b=b===void 0?!0:b;if(a.m==Hz){a.ae.stop();for(var c=r(a.j.variants),d=c.next();!d.done;d=c.next())d=d.value,isFinite(d.disabledUntilTime)&&(d.disabledUntilTime=0);b&&Dz(a)}}
q.disableStream=function(a,b){if(!(this.h.abr.enabled&&this.m!==Wy&&navigator.onLine&&b!=0&&this.j&&this.A))return!1;if(this.j.variants.some(function(h){var k=h[a.type];return k&&k.id!==a.id&&!h.disabledUntilTime?a.type=="audio"?a.language===k.language:!0:!1})){for(var c=!1,d=!1,e=r(this.j.variants),f=e.next();!f.done;f=e.next()){f=f.value;var g=f[a.type];g&&(g.id===a.id?(f.disabledUntilTime=Date.now()/1E3+b,c=!0):g.trickModeVideo&&g.trickModeVideo.id==a.id&&(d=!0))}if(!c&&d)return!1;this.ae.Ka(1);
b=this.dc().video.reduce(function(h,k){return h+k.end-k.start},0);Sy(this,!1,b,!0,!1);return!0}return!1};
function $y(a,b){var c,d,e,f,g;return H(function(h){switch(h.i){case 1:if(a.m==Wy)return h.return();b.severity===1&&a.C.O++;if(!a.j||!a.l||b.handled||b.code!=3016&&b.code!=3014&&b.code!=3015&&b.code!=3024&&b.code!=3018){h.B(2);break}c=Sf(a.j.variants);if(!(c.length>1||a.ra)){h.B(2);break}d=R();if(d.Ba()==="WEBKIT"&&b.code==3016)return h.return();h.o(4);return h.h(Pt(a.l),6);case 6:if(e=h.j)return f=Vy("mediasourcerecovered"),a.dispatchEvent(f),h.return();h.u(2);break;case 4:h.m();case 2:g=Vy("error",
(new Map).set("detail",b)),a.dispatchEvent(g),g.defaultPrevented&&(b.handled=!0),h.l()}})}q.addFont=function(a,b){return to(a,b)};function pz(a,b,c,d){d=d===void 0?a:d;a=(new Map).set("detail",{schemeIdUri:c.schemeIdUri,value:c.value,startTime:c.startTime,endTime:c.endTime,id:c.id,timescale:c.timescale,eventNode:c.eventNode,urlParams:c.urlParams,values:c.values});d.dispatchEvent(Vy(b,a))}
function aA(a,b){if(b.schemeIdUri==="urn:mpeg:dash:event:callback:2015"&&b.eventNode){var c=vd(b.eventNode);c&&(c=c.trim())&&(c=vj(c,b.urlParams),a.N.request(13,Cj([c],fj())).promise.catch(function(){}))}}
function qz(a,b,c,d){d=d===void 0?!1:d;b=(new Map).set("mediaQuality",{bandwidth:b.bandwidth,audioSamplingRate:b.audioSamplingRate,codecs:b.codecs,contentType:b.contentType,frameRate:b.frameRate,height:b.height,mimeType:b.mimeType,channelsCount:b.channelsCount,pixelAspectRatio:b.pixelAspectRatio,width:b.width,label:b.label,roles:b.roles,language:b.language}).set("position",c);a.dispatchEvent(Vy(d?"audiotrackchanged":"mediaqualitychanged",b))}
function Zy(a,b){b=b===void 0?!0:b;if(!a.i.error)return b?new T(2,3,3016):null;a=Bb(a.i.error);var c=a.code;return b||c!==MediaError.MEDIA_ERR_ABORTED?new T(2,3,3016,c,a.nj,a.message):null}
function rz(a,b){if(a.l){var c=Vy("keystatuschanged");a.dispatchEvent(c);var d=Object.keys(b);d.length==1&&d[0]==""&&(d=["00"],b={"00":b[""]});var e=d.length==1&&d[0]=="00";c=!1;if(d.length){d=a.keySystem();for(var f=Vo(a.h.drm.clearKeys),g=function(u,v){u.allowedByKeySystem=!0;v=r(v);for(var w=v.next();!w.done;w=v.next())if(w=w.value,(w=b[e?"00":w])||a.u.H)u.allowedByKeySystem=u.allowedByKeySystem&&!!w&&!er.includes(w)},h=r(a.j.variants),k=h.next();!k.done;k=h.next()){k=k.value;var l=Wf(k);l=r(l);
for(var m=l.next();!m.done;m=l.next()){m=m.value;var n=k.allowedByKeySystem;if(m.keyIds.size)if(m.drmInfos.length&&!f.size&&a.j.type=="HLS")for(var p=r(m.drmInfos),t=p.next();!t.done;t=p.next())t=t.value,t.keySystem==d&&(t.keyIds.size?g(k,t.keyIds):g(k,m.keyIds));else g(k,m.keyIds);n!=k.allowedByKeySystem&&(c=!0)}}}c&&(zz(a),(c=a.l.u)&&!c.allowedByKeySystem?Sy(a):Dz(a))}}function Ez(a,b,c){b>0&&(a.na()||a.Ci(b));b=a.getDuration();c<b&&(a.na()||a.Vb(c))}
function uA(a,b){H(function(c){if(c.i==1)return c.h(Promise.resolve(),2);a.m!=Wy&&a.dispatchEvent(b);c.l()})}q.xa=function(){if(!this.i)return!1;var a=wo(R(),this.i);return a?a.state!="disconnected":!1};q.Nd=function(){return!this.i||this.i.ended?!0:this.ra&&!this.na()&&this.i.currentTime>=this.Za().end};
function cA(a){function b(g,h){Ua(g,"has been deprecated. Please use",h,"instead.")}var c={preferredAudioLanguage:"language",preferredAudioRole:"role",preferredAudioLabel:"label",preferredAudioChannelCount:"channelCount",preferSpatialAudio:"spatialAudio"};if(Object.keys(c).some(function(g){return g in a})){var d={language:"",role:"",label:"",channelCount:0,codec:""};c=r(Object.entries(c));for(var e=c.next();!e.done;e=c.next()){var f=r(e.value);e=f.next().value;f=f.next().value;e in a&&(b(e,"preferredAudio"),
d[f]=a[e],delete a[e])}a.preferredAudio||(a.preferredAudio=[d])}"preferredAudioCodecs"in a&&(b("preferredAudioCodecs","preferredAudio"),d=a.preferredAudioCodecs,Array.isArray(d)&&d.length&&(a.preferredAudio||(a.preferredAudio=d.map(function(g){return{language:"",role:"",label:"",channelCount:0,codec:g}}))),delete a.preferredAudioCodecs);c={preferredTextLanguage:"language",preferredTextRole:"role",preferForcedSubs:"forced"};if(Object.keys(c).some(function(g){return g in a})){d={language:"",role:"",
format:""};c=r(Object.entries(c));for(e=c.next();!e.done;e=c.next())f=r(e.value),e=f.next().value,f=f.next().value,e in a&&(b(e,"preferredText"),d[f]=a[e],delete a[e]);a.preferredText||(a.preferredText=[d])}"preferredTextFormats"in a&&(b("preferredTextFormats","preferredText"),d=a.preferredTextFormats,Array.isArray(d)&&d.length&&(a.preferredText||(a.preferredText=d.map(function(g){return{language:"",role:"",format:g}}))),delete a.preferredTextFormats);c={preferredVideoLabel:"label",preferredVideoRole:"role",
preferredVideoHdrLevel:"hdrLevel",preferredVideoLayout:"layout"};if(Object.keys(c).some(function(g){return g in a})){d={label:"",role:"",language:"",codec:"",hdrLevel:"",layout:""};c=r(Object.entries(c));for(e=c.next();!e.done;e=c.next())f=r(e.value),e=f.next().value,f=f.next().value,e in a&&(b(e,"preferredVideo"),d[f]=a[e],delete a[e]);a.preferredVideo||(a.preferredVideo=[d])}"preferredVideoCodecs"in a&&(b("preferredVideoCodecs","preferredVideo"),d=a.preferredVideoCodecs,Array.isArray(d)&&d.length&&
(a.preferredVideo||(a.preferredVideo=d.map(function(g){return{label:"",role:"",language:"",codec:g,hdrLevel:"",layout:""}}))),delete a.preferredVideoCodecs)}function sA(a,b){a.zd.add(b);b.finally(function(){return a.zd.delete(b)})}function Jz(a){return H(function(b){return a.zd.size?b.h(Promise.all([].concat(F(a.zd))),0):b.return()})}I("shaka.Player",Y);Y.prototype.isEnded=Y.prototype.Nd;Y.prototype.isRemotePlayback=Y.prototype.xa;Y.prototype.addFont=Y.prototype.addFont;
Y.prototype.setVideoContainer=Y.prototype.Yk;Y.prototype.getFetchedPlaybackInfo=Y.prototype.Ej;Y.prototype.getManifestParserFactory=Y.prototype.Ij;Y.prototype.getManifest=Y.prototype.Nf;Y.prototype.retryStreaming=Y.prototype.xg;Y.prototype.setMaxHardwareResolution=Y.prototype.Uk;Y.prototype.addChaptersTrack=Y.prototype.Wi;Y.prototype.addThumbnailsTrack=Y.prototype.Yi;Y.prototype.addTextTrackAsync=Y.prototype.Xi;Y.prototype.getStats=Y.prototype.getStats;Y.prototype.getBufferedInfo=Y.prototype.dc;
Y.prototype.getSegmentAvailabilityDuration=Y.prototype.Ce;Y.prototype.getPresentationStartTimeAsDate=Y.prototype.wh;Y.prototype.getPlayheadTimeAsDate=Y.prototype.Nj;Y.prototype.getChaptersAsync=Y.prototype.zj;Y.prototype.getChaptersTracks=Y.prototype.Aj;Y.prototype.getVideoTracks=Y.prototype.getVideoTracks;Y.prototype.selectVideoTrack=Y.prototype.Sk;Y.prototype.getAudioTracks=Y.prototype.getAudioTracks;Y.prototype.selectAudioTrack=Y.prototype.Rk;Y.prototype.selectVariantTrack=Y.prototype.Ag;
Y.prototype.selectTextTrack=Y.prototype.Ic;Y.prototype.getThumbnails=Y.prototype.Wj;Y.prototype.getAllThumbnails=Y.prototype.wj;Y.prototype.getImageTracks=Y.prototype.Gj;Y.prototype.getTextTracks=Y.prototype.pb;Y.prototype.getVariantTracks=Y.prototype.lc;Y.prototype.cancelTrickPlay=Y.prototype.Cd;Y.prototype.trickPlay=Y.prototype.Xd;Y.prototype.getSkipRanges=Y.prototype.Uj;Y.prototype.clearSkipRanges=Y.prototype.ej;Y.prototype.removeSkipRange=Y.prototype.Mk;Y.prototype.addSkipRange=Y.prototype.Tg;
Y.prototype.useTrickPlayTrackIfAvailable=Y.prototype.Kg;Y.prototype.getPlaybackRate=Y.prototype.Fa;Y.prototype.isBuffering=Y.prototype.Eh;Y.prototype.getKeyStatuses=Y.prototype.Ae;Y.prototype.retryLicensing=Y.prototype.wg;Y.prototype.renewLicense=Y.prototype.pg;Y.prototype.getActiveSessionsMetadata=Y.prototype.Kf;Y.prototype.getExpiration=Y.prototype.Lf;Y.prototype.drmInfo=Y.prototype.drmInfo;Y.prototype.keySystem=Y.prototype.keySystem;Y.prototype.isFullyLoaded=Y.prototype.ek;
Y.prototype.goToLive=Y.prototype.bk;Y.prototype.seekRange=Y.prototype.Za;Y.prototype.isVideoOnly=Y.prototype.Kh;Y.prototype.isAudioOnly=Y.prototype.Ch;Y.prototype.isDynamic=Y.prototype.na;Y.prototype.isInProgress=Y.prototype.ad;Y.prototype.isLive=Y.prototype.isLive;Y.prototype.getQueueManager=Y.prototype.Rj;Y.prototype.getAdManager=Y.prototype.sj;Y.prototype.getAllTimelineRegions=Y.prototype.xj;Y.prototype.getAllScte35Events=Y.prototype.vj;Y.prototype.getAllEmsgRegions=Y.prototype.tj;
Y.prototype.getAllMetadataRegions=Y.prototype.uj;Y.prototype.getMimeType=Y.prototype.Of;Y.prototype.getAssetUri=Y.prototype.ze;Y.prototype.getNetworkingEngine=Y.prototype.Lj;Y.prototype.getMediaElement=Y.prototype.Xc;Y.prototype.getManifestType=Y.prototype.sh;Y.prototype.getLoadMode=Y.prototype.Mf;Y.prototype.resetConfiguration=Y.prototype.Ok;Y.prototype.getBufferFullness=Y.prototype.ph;Y.prototype.getNonDefaultConfiguration=Y.prototype.Mj;Y.prototype.getConfigurationForLowLatency=Y.prototype.Bj;
Y.prototype.getConfiguration=Y.prototype.getConfiguration;Y.prototype.configurationForLowLatency=Y.prototype.gj;Y.prototype.configure=Y.prototype.configure;Y.prototype.releaseAllMutexes=Y.prototype.Lk;Y.prototype.destroyAllPreloads=Y.prototype.fh;Y.prototype.preload=Y.prototype.preload;Y.prototype.detachAndSavePreload=Y.prototype.gh;Y.prototype.unloadAndSavePreload=Y.prototype.fl;Y.prototype.load=Y.prototype.load;Y.prototype.updateStartTime=Y.prototype.kl;Y.prototype.unload=Y.prototype.Yd;
Y.prototype.detach=Y.prototype.detach;Y.prototype.attachCanvas=Y.prototype.$i;Y.prototype.attach=Y.prototype.ub;Y.probeSupport=function(a){a=a===void 0?!0:a;var b,c,d,e,f,g,h;return H(function(k){switch(k.i){case 1:b={};if(!a){k.B(2);break}return k.h(Gp(),3);case 3:b=k.j;case 2:return c=Jc(),d=sr(),e=R(),k.h(e.Db(),4);case 4:return f=k.j,g={manifest:c,media:d,drm:b,hardwareResolution:f},h=yA,h.forEach(function(l,m){g[m]=l()}),k.return(g)}})};
Y.isBrowserSupported=function(){window.Promise||Ua("A Promise implementation or polyfill is required");if(!(window.Promise&&window.Uint8Array&&Array.prototype.forEach)||(navigator.userAgent||"").includes("Trident/"))return!1;R();return Kc()?!0:Lc().canPlayType("application/x-mpegurl")!=""};Y.setQueueManagerFactory=function(a){Qy=a};Y.setAdManagerFactory=function(a){Py=a};Y.registerSupportPlugin=function(a,b){yA.set(a,b)};Y.prototype.destroy=Y.prototype.destroy;var Wy=0,Ly=1,Hz=2,Az=3;
Y.LoadMode={DESTROYED:Wy,NOT_LOADED:Ly,MEDIA_SOURCE:Hz,SRC_EQUALS:Az};Y.version="v5.3.2";var zA=["5","3"];ko=new function(a){this.h=a;this.j=lo;this.i=mo}(new io(Number(zA[0]),Number(zA[1])));var yA=new Map,Py=null,Qy=null;function AA(){}function BA(a,b){a={priority:b||0,bj:a};for(b=0;b<CA.length;b++)if(CA[b].priority<a.priority){CA.splice(b,0,a);return}CA.push(a)}I("shaka.polyfill",AA);AA.register=BA;AA.installAll=function(){for(var a=r(CA),b=a.next();!b.done;b=a.next()){b=b.value;try{b.bj()}catch(c){Ua("Error installing polyfill!",c)}}};var CA=[];function DA(a,b,c){this.h=a;this.j=b||null;this.i=c||null;this.keySystem=a.keySystem}DA.prototype.getConfiguration=function(){var a=this.h.getConfiguration();if(a.videoCapabilities)for(var b=r(a.videoCapabilities),c=b.next();!c.done;c=b.next())c.value.encryptionScheme=this.j;if(a.audioCapabilities)for(b=r(a.audioCapabilities),c=b.next();!c.done;c=b.next())c.value.encryptionScheme=this.i;return a};DA.prototype.createMediaKeys=function(){return this.h.createMediaKeys()};function EA(a){if(ac(a))return"cbcs";if(Zb(a)||$b(a)||Yb(a)||a==="com.huawei.wiseplay")return"cenc";Ua("EmeEncryptionSchemePolyfill: Unknown key system:",a,"Please contribute!");return null}function FA(a){if(!a)return!1;a=a.getConfiguration();var b=a.audioCapabilities&&a.audioCapabilities[0];return(a=a.videoCapabilities&&a.videoCapabilities[0]||b)&&a.encryptionScheme!==void 0?!0:!1}function GA(a,b){return!a||a==b||(a=="cbcs"||a=="cbcs-1-9")&&R().Jc()?!0:!1};function HA(){}var IA;function JA(){R().ef()&&!IA&&!navigator.emeEncryptionSchemePolyfilled&&navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration&&(IA=navigator.requestMediaKeySystemAccess,navigator.requestMediaKeySystemAccess=KA,navigator.emeEncryptionSchemePolyfilled=!0)}
function KA(a,b){var c=this,d,e;return H(function(f){if(f.i==1)return f.h(IA.call(c,a,b),2);d=f.j;if(e=FA(d))return navigator.requestMediaKeySystemAccess=IA,f.return(d);navigator.requestMediaKeySystemAccess=LA;return f.return(LA.call(c,a,b))})}
function LA(a,b){var c=this,d,e,f,g,h,k,l,m,n,p,t,u;return H(function(v){if(v.i==1){d=EA(a);e=[];f=r(b);for(g=f.next();!g.done;g=f.next())h=g.value,k=MA(h.videoCapabilities,d),l=MA(h.audioCapabilities,d),h.videoCapabilities&&h.videoCapabilities.length&&!k.length||h.audioCapabilities&&h.audioCapabilities.length&&!l.length||(m=Object.assign({},h),m.videoCapabilities=k,m.audioCapabilities=l,e.push(m));if(!e.length)throw n=Error("Unsupported keySystem or supportedConfigurations."),n.name="NotSupportedError",
n.code=DOMException.NOT_SUPPORTED_ERR,n;return v.h(IA.call(c,a,e),2)}p=v.j;u=t=null;e[0]&&(e[0].videoCapabilities&&(t=e[0].videoCapabilities[0].encryptionScheme),e[0].audioCapabilities&&(u=e[0].audioCapabilities[0].encryptionScheme));return v.return(new DA(p,t,u))})}function MA(a,b){return a?a.filter(function(c){return GA(c.encryptionScheme,b)}):a}AA.EmeEncryptionScheme=HA;HA.install=JA;BA(JA);function NA(){}function OA(){"getOrInsert"in Map.prototype||(Map.prototype.getOrInsert=PA);"getOrInsertComputed"in Map.prototype||(Map.prototype.getOrInsertComputed=QA);"getOrInsert"in WeakMap.prototype||(WeakMap.prototype.getOrInsert=PA);"getOrInsertComputed"in WeakMap.prototype||(WeakMap.prototype.getOrInsertComputed=QA)}function PA(a,b){this.has(a)||this.set(a,b);return this.get(a)}function QA(a,b){this.has(a)||this.set(a,b(a));return this.get(a)}AA.Map=NA;NA.install=OA;BA(OA);function RA(){}var SA;function TA(){R().ef()&&!SA&&!navigator.mediaCapabilitiesEncryptionSchemePolyfilled&&navigator.mediaCapabilities&&(SA=navigator.mediaCapabilities.decodingInfo,navigator.mediaCapabilities.decodingInfo=UA,navigator.mediaCapabilitiesEncryptionSchemePolyfilled=!0)}
function UA(a){var b=this,c,d,e;return H(function(f){switch(f.i){case 1:return f.h(SA.call(b,a),2);case 2:c=f.j;if(!c.supported||!a.keySystemConfiguration)return f.return(c);d=c.keySystemAccess;if(e=FA(d))return navigator.mediaCapabilities.decodingInfo=SA,f.return(c);navigator.mediaCapabilities.decodingInfo=VA;if(d){f.B(3);break}return f.h(WA(a),4);case 4:return c.keySystemAccess=f.j,f.return(c);case 3:return f.return(VA.call(b,a))}})}
function VA(a){var b=this,c,d,e,f,g,h,k;return H(function(l){switch(l.i){case 1:return d=c=null,!a.keySystemConfiguration||(e=a.keySystemConfiguration,f=e.keySystem,d=e.audio&&e.audio.encryptionScheme,c=e.video&&e.video.encryptionScheme,g=EA(f),h={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:a},GA(d,g)&&GA(c,g))?l.h(SA.call(b,a),2):l.return(h);case 2:k=l.j;if(k.keySystemAccess){k.keySystemAccess=new DA(k.keySystemAccess,c,d);l.B(3);break}if(!a.keySystemConfiguration){l.B(3);
break}return l.h(WA(a),5);case 5:k.keySystemAccess=l.j;case 3:return l.return(k)}})}
function WA(a){var b,c;return H(function(d){if(d.i==1){var e=a.keySystemConfiguration,f=[],g=[];e.audio&&f.push({robustness:e.audio.robustness||"",contentType:a.audio.contentType,encryptionScheme:e.audio.encryptionScheme});e.video&&g.push({robustness:e.video.robustness||"",contentType:a.video.contentType,encryptionScheme:e.video.encryptionScheme});e={initDataTypes:e.initDataType?[e.initDataType]:[],distinctiveIdentifier:e.distinctiveIdentifier,persistentState:e.persistentState,sessionTypes:e.sessionTypes};
f.length&&(e.audioCapabilities=f);g.length&&(e.videoCapabilities=g);b=e;return d.h(navigator.requestMediaKeySystemAccess(a.keySystemConfiguration.keySystem,[b]),2)}c=d.j;return d.return(c)})}AA.MCapEncryptionScheme=RA;RA.install=TA;BA(TA,-2);function XA(){}function YA(){R().Ib()||(navigator.mediaCapabilities||(navigator.mediaCapabilities={}),XA.originalMcap=navigator.mediaCapabilities,navigator.mediaCapabilities.decodingInfo=ZA)}
function ZA(a){var b,c,d,e,f,g,h,k,l,m,n;return H(function(p){switch(p.i){case 1:b={supported:!1,powerEfficient:!0,smooth:!0,keySystemAccess:null,configuration:a};R();c=a.video;d=a.audio;if(a.type!="media-source"){if(a.type=="file"){if(c&&(e=c.contentType,f=Lc().canPlayType(e)!="",!f)||d&&(g=d.contentType,h=Lc().canPlayType(g)!="",!h))return p.return(b)}else return p.return(b);p.B(2);break}if(!Kc())return p.return(b);if(!c){p.B(3);break}return p.h($A(c),4);case 4:if(k=p.j,!k)return p.return(b);case 3:if(!d){p.B(2);
break}return p.h(aB(d),6);case 6:if(l=p.j,!l)return p.return(b);case 2:if(!a.keySystemConfiguration)return b.supported=!0,p.return(b);m=a.keySystemConfiguration;return p.h(bB(c,d,m),8);case 8:if(n=p.j)b.supported=!0,b.keySystemAccess=n;case 7:return p.return(b)}})}function $A(a){var b,c,d;return H(function(e){return e.i==1?(b=R(),c=b.Ia(),c!=="CAST"?e.B(2):e.h(cB(a),3)):e.i!=2?(d=e.j,e.return(d)):e.return(nl(a.contentType))})}
function aB(a){var b,c,d,e,f;return H(function(g){switch(g.i){case 1:b=R();c=b.Ia();d=a.contentType;if(c!=="CAST"||!a.spatialRendering){g.B(2);break}d+="; spatialRendering=true";if(!(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)){g.B(2);break}e=!1;f=dB;if(f.has(d)){e=f.get(d);g.B(4);break}return g.h(cast.__platform__.canDisplayType(d),5);case 5:e=g.j,f.set(d,e);case 4:return g.return(e);case 2:return g.return(nl(d))}})}
function bB(a,b,c){var d,e,f,g,h,k,l,m,n,p,t,u;return H(function(v){switch(v.i){case 1:d=[];e=[];f=[];c.audio&&(g={robustness:c.audio.robustness||"",contentType:b.contentType},R().Qh()&&b.contentType.includes('codecs="ac-3"')&&(g.contentType='audio/mp4; codecs="ec-3"'),c.audio.encryptionScheme&&(g.encryptionScheme=c.audio.encryptionScheme,f.push(c.audio.encryptionScheme)),d.push(g));c.video&&(h={robustness:c.video.robustness||"",contentType:a.contentType},c.video.encryptionScheme&&(h.encryptionScheme=
c.video.encryptionScheme,f.push(c.video.encryptionScheme)),e.push(h));k={initDataTypes:[c.initDataType],distinctiveIdentifier:c.distinctiveIdentifier,persistentState:c.persistentState,sessionTypes:c.sessionTypes};d.length&&(k.audioCapabilities=d);e.length&&(k.videoCapabilities=e);l=a?a.contentType:"";m=b?b.contentType:"";n=Le(l)+";"+Ke(l);p=Le(m)+";"+Ke(m);t=c.keySystem;u=null;v.o(2);var w=bc(n,p,t,f);if(fc.has(w)){w=bc(n,p,t,f);u=fc.get(w)||null;v.B(4);break}return v.h(navigator.requestMediaKeySystemAccess(c.keySystem,
[k]),5);case 5:w=u=v.j;var x=bc(n,p,t,f);fc.set(x,w);case 4:v.u(3);break;case 2:v.m();case 3:return v.return(u)}})}
function cB(a){var b,c,d,e,f;return H(function(g){if(g.i==1){if(!(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType))return g.return(nl(a.contentType));b=a.contentType;a.width&&a.height&&a.width>1280&&a.height>720&&(b+="; width="+a.width+"; height="+a.height);a.framerate&&(c=Math.round(a.framerate),c<24||c>30)&&(b+="; framerate="+a.framerate);d=a.transferFunction||"";switch(d){case "":case "srgb":break;case "pq":b+="; eotf=smpte2084";break;case "hlg":b+="; eotf=arib-std-b67";break;
default:return g.return(!1)}e=!1;f=dB;return f.has(b)?(e=f.get(b),g.B(2)):g.h(cast.__platform__.canDisplayType(b),3)}g.i!=2&&(e=g.j,f.set(b,e));return g.return(e)})}AA.MediaCapabilities=XA;XA.install=YA;XA.originalMcap=null;var dB=new Map;BA(YA,-1);function eB(){this.size=0;this.h=void 0}q=eB.prototype;q.kc=function(){return this.h};q.forEach=function(a){this.h&&a(this.h,ec.value())};q.get=function(a){if(this.has(a))return this.h};q.has=function(a){var b=ec.value();return this.h&&tb(a,b)?!0:!1};q.entries=function(){};q.keys=function(){};q.values=function(){};eB.prototype[Symbol.iterator]=function(){return[][Symbol.iterator]()};function fB(){}function gB(){var a=R(),b=a.dg()?a.sa():null;(window.MediaSource||window.ManagedMediaSource)&&b&&window.MediaSource&&(b<=12?(hB(),iB()):b<=15&&hB());a=r(a.ei());for(b=a.next();!b.done;b=a.next())jB(b.value);(window.MediaSource||window.ManagedMediaSource)&&kB();window.MediaSource&&MediaSource.isTypeSupported('video/webm; codecs="vp9"')&&!MediaSource.isTypeSupported('video/webm; codecs="vp09.00.10.08"')&&lB()}
function hB(){var a=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var b=a.apply(this,Ha.apply(0,arguments));b.abort=function(){};return b}}function iB(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}}
function kB(){if(window.MediaSource){var a=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=function(c){return He(c)!="mp2t"&&a(c)}}if(window.ManagedMediaSource){var b=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);window.ManagedMediaSource.isTypeSupported=function(c){return He(c)!="mp2t"&&b(c)}}}
function jB(a){var b=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=function(d){return Ke(d)!=a&&b(d)};if(window.ManagedMediaSource){var c=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);window.ManagedMediaSource.isTypeSupported=function(d){return Ke(d)!=a&&c(d)}}}
function lB(){var a=MediaSource.isTypeSupported;R().Ji()&&(MediaSource.isTypeSupported=function(b){var c=b.split(/ *; */),d=c.findIndex(function(g){return g.startsWith("codecs=")});if(d<0)return a(b);var e=c[d].replace("codecs=","").replace(/"/g,"").split(/\s*,\s*/),f=e.findIndex(function(g){return g.startsWith("vp09")});f>=0&&(e[f]="vp9",c[d]='codecs="'+e.join(",")+'"',b=c.join("; "));return a(b)})}AA.MediaSource=fB;fB.install=gB;BA(gB);function mB(){}var nB,oB,pB,qB,rB,sB;
function tB(a){if(window.HTMLVideoElement&&window.WebKitMediaKeys&&window.shakaMediaKeysPolyfill!=uB){if(a===void 0?0:a)nB=!0,oB=Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"mediaKeys"),pB=HTMLMediaElement.prototype.setMediaKeys,qB=window.MediaKeys,rB=window.MediaKeySystemAccess,sB=navigator.requestMediaKeySystemAccess;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=vB;window.MediaKeys=wB;window.MediaKeySystemAccess=
xB;navigator.requestMediaKeySystemAccess=yB;window.shakaMediaKeysPolyfill=uB;Df.clear();fc.clear()}}function yB(a,b){try{var c=new xB(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}function vB(a){var b=this.mediaKeys;b&&b!=a&&zB(b,null);delete this.mediaKeys;return(this.mediaKeys=a)?zB(a,this):Promise.resolve()}
function AB(a){a=S(a.initData);if(zb(a).getUint32(0,!0)+4!=a.byteLength)throw new RangeError("Malformed FairPlay init data");a=Eb(a.subarray(4),!0);a=Hb(a);var b=new Event("encrypted");b.initDataType="skd";b.initData=ub(a);this.dispatchEvent(b)}AA.PatchedMediaKeysApple=mB;
mB.uninstall=function(){window.shakaMediaKeysPolyfill==uB&&nB&&(nB=!1,Object.defineProperty(HTMLMediaElement.prototype,"mediaKeys",oB),HTMLMediaElement.prototype.setMediaKeys=pB,window.MediaKeys=qB,window.MediaKeySystemAccess=rB,navigator.requestMediaKeySystemAccess=sB,oB=sB=pB=rB=qB=null,window.shakaMediaKeysPolyfill="",Df.clear(),fc.clear())};mB.install=tB;
function xB(a,b){this.keySystem=a;if(a.startsWith("com.apple.fps"))for(a=r(b),b=a.next();!b.done;b=a.next()){var c=b.value;if(c.persistentState=="required")b=null;else{b={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:c.initDataTypes,sessionTypes:["temporary"],label:c.label};var d=!1,e=!1;if(c.audioCapabilities)for(var f=r(c.audioCapabilities),g=f.next();!g.done;g=f.next())g=g.value,g.contentType&&(d=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,
g.contentType.split(";")[0])&&(b.audioCapabilities.push(g),e=!0));if(c.videoCapabilities)for(c=r(c.videoCapabilities),f=c.next();!f.done;f=c.next())f=f.value,f.contentType&&(d=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,f.contentType.split(";")[0])&&(b.videoCapabilities.push(f),e=!0));d||(e=WebKitMediaKeys.isTypeSupported(this.keySystem,"video/mp4"));b=e?b:null}if(b){this.h=b;return}}a=Error("Unsupported keySystem");a.name="NotSupportedError";a.code=DOMException.NOT_SUPPORTED_ERR;throw a;}
xB.prototype.createMediaKeys=function(){var a=new wB(this.keySystem);return Promise.resolve(a)};xB.prototype.getConfiguration=function(){return this.h};function wB(a){this.i=new WebKitMediaKeys(a);this.h=new ib}wB.prototype.createSession=function(a){a=a||"temporary";if(a!="temporary")throw new TypeError("Session type "+a+" is unsupported on this platform.");return new BB(this.i,a)};wB.prototype.setServerCertificate=function(){return Promise.resolve(!1)};
function zB(a,b){a.h.Sa();if(!b)return Promise.resolve();a.h.J(b,"webkitneedkey",AB);try{return os(b,HTMLMediaElement.HAVE_METADATA,a.h,function(){b.webkitSetMediaKeys(a.i)}),Promise.resolve()}catch(c){return Promise.reject(c)}}wB.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")};
function BB(a){oj.call(this);this.j=null;this.o=a;this.h=this.i=null;this.l=new ib;this.m=Promise.withResolvers();this.sessionId="";this.expiration=NaN;this.keyStatuses=new eB;this.onkeystatuseschange=null}ra(BB,oj);ea.Object.defineProperties(BB.prototype,{closed:{configurable:!0,enumerable:!0,get:function(){return this.m.promise}}});q=BB.prototype;
q.generateRequest=function(a,b){var c=this;this.i=Promise.withResolvers();try{var d=this.o.createSession("video/mp4",S(b));this.j=d;this.sessionId=d.sessionId||"";this.l.J(this.j,"webkitkeymessage",function(e){c.i&&(c.i.resolve(),c.i=null);e=(new Map).set("messageType",c.keyStatuses.kc()==void 0?"license-request":"license-renewal").set("message",ub(e.message));e=new nj("message",e);c.dispatchEvent(e)});this.l.J(d,"webkitkeyadded",function(){c.h&&(CB(c,"usable"),c.h.resolve(),c.h=null)});this.l.J(d,
"webkitkeyerror",function(){var e=Error("EME PatchedMediaKeysApple key error");e.errorCode=c.j.error;if(c.i!=null)c.i.reject(e),c.i=null;else if(c.h!=null)c.h.reject(e),c.h=null;else switch(c.j.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:CB(c,"output-not-allowed");break;default:CB(c,"internal-error")}});CB(this,"status-pending")}catch(e){this.i.reject(e)}return this.i.promise};q.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))};
q.update=function(a){this.h=Promise.withResolvers();try{this.j.update(S(a))}catch(b){this.h.reject(b)}return this.h.promise};q.close=function(){try{this.j.close(),this.m.resolve(),this.l.Sa()}catch(a){this.m.reject(a)}return this.closed};q.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))};
function CB(a,b){var c=a.keyStatuses;c.size=b==void 0?0:1;c.h=b;b=new nj("keystatuseschange");a.dispatchEvent(b);if(a.onkeystatuseschange)a.onkeystatuseschange(b)}var uB="apple";BA(function(){window.HTMLVideoElement&&window.WebKitMediaKeys&&(navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||tB())});function DB(){}function EB(){if(window.MediaKeys){var a=R();MediaKeys.prototype.setServerCertificate&&a.Wd()||(MediaKeys.prototype.setServerCertificate=FB)}}function FB(){return Promise.resolve(!1)}AA.PatchedMediaKeysCert=DB;DB.install=EB;BA(EB);function GB(){}
function HB(){if(!(!window.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)IB="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;navigator.requestMediaKeySystemAccess=JB;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=KB;window.MediaKeys=LB;window.MediaKeySystemAccess=MB;window.shakaMediaKeysPolyfill=NB}}
function OB(a){var b=IB;return b?b+a.charAt(0).toUpperCase()+a.slice(1):a}function JB(a,b){try{var c=new MB(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}function KB(a){var b=this.mediaKeys;b&&b!=a&&PB(b,null);delete this.mediaKeys;(this.mediaKeys=a)&&PB(a,this);return Promise.resolve()}AA.PatchedMediaKeysWebkit=GB;GB.install=HB;
function MB(a,b){this.h=this.keySystem=a;var c=!1;a=="org.w3.clearkey"&&(this.h="webkit-org.w3.clearkey",c=!1);var d=!1;var e=document.getElementsByTagName("video");e=e.length?e[0]:document.createElement("video");b=r(b);for(var f=b.next();!f.done;f=b.next()){f=f.value;var g={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:f.initDataTypes,sessionTypes:["temporary"],label:f.label},h=!1;if(f.audioCapabilities)for(var k=r(f.audioCapabilities),
l=k.next();!l.done;l=k.next())l=l.value,l.contentType&&(h=!0,e.canPlayType(l.contentType.split(";")[0],this.h)&&(g.audioCapabilities.push(l),d=!0));if(f.videoCapabilities)for(k=r(f.videoCapabilities),l=k.next();!l.done;l=k.next())l=l.value,l.contentType&&(h=!0,e.canPlayType(l.contentType,this.h)&&(g.videoCapabilities.push(l),d=!0));h||(d=e.canPlayType("video/mp4",this.h)||e.canPlayType("video/webm",this.h));f.persistentState=="required"&&(c?(g.persistentState="required",g.sessionTypes=["persistent-license"]):
d=!1);if(d){this.i=g;return}}c="Unsupported keySystem";if(a=="org.w3.clearkey"||a=="com.widevine.alpha")c="None of the requested configurations were supported.";a=Error(c);a.name="NotSupportedError";a.code=DOMException.NOT_SUPPORTED_ERR;throw a;}MB.prototype.createMediaKeys=function(){var a=new LB(this.h);return Promise.resolve(a)};MB.prototype.getConfiguration=function(){return this.i};function LB(a){this.m=a;this.i=null;this.h=new ib;this.j=[];this.l=new Map}
function PB(a,b){a.i=b;a.h.Sa();var c=IB;b&&(a.h.J(b,c+"needkey",function(d){var e=new CustomEvent("encrypted");e.initDataType="cenc";e.initData=ub(d.initData);a.i.dispatchEvent(e)}),a.h.J(b,c+"keymessage",function(d){var e=QB(a,d.sessionId);e&&(d=(new Map).set("messageType",e.keyStatuses.kc()==void 0?"licenserequest":"licenserenewal").set("message",d.message),d=new nj("message",d),e.i&&(e.i.resolve(),e.i=null),e.dispatchEvent(d))}),a.h.J(b,c+"keyadded",function(d){(d=QB(a,d.sessionId))&&d.ready()}),
a.h.J(b,c+"keyerror",function(d){var e=QB(a,d.sessionId);if(e){var f=Error("EME v0.1b key error"),g=d.errorCode;g.systemCode=d.systemCode;f.errorCode=g;!d.sessionId&&e.i?(d.systemCode==45&&(f.message="Unsupported session type."),e.i.reject(f),e.i=null):d.sessionId&&e.h?(e.h.reject(f),e.h=null):(f=d.systemCode,d.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?RB(e,"output-restricted"):f==1?RB(e,"expired"):RB(e,"internal-error"))}}))}
LB.prototype.createSession=function(a){a=a||"temporary";if(a!="temporary"&&a!="persistent-license")throw new TypeError("Session type "+a+" is unsupported on this platform.");var b=this.i||document.createElement("video");b.src||(b.src="about:blank");a=new SB(b,this.m,a);this.j.push(a);return a};LB.prototype.setServerCertificate=function(){return Promise.resolve(!1)};LB.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")};
function QB(a,b){var c=a.l.get(b);return c?c:(c=a.j.shift())?(c.sessionId=b,a.l.set(b,c),c):null}function SB(a,b,c){oj.call(this);this.m=a;this.u=!1;this.h=this.i=null;this.l=b;this.o=c;this.j=Promise.withResolvers();this.sessionId="";this.expiration=NaN;this.keyStatuses=new eB;this.onkeystatuseschange=null}ra(SB,oj);ea.Object.defineProperties(SB.prototype,{closed:{configurable:!0,enumerable:!0,get:function(){return this.j.promise}}});q=SB.prototype;
q.ready=function(){RB(this,"usable");this.h&&this.h.resolve();this.h=null};
function TB(a,b,c){if(a.u)return Promise.reject(Error("The session is already initialized."));a.u=!0;try{if(a.o=="persistent-license")if(c)var d=S(Hb("LOAD_SESSION|"+c));else{var e=Hb("PERSISTENT|");d=Qb(e,b)}else d=S(b)}catch(g){return Promise.reject(g)}a.i=Promise.withResolvers();var f=OB("generateKeyRequest");try{a.m[f](a.l,d)}catch(g){if(g.name!="InvalidStateError")return a.i=null,Promise.reject(g);(new gf(function(){try{a.m[f](a.l,d)}catch(h){a.i.reject(h),a.i=null}})).ka(.01)}return a.i.promise}
function UB(a,b,c){if(a.h)a.h.promise.then(function(){return UB(a,b,c)}).catch(function(){return UB(a,b,c)});else{a.h=b;if(a.l=="webkit-org.w3.clearkey"){var d=Db(c);var e=JSON.parse(d);e.keys[0].kty!="oct"&&(a.h.reject(Error("Response is not a valid JSON Web Key Set.")),a.h=null);d=Nb(e.keys[0].k);e=Nb(e.keys[0].kid)}else d=S(c),e=null;var f=OB("addKey");try{a.m[f](a.l,d,e,a.sessionId)}catch(g){a.h.reject(g),a.h=null}}}
function RB(a,b){var c=a.keyStatuses;c.size=b==void 0?0:1;c.h=b;b=new nj("keystatuseschange");a.dispatchEvent(b);if(a.onkeystatuseschange)a.onkeystatuseschange(b)}q.generateRequest=function(a,b){return TB(this,b,null)};q.load=function(a){return this.o=="persistent-license"?TB(this,null,a):Promise.reject(Error("Not a persistent session."))};q.update=function(a){var b=Promise.withResolvers();UB(this,b,a);return b.promise};
q.close=function(){if(this.o!="persistent-license"){if(!this.sessionId)return this.j.reject(Error("The session is not callable.")),this.j.promise;var a=OB("cancelKeyRequest");try{this.m[a](this.l,this.sessionId)}catch(b){}}this.j.resolve();return this.j.promise};q.remove=function(){return this.o!="persistent-license"?Promise.reject(Error("Not a persistent session.")):this.close()};var IB="",NB="webkit";BA(HB);function VB(){}function WB(){window.crypto&&("randomUUID"in window.crypto||(window.crypto.randomUUID=XB))}function XB(){var a=URL.createObjectURL(new Blob),b=a.toString();URL.revokeObjectURL(a);return b.substr(b.lastIndexOf("/")+1)}AA.RandomUUID=VB;VB.install=WB;BA(WB);function YB(){}function ZB(){var a=Symbol.prototype;"description"in a||Object.defineProperty(a,"description",{get:$B})}function $B(){var a=/\((.*)\)/.exec(this.toString());return a?a[1]:void 0}AA.Symbol=YB;YB.install=ZB;BA(ZB);function aC(){}function bC(){for(var a=r([Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,Int8Array,Int16Array,Int32Array,Float32Array,Float64Array]),b=a.next();!b.done;b=a.next()){b=b.value;var c=void 0;(c=b.prototype).indexOf!=null||(c.indexOf=Array.prototype.indexOf);c=void 0;(c=b.prototype).lastIndexOf!=null||(c.lastIndexOf=Array.prototype.lastIndexOf);c=void 0;(c=b.prototype).includes!=null||(c.includes=Array.prototype.includes)}}AA.TypedArray=aC;aC.install=bC;BA(bC);function cC(){}function dC(){window.URLSearchParams||(window.URLSearchParams=eC);!window.URL||!window.URL.prototype||"searchParams"in window.URL.prototype||Object.defineProperty(window.URL.prototype,"searchParams",{get:fC,enumerable:!0,configurable:!0})}
function fC(){var a=this,b=gC.get(a);if(!b){b=new window.URLSearchParams(a.search);var c=function(){var g=b.toString();a.search=g?"?"+g:""},d=b.append;b.append=function(g,h){d.call(this,g,h);c()};var e=b.delete;b.delete=function(g){e.call(this,g);c()};var f=b.set;b.set=function(g,h){f.call(this,g,h);c()};gC.set(a,b)}return b}AA.URLSearchParams=cC;cC.install=dC;var gC=new WeakMap;
function eC(a){this.h=[];if(typeof a==="string"){if(a.startsWith("?")&&(a=a.substring(1)),a){a=r(a.split("&"));for(var b=a.next();!b.done;b=a.next()){var c=b.value.split("=");b=decodeURIComponent(c[0].replace(/\+/g," "));c=c.length>1?decodeURIComponent(c[1].replace(/\+/g," ")):"";this.append(b,c)}}}else if(Array.isArray(a))for(a=r(a),b=a.next();!b.done;b=a.next())b=b.value,this.append(b[0],b[1]);else if(a)for(b in a)this.append(b,a[b])}q=eC.prototype;
q.append=function(a,b){this.h.push([String(a),String(b)])};q.get=function(a){a=String(a);for(var b=r(this.h),c=b.next();!c.done;c=b.next())if(c=c.value,c[0]===a)return c[1];return null};q.has=function(a){var b=String(a);return this.h.some(function(c){return c[0]===b})};q.set=function(a,b){a=String(a);b=String(b);for(var c=!1,d=0;d<this.h.length;d++)this.h[d][0]===a&&(c?(this.h.splice(d,1),d--):(this.h[d][1]=b,c=!0));c||this.append(a,b)};
q.toString=function(){return this.h.map(function(a){return encodeURIComponent(a[0]).replace(/%20/g,"+")+"="+encodeURIComponent(a[1]).replace(/%20/g,"+")}).join("&")};q.entries=function(){var a=0,b=this.h.map(function(d){return[d[0],d[1]]}),c={next:function(){return a<b.length?{value:b[a++],done:!1}:{value:void 0,done:!0}}};c[Symbol.iterator]=function(){return c};return c};
q.keys=function(){var a=0,b=this.h,c={next:function(){return a<b.length?{value:b[a++][0],done:!1}:{value:void 0,done:!0}}};c[Symbol.iterator]=function(){return c};return c};q.values=function(){var a=0,b=this.h,c={next:function(){return a<b.length?{value:b[a++][1],done:!1}:{value:void 0,done:!0}}};c[Symbol.iterator]=function(){return c};return c};q.forEach=function(a){for(var b=r(this.h),c=b.next();!c.done;c=b.next())c=c.value,a(c[1],c[0],this)};eC.prototype[Symbol.iterator]=function(){return this.entries()};
BA(dC);function hC(){}function iC(){if(window.HTMLMediaElement){var a=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var b=a.apply(this);b&&b.catch(function(){});return b}}}AA.VideoPlayPromise=hC;hC.install=iC;BA(iC);function jC(){}function kC(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.requestVideoFrameCallback&&window.requestAnimationFrame&&a.getVideoPlaybackQuality&&(a.requestVideoFrameCallback=lC,a.cancelVideoFrameCallback=mC)}}function nC(a){var b=oC.get(a);b||(b={yk:1,Rc:new Map,presentedFrames:0},oC.set(a,b));return b}
function lC(a){function b(g){if(d.Rc.has(e)){var h=c.getVideoPlaybackQuality().totalVideoFrames||0;h!==d.presentedFrames?(d.presentedFrames=h,h={presentationTime:g,expectedDisplayTime:g,mediaTime:c.currentTime,presentedFrames:h,width:c.videoWidth,height:c.videoHeight,processingDuration:0},d.Rc.delete(e),a(g,h)):(g=window.requestAnimationFrame(b),d.Rc.set(e,g))}}var c=this,d=nC(c),e=d.yk++,f=window.requestAnimationFrame(b);d.Rc.set(e,f);return e}
function mC(a){var b=oC.get(this);if(b){var c=b.Rc.get(a);c!=null&&(window.cancelAnimationFrame(c),b.Rc.delete(a))}}AA.VideoFrameCallback=jC;jC.install=kC;var oC=new WeakMap;BA(kC,-2);function pC(){}function qC(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.getVideoPlaybackQuality&&("webkitDroppedFrameCount"in a||typeof Lc().webkitDroppedFrameCount==="number")&&(a.getVideoPlaybackQuality=rC)}}function rC(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}AA.VideoPlaybackQuality=pC;pC.install=qC;BA(qC);function sC(){}function tC(){if(!window.VTTCue&&window.TextTrackCue){var a=null,b=TextTrackCue.length;if(b==3)a=uC;else if(b==6)a=vC;else{try{var c=!!uC(1,2,"")}catch(d){c=!1}c&&(a=uC)}a&&(window.VTTCue=function(d,e,f){return a(d,e,f)})}}function uC(a,b,c){return new window.TextTrackCue(a,b,c)}function vC(a,b,c){return new window.TextTrackCue(a+"-"+b+"-"+c,a,b,c)}AA.VTTCue=sC;sC.install=tC;BA(tC);function wC(){this.h="UNKNOWN"}wC.prototype.parseInit=function(){};wC.prototype.setManifestType=function(a){this.h=a};
wC.prototype.parseMedia=function(a,b,c,d){function e(A,B,E){for(var C=[],G=r(u),K=G.next();!K.done;K=G.next())(K=xC(K.value.clone(),B,E))&&C.push(K);A.nestedCues=C.concat(A.nestedCues);B=r(C);for(E=B.next();!E.done;E=B.next())E=E.value,A.startTime=Math.min(A.startTime,E.startTime),A.endTime=Math.max(A.endTime,E.endTime)}a=Db(a);var f=[];if(a=="")return f;var g=nd(a,!0).find(function(A){return zd(A,yC,"tt")});if(!g)throw new T(2,2,2005,"Failed to parse TTML.");f=yd(g,yC,"body")[0];if(!f)return[];a=
g.attributes["xml:space"]||"default";var h=Fd(g,zC,"extent");if(a!="default"&&a!="preserve")throw new T(2,2,2005,"Invalid xml:space value: "+a);var k=a=="default",l=new AC(Fd(g,BC,"frameRate"),Fd(g,BC,"subFrameRate"),Fd(g,BC,"frameRateMultiplier"),Fd(g,BC,"tickRate"));a=CC(Fd(g,BC,"cellResolution"));var m=yd(g,yC,"metadata")[0];m=(m?m.children:[]).filter(function(A){return A!="\n"});var n=yd(g,yC,"style"),p=yd(g,yC,"region");g=new Map;for(var t=[],u=[],v=r(p),w=v.next();!w.done;w=v.next()){w=w.value;
var x=DC(this,w,n,h,a);if(x){t.push(x);var y=EC(this,w,l,0,!1,g);FC(this,w,n,"showBackground")=="whenActive"||GC.test(x.backgroundColor)||(y=new Vd(Math.max(y.start+b.periodStart,b.segmentStart),Math.min(y.end+b.periodStart,b.segmentEnd),""),y.region=x,y.isContainer=!0,y.displayAlign=FC(this,w,n,"displayAlign")||y.displayAlign,u.push(y))}}if(Cd(f,yC,"p").length)throw new T(2,2,2001,"<p> can only be inside <div> in TTML");h=r(Cd(f,yC,"div"));for(v=h.next();!v.done;v=h.next())if(Cd(v.value,yC,"span").length)throw new T(2,
2,2001,"<span> can only be inside <p> in TTML");EC(this,f,l,0,!1,g);h=t.length>0&&Array.from(g.keys()).some(function(A){return!!A.attributes.region});c=HC(this,f,b,l,m,n,p,t,k,a,null,!1,c,d,g,{start:0,end:Infinity},h);d=r(c);for(k=d.next();!k.done;k=d.next())k=k.value,k.backgroundColor=k.backgroundColor||"transparent";var z=IC(f),D=c.slice().sort(function(A,B){return A.startTime-B.startTime});D.forEach(function(A,B){e(A,z||B>0?A.startTime:-Infinity,z||B<D.length-1?A.endTime:Infinity)});!c.length&&
u.length&&(f=g.get(f)||{start:0,end:Infinity},d=new Vd(Infinity,0,""),d.isContainer=!0,d.backgroundColor="transparent",a&&(d.cellResolution=a),e(d,z?f.start+b.periodStart:-Infinity,z?f.end+b.periodStart:Infinity),d.startTime<d.endTime&&c.push(d));return c};function IC(a){return!!(a.attributes.begin||a.attributes.end||a.attributes.dur)}
function HC(a,b,c,d,e,f,g,h,k,l,m,n,p,t,u,v,w){function x(N,J){return JC(a,N,J,m,z,A,C,f,G,K.length==0)}var y=sd(b)?m&&KC(m)?null:v:(y=u.get(b))?{start:Math.max(y.start,v.start),end:Math.min(y.end,v.end)}:v;var z=(v=sd(b)?m:b)?LC(v,"region",g,"")[0]:null;v=z?u.get(z):null;y&&v&&(y={start:Math.max(y.start,v.start),end:Math.min(y.end,v.end)});if(!y||y.start>=y.end)return[];var D=!w||!!z;if(sd(b)){if(!n||!D)return[];v={tagName:"span",children:[vd(b)],attributes:{},parent:null}}else v=b;for(var A=null,
B=r(MC),E=B.next();!E.done&&!(A=LC(v,"backgroundImage",e,"#",E.value)[0]);E=B.next());var C=null;B=Fd(v,MC,"backgroundImage");E=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/;if(B&&E.test(B)){B=parseInt(B.split(":").pop(),10)-1;if(B>=t.length)return[];C=t[B]}else p&&B&&!B.startsWith("#")&&(B=(new URL(B,p)).toString())&&(C=B);b=NC(b);if(b=="p"||A||C)n=!0;var G=n;k=(v.attributes["xml:space"]||(k?"default":"preserve"))=="default";E=v.children.filter(function(N){return sd(N)||["div","p","span",
"br"].includes(NC(N))});B=E.every(sd);var K=[];if(!B){E=r(E);for(var L=E.next();!L.done;L=E.next())K=K.concat(HC(a,L.value,c,d,e,f,g,h,k,l,v,n,p,t,u,y,w))}e=m!=null;d=vd(v);p=v.children.length&&d&&/\S/.test(d);if(B&&p&&!D)return[];g=IC(v);if(!(g||p||b=="br"||K.length!=0||e&&!k))return[];e=y.start+c.periodStart;y=y.end+c.periodStart;a.h!=="HLS"&&(e=Math.max(e,c.segmentStart),y=Math.min(y,c.segmentEnd));if(!g&&K.length>0)for(e=Infinity,y=0,g=r(K),p=g.next();!p.done;p=g.next())p=p.value,e=Math.min(e,
p.startTime),y=Math.max(y,p.endTime);if(b=="br")return c=new Vd(e,y,""),c.lineBreak=!0,[c];g="";!B||b=="p"&&KC(v)||(g=Jb(d||""),k&&(g=g.replace(/\s+/g," ")));y=new Vd(e,y,g);y.nestedCues=K;n||(y.isContainer=!0);l&&(y.cellResolution=l);v.attributes.region&&z&&(y.region=h.find(function(N){return N.id==z.attributes["xml:id"]}));x(y,v);return OC(a,y,v,f,u,c,x)}
function OC(a,b,c,d,e,f,g){function h(v,w){for(var x=Object.assign({},c,{attributes:Object.assign({},c.attributes)}),y=m.filter(function(G){return e.get(G).start+f.periodStart<=v&&v<e.get(G).end+f.periodStart}),z=r(y),D=z.next();!D.done;D=z.next()){D=r(k(D.value));for(var A=D.next();!A.done;A=D.next()){A=A.value;for(var B=r(Object.entries(A.attributes)),E=B.next();!E.done;E=B.next()){var C=r(E.value);E=C.next().value;C=C.next().value;(E=l(A,E))&&(x.attributes[E]=C)}}}if(PC(a,x,d,"display")=="none")return null;
w=xC(b.clone(),v,w);y.length&&(w.textDecoration=[],g(w,x));return w}function k(v,w){w=w===void 0?new Set:w;var x=[];w.add(v);for(var y=r((v.attributes.style||"").split(/\s+/)),z=y.next(),D={};!z.done;D={Th:void 0},z=y.next())D.Th=z.value,(z=d.find(function(A){return function(B){return B.attributes["xml:id"]==A.Th}}(D)))&&!w.has(z)&&x.push.apply(x,F(k(z,w)));x.push(v);return x}function l(v,w){var x=w.indexOf(":");if(x<1)return null;for(var y="xmlns:"+w.substring(0,x),z=null;v&&z==null;v=v.parent)z=
v.attributes[y];y=zC.concat(["urn:ebu:tt:style"]);return z!=null&&y.includes(z)?od(z)+":"+w.substring(x+1):null}var m=Cd(c,yC,"set");if(!m.length)return PC(a,c,d,"display")!="none"?[b]:[];for(var n=[b.startTime,b.endTime],p=r(m),t=p.next();!t.done;t=p.next())t=t.value,n.push(e.get(t).start+f.periodStart,e.get(t).end+f.periodStart);n=Array.from(new Set(n)).filter(function(v){return v>=b.startTime&&v<=b.endTime}).sort(function(v,w){return v-w});p=[];for(t=1;t<n.length;t++){var u=h(n[t-1],n[t]);u&&p.push(u)}return p}
function xC(a,b,c){a.startTime=Math.max(a.startTime,b);a.endTime=Math.min(a.endTime,c);if(a.startTime>=a.endTime)return null;a.nestedCues=a.nestedCues.filter(function(d){return xC(d,b,c)});return a}
function DC(a,b,c,d,e){function f(x,y,z){if(!y||y.trim()=="auto")return null;var D=y.trim().split(/\s+/),A=D.length==2?g(D[0],!1,z):null;z=D.length==2?g(D[1],!0,z):null;return A&&z?{x:A,y:z}:(Wa("ttml-region-"+x+"-"+y,"TtmlTextParser ignored the tts:"+x+" of region "+n+", which is invalid or not supported: "+y),null)}function g(x,y,z){var D=QC(x);if(!D||!z&&Number(D[1])<0)return null;z=D[2]=="px";if(D[2]=="%")return{value:Number(D[1]),units:Zc,Ie:z};x=h(x,y);return x!=null?{value:x,units:Zc,Ie:z}:
z?{value:Number(D[1]),units:0,Ie:z}:null}function h(x,y){var z=QC(x),D=z?Number(z[1]):0;z=z?z[2]:"%";if(z=="%")return null;if(z=="px")return(x=y?t:p)?D*100/x:null;if(z=="rw"||z=="rh")return z=="rh"==y?D:null;if(z=="c")return D*100/(y?v:u);if(z=="em"){z=(l("fontSize")||"1c").trim().split(/\s+/);if(z.length>2)return null;if(z.length==2)return x=k(z[y?1:0],y),x==null?null:D*x;var A=k(z[0],!0);if(A==null)return null;if(y)return D*A;if(p&&t)return D*A*t/p;Wa("ttml-horizontal-em","TtmlTextParser approximated a horizontal length in em, as the TTML document has no tts:extent in pixels: "+
x);x=k(z[0],!1);return x==null?null:D*x}return null}function k(x,y){var z=100/(y?v:u);x=QC(x);if(!x)return z;var D=Number(x[1]);return x[2]=="%"?D*z/100:x[2]=="em"?D*z:h(x[0],y)}function l(x){return FC(a,b,c,x)}var m=new Yc,n=b.attributes["xml:id"];if(!n)return null;m.id=n;var p=(d=RC.exec(d||""))?Number(d[1]):null,t=d?Number(d[2]):null,u=e?e.columns:32,v=e?e.rows:15;e=l("extent");if(d=f("extent",e,!1))m.width=d.x.value,m.height=d.y.value,m.widthUnits=d.x.units,m.heightUnits=d.y.units;d=l("origin");
var w=f("origin",d,!0);w&&w.x.units!=w.y.units&&(Wa("ttml-region-origin-units-"+d,"TtmlTextParser ignored the tts:origin of region "+n+", which mixes pixels and other units without a tts:extent in pixels on the TTML document: "+d),w=null);w&&(m.viewportAnchorX=w.x.value,m.viewportAnchorY=w.y.value,m.viewportAnchorUnits=w.x.units,e||w.x.Ie||w.y.Ie||(m.width=100-m.viewportAnchorX,m.widthUnits=Zc,m.height=100-m.viewportAnchorY,m.heightUnits=Zc));(e=l("position"))&&!d&&(e=SC(e,m,h))&&(m.viewportAnchorX=
e[0],m.viewportAnchorY=e[1],m.viewportAnchorUnits=Zc);if(e=l("backgroundColor"))m.backgroundColor=TC(e);e=parseFloat(l("opacity")||"");isNaN(e)||(m.opacity=e);if(e=l("padding"))m.padding=UC(e,m,l("writingMode"),h);l("overflow")=="hidden"&&(m.overflow="hidden");(e=l("zIndex"))&&/^-?\d+$/.test(e)&&(m.zIndex=Number(e));return m}
function SC(a,b,c){a=a.trim().split(/\s+/);if(b.widthUnits!=Zc||b.heightUnits!=Zc||a.length>4)return null;for(var d=[["left","50%"],["top","50%"]],e=a.some(function(n){return/^(top|bottom)$/.test(n)}),f=a.some(function(n){return/^(left|right)$/.test(n)}),g=[!1,!1],h=0;h<a.length;h++){var k=a[h];if(/^[a-z]/.test(k)){var l=a.length>2&&/^[-.\d]/.test(a[h+1]||"")?a[++h]:"0%",m=void 0;m=/^(top|bottom)$/.test(k)?1:/^(left|right)$/.test(k)?0:e!=f?e?0:1:g[0]?1:0;d[m]=[k,l];g[m]=!0}else{if(a.length>2)return null;
d[h][1]=k;g[h]=!0}}a=d.map(function(n,p){var t=p?b.height:b.width,u=QC(n[1]);p=u&&u[2]=="%"?Number(u[1])*(100-t)/100:c(n[1],!!p);if(n[0]=="center")return p==null?NaN:Number(((100-t)/2+p).toFixed(4));n=n[0]=="right"||n[0]=="bottom";return p==null?NaN:Number((n?100-t-p:p).toFixed(4))});return a.some(isNaN)?null:a}
function UC(a,b,c,d){var e=a.trim().split(/\s+/);if(e.length>4)return"";a=e[0];var f=e[1]||a,g=e[2]||a;e=e[3]||f;var h=[a,f,g,e];if(c=="rltb"||c=="rl")h=[a,e,g,f];else if(c=="tblr")h=[e,g,f,a];else if(c=="tbrl"||c=="tb")h=[e,a,f,g];return h.map(function(k,l){var m=!(l%2),n=(QC(k)||[])[2];l=d(k,m);if(n=="%"||n=="px"&&!l)return k;k=(m?b.heightUnits:b.widthUnits)==Zc;m=m?b.height:b.width;return l!=null&&k&&m?Number((l*100/m).toFixed(4))+"%":"0px"}).join(" ")}
function TC(a){var b=a.match(/rgba\(([^)]+)\)/);return b&&(b=b[1].split(",").map(function(c){return c.trim()}),b.length==4)?(b[3]=String(Number(b[3])/255),"rgba("+b.join(",")+")"):a}
function JC(a,b,c,d,e,f,g,h,k,l){function m(u){var v;if(!(v=n(u)))a:{for(v=d;v&&!zd(v,yC,"tt");v=v.parent){var w=PC(a,v,h,u);if(w){v=w;break a}}v=null}return v}function n(u){return VC(a,c,e,h,u,p)}var p=k||l;n("direction")=="rtl"&&(b.direction="rtl");k=n("writingMode");k=="tblr"?b.writingMode="vertical-lr":k=="tb"||k=="tbrl"?b.writingMode="vertical-rl":k=="rltb"||k=="rl"?b.direction="rtl":k&&(b.direction=Yd);if(k=VC(a,c,e,h,"textAlign")){var t=WC[k]||[];b.positionAlign=t[0];b.lineAlign=t[1];b.textAlign=
se[k.toUpperCase()]}else b.textAlign=Xd;if(k=VC(a,c,e,h,"displayAlign"))b.displayAlign=te[k.toUpperCase()];if(k=n("color"))b.color=TC(k);if(k=PC(a,c,h,"backgroundColor"))b.backgroundColor=TC(k);if(k=n("border"))b.border=k;if(k=n("fontFamily"))b.fontFamily=XC[k]||k.split(",").filter(function(u){return u!="default"}).join(",");m("fontWeight")=="bold"&&(b.fontWeight=pe);b.wrapLine=m("wrapOption")!="noWrap";(k=NC(c)=="p"?n("lineHeight"):null)&&(k=="normal"||k.match(YC)||k.match(ZC))&&(b.lineHeight=k);
(k=n("fontSize"))&&(k.match(YC)||k.match(ZC))&&(b.fontSize=$C(a,c,d,e,h)||k);if(k=m("fontStyle"))b.fontStyle=ve[k.toUpperCase()];f?(g=f.attributes.imageType||f.attributes.imagetype,k=f.attributes.encoding,f=vd(f).trim(),g=="PNG"&&k=="Base64"&&f&&(b.backgroundImage="data:image/png;base64,"+f)):g&&(b.backgroundImage=g);f=n("textOutline");f=="none"?b.textStrokeWidth="0":f&&(f=f.trim().split(/\s+(?![^(]*\))/),aD(f[0])?(g=m("color"),b.textStrokeColor=g?TC(g):b.color):(b.textStrokeColor=TC(f[0]),f.shift()),
(f=f[0]?aD(f[0]):null)?b.textStrokeWidth=f:b.textStrokeColor="");if(f=n("textShadow"))b.textShadow=bD(f);(f=n("letterSpacing"))&&f.match(YC)&&(b.letterSpacing=f);(f=n("linePadding"))&&f.match(YC)&&(b.linePadding=f);if(f=PC(a,c,h,"opacity"))b.opacity=parseFloat(f);if(l)for(l=[FC(a,e,h,"textDecoration")].concat(cD(c,d).map(function(u){return PC(a,u,h,"textDecoration")})),l=r(l),f=l.next();!f.done;f=l.next())(f=f.value)&&dD(b,f);l=n("visibility");if(l=="hidden"||l=="visible")b.visibility=l;if(l=n("textCombine"))b.textCombineUpright=
l;if(l={container:"ruby",text:"rt"}[n("ruby")])b.rubyTag=l}function bD(a){return a=="none"?a:a.split(/,(?![^(]*\))/).map(function(b){return b.trim().split(/\s+(?![^(]*\))/).map(function(c){return aD(c)||TC(c)}).join(" ")}).join(", ")}function QC(a){return/^(-?\d*\.?\d+)(px|em|c|%|rw|rh)$/.exec(a)}function aD(a){var b=QC(a);return b?b[2]=="%"?Number(b[1])/100+"em":a:null}function cD(a,b){for(a=[a];b&&NC(b)!="tt";b=b.parent)a.unshift(b);return a}
function dD(a,b){b=r(b.split(" "));for(var c=b.next();!c.done;c=b.next()){var d=c.value;d=="none"?a.textDecoration=[]:(c=!d.startsWith("no"),d=eD[(c?d:d.slice(2)).toLowerCase()],c?d&&!a.textDecoration.includes(d)&&a.textDecoration.push(d):cb(a.textDecoration,d))}}function VC(a,b,c,d,e,f){f=f===void 0?!0:f;return Fd(b,zC,e)||fD(a,b,d,e)||(f?FC(a,c,d,e):null)}function FC(a,b,c,d){return b?Fd(b,zC,d)||fD(a,b,c,d,Cd(b,yC,"style"))||fD(a,b,c,d):null}
function PC(a,b,c,d){return Fd(b,zC,d)||(b.attributes.style?fD(a,b,c,d):null)}function $C(a,b,c,d,e){b=[FC(a,d,e,"fontSize")].concat(cD(b,c).map(function(h){return PC(a,h,e,"fontSize")})).filter(function(h){return h});c=0;d="";for(var f=r(b),g=f.next();!g.done;g=f.next()){g=QC(g.value);if(!g||!["px","c","%"].includes(g[2]))return null;g[2]=="%"&&d?c=c*Number(g[1])/100:(c=Number(g[1]),d=g[2])}return b.length>1?Number(c.toFixed(4))+d:null}
function fD(a,b,c,d,e){e=e||LC(b,"style",c,"");b=null;e=r(e);for(var f=e.next();!f.done;f=e.next()){var g=f.value;if(!(f=Ed(g,"urn:ebu:tt:style",d)||Fd(g,zC,d))){f=a;var h=c,k=d;f=Fd(g,zC,k)||fD(f,g,h,k)}b=f||b}return b}function LC(a,b,c,d,e){return(a=a&&c.length?gD(a,b,e):null)?a.split(" ").map(function(f){return c.find(function(g){return d+g.attributes["xml:id"]==f})}).filter(function(f){return f}):[]}
function gD(a,b,c){for(;a;a=a.parent){var d=c?Ed(a,c,b):a.attributes[b];if(d)return d}return null}
function EC(a,b,c,d,e,f){var g=hD(b.attributes.begin,c),h=hD(b.attributes.end,c),k=hD(b.attributes.dur,c);g=d+(g||0);var l=KC(b),m=iD(b);e=m||e?g:Infinity;for(var n=r(Cd(b,yC,"set")),p=n.next();!p.done;p=n.next())EC(a,p.value,c,g,!1,f);m=r(m||[]);for(n=m.next();!n.done;n=m.next())n=n.value,p=l?e:g,n=sd(n)?l?p:Infinity:EC(a,n,c,p,l,f).end,e=l?n:Math.max(e,n);a=e;h!=null&&k!=null?a=Math.min(g+k,d+h):k!=null?a=g+k:h!=null&&(a=d+h);d={start:g,end:a};f.set(b,d);return d}
function iD(a){var b=NC(a),c=b=="p"||b=="span";a=c||b=="body"||b=="div"?a.children.filter(function(d){return sd(d)?c:["div","p","span","br"].includes(NC(d))}):[];return!a.length||b=="span"&&a.every(sd)?null:a}function NC(a){if(sd(a))return"";var b=a.tagName.split(":").pop();return zd(a,yC,b)?b:""}function KC(a){return a.attributes.timeContainer=="seq"}
function hD(a,b){if(!a)return null;var c=jD.exec(a);if(c)return Number(c[3])+(Number(c[4])+(Number(c[5])||0)/b.h)/b.frameRate+Number(c[2])*60+Number(c[1])*3600;if(c=kD.exec(a))return Number(c[1])/(c[2]=="f"?b.frameRate:b.i);c=lD.exec(a)||mD.exec(a);if(!c)throw new T(2,2,2001,"Could not parse cue time range in TTML");return(Number(c[4])||0)/1E3+(Number(c[3])||0)+(Number(c[2])||0)*60+(Number(c[1])||0)*3600}
function CC(a){return(a=/^(\d+) (\d+)$/.exec(a||""))?{columns:Number(a[1]),rows:Number(a[2])}:null}I("shaka.text.TtmlTextParser",wC);wC.prototype.parseMedia=wC.prototype.parseMedia;wC.prototype.setManifestType=wC.prototype.setManifestType;wC.prototype.parseInit=wC.prototype.parseInit;function AC(a,b,c,d){this.frameRate=Number(a)||30;this.h=Number(b)||1;this.i=Number(d)||(a?this.frameRate*this.h:1);if(a=/^(\d+) (\d+)$/.exec(c||""))this.frameRate*=Number(a[1])/Number(a[2])}
var GC=/^(transparent|#\w{6}00|rgba\(.*,\s*0\))?$/i,ZC=/^(\d{1,4}(?:\.\d+)?|100)%$/,YC=/^(\d+px|\d+em|\d*\.?\d+c)$/,RC=/^(\d+)px (\d+)px$/,jD=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,lD=/^(?:(\d{2,}):)?(\d{2}):(\d{2}(?:\.\d+)?)$/,kD=/^(\d*(?:\.\d*)?)([ft])$/,mD=RegExp("^(?:(\\d*(?:\\.\\d*)?)h)?(?:(\\d*(?:\\.\\d*)?)m(?!s))?(?:(\\d*(?:\\.\\d*)?)s)?(?:(\\d*(?:\\.\\d*)?)ms)?$"),XC={monospaceSerif:"Courier New,Liberation Mono,Courier,monospace",proportionalSansSerif:"Arial,Helvetica,Liberation Sans,sans-serif",
sansSerif:"sans-serif",monospaceSansSerif:"Consolas,monospace",proportionalSerif:"serif"},eD={underline:re,linethrough:"line-through",overline:"overline"},WC={left:["line-left",ae],center:["center","center"],right:["line-right","end"],start:["line-left",ae],end:["line-right","end"]},yC=["http://www.w3.org/ns/ttml","http://www.w3.org/2006/10/ttaf1",""],BC=["http://www.w3.org/ns/ttml#parameter","http://www.w3.org/2006/10/ttaf1#parameter"],zC=["http://www.w3.org/ns/ttml#styling","http://www.w3.org/2006/10/ttaf1#styling"],
MC=["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt","http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];Ue("application/ttml+xml",function(){return new wC});function nD(){this.h=new wC;this.i=null}nD.prototype.parseInit=function(a){var b=this,c=!1;(new ih).ma(wh,nh).S("mdhd",function(d){d=Fh(d.reader,d.version);b.i=d.timescale}).S("stsd",sh).box("stpp",function(d){c=!0;d.parser.stop()}).parse(a);if(!c)throw new T(2,2,2007);};nD.prototype.setManifestType=function(a){this.h.setManifestType(a)};
nD.prototype.parseMedia=function(a,b,c){var d=[],e=null,f=null,g=[],h=new Map,k=[],l=[],m=[],n=0;(new ih).ma(xh,nh).S("tfhd",function(B){B=Dh(B.reader,B.flags);e=B.$b;f=B.Zb}).S("tfdt",function(B){n=Eh(B.reader,B.version).wb}).S("trun",function(B){B=Gh(B.reader,B.version,B.flags);B=r(B.Fc);for(var E=B.next();!E.done;E=B.next())E=E.value,k.push(E.sampleSize||e||0),E=E.Gc||f,l.push(E),m.push(n),n+=E||0}).S("subs",function(B){for(var E=B.reader,C=E.R(),G=-1,K=0;K<C;K++){var L=E.R();G+=L;L=E.kb();for(var N=
[],J=0;J<L;J++)B.version==1?N.push(E.R()):N.push(E.kb()),E.Ja(),E.Ja(),E.R();h.set(G,N)}}).box("mdat",vh(function(B){g.push(B)},!1)).parse(a,!1);if(g.length==0)throw new T(2,2,2007);a=Qb.apply(Kb,F(g));for(var p=oD(this,m,l,b),t=0,u=0;u<k.length;u++){var v=S(a,t,k[u]);t+=k[u];var w=h.get(u),x=[];if(w&&w.length){for(var y=S(v,0,w[0]),z=w[0],D=1;D<w.length;D++){var A=S(v,z,w[D]);A=Lb(A);x.push("data:image/png;base64,"+A);z+=w[D]}v=y}d=d.concat(this.h.parseMedia(v,p?p[u]:b,c,x))}return d};
function oD(a,b,c,d){a=a.i;if(!a||c.length<2)return null;var e=[];c=r(c);for(var f=c.next();!f.done;f=c.next()){f=f.value;if(!f)return null;e.push(f)}c=b[0];f=[];for(var g=0;g<e.length;g++){var h=d.segmentStart+(b[g]-c)/a;f.push({periodStart:d.periodStart,segmentStart:Math.min(Math.max(h,d.segmentStart),d.segmentEnd),segmentEnd:Math.min(Math.max(h+e[g]/a,d.segmentStart),d.segmentEnd),vttOffset:d.vttOffset,isMpegTs:d.isMpegTs})}f[f.length-1].segmentEnd=d.segmentEnd;return f}
I("shaka.text.Mp4TtmlParser",nD);nD.prototype.parseMedia=nD.prototype.parseMedia;nD.prototype.setManifestType=nD.prototype.setManifestType;nD.prototype.parseInit=nD.prototype.parseInit;Ue('application/mp4; codecs="stpp"',function(){return new nD});Ue('application/mp4; codecs="stpp.ttml"',function(){return new nD});Ue('application/mp4; codecs="stpp.ttml.im1i"',function(){return new nD});Ue('application/mp4; codecs="stpp.ttml.im1t"',function(){return new nD});
Ue('application/mp4; codecs="stpp.ttml.im2i"',function(){return new nD});Ue('application/mp4; codecs="stpp.ttml.im2t"',function(){return new nD});Ue('application/mp4; codecs="stpp.ttml.etd1"',function(){return new nD});Ue('application/mp4; codecs="stpp.ttml.etd1|im1t"',function(){return new nD});Ue('application/mp4; codecs="stpp.ttml.im1t|etd1"',function(){return new nD});Ue('application/mp4; codecs="stpp.TTML.im1t"',function(){return new nD});function pD(){this.h="UNKNOWN"}pD.prototype.parseInit=function(){};pD.prototype.setManifestType=function(a){this.h=a};
pD.prototype.parseMedia=function(a,b){a=Db(a);a=a.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var c=a.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(c[0]))throw new T(2,2,2E3);a=b.vttOffset;if(this.h=="HLS"&&c[0].includes("X-TIMESTAMP-MAP")){var d=c[0];a=c.slice(1);var e=d.match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m);d=d.match(/MPEGTS:(\d+)/m);if(!e||!d)throw new T(2,2,2E3);e=gd(e[1]);if(e==null)throw new T(2,2,2E3);d=Number(d[1]);var f=b.segmentStart-b.periodStart;a=(a=a.join("\n").match(/^[ \t]*((?:\d+:)?\d{2}:\d{2}\.\d{3})[ \t]+--\x3e/m))?
gd(a[1]):null;a!=null&&(f-=a-e);d+=Math.max(0,Math.round((f-d/9E4)/95443.7176888889))*8589934592;a=b.periodStart+d/9E4-e}b=qD(c[0]);e=new Map;he(e);d=[];f=!1;c=r(c.slice(1));for(var g=c.next();!g.done;g=c.next())if(g=g.value.split("\n"),rD(g))f||b.push(sD(g.slice(1).join("\n"),":"));else{if((g.length!=1||g[0])&&!tD.test(g[0])&&g[0]=="STYLE"){for(var h=[],k=-1,l=1;l<g.length;l++)g[l].includes("::cue")&&(h.push([]),k=h.length-1),k!=-1&&(h[k].push(g[l]),g[l].includes("}")&&(k=-1));h=r(h);for(k=h.next();!k.done;k=
h.next()){var m=k.value;k="global";(l=m[0].match(/\((.*)\)/))&&(k=l.pop());l=m.slice(1,-1);m[0].includes("}")&&(m=/\{(.*?)\}/.exec(m[0]))&&(l=m[1].split(";"));(m=e.get(k))||(m=new Vd(0,0,""));for(var n=!1,p=0;p<l.length;p++){var t=/^\s*([^:]+):\s*(.*)/.exec(l[p]);if(t){var u=t[2].trim().replace(";","");switch(t[1].trim()){case "background-color":case "background":n=!0;m.backgroundColor=u;break;case "color":n=!0;m.color=u;break;case "font-family":n=!0;m.fontFamily=u;break;case "font-size":n=!0;m.fontSize=
/^\d*\.?\d+%$/.test(u)?parseFloat(u)/100+"em":u;break;case "font-weight":if(parseInt(u,10)>=700||u=="bold")n=!0,m.fontWeight=pe;break;case "font-style":switch(u){case "normal":n=!0;m.fontStyle=de;break;case "italic":n=!0;m.fontStyle=qe;break;case "oblique":n=!0,m.fontStyle="oblique"}break;case "opacity":n=!0;m.opacity=parseFloat(u);break;case "text-combine-upright":n=!0;m.textCombineUpright=u;break;case "text-shadow":n=!0;m.textShadow=u;break;case "white-space":n=!0,m.wrapLine=u!="noWrap"}}}n&&e.set(k,
m)}}m=g;p=a;if(m.length==1&&!m[0]||tD.test(m[0])||m[0]=="STYLE"||rD(m))g=null;else if(g=null,n=0,m[0].includes("--\x3e")||(g=m[0],n=1),h=new ad(m[n]),k=ed(h),t=dd(h,/[ \t]+--\x3e[ \t]+/g),l=ed(h),k==null||t==null||l==null)Ua("Failed to parse VTT time code. Cue skipped:",g,m),g=null;else{k+=p;l+=p;k<0&&(k=0);p="";for(t=n+1;t<m.length;t++)t>n+1&&(p+="\n"),p+=m[t];p=p.trim();e.has("global")?(m=e.get("global").clone(),m.startTime=k,m.endTime=l,m.payload=p):m=new Vd(k,l,p);dd(h,/[ \t]+/gm);uD(m,h,b);ge(m,
e);g!=null&&(m.id=g);g=m}g&&(f=!0,d.push(g))}return d};function vD(a){var b=a.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").split(/\n{2,}/m);a=qD(b[0]);b=r(b);for(var c=b.next();!c.done;c=b.next()){c=c.value.split("\n");if(c.some(function(d){return d.includes("--\x3e")}))break;rD(c)&&a.push(sD(c.slice(1).join("\n"),":"))}return a}function qD(a){var b=[];a=r(a.split("\n"));for(var c=a.next();!c.done;c=a.next())c=c.value,/^Region:/.test(c)&&b.push(sD(c.substring(7),"="));return b}
function rD(a){return/^REGION[ \t]*$/.test(a[0])&&!(a.length>1&&a[1].includes("--\x3e"))}
function sD(a,b){var c=new Yc;c.height=3;c.heightUnits=2;c.regionAnchorX=0;c.regionAnchorY=100;c.viewportAnchorX=0;c.viewportAnchorY=100;a=r(a.split(/[ \t\n]+/));for(var d=a.next();!d.done;d=a.next())if(d=d.value){var e=d.indexOf(b);if(!(e<=0||e==d.length-1)){var f=d.substring(e+1);switch(d.substring(0,e)){case "id":c.id=f;break;case "width":d=wD(f);if(d==null)break;c.width=d;break;case "lines":if(!/^\d+$/.test(f))break;c.height=Number(f);c.heightUnits=2;break;case "regionanchor":d=xD(f);if(!d)break;
c.regionAnchorX=d[0];c.regionAnchorY=d[1];break;case "viewportanchor":d=xD(f);if(!d)break;c.viewportAnchorX=d[0];c.viewportAnchorY=d[1];break;case "scroll":f=="up"&&(c.scroll="up")}}}return c}
function uD(a,b,c){bd(b,function(d){var e;if(e=yD.exec(d))d=e[1],d=="middle"?a.textAlign=Xd:a.textAlign=se[d.toUpperCase()];else if(e=zD.exec(d))a.writingMode=e[1]=="lr"?"vertical-lr":"vertical-rl";else if(e=AD.exec(d))a.size=Number(e[1]);else if(e=BD.exec(d))a.position=Number(e[1]),e[2]&&(d=e[2],a.positionAlign=d=="line-left"||d=="start"?"line-left":d=="line-right"||d=="end"?"line-right":d=="center"||d=="middle"?"center":Wd);else if(e=CD.exec(d)){b:{for(d=c.length-1;d>=0;d--)if(c[d].id==e[1]){d=
c[d];break b}d=null}d&&(a.region=d)}else b:{if(e=DD.exec(d))a.lineInterpretation=1;else if(e=ED.exec(d))a.lineInterpretation=$d;else break b;a.line=Number(e[1]);e[2]&&(a.lineAlign=ue[e[2].toUpperCase()])}});a.region.id&&(a.line!=null||a.size&&a.size!=100||a.writingMode!=Zd)&&(a.region=new Yc)}function xD(a){var b=a.indexOf(",");if(b<0)return null;var c=wD(a.substring(0,b));a=wD(a.substring(b+1));return c==null||a==null?null:[c,a]}
function wD(a){if(!/^\d+(?:\.\d+)?%$/.test(a))return null;a=parseFloat(a);return a>100?null:a}I("shaka.text.VttTextParser",pD);pD.prototype.parseMedia=pD.prototype.parseMedia;pD.prototype.setManifestType=pD.prototype.setManifestType;pD.prototype.parseInit=pD.prototype.parseInit;
var tD=/^NOTE($|[ \t])/,yD=/^align:(start|middle|center|end|left|right)$/,zD=/^vertical:(lr|rl)$/,AD=/^size:([\d.]+)%$/,BD=/^position:([\d.]+)%(?:,(line-left|line-right|middle|center|start|end|auto))?$/,CD=/^region:(.+)$/,DD=/^line:([\d.]+)%(?:,(start|end|center))?$/,ED=/^line:(-?\d+)(?:,(start|end|center))?$/;Ue("text/vtt",function(){return new pD});Ue('text/vtt; codecs="vtt"',function(){return new pD});Ue('text/vtt; codecs="wvtt"',function(){return new pD});function FD(){this.h=null;this.i=[]}FD.prototype.parseInit=function(a){var b=this,c=!1;(new ih).ma(wh,nh).S("mdhd",function(d){d=Fh(d.reader,d.version);b.h=d.timescale}).S("stsd",sh).box("wvtt",function(d){c=!0;d.reader.skip(8);nh(d)}).box("vttC",vh(function(d){b.i=vD(Db(d))},!1)).parse(a);if(!this.h)throw new T(2,2,2008);if(!c)throw new T(2,2,2008);};FD.prototype.setManifestType=function(){};
FD.prototype.parseMedia=function(a,b){var c=this;if(!a.length)return[];if(!this.h)throw new T(2,2,2008);var d=0,e=[],f=[],g=!1,h=!1,k=!1,l=null;(new ih).ma(xh,nh).S("tfdt",function(m){g=!0;d=Eh(m.reader,m.version).wb}).S("tfhd",function(m){l=Dh(m.reader,m.flags).Zb}).S("trun",function(m){h=!0;e=Gh(m.reader,m.version,m.flags).Fc}).box("mdat",vh(function(m){k=!0;var n=e,p=d,t=l,u=p;m=new $g(m,0);n=r(n);for(var v=n.next();!v.done;v=n.next()){v=v.value;var w=v.Gc||t,x=v.$e?p+v.$e:u;u=x+(w||0);var y=0;
do{var z=m.R();if(z<8)throw new T(2,2,2008);y+=z;var D=m.R(),A=null;mh(D)=="vttc"?z>8&&(A=m.Ea(z-8,!1)):m.skip(z-8);w&&A&&(z=GD(A,b.periodStart+x/c.h,b.periodStart+u/c.h,c.i),f.push(z))}while(v.sampleSize&&y<v.sampleSize)}p=r(e);for(t=p.next();!t.done;t=p.next())d+=t.value.Gc||l||0;e=[]},!1)).parse(a,!1);if(!k&&!g&&!h)throw new T(2,2,2008);return f.filter(kf)};
function GD(a,b,c,d){var e,f,g;(new ih).box("payl",vh(function(h){e=Db(h)},!1)).box("iden",vh(function(h){f=Db(h)},!1)).box("sttg",vh(function(h){g=Db(h)},!1)).parse(a);return e?HD(e,f,g,b,c,d):null}function HD(a,b,c,d,e,f){a=new Vd(d,e,a);ge(a);b&&(a.id=b);c&&uD(a,new ad(c),f);return a}I("shaka.text.Mp4VttParser",FD);FD.prototype.parseMedia=FD.prototype.parseMedia;FD.prototype.setManifestType=FD.prototype.setManifestType;FD.prototype.parseInit=FD.prototype.parseInit;
Ue('application/mp4; codecs="wvtt"',function(){return new FD});Object.freeze({Hh:0,Fh:0,yh:0,bh:0,eh:2,Ih:0});Object.freeze({Hh:0,Fh:0,yh:0,bh:0,eh:2,Ih:0});Object.freeze({Hh:0,Fh:0,yh:0,bh:0,eh:1,Ih:1});function ID(a){this.h=new Uint8Array(a);zb(this.h);this.i=0}ID.prototype.va=function(){return this.i};ID.prototype.Na=function(){return this.i};ID.prototype.seek=function(a){if(a>this.h.length)throw new T(2,3,3025);this.i=a};ID.prototype.skip=function(a){var b=this.i+a;b<=this.h.length||(b=new Uint8Array(Math.max(this.h.length*2,b)),b.set(this.h),this.h=b,zb(this.h));this.i+=a};I("shaka.util.DataViewWriter",ID);ID.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:1};[].concat(Pw,Nw,Ow,Mw).filter(function(a,b,c){return c.indexOf(a)===b});}).call(exportTo,innerGlobal,innerGlobal,undefined);if(typeof exports!="undefined")for(var k in exportTo.shaka)exports[k]=exportTo.shaka[k];else if(typeof define=="function"&&define.amd)define(function(){return exportTo.shaka});else innerGlobal.shaka=exportTo.shaka})();

//# sourceMappingURL=shaka-player.dash.map