UNPKG

nsplayer

Version:

NSPlayer, a player which supports quality list of dash and hls

25 lines 435 kB
"undefined"!=typeof self?self:globalThis;import{C as e,_ as t,I as n,M as i,a as r,t as a,E as o,c as s,D as u}from"./index-de6181c4.mjs";import{c as l}from"./_commonjsHelpers-e9ea6b58.mjs";var c,d={}; /* @license Shaka Player Copyright 2016 Google LLC SPDX-License-Identifier: Apache-2.0 */function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}c=d,function(){var e="undefined"!=typeof window?window:l,t={};for(var n in function(e,t,n){ /* @license Shaka Player Copyright 2016 Google LLC SPDX-License-Identifier: Apache-2.0 */ var i;function r(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var a="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e},o=function(n){n=["object"==typeof globalThis&&globalThis,n,"object"==typeof e&&e,"object"==typeof self&&self,"object"==typeof t&&t];for(var i=0;i<n.length;++i){var r=n[i];if(r&&r.Math==Math)return r}throw Error("Cannot find global object")}(this);function s(e,t){if(t)e:{var n=o;e=e.split(".");for(var i=0;i<e.length-1;i++){var r=e[i];if(!(r in n))break e;n=n[r]}(t=t(i=n[e=e[e.length-1]]))!=i&&null!=t&&a(n,e,{configurable:!0,writable:!0,value:t})}}function u(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function l(e){var t="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:r(e)}}function c(e){if(!(e instanceof Array)){e=l(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}s("Symbol",(function(e){function t(e,t){this.g=e,a(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),s("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),n=0;n<t.length;n++){var i=o[t[n]];"function"==typeof i&&"function"!=typeof i.prototype[e]&&a(i.prototype,e,{configurable:!0,writable:!0,value:function(){return u(r(this))}})}return e}));var d,f="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)d=Object.setPrototypeOf;else{var h;e:{var p={};try{p.__proto__={a:!0},h=p.a;break e}catch(e){}h=!1}d=h?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var g=d;function m(e,t){if(e.prototype=f(t.prototype),e.prototype.constructor=e,g)g(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var i=Object.getOwnPropertyDescriptor(t,n);i&&Object.defineProperty(e,n,i)}else e[n]=t[n];e.xh=t.prototype}function v(){this.o=!1,this.l=null,this.h=void 0,this.g=1,this.j=this.m=0,this.u=this.i=null}function y(e){if(e.o)throw new TypeError("Generator is already running");e.o=!0}function b(e,t){e.i={Ee:t,Le:!0},e.g=e.m||e.j}function w(e,t,n){return e.g=n,{value:t}}function T(e){e.g=0}function x(e,t,n){e.m=t,null!=n&&(e.j=n)}function S(e){e.m=0,e.j=2}function E(e,t){e.g=t,e.m=0}function A(e){e.m=0;var t=e.i.Ee;return e.i=null,t}function k(e){e.u=[e.i],e.m=0,e.j=0}function I(e,t){var n=e.u.splice(0)[0];(n=e.i=e.i||n)?n.Le?e.g=e.m||e.j:null!=n.A&&e.j<n.A?(e.g=n.A,e.i=null):e.g=e.j:e.g=t}function M(e){this.g=new v,this.h=e}function C(e,t,n,i){try{var r=t.call(e.g.l,n);if(!(r instanceof Object))throw new TypeError("Iterator result "+r+" is not an object");if(!r.done)return e.g.o=!1,r;var a=r.value}catch(t){return e.g.l=null,b(e.g,t),D(e)}return e.g.l=null,i.call(e.g,a),D(e)}function D(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.o=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,b(e.g,t)}if(e.g.o=!1,e.g.i){if(t=e.g.i,e.g.i=null,t.Le)throw t.Ee;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function R(e){this.next=function(t){return y(e.g),e.g.l?t=C(e,e.g.l.next,t,e.g.s):(e.g.s(t),t=D(e)),t},this.throw=function(t){return y(e.g),e.g.l?t=C(e,e.g.l.throw,t,e.g.s):(b(e.g,t),t=D(e)),t},this.return=function(t){return function(e,t){y(e.g);var n=e.g.l;return n?C(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),D(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function N(e){return function(e){function t(t){return e.next(t)}function n(t){return e.throw(t)}return new Promise((function(i,r){!function e(a){a.done?i(a.value):Promise.resolve(a.value).then(t,n).then(e,r)}(e.next())}))}(new R(new M(e)))}function P(){for(var e=Number(this),t=[],n=e;n<arguments.length;n++)t[n-e]=arguments[n];return t}function L(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _(e,t,n){e instanceof String&&(e=String(e));for(var i=e.length,r=0;r<i;r++){var a=e[r];if(t.call(n,a,r,e))return{Je:r,v:a}}return{Je:-1,v:void 0}}function j(e,t,n){if(null==e)throw new TypeError("The 'this' value for String.prototype."+n+" must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype."+n+" must not be a regular expression");return e+""}function O(e,t){e instanceof String&&(e+="");var n=0,i=!1,r={next:function(){if(!i&&n<e.length){var r=n++;return{value:t(r,e[r]),done:!1}}return i=!0,{done:!0,value:void 0}}};return r[Symbol.iterator]=function(){return r},r}v.prototype.s=function(e){this.h=e},v.prototype.return=function(e){this.i={return:e},this.g=this.j},v.prototype.A=function(e){this.g=e},s("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function i(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var r=o.setTimeout;n.prototype.i=function(e){r(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(i){n||(n=!0,e.call(t,i))}}var t=this,n=!1;return{resolve:e(this.F),reject:e(this.l)}},t.prototype.F=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.H(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.D(e):this.m(e)}},t.prototype.D=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.J(t,e):this.m(e)},t.prototype.l=function(e){this.s(2,e)},t.prototype.m=function(e){this.s(1,e)},t.prototype.s=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.G(),this.u()},t.prototype.G=function(){var e=this;r((function(){if(e.B()){var t=o.console;void 0!==t&&t.error(e.i)}}),1)},t.prototype.B=function(){if(this.o)return!1;var e=o.CustomEvent,t=o.Event,n=o.dispatchEvent;return void 0===n||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=o.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.u=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)a.h(this.g[e]);this.g=null}};var a=new n;return t.prototype.H=function(e){var t=this.j();e.Lc(t.resolve,t.reject)},t.prototype.J=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function i(e,t){return"function"==typeof e?function(t){try{r(e(t))}catch(e){a(e)}}:t}var r,a,o=new t((function(e,t){r=e,a=t}));return this.Lc(i(e,r),i(n,a)),o},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.Lc=function(e,t){function n(){switch(i.h){case 1:e(i.i);break;case 2:t(i.i);break;default:throw Error("Unexpected state: "+i.h)}}var i=this;null==this.g?a.h(n):this.g.push(n),this.o=!0},t.resolve=i,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=l(e),a=r.next();!a.done;a=r.next())i(a.value).Lc(t,n)}))},t.all=function(e){var n=l(e),r=n.next();return r.done?i([]):new t((function(e,t){function a(t){return function(n){o[t]=n,0==--s&&e(o)}}var o=[],s=0;do{o.push(void 0),s++,i(r.value).Lc(a(o.length-1),t),r=n.next()}while(!r.done)}))},t})),s("WeakMap",(function(e){function t(e){if(this.g=(u+=Math.random()+1).toString(),e){e=l(e);for(var t;!(t=e.next()).done;)t=t.value,this.set(t[0],t[1])}}function n(){}function i(e){var t=typeof e;return"object"===t&&null!==e||"function"===t}function r(e){if(!L(e,s)){var t=new n;a(e,s,{value:t})}}function o(e){var t=Object[e];t&&(Object[e]=function(e){return e instanceof n?e:(Object.isExtensible(e)&&r(e),t(e))})}if(function(){if(!e||!Object.seal)return!1;try{var t=Object.seal({}),n=Object.seal({}),i=new e([[t,2],[n,3]]);return 2==i.get(t)&&3==i.get(n)&&(i.delete(t),i.set(n,4),!i.has(t)&&4==i.get(n))}catch(e){return!1}}())return e;var s="$jscomp_hidden_"+Math.random();o("freeze"),o("preventExtensions"),o("seal");var u=0;return t.prototype.set=function(e,t){if(!i(e))throw Error("Invalid WeakMap key");if(r(e),!L(e,s))throw Error("WeakMap key fail: "+e);return e[s][this.g]=t,this},t.prototype.get=function(e){return i(e)&&L(e,s)?e[s][this.g]:void 0},t.prototype.has=function(e){return i(e)&&L(e,s)&&L(e[s],this.g)},t.prototype.delete=function(e){return!!(i(e)&&L(e,s)&&L(e[s],this.g))&&delete e[s][this.g]},t})),s("Map",(function(e){function t(){var e={};return e.Qa=e.next=e.head=e}function n(e,t){var n=e.g;return u((function(){if(n){for(;n.head!=e.g;)n=n.Qa;for(;n.next!=n.head;)return n=n.next,{done:!1,value:t(n)};n=null}return{done:!0,value:void 0}}))}function i(e,t){var n=t&&typeof t;"object"==n||"function"==n?a.has(t)?n=a.get(t):(n=""+ ++o,a.set(t,n)):n="p_"+t;var i=e.h[n];if(i&&L(e.h,n))for(e=0;e<i.length;e++){var r=i[e];if(t!=t&&r.key!=r.key||t===r.key)return{id:n,list:i,index:e,ga:r}}return{id:n,list:i,index:-1,ga:void 0}}function r(e){if(this.h={},this.g=t(),this.size=0,e){e=l(e);for(var n;!(n=e.next()).done;)n=n.value,this.set(n[0],n[1])}}if(function(){if(!e||"function"!=typeof e||!e.prototype.entries||"function"!=typeof Object.seal)return!1;try{var t=Object.seal({x:4}),n=new e(l([[t,"s"]]));if("s"!=n.get(t)||1!=n.size||n.get({x:4})||n.set({x:4},"t")!=n||2!=n.size)return!1;var i=n.entries(),r=i.next();return!r.done&&r.value[0]==t&&"s"==r.value[1]&&!((r=i.next()).done||4!=r.value[0].x||"t"!=r.value[1]||!i.next().done)}catch(e){return!1}}())return e;var a=new WeakMap;r.prototype.set=function(e,t){var n=i(this,e=0===e?0:e);return n.list||(n.list=this.h[n.id]=[]),n.ga?n.ga.value=t:(n.ga={next:this.g,Qa:this.g.Qa,head:this.g,key:e,value:t},n.list.push(n.ga),this.g.Qa.next=n.ga,this.g.Qa=n.ga,this.size++),this},r.prototype.delete=function(e){return!(!(e=i(this,e)).ga||!e.list||(e.list.splice(e.index,1),e.list.length||delete this.h[e.id],e.ga.Qa.next=e.ga.next,e.ga.next.Qa=e.ga.Qa,e.ga.head=null,this.size--,0))},r.prototype.clear=function(){this.h={},this.g=this.g.Qa=t(),this.size=0},r.prototype.has=function(e){return!!i(this,e).ga},r.prototype.get=function(e){return(e=i(this,e).ga)&&e.value},r.prototype.entries=function(){return n(this,(function(e){return[e.key,e.value]}))},r.prototype.keys=function(){return n(this,(function(e){return e.key}))},r.prototype.values=function(){return n(this,(function(e){return e.value}))},r.prototype.forEach=function(e,t){for(var n,i=this.entries();!(n=i.next()).done;)n=n.value,e.call(t,n[1],n[0],this)},r.prototype[Symbol.iterator]=r.prototype.entries;var o=0;return r})),s("Set",(function(e){function t(e){if(this.g=new Map,e){e=l(e);for(var t;!(t=e.next()).done;)this.add(t.value)}this.size=this.g.size}return function(){if(!e||"function"!=typeof e||!e.prototype.entries||"function"!=typeof Object.seal)return!1;try{var t=Object.seal({x:4}),n=new e(l([t]));if(!n.has(t)||1!=n.size||n.add(t)!=n||1!=n.size||n.add({x:4})!=n||2!=n.size)return!1;var i=n.entries(),r=i.next();return!r.done&&r.value[0]==t&&r.value[1]==t&&!(r=i.next()).done&&r.value[0]!=t&&4==r.value[0].x&&r.value[1]==r.value[0]&&i.next().done}catch(e){return!1}}()?e:(t.prototype.add=function(e){return e=0===e?0:e,this.g.set(e,e),this.size=this.g.size,this},t.prototype.delete=function(e){return e=this.g.delete(e),this.size=this.g.size,e},t.prototype.clear=function(){this.g.clear(),this.size=0},t.prototype.has=function(e){return this.g.has(e)},t.prototype.entries=function(){return this.g.entries()},t.prototype.values=function(){return this.g.values()},t.prototype.keys=t.prototype.values,t.prototype[Symbol.iterator]=t.prototype.values,t.prototype.forEach=function(e,t){var n=this;this.g.forEach((function(i){return e.call(t,i,i,n)}))},t)})),s("Array.prototype.findIndex",(function(e){return e||function(e,t){return _(this,e,t).Je}})),s("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),s("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var i=n.length;for(0>(t=t||0)&&(t=Math.max(t+i,0));t<i;t++){var r=n[t];if(r===e||Object.is(r,e))return!0}return!1}})),s("String.prototype.includes",(function(e){return e||function(e,t){return-1!==j(this,e,"includes").indexOf(e,t||0)}})),s("Array.prototype.find",(function(e){return e||function(e,t){return _(this,e,t).v}})),s("String.prototype.startsWith",(function(e){return e||function(e,t){var n=j(this,e,"startsWith"),i=n.length,r=e.length;t=Math.max(0,Math.min(0|t,n.length));for(var a=0;a<r&&t<i;)if(n[t++]!=e[a++])return!1;return a>=r}})),s("Array.prototype.keys",(function(e){return e||function(){return O(this,(function(e){return e}))}}));var U="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var i=arguments[n];if(i)for(var r in i)L(i,r)&&(e[r]=i[r])}return e};s("Object.assign",(function(e){return e||U})),s("Array.from",(function(e){return e||function(e,t,n){t=null!=t?t:function(e){return e};var i=[],r="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];if("function"==typeof r){e=r.call(e);for(var a=0;!(r=e.next()).done;)i.push(t.call(n,r.value,a++))}else for(r=e.length,a=0;a<r;a++)i.push(t.call(n,e[a],a));return i}})),s("Array.prototype.values",(function(e){return e||function(){return O(this,(function(e,t){return t}))}})),s("Promise.prototype.finally",(function(e){return e||function(e){return this.then((function(t){return Promise.resolve(e()).then((function(){return t}))}),(function(t){return Promise.resolve(e()).then((function(){throw t}))}))}})),s("Array.prototype.entries",(function(e){return e||function(){return O(this,(function(e,t){return[e,t]}))}})),s("String.prototype.repeat",(function(e){return e||function(e){var t=j(this,null,"repeat");if(0>e||1342177279<e)throw new RangeError("Invalid count value");e|=0;for(var n="";e;)1&e&&(n+=t),(e>>>=1)&&(t+=t);return n}})),s("Number.isNaN",(function(e){return e||function(e){return"number"==typeof e&&isNaN(e)}})),s("Object.values",(function(e){return e||function(e){var t,n=[];for(t in e)L(e,t)&&n.push(e[t]);return n}})),s("Math.log2",(function(e){return e||function(e){return Math.log(e)/Math.LN2}})),s("Math.trunc",(function(e){return e||function(e){if(e=Number(e),isNaN(e)||1/0===e||-1/0===e||0===e)return e;var t=Math.floor(Math.abs(e));return 0>e?-t:t}})),s("Object.entries",(function(e){return e||function(e){var t,n=[];for(t in e)L(e,t)&&n.push([t,e[t]]);return n}}));var B=this||self;function F(e,t){e=e.split(".");var n,i=B;e[0]in i||void 0===i.execScript||i.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?i=i[n]&&i[n]!==Object.prototype[n]?i[n]:i[n]={}:i[n]=t}function V(e){this.g=Math.exp(Math.log(.5)/e),this.i=this.h=0}function H(e){return e.h/(1-Math.pow(e.g,e.i))}function K(){this.h=new V(2),this.j=new V(5),this.g=0,this.i=128e3,this.l=16e3}function q(){}function G(){}function z(){}function X(e){var t=P.apply(1,arguments);Y.has(e)||(Y.add(e),z.apply(q,c(t)))}function W(){}V.prototype.sample=function(e,t){var n=Math.pow(this.g,e);t=t*(1-n)+n*this.h,isNaN(t)||(this.h=t,this.i+=e)},K.prototype.configure=function(e){this.i=e.minTotalBytes,this.l=e.minBytes,this.h.g=Math.exp(Math.log(.5)/e.fastHalfLife),this.j.g=Math.exp(Math.log(.5)/e.slowHalfLife)},K.prototype.sample=function(e,t){if(!(t<this.l)){var n=8e3*t/e;e/=1e3,this.g+=t,this.h.sample(e,n),this.j.sample(e,n)}},K.prototype.getBandwidthEstimate=function(e){return this.g<this.i?e:Math.min(H(this.h),H(this.j))};var Y=new Set;if(e.console&&e.console.log.bind){var $={},J=($[1]=console.error.bind(console),$[2]=console.warn.bind(console),$[3]=console.info.bind(console),$[4]=console.log.bind(console),$[5]=console.debug.bind(console),$[6]=console.debug.bind(console),$);z=J[2],G=J[1]}function Q(e){if(Z.has(e))return Z.get(e);var t=MediaSource.isTypeSupported(e);return Z.set(e,t),t}var Z=new Map;function ee(e,t){return!("number"!=typeof e||"number"!=typeof t||!isNaN(e)||!isNaN(t))||e===t}function te(e,t){-1<(t=e.indexOf(t))&&e.splice(t,1)}function ne(e,t,n){if(n||(n=ee),e.length!=t.length)return!1;t=t.slice();for(var i={},r=(e=l(e)).next();!r.done;i={md:i.md},r=e.next()){if(i.md=r.value,-1==(r=t.findIndex(function(e){return function(t){return n(e.md,t)}}(i))))return!1;t[r]=t[t.length-1],t.pop()}return 0==t.length}function ie(e,t,n){if(n||(n=ee),e.length!=t.length)return!1;for(var i=0;i<e.length;i++)if(!n(e[i],t[i]))return!1;return!0}function re(e,t,n){this.startTime=e,this.direction=de,this.endTime=t,this.payload=n,this.region=new Te,this.position=null,this.positionAlign=oe,this.size=0,this.textAlign=se,this.writingMode=fe,this.lineInterpretation=he,this.line=null,this.lineHeight="",this.lineAlign=pe,this.displayAlign=le,this.fontSize=this.textStrokeWidth=this.textStrokeColor=this.textShadow=this.border=this.backgroundImage=this.backgroundColor=this.color="",this.fontWeight=ye,this.fontStyle=be,this.linePadding=this.letterSpacing=this.fontFamily="",this.opacity=1,this.textDecoration=[],this.wrapLine=!0,this.id="",this.nestedCues=[],this.lineBreak=this.isContainer=!1,this.cellResolution={columns:32,rows:15}}function ae(e,t){if(e.startTime!=t.startTime||e.endTime!=t.endTime||e.payload!=t.payload)return!1;for(var n in e)if("startTime"!=n&&"endTime"!=n&&"payload"!=n)if("nestedCues"==n){if(!ie(e.nestedCues,t.nestedCues,ae))return!1}else if("region"==n||"cellResolution"==n){for(var i in e[n])if(e[n][i]!=t[n][i])return!1}else if(Array.isArray(e[n])){if(!ie(e[n],t[n]))return!1}else if(e[n]!=t[n])return!1;return!0}re.prototype.clone=function(){var e,t=new re(0,0,"");for(e in this)t[e]=this[e],t[e]&&t[e].constructor==Array&&(t[e]=t[e].slice());return t},F("shaka.text.Cue",re);var oe="auto";re.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:oe};var se="center",ue={LEFT:"left",RIGHT:"right",CENTER:se,START:"start",END:"end"};re.textAlign=ue;var le="after",ce={BEFORE:"before",CENTER:"center",AFTER:le};re.displayAlign=ce;var de="ltr";re.direction={HORIZONTAL_LEFT_TO_RIGHT:de,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var fe="horizontal-tb";re.writingMode={HORIZONTAL_TOP_TO_BOTTOM:fe,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};var he=0;re.lineInterpretation={LINE_NUMBER:he,PERCENTAGE:1};var pe="start",ge={CENTER:"center",START:pe,END:"end"};re.lineAlign=ge;var me={white:"#FFF",lime:"#0F0",cyan:"#0FF",red:"#F00",yellow:"#FF0",magenta:"#F0F",blue:"#00F",black:"#000"};re.defaultTextColor=me;var ve={bg_white:"#FFF",bg_lime:"#0F0",bg_cyan:"#0FF",bg_red:"#F00",bg_yellow:"#FF0",bg_magenta:"#F0F",bg_blue:"#00F",bg_black:"#000"};re.defaultTextBackgroundColor=ve;var ye=400;re.fontWeight={NORMAL:ye,BOLD:700};var be="normal",we={NORMAL:be,ITALIC:"italic",OBLIQUE:"oblique"};function Te(){this.id="",this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0,this.height=this.width=100,this.viewportAnchorUnits=this.widthUnits=this.heightUnits=xe,this.scroll=Se}re.fontStyle=we,re.textDecoration={UNDERLINE:"underline",LINE_THROUGH:"lineThrough",OVERLINE:"overline"},F("shaka.text.CueRegion",Te);var xe=1;Te.units={PX:0,PERCENTAGE:xe,LINES:2};var Se="";function Ee(){}function Ae(e,t){if(!e&&!t)return!0;if(!e||!t||e.byteLength!=t.byteLength)return!1;if(ke(e)==ke(t)&&(e.byteOffset||0)==(t.byteOffset||0))return!0;var n=Me(e);t=Me(t);for(var i=0;i<e.byteLength;i++)if(n[i]!=t[i])return!1;return!0}function ke(e){return e instanceof ArrayBuffer?e:e.buffer}function Ie(e){return e instanceof ArrayBuffer?e:0==e.byteOffset&&e.byteLength==e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer}function Me(e,t,n){return De(e,void 0===t?0:t,n=void 0===n?1/0:n,Uint8Array)}function Ce(e,t,n){return De(e,void 0===t?0:t,n=void 0===n?1/0:n,DataView)}function De(e,t,n,i){var r=(e.byteOffset||0)+e.byteLength;return t=Math.max(0,Math.min((e.byteOffset||0)+t,r)),new i(ke(e),t,Math.min(t+Math.max(n,0),r)-t)}function Re(e,t,n){var i=P.apply(3,arguments);this.severity=e,this.category=t,this.code=n,this.data=i,this.handled=!1}Te.scrollMode={NONE:Se,UP:"up"},F("shaka.util.BufferUtils",Ee),Ee.toDataView=Ce,Ee.toUint8=Me,Ee.toArrayBuffer=Ie,Ee.equal=Ae,Re.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")},F("shaka.util.Error",Re),Re.Severity={RECOVERABLE:1,CRITICAL:2},Re.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9,ADS:10},Re.Code={UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,ATTEMPTS_EXHAUSTED:1010,SEGMENT_MISSING:1011,INVALID_TEXT_HEADER:2e3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,UNABLE_TO_EXTRACT_CUE_START_TIME:2009,INVALID_MP4_CEA:2010,TEXT_COULD_NOT_GUESS_MIME_TYPE:2011,CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS:2012,TEXT_ONLY_WEBVTT_SRC_EQUALS:2013,MISSING_TEXT_PLUGIN:2014,CHAPTERS_TRACK_FAILED:2015,CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_SRC_EQUALS:2016,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,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,HLS_AES_128_INVALID_IV_LENGTH:4043,HLS_AES_128_INVALID_KEY_LENGTH:4044,CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_LIVE_STREAM:4045,STREAMING_ENGINE_STARTUP_INVALID_STATE:5006,NO_RECOGNIZED_KEY_SYSTEMS:6e3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,SERVER_CERTIFICATE_REQUIRED:6015,INIT_DATA_TRANSFORM_ERROR:6016,SERVER_CERTIFICATE_REQUEST_FAILED:6017,LOAD_INTERRUPTED:7e3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,OBJECT_DESTROYED:7003,CONTENT_NOT_LOADED:7004,CAST_API_UNAVAILABLE:8e3,NO_CAST_RECEIVERS:8001,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,STORAGE_NOT_SUPPORTED:9e3,INDEXED_DB_ERROR:9001,DEPRECATED_OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,NEW_KEY_OPERATION_NOT_SUPPORTED:9011,KEY_NOT_FOUND:9012,MISSING_STORAGE_CELL:9013,STORAGE_LIMIT_REACHED:9014,DOWNLOAD_SIZE_CALLBACK_ERROR:9015,MODIFY_OPERATION_NOT_SUPPORTED:9016,INDEXED_DB_INIT_TIMED_OUT:9017,CS_IMA_SDK_MISSING:1e4,CS_AD_MANAGER_NOT_INITIALIZED:10001,SS_IMA_SDK_MISSING:10002,SS_AD_MANAGER_NOT_INITIALIZED:10003,CURRENT_DAI_REQUEST_NOT_FINISHED:10004}; /* @license Copyright 2008 The Closure Library Authors SPDX-License-Identifier: Apache-2.0 */ var Ne=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$"); /* @license Copyright 2006 The Closure Library Authors SPDX-License-Identifier: Apache-2.0 */function Pe(e){var t;e instanceof Pe?(Le(this,e.Ea),this.pb=e.pb,this.Ha=e.Ha,_e(this,e.Kb),this.qa=e.qa,je(this,e.g.clone()),this.fb=e.fb):e&&(t=String(e).match(Ne))?(Le(this,t[1]||"",!0),this.pb=Oe(t[2]||""),this.Ha=Oe(t[3]||"",!0),_e(this,t[4]),this.qa=Oe(t[5]||"",!0),je(this,t[6]||"",!0),this.fb=Oe(t[7]||"")):this.g=new Ge(null)}function Le(e,t,n){e.Ea=n?Oe(t,!0):t,e.Ea&&(e.Ea=e.Ea.replace(/:$/,""))}function _e(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.Kb=t}else e.Kb=null}function je(e,t,n){t instanceof Ge?e.g=t:(n||(t=Ue(t,Ke)),e.g=new Ge(t))}function Oe(e,t){return e?t?decodeURI(e):decodeURIComponent(e):""}function Ue(e,t,n){return null!=e?(e=encodeURI(e).replace(t,Be),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function Be(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}(i=Pe.prototype).Ea="",i.pb="",i.Ha="",i.Kb=null,i.qa="",i.fb="",i.toString=function(){var e=[],t=this.Ea;if(t&&e.push(Ue(t,Fe,!0),":"),t=this.Ha){e.push("//");var n=this.pb;n&&e.push(Ue(n,Fe,!0),"@"),e.push(encodeURIComponent(t).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(t=this.Kb)&&e.push(":",String(t))}return(t=this.qa)&&(this.Ha&&"/"!=t.charAt(0)&&e.push("/"),e.push(Ue(t,"/"==t.charAt(0)?He:Ve,!0))),(t=this.g.toString())&&e.push("?",t),(t=this.fb)&&e.push("#",Ue(t,qe)),e.join("")},i.resolve=function(e){var t=this.clone();"data"===t.Ea&&(t=new Pe);var n=!!e.Ea;n?Le(t,e.Ea):n=!!e.pb,n?t.pb=e.pb:n=!!e.Ha,n?t.Ha=e.Ha:n=null!=e.Kb;var i=e.qa;if(n)_e(t,e.Kb);else if(n=!!e.qa){if("/"!=i.charAt(0))if(this.Ha&&!this.qa)i="/"+i;else{var r=t.qa.lastIndexOf("/");-1!=r&&(i=t.qa.substr(0,r+1)+i)}if(".."==i||"."==i)i="";else if(-1!=i.indexOf("./")||-1!=i.indexOf("/.")){r=0==i.lastIndexOf("/",0),i=i.split("/");for(var a=[],o=0;o<i.length;){var s=i[o++];"."==s?r&&o==i.length&&a.push(""):".."==s?((1<a.length||1==a.length&&""!=a[0])&&a.pop(),r&&o==i.length&&a.push("")):(a.push(s),r=!0)}i=a.join("/")}}return n?t.qa=i:n=""!==e.g.toString(),n?je(t,e.g.clone()):n=!!e.fb,n&&(t.fb=e.fb),t},i.clone=function(){return new Pe(this)};var Fe=/[#\/\?@]/g,Ve=/[#\?:]/g,He=/[#\?]/g,Ke=/[#\?@]/g,qe=/#/g;function Ge(e){this.g=e||null}function ze(e){if(!e.la&&(e.la={},e.Oc=0,e.g))for(var t=e.g.split("&"),n=0;n<t.length;n++){var i=t[n].indexOf("="),r=null;if(0<=i){var a=t[n].substring(0,i);r=t[n].substring(i+1)}else a=t[n];a=decodeURIComponent(a.replace(/\+/g," ")),r=r||"",e.add(a,decodeURIComponent(r.replace(/\+/g," ")))}}function Xe(e,t){return e.concat(t)}function We(){}function Ye(e){return null!=e}function $e(e,t){if(0==t.length)return e;var n=t.map((function(e){return new Pe(e)}));return e.map((function(e){return new Pe(e)})).map((function(e){return n.map((function(t){return e.resolve(t)}))})).reduce(Xe,[]).map((function(e){return e.toString()}))}function Je(e,t){return{keySystem:e,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:t||[],keyIds:new Set}}function Qe(e,t){if(1==t.length)return t[0];if(null!=(e=Ze(e,t)))return e;throw new Re(2,4,4025,t)}function Ze(e,t){for(var n=l(nt[e]),i=n.next();!i.done;i=n.next()){i=i.value;for(var r=l(t),a=r.next();!a.done;a=r.next())if(a=a.value,i.test(a.trim()))return a.trim()}return e==et?"":null}(i=Ge.prototype).la=null,i.Oc=null,i.add=function(e,t){ze(this),this.g=null;var n=this.la.hasOwnProperty(e)?this.la[e]:null;return n||(this.la[e]=n=[]),n.push(t),this.Oc++,this},i.set=function(e,t){return ze(this),this.g=null,this.la.hasOwnProperty(e)?this.la[e]=[t]:this.add(e,t),this},i.toString=function(){if(this.g)return this.g;if(!this.la)return"";var e,t=[];for(e in this.la)for(var n=encodeURIComponent(e),i=this.la[e],r=0;r<i.length;r++){var a=n;""!==i[r]&&(a+="="+encodeURIComponent(i[r])),t.push(a)}return this.g=t.join("&")},i.clone=function(){var e=new Ge;if(e.g=this.g,this.la){var t,n={};for(t in this.la)n[t]=this.la[t].concat();e.la=n,e.Oc=this.Oc}return e};var et="text",tt={va:"video",Hc:"audio",X:et,Wb:"image",Gg:"application"},nt={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4$/,/^dts[cx]$/,/^[du]dts$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av01/,/^dvhe/],text:[/^vtt$/,/^wvtt/,/^stpp/]};function it(){var e,t,n=new Promise((function(n,i){e=n,t=i}));return n.resolve=e,n.reject=t,n}function rt(e){this.h=e,this.g=void 0}function at(e){this.h=e,this.g=null}function ot(e){this.h=e,this.g=null}function st(){return!(!e.MediaSource||!MediaSource.isTypeSupported)}function ut(e){return""!=vt().canPlayType(e)}function lt(){return!!navigator.userAgent.match(/Edge?\//)}function ct(){return mt("Xbox One")}function dt(){return mt("Tizen")}function ft(){return mt("Web0S")&&mt("Chrome/38.0.2125.122 Safari/537.36")}function ht(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!dt()&&!mt("PC=EOS")&&!mt("VirginMedia")&&!pt()&&!mt("AFT")}function pt(){return mt("PlayStation 4")}function gt(){if(!ht())return null;var e=navigator.userAgent.match(/Version\/(\d+)/);return e||(e=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(e[1],10):null}function mt(e){return(navigator.userAgent||"").includes(e)}function vt(){return bt||(yt||(yt=new ot((function(){bt=null}))),(bt=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(bt=document.createElement("video")),yt.N(1),bt)}it.prototype.resolve=function(){},it.prototype.reject=function(){},rt.prototype.value=function(){return null==this.g&&(this.g=this.h()),this.g},at.prototype.N=function(t){var n=this;this.stop();var i=!0,r=null;return this.g=function(){e.clearTimeout(r),i=!1},r=e.setTimeout((function(){i&&n.h()}),1e3*t),this},at.prototype.stop=function(){this.g&&(this.g(),this.g=null)},ot.prototype.Mb=function(){return this.stop(),this.h(),this},ot.prototype.N=function(e){var t=this;return this.stop(),this.g=new at((function(){t.h()})).N(e),this},ot.prototype.Ca=function(e){var t=this;return this.stop(),this.g=new at((function(){t.g.N(e),t.h()})).N(e),this},ot.prototype.stop=function(){this.g&&(this.g.stop(),this.g=null)},F("shaka.util.Timer",ot),ot.prototype.stop=ot.prototype.stop,ot.prototype.tickEvery=ot.prototype.Ca,ot.prototype.tickAfter=ot.prototype.N,ot.prototype.tickNow=ot.prototype.Mb;var yt=null,bt=null;function wt(){}function Tt(t){if(!t)return"";if(239==(t=Me(t))[0]&&187==t[1]&&191==t[2]&&(t=t.subarray(3)),e.TextDecoder&&!pt())return(t=(new TextDecoder).decode(t)).includes("�")&&G('Decoded string contains an "unknown character" codepoint. That probably means the UTF8 encoding was incorrect!'),t;for(var n="",i=0;i<t.length;++i){var r=65533;if(0==(128&t[i])?r=t[i]:t.length>=i+2&&192==(224&t[i])&&128==(192&t[i+1])?(r=(31&t[i])<<6|63&t[i+1],i+=1):t.length>=i+3&&224==(240&t[i])&&128==(192&t[i+1])&&128==(192&t[i+2])?(r=(15&t[i])<<12|(63&t[i+1])<<6|63&t[i+2],i+=2):t.length>=i+4&&240==(241&t[i])&&128==(192&t[i+1])&&128==(192&t[i+2])&&128==(192&t[i+3])&&(r=(7&t[i])<<18|(63&t[i+1])<<12|(63&t[i+2])<<6|63&t[i+3],i+=3),65535>=r)n+=String.fromCharCode(r);else{var a=1023&(r-=65536);n+=String.fromCharCode(55296+(r>>10)),n+=String.fromCharCode(56320+a)}}return n}function xt(e,t,n){if(!e)return"";if(!n&&0!=e.byteLength%2)throw new Re(2,2,2004);n=Math.floor(e.byteLength/2);var i=new Uint16Array(n);e=Ce(e);for(var r=0;r<n;r++)i[r]=e.getUint16(2*r,t);return kt.value()(i)}function St(e){function t(e){return n.byteLength<=e||32<=n[e]&&126>=n[e]}if(!e)return"";var n=Me(e);if(239==n[0]&&187==n[1]&&191==n[2])return Tt(n);if(254==n[0]&&255==n[1])return xt(n.subarray(2),!1);if(255==n[0]&&254==n[1])return xt(n.subarray(2),!0);if(0==n[0]&&0==n[2])return xt(e,!1);if(0==n[1]&&0==n[3])return xt(e,!0);if(t(0)&&t(1)&&t(2)&&t(3))return Tt(e);throw new Re(2,2,2003)}function Et(t){if(e.TextEncoder&&!pt()){var n=new TextEncoder;return Ie(n.encode(t))}t=encodeURIComponent(t),t=unescape(t),n=new Uint8Array(t.length);for(var i=0;i<t.length;i++)n[i]=t[i].charCodeAt(0);return Ie(n)}function At(e,t){for(var n=new ArrayBuffer(2*e.length),i=new DataView(n),r=0;r<e.length;++r)i.setUint16(2*r,e.charCodeAt(r),t);return n}F("shaka.util.StringUtils",wt),wt.resetFromCharCode=function(){kt.g=void 0},wt.toUTF16=At,wt.toUTF8=Et,wt.fromBytesAutoDetect=St,wt.fromUTF16=xt,wt.fromUTF8=Tt;var kt=new rt((function(){function e(e){try{var t=new Uint8Array(e);return 0<String.fromCharCode.apply(null,t).length}catch(e){return!1}}for(var t={Ua:65536};0<t.Ua;(t={Ua:t.Ua}).Ua/=2)if(e(t.Ua))return function(e){return function(t){for(var n="",i=0;i<t.length;i+=e.Ua)n+=String.fromCharCode.apply(null,t.subarray(i,i+e.Ua));return n}}(t);return null}));function It(){}function Mt(e){return e=Me(e),e=kt.value()(e),btoa(e)}function Ct(e,t){return t=null==t||t,e=Mt(e).replace(/\+/g,"-").replace(/\//g,"_"),t?e:e.replace(/[=]*$/,"")}function Dt(t){t=e.atob(t.replace(/-/g,"+").replace(/_/g,"/"));for(var n=new Uint8Array(t.length),i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}function Rt(t){for(var n=t.length/2,i=new Uint8Array(n),r=0;r<n;r++)i[r]=e.parseInt(t.substr(2*r,2),16);return i}function Nt(e){var t=Me(e);e="";for(var n=(t=l(t)).next();!n.done;n=t.next())1==(n=(n=n.value).toString(16)).length&&(n="0"+n),e+=n;return e}function Pt(){for(var e=P.apply(0,arguments),t=0,n=l(e),i=n.next();!i.done;i=n.next())t+=i.value.byteLength;for(t=new Uint8Array(t),n=0,i=(e=l(e)).next();!i.done;i=e.next())i=i.value,t.set(Me(i),n),n+=i.byteLength;return t}function Lt(){}F("shaka.util.Uint8ArrayUtils",It),It.concat=Pt,It.toHex=Nt,It.fromHex=Rt,It.fromBase64=Dt,It.toBase64=Ct,It.toStandardBase64=Mt,F("shaka.dependencies",Lt),Lt.has=function(e){return jt.has(e)},Lt.add=function(e,t){if(!_t[e])throw Error(e+" is not supported");jt.set(e,(function(){return t}))};var _t={muxjs:"muxjs"};Lt.Allowed=_t;var jt=new Map([["muxjs",function(){return e.muxjs}]]);function Ot(e){var t=this;this.o=e,this.m=jt.get("muxjs")(),this.h=this.g=null,this.l=[],this.i=[],this.j=!1,this.m&&(this.g=new this.m.mp4.Transmuxer({keepOriginalTimestamps:!0}),this.g.on("data",(function(e){t.i=e.captions,t.l.push(Pt(e.initSegment,e.data))})),this.g.on("done",(function(){var e={data:Pt.apply(It,c(t.l)),captions:t.i};t.h.resolve(e),t.j=!1})))}function Ut(e,t){var n=Bt(e),i="audio/aac"==e.toLowerCase().split(";")[0];return!(!jt.get("muxjs")()||!n&&!i)&&(i?Q('audio/mp4; codecs="mp4a.40.2"'):t?Q(Vt(t,e)):(t=Vt("audio",e),e=Vt("video",e),Q(t)||Q(e)))}function Bt(e){return"mp2t"==e.toLowerCase().split(";")[0].split("/")[1]}function Ft(e,t){return"audio/aac"==t.toLowerCase().split(";")[0]?'audio/mp4; codecs="mp4a.40.2"':Bt(t)?Vt(e,t):t}function Vt(e,t){if(t=t.replace(/mp2t/i,"mp4"),"audio"==e&&(t=t.replace("video","audio")),e=/avc1\.(66|77|100)\.(\d+)/.exec(t)){var n="avc1.",i=e[1],r=Number(e[2]);n=("66"==i?n+"4200":"77"==i?n+"4d00":n+"6400")+(r>>4).toString(16),n+=(15&r).toString(16),t=t.replace(e[0],n)}return t}function Ht(){}function Kt(e,t){return t&&(e+='; codecs="'+t+'"'),e}function qt(e,t,n){return Ut(t=Kt(e,t),n)?Ft(n,t):"video/mp2t"!=e&&"audio"==n?t.replace("video","audio"):t}function Gt(e){var t=Xt(e);switch(e=t[0],t=t[1].toLowerCase(),!0){case"mp4a"===e&&"69"===t:case"mp4a"===e&&"6b"===t:return"mp3";case"mp4a"===e&&"66"===t:case"mp4a"===e&&"67"===t:case"mp4a"===e&&"68"===t:case"mp4a"===e&&"40.2"===t:case"mp4a"===e&&"40.02"===t:case"mp4a"===e&&"40.5"===t:case"mp4a"===e&&"40.05"===t:case"mp4a"===e&&"40.29"===t:case"mp4a"===e&&"40.42"===t:return"aac";case"mp4a"===e&&"a5"===t:return"ac-3";case"mp4a"===e&&"a6"===t:return"ec-3";case"mp4a"===e&&"b2"===t:return"dtsx";case"mp4a"===e&&"a9"===t:return"dtsc";case"avc1"===e:case"avc3"===e:return"avc";case"hvc1"===e:case"hev1"===e:return"hevc";case"dvh1"===e:case"dvhe"===e:return"dovi"}return e}function zt(e){return(e=e.split(/ *; */)).shift(),(e=e.find((function(e){return e.startsWith("codecs=")})))?e.split("=")[1].replace(/^"|"$/g,""):""}function Xt(e){var t=(e=e.split("."))[0];return e.shift(),[t,e.join(".")]}function Wt(e){this.j=null,this.i=e,this.u=!1,this.l=this.s=0,this.m=1/0,this.h=this.g=null,this.B="",this.o=new Map}function Yt(e){return!(!Zt[e]&&"application/cea-608"!=e&&"application/cea-708"!=e)}function $t(e,t,n){if(e.B=t,t=e.o.get(t))for(var i=l(t.keys()),r=i.next();!r.done;r=i.next())(r=t.get(r.value).filter((function(e){return e.endTime<=n})))&&e.i.append(r)}function Jt(e,t,n){t.startTime+=n,t.endTime+=n;for(var i=(t=l(t.nestedCues)).next();!i.done;i=t.next())Jt(e,i.value,n)}function Qt(e,t,n,i,r){for(var a=n+" "+i,o=new Map,s=(t=l(t)).next();!s.done;s=t.next()){var u=s.value;s=u.stream,u=u.cue,o.has(s)||o.set(s,new Map),o.get(s).has(a)||o.get(s).set(a,[]),Jt(e,u,r),u.startTime>=e.l&&u.startTime<e.m&&(o.get(s).get(a).push(u),s==e.B&&e.i.append([u]))}for(a=(r=l(o.keys())).next();!a.done;a=r.next())for(a=a.value,e.o.has(a)||e.o.set(a,new Map),s=(t=l(o.get(a).keys())).next();!s.done;s=t.next())s=s.value,u=o.get(a).get(s),e.o.get(a).set(s,u);e.g=null==e.g?Math.max(n,e.l):Math.min(e.g,Math.max(n,e.l)),e.h=Math.max(e.h,Math.min(i,e.m))}Ot.prototype.destroy=function(){return this.g&&this.g.dispose(),this.g=null,Promise.resolve()},F("shaka.util.MimeUtils",Ht),Ht.getFullType=Kt,(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels"),Wt.prototype.destroy=function(){return this.i=this.j=null,this.o.clear(),Promise.resolve()},Wt.prototype.remove=function(e,t){var n=this;return N((function(i){if(1==i.g)return w(i,Promise.resolve(),2);!n.i||!n.i.remove(e,t)||null==n.g||t<=n.g||e>=n.h||(e<=n.g&&t>=n.h?n.g=n.h=null:e<=n.g&&t<n.h?n.g=t:e>n.g&&t>=n.h&&(n.h=e)),T(i)}))},F("shaka.text.TextEngine",Wt),Wt.prototype.destroy=Wt.prototype.destroy,Wt.findParser=function(e){return Zt[e]},Wt.unregisterParser=function(e){delete Zt[e]},Wt.registerParser=function(e,t){Zt[e]=t};var Zt={};function en(){}function tn(e,t){return e=an(e),t=an(t),e.split("-")[0]==t.split("-")[0]}function nn(e,t){return e=an(e),t=an(t),e=e.split("-"),t=t.split("-"),e[0]==t[0]&&1==e.length&&2==t.length}function rn(e,t){return e=an(e),t=an(t),e=e.split("-"),t=t.split("-"),2==e.length&&2==t.length&&e[0]==t[0]}function an(e){var t=e.split("-");return e=t[0]||"",t=t[1]||"",e=e.toLowerCase(),e=cn.get(e)||e,(t=t.toUpperCase())?e+"-"+t:e}function on(e,t){return e=an(e),(t=an(t))==e?4:nn(t,e)?3:rn(t,e)?2:nn(e,t)?1:0}function sn(e){var t=e.indexOf("-");return e=(e=0<=t?e.substring(0,t):e).toLowerCase(),cn.get(e)||e}function un(e){return e.language?an(e.language):e.audio&&e.audio.language?an(e.audio.language):e.video&&e.video.language?an(e.video.language):"und"}function ln(e,t){e=an(e);var n=new Set,i=l(t);for(t=i.next();!t.done;t=i.next())n.add(an(t.value));for(t=(i=l(n)).next();!t.done;t=i.next())if((t=t.value)==e)return t;for(t=(i=l(n)).next();!t.done;t=i.next())if(nn(t=t.value,e))return t;for(t=(i=l(n)).next();!t.done;t=i.next())if(rn(t=t.value,e))return t;for(t=(n=l(n)).next();!t.done;t=n.next())if(nn(e,t=t.value))return t;return null}F("shaka.util.LanguageUtils",en),en.findClosestLocale=ln,en.getLocaleForVariant=un,en.getLocaleForText=function(e){return an(e.language||"und")},en.getBase=sn,en.relatedness=on,en.areSiblings=function(e,t){var n=sn(e),i=sn(t);return e!=n&&t!=i&&n==i},en.normalize=an,en.isSiblingOf=rn,en.isParentOf=nn,en.areLanguageCompatible=tn,en.areLocaleCompatible=function(e,t){return(e=an(e))==(t=an(t))};var cn=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 dn(){this.g={}}function fn(e,t,n,i,r){var a=e.variants;(t.length||n.length)&&(a=function(e,t,n){for(var i={},r=(t=l(t)).next();!r.done;i={xd:i.xd},r=t.next())if(i.xd=r.value,r=e.filter(function(e){return function(t){return t.video&&t.video.codecs.startsWith(e.xd)}}(i)),r.length){e=r;break}for(i={},n=l(n),t=n.next();!t.done;i={jd:i.jd},t=n.next())if(i.jd=t.value,t=e.filter(function(e){return function(t){return t.audio&&t.audio.codecs.startsWith(e.jd)}}(i)),t.length){e=t;break}return e}(a,t,n)),t=function(e){for(var t=new dn,n=(e=l(e)).next();!n.done;n=e.next()){var i=pn(n=n.value);t.push(i,n)}return t}(a=Pn(a,i)),t=function(e){var t=0,n=new Map,i=e.size();return e.forEach((function(e,r){for(var a=(r=l(r)).next();!a.done;a=r.next()){var o=(a=a.value).video;if(o&&o.width&&o.height){o=o.width*o.height*(o.frameRate||1),n.has(o)||n.set(o,new dn);var s=n.get(o);s.push(e,a),s.size()===i&&(t=Math.max(t,o))}}})),t?n.get(t):e}(t);var o=function(e,t){for(var n=(t=l(t)).next();!n.done;n=t.next())if((n=n.value)==Bn||n==Fn){if(1==(e=hn(e,n)).size())return e.keys()[0]}else if(n==Vn)break;return function(e){var t="",n=1/0;return e.forEach((function(e,i){for(var r=0,a=0,o=(i=l(i)).next();!o.done;o=i.next())r+=o.value.bandwidth||0,++a;(r/=a)<n&&(t=e,n=r)})),t}(e)}(t,r);e.variants=e.variants.filter((function(e){return pn(e)==o}))}function hn(e,t){var n=0,i=new dn;return e.forEach((function(e,r){for(var a=0,o=0,s=l(r),u=s.next();!u.done;u=s.next())(u=u.value).decodingInfos.length&&(a+=u.decodingInfos[0][t]?1:0,o++);(a/=o)>n?(i.g={},i.push(e,r),n=a):a==n&&i.push(e,r)})),i}function pn(e){var t="";e.video&&(t=Gt(e.video.codecs));var n="";return e.audio&&(n=Gt(e.audio.codecs)),t+"-"+n}function gn(e,t,n){function i(e,t,n){return e>=t&&e<=n}var r=e.video;if(0!=e.disabledUntilTime){if(e.disabledUntilTime>Date.now()/1e3)return!1;e.disabledUntilTime=0}return!(r&&r.width&&r.height&&(!i(r.width,t.minWidth,Math.min(t.maxWidth,n.width))||!i(r.height,t.minHeight,Math.min(t.maxHeight,n.height))||!i(r.width*r.height,t.minPixels,t.maxPixels))||e&&e.video&&e.video.frameRate&&!i(e.video.frameRate,t.minFrameRate,t.maxFrameRate)||!i(e.bandwidth,t.minBandwidth,t.maxBandwidth))}function mn(e,t,n){for(var i=!1,r=(e=l(e)).next();!r.done;r=e.next()){var a=(r=r.value).allowedByApplication;r.allowedByApplication=gn(r,t,n),a!=r.allowedByApplication&&(i=!0)}return i}function vn(e,t){return N((function(n){return 1==n.g?w(n,yn(t,0<t.offlineSessionIds.length),2):(Sn(e,t),function(e){e.textStreams=e.textStreams.filter((function(e){return Yt(Kt(e.mimeType,e.codecs))}))}(t),w(n,function(e){var t,n,i,r,a,o,s;return N((function(u){switch(u.g){case 1:t=[],n=l(e.imageStreams),i=n.next();case 2:if(i.done){u.A(4);break}if(r=i.value,a=r.mimeType,Hn.has(a)){u.A(5);break}if(!(o=Kn.get(a))){Hn.set(a,!1),u.A(5);break}return w(u,function(e){return new Promise((function(t){var n=new Image;n.src=e,"decode"in n?n.decode().then((function(){t(!0)})).catch((function(){t(!1)})):n.onload=n.onerror=function(){t(2===n.height)}}))}(o),7);case 7:s=u.h,Hn.set(a,s);case 5:Hn.get(a)&&t.push(r),i=n.next(),u.A(2);break;case 4:e.imageStreams=t,T(u)}}))}(t),0))}))}function yn(e,t){return N((function(n){if(1==n.g)return w(n,bn(e.variants,t,!1),2);e.variants=e.variants.filter((function(e){var t=e.video;if(t){var n=xn(t.codecs);if(t.codecs.includes(",")){var i=t.codecs.split(",");n=xn(n=Qe("video",i)),i=Tn(i=Qe("audio",i));var r=qt(t.mimeType,i,"audio");if(!Q(r))return!1;n=[n,i].join()}if(!Q(i=qt(t.mimeType,n,"video")))return!1;t.codecs=n}if(n=e.audio){if(i=Tn(n.codecs),!Q(r=qt(n.mimeType,i,"audio")))return!1;n.codecs=i}return ct()&&t&&(t.width&&1920<t.width||t.height&&1080<t.height)&&(t.codecs.includes("avc1.")||t.codecs.includes("avc3."))?(jn(e),!1):((t=e.decodingInfos.some((function(e){return e.supported})))||jn(e),t)})),T(n)}))}function bn(e,t,n){var i,r,a,o,s,u,c,d,f,h;return N((function(p){if(e.some((function(e){return e.decodingInfos.length})))return p.return();for(i=navigator.mediaCapabilities,r=[],a=function(e,t){var n;return N((function(r){return 1==r.g?(x(r,2),w(r,i.decodingInfo(t),4)):2!=r.g?(n=r.h,e.decodingInfos.push(n),E(r,0)):(A(r),JSON.stringify(t),void T(r))}))},o=l(e),s=o.next();!s.done;s=o.next())for(u=s.value,c=wn(u,t,n),d=l(c),f=d.next();!f.done;f=d.next())h=f.value,r.push(a(u,h));return w(p,Promise.all(r),0)}))}function wn(e,t,n){var i=e.audio,r=e.video;if(n={type:n?"file":"media-source"},r){var a=r.codecs;if(r.codecs.includes(",")){var o=r.codecs.split(",");a=xn(a=Qe("video",o)),o=Qe("audio",o),o=qt(r.mimeType,o,"audio"),n.audio={contentType:o,channels:2,bitrate:e.bandwidth||1,samplerate:1,spatialRendering:!1}}if(a=xn(a),a=qt(r.mimeType,a,"video"),n.video={contentType:a,width:r.width||64,height:r.height||64,bitrate:r.bandwidth||e.bandwidth||1,framerate:r.frameRate||1},r.hdr)switch(r.hdr){case"SDR":n.video.transferFunction="srgb";break;case"PQ":n.video.transferFunction="pq";break;case"HLG":n.video.transferFunction="hlg"}}if(i&&(a=Tn(i.codecs),a=qt(i.mimeType,a,"audio"),n.audio={contentType:a,channels:i.channelsCount||2,bitrate:i.bandwidth||e.bandwidth||1,samplerate:i.audioSamplingRate||1,spatialRendering:i.spatialAudio}),!(o=(e.video?e.video.drmInfos:[]).concat(e.audio?e.audio.drmInfos:[])).length)return[n];e=[],a=new Map;for(var s=(o=l(o)).next();!s.done;s=o.next()){var u=s.value;a.get(u.keySystem)||a.set(u.keySystem,[]),a.get(u.keySystem).push(u)}o=t?"required":"optional",t=t?["persistent-license"]:["temporary"];for(var c=(u=l(a.keys())).next();!c.done;c=u.next()){var d=c.value;c=Object.assign({},n);var f=a.get(d);for(d={keySystem:d,initDataType:"cenc",persistentState:o,distinctiveIdentifier:"optional",sessionTypes:t},s=(f=l(f)).next();!s.done;s=f.next()){if((s=s.value).initData&&s.initData.length){for(var h=new