/* @license Shaka Player Copyright 2016 Google LLC SPDX-License-Identifier: Apache-2.0 */if(function(){var Cu=typeof window<"u"?window:global,xe={};if((function(F,Lt,Vr){var g;function si(e){var n=0;return function(){return n>>0)+"_",o=0;return n}),Ue("Symbol.iterator",function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var n="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),i=0;i"u"?!0:(typeof u=="function"?u=new u("unhandledrejection",{cancelable:!0}):typeof a=="function"?u=new a("unhandledrejection",{cancelable:!0}):(u=Dn.document.createEvent("CustomEvent"),u.initCustomEvent("unhandledrejection",!1,!0,u)),u.promise=this,u.reason=this.i,l(u))},n.prototype.A=function(){if(this.g!=null){for(var u=0;u=s}}),Ue("Object.is",function(e){return e||function(n,i){return n===i?n!==0||1/n===1/i:n!==n&&i!==i}}),Ue("Array.prototype.includes",function(e){return e||function(n,i){var r=this;r instanceof String&&(r=String(r));var o=r.length;for(i=i||0,0>i&&(i=Math.max(i+o,0));io||1114111=o?i+=String.fromCharCode(o):(o-=65536,i+=String.fromCharCode(o>>>10&1023|55296),i+=String.fromCharCode(o&1023|56320))}return i}});function Zp(e,n,i){e instanceof String&&(e=String(e));for(var r=e.length,o=0;on||1342177279>>=1)&&(i+=i);return r}}),Ue("Number.EPSILON",function(){return Math.pow(2,-52)}),Ue("Number.MAX_SAFE_INTEGER",function(){return 9007199254740991}),Ue("Number.isFinite",function(e){return e||function(n){return typeof n!="number"?!1:!isNaN(n)&&n!==1/0&&n!==-1/0}}),Ue("Object.values",function(e){return e||function(n){var i=[],r;for(r in n)Fn(n,r)&&i.push(n[r]);return i}}),Ue("Math.log2",function(e){return e||function(n){return Math.log(n)/Math.LN2}}),Ue("String.prototype.endsWith",function(e){return e||function(n,i){var r=ku(this,n,"endsWith");i===void 0&&(i=r.length),i=Math.max(0,Math.min(i|0,r.length));for(var o=n.length;0=o}}),Ue("Math.trunc",function(e){return e||function(n){if(n=Number(n),isNaN(n)||n===1/0||n===-1/0||n===0)return n;var i=Math.floor(Math.abs(n));return 0>n?-i:i}});var QT=this||self;function W(e,n){e=e.split(".");var i=QT;e[0]in i||typeof i.execScript>"u"||i.execScript("var "+e[0]);for(var r;e.length&&(r=e.shift());)e.length||n===void 0?i[r]&&i[r]!==Object.prototype[r]?i=i[r]:i=i[r]={}:i[r]=n}/* @license Shaka Player Copyright 2016 Google LLC SPDX-License-Identifier: Apache-2.0 */function JT(){}function ZT(){}function Hr(e){this.g=Math.exp(Math.log(.5)/e),this.i=this.h=0}Hr.prototype.sample=function(e,n){var i=Math.pow(this.g,e);n=n*(1-i)+i*this.h,isNaN(n)||(this.h=n,this.i+=e)};function Du(e){return e.h/(1-Math.pow(e.g,e.i))}function es(){this.h=new Hr(2),this.j=new Hr(5),this.g=0,this.i=128e3,this.l=16e3}es.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)},es.prototype.sample=function(e,n){if(!(nn)throw Error("Bad port number "+n);e.Yc=n}else e.Yc=null}function ar(e,n,i){n instanceof Kr?e.g=n:(i||(n=ts(n,cS)),e.g=new Kr(n))}function Gr(e,n){return e?n?decodeURI(e):decodeURIComponent(e):""}function ts(e,n,i){return e!=null?(e=encodeURI(e).replace(n,uS),i&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function uS(e){return e=e.charCodeAt(0),"%"+(e>>4&15).toString(16)+(e&15).toString(16)}var of=/[#\/\?@]/g,aS=/[#\?:]/g,lS=/[#\?]/g,cS=/[#\?@]/g,dS=/#/g;function Kr(e){this.g=e||null}function Nu(e){if(!e.Sa&&(e.Sa=new Map,e.hd=0,e.g))for(var n=e.g.split("&"),i=0;ie)}function hf(){var e,n,i,r,o,s,u,a,l,c,d,h,p,f,y,T,v;return P(function(x){switch(x.g){case 1:if(e={width:1/0,height:1/0},Rn()){if(f=F.cast&&cast.__platform__&&cast.__platform__.canDisplayType,e.width=1280,e.height=720,ue(x,14),!(y=f)){x.s(16);break}return S(x,cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160'),17)}if(Jn()){n=F.devicePixelRatio,e.width=1920=i+2&&(e[i]&224)==192&&(e[i+1]&192)==128?(r=(e[i]&31)<<6|e[i+1]&63,i+=1):e.length>=i+3&&(e[i]&240)==224&&(e[i+1]&192)==128&&(e[i+2]&192)==128?(r=(e[i]&15)<<12|(e[i+1]&63)<<6|e[i+2]&63,i+=2):e.length>=i+4&&(e[i]&241)==240&&(e[i+1]&192)==128&&(e[i+2]&192)==128&&(e[i+3]&192)==128&&(r=(e[i]&7)<<18|(e[i+1]&63)<<12|(e[i+2]&63)<<6|e[i+3]&63,i+=3),65535>=r)n+=String.fromCharCode(r);else{r-=65536;var o=r&1023;n+=String.fromCharCode(55296+(r>>10)),n+=String.fromCharCode(56320+o)}}return n}function Bi(e,n,i){if(!e)return"";if(!i&&e.byteLength%2!=0)throw new R(2,2,2004);i=Math.floor(e.byteLength/2);var r=new Uint16Array(i);e=Gt(e);for(var o=0;o=i[r]}if(!e)return"";var i=oe(e);if(i[0]==239&&i[1]==187&&i[2]==191)return We(i);if(i[0]==254&&i[1]==255)return Bi(i.subarray(2),!1);if(i[0]==255&&i[1]==254)return Bi(i.subarray(2),!0);if(i[0]==0&&i[2]==0)return Bi(e,!1);if(i[1]==0&&i[3]==0)return Bi(e,!0);if(n(0)&&n(1)&&n(2)&&n(3))return We(e);throw new R(2,2,2003)}function Pn(e){if(F.TextEncoder&&!Hn()){var n=new TextEncoder;return vn(n.encode(e))}e=encodeURIComponent(e),e=unescape(e),n=new Uint8Array(e.length);for(var i=0;i",""":'"',"'":"'"," ":"\xA0","‎":"\u200E","‏":"\u200F"},i=/&(?:amp|lt|gt|quot|apos|nbsp|lrm|rlm|#[xX]?[0-9a-fA-F]+);/g,r=RegExp(i.source);return e&&r.test(e)?e.replace(i,function(o){return o[1]=="#"?(o=o[2]=="x"||o[2]=="X"?parseInt(o.substring(3),16):parseInt(o.substring(2),10),0<=o&&1114111>=o?String.fromCodePoint(o):""):n[o]||"'"}):e||""}W("shaka.util.StringUtils",lr),lr.resetFromCharCode=function(){ff.g=void 0},lr.toUTF16=wc,lr.toUTF8=Pn,lr.fromBytesAutoDetect=Zn,lr.fromUTF16=Bi,lr.fromUTF8=We;var ff=new ns(function(){function e(i){try{var r=new Uint8Array(i);return 0"u"&&Ee("Could not find LCEVC Library dependencies on this page"),typeof LCEVCdec<"u")this.h=LCEVCdec;else if(typeof LcevcDil<"u")this.h=LcevcDil,this.j=!0,Ce("LcevcDil","lcevc_dil.js is deprecated, please use lcevc_dec.js instead");else{Ee("Could not find LCEVC Library on this page"),e=!1;break e}typeof this.h.SupportObject>"u"?(Ee("Could not find LCEVC Library on this page"),e=!1):(this.h.SupportObject.SupportStatus||Ee(this.h.SupportObject.SupportError),e=typeof this.h<"u"&&typeof libDPIModule<"u"&&this.i instanceof HTMLCanvasElement&&this.h.SupportObject.SupportStatus)}e&&!this.g&&this.h.SupportObject.webGLSupport(this.i)&&(this.i.classList.remove("shaka-hidden"),this.g=this.j?new this.h.LcevcDil(this.l,this.i,this.m):new this.h.LCEVCdec(this.l,this.i,this.m))}function Ic(e,n,i,r){r.type!=="video"||e.o&&!r.baseOriginalId||e.g&&e.g.appendBuffer(n,"video",r.id,-i,!e.o)}function yf(e){e.g&&e.i.classList.add("shaka-hidden")}os.prototype.release=function(){this.g&&(this.g.close(),this.g=null)};function vf(e){return e&&typeof LCEVCdec<"u"?e.codecs=="lvc1":!1}W("shaka.lcevc.Dec",os),os.prototype.release=os.prototype.release;function St(e){if(Cc.has(e))return Cc.get(e);var n=F.ManagedMediaSource||F.MediaSource;return n?(n=n.isTypeSupported(e),Cc.set(e,n),n):!1}function dr(){var e=F.ManagedSourceBuffer||F.SourceBuffer;return!!e&&!!e.prototype&&!!e.prototype.changeType}function Tf(){var e=F.ManagedMediaSource||F.MediaSource;return e&&e.prototype?!!e.prototype.setLiveSeekableRange&&!!e.prototype.clearLiveSeekableRange:!1}var Cc=new Map;function ss(){}ss.prototype.extract=function(){},ss.prototype.decode=function(){return[]},ss.prototype.clear=function(){},ss.prototype.getStreams=function(){return[]};function Mc(){}Mc.prototype.init=function(){},Mc.prototype.parse=function(){return[]};function us(){}us.prototype.init=function(){},us.prototype.i=function(){},us.prototype.g=function(){},us.prototype.j=function(){},W("shaka.media.IClosedCaptionParser",us);function an(e){this.l=new Mc,(e=Sf(e.toLowerCase()))&&(this.l=e()),this.h=new ss,(e=Jr)&&(this.h=e())}an.prototype.init=function(e,n){n!==void 0&&n||this.g(),this.l.init(e)},an.prototype.i=function(e){e=this.l.parse(e),e=m(e);for(var n=e.next();!n.done;n=e.next()){n=n.value;var i=oe(n.packet);0",o),u=e.substring(u,o);var l=u.indexOf(s);if(l==-1){var c=s.indexOf(".");0",o+1);o===-1&&(o=e.length)}else if(e.charCodeAt(o+2)===91&&e.charCodeAt(o+8)===91&&e.substr(o+3,5).toLowerCase()==="cdata"){l=e.indexOf("]]>",o),l==-1?(a.push(e.substr(o+9)),o=e.length):(a.push(e.substring(o+9,l)),o=l+3);continue}o++;continue}e:{c=u,o++;var d=r(),h={};for(l=[];e.charCodeAt(o)!==62&&e[o];){var p=e.charCodeAt(o);if(64p||96p){p=r();for(var f=e.charCodeAt(o);f&&f!==39&&f!==34&&!(64f||96f)&&f!==62;)o++,f=e.charCodeAt(o);var y=o+1;if(o=e.indexOf(e[o],y),y=e.slice(y,o),f===39||f===34){if(o===-1){if(c={tagName:d,attributes:h,children:l,parent:null},n)for(d=0;d/= `.indexOf(e[o])===-1&&e[o];)o++;return e.slice(s,o)}var o=0;return i("")}function Fu(e){return typeof e=="string"}function Ef(e){var n=[];if(!e.children)return[];e=m(e.children);for(var i=e.next();!i.done;i=e.next())i=i.value,typeof i!="string"&&n.push(i);return n}function De(e,n){var i=[];if(!e.children)return[];e=m(e.children);for(var r=e.next();!r.done;r=e.next())r=r.value,r.tagName===n&&i.push(r);return i}function st(e){return typeof e=="string"?Kt(e):(e=e.children.reduce(function(n,i){return typeof i=="string"?n+i:n},""),e===""?null:Kt(e))}function ln(e){return Array.from(e.children).every(function(n){return typeof n=="string"})?((e=st(e))&&(e=e.trim()),e):null}function Kn(e,n,i){if(i=i===void 0?[]:i,e.tagName===n&&i.push(e),e.children){e=m(e.children);for(var r=e.next();!r.done;r=e.next())Kn(r.value,n,i)}return i}function it(e,n){return e=De(e,n),e.length!=1?null:e[0]}function Nn(e,n,i){return e=Af(e,n,i),e.length!=1?null:e[0]}function de(e,n,i,r){r=r===void 0?null:r;var o=null;return e=e.attributes[n],e!=null&&(o=i(e)),o??r}function gi(e,n,i){return n=Lc(n),e.attributes[n+":"+i]||null}function Af(e,n,i){var r=Lc(n);if(n=[],e.children)for(i=r?r+":"+i:i,e=m(e.children),r=e.next();!r.done;r=e.next())(r=r.value)&&r.tagName===i&&n.push(r);return n}function ei(e,n,i){n=m(n);for(var r=n.next();!r.done;r=n.next())if(r=gi(e,r.value,i))return r;return null}function Vi(e){return e?(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)&&(e+="Z"),e=Date.parse(e),isNaN(e)?null:e/1e3):null}function ti(e){return!e||(e=RegExp("^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$","i").exec(e),!e)?null:(e=31536e3*Number(e[1]||null)+2592e3*Number(e[2]||null)+86400*Number(e[3]||null)+3600*Number(e[4]||null)+60*Number(e[5]||null)+Number(e[6]||null),isFinite(e)?e:null)}function Vu(e){var n=/([0-9]+)-([0-9]+)/.exec(e);return!n||(e=Number(n[1]),!isFinite(e))?null:(n=Number(n[2]),isFinite(n)?{start:e,end:n}:null)}function Ut(e){return e=Number(e),e%1===0?e:null}function mi(e){return e=Number(e),e%1===0&&0Math.abs(e.startTime-n.startTime)&&.001>Math.abs(e.endTime-n.endTime)))return!1;for(var i in e)if(i!="startTime"&&i!="endTime"&&i!="payload"){if(i=="nestedCues"){if(!Zr(e.nestedCues,n.nestedCues,Ku))return!1}else if(i=="region"||i=="cellResolution"){for(var r in e[i])if(e[i][r]!=n[i][r])return!1}else if(Array.isArray(e[i])){if(!Zr(e[i],n[i]))return!1}else if(e[i]!=n[i])return!1}return!0}function Xu(e,n){n=n===void 0?new Map:n;var i=e.payload;if(i.includes("<")){n.size===0&&Rf(n);var r=i;i=[];for(var o=-1,s=0;s"&&0",'
'),r+="
";e:{s=r,o=[];var u=-1;i="",r=!1;for(var a=0;a",a);if(l===-1){i=s;break e}if((l=s.substring(a+1,l))&&l=="v"){r=!0;var c=null;if(o.length&&(c=o[o.length-1]),c){if(c===l)i+="/"+l+">";else{if(!c.startsWith("v")){i+=s[a];continue}i+="/"+c+">"}a+=l.length+1}else i+=s[a]}else i+=s[a]}else s[a]==="<"?(u=a+1,s[u]!="v"&&(u=-1)):s[a]===">"&&0","<"+u+">"),i=i.replace("",""),r||(i+="")}i=vS(i),e.payload="";try{var d=mr(""+i+"","span")}catch{}if(d)if(d=d.children,d.length!=1||d[0].tagName)for(d=m(d),i=d.next();!i.done;i=d.next())Pf(i.value,e,n);else e.payload=Kt(i);else e.payload=Kt(i)}else e.payload=Kt(i)}function Rf(e){for(var n=m(Object.entries(Nf)),i=n.next();!i.done;i=n.next()){var r=m(i.value);i=r.next().value,r=r.next().value;var o=new He(0,0,"");o.color=r,e.set("."+i,o)}for(n=m(Object.entries(jf)),i=n.next();!i.done;i=n.next())r=m(i.value),i=r.next().value,r=r.next().value,o=new He(0,0,""),o.backgroundColor=r,e.set("."+i,o)}function vS(e){var n={"< ":""," >":" >"},i=/(< +>|<\s|\s>)/g,r=RegExp(i.source);return e&&r.test(e)?e.replace(i,function(o){return n[o]||""}):e||""}function Pf(e,n,i){var r=n.clone();if(r.nestedCues=[],r.payload="",r.rubyTag="",r.line=null,r.region=new hr,r.position=null,r.size=0,r.textAlign=ni,e.tagName)for(var o=m(e.tagName.split(/(?=[ .])+/g)),s=o.next();!s.done;s=o.next()){var u=s=s.value;if(u.startsWith(".voice-")){var a=u.split("-").pop();u='v[voice="'+a+'"]',i.has(u)||(u="v[voice="+a+"]")}switch(i.has(u)&&(a=r,u=i.get(u))&&(a.backgroundColor=ds(u.backgroundColor,a.backgroundColor),a.color=ds(u.color,a.color),a.fontFamily=ds(u.fontFamily,a.fontFamily),a.fontSize=ds(u.fontSize,a.fontSize),a.textShadow=ds(u.textShadow,a.textShadow),a.fontWeight=u.fontWeight,a.fontStyle=u.fontStyle,a.opacity=u.opacity,a.rubyTag=u.rubyTag,a.textCombineUpright=u.textCombineUpright,a.wrapLine=u.wrapLine),s){case"br":r=Df(r.startTime,r.endTime),n.nestedCues.push(r);return;case"b":r.fontWeight=io;break;case"i":r.fontStyle=ro;break;case"u":r.textDecoration.push(yi);break;case"font":(s=e.attributes.color)&&(r.color=s);break;case"div":if(s=e.attributes.time,!s)break;(s=no(s))&&(r.startTime=s);break;case"ruby":case"rp":case"rt":r.rubyTag=s}}if(o=e.children,Fu(e)||o.length==1&&Fu(o[0]))for(i=st(e).split(` `),e=!0,i=m(i),o=i.next();!o.done;o=i.next())o=o.value,e||(e=Df(r.startTime,r.endTime),n.nestedCues.push(e)),0=e.l&&f.startTime=i.h||(e<=i.g&&n>=i.h?i.g=i.h=null:e<=i.g&&ni.g&&n>=i.h&&(i.h=e)),K(r)})};function ES(e,n,i){e.l=n,e.m=i}function Bf(e,n,i){if(e.C=n,n=e.o.get(n))for(var r=m(n.keys()),o=r.next();!o.done;o=r.next())(o=n.get(o.value).filter(function(s){return s.endTime<=i}))&&e.j.append(o)}function Ff(e,n,i){n.startTime+=i,n.endTime+=i,n=m(n.nestedCues);for(var r=n.next();!r.done;r=n.next())Ff(e,r.value,i)}function AS(e,n,i,r,o){var s=i+" "+r,u=new Map;n=m(n);for(var a=n.next();!a.done;a=n.next()){var l=a.value;a=l.stream,l=l.cue,u.has(a)||u.set(a,new Map),u.get(a).has(s)||u.get(a).set(s,[]),Ff(e,l,o),l.startTime>=e.l&&l.startTimex?(x=I,A=[k.Qe]):I==x&&A.push(k.Qe);d.push.apply(d,X(A))}),a=d}for(i=new Set,n=new Set,a=m(a),o=a.next();!o.done;o=a.next())o=o.value,o.audio&&i.add(o.audio),o.video&&n.add(o.video);a=Array.from(i).sort(function(x,w){return x.bandwidth-w.bandwidth});var h=[];for(i=new Map,a=m(a),o=a.next();!o.done;o=a.next()){if(o=o.value,l=u(o),c=i.get(l)||[],c.length){var p=c[c.length-1],f=It(p.codecs),y=It(o.codecs);f!=y||o.bandwidth&&p.bandwidth&&!(o.bandwidth>p.bandwidth)||(c.push(o),h.push(o.id))}else c.push(o),h.push(o.id);i.set(l,c)}var T={vp8:1,avc:1,"dovi-avc":.95,vp9:.9,vp09:.9,hevc:.85,"dovi-hevc":.8,"dovi-p5":.75,av01:.7,"dovi-av1":.65,vvc:.6};a=Array.from(n).sort(function(x,w){if(!x.bandwidth||!w.bandwidth||x.bandwidth==w.bandwidth){if(x.codecs&&w.codecs&&x.codecs!=w.codecs&&x.width==w.width){var A=It(x.codecs),I=It(w.codecs);if(A!=I)return(T[A]||1)-(T[I]||1)}return x.width-w.width}return x.bandwidth-w.bandwidth}),n=dr();var v=[];for(i=new Map,a=m(a),o=a.next();!o.done;o=a.next()){if(o=o.value,l=s(o),c=i.get(l)||[],c.length){if(p=c[c.length-1],!n&&(f=It(p.codecs),y=It(o.codecs),f!==y))continue;f=It(p.codecs),y=It(o.codecs),f!=y||o.bandwidth&&p.bandwidth&&!(o.bandwidth>p.bandwidth)||(c.push(o),v.push(o.id))}else c.push(o),v.push(o.id);i.set(l,c)}e.variants=e.variants.filter(function(x){var w=x.audio;return x=x.video,!(w&&!h.includes(w.id)||x&&!v.includes(x.id))})}function MS(e,n,i){n=m(n);for(var r=n.next(),o={};!r.done;o={Kh:void 0},r=n.next())if(o.Kh=r.value,r=e.filter(function(s){return function(u){return u.video&&u.video.codecs.startsWith(s.Kh)}}(o)),r.length){e=r;break}for(i=m(i),n=i.next(),r={};!n.done;r={Cg:void 0},n=i.next())if(r.Cg=n.value,n=e.filter(function(s){return function(u){return u.audio&&u.audio.codecs.startsWith(s.Cg)}}(r)),n.length){e=n;break}return e}function kS(e,n,i){e.variants=e.variants.filter(function(r){return Yu(r,n,i)})}function Yu(e,n,i){function r(a,l,c){return a>=l&&a<=c}var o=e.video;if(o&&o.width&&o.height){var s=o.width,u=o.height;if(u>s&&(u=m([u,s]),s=u.next().value,u=u.next().value),!r(s,n.minWidth,Math.min(n.maxWidth,i.width))||!r(u,n.minHeight,Math.min(n.maxHeight,i.height))||!r(o.width*o.height,n.minPixels,n.maxPixels))return!1}return!(e&&e.video&&e.video.frameRate&&!r(e.video.frameRate,n.minFrameRate,n.maxFrameRate)||e&&e.audio&&e.audio.channelsCount&&!r(e.audio.channelsCount,n.minChannelsCount,n.maxChannelsCount)||!r(e.bandwidth,n.minBandwidth,n.maxBandwidth))}function DS(e,n,i,r){return i=i===void 0?[]:i,r=r===void 0?{}:r,P(function(o){return o.g==1?S(o,Kf(e,n,0=e&&o.width>=n){e=o.height,n=o.width;break}i=Jc(this,this.g.restrictions,r,e,n)}for(e=this.getBandwidthEstimate(),r.length&&!i.length&&(i=Jc(this,null,r,1/0,1/0),i=[i[0]]),n=i[0]||null,r=0;r=u&&e<=s&&(n.bandwidth!=o.bandwidth||n.bandwidth==o.bandwidth&&n.video&&o.video&&(n.video.width=n.i))return;e.I=!0,e.u-=1e3*(e.g.switchInterval-e.g.minTimeToSwitch)}Date.now()-e.u<1e3*e.g.switchInterval||(n=e.chooseVariant(),e.getBandwidthEstimate(),n&&e.G(n,e.g.clearBufferSwitch,e.g.safeMarginSwitch))}function Jc(e,n,i,r,o){if(e.C){var s=e.C.Tg();s&&(i=i.filter(function(u){return u.bandwidth&&s?u.bandwidth<=s:!0}))}return n&&(i=i.filter(function(u){return Yu(u,n,{width:o,height:r})})),i.sort(function(u,a){return u.bandwidth-a.bandwidth})}function bS(e){var n=[];e=m(e);for(var i=e.next();!i.done;i=e.next())(i=i.value.video)&&i.height&&i.width&&n.push({height:i.height,width:i.width});return n.sort(function(r,o){return r.width-o.width})}W("shaka.abr.SimpleAbrManager",qe),qe.prototype.configure=qe.prototype.configure,qe.prototype.setCmsdManager=qe.prototype.setCmsdManager,qe.prototype.setMediaElement=qe.prototype.setMediaElement,qe.prototype.playbackRateChanged=qe.prototype.playbackRateChanged,qe.prototype.setVariants=qe.prototype.setVariants,qe.prototype.getBandwidthEstimate=qe.prototype.getBandwidthEstimate,qe.prototype.trySuggestStreams=qe.prototype.trySuggestStreams,qe.prototype.segmentDownloaded=qe.prototype.segmentDownloaded,qe.prototype.disable=qe.prototype.disable,qe.prototype.enable=qe.prototype.enable,qe.prototype.chooseVariant=qe.prototype.chooseVariant,qe.prototype.init=qe.prototype.init,qe.prototype.release=qe.prototype.release,qe.prototype.stop=qe.prototype.stop;var BS=1;W("shaka.config.CrossBoundaryStrategy",{KEEP:"keep",RESET:"reset",RESET_TO_ENCRYPTED:"reset_to_encrypted",RESET_ON_ENCRYPTION_CHANGE:"RESET_ON_ENCRYPTION_CHANGE"});function eg(e,n){var i=Xn();this.l=e.maxAttempts==null?i.maxAttempts:e.maxAttempts,this.j=e.baseDelay==null?i.baseDelay:e.baseDelay,this.o=e.fuzzFactor==null?i.fuzzFactor:e.fuzzFactor,this.m=e.backoffFactor==null?i.backoffFactor:e.backoffFactor,this.g=0,this.h=this.j,(this.i=n===void 0?!1:n)&&(this.g=1)}function tg(e){var n,i;return P(function(r){if(r.g==1){if(e.g>=e.l)if(e.i)e.g=1,e.h=e.j;else throw new R(2,7,1010);return n=e.g,e.g++,n==0?r.return():(i=e.h*(1+(2*Math.random()-1)*e.o),S(r,new Promise(function(o){new ve(o).da(i/1e3)}),2))}e.h*=e.m,K(r)})}function Xn(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4}}function Ne(){var e,n,i=new Promise(function(r,o){e=r,n=o});return i.resolve=e,i.reject=n,i}Ne.prototype.resolve=function(){},Ne.prototype.reject=function(){};function tt(e,n){this.promise=e,this.i=n,this.g=null}function wr(e){return new tt(Promise.reject(e),function(){return Promise.resolve()})}function Zc(){var e=Promise.reject(new R(2,7,7001));return e.catch(function(){}),new tt(e,function(){return Promise.resolve()})}function lo(e){return new tt(Promise.resolve(e),function(){return Promise.resolve()})}function ng(e){return new tt(e,function(){return e.catch(function(){})})}tt.prototype.abort=function(){return this.g||(this.g=this.i()),this.g};function ig(e){return new tt(Promise.all(e.map(function(n){return n.promise})),function(){return Promise.all(e.map(function(n){return n.abort()}))})}tt.prototype.finally=function(e){return this.promise.then(function(){return e(!0)},function(){return e(!1)}),this},tt.prototype.Ha=function(e,n){function i(a){return function(l){if(o.g&&a)s.reject(u);else{var c=a?e:n;c?r=FS(c,l,s):(a?s.resolve:s.reject)(l)}}}function r(){return s.reject(u),o.abort()}var o=this,s=new Ne;s.catch(function(){});var u=new R(2,7,7001);return this.promise.then(i(!0),i(!1)),new tt(s,function(){return r()})};function FS(e,n,i){try{var r=e(n);return r&&r.promise&&r.abort?(i.resolve(r.promise),function(){return r.abort()}):(i.resolve(r),function(){return Promise.resolve(r).then(function(){},function(){})})}catch(o){return i.reject(o),function(){return Promise.resolve()}}}Dn.Object.defineProperties(tt.prototype,{aborted:{configurable:!0,enumerable:!0,get:function(){return this.g!==null}}}),W("shaka.util.AbortableOperation",tt),tt.prototype.chain=tt.prototype.Ha,tt.prototype.finally=tt.prototype.finally,tt.all=ig,tt.prototype.abort=tt.prototype.abort,tt.notAbortable=ng,tt.completed=lo,tt.aborted=Zc,tt.failed=wr;function G(e,n){if(n)if(n instanceof Map)for(var i=m(n.keys()),r=i.next();!r.done;r=i.next())r=r.value,Object.defineProperty(this,r,{value:n.get(r),writable:!0,enumerable:!0});else for(i in n)Object.defineProperty(this,i,{value:n[i],writable:!0,enumerable:!0});this.defaultPrevented=this.cancelable=this.bubbles=!1,this.timeStamp=F.performance&&F.performance.now?F.performance.now():Date.now(),this.type=e,this.isTrusted=!1,this.target=this.currentTarget=null,this.g=!1}function rg(e){var n=new G(e.type),i;for(i in e)Object.defineProperty(n,i,{value:e[i],writable:!0,enumerable:!0});return n}G.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)},G.prototype.stopImmediatePropagation=function(){this.g=!0},G.prototype.stopPropagation=function(){},W("shaka.util.FakeEvent",G);var Zu={Oj:"abrstatuschanged",Pj:"adaptation",Qj:"audiotrackchanged",Rj:"audiotrackschanged",Sj:"boundarycrossed",Tj:"buffering",Uj:"complete",Vj:"downloadcompleted",Wj:"downloadfailed",Xj:"downloadheadersreceived",Yj:"drmsessionupdate",$j:"emsg",uk:"prft",Error:"error",ak:"expirationupdated",bk:"firstquartile",ck:"gapjumped",fk:"keystatuschanged",jk:"loaded",kk:"loading",mk:"manifestparsed",nk:"manifestupdated",pk:"mediaqualitychanged",qk:"mediasourcerecovered",Metadata:"metadata",rk:"midpoint",sk:"nospatialvideoinfo",tk:"onstatechange",vk:"ratechange",xk:"segmentappended",yk:"sessiondata",zk:"spatialvideoinfo",Ak:"stalldetected",Bk:"started",Ck:"statechanged",Dk:"streaming",Ek:"textchanged",Fk:"texttrackvisibility",Gk:"thirdquartile",Hk:"timelineregionadded",Ik:"timelineregionenter",Jk:"timelineregionexit",Kk:"trackschanged",Mk:"unloading",Ok:"variantchanged"};function je(){this.Ea=new Ru,this.Re=this}je.prototype.addEventListener=function(e,n){this.Ea&&this.Ea.push(e,n)},je.prototype.removeEventListener=function(e,n){this.Ea&&this.Ea.remove(e,n)},je.prototype.dispatchEvent=function(e){if(!this.Ea)return!0;var n=this.Ea.get(e.type)||[],i=this.Ea.get("All");for(i&&(n=n.concat(i)),n=m(n),i=n.next();!i.done;i=n.next()){i=i.value,e.target=this.Re,e.currentTarget=this.Re;try{i.handleEvent?i.handleEvent(e):i.call(this,e)}catch{}if(e.g)break}return e.defaultPrevented},je.prototype.release=function(){this.Ea=null};function co(){this.g=[]}function Er(e,n){e.g.push(n.finally(function(){Ln(e.g,n)}))}co.prototype.destroy=function(){for(var e=[],n=m(this.g),i=n.next();!i.done;i=n.next())i=i.value,i.promise.catch(function(){}),e.push(i.abort());return this.g=[],Promise.all(e)};function Fe(e,n,i,r,o,s,u){je.call(this),this.i=!1,this.u=new co,this.g=new Set,this.h=new Set,this.m=e||null,this.l=n||null,this.C=i||null,this.F=r||null,this.G=o||null,this.I=s||null,this.H=u||null,this.A=this.B=!1,this.o=16e3,this.j=new Map}wt(Fe,je),g=Fe.prototype,g.kg=function(e){this.B=e},g.lg=function(e){this.A=e};function xi(e,n,i,r){r=r===void 0?!1:r,i=i||lg;var o=ta.get(e);(!o||i>=o.priority)&&ta.set(e,{priority:i,ue:n,ij:r})}function og(e,n){for(var i=m(e.g),r=i.next();!r.done;r=i.next())n.g.add(r.value);for(e=m(e.h),i=e.next();!i.done;i=e.next())n.h.add(i.value)}g.lj=function(e){this.g.add(e)},g.Hj=function(e){this.g.delete(e)},g.Zh=function(){this.g.clear()},g.mj=function(e){this.h.add(e)},g.Ij=function(e){this.h.delete(e)},g.$h=function(){this.h.clear()},g.Hg=function(){this.j.clear()};function lt(e,n,i){return{uris:e,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:n,licenseRequestType:null,sessionId:null,drmInfo:null,initData:null,initDataType:null,streamDataCallback:i===void 0?null:i}}g.destroy=function(){return this.i=!0,this.g.clear(),this.h.clear(),this.j.clear(),je.prototype.release.call(this),this.u.destroy()},g.request=function(e,n,i){var r=this,o=new ag;if(this.i){var s=Promise.reject(new R(2,7,7001));return s.catch(function(){}),new ea(s,function(){return Promise.resolve()},o)}n.method=n.method||"GET",n.headers=n.headers||{},n.retryParameters=n.retryParameters?Gn(n.retryParameters):Xn(),n.uris=Gn(n.uris),s=VS(this,e,n,i);var u=s.Ha(function(){return sg(r,e,n,i,new eg(n.retryParameters,!1),0,null,o)}),a=u.Ha(function(p){return HS(r,e,p,i)}),l=Date.now(),c=0;s.promise.then(function(){c=Date.now()-l},function(){});var d=0;u.promise.then(function(){d=Date.now()},function(){});var h=a.Ha(function(p){var f=Date.now()-d,y=p.response;return y.timeMs+=c,y.timeMs+=f,p.Oi||!r.m||y.fromCache||n.method=="HEAD"||e!=_n||r.m(y.timeMs,y.data.byteLength,ug(i)),r.H&&r.H(e,y,i),y},function(p){throw p&&(p.severity=2),p});return s=new ea(h.promise,function(){return h.abort()},o),Er(this.u,s),s};function VS(e,n,i,r){function o(a){s=s.Ha(function(){return i.body&&(i.body=vn(i.body)),a(n,i,r)})}var s=lo(void 0);e.G&&o(e.G),e=m(e.g);for(var u=e.next();!u.done;u=e.next())o(u.value);return s.Ha(void 0,function(a){throw a instanceof R&&a.code==7001?a:new R(2,1,1006,a)})}function sg(e,n,i,r,o,s,u,a){e.B&&(i.uris[s]=i.uris[s].replace("https://","http://")),e.A&&(i.uris[s]=i.uris[s].replace("http://","https://")),0this.h.byteLength)throw wi();var n=oe(this.h,this.g,e);return this.g+=e,n},g.skip=function(e){if(this.g+e>this.h.byteLength)throw wi();this.g+=e},g.ph=function(e){if(this.ge||e>this.h.byteLength)throw wi();this.g=e},g.Bc=function(){for(var e=this.g;this.ta()&&this.h.getUint8(this.g)!=0;)this.g+=1;return e=oe(this.h,e,this.g-e),this.g+=1,We(e)};function wi(){return new R(2,3,3e3)}W("shaka.util.DataViewReader",Ge),Ge.prototype.readTerminatedString=Ge.prototype.Bc,Ge.prototype.seek=Ge.prototype.seek,Ge.prototype.rewind=Ge.prototype.ph,Ge.prototype.skip=Ge.prototype.skip,Ge.prototype.readBytes=Ge.prototype.Cb,Ge.prototype.readUint64=Ge.prototype.Zc,Ge.prototype.readInt32=Ge.prototype.$f,Ge.prototype.readUint32=Ge.prototype.S,Ge.prototype.readUint16=Ge.prototype.ma,Ge.prototype.readUint8=Ge.prototype.X,Ge.prototype.getLength=Ge.prototype.getLength,Ge.prototype.getPosition=Ge.prototype.Ba,Ge.prototype.hasMoreData=Ge.prototype.ta;var cg=1;Ge.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:cg};function _e(){this.i=new Map,this.h=new Map,this.g=!1}g=_e.prototype,g.box=function(e,n){return e=dg(e),this.i.set(e,KS),this.h.set(e,n),this},g.R=function(e,n){return e=dg(e),this.i.set(e,hg),this.h.set(e,n),this},g.stop=function(){this.g=!0},g.parse=function(e,n,i){for(e=new Ge(e,0),this.g=!1;e.ta()&&!this.g;)this.Wc(0,e,n,i)},g.Wc=function(e,n,i,r){var o=n.Ba();if(r&&o+8>n.getLength())this.g=!0;else{var s=n.S(),u=n.S(),a=ia(u),l=!1;switch(s){case 0:s=n.getLength()-o;break;case 1:if(r&&n.Ba()+8>n.getLength()){this.g=!0;return}s=n.Zc(),l=!0}var c=this.h.get(u);if(c){var d=null,h=null;if(this.i.get(u)==hg){if(r&&n.Ba()+4>n.getLength()){this.g=!0;return}h=n.S(),d=h>>>24,h&=16777215}u=o+s,i&&u>n.getLength()&&(u=n.getLength()),r&&u>n.getLength()?this.g=!0:(r=u-n.Ba(),n=0>24&255,e>>16&255,e>>8&255,e&255)}function zi(e){return 8+(e.has64BitSize?8:0)+(e.flags!=null?4:0)}W("shaka.util.Mp4Parser",_e),_e.headerSize=zi,_e.typeToString=ia,_e.allData=po,_e.audioSampleEntry=na,_e.visualSampleEntry=en,_e.sampleDescription=Ei,_e.children=he,_e.prototype.parseNext=_e.prototype.Wc,_e.prototype.parse=_e.prototype.parse,_e.prototype.stop=_e.prototype.stop,_e.prototype.fullBox=_e.prototype.R,_e.prototype.box=_e.prototype.box;var KS=0,hg=1;function nd(e){var n=this;this.g=[],this.h=[],this.data=[],new _e().box("moov",he).box("moof",he).R("pssh",function(i){if(!(1r?a.setUint32(l,0):a.setUint32(l,16777216),l+=4,u.set(n,l),l+=n.length,0a&&(a+=Math.pow(2,32)),a="0x"+a.toString(16)}e.u(new R(2,6,6006,s.message,s,a))}})}function ex(e){return P(function(n){return n.g==1?e.J?S(n,e.m,3):n.s(0):S(n,Promise.all(e.T.map(function(i){return i.promise})),0)})}function rd(e,n){var i,r,o,s,u,a,l,c,d,h,p,f,y,T;P(function(v){switch(v.g){case 1:if(i=n.target,e.g.logLicenseExchange&&pi(n.message),r=e.i.get(i),o=e.h.licenseServerUri,s=e.g.advanced[e.h.keySystem],n.messageType=="individualization-request"&&s&&s.individualizationServer&&(o=s.individualizationServer),u=lt([o],e.g.retryParameters),u.body=n.message,u.method="POST",u.licenseRequestType=n.messageType,u.sessionId=i.sessionId,u.drmInfo=e.h,r&&(u.initData=r.initData,u.initDataType=r.initDataType),s&&s.headers)for(a in s.headers)u.headers[a]=s.headers[a];if(e.h.keySystem==="org.w3.clearkey"){var x=u,w=e.h;try{var A=Zn(x.body);if(A){var I=JSON.parse(A);I.type||(I.type=w.sessionType,x.body=Pn(JSON.stringify(I)))}}catch{}}if(yc(e.h.keySystem))if(x=Bi(u.body,!0,!0),x.includes("PlayReadyKeyMessage")){for(x=mr(x,"PlayReadyKeyMessage"),w=Kn(x,"HttpHeader"),w=m(w),A=w.next();!A.done;A=w.next())I=A.value,A=Kn(I,"name")[0],I=Kn(I,"value")[0],u.headers[st(A)]=st(I);x=Kn(x,"Challenge")[0],u.body=Tn(st(x))}else u.headers["Content-Type"]="text/xml; charset=utf-8";return l=Date.now(),ue(v,2),d=e.C.Vb.request(2,u,{isPreload:e.P()}),e.T.push(d),S(v,d.promise,4);case 4:c=v.h,Ln(e.T,d),me(v,3);break;case 2:return h=ae(v),e.l.g||(p=new R(2,6,6007,h),e.i.size==1?(e.u(p),r&&r.rb&&r.rb.reject(p)):(r&&r.rb&&r.rb.reject(p),e.i.delete(i),Es(e)&&(e.m.resolve(),e.L.da(.1)))),v.return();case 3:return e.l.g?v.return():(e.H+=(Date.now()-l)/1e3,e.g.logLicenseExchange&&pi(c.data),ue(v,5),S(v,i.update(c.data),7));case 7:me(v,6);break;case 5:return f=ae(v),y=new R(2,6,6008,f.message),e.u(y),r&&r.rb&&r.rb.reject(y),v.return();case 6:if(e.l.g)return v.return();T=new G("drmsessionupdate"),e.C.onEvent(T),r&&(r.rb&&r.rb.resolve(),Tg(e,r)),K(v)}})}function xg(e,n){n=n.target;var i=e.i.get(n),r=!1;n.keyStatuses.forEach(function(s,u){if(typeof u=="string"){var a=u;u=s,s=a}if(yc(e.h.keySystem)&&u.byteLength==16&&(zr()||Hn()||nt("sony.hbbtv.tv.G5"))){a=Gt(u);var l=a.getUint32(0,!0),c=a.getUint16(4,!0),d=a.getUint16(6,!0);a.setUint32(0,l,!1),a.setUint16(4,c,!1),a.setUint16(6,d,!1)}s!="status-pending"&&(i.loaded=!0),s=="expired"&&(r=!0),u=fi(u).slice(0,32),e.Z.set(u,s)});var o=n.expiration-Date.now();(0>o||r&&1e3>o)&&i&&!i.rb&&(e.i.delete(n),wg(n)),Es(e)&&(e.m.resolve(),e.L.da(lx))}function tx(e){var n=e.Z,i=e.fa;i.clear(),n.forEach(function(r,o){return i.set(o,r)}),n=Array.from(i.values()),n.length&&n.every(function(r){return r=="expired"})&&e.u(new R(2,6,6014)),e.C.re(td(i))}function nx(){var e,n,i,r,o,s,u,a,l,c,d,h,p,f,y,T,v,x,w,A,I,k,C,E,M,D,_,j,L,N,U,O,b,V;return P(function(H){if(H.g==1){if(e="org.w3.clearkey com.widevine.alpha com.widevine.alpha.experiment com.microsoft.playready com.microsoft.playready.hardware com.microsoft.playready.recommendation com.microsoft.playready.recommendation.3000 com.microsoft.playready.recommendation.3000.clearlead com.chromecast.playready com.apple.fps.1_0 com.apple.fps com.huawei.wiseplay".split(" "),!(F.MediaKeys&&F.navigator&&F.navigator.requestMediaKeySystemAccess&&F.MediaKeySystemAccess&&F.MediaKeySystemAccess.prototype.getConfiguration)){for(n={},i=m(e),r=i.next();!r.done;r=i.next())o=r.value,n[o]=null;return H.return(n)}for(s="1.0 1.1 1.2 1.3 1.4 2.0 2.1 2.2 2.3".split(" "),u=["SW_SECURE_CRYPTO","SW_SECURE_DECODE","HW_SECURE_CRYPTO","HW_SECURE_DECODE","HW_SECURE_ALL"],a=["150","2000","3000"],l={"com.widevine.alpha":u,"com.widevine.alpha.experiment":u,"com.microsoft.playready.recommendation":a},c=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],d=[{contentType:'audio/mp4; codecs="mp4a.40.2"'},{contentType:'audio/webm; codecs="opus"'}],h={videoCapabilities:c,audioCapabilities:d,initDataTypes:["cenc","sinf","skd","keyids"]},p=[null,"cenc","cbcs","cbcs-1-9"],f=new Map,y=function(ce,Y){var Me,Re,fe,se,Ie,pe,Te,le,ge,be,ht,Je,Ze;return P(function(rt){switch(rt.g){case 1:return ue(rt,2),S(rt,Y.createMediaKeys(),5);case 5:Me=rt.h;case 4:me(rt,3);break;case 2:return ae(rt),rt.return();case 3:if(fe=(Re=Y.getConfiguration().sessionTypes)?Re.includes("persistent-license"):!1,di()&&(fe=!1),se=Y.getConfiguration().videoCapabilities,Ie=Y.getConfiguration().audioCapabilities,pe={persistentState:fe,encryptionSchemes:[],videoRobustnessLevels:[],audioRobustnessLevels:[],minHdcpVersions:[]},f.has(ce)&&f.get(ce)?pe=f.get(ce):f.set(ce,pe),(Te=se[0].encryptionScheme)&&!pe.encryptionSchemes.includes(Te)&&pe.encryptionSchemes.push(Te),(le=se[0].robustness)&&!pe.videoRobustnessLevels.includes(le)&&pe.videoRobustnessLevels.push(le),(ge=Ie[0].robustness)&&!pe.audioRobustnessLevels.includes(ge)&&pe.audioRobustnessLevels.push(ge),"getStatusForPolicy"in Me){for(be=[],ht=m(s),Je=ht.next(),Ze={};!Je.done;Ze={rd:void 0},Je=ht.next())Ze.rd=Je.value,pe.minHdcpVersions.includes(Ze.rd)||be.push(Me.getStatusForPolicy({minHdcpVersion:Ze.rd}).then(function(vt){return function(Br){Br!="usable"||pe.minHdcpVersions.includes(vt.rd)||pe.minHdcpVersions.push(vt.rd)}}(Ze)));return S(rt,Promise.all(be),0)}rt.s(0)}})},T=function(ce,Y,Me,Re){var fe,se,Ie,pe,Te,le,ge,be,ht,Je;return P(function(Ze){switch(Ze.g){case 1:for(ue(Ze,2),fe=Gn(h),se=m(fe.videoCapabilities),Ie=se.next();!Ie.done;Ie=se.next())pe=Ie.value,pe.encryptionScheme=Y,pe.robustness=Me;for(Te=m(fe.audioCapabilities),le=Te.next();!le.done;le=Te.next())ge=le.value,ge.encryptionScheme=Y,ge.robustness=Re;return be=Gn(fe),be.persistentState="required",be.sessionTypes=["persistent-license"],ht=[be,fe],bi()?S(Ze,ys(5,navigator.requestMediaKeySystemAccess(ce,ht)),7):S(Ze,navigator.requestMediaKeySystemAccess(ce,ht),6);case 6:Je=Ze.h,Ze.s(5);break;case 7:Je=Ze.h;case 5:return S(Ze,y(ce,Je),8);case 8:me(Ze,0);break;case 2:ae(Ze),K(Ze)}})},v=function(ce,Y,Me,Re){var fe,se,Ie;return P(function(pe){switch(pe.g){case 1:return ue(pe,2),fe={type:"media-source",video:{contentType:c[0].contentType,width:640,height:480,bitrate:1,framerate:1},audio:{contentType:d[0].contentType,channels:2,bitrate:1,samplerate:1},keySystemConfiguration:{keySystem:ce,video:{encryptionScheme:Y,robustness:Me},audio:{encryptionScheme:Y,robustness:Re}}},bi()?S(pe,ys(5,navigator.mediaCapabilities.decodingInfo(fe)),7):S(pe,navigator.mediaCapabilities.decodingInfo(fe),6);case 6:se=pe.h,pe.s(5);break;case 7:se=pe.h;case 5:return Ie=se.keySystemAccess,S(pe,y(ce,Ie),8);case 8:me(pe,0);break;case 2:ae(pe),K(pe)}})},x=m(e),w=x.next();!w.done;w=x.next())A=w.value,f.set(A,null);for(I=function(ce){return!(ce==="org.w3.clearkey"&&Tt())},k=[],C=m(p),E=C.next();!E.done;E=C.next())for(M=E.value,D=m(e),_=D.next();!_.done;_=D.next())j=_.value,I(j)&&(k.push(T(j,M,"","")),k.push(v(j,M,"","")));for(L=m(e),N=L.next();!N.done;N=L.next())for(U=N.value,O=m(l[U]||[]),b=O.next();!b.done;b=O.next())V=b.value,I(U)&&(k.push(T(U,null,V,"")),k.push(T(U,null,"",V)),k.push(v(U,null,V,"")),k.push(v(U,null,"",V)));return S(H,Promise.all(k),2)}return H.return(td(f))})}function wg(e){return P(function(n){if(n.g==1)return ue(n,2),S(n,ys(ux,Promise.all([e.close().catch(function(){}),e.closed])),4);if(n.g!=2)return me(n,0);ae(n),K(n)})}function ws(e){var n;return P(function(i){return n=Array.from(e.i.entries()),e.i.clear(),S(i,Promise.all(n.map(function(r){r=m(r);var o=r.next().value,s=r.next().value;return P(function(u){if(u.g==1)return ue(u,2),e.ka||e.B.has(o.sessionId)||s.type!=="persistent-license"||e.g.persistentSessionOnlinePlayback?S(u,wg(o),5):S(u,o.remove(),5);if(u.g!=2)return me(u,0);ae(u),K(u)})})),0)})}function Eg(e){return(e.video?e.video.drmInfos:[]).concat(e.audio?e.audio.drmInfos:[])}function ix(e){e.i.forEach(function(n,i){var r=n.Vf,o=i.expiration;isNaN(o)&&(o=1/0),o!=r&&(e.C.onExpirationUpdated(i.sessionId,o),n.Vf=o)})}function Es(e){return e=e.i.values(),GS(e,function(n){return n.loaded})}function rx(e){for(var n=m(e.h&&e.h.keyIds||new Set([])),i=n.next();!i.done;i=n.next())if(e.Z.get(i.value)!=="usable")return!1;return!0}function ox(e,n){var i=[];for(n.forEach(function(r,o){i.push({keySystem:o,licenseServerUri:r,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",initData:[],keyIds:new Set})}),e=m(e),n=e.next();!n.done;n=e.next())n=n.value,n.video&&(n.video.drmInfos=i),n.audio&&(n.audio.drmInfos=i)}function Ag(e,n,i,r,o,s,u,a){var l=[];e=m(e);for(var c=e.next(),d={};!c.done;d={wa:void 0},c=e.next()){if(d.wa=c.value,n.includes(d.wa.encryptionScheme)||n.push(d.wa.encryptionScheme),d.wa.keySystem=="org.w3.clearkey"&&d.wa.licenseServerUri.startsWith("data:application/json;base64,")?l.includes(d.wa.licenseServerUri)||l.push(d.wa.licenseServerUri):i.includes(d.wa.licenseServerUri)||i.push(d.wa.licenseServerUri),o.includes(d.wa.serverCertificateUri)||o.push(d.wa.serverCertificateUri),d.wa.serverCertificate&&(r.some(function(f){return function(y){return ci(y,f.wa.serverCertificate)}}(d))||r.push(d.wa.serverCertificate)),d.wa.initData){c=m(d.wa.initData);for(var h=c.next(),p={};!h.done;p={Mf:void 0},h=c.next())p.Mf=h.value,s.some(function(f){return function(y){var T=f.Mf;return y.keyId&&y.keyId==T.keyId?!0:y.initDataType==T.initDataType&&ci(y.initData,T.initData)}}(p))||s.push(p.Mf)}if(d.wa.keyIds)for(c=m(d.wa.keyIds),h=c.next();!h.done;h=c.next())u.add(h.value);if(d.wa.keySystemUris&&a)for(d=m(d.wa.keySystemUris),c=d.next();!c.done;c=d.next())a.add(c.value)}if(l.length==1)i.push(l[0]);else if(0>10)+96)+String.fromCharCode(((e&960)>>5)+96)+String.fromCharCode((e&31)+96)}}function da(e,n,i){var r=e.S(),o=[],s=null;i&1&&(s=e.$f()),i&4&&e.skip(4);for(var u=0;ue?"0":"")+e}function Cr(e){if(!Bg){Bg=!0;var n=new Uint8Array([105,115,111,109]),i=new Uint8Array([97,118,99,49]),r=new Uint8Array([0,0,0,1]);ha=we("ftyp",n,r,n,i),n=we("dref",Ex),ad=we("dinf",n)}this.g=e}function mo(e){for(var n=[],i=m(e.g),r=i.next();!r.done;r=i.next()){var o=n,s=o.push,u=r.value;r=we;var a=u.id+1,l=u.stream.width||0,c=u.stream.height||0;u.type=="audio"&&(c=l=0);var d=u.duration*u.timescale,h=Math.floor(d/(qi+1));switch(d=Math.floor(d%(qi+1)),a=new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3].concat(X(ze(a,4)),[0,0,0,0],X(ze(h,4)),X(ze(d,4)),[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0],X(ze(l,2)),[0,0],X(ze(c,2)),[0,0])),a=we("tkhd",a),l=we,h=u.duration*u.timescale,c=Math.floor(h/(qi+1)),h=Math.floor(h%(qi+1)),d=u.stream.language,d=d.charCodeAt(0)-96<<10|d.charCodeAt(1)-96<<5|d.charCodeAt(2)-96,c=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3].concat(X(ze(u.timescale,4)),X(ze(c,4)),X(ze(h,4)),X(ze(d,2)),[0,0])),c=we("mdhd",c),h=u,d=new Uint8Array([]),h.type){case"video":d=fx;break;case"audio":d=gx}h=we("hdlr",d);e:{switch(u.type){case"video":u=we("minf",we("vmhd",Sx),ad,_g(u));break e;case"audio":u=we("minf",we("smhd",xx),ad,_g(u));break e}u=new Uint8Array([])}u=l("mdia",c,h,u),r=r("trak",a,u),s.call(o,r)}for(n=Qe.apply(At,X(n)),s=e.g[0],i=we,r=s.duration*s.timescale,o=Math.floor(r/(qi+1)),r=Math.floor(r%(qi+1)),o=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3].concat(X(ze(s.timescale,4)),X(ze(o,4)),X(ze(r,4)),[0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255])),o=we("mvhd",o),r=[],e=m(e.g),l=e.next();!l.done;l=e.next())u=r,a=u.push,l=new Uint8Array([0,0,0,0].concat(X(ze(l.value.id+1,4)),[0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),l=we("trex",l),a.call(u,l);if(e=Qe.apply(At,X(r)),e=we("mvex",e),r=[],s.encrypted){for(s=m(s.stream.drmInfos),u=s.next();!u.done;u=s.next())if(u=u.value,u.initData)for(u=m(u.initData),a=u.next();!a.done;a=u.next())r.push(a.value.initData);s=Qe.apply(At,X(r))}else s=new Uint8Array([]);return e=i("moov",o,n,e,s),n=new Uint8Array(ha.byteLength+e.byteLength),n.set(ha),n.set(e,ha.byteLength),n}function _g(e){var n=we,i="aac";e.codecs.includes("mp3")?i="mp3":e.codecs.includes("ac-3")?i=di()?"ec-3":"ac-3":e.codecs.includes("ec-3")?i="ec-3":e.codecs.includes("opus")&&(i="opus");var r=new Uint8Array([]);switch(e.type){case"video":if(e.codecs.includes("avc1")){if(i=e.stream.width||0,r=e.stream.height||0,0>8,s[h++]=u[l].length&255,s.set(u[l],h),h+=u[l].length;for(s[h++]=a.length,u=0;u>8,s[h++]=a[u].length&255,s.set(a[u],h),h+=a[u].length;o=o("avcC",s)}i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].concat(X(ze(i,2)),X(ze(r,2)),[0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17])),r="avc1",a=Ug(e),u=new Uint8Array([]),e.encrypted&&(u=Mr(0,e.stream,e.codecs),r="encv"),r=we(r,i,o,a,u)}else e.codecs.includes("hvc1")&&(r=e.stream.width||0,o=e.stream.height||0,i=new Uint8Array([]),0>>1,a<<7|o<<3,6,1,2])),i=i("esds",r)),r="mp4a",o=new Uint8Array([]),e.encrypted&&(o=Mr(0,e.stream,e.codecs),r="enca"),e=we(r,Ms(e),i,o)),r=e}return e=we("stsd",wx,r),n("stbl",e,we("stts",mx),we("stsc",yx),we("stsz",Tx),we("stco",vx))}function Ug(e){if(!e.Ia&&!e.Ka)return new Uint8Array([]);var n=e.Ka;return e=new Uint8Array([].concat(X(ze(e.Ia,4)),X(ze(n,4)))),we("pasp",e)}function Ms(e){return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.stream.channelsCount||2,0,16,0,0,0,0].concat(X(ze(e.stream.audioSamplingRate||44100,2)),[0,0]))}function Mr(e,n,i){e=we,i=new Uint8Array([].concat(X(ze(bg(i.split(".")[0]),4)))),i=we("frma",i);var r="cenc",o=n.drmInfos[0];o&&o.encryptionScheme&&(r=o.encryptionScheme),r=new Uint8Array([0,0,0,0].concat(X(ze(bg(r),4)),[0,1,0,0])),r=we("schm",r),o=we;var s=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);n=m(n.drmInfos);for(var u=n.next();!u.done;u=n.next())if((u=u.value)&&u.keyIds&&u.keyIds.size){u=m(u.keyIds);for(var a=u.next();!a.done;a=u.next())s=Og(a.value)}return n=new Uint8Array([0,0,0,0,0,0,1,8]),n=we("tenc",n,s),e("sinf",i,r,o("schi",n))}function ks(e){var n=[];e=m(e.g);for(var i=e.next();!i.done;i=e.next()){i=i.value;var r=n.push,o=r.apply,s=we,u=new Uint8Array([0,0,0,0].concat(X(ze(i.data?i.data.Db:0,4))));u=we("mfhd",u);var a,l=i.data?i.data.hb:[],c=new Uint8Array(4+l.length);for(a=0;a>8*n&255);return i}function Og(e){for(var n=new Uint8Array(e.length/2),i=0;i>24&255,o[1]=r>>16&255,o[2]=r>>8&255,o[3]=r&255,o.set(i,4),i=0,r=8;i>8*d&255);for(e.set(new Uint8Array(c),a),e.set(l,a+4),a=m(u),l=a.next();!l.done;l=a.next())l=l.value,pa(e,l.start,l.size+4)}}return e}function kx(e,n,i,r,o,s){var u=Mr(new Cr([]),e,r.name),a=n.subarray(r.start,r.start+r.size);for(e=new Uint8Array(r.size+u.byteLength),e.set(a,0),Gt(e).setUint32(4,s),e.set(u,r.size),pa(e,0,e.byteLength),s=new Uint8Array(n.byteLength+e.byteLength),r=Tt()||Vn()||zr()?r.start:r.start+r.size,u=n.subarray(r),s.set(n.subarray(0,r)),s.set(e,r),s.set(u,r+e.byteLength),n=m(o),o=n.next();!o.done;o=n.next())o=o.value,pa(s,o.start,o.size+e.byteLength);return e=Gt(s,i.start),i=zi(i),n=e.getUint32(i),e.setUint32(i,n+1),s}function pa(e,n,i){e=Gt(e,n),n=e.getUint32(0),n!=0&&(n==1?(e.setUint32(8,i>>32),e.setUint32(12,i&4294967295)):e.setUint32(0,i))}function Dx(e){function n(o){r.push({start:o.start,size:o.size}),he(o)}var i=oe(e),r=[];return new _e().box("moov",n).box("trak",n).box("mdia",n).box("minf",n).box("stbl",n).box("stsd",function(o){r.push({start:o.start,size:o.size});for(var s=Gt(i,o.start),u=0;ue.end(0)-e.start(0)}function ld(e){return!e||Ds(e)?null:e.length?e.end(e.length-1):null}function cd(e,n){return!e||!e.length||Ds(e)||n>e.end(e.length-1)?!1:n>=e.start(0)}function Gg(e,n){if(!e||!e.length||Ds(e))return 0;var i=0;e=m(Ii(e));for(var r=e.next();!r.done;r=e.next()){var o=r.value;r=o.start,o=o.end,o>n&&(i+=o-Math.max(r,n))}return i}function Rx(e,n,i){return!e||!e.length||Ds(e)?null:(e=Ii(e).findIndex(function(r,o,s){return r.start>n&&(o==0||s[o-1].end-n<=i)}),0<=e?e:null)}function Ii(e){if(!e)return[];for(var n=[],i=0;ie[n+3]&&255>e[n+4]&&128>e[n+6]&&128>e[n+7]&&128>e[n+8]&&128>e[n+9]}function zg(e,n){return n+10<=e.length&&e[n]===51&&e[n+1]===68&&e[n+2]===73&&255>e[n+3]&&255>e[n+4]&&128>e[n+6]&&128>e[n+7]&&128>e[n+8]&&128>e[n+9]}function hd(e,n){var i=(e[n]&127)<<21;return i|=(e[n+1]&127)<<14,i|=(e[n+2]&127)<<7,i|=e[n+3]&127}function Lx(e){var n={key:e.type,description:"",data:"",mimeType:null,pictureType:null};if(e.type==="APIC"){if(2>e.size||e.data[0]!==3)return null;var i=e.data.subarray(1).indexOf(0);if(i===-1)return null;var r=We(oe(e.data,1,i)),o=e.data[2+i],s=e.data.subarray(3+i).indexOf(0);if(s===-1)return null;var u=We(oe(e.data,3+i,s)),a;return r==="-->"?a=We(oe(e.data,4+i+s)):a=vn(e.data.subarray(4+i+s)),n.mimeType=r,n.pictureType=o,n.description=u,n.data=a,n}return e.type==="TXXX"?2>e.size||e.data[0]!==3||(r=e.data.subarray(1).indexOf(0),r===-1)?null:(i=We(oe(e.data,1,r)),e=We(oe(e.data,2+r)).replace(/\0*$/,""),n.description=i,n.data=e,n):e.type==="WXXX"?2>e.size||e.data[0]!==3||(r=e.data.subarray(1).indexOf(0),r===-1)?null:(i=We(oe(e.data,1,r)),e=We(oe(e.data,2+r)).replace(/\0*$/,""),n.description=i,n.data=e,n):e.type==="PRIV"?2>e.size||(i=e.data.indexOf(0),i===-1)?null:(i=We(oe(e.data,0,i)),n.description=i,i=="com.apple.streaming.transportStreamTimestamp"?(i=e.data.subarray(i.length+1),e=i[3]&1,i=(i[4]<<23)+(i[5]<<15)+(i[6]<<7)+i[7],i/=45,e&&(i+=4772185884e-2),n.data=i):(e=vn(e.data.subarray(i.length+1)),n.data=e),n):e.type[0]==="T"?2>e.size||e.data[0]!==3?null:(e=We(e.data.subarray(1)).replace(/\0*$/,""),n.data=e,n):e.type[0]==="W"?(e=We(e.data).replace(/\0*$/,""),n.data=e,n):e.data?(n.data=vn(e.data),n):null}function kr(e){for(var n=0,i=[];Wg(e,n);){var r=hd(e,n+6);for(e[n+5]>>6&1&&(n+=10),n+=10,r=n+r;n+10>6&1&&(r+=10),r+=10,r+=hd(e,n+6),zg(e,n+10)&&(r+=10),n+=r;return 0>>32-i;return e.g-=i,0>>n)!==0)return e.h<<=n,e.g-=n,n;return pd(e),n+fd(e)}function zt(e){nn(e,1+fd(e))}function z(e){var n=fd(e);return Se(e,n+1)-1}function vo(e){return e=z(e),1&e?1+e>>>1:-1*(e>>>1)}function Q(e){return Se(e,1)===1}function ke(e){return Se(e,8)}function ga(e,n){for(var i=8,r=8,o=0;oe.length)return this;for(var n=Math.max(0,md(e)),i=e.length-(e.length+n)%188,r=!1,o=n;o>4){var a=o+5+e[o+4];if(a==o+188)continue}else a=o+4;switch(u){case 0:s&&(a+=e[a]+1),this.G=(e[a+10]&31)<<8|e[a+11];break;case 17:case 8191:break;case this.G:s&&(a+=e[a]+1),s=e,u={audio:-1,video:-1,ee:-1,audioCodec:"",videoCodec:""};var l=a+3+((s[a+1]&15)<<8|s[a+2])-4;for(a+=12+((s[a+10]&15)<<8|s[a+11]);an.byteLength-6)return null;var r=n[7];if(r&192){var o=536870912*(n[9]&14)+4194304*(n[10]&255)+16384*(n[11]&254)+128*(n[12]&255)+(n[13]&254)/2;e.u==null&&(e.u=o),i.pts=Yg(o,e.u),e.u=i.pts,i.dts=i.pts,r&64&&(r=536870912*(n[14]&14)+4194304*(n[15]&255)+16384*(n[16]&254)+128*(n[17]&255)+(n[18]&254)/2,e.o==null&&(e.o=r),i.dts=Yg(r,e.o)),e.o=i.dts}return e=n[8]+9,n.byteLength<=e?null:(i.data=n.subarray(e),i)}g.hj=function(e){return Ce("TsParser.parseAvcNalus","Please use parseNalus function instead."),this.Xf(e,{Bd:null,state:null})},g.Xf=function(e,n){var i=e.pts?e.pts/9e4:null;e=e.data;var r=e.byteLength,o=1;this.m=="hvc"&&(o=2);var s=n.state||0,u=s,a=0,l=[],c=-1,d=0;for(s==-1&&(c=0,d=this.m=="hvc"?e[0]>>1&63:e[0]&31,s=0,a=1);a>1&63:e[a]&31,c=a,s=0):s=-1):s=0:s=3:s=h?0:1}return 0<=c&&0<=s&&l.push({data:e.subarray(c+o,r),fullData:e.subarray(c,r),type:d,time:i,state:s}),!l.length&&n.Bd&&(i=l.length?l[l.length-1]:n.Bd)&&(i.data=Qe(i.data,e),i.fullData=Qe(i.fullData,e)),n.state=s,l},g.getMetadata=function(){for(var e=[],n=m(this.l),i=n.next();!i.done;i=n.next())i=Qe.apply(At,X(i.value)),(i=gd(this,i))&&e.push({cueTime:i.pts?i.pts/9e4:null,data:i.data,frames:kr(i.data),dts:i.dts,pts:i.pts});return e},g.cb=function(){if(this.i.length&&!this.h.length){for(var e=!1,n=m(this.i),i=n.next();!i.done;i=n.next()){var r=Qe.apply(At,X(i.value)),o=gd(this,r);i=this.h.length?this.h[this.h.length-1]:null,o&&o.pts!=null&&o.dts!=null&&(!i||i.pts!=o.pts&&i.dts!=o.dts)?(this.h.length&&o.dts<(i.dts||0)&&(e=!0),this.h.push(o)):this.h.length&&(r=o?o.data:r)&&(i=this.h.pop(),i.data=Qe(i.data,r),this.h.push(i))}e&&(this.h=this.h.sort(function(s,u){var a=(s.pts||0)-(u.pts||0);return(s.dts||0)-(u.dts||0)||a}))}return this.h},g.vc=function(e){if(e=e===void 0?!0:e,this.j.length&&!this.g.length){for(var n=!1,i=m(this.j),r=i.next();!r.done;r=i.next()){var o=Qe.apply(At,X(r.value)),s=gd(this,o);r=this.g.length?this.g[this.g.length-1]:null,s&&s.pts!=null&&s.dts!=null&&(!r||r.pts!=s.pts&&r.dts!=s.dts)?(this.g.length&&s.dts<(r.dts||0)&&(n=!0),this.g.push(s)):this.g.length&&(o=s?s.data:o)&&(r=this.g.pop(),r.data=Qe(r.data,o),this.g.push(r))}if(e){for(i={Bd:null,state:null},r=[],o=m(this.g),s=o.next();!s.done;s=o.next())s=s.value,s.nalus=this.Xf(s,i),s.nalus.length&&(r.push(s),i.Bd=s.nalus[s.nalus.length-1]);this.g=r}n&&(this.g=this.g.sort(function(u,a){var l=(u.pts||0)-(a.pts||0);return(u.dts||0)-(a.dts||0)||l}))}return e?this.g:(e=this.g,this.g=[],e)},g.getStartTime=function(e){if(e=="audio"){e=null;var n=this.cb();return n.length&&(e=n[0],e=Math.min(e.dts,e.pts)/9e4),e}return e=="video"?(e=null,n=this.vc(!1),n.length&&(e=n[0],e=Math.min(e.dts,e.pts)/9e4),e):null},g.md=function(){return{audio:this.A,video:this.m}},g.de=function(){for(var e=[],n=m(this.vc()),i=n.next();!i.done;i=n.next())e.push.apply(e,X(i.value.nalus));return e},g.Mi=function(){Ce("TsParser.getVideoResolution","Please use getVideoInfo function instead.");var e=this.Kf();return{height:e.height,width:e.width}},g.Kf=function(){return this.m=="hvc"?_x(this):jx(this)};function qg(e){var n=e.vc();return 1a?ga(i,16):ga(i,64))}}if(zt(i),u=z(i),u===0)z(i);else if(u===1)for(nn(i,1),zt(i),zt(i),u=z(i),a=0;ax;x++)Se(r,2);for(x=0;xE;E++)C|=(k>>E&1)<<31-E;return C>>>0}(l),u=u==1?"H":"L",s="hvc1"+("."+["","A","B","C"][s]+a),s+="."+r.toString(16).toUpperCase(),s+="."+u+y,f&&(s+="."+f.toString(16).toUpperCase()),p&&(s+="."+p.toString(16).toUpperCase()),h&&(s+="."+h.toString(16).toUpperCase()),d&&(s+="."+d.toString(16).toUpperCase()),c&&(s+="."+c.toString(16).toUpperCase()),i&&(s+="."+i.toString(16).toUpperCase()),n.codec=s,n.frameRate=qg(e),n}function Yg(e,n){var i=1;for(e>n&&(i=-1);4294967296md(e))}function md(e){for(var n=Math.min(1e3,e.length-564),i=0;ie.start(0)?0:e.length?e.start(0):null):e=null,e}function Rr(e,n){return e.l.size?n==ye?e.h.h:ld(xo(e,n)):null}function Vx(e,n,i){return n==ye?(e=e.h,e.h==null||e.hn?S(s,gt(r,e,function(){return Ta(r,e,n,i)},null),5):s.s(0)):r.m?S(s,gt(r,o.V,function(){return Ta(r,o.V,n,i)},null),0):s.s(0)})};function Jg(e,n){var i;return P(function(r){return r.g==1?(i=ot,n==i.va?e.h?S(r,e.h.remove(0,1/0),0):r.return():S(r,gt(e,n,function(){return Ta(e,n,0,e.i.duration)},null),4)):e.m?S(r,gt(e,i.V,function(){return Ta(e,i.V,0,e.i.duration)},null),0):r.s(0)})}g.flush=function(e){var n=this,i;return P(function(r){return r.g==1?(i=ot,e==i.va?r.return():S(r,gt(n,e,function(){n.g.currentTime-=.001,Mi(n,e)},null),2)):n.m?S(r,gt(n,i.V,function(){var o=i.V;n.g.currentTime-=.001,Mi(n,o)},null),0):r.s(0)})};function Xx(e,n,i,r,o,s,u,a,l){var c,d,h;return P(function(p){return p.g==1?(c=ot,n==c.va?(s||(e.h.u=i),ES(e.h,r,o),p.return()):(d=[],S(p,Qx(e,n,u,a,l),2))):(h=p.h,h||(d.push(gt(e,n,function(){return wo(e,n)},null)),e.m&&d.push(gt(e,c.V,function(){return wo(e,c.V)},null))),s||(d.push(gt(e,n,function(){return Eo(e,n,i)},null)),e.m&&d.push(gt(e,c.V,function(){return Eo(e,c.V,i)},null))),(r!=0||o!=1/0)&&(d.push(gt(e,n,function(){var f=e.l.get(n);f.appendWindowStart=0,f.appendWindowEnd=o,f.appendWindowStart=r,Mi(e,n)},null)),e.m&&d.push(gt(e,c.V,function(){var f=c.V,y=e.l.get(f);y.appendWindowStart=0,y.appendWindowEnd=o,y.appendWindowStart=r,Mi(e,f)},null))),d.length?S(p,Promise.all(d),0):p.s(0))})}function Wx(e,n,i){var r,o;return P(function(s){return s.g==1?(r=ot,n==r.va||(n==r.la&&(e.Fa=new Ne),!e.F||(o=Rr(e,n))&&.1>Math.abs(o-i))?s.return():(gt(e,n,function(){return wo(e,n)},null),e.m&>(e,r.V,function(){return wo(e,r.V)},null),S(s,gt(e,n,function(){return Eo(e,n,i)},null),2))):e.m?S(s,gt(e,r.V,function(){return Eo(e,r.V,i)},null),0):s.s(0)})}g.endOfStream=function(e){var n=this;return P(function(i){return S(i,Rs(n,function(){Dr(n)||So(n)||(e?n.i.endOfStream(e):n.i.endOfStream())}),0)})},g.$a=function(e){var n=this;return P(function(i){return S(i,Rs(n,function(){if(ei&&(i+=.001);var r=!0;e.T=="HLS"&&(r=Rr(e,n),r=!r||.15=n.o&&r&&!n.h)&&(n.i&&n.i(n.g,o),n.h=!0,n.g=i.g.currentTime),n=!r}n&&(n=e.g.currentTime,i=e.g.buffered,r=Rx(i,n,e.h.gapDetectionThreshold),r==null||r==0&&!e.A||(o=i.start(r),(s=e.h.gapPadding)&&(o=Math.ceil(100*(o+s))/100),o>=e.B.mb()||.001>o-n||(r!=0&&i.end(r-1),e.g.currentTime=o,n==e.j&&(e.j=o),e.C++,e.u(new G("gapjumped")))))}}}function ew(e){if(!e.h.stallEnabled)return null;var n=e.h.stallSkip;return new nm(new tw(e.g),e.h.stallThreshold,function(){var i;return P(function(r){if(r.g==1)return i=Ii(e.g.buffered),i.length?n?(e.g.currentTime+=n,r.s(2)):S(r,e.g.play(),3):r.return();if(r.g!=2){if(!e.g)return r.return();e.g.pause(),e.g.play()}e.G++,e.u(new G("stalldetected")),K(r)})})}function nm(e,n,i){this.j=e,this.m=im(e),this.g=e.g.currentTime,this.l=Date.now()/1e3,this.h=!1,this.o=n,this.i=i}nm.prototype.release=function(){this.i=this.j=null};function tw(e){this.g=e}function im(e){if(e.g.paused||e.g.playbackRate==0||e.g.buffered.length==0)var n=!1;else e:{n=e.g.currentTime,e=m(Ii(e.g.buffered));for(var i=e.next();!i.done;i=e.next())if(i=i.value,!(ni.end-.5)){n=!0;break e}n=!1}return n}function Ao(e,n,i,r){n==HTMLMediaElement.HAVE_NOTHING||e.readyState>=n?r():(n=nw.value().get(n),i.qa(e,n,r))}var nw=new ns(function(){return new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]])});function rm(e,n,i,r){var o=this;this.g=e,this.m=n,this.u=i,this.l=null,this.j=function(){return o.l==null&&(o.l=r()),o.l},this.o=!1,this.h=new Pe,this.i=new am(e),Ao(this.g,HTMLMediaElement.HAVE_METADATA,this.h,function(){sm(o,o.j())})}rm.prototype.release=function(){this.h&&(this.h.release(),this.h=null),this.i!=null&&(this.i.release(),this.i=null),this.m=function(){},this.g=null};function Ed(e){return e.o?e.g.currentTime:e.j()}function om(e,n){0Math.abs(e.g.currentTime-n)?um(e):(e.h.qa(e.g,"seeking",function(){um(e)}),lm(e.i,e.g.currentTime&&e.g.currentTime!=0?e.g.currentTime:n))}function um(e){e.o=!0,e.h.D(e.g,"seeking",function(){return e.m()}),e.u(e.g.currentTime)}function am(e){var n=this;this.g=e,this.m=10,this.j=this.l=this.i=0,this.h=new ve(function(){0>=n.i||n.g.currentTime!=n.l||n.g.currentTime===n.j?n.h.stop():(n.g.currentTime=n.j,n.i--)})}am.prototype.release=function(){this.h&&(this.h.stop(),this.h=null),this.g=null};function lm(e,n){e.l=e.g.currentTime,e.j=n,e.i=e.m,e.g.currentTime=n,e.h.ua(.1)}function cm(e){this.h=e,this.j=!1,this.g=null,this.i=new Pe}g=cm.prototype,g.ready=function(){function e(){if(n.g==null||n.g==0&&n.h.duration!=1/0)n.j=!0;else{var i=n.h.currentTime,r=n.g;0>n.g&&(r=Math.max(0,i+n.g)),i!=r?(n.i.qa(n.h,"seeking",function(){n.j=!0}),n.h.currentTime=r):n.j=!0}}var n=this;Ao(this.h,HTMLMediaElement.HAVE_CURRENT_DATA,this.i,function(){e()})},g.release=function(){this.i&&(this.i.release(),this.i=null),this.h=null},g.af=function(e){this.g=this.j?this.g:e},g.Pd=function(){return(this.j?this.h.currentTime:this.g)||0},g.Ag=function(){return 0},g.zg=function(){return 0},g.hh=function(){};function dm(e,n,i,r,o,s){var u=this;this.i=e,this.g=n.presentationTimeline,this.l=i,this.u=o,this.o=null,this.j=new wd(e,n.presentationTimeline,i,s),this.h=new rm(e,function(){e:{var a=u.j;a.l=!0,a.A=!1,a.i&&a.i.ua(a.h.gapJumpTimerTime),Ps(a);var l=Ed(u.h);if(a=pm(u,l),!Tf()&&.001u.g.getDuration()?u.g.Fb():u.g.mb():0>a&&(a=u.g.mb()+a),hm(u,fm(u,a))}),this.m=new ve(function(){if(u.i.readyState!=0&&!u.i.paused){var a=Ed(u.h),l=u.g.Fb(),c=u.g.mb();3>c-l&&(l=c-3),a=i?i-e.l.durationBackoff:n}function pm(e,n){var i=e.l.rebufferingGoal,r=e.l.safeSeekOffset,o=e.g.Fb(),s=e.g.mb(),u=e.g.getDuration();3>s-o&&(o=s-3);var a=e.g.od(i),l=e.g.od(r);return i=e.g.od(i+r),n>=u?hm(e,n):n>s?s-e.l.safeSeekEndOffset:n=a||cd(e.i.buffered,n)?n:i}function fm(e,n){var i=e.g.Fb();return ne?e:n)}function Ae(e){this.g=e,this.m=null,this.i=0,this.o=!1}g=Ae.prototype,g.getNumReferences=function(){return this.g.length},g.getNumEvicted=function(){return this.i},g.release=function(){this.o||(this.g=[],this.m&&this.m.stop(),this.m=null)},g.bj=function(){this.o=!0},g.vb=function(e){for(var n=m(this.g),i=n.next();!i.done;i=n.next())e(i.value)};function Wn(e){return e.g[0]||null}g.find=function(e){for(var n=this.g.length-1,i=n;0<=i;--i){var r=this.g[i],o=i=r.startTime&&ee||e>=this.g.length?null:this.g[e])},g.offset=function(e){if(!this.o)for(var n=m(this.g),i=n.next();!i.done;i=n.next())i.value.offset(e)},g.me=function(e){if(!this.o&&e.length){var n=Math.round(1e3*e[0].startTime)/1e3;this.g=this.g.filter(function(i){return Math.round(1e3*i.startTime)/1e3n&&(i.g.length==0||r.endTime>i.g[0].startTime)}),this.me(e),this.Oa(n)},g.Oa=function(e){if(!this.o){var n=this.g.length;this.g=this.g.filter(function(i){return i.endTime>e}),this.i+=n-this.g.length}},g.Nc=function(e,n,i){if(i=i===void 0?!1:i,!this.o){for(;this.g.length&&this.g[this.g.length-1].startTime>=n;)this.g.pop();for(;this.g.length&&this.g[0].endTime<=e;)this.g.shift(),i||this.i++;this.g.length!=0&&(e=this.g[this.g.length-1],n=new J(e.startTime,n,e.C,e.startByte,e.endByte,e.Y,e.timestampOffset,e.appendWindowStart,e.appendWindowEnd,e.g,e.tilesLayout,e.B,e.h,e.status,e.aesKey),n.mimeType=e.mimeType,n.codecs=e.codecs,n.i=e.i,this.g[this.g.length-1]=n)}},g.Je=function(e,n){var i=this;this.o||(this.m&&this.m.stop(),this.m=new ve(function(){var r=n();r?i.g.push.apply(i.g,X(r)):(i.m.stop(),i.m=null)}),this.m.ua(e))},Ae.prototype[Symbol.iterator]=function(){return this.Eb(0)},Ae.prototype.Eb=function(e,n,i){n=n===void 0?!1:n,i=i===void 0?!1:i;var r=this.find(e);if(r==null)return null;var o=this.get(r);i?r++:r--;var s=-1;if(o&&0=a.startTime&&e=e.g.length&&(this.h++,this.g=0,e=this.i.get(this.h)),e&&0this.g&&(this.h--,this.g=(e=this.i.get(this.h))&&0=this.g);)this.g--,n=e.g[this.g]},W("shaka.media.SegmentIterator",Sn),Sn.prototype.resetToLastIndependent=Sn.prototype.dg,Sn.prototype.next=Sn.prototype.next,Sn.prototype.current=Sn.prototype.current,Sn.prototype.currentPosition=Sn.prototype.ci,Sn.prototype.setReverse=Sn.prototype.cd;function Ye(){Ae.call(this,[]),this.h=[]}wt(Ye,Ae),g=Ye.prototype,g.clone=function(){var e=new Ye;return e.h=this.h.slice(),e.i=this.i,e},g.release=function(){for(var e=m(this.h),n=e.next();!n.done;n=e.next())n.value.release();this.h=[]},g.vb=function(e){for(var n=m(this.h),i=n.next();!i.done;i=n.next())i.value.vb(e)},g.find=function(e){for(var n=this.i,i=m(this.h),r=i.next();!r.done;r=i.next()){r=r.value;var o=r.find(e);if(o!=null)return o+n;n+=r.getNumEvicted()+r.getNumReferences()}return null},g.get=function(e){for(var n=this.i,i=m(this.h),r=i.next();!r.done;r=i.next()){r=r.value;var o=r.get(e-n);if(o)return o;o=r.getNumReferences(),n+=r.getNumEvicted()+o}return null},g.offset=function(){},g.me=function(){},g.Oa=function(e){for(var n=m(this.h),i=n.next();!i.done;i=n.next())i.value.Oa(e);for(;1=i}),0<=n?r.splice(n,r[n].position==i?1:0,e):r.push(e)}xa.prototype.j=function(e){for(var n=m(this.g.values()),i=n.next();!i.done;i=n.next()){i=i.value;var r=i.mf;e:{for(var o=i.Id,s=o.length-1;0<=s;s--){var u=o[s];if(u.position<=e){o=u.Uc;break e}}o=null}s=o&&!(r===o||r&&o&&r.bandwidth==o.bandwidth&&r.audioSamplingRate==o.audioSamplingRate&&r.codecs==o.codecs&&r.contentType==o.contentType&&r.frameRate==o.frameRate&&r.height==o.height&&r.mimeType==o.mimeType&&r.channelsCount==o.channelsCount&&r.pixelAspectRatio==o.pixelAspectRatio&&r.width==o.width),u=o&&r&&o.label&&r.label&&r.label!==o.label;var a=o&&r&&o.language&&r.language&&r.language!==o.language;r=o&&r&&o.roles&&r.roles&&!Zr(r.roles,o.roles),(u||a||r)&&mm(this,e,o.contentType)&&(i.mf=o,r=new G("audiotrackchange",new Map([["quality",o],["position",e]])),this.dispatchEvent(r)),s&&mm(this,e,o.contentType)&&(i.mf=o,JSON.stringify(o),i=new G("qualitychange",new Map([["quality",o],["position",e]])),this.dispatchEvent(i))}};function mm(e,n,i){return!!((e=e.h()[i])&&0=e[0].start&&n=r)})}else n.Id=[]}function wa(e){var n={bandwidth:e.bandwidth||0,audioSamplingRate:null,codecs:e.codecs,contentType:e.type,frameRate:null,height:null,mimeType:e.mimeType,channelsCount:null,pixelAspectRatio:null,width:null,label:null,roles:e.roles,language:null};return e.type=="video"&&(n.frameRate=e.frameRate||null,n.height=e.height||null,n.pixelAspectRatio=e.pixelAspectRatio||null,n.width=e.width||null),e.type=="audio"&&(n.audioSamplingRate=e.audioSamplingRate,n.channelsCount=e.channelsCount,n.label=e.label||null,n.language=e.language),n}function Ns(e){je.call(this),this.h=new Map,this.i=e,this.g=null}wt(Ns,je),Ns.prototype.release=function(){this.h.clear(),this.g&&(this.g.stop(),this.g=null),je.prototype.release.call(this)};function Cd(e,n){var i=n.schemeIdUri+"_"+n.id+"_"+(n.startTime.toFixed(1)+"_"+n.endTime.toFixed(1));e.h.has(i)||(e.h.set(i,n),n=new G("regionadd",new Map([["region",n]])),e.dispatchEvent(n),sw(e))}function sw(e){e.g||(e.g=new ve(function(){for(var n=e.i(),i=m(e.h),r=i.next();!r.done;r=i.next()){var o=m(r.value);r=o.next().value,o=o.next().value,o.endTimer.endTime&&_s(this,r);n&&Md(this)},Ea.prototype.cd=function(e){this.o=e,this.g&&this.g.cd(e)};function Md(e){for(var n=Array.from(e.h.keys()),i=m(e.j.keys()),r=i.next(),o={};!r.done;o={Nf:void 0},r=i.next())o.Nf=r.value,n.some(function(s){return function(u){return fa(u.Y,s.Nf)}}(o))||_s(e,o.Nf)}function Tm(e,n){e.m=n;for(var i=Array.from(e.h.keys());i.length>n;){var r=i.pop();r&&_s(e,r)}Md(e)}function aw(e,n){n&&n!==e.i&&(zn(e),e.i=n)}function _s(e,n){var i=e.h;n instanceof Wt&&(i=e.j),e=i.get(n),i.delete(n),e&&e.abort()}function kd(e){this.g=e,this.Ed=this.pg=null}function Sm(e,n,i){var r=new Uint8Array(0);return e.Ed=e.g(n,i,function(o){return P(function(s){if(s.g==1)return 0>3,_===31&&E.ta()&&(_=32+((D&7)<<3)+((E.X()&224)>>5)),M+="."+_)),u.push(M),l=!0}).box("ac-3",o).box("ec-3",o).box("ac-4",o).box("Opus",o).box("fLaC",o).box("avc1",r).box("avc3",r).box("hev1",r).box("hvc1",r).box("dva1",r).box("dvav",r).box("dvh1",r).box("dvhe",r).box("vp09",r).box("av01",r).box("avcC",function(E){var M=x||"";switch(x){case"dvav":M="avc3";break;case"dva1":M="avc1"}E=E.reader,E.skip(1),E=M+"."+Cs(E.X())+Cs(E.X())+Cs(E.X()),a.push(E),c=!0}).box("hvcC",function(E){var M=x||"";switch(x){case"dvh1":M="hvc1";break;case"dvhe":M="hev1"}var D=E.reader;D.skip(1),E=D.X();var _=["","A","B","C"][E>>6],j=E&31,L=D.S(),N=(E&32)>>5?"H":"L";E=[D.X(),D.X(),D.X(),D.X(),D.X(),D.X()],D=D.X();for(var U=0,O=0;32>O&&(U|=L&1,O!=31);O++)U<<=1,L>>=1;for(M=M+("."+_+j)+("."+Cs(U,!0)),M+="."+N+D,_="",j=E.length;j--;)((N=E[j])||_)&&(_="."+N.toString(16).toUpperCase()+_);M+=_,a.push(M),c=!0}).box("dvcC",function(E){var M=x||"";switch(x){case"hvc1":M="dvh1";break;case"hev1":M="dvhe";break;case"avc1":M="dva1";break;case"avc3":M="dvav";break;case"av01":M="dav1"}var D=E.reader;D.skip(2),E=D.X(),D=D.X(),a.push(M+"."+tn(E>>1&127)+"."+tn(E<<5&32|D>>3&31)),c=!0}).box("dvvC",function(E){var M=x||"";switch(x){case"hvc1":M="dvh1";break;case"hev1":M="dvhe";break;case"avc1":M="dva1";break;case"avc3":M="dvav";break;case"av01":M="dav1"}var D=E.reader;D.skip(2),E=D.X(),D=D.X(),a.push(M+"."+tn(E>>1&127)+"."+tn(E<<5&32|D>>3&31)),c=!0}).R("vpcC",function(E){var M=x||"",D=E.reader;E=D.X();var _=D.X();D=D.X()>>4&15,a.push(M+"."+tn(E)+"."+tn(_)+"."+tn(D)),c=!0}).box("av1C",function(E){var M=x||"";switch(x){case"dav1":M="av01"}var D=E.reader;D.skip(1),E=D.X(),D=D.X();var _=E>>>5,j=(D&64)>>6;a.push(M+"."+_+"."+tn(E&31)+(D>>>7?"H":"M")+"."+tn(_===2&&j?(D&32)>>5?12:10:j?10:8)+"."+((D&16)>>4)+"."+((D&8)>>3)+((D&4)>>2)+(D&3)+"."+tn(1)+"."+tn(1)+"."+tn(1)+".0"),c=!0}).box("enca",na).box("encv",en).box("sinf",he).box("frma",function(E){E=ud(E.reader).codec,s(E)}).box("colr",function(E){a=a.map(function(_){if(_.startsWith("av01.")){var j=E.reader,L=j.Ba(),N=j.Cb(4),U=String.fromCharCode(N[0]);if(U+=String.fromCharCode(N[1]),U+=String.fromCharCode(N[2]),U+=String.fromCharCode(N[3]),U==="nclx"){N=j.ma(),U=j.ma();var O=j.ma(),b=j.X()>>7,V=_.split(".");V.length==10&&(V[6]=tn(N),V[7]=tn(U),V[8]=tn(O),V[9]=String(b),_=V.join("."))}j.seek(L)}return _});var M=hx(E.reader),D=M.colorGamut;T=M.Md,v=D}).parse(e||n,!0),!u.length&&!a.length)return null;var w=l&&!c,A=new Map;if(c&&!i){i=new an("video/mp4"),e&&i.init(e);try{i.i(n);for(var I=m(i.j()),k=I.next();!k.done;k=I.next()){var C=k.value;A.set(C,C)}}catch{}i.g()}return{type:w?"audio":"video",mimeType:w?"audio/mp4":"video/mp4",codecs:Rd(u.concat(a)).join(", "),language:d,height:h,width:p,channelCount:f,sampleRate:y,closedCaptions:A,Md:T,colorGamut:v,frameRate:null}}function Rd(e){var n=new Set,i=[];e=m(e);for(var r=e.next();!r.done;r=e.next()){r=r.value;var o=Xi(r);n.has(o)||(i.push(r),n.add(o))}return n=Ac("audio",i),r=Ac("video",i),e=Ac(ye,i),r=cw(r),n=n.concat(r).concat(e),i.length&&!n.length?i:n}function cw(e){if(1>=e.length)return e;var n=e.find(function(i){return i.startsWith("dvav.")||i.startsWith("dva1.")||i.startsWith("dvh1.")||i.startsWith("dvhe.")||i.startsWith("dav1.")||i.startsWith("dvc1.")||i.startsWith("dvi1.")});return n?St('video/mp4; codecs="'+n+'"')?[n]:e.filter(function(i){return i!=n}):e}function dw(e){var n=null;return new _e().box("moov",he).box("trak",he).box("mdia",he).box("minf",he).box("stbl",he).R("stsd",Ei).box("encv",en).box("enca",na).box("sinf",he).box("schi",he).R("tenc",function(i){i=i.reader,i.X(),i.X(),i.X(),i.X(),n=fi(i.Cb(16))}).parse(e,!0),n}function Pd(e,n,i){var r,o,s,u,a;return P(function(l){if(l.g==1)return r=n,r.cryptoKey?l.s(2):S(l,r.fetchKey(),3);if(o=r.iv,!o)for(o=oe(new ArrayBuffer(16)),s=r.firstMediaSequenceNumber+i,u=o.byteLength-1;0<=u;u--)o[u]=s&255,s>>=8;return n.blockCipherMode=="CBC"?a={name:"AES-CBC",iv:o}:a={name:"AES-CTR",counter:o,length:64},l.return(F.crypto.subtle.decrypt(a,r.cryptoKey,e))})}function Us(e,n,i,r,o){return e=lt(e,r,o),(n!=0||i!=null)&&(e.headers.Range=i?"bytes="+n+"-"+i:"bytes="+n+"-"),e}function xm(e,n){var i=this;this.g=n,this.j=e,this.h=null,this.J=new Map,this.C=1,this.u=this.l=null,this.O=0,this.i=new Map,this.I=!1,this.P=null,this.B=!1,this.m=new ho(function(){return hw(i)}),this.L=Date.now()/1e3,this.o=new Map,this.M={projection:null,hfov:null},this.W=0,this.T=1/0,this.F=null,this.A=new ve(function(){if(i.j&&i.g)if(i.j.presentationTimeline.U()){var r=i.j.presentationTimeline.Fb(),o=i.j.presentationTimeline.mb();1e.g.eb(),r=m(e.i.values()),o=r.next();!o.done;o=r.next())o=o.value,o.ja&&o.ja.cd(i),o.ba&&o.ba.cd(i);for(r=m(e.o.values()),o=r.next();!o.done;o=r.next())o.value.cd(i);(i=e.i.get("video"))&&(r=i.stream)&&(n?(n=r.trickModeVideo)&&!i.hc&&(Io(e,n,!1,0,!1),i.hc=r):(n=i.hc)&&(i.hc=null,Io(e,n,!0,0,!1)))}function wm(e,n,i,r,o,s){i=i===void 0?!1:i,r=r===void 0?0:r,o=o===void 0?!1:o,s=s===void 0?!1:s,e.l=n,e.I&&(n.video&&Io(e,n.video,i,r,o,s),n.audio&&Io(e,n.audio,i,r,o,s))}function Aa(e,n){P(function(i){if(i.g==1)return e.F=null,e.u=n,e.I?n.segmentIndex?i.s(2):S(i,n.createSegmentIndex(),2):i.return();Io(e,n,!0,0,!1),K(i)})}function mw(e,n){for(var i=m(e.J.entries()),r=i.next();!r.done;r=i.next()){var o=m(r.value);r=o.next().value,o=o.next().value,r.includes(n.type)&&(o(),e.J.delete(r))}}function Io(e,n,i,r,o,s){var u=e.i.get(n.type);u||n.type!=ye?u&&(u.hc&&(n.trickModeVideo?(u.hc=n,n=n.trickModeVideo):u.hc=null),u.stream!=n||o)&&(e.o.has(n)?u.ba=e.o.get(n):u.ba&&aw(u.ba,n),n.type==ye&&(o=et(n.mimeType,n.codecs),ya(e.g.aa,o,e.j.sequenceMode,n.external)),!e.o.has(u.stream)&&u.stream.closeSegmentIndex&&(u.Da?(o="("+u.type+":"+u.stream.id+")",e.J.has(o)||e.J.set(o,u.stream.closeSegmentIndex)):u.stream.closeSegmentIndex()),o=u.stream.isAudioMuxedInVideo!=n.isAudioMuxedInVideo,u.stream=n,u.ja=null,u.bf=!!s,n.dependencyStream?u.ld=Ca(e,n.dependencyStream):u.ld=null,o?ka(e,!0,!1):(i?u.oc?u.Se=!0:u.Da?(u.mc=!0,u.Wd=r,u.Se=!0):(Co(u),Od(e,u,!0,r).catch(function(a){e.g&&e.g.onError(a)})):u.Da||u.ib||Ot(e,u,0),yw(e,u).catch(function(a){e.g&&e.g.onError(a)}))):fw(e,n)}function yw(e,n){var i,r;return P(function(o){if(o.g==1)return n.pb?(i=n.stream,r=n.pb,i.segmentIndex?o.s(2):S(o,i.createSegmentIndex(),2)):o.return();if(n.pb!=r||n.stream!=i)return o.return();var s=e.g.Qc(),u=Rr(e.g.aa,n.type),a=n.stream.segmentIndex.find(n.ya?n.ya.endTime:s),l=a==null?null:n.stream.segmentIndex.get(a);a=l&&l.endByte?l.endByte-l.startByte:null,l&&!a&&(a=(l.endTime-l.getStartTime())*(n.stream.bandwidth||0)/8),a?((l=l.Y)&&(a+=(l.endByte?l.endByte-l.startByte:null)||0),l=e.g.getBandwidthEstimate(),s=8*a/l<(u||0)-s-e.h.rebufferingGoal||n.pb.h.g>a):s=!1,s&&n.pb.abort(),K(o)})}g.Ec=function(){if(this.g){for(var e=this.g.Qc(),n=m(this.i.keys()),i=n.next();!i.done;i=n.next()){var r=i.value;i=this.i.get(r);var o=this.g.aa;if(r==ye?(o=o.h,o=o.g==null||o.h==null?!1:e>=o.g&&ee.g.eb()):null}function Tw(e){for(var n=e.h.segmentPrefetchLimit,i=e.h.prefetchAudioLanguages,r=m(e.j.variants),o=r.next(),s={};!o.done;s={ub:void 0},o=r.next())if(s.ub=o.value,s.ub.audio)if(e.o.has(s.ub.audio)){if(o=e.o.get(s.ub.audio),Tm(o,n),!(0=n||!i.some(function(a){return function(l){return uo(a.ub.audio.language,l)}}(s))||!(o=Nd(e,s.ub.audio))||(s.ub.audio.segmentIndex||s.ub.audio.createSegmentIndex(),e.o.set(s.ub.audio,o))}g.updateDuration=function(){var e=Tf(),n=this.j.presentationTimeline.getDuration();1/0>n?(e&&(this.A&&this.A.stop(),Td(this.g.aa)),this.g.aa.$a(n)):e?(this.A&&this.A.ua(.5),this.g.aa.$a(1/0)):this.g.aa.$a(Math.pow(2,32))};function Sw(e,n){var i,r,o,s,u,a;return P(function(l){switch(l.g){case 1:if(Be(e.m),n.Da||n.ib==null||n.oc)return l.return();if(n.ib=null,!n.mc){l.s(2);break}return S(l,Od(e,n,n.Se,n.Wd),3);case 3:return l.return();case 2:if(mw(e,n),n.stream.segmentIndex){l.s(4);break}return i=n.stream,ue(l,5),S(l,n.stream.createSegmentIndex(),7);case 7:me(l,6);break;case 5:return r=ae(l),S(l,bd(e,n,r),8);case 8:return l.return();case 6:if(i!=n.stream)return i.closeSegmentIndex&&i.closeSegmentIndex(),n.Da||n.ib||Ot(e,n,0),l.return();case 4:ue(l,9),o=xw(e,n),o!=null&&(Ot(e,n,o),n.qd=!1),me(l,10);break;case 9:return s=ae(l),S(l,bd(e,n,s),11);case 11:return l.return();case 10:if(u=Array.from(e.i.values()),!e.I||!u.every(function(c){return c.endOfStream})){l.s(0);break}return S(l,e.g.aa.endOfStream(),13);case 13:Be(e.m),a=e.g.aa.getDuration(),a!=0&&al&&s)return n.endOfStream=!0,n.type=="video"&&(e=e.i.get(ye))&&Ud(e)&&(e.endOfStream=!0),null;if(n.endOfStream=!1,u>=a)return i/2;if(a=!n.ja,s=ww(e,n,r,s),!s)return i;u=!1,a&&n.bf&&(u=!0,n.bf=!1),a=1/0,l=Array.from(e.i.values()),l=m(l);for(var c=l.next();!c.done;c=l.next())c=c.value,Ud(c)||c.ja&&!c.ja.current()||(a=Math.min(a,c.ya?c.ya.endTime:r));return o>=a+e.j.presentationTimeline.h?i:(e.h.crossBoundaryStrategy!=="keep"&&Dw(e,n,s)||(n.ba&&n.ja&&!e.o.has(n.stream)&&(n.ba.Oa(s.startTime+.001),js(n.ba,s.startTime).catch(function(){})),Ew(e,n,r,s,u).catch(function(){}),n.ld&&Aw(e,n.ld,r)),null)}function ww(e,n,i,r){if(n.ja)return(i=n.ja.current())&&n.ya&&.001>Math.abs(n.ya.startTime-i.startTime)&&(i=n.ja.next().value),i;if(n.ya||r)return i=n.ya?n.ya.endTime:r,e=0>e.g.eb(),n.stream.segmentIndex&&(n.ja=n.stream.segmentIndex.Eb(i,!1,e)),n.ja&&n.ja.next().value;r=e.j.sequenceMode?0:e.h.inaccurateManifestTolerance;var o=Math.max(i-r,0);e=0>e.g.eb();var s=null;return r&&(n.stream.segmentIndex&&(n.ja=n.stream.segmentIndex.Eb(o,!1,e)),s=n.ja&&n.ja.next().value),s||(n.stream.segmentIndex&&(n.ja=n.stream.segmentIndex.Eb(i,!1,e)),s=n.ja&&n.ja.next().value),s}function Ew(e,n,i,r,o){var s,u,a,l,c,d,h,p,f,y,T,v,x,w,A,I,k,C;return P(function(E){switch(E.g){case 1:if(s=ot,u=n.stream,a=n.ja,n.Da=!0,ue(E,2),r.dc()==2)throw new R(1,1,1011);return S(E,Mw(e,n,r,o),4);case 4:return Be(e.m),e.B?E.return():(l=u.mimeType=="video/mp4"||u.mimeType=="audio/mp4",c=F.ReadableStream,(d=e.h.lowLatencyMode&&e.j.isLowLatency)&&c&&l&&(e.j.type!="HLS"||r.m)?(f=new Uint8Array(0),T=y=!1,x=function(M){var D,_,j,L;return P(function(N){switch(N.g){case 1:if(y||(T=!0,Be(e.m),e.B))return N.return();if(ue(N,2),f=Iw(f,M),D=!1,_=0,new _e().box("mdat",function(U){_=U.size+U.start,D=!0}).parse(f,!1,!0),!D){N.s(4);break}return j=f.subarray(0,_),f=f.subarray(_),S(N,jd(e,n,i,u,r,j,!0,o),5);case 5:n.ba&&n.ja&&js(n.ba,r.startTime,!0);case 4:me(N,0);break;case 2:v=L=ae(N),K(N)}})},S(E,Os(e,n,r,x),9)):(h=Os(e,n,r),S(E,h,7)));case 7:return p=E.h,Be(e.m),e.B?E.return():(Be(e.m),n.mc?(n.Da=!1,Ot(e,n,0),E.return()):S(E,jd(e,n,i,u,r,p,!1,o),6));case 9:if(w=E.h,v)throw v;if(T){E.s(10);break}return y=!0,Be(e.m),e.B?E.return():n.mc?(n.Da=!1,Ot(e,n,0),E.return()):S(E,jd(e,n,i,u,r,w,!1,o),10);case 10:n.ba&&n.ja&&js(n.ba,r.startTime,!0);case 6:if(Be(e.m),e.B)return E.return();n.ya=r,a.next(),n.Da=!1,n.bg=!1,A=e.g.aa.wb(),I=A[n.type],JSON.stringify(I),n.mc||(k=null,n.type===s.la?k=e.i.get(s.V):n.type===s.V&&(k=e.i.get(s.la)),k&&k.type==s.V?e.g.se(r,n.stream,k.stream.isAudioMuxedInVideo):e.g.se(r,n.stream,n.stream.codecs.includes(","))),Ot(e,n,0),me(E,0);break;case 2:if(C=ae(E),Be(e.m,C),e.B)return E.return();if(n.Da=!1,C.code==7001)n.Da=!1,Co(n),Ot(e,n,0),E.s(0);else if(n.type==s.va&&e.h.ignoreTextStreamFailures)e.i.delete(s.va),E.s(0);else return C.code==3017?S(E,Cw(e,n,C),0):(n.qd=!0,C.category==1&&n.ba&&_s(n.ba,r),C.severity=2,S(E,bd(e,n,C),0))}})}function Aw(e,n,i){var r,o,s,u,a,l,c,d;P(function(h){switch(h.g){case 1:if(r=n.stream,s=(o=r.segmentIndex.Eb(i))&&o.next().value,!s){h.s(0);break}if(u=s.Y,!u||fa(u,n.yb)){h.s(3);break}return n.yb=u,ue(h,4),S(h,Os(e,n,u),6);case 6:a=h.h;var p=e.g.aa;p.L&&Ic(p.L,a,0,r),me(h,3);break;case 4:throw l=ae(h),n.yb=null,l;case 3:if(n.ya&&n.ya==s){h.s(0);break}return n.ya=s,ue(h,8),S(h,Os(e,n,s),10);case 10:c=h.h,p=e.g.aa,p.L&&Ic(p.L,c,0,r),me(h,0);break;case 8:throw d=ae(h),n.ya=null,d}})}function Iw(e,n){var i=new Uint8Array(e.length+n.length);return i.set(e),i.set(n,e.length),i}function Cw(e,n,i){var r,o,s,u,a,l;return P(function(c){if(c.g==1){if(r=Array.from(e.i.values()),o=r.some(function(d){return d!=n&&d.bg}))return c.s(2);if(s=e.h.maxDisabledTime===0&&i.code==1011?1:e.h.maxDisabledTime,u=e.g.disableStream(n.stream,s))return c.return();if(e.h.avoidEvictionOnQuotaExceededError)return Ot(e,n,4),c.return();if(a=Math.round(100*e.C),20a&&(d=Math.max(u-o,l-a-s)),d<=a?h.return():S(h,e.g.aa.remove(n.type,s,s+d),2));if(h.g!=4)return Be(e.m),e.F?S(h,_d(e,e.F,i),4):h.s(0);Be(e.m),K(h)})}function Ud(e){return e&&e.type==ye&&(e.stream.mimeType=="application/cea-608"||e.stream.mimeType=="application/cea-708")}function Os(e,n,i,r){var o,s,u,a,l;return P(function(c){switch(c.g){case 1:if(o=i.Gb())return c.return(o);if(s=null,n.ba){var d=n.ba,h=d.h;i instanceof Wt&&(h=d.j),h.has(i)?(d=h.get(i),r&&(d.pg=r),s=d.Ed):s=null}return s||(s=Ma(i,n.stream,r||null,e.h.retryParameters,e.g.Vb)),u=0,n.ja&&(u=n.ja.h),n.pb=s,S(c,s.promise,2);case 2:if(a=c.h,n.pb=null,l=a.data,!i.aesKey){c.s(3);break}return S(c,Pd(l,i.aesKey,u),4);case 4:l=c.h;case 3:return c.return(l)}})}function Ma(e,n,i,r,o,s){s=s===void 0?!1:s;var u=e instanceof J?e:void 0,a=u?1:0;return e=Us(e.N(),e.startByte,e.endByte,r,i),e.contentType=n.type,o.request(_n,e,{type:a,stream:n,segment:u,isPreload:s})}function Od(e,n,i,r){var o,s;return P(function(u){if(u.g==1)return n.mc=!1,n.Se=!1,n.Wd=0,n.oc=!0,n.ya=null,n.ja=null,n.ba&&!e.o.has(n.stream)&&zn(n.ba),r?(o=e.g.Qc(),s=e.g.aa.getDuration(),S(u,e.g.aa.remove(n.type,o+r,s),3)):S(u,Jg(e.g.aa,n.type),4);if(u.g!=3)return Be(e.m),i?S(u,e.g.aa.flush(n.type),3):u.s(3);Be(e.m),n.oc=!1,n.endOfStream=!1,n.Da||n.ib||Ot(e,n,0),K(u)})}function Ot(e,n,i){var r=n.type;(r!=ye||e.i.has(r))&&(n.ib=new is(function(){var o;return P(function(s){if(s.g==1)return ue(s,2),S(s,Sw(e,n),4);if(s.g!=2)return me(s,0);o=ae(s),e.g&&e.g.onError(o),K(s)})}).da(i))}function Co(e){e.ib!=null&&(e.ib.stop(),e.ib=null)}function bs(e){return P(function(n){return e.pb?S(n,e.pb.abort(),0):n.s(0)})}function bd(e,n,i){var r;return P(function(o){if(o.g==1)return i.code==3024?(n.Da=!1,Co(n),Ot(e,n,0),o.return()):S(o,tg(e.P),2);if(Be(e.m),i.category===1&&i.code!=1003){if(n.hc)return Ld(e,!1),o.return();r=e.h.maxDisabledTime===0&&i.code==1011?1:e.h.maxDisabledTime,i.handled=e.g.disableStream(n.stream,r),i.handled&&(i.severity=1)}(!i.handled||i.code!=1011)&&e.g.onError(i),i.handled||e.h.failureCallback(i),K(o)})}function ka(e,n,i){n=n===void 0?!1:n,i=i===void 0?!0:i;var r,o,s,u,a,l;return P(function(c){if(c.g==1){if(r=Date.now()/1e3,o=e.h.minTimeBetweenRecoveries,!n){if(!e.h.allowMediaSourceRecoveries||r-e.Ln||1o);)(o==0||e[o-1]!="\\")&&(s=e.substring(s,o).replace(/\\\./g,"."),r[s]={},r=r[s],s=o+1),o+=1;return r[e.substring(s).replace(/\\\./g,".")]=n,i}function Mo(e,n){return e&&n}function Am(e,n){function i(s){for(var u=m(Object.keys(s)),a=u.next();!a.done;a=u.next())if(a=a.value,!(s[a]instanceof HTMLElement))if(o(s[a])&&Object.keys(s[a]).length===0)delete s[a];else{var l=s[a];Array.isArray(l)&&l.length===0||typeof s[a]=="function"?delete s[a]:o(s[a])&&(i(s[a]),Object.keys(s[a]).length===0&&delete s[a])}}function r(s,u){return Object.keys(s).reduce(function(a,l){var c=s[l];return u.hasOwnProperty(l)?c instanceof HTMLElement&&u[l]instanceof HTMLElement?c.isEqualNode(u[l])||(a[l]=c):o(c)&&o(u[l])?(c=r(c,u[l]),(0"&&i.substr(-6)===""&&(i=i.slice(5,-6),e=!0),!e)try{var r=JSON.parse(i);r.ckc&&(i=r.ckc,e=!0),r.CkcMessage&&(i=r.CkcMessage,e=!0),r.License&&(i=r.License,e=!0)}catch{}e&&(n.data=vn(Tn(i)))}},qt.muxFairPlayRequest=function(e,n){Pa(e,n)},qt.expressplayFairPlayRequest=function(e,n){if(e===2){var i=n.drmInfo;i&&ju(i.keySystem)&&Pa(e,n)}},qt.conaxFairPlayRequest=function(e,n){Pa(e,n)},qt.ezdrmFairPlayRequest=function(e,n){Pa(e,n)},qt.verimatrixFairPlayRequest=function(e,n){e===2&&(e=n.drmInfo)&&ju(e.keySystem)&&(e=oe(n.body),e=pi(e),n.headers["Content-Type"]="application/x-www-form-urlencoded",n.body=Pn("spc="+e))},qt.muxInitDataTransform=function(e,n,i){return Vd(e,n,i)},qt.expressplayInitDataTransform=function(e,n,i){return Vd(e,n,i)},qt.conaxInitDataTransform=function(e,n,i){if(n!=="skd")return e;n=i.serverCertificate,i=Zn(e).split("skd://").pop().split("?").shift(),i=F.atob(i);var r=new ArrayBuffer(2*i.length);r=uf(r);for(var o=0,s=i.length;on)}).sort(function(i,r){return i.audio||r.audio?i.audio?r.audio?(r.audio.channelsCount||0)-(i.audio.channelsCount||0):1:-1:0})}function _w(e,n){if(n=="AUTO"){var i=e.some(function(r){return!!(r.video&&r.video.hdr&&r.video.hdr=="HLG")});n=pf(i)}return e.filter(function(r){return!(r.video&&r.video.hdr&&r.video.hdr!=n)})}function Uw(e,n){return e.filter(function(i){return!(i.video&&i.video.videoLayout&&i.video.videoLayout!=n)})}function Ow(e,n){return e.filter(function(i){return!(i.audio&&i.audio.spatialAudio!=n)})}function bw(e,n){return e.filter(function(i){return!(i.audio&&i.audio.codecs!=n)})}function Na(){}function ko(){var e=1/0;navigator.connection&&navigator.connection.saveData&&(e=360);var n={retryParameters:Xn(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1,persistentSessionOnlinePlayback:!1,persistentSessionsMetadata:[],initDataTransform:function(d,h,p){return F.shakaMediaKeysPolyfill==="apple"&&h=="skd"&&(h=p.serverCertificate,p=Im(d),d=Bs(d,p,h)),d},logLicenseExchange:!1,updateExpirationTime:1,preferredKeySystems:[],keySystemsMapping:{},parseInbandPsshEnabled:Vn(),minHdcpVersion:"",ignoreDuplicateInitData:!nt("Tizen 2"),defaultAudioRobustnessForWidevine:"SW_SECURE_CRYPTO",defaultVideoRobustnessForWidevine:"SW_SECURE_DECODE"};(Vn()||Hn())&&n.preferredKeySystems.push("com.microsoft.playready"),bu()&&!zr()&&(n.keySystemsMapping={"com.microsoft.playready":"com.microsoft.playready.recommendation"});var i="reload",r=!1;!dr()||Jn()||Hn()||qr()||hi()&&lf()===79||Rn()&&!bi()&&!Tc()||bu()&&zr()||(i="smooth",r=!0),r={retryParameters:Xn(),availabilityWindowOverride:NaN,disableAudio:!1,disableVideo:!1,disableText:!1,disableThumbnails:!1,disableIFrames:!1,defaultPresentationDelay:0,segmentRelativeVttTiming:!1,raiseFatalErrorOnManifestUpdateRequestFailure:!1,continueLoadingWhenPaused:!0,ignoreSupplementalCodecs:!1,updatePeriod:-1,ignoreDrmInfo:!1,dash:{clockSyncUri:"",disableXlinkProcessing:!0,xlinkFailGracefully:!1,ignoreMinBufferTime:!1,autoCorrectDrift:!0,initialSegmentLimit:1e3,ignoreSuggestedPresentationDelay:!1,ignoreEmptyAdaptationSet:!1,ignoreMaxSegmentDuration:!1,keySystemsByURI:{"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:94ce86fb-07ff-4f43-adb8-93d2fa968ca2":"com.apple.fps","urn:uuid:3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c":"com.huawei.wiseplay"},manifestPreprocessor:ja,manifestPreprocessorTXml:_a,sequenceMode:!1,multiTypeVariantsAllowed:r,useStreamOnceInPeriodFlattening:!1,enableFastSwitching:!0},hls:{ignoreTextStreamFailures:!1,ignoreImageStreamFailures:!1,defaultAudioCodec:"mp4a.40.2",defaultVideoCodec:"avc1.42E01E",ignoreManifestProgramDateTime:!1,ignoreManifestProgramDateTimeForTypes:[],mediaPlaylistFullMimeType:'video/mp2t; codecs="avc1.42E01E, mp4a.40.2"',liveSegmentsDelay:3,sequenceMode:pS(),ignoreManifestTimestampsInSegmentsMode:!1,disableCodecGuessing:!1,disableClosedCaptionsDetection:!1,allowLowLatencyByteRangeOptimization:!0,allowRangeRequestsToGuessMimeType:!1},mss:{manifestPreprocessor:ja,manifestPreprocessorTXml:_a,sequenceMode:!1,keySystemsBySystemId:{"9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready"}}};var o={retryParameters:Xn(),failureCallback:function(d){return Mo([d])},rebufferingGoal:0,bufferingGoal:10,bufferBehind:30,evictionGoal:1,ignoreTextStreamFailures:!1,alwaysStreamText:!1,startAtSegmentBoundary:!1,gapDetectionThreshold:.5,gapPadding:0,gapJumpTimerTime:.25,durationBackoff:1,safeSeekOffset:5,safeSeekEndOffset:0,stallEnabled:!0,stallThreshold:1,stallSkip:.1,useNativeHlsForFairPlay:!0,inaccurateManifestTolerance:2,lowLatencyMode:!1,forceHTTP:!1,forceHTTPS:!1,minBytesForProgressEvents:16e3,preferNativeDash:!1,preferNativeHls:!1,updateIntervalSeconds:1,observeQualityChanges:!1,maxDisabledTime:30,segmentPrefetchLimit:1,prefetchAudioLanguages:[],disableAudioPrefetch:!1,disableTextPrefetch:!1,disableVideoPrefetch:!1,liveSync:{enabled:!1,targetLatency:.5,targetLatencyTolerance:.5,maxPlaybackRate:1.1,minPlaybackRate:.95,panicMode:!1,panicThreshold:60,dynamicTargetLatency:{enabled:!1,stabilityThreshold:60,rebufferIncrement:.5,maxAttempts:10,maxLatency:4,minLatency:1}},allowMediaSourceRecoveries:!0,minTimeBetweenRecoveries:5,vodDynamicPlaybackRate:!1,vodDynamicPlaybackRateLowBufferRate:.95,vodDynamicPlaybackRateBufferRatio:.5,preloadNextUrlWindow:30,loadTimeout:30,clearDecodingCache:Hn()||qr(),dontChooseCodecs:!1,shouldFixTimestampOffset:hi()||Jn(),avoidEvictionOnQuotaExceededError:!1,crossBoundaryStrategy:"keep"};(hi()||Jn()||Rn()||Ou())&&(o.stallSkip=0),(navigator.userAgent.match(/Edge\//)||Vn())&&(o.gapPadding=.01),Jn()&&(o.gapPadding=2),Uu()&&(o.crossBoundaryStrategy="reset"),di()&&(o.crossBoundaryStrategy="reset_to_encrypted");var s={trackSelectionCallback:function(d){return P(function(h){return h.return(d)})},downloadSizeCallback:function(d){var h;return P(function(p){return p.g==1?navigator.storage&&navigator.storage.estimate?S(p,navigator.storage.estimate(),3):p.return(!0):(h=p.h,p.return(h.usage+d<.95*h.quota))})},progressCallback:function(d,h){return Mo([d,h])},usePersistentLicense:!0,numberOfParallelDownloads:5};e={enabled:!0,useNetworkInformation:!0,defaultBandwidthEstimate:1e6,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:e,minPixels:0,maxPixels:1/0,minFrameRate:0,maxFrameRate:1/0,minBandwidth:0,maxBandwidth:1/0,minChannelsCount:0,maxChannelsCount:1/0},advanced:{minTotalBytes:128e3,minBytes:16e3,fastHalfLife:2,slowHalfLife:5},restrictToElementSize:!1,restrictToScreenSize:!1,ignoreDevicePixelRatio:!1,clearBufferSwitch:!1,safeMarginSwitch:0,cacheLoadThreshold:20,minTimeToSwitch:Tt()?.5:0,preferNetworkInformationBandwidth:!1},i={codecSwitchingStrategy:i,addExtraFeaturesToSourceBuffer:function(d){return Mo([d],"")},forceTransmux:!1,insertFakeEncryptionInInit:!0,correctEc3Enca:!1,modifyCueCallback:function(d,h){return Mo([d,h])},dispatchAllEmsgBoxes:!1};var u=!1,a=!1,l=!0;Sc()&&(a=u=!0,l=!1);var c={drm:n,manifest:r,streaming:o,mediaSource:i,offline:s,abrFactory:function(){return new qe},adaptationSetCriteriaFactory:function(){return new(Function.prototype.bind.apply(La,[null].concat(X(Et.apply(0,arguments)))))},abr:e,autoShowText:3,preferredAudioLanguage:"",preferredAudioLabel:"",preferredTextLanguage:"",preferredVariantRole:"",preferredTextRole:"",preferredAudioChannelCount:2,preferredVideoHdrLevel:"AUTO",preferredVideoLayout:"",preferredVideoLabel:"",preferredVideoCodecs:[],preferredAudioCodecs:[],preferredTextFormats:[],preferForcedSubs:!1,preferSpatialAudio:!1,preferredDecodingAttributes:[],restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:1/0,minPixels:0,maxPixels:1/0,minFrameRate:0,maxFrameRate:1/0,minBandwidth:0,maxBandwidth:1/0,minChannelsCount:0,maxChannelsCount:1/0},playRangeStart:0,playRangeEnd:1/0,textDisplayer:{captionsUpdatePeriod:.25,fontScaleFactor:1},textDisplayFactory:function(){return null},cmcd:{enabled:!1,sessionId:"",contentId:"",rtpSafetyFactor:5,useHeaders:!1,includeKeys:[],version:1},cmsd:{enabled:!0,applyMaximumSuggestedBitrate:!0,estimatedThroughputWeightRatio:.5},lcevc:{enabled:!1,dynamicPerformanceScaling:!0,logLevel:0,drawLogo:!1,poster:!0},ads:{customPlayheadTracker:u,skipPlayDetection:a,supportsMultipleMediaElements:l,disableHLSInterstitial:!1,disableDASHInterstitial:!1,allowPreloadOnDomElements:!0},ignoreHardwareResolution:!1};return s.trackSelectionCallback=function(d){return P(function(h){return h.return(Bw(d,c.preferredAudioLanguage,c.preferredVideoHdrLevel))})},c}function Cm(){return{streaming:{inaccurateManifestTolerance:0,segmentPrefetchLimit:2,updateIntervalSeconds:.1,maxDisabledTime:1,retryParameters:{baseDelay:100}},manifest:{dash:{autoCorrectDrift:!1},retryParameters:{baseDelay:100}},drm:{retryParameters:{baseDelay:100}}}}function $i(e,n,i){var r={".drm.keySystemsMapping":"",".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:[],audioRobustness:[],sessionType:"",serverCertificate:new Uint8Array(0),serverCertificateUri:"",individualizationServer:"",headers:{}}};return Fd(e,n,i||ko(),r,"")}function Bw(e,n,i){var r=i;r=="AUTO"&&(i=e.some(function(a){return!!(a.hdr&&a.hdr=="HLG")}),r=pf(i));var o=e.filter(function(a){return!(a.type!="variant"||a.hdr&&a.hdr!=r)});i=[];var s=qu(n,o.map(function(a){return a.language}));s&&(i=o.filter(function(a){return Oe(a.language)==s})),i.length==0&&(i=o.filter(function(a){return a.primary})),i.length==0&&(o.map(function(a){return a.language}),i=o);var u=i.filter(function(a){return a.height&&480>=a.height});for(u.length&&(u.sort(function(a,l){return l.height-a.height}),i=u.filter(function(a){return a.height==u[0].height})),n=[],i.length&&(o=Math.floor(i.length/2),i.sort(function(a,l){return a.bandwidth-l.bandwidth}),n.push(i[o])),e=m(e),i=e.next();!i.done;i=e.next())i=i.value,i.type!=ye&&i.type!="image"||n.push(i);return n}function ja(e){return Mo([e],e)}function _a(e){return Mo([e],e)}W("shaka.util.PlayerConfiguration",Na),Na.mergeConfigObjects=$i,Na.createDefaultForLL=Cm,Na.createDefault=ko;function Fw(){this.g=null,this.h=[]}function Hd(e,n){var i=0;e.g&&e.g.state==n&&(i+=e.g.duration),e=m(e.h);for(var r=e.next();!r.done;r=e.next())r=r.value,i+=r.state==n?r.duration:0;return i}function Vw(e){function n(s){return{timestamp:s.timestamp,state:s.state,duration:s.duration}}for(var i=[],r=m(e.h),o=r.next();!o.done;o=r.next())i.push(n(o.value));return e.g&&i.push(n(e.g)),i}function Hw(){this.i=this.h=null,this.g=[]}function Gd(e,n,i){e.i!=n&&(e.i=n,e.g.push({timestamp:Date.now()/1e3,id:n.id,type:"text",fromAdaptation:i,bandwidth:null}))}function Ua(){this.nc=this.ah=this.u=this.A=this.I=this.B=this.o=this.j=this.H=this.C=this.i=this.P=this.T=this.L=this.M=this.O=this.l=this.m=NaN,this.J=0,this.F=this.G=NaN,this.g=new Fw,this.h=new Hw}function xn(e,n,i,r){je.call(this),this.O=e,this.Z=n,this.Fa=r.networkingEngine,this.B=i,this.o=null,this.za=0,this.Ma=r.Kc,this.F=r.Zi,this.Na=r.$i,this.g=r.config,this.l=this.G=this.h=null,this.oa=!1,this.H=r.kj,this.sa=!1,this.i=null,this.ka=!1,this.j=this.C=null,this.ea=!1,this.M=new Map,this.Aa=!1,this.Ga=r.jj,this.$=new Ua,this.na=new Ne,this.m=new Ne,this.P=null,this.u=!1,this.fa=r.Th,this.W=this.J=null,this.La=r.Sh,this.T=!1,this.L=[],this.I=[],this.A=!0}wt(xn,je);function Fs(e,n,i){(e=n?e.I:e.L)?e.push(i):i()}function Gw(e){if(e.I)for(var n=m(e.I),i=n.next();!i.done;i=n.next())i=i.value,i();e.I=null}function Mm(e,n){if(e.P=n,e.T=!0,e.L){n=m(e.L);for(var i=n.next();!i.done;i=n.next())i=i.value,i()}e.L=null}g=xn.prototype,g.getStartTime=function(){return this.B},g.Pc=function(){return this.O},g.Hf=function(){return this.h};function Kw(e){return e.ea=!0,e.j}function Xw(e){return e.sa=!0,e.H}g.getStats=function(){return this.$};function Ww(e){return e.ka=!0,e.i}g.Ai=function(){return this.J?Sr(this.J):null},g.zi=function(){return this.W?xr(this.W):null};function zw(e){return e.Aa=!0,e.M}g.start=function(){var e=this;(function(){var n;return P(function(i){switch(i.g){case 1:return S(i,Promise.resolve(),2);case 2:return ue(i,3),S(i,qw(e),5);case 5:if(Pr(e),F.shakaMediaKeysPolyfill==="webkit"){i.s(6);break}return S(i,km(e),7);case 7:Pr(e);case 6:return S(i,Yw(e),8);case 8:if(Pr(e),!e.fa||!e.i){i.s(9);break}return S(i,ex(e.i),10);case 10:Pr(e);case 9:e.m.resolve(),me(i,0);break;case 3:n=ae(i),n instanceof R&&(n.code==7001||n.code==7003)||e.m.reject(n),K(i)}})})()},g.dispatchEvent=function(e){return this.P?this.P.dispatchEvent(e):je.prototype.dispatchEvent.call(this,e)},g.onError=function(e){e.severity===2&&(this.m.reject(e),this.destroy());var n=new Map().set("detail",e);n=new G("error",n),this.dispatchEvent(n),n.defaultPrevented&&(e.handled=!0)};function Pr(e){if(e.u)throw new R(2,7,7003)}function Kd(e,n){e.dispatchEvent(new G("onstatechange",new Map().set("state",n)))}function qw(e){var n,i,r,o,s,u,a,l,c;return P(function(d){switch(d.g){case 1:if(Kd(e,"manifest-parser"),e.l||(e.G=Ng(e.O,e.Z),e.l=e.G(),e.l.configure(e.g.manifest,function(){return e.A})),n=Date.now()/1e3,Kd(e,"manifest"),e.h){d.s(2);break}return S(d,e.l.start(e.O,e.Na),3);case 3:if(e.h=d.h,e.h.variants.length!=1){d.s(2);break}for(i=[],r=e.h.variants[0],o=m([r.video,r.audio]),s=o.next();!s.done;s=o.next())(u=s.value)&&!u.segmentIndex&&i.push(u.createSegmentIndex());if(!(0r.endTime?Hs:Do;this.g.set(r,s);for(var u=m(this.m),a=u.next();!a.done;a=u.next())a=a.value,a.Ic==o&&a.Hc==s&&a.wc(r,n)}}};function ki(e,n,i,r){n=new G(n,new Map([["region",i],["seeking",r]])),e.dispatchEvent(n)}var Vs=1,Do=2,Hs=3;function Nr(e,n,i){var r,o,s,u,a,l,c;return P(function(d){switch(d.g){case 1:var h=new $e(e).Za.split("/").pop().split(".");return r=h.length==1?"":h.pop().toLowerCase(),(o=Qw.get(r))?d.return(o):(s=0,u=lt([e],i),ue(d,2),u.method="HEAD",S(d,n.request(s,u).promise,4));case 4:a=d.h,o=a.headers["content-type"],me(d,3);break;case 2:if(l=ae(d),!l||l.code!=1002&&l.code!=1001){d.s(3);break}return u.method="GET",S(d,n.request(s,u).promise,6);case 6:c=d.h,o=c.headers["content-type"];case 3:return d.return(o?o.toLowerCase().split(";").shift():"")}})}var Qw=new Map().set("mp4","video/mp4").set("m4v","video/mp4").set("m4a","audio/mp4").set("webm","video/webm").set("weba","audio/webm").set("mkv","video/webm").set("ts","video/mp2t").set("ogv","video/ogg").set("ogg","audio/ogg").set("mpg","video/mpeg").set("mpeg","video/mpeg").set("mov","video/quicktime").set("m3u8","application/x-mpegurl").set("mpd","application/dash+xml").set("ism","application/vnd.ms-sstr+xml").set("mp3","audio/mpeg").set("aac","audio/aac").set("flac","audio/flac").set("wav","audio/wav").set("sbv","text/x-subviewer").set("srt","text/srt").set("vtt","text/vtt").set("webvtt","text/vtt").set("ttml","application/ttml+xml").set("lrc","application/x-subtitle-lrc").set("ssa","text/x-ssa").set("ass","text/x-ssa").set("jpeg","image/jpeg").set("jpg","image/jpeg").set("png","image/png").set("svg","image/svg+xml").set("webp","image/webp").set("avif","image/avif").set("html","text/html").set("htm","text/html");function Dm(e,n){if(e.lineBreak)return` `;if(e.nestedCues.length)return e.nestedCues.map(function(u){return Dm(u,e)}).join("");if(!e.payload)return e.payload;var i=[],r=e.fontWeight>=io,o=e.fontStyle==ro,s=e.textDecoration.includes(yi);return r&&i.push(["b"]),o&&i.push(["i"]),s&&i.push(["u"]),o=e.color,o==""&&n&&(o=n.color),r="",(o=Rm(o))&&(r+="."+o),o=e.backgroundColor,o==""&&n&&(o=n.backgroundColor),(n=Rm(o))&&(r+=".bg_"+n),r&&i.push(["c",r]),i.reduceRight(function(u,a){var l=m(a);return a=l.next().value,l=l.next().value,"<"+a+(l===void 0?"":l)+">"+u+""},e.payload)}function Rm(e){e=e.toLowerCase();var n=e.replace(/\s/g,"").match(/^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i);switch(n?e="#"+(parseInt(n[1],10)|256).toString(16).slice(1)+(parseInt(n[2],10)|256).toString(16).slice(1)+(parseInt(n[3],10)|256).toString(16).slice(1):e.startsWith("#")&&7>>0).toString()}if(e.startTime>=e.endTime)return null;var i=new VTTCue(e.startTime,e.endTime,e.payload);i.id=n(e.startTime.toString())+n(e.endTime.toString())+n(e.payload),i.lineAlign=e.lineAlign,i.positionAlign=e.positionAlign,e.size&&(i.size=e.size);try{i.align=e.textAlign}catch{}return e.textAlign=="center"&&i.align!="center"&&(i.align="middle"),e.writingMode=="vertical-lr"?i.vertical="lr":e.writingMode=="vertical-rl"&&(i.vertical="rl"),e.lineInterpretation==1&&(i.snapToLines=!1),e.line!=null&&(i.line=e.line),e.position!=null&&(i.position=e.position),i}function Ct(e,n){for(this.h=e,this.i=n,this.g=null,e=m(Array.from(this.h.textTracks)),n=e.next();!n.done;n=e.next())n=n.value,n.kind!=="metadata"&&n.kind!=="chapters"&&(n.mode="disabled",n.label==this.i&&(this.g=n));this.g&&(this.g.mode="hidden")}g=Ct.prototype,g.configure=function(){},g.remove=function(e,n){return this.g?(Nm(this.g,function(i){return i.startTimee}),!0):!1},g.append=function(e){if(this.g){var n=Wd(e),i=[];e=this.g.cues?Array.from(this.g.cues):[],n=m(n);for(var r=n.next(),o={};!r.done;o={Rc:void 0},r=n.next())o.Rc=r.value,!e.some(function(s){return function(u){return u.startTime==s.Rc.startTime&&u.endTime==s.Rc.endTime&&u.text==s.Rc.payload}}(o))&&o.Rc.payload&&(r=Jw(o.Rc))&&i.push(r);for(e=i.slice().sort(function(s,u){return s.startTime!=u.startTime?s.startTime-u.startTime:s.endTime!=u.endTime?s.endTime-u.startTime:"line"in VTTCue.prototype?i.indexOf(u)-i.indexOf(s):i.indexOf(s)-i.indexOf(u)}),e=m(e),n=e.next();!n.done;n=e.next())this.g.addCue(n.value)}},g.destroy=function(){return this.g&&(Nm(this.g,function(){return!0}),this.g.mode="disabled"),this.g=this.h=null,Promise.resolve()},g.isTextVisible=function(){return this.g?this.g.mode=="showing":!1},g.setTextVisibility=function(e){e&&!this.g&&Lm(this),this.g&&(this.g.mode=e?"showing":"hidden")},g.setTextLanguage=function(){},g.enableTextDisplayer=function(){Lm(this)};function Lm(e){e.h&&!e.g&&(e.g=e.h.addTextTrack("subtitles",e.i),e.g.mode="hidden")}function Nm(e,n){var i=e.mode;e.mode=i=="showing"?"showing":"hidden";for(var r=m(Array.from(e.cues)),o=r.next();!o.done;o=r.next())(o=o.value)&&n(o)&&e.removeCue(o);e.mode=i}W("shaka.text.SimpleTextDisplayer",Ct),Ct.prototype.enableTextDisplayer=Ct.prototype.enableTextDisplayer,Ct.prototype.setTextLanguage=Ct.prototype.setTextLanguage,Ct.prototype.setTextVisibility=Ct.prototype.setTextVisibility,Ct.prototype.isTextVisible=Ct.prototype.isTextVisible,Ct.prototype.destroy=Ct.prototype.destroy,Ct.prototype.append=Ct.prototype.append,Ct.prototype.remove=Ct.prototype.remove,Ct.prototype.configure=Ct.prototype.configure;function Mt(){}g=Mt.prototype,g.configure=function(){},g.remove=function(){},g.append=function(){},g.destroy=function(){},g.isTextVisible=function(){return!1},g.setTextVisibility=function(){},g.setTextLanguage=function(){},g.enableTextDisplayer=function(){},W("shaka.text.StubTextDisplayer",Mt),Mt.prototype.enableTextDisplayer=Mt.prototype.enableTextDisplayer,Mt.prototype.setTextLanguage=Mt.prototype.setTextLanguage,Mt.prototype.setTextVisibility=Mt.prototype.setTextVisibility,Mt.prototype.isTextVisible=Mt.prototype.isTextVisible,Mt.prototype.destroy=Mt.prototype.destroy,Mt.prototype.append=Mt.prototype.append,Mt.prototype.remove=Mt.prototype.remove,Mt.prototype.configure=Mt.prototype.configure;function kt(e,n){var i=this;document.fullscreenEnabled||Ee("Using UITextDisplayer in a browser without Fullscreen API support causes subtitles to not be rendered in fullscreen"),this.A=!1,this.h=[],this.j=e,this.C=n,this.u=this.m=null,this.g=document.createElement("div"),this.g.classList.add("shaka-text-container"),this.g.style.textAlign="center",this.g.style.display="flex",this.g.style.flexDirection="column",this.g.style.alignItems="center",this.g.style.justifyContent="flex-end",this.C.appendChild(this.g),this.o=new ve(function(){i.j.paused||Qi(i)}),Gs(this),this.l=new Map,this.i=new Pe,this.i.D(document,"fullscreenchange",function(){Qi(i,!0)}),this.i.D(this.j,"seeking",function(){Qi(i,!0)}),this.i.D(this.j,"ratechange",function(){Gs(i)}),this.i.D(this.j,"resize",function(){var r=i.j,o=r.videoWidth;r=r.videoHeight,o&&r?i.m=o/r:i.m=null}),this.B=null,"ResizeObserver"in F&&(this.B=new ResizeObserver(function(){Qi(i,!0)}),this.B.observe(this.g)),this.F=new Map}g=kt.prototype,g.configure=function(e){this.u=e,Gs(this),Qi(this,!0)},g.append=function(e){var n=[].concat(X(this.h));e=m(Pm(e));for(var i=e.next(),r={};!i.done;r={kf:void 0},i=e.next())r.kf=i.value,n.some(function(o){return function(s){return Ku(s,o.kf)}}(r))||this.h.push(r.kf);this.h.length&&Gs(this),Qi(this)},g.destroy=function(){return this.g&&(this.C.removeChild(this.g),this.g=null,this.A=!1,this.h=[],this.o&&(this.o.stop(),this.o=null),this.l.clear(),this.i&&(this.i.release(),this.i=null),this.B&&(this.B.disconnect(),this.B=null)),Promise.resolve()},g.remove=function(e,n){if(!this.g)return!1;var i=this.h.length;return this.h=this.h.filter(function(r){return r.startTime=n}),Qi(this,i>this.h.length),this.h.length||Gs(this),!0},g.isTextVisible=function(){return this.A},g.setTextVisibility=function(e){this.A=e,Qi(this,!0)},g.setTextLanguage=function(e){e&&e!="und"?this.g.setAttribute("lang",e):this.g.setAttribute("lang","")},g.enableTextDisplayer=function(){};function Gs(e){e.o&&(e.h.length?e.o.ua((e.u?e.u.captionsUpdatePeriod:.25)/Math.max(1,Math.abs(e.j.playbackRate))):e.o.stop())}function Zw(e,n){for(;n!=null;){if(n==e.g)return!0;n=n.parentElement}return!1}function jm(e,n,i,r,o){var s=!1,u=[],a=[];n=m(n);for(var l=n.next();!l.done;l=n.next()){l=l.value,o.push(l);var c=e.l.get(l),d=l.startTime<=r&&l.endTime>r,h=c?c.Mh:null;c&&(u.push(c.lf),c.Dc&&u.push(c.Dc),d||(s=!0,e.l.delete(l),c=null)),d&&(a.push(l),c?Zw(e,h)||(s=!0):(eE(e,l,o),c=e.l.get(l),h=c.Mh,s=!0)),0e.m&&(a=32),r=0>r?100+r/a*100:r/a*100),u==1&&(s.position="absolute",i.writingMode==yr?(s.width="100%",i.lineAlign==vr?s.top=r+"%":i.lineAlign=="end"&&(s.bottom=100-r+"%")):i.writingMode=="vertical-lr"?(s.height="100%",i.lineAlign==vr?s.left=r+"%":i.lineAlign=="end"&&(s.right=100-r+"%")):(s.height="100%",i.lineAlign==vr?s.right=r+"%":i.lineAlign=="end"&&(s.left=100-r+"%")))),s.lineHeight=i.lineHeight,e=tE(i),e=="line-left"?(s.cssFloat="left",i.position!==null&&(s.position="absolute",i.writingMode==yr?(s.left=i.position+"%",s.width="auto"):s.top=i.position+"%")):e=="line-right"?(s.cssFloat="right",i.position!==null&&(s.position="absolute",i.writingMode==yr?(s.right=100-i.position+"%",s.width="auto"):s.bottom=i.position+"%")):i.position!==null&&i.position!=50&&(s.position="absolute",i.writingMode==yr?(s.left=i.position+"%",s.width="auto"):s.top=i.position+"%"),s.textAlign=i.textAlign,s.textDecoration=i.textDecoration.join(" "),s.writingMode=i.writingMode,"writingMode"in document.documentElement.style&&s.writingMode==i.writingMode||(s.webkitWritingMode=i.writingMode),i.size&&(i.writingMode==yr?s.width=i.size+"%":s.height=i.size+"%")}function zd(e,n,i,r){r=r===void 0?1:r;var o=(o=new RegExp(/(\d*\.?\d+)([a-z]+|%+)/).exec(e))?{value:Number(o[1]),unit:o[2]}:null;if(!o)return e;switch(e=o.unit,r*=o.value,e){case"%":return r/100*i.clientHeight/n.cellResolution.rows+"px";case"c":return i.clientHeight*r/n.cellResolution.rows+"px";default:return r+e}}function iE(e,n){for(var i=e.length-1;0<=i;i--){var r=n(e[i]);if(r||r===0)return r}return null}W("shaka.text.UITextDisplayer",kt),kt.prototype.enableTextDisplayer=kt.prototype.enableTextDisplayer,kt.prototype.setTextLanguage=kt.prototype.setTextLanguage,kt.prototype.setTextVisibility=kt.prototype.setTextVisibility,kt.prototype.isTextVisible=kt.prototype.isTextVisible,kt.prototype.remove=kt.prototype.remove,kt.prototype.destroy=kt.prototype.destroy,kt.prototype.append=kt.prototype.append,kt.prototype.configure=kt.prototype.configure;function rE(e,n){function i(s){for(var u=s,a=m(n),l=a.next();!l.done;l=a.next())l=l.value,l.end&&l.starts?"0":"")+s+":"+(10>a?"0":"")+a+":"+(10>l?"0":"")+l+"."+(100>u?10>u?"00":"0":"")+u}var r=Wd(e);e=`WEBVTT `,r=m(r);for(var o=r.next();!o.done;o=r.next())o=o.value,e+=i(o.startTime)+" --> "+i(o.endTime)+function(s){var u=[];switch(s.textAlign){case"left":u.push("align:left");break;case"right":u.push("align:right");break;case ni:u.push("align:middle");break;case"start":u.push("align:start");break;case"end":u.push("align:end")}switch(s.writingMode){case"vertical-lr":u.push("vertical:lr");break;case"vertical-rl":u.push("vertical:rl")}return u.length?" "+u.join(" "):""}(o)+` `,e+=o.payload+` `;return e}W("shaka.text.WebVttGenerator",function(){});function qd(e,n){this.h=e,this.g=n,this.i=void 0,this.u=!1,this.F=!0,this.l=this.B=!1,this.o=this.m=void 0,this.A=0,this.G=!1,this.C=new Pe,this.j=null}qd.prototype.setMediaElement=function(e){this.j=e,lE(this)},qd.prototype.configure=function(e){this.g=e};function oE(e){e.u=!1,e.F=!0,e.B=!1,e.l=!1,e.m=0,e.o=0,e.A=0,e.G=!1,e.j=null,e.C.Pa()}function sE(e,n){e.l=n,e.l?e.i==Ha?e.i=Ga:e.i==Ka&&(e.i=Xa):e.i==Ga?e.i=Ha:e.i==Xa&&(e.i=Ka)}function uE(e,n){if(e.g&&e.g.enabled&&e.g.version==Om&&e.j&&e.j.autoplay){var i=e.j.play();i&&i.then(function(){e.A=n}).catch(function(){e.A=0})}}function aE(e,n,i){try{if(!e.g.enabled)return n;var r=Yd(e);e:{switch(i.toLowerCase()){case"audio/mp4":case"audio/webm":case"audio/ogg":case"audio/mpeg":case"audio/aac":case"audio/flac":case"audio/wav":var o=ba;break e;case"video/webm":case"video/mp4":case"video/mpeg":case"video/mp2t":o=Fa;break e;case"application/x-mpegurl":case"application/vnd.apple.mpegurl":case"application/dash+xml":case"video/vnd.mpeg.dash.mpd":case"application/vnd.ms-sstr+xml":o=Um;break e}o=void 0}r.ot=o,r.su=!0;var s=Oa(r);return $d(n,s)}catch(u){return ur("CMCD_SRC_ERROR","Could not generate src CMCD data.",u),n}}function lE(e){e.C.qa(e.j,"play",function(){e.m||(e.m=Date.now())}),e.C.qa(e.j,"playing",function(){e.o||(e.o=Date.now())})}function Yd(e){return e.g.sessionId||(e.g.sessionId=F.crypto.randomUUID()),{v:e.g.version,sf:e.i,sid:e.g.sessionId,cid:e.g.contentId,mtp:e.h.getBandwidthEstimate()/1e3}}function Ro(e,n,i){i=i===void 0?{}:i;var r=r===void 0?e.g.useHeaders:r;if(e.g.enabled){Object.assign(i,Yd(e)),i.pr=e.h.eb();var o=i.ot===Ba||i.ot===Fa;if(e.B&&o&&(i.bs=!0,i.su=!0,e.B=!1),i.su==null&&(i.su=e.F),i.v===Om&&(e.h.U()&&(i.ltc=e.h.ae()),o=!e.G&&e.o&&e.m?e.o-(e.A||e.m):void 0,o!=null&&(i.msd=o,e.G=!0)),e=cE(e,i),r)r=fE(e),Object.keys(r).length&&Object.assign(n.headers,r);else{var s=Oa(e);s&&(n.uris=n.uris.map(function(u){return $d(u,s)}))}}}function cE(e,n){var i=e.g.includeKeys;return i.length?Object.keys(n).reduce(function(r,o){return i.includes(o)&&(r[o]=n[o]),r},{}):n}function dE(e){if(e.type===0)return gE;if(e=e.stream){var n=e.type;if(n=="video")return e.codecs&&e.codecs.includes(",")?Fa:Ba;if(n=="audio")return ba;if(n=="text")return e.mimeType==="application/mp4"?Va:Qd}}function hE(e,n){if(n=e.h.wb()[n],!n.length)return NaN;var i=e.h.getCurrentTime();return(e=n.find(function(r){return r.start<=i&&r.end>=i}))?1e3*(e.end-i):NaN}function _m(e,n){if(n=e.h.wb()[n],!n.length)return 0;var i=e.h.getCurrentTime();return(e=n.find(function(r){return r.start<=i&&r.end>=i}))?1e3*(e.end-i):0}function pE(e,n){var i=e.h.Pb();if(!i.length)return NaN;e=i[0],i=m(i);for(var r=i.next();!r.done;r=i.next())r=r.value,r.type==="variant"&&r.bandwidth>e.bandwidth&&(e=r);switch(n){case Ba:return e.videoBandwidth||NaN;case ba:return e.audioBandwidth||NaN;default:return e.bandwidth}}function Oa(e){function n(h){return 100*i(h/100)}function i(h){return Math.round(h)}function r(h){return!Number.isNaN(h)&&h!=null&&h!==""&&h!==!1}var o=[],s={br:i,d:i,bl:n,dl:n,mtp:n,nor:function(h){return encodeURIComponent(h)},rtp:n,tb:i},u=Object.keys(e||{}).sort();u=m(u);for(var a=u.next();!a.done;a=u.next()){a=a.value;var l=e[a];if(r(l)&&(a!=="v"||l!==1)&&(a!="pr"||l!==1)){var c=s[a];c&&(l=c(l)),c=typeof l;var d=void 0;d=c==="string"&&a!=="ot"&&a!=="sf"&&a!=="st"?a+"="+JSON.stringify(l):c==="boolean"?a:c==="symbol"?a+"="+l.description:a+"="+l,o.push(d)}}return o.join(",")}function fE(e){var n=Object.keys(e),i={},r=["Object","Request","Session","Status"],o=[{},{},{},{}],s={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,ltc:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,msd:2,bs:3,rtp:3};n=m(n);for(var u=n.next();!u.done;u=n.next())u=u.value,o[s[u]!=null?s[u]:1][u]=e[u];for(e=0;e=i?e*(1-i)+n*i:e};function bm(e){return e?e.toLowerCase()==="false"?!1:/^[-0-9]/.test(e)?parseInt(e,10):e.replace(/["]+/g,""):!0}W("shaka.util.CmsdManager",wn),wn.prototype.getBandwidthEstimate=wn.prototype.getBandwidthEstimate,wn.prototype.getRoundTripTime=wn.prototype.Di,wn.prototype.getResponseDelay=wn.prototype.Ci,wn.prototype.getEstimatedThroughput=wn.prototype.Rg,wn.prototype.getMaxBitrate=wn.prototype.Tg;var Bm="etp",Fm="mb",Vm="rd",Hm="rtt";function Gm(){this.g=null,this.h=[]}function Jd(e,n){return P(function(i){if(i.g==1)return e.g?S(i,new Promise(function(r){return e.h.push(r)}),2):i.s(2);e.g=n,K(i)})}Gm.prototype.release=function(){0I.end&&(I.end=k.end)}return I},r.Aa=new Ns(p),d?S(w,l(function(){return P(function(A){return S(A,SE(r,i),0)})},"initializeSrcEqualsDrmInner_"),23):(r.Ga=new Ns(p),S(w,l(function(){return P(function(A){if(A.g==1)return S(A,Promise.race([o.na,o.m]),2);r.Ob=o.G;var I=o;I.oa=!0,r.H=I.l,r.i=o.Hf(),K(A)})},"waitForFinish"),15));case 15:if(r.I){w.s(16);break}return S(w,l(function(){return P(function(A){return S(A,eh(r),0)})},"initializeMediaSourceEngineInner_"),16);case 16:return r.i&&r.i.textStreams.length&&(r.u.enableTextDisplayer?r.u.enableTextDisplayer():Ce("Text displayer w/ enableTextDisplayer",'Text displayer should have a "enableTextDisplayer" method!')),S(w,l(function(){return P(function(A){return S(A,o.m,0)})},"waitForFinish"),18);case 18:if(r.g=o.getConfiguration(),r.ve=o.F,r.H&&r.H.setMediaElement&&r.h&&r.H.setMediaElement(r.h),r.wd=Xw(o),r.vd=o.Ga,(f=o.o)&&(r.M=f),c&&r.h&&r.h.nodeName==="AUDIO"&&(yE(r),r.configure("manifest.disableVideo",!0)),o.i){w.s(19);break}return S(w,l(function(){return P(function(A){return S(A,km(o,r.h),0)})},"drmEngine_.init"),19);case 19:return r.C=Ww(o),S(w,l(function(){return P(function(A){return S(A,r.C.Jb(r.h),0)})},"drmEngine_.attach"),21);case 21:return!(y=o.C)||r.Fa&&r.Fa==y||(r.o=Kw(o),r.Fa=o.C,typeof r.o.setMediaElement!="function"&&(Ce("AbrManager w/o setMediaElement","Please use an AbrManager with setMediaElement function."),r.o.setMediaElement=function(){}),typeof r.o.setCmsdManager!="function"&&(Ce("AbrManager w/o setCmsdManager","Please use an AbrManager with setCmsdManager function."),r.o.setCmsdManager=function(){}),typeof r.o.trySuggestStreams!="function"&&(Ce("AbrManager w/o trySuggestStreams","Please use an AbrManager with trySuggestStreams function."),r.o.trySuggestStreams=function(){})),T=zw(o),v=o.J,S(w,l(function(){return P(function(A){return S(A,TE(r,h,v,T),0)})},"loadInner_"),22);case 22:Gw(o),r.Nb&&Tt()&&Kc(r.Nb)&&Ox(r.I,r.W,r.Nb),w.s(14);break;case 23:return S(w,l(function(){return P(function(A){return S(A,xE(r,h,i),0)})},"srcEqualsInner_"),14);case 14:r.dispatchEvent(Ve("loaded"));case 6:if(sn(w),!o){w.s(25);break}return S(w,o.destroy(),25);case 25:r.za=null,un(w,0);break;case 5:if(x=ae(w),!x||x.code==7e3){w.s(27);break}return S(w,r.lc(!1),27);case 27:throw x}})};function yE(e){for(var n=m(e.i.variants),i=n.next();!i.done;i=n.next())i=i.value,i.video&&(i.video.closeSegmentIndex(),i.video=null),i.bandwidth=i.audio&&i.audio.bandwidth?i.audio.bandwidth:0;e.i.variants=e.i.variants.filter(function(r){return r.audio})}g.Gj=function(e,n){e=e===void 0?!0:e,n=n===void 0?!1:n;var i=this,r;return P(function(o){return o.g==1?S(o,Xm(i),2):o.g!=3?(r=o.h,S(o,i.lc(e,n),3)):o.return(r)})},g.Lg=function(e,n){e=e===void 0?!1:e,n=n===void 0?!1:n;var i=this,r;return P(function(o){return o.g==1?S(o,Xm(i,n),2):o.g!=3?(r=o.h,S(o,i.detach(e),3)):o.return(r)})};function Xm(e,n){n=n===void 0?!1:n;var i,r;return P(function(o){if(o.g==1)return i=null,e.i&&e.H&&e.Ob&&e.W?(r=e.h.currentTime,e.U()&&!n&&(r=null),S(o,zm(e,e.W,r,e.Nb,!0,!1,!1),3)):o.s(2);if(o.g!=2){i=o.h,e.Pe.push(i),e.H&&e.H.setMediaElement&&e.H.setMediaElement(null);var s=i,u=e.H,a=e.Ob;s.h=e.i,s.l=u,s.G=a,s=i,u=e.Fa,s.j=e.o,s.C=u,i.o=e.M,i.start(),e.i=null,e.H=null,e.Ob=null,e.o=null,e.Fa=null}return o.return(i)})}g.preload=function(e,n,i){n=n===void 0?null:n;var r=this,o;return P(function(s){return s.g==1?S(s,Wm(r,e,n,i),2):((o=s.h)?o.start():No(r,new R(2,7,7005)),s.return(o))})},g.pf=function(){var e=this,n,i,r,o;return P(function(s){for(n=[],i=m(e.Pe),r=i.next();!r.done;r=i.next())o=r.value,o.u||n.push(o.destroy());return e.Pe=[],S(s,Promise.all(n),0)})};function Wm(e,n,i,r,o){o=o===void 0?!1:o;var s,u,a,l;return P(function(c){return c.g==1?r?c.s(2):S(c,qm(e,n),3):(c.g!=2&&(r=c.h),(s=vE(e,r))?c.return(null):(u=!1,a=!0,o&&(e.o&&e.Fa==e.g.abrFactory&&(a=!1),e.h&&e.h.nodeName==="AUDIO"&&(u=!0)),l=zm(e,n,i,r||null,!o,u,a),l=o?l.then(function(d){return d.A=!1,d}):l.then(function(d){return e.Pe.push(d),d}),c.return(l)))})}function zm(e,n,i,r,o,s,u){o=o===void 0?!0:o,s=s===void 0?!1:s,u=u===void 0?!0:u;var a,l,c,d,h,p,f,y,T,v,x,w,A,I;return P(function(k){return k.g==1?(a=null,l=Gn(e.g),s&&(l.manifest.disableVideo=!0),c=function(){return a.T&&a.u?null:a},d=function(){return c()?c().getConfiguration():e.g},e.ka.width!=1/0||e.ka.height!=1/0||e.g.ignoreHardwareResolution?k.s(2):S(k,hf(),3)):(k.g!=2&&(h=k.h,e.ka.width=h.width,e.ka.height=h.height),p=new od(l,e.ka,null),f={networkingEngine:e.F,filter:function(C){var E,M;return P(function(D){if(D.g==1)return S(D,kg(p,C),2);if(D.g!=4)return E=D.h,E?(M=Ve("trackschanged"),S(D,Promise.resolve(),4)):D.s(0);a.dispatchEvent(M),K(D)})},makeTextStreamsForClosedCaptions:function(C){return jE(e,C)},onTimelineRegionAdded:function(C){Cd(a.H,C)},onEvent:function(C){return a.dispatchEvent(C)},onError:function(C){return a.onError(C)},isLowLatencyMode:function(){return d().streaming.lowLatencyMode},updateDuration:function(){e.j&&a.T&&e.j.updateDuration()},newDrmInfo:function(C){var E=a.i,M=E?E.h:null;M&&E.A&&Pg(p,M.keySystem,C)},onManifestUpdated:function(){var C=new Map().set("isLive",e.U());a.dispatchEvent(Ve("manifestupdated",C)),Fs(a,!1,function(){e.B&&e.B.onManifestUpdated(e.U())})},getBandwidthEstimate:function(){return e.o.getBandwidthEstimate()},onMetadata:function(C,E,M,D){var _=C;C=="com.apple.hls.interstitial"&&(_="com.apple.quicktime.HLS",C={startTime:E,endTime:M,values:D},e.B)&&e.B.onHLSInterstitialMetadata(e,e.h,C),D=m(D),C=D.next();for(var j={};!C.done;j={Zf:void 0},C=D.next())j.Zf=C.value,j.Zf.name!="ID"&&Fs(a,!1,function(L){return function(){th(e,E,M,_,L.Zf)}}(j))},disableStream:function(C){return e.disableStream(C,e.g.streaming.maxDisabledTime)},addFont:function(C,E){return e.addFont(C,E)}},y=new Ns(function(){return e.Ta()}),y.addEventListener("regionadd",function(C){var E=C.region;zs(e,"timelineregionadded",E,a),Fs(a,!1,function(){e.B&&(e.B.onDashTimedMetadata(E),e.B.onDASHInterstitialMetadata(e,e.h,E))})}),T=null,l.streaming.observeQualityChanges&&(T=new xa(function(){return e.wb()}),T.addEventListener("qualitychange",function(C){my(e,C.quality,C.position)}),T.addEventListener("audiotrackchange",function(C){my(e,C.quality,C.position,!0)})),v=!0,x={Vb:e.F,onError:function(C){return a.onError(C)},re:function(C){Fs(a,!0,function(){if(e.C)e:{var E=C,M=Ve("keystatuschanged");e.dispatchEvent(M);var D=Object.keys(E);D.length==1&&D[0]==""&&(D=["00"],E={"00":E[""]}),M=D.length==1&&D[0]=="00";var _=!1;if(D.length){D=e.keySystem();for(var j=Ar(e.g.drm.clearKeys),L=m(e.i.variants),N=L.next();!N.done;N=L.next()){N=N.value;var U=[];N.audio&&U.push(N.audio),N.video&&U.push(N.video),U=m(U);for(var O=U.next();!O.done;O=U.next()){var b=O.value;if(O=N.allowedByKeySystem,b.keyIds.size)if(b.drmInfos.length&&!j.size){b=m(b.drmInfos);for(var V=b.next();!V.done;V=b.next())if(V=V.value,V.keyIds.size&&V.keySystem==D){N.allowedByKeySystem=!0,V=m(V.keyIds);for(var H=V.next();!H.done;H=V.next())H=H.value,((H=E[M?"00":H])||e.C.F)&&(N.allowedByKeySystem=N.allowedByKeySystem&&!!H&&!sd.includes(H))}}else for(N.allowedByKeySystem=!0,b=m(b.keyIds),V=b.next();!V.done;V=b.next())V=V.value,((V=E[M?"00":V])||e.C.F)&&(N.allowedByKeySystem=N.allowedByKeySystem&&!!V&&!sd.includes(V));O!=N.allowedByKeySystem&&(_=!0)}}}if(_&&(Yt(e),!Ri(e)))break e;(E=e.j.l)&&!E.allowedByKeySystem&&Lo(e)}})},onExpirationUpdated:function(C,E){var M=Ve("expirationupdated");a.dispatchEvent(M),(M=a.l)&&M.onExpirationUpdated&&M.onExpirationUpdated(C,E)},onEvent:function(C){a.dispatchEvent(C),C.type=="drmsessionupdate"&&v&&(v=!1,C=Date.now()/1e3-a.za,(e.A||a.getStats()).j=C,e.P&&yf(e.P))}},w=Jm(e,c),og(e.F,w),A=function(){return e.Kc(x)},I={config:l,$i:f,kj:y,jj:T,Kc:A,Zi:p,networkingEngine:w,Th:o,Sh:u},a=new xn(n,r,i,I),k.return(a))})}function qm(e,n){var i,r;return P(function(o){return o.g==1?(i=e.g.manifest.retryParameters,S(o,Nr(n,e.F,i),2)):(r=o.h,r=="application/x-mpegurl"&&Tt()&&(r="application/vnd.apple.mpegurl"),o.return(r))})}function vE(e,n){if(!Qn())return!0;if(n){if((e.h||df()).canPlayType(n)=="")return!1;if(!Qn()||!go.has(n))return!0;if(Kc(n))return Tt()&&(e.g.drm.servers["com.apple.fps"]||e.g.drm.servers["com.apple.fps.1_0"])?e.g.streaming.useNativeHlsForFairPlay:e.g.streaming.preferNativeHls;if(n==="application/dash+xml"||n==="video/vnd.mpeg.dash.mpd")return e.g.streaming.preferNativeDash}return!1}function Ym(e){var n=e.g.textDisplayFactory;n!==e.Ve&&(e.u=n(),e.u.configure?e.u.configure(e.g.textDisplayer):Ce("Text displayer w/ configure",'Text displayer should have a "configure" method!'),e.Ve=n,e.u.setTextVisibility(e.na))}function eh(e){var n,i,r;return P(function(o){if(o.g==1)return Po(e,"media-source"),e.h.removeAttribute("src"),Yi(e.h),Ym(e),n=DE(e.h,e.u,{si:function(){return e.keySystem()},onMetadata:function(s,u,a){s=m(s);for(var l=s.next();!l.done;l=s.next())if(l=l.value,l.data&&typeof l.cueTime=="number"&&l.frames){var c=l.cueTime+u,d=a;d&&c>d&&(d=c);for(var h=m(l.frames),p=h.next();!p.done;p=h.next())th(e,c,d,"org.id3",p.value);e.B&&e.B.onHlsTimedMetadata(l,c)}},ej:function(s){e.Ga&&Cd(e.Ga,{schemeIdUri:s.schemeIdUri,startTime:s.startTime,endTime:s.endTime,id:String(s.id),emsg:s})},onEvent:function(s){return e.dispatchEvent(s)},gj:function(){e.H&&e.H.update&&e.H.update()}},e.P),n.configure(e.g.mediaSource),i=e.g.manifest,r=i.segmentRelativeVttTiming,n.Ea=r,S(o,n.I,2);e.I=n,K(o)})}function $m(e,n,i){function r(){return ih(e)}e.l.D(n,"playing",r),e.l.D(n,"pause",r),e.l.D(n,"ended",r),e.l.D(n,"ratechange",function(){var o=e.h.playbackRate;o!=0&&(e.J&&(e.J.set(o),e.m==jt&&e.o.playbackRateChanged(o),ay(e,o)),o=Ve("ratechange"),e.dispatchEvent(o))}),n.remote&&(e.l.D(n.remote,"connect",function(){return Yt(e)}),e.l.D(n.remote,"connecting",function(){return Yt(e)}),e.l.D(n.remote,"disconnect",function(){return P(function(o){if(o.g==1)return e.j&&n.remote.state=="disconnected"?S(o,ka(e.j),2):o.s(2);Yt(e),K(o)})})),n.audioTracks&&(e.l.D(n.audioTracks,"addtrack",function(){return Yt(e)}),e.l.D(n.audioTracks,"removetrack",function(){return Yt(e)}),e.l.D(n.audioTracks,"change",function(){return Yt(e)})),n.textTracks&&(e.l.D(n.textTracks,"addtrack",function(o){if(o.track)switch(o=o.track,o.kind){case"metadata":AE(e,o);break;case"chapters":IE(e,o);break;default:Yt(e)}}),e.l.D(n.textTracks,"removetrack",function(){return Yt(e)}),e.l.D(n.textTracks,"change",function(){return Yt(e)}),e.g.streaming.crossBoundaryStrategy!=="keep"&&(e.l.D(n,"waiting",function(){e.j&&Bd(e.j)}),e.l.D(n,"timeupdate",function(){e.j&&Bd(e.j)}))),n.preload!="none"&&e.l.qa(n,"loadedmetadata",function(){e.A.C=Date.now()/1e3-i})}function TE(e,n,i,r){var o,s,u,a,l,c,d,h,p,f,y,T,v,x,w,A,I,k,C,E,M,D,_,j,L,N;return P(function(U){switch(U.g){case 1:for(Po(e,"load"),o=e.h,e.J=new Ls({be:function(){return o.playbackRate},tc:function(){return o.defaultPlaybackRate},mg:function(O){o.playbackRate=O},fh:function(O){o.currentTime+=O}}),$m(e,o,n),("onchange"in F.screen)&&e.l.D(F.screen,"change",function(){if(e.M.getConfiguration){var O=e.M.getConfiguration();O.ec=="AUTO"?Ri(e):e.g.preferredVideoHdrLevel=="AUTO"&&e.g.abr.enabled&&(O.ec="AUTO",e.M.configure(O),Ri(e))}}),s=!1,u=m(e.i.variants),a=u.next();!a.done;a=u.next())l=a.value,(c=l.video&&l.video.dependencyStream)&&(s=vf(c));mE(e,e.g,s),e.Rb=e.g.preferredTextLanguage,e.Fd=e.g.preferredTextRole,e.Dd=e.g.preferForcedSubs,sh(e.i.presentationTimeline,e.g.playRangeStart,e.g.playRangeEnd),e.o.init(function(O,b,V){e.i&&e.j&&O!=e.j.l&&Xs(e,O,!0,b===void 0?!1:b,V===void 0?0:V)}),e.o.setMediaElement(o),e.o.setCmsdManager(e.fa),e.j=PE(e),e.j.configure(e.g.streaming),e.m=jt,e.dispatchEvent(Ve("streaming")),d=i;case 2:for((p=e.j.l)||d||(d=Ri(e)?e.o.chooseVariant():null),f=[],h=p||d,y=m([h.video,h.audio]),T=y.next();!T.done;T=y.next())(v=T.value)&&!v.segmentIndex&&(f.push(v.createSegmentIndex()),v.dependencyStream&&f.push(v.dependencyStream.createSegmentIndex()));if(!(0C&&(I=C),S(U,_E(d,I),9);case 9:E=U.h,x(E);case 8:Xs(e,d,!0,!1,0);case 7:return e.G.ready(),M=e.uc().find(function(O){return O.active}),M||((D=ao(e.i.textStreams,e.Rb,e.Fd,e.Dd)[0]||null)&&Gd(e.A.h,D,!0),d&&(D?(Jf(d.audio,D,e.g)&&(e.na=!0),e.na&&e.u.setTextVisibility(!0)):(e.na=!1,e.u.setTextVisibility(!1)),fy(e)),D&&(e.g.streaming.alwaysStreamText||e.Pf())&&(Aa(e.j,D),Ws(e))),S(U,e.j.start(r),10);case 10:e.g.abr.enabled&&(e.o.enable(),gy(e)),Yt(e),Ri(e),e.i.variants.some(function(O){return O.primary}),((_=e.U())&&(e.g.streaming.liveSync&&e.g.streaming.liveSync.enabled||e.i.serviceDescription||e.g.streaming.liveSync.panicMode)||e.g.streaming.vodDynamicPlaybackRate)&&(j=function(){return ly(e)},e.l.D(o,"timeupdate",j)),_||(L=function(){return Ya(e)},e.l.D(o,"timeupdate",L),Ya(e),e.i.nextUrl&&(0, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way, and we cannot provide track info yet. Please do not use preload="none" with Shaka Player.'),c.resolve()),e.l.qa(r,"error",function(){c.reject(oh(e))}),S(T,ys(e.g.streaming.loadTimeout,c),4);case 4:((h=e.U())&&(e.g.streaming.liveSync&&e.g.streaming.liveSync.enabled||e.g.streaming.liveSync.panicMode)||e.g.streaming.vodDynamicPlaybackRate)&&(p=function(){return ly(e)},e.l.D(r,"timeupdate",p)),h||(f=function(){return Ya(e)},e.l.D(r,"timeupdate",f),Ya(e)),e.B&&(e.B.onManifestUpdated(h),h&&(y=e.Ta().end,e.l.D(r,"progress",function(){var v=e.Ta().end;y!=v&&(e.B.onManifestUpdated(e.U()),y=v)}))),e.sa=!0,K(T)}})}function wE(e){var n=e.g.preferredAudioLanguage;n!=""&&e.rh(n,e.g.preferredVariantRole)}function EE(e){var n=e.g.preferredTextLanguage;n!=""&&e.hg(n,e.g.preferredTextRole,e.g.preferForcedSubs)}function AE(e,n){if(n.kind=="metadata"){n.mode="hidden",e.l.D(n,"cuechange",function(){if(n.activeCues)for(var r=m(n.activeCues),o=r.next();!o.done;o=r.next())o=o.value,th(e,o.startTime,o.endTime,o.type,o.value),e.B&&e.B.onCueMetadataChange(o.value);if(n.cues){r=[],o=m(n.cues);for(var s=o.next(),u={};!s.done;u={$b:void 0},s=o.next())u.$b=s.value,u.$b.type=="com.apple.quicktime.HLS"&&u.$b.startTime!=null&&(s=r.find(function(a){return function(l){return l.startTime==a.$b.startTime&&l.endTime==a.$b.endTime}}(u)),s||(s={startTime:u.$b.startTime,endTime:u.$b.endTime,values:[]},r.push(s)),s.values.push(u.$b.value));for(r=m(r),o=r.next();!o.done;o=r.next())o=o.value,o.values.some(function(a){return a.key=="X-ASSET-URI"||a.key=="X-ASSET-LIST"})&&e.B&&(o.values.push({key:"CUE",description:"",data:o.startTime!=0||e.U()?"ONCE":"ONCE,PRE",mimeType:null,pictureType:null}),e.B.onHLSInterstitialMetadata(e,e.h,o))}});var i=new ve(function(){var r=LE(e);r=m(r);for(var o=r.next();!o.done;o=r.next())o.value.mode="hidden"}).qb().da(.5);e.zd.push(function(){i.stop()})}}function Qm(e,n){n=new Map().set("startTime",n.startTime).set("endTime",n.endTime).set("metadataType",n.schemeIdUri).set("payload",n.payload),e.dispatchEvent(Ve("metadata",n))}function th(e,n,i,r,o){e.Aa&&(n={schemeIdUri:r,startTime:n,endTime:i||1/0,id:"",payload:o},n.id=JSON.stringify(n),Cd(e.Aa,n))}function IE(e,n){if(n&&n.kind=="chapters"){n.mode="hidden";var i=new ve(function(){n.mode="hidden"}).qb().da(.5);e.zd.push(function(){i.stop()})}}g.oj=function(){for(var e=this.$;e.g;)e.release()},g.Kc=function(e){return new oa(e)};function Jm(e,n){function i(o){n()?n().dispatchEvent(o):e.dispatchEvent(o)}function r(o){n()?Fs(n(),!0,o):o()}return n||(n=function(){return null}),new Fe(function(o,s,u,a){var l=n()?n().j:e.o;l&&l.segmentDownloaded(o,s,u,a)},function(o,s,u){s=new Map().set("headers",o).set("request",s).set("requestType",u),i(Ve("downloadheadersreceived",s)),r(function(){if(e.fa){var a=e.fa;if(a.h.enabled){var l=o["cmsd-static"];if(l)try{var c=new Map,d=l.split(",");for(l=0;ly);if(v){var x=v.next().value;if(x&&x!=d){if(!Zr(d.N(),x.N())){var w=x.N()[0],A=s.uris[0],I=new URL(w),k=new URL(A);if(I.origin!==k.origin)var C=w;else{for(var E=I.pathname.split("/").slice(1),M=k.pathname.split("/").slice(1,-1);E[0]===M[0];)E.shift(),M.shift();for(;M.length;)M.shift(),E.unshift("..");C=E.join("/")}h.nor=C}if((x.startByte||x.endByte)&&(d.startByte!=x.startByte||d.endByte!=x.endByte)){var D=x.startByte+"-";x.endByte&&(D+=x.endByte),h.nrr=D}}}var _=a.h.eb()||1,j=_m(a,f.type)||500,L=f.bandwidth,N=L?L*(d.endTime-d.startTime)/1e3/(j/_/1e3)*a.g.rtpSafetyFactor:NaN;isNaN(N)||(h.rtp=N)}}p&&h.ot!==Va&&(h.tb=pE(a,h.ot)/1e3),Ro(a,s,h)}}catch(U){ur("CMCD_SEGMENT_ERROR","Could not generate segment CMCD data.",U)}break;case 2:case 5:case 6:Ro(a,s,{ot:"k"});break;case 4:Ro(a,s,{ot:"o"})}})},function(o,s,u,a){(o=n()?n().l:e.H)&&o.banLocation&&o.banLocation(a)},function(o,s){if(s.data){s=s.data.byteLength;var u=n()?n().getStats():e.A;u&&(u.nc=isNaN(u.nc)?s:u.nc+s,o===0&&(u.ah=s))}})}function CE(e,n){return new dm(e.h,e.i,e.g.streaming,n,function(){e.La&&gm(e.La,!0),e.j&&e.j.Ec(),e.O&&ii(e)},function(i){return e.dispatchEvent(i)})}function ME(e,n){var i=e.U()||0=e.h.duration-1}break;case jt:e:if(e.Sc()||Dr(e.I))n=!0;else{if(e.i.presentationTimeline.U()){i=e.i.presentationTimeline.bc();var r=ld(e.h.buffered);if(r!=null&&r>=i){n=!0;break e}}n=!1}break;default:n=!1}r=Gg(e.h.buffered,e.h.currentTime),i=e.O;var o=n,s=i.i.get(i.g);n=i.g,r=o||r>=s&&0=n)return 1;if(!(e<=this.h.currentTime)&&ec(f,d))&&(p=f);p!=d&&(p?(d=Sr(p),l.Ce(d,!0,r||0)):Lo(l))}var l=this;i=i===void 0?0:i,r=r===void 0?0:r,o=o===void 0?"":o,s=s===void 0?!1:s,u=u===void 0?"":u,!(this.i&&this.G&&(a(),!this.xa()))&&function(){if(l.h&&l.h.audioTracks){var c=ao(l.Pb(),e,n||"",!1)[0];c&&l.Ce(c)}}()},g.hg=function(e,n,i){function r(){o.Rb=e,o.Fd=n||"",o.Dd=i||!1;var s=ao(o.i.textStreams,o.Rb,o.Fd,o.Dd)[0]||null;s&&s!=o.j.u&&(Gd(o.A.h,s,!1),o.g.streaming.alwaysStreamText||o.Pf())&&(Aa(o.j,s),$a(o),Ws(o))}var o=this;i=i===void 0?!1:i,!(this.i&&this.G&&(r(),!this.xa()))&&function(){var s=ao(o.uc(),e,n||"",i||!1)[0];s&&o.sh(s)}()},g.yj=function(e,n,i){function r(){for(var s=null,u=m(o.i.variants),a=u.next();!a.done;a=u.next())if(a=a.value,a.audio.label==e){s=a;break}s!=null&&(o.M=o.g.adaptationSetCriteriaFactory(),o.M.configure({language:s.language,role:"",channelCount:0,ec:"",spatialAudio:!1,videoLayout:"",dd:"",Jc:e,codecSwitchingStrategy:o.g.mediaSource.codecSwitchingStrategy,audioCodec:""}),Lo(o,n,i))}var o=this;n=n===void 0?!0:n,i=i===void 0?0:i,!(this.i&&this.G&&(r(),!this.xa()))&&function(){if(o.h&&o.h.audioTracks){var s=Array.from(o.h.audioTracks),u=null;s=m(s);for(var a=s.next();!a.done;a=s.next())a=a.value,a.label==e&&(u=a);u&&cy(o,u)}}()},g.Pf=function(){var e=this.na;return this.u?this.u.isTextVisible():e},g.ji=function(){return this.Hd.map(function(e){return xr(e)})},g.ii=function(e){if(!this.Hd.length)return[];var n=Oe(e);if(e=this.Hd.filter(function(s){return Oe(s.language)==n}),!e.length)return[];var i=[],r=new Set;e=m(e);for(var o=e.next();!o.done;o=e.next())o=o.value,o.segmentIndex&&o.segmentIndex.vb(function(s){var u=s.N()[0],a=s.startTime+"-"+s.endTime+"-"+u;s={id:a,title:u,startTime:s.startTime,endTime:s.endTime},r.has(a)||(i.push(s),r.add(a))});return i};function Ks(e){return Array.from(e.h.textTracks).filter(function(n){return n.kind!="metadata"&&n.kind!="chapters"&&n.label!="Shaka Player TextTrack"})}function sy(e){return Array.from(e.h.textTracks).find(function(n){return n.label=="Shaka Player TextTrack"})}function LE(e){return Array.from(e.h.textTracks).filter(function(n){return n.kind=="metadata"})}g.yh=function(e){e=!!e,this.na!=e&&(this.na=e,this.m==jt?(this.u.setTextVisibility(e),this.g.streaming.alwaysStreamText||(e?this.j.u||(e=ao(this.i.textStreams,this.Rb,this.Fd,this.Dd),0=Math.floor(r.end)&&e.ed():Math.floor(i)<=Math.floor(r.start+o)&&e.ed()})}function ih(e){if(e.A&&e.O){var n=e.A.g,i="playing";e.O.g==fo?i="buffering":e.Sc()?i="ended":e.h.paused&&(i="paused");var r=i;if(n.g==null)n.g={timestamp:Date.now()/1e3,state:r,duration:0},n=!0;else{var o=Date.now()/1e3;n.g.duration=o-n.g.timestamp,n.g.state==r?n=!1:(n.h.push(n.g),n.g={timestamp:o,state:r,duration:0},n=!0)}n&&(i=new Map().set("newstate",i),e.dispatchEvent(Ve("statechanged",i)))}}function ly(e){var n=e.h.playbackRate,i=e.U();if(e.g.streaming.vodDynamicPlaybackRate&&!i){var r=e.g.streaming.vodDynamicPlaybackRateLowBufferRate,o=e.Qg();o<=e.g.streaming.vodDynamicPlaybackRateBufferRatio?n!=r&&e.Ld(r,!1):o==1&&n!==e.J.tc()&&e.ed()}if(i&&(i=e.Ta(),Number.isFinite(i.end)&&!(e.h.currentTime1e3*s&&(s=e.g.streaming.liveSync.dynamicTargetLatency.minLatency,e.T=Math.max(e.T-(u-s)/2,s+r),e.Ma=Date.now()),o&&e.T!==null&&(a=e.T+r,l=e.T-r),u=i.end-e.h.currentTime,r=0,e.m==cn&&(o=e.h.buffered,0a?(n!=c&&e.Ld(c,!1),e.Ma=null):l!=null&&d&&u-ro)&&e.Wen&&(n+=Math.pow(2,32)),n=n.toString(16)),new R(2,3,3016,i,n,e.h.error.message))}function sh(e,n,i){0=this.Ta().end},W("shaka.Player",B),B.prototype.isEnded=B.prototype.Sc,B.prototype.isRemotePlayback=B.prototype.xa,B.prototype.addFont=B.prototype.addFont,B.prototype.setVideoContainer=B.prototype.Bh,B.prototype.getFetchedPlaybackInfo=B.prototype.ni,B.prototype.getManifestParserFactory=B.prototype.ui,B.prototype.getManifest=B.prototype.Hf,B.prototype.retryStreaming=B.prototype.eg,B.prototype.setMaxHardwareResolution=B.prototype.Dj,B.prototype.addChaptersTrack=B.prototype.Ph,B.prototype.addThumbnailsTrack=B.prototype.Rh,B.prototype.addTextTrackAsync=B.prototype.Qh,B.prototype.getStats=B.prototype.getStats,B.prototype.getBufferedInfo=B.prototype.wb,B.prototype.getSegmentAvailabilityDuration=B.prototype.ce,B.prototype.getPresentationStartTimeAsDate=B.prototype.Vg,B.prototype.getPlayheadTimeAsDate=B.prototype.yi,B.prototype.setTextTrackVisibility=B.prototype.yh,B.prototype.getChapters=B.prototype.ii,B.prototype.getChaptersTracks=B.prototype.ji,B.prototype.isTextTrackVisible=B.prototype.Pf,B.prototype.selectVariantsByLabel=B.prototype.yj,B.prototype.selectTextLanguage=B.prototype.hg,B.prototype.selectAudioLanguage=B.prototype.rh,B.prototype.getTextLanguages=B.prototype.Ei,B.prototype.getAudioLanguages=B.prototype.fi,B.prototype.getTextLanguagesAndRoles=B.prototype.Fi,B.prototype.getAudioLanguagesAndRoles=B.prototype.gi,B.prototype.getAudioTracks=B.prototype.getAudioTracks,B.prototype.selectAudioTrack=B.prototype.xj,B.prototype.selectVariantTrack=B.prototype.Ce,B.prototype.selectTextTrack=B.prototype.sh,B.prototype.getThumbnails=B.prototype.Hi,B.prototype.getAllThumbnails=B.prototype.ei,B.prototype.getImageTracks=B.prototype.pi,B.prototype.getTextTracks=B.prototype.uc,B.prototype.getVariantTracks=B.prototype.Pb,B.prototype.cancelTrickPlay=B.prototype.ed,B.prototype.trickPlay=B.prototype.Ld,B.prototype.getPlaybackRate=B.prototype.eb,B.prototype.isBuffering=B.prototype.Of,B.prototype.getKeyStatuses=B.prototype.$d,B.prototype.getActiveSessionsMetadata=B.prototype.Gf,B.prototype.getExpiration=B.prototype.nd,B.prototype.drmInfo=B.prototype.drmInfo,B.prototype.keySystem=B.prototype.keySystem,B.prototype.isFullyLoaded=B.prototype.Ri,B.prototype.goToLive=B.prototype.Ni,B.prototype.seekRange=B.prototype.Ta,B.prototype.isAudioOnly=B.prototype.Qi,B.prototype.isInProgress=B.prototype.xc,B.prototype.isLive=B.prototype.U,B.prototype.getAdManager=B.prototype.Pg,B.prototype.getAssetUri=B.prototype.Pc,B.prototype.getNetworkingEngine=B.prototype.xb,B.prototype.getMediaElement=B.prototype.xi,B.prototype.getManifestType=B.prototype.Sg,B.prototype.getLoadMode=B.prototype.ti,B.prototype.resetConfiguration=B.prototype.sj,B.prototype.getBufferFullness=B.prototype.Qg,B.prototype.getNonDefaultConfiguration=B.prototype.Ug,B.prototype.getConfigurationForLowLatency=B.prototype.ki,B.prototype.getConfiguration=B.prototype.getConfiguration,B.prototype.configurationForLowLatency=B.prototype.bi,B.prototype.configure=B.prototype.configure,B.prototype.releaseAllMutexes=B.prototype.oj,B.prototype.destroyAllPreloads=B.prototype.pf,B.prototype.preload=B.prototype.preload,B.prototype.detachAndSavePreload=B.prototype.Lg,B.prototype.unloadAndSavePreload=B.prototype.Gj,B.prototype.load=B.prototype.load,B.prototype.updateStartTime=B.prototype.Kj,B.prototype.unload=B.prototype.lc,B.prototype.detach=B.prototype.detach,B.prototype.attachCanvas=B.prototype.Uh,B.prototype.attach=B.prototype.Jb,B.probeSupport=function(e){e=e===void 0?!0:e;var n,i,r,o,s,u;return P(function(a){switch(a.g){case 1:if(n={},!e){a.s(2);break}return S(a,nx(),3);case 3:n=a.h;case 2:return i=dx(),r=Bx(),S(a,hf(),4);case 4:return o=a.h,s={manifest:i,media:r,drm:n,hardwareResolution:o},u=Sy,u.forEach(function(l,c){s[c]=l()}),a.return(s)}})},B.isBrowserSupported=function(){return F.Promise||Ee("A Promise implementation or polyfill is required"),F.Promise&&F.Uint8Array&&Array.prototype.forEach&&!nt("Trident/")?Qn()?!0:rs("application/x-mpegurl"):!1},B.setAdManagerFactory=function(e){Ja=e},B.registerSupportPlugin=Km,B.prototype.destroy=B.prototype.destroy;var Un=0,Qa=1,jt=2,cn=3;B.LoadMode={DESTROYED:Un,NOT_LOADED:Qa,MEDIA_SOURCE:jt,SRC_EQUALS:cn},B.version="v4.14.14";var Ty=["4","14"];rf=new function(e){this.g=e,this.i=rS,this.h=oS}(new pc(Number(Ty[0]),Number(Ty[1])));var Sy=new Map,Ja=null;function xy(){this.g=[],this.i=this.m=this.l=this.j=this.h=0}function UE(e){return e.g.length?e.g.reduce(function(n,i){return n+i},0)/e.g.length:0}function te(e,n,i){var r=this;this.g=e,this.h=n,this.m=i,this.i=!1,this.j=this.h.getVolume(),this.l=new Pe,this.l.D(this.h,google.ima.AdEvent.Type.PAUSED,function(){r.i=!0}),this.l.D(this.h,google.ima.AdEvent.Type.RESUMED,function(){r.i=!1})}g=te.prototype,g.needsSkipUI=function(){return!1},g.isClientRendering=function(){return!0},g.hasCustomClick=function(){return!0},g.isUsingAnotherMediaElement=function(){return!0},g.getDuration=function(){return this.g.getDuration()},g.getMinSuggestedDuration=function(){return this.g.getMinSuggestedDuration()},g.getRemainingTime=function(){return this.h.getRemainingTime()},g.isPaused=function(){return this.i},g.isSkippable=function(){return 0<=this.g.getSkipTimeOffset()},g.getTimeUntilSkippable=function(){var e=this.g.getSkipTimeOffset();return e=this.getRemainingTime()-e,Math.max(e,0)},g.canSkipNow=function(){return this.h.getAdSkippableState()},g.skip=function(){return this.h.skip()},g.pause=function(){return this.h.pause()},g.play=function(){return this.h.resume()},g.getVolume=function(){return this.h.getVolume()},g.setVolume=function(e){return this.m.volume=e,this.h.setVolume(e)},g.isMuted=function(){return this.h.getVolume()==0},g.isLinear=function(){return this.g.isLinear()},g.resize=function(e,n){this.h.resize(e,n)},g.setMuted=function(e){(this.m.muted=e)?(this.j=this.getVolume(),this.h.setVolume(0)):this.h.setVolume(this.j)},g.getSequenceLength=function(){var e=this.g.getAdPodInfo();return e==null?1:e.getTotalAds()},g.getPositionInSequence=function(){var e=this.g.getAdPodInfo();return e==null?1:e.getAdPosition()},g.getTitle=function(){return this.g.getTitle()},g.getDescription=function(){return this.g.getDescription()},g.getVastMediaBitrate=function(){return this.g.getVastMediaBitrate()},g.getVastMediaHeight=function(){return this.g.getVastMediaHeight()},g.getVastMediaWidth=function(){return this.g.getVastMediaWidth()},g.getAdId=function(){return this.g.getAdId()},g.getCreativeAdId=function(){return this.g.getCreativeAdId()},g.getAdvertiserName=function(){return this.g.getAdvertiserName()},g.getMediaUrl=function(){return this.g.getMediaUrl()},g.getTimeOffset=function(){var e=this.g.getAdPodInfo();return e==null?0:e.getTimeOffset()},g.getPodIndex=function(){var e=this.g.getAdPodInfo();return e==null?0:e.getPodIndex()},g.release=function(){this.h=this.g=null},W("shaka.ads.ClientSideAd",te),te.prototype.release=te.prototype.release,te.prototype.getPodIndex=te.prototype.getPodIndex,te.prototype.getTimeOffset=te.prototype.getTimeOffset,te.prototype.getMediaUrl=te.prototype.getMediaUrl,te.prototype.getAdvertiserName=te.prototype.getAdvertiserName,te.prototype.getCreativeAdId=te.prototype.getCreativeAdId,te.prototype.getAdId=te.prototype.getAdId,te.prototype.getVastMediaWidth=te.prototype.getVastMediaWidth,te.prototype.getVastMediaHeight=te.prototype.getVastMediaHeight,te.prototype.getVastMediaBitrate=te.prototype.getVastMediaBitrate,te.prototype.getDescription=te.prototype.getDescription,te.prototype.getTitle=te.prototype.getTitle,te.prototype.getPositionInSequence=te.prototype.getPositionInSequence,te.prototype.getSequenceLength=te.prototype.getSequenceLength,te.prototype.setMuted=te.prototype.setMuted,te.prototype.resize=te.prototype.resize,te.prototype.isLinear=te.prototype.isLinear,te.prototype.isMuted=te.prototype.isMuted,te.prototype.setVolume=te.prototype.setVolume,te.prototype.getVolume=te.prototype.getVolume,te.prototype.play=te.prototype.play,te.prototype.pause=te.prototype.pause,te.prototype.skip=te.prototype.skip,te.prototype.canSkipNow=te.prototype.canSkipNow,te.prototype.getTimeUntilSkippable=te.prototype.getTimeUntilSkippable,te.prototype.isSkippable=te.prototype.isSkippable,te.prototype.isPaused=te.prototype.isPaused,te.prototype.getRemainingTime=te.prototype.getRemainingTime,te.prototype.getMinSuggestedDuration=te.prototype.getMinSuggestedDuration,te.prototype.getDuration=te.prototype.getDuration,te.prototype.isUsingAnotherMediaElement=te.prototype.isUsingAnotherMediaElement,te.prototype.hasCustomClick=te.prototype.hasCustomClick,te.prototype.isClientRendering=te.prototype.isClientRendering,te.prototype.needsSkipUI=te.prototype.needsSkipUI;function Xe(){}function wy(e,n){var i=[];e=m(De(e,"Ad"));for(var r=e.next();!r.done;r=e.next())if((r=it(r.value,"InLine"))&&(r=it(r,"Creatives"))){r=m(De(r,"Creative"));for(var o=r.next();!o.done;o=r.next()){o=o.value;var s=it(o,"Linear");if(s&&OE(i,n,s),o=it(o,"NonLinearAds")){o=De(o,"NonLinear"),o=m(o);for(var u=o.next();!u.done;u=o.next())e:{s=i;var a=n,l=u.value,c=it(l,"StaticResource");if(c)u=c.attributes.creativeType;else{if(c=it(l,"HTMLResource"),!c)break e;u="text/html"}if(c=ln(c)){u==="text/html"&&(c="data:text/html;charset=UTF-8,"+encodeURIComponent(c));var d=de(l,"width",Ut)||de(l,"expandedWidth",Ut),h=de(l,"height",Ut)||de(l,"expandedHeight",Ut);if(d||h){var p=null;(l=l.attributes.minSuggestedDuration)&&(p=no(l)),l=0,a!=null&&(l=a),s.push({id:null,groupId:null,startTime:l,endTime:null,uri:c,mimeType:u,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!1,resumeOffset:0,playoutLimit:p,once:!0,pre:a==null,post:a==1/0,timelineRange:!1,loop:!1,overlay:{viewport:{x:0,y:0},topLeft:{x:0,y:0},size:{x:d||0,y:h||0}},displayOnBackground:!1,currentVideo:null,background:null})}}}}}}return i}function OE(e,n,i){var r=0;n!=null&&(r=n);var o=null;if(i.attributes.skipoffset&&(o=no(i.attributes.skipoffset),isNaN(o)&&(o=null)),i=it(i,"MediaFiles")){var s=De(i,"MediaFile");for(i=s,s=s.filter(function(a){return a.attributes.delivery=="streaming"}),s.length&&(i=s),i=i.sort(function(a,l){return(parseInt(l.attributes.height,10)||0)-(parseInt(a.attributes.height,10)||0)}),i=m(i),s=i.next();!s.done;s=i.next())if(s=s.value,!s.attributes.apiFramework){var u=ln(s);if(u){e.push({id:null,groupId:null,startTime:r,endTime:null,uri:u,mimeType:s.attributes.type||null,isSkippable:o!=null,skipOffset:o,skipFor:null,canJump:!1,resumeOffset:0,playoutLimit:null,once:!0,pre:n==null,post:n==1/0,timelineRange:!1,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null});break}}}}W("shaka.ads.Utils",Xe),Xe.ADS_LOADED="ads-loaded",Xe.AD_STARTED="ad-started",Xe.AD_FIRST_QUARTILE="ad-first-quartile",Xe.AD_MIDPOINT="ad-midpoint",Xe.AD_THIRD_QUARTILE="ad-third-quartile",Xe.AD_COMPLETE="ad-complete",Xe.AD_STOPPED="ad-stopped",Xe.AD_SKIPPED="ad-skipped",Xe.AD_VOLUME_CHANGED="ad-volume-changed",Xe.AD_MUTED="ad-muted",Xe.AD_PAUSED="ad-paused",Xe.AD_RESUMED="ad-resumed",Xe.AD_SKIP_STATE_CHANGED="ad-skip-state-changed",Xe.CUEPOINTS_CHANGED="ad-cue-points-changed",Xe.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded",Xe.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded",Xe.AD_CLICKED="ad-clicked",Xe.AD_PROGRESS="ad-progress",Xe.AD_BUFFERING="ad-buffering",Xe.AD_IMPRESSION="ad-impression",Xe.AD_DURATION_CHANGED="ad-duration-changed",Xe.AD_CLOSED="ad-closed",Xe.AD_LOADED="ad-loaded",Xe.ALL_ADS_COMPLETED="all-ads-completed",Xe.AD_LINEAR_CHANGED="ad-linear-changed",Xe.AD_METADATA="ad-metadata",Xe.AD_RECOVERABLE_ERROR="ad-recoverable-error",Xe.AD_ERROR="ad-error",Xe.AD_BREAK_READY="ad-break-ready",Xe.AD_INTERACTION="ad-interaction",Xe.AD_CONTENT_PAUSE_REQUESTED="ad-content-pause-requested",Xe.AD_CONTENT_RESUME_REQUESTED="ad-content-resume-requested",Xe.AD_CONTENT_ATTACH_REQUESTED="ad-content-attach-requested";function Za(e,n,i,r,o){var s=this;this.u=e,this.i=n,this.F=!1,this.A=this.o=null,this.G=NaN,this.l=o,this.j=null,this.h=new Pe,google.ima.settings.setLocale(i),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(!0),this.C=new google.ima.AdDisplayContainer(this.u,this.i),this.C.initialize(),this.m=new google.ima.AdsLoader(this.C),this.m.getSettings().setPlayerType("shaka-player"),this.m.getSettings().setPlayerVersion("v4.14.14"),this.g=null,this.B=r||new google.ima.AdsRenderingSettings,this.h.D(this.m,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,function(u){bE(s,u)}),this.h.D(this.m,google.ima.AdErrorEvent.Type.AD_ERROR,function(u){Ey(s,u)}),this.h.D(this.i,"ended",function(){s.m.contentComplete()}),this.h.qa(this.i,"play",function(){s.F=!0})}Za.prototype.configure=function(e){this.o=e},Za.prototype.stop=function(){this.g&&this.g.stop(),this.u&&Yi(this.u)},Za.prototype.release=function(){this.stop(),this.A&&this.A.disconnect(),this.h&&this.h.release(),this.g&&this.g.destroy(),this.m.destroy(),this.C.destroy()};function Ey(e,n){n.getError(),n=new Map().set("originalEvent",n),e.l(new G("ad-error",n)),el(e,null),e.l(new G("ad-cue-points-changed",new Map().set("cuepoints",[])))}function bE(e,n){if(e.l(new G("ads-loaded",new Map().set("loadTime",Date.now()/1e3-e.G))),e.o.customPlayheadTracker){var i={currentTime:e.i.currentTime};e.g=n.getAdsManager(i,e.B),e.i.muted?e.g.setVolume(0):e.g.setVolume(e.i.volume),e.h.D(e.i,"timeupdate",function(){e.i.duration&&(i.currentTime=e.i.currentTime)}),e.h.D(e.i,"volumechange",function(){e.j&&(e.j.setVolume(e.i.volume),e.i.muted&&e.j.setMuted(!0))})}else e.g=n.getAdsManager(e.i,e.B);e.l(new G("ima-ad-manager-loaded",new Map().set("imaAdManager",e.g)));var r=e.g.getCuePoints();if(r.length){n=[],r=m(r);for(var o=r.next();!o.done;o=r.next())n.push({start:o.value,end:null});e.l(new G("ad-cue-points-changed",new Map().set("cuepoints",n)))}BE(e);try{e.g.init(e.i.offsetWidth,e.i.offsetHeight),e.h.D(e.i,"loadeddata",function(){e.g.resize(e.i.offsetWidth,e.i.offsetHeight)}),"ResizeObserver"in F?(e.A=new ResizeObserver(function(){e.g.resize(e.i.offsetWidth,e.i.offsetHeight)}),e.A.observe(e.i)):e.h.D(document,"fullscreenchange",function(){e.g.resize(e.i.offsetWidth,e.i.offsetHeight)}),e.F||e.o.skipPlayDetection?e.g.start():e.h.qa(e.i,"play",function(){e.F=!0,e.g.start()})}catch{el(e,null)}}function BE(e){function n(i,r){i=new Map().set("originalEvent",i),e.l(new G(r,i))}e.h.D(e.g,google.ima.AdErrorEvent.Type.AD_ERROR,function(i){Ey(e,i)}),e.h.D(e.g,google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,function(i){Ay(e,i)}),e.h.D(e.g,google.ima.AdEvent.Type.STARTED,function(i){Ay(e,i)}),e.h.D(e.g,google.ima.AdEvent.Type.FIRST_QUARTILE,function(i){n(i,"ad-first-quartile")}),e.h.D(e.g,google.ima.AdEvent.Type.MIDPOINT,function(i){n(i,"ad-midpoint")}),e.h.D(e.g,google.ima.AdEvent.Type.THIRD_QUARTILE,function(i){n(i,"ad-third-quartile")}),e.h.D(e.g,google.ima.AdEvent.Type.COMPLETE,function(i){n(i,"ad-complete")}),e.h.D(e.g,google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,function(i){el(e,i)}),e.h.D(e.g,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(i){el(e,i)}),e.h.D(e.g,google.ima.AdEvent.Type.SKIPPED,function(i){n(i,"ad-skipped")}),e.h.D(e.g,google.ima.AdEvent.Type.VOLUME_CHANGED,function(i){n(i,"ad-volume-changed")}),e.h.D(e.g,google.ima.AdEvent.Type.VOLUME_MUTED,function(i){n(i,"ad-muted")}),e.h.D(e.g,google.ima.AdEvent.Type.PAUSED,function(i){e.j&&(e.j.i=!0,n(i,"ad-paused"))}),e.h.D(e.g,google.ima.AdEvent.Type.RESUMED,function(i){e.j&&(e.j.i=!1,n(i,"ad-resumed"))}),e.h.D(e.g,google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,function(i){e.j&&n(i,"ad-skip-state-changed")}),e.h.D(e.g,google.ima.AdEvent.Type.CLICK,function(i){n(i,"ad-clicked")}),e.h.D(e.g,google.ima.AdEvent.Type.AD_PROGRESS,function(i){n(i,"ad-progress")}),e.h.D(e.g,google.ima.AdEvent.Type.AD_BUFFERING,function(i){n(i,"ad-buffering")}),e.h.D(e.g,google.ima.AdEvent.Type.IMPRESSION,function(i){n(i,"ad-impression")}),e.h.D(e.g,google.ima.AdEvent.Type.DURATION_CHANGE,function(i){n(i,"ad-duration-changed")}),e.h.D(e.g,google.ima.AdEvent.Type.USER_CLOSE,function(i){n(i,"ad-closed")}),e.h.D(e.g,google.ima.AdEvent.Type.LOADED,function(i){n(i,"ad-loaded")}),e.h.D(e.g,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(i){n(i,"all-ads-completed")}),e.h.D(e.g,google.ima.AdEvent.Type.LINEAR_CHANGED,function(i){n(i,"ad-linear-changed")}),e.h.D(e.g,google.ima.AdEvent.Type.AD_METADATA,function(i){n(i,"ad-metadata")}),e.h.D(e.g,google.ima.AdEvent.Type.LOG,function(i){n(i,"ad-recoverable-error")}),e.h.D(e.g,google.ima.AdEvent.Type.AD_BREAK_READY,function(i){n(i,"ad-break-ready")}),e.h.D(e.g,google.ima.AdEvent.Type.INTERACTION,function(i){n(i,"ad-interaction")})}function Ay(e,n){var i=n.getAd();i?(e.j=new te(i,e.g,e.i),n.type!=google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED||e.o.supportsMultipleMediaElements||e.l(new G("ad-content-pause-requested")),n=new Map().set("ad",e.j).set("sdkAdObject",i).set("originalEvent",n),e.l(new G("ad-started",n)),e.j.isLinear()&&(e.u.setAttribute("ad-active","true"),e.o.customPlayheadTracker||e.i.pause(),e.i.muted?(n=e.j,n.j=e.i.volume,n.h.setVolume(0)):e.j.setVolume(e.i.volume))):Ee("The IMA SDK fired a "+n.type+" event with no associated ad. Unable to play ad!")}function el(e,n){n&&n.type==google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED&&!e.o.supportsMultipleMediaElements&&e.l(new G("ad-content-resume-requested")),e.l(new G("ad-stopped",new Map().set("originalEvent",n))),e.j&&e.j.isLinear()&&(e.u.removeAttribute("ad-active"),e.o.customPlayheadTracker||e.i.ended||e.i.play())}function ne(e,n,i,r,o,s){this.g=e,this.i=n,this.j=(this.h=n.isSkippable)?n.skipOffset||0:n.skipOffset,this.l=n.skipFor,this.A=i,this.o=r,this.m=o,this.u=s,this.B=n.overlay}g=ne.prototype,g.needsSkipUI=function(){return!0},g.isClientRendering=function(){return!0},g.hasCustomClick=function(){return!1},g.isUsingAnotherMediaElement=function(){return this.u},g.getDuration=function(){var e=this.g.duration;return isNaN(e)?-1:e},g.getMinSuggestedDuration=function(){return this.getDuration()},g.getRemainingTime=function(){var e=this.g.duration;return isNaN(e)?-1:e-this.g.currentTime},g.isPaused=function(){return this.g.paused},g.isSkippable=function(){return this.h&&this.l!=null?this.getDuration()-this.getRemainingTime()=f&&(!o.C.has(h)&&My(h)&&o.C.set(h,o.j.preload(h.uri,null,h.mimeType||void 0)),ky(o,h)),v.s(4);break}if(!o.C.has(h)){v.s(7);break}return S(v,o.C.get(h),8);case 8:(y=v.h)&&y.destroy(),o.C.delete(h);case 7:Dy(o,h),T=JSON.stringify(h),o.W.has(T)&&o.W.delete(T),o.G.delete(h),uh(o),h.overlay||(u=!0);case 4:d=c.next(),v.s(3);break;case 5:u&&nl(o),K(v)}})})}g=Iy.prototype,g.configure=function(e){this.T=e,ah(this)};function FE(e){if(!e.fa&&e.G.size){if(e.I.D(e.g,"playing",e.Z),e.I.D(e.g,"timeupdate",e.Z),e.I.D(e.g,"ended",e.$),"requestVideoFrameCallback"in e.g&&!Sc()){var n=e.g,i=function(){e.O!=-1&&(e.$(),e.O!=-1&&(e.O=n.requestVideoFrameCallback(i)))};e.O=n.requestVideoFrameCallback(i)}else e.P.ua(.025);e.M&&e.M.ua(1),e.fa=!0}}function uh(e){e.fa&&!e.G.size&&(e.I.Ja(e.g,"playing",e.Z),e.I.Ja(e.g,"timeupdate",e.Z),e.I.Ja(e.g,"ended",e.$),e.O!=-1&&(e.g.cancelVideoFrameCallback(e.O),e.O=-1),e.P&&e.P.stop(),e.M&&e.M.stop(),e.fa=!1)}function ah(e){if(e.A&&e.T&&!e.J){var n=e.T.supportsMultipleMediaElements,i=e.g;i.webkitSupportsFullscreen&&i.webkitDisplayingFullscreen&&(n=!1),e.B==n&&(e.B=!n,e.B?(e.h=e.g,e.F&&(e.F.parentElement&&e.A.removeChild(e.F),e.F=null)):(e.F||(n=document.createElement(e.g.tagName),n.autoplay=!0,n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.width="100%",n.style.height="100%",n.style.display="none",n.setAttribute("playsinline",""),e.F=n),e.h=e.F))}}g.stop=function(){if(this.l&&this.l.Pa(),this.W.clear(),this.G.clear(),this.j.pf(),this.C.size){var e=Array.from(this.C.values());e=m(e);for(var n=e.next();!n.done;n=e.next())(n=n.value)&&n.then(function(i){i&&i.destroy()})}if(this.C.clear(),this.L.size)for(e=Array.from(this.L.keys()),e=m(e),n=e.next();!n.done;n=e.next())Dy(this,n.value);this.L.clear(),this.j.detach(),this.J=!1,this.u=this.o=null,this.B=!0,this.h=this.g,this.F=null,lh(this),uh(this),this.A&&Yi(this.A),this.m&&(this.m.stop(),this.m=null)},g.release=function(){this.stop(),this.I&&this.I.release(),this.l&&this.l.release(),this.P&&(this.P.stop(),this.P=null),this.M&&(this.M.stop(),this.M=null),this.j.destroy()},g.If=function(){return this.j};function VE(e,n){var i;P(function(r){if(r.g==1)return ch(e),S(r,XE(e,n),2);i=r.h,i.length?qs(e,i):Ee("Unsupported HLS interstitial",n),K(r)})}function HE(e,n){var i=it(n.eventNode,"OverlayEvent"),r=i.attributes.uri,o=i.attributes.mimeType,s=i.attributes.loop=="true",u=de(i,"z",Ut);if(r&&u!=0){var a={viewport:{x:1920,y:1080},topLeft:{x:0,y:0},size:{x:1920,y:1080}},l=it(i,"Viewport"),c=it(i,"TopLeft"),d=it(i,"Size");if(l&&c&&d){if(a=de(l,"x",Ut),a==null||(l=de(l,"y",Ut),l==null))return;var h=de(c,"x",Ut);if(h==null||(c=de(c,"y",Ut),c==null))return;var p=de(d,"x",Ut);if(p==null||(d=de(d,"y",Ut),d==null))return;a={viewport:{x:a,y:l},topLeft:{x:h,y:c},size:{x:p,y:d}}}d=it(i,"SqueezeCurrent"),i=null,d&&(d=de(d,"percentage",cs))&&(i={viewport:{x:1920,y:1080},topLeft:{x:0,y:0},size:{x:1920*d,y:1080*d}}),qs(e,[{id:n.id,groupId:null,startTime:n.startTime,endTime:n.endTime,uri:r,mimeType:o,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!0,resumeOffset:null,playoutLimit:null,once:!1,pre:!1,post:!1,timelineRange:!0,loop:s,overlay:a,displayOnBackground:u==-1,currentVideo:i,background:null}])}}g.addAdUrlInterstitial=function(e){var n=this,i,r,o,s,u,a,l,c,d;return P(function(h){switch(h.g){case 1:return i={type:12},S(h,dh(n,e,i),2);case 2:if(r=h.h,o=ls(r,"VAST,vmap:VMAP"),!o)throw new R(2,10,10007);if(s=[],o.tagName=="VAST"){s=wy(o,n.o),h.s(3);break}if(o.tagName!="vmap:VMAP"){h.s(3);break}for(var p=[],f=m(De(o,"vmap:AdBreak")),y=f.next();!y.done;y=f.next()){var T=y.value,v=T.attributes.timeOffset;v&&(y=null,v=="start"?y=0:v=="end"?y=1/0:y=no(v),(T=it(T,"vmap:AdSource"))&&(T=it(T,"vmap:AdTagURI"))&&(T=st(T))&&p.push({time:y,uri:T}))}u=m(p),a=u.next();case 5:if(a.done){h.s(3);break}return l=a.value,S(h,dh(n,l.uri,i),8);case 8:if(c=h.h,d=ls(c,"VAST"),!d)throw new R(2,10,10007);s.push.apply(s,X(wy(d,l.time))),a=u.next(),h.s(5);break;case 3:qs(n,s),K(h)}})};function qs(e,n){var i,r,o,s,u,a,l,c;P(function(d){switch(d.g){case 1:i=!1,r=m(n),o=r.next();case 2:if(o.done){d.s(4);break}if(s=o.value,!s.uri){Ee("Missing URL in interstitial",s),d.s(3);break}if(s.mimeType){d.s(5);break}return ue(d,6),u=e.j.xb(),S(d,Nr(s.uri,u,e.H.getConfiguration().streaming.retryParameters),8);case 8:s.mimeType=d.h,me(d,5);break;case 6:ae(d);case 5:if(a=s.id||JSON.stringify(s),e.W.has(a)){d.s(3);break}s.loop&&!s.overlay&&Ee("Loop is only supported in overlay interstitials",s),s.overlay||(i=!0),e.W.add(a),e.G.add(s),l=!1,s.pre&&e.o==null?l=!0:s.startTime!=0||s.canJump?e.o!=null&&(c=s.startTime-e.o,0=c&&(l=!0)):l=!0,l&&(!e.C.has(s)&&My(s)&&e.C.set(s,e.j.preload(s.uri,null,s.mimeType||void 0)),ky(e,s));case 3:o=r.next(),d.s(2);break;case 4:i&&nl(e),FE(e),K(d)}})}function Ys(e,n,i){n=n===void 0?!1:n,i=i===void 0?null:i;var r=0,o=null;if(e.G.size&&e.o!=null){var s=e.g.ended,u=Array.from(e.G).sort(function(d,h){return h.startTime-d.startTime}),a=u;for(a=n?u.filter(function(d){return d.pre}):s?u.filter(function(d){return d.post}):u.filter(function(d){return!d.pre&&!d.post}),u=m(a),a=u.next();!a.done;a=u.next()){a=a.value;var l=!1;if(n)l=a.pre;else if(s)l=a.post;else if(!a.pre&&!a.post){var c=e.o-Math.round(1e3*a.startTime)/1e3;0=c||!a.canJump)&&(l=!(i==null&&e.u&&!e.u.pre&&!e.u.post&&e.u.startTime>=a.startTime))}l&&(!e.u||a.startTime>=e.u.startTime)&&(r==(i||0)?o=a:o&&!a.canJump&&.001Math.abs(u.startTime-n.startTime)}).length),n.once&&(s++,e.G.delete(n),uh(e),n.overlay||nl(e)),n.mimeType&&(n.mimeType.startsWith("image/")||n.mimeType==="text/html")?n.overlay?GE(e,n,i,r,s):Ee("Unsupported interstitial",n):e.B&&n.overlay?Ee("Unsupported interstitial",n):KE(e,n,i,r,o,s)}function GE(e,n,i,r,o){function s(){e.m&&(e.m.stop(),e.m=null),e.A.removeChild(l),lh(e,n),e.i(new G("ad-stopped"));var p=Ys(e,n.pre,r-o);p?(e.l.Pa(),tl(e,p,i,++r,Date.now(),o)):e.J=!1}var u=n.overlay,a=n.mimeType=="text/html"?"iframe":"img",l=document.createElement(a);l.style.objectFit="contain",l.style.position="absolute",l.style.border="none",Cy(e,n),e.i(new G("ad-started",new Map().set("ad",new ie(n,i,r)))),a=="iframe"?l.src=n.uri:(l.src=n.uri,l.onerror=function(p){e.i(new G("ad-error",new Map().set("originalEvent",p))),s()});var c=u.viewport,d=u.topLeft;u=u.size,c.x==0&&c.y==0?(l.width=n.overlay.size.x,l.height=n.overlay.size.y,l.style.bottom="10%",l.style.left="0",l.style.right="0",l.style.width="100%",n.overlay.size.y||a!="iframe"||(l.style.height="auto")):(l.style.height=u.y/c.y*100+"%",l.style.left=d.x/c.x*100+"%",l.style.top=d.y/c.y*100+"%",l.style.width=u.x/c.x*100+"%"),e.A.appendChild(l);var h=Date.now();e.m&&e.m.stop(),e.m=new ve(function(){n.playoutLimit&&(Date.now()-h)/1e3>n.playoutLimit?(e.i(new G("ad-complete")),s()):n.endTime&&e.g.currentTime>n.endTime?(e.i(new G("ad-complete")),s()):e.g.currentTimen.endTime)&&(e.m&&e.m.stop(),e.i(new G("ad-skipped")),s())})}function KE(e,n,i,r,o,s){var u,a,l,c,d,h,p,f,y,T,v,x,w,A,I,k,C;P(function(E){switch(E.g){case 1:if(u=Date.now(),e.J=!0,!e.B||r!=1){E.s(2);break}return e.i(new G("ad-content-pause-requested",new Map().set("saveLivePosition",!0))),a=new Ne,l=function(M){return P(function(D){if(D.g==1)return M.state!="detach"?D.s(0):Sc()?S(D,new Promise(function(_){return new ve(_).da(.1)}),3):D.s(3);a.resolve(),e.l.Ja(e.H,"onstatechange",l),K(D)})},e.l.D(e.H,"onstatechange",l),S(E,a,2);case 2:return Cy(e,n),e.B||(e.h.style.display="",n.overlay?(e.h.loop=n.loop,c=n.overlay.viewport,d=n.overlay.topLeft,h=n.overlay.size,e.h.style.height=h.y/c.y*100+"%",e.h.style.left=d.x/c.x*100+"%",e.h.style.top=d.y/c.y*100+"%",e.h.style.width=h.x/c.x*100+"%"):(e.g.pause(),n.resumeOffset!=null&&n.resumeOffset!=0&&(e.g.currentTime+=n.resumeOffset),e.h.loop=!1,e.h.style.height="100%",e.h.style.left="0",e.h.style.top="0",e.h.style.width="100%")),p=!1,f=function(){if(!e.B&&!n.overlay&&n.resumeOffset==null)if(n.timelineRange&&n.endTime&&n.endTime!=1/0)e.g.currentTime!=n.endTime&&(e.g.currentTime=n.endTime);else{var M=Date.now();e.g.currentTime+=(M-o)/1e3,o=M}},y=function(M){var D,_;return P(function(j){if(j.g==1){if(f(),D=Ys(e,n.pre,r-s),M&&n.groupId)for(;D&&D.groupId==n.groupId;)r++,D=Ys(e,n.pre,r-s);return e.m&&(!n.groupId||D&&D.groupId!=n.groupId)&&(e.m.stop(),e.m=null),lh(e,n),D&&!D.overlay?j.s(2):(n.post&&(e.o=null,e.u=null),e.B?S(j,e.j.detach(),4):S(j,e.j.lc(),4))}j.g!=2&&(e.B&&(_=n.resumeOffset,_==null&&(_=n.timelineRange&&n.endTime&&n.endTime!=1/0?n.endTime-(e.o||0):(Date.now()-o)/1e3),e.i(new G("ad-content-resume-requested",new Map().set("offset",_)))),e.i(new G("ad-stopped")),e.l.Pa(),e.J=!1,e.B?nl(e):(e.h.style.display="none",f(),e.g.ended||e.g.play())),ah(e),D&&(e.i(new G("ad-stopped")),e.l.Pa(),tl(e,D,i,++r,o,s)),K(j)})},T=function(M){return P(function(D){return p?D.return():(p=!0,e.i(new G("ad-error",new Map().set("originalEvent",M))),S(D,y(!1),0))})},v=function(){return P(function(M){if(M.g==1)return p?M.return():(p=!0,S(M,y(!1),2));e.i(new G("ad-complete")),K(M)})},e.ea=function(){return P(function(M){return p?M.return():(p=!0,e.i(new G("ad-skipped")),S(M,y(!0),0))})},x=new ne(e.h,n,e.ea,i,r,!e.B),e.B||(x.setMuted(e.g.muted),x.setVolume(e.g.volume)),e.i(new G("ad-started",new Map().set("ad",x))),(w=x.canSkipNow())&&e.i(new G("ad-skip-state-changed")),e.l.qa(e.j,"error",T),e.l.D(e.h,"timeupdate",function(){if(e.h.duration){var M=x.canSkipNow();w!=M&&0=M.playRangeEnd?v():e.i(new G("ad-paused"))}),e.l.D(e.h,"volumechange",function(){e.h.muted?e.i(new G("ad-muted")):e.i(new G("ad-volume-changed"))}),ue(E,4),ch(e),n.startTime&&n.endTime&&n.endTime!=1/0&&n.startTime!=n.endTime&&(A=n.endTime-n.startTime,0n.endTime)&&e.ea()})),me(E,0);break;case 4:if(C=ae(E),!e.J)return E.return();T(C),K(E)}})}function Cy(e,n){if(n.displayOnBackground&&(e.g.style.zIndex="1"),n.currentVideo!=null){var i=n.currentVideo;e.g.style.transformOrigin="top left";var r=!0,o=[],s=i.topLeft.x/i.viewport.x*100;0=s&&(o.push("translateX("+s+"%)"),r=!1),s=i.topLeft.y/i.viewport.y*100,0=s&&(o.push("translateY("+s+"%)"),r=!1),s=i.size.x/i.viewport.x,1>s&&o.push("scaleX("+s+")"),i=i.size.y/i.viewport.y,1>s&&o.push("scaleY("+i+")"),o.length&&(e.g.style.transform=o.join(" ")),r&&(e.g.style.transition="transform 250ms")}e.A&&(e.A.style.pointerEvents="none",n.background&&(e.A.style.background=n.background)),e.F&&(e.F.style.background=n.overlay?"":"rgb(0, 0, 0)")}function lh(e,n){(!n||n.displayOnBackground)&&(e.g.style.zIndex=""),n&&n.currentVideo==null||(e.g.style.transformOrigin="",e.g.style.transition="",e.g.style.transform=""),e.A&&(e.A.style.pointerEvents="",!n||n.background)&&(e.A.style.background=""),e.F&&(e.F.style.background="")}function XE(e,n){var i,r,o,s,u,a,l,c,d,h,p,f,y,T,v,x,w,A,I,k,C,E,M,D,_,j,L,N,U,O,b,V,H,ce,Y,Me,Re,fe,se,Ie,pe,Te;return P(function(le){switch(le.g){case 1:if(i=[],!n||(r=n.values.find(function(ge){return ge.key=="X-ASSET-URI"}),o=n.values.find(function(ge){return ge.key=="X-ASSET-LIST"}),!r&&!o))return le.return(i);if(s=null,(u=n.values.find(function(ge){return ge.key=="ID"}))&&(s=u.data),a=s==null?Math.floor(10*n.startTime)/10:n.startTime,(l=n.endTime)&&n.endTime!=1/0&&typeof n.endTime=="number"&&(l=s==null?Math.floor(10*n.endTime)/10:n.endTime),c=n.values.find(function(ge){return ge.key=="X-RESTRICT"}),h=d=!0,c&&c.data&&(p=c.data,d=!p.includes("SKIP"),h=!p.includes("JUMP")),f=d?0:null,(y=n.values.find(function(ge){return ge.key=="X-ENABLE-SKIP-AFTER"}))&&(T=y.data,f=parseFloat(T),isNaN(f)&&(f=d?0:null)),v=null,(x=n.values.find(function(ge){return ge.key=="X-ENABLE-SKIP-FOR"}))&&(w=x.data,v=parseFloat(w),isNaN(f)&&(v=null)),A=null,(I=n.values.find(function(ge){return ge.key=="X-RESUME-OFFSET"}))&&(k=I.data,A=parseFloat(k),isNaN(A)&&(A=null)),C=null,(E=n.values.find(function(ge){return ge.key=="X-PLAYOUT-LIMIT"}))&&(M=E.data,C=parseFloat(M),isNaN(C)&&(C=null)),j=_=D=!1,(L=n.values.find(function(ge){return ge.key=="CUE"}))&&(N=L.data,D=N.includes("ONCE"),_=N.includes("PRE"),j=N.includes("POST")),U=!1,(O=n.values.find(function(ge){return ge.key=="X-TIMELINE-OCCUPIES"}))?(b=O.data,U=b.includes("RANGE")):!I&&e.H.U()&&(U=!_&&!j),r){if(V=r.data,!V)return le.return(i);i.push({id:s,groupId:null,startTime:a,endTime:l,uri:V,mimeType:null,isSkippable:d,skipOffset:f,skipFor:v,canJump:h,resumeOffset:A,playoutLimit:C,once:D,pre:_,post:j,timelineRange:U,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null}),le.s(2);break}if(!o){le.s(2);break}return H=o.data,H?(ue(le,4),ce={type:11},S(le,dh(e,H,ce),6)):le.return(i);case 6:for(Y=le.h,Me=We(Y),Re=JSON.parse(Me),(fe=Re["SKIP-CONTROL"])&&(se=fe["ENABLE-SKIP-AFTER"],typeof se=="number"&&(f=parseFloat(se),isNaN(se)&&(f=d?0:null)),Ie=fe["ENABLE-SKIP-FOR"],typeof Ie=="number"&&(v=parseFloat(Ie),isNaN(Ie)&&(v=null))),pe=0;per.startTimeInSeconds+r.durationInSeconds){r=a,i=s;break}}i&&r&&!e.M.includes(r.adId)&&(e.A=n,e.h.currentTime=i.startTimeInSeconds)}}function Ly(e){if(e.h.duration&&(e.g||e.j.length)){var n=e.h.currentTime,i=!1;if(e.g){i=!0;var r=e.C,o=r.startTimeInSeconds+.5*r.durationInSeconds,s=r.startTimeInSeconds+.75*r.durationInSeconds;n>=r.startTimeInSeconds+.25*r.durationInSeconds&&!e.u.includes("firstQuartile")?(e.u.push("firstQuartile"),bt(e,"firstQuartile")):n>=o&&!e.u.includes("midpoint")?(e.u.push("midpoint"),bt(e,"midpoint")):n>=s&&!e.u.includes("thirdQuartile")&&(e.u.push("thirdQuartile"),bt(e,"thirdQuartile")),r=e.g.getRemainingTime(),o=e.g.getDuration(),e.g.canSkipNow()&&0=r||r>o)&&jo(e)}if(!e.g||!e.g.isLinear()){e:for(r=m(e.j),o=r.next();!o.done&&(o=o.value,!(e.g&&e.g.isLinear()));o=r.next())for(s=0;sn){if(e.M.includes(u.adId)){if(e.h.ended)continue;e.h.currentTime=a;break e}jo(e),e.L=o,e.g=new ee(u,s+1,o.ads.length,!0,e.h),e.C=u,s===0&&bt(e,"breakStart"),Ny(e);break}}if(!e.g){for(r=m(e.j),o=r.next();!o.done&&(o=o.value,!e.g);o=r.next())for(s=0;sn&&(e.h.currentTime=e.A),e.A=null)}}}function jo(e){if(e.g){for(;e.B.lastChild;)e.B.removeChild(e.B.firstChild);e.I||e.M.push(e.C.adId);var n=e.g.m;n!==void 0&&n?bt(e,"skip"):bt(e,"complete"),n=m(e.m);for(var i=n.next();!i.done;i=n.next())i=i.value,e.o.Ja(i.target,i.type,i.listener);e.m=[],e.u=[],n=e.g.getPositionInSequence(),i=e.g.getSequenceLength(),n===i&&bt(e,"breakEnd"),e.g=null,e.C=null,e.L=null}}function Ny(e){var n=!1;e.h.paused?n=!0:(bt(e,"impression"),bt(e,"start")),e.m.push({target:e.h,type:"volumechange",listener:function(){e.h.muted&&bt(e,"mute")}}),e.m.push({target:e.h,type:"volumechange",listener:function(){e.h.muted||bt(e,"unmute")}}),e.m.push({target:e.h,type:"play",listener:function(){n?(bt(e,"impression"),bt(e,"start"),n=!1):bt(e,"resume")}}),e.m.push({target:e.h,type:"pause",listener:function(){bt(e,"pause")}});for(var i=m(e.m),r=i.next();!r.done;r=i.next())r=r.value,e.o.D(r.target,r.type,r.listener)}function bt(e,n){var i=e.C.trackingEvents.find(function(s){return s.eventType==n});if(i||(i=e.L.adBreakTrackingEvents.find(function(s){return s.eventType==n})),i){var r={type:10};i=m(i.beaconUrls);for(var o=i.next();!o.done;o=i.next())(o=o.value)&&o!=""&&(o=lt([o],Xn()),o.method="POST",e.J.request(7,o,r))}switch(n){case"impression":e.i(new G("ad-impression"));break;case"start":e.i(new G("ad-started",new Map().set("ad",e.g)));break;case"mute":e.i(new G("ad-muted"));break;case"unmute":e.i(new G("ad-volume-changed"));break;case"resume":e.i(new G("ad-resumed"));break;case"pause":e.i(new G("ad-paused"));break;case"firstQuartile":e.i(new G("ad-first-quartile"));break;case"midpoint":e.i(new G("ad-midpoint"));break;case"thirdQuartile":e.i(new G("ad-third-quartile"));break;case"complete":e.i(new G("ad-complete")),e.i(new G("ad-stopped"));break;case"skip":e.i(new G("ad-skipped")),e.i(new G("ad-stopped"));break;case"breakStart":e.B.setAttribute("ad-active","true");break;case"breakEnd":e.B.removeAttribute("ad-active");break;case"skipStateChanged":e.i(new G("ad-skip-state-changed"))}}function re(e,n){this.g=e,this.i=null,this.h=n}g=re.prototype,g.needsSkipUI=function(){return!0},g.isClientRendering=function(){return!1},g.hasCustomClick=function(){return!0},g.isUsingAnotherMediaElement=function(){return!1},g.getDuration=function(){return this.i?this.i.duration:-1},g.getMinSuggestedDuration=function(){return this.getDuration()},g.getRemainingTime=function(){return this.i?this.i.duration-this.i.currentTime:-1},g.isPaused=function(){return this.h.paused},g.isSkippable=function(){return this.g.isSkippable()},g.getTimeUntilSkippable=function(){var e=this.g.getSkipTimeOffset();return e=this.getRemainingTime()-e,Math.max(e,0)},g.canSkipNow=function(){return this.getTimeUntilSkippable()==0},g.skip=function(){this.h.currentTime+=this.getRemainingTime()},g.pause=function(){return this.h.pause()},g.play=function(){return this.h.play()},g.getVolume=function(){return this.h.volume},g.setVolume=function(e){this.h.volume=e},g.isMuted=function(){return this.h.muted},g.isLinear=function(){return!0},g.resize=function(){},g.setMuted=function(e){this.h.muted=e},g.getSequenceLength=function(){var e=this.g.getAdPodInfo();return e==null?1:e.getTotalAds()},g.getPositionInSequence=function(){var e=this.g.getAdPodInfo();return e==null?1:e.getAdPosition()},g.getTitle=function(){return this.g.getTitle()},g.getDescription=function(){return this.g.getDescription()},g.getVastMediaBitrate=function(){return 0},g.getVastMediaHeight=function(){return this.g.getVastMediaHeight()},g.getVastMediaWidth=function(){return this.g.getVastMediaWidth()},g.getAdId=function(){return this.g.getAdId()},g.getCreativeAdId=function(){return this.g.getCreativeAdId()},g.getAdvertiserName=function(){return this.g.getAdvertiserName()},g.getMediaUrl=function(){return null},g.getTimeOffset=function(){var e=this.g.getAdPodInfo();return e==null?0:e.getTimeOffset()},g.getPodIndex=function(){var e=this.g.getAdPodInfo();return e==null?0:e.getPodIndex()},g.release=function(){this.h=this.i=this.g=null},W("shaka.ads.ServerSideAd",re),re.prototype.release=re.prototype.release,re.prototype.getPodIndex=re.prototype.getPodIndex,re.prototype.getTimeOffset=re.prototype.getTimeOffset,re.prototype.getMediaUrl=re.prototype.getMediaUrl,re.prototype.getAdvertiserName=re.prototype.getAdvertiserName,re.prototype.getCreativeAdId=re.prototype.getCreativeAdId,re.prototype.getAdId=re.prototype.getAdId,re.prototype.getVastMediaWidth=re.prototype.getVastMediaWidth,re.prototype.getVastMediaHeight=re.prototype.getVastMediaHeight,re.prototype.getVastMediaBitrate=re.prototype.getVastMediaBitrate,re.prototype.getDescription=re.prototype.getDescription,re.prototype.getTitle=re.prototype.getTitle,re.prototype.getPositionInSequence=re.prototype.getPositionInSequence,re.prototype.getSequenceLength=re.prototype.getSequenceLength,re.prototype.setMuted=re.prototype.setMuted,re.prototype.resize=re.prototype.resize,re.prototype.isLinear=re.prototype.isLinear,re.prototype.isMuted=re.prototype.isMuted,re.prototype.setVolume=re.prototype.setVolume,re.prototype.getVolume=re.prototype.getVolume,re.prototype.play=re.prototype.play,re.prototype.pause=re.prototype.pause,re.prototype.skip=re.prototype.skip,re.prototype.canSkipNow=re.prototype.canSkipNow,re.prototype.getTimeUntilSkippable=re.prototype.getTimeUntilSkippable,re.prototype.isSkippable=re.prototype.isSkippable,re.prototype.isPaused=re.prototype.isPaused,re.prototype.getRemainingTime=re.prototype.getRemainingTime,re.prototype.getMinSuggestedDuration=re.prototype.getMinSuggestedDuration,re.prototype.getDuration=re.prototype.getDuration,re.prototype.isUsingAnotherMediaElement=re.prototype.isUsingAnotherMediaElement,re.prototype.hasCustomClick=re.prototype.hasCustomClick,re.prototype.isClientRendering=re.prototype.isClientRendering,re.prototype.needsSkipUI=re.prototype.needsSkipUI;function jy(e,n,i,r){var o=this;this.u=e,this.l=n,this.j=null,this.F=NaN,this.i=r,this.G=!1,this.A=this.m=this.o=null,this.B="",this.C=[],this.h=new Pe,e=new google.ima.dai.api.UiSettings,e.setLocale(i),this.g=new google.ima.dai.api.StreamManager(this.l,this.u,e),this.i(new G("ima-stream-manager-loaded",new Map().set("imaStreamManager",this.g))),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.LOADED,function(s){$E(o,s)}),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.ERROR,function(){o.B.length?o.j.resolve(o.B):o.j.reject("IMA Stream request returned an error and there was no backup asset uri provided."),o.j=null}),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED,function(){}),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.STARTED,function(s){s=s.getAd(),o.m=new re(s,o.l),o.A&&(o.m.i=o.A),o.i(new G("ad-started",new Map().set("ad",o.m))),o.u.setAttribute("ad-active","true")}),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED,function(){o.u.removeAttribute("ad-active");var s=o.l.currentTime;o.o&&o.o>s&&(o.l.currentTime=o.o,o.o=null)}),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.AD_PROGRESS,function(s){o.A=s.getStreamData().adProgressData,o.m&&(o.m.i=o.A)}),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.FIRST_QUARTILE,function(){o.i(new G("ad-first-quartile"))}),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.MIDPOINT,function(){o.i(new G("ad-midpoint"))}),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.THIRD_QUARTILE,function(){o.i(new G("ad-third-quartile"))}),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.COMPLETE,function(){o.i(new G("ad-complete")),o.i(new G("ad-stopped")),o.u.removeAttribute("ad-active"),o.m=null}),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.SKIPPED,function(){o.i(new G("ad-skipped")),o.i(new G("ad-stopped"))}),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.CUEPOINTS_CHANGED,function(s){var u=s.getStreamData();s=[],u=m(u.cuepoints);for(var a=u.next();!a.done;a=u.next())a=a.value,s.push({start:a.start,end:a.end});o.C=s,o.i(new G("ad-cue-points-changed",new Map().set("cuepoints",s)))})}g=jy.prototype,g.configure=function(){},g.stop=function(){this.B="",this.o=null,this.C=[]},g.release=function(){this.stop(),this.h&&this.h.release()},g.onCueMetadataChange=function(e){if(e.key&&e.data){var n={};n[e.key]=e.data,this.g.onTimedMetadata(n)}},g.getCuePoints=function(){return this.C};function $E(e,n){e.i(new G("ads-loaded",new Map().set("loadTime",Date.now()/1e3-e.F))),n=n.getStreamData().url,e.j.resolve(n),e.j=null,e.G||e.h.D(e.l,"seeked",function(){var i=e.l.currentTime;if(i!=0){e.g.streamTimeForContentTime(i);var r=e.g.previousCuePointForStreamTime(i);r&&!r.played&&(e.o=i,e.l.currentTime=r.start)}})}function q(){je.call(this),this.h=this.i=this.j=this.g=null,this.m=new xy,this.o=navigator.language,this.l=null}wt(q,je),g=q.prototype,g.setLocale=function(e){this.o=e},g.configure=function(e){this.l=e,this.g&&this.g.configure(this.l),this.j&&this.j.configure(this.l),this.h&&this.h.configure(this.l)},g.initInterstitial=function(e,n,i){var r=this;this.g&&this.g.release(),this.g=new Iy(e,n,i,function(o){return il(r,o)}),this.g.configure(this.l)},g.initClientSide=function(e,n,i){var r=this;if(!F.google||!google.ima||!google.ima.AdsLoader)throw new R(2,10,1e4);this.j&&this.j.release(),this.j=new Za(e,n,this.o,i,function(o){return il(r,o)}),this.j.configure(this.l)},g.release=function(){this.g&&(this.g.release(),this.g=null),this.j&&(this.j.release(),this.j=null),this.i&&(this.i.release(),this.i=null),this.h&&(this.h.release(),this.h=null),je.prototype.release.call(this)},g.onAssetUnload=function(){this.g&&this.g.stop(),this.j&&this.j.stop(),this.i&&this.i.stop(),this.h&&this.h.stop(),this.dispatchEvent(new G("ad-stopped")),this.dispatchEvent(new G("ad-content-attach-requested")),this.m=new xy},g.requestClientSideAds=function(e){if(!this.j)throw new R(1,10,10001);var n=this.j;n.g&&n.g.destroy(),n.m&&n.m.contentComplete(),n.G=Date.now()/1e3,n.m.requestAds(e)},g.updateClientSideAdsRenderingSettings=function(e){if(!this.j)throw new R(1,10,10001);var n=this.j;n.B=e,n.g&&n.g.updateAdsRenderingSettings(n.B)},g.initMediaTailor=function(e,n,i){var r=this;this.i&&this.i.release(),this.i=new $s(e,n,i,function(o){return il(r,o)})},g.requestMediaTailorStream=function(e,n,i){if(!this.i)throw new R(1,10,10005);var r=this.i;return i=i===void 0?"":i,r.l?e=Promise.reject(new R(1,10,10004)):(r.l=new Ne,WE(r,e,n),r.H=i||"",r.P=Date.now()/1e3,e=r.l),e},g.addMediaTailorTrackingUrl=function(e){if(!this.i)throw new R(1,10,10005);var n=this.i;n.G=e,n.i(new G("ads-loaded",new Map().set("loadTime",0)))},g.initServerSide=function(e,n){var i=this;if(!F.google||!google.ima||!google.ima.dai)throw new R(2,10,10002);this.h&&this.h.release(),this.h=new jy(e,n,this.o,function(r){return il(i,r)}),this.h.configure(this.l)},g.requestServerSideStream=function(e,n){if(n=n===void 0?"":n,!this.h)throw new R(1,10,10003);e.adTagParameters||(e.adTagParameters={});var i=e.adTagParameters;return(i.mpt||i.mpv)&&Ee('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overridden.'),e.adTagParameters.mpt="shaka-player",e.adTagParameters.mpv="v4.14.14",i=this.h,i.j?e=Promise.reject(new R(1,10,10004)):(e instanceof google.ima.dai.api.LiveStreamRequest&&(i.G=!0),i.j=new Ne,i.g.requestStream(e),i.B=n||"",i.F=Date.now()/1e3,e=i.j),e},g.replaceServerSideAdTagParameters=function(e){if(!this.h)throw new R(1,10,10003);(e.mpt||e.mpv)&&Ee('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overridden.'),e.mpt="Shaka Player",e.mpv="v4.14.14",this.h.g.replaceAdTagParameters(e)},g.getServerSideCuePoints=function(){return Ce("AdManager.getServerSideCuePoints","Please use getCuePoints function."),this.getCuePoints()},g.getCuePoints=function(){var e=[];return this.h&&(e=e.concat(this.h.getCuePoints())),this.i&&(e=e.concat(this.i.getCuePoints())),e},g.getStats=function(){var e=this.m;return{loadTimes:e.g,averageLoadTime:UE(e),started:e.h,overlayAds:e.j,playedCompletely:e.l,skipped:e.m,errors:e.i}},g.onManifestUpdated=function(e){this.i&&this.i.onManifestUpdated(e)},g.onDashTimedMetadata=function(e){this.h&&e.schemeIdUri=="urn:google:dai:2018"&&this.h.g.processMetadata(e.schemeIdUri,e.eventNode?e.eventNode.attributes.messageData:null,e.startTime)},g.onHlsTimedMetadata=function(e,n){this.h&&this.h.g.processMetadata("ID3",e.data,n)},g.onCueMetadataChange=function(e){this.h&&this.h.onCueMetadataChange(e)},g.onHLSInterstitialMetadata=function(e,n,i){this.l&&this.l.disableHLSInterstitial||(this.g||this.initInterstitial(null,e,n),this.g&&VE(this.g,i))},g.onDASHInterstitialMetadata=function(e,n,i){if(!this.l||!this.l.disableDASHInterstitial){var r=i.schemeIdUri;if(r=="urn:mpeg:dash:event:alternativeMPD:insert:2025"||r=="urn:mpeg:dash:event:alternativeMPD:replace:2025"){if(this.g||this.initInterstitial(null,e,n),this.g&&(e=this.g,n=i.schemeIdUri=="urn:mpeg:dash:event:alternativeMPD:replace:2025",r=i.schemeIdUri=="urn:mpeg:dash:event:alternativeMPD:insert:2025",n||r)){for(var o=i.startTime,s=i.endTime,u=null,a=0,l,c=m(i.eventNode.children),d=c.next();!d.done;d=c.next())if(d=d.value,d.tagName=="AlternativeMPD"){if(d=d.attributes.uri){l=d;break}}else if(d.tagName=="InsertPresentation"||d.tagName=="ReplacePresentation"){var h=d.attributes.url;if(h){l=h,(c=de(d,"maxDuration",Ut))&&(u=c/i.timescale),(c=de(d,"returnOffset",Ut))&&(a=c/i.timescale),n&&a&&(s=o+a);break}}l&&qs(e,[{id:i.id,groupId:null,startTime:o,endTime:s,uri:l,mimeType:null,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!0,resumeOffset:r?a:null,playoutLimit:u,once:!1,pre:!1,post:!1,timelineRange:n&&!r,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null}])}}else(r=="urn:mpeg:dash:event:2012"||r=="urn:scte:dash:scte214-events")&&i.eventNode&&it(i.eventNode,"OverlayEvent")&&(this.g||this.initInterstitial(null,e,n),this.g&&HE(this.g,i))}},g.addCustomInterstitial=function(e){if(!this.g)throw new R(1,10,10006);qs(this.g,[e])},g.addAdUrlInterstitial=function(e){if(!this.g)throw new R(1,10,10006);return this.g.addAdUrlInterstitial(e)},g.getInterstitialPlayer=function(){if(!this.g)throw new R(1,10,10006);return this.g.If()};function il(e,n){if(n&&n.type)switch(n.type){case"ads-loaded":e.m.g.push(n.loadTime);break;case"ad-started":e.m.h++;var i=n.ad;i&&!i.isLinear()&&e.m.j++;break;case"ad-complete":e.m.l++;break;case"ad-skipped":e.m.m++;break;case"ad-error":e.m.i++}e.dispatchEvent(n)}W("shaka.ads.AdManager",q),q.prototype.getInterstitialPlayer=q.prototype.getInterstitialPlayer,q.prototype.addAdUrlInterstitial=q.prototype.addAdUrlInterstitial,q.prototype.addCustomInterstitial=q.prototype.addCustomInterstitial,q.prototype.onDASHInterstitialMetadata=q.prototype.onDASHInterstitialMetadata,q.prototype.onHLSInterstitialMetadata=q.prototype.onHLSInterstitialMetadata,q.prototype.onCueMetadataChange=q.prototype.onCueMetadataChange,q.prototype.onHlsTimedMetadata=q.prototype.onHlsTimedMetadata,q.prototype.onDashTimedMetadata=q.prototype.onDashTimedMetadata,q.prototype.onManifestUpdated=q.prototype.onManifestUpdated,q.prototype.getStats=q.prototype.getStats,q.prototype.getCuePoints=q.prototype.getCuePoints,q.prototype.getServerSideCuePoints=q.prototype.getServerSideCuePoints,q.prototype.replaceServerSideAdTagParameters=q.prototype.replaceServerSideAdTagParameters,q.prototype.requestServerSideStream=q.prototype.requestServerSideStream,q.prototype.initServerSide=q.prototype.initServerSide,q.prototype.addMediaTailorTrackingUrl=q.prototype.addMediaTailorTrackingUrl,q.prototype.requestMediaTailorStream=q.prototype.requestMediaTailorStream,q.prototype.initMediaTailor=q.prototype.initMediaTailor,q.prototype.updateClientSideAdsRenderingSettings=q.prototype.updateClientSideAdsRenderingSettings,q.prototype.requestClientSideAds=q.prototype.requestClientSideAds,q.prototype.onAssetUnload=q.prototype.onAssetUnload,q.prototype.release=q.prototype.release,q.prototype.initClientSide=q.prototype.initClientSide,q.prototype.initInterstitial=q.prototype.initInterstitial,q.prototype.configure=q.prototype.configure,q.prototype.setLocale=q.prototype.setLocale,q.ADS_LOADED="ads-loaded",q.AD_STARTED="ad-started",q.AD_FIRST_QUARTILE="ad-first-quartile",q.AD_MIDPOINT="ad-midpoint",q.AD_THIRD_QUARTILE="ad-third-quartile",q.AD_COMPLETE="ad-complete",q.AD_STOPPED="ad-stopped",q.AD_SKIPPED="ad-skipped",q.AD_VOLUME_CHANGED="ad-volume-changed",q.AD_MUTED="ad-muted",q.AD_PAUSED="ad-paused",q.AD_RESUMED="ad-resumed",q.AD_SKIP_STATE_CHANGED="ad-skip-state-changed",q.CUEPOINTS_CHANGED="ad-cue-points-changed",q.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded",q.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded",q.AD_CLICKED="ad-clicked",q.AD_PROGRESS="ad-progress",q.AD_BUFFERING="ad-buffering",q.AD_IMPRESSION="ad-impression",q.AD_DURATION_CHANGED="ad-duration-changed",q.AD_CLOSED="ad-closed",q.AD_LOADED="ad-loaded",q.ALL_ADS_COMPLETED="all-ads-completed",q.AD_LINEAR_CHANGED="ad-linear-changed",q.AD_METADATA="ad-metadata",q.AD_RECOVERABLE_ERROR="ad-recoverable-error",q.AD_ERROR="ad-error",q.AD_BREAK_READY="ad-break-ready",q.AD_INTERACTION="ad-interaction",q.AD_CONTENT_PAUSE_REQUESTED="ad-content-pause-requested",q.AD_CONTENT_RESUME_REQUESTED="ad-content-resume-requested",q.AD_CONTENT_ATTACH_REQUESTED="ad-content-attach-requested",Ja=function(){return new q};function _y(e){return JSON.stringify(e,function(n,i){if(typeof i!="function"){if(i instanceof Event||i instanceof G){var r={};for(o in i)(n=i[o])&&typeof n=="object"?o=="detail"&&(r[o]=n):o in Event||(r[o]=n);return r}if(i instanceof Error){var o=new Set(["name","message","stack"]);for(r in i)o.add(r);for(r=m(Object.getOwnPropertyNames(i)),n=r.next();!n.done;n=r.next())o.add(n.value);for(r={},o=m(o),n=o.next();!n.done;n=o.next())n=n.value,r[n]=i[n];i={__type__:"Error",contents:r}}else if(i instanceof TimeRanges){for(o={__type__:"TimeRanges",length:i.length,start:[],end:[]},i=m(Ii(i)),r=i.next();!r.done;r=i.next())r=r.value,n=r.end,o.start.push(r.start),o.end.push(n);i=o}else i=ArrayBuffer.isView(i)&&i.BYTES_PER_ELEMENT===1?{__type__:"Uint8Array",entries:Array.from(i)}:typeof i=="number"?isNaN(i)?"NaN":isFinite(i)?i:0>i?"-Infinity":"Infinity":i;return i}})}function hh(e){return JSON.parse(e,function(n,i){if(i=="NaN")var r=NaN;else if(i=="-Infinity")r=-1/0;else if(i=="Infinity")r=1/0;else if(i&&typeof i=="object"&&i.__type__=="TimeRanges")r=QE(i);else if(i&&typeof i=="object"&&i.__type__=="Uint8Array")r=new Uint8Array(i.entries);else if(i&&typeof i=="object"&&i.__type__=="Error"){n=i.contents,i=Error(n.message);for(r in n)i[r]=n[r];r=i}else r=i;return r})}function QE(e){return{length:e.length,start:function(n){return e.start[n]},end:function(n){return e.end[n]}}}var Uy="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),JE="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),ph=["loop","playbackRate"],ZE=["pause","play"],fh=new Map().set("getAssetUri",2).set("getAudioLanguages",4).set("getAudioLanguagesAndRoles",4).set("getBufferFullness",1).set("getBufferedInfo",2).set("getExpiration",2).set("getKeyStatuses",2).set("getPlaybackRate",2).set("getTextLanguages",4).set("getTextLanguagesAndRoles",4).set("getImageTracks",2).set("getThumbnails",2).set("isAudioOnly",10).set("isBuffering",1).set("isInProgress",1).set("isLive",10).set("isTextTrackVisible",1).set("keySystem",10).set("seekRange",1).set("getLoadMode",10).set("getManifestType",10).set("isFullyLoaded",1).set("isEnded",1),gh=new Map().set("getConfiguration",4).set("getConfigurationForLowLatency",4).set("getStats",5).set("getAudioTracks",2).set("getTextTracks",2).set("getVariantTracks",2),Oy=new Map().set("getPlayheadTimeAsDate",1).set("getPresentationStartTimeAsDate",20).set("getSegmentAvailabilityDuration",20),by=[["getConfiguration","configure","getConfigurationForLowLatency","configurationForLowLatency"]],By=[["isTextTrackVisible","setTextTrackVisibility"]],eA="addChaptersTrack addTextTrackAsync addThumbnailsTrack cancelTrickPlay configure configurationForLowLatency getChapters getChaptersTracks resetConfiguration retryStreaming selectAudioLanguage selectAudioTrack selectTextLanguage selectTextTrack selectVariantTrack selectVariantsByLabel setTextTrackVisibility trickPlay updateStartTime goToLive".split(" "),tA=["attach","attachCanvas","detach","load","unload"];function mh(e,n,i,r,o,s,u){var a=this;this.G=e,this.J=u,this.l=new ve(n),this.L=i,this.u=!1,this.A=r,this.F=o,this.M=s,this.i=this.m=!1,this.I="",this.o=null,this.B=function(){return yh(a)},this.C=function(l,c){switch(l=hh(c),l.type){case"event":var d=l.targetName,h=rg(l.event);a.A(d,h);break;case"update":d=l.update;for(h in d){l=a.g[h]||{};for(var p in d[h])l[p]=d[h][p]}a.u&&(a.L(),a.u=!1);break;case"asyncComplete":if(p=l.id,h=l.error,c=l.res,l=a.h.get(p),a.h.delete(p),l)if(h){p=new R(h.severity,h.category,h.code);for(d in h)p[d]=h[d];l.reject(p)}else l.resolve(c)}},this.g={video:{},player:{}},this.H=0,this.h=new Map,this.j=null,Js.add(this)}g=mh.prototype,g.destroy=function(){return Js.delete(this),vh(this),On&&Vy(this),this.l&&(this.l.stop(),this.l=null),this.F=this.A=null,this.i=this.m=!1,this.C=this.B=this.j=this.h=this.g=this.o=null,Promise.resolve()},g.ob=function(){return this.i},g.ag=function(){return this.I},g.init=function(){if(this.G.length)if(F.chrome&&chrome.cast&&chrome.cast.isAvailable){this.m=!0,this.l.qb();var e=new chrome.cast.SessionRequest(this.G,[],null,this.J,null);e=new chrome.cast.ApiConfig(e,function(n){for(var i=m(Js),r=i.next();!r.done;r=i.next()){r=r.value;var o=n;r.j=new Ne,r.u=!0,rl(r,o)}},function(n){for(var i=m(Js),r=i.next();!r.done;r=i.next())r=r.value,ol=n=="available",r.l.qb()},"origin_scoped"),chrome.cast.initialize(e,function(){},function(){}),ol&&this.l.da(iA),(e=On)&&e.status!=chrome.cast.SessionStatus.STOPPED?(this.j=new Ne,this.u=!0,rl(this,e)):On=null}else F.__onGCastApiAvailable!==Hy&&(sl=F.__onGCastApiAvailable||null,F.__onGCastApiAvailable=Hy)},g.ig=function(e){this.o=e,this.i&&Qs(this,{type:"appData",appData:this.o})},g.cast=function(){var e=this;return P(function(n){if(!e.m)throw new R(1,8,8e3);if(!ol)throw new R(1,8,8001);if(e.i)throw new R(1,8,8002);return e.j=new Ne,chrome.cast.requestSession(function(i){return rl(e,i)},function(i){return Fy(e,i)}),S(n,e.j,0)})};function nA(e){e.i&&chrome.cast.requestSession(function(n){return rl(e,n)},function(n){return Fy(e,n)})}g.Oc=function(){if(this.i){if(vh(this),On){Vy(this);try{On.stop(function(){},function(){})}catch{}On=null}yh(this)}},g.get=function(e,n){var i=this;if(e=="video"){if(ZE.includes(n))return function(){return i.nh.apply(i,[e,n].concat(X(Et.apply(0,arguments))))}}else if(e=="player"){if(Oy.has(n)&&!this.get("player","isLive")())return function(){};if(eA.includes(n))return function(){return i.nh.apply(i,[e,n].concat(X(Et.apply(0,arguments))))};if(tA.includes(n))return function(){return i.pj.apply(i,[e,n].concat(X(Et.apply(0,arguments))))};if(fh.has(n)||gh.has(n))return function(){return i.g[e][n]}}return this.g[e][n]},g.set=function(e,n,i){this.g[e][n]=i,Qs(this,{type:"set",targetName:e,property:n,value:i})};function rl(e,n){var i=e.M();On=n,n.addUpdateListener(e.B),n.addMessageListener("urn:x-cast:com.google.shaka.v2",e.C),yh(e),Qs(e,{type:"init",initState:i,appData:e.o}),e.j.resolve()}function Fy(e,n){var i=8003;switch(n.code){case"cancel":i=8004;break;case"timeout":i=8005;break;case"receiver_unavailable":i=8006}e.j.reject(new R(2,8,i,n))}g.nh=function(e,n){Qs(this,{type:"call",targetName:e,methodName:n,args:Et.apply(2,arguments)})},g.pj=function(e,n){var i=Et.apply(2,arguments),r=new Ne,o=this.H.toString();this.H++,this.h.set(o,r);try{Qs(this,{type:"asyncCall",targetName:e,methodName:n,args:i,id:o})}catch(s){r.reject(s)}return r};function Vy(e){var n=On;n.removeUpdateListener(e.B),n.removeMessageListener("urn:x-cast:com.google.shaka.v2",e.C)}function yh(e){var n=On?On.status=="connected":!1;if(e.i&&!n){e.F();for(var i in e.g)e.g[i]={};vh(e)}e.i=n,e.I=n?On.receiver.friendlyName:"",e.l.qb()}function vh(e){if(e.h)for(var n=m(e.h.keys()),i=n.next();!i.done;i=n.next()){i=i.value;var r=e.h.get(i);e.h.delete(i),r.reject(new R(1,7,7e3))}}function Qs(e,n){n=_y(n);var i=On;try{i.sendMessage("urn:x-cast:com.google.shaka.v2",n,function(){},tS)}catch(r){throw n=new R(2,8,8005,r),i=new G("error",new Map().set("detail",n)),e.A("player",i),e.Oc(),n}}var iA=.02,ol=!1,On=null,sl=null,Js=new Set;function Hy(e){if(sl?F.__onGCastApiAvailable=sl:delete F.__onGCastApiAvailable,sl=null,e)for(var n=m(Js),i=n.next();!i.done;i=n.next())i.value.init();typeof F.__onGCastApiAvailable=="function"&&F.__onGCastApiAvailable(e)}function ut(e,n,i,r){r=r===void 0?!1:r,je.call(this);var o=this;this.i=e,this.h=n,this.m=this.o=this.l=this.u=this.j=null,this.C=i,this.B=r,this.A=new Map,this.g=null,F.chrome?(this.g=new mh(i,function(){return Xy(o)},function(){return Wy(o)},function(s,u){return qy(o,s,u)},function(){return zy(o)},function(){return Ky(o)},r),rA(this)):(this.j=this.i,this.u=this.h)}wt(ut,je),g=ut.prototype,g.destroy=function(e){return this.g&&e&&this.g.Oc(),this.m&&(this.m.release(),this.m=null),e=[],this.h&&(e.push(this.h.destroy()),this.h=null),this.g&&(e.push(this.g.destroy()),this.g=null),this.u=this.j=this.i=null,je.prototype.release.call(this),Promise.all(e)},g.Li=function(){return this.j},g.If=function(){return this.u},g.Wh=function(){return this.g?this.g.m&&ol:!1},g.ob=function(){return this.g?this.g.ob():!1},g.ag=function(){return this.g?this.g.ag():""},g.cast=function(){var e=this;return P(function(n){return n.g==1?e.g?S(n,e.g.cast(),2):n.return():e.h?S(n,e.h.lc(),0):n.return()})},g.ig=function(e){this.g&&this.g.ig(e)},g.Ej=function(){this.g&&nA(this.g)},g.Oc=function(){this.g&&this.g.Oc()},g.Xh=function(e,n){n=n===void 0?!1:n;var i=this;return P(function(r){if(r.g==1)return e==i.C&&n==i.B||(i.C=e,i.B=n,!i.g)?r.return():(i.g.Oc(),S(r,i.g.destroy(),2));i.g=null,i.g=new mh(e,function(){return Xy(i)},function(){return Wy(i)},function(o,s){return qy(i,o,s)},function(){return zy(i)},function(){return Ky(i)},n),i.g.init(),K(r)})};function rA(e){e.g.init(),e.m=new Pe;for(var n=m(Uy),i=n.next();!i.done;i=n.next())e.m.D(e.i,i.value,function(s){e.g.ob()||(s=rg(s),e.l.dispatchEvent(s))});for(var r in Zu)e.m.D(e.h,Zu[r],function(s){e.g.ob()||e.o.dispatchEvent(s)});e.j={},n={};for(var o in e.i)n={ud:n.ud},n.ud=o,Object.defineProperty(e.j,n.ud,{configurable:!1,enumerable:!0,get:function(s){return function(){return sA(e,s.ud)}}(n),set:function(s){return function(u){var a=s.ud;e.g.ob()?e.g.set("video",a,u):e.i[a]=u}}(n)});e.u={},Gy(e,function(s){Object.defineProperty(e.u,s,{configurable:!1,enumerable:!0,get:function(){return uA(e,s)}})}),oA(e),e.l=new je,e.l.Re=e.j,e.o=new je,e.o.Re=e.u}function oA(e){var n=new Map;Gy(e,function(i,r){n.has(r)?(r=n.get(r),i.length=o)return null;for(var s=-1,u=-1,a=0;ai||127i||0>n))if(n>=i)for(--r;0<=r;r--)e.i[n+r]=e.i[i+r].map(function(s){return s});else for(var o=0;on;n++)e.i.push(Ch())}function Ch(){for(var e=[],n=0;42>n;n++)e.push(null);return e}function Ji(e,n){av(e)&&(e.i[e.h][e.g]=new tv(n,e.C,e.A,e.u,e.B),e.g++)}function av(e){var n=e.gi;i++,n++)e.i[n]=e.i[i];for(i=0;1>i;i++,n++)e.i[n]=Ch()}function _r(e,n,i){var r=new He(e.j,n,"");r.textAlign=e.F===0?"left":e.F===1?"right":ni;var o=r.region;switch(e.I&&(o.id+="svc"+e.I),o.id+="win"+e.M,o.height=e.o,o.width=e.m,o.heightUnits=2,o.widthUnits=2,o.viewportAnchorX=e.H,o.viewportAnchorY=e.L,o.viewportAnchorUnits=e.J?Qt:2,e.G){case 0:o.regionAnchorX=0,o.regionAnchorY=0;break;case 1:o.regionAnchorX=50,o.regionAnchorY=0;break;case 2:o.regionAnchorX=100,o.regionAnchorY=0;break;case 3:o.regionAnchorX=0,o.regionAnchorY=50;break;case 4:o.regionAnchorX=50,o.regionAnchorY=50;break;case 5:o.regionAnchorX=100,o.regionAnchorY=50;break;case 6:o.regionAnchorX=0,o.regionAnchorY=100;break;case 7:o.regionAnchorX=50,o.regionAnchorY=100;break;case 8:o.regionAnchorX=100,o.regionAnchorY=100}return(i=Zy(r,"svc"+i,e.i,e.j,n))&&(e.j=n),i}Ah.prototype.display=function(){this.l=!0};function EA(){this.i=[],this.h=null,this.g=0}function AA(e,n){n.type===3?(e.g=2*(n.value&63)-1,e.h=[]):e.h&&(0this.h.length)throw new R(2,2,3e3);this.g+=e},eu.prototype.ph=function(e){if(0>this.g-e)throw new R(2,2,3e3);this.g-=e};function IA(e){this.i=e,this.h=[null,null,null,null,null,null,null,null],this.g=null}function CA(e,n,i,r){if(!e.g)return[];if(i==24)return i=ct(n).value,r=ct(n).value,i=function(s){return s.map(function(u){return("0"+(u&255).toString(16)).slice(-2)}).join("")}([i,r]),Ji(e.g,String.fromCharCode(parseInt(i,16))),[];n=e.g;var o=null;switch(i){case 8:!av(n)||0>=n.g&&0>=n.h||(0>=n.g?(n.g=n.m-1,n.h--):n.g--,n.i[n.h][n.g]=null);break;case 13:n.isVisible()&&(o=_r(n,r,e.i)),n.h+1>=n.o?wA(n):n.h++,n.g=0;break;case 14:n.isVisible()&&(o=_r(n,r,e.i)),n.i[n.h]=Ch(),n.g=0;break;case 12:n.isVisible()&&(o=_r(n,r,e.i)),Ih(n),n.h=0,n.g=0}return o?[o]:[]}function MA(e,n,i,r){if(128<=i&&135>=i)r=i&7,e.h[r]&&(e.g=e.h[r]);else{if(i===136){i=ct(n).value,n=[],i=m(tu(e,i));for(var o=i.next();!o.done;o=i.next()){if(o=e.h[o.value],o.isVisible()){var s=_r(o,r,e.i);s&&n.push(s)}Ih(o)}return n}if(i===137)for(n=ct(n).value,n=m(tu(e,n)),i=n.next();!i.done;i=n.next())i=e.h[i.value],i.isVisible()||(i.j=r),i.display();else{if(i===138){for(i=ct(n).value,n=null,i=m(tu(e,i)),o=i.next();!o.done;o=i.next())o=e.h[o.value],o.isVisible()&&(n=_r(o,r,e.i)),o.l=!1;return n?[n]:[]}if(i===139){for(i=ct(n).value,n=null,i=m(tu(e,i)),o=i.next();!o.done;o=i.next())o=e.h[o.value],o.isVisible()?n=_r(o,r,e.i):o.j=r,o.l=!o.l;return n?[n]:[]}if(i===140)return n=ct(n).value,lv(e,n,r);if(i===143)return r=lv(e,255,r),cv(e),r;if(i===144)n.skip(1),r=ct(n).value,e.g&&(e.g.A=0<(r&128),e.g.C=0<(r&64));else if(i===145)r=ct(n).value,i=ct(n).value,n.skip(1),e.g&&(n=dv((i&48)>>4,(i&12)>>2,i&3),e.g.B=dv((r&48)>>4,(r&12)>>2,r&3),e.g.u=n);else if(i===146)r=ct(n).value,n=ct(n).value,e.g&&(e=e.g,e.h=r&15,e.g=n&63);else if(i===151)n.skip(1),n.skip(1),r=ct(n).value,n.skip(1),e.g&&(e.g.F=r&3);else if(152<=i&&159>=i){i=(i&15)-8,o=e.h[i]!==null,o||(s=new Ah(i,e.i),s.j=r,e.h[i]=s),r=ct(n).value,s=ct(n).value;var u=ct(n).value,a=ct(n).value,l=ct(n).value;n=ct(n).value,o&&(n&7)===0||(n=e.h[i],n.h=0,n.g=0,n.C=!1,n.A=!1,n.B="white",n.u="black"),n=e.h[i],n.l=0<(r&32),n.L=s&127,n.H=u,n.G=(a&240)>>4,n.J=0<(s&128),n.o=(a&15)+1,n.m=(l&63)+1,e.g=e.h[i]}}}return[]}function tu(e,n){for(var i=[],r=0;8>r;r++)(n&1)===1&&e.h[r]&&i.push(r),n>>=1;return i}function lv(e,n,i){var r=[];n=m(tu(e,n));for(var o=n.next();!o.done;o=n.next()){o=o.value;var s=e.h[o];s.isVisible()&&(s=_r(s,i,e.i))&&r.push(s),e.h[o]=null}return r}function cv(e){e.g=null,e.h=[null,null,null,null,null,null,null,null]}function dv(e,n,i){var r={0:0,1:0,2:1,3:1};return e=r[e],n=r[n],i=r[i],kA[e<<2|n<<1|i]}var hv=new Map([[32," "],[33,"\xA0"],[37,"\u2026"],[42,"\u0160"],[44,"\u0152"],[48,"\u2588"],[49,"\u2018"],[50,"\u2019"],[51,"\u201C"],[52,"\u201D"],[53,"\u2022"],[57,"\u2122"],[58,"\u0161"],[60,"\u0153"],[61,"\u2120"],[63,"\u0178"],[118,"\u215B"],[119,"\u215C"],[120,"\u215D"],[121,"\u215E"],[122,"\u2502"],[123,"\u2510"],[124,"\u2514"],[125,"\u2500"],[126,"\u2518"],[127,"\u250C"]]),kA="black blue green cyan red magenta yellow white".split(" ");function Oo(){this.h=[],this.g=[],this.i=new EA,this.l=0,this.m=new Map([["CC1",new al(0,0)],["CC2",new al(0,1)],["CC3",new al(1,0)],["CC4",new al(1,1)]]),this.u=this.o=0,this.j=new Map,this.B=!0,this.A=new Set,Mh(this)}Oo.prototype.clear=function(){this.l=0,this.h=[],this.g=[];var e=this.i;e.i=[],e.h=[],e.g=0,Mh(this),e=m(this.j.values());for(var n=e.next();!n.done;n=e.next())cv(n.value)};function Mh(e){e.o=0,e.u=0;for(var n=m(e.m.values()),i=n.next();!i.done;i=n.next())i=i.value,i.h=0,i.g=i.j,i.m=null,Zs(i.i),Zs(i.j),Zs(i.o);e.B=!0}Oo.prototype.extract=function(e,n){if(this.B){for(var i=m(this.m.values()),r=i.next();!r.done;r=i.next())r.value.l=n;this.B=!1}if(e=new Ge(e,0),!(8>e.getLength())&&e.X()===181&&e.ma()===49&&e.S()===1195456820&&e.X()===3&&(i=e.X(),(i&64)!==0))for(i&=31,e.skip(1),r=0;r>2,u=e.X(),a=e.X();s&&(o&=3,o===0||o===1?this.h.push({pts:n,type:o,kb:u,Kb:a,order:this.h.length}):(this.g.push({pts:n,type:o,value:u,order:this.g.length}),this.g.push({pts:n,type:2,value:a,order:this.g.length})))}},Oo.prototype.decode=function(){function e(o,s){return o.pts-s.pts||o.order-s.order}var n=[];this.h.sort(e),this.g.sort(e);for(var i=m(this.h),r=i.next();!r.done;r=i.next())(r=DA(this,r.value))&&n.push(r);for(i=m(this.g),r=i.next();!r.done;r=i.next())AA(this.i,r.value);for(i=m(this.i.i),r=i.next();!r.done;r=i.next())r=RA(this,r.value),n.push.apply(n,X(r));return this.i.i=[],this.h=[],this.g=[],n};function DA(e,n){var i=n.type;if((n.kb&112)===16){var r=n.kb>>3&1;i===0?e.o=r:e.u=r}if(r="CC"+((i<<1|(i?e.u:e.o))+1),i=e.m.get(r),n.kb===255&&n.Kb===255||!n.kb&&!n.Kb||!pv(n.kb)||!pv(n.Kb))return 45<=++e.l&&Mh(e),null;e.l=0,n.kb&=127,n.Kb&=127;var o=n.kb;if(1<=o&&15>=o||!n.kb&&!n.Kb)return null;if(o=null,(n.kb&112)===16)e:{if(e.A.add(r),r=n.kb,e=n.Kb,i.m===(r<<8|e))i.m=null;else if(i.m=r<<8|e,(r&240)===16&&(e&192)===64){n=[11,11,1,2,3,4,12,13,14,15,5,6,7,8,9,10][(r&7)<<1|e>>5&1],r="white",o=!1;var s=null,u=95=u?r=uv[Math.floor(u/2)]:15>=u?o=!0:s=Math.floor((u-16)/2),e=(e&1)===1,i.h!==4&&(u=i.g,i.h===3&&n!==u.g&&(i=1+n-u.h,nv(u,i,1+u.g-u.h,u.h),Ni(u,0,i-1),Ni(u,n+1,15-n)),u.g=n,u.m=e,u.j=o,u.l=r,u.u=s,u.o="black")}else if((r&247)===17&&(e&240)===32)i.g.m=!1,i.g.j=!1,i.g.l="white",Uo(i.g,0,32),r=!1,n=uv[(e&14)>>1],n==="white_italics"&&(n="white",r=!0),i.g.m=(e&1)===1,i.g.j=r,i.g.l=n;else if((r&247)===16&&(e&240)===32||(r&247)===23&&(e&255)===45)n="black",(r&7)===0&&(n=xA[(e&14)>>1]),i.g.o=n;else if((r&247)===17&&(e&240)===48)Uo(i.g,1,e);else if((r&246)===18&&(e&224)===32)Uo(i.g,r&1?3:2,e);else{if((r&246)===20&&(e&240)===32){switch(e=n.pts,r=null,n.Kb){case 32:ov(i);break;case 33:i=i.g,i.i[i.g].pop();break;case 37:r=Eh(i,2,e);break;case 38:r=Eh(i,3,e);break;case 39:r=Eh(i,4,e);break;case 40:Uo(i.g,0,32);break;case 41:i.h=2,i.g=i.i,i.g.h=0,i.l=e;break;case 42:Zs(i.o),sv(i);break;case 43:sv(i);break;case 44:n=i.i,r=null,i.h!==4&&(r=ul(n,i.l,e)),Ni(n,0,15);break;case 45:n=i.g,i.h!==3?r=null:(r=ul(n,i.l,e),o=n.g-n.h+1,nv(n,o-1,o,n.h),Ni(n,0,o-1),Ni(n,n.g,15-n.g),i.l=e);break;case 46:Ni(i.j,0,15);break;case 47:n=null,i.h!==4&&(n=ul(i.i,i.l,e)),r=i.j,i.j=i.i,i.i=r,ov(i),i.l=e,r=n}o=r;break e}(r==23||r==31)&&33<=e&&35>=e&&(i.g.A=e-32)}o=null}else e=n.Kb,Uo(i.g,0,n.kb),Uo(i.g,0,e);return o}function RA(e,n){var i=[];try{for(;n.ta();){var r=ct(n).value,o=(r&224)>>5,s=r&31;if(o===7&&s!=0&&(o=ct(n).value&63),o!=0){e.A.add("svc"+o),e.j.has(o)||e.j.set(o,new IA(o));for(var u=e.j.get(o),a=n.Ba();n.Ba()-a=d)var f=CA(o,l,d,h);else if(128<=d&&159>=d)f=MA(o,l,d,h);else{if(4096<=d&&4127>=d)o=l,l=d&255,8<=l&&15>=l?o.skip(1):16<=l&&23>=l?o.skip(2):24<=l&&31>=l&&o.skip(3);else if(4224<=d&&4255>=d)o=l,l=d&255,128<=l&&135>=l?o.skip(4):136<=l&&143>=l&&o.skip(5);else if(32<=d&&127>=d)l=d,o.g&&(l===127?Ji(o.g,"\u266A"):Ji(o.g,String.fromCharCode(l)));else if(160<=d&&255>=d)o.g&&Ji(o.g,String.fromCharCode(d));else if(4128<=d&&4223>=d){if(l=d&255,o.g)if(hv.has(l)){var y=hv.get(l);Ji(o.g,y)}else Ji(o.g,"_")}else 4256<=d&&4351>=d&&o.g&&((d&255)!=160?Ji(o.g,"_"):Ji(o.g,"[CC]"));f=[]}i.push.apply(i,X(f))}}}}catch(T){if(T instanceof R&&T.code===3e3)ur("CEA708_INVALID_DATA","Buffer read out of bounds / invalid CEA-708 Data.");else throw T}return i}function pv(e){for(var n=0;e;)n^=e&1,e>>=1;return n===1}Oo.prototype.getStreams=function(){return Array.from(this.A)},W("shaka.cea.CeaDecoder",Oo),Jr=function(){return new Oo};function fv(e){for(var n=[],i=e,r=e=0;r>1&63,f=f==39||f==40;break;case ru:a=2,n.skip(1),f=p>>1&63,f=f==23||f==24;break;default:return}if(f)for(p=0,ci.byteLength){i=[];break e}var s=oe(i,e,o);n.push({type:r,value:s}),e+=o}i=n}return i}function gv(e){return e=Tn(st(e)),e=LA(e).filter(function(n){return n.type===NA})[0],e?(e=Bi(e.value,!0),(e=mr(e,"WRMHEADER"))?e:null):null}function hl(e){try{var n=gv(e);if(n)e:{for(var i=m(Kn(n,"DATA")),r=i.next();!r.done;r=i.next()){var o=r.value;if(o.children)for(var s=m(o.children),u=s.next();!u.done;u=s.next()){var a=u.value;if(a.tagName=="LA_URL"){var l=st(a);break e}}}l=""}else l="";return l}catch{return""}}var NA=1;function mv(e,n,i){var r=UA(e),o=null;e=[];var s=[],u=null,a=new Set(r.map(function(c){return c.keyId}));a.delete(null);var l="cenc";if(1"+e+""),hl(e)}return""}function _A(e,n,i,r,o){var s=[];i=m(i);for(var u=i.next();!u.done;u=i.next()){u=u.value;var a=r[u.$c];if(a){var l;if((l=Nn(u.node,"urn:microsoft:playready","pro"))&&st(l)){l=st(l),l=Tn(l);var c=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);l=[{initData:ra(l,c,new Set,0),initDataType:"cenc",keyId:u.keyId}]}else l=null;if(c=null,u.$c==="urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e"){c=u;var d=o;if(d.size==0)c=null;else{var h=new Uint8Array([16,119,239,236,192,178,77,2,172,227,60,30,82,226,251,75]),p=new Uint8Array([]);c=[{initData:ra(p,h,d,1),initDataType:"cenc",keyId:c.keyId}]}}l=Fi(a,n,u.init||e||l||c),(a=BA.get(a))&&(l.licenseServerUri=a(u)),s.push(l)}}return s}function UA(e){var n=[];e=m(e);for(var i=e.next();!i.done;i=e.next())(i=OA(i.value))&&n.push(i);return n}function OA(e){var n=e.attributes.schemeIdUri,i=gi(e,"urn:mpeg:cenc:2013","default_KID"),r=Af(e,"urn:mpeg:cenc:2013","pssh").map(ln),o=e.attributes.value;if(!n)return null;if(n=n.toLowerCase(),i&&(i=i.replace(/-/g,"").toLowerCase(),i.includes(" ")))throw new R(2,4,4009);var s=[];try{s=r.map(function(u){return{initDataType:"cenc",initData:Tn(u),keyId:null}})}catch{throw new R(2,4,4007)}return{node:e,$c:n,keyId:i,init:0v)if(f){if(f=de(f,"t",Nt),f==null)break;if(y>=f)break;v=Math.ceil((f-y)/T)-1}else{if(e==1/0)break;if(y/s>=e)break;v=Math.ceil((e*s-y)/T)-1}for(0>>31;p&=2147483647;var y=u.reader.S();if(u.reader.skip(4),f==1)throw new R(2,3,3006);a.push(new J(c/l+i,(c+y)/l+i,function(){return s},e,e+p-1,n,i,r,o)),c+=y,e+=p}return u.parser.stop(),a}function Zi(e){this.h=Gt(e),this.g=new Ge(this.h,0)}Zi.prototype.ta=function(){return this.g.ta()};function ji(e){var n=Tv(e);if(7Number.MAX_SAFE_INTEGER&&(b=BigInt(N)*BigInt(O)),U+=p,N=U+T,O=Math.min(N,d());var V=[],H=n.dj;if(H)for(var ce=(O-U)/H,Y={},Me=0;Med()&&!U.length?null:U})}return Promise.resolve(_)}function n2(e,n){var i=e.K.fe;if(i||(i=bn(e,er,"initialization")),!i)return null;i=Kt(i);var r=e.K.originalId,o=e.bandwidth||null,s=e.K.Ra,u=e.sb;return n=new Wt(function(){var a=ou(i,r,null,null,o,null);return ft(s(),[a],u())},0,null,Av(e),null,null,n,e.ga.encrypted),n.codecs=e.K.codecs,n.mimeType=e.K.mimeType,e.ha&&(n.g=e.ha.start+e.ha.duration),n}function gl(e,n,i,r,o,s,u,a,l,c){Ae.call(this,[]),this.h=e,this.F=n,this.B=i,this.C=r,this.H=o,this.j=s,this.l=u,this.u=a,this.A=l,this.G=c,Rh(this)}wt(gl,Ae),g=gl.prototype,g.getNumReferences=function(){return this.h?this.h.timeline.length:0},g.release=function(){Ae.prototype.release.call(this),this.h=null},g.Oa=function(e){if(this.h){for(var n=0,i=this.h.timeline,r=0;r=n&&(this.g=this.g.slice(n)),this.i+=n,this.getNumReferences()===0&&this.release())}};function Mv(e,n,i,r,o){if(i2(e,o),e.h){if(i=e.h.timeline,e.h.fc!==n.fc&&(e.h.fc=n.fc),i.length){var s=i[i.length-1];n=n.timeline.filter(function(u){return u.end>s.end})}else n=n.timeline.slice();0=e.l||0>=r.end||n.push(r);e.h.timeline=n,e.Oa(e.j)}}g.find=function(e){if(this.h&&this.h.timeline&&this.h.timeline.length&&e=this.l)return null;for(var i=n.length-1,r=0;r=s&&ee||e>=this.getNumReferences()||!this.h)return null;var i=this.g[e];if(!i){var r=this.h.timeline[e],o=r.wj,s=r.xg+this.h.wg;i=this.j-this.h.ic;var u=this.j+r.end,a=u;e===this.getNumReferences()-1&&this.l!==1/0&&(a=Math.min(a,this.l));for(var l=this.h.codecs,c=this.h.mimeType,d=this.h.bandwidth,h=[],p=(r.end-r.start)/r.Hb,f={},y=0;ya&&e.j.delete(s);if(r=r.filter(function(l){for(var c=m(e.j.keys()),d=c.next();!d.done;d=c.next())if(d.value.includes(new $e(l.location).lb))return!1;return!0}),r.length&&(e.B=r[0].Yf),r=r.map(function(l){return l.location}),!r.length&&e.h)for(o=m(e.h.split(",")),u=o.next();!u.done;u=o.next())(u=n.get(u.value))&&(e.B=e.h,r.push(u));if(!r.length)for(n=m(n.values()),o=n.next();!o.done;o=n.next())r.push(o.value);return i?r:ft(e.i,r)}function _t(){this.l=[],this.h=[],this.g=[],this.j=[],this.i=[],this.u=this.o=!1,this.m=new Set}g=_t.prototype,g.release=function(){for(var e=m(this.h.concat(this.g,this.j,this.i)),n=e.next();!n.done;n=e.next())n=n.value,n.segmentIndex&&n.segmentIndex.release();this.h=[],this.g=[],this.j=[],this.i=[],this.l=[],this.u=this.o=!1,this.m.clear()},g.Ki=function(){return this.l},g.Jf=function(){return this.j.slice()},g.oi=function(){return this.i},g.Kg=function(e,n){if(e){if(e.type=="audio")for(var i=m(this.h),r=i.next();!r.done;r=i.next())r=r.value,r.matchedStreams=r.matchedStreams.filter(function(o){return o!==e});else if(e.type=="video")for(i=m(this.g),r=i.next();!r.done;r=i.next())r=r.value,r.matchedStreams=r.matchedStreams.filter(function(o){return o!==e}),r.trickModeVideo&&(r.trickModeVideo.matchedStreams=r.trickModeVideo.matchedStreams.filter(function(o){return o!==e})),r.dependencyStream&&(r.dependencyStream.matchedStreams=r.dependencyStream.matchedStreams.filter(function(o){return o!==e}));else if(e.type==ye)for(i=m(this.j),r=i.next();!r.done;r=i.next())r=r.value,r.matchedStreams=r.matchedStreams.filter(function(o){return o!==e});else if(e.type=="image")for(i=m(this.i),r=i.next();!r.done;r=i.next())r=r.value,r.matchedStreams=r.matchedStreams.filter(function(o){return o!==e});e.segmentIndex&&e.closeSegmentIndex(),this.m.delete(n)}};function Dv(e,n){var i=[],r=[],o=[],s=[];e=m(e);for(var u=e.next();!u.done;u=e.next()){var a=u.value;u=new Map(a.audioStreams.map(function(h){return[jh(h),h]}));var l=new Map(a.videoStreams.map(function(h){return[Nh(h),h]})),c=new Map(a.textStreams.map(function(h){return[cu(h),h]}));if(a=new Map(a.imageStreams.map(function(h){return[du(h),h]})),n){var d=_v(ye);c.set(cu(d),d),d=_v("image"),a.set(du(d),d)}i.push(u),r.push(l),o.push(c),s.push(a)}return{Dg:i,Lh:r,Hh:o,Xg:s}}g.gf=function(e,n,i){i=i===void 0?!1:i;var r=this,o,s,u,a,l,c,d,h,p,f,y,T,v,x,w,A,I,k,C,E,M,D,_,j,L,N,U,O,b,V,H,ce;return P(function(Y){if(Y.g==1){if(o=ot,!n&&e.length==1)return s=Dv(e,!1),u=s.Dg,a=s.Lh,l=s.Hh,c=s.Xg,r.h=Array.from(u[0].values()),r.g=Array.from(a[0].values()),r.j=Array.from(l[0].values()),r.i=Array.from(c[0].values()),Y.s(2);for(d=i?r.m.size:0,h=-1,p=0;p=r?a.push(new Set(i[l].values())):a.push(new Set);c=m(n),d=c.next();case 2:if(d.done){j.s(4);break}return h=d.value,S(j,s2(e,h,i,r,s,a,u),5);case 5:if(p=j.h,!p)throw new R(2,4,4037);d=c.next(),j.s(2);break;case 4:for(f=m(a),y=f.next();!y.done;y=f.next())for(T=y.value,v=m(T),x=v.next();!x.done;x=v.next())w=x.value,(A=u2(e,w,i,o,s,a))&&n.push(A);for(I=m(a),k=I.next();!k.done;k=I.next())for(C=k.value,E=m(C),M=E.next(),D={};!M.done;D={ng:void 0},M=E.next())if(D.ng=M.value,!Lh(D.ng)&&(_=n.some(function(L){return function(N){return Ph(e,L.ng,N)}}(D))))throw new R(2,4,4037);return j.return(n)}})}function s2(e,n,i,r,o,s,u){return P(function(a){return a.g==1?(Nv(e,i,n,0r))return!0;if(or.length)return!0;if(o.lengthr)return!0;if(or.length)return!0;if(o.lengthe){if(i<=e||i-en-e)return _i}else{if(i>e)return _i;if(e-ie-n)return _i}return Ov}function Uv(e,n,i){return n=Math.abs(e-n),e=Math.abs(e-i),ev&&T>y&&e.L++,T==null&&(T=y),!(e.M!==null&&f!==null&&p!==null&&pe.M)&&(e.M=p),l=A2(e,n,i,{start:p,duration:T,node:d,Zg:T==null||!h}),a.push(l),n.pa.id&&T&&e.ka.set(n.pa.id,T),T==null){l=null;break}l=p+T}}if(o)for(n=m(a),i=n.next();!i.done;i=n.next())i=i.value.id,e.C.includes(i)||e.C.push(i);else e.C=a.map(function(x){return x.id});return s!=null?{periods:a,duration:s+u,Mg:!1}:{periods:a,duration:l,Mg:!0}}function E2(e){var n=Array.from(e.B.keys()).filter(function(a){return!e.C.includes(a)});n=m(n);for(var i=n.next();!i.done;i=n.next()){i=i.value;for(var r=!0,o=m(e.B.get(i)),s=o.next();!s.done;s=o.next()){s=s.value;var u=e.o.get(s);u&&(u.segmentIndex&&u.segmentIndex.getNumReferences()!=0?r=!1:(e.m&&e.m.Kg(u,i),e.o.delete(s)))}r&&e.B.delete(i)}}function A2(e,n,i,r){n.pa=bh(e,r.node,null,i),n.ha=r,n.pa.ab=n.ab,n.pa.id||(n.pa.id="__shaka_period_"+r.start);var o=De(r.node,"EventStream");i=n.presentationTimeline.nb(),o=m(o);for(var s=o.next();!s.done;s=o.next())P2(e,r.start,r.duration,s.value,i);for(i=De(r.node,"SupplementalProperty"),i=m(i),o=i.next();!o.done;o=i.next())o=o.value,o.attributes.schemeIdUri=="urn:mpeg:dash:urlparam:2014"&&(o=hu(e,o))&&(n.sb=o);if(i=De(r.node,"AdaptationSet").map(function(f,y){return Kv(e,n,y,f)}).filter(Wi),n.Mb){o=[],s=m(i);for(var u=s.next();!u.done;u=s.next()){u=m(u.value.rj);for(var a=u.next();!a.done;a=u.next())o.push(a.value)}if(o.length!=new Set(o).size)throw new R(2,4,4018)}for(o=new Map,s=m(i),u=s.next();!u.done;u=s.next())for(u=m(u.value.di),a=u.next();!a.done;a=u.next()){var l=m(a.value);a=l.next().value,l=l.next().value,o.set(a,l)}if(o.size)for(s=null,u=m(i),a=u.next();!a.done;a=u.next()){a=a.value,l=[];for(var c=m(a.streams),d=c.next(),h={};!d.done;h={og:void 0},d=c.next())if(h.og=d.value,o.has(h.og.originalId)){s||(s=De(r.node,"AdaptationSet").map(function(f,y){return Kv(e,n,y,f)}).filter(Wi)),d=m(s);for(var p=d.next();!p.done;p=d.next())(p=p.value.streams.find(function(f){return function(y){return y.originalId==f.og.originalId}}(h)))&&(p.dependencyStream=o.get(p.originalId),p.originalId+=p.dependencyStream.originalId,l.push(p))}l.length&&a.streams.push.apply(a.streams,X(l))}if(r=i.filter(function(f){return!f.vg}),i=i.filter(function(f){return f.vg}),!e.g.disableIFrames){for(i=m(i),o=i.next();!o.done;o=i.next())for(o=o.value,s=o.vg.split(" "),u=m(r),a=u.next();!a.done;a=u.next())if(a=a.value,s.includes(a.id))for(a=m(a.streams),l=a.next();!l.done;l=a.next())$f(l.value,o.streams)}if(i=Sl(e.g.disableAudio,r,"audio"),o=Sl(e.g.disableVideo,r,"video"),s=Sl(e.g.disableText,r,ye),r=Sl(e.g.disableThumbnails,r,"image"),o.length===0&&i.length===0)throw new R(2,4,4004);return{id:n.pa.id,audioStreams:i,videoStreams:o,textStreams:s,imageStreams:r}}function Sl(e,n,i){return e||!n.length?[]:n.reduce(function(r,o){return o.contentType!=i||r.push.apply(r,X(o.streams)),r},[])}function Kv(e,n,i,r){function o(L){var N=L.attributes["dvb:fontFamily"];L=L.attributes["dvb:url"],N&&L&&(L=ft(n.ga.Ra(),[L],n.sb()),e.j.addFont(N,L[0]))}function s(L){switch(L){case 1:case 5:case 6:case 7:return"srgb";case 9:return"rec2020";case 11:case 12:return"p3"}}function u(L){switch(L){case 1:case 6:case 13:case 14:case 15:return"SDR";case 16:return"PQ";case 18:return"HLG"}}n.ga=bh(e,r,n.pa,null),n.ga.position=i;var a=!1;i=De(r,"Role");var l=i.map(function(L){return L.attributes.value}).filter(Wi),c=void 0,d=n.ga.contentType==ye;d&&(c="subtitle"),i=m(i);for(var h=i.next();!h.done;h=i.next()){h=h.value;var p=h.attributes.schemeIdUri;if(p==null||p=="urn:mpeg:dash:role:2011")switch(h=h.attributes.value,h){case"main":a=!0;break;case"caption":case"subtitle":c=h}}var f=De(r,"EssentialProperty");i=null;var y=!1;h=null,p=!1,f=m(f);for(var T=f.next();!T.done;T=f.next()){T=T.value;var v=T.attributes.schemeIdUri;if(v=="http://dashif.org/guidelines/trickmode")i=T.attributes.value;else if(v=="urn:mpeg:mpegB:cicp:TransferCharacteristics")var x=u(parseInt(T.attributes.value,10));else if(v=="urn:mpeg:mpegB:cicp:ColourPrimaries")var w=s(parseInt(T.attributes.value,10));else v!="urn:mpeg:mpegB:cicp:MatrixCoefficients"&&(v=="urn:mpeg:dash:ssr:2023"&&e.g.dash.enableFastSwitching?y=!0:v=="urn:dvb:dash:fontdownload:2014"?o(T):v=="urn:mpeg:dash:urlparam:2014"&&(h=hu(e,T))||(p=!0))}if(p)return null;var A=null;for(p=De(r,"SupplementalProperty"),p=m(p),f=p.next();!f.done;f=p.next())f=f.value,T=f.attributes.schemeIdUri,T=="http://dashif.org/guidelines/last-segment-number"?A=parseInt(f.attributes.value,10)-1:T=="urn:mpeg:mpegB:cicp:TransferCharacteristics"?x=u(parseInt(f.attributes.value,10)):T=="urn:mpeg:mpegB:cicp:ColourPrimaries"?w=s(parseInt(f.attributes.value,10)):T=="urn:dvb:dash:fontdownload:2014"?o(f):T=="urn:mpeg:dash:urlparam:2014"&&(h=hu(e,f));h&&(n.sb=h),h=De(r,"Accessibility");var I=new Map,k;for(h=m(h),p=h.next();!p.done;p=h.next())if(f=p.value,p=f.attributes.schemeIdUri,f=f.attributes.value,p!="urn:scte:dash:cc:cea-608:2015"||e.g.disableText)if(p!="urn:scte:dash:cc:cea-708:2015"||e.g.disableText)p=="urn:mpeg:dash:role:2011"?f!=null&&(l.push(f),f=="captions"&&(c="caption")):p=="urn:tva:metadata:cs:AudioPurposeCS:2007"&&(f=="1"?k="visually impaired":f=="2"&&(k="hard of hearing"));else if(p=1,f!=null)for(f=m(f.split(";")),T=f.next();!T.done;T=f.next()){v=T.value;var C=T=void 0;v.includes("=")?(v=v.split("="),T="svc"+v[0],C=v[1].split(",")[0].split(":").pop()):(T="svc"+p,p++,C=v),I.set(T,Oe(C))}else I.set("svc1","und");else if(p=1,f!=null)for(f=f.split(";"),T=m(f),v=T.next();!v.done;v=T.next()){C=v.value;var E=v=void 0;C.includes("=")?(C=C.split("="),v=C[0].startsWith("CC")?C[0]:"CC"+C[0],E=C[1]||"und"):(v="CC"+p,f.length==2?p+=2:p++,E=C),I.set(v,Oe(E))}else I.set("CC1","und");h=De(r,"ContentProtection");var M=mv(h,e.g.ignoreDrmInfo,e.g.dash.keySystemsByURI);n.ga.encrypted=0e.I)){var i=e.I;0<=e.g.updatePeriod&&(i=e.g.updatePeriod),e.J.da(Math.max(i-n,Du(e.na)))}}function bh(e,n,i,r){i=i||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,pixelAspectRatio:void 0,qe:null,audioSamplingRate:null,ab:0,Be:0,encrypted:!1},r=r||i.Ra;var o=n.attributes.id,s=n.attributes.supplementalId,u=De(n,"BaseURL"),a,l=!1;if(e.h)for(var c=m(u),d=c.next();!d.done;d=c.next()){var h=d.value;d=h.attributes.serviceLocation,h=ln(h),d&&h&&(Vo(e.h,o,d,h),l=!0)}l&&e.h||(a=u.map(ln)),c=n.attributes.contentType||i.contentType,d=n.attributes.mimeType||i.mimeType,h=Rd([n.attributes.codecs||i.codecs]).join(",");var p=de(n,"frameRate",yS)||i.frameRate,f=n.attributes.sar||i.pixelAspectRatio,y=M2(De(n,"InbandEventStream"),i.emsgSchemeIdUris),T=De(n,"AudioChannelConfiguration");T=k2(T)||i.qe;var v=de(n,"audioSamplingRate",Nt)||i.audioSamplingRate;c||(c=qv(d,h));var x=it(n,"SegmentBase"),w=it(n,"SegmentTemplate"),A=x&&de(x,"availabilityTimeOffset",cs)||0,I=w&&de(w,"availabilityTimeOffset",cs)||0,k=u&&u.length&&de(u[0],"availabilityTimeOffset",cs)||0;A=i.ab+k+A+I,I=null,(k=it(n,"SegmentSequenceProperties"))&&(k=it(k,"SAP"))&&(I=de(k,"cadence",Ut)),k=n.attributes.label;var C=De(n,"Label");return C&&C.length&&(C=C[0],st(C)&&(k=st(C))),{Ra:function(){return ft(r(),u.length?e.h&&l?uu(e.h,o):a||[]:[])},bd:x||i.bd,Xb:it(n,"SegmentList")||i.Xb,jc:w||i.jc,width:de(n,"width",Nt)||i.width,height:de(n,"height",Nt)||i.height,contentType:c,mimeType:d,codecs:h,frameRate:p,pixelAspectRatio:f,emsgSchemeIdUris:y,id:s||o,originalId:o,language:n.attributes.lang,qe:T,audioSamplingRate:v,ab:A,fe:null,Be:I||i.Be,label:k||null,encrypted:!1}}function M2(e,n){n=n.slice(),e=m(e);for(var i=e.next();!i.done;i=e.next())i=i.value.attributes.schemeIdUri,n.includes(i)||n.push(i);return n}function k2(e){e=m(e);for(var n=e.next();!n.done;n=e.next()){n=n.value;var i=n.attributes.schemeIdUri;if(i&&(n=n.attributes.value))switch(i){case"urn:mpeg:dash:outputChannelPositionList:2012":return n.trim().split(/ +/).length;case"urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case"urn:dts:dash:audio_channel_configuration:2012":if(n=parseInt(n,10),!n)continue;return n;case"tag:dolby.com,2015:dash:audio_channel_configuration:2015":if(i=[2,1,2,2,2,2,1,2,2,1,1,1,1,2,1,1,2,2],n=parseInt(n,16),!n)continue;for(var r=0,o=0;oi}).map(ln).filter(Wi);return r.length?ft(e.A,r):[]}W("shaka.dash.DashParser",Tl),Ir("application/dash+xml",function(){return new Tl}),Ir("video/vnd.mpeg.dash.mpd",function(){return new Tl});function xl(){}W("shaka.dependencies",xl),xl.has=function(e){return Fh.has(e)},xl.add=function(e,n){if(!$v[e])throw Error(e+" is not supported");e==Yv?Ce("mux.js","mux.js is no longer used in Shaka Player."):Fh.set(e,function(){return n})};var Yv="muxjs",$v={Rk:Yv,ISOBoxer:"ISOBoxer"};xl.Allowed=$v;var Fh=new Map([["ISOBoxer",function(){return F.ISOBoxer}]]);function Qv(e,n,i){this.type=e,this.ca=n,this.segments=i||null}function wl(e,n,i,r){this.id=e,this.name=n,this.attributes=i,this.value=r===void 0?null:r}wl.prototype.toString=function(e){function n(o){return o.name+"="+(isNaN(Number(o.value))?'"'+o.value+'"':o.value)}var i="#"+this.name,r=this.attributes?this.attributes.filter(function(o){return e?!e.has(o.name):!0}).map(n):[];return this.value&&r.unshift(this.value),0n.length||n[0]!="data")throw new R(2,1,1004,e);if(n=n.slice(1).join(":").split(","),2>n.length)throw new R(2,1,1004,e);var i=n[0];e=F.decodeURIComponent(n.slice(1).join(",")),n=i.split(";"),i=n[0];var r=!1;1",pi(n),""].join(` `)))&&(r.licenseServerUri=hl(n)),r=Promise.resolve(r)}else r=Promise.resolve(null);return r}).set("urn:uuid:3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c",function(n){var i=Le(n,"METHOD");if(["SAMPLE-AES","SAMPLE-AES-CTR"].includes(i)){var r="cenc";i=="SAMPLE-AES"&&(r="cbcs"),i=Le(n,"URI"),i=Al(i.split("?")[0]),i=oe(i.data),r=Fi("com.huawei.wiseplay",r,[{initDataType:"cenc",initData:i}]),(n=$(n,"KEYID"))&&r.keyIds.add(n.toLowerCase().substr(2)),n=Promise.resolve(r)}else n=Promise.resolve(null);return n}),this.Na=new Set,this.i=new Map,this.l=null,this.C="",this.Ga=new N2,this.J=-1,this.ea=1/0,this.$=this.Sb=this.Ma=!1,this.B=new ve(function(){if(e.W&&!e.g.continueLoadingWhenPaused&&(e.T.Ja(e.W,"timeupdate"),e.W.paused)){e.T.qa(e.W,"timeupdate",function(){return C0(e)});return}C0(e)}),this.Ea=Rl,this.m=null,this.La=0,this.o=1/0,this.Fa=this.Aa=this.P=0,this.Z=new co,this.G=new Map,this.H=new Map,this.sa=new Map,this.ka=new Map,this.L=new Map,this.na=new Map,this.oa=new Map,this.Rb=this.fa=!1,this.Nb=new Hr(5),this.j=null,this.O=!0,this.za=new Set,this.T=new Pe,this.u=this.W=null,this.Ob=function(){return!1}}g=Il.prototype,g.configure=function(e,n){var i=this.h&&e.updatePeriod!=this.g.updatePeriod&&0<=e.updatePeriod;this.g=e,n&&(this.Ob=n),this.j&&this.j.configure(this.g),i&&this.m&&this.m.presentationTimeline.U()&&this.B.qb()},g.start=function(e,n){var i=this,r;return P(function(o){return o.g==1?(i.h=n,i.fa=n.isLowLatencyMode(),S(o,$h(i,[e]).promise,2)):o.g!=3?(r=o.h,i.C=r.uri,S(o,O2(i,r.data),3)):o.return(i.m)})},g.stop=function(){this.B&&(this.B.stop(),this.B=null);var e=[];return this.Z&&(e.push(this.Z.destroy()),this.Z=null),this.g=this.h=null,this.Na.clear(),this.m=null,this.i.clear(),this.I.clear(),this.H.clear(),this.A.clear(),this.sa.clear(),this.ka.clear(),this.L.clear(),this.na.clear(),this.oa.clear(),this.za.clear(),this.j&&this.j.destroy(),this.T&&(this.T.release(),this.T=null),Promise.all(e)},g.update=function(){var e=this,n,i,r,o,s,u,a,l,c,d,h,p;return P(function(f){if(f.g==1){if(!Bt(e))return f.return();for(n=[],i=Array.from(e.i.values()),e.o=1/0,e.m.gapCount=0,r=i.filter(function(y){return y.stream.segmentIndex}),o=m(r),s=o.next();!s.done;s=o.next())u=s.value,n.push(_2(e,u));return S(f,Promise.all(n),2)}for(p0(e,r.map(function(y){return y.stream})),a=r.some(function(y){return y.pd==0}),r.length&&!a&&(l=lI,kl(e,l.Oh),c=r.map(function(y){return y.Tb}),e.l.$a(Math.min.apply(Math,X(c))),e.h.updateDuration()),a&&Kh(e),d=m(r),h=d.next();!h.done;h=d.next())p=h.value,p.stream.isAudioMuxedInVideo||!p.stream.segmentIndex||Wn(p.stream.segmentIndex)||e.h.disableStream(p.stream);K(f)})};function Gh(e,n){return Bt(e)?e.M.get(n.type):n.le}function _2(e,n){var i,r,o,s,u,a,l,c,d,h,p,f,y,T,v,x,w,A,I,k,C,E,M,D,_,j,L,N,U,O,b,V,H,ce,Y,Me,Re;return P(function(fe){switch(fe.g){case 1:if(n.stream.isAudioMuxedInVideo)return fe.return();for(i=[],r=m(n.N()),o=r.next();!o.done;o=r.next())s=o.value,u=new $e(s),a=u.g,n.Ud&&(0<=n.Ab&&a.add("_HLS_msn",String(n.Ab)),0<=n.Bb&&a.add("_HLS_part",String(n.Bb))),n.Vd&&a.add("_HLS_skip","YES"),sf(a)&&ar(u,Gr(a.toString())),i.push(u.toString());return ue(fe,2),S(fe,$h(e,i,!0).promise,4);case 4:l=fe.h,me(fe,3);break;case 2:throw c=ae(fe),e.h&&e.h.disableStream(n.stream),c;case 3:if(!n.stream.segmentIndex)return fe.return();if(d=Vh(e.Ga,l.data),d.type!=1)throw new R(2,4,4017);return h=l.uri,h==l.originalUri||n.N().includes(h)||n.we.push(h),p=En(d.ca,"EXT-X-DEFINE"),f=Xh(e,p,h),y=n.stream,T=Gh(e,n),S(fe,y0(e,d,y.mimeType,n.N,f),5);case 5:for(v=fe.h,x=v.keyIds,w=v.drmInfos,A=v.encrypted,I=v.Bg,y.encrypted||!A||I||(y.encrypted=!0),k=function(se,Ie){return se.size===Ie.size&&[].concat(X(se)).every(function(pe){return Ie.has(pe)})},k(y.keyIds,x)||(y.keyIds=x,y.drmInfos=w,e.h.newDrmInfo(y)),C=E0(e,d,T,f,n.N,n.type),E=C.segments,(M=C.bandwidth)&&(y.bandwidth=M),D=wa(y),_=m(E),j=_.next();!j.done;j=_.next())L=j.value,L.Y&&(L.Y.Uc=D);y.segmentIndex.yd(E,e.l.nb()),E.length&&(N=Ko(d.ca,"EXT-X-MEDIA-SEQUENCE",0),O=(U=mt(d.ca,"EXT-X-SKIP"))?Number($(U,"SKIPPED-SEGMENTS")):0,b=g0(N,E),V=b.Ab,H=b.Bb,n.Ab=V+O,n.Bb=H,ce=T.get(N),y.segmentIndex.Oa(ce)),(Y=Wn(y.segmentIndex))&&(n.Ac=Y.startTime,Me=E[E.length-1],n.Tb=Me.endTime),(Re=mt(d.ca,"EXT-X-ENDLIST"))&&(n.pd=!0),zh(e,d),qh(e,d.ca,y.type,f,n.N),K(fe)}})}g.onExpirationUpdated=function(){},g.onInitialVariantChosen=function(){},g.banLocation=function(e){this.j&&this.j.banLocation(e)},g.setMediaElement=function(e){this.W=e};function s0(e,n,i){i=i===void 0?!1:i;for(var r=e.J==-1,o=m(n),s=o.next();!s.done;s=o.next()){s=s.value;var u=s.stream.segmentIndex,a=Gh(e,s);if(u=Wn(u)){a=m(a);for(var l=a.next();!l.done;l=a.next()){l=m(l.value);var c=l.next().value;if(l.next().value==u.startTime){r&&(e.J=Math.max(e.J,c)),s.qf=c;break}}}}if(!(0>e.J))for(n=m(n),r=n.next();!r.done;r=n.next())r=r.value,(pu(e,r.type)||i)&&(o=r.stream.segmentIndex)&&(s=e.J-r.qf,0Math.abs(i))){n.Ac+=i,n.Tb+=i,e=Gh(e,n);for(var r=m(e),o=r.next();!o.done;o=r.next()){var s=m(o.value);o=s.next().value,s=s.next().value,e.set(o,s+i)}n.N()}}function O2(e,n){var i,r,o,s,u,a,l,c,d,h,p,f,y,T,v,x,w,A,I,k,C,E,M,D,_,j,L,N,U,O,b,V,H,ce,Y,Me,Re,fe,se,Ie,pe,Te;return P(function(le){switch(le.g){case 1:return i=ot,r=Vh(e.Ga,n),o=En(r.ca,"EXT-X-DEFINE"),s=[],u=[],a=[],e.l=new Z(null,0),e.l.Fc(!0),l=function(){return[e.C]},c=null,d=new Map,r.type==1?(e.O=!1,V=En(r.ca,"EXT-X-DEFINE"),d=Xh(e,V,e.C),c=i.la,H="",ce=new Map,S(le,f0(e,e.F++,d,r,l,"",c,H,!0,"Media Playlist",null,ce,null,!1,null,!1),7)):(B2(e,o),h=En(r.ca,"EXT-X-MEDIA"),p=En(r.ca,"EXT-X-STREAM-INF"),f=En(r.ca,"EXT-X-IMAGE-STREAM-INF"),y=En(r.ca,"EXT-X-I-FRAME-STREAM-INF"),T=En(r.ca,"EXT-X-SESSION-KEY"),v=En(r.ca,"EXT-X-SESSION-DATA"),x=En(r.ca,"EXT-X-CONTENT-STEERING"),V2(e,v),S(le,H2(e,x),4));case 4:if(!e.g.ignoreSupplementalCodecs){for(w=[],A=m(p),I=A.next(),k={};!I.done;k={Fh:void 0},I=A.next())C=I.value,(E=$(C,"SUPPLEMENTAL-CODECS"))&&(k.Fh=E.split(/\s*,\s*/).map(function(ge){return ge.split("/")[0]}),M=C.attributes.map(function(ge){return function(be){var ht=be.name,Je=be.value;return ht=="CODECS"&&(Je=ge.Fh.join(","),be=be.value.split(","),1r-2&&(o=Math.max(1,r-2)),o=r-o;oe.u&&(i=Math.min(-e.u,i),e.u+=i),e.l.xh(0),e.l.jg(i),e.l.Fc(!1)}function x0(e,n,i,r,o){var s=mt(i,"EXT-X-MAP");if(!s)return null;var u=Le(s,"URI"),a=ir(r(),u,o);if(u=[a.toString(),$(s,"BYTERANGE","")].join("-"),!e.sa.has(u)){var l=void 0,c=null,d=!1;i=m(i);for(var h=i.next();!h.done;h=i.next())h=h.value,h.name=="EXT-X-KEY"?(d=Le(h,"METHOD"),Dl(d)&&h.idL?1:0}),i=0;ih))continue}if(h==null){var y=$(u,"DURATION")||$(u,"PLANNED-DURATION");if(y){var T=parseFloat(y);if(isNaN(T)||(h=d+T),0>c-s+T)continue}}var v=$(u,"CLASS")||"com.apple.quicktime.HLS",x=$(u,"END-ON-NEXT")=="YES";if(h==null&&x){for(var w=i+1;wc){h=Math.max(0,k-s);break}}}if(h==null)continue}w=["CLASS","START-DATE","END-DATE","DURATION","END-ON-NEXT"];for(var C=[],E=m(u.attributes),M=E.next();!M.done;M=E.next()){var D=M.value;if(!w.includes(D.name)){var _=n0(D.value,r);(D.name=="X-ASSET-URI"||D.name=="X-ASSET-LIST")&&(_=ir(o(),D.value,r)[0]),C.push({key:D.name,description:"",data:_,mimeType:null,pictureType:null})}}1E)if(M){if(M=de(M,"t",Nt),M==null)break;if(D>=M)break;E=Math.ceil((M-D)/_)-1}else{if(w==1/0)break;if(D/v>=w)break;E=Math.ceil((w*v-D)/_)-1}for(M=0;M<=E;++M)k=D+_,I.push({start:D/v,end:k/v,xg:D}),D=k}for(v=I,x=m(x),w=x.next();!w.done;w=x.next())(w=hI(e,T,w.value,v,y,c))&&(w.type!="audio"||e.g.disableAudio?w.type!="video"||e.g.disableVideo?w.type!=ye||e.g.disableText||d.push(w):h.push(w):f.push(w))}for(p=[],f=m(0>1,i[1]=r<<7|n<<3|e>>1,i[2]=e<<7|8,i[3]=0,n=new Uint16Array(2),n[0]=(i[0]<<8)+i[1],n[1]=(i[2]<<8)+i[3],n[0].toString(16)+n[1].toString(16)):(i=new Uint8Array(2),i[0]=16|r>>1,i[1]=r<<7|n<<3,n=new Uint16Array(1),n[0]=(i[0]<<8)+i[1],n[0].toString(16))}function fI(e,n){var i=0;return e==="AACH"&&(i=5),n?i===0&&(i=(parseInt(n.substr(0,2),16)&248)>>3):(i=2,e==="AACH"&&(i=5)),"mp4a.40."+i}function gI(e){var n=/00000001[0-9]7/.exec(e);return n.length&&e?"avc1."+e.substr(e.indexOf(n[0])+10,6):""}function mI(e,n,i,r,o){var s=r.attributes.Url.replace("{bitrate}",String(i.bandwidth));r=[],o=m(o);for(var u=o.next(),a={};!u.done;a={Ge:void 0},u=o.next())a.Ge=u.value,r.push(new J(a.Ge.start,a.Ge.end,function(l){return function(){return ft(e.l,[s.replace("{start time}",String(l.Ge.xg))])}}(a),0,null,n,0,0,i.mssPrivateData.duration));return r}W("shaka.mss.MssParser",Zh);var yI="AAC AACL AACH AACP AVC1 H264 TTML DFXP".split(" "),vI=new Map().set("CAPT","main").set("SUBT","alternate").set("DESC","main");Ir("application/vnd.ms-sstr+xml",function(){return new Zh});function P0(e,n,i,r,o,s,u){if(200<=i&&299>=i&&i!=202||i==304)return{uri:o||r,originalUri:r,data:n,status:i,headers:e,fromCache:!!e["x-shaka-from-cache"],originalRequest:s};s=null;try{s=Zn(n)}catch{}throw new R(i==401||i==403?2:1,1,1001,r,i,s,e,u,o||r)}function tp(){}function Nl(e,n,i,r,o,s){var u=new AI;Ar(n.headers).forEach(function(d,h){u.append(h,d)});var a=new wI,l={Gg:!1,Ih:!1};if(e=TI(e,n,i,{body:n.body||void 0,headers:u,method:n.method,signal:a.signal,credentials:n.allowCrossSiteCredentials?"include":void 0},l,r,o,n.streamDataCallback,s.minBytesForProgressEvents||0),e=new tt(e,function(){return l.Gg=!0,a.abort(),Promise.resolve()}),n=n.retryParameters.timeout){var c=new ve(function(){l.Ih=!0,a.abort()});c.da(n/1e3),e.finally(function(){c.stop()})}return e}function TI(e,n,i,r,o,s,u,a,l){var c,d,h,p,f,y,T,v,x,w,A,I,k,C,E;return P(function(M){switch(M.g){case 1:return c=xI,d=EI,p=new ArrayBuffer(0),y=f=0,T={},v=Date.now(),ue(M,2),S(M,c(e,r),4);case 4:if(h=M.h,T=SI(h.headers),u(T),r.method=="HEAD"){M.s(5);break}return w=(x=h.headers.get("Content-Length"))?parseInt(x,10):0,h.body?(A=h.clone().body.getReader(),I=function(D){function _(){var j,L,N,U;return P(function(O){switch(O.g){case 1:return ue(O,2),S(O,A.read(),4);case 4:j=O.h,me(O,3);break;case 2:return ae(O),O.return();case 3:if(j.done){O.s(5);break}if(f+=j.value.byteLength,!a){O.s(5);break}return S(O,a(j.value),5);case 5:L=Date.now(),N=f-y,(100=l||j.done)&&(U=j.done?0:w-f,s(L-v,N,U),y=f,v=L),j.done?D.close():(D.enqueue(j.value),_()),K(O)}})}_()},new d({start:I}),S(M,h.arrayBuffer(),8)):S(M,h.arrayBuffer(),9);case 8:p=M.h,M.s(5);break;case 9:p=M.h,k=Date.now(),s(k-v,p.byteLength,0);case 5:n.headers.Range&&(C=n.headers.Range.replace("bytes=","").split("-").map(function(D){return parseInt(D,10)}),C.length==2&&p.byteLength!=C[1]-C[0]+1&&Ee("Payload length does not match range requested bytes",n,h)),me(M,3);break;case 2:throw E=ae(M),o.Gg?new R(1,1,7001,e,i):o.Ih?new R(1,1,1003,e,i):new R(1,1,1002,e,E,i);case 3:return M.return(P0(T,p,h.status,e,h.url,n,i))}})}function SI(e){var n={};return e.forEach(function(i,r){n[r.trim()]=i}),n}function L0(){if(F.ReadableStream)try{new ReadableStream({})}catch{return!1}else return!1;if(F.Response){if(!new Response("").body)return!1}else return!1;return!(!F.fetch||"polyfill"in F.fetch||!F.AbortController)}W("shaka.net.HttpFetchPlugin",tp),tp.isSupported=L0,tp.parse=Nl;var xI=F.fetch,wI=F.AbortController,EI=F.ReadableStream,AI=F.Headers;L0()&&(xi("http",Nl,2,!0),xi("https",Nl,2,!0),xi("blob",Nl,2,!0));function N0(){}function jl(e,n,i,r,o,s){var u=new II,a=Date.now(),l=0,c=new Promise(function(d,h){u.open(n.method,e,!0),u.responseType="arraybuffer",u.timeout=n.retryParameters.timeout,u.withCredentials=n.allowCrossSiteCredentials,u.onabort=function(){h(new R(1,1,7001,e,i))};var p=!1;u.onreadystatechange=function(){if(u.readyState==2&&!p){var y=j0(u);o(y),p=!0}},u.onload=function(y){var T=j0(u),v=u.response;try{r(Date.now()-a,y.loaded-l,0);var x=P0(T,v,u.status,e,u.responseURL,n,i);d(x)}catch(w){h(w)}},u.onerror=function(y){h(new R(1,1,1002,e,y,i))},u.ontimeout=function(){h(new R(1,1,1003,e,i))},u.onprogress=function(y){var T=Date.now(),v=s.minBytesForProgressEvents||0,x=y.loaded-l;(100=v||y.lengthComputable&&y.loaded==y.total)&&(r(T-a,x,u.readyState==4?0:y.total-y.loaded),l=y.loaded,a=T)};for(var f in n.headers)u.setRequestHeader(f.toLowerCase(),n.headers[f]);u.send(n.body)});return new tt(c,function(){return u.abort(),Promise.resolve()})}function j0(e){var n=e.getAllResponseHeaders().trim().split(`\r `);e={},n=m(n);for(var i=n.next();!i.done;i=n.next())i=i.value.split(": "),e[i[0].toLowerCase()]=i.slice(1).join(": ");return e}W("shaka.net.HttpXHRPlugin",N0),N0.parse=jl;var II=F.XMLHttpRequest;xi("http",jl,1,!0),xi("https",jl,1,!0),xi("blob",jl,1,!0);function _0(e,n,i,r,o){this.g=e,this.i=n,this.groupId=i,this.h=r,this.j=o}function np(e){var n=e.Gb(!1);return n?pi(n):e.N().map(function(i){return"{"+encodeURI(i.split("#xywh=")[0])+"}"}).join("")+":"+e.startByte+":"+e.endByte}function CI(e,n){return Us(e.g.N(),e.g.startByte,e.g.endByte,n.streaming.retryParameters)}function U0(){this.g=this.j=this.i=0,this.h=new Map,this.l=0}function O0(e,n){e.i+=n;var i=e.l;return e.l++,e.h.set(i,n),i}U0.prototype.close=function(e,n){if(this.h.has(e)){var i=this.h.get(e);this.h.delete(e),this.j+=i,this.g+=n}};function b0(e){return e.i==0?0:e.j/e.i}function B0(e){var n=this;this.u=e,this.i=new Map,this.h=new ho(function(){return ip(n).catch(function(){})}),this.j=[],this.o=function(){},this.m=function(){},this.g=new U0,this.l=!1}B0.prototype.destroy=function(){return this.h.destroy()};function MI(e,n,i){e.o=n,e.m=i}function ip(e){e.l=!0;var n=e.j.map(function(i){return i()});return e.j=[],Promise.all(n)}function kI(e,n,i,r,o,s){Be(e.h);var u=(e.i.get(n)||Promise.resolve()).then(function(){var a,l,c,d,h,p,f;return P(function(y){if(y.g==1)return S(y,PI(e,i),2);if(a=y.h,e.h.g)throw new R(2,9,7001);if(o)for(d in l=oe(a),c=new nd(l),c.data)h=Number(d),p=c.data[h],f=c.g[h],e.m(p,f);return e.g.close(r,a.byteLength),e.o(b0(e.g),e.g.g),y.return(s(a))})});e.i.set(n,u)}function DI(e,n,i,r,o,s){Be(e.h);var u=(e.i.get(n)||Promise.resolve()).then(function(){if(e.h.g)throw new R(2,9,7001);if(o){var a=oe(i);a=new nd(a);for(var l in a.data){var c=Number(l);e.m(a.data[c],a.g[c])}}return e.g.close(r,i.byteLength),e.o(b0(e.g),e.g.g),s(i)});e.i.set(n,u)}function RI(e){return P(function(n){return n.g==1?S(n,Promise.all(e.i.values()),2):n.return(e.g.g)})}function PI(e,n){var i,r,o,s;return P(function(u){return u.g==1?(i=_n,r=e.u.request(i,n),o=function(){return r.abort()},e.j.push(o),S(u,r.promise,2)):(s=u.h,Ln(e.j,o),u.return(s.data))})}function _l(e,n){var i=this;this.i=e,this.h=e.objectStore(n),this.g=new Ne,e.onabort=function(r){r.preventDefault(),i.g.reject()},e.onerror=function(r){r.preventDefault(),i.g.reject()},e.oncomplete=function(){i.g.resolve()}}_l.prototype.abort=function(){var e=this;return P(function(n){if(n.g==1){try{e.i.abort()}catch{}return ue(n,2),S(n,e.g,4)}if(n.g!=2)return me(n,0);ae(n),K(n)})};function rp(e,n){return new Promise(function(i,r){var o=e.h.openCursor();o.onerror=r,o.onsuccess=function(){var s;return P(function(u){if(u.g==1)return o.result==null?(i(),u.return()):(s=o.result,S(u,n(s.key,s.value,s),2));s.continue(),K(u)})}})}_l.prototype.store=function(){return this.h},_l.prototype.promise=function(){return this.g};function op(e){this.h=e,this.g=[]}op.prototype.destroy=function(){return Promise.all(this.g.map(function(e){return e.abort()}))};function Or(e,n){return Ul(e,n,"readwrite")}function Ul(e,n,i){i=e.h.transaction([n],i);var r=new _l(i,n);return e.g.push(r),r.promise().then(function(){Ln(e.g,r)},function(){Ln(e.g,r)}),r}function br(e,n,i){this.h=new op(e),this.i=n,this.g=i}g=br.prototype,g.destroy=function(){return this.h.destroy()},g.hasFixedKeySpace=function(){return!0},g.addSegments=function(){return F0(this.i)},g.removeSegments=function(e,n){return V0(this,this.i,e,n)},g.getSegments=function(e){var n=this,i;return P(function(r){return r.g==1?S(r,H0(n,n.i,e),2):(i=r.h,r.return(i.map(function(o){return n.Ig(o)})))})},g.addManifests=function(){return F0(this.g)},g.updateManifest=function(){return Promise.reject(new R(2,9,9016,"Cannot modify values in "+this.g))};function LI(e,n,i){e=Or(e.h,e.g);var r=e.store();return r.get(n).onsuccess=function(){r.put(i,n)},e.promise()}g.updateManifestExpiration=function(e,n){var i=Or(this.h,this.g),r=i.store();return r.get(e).onsuccess=function(o){(o=o.target.result)&&(o.expiration=n,r.put(o,e))},i.promise()},g.removeManifests=function(e,n){return V0(this,this.g,e,n)},g.getManifests=function(e){var n=this,i;return P(function(r){return r.g==1?S(r,H0(n,n.g,e),2):(i=r.h,r.return(Promise.all(i.map(function(o){return n.gd(o)}))))})},g.getAllManifests=function(){var e=this,n,i;return P(function(r){return r.g==1?(n=Ul(e.h,e.g,"readonly"),i=new Map,S(r,rp(n,function(o,s){var u;return P(function(a){if(a.g==1)return S(a,e.gd(s),2);u=a.h,i.set(o,u),K(a)})}),2)):r.g!=3?S(r,n.promise(),3):r.return(i)})},g.Ig=function(e){return e},g.gd=function(e){return Promise.resolve(e)};function F0(e){return Promise.reject(new R(2,9,9011,"Cannot add new value to "+e))}g.add=function(e,n){var i=this,r,o,s,u,a,l,c;return P(function(d){if(d.g==1){for(r=Or(i.h,e),o=r.store(),s=[],u=m(n),a=u.next(),l={};!a.done;l={cg:void 0},a=u.next())c=a.value,l.cg=o.add(c),l.cg.onsuccess=function(h){return function(){s.push(h.cg.result)}}(l);return S(d,r.promise(),2)}return d.return(s)})};function V0(e,n,i,r){e=Or(e.h,n),n=e.store(),i=m(i);for(var o=i.next(),s={};!o.done;s={Qf:void 0},o=i.next())s.Qf=o.value,n.delete(s.Qf).onsuccess=function(u){return function(){return r(u.Qf)}}(s);return e.promise()}function H0(e,n,i){var r,o,s,u,a,l,c;return P(function(d){if(d.g==1){for(r=Ul(e.h,n,"readonly"),o=r.store(),s={},u=[],a=m(i),l=a.next(),c={};!l.done;c={xe:void 0,ge:void 0},l=a.next())c.ge=l.value,c.xe=o.get(c.ge),c.xe.onsuccess=function(h){return function(){h.xe.result==null&&u.push(h.ge),s[h.ge]=h.xe.result}}(c);return S(d,r.promise(),2)}if(u.length)throw new R(2,9,9012,"Could not find values for "+u);return d.return(i.map(function(h){return s[h]}))})}function fu(e){this.g=new op(e)}fu.prototype.destroy=function(){return this.g.destroy()},fu.prototype.getAll=function(){var e=this,n,i;return P(function(r){return r.g==1?(n=Ul(e.g,"session-ids","readonly"),i=[],S(r,rp(n,function(o,s){i.push(s)}),2)):r.g!=3?S(r,n.promise(),3):r.return(i)})},fu.prototype.add=function(e){var n=Or(this.g,"session-ids"),i=n.store();e=m(e);for(var r=e.next();!r.done;r=e.next())i.add(r.value);return n.promise()},fu.prototype.remove=function(e){var n=this,i;return P(function(r){return r.g==1?(i=Or(n.g,"session-ids"),S(r,rp(i,function(o,s,u){e.includes(s.sessionId)&&u.delete()}),2)):S(r,i.promise(),0)})};function $t(){this.g=new Map}$t.prototype.destroy=function(){for(var e=[],n=m(this.g.values()),i=n.next();!i.done;i=n.next())e.push(i.value.destroy());return this.g.clear(),Promise.all(e)},$t.prototype.init=function(){var e=this;gu.forEach(function(o,s){(o=o())&&e.g.set(s,o)});for(var n=[],i=m(this.g.values()),r=i.next();!r.done;r=i.next())n.push(r.value.init());return Promise.all(n)};function G0(e){var n=null;if(e.g.forEach(function(i,r){i.getCells().forEach(function(o,s){o.hasFixedKeySpace()||n||(n={path:{zb:r,Qa:s},Qa:o})})}),n)return n;throw new R(2,9,9013,"Could not find a cell that supports add-operations")}function NI(e,n){e.g.forEach(function(i,r){i.getCells().forEach(function(o,s){n({zb:r,Qa:s},o)})})}function Ol(e,n,i){if(e=e.g.get(n),!e)throw new R(2,9,9013,"Could not find mechanism with name "+n);if(n=e.getCells().get(i),!n)throw new R(2,9,9013,"Could not find cell with name "+i);return n}function jI(e,n){e.g.forEach(function(i){n(i.getEmeSessionCell())})}function _I(e){var n=Array.from(e.g.keys());if(!n.length)throw new R(2,9,9e3,"No supported storage mechanisms found");return e.g.get(n[0]).getEmeSessionCell()}function UI(e){var n,i,r;return P(function(o){return o.g==1?(n=Array.from(e.g.values()),i=0n,!l||!c){d.s(3);break}return S(d,s.updateManifestExpiration(r.key(),n),3);case 3:return sn(d),S(d,o.destroy(),10);case 10:un(d,0);break;case 2:ae(d),d.s(3)}})},g.onInitialVariantChosen=function(){},g.banLocation=function(){},g.setMediaElement=function(){},Ir("application/x-offline-manifest",function(){return new Y0});function $0(){}function Q0(e,n){var i=up(e);return i&&i.g=="manifest"?(e={uri:e,originalUri:e,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"},originalRequest:n},e=lo(e)):e=i&&i.g=="segment"?XI(i.key(),i,n):wr(new R(2,1,9004,e)),e}function XI(e,n,i){var r=new $t;return lo(void 0).Ha(function(){return r.init()}).Ha(function(){return Ol(r,n.zb(),n.Qa())}).Ha(function(o){return o.getSegments([n.key()])}).Ha(function(o){return{uri:n,data:o[0].data,headers:{},originalRequest:i}}).finally(function(){return r.destroy()})}W("shaka.offline.OfflineScheme",$0),$0.plugin=Q0,xi("offline",Q0);function J0(e,n,i){var r,o,s,u,a,l;return P(function(c){switch(c.g){case 1:r=[];for(var d=[],h=m(i),p=h.next();!p.done;p=h.next()){p=p.value;for(var f=!1,y=m(d),T=y.next();!T.done;T=y.next())if(T=T.value,zI(T.info,p)){T.sessionIds.push(p.sessionId),f=!0;break}f||d.push({info:p,sessionIds:[p.sessionId]})}o=m(d),s=o.next();case 2:if(s.done){c.s(4);break}return u=s.value,a=WI(e,n,u),S(c,a,5);case 5:l=c.h,r=r.concat(l),s=o.next(),c.s(2);break;case 4:return c.return(r)}})}function WI(e,n,i){var r,o;return P(function(s){switch(s.g){case 1:return r=new oa({Vb:n,onError:function(){},re:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),ue(s,2),r.configure(e),S(s,zS(r,i.info.keySystem,i.info.licenseUri,i.info.serverCertificate,i.info.audioCapabilities,i.info.videoCapabilities),4);case 4:me(s,3);break;case 2:return ae(s),S(s,r.destroy(),5);case 5:return s.return([]);case 3:return o=[],S(s,Promise.all(i.sessionIds.map(function(u){return P(function(a){if(a.g==1)return ue(a,2),S(a,$S(r,u),4);if(a.g!=2)return o.push(u),me(a,0);ae(a),K(a)})})),6);case 6:return S(s,r.destroy(),7);case 7:return s.return(o)}})}function zI(e,n){function i(r,o){return r.robustness==o.robustness&&r.contentType==o.contentType}return e.keySystem==n.keySystem&&e.licenseUri==n.licenseUri&&Rc(e.audioCapabilities,n.audioCapabilities,i)&&Rc(e.videoCapabilities,n.videoCapabilities,i)}function qI(e,n,i){var r=n.presentationTimeline.getDuration();return n=Z0(n),{offlineUri:null,originalManifestUri:e,duration:r,size:0,expiration:1/0,tracks:n,appMetadata:i,isIncomplete:!1}}function ap(e,n){var i=q0(new z0(e.zb(),e.Qa()),n),r=n.appMetadata||{};return i=Z0(i),{offlineUri:e.toString(),originalManifestUri:n.originalManifestUri,duration:n.duration,size:n.size,expiration:n.expiration,tracks:i,appMetadata:r,isIncomplete:n.isIncomplete||!1}}function Z0(e){var n=[],i=$u(e.variants);i=m(i);for(var r=i.next();!r.done;r=i.next())n.push(Sr(r.value));for(e=m(e.textStreams),i=e.next();!i.done;i=e.next())n.push(xr(i.value));return n}function YI(){this.g=new Map}function $I(e,n){var i=n.audio,r=n.video;if(i&&!r&&e.g.set(i.id,i.bandwidth||n.bandwidth),!i&&r&&e.g.set(r.id,r.bandwidth||n.bandwidth),i&&r){var o=i.bandwidth||393216,s=r.bandwidth||n.bandwidth-o;0>=s&&(s=n.bandwidth),e.g.set(i.id,o),e.g.set(r.id,s)}}function QI(e,n){e.g.set(n.id,n.bandwidth||2048)}function e1(e,n){return e=e.g.get(n),e==null&&(e=0),e}function yt(e){var n=this;if(e&&e.constructor!=B)throw new R(2,9,9008);this.g=this.h=null,e?(this.h=e.g,this.g=e.xb()):(this.h=ko(),this.g=new Fe),this.i=[],this.l=[];var i=!e;this.j=new ho(function(){var r,o,s,u,a;return P(function(l){switch(l.g){case 1:return S(l,Promise.all(n.l.map(function(c){return ip(c)})),2);case 2:for(r=function(){},o=[],s=m(n.i),u=s.next();!u.done;u=s.next())a=u.value,o.push(a.then(r,r));return S(l,Promise.all(o),3);case 3:if(!i){l.s(4);break}return S(l,n.g.destroy(),4);case 4:n.h=null,n.g=null,K(l)}})}),this.m=1e9}function lp(){if(Qn())e:{for(var e=m(gu.values()),n=e.next();!n.done;n=e.next())if(n=n.value,n=n()){n.destroy(),e=!0;break e}e=!1}else e=!1;return e}g=yt.prototype,g.destroy=function(){return this.j.destroy()},g.configure=function(e,n){return arguments.length==2&&typeof e=="string"&&(e=Ra(e,n)),$i(this.h,e)},g.getConfiguration=function(){var e=ko();return $i(e,this.h,ko()),e},g.xb=function(){return this.g},g.store=function(e,n,i,r,o){var s=this,u=this.getConfiguration(),a=new B0(this.g);return this.l.push(a),n=JI(this,e,n||{},r||[],o||[],function(){var l;return P(function(c){return c.g==1?i?c.s(2):S(c,Nr(e,s.g,u.manifest.retryParameters),3):(c.g!=2&&(i=c.h),l=Ng(e,i||null),c.return(l()))})},u,a),n=new tt(n,function(){return ip(a)}),n.finally(function(){Ln(s.l,a)}),fC(this,n)};function JI(e,n,i,r,o,s,u,a){var l,c,d,h,p,f,y,T,v,x,w,A,I,k,C,E,M,D,_,j,L,N,U,O;return P(function(b){switch(b.g){case 1:return Fl(),c=l=null,d=new $t,f=p=h=null,ue(b,2,3),S(b,s(),5);case 5:return l=b.h,S(b,uC(e,n,l,u),6);case 6:if(y=b.h,dn(e),T=!y.presentationTimeline.U()&&!y.presentationTimeline.xc(),!T)throw new R(2,9,9005,n);v=m(r),x=v.next();case 7:if(x.done){b.s(9);break}return w=x.value,S(b,aC(e,w,y),10);case 10:A=b.h,y.imageStreams.push(A),dn(e),x=v.next(),b.s(7);break;case 9:I=m(o),k=I.next();case 11:return k.done?(Ig(u.drm.clearKeys,y.variants),M=y.variants.some(function(V){if(V.audio){for(var H=m(V.audio.drmInfos),ce=H.next();!ce.done;ce=H.next())if(ce.value.licenseServerUri.startsWith("data:"))return!0}if(V.video){for(V=m(V.video.drmInfos),H=V.next();!H.done;H=V.next())if(H.value.licenseServerUri.startsWith("data:"))return!0}return!1}),D=u.offline.usePersistentLicense,M&&(D=!1),S(b,e.Kc(y,function(V){f=f||V},u,D),15)):(C=k.value,S(b,lC(e,y,C.uri,C.language,C.kind,C.mime,C.codecs),14));case 14:E=b.h,y.textStreams.push(E),dn(e),k=I.next(),b.s(11);break;case 15:if(c=b.h,dn(e),f)throw f;return S(b,eC(y,c,u,D),16);case 16:return S(b,d.init(),17);case 17:return dn(e),S(b,G0(d),18);case 18:return h=b.h,dn(e),_=tC(c,y,n,i,u,a,D),j=_.Yi,L=_.tg,S(b,h.Qa.addManifests([j]),19);case 19:if(N=b.h,dn(e),p=N[0],dn(e),f)throw f;return S(b,ZI(e,L,p,j,a,u,h.Qa,y,c,D),20);case 20:return dn(e),r1(y,j,c,D),S(b,h.Qa.updateManifest(p,j),21);case 21:return dn(e),U=new ri("manifest",h.path.zb,h.path.Qa,p),b.return(ap(U,j));case 3:return sn(b),S(b,d.destroy(),22);case 22:if(!l){b.s(23);break}return S(b,l.stop(),23);case 23:if(!c){b.s(25);break}return S(b,c.destroy(),25);case 25:un(b,0);break;case 2:if(O=ae(b),p==null){b.s(27);break}return S(b,t1(p),27);case 27:throw f||O}})}function ZI(e,n,i,r,o,s,u,a,l,c){var d,h,p,f,y,T,v,x,w,A,I;return P(function(k){switch(k.g){case 1:if(d={},h=0,p=function(){if(e.j.g||o.l)throw new R(2,9,7001)},f=function(C,E){var M,D,_,j,L,N,U,O,b;return P(function(V){if(V.g==1){for(M=m(C),D=M.next(),_={};!D.done;_={Lb:void 0},D=M.next())_.Lb=D.value,p(),j=CI(_.Lb,s),L=_.Lb.i,N=_.Lb.h,U=function(H){return function(ce){var Y,Me,Re,fe;return P(function(se){switch(se.g){case 1:if(Y=H.Lb.g,Me=Y.Gb(!1),!Y.aesKey||Me){se.s(2);break}return S(se,Pd(ce,Y.aesKey,H.Lb.j),3);case 3:ce=se.h;case 2:return Re=np(Y),S(se,u.addSegments([{data:ce}]),4);case 4:fe=se.h,p(),d[Re]=fe[0],h+=ce.byteLength,K(se)}})}}(_),O=_.Lb.g,(b=O.Gb(!1))?DI(o,_.Lb.groupId,b,L,N,U):kI(o,_.Lb.groupId,j,L,N,U);return S(V,RI(o),2)}return p(),!E||o.l?V.s(0):(r1(a,r,l,c),S(V,u.updateManifest(i,r),0))})},y=!1,ue(k,2),!cp(a)||!y||i1(a)){k.s(4);break}return S(k,f(n.filter(function(C){return C.h}),!0),5);case 5:return p(),n=n.filter(function(C){return!C.h}),T=d,v=h,d={},h=0,S(k,n1(u,i,r,T,v,function(){return dn(e)}),6);case 6:p();case 4:if(y){k.s(7);break}return S(k,f(n,!1),8);case 8:return p(),x=d,w=h,d={},h=0,S(k,n1(u,i,r,x,w,function(){return p()}),9);case 9:p();case 7:me(k,0);break;case 2:return A=ae(k),I=Object.values(d),S(k,u.removeSegments(I,function(){}),10);case 10:throw A}})}function t1(e){var n,i,r,o;return P(function(s){switch(s.g){case 1:return n=new $t,S(s,n.init(),2);case 2:return S(s,G0(n),3);case 3:return i=s.h,r=new ri("manifest",i.path.zb,i.path.Qa,e),S(s,n.destroy(),4);case 4:return o=new yt,S(s,o.remove(r.toString()),0)}})}function n1(e,n,i,r,o,s){var u,a,l,c,d,h,p,f,y,T,v;return P(function(x){switch(x.g){case 1:for(u=!1,ue(x,2),a=!0,l=m(i.streams),c=l.next();!c.done;c=l.next())for(d=c.value,h=m(d.segments),p=h.next();!p.done;p=h.next())f=p.value,y=f.pendingSegmentRefId?r[f.pendingSegmentRefId]:null,y!=null&&(f.dataKey=y,f.pendingSegmentRefId=void 0),y=f.pendingInitSegmentRefId?r[f.pendingInitSegmentRefId]:null,y!=null&&(f.initSegmentKey=y,f.pendingInitSegmentRefId=void 0),f.pendingSegmentRefId&&(a=!1),f.pendingInitSegmentRefId&&(a=!1);return i.size+=o,a&&(i.isIncomplete=!1),S(x,e.updateManifest(n,i),4);case 4:u=!0,s(),me(x,0);break;case 2:return T=ae(x),S(x,t1(n),5);case 5:if(u){x.s(6);break}return v=Object.values(r),S(x,e.removeSegments(v,function(){}),6);case 6:throw T}})}function eC(e,n,i,r){var o,s,u,a,l,c,d,h,p,f,y,T,v,x,w,A,I,k,C,E,M,D,_,j,L,N,U,O,b,V;return P(function(H){switch(H.g){case 1:return o={width:1/0,height:1/0},kS(e,i.restrictions,o),S(H,Kf(n,e,r,i.drm.preferredKeySystems,i.drm.keySystemsMapping),2);case 2:for(s=[],u=i.preferredDecodingAttributes,a=i.preferredVideoCodecs,l=i.preferredAudioCodecs,c=i.preferredTextFormats,Gf(e,a,l,u,c),d=m(e.variants),h=d.next();!h.done;h=d.next())p=h.value,s.push(Sr(p));for(f=m(e.textStreams),y=f.next();!y.done;y=f.next())T=y.value,s.push(xr(T));for(v=m(e.imageStreams),x=v.next();!x.done;x=v.next())w=x.value,s.push(Yc(w));return S(H,i.offline.trackSelectionCallback(s),3);case 3:for(A=H.h,I=e.presentationTimeline.getDuration(),k=0,C=m(A),E=C.next();!E.done;E=C.next())M=E.value,D=M.bandwidth*I/8,k+=D;return ue(H,4),S(H,i.offline.downloadSizeCallback(k),6);case 6:if(_=H.h,!_)throw new R(2,9,9014);me(H,5);break;case 4:throw j=ae(H),j instanceof R?j:new R(2,9,9015);case 5:for(L=new Set,N=new Set,U=new Set,O=m(A),b=O.next();!b.done;b=O.next())V=b.value,V.type=="variant"&&L.add(V.id),V.type=="text"&&N.add(V.id),V.type=="image"&&U.add(V.id);e.variants=e.variants.filter(function(ce){return L.has(ce.id)}),e.textStreams=e.textStreams.filter(function(ce){return N.has(ce.id)}),e.imageStreams=e.imageStreams.filter(function(ce){return U.has(ce.id)}),yC(e),K(H)}})}function tC(e,n,i,r,o,s,u){var a=qI(i,n,r),l=o.offline.progressCallback;MI(s,function(y,T){a.size=T,l(a,y)},function(y,T){c&&u&&d==T&&xs(e,"cenc",y)});var c=cp(n)&&!i1(n),d=null;c&&(d=vC.get(e.h.keySystem));for(var h=new YI,p=m(n.textStreams),f=p.next();!f.done;f=p.next())h.g.set(f.value.id,52);for(p=m(n.imageStreams),f=p.next();!f.done;f=p.next())QI(h,f.value);for(p=m(n.variants),f=p.next();!f.done;f=p.next())$I(h,f.value);return s=dC(s,h,n,o),o=s.streams,s=s.tg,(h=e.h)&&u&&(h.initData=[]),{Yi:{creationTime:Date.now(),originalManifestUri:i,duration:n.presentationTimeline.getDuration(),size:0,expiration:e.nd(),streams:o,sessionIds:u?yg(e):[],drmInfo:h,appMetadata:r,isIncomplete:!0,sequenceMode:n.sequenceMode,type:n.type},tg:s}}function cp(e){return e.variants.some(function(n){var i=n.audio&&n.audio.encrypted;return n.video&&n.video.encrypted||i})}function i1(e){return e.variants.some(function(n){return(n.video?n.video.drmInfos:[]).concat(n.audio?n.audio.drmInfos:[]).some(function(i){return i.initData&&i.initData.length})})}function r1(e,n,i,r){if(n.expiration=i.nd(),i=yg(i),n.sessionIds=r?i:[],cp(e)&&r&&!i.length)throw new R(2,9,9007)}g.remove=function(e){return dp(this,nC(this,e))};function nC(e,n){var i,r,o,s,u,a;return P(function(l){switch(l.g){case 1:if(Fl(),i=up(n),i==null||i.g!="manifest")throw new R(2,9,9004,n);return r=i,o=new $t,li(l,2),S(l,o.init(),4);case 4:return S(l,Ol(o,r.zb(),r.Qa()),5);case 5:return s=l.h,S(l,s.getManifests([r.key()]),6);case 6:return u=l.h,a=u[0],S(l,Promise.all([iC(e,a,o),rC(s,r,a)]),2);case 2:return sn(l),S(l,o.destroy(),8);case 8:un(l,0)}})}function o1(e,n){for(var i=[],r=m(e.streams),o=r.next();!o.done;o=r.next())o=o.value,n&&o.type=="video"?i.push({contentType:et(o.mimeType,o.codecs),robustness:e.drmInfo.videoRobustness}):n||o.type!="audio"||i.push({contentType:et(o.mimeType,o.codecs),robustness:e.drmInfo.audioRobustness});return i}function iC(e,n,i){return P(function(r){return S(r,mC(e.g,e.h.drm,i,n),0)})}function rC(e,n,i){function r(){}var o=gC(i);return ap(n,i),Promise.all([e.removeSegments(o,r),e.removeManifests([n.key()],r)])}g.qj=function(){return dp(this,oC(this))};function oC(e){var n,i,r,o,s,u,a,l,c,d;return P(function(h){switch(h.g){case 1:return Fl(),n=e.g,i=e.h.drm,r=new $t,o=!1,li(h,2),S(h,r.init(),4);case 4:s=[],jI(r,function(p){return s.push(p)}),u=m(s),a=u.next();case 5:if(a.done){h.s(2);break}return l=a.value,S(h,l.getAll(),8);case 8:return c=h.h,S(h,J0(i,n,c),9);case 9:return d=h.h,S(h,l.remove(d),10);case 10:d.length!=c.length&&(o=!0),a=u.next(),h.s(5);break;case 2:return sn(h),S(h,r.destroy(),11);case 11:un(h,3);break;case 3:return h.return(!o)}})}g.list=function(){return dp(this,sC())};function sC(){var e,n,i;return P(function(r){switch(r.g){case 1:return Fl(),e=[],n=new $t,li(r,2),S(r,n.init(),4);case 4:return i=Promise.resolve(),NI(n,function(o,s){i=i.then(function(){var u;return P(function(a){if(a.g==1)return S(a,s.getAllManifests(),2);u=a.h,u.forEach(function(l,c){l=ap(new ri("manifest",o.zb,o.Qa,c),l),e.push(l)}),K(a)})})}),S(r,i,2);case 2:return sn(r),S(r,n.destroy(),6);case 6:un(r,3);break;case 3:return r.return(e)}})}function uC(e,n,i,r){var o,s,u,a,l;return P(function(c){if(c.g==1)return o=null,s=e.g,u={networkingEngine:s,filter:function(){return Promise.resolve()},makeTextStreamsForClosedCaptions:function(){},onTimelineRegionAdded:function(){},onEvent:function(){},onError:function(d){o=d},isLowLatencyMode:function(){return!1},updateDuration:function(){},newDrmInfo:function(){},onManifestUpdated:function(){},getBandwidthEstimate:function(){return r.abr.defaultBandwidthEstimate},onMetadata:function(){},disableStream:function(){},addFont:function(){}},i.configure(r.manifest),dn(e),S(c,i.start(n,u),2);if(c.g!=3)return a=c.h,dn(e),l=u1(a),S(c,Promise.all(ed(l,function(d){return d.createSegmentIndex()})),3);if(dn(e),o)throw o;return c.return(a)})}function aC(e,n,i){var r,o,s,u,a,l,c,d,h,p,f,y,T,v,x;return P(function(w){switch(w.g){case 1:return S(w,s1(e,n),2);case 2:if(r=w.h,r!="text/vtt")throw new R(1,2,2017,n);return S(w,cC(n,e.g,e.h.streaming.retryParameters),3);case 3:if(o=w.h,s=gs(r),!s)throw new R(2,2,2014,r);for(u=s(),a={periodStart:0,segmentStart:0,segmentEnd:i.presentationTimeline.getDuration(),vttOffset:0},l=oe(o),c=u.parseMedia(l,a,n,[]),d=[],h=m(c),p=h.next(),f={};!p.done;f={Ne:void 0,Mc:void 0},p=h.next())f.Mc=p.value,f.Ne=null,y=function(A){return function(){return A.Ne==null&&(A.Ne=ft([n],[A.Mc.payload])),A.Ne||[]}}(f),T=new J(f.Mc.startTime,f.Mc.endTime,y,0,null,null,0,0,1/0),f.Mc.payload.includes("#xywh")&&(v=f.Mc.payload.split("#xywh=")[1].split(","),v.length===4&&T.Ee({height:parseInt(v[3],10),positionX:parseInt(v[0],10),positionY:parseInt(v[1],10),width:parseInt(v[2],10)})),d.push(T);if(x=r,!d.length){w.s(4);break}return S(w,Nr(d[0].N()[0],e.g,e.h.manifest.retryParameters),5);case 5:x=w.h;case 4:return w.return({id:e.m++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new Ae(d),mimeType:x||"",codecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:"image",primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,tilesLayout:"1x1",accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([et(x||"","")]),isAudioMuxedInVideo:!1,baseOriginalId:null})}})}function lC(e,n,i,r,o,s,u){var a,l,c;return P(function(d){if(d.g==1)return s?d.s(2):S(d,s1(e,i),3);if(d.g!=2&&(s=d.h),a={id:e.m++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:Sa(0,n.presentationTimeline.getDuration(),[i]),mimeType:s||"",codecs:u||"",kind:o,encrypted:!1,drmInfos:[],keyIds:new Set,language:r,originalLanguage:r,label:null,type:ye,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([et(s||"",u||"")]),isAudioMuxedInVideo:!1,baseOriginalId:null},l=et(a.mimeType,a.codecs),c=so(l),!c)throw new R(2,2,2014,s);return d.return(a)})}function s1(e,n){var i;return P(function(r){switch(r.g){case 1:return ue(r,2),S(r,Nr(n,e.g,e.h.streaming.retryParameters),4);case 4:i=r.h,me(r,3);break;case 2:ae(r);case 3:if(i)return r.return(i);throw new R(1,2,2011,n)}})}function cC(e,n,i){var r,o,s;return P(function(u){return u.g==1?(r=_n,o=lt([e],i),o.method="GET",S(u,n.request(r,o).promise,2)):(s=u.h,u.return(s.data))})}g.Kc=function(e,n,i,r){var o=this,s;return P(function(u){return u.g==1?(s=new oa({Vb:o.g,onError:n,re:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),s.configure(i.drm),S(u,WS(s,e.variants,r),2)):u.g!=3?S(u,mg(s),3):u.return(s)})};function dC(e,n,i,r){var o=new Map,s=u1(i),u=new Map;s=m(s);for(var a=s.next();!a.done;a=s.next()){a=a.value;var l=hC(e,n,i,a,r,o);u.set(a.id,l)}for(e=m(i.variants),n=e.next();!n.done;n=e.next())n=n.value,n.audio&&u.get(n.audio.id).variantIds.push(n.id),n.video&&u.get(n.video.id).variantIds.push(n.id);return{streams:Array.from(u.values()),tg:Array.from(o.values())}}function hC(e,n,i,r,o,s){var u={id:r.id,originalId:r.originalId,groupId:r.groupId,primary:r.primary,type:r.type,mimeType:r.mimeType,codecs:r.codecs,frameRate:r.frameRate,pixelAspectRatio:r.pixelAspectRatio,hdr:r.hdr,colorGamut:r.colorGamut,videoLayout:r.videoLayout,kind:r.kind,language:r.language,originalLanguage:r.originalLanguage,label:r.label,width:r.width||null,height:r.height||null,encrypted:r.encrypted,keyIds:r.keyIds,segments:[],variantIds:[],roles:r.roles,forced:r.forced,channelsCount:r.channelsCount,audioSamplingRate:r.audioSamplingRate,spatialAudio:r.spatialAudio,closedCaptions:r.closedCaptions,tilesLayout:r.tilesLayout,mssPrivateData:r.mssPrivateData,external:r.external,fastSwitching:r.fastSwitching,isAudioMuxedInVideo:r.isAudioMuxedInVideo},a=o.offline.numberOfParallelDownloads,l=a===0?r.id:0;return pC(r,i.presentationTimeline.nb(),function(c,d){var h=np(c),p=void 0;if(!s.has(h)){var f=c.endTime-c.startTime;f=e1(n,r.id)*f,f=O0(e.g,f),s.set(h,new _0(c,f,l,!1,d))}c.Y&&(p=np(c.Y),s.has(p)||(f=.5*e1(n,r.id),f=O0(e.g,f),s.set(p,new _0(c.Y,f,l,!0,d)))),u.segments.push({pendingInitSegmentRefId:p,initSegmentKey:p?0:null,startTime:c.startTime,endTime:c.endTime,appendWindowStart:c.appendWindowStart,appendWindowEnd:c.appendWindowEnd,timestampOffset:c.timestampOffset,tilesLayout:c.tilesLayout,pendingSegmentRefId:h,dataKey:0,mimeType:c.mimeType,codecs:c.codecs,thumbnailSprite:c.thumbnailSprite}),a!==0&&(l=(l+1)%a)}),u}function pC(e,n,i){if(n=e.segmentIndex.find(n),n!=null)for(var r=e.segmentIndex.get(n);r;)i(r,n),r=e.segmentIndex.get(++n)}function dn(e){if(e.j.g)throw new R(2,9,7001)}function Fl(){if(!lp())throw new R(2,9,9e3)}function dp(e,n){return P(function(i){return i.g==1?(e.i.push(n),li(i,2),S(i,n,4)):i.g!=2?i.return(i.h):(sn(i),Ln(e.i,n),un(i,0))})}function fC(e,n){var i=n.promise;return e.i.push(i),n.finally(function(){Ln(e.i,i)})}function gC(e){var n=new Set;e=m(e.streams);for(var i=e.next();!i.done;i=e.next()){i=m(i.value.segments);for(var r=i.next();!r.done;r=i.next())r=r.value,r.initSegmentKey!=null&&n.add(r.initSegmentKey),n.add(r.dataKey)}return Array.from(n)}function mC(e,n,i,r){var o,s,u;return P(function(a){return a.g==1?r.drmInfo?(o=_I(i),s=r.sessionIds.map(function(l){return{sessionId:l,keySystem:r.drmInfo.keySystem,licenseUri:r.drmInfo.licenseServerUri,serverCertificate:r.drmInfo.serverCertificate,audioCapabilities:o1(r,!1),videoCapabilities:o1(r,!0)}}),S(a,J0(n,e,s),2)):a.return():a.g!=3?(u=a.h,S(a,o.remove(u),3)):S(a,o.add(s.filter(function(l){return!u.includes(l.sessionId)})),0)})}function u1(e){for(var n=new Set,i=m(e.variants),r=i.next();!r.done;r=i.next())r=r.value,r.audio&&n.add(r.audio),r.video&&n.add(r.video);for(i=m(e.textStreams),r=i.next();!r.done;r=i.next())n.add(r.value);for(e=m(e.imageStreams),i=e.next();!i.done;i=e.next())n.add(i.value);return n}function yC(e){e.variants.map(function(s){return s.video});var n=new Set(e.variants.map(function(s){return s.audio}));e=e.textStreams;for(var i=m(n),r=i.next();!r.done;r=i.next()){r=m(n);for(var o=r.next();!o.done;o=r.next());}for(n=m(e),i=n.next();!i.done;i=n.next())for(i=m(e),r=i.next();!r.done;r=i.next());}W("shaka.offline.Storage",yt),yt.deleteAll=function(){var e;return P(function(n){return n.g==1?(e=new $t,li(n,2),S(n,UI(e),2)):n.g!=5?(sn(n),S(n,e.destroy(),5)):un(n,0)})},yt.prototype.list=yt.prototype.list,yt.prototype.removeEmeSessions=yt.prototype.qj,yt.prototype.remove=yt.prototype.remove,yt.prototype.store=yt.prototype.store,yt.prototype.getNetworkingEngine=yt.prototype.xb,yt.prototype.getConfiguration=yt.prototype.getConfiguration,yt.prototype.configure=yt.prototype.configure,yt.prototype.destroy=yt.prototype.destroy,yt.support=lp;var vC=new Map().set("org.w3.clearkey","1077efecc0b24d02ace33c1e52e2fb4b").set("com.widevine.alpha","edef8ba979d64acea3c827dcd51d21ed").set("com.microsoft.playready","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.recommendation","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.software","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.hardware","9a04f07998404286ab92e65be0885f95").set("com.huawei.wiseplay","3d5e6d359b9a41e8b843dd3c6e72c42c");Km("offline",lp);function Rt(){}function Ft(e,n){for(e={priority:n||0,callback:e},n=0;n=e?(hp(),y1()):15>=e&&hp():nt("DT_STB_BCM")?(hp(),y1()):(nt("Tizen 2")||di()||nt("Tizen 4"))&&CC()),(F.MediaSource||F.ManagedMediaSource)&&IC(),F.MediaSource&&MediaSource.isTypeSupported('video/webm; codecs="vp9"')&&!MediaSource.isTypeSupported('video/webm; codecs="vp09.00.10.08"')&&MC()}function hp(){var e=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var n=e.apply(this,Et.apply(0,arguments));return n.abort=function(){},n}}function y1(){var e=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(n,i){return e.call(this,n,i-.001)}}function IC(){if(F.MediaSource){var e=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=function(i){return zu(i)!="mp2t"&&e(i)}}if(F.ManagedMediaSource){var n=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);F.ManagedMediaSource.isTypeSupported=function(i){return zu(i)!="mp2t"&&n(i)}}}function CC(){var e=MediaSource.isTypeSupported.bind(MediaSource);if(MediaSource.isTypeSupported=function(i){return Xi(i)!="opus"&&e(i)},F.ManagedMediaSource){var n=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);F.ManagedMediaSource.isTypeSupported=function(i){return Xi(i)!="opus"&&n(i)}}}function MC(){var e=MediaSource.isTypeSupported;hi()||(MediaSource.isTypeSupported=function(n){var i=n.split(/ *; */),r=i.findIndex(function(u){return u.startsWith("codecs=")});if(0>r)return e(n);var o=i[r].replace("codecs=","").replace(/"/g,"").split(/\s*,\s*/),s=o.findIndex(function(u){return u.startsWith("vp09")});return 0<=s&&(o[s]="vp9",i[r]='codecs="'+o.join(",")+'"',n=i.join("; ")),e(n)})}Rt.MediaSource=g1,g1.install=m1,Ft(m1);function v1(){}function T1(){screen.orientation&&screen.orientation.unlock||(screen.orientation!=null?kC():F.orientation!=null&&DC())}function kC(){screen.orientation.lock===void 0&&(screen.orientation.lock=function(){return Promise.resolve()}),screen.orientation.unlock===void 0&&(screen.orientation.unlock=function(){})}function DC(){function e(){switch(F.orientation){case-90:n.type="landscape-secondary",n.angle=270;break;case 0:n.type="portrait-primary",n.angle=0;break;case 90:n.type="landscape-primary",n.angle=90;break;case 180:n.type="portrait-secondary",n.angle=180}}var n=new Hl;screen.orientation=n,e(),F.addEventListener("orientationchange",function(){e();var i=new G("change");n.dispatchEvent(i)})}Rt.Orientation=v1,v1.install=T1;function Hl(){je.call(this),this.type="",this.angle=0}wt(Hl,je),Hl.prototype.lock=function(e){function n(r){return screen.lockOrientation?screen.lockOrientation(r):screen.mozLockOrientation?screen.mozLockOrientation(r):screen.msLockOrientation?screen.msLockOrientation(r):!1}var i=!1;switch(e){case"natural":i=n("default");break;case"any":i=!0,this.unlock();break;default:i=n(e)}return i?Promise.resolve():(e=Error("screen.orientation.lock() is not available on this device"),e.name="NotSupportedError",e.code=DOMException.NOT_SUPPORTED_ERR,Promise.reject(e))},Hl.prototype.unlock=function(){screen.unlockOrientation?screen.unlockOrientation():screen.mozUnlockOrientation?screen.mozUnlockOrientation():screen.msUnlockOrientation&&screen.msUnlockOrientation()},Ft(T1);function pp(){}var fp,gp,mp,yp,vp,Tp;function S1(e){F.HTMLVideoElement&&F.WebKitMediaKeys&&F.shakaMediaKeysPolyfill!=xp&&(e!==void 0&&e&&(fp=!0,gp=Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"mediaKeys"),mp=HTMLMediaElement.prototype.setMediaKeys,yp=F.MediaKeys,vp=F.MediaKeySystemAccess,Tp=navigator.requestMediaKeySystemAccess),delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=PC,F.MediaKeys=vu,F.MediaKeySystemAccess=Gl,navigator.requestMediaKeySystemAccess=RC,F.shakaMediaKeysPolyfill=xp,Qu.clear(),Wr.clear())}function RC(e,n){try{var i=new Gl(e,n);return Promise.resolve(i)}catch(r){return Promise.reject(r)}}function PC(e){var n=this.mediaKeys;return n&&n!=e&&x1(n,null),delete this.mediaKeys,(this.mediaKeys=e)?x1(e,this):Promise.resolve()}function LC(e){if(e=oe(e.initData),Gt(e).getUint32(0,!0)+4!=e.byteLength)throw new RangeError("Malformed FairPlay init data");e=Bi(e.subarray(4),!0),e=Pn(e);var n=new Event("encrypted");n.initDataType="skd",n.initData=vn(e),this.dispatchEvent(n)}Rt.PatchedMediaKeysApple=pp,pp.uninstall=function(){F.shakaMediaKeysPolyfill==xp&&fp&&(fp=!1,Object.defineProperty(HTMLMediaElement.prototype,"mediaKeys",gp),HTMLMediaElement.prototype.setMediaKeys=mp,F.MediaKeys=yp,F.MediaKeySystemAccess=vp,navigator.requestMediaKeySystemAccess=Tp,gp=Tp=mp=vp=yp=null,F.shakaMediaKeysPolyfill="",Qu.clear(),Wr.clear())},pp.install=S1;function Gl(e,n){if(this.keySystem=e,e.startsWith("com.apple.fps"))for(e=m(n),n=e.next();!n.done;n=e.next()){var i=n.value;if(i.persistentState=="required")n=null;else{n={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:i.initDataTypes,sessionTypes:["temporary"],label:i.label};var r=!1,o=!1;if(i.audioCapabilities)for(var s=m(i.audioCapabilities),u=s.next();!u.done;u=s.next())u=u.value,u.contentType&&(r=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,u.contentType.split(";")[0])&&(n.audioCapabilities.push(u),o=!0));if(i.videoCapabilities)for(i=m(i.videoCapabilities),s=i.next();!s.done;s=i.next())s=s.value,s.contentType&&(r=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,s.contentType.split(";")[0])&&(n.videoCapabilities.push(s),o=!0));r||(o=WebKitMediaKeys.isTypeSupported(this.keySystem,"video/mp4")),n=o?n:null}if(n){this.g=n;return}}throw e=Error("Unsupported keySystem"),e.name="NotSupportedError",e.code=DOMException.NOT_SUPPORTED_ERR,e}Gl.prototype.createMediaKeys=function(){var e=new vu(this.keySystem);return Promise.resolve(e)},Gl.prototype.getConfiguration=function(){return this.g};function vu(e){this.h=new WebKitMediaKeys(e),this.g=new Pe}vu.prototype.createSession=function(e){if(e=e||"temporary",e!="temporary")throw new TypeError("Session type "+e+" is unsupported on this platform.");return new Sp(this.h,e)},vu.prototype.setServerCertificate=function(){return Promise.resolve(!1)};function x1(e,n){if(e.g.Pa(),!n)return Promise.resolve();e.g.D(n,"webkitneedkey",LC);try{return Ao(n,HTMLMediaElement.HAVE_METADATA,e.g,function(){n.webkitSetMediaKeys(e.h)}),Promise.resolve()}catch(i){return Promise.reject(i)}}vu.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")};function Sp(e){je.call(this),this.i=null,this.l=e,this.g=this.h=null,this.j=new Pe,this.sessionId="",this.expiration=NaN,this.closed=new Ne,this.keyStatuses=new w1}wt(Sp,je),g=Sp.prototype,g.generateRequest=function(e,n){var i=this;this.h=new Ne;try{var r=this.l.createSession("video/mp4",oe(n));this.i=r,this.sessionId=r.sessionId||"",this.j.D(this.i,"webkitkeymessage",function(o){i.h&&(i.h.resolve(),i.h=null),o=new Map().set("messageType",i.keyStatuses.dc()==null?"license-request":"license-renewal").set("message",vn(o.message)),o=new G("message",o),i.dispatchEvent(o)}),this.j.D(r,"webkitkeyadded",function(){i.g&&(Kl(i,"usable"),i.g.resolve(),i.g=null)}),this.j.D(r,"webkitkeyerror",function(){var o=Error("EME PatchedMediaKeysApple key error");if(o.errorCode=i.i.error,i.h!=null)i.h.reject(o),i.h=null;else if(i.g!=null)i.g.reject(o),i.g=null;else switch(i.i.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:Kl(i,"output-not-allowed");break;default:Kl(i,"internal-error")}}),Kl(this,"status-pending")}catch(o){this.h.reject(o)}return this.h},g.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))},g.update=function(e){this.g=new Ne;try{this.i.update(oe(e))}catch(n){this.g.reject(n)}return this.g},g.close=function(){try{this.i.close(),this.closed.resolve(),this.j.Pa()}catch(e){this.closed.reject(e)}return this.closed},g.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))};function Kl(e,n){var i=e.keyStatuses;i.size=n==null?0:1,i.g=n,n=new G("keystatuseschange"),e.dispatchEvent(n)}function w1(){this.size=0,this.g=void 0}g=w1.prototype,g.dc=function(){return this.g},g.forEach=function(e){this.g&&e(this.g,_u.value())},g.get=function(e){if(this.has(e))return this.g},g.has=function(e){var n=_u.value();return!!(this.g&&ci(e,n))},g.entries=function(){},g.keys=function(){},g.values=function(){};var xp="apple";Ft(function(){F.HTMLVideoElement&&F.WebKitMediaKeys&&(navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||S1())});function E1(){}function A1(){F.MediaKeys&&(!MediaKeys.prototype.setServerCertificate||di()||nt("Tizen 4")||nt("Tizen 5.0")||Uu())&&(MediaKeys.prototype.setServerCertificate=NC)}function NC(){return Promise.resolve(!1)}Rt.PatchedMediaKeysCert=E1,E1.install=A1,Ft(A1);function I1(){}function C1(){if(!(!F.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)Cp="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;navigator.requestMediaKeySystemAccess=jC,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=_C,F.MediaKeys=Tu,F.MediaKeySystemAccess=Xl,F.shakaMediaKeysPolyfill=UC}}function wp(e){var n=Cp;return n?n+e.charAt(0).toUpperCase()+e.slice(1):e}function jC(e,n){try{var i=new Xl(e,n);return Promise.resolve(i)}catch(r){return Promise.reject(r)}}function _C(e){var n=this.mediaKeys;return n&&n!=e&&M1(n,null),delete this.mediaKeys,(this.mediaKeys=e)&&M1(e,this),Promise.resolve()}Rt.PatchedMediaKeysWebkit=I1,I1.install=C1;function Xl(e,n){this.g=this.keySystem=e;var i=!1;e=="org.w3.clearkey"&&(this.g="webkit-org.w3.clearkey",i=!1);var r=!1,o=document.getElementsByTagName("video");o=o.length?o[0]:document.createElement("video"),n=m(n);for(var s=n.next();!s.done;s=n.next()){s=s.value;var u={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:s.initDataTypes,sessionTypes:["temporary"],label:s.label},a=!1;if(s.audioCapabilities)for(var l=m(s.audioCapabilities),c=l.next();!c.done;c=l.next())c=c.value,c.contentType&&(a=!0,o.canPlayType(c.contentType.split(";")[0],this.g)&&(u.audioCapabilities.push(c),r=!0));if(s.videoCapabilities)for(l=m(s.videoCapabilities),c=l.next();!c.done;c=l.next())c=c.value,c.contentType&&(a=!0,o.canPlayType(c.contentType,this.g)&&(u.videoCapabilities.push(c),r=!0));if(a||(r=o.canPlayType("video/mp4",this.g)||o.canPlayType("video/webm",this.g)),s.persistentState=="required"&&(i?(u.persistentState="required",u.sessionTypes=["persistent-license"]):r=!1),r){this.h=u;return}}throw i="Unsupported keySystem",(e=="org.w3.clearkey"||e=="com.widevine.alpha")&&(i="None of the requested configurations were supported."),e=Error(i),e.name="NotSupportedError",e.code=DOMException.NOT_SUPPORTED_ERR,e}Xl.prototype.createMediaKeys=function(){var e=new Tu(this.g);return Promise.resolve(e)},Xl.prototype.getConfiguration=function(){return this.h};function Tu(e){this.l=e,this.h=null,this.g=new Pe,this.i=[],this.j=new Map}function M1(e,n){e.h=n,e.g.Pa();var i=Cp;n&&(e.g.D(n,i+"needkey",function(r){var o=new CustomEvent("encrypted");o.initDataType="cenc",o.initData=vn(r.initData),e.h.dispatchEvent(o)}),e.g.D(n,i+"keymessage",function(r){var o=Ep(e,r.sessionId);o&&(r=new Map().set("messageType",o.keyStatuses.dc()==null?"licenserequest":"licenserenewal").set("message",r.message),r=new G("message",r),o.h&&(o.h.resolve(),o.h=null),o.dispatchEvent(r))}),e.g.D(n,i+"keyadded",function(r){(r=Ep(e,r.sessionId))&&r.ready()}),e.g.D(n,i+"keyerror",function(r){var o=Ep(e,r.sessionId);if(o){var s=Error("EME v0.1b key error"),u=r.errorCode;u.systemCode=r.systemCode,s.errorCode=u,!r.sessionId&&o.h?(r.systemCode==45&&(s.message="Unsupported session type."),o.h.reject(s),o.h=null):r.sessionId&&o.g?(o.g.reject(s),o.g=null):(s=r.systemCode,r.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?Wl(o,"output-restricted"):s==1?Wl(o,"expired"):Wl(o,"internal-error"))}}))}Tu.prototype.createSession=function(e){if(e=e||"temporary",e!="temporary"&&e!="persistent-license")throw new TypeError("Session type "+e+" is unsupported on this platform.");var n=this.h||document.createElement("video");return n.src||(n.src="about:blank"),e=new Ap(n,this.l,e),this.i.push(e),e},Tu.prototype.setServerCertificate=function(){return Promise.resolve(!1)},Tu.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")};function Ep(e,n){var i=e.j.get(n);return i||((i=e.i.shift())?(i.sessionId=n,e.j.set(n,i),i):null)}function Ap(e,n,i){je.call(this),this.j=e,this.m=!1,this.g=this.h=null,this.i=n,this.l=i,this.sessionId="",this.expiration=NaN,this.closed=new Ne,this.keyStatuses=new D1}wt(Ap,je),g=Ap.prototype,g.ready=function(){Wl(this,"usable"),this.g&&this.g.resolve(),this.g=null};function k1(e,n,i){if(e.m)return Promise.reject(Error("The session is already initialized."));e.m=!0;try{if(e.l=="persistent-license")if(i)var r=oe(Pn("LOAD_SESSION|"+i));else{var o=Pn("PERSISTENT|");r=Qe(o,n)}else r=oe(n)}catch(u){return Promise.reject(u)}e.h=new Ne;var s=wp("generateKeyRequest");try{e.j[s](e.i,r)}catch(u){if(u.name!="InvalidStateError")return e.h=null,Promise.reject(u);new ve(function(){try{e.j[s](e.i,r)}catch(a){e.h.reject(a),e.h=null}}).da(.01)}return e.h}function Ip(e,n,i){if(e.g)e.g.then(function(){return Ip(e,n,i)}).catch(function(){return Ip(e,n,i)});else{if(e.g=n,e.i=="webkit-org.w3.clearkey"){var r=We(i),o=JSON.parse(r);o.keys[0].kty!="oct"&&(e.g.reject(Error("Response is not a valid JSON Web Key Set.")),e.g=null),r=Tn(o.keys[0].k),o=Tn(o.keys[0].kid)}else r=oe(i),o=null;var s=wp("addKey");try{e.j[s](e.i,r,o,e.sessionId)}catch(u){e.g.reject(u),e.g=null}}}function Wl(e,n){var i=e.keyStatuses;i.size=n==null?0:1,i.g=n,n=new G("keystatuseschange"),e.dispatchEvent(n)}g.generateRequest=function(e,n){return k1(this,n,null)},g.load=function(e){return this.l=="persistent-license"?k1(this,null,e):Promise.reject(Error("Not a persistent session."))},g.update=function(e){var n=new Ne;return Ip(this,n,e),n},g.close=function(){if(this.l!="persistent-license"){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var e=wp("cancelKeyRequest");try{this.j[e](this.i,this.sessionId)}catch{}}return this.closed.resolve(),this.closed},g.remove=function(){return this.l!="persistent-license"?Promise.reject(Error("Not a persistent session.")):this.close()};function D1(){this.size=0,this.g=void 0}g=D1.prototype,g.dc=function(){return this.g},g.forEach=function(e){this.g&&e(this.g,_u.value())},g.get=function(e){if(this.has(e))return this.g},g.has=function(e){var n=_u.value();return!!(this.g&&ci(e,n))},g.entries=function(){},g.keys=function(){},g.values=function(){};var Cp="",UC="webkit";Ft(C1);function R1(){}function P1(){if(F.HTMLVideoElement){var e=HTMLVideoElement.prototype;e.requestPictureInPicture&&document.exitPictureInPicture||!e.webkitSupportsPresentationMode||(document.pictureInPictureEnabled=!0,document.pictureInPictureElement=null,e.requestPictureInPicture=bC,Object.defineProperty(e,"disablePictureInPicture",{get:FC,set:VC,enumerable:!0,configurable:!0}),document.exitPictureInPicture=BC,document.addEventListener("webkitpresentationmodechanged",OC,!0))}}function OC(e){if(e=e.target,e.webkitPresentationMode=="picture-in-picture"){document.pictureInPictureElement=e;var n=new Event("enterpictureinpicture");e.dispatchEvent(n)}else document.pictureInPictureElement==e&&(document.pictureInPictureElement=null),n=new Event("leavepictureinpicture"),e.dispatchEvent(n)}function bC(){return this.webkitSupportsPresentationMode("picture-in-picture")?(this.webkitSetPresentationMode("picture-in-picture"),document.pictureInPictureElement=this,Promise.resolve()):Promise.reject(Error("PiP not allowed by video element"))}function BC(){var e=document.pictureInPictureElement;return e?(e.webkitSetPresentationMode("inline"),document.pictureInPictureElement=null,Promise.resolve()):Promise.reject(Error("No picture in picture element found"))}function FC(){return this.hasAttribute("disablePictureInPicture")?!0:!this.webkitSupportsPresentationMode("picture-in-picture")}function VC(e){e?this.setAttribute("disablePictureInPicture",""):this.removeAttribute("disablePictureInPicture")}Rt.PiPWebkit=R1,R1.install=P1,Ft(P1);function L1(){}function N1(){F.crypto&&("randomUUID"in F.crypto||(F.crypto.randomUUID=HC))}function HC(){var e=URL.createObjectURL(new Blob),n=e.toString();return URL.revokeObjectURL(e),n.substr(n.lastIndexOf("/")+1)}Rt.RandomUUID=L1,L1.install=N1,Ft(N1);function j1(){}function _1(){var e=Symbol.prototype;"description"in e||Object.defineProperty(e,"description",{get:GC})}function GC(){var e=/\((.*)\)/.exec(this.toString());return e?e[1]:void 0}Rt.Symbol=j1,j1.install=_1,Ft(_1);/* @license Shaka Player Copyright 2025 Google LLC SPDX-License-Identifier: Apache-2.0 */function U1(){}function O1(){for(var e=m([Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,Int8Array,Int16Array,Int32Array,Float32Array,Float64Array]),n=e.next();!n.done;n=e.next())n=n.value,n.prototype.indexOf||(n.prototype.indexOf=KC),n.prototype.lastIndexOf||(n.prototype.lastIndexOf=XC),n.prototype.includes||(n.prototype.includes=WC)}function KC(e,n){return Array.prototype.indexOf.call(this,e,n)}function XC(e,n){return Array.prototype.lastIndexOf.call(this,e,n)}function WC(e,n){return this.indexOf(e,n)!==-1}Rt.TypedArray=U1,U1.install=O1,Ft(O1);function b1(){}function B1(){if(F.HTMLMediaElement){var e=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var n=e.apply(this);return n&&n.catch(function(){}),n}}}Rt.VideoPlayPromise=b1,b1.install=B1,Ft(B1);function F1(){}function V1(){if(F.HTMLVideoElement){var e=HTMLVideoElement.prototype;!e.getVideoPlaybackQuality&&("webkitDroppedFrameCount"in e||Uu())&&(e.getVideoPlaybackQuality=zC)}}function zC(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}Rt.VideoPlaybackQuality=F1,F1.install=V1,Ft(V1);function H1(){}function G1(){if(!F.VTTCue&&F.TextTrackCue){var e=null,n=TextTrackCue.length;if(n==3)e=Mp;else if(n==6)e=qC;else{try{var i=!!Mp(1,2,"")}catch{i=!1}i&&(e=Mp)}e&&(F.VTTCue=function(r,o,s){return e(r,o,s)})}}function Mp(e,n,i){return new F.TextTrackCue(e,n,i)}function qC(e,n,i){return new F.TextTrackCue(e+"-"+n+"-"+i,e,n,i)}Rt.VTTCue=H1,H1.install=G1,Ft(G1);function hn(){}hn.prototype.parseInit=function(){},hn.prototype.setSequenceMode=function(){},hn.prototype.setManifestType=function(){},hn.prototype.parseMedia=function(e,n){var i=null,r=[];e=We(e).split(/\r?\n/),e=m(e);for(var o=e.next();!o.done;o=e.next())if((o=o.value)&&!/^\s+$/.test(o)&&(o=YC.exec(o))){var s=$C.exec(o[1]);s=60*parseInt(s[1],10)+parseFloat(s[2].replace(",",".")),o=new He(s,n.segmentEnd?n.segmentEnd:s+2,o[2]),i&&(i.endTime=s,r.push(i)),i=o}return i&&r.push(i),r},W("shaka.text.LrcTextParser",hn),hn.prototype.parseMedia=hn.prototype.parseMedia,hn.prototype.setManifestType=hn.prototype.setManifestType,hn.prototype.setSequenceMode=hn.prototype.setSequenceMode,hn.prototype.parseInit=hn.prototype.parseInit;var YC=/^\[(\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?)\](.*)/,$C=/^(\d+):(\d{1,2}(?:[.,]\d{1,3})?)$/;xt("application/x-subtitle-lrc",function(){return new hn});function rn(){}rn.prototype.parseInit=function(){},rn.prototype.setSequenceMode=function(){},rn.prototype.setManifestType=function(){},rn.prototype.parseMedia=function(e,n,i,r){var o=We(e);if(e=[],o=="")return e;var s=mr(o,"tt",!0);if(!s)throw new R(2,2,2005,"Failed to parse TTML.");if(o=Kn(s,"body")[0],!o)return[];var u=ei(s,Su,"frameRate"),a=ei(s,Su,"subFrameRate"),l=ei(s,Su,"frameRateMultiplier"),c=ei(s,Su,"tickRate"),d=ei(s,Su,"cellResolution"),h=s.attributes["xml:space"]||"default",p=ei(s,Yl,"extent");if(h!="default"&&h!="preserve")throw new R(2,2,2005,"Invalid xml:space value: "+h);h=h=="default",u=new tM(u,a,l,c),d=eM(d),a=Kn(s,"metadata")[0],a=(a?a.children:[]).filter(function(T){return T!=` `}),l=Kn(s,"style"),s=Kn(s,"region"),c=[];for(var f=m(s),y=f.next();!y.done;y=f.next())(y=QC(y.value,l,p))&&c.push(y);if(De(o,"p").length)throw new R(2,2,2001,"

can only be inside

in TTML");for(p=m(De(o,"div")),f=p.next();!f.done;f=p.next())if(De(f.value,"span").length)throw new R(2,2,2001," can only be inside

in TTML");return(n=K1(o,n,u,a,l,s,c,h,d,null,!1,i,r))&&(n.backgroundColor||(n.backgroundColor="transparent"),e.push(n)),e};function K1(e,n,i,r,o,s,u,a,l,c,d,h,p){var f=c;if(Fu(e)){if(!d)return null;var y={tagName:"span",children:[st(e)],attributes:{},parent:null}}else y=e;for(var T=null,v=m(eT),x=v.next();!x.done&&!(T=ql(y,"backgroundImage",r,"#",x.value)[0]);x=v.next());v=null,x=ei(y,eT,"backgroundImage");var w=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/;if(x&&w.test(x)){if(v=parseInt(x.split(":").pop(),10)-1,v>=p.length)return null;v=p[v]}else h&&x&&!x.startsWith("#")&&(w=new $e(h),x=new $e(x),(x=w.resolve(x).toString())&&(v=x));if((e.tagName=="p"||T||v)&&(d=!0),e=d,x=(y.attributes["xml:space"]||(a?"default":"preserve"))=="default",w=y.children.every(Fu),a=[],!w)for(var A=m(y.children),I=A.next();!I.done;I=A.next())(I=K1(I.value,n,i,r,o,s,u,x,l,y,d,h,p))&&a.push(I);if(r=c!=null,h=st(y),h=y.children.length&&h&&/\S/.test(h),A=y.attributes.begin||y.attributes.end||y.attributes.dur,!(A||h||y.tagName=="br"||a.length!=0||r&&!x))return null;for(p=z1(y,i),h=p.start,p=p.end;f&&f.tagName&&f.tagName!="tt";)p=ZC(f,i,h,p),h=p.start,p=p.end,f=f.parent;if(h==null&&(h=0),h+=n.periodStart,p=p==null?1/0:p+n.periodStart,h=Math.max(h,n.segmentStart),p=Math.min(p,n.segmentEnd),!A&&0i.length)return s;var u=e;for(e=null;!e&&!(e=o?gi(u,o,n):u.attributes[n])&&(u=u.parent,u););if(n=e){for(n=m(n.split(" ")),o=n.next();!o.done;o=n.next())for(o=o.value,e=m(i),u=e.next();!u.done;u=e.next())if(u=u.value,r+u.attributes["xml:id"]==o){s.push(u);break}}return s}function ZC(e,n,i,r){return e=z1(e,n),i==null?i=e.start:e.start!=null&&(i+=e.start),r==null?r=e.end:e.start!=null&&(r+=e.start),{start:i,end:r}}function z1(e,n){var i=Rp(e.attributes.begin,n),r=Rp(e.attributes.end,n);return e=Rp(e.attributes.dur,n),r==null&&e!=null&&(r=i+e),{start:i,end:r}}function Rp(e,n){var i=null;if(q1.test(e)){e=q1.exec(e),i=Number(e[1]);var r=Number(e[2]),o=Number(e[3]),s=Number(e[4]);s+=(Number(e[5])||0)/n.h,o+=s/n.frameRate,i=o+60*r+3600*i}else if(Y1.test(e))i=Pp(Y1,e);else if($1.test(e))i=Pp($1,e);else if(Q1.test(e))e=Q1.exec(e),i=Number(e[1])/n.frameRate;else if(J1.test(e))e=J1.exec(e),i=Number(e[1])/n.g;else if(Z1.test(e))i=Pp(Z1,e);else if(e)throw new R(2,2,2001,"Could not parse cue time range in TTML");return i}function Pp(e,n){return e=e.exec(n),e==null||e[0]==""?null:(Number(e[4])||0)/1e3+(Number(e[3])||0)+60*(Number(e[2])||0)+3600*(Number(e[1])||0)}function eM(e){return e&&(e=/^(\d+) (\d+)$/.exec(e))?{pc:parseInt(e[1],10),rows:parseInt(e[2],10)}:null}W("shaka.text.TtmlTextParser",rn),rn.prototype.parseMedia=rn.prototype.parseMedia,rn.prototype.setManifestType=rn.prototype.setManifestType,rn.prototype.setSequenceMode=rn.prototype.setSequenceMode,rn.prototype.parseInit=rn.prototype.parseInit;function tM(e,n,i,r){this.frameRate=Number(e)||30,this.h=Number(n)||1,this.g=Number(r),this.g==0&&(this.g=e?this.frameRate*this.h:1),i&&(e=/^(\d+) (\d+)$/g.exec(i))&&(this.frameRate*=Number(e[1])/Number(e[2]))}var Lp=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,nM=/^(\d{1,4}(?:\.\d+)?|100)%$/,Wo=/^(\d+px|\d+em|\d*\.?\d+c)$/,Np=/^(\d+)px (\d+)px$/,q1=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Y1=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,$1=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,Q1=/^(\d*(?:\.\d*)?)f$/,J1=/^(\d*(?:\.\d*)?)t$/,Z1=RegExp("^(?:(\\d*(?:\\.\\d*)?)h)?(?:(\\d*(?:\\.\\d*)?)m)?(?:(\\d*(?:\\.\\d*)?)s)?(?:(\\d*(?:\\.\\d*)?)ms)?$"),iM=new Map().set("left",vr).set("center","center").set("right","end").set("start",vr).set("end","end"),rM=new Map().set("left","line-left").set("center","center").set("right","line-right"),Su=["http://www.w3.org/ns/ttml#parameter","http://www.w3.org/2006/10/ttaf1#parameter"],Yl=["http://www.w3.org/ns/ttml#styling","http://www.w3.org/2006/10/ttaf1#styling"],eT=["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt","http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];xt("application/ttml+xml",function(){return new rn});function dt(){this.g=new rn}dt.prototype.parseInit=function(e){var n=!1;if(new _e().box("moov",he).box("trak",he).box("mdia",he).box("minf",he).box("stbl",he).R("stsd",Ei).box("stpp",function(i){n=!0,i.parser.stop()}).parse(e),!n)throw new R(2,2,2007)},dt.prototype.setSequenceMode=function(){},dt.prototype.setManifestType=function(){},dt.prototype.parseMedia=function(e,n,i){var r=[],o=null,s=[],u=new Map,a=[];if(new _e().box("moof",he).box("traf",he).R("tfhd",function(x){o=aa(x.reader,x.flags).kd}).R("trun",function(x){x=da(x.reader,x.version,x.flags),x=m(x.fg);for(var w=x.next();!w.done;w=x.next())a.push(w.value.sampleSize||o||0)}).R("subs",function(x){for(var w=x.reader,A=w.S(),I=-1,k=0;k")||(s=c[0],c.splice(0,1)),a=new eo(c[0]),u=as(a),h=pr(a,/[ \t]+--\x3e[ \t]+/g),l=as(a),u==null||h==null||l==null)Ee("Failed to parse VTT time code. Cue skipped:",s,c),s=null;else{for(u+=d,l+=d,d=c.slice(1).join(` `).trim(),r.has("global")?(c=r.get("global").clone(),c.startTime=u,c.endTime=l,c.payload=d):c=new He(u,l,d),to(a),u=fr(a);u;)tT(c,u,n),to(a),u=fr(a);Xu(c,r),s!=null&&(c.id=s),s=c}s&&o.push(s)}return o};function tT(e,n,i){var r;(r=/^align:(start|middle|center|end|left|right)$/.exec(n))?(n=r[1],n=="middle"?e.textAlign=ni:e.textAlign=Uc[n.toUpperCase()]):(r=/^vertical:(lr|rl)$/.exec(n))?e.writingMode=r[1]=="lr"?"vertical-lr":"vertical-rl":(r=/^size:([\d.]+)%$/.exec(n))?e.size=Number(r[1]):(r=/^position:([\d.]+)%(?:,(line-left|line-right|middle|center|start|end|auto))?$/.exec(n))?(e.position=Number(r[1]),r[2]&&(n=r[2],e.positionAlign=n=="line-left"||n=="start"?"line-left":n=="line-right"||n=="end"?"line-right":n=="center"||n=="middle"?"center":Wu)):(r=/^region:(.*)$/.exec(n))?(n=oM(i,r[1]))&&(e.region=n):(i=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(n))?(e.lineInterpretation=1,e.line=Number(i[1]),i[2]&&(e.lineAlign=Oc[i[2].toUpperCase()])):(i=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(n))&&(e.lineInterpretation=fs,e.line=Number(i[1]),i[2]&&(e.lineAlign=Oc[i[2].toUpperCase()]))}function oM(e,n){return e=e.filter(function(i){return i.id==n}),e.length?e[0]:null}W("shaka.text.VttTextParser",Vt),Vt.prototype.parseMedia=Vt.prototype.parseMedia,Vt.prototype.setManifestType=Vt.prototype.setManifestType,Vt.prototype.setSequenceMode=Vt.prototype.setSequenceMode,Vt.prototype.parseInit=Vt.prototype.parseInit,xt("text/vtt",function(){return new Vt}),xt('text/vtt; codecs="vtt"',function(){return new Vt}),xt('text/vtt; codecs="wvtt"',function(){return new Vt});function pn(){this.g=null}pn.prototype.parseInit=function(e){var n=this,i=!1;if(new _e().box("moov",he).box("trak",he).box("mdia",he).R("mdhd",function(r){r=ca(r.reader,r.version),n.g=r.timescale}).box("minf",he).box("stbl",he).R("stsd",Ei).box("wvtt",function(){i=!0}).parse(e),!this.g)throw new R(2,2,2008);if(!i)throw new R(2,2,2008)},pn.prototype.setSequenceMode=function(){},pn.prototype.setManifestType=function(){},pn.prototype.parseMedia=function(e,n){if(!e.length)return[];if(!this.g)throw new R(2,2,2008);var i=0,r=[],o,s=[],u=!1,a=!1,l=!1,c=null;if(new _e().box("moof",he).box("traf",he).R("tfdt",function(A){u=!0,i=la(A.reader,A.version).baseMediaDecodeTime}).R("tfhd",function(A){c=aa(A.reader,A.flags).jd}).R("trun",function(A){a=!0,r=da(A.reader,A.version,A.flags).fg}).box("mdat",po(function(A){l=!0,o=A})).parse(e,!1),!l&&!u&&!a)throw new R(2,2,2008);e=i;for(var d=new Ge(o,0),h=m(r),p=h.next();!p.done;p=h.next()){p=p.value;var f=p.gg||c,y=p.ze?i+p.ze:e;e=y+(f||0);var T=0;do{var v=d.S();T+=v;var x=d.S(),w=null;ia(x)=="vttc"?8").replace(/{\/b}/g,"").replace(/{i}/g,"").replace(/{\/i}/g,"").replace(/{u}/g,"").replace(/{\/u}/g,"")+` `;return n}W("shaka.text.SrtTextParser",on),on.srt2webvtt=nT,on.prototype.parseMedia=on.prototype.parseMedia,on.prototype.setManifestType=on.prototype.setManifestType,on.prototype.setSequenceMode=on.prototype.setSequenceMode,on.prototype.parseInit=on.prototype.parseInit,xt("text/srt",function(){return new on});function gn(){}gn.prototype.parseInit=function(){},gn.prototype.setSequenceMode=function(){},gn.prototype.setManifestType=function(){},gn.prototype.parseMedia=function(e){var n="",i="",r=null,o=null;for(o=We(e).split(/\r?\n\s*\r?\n/),e=m(o),o=e.next();!o.done;o=e.next()){var s=o.value;o=s,(s=lM.exec(s))&&(r=s[1],o=s[2]),r=="V4 Styles"||r=="V4+ Styles"?(n=o,n=i?n+(` `+o):o):r=="Events"&&(i=i?i+(` `+o):o)}for(r=[],o=null,n=m(n.split(/\r?\n/)),e=n.next();!e.done;e=n.next())if(e=e.value,!/^\s*;/.test(e)&&(s=oT.exec(e))){if(e=s[1].trim(),s=s[2].trim(),e=="Format")o=s.split($l);else if(e=="Style"){e=s.split($l),s={};for(var u=0;u>8&255)+","+(e>>16&255)+","+(e>>24&255^255)/255+")":null}function rT(e){return e=cM.exec(e),3600*(e[1]?parseInt(e[1].replace(":",""),10):0)+60*parseInt(e[2],10)+parseFloat(e[3])}W("shaka.text.SsaTextParser",gn),gn.prototype.parseMedia=gn.prototype.parseMedia,gn.prototype.setManifestType=gn.prototype.setManifestType,gn.prototype.setSequenceMode=gn.prototype.setSequenceMode,gn.prototype.parseInit=gn.prototype.parseInit;var lM=/^\s*\[([^\]]+)\]\r?\n([\s\S]*)/,oT=/^\s*([^:]+):\s*(.*)/,$l=/\s*,\s*/,cM=/^(\d+:)?(\d{1,2}):(\d{1,2}(?:[.]\d{1,3})?)?$/;xt("text/x-ssa",function(){return new gn});function sT(e,n){var i=e[n+1]&1?7:9;return n+i<=e.length&&(e=((e[n+3]&3)<<11|e[n+4]<<3|(e[n+5]&224)>>>5)-i,0>>2;if(r>i.length-1)return null;var o=((e[n+2]&192)>>>6)+1,s=(e[n+2]&1)<<2;return s|=(e[n+3]&192)>>>6,{sampleRate:i[r],channelCount:s,codec:"mp4a.40."+o}}function aT(e,n){if(n+1=e.length)return!1;var r=(e[n+3]&3)<<11|e[n+4]<<3|(e[n+5]&224)>>>5;return r<=i?!1:(n+=r,n===e.length||n+1e.length||e[n]!==11||e[n+1]!==119)return null;var i=e[n+4]>>6;if(3<=i)return null;var r=e[n+4]&63,o=2*[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][3*r+i];if(n+o>e.length)return null;var s=e[n+6]>>5,u=0;s===2?u+=2:(s&1&&s!==1&&(u+=2),s&4&&(u+=2)),u=(e[n+6]<<8|e[n+7])>>12-u&1;var a=e[n+5]&7;return e=new Uint8Array([i<<6|e[n+5]>>3<<1|a>>2,(a&3)<<6|s<<3|u<<2|r>>4,r<<4&224]),{sampleRate:[48e3,44100,32e3][i],channelCount:[2,1,2,3,3,4,4,5][s]+u,ra:e,ia:o}}function hM(e,n){if(e[n]===11&&e[n+1]===119){var i=0,r=5;n+=r;for(var o,s;0>>24+a<>a,i=i?i<i)return!0}return!1}function An(e){this.j=e,this.h=0,this.g=new Map,this.i=null}g=An.prototype,g.destroy=function(){this.g.clear()},g.isSupported=function(e){return e.toLowerCase().split(";")[0]=="audio/ac3"?St(this.convertCodecs("audio",e)):!1},g.convertCodecs=function(e,n){return n.toLowerCase().split(";")[0]=="audio/ac3"?di()?'audio/mp4; codecs="ec-3"':'audio/mp4; codecs="ac-3"':n},g.getOriginalMimeType=function(){return this.j},g.transmux=function(e,n,i,r){e=oe(e);for(var o=yo(e),s=o.length;se.length||(e[n]<<8|e[n+1]<<0)!==2935)return null;var i=new Ci(e.subarray(n+2));nn(i,2),nn(i,3);var r=Se(i,11)+1<<1,o=Se(i,2);if(o==3){o=Se(i,2),o=[24e3,22060,16e3][o];var s=3}else o=[48e3,44100,32e3][o],s=Se(i,2);var u=Se(i,3),a=Se(i,1);return i=Se(i,5),n+r>e.byteLength?null:(e=Math.floor(r*o/(16*[1,2,3,6][s])),e=new Uint8Array([(e&8160)>>5,(e&31)<<3,o<<6|i<<1|0,0|u<<1|a<<0,0]),{sampleRate:o,channelCount:[2,1,2,3,3,4,4,5][u]+a,ra:e,ia:r})}function In(e){this.j=e,this.h=0,this.g=new Map,this.i=null}g=In.prototype,g.destroy=function(){this.g.clear()},g.isSupported=function(e){return e.toLowerCase().split(";")[0]=="audio/ec3"?St(this.convertCodecs("audio",e)):!1},g.convertCodecs=function(e,n){return n.toLowerCase().split(";")[0]=="audio/ec3"?'audio/mp4; codecs="ec-3"':n},g.getOriginalMimeType=function(){return this.j},g.transmux=function(e,n,i,r){e=oe(e);for(var o=yo(e),s=o.length;so?ga(i,16):ga(i,64))}if(zt(i),r=z(i),r===0)z(i);else if(r===1)for(nn(i,1),zt(i),zt(i),r=z(i),o=0;o=p?(r=f[p-1],o=y[p-1]):p===255&&(r=Se(i,16),o=Se(i,16))}return i=(2-a)*(u+1)*16-2*d-2*h,s=16*(s+1)-2*l-2*c,l=[],n=n.fullData,l.push(n.byteLength>>>8&255),l.push(n.byteLength&255),l=l.concat.apply(l,X(n)),n=[],e=e.fullData,n.push(e.byteLength>>>8&255),n.push(e.byteLength&255),n=n.concat.apply(n,X(e)),e=new Uint8Array([1,l[3],l[4],l[5],255,225].concat(l,[1],n)),{height:i,width:s,Ca:e,Ia:r,Ka:o}}function fM(e){function n(y){o={data:new Uint8Array([]),frame:!1,isKeyframe:!1,pts:y.pts,dts:y.dts,nalus:[]}}function i(){if(o&&o.nalus.length&&o.frame){for(var y=[],T=m(o.nalus),v=T.next();!v.done;v=T.next()){v=v.value;var x=v.fullData.byteLength,w=new Uint8Array(4);w[0]=x>>24&255,w[1]=x>>16&255,w[2]=x>>8&255,w[3]=x&255,y.push(w),y.push(v.fullData)}o.data=Qe.apply(At,X(y)),r.push(o)}}for(var r=[],o=null,s=!1,u=0;uC;C++)Se(e,2);for(C=0;C_;_++)for(var j=0;j<(_===3?2:6);j++)if(Q(e)){var L=Math.min(64,1<<4+(_<<1));1<_&&vo(e);for(var N=0;N=L?(D=N[L-1],_=U[L-1]):L===255&&(D=Se(e,16),_=Se(e,16))),Q(e)&&Q(e),Q(e)&&(Se(e,3),Q(e),Q(e)&&(ke(e),ke(e),ke(e))),Q(e)&&(z(e),z(e)),Q(e),Q(e),Q(e),(L=Q(e))&&(z(e),z(e),z(e),z(e)),Q(e)&&(Se(e,32),Se(e,32),Q(e)&&z(e),Q(e)))for(U=!1,L=Q(e),N=Q(e),(L||N)&&((U=Q(e))&&(ke(e),Se(e,5),Q(e),Se(e,5)),Se(e,4),Se(e,4),U&&Se(e,4),Se(e,5),Se(e,5),Se(e,5)),O=0;O<=s;O++){var V=!0;b=1,Q(e)||(V=Q(e));var H=!1;if(V?z(e):H=Q(e),H||(b=z(e)+1),L){for(V=0;V>8,o[14]=r.ne&255,o[15]=252|r.Wf&3,o[16]=252|r.ff&3,o[17]=248|r.ef&7,o[18]=248|r.df&7,o[19]=0,o[20]=0,o[21]=(r.hf&3)<<6|(r.Uf&7)<<3|(r.rg?1:0)<<2|3,o[22]=3,o[23]=160,o[24]=0,o[25]=1,o[26]=(e.byteLength&65280)>>8,o[27]=(e.byteLength&255)>>0,o.set(e,28),o[23+(5+e.byteLength)]=161,o[e.byteLength+29]=0,o[e.byteLength+30]=1,o[e.byteLength+31]=(n.byteLength&65280)>>8,o[e.byteLength+32]=(n.byteLength&255)>>0,o.set(n,e.byteLength+33),o[23+(e.byteLength+10+n.byteLength)]=162,o[e.byteLength+10+n.byteLength+24]=0,o[e.byteLength+10+n.byteLength+25]=1,o[e.byteLength+10+n.byteLength+26]=(i.byteLength&65280)>>8,o[e.byteLength+10+n.byteLength+27]=(i.byteLength&255)>>0,o.set(i,e.byteLength+10+n.byteLength+28),o}function Ql(e,n){var i=e[n+1]>>3&3,r=e[n+1]>>1&3,o=e[n+2]>>4&15,s=e[n+2]>>2&3;if(i!==1&&o!==0&&o!==15&&s!==3){var u=e[n+3]>>6;o=1e3*xM[14*(i===3?3-r:r===3?3:4)+o-1],s=wM[3*(i===3?0:i===2?1:2)+s],i=EM[i][r];var a=AM[r],l=Math.floor(i*o/s+(e[n+2]>>1&1))*a,c=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);return(c=c?parseInt(c[1],10):0)&&87>=c&&r===2&&224e3<=o&&u===0&&(e[n+3]|=128),{sampleRate:s,channelCount:u===3?1:2,ia:l,tj:8*i*a}}return null}function dT(e,n){return e[n]===255&&(e[n+1]&224)===224&&(e[n+1]&6)!==0}function hT(e,n){if(n+1r;r++)this.usertype[r]!==CM[r]&&(i=!1);i&&(this._parsing&&(this.type="sepiff"),n.call(this))})}g=yn.prototype,g.destroy=function(){},g.isSupported=function(e,n){var i=e.startsWith("mss/");return!this.g||!i?!1:n?St(this.convertCodecs(n,e)):(n=this.convertCodecs("audio",e),e=this.convertCodecs("video",e),St(n)||St(e))},g.convertCodecs=function(e,n){return n.replace("mss/","")},g.getOriginalMimeType=function(){return this.h},g.transmux=function(e,n,i){if(!i)return Promise.resolve(oe(e));if(!n.mssPrivateData)return Promise.reject(new R(2,3,3020,i?i.N()[0]:null));try{var r,o=this.g.parseBuffer(e),s=o.fetch("tfhd");s.track_ID=n.id+1;var u=o.fetch("tfdt"),a=o.fetch("traf");u===null&&(u=this.g.createFullBox("tfdt",a,s),u.version=1,u.flags=0,u.baseMediaDecodeTime=Math.floor(i.startTime*n.mssPrivateData.timescale));var l=o.fetch("trun"),c=o.fetch("tfxd");c&&c._parent.boxes.splice(c._parent.boxes.indexOf(c),1);var d=o.fetch("tfrf");d&&d._parent.boxes.splice(d._parent.boxes.indexOf(d),1);var h=o.fetch("sepiff");if(h!==null){h.type="senc",h.usertype=void 0;var p=o.fetch("saio");if(p===null){p=this.g.createFullBox("saio",a),p.version=0,p.flags=0,p.entry_count=1,p.offset=[0];var f=this.g.createFullBox("saiz",a);if(f.version=0,f.flags=0,f.sample_count=h.sample_count,f.default_sample_info_size=0,f.sample_info_size=[],h.flags&2)for(r=0;r>24&255,Re[1]=Me>>16&255,Re[2]=Me>>8&255,Re[3]=Me&255,O.push(Re),O.push(ce.fullData)}}var fe=O.length?{data:Qe.apply(At,X(O)),isKeyframe:U}:null;if(fe){M==null&&L.dts!=null&&(M=L.dts);var se=void 0;se=j+1<_.length?(_[j+1].dts||0)-(L.dts||0):1<_.length?(L.dts||0)-(_[j-1].dts||0):9e4*(i.endTime-i.startTime),E.push({data:fe.data,size:fe.data.byteLength,duration:se,bb:Math.round((L.pts||0)-(L.dts||0)),flags:{fb:0,Ya:0,Xa:0,Va:0,Wa:fe.isKeyframe?2:1,gb:fe.isKeyframe?0:1}})}}var Ie=mM(D);if(!Ie||M==null)throw new R(2,3,3018,i?i.N()[0]:null);n.height=Ie.height,n.width=Ie.width,h={id:n.id,type:"video",codecs:"hvc1",encrypted:n.encrypted&&0>>24&255,oi.sampleRate>>>17&255,oi.sampleRate>>>8&255,oi.sampleRate>>>0&255,0,0].concat(X(Ht))),BT=oi.sampleRate,FT=m(l.cb()),zp=FT.next();!zp.done;zp=FT.next()){var qp=zp.value,Jo=qp.data;oc==null&&qp.pts!==null&&(oc=qp.pts);for(var Au=0;Au-1?"Firefox: Please enable casting, click here: https://googlechromecast.com/how-to-cast-firefox-to-tv/":navigator.userAgent.toLowerCase().indexOf("opr/")>-1?"Opera: Please enable casting, click here: https://googlechromecast.com/how-to-cast-opera-browser-to-tv-using-google-chromecast/":navigator.userAgent.toLowerCase().indexOf("iron safari")>-1?"Iron Safari: Please enable casting, click here: https://googlechromecast.com/how-to-cast-opera-browser-to-tv-using-google-chromecast/":navigator.brave?"Brave: Please enable casting, click here: https://googlechromecast.com/how-to-cast-brave-browser-to-chromecast/":"This Browser"}_init(xe=0){if(!window.chrome||!window.chrome.cast||!window.chrome.cast.isAvailable)return xe++>20?this.trigger("error","Casting is not enabled in "+this._getBrowser()):setTimeout(this._init.bind(this),250,xe);clearInterval(this.intervalIsAvailable),cast.framework.CastContext.getInstance().setOptions({receiverApplicationId:this.receiver,autoJoinPolicy:this.joinpolicy,language:"en-US",resumeSavedSession:!0}),this._player=new cast.framework.RemotePlayer,this._controller=new cast.framework.RemotePlayerController(this._player),this._controller.addEventListener("isConnectedChanged",this._isConnectedChanged.bind(this)),this._controller.addEventListener("isMediaLoadedChanged",this._isMediaLoadedChanged.bind(this)),this._controller.addEventListener("isMutedChanged",this._isMutedChanged.bind(this)),this._controller.addEventListener("isPausedChanged",this._isPausedChanged.bind(this)),this._controller.addEventListener("currentTimeChanged",this._currentTimeChanged.bind(this)),this._controller.addEventListener("durationChanged",this._durationChanged.bind(this)),this._controller.addEventListener("volumeLevelChanged",this._volumeLevelChanged.bind(this)),this._controller.addEventListener("playerStateChanged",this._playerStateChanged.bind(this)),this.available=!0,this.trigger("available")}_isMediaLoadedChanged(){this._player.isMediaLoaded&&setTimeout(()=>{if(this._player.mediaInfo){for(var xe in this.device=cast.framework.CastContext.getInstance().getCurrentSession().getCastDevice().friendlyName||this.device,this.src=this._player.mediaInfo.contentId,this.title=this._player.title||null,this.description=this._player.mediaInfo.metadata.subtitle||null,this.poster=this._player.imageUrl||null,this.subtitles=[],this.volumeLevel=this.volumeLevel=Number(this._player.volumeLevel.toFixed(1)),this.muted=this._player.isMuted,this.paused=this._player.isPaused,this.time=Math.round(this._player.currentTime,1),this.timePretty=this._controller.getFormattedTime(this.time),this.duration=this._player.duration,this.durationPretty=this._controller.getFormattedTime(this._player.duration),this.progress=this._controller.getSeekPosition(this.time,this._player.duration),this.state=this._player.playerState.toLowerCase(),this._player.mediaInfo.tracks)this._player.mediaInfo.tracks[xe].type==="TEXT"&&this.subtitles.push({label:this._player.mediaInfo.tracks[xe].name,src:this._player.mediaInfo.tracks[xe].trackContentId});var at=cast.framework.CastContext.getInstance().getCurrentSession().getSessionObj().media[0].activeTrackIds;at&&at.length&&this.subtitles[at[0]]&&(this.subtitles[at[0]].active=!0)}})}_isConnectedChanged(){this.connected=this._player.isConnected,this.connected&&(this.device=cast.framework.CastContext.getInstance().getCurrentSession().getCastDevice().friendlyName||this.device),this.state=this.connected?"connected":"disconnected",this.trigger("statechange"),this.trigger(this.connected?"connect":"disconnect")}_currentTimeChanged(){var xe=this.time;this.time=Math.round(this._player.currentTime,1),this.duration=this._player.duration,this.progress=this._controller.getSeekPosition(this.time,this.duration),this.timePretty=this._controller.getFormattedTime(this.time),this.durationPretty=this._controller.getFormattedTime(this.duration),(xe!=this.time||this._player.isPaused)&&this.trigger("timeupdate")}_durationChanged(){this.duration=this._player.duration}_volumeLevelChanged(){this.volumeLevel=Number(this._player.volumeLevel.toFixed(1)),this._player.isMediaLoaded&&this.trigger("volumechange")}_isMutedChanged(){var xe=this.muted;this.muted=this._player.isMuted,xe!=this.muted&&this.trigger(this.muted?"mute":"unmute")}_isPausedChanged(){this.paused=this._player.isPaused,this.paused&&this.trigger("pause")}_playerStateChanged(){if(this.connected=this._player.isConnected,this.connected)switch(this.device=cast.framework.CastContext.getInstance().getCurrentSession().getCastDevice().friendlyName||this.device,this.state=this._player.playerState.toLowerCase(),this.state){case"idle":return this.state="ended",this.trigger("statechange"),this.trigger("end"),this;case"buffering":return this.time=Math.round(this._player.currentTime,1),this.duration=this._player.duration,this.progress=this._controller.getSeekPosition(this.time,this.duration),this.timePretty=this._controller.getFormattedTime(this.time),this.durationPretty=this._controller.getFormattedTime(this.duration),this.trigger("statechange"),this.trigger("buffering"),this;case"playing":return setTimeout(()=>{this.trigger("statechange"),this.trigger("playing")}),this}}on(xe,at){return this._events[xe]||(this._events[xe]=[]),this._events[xe].push(at),xe==="available"&&this.available===!0&&setTimeout(()=>at(),0),this}off(xe){return xe?this._events[xe]&&(this._events[xe]=[]):this._events={},this}trigger(xe){var at=Array.prototype.slice.call(arguments,1);for(var F in this._events[xe])setTimeout(()=>{this._events[xe][F].apply(this,at)},1);if(xe==="error")return this;for(var F in this._events.event)setTimeout(()=>{this._events.event[F].apply(this,[xe])},1);return this}cast(xe,at={}){if(!xe)return this.trigger("error","No media source specified.");for(var F in at.src=xe,at)at.hasOwnProperty(F)&&(this[F]=at[F]);if(cast.framework.CastContext.getInstance().getCurrentSession()){var Lt=new chrome.cast.media.MediaInfo(this.src);if(Lt.metadata=new chrome.cast.media.GenericMediaMetadata,this.subtitles.length){Lt.textTrackStyle=new chrome.cast.media.TextTrackStyle,Lt.textTrackStyle.backgroundColor="#00000000",Lt.textTrackStyle.edgeColor="#00000016",Lt.textTrackStyle.edgeType="DROP_SHADOW",Lt.textTrackStyle.fontFamily="CASUAL",Lt.textTrackStyle.fontScale=1,Lt.textTrackStyle.foregroundColor="#FFFFFF",Lt.textTrackStyle={...Lt.textTrackStyle,...this.subtitleStyle};var Vr=[];for(var g in this.subtitles){var si=new chrome.cast.media.Track(g,"TEXT");si.name=this.subtitles[g].label,si.subtype="CAPTIONS",si.trackContentId=this.subtitles[g].src,si.trackContentType="text/vtt",si.trackId=parseInt(g),Vr.push(si)}Lt.tracks=Vr}Lt.metadata.images=[new chrome.cast.Image(this.poster)],Lt.metadata.title=this.title,Lt.metadata.subtitle=this.description;var ui=new chrome.cast.media.LoadRequest(Lt);if(ui.currentTime=this.time,ui.autoplay=!this.paused,this.subtitles.length){for(var g in this.subtitles)if(this.subtitles[g].active){ui.activeTrackIds=[parseInt(g)];break}}cast.framework.CastContext.getInstance().getCurrentSession().loadMedia(ui).then(()=>(this.device=cast.framework.CastContext.getInstance().getCurrentSession().getCastDevice().friendlyName||this.device,this.paused&&this._controller.playOrPause(),this),pt=>this.trigger("error",pt))}else cast.framework.CastContext.getInstance().requestSession().then(()=>{if(!cast.framework.CastContext.getInstance().getCurrentSession())return this.trigger("error","Could not connect with the cast device");var pt=new chrome.cast.media.MediaInfo(this.src);if(pt.metadata=new chrome.cast.media.GenericMediaMetadata,this.subtitles.length){pt.textTrackStyle=new chrome.cast.media.TextTrackStyle,pt.textTrackStyle.backgroundColor="#00000000",pt.textTrackStyle.edgeColor="#00000016",pt.textTrackStyle.edgeType="DROP_SHADOW",pt.textTrackStyle.fontFamily="CASUAL",pt.textTrackStyle.fontScale=1,pt.textTrackStyle.foregroundColor="#FFFFFF",pt.textTrackStyle={...pt.textTrackStyle,...this.subtitleStyle};var Dn=[];for(var Ue in this.subtitles){var ai=new chrome.cast.media.Track(Ue,"TEXT");ai.name=this.subtitles[Ue].label,ai.subtype="CAPTIONS",ai.trackContentId=this.subtitles[Ue].src,ai.trackContentType="text/vtt",ai.trackId=parseInt(Ue),Dn.push(ai)}pt.tracks=Dn}pt.metadata.images=[new chrome.cast.Image(this.poster)],pt.metadata.title=this.title,pt.metadata.subtitle=this.description;var m=new chrome.cast.media.LoadRequest(pt);if(m.currentTime=this.time,m.autoplay=!this.paused,this.subtitles.length){for(var Ue in this.subtitles)if(this.subtitles[Ue].active){m.activeTrackIds=[parseInt(Ue)];break}}cast.framework.CastContext.getInstance().getCurrentSession().loadMedia(m).then(()=>(this.device=cast.framework.CastContext.getInstance().getCurrentSession().getCastDevice().friendlyName||this.device,this.paused&&this._controller.playOrPause(),this),X=>this.trigger("error",X))},pt=>(pt!=="cancel"&&this.trigger("error",pt),this))}seek(xe,at){return at&&(xe=this._controller.getSeekTime(xe,this._player.duration)),this._player.currentTime=xe,this._controller.seek(),this}volume(xe){return this._player.volumeLevel=xe,this._controller.setVolumeLevel(),this}play(){return this.paused&&this._controller.playOrPause(),this}pause(){return this.paused||this._controller.playOrPause(),this}mute(){return this.muted||this._controller.muteOrUnmute(),this}unmute(){return this.muted&&this._controller.muteOrUnmute(),this}subtitle(xe){var at=new chrome.cast.media.EditTracksInfoRequest([parseInt(xe)]);cast.framework.CastContext.getInstance().getCurrentSession().getSessionObj().media[0].editTracksInfo(at,()=>{for(var F in this.subtitles)delete this.subtitles[F].active,F==xe&&(this.subtitles[F].active=!0);return this.trigger("subtitlechange")},F=>this.trigger("error",F))}disconnect(){return cast.framework.CastContext.getInstance().endCurrentSession(!0),this._controller.stop(),this.connected=!1,this.device="Chromecast",this.src="",this.title="",this.description="",this.poster="",this.subtitles=[],this.volumeLevel=1,this.muted=!1,this.paused=!1,this.time=0,this.timePretty="00:00:00",this.duration=0,this.durationPretty="00:00:00",this.progress=0,this.state="disconnected",this.trigger("disconnect"),this}}typeof module<"u"&&(module.exports=Castjs);