diff --git a/build/karma.conf.js b/build/karma.conf.js index 8ebd55197..49f8d6687 100644 --- a/build/karma.conf.js +++ b/build/karma.conf.js @@ -4,7 +4,7 @@ const webpackConfig = require('./webpack.karma.config'); // These should be updated to match the Preview version in package.json whenever a file in that third party directory // is updated. Also, update the matching configuration in constants.js, which is needed for main preview functionality const DOC_STATIC_ASSETS_VERSION = '1.17.0'; -const MEDIA_STATIC_ASSETS_VERSION = '1.30.0'; +const MEDIA_STATIC_ASSETS_VERSION = '1.33.0'; const MODEL3D_STATIC_ASSETS_VERSION = '1.12.0'; const SWF_STATIC_ASSETS_VERSION = '0.112.0'; const TEXT_STATIC_ASSETS_VERSION = '0.114.0'; diff --git a/src/lib/constants.js b/src/lib/constants.js index 92b6edd7a..f29849b44 100644 --- a/src/lib/constants.js +++ b/src/lib/constants.js @@ -94,7 +94,7 @@ export const PDFJS_HEIGHT_PADDING_PX = 5; // Should match VERTICAL_PADDING in pd // These should be updated to match the Preview version in package.json whenever a file in that third party directory // is updated. Also, update the matching configuration in karma.conf.js, which is needed for tests export const DOC_STATIC_ASSETS_VERSION = '1.17.0'; -export const MEDIA_STATIC_ASSETS_VERSION = '1.30.0'; +export const MEDIA_STATIC_ASSETS_VERSION = '1.33.0'; export const MODEL3D_STATIC_ASSETS_VERSION = '1.12.0'; export const SWF_STATIC_ASSETS_VERSION = '0.112.0'; export const TEXT_STATIC_ASSETS_VERSION = '0.114.0'; diff --git a/src/third-party/media/1.33.0/shaka-player.compiled.js b/src/third-party/media/1.33.0/shaka-player.compiled.js new file mode 100644 index 000000000..b606bfc47 --- /dev/null +++ b/src/third-party/media/1.33.0/shaka-player.compiled.js @@ -0,0 +1,438 @@ +(function(){var g={}; +(function(window){var m,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this;function ca(){ca=function(){};ba.Symbol||(ba.Symbol=da)}var da=function(){var a=0;return function(b){return"jscomp_symbol_"+(b||"")+a++}}(); +function ea(){ca();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return fa(this)}});ea=function(){}}function fa(a){var b=0;return ha(function(){return bthis.a?a:Math.min(oa(this.b),oa(this.c))};function qa(){}function ra(){}window.console&&window.console.log.bind&&(qa=console.warn.bind(console));function p(a,b,c,d){this.severity=a;this.category=b;this.code=c;this.data=Array.prototype.slice.call(arguments,3);this.handled=!1}n("shaka.util.Error",p);p.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")};p.Severity={RECOVERABLE:1,CRITICAL:2};p.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9}; +p.Code={UNSUPPORTED_SCHEME:1E3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,UNKNOWN_DATA_URI_ENCODING:1005,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,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,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,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,UNPLAYABLE_PERIOD:4011,RESTRICTIONS_CANNOT_BE_MET:4012,NO_PERIODS:4014,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_COULD_NOT_GUESS_MIME_TYPE:4021, +HLS_MASTER_PLAYLIST_NOT_PROVIDED:4022,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,DASH_UNSUPPORTED_XLINK_ACTUATE:4027,DASH_XLINK_DEPTH_LIMIT:4028,HLS_COULD_NOT_PARSE_SEGMENT_START_TIME:4030,INVALID_STREAMS_CHOSEN:5005,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,LOAD_INTERRUPTED:7E3,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,OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004, +CANNOT_STORE_LIVE_OFFLINE:9005,STORE_ALREADY_IN_PROGRESS:9006,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,CONTENT_UNSUPPORTED_BY_BROWSER:9009,UNSUPPORTED_UPGRADE_REQUEST:9010};var sa=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;function ta(a){var b;a instanceof ta?(ua(this,a.fa),this.Aa=a.Aa,this.ja=a.ja,va(this,a.Oa),this.Y=a.Y,wa(this,xa(a.a)),this.va=a.va):a&&(b=String(a).match(sa))?(ua(this,b[1]||"",!0),this.Aa=ya(b[2]||""),this.ja=ya(b[3]||"",!0),va(this,b[4]),this.Y=ya(b[5]||"",!0),wa(this,b[6]||"",!0),this.va=ya(b[7]||"")):this.a=new za(null)}m=ta.prototype;m.fa="";m.Aa="";m.ja="";m.Oa=null;m.Y="";m.va=""; +m.toString=function(){var a=[],b=this.fa;b&&a.push(Aa(b,Ba,!0),":");if(b=this.ja){a.push("//");var c=this.Aa;c&&a.push(Aa(c,Ba,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.Oa;null!=b&&a.push(":",String(b))}if(b=this.Y)this.ja&&"/"!=b.charAt(0)&&a.push("/"),a.push(Aa(b,"/"==b.charAt(0)?Ca:Da,!0));(b=this.a.toString())&&a.push("?",b);(b=this.va)&&a.push("#",Aa(b,Ea));return a.join("")}; +m.resolve=function(a){var b=new ta(this);"data"===b.fa&&(b=new ta);var c=!!a.fa;c?ua(b,a.fa):c=!!a.Aa;c?b.Aa=a.Aa:c=!!a.ja;c?b.ja=a.ja:c=null!=a.Oa;var d=a.Y;if(c)va(b,a.Oa);else if(c=!!a.Y){if("/"!=d.charAt(0))if(this.ja&&!this.Y)d="/"+d;else{var e=b.Y.lastIndexOf("/");-1!=e&&(d=b.Y.substr(0,e+1)+d)}if(".."==d||"."==d)d="";else if(-1!=d.indexOf("./")||-1!=d.indexOf("/.")){e=0==d.lastIndexOf("/",0);d=d.split("/");for(var f=[],g=0;gb)throw Error("Bad port number "+b);a.Oa=b}else a.Oa=null}function wa(a,b,c){b instanceof za?a.a=b:(c||(b=Aa(b,Fa)),a.a=new za(b))} +function ya(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function Aa(a,b,c){return"string"==typeof a?(a=encodeURI(a).replace(b,Ga),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function Ga(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var Ba=/[#\/\?@]/g,Da=/[#\?:]/g,Ca=/[#\?]/g,Fa=/[#\?@]/g,Ea=/#/g;function za(a){this.b=a||null}za.prototype.a=null;za.prototype.c=null; +za.prototype.add=function(a,b){if(!this.a&&(this.a={},this.c=0,this.b))for(var c=this.b.split("&"),d=0;d=a.j)if(a.c)a.a=1,a.b=a.f;else return Promise.reject();var b=new u;a.a?(Ka(a,b.resolve,a.b*(1+(2*Math.random()-1)*a.i)),a.b*=a.h):b.resolve();a.a++;return b} +function Ia(){return{maxAttempts:2,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:0}}function Ka(a,b,c){if(a.g)if(a.g()||0==c)b();else{var d=Math.min(200,c);La(function(){Ka(this,b,c-d)}.bind(a),d)}else La(b,c)}function La(a,b){window.setTimeout(a,b)};function Ma(a,b,c,d,e){var f=e in d,g;for(g in b){var h=e+"."+g,k=f?d[e]:c[g];if(f||g in a)void 0===b[g]?void 0===k||f?delete a[g]:a[g]=k:k.constructor==Object&&b[g]&&b[g].constructor==Object?(a[g]||(a[g]=k),Ma(a[g],b[g],k,d,h)):typeof b[g]==typeof k&&null!=b[g]&&b[g].constructor==k.constructor&&(a[g]=b[g])}} +function Na(a){function b(a){switch(typeof a){case "undefined":case "boolean":case "number":case "string":case "symbol":case "function":return a;default:if(!a)return a;if(0<=c.indexOf(a))return null;var d=a.constructor==Array;if(a.constructor!=Object&&!d)return null;c.push(a);var f=d?[]:{},g;for(g in a)f[g]=b(a[g]);d&&(f.length=a.length);return f}}var c=[];return b(a)};function Oa(a,b){return a.reduce(function(a,b,e){return b["catch"](a.bind(null,e))}.bind(null,b),Promise.reject())}function Pa(a,b){return a.concat(b)}function Qa(){}function Ra(a){return null!=a}function Sa(a,b,c){return c.indexOf(a)==b};function x(a){this.f=!1;this.a=[];this.b=[];this.c=[];this.g=a||null}n("shaka.net.NetworkingEngine",x);x.RequestType={MANIFEST:0,SEGMENT:1,LICENSE:2,APP:3};x.PluginPriority={Ze:1,af:2,We:3};var Ta={};function Ua(a,b,c){c=c||3;var d=Ta[a];if(!d||c>=d.je)Ta[a]={je:c,he:b}}x.registerScheme=Ua;x.unregisterScheme=function(a){delete Ta[a]};x.prototype.le=function(a){this.b.push(a)};x.prototype.registerRequestFilter=x.prototype.le;x.prototype.Pe=function(a){var b=this.b;a=b.indexOf(a);0<=a&&b.splice(a,1)}; +x.prototype.unregisterRequestFilter=x.prototype.Pe;x.prototype.bd=function(){this.b=[]};x.prototype.clearAllRequestFilters=x.prototype.bd;x.prototype.me=function(a){this.c.push(a)};x.prototype.registerResponseFilter=x.prototype.me;x.prototype.Qe=function(a){var b=this.c;a=b.indexOf(a);0<=a&&b.splice(a,1)};x.prototype.unregisterResponseFilter=x.prototype.Qe;x.prototype.cd=function(){this.c=[]};x.prototype.clearAllResponseFilters=x.prototype.cd; +function Va(a,b){return{uris:a,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:b}}x.prototype.destroy=function(){this.f=!0;this.b=[];this.c=[];for(var a=[],b=0;b=a[b]}.bind(null,b);if(0==b[0]&&0==b[2])return nb(a,!1);if(0==b[1]&&0==b[3])return nb(a,!0);if(c(0)&&c(1)&&c(2)&&c(3))return D(a);throw new p(2,2,2003);}n("shaka.util.StringUtils.fromBytesAutoDetect",ob); +function pb(a){a=encodeURIComponent(a);a=unescape(a);for(var b=new Uint8Array(a.length),c=0;cd||c&&1E3>d)&&!this.a[b].na&&(this.a.splice(b,1),a.close());rb(this.I,.5)}};m.ke=function(){function a(a,c){return"expired"==c}!gb(this.A)&&ib(this.A,a)&&this.h(new p(2,6,6014));this.s.Tb(this.A)}; +function Pb(){var a=[],b=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],c=[{videoCapabilities:b,persistentState:"required",sessionTypes:["persistent-license"]},{videoCapabilities:b}],d={};"org.w3.clearkey com.widevine.alpha com.microsoft.playready com.apple.fps.2_0 com.apple.fps.1_0 com.apple.fps com.adobe.primetime".split(" ").forEach(function(b){var e=navigator.requestMediaKeySystemAccess(b,c).then(function(a){var c=a.getConfiguration().sessionTypes;c= +c?0<=c.indexOf("persistent-license"):!1;0<=navigator.userAgent.indexOf("Tizen 3")&&(c=!1);d[b]={persistentState:c};return a.createMediaKeys()})["catch"](function(){d[b]=null});a.push(e)});return Promise.all(a).then(function(){return d})}m.Nd=function(){for(var a=0;aa.end(0)-a.start(0)?null:a.length?a.end(a.length-1):null}function Tb(a,b){return!a||!a.length||1==a.length&&1E-6>a.end(0)-a.start(0)?!1:b>=a.start(0)&&b<=a.end(a.length-1)}function Ub(a,b){if(!a||!a.length||1==a.length&&1E-6>a.end(0)-a.start(0))return 0;for(var c=0,d=a.length-1;0<=d&&a.end(d)>b;--d)c+=a.end(d)-Math.max(a.start(d),b);return c}function Vb(a){if(!a)return[];for(var b=[],c=0;c>4).toString(16);e+=(g&15).toString(16);c=c.replace(d[0],e)}return c}function Yb(a,b){a.b=new u;a.c=[];var c=new Uint8Array(b);a.a.push(c);a.a.flush();return a.b} +Wb.prototype.g=function(a){var b=new Uint8Array(a.data.byteLength+a.initSegment.byteLength);b.set(a.initSegment,0);b.set(a.data,a.initSegment.byteLength);this.c.push(b)};Wb.prototype.f=function(){var a=yb.apply(null,this.c);this.b.resolve(a)};function Zb(a){this.c=null;this.f=a;this.i=this.g=0;this.h=Infinity;this.b=this.a=null}var E={};n("shaka.text.TextEngine.registerParser",function(a,b){E[a]=b});n("shaka.text.TextEngine.unregisterParser",function(a){delete E[a]});Zb.prototype.destroy=function(){this.f=this.c=null;return Promise.resolve()};Zb.prototype.ze=function(a){this.f=a};Zb.prototype.setDisplayer=Zb.prototype.ze; +Zb.prototype.Kb=function(a){var b={periodStart:0,segmentStart:null,segmentEnd:0};try{return this.c.parseMedia(new Uint8Array(a),b)[0].startTime}catch(c){throw new p(2,2,2009,c);}}; +function $b(a,b,c,d){return Promise.resolve().then(function(){if(this.c&&this.f)if(null==c||null==d)this.c.parseInit(new Uint8Array(b));else{var a={periodStart:this.g,segmentStart:this.g+c,segmentEnd:this.g+d};a=this.c.parseMedia(new Uint8Array(b),a).filter(function(a){return a.startTime>=this.i&&a.startTime=this.b||(a<=this.a&&b>=this.b?this.a=this.b=null:a<=this.a&&bthis.a&&b>=this.b&&(this.b=a))}.bind(this))};function ac(a,b,c){this.g=a;this.f=b;this.l=c;this.b={};this.a=null;this.c={};this.i=new z;this.j=!1;this.h={}} +function bc(){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="vp9",video/mp4; codecs="vp09.00.10.08",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="opus",audio/mp4; codecs="flac",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="av1",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(",").forEach(function(b){a[b]=!!E[b]|| +MediaSource.isTypeSupported(b);var c=b.split(";")[0];a[c]=a[c]||a[b]});return a}m=ac.prototype;m.destroy=function(){this.j=!0;var a=[],b;for(b in this.c){var c=this.c[b],d=c[0];this.c[b]=c.slice(0,1);d&&a.push(d.p["catch"](Qa));for(d=1;dc.end(0)-c.start(0)?null:1==c.length&&0>c.start(0)?0:c.length?c.start(0):null;return c}m.Gb=function(){var a=this.a&&null!=this.a.a?[{start:this.a.a,end:this.a.b}]:[];return{total:Vb(this.g.buffered),audio:Vb(ec(this,"audio")),video:Vb(ec(this,"video")),text:a}};function ec(a,b){try{return a.b[b].buffered}catch(c){return null}} +function fc(a,b,c,d,e){return"text"==b?$b(a.a,c,d,e):a.h[b]?Yb(a.h[b],c).then(function(a){return gc(this,b,this.Rc.bind(this,b,a.buffer))}.bind(a)):gc(a,b,a.Rc.bind(a,b,c))}m.remove=function(a,b,c){return"text"==a?this.a.remove(b,c):gc(this,a,this.Sc.bind(this,a,b,c))};function hc(a,b){return"text"==b?a.a?a.a.remove(0,Infinity):Promise.resolve():gc(a,b,a.Sc.bind(a,b,0,a.f.duration))} +function ic(a,b,c,d,e){return"text"==b?(a.a.g=c,a=a.a,a.i=d,a.h=e,Promise.resolve()):Promise.all([gc(a,b,a.Yc.bind(a,b)),gc(a,b,a.Be.bind(a,b,c)),gc(a,b,a.ye.bind(a,b,d,e))])}m.endOfStream=function(a){return jc(this,function(){a?this.f.endOfStream(a):this.f.endOfStream()}.bind(this))};m.ha=function(a){return jc(this,function(){this.f.duration=a}.bind(this))};m.S=function(){return this.f.duration};m.Rc=function(a,b){this.b[a].appendBuffer(b)}; +m.Sc=function(a,b,c){c<=b?this.Ma(a):this.b[a].remove(b,c)};m.Yc=function(a){var b=this.b[a].appendWindowStart,c=this.b[a].appendWindowEnd;this.b[a].abort();this.b[a].appendWindowStart=b;this.b[a].appendWindowEnd=c;this.Ma(a)};m.gd=function(a){this.g.currentTime-=.001;this.Ma(a)};m.Be=function(a,b){0>b&&(b+=.001);this.b[a].timestampOffset=b;this.Ma(a)};m.ye=function(a,b,c){this.b[a].appendWindowStart=0;this.b[a].appendWindowEnd=c;this.b[a].appendWindowStart=b;this.Ma(a)}; +m.Le=function(a){this.c[a][0].p.reject(new p(2,3,3014,this.g.error?this.g.error.code:0))};m.Ma=function(a){var b=this.c[a][0];b&&(b.p.resolve(),kc(this,a))};function gc(a,b,c){if(a.j)return Promise.reject();c={start:c,p:new u};a.c[b].push(c);if(1==a.c[b].length)try{c.start()}catch(d){"QuotaExceededError"==d.name?c.p.reject(new p(2,3,3017,b)):c.p.reject(new p(2,3,3015,d)),kc(a,b)}return c.p} +function jc(a,b){if(a.j)return Promise.reject();var c=[],d;for(d in a.b){var e=new u,f={start:function(a){a.resolve()}.bind(null,e),p:e};a.c[d].push(f);c.push(e);1==a.c[d].length&&f.start()}return Promise.all(c).then(function(){var a;try{b()}catch(k){var c=Promise.reject(new p(2,3,3015,k))}for(a in this.b)kc(this,a);return c}.bind(a),function(){return Promise.reject()}.bind(a))}function kc(a,b){a.c[b].shift();var c=a.c[b][0];if(c)try{c.start()}catch(d){c.p.reject(new p(2,3,3015,d)),kc(a,b)}};function lc(a,b,c){return c==b||a>=mc&&c==b.split("-")[0]||a>=nc&&c.split("-")[0]==b.split("-")[0]?!0:!1}var mc=1,nc=2;function oc(a){a=a.toLowerCase().split("-");var b=pc[a[0]];b&&(a[0]=b);return a.join("-")} +var pc={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 qc(a,b,c){var d=a.video;return d&&(d.widthb.maxWidth||d.width>c.width||d.heightb.maxHeight||d.height>c.height||d.width*d.heightb.maxPixels)||a.bandwidthb.maxBandwidth?!1:!0}function rc(a,b,c){var d=!1;a.variants.forEach(function(a){var e=a.allowedByApplication;a.allowedByApplication=qc(a,b,c);e!=a.allowedByApplication&&(d=!0)});return d} +function sc(a,b,c,d){d.variants=d.variants.filter(function(d){return a&&a.L&&!Qb(a,d)?!1:tc(d.audio,a,b)&&tc(d.video,a,c)});d.textStreams=d.textStreams.filter(function(a){return!!E[kb(a.mimeType,a.codecs)]})} +function tc(a,b,c){if(!a)return!0;var d=null;b&&b.L&&(d=b.u);b=kb(a.mimeType,a.codecs);var e=kb(a.mimeType,a.codecs),f=a.mimeType,g;for(g in lb){var h=a[g],k=lb[g];h&&(f+="; "+k+'="'+h+'"')}return!(E[e]||MediaSource.isTypeSupported(f)||window.muxjs&&"mp2t"==e.split(";")[0].split("/")[1]&&MediaSource.isTypeSupported(Xb(a.type,e)))||d&&a.encrypted&&0>d.indexOf(b)||c&&(a.mimeType!=c.mimeType||a.codecs.split(".")[0]!=c.codecs.split(".")[0])?!1:!0} +function uc(a){var b=a.audio,c=a.video,d=b?b.codecs:null,e=c?c.codecs:null,f=[];e&&f.push(e);d&&f.push(d);var g=[];c&&g.push(c.mimeType);b&&g.push(b.mimeType);g=g[0]||null;var h=[];b&&h.push(b.kind);c&&h.push(c.kind);h=h[0]||null;var k=[];b&&k.push.apply(k,b.roles);c&&k.push.apply(k,c.roles);k=Xa(k);a={id:a.id,active:!1,type:"variant",bandwidth:a.bandwidth,language:a.language,label:null,kind:h,width:null,height:null,frameRate:null,mimeType:g,codecs:f.join(", "),audioCodec:d,videoCodec:e,primary:a.primary, +roles:k,videoId:null,audioId:null,channelsCount:null,audioBandwidth:null,videoBandwidth:null};c&&(a.videoId=c.id,a.width=c.width||null,a.height=c.height||null,a.frameRate=c.frameRate||null,a.videoBandwidth=c.bandwidth||null);b&&(a.audioId=b.id,a.channelsCount=b.channelsCount,a.audioBandwidth=b.bandwidth||null,a.label=b.label);return a} +function vc(a){return{id:a.id,active:!1,type:"text",bandwidth:0,language:a.language,label:a.label,kind:a.kind||null,width:null,height:null,frameRate:null,mimeType:a.mimeType,codecs:a.codecs||null,audioCodec:null,videoCodec:null,primary:a.primary,roles:a.roles,videoId:null,audioId:null,channelsCount:null,audioBandwidth:null,videoBandwidth:null}}function wc(a){var b=[],c=xc(a.variants);a=a.textStreams;c.forEach(function(a){b.push(uc(a))});a.forEach(function(a){b.push(vc(a))});return b} +function yc(a,b,c){return xc(a.variants).map(function(a){var d=uc(a);a.video&&a.audio?d.active=c==a.video.id&&b==a.audio.id:a.video?d.active=c==a.video.id:a.audio&&(d.active=b==a.audio.id);return d})}function zc(a,b){return a.textStreams.map(function(a){var c=vc(a);c.active=b==a.id;return c})}function Ac(a,b){for(var c=0;c=a.periods[c].startTime)return c;return 0}function Kc(a,b){for(var c=0;c=e.bandwidth/this.a.bandwidthDowngradeTarget&&b<=f&&(c=e)}this.f=Date.now();return c};F.prototype.chooseVariant=F.prototype.chooseVariant;F.prototype.enable=function(){this.c=!0}; +F.prototype.enable=F.prototype.enable;F.prototype.disable=function(){this.c=!1};F.prototype.disable=F.prototype.disable;F.prototype.segmentDownloaded=function(a,b){var c=this.b;if(!(16E3>b)){var d=8E3*b/a,e=a/1E3;c.a+=b;na(c.b,e,d);na(c.c,e,d)}if(null!=this.f&&this.c)a:{if(!this.i){if(!(128E3<=this.b.a))break a;this.i=!0}else if(Date.now()-this.f<1E3*this.a.switchInterval)break a;c=this.chooseVariant();this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate);this.h(c)}}; +F.prototype.segmentDownloaded=F.prototype.segmentDownloaded;F.prototype.getBandwidthEstimate=function(){return this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate)};F.prototype.getBandwidthEstimate=F.prototype.getBandwidthEstimate;F.prototype.setVariants=function(a){this.g=a};F.prototype.setVariants=F.prototype.setVariants;F.prototype.configure=function(a){this.a=a};F.prototype.configure=F.prototype.configure; +function Lc(a,b){return b.filter(function(b){return qc(b,a,{width:Infinity,height:Infinity})}).sort(function(a,b){return a.bandwidth-b.bandwidth})};var Mc="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),Nc="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),Oc=["loop","playbackRate"],Pc=["pause","play"],Qc="adaptation buffering emsg error loading streaming texttrackvisibility timelineregionadded timelineregionenter timelineregionexit trackschanged unloading".split(" "),Rc={drmInfo:20,getAudioLanguages:2,getAudioLanguagesAndRoles:2, +getBufferedInfo:2,getConfiguration:2,getExpiration:2,getManifestUri:2,getPlaybackRate:2,getTextLanguages:2,getTextLanguagesAndRoles:2,getTextTracks:2,getStats:5,getVariantTracks:2,isAudioOnly:10,isBuffering:1,isInProgress:1,isLive:10,isTextTrackVisible:1,keySystem:10,seekRange:1},Sc={getPlayheadTimeAsDate:1,getPresentationStartTimeAsDate:20},Tc=[["getConfiguration","configure"]],Uc=[["isTextTrackVisible","setTextTrackVisibility"]],Zc="addTextTrack cancelTrickPlay configure resetConfiguration retryStreaming selectAudioLanguage selectTextLanguage selectTextTrack selectVariantTrack setTextTrackVisibility trickPlay".split(" "), +$c=["load","unload"];function ad(a){return JSON.stringify(a,function(a,c){if("function"!=typeof c){if(c instanceof Event||c instanceof B){var b={},e;for(e in c){var f=c[e];f&&"object"==typeof f?"detail"==e&&(b[e]=f):e in Event||(b[e]=f)}return b}if(c instanceof TimeRanges)for(b={__type__:"TimeRanges",length:c.length,start:[],end:[]},e=0;ec?"-Infinity":"Infinity":c;return b}})} +function bd(a){return JSON.parse(a,function(a,c){return"NaN"==c?NaN:"-Infinity"==c?-Infinity:"Infinity"==c?Infinity:c&&"object"==typeof c&&"TimeRanges"==c.__type__?cd(c):c})}function cd(a){return{length:a.length,start:function(b){return a.start[b]},end:function(b){return a.end[b]}}};function dd(a,b,c,d,e,f){this.K=a;this.g=b;this.L=c;this.j=!1;this.A=d;this.I=e;this.u=f;this.b=this.h=!1;this.w="";this.i=null;this.l=this.wc.bind(this);this.m=this.Jd.bind(this);this.a={video:{},player:{}};this.s=0;this.c={};this.f=null}var ed=!1,G=null;m=dd.prototype;m.destroy=function(){fd(this);G&&gd(this);this.I=this.A=this.g=null;this.b=this.h=!1;this.m=this.l=this.f=this.c=this.a=this.i=null;return Promise.resolve()};m.X=function(){return this.b};m.Xb=function(){return this.w}; +m.init=function(){if(window.chrome&&chrome.cast&&chrome.cast.isAvailable){delete window.__onGCastApiAvailable;this.h=!0;this.g();var a=new chrome.cast.SessionRequest(this.K);a=new chrome.cast.ApiConfig(a,this.xc.bind(this),this.Qd.bind(this),"origin_scoped");chrome.cast.initialize(a,function(){},function(){});ed&&setTimeout(this.g.bind(this),20);(a=G)&&a.status!=chrome.cast.SessionStatus.STOPPED?this.xc(a):G=null}else window.__onGCastApiAvailable=function(a){a&&this.init()}.bind(this)}; +m.$b=function(a){this.i=a;this.b&&hd({type:"appData",appData:this.i})};m.cast=function(a){if(!this.h)return Promise.reject(new p(1,8,8E3));if(!ed)return Promise.reject(new p(1,8,8001));if(this.b)return Promise.reject(new p(1,8,8002));this.f=new u;chrome.cast.requestSession(this.Ub.bind(this,a),this.vc.bind(this));return this.f};m.tb=function(){this.b&&(fd(this),G&&(gd(this),G.stop(function(){},function(){}),G=null))}; +m.get=function(a,b){if("video"==a){if(0<=Pc.indexOf(b))return this.Hc.bind(this,a,b)}else if("player"==a){if(Sc[b]&&!this.get("player","isLive")())return function(){};if(0<=Zc.indexOf(b))return this.Hc.bind(this,a,b);if(0<=$c.indexOf(b))return this.oe.bind(this,a,b);if(Rc[b])return this.Ec.bind(this,a,b)}return this.Ec(a,b)};m.set=function(a,b,c){this.a[a][b]=c;hd({type:"set",targetName:a,property:b,value:c})}; +m.Ub=function(a,b){G=b;b.addUpdateListener(this.l);b.addMessageListener("urn:x-cast:com.google.shaka.v2",this.m);this.wc();hd({type:"init",initState:a,appData:this.i});this.f.resolve()};m.vc=function(a){var b=8003;switch(a.code){case "cancel":b=8004;break;case "timeout":b=8005;break;case "receiver_unavailable":b=8006}this.f.reject(new p(2,8,b,a))};m.Ec=function(a,b){return this.a[a][b]};m.Hc=function(a,b){hd({type:"call",targetName:a,methodName:b,args:Array.prototype.slice.call(arguments,2)})}; +m.oe=function(a,b){var c=Array.prototype.slice.call(arguments,2),d=new u,e=this.s.toString();this.s++;this.c[e]=d;hd({type:"asyncCall",targetName:a,methodName:b,args:c,id:e});return d};m.xc=function(a){var b=this.u();this.f=new u;this.j=!0;this.Ub(b,a)};m.Qd=function(a){ed="available"==a;this.g()};function gd(a){var b=G;b.removeUpdateListener(a.l);b.removeMessageListener("urn:x-cast:com.google.shaka.v2",a.m)} +m.wc=function(){var a=G?"connected"==G.status:!1;if(this.b&&!a){this.I();for(var b in this.a)this.a[b]={};fd(this)}this.w=(this.b=a)?G.receiver.friendlyName:"";this.g()};function fd(a){for(var b in a.c){var c=a.c[b];delete a.c[b];c.reject(new p(1,7,7E3))}} +m.Jd=function(a,b){var c=bd(b);switch(c.type){case "event":var d=c.targetName,e=c.event;this.A(d,new B(e.type,e));break;case "update":e=c.update;for(d in e){c=this.a[d]||{};for(var f in e[d])c[f]=e[d][f]}this.j&&(this.L(),this.j=!1);break;case "asyncComplete":if(d=c.id,f=c.error,c=this.c[d],delete this.c[d],c)if(f){d=new p(f.severity,f.category,f.code);for(e in f)d[e]=f[e];c.reject(d)}else c.resolve()}};function hd(a){a=ad(a);G.sendMessage("urn:x-cast:com.google.shaka.v2",a,function(){},ra)};function H(){this.Bb=new ab;this.jb=this}H.prototype.addEventListener=function(a,b){this.Bb.push(a,b)};H.prototype.removeEventListener=function(a,b){this.Bb.remove(a,b)};H.prototype.dispatchEvent=function(a){for(var b=this.Bb.get(a.type)||[],c=0;cr)if(w+1=r)break;r=Math.ceil((r-t)/y)-1}else{if(Infinity==k)break;else if(t/e>=k)break;r=Math.ceil((k*e-t)/y)-1}0this.G.byteLength&&Od();var b=new Uint8Array(this.G.buffer,this.G.byteOffset+this.a,a);this.a+=a;return new Uint8Array(b)};N.prototype.readBytes=N.prototype.Pa; +N.prototype.F=function(a){this.a+a>this.G.byteLength&&Od();this.a+=a};N.prototype.skip=N.prototype.F;N.prototype.Kc=function(a){this.aa||a>this.G.byteLength)&&Od();this.a=a};N.prototype.seek=N.prototype.seek;N.prototype.Wb=function(){for(var a=this.a;this.ea()&&0!=this.G.getUint8(this.a);)this.a+=1;a=new Uint8Array(this.G.buffer,this.G.byteOffset+a,this.a-a);this.a+=1;return D(a)}; +N.prototype.readTerminatedString=N.prototype.Wb;function Od(){throw new p(2,3,3E3);};function O(){this.c=[];this.b=[];this.a=!1}n("shaka.util.Mp4Parser",O);O.prototype.B=function(a,b){var c=Pd(a);this.c[c]=0;this.b[c]=b;return this};O.prototype.box=O.prototype.B;O.prototype.W=function(a,b){var c=Pd(a);this.c[c]=1;this.b[c]=b;return this};O.prototype.fullBox=O.prototype.W;O.prototype.stop=function(){this.a=!0};O.prototype.stop=O.prototype.stop; +O.prototype.parse=function(a,b){var c=new Uint8Array(a);c=new N(new DataView(c.buffer,c.byteOffset,c.byteLength),0);for(this.a=!1;c.ea()&&!this.a;)this.xb(0,c,b)};O.prototype.parse=O.prototype.parse; +O.prototype.xb=function(a,b,c){var d=b.U(),e=b.C(),f=b.C();switch(e){case 0:e=b.G.byteLength-d;break;case 1:e=b.Qa()}var g=this.b[f];if(g){var h=null,k=null;1==this.c[f]&&(k=b.C(),h=k>>>24,k&=16777215);f=d+e;c&&f>b.G.byteLength&&(f=b.G.byteLength);f-=b.U();b=0>>31;l&=2147483647;var w=d.o.C();d.o.F(4);if(1==q)throw new p(2,3,3006);e.push(new M(e.length,g/f-b,(g+w)/f-b,function(){return c},a,a+l-1));g+=w;a+=l}d.la.stop();return e};function Q(a){this.a=a}n("shaka.media.SegmentIndex",Q);Q.prototype.destroy=function(){this.a=null;return Promise.resolve()};Q.prototype.destroy=Q.prototype.destroy;Q.prototype.find=function(a){for(var b=this.a.length-1;0<=b;--b){var c=this.a[b];if(a>=c.startTime&&aa||a>=this.a.length?null:this.a[a]};Q.prototype.get=Q.prototype.get;Q.prototype.offset=function(a){for(var b=0;bf.startTime?0==c&&b.push(f):(.1a){this.a.splice(0,b);return}this.a=[]};Q.prototype.evict=Q.prototype.Fb; +function Ud(a,b){for(;a.a.length;){var c=a.a[a.a.length-1];if(c.startTime>=b)a.a.pop();else break}for(;a.a.length;)if(c=a.a[0],0>=c.endTime)a.a.shift();else break;0!=a.a.length&&(c=a.a[0],c.startTime=c&&!(b&1<<8-c);c++);if(8a||c&&a>=c?null:Math.floor(a/d)},getSegmentReference:function(a){var b=a*d,q=b+d;c&&(q=Math.min(q,c));return 0>q||c&&b>=c?null:new M(a,b,q,function(){var c=Gd(g,k,a+e,h,b*f);return C(l,[c])},0,null)}}} +function pe(a,b){for(var c=[],d=0;da.l||(a.f=window.setTimeout(a.Ke.bind(a),1E3*Math.max(Math.max(3,a.l)-b,0)))} +function Ce(a,b,c){b=b||{contentType:"",mimeType:"",codecs:"",containsEmsgBoxes:!1,frameRate:void 0,Rb:null};c=c||b.ba;var d=J(a,"BaseURL").map(td),e=a.getAttribute("contentType")||b.contentType,f=a.getAttribute("mimeType")||b.mimeType,g=a.getAttribute("codecs")||b.codecs,h=K(a,"frameRate",Ad)||b.frameRate,k=!!J(a,"InbandEventStream").length,l=J(a,"AudioChannelConfiguration");l=He(l)||b.Rb;e||(e=Fe(f,g));return{ba:C(c,d),bb:sd(a,"SegmentBase")||b.bb,qa:sd(a,"SegmentList")||b.qa,eb:sd(a,"SegmentTemplate")|| +b.eb,width:K(a,"width",zd)||b.width,height:K(a,"height",zd)||b.height,contentType:e,mimeType:f,codecs:g,frameRate:h,containsEmsgBoxes:k||b.containsEmsgBoxes,id:a.getAttribute("id"),Rb:l}} +function He(a){for(var b=0;b>=1;return a}}}return null}function Ge(a){var b=0+(a.bb?1:0);b+=a.qa?1:0;b+=a.eb?1:0;if(0==b)return"text"==a.contentType||"application"==a.contentType?!0:!1;1!=b&&(a.bb&&(a.qa=null),a.eb=null);return!0}function Ie(a,b,c,d){b=C(b,[c]);b=Va(b,a.b.retryParameters);b.method=d;return a.a.networkingEngine.request(0,b).then(function(a){if("HEAD"==d){if(!a.headers||!a.headers.date)return 0;a=a.headers.date}else a=D(a.data);a=Date.parse(a);return isNaN(a)?0:a-Date.now()})} +function Ae(a,b,c,d){c=c.map(function(a){return{scheme:a.getAttribute("schemeIdUri"),value:a.getAttribute("value")}});var e=a.b.dash.clockSyncUri;d&&!c.length&&e&&c.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:e});return Oa(c,function(a){var c=a.value;switch(a.scheme){case "urn:mpeg:dash:utc:http-head:2014":case "urn:mpeg:dash:utc:http-head:2012":return Ie(this,b,c,"HEAD");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 Ie(this, +b,c,"GET");case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":return a=Date.parse(c),isNaN(a)?0:a-Date.now();case "urn:mpeg:dash:utc:http-ntp:2014":case "urn:mpeg:dash:utc:ntp:2014":case "urn:mpeg:dash:utc:sntp:2014":return Promise.reject();default:return Promise.reject()}}.bind(a))["catch"](function(){return 0})} +m.de=function(a,b,c){var d=c.getAttribute("schemeIdUri")||"",e=c.getAttribute("value")||"",f=K(c,"timescale",zd)||1;J(c,"Event").forEach(function(c){var g=K(c,"presentationTime",zd)||0,k=K(c,"duration",zd)||0;g=g/f+a;k=g+k/f;null!=b&&(g=Math.min(g,a+b),k=Math.min(k,a+b));c={schemeIdUri:d,value:e,startTime:g,endTime:k,id:c.getAttribute("id")||"",eventElement:c};this.a.onTimelineRegionAdded(c)}.bind(this))}; +m.qe=function(a,b,c){a=Va(a,this.b.retryParameters);null!=b&&(a.headers.Range="bytes="+b+"-"+(null!=c?c:""));return this.a.networkingEngine.request(1,a).then(function(a){return a.data})};function Fe(a,b){return E[kb(a,b)]?"text":a.split("/")[0]}re.mpd=ue;qe["application/dash+xml"]=ue;function Je(a,b,c,d){this.uri=a;this.type=b;this.a=c;this.segments=d||null}function Ke(a,b,c,d){this.id=a;this.name=b;this.a=c;this.value=d||null}Ke.prototype.toString=function(){function a(a){return a.name+'="'+a.value+'"'}return this.value?"#"+this.name+":"+this.value:0b.length||"data"!=b[0])throw new p(2,1,1004,a);b=b.slice(1).join(":").split(",");if(2>b.length)throw new p(2,1,1004,a);var c=b[0];b=window.decodeURIComponent(b.slice(1).join(","));c=c.split(";");var d=null;1l.Qb&&(l.stream.presentationTimeOffset=-b,l.cb.offset(b))}else for(k in this.b.ha(h),this.a)l=this.a[k],l.stream.presentationTimeOffset=b,l.cb.offset(-b),Ud(l.cb,h);this.m={presentationTimeline:this.b,periods:[a],offlineSessionIds:[],minBufferTime:0}}.bind(a))} +function mf(a,b){var c=b.a,d=Oe(b.a,"EXT-X-MEDIA").filter(function(a){return"SUBTITLES"==nf(a,"TYPE")}.bind(a)).map(function(a){return of(this,a)}.bind(a));return Promise.all(d).then(function(a){var d=Oe(c,"EXT-X-STREAM-INF").map(function(a){return pf(this,a,b)}.bind(this));return Promise.all(d).then(function(b){return{startTime:0,variants:b.reduce(Pa,[]),textStreams:a}}.bind(this))}.bind(a))} +function pf(a,b,c){var d=Me(b,"CODECS","avc1.42E01E,mp4a.40.2").split(","),e=b.getAttribute("RESOLUTION"),f=null,g=null,h=Me(b,"FRAME-RATE"),k=Number(nf(b,"BANDWIDTH"));if(e){var l=e.value.split("x");f=l[0];g=l[1]}c=Oe(c.a,"EXT-X-MEDIA");var q=Me(b,"AUDIO"),w=Me(b,"VIDEO");q?c=Qe(c,"AUDIO",q):w&&(c=Qe(c,"VIDEO",w));if(l=qf("text",d)){var r=Me(b,"SUBTITLES");r&&(r=Qe(c,"SUBTITLES",r),r.length&&(a.u[r[0].id].stream.codecs=l));d.splice(d.indexOf(l),1)}c=c.map(function(a){return rf(this,a,d)}.bind(a)); +var t=[],y=[];return Promise.all(c).then(function(a){q?t=a:w&&(y=a);a=!1;if(t.length||y.length)if(t.length)if(nf(b,"URI")==t[0].Zb){var c="audio";a=!0}else c="video";else c="audio";else 1==d.length?(c=qf("video",d),c=e||h||c?"video":"audio"):(c="video",d=[d.join(",")]);return a?Promise.resolve():sf(this,b,d,c)}.bind(a)).then(function(a){a&&("audio"==a.stream.type?t=[a]:y=[a]);y&&tf(y);t&&tf(t);return uf(this,t,y,k,f,g,h)}.bind(a))} +function tf(a){a.forEach(function(a){var b=a.stream.codecs.split(",");b=b.filter(function(a){return"mp4a.40.34"!=a});a.stream.codecs=b.join(",")})} +function uf(a,b,c,d,e,f,g){c.forEach(function(a){if(a=a.stream)a.width=Number(e)||void 0,a.height=Number(f)||void 0,a.frameRate=Number(g)||void 0}.bind(a));b.length||(b=[null]);c.length||(c=[null]);for(var h=[],k=0;k>4,0!=d&&2!=d||b(),3==d&&(d=a.$(),a.F(d)),1!=a.C()>>8)a.seek(c+188),d=a.$(),71!=d&&(a.seek(c+192),d=a.$()),71!=d&&(a.seek(c+204),d=a.$()),71!=d&&b(),a.Kc(1);else return a.F(3),c=a.$()>>6,0!=c&&1!=c||b(),0==a.$()&&b(),c=a.$(),d=a.ab(),a=a.ab(),(1073741824*((c&14)>>1)+((d&65534)<<14|(a&65534)>>1))/9E4} +function qf(a,b){for(var c=If[a],d=0;dc.end(0)-c.start(0))){var d=.1;/(Edge\/|Trident\/|Tizen)/.test(navigator.userAgent)&&(d=.5);for(var e=0;eb&&(0==e||c.end(e-1)-b<=d)){d=e;break a}}d=null}if(null==d){if(c=this.a.currentTime, +b=this.a.buffered,3>this.a.readyState&&0=b.start(d)&&c=f)){f=e-b;a=f<=a;var g=!1;.001>f||(a||this.c||(this.c=!0,b=new B("largegap",{currentTime:b,gapSize:f}),b.cancelable=!0,this.w(b),this.s.jumpLargeGaps&& +!b.defaultPrevented&&(g=!0)),!a&&!g)||(0!=d&&c.end(d-1),this.a.currentTime=e)}}}}};function Lf(a,b,c){this.a=a;this.j=b;this.i=c;this.b=new z;this.g=1;this.h=!1;this.c=null;this.f=new qb(this.Bd.bind(this));0b?0:b;!a.h&&0>b&&(a.c=new qb(function(){this.a.currentTime+=b/4}.bind(a)),sb(a.c,.25))}m.Pd=function(){var a=this.h||0>this.g?0:this.g;this.a.playbackRate&&this.a.playbackRate!=a&&Pf(this,this.a.playbackRate)}; +m.zc=function(){this.b.ia(this.a,"timeupdate");this.f.cancel();.001>Math.abs(this.a.currentTime-this.i)?this.Ac():(db(this.b,this.a,"seeking",this.Ac.bind(this)),this.a.currentTime=this.i)};m.Ac=function(){A(this.b,this.a,"seeking",this.j.bind(this))};m.Bd=function(){this.i=this.a.currentTime;this.j()};function Of(a,b,c){a.a.currentTime=c;var d=0,e=function(){!this.a||10<=d++||this.a.currentTime!=b||(this.a.currentTime=c,setTimeout(e,100))}.bind(a);setTimeout(e,100)};function Qf(a,b,c,d,e,f){this.b=a;this.c=b;this.h=c;this.i=e;this.f=null;this.g=new Kf(a,b,c,f);b=this.Rd.bind(this);null==d&&(d=this.c.presentationTimeline,d=Infinity>d.S()?d.Va():d.Ha());d=Rf(this,Sf(this,d));this.a=new Lf(a,b,d);this.f=new qb(this.Od.bind(this));sb(this.f,.25)}m=Qf.prototype;m.destroy=function(){var a=Promise.all([this.a.destroy(),this.g.destroy()]);this.g=this.a=null;null!=this.f&&(this.f.cancel(),this.f=null);this.i=this.h=this.c=this.b=null;return a}; +function Tf(a){var b=Mf(a.a);0=c?c-a.h.durationBackoff:b}function Uf(a,b){var c=Tb.bind(null,a.b.buffered),d=1*Math.max(a.c.minBufferTime||0,a.h.rebufferingGoal),e=a.c.presentationTimeline,f=e.Ga(0),g=e.Ha(),h=e.S(),k=e.Ga(d),l=e.Ga(5);d=e.Ga(d+5);return b>=h?Rf(a,b):b>g?g:b=k||c(b)?b:d}function Sf(a,b){var c=a.c.presentationTimeline.Va();if(bc?c:b};function Vf(a,b,c,d,e,f,g){this.a=a;this.w=b;this.g=c;this.u=d;this.l=e;this.h=f;this.A=g;this.c=[];this.j=new z;this.b=!1;this.i=-1;this.f=null;Wf(this)}Vf.prototype.destroy=function(){var a=this.j?this.j.destroy():Promise.resolve();this.j=null;Xf(this);this.A=this.h=this.l=this.u=this.g=this.w=this.a=null;this.c=[];return a}; +Vf.prototype.s=function(a){if(!this.c.some(function(b){return b.info.schemeIdUri==a.schemeIdUri&&b.info.startTime==a.startTime&&b.info.endTime==a.endTime})){var b={info:a,status:1};this.c.push(b);var c=new B("timelineregionadded",{detail:Yf(a)});this.h(c);this.m(!0,b)}};function Yf(a){var b=Na(a);b.eventElement=a.eventElement;return b} +Vf.prototype.m=function(a,b){var c=b.info.startTime>this.a.currentTime?1:b.info.endTime=d;c="ended"==this.w.readyState;b=b||this.a.ended||c;this.b?(c=1*Math.max(this.g.minBufferTime||0,this.u.rebufferingGoal),(b||a>=c)&&0!=this.b&&(this.b=!1,this.l(!1))):!b&&.5>a&&1!=this.b&&(this.b=!0,this.l(!0));this.c.forEach(this.m.bind(this,!1))};function Zf(a,b){this.a=b;this.b=a;this.h=null;this.i=1;this.m=Promise.resolve();this.g=[];this.j={};this.c={};this.s=!1;this.A=null;this.w=this.f=this.l=!1;this.u=0}m=Zf.prototype;m.destroy=function(){for(var a in this.c)$f(this.c[a]);this.h=this.c=this.j=this.g=this.m=this.b=this.a=null;this.f=!0;return Promise.resolve()}; +m.configure=function(a){this.h=a;this.A=new Ha({maxAttempts:Math.max(a.retryParameters.maxAttempts,2),baseDelay:a.retryParameters.baseDelay,backoffFactor:a.retryParameters.backoffFactor,fuzzFactor:a.retryParameters.fuzzFactor,timeout:0},!0)};m.init=function(){var a=Tf(this.a.Na);a=this.a.uc(this.b.periods[Jc(this.b,a)]);return a.variant||a.text?ag(this,a).then(function(){this.a&&this.a.Fd&&this.a.Fd()}.bind(this)):Promise.reject(new p(2,5,5005))}; +function S(a){var b=Tf(a.a.Na);return a.b.periods[Jc(a.b,b)]}function bg(a){var b=a.c.video||a.c.audio;return b?a.b.periods[b.xa]:null}function cg(a){return dg(a,"audio")}function eg(a){return dg(a,"video")}function dg(a,b){var c=a.c[b];return c?c.pa||c.stream:null}function fg(a,b){hc(a.a.J,"text");a.u++;a.w=!1;var c=a.u;a.a.J.init({text:b});return gg(a,[b]).then(function(){if(this.u==c&&!this.c.text&&!this.w){var a=Tf(this.a.Na);this.c.text=hg(b,Jc(this.b,a));ig(this,this.c.text,0)}}.bind(a))} +function jg(a,b){var c=a.c.video;if(c){var d=c.stream;if(d)if(b){var e=d.trickModeVideo;if(e){var f=c.pa;f||(kg(a,e,!1),c.pa=d)}}else if(f=c.pa)c.pa=null,kg(a,f,!0)}}function lg(a,b,c){b.video&&kg(a,b.video,c);b.audio&&kg(a,b.audio,c)} +function kg(a,b,c){var d=a.c[b.type];if(!d&&"text"==b.type&&a.h.ignoreTextStreamFailures)fg(a,b);else if(d){var e=Kc(a.b,b);c&&e!=d.xa?mg(a):(d.pa&&(b.trickModeVideo?(d.pa=b,b=b.trickModeVideo):d.pa=null),(e=a.g[e])&&e.Ra&&(e=a.j[b.id])&&e.Ra&&d.stream!=b&&("text"==b.type&&cc(a.a.J,kb(b.mimeType,b.codecs)),d.stream=b,d.vb=!0,c&&(d.ua?d.Ab=!0:d.ya?(d.sa=!0,d.Ab=!0):($f(d),ng(a,d,!0)))))}} +function og(a){var b=Tf(a.a.Na);Object.keys(a.c).every(function(a){var c=this.a.J;"text"==a?(a=c.a,a=b>=a.a&&bb?a.a.J.ha(b):a.a.J.ha(Math.pow(2,32))}m.Me=function(a){if(!this.f&&!a.ya&&null!=a.ra&&!a.ua)if(a.ra=null,a.sa)ng(this,a,a.Ab);else{try{var b=rg(this,a);null!=b&&(ig(this,a,b),a.Wa=!1)}catch(c){sg(this,c);return}b=hb(this.c);tg(this,a);b.every(function(a){return a.endOfStream})&&this.a.J.endOfStream().then(function(){var a=this.a.J.S();a=a.b.presentationTimeline.S())return b.endOfStream=!0,null;b.endOfStream=!1;b.xa=f;if(f!=e)return null;if(g>=h)return.5;d=a.a.J;f=b.type;d="text"==f?d.a.b:Sb(ec(d, +f));b.ka&&b.stream==b.Ka?(f=b.ka.position+1,d=ug(a,b,e,f)):(f=b.ka?b.stream.findSegmentPosition(Math.max(0,a.b.periods[Kc(a.b,b.Ka)].startTime+b.ka.endTime-a.b.periods[e].startTime)):b.stream.findSegmentPosition(Math.max(0,(d||c)-a.b.periods[e].startTime)),null==f?d=null:(g=null,null==d&&(g=ug(a,b,e,Math.max(0,f-1))),d=g||ug(a,b,e,f)));if(!d)return 1;b.Ic=0;vg(a,b,c,e,d);return null} +function ug(a,b,c,d){c=a.b.periods[c];b=b.stream.getSegmentReference(d);if(!b)return null;d=a.b.presentationTimeline;a=d.Ja();d=d.Ia();return c.startTime+b.endTimed?null:b} +function vg(a,b,c,d,e){var f=a.b.periods[d],g=b.stream,h=a.b.presentationTimeline.S(),k=a.b.periods[d+1];d=wg(a,b,d,Math.max(0,f.startTime-.1),k?k.startTime:h);b.ya=!0;b.vb=!1;h=xg(a,e);Promise.all([d,h]).then(function(a){if(!this.f&&!this.l)return yg(this,b,c,f,g,e,a[1])}.bind(a)).then(function(){this.f||this.l||(b.ya=!1,b.Yb=!1,b.sa||this.a.$a(),ig(this,b,0),zg(this,g))}.bind(a))["catch"](function(a){this.f||this.l||(b.ya=!1,"text"==b.type&&this.h.ignoreTextStreamFailures?delete this.c.text:3017== +a.code?Ag(this,b,a):(b.Wa=!0,a.severity=2,sg(this,a)))}.bind(a))}function Ag(a,b,c){if(!hb(a.c).some(function(a){return a!=b&&a.Yb})){var d=Math.round(100*a.i);if(20=c?Promise.resolve():a.a.J.remove(b.type,e,e+c).then(function(){}.bind(a))}function zg(a,b){if(!a.s&&(a.s=hb(a.c).every(function(a){return"text"==a.type?!0:!a.sa&&!a.ua&&a.ka}),a.s)){var c=Kc(a.b,b);a.g[c]||qg(a,c).then(function(){this.a.tc()}.bind(a))["catch"](Qa);for(c=0;c=b.status&&202!=b.status)b.responseURL&&(a=b.responseURL),c({uri:a,data:b.response,headers:e,fromCache:!!e["x-shaka-from-cache"]}); +else{var f=null;try{f=ob(b.response)}catch(l){}d(new p(401==b.status||403==b.status?2:1,1,1001,a,b.status,f,e))}};e.onerror=function(){d(new p(1,1,1002,a))};e.ontimeout=function(){d(new p(1,1,1003,a))};for(var f in b.headers)e.setRequestHeader(f,b.headers[f]);e.send(b.body)})}n("shaka.net.HttpPlugin",Dg);Dg.c=window.XMLHttpRequest;Ua("http",Dg,1);Ua("https",Dg,1);function Eg(){this.b=null;this.a=[]}function Fg(){if(!window.indexedDB)return Promise.resolve();var a=window.indexedDB.deleteDatabase("shaka_offline_db"),b=new u;a.onsuccess=function(){b.resolve()};a.onerror=Gg.bind(null,a,b);return b}Eg.prototype.init=function(a){return Hg(a).then(function(a){this.b=a}.bind(this))}; +Eg.prototype.destroy=function(){return Promise.all(this.a.map(function(a){try{a.transaction.abort()}catch(b){}return a.N["catch"](Qa)})).then(function(){this.b&&(this.b.close(),this.b=null)}.bind(this))};Eg.prototype.Fa=function(a){return Ig(this,"manifest-v3",a)};function Jg(a,b){return Kg(a,b)}function Ig(a,b,c){var d;return Lg(a,b,"readonly",function(a){d=a.get(c)}).then(function(){return d.result})} +function Kg(a,b){return Lg(a,"manifest-v3","readonly",function(a){a.openCursor().onsuccess=function(a){if(a=a.target.result)b(a.key,a.value),a["continue"]()}})}function Mg(a,b,c){return Lg(a,"manifest-v3","readwrite",function(a){a.put(c,b)})}function Ng(a,b,c){var d;return Lg(a,b,"readwrite",function(a){a.add(c).onsuccess=function(a){d=a.target.result}}).then(function(){return d})} +function Og(a,b,c,d){return Lg(a,b,"readwrite",function(a){c.forEach(function(b){a["delete"](b).onsuccess=function(){d&&d(b)}})})}function Lg(a,b,c,d){var e={transaction:a.b.transaction([b],c),N:new u};e.transaction.oncomplete=function(){a.a.splice(a.a.indexOf(e),1);e.N.resolve()};e.transaction.onabort=function(b){a.a.splice(a.a.indexOf(e),1);Gg(e.transaction,e.N,b)};e.transaction.onerror=Pg();b=e.transaction.objectStore(b);d(b);a.a.push(e);return e.N} +function Qg(a,b,c){function d(){var b=f.pop();b?e(b,d):(a.reject(new p(1,9,9010,g)),c.abort())}function e(a,b){c.objectStore(a).openCursor().onsuccess=function(a){(a=a.target.result)?(g.push(a.value.originalManifestUri),a["continue"]()):b()}}var f=["manifest","manifest-v2"].filter(function(a){return b.objectStoreNames.contains(a)}),g=[];d()}function Gg(a,b,c){b.reject(a.error?new p(2,9,9001,a.error):new p(2,9,9002));c.preventDefault()} +function Hg(a){function b(){return new Promise(function(a){setTimeout(a,1E3)})}var c=a||0,d=0=a.length)return Promise.resolve();var d=a[b++];return Wg(this,d).then(c)}.bind(this);return c()}.bind(a));a.b={};a.g=Promise.all(c).then(function(){return Ng(this.h,"manifest-v3",b)}.bind(a)).then(function(a){this.i=[];return a}.bind(a));return a.g} +function Wg(a,b){var c=Va(b.uris,a.m);if(0!=b.O||null!=b.D)c.headers.Range="bytes="+b.O+"-"+(null==b.D?"":b.D);var d;return a.j.request(1,c).then(function(a){if(!this.a)return Promise.reject(new p(2,9,9002));d=a.data.byteLength;return Ng(this.h,"segment-v3",{data:a.data})}.bind(a)).then(function(a){if(!this.a)return Promise.reject(new p(2,9,9002));this.a.size+=d;this.f+=null==b.D?b.jc:b.D-b.O+1;this.i.push(a);b.Vd(a);Xg(this)}.bind(a))}Sg.prototype.s=function(a){this.c+=null==a.D?a.jc:a.D-a.O+1}; +function Xg(a){var b=0==a.c?0:a.f/a.c,c=a.a.size;a.l.forEach(function(a){a(b,c)})};function Yg(a){return(a=/^offline:manifest\/([0-9]+)$/.exec(a))?Number(a[1]):null};function Zg(a,b,c){var d=void 0==b.expiration?Infinity:b.expiration,e=b.presentationTimeline.S();b=wc(b.periods[0]);return{offlineUri:null,originalManifestUri:a,duration:e,size:0,expiration:d,tracks:b,appMetadata:c}}function $g(a,b){var c=ah(b.periods[0],[],new R(null,0)),d=b.appMetadata||{};c=wc(c);return{offlineUri:a,originalManifestUri:b.originalManifestUri,duration:b.duration,size:b.size,expiration:b.expiration,tracks:c,appMetadata:d}} +function ah(a,b,c){var d=a.streams.filter(bh),e=a.streams.filter(ch);b=dh(d,e,b);d=a.streams.filter(eh).map(fh);a.streams.forEach(function(a,b){var d=a.segments.map(function(a,b){return gh(b,a)});c.Za(d,0==b)});return{startTime:a.startTime,variants:b,textStreams:d}}function gh(a,b){var c="offline:segment/"+b.dataKey;return new M(a,b.startTime,b.endTime,function(){return[c]},0,null)} +function dh(a,b,c){var d={},e=[];e.push.apply(e,a);e.push.apply(e,b);e.forEach(function(a){a.variantIds.forEach(function(a){d[a]||(d[a]={id:a,language:"",primary:!1,audio:null,video:null,bandwidth:0,drmInfos:c,allowedByApplication:!0,allowedByKeySystem:!0})})});a.forEach(function(a){var b=fh(a);a.variantIds.forEach(function(a){a=d[a];a.language=b.language;a.primary=a.primary||b.primary;a.audio=b})});b.forEach(function(a){var b=fh(a);a.variantIds.forEach(function(a){a=d[a];a.primary=a.primary||b.primary; +a.video=b})});return hb(d)} +function fh(a){var b=a.segments.map(function(a,b){return gh(b,a)});b=new Q(b);b={id:a.id,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:b.find.bind(b),getSegmentReference:b.get.bind(b),initSegmentReference:null,presentationTimeOffset:a.presentationTimeOffset,mimeType:a.mimeType,codecs:a.codecs,width:a.width||void 0,height:a.height||void 0,frameRate:a.frameRate||void 0,kind:a.kind,encrypted:a.encrypted,keyId:a.keyId,language:a.language,label:a.label||null,type:a.contentType,primary:a.primary, +trickModeVideo:null,containsEmsgBoxes:!1,roles:[],channelsCount:null};null!=a.initSegmentKey&&(b.initSegmentReference=hh(a.initSegmentKey));return b}function hh(a){var b="offline:segment/"+a;return new L(function(){return[b]},0,null)}function bh(a){return"audio"==a.contentType}function ch(a){return"video"==a.contentType}function eh(a){return"text"==a.contentType};function ih(){return jh().then(function(){var a=new Eg;return a.init().then(function(){return a})})}function kh(){return jh().then(function(){return Fg()})}function jh(){return null!=window.indexedDB?Promise.resolve():Promise.reject(new p(2,9,9E3))};function lh(){this.a=-1}m=lh.prototype;m.configure=function(){};m.start=function(a){var b=Yg(a);if(null==b)return Promise.reject(new p(2,1,9004,a));this.a=b;var c;return ih().then(function(a){c=a;return c.Fa(b)}.bind(this)).then(function(a){if(!a)throw new p(2,9,9003,b);return mh(a)}).then(function(a){return c.destroy().then(function(){return a})},function(a){return c.destroy().then(function(){throw a;})})};m.stop=function(){return Promise.resolve()};m.update=function(){}; +m.onExpirationUpdated=function(a,b){var c=this.a,d;ih().then(function(a){d=a;return d.Fa(c)}).then(function(e){if(e&&!(0>e.sessionIds.indexOf(a))&&(void 0==e.expiration||e.expiration>b))return e.expiration=b,Mg(d,c,e)})["catch"](function(){}).then(function(){return d.destroy()})};function mh(a){var b=new R(null,0);b.ha(a.duration);var c=a.drmInfo?[a.drmInfo]:[];return{presentationTimeline:b,minBufferTime:2,offlineSessionIds:a.sessionIds,periods:a.periods.map(function(a){return ah(a,c,b)})}} +qe["application/x-offline-manifest"]=lh;function nh(a){if(null!=Yg(a))return nh.a(a);var b=(b=/^offline:segment\/([0-9]+)$/.exec(a))?Number(b[1]):null;return null!=b?nh.b(b,a):Promise.reject(new p(2,1,9004,a))}n("shaka.offline.OfflineScheme",nh);nh.a=function(a){a={uri:a,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}};return Promise.resolve(a)}; +nh.b=function(a,b){var c,d;return ih().then(function(b){c=b;return Ig(c,"segment-v3",a)}).then(function(a){d=a;return c.destroy()}).then(function(){if(!d)throw new p(2,9,9003,a);return{uri:b,data:d.data,headers:{}}})};Ua("offline",nh);function T(a,b,c){this.startTime=a;this.endTime=b;this.payload=c;this.region={x:0,y:0,width:100,height:100};this.position=null;this.positionAlign=oh;this.size=100;this.textAlign=ph;this.writingDirection=qh;this.lineInterpretation=rh;this.line=null;this.lineHeight="";this.lineAlign=sh;this.displayAlign=th;this.fontSize=this.backgroundColor=this.color="";this.fontWeight=uh;this.fontStyle=vh;this.fontFamily="";this.textDecoration=[];this.wrapLine=!0;this.id=""}n("shaka.text.Cue",T);var oh="auto"; +T.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:oh};var ph="center",wh={LEFT:"left",RIGHT:"right",CENTER:ph,START:"start",END:"end"};T.textAlign=wh;var th="before",xh={BEFORE:th,CENTER:"center",AFTER:"after"};T.displayAlign=xh;var qh=0;T.writingDirection={HORIZONTAL_LEFT_TO_RIGHT:qh,HORIZONTAL_RIGHT_TO_LEFT:1,VERTICAL_LEFT_TO_RIGHT:2,VERTICAL_RIGHT_TO_LEFT:3};var rh=0;T.lineInterpretation={LINE_NUMBER:rh,PERCENTAGE:1};var sh="center",yh={CENTER:sh,START:"start",END:"end"}; +T.lineAlign=yh;var uh=400;T.fontWeight={NORMAL:uh,BOLD:700};var vh="normal",zh={NORMAL:vh,ITALIC:"italic",OBLIQUE:"oblique"};T.fontStyle=zh;T.textDecoration={UNDERLINE:"underline",LINE_THROUGH:"lineThrough",OVERLINE:"overline"};function U(a){this.a=null;for(var b=0;b=b||c.endTime<=a?!1:!0});return!0};U.prototype.remove=U.prototype.remove; +U.prototype.append=function(a){for(var b=[],c=0;c=a.endTime)return null;var b=new VTTCue(a.startTime,a.endTime,a.payload);b.lineAlign=a.lineAlign;b.positionAlign=a.positionAlign;b.size=a.size;try{b.align=a.textAlign}catch(c){}"center"==a.textAlign&&"center"!=b.align&&(b.align="middle");2==a.writingDirection?b.vertical="lr":3==a.writingDirection&&(b.vertical="rl");1==a.lineInterpretation&&(b.snapToLines=!1);null!=a.line&&(b.line=a.line);null!=a.position&&(b.position=a.position);return b} +function Ah(a,b){for(var c=a.b,d=[],e=0;ethis.lb.indexOf(a.id)}.bind(this))}; +V.prototype.getTextTracks=V.prototype.td;V.prototype.we=function(a){if(this.a){var b=S(this.a);if(a=Bc(b,a))Sh(this,a,!1),this.ta?this.A=a:kg(this.a,a,!0),this.Ca=a.language}};V.prototype.selectTextTrack=V.prototype.we; +V.prototype.xe=function(a,b){if(this.a){this.c.abr.enabled&&qa("Changing tracks while abr manager is enabled will likely result in the selected track being overriden. Consider disabling abr before calling selectVariantTrack().");var c=S(this.a);(c=Ac(c,a))&&Cc(c)&&(Th(this,c,!1),Uh(this,c,b),this.Ba=c.language)}};V.prototype.selectVariantTrack=V.prototype.xe;V.prototype.jd=function(){if(!this.a)return[];var a=S(this.a);a=xc(a.variants).map(function(a){return a.audio}).filter(Sa);return Vh(a)}; +V.prototype.getAudioLanguagesAndRoles=V.prototype.jd;V.prototype.sd=function(){if(!this.a)return[];var a=S(this.a);return Vh(a.textStreams)};V.prototype.getTextLanguagesAndRoles=V.prototype.sd;V.prototype.hd=function(){if(!this.a)return[];var a=S(this.a);return xc(a.variants).map(function(a){return a.language}).filter(Sa)};V.prototype.getAudioLanguages=V.prototype.hd;V.prototype.rd=function(){return this.a?S(this.a).textStreams.map(function(a){return a.language}).filter(Sa):[]}; +V.prototype.getTextLanguages=V.prototype.rd;function Vh(a){var b=[];a.forEach(function(a){if(a){var c=a.language;a.roles.length?a.roles.forEach(function(a){b.push({language:c,role:a})}):b.push({language:c,role:""})}else b.push({language:"und",role:""})});return Xa(b,function(a,b){return a.language==b.language&&a.role==b.role})}V.prototype.ue=function(a,b){if(this.a){var c=S(this.a);this.Ba=a;this.ib=b||"";Qh(this,c)}};V.prototype.selectAudioLanguage=V.prototype.ue; +V.prototype.ve=function(a,b){if(this.a){var c=S(this.a);this.Ca=a;this.hb=b||"";Qh(this,c)}};V.prototype.selectTextLanguage=V.prototype.ve;V.prototype.Mb=function(){return this.u?this.u.isTextVisible():this.qb};V.prototype.isTextTrackVisible=V.prototype.Mb;V.prototype.Ae=function(a){this.u&&this.u.setTextVisibility(a);this.qb=a;Wh(this);this.a&&(a?(a=S(this.a),a=Fc(a.textStreams,this.Ca,this.hb)[0],fg(this.a,a)):(a=this.a,a.w=!0,a.c.text&&($f(a.c.text),delete a.c.text)))}; +V.prototype.setTextTrackVisibility=V.prototype.Ae;V.prototype.od=function(){return this.b?new Date(1E3*this.b.presentationTimeline.c+1E3*this.f.currentTime):null};V.prototype.getPlayheadTimeAsDate=V.prototype.od;V.prototype.qd=function(){return this.b?new Date(1E3*this.b.presentationTimeline.c):null};V.prototype.getPresentationStartTimeAsDate=V.prototype.qd;V.prototype.Gb=function(){return this.ca?this.ca.Gb():{total:[],audio:[],video:[],text:[]}};V.prototype.getBufferedInfo=V.prototype.Gb; +V.prototype.getStats=function(){Yh(this);this.gb();var a=null,b=null,c=this.f;c=c&&c.getVideoPlaybackQuality?c.getVideoPlaybackQuality():{};if(this.g&&this.b){var d=Jc(this.b,Tf(this.g)),e=this.b.periods[d];if(d=this.I[d])b=Ic(d.audio,d.video,e.variants),a=b.video||{}}a||(a={});b||(b={});return{width:a.width||0,height:a.height||0,streamBandwidth:b.bandwidth||0,decodedFrames:Number(c.totalVideoFrames),droppedFrames:Number(c.droppedVideoFrames),estimatedBandwidth:this.h?this.h.getBandwidthEstimate(): +NaN,loadLatency:this.j.loadLatency,playTime:this.j.playTime,bufferingTime:this.j.bufferingTime,switchHistory:Na(this.j.switchHistory),stateHistory:Na(this.j.stateHistory)}};V.prototype.getStats=V.prototype.getStats; +V.prototype.addTextTrack=function(a,b,c,d,e,f){if(!this.a)return Promise.reject();for(var g=S(this.a),h,k=0;kb&&(b+=Math.pow(2,32)),b=b.toString(16));this.Sa(new p(2,3,3016,a,b,this.f.error.message))}}}; +m.Gd=function(a){var b=["output-restricted","internal-error"],c=S(this.a),d=!1,e=Object.keys(a),f=1==e.length&&"00"==e[0];e.length&&c.variants.forEach(function(c){var e=[];c.audio&&e.push(c.audio);c.video&&e.push(c.video);e.forEach(function(e){var g=c.allowedByKeySystem;e.keyId&&(e=a[f?"00":e.keyId],c.allowedByKeySystem=!!e&&0>b.indexOf(e));g!=c.allowedByKeySystem&&(d=!0)})});(e=Hc(cg(this.a),eg(this.a),c.variants))&&!e.allowedByKeySystem&&Qh(this,c);d&&Mh(this)}; +m.Dd=function(a,b){if(this.i&&this.i.onExpirationUpdated)this.i.onExpirationUpdated(a,b);this.dispatchEvent(new B("expirationupdated"))};function W(a){if(!a||a.constructor!=V)throw new p(2,9,9008);this.g=null;this.a=a;this.b=ai(this);this.f=null;this.l=!1;this.c=this.s=this.h=this.i=null}n("shaka.offline.Storage",W);function bi(){return null!=window.indexedDB}W.support=bi;W.prototype.destroy=function(){var a=this.g,b=this.c?this.c.destroy()["catch"](function(){}).then(function(){if(a)return a.destroy()}):Promise.resolve();this.b=this.a=this.c=this.g=null;return b};W.prototype.destroy=W.prototype.destroy; +W.prototype.configure=function(a){Ma(this.b,a,ai(this),{},"")};W.prototype.configure=W.prototype.configure; +W.prototype.store=function(a,b,c){function d(a){f=a}if(this.l)return Promise.reject(new p(2,9,9006));this.l=!0;var e=b||{},f=null;return ci(this).then(function(){X(this);return di(this,a,d,c)}.bind(this)).then(function(b){X(this);if(f)throw f;return ei(this,a,b.manifest,e,b.ed)}.bind(this)).then(function(a){X(this);return fi(this).then(function(){return a})}.bind(this))["catch"](function(a){f=f||a;return fi(this).then(function(){throw f;})}.bind(this))};W.prototype.store=W.prototype.store; +function ei(a,b,c,d,e){if(c.presentationTimeline.P()||c.presentationTimeline.wa())throw new p(2,9,9005,b);a.h=c;a.f=e;a.j(c.periods);a.s=Zg(b,c,d);var f=gi(a,b,d);return Vg(a.c,f).then(function(a){return $g("offline:manifest/"+a,f)})}W.prototype.remove=function(a){return a.offlineUri?(qa("Removing downloaded content using shakaExtern.StoredContent is deprecated. Please remove using the offline uri."),hi(this,a.offlineUri)):hi(this,a)};W.prototype.remove=W.prototype.remove; +function hi(a,b){function c(a){6013!=a.code&&(e=a)}var d=Yg(b);if(null==d)return Promise.reject(new p(2,9,9004,b));var e=null,f,g;return ci(a).then(function(){X(this);return this.g.Fa(d)}.bind(a)).then(function(a){X(this);if(!a)throw new p(2,9,9003,b);f=a;a=mh(f);g=new zb({Ya:this.a.s,onError:c,Tb:function(){},onExpirationUpdated:function(){},onEvent:function(){}});g.configure(this.a.getConfiguration().drm);return g.init(a,this.b.usePersistentLicense||!1)}.bind(a)).then(function(){return Eb(g,f.sessionIds)}.bind(a)).then(function(){return g.destroy()}.bind(a)).then(function(){X(this); +if(e)throw e;return ii(this,b,d,f)}.bind(a))}function ii(a,b,c,d){function e(){k++;f(g,k/l)}var f=a.b.progressCallback,g=$g(b,d),h=ji(d),k=0,l=h.length+1;return Promise.resolve().then(function(){X(this);return Og(this.g,"segment-v3",h,e)}.bind(a)).then(function(){X(this);return Og(this.g,"manifest-v3",[c],e)}.bind(a))}W.prototype.list=function(){var a=[];return ci(this).then(function(){X(this);return Jg(this.g,function(b,c){var d=$g("offline:manifest/"+b,c);a.push(d)})}.bind(this)).then(function(){return a})}; +W.prototype.list=W.prototype.list; +function di(a,b,c,d){function e(){}var f=a.a.s,g=a.a.getConfiguration(),h,k,l;return te(b,f,g.manifest.retryParameters,d).then(function(a){X(this);l=new a;l.configure(g.manifest);return l.start(b,{networkingEngine:f,filterAllPeriods:this.j.bind(this),filterNewPeriod:this.m.bind(this),onTimelineRegionAdded:function(){},onEvent:function(){},onError:c})}.bind(a)).then(function(a){X(this);h=a;k=new zb({Ya:f,onError:c,Tb:e,onExpirationUpdated:function(){},onEvent:function(){}});k.configure(g.drm);return k.init(h, +this.b.usePersistentLicense||!1)}.bind(a)).then(function(){X(this);return ki(h)}.bind(a)).then(function(){X(this);return Db(k)}.bind(a)).then(function(){X(this);return l.stop()}.bind(a)).then(function(){X(this);return{manifest:h,ed:k}}.bind(a))["catch"](function(a){if(l)return l.stop().then(function(){throw a;});throw a;})} +W.prototype.u=function(a){var b=[],c=oc(this.a.getConfiguration().preferredAudioLanguage),d=[0,mc,nc],e=a.filter(function(a){return"variant"==a.type});d=d.map(function(a){return e.filter(function(b){b=oc(b.language);return lc(a,c,b)})});for(var f,g=0;g=a.height});h.length&&(h.sort(function(a, +b){return b.height-a.height}),f=h.filter(function(a){return a.height==h[0].height}));f.sort(function(a,b){return a.bandwidth-b.bandwidth});f.length&&b.push(f[Math.floor(f.length/2)]);b.push.apply(b,a.filter(function(a){return"text"==a.type}));return b};function ai(a){return{trackSelectionCallback:a.u.bind(a),progressCallback:function(a,c){if(a||c)return null},usePersistentLicense:!0}} +function ci(a){if(null==window.indexedDB)return Promise.reject(new p(2,9,9E3));if(a.g)return Promise.resolve();var b=a.a.s,c=a.a.getConfiguration().streaming.retryParameters;return ih().then(function(a){this.g=a;this.c=new Sg(a,b,c);Tg(this.c,function(a,b){var c=this.s;c.size=b;this.b.progressCallback(c,a)}.bind(this))}.bind(a))}W.prototype.j=function(a){a.forEach(this.m.bind(this))}; +W.prototype.m=function(a){var b=null;if(this.i){var c=this.i.filter(function(a){return"variant"==a.type})[0];c&&(b=Ac(a,c))}var d=c=null;b&&(b.audio&&(c=b.audio),b.video&&(d=b.video));sc(this.f,c,d,a);rc(a,this.a.getConfiguration().restrictions,{width:Infinity,height:Infinity})};function fi(a){var b=a.f?a.f.destroy():Promise.resolve();a.f=null;a.h=null;a.l=!1;a.i=null;return b} +function ki(a){var b=a.periods.map(function(a){return a.variants}).reduce(Pa,[]).map(function(a){var b=[];a.audio&&b.push(a.audio);a.video&&b.push(a.video);return b}).reduce(Pa,[]).filter(Sa);a=a.periods.map(function(a){return a.textStreams}).reduce(Pa,[]);b.push.apply(b,a);return Promise.all(b.map(function(a){return a.createSegmentIndex()}))} +function gi(a,b,c){var d=a.h.periods.map(a.w.bind(a)),e=a.f.b,f=Hb(a.f);if(e&&a.b.usePersistentLicense){if(!f.length)throw new p(2,9,9007,b);e.initData=[]}return{originalManifestUri:b,duration:a.h.presentationTimeline.S(),size:0,expiration:a.f.ub(),periods:d,sessionIds:a.b.usePersistentLicense?f:[],drmInfo:e,appMetadata:c}} +W.prototype.w=function(a){var b=yc(a,null,null),c=zc(a,null);b=this.b.trackSelectionCallback(b.concat(c));null==this.i&&(this.i=b,this.j(this.h.periods));for(c=b.length-1;0navigator.userAgent.indexOf("Trident/")||HTMLInputElement.prototype.addEventListener==ri||(qi=HTMLInputElement.prototype.addEventListener,HTMLInputElement.prototype.addEventListener=ri)});oi(function(){if(4503599627370497!=Math.round(4503599627370497)){var a=Math.round;Math.round=function(b){var c=b;4503599627370496>=b&&(c=a(b));return c}}});function si(a){this.f=[];this.b=[];this.a=[];(new O).W("pssh",this.c.bind(this)).parse(a.buffer)}si.prototype.c=function(a){if(!(1=d.a.length)a=c;else{var e=[];for(a=0;aa.textDecoration.indexOf("underline")&&a.textDecoration.push("underline");break;case "noUnderline":0<=a.textDecoration.indexOf("underline")&&Za(a.textDecoration,"underline");break;case "lineThrough":0>a.textDecoration.indexOf("lineThrough")&&a.textDecoration.push("lineThrough");break;case "noLineThrough":0<=a.textDecoration.indexOf("lineThrough")&&Za(a.textDecoration,"lineThrough");break;case "overline":0>a.textDecoration.indexOf("overline")&& +a.textDecoration.push("overline");break;case "noOverline":0<=a.textDecoration.indexOf("overline")&&Za(a.textDecoration,"overline")}}function Z(a,b,c,d){return(a=Dj(a,c,d))?a:Bj(b,c,d)}function Bj(a,b,c){for(var d=tj(a),e=0;ec.length)return null;var d=null,e=a;for(a=null;e&&!(a=e.getAttribute(b))&&(e=e.parentNode,e instanceof Element););if(b=a)for(a=0;ag[0].indexOf("--\x3e")&&(k=g[0],g.splice(0,1));var l=new Se(g[0]),q=Nj(l),w=Te(l,/[ \t]+--\x3e[ \t]+/g),r=Nj(l);if(null==q||null==w||null==r)throw new p(2,2,2001);g=new T(q+h,r+h,g.slice(1).join("\n").trim());Te(l,/[ \t]+/gm);for(h=Ue(l);h;)Oj(g,h),Te(l,/[ \t]+/gm),h=Ue(l);null!=k&&(g.id=k);k=g}k&&f.push(k)}return f}; +function Oj(a,b){var c;if(c=/^align:(start|middle|center|end|left|right)$/.exec(b))c=c[1],"middle"==c?a.textAlign=ph:a.textAlign=wh[c.toUpperCase()];else if(c=/^vertical:(lr|rl)$/.exec(b))a.writingDirection="lr"==c[1]?2:3;else if(c=/^size:([\d.]+)%$/.exec(b))a.size=Number(c[1]);else if(c=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(b))a.position=Number(c[1]),c[2]&&(c=c[2],a.positionAlign="line-left"==c||"start"==c?"line-left":"line-right"==c||"end"==c?"line-right":"center"); +else if(c=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=1,a.line=Number(c[1]),c[2]&&(a.lineAlign=yh[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=rh,a.line=Number(c[1]),c[2]&&(a.lineAlign=yh[c[2].toUpperCase()])}function Nj(a){a=Te(a,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3})/g);if(null==a)return null;var b=Number(a[2]),c=Number(a[3]);return 59