@castlabs/prestoplay 6.18.0 → 6.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +7 -7
  5. package/cjs/cl.cast.js +115 -114
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +581 -577
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +77 -75
  10. package/cjs/cl.externs.js +175 -293
  11. package/cjs/cl.freewheel.js +23 -24
  12. package/cjs/cl.hls.js +70 -71
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +28 -29
  15. package/cjs/cl.ima.js +24 -24
  16. package/cjs/cl.mse.js +313 -314
  17. package/cjs/cl.muxdata.js +15 -15
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +14 -14
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.sessions.js +16 -15
  22. package/cjs/cl.simid.js +15 -15
  23. package/cjs/cl.smooth.js +71 -72
  24. package/cjs/cl.thumbnails.js +26 -26
  25. package/cjs/cl.tizen.js +71 -71
  26. package/cjs/cl.ttml.js +27 -27
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +12 -13
  29. package/cjs/cl.vr.js +19 -19
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.youbora.js +18 -18
  32. package/cl.adobe.js +3 -3
  33. package/cl.airplay.js +3 -3
  34. package/cl.broadpeak.js +5 -5
  35. package/cl.cast.js +90 -89
  36. package/cl.conviva.js +27 -27
  37. package/cl.core.js +475 -474
  38. package/cl.crypto.js +9 -9
  39. package/cl.dash.js +72 -71
  40. package/cl.externs.js +172 -294
  41. package/cl.freewheel.js +19 -19
  42. package/cl.hls.js +74 -72
  43. package/cl.hlssmpte.js +5 -5
  44. package/cl.htmlcue.js +25 -26
  45. package/cl.ima.js +17 -17
  46. package/cl.mse.js +277 -274
  47. package/cl.muxdata.js +13 -13
  48. package/cl.onboard.js +4 -4
  49. package/cl.persistent.js +11 -11
  50. package/cl.playlist.js +5 -5
  51. package/cl.sessions.js +10 -10
  52. package/cl.simid.js +13 -13
  53. package/cl.smooth.js +59 -59
  54. package/cl.thumbnails.js +19 -19
  55. package/cl.tizen.js +57 -57
  56. package/cl.ttml.js +22 -22
  57. package/cl.verimatrix.js +4 -4
  58. package/cl.vimond.js +9 -8
  59. package/cl.vr.js +14 -14
  60. package/cl.vtt.js +12 -12
  61. package/cl.youbora.js +15 -15
  62. package/clpp.styles.css +14 -0
  63. package/package.json +1 -1
  64. package/typings.d.ts +379 -384
package/cl.core.js CHANGED
@@ -1,391 +1,396 @@
1
- let g={}; let _ = {};let f=function(window){'use strict';var ba,ca,la,oa,ta,ua,wa,xa,ya,za,Ra,Xa,Ya,Za,ab,bb,db,eb,ib,kb,lb,mb,nb,ob,pb,rb,sb,xb,Ab,Eb,Hb,Ib,Lb,Nb,Qb,Rb,Vb,Wb,Yb,Ac,Fc,Kc,Vc,Wc,bd,cd,dd,fd,gd,hd,id,jd,ld,md,nd,od,qd,rd,yd,Bd,Hd,Id,Kd,Ld,Nd,Qd,Rd,Td,Xd,ce,fe,ge,ie,je,te,Le,Se,Ue,Ve,We,Xe,Ye,Ze,$e,af,bf,cf,gf,jf,kf,lf,mf,nf,pf,qf,uf,wf,Lf,Of,Uf,$f,bg,cg,tg,xg,yg,zg,Ag,Bg,Dg,Eg,Fg,Gg,Hg,Ig,Lg,Mg,Rg,Og,Zg,$g,dh,fh,nh,oh,yh,zh,sh,vh,Bh,Dh,Ch,Fh,Gh,Hh,Kh,Lh,Nh,Oh,Uh,Wh,Yh,Sh,$h,ei,gi,fi,hi,ii,ji,mi,ni,qi,Qi,Ui,Vi,Wi,Xi,Yi,$i,aj,bj,
2
- cj,fj,ij,mj,nj,rj,tj,oj,qj,sj,wj,xj,yj,Aj,Bj,Ij,Qj,Uj,Zj,Yj,lk,ek,dk,wk,xk,zk,Ak,Bk,Ck,Dk,Ek,Gk,Fk,Hk,Ik,Lk,Mk,Nk,yk,Pk,Rk,Tk,Vk,Xk,bl,dl,el,fl,gl,hl,il,jl,kl,ll,ml,sl,Bl,Dl,Jl,Nl,Pl,Wl,fm,Sl,am,km,mm,nm,Bm,Cm,Jm,Mm,Nm,Pm,Rm,Sm,Tm,Km,Qm,Um,Vm,Wm,Xm,Ym,Zm,en,kn,mn,on,nn,qn,hn,xn,un,wn,vn,ln,yn,zn,An,Gn,Hn,In,Ln,Pn,Qn,Sn,Nn,Mn,$n,ao,fo,eo,ho,jo,ko,go,mo,no,oo,to,yo,zo,Ao,Eo,Fo,Do,Go,Co,Bo,Io,Ko,Mo,Oo,Po,Qo,Ro,So,To,Uo,Vo,Wo,Xo,Yo,bp,fp,hp,jp,kp,lp,np,op,mp,wp,qp,rp,xp,up,yp,Bp,Cp,Dp,zp,Ap,Ep,Fp,Ip,
3
- Mp,Np,Qp,Sp,Tp,Rp,Op,Hp,Lp,Jp,Kp,Wp,Xp,Yp,Zp,$p,bq,dq,eq,gq,iq,kq,cq,lq,mq,hq,jq,nq,oq,Aq,Fq,Eq,Gq,Hq,Iq,Jq,qq,Lq,rq,pq,sq,Pq,uq,Sq,Bq,ar,br,cr,fr,dr,er,gr,hr,ir,jr,kr,lr,mr,nr,or,pr,rr,sr,tr,vr,xr,Cr,Dr,Er,Gr,Hr,Ir,Kr,Lr,Jr,Mr,Pr,Or,Nr,Qr,Tr,Xr,Wr,bs,Jg,Kg;_.aa=" is registered.";ba=" is unsupported on this platform.";ca=" to a log level. Falling back to default!";_.fa="6.18.0";_.ha="AdaptationSet";_.ia="Already destroyed. No-op";_.ja="Already released. No-op";_.ka="Autoplay is not allowed due to browser policy.";
4
- la="Autoplay should not be used for preloaded streams. ";_.ma="BANDWIDTH";_.na="BASIC";oa="CHECKSUM";_.pa="CODECS";_.qa="Cannot retrieve buffer information due to platform limitations";_.ra="CastlabsPlayer";_.sa="Configuration is valid";ta="Content-Length";ua="Content-Type";_.va="Could not find configured DRM environment.";wa="DRM licenses loaded";xa="DRMtoday";ya="DRMtodayOnboard";za="Destroying player";_.Aa="Disable track type ";_.Ba="EXT-X-BYTERANGE";_.Ca="EXT-X-DATERANGE";_.Da="EXT-X-DISCONTINUITY";
5
- _.Ea="EXT-X-DISCONTINUITY-SEQUENCE";_.Fa="EXT-X-ENDLIST";_.Ga="EXT-X-KEY";_.Ha="EXT-X-MAP";_.Ia="EXT-X-MEDIA-SEQUENCE";_.Ja="EXT-X-PART-INF";_.La="EXT-X-PLAYLIST-TYPE";_.Ma="EXT-X-PRELOAD-HINT";_.Na="EXT-X-PROGRAM-DATE-TIME";_.Oa="EXT-X-SERVER-CONTROL";_.Qa="EXT-X-TARGETDURATION";Ra="Error while decoding string!";_.Sa="Error while fetching license!";_.Ta="FairPlay Certificate URL is not defined";_.Ua="FairPlay License URL is not defined";_.Va="GROUP-ID";Xa="HW_SECURE_ALL";Ya="HW_SECURE_CRYPTO";
6
- Za="HW_SECURE_DECODE";ab="HeaderDrm";bb="InvalidStateError";_.cb="LANGUAGE";db="License verification failed: ";eb="Load interrupted while a player release is pending";_.fb="Loading player with configuration";_.gb="MaxHeight";_.hb="MaxWidth";ib="Missing media element";kb="No drmtoday configuration found in player configuration. Unable to modify the DRM license request!";lb="No event provided!";mb="No items in the playlist";nb="No sources provided!";ob="No track data attached to the event, unable to add track!";
7
- pb="Not a persistent session.";_.qb="Not supported";rb="NotAllowedError";sb="NotSupportedError";_.tb="PLAYLIST";_.ub="POST";_.wb="PlayReady License URL is not defined";xb="Player not ready yet.";_.yb="Player sources";_.zb="Please make sure ";Ab="Preloading is not supported by this player.";_.Bb="QualityLevel";_.Cb="RESOLUTION";_.Db="Representation";Eb="STANDARD";_.Fb="SW_SECURE_CRYPTO";_.Gb="SW_SECURE_DECODE";Hb="Session is closed";Ib="Skipping Session creation. License for init data was already requested in ";
8
- _.Jb="SmoothStreamingMedia";_.Kb="TYPE";Lb="The index is not in the allowed range.";_.Mb="URI";Nb="Unable to translate ";_.Ob="Unhandled/ignored event";_.Pb="Unregistering listeners";Qb="Unsupported keySystem";Rb="Using VTTCue polyfill from 3 argument TextTrackCue.";_.Sb="VIDEO";_.Tb="VOD";Vb="Wait for preloading to finish";Wb="WebkitEmeManager.MediaKeySession.load";_.Xb="Widevine License URL is not defined";Yb="Will create EME Manager: ";_.Zb="X-ASSET-LIST";_.$b="X-ASSET-URI";_.ac="X-PLAYOUT-LIMIT";
9
- _.bc="X-RESUME-OFFSET";_.cc="ad-break-started";_.dc="ad-break-stopped";_.ec="ad-buffering";_.fc="ad-clicked";_.gc="ad-completed";_.hc="ad-first-quartile";_.ic="ad-impression";_.jc="ad-loaded";_.lc="ad-midpoint";_.mc="ad-paused";_.nc="ad-progress";_.oc="ad-resumed";_.pc="ad-skipped";_.qc="ad-started";_.rc="ad-stopped";_.sc="ad-third-quartile";_.tc="addtrack";_.uc="ads-timeline-changed";_.vc="airplay-casting-ended";_.wc="airplay-casting-started";_.xc="airplay-status-changed";_.yc="application/cea-608";
10
- _.zc="application/dash+xml";Ac="application/mp4";_.Bc='application/mp4; codecs\x3d"stpp"';_.Cc='application/mp4; codecs\x3d"wvtt"';_.Dc="application/ttml+xml";_.Ec="application/vnd.ms-sstr+xml";Fc="application/x-www-form-urlencoded";_.p="audio";_.Gc="audio/aac";_.Hc="audio/ac3";_.Ic="audio/eac3";_.Jc="audio/mp4";Kc='audio/mp4;codecs\x3d"mp4a.40.2"';_.Lc="audiobufferchanged";_.Mc="autoplaynotallowed";_.Nc="bitratechanged";_.Pc="boolean";_.Qc="bufferingended";_.Uc="bufferingstarted";Vc="canplay";
11
- Wc="canplaythrough";_.Xc="castingstarted";_.Yc="caststatuschanged";_.Zc="cdn-switch-success";_.$c="cenc";_.ad="center";bd="certificate-request";cd="change";dd="chrome";_.ed="clpp-fill";fd="clpp-hidden";gd="clpp-mc-playlist";hd="clpp-mc-playlist-item";id="clpp-mc-playlist-video-el";jd="clpp-visible";_.kd="clpp.cast.CastSender";ld="clpp.drm.HeaderDrm";md="clpp.drm.eme.AppleEmeManager";nd="clpp.interstitial.Player";od="clpp.native.Player";qd="clpp.plist.McPlaylist";rd="clpp.utils.Platform";_.sd="codecs";
12
- _.td="column-reverse";_.ud="com.adobe.primetime";_.vd="com.apple.fps";_.wd="com.apple.hls.interstitial";_.xd="com.microsoft.playready";yd="com.microsoft.playready.recommendation";_.zd="com.widevine.alpha";_.Ad="config.drm.customData is not defined";Bd="controls";_.Cd="cuechange";_.Dd="decoder";_.Ed="destroy()";_.Fd="disabled";_.Gd="div";Hd="drm.mediaKeys.end";Id="drm.mediaKeys.start";Kd="drm.onPlay.end";Ld="drm.onPlay.start";_.Md="drmexpirationupdate";Nd="drmrenewalstarted";_.Od="drmsessionpersisted";
13
- _.Pd="drmsessionupdate";Qd="drmtoday";Rd="durationchange";_.Sd="ec-3";Td="encrypted";_.Ud="end";_.Vd="ended";_.r="error";_.Wd="forced";Xd="fullscreenElement";_.Yd="function";_.Zd="height";_.$d="hidden";_.ae="hls-daterange";_.be="html";ce="https://content.players.castlabs.com/api-interstitials-v3/B-P1-B_360p.json";_.de="image";_.ee="internal-error";fe="itemchange";ge="keystatuseschange";_.he="left";ie="license-renewal";je="license-request";_.ke="line-left";_.me="line-right";_.ne="live-turned-static";
14
- _.re="loadeddata";_.se="loadedmetadata";te="loadstart";_.ue="main";_.ve="mdat";_.we="mdia";_.xe="message";_.ye="metadata";_.ze="mimeType";_.Ae="minf";_.Be="moov";_.Ce="mpd-type-changed";_.De="mpeg-dash-callback-event";_.Ee="none";_.t="number";_.Fe="object";_.Ge="onBitrateChanged()";_.He="onPlayerError()";_.Ie="onPlayerWillDestroy";_.Je="onPlayerWillRelease";_.Ke="onStateChanged()";Le="online-status-changed";_.Me="optional";_.Ne="org.w3.clearkey";_.Oe="output-restricted";_.Pe="pause";_.Qe="persistent";
15
- _.Re="persistent-license";Se="picture-in-picture";_.Te="play";Ue="player.afterLoad.end";Ve="player.afterLoad.start";We="player.appendLoad.end";Xe="player.appendLoad.start";Ye="player.beforeLoad.end";Ze="player.beforeLoad.start";$e="player.load.end";af="player.load.start";bf="player.setupPlaylist.end";cf="player.setupPlaylist.start";_.df="playing";_.ef="playlist-item-changed";_.ff="playlist-modified";gf="playlist.next.end";jf="playlist.next.start";kf="preload-aborted";lf="preload-failed";mf="preloaded";
16
- nf="preloading";_.of="prevent";pf="primary-before-load";qf="primary-content";_.rf="progress";_.sf="px";_.tf="ratechange";uf="released";_.vf="releasing";wf="removetrack";_.xf="required";_.yf="resize";_.zf="right";_.Af="sc-playlist-ended";_.Bf="sc-playlist-item-changed";_.Cf="sc-playlist-live-turned-static";_.Df="sc-playlist-timeline-changed";_.Ef="seeked";_.Ff="seeking";_.Gf="showing";_.Hf="simid-creative-started";_.If="simid-creative-stopped";_.Jf="sinf";_.Kf="smooth";Lf="stalled";_.Mf="start";
17
- _.Nf="statechanged";Of="status-pending";_.Pf="stbl";_.Qf="string";_.Rf="stsd";_.Sf="style";_.Tf="subtitles-htmlcue";Uf="temporary";_.Vf="text/vtt";_.Wf="text/xml";_.Xf="timeupdate";_.Yf="trak";_.Zf="ttml-xml";$f="unauthenticated";_.ag="und";bg="unknown";cg="update";_.dg="urn:scte:scte35";_.eg="urn:scte:scte35:2014";_.fg="user-seeked";_.gg="user-seeking";_.hg="value";_.ig="vertical-lr";_.jg="vertical-rl";_.w="video";_.lg="video/mp2t";_.mg="video/mp4";_.ng="videobufferchanged";_.rg="videotrackchanged";
18
- _.sg="vimond-response";tg="visibilitychange";_.ug="vtt-xml";_.vg="waiting";_.wg="waitingforkey";xg="webkit-org.w3.clearkey";yg="webkitkeyadded";zg="webkitkeyerror";Ag="webkitkeymessage";Bg="webkitneedkey";_.Cg="width";Dg="x-dt-csl-tracking-token";Eg="x-dt-follow-up-token";Fg="x-dt-resp-code";Hg=function(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}};Ig=function(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:Hg(a)}};
19
- Lg=function(a,b){if(b){var c=Jg;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&Kg(c,a,{configurable:!0,writable:!0,value:b})}};Mg=function(a){function b(d){return a.next(d)}function c(d){return a.throw(d)}return new Promise(function(d,e){function f(g){g.done?d(g.value):Promise.resolve(g.value).then(b,c).then(f,e)}f(a.next())})};_.x=function(a){return Mg(a())};
20
- _.z=function(a,b){a=a.split(".");var c=Ng;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};_.Qg=function(a){return _.A(a)||Og(a)?a:_.Pg(a)};_.Pg=function(...a){let b={};for(let c=0;c<a.length;c++)null!=a[c]&&(b=Rg(b,{merging:a[c]},1));return b.merging||null};_.Sg=function(a){for(const b in a)if(void 0!==a[b])return!0;return!1};
21
- Rg=function(a,b,c){const d=c+1;if(_.A(a)||!_.Tg(a))a={};for(const e in b)c=b[e],Og(c)||_.A(c)||_.Ug(c)||c instanceof Element?a[e]=c:_.Tg(c)&&c.buffer&&c.buffer instanceof ArrayBuffer&&_.Ug(c.subarray)?a[e]=c.subarray(0):c instanceof Array?a[e]=Rg([],c,d):!_.A(c)&&_.Vg(c)&&20>d&&(a[e]=Rg(a[e],c,d));return a};Og=function(a){a=typeof a;return a===_.Qf||a===_.t||a===_.Pc};_.A=function(a){return null===a||"undefined"===typeof a};_.Tg=function(a){return typeof a===_.Fe};
22
- _.Ug=function(a){return typeof a===_.Yd};_.Wg=function(a){return typeof a===_.Qf};_.Xg=function(a){return typeof a===_.t};_.Vg=function(a){if(_.A(a)||!_.Tg(a))return!1;a=Object.getPrototypeOf(a);return a===Object.prototype||null===a};
23
- _.Yg=function(a,b,c,d){if(a===b||null===a&&null===b||void 0===a&&void 0===b)return!0;if(null===a&&null!==b||null!==a&&null===b||void 0!==a&&void 0===b||void 0===a&&void 0!==b||!_.Tg(a)||!_.Tg(b))return!1;const e=c||Object.keys(a),f={};for(let g=0;g<e.length;g++){const h=e[g];if(_.A(d)||0>d.indexOf(h))if(f[h]=!0,a[h]!==b[h])return!1}if(_.A(c))for(a=Object.keys(b),b=0;b<a.length;b++)if(c=a[b],(_.A(d)||0>d.indexOf(c))&&!f[c])return!1;return!0};
24
- Zg=function(a){return(Number.hasOwnProperty("isNaN")?Number.isNaN:b=>b!==b)(a)};$g=function(a){const b=new Map;for(const c of Object.keys(a))b.set(c,a[c]);return b};_.ah=function(a){const b={};a.forEach((c,d)=>{b[d]=c});return b};dh=function(a){return a&&0<=bh[a]?bh[a]:ch};fh=function(a){if(!a)return _.C("clpp.log",Nb+a+ca),-1;const b=eh[a.toUpperCase()];return void 0===b?(_.C("clpp.log",Nb+a+ca),-1):b};_.hh=function(a){gh.info.apply(gh,arguments)};_.ih=function(a){gh.debug.apply(gh,arguments)};
25
- _.C=function(a){gh.warn.apply(gh,arguments)};_.jh=function(a){gh.error.apply(gh,arguments)};_.mh=function(a){if(a){var b=a.a();b in _.kh?_.lh.warn("Player-Factory '"+b+"' already registered"):(_.kh[b]=a,_.lh.info("Registered Player-Factory: '"+b+"'"))}};nh=function(a){return Object.values(_.kh).find(a)||null};_.ph=function(a){var b=a.a;var c=[];for(const d in b.a)c.push.apply(c,b.a[d]);b=c;for(c=0;c<b.length;++c)oh(b[c]);a.a.clear()};
26
- _.qh=function(a,b,c,d){const e=f=>{for(const g of c)a.off(b,g,e);d(f)};for(const f of c)a.on(b,f,e)};oh=function(a){a.target.removeEventListener(a.type,a.a,a.f);a.target=null;a.a=null};
27
- yh=function(a,b){a.g.debug("onMetadata_()");b.mode=_.$d;const c=[];let d=!0;const e=f=>{for(var g of c)if(f.startTime===g.startTime&&f.endTime===g.endTime)return g;g={schemeIdUri:"",value:"",startTime:0,endTime:0,id:"",type:_.rh,eventElement:null};a.o&&d&&"SCTE35-IN"===f.value.key&&0<f.startTime?(g.startTime=0,g.endTime=f.startTime):(g.startTime=f.startTime,g.endTime=f.endTime);d=!1;c.push(g);return c[c.length-1]};if(b.cues){for(const f of b.cues){if(sh(a,f))continue;const g=e(f);switch(f.value.key){case "SCTE35-IN":case "SCTE35-OUT":g.schemeIdUri=
28
- _.eg;g.type=_.th;break;case "X-CUSTOM-ID":g.id=f.value.data}}for(const f of c)a.m.trigger(new _.E(_.uh,{detail:f}));Array.prototype.push.apply(a.h,c);vh(a,c,b);a.f.off(b,_.Cd);a.f.on(b,_.Cd,f=>{f=f.target.activeCues;f=f.length?sh(a,f[0]):a.a;var g;if(g=f){{g=f;const h=a.m.getPosition();g=g.startTime<=h&&h<g.endTime}}if(g)a.a=f,a.m.trigger(new _.E(_.wh,{detail:f}));else{if(f=a.a)f=a.a,g=a.m.getPosition(),f=f.endTime<=g;f&&(f=a.a,a.a=null,a.m.trigger(new _.E(_.xh,{detail:f})))}})}};
29
- zh=function(a,b){a.j=b;a.l=a.j.textTracks;a.f.on(a.l,_.tc,c=>{c=c.track;c.kind===_.ye&&yh(a,c)})};sh=function(a,b){for(const c of a.h)if(b.startTime===c.startTime&&b.endTime===c.endTime)return c;return null};vh=function(a,b,c){if(a.o){for(;0<c.cues.length;)c.removeCue(c.cues[0]);b.forEach(function(d){c.addCue(new DataCue(d.startTime,d.endTime,{key:"SCTE35-OUT",data:null}))})}};_.Ah=function(a){return Array.isArray(a)?a:[a]};
30
- Bh=function(a,b){return a===b?!0:a.length===b.length&&a.every((c,d)=>c===b[d])};Dh=function(a,b,c){if(null==a&&null==b)return!0;if(null==a||null==b)return!1;a=c?a.map(c):a;b=c?b.map(c):b;return Ch(a,b)&&Ch(b,a)};Ch=function(a,b){const c=new Set(a);return b.every(d=>c.has(d))};_.Eh=function(a,b={}){if(b.af){const c=[];for(const d of a)c.some(e=>b.af(d,e))||c.push(d);return c}return Array.from((new Set(a)).values())};
31
- Fh=function(a,b){b=b.track;b.kind!==_.ye&&(b.mode===_.Gf&&(b.mode=_.$d),a.a.on(b,_.Cd,c=>{c=c.target||c.srcElement;c.mode=_.$d;c.activeCues&&(c=Array.from(c.activeCues).map(a.o),a.l.append(c,[]))}))};Gh=function(a,b,c,d){a=`${a===_.F?"FATAL":"RECOVERABLE"} Clpp-Error [Category ${b} - Code ${c}]`;if(_.Wg(d))a+=": "+d;else if(null!=d)if(null!=d.message)a+=": "+d.message,delete d.message;else try{a+=": "+JSON.stringify(d)}catch(e){}return a};
32
- Hh=function(a,b){const c=b||Bh;let d=null,e=null,f=!1;return function(...g){if(f&&c(g,d))return e;f=!0;d=g;return e=a(...g)}};_.Ih=function(a){return null!=a};Kh=function(...a){for(let b=0;b<a.length;b++){const c=a[b];if(null!==c&&void 0!==c)return c}throw new _.Jh("No non-null, non-undefined value found");};Lh=function(...a){for(let b=0;b<a.length;b++){const c=a[b];if(null!==c&&void 0!==c)return c}};
33
- _.Mh=function(a){var b;a instanceof _.Mh?(Nh(this,a.gb),this.qc=a.qc,this.Pa=a.Pa,Oh(this,a.Hc),this.Da=a.Da,_.Rh(this,Sh(a.a)),this.fc=a.fc):a&&(b=String(a).match(Th))?(Nh(this,b[1]||"",!0),this.qc=Uh(b[2]||""),this.Pa=Uh(b[3]||"",!0),Oh(this,b[4]),this.Da=Uh(b[5]||"",!0),_.Rh(this,b[6]||"",!0),this.fc=Uh(b[7]||"")):this.a=new _.Vh(null)};Nh=function(a,b,c){a.gb=c?Uh(b,!0):b;a.gb&&(a.gb=a.gb.replace(/:$/,""))};
34
- Oh=function(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.Hc=b}else a.Hc=null};_.Rh=function(a,b,c){b instanceof _.Vh?a.a=b:(c||(b=Wh(b,Xh)),a.a=new _.Vh(b))};Uh=function(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""};Wh=function(a,b,c){return typeof a===_.Qf?(a=encodeURI(a).replace(b,Yh),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null};Yh=function(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)};_.Vh=function(a){this.f=a||null};
35
- Sh=function(a){var b=new _.Vh;b.f=a.f;if(a.a){var c={},d;for(d in a.a)c[d]=a.a[d].concat();b.a=c;b.h=a.h}return b};$h=function(a,b){const c=Zh[a];for(const d of c)for(const e of b)if(d.test(e.trim()))return e.trim();return a===_.G?"":null};_.I=function(a,b,c,d){d=void 0===d?{}:d;a=a.getAttribute(b);if(!a&&d.required)throw new _.H(_.F,4,4023,`Required attribute missing: ${b}`);return a?a.value:c||null};
36
- _.bi=function(a){var b=(a||"").split("-");a=b[0]||"";b=b[1]||"";a=a.toLowerCase();a=ai.get(a)||a;return(b=b.toUpperCase())?a+"-"+b:a};_.ci=function(a,b){a=_.bi(a);b=_.bi(b);return a.split("-")[0]===b.split("-")[0]};_.di=function(a,b){for(const c of a)if(!b(c))return!1;return!0};ei=function*(a){for(let b=0;b<a;b++)yield b};
37
- gi=function(a,b){if(!a&&!b)return!0;if(!a||!b||a.byteLength!==b.byteLength)return!1;if(fi(a)===fi(b)&&(a.byteOffset||0)===(b.byteOffset||0))return!0;const c=_.J(a);b=_.J(b);for(const d of ei(a.byteLength))if(c[d]!==b[d])return!1;return!0};fi=function(a){return a instanceof ArrayBuffer?a:a.buffer};_.J=function(a,b=0,c=Infinity){return hi(a,b,c,Uint8Array)};
38
- hi=function(a,b,c,d){const e=d.BYTES_PER_ELEMENT||1,f=fi(a),g=(a.byteOffset||0)+a.byteLength;a=Math.max(0,Math.min((a.byteOffset||0)+b*e,g));c=Math.min(a+Math.max(c*e,0),g);a/=e;return new d(f,a,c/e-a)};ii=function(a,b=0,c=Infinity){return hi(a,b,c,Uint16Array)};ji=function(a,b=0,c=Infinity){return hi(a,b,c,Uint32Array)};_.ki=function(a,b=0,c=Infinity){return hi(a,b,c,Int32Array)};_.li=function(a,b=0,c=Infinity){return hi(a,b,c,DataView)};
39
- mi=function(a){return a instanceof ArrayBuffer?a:0===a.byteOffset&&a.byteLength===a.buffer.byteLength?a.buffer:(new Uint8Array(a)).buffer};ni=function(a){let b="";for(let c=0;c<a.length;c+=16E3)b+=String.fromCharCode.apply(null,a.subarray(c,c+16E3));return b};
40
- _.oi=function(a){if(!a)return"";a=_.J(a);239===a[0]&&187===a[1]&&191===a[2]&&(a=a.subarray(3));if("TextDecoder"in window){a=(new TextDecoder).decode(a);if(a.includes("\ufffd"))throw Error(Ra);return a}a=escape(ni(a));try{return decodeURIComponent(a)}catch(b){throw Error(Ra);}};
41
- qi=function(a,b,c){if(!a)return"";if(!c&&0!==a.byteLength%2)throw pi.error("Data has an incorrect length, must be even."),Error("Data does not seem to be UTF-16 encoded!");c=_.J(a);if(b&&255===c[0]&&254===c[1]||254===c[0]&&255===c[1])a=c.subarray(2);if(a instanceof ArrayBuffer)var d=a;else c=new Uint8Array(a.byteLength),c.set(_.J(a)),d=c.buffer;a=Math.floor(a.byteLength/2);c=new Uint16Array(a);d=new DataView(d);for(let e=0;e<a;e++)c[e]=d.getUint16(2*e,b);return ni(c)};
42
- _.ri=function(a,b){if(_.Wg(a))return a;let c="";b=!!b;const d=_.J(a);239===d[0]&&187===d[1]&&191===d[2]?c=_.oi(d):254===d[0]&&255===d[1]?c=qi(d.subarray(2),!1):255===d[0]&&254===d[1]&&(c=qi(d.subarray(2),!0));const e=function(f,g){return f.byteLength<=g||32<=f[g]&&126>=f[g]}.bind(null,d);pi.debug("Unable to find byte-order-mark, making an educated guess.");0===d[0]&&0===d[2]?c=qi(a,!1):0===d[1]&&0===d[3]?c=qi(a,!0):e(0)&&e(1)&&e(2)&&e(3)&&(c=_.oi(a));if(c)return b&&(c=escape(c)),c;throw Error("Unable to detect text encoding");
43
- };_.si=function(a){if("TextEncoder"in window)return(new TextEncoder).encode(a);a=encodeURIComponent(a);a=unescape(a);const b=new Uint8Array(a.length);for(let c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b};_.ti=function(a,b){const c=new Uint8Array(2*a.length),d=new DataView(c.buffer);for(let e=0;e<a.length;++e)d.setUint16(2*e,a.charCodeAt(e),b);return c.buffer};
44
- _.ui=function(a,b){var c=b||1;b=a.length;const d=new ArrayBuffer(b*c);let e;4===c?e=ji(d):2===c?e=ii(d):e=_.J(d);for(c=0;c<b;c++)e[c]=a.charCodeAt(c);return d};_.vi=function(a,b){return String.prototype.startsWith?a.startsWith(b):0===a.indexOf(b)};_.wi=function(a,b){if(String.prototype.endsWith)return a.endsWith(b);const c=a.length-b.length;a=a.lastIndexOf(b,c);return-1!==a&&a===c};_.xi=function(a){return!!(a&&0<a.length)};_.yi=function(a){return!a||0===a.length};
45
- _.zi=function(a){if(void 0===a||null===a||""===a)return"";try{let b=Number(a);if(Zg(b))return"";a="bps";1E3<=Math.abs(b)&&(a="Kbps",b/=1E3);1E3<=Math.abs(b)&&(a="Mbps",b/=1E3);return`${b.toFixed(2).replace(/[.,]00$/,"")}${a}`}catch(b){return""}};_.Bi=function(a){a=a.replace(/<[^>]+>/gi,"");Ai.innerHTML=a;a=Ai.textContent;return a=a.replace(/<[^>]+>/gi,"")};_.Di=function(a,b=!0){a=_.Ci(a).replace(/\+/g,"-").replace(/\//g,"_");return b?a:a.replace(/[=]*$/,"")};_.Ci=function(a){a=ni(_.J(a));return btoa(a)};
46
- _.Ei=function(a){a=window.atob(a.replace(/-/g,"+").replace(/_/g,"/"));const b=new Uint8Array(a.length);for(let c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b};_.Fi=function(a){const b=new Uint8Array(a.length/2);for(let c=0;c<a.length;c+=2)b[c/2]=window.parseInt(a.substr(c,2),16);return b};_.Gi=function(a){let b="";for(let c=0;c<a.length;++c){let d=a[c].toString(16);1===d.length&&(d="0"+d);b+=d}return b};
47
- _.Hi=function(a,b){if(!a&&!b)return!0;if(!a||!b||a.length!==b.length)return!1;for(let c=0;c<a.length;++c)if(a[c]!==b[c])return!1;return!0};_.Ii=function(a){var b=0;for(var c=0;c<arguments.length;++c)b+=arguments[c].length;b=new Uint8Array(+b);c=0;for(let d=0;d<arguments.length;++d)b.set(arguments[d],c),c+=arguments[d].length;return b};
48
- _.Ji=function(a,b){b.lastIndex=a.a;b=b.exec(a.f);b=null==b?null:{position:b.index,length:b[0].length,results:b};if(a.a===a.f.length||null===b||b.position!==a.a)return null;a.a+=b.length;return b.results};
49
- _.Ni=function(a,b){var c=b.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!c)throw new _.H(_.F,4,4016,{invalidTag:b});b=c[1];var d=c[2];c=[];let e;if(d){d=new _.Ki(d);var f;(f=_.Ji(d,/^([^,=]+)(?:,|$)/g))&&(e=f[1]);const g=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;for(;f=_.Ji(d,g);)c.push(new _.Li(f[1],f[2]||f[3]||""))}return new _.Mi(a,b,c,e)};_.Pi=function(){return{maxAttempts:1,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:0,fatalStatusCodes:[...Oi]}};
50
- Qi=function(a,b){a.timeout=b.timeout;a.baseDelay=b.baseDelay;a.backoffFactor=b.backoffFactor;a.fuzzFactor=b.fuzzFactor;a.maxAttempts=b.maxAttempts;a.fatalStatusCodes=b.fatalStatusCodes||[...Oi]};
51
- _.Si=function(a,b){_.Wg(a)&&(a={uris:[a]});Array.isArray(a)&&(a={uris:a});const c={uris:a.uris||[],type:a.type||_.Ri,uriIndex:0,method:a.method||"GET",body:a.body||null,headers:Object.assign({},a.headers),allowCrossSiteCredentials:a.allowCrossSiteCredentials||!1,onProgress:a.onProgress||null,onFragment:a.onFragment||null,maxAttempts:a.maxAttempts||1,currentAttempt:0,baseDelay:a.baseDelay||1E3,backoffFactor:a.backoffFactor||2,fuzzFactor:a.fuzzFactor||.5,timeout:a.timeout||0,requestModifiers:a.requestModifiers||
52
- [],responseModifiers:a.responseModifiers||[],startTime:a.startTime||null,endTime:a.endTime||null,contentType:a.contentType||null,licenseRequestType:a.licenseRequestType||null,sessionId:null,bytesRemaining:-1,bytesLoaded:-1,bytesTotal:-1,timescale:a.timescale||null,rateLimitBps:a.rateLimitBps||null,disableFragmentSupport:a.disableFragmentSupport||!1,disableMergedFragments:a.disableMergedFragments||!1,fatalStatusCodes:[...Oi],requestStartTimestamp:null};a.keyInfo&&(c.keyInfo=a.keyInfo);b&&Qi(c,b);return c};
53
- _.Ti=function(a,b,c,d,e,f,g,h){e&&(d=e);e={uri:d,data:b||new ArrayBuffer(0),headers:a,status:c,fromCache:!!a["x-shaka-from-cache"],timeMs:g,responseStartMs:h,request:f};if(200<=c&&299>=c&&202!==c)return e;g=null;try{g=_.ri(b,!0)}catch(k){}_.ih("HTTP error text:",g);throw new _.H(0<=(f.fatalStatusCodes||[]).indexOf(c)?_.F:1,1,1001,{url:d,status:c,responseText:g,headers:a,request:f,response:e});};
54
- Ui=function(a,b){b=parseInt(b,10);Number.isNaN(b)&&(b=-1);a.bytesTotal=b;a.bytesLoaded=0;a.bytesRemaining=b};Vi=function(a,b,c){0<a.bytesRemaining&&(a.bytesRemaining-=b);a.bytesLoaded+=b;if(a.onProgress)a.onProgress(b,c)};Wi=function(a,b,c){if(0>=a)return Promise.resolve();const d=8*c/a-b/1E3;return 0<d?new Promise(e=>{setTimeout(e,1E3*d)}):Promise.resolve()};
55
- Xi=function(a,b,c){try{const d=a(b);if(d&&d.R&&d.abort)return c.resolve(d.R),()=>d.abort();c.resolve(d);return()=>Promise.resolve(d).then(()=>{}).catch(()=>{})}catch(d){return c.reject(d),()=>Promise.resolve()}};Yi=function(a,b){a.R.then(()=>b(!0),()=>b(!1));return a};_.Zi=function(a,b){a.a.push(Yi(b,()=>{{var c=a.a;const d=c.indexOf(b);-1<d&&c.splice(d,1)}}))};$i=function(a,b){return _.x(function*(){const c=yield a.fetch(b);return _.oi(c.data).replace(/\r\n|\r(?=[^\n]|$)/gm,"\n")})};
56
- aj=function(a,b){return _.x(function*(){const c=yield $i(a,b);try{const d=JSON.parse(c);if(null==d||typeof d!==_.Fe)throw Error("Not an object");return d}catch(d){throw new _.Jh("Failed to parse JSON response","json-failed");}})};bj=function(a,b,c,d){d=void 0===d?"HEAD":d;return _.x(function*(){if(!navigator.onLine)return!1;if(b){const e=_.Si(b,c);e.method=d;c||(e.timeout=5E3);e.headers["cache-control"]="no-cache";try{yield a.fetch(e).R}catch(f){if(1002===f.code||1003===f.code)return!1}}return!0})};
57
- cj=function(a){return`@@scheme:${a.scheme||""}`+`@@value:${a.value}`+`@@id:${a.id||""}@@type:${a.type||""}`+`@@protocol:${a.protocol||""}`};_.dj=function(a){return a&&a!==_.ag?a:null};
58
- fj=function(a){if(!a)throw new _.H(_.F,3,3101,`Invalid track type: ${a}`);if(!_.Wg(a))throw new _.H(_.F,3,3101,`Invalid track type: ${a}. Track type must be a string!`);switch(a.toLowerCase()){case _.K:return _.K;case _.L:return _.L;case _.N:return _.N;case ej:return ej}throw new _.H(_.F,3,3101,`Unknown track type: ${a}.`);};
59
- ij=function(a,b){a=fj(a);const c=_.dj(b.kind);let d=b.id;d||(d=String(_.gj++));a=new _.hj(d,c===_.ye?ej:a);a.kind=c;a.label=_.dj(b.label);a.language=_.dj(b.language);a.originalLanguage=b.originalLanguage||a.language;return a};_.jj=function(a){return`${a.scheme}//`+`${a.a}${a.port?":"+a.port:""}${a.path}${a.h}${a.f}`};
60
- _.kj=function(a,b,c){return a?(c||Object.keys(a).sort()).reduce(function(d,e){if(!(e in a))return d;const f=a[e];let g="\x26";""===d&&(g=b?"":"?");d=d+g+encodeURIComponent(e);return d=d+"\x3d"+encodeURIComponent(void 0===f?"":f)},""):""};_.lj=function(a){const b={};a=a||"";a=a.substring(a.indexOf("?")+1);for(const d of a.split("\x26")){var c=d.split("\x3d");a=decodeURIComponent(c[0]);c=decodeURIComponent(c[1]||"");a&&(b[a]=c)}return b};
61
- mj=function(a,b){return a.startsWith("http:://")||a.startsWith("https:://")?a:(new URL(a,b)).toString()};nj=function(a,b){return _.x(function*(){const c=_.Si(b);return yield $i(a.f,c)})};rj=function(a,b,c){return _.x(function*(){const {mimeType:d,renditions:e}=yield oj(a,b,c),f=new _.hj("dummy",_.N),g=e.map((h,k)=>{k=new _.pj(`R${k}`,f);k.bandwidth=h.bandwidth;k.Kc=h.Kc;k.codec=h.codec;k.width=h.width;k.height=h.height;return k});qj(g);return{renditions:g,mimeType:d||void 0}})};
62
- tj=function(a){a=a.split("\n").filter(c=>c.trim().startsWith("#EXT-X-MEDIA:")).map(c=>sj(c));const b=new Map;a.forEach(c=>{if(c.type&&c.name){const d=`${c.type}:${c.name}`;if(b.has(d))throw Error("#EXT-X-MEDIA:NAME attributes are not unique. It is impossible to map HLS metadata to Safari data structures.");b.set(d,c)}});return b};oj=function(a,b,c){return _.x(function*(){const d=wj(b),e=xj(b,c);return{mimeType:yield yj(a,e,d[0]?d[0].codec:null),renditions:d}})};
63
- qj=function(a){const b=new Set;a.forEach(c=>{b.add(`${c.width}x${c.height}`)});if(b.size<a.length)throw Error("Playlist contains multiple renditions with the same resolution.");};sj=function(a){const b=_.Ni(0,a);a=d=>(d=b.getAttribute(d))?d.value:void 0;var c=a(_.Kb);c=null!=c?{AUDIO:_.L,VIDEO:_.N,SUBTITLES:_.K}[c]:void 0;return{type:c,groupId:a(_.Va),name:a("NAME"),language:a(_.cb),Mh:a("AUTOSELECT"),default:a("DEFAULT"),Th:a("FORCED"),$e:a("CHARACTERISTICS"),uri:a(_.Mb)}};
64
- wj=function(a){return a.split("\n").filter(b=>b.trim().startsWith("#EXT-X-STREAM-INF:")).map(b=>{var c=_.Ni(0,b);if(c.getAttribute(_.Sb))throw Error("Playlist contains alternative video streams.");var d=_.I(c,_.Cb);b=d?Number(d.split("x")[0]):null;d=d?Number(d.split("x")[1]):null;var e=_.I(c,_.ma);e=e?Number(e):null;var f=_.I(c,"AVERAGE-BANDWIDTH");f=f?Number(f):null;c=_.I(c,_.pa);c=_.zj(_.w,c?c.split(","):[]);return b={bandwidth:e,Kc:f,codec:c,width:b,height:d,mimeType:null}})};
65
- xj=function(a,b){return(a=a.split("\n").filter(c=>c.trim().endsWith(".m3u8"))[0])?mj(a,b):null};yj=function(a,b,c){return _.x(function*(){if(!b||!c)return null;var d=yield nj(a,b);d=[Aj(d,b),Bj(d,b)].filter(Boolean);return _.Cj(d,_.w,c)})};Aj=function(a,b){return(a=a.split("\n").find(c=>!c.startsWith("#")&&0<c.trim().length))?mj(a,b):null};Bj=function(a,b){a=a.split("\n").find(c=>c.startsWith("#EXT-X-MAP:"));return a?(a=_.I(_.Ni(0,a),_.Mb))?mj(a,b):null:null};
66
- _.Ej=function(a,b,c){for(const d of _.Dj)if(d.probe(b,c))return d.create(a);return null};_.Fj=function(a){a=_.Dj.indexOf(a);0<=a&&_.Dj.splice(a,1)};Ij=function(a,b){var c=Gj;Hj.set(`${a.toLowerCase().split(";")[0]}-${c}`,{priority:c,plugin:b})};_.Mj=function(a,b){var c=[Jj,Kj,Lj,Gj];for(const d of c)if(c=Hj.get(`${a.toLowerCase().split(";")[0]}-${d}`)){const e=c.plugin(),f=e.isSupported(a,b);e.destroy();if(f)return c.plugin}return null};
67
- _.Nj=function(a,b){b&&(a+=';codecs\x3d"'+b+'"');return a.replace(/\s/g,"")};_.Oj=function(a){return a.split(";")[0]};_.Pj=function(a){a=a.split(/\s*;\s*/);a.shift();return(a=a.find(b=>b.startsWith("codecs\x3d")))?a.split("\x3d")[1].replace(/^"|"$/g,"").split(/\s*,\s*/).join(","):""};Qj=function(a,b,c){a.stop();let d=!0,e=null;a.a=()=>{c?clearInterval(e):clearTimeout(e);d=!1};const f=()=>{d&&a.f()};e=c?setInterval(f,1E3*b):setTimeout(f,1E3*b);return a};
68
- Uj=function(){if(Rj)return Rj;Sj||(Sj=new _.Tj(()=>{Rj=null}));(Rj=document.querySelector(_.w)||document.querySelector(_.p))||(Rj=document.createElement(_.w));Sj.ha(1);return Rj};_.Vj=function(){return!!navigator.userAgent.match(/Edge?\//)};_.Wj=function(a){return(navigator.userAgent||"").includes(a)};_.Xj=function(a){return _.Wj("Tizen"+(a?" "+String(a):""))};
69
- Zj=function(a){const b={major:-1,name:bg};if(!a)return b;var c=a.replace(/_/g,".");b.name=c;c=c.split(".");1<=c.length&&(b.major=Yj(a,c[0]));2<=c.length&&(b.minor=Yj(a,c[1]));3<=c.length&&(b.patch=Yj(a,c[2]));4<=c.length&&(b.build=Yj(a,c[3]));return b};_.ak=function(){return _.Wj("Web0S")};_.ck=function(){return _.ak()&&79===_.bk().major};
70
- _.bk=function(){const a=dk();const b=["ie","edge","opera","firefox","safari",dd];var c=ek();const d=fk[c];for(let e=0,f=b.length;e<f;e++)if(c=d[b[e]]&&a.match(d[b[e]]))return Zj(c[1]);return Zj("")};_.gk=function(){return _.Wj("CrKey")};_.hk=function(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!_.Xj()};_.ik=function(){return/(?:iPhone|iPad|iPod|Android)/.test(navigator.userAgent)?!0:_.hk()&&1<navigator.maxTouchPoints};_.jk=function(){return/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)};
71
- Yj=function(a,b){try{return parseInt(b,10)}catch(c){kk.warn("Unable to parse version number for '"+b+"' from '"+a+"'")}return-1};lk=function(a,b){if(!a||!b||0===b.length)return!1;for(let c=0;c<b.length;c++)if(0<=a.indexOf(b[c]))return!0;return!1};
72
- ek=function(){const a=dk();if(!a)return mk;var b=a.match(/^.+?(?=\))/);if(!b)return mk;b=b[0];if(lk(b,["iphone","ipad"]))return nk;if(lk(b,["android"]))return ok;if(lk(b,["macintosh"]))return pk;if(lk(b,["windows nt"]))return qk;if(lk(b,["tizen"]))return rk;if(lk(b,["web0s"]))return sk;if(lk(b,["linux"]))return tk;kk.warn("Unable to identify OS from user agent: "+a);return mk};dk=function(){let a=window.navigator.userAgent;return a=a.toLowerCase()};
73
- _.vk=function(){var a=ek();var b=ek();var c=fk[b];if(c){c=dk().match(c.os_version)[1];c=Zj(c);if(b===qk)if("5.1"===c.name)c.name="xp";else if("6.1"===c.name)c.name="7";else if("6.2"===c.name||"6.3"===c.name)c.name="8";b=c}else b=Zj("");a:{c=dk();const e=["ie","edge","opera","firefox","safari",dd];var d=ek();d=fk[d];for(let f=0,g=e.length;f<g;f++)if(d[e[f]]&&c.match(d[e[f]])){c=e[f];break a}c=uk}return{os:a,osVersion:b,browser:c,browserVersion:_.bk()}};
74
- wk=function(a,b,c){return a.type!==c?!1:void 0!==b.id&&null!==b.id&&""!==b.id?a.id===b.id:_.Yg(a,{kind:_.dj(b.kind),language:_.dj(b.language),label:_.dj(b.label)},["kind","language","label"])};xk=function(a){return a.enabled||a.selected||a.mode===_.Gf||a.mode===_.$d};zk=function(a,b,c){return yk(a)&&b===_.N&&!!c.enableHlsVideoTrackInfo};
75
- Ak=function(a,b,c){return _.x(function*(){var d=a.m.getLoadedSource();d&&a.j&&(d=yield a.j.a(d.url,c),d.mimeType&&(b.mimeType=d.mimeType),d.renditions&&0<d.renditions.length&&(b.renditions=d.renditions,b.renditions.forEach(e=>{e.track=b})))})};Bk=function(a,b,c){return yk(a)&&(b===_.L||b===_.K)&&!!c.enableMetadata};
76
- Ck=function(a,b,c){return _.x(function*(){var d=a.m.getLoadedSource();d&&a.j&&(d=yield a.j.a(d.url,c),d.Ec&&(d=d.Ec.get(`${b.type}:${b.label}`))&&d.$e&&(b.accessibility=d.$e.split(",").map(e=>e.trim()).map(e=>({value:e,type:b.type,protocol:"HLS"}))))})};Dk=function(a,b){return a.h.filter(c=>c.type===b)};Ek=function(a){(a=a.m.getTextDisplayer())&&a.remove(0,Infinity)};Gk=function(a,b){if(a=Fk(a,b))a=Array.from(a),b===_.K&&(a=a.filter(c=>c.kind!==_.ye));return a};
77
- Fk=function(a,b){if(!a.m)return null;a=a.m.getSurface();if(!a)return null;a=a.getMedia();if(!a)return null;switch(b){case _.L:return a.audioTracks;case _.N:return a.videoTracks;case _.K:return a.textTracks;default:return null}};Hk=function(a,b){return(a=a.a.get(b)||null)&&a.renditions[0]};Ik=function(a,b){return(a=a.l.get(b))&&a.renditions[0]};
78
- Lk=function(a,b,c){const d=Gk(a,b);if(c){if(void 0===a.h.find(f=>f.id===c.id))throw Error(`Unknown track with ID ${c.id} and type ${b}`);if(c.type!==b)throw Error(`Types mismatch for track ${c.type} and arg ${b}`);a.g.debug("Activate track type "+b+" with ID: "+c.id);if(d){a.l.set(b,c);let f;var e=!0;let g=!1;switch(b){case _.K:f="mode";e=_.Gf;g=_.Fd;break;case _.L:f="enabled";break;case _.N:f="selected"}if(f)for(const h of d)h[f]=wk(c,h,c.type)?e:g}}else if(a.g.debug(_.Aa+b),a.a.get(b)&&d&&b===_.K){for(e of d)e.mode=
79
- _.Fd;a.a.set(b,null)}b===_.L?a.m.trigger(new _.E(_.Jk)):b===_.K&&a.m.trigger(new _.E(_.Kk))};Mk=function(a,b,c){if(a.m){var d=a.m.getSurface().getMedia();if(d){var e=document.createElement("track");e.id=c;e.kind=b.kind;e.srclang=b.language;b.label&&(e.label=b.label);e.src=_.yi(b.url)?URL.createObjectURL(new Blob([])):b.url;d.appendChild(e);a.I.push(e)}}};
80
- Nk=function(a,b){return _.x(function*(){var c=a.m.getConfiguration(),d=_.Ej(c,b.mimeType,_.Vf);if(d){c=_.Si(b.url);var e=yield a.m.getNetworkEngine().fetch(c).R;e&&e.data&&(c="External_"+`${a.G++}`,a.o[c]=b,d=d.a(_.J(e.data)),d={url:URL.createObjectURL(new Blob([d])),kind:b.kind,language:b.language,label:b.label,mimeType:_.Vf},Mk(a,d,c))}else a.g.warn("Track MIME type is not supported",b)})};yk=function(a){a=a.m.getLoadedSource();return!(!a||a.type!==_.Ok&&!a.url.endsWith(".m3u8"))&&_.hk()};
81
- Pk=function(a,b,c){c=_.Ah(c).filter(e=>e);a.g.info("Find preferred tracks for",b,c);const d=Dk(a,b);c.some(e=>{const f=_.bi(e);return(e=d.find(g=>{g=_.bi(g.language||"");return _.ci(f,g)}))?(a.g.info("Will select track with id",e.id),Lk(a,b,e),!0):!1})};Rk=function(a){return a.name===rb&&Qk.some(b=>a.message.startsWith(b))};
82
- _.Uk=function(){var a=Infinity;navigator.connection&&navigator.connection.saveData&&_.ik()&&(a=360);const b=_.Pi();b.maxAttempts=3;a={source:"",license:Sk,viewerId:void 0,autoplay:void 0,pauseWhenInBackground:!1,manifest:{attemptParameters:_.Pi(),availabilityWindowOverride:NaN,clockSyncUri:"",ignoreDrmInfo:!1,xlinkFailGracefully:!1,autoCorrectDrift:!0,timeline:{version:1,type:void 0}},abr:{enabled:!0,defaultBandwidthEstimate:1E3,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,
83
- useSwitchIntervalForInitialSwitch:!1,restrictions:Tk(a),useCmsd:!1},drm:null,enableHtmlCue:!0,preferredAudioLanguage:"",preferredTextLanguage:"",preferredAudioRole:_.ue,preferredTextRole:"",preferredAudioChannelCount:2,preferredAudioCodec:[],preferredVideoCodec:[],preferSpatialAudio:!1,preferForcedSubtitles:!1,volume:null,startTime:null,loop:!1,lowLatencyMode:!1,suggestedPresentationDelay:void 0,muted:void 0,forceWaitForTracks:!1,streaming:{attemptParameters:b,bufferingGoal:10,rebufferingGoal:2,bufferBehind:30,
84
- ignoreTextStreamFailures:!1,alwaysStreamText:!1,relativeTextTimestamp:!1,startAtSegmentBoundary:!1,gapDetectionThreshold:.1,disableAudioTracks:!1,disableVideoTracks:!1,smallGapLimit:.5,jumpLargeGaps:!0,durationBackoff:1,maxSegmentToMediaOffset:1,forceNativeTS:!1,preferNativeHlsOnSafari:!0,safeSeekOffset:5,stallEnabled:!0,stallThreshold:3,stallSkip:.5,bufferLimitUpdateInterval:.5,overridePasp:!1,enableLiveEdgeChasing:!1,chasingRate:1.15,startChasingAt:5,stopChasingAt:2,chaseJumpDistance:10,patchEdgeWhenMixedContent:!1,
85
- ignoreDrift:!1,disableFragmentSupport:!1,disableMergedFragments:!1,ignoreManagedMediaSourceStreamingHints:!1},mediaSource:{codecSwitchingStrategy:_.of},restrictions:Tk(),tizen:{sideStreamText:_.Xj(2)},safari:{enableHlsVideoTrackInfo:!1,enableMetadata:!1},trickPlay:{speedUpMode:_.Dd,preferTrickPlayTracks:!0},playlist:{timeline:"basic",content:_.Tb,cropTimeline:!1}};if(_.Wj("Edge/")||_.Xj())a.streaming.gapDetectionThreshold=.5;_.ak()&&(a.streaming.stallEnabled=!1);_.ck()&&(a.streaming.stallEnabled=
86
- !0,a.streaming.stallThreshold=1,a.streaming.stallSkip=1,a.streaming.gapDetectionThreshold=.02);_.Xj()&&(a.streaming.stallEnabled=!0,a.streaming.stallThreshold=1,a.streaming.stallSkip=0);a.vr={enable:!1,attachMouseListener:!0,fieldOfView:70,sensitivity:1,invertHorizontalControl:!1,invertVerticalControl:!1};return a};Tk=function(a){a=void 0===a?Infinity:a;return{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:a,minPixels:0,maxPixels:Infinity,minBandwidth:0,maxBandwidth:Infinity}};
87
- _.Wk=function(...a){if(!a)return _.Uk();var b=[_.Uk()];let c=!1;for(let d of a)null!==d&&void 0!==d&&(_.Wg(d)&&(d={source:d}),d.lowLatencyMode&&!c&&(b.push({streaming:{rebufferingGoal:.1,bufferLimitUpdateInterval:.01,ignoreDrift:!0,attemptParameters:{maxAttempts:3,baseDelay:250,backoffFactor:1}},abr:{bandwidthUpgradeTarget:.6,bandwidthDowngradeTarget:.95},manifest:{lowLatencyMode:!0}}),c=!0),b.push(d),null!=d.suggestedPresentationDelay&&b.push({manifest:{suggestedPresentationDelay:d.suggestedPresentationDelay}}));
88
- a=_.Pg.apply(null,b);_.Wg(a.volume)&&(""===""+a.volume?a.volume=null:a.volume=Number(a.volume));if(!_.A(a.volume)&&(!_.Xg(a.volume)||Zg(a.volume)))throw new _.H(_.F,7,7100,"config.volume is not a number");if(!_.A(a.preferredTextLanguage)&&!_.Wg(a.preferredTextLanguage)&&!Array.isArray(a.preferredTextLanguage))throw new _.H(_.F,7,7100,"config.preferredTextLanguage is not a string or an array");if(!_.A(a.preferredAudioLanguage)&&!_.Wg(a.preferredAudioLanguage)&&!Array.isArray(a.preferredAudioLanguage))throw new _.H(_.F,
89
- 7,7100,"config.preferredAudioLanguage is not a string or an array");if(!_.A(a.preferredAudioCodec)&&!_.Wg(a.preferredAudioCodec)&&!Array.isArray(a.preferredAudioCodec))throw new _.H(_.F,7,7100,"config.preferredAudioCodec is not a string or an array");if(!_.A(a.preferredVideoCodec)&&!_.Wg(a.preferredVideoCodec)&&!Array.isArray(a.preferredVideoCodec))throw new _.H(_.F,7,7100,"config.preferredVideoCodec is not a string or an array");if(!_.A(a.drm)){if(a.drm.env&&!_.Wg(a.drm.env))throw new _.H(_.F,7,
90
- 7100,"config.drm.env is not a string");if(a.drm.offlineId&&!_.Wg(a.drm.offlineId))throw new _.H(_.F,7,7100,"config.drm.offlineId is not a string");}if(b=a.streaming){b.bufferingGoal=Number(b.bufferingGoal);b.rebufferingGoal=Number(b.rebufferingGoal);b.bufferBehind=Number(b.bufferBehind);b.smallGapLimit=Number(b.smallGapLimit);b.durationBackoff=Number(b.durationBackoff);if(!_.Xg(b.bufferingGoal)||Zg(b.bufferingGoal))throw new _.H(_.F,7,7100,"config.streaming.bufferingGoal is not a number");if(!_.Xg(b.rebufferingGoal)||
91
- Zg(b.rebufferingGoal))throw new _.H(_.F,7,7100,"config.streaming.rebufferingGoal is not a number");if(b.rebufferingGoal>b.bufferingGoal)throw new _.H(_.F,7,7100,"config.streaming.rebufferingGoal must be \x3e\x3d bufferingGoal");if(!_.Xg(b.bufferBehind)||Zg(b.bufferBehind))throw new _.H(_.F,7,7100,"config.streaming.bufferBehind is not a number");if(!_.Xg(b.smallGapLimit)||Zg(b.smallGapLimit))throw new _.H(_.F,7,7100,"config.streaming.smallGapLimit is not a number");if(!_.Xg(b.durationBackoff)||Zg(b.durationBackoff))throw new _.H(_.F,
92
- 7,7100,"config.streaming.durationBackoff is not a number");b=a.manifest;if(_.A(b.availabilityWindowOverride))b.availabilityWindowOverride=NaN;else if(typeof b.availabilityWindowOverride!==_.t)throw new _.H(_.F,7,7100,"Invalid value for |manifest.availabilityWindowOverride|");Vk(a.restrictions);Vk(a.abr.restrictions);a.abr.initialRestrictions&&Vk(a.abr.initialRestrictions)}return a};
93
- Vk=function(a){_.A(a.maxPixels)&&(a.maxPixels=Infinity);_.A(a.maxBandwidth)&&(a.maxBandwidth=Infinity);_.A(a.maxHeight)&&(a.maxHeight=Infinity);_.A(a.maxWidth)&&(a.maxWidth=Infinity);_.A(a.minPixels)&&(a.minPixels=0);_.A(a.minBandwidth)&&(a.minBandwidth=0);_.A(a.minHeight)&&(a.minHeight=0);_.A(a.minWidth)&&(a.minWidth=0);a.minWidth=Number(a.minWidth);a.maxWidth=Number(a.maxWidth);a.minHeight=Number(a.minHeight);a.maxHeight=Number(a.maxHeight);a.minBandwidth=Number(a.minBandwidth);a.maxBandwidth=Number(a.maxBandwidth);
94
- a.minPixels=Number(a.minPixels);a.maxPixels=Number(a.maxPixels);if(Number.isNaN(a.minWidth)||Number.isNaN(a.maxWidth)||Number.isNaN(a.minHeight)||Number.isNaN(a.maxHeight)||Number.isNaN(a.minBandwidth)||Number.isNaN(a.maxBandwidth)||Number.isNaN(a.minPixels)||Number.isNaN(a.maxPixels))throw new _.H(_.F,7,7100,"Restrictions contain NaN");};Xk=function(a){return typeof a===_.Fe&&!Array.isArray(a)&&"source"in a};_.Zk=function(a){return _.Yk.get(a)||null};
95
- _.al=function(a){_.Yk.get(a.id())?$k.warn("Component already in use."):_.Yk.set(a.id(),a)};bl=function(a){return Array.from(_.Yk.values()).find(b=>b instanceof a)||null};dl=function(a){for(const b of _.Yk.values())a(b)};el=function(a){dl(b=>{b.o(a)})};fl=function(a){dl(b=>{b.h(a)})};gl=function(){dl(()=>{})};hl=function(){dl(()=>{})};il=function(a){if(null!==bl(a))return null;a=new a;a.f();_.al(a);$k.info("Installed component:",a.id());return a};
96
- jl=function(a){if(a=bl(a))a.a(),_.Yk.delete(a.id()),$k.info("Uninstalled component:",a.id())};kl=function(a){return _.vi(a,_.vd)||_.vi(a,_.xd)};ll=function(a,b){3===b.type&&(a.f&&(a.g.debug("Attaching tracking token"),b.headers[Dg]=a.f),a.a&&(b.headers[Eg]=a.a))};
97
- ml=function(a,b){return b.request&&3===b.request.type&&(a.f=b.headers[Dg],a.a=b.headers[Eg],b=b.headers["x-dt-csl-renewal-info"],a.f&&a.g.debug("Loaded tracking token "+a.f),a.a&&a.g.debug("Loaded followup token "+a.a),b)?(a=JSON.parse(_.oi(_.Ei(b))),{delay:a.renewalPeriod,Jh:{maxAttempts:a.retryCount,baseDelay:1E3*a.retryPeriod,backoffFactor:1,fuzzFactor:0,timeout:0}}):null};_.ol=function(a){_.nl[a.I]=a};
98
- _.ql=function(a){const b={attemptParameters:_.Pi(),enforceSingleSession:!1,delayLicenseRequestUntilPlayed:!1,enableSessionCacheForSkd:!1,ignoreUnrecognizedInitData:!0,Za:{},widevineVersion:_.zd};if(a&&(b.enforceSingleSession=!!a.enforceSingleSession,b.delayLicenseRequestUntilPlayed=!!a.delayLicenseRequestUntilPlayed,b.preferredDrmSystem=a.preferredDrmSystem,b.emeApi=a.emeApi,a.attemptParameters&&(b.attemptParameters=a.attemptParameters),b.enableSessionCacheForSkd=!!a.enableSessionCacheForSkd,void 0!==
99
- a.ignoreUnrecognizedInitData&&(b.ignoreUnrecognizedInitData=!!a.ignoreUnrecognizedInitData),typeof a.widevineVersion===_.Qf&&0<a.widevineVersion.length&&(b.widevineVersion=a.widevineVersion),a.env)){const c=_.nl[a.env]||null;if(!c)throw _.ih(_.va,_.zb+a.env+_.aa),new _.H(_.F,6,6015,`DRM environment '${a.env}' is missing.`);b.Za=_.pl(c,a.customData)||{};_.vi(a.env.toLowerCase(),Qd)&&(b.enforceSingleSession=!0)}return b};
100
- sl=function(a){a=rl[a];if(!a)return null;const b=_.vk();return b.os===ok&&4===b.osVersion.major&&4===b.osVersion.minor?null:new Uint8Array(a)};
101
- _.pl=function(a,b){const c={};var d=b?b.widevineVideoRobustness:void 0,e=b?b.widevineAudioRobustness:void 0;const f=b?b.serverCertificate:void 0;var g=a.f[_.zd];if(g){var h=g.licenseUrl;d=Lh(d,g.videoRobustness);e=Lh(e,g.audioRobustness);var k=g.modifiers,l=Kh(b?b.widevineDistinctiveIdentifierRequired:void 0,g.distinctiveIdentifierRequired,!1),m=Kh(b?b.widevinePersistentStateRequired:void 0,g.persistentStateRequired,!1);g=void 0===f?g.serverCertificate:null===f?null:typeof f===_.Qf?sl(f):f;c[_.zd]=
102
- {licenseUrl:h,videoRobustness:d,audioRobustness:e,modifiers:k,distinctiveIdentifierRequired:l,persistentStateRequired:m,serverCertificate:g}}(g=a.f[_.vd])&&(c[_.vd]={licenseUrl:g.licenseUrl,certificateUrl:g.certificateUrl,modifiers:g.modifiers});h=b?b.playReadyVideoRobustness:void 0;b=b?b.playReadyAudioRobustness:void 0;(g=a.f[_.xd])&&(c[_.xd]={licenseUrl:g.licenseUrl,videoRobustness:h||g.videoRobustness,audioRobustness:b||g.audioRobustness,individualizationServer:g.individualizationServer,useLegacySystem:g.useLegacySystem,
103
- modifiers:g.modifiers});return c};_.tl=function(){throw new _.H(_.F,3,3E3);};_.ul=function(a,b,c){const d=c||0;c=b.byteLength-d;const e=_.J(a.f.buffer);b=_.J(b.buffer,d,c);try{e.set(b,a.a),a.a+=c}catch(f){_.tl()}};_.O=function(a,b){try{a.f.setUint32(a.a,b,a.h),a.a+=4}catch(c){_.tl()}};_.vl=function(a){return a.a<a.f.byteLength};_.wl=function(){throw new _.H(_.F,3,3E3,"Buffer read out of bounds.");};_.xl=function(a){try{const b=a.f.getUint8(a.a);a.a+=1;return b}catch(b){_.wl()}};
104
- _.yl=function(a){try{const b=a.f.getUint16(a.a,a.h);a.a+=2;return b}catch(b){_.wl()}};_.P=function(a){try{const b=a.f.getUint32(a.a,a.h);a.a+=4;return b}catch(b){_.wl()}};_.zl=function(a){try{const b=a.f.getInt32(a.a,a.h);a.a+=4;return b}catch(b){_.wl()}};_.Al=function(a){let b=0,c=0;try{!0===a.h?(b=a.f.getUint32(a.a,!0),c=a.f.getUint32(a.a+4,!0)):(c=a.f.getUint32(a.a,!1),b=a.f.getUint32(a.a+4,!1))}catch(d){_.wl()}if(2097151<c)throw new _.H(_.F,3,3001);a.a+=8;return c*Math.pow(2,32)+b};
105
- Bl=function(a,b){const c=new Uint8Array(b);for(let d=0;d<b;d++)c[d]=_.xl(a);return c};_.Cl=function(a,b){a.a+b>a.f.byteLength&&_.wl();var c=a.a+a.f.byteOffset;c=a.f.buffer.slice(c,c+b);a.a+=b;return _.J(c)};Dl=function(a){let b=0;for(let c=0;c<a.length;c++)b=b<<8|a.charCodeAt(c);return b};_.El=function(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)};_.Fl=function(a){for(;_.vl(a.reader)&&!a.parser.a;)a.parser.Ld(a.start+a.headerSize,a.reader,a.partialOkay)};
106
- _.Gl=function(a){for(let b=_.P(a.reader);0<b&&!a.parser.a;--b)a.parser.Ld(a.start+a.headerSize,a.reader,a.partialOkay)};_.Hl=function(a){return b=>{const c=b.reader.Ha()-b.reader.getPosition();a(_.Cl(b.reader,c))}};_.Il=function(a){return 8+(a.has64BitSize?8:0)+(null!=a.flags?4:0)};Jl=function(a){let b="";try{b=_.ri(a)}catch(c){}return b};_.Ll=function(a){a=Jl(a);let b="";a.length&&(b=(new _.Kl(a)).a);return b};
107
- Nl=function(a){if(!a)return null;let b=null;try{const c=JSON.parse(_.oi(a)),d=_.Ei(c.sinf[0]);(new _.Ml).M(_.Jf,_.Fl).M("schi",_.Fl).M("tenc",e=>{e.reader.skip(6);_.xl(e.reader)&&(e.reader.skip(1),b=_.Gi(_.Cl(e.reader,16)));e.parser.stop()}).parse(d)}catch(c){}return b};
108
- Pl=function(a,b,c){if(!c||!c.byteLength)throw new _.H(_.F,6,6102);let d;typeof b===_.Qf?d=_.ti(b,!0):d=b;a=_.ti(Jl(a),!0);b=new _.Ol(12+a.byteLength+d.byteLength+c.byteLength,!0);_.O(b,a.byteLength);_.ul(b,_.J(a));_.O(b,d.byteLength);_.ul(b,_.J(d));_.O(b,c.byteLength);_.ul(b,_.J(c));return _.J(b.buffer)};_.Ql=function(a){var b=_.J(a.body);b=_.Di(b);a.headers[ua]=Fc;a.body=_.si("spc\x3d"+b).buffer};
109
- _.Rl=function(a){let b;try{b=_.oi(a.data)}catch(c){return}b=b.trim();"\x3cckc\x3e"===b.substr(0,5)&&"\x3c/ckc\x3e"===b.substr(-6)&&(b=b.slice(5,-6));try{const c=JSON.parse(b);c.ckc&&(b=c.ckc);c.CkcMessage&&(b=c.CkcMessage);c.License&&(b=c.License)}catch(c){}a.data=mi(_.Ei(b))};Wl=function(a,b){b=Sl(b);if(a===_.zd)return b+Tl;if(a===_.xd)return b+Ul;if(a===_.vd)return b+Vl;throw Error("Unknown DRM Key-System '"+a+"'. Can not infer license URL!");};
110
- _.Zl=function(a,b,c,d){d=void 0===d?!0:d;c=a.drm;c&&c.env.startsWith(xa)?c.customData&&(_.Yl(b,a),a=b.uris[0],d&&c.customData.assetId&&(a+="?assetId\x3d"+encodeURI(`${c.customData.assetId}`),c.customData.variantId&&(a+="\x26variantId\x3d"+encodeURI(`${c.customData.variantId}`)),b.uris[0]=a)):Xl.warn(kb)};
111
- _.$l=function(a,b){try{const c=_.J(b.data),d=JSON.parse(String.fromCharCode.apply(null,c));Xl.debug("Widevine License response",d);const e=atob(d.license),f=new Uint8Array(e.length);for(a=0;a<e.length;++a)f[a]=e.charCodeAt(a);b.data=f.buffer}catch(c){Xl.debug("Unable to parse DRMtoday response JSON, assuming the response contained raw data")}};
112
- _.bm=function(a,b,c){var d=c&&c.customData&&c.customData.fpsContentId;_.Zl(a,b,c,!1);b.headers[ua]=Fc;c={spc:_.Ci(b.body)};if((a=a.drm)&&a.env.startsWith(ya)&&d){a={};var e=_.lj((new _.Kl(am(d))).f);d=e.keyId;if(e=e.assetId)Xl.info("Applying assetId from HLS manifest."),a.assetId=e;d&&(Xl.info("Applying keyId from HLS manifest."),a.keyId=d);d=a;d.keyId&&(Xl.info("Adding keyID to FPS payload:",d.keyId),c.keyId=d.keyId);d.assetId&&(Xl.info("Adding assetID to FPS payload:",d.assetId),c.assetId=d.assetId)}b.body=
113
- _.ui(_.kj(c,!0))};_.cm=function(a,b){Xl.debug("Clearing response data");200===b.status&&(a=_.oi(b.data).trim(),"\x3cckc\x3e"===a.substr(0,5)&&"\x3c/ckc\x3e"===a.substr(-6)&&(a=a.slice(5,-6)),b.data=_.Ei(a).buffer)};
114
- _.dm=function(a,b,c){b=Jl(b);c=c&&c.customData?c.customData:{};b=new _.Kl(am(b));const d=_.lj(b.f);if(a&&a.drm&&a.drm.customData){var e=a.drm.customData;a=e.assetId;e=e.variantId;a&&_.xi(`${a}`)&&(d.assetId=a,Xl.debug("Using assetId from the configuration instead of the value from the HLS manifest."));e&&_.xi(`${e}`)&&(d.variantId=e,Xl.info("Using variantId from the configuration instead of the value from the HLS manifest."))}d.keyId?(a=["keyId"],Xl.debug("KeyId found in FPS SKD. Removing other parameters")):
115
- a=["assetId","variantId"];b.f=_.kj(d,!1,a);"/"!==b.path||b.j.includes(`${b.a}/`)||(b.path="");b=_.jj(b);return c.fpsContentId=b};_.em=function(a,b){a=a.drm;if(!a||!a.env.startsWith(xa))Xl.warn(kb);else if(a.customData&&a.customData.merchant&&!a.env.startsWith(ya)){const c=new _.Mh(b.uris[0]);let d=c.Da;d.endsWith("/")||(d+="/");d+=a.customData.merchant;c.Da=d;b.uris[0]=c.toString()}};fm=function(a,b,c){_.Zl(a,b,c);a=a.drm;a=!(!a||!a.offlineId);c=new _.Mh(b.uris[0]);c.a.add(_.Qe,a);b.uris[0]=c.toString()};
116
- Sl=function(a){if(a===gm)return"https://lic.drmtoday.com";if(a===hm)return"https://lic.staging.drmtoday.com";if(a===im)return"https://lic.test.drmtoday.com";throw Error("Unknown DRMtoday environment '"+a+"'. Can not infer DRMtoday base URL!");};am=function(a){a=a.replace(/assetid/gi,"assetId");a=a.replace(/variantid/gi,"variantId");return a=a.replace(/keyid/gi,"keyId")};
117
- _.Yl=function(a,b){if((b=b.drm)&&b.customData){var c={userId:b.customData.userId,sessionId:b.customData.sessionId,merchant:b.customData.merchant};_.Sg(c)&&(a.headers["dt-custom-data"]=btoa(JSON.stringify(c)));(b=b.customData.authToken)&&(a.headers["x-dt-auth-token"]=b)}};km=function(a){const b={},c=a?a[Fg]:void 0;a=jm[a?a[Fg]:void 0];c&&(b.drmTodayErrorCode=c);a&&(b.drmTodayErrorMessage=a);return b};
118
- mm=function(a,b=0){_.hh("Registering EME Factory: "+a.a());a={priority:b,Pb:a};for(let c=0;c<lm.length;++c)if(lm[c].priority<b){lm.splice(c,0,a);return}lm.push(a)};nm=function(a){if(a){const {Pb:b}=lm.find(({Pb:c})=>c.a()===a);if(b&&b.isSupported())return _.hh(Yb+b.a()),b.create();_.hh("Cannot create selected EME manager. Choosing by priority list.")}for(const {Pb:b}of lm)if(b.isSupported())return _.hh(Yb+b.a()),b.create();throw Error("Missing EME managers");};
119
- _.pm=function(a,b){a=_.om(a,b);return 1!==a.length?null:a[0]};_.om=function(a,b){return Array.prototype.filter.call(a.childNodes,c=>c instanceof Element&&c.tagName===b)};_.qm=function(a){return Array.prototype.every.call(a.childNodes,b=>b.nodeType===Node.TEXT_NODE||b.nodeType===Node.CDATA_SECTION_NODE)?a.textContent.trim():null};
120
- _.rm=function(a,b){const c=new DOMParser;let d=null,e=null;try{e=c.parseFromString(a,_.Wf)}catch(f){}e&&e.documentElement.tagName===b&&(d=e.documentElement);return d&&0<d.getElementsByTagName("parsererror").length?null:d};_.xm=function(a){var b=_.Fi(a);b=parseInt(b.byteLength,10).toString(16);b=_.Fi("12"+b+a);return new sm(tm,a,b)};
121
- _.zm=function(a){const b=new _.ym(new DataView(a.buffer,a.byteOffset,a.byteLength),!1);a=_.P(b);var c=_.P(b);c=_.El(c);var d=_.P(b);const e=d>>>24;d&=16777215;var f=_.Cl(b,16);f=_.Gi(f);if(0<e){var g=_.P(b);b.skip(16*g)}g=_.P(b);const h=()=>{let u=_.xl(b),v=(u&127)>>>0,y=7;for(;128<=u&&28>=y;)u=_.xl(b),v=(v|(u&(28>y?127:15))<<y)>>>0,y+=7;return 28<y?-1:v},k=u=>{switch(u){case 0:do if(!_.vl(b))throw Error("not enough data to skip!");while(_.xl(b)&128);break;case 1:b.skip(8);break;case 2:b.skip(h());
122
- break;case 3:for(;4!==(u=h()&7);)k(u);break;case 5:b.skip(4);break;default:throw Error("invalid wire type "+u);}},l=[];let m=null;for(;_.vl(b);){var n=h(),q=n&7;n>>>=3;if(2===q){q=h();if(0>q)throw Error(`unable to read length of field ${n}`);q=Bl(b,q);2===n?l.push(q):4===n&&(m=q)}else k(q)}_.ih("Parsed WV PSSH Box","size",a,"name",c,"version",e,"flags",d,"size",g,"systemId",f,"contentId (base64)",m?_.Ci(m):"","keyIds",l.map(u=>_.Gi(u)));return 0<l.length?_.xm(_.Gi(l[0])):null};
123
- _.Am=function(a){const b=[];b.push(a[3]);b.push(a[2]);b.push(a[1]);b.push(a[0]);b.push(a[5]);b.push(a[4]);b.push(a[7]);b.push(a[6]);a=_.J(a);a.set(b,0);return a};
124
- _.Fm=function(a){a:{var b=new _.ym(new DataView(a.buffer),!0);_.P(b);for(_.yl(b);_.vl(b);)if(1===_.yl(b)){var c=_.yl(b);b=_.Cl(b,c);break a}b=null}b||(b=a);a=qi(b,!0);c=_.rm(a,"WRMHEADER");a=c.getAttribute("version");var d=_.pm(c,"DATA");c=(c=_.pm(d,"LA_URL"))?_.qm(c):"";var e;if(e=_.pm(d,"KID"))if(e=_.qm(e)){var f=_.pm(d,oa);e={value:e,Wd:f?f.textContent.trim():null}}else e=null;else e=null;d=e?[e]:(e=Bm(d))?[e]:(d=Cm(d))?d:null;const {value:g="",Wd:h}=d&&d[0]||{};d=_.Ei(g);d=_.Am(d);d=_.Gi(d);return new _.Dm(_.Em,
125
- d,c,b,a,h)};Bm=function(a){a=_.pm(a,"PROTECTINFO");if(!a)return null;var b=_.pm(a,"KID");if(!b)return null;a=b.getAttribute("VALUE");if(!a)return null;const c=b.getAttribute(oa);b=b.getAttribute("ALGID");return{value:a,Wd:c,cg:b}};
126
- Cm=function(a){a=_.pm(a,"PROTECTINFO");if(!a)return null;a=_.pm(a,"KIDS");if(!a)return null;var b=_.om(a,"KID");if(!b.length)return null;a=[];for(const c of b)if(b=c.getAttribute("VALUE")){const d=c.getAttribute(oa),e=c.getAttribute("ALGID");a.push({value:b,Wd:d,cg:e})}return a.length?a:null};_.Hm=function(a){Gm&&performance.mark(a)};_.Im=function(a,b,c){Gm&&performance.measure(a,b,c)};
127
- Jm=function(a){return _.x(function*(){const b=new Promise(c=>{(new _.Tj(c)).ha(1)});(yield Promise.race([a.close().then(()=>!0),b.then(()=>!1)]))||_.C("Timeout waiting for session close")})};_.Lm=function(a){return Km(a)?_.xd:a};Mm=function(a,b){const c=[];b.forEach((d,e)=>{c.push({keySystem:e,licenseServerUri:d.licenseUrl,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],keyIds:[]})});for(const d of a)d.drmInfos=c};
128
- Nm=function(a,b){if(a.keySystem){var c=_.Lm(a.keySystem);b=b[c];c===_.Ne&&a.licenseServerUri||(b&&(a.licenseServerUri=b.licenseUrl||""),a.keyIds||(a.keyIds=[]),b&&(a.distinctiveIdentifierRequired||(a.distinctiveIdentifierRequired=b.distinctiveIdentifierRequired),a.persistentStateRequired||(a.persistentStateRequired=b.persistentStateRequired),a.videoRobustness||(a.videoRobustness=b.videoRobustness||""),a.audioRobustness||(a.audioRobustness=b.audioRobustness||""),a.serverCertificate||(a.serverCertificate=
129
- b.serverCertificate||null)))}};_.Om=function(a,b){b=_.Nj(a.mimeType,b||a.codecs);if(_.Mj(b,a.type)){a=a.type;var c=_.Mj(b,a);c&&(c=c(),b=c.convertCodecs(a,b),c.destroy())}return b};Pm=function(a){for(const b of a.audioCapabilities||[])delete b.robustness;for(const b of a.videoCapabilities||[])delete b.robustness};Rm=function(a){return(a.audioCapabilities||[]).some(Qm)||(a.videoCapabilities||[]).some(Qm)};
130
- Sm=function(a,b){a=_.Ll(b);_.ih("Using default Content ID extractor. The hostname part from HLS #EXT-X-KEY:URI skd:// will be used.","Extracted Content ID: "+a);return a};
131
- Tm=function(a){var {playerConfig:b,initData:c,initDataType:d,drmInfo:e,drmSystemConfig:f,sessionContext:g,emeApi:h}=a;if("skd"===d&&"APPLE"===h){a=e.serverCertificate;let k=f&&f.modifiers&&f.modifiers.extractContentId;_.Ug(k)||(k=Sm);let l="";try{l=k(b,c,g)}catch(m){throw new _.H(_.F,6,6103);}if(!l.length)throw new _.H(_.F,6,6101,"Content ID is an empty string");c=Pl(c,l,a)}return c};Km=function(a){return!!a.match(/^com\.(microsoft|chromecast)\.playready/)};
132
- Qm=function(a){return null!=a.robustness&&""!==a.robustness};Um=function(a,b,c,d,e){for(const f of a){b.includes(f.licenseServerUri)||b.push(f.licenseServerUri);f.serverCertificate&&(c.some(g=>_.Hi(g,f.serverCertificate))||c.push(f.serverCertificate));if(f.initData){for(const g of f.initData)g.periodId=f.periodId;for(const g of f.initData)d.some(h=>h.keyId&&h.keyId===g.keyId&&h.periodId===g.periodId?!0:!1)||d.push(g)}if(f.keyIds)for(a=0;a<f.keyIds.length;++a)e.includes(f.keyIds[a])||e.push(f.keyIds[a])}};
133
- Vm=function(a){var b=a.l;const c=a.W;c.clear();b.forEach((d,e)=>c.set(e,d));b=Array.from(c.values());b.length&&b.every(d=>"expired"===d)&&a.U(new _.H(_.F,6,6014));a.D.re(_.ah(c));a.o||a.g.info(wa);a.o=!0;a.B=!1};Wm=function(a){a.f.forEach((b,c)=>{const d=b.me;let e=c.expiration;isNaN(e)&&(e=Infinity);e!==d&&(a.D.qe(c.sessionId,e),b.me=e)})};
134
- Xm=function(a){return _.x(function*(){a.w.release();a.w=null;a.K.release();a.K=null;a.o=!1;a.B=!1;a.F.reject();a.X.stop();a.X=null;a.S.stop();a.S=null;const b=Array.from(a.f.keys());for(const c of a.f.values())c.wc&&c.wc.stop();a.f.clear();yield Promise.all(b.map(c=>Promise.resolve().then(()=>_.x(function*(){a.g.debug("Closing session",c.sessionId);try{yield Jm(c)}catch(d){a.g.warn("Error while closing session",d)}}))));if(a.A){try{yield a.j.h(null)}catch(c){a.g.warn("Error while resetting media keys",
135
- c)}a.A=null}a.j=null;a.a=null;a.H.clear();a.G=null;a.J=[];a.h=null;a.U=null;a.D=null;a.N=0;a.L=null})};_.an=function(a,b){const c=b.some(e=>0<e.drmInfos.length);if(!c){var d=$g(a.h.Za);Mm(b,d)}if(d=Ym(a))for(const e of b)e.drmInfos=[d];for(const e of b)for(const f of e.drmInfos)Nm(f,a.h.Za);b=Zm(a,b);if(!b.size)return a.O=!0,Promise.resolve();_.Hm(Id);a=_.$m(a,b);return(c?a:a.catch(()=>{})).then(()=>{_.Hm(Hd);_.Im("DRM queryMediaKeys_()",Id,Hd)})};
136
- _.cn=function(a,b,c){c=void 0===c?[]:c;a.I=bn;a.J=c;a.C=0<c.length;a.g.debug("Using Persisted Licenses: "+a.C);a.h&&a.h.enableSessionCacheForSkd&&a.g.info("Enabled session cache for SKD license requests");return _.an(a,b)};
137
- _.$m=function(a,b){if(1===b.size&&b.has(""))return Promise.reject(new _.H(_.F,6,6E3));null===a.j&&(a.j=nm(a.h.emeApi));for(var c of b.values())0===c.audioCapabilities.length&&delete c.audioCapabilities,0===c.videoCapabilities.length&&delete c.videoCapabilities;let d=c=new _.dn;const e=(h,k,l)=>{k.drmInfos.some(m=>!!m.licenseServerUri)===h&&(d=d.catch(()=>{if(a.va)return null;if(l===_.xd){if(_.Vj()&&!a.h.Za[l].useLegacySystem)return k.label=yd,a.j.a(yd,[k]).catch(()=>{a.g.warn("Unable to create com.microsoft.playready.recommendation. Falling back to com.microsoft.playready.");
138
- k.label=_.xd;Pm(k);return a.j.a(l,[k])});Pm(k)}if(l===_.zd&&a.h.widevineVersion!==_.zd){const m=a.h.widevineVersion;if(!m.startsWith(_.zd))return a.g.error(`Invalid "widevineVersion" value "${m}".`),Promise.reject();const n=Object.assign({},k,{label:m,distinctiveIdentifier:_.Me,persistentState:_.Me});return a.j.a(m,[n]).catch(()=>a.j.a(l,[k]))}return a.j.a(l,[k]).catch(m=>{a:{if(l===_.zd&&Rm(k)){const n=_.vk();if(Rm(k)&&n.os===ok&&n.browser===dd){a.g.warn("requestMediaKeySystemAccess() failed",m);
139
- a.g.warn("Will try to recover by removing the robustness attribute of videoCapabilities and audioCapabilities.");Pm(k);m=a.j.a(l,[k]);break a}}throw m;}return m})}))};let f=a.h.preferredDrmSystem;if(!f){var g=_.vk();if(g.os===qk&&10<=g.osVersion.major&&"edge"===g.browser)f=_.xd;else if("safari"===g.browser)f=_.vd;else if(g.browser===dd||"firefox"===g.browser)f=_.zd}f&&(g=b.get(f))&&(e(!0,g,f),e(!1,g,f));for(const h of[!0,!1])b.forEach((k,l)=>{l!==f&&e(h,k,l)});d=d.catch(()=>{throw new _.H(_.F,6,6001,
140
- "Failed to get MediaKeySystemAccess.");});d=d.then(h=>{if(a.va)return null;a.H.clear();var k=h.getConfiguration();a.g.info("Got MediaKeySystemAccess with configuration",k);var l=k.audioCapabilities||[];k=k.videoCapabilities||[];for(var m of l)a.H.add(m.contentType.toLowerCase());for(var n of k)a.H.add(n.contentType.toLowerCase());{l=h.keySystem;m=b.get(_.Lm(h.keySystem));n=[];k=[];const q=[],u=[];Um(m.drmInfos,n,k,q,u);1<k.length&&_.C("Multiple unique server certificates found! Only the first will be used.");
141
- 1<n.length&&_.C("Multiple unique license server URIs found! Only the first will be used.");l={keySystem:l,licenseServerUri:n[0],distinctiveIdentifierRequired:m.distinctiveIdentifier===_.xf,persistentStateRequired:m.persistentState===_.xf,audioRobustness:m.audioCapabilities?m.audioCapabilities[0].robustness:"",videoRobustness:m.videoCapabilities?m.videoCapabilities[0].robustness:"",serverCertificate:k[0],initData:q,keyIds:u,periodId:null}}a.a=l;if(!a.a.licenseServerUri)throw new _.H(_.F,6,6012,a.a.keySystem);
142
- return h.createMediaKeys()}).then(h=>{a.va||(a.g.info("Created MediaKeys for key system",a.a.keySystem),a.G=h,a.O=!0)}).catch(h=>{if(!a.va){a.a=null;a.H.clear();if(h instanceof _.H)throw h;throw new _.H(_.F,6,6002,{browserError:h.message});}});c.reject();return d};
143
- Ym=function(a){a=$g(a.h.Za[_.Ne]||{});if(0===a.size)return null;const b=[],c=[];a.forEach((e,f)=>{f=_.Fi(f);e=_.Fi(e);e={kty:"oct",kid:_.Di(f,!1),k:_.Di(e,!1)};b.push(e);c.push(e.kid)});a=JSON.stringify({keys:b});var d=JSON.stringify({kids:c});d=[{initData:_.si(d),initDataType:"keyids"}];return{keySystem:_.Ne,licenseServerUri:"data:application/json;base64,"+window.btoa(a),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:d,
1
+ let g={}; let _ = {};let f=function(window){'use strict';var ba,ca,la,oa,ta,ua,wa,xa,ya,za,Ra,Xa,Ya,$a,ab,bb,db,eb,jb,kb,lb,mb,nb,ob,pb,rb,tb,xb,Ab,Eb,Hb,Ib,Lb,Nb,Qb,Rb,Vb,Wb,Yb,ic,kc,Cc,Hc,Mc,Xc,Yc,dd,ed,fd,hd,id,jd,ld,md,nd,pd,qd,xd,Ad,Gd,Hd,Jd,Kd,Md,Pd,Qd,Sd,Yd,fe,he,ie,te,Le,Se,Ue,Ve,We,Xe,Ye,Ze,$e,af,bf,cf,hf,jf,kf,lf,mf,nf,pf,tf,vf,Kf,Nf,Tf,$f,bg,cg,ig,ug,yg,zg,Ag,Bg,Cg,Eg,Fg,Gg,Hg,Ig,Jg,Mg,Ng,Sg,Pg,$g,ah,ch,fh,hh,mh,wh,xh,qh,th,zh,Bh,Ah,Dh,Eh,Fh,Kh,Lh,Nh,Oh,Sh,Uh,Wh,Qh,Yh,bi,di,fi,ei,gi,hi,ii,li,mi,pi,Pi,Qi,Ti,Ui,Vi,Xi,Yi,Zi,$i,bj,cj,
2
+ dj,ej,hj,kj,oj,pj,vj,xj,sj,uj,wj,yj,zj,Aj,Cj,Dj,Fj,Lj,Tj,Xj,ck,bk,ok,hk,gk,zk,Ak,Ck,Dk,Ek,Fk,Gk,Hk,Jk,Ik,Kk,Lk,Ok,Pk,Qk,Bk,Sk,Wk,Yk,$k,bl,el,jl,kl,ll,ml,nl,ol,pl,ql,rl,sl,tl,zl,Il,Kl,Ql,Ul,Wl,cm,pm,Zl,hm,um,wm,xm,Im,Jm,Qm,Tm,Um,Wm,Ym,Zm,$m,Rm,Xm,an,bn,cn,dn,en,fn,mn,rn,tn,vn,un,xn,pn,En,Bn,Dn,Cn,sn,Fn,Gn,Hn,Nn,On,Pn,Sn,Wn,Xn,Zn,Un,Tn,ho,io,mo,lo,oo,qo,ro,no,to,uo,vo,zo,Co,Bo,Ao,Do,Eo,Go,Ho,Io,Ko,Lo,Jo,Mo,Oo,Po,Qo,Uo,Ro,Wo,$o,ap,Zo,bp,Yo,Xo,fp,ep,kp,lp,qp,sp,up,wp,xp,yp,zp,Ap,Bp,Cp,Hp,Ip,Jp,Kp,Lp,
3
+ Np,Op,Pp,Qp,Rp,Sp,cq,Tp,Up,Vp,Wp,Xp,Yp,Zp,$p,aq,bq,kq,lq,mq,fq,nq,iq,hq,eq,jq,oq,pq,sq,Aq,Bq,Cq,zq,Iq,Dq,Eq,Fq,Gq,Hq,qq,rq,tq,uq,vq,Lq,xq,yq,Qq,Sq,Uq,Vq,Wq,Xq,Yq,Zq,$q,ar,br,cr,dr,hr,lr,nr,pr,rr,sr,tr,vr,Dr,wr,xr,yr,Fr,Br,Gr,Jr,Hr,Ir,Kr,Lr,Mr,Qr,Rr,Ur,es,fs,is,ms,ns,qs,ss,ts,rs,os,hs,ls,js,ks,us,xs,ys,zs,vs,ws,Kg,Lg;_.aa=" is registered.";ba=" is unsupported on this platform.";ca=" to a log level. Falling back to default!";_.da="6.19.1";_.ha="AdaptationSet";_.ia="Already destroyed. No-op";_.ja="Already released. No-op";
4
+ _.ka="Autoplay is not allowed due to browser policy.";la="Autoplay should not be used for preloaded streams. ";_.ma="BANDWIDTH";_.na="BASIC";oa="CHECKSUM";_.pa="CODECS";_.qa="Cannot retrieve buffer information due to platform limitations";_.ra="CastlabsPlayer";_.sa="Configuration is valid";ta="Content-Length";ua="Content-Type";_.va="Could not find configured DRM environment.";wa="DRM licenses loaded";xa="DRMtoday";ya="DRMtodayOnboard";za="Destroying player";_.Aa="Disable track type ";_.Ba="EXT-X-BYTERANGE";
5
+ _.Ca="EXT-X-DATERANGE";_.Da="EXT-X-DISCONTINUITY";_.Ea="EXT-X-DISCONTINUITY-SEQUENCE";_.Fa="EXT-X-ENDLIST";_.Ga="EXT-X-KEY";_.Ha="EXT-X-MAP";_.Ia="EXT-X-MEDIA-SEQUENCE";_.Ja="EXT-X-PART-INF";_.La="EXT-X-PLAYLIST-TYPE";_.Ma="EXT-X-PRELOAD-HINT";_.Na="EXT-X-PROGRAM-DATE-TIME";_.Oa="EXT-X-SERVER-CONTROL";_.Qa="EXT-X-TARGETDURATION";Ra="Error while decoding string!";_.Sa="Error while fetching license!";_.Ta="FairPlay Certificate URL is not defined";_.Va="FairPlay License URL is not defined";_.Wa="GROUP-ID";
6
+ Xa="HW_SECURE_ALL";Ya="HW_SECURE_CRYPTO";$a="HW_SECURE_DECODE";ab="HeaderDrm";bb="InvalidStateError";_.cb="LANGUAGE";db="License verification failed: ";eb="Load interrupted while a player release is pending";_.fb="Loading player with configuration";_.gb="MaxHeight";_.hb="MaxWidth";jb="Missing media element";kb="No drmtoday configuration found in player configuration. Unable to modify the DRM license request!";lb="No event provided!";mb="No items in the playlist";nb="No sources provided!";ob="No track data attached to the event, unable to add track!";
7
+ pb="Not a persistent session.";_.qb="Not supported";rb="NotAllowedError";tb="NotSupportedError";_.ub="PLAYLIST";_.vb="POST";_.wb="PlayReady License URL is not defined";xb="Player not ready yet.";_.yb="Player sources";_.zb="Please make sure ";Ab="Preloading is not supported by this player.";_.Bb="QualityLevel";_.Cb="RESOLUTION";_.Db="Representation";Eb="STANDARD";_.Fb="SW_SECURE_CRYPTO";_.Gb="SW_SECURE_DECODE";Hb="Session is closed";Ib="Skipping Session creation. License for init data was already requested in ";
8
+ _.Jb="SmoothStreamingMedia";_.Kb="TYPE";Lb="The index is not in the allowed range.";_.Mb="URI";Nb="Unable to translate ";_.Ob="Unhandled/ignored event";_.Pb="Unregistering listeners";Qb="Unsupported keySystem";Rb="Using VTTCue polyfill from 3 argument TextTrackCue.";_.Tb="VIDEO";_.Ub="VOD";Vb="Wait for preloading to finish";Wb="WebkitEmeManager.MediaKeySession.load";_.Xb="Widevine License URL is not defined";Yb="Will create EME Manager: ";_.Zb="X-ASSET-LIST";_.$b="X-ASSET-URI";_.ac="X-PLAYOUT-LIMIT";
9
+ _.bc="X-RESUME-OFFSET";_.cc="ad-break-started";_.dc="ad-break-stopped";_.ec="ad-buffering";_.fc="ad-clicked";_.gc="ad-completed";_.hc="ad-first-quartile";ic="ad-hls-asset-list-request";kc="ad-hls-asset-list-response";_.lc="ad-impression";_.mc="ad-loaded";_.nc="ad-midpoint";_.oc="ad-paused";_.pc="ad-progress";_.qc="ad-resumed";_.rc="ad-skipped";_.sc="ad-started";_.tc="ad-stopped";_.uc="ad-third-quartile";_.vc="addtrack";_.wc="ads-timeline-changed";_.xc="airplay-casting-ended";_.yc="airplay-casting-started";
10
+ _.zc="airplay-status-changed";_.Ac="application/cea-608";_.Bc="application/dash+xml";Cc="application/mp4";_.Dc='application/mp4; codecs\x3d"stpp"';_.Ec='application/mp4; codecs\x3d"wvtt"';_.Fc="application/ttml+xml";_.Gc="application/vnd.ms-sstr+xml";Hc="application/x-www-form-urlencoded";_.p="audio";_.Ic="audio/aac";_.Jc="audio/ac3";_.Kc="audio/eac3";_.Lc="audio/mp4";Mc='audio/mp4;codecs\x3d"mp4a.40.2"';_.Nc="audiobufferchanged";_.Oc="autoplaynotallowed";_.Pc="bitratechanged";_.Rc="boolean";
11
+ _.Sc="bufferingended";_.Wc="bufferingstarted";Xc="canplay";Yc="canplaythrough";_.Zc="castingstarted";_.$c="caststatuschanged";_.ad="cdn-switch-success";_.bd="cenc";_.cd="center";dd="certificate-request";ed="change";fd="chrome";_.gd="clpp-fill";hd="clpp-hidden";id="clpp-mc-playlist";jd="clpp-visible";_.kd="clpp.cast.CastSender";ld="clpp.drm.HeaderDrm";md="clpp.drm.eme.AppleEmeManager";nd="clpp.native.Player";pd="clpp.plist.McPlaylist";qd="clpp.utils.Platform";_.rd="codecs";_.sd="column-reverse";
12
+ _.td="com.adobe.primetime";_.ud="com.apple.fps";_.vd="com.apple.hls.interstitial";_.wd="com.microsoft.playready";xd="com.microsoft.playready.recommendation";_.yd="com.widevine.alpha";_.zd="config.drm.customData is not defined";Ad="controls";_.Bd="cuechange";_.Cd="decoder";_.Dd="destroy()";_.Ed="disabled";_.Fd="div";Gd="drm.mediaKeys.end";Hd="drm.mediaKeys.start";Jd="drm.onPlay.end";Kd="drm.onPlay.start";_.Ld="drmexpirationupdate";Md="drmrenewalstarted";_.Nd="drmsessionpersisted";_.Od="drmsessionupdate";
13
+ Pd="drmtoday";Qd="durationchange";_.Rd="ec-3";Sd="encrypted";_.Td="end";_.Ud="ended";_.Vd="error";_.Wd="estimatedThroughputKbps";_.Xd="forced";Yd="fullscreenElement";_.Zd="function";_.$d="height";_.ae="hidden";_.be="hls-daterange";_.ce="html";_.de="image";_.ee="internal-error";fe="keystatuseschange";_.ge="left";he="license-renewal";ie="license-request";_.je="line-left";_.le="line-right";_.me="live-turned-static";_.qe="load";_.re="loadeddata";_.se="loadedmetadata";te="loadstart";_.ue="main";_.ve="mdat";
14
+ _.we="mdia";_.xe="message";_.ye="metadata";_.ze="mimeType";_.Ae="minf";_.Be="moov";_.Ce="mpd-type-changed";_.De="mpeg-dash-callback-event";_.Ee="none";_.r="number";_.Fe="object";_.Ge="onBitrateChanged()";_.He="onPlayerError()";_.Ie="onPlayerWillDestroy";_.Je="onPlayerWillRelease";_.Ke="onStateChanged()";Le="online-status-changed";_.Me="optional";_.Ne="org.w3.clearkey";_.Oe="output-restricted";_.Pe="pause";_.Qe="persistent";_.Re="persistent-license";Se="picture-in-picture";_.Te="play";Ue="player.afterLoad.end";
15
+ Ve="player.afterLoad.start";We="player.appendLoad.end";Xe="player.appendLoad.start";Ye="player.beforeLoad.end";Ze="player.beforeLoad.start";$e="player.load.end";af="player.load.start";bf="player.setupPlaylist.end";cf="player.setupPlaylist.start";_.df="playing";_.ef="playlist-item-changed";_.gf="playlist-modified";hf="playlist.next.end";jf="playlist.next.start";kf="preload-aborted";lf="preload-failed";mf="preloaded";nf="preloading";_.of="prevent";pf="primary-content";_.qf="progress";_.rf="px";
16
+ _.sf="ratechange";tf="released";_.uf="releasing";vf="removetrack";_.wf="required";_.xf="resize";_.yf="right";_.zf="sc-playlist-ended";_.Af="sc-playlist-item-changed";_.Bf="sc-playlist-live-turned-static";_.Cf="sc-playlist-timeline-changed";_.Df="seeked";_.Ef="seeking";_.Ff="showing";_.Gf="simid-creative-started";_.Hf="simid-creative-stopped";_.If="sinf";_.Jf="smooth";Kf="stalled";_.Lf="start";_.Mf="statechanged";Nf="status-pending";_.Of="stbl";_.Pf="string";_.Qf="stsd";_.Rf="style";_.Sf="subtitles-htmlcue";
17
+ Tf="temporary";_.Uf="text/vtt";_.Vf="text/xml";_.Wf="timeline-cues-changed";_.Xf="timeupdate";_.Yf="trak";_.Zf="ttml-xml";$f="unauthenticated";_.ag="und";bg="unknown";cg="update";_.dg="urn:scte:scte35";_.eg="urn:scte:scte35:2014";_.fg="user-seeked";_.gg="user-seeking";_.hg="value";ig="version";_.kg="vertical-lr";_.lg="vertical-rl";_.t="video";_.mg="video/mp2t";_.qg="video/mp4";_.rg="videobufferchanged";_.sg="videotrackchanged";_.tg="vimond-response";ug="visibilitychange";_.vg="vtt-xml";_.wg="waiting";
18
+ _.xg="waitingforkey";yg="webkit-org.w3.clearkey";zg="webkitkeyadded";Ag="webkitkeyerror";Bg="webkitkeymessage";Cg="webkitneedkey";_.Dg="width";Eg="x-dt-csl-tracking-token";Fg="x-dt-follow-up-token";Gg="x-dt-resp-code";Ig=function(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}};Jg=function(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:Ig(a)}};
19
+ Mg=function(a,b){if(b){var c=Kg;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&Lg(c,a,{configurable:!0,writable:!0,value:b})}};Ng=function(a){function b(d){return a.next(d)}function c(d){return a.throw(d)}return new Promise(function(d,e){function f(g){g.done?d(g.value):Promise.resolve(g.value).then(b,c).then(f,e)}f(a.next())})};_.w=function(a){return Ng(a())};
20
+ _.x=function(a,b){a=a.split(".");var c=Og;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};_.Rg=function(a){return _.z(a)||Pg(a)?a:_.Qg(a)};_.Qg=function(...a){let b={};for(let c=0;c<a.length;c++)null!=a[c]&&(b=Sg(b,{merging:a[c]},1));return b.merging||null};_.Tg=function(a){for(const b in a)if(void 0!==a[b])return!0;return!1};
21
+ Sg=function(a,b,c){const d=c+1;if(_.z(a)||!_.Ug(a))a={};for(const e in b)c=b[e],Pg(c)||_.z(c)||_.Vg(c)||c instanceof Element?a[e]=c:_.Ug(c)&&c.buffer&&c.buffer instanceof ArrayBuffer&&_.Vg(c.subarray)?a[e]=c.subarray(0):c instanceof Array?a[e]=Sg([],c,d):!_.z(c)&&_.Wg(c)&&20>d&&(a[e]=Sg(a[e],c,d));return a};Pg=function(a){a=typeof a;return a===_.Pf||a===_.r||a===_.Rc};_.z=function(a){return null===a||"undefined"===typeof a};_.Ug=function(a){return typeof a===_.Fe};
22
+ _.Vg=function(a){return typeof a===_.Zd};_.Xg=function(a){return typeof a===_.Pf};_.Yg=function(a){return typeof a===_.r};_.Wg=function(a){if(_.z(a)||!_.Ug(a))return!1;a=Object.getPrototypeOf(a);return a===Object.prototype||null===a};
23
+ _.Zg=function(a,b,c,d){if(a===b||null===a&&null===b||void 0===a&&void 0===b)return!0;if(null===a&&null!==b||null!==a&&null===b||void 0!==a&&void 0===b||void 0===a&&void 0!==b||!_.Ug(a)||!_.Ug(b))return!1;const e=c||Object.keys(a),f={};for(let g=0;g<e.length;g++){const h=e[g];if(_.z(d)||0>d.indexOf(h))if(f[h]=!0,a[h]!==b[h])return!1}if(_.z(c))for(a=Object.keys(b),b=0;b<a.length;b++)if(c=a[b],(_.z(d)||0>d.indexOf(c))&&!f[c])return!1;return!0};
24
+ $g=function(a){return(Number.hasOwnProperty("isNaN")?Number.isNaN:b=>b!==b)(a)};ah=function(a){const b=new Map;for(const c of Object.keys(a))b.set(c,a[c]);return b};_.bh=function(a){const b={};a.forEach((c,d)=>{b[d]=c});return b};ch=function(a,b){b=b.toLowerCase();for(const [c,d]of Object.entries(a))if(c.toLowerCase()===b)return d;return null};fh=function(a){return a&&0<=dh[a]?dh[a]:eh};
25
+ hh=function(a){if(!a)return _.B("clpp.log",Nb+a+ca),-1;const b=gh[a.toUpperCase()];return void 0===b?(_.B("clpp.log",Nb+a+ca),-1):b};_.jh=function(a){ih.info.apply(ih,arguments)};_.kh=function(a){ih.debug.apply(ih,arguments)};_.B=function(a){ih.warn.apply(ih,arguments)};_.lh=function(a){ih.error.apply(ih,arguments)};_.nh=function(a){var b=a.a;var c=[];for(const d in b.a)c.push.apply(c,b.a[d]);b=c;for(c=0;c<b.length;++c)mh(b[c]);a.a.clear()};
26
+ _.oh=function(a,b,c,d){const e=f=>{for(const g of c)a.off(b,g,e);d(f)};for(const f of c)a.on(b,f,e)};mh=function(a){a.target.removeEventListener(a.type,a.a,a.f);a.target=null;a.a=null};
27
+ wh=function(a,b){a.g.debug("onMetadata_()");b.mode=_.ae;const c=[];let d=!0;const e=f=>{for(var g of c)if(f.startTime===g.startTime&&f.endTime===g.endTime)return g;g={schemeIdUri:"",value:"",startTime:0,endTime:0,id:"",type:_.ph,eventElement:null};a.o&&d&&"SCTE35-IN"===f.value.key&&0<f.startTime?(g.startTime=0,g.endTime=f.startTime):(g.startTime=f.startTime,g.endTime=f.endTime);d=!1;c.push(g);return c[c.length-1]};if(b.cues){for(const f of b.cues){if(qh(a,f))continue;const g=e(f);switch(f.value.key){case "SCTE35-IN":case "SCTE35-OUT":g.schemeIdUri=
28
+ _.eg;g.type=_.rh;break;case "X-CUSTOM-ID":g.id=f.value.data}}for(const f of c)a.m.trigger(new _.C(_.sh,{detail:f}));Array.prototype.push.apply(a.h,c);th(a,c,b);a.f.off(b,_.Bd);a.f.on(b,_.Bd,f=>{f=f.target.activeCues;f=f.length?qh(a,f[0]):a.a;var g;if(g=f){{g=f;const h=a.m.getPosition();g=g.startTime<=h&&h<g.endTime}}if(g)a.a=f,a.m.trigger(new _.C(_.uh,{detail:f}));else{if(f=a.a)f=a.a,g=a.m.getPosition(),f=f.endTime<=g;f&&(f=a.a,a.a=null,a.m.trigger(new _.C(_.vh,{detail:f})))}})}};
29
+ xh=function(a,b){a.j=b;a.l=a.j.textTracks;a.f.on(a.l,_.vc,c=>{c=c.track;c.kind===_.ye&&wh(a,c)})};qh=function(a,b){for(const c of a.h)if(b.startTime===c.startTime&&b.endTime===c.endTime)return c;return null};th=function(a,b,c){if(a.o){for(;0<c.cues.length;)c.removeCue(c.cues[0]);b.forEach(function(d){c.addCue(new DataCue(d.startTime,d.endTime,{key:"SCTE35-OUT",data:null}))})}};_.yh=function(a){return Array.isArray(a)?a:[a]};
30
+ zh=function(a,b){return a===b?!0:a.length===b.length&&a.every((c,d)=>c===b[d])};Bh=function(a,b,c){if(null==a&&null==b)return!0;if(null==a||null==b)return!1;a=c?a.map(c):a;b=c?b.map(c):b;return Ah(a,b)&&Ah(b,a)};Ah=function(a,b){const c=new Set(a);return b.every(d=>c.has(d))};_.Ch=function(a,b={}){if(b.bf){const c=[];for(const d of a)c.some(e=>b.bf(d,e))||c.push(d);return c}return Array.from((new Set(a)).values())};
31
+ Dh=function(a,b){const c=new Set(a),d=new Set(b);return{mh:a.filter(e=>!d.has(e)),di:a.filter(e=>d.has(e)),eg:b.filter(e=>!c.has(e))}};Eh=function(a,b,c,d){a=`${a===_.E?"FATAL":"RECOVERABLE"} Clpp-Error [Category ${b} - Code ${c}]`;if(_.Xg(d))a+=": "+d;else if(null!=d)if(null!=d.message)a+=": "+d.message,delete d.message;else try{a+=": "+JSON.stringify(d)}catch(e){}return a};Fh=function(a,b){const c=b||zh;let d=null,e=null,f=!1;return function(...g){if(f&&c(g,d))return e;f=!0;d=g;return e=a(...g)}};
32
+ _.Gh=function(a){return null!=a};Kh=function(...a){for(let b=0;b<a.length;b++){const c=a[b];if(null!==c&&void 0!==c)return c}throw new _.Jh("No non-null, non-undefined value found");};Lh=function(...a){for(let b=0;b<a.length;b++){const c=a[b];if(null!==c&&void 0!==c)return c}};
33
+ _.Mh=function(a){var b;a instanceof _.Mh?(Nh(this,a.rb),this.rc=a.rc,this.Sa=a.Sa,Oh(this,a.Kc),this.Da=a.Da,_.Ph(this,Qh(a.a)),this.ic=a.ic):a&&(b=String(a).match(Rh))?(Nh(this,b[1]||"",!0),this.rc=Sh(b[2]||""),this.Sa=Sh(b[3]||"",!0),Oh(this,b[4]),this.Da=Sh(b[5]||"",!0),_.Ph(this,b[6]||"",!0),this.ic=Sh(b[7]||"")):this.a=new _.Th(null)};Nh=function(a,b,c){a.rb=c?Sh(b,!0):b;a.rb&&(a.rb=a.rb.replace(/:$/,""))};
34
+ Oh=function(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.Kc=b}else a.Kc=null};_.Ph=function(a,b,c){b instanceof _.Th?a.a=b:(c||(b=Uh(b,Vh)),a.a=new _.Th(b))};Sh=function(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""};Uh=function(a,b,c){return typeof a===_.Pf?(a=encodeURI(a).replace(b,Wh),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null};Wh=function(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)};_.Th=function(a){this.f=a||null};
35
+ Qh=function(a){var b=new _.Th;b.f=a.f;if(a.a){var c={},d;for(d in a.a)c[d]=a.a[d].concat();b.a=c;b.h=a.h}return b};Yh=function(a,b){const c=Xh[a];for(const d of c)for(const e of b)if(d.test(e.trim()))return e.trim();return a===_.F?"":null};_.H=function(a,b,c,d){d=void 0===d?{}:d;a=a.getAttribute(b);if(!a&&d.required)throw new _.G(_.E,4,4023,`Required attribute missing: ${b}`);return a?a.value:c||null};
36
+ _.$h=function(a){var b=(a||"").split("-");a=b[0]||"";b=b[1]||"";a=a.toLowerCase();a=Zh.get(a)||a;return(b=b.toUpperCase())?a+"-"+b:a};_.ai=function(a,b){a=_.$h(a);b=_.$h(b);return a.split("-")[0]===b.split("-")[0]};bi=function(a){return a.reduce((b,c)=>b+c,0)};_.ci=function(a,b){for(const c of a)if(!b(c))return!1;return!0};di=function*(a){for(let b=0;b<a;b++)yield b};
37
+ fi=function(a,b){if(!a&&!b)return!0;if(!a||!b||a.byteLength!==b.byteLength)return!1;if(ei(a)===ei(b)&&(a.byteOffset||0)===(b.byteOffset||0))return!0;const c=_.I(a);b=_.I(b);for(const d of di(a.byteLength))if(c[d]!==b[d])return!1;return!0};ei=function(a){return a instanceof ArrayBuffer?a:a.buffer};_.I=function(a,b=0,c=Infinity){return gi(a,b,c,Uint8Array)};
38
+ gi=function(a,b,c,d){const e=d.BYTES_PER_ELEMENT||1,f=ei(a),g=(a.byteOffset||0)+a.byteLength;a=Math.max(0,Math.min((a.byteOffset||0)+b*e,g));c=Math.min(a+Math.max(c*e,0),g);a/=e;return new d(f,a,c/e-a)};hi=function(a,b=0,c=Infinity){return gi(a,b,c,Uint16Array)};ii=function(a,b=0,c=Infinity){return gi(a,b,c,Uint32Array)};_.ji=function(a,b=0,c=Infinity){return gi(a,b,c,Int32Array)};_.ki=function(a,b=0,c=Infinity){return gi(a,b,c,DataView)};
39
+ li=function(a){return a instanceof ArrayBuffer?a:0===a.byteOffset&&a.byteLength===a.buffer.byteLength?a.buffer:(new Uint8Array(a)).buffer};mi=function(a){let b="";for(let c=0;c<a.length;c+=16E3)b+=String.fromCharCode.apply(null,a.subarray(c,c+16E3));return b};
40
+ _.ni=function(a){if(!a)return"";a=_.I(a);239===a[0]&&187===a[1]&&191===a[2]&&(a=a.subarray(3));if("TextDecoder"in window){a=(new TextDecoder).decode(a);if(a.includes("\ufffd"))throw Error(Ra);return a}a=escape(mi(a));try{return decodeURIComponent(a)}catch(b){throw Error(Ra);}};
41
+ pi=function(a,b,c){if(!a)return"";if(!c&&0!==a.byteLength%2)throw oi.error("Data has an incorrect length, must be even."),Error("Data does not seem to be UTF-16 encoded!");c=_.I(a);if(b&&255===c[0]&&254===c[1]||254===c[0]&&255===c[1])a=c.subarray(2);if(a instanceof ArrayBuffer)var d=a;else c=new Uint8Array(a.byteLength),c.set(_.I(a)),d=c.buffer;a=Math.floor(a.byteLength/2);c=new Uint16Array(a);d=new DataView(d);for(let e=0;e<a;e++)c[e]=d.getUint16(2*e,b);return mi(c)};
42
+ _.qi=function(a,b){if(_.Xg(a))return a;let c="";b=!!b;const d=_.I(a);239===d[0]&&187===d[1]&&191===d[2]?c=_.ni(d):254===d[0]&&255===d[1]?c=pi(d.subarray(2),!1):255===d[0]&&254===d[1]&&(c=pi(d.subarray(2),!0));const e=function(f,g){return f.byteLength<=g||32<=f[g]&&126>=f[g]}.bind(null,d);oi.debug("Unable to find byte-order-mark, making an educated guess.");0===d[0]&&0===d[2]?c=pi(a,!1):0===d[1]&&0===d[3]?c=pi(a,!0):e(0)&&e(1)&&e(2)&&e(3)&&(c=_.ni(a));if(c)return b&&(c=escape(c)),c;throw Error("Unable to detect text encoding");
43
+ };_.ri=function(a){if("TextEncoder"in window)return(new TextEncoder).encode(a);a=encodeURIComponent(a);a=unescape(a);const b=new Uint8Array(a.length);for(let c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b};_.si=function(a,b){const c=new Uint8Array(2*a.length),d=new DataView(c.buffer);for(let e=0;e<a.length;++e)d.setUint16(2*e,a.charCodeAt(e),b);return c.buffer};
44
+ _.ti=function(a,b){var c=b||1;b=a.length;const d=new ArrayBuffer(b*c);let e;4===c?e=ii(d):2===c?e=hi(d):e=_.I(d);for(c=0;c<b;c++)e[c]=a.charCodeAt(c);return d};_.ui=function(a,b){return String.prototype.startsWith?a.startsWith(b):0===a.indexOf(b)};_.vi=function(a,b){if(String.prototype.endsWith)return a.endsWith(b);const c=a.length-b.length;a=a.lastIndexOf(b,c);return-1!==a&&a===c};_.wi=function(a){return!!(a&&0<a.length)};_.xi=function(a){return!a||0===a.length};
45
+ _.yi=function(a){if(void 0===a||null===a||""===a)return"";try{let b=Number(a);if($g(b))return"";a="bps";1E3<=Math.abs(b)&&(a="Kbps",b/=1E3);1E3<=Math.abs(b)&&(a="Mbps",b/=1E3);return`${b.toFixed(2).replace(/[.,]00$/,"")}${a}`}catch(b){return""}};_.Ai=function(a){a=a.replace(/<[^>]+>/gi,"");zi.innerHTML=a;a=zi.textContent;return a=a.replace(/<[^>]+>/gi,"")};_.Ci=function(a,b=!0){a=_.Bi(a).replace(/\+/g,"-").replace(/\//g,"_");return b?a:a.replace(/[=]*$/,"")};_.Bi=function(a){a=mi(_.I(a));return btoa(a)};
46
+ _.Di=function(a){a=window.atob(a.replace(/-/g,"+").replace(/_/g,"/"));const b=new Uint8Array(a.length);for(let c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b};_.Ei=function(a){const b=new Uint8Array(a.length/2);for(let c=0;c<a.length;c+=2)b[c/2]=window.parseInt(a.substr(c,2),16);return b};_.Fi=function(a){let b="";for(let c=0;c<a.length;++c){let d=a[c].toString(16);1===d.length&&(d="0"+d);b+=d}return b};
47
+ _.Gi=function(a,b){if(!a&&!b)return!0;if(!a||!b||a.length!==b.length)return!1;for(let c=0;c<a.length;++c)if(a[c]!==b[c])return!1;return!0};_.Hi=function(a){var b=0;for(var c=0;c<arguments.length;++c)b+=arguments[c].length;b=new Uint8Array(+b);c=0;for(let d=0;d<arguments.length;++d)b.set(arguments[d],c),c+=arguments[d].length;return b};
48
+ _.Ii=function(a,b){b.lastIndex=a.a;b=b.exec(a.f);b=null==b?null:{position:b.index,length:b[0].length,results:b};if(a.a===a.f.length||null===b||b.position!==a.a)return null;a.a+=b.length;return b.results};
49
+ _.Mi=function(a,b){var c=b.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!c)throw new _.G(_.E,4,4016,{invalidTag:b});b=c[1];var d=c[2];c=[];let e;if(d){d=new _.Ji(d);var f;(f=_.Ii(d,/^([^,=]+)(?:,|$)/g))&&f[1]&&(e=f[1].trim());const g=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;for(;f=_.Ii(d,g);)c.push(new _.Ki(f[1],f[2]||f[3]||""))}return new _.Li(a,b,c,e)};_.Oi=function(){return{maxAttempts:1,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:0,fatalStatusCodes:[...Ni]}};
50
+ Pi=function(a,b){a.timeout=b.timeout;a.baseDelay=b.baseDelay;a.backoffFactor=b.backoffFactor;a.fuzzFactor=b.fuzzFactor;a.maxAttempts=b.maxAttempts;a.fatalStatusCodes=b.fatalStatusCodes||[...Ni]};Qi=function(a){const b={};a.forEach((c,d)=>{b[d.trim()]=c});return b};
51
+ _.Si=function(a,b){_.Xg(a)&&(a={uris:[a]});Array.isArray(a)&&(a={uris:a});const c={uris:a.uris||[],type:a.type||_.Ri,uriIndex:0,method:a.method||"GET",body:a.body||null,headers:Object.assign({},a.headers),allowCrossSiteCredentials:a.allowCrossSiteCredentials||!1,onProgress:a.onProgress||null,onFragment:a.onFragment||null,maxAttempts:a.maxAttempts||1,currentAttempt:0,baseDelay:a.baseDelay||1E3,backoffFactor:a.backoffFactor||2,fuzzFactor:a.fuzzFactor||.5,timeout:a.timeout||0,requestModifiers:a.requestModifiers||
52
+ [],responseModifiers:a.responseModifiers||[],startTime:a.startTime||null,endTime:a.endTime||null,contentType:a.contentType||null,licenseRequestType:a.licenseRequestType||null,sessionId:null,bytesRemaining:-1,bytesLoaded:-1,bytesTotal:-1,timescale:a.timescale||null,rateLimitBps:a.rateLimitBps||null,disableFragmentSupport:a.disableFragmentSupport||!1,disableMergedFragments:a.disableMergedFragments||!1,fatalStatusCodes:[...Ni],requestStartTimestamp:null};a.keyInfo&&(c.keyInfo=a.keyInfo);b&&Pi(c,b);return c};
53
+ _.Wi=function(a,b,c,d,e,f,g,h){a={uri:e||d,data:b,headers:a,status:c,timeMs:g,responseStartMs:h,request:f};if(Ti(c))return Ui(a);throw Vi(a);};Ti=function(a){return 200<=a&&299>=a&&202!==a};Ui=function(a){return{uri:a.uri,data:a.data||new ArrayBuffer(0),headers:a.headers,status:a.status,fromCache:!!a.headers["x-shaka-from-cache"],timeMs:a.timeMs,responseStartMs:a.responseStartMs,request:a.request}};
54
+ Vi=function(a){a=Ui(a);try{var b=_.qi(a.data,!0)}catch(d){b=null}_.kh("HTTP error text:",b);const c=a.request;return new _.G(0<=(c?c.fatalStatusCodes||[]:[]).indexOf(a.status)?_.E:1,1,1001,{url:a.uri,status:a.status,responseText:b,headers:a.headers,request:a.request,response:a})};Xi=function(a,b){b=parseInt(b,10);Number.isNaN(b)&&(b=-1);a.bytesTotal=b;a.bytesLoaded=0;a.bytesRemaining=b};Yi=function(a,b,c){0<a.bytesRemaining&&(a.bytesRemaining-=b);a.bytesLoaded+=b;if(a.onProgress)a.onProgress(b,c)};
55
+ Zi=function(a,b,c){if(0>=a)return Promise.resolve();const d=8*c/a-b/1E3;return 0<d?new Promise(e=>{setTimeout(e,1E3*d)}):Promise.resolve()};$i=function(a,b){a.W.then(()=>b(!0),()=>b(!1));return a};_.aj=function(a,b){a.a.push($i(b,()=>{{var c=a.a;const d=c.indexOf(b);-1<d&&c.splice(d,1)}}))};bj=function(a,b){return _.w(function*(){const c=yield a.fetch(b);return _.ni(c.data).replace(/\r\n|\r(?=[^\n]|$)/gm,"\n")})};
56
+ cj=function(a,b){return _.w(function*(){const c=yield bj(a,b);try{const d=JSON.parse(c);if(null==d||typeof d!==_.Fe)throw Error("Not an object");return d}catch(d){throw new _.Jh("Failed to parse JSON response","json-failed");}})};dj=function(a,b,c,d){d=void 0===d?"HEAD":d;return _.w(function*(){if(!navigator.onLine)return!1;if(b){const e=_.Si(b,c);e.method=d;c||(e.timeout=5E3);e.headers["cache-control"]="no-cache";try{yield a.fetch(e).W}catch(f){if(1002===f.code||1003===f.code)return!1}}return!0})};
57
+ ej=function(a){return`@@scheme:${a.scheme||""}`+`@@value:${a.value}`+`@@id:${a.id||""}@@type:${a.type||""}`+`@@protocol:${a.protocol||""}`};_.fj=function(a){return a&&a!==_.ag?a:null};
58
+ hj=function(a){if(!a)throw new _.G(_.E,3,3101,`Invalid track type: ${a}`);if(!_.Xg(a))throw new _.G(_.E,3,3101,`Invalid track type: ${a}. Track type must be a string!`);switch(a.toLowerCase()){case _.J:return _.J;case _.K:return _.K;case _.L:return _.L;case gj:return gj}throw new _.G(_.E,3,3101,`Unknown track type: ${a}.`);};
59
+ kj=function(a,b){a=hj(a);const c=_.fj(b.kind);let d=b.id;d||(d=String(_.ij++));a=new _.jj(d,c===_.ye?gj:a);a.kind=c;a.label=_.fj(b.label);a.language=_.fj(b.language);a.originalLanguage=b.originalLanguage||a.language;return a};_.lj=function(a){return`${a.scheme}//`+`${a.a}${a.port?":"+a.port:""}${a.path}${a.h}${a.f}`};
60
+ _.mj=function(a,b,c){return a?(c||Object.keys(a).sort()).reduce(function(d,e){if(!(e in a))return d;const f=a[e];let g="\x26";""===d&&(g=b?"":"?");d=d+g+encodeURIComponent(e);return d=d+"\x3d"+encodeURIComponent(void 0===f?"":f)},""):""};_.nj=function(a){const b={};a=a||"";a=a.substring(a.indexOf("?")+1);for(const d of a.split("\x26")){var c=d.split("\x3d");a=decodeURIComponent(c[0]);c=decodeURIComponent(c[1]||"");a&&(b[a]=c)}return b};
61
+ oj=function(a,b){return a.startsWith("http:://")||a.startsWith("https:://")?a:(new URL(a,b)).toString()};pj=function(a,b){return _.w(function*(){const c=_.Si(b);return yield bj(a.f,c)})};vj=function(a,b,c){return _.w(function*(){const {mimeType:d,renditions:e}=yield sj(a,b,c),f=new _.jj("dummy",_.L),g=e.map((h,k)=>{k=new _.tj(`R${k}`,f);k.bandwidth=h.bandwidth;k.Mc=h.Mc;k.codec=h.codec;k.width=h.width;k.height=h.height;return k});uj(g);return{renditions:g,mimeType:d||void 0}})};
62
+ xj=function(a){a=a.split("\n").filter(c=>c.trim().startsWith("#EXT-X-MEDIA:")).map(c=>wj(c));const b=new Map;a.forEach(c=>{if(c.type&&c.name){const d=`${c.type}:${c.name}`;if(b.has(d))throw Error("#EXT-X-MEDIA:NAME attributes are not unique. It is impossible to map HLS metadata to Safari data structures.");b.set(d,c)}});return b};sj=function(a,b,c){return _.w(function*(){const d=yj(b),e=zj(b,c);return{mimeType:yield Aj(a,e,d[0]?d[0].codec:null),renditions:d}})};
63
+ uj=function(a){const b=new Set;a.forEach(c=>{b.add(`${c.width}x${c.height}`)});if(b.size<a.length)throw Error("Playlist contains multiple renditions with the same resolution.");};wj=function(a){const b=_.Mi(0,a);a=d=>(d=b.getAttribute(d))?d.value:void 0;var c=a(_.Kb);c=null!=c?{AUDIO:_.K,VIDEO:_.L,SUBTITLES:_.J}[c]:void 0;return{type:c,groupId:a(_.Wa),name:a("NAME"),language:a(_.cb),Ph:a("AUTOSELECT"),default:a("DEFAULT"),Xh:a("FORCED"),af:a("CHARACTERISTICS"),uri:a(_.Mb)}};
64
+ yj=function(a){return a.split("\n").filter(b=>b.trim().startsWith("#EXT-X-STREAM-INF:")).map(b=>{var c=_.Mi(0,b);if(c.getAttribute(_.Tb))throw Error("Playlist contains alternative video streams.");var d=_.H(c,_.Cb);b=d?Number(d.split("x")[0]):null;d=d?Number(d.split("x")[1]):null;var e=_.H(c,_.ma);e=e?Number(e):null;var f=_.H(c,"AVERAGE-BANDWIDTH");f=f?Number(f):null;c=_.H(c,_.pa);c=_.Bj(_.t,c?c.split(","):[]);return b={bandwidth:e,Mc:f,codec:c,width:b,height:d,mimeType:null}})};
65
+ zj=function(a,b){return(a=a.split("\n").filter(c=>c.trim().endsWith(".m3u8"))[0])?oj(a,b):null};Aj=function(a,b,c){return _.w(function*(){if(!b||!c)return null;var d=yield pj(a,b);d=[Cj(d,b),Dj(d,b)].filter(Boolean);return _.Ej(d,_.t,c)})};Cj=function(a,b){return(a=a.split("\n").find(c=>!c.startsWith("#")&&0<c.trim().length))?oj(a,b):null};Dj=function(a,b){a=a.split("\n").find(c=>c.startsWith("#EXT-X-MAP:"));return a?(a=_.H(_.Mi(0,a),_.Mb))?oj(a,b):null:null};
66
+ Fj=function(a,b){b=b.track;b.kind!==_.ye&&(b.mode===_.Ff&&(b.mode=_.ae),a.a.on(b,_.Bd,c=>{c=c.target||c.srcElement;c.mode=_.ae;c.activeCues&&(c=Array.from(c.activeCues).map(a.o),a.l.append(c,[]))}))};_.Hj=function(a,b,c){for(const d of _.Gj)if(d.probe(b,c))return d.create(a);return null};_.Ij=function(a){a=_.Gj.indexOf(a);0<=a&&_.Gj.splice(a,1)};Lj=function(a,b){var c=Jj;Kj.set(`${a.toLowerCase().split(";")[0]}-${c}`,{priority:c,plugin:b})};
67
+ _.Pj=function(a,b){var c=[Mj,Nj,Oj,Jj];for(const d of c)if(c=Kj.get(`${a.toLowerCase().split(";")[0]}-${d}`)){const e=c.plugin(),f=e.isSupported(a,b);e.destroy();if(f)return c.plugin}return null};_.Qj=function(a,b){b&&(a+=';codecs\x3d"'+b+'"');return a.replace(/\s/g,"")};_.Rj=function(a){return a.split(";")[0]};_.Sj=function(a){a=a.split(/\s*;\s*/);a.shift();return(a=a.find(b=>b.startsWith("codecs\x3d")))?a.split("\x3d")[1].replace(/^"|"$/g,"").split(/\s*,\s*/).join(","):""};
68
+ Tj=function(a,b,c){a.stop();let d=!0,e=null;a.a=()=>{c?clearInterval(e):clearTimeout(e);d=!1};const f=()=>{d&&a.f()};e=c?setInterval(f,1E3*b):setTimeout(f,1E3*b);return a};Xj=function(){if(Uj)return Uj;Vj||(Vj=new _.Wj(()=>{Uj=null}));(Uj=document.querySelector(_.t)||document.querySelector(_.p))||(Uj=document.createElement(_.t));Vj.fa(1);return Uj};_.Yj=function(){return!!navigator.userAgent.match(/Edge?\//)};_.Zj=function(a){return(navigator.userAgent||"").includes(a)};
69
+ _.ak=function(a){return _.Zj("Tizen"+(a?" "+String(a):""))};ck=function(a){const b={major:-1,name:bg};if(!a)return b;var c=a.replace(/_/g,".");b.name=c;c=c.split(".");1<=c.length&&(b.major=bk(a,c[0]));2<=c.length&&(b.minor=bk(a,c[1]));3<=c.length&&(b.patch=bk(a,c[2]));4<=c.length&&(b.build=bk(a,c[3]));return b};_.dk=function(){return _.Zj("Web0S")};_.fk=function(){return _.dk()&&79===_.ek().major};
70
+ _.ek=function(){const a=gk();const b=["ie","edge","opera","firefox","safari",fd];var c=hk();const d=ik[c];for(let e=0,f=b.length;e<f;e++)if(c=d[b[e]]&&a.match(d[b[e]]))return ck(c[1]);return ck("")};_.jk=function(){return _.Zj("CrKey")};_.kk=function(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!_.ak()};_.lk=function(){return/(?:iPhone|iPad|iPod|Android)/.test(navigator.userAgent)?!0:_.kk()&&1<navigator.maxTouchPoints};_.mk=function(){return/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)};
71
+ bk=function(a,b){try{return parseInt(b,10)}catch(c){nk.warn("Unable to parse version number for '"+b+"' from '"+a+"'")}return-1};ok=function(a,b){if(!a||!b||0===b.length)return!1;for(let c=0;c<b.length;c++)if(0<=a.indexOf(b[c]))return!0;return!1};
72
+ hk=function(){const a=gk();if(!a)return pk;var b=a.match(/^.+?(?=\))/);if(!b)return pk;b=b[0];if(ok(b,["iphone","ipad"]))return qk;if(ok(b,["android"]))return rk;if(ok(b,["macintosh"]))return sk;if(ok(b,["windows nt"]))return tk;if(ok(b,["tizen"]))return uk;if(ok(b,["web0s"]))return vk;if(ok(b,["linux"]))return wk;nk.warn("Unable to identify OS from user agent: "+a);return pk};gk=function(){let a=window.navigator.userAgent;return a=a.toLowerCase()};
73
+ _.yk=function(){var a=hk();var b=hk();var c=ik[b];if(c){c=gk().match(c.os_version)[1];c=ck(c);if(b===tk)if("5.1"===c.name)c.name="xp";else if("6.1"===c.name)c.name="7";else if("6.2"===c.name||"6.3"===c.name)c.name="8";b=c}else b=ck("");a:{c=gk();const e=["ie","edge","opera","firefox","safari",fd];var d=hk();d=ik[d];for(let f=0,g=e.length;f<g;f++)if(d[e[f]]&&c.match(d[e[f]])){c=e[f];break a}c=xk}return{os:a,osVersion:b,browser:c,browserVersion:_.ek()}};
74
+ zk=function(a,b,c){return a.type!==c?!1:void 0!==b.id&&null!==b.id&&""!==b.id?a.id===b.id:_.Zg(a,{kind:_.fj(b.kind),language:_.fj(b.language),label:_.fj(b.label)},["kind","language","label"])};Ak=function(a){return a.enabled||a.selected||a.mode===_.Ff||a.mode===_.ae};Ck=function(a,b,c){return Bk(a)&&b===_.L&&!!c.enableHlsVideoTrackInfo};
75
+ Dk=function(a,b,c){return _.w(function*(){var d=a.m.getLoadedSource();d&&a.j&&(d=yield a.j.a(d.url,c),d.mimeType&&(b.mimeType=d.mimeType),d.renditions&&0<d.renditions.length&&(b.renditions=d.renditions,b.renditions.forEach(e=>{e.track=b})))})};Ek=function(a,b,c){return Bk(a)&&(b===_.K||b===_.J)&&!!c.enableMetadata};
76
+ Fk=function(a,b,c){return _.w(function*(){var d=a.m.getLoadedSource();d&&a.j&&(d=yield a.j.a(d.url,c),d.Hc&&(d=d.Hc.get(`${b.type}:${b.label}`))&&d.af&&(b.accessibility=d.af.split(",").map(e=>e.trim()).map(e=>({value:e,type:b.type,protocol:"HLS"}))))})};Gk=function(a,b){return a.h.filter(c=>c.type===b)};Hk=function(a){(a=a.m.getTextDisplayer())&&a.remove(0,Infinity)};Jk=function(a,b){if(a=Ik(a,b))a=Array.from(a),b===_.J&&(a=a.filter(c=>c.kind!==_.ye));return a};
77
+ Ik=function(a,b){if(!a.m)return null;a=a.m.getSurface();if(!a)return null;a=a.getMedia();if(!a)return null;switch(b){case _.K:return a.audioTracks;case _.L:return a.videoTracks;case _.J:return a.textTracks;default:return null}};Kk=function(a,b){return(a=a.a.get(b)||null)&&a.renditions[0]};Lk=function(a,b){return(a=a.l.get(b))&&a.renditions[0]};
78
+ Ok=function(a,b,c){const d=Jk(a,b);if(c){if(void 0===a.h.find(f=>f.id===c.id))throw Error(`Unknown track with ID ${c.id} and type ${b}`);if(c.type!==b)throw Error(`Types mismatch for track ${c.type} and arg ${b}`);a.g.debug("Activate track type "+b+" with ID: "+c.id);if(d){a.l.set(b,c);let f;var e=!0;let g=!1;switch(b){case _.J:f="mode";e=_.Ff;g=_.Ed;break;case _.K:f="enabled";break;case _.L:f="selected"}if(f)for(const h of d)h[f]=zk(c,h,c.type)?e:g}}else if(a.g.debug(_.Aa+b),a.a.get(b)&&d&&b===_.J){for(e of d)e.mode=
79
+ _.Ed;a.a.set(b,null)}b===_.K?a.m.trigger(new _.C(_.Mk)):b===_.J&&a.m.trigger(new _.C(_.Nk))};Pk=function(a,b,c){if(a.m){var d=a.m.getSurface().getMedia();if(d){var e=document.createElement("track");e.id=c;e.kind=b.kind;e.srclang=b.language;b.label&&(e.label=b.label);e.src=_.xi(b.url)?URL.createObjectURL(new Blob([])):b.url;d.appendChild(e);a.I.push(e)}}};
80
+ Qk=function(a,b){return _.w(function*(){var c=a.m.getConfiguration(),d=_.Hj(c,b.mimeType,_.Uf);if(d){c=_.Si(b.url);var e=yield a.m.getNetworkEngine().fetch(c).W;e&&e.data&&(c="External_"+`${a.G++}`,a.o[c]=b,d=d.a(_.I(e.data)),d={url:URL.createObjectURL(new Blob([d])),kind:b.kind,language:b.language,label:b.label,mimeType:_.Uf},Pk(a,d,c))}else a.g.warn("Track MIME type is not supported",b)})};Bk=function(a){a=a.m.getLoadedSource();return!(!a||a.type!==_.Rk&&!a.url.endsWith(".m3u8"))&&_.kk()};
81
+ Sk=function(a,b,c){c=_.yh(c).filter(e=>e);a.g.info("Find preferred tracks for",b,c);const d=Gk(a,b);c.some(e=>{const f=_.$h(e);return(e=d.find(g=>{g=_.$h(g.language||"");return _.ai(f,g)}))?(a.g.info("Will select track with id",e.id),Ok(a,b,e),!0):!1})};_.Vk=function(a){if(a){var b=a.a();b in _.Tk?_.Uk.warn("Player-Factory '"+b+"' already registered"):(_.Tk[b]=a,_.Uk.info("Registered Player-Factory: '"+b+"'"))}};Wk=function(a){return Object.values(_.Tk).find(a)||null};
82
+ Yk=function(a){return a.name===rb&&Xk.some(b=>a.message.startsWith(b))};
83
+ _.al=function(){var a=Infinity;navigator.connection&&navigator.connection.saveData&&_.lk()&&(a=360);const b=_.Oi();b.maxAttempts=3;a={source:"",license:Zk,viewerId:void 0,autoplay:void 0,pauseWhenInBackground:!1,ads:{hls:{enable:!0,resolutionOffsetSec:35}},manifest:{attemptParameters:_.Oi(),availabilityWindowOverride:NaN,clockSyncUri:"",ignoreDrmInfo:!1,xlinkFailGracefully:!1,autoCorrectDrift:!0,timeline:{version:1,type:void 0}},abr:{enabled:!0,defaultBandwidthEstimate:1E3,switchInterval:8,bandwidthUpgradeTarget:.85,
84
+ bandwidthDowngradeTarget:.95,useSwitchIntervalForInitialSwitch:!1,restrictions:$k(a),useCmsd:!0},drm:null,enableHtmlCue:!0,preferredAudioLanguage:"",preferredTextLanguage:"",preferredAudioRole:_.ue,preferredTextRole:"",preferredAudioChannelCount:2,preferredAudioCodec:[],preferredVideoCodec:[],preferSpatialAudio:!1,preferForcedSubtitles:!1,volume:null,startTime:null,loop:!1,lowLatencyMode:!1,suggestedPresentationDelay:void 0,muted:void 0,forceWaitForTracks:!1,streaming:{attemptParameters:b,bufferingGoal:10,
85
+ rebufferingGoal:2,bufferBehind:30,ignoreTextStreamFailures:!1,alwaysStreamText:!1,relativeTextTimestamp:!1,startAtSegmentBoundary:!1,gapDetectionThreshold:.1,disableAudioTracks:!1,disableVideoTracks:!1,smallGapLimit:.5,jumpLargeGaps:!0,durationBackoff:1,maxSegmentToMediaOffset:1,forceNativeTS:!1,preferNativeHlsOnSafari:!0,safeSeekOffset:5,stallEnabled:!0,stallThreshold:3,stallSkip:.5,bufferLimitUpdateInterval:.5,overridePasp:!1,enableLiveEdgeChasing:!1,chasingRate:1.15,startChasingAt:5,stopChasingAt:2,
86
+ chaseJumpDistance:10,patchEdgeWhenMixedContent:!1,ignoreDrift:!1,disableFragmentSupport:!1,disableMergedFragments:!1,ignoreManagedMediaSourceStreamingHints:!1},mediaSource:{codecSwitchingStrategy:_.of},restrictions:$k(),tizen:{sideStreamText:_.ak(2)},safari:{enableHlsVideoTrackInfo:!1,enableMetadata:!1},trickPlay:{speedUpMode:_.Cd,preferTrickPlayTracks:!0},playlist:{timeline:"basic",content:_.Ub,cropTimeline:!1}};if(_.ak()||_.dk())a.ads.hls.enable=!1;if(_.Zj("Edge/")||_.ak())a.streaming.gapDetectionThreshold=
87
+ .5;_.dk()&&(a.streaming.stallEnabled=!1);_.fk()&&(a.streaming.stallEnabled=!0,a.streaming.stallThreshold=1,a.streaming.stallSkip=1,a.streaming.gapDetectionThreshold=.02);_.ak()&&(a.streaming.stallEnabled=!0,a.streaming.stallThreshold=1,a.streaming.stallSkip=0);a.vr={enable:!1,attachMouseListener:!0,fieldOfView:70,sensitivity:1,invertHorizontalControl:!1,invertVerticalControl:!1};return a};
88
+ $k=function(a){a=void 0===a?Infinity:a;return{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:a,minPixels:0,maxPixels:Infinity,minBandwidth:0,maxBandwidth:Infinity}};
89
+ _.dl=function(...a){if(!a)return _.al();var b=[_.al()];let c=!1;for(let d of a)null!==d&&void 0!==d&&(_.Xg(d)&&(d={source:d}),d.lowLatencyMode&&!c&&(b.push({streaming:{rebufferingGoal:.1,bufferLimitUpdateInterval:.01,attemptParameters:{maxAttempts:3,baseDelay:250,backoffFactor:1}},abr:{bandwidthUpgradeTarget:.6,bandwidthDowngradeTarget:.95},manifest:{lowLatencyMode:!0}}),c=!0),b.push(d),null!=d.suggestedPresentationDelay&&b.push({manifest:{suggestedPresentationDelay:d.suggestedPresentationDelay}}));
90
+ a=_.Qg.apply(null,b);_.Xg(a.volume)&&(""===""+a.volume?a.volume=null:a.volume=Number(a.volume));if(!_.z(a.volume)&&(!_.Yg(a.volume)||$g(a.volume)))throw new _.G(_.E,7,7100,"config.volume is not a number");if(!_.z(a.preferredTextLanguage)&&!_.Xg(a.preferredTextLanguage)&&!Array.isArray(a.preferredTextLanguage))throw new _.G(_.E,7,7100,"config.preferredTextLanguage is not a string or an array");if(!_.z(a.preferredAudioLanguage)&&!_.Xg(a.preferredAudioLanguage)&&!Array.isArray(a.preferredAudioLanguage))throw new _.G(_.E,
91
+ 7,7100,"config.preferredAudioLanguage is not a string or an array");if(!_.z(a.preferredAudioCodec)&&!_.Xg(a.preferredAudioCodec)&&!Array.isArray(a.preferredAudioCodec))throw new _.G(_.E,7,7100,"config.preferredAudioCodec is not a string or an array");if(!_.z(a.preferredVideoCodec)&&!_.Xg(a.preferredVideoCodec)&&!Array.isArray(a.preferredVideoCodec))throw new _.G(_.E,7,7100,"config.preferredVideoCodec is not a string or an array");if(!_.z(a.drm)){if(a.drm.env&&!_.Xg(a.drm.env))throw new _.G(_.E,7,
92
+ 7100,"config.drm.env is not a string");if(a.drm.offlineId&&!_.Xg(a.drm.offlineId))throw new _.G(_.E,7,7100,"config.drm.offlineId is not a string");}if(b=a.streaming){b.bufferingGoal=Number(b.bufferingGoal);b.rebufferingGoal=Number(b.rebufferingGoal);b.bufferBehind=Number(b.bufferBehind);b.smallGapLimit=Number(b.smallGapLimit);b.durationBackoff=Number(b.durationBackoff);if(!_.Yg(b.bufferingGoal)||$g(b.bufferingGoal))throw new _.G(_.E,7,7100,"config.streaming.bufferingGoal is not a number");if(!_.Yg(b.rebufferingGoal)||
93
+ $g(b.rebufferingGoal))throw new _.G(_.E,7,7100,"config.streaming.rebufferingGoal is not a number");if(b.rebufferingGoal>b.bufferingGoal)throw new _.G(_.E,7,7100,"config.streaming.rebufferingGoal must be \x3e\x3d bufferingGoal");if(!_.Yg(b.bufferBehind)||$g(b.bufferBehind))throw new _.G(_.E,7,7100,"config.streaming.bufferBehind is not a number");if(!_.Yg(b.smallGapLimit)||$g(b.smallGapLimit))throw new _.G(_.E,7,7100,"config.streaming.smallGapLimit is not a number");if(!_.Yg(b.durationBackoff)||$g(b.durationBackoff))throw new _.G(_.E,
94
+ 7,7100,"config.streaming.durationBackoff is not a number");b=a.manifest;if(_.z(b.availabilityWindowOverride))b.availabilityWindowOverride=NaN;else if(typeof b.availabilityWindowOverride!==_.r)throw new _.G(_.E,7,7100,"Invalid value for |manifest.availabilityWindowOverride|");bl(a.restrictions);bl(a.abr.restrictions);a.abr.initialRestrictions&&bl(a.abr.initialRestrictions)}return a};
95
+ bl=function(a){_.z(a.maxPixels)&&(a.maxPixels=Infinity);_.z(a.maxBandwidth)&&(a.maxBandwidth=Infinity);_.z(a.maxHeight)&&(a.maxHeight=Infinity);_.z(a.maxWidth)&&(a.maxWidth=Infinity);_.z(a.minPixels)&&(a.minPixels=0);_.z(a.minBandwidth)&&(a.minBandwidth=0);_.z(a.minHeight)&&(a.minHeight=0);_.z(a.minWidth)&&(a.minWidth=0);a.minWidth=Number(a.minWidth);a.maxWidth=Number(a.maxWidth);a.minHeight=Number(a.minHeight);a.maxHeight=Number(a.maxHeight);a.minBandwidth=Number(a.minBandwidth);a.maxBandwidth=Number(a.maxBandwidth);
96
+ a.minPixels=Number(a.minPixels);a.maxPixels=Number(a.maxPixels);if(Number.isNaN(a.minWidth)||Number.isNaN(a.maxWidth)||Number.isNaN(a.minHeight)||Number.isNaN(a.maxHeight)||Number.isNaN(a.minBandwidth)||Number.isNaN(a.maxBandwidth)||Number.isNaN(a.minPixels)||Number.isNaN(a.maxPixels))throw new _.G(_.E,7,7100,"Restrictions contain NaN");};el=function(a){return typeof a===_.Fe&&!Array.isArray(a)&&"source"in a};_.gl=function(a){return _.fl.get(a)||null};
97
+ _.il=function(a){_.fl.get(a.id())?hl.warn("Component already in use."):_.fl.set(a.id(),a)};jl=function(a){return Array.from(_.fl.values()).find(b=>b instanceof a)||null};kl=function(a){for(const b of _.fl.values())a(b)};ll=function(a){kl(b=>{b.o(a)})};ml=function(a){kl(b=>{b.h(a)})};nl=function(){kl(()=>{})};ol=function(){kl(()=>{})};pl=function(a){if(null!==jl(a))return null;a=new a;a.f();_.il(a);hl.info("Installed component:",a.id());return a};
98
+ ql=function(a){if(a=jl(a))a.a(),_.fl.delete(a.id()),hl.info("Uninstalled component:",a.id())};rl=function(a){return _.ui(a,_.ud)||_.ui(a,_.wd)};sl=function(a,b){3===b.type&&(a.f&&(a.g.debug("Attaching tracking token"),b.headers[Eg]=a.f),a.a&&(b.headers[Fg]=a.a))};
99
+ tl=function(a,b){return b.request&&3===b.request.type&&(a.f=b.headers[Eg],a.a=b.headers[Fg],b=b.headers["x-dt-csl-renewal-info"],a.f&&a.g.debug("Loaded tracking token "+a.f),a.a&&a.g.debug("Loaded followup token "+a.a),b)?(a=JSON.parse(_.ni(_.Di(b))),{delay:a.renewalPeriod,Mh:{maxAttempts:a.retryCount,baseDelay:1E3*a.retryPeriod,backoffFactor:1,fuzzFactor:0,timeout:0}}):null};_.vl=function(a){_.ul[a.I]=a};
100
+ _.xl=function(a){const b={attemptParameters:_.Oi(),enforceSingleSession:!1,delayLicenseRequestUntilPlayed:!1,enableSessionCacheForSkd:!1,ignoreUnrecognizedInitData:!0,bb:{},widevineVersion:_.yd};if(a&&(b.enforceSingleSession=!!a.enforceSingleSession,b.delayLicenseRequestUntilPlayed=!!a.delayLicenseRequestUntilPlayed,b.preferredDrmSystem=a.preferredDrmSystem,b.emeApi=a.emeApi,a.attemptParameters&&(b.attemptParameters=a.attemptParameters),b.enableSessionCacheForSkd=!!a.enableSessionCacheForSkd,void 0!==
101
+ a.ignoreUnrecognizedInitData&&(b.ignoreUnrecognizedInitData=!!a.ignoreUnrecognizedInitData),typeof a.widevineVersion===_.Pf&&0<a.widevineVersion.length&&(b.widevineVersion=a.widevineVersion),a.env)){const c=_.ul[a.env]||null;if(!c)throw _.kh(_.va,_.zb+a.env+_.aa),new _.G(_.E,6,6015,`DRM environment '${a.env}' is missing.`);b.bb=_.wl(c,a.customData)||{};_.ui(a.env.toLowerCase(),Pd)&&(b.enforceSingleSession=!0)}return b};
102
+ zl=function(a){a=yl[a];if(!a)return null;const b=_.yk();return b.os===rk&&4===b.osVersion.major&&4===b.osVersion.minor?null:new Uint8Array(a)};
103
+ _.wl=function(a,b){const c={};var d=b?b.widevineVideoRobustness:void 0,e=b?b.widevineAudioRobustness:void 0;const f=b?b.serverCertificate:void 0;var g=a.f[_.yd];if(g){var h=g.licenseUrl;d=Lh(d,g.videoRobustness);e=Lh(e,g.audioRobustness);var k=g.modifiers,l=Kh(b?b.widevineDistinctiveIdentifierRequired:void 0,g.distinctiveIdentifierRequired,!1),m=Kh(b?b.widevinePersistentStateRequired:void 0,g.persistentStateRequired,!1);g=void 0===f?g.serverCertificate:null===f?null:typeof f===_.Pf?zl(f):f;c[_.yd]=
104
+ {licenseUrl:h,videoRobustness:d,audioRobustness:e,modifiers:k,distinctiveIdentifierRequired:l,persistentStateRequired:m,serverCertificate:g}}(g=a.f[_.ud])&&(c[_.ud]={licenseUrl:g.licenseUrl,certificateUrl:g.certificateUrl,modifiers:g.modifiers});h=b?b.playReadyVideoRobustness:void 0;b=b?b.playReadyAudioRobustness:void 0;(g=a.f[_.wd])&&(c[_.wd]={licenseUrl:g.licenseUrl,videoRobustness:h||g.videoRobustness,audioRobustness:b||g.audioRobustness,individualizationServer:g.individualizationServer,useLegacySystem:g.useLegacySystem,
105
+ modifiers:g.modifiers});return c};_.Al=function(){throw new _.G(_.E,3,3E3);};_.Bl=function(a,b,c){const d=c||0;c=b.byteLength-d;const e=_.I(a.f.buffer);b=_.I(b.buffer,d,c);try{e.set(b,a.a),a.a+=c}catch(f){_.Al()}};_.N=function(a,b){try{a.f.setUint32(a.a,b,a.h),a.a+=4}catch(c){_.Al()}};_.Cl=function(a){return a.a<a.f.byteLength};_.Dl=function(){throw new _.G(_.E,3,3E3,"Buffer read out of bounds.");};_.El=function(a){try{const b=a.f.getUint8(a.a);a.a+=1;return b}catch(b){_.Dl()}};
106
+ _.Fl=function(a){try{const b=a.f.getUint16(a.a,a.h);a.a+=2;return b}catch(b){_.Dl()}};_.O=function(a){try{const b=a.f.getUint32(a.a,a.h);a.a+=4;return b}catch(b){_.Dl()}};_.Gl=function(a){try{const b=a.f.getInt32(a.a,a.h);a.a+=4;return b}catch(b){_.Dl()}};_.Hl=function(a){let b=0,c=0;try{!0===a.h?(b=a.f.getUint32(a.a,!0),c=a.f.getUint32(a.a+4,!0)):(c=a.f.getUint32(a.a,!1),b=a.f.getUint32(a.a+4,!1))}catch(d){_.Dl()}if(2097151<c)throw new _.G(_.E,3,3001);a.a+=8;return c*Math.pow(2,32)+b};
107
+ Il=function(a,b){const c=new Uint8Array(b);for(let d=0;d<b;d++)c[d]=_.El(a);return c};_.Jl=function(a,b){a.a+b>a.f.byteLength&&_.Dl();var c=a.a+a.f.byteOffset;c=a.f.buffer.slice(c,c+b);a.a+=b;return _.I(c)};Kl=function(a){let b=0;for(let c=0;c<a.length;c++)b=b<<8|a.charCodeAt(c);return b};_.Ll=function(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)};_.Ml=function(a){for(;_.Cl(a.reader)&&!a.parser.a;)a.parser.Jd(a.start+a.headerSize,a.reader,a.partialOkay)};
108
+ _.Nl=function(a){for(let b=_.O(a.reader);0<b&&!a.parser.a;--b)a.parser.Jd(a.start+a.headerSize,a.reader,a.partialOkay)};_.Ol=function(a){return b=>{const c=b.reader.Ja()-b.reader.getPosition();a(_.Jl(b.reader,c))}};_.Pl=function(a){return 8+(a.has64BitSize?8:0)+(null!=a.flags?4:0)};Ql=function(a){let b="";try{b=_.qi(a)}catch(c){}return b};_.Sl=function(a){a=Ql(a);let b="";a.length&&(b=(new _.Rl(a)).a);return b};
109
+ Ul=function(a){if(!a)return null;let b=null;try{const c=JSON.parse(_.ni(a)),d=_.Di(c.sinf[0]);(new _.Tl).N(_.If,_.Ml).N("schi",_.Ml).N("tenc",e=>{e.reader.skip(6);_.El(e.reader)&&(e.reader.skip(1),b=_.Fi(_.Jl(e.reader,16)));e.parser.stop()}).parse(d)}catch(c){}return b};
110
+ Wl=function(a,b,c){if(!c||!c.byteLength)throw new _.G(_.E,6,6102);let d;typeof b===_.Pf?d=_.si(b,!0):d=b;a=_.si(Ql(a),!0);b=new _.Vl(12+a.byteLength+d.byteLength+c.byteLength,!0);_.N(b,a.byteLength);_.Bl(b,_.I(a));_.N(b,d.byteLength);_.Bl(b,_.I(d));_.N(b,c.byteLength);_.Bl(b,_.I(c));return _.I(b.buffer)};_.Xl=function(a){var b=_.I(a.body);b=_.Ci(b);a.headers[ua]=Hc;a.body=_.ri("spc\x3d"+b).buffer};
111
+ _.Yl=function(a){let b;try{b=_.ni(a.data)}catch(c){return}b=b.trim();"\x3cckc\x3e"===b.substr(0,5)&&"\x3c/ckc\x3e"===b.substr(-6)&&(b=b.slice(5,-6));try{const c=JSON.parse(b);c.ckc&&(b=c.ckc);c.CkcMessage&&(b=c.CkcMessage);c.License&&(b=c.License)}catch(c){}a.data=li(_.Di(b))};cm=function(a,b){b=Zl(b);if(a===_.yd)return b+$l;if(a===_.wd)return b+am;if(a===_.ud)return b+bm;throw Error("Unknown DRM Key-System '"+a+"'. Can not infer license URL!");};
112
+ _.fm=function(a,b,c,d){d=void 0===d?!0:d;c=a.drm;c&&c.env.startsWith(xa)?c.customData&&(_.em(b,a),a=b.uris[0],d&&c.customData.assetId&&(a+="?assetId\x3d"+encodeURI(`${c.customData.assetId}`),c.customData.variantId&&(a+="\x26variantId\x3d"+encodeURI(`${c.customData.variantId}`)),b.uris[0]=a)):dm.warn(kb)};
113
+ _.gm=function(a,b){try{const c=_.I(b.data),d=JSON.parse(String.fromCharCode.apply(null,c));dm.debug("Widevine License response",d);const e=atob(d.license),f=new Uint8Array(e.length);for(a=0;a<e.length;++a)f[a]=e.charCodeAt(a);b.data=f.buffer}catch(c){dm.debug("Unable to parse DRMtoday response JSON, assuming the response contained raw data")}};
114
+ _.im=function(a,b,c){var d=c&&c.customData&&c.customData.fpsContentId;_.fm(a,b,c,!1);b.headers[ua]=Hc;c={spc:_.Bi(b.body)};if((a=a.drm)&&a.env.startsWith(ya)&&d){a={};var e=_.nj((new _.Rl(hm(d))).f);d=e.keyId;if(e=e.assetId)dm.info("Applying assetId from HLS manifest."),a.assetId=e;d&&(dm.info("Applying keyId from HLS manifest."),a.keyId=d);d=a;d.keyId&&(dm.info("Adding keyID to FPS payload:",d.keyId),c.keyId=d.keyId);d.assetId&&(dm.info("Adding assetID to FPS payload:",d.assetId),c.assetId=d.assetId)}b.body=
115
+ _.ti(_.mj(c,!0))};_.jm=function(a,b){dm.debug("Clearing response data");200===b.status&&(a=_.ni(b.data).trim(),"\x3cckc\x3e"===a.substr(0,5)&&"\x3c/ckc\x3e"===a.substr(-6)&&(a=a.slice(5,-6)),b.data=_.Di(a).buffer)};
116
+ _.km=function(a,b,c){b=Ql(b);c=c&&c.customData?c.customData:{};b=new _.Rl(hm(b));const d=_.nj(b.f);if(a&&a.drm&&a.drm.customData){var e=a.drm.customData;a=e.assetId;e=e.variantId;a&&_.wi(`${a}`)&&(d.assetId=a,dm.debug("Using assetId from the configuration instead of the value from the HLS manifest."));e&&_.wi(`${e}`)&&(d.variantId=e,dm.info("Using variantId from the configuration instead of the value from the HLS manifest."))}d.keyId?(a=["keyId"],dm.debug("KeyId found in FPS SKD. Removing other parameters")):
117
+ a=["assetId","variantId"];b.f=_.mj(d,!1,a);"/"!==b.path||b.j.includes(`${b.a}/`)||(b.path="");b=_.lj(b);return c.fpsContentId=b};_.om=function(a,b){a=a.drm;if(!a||!a.env.startsWith(xa))dm.warn(kb);else if(a.customData&&a.customData.merchant&&!a.env.startsWith(ya)){const c=new _.Mh(b.uris[0]);let d=c.Da;d.endsWith("/")||(d+="/");d+=a.customData.merchant;c.Da=d;b.uris[0]=c.toString()}};pm=function(a,b,c){_.fm(a,b,c);a=a.drm;a=!(!a||!a.offlineId);c=new _.Mh(b.uris[0]);c.a.add(_.Qe,a);b.uris[0]=c.toString()};
118
+ Zl=function(a){if(a===qm)return"https://lic.drmtoday.com";if(a===rm)return"https://lic.staging.drmtoday.com";if(a===sm)return"https://lic.test.drmtoday.com";throw Error("Unknown DRMtoday environment '"+a+"'. Can not infer DRMtoday base URL!");};hm=function(a){a=a.replace(/assetid/gi,"assetId");a=a.replace(/variantid/gi,"variantId");return a=a.replace(/keyid/gi,"keyId")};
119
+ _.em=function(a,b){if((b=b.drm)&&b.customData){var c={userId:b.customData.userId,sessionId:b.customData.sessionId,merchant:b.customData.merchant};_.Tg(c)&&(a.headers["dt-custom-data"]=btoa(JSON.stringify(c)));(b=b.customData.authToken)&&(a.headers["x-dt-auth-token"]=b)}};um=function(a){const b={},c=a?a[Gg]:void 0;a=tm[a?a[Gg]:void 0];c&&(b.drmTodayErrorCode=c);a&&(b.drmTodayErrorMessage=a);return b};
120
+ wm=function(a,b=0){_.jh("Registering EME Factory: "+a.a());a={priority:b,ya:a};for(let c=0;c<vm.length;++c)if(vm[c].priority<b){vm.splice(c,0,a);return}vm.push(a)};xm=function(a){if(a){const {ya:b}=vm.find(({ya:c})=>c.a()===a);if(b&&b.f())return _.jh(Yb+b.a()),b.create();_.jh("Cannot create selected EME manager. Choosing by priority list.")}for(const {ya:b}of vm)if(b.f())return _.jh(Yb+b.a()),b.create();throw Error("Missing EME managers");};
121
+ _.zm=function(a,b){a=_.ym(a,b);return 1!==a.length?null:a[0]};_.ym=function(a,b){return Array.prototype.filter.call(a.childNodes,c=>c instanceof Element&&c.tagName===b)};_.Am=function(a){return Array.prototype.every.call(a.childNodes,b=>b.nodeType===Node.TEXT_NODE||b.nodeType===Node.CDATA_SECTION_NODE)?a.textContent.trim():null};
122
+ _.Bm=function(a,b){const c=new DOMParser;let d=null,e=null;try{e=c.parseFromString(a,_.Vf)}catch(f){}e&&e.documentElement.tagName===b&&(d=e.documentElement);return d&&0<d.getElementsByTagName("parsererror").length?null:d};_.Em=function(a){var b=_.Ei(a);b=parseInt(b.byteLength,10).toString(16);b=_.Ei("12"+b+a);return new Cm(Dm,a,b)};
123
+ _.Gm=function(a){const b=new _.Fm(new DataView(a.buffer,a.byteOffset,a.byteLength),!1);a=_.O(b);var c=_.O(b);c=_.Ll(c);var d=_.O(b);const e=d>>>24;d&=16777215;var f=_.Jl(b,16);f=_.Fi(f);if(0<e){var g=_.O(b);b.skip(16*g)}g=_.O(b);const h=()=>{let u=_.El(b),v=(u&127)>>>0,y=7;for(;128<=u&&28>=y;)u=_.El(b),v=(v|(u&(28>y?127:15))<<y)>>>0,y+=7;return 28<y?-1:v},k=u=>{switch(u){case 0:do if(!_.Cl(b))throw Error("not enough data to skip!");while(_.El(b)&128);break;case 1:b.skip(8);break;case 2:b.skip(h());
124
+ break;case 3:for(;4!==(u=h()&7);)k(u);break;case 5:b.skip(4);break;default:throw Error("invalid wire type "+u);}},l=[];let m=null;for(;_.Cl(b);){var n=h(),q=n&7;n>>>=3;if(2===q){q=h();if(0>q)throw Error(`unable to read length of field ${n}`);q=Il(b,q);2===n?l.push(q):4===n&&(m=q)}else k(q)}_.kh("Parsed WV PSSH Box","size",a,"name",c,ig,e,"flags",d,"size",g,"systemId",f,"contentId (base64)",m?_.Bi(m):"","keyIds",l.map(u=>_.Fi(u)));return 0<l.length?_.Em(_.Fi(l[0])):null};
125
+ _.Hm=function(a){const b=[];b.push(a[3]);b.push(a[2]);b.push(a[1]);b.push(a[0]);b.push(a[5]);b.push(a[4]);b.push(a[7]);b.push(a[6]);a=_.I(a);a.set(b,0);return a};
126
+ _.Mm=function(a){a:{var b=new _.Fm(new DataView(a.buffer),!0);_.O(b);for(_.Fl(b);_.Cl(b);)if(1===_.Fl(b)){var c=_.Fl(b);b=_.Jl(b,c);break a}b=null}b||(b=a);a=pi(b,!0);c=_.Bm(a,"WRMHEADER");a=c.getAttribute(ig);var d=_.zm(c,"DATA");c=(c=_.zm(d,"LA_URL"))?_.Am(c):"";var e;if(e=_.zm(d,"KID"))if(e=_.Am(e)){var f=_.zm(d,oa);e={value:e,Ud:f?f.textContent.trim():null}}else e=null;else e=null;d=e?[e]:(e=Im(d))?[e]:(d=Jm(d))?d:null;const {value:g="",Ud:h}=d&&d[0]||{};d=_.Di(g);d=_.Hm(d);d=_.Fi(d);return new _.Km(_.Lm,
127
+ d,c,b,a,h)};Im=function(a){a=_.zm(a,"PROTECTINFO");if(!a)return null;var b=_.zm(a,"KID");if(!b)return null;a=b.getAttribute("VALUE");if(!a)return null;const c=b.getAttribute(oa);b=b.getAttribute("ALGID");return{value:a,Ud:c,fg:b}};
128
+ Jm=function(a){a=_.zm(a,"PROTECTINFO");if(!a)return null;a=_.zm(a,"KIDS");if(!a)return null;var b=_.ym(a,"KID");if(!b.length)return null;a=[];for(const c of b)if(b=c.getAttribute("VALUE")){const d=c.getAttribute(oa),e=c.getAttribute("ALGID");a.push({value:b,Ud:d,fg:e})}return a.length?a:null};_.Om=function(a){Nm&&performance.mark(a)};_.Pm=function(a,b,c){Nm&&performance.measure(a,b,c)};
129
+ Qm=function(a){return _.w(function*(){const b=new Promise(c=>{(new _.Wj(c)).fa(1)});(yield Promise.race([a.close().then(()=>!0),b.then(()=>!1)]))||_.B("Timeout waiting for session close")})};_.Sm=function(a){return Rm(a)?_.wd:a};Tm=function(a,b){const c=[];b.forEach((d,e)=>{c.push({keySystem:e,licenseServerUri:d.licenseUrl,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],keyIds:[]})});for(const d of a)d.drmInfos=c};
130
+ Um=function(a,b){if(a.keySystem){var c=_.Sm(a.keySystem);b=b[c];c===_.Ne&&a.licenseServerUri||(b&&(a.licenseServerUri=b.licenseUrl||""),a.keyIds||(a.keyIds=[]),b&&(a.distinctiveIdentifierRequired||(a.distinctiveIdentifierRequired=b.distinctiveIdentifierRequired),a.persistentStateRequired||(a.persistentStateRequired=b.persistentStateRequired),a.videoRobustness||(a.videoRobustness=b.videoRobustness||""),a.audioRobustness||(a.audioRobustness=b.audioRobustness||""),a.serverCertificate||(a.serverCertificate=
131
+ b.serverCertificate||null)))}};_.Vm=function(a,b){b=_.Qj(a.mimeType,b||a.codecs);if(_.Pj(b,a.type)){a=a.type;var c=_.Pj(b,a);c&&(c=c(),b=c.convertCodecs(a,b),c.destroy())}return b};Wm=function(a){for(const b of a.audioCapabilities||[])delete b.robustness;for(const b of a.videoCapabilities||[])delete b.robustness};Ym=function(a){return(a.audioCapabilities||[]).some(Xm)||(a.videoCapabilities||[]).some(Xm)};
132
+ Zm=function(a,b){a=_.Sl(b);_.kh("Using default Content ID extractor. The hostname part from HLS #EXT-X-KEY:URI skd:// will be used.","Extracted Content ID: "+a);return a};
133
+ $m=function(a){var {playerConfig:b,initData:c,initDataType:d,drmInfo:e,drmSystemConfig:f,sessionContext:g,emeApi:h}=a;if("skd"===d&&"APPLE"===h){a=e.serverCertificate;let k=f&&f.modifiers&&f.modifiers.extractContentId;_.Vg(k)||(k=Zm);let l="";try{l=k(b,c,g)}catch(m){throw new _.G(_.E,6,6103);}if(!l.length)throw new _.G(_.E,6,6101,"Content ID is an empty string");c=Wl(c,l,a)}return c};Rm=function(a){return!!a.match(/^com\.(microsoft|chromecast)\.playready/)};
134
+ Xm=function(a){return null!=a.robustness&&""!==a.robustness};an=function(a,b,c,d,e){for(const f of a){b.includes(f.licenseServerUri)||b.push(f.licenseServerUri);f.serverCertificate&&(c.some(g=>_.Gi(g,f.serverCertificate))||c.push(f.serverCertificate));if(f.initData){for(const g of f.initData)g.periodId=f.periodId;for(const g of f.initData)d.some(h=>h.keyId&&h.keyId===g.keyId&&h.periodId===g.periodId?!0:!1)||d.push(g)}if(f.keyIds)for(a=0;a<f.keyIds.length;++a)e.includes(f.keyIds[a])||e.push(f.keyIds[a])}};
135
+ bn=function(a){var b=a.l;const c=a.V;c.clear();b.forEach((d,e)=>c.set(e,d));b=Array.from(c.values());b.length&&b.every(d=>"expired"===d)&&a.T(new _.G(_.E,6,6014));a.D.qe(_.bh(c));a.o||a.g.info(wa);a.o=!0;a.B=!1};cn=function(a){a.f.forEach((b,c)=>{const d=b.le;let e=c.expiration;isNaN(e)&&(e=Infinity);e!==d&&(a.D.pe(c.sessionId,e),b.le=e)})};
136
+ dn=function(a){return _.w(function*(){a.w.release();a.w=null;a.K.release();a.K=null;a.o=!1;a.B=!1;a.F.reject();a.X.stop();a.X=null;a.R.stop();a.R=null;const b=Array.from(a.f.keys());for(const c of a.f.values())c.xc&&c.xc.stop();a.f.clear();yield Promise.all(b.map(c=>Promise.resolve().then(()=>_.w(function*(){a.g.debug("Closing session",c.sessionId);try{yield Qm(c)}catch(d){a.g.warn("Error while closing session",d)}}))));if(a.A){try{yield a.j.h(null)}catch(c){a.g.warn("Error while resetting media keys",
137
+ c)}a.A=null}a.j=null;a.a=null;a.H.clear();a.G=null;a.J=[];a.h=null;a.T=null;a.D=null;a.M=0;a.L=null})};_.hn=function(a,b){const c=b.some(e=>0<e.drmInfos.length);if(!c){var d=ah(a.h.bb);Tm(b,d)}if(d=en(a))for(const e of b)e.drmInfos=[d];for(const e of b)for(const f of e.drmInfos)Um(f,a.h.bb);b=fn(a,b);if(!b.size)return a.O=!0,Promise.resolve();_.Om(Hd);a=_.gn(a,b);return(c?a:a.catch(()=>{})).then(()=>{_.Om(Gd);_.Pm("DRM queryMediaKeys_()",Hd,Gd)})};
138
+ _.kn=function(a,b,c){c=void 0===c?[]:c;a.I=jn;a.J=c;a.C=0<c.length;a.g.debug("Using Persisted Licenses: "+a.C);a.h&&a.h.enableSessionCacheForSkd&&a.g.info("Enabled session cache for SKD license requests");return _.hn(a,b)};
139
+ _.gn=function(a,b){if(1===b.size&&b.has(""))return Promise.reject(new _.G(_.E,6,6E3));null===a.j&&(a.j=xm(a.h.emeApi));for(var c of b.values())0===c.audioCapabilities.length&&delete c.audioCapabilities,0===c.videoCapabilities.length&&delete c.videoCapabilities;let d=c=new _.ln;const e=(h,k,l)=>{k.drmInfos.some(m=>!!m.licenseServerUri)===h&&(d=d.catch(()=>{if(a.ua)return null;if(l===_.wd){if(_.Yj()&&!a.h.bb[l].useLegacySystem)return k.label=xd,a.j.a(xd,[k]).catch(()=>{a.g.warn("Unable to create com.microsoft.playready.recommendation. Falling back to com.microsoft.playready.");
140
+ k.label=_.wd;Wm(k);return a.j.a(l,[k])});Wm(k)}if(l===_.yd&&a.h.widevineVersion!==_.yd){const m=a.h.widevineVersion;if(!m.startsWith(_.yd))return a.g.error(`Invalid "widevineVersion" value "${m}".`),Promise.reject();const n=Object.assign({},k,{label:m,distinctiveIdentifier:_.Me,persistentState:_.Me});return a.j.a(m,[n]).catch(()=>a.j.a(l,[k]))}return a.j.a(l,[k]).catch(m=>{a:{if(l===_.yd&&Ym(k)){const n=_.yk();if(Ym(k)&&n.os===rk&&n.browser===fd){a.g.warn("requestMediaKeySystemAccess() failed",m);
141
+ a.g.warn("Will try to recover by removing the robustness attribute of videoCapabilities and audioCapabilities.");Wm(k);m=a.j.a(l,[k]);break a}}throw m;}return m})}))};let f=a.h.preferredDrmSystem;if(!f){var g=_.yk();if(g.os===tk&&10<=g.osVersion.major&&"edge"===g.browser)f=_.wd;else if("safari"===g.browser)f=_.ud;else if(g.browser===fd||"firefox"===g.browser)f=_.yd}f&&(g=b.get(f))&&(e(!0,g,f),e(!1,g,f));for(const h of[!0,!1])b.forEach((k,l)=>{l!==f&&e(h,k,l)});d=d.catch(()=>{throw new _.G(_.E,6,6001,
142
+ "Failed to get MediaKeySystemAccess.");});d=d.then(h=>{if(a.ua)return null;a.H.clear();var k=h.getConfiguration();a.g.info("Got MediaKeySystemAccess with configuration",k);var l=k.audioCapabilities||[];k=k.videoCapabilities||[];for(var m of l)a.H.add(m.contentType.toLowerCase());for(var n of k)a.H.add(n.contentType.toLowerCase());{l=h.keySystem;m=b.get(_.Sm(h.keySystem));n=[];k=[];const q=[],u=[];an(m.drmInfos,n,k,q,u);1<k.length&&_.B("Multiple unique server certificates found! Only the first will be used.");
143
+ 1<n.length&&_.B("Multiple unique license server URIs found! Only the first will be used.");l={keySystem:l,licenseServerUri:n[0],distinctiveIdentifierRequired:m.distinctiveIdentifier===_.wf,persistentStateRequired:m.persistentState===_.wf,audioRobustness:m.audioCapabilities?m.audioCapabilities[0].robustness:"",videoRobustness:m.videoCapabilities?m.videoCapabilities[0].robustness:"",serverCertificate:k[0],initData:q,keyIds:u,periodId:null}}a.a=l;if(!a.a.licenseServerUri)throw new _.G(_.E,6,6012,a.a.keySystem);
144
+ return h.createMediaKeys()}).then(h=>{a.ua||(a.g.info("Created MediaKeys for key system",a.a.keySystem),a.G=h,a.O=!0)}).catch(h=>{if(!a.ua){a.a=null;a.H.clear();if(h instanceof _.G)throw h;throw new _.G(_.E,6,6002,{browserError:h.message});}});c.reject();return d};
145
+ en=function(a){a=ah(a.h.bb[_.Ne]||{});if(0===a.size)return null;const b=[],c=[];a.forEach((e,f)=>{f=_.Ei(f);e=_.Ei(e);e={kty:"oct",kid:_.Ci(f,!1),k:_.Ci(e,!1)};b.push(e);c.push(e.kid)});a=JSON.stringify({keys:b});var d=JSON.stringify({kids:c});d=[{initData:_.ri(d),initDataType:"keyids"}];return{keySystem:_.Ne,licenseServerUri:"data:application/json;base64,"+window.btoa(a),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:d,
144
146
  keyIds:[],periodId:null}};
145
- Zm=function(a,b){var c=new Set;for(var d of b)for(var e of d.drmInfos)Nm(e,a.h.Za),c.add(e);d=a.C?_.xf:_.Me;e=a.C?[_.Re]:[Uf];a=new Map;for(const f of c)a.set(f.keySystem,{initDataTypes:[_.$c],audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:_.Me,persistentState:d,sessionTypes:e,label:f.keySystem,drmInfos:[]});for(const f of b){b=f.audio;c=f.video;const g=b?_.Om(b):"";let h=null;b&&"ac-3"===b.codecs.toLowerCase()&&_.Xj()&&(h=_.Om(b,_.Sd));const k=c?_.Om(c):"";let l=null;c&&"ac-3"===
146
- c.codecs.toLowerCase()&&_.Xj()&&(l=_.Om(c,_.Sd));for(const m of f.drmInfos){const n=a.get(m.keySystem);n.drmInfos.push(m);m.initData&&m.initData.length&&(n.initDataTypes=[...new Set(m.initData.map(q=>q.initDataType))]);m.distinctiveIdentifierRequired&&(n.distinctiveIdentifier=_.xf);m.persistentStateRequired&&(n.persistentState=_.xf);b&&_.Ah(m.audioRobustness).forEach(q=>{const u={robustness:q||"",contentType:g};n.audioCapabilities.find(v=>v.robustness===u.robustness&&v.contentType===u.contentType)||
147
- n.audioCapabilities.push(u);h&&n.audioCapabilities.push({robustness:q||"",contentType:h})});c&&_.Ah(m.videoRobustness).forEach(q=>{const u={robustness:q||"",contentType:k};n.videoCapabilities.find(v=>v.robustness===u.robustness&&v.contentType===u.contentType)||n.videoCapabilities.push(u);l&&n.videoCapabilities.push({robustness:q||"",contentType:l})})}}return a};
148
- en=function(a){return _.x(function*(){if(!a.j.o())if(a.L)yield a.L;else try{a.L=a.j.h(a.G),yield a.L}catch(b){a.va||a.U(new _.H(_.F,6,6003,b.message,b))}})};
149
- _.jn=function(a,b,c,d){d=void 0===d?"":d;if(c.length&&(!a.C||a.I!==bn)){var e=a.keySystem();if(!e.startsWith(_.vd)&&b===_.$c){const f=new fn(c);if(1<f.a.length&&(e={"org.w3.clearkey":"1077efecc0b24d02ace33c1e52e2fb4b","com.widevine.alpha":"edef8ba979d64acea3c827dcd51d21ed","com.microsoft.playready":"9a04f07998404286ab92e65be0885f95","com.adobe.primetime":"f239e769efa348509c16a903c6932efb"}[e]))for(let g=0;g<f.f.length;g++)if(e===f.f[g]){c=c.subarray(f.a[g].start,f.a[g].end+1);break}}(a.A.webkitCurrentPlaybackTargetIsWireless||
150
- _.Xj(2)||a.keySystem().startsWith(_.vd)||!_.gn(a,d,c,!0))&&hn(a,d,null,b,c)}};kn=function(a,b){return _.x(function*(){a.g.info(`Handle encrypted event for type ${b.initDataType}`);yield en(a);b.initData&&_.jn(a,b.initDataType,_.J(b.initData))})};mn=function(a){return _.x(function*(){_.Hm(Ld);const b=a.T.map(c=>ln(a,c));a.aa=!0;a.T=[];yield Promise.all(b);_.Hm(Kd);_.Im("drm.onPlay",Ld,Kd)})};
151
- on=function(a){const b=a.keySystem(),c=a.h.Za[b],d=c.certificateUrl||"";if(""===d)return Promise.resolve();const e=a.D.getConfiguration();return nn(a,e).then(()=>{var f=c.modifiers;const g=f&&f.certificateRequest,h=f&&f.certificateResponse;f=_.Si([d],a.h.attemptParameters);f.type=3;f.licenseRequestType=bd;g&&f.requestModifiers.push(k=>g(e,k));h&&f.responseModifiers.push(k=>h(e,k));a.g.debug("Fetching certificate");return a.D.vb.fetch(f).R}).then(f=>{a.a.serverCertificate=_.J(f.data)}).catch(f=>{var g=
152
- f.data.headers;g=Object.assign({message:"Error while fetching certificate!",url:f.data.url,status:f.data.status,response:f.data.response},g?{headers:g}:{},km(g));throw new _.H(_.F,6,6100,g,f);})};
153
- _.pn=function(a){return _.x(function*(){if(a.G&&a.a&&a.a.serverCertificate&&a.a.serverCertificate.length)try{const b=yield a.G.setServerCertificate(a.a.serverCertificate);void 0===b||b||a.g.debug("Server certificates are not supported by the key system. The server certificate has been ignored.")}catch(b){throw new _.H(_.F,6,6004,{browserError:b.message});}})};
154
- _.sn=function(a){const b=a.a?a.a.initData||[]:[];for(const c of b){let d=!_.Xj(2);if(a.h.enforceSingleSession&&!a.keySystem().startsWith(_.vd)){const e=a.f.values();for(const f of e)_.Hi(c.initData,f.initData)?(a.g.info("Skipping Session creation. Existing init data in single session mode!"),d=!1):f.periodId===c.periodId&&(a.g.info("Skipping Session creation. Merging init data for period in single session mode "+`for Key ID ${c.keyId}.`),qn(c.initData,f)||(f.ud.push(c.initData),c.keyId&&!f.ab.includes(c.keyId)&&
155
- f.ab.push(c.keyId),a.l.get(c.keyId)||a.l.set(c.keyId,Of)),d=!1)}!d||a.C&&a.I===bn||(_.gn(a,c.keyId,c.initData)&&(d=!1),d&&(a.g.info("Request new media key session on create"),hn(a,c.keyId,c.periodId,c.initDataType,c.initData)))}for(const c of a.J)_.rn(a,c);b.length||a.J.length||(a.o||a.g.info(wa),a.o=!0,a.B=!1,a.F.resolve());return a.F};
156
- _.tn=function(a,b){if(!a.G)return _.qh(a.w,b,[Td,"msneedkey",Bg,"needkey"],()=>{a.U(new _.H(_.F,6,6010))}),Promise.resolve();a.A=b;a.j.l(b);a.w.one(a.A,_.Te,()=>mn(a));a.w.on(a.A,_.wg,e=>{const f=a.B;a.B=!a.o;!f&&a.B&&(a.g.info("Waiting for DRM license key delivery"),a.D.onEvent(e))});var c=a.a.initData.find(e=>0<e.initData.length);let d=Promise.resolve();if(c||a.j.f()!==Eb||a.J.length)d=en(a);c=Promise.resolve();_.ak()&&38===_.bk().major||(a.a&&a.a.keySystem!==_.Ne&&!a.a.serverCertificate&&(c=on(a)),
157
- c=c.then(()=>_.pn(a)));return Promise.all([d,c]).then(()=>{a.va||(_.sn(a),a.w.on(a.A,Td,e=>kn(a,e)))}).catch(e=>{if(!a.va){if(6004===e.code&&a.a&&a.a.keySystem===_.zd&&1>a.N&&a.a.serverCertificate&&a.a.serverCertificate.length)return a.g.warn("Detected invalid widevine server certificate!. Retrying"),a.U(new _.H(1,6,6004)),a.a.serverCertificate=null,a.N++,_.tn(a,b);1<=a.N&&a.g.info("Could not get valid widevine server certificate. Giving up");throw e;}})};
158
- nn=function(a,b){return _.x(function*(){const c=a.D.Bc();if(c){var d=b&&b.drm&&b.drm.customData;d&&(yield c(d))}})};
159
- _.rn=function(a,b){let c;try{a.g.debug("Attempting to load an offline session",b),c=a.G.createSession(_.Re)}catch(e){const f=new _.H(_.F,6,6005,{browserError:e.message});a.U(f);return Promise.reject(f)}a.w.on(c,_.xe,a.ea.bind(a));a.w.on(c,ge,a.ga.bind(a));const d={initData:null,loaded:!1,me:Infinity,xb:null,Ka:new _.dn,periodId:null,ud:[],keyId:null,ab:[],initDataType:null,dc:null,sessionContext:{ldlDelay:0,customData:{}}};d.Ka.catch(()=>{});a.f.set(c,d);return c.load(b).then(e=>{if(a.va)return null;
160
- a.g.debug("Loaded offline session",b,e);if(!e)return a.f.delete(c),a.U(new _.H(_.F,6,6013)),null;d.loaded=!0;un(a)&&(a.o||a.g.info(wa),a.o=!0,a.B=!1,a.F.resolve());return c},e=>{a.va||(a.f.delete(c),a.U(new _.H(_.F,6,6005,{browserError:e.message})))})};qn=function(a,b){if(!a)return!1;for(let c=0;c<b.ud.length;c++)if(_.Hi(a,b.ud[c]))return!0;return!1};
161
- _.gn=function(a,b,c,d){d=void 0===d?!1:d;for(const e of a.f.keys()){const f=a.f.get(e);if(_.Hi(c,f.initData))return b?f.ab.includes(b)?d&&a.g.info("Skipping Session creation. "+`License for init data with Key ID ${b} was already `+`requested in Session: '${e.sessionId}'. `):(f.ab.push(b),a.l.get(b)||a.l.set(b,Of),d&&a.g.info(Ib+`Session: '${e.sessionId}'`+`Adding Key ID ${b} to session meta-data.`)):d&&a.g.info(Ib+`Session: '${e.sessionId}'`),!0;if(qn(c,f))return d&&a.g.info("Skipping Session creation. License for init data was already requested [extra]"),
147
+ fn=function(a,b){var c=new Set;for(var d of b)for(var e of d.drmInfos)Um(e,a.h.bb),c.add(e);d=a.C?_.wf:_.Me;e=a.C?[_.Re]:[Tf];a=new Map;for(const f of c)a.set(f.keySystem,{initDataTypes:[_.bd],audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:_.Me,persistentState:d,sessionTypes:e,label:f.keySystem,drmInfos:[]});for(const f of b){b=f.audio;c=f.video;const g=b?_.Vm(b):"";let h=null;b&&"ac-3"===b.codecs.toLowerCase()&&_.ak()&&(h=_.Vm(b,_.Rd));const k=c?_.Vm(c):"";let l=null;c&&"ac-3"===
148
+ c.codecs.toLowerCase()&&_.ak()&&(l=_.Vm(c,_.Rd));for(const m of f.drmInfos){const n=a.get(m.keySystem);n.drmInfos.push(m);m.initData&&m.initData.length&&(n.initDataTypes=[...new Set(m.initData.map(q=>q.initDataType))]);m.distinctiveIdentifierRequired&&(n.distinctiveIdentifier=_.wf);m.persistentStateRequired&&(n.persistentState=_.wf);b&&_.yh(m.audioRobustness).forEach(q=>{const u={robustness:q||"",contentType:g};n.audioCapabilities.find(v=>v.robustness===u.robustness&&v.contentType===u.contentType)||
149
+ n.audioCapabilities.push(u);h&&n.audioCapabilities.push({robustness:q||"",contentType:h})});c&&_.yh(m.videoRobustness).forEach(q=>{const u={robustness:q||"",contentType:k};n.videoCapabilities.find(v=>v.robustness===u.robustness&&v.contentType===u.contentType)||n.videoCapabilities.push(u);l&&n.videoCapabilities.push({robustness:q||"",contentType:l})})}}return a};
150
+ mn=function(a){return _.w(function*(){if(!a.j.o())if(a.L)yield a.L;else try{a.L=a.j.h(a.G),yield a.L}catch(b){a.ua||a.T(new _.G(_.E,6,6003,b.message,b))}})};
151
+ _.qn=function(a,b,c,d){d=void 0===d?"":d;if(c.length&&(!a.C||a.I!==jn)){var e=a.keySystem();if(!e.startsWith(_.ud)&&b===_.bd){const f=new nn(c);if(1<f.a.length&&(e={"org.w3.clearkey":"1077efecc0b24d02ace33c1e52e2fb4b","com.widevine.alpha":"edef8ba979d64acea3c827dcd51d21ed","com.microsoft.playready":"9a04f07998404286ab92e65be0885f95","com.adobe.primetime":"f239e769efa348509c16a903c6932efb"}[e]))for(let g=0;g<f.f.length;g++)if(e===f.f[g]){c=c.subarray(f.a[g].start,f.a[g].end+1);break}}(a.A.webkitCurrentPlaybackTargetIsWireless||
152
+ _.ak(2)||a.keySystem().startsWith(_.ud)||!_.on(a,d,c,!0))&&pn(a,d,null,b,c)}};rn=function(a,b){return _.w(function*(){a.g.info(`Handle encrypted event for type ${b.initDataType}`);yield mn(a);b.initData&&_.qn(a,b.initDataType,_.I(b.initData))})};tn=function(a){return _.w(function*(){_.Om(Kd);const b=a.S.map(c=>sn(a,c));a.Z=!0;a.S=[];yield Promise.all(b);_.Om(Jd);_.Pm("drm.onPlay",Kd,Jd)})};
153
+ vn=function(a){const b=a.keySystem(),c=a.h.bb[b],d=c.certificateUrl||"";if(""===d)return Promise.resolve();const e=a.D.getConfiguration();return un(a,e).then(()=>{var f=c.modifiers;const g=f&&f.certificateRequest,h=f&&f.certificateResponse;f=_.Si([d],a.h.attemptParameters);f.type=3;f.licenseRequestType=dd;g&&f.requestModifiers.push(k=>g(e,k));h&&f.responseModifiers.push(k=>h(e,k));a.g.debug("Fetching certificate");return a.D.Hb.fetch(f).W}).then(f=>{a.a.serverCertificate=_.I(f.data)}).catch(f=>{var g=
154
+ f.data.headers;g=Object.assign({message:"Error while fetching certificate!",url:f.data.url,status:f.data.status,response:f.data.response},g?{headers:g}:{},um(g));throw new _.G(_.E,6,6100,g,f);})};
155
+ _.wn=function(a){return _.w(function*(){if(a.G&&a.a&&a.a.serverCertificate&&a.a.serverCertificate.length)try{const b=yield a.G.setServerCertificate(a.a.serverCertificate);void 0===b||b||a.g.debug("Server certificates are not supported by the key system. The server certificate has been ignored.")}catch(b){throw new _.G(_.E,6,6004,{browserError:b.message});}})};
156
+ _.zn=function(a){const b=a.a?a.a.initData||[]:[];for(const c of b){let d=!_.ak(2);if(a.h.enforceSingleSession&&!a.keySystem().startsWith(_.ud)){const e=a.f.values();for(const f of e)_.Gi(c.initData,f.initData)?(a.g.info("Skipping Session creation. Existing init data in single session mode!"),d=!1):f.periodId===c.periodId&&(a.g.info("Skipping Session creation. Merging init data for period in single session mode "+`for Key ID ${c.keyId}.`),xn(c.initData,f)||(f.td.push(c.initData),c.keyId&&!f.fb.includes(c.keyId)&&
157
+ f.fb.push(c.keyId),a.l.get(c.keyId)||a.l.set(c.keyId,Nf)),d=!1)}!d||a.C&&a.I===jn||(_.on(a,c.keyId,c.initData)&&(d=!1),d&&(a.g.info("Request new media key session on create"),pn(a,c.keyId,c.periodId,c.initDataType,c.initData)))}for(const c of a.J)_.yn(a,c);b.length||a.J.length||(a.o||a.g.info(wa),a.o=!0,a.B=!1,a.F.resolve());return a.F};
158
+ _.An=function(a,b){if(!a.G)return _.oh(a.w,b,[Sd,"msneedkey",Cg,"needkey"],()=>{a.T(new _.G(_.E,6,6010))}),Promise.resolve();a.A=b;a.j.l(b);a.w.one(a.A,_.Te,()=>tn(a));a.w.on(a.A,_.xg,e=>{const f=a.B;a.B=!a.o;!f&&a.B&&(a.g.info("Waiting for DRM license key delivery"),a.D.onEvent(e))});var c=a.a.initData.find(e=>0<e.initData.length);let d=Promise.resolve();if(c||a.j.f()!==Eb||a.J.length)d=mn(a);c=Promise.resolve();_.dk()&&38===_.ek().major||(a.a&&a.a.keySystem!==_.Ne&&!a.a.serverCertificate&&(c=vn(a)),
159
+ c=c.then(()=>_.wn(a)));return Promise.all([d,c]).then(()=>{a.ua||(_.zn(a),a.w.on(a.A,Sd,e=>rn(a,e)))}).catch(e=>{if(!a.ua){if(6004===e.code&&a.a&&a.a.keySystem===_.yd&&1>a.M&&a.a.serverCertificate&&a.a.serverCertificate.length)return a.g.warn("Detected invalid widevine server certificate!. Retrying"),a.T(new _.G(1,6,6004)),a.a.serverCertificate=null,a.M++,_.An(a,b);1<=a.M&&a.g.info("Could not get valid widevine server certificate. Giving up");throw e;}})};
160
+ un=function(a,b){return _.w(function*(){const c=a.D.Cc();if(c){var d=b&&b.drm&&b.drm.customData;d&&(yield c(d))}})};
161
+ _.yn=function(a,b){let c;try{a.g.debug("Attempting to load an offline session",b),c=a.G.createSession(_.Re)}catch(e){const f=new _.G(_.E,6,6005,{browserError:e.message});a.T(f);return Promise.reject(f)}a.w.on(c,_.xe,a.da.bind(a));a.w.on(c,fe,a.ba.bind(a));const d={initData:null,loaded:!1,le:Infinity,Jb:null,Ma:new _.ln,periodId:null,td:[],keyId:null,fb:[],initDataType:null,gc:null,sessionContext:{ldlDelay:0,customData:{}}};d.Ma.catch(()=>{});a.f.set(c,d);return c.load(b).then(e=>{if(a.ua)return null;
162
+ a.g.debug("Loaded offline session",b,e);if(!e)return a.f.delete(c),a.T(new _.G(_.E,6,6013)),null;d.loaded=!0;Bn(a)&&(a.o||a.g.info(wa),a.o=!0,a.B=!1,a.F.resolve());return c},e=>{a.ua||(a.f.delete(c),a.T(new _.G(_.E,6,6005,{browserError:e.message})))})};xn=function(a,b){if(!a)return!1;for(let c=0;c<b.td.length;c++)if(_.Gi(a,b.td[c]))return!0;return!1};
163
+ _.on=function(a,b,c,d){d=void 0===d?!1:d;for(const e of a.f.keys()){const f=a.f.get(e);if(_.Gi(c,f.initData))return b?f.fb.includes(b)?d&&a.g.info("Skipping Session creation. "+`License for init data with Key ID ${b} was already `+`requested in Session: '${e.sessionId}'. `):(f.fb.push(b),a.l.get(b)||a.l.set(b,Nf),d&&a.g.info(Ib+`Session: '${e.sessionId}'`+`Adding Key ID ${b} to session meta-data.`)):d&&a.g.info(Ib+`Session: '${e.sessionId}'`),!0;if(xn(c,f))return d&&a.g.info("Skipping Session creation. License for init data was already requested [extra]"),
162
164
  !0}return!1};
163
- hn=function(a,b,c,d,e,f,g){f=void 0===f?null:f;g=void 0===g?!1:g;_.x(function*(){if(e.length){var h=b;if(!h)try{h=vn(a,d,e,f)}catch(u){if(a.g.warn("Ignoring unrecognized init data. This may be caused by unsupported or malformed init data. Set `drm.ignoreUnrecognizedInitData \x3d false` if you want to override this behavior and use the init data after all.",{error:u,initDataType:d,initData:e}),a.h.ignoreUnrecognizedInitData)return}if(!g&&wn(a,h,d,e)){var k=!0;if("skd"===d&&!a.h.enableSessionCacheForSkd)for(var l of a.f.keys()){var m=a.f.get(l);
164
- if(h&&m.keyId===h){a.g.warn(`Close and re-open session for ${h}`);try{yield l.close()}catch(u){a.g.warn("Unable to close session",u)}k=!1}}if(k){a.g.warn(`Skip creating a new session for ${h}`);return}}try{var n=a.C?_.Re:Uf;var q=a.G.createSession(n);a.g.info(`Created new ${n} session for Key ID: '${h}'. `+`Init data type: ${d}.`)}catch(u){a.U(new _.H(_.F,6,6005,{browserError:u.message}));return}a.w.on(q,_.xe,a.ea.bind(a));a.w.on(q,ge,a.ga.bind(a));k={dc:f,ud:[],initData:e,initDataType:d,keyId:h,
165
- ab:h?[h]:[],loaded:!1,me:Infinity,periodId:c,xb:null,Ka:new _.dn,sessionContext:{ldlDelay:0,customData:{}}};k.Ka.catch(()=>{});f&&(l=a.f.get(f),k.sessionContext=l.sessionContext);a.f.set(q,k);h&&!a.l.get(h)&&a.l.set(h,Of);if(e)for(l=0;l<a.a.initData.length;l++)m=a.a.initData[l],m.keyId&&!k.ab.includes(m.keyId)&&_.Hi(m.initData,e)&&(k.keyId||(k.keyId=m.keyId),k.ab.push(m.keyId),a.l.get(m.keyId)||a.l.set(m.keyId,Of));l=a.D.getConfiguration();m=a.keySystem();m=a.h.Za[m];n=(n=m.modifiers)&&n.transformInitData;
166
- _.Ug(n)||(n=Tm);try{e=n({playerConfig:l,initData:e,initDataType:d,drmInfo:a.a,drmSystemConfig:m,sessionContext:k.sessionContext,emeApi:a.j.f()})}catch(u){h=u;u instanceof _.H||(h=new _.H(_.F,6,6016,u));k.Ka&&k.Ka.reject(u);a.U(h);return}a.g.info(`Generate License Request for key ID: '${h}'`);q.generateRequest(d,e.buffer).catch(u=>{if(!a.va){var v=null;u.errorCode&&u.errorCode.systemCode&&(v=u.errorCode.systemCode,0>v&&(v+=Math.pow(2,32)),v="0x"+v.toString(16));a.U(new _.H(_.F,6,6006,{browserError:u.message,
167
- error:u,extended:v},u))}})}else a.g.warn("Empty init data")})};xn=function(a){let b=Infinity;a=a.f.keys();for(const c of a)isNaN(c.expiration)||(b=Math.min(b,c.expiration));return b};un=function(a){a=a.f.values();return _.di(a,b=>b.loaded)};wn=function(a,b,c,d){if(!b&&c!==_.Jf)return!1;d=b||Nl(d);for(const e of a.f.values())if(b&&e.keyId===b||b&&e.ab.includes(b)||c===_.Jf&&(e.keyId||Nl(e.initData))===d)return!0;return!1};
168
- vn=function(a,b,c,d){d=void 0===d?null:d;if("skd"===b){a:{var e=d;e=void 0===e?null:e;var f=a.keySystem(),g=a.h.Za[f];f=a.D.getConfiguration();g=g&&g.modifiers&&g.modifiers.extractContentId;_.Ug(g)||(g=Sm);try{var h={ldlDelay:0,customData:{}};e&&(h=a.f.get(e).sessionContext);var k=g(f,c,h);a.g.debug(`Extracted Content ID '${k}' from SKD`);var l=k;break a}catch(m){a.g.warn("Unable to extract Content ID from SKD",m)}l=""}return l}if(b===_.Jf)return Nl(c)||"";if(b===_.$c){l=a.keySystem();try{if(l.match(/^com\.widevine\.alpha/)){const m=
169
- _.zm(c);if(m)return m.a}else if(Km(l)){{f=new _.ym(new DataView(c.buffer,c.byteOffset,c.byteLength),!1);g=_.P(f);const m=_.P(f);h=_.El(m);const n=_.P(f);c=n>>>24;k=n&16777215;const q=_.Cl(f,16),u=_.Gi(q);if(0<c){const D=_.P(f);f.skip(16*D)}const v=_.P(f),y=_.Cl(f,v),B=_.Fm(y);_.ih("Parsed PR PSSH Box","size",g,"name",h,"version",c,"flags",k,"size",v,"systemId",u,"keyId",B.a);e=B}if(e)return e.a}}catch(m){throw a.g.warn("Unable to extract Key ID from PSSH data.",{error:m,keySystem:l}),m;}}return""};
170
- ln=function(a,b){const c=b.target,d=a.f.get(c);var e=a.keySystem();let f=!1;e.match(/^com\.widevine\.alpha/)&&b.message&&2===b.message.byteLength?(f=!0,a.g.info("WV Server certificate request for "+`SID:'${c.sessionId} `+`from msg '${b.messageType}'`)):a.g.info("License request for "+`SID:'${c.sessionId}'/KID:'${d.keyId}' `+`from msg '${b.messageType}'`);let g=a.a.licenseServerUri;e=a.h.Za[e];"individualization-request"===b.messageType&&e&&e.individualizationServer&&(g=e.individualizationServer);
171
- const h=_.Si([g],a.h.attemptParameters);h.type=3;h.body=b.message;h.method=_.ub;h.licenseRequestType=b.messageType===je&&d.dc?ie:f?bd:b.messageType;h.sessionId=c.sessionId;if(h.licenseRequestType===ie)a.D.onEvent(new _.E(Nd));Km(a.a.keySystem)&&yn(a,h);ll(a.K,h);const k=Math.floor(b.timeStamp),l=Date.now();return zn(a,h,d.sessionContext).then(()=>{_.Hm(`drm.license.req.${k}.start`);a.g.debug("Sending DRM license request to",g,h);return a.D.vb.fetch(h).R}).then(m=>{_.Hm(`drm.license.req.${k}.end`);
172
- _.Im(`drm.license.req.${k}`,`drm.license.req.${k}.start`,`drm.license.req.${k}.end`);if(a.va)return Promise.reject();const n=Date.now()-l;var q=An(a,m);let u="";q&&(u=` RID:${q}`);q=m&&m.data?m.data.byteLength:-1;f?a.g.info("WV Server certificate response for "+`SID:'${c.sessionId}' `+`${q} bytes `+`in ${n}ms${u}`):a.g.info("License response for "+`SID:'${c.sessionId}'/`+`KID:'${d.keyId}' `+`${q} bytes `+`in ${n}ms${u}`);const v=ml(a.K,m);_.Hm(`drm.sess.update.${k}.start`);return c.update(m.data).then(()=>
173
- {_.Hm(`drm.sess.update.${k}.end`);_.Im(`drm.sess.update.${k}`,`drm.sess.update.${k}.start`,`drm.sess.update.${k}.end`);if(!f){var y=xn(a),B=v?Date.now()+1E3*v.delay:Number.NaN;y=new _.E(_.Pd,{keySystem:a.keySystem(),expirationTime:y,expectedRenewalTime:B});a.D.onEvent(y);d&&(d.xb&&d.xb.resolve(),d.dc&&(y=d.dc,a.g.info(`Closing expired session '${y.sessionId}'`),Jm(y).catch(()=>{a.g.warn("Unable to close expired session in time")}),(y=a.f.get(d.dc))&&y.wc&&y.wc.stop(),a.f.delete(d.dc),d.dc=null),(new _.Tj(()=>
174
- {a.va||(d.loaded=!0,d.Ka&&d.Ka.resolve(),un(a)&&(a.o||a.g.info(wa),a.o=!0,a.B=!1,a.F.resolve()))})).ha(5),null!==d.initData&&(0<d.sessionContext.ldlDelay||v&&kl(a.keySystem()))&&(y=new _.Tj(()=>{!a.va&&a.K&&(a.g.info("Updating CSL Sessions"),Km(a.keySystem())?hn(a,d.keyId,d.periodId,d.initDataType,d.initData,c,!0):a.keySystem().startsWith(_.vd)&&c.update(_.si("renew")))}),d.wc=y,y.ha(v?v.delay:d.sessionContext.ldlDelay)))}})},m=>_.x(function*(){if(!a.va){var n=m.data.headers;n=Object.assign({message:_.Sa,
175
- url:m.data.url,status:m.data.status,response:m.data.response},n?{headers:n}:{},km(n));n=new _.H(_.F,6,6007,n,m);a.U(n);d&&d.xb&&d.xb.reject(n);d&&d.Ka&&d.Ka.reject(n)}})).catch(m=>{a.va||(m===Hb?a.g.info("Ignore update for closed sessions"):(m=new _.H(_.F,6,6008,{browserError:m.message}),a.U(m),d&&d.xb&&d.xb.reject(m),d&&d.Ka&&d.Ka.reject(m)))})};
176
- yn=function(a,b){var c=qi(b.body,!0,!0);if(c.includes("PlayReadyKeyMessage")){a.g.debug("Unwrapping PlayReady request.");a=(new DOMParser).parseFromString(c,"application/xml");c=a.getElementsByTagName("HttpHeader");for(let d=0;d<c.length;++d)b.headers[c[d].querySelector("name").textContent]=c[d].querySelector(_.hg).textContent;b.body=_.Ei(a.querySelector("Challenge").textContent).buffer}else a.g.debug("PlayReady request is already unwrapped."),b.headers[ua]="text/xml; charset\x3dutf-8"};
177
- zn=function(a,b,c){return _.x(function*(){const d=a.D.getConfiguration();yield nn(a,d);const e=a.keySystem();var f=a.h.Za[e];const g=(f=f&&f.modifiers)&&f.licenseRequest,h=f&&f.licenseResponse;g?b.requestModifiers.push(k=>g(d,k,c)):e.startsWith(_.vd)&&b.requestModifiers.push(k=>_.Ql(k));h?b.responseModifiers.push(k=>h(d,k,c)):e.startsWith(_.vd)&&b.responseModifiers.push(k=>_.Rl(k))})};
178
- An=function(a,b){if(!b||!b.headers)return"";if(b=b.headers["x-dt-li"])try{return JSON.parse(_.oi(_.Ei(b))).ti}catch(c){a.g.warn("Unable to parse DRMtoday Request ID",c)}return""};_.Dn=function(a,b){a&&b&&(_.Bn.set(a,b),_.Cn.info(`Registered TextDisplayerFactory: '${a}'`))};
179
- _.En=function(a,b){b=b.find(c=>(c=_.Bn.get(c))?c.isSupported(a):!1);if(null==b)return _.Cn.warn("Subtitles may not work as expected. No compatible text displayer found for this platform."),null;_.Cn.info(`Chosen the text displayer: ${b}`);return _.Bn.get(b)};_.Fn=function(a,b){if(null==a.a)a.a={timestamp:Date.now()/1E3,state:b,duration:0};else{{const c=Date.now()/1E3;a.a.duration=c-a.a.timestamp;a.a.state!==b&&(a.f.push(a.a),a.a={timestamp:c,state:b,duration:0})}}};
180
- Gn=function(a,b){let c=0;a.a&&a.a.state===b&&(c+=a.a.duration);for(const d of a.f)c+=d.state===b?d.duration:0;return c};Hn=function(a){const b=d=>({timestamp:d.timestamp,state:d.state,duration:d.duration}),c=[];for(const d of a.f)c.push(b(d));a.a&&c.push(b(a.a));return c};In=function(a){return a.a.map(b=>_.Qg(b))};
181
- _.Jn=function(){return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,corruptedFrames:NaN,estimatedBandwidth:NaN,loadLatency:NaN,playTime:NaN,pauseTime:NaN,bufferingTime:NaN,switchHistory:[],stateHistory:[]}};Ln=function(a,b,c,d){b===HTMLMediaElement.HAVE_NOTHING||a.readyState>=b?d():(b=Kn.value().get(b),c.one(a,b,d))};
182
- Pn=function(a){a.g.debug("Start watching for video events for "+a.m.namespace());const b=a.m,c=d=>Mn(a,d.type);a.a.on(b,_.Vd,()=>{a.h||(a.j=!1,Nn(a,_.On))});a.a.on(b,Vc,c);a.a.on(b,_.df,()=>{a.F=!0;a.j=!1;Mn(a,_.df)});a.a.on(b,_.Pe,()=>{a.F=!1;a.j=!1;Mn(a,_.Pe)});a.a.on(b,_.Xf,c);a.a.on(b,_.tf,c);a.a.on(b,_.Ef,d=>{a.h=!1;a.j=!1;Mn(a,d.type)});a.a.on(b,_.Ff,d=>{a.h=!0;Mn(a,d.type)});a.a.on(b,Lf,c);a.a.on(b,_.vg,()=>{a.j=!0;Mn(a,_.vg)});a.a.on(b,_.r,d=>a.U(d));a.a.on(b,_.se,c);a.a.on(b,Wc,()=>{a.C=
183
- !0;Mn(a,Wc)});a.a.on(b,_.gg,d=>{a.h=!0;Mn(a,d.type)});a.a.on(b,_.fg,d=>{a.h=!1;a.j=!1;Mn(a,d.type)})};Qn=function(a,b){return Object.keys(b)[a]};Sn=function(a,b){const c={type:_.Nf};b===_.Uc||b===_.Qc?(c.reason=a.w,b===_.Uc?c.timeSinceLastStateChangeMS=a.H:c.bufferedTimeMS=a.B):(a.f===_.Rn&&(c.reason=a.w),a.A===_.Rn&&(c.reason=a.w,c.bufferedTimeMS=a.B),c.currentState=a.f,c.previousState=a.A,c.timeSinceLastStateChangeMS=a.H);return c};
184
- Nn=function(a,b){if(a.f===b)return!1;var c=Date.now();const d=a.f===_.Rn;a.A=a.f;a.f=b;a.A===_.On&&(a.I=c,a.o=0);a.o||(a.o=a.I||c);a.H=c-a.o;a.o=c;b===_.Rn?(a.K=a.o,a.w=a.h?1:2,a.g.info("Buffering started. Reason: "+Qn(a.w-1,_.Tn)),b=Sn(a,_.Uc),a.Zb(_.Uc,b)):d&&(a.B=a.o-a.K,a.g.info("Buffering finished. Reason: "+Qn(a.w-1,_.Tn)+". Buffering time: "+a.B+" ms"),b=Sn(a,_.Qc),a.Zb(_.Qc,b));b=Qn(a.A,_.Un);c=Qn(a.f,_.Un);a.g.info(`Player state change: ${b} -> ${c}`);a.Zb(_.Nf,Sn(a,""));return!0};
185
- Mn=function(a,b){if(a.f===_.Vn)a.g.warn("Player is in error state, aborting any further state checks");else{var c=a.m.isPaused(),d=a.m?a.m.isEnded():!1;if(d)a.h||(a.j=!1,Nn(a,_.On));else if(b!==_.Xf){var e=a.m.getPosition();e=null!==e&&void 0!==e&&0<=e?a.m.getBufferInfo().ya(e,!0):-1;a.G=e;e=a.m.getSurface().getMedia();a.l=e?e.readyState:null;a.J=a.m.getPlaybackRate()||1;e=typeof a.l===_.t&&2>a.l&&2===e.networkState;var f=typeof a.l===_.t&&0>=a.G&&a.f===_.Wn,g=typeof a.l===_.t&&2>=a.l&&a.j;e=a.h||
186
- f||e||g;!a.L||a.m.isLive()||a.f!==_.Rn||e||(f=b===_.Ef&&4===a.l,(g=a.A===_.Xn)&&!a.C?e=!0:g||a.C||f||(e=!0));f=!1;e?f=Nn(a,_.Rn):c?f=Nn(a,_.Yn):a.F&&(f=Nn(a,_.Zn));f&&(a.C=!1);a.g.debug("Video state check for event "+b+":: seeking: "+a.h+", waiting: "+a.j+", playing: "+a.F+", paused: "+c+", readyState: "+a.l+", rate: "+a.J+", buffer: "+a.G+", ended: "+d+". Changed state: "+f+", Current state: "+Qn(a.f,_.Un))}}};
187
- $n=function(a){a=(new _.Mh(a)).Da;if(!a)return null;a=a.toUpperCase();return _.wi(a,".MPD")?_.zc:_.wi(a,".M3U8")?_.Ok:_.wi(a,".MP4")?_.mg:_.wi(a,"MANIFEST")||_.wi(a,".ISM")?_.Ec:null};_.bo=function(a){let b;Xk(a)?b=a.source:b=a;Array.isArray(b)||(b=[b]);b=b.filter(c=>typeof c===_.Qf||"url"in c);a=[];for(let c=0;c<b.length;c++){const d=ao(b[c]);d&&a.push(d)}return a};
188
- ao=function(a){let b=null;_.Wg(a)&&(a={url:a});typeof a===_.Fe&&!Array.isArray(a)&&"url"in a&&(b={url:a.url,type:a.type?a.type:null},_.A(a.drmProtected)||typeof a.drmProtected!==_.Pc||(b.drmProtected=a.drmProtected),_.A(a.isLive)||typeof a.isLive!==_.Pc||(b.isLive=a.isLive),_.A(a.name)||typeof a.name!==_.Qf||(b.name=a.name),_.A(a.Lb)||typeof a.Lb!==_.Qf||(b.Lb=a.Lb),_.A(a.audioMimeType)||typeof a.audioMimeType!==_.Qf||(b.audioMimeType=a.audioMimeType));b&&!b.type&&(b.type=$n(a.url),b.type?co.debug("Detect media type "+
189
- b.type+" for "+a.url):co.warn("Unable to detect media type for "+a.url));return b};fo=function(a){return a.w?eo():new Promise(b=>{if(a.a){const c=a.a;a.h.off(c,_.r);a.h.off(c,_.yf);a.a=null}b()})};eo=function(){return Promise.reject(new _.H(_.F,7,7E3))};
190
- ho=function(a,b){return a.w?eo():new Promise(c=>{a.a||(a.h.on(b,_.r,()=>{{const d=go(a);if(d)a.onError(d)}}),a.h.on(b,_.yf,()=>{const d=b.videoWidth,e=b.videoHeight,f=a.getTrackManager();f&&0<d&&0<e&&(f.w={width:d,height:e});a.trigger(new _.E(_.Nc,{detail:{width:d,height:e}}))}),a.a=b);c()})};
191
- jo=function(a){return _.x(function*(){if(a.w)return eo();var b=a.da[a.getSourceIndex()];if(!a.configuration.drm||!1===b.drmProtected)return a.log.debug("No DRM configuration present.","Skipping DRM engine initialization"),Promise.resolve();b=_.ql(a.configuration.drm);a.log.debug("Drm configuration: ",b);const c=a.getNetworkEngine();a.o=new _.io({vb:c,onError:d=>a.onError(d),re:()=>{},qe:(d,e)=>{a.trigger(new _.E(_.Md,{expirationTime:e}))},onEvent:d=>{d instanceof _.E?a.dispatchEvent(d):a.log.debug(_.Ob,
192
- d.type)},getConfiguration:()=>a.getConfiguration(),Bc:()=>a.Bc()});a.o.h=b;yield _.cn(a.o,[{id:0,language:_.ag,primary:!1,audio:null,video:{id:0,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:()=>null,getSegmentReference:()=>null,adjustSegmentDurations:()=>{},getDuration:a.getDuration.bind(a),initSegmentReference:null,Aa:0,mimeType:_.mg,codecs:"",encrypted:!0,keyId:null,language:_.ag,originalLanguage:_.ag,label:null,type:_.w,primary:!1,frameRate:void 0,Xh:void 0,
193
- trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,spatialAudio:!1,Kh:null,closedCaptions:null},bandwidth:100,drmInfos:[],allowedByApplication:!0,allowedByKeySystem:!0}]);yield _.tn(a.o,a.a);return Promise.resolve()})};ko=function(a,b){Ln(a.a,HTMLMediaElement.HAVE_CURRENT_DATA,a.h,()=>{a.getState()!==_.Vn&&a.seek(b).catch(c=>{a.log.warn("Error while seeking to start position.",c)})})};
194
- go=function(a){if(null===a.da||!a.a.error)return null;const b=a.a.error.code;if(1===b)return null;let c=a.a.error.msExtendedCode;c&&(0>c&&(c+=Math.pow(2,32)),c=c.toString(16));return new _.H(_.F,3,3016,{code:b,Sh:c,message:a.a.error.message})};
195
- mo=function(a){if(a.w)return new _.lo(eo(),()=>{});const b=a.da[a.getSourceIndex()],c=a.configuration.startTime||null,d=a.a,e=a.H;c&&ko(a,c);if(d.preload!==_.Ee)a.h.one(d,_.se,()=>{const g=Date.now()/1E3-e;a.f.A=g;a.log.debug("Time to load: ",g)});d.src=b.url;(_.Xj()||_.ak())&&d.load();const f=new _.dn;a.h.one(d,Lf,()=>{const g=a.getConfiguration().manifest.attemptParameters.timeout||30;a.B||(a.B=(new _.Tj(()=>{f.reject(new _.H(_.F,3,3100,{message:`Unable to load media source successfully from ${b.url}`,
196
- uri:b.url},d.error))})).ha(g))});Ln(d,a.configuration.forceWaitForTracks?HTMLMediaElement.HAVE_CURRENT_DATA:HTMLMediaElement.HAVE_METADATA,a.h,()=>f.resolve());d.error?f.reject(go(a)):d.preload===_.Ee&&(a.log.warn('With \x3cvideo preload\x3d"none"\x3e, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way. Please do not use preload\x3d"none" with PRESTOplay for Web Apps.'),f.resolve());a.h.one(d,_.r,()=>{f.reject(go(a))});return new _.lo(f,
197
- ()=>{const g=new _.H(_.F,7,7001);f.reject(g);return Promise.resolve()})};no=function(a,b){Ln(b,HTMLMediaElement.HAVE_CURRENT_DATA,a.h,()=>{if(a.isLive()&&a.getState()!==_.Vn){var c=a.getSeekRange().end,d=a.getPosition();Infinity===c||20>c-d||(a.log.warn("Detected that HLS live stream was not started from close to the live edge. Auto-fixing, seeking to seek range end."+`(position: ${d}, seek range end: ${c})`),a.seek(c).catch(e=>{a.log.warn("Error while seeking to seek range edge.",e)}))}})};
198
- oo=function(a,b){let c=!1;a.h.on(b,_.Ff,()=>{c=b.paused});a.h.on(b,_.Ef,()=>{.2>b.duration-b.currentTime&&b.paused&&!c&&(a.log.warn("Player was auto-paused during seek to the end, auto-resuming."),b.play())})};_.ro=function(a){a&&(0<=po.indexOf(a)?qo.warn(`Factory '${a.name()}' is already registered`):(po.push(a),qo.info(`Factory ${a.name()}' has been registered.`)))};to=function(a,b){let c=po.find(d=>d.isSupported(a,b));c||(c=new so);qo.info(`Chosen ads: ${c.name()}`);return c};
199
- _.uo=function(a,b){a=document.createElement(a);for(const c in b){const d=b[c];null===d||void 0===d?a.setAttribute(c,""):a.setAttribute(c,d)}return a};_.vo=function(a,b){a.classList.add(b)};_.wo=function(a,b){if(a&&typeof b===_.Fe)for(const c in b)a.style[c]=b[c]};_.xo=function(a){return document.createElement(a)};
200
- yo=function(a,b){const c=new MutationObserver(()=>{const d=Array.from(a.h.values());Ch(Array.from(b.classList),Array.from(d))||b.classList.add(...d)});c.observe(b,{attributes:!0,attributeFilter:["class"]});return c};zo=function(a,b){a.a&&0!==b.length&&(a.a.classList.add(b),a.h.add(b))};
201
- Ao=function(a,b,c){(_.ak()&&53===_.bk().major||_.ak()&&68===_.bk().major||_.ck())&&!b.hasAttribute(Bd)&&(b.style.opacity="0",b.setAttribute(Bd,""),a.j.one(b,Rd,()=>{b.removeAttribute(Bd);b.style.opacity="1";c&&(c.style.opacity="1")}))};
202
- Eo=function(a){a.a.on(window,"offline",()=>{Bo(a,!1)});a.a.on(window,"online",()=>{a.f||Co(a)});a.a.on(a.m,Lf,()=>Do(a));a.a.on(a.m,"suspend",()=>Do(a));a.a.on(a.m,_.vg,()=>Do(a));a.a.on(a.m,_.df,()=>{a.f||Co(a)});a.a.on(a.m,_.rf,()=>{a.f||Co(a)});a.a.on(a.m,_.Nf,()=>{switch(a.m.getState()){case _.Rn:Do(a);break;default:Do(a)}})};Fo=function(a){a.h&&(a.h.stop(),a.h=null)};Do=function(a){a.f&&Co(a)};
203
- Go=function(a){return _.x(function*(){var b=a.m.getConfiguration().connectivityCheck;b&&a.m&&(b=yield bj(a.j,b.url,b.attemptParameters,b.method),Bo(a,b))})};Co=function(a){a.m.getConfiguration().connectivityCheck&&(Fo(a),a.h=(new _.Tj(()=>Go(a))).ha(5))};Bo=function(a,b){Fo(a);a.f!==b&&(a.f=b,a.m&&a.m.getConfiguration().connectivityCheck&&a.m.trigger(new _.E(Le,{online:a.f})))};Io=function(){for(let a=0;a<Ho.length;++a)Ho[a].uc()};
204
- _.Jo=function(a,b){b=b||0;a={priority:b,uc:a};for(let c=0;c<Ho.length;c++)if(Ho[c].priority<b){Ho.splice(c,0,a);return}Ho.push(a)};Ko=function(a,b){a.onError(b);a.release().then(()=>a.destroy())};
205
- Mo=function(a){var b=Lo;const c={kty:"RSA",n:b.n,e:b.e},d=a.h+"."+a.f,e=a.j;return new Promise(function(f,g){let h;try{h=window&&window.crypto&&window.crypto.subtle}catch(l){}if(h){var k={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};h.importKey("jwk",c,k,!1,["verify"]).then(function(l){const m=_.si(d),n=_.Ei(e);return h.verify(k,l,n.buffer,m.buffer)}).then(function(l){l?f():g(new _.Jh("Signature Verification failed",$f))}).catch(g)}else f()})};
206
- Oo=function(a){if(!a.a){var b=a.f.split(".");if(3!==b.length)throw Error("Expected to find 3 data sections in JWT raw data");b=new No(b[0],b[1],b[2]);a.a=b}return a.a};Po=function(a){return _.x(function*(){var b=Oo(a);try{yield Mo(b)}catch(c){if(c&&c.code===$f)throw c;{b=window.location.href;const d=new _.Mh(b);b=d.gb||d.Pa?d:new _.Mh("//"+b)}if(!/(^127\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)|(^localhost)/.test(b.Pa))throw c;}})};
207
- Qo=function(a){switch((a.da[0]||{src:"",type:""}).type){case _.zc:a="dash";break;case _.Ec:a="ss";break;case _.Ok:a="hls";break;case _.mg:a="mp4";break;default:a=""}return a};Ro=function(a){return a.viewerId?a.viewerId:(a=a.drm||null)&&a.customData&&a.customData.userId?`${a.customData.userId}`:""};So=function(a){return(a=a.drm||null)&&a.customData&&a.customData.assetId?`${a.customData.assetId}`:""};
208
- To=function(a){return(a=a.drm||null)&&a.customData&&a.customData.sessionId?`${a.customData.sessionId}`:""};Uo=function(a){a=a.drmInfo;return(new _.Mh(a&&a.licenseServerUri||"")).Pa};Vo=function(a){const b=a.configuration;let c="no";b.drm&&!_.Yg(b.drm,{})&&(c="custom",b.drm.env&&b.drm.env.toLowerCase().startsWith(Qd)||Uo(a).endsWith("drmtoday.com"))&&(c=Qd);return c};Wo=function(a){a=a.drmInfo;let b="";if(a)switch(a.keySystem){case _.zd:b="wv";break;case _.xd:b="pr";break;case _.vd:b="fps"}return b};
209
- Xo=function(a){a=a.drmInfo;let b=!1;a&&(b=a.persistentStateRequired);return b.toString()};Yo=function(a){a=a.drmInfo;let b="";if(a)switch(a.videoRobustness){case Za:case Xa:b="L1";break;case Ya:b="L2";break;case _.Gb:case _.Fb:b="L3"}return b};
210
- bp=function(a,b){const c="ie"===_.vk().browser;var d=b.configuration;const e=[...Array.from(_.Yk.keys()),...b.Gf];b={"CL-KEY":a.f,"CL-LOCATION":window.location.href,"CL-SDK-VERSION":_.fa,"CL-USER-ID":Ro(d),"CL-ASSET-ID":So(d),"CL-SESSION-ID":To(d),"CL-PLAYBACK-TYPE":b.isLive?Zo:$o,"CL-CONTENT-TYPE":Qo(b),"CL-PLUGINS":e.join(" "),"CL-DRM":Vo(b),"CL-DRM-CDM":Wo(b),"CL-DRM-SEC-LEVEL":Yo(b),"CL-DRM-OFFLINE":Xo(b),"CL-DRM-IP":Uo(b)};c&&(d=window.localStorage.getItem("cl_et"))&&(b["CL-ETAG"]=d);d=_.Si(["https://downloads.castlabs.com/r/register/"]);
211
- d.method="GET";d.headers=b;return(new _.ap).fetch(d).R.then(f=>{200===f.status&&c&&window.localStorage.setItem("cl_et",f.headers.etag);return Promise.resolve()}).catch(f=>{a:{var g=Oo(a);f=f.data;var h=f.status;if(g.a&&g.a.ilv)g=Promise.resolve();else{switch(h){case 403:case 404:g=7101;var k="castLabs Player license is invalid";if(403===h){h=k;k="";try{k=JSON.parse(decodeURIComponent(f.responseText)).message}catch(l){}f=k;f=h+(": "+f)}else f=k+"!";k=f;break;case 412:g=7103;k="License requires a viewer ID. It should be supplied either via the `viewerId` config or in case of DRMtoday via the `drm.customData.userID` config.";
212
- break;default:g=Promise.resolve();break a}a.g.error(db+k);g=Promise.reject(new _.H(_.F,7,g,k))}}return g})};_.dp=function(a){a&&(0<=cp.indexOf(a)||cp.push(a))};fp=function(a,b){a.B=new ep(b);Po(a.B).catch(c=>{setTimeout(()=>{a.g.error(db+c);a.trigger(new _.E(_.r,{detail:new _.H(_.F,7,7101)}));a.destroy()},1E3)})};hp=function(a,b){a.S=b;for(const c of a.S)(b=c.id())&&(a.H[b]=c);_.gp(a,"onPlayerCreated")};
213
- _.ip=function(a,b){null!=b&&b===a.a?a.a.forwardEventsTo(a):(a.a&&(a.a.stopForwardingEventsTo(a),a.a.destroy(),a.a=null),b&&(b.init(a.h,a.A),b.setNetworkEngine(a.getNetworkEngine()),b.forwardEventsTo(a),a.a=b))};
214
- jp=function(a,b){_.x(function*(){a.h.getMedia()||a.h.getCastElement();a.B||(a.B=new ep(a.f.license));try{a.g.debug("Verifying license remotely"),yield bp(a.B,b),a.g.debug("License verified remotely")}catch(c){a.g.debug("License rejected by remote",c),setTimeout(Ko,1E3,{release:a.release.bind(a),destroy:a.destroy.bind(a),onError:a.onError.bind(a)},c)}})};_.gp=function(a,b,...c){if(!a.T)return Promise.resolve();const d=a.S.map(e=>e[b].call(e,a,...c)).filter(e=>e instanceof Promise);return Promise.all(d)};
215
- kp=function(a){return _.x(function*(){if(a.L)return a.g.debug("The player is already released. No-op"),new Promise(b=>b());a.W.off(document,tg);a.trigger(new _.E(_.vf));a.h&&a.h.release();a.j&&(yield a.j.dispose(),a.j=null);if(a.a){let b=null;const c=a.a.on(_.Nf,d=>{b=d});return _.gp(a,_.Je).then(()=>{a.a.stopForwardingEventsTo(a);return Promise.all([a.a.release(),a.F.release()])}).then(()=>{a.g.debug("Releasing player completed");b&&(a.g.debug("Re-post state change event after release"),a.trigger(b))}).finally(()=>
216
- {a.a.off(_.Nf,c);a.trigger(new _.E(uf))})}a.trigger(new _.E(uf));return new Promise(b=>b())})};lp=function(a,b){const c=nh(d=>d.f(_.tb)&&a.every(e=>2===d.canPlay(e,b)));if(!c)throw new _.H(_.F,7,7003,"No compatible player implementing playlist mode found!");return Promise.resolve({player:c.create(),sourceIndex:0})};np=function(a,b,c){return _.x(function*(){if(2===(a.a?a.a.canPlay(b[0],c):0)&&!a.N)return{player:a.a,sourceIndex:0};a.N=!1;return mp(a,b,c)})};
217
- op=function(a,b,c){return a.J===_.tb?lp(b,c):np(a,b,c)};
218
- mp=function(a,b,c){return new Promise((d,e)=>{var f;if(b){var g=f=null;for(var h=0;h<b.length;h++);h=Object.values(_.kh);for(let k=0;k<b.length;k++)for(let l=0;l<h.length;l++){const m={Pb:h[l],confidence:h[l].canPlay(b[k],c)};if(null===f||f.confidence<m.confidence)f=m,g=k}f&&typeof g===_.t&&0<f.confidence?(_.lh.debug("Player Factory '"+f.Pb.a()+"' can play",b[g]),f=new pp(f.Pb,g)):(_.lh.error("No compatible Player Factory found for sources:",b),f=null)}else f=null;f?(e=f.Pb.create(),d({player:e,sourceIndex:f.sourceIndex})):
219
- (d=new _.E(_.r,{detail:new _.H(_.F,7,7003)}),a.trigger(d),e(d))})};
220
- _.sp=function(a,b,c){return _.x(function*(){if(a.K)throw new _.H(_.F,7,7E3,"Player is already destroyed.");if(!a.h)throw new _.H(_.F,7,7E3,"No surface associated with this player!");_.Hm(Ze);yield a.release();var d=c||_.bo(b);if(!b||0===d.length)throw new _.H(_.F,7,7003,nb);a.X=d;a.f=_.Wk(a.A,b,{source:d});a.L=!1;d=yield op(a,d,a.f);_.ip(a,d.player);a.a&&a.a.setSourceIndex(d.sourceIndex);qp(a);a.a&&a.a.setCdnErrorCallback(a.I);rp(a,a.f);if(a.f.pauseWhenInBackground)a.W.on(document,tg,()=>{document.hidden?
221
- (a.g.debug("Player is hidden: pausing..."),a.pause()):(a.g.debug("Player is visible: resuming..."),a.play())});fl(a);yield _.gp(a,"onContentWillLoad",a.f.source[d.sourceIndex]);_.Hm(Ye);_.Im("player.beforeLoad",Ze,Ye)})};_.tp=function(a){return _.x(function*(){a.h.getMedia()||a.h.getCastElement();a.trigger(new _.E(te));yield Promise.all([a.a.load(a.f),a.j.load()])})};
222
- _.vp=function(a){return _.x(function*(){_.Hm(Ve);jp(a,{configuration:a.getConfiguration(),da:a.pf(),drmInfo:a.getDrmInfo(),Gf:Object.keys(a.H),isLive:a.isLive()});up(a);gl();yield _.gp(a,"onContentLoaded");a.f.autoplay&&(yield a.play());_.Hm(Ue);_.Im("player.afterLoad",Ve,Ue)})};wp=function(a){return _.x(function*(){if(a.a){var b=a.a;b.Of?(a.trigger(new _.E(te)),yield b.Of(),yield _.vp(a)):a.g.warn(Ab)}else a.g.warn(xb)})};
223
- qp=function(a){a.a&&a.a.setDrmCustomDataModifier(b=>_.x(function*(){a.yc&&a.Yd&&(a.Yd=!1,yield a.yc(b))}))};rp=function(a,b){a.j=to(a,b).create(a)};
224
- xp=function(a){const b=_.Ah(a.f.preferredTextLanguage).filter(f=>f),c=a.f.preferForcedSubtitles,d=a.getTrackManager().ka().filter(f=>c?f.kind===_.Wd:f.kind!==_.Wd);if(0===d.length)c&&a.g.warn("Forced subtitles are configured to be preferred, but no forced subtitles are available.");else{if(c&&0===b.length){var e=a.getTrackManager().na();e&&e.language?(e=_.bi(e.language||""),b.push(e)):(e=a.getTrackManager().Ja())&&e.language&&(e=_.bi(e.language||""),b.push(e));0===b.length&&a.g.warn("Forced subtitles are configured to be preferred, but neither the preferred text language is set, nor the audio or video track language is available to determine which forced subtitles language to select.")}b.some(f=>
225
- {const g=_.bi(f);if(f=d.find(h=>{h=_.bi(h.language||"");return _.ci(h,g)}))return a.getTrackManager().La(f),!0;c&&a.g.warn("Forced subtitles are configured to be preferred, but no forced subtitles match the preferred languages: ",b);return!1})}};up=function(a){_.x(function*(){const b=[];if(a.f.remoteTextTracks)for(const c of a.f.remoteTextTracks)b.push(a.getTrackManager().addTextTrack(c));yield Promise.all(b);xp(a)})};yp=function(a){a.G.forEach(b=>b());a.G=[]};
226
- Bp=function(a,b){return _.x(function*(){try{_.Hm(cf);a.J=_.tb;a.T=!1;const c=b.slice(1).map(d=>({config:d,da:_.bo(d)}));yield _.sp(a,b[0]);c.forEach(d=>{zp(a,d.config,d.da)});a.trigger(new _.E(te));yield a.a.setupPlaylist(b);yield _.vp(a);c.forEach(d=>{Ap(a,d.config,d.da)});_.Hm(bf);_.Im("player.setupPlaylist",cf,bf)}catch(c){if(a.l)throw a.g.info(eb),new _.H(_.F,7,7E3);throw c;}})};
227
- Cp=function(a,b){const c=d=>{a.C=a.o.findIndex(e=>e.id===d.id)};a.addEventListener(_.Bf,c);a.G.push(()=>{a.removeEventListener(_.Bf,c)});if(b.endTime){const d=b.endTime,e=()=>{a.getPosition()>=d&&(a.removeEventListener(_.Xf,e),a.g.info("Playlist end time reached. Stopping playback."),a.trigger(new _.E(_.Af)),a.pause())};a.addEventListener(_.Xf,e);a.G.push(()=>{a.removeEventListener(_.Xf,e)})}};
228
- Dp=function(a,b){return _.x(function*(){try{_.Hm(Xe);const c=_.bo(b);zp(a,b,c);yield a.a.appendLoad(b);Ap(a,b,c);_.Hm(We);_.Im("player.appendLoad",Xe,We)}catch(c){if(a.l)throw a.g.info(eb),new _.H(_.F,7,7E3,{id:b.id});throw c;}})};
229
- zp=function(a,b,c){if(0===c.length)throw new _.H(_.F,7,7003,{message:nb,id:b.id});if(1<c.length)throw new _.H(_.F,7,7003,{message:"Multiple sources not supported!",id:b.id,source:c});if(2!==(a.a?a.a.canPlay(c[0],a.f):0))throw new _.H(_.F,7,7003,{message:"Source not supported by the current player!",id:b.id,source:c[0]});};Ap=function(a,b,c){jp(a,{configuration:b,da:c,drmInfo:a.getDrmInfo(),Gf:Object.keys(a.H),isLive:c[0].isLive})};
230
- Ep=function(a,b){const c=document.getElementById(a);if(!c)throw Error("Anchor element not found");c.classList.add(gd);return Array.from({length:3}).map(()=>{const d=document.createElement(_.w);d.classList.add(id);const e=document.createElement(_.Gd);e.classList.add(hd);e.appendChild(d);c.appendChild(e);return new Q(d,b)})};
231
- Fp=function(a,b,c){const d=b.getSurface().getMedia();b=b.getSurface().getUniqueCssClass();d&&(c?(a.g.info(`Show video element .${b}`),d.classList.add(jd)):(a.g.info(`Hide video element .${b}`),d.classList.remove(jd)),a.w&&a.w(d,c))};Ip=function(a,b){return _.x(function*(){const c=yield a.o.get();a.f=b;b.role=Gp;a.f.player=c;a.f.videoEl=c.getSurface().getMedia();Fp(a,c,!0);yield c.load(b.config);Hp(a,b);b.config.autoplay||(yield c.play())})};
232
- Mp=function(a){_.x(function*(){if(0===a.a)yield Jp(a);else if(a.a===a.h.length-1)yield Kp(a);else{const b=[a.a-1,a.a+1];a.g.info(`Preload items (indices: ${b})`);yield Promise.all(b.map(c=>Lp(a,c)))}})};
233
- Np=function(a,b){return _.x(function*(){if(b.player){if(b.state===nf){a.g.info(Vb);try{yield b.preloadPromise}catch(c){}}a.f=b;b.role=Gp;Fp(a,b.player,!0);b.state===mf?(_.Hm(jf),a.fa.preloadMedia?yield b.player.play():yield wp(b.player),_.Hm(gf),_.Im("playlist.next",jf,gf)):b.state===lf&&(yield b.player.load(b.config));Hp(a,b);b.config.autoplay||(yield b.player.play())}})};
234
- Qp=function(a,b){return _.x(function*(){a.g.info(`Stop current playback (index: ${b.index})`);b.player.pause();Fp(a,b.player,!1);yield Op(a,b);b.player=null;b.videoEl=null;b.role=Pp})};Sp=function(a){return Promise.all(Array.from(a.l.keys()).map(b=>Rp(a,b)))};Tp=function(a){return _.x(function*(){yield a.o.destroy();const b=document.getElementById(a.fa.anchorId);b&&(b.classList.remove(gd),b.innerHTML="")})};
235
- Rp=function(a,b){return _.x(function*(){const c=a.l.get(b);c&&(a.g.info(`Stop preloading item (index: ${b})`),c.player&&(yield Op(a,c)),a.l.delete(b))})};Op=function(a,b){return _.x(function*(){b.disposers.forEach(c=>c());b.disposers=[];b.player&&(yield a.o.release(b.player))})};Hp=function(a,b){if(a.fa.autoplayNext){const c=()=>{a.g.info("Automatically transition to next item");a.Ff()};b.player.on(_.Vd,c);const d=b.player;b.disposers.push(()=>{d.off(_.Vd,c)})}};
236
- Lp=function(a,b){return _.x(function*(){const c=yield a.o.get(),d=a.h[b];d.player=c;d.videoEl=c.getSurface().getMedia();d.role=Pp;d.state=nf;a.trigger(new _.E(cg));try{a.l.set(b,d),a.fa.preloadMedia?(d.config.autoplay&&(a.g.warn(la+`Force disabling autoplay (index: ${b})`),d.config.autoplay=!1),d.preloadPromise=c.load(d.config)):d.preloadPromise=c.preload(d.config),yield d.preloadPromise,d.state=mf,a.trigger(new _.E(cg))}catch(e){7001===e.code?(a.g.info(`Preload aborted (index: ${b})`),d.state=kf):
237
- (a.g.warn(`Preload failed (index: ${b})`,e),a.trigger(new _.E(_.r,{detail:e})),d.state=lf),a.trigger(new _.E(cg))}})};Jp=function(a){return _.x(function*(){const b=a.a+1;a.g.info(`Preload following item (index: ${b})`);yield Lp(a,b)})};Kp=function(a){return _.x(function*(){const b=a.a-1;a.g.info(`Preload preceding item (index: ${b})`);yield Lp(a,b)})};
238
- _.Vp=function(a){if(Up.has(a))return Up.get(a);if(window.ManagedMediaSource){var b=ManagedMediaSource.isTypeSupported(a);Up.set(a,b);return b}return window.MediaSource?(b=MediaSource.isTypeSupported(a),Up.set(a,b),b):!1};Wp=function(a,b){b=b.replace(/mp2t/i,"mp4");a===_.p&&(b=b.replace(_.w,_.p));if(a=/avc1\.(66|77|100)\.(\d+)/.exec(b)){let d="avc1.";var c=a[1];d="66"===c?d+"4200":"77"===c?d+"4d00":d+"6400";c=Number(a[2]);d+=(c>>4).toString(16);d+=(c&15).toString(16);b=b.replace(a[0],d)}return b};
239
- Xp=function(a,b,c){a.classList.add(gd);return Array.from({length:b}).map(()=>{const d=document.createElement(_.w);d.classList.add(id);const e=document.createElement(_.Gd);e.classList.add(hd);e.appendChild(d);a.appendChild(e);return new Q(d,c)})};
240
- Yp=function(a,b,c){if(!a.w){var d=b.getSurface().getMedia();b=b.getSurface().getUniqueCssClass();d&&(c?(a.g.info(`Show video element .${b}`),d.classList.add(jd),d.classList.remove("clpp-hide")):(a.g.info(`Hide video element .${b}`),d.classList.remove(jd),d.classList.add("clpp-hide")),a.o&&a.o(d,c))}};Zp=function(a){return _.x(function*(){const b=a.a;b&&("loaded"!==b.state&&(yield b.ed),yield b.player.play(),b.state=_.df,b.mc&&b.mc())})};$p=function(a,b){a.w=b;const c=a.a&&a.a.player;c&&Yp(a,c,!b)};
241
- bq=function(a,b){return _.x(function*(){if(b.player){if(b.state===nf){a.g.info(Vb);try{yield b.preloadPromise}catch(c){}}a.a=b;b.role=aq;Yp(a,b.player,!0);b.state="loading";b.state===mf?yield b.player.play():b.state===lf&&(yield b.player.load(b.config));b.config.autoplay||(yield b.player.play());b.state=_.df}})};dq=function(a,b){return _.x(function*(){yield cq(a,b);b.config.autoplay||(yield b.player.play());b.state=_.df})};
242
- eq=function(a,b){const c=b.transition;if(c){if(c.Wa){const d=c.Wa,e=()=>{a.g.info(`Transition onEnded to (ID: ${d})`);a.play(d)};b.player.on(_.Vd,e);b.disposers.push(()=>{b.player.off(_.Vd,e)})}if(c.yf){const d=e=>{const f=c.yf.find(g=>g.cueId===e.detail.id);f&&(a.g.info(`Transition onCue to (ID: ${f.itemId})`),a.play(f.itemId))};b.player.on(_.wh,d);b.disposers.push(()=>{b.player.off(_.wh,d)})}if(c.Df){const d=c.Df,e=()=>{b.player.getPosition()>=d.position&&(a.g.info(`Transition onPosition to (ID: ${d.itemId})`),
243
- a.play(d.itemId))};b.player.on(_.Xf,e);b.disposers.push(()=>{b.player.off(_.Xf,e)})}}};gq=function(a,b){return _.x(function*(){a.g.info(`Stop current playback (ID: ${b.id})`);b.disposers.forEach(d=>d());b.disposers=[];const c=b.player;b.player=null;b.videoEl=null;b.role=fq;c.pause();yield a.l.release(c);Yp(a,c,!1)})};iq=function(a){return Promise.all(Array.from(a.f.keys()).map(b=>hq(a,b)))};
244
- kq=function(a,b){_.x(function*(){if(0!==b.length){a.g.info(`Preload items (IDs: ${b})`);var c=a.j.filter(d=>b.includes(d.id))||[];yield Promise.all(c.map(d=>jq(a,d)))}})};cq=function(a,b){return _.x(function*(){const c=yield a.l.get();a.a=b;b.role=aq;a.a.player=c;a.a.videoEl=c.getSurface().getMedia();Yp(a,c,!0);b.primary&&a.trigger(new _.E(pf,{detail:{player:c}}));b.state="loading";b.ed=yield c.load(b.config);b.state="loaded"})};
245
- lq=function(a){return _.x(function*(){yield a.l.destroy();const b=a.fa.anchorEl;b&&(b.classList.remove(gd),b.innerHTML="")})};mq=function(a){a.a&&(a.a.disposers.forEach(b=>b()),a.a.disposers=[],eq(a,a.a),iq(a),kq(a,a.a.next))};hq=function(a,b){return _.x(function*(){const c=a.f.get(b);c&&(a.g.info(`Stop preloading item (ID: ${b})`),c.player&&(yield a.l.release(c.player)),a.f.delete(b))})};
246
- jq=function(a,b){return _.x(function*(){const c=b.id,d=yield a.l.get();b.player=d;b.videoEl=d.getSurface().getMedia();b.role=fq;b.state=nf;a.trigger(new _.E(cg));try{a.f.set(c,b),b.config.autoplay&&(a.g.warn(la+`Force disabling autoplay (ID: ${c})`),b.config.autoplay=!1),b.primary&&a.trigger(new _.E(pf,{detail:{player:d}})),b.preloadPromise=d.load(b.config),yield b.preloadPromise,b.state=mf,a.trigger(new _.E(cg))}catch(e){7001===e.code?(a.g.info(`Preload aborted (ID: ${c})`),b.state=kf):(a.g.warn(`Preload failed (ID: ${c})`,
247
- e),a.trigger(new _.E(_.r,{detail:e})),b.state=lf),a.trigger(new _.E(cg))}})};nq=function(a){return a&&a.ASSETS&&Array.isArray(a.ASSETS)?a.ASSETS.every(b=>typeof b.URI===_.Qf&&typeof b.DURATION===_.t):!1};oq=function(a){a.f.forEach(b=>b());a.f=[]};
248
- Aq=function(a,b){const c=()=>_.x(function*(){var e=b.getPosition(),f=pq(a,e);f&&(a.g.info(`Interstitial ${f.cueId} coming up `+`at ${f.startTime} s`),(yield qq(a,f))&&rq(a,f,b));if((f=sq(a))&&f.state===tq&&b.getDuration()-e<a.fa.resolutionOffsetSec&&(yield qq(a,f)))if(f.Ca&&0!==f.Ca.length){if(e=a.Y.getCurrentItem()){var g=uq(a,f,vq);a.Y.Jc(g);var h=g[0].id;e.next=[h];e.transition={Wa:h};mq(a.Y);f.state=wq;a.g.info(`Postroll interstitial ${f.cueId} scheduled`);a.trigger(new _.E(xq,{detail:{id:f.cueId,
249
- startTime:f.startTime,endTime:f.endTime,resumePosition:f.resumePosition,itemCount:g.length,playoutLimit:f.playoutLimit}}))}}else a.g.warn("Postroll interstitial has no assets, ignoring.")});b.addEventListener(_.Xf,c);a.f.push(()=>{b.removeEventListener(_.Xf,c)});const d=()=>{a.trigger(new _.E(yq));sq(a)||a.trigger(new _.E(zq))};b.on(_.Vd,d);a.f.push(()=>{b.off(_.Vd,d)})};
250
- Fq=function(a,b,c){return _.x(function*(){if(b.source){yield a.unload();var d=_.Qg(b);if(a.fa.yospace.enabled){var e=_.bo(b);1!==e.length&&a.g.warn("Multiple sources found this is currently not supported, only the first one will be used.");e=yield Bq(a.h,e[0].url);d.source={url:e,type:_.Ok}}a.Y.Jc([{id:qf,primary:!0,config:d,next:[]}]);yield a.Y.load(qf);(d=a.Y.Ab())&&d.wd()?(d=d.wd(),a.fa.mockCues&&(e=a.fa.mockCues,d.clear(),e===Cq?d.f({id:"cue-1",startTime:0,endTime:0,value:"",schemeIdUri:_.wd,
251
- eventElement:null,type:_.rh,ta:{"X-ASSET-LIST":ce,CUE:"PRE"}}):e===Dq?(d.f({id:"cue-1",startTime:10,endTime:33,value:"",schemeIdUri:_.wd,eventElement:null,type:_.rh,ta:{"X-ASSET-LIST":ce}}),d.f({id:"cue-2",startTime:160,endTime:220,value:"",schemeIdUri:_.wd,eventElement:null,type:_.rh,ta:{"X-ASSET-LIST":ce}})):e===vq&&d.f({id:"cue-1",startTime:0,endTime:0,value:"",schemeIdUri:_.wd,eventElement:null,type:_.rh,ta:{"X-ASSET-LIST":ce,CUE:_.ub}})),d=Array.from(d.cues()),Eq(a,d,c)||($p(a.Y,!1),c||(yield Zp(a.Y)))):
252
- a.g.error("Failed to get cue timeline after load")}else a.g.error("Config must be of type cl.api.PlayerConfiguration")})};
253
- Eq=function(a,b,c){b=b.filter(h=>h.schemeIdUri===_.wd&&h.ta);a.g.info("Interstitial cues found",b);if(!Gq(a,b))return!1;const d=[],e=[],f=[],g=[];b.forEach(h=>{const k=h.ta.CUE||[];k.includes(_.ub)?e.push(h):k.includes("PRE")?d.push(h):h.startTime<a.fa.prerollMarginSec?d.push(h):h.startTime<a.fa.resolutionOffsetSec?g.push(h):f.push(h)});1<d.length?a.g.warn("Multiple preroll interstitials not supported. Will display only the 1st one."):d[0]&&Hq(a,d[0],c);g.forEach(h=>Iq(a,h));f.forEach(h=>Jq(a,h,Dq));
254
- 1<e.length?a.g.warn("Multiple postroll interstitials not supported. Will display only the 1st one."):e[0]&&Jq(a,e[0],vq);a.trigger(new _.E(Kq,{detail:a.Rc()}));return 0<d.length};
255
- Gq=function(a,b){const c=b.sort((g,h)=>g.startTime-h.startTime),d=a.fa.resolutionOffsetSec,e=[];for(let g=0;g<c.length-1;g++){const h=c[g],k=c[g+1];k&&k.startTime-h.endTime<d&&e.push(`Interstitials ${h.id} and ${k.id} `+`are too close to each other (less than ${d} s).`);k&&k.startTime<=h.endTime&&e.push(`Interstitials ${h.id} and ${k.id} `+"overlap.")}const f=[];b.forEach(g=>{const h=g.ta[_.$b],k=g.ta[_.ac];g.ta[_.Zb]||h?null!=k&&1>k&&a.g.warn(`Interstitial cue ${g.id} is invalid `+"X-PLAYOUT-LIMIT is less than 1 s.",
256
- g):f.push(`Interstitial cue ${g.id} is invalid `+"it contains neither X-ASSET-LIST nor X-ASSET-URI.")});0<f.length?a.g.error("Invalid interstitials, all interstitials will "+`be skipped. ${f.join(" ")}`):0<e.length&&a.g.warn("Unsupported format of interstitials, playback may not "+`behave correctly. ${e.join(" ")}`);return 0===f.length};
257
- Hq=function(a,b,c){_.x(function*(){const d=Jq(a,b,Cq),e=yield qq(a,d),f=d.Ca?d.Ca.length:0;e&&0<f?Lq(a,d,c):(e?a.g.warn("Preroll interstitial has no assets, skipping"):a.g.error("Preroll interstitial failed, skipping"),$p(a.Y,!1),c||(yield Zp(a.Y)))})};
258
- Iq=function(a,b){return _.x(function*(){const c=Jq(a,b,Dq);a.g.info(`Interstitial ${c.cueId} coming up `+`at ${c.startTime} s`);if(yield qq(a,c)){const e=a.Y.getCurrentItem();if(!e)a.g.error("Cannot schedule interstitial "+`${c.cueId}, no primary content not found in `+"playlist");else if(e.player){var d=e.player;e.state===_.df?rq(a,c,d):e.mc=()=>{rq(a,c,d)}}}})};
259
- Jq=function(a,b,c){{const d=b.ta[_.bc];b={cueId:b.id,startTime:b.startTime,endTime:b.endTime,state:tq,Re:b.ta[_.Zb],Se:b.ta[_.$b],Ca:null,resumePosition:null==d?b.endTime:b.startTime+d,playoutLimit:b.ta[_.ac],Md:c}}a.a.push(b);return b};
260
- qq=function(a,b){return _.x(function*(){b.state=Mq;const c={id:b.cueId,startTime:b.startTime,endTime:b.endTime,resumePosition:b.resumePosition,itemCount:-1,playoutLimit:b.playoutLimit};a.trigger(new _.E(Nq,{detail:c}));if(b.Re)try{a.g.info(`Load X-ASSET-LIST for ${b.cueId}`),a.trigger(new _.E(Oq,{detail:c})),b.Ca=yield Pq(a,b.Re),b.state=wq,c.itemCount=b.Ca.length}catch(d){a.g.error("Failed to load X-ASSET-LIST",d),b.state=Qq}finally{a.trigger(new _.E(Rq,{detail:c}))}else b.Se?(b.Ca=[{URI:b.Se,DURATION:b.endTime-
261
- b.startTime}],b.state=wq):b.state=Qq;return b.state===wq})};Lq=function(a,b,c){_.x(function*(){const d=a.Y.getCurrentItem();if(d){var e=uq(a,b,Cq);a.Y.Jc(e);Sq(a,d,b,!0);mq(a.Y);b.state=wq;c?yield a.Y.load(e[0].id):yield a.Y.play(e[0].id);$p(a.Y,!1)}})};
262
- rq=function(a,b,c){if(b.Ca)if(0===b.Ca.length){const g=()=>{c.seek(b.resumePosition)};c.on(_.wh,g);a.f.push(()=>{c.off(_.wh,g)});a.g.info(`Interstitial ${b.cueId} scheduled to `+"be skipped")}else{var d=a.Y.getCurrentItem();if(d){var e=uq(a,b,Dq);a.Y.Jc(e);var f=e[0].id;Sq(a,d,b,!1);d.next=[f];d.transition={yf:[{cueId:b.cueId,itemId:f}]};mq(a.Y);b.state=wq;a.g.info(`Interstitial ${b.cueId} scheduled for `+`${b.startTime} s`);a.trigger(new _.E(xq,{detail:{id:b.cueId,startTime:b.startTime,endTime:b.endTime,
263
- resumePosition:b.resumePosition,itemCount:e.length,playoutLimit:b.playoutLimit}}))}}};pq=function(a,b){return a.a.find(c=>{const d=c.startTime-b;return c.Md===Dq&&c.state===tq&&0<d&&d<=a.fa.resolutionOffsetSec})||null};sq=function(a){return a.a.find(b=>b.Md===vq)||null};Pq=function(a,b){return _.x(function*(){var c=a.Y.Ab();if(!c)throw Error("No player found");c=c.getNetworkEngine();const d=_.Si(b);c=yield aj(c,d);if(!nq(c))throw new _.Jh("Invalid X-ASSET-LIST list response");return Promise.resolve(c.ASSETS)})};
264
- uq=function(a,b,c){let d=0,e=b.Ca.map((f,g)=>{g=`${b.cueId}-${g}`;d+=f.DURATION;return{id:g,config:{source:{url:f.URI,type:_.Ok}},duration:f.DURATION,bf:d,Pg:b.cueId,next:[]}});e.forEach((f,g)=>{const h=g===e.length-1;h&&c===vq||(h?(f.next=[qf],f.transition={Wa:qf}):(g=h?qf:`${f.Pg}-${g+1}`,f.next=[g],f.transition={Wa:g}))});a.fa.interstitialAssetConverter&&(e=e.map(f=>a.fa.interstitialAssetConverter(f)));e.forEach((f,g)=>{f.mc=()=>{a.g.info(`Playing interstitial asset ${f.id}`,f);a.trigger(new _.E(Tq,
265
- {detail:{id:f.id,podId:b.cueId,uri:f.config.source.url,duration:f.duration,podOrder:g+1,podCount:b.Ca.length}}))}});if(null!=b.playoutLimit){const f=b.playoutLimit;a.g.info(`Playout limit for ${b.cueId} is `+`${f} s`);e=e.filter(k=>k.bf-k.duration<=f);const g=e[e.length-1],h=Math.abs(g.bf-f);1>h?g.transition.Wa=qf:(g.transition.Wa=void 0,g.transition.Df={position:g.duration-h,itemId:qf});g.next=[qf]}e[0].mc=()=>{a.g.info(`Playing interstitial ${c} ${b.cueId} with `+`${b.Ca.length} assets and will resume primary `+
266
- `content at ${b.resumePosition} s.`,e);a.g.info(`Playing interstitial asset ${e[0].id}`,e[0]);a.trigger(new _.E(Uq,{detail:{id:b.cueId,startTime:b.startTime,endTime:b.endTime,resumePosition:b.resumePosition,itemCount:e.length,playoutLimit:b.playoutLimit}}));a.trigger(new _.E(Tq,{detail:{id:e[0].id,podId:b.cueId,uri:b.Ca[0].URI,duration:b.Ca[0].DURATION,podOrder:1,podCount:b.Ca.length}}))};e[e.length-1].Wa=()=>{a.trigger(new _.E(Vq,{detail:{id:b.cueId}}));b.state=Wq;a.Y.removeItems(e.map(f=>f.id));
267
- c===vq&&a.trigger(new _.E(zq))};return e};Sq=function(a,b,c,d){b.mc=()=>{a.g.info("Resuming primary content at "+`${b.config.startTime} s.`);b.next=[];d&&a.trigger(new _.E(Xq))};b.config.startTime=c.resumePosition};
268
- Bq=function(a,b){var c=Yq;return _.x(function*(){a.a=null;if(typeof YospaceAdManagement!==_.Fe)throw new _.H(_.F,7,7003,"Yospace SDK not found.");if(typeof b!==_.Qf)throw new _.H(_.F,7,7003,"Yospace URL must be a string.");a:switch(c){case Yq:var d=YospaceAdManagement.SessionVOD.create(b);break a;case Zq:d=YospaceAdManagement.SessionLive.create(b);break a;case $q:d=YospaceAdManagement.SessionDVRLive.create(b);break a;default:throw new _.H(_.F,7,7003,`Yospace stream type unknown ${c}.`);}d=yield d;
269
- if(d.getSessionState()!==YospaceAdManagement.SessionState.INITIALISED)throw new _.H(_.F,7,7003,"Yospace session failed to initialize");a.a=d;return d.getPlaybackUrl()})};ar=function(a,b){a.size=void 0===b?0:1;a.g.debug("Setting key status to",b);a.a=b};
270
- br=function(a,b){a.f=b;_.ph(a.a);if(!b)return Promise.resolve();a.a.on(b,Td,c=>{_.ih("AppleEmeManager.cancelNativeMediaEncryptedEvent_",c);"MediaEncryptedEvent"in window&&c instanceof MediaEncryptedEvent&&(a.g.info("Cancel native MediaEncryptedEvent when using Apple-prefixed EME"),c.stopImmediatePropagation())});a.a.on(b,Bg,c=>{{a.g.debug("Handle webkitNeedKey event");c=_.J(c.initData);if(_.li(c).getUint32(0,!0)+4!==c.byteLength)throw new RangeError("Malformed FairPlay init data");c=qi(c.subarray(4),
271
- !0);c=_.si(c);const d=new Event(Td);d.initDataType="skd";d.initData=mi(c);a.f.dispatchEvent(d)}});Ln(b,HTMLMediaElement.HAVE_METADATA,a.a,()=>b.webkitSetMediaKeys(a.h));return Promise.resolve()};cr=function(a,b){ar(a.keyStatuses,b);b=new _.E(ge);a.dispatchEvent(b)};
272
- fr=function(a,b){a.a=b;_.ph(a.f);b&&(a.f.on(b,a.h+"needkey",c=>{{const d=new Event(Td);d.initDataType=_.$c;d.initData=mi(c.initData);a.a.dispatchEvent(d)}}),a.f.on(b,a.h+"keymessage",c=>{{const e=dr(a,c.sessionId);if(e){var d=void 0===e.keyStatuses.getStatus();c=new _.E(_.xe,{messageType:d?je:ie,message:c.message});d=e;_.ih("WebkitEmeManager.MediaKeySession.generated");d.f&&(d.f.resolve(),d.f=null);e.dispatchEvent(c)}else _.jh("Session not found",c.sessionId)}}),a.f.on(b,a.h+"keyadded",c=>{(c=dr(a,
273
- c.sessionId))&&c.ready()}),a.f.on(b,a.h+"keyerror",c=>{var d=dr(a,c.sessionId);if(d){{var e=Error("EME v0.1b key error");const f=c.errorCode;f.systemCode=c.systemCode;e.errorCode=f;!c.sessionId&&d.f?(45===c.systemCode&&(e.message="Unsupported session type."),d.f.reject(e),d.f=null):c.sessionId&&d.a?(d.a.reject(e),d.a=null):(e=c.systemCode,c.errorCode.code===MediaKeyError.MEDIA_KEYERR_OUTPUT?er(d,_.Oe):1===e?er(d,"expired"):er(d,_.ee))}}}))};
274
- dr=function(a,b){let c=a.l.get(b);return c?c:(c=a.j.shift())?(c.sessionId=b,a.l.set(b,c),c):null};er=function(a,b){ar(a.keyStatuses,b);b=new _.E(ge);a.dispatchEvent(b)};gr=function(a,b){return a.w?a.w+b.charAt(0).toUpperCase()+b.slice(1):b};
275
- hr=function(a,b,c){if(a.o)return Promise.reject(Error("The session is already initialized."));a.o=!0;let d;try{if(a.l===_.Re)if(c)d=_.J(_.si("LOAD_SESSION|"+c));else{const f=_.si("PERSISTENT|"),g=new Uint8Array(f.byteLength+b.byteLength);g.set(f,0);g.set(_.J(b),f.byteLength);d=g}else d=_.J(b)}catch(f){return Promise.reject(f)}a.f=new _.dn;const e=gr(a,"generateKeyRequest");try{a.j[e](a.h,d)}catch(f){if(f.name!==bb)return a.f=null,Promise.reject(f);(new _.Tj(()=>{try{a.j[e](a.h,d)}catch(g){a.f.reject(g),
276
- a.f=null}})).ha(.01)}return a.f};ir=function(a,b,c){if(a.a)a.a.then(()=>ir(a,b,c)).catch(()=>ir(a,b,c));else{a.a=b;if(a.h===xg){var d=_.oi(c);var e=JSON.parse(d);"oct"!==e.keys[0].kty&&(a.a.reject(Error("Response is not a valid JSON Web Key Set.")),a.a=null);d=_.Ei(e.keys[0].k);e=_.Ei(e.keys[0].kid)}else d=_.J(c),e=null;var f=gr(a,"addKey");try{a.j[f](a.h,d,e,a.sessionId)}catch(g){a.a.reject(g),a.a=null}}};
277
- jr=function(a){const b=a.type.replace(/^(webkit|moz|MS)/,"").toLowerCase();let c;typeof Event===_.Yd?c=new Event(b,a):(c=document.createEvent("Event"),c.initEvent(b,a.bubbles,a.cancelable));a.target.dispatchEvent(c)};kr=function(a){a=a.target;if(a.webkitPresentationMode===Se){document.pictureInPictureElement=a;var b=new Event("enterpictureinpicture");a.dispatchEvent(b)}else document.pictureInPictureElement===a&&(document.pictureInPictureElement=null),b=new Event("leavepictureinpicture"),a.dispatchEvent(b)};
278
- lr=function(){return this.webkitSupportsPresentationMode(Se)?(this.webkitSetPresentationMode(Se),document.pictureInPictureElement=this,Promise.resolve()):Promise.reject(Error("PiP not allowed by video element"))};mr=function(){const a=document.pictureInPictureElement;return a?(a.webkitSetPresentationMode("inline"),document.pictureInPictureElement=null,Promise.resolve()):Promise.reject(Error("No picture in picture element found"))};
279
- nr=function(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}};or=function(a,b,c){return new window.TextTrackCue(a,b,c)};pr=function(a,b,c){return new window.TextTrackCue(a+"-"+b+"-"+c,a,b,c)};rr=function(a,b,c){if("input"===a)switch(this.type){case "range":a=cd}qr.call(this,a,b,c)};sr=function(){return window.performance&&window.performance.now?window.performance.now():Date.now()};
280
- tr=function(a){return sr()-a.a};vr=function(a){const b=new ur;b.a=a.a;return b};_.wr=function(a){const b=[];for(const c of a)for(const d of c.variants)b.push(d);return b};_.yr=function(a,b,c,d){return _.x(function*(){try{return new (yield xr(a,b,c,d))}catch(e){throw e.a(_.F),e;}})};
281
- xr=function(a,b,c,d){return _.x(function*(){if(d){var e=_.zr[d.toLowerCase()];if(e)return e;_.C("Could not determine manifest type using MIME type ",d)}if(e=_.Ar(a)){const f=_.Br[e];if(f)return f;_.C("Could not determine manifest type for extension ",e)}else _.C("Could not find extension for ",a);if(!d&&(d=yield Cr(a,b,c))){if(e=_.zr[d])return e;_.C("Could not determine manifest type using MIME type",d)}throw new _.H(_.F,4,4E3,{url:a});})};
282
- _.Ar=function(a){a=(new _.Mh(a)).Da.split("/").pop().split(".");return 1===a.length?"":a.pop().toLowerCase()};Cr=function(a,b,c){return _.x(function*(){var d=_.Si(a);Qi(d,c);d.type=1;d.method="HEAD";return(d=(yield b.fetch(d).R).headers["content-type"])?d.toLowerCase():""})};Dr=function(a,b){var c=a.f+b.byteLength;if(a.a.byteLength<c){let d=a.a.byteLength;for(;d<c;)d*=2;c=new Uint8Array(d);c.set(a.a);a.a=c}a.a.set(b,a.f);a.f+=b.byteLength};
283
- Er=function(a,b,c){return b.read().then(({done:d,value:e})=>{null!=e&&(Dr(a,e),Vi(c,e.byteLength,tr(a.h)),a.h.a=sr());return d?(d=a.a.buffer,a.a.byteLength!==a.f&&(d=d.slice(0,a.f)),Promise.resolve(d)):Promise.resolve().then(()=>Er(a,b,c))})};
284
- Gr=function(a){const b=a.uris[a.uriIndex],c=new Fr,d=new ur,e=vr(d);let f=0,g;const h=new _.dn;c.open(a.method,b,!0);c.responseType="arraybuffer";c.timeout=a.timeout;c.withCredentials=a.allowCrossSiteCredentials;let k=!1,l=!1;c.onreadystatechange=function(m){m=m.target;m.readyState>=XMLHttpRequest.LOADING&&0===f&&(g=tr(e));m.readyState>=XMLHttpRequest.HEADERS_RECEIVED&&!k&&(m=m.getResponseHeader(ta),Ui(a,m),k=!0)};c.onload=function(m){m=m.target;var n=(m.getAllResponseHeaders()||"").trim().split("\r\n");
285
- const q={};for(const u of n)n=u.split(": "),q[n[0].toLowerCase()]=n.slice(1).join(": ");try{const u=tr(e);l||Vi(a,m.response?m.response.length:0,u);const v=_.Ti(q,m.response,m.status,b,m.responseURL,a,u,g);a.rateLimitBps?Wi(a.rateLimitBps,tr(e),a.bytesLoaded).then(()=>{h.resolve(v)}):h.resolve(v)}catch(u){h.reject(u)}};c.onerror=function(m){m=m.target;if(0>=m.status)h.reject(new _.H(1,1,1002,{url:b,request:a,status:m.status}));else{var n=m.getAllResponseHeaders();const u={};if(n){n=n.trim().split("\r\n");
286
- for(var q of n)n=q.split(": "),u[n[0].toLowerCase()]=n.slice(1).join(": ")}q=_.Ti(u,m.response,m.status,b,m.responseURL,a,tr(e),g);h.resolve(q)}};c.ontimeout=function(){h.reject(new _.H(1,1,1003,{url:b,request:a}))};c.onprogress=function(m){const n=tr(d);d.a=sr();if(100<n||m.lengthComputable&&m.loaded===m.total)Vi(a,m.loaded-f,n),f=m.loaded,l=!0};for(const m in a.headers)c.setRequestHeader(m.toLowerCase(),a.headers[m]);c.send(a.body);return{R:h,request:a,abort:()=>{c.abort();h.reject(new _.H(1,1,
287
- 7001,{url:b,request:a}));return Promise.resolve()}}};Hr=function(a){let b=null;a.h!==a.f&&(b={start:a.h,end:a.f,length:a.f-a.h,data:new DataView(a.j.a.buffer,a.h,a.f-a.h),count:-1});return b};Ir=function(a,b){{var c=a.j;const d=c.f+b.byteLength;if(d>c.a.byteLength){const e=c.a;c.a=new Uint8Array(Math.max(Math.ceil(c.a.buffer.byteLength*c.h),d));c.a.set(e)}c.a.set(b,c.f);c.f+=b.byteLength}a.a=a.h;a.f=a.j.f;a.l=new DataView(a.j.a.buffer,0,a.j.f)};
288
- Kr=function(a){if(0<=a.o&&a.f<a.o)return null;let b=Jr(a);for(;null!==b;){if(b.name===_.ve){const c={start:a.h,end:b.end,length:b.end-a.h,data:new DataView(a.j.a.buffer,a.h,b.end-a.h),count:1};a.h=b.end;return c}b=Jr(a)}return null};
289
- Lr=function(a,b,c,d){return b.read().then(e=>{var {done:f,value:g}=e;d&&g&&(d(g.byteLength,tr(a.w)),a.w.a=sr());if(f)return e=Hr(a),(e=c(!0,e))?e.then(()=>a.j.a.buffer):Promise.resolve(a.j.a.buffer);let h=Promise.resolve();if(null!=g){Ir(a,g);var k=Kr(a);for(e=[];k;)e.push(k),k=Kr(a);if(!a.A)e.forEach(l=>{h=h.then(()=>c(!1,l))});else if(0<e.length){k=e[0];if(1<e.length){k=e[0];const l=e[e.length-1],m=l.end-k.start;k={start:k.start,end:l.end,length:m,data:new DataView(a.j.a.buffer,k.start,m),count:e.length}}(e=
290
- c(!1,k))&&(h=e)}}return h.then(()=>Lr(a,b,c,d))})};
291
- Jr=function(a){const b=a.a;if(a.a+4>=a.f)return a.a=a.f,null;var c=Mr(a);if(a.a+4>=a.f)return a.a=a.f,null;var d=Mr(a);d=String.fromCharCode(d>>24&255,d>>16&255,d>>8&255,d&255);switch(c){case 0:c=a.f-b;break;case 1:if(a.a+8>=a.f)return a.a=a.f,null;{let e,f;try{f=a.l.getUint32(a.a,!1),e=a.l.getUint32(a.a+4,!1)}catch(g){throw new _.H(_.F,3,3E3);}if(2097151<f)throw new _.H(_.F,3,3E3);a.a+=8;c=f*Math.pow(2,32)+e}}c=b+c;a.o=c;return a.f>=c?(a.a=c,{name:d,start:b,end:c}):null};
292
- Mr=function(a){const b=a.l.getUint32(a.a,!1);a.a+=4;return b};
293
- Pr=function(a){a.h=a.B.then(e=>{a.j=e.request;e.request.uriIndex=e.request.currentAttempt%e.request.uris.length;if(0<e.request.currentAttempt){-1===a.f&&(a.f=Nr(e.request.baseDelay,1E3));const f=a.f*(1+(2*Math.random()-1)*Nr(e.request.fuzzFactor,.5));a.f*=Nr(e.request.backoffFactor,2);if(0<f)return(new Promise((g,h)=>{a.l=h;Or(a,()=>{g(e.plugin(e.request))},f)})).catch(g=>{if(!a.a)throw g;})}if(a.a)throw new _.H(1,1,7001,{url:e.request.uris[e.request.uriIndex],request:e.request});return e.plugin(e.request)});
294
- let b=0,c=0,d=0;return a.h.then(e=>{const f=e.request;f.currentAttempt+=1;b=f.currentAttempt;c=f.maxAttempts;d=f.uris.length;return e.R}).then(e=>{a.w.resolve(e)}).catch(e=>{if(e instanceof _.H){const f=b<d,g=7001!==e.code,h=b<c;if((1===e.severity||f)&&g&&h)return Pr(a);g&&e.a(_.F);a.w.reject(e)}else a.w.reject(e)})};Or=function(a,b,c){a.o=setTimeout(b,c)};Nr=function(a,b){return null===a||void 0===a?b:a};
295
- Qr=function(a){var b=a.split("\x3d");const c=b[0];b=b[1];if(!c)throw new _.Jh("Parsing CMSD, missing parameter or wrong format");if(c&&!b)return{key:c,value:!0};const d=b[0];if('"'===d&&'"'===b[b.length-1])return{key:c,value:b.replaceAll(/(^")|("$)/g,"")};if(/^[-0-9]/.test(d))return{key:c,value:parseInt(b,10)};if(/^[a-zA-Z*]/.test(d))return{key:c,value:b};throw new _.Jh(`Parsing CMSD, not recognized value type of ${a}`);};
296
- Tr=function(a){return b=>{if(a.a){a:{b=b.headers;for(const [d,e]of Object.entries(b))if("cmsd-dynamic"===d.toLowerCase()){b=e;break a}b=null}if(b){try{const d=new Map,e=b.split(";");for(b=0;b<e.length;b++){const {key:f,value:g}=Qr(e[b]);Object.values(Rr).includes(f)&&d.set(f,g)}var c=d}catch(d){Sr.error("CmsdManager parseCmsdDynamicHeader_ failed:",d),c=null}a.f=c}}}};
297
- Xr=function(a){var b=new Ur;for(const e in a.headers)b.append(e.toLowerCase(),a.headers[e]);const c=new Vr,d={Lc:!1,Mf:!1};b={R:Wr(a.uris[a.uriIndex],a,{body:a.body||void 0,headers:b,method:a.method,signal:c.signal,credentials:a.allowCrossSiteCredentials?"include":void 0},d),request:a,abort:()=>{d.Lc||(d.Lc=!0,c.abort());return Promise.resolve()}};if(a=a.timeout){const e=window.setTimeout(()=>{d.Mf=!0;c.abort()},a);b.R=b.R.finally(()=>{window.clearTimeout(e)})}return b};
298
- Wr=function(a,b,c,d){return _.x(function*(){let e,f,g;const h=new ur,k=vr(h);try{e=yield Yr(a,c);g=tr(h);const m=e.headers.get(ta);Ui(b,m);const n=m?parseInt(m,10):0;if(b.onFragment&&!b.disableFragmentSupport&&2===b.type){const q=e.body.getReader();f=yield Lr(new Zr(n,!b.disableMergedFragments),q,(u,v)=>{if(d.Lc)return null;v&&v.data&&(Vi(b,v.data.byteLength,tr(h)),h.a=sr());return b.onFragment&&v?b.rateLimitBps?Wi(b.rateLimitBps,tr(k),b.bytesLoaded).then(()=>b.onFragment(v)):b.onFragment(v):null},
299
- b.onProgress)}else{const q=e.body.getReader();f=yield Er(new $r(n),q,b);b.rateLimitBps&&(yield Wi(b.rateLimitBps,tr(k),f.byteLength))}}catch(m){if(d.Lc)throw new _.H(1,1,7001,{url:a,request:b});if(d.Mf)throw new _.H(1,1,1003,{url:a,request:b});_.jh("Error while fetching data:",m);throw new _.H(1,1,1002,{url:a,error:m,request:b,status:-1},m);}const l={};e.headers.forEach((m,n)=>{l[n.trim()]=m});if(d.Lc)throw new _.H(1,1,7001,{url:a,request:b});return _.Ti(l,f,e.status,a,e.url,b,tr(k),g)})};
300
- bs=function(a){try{const b=a.uris[a.uriIndex],c=_.as(b);return{R:Promise.resolve({uri:b,data:c.data,request:a,headers:{"content-type":c.contentType}}),request:a,abort:()=>Promise.resolve()}}catch(b){return{R:Promise.reject(b),request:a,abort:()=>Promise.resolve()}}};
301
- _.as=function(a){var b=a.split(":");if(2>b.length||"data"!==b[0])throw _.jh("Bad data URI, failed to parse scheme"),new _.H(_.F,1,1004,{uri:a});b=b.slice(1).join(":").split(",");if(2>b.length)throw _.jh("Bad data URI, failed to extract encoding and MIME type"),new _.H(_.F,1,1004,{uri:a});var c=b[0];a=window.decodeURIComponent(b.slice(1).join(","));b=c.split(";");c=b[0];let d=!1;1<b.length&&"base64"===b[b.length-1]&&(d=!0,b.pop());return{data:d?_.Ei(a).buffer:_.si(a).buffer,contentType:c}};
302
- _.gs=function(a,b){a=_.Nj(_.Oj(a),_.Pj(a));_.fs[a]=b};_.hs=function(a){a=_.Nj(_.Oj(a),_.Pj(a));return _.fs[a]||null};_.is=function(a){a=_.Nj(_.Oj(a),_.Pj(a));delete _.fs[a]};_.ns=function(a){if(!a.w)return null;const b=a.H;switch(a.w){case js:return`-2px -2px 0 ${b}, -1px -1px 0 ${b}`;case ks:return`2px 2px 0 ${b}, 1px 1px 0 ${b}`;case ls:return`-1px 0 ${b}, 0 1px ${b}, 1px 0 ${b}, `+`0 -1px ${b}`;case ms:return`2px 2px 3px ${b}, 2px 2px 4px ${b}, `+`2px 2px 5px ${b}`;default:return _.Ee}};
303
- Jg="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this;Kg=typeof Object.defineProperties==_.Yd?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};
304
- Lg("Promise",function(a){function b(g){this.f=0;this.l=void 0;this.a=[];var h=this.j();try{g(h.resolve,h.reject)}catch(k){h.reject(k)}}function c(){this.a=null}function d(g){return g instanceof b?g:new b(function(h){h(g)})}if(a)return a;c.prototype.f=function(g){if(null==this.a){this.a=[];var h=this;this.h(function(){h.l()})}this.a.push(g)};var e=Jg.setTimeout;c.prototype.h=function(g){e(g,0)};c.prototype.l=function(){for(;this.a&&this.a.length;){var g=this.a;this.a=[];for(var h=0;h<g.length;++h){var k=
305
- g[h];g[h]=null;try{k()}catch(l){this.j(l)}}}this.a=null};c.prototype.j=function(g){this.h(function(){throw g;})};b.prototype.j=function(){function g(l){return function(m){k||(k=!0,l.call(h,m))}}var h=this,k=!1;return{resolve:g(this.C),reject:g(this.h)}};b.prototype.C=function(g){if(g===this)this.h(new TypeError("A Promise cannot resolve to itself"));else if(g instanceof b)this.F(g);else{a:switch(typeof g){case _.Fe:var h=null!=g;break a;case _.Yd:h=!0;break a;default:h=!1}h?this.B(g):this.o(g)}};
306
- b.prototype.B=function(g){var h=void 0;try{h=g.then}catch(k){this.h(k);return}typeof h==_.Yd?this.G(h,g):this.o(g)};b.prototype.h=function(g){this.w(2,g)};b.prototype.o=function(g){this.w(1,g)};b.prototype.w=function(g,h){if(0!=this.f)throw Error("Cannot settle("+g+", "+h+"): Promise already settled in state"+this.f);this.f=g;this.l=h;this.A()};b.prototype.A=function(){if(null!=this.a){for(var g=0;g<this.a.length;++g)f.f(this.a[g]);this.a=null}};var f=new c;b.prototype.F=function(g){var h=this.j();
307
- g.od(h.resolve,h.reject)};b.prototype.G=function(g,h){var k=this.j();try{g.call(h,k.resolve,k.reject)}catch(l){k.reject(l)}};b.prototype.then=function(g,h){function k(q,u){return typeof q==_.Yd?function(v){try{l(q(v))}catch(y){m(y)}}:u}var l,m,n=new b(function(q,u){l=q;m=u});this.od(k(g,l),k(h,m));return n};b.prototype.catch=function(g){return this.then(void 0,g)};b.prototype.od=function(g,h){function k(){switch(l.f){case 1:g(l.l);break;case 2:h(l.l);break;default:throw Error("Unexpected state: "+
308
- l.f);}}var l=this;null==this.a?f.f(k):this.a.push(k)};b.resolve=d;b.reject=function(g){return new b(function(h,k){k(g)})};b.race=function(g){return new b(function(h,k){for(var l=Ig(g),m=l.next();!m.done;m=l.next())d(m.value).od(h,k)})};b.all=function(g){var h=Ig(g),k=h.next();return k.done?d([]):new b(function(l,m){function n(v){return function(y){q[v]=y;u--;0==u&&l(q)}}var q=[],u=0;do q.push(void 0),u++,d(k.value).od(n(q.length-1),m),k=h.next();while(!k.done)})};return b});var Ng=this||self;
309
- Ng.a=!0;_.z("clpp.utils.obj.cloneItem",_.Qg);_.z("clpp.utils.obj.merge",_.Pg);var eh={DEFAULT:-1,NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4};_.z("clpp.log.Level",eh);var ch=3,bh={},os=[];_.z("clpp.log.getLoggers",function(){return _.Qg(bh)});_.z("clpp.log.addInterceptor",function(a){a&&os.push(a)});_.z("clpp.log.removeInterceptor",function(a){a&&(a=os.indexOf(a),0<=a&&os.splice(a,1))});_.z("clpp.log.getTagLevel",dh);_.z("clpp.log.hasTagLevel",function(a){return void 0===a?!1:0<=bh[a]});_.z("clpp.log.setTagLevel",function(a,b){a&&(_.Wg(b)&&(b=fh(b)),bh[a]=b)});
310
- _.z("clpp.log.setLogLevel",function(a){-1===a&&(a=3);_.Wg(a)&&(a=fh(a));ch=a});_.z("clpp.log.getLogLevel",function(){return ch});
311
- _.R=class{constructor(a){(this.tag=a)&&void 0===bh[a]&&(bh[a]=-1)}log(a,b){if(window.console){if(1<arguments.length){var c=arguments[0];Array.prototype.shift.call(arguments)}else c=3;var d=dh(this.tag);if(0<=d){if(d<c)return}else if(ch<c)return;this.tag&&Array.prototype.unshift.call(arguments,"["+this.tag+"]");d=new Date;d.toISOString&&(d=d.toISOString().substring(11).replace("Z",""),Array.prototype.unshift.call(arguments,d));4===c?console.log.apply(console,arguments):3===c?console.info.apply(console,
312
- arguments):2===c?console.warn.apply(console,arguments):1===c?console.error.apply(console,arguments):console.log.apply(console,arguments);for(const e of os)e.call(e,c,arguments)}}info(a){Array.prototype.unshift.call(arguments,3);this.log.apply(this,arguments)}debug(a){Array.prototype.unshift.call(arguments,4);this.log.apply(this,arguments)}warn(a){Array.prototype.unshift.call(arguments,2);this.log.apply(this,arguments)}error(a){Array.prototype.unshift.call(arguments,1);this.log.apply(this,arguments)}mg(a){return a?
313
- this.tag?new _.R(this.tag+"."+a):new _.R(a):this}};_.z("clpp.log.Logger",_.R);_.R.prototype.createChild=_.R.prototype.mg;_.R.prototype.error=_.R.prototype.error;_.R.prototype.warn=_.R.prototype.warn;_.R.prototype.debug=_.R.prototype.debug;_.R.prototype.info=_.R.prototype.info;_.R.prototype.log=_.R.prototype.log;var gh=new _.R("clpp");_.z("clpp.log.info",_.hh);_.z("clpp.log.debug",_.ih);_.z("clpp.log.warn",_.C);_.z("clpp.log.error",_.jh);(function(){const a=console.assert;a?a.bind||(console.assert=function(){a.apply(console,arguments)}):console.assert=function(){}})();var pp;pp=class{constructor(a,b){this.Pb=a;this.sourceIndex=b}};_.lh=new _.R("clpp.players");_.kh={};_.ps=class{constructor(){this.a={}}push(a,b){a in this.a?this.a[a].push(b):this.a[a]=[b]}get(a){return(a=this.a[a])?a.slice():[]}remove(a,b){a=this.a[a];if(!a)return!1;let c=!1;for(let d=0;d<a.length;++d)a[d]===b&&(a.splice(d,1),--d,c=!0);return c}clear(){this.a={}}forEach(a){for(const b in this.a)a(b,this.a[b])}};var qs,rs;qs=class{constructor(a,b,c,d){this.f=a;this.uc=b;this.a=c;this.kh=!!d}Zb(a){try{this.uc.handleEvent?this.uc.handleEvent(a):this.uc.call(this.a,a)}catch(b){_.jh("clpp","Uncaught exception in event handler for event '"+this.f+"'",b,b?b.message:null,b?b.stack:null)}}};
314
- _.E=class{constructor(a,b){if(b)for(const c in b)this[c]=b[c];this.defaultPrevented=this.cancelable=this.bubbles=!1;this.timeStamp=window.performance&&window.performance.now?window.performance.now():Date.now();this.type=a;this.isTrusted=!1;this.target=this.currentTarget=null;this.f=this.a=!1}preventDefault(){this.cancelable&&(this.defaultPrevented=!0)}stopImmediatePropagation(){this.f=!0}stopPropagation(){}};
315
- rs=class{constructor(a){this.a=new _.ps;this.f=a}trigger(a){const b=this.a.get(a.type);if(b)for(let c=0;c<b.length&&(a.target=this.f,a.currentTarget=this.f,b[c].Zb(a),b[c].kh&&this.a.remove(a.type,b[c]),!a||!a.f);c++);}on(a,b,c){this.a.push(a,new qs(a,b,c||this.f));return b}one(a,b,c){this.a.push(a,new qs(a,b,c||this.f,!0));return b}off(a,b){const c=this.a.get(a);let d=!1;if(c)for(let e=0;e<c.length;e++)c[e].uc===b&&(d=this.a.remove(a,c[e])||d);return d}clear(){this.a.clear()}};var ss;_.ts=class{constructor(){this.a=new _.ps}release(){_.ph(this)}on(a,b,c,d=!1){a=new ss(a,b,c,d);this.a.push(b,a)}one(a,b,c){const d=e=>{this.off(a,b,d);return c(e)};this.on(a,b,d)}off(a,b,c){const d=this.a.get(b)||[];for(let e=0;e<d.length;++e){const f=d[e];f.target!==a||c!==f.a&&c||(oh(f),this.a.remove(b,f))}}};ss=class{constructor(a,b,c,d){this.target=a;this.type=b;this.a=c;this.f=d;this.target.addEventListener(b,c,d)}};var us=class{constructor(a){this.m=a;this.o=a.getConfiguration().streaming.addMissingTimelineCues||!1;this.j=null;this.f=new _.ts;this.a=this.l=null;this.h=[];this.g=new _.R("clpp.native.Metadata")}release(){this.f.release();this.h=[];this.a=null}destroy(){const a=this;return _.x(function*(){a.release();a.l=null;a.j=null})}getTimelineCues(){return this.h}};_.Bs=class{constructor(a,b,c,d){d=void 0===d?_.vs:d;this.startTime=a;this.endTime=b;this.payload=c;this.payloadType=d;this.positionAlign=this.position=null;this.size=100;this.textAlign=_.ws;this.writingMode=_.xs;this.lineInterpretation=_.ys;this.line=null;this.lineAlign=_.zs;this.direction=As;this.region=null;this.cssClassList=[];this.id=this.backgroundImage="";this.containerRows=null}zc(a){return this.payload===a.payload&&this.startTime===a.startTime&&this.endTime===a.endTime&&this.payloadType===
316
- a.payloadType}};_.z("clpp.text.Cue",_.Bs);_.Bs.positionAlign={LEFT:_.ke,RIGHT:_.me,CENTER:_.ad,AUTO:"auto"};_.vs="text";_.Bs.payloadType={TEXT:_.vs,VTT_XML:_.ug,TTML_XML:_.Zf};_.ws=_.ad;_.Cs={LEFT:_.he,RIGHT:_.zf,CENTER:_.ws,START:_.he,END:_.zf};_.Bs.textAlign=_.Cs;var As="ltr";_.Bs.direction={HORIZONTAL_LEFT_TO_RIGHT:As,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};_.xs="horizontal-tb";_.Bs.writingMode={HORIZONTAL_TOP_TO_BOTTOM:_.xs,VERTICAL_LEFT_TO_RIGHT:_.ig,VERTICAL_RIGHT_TO_LEFT:_.jg};_.ys=0;
317
- _.Bs.lineInterpretation={LINE_NUMBER:_.ys,PERCENTAGE:1};_.zs=_.Mf;_.Ds={CENTER:_.ad,START:_.zs,END:_.Ud};_.Bs.lineAlign=_.Ds;_.Gs=class{constructor(){this.id="";this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0;this.height=this.width=100;this.viewportAnchorUnits=this.widthUnits=this.heightUnits=_.Es;this.scroll=Fs;this.cssClassList=[];this.writingMode=this.displayAlign=null}};_.z("clpp.text.CueRegion",_.Gs);_.Es=1;_.Gs.units={PX:0,PERCENTAGE:_.Es,LINES:2};var Fs="";
318
- _.Gs.scrollMode={NONE:Fs,UP:"up"};_.Gs.displayAlign={BEFORE:"flex-end",CENTER:_.ad,AFTER:"flex-start"};_.Gs.writingMode={HORIZONTAL_TOP_TO_BOTTOM:_.td,VERTICAL_LEFT_TO_RIGHT:"row-reverse",VERTICAL_RIGHT_TO_LEFT:"row"};var Hs=class{constructor(a){this.m=a;this.l=a.getTextDisplayer();this.f=this.h=null;this.a=new _.ts;this.j=!1;this.g=new _.R("clpp.native.CueHandler")}destroy(){this.a.release();this.j=!1;this.l=this.a=this.h=this.f=null;return Promise.resolve()}start(a){this.j?this.g.warn("Already started. Ignoring request..."):(this.j=!0,this.h=a,this.f=this.h.textTracks,this.a.on(this.f,_.tc,b=>Fh(this,b)),this.a.on(this.f,cd,()=>{{const b=this.f;for(let c=0;c<b.length;c++){const d=b[c];d.mode===_.Gf&&(d.mode=
319
- _.$d)}}}))}o(a){const b=new _.Bs(a.startTime,a.endTime,a.text,_.ug);if(_.Wg(a.vertical))switch(a.vertical){case "lr":b.writingMode=_.ig;break;case "rl":b.writingMode=_.jg}_.Xg(a.size)&&(b.size=a.size);if(_.Wg(a.align))switch(a.align){case _.he:case _.Mf:b.textAlign=_.he;break;case _.ad:b.textAlign=_.ws;break;case _.zf:case _.Ud:b.textAlign=_.zf}_.Xg(a.position)&&(b.position=a.position);if(_.Wg(a.positionAlign))switch(a.positionAlign){case _.ke:b.positionAlign=_.ke;break;case _.ad:b.positionAlign=
320
- _.ad;break;case _.me:b.positionAlign=_.me}_.Xg(a.line)&&(b.line=a.line);if(_.Wg(a.lineAlign))switch(a.lineAlign){case _.Mf:b.lineAlign=_.zs;break;case _.ad:b.lineAlign=_.ad;break;case _.Ud:b.lineAlign=_.Ud}typeof a.snapToLines===_.Pc&&(b.lineInterpretation=a.snapToLines?_.ys:1);return b}};_.H=class extends Error{constructor(a,b,c,d,e){super(Gh(a,b,c,d));this.severity=a;this.category=b;this.code=c;this.data=!d||_.Wg(d)?{}:d;this.cause=void 0===e?null:e;this.f=!1;Error.captureStackTrace&&Error.captureStackTrace(this,_.H)}a(a){this.severity!==a&&(this.severity=a,this.message=Gh(this.severity,this.category,this.code,this.data))}toString(){let a=this.message;this.cause&&(a+=`\n Caused by ${this.cause}`);return a}};_.z("clpp.Error",_.H);_.F=2;_.H.Severity={RECOVERABLE:1,FATAL:_.F};
321
- _.H.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,PLUGIN:9,ADS:10};
322
- _.H.Code={UNSUPPORTED_SCHEME:1E3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,UNKNOWN_DATA_URI_ENCODING:1005,REQUEST_MODIFIER_ERROR:1006,RESPONSE_MODIFIER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,ATTEMPTS_EXHAUSTED:1010,INVALID_TEXT_HEADER:2E3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,UNABLE_TO_EXTRACT_CUE_START_TIME:2009,FETCH_OR_APPEND_ERROR:2010,INVALID_MP4:2011,
165
+ pn=function(a,b,c,d,e,f,g){f=void 0===f?null:f;g=void 0===g?!1:g;_.w(function*(){if(e.length){var h=b;if(!h)try{h=Cn(a,d,e,f)}catch(u){if(a.g.warn("Ignoring unrecognized init data. This may be caused by unsupported or malformed init data. Set `drm.ignoreUnrecognizedInitData \x3d false` if you want to override this behavior and use the init data after all.",{error:u,initDataType:d,initData:e}),a.h.ignoreUnrecognizedInitData)return}if(!g&&Dn(a,h,d,e)){var k=!0;if("skd"===d&&!a.h.enableSessionCacheForSkd)for(var l of a.f.keys()){var m=a.f.get(l);
166
+ if(h&&m.keyId===h){a.g.warn(`Close and re-open session for ${h}`);try{yield l.close()}catch(u){a.g.warn("Unable to close session",u)}k=!1}}if(k){a.g.warn(`Skip creating a new session for ${h}`);return}}try{var n=a.C?_.Re:Tf;var q=a.G.createSession(n);a.g.info(`Created new ${n} session for Key ID: '${h}'. `+`Init data type: ${d}.`)}catch(u){a.T(new _.G(_.E,6,6005,{browserError:u.message}));return}a.w.on(q,_.xe,a.da.bind(a));a.w.on(q,fe,a.ba.bind(a));k={gc:f,td:[],initData:e,initDataType:d,keyId:h,
167
+ fb:h?[h]:[],loaded:!1,le:Infinity,periodId:c,Jb:null,Ma:new _.ln,sessionContext:{ldlDelay:0,customData:{}}};k.Ma.catch(()=>{});f&&(l=a.f.get(f),k.sessionContext=l.sessionContext);a.f.set(q,k);h&&!a.l.get(h)&&a.l.set(h,Nf);if(e)for(l=0;l<a.a.initData.length;l++)m=a.a.initData[l],m.keyId&&!k.fb.includes(m.keyId)&&_.Gi(m.initData,e)&&(k.keyId||(k.keyId=m.keyId),k.fb.push(m.keyId),a.l.get(m.keyId)||a.l.set(m.keyId,Nf));l=a.D.getConfiguration();m=a.keySystem();m=a.h.bb[m];n=(n=m.modifiers)&&n.transformInitData;
168
+ _.Vg(n)||(n=$m);try{e=n({playerConfig:l,initData:e,initDataType:d,drmInfo:a.a,drmSystemConfig:m,sessionContext:k.sessionContext,emeApi:a.j.f()})}catch(u){h=u;u instanceof _.G||(h=new _.G(_.E,6,6016,u));k.Ma&&k.Ma.reject(u);a.T(h);return}a.g.info(`Generate License Request for key ID: '${h}'`);q.generateRequest(d,e.buffer).catch(u=>{if(!a.ua){var v=null;u.errorCode&&u.errorCode.systemCode&&(v=u.errorCode.systemCode,0>v&&(v+=Math.pow(2,32)),v="0x"+v.toString(16));a.T(new _.G(_.E,6,6006,{browserError:u.message,
169
+ error:u,extended:v},u))}})}else a.g.warn("Empty init data")})};En=function(a){let b=Infinity;a=a.f.keys();for(const c of a)isNaN(c.expiration)||(b=Math.min(b,c.expiration));return b};Bn=function(a){a=a.f.values();return _.ci(a,b=>b.loaded)};Dn=function(a,b,c,d){if(!b&&c!==_.If)return!1;d=b||Ul(d);for(const e of a.f.values())if(b&&e.keyId===b||b&&e.fb.includes(b)||c===_.If&&(e.keyId||Ul(e.initData))===d)return!0;return!1};
170
+ Cn=function(a,b,c,d){d=void 0===d?null:d;if("skd"===b){a:{var e=d;e=void 0===e?null:e;var f=a.keySystem(),g=a.h.bb[f];f=a.D.getConfiguration();g=g&&g.modifiers&&g.modifiers.extractContentId;_.Vg(g)||(g=Zm);try{var h={ldlDelay:0,customData:{}};e&&(h=a.f.get(e).sessionContext);var k=g(f,c,h);a.g.debug(`Extracted Content ID '${k}' from SKD`);var l=k;break a}catch(m){a.g.warn("Unable to extract Content ID from SKD",m)}l=""}return l}if(b===_.If)return Ul(c)||"";if(b===_.bd){l=a.keySystem();try{if(l.match(/^com\.widevine\.alpha/)){const m=
171
+ _.Gm(c);if(m)return m.a}else if(Rm(l)){{f=new _.Fm(new DataView(c.buffer,c.byteOffset,c.byteLength),!1);g=_.O(f);const m=_.O(f);h=_.Ll(m);const n=_.O(f);c=n>>>24;k=n&16777215;const q=_.Jl(f,16),u=_.Fi(q);if(0<c){const D=_.O(f);f.skip(16*D)}const v=_.O(f),y=_.Jl(f,v),A=_.Mm(y);_.kh("Parsed PR PSSH Box","size",g,"name",h,ig,c,"flags",k,"size",v,"systemId",u,"keyId",A.a);e=A}if(e)return e.a}}catch(m){throw a.g.warn("Unable to extract Key ID from PSSH data.",{error:m,keySystem:l}),m;}}return""};
172
+ sn=function(a,b){const c=b.target,d=a.f.get(c);var e=a.keySystem();let f=!1;e.match(/^com\.widevine\.alpha/)&&b.message&&2===b.message.byteLength?(f=!0,a.g.info("WV Server certificate request for "+`SID:'${c.sessionId} `+`from msg '${b.messageType}'`)):a.g.info("License request for "+`SID:'${c.sessionId}'/KID:'${d.keyId}' `+`from msg '${b.messageType}'`);let g=a.a.licenseServerUri;e=a.h.bb[e];"individualization-request"===b.messageType&&e&&e.individualizationServer&&(g=e.individualizationServer);
173
+ const h=_.Si([g],a.h.attemptParameters);h.type=3;h.body=b.message;h.method=_.vb;h.licenseRequestType=b.messageType===ie&&d.gc?he:f?dd:b.messageType;h.sessionId=c.sessionId;if(h.licenseRequestType===he)a.D.onEvent(new _.C(Md));Rm(a.a.keySystem)&&Fn(a,h);sl(a.K,h);const k=Math.floor(b.timeStamp),l=Date.now();return Gn(a,h,d.sessionContext).then(()=>{_.Om(`drm.license.req.${k}.start`);a.g.debug("Sending DRM license request to",g,h);return a.D.Hb.fetch(h).W}).then(m=>{_.Om(`drm.license.req.${k}.end`);
174
+ _.Pm(`drm.license.req.${k}`,`drm.license.req.${k}.start`,`drm.license.req.${k}.end`);if(a.ua)return Promise.reject();const n=Date.now()-l;var q=Hn(a,m);let u="";q&&(u=` RID:${q}`);q=m&&m.data?m.data.byteLength:-1;f?a.g.info("WV Server certificate response for "+`SID:'${c.sessionId}' `+`${q} bytes `+`in ${n}ms${u}`):a.g.info("License response for "+`SID:'${c.sessionId}'/`+`KID:'${d.keyId}' `+`${q} bytes `+`in ${n}ms${u}`);const v=tl(a.K,m);_.Om(`drm.sess.update.${k}.start`);return c.update(m.data).then(()=>
175
+ {_.Om(`drm.sess.update.${k}.end`);_.Pm(`drm.sess.update.${k}`,`drm.sess.update.${k}.start`,`drm.sess.update.${k}.end`);if(!f){var y=En(a),A=v?Date.now()+1E3*v.delay:Number.NaN;y=new _.C(_.Od,{keySystem:a.keySystem(),expirationTime:y,expectedRenewalTime:A});a.D.onEvent(y);d&&(d.Jb&&d.Jb.resolve(),d.gc&&(y=d.gc,a.g.info(`Closing expired session '${y.sessionId}'`),Qm(y).catch(()=>{a.g.warn("Unable to close expired session in time")}),(y=a.f.get(d.gc))&&y.xc&&y.xc.stop(),a.f.delete(d.gc),d.gc=null),(new _.Wj(()=>
176
+ {a.ua||(d.loaded=!0,d.Ma&&d.Ma.resolve(),Bn(a)&&(a.o||a.g.info(wa),a.o=!0,a.B=!1,a.F.resolve()))})).fa(5),null!==d.initData&&(0<d.sessionContext.ldlDelay||v&&rl(a.keySystem()))&&(y=new _.Wj(()=>{!a.ua&&a.K&&(a.g.info("Updating CSL Sessions"),Rm(a.keySystem())?pn(a,d.keyId,d.periodId,d.initDataType,d.initData,c,!0):a.keySystem().startsWith(_.ud)&&c.update(_.ri("renew")))}),d.xc=y,y.fa(v?v.delay:d.sessionContext.ldlDelay)))}})},m=>_.w(function*(){if(!a.ua){var n=m.data.headers;n=Object.assign({message:_.Sa,
177
+ url:m.data.url,status:m.data.status,response:m.data.response},n?{headers:n}:{},um(n));n=new _.G(_.E,6,6007,n,m);a.T(n);d&&d.Jb&&d.Jb.reject(n);d&&d.Ma&&d.Ma.reject(n)}})).catch(m=>{a.ua||(m===Hb?a.g.info("Ignore update for closed sessions"):(m=new _.G(_.E,6,6008,{browserError:m.message}),a.T(m),d&&d.Jb&&d.Jb.reject(m),d&&d.Ma&&d.Ma.reject(m)))})};
178
+ Fn=function(a,b){var c=pi(b.body,!0,!0);if(c.includes("PlayReadyKeyMessage")){a.g.debug("Unwrapping PlayReady request.");a=(new DOMParser).parseFromString(c,"application/xml");c=a.getElementsByTagName("HttpHeader");for(let d=0;d<c.length;++d)b.headers[c[d].querySelector("name").textContent]=c[d].querySelector(_.hg).textContent;b.body=_.Di(a.querySelector("Challenge").textContent).buffer}else a.g.debug("PlayReady request is already unwrapped."),b.headers[ua]="text/xml; charset\x3dutf-8"};
179
+ Gn=function(a,b,c){return _.w(function*(){const d=a.D.getConfiguration();yield un(a,d);const e=a.keySystem();var f=a.h.bb[e];const g=(f=f&&f.modifiers)&&f.licenseRequest,h=f&&f.licenseResponse;g?b.requestModifiers.push(k=>g(d,k,c)):e.startsWith(_.ud)&&b.requestModifiers.push(k=>_.Xl(k));h?b.responseModifiers.push(k=>h(d,k,c)):e.startsWith(_.ud)&&b.responseModifiers.push(k=>_.Yl(k))})};
180
+ Hn=function(a,b){if(!b||!b.headers)return"";if(b=b.headers["x-dt-li"])try{return JSON.parse(_.ni(_.Di(b))).ti}catch(c){a.g.warn("Unable to parse DRMtoday Request ID",c)}return""};_.Kn=function(a,b){a&&b&&(_.In.set(a,b),_.Jn.info(`Registered TextDisplayerFactory: '${a}'`))};
181
+ _.Ln=function(a,b){b=b.find(c=>(c=_.In.get(c))?c.a(a):!1);if(null==b)return _.Jn.warn("Subtitles may not work as expected. No compatible text displayer found for this platform."),null;_.Jn.info(`Chosen the text displayer: ${b}`);return _.In.get(b)};_.Mn=function(a,b){if(null==a.a)a.a={timestamp:Date.now()/1E3,state:b,duration:0};else{{const c=Date.now()/1E3;a.a.duration=c-a.a.timestamp;a.a.state!==b&&(a.f.push(a.a),a.a={timestamp:c,state:b,duration:0})}}};
182
+ Nn=function(a,b){let c=0;a.a&&a.a.state===b&&(c+=a.a.duration);for(const d of a.f)c+=d.state===b?d.duration:0;return c};On=function(a){const b=d=>({timestamp:d.timestamp,state:d.state,duration:d.duration}),c=[];for(const d of a.f)c.push(b(d));a.a&&c.push(b(a.a));return c};Pn=function(a){return a.a.map(b=>_.Rg(b))};
183
+ _.Qn=function(){return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,corruptedFrames:NaN,estimatedBandwidth:NaN,loadLatency:NaN,playTime:NaN,pauseTime:NaN,bufferingTime:NaN,switchHistory:[],stateHistory:[]}};Sn=function(a,b,c,d){b===HTMLMediaElement.HAVE_NOTHING||a.readyState>=b?d():(b=Rn.value().get(b),c.one(a,b,d))};
184
+ Wn=function(a){a.g.debug("Start watching for video events for "+a.m.namespace());const b=a.m,c=d=>Tn(a,d.type);a.a.on(b,_.Ud,()=>{a.h||(a.j=!1,Un(a,_.Vn))});a.a.on(b,Xc,c);a.a.on(b,_.df,()=>{a.F=!0;a.j=!1;Tn(a,_.df)});a.a.on(b,_.Pe,()=>{a.F=!1;a.j=!1;Tn(a,_.Pe)});a.a.on(b,_.Xf,c);a.a.on(b,_.sf,c);a.a.on(b,_.Df,d=>{a.h=!1;a.j=!1;Tn(a,d.type)});a.a.on(b,_.Ef,d=>{a.h=!0;Tn(a,d.type)});a.a.on(b,Kf,c);a.a.on(b,_.wg,()=>{a.j=!0;Tn(a,_.wg)});a.a.on(b,_.Vd,d=>a.T(d));a.a.on(b,_.se,c);a.a.on(b,Yc,()=>{a.C=
185
+ !0;Tn(a,Yc)});a.a.on(b,_.gg,d=>{a.h=!0;Tn(a,d.type)});a.a.on(b,_.fg,d=>{a.h=!1;a.j=!1;Tn(a,d.type)})};Xn=function(a,b){return Object.keys(b)[a]};Zn=function(a,b){const c={type:_.Mf};b===_.Wc||b===_.Sc?(c.reason=a.w,b===_.Wc?c.timeSinceLastStateChangeMS=a.H:c.bufferedTimeMS=a.B):(a.f===_.Yn&&(c.reason=a.w),a.A===_.Yn&&(c.reason=a.w,c.bufferedTimeMS=a.B),c.currentState=a.f,c.previousState=a.A,c.timeSinceLastStateChangeMS=a.H);return c};
186
+ Un=function(a,b){if(a.f===b)return!1;var c=Date.now();const d=a.f===_.Yn;a.A=a.f;a.f=b;a.A===_.Vn&&(a.I=c,a.o=0);a.o||(a.o=a.I||c);a.H=c-a.o;a.o=c;b===_.Yn?(a.K=a.o,a.w=a.h?1:2,a.g.info("Buffering started. Reason: "+Xn(a.w-1,_.$n)),b=Zn(a,_.Wc),a.cb(_.Wc,b)):d&&(a.B=a.o-a.K,a.g.info("Buffering finished. Reason: "+Xn(a.w-1,_.$n)+". Buffering time: "+a.B+" ms"),b=Zn(a,_.Sc),a.cb(_.Sc,b));b=Xn(a.A,_.ao);c=Xn(a.f,_.ao);a.g.info(`Player state change: ${b} -> ${c}`);a.cb(_.Mf,Zn(a,""));return!0};
187
+ Tn=function(a,b){if(a.f===_.bo)a.g.warn("Player is in error state, aborting any further state checks");else{var c=a.m.isPaused(),d=a.m?a.m.isEnded():!1;if(d)a.h||(a.j=!1,Un(a,_.Vn));else if(b!==_.Xf){var e=a.m.getPosition();e=null!==e&&void 0!==e&&0<=e?a.m.getBufferInfo().xa(e,!0):-1;a.G=e;e=a.m.getSurface().getMedia();a.l=e?e.readyState:null;a.J=a.m.getPlaybackRate()||1;e=typeof a.l===_.r&&2>a.l&&2===e.networkState;var f=typeof a.l===_.r&&0>=a.G&&a.f===_.co,g=typeof a.l===_.r&&2>=a.l&&a.j;e=a.h||
188
+ f||e||g;!a.L||a.m.isLive()||a.f!==_.Yn||e||(f=b===_.Df&&4===a.l,(g=a.A===_.eo)&&!a.C?e=!0:g||a.C||f||(e=!0));f=!1;e?f=Un(a,_.Yn):c?f=Un(a,_.fo):a.F&&(f=Un(a,_.go));f&&(a.C=!1);a.g.debug("Video state check for event "+b+":: seeking: "+a.h+", waiting: "+a.j+", playing: "+a.F+", paused: "+c+", readyState: "+a.l+", rate: "+a.J+", buffer: "+a.G+", ended: "+d+". Changed state: "+f+", Current state: "+Xn(a.f,_.ao))}}};
189
+ ho=function(a){a=(new _.Mh(a)).Da;if(!a)return null;a=a.toUpperCase();return _.vi(a,".MPD")?_.Bc:_.vi(a,".M3U8")?_.Rk:_.vi(a,".MP4")?_.qg:_.vi(a,"MANIFEST")||_.vi(a,".ISM")?_.Gc:null};_.jo=function(a){let b;el(a)?b=a.source:b=a;Array.isArray(b)||(b=[b]);b=b.filter(c=>typeof c===_.Pf||"url"in c);a=[];for(let c=0;c<b.length;c++){const d=io(b[c]);d&&a.push(d)}return a};
190
+ io=function(a){let b=null;_.Xg(a)&&(a={url:a});typeof a===_.Fe&&!Array.isArray(a)&&"url"in a&&(b={url:a.url,type:a.type?a.type:null},_.z(a.drmProtected)||typeof a.drmProtected!==_.Rc||(b.drmProtected=a.drmProtected),_.z(a.isLive)||typeof a.isLive!==_.Rc||(b.isLive=a.isLive),_.z(a.name)||typeof a.name!==_.Pf||(b.name=a.name),_.z(a.Tb)||typeof a.Tb!==_.Pf||(b.Tb=a.Tb),_.z(a.audioMimeType)||typeof a.audioMimeType!==_.Pf||(b.audioMimeType=a.audioMimeType));b&&!b.type&&(b.type=ho(a.url),b.type?ko.debug("Detect media type "+
191
+ b.type+" for "+a.url):ko.warn("Unable to detect media type for "+a.url));return b};mo=function(a){return a.w?lo():new Promise(b=>{if(a.a){const c=a.a;a.h.off(c,_.Vd);a.h.off(c,_.xf);a.a=null}b()})};lo=function(){return Promise.reject(new _.G(_.E,7,7E3))};
192
+ oo=function(a,b){return a.w?lo():new Promise(c=>{a.a||(a.h.on(b,_.Vd,()=>{{const d=no(a);if(d)a.onError(d)}}),a.h.on(b,_.xf,()=>{const d=b.videoWidth,e=b.videoHeight,f=a.getTrackManager();f&&0<d&&0<e&&(f.w={width:d,height:e});a.trigger(new _.C(_.Pc,{detail:{width:d,height:e}}))}),a.a=b);c()})};
193
+ qo=function(a){return _.w(function*(){if(a.w)return lo();var b=a.ea[a.getSourceIndex()];if(!a.configuration.drm||!1===b.drmProtected)return a.log.debug("No DRM configuration present.","Skipping DRM engine initialization"),Promise.resolve();b=_.xl(a.configuration.drm);a.log.debug("Drm configuration: ",b);const c=a.getNetworkEngine();a.o=new _.po({Hb:c,onError:d=>a.onError(d),qe:()=>{},pe:(d,e)=>{a.trigger(new _.C(_.Ld,{expirationTime:e}))},onEvent:d=>{d instanceof _.C?a.dispatchEvent(d):a.log.debug(_.Ob,
194
+ d.type)},getConfiguration:()=>a.getConfiguration(),Cc:()=>a.Cc()});a.o.h=b;yield _.kn(a.o,[{id:0,language:_.ag,primary:!1,audio:null,video:{id:0,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:()=>null,getSegmentReference:()=>null,adjustSegmentDurations:()=>{},getDuration:a.getDuration.bind(a),initSegmentReference:null,Ba:0,mimeType:_.qg,codecs:"",encrypted:!0,keyId:null,language:_.ag,originalLanguage:_.ag,label:null,type:_.t,primary:!1,frameRate:void 0,ai:void 0,
195
+ trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,spatialAudio:!1,Nh:null,closedCaptions:null},bandwidth:100,drmInfos:[],allowedByApplication:!0,allowedByKeySystem:!0}]);yield _.An(a.o,a.a);return Promise.resolve()})};ro=function(a,b){Sn(a.a,HTMLMediaElement.HAVE_CURRENT_DATA,a.h,()=>{a.getState()!==_.bo&&a.seek(b).catch(c=>{a.log.warn("Error while seeking to start position.",c)})})};
196
+ no=function(a){if(null===a.ea||!a.a.error)return null;const b=a.a.error.code;if(1===b)return null;let c=a.a.error.msExtendedCode;c&&(0>c&&(c+=Math.pow(2,32)),c=c.toString(16));return new _.G(_.E,3,3016,{code:b,Wh:c,message:a.a.error.message})};
197
+ to=function(a){if(a.w)return new _.so(lo(),()=>{});const b=a.ea[a.getSourceIndex()],c=a.configuration.startTime||null,d=a.a,e=a.H;c&&ro(a,c);if(d.preload!==_.Ee)a.h.one(d,_.se,()=>{const g=Date.now()/1E3-e;a.f.A=g;a.log.debug("Time to load: ",g)});d.src=b.url;(_.ak()||_.dk())&&d.load();const f=new _.ln;a.h.one(d,Kf,()=>{const g=a.getConfiguration().manifest.attemptParameters.timeout||30;a.B||(a.B=(new _.Wj(()=>{f.reject(new _.G(_.E,3,3100,{message:`Unable to load media source successfully from ${b.url}`,
198
+ uri:b.url},d.error))})).fa(g))});Sn(d,a.configuration.forceWaitForTracks?HTMLMediaElement.HAVE_CURRENT_DATA:HTMLMediaElement.HAVE_METADATA,a.h,()=>f.resolve());d.error?f.reject(no(a)):d.preload===_.Ee&&(a.log.warn('With \x3cvideo preload\x3d"none"\x3e, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way. Please do not use preload\x3d"none" with PRESTOplay for Web Apps.'),f.resolve());a.h.one(d,_.Vd,()=>{f.reject(no(a))});return new _.so(f,
199
+ ()=>{const g=new _.G(_.E,7,7001);f.reject(g);return Promise.resolve()})};uo=function(a,b){Sn(b,HTMLMediaElement.HAVE_CURRENT_DATA,a.h,()=>{if(a.isLive()&&a.getState()!==_.bo){var c=a.getSeekRange().end,d=a.getPosition();Infinity===c||20>c-d||(a.log.warn("Detected that HLS live stream was not started from close to the live edge. Auto-fixing, seeking to seek range end."+`(position: ${d}, seek range end: ${c})`),a.seek(c).catch(e=>{a.log.warn("Error while seeking to seek range edge.",e)}))}})};
200
+ vo=function(a,b){let c=!1;a.h.on(b,_.Ef,()=>{c=b.paused});a.h.on(b,_.Df,()=>{.2>b.duration-b.currentTime&&b.paused&&!c&&(a.log.warn("Player was auto-paused during seek to the end, auto-resuming."),b.play())})};_.yo=function(a){0<=wo.indexOf(a)?xo.warn(`Factory '${a.name()}' is already registered`):(wo.push(a),xo.info(`Factory '${a.name()}' has been registered.`))};zo=function(a,b){const c=wo.find(d=>d.a(a,b))||null;c&&xo.info(`Chosen ads manager: ${c.name()}`);return c};
201
+ Co=function(a){a.h=a.B.then(e=>{a.j=e.request;e.request.uriIndex=e.request.currentAttempt%e.request.uris.length;if(0<e.request.currentAttempt){-1===a.f&&(a.f=Ao(e.request.baseDelay,1E3));const f=a.f*(1+(2*Math.random()-1)*Ao(e.request.fuzzFactor,.5));a.f*=Ao(e.request.backoffFactor,2);if(0<f)return(new Promise((g,h)=>{a.l=h;Bo(a,()=>{g(e.plugin(e.request))},f)})).catch(g=>{if(!a.a)throw g;})}if(a.a)throw new _.G(1,1,7001,{url:e.request.uris[e.request.uriIndex],request:e.request});return e.plugin(e.request)});
202
+ let b=0,c=0,d=0;return a.h.then(e=>{const f=e.request;f.currentAttempt+=1;b=f.currentAttempt;c=f.maxAttempts;d=f.uris.length;return e.W}).then(e=>{a.w.resolve(e)}).catch(e=>{if(e instanceof _.G){const f=b<d,g=7001!==e.code,h=b<c;if((1===e.severity||f)&&g&&h)return Co(a);g&&e.a(_.E);a.w.reject(e)}else a.w.reject(e)})};Bo=function(a,b,c){a.o=setTimeout(b,c)};Ao=function(a,b){return null===a||void 0===a?b:a};Do=function(){return window.performance&&window.performance.now?window.performance.now():Date.now()};
203
+ Eo=function(a){return Do()-a.a};Go=function(a){const b=new Fo;b.a=a.a;return b};Ho=function(a){let b=null;a.h!==a.f&&(b={start:a.h,end:a.f,length:a.f-a.h,data:new DataView(a.j.a.buffer,a.h,a.f-a.h),count:-1});return b};Io=function(a,b){{var c=a.j;const d=c.f+b.byteLength;if(d>c.a.byteLength){const e=c.a;c.a=new Uint8Array(Math.max(Math.ceil(c.a.buffer.byteLength*c.h),d));c.a.set(e)}c.a.set(b,c.f);c.f+=b.byteLength}a.a=a.h;a.f=a.j.f;a.l=new DataView(a.j.a.buffer,0,a.j.f)};
204
+ Ko=function(a){if(0<=a.o&&a.f<a.o)return null;let b=Jo(a);for(;null!==b;){if(b.name===_.ve){const c={start:a.h,end:b.end,length:b.end-a.h,data:new DataView(a.j.a.buffer,a.h,b.end-a.h),count:1};a.h=b.end;return c}b=Jo(a)}return null};
205
+ Lo=function(a,b,c,d){return b.read().then(e=>{var {done:f,value:g}=e;d&&g&&(d(g.byteLength,Eo(a.w)),a.w.a=Do());if(f)return e=Ho(a),(e=c(!0,e))?e.then(()=>a.j.a.buffer):Promise.resolve(a.j.a.buffer);let h=Promise.resolve();if(null!=g){Io(a,g);var k=Ko(a);for(e=[];k;)e.push(k),k=Ko(a);if(!a.A)e.forEach(l=>{h=h.then(()=>c(!1,l))});else if(0<e.length){k=e[0];if(1<e.length){k=e[0];const l=e[e.length-1],m=l.end-k.start;k={start:k.start,end:l.end,length:m,data:new DataView(a.j.a.buffer,k.start,m),count:e.length}}(e=
206
+ c(!1,k))&&(h=e)}}return h.then(()=>Lo(a,b,c,d))})};
207
+ Jo=function(a){const b=a.a;if(a.a+4>=a.f)return a.a=a.f,null;var c=Mo(a);if(a.a+4>=a.f)return a.a=a.f,null;var d=Mo(a);d=String.fromCharCode(d>>24&255,d>>16&255,d>>8&255,d&255);switch(c){case 0:c=a.f-b;break;case 1:if(a.a+8>=a.f)return a.a=a.f,null;{let e,f;try{f=a.l.getUint32(a.a,!1),e=a.l.getUint32(a.a+4,!1)}catch(g){throw new _.G(_.E,3,3E3);}if(2097151<f)throw new _.G(_.E,3,3E3);a.a+=8;c=f*Math.pow(2,32)+e}}c=b+c;a.o=c;return a.f>=c?(a.a=c,{name:d,start:b,end:c}):null};
208
+ Mo=function(a){const b=a.l.getUint32(a.a,!1);a.a+=4;return b};
209
+ Oo=function(a){const b=a.uris[a.uriIndex],c=new No,d=new Fo,e=Go(d);let f=0,g;const h=new _.ln;c.open(a.method,b,!0);c.responseType="arraybuffer";c.timeout=a.timeout;c.withCredentials=a.allowCrossSiteCredentials;let k=!1,l=!1;c.onreadystatechange=function(m){m=m.target;m.readyState>=XMLHttpRequest.LOADING&&0===f&&(g=Eo(e));m.readyState>=XMLHttpRequest.HEADERS_RECEIVED&&!k&&(m=m.getResponseHeader(ta),Xi(a,m),k=!0)};c.onload=function(m){m=m.target;var n=(m.getAllResponseHeaders()||"").trim().split("\r\n");
210
+ const q={};for(const u of n)n=u.split(": "),q[n[0].toLowerCase()]=n.slice(1).join(": ");try{const u=Eo(e);l||Yi(a,m.response?m.response.length:0,u);const v=_.Wi(q,m.response,m.status,b,m.responseURL,a,u,g);a.rateLimitBps?Zi(a.rateLimitBps,Eo(e),a.bytesLoaded).then(()=>{h.resolve(v)}):h.resolve(v)}catch(u){h.reject(u)}};c.onerror=function(m){m=m.target;if(0>=m.status)h.reject(new _.G(1,1,1002,{url:b,request:a,status:m.status}));else{var n=m.getAllResponseHeaders();const u={};if(n){n=n.trim().split("\r\n");
211
+ for(var q of n)n=q.split(": "),u[n[0].toLowerCase()]=n.slice(1).join(": ")}q=_.Wi(u,m.response,m.status,b,m.responseURL,a,Eo(e),g);h.resolve(q)}};c.ontimeout=function(){h.reject(new _.G(1,1,1003,{url:b,request:a}))};c.onprogress=function(m){const n=Eo(d);d.a=Do();if(100<n||m.lengthComputable&&m.loaded===m.total)Yi(a,m.loaded-f,n),f=m.loaded,l=!0};for(const m in a.headers)c.setRequestHeader(m.toLowerCase(),a.headers[m]);c.send(a.body);return{W:h,request:a,abort:()=>{c.abort();h.reject(new _.G(1,1,
212
+ 7001,{url:b,request:a}));return Promise.resolve()}}};Po=function(a,b){var c=a.f+b.byteLength;if(a.a.byteLength<c){let d=a.a.byteLength;for(;d<c;)d*=2;c=new Uint8Array(d);c.set(a.a);a.a=c}a.a.set(b,a.f);a.f+=b.byteLength};Qo=function(a,b,c){return b.read().then(({done:d,value:e})=>{null!=e&&(Po(a,e),Yi(c,e.byteLength,Eo(a.h)),a.h.a=Do());return d?(d=a.a.buffer,a.a.byteLength!==a.f&&(d=d.slice(0,a.f)),Promise.resolve(d)):Promise.resolve().then(()=>Qo(a,b,c))})};
213
+ Uo=function(a){try{const b=a.split(",").map(c=>{const d={};c=c.split(";");for(let e=0;e<c.length;e++){const {key:f,value:g}=Ro(c[e]);Object.keys(So).includes(f)&&(d[So[f]]=g)}return d}).filter(c=>_.Tg(c));return 0<b.length?b:null}catch(b){return To.error("CmsdManager parseCmsdDynamicHeader_ failed:",b),null}};
214
+ Ro=function(a){var b=a.split("\x3d");const c=b[0];b=b[1];if(!c)throw new _.Jh("Parsing CMSD, missing parameter or wrong format");if(c&&!b)return{key:c,value:!0};const d=b[0];if('"'===d&&'"'===b[b.length-1])return{key:c,value:b.replaceAll(/(^")|("$)/g,"")};if(/^[-0-9]/.test(d))return{key:c,value:parseInt(b,10)};if(/^[a-zA-Z*]/.test(d))return{key:c,value:b};throw new _.Jh(`Parsing CMSD, not recognized value type of ${a}`);};
215
+ Wo=function(a){return b=>{{var c=b.headers;let e=b=null;var d=ch(c,"cmsd-dynamic");c=ch(c,"cmsd-static");d&&(b=Uo(d),a.a=b);if(c)try{d={};const f=c.split(",");for(c=0;c<f.length;c++){const {key:g,value:h}=Ro(f[c]);Object.keys(Vo).includes(g)&&(d[Vo[g]]=h)}e=_.Tg(d)?d:null}catch(f){To.error("CmsdManager parseCmsdStaticHeader_ failed:",f),e=null}(b||e)&&a.m.trigger(new _.C("cmsd-event",{Vh:b,fi:e}))}}};
216
+ $o=function(a){a.a.on(window,"offline",()=>{Xo(a,!1)});a.a.on(window,"online",()=>{a.f||Yo(a)});a.a.on(a.m,Kf,()=>Zo(a));a.a.on(a.m,"suspend",()=>Zo(a));a.a.on(a.m,_.wg,()=>Zo(a));a.a.on(a.m,_.df,()=>{a.f||Yo(a)});a.a.on(a.m,_.qf,()=>{a.f||Yo(a)});a.a.on(a.m,_.Mf,()=>{switch(a.m.getState()){case _.Yn:Zo(a);break;default:Zo(a)}})};ap=function(a){a.h&&(a.h.stop(),a.h=null)};Zo=function(a){a.f&&Yo(a)};
217
+ bp=function(a){return _.w(function*(){var b=a.m.getConfiguration().connectivityCheck;b&&a.m&&(b=yield dj(a.j,b.url,b.attemptParameters,b.method),Xo(a,b))})};Yo=function(a){a.m.getConfiguration().connectivityCheck&&(ap(a),a.h=(new _.Wj(()=>bp(a))).fa(5))};Xo=function(a,b){ap(a);a.f!==b&&(a.f=b,a.m&&a.m.getConfiguration().connectivityCheck&&a.m.trigger(new _.C(Le,{online:a.f})))};
218
+ fp=function(a){var b=new cp;for(const e in a.headers)b.append(e.toLowerCase(),a.headers[e]);const c=new dp,d={Nc:!1,Of:!1};b={W:ep(a.uris[a.uriIndex],a,{body:a.body||void 0,headers:b,method:a.method,signal:c.signal,credentials:a.allowCrossSiteCredentials?"include":void 0},d),request:a,abort:()=>{d.Nc||(d.Nc=!0,c.abort());return Promise.resolve()}};if(a=a.timeout){const e=window.setTimeout(()=>{d.Of=!0;c.abort()},a);b.W=b.W.finally(()=>{window.clearTimeout(e)})}return b};
219
+ ep=function(a,b,c,d){return _.w(function*(){const e=new Fo,f=Go(e);try{const g=yield gp(a,c),h=Qi(g.headers),k={uri:g.url,data:null,headers:h,status:g.status,timeMs:Eo(f),responseStartMs:Eo(e),request:b};if(!Ti(g.status))throw k.data=yield g.arrayBuffer(),Vi(k);const l=g.headers.get(ta);Xi(b,l);const m=l?parseInt(l,10):0;if(b.onFragment&&!b.disableFragmentSupport&&2===b.type){const n=g.body.getReader(),q=new hp(m,!b.disableMergedFragments);k.data=yield Lo(q,n,(u,v)=>{if(d.Nc)return null;v&&v.data&&
220
+ (Yi(b,v.data.byteLength,Eo(e)),e.a=Do());return b.onFragment&&v?b.rateLimitBps?Zi(b.rateLimitBps,Eo(f),b.bytesLoaded).then(()=>b.onFragment(v)):b.onFragment(v):null},b.onProgress)}else{const n=g.body.getReader(),q=yield Qo(new ip(m),n,b);b.rateLimitBps&&(yield Zi(b.rateLimitBps,Eo(f),q.byteLength));k.data=q}if(d.Nc)throw Error("Request was aborted");return Ui(k)}catch(g){if(d.Nc)throw new _.G(1,1,7001,{url:a,request:b});if(d.Of)throw new _.G(1,1,1003,{url:a,request:b});if(g&&1001===g.code)throw g;
221
+ _.lh("Error while fetching data:",g);throw new _.G(1,1,1002,{url:a,error:g,request:b,status:-1},g);}})};kp=function(a){try{const b=a.uris[a.uriIndex],c=_.jp(b);return{W:Promise.resolve({uri:b,data:c.data,request:a,headers:{"content-type":c.contentType}}),request:a,abort:()=>Promise.resolve()}}catch(b){return{W:Promise.reject(b),request:a,abort:()=>Promise.resolve()}}};
222
+ _.jp=function(a){var b=a.split(":");if(2>b.length||"data"!==b[0])throw _.lh("Bad data URI, failed to parse scheme"),new _.G(_.E,1,1004,{uri:a});b=b.slice(1).join(":").split(",");if(2>b.length)throw _.lh("Bad data URI, failed to extract encoding and MIME type"),new _.G(_.E,1,1004,{uri:a});var c=b[0];a=window.decodeURIComponent(b.slice(1).join(","));b=c.split(";");c=b[0];let d=!1;1<b.length&&"base64"===b[b.length-1]&&(d=!0,b.pop());return{data:d?_.Di(a).buffer:_.ri(a).buffer,contentType:c}};
223
+ _.mp=function(a,b,c,d){return _.w(function*(){try{return new (yield lp(a,b,c,d))}catch(e){throw e.a(_.E),e;}})};
224
+ lp=function(a,b,c,d){return _.w(function*(){if(d){var e=_.np[d.toLowerCase()];if(e)return e;_.B("Could not determine manifest type using MIME type ",d)}if(e=_.op(a)){const f=_.pp[e];if(f)return f;_.B("Could not determine manifest type for extension ",e)}else _.B("Could not find extension for ",a);if(!d&&(d=yield qp(a,b,c))){if(e=_.np[d])return e;_.B("Could not determine manifest type using MIME type",d)}throw new _.G(_.E,4,4E3,{url:a});})};
225
+ _.op=function(a){a=(new _.Mh(a)).Da.split("/").pop().split(".");return 1===a.length?"":a.pop().toLowerCase()};qp=function(a,b,c){return _.w(function*(){var d=_.Si(a);Pi(d,c);d.type=1;d.method="HEAD";return(d=(yield b.fetch(d).W).headers["content-type"])?d.toLowerCase():""})};sp=function(){for(let a=0;a<rp.length;++a)rp[a].vc()};_.tp=function(a,b){b=b||0;a={priority:b,vc:a};for(let c=0;c<rp.length;c++)if(rp[c].priority<b){rp.splice(c,0,a);return}rp.push(a)};
226
+ up=function(a){const b=a.type.replace(/^(webkit|moz|MS)/,"").toLowerCase();let c;typeof Event===_.Zd?c=new Event(b,a):(c=document.createEvent("Event"),c.initEvent(b,a.bubbles,a.cancelable));a.target.dispatchEvent(c)};wp=function(a,b,c){if("input"===a)switch(this.type){case "range":a=ed}vp.call(this,a,b,c)};xp=function(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}};
227
+ yp=function(a){a=a.target;if(a.webkitPresentationMode===Se){document.pictureInPictureElement=a;var b=new Event("enterpictureinpicture");a.dispatchEvent(b)}else document.pictureInPictureElement===a&&(document.pictureInPictureElement=null),b=new Event("leavepictureinpicture"),a.dispatchEvent(b)};zp=function(){return this.webkitSupportsPresentationMode(Se)?(this.webkitSetPresentationMode(Se),document.pictureInPictureElement=this,Promise.resolve()):Promise.reject(Error("PiP not allowed by video element"))};
228
+ Ap=function(){const a=document.pictureInPictureElement;return a?(a.webkitSetPresentationMode("inline"),document.pictureInPictureElement=null,Promise.resolve()):Promise.reject(Error("No picture in picture element found"))};Bp=function(a,b,c){return new window.TextTrackCue(a,b,c)};Cp=function(a,b,c){return new window.TextTrackCue(a+"-"+b+"-"+c,a,b,c)};_.Dp=function(a,b){a=document.createElement(a);for(const c in b){const d=b[c];null===d||void 0===d?a.setAttribute(c,""):a.setAttribute(c,d)}return a};
229
+ _.Ep=function(a,b){a.classList.add(b)};_.Fp=function(a,b){if(a&&typeof b===_.Fe)for(const c in b)a.style[c]=b[c]};_.Gp=function(a){return document.createElement(a)};Hp=function(a,b){const c=new MutationObserver(()=>{const d=Array.from(a.h.values());Ah(Array.from(b.classList),Array.from(d))||b.classList.add(...d)});c.observe(b,{attributes:!0,attributeFilter:["class"]});return c};Ip=function(a,b){a.a&&0!==b.length&&(a.a.classList.add(b),a.h.add(b))};
230
+ Jp=function(a,b,c){(_.dk()&&53===_.ek().major||_.dk()&&68===_.ek().major||_.fk())&&!b.hasAttribute(Ad)&&(b.style.opacity="0",b.setAttribute(Ad,""),a.j.one(b,Qd,()=>{b.removeAttribute(Ad);b.style.opacity="1";c&&(c.style.opacity="1")}))};Kp=function(a){if(a.Vb&&0===a.Vb.getDuration()){var b=a.player.getDuration();a.Vb.h=b}a.Hd&&a.Hd()};Lp=function(a,b){return _.w(function*(){yield a.release();yield a.load(b)})};
231
+ Np=function(a,b,c){return Array.from({length:2}).map(()=>{var d=document.createElement(_.t);b.appendChild(d);const e=a.za.ya.create();d=new Mp(d);e.init(d,c);e.setSourceIndex(0);d=d.getContainer();if(!d)throw Error("Failed to create player surface container element");d.classList.add("secondary");a.A.push(d);return e})};Op=function(a){return[a.f,...a.l.a.map(b=>b.player)]};
232
+ Pp=function(a,b,c){const d=b.getSurface().getMedia();b=b.getSurface().getUniqueCssClass();d&&(c?(a.g.debug(`Show video element .${b}`),d.classList.add(jd),d.classList.remove("clpp-hide")):(a.g.debug(`Hide video element .${b}`),d.classList.remove(jd),d.classList.add("clpp-hide")),a.B&&a.B(d,c))};Qp=function(a){return _.w(function*(){const b=a.a;b&&("loaded"!==b.state&&(yield b.Gc),yield b.player.play(),b.state=_.df,Kp(b))})};
233
+ Rp=function(a,b){a.g.info("Add items",b);a.h=a.h.concat(b.map(c=>Object.assign({},c,{state:"idle",disposers:[],preloadPromise:Promise.resolve(),Gc:Promise.resolve()})))};Sp=function(a,b){0!==a.h.length&&(b?(a.g.info("Remove items",b),a.h=a.h.filter(c=>!b.includes(c.id))):(a.g.info("Remove all items"),a.h=[]))};
234
+ cq=function(a,b,c){return _.w(function*(){if(a.o)a.g.warn(`Cannot ${c} item while busy (ID: ${b})`);else{var d=Tp(a,b);if(d){a.g.info(`${c} item (ID: ${b})`);a.o=!0;var e=a.a;e&&(e.player.isPaused()||e.player.pause(),e.player.setMuted(!0));var f=a.j.has(b);f&&a.j.delete(b);try{c===_.Te?(e&&d.primary?yield Up(a,d):f?yield Vp(a,d):yield Wp(a,d),Kp(d)):f?a.g.error("Loading preloaded items is not supported"):yield Xp(a,d);Yp(a,d);d.player.setMuted(!1);d.Vb&&Zp(a,d,d.Vb);if(d.pb)d.player.one(_.Ud,d.pb);
235
+ d.Cf&&d.Cf()}catch(g){throw a.g.error(`Item failed to ${c} (ID: ${b})`),g;}finally{a.o=!1,e&&$p(a,e),aq(a),bq(a,d.next)}}else a.g.warn(`Item not found (ID: ${b})`)}})};Tp=function(a,b){return a.h.find(c=>c.id===b)||null};Up=function(a,b){return _.w(function*(){if(b.player){if(b.state===nf){a.g.info("Wait for seek to finish");try{yield b.preloadPromise}catch(c){}}a.a=b;b.role=dq;Pp(a,b.player,!0);b.state="loading";yield b.player.play();b.state=_.df}})};
236
+ Vp=function(a,b){return _.w(function*(){const c=b.player;if(c){if(b.state===nf){a.g.info(Vb);try{yield b.preloadPromise}catch(d){}}a.a=b;b.role=dq;Pp(a,c,!0);b.state===mf?yield c.play():b.state===lf&&(yield Lp(c,b.config));b.state=_.df}})};Wp=function(a,b){return _.w(function*(){yield Xp(a,b);yield b.player.play();b.state=_.df})};
237
+ Xp=function(a,b){return _.w(function*(){const c=yield eq(a,!!b.primary);a.a=b;b.role=dq;a.a.player=c;a.a.videoEl=c.getSurface().getMedia();Pp(a,c,!0);b.state="loading";b.Gc=Lp(c,b.config);yield b.Gc;b.state="loaded"})};
238
+ Yp=function(a,b){const c=b.transition;if(c&&!c.qh){if(c.pb){const d=c.pb,e=()=>{a.g.info(`Transition onEnded to (ID: ${d})`);a.play(d)};b.player.one(_.Ud,e);b.disposers.push(()=>{b.player.off(_.Ud,e)})}c.re&&fq(a,b,()=>{const d=a.a.Vb;d&&(a.f.trigger(new _.C(_.tc,{detail:d})),a.f.trigger(new _.C(_.gc,{detail:d})),d.a===d.f&&a.f.trigger(new _.C(_.dc)))});c.qh=!0}};
239
+ Zp=function(a,b,c){const d=b.player,e=()=>{const l=d.getPosition(),m=c.getDuration();c.j=l;a.f.trigger(new _.C(_.pc,{detail:c}));!c.l&&l>=m/4&&(c.l=!0,a.f.trigger(new _.C(_.hc,{detail:c})));!c.o&&l>=m/2&&(c.o=!0,a.f.trigger(new _.C(_.nc,{detail:c})));!c.w&&l>=3*m/4&&(c.w=!0,a.f.trigger(new _.C(_.uc,{detail:c})))},f=()=>{d.isEnded()||a.f.trigger(new _.C(_.oc,{detail:c}))},g=()=>{a.f.trigger(new _.C(_.qc,{detail:c}))},h=()=>{a.f.trigger(new _.C(_.ec,{detail:c}))},k=()=>{a.f.trigger(new _.C(_.tc,{detail:c}));
240
+ a.f.trigger(new _.C(_.gc,{detail:c}));c.a===c.f&&a.f.trigger(new _.C(_.dc))};d.on(_.Xf,e);d.on(_.Pe,f);d.on(_.df,g);d.on(_.Wc,h);d.one(_.Ud,k);b.disposers.push(()=>{d.off(_.Xf,e);d.off(_.Pe,f);d.off(_.df,g);d.off(_.Wc,h);d.off(_.Ud,k)});1===c.a&&a.f.trigger(new _.C(_.cc));a.f.trigger(new _.C(_.lc,{detail:c}));a.f.trigger(new _.C(_.sc,{detail:c}))};
241
+ $p=function(a,b){return _.w(function*(){const c=b.player;b.primary?a.g.info("Pause primary playback"):(a.g.info(`Stop previous playback (ID: ${b.id})`),b.disposers.forEach(d=>d()),b.disposers=[],b.player=null,b.videoEl=null,b.role=gq,yield hq(a,c));Pp(a,c,!1)})};aq=function(a){return Promise.all(Array.from(a.j.keys()).map(b=>iq(a,b)))};bq=function(a,b){_.w(function*(){if(0!==b.length){a.g.info(`Preload items (IDs: ${b})`);var c=a.h.filter(d=>b.includes(d.id))||[];yield Promise.all(c.map(d=>jq(a,d)))}})};
242
+ kq=function(a){return a.h.find(b=>!!b.primary)||null};lq=function(a,b){const c=kq(a);c?c.Fa=b:a.g.error("Failed to get primary item. Cannot configure resume position.")};mq=function(a){a.A.forEach(b=>a.w.removeChild(b));a.A=[];Pp(a,a.f,!0)};
243
+ fq=function(a,b,c){const d=b.transition.re;let e=null;d.Fa&&lq(a,d.Fa);const f=()=>{const k=b.player.getPosition();.5>=d.position-k&&(h(),g())},g=()=>{var k=b.player.getPosition();k>=d.position?(c(),a.g.info(`Transition onPosition to (ID: ${d.itemId}), `+`playback position: ${k.toFixed(3)} s, `+`transition point: ${d.position.toFixed(3)} s. `),a.play(d.itemId),k=!0):k=!1;k?e=null:e=requestAnimationFrame(g)},h=()=>{b.player.off(_.Xf,f)};b.player.on(_.Xf,f);b.disposers.push(()=>{null!=e&&(cancelAnimationFrame(e),
244
+ e=null)});b.disposers.push(h)};nq=function(a){a.a&&(a.a.disposers.forEach(b=>b()),a.a.disposers=[],a.a.Vb&&Zp(a,a.a,a.a.Vb),Yp(a,a.a),aq(a),bq(a,a.a.next))};iq=function(a,b){return _.w(function*(){const c=a.j.get(b);c&&(a.g.info(`Stop preloading item (ID: ${b})`),c.player&&(yield hq(a,c.player)),a.j.delete(b))})};hq=function(a,b){return _.w(function*(){b!==a.f&&(yield a.l.release(b))})};
245
+ eq=function(a,b){return _.w(function*(){if(b)return a.f;const c=yield a.l.get();if(!c)throw Error("No player available");return c})};
246
+ jq=function(a,b){return _.w(function*(){if(b.primary){b.state=nf;a.j.set(b.id,b);var c=b.player;b.Fa&&(a.g.info("Preparing to resume at",b.Fa),c.setMuted(!0),yield c.seek(b.Fa));b.state=mf}else{c=b.id;var d=yield eq(a,!1);b.player=d;b.videoEl=d.getSurface().getMedia();b.role=gq;b.state=nf;try{a.j.set(c,b),b.config.autoplay&&(a.g.warn(la+`Force disabling autoplay (ID: ${c})`),b.config.autoplay=!1),b.preloadPromise=Lp(d,b.config),yield b.preloadPromise,b.state=mf}catch(e){7001===e.code?(a.g.info(`Preload aborted (ID: ${c})`),
247
+ b.state=kf):(a.g.warn(`Preload failed (ID: ${c})`,e),b.state=lf)}}})};oq=function(a){return a&&a.ASSETS&&Array.isArray(a.ASSETS)?a.ASSETS.every(b=>typeof b.URI===_.Pf&&typeof b.DURATION===_.r):!1};pq=function(a,b){return a.a.find(c=>1===c.ue&&b>c.startTime&&b<c.endTime)||null};sq=function(a,b){return _.w(function*(){if(!(yield qq(a,b)))throw Error("Failed to bind");yield rq(a,b,1,!1)})};
248
+ Aq=function(a,b){const c=()=>_.w(function*(){var e=b.getPosition(),f=tq(a,e);f&&(a.g.info(`Interstitial ${f.sa} coming up `+`at ${f.startTime} s`),(yield qq(a,f))&&uq(a,f,b));if((f=vq(a))&&f.state===wq&&b.getDuration()-e<a.za.resolutionOffsetSec&&(yield qq(a,f)))if(f.Ha&&0!==f.Ha.length){if(e=a.qa.getCurrentItem()){var g=xq(a,f,2),h=g[0].id;e.next=[h];e.transition={pb:h};yq(a,f,g);a.g.info(`Postroll interstitial ${f.sa} scheduled`)}}else a.g.warn("Postroll interstitial has no assets, ignoring.")});
249
+ b.addEventListener(_.Xf,c);a.h.push(()=>{b.removeEventListener(_.Xf,c)});const d=()=>{zq(a,!1,!0,!0)};b.addEventListener(_.Wf,d);a.h.push(()=>{b.removeEventListener(_.Wf,d)})};Bq=function(a){a.h.forEach(b=>b());a.h=[]};Cq=function(a){return(a=a.qa.getCurrentItem())&&!a.primary?a.player:null};
250
+ zq=function(a,b,c,d){const e=Dq(a);a.g.info("Interstitial cues found",e);var f=e;if(d){f=Dh(a.a.map(m=>m.sa),e.map(m=>m.id));Eq(a,f.mh);const l=new Set(f.eg);f=e.filter(m=>l.has(m.id))}if(!Fq(a,f))return!1;const g=[],h=[],k=[];f.forEach(l=>{const m=l.customAttributes.CUE||[];m.includes(_.vb)?h.push(l):!d&&m.includes("PRE")?g.push(l):!c&&l.startTime<a.za.gh?g.push(l):k.push(l)});1<g.length?a.g.warn("Multiple preroll interstitials not supported. Will display only the 1st one."):g[0]&&Gq(a,g[0],b);k.forEach(l=>
251
+ Hq(a,l,1));1<h.length?a.g.warn("Multiple postroll interstitials not supported. Will display only the 1st one."):h[0]&&Hq(a,h[0],2);a.g.info("Interstitials changed",a.a);return 0<g.length};
252
+ Iq=function(a){_.w(function*(){var b=a.qa;Rp(b,[{id:pf,primary:!0,config:b.f.getConfiguration(),next:[]}]);var c=kq(b);if(!c)throw Error("Failed to find primary item");b.a=c;c.role=dq;c.player=b.f;c.videoEl=c.player.getSurface().getMedia();Pp(b,c.player,!0);b=a.f;c=b.getConfiguration();a.j=zq(a,!c.autoplay,b.isLive(),!1);if(a.j){if(b=a.qa,c=b.l,c=c.a[0]?c.a[0].player:null)Pp(b,b.f,!1),Pp(b,c,!0)}else c.autoplay&&(yield Qp(a.qa))})};
253
+ Dq=function(a){return a.f.getTimelineCues().filter(b=>b.schemeIdUri===_.vd&&b.customAttributes)};Eq=function(a,b){const c=new Set(b);a.a.forEach(d=>{c.has(d.sa)&&![wq,Jq].includes(d.state)&&a.g.warn("Removing an interstitial in active state",d)});a.a=a.a.filter(d=>!c.has(d.sa))};
254
+ Fq=function(a,b){const c=b.sort((g,h)=>g.startTime-h.startTime),d=a.za.resolutionOffsetSec,e=[];for(let g=0;g<c.length-1;g++){const h=c[g],k=c[g+1];k&&k.startTime-h.endTime<d&&e.push(`Interstitials ${h.id} and ${k.id} `+`are too close to each other (less than ${d} s).`);k&&k.startTime<=h.endTime&&e.push(`Interstitials ${h.id} and ${k.id} `+"overlap.")}const f=[];b.forEach(g=>{const h=g.customAttributes[_.$b],k=g.customAttributes[_.ac];g.customAttributes[_.Zb]||h?null!=k&&1>k&&a.g.warn(`Interstitial cue ${g.id} is invalid `+
255
+ "X-PLAYOUT-LIMIT is less than 1 s.",g):f.push(`Interstitial cue ${g.id} is invalid `+"it contains neither X-ASSET-LIST nor X-ASSET-URI.")});0<f.length?a.g.error("Invalid interstitials, all interstitials will "+`be skipped. ${f.join(" ")}`):0<e.length&&a.g.warn("Unsupported format of interstitials, playback may not "+`behave correctly. ${e.join(" ")}`);return 0===f.length};
256
+ Gq=function(a,b,c){_.w(function*(){const d=Hq(a,b,0),e=yield qq(a,d),f=d.Ha?d.Ha.length:0;e&&0<f?(rq(a,d,0,c),a.g.info(`Preroll interstitial ${d.sa} scheduled`)):(e?a.g.warn("Preroll interstitial has no assets, skipping"):a.g.error("Preroll interstitial failed, skipping"),c||(yield Qp(a.qa)))})};
257
+ Hq=function(a,b,c){{const d=b.customAttributes[_.bc];b={sa:b.id,startTime:b.startTime,endTime:b.endTime,state:wq,Se:b.customAttributes[_.Zb],Te:b.customAttributes[_.$b],Ha:null,Fa:null==d?null:b.startTime+d,oh:d,Gf:b.customAttributes[_.ac],ue:c}}a.a.push(b);return b};
258
+ qq=function(a,b){return _.w(function*(){b.state=Kq;if(b.Se)try{a.g.info(`Load X-ASSET-LIST for ${b.sa}`);a.cb(new _.C(ic));b.Ha=yield Lq(a,b.Se);b.Ha&&0!==b.Ha.length||a.g.info(`Interstitial ${b.sa} has no assets, `+"will be smoothly skipped");if(null==b.Fa){const c=bi(b.Ha.map(d=>d.DURATION));b.Fa=b.startTime+c}b.state=Mq;a.cb(new _.C(kc))}catch(c){a.g.error("Failed to load X-ASSET-LIST",c),b.state=Nq}else b.Te?(b.Ha=[{URI:b.Te,DURATION:b.endTime-b.startTime}],b.state=Mq):b.state=Nq;return b.state===
259
+ Mq})};rq=function(a,b,c,d){return _.w(function*(){if(a.qa.getCurrentItem()){var e=xq(a,b,c);yq(a,b,e);lq(a.qa,b.Fa);d?yield a.qa.load(e[0].id):yield a.qa.play(e[0].id)}})};tq=function(a,b){return a.a.find(c=>{const d=c.startTime-b;return 1===c.ue&&[wq,Jq].includes(c.state)&&0<d&&d<=a.za.resolutionOffsetSec})||null};
260
+ uq=function(a,b,c){if(b.Ha)if(0===b.Ha.length){const g=()=>{c.isLive()?a.g.info("Skipping empty "+`live interstitial ${b.sa}`):null!=b.Fa&&0!==b.oh?c.seek(b.Fa):a.g.info(`Empty VOD interstitial ${b.sa}, `+"continuing to next segment")};c.one(_.uh,g);a.h.push(()=>{c.off(_.uh,g)});a.g.info(`Interstitial ${b.sa} scheduled to `+"be skipped")}else{var d=a.qa.getCurrentItem();if(d){var e=xq(a,b,1),f=e[0].id;lq(a.qa,b.Fa);d.next=[f];d.transition={re:{position:b.startTime,itemId:f,Fa:b.Fa}};yq(a,b,e);a.g.info(`Interstitial ${b.sa} scheduled for `+
261
+ `${b.startTime} s`)}}};vq=function(a){return a.a.find(b=>2===b.ue)||null};Lq=function(a,b){return _.w(function*(){var c=a.qa.vd();if(!c)throw Error("No player found");c=c.getNetworkEngine();const d=_.Si(b);c=yield cj(c,d);if(!oq(c))throw new _.Jh("Invalid X-ASSET-LIST list response");return Promise.resolve(c.ASSETS)})};
262
+ xq=function(a,b,c){let d=0,e=b.Ha.map((g,h)=>{const k=`${b.sa}-${h}`;d+=g.DURATION;return{id:k,config:{source:{url:g.URI,type:_.Rk}},duration:g.DURATION,Oc:d,Rg:b.sa,next:[],Vb:new P(c,h+1,b.Ha.length,g.DURATION)}});e.forEach((g,h)=>{const k=h===e.length-1;k&&2===c||(k?(g.next=[pf],g.transition={pb:pf}):(h=k?pf:`${g.Rg}-${h+1}`,g.next=[h],g.transition={pb:h}))});e.forEach(g=>{g.Hd=()=>{a.g.info(`Playing interstitial asset ${g.id}`,g)}});if(null!=b.Gf){const g=b.Gf;a.g.info(`Playout limit for ${b.sa} is `+
263
+ `${g} s`);const h=e[e.length-1],k=g-(h.Oc-h.duration);0>=g?e=[]:g<h.Oc?(e=e.filter(l=>l.Oc-l.duration<=g),.1>Math.abs(k-h.duration)?h.transition.pb=pf:h.transition.re={position:k,itemId:pf}):g>h.Oc&&a.g.info(`Playout limit (${g}) is`+`larger than total duration: (${h.Oc})`)}const f=e[0].Hd;e[0].Hd=()=>{a.g.info(`Playing interstitial ${c} ${b.sa} with `+`${b.Ha.length} assets and will resume primary `+`content at ${b.Fa.toFixed(1)} s.`,e);f()};e[0].Cf=()=>{b.state=Oq};e[e.length-1].pb=()=>{b.state=
264
+ Jq;Sp(a.qa,e.map(g=>g.id))};return e};yq=function(a,b,c){Rp(a.qa,c);nq(a.qa);b.state=Pq;a.cb(new _.C(_.mc,{detail:null}))};Qq=function(a,b){a.onError(b);a.release().then(()=>a.destroy())};
265
+ Sq=function(a){var b=Rq;const c={kty:"RSA",n:b.n,e:b.e},d=a.h+"."+a.f,e=a.j;return new Promise(function(f,g){let h;try{h=window&&window.crypto&&window.crypto.subtle}catch(l){}if(h){var k={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};h.importKey("jwk",c,k,!1,["verify"]).then(function(l){const m=_.ri(d),n=_.Di(e);return h.verify(k,l,n.buffer,m.buffer)}).then(function(l){l?f():g(new _.Jh("Signature Verification failed",$f))}).catch(g)}else f()})};
266
+ Uq=function(a){if(!a.a){var b=a.f.split(".");if(3!==b.length)throw Error("Expected to find 3 data sections in JWT raw data");b=new Tq(b[0],b[1],b[2]);a.a=b}return a.a};Vq=function(a){return _.w(function*(){var b=Uq(a);try{yield Sq(b)}catch(c){if(c&&c.code===$f)throw c;{b=window.location.href;const d=new _.Mh(b);b=d.rb||d.Sa?d:new _.Mh("//"+b)}if(!/(^127\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)|(^localhost)/.test(b.Sa))throw c;}})};
267
+ Wq=function(a){switch((a.ea[0]||{src:"",type:""}).type){case _.Bc:a="dash";break;case _.Gc:a="ss";break;case _.Rk:a="hls";break;case _.qg:a="mp4";break;default:a=""}return a};Xq=function(a){return a.viewerId?a.viewerId:(a=a.drm||null)&&a.customData&&a.customData.userId?`${a.customData.userId}`:""};Yq=function(a){return(a=a.drm||null)&&a.customData&&a.customData.assetId?`${a.customData.assetId}`:""};
268
+ Zq=function(a){return(a=a.drm||null)&&a.customData&&a.customData.sessionId?`${a.customData.sessionId}`:""};$q=function(a){a=a.drmInfo;return(new _.Mh(a&&a.licenseServerUri||"")).Sa};ar=function(a){const b=a.configuration;let c="no";b.drm&&!_.Zg(b.drm,{})&&(c="custom",b.drm.env&&b.drm.env.toLowerCase().startsWith(Pd)||$q(a).endsWith("drmtoday.com"))&&(c=Pd);return c};br=function(a){a=a.drmInfo;let b="";if(a)switch(a.keySystem){case _.yd:b="wv";break;case _.wd:b="pr";break;case _.ud:b="fps"}return b};
269
+ cr=function(a){a=a.drmInfo;let b=!1;a&&(b=a.persistentStateRequired);return b.toString()};dr=function(a){a=a.drmInfo;let b="";if(a)switch(a.videoRobustness){case $a:case Xa:b="L1";break;case Ya:b="L2";break;case _.Gb:case _.Fb:b="L3"}return b};
270
+ hr=function(a,b){const c="ie"===_.yk().browser;var d=b.configuration;const e=[...Array.from(_.fl.keys()),...b.Hf];b={"CL-KEY":a.f,"CL-LOCATION":window.location.href,"CL-SDK-VERSION":_.da,"CL-USER-ID":Xq(d),"CL-ASSET-ID":Yq(d),"CL-SESSION-ID":Zq(d),"CL-PLAYBACK-TYPE":b.isLive?er:fr,"CL-CONTENT-TYPE":Wq(b),"CL-PLUGINS":e.join(" "),"CL-DRM":ar(b),"CL-DRM-CDM":br(b),"CL-DRM-SEC-LEVEL":dr(b),"CL-DRM-OFFLINE":cr(b),"CL-DRM-IP":$q(b)};c&&(d=window.localStorage.getItem("cl_et"))&&(b["CL-ETAG"]=d);d=_.Si(["https://downloads.castlabs.com/r/register/"]);
271
+ d.method="GET";d.headers=b;return(new _.gr).fetch(d).W.then(f=>{200===f.status&&c&&window.localStorage.setItem("cl_et",f.headers.etag);return Promise.resolve()}).catch(f=>{a:{var g=Uq(a);f=f.data;var h=f.status;if(g.a&&g.a.ilv)g=Promise.resolve();else{switch(h){case 403:case 404:g=7101;var k="castLabs Player license is invalid";if(403===h){h=k;k="";try{k=JSON.parse(decodeURIComponent(f.responseText)).message}catch(l){}f=k;f=h+(": "+f)}else f=k+"!";k=f;break;case 412:g=7103;k="License requires a viewer ID. It should be supplied either via the `viewerId` config or in case of DRMtoday via the `drm.customData.userID` config.";
272
+ break;default:g=Promise.resolve();break a}a.g.error(db+k);g=Promise.reject(new _.G(_.E,7,g,k))}}return g})};_.jr=function(a){a&&(0<=ir.indexOf(a)||ir.push(a))};lr=function(a){!a.h&&a.A&&a.a&&a.f.ads.hls.enable&&a.getTimelineCues().some(b=>b.schemeIdUri===_.vd)&&(a.h=new kr,a.h.w(a.a,a.A))};nr=function(a,b){a.F=new mr(b);Vq(a.F).catch(c=>{setTimeout(()=>{a.g.error(db+c);a.trigger(new _.C(_.Vd,{detail:new _.G(_.E,7,7101)}));a.destroy()},1E3)})};
273
+ pr=function(a,b){a.V=b;for(const c of a.V)(b=c.id())&&(a.J[b]=c);_.or(a,"onPlayerCreated")};_.qr=function(a,b,c){c=void 0===c?null:c;null!=b&&b===a.a?a.a.forwardEventsTo(a):(a.a&&(a.a.stopForwardingEventsTo(a),a.a.destroy(),a.a=null,a.A=null),b&&(b.init(a.j,a.C),b.setNetworkEngine(a.getNetworkEngine()),b.forwardEventsTo(a),a.a=b,a.A=c))};
274
+ rr=function(a,b){_.w(function*(){a.j.getMedia()||a.j.getCastElement();a.F||(a.F=new mr(a.f.license));try{a.g.debug("Verifying license remotely"),yield hr(a.F,b),a.g.debug("License verified remotely")}catch(c){a.g.debug("License rejected by remote",c),setTimeout(Qq,1E3,{release:a.release.bind(a),destroy:a.destroy.bind(a),onError:a.onError.bind(a)},c)}})};_.or=function(a,b,...c){if(!a.X)return Promise.resolve();const d=a.V.map(e=>e[b].call(e,a,...c)).filter(e=>e instanceof Promise);return Promise.all(d)};
275
+ sr=function(a){return _.w(function*(){if(a.O)return a.g.debug("The player is already released. No-op"),new Promise(b=>b());a.Y.off(document,ug);a.trigger(new _.C(_.uf));a.j&&a.j.release();a.h&&(yield a.h.h(),a.h=null);a.B&&(yield a.B.release(),a.B=null);if(a.a){let b=null;const c=a.a.on(_.Mf,d=>{b=d});return _.or(a,_.Je).then(()=>{a.a.stopForwardingEventsTo(a);return Promise.all([a.a.release(),a.H.release()])}).then(()=>{a.g.debug("Releasing player completed");b&&(a.g.debug("Re-post state change event after release"),
276
+ a.trigger(b))}).finally(()=>{a.a.off(_.Mf,c);a.trigger(new _.C(tf))})}a.trigger(new _.C(tf));return new Promise(b=>b())})};tr=function(a,b){const c=Wk(d=>d.f(_.ub)&&a.every(e=>2===d.canPlay(e,b)));if(!c)throw new _.G(_.E,7,7003,"No compatible player implementing playlist mode found!");return{ya:c,player:c.create(),sourceIndex:0}};
277
+ vr=function(a,b,c){if(a.L===_.ub)b=tr(b,c);else if(2!==(a.a?a.a.canPlay(b[0],c):0)||a.R){a.R=!1;if(b){var d=a=null;for(var e=0;e<b.length;e++);e=Object.values(_.Tk);for(let f=0;f<b.length;f++)for(let g=0;g<e.length;g++){const h={ya:e[g],confidence:e[g].canPlay(b[f],c)};if(null===a||a.confidence<h.confidence)a=h,d=f}a&&typeof d===_.r&&0<a.confidence?(_.Uk.debug("Player Factory '"+a.ya.a()+"' can play",b[d]),b=new ur(a.ya,d)):(_.Uk.debug("No compatible Player Factory found for sources:",b),b=null)}else b=
278
+ null;if(!b)throw new _.G(_.E,7,7003,"No player factory compatible with given sources found!");c=b.ya;a=c.create();b={ya:c,player:a,sourceIndex:b.sourceIndex}}else b={ya:a.A,player:a.a,sourceIndex:0};return b};
279
+ _.zr=function(a,b,c){return _.w(function*(){if(a.M)throw new _.G(_.E,7,7E3,"Player is already destroyed.");if(!a.j)throw new _.G(_.E,7,7E3,"No surface associated with this player!");_.Om(Ze);yield a.release();var d=c||_.jo(b);if(!b||0===d.length)throw new _.G(_.E,7,7003,nb);a.Z=d;a.f=_.dl(a.C,b,{source:d});a.O=!1;d=vr(a,d,a.f);_.qr(a,d.player,d.ya);a.a&&a.a.setSourceIndex(d.sourceIndex);wr(a);a.a&&a.a.setCdnErrorCallback(a.K);xr(a,a.f);yr(a);if(a.f.pauseWhenInBackground)a.Y.on(document,ug,()=>{document.hidden?
280
+ (a.g.debug("Player is hidden: pausing..."),a.pause()):(a.g.debug("Player is visible: resuming..."),a.play())});ml(a);yield _.or(a,"onContentWillLoad",a.f.source[d.sourceIndex]);_.Om(Ye);_.Pm("player.beforeLoad",Ze,Ye)})};_.Ar=function(a){return _.w(function*(){a.j.getMedia()||a.j.getCastElement();a.trigger(new _.C(te));yield Promise.all([a.a.load(a.f),a.h?a.h.load():Promise.resolve()])})};
281
+ _.Cr=function(a){return _.w(function*(){_.Om(Ve);rr(a,{configuration:a.getConfiguration(),ea:a.pf(),drmInfo:a.getDrmInfo(),Hf:Object.keys(a.J),isLive:a.isLive()});Br(a);nl();yield _.or(a,"onContentLoaded");a.f.autoplay&&(a.h?a.h.o():1)&&(yield a.play());_.Om(Ue);_.Pm("player.afterLoad",Ve,Ue)})};Dr=function(a){return _.w(function*(){if(a.a){var b=a.a;b.Qf?(a.trigger(new _.C(te)),yield b.Qf(),yield _.Cr(a)):a.g.warn(Ab)}else a.g.warn(xb)})};
282
+ wr=function(a){a.a&&a.a.setDrmCustomDataModifier(b=>_.w(function*(){a.zc&&a.Wd&&(a.Wd=!1,yield a.zc(b))}))};xr=function(a,b){if(b=zo(a,b))a.h=b.create(a)};yr=function(a){a.B=new Er(a);a.a.setCmsdManager(a.B)};
283
+ Fr=function(a){const b=_.yh(a.f.preferredTextLanguage).filter(f=>f),c=a.f.preferForcedSubtitles,d=a.getTrackManager().ha().filter(f=>c?f.kind===_.Xd:f.kind!==_.Xd);if(0===d.length)c&&a.g.warn("Forced subtitles are configured to be preferred, but no forced subtitles are available.");else{if(c&&0===b.length){var e=a.getTrackManager().la();e&&e.language?(e=_.$h(e.language||""),b.push(e)):(e=a.getTrackManager().La())&&e.language&&(e=_.$h(e.language||""),b.push(e));0===b.length&&a.g.warn("Forced subtitles are configured to be preferred, but neither the preferred text language is set, nor the audio or video track language is available to determine which forced subtitles language to select.")}b.some(f=>
284
+ {const g=_.$h(f);if(f=d.find(h=>{h=_.$h(h.language||"");return _.ai(h,g)}))return a.getTrackManager().Na(f),!0;c&&a.g.warn("Forced subtitles are configured to be preferred, but no forced subtitles match the preferred languages: ",b);return!1})}};Br=function(a){_.w(function*(){const b=[];if(a.f.remoteTextTracks)for(const c of a.f.remoteTextTracks)b.push(a.getTrackManager().addTextTrack(c));yield Promise.all(b);Fr(a)})};
285
+ Gr=function(a,b){a.size=void 0===b?0:1;a.g.debug("Setting key status to",b);a.a=b};
286
+ Jr=function(a,b){a.a=b;_.nh(a.f);b&&(a.f.on(b,a.h+"needkey",c=>{{const d=new Event(Sd);d.initDataType=_.bd;d.initData=li(c.initData);a.a.dispatchEvent(d)}}),a.f.on(b,a.h+"keymessage",c=>{{const e=Hr(a,c.sessionId);if(e){var d=void 0===e.keyStatuses.getStatus();c=new _.C(_.xe,{messageType:d?ie:he,message:c.message});d=e;_.kh("WebkitEmeManager.MediaKeySession.generated");d.f&&(d.f.resolve(),d.f=null);e.dispatchEvent(c)}else _.lh("Session not found",c.sessionId)}}),a.f.on(b,a.h+"keyadded",c=>{(c=Hr(a,
287
+ c.sessionId))&&c.ready()}),a.f.on(b,a.h+"keyerror",c=>{var d=Hr(a,c.sessionId);if(d){{var e=Error("EME v0.1b key error");const f=c.errorCode;f.systemCode=c.systemCode;e.errorCode=f;!c.sessionId&&d.f?(45===c.systemCode&&(e.message="Unsupported session type."),d.f.reject(e),d.f=null):c.sessionId&&d.a?(d.a.reject(e),d.a=null):(e=c.systemCode,c.errorCode.code===MediaKeyError.MEDIA_KEYERR_OUTPUT?Ir(d,_.Oe):1===e?Ir(d,"expired"):Ir(d,_.ee))}}}))};
288
+ Hr=function(a,b){let c=a.l.get(b);return c?c:(c=a.j.shift())?(c.sessionId=b,a.l.set(b,c),c):null};Ir=function(a,b){Gr(a.keyStatuses,b);b=new _.C(fe);a.dispatchEvent(b)};Kr=function(a,b){return a.w?a.w+b.charAt(0).toUpperCase()+b.slice(1):b};
289
+ Lr=function(a,b,c){if(a.o)return Promise.reject(Error("The session is already initialized."));a.o=!0;let d;try{if(a.l===_.Re)if(c)d=_.I(_.ri("LOAD_SESSION|"+c));else{const f=_.ri("PERSISTENT|"),g=new Uint8Array(f.byteLength+b.byteLength);g.set(f,0);g.set(_.I(b),f.byteLength);d=g}else d=_.I(b)}catch(f){return Promise.reject(f)}a.f=new _.ln;const e=Kr(a,"generateKeyRequest");try{a.j[e](a.h,d)}catch(f){if(f.name!==bb)return a.f=null,Promise.reject(f);(new _.Wj(()=>{try{a.j[e](a.h,d)}catch(g){a.f.reject(g),
290
+ a.f=null}})).fa(.01)}return a.f};Mr=function(a,b,c){if(a.a)a.a.then(()=>Mr(a,b,c)).catch(()=>Mr(a,b,c));else{a.a=b;if(a.h===yg){var d=_.ni(c);var e=JSON.parse(d);"oct"!==e.keys[0].kty&&(a.a.reject(Error("Response is not a valid JSON Web Key Set.")),a.a=null);d=_.Di(e.keys[0].k);e=_.Di(e.keys[0].kid)}else d=_.I(c),e=null;var f=Kr(a,"addKey");try{a.j[f](a.h,d,e,a.sessionId)}catch(g){a.a.reject(g),a.a=null}}};
291
+ Qr=function(a,b){a.f=b;_.nh(a.a);if(!b)return Promise.resolve();a.a.on(b,Sd,c=>{_.kh("AppleEmeManager.cancelNativeMediaEncryptedEvent_",c);"MediaEncryptedEvent"in window&&c instanceof MediaEncryptedEvent&&(a.g.info("Cancel native MediaEncryptedEvent when using Apple-prefixed EME"),c.stopImmediatePropagation())});a.a.on(b,Cg,c=>{{a.g.debug("Handle webkitNeedKey event");c=_.I(c.initData);if(_.ki(c).getUint32(0,!0)+4!==c.byteLength)throw new RangeError("Malformed FairPlay init data");c=pi(c.subarray(4),
292
+ !0);c=_.ri(c);const d=new Event(Sd);d.initDataType="skd";d.initData=li(c);a.f.dispatchEvent(d)}});Sn(b,HTMLMediaElement.HAVE_METADATA,a.a,()=>b.webkitSetMediaKeys(a.h));return Promise.resolve()};Rr=function(a,b){Gr(a.keyStatuses,b);b=new _.C(fe);a.dispatchEvent(b)};_.Tr=function(a){if(Sr.has(a))return Sr.get(a);if(window.ManagedMediaSource){var b=ManagedMediaSource.isTypeSupported(a);Sr.set(a,b);return b}return window.MediaSource?(b=MediaSource.isTypeSupported(a),Sr.set(a,b),b):!1};
293
+ Ur=function(a,b){b=b.replace(/mp2t/i,"mp4");a===_.p&&(b=b.replace(_.t,_.p));if(a=/avc1\.(66|77|100)\.(\d+)/.exec(b)){let d="avc1.";var c=a[1];d="66"===c?d+"4200":"77"===c?d+"4d00":d+"6400";c=Number(a[2]);d+=(c>>4).toString(16);d+=(c&15).toString(16);b=b.replace(a[0],d)}return b};_.Vr=function(a){const b=[];for(const c of a)for(const d of c.variants)b.push(d);return b};
294
+ _.$r=function(a){if(!a.w)return null;const b=a.H;switch(a.w){case Wr:return`-2px -2px 0 ${b}, -1px -1px 0 ${b}`;case Xr:return`2px 2px 0 ${b}, 1px 1px 0 ${b}`;case Yr:return`-1px 0 ${b}, 0 1px ${b}, 1px 0 ${b}, `+`0 -1px ${b}`;case Zr:return`2px 2px 3px ${b}, 2px 2px 4px ${b}, `+`2px 2px 5px ${b}`;default:return _.Ee}};_.bs=function(a,b){a=_.Qj(_.Rj(a),_.Sj(a));_.as[a]=b};_.cs=function(a){a=_.Qj(_.Rj(a),_.Sj(a));return _.as[a]||null};_.ds=function(a){a=_.Qj(_.Rj(a),_.Sj(a));delete _.as[a]};
295
+ es=function(a,b){const c=document.getElementById(a);if(!c)throw Error("Anchor element not found");c.classList.add(id);return Array.from({length:3}).map(()=>{const d=document.createElement(_.t);d.classList.add("clpp-mc-playlist-video-el");const e=document.createElement(_.Fd);e.classList.add("clpp-mc-playlist-item");e.appendChild(d);c.appendChild(e);return new Q(d,b)})};
296
+ fs=function(a,b,c){const d=b.getSurface().getMedia();b=b.getSurface().getUniqueCssClass();d&&(c?(a.g.info(`Show video element .${b}`),d.classList.add(jd)):(a.g.info(`Hide video element .${b}`),d.classList.remove(jd)),a.w&&a.w(d,c))};is=function(a,b){return _.w(function*(){const c=yield a.o.get();a.f=b;b.role=gs;a.f.player=c;a.f.videoEl=c.getSurface().getMedia();fs(a,c,!0);yield c.load(b.config);hs(a,b);b.config.autoplay||(yield c.play())})};
297
+ ms=function(a){_.w(function*(){if(0===a.a)yield js(a);else if(a.a===a.h.length-1)yield ks(a);else{const b=[a.a-1,a.a+1];a.g.info(`Preload items (indices: ${b})`);yield Promise.all(b.map(c=>ls(a,c)))}})};
298
+ ns=function(a,b){return _.w(function*(){if(b.player){if(b.state===nf){a.g.info(Vb);try{yield b.preloadPromise}catch(c){}}a.f=b;b.role=gs;fs(a,b.player,!0);b.state===mf?(_.Om(jf),a.za.preloadMedia?yield b.player.play():yield Dr(b.player),_.Om(hf),_.Pm("playlist.next",jf,hf)):b.state===lf&&(yield b.player.load(b.config));hs(a,b);b.config.autoplay||(yield b.player.play())}})};
299
+ qs=function(a,b){return _.w(function*(){a.g.info(`Stop current playback (index: ${b.index})`);b.player.pause();fs(a,b.player,!1);yield os(a,b);b.player=null;b.videoEl=null;b.role=ps})};ss=function(a){return Promise.all(Array.from(a.l.keys()).map(b=>rs(a,b)))};ts=function(a){return _.w(function*(){yield a.o.destroy();const b=document.getElementById(a.za.anchorId);b&&(b.classList.remove(id),b.innerHTML="")})};
300
+ rs=function(a,b){return _.w(function*(){const c=a.l.get(b);c&&(a.g.info(`Stop preloading item (index: ${b})`),c.player&&(yield os(a,c)),a.l.delete(b))})};os=function(a,b){return _.w(function*(){b.disposers.forEach(c=>c());b.disposers=[];b.player&&(yield a.o.release(b.player))})};hs=function(a,b){if(a.za.autoplayNext){const c=()=>{a.g.info("Automatically transition to next item");a.Ff()};b.player.on(_.Ud,c);const d=b.player;b.disposers.push(()=>{d.off(_.Ud,c)})}};
301
+ ls=function(a,b){return _.w(function*(){const c=yield a.o.get(),d=a.h[b];d.player=c;d.videoEl=c.getSurface().getMedia();d.role=ps;d.state=nf;a.trigger(new _.C(cg));try{a.l.set(b,d),a.za.preloadMedia?(d.config.autoplay&&(a.g.warn(la+`Force disabling autoplay (index: ${b})`),d.config.autoplay=!1),d.preloadPromise=c.load(d.config)):d.preloadPromise=c.preload(d.config),yield d.preloadPromise,d.state=mf,a.trigger(new _.C(cg))}catch(e){7001===e.code?(a.g.info(`Preload aborted (index: ${b})`),d.state=kf):
302
+ (a.g.warn(`Preload failed (index: ${b})`,e),a.trigger(new _.C(_.Vd,{detail:e})),d.state=lf),a.trigger(new _.C(cg))}})};js=function(a){return _.w(function*(){const b=a.a+1;a.g.info(`Preload following item (index: ${b})`);yield ls(a,b)})};ks=function(a){return _.w(function*(){const b=a.a-1;a.g.info(`Preload preceding item (index: ${b})`);yield ls(a,b)})};us=function(a){a.I.forEach(b=>b());a.I=[]};
303
+ xs=function(a,b){return _.w(function*(){try{_.Om(cf);a.L=_.ub;a.X=!1;const c=b.slice(1).map(d=>({config:d,ea:_.jo(d)}));yield _.zr(a,b[0]);c.forEach(d=>{vs(a,d.config,d.ea)});a.trigger(new _.C(te));yield a.a.setupPlaylist(b);yield _.Cr(a);c.forEach(d=>{ws(a,d.config,d.ea)});_.Om(bf);_.Pm("player.setupPlaylist",cf,bf)}catch(c){if(a.l)throw a.g.info(eb),new _.G(_.E,7,7E3);throw c;}})};
304
+ ys=function(a,b){const c=d=>{a.G=a.o.findIndex(e=>e.id===d.id)};a.addEventListener(_.Af,c);a.I.push(()=>{a.removeEventListener(_.Af,c)});if(b.endTime){const d=b.endTime,e=()=>{a.getPosition()>=d&&(a.removeEventListener(_.Xf,e),a.g.info("Playlist end time reached. Stopping playback."),a.trigger(new _.C(_.zf)),a.pause())};a.addEventListener(_.Xf,e);a.I.push(()=>{a.removeEventListener(_.Xf,e)})}};
305
+ zs=function(a,b){return _.w(function*(){try{_.Om(Xe);const c=_.jo(b);vs(a,b,c);yield a.a.appendLoad(b);ws(a,b,c);_.Om(We);_.Pm("player.appendLoad",Xe,We)}catch(c){if(a.l)throw a.g.info(eb),new _.G(_.E,7,7E3,{id:b.id});throw c;}})};
306
+ vs=function(a,b,c){if(0===c.length)throw new _.G(_.E,7,7003,{message:nb,id:b.id});if(1<c.length)throw new _.G(_.E,7,7003,{message:"Multiple sources not supported!",id:b.id,source:c});if(2!==(a.a?a.a.canPlay(c[0],a.f):0))throw new _.G(_.E,7,7003,{message:"Source not supported by the current player!",id:b.id,source:c[0]});};ws=function(a,b,c){rr(a,{configuration:b,ea:c,drmInfo:a.getDrmInfo(),Hf:Object.keys(a.J),isLive:c[0].isLive})};
307
+ Kg="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this;Lg=typeof Object.defineProperties==_.Zd?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};
308
+ Mg("Promise",function(a){function b(g){this.f=0;this.l=void 0;this.a=[];var h=this.j();try{g(h.resolve,h.reject)}catch(k){h.reject(k)}}function c(){this.a=null}function d(g){return g instanceof b?g:new b(function(h){h(g)})}if(a)return a;c.prototype.f=function(g){if(null==this.a){this.a=[];var h=this;this.h(function(){h.l()})}this.a.push(g)};var e=Kg.setTimeout;c.prototype.h=function(g){e(g,0)};c.prototype.l=function(){for(;this.a&&this.a.length;){var g=this.a;this.a=[];for(var h=0;h<g.length;++h){var k=
309
+ g[h];g[h]=null;try{k()}catch(l){this.j(l)}}}this.a=null};c.prototype.j=function(g){this.h(function(){throw g;})};b.prototype.j=function(){function g(l){return function(m){k||(k=!0,l.call(h,m))}}var h=this,k=!1;return{resolve:g(this.C),reject:g(this.h)}};b.prototype.C=function(g){if(g===this)this.h(new TypeError("A Promise cannot resolve to itself"));else if(g instanceof b)this.F(g);else{a:switch(typeof g){case _.Fe:var h=null!=g;break a;case _.Zd:h=!0;break a;default:h=!1}h?this.B(g):this.o(g)}};
310
+ b.prototype.B=function(g){var h=void 0;try{h=g.then}catch(k){this.h(k);return}typeof h==_.Zd?this.G(h,g):this.o(g)};b.prototype.h=function(g){this.w(2,g)};b.prototype.o=function(g){this.w(1,g)};b.prototype.w=function(g,h){if(0!=this.f)throw Error("Cannot settle("+g+", "+h+"): Promise already settled in state"+this.f);this.f=g;this.l=h;this.A()};b.prototype.A=function(){if(null!=this.a){for(var g=0;g<this.a.length;++g)f.f(this.a[g]);this.a=null}};var f=new c;b.prototype.F=function(g){var h=this.j();
311
+ g.nd(h.resolve,h.reject)};b.prototype.G=function(g,h){var k=this.j();try{g.call(h,k.resolve,k.reject)}catch(l){k.reject(l)}};b.prototype.then=function(g,h){function k(q,u){return typeof q==_.Zd?function(v){try{l(q(v))}catch(y){m(y)}}:u}var l,m,n=new b(function(q,u){l=q;m=u});this.nd(k(g,l),k(h,m));return n};b.prototype.catch=function(g){return this.then(void 0,g)};b.prototype.nd=function(g,h){function k(){switch(l.f){case 1:g(l.l);break;case 2:h(l.l);break;default:throw Error("Unexpected state: "+
312
+ l.f);}}var l=this;null==this.a?f.f(k):this.a.push(k)};b.resolve=d;b.reject=function(g){return new b(function(h,k){k(g)})};b.race=function(g){return new b(function(h,k){for(var l=Jg(g),m=l.next();!m.done;m=l.next())d(m.value).nd(h,k)})};b.all=function(g){var h=Jg(g),k=h.next();return k.done?d([]):new b(function(l,m){function n(v){return function(y){q[v]=y;u--;0==u&&l(q)}}var q=[],u=0;do q.push(void 0),u++,d(k.value).nd(n(q.length-1),m),k=h.next();while(!k.done)})};return b});var Og=this||self;
313
+ Og.a=!0;_.x("clpp.utils.obj.cloneItem",_.Rg);_.x("clpp.utils.obj.merge",_.Qg);var gh={DEFAULT:-1,NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4};_.x("clpp.log.Level",gh);var eh=3,dh={},As=[];_.x("clpp.log.getLoggers",function(){return _.Rg(dh)});_.x("clpp.log.addInterceptor",function(a){a&&As.push(a)});_.x("clpp.log.removeInterceptor",function(a){a&&(a=As.indexOf(a),0<=a&&As.splice(a,1))});_.x("clpp.log.getTagLevel",fh);_.x("clpp.log.hasTagLevel",function(a){return void 0===a?!1:0<=dh[a]});_.x("clpp.log.setTagLevel",function(a,b){a&&(_.Xg(b)&&(b=hh(b)),dh[a]=b)});
314
+ _.x("clpp.log.setLogLevel",function(a){-1===a&&(a=3);_.Xg(a)&&(a=hh(a));eh=a});_.x("clpp.log.getLogLevel",function(){return eh});
315
+ _.R=class{constructor(a){(this.tag=a)&&void 0===dh[a]&&(dh[a]=-1)}log(a,b){if(window.console){if(1<arguments.length){var c=arguments[0];Array.prototype.shift.call(arguments)}else c=3;var d=fh(this.tag);if(0<=d){if(d<c)return}else if(eh<c)return;this.tag&&Array.prototype.unshift.call(arguments,"["+this.tag+"]");d=new Date;d.toISOString&&(d=d.toISOString().substring(11).replace("Z",""),Array.prototype.unshift.call(arguments,d));4===c?console.log.apply(console,arguments):3===c?console.info.apply(console,
316
+ arguments):2===c?console.warn.apply(console,arguments):1===c?console.error.apply(console,arguments):console.log.apply(console,arguments);for(const e of As)e.call(e,c,arguments)}}info(a){Array.prototype.unshift.call(arguments,3);this.log.apply(this,arguments)}debug(a){Array.prototype.unshift.call(arguments,4);this.log.apply(this,arguments)}warn(a){Array.prototype.unshift.call(arguments,2);this.log.apply(this,arguments)}error(a){Array.prototype.unshift.call(arguments,1);this.log.apply(this,arguments)}pg(a){return a?
317
+ this.tag?new _.R(this.tag+"."+a):new _.R(a):this}};_.x("clpp.log.Logger",_.R);_.R.prototype.createChild=_.R.prototype.pg;_.R.prototype.error=_.R.prototype.error;_.R.prototype.warn=_.R.prototype.warn;_.R.prototype.debug=_.R.prototype.debug;_.R.prototype.info=_.R.prototype.info;_.R.prototype.log=_.R.prototype.log;var ih=new _.R("clpp");_.x("clpp.log.info",_.jh);_.x("clpp.log.debug",_.kh);_.x("clpp.log.warn",_.B);_.x("clpp.log.error",_.lh);_.Bs=class{constructor(){this.a={}}push(a,b){a in this.a?this.a[a].push(b):this.a[a]=[b]}get(a){return(a=this.a[a])?a.slice():[]}remove(a,b){a=this.a[a];if(!a)return!1;let c=!1;for(let d=0;d<a.length;++d)a[d]===b&&(a.splice(d,1),--d,c=!0);return c}clear(){this.a={}}};(function(){const a=console.assert;a?a.bind||(console.assert=function(){a.apply(console,arguments)}):console.assert=function(){}})();var Cs,Ds;Cs=class{constructor(a,b,c,d){this.f=a;this.vc=b;this.a=c;this.lh=!!d}cb(a){try{this.vc.handleEvent?this.vc.handleEvent(a):this.vc.call(this.a,a)}catch(b){_.lh("clpp","Uncaught exception in event handler for event '"+this.f+"'",b,b?b.message:null,b?b.stack:null)}}};
318
+ _.C=class{constructor(a,b){if(b)for(const c in b)this[c]=b[c];this.defaultPrevented=this.cancelable=this.bubbles=!1;this.timeStamp=window.performance&&window.performance.now?window.performance.now():Date.now();this.type=a;this.isTrusted=!1;this.target=this.currentTarget=null;this.f=this.a=!1}preventDefault(){this.cancelable&&(this.defaultPrevented=!0)}stopImmediatePropagation(){this.f=!0}stopPropagation(){}};
319
+ Ds=class{constructor(a){this.a=new _.Bs;this.f=a}trigger(a){const b=this.a.get(a.type);if(b)for(let c=0;c<b.length&&(a.target=this.f,a.currentTarget=this.f,b[c].cb(a),b[c].lh&&this.a.remove(a.type,b[c]),!a||!a.f);c++);}on(a,b,c){this.a.push(a,new Cs(a,b,c||this.f));return b}one(a,b,c){this.a.push(a,new Cs(a,b,c||this.f,!0));return b}off(a,b){const c=this.a.get(a);let d=!1;if(c)for(let e=0;e<c.length;e++)c[e].vc===b&&(d=this.a.remove(a,c[e])||d);return d}clear(){this.a.clear()}};var Es;_.Fs=class{constructor(){this.a=new _.Bs}release(){_.nh(this)}on(a,b,c,d=!1){a=new Es(a,b,c,d);this.a.push(b,a)}one(a,b,c){const d=e=>{this.off(a,b,d);return c(e)};this.on(a,b,d)}off(a,b,c){const d=this.a.get(b)||[];for(let e=0;e<d.length;++e){const f=d[e];f.target!==a||c!==f.a&&c||(mh(f),this.a.remove(b,f))}}};Es=class{constructor(a,b,c,d){this.target=a;this.type=b;this.a=c;this.f=d;this.target.addEventListener(b,c,d)}};var Gs=class{constructor(a){this.m=a;this.o=a.getConfiguration().streaming.addMissingTimelineCues||!1;this.j=null;this.f=new _.Fs;this.a=this.l=null;this.h=[];this.g=new _.R("clpp.native.Metadata")}release(){this.f.release();this.h=[];this.a=null}destroy(){const a=this;return _.w(function*(){a.release();a.l=null;a.j=null})}getTimelineCues(){return this.h}};_.G=class extends Error{constructor(a,b,c,d,e){super(Eh(a,b,c,d));this.severity=a;this.category=b;this.code=c;this.data=!d||_.Xg(d)?{}:d;this.cause=void 0===e?null:e;this.f=!1;Error.captureStackTrace&&Error.captureStackTrace(this,_.G)}a(a){this.severity!==a&&(this.severity=a,this.message=Eh(this.severity,this.category,this.code,this.data))}toString(){let a=this.message;this.cause&&(a+=`\n Caused by ${this.cause}`);return a}};_.x("clpp.Error",_.G);_.E=2;_.G.Severity={RECOVERABLE:1,FATAL:_.E};
320
+ _.G.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,PLUGIN:9,ADS:10};
321
+ _.G.Code={UNSUPPORTED_SCHEME:1E3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,UNKNOWN_DATA_URI_ENCODING:1005,REQUEST_MODIFIER_ERROR:1006,RESPONSE_MODIFIER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,ATTEMPTS_EXHAUSTED:1010,INVALID_TEXT_HEADER:2E3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,UNABLE_TO_EXTRACT_CUE_START_TIME:2009,FETCH_OR_APPEND_ERROR:2010,INVALID_MP4:2011,
323
322
  TEXT_PARSER_MISSING:2012,THUMBNAILS_FAILED_TO_LOAD:2013,THUMBNAIL_ERROR:2014,BUFFER_READ_OUT_OF_BOUNDS:3E3,JS_INTEGER_OVERFLOW:3001,EBML_OVERFLOW:3002,EBML_BAD_FLOATING_POINT_SIZE:3003,MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005,MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,
324
- MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,TRANSMUXING_FAILED:3018,MP4_PARSER_ERROR:3019,MEDIA_LOAD_ERROR:3100,INVALID_TRACK_TYPE:3101,UNKNOWN_TRACK:3102,MEDIA_DECRYPTION_ERROR:3103,PLAY_NOT_ALLOWED:3200,UNABLE_TO_GUESS_MANIFEST_TYPE:4E3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,DASH_WEBM_MISSING_INIT:4005,DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,DASH_NO_COMMON_KEY_SYSTEM:4008,
325
- DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,UNPLAYABLE_PERIOD:4011,RESTRICTIONS_CANNOT_BE_MET:4012,NO_PERIODS:4014,HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020,HLS_COULD_NOT_GUESS_MIME_TYPE:4021,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,DASH_UNSUPPORTED_XLINK_ACTUATE:4027,
326
- DASH_XLINK_DEPTH_LIMIT:4028,HLS_COULD_NOT_PARSE_SEGMENT_START_TIME:4030,CONTENT_UNSUPPORTED_BY_BROWSER:4032,SMOOTH_INVALID_MANIFEST_XML:4033,SMOOTH_EMPTY_PRESENTATION:4034,SMOOTH_MEDIA_PROCESSING_ERROR:4035,SMOOTH_INVALID_VERSION:4036,SMOOTH_INVALID_FRAGMENT_METADATA:4037,SMOOTH_REQUIRED_ATTRIBUTE_MISSING:4038,SMOOTH_TRUNCATED_MEDIA_FILE:4039,CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM:4040,HLS_MSE_ENCRYPTED_TS_NOT_SUPPORTED:4041,HLS_PLAYLIST_NOT_UTF8:4042,HLS_PLAYLIST_EMPTY:4043,HLS_INVALID_VALUE:4044,
327
- HLS_DISCONTINUITY_NOT_SUPPORTED:4045,HLS_UNSUPPORTED_FEATURE:4046,HLS_INCOMPATIBLE_PLAYLIST_UPDATE:4047,INVALID_STREAMS_CHOSEN:5005,NO_RECOGNIZED_KEY_SYSTEMS:6E3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,
328
- EXPIRED:6014,REQUESTED_DRM_ENVIRONMENT_UNAVAILABLE:6015,INIT_DATA_TRANSFORM_ERROR:6016,CERTIFICATE_REQUEST_FAILED:6100,NO_CONTENT_ID:6101,SERVER_CERTIFICATE_REQUIRED:6102,EXTRACT_CONTENT_ID_MODIFIER_ERROR:6103,FAILED_TO_PERSIST_SESSION:6200,FAILED_TO_REMOVE_SESSION:6201,INVALID_SESSION_STORAGE_IMPLEMENTATION:6202,LOAD_INTERRUPTED:7E3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,CANNOT_LOAD_SOURCE:7003,MEDIA_ELEMENT_NOT_FOUND:7004,INVALID_MEDIA_ELEMENT:7005,INVALID_CONTAINER_ELEMENT:7006,INVALID_ARGUMENT:7007,
329
- WRONG_ORDER_OF_OPERATIONS:7008,NOT_SUPPORTED:7009,INVALID_CONFIGURATION:7100,INVALID_LICENSE:7101,NO_ELEMENT:7102,USER_ID_NOT_PROVIDED:7103,KEY_LOAD_ERROR:7104,TIZEN_INTERNAL_ERROR:7200,CAF_INTERNAL_ERROR:7300,INTERNAL_CAST_ERROR:8E3,CAST_API_NOT_READY:8001,NO_RECEIVERS_AVAILABLE:8002,ALREADY_CASTING:8003,NO_CAST_SESSION:8004,CONVIVA_SDK_NOT_LOADED:9E3,CONVIVA_INVALID_CONFIGURATION:9001,CONVIVA_RUNTIME_ERROR:9002,GL_CONTEXT_ERROR:9003,GL_SHADER_ERROR:9004,YOUBORA_SDK_MISSING:9100,YOUBORA_INVALID_CONFIGURATION:9101,
330
- YOUBORA_SDK_VERSION_NOT_SUPPORTED:9102,VIMOND_INVALID_CONFIGURATION:9200,VIMOND_SESSION_ERROR:9201,MUXDATA_INVALID_CONFIGURATION:9300,MUX_SDK_MISSING:9301,MUXDATA_INIT_ERROR:9302,IMA_SDK_MISSING:1E4,IMA_INVALID_CONFIGURATION:10001,IMA_UNSUPPORTED_PLATFORM:10002,AD_ERROR:10003,SIMID_CONTAINER_MISSING:10100,BROADPEAK_SDK_MISSING:11E3,BROADPEAK_SESSION_ERROR:11001,FREEWHEEL_SDK_MISSING:12E3,FREEWHEEL_INVALID_CONFIGURATION:12001,CONTENT_TRANSFORMATION_FAILED:14E3,SESSIONS_INVALID_CONFIGURATION:15E3};
331
- _.Jh=class extends Error{constructor(a,b){super(a);this.code=b}};var Th=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;Gg=_.Mh.prototype;Gg.gb="";Gg.qc="";Gg.Pa="";Gg.Hc=null;Gg.Da="";Gg.fc="";Gg.toString=function(){var a=[],b=this.gb;b&&a.push(Wh(b,Is,!0),":");if(b=this.Pa){a.push("//");var c=this.qc;c&&a.push(Wh(c,Is,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.Hc;null!=b&&a.push(":",String(b))}if(b=this.Da)this.Pa&&"/"!=b.charAt(0)&&a.push("/"),a.push(Wh(b,"/"==b.charAt(0)?Js:Ks,!0));(b=this.a.toString())&&a.push("?",b);(b=this.fc)&&a.push("#",Wh(b,Ls));return a.join("")};
332
- Gg.resolve=function(a){var b=new _.Mh(this);"data"===b.gb&&(b=new _.Mh);var c=!!a.gb;c?Nh(b,a.gb):c=!!a.qc;c?b.qc=a.qc:c=!!a.Pa;c?b.Pa=a.Pa:c=null!=a.Hc;var d=a.Da;if(c)Oh(b,a.Hc);else if(c=!!a.Da){if("/"!=d.charAt(0))if(this.Pa&&!this.Da)d="/"+d;else{var e=b.Da.lastIndexOf("/");-1!=e&&(d=b.Da.substr(0,e+1)+d)}if(".."==d||"."==d)d="";else if(-1!=d.indexOf("./")||-1!=d.indexOf("/.")){e=0==d.lastIndexOf("/",0);d=d.split("/");for(var f=[],g=0;g<d.length;){var h=d[g++];"."==h?e&&g==d.length&&f.push(""):
333
- ".."==h?((1<f.length||1==f.length&&""!=f[0])&&f.pop(),e&&g==d.length&&f.push("")):(f.push(h),e=!0)}d=f.join("/")}}c?b.Da=d:c=""!==a.a.toString();c?_.Rh(b,Sh(a.a)):c=!!a.fc;c&&(b.fc=a.fc);return b};var Is=/[#\/\?@]/g,Ks=/[#\?:]/g,Js=/[#\?]/g,Xh=/[#\?@]/g,Ls=/#/g;_.Vh.prototype.a=null;_.Vh.prototype.h=null;
334
- _.Vh.prototype.add=function(a,b){if(!this.a&&(this.a={},this.h=0,this.f))for(var c=this.f.split("\x26"),d=0;d<c.length;d++){var e=c[d].indexOf("\x3d"),f=null;if(0<=e){var g=c[d].substring(0,e);f=c[d].substring(e+1)}else g=c[d];g=decodeURIComponent(g.replace(/\+/g," "));f=f||"";this.add(g,decodeURIComponent(f.replace(/\+/g," ")))}this.f=null;(c=this.a.hasOwnProperty(a)&&this.a[a])||(this.a[a]=c=[]);c.push(b);null!==this.h&&this.h++;return this};
335
- _.Vh.prototype.toString=function(){if(this.f)return this.f;if(!this.a)return"";var a=[],b;for(b in this.a)for(var c=encodeURIComponent(b),d=this.a[b],e=0;e<d.length;e++){var f=c;""!==d[e]&&(f+="\x3d"+encodeURIComponent(d[e]));a.push(f)}return this.f=a.join("\x26")};var Zh;_.G="text";_.Ms=1/15;Zh={audio:[/^vorbis$/,/^Opus$/,/^opus$/,/^fLaC$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4/,/^dts[cex]$/,/^iamf/,/^mhm[12]/],video:[/^avc/,/^hev/,/^hvc/,/^vvc/,/^vvi/,/^vp0?[89]/,/^av01/,/^dvh/,/^dva/,/^dav/]};Zh[_.G]=[/^vtt$/,/^wvtt/,/^stpp/];var Ns;Ns={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av0?1/],text:[/^vtt$/,/^wvtt/,/^stpp/]};_.zj=(a,b)=>{const c=Ns[a];for(let d=0;d<c.length;d++)for(let e=0;e<b.length;e++)if(c[d].test(b[e].trim()))return b[e].trim();return a===_.G?"":null};_.Os={text:{mp4:Ac,m4s:Ac,m4i:Ac,cmft:Ac,vtt:_.Vf,ttml:_.Dc},video:{mp4:_.mg,m4s:_.mg,m4i:_.mg,m4v:_.mg,cmfv:_.mg,ts:_.lg},audio:{mp4:_.Jc,m4s:_.Jc,m4i:_.Jc,m4a:_.Jc,cmfa:_.Jc,ts:_.lg,aac:_.Gc,ec3:_.Ic,ac3:_.Hc},image:{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"}};_.Cj=(a,b,c)=>a.map(d=>{d=_.Ps(d)||"";return d=(d=_.Os[b][d])?d:b===_.G?c&&"vtt"!==c?Ac:_.Vf:null}).filter(Boolean)[0]||null;
336
- _.Ps=a=>{a=(new _.Mh(a)).Da.split(".");return 1>=a.length?null:a.pop()};_.Mi=class{constructor(a,b,c,d){this.id=a;this.name=b;this.attributes=c;this.value=void 0===d?null:d}toString(){function a(d){return d.name+"\x3d"+(isNaN(Number(d.value))?'"'+d.value+'"':d.value)}let b="#"+this.name;const c=this.attributes?this.attributes.map(a):[];this.value&&c.unshift(this.value);0<c.length&&(b+=":"+c.join(","));return b}getAttribute(a){const b=this.attributes.filter(c=>c.name===a);return b.length?b[0]:null}};_.Li=class{constructor(a,b){this.name=a;this.value=b}};var ai=new Map([["aar","aa"],["abk","ab"],["afr","af"],["aka","ak"],["alb","sq"],["amh","am"],["ara","ar"],["arg","an"],["arm","hy"],["asm","as"],["ava","av"],["ave","ae"],["aym","ay"],["aze","az"],["bak","ba"],["bam","bm"],["baq","eu"],["bel","be"],["ben","bn"],["bih","bh"],["bis","bi"],["bod","bo"],["bos","bs"],["bre","br"],["bul","bg"],["bur","my"],["cat","ca"],["ces","cs"],["cha","ch"],["che","ce"],["chi","zh"],["chu","cu"],["chv","cv"],["cor","kw"],["cos","co"],["cre","cr"],["cym","cy"],["cze",
337
- "cs"],["dan","da"],["deu","de"],[_.Gd,"dv"],["dut","nl"],["dzo","dz"],["ell","el"],["eng","en"],["epo","eo"],["est","et"],["eus","eu"],["ewe","ee"],["fao","fo"],["fas","fa"],["fij","fj"],["fin","fi"],["fra","fr"],["fre","fr"],["fry","fy"],["ful","ff"],["geo","ka"],["ger","de"],["gla","gd"],["gle","ga"],["glg","gl"],["glv","gv"],["gre","el"],["grn","gn"],["guj","gu"],["hat","ht"],["hau","ha"],["heb","he"],["her","hz"],["hin","hi"],["hmo","ho"],["hrv","hr"],["hun","hu"],["hye","hy"],["ibo","ig"],["ice",
323
+ MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,TRANSMUXING_FAILED:3018,MP4_PARSER_ERROR:3019,MEDIA_LOAD_ERROR:3100,INVALID_TRACK_TYPE:3101,UNKNOWN_TRACK:3102,MEDIA_DECRYPTION_ERROR:3103,PLAY_NOT_ALLOWED:3200,PAUSE_FAILED:3201,UNABLE_TO_GUESS_MANIFEST_TYPE:4E3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,DASH_WEBM_MISSING_INIT:4005,DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,
324
+ DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,UNPLAYABLE_PERIOD:4011,RESTRICTIONS_CANNOT_BE_MET:4012,NO_PERIODS:4014,HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020,HLS_COULD_NOT_GUESS_MIME_TYPE:4021,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,
325
+ DASH_UNSUPPORTED_XLINK_ACTUATE:4027,DASH_XLINK_DEPTH_LIMIT:4028,HLS_COULD_NOT_PARSE_SEGMENT_START_TIME:4030,CONTENT_UNSUPPORTED_BY_BROWSER:4032,SMOOTH_INVALID_MANIFEST_XML:4033,SMOOTH_EMPTY_PRESENTATION:4034,SMOOTH_MEDIA_PROCESSING_ERROR:4035,SMOOTH_INVALID_VERSION:4036,SMOOTH_INVALID_FRAGMENT_METADATA:4037,SMOOTH_REQUIRED_ATTRIBUTE_MISSING:4038,SMOOTH_TRUNCATED_MEDIA_FILE:4039,CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM:4040,HLS_MSE_ENCRYPTED_TS_NOT_SUPPORTED:4041,HLS_PLAYLIST_NOT_UTF8:4042,HLS_PLAYLIST_EMPTY:4043,
326
+ HLS_INVALID_VALUE:4044,HLS_DISCONTINUITY_NOT_SUPPORTED:4045,HLS_UNSUPPORTED_FEATURE:4046,HLS_INCOMPATIBLE_PLAYLIST_UPDATE:4047,INVALID_STREAMS_CHOSEN:5005,STREAMING_ERROR:5006,NO_RECOGNIZED_KEY_SYSTEMS:6E3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,
327
+ NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,REQUESTED_DRM_ENVIRONMENT_UNAVAILABLE:6015,INIT_DATA_TRANSFORM_ERROR:6016,CERTIFICATE_REQUEST_FAILED:6100,NO_CONTENT_ID:6101,SERVER_CERTIFICATE_REQUIRED:6102,EXTRACT_CONTENT_ID_MODIFIER_ERROR:6103,FAILED_TO_PERSIST_SESSION:6200,FAILED_TO_REMOVE_SESSION:6201,INVALID_SESSION_STORAGE_IMPLEMENTATION:6202,LOAD_INTERRUPTED:7E3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,CANNOT_LOAD_SOURCE:7003,MEDIA_ELEMENT_NOT_FOUND:7004,INVALID_MEDIA_ELEMENT:7005,
328
+ INVALID_CONTAINER_ELEMENT:7006,INVALID_ARGUMENT:7007,WRONG_ORDER_OF_OPERATIONS:7008,NOT_SUPPORTED:7009,INVALID_CONFIGURATION:7100,INVALID_LICENSE:7101,NO_ELEMENT:7102,USER_ID_NOT_PROVIDED:7103,KEY_LOAD_ERROR:7104,TIZEN_INTERNAL_ERROR:7200,CAF_INTERNAL_ERROR:7300,INTERNAL_CAST_ERROR:8E3,CAST_API_NOT_READY:8001,NO_RECEIVERS_AVAILABLE:8002,ALREADY_CASTING:8003,NO_CAST_SESSION:8004,CONVIVA_SDK_NOT_LOADED:9E3,CONVIVA_INVALID_CONFIGURATION:9001,CONVIVA_RUNTIME_ERROR:9002,GL_CONTEXT_ERROR:9003,GL_SHADER_ERROR:9004,
329
+ YOUBORA_SDK_MISSING:9100,YOUBORA_INVALID_CONFIGURATION:9101,YOUBORA_SDK_VERSION_NOT_SUPPORTED:9102,VIMOND_INVALID_CONFIGURATION:9200,VIMOND_SESSION_ERROR:9201,MUXDATA_INVALID_CONFIGURATION:9300,MUX_SDK_MISSING:9301,MUXDATA_INIT_ERROR:9302,IMA_SDK_MISSING:1E4,IMA_INVALID_CONFIGURATION:10001,IMA_UNSUPPORTED_PLATFORM:10002,AD_ERROR:10003,SIMID_CONTAINER_MISSING:10100,BROADPEAK_SDK_MISSING:11E3,BROADPEAK_SESSION_ERROR:11001,FREEWHEEL_SDK_MISSING:12E3,FREEWHEEL_INVALID_CONFIGURATION:12001,CONTENT_TRANSFORMATION_FAILED:14E3,
330
+ SESSIONS_INVALID_CONFIGURATION:15E3};_.Jh=class extends Error{constructor(a,b){super(a);this.code=b}};var Rh=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;Hg=_.Mh.prototype;Hg.rb="";Hg.rc="";Hg.Sa="";Hg.Kc=null;Hg.Da="";Hg.ic="";Hg.toString=function(){var a=[],b=this.rb;b&&a.push(Uh(b,Hs,!0),":");if(b=this.Sa){a.push("//");var c=this.rc;c&&a.push(Uh(c,Hs,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.Kc;null!=b&&a.push(":",String(b))}if(b=this.Da)this.Sa&&"/"!=b.charAt(0)&&a.push("/"),a.push(Uh(b,"/"==b.charAt(0)?Is:Js,!0));(b=this.a.toString())&&a.push("?",b);(b=this.ic)&&a.push("#",Uh(b,Ks));return a.join("")};
331
+ Hg.resolve=function(a){var b=new _.Mh(this);"data"===b.rb&&(b=new _.Mh);var c=!!a.rb;c?Nh(b,a.rb):c=!!a.rc;c?b.rc=a.rc:c=!!a.Sa;c?b.Sa=a.Sa:c=null!=a.Kc;var d=a.Da;if(c)Oh(b,a.Kc);else if(c=!!a.Da){if("/"!=d.charAt(0))if(this.Sa&&!this.Da)d="/"+d;else{var e=b.Da.lastIndexOf("/");-1!=e&&(d=b.Da.substr(0,e+1)+d)}if(".."==d||"."==d)d="";else if(-1!=d.indexOf("./")||-1!=d.indexOf("/.")){e=0==d.lastIndexOf("/",0);d=d.split("/");for(var f=[],g=0;g<d.length;){var h=d[g++];"."==h?e&&g==d.length&&f.push(""):
332
+ ".."==h?((1<f.length||1==f.length&&""!=f[0])&&f.pop(),e&&g==d.length&&f.push("")):(f.push(h),e=!0)}d=f.join("/")}}c?b.Da=d:c=""!==a.a.toString();c?_.Ph(b,Qh(a.a)):c=!!a.ic;c&&(b.ic=a.ic);return b};var Hs=/[#\/\?@]/g,Js=/[#\?:]/g,Is=/[#\?]/g,Vh=/[#\?@]/g,Ks=/#/g;_.Th.prototype.a=null;_.Th.prototype.h=null;
333
+ _.Th.prototype.add=function(a,b){if(!this.a&&(this.a={},this.h=0,this.f))for(var c=this.f.split("\x26"),d=0;d<c.length;d++){var e=c[d].indexOf("\x3d"),f=null;if(0<=e){var g=c[d].substring(0,e);f=c[d].substring(e+1)}else g=c[d];g=decodeURIComponent(g.replace(/\+/g," "));f=f||"";this.add(g,decodeURIComponent(f.replace(/\+/g," ")))}this.f=null;(c=this.a.hasOwnProperty(a)&&this.a[a])||(this.a[a]=c=[]);c.push(b);null!==this.h&&this.h++;return this};
334
+ _.Th.prototype.toString=function(){if(this.f)return this.f;if(!this.a)return"";var a=[],b;for(b in this.a)for(var c=encodeURIComponent(b),d=this.a[b],e=0;e<d.length;e++){var f=c;""!==d[e]&&(f+="\x3d"+encodeURIComponent(d[e]));a.push(f)}return this.f=a.join("\x26")};var Xh;_.F="text";_.Ls=1/15;Xh={audio:[/^vorbis$/,/^Opus$/,/^opus$/,/^fLaC$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4/,/^dts[cex]$/,/^iamf/,/^mhm[12]/],video:[/^avc/,/^hev/,/^hvc/,/^vvc/,/^vvi/,/^vp0?[89]/,/^av01/,/^dvh/,/^dva/,/^dav/]};Xh[_.F]=[/^vtt$/,/^wvtt/,/^stpp/];var Ms;Ms={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av0?1/],text:[/^vtt$/,/^wvtt/,/^stpp/]};_.Bj=(a,b)=>{const c=Ms[a];for(let d=0;d<c.length;d++)for(let e=0;e<b.length;e++)if(c[d].test(b[e].trim()))return b[e].trim();return a===_.F?"":null};_.Ns={text:{mp4:Cc,m4s:Cc,m4i:Cc,cmft:Cc,vtt:_.Uf,ttml:_.Fc},video:{mp4:_.qg,m4s:_.qg,m4i:_.qg,m4v:_.qg,cmfv:_.qg,ts:_.mg},audio:{mp4:_.Lc,m4s:_.Lc,m4i:_.Lc,m4a:_.Lc,cmfa:_.Lc,ts:_.mg,aac:_.Ic,ec3:_.Kc,ac3:_.Jc},image:{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"}};_.Ej=(a,b,c)=>a.map(d=>{d=_.Os(d)||"";return d=(d=_.Ns[b][d])?d:b===_.F?c&&"vtt"!==c?Cc:_.Uf:null}).filter(Boolean)[0]||null;
335
+ _.Os=a=>{a=(new _.Mh(a)).Da.split(".");return 1>=a.length?null:a.pop()};_.Li=class{constructor(a,b,c,d){this.id=a;this.name=b;this.attributes=c;this.value=void 0===d?null:d}toString(){function a(d){return d.name+"\x3d"+(isNaN(Number(d.value))?'"'+d.value+'"':d.value)}let b="#"+this.name;const c=this.attributes?this.attributes.map(a):[];this.value&&c.unshift(this.value);0<c.length&&(b+=":"+c.join(","));return b}getAttribute(a){const b=this.attributes.filter(c=>c.name===a);return b.length?b[0]:null}};_.Ki=class{constructor(a,b){this.name=a;this.value=b}};var Zh=new Map([["aar","aa"],["abk","ab"],["afr","af"],["aka","ak"],["alb","sq"],["amh","am"],["ara","ar"],["arg","an"],["arm","hy"],["asm","as"],["ava","av"],["ave","ae"],["aym","ay"],["aze","az"],["bak","ba"],["bam","bm"],["baq","eu"],["bel","be"],["ben","bn"],["bih","bh"],["bis","bi"],["bod","bo"],["bos","bs"],["bre","br"],["bul","bg"],["bur","my"],["cat","ca"],["ces","cs"],["cha","ch"],["che","ce"],["chi","zh"],["chu","cu"],["chv","cv"],["cor","kw"],["cos","co"],["cre","cr"],["cym","cy"],["cze",
336
+ "cs"],["dan","da"],["deu","de"],[_.Fd,"dv"],["dut","nl"],["dzo","dz"],["ell","el"],["eng","en"],["epo","eo"],["est","et"],["eus","eu"],["ewe","ee"],["fao","fo"],["fas","fa"],["fij","fj"],["fin","fi"],["fra","fr"],["fre","fr"],["fry","fy"],["ful","ff"],["geo","ka"],["ger","de"],["gla","gd"],["gle","ga"],["glg","gl"],["glv","gv"],["gre","el"],["grn","gn"],["guj","gu"],["hat","ht"],["hau","ha"],["heb","he"],["her","hz"],["hin","hi"],["hmo","ho"],["hrv","hr"],["hun","hu"],["hye","hy"],["ibo","ig"],["ice",
338
337
  "is"],["ido","io"],["iii","ii"],["iku","iu"],["ile","ie"],["ina","ia"],["ind","id"],["ipk","ik"],["isl","is"],["ita","it"],["jav","jv"],["jpn","ja"],["kal","kl"],["kan","kn"],["kas","ks"],["kat","ka"],["kau","kr"],["kaz","kk"],["khm","km"],["kik","ki"],["kin","rw"],["kir","ky"],["kom","kv"],["kon","kg"],["kor","ko"],["kua","kj"],["kur","ku"],["lao","lo"],["lat","la"],["lav","lv"],["lim","li"],["lin","ln"],["lit","lt"],["ltz","lb"],["lub","lu"],["lug","lg"],["mac","mk"],["mah","mh"],["mal","ml"],["mao",
339
338
  "mi"],["mar","mr"],["may","ms"],["mkd","mk"],["mlg","mg"],["mlt","mt"],["mon","mn"],["mri","mi"],["msa","ms"],["mya","my"],["nau","na"],["nav","nv"],["nbl","nr"],["nde","nd"],["ndo","ng"],["nep","ne"],["nld","nl"],["nno","nn"],["nob","nb"],["nor","no"],["nya","ny"],["oci","oc"],["oji","oj"],["ori","or"],["orm","om"],["oss","os"],["pan","pa"],["per","fa"],["pli","pi"],["pol","pl"],["por","pt"],["pus","ps"],["que","qu"],["roh","rm"],["ron","ro"],["rum","ro"],["run","rn"],["rus","ru"],["sag","sg"],["san",
340
339
  "sa"],["sin","si"],["slk","sk"],["slo","sk"],["slv","sl"],["sme","se"],["smo","sm"],["sna","sn"],["snd","sd"],["som","so"],["sot","st"],["spa","es"],["sqi","sq"],["srd","sc"],["srp","sr"],["ssw","ss"],["sun","su"],["swa","sw"],["swe","sv"],["tah","ty"],["tam","ta"],["tat","tt"],["tel","te"],["tgk","tg"],["tgl","tl"],["tha","th"],["tib","bo"],["tir","ti"],["ton","to"],["tsn","tn"],["tso","ts"],["tuk","tk"],["tur","tr"],["twi","tw"],["uig","ug"],["ukr","uk"],["urd","ur"],["uzb","uz"],["ven","ve"],["vie",
341
- "vi"],["vol","vo"],["wel","cy"],["wln","wa"],["wol","wo"],["xho","xh"],["yid","yi"],["yor","yo"],["zha","za"],["zho","zh"],["zul","zu"]]);var Qs=class{};_.z("clpp.utils.BufferUtils",Qs);Qs.toArrayBuffer=mi;Qs.toDataView=_.li;Qs.toInt32Array=_.ki;Qs.toUint32Array=ji;Qs.toUint16Array=ii;Qs.toUint8Array=_.J;Qs.equal=gi;var pi=new _.R("clpp.utils.strings");_.z("clpp.utils.strings.fromUtf8",_.oi);_.z("clpp.utils.strings.fromBytesAutoDetect",_.ri);_.z("clpp.utils.strings.toUtf8",_.si);_.z("clpp.utils.strings.toUtf16",_.ti);_.z("clpp.utils.strings.toByteArray",_.ui);_.z("clpp.utils.strings.startsWith",_.vi);_.z("clpp.utils.strings.endsWith",_.wi);_.z("clpp.utils.strings.bitrateToString",_.zi);
342
- _.z("clpp.utils.strings.durationToString",function(a,b="%h:%mm:%ss"){if(null===a||void 0===a)a=0;if(null===b||void 0===b)b="%h:%mm:%ss";const c=Math.floor(a/3600),d=Math.floor((a-3600*c)/60);a=Math.floor(a-3600*c-60*d);const e=(g,h)=>g.length<h?e("0"+g,h):g,f=g=>(h,k)=>e(g,k.length-1);return b.replace(/(%h+)/,f(String(c))).replace(/(%m+)/,f(String(d))).replace(/(%s+)/,f(String(a)))});
343
- _.z("clpp.utils.strings.hashCode",function(a){let b=0;if(0===a.length)return b;for(let c=0;c<a.length;c++)b=(b<<5)-b+a.charCodeAt(c),b|=0;return b});var Ai=document.createElement("span");var Rs=class{};_.z("clpp.utils.Uint8ArrayUtils",Rs);Rs.toStandardBase64=_.Ci;Rs.concat=_.Ii;Rs.equal=_.Hi;Rs.toHex=_.Gi;Rs.fromHex=_.Fi;Rs.fromBase64=_.Ei;Rs.toBase64Url=_.Di;_.Ss=new _.R("clpp.hls.Utils");_.Ki=class{constructor(a){this.f=a;this.a=0}};_.Ts=new Set([_.Ea,_.Fa,"EXT-X-I-FRAMES-ONLY",_.Ia,_.Ja,_.La,_.Oa,_.Qa]);_.Us=new Set(["EXTINF",_.Ba,_.Da,_.Ga,_.Ha,_.Na]);_.Vs=new Set(["EXT-X-PART",_.Ma]);_.Ws=new Set([_.Ca]);var Oi=[403,401];_.z("clpp.net.DEFAULT_FATAL_STATUS_CODES",Oi);_.z("clpp.net.makeRequest",_.Si);_.Ri=6;_.z("clpp.net.RequestType",{MANIFEST:1,SEGMENT:2,LICENSE:3,APP:4,TIMING:5,OTHER:_.Ri});_.dn=class{constructor(){this.Hf=this.Jb=this.done=!1;this.error=this.value=null;let a,b;const c=new Promise((d,e)=>{a=function(f){this.done=this.Jb=!0;this.value=f;d(f)};b=function(f){this.done=this.Hf=!0;this.error=f;e(f)}});c.Jb=!1;c.done=!1;c.Hf=!1;c.value=null;c.error=null;c.resolve=a;c.reject=b;return c}resolve(){}reject(){}};_.lo=class{constructor(a,b){this.R=a;this.A=b;this.a=!1}abort(){this.a=!0;return this.A()}qd(a,b){const c=new _.dn;let d=()=>{c.reject(new _.H(_.F,7,7001));return this.abort()};this.R.then(e=>{this.a?c.reject(new _.H(_.F,7,7001)):a?d=Xi(a,e,c):c.resolve(e)},e=>{b?d=Xi(b,e,c):c.reject(e)});return new _.lo(c,()=>d())}};_.lo.aborted=function(){const a=Promise.reject(new _.H(_.F,7,7001));a.catch(()=>{});return new _.lo(a,()=>Promise.resolve())};_.lo.prototype.chain=_.lo.prototype.qd;_.Xs=class{constructor(){this.a=[]}destroy(){const a=[];for(const b of this.a)b.R.catch(()=>{}),a.push(b.abort());this.a=[];return Promise.all(a)}};_.ap=class{constructor(){this.f=[];this.h=[];this.j=[];this.w=!1;this.o=new _.Xs;this.a={};this.l=0;this.a.data=bs;!window.fetch||!window.AbortController||_.Xj(6)||_.ak()&&68<_.vk().browserVersion.major?(this.a.http=Gr,this.a.https=Gr):(this.a.http=Xr,this.a.https=Xr)}sh(a){0<a?_.C("Rate limit set to "+a+"bps"):_.C("Rate limit disabled");this.l=a}release(){return this.o.destroy()}destroy(){this.w=!0;this.f=[];this.h=[];return this.o.destroy()}Rd(a){this.f.push(a)}tc(a){this.h.push(a)}ye(a){this.f=
344
- this.f.filter(b=>b!==a)}gd(a){this.h=this.h.filter(b=>b!==a)}fetch(a){if(this.w)return new Ys(Promise.reject(new _.H(1,1,7001,{url:a.uris[a.uriIndex],request:a})));this.l&&0<this.l&&(a.rateLimitBps=this.l);var b=[];for(const f of this.f)b.push(f);if(a.requestModifiers)for(const f of a.requestModifiers)b.push(f);a.requestModifiers=b;b=[];for(var c of this.h)b.push(c);if(a.responseModifiers)for(var d of a.responseModifiers)b.push(d);a.responseModifiers=b;let e;d=c=new _.dn;try{for(const f of a.requestModifiers)d=
345
- d.then(g=>{if(e.a)throw new _.H(_.F,1,7001,g?{url:g.uris[g.uriIndex],request:g}:null);return f(g)||g}).catch(g=>{if(g instanceof _.H)throw g;throw new _.H(_.F,1,1006,null,g);});d=d.then(f=>{var g=new _.Mh(f.uris[f.uriIndex]);var h=g.gb;h||(h=location.protocol,h=h.slice(0,-1),Nh(g,h),f.uris[f.uriIndex]=g.toString());h=this.a[h];if(!h)throw new _.H(_.F,1,1E3,{url:g.toString()});g=h;return{request:f,plugin:g}});e=new Ys(d);for(const f of a.responseModifiers)e.then(g=>{const h=()=>{if(e.a)throw new _.H(_.F,
346
- 1,7001,g?{url:g.request.uris[g.request.uriIndex],request:g.request}:null);};h();const k=f(g)||g;h();return k}).catch(g=>{if(g instanceof _.H&&g.data&&g.data.response){const h=f(g.data.response);if(h&&h.then)return h.then(()=>Promise.reject(g))}return Promise.reject(g)}).catch(g=>{if(g instanceof _.H)throw g;throw new _.H(_.F,1,1007,null,g);});for(const f of this.j)e.catch(g=>{g instanceof _.H&&g.data&&g.data.response||f({uri:a.uris[a.uriIndex],data:(new Uint8Array(0)).buffer,status:-1,timeMs:0,headers:{},
347
- request:a});return Promise.reject(g)}).catch(g=>{if(g instanceof _.H)throw g;throw new _.H(_.F,1,1007,null,g);});_.Zi(this.o,e);c.resolve(a);return e}catch(f){return new Ys(Promise.reject(f))}}};_.z("clpp.net.NetworkEngine",_.ap);_.ap.prototype.fetch=_.ap.prototype.fetch;_.ap.prototype.removeResponseModifier=_.ap.prototype.gd;_.ap.prototype.removeRequestModifier=_.ap.prototype.ye;_.ap.prototype.addResponseModifier=_.ap.prototype.tc;_.ap.prototype.addRequestModifier=_.ap.prototype.Rd;
348
- _.ap.prototype.setRateLimit=_.ap.prototype.sh;var ej;
349
- _.hj=class{constructor(a,b){this.id=a;this.type=b;this.roles=[];this.frameRate=this.label=this.originalLanguage=this.language=this.kind=null;this.trickPlay=!1;this.channelsCount=this.src=this.mimeType=null;this.spatialAudio=!1;this.renditions=[];this.accessibility=[]}zc(a){return this.type===a.type&&this.channelsCount===a.channelsCount&&this.frameRate===a.frameRate&&this.trickPlay===a.trickPlay&&this.kind===a.kind&&this.label===a.label&&this.language===a.language&&this.mimeType===a.mimeType&&Dh(this.roles,
350
- a.roles)&&Dh(this.accessibility,a.accessibility,cj)}toString(){return`Track type: ${this.type} id: ${this.id}
351
- renditions size: ${this.renditions.length}`}};_.z("clpp.Track",_.hj);_.hj.prototype.toString=_.hj.prototype.toString;_.pj=class{constructor(a,b){this.track=b;this.id=a;this.originalId=this.drm=this.drmInfo=this.codec=this.Kc=this.bandwidth=this.height=this.width=null}};_.z("clpp.Rendition",_.pj);_.gj=1;_.N=_.w;_.L=_.p;_.K="text";ej=_.ye;_.Zs={VIDEO:_.N,AUDIO:_.L,TEXT:_.K,METADATA:ej};_.hj.Type=_.Zs;_.Kl=class{constructor(a){this.j=a;this.scheme=null;const b=document.createElement("a"),c=a.match(/^(.*:)(\/\/(.*))$/);let d=!1;if(c){if(this.scheme=c[1],b.href=c[2],":"===b.protocol||""===b.host&&""===b.pathname)b.href="//dummy.com/"+c[3],d=!0}else{b.href=a;if(":"===b.protocol||""===b.host&&""===b.pathname)b.href="//dummy.com/"+a.match(/\/?\/?(.*)/)[1],d=!0;this.scheme=b.protocol}""===this.scheme&&(this.scheme=window.location.protocol);this.a=d?"":b.hostname;this.port=b.port;this.path=b.pathname;
352
- _.vi(this.path,"/")||(this.path="/"+this.path);this.f=b.search;this.h=b.hash}};_.z("clpp.utils.url.queryString",_.kj);var $s=class{constructor(a){this.f=a;this.g=new _.R("clpp.native.hls.HlsMetadataParser");this.a=Hh(this.h.bind(this),(b,c)=>b[0]===c[0]&&b[1].enableHlsVideoTrackInfo===c[1].enableHlsVideoTrackInfo&&b[1].enableMetadata===c[1].enableMetadata)}h(a,b){const c=this;return _.x(function*(){let d=null;try{d=yield nj(c,a)}catch(f){return c.g.warn("Failed to fetch playlist in order metadata from HLS playlist.",f.message),Promise.resolve({})}const e={};try{if(b.enableHlsVideoTrackInfo){const f=yield rj(c,d,
353
- a);e.renditions=f.renditions;e.mimeType=f.mimeType}}catch(f){c.g.warn("Failed to parse video metadata from HLS playlist.",f.message)}try{const f=yield tj(d);e.Ec=f}catch(f){c.g.warn("Failed to parse metadata from HLS playlist.",f.message)}return e})}};_.Dj=[];_.S=class{Vd(){return!0}vg(a){return this.getVideoTracks().find(b=>_.Yg(b,a,a&&Object.keys(a)))}rg(a){return this.getAudioTracks().find(b=>_.Yg(b,a,a&&Object.keys(a)))}tg(a){return this.ka().find(b=>_.Yg(b,a,a&&Object.keys(a)))}ug(a){return this.getVideoTracks().flatMap(b=>b.renditions).find(b=>_.Yg(b,a,a&&Object.keys(a)))}qg(a){return this.getAudioTracks().flatMap(b=>b.renditions).find(b=>_.Yg(b,a,a&&Object.keys(a)))}sg(a){return this.ka().flatMap(b=>b.renditions).find(b=>_.Yg(b,a,a&&Object.keys(a)))}};
354
- _.z("clpp.TrackManager",_.S);_.S.prototype.isAbrEnabled=_.S.prototype.ra;_.S.prototype.addTextTrack=_.S.prototype.addTextTrack;_.S.prototype.findTextRendition=_.S.prototype.sg;_.S.prototype.findAudioRendition=_.S.prototype.qg;_.S.prototype.findVideoRendition=_.S.prototype.ug;_.S.prototype.findTextTrack=_.S.prototype.tg;_.S.prototype.findAudioTrack=_.S.prototype.rg;_.S.prototype.findVideoTrack=_.S.prototype.vg;_.S.prototype.setTextRendition=_.S.prototype.ib;_.S.prototype.setAudioRendition=_.S.prototype.hb;
355
- _.S.prototype.setVideoRendition=_.S.prototype.Ya;_.S.prototype.setTextTrack=_.S.prototype.La;_.S.prototype.setAudioTrack=_.S.prototype.wa;_.S.prototype.setVideoTrack=_.S.prototype.jb;_.S.prototype.getTextTrack=_.S.prototype.ua;_.S.prototype.getAudioTrack=_.S.prototype.na;_.S.prototype.getVideoTrack=_.S.prototype.Ja;_.S.prototype.getLoadingTextRendition=_.S.prototype.pb;_.S.prototype.getLoadingAudioRendition=_.S.prototype.ob;_.S.prototype.getLoadingVideoRendition=_.S.prototype.cb;
356
- _.S.prototype.getTextRendition=_.S.prototype.Ia;_.S.prototype.getAudioRendition=_.S.prototype.Qa;_.S.prototype.getVideoRendition=_.S.prototype.oa;_.S.prototype.getTextTracks=_.S.prototype.ka;_.S.prototype.getAudioTracks=_.S.prototype.getAudioTracks;_.S.prototype.getVideoTracks=_.S.prototype.getVideoTracks;_.S.prototype.canSelectVideoTracks=_.S.prototype.Vd;var Hj=new Map,Gj=1,Lj=2,Kj=3,Jj=4;_.at=(new Map).set(_.sd,_.sd).set("frameRate","framerate").set("bandwidth","bitrate").set(_.Cg,_.Cg).set(_.Zd,_.Zd).set("channelsCount","channels");_.bt=class{constructor(a){this.f=a;this.a=null}ha(a){return Qj(this,a,!1)}kb(a){return Qj(this,a,!0)}stop(){this.a&&(this.a(),this.a=null)}};_.Tj=class{constructor(a){this.f=a;this.a=null}Ie(){this.stop();this.f();return this}ha(a){this.stop();this.a=(new _.bt(()=>{this.f()})).ha(a);return this}kb(a){this.stop();this.a=(new _.bt(()=>{this.f()})).kb(a);return this}stop(){this.a&&(this.a.stop(),this.a=null)}};_.z("clpp.utils.Timer",_.Tj);_.Tj.prototype.stop=_.Tj.prototype.stop;_.Tj.prototype.tickEvery=_.Tj.prototype.kb;_.Tj.prototype.tickAfter=_.Tj.prototype.ha;_.Tj.prototype.tickNow=_.Tj.prototype.Ie;var ct=class{};_.z(rd,ct);ct.getInfo=_.vk;
357
- var Sj=null,Rj=null,kk=new _.R(rd),ok="android",nk="ios",tk="linux",pk="osx",qk="windows",rk="tizen",sk="webos",mk=bg,uk=bg,fk={windows:{os_version:/windows\s+?nt\s([\d.]+)/i,ie:/windows\s+?nt.+?trident\/[\d.]+.*rv:([\d.]+)/i,edge:/windows\s+?nt.+?edge?\/([\d.]+)/i,chrome:/windows\s+?nt.+?chrome\/([\d.]+)/i,firefox:/windows\s+?nt.+?firefox\/([\d.]+)/i,opera:/windows\s+?nt.+?opr\/([\d.]+)/i},osx:{os_version:/macintosh.+?([\d._]+)/i,safari:/macintosh.+?version\/([\d._]+).+?safari/i,edge:/macintosh.+?edge?\/([\d._]+)/i,
340
+ "vi"],["vol","vo"],["wel","cy"],["wln","wa"],["wol","wo"],["xho","xh"],["yid","yi"],["yor","yo"],["zha","za"],["zho","zh"],["zul","zu"]]);var Ps=class{};_.x("clpp.utils.BufferUtils",Ps);Ps.toArrayBuffer=li;Ps.toDataView=_.ki;Ps.toInt32Array=_.ji;Ps.toUint32Array=ii;Ps.toUint16Array=hi;Ps.toUint8Array=_.I;Ps.equal=fi;var oi=new _.R("clpp.utils.strings");_.x("clpp.utils.strings.fromUtf8",_.ni);_.x("clpp.utils.strings.fromBytesAutoDetect",_.qi);_.x("clpp.utils.strings.toUtf8",_.ri);_.x("clpp.utils.strings.toUtf16",_.si);_.x("clpp.utils.strings.toByteArray",_.ti);_.x("clpp.utils.strings.startsWith",_.ui);_.x("clpp.utils.strings.endsWith",_.vi);_.x("clpp.utils.strings.bitrateToString",_.yi);
341
+ _.x("clpp.utils.strings.durationToString",function(a,b="%h:%mm:%ss"){if(null===a||void 0===a)a=0;if(null===b||void 0===b)b="%h:%mm:%ss";const c=Math.floor(a/3600),d=Math.floor((a-3600*c)/60);a=Math.floor(a-3600*c-60*d);const e=(g,h)=>g.length<h?e("0"+g,h):g,f=g=>(h,k)=>e(g,k.length-1);return b.replace(/(%h+)/,f(String(c))).replace(/(%m+)/,f(String(d))).replace(/(%s+)/,f(String(a)))});
342
+ _.x("clpp.utils.strings.hashCode",function(a){let b=0;if(0===a.length)return b;for(let c=0;c<a.length;c++)b=(b<<5)-b+a.charCodeAt(c),b|=0;return b});var zi=document.createElement("span");var Qs=class{};_.x("clpp.utils.Uint8ArrayUtils",Qs);Qs.toStandardBase64=_.Bi;Qs.concat=_.Hi;Qs.equal=_.Gi;Qs.toHex=_.Fi;Qs.fromHex=_.Ei;Qs.fromBase64=_.Di;Qs.toBase64Url=_.Ci;_.Rs=new _.R("clpp.hls.Utils");_.Ji=class{constructor(a){this.f=a;this.a=0}};_.Ss=new Set([_.Ea,_.Fa,"EXT-X-I-FRAMES-ONLY",_.Ia,_.Ja,_.La,_.Oa,_.Qa]);_.Ts=new Set(["EXTINF",_.Ba,_.Da,_.Ga,_.Ha,_.Na]);_.Us=new Set(["EXT-X-PART",_.Ma]);_.Vs=new Set([_.Ca]);var Ni=[403,401];_.x("clpp.net.DEFAULT_FATAL_STATUS_CODES",Ni);_.x("clpp.net.makeRequest",_.Si);_.Ri=6;_.x("clpp.net.RequestType",{MANIFEST:1,SEGMENT:2,LICENSE:3,APP:4,TIMING:5,OTHER:_.Ri});_.ln=class{constructor(){this.Jf=this.Kd=this.done=!1;this.error=this.value=null;let a,b;const c=new Promise((d,e)=>{a=function(f){this.done=this.Kd=!0;this.value=f;d(f)};b=function(f){this.done=this.Jf=!0;this.error=f;e(f)}});c.Kd=!1;c.done=!1;c.Jf=!1;c.value=null;c.error=null;c.resolve=a;c.reject=b;return c}resolve(){}reject(){}};_.so=class{constructor(a,b){this.W=a;this.A=b;this.a=!1}abort(){this.a=!0;return this.A()}};_.Ws=class{constructor(){this.a=[]}destroy(){const a=[];for(const b of this.a)b.W.catch(()=>{}),a.push(b.abort());this.a=[];return Promise.all(a)}};_.gr=class{constructor(){this.f=[];this.h=[];this.j=[];this.w=!1;this.o=new _.Ws;this.a={};this.l=0;this.a.data=kp;!window.fetch||!window.AbortController||_.ak(6)||_.dk()&&68<_.yk().browserVersion.major?(this.a.http=Oo,this.a.https=Oo):(this.a.http=fp,this.a.https=fp)}wh(a){0<a?_.B("Rate limit set to "+a+"bps"):_.B("Rate limit disabled");this.l=a}release(){return this.o.destroy()}destroy(){this.w=!0;this.f=[];this.h=[];return this.o.destroy()}Pd(a){this.f.push(a)}uc(a){this.h.push(a)}ze(a){this.f=
343
+ this.f.filter(b=>b!==a)}fd(a){this.h=this.h.filter(b=>b!==a)}fetch(a){if(this.w)return new Xs(Promise.reject(new _.G(1,1,7001,{url:a.uris[a.uriIndex],request:a})));this.l&&0<this.l&&(a.rateLimitBps=this.l);var b=[];for(const f of this.f)b.push(f);if(a.requestModifiers)for(const f of a.requestModifiers)b.push(f);a.requestModifiers=b;b=[];for(var c of this.h)b.push(c);if(a.responseModifiers)for(var d of a.responseModifiers)b.push(d);a.responseModifiers=b;let e;d=c=new _.ln;try{for(const f of a.requestModifiers)d=
344
+ d.then(g=>{if(e.a)throw new _.G(_.E,1,7001,g?{url:g.uris[g.uriIndex],request:g}:null);return f(g)||g}).catch(g=>{if(g instanceof _.G)throw g;throw new _.G(_.E,1,1006,null,g);});d=d.then(f=>{var g=new _.Mh(f.uris[f.uriIndex]);var h=g.rb;h||(h=location.protocol,h=h.slice(0,-1),Nh(g,h),f.uris[f.uriIndex]=g.toString());h=this.a[h];if(!h)throw new _.G(_.E,1,1E3,{url:g.toString()});g=h;return{request:f,plugin:g}});e=new Xs(d);for(const f of a.responseModifiers)e.then(g=>{const h=()=>{if(e.a)throw new _.G(_.E,
345
+ 1,7001,g?{url:g.request.uris[g.request.uriIndex],request:g.request}:null);};h();const k=f(g)||g;h();return k}).catch(g=>{if(g instanceof _.G&&g.data&&g.data.response){const h=f(g.data.response);if(h&&h.then)return h.then(()=>Promise.reject(g))}return Promise.reject(g)}).catch(g=>{if(g instanceof _.G)throw g;throw new _.G(_.E,1,1007,null,g);});for(const f of this.j)e.catch(g=>{g instanceof _.G&&g.data&&g.data.response||f({uri:a.uris[a.uriIndex],data:(new Uint8Array(0)).buffer,status:-1,timeMs:0,headers:{},
346
+ request:a});return Promise.reject(g)}).catch(g=>{if(g instanceof _.G)throw g;throw new _.G(_.E,1,1007,null,g);});_.aj(this.o,e);c.resolve(a);return e}catch(f){return new Xs(Promise.reject(f))}}};_.x("clpp.net.NetworkEngine",_.gr);_.gr.prototype.fetch=_.gr.prototype.fetch;_.gr.prototype.removeResponseModifier=_.gr.prototype.fd;_.gr.prototype.removeRequestModifier=_.gr.prototype.ze;_.gr.prototype.addResponseModifier=_.gr.prototype.uc;_.gr.prototype.addRequestModifier=_.gr.prototype.Pd;
347
+ _.gr.prototype.setRateLimit=_.gr.prototype.wh;var gj;
348
+ _.jj=class{constructor(a,b){this.id=a;this.type=b;this.roles=[];this.frameRate=this.label=this.originalLanguage=this.language=this.kind=null;this.trickPlay=!1;this.channelsCount=this.src=this.mimeType=null;this.spatialAudio=!1;this.renditions=[];this.accessibility=[]}Ac(a){return this.type===a.type&&this.channelsCount===a.channelsCount&&this.frameRate===a.frameRate&&this.trickPlay===a.trickPlay&&this.kind===a.kind&&this.label===a.label&&this.language===a.language&&this.mimeType===a.mimeType&&Bh(this.roles,
349
+ a.roles)&&Bh(this.accessibility,a.accessibility,ej)}toString(){return`Track type: ${this.type} id: ${this.id}
350
+ renditions size: ${this.renditions.length}`}};_.x("clpp.Track",_.jj);_.jj.prototype.toString=_.jj.prototype.toString;_.tj=class{constructor(a,b){this.track=b;this.id=a;this.originalId=this.drm=this.drmInfo=this.codec=this.Mc=this.bandwidth=this.height=this.width=null}};_.x("clpp.Rendition",_.tj);_.ij=1;_.L=_.t;_.K=_.p;_.J="text";gj=_.ye;_.Ys={VIDEO:_.L,AUDIO:_.K,TEXT:_.J,METADATA:gj};_.jj.Type=_.Ys;_.Rl=class{constructor(a){this.j=a;this.scheme=null;const b=document.createElement("a"),c=a.match(/^(.*:)(\/\/(.*))$/);let d=!1;if(c){if(this.scheme=c[1],b.href=c[2],":"===b.protocol||""===b.host&&""===b.pathname)b.href="//dummy.com/"+c[3],d=!0}else{b.href=a;if(":"===b.protocol||""===b.host&&""===b.pathname)b.href="//dummy.com/"+a.match(/\/?\/?(.*)/)[1],d=!0;this.scheme=b.protocol}""===this.scheme&&(this.scheme=window.location.protocol);this.a=d?"":b.hostname;this.port=b.port;this.path=b.pathname;
351
+ _.ui(this.path,"/")||(this.path="/"+this.path);this.f=b.search;this.h=b.hash}};_.x("clpp.utils.url.queryString",_.mj);var Zs=class{constructor(a){this.f=a;this.g=new _.R("clpp.native.hls.HlsMetadataParser");this.a=Fh(this.h.bind(this),(b,c)=>b[0]===c[0]&&b[1].enableHlsVideoTrackInfo===c[1].enableHlsVideoTrackInfo&&b[1].enableMetadata===c[1].enableMetadata)}h(a,b){const c=this;return _.w(function*(){let d=null;try{d=yield pj(c,a)}catch(f){return c.g.warn("Failed to fetch playlist in order metadata from HLS playlist.",f.message),Promise.resolve({})}const e={};try{if(b.enableHlsVideoTrackInfo){const f=yield vj(c,d,
352
+ a);e.renditions=f.renditions;e.mimeType=f.mimeType}}catch(f){c.g.warn("Failed to parse video metadata from HLS playlist.",f.message)}try{const f=yield xj(d);e.Hc=f}catch(f){c.g.warn("Failed to parse metadata from HLS playlist.",f.message)}return e})}};_.ft=class{constructor(a,b,c,d){d=void 0===d?_.$s:d;this.startTime=a;this.endTime=b;this.payload=c;this.payloadType=d;this.positionAlign=this.position=null;this.size=100;this.textAlign=_.at;this.writingMode=_.bt;this.lineInterpretation=_.ct;this.line=null;this.lineAlign=_.dt;this.direction=et;this.region=null;this.cssClassList=[];this.id=this.backgroundImage="";this.containerRows=null}Ac(a){return this.payload===a.payload&&this.startTime===a.startTime&&this.endTime===a.endTime&&this.payloadType===
353
+ a.payloadType}};_.x("clpp.text.Cue",_.ft);_.ft.positionAlign={LEFT:_.je,RIGHT:_.le,CENTER:_.cd,AUTO:"auto"};_.$s="text";_.ft.payloadType={TEXT:_.$s,VTT_XML:_.vg,TTML_XML:_.Zf};_.at=_.cd;_.gt={LEFT:_.ge,RIGHT:_.yf,CENTER:_.at,START:_.ge,END:_.yf};_.ft.textAlign=_.gt;var et="ltr";_.ft.direction={HORIZONTAL_LEFT_TO_RIGHT:et,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};_.bt="horizontal-tb";_.ft.writingMode={HORIZONTAL_TOP_TO_BOTTOM:_.bt,VERTICAL_LEFT_TO_RIGHT:_.kg,VERTICAL_RIGHT_TO_LEFT:_.lg};_.ct=0;
354
+ _.ft.lineInterpretation={LINE_NUMBER:_.ct,PERCENTAGE:1};_.dt=_.Lf;_.ht={CENTER:_.cd,START:_.dt,END:_.Td};_.ft.lineAlign=_.ht;_.kt=class{constructor(){this.id="";this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0;this.height=this.width=100;this.viewportAnchorUnits=this.widthUnits=this.heightUnits=_.it;this.scroll=jt;this.cssClassList=[];this.writingMode=this.displayAlign=null}};_.x("clpp.text.CueRegion",_.kt);_.it=1;_.kt.units={PX:0,PERCENTAGE:_.it,LINES:2};var jt="";
355
+ _.kt.scrollMode={NONE:jt,UP:"up"};_.kt.displayAlign={BEFORE:"flex-end",CENTER:_.cd,AFTER:"flex-start"};_.kt.writingMode={HORIZONTAL_TOP_TO_BOTTOM:_.sd,VERTICAL_LEFT_TO_RIGHT:"row-reverse",VERTICAL_RIGHT_TO_LEFT:"row"};var lt=class{constructor(a){this.m=a;this.l=a.getTextDisplayer();this.f=this.h=null;this.a=new _.Fs;this.j=!1;this.g=new _.R("clpp.native.CueHandler")}destroy(){this.a.release();this.j=!1;this.l=this.a=this.h=this.f=null;return Promise.resolve()}start(a){this.j?this.g.warn("Already started. Ignoring request..."):(this.j=!0,this.h=a,this.f=this.h.textTracks,this.a.on(this.f,_.vc,b=>Fj(this,b)),this.a.on(this.f,ed,()=>{{const b=this.f;for(let c=0;c<b.length;c++){const d=b[c];d.mode===_.Ff&&(d.mode=
356
+ _.ae)}}}))}o(a){const b=new _.ft(a.startTime,a.endTime,a.text,_.vg);if(_.Xg(a.vertical))switch(a.vertical){case "lr":b.writingMode=_.kg;break;case "rl":b.writingMode=_.lg}_.Yg(a.size)&&(b.size=a.size);if(_.Xg(a.align))switch(a.align){case _.ge:case _.Lf:b.textAlign=_.ge;break;case _.cd:b.textAlign=_.at;break;case _.yf:case _.Td:b.textAlign=_.yf}_.Yg(a.position)&&(b.position=a.position);if(_.Xg(a.positionAlign))switch(a.positionAlign){case _.je:b.positionAlign=_.je;break;case _.cd:b.positionAlign=
357
+ _.cd;break;case _.le:b.positionAlign=_.le}_.Yg(a.line)&&(b.line=a.line);if(_.Xg(a.lineAlign))switch(a.lineAlign){case _.Lf:b.lineAlign=_.dt;break;case _.cd:b.lineAlign=_.cd;break;case _.Td:b.lineAlign=_.Td}typeof a.snapToLines===_.Rc&&(b.lineInterpretation=a.snapToLines?_.ct:1);return b}};_.Gj=[];_.S=class{Td(){return!0}yg(a){return this.getVideoTracks().find(b=>_.Zg(b,a,a&&Object.keys(a)))}ug(a){return this.getAudioTracks().find(b=>_.Zg(b,a,a&&Object.keys(a)))}wg(a){return this.ha().find(b=>_.Zg(b,a,a&&Object.keys(a)))}xg(a){return this.getVideoTracks().flatMap(b=>b.renditions).find(b=>_.Zg(b,a,a&&Object.keys(a)))}tg(a){return this.getAudioTracks().flatMap(b=>b.renditions).find(b=>_.Zg(b,a,a&&Object.keys(a)))}vg(a){return this.ha().flatMap(b=>b.renditions).find(b=>_.Zg(b,a,a&&Object.keys(a)))}};
358
+ _.x("clpp.TrackManager",_.S);_.S.prototype.isAbrEnabled=_.S.prototype.pa;_.S.prototype.addTextTrack=_.S.prototype.addTextTrack;_.S.prototype.findTextRendition=_.S.prototype.vg;_.S.prototype.findAudioRendition=_.S.prototype.tg;_.S.prototype.findVideoRendition=_.S.prototype.xg;_.S.prototype.findTextTrack=_.S.prototype.wg;_.S.prototype.findAudioTrack=_.S.prototype.ug;_.S.prototype.findVideoTrack=_.S.prototype.yg;_.S.prototype.setTextRendition=_.S.prototype.tb;_.S.prototype.setAudioRendition=_.S.prototype.sb;
359
+ _.S.prototype.setVideoRendition=_.S.prototype.ab;_.S.prototype.setTextTrack=_.S.prototype.Na;_.S.prototype.setAudioTrack=_.S.prototype.va;_.S.prototype.setVideoTrack=_.S.prototype.ub;_.S.prototype.getTextTrack=_.S.prototype.ta;_.S.prototype.getAudioTrack=_.S.prototype.la;_.S.prototype.getVideoTrack=_.S.prototype.La;_.S.prototype.getLoadingTextRendition=_.S.prototype.Ab;_.S.prototype.getLoadingAudioRendition=_.S.prototype.zb;_.S.prototype.getLoadingVideoRendition=_.S.prototype.jb;
360
+ _.S.prototype.getTextRendition=_.S.prototype.Ka;_.S.prototype.getAudioRendition=_.S.prototype.Ta;_.S.prototype.getVideoRendition=_.S.prototype.ma;_.S.prototype.getTextTracks=_.S.prototype.ha;_.S.prototype.getAudioTracks=_.S.prototype.getAudioTracks;_.S.prototype.getVideoTracks=_.S.prototype.getVideoTracks;_.S.prototype.canSelectVideoTracks=_.S.prototype.Td;var Kj=new Map,Jj=1,Oj=2,Nj=3,Mj=4;_.mt=(new Map).set(_.rd,_.rd).set("frameRate","framerate").set("bandwidth","bitrate").set(_.Dg,_.Dg).set(_.$d,_.$d).set("channelsCount","channels");_.nt=class{constructor(a){this.f=a;this.a=null}fa(a){return Tj(this,a,!1)}vb(a){return Tj(this,a,!0)}stop(){this.a&&(this.a(),this.a=null)}};_.Wj=class{constructor(a){this.f=a;this.a=null}Je(){this.stop();this.f();return this}fa(a){this.stop();this.a=(new _.nt(()=>{this.f()})).fa(a);return this}vb(a){this.stop();this.a=(new _.nt(()=>{this.f()})).vb(a);return this}stop(){this.a&&(this.a.stop(),this.a=null)}};_.x("clpp.utils.Timer",_.Wj);_.Wj.prototype.stop=_.Wj.prototype.stop;_.Wj.prototype.tickEvery=_.Wj.prototype.vb;_.Wj.prototype.tickAfter=_.Wj.prototype.fa;_.Wj.prototype.tickNow=_.Wj.prototype.Je;var ot=class{};_.x(qd,ot);ot.getInfo=_.yk;
361
+ var Vj=null,Uj=null,nk=new _.R(qd),rk="android",qk="ios",wk="linux",sk="osx",tk="windows",uk="tizen",vk="webos",pk=bg,xk=bg,ik={windows:{os_version:/windows\s+?nt\s([\d.]+)/i,ie:/windows\s+?nt.+?trident\/[\d.]+.*rv:([\d.]+)/i,edge:/windows\s+?nt.+?edge?\/([\d.]+)/i,chrome:/windows\s+?nt.+?chrome\/([\d.]+)/i,firefox:/windows\s+?nt.+?firefox\/([\d.]+)/i,opera:/windows\s+?nt.+?opr\/([\d.]+)/i},osx:{os_version:/macintosh.+?([\d._]+)/i,safari:/macintosh.+?version\/([\d._]+).+?safari/i,edge:/macintosh.+?edge?\/([\d._]+)/i,
358
362
  chrome:/macintosh.+?chrome\/([\d._]+)/i,firefox:/macintosh.+?firefox\/([\d._]+)/i,opera:/macintosh.+?opr\/([\d._]+)/i},unknown:{ie:/.+?trident\/([\d.]+)/i,edge:/.+?edge?\/([\d.]+)/i,safari:/.+?version\/([\d._]+).+?safari/i,chrome:/.+?chrome\/([\d._]+)/i,firefox:/.+?firefox\/([\d._]+)/i,opera:/.+?opr\/([\d._]+)/i},android:{os_version:/android.+?([\d._]+)/i,chrome:/android.+?chrome\/([\d._]+)/i,firefox:/android.+?firefox\/([\d._]+)/i,opera:/android.+?opr\/([\d._]+)/i},ios:{os_version:/(?:iPad|iPhone).+?([\d._]+)/i,
359
363
  chrome:/.+?CriOS\/([\d._]+)/i,firefox:/.+?FxiOS\/([\d._]+)/i,safari:/.+?version\/([\d._]+).+?safari/i,opera:/.+?opr\/([\d._]+)/i},linux:{os_version:/linux.+?([\d._]+)/i,safari:/linux.+?version\/([\d._]+).+?safari/i,chrome:/linux.+?chrome\/([\d._]+)/i,firefox:/linux.+?firefox\/([\d._]+)/i,opera:/linux.+?opr\/([\d._]+)/i},tizen:{os_version:/tizen.+?([\d._]+)/i,safari:/linux.+?version\/([\d._]+).+?safari/i,chrome:/linux.+?chrome\/([\d._]+)/i,firefox:/linux.+?firefox\/([\d._]+)/i,opera:/linux.+?opr\/([\d._]+)/i},
360
- webos:{os_version:/linux.+?([\d._]+)/i,safari:/linux.+?version\/([\d._]+).+?safari/i,chrome:/linux.+?chrome\/([\d._]+)/i,firefox:/linux.+?firefox\/([\d._]+)/i,opera:/linux.+?opr\/([\d._]+)/i}};var T=class extends _.S{constructor(){super();this.g=new _.R("clpp.native.TrackManager");this.m=null;this.f=new _.ts;this.h=[];this.G=0;this.o={};this.I=[];this.a=new Map;this.w=null;this.l=new Map;this.A=!0;this.N=this.B.bind(this,_.K);this.S=this.F.bind(this,_.K);this.O=this.C.bind(this,_.K);this.T=this.B.bind(this,_.N);this.X=this.F.bind(this,_.N);this.W=this.C.bind(this,_.N);this.J=this.B.bind(this,_.L);this.L=this.F.bind(this,_.L);this.K=this.C.bind(this,_.L);this.j=null}Vd(){return!_.hk()}B(a,
361
- b){const c=this;return _.x(function*(){if(b){var d=b.track;if(d){var e=a===_.N,f=a===_.K,g=a===_.L||e,h=b.target,k=c.h.find(n=>wk(n,d,a));if(k)c.g.warn("Track from event already exists",d,k);else{var l=ij(a,d),m=xk(d);if(f){if(d.kind===_.ye)return;let n;void 0!==d.id?n=c.o[d.id]:n=Object.values(c.o).find(q=>wk(l,q,a));l.kind&&"captions"===l.kind&&(l.mimeType=_.yc);n&&(l.src=n.url,l.mimeType=n.mimeType)}else if(k=c.h.find(n=>n.type===a&&_.Yg(n,l,["kind","label","language"]))){k.id=d.id;m&&(c.g.debug(`Setting native ${a} track active`),
362
- c.a.set(a,k));c.g.debug("Track from event seems to already exists, flipped native track to",d);return}try{l.renditions.push(new _.pj(l.id,l));c.h.push(l);const n=c.m.getConfiguration().safari;zk(c,a,n)?yield Ak(c,l,n):Bk(c,a,n)&&(yield Ck(c,l,n));c.g.debug(a+" Track added",l);c.m.trigger(new _.E(_.dt));const q=Dk(c,a).length,u=!(!h||!h.length),v=h&&h.length||0;f=()=>{c.g.debug(`Setting native ${a} track active. `+`Native track active: ${m}. `+`Number of tracks: ${q}`,d);c.a.set(a,l)};m?f():1===q&&
363
- g&&(e?f():u&&1!==v||f())}catch(n){c.g.error("Error while converting track data",n)}}}else c.g.warn(ob)}else c.g.warn(lb)})}F(a,b){if(b){var c=b.track;c?a===_.K&&c.kind!==_.ye&&(b=this.h.find(d=>wk(d,c,a)))&&(this.h.splice(this.h.indexOf(b),1),(this.a.get(a)||null)===b&&(this.a.set(a,null),Ek(this)),this.g.debug(a+" Track removed, id: ",b.id)):this.g.warn(ob)}else this.g.warn(lb)}C(a,b){this.g.debug(a+" Track changed",b);a===_.K&&Ek(this);const c=Gk(this,a);if(c)for(let d=0;d<c.length;++d)if(xk(c[d])){if(b=
364
- this.h.find(e=>wk(e,c[d],a)))this.a.set(a,b),this.g.debug("Track change detected, id:",b.id),b===this.l.get(a)&&this.l.set(a,null),a===_.L?this.m.trigger(new _.E(_.Jk)):a===_.K&&this.m.trigger(new _.E(_.Kk));break}}initialize(a){this.m=a;this.j=new $s(a.getNetworkEngine())}load(){this.A=!1;var a=Fk(this,_.K);a&&(this.f.on(a,_.tc,this.N),this.f.on(a,wf,this.S),this.f.on(a,cd,this.O));if(a=Fk(this,_.L))this.f.on(a,_.tc,this.J),this.f.on(a,wf,this.L),this.f.on(a,cd,this.K);if(a=Fk(this,_.N))this.f.on(a,
365
- _.tc,this.T),this.f.on(a,wf,this.X),this.f.on(a,cd,this.W);this.f.one(this.m,Wc,this.H.bind(this))}release(){this.A=!0;this.h=[];this.o={};this.a.clear();this.l.clear();this.f.release()}destroy(){this.release();this.m=null}getVideoTracks(){return Dk(this,_.N)}getAudioTracks(){return Dk(this,_.L)}ka(){return Dk(this,_.K)}oa(){const a=this.a.get(_.N)||null;if(!a)return null;if(this.w){const b=a.renditions.find(c=>c.width===this.w.width&&c.height===this.w.height);if(b)return b}return a.renditions[0]||
366
- null}Qa(){return Hk(this,_.L)}Ia(){return Hk(this,_.K)}cb(){return Ik(this,_.N)}ob(){return Ik(this,_.L)}pb(){return Ik(this,_.K)}Ja(){return this.a.get(_.N)||null}na(){return this.a.get(_.L)||null}ua(){return this.a.get(_.K)||null}jb(a){Lk(this,_.N,a)}wa(a){Lk(this,_.L,a)}La(a){Lk(this,_.K,a)}Ya(a){Lk(this,_.N,a&&a.track)}hb(a){Lk(this,_.L,a&&a.track)}ib(a){Lk(this,_.K,a&&a.track)}addTextTrack(a){const b=this;return _.x(function*(){if(a.mimeType.match(/text\/vtt/)){const c="External_"+`${b.G++}`;
367
- b.o[c]=a;Mk(b,a,c)}else yield Nk(b,a)})}ra(){return 1>=this.getVideoTracks().flatMap(a=>a.renditions).length}H(){const a=this;return _.x(function*(){const b=a.m.getConfiguration();Pk(a,_.L,b.preferredAudioLanguage);if(!Gk(a,_.K).some(c=>xk(c))){const c=Fk(a,_.K);yield new Promise(d=>{a.f.one(c,cd,d);(new _.Tj(d)).ha(1)})}a.A||Pk(a,_.K,b.preferredTextLanguage)})}};T.prototype.isAbrEnabled=T.prototype.ra;T.prototype.addTextTrack=T.prototype.addTextTrack;T.prototype.setTextRendition=T.prototype.ib;
368
- T.prototype.setAudioRendition=T.prototype.hb;T.prototype.setVideoRendition=T.prototype.Ya;T.prototype.setTextTrack=T.prototype.La;T.prototype.setAudioTrack=T.prototype.wa;T.prototype.setVideoTrack=T.prototype.jb;T.prototype.getTextTrack=T.prototype.ua;T.prototype.getAudioTrack=T.prototype.na;T.prototype.getVideoTrack=T.prototype.Ja;T.prototype.getLoadingTextRendition=T.prototype.pb;T.prototype.getLoadingAudioRendition=T.prototype.ob;T.prototype.getLoadingVideoRendition=T.prototype.cb;
369
- T.prototype.getTextRendition=T.prototype.Ia;T.prototype.getAudioRendition=T.prototype.Qa;T.prototype.getVideoRendition=T.prototype.oa;T.prototype.getTextTracks=T.prototype.ka;T.prototype.getAudioTracks=T.prototype.getAudioTracks;T.prototype.getVideoTracks=T.prototype.getVideoTracks;T.prototype.canSelectVideoTracks=T.prototype.Vd;_.et=class{constructor(a,b="total"){this.length=(this.f=a)?a.length:0;this.a=[];this.type=b}start(a){if(this.f)return this.f.start(a);if(a<this.a.length)return this.a[a].start;throw Error(Lb);}end(a){if(this.f)return this.f.end(a);if(a<this.a.length)return this.a[a].end;throw Error(Lb);}Ga(){return!this.length||1===this.length&&1E-6>this.end(0)-this.start(0)?null:1===this.length&&0>this.start(0)?0:this.start(0)}ja(){return!this.length||1===this.length&&1E-6>this.end(0)-this.start(0)?null:this.end(this.length-
370
- 1)}tb(a,b=!0,c=0){if(!this.length||1===this.length&&1E-6>this.end(0)-this.start(0)||a>this.end(this.length-1))return!1;if(b)return c+a>=this.start(0)&&a<=this.end(this.length-1);for(b=0;b<this.length;b++)if(c+a>=this.start(b)&&a<=this.end(b))return!0;return!1}ya(a,b=!1){if(!this.length||1===this.length&&1E-6>this.end(0)-this.start(0))return 0;let c=0;if(b)b=this.ja(),null!=b&&(c=Math.max(0,b-a));else for(b=this.length-1;0<=b&&this.end(b)>a;--b)c+=this.end(b)-Math.max(this.start(b),a);return c}toString(){let a=
371
- "";for(let b=0;b<this.length;b++)0<b&&(a+=" "),a+=`${this.start(b).toFixed(3)}-${this.end(b).toFixed(3)}`;return a}};_.z("clpp.BufferInfo",_.et);_.et.prototype.bufferedAheadOf=_.et.prototype.ya;_.et.prototype.isBuffered=_.et.prototype.tb;_.et.prototype.bufferEnd=_.et.prototype.ja;_.et.prototype.bufferStart=_.et.prototype.Ga;_.et.prototype.end=_.et.prototype.end;_.et.prototype.start=_.et.prototype.start;_.ft=class{constructor(){this.Pc=new rs(this);this.Nc=[]}addEventListener(a,b){this.on(a,b)}removeEventListener(a,b){this.off(a,b)}on(a,b,c){return this.Pc.on(a,b,c)}one(a,b,c){return this.Pc.one(a,b,c)}off(a,b){return this.Pc.off(a,b)}forwardEventsTo(a){a&&(0<=this.Nc.indexOf(a)||this.Nc.push(a))}dispatchEvent(a){this.trigger(a);return a.defaultPrevented}stopForwardingEventsTo(a){a&&(a=this.Nc.indexOf(a),0<=a&&this.Nc.splice(a,1))}trigger(a){this.Pc.trigger(a);for(const b of this.Nc)b.dispatchEvent(a)}};
372
- _.ft.prototype.off=_.ft.prototype.off;_.ft.prototype.one=_.ft.prototype.one;_.ft.prototype.on=_.ft.prototype.on;_.ft.prototype.removeEventListener=_.ft.prototype.removeEventListener;_.ft.prototype.addEventListener=_.ft.prototype.addEventListener;_.z("clpp.events.ERROR",_.r);_.z("clpp.events.LOADEDMETADATA",_.se);_.z("clpp.events.BUFFERING_ENDED",_.Qc);_.z("clpp.events.BUFFERING_STARTED",_.Uc);_.z("clpp.events.STATE_CHANGED",_.Nf);_.Jk="audiotrackchanged";_.z("clpp.events.AUDIO_TRACK_CHANGED",_.Jk);_.Kk="texttrackchanged";_.z("clpp.events.TEXT_TRACK_CHANGED",_.Kk);_.z("clpp.events.VIDEO_TRACK_CHANGED",_.rg);_.z("clpp.events.BITRATE_CHANGED",_.Nc);_.dt="tracksadded";_.z("clpp.events.TRACKS_ADDED",_.dt);_.z("clpp.events.LOAD_START",te);
373
- _.z("clpp.events.RELEASING",_.vf);_.z("clpp.events.RELEASED",uf);_.z("clpp.events.DESTROYING","destroying");_.z("clpp.events.DESTROYED","destroyed");_.z("clpp.events.VIDEO_BUFFER_CHANGED",_.ng);_.z("clpp.events.AUDIO_BUFFER_CHANGED",_.Lc);_.z("clpp.events.DOWNLOAD_TRACE","downloadtrace");_.z("clpp.events.DRM_SESSION_UPDATE",_.Pd);_.z("clpp.events.DRM_SESSION_PERSISTED",_.Od);_.z("clpp.events.DRM_RENEWAL_STARTED",Nd);_.z("clpp.events.DRM_EXPIRATION_UPDATE",_.Md);
374
- _.z("clpp.events.AUTOPLAY_NOT_ALLOWED",_.Mc);_.z("clpp.events.PLAY",_.Te);_.z("clpp.events.SEEKING",_.Ff);_.z("clpp.events.SEEKED",_.Ef);_.z("clpp.events.USER_SEEKING",_.gg);_.z("clpp.events.USER_SEEKED",_.fg);_.Tn={SEEKING:1,NO_DATA:2};_.z("clpp.events.BufferingReasons",_.Tn);_.z("clpp.events.ADS_TIMELINE_CHANGED",_.uc);_.z("clpp.events.AD_LOADED",_.jc);_.z("clpp.events.AD_BREAK_STARTED",_.cc);_.z("clpp.events.AD_STARTED",_.qc);_.z("clpp.events.AD_BUFFERING",_.ec);_.z("clpp.events.AD_PROGRESS",_.nc);
375
- _.z("clpp.events.AD_FIRST_QUARTILE",_.hc);_.z("clpp.events.AD_MIDPOINT",_.lc);_.z("clpp.events.AD_THIRD_QUARTILE",_.sc);_.z("clpp.events.AD_PAUSED",_.mc);_.z("clpp.events.AD_RESUMED",_.oc);_.z("clpp.events.AD_SKIPPED",_.pc);_.z("clpp.events.AD_CLICKED",_.fc);_.z("clpp.events.AD_IMPRESSION",_.ic);_.z("clpp.events.AD_COMPLETED",_.gc);_.z("clpp.events.AD_STOPPED",_.rc);_.z("clpp.events.AD_BREAK_STOPPED",_.dc);_.z("clpp.events.SIMID_CREATIVE_STARTED",_.Hf);_.z("clpp.events.SIMID_CREATIVE_STOPPED",_.If);
376
- _.z("clpp.events.CASTING_STARTED",_.Xc);_.z("clpp.events.CASTING_ENDED","castingended");_.z("clpp.events.CAST_STATUS_CHANGED",_.Yc);_.z("clpp.events.AIRPLAY_STATUS_CHANGED",_.xc);_.z("clpp.events.AIRPLAY_CASTING_STARTED",_.wc);_.z("clpp.events.AIRPLAY_CASTING_ENDED",_.vc);_.uh="timeline-cue-added";_.z("clpp.events.TIMELINE_CUE_ADDED",_.uh);_.wh="timeline-cue-enter";_.z("clpp.events.TIMELINE_CUE_ENTER",_.wh);_.xh="timeline-cue-exit";_.z("clpp.events.TIMELINE_CUE_EXIT",_.xh);
377
- _.z("clpp.events.MPD_TYPE_CHANGED",_.Ce);_.z("clpp.events.LIVE_TURNED_STATIC",_.ne);_.z("clpp.events.VIMOND_RESPONSE",_.sg);_.z("clpp.events.PLAYLIST_ITEM_CHANGED",_.ef);_.z("clpp.events.PLAYLIST_MODIFIED",_.ff);_.z("clpp.events.SC_PLAYLIST_TIMELINE_CHANGED",_.Df);_.z("clpp.events.SC_PLAYLIST_ITEM_CHANGED",_.Bf);_.z("clpp.events.SC_PLAYLIST_ENDED",_.Af);_.z("clpp.events.SC_PLAYLIST_LIVE_TURNED_STATIC",_.Cf);_.z("clpp.events.CDN_SWITCH_SUCCESS",_.Zc);_.z("clpp.events.ONLINE_STATUS_CHANGED",Le);var Qk=["play() failed because the user didn't interact","The play method is not allowed by the user agent","The request is not allowed by the user agent or the platform"];_.z("clpp.version",_.fa);_.z("clpp.name",_.ra);_.Ok="application/x-mpegurl";_.z("clpp.Type",{DASH:_.zc,HLS:_.Ok,SMOOTH_STREAMING:_.Ec,MP4:_.mg});_.th="scte35";_.rh=bg;_.z("clpp.TimelineCueType",{SCTE35:_.th,DASH_CALLBACK:_.De,HLS_DATERANGE:_.ae,UNKNOWN:_.rh});_.z("clpp.SpeedUpMode",{DECODER:_.Dd,SEEK:"seek"});_.z("clpp.CodecSwitchingStrategy",{PREVENT:_.of,SMOOTH:_.Kf});var gt=class{};_.z("clpp.utils.PlayerConfiguration",gt);gt.create=_.Wk;var ht=["abort",Vc,Wc,Rd,"emptied",Td,_.Vd,_.r,"interruptbegin","interruptend",_.re,_.se,te,"mozaudioavailable",_.Pe,_.Te,_.df,_.rf,_.tf,_.Ef,_.Ff,Lf,"suspend",_.Xf,"volumechange",_.vg,_.wg,_.yf,Bg,Ag,yg,zg];_.it=class extends _.ft{constructor(a){super();this.log=new _.R(a);this.configuration=this.la=_.Uk();this.da=this.C=null;this.Xc=this.ve=!1;this.Qe=new _.R("clpp.video.events");this.$b=null;this.Bd=-1;this.ag=this.Yf.bind(this);this.se=new _.ap;this.L=new _.ts;this.vc=this.yc=this.O=null}init(a,b){this.configuration=this.la=b;this.C=a;this.log.info("Initializing Player surface");a=this.C.getMedia();this.log.info("Attaching media element listeners");for(const c of ht)this.L.on(a,c,this.ag,c!==_.r);
378
- this.$b||(this.$b=this.Pf());this.$b.initialize(this);this.C.showMediaElement()}release(){this.O&&(this.O.destroy(),this.O=null);return Promise.resolve()}destroy(){this.L.release();return this.se.release()}canPlay(a,b){return _.kh[this.namespace()].canPlay(a,b)}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.qb)}appendLoad(){return Promise.reject(_.qb)}seekWith(){return Promise.reject(_.qb)}play(){if(!this.da)return Promise.reject("No sources specified yet. You need to load content before calling play.");
379
- const a=this.C.getMedia().play();return Promise.resolve(a).catch(b=>{this.log.info("Caught play promise exception",b);const c={name:b.name||"",message:b.message||"",stack:b.stack||""};Rk(c)?(this.trigger(new _.E(_.Mc)),this.log.warn(_.ka)):c.name===rb&&this.log.warn('Unrecognized "NotAllowedError" on play(). '+`${b.name}: ${b.message}`);throw b;})}pause(){return this.da?new Promise((a,b)=>{const c=this.getState();if(c!==_.Rn&&c!==_.On&&c!==_.Zn&&c!==_.Yn)b();else if(this.C.getMedia().pause(),this.getState()===
380
- _.Zn)this.L.one(this,_.Nf,()=>{a()});else a()}):Promise.reject("No sources specified yet. You need to load content before calling pause.")}isPaused(){return this.C.getMedia().paused}isEnded(){return this.C.getMedia().ended}getConfiguration(){return this.configuration}setDrmCustomDataModifier(a){this.yc=a}setCdnErrorCallback(a){this.vc=a}Bc(){return this.yc}getSurface(){return this.C}getBufferInfo(a){const b=this.getSurface().getMedia();return new _.et(b?b.buffered:void 0,a)}getPosition(){return this.getMediaPosition()}getMediaPosition(){const a=
381
- this.C.getMedia();if(a)return a.currentTime;this.log.warn("No media element available, can not report current time!");return 0}seek(a){const b=this.getMediaPosition();if(void 0===a||null===a||typeof a!==_.t||a===b)return Promise.resolve();const c=this.C.getMedia();if(!c)return this.log.warn("No media element available, can not set current time!"),Promise.reject();const d=a-b;return.1>=Math.abs(d)?(this.log.info("Skip seek. Delta "+Math.abs(d)+" \x3c 0.1"),Promise.resolve()):new Promise((e,f)=>{const g=
382
- ()=>{this.trigger(new _.E(_.gg));this.L.on(c,_.Ef,h);this.L.on(c,_.Xf,h);this.L.on(c,_.rf,h);this.log.info("Seeking to "+a+". Delta "+d);this.Xc=this.ve=!0;c.currentTime=a},h=l=>{const m=this.getMediaPosition(),n=.1>=Math.abs(a-m);var q=.25<m-a;const u=c.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA,v=l.type===_.Ef,y=l.type===_.rf,B=l.type===_.Xf,D=y&&u;q=v||n&&D||B&&q;this.log.debug("Checking seeking state after "+l.type+" event. Seek completed:",q,"Current Time:",m,"Target Time:",a,"Native Event:",
383
- v,"Time reached",n,"Timeupdate:",B,"Progress:",y,"ReadyState:",u,"Progress Ready:",D);q?(this.Xc=this.ve=!1,this.L.off(c,_.Ef,h),this.L.off(c,_.Xf,h),this.L.off(c,_.rf,h),this.Pe(),this.trigger(new _.E(_.fg)),e()):y&&b===m&&(this.log.debug("Seek seemed to have been ignored. Trying again"),c.currentTime=a)},k=()=>{if(c.readyState>HTMLMediaElement.HAVE_NOTHING)g();else this.L.one(c,_.se,g)};this.getState()===_.Wn?(this.log.debug("Player is in IDLE state. Postpone seek."),this.L.one(this,_.Nf,()=>{switch(this.getState()){case _.Rn:case _.Zn:case _.Yn:this.log.debug("Valid seek state reached.");
384
- k();break;default:this.log.warn("Invalid seek target state. Aborting seek"),f()}})):k()})}getVolume(){const a=this.C.getMedia();if(a)return a.volume;this.log.warn("No media element available, can not report volume!");return null}setVolume(a){const b=this.C.getMedia();b?_.Xg(a)?0>a||1<a?this.log.warn(`Can not set volume to ${a}.
385
- Value must be between 0 and 1.`):b.volume=a:this.log.warn("Can not set volume to "+a+". Volume must be a number"):this.log.warn("No media element available, can not set volume !")}isMuted(){return this.C.getMedia().muted}setMuted(a){const b=this.C.getMedia();typeof a===_.Pc&&(b.muted=a)}getDuration(){return this.getMediaDuration()}getMediaDuration(){return this.da?this.C.getMedia().duration:-1}getTrackManager(){return this.$b}getPlaybackRate(){const a=this.C.getMedia();return a&&a.playbackRate||
386
- 1}setPlaybackRate(a){const b=this.C.getMedia();void 0!==a&&b&&(b.playbackRate=a)}setSourceIndex(a){this.Bd=a}getSourceIndex(){return this.Bd}getLoadedSource(){return this.da&&-1!==this.Bd?this.da[this.Bd]:null}getPeriods(){return[]}getNetworkEngine(){return this.se}setNetworkEngine(a){this.se=a}getTextDisplayer(){return this.O}getTimelineCues(){return[]}resetAbr(){}Yf(a){var b=this.getSurface().getMedia();const c=this.getPosition();let d="Received Video Element Event: '"+a.type+"' with playhead at: "+
387
- c;if(a.type===_.Xf||a.type===_.rf)this.Qe.debug(d);else{let e="";switch(a.type){case _.tf:e=`Rate: ${this.getPlaybackRate()}`;break;case Rd:e=`Duration: ${this.getDuration()}`;break;case "volumechange":e=`Volume: ${this.getVolume()} Muted: ${this.isMuted()}`;break;case _.Te:case _.df:case "suspend":case _.vg:case Lf:case _.Ff:case _.Ef:case _.Xf:case _.rf:case Vc:case Wc:b=this.getBufferInfo().ya(c);e=`State ${this.getSurface().getMedia().readyState} `+`Buffer: ${b}`;break;case _.yf:null!=b&&(e=`Size: ${b.videoWidth}x${b.videoHeight}`)}e&&
388
- (d+=". "+e);this.Qe.info(d)}a.type!==_.r&&this.trigger(new _.E(a.type,{detail:a}))}Pe(){}};_.it.prototype.getTextDisplayer=_.it.prototype.getTextDisplayer;_.it.prototype.setNetworkEngine=_.it.prototype.setNetworkEngine;_.it.prototype.getNetworkEngine=_.it.prototype.getNetworkEngine;var $k;$k=new _.R("clpp.Components");_.Yk=new Map;_.z("clpp.install",function(a){il(a)});_.z("clpp.uninstall",function(a){jl(a)});var jt=class{constructor(){this.a=this.f=null;this.g=new _.R("clpp.drm.csl")}release(){this.a=this.f=null}};_.z("clpp.drm.WidevineRobustnessLevel",{SW_SECURE_CRYPTO:_.Fb,SW_SECURE_DECODE:_.Gb,HW_SECURE_CRYPTO:Ya,HW_SECURE_DECODE:Za,HW_SECURE_ALL:Xa});_.z("clpp.drm.PlayreadyRobustnessLevel",{SL150:"150",SL2000:"2000",SL3000:"3000"});_.z("clpp.drm.KeySystem",{NONE:_.Ee,CLEAR_KEY:_.Ne,WIDEVINE:_.zd,PLAYREADY:_.xd,FAIRPLAY:_.vd,PRIMETIME:_.ud});_.nl={};_.z("clpp.drm.registerDrmEnvironment",_.ol);var rl={V1_STAGING:[10,191,2,8,3,18,16,40,112,52,84,192,8,246,54,24,173,231,68,61,182,196,200,24,139,231,249,144,5,34,142,2,48,130,1,10,2,130,1,1,0,181,33,18,184,208,93,2,63,204,93,149,226,194,81,193,198,73,180,23,124,216,210,190,239,53,91,176,103,67,222,102,30,61,42,188,49,130,183,153,70,213,95,220,8,223,233,84,7,129,94,154,98,116,179,34,162,199,245,224,103,187,95,10,192,122,137,212,90,234,148,178,81,111,7,91,102,239,129,29,13,38,225,185,166,184,148,242,185,133,121,98,170,23,28,79,102,99,13,62,76,
364
+ webos:{os_version:/linux.+?([\d._]+)/i,safari:/linux.+?version\/([\d._]+).+?safari/i,chrome:/linux.+?chrome\/([\d._]+)/i,firefox:/linux.+?firefox\/([\d._]+)/i,opera:/linux.+?opr\/([\d._]+)/i}};var T=class extends _.S{constructor(){super();this.g=new _.R("clpp.native.TrackManager");this.m=null;this.f=new _.Fs;this.h=[];this.G=0;this.o={};this.I=[];this.a=new Map;this.w=null;this.l=new Map;this.A=!0;this.M=this.B.bind(this,_.J);this.R=this.F.bind(this,_.J);this.O=this.C.bind(this,_.J);this.S=this.B.bind(this,_.L);this.X=this.F.bind(this,_.L);this.V=this.C.bind(this,_.L);this.J=this.B.bind(this,_.K);this.L=this.F.bind(this,_.K);this.K=this.C.bind(this,_.K);this.j=null}Td(){return!_.kk()}B(a,
365
+ b){const c=this;return _.w(function*(){if(b){var d=b.track;if(d){var e=a===_.L,f=a===_.J,g=a===_.K||e,h=b.target,k=c.h.find(n=>zk(n,d,a));if(k)c.g.warn("Track from event already exists",d,k);else{var l=kj(a,d),m=Ak(d);if(f){if(d.kind===_.ye)return;let n;void 0!==d.id?n=c.o[d.id]:n=Object.values(c.o).find(q=>zk(l,q,a));l.kind&&"captions"===l.kind&&(l.mimeType=_.Ac);n&&(l.src=n.url,l.mimeType=n.mimeType)}else if(k=c.h.find(n=>n.type===a&&_.Zg(n,l,["kind","label","language"]))){k.id=d.id;m&&(c.g.debug(`Setting native ${a} track active`),
366
+ c.a.set(a,k));c.g.debug("Track from event seems to already exists, flipped native track to",d);return}try{l.renditions.push(new _.tj(l.id,l));c.h.push(l);const n=c.m.getConfiguration().safari;Ck(c,a,n)?yield Dk(c,l,n):Ek(c,a,n)&&(yield Fk(c,l,n));c.g.debug(a+" Track added",l);c.m.trigger(new _.C(_.pt));const q=Gk(c,a).length,u=!(!h||!h.length),v=h&&h.length||0;f=()=>{c.g.debug(`Setting native ${a} track active. `+`Native track active: ${m}. `+`Number of tracks: ${q}`,d);c.a.set(a,l)};m?f():1===q&&
367
+ g&&(e?f():u&&1!==v||f())}catch(n){c.g.error("Error while converting track data",n)}}}else c.g.warn(ob)}else c.g.warn(lb)})}F(a,b){if(b){var c=b.track;c?a===_.J&&c.kind!==_.ye&&(b=this.h.find(d=>zk(d,c,a)))&&(this.h.splice(this.h.indexOf(b),1),(this.a.get(a)||null)===b&&(this.a.set(a,null),Hk(this)),this.g.debug(a+" Track removed, id: ",b.id)):this.g.warn(ob)}else this.g.warn(lb)}C(a,b){this.g.debug(a+" Track changed",b);a===_.J&&Hk(this);const c=Jk(this,a);if(c)for(let d=0;d<c.length;++d)if(Ak(c[d])){if(b=
368
+ this.h.find(e=>zk(e,c[d],a)))this.a.set(a,b),this.g.debug("Track change detected, id:",b.id),b===this.l.get(a)&&this.l.set(a,null),a===_.K?this.m.trigger(new _.C(_.Mk)):a===_.J&&this.m.trigger(new _.C(_.Nk));break}}initialize(a){this.m=a;this.j=new Zs(a.getNetworkEngine())}load(){this.A=!1;var a=Ik(this,_.J);a&&(this.f.on(a,_.vc,this.M),this.f.on(a,vf,this.R),this.f.on(a,ed,this.O));if(a=Ik(this,_.K))this.f.on(a,_.vc,this.J),this.f.on(a,vf,this.L),this.f.on(a,ed,this.K);if(a=Ik(this,_.L))this.f.on(a,
369
+ _.vc,this.S),this.f.on(a,vf,this.X),this.f.on(a,ed,this.V);this.f.one(this.m,Yc,this.H.bind(this))}release(){this.A=!0;this.h=[];this.o={};this.a.clear();this.l.clear();this.f.release()}destroy(){this.release();this.m=null}getVideoTracks(){return Gk(this,_.L)}getAudioTracks(){return Gk(this,_.K)}ha(){return Gk(this,_.J)}ma(){const a=this.a.get(_.L)||null;if(!a)return null;if(this.w){const b=a.renditions.find(c=>c.width===this.w.width&&c.height===this.w.height);if(b)return b}return a.renditions[0]||
370
+ null}Ta(){return Kk(this,_.K)}Ka(){return Kk(this,_.J)}jb(){return Lk(this,_.L)}zb(){return Lk(this,_.K)}Ab(){return Lk(this,_.J)}La(){return this.a.get(_.L)||null}la(){return this.a.get(_.K)||null}ta(){return this.a.get(_.J)||null}ub(a){Ok(this,_.L,a)}va(a){Ok(this,_.K,a)}Na(a){Ok(this,_.J,a)}ab(a){Ok(this,_.L,a&&a.track)}sb(a){Ok(this,_.K,a&&a.track)}tb(a){Ok(this,_.J,a&&a.track)}addTextTrack(a){const b=this;return _.w(function*(){if(a.mimeType.match(/text\/vtt/)){const c="External_"+`${b.G++}`;
371
+ b.o[c]=a;Pk(b,a,c)}else yield Qk(b,a)})}pa(){return 1>=this.getVideoTracks().flatMap(a=>a.renditions).length}H(){const a=this;return _.w(function*(){const b=a.m.getConfiguration();Sk(a,_.K,b.preferredAudioLanguage);if(!Jk(a,_.J).some(c=>Ak(c))){const c=Ik(a,_.J);yield new Promise(d=>{a.f.one(c,ed,d);(new _.Wj(d)).fa(1)})}a.A||Sk(a,_.J,b.preferredTextLanguage)})}};T.prototype.isAbrEnabled=T.prototype.pa;T.prototype.addTextTrack=T.prototype.addTextTrack;T.prototype.setTextRendition=T.prototype.tb;
372
+ T.prototype.setAudioRendition=T.prototype.sb;T.prototype.setVideoRendition=T.prototype.ab;T.prototype.setTextTrack=T.prototype.Na;T.prototype.setAudioTrack=T.prototype.va;T.prototype.setVideoTrack=T.prototype.ub;T.prototype.getTextTrack=T.prototype.ta;T.prototype.getAudioTrack=T.prototype.la;T.prototype.getVideoTrack=T.prototype.La;T.prototype.getLoadingTextRendition=T.prototype.Ab;T.prototype.getLoadingAudioRendition=T.prototype.zb;T.prototype.getLoadingVideoRendition=T.prototype.jb;
373
+ T.prototype.getTextRendition=T.prototype.Ka;T.prototype.getAudioRendition=T.prototype.Ta;T.prototype.getVideoRendition=T.prototype.ma;T.prototype.getTextTracks=T.prototype.ha;T.prototype.getAudioTracks=T.prototype.getAudioTracks;T.prototype.getVideoTracks=T.prototype.getVideoTracks;T.prototype.canSelectVideoTracks=T.prototype.Td;_.qt=class{constructor(a,b="total"){this.length=(this.f=a)?a.length:0;this.a=[];this.type=b}start(a){if(this.f)return this.f.start(a);if(a<this.a.length)return this.a[a].start;throw Error(Lb);}end(a){if(this.f)return this.f.end(a);if(a<this.a.length)return this.a[a].end;throw Error(Lb);}Ia(){return!this.length||1===this.length&&1E-6>this.end(0)-this.start(0)?null:1===this.length&&0>this.start(0)?0:this.start(0)}ga(){return!this.length||1===this.length&&1E-6>this.end(0)-this.start(0)?null:this.end(this.length-
374
+ 1)}Fb(a,b=!0,c=0){if(!this.length||1===this.length&&1E-6>this.end(0)-this.start(0)||a>this.end(this.length-1))return!1;if(b)return c+a>=this.start(0)&&a<=this.end(this.length-1);for(b=0;b<this.length;b++)if(c+a>=this.start(b)&&a<=this.end(b))return!0;return!1}xa(a,b=!1){if(!this.length||1===this.length&&1E-6>this.end(0)-this.start(0))return 0;let c=0;if(b)b=this.ga(),null!=b&&(c=Math.max(0,b-a));else for(b=this.length-1;0<=b&&this.end(b)>a;--b)c+=this.end(b)-Math.max(this.start(b),a);return c}toString(){let a=
375
+ "";for(let b=0;b<this.length;b++)0<b&&(a+=" "),a+=`${this.start(b).toFixed(3)}-${this.end(b).toFixed(3)}`;return a}};_.x("clpp.BufferInfo",_.qt);_.qt.prototype.bufferedAheadOf=_.qt.prototype.xa;_.qt.prototype.isBuffered=_.qt.prototype.Fb;_.qt.prototype.bufferEnd=_.qt.prototype.ga;_.qt.prototype.bufferStart=_.qt.prototype.Ia;_.qt.prototype.end=_.qt.prototype.end;_.qt.prototype.start=_.qt.prototype.start;_.rt=class{constructor(){this.Sc=new Ds(this);this.Qc=[]}addEventListener(a,b){this.on(a,b)}removeEventListener(a,b){this.off(a,b)}on(a,b,c){return this.Sc.on(a,b,c)}one(a,b,c){return this.Sc.one(a,b,c)}off(a,b){return this.Sc.off(a,b)}forwardEventsTo(a){a&&(0<=this.Qc.indexOf(a)||this.Qc.push(a))}dispatchEvent(a){this.trigger(a);return a.defaultPrevented}stopForwardingEventsTo(a){a&&(a=this.Qc.indexOf(a),0<=a&&this.Qc.splice(a,1))}trigger(a){this.Sc.trigger(a);for(const b of this.Qc)b.dispatchEvent(a)}};
376
+ _.rt.prototype.off=_.rt.prototype.off;_.rt.prototype.one=_.rt.prototype.one;_.rt.prototype.on=_.rt.prototype.on;_.rt.prototype.removeEventListener=_.rt.prototype.removeEventListener;_.rt.prototype.addEventListener=_.rt.prototype.addEventListener;var ur;ur=class{constructor(a,b){this.ya=a;this.sourceIndex=b}};_.Uk=new _.R("clpp.players");_.Tk={};_.x("clpp.events.ERROR",_.Vd);_.x("clpp.events.LOADEDMETADATA",_.se);_.x("clpp.events.BUFFERING_ENDED",_.Sc);_.x("clpp.events.BUFFERING_STARTED",_.Wc);_.x("clpp.events.STATE_CHANGED",_.Mf);_.Mk="audiotrackchanged";_.x("clpp.events.AUDIO_TRACK_CHANGED",_.Mk);_.Nk="texttrackchanged";_.x("clpp.events.TEXT_TRACK_CHANGED",_.Nk);_.x("clpp.events.VIDEO_TRACK_CHANGED",_.sg);_.x("clpp.events.BITRATE_CHANGED",_.Pc);_.pt="tracksadded";_.x("clpp.events.TRACKS_ADDED",_.pt);_.x("clpp.events.LOAD_START",te);
377
+ _.x("clpp.events.RELEASING",_.uf);_.x("clpp.events.RELEASED",tf);_.x("clpp.events.DESTROYING","destroying");_.x("clpp.events.DESTROYED","destroyed");_.x("clpp.events.VIDEO_BUFFER_CHANGED",_.rg);_.x("clpp.events.AUDIO_BUFFER_CHANGED",_.Nc);_.x("clpp.events.DOWNLOAD_TRACE","downloadtrace");_.x("clpp.events.DRM_SESSION_UPDATE",_.Od);_.x("clpp.events.DRM_SESSION_PERSISTED",_.Nd);_.x("clpp.events.DRM_RENEWAL_STARTED",Md);_.x("clpp.events.DRM_EXPIRATION_UPDATE",_.Ld);
378
+ _.x("clpp.events.AUTOPLAY_NOT_ALLOWED",_.Oc);_.x("clpp.events.PLAY",_.Te);_.x("clpp.events.SEEKING",_.Ef);_.x("clpp.events.SEEKED",_.Df);_.x("clpp.events.USER_SEEKING",_.gg);_.x("clpp.events.USER_SEEKED",_.fg);_.$n={SEEKING:1,NO_DATA:2};_.x("clpp.events.BufferingReasons",_.$n);_.x("clpp.events.ADS_TIMELINE_CHANGED",_.wc);_.x("clpp.events.AD_LOADED",_.mc);_.x("clpp.events.AD_BREAK_STARTED",_.cc);_.x("clpp.events.AD_STARTED",_.sc);_.x("clpp.events.AD_BUFFERING",_.ec);_.x("clpp.events.AD_PROGRESS",_.pc);
379
+ _.x("clpp.events.AD_FIRST_QUARTILE",_.hc);_.x("clpp.events.AD_MIDPOINT",_.nc);_.x("clpp.events.AD_THIRD_QUARTILE",_.uc);_.x("clpp.events.AD_PAUSED",_.oc);_.x("clpp.events.AD_RESUMED",_.qc);_.x("clpp.events.AD_SKIPPED",_.rc);_.x("clpp.events.AD_CLICKED",_.fc);_.x("clpp.events.AD_IMPRESSION",_.lc);_.x("clpp.events.AD_COMPLETED",_.gc);_.x("clpp.events.AD_STOPPED",_.tc);_.x("clpp.events.AD_BREAK_STOPPED",_.dc);_.x("clpp.events.AD_HLS_ASSET_LIST_REQUEST",ic);
380
+ _.x("clpp.events.AD_HLS_ASSET_LIST_RESPONSE",kc);_.x("clpp.events.SIMID_CREATIVE_STARTED",_.Gf);_.x("clpp.events.SIMID_CREATIVE_STOPPED",_.Hf);_.x("clpp.events.CASTING_STARTED",_.Zc);_.x("clpp.events.CASTING_ENDED","castingended");_.x("clpp.events.CAST_STATUS_CHANGED",_.$c);_.x("clpp.events.AIRPLAY_STATUS_CHANGED",_.zc);_.x("clpp.events.AIRPLAY_CASTING_STARTED",_.yc);_.x("clpp.events.AIRPLAY_CASTING_ENDED",_.xc);_.sh="timeline-cue-added";_.x("clpp.events.TIMELINE_CUE_ADDED",_.sh);_.uh="timeline-cue-enter";
381
+ _.x("clpp.events.TIMELINE_CUE_ENTER",_.uh);_.vh="timeline-cue-exit";_.x("clpp.events.TIMELINE_CUE_EXIT",_.vh);_.x("clpp.events.TIMELINE_CUES_CHANGED",_.Wf);_.x("clpp.events.MPD_TYPE_CHANGED",_.Ce);_.x("clpp.events.LIVE_TURNED_STATIC",_.me);_.x("clpp.events.VIMOND_RESPONSE",_.tg);_.x("clpp.events.PLAYLIST_ITEM_CHANGED",_.ef);_.x("clpp.events.PLAYLIST_MODIFIED",_.gf);_.x("clpp.events.SC_PLAYLIST_TIMELINE_CHANGED",_.Cf);_.x("clpp.events.SC_PLAYLIST_ITEM_CHANGED",_.Af);
382
+ _.x("clpp.events.SC_PLAYLIST_ENDED",_.zf);_.x("clpp.events.SC_PLAYLIST_LIVE_TURNED_STATIC",_.Bf);_.x("clpp.events.CDN_SWITCH_SUCCESS",_.ad);_.x("clpp.events.ONLINE_STATUS_CHANGED",Le);_.x("clpp.events.CMSD_EVENT","cmsd-event");var Xk=["play() failed because the user didn't interact","The play method is not allowed by the user agent","The request is not allowed by the user agent or the platform"];_.x("clpp.version",_.da);_.x("clpp.name",_.ra);_.Rk="application/x-mpegurl";_.x("clpp.Type",{DASH:_.Bc,HLS:_.Rk,SMOOTH_STREAMING:_.Gc,MP4:_.qg});_.rh="scte35";_.ph=bg;_.x("clpp.TimelineCueType",{SCTE35:_.rh,DASH_CALLBACK:_.De,HLS_DATERANGE:_.be,UNKNOWN:_.ph});_.x("clpp.SpeedUpMode",{DECODER:_.Cd,SEEK:"seek"});_.x("clpp.CodecSwitchingStrategy",{PREVENT:_.of,SMOOTH:_.Jf});var st=class{};_.x("clpp.utils.PlayerConfiguration",st);st.create=_.dl;var tt=["abort",Xc,Yc,Qd,"emptied",Sd,_.Ud,_.Vd,"interruptbegin","interruptend",_.re,_.se,te,"mozaudioavailable",_.Pe,_.Te,_.df,_.qf,_.sf,_.Df,_.Ef,Kf,"suspend",_.Xf,"volumechange",_.wg,_.xg,_.xf,Cg,Bg,zg,Ag];_.ut=class extends _.rt{constructor(a){super();this.log=new _.R(a);this.configuration=this.da=_.al();this.ea=this.C=null;this.jc=this.se=!1;this.Re=new _.R("clpp.video.events");this.Kb=null;this.Dc=-1;this.cg=this.$f.bind(this);this.ke=new _.gr;this.L=new _.Fs;this.he=this.wc=this.zc=this.O=null}init(a,b){this.configuration=this.da=b;this.C=a;this.log.info("Initializing Player surface");a=this.C.getMedia();this.log.info("Attaching media element listeners");for(const c of tt)this.L.on(a,c,this.cg,
383
+ c!==_.Vd);this.Kb||(this.Kb=this.Rf());this.Kb.initialize(this);this.C.showMediaElement()}release(){this.O&&(this.O.destroy(),this.O=null);return Promise.resolve()}destroy(){this.L.release();return this.ke.release()}canPlay(a,b){return _.Tk[this.namespace()].canPlay(a,b)}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.qb)}appendLoad(){return Promise.reject(_.qb)}seekWith(){return Promise.reject(_.qb)}setSeekInterceptor(){}play(){if(!this.ea)return Promise.reject("No sources specified yet. You need to load content before calling play.");
384
+ const a=this.C.getMedia().play();return Promise.resolve(a).catch(b=>{this.log.info("Caught play promise exception",b);const c={name:b.name||"",message:b.message||"",stack:b.stack||""};Yk(c)?(this.trigger(new _.C(_.Oc)),this.log.warn(_.ka)):c.name===rb&&this.log.warn('Unrecognized "NotAllowedError" on play(). '+`${b.name}: ${b.message}`);throw b;})}pause(){return this.ea?new Promise((a,b)=>{const c=this.getState();if(c!==_.Yn&&c!==_.Vn&&c!==_.go&&c!==_.fo)b(new _.G(_.E,7,3201,"The player state does not allow pause."));
385
+ else if(this.C.getMedia().pause(),this.getState()===_.go)this.L.one(this,_.Mf,()=>{a()});else a()}):Promise.reject(new _.G(_.E,7,3201,"No sources specified yet. You need to load content before calling pause."))}isPaused(){return this.C.getMedia().paused}isEnded(){return this.C.getMedia().ended}getConfiguration(){return this.configuration}setDrmCustomDataModifier(a){this.zc=a}setCdnErrorCallback(a){this.wc=a}Cc(){return this.zc}getSurface(){return this.C}getBufferInfo(a){const b=this.getSurface().getMedia();
386
+ return new _.qt(b?b.buffered:void 0,a)}getPosition(){return this.getMediaPosition()}getMediaPosition(){const a=this.C.getMedia();if(a)return a.currentTime;this.log.warn("No media element available, can not report current time!");return 0}seek(a){const b=this.getMediaPosition();if(void 0===a||null===a||typeof a!==_.r||a===b)return Promise.resolve();const c=this.C.getMedia();if(!c)return this.log.warn("No media element available, can not set current time!"),Promise.reject();const d=a-b;return.1>=Math.abs(d)?
387
+ (this.log.info("Skip seek. Delta "+Math.abs(d)+" \x3c 0.1"),Promise.resolve()):new Promise((e,f)=>{const g=()=>{this.trigger(new _.C(_.gg));this.L.on(c,_.Df,h);this.L.on(c,_.Xf,h);this.L.on(c,_.qf,h);this.log.info("Seeking to "+a+". Delta "+d);this.jc=this.se=!0;c.currentTime=a},h=l=>{const m=this.getMediaPosition(),n=.1>=Math.abs(a-m);var q=.25<m-a;const u=c.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA,v=l.type===_.Df,y=l.type===_.qf,A=l.type===_.Xf,D=y&&u;q=v||n&&D||A&&q;this.log.debug("Checking seeking state after "+
388
+ l.type+" event. Seek completed:",q,"Current Time:",m,"Target Time:",a,"Native Event:",v,"Time reached",n,"Timeupdate:",A,"Progress:",y,"ReadyState:",u,"Progress Ready:",D);q?(this.jc=this.se=!1,this.L.off(c,_.Df,h),this.L.off(c,_.Xf,h),this.L.off(c,_.qf,h),this.Qe(),this.trigger(new _.C(_.fg)),e()):y&&b===m&&(this.log.debug("Seek seemed to have been ignored. Trying again"),c.currentTime=a)},k=()=>{if(c.readyState>HTMLMediaElement.HAVE_NOTHING)g();else this.L.one(c,_.se,g)};this.getState()===_.co?
389
+ (this.log.debug("Player is in IDLE state. Postpone seek."),this.L.one(this,_.Mf,()=>{switch(this.getState()){case _.Yn:case _.go:case _.fo:this.log.debug("Valid seek state reached.");k();break;default:this.log.warn("Invalid seek target state. Aborting seek"),f()}})):k()})}getVolume(){const a=this.C.getMedia();if(a)return a.volume;this.log.warn("No media element available, can not report volume!");return null}setVolume(a){const b=this.C.getMedia();b?_.Yg(a)?0>a||1<a?this.log.warn(`Can not set volume to ${a}.
390
+ Value must be between 0 and 1.`):b.volume=a:this.log.warn("Can not set volume to "+a+". Volume must be a number"):this.log.warn("No media element available, can not set volume !")}isMuted(){return this.C.getMedia().muted}setMuted(a){const b=this.C.getMedia();typeof a===_.Rc&&(b.muted=a)}getDuration(){return this.getMediaDuration()}getMediaDuration(){return this.ea?this.C.getMedia().duration:-1}getTrackManager(){return this.Kb}getPlaybackRate(){const a=this.C.getMedia();return a&&a.playbackRate||
391
+ 1}setPlaybackRate(a){const b=this.C.getMedia();void 0!==a&&b&&(b.playbackRate=a)}setSourceIndex(a){this.Dc=a}getSourceIndex(){return this.Dc}getLoadedSource(){return this.ea&&-1!==this.Dc?this.ea[this.Dc]:null}getPeriods(){return[]}getNetworkEngine(){return this.ke}setNetworkEngine(a){this.ke=a}setCmsdManager(a){this.he=a}getTextDisplayer(){return this.O}getTimelineCues(){return[]}getCueTimeline(){return null}resetAbr(){}$f(a){var b=this.getSurface().getMedia();const c=this.getPosition();let d="Received Video Element Event: '"+
392
+ a.type+"' with playhead at: "+c;if(a.type===_.Xf||a.type===_.qf)this.Re.debug(d);else{let e="";switch(a.type){case _.sf:e=`Rate: ${this.getPlaybackRate()}`;break;case Qd:e=`Duration: ${this.getDuration()}`;break;case "volumechange":e=`Volume: ${this.getVolume()} Muted: ${this.isMuted()}`;break;case _.Te:case _.df:case "suspend":case _.wg:case Kf:case _.Ef:case _.Df:case _.Xf:case _.qf:case Xc:case Yc:b=this.getBufferInfo().xa(c);e=`State ${this.getSurface().getMedia().readyState} `+`Buffer: ${b}`;
393
+ break;case _.xf:null!=b&&(e=`Size: ${b.videoWidth}x${b.videoHeight}`)}e&&(d+=". "+e);this.Re.info(d)}a.type!==_.Vd&&this.trigger(new _.C(a.type,{detail:a}))}Qe(){}};_.ut.prototype.getTextDisplayer=_.ut.prototype.getTextDisplayer;_.ut.prototype.setNetworkEngine=_.ut.prototype.setNetworkEngine;_.ut.prototype.getNetworkEngine=_.ut.prototype.getNetworkEngine;var hl;hl=new _.R("clpp.Components");_.fl=new Map;_.x("clpp.install",function(a){pl(a)});_.x("clpp.uninstall",function(a){ql(a)});var vt=class{constructor(){this.a=this.f=null;this.g=new _.R("clpp.drm.csl")}release(){this.a=this.f=null}};_.x("clpp.drm.WidevineRobustnessLevel",{SW_SECURE_CRYPTO:_.Fb,SW_SECURE_DECODE:_.Gb,HW_SECURE_CRYPTO:Ya,HW_SECURE_DECODE:$a,HW_SECURE_ALL:Xa});_.x("clpp.drm.PlayreadyRobustnessLevel",{SL150:"150",SL2000:"2000",SL3000:"3000"});_.x("clpp.drm.KeySystem",{NONE:_.Ee,CLEAR_KEY:_.Ne,WIDEVINE:_.yd,PLAYREADY:_.wd,FAIRPLAY:_.ud,PRIMETIME:_.td});_.ul={};_.x("clpp.drm.registerDrmEnvironment",_.vl);var yl={V1_STAGING:[10,191,2,8,3,18,16,40,112,52,84,192,8,246,54,24,173,231,68,61,182,196,200,24,139,231,249,144,5,34,142,2,48,130,1,10,2,130,1,1,0,181,33,18,184,208,93,2,63,204,93,149,226,194,81,193,198,73,180,23,124,216,210,190,239,53,91,176,103,67,222,102,30,61,42,188,49,130,183,153,70,213,95,220,8,223,233,84,7,129,94,154,98,116,179,34,162,199,245,224,103,187,95,10,192,122,137,212,90,234,148,178,81,111,7,91,102,239,129,29,13,38,225,185,166,184,148,242,185,133,121,98,170,23,28,79,102,99,13,62,76,
389
394
  96,39,24,137,127,94,30,249,182,170,245,173,77,186,42,126,20,23,109,241,52,161,211,24,91,90,33,138,192,90,76,65,240,129,239,255,128,163,160,64,197,11,9,187,199,64,238,220,216,241,77,103,90,145,152,15,146,202,125,220,100,106,6,173,173,81,1,247,74,14,73,140,192,31,0,83,43,172,33,120,80,189,144,94,144,146,54,86,183,223,239,239,66,72,103,103,243,62,246,40,61,79,66,84,171,114,88,147,144,190,229,88,8,241,214,104,8,13,69,216,147,194,188,162,247,77,96,160,192,208,160,153,60,239,1,96,71,3,51,76,54,56,19,148,
390
395
  134,188,157,175,36,253,103,160,127,154,217,67,2,3,1,0,1,58,18,115,116,97,103,105,110,103,46,103,111,111,103,108,101,46,99,111,109,18,128,3,152,62,48,53,38,117,244,11,167,21,252,36,155,218,229,212,172,114,73,162,102,101,33,228,54,85,115,149,41,114,31,248,128,224,170,239,197,226,123,201,128,218,234,218,191,63,195,134,208,132,160,44,130,83,120,72,204,117,63,244,151,176,17,167,218,151,120,138,0,226,170,107,132,205,125,113,192,122,72,235,246,22,2,204,165,163,243,32,48,167,41,92,48,218,145,91,145,220,24,
391
396
  185,188,149,147,184,222,139,181,15,13,237,193,41,56,184,233,224,57,205,222,24,250,130,232,27,176,50,99,15,233,85,216,90,86,108,225,84,48,11,246,212,193,189,18,105,102,53,107,40,125,101,123,24,206,99,208,239,212,95,197,38,158,151,234,177,28,181,99,229,86,67,178,111,244,159,16,156,33,1,175,202,243,91,131,47,40,143,13,157,69,150,14,37,158,133,251,93,36,219,210,207,130,118,76,93,217,191,114,126,251,233,200,97,248,105,50,31,106,222,24,144,95,77,146,249,166,218,101,54,219,132,117,135,29,22,142,135,11,178,
@@ -399,102 +404,98 @@ c;if(a.type===_.Xf||a.type===_.rf)this.Qe.debug(d);else{let e="";switch(a.type){
399
404
  21,58,231,13,118,215,58,166,74,44,51,103,50,120,198,197,213,64,34,105,66,115,72,235,88,51,28,238,54,93,147,140,187,28,173,50,109,5,234,155,141,29,52,234,135,38,55,103,111,116,98,171,210,13,211,129,249,70,57,64,155,151,38,8,225,188,229,3,247,234,26,46,91,211,250,252,38,87,111,205,37,108,74,168,112,74,116,191,73,170,243,167,54,36,20,23,72,67,35,181,159,241,102,250,221,22,18,92,161,54,236,172,183,214,18,160,199,92,46,171,180,211,90,64,62,144,121,201,77,74,211,17,244,49,124,244,120,116,148,234,184,79,
400
405
  136,12,176,34,231,39,149,87,28,219,2,3,1,0,1,58,12,99,97,115,116,108,97,98,115,46,99,111,109,64,1,18,128,3,50,97,151,165,120,63,210,172,84,187,10,36,166,202,149,32,118,107,37,251,186,217,170,254,4,95,20,85,66,157,43,154,24,66,136,147,101,223,78,204,173,228,175,111,100,168,97,164,222,84,160,51,79,233,227,223,105,252,85,11,242,129,199,206,11,9,236,118,163,118,204,179,159,69,108,223,229,114,176,8,26,36,9,23,103,233,62,55,162,154,209,96,98,102,80,173,114,233,213,36,56,135,65,188,245,176,95,70,189,199,
401
406
  143,81,72,182,124,207,225,238,28,172,144,110,89,44,12,137,51,52,239,130,117,119,15,207,200,229,142,166,8,80,79,111,255,191,70,47,189,108,75,234,184,241,119,21,255,98,167,124,132,30,239,102,113,7,132,96,39,134,123,220,209,255,110,222,35,147,0,77,125,253,129,139,66,158,126,221,13,117,113,163,143,235,9,130,180,3,133,94,152,45,199,69,168,182,95,122,82,25,203,10,99,191,186,193,238,225,224,140,156,142,171,110,26,214,32,240,6,218,138,10,47,114,133,17,1,151,43,213,223,198,210,186,81,18,50,221,84,177,180,
402
- 26,58,164,235,113,177,235,207,22,230,8,119,76,167,166,176,173,209,214,53,116,116,231,227,221,238,174,87,249,19,166,195,81,47,210,172,15,75,251,202,192,80,85,213,23,17,178,104,181,193,115,239,91,72,230,167,55,143,10,250,26,54,8,60,13,213,206,235,3,215,179,205,232,1,144,158,35,48,196,149,117,219,63,196,130,117,40,165,193,65,215,122,44,201,218,67,216,6,131,178,5,168,229,21,137,112,215,254,127,48,160,181,68,49,255,64,46,247,236,85,155,146,208,5,219,252,37,174,31,218,136,135,55,119,112]};_.kt=class{constructor(a){this.I=a;this.f={}}Ta(a,b){this.f[a]=b}};_.z("clpp.drm.DrmEnvironment",_.kt);_.kt.prototype.setDrmSystem=_.kt.prototype.Ta;_.Ol=class{constructor(a,b){b=void 0===b?!1:b;this.f=_.Xg(a)?new DataView(new ArrayBuffer(a),0,a):a;this.a=0;this.h=b;this.buffer=this.f.buffer}getPosition(){return this.a}Ha(){return this.f.byteLength}seek(a){(0>a||a>=this.f.byteLength)&&_.tl();this.a=a}};_.ym=class{constructor(a,b){this.f=a;this.h=void 0===b?!0:b;this.a=0}getPosition(){return this.a}Ha(){return this.f.byteLength}skip(a){this.a+a>this.f.byteLength&&_.wl();this.a+=a}seek(a){if(0>a||a>=this.f.byteLength)throw _.wl();this.a=a}};
403
- _.z("clpp.utils.dataview.DataViewReader",_.ym);_.Ml=class{constructor(){this.h=[];this.f=[];this.a=!1;this.g=new _.R("clpp.mp4")}M(a,b){a=Dl(a);this.h[a]=lt;this.f[a]=b;return this}ca(a,b){a=Dl(a);this.h[a]=mt;this.f[a]=b;return this}stop(){this.a=!0}parse(a,b){a=_.J(a);a=new _.ym(new DataView(a.buffer,a.byteOffset,a.byteLength),!1);for(this.a=!1;_.vl(a)&&!this.a;)this.Ld(0,a,b)}Ld(a,b,c){const d=b.getPosition();let e=_.P(b);var f=_.P(b);let g=!1;this.g.debug("Parsing MP4 box",_.El(f));switch(e){case 0:e=b.Ha()-d;break;case 1:e=_.Al(b),g=!0}const h=
404
- this.f[f];if(h){let m=null;var k=null;this.h[f]===mt&&(k=_.P(b),m=k>>>24,k&=16777215);f=b.getPosition()-d;var l=d+e;c&&l>b.Ha()&&(l=b.Ha());l-=b.getPosition();b=0<l?_.Cl(b,l):new Uint8Array(0);b=new _.ym(new DataView(b.buffer,b.byteOffset,b.byteLength),!1);h({parser:this,partialOkay:c||!1,version:m,flags:k,reader:b,size:e,start:d+a,headerSize:f,has64BitSize:g})}else a=Math.min(d+e-b.getPosition(),b.Ha()-b.getPosition()),b.skip(a)}};_.z("clpp.utils.Mp4Parser",_.Ml);_.Ml.typeToString=_.El;
405
- _.Ml.allData=_.Hl;_.Ml.sampleDescription=_.Gl;_.Ml.children=_.Fl;_.Ml.prototype.parseNext=_.Ml.prototype.Ld;_.Ml.prototype.parse=_.Ml.prototype.parse;_.Ml.prototype.stop=_.Ml.prototype.stop;_.Ml.prototype.fullBox=_.Ml.prototype.ca;_.Ml.prototype.box=_.Ml.prototype.M;_.Ml.headerSize=_.Il;var lt=0,mt=1;var nt=class{};_.z("clpp.utils.FairplayUtils",nt);nt.parseFairPlayResponse=_.Rl;nt.formatFairPlayRequest=_.Ql;nt.createFairplayPayload=Pl;nt.extractContentId=_.Ll;nt.extractExtXKeyUri=Jl;var Xl=new _.R("clpp.drm.DrmToday"),gm="PRODUCTION",hm="STAGING",im="TEST",ot={PRODUCTION:gm,STAGING:hm,TEST:im};_.z("clpp.drm.DrmToday.Environment",ot);_.z("clpp.drm.DrmToday.WidevineCertificates",{V1_PROD:"V1_PROD",V1_STAGING:"V1_STAGING",V2:"V2"});
406
- var Tl="/license-proxy-widevine/cenc/",Ul="/license-proxy-headerauth/drmtoday/RightsManager.asmx",Vl="/license-server-fairplay/",jm={"00000":"Success","01000":"General Internal Error","02000":"General Request Error","03000":"General Request Authentication Error",10001:"Bad Request",3E4:"General DRM error",4E4:"General Widevine Modular error",40001:"Widevine Device Certificate Revocation (wv 127)",40002:"Widevine Device Certificate Revocation - Permanently (wv 175)",41E3:"General Widevine Classic error",
407
- 42E3:"General Playready error",43E3:"General Fairplay error",44E3:"General OMA error",44001:"OMA Device registration failed",45E3:"General CDRM error",45001:"CDRM Device registration failed",6E4:"CSL",60001:"CSL - INVALID",60100:"CSL - Denied by Stream Limiting",7E4:"General Output Protection",70001:"All keys filtered by EOP settings",8E4:"TAKE DOWN",80001:"TAKE DOWN - Denied by Take Down",9E4:"General GBL error",90001:"License delivery prohibited in your region"},pt=[Xa,Za,Ya,_.Gb,_.Fb],qt=[Xa,Za,
408
- Ya,_.Gb,_.Fb],rt=["3000","2000","150"],st=["2000","150"];
409
- for(const a of Object.keys(ot)){let b=xa;a!==gm&&(b+=`_${a}`);const c=new _.kt(b);let d=null;switch(a){case gm:case hm:d=sl("V2");break;case im:d=null}c.Ta(_.zd,{licenseUrl:Wl(_.zd,a),videoRobustness:pt,audioRobustness:qt,persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:d,modifiers:{licenseRequest:_.Zl,licenseResponse:_.$l}});c.Ta(_.vd,{licenseUrl:Wl(_.vd,a),certificateUrl:Sl(a)+"/license-server-fairplay/cert/",modifiers:{licenseRequest:_.bm,licenseResponse:_.cm,extractContentId:_.dm,
410
- certificateRequest:_.em}});c.Ta(_.xd,{licenseUrl:Wl(_.xd,a),videoRobustness:rt,audioRobustness:st,modifiers:{licenseRequest:fm}});_.ol(c)};var tt=class{};_.z("clpp.drm.eme.EmeFactory",tt);var lm=[];tt.Apis={STANDARD:Eb,APPLE:"APPLE",WEBKIT:"WEBKIT",NOP:"NOP"};var tm,ut,sm;_.Em=[154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149];tm=[237,239,139,169,121,214,74,206,163,200,39,220,213,29,33,237];ut=class{constructor(a,b,c){this.j=new Uint8Array(a);this.a=b;this.f=c}};sm=class extends ut{};_.Dm=class extends ut{constructor(a,b,c,d,e,f){f=void 0===f?null:f;super(a,b,d);this.version=e;this.h=c;this.l=f}};var Gm=!!(performance&&performance.mark&&performance.measure);var fn=class{constructor(a){this.f=[];this.h=[];this.a=[];8<=a.byteLength&&(new _.Ml).ca("pssh",this.j.bind(this)).parse(a.buffer);0===this.a.length&&_.C("No pssh box found!")}j(a){if(1<a.version)_.C("Unrecognized PSSH version found!");else{var b=_.Gi(_.Cl(a.reader,16)),c=[];if(0<a.version){var d=_.P(a.reader);for(let e=0;e<d;++e){const f=_.Gi(_.Cl(a.reader,16));c.push(f)}}d=_.P(a.reader);a.reader.skip(d);this.h.push.apply(this.h,c);this.f.push(b);this.a.push({start:a.start,end:a.start+a.size-1});
411
- a.reader.getPosition()!==a.reader.Ha()&&_.C("Mismatch between box size and data size!")}}};var bn,vt;
412
- _.io=class{constructor(a){this.D=a;this.H=new Set;this.A=this.G=this.j=null;this.O=!1;this.a=null;this.I=vt;this.w=new _.ts;this.K=new jt;this.f=new Map;this.J=[];this.F=new _.dn;this.h=null;this.U=b=>{this.o=!0;this.B=!1;this.F.reject(b);a.onError(b)};this.l=new Map;this.W=new Map;this.S=new _.Tj(()=>Vm(this));this.va=!1;this.Z=new _.dn;this.C=!1;this.T=[];this.aa=!1;this.N=0;this.g=new _.R("clpp.drm.DrmEngine");this.X=(new _.Tj(()=>{Wm(this)})).kb(1);this.F.catch(()=>{});this.o=this.B=!1;this.L=
413
- null}destroy(){const a=this;return _.x(function*(){a.va?yield a.Z:(a.va=!0,yield Xm(a),a.Z.resolve())})}keySystem(){return this.a?_.Lm(this.a.keySystem):""}getDrmInfo(){return this.a}ea(a){const b=this;return _.x(function*(){if(!b.C||b.I!==bn){var c=Math.floor(a.timeStamp),d=`drm.msg.${c}.start`,e=`drm.msg.${c}.end`;_.Hm(d);!b.h.delayLicenseRequestUntilPlayed||b.A&&!b.A.paused||b.aa?yield ln(b,a):b.T.push(a);_.Hm(e);_.Im(`drm.sess.msg.${c}`,d,e)}})}ga(a){const b=a.target;this.g.info("Key status changed for session",
414
- b.sessionId);const c=this.f.get(b);let d=!1;b.keyStatuses.forEach((e,f)=>{if(typeof f===_.Qf){var g=f;f=e;e=g}if(Km(this.a.keySystem)&&16===f.byteLength&&_.Vj()){g=_.li(f);const k=g.getUint32(0,!0),l=g.getUint16(4,!0),m=g.getUint16(6,!0);g.setUint32(0,k,!1);g.setUint16(4,l,!1);g.setUint16(6,m,!1)}c&&e!==Of&&(c.loaded=!0);c&&c.Ka&&c.Ka.resolve();"expired"===e&&(d=!0);f=_.J(f);let h=_.Gi(f);"00"===h&&c&&c.keyId?h=c.keyId:this.a.keySystem.startsWith(_.vd)&&16!==f.byteLength&&(h=ni(f));(f=h||"")?this.g.info(`Key status for Key ID '${h}': ${e}`):
415
- this.g.info(`Key status global keys: ${e}`);this.l.set(f,e);c&&!c.keyId&&this.f.forEach((k,l)=>{l===b||k.keyId!==h||k.loaded||(k.loaded=!0)})});c&&c.loaded&&c.ab.forEach(e=>{this.l.get(e)===Of&&(this.g.warn(`Key status for Key ID '${e}': 'output-restricted'`),this.l.set(e,_.Oe))});for(a=0;a<this.a.initData.length;a++){const e=this.a.initData[a];e.keyId&&this.l.get(e.keyId)===Of&&_.Hi(e.initData,c.initData)&&(this.g.warn(`Key status for Key ID '${e.keyId}': 'output-restricted'`),this.l.set(e.keyId,
416
- _.Oe))}a=b.expiration-Date.now();(0>a||d&&1E3>a)&&c&&!c.xb&&(this.g.debug("Session has expired",b.sessionId),(a=this.f.get(b))&&a.wc&&a.wc.stop(),this.f.delete(b),b.close().catch(()=>{}));un(this)&&(this.F.resolve(),1!==this.f.size||d?this.S.ha(.5):Vm(this))}};bn=0;vt=3;_.Bn=new Map;_.Cn=new _.R("clpp.text");var wt=class{constructor(){this.a=null;this.f=[]}};var xt=class{constructor(){this.h=this.f=this.j=null;this.a=[]}};_.yt=class{constructor(){this.f=this.o=this.A=this.C=this.j=this.l=this.h=this.w=NaN;this.a=new wt;this.B=new xt}getStats(){return{width:this.w,height:this.h,streamBandwidth:this.o,decodedFrames:this.j,droppedFrames:this.l,corruptedFrames:this.C,estimatedBandwidth:this.f,loadLatency:this.A,playTime:Gn(this.a,_.Zn),pauseTime:Gn(this.a,_.Yn),bufferingTime:Gn(this.a,_.Rn),stateHistory:Hn(this.a),switchHistory:In(this.B)}}};_.zt=class{constructor(a){this.f=a;this.a=void 0}value(){void 0===this.a&&(this.a=this.f());return this.a}};var Kn=new _.zt(()=>new Map([[HTMLMediaElement.HAVE_METADATA,_.se],[HTMLMediaElement.HAVE_CURRENT_DATA,_.re],[HTMLMediaElement.HAVE_FUTURE_DATA,Vc],[HTMLMediaElement.HAVE_ENOUGH_DATA,Wc]]));var Bt=class{constructor(a){this.g=new _.R("clpp.StateManager");this.m=a;this.a=new _.ts;this.f=_.Wn;this.A=_.At;this.H=0;this.w=-1;this.K=this.o=this.I=this.B=0;this.j=this.h=this.F=!1;this.G=0;this.l=null;this.J=0;this.L=_.hk();this.C=!1;this.I=Date.now();Pn(this)}Zb(a,b){this.m&&this.m.trigger(new _.E(a,{detail:b}))}getState(){return Sn(this,"")}U(a){(a=a&&a.detail)&&a.severity&&a.severity===_.F&&Nn(this,_.Vn)}destroy(){this.g.debug("Stop watching for video events for "+this.m.namespace());this.a.release()}};_.z("clpp.utils.media.detectType",$n);var co=new _.R("clpp.sources");var Ct=class extends _.it{constructor(){super(od);this.w=this.G=!1;this.l=this.A=this.o=this.a=this.j=null;this.h=new _.ts;this.F=this.B=this.f=this.H=null}init(a,b){super.init(a,b);this.j=new Bt(this);Nn(this.j,_.Wn)}namespace(){return od}unload(){const a=this;return _.x(function*(){if(a.da){a.log.debug("Releasing player with source",a.da);a.B&&(a.B.stop(),a.B=null);const b=a.getTrackManager();b&&b.release();a.A&&(a.A.destroy(),a.A=null);a.O&&(a.O.destroy(),a.O=null);a.l&&a.l.release();a.o&&(a.o.destroy(),
417
- a.o=null);_.ph(a.h);a.f&&(a.f=new _.yt);a.F=null;a.da=null;a.G=!1;a.a&&(a.a.removeAttribute("src"),a.a.load());yield fo(a)}})}release(){return super.release().then(()=>this.unload()).then(()=>{this.j&&Nn(this.j,_.Wn)})}destroy(){if(this.w)return this.log.warn("Player is already destroyed!"),Promise.resolve();this.w=!0;return super.destroy().then(()=>this.release()).then(()=>{this.log.debug(za);const a=this.getTrackManager();a&&a.destroy();this.l&&(this.l.destroy().catch(b=>{this.log.warn("Error while disposing metadata handler",
418
- b)}),this.l=null);this.j&&(this.j.destroy(),this.j=null);this.f=null})}getDrmInfo(){return this.o?this.o.getDrmInfo():null}detach(){}getTrackManager(){return this.$b}load(a){const b=this;return _.x(function*(){if(b.w)return eo();if(!b.getSurface()||!b.getSurface().getMedia())return Promise.reject("No surface or no media element in surface");const c=b.C.getMedia();b.H=Date.now()/1E3;b.f=new _.yt;b.h.on(b,_.Nf,()=>{b.f&&_.Fn(b.f.a,b.getState())});Nn(b.j,_.Xn);b.da=_.bo(a);b.configuration=_.Wk(b.la,
419
- a);b.log.debug(_.fb,b.configuration);b.log.debug(_.yb,b.da);const d=_.En(b.configuration,[_.be,"native"]);b.O=d.create(b);b.O.setTextVisibility(!0);b.configuration.enableHtmlCue&&_.Zk(_.Tf)&&!_.jk()&&(b.A=new Hs(b),b.A.start(c));b.l?b.l.release():b.l=new us(b);zh(b.l,c);b.getTrackManager().load();c.loop=!!b.configuration.loop;_.A(b.configuration.volume)||b.setVolume(b.configuration.volume);_.A(b.configuration.muted)||b.setMuted(b.configuration.muted);b.h.one(c,Vc,()=>{b.trigger(new _.E(_.dt))});null==
420
- b.configuration.startTime&&no(b,c);_.hk()&&oo(b,c);try{yield ho(b,c),yield jo(b),yield mo(b).R}catch(e){b.G=!1,b.onError(e)}})}onError(a){this.G||(a.severity===_.F&&null!==this.j&&Nn(this.j,_.Vn),this.trigger(new _.E(_.r,{detail:a})))}Pf(){return new T}getState(){return null!==this.j?this.j.getState().currentState:_.At}getPresentationStartTime(){if(this.a&&this.a.getStartDate&&this.isLive()){const a=this.a.getStartDate();return isNaN(a.getTime())?(this.log.warn("EXT-X-PROGRAM-DATETIME required to get presentation start time as Date!"),
421
- null):a.getTime()/1E3}return null}getSeekRange(){var a=this.getSurface().getMedia();if(a&&a.src){a=a.seekable;if(a.length)return this.F=a={start:a.start(0),end:a.end(a.length-1)};if(this.F)return this.F}return{start:0,end:0}}isLive(){return this.a&&this.a.src?Infinity===this.a.duration:!1}getStats(){if(!this.f||!this.a)return _.Jn();this.f&&_.Fn(this.f.a,this.getState());var a=this.a,b=this.f,c=a.videoHeight;b.w=a.videoWidth;b.h=c;a.getVideoPlaybackQuality&&(c=a.getVideoPlaybackQuality(),a=this.f,
422
- b=Number(c.totalVideoFrames),a.l=Number(c.droppedVideoFrames),a.j=b,this.f.C=Number(c.corruptedVideoFrames));if(a=this.getTrackManager())if(a=a.oa())a.bandwidth&&(this.f.o=a.bandwidth),a.Kc&&(this.f.f=a.Kc);return this.f.getStats()}getTimelineCues(){return this.l?this.l.getTimelineCues():[]}};
423
- _.mh(new class{a(){return od}canPlay(a,b){a=a.type||"";const c=a===_.zc,d=a===_.Ec,e=a===_.Ok;var f;_.gk()||c||d||e&&!_.hk()?f=0:f=""!==Uj().canPlayType(a)?e&&_.hk()&&(window.ManagedMediaSource||window.MediaSource&&MediaSource.isTypeSupported)&&!b.streaming.preferNativeHlsOnSafari?1:2:0;return f}f(a){return a===_.na}create(){return new Ct}});_.z("clpp.ads.PodType",{PREROLL:0,MIDROLL:1,POSTROLL:2});_.z("clpp.ads.Technology",{CLIENT_SIDE:0,SERVER_SIDE:1});_.z("clpp.ads.ErrorType",{LOAD:0,PLAY:1,OTHER:2});var qo=new _.R("clpp.ads"),po=[];_.z("clpp.utils.dom.createHTMLElement",_.xo);var Dt=class{constructor(a){this.a=null;this.h=new Set;this.f=null;this.set(a||null)}set(a){this.h.clear();this.f&&(this.f.disconnect(),this.f=null);if(this.a=a)this.f=yo(this,a)}get(){return this.a}};var Gt=class{constructor(a,b){this.g=new _.R("clpp.PlayerSurface");this.w=_.Pg(Et,b);this.f=new Dt;this.h=null;this.a=new Dt;this.l=Ft;Ft+=1;this.o=`clpp-video-${this.l}`;this.j=new _.ts;if(null==a)throw new _.H(_.F,7,7102,"No Media element was provided");if(!(a instanceof Element||(a=document.getElementById(a),a)))throw new _.H(_.F,7,7004,"Media element not found");b=this.w;this.g.debug("Initializing Player Surface on ",a);if("cast-media-player"===a.tagName.toLowerCase())this.h=a;else{if(!(a instanceof
424
- HTMLMediaElement))throw new _.H(_.F,7,7005,"Media element is not instance of HTMLMediaElement");if(!a.hasAttribute("crossorigin")){var c=b.crossorigin;this.g.info("Setting media elements crossorigin to "+c);a.setAttribute("crossorigin",c)}this.f.set(a);if(b.disableContainer)var d=null;else if(b.containerEl){if(a.parentNode!==b.containerEl)throw new _.H(_.F,7,7006,"Container element is not a direct parent of media element");d=b.containerEl}else{c=document.createElement(_.Gd);a.parentNode?a.parentNode.replaceChild(c,
425
- a):this.g.warn("Player Surface Element has no parent. Can not inject container. You have to manually add playerSurface.getContainer() to the DOM!");var e=[];for(let g=0;g<a.classList.length;g++)e.push(a.classList[g]);for(var f of e)a.classList.remove(f),_.vo(c,f);c.style.cssText=a.style.cssText;a.removeAttribute(_.Sf);for(d of[_.Cg,_.Zd])f=a.getAttribute(d),f=parseInt(f,10),isNaN(f)||(c.style[d]=`${f}px`),_.Xj()||a.removeAttribute(d);c.appendChild(a);d=c}d&&(this.a.set(d),zo(this.a,"clpp-container"),
426
- zo(this.a,this.o),zo(this.f,_.ed),zo(this.f,"clpp-video"));b.webOSStartupPatch&&Ao(this,a,d)}}getMedia(){return this.f.get()}getContainer(){return this.a.get()}getSafeContainer(){return this.a}getId(){return this.l}getUniqueCssClass(){return this.o}getCastElement(){return this.h}isFullscreen(){return!!document.fullscreenElement}hideMediaElement(){const a=this.getMedia();a?_.vo(a,fd):this.g.debug("No media element available that could be hidden")}showMediaElement(){const a=this.getMedia();a?a.classList.remove(fd):
427
- this.g.debug("No media element available that could be shown")}addElementToContainer(a,b,c){b=void 0===b?!1:b;c=void 0===c?!1:c;const d=this.getContainer();if(!d)throw Error("No container is available. Unable to add element");b&&_.vo(a,_.ed);c?d.insertBefore(a,d.firstElementChild):d.appendChild(a)}removeElementFromContainer(a){const b=this.getContainer();if(!b)throw Error("No container is available. Unable to remove element");b.removeChild(a)}hide(a){_.vo(a,fd)}show(a){a.classList.remove(fd)}release(){this.j.release()}};
428
- Gt.prototype.removeElementFromContainer=Gt.prototype.removeElementFromContainer;Gt.prototype.addElementToContainer=Gt.prototype.addElementToContainer;Gt.prototype.getCastElement=Gt.prototype.getCastElement;Gt.prototype.getContainer=Gt.prototype.getContainer;Gt.prototype.getMedia=Gt.prototype.getMedia;var Et={disableContainer:!1,webOSStartupPatch:!0,crossorigin:"anonymous",containerEl:null},Ft=1;var Ht=class{constructor(a){this.m=a;this.j=this.m.getNetworkEngine();this.a=new _.ts;this.h=null;this.f=!0;Eo(this)}release(){this.a.release();Fo(this);this.m=null}};_.z("clpp.polyfill.installAll",Io);var Ho=[];_.z("clpp.polyfill.register",_.Jo);var No=class{constructor(a,b,c){this.h=a;this.f=b;JSON.parse(_.oi(_.Ei(a)));this.a=JSON.parse(_.oi(_.Ei(b)));this.j=c}};var Lo={n:"vXdoJIQCz6sZ9pbduNukEHOR0H2dHlwuuBUAR5Ot7WLEYvav5mn63yxr6F6TIl8RHTFw2siXQhHblZH2Y89o8vhcZRFkYXo6h0igEVafu-n0w52UEcH8Cqzlb8Q7x03Qb8OcKLngSzDkwe5Y2Aix6I66RRVNLLssqyjp2n5tXs4JQmYdqY6hhpGhmBN84naeCTdcPpAYhCw8jqbTSNrJp5hjU4GVvOiUtoYCvdESV9xrOR7fPCFXhWfLtC3i1k1zVoIM7YW5qD0F676jhqkF-GmDuCHpRY2I2Cxui-ytYEVIM6_pylSIlmYLjARmv2jXz9aV_WvHLh6B8Yx0slNGCQ",e:"AQAB"},Sk="eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ1cmxzIjpbIjovL2Nhc3RsYWJzLmNvbSJdLCJ0eXBlIjoiV2ViIiwia2lkIjoxOTUwLCJpbHYiOmZhbHNlfQ.jzGGRcbFr_2QET-4tbMcpR5pSaj7eV7X2d1HWw_VKQpPg3zCwSZSDuqw225dIYyAYwLSiElbozbZPSArkBXOsoUm-KZRUPF4m7WG0T7Uza5G-QaQw57BbbfcSsooSpatC997kHKLMTjO71By9Olcu5ykN164nZpGQtZNzQjYag-bnUaMVI5vvhzjlvDihORQ9V_qRlEh0-mpoz6W0-36HGAbWIXWq0kxPh6inbovby-ZmFpqGrVjWOEFa55EARZXPNW9ERupW5xrrYHZdwwTpdRTY5IwEnobS85yTrLhK8Y2MV4jlQLTtQp372fKDsuU6q6_4XvmNq1SgAoKoaf41g";var ep=class{constructor(a){this.f=a;this.a=null;this.g=new _.R("clpp.utils.LicenseKey")}},$o="vod",Zo="live";var Q=class extends _.ft{constructor(a,b,c){super();Io();this.g=new _.R("clpp.Player");if(!a)throw new _.H(_.F,7,7102);this.W=new _.ts;this.f=this.A=b||_.Uk();this.l=null;void 0===this.f.license&&(this.f.license=Sk,this.g.warn("You are using the embedded demo license!"));if(!this.f.license)throw this.g.error("You provided null or empty string as your license. Please check your license configuration."),new _.H(_.F,7,7101,"No license provided in configuration!");this.h=new Gt(a,c);this.a=this.B=null;
429
- this.F=new _.ap;this.j=null;this.S=[];this.T=!0;this.H={};this.X=null;this.L=!0;this.N=this.K=!1;this.I=this.yc=null;this.Yd=!1;this.aa=new Ht(this);this.on(_.Nf,()=>{this.getState()===_.Vn&&(this.a?this.a.unload():Promise.resolve())});this.on(_.wc,this.Z.bind(this));this.on(_.vc,this.Z.bind(this));fp(this,this.f.license);this.h.getMedia()&&(a=this.h.getMedia(),a.hasAttribute("autoplay")&&(a.removeAttribute("autoplay"),this.g.debug("Removed autoplay attribute from video element. Auto play will be handled by configuration."),
430
- void 0===this.f.autoplay&&(this.f.autoplay=!0,this.g.debug("Setting autoplay in configuration since it was specified in the video element"))));a=[];for(const d of cp)try{const e=d.create(this.f);e&&a.push(e)}catch(e){this.g.error("Error while creating player plugin",e)}hp(this,a);this.J=_.na;el(this)}on(a,b,c){return super.on(a,b,c)}one(a,b,c){return super.one(a,b,c)}off(a,b){return super.off(a,b)}onError(a){if(null!==this.a)this.a.onError(a);else a=new _.E(_.r,{detail:a}),this.trigger(a)}gc(a){a=
431
- this.H[a];void 0===a&&(a=null);return a}getSurface(){return this.h}getConfiguration(){return _.Qg(this.f)}getDrmInfo(){return this.a?this.a.getDrmInfo():null}detach(){return this.a?this.a.detach():Promise.resolve()}release(){if(null!=this.l)return this.g.info("Player release already in progress"),this.l;this.g.debug("Releasing player");this.l=kp(this);return this.l.finally(()=>{this.g.debug("Player released");this.l=null})}destroy(){if(this.K)return this.g.debug("The player is already destroyed. No-op"),
432
- new Promise(a=>a());this.K=!0;return this.release().then(()=>{this.g.debug(za);this.trigger(new _.E("destroying"));return _.gp(this,_.Ie)}).then(()=>{this.a&&this.a.stopForwardingEventsTo(this);this.Pc.clear();this.aa.release();if(this.a)return this.a.destroy()}).then(()=>this.F.destroy()).then(()=>{hl();this.a=null;this.trigger(new _.E("destroyed"))})}load(a){const b=this;return _.x(function*(){try{_.Hm(af);b.J=_.na;b.T=!0;const c=_.bo(a);yield _.sp(b,Xk(a)?a:{},c);yield _.tp(b);yield _.vp(b);_.Hm($e);
433
- _.Im("player.load",af,$e)}catch(c){if(b.l)throw b.g.info(eb),new _.H(_.F,7,7E3);throw c;}})}preload(a){const b=this;return _.x(function*(){yield _.sp(b,a);if(b.a){var c=b.a;c.preload?yield c.preload(b.f):b.g.warn(Ab)}else b.g.warn(xb)})}use(a){(a=il(a))&&a.o(this)}remove(a){return(this.getState()<=_.Wn||this.L)&&null!==bl(a)?(jl(a),this.N=!0):!1}play(){return this.a?this.j&&this.a.namespace()!==_.kd?this.j.start(this.a):this.a.play():Promise.reject("No player initialized. You need to load content before calling play.")}pause(){return this.a?
434
- this.a.pause():Promise.reject("No player initialized. You need to load content before calling pause.")}getTrackManager(){return this.a&&this.a.getTrackManager()}getBufferInfo(a){return this.a?this.a.getBufferInfo(a):new _.et}getState(){return this.a?this.a.getState():_.Wn}getPeriods(){return this.a?this.a.getPeriods():[]}isEnded(){return this.a&&this.a.isEnded()||!1}isPaused(){return this.a&&this.a.isPaused()||!1}getPosition(){return this.a?this.a.getPosition():0}seek(a){return this.getState()===
435
- _.Vn?Promise.reject("Cannot seek in current state."):this.a?this.a.seek(a):Promise.reject("delegate does not exist")}getPresentationStartTime(){return this.a?this.a.getPresentationStartTime():null}getSeekRange(){return this.a?this.a.getSeekRange():{start:0,end:0}}hc(){const a=this.a;return a&&a.hc?a.hc():null}getVolume(){return this.a?this.a.getVolume():null}setVolume(a){this.a&&this.a.setVolume(a)}getDuration(){return this.a?this.a.getDuration():-1}getAdsManager(){return this.j}namespace(){return this.a&&
436
- this.a.namespace()||"Undefined"}getPlaybackRate(){return this.a?this.a.getPlaybackRate():1}setPlaybackRate(a,b){this.a&&this.a.setPlaybackRate(a,b)}isMuted(){return this.a&&this.a.isMuted()||!1}setMuted(a){this.a&&this.a.setMuted(a)}getNetworkEngine(){return this.F}setNetworkEngine(a){this.F=a}getTextDisplayer(){return this.a&&this.a.getTextDisplayer()}isLive(){return!!this.a&&this.a.isLive()}getStats(){return this.a?this.a.getStats():null}pf(){return Object.freeze(this.X)}getLoadedSource(){return this.a&&
437
- this.a.getLoadedSource()}getTimelineCues(){return this.a?this.a.getTimelineCues():[]}wd(){return this.a?this.a.wd():null}resetAbr(){this.a&&this.a.resetAbr()}setDrmCustomDataModifier(a){this.yc=a;qp(this)}setCdnErrorCallback(a){this.I=a;this.a&&this.a.setCdnErrorCallback(this.I)}Z(){this.Yd=!0}};_.z("clpp.Player",Q);Q.registerPlugin=_.dp;Q.prototype.setCdnErrorCallback=Q.prototype.setCdnErrorCallback;Q.prototype.setDrmCustomDataModifier=Q.prototype.setDrmCustomDataModifier;Q.prototype.resetAbr=Q.prototype.resetAbr;
438
- Q.prototype.getTimelineCues=Q.prototype.getTimelineCues;Q.prototype.getLoadedSource=Q.prototype.getLoadedSource;Q.prototype.getSources=Q.prototype.pf;Q.prototype.getStats=Q.prototype.getStats;Q.prototype.isLive=Q.prototype.isLive;Q.prototype.getTextDisplayer=Q.prototype.getTextDisplayer;Q.prototype.setNetworkEngine=Q.prototype.setNetworkEngine;Q.prototype.getNetworkEngine=Q.prototype.getNetworkEngine;Q.prototype.setMuted=Q.prototype.setMuted;Q.prototype.isMuted=Q.prototype.isMuted;
439
- Q.prototype.setPlaybackRate=Q.prototype.setPlaybackRate;Q.prototype.getPlaybackRate=Q.prototype.getPlaybackRate;Q.prototype.namespace=Q.prototype.namespace;Q.prototype.getAdsManager=Q.prototype.getAdsManager;Q.prototype.getDuration=Q.prototype.getDuration;Q.prototype.setVolume=Q.prototype.setVolume;Q.prototype.getVolume=Q.prototype.getVolume;Q.prototype.getTimelineOffset=Q.prototype.hc;Q.prototype.getSeekRange=Q.prototype.getSeekRange;Q.prototype.getPresentationStartTime=Q.prototype.getPresentationStartTime;
440
- Q.prototype.seek=Q.prototype.seek;Q.prototype.getPosition=Q.prototype.getPosition;Q.prototype.isPaused=Q.prototype.isPaused;Q.prototype.isEnded=Q.prototype.isEnded;Q.prototype.getState=Q.prototype.getState;Q.prototype.getBufferInfo=Q.prototype.getBufferInfo;Q.prototype.getTrackManager=Q.prototype.getTrackManager;Q.prototype.pause=Q.prototype.pause;Q.prototype.play=Q.prototype.play;Q.prototype.remove=Q.prototype.remove;Q.prototype.use=Q.prototype.use;Q.prototype.load=Q.prototype.load;
441
- Q.prototype.destroy=Q.prototype.destroy;Q.prototype.release=Q.prototype.release;Q.prototype.getDrmInfo=Q.prototype.getDrmInfo;Q.prototype.getConfiguration=Q.prototype.getConfiguration;Q.prototype.getSurface=Q.prototype.getSurface;Q.prototype.getPlugin=Q.prototype.gc;Q.prototype.off=Q.prototype.off;Q.prototype.one=Q.prototype.one;Q.prototype.on=Q.prototype.on;_.Wn=0;_.Xn=1;_.Rn=2;_.Zn=3;_.Yn=4;_.On=5;_.Vn=6;_.At=7;
442
- _.Un={IDLE:_.Wn,PREPARING:_.Xn,BUFFERING:_.Rn,PLAYING:_.Zn,PAUSED:_.Yn,ENDED:_.On,ERROR:_.Vn,UNSET:_.At};Q.State=_.Un;var cp=[];var It=class extends Q{constructor(a,b,c){super(a,b,c);a={manifest:{timeline:{version:2},keepTimelineLive:!0},streaming:{preferNativeHlsOnSafari:!1,enableLiveEdgeChasing:!1,startAtSegmentBoundary:!1}};this.A=_.Pg(this.A,a);this.f=_.Pg(this.f,a);this.C=0;this.o=[];this.O=!1;this.w=null;this.G=[]}open(a,b){const c=this;return _.x(function*(){if(c.w)throw new _.H(_.F,7,7008,`Cannot call open() while ${c.w}() is ongoing!`);if(0!==a)throw new _.H(_.F,7,7007,"The index parameter only supports the value of 0.");
443
- if(0===b.length)throw new _.H(_.F,7,7003,nb);if(b.some(g=>!g.id||!g.source))throw new _.H(_.F,7,7100,"Some config is missing required properties `id` or `source`!");if((new Set(b.map(g=>g.id))).size!==b.length)throw new _.H(_.F,7,7100,"Some config contains a non-unique property `id`!");const d=b[0].playlist;if(d){var e=d.timeline,f=["flat","basic"];if(e&&!f.includes(e))throw new _.H(_.F,7,7100,"Unsupported `playlist.timeline` config value!");e=d.startTime;if(null!=e&&(typeof e!==_.t||0>e))throw new _.H(_.F,
444
- 7,7100,"Invalid `playlist.startTime` config value!");f=d.endTime;if(null!=f&&(typeof f!==_.t||0>f||null!=e&&f<=e))throw new _.H(_.F,7,7100,"Invalid `playlist.endTime` config value!");if("DVR"===d.content&&!f)throw new _.H(_.F,7,7100,"`playlist.endTime` config value is required for DVR content!");}try{yp(c),c.w="open",yield Bp(c,b),c.C=0,c.o=b,c.O=!0,Cp(c,b[0].playlist||{})}finally{c.w=null}})}bg(a){const b=this;return _.x(function*(){if(b.w)throw new _.H(_.F,7,7008,`Cannot call addItem() while ${b.w}() is ongoing!`);
445
- if(!b.O)throw new _.H(_.F,7,7008,"open() must be called before addItem()!");if(!a.id||!a.source)throw new _.H(_.F,7,7100,"The config is missing required properties `id` or `source`!");if((new Set(b.o.map(c=>c.id))).has(a.id))throw new _.H(_.F,7,7100,"A config with this `id` already exists in the playlist!");try{b.w="addItem",b.o.push(a),yield Dp(b,a)}finally{b.w=null}})}getCurrentItem(){return this.o[this.C]||null}getCurrentItemIndex(){return this.C}Dg(){return[...this.o]}Tc(){return this.o.length}getTimeline(){return this.a?
446
- this.a.getTimeline():null}seekWith(a){return this.a?this.a.seekWith(a):Promise.resolve()}release(){this.o=[];this.C=0;this.O=!1;return super.release()}destroy(){yp(this);return super.destroy()}setCdnErrorCallback(){throw new _.H(1,7,7009,"CDN switching is not supported!");}};_.z("clpp.plist.ScPlaylist",It);It.prototype.setCdnErrorCallback=It.prototype.setCdnErrorCallback;It.prototype.destroy=It.prototype.destroy;It.prototype.release=It.prototype.release;It.prototype.seekWith=It.prototype.seekWith;
447
- It.prototype.getTimeline=It.prototype.getTimeline;It.prototype.getSize=It.prototype.Tc;It.prototype.getPlaylist=It.prototype.Dg;It.prototype.getCurrentItemIndex=It.prototype.getCurrentItemIndex;It.prototype.getCurrentItem=It.prototype.getCurrentItem;It.prototype.addItem=It.prototype.bg;It.prototype.open=It.prototype.open;var Jt=class{constructor(a){this.a=a.map(b=>({videoId:b.getSurface().getMedia().id,player:b,nd:!0,ready:Promise.resolve()}));this.g=new _.R("clpp.plist.PlayerPool")}has(){return this.a.some(a=>a.nd)}get(){const a=this;return _.x(function*(){const b=a.a.find(c=>c.nd);if(!b)throw Error("No available players in the pool");b.nd=!1;yield b.ready;return b.player})}release(a){const b=this.a.find(c=>c.player===a);if(!b)return Promise.resolve();b.nd=!0;b.ready=new Promise(c=>{a.release().catch(d=>{this.g.error("Failed to unload player",
448
- d)}).then(c)});return b.ready}destroy(){const a=this;return _.x(function*(){yield Promise.all(a.a.map(b=>b.player.destroy()))})}};var Kt=class extends _.ft{constructor(a){super();this.fa=_.Pg({transition:_.Pe,preloadMedia:!1},a);this.h=[];this.a=0;const b=Ep(a.anchorId,this.fa.config);this.o=new Jt(b);this.f=null;this.j=!1;this.l=new Map;this.w=a.toggleVisible;this.g=new _.R(qd);this.o.a.forEach(c=>Fp(this,c.player,!1))}Sc(){return this.f}Ab(){return this.f?this.f.player:null}lf(){return this.l.get(this.a+1)||null}mf(){return this.l.get(this.a-1)||null}ce(){return[this.mf(),this.lf()].filter(Boolean)}ph(a){if(0<this.h.length)throw Error("Cannot re-set items in the playlist");
449
- this.g.info("Set items",a);this.h=a.map((b,c)=>({config:b,index:c,preloadPromise:Promise.resolve(),disposers:[]}))}oh(a){if(0===this.h.length)throw Error(mb);if(0>a||a>this.h.length-1)throw Error("Index out of bounds");this.a=a}Dc(){return this.a<this.h.length-1}qf(){return 0<this.a}eh(){const a=this;return _.x(function*(){if(a.j)a.g.warn("Cannot play first item while busy");else if(0===a.h.length)a.g.warn(mb);else{a.j=!0;a.g.info(`First (index: ${a.a})`);var b=a.h[a.a];try{a.g.info(`First loading (index: ${a.a})`),
450
- yield Ip(a,b),a.g.info(`First playing (index: ${a.a})`)}catch(c){throw a.g.error(`First failed (index: ${a.a})`),c;}finally{a.j=!1,Mp(a)}}})}Ff(){const a=this;return _.x(function*(){if(a.j)a.g.warn("Cannot play next item while busy");else if(a.Dc()){a.j=!0;a.a+=1;a.g.info(`Next (index: ${a.a})`);var b=a.f;a.fa.transition===_.Pe&&b.player.pause();Rp(a,a.a+-2);a.l.delete(a.a);var c=a.h[a.a];try{a.g.info(`Next loading (index: ${a.a})`),yield Np(a,c),a.g.info(`Next playing (index: ${a.a})`)}catch(d){throw a.g.error(`Next failed (index: ${a.a})`),
451
- d;}finally{a.j=!1,b&&Qp(a,b),Mp(a)}}else a.g.warn("There are no more items in the playlist")})}fh(){const a=this;return _.x(function*(){if(a.j)a.g.warn("Cannot play previous item while busy");else if(a.qf()){a.j=!0;--a.a;a.g.info(`Previous (index: ${a.a})`);var b=a.f;a.fa.transition===_.Pe&&b.player.pause();Rp(a,a.a+2);a.l.delete(a.a);var c=a.h[a.a];try{a.g.info(`Previous loading (index: ${a.a})`),yield Np(a,c),a.g.info(`Previous playing (index: ${a.a})`)}catch(d){throw a.g.error(`Previous failed (index: ${a.a})`),
452
- d;}finally{a.j=!1,b&&Qp(a,b),Mp(a)}}else a.g.warn("There are no more previous items in the playlist")})}destroy(){const a=this;return _.x(function*(){a.g.info("Destroy");yield Promise.all([Sp(a),a.f?Qp(a,a.f):Promise.resolve()]);yield Tp(a)})}};_.z(qd,Kt);Kt.prototype.destroy=Kt.prototype.destroy;Kt.prototype.playPrev=Kt.prototype.fh;Kt.prototype.playNext=Kt.prototype.Ff;Kt.prototype.playFirst=Kt.prototype.eh;Kt.prototype.hasPrev=Kt.prototype.qf;Kt.prototype.hasNext=Kt.prototype.Dc;
453
- Kt.prototype.setIndex=Kt.prototype.oh;Kt.prototype.setItems=Kt.prototype.ph;Kt.prototype.getPreloading=Kt.prototype.ce;Kt.prototype.getPrev=Kt.prototype.mf;Kt.prototype.getNext=Kt.prototype.lf;Kt.prototype.getCurrentPlayer=Kt.prototype.Ab;Kt.prototype.getCurrent=Kt.prototype.Sc;var Pp="preload",Gp=_.ue;var Up=new Map;var Nt=class{constructor(a){this.h=a;this.f={keepOriginalTimestamps:!0,remux:!1};this.a=new muxjs.mp4.Transmuxer(this.f)}destroy(){this.a.dispose();this.a=null}reset(){this.a=new muxjs.mp4.Transmuxer(this.f)}isSupported(a,b){const c="mp2t"===a.toLowerCase().split(";")[0].split("/")[1],d=a.toLowerCase().split(";")[0]===_.Gc;if(!window.muxjs||!c&&!d)return!1;if(d)return _.Vp(Kc);if(b)return _.Vp(Wp(b,a));b=Wp(_.p,a);a=Wp(_.w,a);return _.Vp(b)||_.Vp(a)}isMuxed(a,b){return 1<this.demuxMimeTypes(a,b).size}demuxMimeTypes(a,
454
- b){const c=new Map;c.set(a,b);try{const d=_.Oj(b),e=_.Pj(b).split(","),f=new Map,g=$h(_.p,e),h=$h(_.w,e);g&&f.set(_.p,this.convertCodecs(_.p,_.Nj(d,g)));h&&f.set(_.w,this.convertCodecs(_.w,_.Nj(d,h)));return f}catch(d){return c}}convertCodecs(a,b){return b.toLowerCase().split(";")[0]===_.Gc?Kc:"mp2t"===b.toLowerCase().split(";")[0].split("/")[1]?Wp(a,b):b}getOriginalMimeType(){return this.h}transmux(a){const b=[],c=[];let d=[],e=null;a=_.J(a);const f=h=>{d=h.captions;const k=new Uint8Array(h.data.byteLength+
455
- h.initSegment.byteLength);k.set(h.initSegment,0);k.set(h.data,h.initSegment.byteLength);h.type===Lt?b.push(k):h.type===Mt&&c.push(k)},g=()=>{e={video:_.Ii(...b),captions:d,audio:_.Ii(...c)}};this.a.on("data",f);this.a.on("done",g);this.a.push(a);this.a.flush();this.a.off("data",f);this.a.off("done",g);if(!e)throw new _.H(_.F,3,3018);return e}};Ij(_.Gc,()=>new Nt(_.Gc));Ij(_.lg,()=>new Nt(_.lg));var Mt=_.p,Lt=_.w;var Ot=class extends _.ft{constructor(a){super();this.fa=_.Pg({Wg:2},a);this.j=[];const b=Xp(a.anchorEl,this.fa.Wg+1,this.fa.og);this.l=new Jt(b);this.a=null;this.h=!1;this.f=new Map;this.w=!1;this.o=a.toggleVisible;this.g=new _.R("clpp.interstitial.MultiController");this.l.a.forEach(c=>Yp(this,c.player,!1))}getCurrentItem(){return this.a}Ab(){return this.a?this.a.player:null}ce(){return Array.from(this.f.values())}Jc(a){this.g.info("Add items",a);this.j=this.j.concat(a.map(b=>Object.assign({},b,
456
- {state:"idle",disposers:[],preloadPromise:Promise.resolve(),ed:Promise.resolve()})))}removeItems(a){this.g.info("Remove items",a);a?this.j=this.j.filter(b=>!a.includes(b.id)):this.j=[]}Dc(){return 0<this.f.size}play(a){const b=this;return _.x(function*(){if(b.h)b.g.warn(`Cannot play item while busy (ID: ${a})`);else{var c=b.getItem(a);if(c){b.g.info(`Play item (ID: ${a})`);b.h=!0;var d=b.a;d&&d.player.pause();var e=b.f.has(a);e&&b.f.delete(a);try{b.g.info(`Item loading (ID: ${a})`);e?yield bq(b,c):
457
- yield dq(b,c);c.mc&&c.mc();if(c.Wa)c.player.on(_.Vd,c.Wa);b.trigger(new _.E(fe,{detail:c}));eq(b,c);b.g.info(`Item playing (ID: ${a})`)}catch(f){throw b.g.error(`Item failed (ID: ${a})`),f;}finally{b.h=!1,d&&gq(b,d),iq(b),kq(b,c.next)}}else b.g.warn(`Item not found (ID: ${a})`)}})}load(a){const b=this;return _.x(function*(){if(b.h)b.g.warn(`Cannot load item while busy (ID: ${a})`);else{var c=b.getItem(a);if(c){b.g.info(`Load item (ID: ${a})`);b.h=!0;var d=b.a;d&&d.player.pause();var e=b.f.has(a);
458
- e&&b.f.delete(a);try{b.g.info(`Item loading (ID: ${a})`),e?b.g.error("Loading preloaded items is not supported"):yield cq(b,c),b.trigger(new _.E(fe,{detail:c})),eq(b,c),b.g.info(`Item loaded (ID: ${a})`)}catch(f){throw b.g.error(`Item failed (ID: ${a})`),f;}finally{b.h=!1,d&&gq(b,d),iq(b),kq(b,c.next)}}else b.g.warn(`Item not found (ID: ${a})`)}})}getItem(a){return this.j.find(b=>b.id===a)||null}release(){const a=this;return _.x(function*(){yield Promise.all([iq(a),a.a?gq(a,a.a):Promise.resolve()]);
459
- a.a=null;a.h=!1;a.removeItems();$p(a,!0)})}destroy(){const a=this;return _.x(function*(){a.g.info("Destroy");yield a.release();yield lq(a)})}};Ot.prototype.destroy=Ot.prototype.destroy;Ot.prototype.release=Ot.prototype.release;Ot.prototype.getItem=Ot.prototype.getItem;Ot.prototype.load=Ot.prototype.load;Ot.prototype.play=Ot.prototype.play;Ot.prototype.hasNext=Ot.prototype.Dc;Ot.prototype.removeItems=Ot.prototype.removeItems;Ot.prototype.addItems=Ot.prototype.Jc;Ot.prototype.getPreloading=Ot.prototype.ce;
460
- Ot.prototype.getCurrentPlayer=Ot.prototype.Ab;Ot.prototype.getCurrentItem=Ot.prototype.getCurrentItem;var fq="preload",aq=_.ue;var Tt=class extends _.ft{constructor(a){super();this.h=new Pt;this.fa={prerollMarginSec:.5,resolutionOffsetSec:35,yospace:{enabled:!1}};this.fa=_.Pg(this.fa,a);this.g=new _.R(nd);this.j=null;this.Y=new Ot({og:this.fa.config,anchorEl:a.anchorEl,preloadMedia:!0});$p(this.Y,!0);this.Y.on(fe,b=>{const c=b.detail;c.primary&&(this.j=c.player.getDuration());this.trigger(new _.E(Qt,b));oq(this);c.primary&&Aq(this,c.player)});this.f=[];this.Y.on(pf,b=>{this.trigger(new _.E(Rt,{detail:{player:b.detail.player}}))});
461
- this.a=[]}load(a){const b=this;return _.x(function*(){yield Fq(b,a,!1);b.trigger(new _.E(St));b.Y.getCurrentItem().primary&&b.trigger(new _.E(Xq))})}Rc(){const a=this.j;return a?this.a.map(b=>({cueId:b.cueId,startTime:b.startTime,endTime:b.endTime,primaryDuration:a,Md:b.Md})):[]}Jg(){return this.h.a}Vg(a){const b=this;return _.x(function*(){yield Fq(b,a,!0)})}unload(){const a=this;return _.x(function*(){yield a.Y.release();a.a=[];a.h.release()})}destroy(){const a=this;return _.x(function*(){yield a.Y.destroy();
462
- a.a=[];a.h.release()})}Bh(){const a=this;return _.x(function*(){yield Zp(a.Y);a.trigger(new _.E(St));a.Y.getCurrentItem().primary&&a.trigger(new _.E(Xq))})}getPosition(){const a=this.Y.Ab();return a?a.getPosition():null}Ab(){return this.Y.Ab()}getCurrentItem(){return this.Y.getCurrentItem()}};_.z(nd,Tt);Tt.prototype.getCurrentItem=Tt.prototype.getCurrentItem;Tt.prototype.getCurrentPlayer=Tt.prototype.Ab;Tt.prototype.getPosition=Tt.prototype.getPosition;Tt.prototype.unpause=Tt.prototype.Bh;
463
- Tt.prototype.destroy=Tt.prototype.destroy;Tt.prototype.unload=Tt.prototype.unload;Tt.prototype.loadPaused=Tt.prototype.Vg;Tt.prototype.getYospaceSession=Tt.prototype.Jg;Tt.prototype.getCues=Tt.prototype.Rc;Tt.prototype.load=Tt.prototype.load;
464
- var tq="new",Mq="preparing",wq="ready",Wq="completed",Qq="failed",Nq="interstitial-preload-started",Oq="x-asset-list-request-started",Rq="x-asset-list-request-ended",xq="interstitial-scheduled",Uq="interstitial-started",Vq="interstitial-ended",Tq="interstitial-item-started",Rt="primary-player-changed",Qt="item-changed",St="playback-started",zq="playback-ended",Xq="primary-started",yq="primary-ended",Kq="cues-changed";
465
- _.z("clpp.interstitial.Event",{RESOLUTION_STARTED:Nq,ASSET_LIST_STARTED:Oq,ASSET_LIST_ENDED:Rq,SCHEDULED:xq,STARTED:Uq,ENDED:Vq,ITEM_STARTED:Tq,PRIMARY_PLAYER_CHANGED:Rt,ITEM_CHANGED:Qt,PLAYBACK_STARTED:St,PLAYBACK_ENDED:zq,PRIMARY_STARTED:Xq,PRIMARY_ENDED:yq,CUES_CHANGED:Kq});var Pt=class{constructor(){this.a=null}release(){this.a&&(this.a.shutdown(),this.a=null)}},Cq="PREROLL",Dq="MIDROLL",vq="POSTROLL",Yq=_.Tb,Zq="LIVE",$q="DVR";var U=class{yb(){}zb(){}Fb(){}getId(){}getCreativeId(){}getApiFramework(){}getAdSystem(){}getAdvertiserName(){}getTitle(){}getDuration(){}getSkipTimeOffset(){}kc(){}Qb(){}getMediaUrl(){}Cb(){}Bb(){}qb(){}eb(){}getPodIndex(){}Rb(){}Sb(){}Eb(){}getWrapperAdIds(){}getWrapperAdSystems(){}getWrapperCreativeIds(){}};_.z("clpp.ads.IAd",U);U.prototype.getWrapperCreativeIds=U.prototype.getWrapperCreativeIds;U.prototype.getWrapperAdSystems=U.prototype.getWrapperAdSystems;U.prototype.getWrapperAdIds=U.prototype.getWrapperAdIds;
466
- U.prototype.getSequenceLength=U.prototype.Eb;U.prototype.getPositionInSequence=U.prototype.Sb;U.prototype.getPodTimeOffset=U.prototype.Rb;U.prototype.getPodIndex=U.prototype.getPodIndex;U.prototype.getPodType=U.prototype.eb;U.prototype.getMediaBitrate=U.prototype.qb;U.prototype.getMediaHeight=U.prototype.Bb;U.prototype.getMediaWidth=U.prototype.Cb;U.prototype.getMediaUrl=U.prototype.getMediaUrl;U.prototype.getClickThroughUrl=U.prototype.Qb;U.prototype.isBumper=U.prototype.kc;
467
- U.prototype.getSkipTimeOffset=U.prototype.getSkipTimeOffset;U.prototype.getDuration=U.prototype.getDuration;U.prototype.getTitle=U.prototype.getTitle;U.prototype.getAdvertiserName=U.prototype.getAdvertiserName;U.prototype.getAdSystem=U.prototype.getAdSystem;U.prototype.getApiFramework=U.prototype.getApiFramework;U.prototype.getCreativeId=U.prototype.getCreativeId;U.prototype.getId=U.prototype.getId;U.prototype.getTechnology=U.prototype.Fb;U.prototype.getAdManagerVersion=U.prototype.zb;
468
- U.prototype.getAdManagerName=U.prototype.yb;var Ut=class{name(){}isSupported(){}create(){}};_.z("clpp.ads.IAdsManagerFactory",Ut);Ut.prototype.create=Ut.prototype.create;Ut.prototype.isSupported=Ut.prototype.isSupported;Ut.prototype.name=Ut.prototype.name;var Vt=class{load(){}start(){}resume(){}pause(){}skip(){}getVolume(){}setVolume(){}getPosition(){}dispose(){}};_.z("clpp.ads.IAdsManager",Vt);Vt.prototype.getPosition=Vt.prototype.getPosition;Vt.prototype.setVolume=Vt.prototype.setVolume;Vt.prototype.getVolume=Vt.prototype.getVolume;Vt.prototype.skip=Vt.prototype.skip;Vt.prototype.pause=Vt.prototype.pause;Vt.prototype.resume=Vt.prototype.resume;var Wt=class{load(){return Promise.resolve()}start(a){return a.play()}resume(){}pause(){}skip(){}getVolume(){return 1}setVolume(){}getPosition(){return-1}dispose(){return _.x(function*(){})}};Wt.prototype.dispose=Wt.prototype.dispose;Wt.prototype.getPosition=Wt.prototype.getPosition;Wt.prototype.setVolume=Wt.prototype.setVolume;Wt.prototype.getVolume=Wt.prototype.getVolume;Wt.prototype.skip=Wt.prototype.skip;Wt.prototype.pause=Wt.prototype.pause;Wt.prototype.resume=Wt.prototype.resume;
469
- Wt.prototype.start=Wt.prototype.start;Wt.prototype.load=Wt.prototype.load;var so=class{name(){return"clpp.ads.NopAdsManagerFactory"}isSupported(){return!0}create(){return new Wt}};so.prototype.create=so.prototype.create;so.prototype.isSupported=so.prototype.isSupported;so.prototype.name=so.prototype.name;var Xt=class{getCuePoints(){}Tb(){}sb(){}};_.z("clpp.ads.IAdsTimeline",Xt);Xt.prototype.hasPostroll=Xt.prototype.sb;Xt.prototype.hasPreroll=Xt.prototype.Tb;Xt.prototype.getCuePoints=Xt.prototype.getCuePoints;_.Yt=class{f(){}a(){}h(){}o(){}};var Zt=class{constructor(){this.j=null;this.g=new _.R("clpp.drm.eme.StandardEmeManager")}l(a){this.j=a}h(a){return this.j?this.j.setMediaKeys(a):Promise.reject(ib)}o(){return this.j&&this.j.mediaKeys}a(a,b){this.g.info("Requesting media key system access for",a,b.map(c=>Object.assign({},c,{drmInfos:c.drmInfos.map(()=>"_anonymous_")})));return navigator.requestMediaKeySystemAccess(a,b).catch(c=>{this.g.info("Failed to request media key system access for "+`${a}.`,c);return Promise.reject(c)})}f(){return Eb}};
470
- mm(new class{a(){return Eb}isSupported(){return!!(window.MediaKeys&&navigator.requestMediaKeySystemAccess&&window.MediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)}create(){return new Zt}},1E3);var au=class{constructor(){this.size=0;this.a=void 0;this.g=new _.R("clpp.drm.eme.MediaKeyStatusMap")}getStatus(){return this.a}forEach(a){this.a&&a(this.a,$t.value())}get(a){if(this.has(a))return this.a}has(a){const b=$t.value();return this.a&&gi(a,b)?!0:!1}entries(){}keys(){}values(){}},$t=new _.zt(()=>mi(new Uint8Array([0])));var bu=class{l(){}h(a){_.ih("NopEmeManager.setMediaKeys");return null===a?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}o(){return null}a(){_.ih("NopEmeManager.requestMediaKeySystemAccess");return Promise.reject(Error("The key system specified is not supported."))}f(){return"NOP"}};mm(new class{a(){return"NOP"}isSupported(){return!0}create(){return new bu}},-1);var du=class{constructor(){this.j=this.w=null}l(a){this.w=a}h(a){const b=this.j;b&&b!==a&&br(b,null);return(this.j=a)?br(a,this.w):Promise.resolve()}o(){return this.j}a(a,b){_.ih("AppleEmeManager.requestMediaKeySystemAccess");try{const c=new cu(a,b);return Promise.resolve(c)}catch(c){return Promise.reject(c)}}f(){return"APPLE"}},cu=class{constructor(a,b){this.keySystem=a;if(a.startsWith(_.vd))for(var c of b){a:{a=c;if(a.persistentState===_.xf){a=null;break a}b={audioCapabilities:[],videoCapabilities:[],
471
- persistentState:_.Me,distinctiveIdentifier:_.Me,initDataTypes:a.initDataTypes,sessionTypes:[Uf],label:a.label};let d=!1,e=!1;if(a.audioCapabilities)for(const f of a.audioCapabilities)f.contentType&&(d=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,f.contentType.split(";")[0])&&(b.audioCapabilities.push(f),e=!0));if(a.videoCapabilities)for(const f of a.videoCapabilities)f.contentType&&(d=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,f.contentType.split(";")[0])&&(b.videoCapabilities.push(f),
472
- e=!0));d||(e=WebKitMediaKeys.isTypeSupported(this.keySystem,_.mg));a=e?b:null}if(a){this.a=a;return}}c=Error(Qb);c.name=sb;c.code=DOMException.NOT_SUPPORTED_ERR;throw c;}createMediaKeys(){const a=new eu(this.keySystem);return Promise.resolve(a)}getConfiguration(){_.ih("AppleEmeManager.MediaKeySystemAccess.getConfiguration");return this.a}},eu=class{constructor(a){this.f=null;this.h=new WebKitMediaKeys(a);this.a=new _.ts;this.j=0;this.g=new _.R(md);this.g.info("Created Media Keys for "+a)}createSession(a){a=
473
- void 0===a?Uf:a;this.g.debug("Creating Apple MediaKeys Session");if(a!==Uf)throw new TypeError("Session type "+a+ba);return new fu(this.h,`__session_${this.j++}`)}setServerCertificate(){this.g.debug("AppleEmeManager.MediaKeys.setServerCertificate");return Promise.resolve(!1)}},fu=class extends _.ft{constructor(a,b){super();this.a=null;this.o=a;this.f=this.h=null;this.j=new _.ts;this.sessionId=b;this.expiration=NaN;this.closed=new _.dn;this.l=!1;this.keyStatuses=new au;this.g=new _.R(md)}generateRequest(a,
474
- b){if(this.l)return Promise.reject(Hb);this.g.debug("generateRequest");this.h=new _.dn;try{const c=this.o.createSession(_.mg,_.J(b));this.a=c;this.sessionId=c.sessionId||this.sessionId||"";this.j.on(c,Ag,d=>{{const e=this.keyStatuses.getStatus();this.g.debug(`Received Key Message in ${this.sessionId}`);this.h&&(this.h.resolve(),this.h=null);d=new _.E(_.xe,{messageType:void 0===e||e===Of?je:ie,message:mi(d.message.buffer)});this.dispatchEvent(d)}});this.j.on(c,yg,d=>{this.g.debug("onWebkitKeyAdded_",
475
- d);this.f&&(cr(this,"usable"),this.f.resolve(),this.f=null)});this.j.on(c,zg,()=>{var d=this.keyStatuses.getStatus();if(this.a&&this.a&&this.a.error&&this.a.error.code===WebKitMediaKeyError.MEDIA_KEYERR_DOMAIN&&d===Of)this.g.warn(`Ignoring webkit key error for session ${this.sessionId}`);else if(this.g.error(`Received key error in session ${this.sessionId} `+`with code ${this.a.error.code}. `+`Session Status ${d}.`),d=Error("EME AppleEmeManager key error"),d.errorCode=this.a.error,null!==this.h)this.h.reject(d),
476
- this.h=null;else if(null!==this.f)this.f.reject(d),this.f=null;else switch(this.a.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:cr(this,"output-not-allowed");break;default:cr(this,_.ee)}});cr(this,Of)}catch(c){this.h.reject(c)}return this.h}load(){this.g.debug("load");return Promise.reject(Error("MediaKeySession.load not yet supported"))}update(a){if(this.l)return Promise.reject(Hb);this.g.debug(cg);this.f=new _.dn;try{this.a.update(_.J(a))}catch(b){this.f.reject(b)}return this.f}close(){if(this.l)return this.closed;
477
- this.g.info(`Closing Key Session ${this.sessionId}`);this.l=!0;try{this.a.close(),this.closed.resolve(),_.ph(this.j)}catch(a){this.closed.reject(a)}return this.closed}remove(){this.g.debug("remove");return Promise.reject(Error("MediaKeySession is only applicable for persistent licenses, which are not supported on this platform"))}};mm(new class{a(){return"APPLE"}isSupported(){return!!window.WebKitMediaKeys}create(){return new du}},1100);var hu=class{constructor(){this.w=this.j=null;this.A="";HTMLMediaElement.prototype.webkitGenerateKeyRequest&&(this.A="webkit")}l(a){this.j=a}h(a){_.ih("WebkitEmeManager.setMediaKeys");if(!this.j)return Promise.reject(ib);const b=this.w;b&&b!==a&&fr(b,null);(this.w=a)&&fr(a,this.j);return Promise.resolve()}o(){return this.w}a(a,b){_.ih("WebkitEmeManager.requestMediaKeySystemAccess");try{if(this.j)var c=this.j;else{var d=document.getElementsByTagName(_.w);c=d.length?d[0]:document.createElement(_.w)}const e=
478
- new gu(this.A,c,a,b);return Promise.resolve(e)}catch(e){return Promise.reject(e)}}f(){return"WEBKIT"}},gu=class{constructor(a,b,c,d){this.h=a;this.a=this.keySystem=c;a=!1;c===_.Ne&&(this.a=xg,a=!1);let e=!1;for(const g of d){d=[];var f=[];let h=!1;if(g.audioCapabilities)for(const k of g.audioCapabilities)k.contentType&&(h=!0,b.canPlayType(k.contentType.split(";")[0],this.a)&&(d.push(k),e=!0));if(g.videoCapabilities)for(const k of g.videoCapabilities)k.contentType&&(h=!0,b.canPlayType(k.contentType,
479
- this.a)&&(f.push(k),e=!0));h||(e=b.canPlayType(_.mg,this.a)||b.canPlayType("video/webm",this.a));g.persistentState!==_.xf||a||(e=!1);if(e){this.f=g;return}}b=Qb;if(c===_.Ne||c===_.zd)b="None of the requested configurations were supported.";c=Error(b);c.name=sb;c.code=DOMException.NOT_SUPPORTED_ERR;throw c;}createMediaKeys(){return Promise.resolve(new iu(this.h,this.a))}getConfiguration(){return this.f}},iu=class{constructor(a,b){this.h=a;this.o=b;this.a=null;this.f=new _.ts;this.j=[];this.l=new Map}createSession(a=
480
- Uf){if(a!==Uf&&a!==_.Re)throw new TypeError("Session type "+a+ba);if(!this.a)throw a=Error("Media element is missing."),a.name=bb,a.code=DOMException.INVALID_STATE_ERR,a;this.a.src||(this.a.src="about:blank");a=new ju(this.h,this.a,this.o,a);this.j.push(a);return a}setServerCertificate(){return Promise.resolve(!1)}},ju=class extends _.ft{constructor(a,b,c,d){super();this.w=a;this.j=b;this.o=!1;this.a=this.f=null;this.h=c;this.l=d;this.sessionId="";this.expiration=NaN;this.closed=new _.dn;this.keyStatuses=
481
- new au}ready(){_.ih("WebkitEmeManager.MediaKeySession.ready");er(this,"usable");this.a&&this.a.resolve();this.a=null}generateRequest(a,b){_.ih("WebkitEmeManager.MediaKeySession.generateRequest");return hr(this,b,null)}load(a){_.ih(Wb);return this.l===_.Re?hr(this,null,a):Promise.reject(Error(pb))}update(a){_.ih(Wb);const b=new _.dn;ir(this,b,a);return b}close(){_.ih("WebkitEmeManager.MediaKeySession.close");if(this.l!==_.Re){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),
482
- this.closed;const a=gr(this,"cancelKeyRequest");try{this.j[a](this.h,this.sessionId)}catch(b){}}this.closed.resolve();return this.closed}remove(){_.ih("WebkitEmeManager.MediaKeySession.remove");return this.l!==_.Re?Promise.reject(Error(pb)):this.close()}};mm(new class{a(){return"WEBKIT"}isSupported(){return!(!HTMLMediaElement.prototype.webkitGenerateKeyRequest&&!HTMLMediaElement.prototype.generateKeyRequest)}create(){return new hu}});var mu=class extends _.kt{constructor(a,b,c,d,e){super(ab);this.l=a;this.j=b;this.h=c;this.a=d;this.o=e;this.g=new _.R(ld);_.yi(this.l)?this.g.warn(_.Xb):this.Ta(_.zd,{licenseUrl:this.l,videoRobustness:[_.Gb,void 0],audioRobustness:[_.Fb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.fd.bind(this)}});_.yi(this.j)?this.g.warn(_.wb):this.Ta(_.xd,{licenseUrl:this.j,videoRobustness:["3000"],audioRobustness:["2000"],modifiers:{licenseRequest:this.fd.bind(this)}});
483
- _.yi(this.h)?this.g.warn(_.Ua):_.yi(this.a)?this.g.warn(_.Ta):this.Ta(_.vd,{licenseUrl:this.h,certificateUrl:this.a,modifiers:{licenseRequest:this.Af.bind(this),licenseResponse:this.Bf.bind(this),certificateRequest:this.fd.bind(this),extractContentId:this.ef.bind(this)}})}fd(a,b){a=a.drm.customData.headers||{};for(const c of Object.keys(a))b.headers[c]=a[c]}ef(a,b){a=Jl(b);switch(this.o){case ku:return a;case lu:return(new _.Kl(a)).a;default:throw Error("Unknown content ID strategy");}}Af(a,b){b.headers[ua]=
484
- Fc;this.fd(a,b);a={spc:_.Ci(b.body)};b.body=_.ui(_.kj(a,!0))}Bf(a,b){a=_.oi(b.data).trim();const c="\x3c/ckc\x3e"===a.substr(-6);"\x3cckc\x3e"===a.substr(0,5)&&c&&(a=a.slice(5,-6));b.data=_.Ei(a).buffer}};_.z(ld,mu);mu.prototype.onFairPlayLicenseResponse=mu.prototype.Bf;mu.prototype.onFairPlayLicenseRequest=mu.prototype.Af;mu.prototype.extractFairPlayContentId=mu.prototype.ef;mu.prototype.onLicenseRequest=mu.prototype.fd;mu.prototype.constructor=mu.prototype.constructor;mu.NAME=ab;
485
- var lu="hostname",ku="full-skd";mu.FairPlayContentIdStrategy={HOSTNAME:lu,FULL_SKD:ku};_.z("clpp.drm.HeaderDrmComponent",class extends _.Yt{h(a){a=a.getConfiguration();if(a.drm&&a.drm&&a.drm.env===ab){a=a.drm.customData;if(!a)throw new _.H(_.F,7,7100,_.Ad);a=new mu(a.widevineLicenseUrl,a.playReadyLicenseUrl,a.fairPlayLicenseUrl,a.fairPlayCertificateUrl,a.fairPlayContentIdStrategy||ku);_.ol(a)}}a(){delete _.nl.HeaderDrm}id(){return"headerdrm"}});_.Jo(function(){ArrayBuffer.prototype.slice||(ArrayBuffer.prototype.slice=function(a,b){b=void 0!==b?b:this.byteLength;a=Math.floor(a);b=Math.floor(b);0>a&&(a+=this.byteLength);0>b&&(b+=this.byteLength);a=Math.min(Math.max(0,a),this.byteLength);b=Math.min(Math.max(0,b),this.byteLength);if(0>=b-a)return new ArrayBuffer(0);const c=new ArrayBuffer(b-a),d=_.J(c);a=new Uint8Array(this,a,b-a);d.set(a);return c})});_.Jo(function(){_.ih("mathRound.install")});_.Jo(function(){if(window.Document){var a=Element.prototype;a.requestFullscreen=a.requestFullscreen||a.mozRequestFullScreen||a.msRequestFullscreen||a.webkitRequestFullscreen;a=Document.prototype;a.exitFullscreen=a.exitFullscreen||a.mozCancelFullScreen||a.msExitFullscreen||a.webkitExitFullscreen;Xd in document||(Object.defineProperty(document,Xd,{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement}}),Object.defineProperty(document,"fullscreenEnabled",
486
- {get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitSupportsFullscreen||document.webkitFullscreenEnabled}}));document.addEventListener("webkitfullscreenchange",jr);document.addEventListener("webkitfullscreenerror",jr);document.addEventListener("mozfullscreenchange",jr);document.addEventListener("mozfullscreenerror",jr);document.addEventListener("MSFullscreenChange",jr);document.addEventListener("MSFullscreenError",jr)}});_.Jo(function(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;a.requestPictureInPicture&&document.exitPictureInPicture||!a.webkitSupportsPresentationMode||(_.ih("PiPWebkit.install"),document.pictureInPictureEnabled=!0,document.pictureInPictureElement=null,a.requestPictureInPicture=lr,document.exitPictureInPicture=mr,document.addEventListener("webkitpresentationmodechanged",kr,!0))}});_.Jo(function(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.getVideoPlaybackQuality&&"webkitDroppedFrameCount"in a&&(a.getVideoPlaybackQuality=nr)}});_.Jo(function(){if(window.VTTCue)_.hh("Using native VTTCue.");else if(window.TextTrackCue){var a=TextTrackCue.length;if(3===a)_.hh(Rb),window.VTTCue=or;else if(6===a)_.hh("Using VTTCue polyfill from 6 argument TextTrackCue."),window.VTTCue=pr;else{try{var b=!!or(1,2,"")}catch(c){b=!1}b&&(_.hh(Rb),window.VTTCue=or)}}else _.jh("VTTCue not available.")});var qr;_.Jo(function(){_.ih("InputEvent.install");_.Wj("Trident/")&&HTMLInputElement.prototype.addEventListener!==rr&&(_.hh("Patching input event support on IE."),qr=HTMLInputElement.prototype.addEventListener,HTMLInputElement.prototype.addEventListener=rr)});_.Jo(function(){navigator.languages||Object.defineProperty(navigator,"languages",{get:()=>navigator.language?[navigator.language]:["en"]})});_.Jo(function(){_.ih("VideoPlayPromise.install");if(window.HTMLMediaElement){const a=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){const b=a.apply(this);b&&b.catch(()=>{});return b}}});var ur=class{constructor(){this.a=sr()}};var nu=class{constructor(a,b){b=void 0===b?2:b;this.a=new Uint8Array(a);this.h=b;this.f=0}};_.ou=class{constructor(a,b,c){this.h=a;this.j=b;this.f=c||this.h.getMedia();this.a=null}start(){this.a=new ResizeObserver(a=>{a=a[0];this.j(a.contentRect.width,a.contentRect.height,this.h.isFullscreen())});this.f&&this.a.observe(this.f)}stop(){this.a&&(this.a.disconnect(),this.a=null)}};var pu;_.qu=class{constructor(){this.a=new Blob([pu],{type:_.mg})}canPlay(a){var b=document.createElement(_.w);b.setAttribute("playsinline","playsinline");a&&(b.muted=!0,b.setAttribute("muted","muted"));b.src=URL.createObjectURL(this.a);const c=new _.dn;b=b.play();const d=(new _.Tj(()=>{d.stop();c.resolve(a)})).ha(.25);void 0!==b?b.then(()=>{d.stop();c.resolve(!0)}).catch(e=>{e&&e.message&&e.message===sb?(d.stop(),c.resolve(!0)):(d.stop(),c.resolve(!1))}):(d.stop(),c.resolve(!0));return c}};
487
- pu=new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,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,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,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,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
407
+ 26,58,164,235,113,177,235,207,22,230,8,119,76,167,166,176,173,209,214,53,116,116,231,227,221,238,174,87,249,19,166,195,81,47,210,172,15,75,251,202,192,80,85,213,23,17,178,104,181,193,115,239,91,72,230,167,55,143,10,250,26,54,8,60,13,213,206,235,3,215,179,205,232,1,144,158,35,48,196,149,117,219,63,196,130,117,40,165,193,65,215,122,44,201,218,67,216,6,131,178,5,168,229,21,137,112,215,254,127,48,160,181,68,49,255,64,46,247,236,85,155,146,208,5,219,252,37,174,31,218,136,135,55,119,112]};_.wt=class{constructor(a){this.I=a;this.f={}}Wa(a,b){this.f[a]=b}};_.x("clpp.drm.DrmEnvironment",_.wt);_.wt.prototype.setDrmSystem=_.wt.prototype.Wa;_.Vl=class{constructor(a,b){b=void 0===b?!1:b;this.f=_.Yg(a)?new DataView(new ArrayBuffer(a),0,a):a;this.a=0;this.h=b;this.buffer=this.f.buffer}getPosition(){return this.a}Ja(){return this.f.byteLength}seek(a){(0>a||a>=this.f.byteLength)&&_.Al();this.a=a}};_.Fm=class{constructor(a,b){this.f=a;this.h=void 0===b?!0:b;this.a=0}getPosition(){return this.a}Ja(){return this.f.byteLength}skip(a){this.a+a>this.f.byteLength&&_.Dl();this.a+=a}seek(a){if(0>a||a>=this.f.byteLength)throw _.Dl();this.a=a}};
408
+ _.x("clpp.utils.dataview.DataViewReader",_.Fm);_.Tl=class{constructor(){this.h=[];this.f=[];this.a=!1;this.g=new _.R("clpp.mp4")}N(a,b){a=Kl(a);this.h[a]=xt;this.f[a]=b;return this}ca(a,b){a=Kl(a);this.h[a]=yt;this.f[a]=b;return this}stop(){this.a=!0}parse(a,b){a=_.I(a);a=new _.Fm(new DataView(a.buffer,a.byteOffset,a.byteLength),!1);for(this.a=!1;_.Cl(a)&&!this.a;)this.Jd(0,a,b)}Jd(a,b,c){const d=b.getPosition();let e=_.O(b);var f=_.O(b);let g=!1;this.g.debug("Parsing MP4 box",_.Ll(f));switch(e){case 0:e=b.Ja()-d;break;case 1:e=_.Hl(b),g=!0}const h=
409
+ this.f[f];if(h){let m=null;var k=null;this.h[f]===yt&&(k=_.O(b),m=k>>>24,k&=16777215);f=b.getPosition()-d;var l=d+e;c&&l>b.Ja()&&(l=b.Ja());l-=b.getPosition();b=0<l?_.Jl(b,l):new Uint8Array(0);b=new _.Fm(new DataView(b.buffer,b.byteOffset,b.byteLength),!1);h({parser:this,partialOkay:c||!1,version:m,flags:k,reader:b,size:e,start:d+a,headerSize:f,has64BitSize:g})}else a=Math.min(d+e-b.getPosition(),b.Ja()-b.getPosition()),b.skip(a)}};_.x("clpp.utils.Mp4Parser",_.Tl);_.Tl.typeToString=_.Ll;
410
+ _.Tl.allData=_.Ol;_.Tl.sampleDescription=_.Nl;_.Tl.children=_.Ml;_.Tl.prototype.parseNext=_.Tl.prototype.Jd;_.Tl.prototype.parse=_.Tl.prototype.parse;_.Tl.prototype.stop=_.Tl.prototype.stop;_.Tl.prototype.fullBox=_.Tl.prototype.ca;_.Tl.prototype.box=_.Tl.prototype.N;_.Tl.headerSize=_.Pl;var xt=0,yt=1;var zt=class{};_.x("clpp.utils.FairplayUtils",zt);zt.parseFairPlayResponse=_.Yl;zt.formatFairPlayRequest=_.Xl;zt.createFairplayPayload=Wl;zt.extractContentId=_.Sl;zt.extractExtXKeyUri=Ql;var dm=new _.R("clpp.drm.DrmToday"),qm="PRODUCTION",rm="STAGING",sm="TEST",At={PRODUCTION:qm,STAGING:rm,TEST:sm};_.x("clpp.drm.DrmToday.Environment",At);_.x("clpp.drm.DrmToday.WidevineCertificates",{V1_PROD:"V1_PROD",V1_STAGING:"V1_STAGING",V2:"V2"});
411
+ var $l="/license-proxy-widevine/cenc/",am="/license-proxy-headerauth/drmtoday/RightsManager.asmx",bm="/license-server-fairplay/",tm={"00000":"Success","01000":"General Internal Error","02000":"General Request Error","03000":"General Request Authentication Error",10001:"Bad Request",3E4:"General DRM error",4E4:"General Widevine Modular error",40001:"Widevine Device Certificate Revocation (wv 127)",40002:"Widevine Device Certificate Revocation - Permanently (wv 175)",41E3:"General Widevine Classic error",
412
+ 42E3:"General Playready error",43E3:"General Fairplay error",44E3:"General OMA error",44001:"OMA Device registration failed",45E3:"General CDRM error",45001:"CDRM Device registration failed",6E4:"CSL",60001:"CSL - INVALID",60100:"CSL - Denied by Stream Limiting",7E4:"General Output Protection",70001:"All keys filtered by EOP settings",8E4:"TAKE DOWN",80001:"TAKE DOWN - Denied by Take Down",9E4:"General GBL error",90001:"License delivery prohibited in your region"},Bt=[Xa,$a,Ya,_.Gb,_.Fb],Ct=[Xa,$a,
413
+ Ya,_.Gb,_.Fb],Dt=["3000","2000","150"],Et=["2000","150"];
414
+ for(const a of Object.keys(At)){let b=xa;a!==qm&&(b+=`_${a}`);const c=new _.wt(b);let d=null;switch(a){case qm:case rm:d=zl("V2");break;case sm:d=null}c.Wa(_.yd,{licenseUrl:cm(_.yd,a),videoRobustness:Bt,audioRobustness:Ct,persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:d,modifiers:{licenseRequest:_.fm,licenseResponse:_.gm}});c.Wa(_.ud,{licenseUrl:cm(_.ud,a),certificateUrl:Zl(a)+"/license-server-fairplay/cert/",modifiers:{licenseRequest:_.im,licenseResponse:_.jm,extractContentId:_.km,
415
+ certificateRequest:_.om}});c.Wa(_.wd,{licenseUrl:cm(_.wd,a),videoRobustness:Dt,audioRobustness:Et,modifiers:{licenseRequest:pm}});_.vl(c)};var Ft=class{};_.x("clpp.drm.eme.EmeFactory",Ft);var vm=[];Ft.Apis={STANDARD:Eb,APPLE:"APPLE",WEBKIT:"WEBKIT",NOP:"NOP"};var Dm,Gt,Cm;_.Lm=[154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149];Dm=[237,239,139,169,121,214,74,206,163,200,39,220,213,29,33,237];Gt=class{constructor(a,b,c){this.j=new Uint8Array(a);this.a=b;this.f=c}};Cm=class extends Gt{};_.Km=class extends Gt{constructor(a,b,c,d,e,f){f=void 0===f?null:f;super(a,b,d);this.version=e;this.h=c;this.l=f}};var Nm=!!(performance&&performance.mark&&performance.measure);var nn=class{constructor(a){this.f=[];this.h=[];this.a=[];8<=a.byteLength&&(new _.Tl).ca("pssh",this.j.bind(this)).parse(a.buffer);0===this.a.length&&_.B("No pssh box found!")}j(a){if(1<a.version)_.B("Unrecognized PSSH version found!");else{var b=_.Fi(_.Jl(a.reader,16)),c=[];if(0<a.version){var d=_.O(a.reader);for(let e=0;e<d;++e){const f=_.Fi(_.Jl(a.reader,16));c.push(f)}}d=_.O(a.reader);a.reader.skip(d);this.h.push.apply(this.h,c);this.f.push(b);this.a.push({start:a.start,end:a.start+a.size-1});
416
+ a.reader.getPosition()!==a.reader.Ja()&&_.B("Mismatch between box size and data size!")}}};var jn,Ht;
417
+ _.po=class{constructor(a){this.D=a;this.H=new Set;this.A=this.G=this.j=null;this.O=!1;this.a=null;this.I=Ht;this.w=new _.Fs;this.K=new vt;this.f=new Map;this.J=[];this.F=new _.ln;this.h=null;this.T=b=>{this.o=!0;this.B=!1;this.F.reject(b);a.onError(b)};this.l=new Map;this.V=new Map;this.R=new _.Wj(()=>bn(this));this.ua=!1;this.Y=new _.ln;this.C=!1;this.S=[];this.Z=!1;this.M=0;this.g=new _.R("clpp.drm.DrmEngine");this.X=(new _.Wj(()=>{cn(this)})).vb(1);this.F.catch(()=>{});this.o=this.B=!1;this.L=
418
+ null}destroy(){const a=this;return _.w(function*(){a.ua?yield a.Y:(a.ua=!0,yield dn(a),a.Y.resolve())})}keySystem(){return this.a?_.Sm(this.a.keySystem):""}getDrmInfo(){return this.a}da(a){const b=this;return _.w(function*(){if(!b.C||b.I!==jn){var c=Math.floor(a.timeStamp),d=`drm.msg.${c}.start`,e=`drm.msg.${c}.end`;_.Om(d);!b.h.delayLicenseRequestUntilPlayed||b.A&&!b.A.paused||b.Z?yield sn(b,a):b.S.push(a);_.Om(e);_.Pm(`drm.sess.msg.${c}`,d,e)}})}ba(a){const b=a.target;this.g.info("Key status changed for session",
419
+ b.sessionId);const c=this.f.get(b);let d=!1;b.keyStatuses.forEach((e,f)=>{if(typeof f===_.Pf){var g=f;f=e;e=g}if(Rm(this.a.keySystem)&&16===f.byteLength&&_.Yj()){g=_.ki(f);const k=g.getUint32(0,!0),l=g.getUint16(4,!0),m=g.getUint16(6,!0);g.setUint32(0,k,!1);g.setUint16(4,l,!1);g.setUint16(6,m,!1)}c&&e!==Nf&&(c.loaded=!0);c&&c.Ma&&c.Ma.resolve();"expired"===e&&(d=!0);f=_.I(f);let h=_.Fi(f);"00"===h&&c&&c.keyId?h=c.keyId:this.a.keySystem.startsWith(_.ud)&&16!==f.byteLength&&(h=mi(f));(f=h||"")?this.g.info(`Key status for Key ID '${h}': ${e}`):
420
+ this.g.info(`Key status global keys: ${e}`);this.l.set(f,e);c&&!c.keyId&&this.f.forEach((k,l)=>{l===b||k.keyId!==h||k.loaded||(k.loaded=!0)})});c&&c.loaded&&c.fb.forEach(e=>{this.l.get(e)===Nf&&(this.g.warn(`Key status for Key ID '${e}': 'output-restricted'`),this.l.set(e,_.Oe))});for(a=0;a<this.a.initData.length;a++){const e=this.a.initData[a];e.keyId&&this.l.get(e.keyId)===Nf&&_.Gi(e.initData,c.initData)&&(this.g.warn(`Key status for Key ID '${e.keyId}': 'output-restricted'`),this.l.set(e.keyId,
421
+ _.Oe))}a=b.expiration-Date.now();(0>a||d&&1E3>a)&&c&&!c.Jb&&(this.g.debug("Session has expired",b.sessionId),(a=this.f.get(b))&&a.xc&&a.xc.stop(),this.f.delete(b),b.close().catch(()=>{}));Bn(this)&&(this.F.resolve(),1!==this.f.size||d?this.R.fa(.5):bn(this))}};jn=0;Ht=3;_.In=new Map;_.Jn=new _.R("clpp.text");var It=class{constructor(){this.a=null;this.f=[]}};var Jt=class{constructor(){this.h=this.f=this.j=null;this.a=[]}};_.Kt=class{constructor(){this.f=this.o=this.A=this.C=this.j=this.l=this.h=this.w=NaN;this.a=new It;this.B=new Jt}getStats(){return{width:this.w,height:this.h,streamBandwidth:this.o,decodedFrames:this.j,droppedFrames:this.l,corruptedFrames:this.C,estimatedBandwidth:this.f,loadLatency:this.A,playTime:Nn(this.a,_.go),pauseTime:Nn(this.a,_.fo),bufferingTime:Nn(this.a,_.Yn),stateHistory:On(this.a),switchHistory:Pn(this.B)}}};_.Lt=class{constructor(a){this.f=a;this.a=void 0}value(){void 0===this.a&&(this.a=this.f());return this.a}};var Rn=new _.Lt(()=>new Map([[HTMLMediaElement.HAVE_METADATA,_.se],[HTMLMediaElement.HAVE_CURRENT_DATA,_.re],[HTMLMediaElement.HAVE_FUTURE_DATA,Xc],[HTMLMediaElement.HAVE_ENOUGH_DATA,Yc]]));var Nt=class{constructor(a){this.g=new _.R("clpp.StateManager");this.m=a;this.a=new _.Fs;this.f=_.co;this.A=_.Mt;this.H=0;this.w=-1;this.K=this.o=this.I=this.B=0;this.j=this.h=this.F=!1;this.G=0;this.l=null;this.J=0;this.L=_.kk();this.C=!1;this.I=Date.now();Wn(this)}cb(a,b){this.m&&this.m.trigger(new _.C(a,{detail:b}))}getState(){return Zn(this,"")}T(a){(a=a&&a.detail)&&a.severity&&a.severity===_.E&&Un(this,_.bo)}destroy(){this.g.debug("Stop watching for video events for "+this.m.namespace());this.a.release()}};_.x("clpp.utils.media.detectType",ho);var ko=new _.R("clpp.sources");var Ot=class extends _.ut{constructor(){super(nd);this.w=this.G=!1;this.l=this.A=this.o=this.a=this.j=null;this.h=new _.Fs;this.F=this.B=this.f=this.H=null}init(a,b){super.init(a,b);this.j=new Nt(this);Un(this.j,_.co)}namespace(){return nd}unload(){const a=this;return _.w(function*(){if(a.ea){a.log.debug("Releasing player with source",a.ea);a.B&&(a.B.stop(),a.B=null);const b=a.getTrackManager();b&&b.release();a.A&&(a.A.destroy(),a.A=null);a.O&&(a.O.destroy(),a.O=null);a.l&&a.l.release();a.o&&(a.o.destroy(),
422
+ a.o=null);_.nh(a.h);a.f&&(a.f=new _.Kt);a.F=null;a.ea=null;a.G=!1;a.a&&(a.a.removeAttribute("src"),a.a.load());yield mo(a)}})}release(){return super.release().then(()=>this.unload()).then(()=>{this.j&&Un(this.j,_.co)})}destroy(){if(this.w)return this.log.warn("Player is already destroyed!"),Promise.resolve();this.w=!0;return super.destroy().then(()=>this.release()).then(()=>{this.log.debug(za);const a=this.getTrackManager();a&&a.destroy();this.l&&(this.l.destroy().catch(b=>{this.log.warn("Error while disposing metadata handler",
423
+ b)}),this.l=null);this.j&&(this.j.destroy(),this.j=null);this.f=null})}getDrmInfo(){return this.o?this.o.getDrmInfo():null}detach(){}setSeekInterceptor(){}getTrackManager(){return this.Kb}load(a){const b=this;return _.w(function*(){if(b.w)return lo();if(!b.getSurface()||!b.getSurface().getMedia())return Promise.reject("No surface or no media element in surface");const c=b.C.getMedia();b.H=Date.now()/1E3;b.f=new _.Kt;b.h.on(b,_.Mf,()=>{b.f&&_.Mn(b.f.a,b.getState())});Un(b.j,_.eo);b.ea=_.jo(a);b.configuration=
424
+ _.dl(b.da,a);b.log.debug(_.fb,b.configuration);b.log.debug(_.yb,b.ea);const d=_.Ln(b.configuration,[_.ce,"native"]);b.O=d.create(b);b.O.setTextVisibility(!0);b.configuration.enableHtmlCue&&_.gl(_.Sf)&&!_.mk()&&(b.A=new lt(b),b.A.start(c));b.l?b.l.release():b.l=new Gs(b);xh(b.l,c);b.getTrackManager().load();c.loop=!!b.configuration.loop;_.z(b.configuration.volume)||b.setVolume(b.configuration.volume);_.z(b.configuration.muted)||b.setMuted(b.configuration.muted);b.h.one(c,Xc,()=>{b.trigger(new _.C(_.pt))});
425
+ null==b.configuration.startTime&&uo(b,c);_.kk()&&vo(b,c);try{yield oo(b,c),yield qo(b),yield to(b).W}catch(e){b.G=!1,b.onError(e)}})}onError(a){this.G||(a.severity===_.E&&null!==this.j&&Un(this.j,_.bo),this.trigger(new _.C(_.Vd,{detail:a})))}Rf(){return new T}getState(){return null!==this.j?this.j.getState().currentState:_.Mt}getPresentationStartTime(){if(this.a&&this.a.getStartDate&&this.isLive()){const a=this.a.getStartDate();return isNaN(a.getTime())?null:a.getTime()/1E3}return null}getSeekRange(){var a=
426
+ this.getSurface().getMedia();if(a&&a.src){a=a.seekable;if(a.length)return this.F=a={start:a.start(0),end:a.end(a.length-1)};if(this.F)return this.F}return{start:0,end:0}}isLive(){return this.a&&this.a.src?Infinity===this.a.duration:!1}getStats(){if(!this.f||!this.a)return _.Qn();this.f&&_.Mn(this.f.a,this.getState());var a=this.a,b=this.f,c=a.videoHeight;b.w=a.videoWidth;b.h=c;a.getVideoPlaybackQuality&&(c=a.getVideoPlaybackQuality(),a=this.f,b=Number(c.totalVideoFrames),a.l=Number(c.droppedVideoFrames),
427
+ a.j=b,this.f.C=Number(c.corruptedVideoFrames));if(a=this.getTrackManager())if(a=a.ma())a.bandwidth&&(this.f.o=a.bandwidth),a.Mc&&(this.f.f=a.Mc);return this.f.getStats()}getTimelineCues(){return this.l?this.l.getTimelineCues():[]}getCueTimeline(){return null}};
428
+ _.Vk(new class{a(){return nd}canPlay(a,b){a=a.type||"";const c=a===_.Bc,d=a===_.Gc,e=a===_.Rk;var f;_.jk()||c||d||e&&!_.kk()?f=0:f=""!==Xj().canPlayType(a)?e&&_.kk()&&(window.ManagedMediaSource||window.MediaSource&&MediaSource.isTypeSupported)&&!b.streaming.preferNativeHlsOnSafari?1:2:0;return f}f(a){return a===_.na}create(){return new Ot}});var Pt=class{getCuePoints(){}Eb(){}Db(){}};_.x("clpp.ads.IAdsTimeline",Pt);Pt.prototype.hasPostroll=Pt.prototype.Db;Pt.prototype.hasPreroll=Pt.prototype.Eb;Pt.prototype.getCuePoints=Pt.prototype.getCuePoints;var U=class{hb(){}ib(){}ob(){}getId(){}getCreativeId(){}getApiFramework(){}getAdSystem(){}getAdvertiserName(){}getTitle(){}getDuration(){}getPosition(){}getSkipTimeOffset(){}Nb(){}xb(){}getMediaUrl(){}lb(){}kb(){}Za(){}Ua(){}getPodIndex(){}Bb(){}Cb(){}nb(){}getWrapperAdIds(){}getWrapperAdSystems(){}getWrapperCreativeIds(){}};_.x("clpp.ads.IAd",U);U.prototype.getWrapperCreativeIds=U.prototype.getWrapperCreativeIds;U.prototype.getWrapperAdSystems=U.prototype.getWrapperAdSystems;
429
+ U.prototype.getWrapperAdIds=U.prototype.getWrapperAdIds;U.prototype.getSequenceLength=U.prototype.nb;U.prototype.getPositionInSequence=U.prototype.Cb;U.prototype.getPodTimeOffset=U.prototype.Bb;U.prototype.getPodIndex=U.prototype.getPodIndex;U.prototype.getPodType=U.prototype.Ua;U.prototype.getMediaBitrate=U.prototype.Za;U.prototype.getMediaHeight=U.prototype.kb;U.prototype.getMediaWidth=U.prototype.lb;U.prototype.getMediaUrl=U.prototype.getMediaUrl;U.prototype.getClickThroughUrl=U.prototype.xb;
430
+ U.prototype.isBumper=U.prototype.Nb;U.prototype.getSkipTimeOffset=U.prototype.getSkipTimeOffset;U.prototype.getPosition=U.prototype.getPosition;U.prototype.getDuration=U.prototype.getDuration;U.prototype.getTitle=U.prototype.getTitle;U.prototype.getAdvertiserName=U.prototype.getAdvertiserName;U.prototype.getAdSystem=U.prototype.getAdSystem;U.prototype.getApiFramework=U.prototype.getApiFramework;U.prototype.getCreativeId=U.prototype.getCreativeId;U.prototype.getId=U.prototype.getId;
431
+ U.prototype.getTechnology=U.prototype.ob;U.prototype.getAdManagerVersion=U.prototype.ib;U.prototype.getAdManagerName=U.prototype.hb;_.x("clpp.ads.PodType",{PREROLL:0,MIDROLL:1,POSTROLL:2});_.x("clpp.ads.Technology",{CLIENT_SIDE:0,SERVER_SIDE:1,SERVER_GUIDED:2});_.x("clpp.ads.ErrorType",{LOAD:0,PLAY:1,OTHER:2});var xo=new _.R("clpp.ads"),wo=[];var Qt=class{load(){}start(){}w(){}resume(){}pause(){}skip(){}getVolume(){}setVolume(){}getPosition(){}h(){}o(){}};_.x("clpp.ads.IAdsManager",Qt);Qt.prototype.getPosition=Qt.prototype.getPosition;Qt.prototype.setVolume=Qt.prototype.setVolume;Qt.prototype.getVolume=Qt.prototype.getVolume;Qt.prototype.skip=Qt.prototype.skip;Qt.prototype.pause=Qt.prototype.pause;Qt.prototype.resume=Qt.prototype.resume;var Xs=class extends _.so{constructor(a){super(new _.ln,()=>Promise.resolve());this.B=a;this.h=null;this.w=this.W;this.f=-1;this.j=this.l=this.o=null;Co(this)}then(a,b){this.W=this.W.then(a,b);return this}catch(a){this.W=this.W.catch(a);return this}abort(){if(this.a)return Promise.resolve();this.a=!0;return this.h.then(a=>{this.o&&clearTimeout(this.o);this.l&&this.l();return a.abort()}).catch(()=>{})}};var Rt=class{constructor(a,b){b=void 0===b?2:b;this.a=new Uint8Array(a);this.h=b;this.f=0}};var Fo=class{constructor(){this.a=Do()}};var hp=class{constructor(a,b){a=void 0===a?1E6:a;b=void 0===b?!0:b;this.j=new Rt(a);this.length=a;this.A=b;this.f=this.a=this.h=0;this.l=null;this.o=-1;this.w=new Fo}};var No=window.XMLHttpRequest;var ip=class{constructor(a){this.a=new Uint8Array(a||65536);this.f=0;this.h=new Fo}};var Er,So,Vo,To;Er=class{constructor(a){this.m=a;this.f=a.getNetworkEngine();this.h=Wo(this);this.f.uc(this.h);this.a=null}release(){this.a=null;this.f.fd(this.h)}};_.St="maxSuggestedBitrateKbps";So={du:"duress",etp:_.Wd,mb:_.St,rd:"responseDelay",rtt:"roundTripTime"};Vo={at:"availabilityTime",br:"encodedBitrateKbps",ht:"heldTime",n:"intermediaryIdentifier",nor:"nextObjectResponse",nrr:"nextRangeResponse",d:"objectDuration",ot:"objectType",su:"startup",st:"streamType",sf:"streamingFormat",v:ig};
432
+ To=new _.R("clpp.net.CmsdManager");var Tt=class{constructor(a){this.m=a;this.j=this.m.getNetworkEngine();this.a=new _.Fs;this.h=null;this.f=!0;$o(this)}release(){this.a.release();ap(this);this.m=null}};var gp=window.fetch,dp=window.AbortController,cp=window.Headers;_.Ut=class{constructor(a,b,c,d){this.id=a;this.f=b;this.a=c;this.h=d}getDuration(){return this.a}getId(){return this.id}Mb(){return this.f}Zc(){return this.h}Ac(a){return this.getId()===a.getId()&&this.Mb()===a.Mb()&&this.getDuration()===a.getDuration()&&this.Zc()===a.Zc()}};_.x("clpp.media.TimelineWindow",_.Ut);_.Ut.prototype.isDynamic=_.Ut.prototype.Zc;_.Ut.prototype.getStart=_.Ut.prototype.Mb;_.Ut.prototype.getId=_.Ut.prototype.getId;_.Ut.prototype.getDuration=_.Ut.prototype.getDuration;_.Vt=class{constructor(){this.a=[];this.f=-1;this.h=null}Jg(a){return this.a[a]||null}Kg(){return this.a.length}Lg(){return this.a}jf(){return this.a[this.f]||null}Eg(){return this.f}};_.x("clpp.media.Timeline",_.Vt);_.Vt.prototype.getCurrentWindowIndex=_.Vt.prototype.Eg;_.Vt.prototype.getCurrentWindow=_.Vt.prototype.jf;_.Vt.prototype.getWindows=_.Vt.prototype.Lg;_.Vt.prototype.getWindowCount=_.Vt.prototype.Kg;_.Vt.prototype.getWindow=_.Vt.prototype.Jg;_.Wt=new _.R("clpp.media.TimestampParser");_.np={};_.pp={};_.x("clpp.polyfill.installAll",sp);var rp=[];_.x("clpp.polyfill.register",_.tp);_.tp(function(){navigator.languages||Object.defineProperty(navigator,"languages",{get:()=>navigator.language?[navigator.language]:["en"]})});_.tp(function(){_.kh("VideoPlayPromise.install");if(window.HTMLMediaElement){const a=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){const b=a.apply(this);b&&b.catch(()=>{});return b}}});_.tp(function(){if(window.Document){var a=Element.prototype;a.requestFullscreen=a.requestFullscreen||a.mozRequestFullScreen||a.msRequestFullscreen||a.webkitRequestFullscreen;a=Document.prototype;a.exitFullscreen=a.exitFullscreen||a.mozCancelFullScreen||a.msExitFullscreen||a.webkitExitFullscreen;Yd in document||(Object.defineProperty(document,Yd,{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement}}),Object.defineProperty(document,"fullscreenEnabled",
433
+ {get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitSupportsFullscreen||document.webkitFullscreenEnabled}}));document.addEventListener("webkitfullscreenchange",up);document.addEventListener("webkitfullscreenerror",up);document.addEventListener("mozfullscreenchange",up);document.addEventListener("mozfullscreenerror",up);document.addEventListener("MSFullscreenChange",up);document.addEventListener("MSFullscreenError",up)}});var vp;_.tp(function(){_.kh("InputEvent.install");_.Zj("Trident/")&&HTMLInputElement.prototype.addEventListener!==wp&&(_.jh("Patching input event support on IE."),vp=HTMLInputElement.prototype.addEventListener,HTMLInputElement.prototype.addEventListener=wp)});_.tp(function(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.getVideoPlaybackQuality&&"webkitDroppedFrameCount"in a&&(a.getVideoPlaybackQuality=xp)}});_.tp(function(){_.kh("mathRound.install")});_.tp(function(){ArrayBuffer.prototype.slice||(ArrayBuffer.prototype.slice=function(a,b){b=void 0!==b?b:this.byteLength;a=Math.floor(a);b=Math.floor(b);0>a&&(a+=this.byteLength);0>b&&(b+=this.byteLength);a=Math.min(Math.max(0,a),this.byteLength);b=Math.min(Math.max(0,b),this.byteLength);if(0>=b-a)return new ArrayBuffer(0);const c=new ArrayBuffer(b-a),d=_.I(c);a=new Uint8Array(this,a,b-a);d.set(a);return c})});_.tp(function(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;a.requestPictureInPicture&&document.exitPictureInPicture||!a.webkitSupportsPresentationMode||(_.kh("PiPWebkit.install"),document.pictureInPictureEnabled=!0,document.pictureInPictureElement=null,a.requestPictureInPicture=zp,document.exitPictureInPicture=Ap,document.addEventListener("webkitpresentationmodechanged",yp,!0))}});_.tp(function(){if(window.VTTCue)_.jh("Using native VTTCue.");else if(window.TextTrackCue){var a=TextTrackCue.length;if(3===a)_.jh(Rb),window.VTTCue=Bp;else if(6===a)_.jh("Using VTTCue polyfill from 6 argument TextTrackCue."),window.VTTCue=Cp;else{try{var b=!!Bp(1,2,"")}catch(c){b=!1}b&&(_.jh(Rb),window.VTTCue=Bp)}}else _.lh("VTTCue not available.")});var P=class{constructor(a,b,c,d){this.w=this.o=this.l=!1;this.A=a;this.a=b;this.f=c;this.h=d;this.j=0}hb(){return""}ib(){return""}ob(){return 2}getId(){return""}getCreativeId(){return""}getApiFramework(){return null}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return""}getDuration(){return this.h}getPosition(){return this.j}getSkipTimeOffset(){return-1}Nb(){return!1}xb(){return null}getMediaUrl(){return null}lb(){return 0}kb(){return 0}Za(){return 0}Ua(){return this.A}getPodIndex(){return 0}Bb(){return 0}Cb(){return this.a}nb(){return this.f}getWrapperAdIds(){return[]}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}};
434
+ P.prototype.getWrapperCreativeIds=P.prototype.getWrapperCreativeIds;P.prototype.getWrapperAdSystems=P.prototype.getWrapperAdSystems;P.prototype.getWrapperAdIds=P.prototype.getWrapperAdIds;P.prototype.getSequenceLength=P.prototype.nb;P.prototype.getPositionInSequence=P.prototype.Cb;P.prototype.getPodTimeOffset=P.prototype.Bb;P.prototype.getPodIndex=P.prototype.getPodIndex;P.prototype.getPodType=P.prototype.Ua;P.prototype.getMediaBitrate=P.prototype.Za;P.prototype.getMediaHeight=P.prototype.kb;
435
+ P.prototype.getMediaWidth=P.prototype.lb;P.prototype.getMediaUrl=P.prototype.getMediaUrl;P.prototype.getClickThroughUrl=P.prototype.xb;P.prototype.isBumper=P.prototype.Nb;P.prototype.getSkipTimeOffset=P.prototype.getSkipTimeOffset;P.prototype.getPosition=P.prototype.getPosition;P.prototype.getDuration=P.prototype.getDuration;P.prototype.getTitle=P.prototype.getTitle;P.prototype.getAdvertiserName=P.prototype.getAdvertiserName;P.prototype.getAdSystem=P.prototype.getAdSystem;
436
+ P.prototype.getApiFramework=P.prototype.getApiFramework;P.prototype.getCreativeId=P.prototype.getCreativeId;P.prototype.getId=P.prototype.getId;P.prototype.getTechnology=P.prototype.ob;P.prototype.getAdManagerVersion=P.prototype.ib;P.prototype.getAdManagerName=P.prototype.hb;var Xt=class{constructor(a){this.a=a.map(b=>({videoId:b.getSurface().getMedia().id,player:b,md:!0,ready:Promise.resolve()}));this.g=new _.R("clpp.plist.PlayerPool")}has(){return this.a.some(a=>a.md)}get(){const a=this;return _.w(function*(){const b=a.a.find(c=>c.md);if(!b)throw Error("No available players in the pool");b.md=!1;yield b.ready;return b.player})}release(a){const b=this.a.find(c=>c.player===a);if(!b)return Promise.resolve();b.md=!0;b.ready=new Promise(c=>{a.release().catch(d=>{this.g.error("Failed to unload player",
437
+ d)}).then(c)});return b.ready}destroy(){const a=this;return _.w(function*(){yield Promise.all(a.a.map(b=>b.player.destroy()))})}};_.x("clpp.utils.dom.createHTMLElement",_.Gp);var Yt=class{constructor(a){this.a=null;this.h=new Set;this.f=null;this.set(a||null)}set(a){this.h.clear();this.f&&(this.f.disconnect(),this.f=null);if(this.a=a)this.f=Hp(this,a)}get(){return this.a}};var Mp=class{constructor(a,b){this.g=new _.R("clpp.PlayerSurface");this.w=_.Qg(Zt,b);this.f=new Yt;this.h=null;this.a=new Yt;this.l=$t;$t+=1;this.o=`clpp-video-${this.l}`;this.j=new _.Fs;if(null==a)throw new _.G(_.E,7,7102,"No Media element was provided");if(!(a instanceof Element||(a=document.getElementById(a),a)))throw new _.G(_.E,7,7004,"Media element not found");b=this.w;this.g.debug("Initializing Player Surface on ",a);if("cast-media-player"===a.tagName.toLowerCase())this.h=a;else{if(!(a instanceof
438
+ HTMLMediaElement))throw new _.G(_.E,7,7005,"Media element is not instance of HTMLMediaElement");if(!a.hasAttribute("crossorigin")){var c=b.crossorigin;this.g.info("Setting media elements crossorigin to "+c);a.setAttribute("crossorigin",c)}this.f.set(a);if(b.disableContainer)var d=null;else if(b.containerEl){if(a.parentNode!==b.containerEl)throw new _.G(_.E,7,7006,"Container element is not a direct parent of media element");d=b.containerEl}else{c=document.createElement(_.Fd);a.parentNode?a.parentNode.replaceChild(c,
439
+ a):this.g.warn("Player Surface Element has no parent. Can not inject container. You have to manually add playerSurface.getContainer() to the DOM!");var e=[];for(let g=0;g<a.classList.length;g++)e.push(a.classList[g]);for(var f of e)a.classList.remove(f),_.Ep(c,f);c.style.cssText=a.style.cssText;a.removeAttribute(_.Rf);for(d of[_.Dg,_.$d])f=a.getAttribute(d),f=parseInt(f,10),isNaN(f)||(c.style[d]=`${f}px`),_.ak()||a.removeAttribute(d);c.appendChild(a);d=c}d&&(this.a.set(d),Ip(this.a,"clpp-container"),
440
+ Ip(this.a,this.o),Ip(this.f,_.gd),Ip(this.f,"clpp-video"));b.webOSStartupPatch&&Jp(this,a,d)}}getMedia(){return this.f.get()}getContainer(){return this.a.get()}getSafeContainer(){return this.a}getId(){return this.l}getUniqueCssClass(){return this.o}getCastElement(){return this.h}isFullscreen(){return!!document.fullscreenElement}hideMediaElement(){const a=this.getMedia();a?_.Ep(a,hd):this.g.debug("No media element available that could be hidden")}showMediaElement(){const a=this.getMedia();a?a.classList.remove(hd):
441
+ this.g.debug("No media element available that could be shown")}addElementToContainer(a,b,c){b=void 0===b?!1:b;c=void 0===c?!1:c;const d=this.getContainer();if(!d)throw Error("No container is available. Unable to add element");b&&_.Ep(a,_.gd);c?d.insertBefore(a,d.firstElementChild):d.appendChild(a)}removeElementFromContainer(a){const b=this.getContainer();if(!b)throw Error("No container is available. Unable to remove element");b.removeChild(a)}hide(a){_.Ep(a,hd)}show(a){a.classList.remove(hd)}release(){this.j.release()}};
442
+ Mp.prototype.removeElementFromContainer=Mp.prototype.removeElementFromContainer;Mp.prototype.addElementToContainer=Mp.prototype.addElementToContainer;Mp.prototype.getCastElement=Mp.prototype.getCastElement;Mp.prototype.getContainer=Mp.prototype.getContainer;Mp.prototype.getMedia=Mp.prototype.getMedia;var Zt={disableContainer:!1,webOSStartupPatch:!0,crossorigin:"anonymous",containerEl:null},$t=1;var au=class{constructor(a){this.za=a;this.h=[];this.f=a.If;this.w=a.If.getSurface().getContainer();if(!this.w)throw Error("Primary player does not have a container");this.A=[];const b=Np(this,this.w,this.za.rg);this.l=new Xt(b);this.a=null;this.o=!1;this.j=new Map;this.B=a.toggleVisible;this.g=new _.R("clpp.interstitial.MultiController");Op(this).forEach(c=>Pp(this,c,!1))}getCurrentItem(){return this.a}vd(){return this.a?this.a.player:null}lf(){return Array.from(this.j.values())}Wc(){return 0<this.j.size}play(a){return cq(this,
443
+ a,_.Te)}load(a){return cq(this,a,_.qe)}release(){const a=this;return _.w(function*(){yield Promise.all([aq(a),a.a?$p(a,a.a):Promise.resolve()]);a.a=null;a.o=!1;Sp(a)})}destroy(){const a=this;return _.w(function*(){a.g.info("Destroy");yield a.release();yield a.l.destroy();mq(a)})}},gq="preload",dq=_.ue;var cu=class extends _.rt{constructor(a){super();this.l=new bu;this.za=_.Qg({gh:.5,hi:{enabled:!1}},a);this.g=new _.R("clpp.interstitial.Player");this.f=a.player;this.f.setSeekInterceptor(b=>{const c=pq(this,b);return c&&[wq,Jq].includes(c.state)?(this.g.info("Seeking into an interstitial",c.sa),sq(this,c).catch(()=>{this.f.seek(b)}),!1):!0});this.qa=new au({rg:this.za.config,If:a.player,preloadMedia:!0,ya:a.ya});this.h=[];this.a=[];this.j=!1;Aq(this,a.player)}destroy(){const a=this;return _.w(function*(){Bq(a);
444
+ a.a=[];a.j=!1;a.f.setSeekInterceptor(null);a.l.release();yield a.qa.destroy()})}Eb(){return this.j}isLive(){const a=this.qa.vd();return a?a.isLive():null}cb(a){this.f.trigger(a)}},wq=0,Kq=1,Mq=2,Nq=3,Pq=4,Oq=5,Jq=6,bu=class{constructor(){this.a=null}release(){this.a&&(this.a.shutdown(),this.a=null)}};var kr=class{constructor(){this.a=null}load(){return Promise.resolve()}start(){return Promise.resolve()}w(a,b){const c=a.getConfiguration();a=Object.assign({},{config:c,player:a,ya:b},c.ads.hls||{});this.a=new cu(a);Iq(this.a)}resume(){const a=Cq(this.a);a&&a.play()}pause(){const a=Cq(this.a);a&&a.pause()}skip(){}getVolume(){const a=Cq(this.a);return a?a.getVolume()||0:0}setVolume(a){const b=Cq(this.a);if(b)return b.setVolume(a)}getPosition(){const a=Cq(this.a);return a?a.getPosition():-1}o(){return!this.a.Eb()}h(){return this.a.destroy()}};
445
+ kr.prototype.getPosition=kr.prototype.getPosition;kr.prototype.setVolume=kr.prototype.setVolume;kr.prototype.getVolume=kr.prototype.getVolume;kr.prototype.skip=kr.prototype.skip;kr.prototype.pause=kr.prototype.pause;kr.prototype.resume=kr.prototype.resume;var Tq=class{constructor(a,b,c){this.h=a;this.f=b;JSON.parse(_.ni(_.Di(a)));this.a=JSON.parse(_.ni(_.Di(b)));this.j=c}};var Rq={n:"vXdoJIQCz6sZ9pbduNukEHOR0H2dHlwuuBUAR5Ot7WLEYvav5mn63yxr6F6TIl8RHTFw2siXQhHblZH2Y89o8vhcZRFkYXo6h0igEVafu-n0w52UEcH8Cqzlb8Q7x03Qb8OcKLngSzDkwe5Y2Aix6I66RRVNLLssqyjp2n5tXs4JQmYdqY6hhpGhmBN84naeCTdcPpAYhCw8jqbTSNrJp5hjU4GVvOiUtoYCvdESV9xrOR7fPCFXhWfLtC3i1k1zVoIM7YW5qD0F676jhqkF-GmDuCHpRY2I2Cxui-ytYEVIM6_pylSIlmYLjARmv2jXz9aV_WvHLh6B8Yx0slNGCQ",e:"AQAB"},Zk="eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ1cmxzIjpbIjovL2Nhc3RsYWJzLmNvbSJdLCJ0eXBlIjoiV2ViIiwia2lkIjoxOTUwLCJpbHYiOmZhbHNlfQ.jzGGRcbFr_2QET-4tbMcpR5pSaj7eV7X2d1HWw_VKQpPg3zCwSZSDuqw225dIYyAYwLSiElbozbZPSArkBXOsoUm-KZRUPF4m7WG0T7Uza5G-QaQw57BbbfcSsooSpatC997kHKLMTjO71By9Olcu5ykN164nZpGQtZNzQjYag-bnUaMVI5vvhzjlvDihORQ9V_qRlEh0-mpoz6W0-36HGAbWIXWq0kxPh6inbovby-ZmFpqGrVjWOEFa55EARZXPNW9ERupW5xrrYHZdwwTpdRTY5IwEnobS85yTrLhK8Y2MV4jlQLTtQp372fKDsuU6q6_4XvmNq1SgAoKoaf41g";var mr=class{constructor(a){this.f=a;this.a=null;this.g=new _.R("clpp.utils.LicenseKey")}},fr="vod",er="live";var Q=class extends _.rt{constructor(a,b,c){super();sp();this.g=new _.R("clpp.Player");if(!a)throw new _.G(_.E,7,7102);this.Y=new _.Fs;this.f=this.C=b||_.al();this.l=null;void 0===this.f.license&&(this.f.license=Zk,this.g.warn("You are using the embedded demo license!"));if(!this.f.license)throw this.g.error("You provided null or empty string as your license. Please check your license configuration."),new _.G(_.E,7,7101,"No license provided in configuration!");this.j=new Mp(a,c);this.A=this.a=this.F=
446
+ null;this.H=new _.gr;this.h=null;this.V=[];this.X=!0;this.J={};this.Z=null;this.O=!0;this.R=this.M=!1;this.K=this.zc=null;this.Wd=!1;this.da=new Tt(this);this.B=null;this.on(_.Mf,()=>{this.getState()===_.bo&&(this.a?this.a.unload():Promise.resolve())});this.on(_.yc,this.ba.bind(this));this.on(_.xc,this.ba.bind(this));this.on(_.Wf,()=>lr(this));nr(this,this.f.license);this.j.getMedia()&&(a=this.j.getMedia(),a.hasAttribute("autoplay")&&(a.removeAttribute("autoplay"),this.g.debug("Removed autoplay attribute from video element. Auto play will be handled by configuration."),
447
+ void 0===this.f.autoplay&&(this.f.autoplay=!0,this.g.debug("Setting autoplay in configuration since it was specified in the video element"))));a=[];for(const d of ir)try{const e=d.create(this.f);e&&a.push(e)}catch(e){this.g.error("Error while creating player plugin",e)}pr(this,a);this.L=_.na;ll(this)}on(a,b,c){return super.on(a,b,c)}one(a,b,c){return super.one(a,b,c)}off(a,b){return super.off(a,b)}onError(a){if(null!==this.a)this.a.onError(a);else a=new _.C(_.Vd,{detail:a}),this.trigger(a)}kc(a){a=
448
+ this.J[a];void 0===a&&(a=null);return a}getSurface(){return this.j}getConfiguration(){return _.Rg(this.f)}getDrmInfo(){return this.a?this.a.getDrmInfo():null}detach(){return this.a?this.a.detach():Promise.resolve()}release(){if(null!=this.l)return this.g.info("Player release already in progress"),this.l;this.g.debug("Releasing player");this.l=sr(this);return this.l.finally(()=>{this.g.debug("Player released");this.l=null})}destroy(){if(this.M)return this.g.debug("The player is already destroyed. No-op"),
449
+ new Promise(a=>a());this.M=!0;return this.release().then(()=>{this.g.debug(za);this.trigger(new _.C("destroying"));return _.or(this,_.Ie)}).then(()=>{this.a&&this.a.stopForwardingEventsTo(this);this.Sc.clear();this.da.release();if(this.a)return this.a.destroy()}).then(()=>this.H.destroy()).then(()=>{ol();this.A=this.a=null;this.trigger(new _.C("destroyed"))})}load(a){const b=this;return _.w(function*(){try{_.Om(af);b.L=_.na;b.X=!0;const c=_.jo(a);yield _.zr(b,el(a)?a:{},c);yield _.Ar(b);yield _.Cr(b);
450
+ _.Om($e);_.Pm("player.load",af,$e)}catch(c){if(b.l)throw b.g.info(eb),new _.G(_.E,7,7E3);throw c;}})}preload(a){const b=this;return _.w(function*(){yield _.zr(b,a);if(b.a){var c=b.a;c.preload?yield c.preload(b.f):b.g.warn(Ab)}else b.g.warn(xb)})}use(a){(a=pl(a))&&a.o(this)}remove(a){return(this.getState()<=_.co||this.O)&&null!==jl(a)?(ql(a),this.R=!0):!1}play(){return this.a?!this.h||this.h instanceof kr||this.a.namespace()===_.kd?this.a.play():this.h.start(this.a):Promise.reject("No player initialized. You need to load content before calling play.")}pause(){return this.a?
451
+ this.a.pause():Promise.reject("No player initialized. You need to load content before calling pause.")}getTrackManager(){return this.a&&this.a.getTrackManager()}getBufferInfo(a){return this.a?this.a.getBufferInfo(a):new _.qt}getState(){return this.a?this.a.getState():_.co}getPeriods(){return this.a?this.a.getPeriods():[]}isEnded(){return this.a&&this.a.isEnded()||!1}isPaused(){return this.a&&this.a.isPaused()||!1}getPosition(){return this.a?this.a.getPosition():0}seek(a){return this.getState()===
452
+ _.bo?Promise.reject("Cannot seek in current state."):this.a?this.a.seek(a):Promise.reject("delegate does not exist")}getPresentationStartTime(){return this.a?this.a.getPresentationStartTime():null}getSeekRange(){return this.a?this.a.getSeekRange():{start:0,end:0}}lc(){const a=this.a;return a&&a.lc?a.lc():null}getVolume(){return this.a?this.a.getVolume():null}setVolume(a){this.a&&this.a.setVolume(a)}getDuration(){return this.a?this.a.getDuration():-1}getAdsManager(){return this.h}namespace(){return this.a&&
453
+ this.a.namespace()||"Undefined"}getPlaybackRate(){return this.a?this.a.getPlaybackRate():1}setPlaybackRate(a,b){this.a&&this.a.setPlaybackRate(a,b)}isMuted(){return this.a&&this.a.isMuted()||!1}setMuted(a){this.a&&this.a.setMuted(a)}getNetworkEngine(){return this.H}setNetworkEngine(a){this.H=a}getTextDisplayer(){return this.a&&this.a.getTextDisplayer()}isLive(){return!!this.a&&this.a.isLive()}getStats(){return this.a?this.a.getStats():null}pf(){return Object.freeze(this.Z)}getLoadedSource(){return this.a&&
454
+ this.a.getLoadedSource()}getTimelineCues(){return this.a?this.a.getTimelineCues():[]}getCueTimeline(){return this.a?this.a.getCueTimeline():null}resetAbr(){this.a&&this.a.resetAbr()}setDrmCustomDataModifier(a){this.zc=a;wr(this)}setCdnErrorCallback(a){this.K=a;this.a&&this.a.setCdnErrorCallback(this.K)}ba(){this.Wd=!0}};_.x("clpp.Player",Q);Q.registerPlugin=_.jr;Q.prototype.setCdnErrorCallback=Q.prototype.setCdnErrorCallback;Q.prototype.setDrmCustomDataModifier=Q.prototype.setDrmCustomDataModifier;
455
+ Q.prototype.resetAbr=Q.prototype.resetAbr;Q.prototype.getTimelineCues=Q.prototype.getTimelineCues;Q.prototype.getLoadedSource=Q.prototype.getLoadedSource;Q.prototype.getSources=Q.prototype.pf;Q.prototype.getStats=Q.prototype.getStats;Q.prototype.isLive=Q.prototype.isLive;Q.prototype.getTextDisplayer=Q.prototype.getTextDisplayer;Q.prototype.setNetworkEngine=Q.prototype.setNetworkEngine;Q.prototype.getNetworkEngine=Q.prototype.getNetworkEngine;Q.prototype.setMuted=Q.prototype.setMuted;
456
+ Q.prototype.isMuted=Q.prototype.isMuted;Q.prototype.setPlaybackRate=Q.prototype.setPlaybackRate;Q.prototype.getPlaybackRate=Q.prototype.getPlaybackRate;Q.prototype.namespace=Q.prototype.namespace;Q.prototype.getAdsManager=Q.prototype.getAdsManager;Q.prototype.getDuration=Q.prototype.getDuration;Q.prototype.setVolume=Q.prototype.setVolume;Q.prototype.getVolume=Q.prototype.getVolume;Q.prototype.getTimelineOffset=Q.prototype.lc;Q.prototype.getSeekRange=Q.prototype.getSeekRange;
457
+ Q.prototype.getPresentationStartTime=Q.prototype.getPresentationStartTime;Q.prototype.seek=Q.prototype.seek;Q.prototype.getPosition=Q.prototype.getPosition;Q.prototype.isPaused=Q.prototype.isPaused;Q.prototype.isEnded=Q.prototype.isEnded;Q.prototype.getState=Q.prototype.getState;Q.prototype.getBufferInfo=Q.prototype.getBufferInfo;Q.prototype.getTrackManager=Q.prototype.getTrackManager;Q.prototype.pause=Q.prototype.pause;Q.prototype.play=Q.prototype.play;Q.prototype.remove=Q.prototype.remove;
458
+ Q.prototype.use=Q.prototype.use;Q.prototype.load=Q.prototype.load;Q.prototype.destroy=Q.prototype.destroy;Q.prototype.release=Q.prototype.release;Q.prototype.getDrmInfo=Q.prototype.getDrmInfo;Q.prototype.getConfiguration=Q.prototype.getConfiguration;Q.prototype.getSurface=Q.prototype.getSurface;Q.prototype.getPlugin=Q.prototype.kc;Q.prototype.off=Q.prototype.off;Q.prototype.one=Q.prototype.one;Q.prototype.on=Q.prototype.on;_.co=0;_.eo=1;_.Yn=2;_.go=3;_.fo=4;_.Vn=5;_.bo=6;_.Mt=7;
459
+ _.ao={IDLE:_.co,PREPARING:_.eo,BUFFERING:_.Yn,PLAYING:_.go,PAUSED:_.fo,ENDED:_.Vn,ERROR:_.bo,UNSET:_.Mt};Q.State=_.ao;var ir=[];var fu=class extends _.wt{constructor(a,b,c,d,e){super(ab);this.l=a;this.j=b;this.h=c;this.a=d;this.o=e;this.g=new _.R(ld);_.xi(this.l)?this.g.warn(_.Xb):this.Wa(_.yd,{licenseUrl:this.l,videoRobustness:[_.Gb,void 0],audioRobustness:[_.Fb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.ed.bind(this)}});_.xi(this.j)?this.g.warn(_.wb):this.Wa(_.wd,{licenseUrl:this.j,videoRobustness:["3000"],audioRobustness:["2000"],modifiers:{licenseRequest:this.ed.bind(this)}});
460
+ _.xi(this.h)?this.g.warn(_.Va):_.xi(this.a)?this.g.warn(_.Ta):this.Wa(_.ud,{licenseUrl:this.h,certificateUrl:this.a,modifiers:{licenseRequest:this.Af.bind(this),licenseResponse:this.Bf.bind(this),certificateRequest:this.ed.bind(this),extractContentId:this.ef.bind(this)}})}ed(a,b){a=a.drm.customData.headers||{};for(const c of Object.keys(a))b.headers[c]=a[c]}ef(a,b){a=Ql(b);switch(this.o){case du:return a;case eu:return(new _.Rl(a)).a;default:throw Error("Unknown content ID strategy");}}Af(a,b){b.headers[ua]=
461
+ Hc;this.ed(a,b);a={spc:_.Bi(b.body)};b.body=_.ti(_.mj(a,!0))}Bf(a,b){a=_.ni(b.data).trim();const c="\x3c/ckc\x3e"===a.substr(-6);"\x3cckc\x3e"===a.substr(0,5)&&c&&(a=a.slice(5,-6));b.data=_.Di(a).buffer}};_.x(ld,fu);fu.prototype.onFairPlayLicenseResponse=fu.prototype.Bf;fu.prototype.onFairPlayLicenseRequest=fu.prototype.Af;fu.prototype.extractFairPlayContentId=fu.prototype.ef;fu.prototype.onLicenseRequest=fu.prototype.ed;fu.prototype.constructor=fu.prototype.constructor;fu.NAME=ab;
462
+ var eu="hostname",du="full-skd";fu.FairPlayContentIdStrategy={HOSTNAME:eu,FULL_SKD:du};var gu=class{constructor(){this.j=null;this.g=new _.R("clpp.drm.eme.StandardEmeManager")}l(a){this.j=a}h(a){return this.j?this.j.setMediaKeys(a):Promise.reject(jb)}o(){return this.j&&this.j.mediaKeys}a(a,b){this.g.info("Requesting media key system access for",a,b.map(c=>Object.assign({},c,{drmInfos:c.drmInfos.map(()=>"_anonymous_")})));return navigator.requestMediaKeySystemAccess(a,b).catch(c=>{this.g.info("Failed to request media key system access for "+`${a}.`,c);return Promise.reject(c)})}f(){return Eb}};
463
+ wm(new class{a(){return Eb}f(){return!!(window.MediaKeys&&navigator.requestMediaKeySystemAccess&&window.MediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)}create(){return new gu}},1E3);var iu=class{constructor(){this.size=0;this.a=void 0;this.g=new _.R("clpp.drm.eme.MediaKeyStatusMap")}getStatus(){return this.a}forEach(a){this.a&&a(this.a,hu.value())}get(a){if(this.has(a))return this.a}has(a){const b=hu.value();return this.a&&fi(a,b)?!0:!1}entries(){}keys(){}values(){}},hu=new _.Lt(()=>li(new Uint8Array([0])));var ku=class{constructor(){this.w=this.j=null;this.A="";HTMLMediaElement.prototype.webkitGenerateKeyRequest&&(this.A="webkit")}l(a){this.j=a}h(a){_.kh("WebkitEmeManager.setMediaKeys");if(!this.j)return Promise.reject(jb);const b=this.w;b&&b!==a&&Jr(b,null);(this.w=a)&&Jr(a,this.j);return Promise.resolve()}o(){return this.w}a(a,b){_.kh("WebkitEmeManager.requestMediaKeySystemAccess");try{if(this.j)var c=this.j;else{var d=document.getElementsByTagName(_.t);c=d.length?d[0]:document.createElement(_.t)}const e=
464
+ new ju(this.A,c,a,b);return Promise.resolve(e)}catch(e){return Promise.reject(e)}}f(){return"WEBKIT"}},ju=class{constructor(a,b,c,d){this.h=a;this.a=this.keySystem=c;a=!1;c===_.Ne&&(this.a=yg,a=!1);let e=!1;for(const g of d){d=[];var f=[];let h=!1;if(g.audioCapabilities)for(const k of g.audioCapabilities)k.contentType&&(h=!0,b.canPlayType(k.contentType.split(";")[0],this.a)&&(d.push(k),e=!0));if(g.videoCapabilities)for(const k of g.videoCapabilities)k.contentType&&(h=!0,b.canPlayType(k.contentType,
465
+ this.a)&&(f.push(k),e=!0));h||(e=b.canPlayType(_.qg,this.a)||b.canPlayType("video/webm",this.a));g.persistentState!==_.wf||a||(e=!1);if(e){this.f=g;return}}b=Qb;if(c===_.Ne||c===_.yd)b="None of the requested configurations were supported.";c=Error(b);c.name=tb;c.code=DOMException.NOT_SUPPORTED_ERR;throw c;}createMediaKeys(){return Promise.resolve(new lu(this.h,this.a))}getConfiguration(){return this.f}},lu=class{constructor(a,b){this.h=a;this.o=b;this.a=null;this.f=new _.Fs;this.j=[];this.l=new Map}createSession(a=
466
+ Tf){if(a!==Tf&&a!==_.Re)throw new TypeError("Session type "+a+ba);if(!this.a)throw a=Error("Media element is missing."),a.name=bb,a.code=DOMException.INVALID_STATE_ERR,a;this.a.src||(this.a.src="about:blank");a=new mu(this.h,this.a,this.o,a);this.j.push(a);return a}setServerCertificate(){return Promise.resolve(!1)}},mu=class extends _.rt{constructor(a,b,c,d){super();this.w=a;this.j=b;this.o=!1;this.a=this.f=null;this.h=c;this.l=d;this.sessionId="";this.expiration=NaN;this.closed=new _.ln;this.keyStatuses=
467
+ new iu}ready(){_.kh("WebkitEmeManager.MediaKeySession.ready");Ir(this,"usable");this.a&&this.a.resolve();this.a=null}generateRequest(a,b){_.kh("WebkitEmeManager.MediaKeySession.generateRequest");return Lr(this,b,null)}load(a){_.kh(Wb);return this.l===_.Re?Lr(this,null,a):Promise.reject(Error(pb))}update(a){_.kh(Wb);const b=new _.ln;Mr(this,b,a);return b}close(){_.kh("WebkitEmeManager.MediaKeySession.close");if(this.l!==_.Re){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),
468
+ this.closed;const a=Kr(this,"cancelKeyRequest");try{this.j[a](this.h,this.sessionId)}catch(b){}}this.closed.resolve();return this.closed}remove(){_.kh("WebkitEmeManager.MediaKeySession.remove");return this.l!==_.Re?Promise.reject(Error(pb)):this.close()}};wm(new class{a(){return"WEBKIT"}f(){return!(!HTMLMediaElement.prototype.webkitGenerateKeyRequest&&!HTMLMediaElement.prototype.generateKeyRequest)}create(){return new ku}});var ou=class{constructor(){this.j=this.w=null}l(a){this.w=a}h(a){const b=this.j;b&&b!==a&&Qr(b,null);return(this.j=a)?Qr(a,this.w):Promise.resolve()}o(){return this.j}a(a,b){_.kh("AppleEmeManager.requestMediaKeySystemAccess");try{const c=new nu(a,b);return Promise.resolve(c)}catch(c){return Promise.reject(c)}}f(){return"APPLE"}},nu=class{constructor(a,b){this.keySystem=a;if(a.startsWith(_.ud))for(var c of b){a:{a=c;if(a.persistentState===_.wf){a=null;break a}b={audioCapabilities:[],videoCapabilities:[],
469
+ persistentState:_.Me,distinctiveIdentifier:_.Me,initDataTypes:a.initDataTypes,sessionTypes:[Tf],label:a.label};let d=!1,e=!1;if(a.audioCapabilities)for(const f of a.audioCapabilities)f.contentType&&(d=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,f.contentType.split(";")[0])&&(b.audioCapabilities.push(f),e=!0));if(a.videoCapabilities)for(const f of a.videoCapabilities)f.contentType&&(d=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,f.contentType.split(";")[0])&&(b.videoCapabilities.push(f),
470
+ e=!0));d||(e=WebKitMediaKeys.isTypeSupported(this.keySystem,_.qg));a=e?b:null}if(a){this.a=a;return}}c=Error(Qb);c.name=tb;c.code=DOMException.NOT_SUPPORTED_ERR;throw c;}createMediaKeys(){const a=new pu(this.keySystem);return Promise.resolve(a)}getConfiguration(){_.kh("AppleEmeManager.MediaKeySystemAccess.getConfiguration");return this.a}},pu=class{constructor(a){this.f=null;this.h=new WebKitMediaKeys(a);this.a=new _.Fs;this.j=0;this.g=new _.R(md);this.g.info("Created Media Keys for "+a)}createSession(a){a=
471
+ void 0===a?Tf:a;this.g.debug("Creating Apple MediaKeys Session");if(a!==Tf)throw new TypeError("Session type "+a+ba);return new qu(this.h,`__session_${this.j++}`)}setServerCertificate(){this.g.debug("AppleEmeManager.MediaKeys.setServerCertificate");return Promise.resolve(!1)}},qu=class extends _.rt{constructor(a,b){super();this.a=null;this.o=a;this.f=this.h=null;this.j=new _.Fs;this.sessionId=b;this.expiration=NaN;this.closed=new _.ln;this.l=!1;this.keyStatuses=new iu;this.g=new _.R(md)}generateRequest(a,
472
+ b){if(this.l)return Promise.reject(Hb);this.g.debug("generateRequest");this.h=new _.ln;try{const c=this.o.createSession(_.qg,_.I(b));this.a=c;this.sessionId=c.sessionId||this.sessionId||"";this.j.on(c,Bg,d=>{{const e=this.keyStatuses.getStatus();this.g.debug(`Received Key Message in ${this.sessionId}`);this.h&&(this.h.resolve(),this.h=null);d=new _.C(_.xe,{messageType:void 0===e||e===Nf?ie:he,message:li(d.message.buffer)});this.dispatchEvent(d)}});this.j.on(c,zg,d=>{this.g.debug("onWebkitKeyAdded_",
473
+ d);this.f&&(Rr(this,"usable"),this.f.resolve(),this.f=null)});this.j.on(c,Ag,()=>{var d=this.keyStatuses.getStatus();if(this.a&&this.a&&this.a.error&&this.a.error.code===WebKitMediaKeyError.MEDIA_KEYERR_DOMAIN&&d===Nf)this.g.warn(`Ignoring webkit key error for session ${this.sessionId}`);else if(this.g.error(`Received key error in session ${this.sessionId} `+`with code ${this.a.error.code}. `+`Session Status ${d}.`),d=Error("EME AppleEmeManager key error"),d.errorCode=this.a.error,null!==this.h)this.h.reject(d),
474
+ this.h=null;else if(null!==this.f)this.f.reject(d),this.f=null;else switch(this.a.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:Rr(this,"output-not-allowed");break;default:Rr(this,_.ee)}});Rr(this,Nf)}catch(c){this.h.reject(c)}return this.h}load(){this.g.debug(_.qe);return Promise.reject(Error("MediaKeySession.load not yet supported"))}update(a){if(this.l)return Promise.reject(Hb);this.g.debug(cg);this.f=new _.ln;try{this.a.update(_.I(a))}catch(b){this.f.reject(b)}return this.f}close(){if(this.l)return this.closed;
475
+ this.g.info(`Closing Key Session ${this.sessionId}`);this.l=!0;try{this.a.close(),this.closed.resolve(),_.nh(this.j)}catch(a){this.closed.reject(a)}return this.closed}remove(){this.g.debug("remove");return Promise.reject(Error("MediaKeySession is only applicable for persistent licenses, which are not supported on this platform"))}};wm(new class{a(){return"APPLE"}f(){return!!window.WebKitMediaKeys}create(){return new ou}},1100);var ru=class{l(){}h(a){_.kh("NopEmeManager.setMediaKeys");return null===a?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}o(){return null}a(){_.kh("NopEmeManager.requestMediaKeySystemAccess");return Promise.reject(Error("The key system specified is not supported."))}f(){return"NOP"}};wm(new class{a(){return"NOP"}f(){return!0}create(){return new ru}},-1);_.su=class{f(){}a(){}h(){}o(){}};_.x("clpp.drm.HeaderDrmComponent",class extends _.su{h(a){a=a.getConfiguration();if(a.drm&&a.drm&&a.drm.env===ab){a=a.drm.customData;if(!a)throw new _.G(_.E,7,7100,_.zd);a=new fu(a.widevineLicenseUrl,a.playReadyLicenseUrl,a.fairPlayLicenseUrl,a.fairPlayCertificateUrl,a.fairPlayContentIdStrategy||du);_.vl(a)}}a(){delete _.ul.HeaderDrm}id(){return"headerdrm"}});var Sr=new Map;var vu=class{constructor(a){this.h=a;this.f={keepOriginalTimestamps:!0,remux:!1};this.a=new muxjs.mp4.Transmuxer(this.f)}destroy(){this.a.dispose();this.a=null}reset(){this.a=new muxjs.mp4.Transmuxer(this.f)}isSupported(a,b){const c="mp2t"===a.toLowerCase().split(";")[0].split("/")[1],d=a.toLowerCase().split(";")[0]===_.Ic;if(!window.muxjs||!c&&!d)return!1;if(d)return _.Tr(Mc);if(b)return _.Tr(Ur(b,a));b=Ur(_.p,a);a=Ur(_.t,a);return _.Tr(b)||_.Tr(a)}isMuxed(a,b){return 1<this.demuxMimeTypes(a,b).size}demuxMimeTypes(a,
476
+ b){const c=new Map;c.set(a,b);try{const d=_.Rj(b),e=_.Sj(b).split(","),f=new Map,g=Yh(_.p,e),h=Yh(_.t,e);g&&f.set(_.p,this.convertCodecs(_.p,_.Qj(d,g)));h&&f.set(_.t,this.convertCodecs(_.t,_.Qj(d,h)));return f}catch(d){return c}}convertCodecs(a,b){return b.toLowerCase().split(";")[0]===_.Ic?Mc:"mp2t"===b.toLowerCase().split(";")[0].split("/")[1]?Ur(a,b):b}getOriginalMimeType(){return this.h}transmux(a){const b=[],c=[];let d=[],e=null;a=_.I(a);const f=h=>{d=h.captions;const k=new Uint8Array(h.data.byteLength+
477
+ h.initSegment.byteLength);k.set(h.initSegment,0);k.set(h.data,h.initSegment.byteLength);h.type===tu?b.push(k):h.type===uu&&c.push(k)},g=()=>{e={video:_.Hi(...b),captions:d,audio:_.Hi(...c)}};this.a.on("data",f);this.a.on("done",g);this.a.push(a);this.a.flush();this.a.off("data",f);this.a.off("done",g);if(!e)throw new _.G(_.E,3,3018);return e}};Lj(_.Ic,()=>new vu(_.Ic));Lj(_.mg,()=>new vu(_.mg));var uu=_.p,tu=_.t;var wu;_.xu=class{constructor(){this.a=new Blob([wu],{type:_.qg})}canPlay(a){var b=document.createElement(_.t);b.setAttribute("playsinline","playsinline");a&&(b.muted=!0,b.setAttribute("muted","muted"));b.src=URL.createObjectURL(this.a);const c=new _.ln;b=b.play();const d=(new _.Wj(()=>{d.stop();c.resolve(a)})).fa(.25);void 0!==b?b.then(()=>{d.stop();c.resolve(!0)}).catch(e=>{e&&e.message&&e.message===tb?(d.stop(),c.resolve(!0)):(d.stop(),c.resolve(!1))}):(d.stop(),c.resolve(!0));return c}};
478
+ wu=new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,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,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,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,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
488
479
  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,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,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,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,0,0,0,55,167,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,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,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,0,0,0,0,0,0,0,0,0,0,0,112,33,16,5,32,164,27,255,192,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,0,0,
489
480
  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,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,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,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,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,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,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,128,0,0,0,0,0,0,
490
481
  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,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,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,0,0,0,0,0,112,0,0,2,194,109,111,111,118,0,0,0,108,109,118,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,232,0,0,0,47,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,0,0,0,3,0,0,1,236,116,114,97,107,0,0,0,92,116,107,104,100,0,0,0,3,0,0,0,0,0,0,
491
482
  0,0,0,0,0,2,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,1,1,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,36,101,100,116,115,0,0,0,28,101,108,115,116,0,0,0,0,0,0,0,1,0,0,0,47,0,0,0,0,0,1,0,0,0,0,1,100,109,100,105,97,0,0,0,32,109,100,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,68,0,0,8,0,85,196,0,0,0,0,0,45,104,100,108,114,0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0,0,0,1,15,109,105,110,102,0,0,
492
483
  0,16,115,109,104,100,0,0,0,0,0,0,0,0,0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1,0,0,0,211,115,116,98,108,0,0,0,103,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,87,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,51,101,115,100,115,0,0,0,0,3,128,128,128,34,0,2,0,4,128,128,128,20,64,21,0,0,0,0,1,244,0,0,1,243,249,5,128,128,128,2,18,16,6,128,128,128,1,2,0,0,0,24,115,116,116,115,0,0,0,0,0,0,0,1,0,0,0,2,0,0,4,0,0,0,0,28,115,
493
- 116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49]);_.ru=class{constructor(a,b,c,d){this.id=a;this.f=b;this.a=c;this.h=d}getDuration(){return this.a}getId(){return this.id}rb(){return this.f}Zc(){return this.h}zc(a){return this.getId()===a.getId()&&this.rb()===a.rb()&&this.getDuration()===a.getDuration()&&this.Zc()===a.Zc()}};_.z("clpp.media.TimelineWindow",_.ru);_.ru.prototype.isDynamic=_.ru.prototype.Zc;_.ru.prototype.getStart=_.ru.prototype.rb;_.ru.prototype.getId=_.ru.prototype.getId;_.ru.prototype.getDuration=_.ru.prototype.getDuration;_.su=new _.R("clpp.media.TimestampParser");_.tu=class{constructor(){this.a=[];this.f=-1;this.h=null}Gg(a){return this.a[a]||null}Hg(){return this.a.length}Ig(){return this.a}jf(){return this.a[this.f]||null}Bg(){return this.f}};_.z("clpp.media.Timeline",_.tu);_.tu.prototype.getCurrentWindowIndex=_.tu.prototype.Bg;_.tu.prototype.getCurrentWindow=_.tu.prototype.jf;_.tu.prototype.getWindows=_.tu.prototype.Ig;_.tu.prototype.getWindowCount=_.tu.prototype.Hg;_.tu.prototype.getWindow=_.tu.prototype.Gg;_.zr={};_.Br={};var $r=class{constructor(a){this.a=new Uint8Array(a||65536);this.f=0;this.h=new ur}};var Fr=window.XMLHttpRequest;var Zr=class{constructor(a,b){a=void 0===a?1E6:a;b=void 0===b?!0:b;this.j=new nu(a);this.length=a;this.A=b;this.f=this.a=this.h=0;this.l=null;this.o=-1;this.w=new ur}};var Ys=class extends _.lo{constructor(a){super(new _.dn,()=>Promise.resolve());this.B=a;this.h=null;this.w=this.R;this.f=-1;this.j=this.l=this.o=null;Pr(this)}then(a,b){this.R=this.R.then(a,b);return this}catch(a){this.R=this.R.catch(a);return this}abort(){if(this.a)return Promise.resolve();this.a=!0;return this.h.then(a=>{this.o&&clearTimeout(this.o);this.l&&this.l();return a.abort()}).catch(()=>{})}};_.vu=class{constructor(a){this.a=!1;this.h=a;this.j=Tr(this);this.h.tc(this.j);this.f=null}enabled(){return this.a}kf(){return this.a&&this.f&&this.f.has(uu)?1E3*this.f.get(uu):null}release(){this.f=null;this.a=!1;this.h.gd(this.j)}};_.vu.prototype.getEstimatedThroughput=_.vu.prototype.kf;var uu="etp",Rr={Hh:uu},Sr=new _.R("clpp.net.CmsdManager");var Yr=window.fetch,Vr=window.AbortController,Ur=window.Headers;_.fs={};_.xu=class{constructor(a){a=a.getConfiguration();a=_.Qg(a.textStyle||a.textstyle||{});this.K=typeof a.backgroundColor===_.Qf?a.backgroundColor:null;this.S=typeof a.windowColor===_.Qf?a.windowColor:null;this.N=typeof a.fontColor===_.Qf?a.fontColor:null;this.O=typeof a.fontFamily===_.Qf?a.fontFamily:null;this.I=typeof a.fontSize===_.Qf?a.fontSize:null;this.C=typeof a.fontSizePercent===_.t?a.fontSizePercent:null;this.H=typeof a.edgeColor===_.Qf?a.edgeColor:"rgba(0, 0, 0, 1)";this.w=null;typeof a.edgeType===
494
- _.Qf&&(this.w=a.edgeType)}getBackgroundColor(){return this.K}setBackgroundColor(a){this.K=a;this.h()}getWindowColor(){return this.S}setWindowColor(a){this.S=a;this.h()}getFontFamily(){return this.O}setFontFamily(a){this.O=a;this.h()}getFontColor(){return this.N}setFontColor(a){this.N=a;this.h()}getFontSize(){return this.I}setFontSize(a){this.I=a;this.h()}getFontSizePercent(){return null===this.C?wu:this.C}setFontSizePercent(a){this.C=a;this.h()}getEdgeColor(){return this.H}setEdgeColor(a){this.H=
495
- a;this.h()}getEdgeType(){return this.w}setEdgeType(a){this.w=a;this.h()}};_.xu.prototype.setEdgeType=_.xu.prototype.setEdgeType;_.xu.prototype.getEdgeType=_.xu.prototype.getEdgeType;_.xu.prototype.setEdgeColor=_.xu.prototype.setEdgeColor;_.xu.prototype.getEdgeColor=_.xu.prototype.getEdgeColor;_.xu.prototype.setFontSizePercent=_.xu.prototype.setFontSizePercent;_.xu.prototype.getFontSizePercent=_.xu.prototype.getFontSizePercent;_.xu.prototype.setFontSize=_.xu.prototype.setFontSize;
496
- _.xu.prototype.getFontSize=_.xu.prototype.getFontSize;_.xu.prototype.setFontColor=_.xu.prototype.setFontColor;_.xu.prototype.getFontColor=_.xu.prototype.getFontColor;_.xu.prototype.setFontFamily=_.xu.prototype.setFontFamily;_.xu.prototype.getFontFamily=_.xu.prototype.getFontFamily;_.xu.prototype.setWindowColor=_.xu.prototype.setWindowColor;_.xu.prototype.getWindowColor=_.xu.prototype.getWindowColor;_.xu.prototype.setBackgroundColor=_.xu.prototype.setBackgroundColor;
497
- _.xu.prototype.getBackgroundColor=_.xu.prototype.getBackgroundColor;var wu=1/15;var js="raised",ks="depressed",ms="dropshadow",ls="uniform";_.z("clpp.text.EdgeType",{NONE:_.Ee,RAISED:js,DEPRESSED:ks,DROP_SHADOW:ms,UNIFORM:ls});_.gs(Ac,class{constructor(a){this.f=a;this.a=null;this.g=new _.R("clpp.text.Mp4TextParser")}parseInit(a){let b;try{const c=_.hs(_.Bc);c?(b=new c(this.f),b.parseInit(a)):this.g.warn("The clpp.ttml.Mp4TtmlParser class is not available. Please register the ttml component first.")}catch(c){b=null}if(b)this.a=b;else{try{const c=_.hs(_.Cc);c?(b=new c(this.f),b.parseInit(a)):this.g.warn("The clpp.vtt.Mp4VttParser class is not available. Please register the vtt component first.")}catch(c){b=null}if(b)this.a=
498
- b;else throw new _.H(_.F,2,2011);}}parseMedia(a,b){if(!this.a)throw new _.H(_.F,2,2011);return this.a.parseMedia(a,b)}});var yu;
499
- _.zu=class extends _.xu{constructor(a){super(a);this.o=a.getSurface().getMedia();this.f=`clpp-video-${yu++}`;this.j=document.createElement(_.Sf);this.l=this.A=!1;_.vo(this.o,this.f);document.head.appendChild(this.j);this.h()}append(){}remove(){return!0}isTextVisible(){return this.A}setTextVisibility(a){this.A=a}h(){if(!this.l){var a={"background-color":this.getBackgroundColor(),color:this.getFontColor(),"font-family":this.getFontFamily(),"font-size":this.getFontSize(),"text-shadow":_.ns(this)},b=
500
- Object.keys(a).map(c=>null!==a[c]?`${c}:${a[c]};`:"").join("");this.j.textContent=`.${this.f}::cue {${b}}`}}destroy(){this.o.classList.remove(this.f);document.head.removeChild(this.j);this.l=!0;return Promise.resolve()}};yu=0;_.Dn("native",new class{isSupported(){return!0}create(a){return new _.zu(a)}});_.Au=class{onContentWillLoad(){return Promise.resolve()}onContentLoaded(){return Promise.resolve()}onPlayerWillDestroy(){}onPlayerWillRelease(){}};};f.call(g,window);g.clpp._ = _;delete window.clpp; export let clpp = g.clpp; export default clpp;
484
+ 116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49]);_.yu=class{constructor(a,b,c){this.h=a;this.j=b;this.f=c||this.h.getMedia();this.a=null}start(){this.a=new ResizeObserver(a=>{a=a[0];this.j(a.contentRect.width,a.contentRect.height,this.h.isFullscreen())});this.f&&this.a.observe(this.f)}stop(){this.a&&(this.a.disconnect(),this.a=null)}};_.Au=class{constructor(a){a=a.getConfiguration();a=_.Rg(a.textStyle||a.textstyle||{});this.K=typeof a.backgroundColor===_.Pf?a.backgroundColor:null;this.R=typeof a.windowColor===_.Pf?a.windowColor:null;this.M=typeof a.fontColor===_.Pf?a.fontColor:null;this.O=typeof a.fontFamily===_.Pf?a.fontFamily:null;this.I=typeof a.fontSize===_.Pf?a.fontSize:null;this.C=typeof a.fontSizePercent===_.r?a.fontSizePercent:null;this.H=typeof a.edgeColor===_.Pf?a.edgeColor:"rgba(0, 0, 0, 1)";this.w=null;typeof a.edgeType===
485
+ _.Pf&&(this.w=a.edgeType)}getBackgroundColor(){return this.K}setBackgroundColor(a){this.K=a;this.h()}getWindowColor(){return this.R}setWindowColor(a){this.R=a;this.h()}getFontFamily(){return this.O}setFontFamily(a){this.O=a;this.h()}getFontColor(){return this.M}setFontColor(a){this.M=a;this.h()}getFontSize(){return this.I}setFontSize(a){this.I=a;this.h()}getFontSizePercent(){return null===this.C?zu:this.C}setFontSizePercent(a){this.C=a;this.h()}getEdgeColor(){return this.H}setEdgeColor(a){this.H=
486
+ a;this.h()}getEdgeType(){return this.w}setEdgeType(a){this.w=a;this.h()}};_.Au.prototype.setEdgeType=_.Au.prototype.setEdgeType;_.Au.prototype.getEdgeType=_.Au.prototype.getEdgeType;_.Au.prototype.setEdgeColor=_.Au.prototype.setEdgeColor;_.Au.prototype.getEdgeColor=_.Au.prototype.getEdgeColor;_.Au.prototype.setFontSizePercent=_.Au.prototype.setFontSizePercent;_.Au.prototype.getFontSizePercent=_.Au.prototype.getFontSizePercent;_.Au.prototype.setFontSize=_.Au.prototype.setFontSize;
487
+ _.Au.prototype.getFontSize=_.Au.prototype.getFontSize;_.Au.prototype.setFontColor=_.Au.prototype.setFontColor;_.Au.prototype.getFontColor=_.Au.prototype.getFontColor;_.Au.prototype.setFontFamily=_.Au.prototype.setFontFamily;_.Au.prototype.getFontFamily=_.Au.prototype.getFontFamily;_.Au.prototype.setWindowColor=_.Au.prototype.setWindowColor;_.Au.prototype.getWindowColor=_.Au.prototype.getWindowColor;_.Au.prototype.setBackgroundColor=_.Au.prototype.setBackgroundColor;
488
+ _.Au.prototype.getBackgroundColor=_.Au.prototype.getBackgroundColor;var zu=1/15;var Bu;
489
+ _.Cu=class extends _.Au{constructor(a){super(a);this.o=a.getSurface().getMedia();this.f=`clpp-video-${Bu++}`;this.j=document.createElement(_.Rf);this.l=this.A=!1;_.Ep(this.o,this.f);document.head.appendChild(this.j);this.h()}append(){}remove(){return!0}isTextVisible(){return this.A}setTextVisibility(a){this.A=a}h(){if(!this.l){var a={"background-color":this.getBackgroundColor(),color:this.getFontColor(),"font-family":this.getFontFamily(),"font-size":this.getFontSize(),"text-shadow":_.$r(this)},b=
490
+ Object.keys(a).map(c=>null!==a[c]?`${c}:${a[c]};`:"").join("");this.j.textContent=`.${this.f}::cue {${b}}`}}destroy(){this.o.classList.remove(this.f);document.head.removeChild(this.j);this.l=!0;return Promise.resolve()}};Bu=0;var Wr="raised",Xr="depressed",Zr="dropshadow",Yr="uniform";_.x("clpp.text.EdgeType",{NONE:_.Ee,RAISED:Wr,DEPRESSED:Xr,DROP_SHADOW:Zr,UNIFORM:Yr});_.as={};_.Kn("native",new class{a(){return!0}create(a){return new _.Cu(a)}});_.bs(Cc,class{constructor(a){this.f=a;this.a=null;this.g=new _.R("clpp.text.Mp4TextParser")}parseInit(a){let b;try{const c=_.cs(_.Dc);c?(b=new c(this.f),b.parseInit(a)):this.g.warn("The clpp.ttml.Mp4TtmlParser class is not available. Please register the ttml component first.")}catch(c){b=null}if(b)this.a=b;else{try{const c=_.cs(_.Ec);c?(b=new c(this.f),b.parseInit(a)):this.g.warn("The clpp.vtt.Mp4VttParser class is not available. Please register the vtt component first.")}catch(c){b=null}if(b)this.a=
491
+ b;else throw new _.G(_.E,2,2011);}}parseMedia(a,b){if(!this.a)throw new _.G(_.E,2,2011);return this.a.parseMedia(a,b)}});var Du=class extends _.rt{constructor(a){super();this.za=_.Qg({transition:_.Pe,preloadMedia:!1},a);this.h=[];this.a=0;const b=es(a.anchorId,this.za.config);this.o=new Xt(b);this.f=null;this.j=!1;this.l=new Map;this.w=a.toggleVisible;this.g=new _.R(pd);this.o.a.forEach(c=>fs(this,c.player,!1))}Tc(){return this.f}vd(){return this.f?this.f.player:null}kf(){return this.l.get(this.a+1)||null}mf(){return this.l.get(this.a-1)||null}lf(){return[this.mf(),this.kf()].filter(Boolean)}th(a){if(0<this.h.length)throw Error("Cannot re-set items in the playlist");
492
+ this.g.info("Set items",a);this.h=a.map((b,c)=>({config:b,index:c,preloadPromise:Promise.resolve(),disposers:[]}))}sh(a){if(0===this.h.length)throw Error(mb);if(0>a||a>this.h.length-1)throw Error("Index out of bounds");this.a=a}Wc(){return this.a<this.h.length-1}qf(){return 0<this.a}eh(){const a=this;return _.w(function*(){if(a.j)a.g.warn("Cannot play first item while busy");else if(0===a.h.length)a.g.warn(mb);else{a.j=!0;a.g.info(`First (index: ${a.a})`);var b=a.h[a.a];try{a.g.info(`First loading (index: ${a.a})`),
493
+ yield is(a,b),a.g.info(`First playing (index: ${a.a})`)}catch(c){throw a.g.error(`First failed (index: ${a.a})`),c;}finally{a.j=!1,ms(a)}}})}Ff(){const a=this;return _.w(function*(){if(a.j)a.g.warn("Cannot play next item while busy");else if(a.Wc()){a.j=!0;a.a+=1;a.g.info(`Next (index: ${a.a})`);var b=a.f;a.za.transition===_.Pe&&b.player.pause();rs(a,a.a+-2);a.l.delete(a.a);var c=a.h[a.a];try{a.g.info(`Next loading (index: ${a.a})`),yield ns(a,c),a.g.info(`Next playing (index: ${a.a})`)}catch(d){throw a.g.error(`Next failed (index: ${a.a})`),
494
+ d;}finally{a.j=!1,b&&qs(a,b),ms(a)}}else a.g.warn("There are no more items in the playlist")})}fh(){const a=this;return _.w(function*(){if(a.j)a.g.warn("Cannot play previous item while busy");else if(a.qf()){a.j=!0;--a.a;a.g.info(`Previous (index: ${a.a})`);var b=a.f;a.za.transition===_.Pe&&b.player.pause();rs(a,a.a+2);a.l.delete(a.a);var c=a.h[a.a];try{a.g.info(`Previous loading (index: ${a.a})`),yield ns(a,c),a.g.info(`Previous playing (index: ${a.a})`)}catch(d){throw a.g.error(`Previous failed (index: ${a.a})`),
495
+ d;}finally{a.j=!1,b&&qs(a,b),ms(a)}}else a.g.warn("There are no more previous items in the playlist")})}destroy(){const a=this;return _.w(function*(){a.g.info("Destroy");yield Promise.all([ss(a),a.f?qs(a,a.f):Promise.resolve()]);yield ts(a)})}};_.x(pd,Du);Du.prototype.destroy=Du.prototype.destroy;Du.prototype.playPrev=Du.prototype.fh;Du.prototype.playNext=Du.prototype.Ff;Du.prototype.playFirst=Du.prototype.eh;Du.prototype.hasPrev=Du.prototype.qf;Du.prototype.hasNext=Du.prototype.Wc;
496
+ Du.prototype.setIndex=Du.prototype.sh;Du.prototype.setItems=Du.prototype.th;Du.prototype.getPreloading=Du.prototype.lf;Du.prototype.getPrev=Du.prototype.mf;Du.prototype.getNext=Du.prototype.kf;Du.prototype.getCurrentPlayer=Du.prototype.vd;Du.prototype.getCurrent=Du.prototype.Tc;var ps="preload",gs=_.ue;var Eu=class extends Q{constructor(a,b,c){super(a,b,c);a={manifest:{timeline:{version:2},keepTimelineLive:!0},streaming:{preferNativeHlsOnSafari:!1,enableLiveEdgeChasing:!1,startAtSegmentBoundary:!1}};this.C=_.Qg(this.C,a);this.f=_.Qg(this.f,a);this.G=0;this.o=[];this.S=!1;this.w=null;this.I=[]}open(a,b){const c=this;return _.w(function*(){if(c.w)throw new _.G(_.E,7,7008,`Cannot call open() while ${c.w}() is ongoing!`);if(0!==a)throw new _.G(_.E,7,7007,"The index parameter only supports the value of 0.");
497
+ if(0===b.length)throw new _.G(_.E,7,7003,nb);if(b.some(g=>!g.id||!g.source))throw new _.G(_.E,7,7100,"Some config is missing required properties `id` or `source`!");if((new Set(b.map(g=>g.id))).size!==b.length)throw new _.G(_.E,7,7100,"Some config contains a non-unique property `id`!");const d=b[0].playlist;if(d){var e=d.timeline,f=["flat","basic"];if(e&&!f.includes(e))throw new _.G(_.E,7,7100,"Unsupported `playlist.timeline` config value!");e=d.startTime;if(null!=e&&(typeof e!==_.r||0>e))throw new _.G(_.E,
498
+ 7,7100,"Invalid `playlist.startTime` config value!");f=d.endTime;if(null!=f&&(typeof f!==_.r||0>f||null!=e&&f<=e))throw new _.G(_.E,7,7100,"Invalid `playlist.endTime` config value!");if("DVR"===d.content&&!f)throw new _.G(_.E,7,7100,"`playlist.endTime` config value is required for DVR content!");}try{us(c),c.w="open",yield xs(c,b),c.G=0,c.o=b,c.S=!0,ys(c,b[0].playlist||{})}finally{c.w=null}})}dg(a){const b=this;return _.w(function*(){if(b.w)throw new _.G(_.E,7,7008,`Cannot call addItem() while ${b.w}() is ongoing!`);
499
+ if(!b.S)throw new _.G(_.E,7,7008,"open() must be called before addItem()!");if(!a.id||!a.source)throw new _.G(_.E,7,7100,"The config is missing required properties `id` or `source`!");if((new Set(b.o.map(c=>c.id))).has(a.id))throw new _.G(_.E,7,7100,"A config with this `id` already exists in the playlist!");try{b.w="addItem",b.o.push(a),yield zs(b,a)}finally{b.w=null}})}getCurrentItem(){return this.o[this.G]||null}getCurrentItemIndex(){return this.G}Gg(){return[...this.o]}Uc(){return this.o.length}getTimeline(){return this.a?
500
+ this.a.getTimeline():null}seekWith(a){return this.a?this.a.seekWith(a):Promise.resolve()}release(){this.o=[];this.G=0;this.S=!1;return super.release()}destroy(){us(this);return super.destroy()}setCdnErrorCallback(){throw new _.G(1,7,7009,"CDN switching is not supported!");}};_.x("clpp.plist.ScPlaylist",Eu);Eu.prototype.setCdnErrorCallback=Eu.prototype.setCdnErrorCallback;Eu.prototype.destroy=Eu.prototype.destroy;Eu.prototype.release=Eu.prototype.release;Eu.prototype.seekWith=Eu.prototype.seekWith;
501
+ Eu.prototype.getTimeline=Eu.prototype.getTimeline;Eu.prototype.getSize=Eu.prototype.Uc;Eu.prototype.getPlaylist=Eu.prototype.Gg;Eu.prototype.getCurrentItemIndex=Eu.prototype.getCurrentItemIndex;Eu.prototype.getCurrentItem=Eu.prototype.getCurrentItem;Eu.prototype.addItem=Eu.prototype.dg;Eu.prototype.open=Eu.prototype.open;_.Fu=class{onContentWillLoad(){return Promise.resolve()}onContentLoaded(){return Promise.resolve()}onPlayerWillDestroy(){}onPlayerWillRelease(){}};};f.call(g,window);g.clpp._ = _;delete window.clpp; export let clpp = g.clpp; export default clpp;