@castlabs/prestoplay 6.31.1 → 6.32.0-beta.2

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 (68) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +2 -2
  3. package/cjs/cl.adobe.js +3 -3
  4. package/cjs/cl.airplay.js +3 -3
  5. package/cjs/cl.broadpeak.js +18 -18
  6. package/cjs/cl.cast.js +127 -125
  7. package/cjs/cl.cdn.js +13 -0
  8. package/cjs/cl.conviva.js +32 -32
  9. package/cjs/cl.core.js +615 -610
  10. package/cjs/cl.crypto.js +9 -9
  11. package/cjs/cl.dash.js +101 -95
  12. package/cjs/cl.externs.js +113 -44
  13. package/cjs/cl.freewheel.js +26 -26
  14. package/cjs/cl.hls.js +78 -78
  15. package/cjs/cl.hlssmpte.js +6 -6
  16. package/cjs/cl.htmlcue.js +30 -30
  17. package/cjs/cl.ima.js +26 -26
  18. package/cjs/cl.mediatailor.js +3 -3
  19. package/cjs/cl.mse.js +351 -350
  20. package/cjs/cl.muxdata.js +14 -14
  21. package/cjs/cl.onboard.js +4 -4
  22. package/cjs/cl.persistent.js +14 -14
  23. package/cjs/cl.playlist.js +6 -6
  24. package/cjs/cl.simid.js +16 -16
  25. package/cjs/cl.smooth.js +71 -71
  26. package/cjs/cl.thumbnails.js +26 -26
  27. package/cjs/cl.tizen.js +71 -71
  28. package/cjs/cl.ttml.js +29 -29
  29. package/cjs/cl.verimatrix.js +5 -5
  30. package/cjs/cl.vimond.js +11 -11
  31. package/cjs/cl.vr.js +19 -19
  32. package/cjs/cl.vtt.js +14 -14
  33. package/cjs/cl.yospace.js +4 -4
  34. package/cjs/cl.youbora.js +40 -40
  35. package/cl.adobe.js +3 -3
  36. package/cl.airplay.js +3 -3
  37. package/cl.broadpeak.js +14 -14
  38. package/cl.cast.js +102 -101
  39. package/cl.cdn.js +7 -0
  40. package/cl.conviva.js +27 -27
  41. package/cl.core.js +498 -495
  42. package/cl.crypto.js +9 -9
  43. package/cl.dash.js +91 -87
  44. package/cl.externs.js +109 -44
  45. package/cl.freewheel.js +20 -20
  46. package/cl.hls.js +82 -82
  47. package/cl.hlssmpte.js +5 -5
  48. package/cl.htmlcue.js +26 -26
  49. package/cl.ima.js +20 -20
  50. package/cl.mediatailor.js +2 -2
  51. package/cl.mse.js +301 -300
  52. package/cl.muxdata.js +13 -13
  53. package/cl.onboard.js +4 -4
  54. package/cl.persistent.js +10 -10
  55. package/cl.playlist.js +5 -5
  56. package/cl.simid.js +14 -14
  57. package/cl.smooth.js +61 -61
  58. package/cl.thumbnails.js +19 -19
  59. package/cl.tizen.js +56 -56
  60. package/cl.ttml.js +22 -22
  61. package/cl.verimatrix.js +4 -4
  62. package/cl.vimond.js +8 -8
  63. package/cl.vr.js +14 -14
  64. package/cl.vtt.js +12 -12
  65. package/cl.yospace.js +3 -3
  66. package/cl.youbora.js +31 -31
  67. package/package.json +7 -1
  68. package/typings.d.ts +328 -114
package/cl.core.js CHANGED
@@ -1,355 +1,358 @@
1
- let g={}; let _ = {};let f=function(window){'use strict';var ba,ca,la,oa,sa,ta,va,wa,ya,za,Aa,Ba,Fa,Ga,Ha,Ia,Ja,La,Ma,Ra,Ta,Ua,Va,Wa,Xa,Za,ab,bb,gb,kb,qb,rb,ub,xb,Ab,Bb,Cb,Fb,Gb,Jb,Kb,Nb,Sb,Zb,$b,ac,Dc,Ic,Qc,Rc,Yc,Zc,$c,bd,cd,fd,gd,id,jd,kd,ld,md,nd,od,td,vd,Ad,Gd,Hd,Id,Jd,Ld,Md,Nd,Rd,Sd,Ud,$d,ie,ke,le,se,Oe,Ve,Xe,Ye,Ze,$e,af,bf,cf,df,ef,ff,kf,mf,nf,of,pf,qf,sf,wf,yf,Of,Rf,Xf,jg,mg,vg,Hg,Ig,Jg,Kg,Lg,Ng,Og,Pg,Vg,Wg,Zg,$g,eh,bh,mh,nh,ph,sh,uh,Ch,Ih,Nh,Oh,Ph,Qh,Rh,Sh,Th,Uh,Vh,Yh,Wh,$h,bi,ai,di,fi,ei,gi,hi,ii,li,mi,pi,Fi,Gi,Hi,Ii,Mi,Ri,Qi,bj,Ui,
2
- Ti,mj,nj,oj,sj,tj,uj,vj,Jj,Ej,Lj,Mj,Nj,Pj,Qj,Oj,Tj,Uj,Vj,Sj,wj,xj,Aj,Bj,Cj,Dj,Fj,Gj,Hj,Ij,ck,dk,Kj,Rj,ek,Zj,Yj,bk,Wj,hk,kk,lk,mk,nk,pk,ok,sk,tk,wk,xk,yk,Ak,Bk,Ck,Dk,Fk,Gk,Ik,Jk,Kk,Nk,Ok,Lk,Wk,Xk,Yk,Vk,gl,Mk,Zk,$k,al,bl,dl,el,fl,il,Qk,hl,Rk,Pk,Sk,jl,kl,ol,ql,ll,rl,Tk,Uk,ul,wl,Al,Bl,zl,Dl,yl,xl,Hl,Il,Jl,Ll,Ml,Nl,Ol,Pl,Rl,Sl,Ql,Tl,Vl,Ul,Yl,gm,El,jm,im,hm,sl,Cl,lm,km,nm,om,sm,Am,Im,Km,Lm,Om,Sm,Xm,$m,bn,cn,dn,gn,nn,pn,qn,rn,sn,tn,un,vn,wn,xn,yn,zn,En,Ln,In,Nn,Sn,Un,Wn,Yn,Zn,$n,ao,co,mo,eo,fo,ho,oo,ko,
3
- Rn,ro,so,qo,po,uo,vo,zo,to,Ao,yo,Bo,Co,wo,xo,Do,Io,Jo,Eo,Ho,Go,Fo,Ko,Lo,Mo,Yo,$o,fp,jp,lp,sp,Cp,op,xp,Ip,Jp,Kp,Mp,Np,Op,Rp,Pp,Qp,Sp,Tp,Up,Xp,dq,eq,iq,lq,mq,oq,qq,rq,tq,jq,pq,uq,vq,wq,xq,Gq,zq,Hq,yq,Aq,Bq,Iq,Nq,Pq,Rq,Qq,Tq,Lq,ar,Yq,$q,Zq,Oq,br,cr,dr,er,fr,gr,hr,ir,or,rr,tr,ur,yr,Ar,vr,xr,zr,Br,Cr,Dr,Fr,Gr,Mr,Nr,Or,Qr,Rr,Sr,Tr,Ur,Vr,Xr,Wr,Yr,Zr,$r,as,bs,Pr,cs,es,ks,ls,ms,rs,ss,ts,us,ps,os,Cs,Es,Fs,Gs,ys,Is,Js,Ks,Ls,Os,Ps,Qs,Ms,Ns,Rs,Ss,Vs,Zs,$s,ct,et,ft,dt,at,Us,Ys,Ws,Xs,it,jt,kt,lt,mt,nt,ot,pt,rt,
4
- Ct,Gt,Xg,Yg;_.aa=" is registered.";ba=" is unsupported on this platform.";ca=" to a log level. Falling back to default!";_.da="#text";_.ea="6.31.1";_.fa="AdaptationSet";_.ha="Already destroyed. No-op";_.ia="Already released. No-op";_.ja="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="Content-Length";
5
- ta="Content-Type";_.ua="Could not find configured DRM environment.";va="DRM licenses loaded";wa="DRMtoday";ya="DRMtodayOnboard";za="Destroying player";Aa="Error while decoding string!";Ba="Error while fetching certificate!";_.Ca="FairPlay Certificate URL is not defined";_.Da="FairPlay License URL is not defined";_.Ea="GROUP-ID";Fa="HW_SECURE_ALL";Ga="HW_SECURE_CRYPTO";Ha="HW_SECURE_DECODE";Ia="HeaderDrm";Ja="InvalidStateError";_.Ka="LANGUAGE";La="License verification failed: ";Ma="Load interrupted while a player release is pending";
6
- _.Oa="Loading player with configuration";_.Pa="MaxHeight";_.Qa="MaxWidth";Ra="Missing media element";_.Sa="NAME";Ta="No drmtoday configuration found in player configuration. Unable to modify the DRM license request!";Ua="No event provided!";Va="No items in the playlist";Wa="No sources provided!";Xa="No track data attached to the event, unable to add track!";Za="Not a persistent session.";_.$a="Not supported";ab="NotAllowedError";bb="NotSupportedError";_.cb="PLAYLIST";_.eb="POST";_.fb="PlayReady License URL is not defined";
7
- gb="Player not ready yet.";_.hb="Player sources";_.ib="Please make sure ";kb="Preloading is not supported by this player.";_.lb="QualityLevel";_.mb="RESOLUTION";_.nb="Representation";_.ob="SW_SECURE_CRYPTO";_.pb="SW_SECURE_DECODE";qb="Session is closed";rb="Skipping Session creation. License for init data was already requested in ";_.sb="SmoothStreamingMedia";_.tb="TYPE";ub="The index is not in the allowed range.";_.vb="URI";xb="Unable to translate ";_.yb="Unhandled/ignored event";_.zb="Unregistering listeners";
8
- Ab="Unsupported keySystem";Bb="Updating playout limit for interstitial";Cb="Using VTTCue polyfill from 3 argument TextTrackCue.";_.Db="VIDEO";_.Eb="VOD";Fb="Wait for preloading to finish";Gb="WebkitEmeManager.MediaKeySession.load";_.Ib="Widevine License URL is not defined";Jb="Will create EME Manager: ";Kb="X-AD-CREATIVE-SIGNALING";_.Lb="X-ASSET-LIST";_.Mb="X-ASSET-URI";Nb="X-GROUPED-ASSET-LIST";_.Pb="X-PLAYOUT-LIMIT";_.Qb="X-RESTRICT";_.Rb="X-RESUME-OFFSET";Sb="X-TIMELINE-OCCUPIES";_.Tb="ad-break-started";
9
- _.Ub="ad-break-stopped";_.Vb="ad-buffering";_.Wb="ad-clicked";_.Xb="ad-completed";_.Yb="ad-first-quartile";Zb="ad-hls-asset-list-request";$b="ad-hls-asset-list-response";ac="ad-hls-resoled";_.bc="ad-impression";_.cc="ad-loaded";_.dc="ad-midpoint";_.gc="ad-paused";_.ic="ad-progress";_.jc="ad-resumed";_.kc="ad-skipped";_.lc="ad-started";_.mc="ad-stopped";_.nc="ad-third-quartile";_.oc="addtrack";_.pc="ads-timeline-changed";_.qc="airplay-casting-ended";_.rc="airplay-casting-started";_.sc="airplay-status-changed";
10
- _.uc="application/cea-608";_.vc="application/dash+xml";_.yc="application/mp4";_.zc='application/mp4; codecs\x3d"stpp"';_.Ac='application/mp4; codecs\x3d"wvtt"';_.Bc="application/ttml+xml";_.Cc="application/vnd.ms-sstr+xml";Dc="application/x-www-form-urlencoded";_.q="audio";_.Ec="audio/aac";_.Fc="audio/ac3";_.Gc="audio/eac3";_.Hc="audio/mp4";Ic='audio/mp4;codecs\x3d"mp4a.40.2"';_.Jc="audiobufferchanged";_.Kc="audiotrackchanged";_.Lc="autoplaynotallowed";_.Mc="bitratechanged";_.Nc="boolean";_.Oc="bufferingended";
11
- _.Pc="bufferingstarted";Qc="canplay";Rc="canplaythrough";_.Sc="castingstarted";_.Tc="caststatuschanged";_.Uc="castvisibilitychanged";_.Vc="cdn-switch-success";_.Wc="cenc";_.Xc="center";Yc="certificate-request";Zc="change";$c="chrome";_.ad="clpp-fill";bd="clpp-hidden";cd="clpp-mc-playlist";fd="clpp-visible";gd="clpp.PlayerFleet";_.hd="clpp.cast.CastSender";id="clpp.drm.DrmToday";jd="clpp.drm.HeaderDrm";kd="clpp.drm.eme.AppleEmeManager";ld="clpp.drm.eme.EmeFactory";md="clpp.native.Player";nd="clpp.playlist.McPlaylist";
12
- od="clpp.utils.Platform";_.pd="codecs";_.qd="column-reverse";_.rd="com.adobe.primetime";_.sd="com.apple.fps";td="com.apple.quicktime.HLS";_.ud="com.microsoft.playready";vd="com.microsoft.playready.recommendation";_.wd="com.widevine.alpha";_.xd="config.drm.customData is not defined";_.yd="content-steering-change";_.zd="content-steering-location-ban-update";Ad="controls";_.Bd="cuechange";_.Cd="decoder";_.Dd="destroy()";_.Ed="disabled";_.Fd="div";Gd="drm.mediaKeys.end";Hd="drm.mediaKeys.start";Id="drm.onPlay.end";
13
- Jd="drm.onPlay.start";_.Kd="drmexpirationupdate";Ld="drmlicenserequested";Md="drmrenewalstarted";Nd="drmsessioncreated";_.Pd="drmsessionpersisted";_.Qd="drmsessionupdate";Rd="drmtoday";Sd="durationchange";_.Td="ec-3";Ud="encrypted";_.Vd="end";_.Wd="ended";_.Xd="error";_.Yd="estimatedThroughputKbps";_.Zd="forced";$d="fullscreenElement";_.ae="function";_.be="height";_.ce="hidden";_.de="hls-daterange";_.ee="html";_.fe="https://";_.ge="image";_.he="internal-error";ie="keystatuseschange";_.je="left";
14
- ke="license-renewal";le="license-request";_.me="line-left";_.ne="line-right";_.oe="live-turned-static";_.pe="load";_.qe="loadeddata";_.re="loadedmetadata";se="loadstart";_.te="main";_.xe="mdat";_.ye="mdia";_.ze="message";_.Ae="metadata";_.Be="mimeType";_.Ce="minf";_.De="moov";_.Ee="mpd-type-changed";_.Fe="mpeg-dash-callback-event";_.Ge="none";_.r="number";_.He="object";_.Ie="onBitrateChanged()";_.Je="onContentLoaded";_.Ke="onPlayerError()";_.Le="onPlayerWillDestroy";_.Me="onPlayerWillRelease";
15
- _.Ne="onStateChanged()";Oe="online-status-changed";_.Pe="optional";_.Qe="org.w3.clearkey";_.Re="output-restricted";_.Se="pause";_.Te="persistent";_.Ue="persistent-license";Ve="picture-in-picture";_.We="play";Xe="player.afterLoad.end";Ye="player.afterLoad.start";Ze="player.appendLoad.end";$e="player.appendLoad.start";af="player.beforeLoad.end";bf="player.beforeLoad.start";cf="player.load.end";df="player.load.start";ef="player.setupPlaylist.end";ff="player.setupPlaylist.start";_.gf="playing";_.hf="playlist-item-changed";
16
- _.jf="playlist-modified";kf="playlist.next.end";mf="playlist.next.start";nf="preload-aborted";of="preload-failed";pf="preloaded";qf="preloading";_.rf="prevent";sf="primary-content";_.tf="progress";_.uf="px";_.vf="ratechange";wf="released";_.xf="releasing";yf="removetrack";_.zf="required";_.Af="resize";_.Bf="right";_.Cf="sc-playlist-ended";_.Df="sc-playlist-item-changed";_.Ef="sc-playlist-live-turned-static";_.Ff="sc-playlist-timeline-changed";_.Gf="scte35";_.Hf="seeked";_.If="seeking";_.Jf="showing";
17
- _.Kf="simid-creative-started";_.Lf="simid-creative-stopped";_.Mf="sinf";_.Nf="smooth";Of="stalled";_.Pf="start";_.Qf="statechanged";Rf="status-pending";_.Sf="stbl";_.Tf="string";_.Uf="stsd";_.Vf="style";_.Wf="subtitles-htmlcue";Xf="temporary";_.Yf="text";_.Zf="text/vtt";_.$f="text/xml";_.ag="texttrackchanged";_.bg="timeline-cue-added";_.cg="timeline-cue-enter";_.dg="timeline-cue-exit";_.eg="timeline-cues-changed";_.fg="timeupdate";_.gg="tracksadded";_.hg="trak";_.ig="ttml-xml";jg="unauthenticated";
18
- _.kg="und";_.lg="unknown";mg="update";_.qg="urn:scte:scte35";_.rg="urn:scte:scte35:2014";_.sg="user-seeked";_.tg="user-seeking";_.ug="value";vg="version";_.wg="vertical-lr";_.xg="vertical-rl";_.t="video";_.yg="video/mp2t";_.zg="video/mp4";_.Ag="videobufferchanged";_.Bg="videotrackchanged";_.Cg="vimond-response";_.Dg="visibilitychange";_.Eg="vtt-xml";_.Fg="waiting";_.Gg="waitingforkey";Hg="webkit-org.w3.clearkey";Ig="webkitkeyadded";Jg="webkitkeyerror";Kg="webkitkeymessage";Lg="webkitneedkey";
19
- _.Mg="width";Ng="x-dt-csl-tracking-token";Og="x-dt-follow-up-token";Pg="x-dt-resp-code";_.Qg="yospace-session-ended";_.Rg="yospace-session-started";_.Ug=function(a){return function(){return _.Tg[a].apply(this,arguments)}};Vg=function(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}};Wg=function(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:Vg(a)}};
20
- Zg=function(a,b){if(b){var c=Xg;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&&Yg(c,a,{configurable:!0,writable:!0,value:b})}};$g=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 $g(a())};
21
- _.x=function(a,b){a=a.split(".");var c=ah;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};_.dh=function(a){return _.z(a)||bh(a)?a:_.ch(a)};_.ch=function(...a){let b={};for(let c=0;c<a.length;c++)null!=a[c]&&(b=eh(b,{merging:a[c]},1));return b.merging||null};_.fh=function(a){for(const b in a)if(void 0!==a[b])return!0;return!1};
22
- eh=function(a,b,c){const d=c+1;if(_.z(a)||!_.gh(a))a={};for(const e in b)c=b[e],bh(c)||_.z(c)||_.hh(c)||c instanceof Element?a[e]=c:c instanceof Date?a[e]=c:_.gh(c)&&c.buffer&&c.buffer instanceof ArrayBuffer&&_.hh(c.subarray)?a[e]=c.subarray(0):c instanceof Array?a[e]=eh([],c,d):!_.z(c)&&_.ih(c)&&20>d&&(a[e]=eh(a[e],c,d));return a};bh=function(a){a=typeof a;return a===_.Tf||a===_.r||a===_.Nc};_.z=function(a){return null===a||"undefined"===typeof a};_.gh=function(a){return typeof a===_.He};
23
- _.hh=function(a){return typeof a===_.ae};_.jh=function(a){return typeof a===_.Tf};_.kh=function(a){return typeof a===_.r};_.ih=function(a){if(_.z(a)||!_.gh(a))return!1;a=Object.getPrototypeOf(a);return a===Object.prototype||null===a};
24
- _.lh=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||!_.gh(a)||!_.gh(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};
25
- mh=function(a){return(Number.hasOwnProperty("isNaN")?Number.isNaN:b=>b!==b)(a)};nh=function(a){const b=new Map;for(const c of Object.keys(a))b.set(c,a[c]);return b};_.oh=function(a){const b={};a.forEach((c,d)=>{b[d]=c});return b};ph=function(a,b){b=b.toLowerCase();for(const [c,d]of Object.entries(a))if(c.toLowerCase()===b)return d;return null};sh=function(a){return a&&0<=qh[a]?qh[a]:rh};
26
- uh=function(a){if(!a)return _.C("clpp.log",xb+a+ca),-1;const b=th[a.toUpperCase()];return void 0===b?(_.C("clpp.log",xb+a+ca),-1):b};_.wh=function(a){vh.info.apply(vh,arguments)};_.xh=function(a){vh.debug.apply(vh,arguments)};_.C=function(a){vh.warn.apply(vh,arguments)};_.yh=function(a){vh.error.apply(vh,arguments)};_.Bh=function(a){if(a){var b=a.a();b in _.zh?_.Ah.warn("Player-Factory '"+b+"' already registered"):(_.zh[b]=a,_.Ah.info("Registered Player-Factory: '"+b+"'"))}};
27
- Ch=function(a){return Object.values(_.zh).find(a)||null};_.Fh=function(a){0<=Dh.indexOf(a)?Eh.warn(`Factory '${a.name()}' is already registered`):(Dh.push(a),Eh.info(`Factory '${a.name()}' has been registered.`))};Ih=function(a,b){const c=Dh.find(d=>d.a(a,b))||null;c&&Eh.info(`Chosen ads manager: ${c.name()}`);return c};_.Kh=function(a){return _.Jh.get(a)||null};_.Mh=function(a){_.Jh.get(a.id())?Lh.warn("Component already in use."):_.Jh.set(a.id(),a)};
28
- Nh=function(a){return Array.from(_.Jh.values()).find(b=>b instanceof a)||null};Oh=function(a){for(const b of _.Jh.values())a(b)};Ph=function(a){Oh(b=>{b.playerConstructed(a)})};Qh=function(a){Oh(b=>{b.beforeLoad(a)})};Rh=function(a){Oh(b=>{b.afterLoad(a)})};Sh=function(a){Oh(b=>{b.playerDestroyed(a)})};Th=function(a){if(null!==Nh(a))return null;a=new a;a.install();_.Mh(a);Lh.info("Installed component:",a.id());return a};
29
- Uh=function(a){if(a=Nh(a))a.uninstall(),_.Jh.delete(a.id()),Lh.info("Uninstalled component:",a.id())};Vh=function(a,b,c,d){a=`${a===_.D?"FATAL":"RECOVERABLE"} Clpp-Error [Category ${b} - Code ${c}]`;if(_.jh(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};_.Xh=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)Wh(b[c]);a.a.clear()};
30
- Yh=function(a,b,c){var d=[Ud,"msneedkey",Lg,"needkey"];const e=f=>{for(const g of d)a.off(b,g,e);c(f)};for(const f of d)a.on(b,f,e)};Wh=function(a){a.target.removeEventListener(a.type,a.a,a.f);a.target=null;a.a=null};_.Zh=function(a){return Array.isArray(a)?a:[a]};$h=function(a,b){return a===b?!0:a.length===b.length&&a.every((c,d)=>c===b[d])};bi=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 ai(a,b)&&ai(b,a)};
31
- ai=function(a,b){const c=new Set(a);return b.every(d=>c.has(d))};_.ci=function(a,b={}){if(b.bg){const c=[];for(const d of a)c.some(e=>b.bg(d,e))||c.push(d);return c}return Array.from((new Set(a)).values())};di=function(a,b){const c=new Set(a),d=new Set(b);return{Ii:a.filter(e=>!d.has(e)),Gj:a.filter(e=>d.has(e)),rh:b.filter(e=>!c.has(e))}};
32
- 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=_.G(a);b=_.G(b);for(let d=0;d<a.byteLength;d++)if(c[d]!==b[d])return!1;return!0};ei=function(a){return a instanceof ArrayBuffer?a:a.buffer};_.G=function(a,b=0,c=Infinity){return gi(a,b,c,Uint8Array)};
33
- 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)};
34
- 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};
35
- _.ni=function(a){if(!a)return"";a=_.G(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(Aa);return a}a=escape(mi(a));try{return decodeURIComponent(a)}catch(b){throw Error(Aa);}};
36
- 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=_.G(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(_.G(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)};
37
- _.qi=function(a,b){if(_.jh(a))return a;let c="";b=!!b;const d=_.G(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");
38
- };_.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};
39
- _.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=_.G(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};
40
- _.yi=function(a){if(void 0===a||null===a||""===a)return"";try{let b=Number(a);if(mh(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,"")};_.Bi=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};
41
- _.Ci=function(a,b){a.classList.add(b)};_.Di=function(a,b){if(a&&typeof b===_.He)for(const c in b)a.style[c]=b[c]};_.Ei=function(a){return document.createElement(a)};Fi=function(a,b){const c=new MutationObserver(()=>{const d=Array.from(a.h.values());ai(Array.from(b.classList),Array.from(d))||b.classList.add(...d)});c.observe(b,{attributes:!0,attributeFilter:["class"]});return c};Gi=function(a,b){a.a&&0!==b.length&&(a.a.classList.add(b),a.h.add(b))};
42
- Hi=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};Ii=function(a){return 0>=a?Promise.resolve():new Promise(b=>{setTimeout(()=>{b()},1E3*a)})};Mi=function(){if(Ji)return Ji;Ki||(Ki=new _.Li(()=>{Ji=null}));(Ji=document.querySelector(_.t)||document.querySelector(_.q))||(Ji=document.createElement(_.t));Ki.la(1);return Ji};_.Ni=function(){return!!navigator.userAgent.match(/Edge?\//)};
43
- _.Oi=function(a){return(navigator.userAgent||"").includes(a)};_.Pi=function(a){return _.Oi("Tizen"+(a?" "+String(a):""))};Ri=function(a){const b={major:-1,name:_.lg};if(!a)return b;var c=a.replace(/_/g,".");b.name=c;c=c.split(".");1<=c.length&&(b.major=Qi(a,c[0]));2<=c.length&&(b.minor=Qi(a,c[1]));3<=c.length&&(b.patch=Qi(a,c[2]));4<=c.length&&(b.build=Qi(a,c[3]));return b};_.Si=function(){return _.Oi("Web0S")};
44
- _.Wi=function(){const a=Ti();const b=["ie","edge","opera","firefox","safari",$c];var c=Ui();const d=Vi[c];for(let e=0,f=b.length;e<f;e++)if(c=d[b[e]]&&a.match(d[b[e]]))return Ri(c[1]);return Ri("")};_.Xi=function(){return _.Oi("CrKey")};_.Yi=function(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!_.Pi()};_.Zi=function(){return/(?:iPhone|iPad|iPod|Android)/.test(navigator.userAgent)?!0:_.Yi()&&1<navigator.maxTouchPoints};_.$i=function(){return/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)};
45
- Qi=function(a,b){try{return parseInt(b,10)}catch(c){aj.warn("Unable to parse version number for '"+b+"' from '"+a+"'")}return-1};bj=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};
46
- Ui=function(){const a=Ti();if(!a)return cj;var b=a.match(/^.+?(?=\))/);if(!b)return cj;b=b[0];if(bj(b,["iphone","ipad"]))return dj;if(bj(b,["android"]))return ej;if(bj(b,["macintosh"]))return fj;if(bj(b,["windows nt"]))return gj;if(bj(b,["tizen"]))return hj;if(bj(b,["web0s"]))return ij;if(bj(b,["linux"]))return jj;aj.warn("Unable to identify OS from user agent: "+a);return cj};Ti=function(){let a=window.navigator.userAgent;return a=a.toLowerCase()};
47
- _.lj=function(){var a=Ui();var b=Ui();var c=Vi[b];if(c){c=Ti().match(c.os_version)[1];c=Ri(c);if(b===gj)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=Ri("");a:{c=Ti();const e=["ie","edge","opera","firefox","safari",$c];var d=Ui();d=Vi[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=kj}return{os:a,osVersion:b,browser:c,browserVersion:_.Wi()}};
48
- mj=function(a,b,c){b.hasAttribute(Ad)||(b.style.opacity="0",b.setAttribute(Ad,""),a.j.one(b,Sd,()=>{b.removeAttribute(Ad);b.style.opacity="1";c&&(c.style.opacity="1")}))};nj=function(a){if(a.Na){let b=a.player.getDuration();a.maxDuration&&(b=Math.min(b,a.maxDuration));a.Na.h=b}a.ue&&a.ue()};oj=function(a){if(a.sideAdContainer)a=a.sideAdContainer;else if(a=a.Ng.getSurface().getContainer(),!a)throw Error("Primary player does not have a container");return a};
49
- sj=function(a,b,c){return Array.from({length:2}).map((d,e)=>{var f=document.createElement(_.t);b.appendChild(f);d=a.ka.nb.create();f=new rj(f);d.init(f,c);d.setSourceIndex(0);const g=f.getContainer();if(!g)throw Error("Failed to create player surface container element");g.classList.add("secondary");f.getMedia().classList.add(`v-${e}`);a.A.push(g);return d})};tj=function(a){return[a.a,...a.o.a.map(b=>b.player)]};
50
- uj=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(fd),d.classList.remove("clpp-hide")):(a.g.debug(`Hide video element .${b}`),d.classList.remove(fd),d.classList.add("clpp-hide")),a.F&&a.F(d,c))};vj=function(a){return a.h.find(b=>!!b.primary)||null};
51
- Jj=function(a,b,c){return _.w(function*(){if(a.w)a.g.warn(`Cannot ${c} item while busy (ID: ${b})`);else{var d=wj(a,b);if(d){a.g.info(`${c} item (ID: ${b})`);a.w=!0;var e=a.f;e&&(e.player.isPaused()||(a.l?e.primary?xj(a,e,yj):e.player.pause():e.player.pause()),e.primary?xj(a,e,yj):xj(a,e,zj));var f=a.j.has(b);f&&a.j.delete(b);try{c===_.We?(e&&d.primary?yield Aj(a,d):f?yield Bj(a,d):yield Cj(a,d),nj(d)):f?a.g.error("Loading preloaded items is not supported"):yield Dj(a,d);Ej(a,d);d.primary?xj(a,d,
52
- zj):xj(a,d,yj);d.Na&&Fj(a,d,d.Na);if(d.Ea)d.player.one(_.Wd,d.Ea);e&&Gj(a,e)}catch(g){a.g.error(`Item failed to ${c} (ID: ${b})`,g);if(d.primary)throw g;const h=vj(a);h&&(a.g.warn("Ad failed, resuming primary item"),yield Aj(a,h))}finally{a.w=!1,Hj(a),Ij(a,d.next)}}else a.g.warn(`Item not found (ID: ${b})`)}})};
53
- Ej=function(a,b){const c=b.transition;if(c&&!c.Ug){if(c.Ea){const d=c.Ea,e=()=>{a.g.info(`Transition onEnded to (ID: ${d})`);a.play(d)};b.player.one(_.Wd,e);b.disposers.push(()=>{b.player.off(_.Wd,e)})}c.se&&Kj(a,b,()=>{const d=a.f.Na;d&&(b.disposers.forEach(e=>e()),b.disposers=[],a.a.trigger(new _.H(_.mc,{ad:d})),a.a.trigger(new _.H(_.Xb,{ad:d})),a.a.trigger(new _.H(_.Ub,{id:b.Vb})))});c.Ug=!0}};
54
- Lj=function(a,b){return _.w(function*(){a.g.info("Crop ads by playout limit",b);var c=vj(a),d=a.getCurrentItem();if(c&&d&&d.Na&&null!=c.Z){var e=a.h.filter(l=>!l.primary),f=Math.max(...e.map(l=>l.ub));if(b>f)a.g.info("Playout limit is greater than ad pod duration, ignored.");else{var g=d.player.getPosition()+(d.ub-d.duration),h=e.sort((l,m)=>m.ub-l.ub)[0],k=c.Z;b<=g?(c.Z-=f-g,a.g.warn("Playout limit exceeded, immediately returning "+`to primary at ${c.Z.toFixed(1)} instead of `+`${k.toFixed(1)}`),
55
- yield Jj(a,c.id,_.We),h.Ea&&h.Ea(),c=d.Na,a.a.trigger(new _.H(_.mc,{ad:c})),a.a.trigger(new _.H(_.Xb,{ad:c})),a.a.trigger(new _.H(_.Ub,{id:d.Vb}))):(a.g.warn("Limiting playout of ads to",b),(d=e.find(l=>b<=l.ub&&b>=l.ub-l.duration))?(e=b-(d.ub-d.duration),d.Na.h=e,c.Z-=f-b,a.g.info("Last ad is now ",d.Na.eb(),"with cropped duration",e,"and primary will resume at",c.Z.toFixed(1),"instead of",k.toFixed(1)),h.Ea&&(d.Ea=h.Ea),d.transition={se:{position:e,itemId:c.id,Z:c.Z}},Ej(a,d)):a.g.warn("Cannot find ad hit by limit"))}}})};
56
- Mj=function(a){return _.w(function*(){const b=a.f;b&&("loaded"!==b.state&&(yield b.cd),yield b.player.play(),b.state=_.gf,nj(b))})};Nj=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(),cd:Promise.resolve()})))};
57
- Pj=function(a,b){return _.w(function*(){a.g.info("Remove items",b);const c=[],d=[];for(const e of a.h)b.includes(e.id)?d.push(e):c.push(e);a.h=c;yield Promise.all(d.map(e=>{e.disposers.forEach(f=>f());e.disposers=[];return Oj(a,e.id)}))})};Qj=function(a){return _.w(function*(){yield Pj(a,a.h.map(b=>b.id))})};Oj=function(a,b){return _.w(function*(){const c=a.j.get(b);c&&(a.g.info(`Stop preloading item (ID: ${b})`),c.player&&(yield Rj(a,c.player)),a.j.delete(b))})};
58
- Tj=function(a){const b=vj(a);b&&(b.transition=void 0,b.next=[],Sj(a))};Uj=function(a){return _.w(function*(){const b=a.h.filter(c=>!c.primary).map(c=>c.id);Tj(a);yield Pj(a,b)})};Vj=function(a){_.w(function*(){const b=a.getCurrentItem(),c=b.next[0];b&&b.primary&&c&&(Tj(a),yield a.play(c))})};Sj=function(a){a.f&&(a.f.disposers.forEach(b=>b()),a.f.disposers=[],a.f.transition&&(a.f.transition.Ug=!1),Ej(a,a.f))};wj=function(a,b){return a.h.find(c=>c.id===b)||null};
59
- xj=function(a,b,c){const d=b?b.Vb||null:null;a.B?(a.a.setMuted(!0),Wj(a,!0)):(b.audio&&(c=b.audio),a.ka.onAudioDecision&&(c=a.ka.onAudioDecision(d)),c===zj?(a.a.setMuted(!1),Wj(a,!0)):c===yj?(a.a.setMuted(!0),Wj(a,!1)):a.g.warn("Audio decision not supported",c))};
60
- Aj=function(a,b){return _.w(function*(){if(b.player){a.G();if(b.state===qf){a.g.info("Wait for seek to finish");try{yield b.preloadPromise}catch(c){}}a.ga=!1;b.Z&&(yield b.player.seek(b.Z,!0));a.f=b;b.role=Xj;uj(a,b.player,!0);b.state="loading";a.l?(xj(a,b,zj),b.player.isPaused()&&(yield b.player.play())):yield b.player.play();b.state=_.gf}})};
61
- Bj=function(a,b){return _.w(function*(){const c=b.player;if(c){if(b.state===qf){a.g.info(Fb);try{yield b.preloadPromise}catch(d){}}a.f=b;b.role=Xj;uj(a,c,!0);b.state===pf?yield c.play():b.state===of&&(yield Yj(a,c,b.config,b.Nd));b.state=_.gf}})};Cj=function(a,b){return _.w(function*(){yield Dj(a,b);yield b.player.play();b.state=_.gf})};
62
- Dj=function(a,b){return _.w(function*(){const c=yield Zj(a,!!b.primary);a.f=b;b.role=Xj;a.f.player=c;a.f.videoEl=c.getSurface().getMedia();uj(a,c,!0);b.state="loading";b.cd=Yj(a,c,b.config,b.Nd);yield b.cd;b.state="loaded"})};
63
- Fj=function(a,b,c){const d=b.player,e=()=>{const l=d.getPosition(),m=c.getDuration();c.w=l;a.a.trigger(new _.H(_.ic,{ad:c}));!c.j&&l>=m/4&&(c.j=!0,a.a.trigger(new _.H(_.Yb,{ad:c})));!c.l&&l>=m/2&&(c.l=!0,a.a.trigger(new _.H(_.dc,{ad:c})));!c.o&&l>=3*m/4&&(c.o=!0,a.a.trigger(new _.H(_.nc,{ad:c})))},f=()=>{d.isEnded()||a.a.trigger(new _.H(_.gc,{ad:c}))},g=()=>{a.a.trigger(new _.H(_.jc,{ad:c}))},h=()=>{a.a.trigger(new _.H(_.Vb,{ad:c}))},k=()=>{a.a.trigger(new _.H(_.mc,{ad:c}));a.a.trigger(new _.H(_.Xb,
64
- {ad:c}));c.f===c.a&&a.a.trigger(new _.H(_.Ub,{id:b.Vb}))};d.on(_.fg,e);d.on(_.Se,f);d.on(_.gf,g);d.on(_.Pc,h);d.one(_.Wd,k);b.disposers.push(()=>{d.off(_.fg,e);d.off(_.Se,f);d.off(_.gf,g);d.off(_.Pc,h);d.off(_.Wd,k)});1===c.f&&a.a.trigger(new _.H(_.Tb,{id:b.Vb}));c.videoEl=d.getSurface().getMedia();a.a.trigger(new _.H(_.bc,{ad:c}));a.a.trigger(new _.H(_.lc,{ad:c}))};
65
- Gj=function(a,b){return _.w(function*(){const c=b.player;b.primary?(a.g.info("Pause primary playback"),a.l||uj(a,c,!1)):(a.g.info(`Stop previous playback (ID: ${b.id})`),b.disposers.forEach(d=>d()),b.disposers=[],b.player=null,b.videoEl=null,b.role=ak,b.nf?(a.g.info(`Release player (ID: ${b.id}) `+`after delay ${b.nf} ms.`),yield new Promise(d=>{setTimeout(()=>_.w(function*(){yield Rj(a,c);uj(a,c,!1);a.a.trigger(new _.H("ad-hls-released"));d()}),b.nf)})):(yield Rj(a,c),uj(a,c,!1)))})};
66
- Hj=function(a){Promise.all(Array.from(a.j.keys()).map(b=>Oj(a,b)))};Ij=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=>bk(a,d)))}})};ck=function(a,b,c){c=void 0===c?!1:c;if(!a.ga){var d=vj(a);d?(d.Z=b,c&&(a.ga=!0)):a.g.error("Failed to get primary item. Cannot configure resume position.")}};dk=function(a){a.A.forEach(b=>a.C.removeChild(b));a.A=[];uj(a,a.a,!0)};
67
- Kj=function(a,b,c){const d=b.transition.se;let e=null;d.Z&&ck(a,d.Z);const f=()=>{const k=b.player.getPosition();.5>=d.position-k&&(a.g.info("Start RAF polling"),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=()=>{a.g.info("Stop timeupdate polling");b.player.off(_.fg,f)};
68
- a.g.info("Start timeupdate polling");b.player.on(_.fg,f);b.disposers.push(()=>{null!=e&&(a.g.info("Stop RAF polling"),cancelAnimationFrame(e),e=null)});b.disposers.push(h)};Rj=function(a,b){return _.w(function*(){b!==a.a&&(yield a.o.release(b))})};ek=function(a){return _.w(function*(){a.f&&(yield Gj(a,a.f),uj(a,a.a,!0))})};Zj=function(a,b){return _.w(function*(){if(b)return a.a;const c=yield a.o.get();if(!c)throw Error("No player available");return c})};
69
- Yj=function(a,b,c,d){return _.w(function*(){yield b.release();yield b.load(c);d&&d(b.getDuration());if(a.f&&a.f.player){const e=a.f.player.getVolume();b.setVolume(null==e?1:e);b.setMuted(a.f.player.isMuted()||!1)}})};
70
- bk=function(a,b){return _.w(function*(){if(b.primary){b.state=qf;a.j.set(b.id,b);if(b.Z&&!a.l){var c=b.player;a.g.info("Preparing to resume at",b.Z);xj(a,b,yj);yield c.seek(b.Z,!0)}b.state=pf}else{c=b.id;var d=yield Zj(a,!1);b.player=d;b.videoEl=d.getSurface().getMedia();b.role=ak;b.state=qf;try{a.j.set(c,b);b.config.autoplay&&(a.g.warn(la+`Force disabling autoplay (ID: ${c})`),b.config.autoplay=!1);const e=a.a.getBandwidthEstimate();e&&(b.config.abr||(b.config.abr={}),b.config.abr.defaultBandwidthEstimate=
71
- e);b.preloadPromise=Yj(a,d,b.config,b.Nd);yield b.preloadPromise;b.state=pf}catch(e){7001===e.code?(a.g.info(`Preload aborted (ID: ${c})`),b.state=nf):(a.g.warn(`Preload failed (ID: ${c})`,e),b.state=of)}}})};Wj=function(a,b){a.h.filter(c=>!c.primary&&c.player).forEach(c=>c.player.setMuted(b))};_.fk=function(a){return"com.apple.hls.interstitial"===a||"com.apple.hls.overlay"===a};_.gk=function(a){if(!a)return!1;const b=!!a[_.Mb];a=!!a[_.Lb];return(b||a)&&!(b&&a)};
72
- hk=function(a){return a&&a.ASSETS&&Array.isArray(a.ASSETS)?a.ASSETS.every(b=>typeof b.URI===_.Tf&&typeof b.DURATION===_.r):!1};kk=function(a){return a.Hf&&!(a.once&&a.Vg)&&[ik,jk].includes(a.state)};lk=function(a){a=a.customAttributes[Kb];if(!a)return null;try{return JSON.parse(atob(a))}catch(b){return null}};mk=function(a,b){for(let d=0;d<a.length;d++){const e=a[d];var c=d===a.length-1;c&&2===b||(c?(e.next=[sf],e.transition={Ea:sf}):(c=a[d+1].id,e.next=[c],e.transition={Ea:c}))}};
73
- nk=function(a){const b={};a=a.map(d=>d.customAttributes||{});const c=new Set;a.forEach(d=>{Object.keys(d).forEach(e=>{c.add(e)})});for(const d of c)if(d===_.Qb){const e=new Set([]);a.forEach(f=>{f[d]&&f[d].forEach(g=>e.add(g))});b[d]=Array.from(e)}else if(d===_.Rb){const e=a.reduce((f,g)=>g[d]?f+g[d]:f,0);b[d]=e}return b};
74
- pk=function(a,b){if(0===a.length)return a;const c=new Map;1===b?a.forEach(d=>{const e=c.get(d.startTime)||[];e.push(d);c.set(d.startTime,e)}):c.set(0,a);a=[];for(const d of c.values())1===d.length?a.push(d[0]):(b=ok(d),a.push(b));return a};
75
- ok=function(a){const b=[];let c=0;a.forEach(f=>{var g=Math.max(0,f.endTime-f.startTime);c+=g;var h=f.customAttributes[_.Lb];h&&b.push({type:"list",id:f.id,customAttributes:f.customAttributes,oc:{URI:h,DURATION:0}});if(h=f.customAttributes[_.Mb])g={type:"uri",id:f.id,customAttributes:f.customAttributes,oc:{URI:h,DURATION:g}},(f=lk(f))&&(g.oc[Kb]=f),b.push(g)});const d=nk(a);d[Nb]={entries:b,pa:[]};const e=a[0];a=a.map(f=>f.id).join("+");return Object.assign({},e,{id:a,endTime:e.startTime+c,customAttributes:d})};
76
- _.rk=function(){return{maxAttempts:1,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:0,fatalStatusCodes:[...qk]}};sk=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||[...qk]};tk=function(a){const b={};a.forEach((c,d)=>{b[d.trim()]=c});return b};
77
- _.vk=function(a,b){_.jh(a)&&(a={uris:[a]});Array.isArray(a)&&(a={uris:a});const c={uris:a.uris||[],type:a.type||_.uk,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||
78
- [],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:[...qk],requestStartTimestamp:null};a.keyInfo&&(c.keyInfo=a.keyInfo);b&&sk(c,b);return c};
79
- _.zk=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(wk(c))return xk(a);throw yk(a);};wk=function(a){return 200<=a&&299>=a&&202!==a};xk=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}};
80
- yk=function(a){a=xk(a);try{var b=_.qi(a.data,!0)}catch(d){b=null}_.xh("HTTP error text:",b);const c=a.request;return new _.I(0<=(c?c.fatalStatusCodes||[]:[]).indexOf(a.status)?_.D:1,1,1001,{url:a.uri,status:a.status,responseText:b,headers:a.headers,request:a.request,response:a})};Ak=function(a,b){b=parseInt(b,10);Number.isNaN(b)&&(b=-1);a.bytesTotal=b;a.bytesLoaded=0;a.bytesRemaining=b};Bk=function(a,b,c){0<a.bytesRemaining&&(a.bytesRemaining-=b);a.bytesLoaded+=b;if(a.onProgress)a.onProgress(b,c)};
81
- Ck=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()};Dk=function(a){return a.reduce((b,c)=>b+c,0)};Fk=function(a){return a.a.find(b=>b.state===Ek)||null};Gk=function(a,b){const c=a.f.getPosition();b>=c||a.a.filter(d=>1===d.jd&&!d.once&&d.Cg&&d.startTime>b).forEach(d=>{d.Hf=!0})};Ik=function(a){return a.a.find(b=>b.state===Hk)||null};
82
- Jk=function(a,b){return a.a.find(c=>kk(c)&&!c.hi&&1===c.jd&&b>c.startTime&&b<c.endTime)||null};Kk=function(a,b){const c=a.f.getPosition();return a.a.filter(d=>1===d.jd&&!d.Zf).sort((d,e)=>e.startTime-d.startTime).find(d=>d.startTime>c&&d.startTime<b)||null};Nk=function(a,b,c){_.w(function*(){a.ga=!0;try{const d=Ik(a);d&&(yield Lk(a,d));a.g.info("Seek into interstitial",b.ea);yield Mk(a,b)}catch(d){yield a.f.seek(c)}finally{a.ga=!1}})};
83
- Ok=function(a,b,c){_.w(function*(){a.ga=!0;try{const d=Ik(a);d&&(yield Lk(a,d));a.g.info("Play jumped interstitial",b.ea,"resume at",c.toFixed(2));yield Mk(a,b,c)}catch(d){a.g.warn("Failed to play jumped interstitial",b.ea,d),b.Hh=new Date,yield a.f.seek(c)}finally{a.ga=!1}})};Lk=function(a,b){return _.w(function*(){a.g.info("Unschedule interstitial",b.ea);yield Uj(a.Y);b.state=ik})};
84
- Wk=function(a,b){const c=()=>_.w(function*(){if(!a.ga&&!a.Ge){var g=b.getPosition(),h=Pk(a,g);h&&(yield Qk(a,h))&&Rk(a,h,b);if((h=Sk(a))&&h.state===ik&&b.getDuration()-g<a.ka.resolutionOffsetSec&&(yield Qk(a,h)))if(h.pa&&0!==h.pa.length){if(g=a.Y.getCurrentItem()){var k=Tk(a,h,2);if(0!==k.length){var l=k[0].id;g.next=[l];g.transition={Ea:l};a.g.info(`Schedule postroll interstitial ${h.ea}`);Uk(a,h,k)}}}else a.g.warn("Postroll interstitial has no assets, ignoring.")}});b.on(_.fg,c);a.h.push(()=>{b.off(_.fg,
85
- c)});const d=()=>{Vk(a,!1,!0,!0)};b.on(_.eg,d);a.h.push(()=>{b.off(_.eg,d)});const e=()=>{a.Ge=!0};b.on(_.Tb,e);a.h.push(()=>{b.off(_.Tb,e)});const f=()=>{a.Ge=!1};b.on(_.Ub,f);a.h.push(()=>{b.off(_.Ub,f)})};Xk=function(a){a.h.forEach(b=>b());a.h=[]};Yk=function(a){return(a=a.Y.getCurrentItem())&&!a.primary?a.player:null};
86
- Vk=function(a,b,c,d){var e=Zk(a);a.g.info("Interstitial cues changed",e);var f=e;if(d){f=di(a.a.map(p=>p.ea),e.map(p=>p.id));$k(a,f.Ii);const n=new Set(f.rh);f=e.filter(p=>n.has(p.id))}if(!al(a,f))return!1;const g=[],h=[],k=[];f.forEach(n=>{const p=n.customAttributes.CUE||[];p.includes(_.eb)?h.push(n):!d&&p.includes("PRE")?g.push(n):!c&&n.startTime<a.ka.Ei?g.push(n):k.push(n)});e=pk(g,0);f=pk(h,2);const l=pk(k,1),m=e.concat(f,l);bl(a,m);0<e.length&&dl(a,e[0],b);l.forEach(n=>el(a,n,1));0<f.length&&
87
- el(a,f[0],2);fl(a,m);return 0<e.length};gl=function(a){_.w(function*(){var b=a.Y;Nj(b,[{id:sf,primary:!0,config:b.a.getConfiguration(),next:[],ub:0,duration:0,Vb:null}]);var c=vj(b);if(!c)throw Error("Failed to find primary item");b.f=c;c.role=Xj;c.player=b.a;c.videoEl=c.player.getSurface().getMedia();uj(b,c.player,!0);b=a.f;c=b.getConfiguration();a.j=Vk(a,!c.autoplay,b.isLive(),!1);if(a.j){if(b=a.Y,c=b.o,c=c.a[0]?c.a[0].player:null)b.l||uj(b,b.a,!1),uj(b,c,!0)}else c.autoplay&&(yield Mj(a.Y))})};
88
- Mk=function(a,b,c){return _.w(function*(){if(!(yield Qk(a,b)))throw Error("Failed to bind");yield hl(a,b,1,!1,c)})};Zk=function(a){return a.f.getTimelineCues().filter(b=>_.fk(b.schemeIdUri)&&b.customAttributes)};$k=function(a,b){const c=new Set(b);a.a.forEach(d=>{c.has(d.ea)&&!kk(d)&&a.g.warn("Removing an interstitial in active state",d)});a.a=a.a.filter(d=>!c.has(d.ea))};
89
- al=function(a,b){const c=[];b.forEach(d=>{_.gk(d.customAttributes)||c.push(`Interstitial cue ${d.id} is invalid `+"it must contain exactly one of X-ASSET-LIST or X-ASSET-URI.")});0<c.length&&a.g.error("Invalid interstitials, all interstitials will "+`be skipped. ${c.join(" ")}`);return 0===c.length};
90
- bl=function(a,b){var c=b.sort((f,g)=>f.startTime-g.startTime);b=a.ka.resolutionOffsetSec;let d=Infinity;const e=[];for(let f=0;f<c.length-1;f++){const g=c[f],h=c[f+1];h&&(d=Math.min(d,h.startTime-g.endTime));h&&h.startTime<=g.endTime&&e.push(`Interstitials ${g.id} and ${h.id} `+"overlap.")}d<b&&(c=d/2,a.ka.resolutionOffsetSec=c,a.g.info("Interstitials are closer than configured "+`resolutionOffsetSec (${b} s) auto-reconfiguring to `+`${c} s.`));0<e.length&&a.g.warn("Unsupported format of interstitials, playback may not "+
91
- `behave correctly. ${e.join(" ")}`)};dl=function(a,b,c){_.w(function*(){var d=el(a,b,0);const e=yield Qk(a,d),f=d.pa?d.pa.length:0;if(e&&0<f)try{a.g.info(`Player preroll interstitial ${d.ea}`),yield hl(a,d,0,c)}catch(g){a.g.error("Preroll interstitial failed.",g),(d=vj(a.Y))&&(yield a.Y.play(d.id))}else e?a.g.warn("Preroll interstitial has no assets, skipping"):a.g.error("Preroll interstitial failed, skipping"),yield ek(a.Y),c||(yield Mj(a.Y))})};
92
- el=function(a,b,c){{const e=b.customAttributes[_.Mb],f=b.customAttributes[_.Lb],g=b.customAttributes[Nb],h=b.customAttributes[_.Rb],k=b.customAttributes[_.Pb],l=b.customAttributes[_.Qb]||[];b.customAttributes[Sb]||(b.customAttributes[Sb]=null==h||0<h?"RANGE":"POINT");var d=b.customAttributes["X-YOSPACE-AUDIO-PRIORITY"];d="CONTENT"===d?zj:"AD"===d?yj:void 0;b={ea:b.id,startTime:b.startTime,endTime:b.endTime,state:ik,Of:f,Pf:e,zd:g,pa:null,Z:null==h?null:Math.max(0,b.startTime+h),Ki:h,ic:k,jd:c,hi:"POINT"===
93
- b.customAttributes[Sb],zh:!l.includes("SKIP"),Zf:!l.includes("JUMP"),Wg:lk(b),Cg:null!=h&&0>h,once:(b.customAttributes.CUE||[]).includes("ONCE"),Vg:!1,Hf:!0,customAttributes:b.customAttributes,audio:d}}a.a.push(b);return b};
94
- fl=function(a,b){_.w(function*(){const c=a.Y.getCurrentItem();if(c)if(c.primary)a.a.forEach(g=>{const h=b.find(k=>k.id===g.ea);if(h){const k=h.customAttributes[_.Pb];null==g.ic&&null!=k&&(a.g.info(Bb,h.id,"Playout limit",k),g.ic=k,1===g.jd&&g.state===Hk&&il(a,g))}});else{var d=b.find(g=>g.id===c.Vb);if(d){var e=d.customAttributes[_.Pb];if(null!=e){var f=a.a.find(g=>g.ea===d.id);f&&null==f.ic&&(a.g.info(Bb,d.id,"Playout limit",e),f.ic=e,yield Lj(a.Y,e))}}}})};
95
- il=function(a,b){_.w(function*(){yield Lk(a,b);yield Rk(a,b,a.f)})};Qk=function(a,b){return _.w(function*(){b.state=Ek;if(b.zd)yield jl(a,b,b.zd);else if(b.Of)yield kl(a,b,b.Of);else if(b.Pf){b.pa=[{URI:b.Pf,DURATION:b.endTime-b.startTime}];var c={URI:b.pa[0].URI,DURATION:b.pa[0].DURATION};b.Wg&&(c[Kb]=b.Wg);c={ASSETS:[c]};ll(a,new _.H(ac,{id:b.ea,detail:c}));b.state=ml}else b.state=nl;return b.state===ml})};
96
- hl=function(a,b,c,d,e){return _.w(function*(){if(0!==b.pa.length&&a.Y.getCurrentItem()){var f=Tk(a,b,c);0!==f.length&&(Uk(a,b,f),0===c&&a.f.isLive()||(null!=e?ck(a.Y,e,!0):null!=b.Z&&ck(a.Y,b.Z)),d?yield a.Y.load(f[0].id):yield a.Y.play(f[0].id))}})};
97
- Rk=function(a,b,c){if(b.pa)if(0===b.pa.length){const g=()=>{c.isLive()?a.g.info("Skipping empty "+`live interstitial ${b.ea}`):null!=b.Z&&0!==b.Ki?c.seek(b.Z):a.g.info(`Empty VOD interstitial ${b.ea}, `+"continuing to next segment")};c.one(_.cg,g);a.h.push(()=>{c.off(_.cg,g)});a.g.info(`Schedule interstitial ${b.ea} to `+"be skipped")}else{var d=a.Y.getCurrentItem();if(d){var e=Tk(a,b,1);if(0!==e.length){var f=e[0].id;null!=b.Z&&ck(a.Y,b.Z);d.next=[f];d.transition={se:{position:b.startTime,itemId:f,
98
- Z:b.Z}};a.g.info(`Schedule interstitial ${b.ea} for `+`${b.startTime} s`);Uk(a,b,e)}}}};Pk=function(a,b){return a.a.find(c=>{const d=c.startTime-b;return 1===c.jd&&kk(c)&&0<d&&d<=a.ka.resolutionOffsetSec})||null};Sk=function(a){return a.a.find(b=>2===b.jd)||null};
99
- jl=function(a,b,c){return _.w(function*(){try{const d=[],e=c.entries,f=e.map(h=>_.w(function*(){if("list"===h.type)return(yield ol(a,h.oc.URI)).ASSETS.map(k=>({id:h.id,customAttributes:h.customAttributes,oc:k}));if("uri"===h.type)return[{id:h.id,customAttributes:h.customAttributes,oc:h.oc}];throw new _.pl("Invalid group asset entry type");}));(yield Promise.all(f)).forEach(h=>d.push(...h));b.zd={entries:e,pa:d};const g={ASSETS:d.map(h=>h.oc)};ql(a,b,g)}catch(d){a.g.error(`Failed to bind grouped asset list for ${b.ea}`,
100
- d),b.state=nl}})};kl=function(a,b,c){return _.w(function*(){try{a.g.info(`Load X-ASSET-LIST for ${b.ea}`);ll(a,new _.H(Zb));const d=yield ol(a,c);ql(a,b,d)}catch(d){a.g.error("Failed to load X-ASSET-LIST",d),b.state=nl}})};
101
- ol=function(a,b){return _.w(function*(){var c=a.Y.je();if(!c)throw Error("No player found");c=c.getNetworkEngine();const d=_.vk(rl(a,b));c=yield sl(c,d);if(null===c)return a.g.warn(`X-ASSET-LIST ${b} returned no content`),{ASSETS:[]};if(!hk(c))throw new _.pl("Invalid X-ASSET-LIST list response");return c})};
102
- ql=function(a,b,c){b.pa=c.ASSETS;b.pa&&0!==b.pa.length||a.g.info(`Interstitial ${b.ea} has no assets, `+"will be smoothly skipped");if(null==b.Z){const d=Dk(b.pa.map(e=>e.DURATION));b.Z=b.startTime+(null==b.ic?d:Math.min(b.ic,d))}b.state=ml;ll(a,new _.H($b));ll(a,new _.H(ac,{id:b.ea,detail:c}))};ll=function(a,b){a.f.trigger(b)};rl=function(a,b){return(a=a.ka.Di)?(b=new URL(b),b.searchParams.set("_HLS_primary_id",a),b.toString()):b};
103
- Tk=function(a,b,c){let d=0;const e=!!b.zd;let f=b.pa.map((l,m)=>{let n=b.ea;e&&(n=b.zd.pa[m].id);d+=l.DURATION;return{id:`${n}-${m}`,config:{source:{url:rl(a,l.URI),type:_.tl}},duration:l.DURATION,ub:d,Vb:n,next:[],Na:new J(c,m+1,b.pa.length,l.DURATION,n,b.zh,b.customAttributes||null),audio:b.audio}});mk(f,c);f.forEach(l=>{l.ue=()=>{var m=l.Na;a.g.info(`Playing ad ${`${m.f}/${m.a}`} of interstitial `+l.Vb)};l.Nd=()=>{ll(a,new _.H(_.cc,{ad:l.Na}))}});if(null!=b.ic&&(f=ul(a,b,f),0===f.length))return[];
104
- const g=f[0].ue;f[0].ue=()=>{b.state=vl;b.Vg=!0;b.Cg&&(b.Hf=!1);a.g.info(`Playing interstitial ${b.ea} with `+`${b.pa.length} assets and will resume primary `+`content ${b.Z?`at ${b.Z.toFixed(1)} s`:"after interstitial ended"}.`);g()};const h=f[0].Nd;f[0].Nd=l=>{null==b.Z&&(b.Z=b.startTime+l,ck(a.Y,b.Z),a.g.info("Primary content will resume at",b.Z.toFixed(1),"s"));h(l)};const k=f[f.length-1];k.Ea=()=>{b.state=jk;Pj(a.Y,f.map(l=>l.id));2===c&&ek(a.Y)};k.nf=a.ka.adReleaseDelayMs;return f};
105
- Uk=function(a,b,c){Nj(a.Y,c);a=a.Y;Sj(a);a.f&&(a.f.Na&&Fj(a,a.f,a.f.Na),Hj(a),Ij(a,a.f.next));b.state=Hk};
106
- ul=function(a,b,c){const d=b.ic;a.g.info(`Playout limit for ${b.ea} is `+`${d} s`);b=c[c.length-1].ub;if(d>=b)return a.g.info(`Playout limit (${d}) is`+`larger or equal to total duration: (${b}).`),c;if(0>=d)return a.g.info("Discarding all ads."),[];const e=c.filter(f=>f.ub-f.duration<=d);e.forEach(f=>{f.Na.a=e.length});a=e[e.length-1];c=d-(a.ub-a.duration);.1>Math.abs(c-a.duration)?a.transition.Ea=sf:a.transition.se={position:c,itemId:sf,Z:null};a.maxDuration=c;return e};
107
- wl=function(){try{const a=URL.createObjectURL(new Blob);URL.revokeObjectURL(a);return a.slice(a.lastIndexOf("/")+1)}catch(a){let b=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,c=>{const d=(b+16*Math.random())%16|0;b=Math.floor(b/16);return("x"===c?d:d&3|8).toString(16)})}};
108
- Al=function(a){a.a.on(window,"offline",()=>{xl(a,!1)});a.a.on(window,"online",()=>{a.f||yl(a)});a.a.on(a.m,Of,()=>zl(a));a.a.on(a.m,"suspend",()=>zl(a));a.a.on(a.m,_.Fg,()=>zl(a));a.a.on(a.m,_.gf,()=>{a.f||yl(a)});a.a.on(a.m,_.tf,()=>{a.f||yl(a)});a.a.on(a.m,_.Qf,()=>{switch(a.m.getState()){case 2:zl(a);break;default:zl(a)}})};Bl=function(a){a.h&&(a.h.stop(),a.h=null)};zl=function(a){a.f&&yl(a)};
109
- Dl=function(a){return _.w(function*(){var b=a.m.getConfiguration().connectivityCheck;b&&a.m&&(b=yield Cl(a.j,b.url,b.attemptParameters,b.method),xl(a,b))})};yl=function(a){a.m.getConfiguration().connectivityCheck&&(Bl(a),a.h=(new _.Li(()=>Dl(a))).la(5))};xl=function(a,b){Bl(a);a.f!==b&&(a.f=b,a.m&&a.m.getConfiguration().connectivityCheck&&a.m.trigger(new _.H(Oe,{online:a.f})))};_.Fl=function(a,b){a.a.push(El(b,()=>{{var c=a.a;const d=c.indexOf(b);-1<d&&c.splice(d,1)}}))};
110
- _.Gl=function(){let a,b;const c=new Promise((e,f)=>{a=e;b=f}),d=Object.assign(c,{done:!1,pf:!1,Gi:!1,value:null,error:null,resolve(e){d.pf=!0;d.done=!0;d.value=e;a(e)},reject(e){d.Gi=!0;d.done=!0;d.error=e;b(e)}});return d};Hl=function(a,b){try{return new URL(a,b)}catch(c){return null}};Il=function(){return window.performance&&window.performance.now?window.performance.now():Date.now()};Jl=function(a){return Il()-a.a};Ll=function(a){const b=new Kl;b.a=a.a;return b};
111
- Ml=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};Nl=function(a,b,c){return b.read().then(({done:d,value:e})=>{null!=e&&(Ml(a,e),Bk(c,e.byteLength,Jl(a.h)),a.h.a=Il());return d?(d=a.a.buffer,a.a.byteLength!==a.f&&(d=d.slice(0,a.f)),Promise.resolve(d)):Promise.resolve().then(()=>Nl(a,b,c))})};
112
- Ol=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};Pl=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)};
113
- Rl=function(a){if(0<=a.o&&a.f<a.o)return null;let b=Ql(a);for(;null!==b;){if(b.name===_.xe){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=Ql(a)}return null};
114
- Sl=function(a,b,c,d){return b.read().then(e=>{var {done:f,value:g}=e;d&&g&&(d(g.byteLength,Jl(a.w)),a.w.a=Il());if(f)return e=Ol(a),(e=c(!0,e))?e.then(()=>a.j.a.buffer):Promise.resolve(a.j.a.buffer);let h=Promise.resolve();if(null!=g){Pl(a,g);var k=Rl(a);for(e=[];k;)e.push(k),k=Rl(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=
115
- c(!1,k))&&(h=e)}}return h.then(()=>Sl(a,b,c,d))})};
116
- Ql=function(a){const b=a.a;if(a.a+4>=a.f)return a.a=a.f,null;var c=Tl(a);if(a.a+4>=a.f)return a.a=a.f,null;var d=Tl(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 _.I(_.D,3,3E3);}if(2097151<f)throw new _.I(_.D,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};
117
- Tl=function(a){const b=a.l.getUint32(a.a,!1);a.a+=4;return b};
118
- Vl=function(a){var b=new window.Headers;for(const e in a.headers)b.append(e.toLowerCase(),a.headers[e]);const c=new window.AbortController,d={pd:!1,Zg:!1};b={V:Ul(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.pd||(d.pd=!0,c.abort());return Promise.resolve()}};if(a=a.timeout){const e=window.setTimeout(()=>{d.Zg=!0;c.abort()},a);b.V=b.V.finally(()=>{window.clearTimeout(e)})}return b};
119
- Ul=function(a,b,c,d){return _.w(function*(){const e=new Kl,f=Ll(e);try{const g=yield window.fetch(a,c),h=tk(g.headers),k={uri:g.url,data:null,headers:h,status:g.status,timeMs:0,responseStartMs:Jl(f),request:b};if(!wk(g.status))throw k.data=yield g.arrayBuffer(),k.timeMs=Jl(e),yk(k);const l=g.headers.get(sa);Ak(b,l);const m=l?parseInt(l,10):0;if(b.onFragment&&!b.disableFragmentSupport&&2===b.type){const n=g.body.getReader(),p=new Wl(m,!b.disableMergedFragments);k.data=yield Sl(p,n,(u,v)=>{if(d.pd)return null;
120
- v&&v.data&&(Bk(b,v.data.byteLength,Jl(f)),f.a=Il());return b.onFragment&&v?b.rateLimitBps?Ck(b.rateLimitBps,Jl(e),b.bytesLoaded).then(()=>b.onFragment(v)):b.onFragment(v):null},b.onProgress)}else{const n=g.body.getReader(),p=yield Nl(new Xl(m),n,b);b.rateLimitBps&&(yield Ck(b.rateLimitBps,Jl(e),p.byteLength));k.data=p}if(d.pd)throw Error("Request was aborted");k.timeMs=Jl(e);return xk(k)}catch(g){if(d.pd)throw new _.I(1,1,7001,{url:a,request:b});if(d.Zg)throw new _.I(1,1,1003,{url:a,request:b});if(g&&
121
- 1001===g.code)throw g;_.yh("Error while fetching data:",g);throw new _.I(1,1,1002,{url:a,error:g,request:b,status:-1},g);}})};
122
- Yl=function(a){const b=a.uris[a.uriIndex],c=new window.XMLHttpRequest,d=new Kl,e=Ll(d);let f=0,g;const h=new _.Gl;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=Jl(e));m.readyState>=XMLHttpRequest.HEADERS_RECEIVED&&!k&&(m=m.getResponseHeader(sa),Ak(a,m),k=!0)};c.onload=function(m){m=m.target;var n=(m.getAllResponseHeaders()||
123
- "").trim().split("\r\n");const p={};for(const u of n)n=u.split(": "),p[n[0].toLowerCase()]=n.slice(1).join(": ");try{const u=Jl(e);l||Bk(a,m.response?m.response.length:0,u);const v=_.zk(p,m.response,m.status,b,m.responseURL,a,u,g);a.rateLimitBps?Ck(a.rateLimitBps,Jl(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 _.I(1,1,1002,{url:b,request:a,status:m.status}));else{var n=m.getAllResponseHeaders();const u=
124
- {};if(n){n=n.trim().split("\r\n");for(var p of n)n=p.split(": "),u[n[0].toLowerCase()]=n.slice(1).join(": ")}p=_.zk(u,m.response,m.status,b,m.responseURL,a,Jl(e),g);h.resolve(p)}};c.ontimeout=function(){h.reject(new _.I(1,1,1003,{url:b,request:a}))};c.onprogress=function(m){const n=Jl(d);d.a=Il();if(100<n||m.lengthComputable&&m.loaded===m.total)Bk(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{V:h,request:a,abort:()=>
125
- {c.abort();h.reject(new _.I(1,1,7001,{url:b,request:a}));return Promise.resolve()}}};_.$l=function(a,b=!0){a=_.Zl(a).replace(/\+/g,"-").replace(/\//g,"_");return b?a:a.replace(/[=]*$/,"")};_.Zl=function(a){a=mi(_.G(a));return btoa(a)};_.am=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};
126
- _.bm=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};_.cm=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};_.dm=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};
127
- _.em=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};gm=function(a){try{const b=a.uris[a.uriIndex],c=_.fm(b);return{V:Promise.resolve({uri:b,data:c.data,request:a,headers:{"content-type":c.contentType}}),request:a,abort:()=>Promise.resolve()}}catch(b){return{V:Promise.reject(b),request:a,abort:()=>Promise.resolve()}}};
128
- _.fm=function(a){var b=a.split(":");if(2>b.length||"data"!==b[0])throw _.yh("Bad data URI, failed to parse scheme"),new _.I(_.D,1,1004,{uri:a});b=b.slice(1).join(":").split(",");if(2>b.length)throw _.yh("Bad data URI, failed to extract encoding and MIME type"),new _.I(_.D,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?_.am(a).buffer:_.ri(a).buffer,contentType:c}};
129
- El=function(a,b){a.V.then(()=>b(!0),()=>b(!1));return a};
130
- jm=function(a){a.h=a.C.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=hm(e.request.baseDelay,1E3));const f=a.f*(1+(2*Math.random()-1)*hm(e.request.fuzzFactor,.5));a.f*=hm(e.request.backoffFactor,2);if(0<f)return(new Promise((g,h)=>{a.l=h;im(a,()=>{g(e.plugin(e.request))},f)})).catch(g=>{if(!a.a)throw g;})}if(a.a)throw new _.I(1,1,7001,{url:e.request.uris[e.request.uriIndex],request:e.request});return e.plugin(e.request)});
131
- 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.V}).then(e=>{a.w.resolve(e)}).catch(e=>{if(e instanceof _.I){const f=b<d,g=7001!==e.code,h=b<c;if((1===e.severity||f)&&g&&h)return a.A&&a.A(e),jm(a);g&&e.a(_.D);a.w.reject(e)}else a.w.reject(e)})};im=function(a,b,c){a.o=setTimeout(b,c)};hm=function(a,b){return null===a||void 0===a?b:a};
132
- sl=function(a,b){return _.w(function*(){const c=yield km(a,b);if(!c)return null;try{const d=JSON.parse(c);if(null==d||typeof d!==_.He)throw Error("Not an object");return d}catch(d){throw new _.pl("Failed to parse JSON response","json-failed");}})};Cl=function(a,b,c,d){d=void 0===d?"HEAD":d;return _.w(function*(){if(!navigator.onLine)return!1;if(b){const e=_.vk(b,c);e.method=d;c||(e.timeout=5E3);e.headers["cache-control"]="no-cache";try{yield a.fetch(e).V}catch(f){if(1002===f.code||1003===f.code)return!1}}return!0})};
133
- lm=function(a,b){a.A=b};km=function(a,b){return _.w(function*(){const c=yield a.fetch(b);return _.ni(c.data).replace(/\r\n|\r(?=[^\n]|$)/gm,"\n")})};
134
- _.pm=function(a,b,c){if(a.w)return new mm(Promise.reject(new _.I(1,1,7001,{url:b.uris[b.uriIndex],request:b})));a.l&&0<a.l&&(b.rateLimitBps=a.l);var d=[];for(var e of a.h)d.push(e);if(b.requestModifiers)for(const g of b.requestModifiers)d.push(g);b.requestModifiers=d;nm(a,b);b.responseModifiers=[...a.j,...b.responseModifiers||[]];let f;e=d=new _.Gl;try{const g=[{type:"public",modifiers:b.requestModifiers},{type:"internal",modifiers:a.f}];for(const h of g)for(const k of h.modifiers)e=e.then(l=>{if(f.a)throw new _.I(_.D,
135
- 1,7001,l?{url:l.uris[l.uriIndex],request:l}:null);return"internal"===h.type?k(l,c)||l:k(l)||l}).catch(l=>{if(l instanceof _.I)throw l;throw new _.I(_.D,1,1006,null,l);});e=e.then(h=>({request:h,plugin:om(a,h)}));f=new mm(e,a.A);for(const h of b.responseModifiers)f.then(k=>{const l=()=>{if(f.a)throw new _.I(_.D,1,7001,k?{url:k.request.uris[k.request.uriIndex],request:k.request}:null);};l();const m=h(k)||k;l();return m}).catch(k=>{if(k instanceof _.I&&k.data&&k.data.response){const l=h(k.data.response);
136
- if(l&&l.then)return l.then(()=>Promise.reject(k))}return Promise.reject(k)}).catch(k=>{if(k instanceof _.I)throw k;throw new _.I(_.D,1,1007,null,k);});_.Fl(a.o,f);d.resolve(b);return f}catch(g){return new mm(Promise.reject(g))}};nm=function(a,b){for(const c of a.headers){const [d,e]=c;b.headers[d]||(b.headers[d]=e)}};om=function(a,b){b=b.uris[b.uriIndex];var c=new _.qm(b,location.href);c=c?c.a.protocol.slice(0,-1):"";const d=a.a[c];if(!d)throw new _.I(_.D,1,1E3,{url:b});return e=>d(e)};
137
- sm=function(){rm.forEach(a=>a())};_.tm=function(a){rm.push(a)};_.vm=function(a){um&&performance.mark(a)};_.xm=function(a,b,c){um&&(b=performance.measure(a,b,c),null!=b&&wm.info(`Step: "${a}" took ${b.duration.toFixed(0)} ms.`))};Am=function(a,b){var c=ym;zm.set(`${a.toLowerCase().split(";")[0]}-${c}`,{priority:c,plugin:b})};_.Hm=function(a,b){var c=[Bm,Cm,Gm,ym];for(const d of c)if(c=zm.get(`${a.toLowerCase().split(";")[0]}-${d}`)){const e=c.plugin(),f=e.isSupported(a,b);e.destroy();if(f)return c.plugin}return null};
138
- Im=function(a,b){const c=b||$h;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)}};_.Jm=function(a){return null!=a};Km=function(...a){for(let b=0;b<a.length;b++){const c=a[b];if(null!==c&&void 0!==c)return c}throw new _.pl("No non-null, non-undefined value found");};Lm=function(...a){for(let b=0;b<a.length;b++){const c=a[b];if(null!==c&&void 0!==c)return c}};_.Mm=function(a){return`${a.scheme}//`+`${a.a}${a.port?":"+a.port:""}${a.path}${a.h}${a.f}`};
139
- _.Nm=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)},""):""};Om=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};
140
- _.Pm=function(a,b){if(a.startsWith("http://")||a.startsWith(_.fe))return a;let c=b;b.startsWith("//")&&(c=`${location.protocol}${c}`);b=new URL(c);b.search="";return(new URL(a,b)).toString()};_.Qm=function(a){if(!a)return null;a=(new _.qm(a)).a.pathname.split("/");if(1>a.length)return null;a=a.pop().split(".");return 1>=a.length?null:a.pop().toLowerCase()};Sm=function(a,b){const c=Rm[a];for(const d of c)for(const e of b)if(d.test(e.trim()))return e.trim();return a===_.K?"":null};
141
- _.Tm=function(a,b){b&&(a+=';codecs\x3d"'+b+'"');return a.replace(/\s/g,"")};_.Um=function(a){return a.split(";")[0]};_.Vm=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(","):""};
142
- _.Zm=function(){var a=Infinity;navigator.connection&&navigator.connection.saveData&&_.Zi()&&(a=360);const b=_.rk();b.maxAttempts=3;a={source:"",license:Wm,viewerId:void 0,autoplay:void 0,pauseWhenInBackground:!1,ads:{hls:{enable:!0,resolutionOffsetSec:35}},manifest:{attemptParameters:_.rk(),availabilityWindowOverride:NaN,clockSyncUri:"",ignoreDrmInfo:!1,xlinkFailGracefully:!1,autoCorrectDrift:!0,timeline:{version:1,type:void 0}},abr:{enabled:!0,defaultBandwidthEstimate:1E3,switchInterval:8,bandwidthUpgradeTarget:.85,
143
- bandwidthDowngradeTarget:.95,useSwitchIntervalForInitialSwitch:!1,restrictions:Xm(a),useCmsd:!0},contentSteering:{enabled:!0,attemptParameters:_.rk()},drm:null,cmcd:{enabled:!1,version:1,rtpMultiplier:5,deliveryMode:"headers"},enableHtmlCue:!0,preferredAudioLanguage:"",preferredTextLanguage:"",preferredAudioRole:_.te,preferredTextRole:"",preferredAudioChannelCount:2,preferredAudioCodec:[],preferredVideoCodec:[],preferSpatialAudio:!1,preferForcedSubtitles:!1,volume:null,startTime:null,loop:!1,lowLatencyMode:!1,
144
- suggestedPresentationDelay:void 0,muted:void 0,forceWaitForTracks:!1,xmlParser:_.Ym,streaming:{attemptParameters:b,bufferingGoal:10,rebufferingGoal:2,bufferBehind:30,ignoreTextStreamFailures:!1,alwaysStreamText:!1,relativeTextTimestamp:!1,startAtSegmentBoundary:!1,gapDetectionThreshold:.1,disableAudioTracks:!1,disableVideoTracks:!1,smallGapLimit:.5,jumpLargeGaps:!0,gapTolerance:.001,durationBackoff:1,maxSegmentToMediaOffset:1,forceNativeTS:!1,preferNativeHlsOnSafari:!0,safeSeekOffset:5,stallEnabled:!0,
145
- stallThreshold:3,stallSkip:.5,bufferLimitUpdateInterval:.5,overridePasp:!1,enableLiveEdgeChasing:!1,chasingRate:1.15,startChasingAt:5,stopChasingAt:2,chaseJumpDistance:10,patchEdgeWhenMixedContent:!1,ignoreDrift:!1,disableFragmentSupport:!1,disableMergedFragments:!1,ignoreManagedMediaSourceStreamingHints:!1},mediaSource:{codecSwitchingStrategy:_.rf},restrictions:Xm(),tizen:{sideStreamText:_.Pi(2)},safari:{enableHlsVideoTrackInfo:!1,enableMetadata:!1},mse:{sendPlaybackSessionIdHeader:!1},trickPlay:{speedUpMode:_.Cd,
146
- preferTrickPlayTracks:!0},playlist:{timeline:"basic",content:_.Eb,cropTimeline:!1},yospace:{enabled:!1},broadpeak:{adTracking:!1},cmsd:{enabled:!0},mediatailor:{enabled:!1,sessionConfig:{}},disableRestrictions:!1,chromecast:{useSenderAbrConfig:!1,useSenderStreamingConfig:!1}};if(_.Pi()||_.Si())a.ads.hls.enable=!1;if(_.Oi("Edge/")||_.Pi())a.streaming.gapDetectionThreshold=.5;_.Si()&&(a.streaming.stallEnabled=!1);_.Si()&&79===_.Wi().major&&(a.streaming.stallEnabled=!0,a.streaming.stallThreshold=1,a.streaming.stallSkip=
147
- 1,a.streaming.gapDetectionThreshold=.02);_.Pi()&&(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};Xm=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}};
148
- _.an=function(a,b){b=void 0===b?{}:b;if(!a)return _.Zm();const c=[_.Zm()];let d=!1;for(let e of a)null!==e&&void 0!==e&&(_.jh(e)&&(e={source:e}),e.lowLatencyMode&&!d&&(c.push({streaming:{rebufferingGoal:.1,bufferLimitUpdateInterval:.01,attemptParameters:{maxAttempts:3,baseDelay:250,backoffFactor:1}},abr:{bandwidthUpgradeTarget:.6,bandwidthDowngradeTarget:.95},manifest:{lowLatencyMode:!0}}),d=!0),c.push(e),b.Mi||null==e.suggestedPresentationDelay||c.push({manifest:{suggestedPresentationDelay:e.suggestedPresentationDelay}}));
149
- a=_.ch.apply(null,c);_.jh(a.volume)&&(""===""+a.volume?a.volume=null:a.volume=Number(a.volume));if(!_.z(a.volume)&&(!_.kh(a.volume)||mh(a.volume)))throw new _.I(_.D,7,7100,"config.volume is not a number");if(!_.z(a.preferredTextLanguage)&&!_.jh(a.preferredTextLanguage)&&!Array.isArray(a.preferredTextLanguage))throw new _.I(_.D,7,7100,"config.preferredTextLanguage is not a string or an array");if(!_.z(a.preferredAudioLanguage)&&!_.jh(a.preferredAudioLanguage)&&!Array.isArray(a.preferredAudioLanguage))throw new _.I(_.D,
150
- 7,7100,"config.preferredAudioLanguage is not a string or an array");if(!_.z(a.preferredAudioCodec)&&!_.jh(a.preferredAudioCodec)&&!Array.isArray(a.preferredAudioCodec))throw new _.I(_.D,7,7100,"config.preferredAudioCodec is not a string or an array");if(!_.z(a.preferredVideoCodec)&&!_.jh(a.preferredVideoCodec)&&!Array.isArray(a.preferredVideoCodec))throw new _.I(_.D,7,7100,"config.preferredVideoCodec is not a string or an array");if(!_.z(a.drm)){if(a.drm.env&&!_.jh(a.drm.env))throw new _.I(_.D,7,
151
- 7100,"config.drm.env is not a string");if(a.drm.offlineId&&!_.jh(a.drm.offlineId))throw new _.I(_.D,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(!_.kh(b.bufferingGoal)||mh(b.bufferingGoal))throw new _.I(_.D,7,7100,"config.streaming.bufferingGoal is not a number");if(!_.kh(b.rebufferingGoal)||
152
- mh(b.rebufferingGoal))throw new _.I(_.D,7,7100,"config.streaming.rebufferingGoal is not a number");if(b.rebufferingGoal>b.bufferingGoal)throw new _.I(_.D,7,7100,"config.streaming.rebufferingGoal must be \x3e\x3d bufferingGoal");if(!_.kh(b.bufferBehind)||mh(b.bufferBehind))throw new _.I(_.D,7,7100,"config.streaming.bufferBehind is not a number");if(!_.kh(b.smallGapLimit)||mh(b.smallGapLimit))throw new _.I(_.D,7,7100,"config.streaming.smallGapLimit is not a number");if(!_.kh(b.durationBackoff)||mh(b.durationBackoff))throw new _.I(_.D,
153
- 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 _.I(_.D,7,7100,"Invalid value for |manifest.availabilityWindowOverride|");$m(a.restrictions);$m(a.abr.restrictions);a.abr.initialRestrictions&&$m(a.abr.initialRestrictions)}return a};
154
- $m=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);
155
- 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 _.I(_.D,7,7100,"Restrictions contain NaN");};bn=function(a){return typeof a===_.He&&!Array.isArray(a)&&"source"in a};
156
- cn=function(a){if(!a)return null;a=(new _.qm(a)).a.pathname.toUpperCase();return a.endsWith(".MPD")?_.vc:a.endsWith(".M3U8")?_.tl:a.endsWith(".MP4")?_.zg:a.endsWith(".MP3")?"audio/mp3":a.endsWith("MANIFEST")||a.endsWith(".ISM")?_.Cc:null};_.en=function(a){let b;bn(a)?b=a.source:b=a;Array.isArray(b)||(b=[b]);b=b.filter(c=>typeof c===_.Tf||"url"in c);a=[];for(let c=0;c<b.length;c++){const d=dn(b[c]);d&&a.push(d)}return a};
157
- dn=function(a){let b=null;_.jh(a)&&(a={url:a});typeof a===_.He&&!Array.isArray(a)&&"url"in a&&(b={url:a.url,type:a.type?a.type:null},_.z(a.drmProtected)||typeof a.drmProtected!==_.Nc||(b.drmProtected=a.drmProtected),_.z(a.isLive)||typeof a.isLive!==_.Nc||(b.isLive=a.isLive),_.z(a.name)||typeof a.name!==_.Tf||(b.name=a.name),_.z(a.dc)||typeof a.dc!==_.Tf||(b.dc=a.dc),_.z(a.lb)||typeof a.lb!==_.Tf||(b.lb=a.lb));b&&!b.type&&(b.type=cn(a.url),b.type?fn.debug("Detect media type "+b.type+" for "+a.url):
158
- fn.warn("Unable to detect media type for "+a.url));return b};gn=function(a,b){a.onError(b);a.release().then(()=>a.destroy())};_.jn=function(a){_.hn[a.I]=a};
159
- _.ln=function(a){const b={attemptParameters:_.rk(),enforceSingleSession:!1,delayLicenseRequestUntilPlayed:!1,enableSessionCacheForSkd:!1,ignoreUnrecognizedInitData:!0,La:{},widevineVersion:_.wd};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!==
160
- a.ignoreUnrecognizedInitData&&(b.ignoreUnrecognizedInitData=!!a.ignoreUnrecognizedInitData),typeof a.widevineVersion===_.Tf&&0<a.widevineVersion.length&&(b.widevineVersion=a.widevineVersion),a.env)){const c=_.hn[a.env]||null;if(!c)throw _.xh(_.ua,_.ib+a.env+_.aa),new _.I(_.D,6,6015,`DRM environment '${a.env}' is missing.`);b.La=_.kn(c,a.customData)||{};_.ui(a.env.toLowerCase(),Rd)&&(b.enforceSingleSession=!0)}return b};
161
- nn=function(a){var b=mn;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=_.am(e);return h.verify(k,l,n.buffer,m.buffer)}).then(function(l){l?f():g(new _.pl("Signature Verification failed",jg))}).catch(g)}else f()})};
162
- pn=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 on(b[0],b[1],b[2]);a.a=b}return a.a};qn=function(a){return _.w(function*(){var b=pn(a);try{yield nn(b)}catch(c){if(c&&c.code===jg)throw c;b=new _.qm(window.location.href);if(!/(^127\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)|(^localhost)/.test(b.a.hostname))throw c;}})};
163
- rn=function(a){switch((a.ha[0]||{src:"",type:""}).type){case _.vc:a="dash";break;case _.Cc:a="ss";break;case _.tl:a="hls";break;case _.zg:a="mp4";break;default:a=""}return a};sn=function(a){return a.viewerId?a.viewerId:(a=a.drm||null)&&a.customData&&a.customData.userId?`${a.customData.userId}`:""};tn=function(a){return(a=a.drm||null)&&a.customData&&a.customData.assetId?`${a.customData.assetId}`:""};
164
- un=function(a){return(a=a.drm||null)&&a.customData&&a.customData.sessionId?`${a.customData.sessionId}`:""};vn=function(a){return(a=(a=a.drmInfo)&&a.licenseServerUri||"")?(new _.qm(a)).a.hostname:""};wn=function(a){const b=a.configuration;let c="no";b.drm&&!_.lh(b.drm,{})&&(c="custom",b.drm.env&&b.drm.env.toLowerCase().startsWith(Rd)||vn(a).endsWith("drmtoday.com"))&&(c=Rd);return c};
165
- xn=function(a){a=a.drmInfo;let b="";if(a)switch(a.keySystem){case _.wd:b="wv";break;case _.ud:b="pr";break;case _.sd:b="fps"}return b};yn=function(a){a=a.drmInfo;let b=!1;a&&(b=a.persistentStateRequired);return b.toString()};zn=function(a){a=a.drmInfo;let b="";if(a)switch(a.videoRobustness){case Ha:case Fa:b="L1";break;case Ga:b="L2";break;case _.pb:case _.ob:b="L3"}return b};
166
- En=function(a,b){const c="ie"===_.lj().browser;var d=b.configuration;const e=[...Array.from(_.Jh.keys()),...b.Mg];b={"CL-KEY":a.f,"CL-LOCATION":window.location.href,"CL-SDK-VERSION":_.ea,"CL-USER-ID":sn(d),"CL-ASSET-ID":tn(d),"CL-SESSION-ID":un(d),"CL-PLAYBACK-TYPE":b.isLive?An:Bn,"CL-CONTENT-TYPE":rn(b),"CL-PLUGINS":e.join(" "),"CL-DRM":wn(b),"CL-DRM-CDM":xn(b),"CL-DRM-SEC-LEVEL":zn(b),"CL-DRM-OFFLINE":yn(b),"CL-DRM-IP":vn(b)};Cn&&Cn.companionSdk&&(Cn.companionSdk.name&&(b["CL-COMPANION-SDK"]=Cn.companionSdk.name),
167
- Cn.companionSdk.version&&(b["CL-COMPANION-SDK-VERSION"]=Cn.companionSdk.version));c&&(d=window.localStorage.getItem("cl_et"))&&(b["CL-ETAG"]=d);d=_.vk(["https://downloads.castlabs.com/r/register/"]);d.method="GET";d.headers=b;return(new _.Dn).fetch(d).V.then(f=>{200===f.status&&c&&window.localStorage.setItem("cl_et",f.headers.etag);return Promise.resolve()}).catch(f=>{a:{var g=pn(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";
168
- 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.";break;default:g=Promise.resolve();break a}a.g.error(La+k);g=Promise.reject(new _.I(_.D,7,g,k))}}return g})};
169
- _.Gn=function(a){var b=(a||"").split("-");a=b[0]||"";b=b[1]||"";a=a.toLowerCase();a=Fn.get(a)||a;return(b=b.toUpperCase())?a+"-"+b:a};_.Hn=function(a,b){a=_.Gn(a);b=_.Gn(b);return a.split("-")[0]===b.split("-")[0]};
170
- Ln=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}=In(c[e]);Object.keys(Jn).includes(f)&&(d[Jn[f]]=g)}return d}).filter(c=>_.fh(c));return 0<b.length?b:null}catch(b){return Kn.error("CmsdManager parseCmsdDynamicHeader_ failed:",b),null}};
171
- In=function(a){var b=a.split("\x3d");const c=b[0];b=b[1];if(!c)throw new _.pl("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 _.pl(`Parsing CMSD, not recognized value type of ${a}`);};
172
- Nn=function(a){return b=>{{var c=b.headers;let e=b=null;var d=ph(c,"cmsd-dynamic");c=ph(c,"cmsd-static");d&&(b=Ln(d),a.a=b);if(c)try{d={};const f=c.split(",");for(c=0;c<f.length;c++){const {key:g,value:h}=In(f[c]);Object.keys(Mn).includes(g)&&(d[Mn[g]]=h)}e=_.fh(d)?d:null}catch(f){Kn.error("CmsdManager parseCmsdStaticHeader_ failed:",f),e=null}(b||e)&&a.m.trigger(new _.H("cmsd-event",{wj:b,Ij:e}))}}};_.Pn=function(a){a&&(0<=On.indexOf(a)||On.push(a))};
173
- Sn=function(a){if(!a.h&&a.A&&a.a&&a.f.ads.hls.enable&&a.getTimelineCues().some(b=>_.fk(b.schemeIdUri))){const b=new Qn;b.B(a.a,a.A,a.f.mse.sendPlaybackSessionIdHeader?a.F:null);Rn(a,b,a.f)}};Un=function(a,b){a.H=new Tn(b);qn(a.H).catch(c=>{setTimeout(()=>{a.g.error(La+c);a.trigger(new _.H(_.Xd,{detail:new _.I(_.D,7,7101)}));a.destroy()},1E3)})};Wn=function(a,b){a.W=b;for(const c of a.W)(b=c.id())&&(a.K[b]=c);_.Vn(a,"onPlayerCreated")};
174
- _.Xn=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))};
175
- Yn=function(a,b){_.w(function*(){a.j.getMedia()||a.j.getCastElement();a.H||(a.H=new Tn(a.f.license));try{a.g.debug("Verifying license remotely"),yield En(a.H,b),a.g.debug("License verified remotely")}catch(c){a.g.debug("License rejected by remote",c),setTimeout(gn,1E3,{release:a.release.bind(a),destroy:a.destroy.bind(a),onError:a.onError.bind(a)},c)}})};_.Vn=function(a,b,...c){if(!a.X)return Promise.resolve();const d=a.W.map(e=>e[b].call(e,a,...c)).filter(e=>e instanceof Promise);return Promise.all(d)};
176
- Zn=function(a){return _.w(function*(){if(a.R)return a.g.debug("The player is already released. No-op"),new Promise(b=>b());a.$.off(document,_.Dg);a.trigger(new _.H(_.xf));a.j&&a.j.release();a.h&&(yield a.h.w(),a.h=null);a.B&&(yield a.B.release(),a.B=null);if(a.a){let b=null;const c=a.a.on(_.Qf,d=>{b=d});return _.Vn(a,_.Me).then(()=>{a.a.stopForwardingEventsTo(a);return Promise.all([a.a.release(),a.I.release()])}).then(()=>{a.g.debug("Releasing player completed");b&&(a.g.debug("Re-post state change event after release"),
177
- a.trigger(b))}).finally(()=>{a.a.off(_.Qf,c);a.trigger(new _.H(wf))})}a.trigger(new _.H(wf));return new Promise(b=>b())})};$n=function(a){a.F&&(a.g.info("Playback session ended, ID:",a.F),a.F=null,a.a&&a.a.setPlaybackSessionId(null))};ao=function(a,b){const c=Ch(d=>d.f(_.cb)&&a.every(e=>2===d.canPlay(e,b)));if(!c)throw new _.I(_.D,7,7003,"No compatible player implementing playlist mode found!");return{nb:c,player:c.create(),sourceIndex:0}};
178
- co=function(a,b,c){if(a.M===_.cb)b=ao(b,c);else if(2!==(a.a?a.a.canPlay(b[0],c):0)||a.S){a.S=!1;if(b){var d=a=null;for(var e=0;e<b.length;e++);e=Object.values(_.zh);for(let f=0;f<b.length;f++)for(let g=0;g<e.length;g++){const h={nb: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?(_.Ah.debug("Player Factory '"+a.nb.a()+"' can play",b[d]),b=new bo(a.nb,d)):(_.Ah.debug("No compatible Player Factory found for sources:",b),b=null)}else b=
179
- null;if(!b)throw new _.I(_.D,7,7003,"No player factory compatible with given sources found!");c=b.nb;a=c.create();b={nb:c,player:a,sourceIndex:b.sourceIndex}}else b={nb:a.A,player:a.a,sourceIndex:0};return b};
180
- _.io=function(a,b,c){return _.w(function*(){if(a.N)throw new _.I(_.D,7,7E3,"Player is already destroyed.");if(!a.j)throw new _.I(_.D,7,7E3,"No surface associated with this player!");_.vm(bf);yield a.release();var d=c||_.en(b);if(!b||0===d.length)throw new _.I(_.D,7,7003,Wa);a.da=d;a.f=_.an([a.C,b,{source:d}]);a.R=!1;d=co(a,d,a.f);_.Xn(a,d.player,d.nb);eo(a,a.a);a.a&&a.a.setSourceIndex(d.sourceIndex);fo(a);a.a&&a.a.setCdnErrorCallback(a.L);_.go(a,a.f);ho(a);if(a.f.pauseWhenInBackground)a.$.on(document,
181
- _.Dg,()=>{document.hidden?(a.g.debug("Player is hidden: pausing..."),a.pause()):(a.g.debug("Player is visible: resuming..."),a.play())});Qh(a);yield _.Vn(a,"onContentWillLoad",a.f.source[d.sourceIndex]);_.vm(af);_.xm("player.beforeLoad",bf,af)})};_.jo=function(a){return _.w(function*(){a.j.getMedia()||a.j.getCastElement();a.trigger(new _.H(se));yield Promise.all([a.a.load(a.f),a.h?a.h.load():Promise.resolve()])})};
182
- _.lo=function(a){return _.w(function*(){_.vm(Ye);Yn(a,{configuration:a.getConfiguration(),ha:a.rg(),drmInfo:a.getDrmInfo(),Mg:Object.keys(a.K),isLive:a.isLive()});ko(a);Rh(a);yield _.Vn(a,_.Je);a.f.autoplay&&(a.h?a.h.A():1)&&(yield a.play());_.vm(Xe);_.xm("player.afterLoad",Ye,Xe)})};mo=function(a){return _.w(function*(){if(a.a){var b=a.a;b.bh?(a.trigger(new _.H(se)),yield b.bh(),yield _.lo(a)):a.g.warn(kb)}else a.g.warn(gb)})};
183
- eo=function(a,b){try{var c=crypto.randomUUID()}catch(d){c=wl()}a.g.info("Playback session started, ID:",c);b.setPlaybackSessionId(c);a.F=c};fo=function(a){a.a&&a.a.setDrmCustomDataModifier(b=>_.w(function*(){a.Ve&&a.Qc&&(yield a.Qc(b))}))};_.go=function(a,b){b=b||a.f;var c=Ih(a,b);c&&(c=c.create(a),Rn(a,c,b))};ho=function(a){a.f.cmsd.enabled&&(a.B=new no(a),a.a.setCmsdManager(a.B))};
184
- oo=function(a){const b=_.Zh(a.f.preferredTextLanguage).filter(f=>f),c=a.f.preferForcedSubtitles,d=a.getTrackManager().sa().filter(f=>c?f.kind===_.Zd:f.kind!==_.Zd);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().ra();e&&e.language?(e=_.Gn(e.language||""),b.push(e)):(e=a.getTrackManager().Ha())&&e.language&&(e=_.Gn(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=>
185
- {const g=_.Gn(f);if(f=d.find(h=>{h=_.Gn(h.language||"");return _.Hn(h,g)}))return a.getTrackManager().Za(f),!0;c&&a.g.warn("Forced subtitles are configured to be preferred, but no forced subtitles match the preferred languages: ",b);return!1})}};ko=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);oo(a)})};Rn=function(a,b,c){a.h=b;b.h(null==c.volume?1:c.volume);b.setMuted(c.muted||!1)};
186
- ro=function(a,b){return _.w(function*(){yield po(a,()=>Promise.all(qo(a).map(b)))})};so=function(a,b){_.w(function*(){yield po(a,()=>Promise.all(a.f.filter(c=>null!=c.getLoadedSource()).map(b)))})};qo=function(a){return[a.Ec,...a.f].filter(b=>null!=b)};po=function(a,b){return _.w(function*(){a.a&&(yield a.a);a.a=b().then(()=>{a.a=null})})};uo=function(a){return to(a).filter(b=>b.type===td&&!b.jf)};vo=function(a){a.forEach(b=>{b.jf=!0})};
187
- zo=function(a,b){a=a.map(c=>({startTime:c.startTime,endTime:c.endTime,key:c.value.key,value:c.value.data,xg:!1}));a=wo(a);b&&(a=xo(a));return new Set(yo(a))};to=function(a){const b=[];for(const c of a)b.push(c);return b};Ao=function(a,b){const c=a.endTime-a.startTime,d=b.endTime-b.startTime,e=a.eg||a.startTime,f=b.eg||b.startTime;return(Infinity===c&&Infinity===d||.01>Math.abs(c-d))&&.5>Math.abs(e-f)&&a.value.key===b.value.key&&a.value.data===b.value.data};
188
- yo=function(a){const b=[];for(const c of a)(a=b.find(d=>d.startTime===c.startTime&&d.endTime===c.endTime))?Bo(c,a):(a=Co(c),b.push(a));return b};Bo=function(a,b){if(a.key.startsWith("X-"))b.customAttributes||(b.customAttributes={}),b.customAttributes[a.key]=a.value,"X-CUSTOM-ID"===a.key&&(b.id=a.value);else if("SCTE35-OUT"===a.key||"SCTE35-IN"===a.key)b.schemeIdUri=_.rg,b.type=_.Gf};
189
- Co=function(a){var b=a.startTime;const c=a.endTime;b={schemeIdUri:"",value:"",startTime:b,endTime:c,id:`T${b.toFixed(2)}-${c.toFixed(2)}`,type:_.de,eventElement:null};Bo(a,b);return b};wo=function(a){const b=new Set(a),c=new Set(a.filter(d=>"SCTE35-OUT"===d.key).map(Do));a.filter(d=>"SCTE35-IN"===d.key).forEach(d=>{c.has(Do(d))||(d.xg=!0)});return Array.from(b.values())};xo=function(a){a.forEach(b=>{b.xg&&(b.endTime=b.startTime,b.startTime=0)});return a};Do=function(a){return`${a.startTime}-${a.endTime}`};
190
- Io=function(a,b){a.g.debug("onMetadataTrackAdded_()");b.mode=_.ce;var c=!b.cues||0===b.cues.length;if(a.m.isLive()||!c){var d=b.cues;c=uo(d);vo(c);a.a=zo(c,a.l);0<a.a.size&&(Eo(a,a.a),a.m.trigger(new _.H(_.eg)));a.j.on(b,_.Bd,()=>{{const l=a.m.getPosition();for(const m of a.a){var e,f=a,g=m,h=l;if(Infinity===g.endTime){if(e=!f.f.has(g)){e=g.startTime;var k=e+.5;e=e<=h&&h<=k}e&&(f.f.add(g),f.m.trigger(new _.H(_.cg,{detail:g})))}else h=g.startTime<=h&&h<=g.endTime,!h&&f.f.has(g)?(f.f.delete(g),f.m.trigger(new _.H(_.dg,
191
- {detail:g}))):h&&!f.f.has(g)&&(f.f.add(g),f.m.trigger(new _.H(_.cg,{detail:g})))}}});a.m.isLive()&&(a.h=setInterval(()=>{if(b.cues){var e=a.m.getSeekRange().start;var f=[];for(var g of b.cues)g.endTime<e&&f.push(g);Fo(a,b,f);0<f.length&&a.g.debug(`Evicted ${f.length} old cues.`);for(var h of a.a)h.endTime<e&&a.a.delete(h);e=0<f.length}else e=!1;Go(a,b);f=uo(d);var k=zo(f,a.l);g=new Set;h=!1;for(l of k)(k=Ho(a,l))?(l.customAttributes&&(k.customAttributes=_.ch(k.customAttributes||{},l.customAttributes)||
192
- void 0),h=!0):(a.a.add(l),g.add(l));var l={ri:g,uh:0<g.size||h};const {ri:m,uh:n}=l;vo(f);(e||n)&&a.m.trigger(new _.H(_.eg));Eo(a,m)},6E3))}};Jo=function(a,b){a.j.on(b,_.oc,c=>{c=c.track;c.kind===_.Ae&&Io(a,c)})};Eo=function(a,b){for(const c of b)a.m.trigger(new _.H(_.bg,{detail:c}))};Ho=function(a,b){return Array.from(a.a.values()).find(c=>b.startTime===c.startTime&&b.endTime===c.endTime)||null};
193
- Go=function(a,b){if(b.cues){var c=to(b.cues).filter(f=>f.type===td),d=c.filter(f=>f.jf);c=c.filter(f=>!f.jf);var e=[];for(const f of c)for(const g of d)Ao(f,g)&&(e.push(f),g.eg=f.startTime);Fo(a,b,e);0<e.length&&a.g.debug(`Removed ${e.length} duplicated cues.`)}};Fo=function(a,b,c){for(const d of c)try{b.removeCue(d)}catch(e){a.g.debug("Failed to remove cue",d,e)}};
194
- Ko=function(a,b){b=b.track;b.kind!==_.Ae&&(b.mode===_.Jf&&(b.mode=_.ce),a.a.on(b,_.Bd,c=>{c=c.target||c.srcElement;c.mode=_.ce;c.activeCues&&(c=Array.from(c.activeCues).map(a.o),a.l.append(c,[]))}))};_.L=function(a,b,c,d){d=void 0===d?{}:d;a=a.getAttribute(b);if(!a&&d.required)throw new _.I(_.D,4,4023,`Required attribute missing: ${b}`);return a?a.value:c||null};Lo=function(a,b){3===b.type&&(a.f&&(a.g.debug("Attaching tracking token"),b.headers[Ng]=a.f),a.a&&(b.headers[Og]=a.a))};
195
- Mo=function(a,b){return b.request&&3===b.request.type&&(a.f=b.headers[Ng],a.a=b.headers[Og],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(_.am(b))),{delay:a.renewalPeriod,mj:{maxAttempts:a.retryCount,baseDelay:1E3*a.retryPeriod,backoffFactor:1,fuzzFactor:0,timeout:0}}):null};
196
- _.Oo=function(a){a=No[a];if(!a)return null;const b=_.lj();return b.os===ej&&4===b.osVersion.major&&4===b.osVersion.minor?null:new Uint8Array(a)};_.Po=function(a,b){return void 0===a?b:null===a?null:typeof a===_.Tf?_.Oo(a):a};
197
- _.kn=function(a,b){const c={};var d=b?b.widevineVideoRobustness:void 0;const e=b?b.widevineAudioRobustness:void 0,f=b?b.serverCertificate:void 0;let g=a.f[_.wd];g&&(c[_.wd]={licenseUrl:g.licenseUrl,videoRobustness:Lm(d,g.videoRobustness),audioRobustness:Lm(e,g.audioRobustness),modifiers:g.modifiers,distinctiveIdentifierRequired:Km(b?b.widevineDistinctiveIdentifierRequired:void 0,g.distinctiveIdentifierRequired,!1),persistentStateRequired:Km(b?b.widevinePersistentStateRequired:void 0,g.persistentStateRequired,
198
- !1),serverCertificate:_.Po(f,g.serverCertificate)});(g=a.f[_.sd])&&(c[_.sd]={licenseUrl:g.licenseUrl,certificateUrl:g.certificateUrl,modifiers:g.modifiers});d=b?b.playReadyVideoRobustness:void 0;b=b?b.playReadyAudioRobustness:void 0;(g=a.f[_.ud])&&(c[_.ud]={licenseUrl:g.licenseUrl,videoRobustness:d||g.videoRobustness,audioRobustness:b||g.audioRobustness,individualizationServer:g.individualizationServer,useLegacySystem:g.useLegacySystem,modifiers:g.modifiers});return c};
199
- _.Qo=function(){throw new _.I(_.D,3,3E3);};_.Ro=function(a,b,c){const d=c||0;c=b.byteLength-d;const e=_.G(a.f.buffer);b=_.G(b.buffer,d,c);try{e.set(b,a.a),a.a+=c}catch(f){_.Qo()}};_.M=function(a,b){try{a.f.setUint32(a.a,b,a.h),a.a+=4}catch(c){_.Qo()}};_.So=function(a){return a.a<a.f.byteLength};_.To=function(){throw new _.I(_.D,3,3E3,"Buffer read out of bounds.");};_.Uo=function(a){try{const b=a.f.getUint8(a.a);a.a+=1;return b}catch(b){_.To()}};
200
- _.Vo=function(a){try{const b=a.f.getUint16(a.a,a.h);a.a+=2;return b}catch(b){_.To()}};_.N=function(a){try{const b=a.f.getUint32(a.a,a.h);a.a+=4;return b}catch(b){_.To()}};_.Wo=function(a){try{const b=a.f.getInt32(a.a,a.h);a.a+=4;return b}catch(b){_.To()}};_.Xo=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){_.To()}if(2097151<c)throw new _.I(_.D,3,3001);a.a+=8;return c*Math.pow(2,32)+b};
201
- Yo=function(a,b){const c=new Uint8Array(b);for(let d=0;d<b;d++)c[d]=_.Uo(a);return c};_.Zo=function(a,b){a.a+b>a.f.byteLength&&_.To();var c=a.a+a.f.byteOffset;c=a.f.buffer.slice(c,c+b);a.a+=b;return _.G(c)};$o=function(a){let b=0;for(let c=0;c<a.length;c++)b=b<<8|a.charCodeAt(c);return b};_.ap=function(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)};_.bp=function(a){for(;_.So(a.reader)&&!a.parser.a;)a.parser.we(a.start+a.headerSize,a.reader,a.partialOkay)};
202
- _.cp=function(a){for(let b=_.N(a.reader);0<b&&!a.parser.a;--b)a.parser.we(a.start+a.headerSize,a.reader,a.partialOkay)};_.dp=function(a){return b=>{const c=b.reader.Sa()-b.reader.getPosition();a(_.Zo(b.reader,c))}};_.ep=function(a){return 8+(a.has64BitSize?8:0)+(null!=a.flags?4:0)};fp=function(a){let b="";try{b=_.qi(a)}catch(c){}return b};_.hp=function(a){a=fp(a);let b="";a.length&&(b=(new _.gp(a)).a);return b};
203
- jp=function(a){if(!a)return null;let b=null;try{const c=JSON.parse(_.ni(a)),d=_.am(c.sinf[0]);(new _.ip).O(_.Mf,_.bp).O("schi",_.bp).O("tenc",e=>{e.reader.skip(6);_.Uo(e.reader)&&(e.reader.skip(1),b=_.cm(_.Zo(e.reader,16)));e.parser.stop()}).parse(d)}catch(c){}return b};
204
- lp=function(a,b,c){if(!c||!c.byteLength)throw new _.I(_.D,6,6102);let d;typeof b===_.Tf?d=_.si(b,!0):d=b;a=_.si(fp(a),!0);b=new _.kp(12+a.byteLength+d.byteLength+c.byteLength,!0);_.M(b,a.byteLength);_.Ro(b,_.G(a));_.M(b,d.byteLength);_.Ro(b,_.G(d));_.M(b,c.byteLength);_.Ro(b,_.G(c));return _.G(b.buffer)};_.mp=function(a){var b=_.G(a.body);b=_.$l(b);a.headers[ta]=Dc;a.body=_.ri("spc\x3d"+b).buffer};
205
- _.np=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(_.am(b))};sp=function(a,b){b=op(b);if(a===_.wd)return b+pp;if(a===_.ud)return b+qp;if(a===_.sd)return b+rp;throw Error("Unknown DRM Key-System '"+a+"'. Can not infer license URL!");};
206
- _.vp=function(a,b,c,d){d=void 0===d?!0:d;c=a.drm;c&&c.env.startsWith(wa)?c.customData&&(_.up(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)):tp.warn(Ta)};
207
- _.wp=function(a,b){try{const c=_.G(b.data),d=JSON.parse(String.fromCharCode.apply(null,c));tp.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){tp.debug("Unable to parse DRMtoday response JSON, assuming the response contained raw data")}};
208
- _.yp=function(a,b,c){var d=c&&c.customData&&c.customData.fpsContentId;_.vp(a,b,c,!1);b.headers[ta]=Dc;c={spc:_.Zl(b.body)};if((a=a.drm)&&a.env.startsWith(ya)&&d){a={};var e=Om((new _.gp(xp(d))).f);d=e.keyId;if(e=e.assetId)tp.info("Applying assetId from HLS manifest."),a.assetId=e;d&&(tp.info("Applying keyId from HLS manifest."),a.keyId=d);d=a;d.keyId&&(tp.info("Adding keyID to FPS payload:",d.keyId),c.keyId=d.keyId);d.assetId&&(tp.info("Adding assetID to FPS payload:",d.assetId),c.assetId=d.assetId)}b.body=
209
- _.ti(_.Nm(c,!0))};_.zp=function(a,b){tp.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=_.am(a).buffer)};
210
- _.Ap=function(a,b,c){b=fp(b);c=c&&c.customData?c.customData:{};b=new _.gp(xp(b));const d=Om(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,tp.debug("Using assetId from the configuration instead of the value from the HLS manifest."));e&&_.wi(`${e}`)&&(d.variantId=e,tp.info("Using variantId from the configuration instead of the value from the HLS manifest."))}d.keyId?(a=["keyId"],tp.debug("KeyId found in FPS SKD. Removing other parameters")):
211
- a=["assetId","variantId"];b.f=_.Nm(d,!1,a);"/"!==b.path||b.j.includes(`${b.a}/`)||(b.path="");b=_.Mm(b);return c.fpsContentId=b};_.Bp=function(a,b){a=a.drm;if(!a||!a.env.startsWith(wa))tp.warn(Ta);else if(a.customData&&a.customData.merchant&&!a.env.startsWith(ya)){const c=new _.qm(b.uris[0]);let d=c.a.pathname;d.endsWith("/")||(d+="/");d+=a.customData.merchant;c.a.pathname=d;b.uris[0]=c.toString()}};
212
- Cp=function(a,b,c){_.vp(a,b,c);a=a.drm;a=!(!a||!a.offlineId);c=new _.qm(b.uris[0]);c.a.searchParams.set(_.Te,a.toString());b.uris[0]=c.toString()};op=function(a){if(a===Dp)return"https://lic.drmtoday.com";if(a===Ep)return"https://lic.staging.drmtoday.com";if(a===Fp)return"https://lic-demo.staging.drmtoday.com";if(a===Gp)return"https://lic.test.drmtoday.com";throw Error("Unknown DRMtoday environment '"+a+"'. Can not infer DRMtoday base URL!");};
213
- xp=function(a){a=a.replace(/assetid/gi,"assetId");a=a.replace(/variantid/gi,"variantId");return a=a.replace(/keyid/gi,"keyId")};_.up=function(a,b){if((b=b.drm)&&b.customData){var c={userId:b.customData.userId,sessionId:b.customData.sessionId,merchant:b.customData.merchant};_.fh(c)&&(a.headers["dt-custom-data"]=btoa(JSON.stringify(c)));(b=b.customData.authToken)&&(a.headers["x-dt-auth-token"]=b)}};
214
- Ip=function(a){const b={},c=a?a[Pg]:void 0;a=Hp[a?a[Pg]:void 0];c&&(b.drmTodayErrorCode=c);a&&(b.drmTodayErrorMessage=a);return b};Jp=function(a){a=a["x-dt-li"];if(!a)return null;try{const b=JSON.parse(atob(a));a={};b.ti&&(a.requestId=b.ti);b.rpd&&(a.delay=Number(b.rpd)/1E3);return a}catch(b){return tp.warn("Unable to parse DRMtoday License Info header (x-dt-li)",b),null}};Kp=function(a,b){a.size=void 0===b?0:1;a.g.debug("Setting key status to",b);a.a=b};
215
- Mp=function(a,b,c,d){b===HTMLMediaElement.HAVE_NOTHING||a.readyState>=b?d():(b=Lp.value().get(b),c.one(a,b,d))};
216
- Np=function(a,b){a.f=b;_.Xh(a.a);if(!b)return Promise.resolve();a.a.on(b,Ud,c=>{_.xh("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,Lg,c=>{{a.g.debug("Handle webkitNeedKey event");c=_.G(c.initData);if(_.ki(c).getUint32(0,!0)+4!==c.byteLength)throw new RangeError("Malformed FairPlay init data");c=pi(c.subarray(4),
217
- !0);c=_.ri(c);const d=new Event(Ud);d.initDataType="skd";d.initData=li(c);a.f.dispatchEvent(d)}});Mp(b,HTMLMediaElement.HAVE_METADATA,a.a,()=>b.webkitSetMediaKeys(a.h));return Promise.resolve()};Op=function(a,b){Kp(a.keyStatuses,b);b=new _.H(ie);a.dispatchEvent(b)};
218
- Rp=function(a,b){a.a=b;_.Xh(a.f);b&&(a.f.on(b,a.h+"needkey",c=>{{const d=new Event(Ud);d.initDataType=_.Wc;d.initData=li(c.initData);a.a.dispatchEvent(d)}}),a.f.on(b,a.h+"keymessage",c=>{{const e=Pp(a,c.sessionId);if(e){var d=void 0===e.keyStatuses.getStatus();c=new _.H(_.ze,{messageType:d?le:ke,message:c.message});d=e;_.xh("WebkitEmeManager.MediaKeySession.generated");d.f&&(d.f.resolve(),d.f=null);e.dispatchEvent(c)}else _.yh("Session not found",c.sessionId)}}),a.f.on(b,a.h+"keyadded",c=>{(c=Pp(a,
219
- c.sessionId))&&c.ready()}),a.f.on(b,a.h+"keyerror",c=>{var d=Pp(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?Qp(d,_.Re):1===e?Qp(d,"expired"):Qp(d,_.he))}}}))};
220
- Pp=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};Qp=function(a,b){Kp(a.keyStatuses,b);b=new _.H(ie);a.dispatchEvent(b)};Sp=function(a,b){return a.w?a.w+b.charAt(0).toUpperCase()+b.slice(1):b};
221
- Tp=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===_.Ue)if(c)d=_.G(_.ri("LOAD_SESSION|"+c));else{const f=_.ri("PERSISTENT|"),g=new Uint8Array(f.byteLength+b.byteLength);g.set(f,0);g.set(_.G(b),f.byteLength);d=g}else d=_.G(b)}catch(f){return Promise.reject(f)}a.f=new _.Gl;const e=Sp(a,"generateKeyRequest");try{a.j[e](a.h,d)}catch(f){if(f.name!==Ja)return a.f=null,Promise.reject(f);(new _.Li(()=>{try{a.j[e](a.h,d)}catch(g){a.f.reject(g),
222
- a.f=null}})).la(.01)}return a.f};Up=function(a,b,c){if(a.a)a.a.then(()=>Up(a,b,c)).catch(()=>Up(a,b,c));else{a.a=b;if(a.h===Hg){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=_.am(e.keys[0].k);e=_.am(e.keys[0].kid)}else d=_.G(c),e=null;var f=Sp(a,"addKey");try{a.j[f](a.h,d,e,a.sessionId)}catch(g){a.a.reject(g),a.a=null}}};
223
- Xp=function(a,b){var c=Vp;if(a){var d=c.find(e=>e.a()===a);if(d)return Wp.info(Jb+d.a()),d.create();Wp.info("Cannot create selected EME manager, falling back to the default.")}if(b&&(d=c.find(e=>e.a()===b)))return Wp.info(Jb+d.a()),d.create();c=c[0];if(!c)throw Error("Missing EME managers.");Wp.info(Jb+c.a());return c.create()};_.$p=function(a){var b=_.bm(a);b=parseInt(b.byteLength,10).toString(16);b=_.bm("12"+b+a);return new Yp(Zp,a,b)};
224
- _.bq=function(a){const b=new _.aq(new DataView(a.buffer,a.byteOffset,a.byteLength),!1);a=_.N(b);var c=_.N(b);c=_.ap(c);var d=_.N(b);const e=d>>>24;d&=16777215;var f=_.Zo(b,16);f=_.cm(f);if(0<e){var g=_.N(b);b.skip(16*g)}g=_.N(b);const h=()=>{let u=_.Uo(b),v=(u&127)>>>0,y=7;for(;128<=u&&28>=y;)u=_.Uo(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(!_.So(b))throw Error("not enough data to skip!");while(_.Uo(b)&128);break;case 1:b.skip(8);break;case 2:b.skip(h());
225
- 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(;_.So(b);){var n=h(),p=n&7;n>>>=3;if(2===p){p=h();if(0>p)throw Error(`unable to read length of field ${n}`);p=Yo(b,p);2===n?l.push(p):4===n&&(m=p)}else k(p)}_.xh("Parsed WV PSSH Box","size",a,"name",c,vg,e,"flags",d,"size",g,"systemId",f,"contentId (base64)",m?_.Zl(m):"","keyIds",l.map(u=>_.cm(u)));return 0<l.length?_.$p(_.cm(l[0])):null};
226
- _.cq=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=_.G(a);a.set(b,0);return a};
227
- _.hq=function(a){var b=_.O;a:{var c=new _.aq(new DataView(a.buffer),!0);_.N(c);for(_.Vo(c);_.So(c);)if(1===_.Vo(c)){var d=_.Vo(c);c=_.Zo(c,d);break a}c=null}c||(c=a);a=pi(c,!0);d=b.j(a,"WRMHEADER");a=d.getAttribute(vg)||"";d=b.h(d,"DATA");var e=b.h(d,"LA_URL");b=e?b.f(e):"";var f=_.O;if(e=f.h(d,"KID"))if(e=f.f(e)){var g=f.h(d,oa);f=g?f.f(g):null;e={value:e,Le:f}}else e=null;else e=null;d=e?[e]:(e=dq(d))?[e]:(d=eq(d))?d:null;const {value:h="",Le:k}=d&&d[0]||{};d=_.am(h);d=_.cq(d);d=_.cm(d);return new _.fq(_.gq,
228
- d,b,c,a,k)};dq=function(a){var b=_.O;a=b.h(a,"PROTECTINFO");if(!a)return null;var c=b.h(a,"KID");if(!c)return null;b=c.getAttribute("VALUE");if(!b)return null;a=c.getAttribute(oa);c=c.getAttribute("ALGID");return{value:b,Le:a,sh:c}};
229
- eq=function(a){var b=_.O;a=b.h(a,"PROTECTINFO");if(!a)return null;a=b.h(a,"KIDS");if(!a)return null;a=b.a(a,"KID");if(!a.length)return null;b=[];for(const c of a)if(a=c.getAttribute("VALUE")){const d=c.getAttribute(oa),e=c.getAttribute("ALGID");b.push({value:a,Le:d,sh:e})}return b.length?b:null};iq=function(a){return _.w(function*(){const b=new Promise(c=>{(new _.Li(c)).la(1)});(yield Promise.race([a.close().then(()=>!0),b.then(()=>!1)]))||_.C("Timeout waiting for session close")})};
230
- _.kq=function(a){return jq(a)?_.ud:a};lq=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};
231
- mq=function(a,b){b=b[_.kq(a.keySystem)];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=b.serverCertificate||null))};
232
- _.nq=function(a,b){b=_.Tm(a.mimeType,b||a.codecs);if(_.Hm(b,a.type)){a=a.type;var c=_.Hm(b,a);c&&(c=c(),b=c.convertCodecs(a,b),c.destroy())}return b};oq=function(a){for(const b of a.audioCapabilities||[])delete b.robustness;for(const b of a.videoCapabilities||[])delete b.robustness};qq=function(a){return(a.audioCapabilities||[]).some(pq)||(a.videoCapabilities||[]).some(pq)};
233
- rq=function(a,b){a=_.hp(b);_.xh("Using default Content ID extractor. The hostname part from HLS #EXT-X-KEY:URI skd:// will be used.","Extracted Content ID: "+a);return a};
234
- tq=function(a){var {playerConfig:b,initData:c,initDataType:d,drmInfo:e,drmSystemConfig:f,sessionContext:g,emeApi:h}=a;if("skd"===d&&h===sq){a=e.serverCertificate;let k=f&&f.modifiers&&f.modifiers.extractContentId;_.hh(k)||(k=rq);let l="";try{l=k(b,c,g)}catch(m){throw new _.I(_.D,6,6103);}if(!l.length)throw new _.I(_.D,6,6101,"Content ID is an empty string");c=lp(c,l,a)}return c};jq=function(a){return!!a.match(/^com\.(microsoft|chromecast)\.playready/)};
235
- pq=function(a){return null!=a.robustness&&""!==a.robustness};uq=function(a,b,c,d,e){for(const f of a){b.includes(f.licenseServerUri)||b.push(f.licenseServerUri);f.serverCertificate&&(c.some(g=>_.dm(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])}};
236
- vq=function(a){var b=a.o;const c=a.X;c.clear();b.forEach((d,e)=>c.set(e,d));b=Array.from(c.values());b.length&&b.every(d=>"expired"===d)&&a.w(new _.I(_.D,6,6014));a.D.df(_.oh(c));a.A||a.g.info(va);a.A=!0;a.F=!1};wq=function(a){a.h.forEach((b,c)=>{const d=b.$e;let e=c.expiration;isNaN(e)&&(e=Infinity);e!==d&&(a.D.cf(c.sessionId,e),b.$e=e)})};
237
- xq=function(a){return _.w(function*(){a.B.release();a.B=null;a.M.release();a.M=null;a.A=!1;a.F=!1;a.H.reject();a.$.stop();a.$=null;a.U.stop();a.U=null;const b=Array.from(a.h.keys());for(const c of a.h.values())c.Oc&&c.Oc.stop();a.h.clear();yield Promise.all(b.map(c=>Promise.resolve().then(()=>_.w(function*(){a.g.debug("Closing session",c.sessionId);try{yield iq(c)}catch(d){a.g.warn("Error while closing session",d)}}))));if(a.C){try{yield a.l.h(null)}catch(c){a.g.warn("Error while resetting media keys",
238
- c)}a.C=null}a.l=null;a.a=null;a.J.clear();a.I=null;a.L=[];a.f=null;a.w=null;a.D=null;a.R=0;a.N=null})};_.Dq=function(a,b){const c=yq(a,b),d=zq(b);for(const e of d)Aq(a,e,a.f.La);b=Bq(a,b);if(!b.size)return a.S=!0,Promise.resolve();_.vm(Hd);a=_.Cq(a,b);return(c?a:a.catch(()=>{})).then(()=>{_.vm(Gd);_.xm("DRM queryMediaKeys_()",Hd,Gd)})};
239
- _.Fq=function(a,b,c){c=void 0===c?[]:c;a.K=Eq;a.L=c;a.G=0<c.length;a.g.debug("Using Persisted Licenses: "+a.G);a.f&&a.f.enableSessionCacheForSkd&&a.g.info("Enabled session cache for SKD license requests");return _.Dq(a,b)};
240
- _.Cq=function(a,b){if(1===b.size&&b.has(""))return Promise.reject(new _.I(_.D,6,6E3));null===a.l&&(a.l=Xp(a.f.emeApi,a.kb));for(var c of b.values())0===c.audioCapabilities.length&&delete c.audioCapabilities,0===c.videoCapabilities.length&&delete c.videoCapabilities;let d=c=new _.Gl;const e=_.lj(),f=(k,l,m)=>{l.drmInfos.some(n=>!!n.licenseServerUri)===k&&(d=d.catch(()=>{if(a.j)return null;if(m===_.ud){if((_.Ni()||e.os===gj&&_.Oi("Chrome")&&!_.Ni())&&!a.f.La[m].useLegacySystem)return l.label=vd,a.l.a(vd,
241
- [l]).catch(()=>{a.g.warn("Unable to create com.microsoft.playready.recommendation. Falling back to com.microsoft.playready.");l.label=_.ud;oq(l);return a.l.a(m,[l])});oq(l)}if(m===_.wd&&a.f.widevineVersion!==_.wd){const n=a.f.widevineVersion;if(!n.startsWith(_.wd))return a.g.error(`Invalid "widevineVersion" value "${n}".`),Promise.reject();const p=Object.assign({},l,{label:n,distinctiveIdentifier:_.Pe,persistentState:_.Pe});return a.l.a(n,[p]).catch(()=>a.l.a(m,[l]))}return a.l.a(m,[l]).catch(n=>
242
- {a:{if(m===_.wd&&qq(l)){const p=_.lj();if(qq(l)&&p.os===ej&&p.browser===$c){a.g.warn("requestMediaKeySystemAccess() failed",n);a.g.warn("Will try to recover by removing the robustness attribute of videoCapabilities and audioCapabilities.");oq(l);n=a.l.a(m,[l]);break a}}throw n;}return n})}))};let g=a.f.preferredDrmSystem;if(!g){var h=_.lj();if(h.os===gj&&10<=h.osVersion.major&&"edge"===h.browser)g=_.ud;else if("safari"===h.browser)g=_.sd;else if(h.browser===$c||"firefox"===h.browser)g=_.wd}g&&(h=
243
- b.get(g))&&(f(!0,h,g),f(!1,h,g));for(const k of[!0,!1])b.forEach((l,m)=>{m!==g&&f(k,l,m)});d=d.catch(()=>{throw new _.I(_.D,6,6001,"Failed to get MediaKeySystemAccess.");});d=d.then(k=>{if(a.j)return null;a.J.clear();var l=k.getConfiguration();a.g.info("Got MediaKeySystemAccess with configuration",l);var m=l.audioCapabilities||[];l=l.videoCapabilities||[];for(var n of m)a.J.add(n.contentType.toLowerCase());for(var p of l)a.J.add(p.contentType.toLowerCase());{m=k.keySystem;n=b.get(_.kq(k.keySystem));
244
- p=[];l=[];const u=[],v=[];uq(n.drmInfos,p,l,u,v);1<l.length&&_.C("Multiple unique server certificates found! Only the first will be used.");1<p.length&&_.C("Multiple unique license server URIs found! Only the first will be used.");m={keySystem:m,licenseServerUri:p[0],distinctiveIdentifierRequired:n.distinctiveIdentifier===_.zf,persistentStateRequired:n.persistentState===_.zf,audioRobustness:n.audioCapabilities?n.audioCapabilities[0].robustness:"",videoRobustness:n.videoCapabilities?n.videoCapabilities[0].robustness:
1
+ let g={}; let _ = {};let f=function(window){'use strict';var ba,ca,la,oa,sa,ta,va,wa,xa,za,Aa,Ba,Ga,Ha,Ia,Ja,Ka,Ma,Na,Sa,Ua,Va,Wa,Ya,Za,$a,bb,cb,gb,jb,qb,rb,ub,xb,Bb,Cb,Db,Gb,Hb,Lb,Mb,Pb,Tb,$b,ac,bc,Dc,Ic,Qc,Rc,Yc,Zc,$c,bd,cd,fd,gd,id,jd,kd,ld,md,nd,od,td,vd,Ad,Gd,Hd,Id,Jd,Ld,Md,Nd,Rd,Sd,Ud,$d,je,le,me,te,Pe,We,Ye,Ze,$e,af,bf,cf,df,ef,ff,gf,lf,mf,nf,of,pf,rf,tf,xf,zf,Pf,Sf,kg,ng,wg,Ig,Jg,Kg,Lg,Mg,Og,Pg,Qg,Rg,Sg,$g,ah,dh,eh,jh,gh,rh,sh,uh,xh,zh,Hh,Lh,Sh,Th,Uh,Vh,Wh,Xh,Yh,Zh,bi,$h,di,fi,ei,hi,ji,ii,ki,li,mi,pi,qi,ti,Ji,Ki,Li,Mi,Qi,Vi,Ui,fj,Yi,
2
+ Xi,qj,rj,uj,wj,xj,yj,zj,Nj,Ij,Pj,Qj,Rj,Tj,Uj,Sj,Xj,Yj,Zj,Wj,Aj,Bj,Ej,Fj,Gj,Hj,Jj,Kj,Lj,Mj,gk,hk,Oj,Vj,ik,dk,ck,fk,ak,lk,ok,pk,qk,rk,tk,sk,wk,xk,Ak,Bk,Ck,Ek,Fk,Gk,Hk,Jk,Kk,Mk,Nk,Ok,Rk,Sk,Pk,$k,al,bl,Zk,kl,Qk,dl,el,fl,gl,hl,il,jl,ml,Uk,ll,Vk,Tk,Wk,nl,ol,sl,ul,pl,vl,Xk,Yk,yl,Al,El,Fl,Dl,Hl,Cl,Bl,Ll,Ml,Nl,Pl,Ql,Rl,Sl,Tl,Vl,Wl,Ul,Xl,Zl,Yl,bm,km,Il,nm,mm,lm,wl,Gl,pm,om,rm,sm,wm,Em,Mm,Om,Pm,Sm,Wm,an,dn,fn,gn,hn,ln,rn,tn,un,vn,wn,xn,yn,zn,An,Bn,Cn,Dn,In,Pn,Mn,Rn,Wn,Yn,$n,bo,co,eo,fo,ho,qo,io,jo,lo,so,oo,
3
+ Vn,vo,wo,uo,to,yo,zo,Do,xo,Eo,Co,Fo,Go,Ao,Bo,Ho,Mo,No,Io,Lo,Ko,Jo,Oo,Po,Qo,Ro,cp,ep,kp,op,qp,tp,up,zp,Jp,vp,Qp,Ep,Sp,Tp,Up,Wp,Xp,Yp,aq,Zp,$p,bq,cq,dq,gq,nq,oq,sq,vq,wq,yq,Aq,Bq,Dq,tq,zq,Eq,Fq,Gq,Hq,Qq,Jq,Rq,Iq,Kq,Lq,Sq,Xq,Zq,ar,$q,cr,Vq,kr,hr,jr,ir,Yq,lr,mr,nr,or,pr,qr,rr,sr,yr,Br,Dr,Er,Ir,Kr,Fr,Hr,Jr,Lr,Mr,Nr,Pr,Qr,Wr,Xr,Yr,$r,as,bs,cs,ds,es,gs,fs,hs,is,js,ks,ls,Zr,ms,os,us,vs,ws,Bs,Cs,Ds,Es,zs,ys,Ms,Os,Ps,Qs,Is,Ss,Ts,Us,Vs,Ys,Zs,$s,Ws,Xs,at,bt,et,it,jt,mt,ot,pt,nt,kt,dt,ht,ft,gt,st,tt,ut,vt,wt,
4
+ xt,yt,zt,Bt,Mt,Qt,bh,ch;_.aa=" is registered.";ba=" is unsupported on this platform.";ca=" to a log level. Falling back to default!";_.da="#text";_.ea="6.32.0-beta.2";_.fa="AdaptationSet";_.ha="Already destroyed. No-op";_.ia="Already released. No-op";_.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";
5
+ sa="Content-Length";ta="Content-Type";_.ua="Could not find configured DRM environment.";va="DRM licenses loaded";wa="DRMtoday";xa="DRMtodayOnboard";za="Destroying player";Aa="Error while decoding string!";Ba="Error while fetching certificate!";_.Da="FairPlay Certificate URL is not defined";_.Ea="FairPlay License URL is not defined";_.Fa="GROUP-ID";Ga="HW_SECURE_ALL";Ha="HW_SECURE_CRYPTO";Ia="HW_SECURE_DECODE";Ja="HeaderDrm";Ka="InvalidStateError";_.La="LANGUAGE";Ma="License verification failed: ";
6
+ Na="Load interrupted while a player release is pending";_.Pa="Loading player with configuration";_.Qa="MaxHeight";_.Ra="MaxWidth";Sa="Missing media element";_.Ta="NAME";Ua="No drmtoday configuration found in player configuration. Unable to modify the DRM license request!";Va="No event provided!";Wa="No items in the playlist";Ya="No sources provided!";Za="No track data attached to the event, unable to add track!";$a="Not a persistent session.";_.ab="Not supported";bb="NotAllowedError";cb="NotSupportedError";
7
+ _.db="PLAYLIST";_.eb="POST";_.fb="PlayReady License URL is not defined";gb="Player not ready yet.";_.hb="Player sources";_.ib="Please make sure ";jb="Preloading is not supported by this player.";_.lb="QualityLevel";_.mb="RESOLUTION";_.nb="Representation";_.ob="SW_SECURE_CRYPTO";_.pb="SW_SECURE_DECODE";qb="Session is closed";rb="Skipping Session creation. License for init data was already requested in ";_.sb="SmoothStreamingMedia";_.tb="TYPE";ub="The index is not in the allowed range.";_.wb="URI";
8
+ xb="Unable to translate ";_.zb="Unhandled/ignored event";_.Ab="Unregistering listeners";Bb="Unsupported keySystem";Cb="Updating playout limit for interstitial";Db="Using VTTCue polyfill from 3 argument TextTrackCue.";_.Eb="VIDEO";_.Fb="VOD";Gb="Wait for preloading to finish";Hb="WebkitEmeManager.MediaKeySession.load";_.Ib="Widevine License URL is not defined";Lb="Will create EME Manager: ";Mb="X-AD-CREATIVE-SIGNALING";_.Nb="X-ASSET-LIST";_.Ob="X-ASSET-URI";Pb="X-GROUPED-ASSET-LIST";_.Qb="X-PLAYOUT-LIMIT";
9
+ _.Rb="X-RESTRICT";_.Sb="X-RESUME-OFFSET";Tb="X-TIMELINE-OCCUPIES";_.Ub="ad-break-started";_.Vb="ad-break-stopped";_.Wb="ad-buffering";_.Xb="ad-clicked";_.Yb="ad-completed";_.Zb="ad-first-quartile";$b="ad-hls-asset-list-request";ac="ad-hls-asset-list-response";bc="ad-hls-resoled";_.cc="ad-impression";_.dc="ad-loaded";_.ec="ad-midpoint";_.hc="ad-paused";_.jc="ad-progress";_.kc="ad-resumed";_.lc="ad-skipped";_.mc="ad-started";_.nc="ad-stopped";_.oc="ad-third-quartile";_.pc="addtrack";_.qc="ads-timeline-changed";
10
+ _.rc="airplay-casting-ended";_.sc="airplay-casting-started";_.tc="airplay-status-changed";_.uc="application/cea-608";_.vc="application/dash+xml";_.wc="application/mp4";_.zc='application/mp4; codecs\x3d"stpp"';_.Ac='application/mp4; codecs\x3d"wvtt"';_.Bc="application/ttml+xml";_.Cc="application/vnd.ms-sstr+xml";Dc="application/x-www-form-urlencoded";_.q="audio";_.Ec="audio/aac";_.Fc="audio/ac3";_.Gc="audio/eac3";_.Hc="audio/mp4";Ic='audio/mp4;codecs\x3d"mp4a.40.2"';_.Jc="audiobufferchanged";
11
+ _.Kc="audiotrackchanged";_.Lc="autoplaynotallowed";_.Mc="bitratechanged";_.Nc="boolean";_.Oc="bufferingended";_.Pc="bufferingstarted";Qc="canplay";Rc="canplaythrough";_.Sc="castingstarted";_.Tc="caststatuschanged";_.Uc="castvisibilitychanged";_.Vc="cdn-switch-success";_.Wc="cenc";_.Xc="center";Yc="certificate-request";Zc="change";$c="chrome";_.ad="clpp-fill";bd="clpp-hidden";cd="clpp-mc-playlist";fd="clpp-visible";gd="clpp.PlayerFleet";_.hd="clpp.cast.CastSender";id="clpp.drm.DrmToday";jd="clpp.drm.HeaderDrm";
12
+ kd="clpp.drm.eme.AppleEmeManager";ld="clpp.drm.eme.EmeFactory";md="clpp.native.Player";nd="clpp.playlist.McPlaylist";od="clpp.utils.Platform";_.pd="codecs";_.qd="column-reverse";_.rd="com.adobe.primetime";_.sd="com.apple.fps";td="com.apple.quicktime.HLS";_.ud="com.microsoft.playready";vd="com.microsoft.playready.recommendation";_.wd="com.widevine.alpha";_.xd="config.drm.customData is not defined";_.yd="content-steering-change";_.zd="content-steering-location-ban-update";Ad="controls";_.Bd="cuechange";
13
+ _.Cd="decoder";_.Dd="destroy()";_.Ed="disabled";_.Fd="div";Gd="drm.mediaKeys.end";Hd="drm.mediaKeys.start";Id="drm.onPlay.end";Jd="drm.onPlay.start";_.Kd="drmexpirationupdate";Ld="drmlicenserequested";Md="drmrenewalstarted";Nd="drmsessioncreated";_.Pd="drmsessionpersisted";_.Qd="drmsessionupdate";Rd="drmtoday";Sd="durationchange";_.Td="ec-3";Ud="encrypted";_.Vd="end";_.Wd="ended";_.Xd="error";_.Yd="estimatedThroughputKbps";_.Zd="forced";$d="fullscreenElement";_.ae="function";_.be="height";_.ce="hidden";
14
+ _.de="hls-daterange";_.ee="html";_.fe="http://";_.ge="https://";_.he="image";_.ie="internal-error";je="keystatuseschange";_.ke="left";le="license-renewal";me="license-request";_.ne="line-left";_.oe="line-right";_.pe="live-turned-static";_.qe="load";_.re="loadeddata";_.se="loadedmetadata";te="loadstart";_.ue="main";_.ve="mdat";_.ze="mdia";_.Ae="message";_.Be="metadata";_.Ce="mimeType";_.De="minf";_.Ee="moov";_.Fe="mpd-type-changed";_.Ge="mpeg-dash-callback-event";_.He="none";_.r="number";_.Ie="object";
15
+ _.Je="onBitrateChanged()";_.Ke="onContentLoaded";_.Le="onPlayerError()";_.Me="onPlayerWillDestroy";_.Ne="onPlayerWillRelease";_.Oe="onStateChanged()";Pe="online-status-changed";_.Qe="optional";_.Re="org.w3.clearkey";_.Se="output-restricted";_.Te="pause";_.Ue="persistent";_.Ve="persistent-license";We="picture-in-picture";_.Xe="play";Ye="player.afterLoad.end";Ze="player.afterLoad.start";$e="player.appendLoad.end";af="player.appendLoad.start";bf="player.beforeLoad.end";cf="player.beforeLoad.start";
16
+ df="player.open.end";ef="player.open.start";ff="player.setupPlaylist.end";gf="player.setupPlaylist.start";_.hf="playing";_.jf="playlist-item-changed";_.kf="playlist-modified";lf="playlist.next.end";mf="playlist.next.start";nf="preload-aborted";of="preload-failed";pf="preloaded";rf="preloading";_.sf="prevent";tf="primary-content";_.uf="progress";_.vf="px";_.wf="ratechange";xf="released";_.yf="releasing";zf="removetrack";_.Af="required";_.Bf="resize";_.Cf="right";_.Df="sc-playlist-ended";_.Ef="sc-playlist-item-changed";
17
+ _.Ff="sc-playlist-live-turned-static";_.Gf="sc-playlist-timeline-changed";_.Hf="scte35";_.If="seeked";_.Jf="seeking";_.Kf="showing";_.Lf="simid-creative-started";_.Mf="simid-creative-stopped";_.Nf="sinf";_.Of="smooth";Pf="stalled";_.Qf="start";_.Rf="statechanged";Sf="status-pending";_.Tf="stbl";_.Uf="string";_.Vf="stsd";_.Wf="style";_.Xf="subtitles-htmlcue";_.Yf="temporary";_.Zf="text";_.$f="text/vtt";_.ag="text/xml";_.bg="texttrackchanged";_.cg="timeline-cue-added";_.dg="timeline-cue-enter";
18
+ _.eg="timeline-cue-exit";_.fg="timeline-cues-changed";_.gg="timeupdate";_.hg="tracksadded";_.ig="trak";_.jg="ttml-xml";kg="unauthenticated";_.lg="und";_.mg="unknown";ng="update";_.og="urn:scte:scte35";_.pg="urn:scte:scte35:2014";_.qg="user-seeked";_.ug="user-seeking";_.vg="value";wg="version";_.xg="vertical-lr";_.yg="vertical-rl";_.t="video";_.zg="video/mp2t";_.Ag="video/mp4";_.Bg="videobufferchanged";_.Cg="videotrackchanged";_.Dg="vimond-response";_.Eg="visibilitychange";_.Fg="vtt-xml";_.Gg="waiting";
19
+ _.Hg="waitingforkey";Ig="webkit-org.w3.clearkey";Jg="webkitkeyadded";Kg="webkitkeyerror";Lg="webkitkeymessage";Mg="webkitneedkey";_.Ng="width";Og="x-dt-auth-token";Pg="x-dt-csl-renewal-info";Qg="x-dt-csl-tracking-token";Rg="x-dt-follow-up-token";Sg="x-dt-resp-code";_.Tg="x-dt-session-info";_.Ug="x-dt-session-token";_.Vg="yospace-session-ended";_.Wg="yospace-session-started";_.Zg=function(a){return function(){return _.Yg[a].apply(this,arguments)}};
20
+ $g=function(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}};ah=function(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:$g(a)}};dh=function(a,b){if(b){var c=bh;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&&ch(c,a,{configurable:!0,writable:!0,value:b})}};
21
+ eh=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 eh(a())};_.x=function(a,b){a=a.split(".");var c=fh;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};
22
+ _.ih=function(a){return _.z(a)||gh(a)?a:_.hh(a)};_.hh=function(...a){let b={};for(let c=0;c<a.length;c++)null!=a[c]&&(b=jh(b,{merging:a[c]},1));return b.merging||null};_.kh=function(a){for(const b in a)if(void 0!==a[b])return!0;return!1};
23
+ jh=function(a,b,c){const d=c+1;if(_.z(a)||!_.lh(a))a={};for(const e in b)c=b[e],gh(c)||_.z(c)||_.mh(c)||c instanceof Element?a[e]=c:c instanceof Date?a[e]=c:_.lh(c)&&c.buffer&&c.buffer instanceof ArrayBuffer&&_.mh(c.subarray)?a[e]=c.subarray(0):c instanceof Array?a[e]=jh([],c,d):!_.z(c)&&_.nh(c)&&20>d&&(a[e]=jh(a[e],c,d));return a};gh=function(a){a=typeof a;return a===_.Uf||a===_.r||a===_.Nc};_.z=function(a){return null===a||"undefined"===typeof a};_.lh=function(a){return typeof a===_.Ie};
24
+ _.mh=function(a){return typeof a===_.ae};_.oh=function(a){return typeof a===_.Uf};_.ph=function(a){return typeof a===_.r};_.nh=function(a){if(_.z(a)||!_.lh(a))return!1;a=Object.getPrototypeOf(a);return a===Object.prototype||null===a};
25
+ _.qh=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||!_.lh(a)||!_.lh(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};
26
+ rh=function(a){return(Number.hasOwnProperty("isNaN")?Number.isNaN:b=>b!==b)(a)};sh=function(a){const b=new Map;for(const c of Object.keys(a))b.set(c,a[c]);return b};_.th=function(a){const b={};a.forEach((c,d)=>{b[d]=c});return b};uh=function(a,b){b=b.toLowerCase();for(const [c,d]of Object.entries(a))if(c.toLowerCase()===b)return d;return null};xh=function(a){return a&&0<=vh[a]?vh[a]:wh};
27
+ zh=function(a){if(!a)return _.B("clpp.log",xb+a+ca),-1;const b=yh[a.toUpperCase()];return void 0===b?(_.B("clpp.log",xb+a+ca),-1):b};_.Bh=function(a){Ah.info.apply(Ah,arguments)};_.Ch=function(a){Ah.debug.apply(Ah,arguments)};_.B=function(a){Ah.warn.apply(Ah,arguments)};_.Dh=function(a){Ah.error.apply(Ah,arguments)};_.Gh=function(a){if(a){var b=a.a();b in _.Eh?_.Fh.warn("Player-Factory '"+b+"' already registered"):(_.Eh[b]=a,_.Fh.info("Registered Player-Factory: '"+b+"'"))}};
28
+ Hh=function(a){return Object.values(_.Eh).find(a)||null};_.Kh=function(a){0<=Ih.indexOf(a)?Jh.warn(`Factory '${a.name()}' is already registered`):(Ih.push(a),Jh.info(`Factory '${a.name()}' has been registered.`))};Lh=function(a,b){const c=Ih.find(d=>d.a(a,b))||null;c&&Jh.info(`Chosen ads manager: ${c.name()}`);return c};_.Ph=function(a){return _.Oh.get(a)||null};_.Rh=function(a){_.Oh.get(a.id())?Qh.warn("Component already in use."):_.Oh.set(a.id(),a)};
29
+ Sh=function(a){return Array.from(_.Oh.values()).find(b=>b instanceof a)||null};Th=function(a){for(const b of _.Oh.values())a(b)};Uh=function(a){Th(b=>{b.playerConstructed(a)})};Vh=function(a){Th(b=>{b.beforeLoad(a)})};Wh=function(a){Th(b=>{b.afterLoad(a)})};Xh=function(a){if(null!==Sh(a))return null;a=new a;a.install();_.Rh(a);Qh.info("Installed component:",a.id());return a};Yh=function(a){if(a=Sh(a))a.uninstall(),_.Oh.delete(a.id()),Qh.info("Uninstalled component:",a.id())};
30
+ Zh=function(a,b,c,d){a=`${a===_.D?"FATAL":"RECOVERABLE"} Clpp-Error [Category ${b} - Code ${c}]`;if(_.oh(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};_.ai=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)$h(b[c]);a.a.clear()};bi=function(a,b,c){var d=[Ud,"msneedkey",Mg,"needkey"];const e=f=>{for(const g of d)a.off(b,g,e);c(f)};for(const f of d)a.on(b,f,e)};
31
+ $h=function(a){a.target.removeEventListener(a.type,a.a,a.f);a.target=null;a.a=null};_.ci=function(a){return Array.isArray(a)?a:[a]};di=function(a,b){return a===b?!0:a.length===b.length&&a.every((c,d)=>c===b[d])};fi=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 ei(a,b)&&ei(b,a)};ei=function(a,b){const c=new Set(a);return b.every(d=>c.has(d))};_.gi=function(a,b={}){if(b.ng){const c=[];for(const d of a)c.some(e=>b.ng(d,e))||c.push(d);return c}return Array.from((new Set(a)).values())};
32
+ hi=function(a,b){const c=new Set(a),d=new Set(b);return{Ui:a.filter(e=>!d.has(e)),Qj:a.filter(e=>d.has(e)),Bh:b.filter(e=>!c.has(e))}};ji=function(a,b){if(!a&&!b)return!0;if(!a||!b||a.byteLength!==b.byteLength)return!1;if(ii(a)===ii(b)&&(a.byteOffset||0)===(b.byteOffset||0))return!0;const c=_.G(a);b=_.G(b);for(let d=0;d<a.byteLength;d++)if(c[d]!==b[d])return!1;return!0};ii=function(a){return a instanceof ArrayBuffer?a:a.buffer};_.G=function(a,b=0,c=Infinity){return ki(a,b,c,Uint8Array)};
33
+ ki=function(a,b,c,d){const e=d.BYTES_PER_ELEMENT||1,f=ii(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)};li=function(a,b=0,c=Infinity){return ki(a,b,c,Uint16Array)};mi=function(a,b=0,c=Infinity){return ki(a,b,c,Uint32Array)};_.ni=function(a,b=0,c=Infinity){return ki(a,b,c,Int32Array)};_.oi=function(a,b=0,c=Infinity){return ki(a,b,c,DataView)};
34
+ pi=function(a){return a instanceof ArrayBuffer?a:0===a.byteOffset&&a.byteLength===a.buffer.byteLength?a.buffer:(new Uint8Array(a)).buffer};qi=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};
35
+ _.ri=function(a){if(!a)return"";a=_.G(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(Aa);return a}a=escape(qi(a));try{return decodeURIComponent(a)}catch(b){throw Error(Aa);}};
36
+ ti=function(a,b,c){if(!a)return"";if(!c&&0!==a.byteLength%2)throw si.error("Data has an incorrect length, must be even."),Error("Data does not seem to be UTF-16 encoded!");c=_.G(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(_.G(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 qi(c)};
37
+ _.ui=function(a,b){if(_.oh(a))return a;let c="";b=!!b;const d=_.G(a);239===d[0]&&187===d[1]&&191===d[2]?c=_.ri(d):254===d[0]&&255===d[1]?c=ti(d.subarray(2),!1):255===d[0]&&254===d[1]&&(c=ti(d.subarray(2),!0));const e=function(f,g){return f.byteLength<=g||32<=f[g]&&126>=f[g]}.bind(null,d);si.debug("Unable to find byte-order-mark, making an educated guess.");0===d[0]&&0===d[2]?c=ti(a,!1):0===d[1]&&0===d[3]?c=ti(a,!0):e(0)&&e(1)&&e(2)&&e(3)&&(c=_.ri(a));if(c)return b&&(c=escape(c)),c;throw Error("Unable to detect text encoding");
38
+ };_.vi=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};_.wi=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};
39
+ _.xi=function(a,b){var c=b||1;b=a.length;const d=new ArrayBuffer(b*c);let e;4===c?e=mi(d):2===c?e=li(d):e=_.G(d);for(c=0;c<b;c++)e[c]=a.charCodeAt(c);return d};_.yi=function(a,b){return String.prototype.startsWith?a.startsWith(b):0===a.indexOf(b)};_.zi=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};_.Ai=function(a){return!!(a&&0<a.length)};_.Bi=function(a){return!a||0===a.length};
40
+ _.Ci=function(a){if(void 0===a||null===a||""===a)return"";try{let b=Number(a);if(rh(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""}};_.Ei=function(a){a=a.replace(/<[^>]+>/gi,"");Di.innerHTML=a;a=Di.textContent;return a=a.replace(/<[^>]+>/gi,"")};_.Fi=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};
41
+ _.Gi=function(a,b){a.classList.add(b)};_.Hi=function(a,b){if(a&&typeof b===_.Ie)for(const c in b)a.style[c]=b[c]};_.Ii=function(a){return document.createElement(a)};Ji=function(a,b){const c=new MutationObserver(()=>{const d=Array.from(a.h.values());ei(Array.from(b.classList),Array.from(d))||b.classList.add(...d)});c.observe(b,{attributes:!0,attributeFilter:["class"]});return c};Ki=function(a,b){a.a&&0!==b.length&&(a.a.classList.add(b),a.h.add(b))};
42
+ Li=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};Mi=function(a){return 0>=a?Promise.resolve():new Promise(b=>{setTimeout(()=>{b()},1E3*a)})};Qi=function(){if(Ni)return Ni;Oi||(Oi=new _.Pi(()=>{Ni=null}));(Ni=document.querySelector(_.t)||document.querySelector(_.q))||(Ni=document.createElement(_.t));Oi.la(1);return Ni};_.Ri=function(){return!!navigator.userAgent.match(/Edge?\//)};
43
+ _.Si=function(a){return(navigator.userAgent||"").includes(a)};_.Ti=function(a){return _.Si("Tizen"+(a?" "+String(a):""))};Vi=function(a){const b={major:-1,name:_.mg};if(!a)return b;var c=a.replace(/_/g,".");b.name=c;c=c.split(".");1<=c.length&&(b.major=Ui(a,c[0]));2<=c.length&&(b.minor=Ui(a,c[1]));3<=c.length&&(b.patch=Ui(a,c[2]));4<=c.length&&(b.build=Ui(a,c[3]));return b};_.Wi=function(){return _.Si("Web0S")};
44
+ _.$i=function(){const a=Xi();const b=["ie","edge","opera","firefox","safari",$c];var c=Yi();const d=Zi[c];for(let e=0,f=b.length;e<f;e++)if(c=d[b[e]]&&a.match(d[b[e]]))return Vi(c[1]);return Vi("")};_.aj=function(){return _.Si("CrKey")};_.bj=function(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!_.Ti()};_.cj=function(){return/(?:iPhone|iPad|iPod|Android)/.test(navigator.userAgent)?!0:_.bj()&&1<navigator.maxTouchPoints};_.dj=function(){return/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)};
45
+ Ui=function(a,b){try{return parseInt(b,10)}catch(c){ej.warn("Unable to parse version number for '"+b+"' from '"+a+"'")}return-1};fj=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};
46
+ Yi=function(){const a=Xi();if(!a)return gj;var b=a.match(/^.+?(?=\))/);if(!b)return gj;b=b[0];if(fj(b,["iphone","ipad"]))return hj;if(fj(b,["android"]))return ij;if(fj(b,["macintosh"]))return jj;if(fj(b,["windows nt"]))return kj;if(fj(b,["tizen"]))return lj;if(fj(b,["web0s"]))return mj;if(fj(b,["linux"]))return nj;ej.warn("Unable to identify OS from user agent: "+a);return gj};Xi=function(){let a=window.navigator.userAgent;return a=a.toLowerCase()};
47
+ _.pj=function(){var a=Yi();var b=Yi();var c=Zi[b];if(c){c=Xi().match(c.os_version)[1];c=Vi(c);if(b===kj)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=Vi("");a:{c=Xi();const e=["ie","edge","opera","firefox","safari",$c];var d=Yi();d=Zi[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=oj}return{os:a,osVersion:b,browser:c,browserVersion:_.$i()}};
48
+ qj=function(a,b,c){b.hasAttribute(Ad)||(b.style.opacity="0",b.setAttribute(Ad,""),a.j.one(b,Sd,()=>{b.removeAttribute(Ad);b.style.opacity="1";c&&(c.style.opacity="1")}))};rj=function(a){if(a.Na){let b=a.player.getDuration();a.maxDuration&&(b=Math.min(b,a.maxDuration));a.Na.h=b}a.Ge&&a.Ge()};uj=function(a){if(a.sideAdContainer)a=a.sideAdContainer;else if(a=a.Yg.getSurface().getContainer(),!a)throw Error("Primary player does not have a container");return a};
49
+ wj=function(a,b,c){return Array.from({length:2}).map((d,e)=>{var f=document.createElement(_.t);b.appendChild(f);d=a.ka.ob.create();f=new vj(f);d.init(f,c);d.setSourceIndex(0);const g=f.getContainer();if(!g)throw Error("Failed to create player surface container element");g.classList.add("secondary");f.getMedia().classList.add(`v-${e}`);a.A.push(g);return d})};xj=function(a){return[a.a,...a.o.a.map(b=>b.player)]};
50
+ yj=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(fd),d.classList.remove("clpp-hide")):(a.g.debug(`Hide video element .${b}`),d.classList.remove(fd),d.classList.add("clpp-hide")),a.F&&a.F(d,c))};zj=function(a){return a.h.find(b=>!!b.primary)||null};
51
+ Nj=function(a,b,c){return _.w(function*(){if(a.w)a.g.warn(`Cannot ${c} item while busy (ID: ${b})`);else{var d=Aj(a,b);if(d){a.g.info(`${c} item (ID: ${b})`);a.w=!0;var e=a.f;e&&(e.player.isPaused()||(a.l?e.primary?Bj(a,e,Cj):e.player.pause():a.a.isLive()||e.player.pause()),e.primary?Bj(a,e,Cj):Bj(a,e,Dj));var f=a.j.has(b);f&&a.j.delete(b);try{c===_.Xe?(e&&d.primary?yield Ej(a,d):f?yield Fj(a,d):yield Gj(a,d),rj(d)):f?a.g.error("Loading preloaded items is not supported"):yield Hj(a,d);Ij(a,d);d.primary?
52
+ Bj(a,d,Dj):Bj(a,d,Cj);d.Na&&Jj(a,d,d.Na);if(d.Ea)d.player.one(_.Wd,d.Ea);e&&Kj(a,e)}catch(g){a.g.error(`Item failed to ${c} (ID: ${b})`,g);if(d.primary)throw g;const h=zj(a);h&&(a.g.warn("Ad failed, resuming primary item"),yield Ej(a,h))}finally{a.w=!1,Lj(a),Mj(a,d.next)}}else a.g.warn(`Item not found (ID: ${b})`)}})};
53
+ Ij=function(a,b){const c=b.transition;if(c&&!c.eh){if(c.Ea){const d=c.Ea,e=()=>{a.g.info(`Transition onEnded to (ID: ${d})`);a.play(d)};b.player.one(_.Wd,e);b.disposers.push(()=>{b.player.off(_.Wd,e)})}c.Ee&&Oj(a,b,()=>{const d=a.f.Na;d&&(b.disposers.forEach(e=>e()),b.disposers=[],a.a.trigger(new _.H(_.nc,{ad:d})),a.a.trigger(new _.H(_.Yb,{ad:d})),a.a.trigger(new _.H(_.Vb,{id:b.Yb})))});c.eh=!0}};
54
+ Pj=function(a,b){return _.w(function*(){a.g.info("Crop ads by playout limit",b);var c=zj(a),d=a.getCurrentItem();if(c&&d&&d.Na&&null!=c.Z){var e=a.h.filter(l=>!l.primary),f=Math.max(...e.map(l=>l.wb));if(b>f)a.g.info("Playout limit is greater than ad pod duration, ignored.");else{var g=d.player.getPosition()+(d.wb-d.duration),h=e.sort((l,m)=>m.wb-l.wb)[0],k=c.Z;b<=g?(c.Z-=f-g,a.g.warn("Playout limit exceeded, immediately returning "+`to primary at ${c.Z.toFixed(1)} instead of `+`${k.toFixed(1)}`),
55
+ yield Nj(a,c.id,_.Xe),h.Ea&&h.Ea(),c=d.Na,a.a.trigger(new _.H(_.nc,{ad:c})),a.a.trigger(new _.H(_.Yb,{ad:c})),a.a.trigger(new _.H(_.Vb,{id:d.Yb}))):(a.g.warn("Limiting playout of ads to",b),(d=e.find(l=>b<=l.wb&&b>=l.wb-l.duration))?(e=b-(d.wb-d.duration),d.Na.h=e,c.Z-=f-b,a.g.info("Last ad is now ",d.Na.gb(),"with cropped duration",e,"and primary will resume at",c.Z.toFixed(1),"instead of",k.toFixed(1)),h.Ea&&(d.Ea=h.Ea),d.transition={Ee:{position:e,itemId:c.id,Z:c.Z}},Ij(a,d)):a.g.warn("Cannot find ad hit by limit"))}}})};
56
+ Qj=function(a){return _.w(function*(){const b=a.f;b&&("loaded"!==b.state&&(yield b.ld),yield b.player.play(),b.state=_.hf,rj(b))})};Rj=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(),ld:Promise.resolve()})))};
57
+ Tj=function(a,b){return _.w(function*(){a.g.info("Remove items",b);const c=[],d=[];for(const e of a.h)b.includes(e.id)?d.push(e):c.push(e);a.h=c;yield Promise.all(d.map(e=>{e.disposers.forEach(f=>f());e.disposers=[];return Sj(a,e.id)}))})};Uj=function(a){return _.w(function*(){yield Tj(a,a.h.map(b=>b.id))})};Sj=function(a,b){return _.w(function*(){const c=a.j.get(b);c&&(a.g.info(`Stop preloading item (ID: ${b})`),c.player&&(yield Vj(a,c.player)),a.j.delete(b))})};
58
+ Xj=function(a){const b=zj(a);b&&(b.transition=void 0,b.next=[],Wj(a))};Yj=function(a){return _.w(function*(){const b=a.h.filter(c=>!c.primary).map(c=>c.id);Xj(a);yield Tj(a,b)})};Zj=function(a){_.w(function*(){const b=a.getCurrentItem(),c=b.next[0];b&&b.primary&&c&&(Xj(a),yield a.play(c))})};Wj=function(a){a.f&&(a.f.disposers.forEach(b=>b()),a.f.disposers=[],a.f.transition&&(a.f.transition.eh=!1),Ij(a,a.f))};Aj=function(a,b){return a.h.find(c=>c.id===b)||null};
59
+ Bj=function(a,b,c){const d=b?b.Yb||null:null;a.B?(a.a.setMuted(!0),ak(a,!0)):(b.audio&&(c=b.audio),a.ka.onAudioDecision&&(c=a.ka.onAudioDecision(d)),c===Dj?(a.a.setMuted(!1),ak(a,!0)):c===Cj?(a.a.setMuted(!0),ak(a,!1)):a.g.warn("Audio decision not supported",c))};
60
+ Ej=function(a,b){return _.w(function*(){if(b.player){a.G();if(b.state===rf){a.g.info("Wait for seek to finish");try{yield b.preloadPromise}catch(c){}}a.ga=!1;b.Z&&(yield b.player.seek(b.Z,!0));a.f=b;b.role=bk;yj(a,b.player,!0);b.state="loading";a.l?(Bj(a,b,Dj),b.player.isPaused()&&(yield b.player.play())):a.a.isPaused()&&(yield b.player.play());b.state=_.hf}})};
61
+ Fj=function(a,b){return _.w(function*(){const c=b.player;if(c){if(b.state===rf){a.g.info(Gb);try{yield b.preloadPromise}catch(d){}}a.f=b;b.role=bk;yj(a,c,!0);b.state===pf?yield c.play():b.state===of&&(yield ck(a,c,b.config,b.Vd));b.state=_.hf}})};Gj=function(a,b){return _.w(function*(){yield Hj(a,b);yield b.player.play();b.state=_.hf})};
62
+ Hj=function(a,b){return _.w(function*(){const c=yield dk(a,!!b.primary);a.f=b;b.role=bk;a.f.player=c;a.f.videoEl=c.getSurface().getMedia();yj(a,c,!0);b.state="loading";b.ld=ck(a,c,b.config,b.Vd);yield b.ld;b.state="loaded"})};
63
+ Jj=function(a,b,c){const d=b.player,e=()=>{const l=d.getPosition(),m=c.getDuration();c.setPosition(l);a.a.trigger(new _.H(_.jc,{ad:c}));!c.j&&l>=m/4&&(c.j=!0,a.a.trigger(new _.H(_.Zb,{ad:c})));!c.l&&l>=m/2&&(c.l=!0,a.a.trigger(new _.H(_.ec,{ad:c})));!c.o&&l>=3*m/4&&(c.o=!0,a.a.trigger(new _.H(_.oc,{ad:c})))},f=()=>{d.isEnded()||a.a.trigger(new _.H(_.hc,{ad:c}))},g=()=>{a.a.trigger(new _.H(_.kc,{ad:c}))},h=()=>{a.a.trigger(new _.H(_.Wb,{ad:c}))},k=()=>{a.a.trigger(new _.H(_.nc,{ad:c}));a.a.trigger(new _.H(_.Yb,
64
+ {ad:c}));c.f===c.a&&a.a.trigger(new _.H(_.Vb,{id:b.Yb}))};d.on(_.gg,e);d.on(_.Te,f);d.on(_.hf,g);d.on(_.Pc,h);d.one(_.Wd,k);b.disposers.push(()=>{d.off(_.gg,e);d.off(_.Te,f);d.off(_.hf,g);d.off(_.Pc,h);d.off(_.Wd,k)});1===c.f&&a.a.trigger(new _.H(_.Ub,{id:b.Yb}));c.videoEl=d.getSurface().getMedia();a.a.trigger(new _.H(_.cc,{ad:c}));a.a.trigger(new _.H(_.mc,{ad:c}))};
65
+ Kj=function(a,b){return _.w(function*(){const c=b.player;b.primary?(a.g.info("Pause primary playback"),a.l||yj(a,c,!1)):(a.g.info(`Stop previous playback (ID: ${b.id})`),b.disposers.forEach(d=>d()),b.disposers=[],b.player=null,b.videoEl=null,b.role=ek,b.Bf?(a.g.info(`Release player (ID: ${b.id}) `+`after delay ${b.Bf} ms.`),yield new Promise(d=>{setTimeout(()=>_.w(function*(){yield Vj(a,c);yj(a,c,!1);a.a.trigger(new _.H("ad-hls-released"));d()}),b.Bf)})):(yield Vj(a,c),yj(a,c,!1)))})};
66
+ Lj=function(a){Promise.all(Array.from(a.j.keys()).map(b=>Sj(a,b)))};Mj=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=>fk(a,d)))}})};gk=function(a,b,c){c=void 0===c?!1:c;if(!a.ga&&!a.a.isLive()){var d=zj(a);d?(d.Z=b,c&&(a.ga=!0)):a.g.error("Failed to get primary item. Cannot configure resume position.")}};hk=function(a){a.A.forEach(b=>a.C.removeChild(b));a.A=[];yj(a,a.a,!0)};
67
+ Oj=function(a,b,c){const d=b.transition.Ee;let e=null;d.Z&&gk(a,d.Z);const f=()=>{const k=b.player.getPosition();.5>=d.position-k&&(a.g.info("Start RAF polling"),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=()=>{a.g.info("Stop timeupdate polling");b.player.off(_.gg,f)};
68
+ a.g.info("Start timeupdate polling");b.player.on(_.gg,f);b.disposers.push(()=>{null!=e&&(a.g.info("Stop RAF polling"),cancelAnimationFrame(e),e=null)});b.disposers.push(h)};Vj=function(a,b){return _.w(function*(){b!==a.a&&(yield a.o.release(b))})};ik=function(a){return _.w(function*(){a.f&&(yield Kj(a,a.f),yj(a,a.a,!0))})};dk=function(a,b){return _.w(function*(){if(b)return a.a;const c=yield a.o.get();if(!c)throw Error("No player available");return c})};
69
+ ck=function(a,b,c,d){return _.w(function*(){yield b.release();yield b.load(c);d&&d(b.getDuration());if(a.f&&a.f.player){const e=a.f.player.getVolume();b.setVolume(null==e?1:e);b.setMuted(a.f.player.isMuted()||!1)}})};
70
+ fk=function(a,b){return _.w(function*(){if(b.primary){b.state=rf;a.j.set(b.id,b);if(b.Z&&!a.l){var c=b.player;a.g.info("Preparing to resume at",b.Z);Bj(a,b,Cj);yield c.seek(b.Z,!0)}b.state=pf}else{c=b.id;var d=yield dk(a,!1);b.player=d;b.videoEl=d.getSurface().getMedia();b.role=ek;b.state=rf;try{a.j.set(c,b);b.config.autoplay&&(a.g.warn(la+`Force disabling autoplay (ID: ${c})`),b.config.autoplay=!1);const e=a.a.getBandwidthEstimate();e&&(b.config.abr||(b.config.abr={}),b.config.abr.defaultBandwidthEstimate=
71
+ e);b.preloadPromise=ck(a,d,b.config,b.Vd);yield b.preloadPromise;b.state=pf}catch(e){7001===e.code?(a.g.info(`Preload aborted (ID: ${c})`),b.state=nf):(a.g.warn(`Preload failed (ID: ${c})`,e),b.state=of)}}})};ak=function(a,b){a.h.filter(c=>!c.primary&&c.player).forEach(c=>c.player.setMuted(b))};_.jk=function(a){return"com.apple.hls.interstitial"===a||"com.apple.hls.overlay"===a};_.kk=function(a){if(!a)return!1;const b=!!a[_.Ob];a=!!a[_.Nb];return(b||a)&&!(b&&a)};
72
+ lk=function(a){return a&&a.ASSETS&&Array.isArray(a.ASSETS)?a.ASSETS.every(b=>typeof b.URI===_.Uf&&typeof b.DURATION===_.r):!1};ok=function(a){return a.Uf&&!(a.once&&a.fh)&&[mk,nk].includes(a.state)};pk=function(a){a=a.customAttributes[Mb];if(!a)return null;try{return JSON.parse(atob(a))}catch(b){return null}};qk=function(a,b){for(let d=0;d<a.length;d++){const e=a[d];var c=d===a.length-1;c&&2===b||(c?(e.next=[tf],e.transition={Ea:tf}):(c=a[d+1].id,e.next=[c],e.transition={Ea:c}))}};
73
+ rk=function(a){const b={};a=a.map(d=>d.customAttributes||{});const c=new Set;a.forEach(d=>{Object.keys(d).forEach(e=>{c.add(e)})});for(const d of c)if(d===_.Rb){const e=new Set([]);a.forEach(f=>{f[d]&&f[d].forEach(g=>e.add(g))});b[d]=Array.from(e)}else if(d===_.Sb){const e=a.reduce((f,g)=>g[d]?f+g[d]:f,0);b[d]=e}return b};
74
+ tk=function(a,b){if(0===a.length)return a;const c=new Map;1===b?a.forEach(d=>{const e=c.get(d.startTime)||[];e.push(d);c.set(d.startTime,e)}):c.set(0,a);a=[];for(const d of c.values())1===d.length?a.push(d[0]):(b=sk(d),a.push(b));return a};
75
+ sk=function(a){const b=[];let c=0;a.forEach(f=>{var g=Math.max(0,f.endTime-f.startTime);c+=g;var h=f.customAttributes[_.Nb];h&&b.push({type:"list",id:f.id,customAttributes:f.customAttributes,wc:{URI:h,DURATION:0}});if(h=f.customAttributes[_.Ob])g={type:"uri",id:f.id,customAttributes:f.customAttributes,wc:{URI:h,DURATION:g}},(f=pk(f))&&(g.wc[Mb]=f),b.push(g)});const d=rk(a);d[Pb]={entries:b,pa:[]};const e=a[0];a=a.map(f=>f.id).join("+");return Object.assign({},e,{id:a,endTime:e.startTime+c,customAttributes:d})};
76
+ _.vk=function(){return{maxAttempts:1,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:0,fatalStatusCodes:[...uk]}};wk=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||[...uk]};xk=function(a){const b={};a.forEach((c,d)=>{b[d.trim()]=c});return b};
77
+ _.zk=function(a,b){_.oh(a)&&(a={uris:[a]});Array.isArray(a)&&(a={uris:a});const c={uris:a.uris||[],type:a.type||_.yk,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||
78
+ [],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:[...uk],requestStartTimestamp:null};a.keyInfo&&(c.keyInfo=a.keyInfo);b&&wk(c,b);return c};
79
+ _.Dk=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(Ak(c))return Bk(a);throw Ck(a);};Ak=function(a){return 200<=a&&299>=a&&202!==a};Bk=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}};
80
+ Ck=function(a){a=Bk(a);try{var b=_.ui(a.data,!0)}catch(d){b=null}_.Ch("HTTP error text:",b);const c=a.request;return new _.I(0<=(c?c.fatalStatusCodes||[]:[]).indexOf(a.status)?_.D:1,1,1001,{url:a.uri,status:a.status,responseText:b,headers:a.headers,request:a.request,response:a})};Ek=function(a,b){b=parseInt(b,10);Number.isNaN(b)&&(b=-1);a.bytesTotal=b;a.bytesLoaded=0;a.bytesRemaining=b};Fk=function(a,b,c){0<a.bytesRemaining&&(a.bytesRemaining-=b);a.bytesLoaded+=b;if(a.onProgress)a.onProgress(b,c)};
81
+ Gk=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()};Hk=function(a){return a.reduce((b,c)=>b+c,0)};Jk=function(a){return a.a.find(b=>b.state===Ik)||null};Kk=function(a,b){const c=a.f.getPosition();b>=c||a.a.filter(d=>1===d.qd&&!d.once&&d.Ng&&d.startTime>b).forEach(d=>{d.Uf=!0})};Mk=function(a){return a.a.find(b=>b.state===Lk)||null};
82
+ Nk=function(a,b){return a.a.find(c=>ok(c)&&!c.vi&&1===c.qd&&b>c.startTime&&b<c.endTime)||null};Ok=function(a,b){const c=a.f.getPosition();return a.a.filter(d=>1===d.qd&&!d.kg).sort((d,e)=>e.startTime-d.startTime).find(d=>d.startTime>c&&d.startTime<b)||null};Rk=function(a,b,c){_.w(function*(){a.ga=!0;try{const d=Mk(a);d&&(yield Pk(a,d));a.g.info("Seek into interstitial",b.ea);yield Qk(a,b)}catch(d){yield a.f.seek(c)}finally{a.ga=!1}})};
83
+ Sk=function(a,b,c){_.w(function*(){a.ga=!0;try{const d=Mk(a);d&&(yield Pk(a,d));a.g.info("Play jumped interstitial",b.ea,"resume at",c.toFixed(2));yield Qk(a,b,c)}catch(d){a.g.warn("Failed to play jumped interstitial",b.ea,d),b.Sh=new Date,yield a.f.seek(c)}finally{a.ga=!1}})};Pk=function(a,b){return _.w(function*(){a.g.info("Unschedule interstitial",b.ea);yield Yj(a.Y);b.state=mk})};
84
+ $k=function(a,b){const c=()=>_.w(function*(){if(!a.ga&&!a.Te){var g=b.getPosition(),h=Tk(a,g);h&&(yield Uk(a,h))&&Vk(a,h,b);if((h=Wk(a))&&h.state===mk&&b.getDuration()-g<a.ka.resolutionOffsetSec&&(yield Uk(a,h)))if(h.pa&&0!==h.pa.length){if(g=a.Y.getCurrentItem()){var k=Xk(a,h,2);if(0!==k.length){var l=k[0].id;g.next=[l];g.transition={Ea:l};a.g.info(`Schedule postroll interstitial ${h.ea}`);Yk(a,h,k)}}}else a.g.warn("Postroll interstitial has no assets, ignoring.")}});b.on(_.gg,c);a.h.push(()=>{b.off(_.gg,
85
+ c)});const d=()=>{Zk(a,!1,!0,!0)};b.on(_.fg,d);a.h.push(()=>{b.off(_.fg,d)});const e=()=>{a.Te=!0};b.on(_.Ub,e);a.h.push(()=>{b.off(_.Ub,e)});const f=()=>{a.Te=!1};b.on(_.Vb,f);a.h.push(()=>{b.off(_.Vb,f)})};al=function(a){a.h.forEach(b=>b());a.h=[]};bl=function(a){return(a=a.Y.getCurrentItem())&&!a.primary?a.player:null};
86
+ Zk=function(a,b,c,d){var e=dl(a);a.g.info("Interstitial cues changed",e);var f=e;if(d){f=hi(a.a.map(p=>p.ea),e.map(p=>p.id));el(a,f.Ui);const n=new Set(f.Bh);f=e.filter(p=>n.has(p.id))}if(!fl(a,f))return!1;const g=[],h=[],k=[];f.forEach(n=>{const p=n.customAttributes.CUE||[];p.includes(_.eb)?h.push(n):!d&&p.includes("PRE")?g.push(n):!c&&n.startTime<a.ka.Qi?g.push(n):k.push(n)});e=tk(g,0);f=tk(h,2);const l=tk(k,1),m=e.concat(f,l);gl(a,m);0<e.length&&hl(a,e[0],b);l.forEach(n=>il(a,n,1));0<f.length&&
87
+ il(a,f[0],2);jl(a,m);return 0<e.length};kl=function(a){_.w(function*(){var b=a.Y;Rj(b,[{id:tf,primary:!0,config:b.a.getConfiguration(),next:[],wb:0,duration:0,Yb:null}]);var c=zj(b);if(!c)throw Error("Failed to find primary item");b.f=c;c.role=bk;c.player=b.a;c.videoEl=c.player.getSurface().getMedia();yj(b,c.player,!0);b=a.f;c=b.getConfiguration();a.j=Zk(a,!c.autoplay,b.isLive(),!1);if(a.j){if(b=a.Y,c=b.o,c=c.a[0]?c.a[0].player:null)b.l||yj(b,b.a,!1),yj(b,c,!0)}else c.autoplay&&(yield Qj(a.Y))})};
88
+ Qk=function(a,b,c){return _.w(function*(){if(!(yield Uk(a,b)))throw Error("Failed to bind");yield ll(a,b,1,!1,c)})};dl=function(a){return a.f.getTimelineCues().filter(b=>_.jk(b.schemeIdUri)&&b.customAttributes)};el=function(a,b){const c=new Set(b);a.a.forEach(d=>{c.has(d.ea)&&!ok(d)&&a.g.warn("Removing an interstitial in active state",d)});a.a=a.a.filter(d=>!c.has(d.ea))};
89
+ fl=function(a,b){const c=[];b.forEach(d=>{_.kk(d.customAttributes)||c.push(`Interstitial cue ${d.id} is invalid `+"it must contain exactly one of X-ASSET-LIST or X-ASSET-URI.")});0<c.length&&a.g.error("Invalid interstitials, all interstitials will "+`be skipped. ${c.join(" ")}`);return 0===c.length};
90
+ gl=function(a,b){var c=b.sort((f,g)=>f.startTime-g.startTime);b=a.ka.resolutionOffsetSec;let d=Infinity;const e=[];for(let f=0;f<c.length-1;f++){const g=c[f],h=c[f+1];h&&(d=Math.min(d,h.startTime-g.endTime));h&&h.startTime<=g.endTime&&e.push(`Interstitials ${g.id} and ${h.id} `+"overlap.")}d<b&&(c=d/2,a.ka.resolutionOffsetSec=c,a.g.info("Interstitials are closer than configured "+`resolutionOffsetSec (${b} s) auto-reconfiguring to `+`${c} s.`));0<e.length&&a.g.warn("Unsupported format of interstitials, playback may not "+
91
+ `behave correctly. ${e.join(" ")}`)};hl=function(a,b,c){_.w(function*(){var d=il(a,b,0);const e=yield Uk(a,d),f=d.pa?d.pa.length:0;if(e&&0<f)try{a.g.info(`Player preroll interstitial ${d.ea}`),yield ll(a,d,0,c)}catch(g){a.g.error("Preroll interstitial failed.",g),(d=zj(a.Y))&&(yield a.Y.play(d.id))}else e?a.g.warn("Preroll interstitial has no assets, skipping"):a.g.error("Preroll interstitial failed, skipping"),yield ik(a.Y),c||(yield Qj(a.Y))})};
92
+ il=function(a,b,c){{const e=b.customAttributes[_.Ob],f=b.customAttributes[_.Nb],g=b.customAttributes[Pb],h=b.customAttributes[_.Sb],k=b.customAttributes[_.Qb],l=b.customAttributes[_.Rb]||[];b.customAttributes[Tb]||(b.customAttributes[Tb]=null==h||0<h?"RANGE":"POINT");var d=b.customAttributes["X-YOSPACE-AUDIO-PRIORITY"];d="CONTENT"===d?Dj:"AD"===d?Cj:void 0;b={ea:b.id,startTime:b.startTime,endTime:b.endTime,state:mk,$f:f,ag:e,Kd:g,pa:null,Z:null==h?null:Math.max(0,b.startTime+h),Wi:h,qc:k,qd:c,vi:"POINT"===
93
+ b.customAttributes[Tb],Kh:!l.includes("SKIP"),kg:!l.includes("JUMP"),gh:pk(b),Ng:null!=h&&0>h,once:(b.customAttributes.CUE||[]).includes("ONCE"),fh:!1,Uf:!0,customAttributes:b.customAttributes,audio:d}}a.a.push(b);return b};
94
+ jl=function(a,b){_.w(function*(){const c=a.Y.getCurrentItem();if(c)if(c.primary)a.a.forEach(g=>{const h=b.find(k=>k.id===g.ea);if(h){const k=h.customAttributes[_.Qb];null==g.qc&&null!=k&&(a.g.info(Cb,h.id,"Playout limit",k),g.qc=k,1===g.qd&&g.state===Lk&&ml(a,g))}});else{var d=b.find(g=>g.id===c.Yb);if(d){var e=d.customAttributes[_.Qb];if(null!=e){var f=a.a.find(g=>g.ea===d.id);f&&null==f.qc&&(a.g.info(Cb,d.id,"Playout limit",e),f.qc=e,yield Pj(a.Y,e))}}}})};
95
+ ml=function(a,b){_.w(function*(){yield Pk(a,b);yield Vk(a,b,a.f)})};Uk=function(a,b){return _.w(function*(){b.state=Ik;if(b.Kd)yield nl(a,b,b.Kd);else if(b.$f)yield ol(a,b,b.$f);else if(b.ag){b.pa=[{URI:b.ag,DURATION:b.endTime-b.startTime}];var c={URI:b.pa[0].URI,DURATION:b.pa[0].DURATION};b.gh&&(c[Mb]=b.gh);c={ASSETS:[c]};pl(a,new _.H(bc,{id:b.ea,detail:c}));b.state=ql}else b.state=rl;return b.state===ql})};
96
+ ll=function(a,b,c,d,e){return _.w(function*(){if(0!==b.pa.length&&a.Y.getCurrentItem()){var f=Xk(a,b,c);0!==f.length&&(Yk(a,b,f),0===c&&a.f.isLive()||(null!=e?gk(a.Y,e,!0):null!=b.Z&&gk(a.Y,b.Z)),d?yield a.Y.load(f[0].id):yield a.Y.play(f[0].id))}})};
97
+ Vk=function(a,b,c){if(b.pa)if(0===b.pa.length){const g=()=>{c.isLive()?a.g.info("Skipping empty "+`live interstitial ${b.ea}`):null!=b.Z&&0!==b.Wi?c.seek(b.Z):a.g.info(`Empty VOD interstitial ${b.ea}, `+"continuing to next segment")};c.one(_.dg,g);a.h.push(()=>{c.off(_.dg,g)});a.g.info(`Schedule interstitial ${b.ea} to `+"be skipped")}else{var d=a.Y.getCurrentItem();if(d){var e=Xk(a,b,1);if(0!==e.length){var f=e[0].id;null!=b.Z&&gk(a.Y,b.Z);d.next=[f];d.transition={Ee:{position:b.startTime,itemId:f,
98
+ Z:b.Z}};a.g.info(`Schedule interstitial ${b.ea} for `+`${b.startTime} s`);Yk(a,b,e)}}}};Tk=function(a,b){return a.a.find(c=>{const d=c.startTime-b;return 1===c.qd&&ok(c)&&0<d&&d<=a.ka.resolutionOffsetSec})||null};Wk=function(a){return a.a.find(b=>2===b.qd)||null};
99
+ nl=function(a,b,c){return _.w(function*(){try{const d=[],e=c.entries,f=e.map(h=>_.w(function*(){if("list"===h.type)return(yield sl(a,h.wc.URI)).ASSETS.map(k=>({id:h.id,customAttributes:h.customAttributes,wc:k}));if("uri"===h.type)return[{id:h.id,customAttributes:h.customAttributes,wc:h.wc}];throw new _.tl("Invalid group asset entry type");}));(yield Promise.all(f)).forEach(h=>d.push(...h));b.Kd={entries:e,pa:d};const g={ASSETS:d.map(h=>h.wc)};ul(a,b,g)}catch(d){a.g.error(`Failed to bind grouped asset list for ${b.ea}`,
100
+ d),b.state=rl}})};ol=function(a,b,c){return _.w(function*(){try{a.g.info(`Load X-ASSET-LIST for ${b.ea}`);pl(a,new _.H($b));const d=yield sl(a,c);ul(a,b,d)}catch(d){a.g.error("Failed to load X-ASSET-LIST",d),b.state=rl}})};
101
+ sl=function(a,b){return _.w(function*(){var c=a.Y.we();if(!c)throw Error("No player found");c=c.getNetworkEngine();const d=_.zk(vl(a,b));c=yield wl(c,d);if(null===c)return a.g.warn(`X-ASSET-LIST ${b} returned no content`),{ASSETS:[]};if(!lk(c))throw new _.tl("Invalid X-ASSET-LIST list response");return c})};
102
+ ul=function(a,b,c){b.pa=c.ASSETS;b.pa&&0!==b.pa.length||a.g.info(`Interstitial ${b.ea} has no assets, `+"will be smoothly skipped");if(null==b.Z){const d=Hk(b.pa.map(e=>e.DURATION));b.Z=b.startTime+(null==b.qc?d:Math.min(b.qc,d))}b.state=ql;pl(a,new _.H(ac));pl(a,new _.H(bc,{id:b.ea,detail:c}))};pl=function(a,b){a.f.trigger(b)};vl=function(a,b){return(a=a.ka.Pi)?(b=new URL(b),b.searchParams.set("_HLS_primary_id",a),b.toString()):b};
103
+ Xk=function(a,b,c){let d=0;const e=!!b.Kd;let f=b.pa.map((l,m)=>{let n=b.ea;e&&(n=b.Kd.pa[m].id);d+=l.DURATION;return{id:`${n}-${m}`,config:{source:{url:vl(a,l.URI),type:_.xl}},duration:l.DURATION,wb:d,Yb:n,next:[],Na:new J(c,m+1,b.pa.length,l.DURATION,n,b.Kh,b.customAttributes||null),audio:b.audio}});qk(f,c);f.forEach(l=>{l.Ge=()=>{var m=l.Na;a.g.info(`Playing ad ${`${m.f}/${m.a}`} of interstitial `+l.Yb)};l.Vd=()=>{pl(a,new _.H(_.dc,{ad:l.Na}))}});if(null!=b.qc&&(f=yl(a,b,f),0===f.length))return[];
104
+ const g=f[0].Ge;f[0].Ge=()=>{b.state=zl;b.fh=!0;b.Ng&&(b.Uf=!1);a.g.info(`Playing interstitial ${b.ea} with `+`${b.pa.length} assets and will resume primary `+`content ${b.Z?`at ${b.Z.toFixed(1)} s`:"after interstitial ended"}.`);g()};const h=f[0].Vd;f[0].Vd=l=>{null==b.Z&&(b.Z=b.startTime+l,gk(a.Y,b.Z),a.g.info("Primary content will resume at",b.Z.toFixed(1),"s"));h(l)};const k=f[f.length-1];k.Ea=()=>{b.state=nk;Tj(a.Y,f.map(l=>l.id));2===c&&ik(a.Y)};k.Bf=a.ka.adReleaseDelayMs;return f};
105
+ Yk=function(a,b,c){Rj(a.Y,c);a=a.Y;Wj(a);a.f&&(a.f.Na&&Jj(a,a.f,a.f.Na),Lj(a),Mj(a,a.f.next));b.state=Lk};
106
+ yl=function(a,b,c){const d=b.qc;a.g.info(`Playout limit for ${b.ea} is `+`${d} s`);b=c[c.length-1].wb;if(d>=b)return a.g.info(`Playout limit (${d}) is`+`larger or equal to total duration: (${b}).`),c;if(0>=d)return a.g.info("Discarding all ads."),[];const e=c.filter(f=>f.wb-f.duration<=d);e.forEach(f=>{f.Na.a=e.length});a=e[e.length-1];c=d-(a.wb-a.duration);.1>Math.abs(c-a.duration)?a.transition.Ea=tf:a.transition.Ee={position:c,itemId:tf,Z:null};a.maxDuration=c;return e};
107
+ Al=function(){try{const a=URL.createObjectURL(new Blob);URL.revokeObjectURL(a);return a.slice(a.lastIndexOf("/")+1)}catch(a){let b=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,c=>{const d=(b+16*Math.random())%16|0;b=Math.floor(b/16);return("x"===c?d:d&3|8).toString(16)})}};
108
+ El=function(a){a.a.on(window,"offline",()=>{Bl(a,!1)});a.a.on(window,"online",()=>{a.f||Cl(a)});a.a.on(a.m,Pf,()=>Dl(a));a.a.on(a.m,"suspend",()=>Dl(a));a.a.on(a.m,_.Gg,()=>Dl(a));a.a.on(a.m,_.hf,()=>{a.f||Cl(a)});a.a.on(a.m,_.uf,()=>{a.f||Cl(a)});a.a.on(a.m,_.Rf,()=>{switch(a.m.getState()){case 2:Dl(a);break;default:Dl(a)}})};Fl=function(a){a.h&&(a.h.stop(),a.h=null)};Dl=function(a){a.f&&Cl(a)};
109
+ Hl=function(a){return _.w(function*(){var b=a.m.getConfiguration().connectivityCheck;b&&a.m&&(b=yield Gl(a.j,b.url,b.attemptParameters,b.method),Bl(a,b))})};Cl=function(a){a.m.getConfiguration().connectivityCheck&&(Fl(a),a.h=(new _.Pi(()=>Hl(a))).la(5))};Bl=function(a,b){Fl(a);a.f!==b&&(a.f=b,a.m&&a.m.getConfiguration().connectivityCheck&&a.m.trigger(new _.H(Pe,{online:a.f})))};_.Jl=function(a,b){a.a.push(Il(b,()=>{{var c=a.a;const d=c.indexOf(b);-1<d&&c.splice(d,1)}}))};
110
+ _.Kl=function(){let a,b;const c=new Promise((e,f)=>{a=e;b=f}),d=Object.assign(c,{done:!1,Df:!1,Si:!1,value:null,error:null,resolve(e){d.Df=!0;d.done=!0;d.value=e;a(e)},reject(e){d.Si=!0;d.done=!0;d.error=e;b(e)}});return d};Ll=function(a,b){try{return new URL(a,b)}catch(c){return null}};Ml=function(){return window.performance&&window.performance.now?window.performance.now():Date.now()};Nl=function(a){return Ml()-a.a};Pl=function(a){const b=new Ol;b.a=a.a;return b};
111
+ Ql=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};Rl=function(a,b,c){return b.read().then(({done:d,value:e})=>{null!=e&&(Ql(a,e),Fk(c,e.byteLength,Nl(a.h)),a.h.a=Ml());return d?(d=a.a.buffer,a.a.byteLength!==a.f&&(d=d.slice(0,a.f)),Promise.resolve(d)):Promise.resolve().then(()=>Rl(a,b,c))})};
112
+ Sl=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};Tl=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)};
113
+ Vl=function(a){if(0<=a.o&&a.f<a.o)return null;let b=Ul(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=Ul(a)}return null};
114
+ Wl=function(a,b,c,d){return b.read().then(e=>{var {done:f,value:g}=e;d&&g&&(d(g.byteLength,Nl(a.w)),a.w.a=Ml());if(f)return e=Sl(a),(e=c(!0,e))?e.then(()=>a.j.a.buffer):Promise.resolve(a.j.a.buffer);let h=Promise.resolve();if(null!=g){Tl(a,g);var k=Vl(a);for(e=[];k;)e.push(k),k=Vl(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=
115
+ c(!1,k))&&(h=e)}}return h.then(()=>Wl(a,b,c,d))})};
116
+ Ul=function(a){const b=a.a;if(a.a+4>=a.f)return a.a=a.f,null;var c=Xl(a);if(a.a+4>=a.f)return a.a=a.f,null;var d=Xl(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 _.I(_.D,3,3E3);}if(2097151<f)throw new _.I(_.D,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};
117
+ Xl=function(a){const b=a.l.getUint32(a.a,!1);a.a+=4;return b};
118
+ Zl=function(a){var b=new window.Headers;for(const e in a.headers)b.append(e.toLowerCase(),a.headers[e]);const c=new window.AbortController,d={yd:!1,jh:!1};b={V:Yl(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.yd||(d.yd=!0,c.abort());return Promise.resolve()}};if(a=a.timeout){const e=window.setTimeout(()=>{d.jh=!0;c.abort()},a);b.V=b.V.finally(()=>{window.clearTimeout(e)})}return b};
119
+ Yl=function(a,b,c,d){return _.w(function*(){const e=new Ol,f=Pl(e);try{const g=yield window.fetch(a,c),h=xk(g.headers),k={uri:g.url,data:null,headers:h,status:g.status,timeMs:0,responseStartMs:Nl(f),request:b};if(!Ak(g.status)&&428!==g.status)throw k.data=yield g.arrayBuffer(),k.timeMs=Nl(e),Ck(k);const l=g.headers.get(sa);Ek(b,l);const m=l?parseInt(l,10):0;if(b.onFragment&&!b.disableFragmentSupport&&2===b.type){const n=g.body.getReader(),p=new $l(m,!b.disableMergedFragments);k.data=yield Wl(p,n,
120
+ (u,v)=>{if(d.yd)return null;v&&v.data&&(Fk(b,v.data.byteLength,Nl(f)),f.a=Ml());return b.onFragment&&v?b.rateLimitBps?Gk(b.rateLimitBps,Nl(e),b.bytesLoaded).then(()=>b.onFragment(v)):b.onFragment(v):null},b.onProgress)}else{const n=g.body.getReader(),p=yield Rl(new am(m),n,b);b.rateLimitBps&&(yield Gk(b.rateLimitBps,Nl(e),p.byteLength));k.data=p}if(d.yd)throw Error("Request was aborted");k.timeMs=Nl(e);return Bk(k)}catch(g){if(d.yd)throw new _.I(1,1,7001,{url:a,request:b});if(d.jh)throw new _.I(1,
121
+ 1,1003,{url:a,request:b});if(g&&1001===g.code)throw g;_.Dh("Error while fetching data:",g);throw new _.I(1,1,1002,{url:a,error:g,request:b,status:-1},g);}})};
122
+ bm=function(a){const b=a.uris[a.uriIndex],c=new window.XMLHttpRequest,d=new Ol,e=Pl(d);let f=0,g;const h=new _.Kl;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=Nl(e));m.readyState>=XMLHttpRequest.HEADERS_RECEIVED&&!k&&(m=m.getResponseHeader(sa),Ek(a,m),k=!0)};c.onload=function(m){m=m.target;var n=(m.getAllResponseHeaders()||
123
+ "").trim().split("\r\n");const p={};for(const u of n)n=u.split(": "),p[n[0].toLowerCase()]=n.slice(1).join(": ");try{const u=Nl(e);l||Fk(a,m.response?m.response.length:0,u);const v=_.Dk(p,m.response,m.status,b,m.responseURL,a,u,g);a.rateLimitBps?Gk(a.rateLimitBps,Nl(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 _.I(1,1,1002,{url:b,request:a,status:m.status}));else{var n=m.getAllResponseHeaders();const u=
124
+ {};if(n){n=n.trim().split("\r\n");for(var p of n)n=p.split(": "),u[n[0].toLowerCase()]=n.slice(1).join(": ")}p=_.Dk(u,m.response,m.status,b,m.responseURL,a,Nl(e),g);h.resolve(p)}};c.ontimeout=function(){h.reject(new _.I(1,1,1003,{url:b,request:a}))};c.onprogress=function(m){const n=Nl(d);d.a=Ml();if(100<n||m.lengthComputable&&m.loaded===m.total)Fk(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{V:h,request:a,abort:()=>
125
+ {c.abort();h.reject(new _.I(1,1,7001,{url:b,request:a}));return Promise.resolve()}}};_.dm=function(a,b=!0){a=_.cm(a).replace(/\+/g,"-").replace(/\//g,"_");return b?a:a.replace(/[=]*$/,"")};_.cm=function(a){a=qi(_.G(a));return btoa(a)};_.em=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};
126
+ _.fm=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};_.gm=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};_.hm=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};
127
+ _.im=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};km=function(a){try{const b=a.uris[a.uriIndex],c=_.jm(b);return{V:Promise.resolve({uri:b,data:c.data,request:a,headers:{"content-type":c.contentType}}),request:a,abort:()=>Promise.resolve()}}catch(b){return{V:Promise.reject(b),request:a,abort:()=>Promise.resolve()}}};
128
+ _.jm=function(a){var b=a.split(":");if(2>b.length||"data"!==b[0])throw _.Dh("Bad data URI, failed to parse scheme"),new _.I(_.D,1,1004,{uri:a});b=b.slice(1).join(":").split(",");if(2>b.length)throw _.Dh("Bad data URI, failed to extract encoding and MIME type"),new _.I(_.D,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?_.em(a).buffer:_.vi(a).buffer,contentType:c}};
129
+ Il=function(a,b){a.V.then(()=>b(!0),()=>b(!1));return a};
130
+ nm=function(a){a.h=a.C.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=lm(e.request.baseDelay,1E3));const f=a.f*(1+(2*Math.random()-1)*lm(e.request.fuzzFactor,.5));a.f*=lm(e.request.backoffFactor,2);if(0<f)return(new Promise((g,h)=>{a.l=h;mm(a,()=>{g(e.plugin(e.request))},f)})).catch(g=>{if(!a.a)throw g;})}if(a.a)throw new _.I(1,1,7001,{url:e.request.uris[e.request.uriIndex],request:e.request});return e.plugin(e.request)});
131
+ 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.V}).then(e=>{a.w.resolve(e)}).catch(e=>{if(e instanceof _.I){const f=b<d,g=7001!==e.code,h=b<c;if((1===e.severity||f)&&g&&h)return a.A&&a.A(e),nm(a);g&&e.a(_.D);a.w.reject(e)}else a.w.reject(e)})};mm=function(a,b,c){a.o=setTimeout(b,c)};lm=function(a,b){return null===a||void 0===a?b:a};
132
+ wl=function(a,b){return _.w(function*(){const c=yield om(a,b);if(!c)return null;try{const d=JSON.parse(c);if(null==d||typeof d!==_.Ie)throw Error("Not an object");return d}catch(d){throw new _.tl("Failed to parse JSON response","json-failed");}})};Gl=function(a,b,c,d){d=void 0===d?"HEAD":d;return _.w(function*(){if(!navigator.onLine)return!1;if(b){const e=_.zk(b,c);e.method=d;c||(e.timeout=5E3);e.headers["cache-control"]="no-cache";try{yield a.fetch(e).V}catch(f){if(1002===f.code||1003===f.code)return!1}}return!0})};
133
+ pm=function(a,b){a.A=b};om=function(a,b){return _.w(function*(){const c=yield a.fetch(b);return _.ri(c.data).replace(/\r\n|\r(?=[^\n]|$)/gm,"\n")})};
134
+ _.tm=function(a,b,c){if(a.w)return new qm(Promise.reject(new _.I(1,1,7001,{url:b.uris[b.uriIndex],request:b})));a.l&&0<a.l&&(b.rateLimitBps=a.l);var d=[];for(var e of a.h)d.push(e);if(b.requestModifiers)for(const g of b.requestModifiers)d.push(g);b.requestModifiers=d;rm(a,b);b.responseModifiers=[...a.j,...b.responseModifiers||[]];let f;e=d=new _.Kl;try{const g=[{type:"public",modifiers:b.requestModifiers},{type:"internal",modifiers:a.f}];for(const h of g)for(const k of h.modifiers)e=e.then(l=>{if(f.a)throw new _.I(_.D,
135
+ 1,7001,l?{url:l.uris[l.uriIndex],request:l}:null);return"internal"===h.type?k(l,c)||l:k(l)||l}).catch(l=>{if(l instanceof _.I)throw l;throw new _.I(_.D,1,1006,null,l);});e=e.then(h=>({request:h,plugin:sm(a,h)}));f=new qm(e,a.A);for(const h of b.responseModifiers)f.then(k=>{const l=()=>{if(f.a)throw new _.I(_.D,1,7001,k?{url:k.request.uris[k.request.uriIndex],request:k.request}:null);};l();const m=h(k)||k;l();return m}).catch(k=>{if(k instanceof _.I&&k.data&&k.data.response){const l=h(k.data.response);
136
+ if(l&&l.then)return l.then(()=>Promise.reject(k))}return Promise.reject(k)}).catch(k=>{if(k instanceof _.I)throw k;throw new _.I(_.D,1,1007,null,k);});_.Jl(a.o,f);d.resolve(b);return f}catch(g){return new qm(Promise.reject(g))}};rm=function(a,b){for(const c of a.headers){const [d,e]=c;b.headers[d]||(b.headers[d]=e)}};sm=function(a,b){b=b.uris[b.uriIndex];var c=new _.um(b,location.href);c=c?c.a.protocol.slice(0,-1):"";const d=a.a[c];if(!d)throw new _.I(_.D,1,1E3,{url:b});return e=>d(e)};
137
+ wm=function(){vm.forEach(a=>a())};_.xm=function(a){vm.push(a)};_.zm=function(a){ym&&performance.mark(a)};_.Bm=function(a,b,c){ym&&(b=performance.measure(a,b,c),null!=b&&Am.info(`Step: "${a}" took ${b.duration.toFixed(0)} ms.`))};Em=function(a,b){var c=Cm;Dm.set(`${a.toLowerCase().split(";")[0]}-${c}`,{priority:c,plugin:b})};_.Lm=function(a,b){var c=[Fm,Gm,Km,Cm];for(const d of c)if(c=Dm.get(`${a.toLowerCase().split(";")[0]}-${d}`)){const e=c.plugin(),f=e.isSupported(a,b);e.destroy();if(f)return c.plugin}return null};
138
+ Mm=function(a,b){const c=b||di;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)}};_.Nm=function(a){return null!=a};Om=function(...a){for(let b=0;b<a.length;b++){const c=a[b];if(null!==c&&void 0!==c)return c}throw new _.tl("No non-null, non-undefined value found");};Pm=function(...a){for(let b=0;b<a.length;b++){const c=a[b];if(null!==c&&void 0!==c)return c}};_.Qm=function(a){return`${a.scheme}//`+`${a.a}${a.port?":"+a.port:""}${a.path}${a.h}${a.f}`};
139
+ _.Rm=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)},""):""};Sm=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};
140
+ _.Tm=function(a,b){if(a.startsWith(_.fe)||a.startsWith(_.ge))return a;let c=b;b.startsWith("//")&&(c=`${location.protocol}${c}`);b=new URL(c);b.search="";return(new URL(a,b)).toString()};_.Um=function(a){if(!a)return null;a=(new _.um(a)).a.pathname.split("/");if(1>a.length)return null;a=a.pop().split(".");return 1>=a.length?null:a.pop().toLowerCase()};Wm=function(a,b){const c=Vm[a];for(const d of c)for(const e of b)if(d.test(e.trim()))return e.trim();return a===_.K?"":null};
141
+ _.Xm=function(a,b){b&&(a+=';codecs\x3d"'+b+'"');return a.replace(/\s/g,"")};_.Ym=function(a){return a.split(";")[0]};_.Zm=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(","):""};
142
+ _.cn=function(){var a=Infinity;navigator.connection&&navigator.connection.saveData&&_.cj()&&(a=360);const b=_.vk();b.maxAttempts=3;a={source:"",license:$m,viewerId:void 0,autoplay:void 0,pauseWhenInBackground:!1,ads:{hls:{enable:!0,resolutionOffsetSec:35}},manifest:{attemptParameters:_.vk(),availabilityWindowOverride:NaN,clockSyncUri:"",ignoreDrmInfo:!1,xlinkFailGracefully:!1,autoCorrectDrift:!0,timeline:{version:1,type:void 0}},abr:{enabled:!0,defaultBandwidthEstimate:1E3,switchInterval:8,bandwidthUpgradeTarget:.85,
143
+ bandwidthDowngradeTarget:.95,useSwitchIntervalForInitialSwitch:!1,restrictions:an(a),useCmsd:!0},contentSteering:{enabled:!0,attemptParameters:_.vk()},drm:null,cmcd:{enabled:!1,version:1,rtpMultiplier:5,deliveryMode:"headers"},enableHtmlCue:!0,preferredAudioLanguage:"",preferredTextLanguage:"",preferredAudioRole:_.ue,preferredTextRole:"",preferredAudioChannelCount:2,preferredAudioCodec:[],preferredVideoCodec:[],preferSpatialAudio:!1,preferForcedSubtitles:!1,volume:null,startTime:null,loop:!1,lowLatencyMode:!1,
144
+ suggestedPresentationDelay:void 0,muted:void 0,forceWaitForTracks:!1,xmlParser:_.bn,streaming:{attemptParameters:b,bufferingGoal:10,rebufferingGoal:2,bufferBehind:30,ignoreTextStreamFailures:!1,alwaysStreamText:!1,relativeTextTimestamp:!1,startAtSegmentBoundary:!1,gapDetectionThreshold:.1,disableAudioTracks:!1,disableVideoTracks:!1,smallGapLimit:.5,jumpLargeGaps:!0,gapTolerance:.001,durationBackoff:1,maxSegmentToMediaOffset:1,forceNativeTS:!1,preferNativeHlsOnSafari:!0,safeSeekOffset:5,stallEnabled:!0,
145
+ stallThreshold:3,stallSkip:.5,bufferLimitUpdateInterval:.5,overridePasp:!1,enableLiveEdgeChasing:!1,chasingRate:1.15,startChasingAt:5,stopChasingAt:2,chaseJumpDistance:10,patchEdgeWhenMixedContent:!1,ignoreDrift:!1,disableFragmentSupport:!1,disableMergedFragments:!1,ignoreManagedMediaSourceStreamingHints:!1},mediaSource:{codecSwitchingStrategy:_.sf},restrictions:an(),tizen:{sideStreamText:_.Ti(2)},safari:{enableHlsVideoTrackInfo:!1,enableMetadata:!1},mse:{sendPlaybackSessionIdHeader:!1},trickPlay:{speedUpMode:_.Cd,
146
+ preferTrickPlayTracks:!0},playlist:{timeline:"basic",content:_.Fb,cropTimeline:!1},yospace:{enabled:!1},broadpeak:{adTracking:!1},cmsd:{enabled:!0},mediatailor:{enabled:!1,sessionConfig:{}},disableRestrictions:!1,chromecast:{useSenderAbrConfig:!1,useSenderStreamingConfig:!1}};if(_.Ti()||_.Wi())a.ads.hls.enable=!1;if(_.Si("Edge/")||_.Ti())a.streaming.gapDetectionThreshold=.5;_.Wi()&&(a.streaming.stallEnabled=!1);_.Wi()&&79===_.$i().major&&(a.streaming.stallEnabled=!0,a.streaming.stallThreshold=1,a.streaming.stallSkip=
147
+ 1,a.streaming.gapDetectionThreshold=.02);_.Ti()&&(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};an=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}};
148
+ _.en=function(a,b){b=void 0===b?{}:b;if(!a)return _.cn();const c=[_.cn()];let d=!1;for(let e of a)null!==e&&void 0!==e&&(_.oh(e)&&(e={source:e}),e.lowLatencyMode&&!d&&(c.push({streaming:{rebufferingGoal:.1,bufferLimitUpdateInterval:.01,attemptParameters:{maxAttempts:3,baseDelay:250,backoffFactor:1}},abr:{bandwidthUpgradeTarget:.6,bandwidthDowngradeTarget:.95},manifest:{lowLatencyMode:!0}}),d=!0),c.push(e),b.Yi||null==e.suggestedPresentationDelay||c.push({manifest:{suggestedPresentationDelay:e.suggestedPresentationDelay}}));
149
+ a=_.hh.apply(null,c);_.oh(a.volume)&&(""===""+a.volume?a.volume=null:a.volume=Number(a.volume));if(!_.z(a.volume)&&(!_.ph(a.volume)||rh(a.volume)))throw new _.I(_.D,7,7100,"config.volume is not a number");if(!_.z(a.preferredTextLanguage)&&!_.oh(a.preferredTextLanguage)&&!Array.isArray(a.preferredTextLanguage))throw new _.I(_.D,7,7100,"config.preferredTextLanguage is not a string or an array");if(!_.z(a.preferredAudioLanguage)&&!_.oh(a.preferredAudioLanguage)&&!Array.isArray(a.preferredAudioLanguage))throw new _.I(_.D,
150
+ 7,7100,"config.preferredAudioLanguage is not a string or an array");if(!_.z(a.preferredAudioCodec)&&!_.oh(a.preferredAudioCodec)&&!Array.isArray(a.preferredAudioCodec))throw new _.I(_.D,7,7100,"config.preferredAudioCodec is not a string or an array");if(!_.z(a.preferredVideoCodec)&&!_.oh(a.preferredVideoCodec)&&!Array.isArray(a.preferredVideoCodec))throw new _.I(_.D,7,7100,"config.preferredVideoCodec is not a string or an array");if(!_.z(a.drm)){if(a.drm.env&&!_.oh(a.drm.env))throw new _.I(_.D,7,
151
+ 7100,"config.drm.env is not a string");if(a.drm.offlineId&&!_.oh(a.drm.offlineId))throw new _.I(_.D,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(!_.ph(b.bufferingGoal)||rh(b.bufferingGoal))throw new _.I(_.D,7,7100,"config.streaming.bufferingGoal is not a number");if(!_.ph(b.rebufferingGoal)||
152
+ rh(b.rebufferingGoal))throw new _.I(_.D,7,7100,"config.streaming.rebufferingGoal is not a number");if(b.rebufferingGoal>b.bufferingGoal)throw new _.I(_.D,7,7100,"config.streaming.rebufferingGoal must be \x3e\x3d bufferingGoal");if(!_.ph(b.bufferBehind)||rh(b.bufferBehind))throw new _.I(_.D,7,7100,"config.streaming.bufferBehind is not a number");if(!_.ph(b.smallGapLimit)||rh(b.smallGapLimit))throw new _.I(_.D,7,7100,"config.streaming.smallGapLimit is not a number");if(!_.ph(b.durationBackoff)||rh(b.durationBackoff))throw new _.I(_.D,
153
+ 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 _.I(_.D,7,7100,"Invalid value for |manifest.availabilityWindowOverride|");dn(a.restrictions);dn(a.abr.restrictions);a.abr.initialRestrictions&&dn(a.abr.initialRestrictions)}return a};
154
+ dn=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);
155
+ 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 _.I(_.D,7,7100,"Restrictions contain NaN");};fn=function(a){return typeof a===_.Ie&&!Array.isArray(a)&&"source"in a};
156
+ gn=function(a){if(!a)return null;a=(new _.um(a)).a.pathname.toUpperCase();return a.endsWith(".MPD")?_.vc:a.endsWith(".M3U8")?_.xl:a.endsWith(".MP4")?_.Ag:a.endsWith(".MP3")?"audio/mp3":a.endsWith("MANIFEST")||a.endsWith(".ISM")?_.Cc:null};_.jn=function(a){let b;fn(a)?b=a.source:b=a;Array.isArray(b)||(b=[b]);b=b.filter(c=>typeof c===_.Uf||"url"in c);a=[];for(let c=0;c<b.length;c++){const d=hn(b[c]);d&&a.push(d)}return a};
157
+ hn=function(a){let b=null;_.oh(a)&&(a={url:a});typeof a===_.Ie&&!Array.isArray(a)&&"url"in a&&(b={url:a.url,type:a.type?a.type:null},_.z(a.drmProtected)||typeof a.drmProtected!==_.Nc||(b.drmProtected=a.drmProtected),_.z(a.isLive)||typeof a.isLive!==_.Nc||(b.isLive=a.isLive),_.z(a.name)||typeof a.name!==_.Uf||(b.name=a.name),_.z(a.jc)||typeof a.jc!==_.Uf||(b.jc=a.jc),_.z(a.nb)||typeof a.nb!==_.Uf||(b.nb=a.nb));b&&!b.type&&(b.type=gn(a.url),b.type?kn.debug("Detect media type "+b.type+" for "+a.url):
158
+ kn.warn("Unable to detect media type for "+a.url));return b};ln=function(a,b){a.onError(b);a.release().then(()=>a.destroy())};_.nn=function(a){_.mn[a.I]=a};
159
+ _.pn=function(a){const b={attemptParameters:_.vk(),enforceSingleSession:!1,delayLicenseRequestUntilPlayed:!1,enableSessionCacheForSkd:!1,ignoreUnrecognizedInitData:!0,La:{},widevineVersion:_.wd};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!==
160
+ a.ignoreUnrecognizedInitData&&(b.ignoreUnrecognizedInitData=!!a.ignoreUnrecognizedInitData),typeof a.widevineVersion===_.Uf&&0<a.widevineVersion.length&&(b.widevineVersion=a.widevineVersion),a.env)){const c=_.mn[a.env]||null;if(!c)throw _.Ch(_.ua,_.ib+a.env+_.aa),new _.I(_.D,6,6015,`DRM environment '${a.env}' is missing.`);b.La=_.on(c,a.customData)||{};_.yi(a.env.toLowerCase(),Rd)&&(b.enforceSingleSession=!0)}return b};
161
+ rn=function(a){var b=qn;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=_.vi(d),n=_.em(e);return h.verify(k,l,n.buffer,m.buffer)}).then(function(l){l?f():g(new _.tl("Signature Verification failed",kg))}).catch(g)}else f()})};
162
+ tn=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 sn(b[0],b[1],b[2]);a.a=b}return a.a};un=function(a){return _.w(function*(){var b=tn(a);try{yield rn(b)}catch(c){if(c&&c.code===kg)throw c;b=new _.um(window.location.href);if(!/(^127\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)|(^localhost)/.test(b.a.hostname))throw c;}})};
163
+ vn=function(a){switch((a.ha[0]||{src:"",type:""}).type){case _.vc:a="dash";break;case _.Cc:a="ss";break;case _.xl:a="hls";break;case _.Ag:a="mp4";break;default:a=""}return a};wn=function(a){return a.viewerId?a.viewerId:(a=a.drm||null)&&a.customData&&a.customData.userId?`${a.customData.userId}`:""};xn=function(a){return(a=a.drm||null)&&a.customData&&a.customData.assetId?`${a.customData.assetId}`:""};
164
+ yn=function(a){return(a=a.drm||null)&&a.customData&&a.customData.sessionId?`${a.customData.sessionId}`:""};zn=function(a){return(a=(a=a.drmInfo)&&a.licenseServerUri||"")?(new _.um(a)).a.hostname:""};An=function(a){const b=a.configuration;let c="no";b.drm&&!_.qh(b.drm,{})&&(c="custom",b.drm.env&&b.drm.env.toLowerCase().startsWith(Rd)||zn(a).endsWith("drmtoday.com"))&&(c=Rd);return c};
165
+ Bn=function(a){a=a.drmInfo;let b="";if(a)switch(a.keySystem){case _.wd:b="wv";break;case _.ud:b="pr";break;case _.sd:b="fps"}return b};Cn=function(a){a=a.drmInfo;let b=!1;a&&(b=a.persistentStateRequired);return b.toString()};Dn=function(a){a=a.drmInfo;let b="";if(a)switch(a.videoRobustness){case Ia:case Ga:b="L1";break;case Ha:b="L2";break;case _.pb:case _.ob:b="L3"}return b};
166
+ In=function(a,b){const c="ie"===_.pj().browser;var d=b.configuration;const e=[...Array.from(_.Oh.keys()),...b.Xg];b={"CL-KEY":a.f,"CL-LOCATION":window.location.href,"CL-SDK-VERSION":_.ea,"CL-USER-ID":wn(d),"CL-ASSET-ID":xn(d),"CL-SESSION-ID":yn(d),"CL-PLAYBACK-TYPE":b.isLive?En:Fn,"CL-CONTENT-TYPE":vn(b),"CL-PLUGINS":e.join(" "),"CL-DRM":An(b),"CL-DRM-CDM":Bn(b),"CL-DRM-SEC-LEVEL":Dn(b),"CL-DRM-OFFLINE":Cn(b),"CL-DRM-IP":zn(b)};Gn&&Gn.companionSdk&&(Gn.companionSdk.name&&(b["CL-COMPANION-SDK"]=Gn.companionSdk.name),
167
+ Gn.companionSdk.version&&(b["CL-COMPANION-SDK-VERSION"]=Gn.companionSdk.version));c&&(d=window.localStorage.getItem("cl_et"))&&(b["CL-ETAG"]=d);d=_.zk(["https://downloads.castlabs.com/r/register/"]);d.method="GET";d.headers=b;return(new _.Hn).fetch(d).V.then(f=>{200===f.status&&c&&window.localStorage.setItem("cl_et",f.headers.etag);return Promise.resolve()}).catch(f=>{a:{var g=tn(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";
168
+ 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.";break;default:g=Promise.resolve();break a}a.g.error(Ma+k);g=Promise.reject(new _.I(_.D,7,g,k))}}return g})};
169
+ _.Kn=function(a){var b=(a||"").split("-");a=b[0]||"";b=b[1]||"";a=a.toLowerCase();a=Jn.get(a)||a;return(b=b.toUpperCase())?a+"-"+b:a};_.Ln=function(a,b){a=_.Kn(a);b=_.Kn(b);return a.split("-")[0]===b.split("-")[0]};
170
+ Pn=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}=Mn(c[e]);Object.keys(Nn).includes(f)&&(d[Nn[f]]=g)}return d}).filter(c=>_.kh(c));return 0<b.length?b:null}catch(b){return On.error("CmsdManager parseCmsdDynamicHeader_ failed:",b),null}};
171
+ Mn=function(a){var b=a.split("\x3d");const c=b[0];b=b[1];if(!c)throw new _.tl("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 _.tl(`Parsing CMSD, not recognized value type of ${a}`);};
172
+ Rn=function(a){return b=>{{var c=b.headers;let e=b=null;var d=uh(c,"cmsd-dynamic");c=uh(c,"cmsd-static");d&&(b=Pn(d),a.a=b);if(c)try{d={};const f=c.split(",");for(c=0;c<f.length;c++){const {key:g,value:h}=Mn(f[c]);Object.keys(Qn).includes(g)&&(d[Qn[g]]=h)}e=_.kh(d)?d:null}catch(f){On.error("CmsdManager parseCmsdStaticHeader_ failed:",f),e=null}(b||e)&&a.m.trigger(new _.H("cmsd-event",{Gj:b,Uj:e}))}}};_.Tn=function(a){a&&(0<=Sn.indexOf(a)||Sn.push(a))};
173
+ Wn=function(a){if(!a.h&&a.A&&a.a&&a.f.ads.hls.enable&&a.getTimelineCues().some(b=>_.jk(b.schemeIdUri))){const b=new Un;b.A(a.a,a.A,a.f.mse.sendPlaybackSessionIdHeader?a.F:null);Vn(a,b,a.f)}};Yn=function(a,b){a.H=new Xn(b);un(a.H).catch(c=>{setTimeout(()=>{a.g.error(Ma+c);a.trigger(new _.H(_.Xd,{detail:new _.I(_.D,7,7101)}));a.destroy()},1E3)})};$n=function(a,b){a.W=b;for(const c of a.W)(b=c.id())&&(a.K[b]=c);_.Zn(a,"onPlayerCreated")};
174
+ _.ao=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))};
175
+ bo=function(a,b){_.w(function*(){a.j.getMedia()||a.j.getCastElement();a.H||(a.H=new Xn(a.f.license));try{a.g.debug("Verifying license remotely"),yield In(a.H,b),a.g.debug("License verified remotely")}catch(c){a.g.debug("License rejected by remote",c),setTimeout(ln,1E3,{release:a.release.bind(a),destroy:a.destroy.bind(a),onError:a.onError.bind(a)},c)}})};_.Zn=function(a,b,...c){if(!a.X)return Promise.resolve();const d=a.W.map(e=>e[b].call(e,a,...c)).filter(e=>e instanceof Promise);return Promise.all(d)};
176
+ co=function(a){return _.w(function*(){if(a.R)return a.g.debug("The player is already released. No-op"),new Promise(b=>b());a.ca.off(document,_.Eg);a.trigger(new _.H(_.yf));a.j&&a.j.release();a.h&&(yield a.h.o(),a.h=null);a.B&&(yield a.B.release(),a.B=null);if(a.a){let b=null;const c=a.a.on(_.Rf,d=>{b=d});return _.Zn(a,_.Ne).then(()=>{a.a.stopForwardingEventsTo(a);return Promise.all([a.a.release(),a.I.release()])}).then(()=>{a.g.debug("Releasing player completed");b&&(a.g.debug("Re-post state change event after release"),
177
+ a.trigger(b))}).finally(()=>{a.a.off(_.Rf,c);a.trigger(new _.H(xf))})}a.trigger(new _.H(xf));return new Promise(b=>b())})};eo=function(a){a.F&&(a.g.info("Playback session ended, ID:",a.F),a.F=null,a.a&&a.a.setPlaybackSessionId(null))};fo=function(a,b){const c=Hh(d=>d.f(_.db)&&a.every(e=>2===d.canPlay(e,b)));if(!c)throw new _.I(_.D,7,7003,"No compatible player implementing playlist mode found!");return{ob:c,player:c.create(),sourceIndex:0}};
178
+ ho=function(a,b,c){if(a.M===_.db)b=fo(b,c);else if(2!==(a.a?a.a.canPlay(b[0],c):0)||a.S){a.S=!1;if(b){var d=a=null;for(var e=0;e<b.length;e++);e=Object.values(_.Eh);for(let f=0;f<b.length;f++)for(let g=0;g<e.length;g++){const h={ob: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?(_.Fh.debug("Player Factory '"+a.ob.a()+"' can play",b[d]),b=new go(a.ob,d)):(_.Fh.debug("No compatible Player Factory found for sources:",b),b=null)}else b=
179
+ null;if(!b)throw new _.I(_.D,7,7003,"No player factory compatible with given sources found!");c=b.ob;a=c.create();b={ob:c,player:a,sourceIndex:b.sourceIndex}}else b={ob:a.A,player:a.a,sourceIndex:0};return b};
180
+ _.mo=function(a,b,c){return _.w(function*(){if(a.P)throw new _.I(_.D,7,7E3,"Player is already destroyed.");if(!a.j)throw new _.I(_.D,7,7E3,"No surface associated with this player!");_.zm(cf);yield a.release();var d=c||_.jn(b);if(!b||0===d.length)throw new _.I(_.D,7,7003,Ya);a.da=d;a.f=_.en([a.C,b,{source:d}]);a.R=!1;d=ho(a,d,a.f);_.ao(a,d.player,d.ob);io(a,a.a);a.a&&a.a.setSourceIndex(d.sourceIndex);jo(a);a.a&&a.a.setCdnErrorCallback(a.L);_.ko(a,a.f);lo(a);if(a.f.pauseWhenInBackground)a.ca.on(document,
181
+ _.Eg,()=>{document.hidden?(a.g.debug("Player is hidden: pausing..."),a.pause()):(a.g.debug("Player is visible: resuming..."),a.play())});Vh(a);yield _.Zn(a,"onContentWillLoad",a.f.source[d.sourceIndex]);_.zm(bf);_.Bm("player.beforeLoad",cf,bf)})};_.no=function(a){return _.w(function*(){a.j.getMedia()||a.j.getCastElement();a.trigger(new _.H(te));yield Promise.all([a.a.load(a.f),a.h?a.h.load():Promise.resolve()])})};
182
+ _.po=function(a){return _.w(function*(){_.zm(Ze);bo(a,{configuration:a.getConfiguration(),ha:a.Cg(),drmInfo:a.getDrmInfo(),Xg:Object.keys(a.K),isLive:a.isLive()});oo(a);Wh(a);yield _.Zn(a,_.Ke);a.f.autoplay&&(a.h?a.h.w():1)&&(yield a.play());_.zm(Ye);_.Bm("player.afterLoad",Ze,Ye)})};qo=function(a){return _.w(function*(){if(a.a){var b=a.a;b.mh?(a.trigger(new _.H(te)),yield b.mh(),yield _.po(a)):a.g.warn(jb)}else a.g.warn(gb)})};
183
+ io=function(a,b){try{var c=crypto.randomUUID()}catch(d){c=Al()}a.g.info("Playback session started, ID:",c);b.setPlaybackSessionId(c);a.F=c};jo=function(a){a.a&&a.a.setDrmCustomDataModifier(b=>_.w(function*(){a.gf&&a.Yc&&(yield a.Yc(b))}))};_.ko=function(a,b){b=b||a.f;var c=Lh(a,b);c&&(c=c.create(a),Vn(a,c,b))};lo=function(a){a.f.cmsd.enabled&&(a.B=new ro(a),a.a.setCmsdManager(a.B))};
184
+ so=function(a){const b=_.ci(a.f.preferredTextLanguage).filter(f=>f),c=a.f.preferForcedSubtitles,d=a.getTrackManager().sa().filter(f=>c?f.kind===_.Zd:f.kind!==_.Zd);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().ra();e&&e.language?(e=_.Kn(e.language||""),b.push(e)):(e=a.getTrackManager().Ia())&&e.language&&(e=_.Kn(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=>
185
+ {const g=_.Kn(f);if(f=d.find(h=>{h=_.Kn(h.language||"");return _.Ln(h,g)}))return a.getTrackManager().ab(f),!0;c&&a.g.warn("Forced subtitles are configured to be preferred, but no forced subtitles match the preferred languages: ",b);return!1})}};oo=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);so(a)})};Vn=function(a,b,c){a.h=b;b.h(null==c.volume?1:c.volume);b.setMuted(c.muted||!1)};
186
+ vo=function(a,b){return _.w(function*(){yield to(a,()=>Promise.all(uo(a).map(b)))})};wo=function(a,b){_.w(function*(){yield to(a,()=>Promise.all(a.f.filter(c=>null!=c.Sa()).map(b)))})};uo=function(a){return[a.Mc,...a.f].filter(b=>null!=b)};to=function(a,b){return _.w(function*(){a.a&&(yield a.a);a.a=b().then(()=>{a.a=null})})};yo=function(a){return xo(a).filter(b=>b.type===td&&!b.xf)};zo=function(a){a.forEach(b=>{b.xf=!0})};
187
+ Do=function(a,b){a=a.map(c=>({startTime:c.startTime,endTime:c.endTime,key:c.value.key,value:c.value.data,Ig:!1}));a=Ao(a);b&&(a=Bo(a));return new Set(Co(a))};xo=function(a){const b=[];for(const c of a)b.push(c);return b};Eo=function(a,b){const c=a.endTime-a.startTime,d=b.endTime-b.startTime,e=a.qg||a.startTime,f=b.qg||b.startTime;return(Infinity===c&&Infinity===d||.01>Math.abs(c-d))&&.5>Math.abs(e-f)&&a.value.key===b.value.key&&a.value.data===b.value.data};
188
+ Co=function(a){const b=[];for(const c of a)(a=b.find(d=>d.startTime===c.startTime&&d.endTime===c.endTime))?Fo(c,a):(a=Go(c),b.push(a));return b};Fo=function(a,b){if(a.key.startsWith("X-"))b.customAttributes||(b.customAttributes={}),b.customAttributes[a.key]=a.value,"X-CUSTOM-ID"===a.key&&(b.id=a.value);else if("SCTE35-OUT"===a.key||"SCTE35-IN"===a.key)b.schemeIdUri=_.pg,b.type=_.Hf};
189
+ Go=function(a){var b=a.startTime;const c=a.endTime;b={schemeIdUri:"",value:"",startTime:b,endTime:c,id:`T${b.toFixed(2)}-${c.toFixed(2)}`,type:_.de,eventElement:null};Fo(a,b);return b};Ao=function(a){const b=new Set(a),c=new Set(a.filter(d=>"SCTE35-OUT"===d.key).map(Ho));a.filter(d=>"SCTE35-IN"===d.key).forEach(d=>{c.has(Ho(d))||(d.Ig=!0)});return Array.from(b.values())};Bo=function(a){a.forEach(b=>{b.Ig&&(b.endTime=b.startTime,b.startTime=0)});return a};Ho=function(a){return`${a.startTime}-${a.endTime}`};
190
+ Mo=function(a,b){a.g.debug("onMetadataTrackAdded_()");b.mode=_.ce;var c=!b.cues||0===b.cues.length;if(a.m.isLive()||!c){var d=b.cues;c=yo(d);zo(c);a.a=Do(c,a.l);0<a.a.size&&(Io(a,a.a),a.m.trigger(new _.H(_.fg)));a.j.on(b,_.Bd,()=>{{const l=a.m.getPosition();for(const m of a.a){var e,f=a,g=m,h=l;if(Infinity===g.endTime){if(e=!f.f.has(g)){var k=g.startTime;e=k;k+=.5;e=e<=h&&h<=k}e&&(f.f.add(g),f.m.trigger(new _.H(_.dg,{detail:g})))}else h=g.startTime<=h&&h<=g.endTime,!h&&f.f.has(g)?(f.f.delete(g),f.m.trigger(new _.H(_.eg,
191
+ {detail:g}))):h&&!f.f.has(g)&&(f.f.add(g),f.m.trigger(new _.H(_.dg,{detail:g})))}}});a.m.isLive()&&(a.h=setInterval(()=>{if(b.cues){var e=a.m.getSeekRange().start;var f=[];for(var g of b.cues)g.endTime<e&&f.push(g);Jo(a,b,f);0<f.length&&a.g.debug(`Evicted ${f.length} old cues.`);for(var h of a.a)h.endTime<e&&a.a.delete(h);e=0<f.length}else e=!1;Ko(a,b);f=yo(d);var k=Do(f,a.l);g=new Set;h=!1;for(l of k)(k=Lo(a,l))?(l.customAttributes&&(k.customAttributes=_.hh(k.customAttributes||{},l.customAttributes)||
192
+ void 0),h=!0):(a.a.add(l),g.add(l));var l={Ei:g,Eh:0<g.size||h};const {Ei:m,Eh:n}=l;zo(f);(e||n)&&a.m.trigger(new _.H(_.fg));Io(a,m)},6E3))}};No=function(a,b){a.j.on(b,_.pc,c=>{c=c.track;c.kind===_.Be&&Mo(a,c)})};Io=function(a,b){for(const c of b)a.m.trigger(new _.H(_.cg,{detail:c}))};Lo=function(a,b){return Array.from(a.a.values()).find(c=>b.startTime===c.startTime&&b.endTime===c.endTime)||null};
193
+ Ko=function(a,b){if(b.cues){var c=xo(b.cues).filter(f=>f.type===td),d=c.filter(f=>f.xf);c=c.filter(f=>!f.xf);var e=[];for(const f of c)for(const g of d)Eo(f,g)&&(e.push(f),g.qg=f.startTime);Jo(a,b,e);0<e.length&&a.g.debug(`Removed ${e.length} duplicated cues.`)}};Jo=function(a,b,c){for(const d of c)try{b.removeCue(d)}catch(e){a.g.debug("Failed to remove cue",d,e)}};
194
+ Oo=function(a,b){b=b.track;b.kind!==_.Be&&(b.mode===_.Kf&&(b.mode=_.ce),a.a.on(b,_.Bd,c=>{c=c.target||c.srcElement;c.mode=_.ce;c.activeCues&&(c=Array.from(c.activeCues).map(a.o),a.l.append(c,[]))}))};_.L=function(a,b,c,d){d=void 0===d?{}:d;a=a.getAttribute(b);if(!a&&d.required)throw new _.I(_.D,4,4023,`Required attribute missing: ${b}`);return a?a.value:c||null};
195
+ Po=function(a,b){3===b.type&&(a.h?(a.g.debug("Attaching session token as Bearer"),b.headers.Authorization="Bearer "+a.h,delete b.headers[Og]):a.f&&(a.g.debug("Attaching tracking token"),b.headers[Qg]=a.f),a.a&&(b.headers[Rg]=a.a))};Qo=function(a,b){try{const c=JSON.parse(_.ri(_.em(b)));return{delay:c.renewalPeriod,Fh:{maxAttempts:c.retryCount,baseDelay:1E3*c.retryPeriod,backoffFactor:1,fuzzFactor:0,timeout:0}}}catch(c){return a.g.warn("Failed to parse legacy renewal info",c),null}};
196
+ Ro=function(a,b){if(b.request&&3===b.request.type){const g=b.headers[_.Ug],h=b.headers[_.Tg];if(g){a.h=g;a.g.debug("Loaded session token");a.f=b.headers[Qg]||null;a.a=b.headers[Rg]||null;if(h){try{b=h;try{var c=JSON.parse(_.ri(_.em(b)))}catch(l){c=JSON.parse(b)}const k=c.renewal;if(k){var d=k.retryInterval||10,e=k.graceDuration||60;a.g.debug("Parsed session info: interval\x3d"+k.interval+"s, retryInterval\x3d"+d+"s, graceDuration\x3d"+e+"s");var f={delay:k.interval,Fh:{maxAttempts:Math.ceil(e/d),
197
+ baseDelay:1E3*d,backoffFactor:1,fuzzFactor:0,timeout:0}}}else a.g.warn("Session info missing renewal data"),f=null}catch(k){a.g.warn("Unable to parse session info",k),f=null}return f}return(f=b.headers[Pg])?Qo(a,f):null}a.h=null;a.f=b.headers[Qg];a.a=b.headers[Rg];f=b.headers[Pg];a.f&&a.g.debug("Loaded tracking token "+a.f);a.a&&a.g.debug("Loaded followup token "+a.a);if(f)return Qo(a,f)}return null};
198
+ _.To=function(a){a=_.So[a];if(!a)return null;const b=_.pj();return b.os===ij&&4===b.osVersion.major&&4===b.osVersion.minor?null:new Uint8Array(a)};_.Uo=function(a,b){return void 0===a?b:null===a?null:typeof a===_.Uf?_.To(a):a};
199
+ _.on=function(a,b){const c={};var d=b?b.widevineVideoRobustness:void 0;const e=b?b.widevineAudioRobustness:void 0,f=b?b.serverCertificate:void 0;let g=a.f[_.wd];g&&(c[_.wd]={licenseUrl:g.licenseUrl,videoRobustness:Pm(d,g.videoRobustness),audioRobustness:Pm(e,g.audioRobustness),modifiers:g.modifiers,distinctiveIdentifierRequired:Om(b?b.widevineDistinctiveIdentifierRequired:void 0,g.distinctiveIdentifierRequired,!1),persistentStateRequired:Om(b?b.widevinePersistentStateRequired:void 0,g.persistentStateRequired,
200
+ !1),serverCertificate:_.Uo(f,g.serverCertificate)});(g=a.f[_.sd])&&(c[_.sd]={licenseUrl:g.licenseUrl,certificateUrl:g.certificateUrl,modifiers:g.modifiers});d=b?b.playReadyVideoRobustness:void 0;b=b?b.playReadyAudioRobustness:void 0;(g=a.f[_.ud])&&(c[_.ud]={licenseUrl:g.licenseUrl,videoRobustness:d||g.videoRobustness,audioRobustness:b||g.audioRobustness,individualizationServer:g.individualizationServer,useLegacySystem:g.useLegacySystem,modifiers:g.modifiers});return c};
201
+ _.Vo=function(){throw new _.I(_.D,3,3E3);};_.Wo=function(a,b,c){const d=c||0;c=b.byteLength-d;const e=_.G(a.f.buffer);b=_.G(b.buffer,d,c);try{e.set(b,a.a),a.a+=c}catch(f){_.Vo()}};_.M=function(a,b){try{a.f.setUint32(a.a,b,a.h),a.a+=4}catch(c){_.Vo()}};_.Xo=function(a){return a.a<a.f.byteLength};_.Yo=function(){throw new _.I(_.D,3,3E3,"Buffer read out of bounds.");};_.Zo=function(a){try{const b=a.f.getUint8(a.a);a.a+=1;return b}catch(b){_.Yo()}};
202
+ _.$o=function(a){try{const b=a.f.getUint16(a.a,a.h);a.a+=2;return b}catch(b){_.Yo()}};_.N=function(a){try{const b=a.f.getUint32(a.a,a.h);a.a+=4;return b}catch(b){_.Yo()}};_.ap=function(a){try{const b=a.f.getInt32(a.a,a.h);a.a+=4;return b}catch(b){_.Yo()}};_.bp=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){_.Yo()}if(2097151<c)throw new _.I(_.D,3,3001);a.a+=8;return c*Math.pow(2,32)+b};
203
+ cp=function(a,b){const c=new Uint8Array(b);for(let d=0;d<b;d++)c[d]=_.Zo(a);return c};_.dp=function(a,b){a.a+b>a.f.byteLength&&_.Yo();var c=a.a+a.f.byteOffset;c=a.f.buffer.slice(c,c+b);a.a+=b;return _.G(c)};ep=function(a){let b=0;for(let c=0;c<a.length;c++)b=b<<8|a.charCodeAt(c);return b};_.fp=function(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)};_.gp=function(a){for(;_.Xo(a.reader)&&!a.parser.a;)a.parser.Ie(a.start+a.headerSize,a.reader,a.partialOkay)};
204
+ _.hp=function(a){for(let b=_.N(a.reader);0<b&&!a.parser.a;--b)a.parser.Ie(a.start+a.headerSize,a.reader,a.partialOkay)};_.ip=function(a){return b=>{const c=b.reader.Ta()-b.reader.getPosition();a(_.dp(b.reader,c))}};_.jp=function(a){return 8+(a.has64BitSize?8:0)+(null!=a.flags?4:0)};kp=function(a){let b="";try{b=_.ui(a)}catch(c){}return b};_.mp=function(a){a=kp(a);let b="";a.length&&(b=(new _.lp(a)).a);return b};
205
+ op=function(a){if(!a)return null;let b=null;try{const c=JSON.parse(_.ri(a)),d=_.em(c.sinf[0]);(new _.np).N(_.Nf,_.gp).N("schi",_.gp).N("tenc",e=>{e.reader.skip(6);_.Zo(e.reader)&&(e.reader.skip(1),b=_.gm(_.dp(e.reader,16)));e.parser.stop()}).parse(d)}catch(c){}return b};
206
+ qp=function(a,b,c){if(!c||!c.byteLength)throw new _.I(_.D,6,6102);let d;typeof b===_.Uf?d=_.wi(b,!0):d=b;a=_.wi(kp(a),!0);b=new _.pp(12+a.byteLength+d.byteLength+c.byteLength,!0);_.M(b,a.byteLength);_.Wo(b,_.G(a));_.M(b,d.byteLength);_.Wo(b,_.G(d));_.M(b,c.byteLength);_.Wo(b,_.G(c));return _.G(b.buffer)};_.rp=function(a){var b=_.G(a.body);b=_.dm(b);a.headers[ta]=Dc;a.body=_.vi("spc\x3d"+b).buffer};
207
+ _.sp=function(a){let b;try{b=_.ri(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=pi(_.em(b))};tp=function(){return{video:[Ga,Ia,Ha,_.pb,_.ob],audio:[Ga,Ia,Ha,_.pb,_.ob]}};up=function(){return{video:["3000","2000","150"],audio:["2000","150"]}};
208
+ zp=function(a,b){b=vp(b);if(a===_.wd)return b+wp;if(a===_.ud)return b+xp;if(a===_.sd)return b+yp;throw Error("Unknown DRM Key-System '"+a+"'. Can not infer license URL!");};_.Cp=function(a,b,c,d){d=void 0===d?!0:d;c=a.drm;c&&c.env.startsWith(wa)?c.customData&&(_.Bp(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)):Ap.warn(Ua)};
209
+ _.Dp=function(a,b){try{const c=_.G(b.data),d=JSON.parse(String.fromCharCode.apply(null,c));Ap.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){Ap.debug("Unable to parse DRMtoday response JSON, assuming the response contained raw data")}};
210
+ _.Fp=function(a,b,c){var d=c&&c.customData&&c.customData.fpsContentId;_.Cp(a,b,c,!1);b.headers[ta]=Dc;c={spc:_.cm(b.body)};if((a=a.drm)&&a.env.startsWith(xa)&&d){a={};var e=Sm((new _.lp(Ep(d))).f);d=e.keyId;if(e=e.assetId)Ap.info("Applying assetId from HLS manifest."),a.assetId=e;d&&(Ap.info("Applying keyId from HLS manifest."),a.keyId=d);d=a;d.keyId&&(Ap.info("Adding keyID to FPS payload:",d.keyId),c.keyId=d.keyId);d.assetId&&(Ap.info("Adding assetID to FPS payload:",d.assetId),c.assetId=d.assetId)}b.body=
211
+ _.xi(_.Rm(c,!0))};_.Gp=function(a,b){Ap.debug("Clearing response data");200===b.status&&(a=_.ri(b.data).trim(),"\x3cckc\x3e"===a.substr(0,5)&&"\x3c/ckc\x3e"===a.substr(-6)&&(a=a.slice(5,-6)),b.data=_.em(a).buffer)};
212
+ _.Hp=function(a,b,c){b=kp(b);c=c&&c.customData?c.customData:{};b=new _.lp(Ep(b));const d=Sm(b.f);if(a&&a.drm&&a.drm.customData){var e=a.drm.customData;a=e.assetId;e=e.variantId;a&&_.Ai(`${a}`)&&(d.assetId=a,Ap.debug("Using assetId from the configuration instead of the value from the HLS manifest."));e&&_.Ai(`${e}`)&&(d.variantId=e,Ap.info("Using variantId from the configuration instead of the value from the HLS manifest."))}d.keyId?(a=["keyId"],Ap.debug("KeyId found in FPS SKD. Removing other parameters")):
213
+ a=["assetId","variantId"];b.f=_.Rm(d,!1,a);"/"!==b.path||b.j.includes(`${b.a}/`)||(b.path="");b=_.Qm(b);return c.fpsContentId=b};_.Ip=function(a,b){a=a.drm;if(!a||!a.env.startsWith(wa))Ap.warn(Ua);else if(a.customData&&a.customData.merchant&&!a.env.startsWith(xa)){const c=new _.um(b.uris[0]);let d=c.a.pathname;d.endsWith("/")||(d+="/");d+=a.customData.merchant;c.a.pathname=d;b.uris[0]=c.toString()}};
214
+ Jp=function(a,b,c){_.Cp(a,b,c);a=a.drm;a=!(!a||!a.offlineId);c=new _.um(b.uris[0]);c.a.searchParams.set(_.Ue,a.toString());b.uris[0]=c.toString()};vp=function(a){if(a===Kp)return"https://lic.drmtoday.com";if(a===Lp)return"https://lic.staging.drmtoday.com";if(a===Mp)return"https://lic-demo.staging.drmtoday.com";if(a===Np)return"https://lic.test.drmtoday.com";throw Error("Unknown DRMtoday environment '"+a+"'. Can not infer DRMtoday base URL!");};
215
+ Qp=function(a,b,c){const d=tp(),e=up();b.endsWith("/")||(b+="/");const f=(g,h)=>g?g.startsWith(_.fe)||g.startsWith(_.ge)?g:b+g:b+h;c=c||{};a=new _.Op(a);a.Ga(_.wd,{licenseUrl:f(c.widevineUrl,wp),videoRobustness:d.video,audioRobustness:d.audio,persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:_.Cp,licenseResponse:_.Dp}});a.Ga(_.sd,{licenseUrl:f(c.fairplayUrl,yp),certificateUrl:f(c.fairplayCertificateUrl||c.fairplayUrl,Pp),modifiers:{licenseRequest:_.Fp,
216
+ licenseResponse:_.Gp,extractContentId:_.Hp,certificateRequest:_.Ip}});a.Ga(_.ud,{licenseUrl:f(c.playreadyUrl,xp),videoRobustness:e.video,audioRobustness:e.audio,modifiers:{licenseRequest:Jp}});_.nn(a)};Ep=function(a){a=a.replace(/assetid/gi,"assetId");a=a.replace(/variantid/gi,"variantId");return a=a.replace(/keyid/gi,"keyId")};
217
+ _.Bp=function(a,b){if((b=b.drm)&&b.customData){var c={userId:b.customData.userId,sessionId:b.customData.sessionId,merchant:b.customData.merchant};_.kh(c)&&(a.headers["dt-custom-data"]=btoa(JSON.stringify(c)));(b=b.customData.authToken)&&(a.headers[Og]=b)}};Sp=function(a){const b={},c=a?a[Sg]:void 0;a=Rp[a?a[Sg]:void 0];c&&(b.drmTodayErrorCode=c);a&&(b.drmTodayErrorMessage=a);return b};
218
+ Tp=function(a){a=a["x-dt-li"];if(!a)return null;try{const b=JSON.parse(atob(a));a={};b.ti&&(a.requestId=b.ti);b.rpd&&(a.delay=Number(b.rpd)/1E3);return a}catch(b){return Ap.warn("Unable to parse DRMtoday License Info header (x-dt-li)",b),null}};Up=function(a,b){a.size=void 0===b?0:1;a.g.debug("Setting key status to",b);a.a=b};Wp=function(a,b,c,d){b===HTMLMediaElement.HAVE_NOTHING||a.readyState>=b?d():(b=Vp.value().get(b),c.one(a,b,d))};
219
+ Xp=function(a,b){a.f=b;_.ai(a.a);if(!b)return Promise.resolve();a.a.on(b,Ud,c=>{_.Ch("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,Mg,c=>{{a.g.debug("Handle webkitNeedKey event");c=_.G(c.initData);if(_.oi(c).getUint32(0,!0)+4!==c.byteLength)throw new RangeError("Malformed FairPlay init data");c=ti(c.subarray(4),
220
+ !0);c=_.vi(c);const d=new Event(Ud);d.initDataType="skd";d.initData=pi(c);a.f.dispatchEvent(d)}});Wp(b,HTMLMediaElement.HAVE_METADATA,a.a,()=>b.webkitSetMediaKeys(a.h));return Promise.resolve()};Yp=function(a,b){Up(a.keyStatuses,b);b=new _.H(je);a.dispatchEvent(b)};
221
+ aq=function(a,b){a.a=b;_.ai(a.f);b&&(a.f.on(b,a.h+"needkey",c=>{{const d=new Event(Ud);d.initDataType=_.Wc;d.initData=pi(c.initData);a.a.dispatchEvent(d)}}),a.f.on(b,a.h+"keymessage",c=>{{const e=Zp(a,c.sessionId);if(e){var d=void 0===e.keyStatuses.getStatus();c=new _.H(_.Ae,{messageType:d?me:le,message:c.message});d=e;_.Ch("WebkitEmeManager.MediaKeySession.generated");d.f&&(d.f.resolve(),d.f=null);e.dispatchEvent(c)}else _.Dh("Session not found",c.sessionId)}}),a.f.on(b,a.h+"keyadded",c=>{(c=Zp(a,
222
+ c.sessionId))&&c.ready()}),a.f.on(b,a.h+"keyerror",c=>{var d=Zp(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?$p(d,_.Se):1===e?$p(d,"expired"):$p(d,_.ie))}}}))};
223
+ Zp=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};$p=function(a,b){Up(a.keyStatuses,b);b=new _.H(je);a.dispatchEvent(b)};bq=function(a,b){return a.w?a.w+b.charAt(0).toUpperCase()+b.slice(1):b};
224
+ cq=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===_.Ve)if(c)d=_.G(_.vi("LOAD_SESSION|"+c));else{const f=_.vi("PERSISTENT|"),g=new Uint8Array(f.byteLength+b.byteLength);g.set(f,0);g.set(_.G(b),f.byteLength);d=g}else d=_.G(b)}catch(f){return Promise.reject(f)}a.f=new _.Kl;const e=bq(a,"generateKeyRequest");try{a.j[e](a.h,d)}catch(f){if(f.name!==Ka)return a.f=null,Promise.reject(f);(new _.Pi(()=>{try{a.j[e](a.h,d)}catch(g){a.f.reject(g),
225
+ a.f=null}})).la(.01)}return a.f};dq=function(a,b,c){if(a.a)a.a.then(()=>dq(a,b,c)).catch(()=>dq(a,b,c));else{a.a=b;if(a.h===Ig){var d=_.ri(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=_.em(e.keys[0].k);e=_.em(e.keys[0].kid)}else d=_.G(c),e=null;var f=bq(a,"addKey");try{a.j[f](a.h,d,e,a.sessionId)}catch(g){a.a.reject(g),a.a=null}}};
226
+ gq=function(a,b){var c=eq;if(a){var d=c.find(e=>e.a()===a);if(d)return fq.info(Lb+d.a()),d.create();fq.info("Cannot create selected EME manager, falling back to the default.")}if(b&&(d=c.find(e=>e.a()===b)))return fq.info(Lb+d.a()),d.create();c=c[0];if(!c)throw Error("Missing EME managers.");fq.info(Lb+c.a());return c.create()};_.jq=function(a){var b=_.fm(a);b=parseInt(b.byteLength,10).toString(16);b=_.fm("12"+b+a);return new hq(iq,a,b)};
227
+ _.lq=function(a){const b=new _.kq(new DataView(a.buffer,a.byteOffset,a.byteLength),!1);a=_.N(b);var c=_.N(b);c=_.fp(c);var d=_.N(b);const e=d>>>24;d&=16777215;var f=_.dp(b,16);f=_.gm(f);if(0<e){var g=_.N(b);b.skip(16*g)}g=_.N(b);const h=()=>{let u=_.Zo(b),v=(u&127)>>>0,y=7;for(;128<=u&&28>=y;)u=_.Zo(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(!_.Xo(b))throw Error("not enough data to skip!");while(_.Zo(b)&128);break;case 1:b.skip(8);break;case 2:b.skip(h());
228
+ 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(;_.Xo(b);){var n=h(),p=n&7;n>>>=3;if(2===p){p=h();if(0>p)throw Error(`unable to read length of field ${n}`);p=cp(b,p);2===n?l.push(p):4===n&&(m=p)}else k(p)}_.Ch("Parsed WV PSSH Box","size",a,"name",c,wg,e,"flags",d,"size",g,"systemId",f,"contentId (base64)",m?_.cm(m):"","keyIds",l.map(u=>_.gm(u)));return 0<l.length?_.jq(_.gm(l[0])):null};
229
+ _.mq=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=_.G(a);a.set(b,0);return a};
230
+ _.rq=function(a){var b=_.O;a:{var c=new _.kq(new DataView(a.buffer),!0);_.N(c);for(_.$o(c);_.Xo(c);)if(1===_.$o(c)){var d=_.$o(c);c=_.dp(c,d);break a}c=null}c||(c=a);a=ti(c,!0);d=b.j(a,"WRMHEADER");a=d.getAttribute(wg)||"";d=b.h(d,"DATA");var e=b.h(d,"LA_URL");b=e?b.f(e):"";var f=_.O;if(e=f.h(d,"KID"))if(e=f.f(e)){var g=f.h(d,oa);f=g?f.f(g):null;e={value:e,Ze:f}}else e=null;else e=null;d=e?[e]:(e=nq(d))?[e]:(d=oq(d))?d:null;const {value:h="",Ze:k}=d&&d[0]||{};d=_.em(h);d=_.mq(d);d=_.gm(d);return new _.pq(_.qq,
231
+ d,b,c,a,k)};nq=function(a){var b=_.O;a=b.h(a,"PROTECTINFO");if(!a)return null;var c=b.h(a,"KID");if(!c)return null;b=c.getAttribute("VALUE");if(!b)return null;a=c.getAttribute(oa);c=c.getAttribute("ALGID");return{value:b,Ze:a,Ch:c}};
232
+ oq=function(a){var b=_.O;a=b.h(a,"PROTECTINFO");if(!a)return null;a=b.h(a,"KIDS");if(!a)return null;a=b.a(a,"KID");if(!a.length)return null;b=[];for(const c of a)if(a=c.getAttribute("VALUE")){const d=c.getAttribute(oa),e=c.getAttribute("ALGID");b.push({value:a,Ze:d,Ch:e})}return b.length?b:null};sq=function(a){return _.w(function*(){const b=new Promise(c=>{(new _.Pi(c)).la(1)});(yield Promise.race([a.close().then(()=>!0),b.then(()=>!1)]))||_.B("Timeout waiting for session close")})};
233
+ _.uq=function(a){return tq(a)?_.ud:a};vq=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};
234
+ wq=function(a,b){b=b[_.uq(a.keySystem)];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=b.serverCertificate||null))};
235
+ _.xq=function(a,b){b=_.Xm(a.mimeType,b||a.codecs);if(_.Lm(b,a.type)){a=a.type;var c=_.Lm(b,a);c&&(c=c(),b=c.convertCodecs(a,b),c.destroy())}return b};yq=function(a){for(const b of a.audioCapabilities||[])delete b.robustness;for(const b of a.videoCapabilities||[])delete b.robustness};Aq=function(a){return(a.audioCapabilities||[]).some(zq)||(a.videoCapabilities||[]).some(zq)};
236
+ Bq=function(a,b){a=_.mp(b);_.Ch("Using default Content ID extractor. The hostname part from HLS #EXT-X-KEY:URI skd:// will be used.","Extracted Content ID: "+a);return a};
237
+ Dq=function(a){var {playerConfig:b,initData:c,initDataType:d,drmInfo:e,drmSystemConfig:f,sessionContext:g,emeApi:h}=a;if("skd"===d&&h===Cq){a=e.serverCertificate;let k=f&&f.modifiers&&f.modifiers.extractContentId;_.mh(k)||(k=Bq);let l="";try{l=k(b,c,g)}catch(m){throw new _.I(_.D,6,6103);}if(!l.length)throw new _.I(_.D,6,6101,"Content ID is an empty string");c=qp(c,l,a)}return c};tq=function(a){return!!a.match(/^com\.(microsoft|chromecast)\.playready/)};
238
+ zq=function(a){return null!=a.robustness&&""!==a.robustness};Eq=function(a,b,c,d,e){for(const f of a){b.includes(f.licenseServerUri)||b.push(f.licenseServerUri);f.serverCertificate&&(c.some(g=>_.hm(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])}};
239
+ Fq=function(a){var b=a.o;const c=a.X;c.clear();b.forEach((d,e)=>c.set(e,d));b=Array.from(c.values());b.length&&b.every(d=>"expired"===d)&&a.w(new _.I(_.D,6,6014));a.D.rf(_.th(c));a.A||a.g.info(va);a.A=!0;a.F=!1};Gq=function(a){a.h.forEach((b,c)=>{const d=b.mf;let e=c.expiration;isNaN(e)&&(e=Infinity);e!==d&&(a.D.qf(c.sessionId,e),b.mf=e)})};
240
+ Hq=function(a){return _.w(function*(){a.B.release();a.B=null;a.M.release();a.M=null;a.A=!1;a.F=!1;a.H.reject();a.ca.stop();a.ca=null;a.U.stop();a.U=null;const b=Array.from(a.h.keys());for(const c of a.h.values())c.td&&c.td.stop();a.h.clear();yield Promise.all(b.map(c=>Promise.resolve().then(()=>_.w(function*(){a.g.debug("Closing session",c.sessionId);try{yield sq(c)}catch(d){a.g.warn("Error while closing session",d)}}))));if(a.C){try{yield a.l.h(null)}catch(c){a.g.warn("Error while resetting media keys",
241
+ c)}a.C=null}a.l=null;a.a=null;a.J.clear();a.I=null;a.L=[];a.f=null;a.w=null;a.D=null;a.R=0;a.P=null})};_.Nq=function(a,b){const c=Iq(a,b),d=Jq(b);for(const e of d)Kq(a,e,a.f.La);b=Lq(a,b);if(!b.size)return a.S=!0,Promise.resolve();_.zm(Hd);a=_.Mq(a,b);return(c?a:a.catch(()=>{})).then(()=>{_.zm(Gd);_.Bm("DRM queryMediaKeys_()",Hd,Gd)})};
242
+ _.Pq=function(a,b,c){c=void 0===c?[]:c;a.K=Oq;a.L=c;a.G=0<c.length;a.g.debug("Using Persisted Licenses: "+a.G);a.f&&a.f.enableSessionCacheForSkd&&a.g.info("Enabled session cache for SKD license requests");return _.Nq(a,b)};
243
+ _.Mq=function(a,b){if(1===b.size&&b.has(""))return Promise.reject(new _.I(_.D,6,6E3));null===a.l&&(a.l=gq(a.f.emeApi,a.lb));for(var c of b.values())0===c.audioCapabilities.length&&delete c.audioCapabilities,0===c.videoCapabilities.length&&delete c.videoCapabilities;let d=c=new _.Kl;const e=_.pj(),f=(k,l,m)=>{l.drmInfos.some(n=>!!n.licenseServerUri)===k&&(d=d.catch(()=>{if(a.j)return null;if(m===_.ud){if((_.Ri()||e.os===kj&&_.Si("Chrome")&&!_.Ri())&&!a.f.La[m].useLegacySystem)return l.label=vd,a.l.a(vd,
244
+ [l]).catch(()=>{a.g.warn("Unable to create com.microsoft.playready.recommendation. Falling back to com.microsoft.playready.");l.label=_.ud;yq(l);return a.l.a(m,[l])});yq(l)}if(m===_.wd&&a.f.widevineVersion!==_.wd){const n=a.f.widevineVersion;if(!n.startsWith(_.wd))return a.g.error(`Invalid "widevineVersion" value "${n}".`),Promise.reject();const p=Object.assign({},l,{label:n,distinctiveIdentifier:_.Qe,persistentState:_.Qe});return a.l.a(n,[p]).catch(()=>a.l.a(m,[l]))}return a.l.a(m,[l]).catch(n=>
245
+ {a:{if(m===_.wd&&Aq(l)){const p=_.pj();if(Aq(l)&&p.os===ij&&p.browser===$c){a.g.warn("requestMediaKeySystemAccess() failed",n);a.g.warn("Will try to recover by removing the robustness attribute of videoCapabilities and audioCapabilities.");yq(l);n=a.l.a(m,[l]);break a}}throw n;}return n})}))};let g=a.f.preferredDrmSystem;if(!g){var h=_.pj();if(h.os===kj&&10<=h.osVersion.major&&"edge"===h.browser)g=_.ud;else if("safari"===h.browser)g=_.sd;else if(h.browser===$c||"firefox"===h.browser)g=_.wd}g&&(h=
246
+ b.get(g))&&(f(!0,h,g),f(!1,h,g));for(const k of[!0,!1])b.forEach((l,m)=>{m!==g&&f(k,l,m)});d=d.catch(()=>{throw new _.I(_.D,6,6001,"Failed to get MediaKeySystemAccess.");});d=d.then(k=>{if(a.j)return null;a.J.clear();var l=k.getConfiguration();a.g.info("Got MediaKeySystemAccess with configuration",l);var m=l.audioCapabilities||[];l=l.videoCapabilities||[];for(var n of m)a.J.add(n.contentType.toLowerCase());for(var p of l)a.J.add(p.contentType.toLowerCase());{m=k.keySystem;n=b.get(_.uq(k.keySystem));
247
+ p=[];l=[];const u=[],v=[];Eq(n.drmInfos,p,l,u,v);1<l.length&&_.B("Multiple unique server certificates found! Only the first will be used.");1<p.length&&_.B("Multiple unique license server URIs found! Only the first will be used.");m={keySystem:m,licenseServerUri:p[0],distinctiveIdentifierRequired:n.distinctiveIdentifier===_.Af,persistentStateRequired:n.persistentState===_.Af,audioRobustness:n.audioCapabilities?n.audioCapabilities[0].robustness:"",videoRobustness:n.videoCapabilities?n.videoCapabilities[0].robustness:
245
248
  "",serverCertificate:l[0],initData:u,keyIds:v,periodId:null}}a.a=m;if(!a.a.licenseServerUri)throw new _.I(_.D,6,6012,a.a.keySystem);return k.createMediaKeys()}).then(k=>{a.j||(a.g.info("Created MediaKeys for key system",a.a.keySystem),a.I=k,a.S=!0)}).catch(k=>{if(!a.j){a.a=null;a.J.clear();if(k instanceof _.I)throw k;throw new _.I(_.D,6,6002,{browserError:k.message});}});c.reject();return d};
246
- Gq=function(a){a=nh(a.f.La[_.Qe]||{});if(0===a.size)return null;const b=[],c=[];a.forEach((e,f)=>{f=_.bm(f);e=_.bm(e);e={kty:"oct",kid:_.$l(f,!1),k:_.$l(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:_.Qe,licenseServerUri:"data:application/json;base64,"+window.btoa(a),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:d,
247
- keyIds:[],periodId:null}};zq=function(a){const b=[];for(const c of a)for(const d of c.drmInfos)b.push(d);return b};Hq=function(a,b){for(const c of b)""===c.licenseServerUri||a.f.La[c.keySystem]||(a.f.La[c.keySystem]={licenseUrl:""})};
248
- yq=function(a,b){const c=b.some(g=>0<g.drmInfos.length);if(!c){var d=nh(a.f.La);lq(b,d)}d=a.f.La[_.sd];const e=b.some(g=>g.drmInfos.some(h=>h.keySystem===_.sd));if(!1!==a.f.pj&&_.Yi()&&!e&&d)for(var f of b)f.drmInfos.push({keySystem:_.sd,licenseServerUri:d.licenseUrl,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],keyIds:[],periodId:null});if(f=Gq(a))for(const g of b)g.drmInfos=[f];b=zq(b);Hq(a,b);for(const g of b)mq(g,
249
- a.f.La);return c};Aq=function(a,b,c){const d=_.kq(b.keySystem);c=c[d];d===_.Qe&&b.licenseServerUri?a.g.debug("Using Clear Key data URI for",d):c&&c.licenseUrl?(b.licenseServerUri=c.licenseUrl,a.g.debug("Using license server URI from user-configured clpp.drm.DrmEnvironment (licenseUrl) for",d)):a.g.debug("Using license server URI from the manifest for ",d)};
250
- Bq=function(a,b){var c=new Set(zq(b));const d=a.G?_.zf:_.Pe,e=a.G?[_.Ue]:[Xf];a=new Map;for(const f of c)a.set(f.keySystem,{initDataTypes:[_.Wc],audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:_.Pe,persistentState:d,sessionTypes:e,label:f.keySystem,drmInfos:[]});for(const f of b){b=f.audio;c=f.video;const g=b?_.nq(b):"";let h=null;b&&"ac-3"===b.codecs.toLowerCase()&&_.Pi()&&(h=_.nq(b,_.Td));const k=c?_.nq(c):"";let l=null;c&&"ac-3"===c.codecs.toLowerCase()&&_.Pi()&&(l=_.nq(c,_.Td));
251
- 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(p=>p.initDataType))]);m.distinctiveIdentifierRequired&&(n.distinctiveIdentifier=_.zf);m.persistentStateRequired&&(n.persistentState=_.zf);b&&_.Zh(m.audioRobustness).forEach(p=>{const u={robustness:p||"",contentType:g};n.audioCapabilities.find(v=>v.robustness===u.robustness&&v.contentType===u.contentType)||n.audioCapabilities.push(u);h&&n.audioCapabilities.push({robustness:p||
252
- "",contentType:h})});c&&_.Zh(m.videoRobustness).forEach(p=>{const u={robustness:p||"",contentType:k};n.videoCapabilities.find(v=>v.robustness===u.robustness&&v.contentType===u.contentType)||n.videoCapabilities.push(u);l&&n.videoCapabilities.push({robustness:p||"",contentType:l})})}}return a};Iq=function(a){return _.w(function*(){if(!a.l.o())if(a.N)yield a.N;else try{a.N=a.l.h(a.I),yield a.N}catch(b){a.j||a.w(new _.I(_.D,6,6003,b.message,b))}})};
253
- _.Mq=function(a,b,c,d){d=void 0===d?"":d;if(c.length&&(!a.G||a.K!==Eq)){var e=a.keySystem();if(!e.startsWith(_.sd)&&b===_.Wc){const f=new Jq(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.C.webkitCurrentPlaybackTargetIsWireless||
254
- _.Pi(2)||a.keySystem().startsWith(_.sd)||!_.Kq(a,d,c,!0))&&Lq(a,d,null,b,c)}};Nq=function(a,b){return _.w(function*(){a.g.info(`Handle encrypted event for type ${b.initDataType}`);yield Iq(a);b.initData&&_.Mq(a,b.initDataType,_.G(b.initData))})};Pq=function(a){return _.w(function*(){_.vm(Jd);const b=a.W.map(c=>Oq(a,c));a.ia=!0;a.W=[];yield Promise.all(b);_.vm(Id);_.xm("drm.onPlay",Jd,Id)})};
255
- Rq=function(a){const b=a.keySystem(),c=a.f.La[b],d=c.certificateUrl||"";if(""===d)return Promise.resolve();const e=a.D.getConfiguration();return Qq(a,e).then(()=>{var f=c.modifiers;const g=f&&f.certificateRequest,h=f&&f.certificateResponse;f=_.vk([d],a.f.attemptParameters);f.type=3;f.licenseRequestType=Yc;g&&f.requestModifiers.push(k=>g(e,k));h&&f.responseModifiers.push(k=>h(e,k));a.g.debug("Fetching certificate");return a.D.Ab.fetch(f).V}).then(f=>{a.a.serverCertificate=_.G(f.data)}).catch(f=>{var g=
256
- f.data.headers;g=Object.assign({message:Ba,url:f.data.url,status:f.data.status,response:f.data.response},g?{headers:g}:{},Ip(g));throw new _.I(_.D,6,6100,g,f);})};
257
- _.Sq=function(a){return _.w(function*(){if(a.I&&a.a&&a.a.serverCertificate&&a.a.serverCertificate.length)try{const b=yield a.I.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 _.I(_.D,6,6004,{browserError:b.message});}})};
258
- _.Vq=function(a){const b=a.a?a.a.initData||[]:[];for(const c of b){let d=!_.Pi(2);if(a.f.enforceSingleSession&&!a.keySystem().startsWith(_.sd)){const e=a.h.values();for(const f of e)_.dm(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}.`),Tq(c.initData,f)||(f.fe.push(c.initData),c.keyId&&!f.sb.includes(c.keyId)&&
259
- f.sb.push(c.keyId),a.o.get(c.keyId)||a.o.set(c.keyId,Rf)),d=!1)}!d||a.G&&a.K===Eq||(_.Kq(a,c.keyId,c.initData)&&(d=!1),d&&(a.g.info("Request new media key session on create"),Lq(a,c.keyId,c.periodId,c.initDataType,c.initData)))}for(const c of a.L)_.Uq(a,c);b.length||a.L.length||(a.A||a.g.info(va),a.A=!0,a.F=!1,a.H.resolve());return a.H};
260
- _.Xq=function(a,b){if(!a.I)return Yh(a.B,b,()=>{a.w(new _.I(_.D,6,6010))}),Promise.resolve();a.C=b;a.l.l(b);a.B.one(a.C,_.We,()=>Pq(a));a.B.on(a.C,_.Gg,e=>{const f=a.F;a.F=!a.A;!f&&a.F&&(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.l.f()!==Wq||a.L.length)d=Iq(a);c=Promise.resolve();_.Si()&&38===_.Wi().major||(a.a&&a.a.keySystem!==_.Qe&&!a.a.serverCertificate&&(c=Rq(a)),c=c.then(()=>_.Sq(a)));return Promise.all([d,
261
- c]).then(()=>{a.j||(_.Vq(a),a.B.on(a.C,Ud,e=>Nq(a,e)))}).catch(e=>{if(!a.j){if(6004===e.code&&a.a&&a.a.keySystem===_.wd&&1>a.R&&a.a.serverCertificate&&a.a.serverCertificate.length)return a.g.warn("Detected invalid widevine server certificate!. Retrying"),a.w(new _.I(1,6,6004)),a.a.serverCertificate=null,a.R++,_.Xq(a,b);1<=a.R&&a.g.info("Could not get valid widevine server certificate. Giving up");throw e;}})};
262
- Qq=function(a,b){return _.w(function*(){const c=a.D.Tc();if(c){var d=b&&b.drm&&b.drm.customData;d&&(yield c(d))}})};
263
- _.Uq=function(a,b){let c;try{a.g.debug("Attempting to load an offline session",b),c=a.I.createSession(_.Ue)}catch(e){const f=new _.I(_.D,6,6005,{browserError:e.message});a.w(f);return Promise.reject(f)}a.B.on(c,_.ze,a.ab.bind(a));a.B.on(c,ie,a.Ma.bind(a));const d={initData:null,loaded:!1,$e:Infinity,nc:null,pb:new _.Gl,periodId:null,fe:[],keyId:null,sb:[],initDataType:null,uc:null,sessionContext:{ldlDelay:0,customData:{}}};d.pb.catch(()=>{});a.h.set(c,d);return c.load(b).then(e=>{if(a.j)return null;
264
- a.g.debug("Loaded offline session",b,e);if(!e)return a.h.delete(c),a.w(new _.I(_.D,6,6013)),null;d.loaded=!0;Yq(a)&&(a.A||a.g.info(va),a.A=!0,a.F=!1,a.H.resolve());return c},e=>{a.j||(a.h.delete(c),a.w(new _.I(_.D,6,6005,{browserError:e.message})))})};Tq=function(a,b){if(!a)return!1;for(let c=0;c<b.fe.length;c++)if(_.dm(a,b.fe[c]))return!0;return!1};
265
- _.Kq=function(a,b,c,d){d=void 0===d?!1:d;for(const e of a.h.keys()){const f=a.h.get(e);if(_.dm(c,f.initData))return b?f.sb.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.sb.push(b),a.o.get(b)||a.o.set(b,Rf),d&&a.g.info(rb+`Session: '${e.sessionId}'`+`Adding Key ID ${b} to session meta-data.`)):d&&a.g.info(rb+`Session: '${e.sessionId}'`),!0;if(Tq(c,f))return d&&a.g.info("Skipping Session creation. License for init data was already requested [extra]"),
249
+ Qq=function(a){a=sh(a.f.La[_.Re]||{});if(0===a.size)return null;const b=[],c=[];a.forEach((e,f)=>{f=_.fm(f);e=_.fm(e);e={kty:"oct",kid:_.dm(f,!1),k:_.dm(e,!1)};b.push(e);c.push(e.kid)});a=JSON.stringify({keys:b});var d=JSON.stringify({kids:c});d=[{initData:_.vi(d),initDataType:"keyids"}];return{keySystem:_.Re,licenseServerUri:"data:application/json;base64,"+window.btoa(a),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:d,
250
+ keyIds:[],periodId:null}};Jq=function(a){const b=[];for(const c of a)for(const d of c.drmInfos)b.push(d);return b};Rq=function(a,b){for(const c of b)""===c.licenseServerUri||a.f.La[c.keySystem]||(a.f.La[c.keySystem]={licenseUrl:""})};
251
+ Iq=function(a,b){const c=b.some(g=>0<g.drmInfos.length);if(!c){var d=sh(a.f.La);vq(b,d)}d=a.f.La[_.sd];const e=b.some(g=>g.drmInfos.some(h=>h.keySystem===_.sd));if(!1!==a.f.zj&&_.bj()&&!e&&d)for(var f of b)f.drmInfos.push({keySystem:_.sd,licenseServerUri:d.licenseUrl,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],keyIds:[],periodId:null});if(f=Qq(a))for(const g of b)g.drmInfos=[f];b=Jq(b);Rq(a,b);for(const g of b)wq(g,
252
+ a.f.La);return c};Kq=function(a,b,c){const d=_.uq(b.keySystem);c=c[d];d===_.Re&&b.licenseServerUri?a.g.debug("Using Clear Key data URI for",d):c&&c.licenseUrl?(b.licenseServerUri=c.licenseUrl,a.g.debug("Using license server URI from user-configured clpp.drm.DrmEnvironment (licenseUrl) for",d)):a.g.debug("Using license server URI from the manifest for ",d)};
253
+ Lq=function(a,b){var c=new Set(Jq(b));const d=a.G?_.Af:_.Qe,e=a.G?[_.Ve]:[_.Yf];a=new Map;for(const f of c)a.set(f.keySystem,{initDataTypes:[_.Wc],audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:_.Qe,persistentState:d,sessionTypes:e,label:f.keySystem,drmInfos:[]});for(const f of b){b=f.audio;c=f.video;const g=b?_.xq(b):"";let h=null;b&&"ac-3"===b.codecs.toLowerCase()&&_.Ti()&&(h=_.xq(b,_.Td));const k=c?_.xq(c):"";let l=null;c&&"ac-3"===c.codecs.toLowerCase()&&_.Ti()&&(l=_.xq(c,_.Td));
254
+ 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(p=>p.initDataType))]);m.distinctiveIdentifierRequired&&(n.distinctiveIdentifier=_.Af);m.persistentStateRequired&&(n.persistentState=_.Af);b&&_.ci(m.audioRobustness).forEach(p=>{const u={robustness:p||"",contentType:g};n.audioCapabilities.find(v=>v.robustness===u.robustness&&v.contentType===u.contentType)||n.audioCapabilities.push(u);h&&n.audioCapabilities.push({robustness:p||
255
+ "",contentType:h})});c&&_.ci(m.videoRobustness).forEach(p=>{const u={robustness:p||"",contentType:k};n.videoCapabilities.find(v=>v.robustness===u.robustness&&v.contentType===u.contentType)||n.videoCapabilities.push(u);l&&n.videoCapabilities.push({robustness:p||"",contentType:l})})}}return a};Sq=function(a){return _.w(function*(){if(!a.l.o())if(a.P)yield a.P;else try{a.P=a.l.h(a.I),yield a.P}catch(b){a.j||a.w(new _.I(_.D,6,6003,b.message,b))}})};
256
+ _.Wq=function(a,b,c,d){d=void 0===d?"":d;if(c.length&&(!a.G||a.K!==Oq)){var e=a.keySystem();if(!e.startsWith(_.sd)&&b===_.Wc){const f=new Tq(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.C.webkitCurrentPlaybackTargetIsWireless||
257
+ _.Ti(2)||a.keySystem().startsWith(_.sd)||!_.Uq(a,d,c,!0))&&Vq(a,d,null,b,c)}};Xq=function(a,b){return _.w(function*(){a.g.info(`Handle encrypted event for type ${b.initDataType}`);yield Sq(a);b.initData&&_.Wq(a,b.initDataType,_.G(b.initData))})};Zq=function(a){return _.w(function*(){_.zm(Jd);const b=a.W.map(c=>Yq(a,c));a.ia=!0;a.W=[];yield Promise.all(b);_.zm(Id);_.Bm("drm.onPlay",Jd,Id)})};
258
+ ar=function(a){const b=a.keySystem(),c=a.f.La[b],d=c.certificateUrl||"";if(""===d)return Promise.resolve();const e=a.D.getConfiguration();return $q(a,e).then(()=>{var f=c.modifiers;const g=f&&f.certificateRequest,h=f&&f.certificateResponse;f=_.zk([d],a.f.attemptParameters);f.type=3;f.licenseRequestType=Yc;g&&f.requestModifiers.push(k=>g(e,k));h&&f.responseModifiers.push(k=>h(e,k));a.g.debug("Fetching certificate");return a.D.Cb.fetch(f).V}).then(f=>{a.a.serverCertificate=_.G(f.data)}).catch(f=>{var g=
259
+ f.data.headers;g=Object.assign({message:Ba,url:f.data.url,status:f.data.status,response:f.data.response},g?{headers:g}:{},Sp(g));throw new _.I(_.D,6,6100,g,f);})};
260
+ _.br=function(a){return _.w(function*(){if(a.I&&a.a&&a.a.serverCertificate&&a.a.serverCertificate.length)try{const b=yield a.I.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 _.I(_.D,6,6004,{browserError:b.message});}})};
261
+ _.er=function(a){const b=a.a?a.a.initData||[]:[];for(const c of b){let d=!_.Ti(2);if(a.f.enforceSingleSession&&!a.keySystem().startsWith(_.sd)){const e=a.h.values();for(const f of e)_.hm(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}.`),cr(c.initData,f)||(f.se.push(c.initData),c.keyId&&!f.vb.includes(c.keyId)&&
262
+ f.vb.push(c.keyId),a.o.get(c.keyId)||a.o.set(c.keyId,Sf)),d=!1)}!d||a.G&&a.K===Oq||(_.Uq(a,c.keyId,c.initData)&&(d=!1),d&&(a.g.info("Request new media key session on create"),Vq(a,c.keyId,c.periodId,c.initDataType,c.initData)))}for(const c of a.L)_.dr(a,c);b.length||a.L.length||(a.A||a.g.info(va),a.A=!0,a.F=!1,a.H.resolve());return a.H};
263
+ _.gr=function(a,b){if(!a.I)return bi(a.B,b,()=>{a.w(new _.I(_.D,6,6010))}),Promise.resolve();a.C=b;a.l.l(b);a.B.one(a.C,_.Xe,()=>Zq(a));a.B.on(a.C,_.Hg,e=>{const f=a.F;a.F=!a.A;!f&&a.F&&(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.l.f()!==fr||a.L.length)d=Sq(a);c=Promise.resolve();_.Wi()&&38===_.$i().major||(a.a&&a.a.keySystem!==_.Re&&!a.a.serverCertificate&&(c=ar(a)),c=c.then(()=>_.br(a)));return Promise.all([d,
264
+ c]).then(()=>{a.j||(_.er(a),a.B.on(a.C,Ud,e=>Xq(a,e)))}).catch(e=>{if(!a.j){if(6004===e.code&&a.a&&a.a.keySystem===_.wd&&1>a.R&&a.a.serverCertificate&&a.a.serverCertificate.length)return a.g.warn("Detected invalid widevine server certificate!. Retrying"),a.w(new _.I(1,6,6004)),a.a.serverCertificate=null,a.R++,_.gr(a,b);1<=a.R&&a.g.info("Could not get valid widevine server certificate. Giving up");throw e;}})};
265
+ $q=function(a,b){return _.w(function*(){const c=a.D.bd();if(c){var d=b&&b.drm&&b.drm.customData;d&&(yield c(d))}})};
266
+ _.dr=function(a,b){let c;try{a.g.debug("Attempting to load an offline session",b),c=a.I.createSession(_.Ve)}catch(e){const f=new _.I(_.D,6,6005,{browserError:e.message});a.w(f);return Promise.reject(f)}a.B.on(c,_.Ae,a.cb.bind(a));a.B.on(c,je,a.Ma.bind(a));const d={initData:null,loaded:!1,mf:Infinity,vc:null,rb:new _.Kl,periodId:null,se:[],keyId:null,vb:[],initDataType:null,Cc:null,sessionContext:{ldlDelay:0,customData:{}}};d.rb.catch(()=>{});a.h.set(c,d);return c.load(b).then(e=>{if(a.j)return null;
267
+ a.g.debug("Loaded offline session",b,e);if(!e)return a.h.delete(c),a.w(new _.I(_.D,6,6013)),null;d.loaded=!0;hr(a)&&(a.A||a.g.info(va),a.A=!0,a.F=!1,a.H.resolve());return c},e=>{a.j||(a.h.delete(c),a.w(new _.I(_.D,6,6005,{browserError:e.message})))})};cr=function(a,b){if(!a)return!1;for(let c=0;c<b.se.length;c++)if(_.hm(a,b.se[c]))return!0;return!1};
268
+ _.Uq=function(a,b,c,d){d=void 0===d?!1:d;for(const e of a.h.keys()){const f=a.h.get(e);if(_.hm(c,f.initData))return b?f.vb.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.vb.push(b),a.o.get(b)||a.o.set(b,Sf),d&&a.g.info(rb+`Session: '${e.sessionId}'`+`Adding Key ID ${b} to session meta-data.`)):d&&a.g.info(rb+`Session: '${e.sessionId}'`),!0;if(cr(c,f))return d&&a.g.info("Skipping Session creation. License for init data was already requested [extra]"),
266
269
  !0}return!1};
267
- Lq=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=Zq(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.f.ignoreUnrecognizedInitData)return}if(!g&&$q(a,h,d,e)){var k=!0;if("skd"===d&&!a.f.enableSessionCacheForSkd)for(var l of a.h.keys()){var m=a.h.get(l);
268
- 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.G?_.Ue:Xf;var p=a.I.createSession(n);a.D.onEvent(new _.H(Nd,{keySystem:a.keySystem()}));a.g.info(`Created new ${n} session for Key ID: '${h}'. `+`Init data type: ${d}.`)}catch(u){a.w(new _.I(_.D,6,6005,{browserError:u.message}));return}a.B.on(p,_.ze,a.ab.bind(a));a.B.on(p,ie,a.Ma.bind(a));
269
- k={uc:f,fe:[],initData:e,initDataType:d,keyId:h,sb:h?[h]:[],loaded:!1,$e:Infinity,periodId:c,nc:null,pb:new _.Gl,sessionContext:{ldlDelay:0,customData:{}}};k.pb.catch(()=>{});f&&(l=a.h.get(f),k.sessionContext=l.sessionContext);a.h.set(p,k);h&&!a.o.get(h)&&a.o.set(h,Rf);if(e)for(l=0;l<a.a.initData.length;l++)m=a.a.initData[l],m.keyId&&!k.sb.includes(m.keyId)&&_.dm(m.initData,e)&&(k.keyId||(k.keyId=m.keyId),k.sb.push(m.keyId),a.o.get(m.keyId)||a.o.set(m.keyId,Rf));l=a.D.getConfiguration();m=a.keySystem();
270
- m=a.f.La[m];n=(n=m.modifiers)&&n.transformInitData;_.hh(n)||(n=tq);try{e=n({playerConfig:l,initData:e,initDataType:d,drmInfo:a.a,drmSystemConfig:m,sessionContext:k.sessionContext,emeApi:a.l.f()})}catch(u){h=u;u instanceof _.I||(h=new _.I(_.D,6,6016,u));k.pb&&k.pb.reject(u);a.w(h);return}a.g.info(`Generate License Request for key ID: '${h}'`);p.generateRequest(d,e.buffer).catch(u=>{if(!a.j){var v=null;u.errorCode&&u.errorCode.systemCode&&(v=u.errorCode.systemCode,0>v&&(v+=Math.pow(2,32)),v="0x"+v.toString(16));
271
- a.w(new _.I(_.D,6,6006,{browserError:u.message,error:u,extended:v},u))}})}else a.g.warn("Empty init data")})};ar=function(a){let b=Infinity;a=a.h.keys();for(const c of a)isNaN(c.expiration)||(b=Math.min(b,c.expiration));return b};Yq=function(a){for(const b of a.h.values())if(!b.loaded)return!1;return!0};$q=function(a,b,c,d){if(!b&&c!==_.Mf)return!1;d=b||jp(d);for(const e of a.h.values())if(b&&e.keyId===b||b&&e.sb.includes(b)||c===_.Mf&&(e.keyId||jp(e.initData))===d)return!0;return!1};
272
- Zq=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.f.La[f];f=a.D.getConfiguration();g=g&&g.modifiers&&g.modifiers.extractContentId;_.hh(g)||(g=rq);try{var h={ldlDelay:0,customData:{}};e&&(h=a.h.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===_.Mf)return jp(c)||"";if(b===_.Wc){l=a.keySystem();try{if(l.match(/^com\.widevine\.alpha/)){const m=
273
- _.bq(c);if(m)return m.a}else if(jq(l)){{f=new _.aq(new DataView(c.buffer,c.byteOffset,c.byteLength),!1);g=_.N(f);const m=_.N(f);h=_.ap(m);const n=_.N(f);c=n>>>24;k=n&16777215;const p=_.Zo(f,16),u=_.cm(p);if(0<c){const E=_.N(f);f.skip(16*E)}const v=_.N(f),y=_.Zo(f,v),A=_.hq(y);_.xh("Parsed PR PSSH Box","size",g,"name",h,vg,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""};
274
- Oq=function(a,b){return _.w(function*(){const c=b.target,d=a.h.get(c);if(d){var e=a.a.licenseServerUri;if(br(a,b))yield cr(a,e,b,c,d);else{var f=a.xa;if(0<f&&(a.g.info(`Delaying license request by ${f} s.`),yield Ii(f),a.j))return;var g=a.keySystem(),h=a.f.La[g];"individualization-request"===b.messageType&&h&&h.individualizationServer&&(e=h.individualizationServer);var k=_.vk([e],a.f.attemptParameters);k.type=3;k.body=b.message;k.method=_.eb;k.licenseRequestType=b.messageType===le&&d.uc?ke:b.messageType;
275
- k.sessionId=c.sessionId;if(k.licenseRequestType===ke)a.D.onEvent(new _.H(Md));jq(a.a.keySystem)&&dr(a,k);Lo(a.M,k);h=String(Math.floor(b.timeStamp));if(f=yield er(a,k,d,h,e,c.sessionId,b.messageType,f))if(e=Mo(a.M,f),yield fr(a,c,f.data,d,h))h=ar(a),a.D.onEvent(new _.H(_.Qd,{keySystem:g,expirationTime:h,expectedRenewalTime:e?Date.now()+1E3*e.delay:Number.NaN})),d.nc&&d.nc.resolve(),d.uc&&(h=d.uc,a.g.info(`Closing expired session '${h.sessionId}'`),iq(h).catch(()=>{a.g.warn("Unable to close expired session in time")}),
276
- (h=a.h.get(d.uc))&&h.Oc&&h.Oc.stop(),a.h.delete(d.uc),d.uc=null),(new _.Li(()=>{a.j||(d.loaded=!0,d.pb&&d.pb.resolve(),Yq(a)&&(a.A||a.g.info(va),a.A=!0,a.F=!1,a.H.resolve()))})).la(5),null!==d.initData&&(0<d.sessionContext.ldlDelay||e&&(_.ui(g,_.sd)||_.ui(g,_.ud)))&&(h=new _.Li(()=>{!a.j&&a.M&&(a.g.info("Updating CSL Sessions"),jq(g)?Lq(a,d.keyId,d.periodId,d.initDataType,d.initData,c,!0):g.startsWith(_.sd)&&c.update(_.ri("renew")))}),d.Oc=h,h.la(e?e.delay:d.sessionContext.ldlDelay))}}else a.g.error(`Session metadata not found for ${c.sessionId}.`)})};
277
- br=function(a,b){return!!a.keySystem().match(/^com\.widevine\.alpha/)&&b.message&&2===b.message.byteLength};cr=function(a,b,c,d,e){return _.w(function*(){var f=_.vk([b],a.f.attemptParameters);f.type=3;f.body=c.message;f.method=_.eb;f.licenseRequestType=Yc;f.sessionId=d.sessionId;(f=yield gr(a,f,e,b,d.sessionId,c.messageType))&&(yield fr(a,d,f.data,e,String(Math.floor(c.timeStamp))))})};
278
- dr=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(_.ug).textContent;b.body=_.am(a.querySelector("Challenge").textContent).buffer}else a.g.debug("PlayReady request is already unwrapped."),b.headers[ta]="text/xml; charset\x3dutf-8"};
279
- er=function(a,b,c,d,e,f,g,h){return _.w(function*(){a.g.info("License request for "+`SID:'${f}'/KID:'${c.keyId}' `+`from msg '${g}'.`);yield hr(a,b,c.sessionContext);a.g.debug("Sending DRM license request to",e,b);a.D.onEvent(new _.H(Ld,{delay:h}));var k=Date.now();_.vm(`drm.license.req.${d}.start`);var l=null;try{l=yield a.D.Ab.fetch(b).V}catch(p){if(a.j)return null;l=p.data.headers;l=Object.assign({message:"Error while fetching DRM license!",url:p.data.url,status:p.data.status,response:p.data.response},
280
- l?{headers:l}:{},Ip(l));l=new _.I(_.D,6,6007,l,p);ir(a,l,c);return null}_.vm(`drm.license.req.${d}.end`);_.xm(`drm.license.req.${d}`,`drm.license.req.${d}.start`,`drm.license.req.${d}.end`);k=Date.now()-k;const m=Jp(l.headers);m&&(a.xa=m.delay||0);let n="";m&&m.requestId&&(n=` RID:${m.requestId}`);a.g.info("License response for "+`SID:'${f}'/`+`KID:'${c.keyId}' `+`${l.data.byteLength} bytes `+`in ${k}ms${n}`);return a.j?null:l})};
281
- fr=function(a,b,c,d,e){return _.w(function*(){_.vm(`drm.sess.update.${e}.start`);try{yield b.update(c)}catch(f){if(a.j)return!1;if(f===qb)return a.g.info("Ignore update for closed sessions"),!1;const g=new _.I(_.D,6,6008,{browserError:f.message});ir(a,g,d);return!1}_.vm(`drm.sess.update.${e}.end`);_.xm(`drm.sess.update.${e}`,`drm.sess.update.${e}.start`,`drm.sess.update.${e}.end`);return a.j?!1:!0})};
282
- gr=function(a,b,c,d,e,f){return _.w(function*(){a.g.info("WV Server certificate request for "+`SID:'${e} from msg '${f}'.`);yield hr(a,b,c.sessionContext);a.g.debug("Sending Widevine certificate request to",d,b);var g=Date.now(),h=null;try{h=yield a.D.Ab.fetch(b).V}catch(m){if(a.j)return null;h=m.data.headers;h=Object.assign({message:Ba,url:m.data.url,status:m.data.status,response:m.data.response},h?{headers:h}:{},Ip(h));h=new _.I(_.D,6,6100,h,m);ir(a,h,c);return null}g=Date.now()-g;const k=Jp(h.headers);
270
+ Vq=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=ir(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.f.ignoreUnrecognizedInitData)return}if(!g&&jr(a,h,d,e)){var k=!0;if("skd"===d&&!a.f.enableSessionCacheForSkd)for(var l of a.h.keys()){var m=a.h.get(l);
271
+ 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.G?_.Ve:_.Yf;var p=a.I.createSession(n);a.D.onEvent(new _.H(Nd,{keySystem:a.keySystem()}));a.g.info(`Created new ${n} session for Key ID: '${h}'. `+`Init data type: ${d}.`)}catch(u){a.w(new _.I(_.D,6,6005,{browserError:u.message}));return}a.B.on(p,_.Ae,a.cb.bind(a));a.B.on(p,je,a.Ma.bind(a));
272
+ k={Cc:f,se:[],initData:e,initDataType:d,keyId:h,vb:h?[h]:[],loaded:!1,mf:Infinity,periodId:c,vc:null,rb:new _.Kl,sessionContext:{ldlDelay:0,customData:{}}};k.rb.catch(()=>{});f&&(l=a.h.get(f),k.sessionContext=l.sessionContext);a.h.set(p,k);h&&!a.o.get(h)&&a.o.set(h,Sf);if(e)for(l=0;l<a.a.initData.length;l++)m=a.a.initData[l],m.keyId&&!k.vb.includes(m.keyId)&&_.hm(m.initData,e)&&(k.keyId||(k.keyId=m.keyId),k.vb.push(m.keyId),a.o.get(m.keyId)||a.o.set(m.keyId,Sf));l=a.D.getConfiguration();m=a.keySystem();
273
+ m=a.f.La[m];n=(n=m.modifiers)&&n.transformInitData;_.mh(n)||(n=Dq);try{e=n({playerConfig:l,initData:e,initDataType:d,drmInfo:a.a,drmSystemConfig:m,sessionContext:k.sessionContext,emeApi:a.l.f()})}catch(u){h=u;u instanceof _.I||(h=new _.I(_.D,6,6016,u));k.rb&&k.rb.reject(u);a.w(h);return}a.g.info(`Generate License Request for key ID: '${h}'`);p.generateRequest(d,e.buffer).catch(u=>{if(!a.j){var v=null;u.errorCode&&u.errorCode.systemCode&&(v=u.errorCode.systemCode,0>v&&(v+=Math.pow(2,32)),v="0x"+v.toString(16));
274
+ a.w(new _.I(_.D,6,6006,{browserError:u.message,error:u,extended:v},u))}})}else a.g.warn("Empty init data")})};kr=function(a){let b=Infinity;a=a.h.keys();for(const c of a)isNaN(c.expiration)||(b=Math.min(b,c.expiration));return b};hr=function(a){for(const b of a.h.values())if(!b.loaded)return!1;return!0};jr=function(a,b,c,d){if(!b&&c!==_.Nf)return!1;d=b||op(d);for(const e of a.h.values())if(b&&e.keyId===b||b&&e.vb.includes(b)||c===_.Nf&&(e.keyId||op(e.initData))===d)return!0;return!1};
275
+ ir=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.f.La[f];f=a.D.getConfiguration();g=g&&g.modifiers&&g.modifiers.extractContentId;_.mh(g)||(g=Bq);try{var h={ldlDelay:0,customData:{}};e&&(h=a.h.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===_.Nf)return op(c)||"";if(b===_.Wc){l=a.keySystem();try{if(l.match(/^com\.widevine\.alpha/)){const m=
276
+ _.lq(c);if(m)return m.a}else if(tq(l)){{f=new _.kq(new DataView(c.buffer,c.byteOffset,c.byteLength),!1);g=_.N(f);const m=_.N(f);h=_.fp(m);const n=_.N(f);c=n>>>24;k=n&16777215;const p=_.dp(f,16),u=_.gm(p);if(0<c){const E=_.N(f);f.skip(16*E)}const v=_.N(f),y=_.dp(f,v),A=_.rq(y);_.Ch("Parsed PR PSSH Box","size",g,"name",h,wg,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""};
277
+ Yq=function(a,b){return _.w(function*(){const c=b.target,d=a.h.get(c);if(d){var e=a.a.licenseServerUri;if(lr(a,b))yield mr(a,e,b,c,d);else{var f=a.Aa;if(0<f&&(a.g.info(`Delaying license request by ${f} s.`),yield Mi(f),a.j))return;var g=a.keySystem(),h=a.f.La[g];"individualization-request"===b.messageType&&h&&h.individualizationServer&&(e=h.individualizationServer);var k=_.zk([e],a.f.attemptParameters);k.type=3;k.body=b.message;k.method=_.eb;k.licenseRequestType=b.messageType===me&&d.Cc?le:b.messageType;
278
+ k.sessionId=c.sessionId;if(k.licenseRequestType===le)a.D.onEvent(new _.H(Md));tq(a.a.keySystem)&&nr(a,k);Po(a.M,k);h=String(Math.floor(b.timeStamp));if(f=yield or(a,k,d,h,e,c.sessionId,b.messageType,f))if(e=Ro(a.M,f),yield pr(a,c,f.data,d,h))h=kr(a),a.D.onEvent(new _.H(_.Qd,{keySystem:g,expirationTime:h,expectedRenewalTime:e?Date.now()+1E3*e.delay:Number.NaN})),d.vc&&d.vc.resolve(),d.Cc&&(h=d.Cc,a.g.info(`Closing expired session '${h.sessionId}'`),sq(h).catch(()=>{a.g.warn("Unable to close expired session in time")}),
279
+ (h=a.h.get(d.Cc))&&h.td&&h.td.stop(),a.h.delete(d.Cc),d.Cc=null),(new _.Pi(()=>{a.j||(d.loaded=!0,d.rb&&d.rb.resolve(),hr(a)&&(a.A||a.g.info(va),a.A=!0,a.F=!1,a.H.resolve()))})).la(5),null!==d.initData&&(0<d.sessionContext.ldlDelay||e&&(_.yi(g,_.sd)||_.yi(g,_.ud)))&&(h=new _.Pi(()=>{!a.j&&a.M&&(a.g.info("Triggering DRM session renewal"),tq(g)?Vq(a,d.keyId,d.periodId,d.initDataType,d.initData,c,!0):g.startsWith(_.sd)&&c.update(_.vi("renew")))}),d.td=h,h.la(e?e.delay:d.sessionContext.ldlDelay))}}else a.g.error(`Session metadata not found for ${c.sessionId}.`)})};
280
+ lr=function(a,b){return!!a.keySystem().match(/^com\.widevine\.alpha/)&&b.message&&2===b.message.byteLength};mr=function(a,b,c,d,e){return _.w(function*(){var f=_.zk([b],a.f.attemptParameters);f.type=3;f.body=c.message;f.method=_.eb;f.licenseRequestType=Yc;f.sessionId=d.sessionId;(f=yield qr(a,f,e,b,d.sessionId,c.messageType))&&(yield pr(a,d,f.data,e,String(Math.floor(c.timeStamp))))})};
281
+ nr=function(a,b){var c=ti(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(_.vg).textContent;b.body=_.em(a.querySelector("Challenge").textContent).buffer}else a.g.debug("PlayReady request is already unwrapped."),b.headers[ta]="text/xml; charset\x3dutf-8"};
282
+ or=function(a,b,c,d,e,f,g,h){return _.w(function*(){a.g.info("License request for "+`SID:'${f}'/KID:'${c.keyId}' `+`from msg '${g}'.`);yield rr(a,b,c.sessionContext);a.g.debug("Sending DRM license request to",e,b);a.D.onEvent(new _.H(Ld,{delay:h}));var k=Date.now();_.zm(`drm.license.req.${d}.start`);var l=null;try{l=yield a.D.Cb.fetch(b).V}catch(p){if(a.j)return null;l=p.data.headers;l=Object.assign({message:"Error while fetching DRM license!",url:p.data.url,status:p.data.status,response:p.data.response},
283
+ l?{headers:l}:{},Sp(l));l=new _.I(_.D,6,6007,l,p);sr(a,l,c);return null}_.zm(`drm.license.req.${d}.end`);_.Bm(`drm.license.req.${d}`,`drm.license.req.${d}.start`,`drm.license.req.${d}.end`);k=Date.now()-k;const m=Tp(l.headers);m&&(a.Aa=m.delay||0);let n="";m&&m.requestId&&(n=` RID:${m.requestId}`);a.g.info("License response for "+`SID:'${f}'/`+`KID:'${c.keyId}' `+`${l.data.byteLength} bytes `+`in ${k}ms${n}`);return a.j?null:l})};
284
+ pr=function(a,b,c,d,e){return _.w(function*(){_.zm(`drm.sess.update.${e}.start`);try{yield b.update(c)}catch(f){if(a.j)return!1;if(f===qb)return a.g.info("Ignore update for closed sessions"),!1;const g=new _.I(_.D,6,6008,{browserError:f.message});sr(a,g,d);return!1}_.zm(`drm.sess.update.${e}.end`);_.Bm(`drm.sess.update.${e}`,`drm.sess.update.${e}.start`,`drm.sess.update.${e}.end`);return a.j?!1:!0})};
285
+ qr=function(a,b,c,d,e,f){return _.w(function*(){a.g.info("WV Server certificate request for "+`SID:'${e} from msg '${f}'.`);yield rr(a,b,c.sessionContext);a.g.debug("Sending Widevine certificate request to",d,b);var g=Date.now(),h=null;try{h=yield a.D.Cb.fetch(b).V}catch(m){if(a.j)return null;h=m.data.headers;h=Object.assign({message:Ba,url:m.data.url,status:m.data.status,response:m.data.response},h?{headers:h}:{},Sp(h));h=new _.I(_.D,6,6100,h,m);sr(a,h,c);return null}g=Date.now()-g;const k=Tp(h.headers);
283
286
  let l="";k&&k.requestId&&(l=` RID:${k.requestId}`);a.g.info("WV Server certificate response for "+`SID:'${e}' `+`${h.data.byteLength} bytes `+`in ${g}ms${l}`);return a.j?null:h})};
284
- hr=function(a,b,c){return _.w(function*(){const d=a.D.getConfiguration();yield Qq(a,d);const e=a.keySystem();var f=a.f.La[e];const g=(f=f&&f.modifiers)&&f.licenseRequest,h=f&&f.licenseResponse;g?b.requestModifiers.push(k=>g(d,k,c)):e.startsWith(_.sd)&&b.requestModifiers.push(k=>_.mp(k));h?b.responseModifiers.push(k=>h(d,k,c)):e.startsWith(_.sd)&&b.responseModifiers.push(k=>_.np(k))})};ir=function(a,b,c){a.j||(a.w(b),c.nc&&c.nc.reject(b),c.pb&&c.pb.reject(b))};
285
- _.jr=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};
286
- _.nr=function(a,b){var c=b.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!c)throw new _.I(_.D,4,4016,{invalidTag:b});b=c[1];var d=c[2];c=[];let e;if(d){d=new _.kr(d);var f;(f=_.jr(d,/^([^,=]+)(?:,|$)/g))&&f[1]&&(e=f[1].trim());const g=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;for(;f=_.jr(d,g);)c.push(new _.lr(f[1],f[2]||f[3]||""))}return new _.mr(a,b,c,e)};or=function(a){return`@@scheme:${a.scheme||""}`+`@@value:${a.value}`+`@@id:${a.id||""}@@type:${a.type||""}`+`@@protocol:${a.protocol||""}`};
287
- _.pr=function(a){return a&&a!==_.kg?a:null};rr=function(a){if(!a)throw new _.I(_.D,3,3101,`Invalid track type: ${a}`);if(!_.jh(a))throw new _.I(_.D,3,3101,`Invalid track type: ${a}. Track type must be a string!`);switch(a.toLowerCase()){case _.P:return _.P;case _.Q:return _.Q;case _.R:return _.R;case qr:return qr}throw new _.I(_.D,3,3101,`Unknown track type: ${a}.`);};
288
- tr=function(a,b,c){a=rr(a);const d=_.pr(c.kind);a=new _.sr(b,d===_.Ae?qr:a);a.kind=d;a.label=_.pr(c.label);a.language=_.pr(c.language);a.originalLanguage=c.originalLanguage||a.language;return a};ur=function(a,b){return _.w(function*(){const c=_.vk(b);return yield km(a.f,c)})};
289
- yr=function(a,b,c){return _.w(function*(){const {mimeType:d,renditions:e}=yield vr(a,b,c),f=new _.sr("dummy",_.R),g=e.map((h,k)=>{k=new _.wr(`R${k}`,f);k.bandwidth=h.bandwidth;k.nd=h.nd;k.codec=h.codec;k.width=h.width;k.height=h.height;return k});xr(g);return{renditions:g,mimeType:d||void 0}})};
290
- Ar=function(a){a=a.split("\n").filter(c=>c.trim().startsWith("#EXT-X-MEDIA:")).map(c=>zr(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};vr=function(a,b,c){return _.w(function*(){const d=Br(b),e=Cr(b,c);return{mimeType:yield Dr(a,e,d[0]?d[0].codec:null),renditions:d}})};
291
- xr=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.");};zr=function(a){const b=_.nr(0,a);a=d=>(d=b.getAttribute(d))?d.value:void 0;var c=a(_.tb);c=null!=c?{AUDIO:_.Q,VIDEO:_.R,SUBTITLES:_.P}[c]:void 0;return{type:c,groupId:a(_.Ea),name:a(_.Sa),language:a(_.Ka),qj:a("AUTOSELECT"),default:a("DEFAULT"),yj:a("FORCED"),ag:a("CHARACTERISTICS"),uri:a(_.vb)}};
292
- Br=function(a){return a.split("\n").filter(b=>b.trim().startsWith("#EXT-X-STREAM-INF:")).map(b=>{var c=_.nr(0,b);if(c.getAttribute(_.Db))throw Error("Playlist contains alternative video streams.");var d=_.L(c,_.mb);b=d?Number(d.split("x")[0]):null;d=d?Number(d.split("x")[1]):null;var e=_.L(c,_.ma);e=e?Number(e):null;var f=_.L(c,"AVERAGE-BANDWIDTH");f=f?Number(f):null;c=_.L(c,_.pa);c=_.Er(_.t,c?c.split(","):[]);return b={bandwidth:e,nd:f,codec:c,width:b,height:d,mimeType:null}})};
293
- Cr=function(a,b){return(a=a.split("\n").filter(c=>c.trim().endsWith(".m3u8"))[0])?_.Pm(a,b):null};Dr=function(a,b,c){return _.w(function*(){if(!b||!c)return null;var d=yield ur(a,b);d=[Fr(d,b),Gr(d,b)].filter(Boolean);return _.Hr(d,_.t,c)})};Fr=function(a,b){return(a=a.split("\n").find(c=>!c.startsWith("#")&&0<c.trim().length))?_.Pm(a,b):null};Gr=function(a,b){a=a.split("\n").find(c=>c.startsWith("#EXT-X-MAP:"));return a?(a=_.L(_.nr(0,a),_.vb))?_.Pm(a,b):null:null};
294
- _.Jr=function(a,b,c){for(const d of _.Ir)if(d.probe(b,c))return d.create(a);return null};_.Kr=function(a){a=_.Ir.indexOf(a);0<=a&&_.Ir.splice(a,1)};Mr=function(a,b){return a===_.Q?String(_.Lr++):b.id};Nr=function(a){return a.enabled||a.selected||a.mode===_.Jf||a.mode===_.ce};
295
- Or=function(a,b,c,d){return b.type!==d?!1:d===_.Q&&(a=a.A.get(b.id),void 0!==a)?a===c:void 0!==c.id&&null!==c.id&&""!==c.id?b.id===c.id:_.lh(b,{kind:_.pr(c.kind),language:_.pr(c.language),label:_.pr(c.label)},["kind","language","label"])};Qr=function(a,b,c){return Pr(a)&&b===_.R&&!!c.enableHlsVideoTrackInfo};
296
- Rr=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})))})};Sr=function(a,b,c){return Pr(a)&&(b===_.Q||b===_.P)&&!!c.enableMetadata};
297
- Tr=function(a,b,c){return _.w(function*(){var d=a.m.getLoadedSource();d&&a.j&&(d=yield a.j.a(d.url,c),d.Gc&&(d=d.Gc.get(`${b.type}:${b.label}`))&&d.ag&&(b.accessibility=d.ag.split(",").map(e=>e.trim()).map(e=>({value:e,type:b.type,protocol:"HLS"}))))})};Ur=function(a,b){return a.h.filter(c=>c.type===b)};Vr=function(a){(a=a.m.getTextDisplayer())&&a.remove(0,Infinity)};Xr=function(a,b){if(a=Wr(a,b))a=Array.from(a),b===_.P&&(a=a.filter(c=>c.kind!==_.Ae));return a};
298
- Wr=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 _.Q:return a.audioTracks;case _.R:return a.videoTracks;case _.P:return a.textTracks;default:return null}};Yr=function(a,b){return(a=a.a.get(b)||null)&&a.renditions[0]};Zr=function(a,b){return(a=a.l.get(b))&&a.renditions[0]};
299
- $r=function(a,b,c){const d=Xr(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 _.P:f="mode";e=_.Jf;g=_.Ed;break;case _.Q:f="enabled";break;case _.R:f="selected"}if(f)for(const h of d)h[f]=Or(a,c,h,c.type)?e:g}}else if(a.g.debug("Disable track type "+b),a.a.get(b)&&
300
- d&&b===_.P){for(e of d)e.mode=_.Ed;a.a.set(b,null)}b===_.Q?a.m.trigger(new _.H(_.Kc)):b===_.P&&a.m.trigger(new _.H(_.ag))};as=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.J.push(e)}}};
301
- bs=function(a,b){return _.w(function*(){var c=a.m.getConfiguration();if(c=_.Jr(c,b.mimeType,_.Zf)){var d=_.vk(b.url),e={objectType:b.mimeType===_.yc?"tt":"c"};(e=yield _.pm(a.m.getNetworkEngine(),d,e).V)&&e.data&&(d="External_"+`${a.H++}`,a.o[d]=b,c=c.a(_.G(e.data)),c={url:URL.createObjectURL(new Blob([c])),kind:b.kind,language:b.language,label:b.label,mimeType:_.Zf},as(a,c,d))}else a.g.warn("Track MIME type is not supported",b)})};
302
- Pr=function(a){a=a.m.getLoadedSource();return!(!a||a.type!==_.tl&&!a.url.endsWith(".m3u8"))&&_.Yi()};cs=function(a,b,c){c=_.Zh(c).filter(e=>e);a.g.info("Find preferred tracks for",b,c);const d=Ur(a,b);c.some(e=>{const f=_.Gn(e);return(e=d.find(g=>{g=_.Gn(g.language||"");return _.Hn(f,g)}))?(a.g.info("Will select track with id",e.id),$r(a,b,e),!0):!1})};es=function(a){return a.name===ab&&ds.some(b=>a.message.startsWith(b))};_.hs=function(a,b){a&&b&&(_.fs.set(a,b),_.gs.info(`Registered TextDisplayerFactory: '${a}'`))};
303
- _.is=function(a,b){b=b.find(c=>(c=_.fs.get(c))?c.a(a):!1);if(null==b)return _.gs.warn("Subtitles may not work as expected. No compatible text displayer found for this platform."),null;_.gs.info(`Chosen the text displayer: ${b}`);return _.fs.get(b)};_.js=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})}}};
304
- ks=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};ls=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};ms=function(a){return a.a.map(b=>_.dh(b))};
305
- _.ns=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:[]}};
306
- rs=function(a){a.g.debug("Start watching for video events for "+a.m.namespace());const b=a.m,c=d=>os(a,d.type);a.a.on(b,_.Wd,()=>{a.ga||(a.h=!1,ps(a,5))});a.a.on(b,Qc,c);a.a.on(b,_.gf,()=>{a.C=!0;a.h=!1;os(a,_.gf)});a.a.on(b,_.Se,()=>{a.C=!1;a.h=!1;os(a,_.Se)});a.a.on(b,_.fg,c);a.a.on(b,_.vf,c);a.a.on(b,_.Hf,d=>{a.ga=!1;a.h=!1;os(a,d.type)});a.a.on(b,_.If,d=>{a.ga=!0;os(a,d.type)});a.a.on(b,Of,c);a.a.on(b,_.Fg,()=>{a.h=!0;os(a,_.Fg)});a.a.on(b,_.Xd,d=>{(d=d&&d.detail)&&d.severity&&d.severity===_.D&&
307
- ps(a,_.qs)});a.a.on(b,_.re,c);a.a.on(b,Rc,()=>{a.B=!0;os(a,Rc)});a.a.on(b,_.tg,d=>{a.ga=!0;os(a,d.type)});a.a.on(b,_.sg,d=>{a.ga=!1;a.h=!1;os(a,d.type)})};ss=function(a,b){return Object.keys(b)[a]};ts=function(a,b){const c={type:_.Qf};b===_.Pc||b===_.Oc?(c.reason=a.o,b===_.Pc?c.timeSinceLastStateChangeMS=a.G:c.bufferedTimeMS=a.A):(2===a.f&&(c.reason=a.o),2===a.w&&(c.reason=a.o,c.bufferedTimeMS=a.A),c.currentState=a.f,c.previousState=a.w,c.timeSinceLastStateChangeMS=a.G);return c};
308
- us=function(a,b,c){a.m&&a.m.trigger(new _.H(b,{detail:c}))};
309
- ps=function(a,b){if(a.f===b)return!1;var c=Date.now();const d=2===a.f;a.w=a.f;a.f=b;5===a.w&&(a.H=c,a.l=0);a.l||(a.l=a.H||c);a.G=c-a.l;a.l=c;2===b?(a.J=a.l,a.o=a.ga?1:2,a.g.info("Buffering started. Reason: "+ss(a.o-1,_.vs)),b=ts(a,_.Pc),us(a,_.Pc,b)):d&&(a.A=a.l-a.J,a.g.info("Buffering finished. Reason: "+ss(a.o-1,_.vs)+". Buffering time: "+a.A+" ms"),b=ts(a,_.Oc),us(a,_.Oc,b));b=ss(a.w,_.ws);c=ss(a.f,_.ws);a.g.info(`Player state change: ${b} -> ${c}`);us(a,_.Qf,ts(a,""));return!0};
310
- os=function(a,b){if(a.f===_.qs)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.ga||(a.h=!1,ps(a,5));else if(b!==_.fg){var e=a.m.getPosition();e=null!==e&&void 0!==e&&0<=e?a.m.getBufferInfo().Pa(e,!0):-1;a.F=e;e=a.m.getSurface().getMedia();a.j=e?e.readyState:null;a.I=a.m.getPlaybackRate()||1;e=typeof a.j===_.r&&2>a.j&&2===e.networkState;var f=typeof a.j===_.r&&0>=a.F&&a.f===_.xs,g=typeof a.j===_.r&&2>=a.j&&a.h;e=a.ga||
311
- f||e||g;!a.K||a.m.isLive()||2!==a.f||e||(f=b===_.Hf&&4===a.j,(g=1===a.w)&&!a.B?e=!0:g||a.B||f||(e=!0));f=!1;e?f=ps(a,2):c?f=ps(a,4):a.C&&(f=ps(a,3));f&&(a.B=!1);a.g.debug("Video state check for event "+b+":: seeking: "+a.ga+", waiting: "+a.h+", playing: "+a.C+", paused: "+c+", readyState: "+a.j+", rate: "+a.I+", buffer: "+a.F+", ended: "+d+". Changed state: "+f+", Current state: "+ss(a.f,_.ws))}}};
312
- Cs=function(a,b){if(a.w)throw new _.I(_.D,7,7E3);a.a||(a.h.on(b,_.Xd,()=>{{const c=ys(a);if(c)a.onError(c)}}),a.h.on(b,_.Af,()=>{const c=b.videoWidth,d=b.videoHeight,e=a.getTrackManager();e&&0<c&&0<d&&(e.w={width:c,height:d});a.trigger(new _.H(_.Mc,{detail:{width:c,height:d}}))}),a.a=b)};Es=function(a){const b=_.Yi()?sq:void 0;return new _.Ds(a,b)};
313
- Fs=function(a){return _.w(function*(){if(a.w)return Promise.reject(new _.I(_.D,7,7E3));var b=a.ha[a.getSourceIndex()];if(!a.configuration.drm||!1===b.drmProtected)return a.log.debug("No DRM configuration present.","Skipping DRM engine initialization"),Promise.resolve();b=_.ln(a.configuration.drm);a.log.debug("Drm configuration: ",b);const c=a.getNetworkEngine();a.o=Es({Ab:c,onError:d=>a.onError(d),df:()=>{},cf:(d,e)=>{a.trigger(new _.H(_.Kd,{expirationTime:e}))},onEvent:d=>{d instanceof _.H?a.dispatchEvent(d):
314
- a.log.debug(_.yb,d.type)},getConfiguration:()=>a.getConfiguration(),Tc:()=>a.Tc()});a.o.f=b;yield _.Fq(a.o,[{id:0,language:_.kg,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,Ja:0,mimeType:_.zg,codecs:"",encrypted:!0,keyId:null,language:_.kg,originalLanguage:_.kg,label:null,type:_.t,primary:!1,frameRate:void 0,
315
- Cj:void 0,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,spatialAudio:!1,nj:null,closedCaptions:null},bandwidth:100,drmInfos:[],allowedByApplication:!0,allowedByKeySystem:!0}]);yield _.Xq(a.o,a.a)})};Gs=function(a,b){Mp(a.a,HTMLMediaElement.HAVE_CURRENT_DATA,a.h,()=>{a.getState()!==_.qs&&a.seek(b).catch(c=>{a.log.warn("Error while seeking to start position.",c)})})};
316
- ys=function(a){if(null===a.ha||!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 _.I(_.D,3,3016,{code:b,xj:c,message:a.a.error.message})};
317
- Is=function(a){if(a.w)return new _.Hs(Promise.reject(new _.I(_.D,7,7E3)),()=>{});const b=a.ha[a.getSourceIndex()],c=a.configuration.startTime||null,d=a.a,e=a.H;c&&Gs(a,c);if(d.preload!==_.Ge)a.h.one(d,_.re,()=>{const g=Date.now()/1E3-e;a.f.B=g;a.log.debug("Time to load: ",g)});d.src=b.url;(_.Pi()||_.Si())&&d.load();const f=new _.Gl;a.h.one(d,Of,()=>{const g=a.getConfiguration().manifest.attemptParameters.timeout||30;a.B||(a.B=(new _.Li(()=>{f.reject(new _.I(_.D,3,3100,{message:`Unable to load media source successfully from ${b.url}`,
318
- uri:b.url},d.error))})).la(g))});Mp(d,a.configuration.forceWaitForTracks?HTMLMediaElement.HAVE_CURRENT_DATA:HTMLMediaElement.HAVE_METADATA,a.h,()=>f.resolve());d.error?f.reject(ys(a)):d.preload===_.Ge&&(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,_.Xd,()=>{f.reject(ys(a))});return new _.Hs(f,
319
- ()=>{const g=new _.I(_.D,7,7001);f.reject(g);return Promise.resolve()})};Js=function(a,b){Mp(b,HTMLMediaElement.HAVE_CURRENT_DATA,a.h,()=>{if(a.isLive()&&a.getState()!==_.qs){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)}))}})};
320
- Ks=function(a,b){let c=!1;a.h.on(b,_.If,()=>{c=b.paused});a.h.on(b,_.Hf,()=>{.2>b.duration-b.currentTime&&b.paused&&!c&&(a.log.warn("Player was auto-paused during seek to the end, auto-resuming."),b.play())})};Ls=function(a){a.J.forEach(b=>b());a.J=[]};
321
- Os=function(a,b){return _.w(function*(){try{_.vm(ff);a.M=_.cb;a.X=!1;const c=b.slice(1).map(d=>({config:d,ha:_.en(d)}));yield _.io(a,b[0]);c.forEach(d=>{Ms(a,d.config,d.ha)});a.trigger(new _.H(se));yield a.a.setupPlaylist(b);yield _.lo(a);c.forEach(d=>{Ns(a,d.config,d.ha)});_.vm(ef);_.xm("player.setupPlaylist",ff,ef)}catch(c){if(a.l)throw a.g.info(Ma),new _.I(_.D,7,7E3);throw c;}})};
322
- Ps=function(a,b){const c=d=>{a.G=a.o.findIndex(e=>e.id===d.id)};a.addEventListener(_.Df,c);a.J.push(()=>{a.removeEventListener(_.Df,c)});if(b.endTime){const d=b.endTime,e=()=>{a.getPosition()>=d&&(a.removeEventListener(_.fg,e),a.g.info("Playlist end time reached. Stopping playback."),a.trigger(new _.H(_.Cf)),a.pause())};a.addEventListener(_.fg,e);a.J.push(()=>{a.removeEventListener(_.fg,e)})}};
323
- Qs=function(a,b){return _.w(function*(){try{_.vm($e);const c=_.en(b);Ms(a,b,c);yield a.a.appendLoad(b);Ns(a,b,c);_.vm(Ze);_.xm("player.appendLoad",$e,Ze)}catch(c){if(a.l)throw a.g.info(Ma),new _.I(_.D,7,7E3,{id:b.id});throw c;}})};
324
- Ms=function(a,b,c){if(0===c.length)throw new _.I(_.D,7,7003,{message:Wa,id:b.id});if(1<c.length)throw new _.I(_.D,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 _.I(_.D,7,7003,{message:"Source not supported by the current player!",id:b.id,source:c[0]});};Ns=function(a,b,c){Yn(a,{configuration:b,ha:c,drmInfo:a.getDrmInfo(),Mg:Object.keys(a.K),isLive:c[0].isLive})};
325
- Rs=function(a,b){const c=document.getElementById(a);if(!c)throw Error("Anchor element not found");c.classList.add(cd);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 S(d,b)})};
326
- Ss=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(fd)):(a.g.info(`Hide video element .${b}`),d.classList.remove(fd)),a.w&&a.w(d,c))};Vs=function(a,b){return _.w(function*(){const c=yield a.o.get();a.f=b;b.role=Ts;a.f.player=c;a.f.videoEl=c.getSurface().getMedia();Ss(a,c,!0);yield c.load(b.config);Us(a,b);b.config.autoplay||(yield c.play())})};
327
- Zs=function(a){_.w(function*(){if(0===a.a)yield Ws(a);else if(a.a===a.h.length-1)yield Xs(a);else{const b=[a.a-1,a.a+1];a.g.info(`Preload items (indices: ${b})`);yield Promise.all(b.map(c=>Ys(a,c)))}})};
328
- $s=function(a,b){return _.w(function*(){if(b.player){if(b.state===qf){a.g.info(Fb);try{yield b.preloadPromise}catch(c){}}a.f=b;b.role=Ts;Ss(a,b.player,!0);b.state===pf?(_.vm(mf),a.ka.preloadMedia?yield b.player.play():yield mo(b.player),_.vm(kf),_.xm("playlist.next",mf,kf)):b.state===of&&(yield b.player.load(b.config));Us(a,b);b.config.autoplay||(yield b.player.play())}})};
329
- ct=function(a,b){return _.w(function*(){a.g.info(`Stop current playback (index: ${b.index})`);b.player.pause();Ss(a,b.player,!1);yield at(a,b);b.player=null;b.videoEl=null;b.role=bt})};et=function(a){return Promise.all(Array.from(a.l.keys()).map(b=>dt(a,b)))};ft=function(a){return _.w(function*(){yield a.o.destroy();const b=document.getElementById(a.ka.anchorId);b&&(b.classList.remove(cd),b.innerHTML="")})};
330
- dt=function(a,b){return _.w(function*(){const c=a.l.get(b);c&&(a.g.info(`Stop preloading item (index: ${b})`),c.player&&(yield at(a,c)),a.l.delete(b))})};at=function(a,b){return _.w(function*(){b.disposers.forEach(c=>c());b.disposers=[];b.player&&(yield a.o.release(b.player))})};Us=function(a,b){if(a.ka.autoplayNext){const c=()=>{a.g.info("Automatically transition to next item");a.Kg()};b.player.on(_.Wd,c);const d=b.player;b.disposers.push(()=>{d.off(_.Wd,c)})}};
331
- Ys=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=bt;d.state=qf;a.trigger(new _.H(mg));try{a.l.set(b,d),a.ka.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=pf,a.trigger(new _.H(mg))}catch(e){7001===e.code?(a.g.info(`Preload aborted (index: ${b})`),d.state=nf):
332
- (a.g.warn(`Preload failed (index: ${b})`,e),a.trigger(new _.H(_.Xd,{detail:e})),d.state=of),a.trigger(new _.H(mg))}})};Ws=function(a){return _.w(function*(){const b=a.a+1;a.g.info(`Preload following item (index: ${b})`);yield Ys(a,b)})};Xs=function(a){return _.w(function*(){const b=a.a-1;a.g.info(`Preload preceding item (index: ${b})`);yield Ys(a,b)})};
333
- _.ht=function(a){if(gt.has(a))return gt.get(a);if(window.ManagedMediaSource){var b=ManagedMediaSource.isTypeSupported(a);gt.set(a,b);return b}return window.MediaSource?(b=MediaSource.isTypeSupported(a),gt.set(a,b),b):!1};it=function(a,b){b=b.replace(/mp2t/i,"mp4");a===_.q&&(b=b.replace(_.t,_.q));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};
334
- jt=function(a){const b=a.type.replace(/^(webkit|moz|MS)/,"").toLowerCase();let c;typeof Event===_.ae?c=new Event(b,a):(c=document.createEvent("Event"),c.initEvent(b,a.bubbles,a.cancelable));a.target.dispatchEvent(c)};kt=function(a){a=a.target;if(a.webkitPresentationMode===Ve){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)};
335
- lt=function(){return this.webkitSupportsPresentationMode(Ve)?(this.webkitSetPresentationMode(Ve),document.pictureInPictureElement=this,Promise.resolve()):Promise.reject(Error("PiP not allowed by video element"))};mt=function(){const a=document.pictureInPictureElement;return a?(a.webkitSetPresentationMode("inline"),document.pictureInPictureElement=null,Promise.resolve()):Promise.reject(Error("No picture in picture element found"))};
336
- nt=function(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}};ot=function(a,b,c){return new window.TextTrackCue(a,b,c)};pt=function(a,b,c){return new window.TextTrackCue(a+"-"+b+"-"+c,a,b,c)};rt=function(a,b,c){if("input"===a)switch(this.type){case "range":a=Zc}qt.call(this,a,b,c)};_.st=function(a){const b=[];for(const c of a)for(const d of c.variants)b.push(d);return b};
337
- _.ut=function(a,b){a=_.Tm(_.Um(a),_.Vm(a));_.tt[a]=b};_.vt=function(a){a=_.Tm(_.Um(a),_.Vm(a));return _.tt[a]||null};_.wt=function(a){a=_.Tm(_.Um(a),_.Vm(a));delete _.tt[a]};_.Bt=function(a){if(!a.w)return null;const b=a.H;switch(a.w){case xt:return`-2px -2px 0 ${b}, -1px -1px 0 ${b}`;case yt:return`2px 2px 0 ${b}, 1px 1px 0 ${b}`;case zt:return`-1px 0 ${b}, 0 1px ${b}, 1px 0 ${b}, `+`0 -1px ${b}`;case At:return`2px 2px 3px ${b}, 2px 2px 4px ${b}, `+`2px 2px 5px ${b}`;default:return _.Ge}};
338
- _.Dt=function(a,b,c,d){return _.w(function*(){try{return new (yield Ct(a,b,c,d))}catch(e){throw e.a(_.D),e;}})};
339
- Ct=function(a,b,c,d){return _.w(function*(){if(d){var e=_.Et[d.toLowerCase()];if(e)return e;_.C("Could not determine manifest type using MIME type ",d)}if(e=_.Qm(a)){const f=_.Ft[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 Gt(a,b,c))){if(e=_.Et[d])return e;_.C("Could not determine manifest type using MIME type",d)}throw new _.I(_.D,4,4E3,{url:a});})};
340
- Gt=function(a,b,c){return _.w(function*(){var d=_.vk(a);sk(d,c);d.type=1;d.method="HEAD";return(d=(yield b.fetch(d).V).headers["content-type"])?d.toLowerCase():""})};_.Tg=[];Xg="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this;Yg=typeof Object.defineProperties==_.ae?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};
341
- Zg("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=Xg.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=
342
- 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 _.He:var h=null!=g;break a;case _.ae:h=!0;break a;default:h=!1}h?this.B(g):this.o(g)}};
287
+ rr=function(a,b,c){return _.w(function*(){const d=a.D.getConfiguration();yield $q(a,d);const e=a.keySystem();var f=a.f.La[e];const g=(f=f&&f.modifiers)&&f.licenseRequest,h=f&&f.licenseResponse;g?b.requestModifiers.push(k=>g(d,k,c)):e.startsWith(_.sd)&&b.requestModifiers.push(k=>_.rp(k));h?b.responseModifiers.push(k=>h(d,k,c)):e.startsWith(_.sd)&&b.responseModifiers.push(k=>_.sp(k))})};sr=function(a,b,c){a.j||(a.w(b),c.vc&&c.vc.reject(b),c.rb&&c.rb.reject(b))};
288
+ _.tr=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};
289
+ _.xr=function(a,b){var c=b.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!c)throw new _.I(_.D,4,4016,{invalidTag:b});b=c[1];var d=c[2];c=[];let e;if(d){d=new _.ur(d);var f;(f=_.tr(d,/^([^,=]+)(?:,|$)/g))&&f[1]&&(e=f[1].trim());const g=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;for(;f=_.tr(d,g);)c.push(new _.vr(f[1],f[2]||f[3]||""))}return new _.wr(a,b,c,e)};yr=function(a){return`@@scheme:${a.scheme||""}`+`@@value:${a.value}`+`@@id:${a.id||""}@@type:${a.type||""}`+`@@protocol:${a.protocol||""}`};
290
+ _.zr=function(a){return a&&a!==_.lg?a:null};Br=function(a){if(!a)throw new _.I(_.D,3,3101,`Invalid track type: ${a}`);if(!_.oh(a))throw new _.I(_.D,3,3101,`Invalid track type: ${a}. Track type must be a string!`);switch(a.toLowerCase()){case _.P:return _.P;case _.Q:return _.Q;case _.R:return _.R;case Ar:return Ar}throw new _.I(_.D,3,3101,`Unknown track type: ${a}.`);};
291
+ Dr=function(a,b,c){a=Br(a);const d=_.zr(c.kind);a=new _.Cr(b,d===_.Be?Ar:a);a.kind=d;a.label=_.zr(c.label);a.language=_.zr(c.language);a.originalLanguage=c.originalLanguage||a.language;return a};Er=function(a,b){return _.w(function*(){const c=_.zk(b);return yield om(a.f,c)})};
292
+ Ir=function(a,b,c){return _.w(function*(){const {mimeType:d,renditions:e}=yield Fr(a,b,c),f=new _.Cr("dummy",_.R),g=e.map((h,k)=>{k=new _.Gr(`R${k}`,f);k.bandwidth=h.bandwidth;k.wd=h.wd;k.codec=h.codec;k.width=h.width;k.height=h.height;return k});Hr(g);return{renditions:g,mimeType:d||void 0}})};
293
+ Kr=function(a){a=a.split("\n").filter(c=>c.trim().startsWith("#EXT-X-MEDIA:")).map(c=>Jr(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};Fr=function(a,b,c){return _.w(function*(){const d=Lr(b),e=Mr(b,c);return{mimeType:yield Nr(a,e,d[0]?d[0].codec:null),renditions:d}})};
294
+ Hr=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.");};Jr=function(a){const b=_.xr(0,a);a=d=>(d=b.getAttribute(d))?d.value:void 0;var c=a(_.tb);c=null!=c?{AUDIO:_.Q,VIDEO:_.R,SUBTITLES:_.P}[c]:void 0;return{type:c,groupId:a(_.Fa),name:a(_.Ta),language:a(_.La),Aj:a("AUTOSELECT"),default:a("DEFAULT"),Ij:a("FORCED"),mg:a("CHARACTERISTICS"),uri:a(_.wb)}};
295
+ Lr=function(a){return a.split("\n").filter(b=>b.trim().startsWith("#EXT-X-STREAM-INF:")).map(b=>{var c=_.xr(0,b);if(c.getAttribute(_.Eb))throw Error("Playlist contains alternative video streams.");var d=_.L(c,_.mb);b=d?Number(d.split("x")[0]):null;d=d?Number(d.split("x")[1]):null;var e=_.L(c,_.ma);e=e?Number(e):null;var f=_.L(c,"AVERAGE-BANDWIDTH");f=f?Number(f):null;c=_.L(c,_.pa);c=_.Or(_.t,c?c.split(","):[]);return b={bandwidth:e,wd:f,codec:c,width:b,height:d,mimeType:null}})};
296
+ Mr=function(a,b){return(a=a.split("\n").filter(c=>c.trim().endsWith(".m3u8"))[0])?_.Tm(a,b):null};Nr=function(a,b,c){return _.w(function*(){if(!b||!c)return null;var d=yield Er(a,b);d=[Pr(d,b),Qr(d,b)].filter(Boolean);return _.Rr(d,_.t,c)})};Pr=function(a,b){return(a=a.split("\n").find(c=>!c.startsWith("#")&&0<c.trim().length))?_.Tm(a,b):null};Qr=function(a,b){a=a.split("\n").find(c=>c.startsWith("#EXT-X-MAP:"));return a?(a=_.L(_.xr(0,a),_.wb))?_.Tm(a,b):null:null};
297
+ _.Tr=function(a,b,c){for(const d of _.Sr)if(d.probe(b,c))return d.create(a);return null};_.Ur=function(a){a=_.Sr.indexOf(a);0<=a&&_.Sr.splice(a,1)};Wr=function(a,b){return a===_.Q?String(_.Vr++):b.id};Xr=function(a){return a.enabled||a.selected||a.mode===_.Kf||a.mode===_.ce};
298
+ Yr=function(a,b,c,d){return b.type!==d?!1:d===_.Q&&(a=a.A.get(b.id),void 0!==a)?a===c:void 0!==c.id&&null!==c.id&&""!==c.id?b.id===c.id:_.qh(b,{kind:_.zr(c.kind),language:_.zr(c.language),label:_.zr(c.label)},["kind","language","label"])};$r=function(a,b,c){return Zr(a)&&b===_.R&&!!c.enableHlsVideoTrackInfo};
299
+ as=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})))})};bs=function(a,b,c){return Zr(a)&&(b===_.Q||b===_.P)&&!!c.enableMetadata};
300
+ cs=function(a,b,c){return _.w(function*(){var d=a.m.getLoadedSource();d&&a.j&&(d=yield a.j.a(d.url,c),d.Oc&&(d=d.Oc.get(`${b.type}:${b.label}`))&&d.mg&&(b.accessibility=d.mg.split(",").map(e=>e.trim()).map(e=>({value:e,type:b.type,protocol:"HLS"}))))})};ds=function(a,b){return a.h.filter(c=>c.type===b)};es=function(a){(a=a.m.getTextDisplayer())&&a.remove(0,Infinity)};gs=function(a,b){if(a=fs(a,b))a=Array.from(a),b===_.P&&(a=a.filter(c=>c.kind!==_.Be));return a};
301
+ fs=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 _.Q:return a.audioTracks;case _.R:return a.videoTracks;case _.P:return a.textTracks;default:return null}};hs=function(a,b){return(a=a.a.get(b)||null)&&a.renditions[0]};is=function(a,b){return(a=a.l.get(b))&&a.renditions[0]};
302
+ js=function(a,b,c){const d=gs(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 _.P:f="mode";e=_.Kf;g=_.Ed;break;case _.Q:f="enabled";break;case _.R:f="selected"}if(f)for(const h of d)h[f]=Yr(a,c,h,c.type)?e:g}}else if(a.g.debug("Disable track type "+b),a.a.get(b)&&
303
+ d&&b===_.P){for(e of d)e.mode=_.Ed;a.a.set(b,null)}b===_.Q?a.m.trigger(new _.H(_.Kc)):b===_.P&&a.m.trigger(new _.H(_.bg))};ks=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=_.Bi(b.url)?URL.createObjectURL(new Blob([])):b.url;d.appendChild(e);a.J.push(e)}}};
304
+ ls=function(a,b){return _.w(function*(){var c=a.m.getConfiguration();if(c=_.Tr(c,b.mimeType,_.$f)){var d=_.zk(b.url),e={objectType:b.mimeType===_.wc?"tt":"c"};(e=yield _.tm(a.m.getNetworkEngine(),d,e).V)&&e.data&&(d="External_"+`${a.H++}`,a.o[d]=b,c=c.a(_.G(e.data)),c={url:URL.createObjectURL(new Blob([c])),kind:b.kind,language:b.language,label:b.label,mimeType:_.$f},ks(a,c,d))}else a.g.warn("Track MIME type is not supported",b)})};
305
+ Zr=function(a){a=a.m.getLoadedSource();return!(!a||a.type!==_.xl&&!a.url.endsWith(".m3u8"))&&_.bj()};ms=function(a,b,c){c=_.ci(c).filter(e=>e);a.g.info("Find preferred tracks for",b,c);const d=ds(a,b);c.some(e=>{const f=_.Kn(e);return(e=d.find(g=>{g=_.Kn(g.language||"");return _.Ln(f,g)}))?(a.g.info("Will select track with id",e.id),js(a,b,e),!0):!1})};os=function(a){return a.name===bb&&ns.some(b=>a.message.startsWith(b))};_.rs=function(a,b){a&&b&&(_.ps.set(a,b),_.qs.info(`Registered TextDisplayerFactory: '${a}'`))};
306
+ _.ss=function(a,b){b=b.find(c=>(c=_.ps.get(c))?c.a(a):!1);if(null==b)return _.qs.warn("Subtitles may not work as expected. No compatible text displayer found for this platform."),null;_.qs.info(`Chosen the text displayer: ${b}`);return _.ps.get(b)};_.ts=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})}}};
307
+ us=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};vs=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};ws=function(a){return a.a.map(b=>_.ih(b))};
308
+ _.xs=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:[]}};
309
+ Bs=function(a){a.g.debug("Start watching for video events for "+a.m.namespace());const b=a.m,c=d=>ys(a,d.type);a.a.on(b,_.Wd,()=>{a.ga||(a.h=!1,zs(a,5))});a.a.on(b,Qc,c);a.a.on(b,_.hf,()=>{a.C=!0;a.h=!1;ys(a,_.hf)});a.a.on(b,_.Te,()=>{a.C=!1;a.h=!1;ys(a,_.Te)});a.a.on(b,_.gg,c);a.a.on(b,_.wf,c);a.a.on(b,_.If,d=>{a.ga=!1;a.h=!1;ys(a,d.type)});a.a.on(b,_.Jf,d=>{a.ga=!0;ys(a,d.type)});a.a.on(b,Pf,c);a.a.on(b,_.Gg,()=>{a.h=!0;ys(a,_.Gg)});a.a.on(b,_.Xd,d=>{(d=d&&d.detail)&&d.severity&&d.severity===_.D&&
310
+ zs(a,_.As)});a.a.on(b,_.se,c);a.a.on(b,Rc,()=>{a.B=!0;ys(a,Rc)});a.a.on(b,_.ug,d=>{a.ga=!0;ys(a,d.type)});a.a.on(b,_.qg,d=>{a.ga=!1;a.h=!1;ys(a,d.type)})};Cs=function(a,b){return Object.keys(b)[a]};Ds=function(a,b){const c={type:_.Rf};b===_.Pc||b===_.Oc?(c.reason=a.o,b===_.Pc?c.timeSinceLastStateChangeMS=a.G:c.bufferedTimeMS=a.A):(2===a.f&&(c.reason=a.o),2===a.w&&(c.reason=a.o,c.bufferedTimeMS=a.A),c.currentState=a.f,c.previousState=a.w,c.timeSinceLastStateChangeMS=a.G);return c};
311
+ Es=function(a,b,c){a.m&&a.m.trigger(new _.H(b,{detail:c}))};
312
+ zs=function(a,b){if(a.f===b)return!1;var c=Date.now();const d=2===a.f;a.w=a.f;a.f=b;5===a.w&&(a.H=c,a.l=0);a.l||(a.l=a.H||c);a.G=c-a.l;a.l=c;2===b?(a.J=a.l,a.o=a.ga?1:2,a.g.info("Buffering started. Reason: "+Cs(a.o-1,_.Fs)),b=Ds(a,_.Pc),Es(a,_.Pc,b)):d&&(a.A=a.l-a.J,a.g.info("Buffering finished. Reason: "+Cs(a.o-1,_.Fs)+". Buffering time: "+a.A+" ms"),b=Ds(a,_.Oc),Es(a,_.Oc,b));b=Cs(a.w,_.Gs);c=Cs(a.f,_.Gs);a.g.info(`Player state change: ${b} -> ${c}`);Es(a,_.Rf,Ds(a,""));return!0};
313
+ ys=function(a,b){if(a.f===_.As)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.ga||(a.h=!1,zs(a,5));else if(b!==_.gg){var e=a.m.getPosition();e=null!==e&&void 0!==e&&0<=e?a.m.getBufferInfo().Pa(e,!0):-1;a.F=e;e=a.m.getSurface().getMedia();a.j=e?e.readyState:null;a.I=a.m.getPlaybackRate()||1;e=typeof a.j===_.r&&2>a.j&&2===e.networkState;var f=typeof a.j===_.r&&0>=a.F&&a.f===_.Hs,g=typeof a.j===_.r&&2>=a.j&&a.h;e=a.ga||
314
+ f||e||g;!a.K||a.m.isLive()||2!==a.f||e||(f=b===_.If&&4===a.j,(g=1===a.w)&&!a.B?e=!0:g||a.B||f||(e=!0));f=!1;e?f=zs(a,2):c?f=zs(a,4):a.C&&(f=zs(a,3));f&&(a.B=!1);a.g.debug("Video state check for event "+b+":: seeking: "+a.ga+", waiting: "+a.h+", playing: "+a.C+", paused: "+c+", readyState: "+a.j+", rate: "+a.I+", buffer: "+a.F+", ended: "+d+". Changed state: "+f+", Current state: "+Cs(a.f,_.Gs))}}};
315
+ Ms=function(a,b){if(a.w)throw new _.I(_.D,7,7E3);a.a||(a.h.on(b,_.Xd,()=>{{const c=Is(a);if(c)a.onError(c)}}),a.h.on(b,_.Bf,()=>{const c=b.videoWidth,d=b.videoHeight,e=a.getTrackManager();e&&0<c&&0<d&&(e.w={width:c,height:d});a.trigger(new _.H(_.Mc,{detail:{width:c,height:d}}))}),a.a=b)};Os=function(a){const b=_.bj()?Cq:void 0;return new _.Ns(a,b)};
316
+ Ps=function(a){return _.w(function*(){if(a.w)return Promise.reject(new _.I(_.D,7,7E3));var b=a.ha[a.getSourceIndex()];if(!a.configuration.drm||!1===b.drmProtected)return a.log.debug("No DRM configuration present.","Skipping DRM engine initialization"),Promise.resolve();b=_.pn(a.configuration.drm);a.log.debug("Drm configuration: ",b);const c=a.getNetworkEngine();a.o=Os({Cb:c,onError:d=>a.onError(d),rf:()=>{},qf:(d,e)=>{a.trigger(new _.H(_.Kd,{expirationTime:e}))},onEvent:d=>{d instanceof _.H?a.dispatchEvent(d):
317
+ a.log.debug(_.zb,d.type)},getConfiguration:()=>a.getConfiguration(),bd:()=>a.bd()});a.o.f=b;yield _.Pq(a.o,[{id:0,language:_.lg,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,Ka:0,mimeType:_.Ag,codecs:"",encrypted:!0,keyId:null,language:_.lg,originalLanguage:_.lg,label:null,type:_.t,primary:!1,frameRate:void 0,
318
+ Mj:void 0,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,spatialAudio:!1,xj:null,closedCaptions:null},bandwidth:100,drmInfos:[],allowedByApplication:!0,allowedByKeySystem:!0}]);yield _.gr(a.o,a.a)})};Qs=function(a,b){Wp(a.a,HTMLMediaElement.HAVE_CURRENT_DATA,a.h,()=>{a.getState()!==_.As&&a.seek(b).catch(c=>{a.log.warn("Error while seeking to start position.",c)})})};
319
+ Is=function(a){if(null===a.ha||!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 _.I(_.D,3,3016,{code:b,Hj:c,message:a.a.error.message})};
320
+ Ss=function(a){if(a.w)return new _.Rs(Promise.reject(new _.I(_.D,7,7E3)),()=>{});const b=a.ha[a.getSourceIndex()],c=a.configuration.startTime||null,d=a.a,e=a.H;c&&Qs(a,c);if(d.preload!==_.He)a.h.one(d,_.se,()=>{const g=Date.now()/1E3-e;a.f.B=g;a.log.debug("Time to load: ",g)});d.src=b.url;(_.Ti()||_.Wi())&&d.load();const f=new _.Kl;a.h.one(d,Pf,()=>{const g=a.getConfiguration().manifest.attemptParameters.timeout||30;a.B||(a.B=(new _.Pi(()=>{f.reject(new _.I(_.D,3,3100,{message:`Unable to load media source successfully from ${b.url}`,
321
+ uri:b.url},d.error))})).la(g))});Wp(d,a.configuration.forceWaitForTracks?HTMLMediaElement.HAVE_CURRENT_DATA:HTMLMediaElement.HAVE_METADATA,a.h,()=>f.resolve());d.error?f.reject(Is(a)):d.preload===_.He&&(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,_.Xd,()=>{f.reject(Is(a))});return new _.Rs(f,
322
+ ()=>{const g=new _.I(_.D,7,7001);f.reject(g);return Promise.resolve()})};Ts=function(a,b){Wp(b,HTMLMediaElement.HAVE_CURRENT_DATA,a.h,()=>{if(a.isLive()&&a.getState()!==_.As){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)}))}})};
323
+ Us=function(a,b){let c=!1;a.h.on(b,_.Jf,()=>{c=b.paused});a.h.on(b,_.If,()=>{.2>b.duration-b.currentTime&&b.paused&&!c&&(a.log.warn("Player was auto-paused during seek to the end, auto-resuming."),b.play())})};Vs=function(a){a.J.forEach(b=>b());a.J=[]};
324
+ Ys=function(a,b){return _.w(function*(){try{_.zm(gf);a.M=_.db;a.X=!1;const c=b.slice(1).map(d=>({config:d,ha:_.jn(d)}));yield _.mo(a,b[0]);c.forEach(d=>{Ws(a,d.config,d.ha)});a.trigger(new _.H(te));yield a.a.setupPlaylist(b);yield _.po(a);c.forEach(d=>{Xs(a,d.config,d.ha)});_.zm(ff);_.Bm("player.setupPlaylist",gf,ff)}catch(c){if(a.l)throw a.g.info(Na),new _.I(_.D,7,7E3);throw c;}})};
325
+ Zs=function(a,b){const c=d=>{a.G=a.o.findIndex(e=>e.id===d.id)};a.addEventListener(_.Ef,c);a.J.push(()=>{a.removeEventListener(_.Ef,c)});if(b.endTime){const d=b.endTime,e=()=>{a.getPosition()>=d&&(a.removeEventListener(_.gg,e),a.g.info("Playlist end time reached. Stopping playback."),a.trigger(new _.H(_.Df)),a.pause())};a.addEventListener(_.gg,e);a.J.push(()=>{a.removeEventListener(_.gg,e)})}};
326
+ $s=function(a,b){return _.w(function*(){try{_.zm(af);const c=_.jn(b);Ws(a,b,c);yield a.a.appendLoad(b);Xs(a,b,c);_.zm($e);_.Bm("player.appendLoad",af,$e)}catch(c){if(a.l)throw a.g.info(Na),new _.I(_.D,7,7E3,{id:b.id});throw c;}})};
327
+ Ws=function(a,b,c){if(0===c.length)throw new _.I(_.D,7,7003,{message:Ya,id:b.id});if(1<c.length)throw new _.I(_.D,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 _.I(_.D,7,7003,{message:"Source not supported by the current player!",id:b.id,source:c[0]});};Xs=function(a,b,c){bo(a,{configuration:b,ha:c,drmInfo:a.getDrmInfo(),Xg:Object.keys(a.K),isLive:c[0].isLive})};
328
+ at=function(a,b){const c=document.getElementById(a);if(!c)throw Error("Anchor element not found");c.classList.add(cd);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 S(d,b)})};
329
+ bt=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(fd)):(a.g.info(`Hide video element .${b}`),d.classList.remove(fd)),a.w&&a.w(d,c))};et=function(a,b){return _.w(function*(){const c=yield a.o.get();a.f=b;b.role=ct;a.f.player=c;a.f.videoEl=c.getSurface().getMedia();bt(a,c,!0);yield c.open(b.config);dt(a,b);b.config.autoplay||(yield c.play())})};
330
+ it=function(a){_.w(function*(){if(0===a.a)yield ft(a);else if(a.a===a.h.length-1)yield gt(a);else{const b=[a.a-1,a.a+1];a.g.info(`Preload items (indices: ${b})`);yield Promise.all(b.map(c=>ht(a,c)))}})};
331
+ jt=function(a,b){return _.w(function*(){if(b.player){if(b.state===rf){a.g.info(Gb);try{yield b.preloadPromise}catch(c){}}a.f=b;b.role=ct;bt(a,b.player,!0);b.state===pf?(_.zm(mf),a.ka.preloadMedia?yield b.player.play():yield qo(b.player),_.zm(lf),_.Bm("playlist.next",mf,lf)):b.state===of&&(yield b.player.open(b.config));dt(a,b);b.config.autoplay||(yield b.player.play())}})};
332
+ mt=function(a,b){return _.w(function*(){a.g.info(`Stop current playback (index: ${b.index})`);b.player.pause();bt(a,b.player,!1);yield kt(a,b);b.player=null;b.videoEl=null;b.role=lt})};ot=function(a){return Promise.all(Array.from(a.l.keys()).map(b=>nt(a,b)))};pt=function(a){return _.w(function*(){yield a.o.destroy();const b=document.getElementById(a.ka.anchorId);b&&(b.classList.remove(cd),b.innerHTML="")})};
333
+ nt=function(a,b){return _.w(function*(){const c=a.l.get(b);c&&(a.g.info(`Stop preloading item (index: ${b})`),c.player&&(yield kt(a,c)),a.l.delete(b))})};kt=function(a,b){return _.w(function*(){b.disposers.forEach(c=>c());b.disposers=[];b.player&&(yield a.o.release(b.player))})};dt=function(a,b){if(a.ka.autoplayNext){const c=()=>{a.g.info("Automatically transition to next item");a.Vg()};b.player.on(_.Wd,c);const d=b.player;b.disposers.push(()=>{d.off(_.Wd,c)})}};
334
+ ht=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=lt;d.state=rf;a.trigger(new _.H(ng));try{a.l.set(b,d),a.ka.preloadMedia?(d.config.autoplay&&(a.g.warn(la+`Force disabling autoplay (index: ${b})`),d.config.autoplay=!1),d.preloadPromise=c.open(d.config)):d.preloadPromise=c.preload(d.config),yield d.preloadPromise,d.state=pf,a.trigger(new _.H(ng))}catch(e){7001===e.code?(a.g.info(`Preload aborted (index: ${b})`),d.state=nf):
335
+ (a.g.warn(`Preload failed (index: ${b})`,e),a.trigger(new _.H(_.Xd,{detail:e})),d.state=of),a.trigger(new _.H(ng))}})};ft=function(a){return _.w(function*(){const b=a.a+1;a.g.info(`Preload following item (index: ${b})`);yield ht(a,b)})};gt=function(a){return _.w(function*(){const b=a.a-1;a.g.info(`Preload preceding item (index: ${b})`);yield ht(a,b)})};
336
+ _.rt=function(a){if(qt.has(a))return qt.get(a);if(window.ManagedMediaSource){var b=ManagedMediaSource.isTypeSupported(a);qt.set(a,b);return b}return window.MediaSource?(b=MediaSource.isTypeSupported(a),qt.set(a,b),b):!1};st=function(a,b){b=b.replace(/mp2t/i,"mp4");a===_.q&&(b=b.replace(_.t,_.q));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};
337
+ tt=function(a){const b=a.type.replace(/^(webkit|moz|MS)/,"").toLowerCase();let c;typeof Event===_.ae?c=new Event(b,a):(c=document.createEvent("Event"),c.initEvent(b,a.bubbles,a.cancelable));a.target.dispatchEvent(c)};ut=function(a){a=a.target;if(a.webkitPresentationMode===We){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)};
338
+ vt=function(){return this.webkitSupportsPresentationMode(We)?(this.webkitSetPresentationMode(We),document.pictureInPictureElement=this,Promise.resolve()):Promise.reject(Error("PiP not allowed by video element"))};wt=function(){const a=document.pictureInPictureElement;return a?(a.webkitSetPresentationMode("inline"),document.pictureInPictureElement=null,Promise.resolve()):Promise.reject(Error("No picture in picture element found"))};
339
+ xt=function(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}};yt=function(a,b,c){return new window.TextTrackCue(a,b,c)};zt=function(a,b,c){return new window.TextTrackCue(a+"-"+b+"-"+c,a,b,c)};Bt=function(a,b,c){if("input"===a)switch(this.type){case "range":a=Zc}At.call(this,a,b,c)};_.Ct=function(a){const b=[];for(const c of a)for(const d of c.variants)b.push(d);return b};
340
+ _.Et=function(a,b){a=_.Xm(_.Ym(a),_.Zm(a));_.Dt[a]=b};_.Ft=function(a){a=_.Xm(_.Ym(a),_.Zm(a));return _.Dt[a]||null};_.Gt=function(a){a=_.Xm(_.Ym(a),_.Zm(a));delete _.Dt[a]};_.Lt=function(a){if(!a.w)return null;const b=a.H;switch(a.w){case Ht:return`-2px -2px 0 ${b}, -1px -1px 0 ${b}`;case It:return`2px 2px 0 ${b}, 1px 1px 0 ${b}`;case Jt:return`-1px 0 ${b}, 0 1px ${b}, 1px 0 ${b}, `+`0 -1px ${b}`;case Kt:return`2px 2px 3px ${b}, 2px 2px 4px ${b}, `+`2px 2px 5px ${b}`;default:return _.He}};
341
+ _.Nt=function(a,b,c,d){return _.w(function*(){try{return new (yield Mt(a,b,c,d))}catch(e){throw e.a(_.D),e;}})};
342
+ Mt=function(a,b,c,d){return _.w(function*(){if(d){var e=_.Ot[d.toLowerCase()];if(e)return e;_.B("Could not determine manifest type using MIME type ",d)}if(e=_.Um(a)){const f=_.Pt[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 Qt(a,b,c))){if(e=_.Ot[d])return e;_.B("Could not determine manifest type using MIME type",d)}throw new _.I(_.D,4,4E3,{url:a});})};
343
+ Qt=function(a,b,c){return _.w(function*(){var d=_.zk(a);wk(d,c);d.type=1;d.method="HEAD";return(d=(yield b.fetch(d).V).headers["content-type"])?d.toLowerCase():""})};_.Yg=[];bh="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this;ch=typeof Object.defineProperties==_.ae?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};
344
+ dh("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=bh.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=
345
+ 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 _.Ie:var h=null!=g;break a;case _.ae:h=!0;break a;default:h=!1}h?this.B(g):this.o(g)}};
343
346
  b.prototype.B=function(g){var h=void 0;try{h=g.then}catch(k){this.h(k);return}typeof h==_.ae?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();
344
- g.be(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(p,u){return typeof p==_.ae?function(v){try{l(p(v))}catch(y){m(y)}}:u}var l,m,n=new b(function(p,u){l=p;m=u});this.be(k(g,l),k(h,m));return n};b.prototype.catch=function(g){return this.then(void 0,g)};b.prototype.be=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: "+
345
- 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=Wg(g),m=l.next();!m.done;m=l.next())d(m.value).be(h,k)})};b.all=function(g){var h=Wg(g),k=h.next();return k.done?d([]):new b(function(l,m){function n(v){return function(y){p[v]=y;u--;0==u&&l(p)}}var p=[],u=0;do p.push(void 0),u++,d(k.value).be(n(p.length-1),m),k=h.next();while(!k.done)})};return b});var ah=this||self;
346
- ah.a=!0;_.x("clpp.utils.obj.cloneItem",_.dh);_.x("clpp.utils.obj.merge",_.ch);var th={DEFAULT:-1,NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4};_.x("clpp.log.Level",th);var rh=0,qh={},Ht=[];_.x("clpp.log.getLoggers",function(){return _.dh(qh)});_.x("clpp.log.addInterceptor",function(a){a&&Ht.push(a)});_.x("clpp.log.removeInterceptor",function(a){a&&(a=Ht.indexOf(a),0<=a&&Ht.splice(a,1))});_.x("clpp.log.getTagLevel",sh);_.x("clpp.log.hasTagLevel",function(a){return void 0===a?!1:0<=qh[a]});_.x("clpp.log.setTagLevel",function(a,b){a&&(_.jh(b)&&(b=uh(b)),qh[a]=b)});
347
- _.x("clpp.log.setLogLevel",function(a){-1===a&&(a=3);_.jh(a)&&(a=uh(a));rh=a});_.x("clpp.log.getLogLevel",function(){return rh});
348
- _.T=class{constructor(a){(this.tag=a)&&void 0===qh[a]&&(qh[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=sh(this.tag);if(0<=d){if(d<c)return}else if(rh<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,
349
- arguments):2===c?console.warn.apply(console,arguments):1===c?console.error.apply(console,arguments):console.log.apply(console,arguments);for(const e of Ht)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)}Dh(a){return a?
350
- this.tag?new _.T(this.tag+"."+a):new _.T(a):this}};_.x("clpp.log.Logger",_.T);_.T.prototype.createChild=_.T.prototype.Dh;_.T.prototype.error=_.T.prototype.error;_.T.prototype.warn=_.T.prototype.warn;_.T.prototype.debug=_.T.prototype.debug;_.T.prototype.info=_.T.prototype.info;_.T.prototype.log=_.T.prototype.log;var vh=new _.T("clpp");_.x("clpp.log.info",_.wh);_.x("clpp.log.debug",_.xh);_.x("clpp.log.warn",_.C);_.x("clpp.log.error",_.yh);(function(){const a=console.assert;a?a.bind||(console.assert=function(){a.apply(console,arguments)}):console.assert=function(){}})();var bo;bo=class{constructor(a,b){this.nb=a;this.sourceIndex=b}};_.Ah=new _.T("clpp.players");_.zh={};_.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 Eh=new _.T("clpp.ads"),Dh=[];_.It=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(ub);}end(a){if(this.f)return this.f.end(a);if(a<this.a.length)return this.a[a].end;throw Error(ub);}Sb(){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)}Oa(){return!this.length||1===this.length&&1E-6>this.end(0)-this.start(0)?null:this.end(this.length-
351
- 1)}hc(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}Pa(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.Oa(),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=
352
- "";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",_.It);_.It.prototype.bufferedAheadOf=_.It.prototype.Pa;_.It.prototype.isBuffered=_.It.prototype.hc;_.It.prototype.bufferEnd=_.It.prototype.Oa;_.It.prototype.bufferStart=_.It.prototype.Sb;_.It.prototype.end=_.It.prototype.end;_.It.prototype.start=_.It.prototype.start;var Lh;Lh=new _.T("clpp.Components");_.Jh=new Map;_.x("clpp.install",function(a){Th(a)});_.x("clpp.uninstall",function(a){Uh(a)});_.I=class extends Error{constructor(a,b,c,d,e){super(Vh(a,b,c,d));this.severity=a;this.category=b;this.code=c;this.data=!d||_.jh(d)?{}:d;this.cause=void 0===e?null:e;this.f=!1;Error.captureStackTrace&&Error.captureStackTrace(this,_.I)}a(a){this.severity!==a&&(this.severity=a,this.message=Vh(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",_.I);_.D=2;_.I.Severity={RECOVERABLE:1,FATAL:_.D};
347
+ g.me(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(p,u){return typeof p==_.ae?function(v){try{l(p(v))}catch(y){m(y)}}:u}var l,m,n=new b(function(p,u){l=p;m=u});this.me(k(g,l),k(h,m));return n};b.prototype.catch=function(g){return this.then(void 0,g)};b.prototype.me=function(g,h){function k(){switch(l.f){case 1:g(l.l);break;case 2:h(l.l);break;default:throw Error("Unexpected state: "+
348
+ 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=ah(g),m=l.next();!m.done;m=l.next())d(m.value).me(h,k)})};b.all=function(g){var h=ah(g),k=h.next();return k.done?d([]):new b(function(l,m){function n(v){return function(y){p[v]=y;u--;0==u&&l(p)}}var p=[],u=0;do p.push(void 0),u++,d(k.value).me(n(p.length-1),m),k=h.next();while(!k.done)})};return b});var fh=this||self;
349
+ fh.a=!0;_.x("clpp.utils.obj.cloneItem",_.ih);_.x("clpp.utils.obj.merge",_.hh);var yh={DEFAULT:-1,NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4};_.x("clpp.log.Level",yh);var wh=0,vh={},Rt=[];_.x("clpp.log.getLoggers",function(){return _.ih(vh)});_.x("clpp.log.addInterceptor",function(a){a&&Rt.push(a)});_.x("clpp.log.removeInterceptor",function(a){a&&(a=Rt.indexOf(a),0<=a&&Rt.splice(a,1))});_.x("clpp.log.getTagLevel",xh);_.x("clpp.log.hasTagLevel",function(a){return void 0===a?!1:0<=vh[a]});_.x("clpp.log.setTagLevel",function(a,b){a&&(_.oh(b)&&(b=zh(b)),vh[a]=b)});
350
+ _.x("clpp.log.setLogLevel",function(a){-1===a&&(a=3);_.oh(a)&&(a=zh(a));wh=a});_.x("clpp.log.getLogLevel",function(){return wh});
351
+ _.T=class{constructor(a){(this.tag=a)&&void 0===vh[a]&&(vh[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=xh(this.tag);if(0<=d){if(d<c)return}else if(wh<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,
352
+ arguments):2===c?console.warn.apply(console,arguments):1===c?console.error.apply(console,arguments):console.log.apply(console,arguments);for(const e of Rt)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)}Oh(a){return a?
353
+ this.tag?new _.T(this.tag+"."+a):new _.T(a):this}};_.x("clpp.log.Logger",_.T);_.T.prototype.createChild=_.T.prototype.Oh;_.T.prototype.error=_.T.prototype.error;_.T.prototype.warn=_.T.prototype.warn;_.T.prototype.debug=_.T.prototype.debug;_.T.prototype.info=_.T.prototype.info;_.T.prototype.log=_.T.prototype.log;var Ah=new _.T("clpp");_.x("clpp.log.info",_.Bh);_.x("clpp.log.debug",_.Ch);_.x("clpp.log.warn",_.B);_.x("clpp.log.error",_.Dh);(function(){const a=console.assert;a?a.bind||(console.assert=function(){a.apply(console,arguments)}):console.assert=function(){}})();var go;go=class{constructor(a,b){this.ob=a;this.sourceIndex=b}};_.Fh=new _.T("clpp.players");_.Eh={};_.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 Jh=new _.T("clpp.ads"),Ih=[];_.St=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(ub);}end(a){if(this.f)return this.f.end(a);if(a<this.a.length)return this.a[a].end;throw Error(ub);}Vb(){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)}Oa(){return!this.length||1===this.length&&1E-6>this.end(0)-this.start(0)?null:this.end(this.length-
354
+ 1)}oc(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}Pa(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.Oa(),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=
355
+ "";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",_.St);_.St.prototype.bufferedAheadOf=_.St.prototype.Pa;_.St.prototype.isBuffered=_.St.prototype.oc;_.St.prototype.bufferEnd=_.St.prototype.Oa;_.St.prototype.bufferStart=_.St.prototype.Vb;_.St.prototype.end=_.St.prototype.end;_.St.prototype.start=_.St.prototype.start;var Qh;Qh=new _.T("clpp.Components");_.Oh=new Map;_.x("clpp.install",function(a){Xh(a)});_.x("clpp.uninstall",function(a){Yh(a)});_.I=class extends Error{constructor(a,b,c,d,e){super(Zh(a,b,c,d));this.severity=a;this.category=b;this.code=c;this.data=!d||_.oh(d)?{}:d;this.cause=void 0===e?null:e;this.f=!1;Error.captureStackTrace&&Error.captureStackTrace(this,_.I)}a(a){this.severity!==a&&(this.severity=a,this.message=Zh(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",_.I);_.D=2;_.I.Severity={RECOVERABLE:1,FATAL:_.D};
353
356
  _.I.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,PLUGIN:9,ADS:10};
354
357
  _.I.Code={UNSUPPORTED_SCHEME:1E3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,REQUEST_MODIFIER_ERROR:1006,RESPONSE_MODIFIER_ERROR:1007,MALFORMED_TEST_URI:1008,MALFORMED_URL:1011,INVALID_TEXT_HEADER:2E3,INVALID_TEXT_CUE:2001,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,FETCH_OR_APPEND_ERROR:2010,INVALID_MP4:2011,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,
355
358
  EBML_BAD_FLOATING_POINT_SIZE:3003,MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005,MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,TRANSMUXING_FAILED:3018,
@@ -359,68 +362,69 @@ SMOOTH_EMPTY_PRESENTATION:4034,SMOOTH_MEDIA_PROCESSING_ERROR:4035,SMOOTH_INVALID
359
362
  NO_RECOGNIZED_KEY_SYSTEMS:6E3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,REQUESTED_DRM_ENVIRONMENT_UNAVAILABLE:6015,INIT_DATA_TRANSFORM_ERROR:6016,CERTIFICATE_REQUEST_FAILED:6100,
360
363
  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,CANNOT_LOAD_SOURCE:7003,MEDIA_ELEMENT_NOT_FOUND:7004,INVALID_MEDIA_ELEMENT:7005,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,
361
364
  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,YOUBORA_SDK_VERSION_NOT_SUPPORTED:9102,VIMOND_INVALID_CONFIGURATION:9200,VIMOND_SESSION_ERROR:9201,MUXDATA_INVALID_CONFIGURATION:9300,
362
- 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};_.pl=class extends Error{constructor(a,b){super(a);this.code=b}};_.H=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(){}};_.Jt=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 Kt;_.Lt=class{constructor(){this.a=new _.Jt}release(){_.Xh(this)}on(a,b,c,d=!1){a=new Kt(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||(Wh(f),this.a.remove(b,f))}}};Kt=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 Mt=class{constructor(a,b,c,d){this.h=a;this.a=b;this.f=c;this.j=!!d}trigger(a){try{this.a.handleEvent?this.a.handleEvent(a):this.a.call(this.f,a)}catch(b){_.yh("clpp","Uncaught exception in event handler for event '"+this.h+"'",b,b?b.message:null,b?b.stack:null)}}};var Nt=class{constructor(a){this.a=new _.Jt;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].trigger(a),b[c].j&&this.a.remove(a.type,b[c]),!a||!a.f);c++);}on(a,b,c){this.a.push(a,new Mt(a,b,c||this.f));return b}one(a,b,c){this.a.push(a,new Mt(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].a===b&&(d=this.a.remove(a,c[e])||d);return d}clear(){this.a.clear()}};_.Ot=class{constructor(){this.ud=new Nt(this);this.sd=[]}addEventListener(a,b){this.on(a,b)}removeEventListener(a,b){this.off(a,b)}on(a,b,c){return this.ud.on(a,b,c)}one(a,b,c){return this.ud.one(a,b,c)}off(a,b){return this.ud.off(a,b)}forwardEventsTo(a){a&&(0<=this.sd.indexOf(a)||this.sd.push(a))}dispatchEvent(a){this.trigger(a);return a.defaultPrevented}stopForwardingEventsTo(a){a&&(a=this.sd.indexOf(a),0<=a&&this.sd.splice(a,1))}trigger(a){this.ud.trigger(a);for(const b of this.sd)b.dispatchEvent(a)}};
363
- _.Ot.prototype.off=_.Ot.prototype.off;_.Ot.prototype.one=_.Ot.prototype.one;_.Ot.prototype.on=_.Ot.prototype.on;_.Ot.prototype.removeEventListener=_.Ot.prototype.removeEventListener;_.Ot.prototype.addEventListener=_.Ot.prototype.addEventListener;var Pt=class{load(){}j(){}B(){}resume(){}pause(){}hb(){}isPaused(){}skip(){}getVolume(){}getAdVolume(){}setVolume(){}h(){}setMuted(){}isMuted(){}o(){}getPosition(){}w(){}A(){}};_.x("clpp.ads.IAdsManager",Pt);Pt.prototype.getPosition=Pt.prototype.getPosition;Pt.prototype.setVolume=Pt.prototype.setVolume;Pt.prototype.getVolume=Pt.prototype.getVolume;Pt.prototype.skip=Pt.prototype.skip;Pt.prototype.pause=Pt.prototype.pause;Pt.prototype.resume=Pt.prototype.resume;_.x("clpp.events.ERROR",_.Xd);_.x("clpp.events.LOADEDMETADATA",_.re);_.x("clpp.events.BUFFERING_ENDED",_.Oc);_.x("clpp.events.BUFFERING_STARTED",_.Pc);_.x("clpp.events.STATE_CHANGED",_.Qf);_.x("clpp.events.AUDIO_TRACK_CHANGED",_.Kc);_.x("clpp.events.TEXT_TRACK_CHANGED",_.ag);_.x("clpp.events.VIDEO_TRACK_CHANGED",_.Bg);_.x("clpp.events.BITRATE_CHANGED",_.Mc);_.x("clpp.events.TRACKS_ADDED",_.gg);_.x("clpp.events.LOAD_START",se);_.x("clpp.events.RELEASING",_.xf);_.x("clpp.events.RELEASED",wf);
364
- _.x("clpp.events.DESTROYING","destroying");_.x("clpp.events.DESTROYED","destroyed");_.x("clpp.events.VIDEO_BUFFER_CHANGED",_.Ag);_.x("clpp.events.AUDIO_BUFFER_CHANGED",_.Jc);_.x("clpp.events.DOWNLOAD_TRACE","downloadtrace");_.x("clpp.events.DRM_SESSION_CREATED",Nd);_.x("clpp.events.DRM_SESSION_UPDATE",_.Qd);_.x("clpp.events.DRM_SESSION_PERSISTED",_.Pd);_.x("clpp.events.DRM_RENEWAL_STARTED",Md);_.x("clpp.events.DRM_EXPIRATION_UPDATE",_.Kd);_.x("clpp.events.DRM_LICENSE_REQUESTED",Ld);
365
- _.x("clpp.events.AUTOPLAY_NOT_ALLOWED",_.Lc);_.x("clpp.events.PLAY",_.We);_.x("clpp.events.SEEKING",_.If);_.x("clpp.events.SEEKED",_.Hf);_.x("clpp.events.USER_SEEKING",_.tg);_.x("clpp.events.USER_SEEKED",_.sg);_.vs={SEEKING:1,NO_DATA:2};_.x("clpp.events.BufferingReasons",_.vs);_.x("clpp.events.ADS_TIMELINE_CHANGED",_.pc);_.x("clpp.events.AD_LOADED",_.cc);_.x("clpp.events.AD_BREAK_STARTED",_.Tb);_.x("clpp.events.AD_STARTED",_.lc);_.x("clpp.events.AD_BUFFERING",_.Vb);_.x("clpp.events.AD_PROGRESS",_.ic);
366
- _.x("clpp.events.AD_FIRST_QUARTILE",_.Yb);_.x("clpp.events.AD_MIDPOINT",_.dc);_.x("clpp.events.AD_THIRD_QUARTILE",_.nc);_.x("clpp.events.AD_PAUSED",_.gc);_.x("clpp.events.AD_RESUMED",_.jc);_.x("clpp.events.AD_SKIPPED",_.kc);_.x("clpp.events.AD_CLICKED",_.Wb);_.x("clpp.events.AD_IMPRESSION",_.bc);_.x("clpp.events.AD_COMPLETED",_.Xb);_.x("clpp.events.AD_STOPPED",_.mc);_.x("clpp.events.AD_BREAK_STOPPED",_.Ub);_.x("clpp.events.AD_HLS_ASSET_LIST_REQUEST",Zb);
367
- _.x("clpp.events.AD_HLS_ASSET_LIST_RESPONSE",$b);_.x("clpp.events.AD_HLS_RESOLVED",ac);_.x("clpp.events.SIMID_CREATIVE_STARTED",_.Kf);_.x("clpp.events.SIMID_CREATIVE_STOPPED",_.Lf);_.x("clpp.events.CASTING_STARTED",_.Sc);_.x("clpp.events.CASTING_ENDED","castingended");_.x("clpp.events.CAST_STATUS_CHANGED",_.Tc);_.x("clpp.events.CAST_VISIBILITY_CHANGED",_.Uc);_.x("clpp.events.AIRPLAY_STATUS_CHANGED",_.sc);_.x("clpp.events.AIRPLAY_CASTING_STARTED",_.rc);_.x("clpp.events.AIRPLAY_CASTING_ENDED",_.qc);
368
- _.x("clpp.events.TIMELINE_CUE_ADDED",_.bg);_.x("clpp.events.TIMELINE_CUE_ENTER",_.cg);_.x("clpp.events.TIMELINE_CUE_EXIT",_.dg);_.x("clpp.events.TIMELINE_CUES_CHANGED",_.eg);_.x("clpp.events.MPD_TYPE_CHANGED",_.Ee);_.x("clpp.events.LIVE_TURNED_STATIC",_.oe);_.x("clpp.events.VIMOND_RESPONSE",_.Cg);_.x("clpp.events.PLAYLIST_ITEM_CHANGED",_.hf);_.x("clpp.events.PLAYLIST_MODIFIED",_.jf);_.x("clpp.events.SC_PLAYLIST_TIMELINE_CHANGED",_.Ff);_.x("clpp.events.SC_PLAYLIST_ITEM_CHANGED",_.Df);
369
- _.x("clpp.events.SC_PLAYLIST_ENDED",_.Cf);_.x("clpp.events.SC_PLAYLIST_LIVE_TURNED_STATIC",_.Ef);_.x("clpp.events.CDN_SWITCH_SUCCESS",_.Vc);_.x("clpp.events.ONLINE_STATUS_CHANGED",Oe);_.x("clpp.events.CMSD_EVENT","cmsd-event");_.x("clpp.events.YOSPACE_SESSION_STARTED",_.Rg);_.x("clpp.events.YOSPACE_SESSION_ENDED",_.Qg);_.x("clpp.events.CONTENT_STEERING_CHANGE",_.yd);_.x("clpp.events.CONTENT_STEERING_LOCATION_BAN_UPDATE",_.zd);var U=class{bb(){}cb(){}fb(){}getId(){}getCreativeId(){}xb(){}getApiFramework(){}getAdSystem(){}getAdvertiserName(){}getTitle(){}getDuration(){}getPosition(){}getSkipTimeOffset(){}zb(){}Ra(){}getMediaUrl(){}Ua(){}Ta(){}Ba(){}Ca(){}getPodIndex(){}ob(){}eb(){}Va(){}getWrapperAdIds(){}getWrapperAdSystems(){}getWrapperCreativeIds(){}yb(){}canSeek(){}};_.x("clpp.ads.IAd",U);U.prototype.canSeek=U.prototype.canSeek;U.prototype.getVideoElement=U.prototype.yb;U.prototype.getWrapperCreativeIds=U.prototype.getWrapperCreativeIds;
370
- U.prototype.getWrapperAdSystems=U.prototype.getWrapperAdSystems;U.prototype.getWrapperAdIds=U.prototype.getWrapperAdIds;U.prototype.getSequenceLength=U.prototype.Va;U.prototype.getPositionInSequence=U.prototype.eb;U.prototype.getPodTimeOffset=U.prototype.ob;U.prototype.getPodIndex=U.prototype.getPodIndex;U.prototype.getPodType=U.prototype.Ca;U.prototype.getMediaBitrate=U.prototype.Ba;U.prototype.getMediaHeight=U.prototype.Ta;U.prototype.getMediaWidth=U.prototype.Ua;U.prototype.getMediaUrl=U.prototype.getMediaUrl;
371
- U.prototype.getClickThroughUrl=U.prototype.Ra;U.prototype.isBumper=U.prototype.zb;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.getSourceId=U.prototype.xb;
372
- U.prototype.getCreativeId=U.prototype.getCreativeId;U.prototype.getId=U.prototype.getId;U.prototype.getTechnology=U.prototype.fb;U.prototype.getAdManagerVersion=U.prototype.cb;U.prototype.getAdManagerName=U.prototype.bb;var J=class{constructor(a,b,c,d,e,f,g){this.o=this.l=this.j=!1;this.F=a;this.f=b;this.a=c;this.h=d;this.w=0;this.B=`${e}:${b}`;this.G=e;this.videoEl=null;this.A=f;this.C=g||null}bb(){return""}cb(){return""}fb(){return 2}getId(){return this.B}getCreativeId(){return""}xb(){return this.G}getApiFramework(){return null}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return""}getDuration(){return this.h}getPosition(){return this.w}getSkipTimeOffset(){return-1}canSeek(){return this.A}zb(){return!1}Ra(){return null}getMediaUrl(){return null}Ua(){return 0}Ta(){return 0}Ba(){return 0}Ca(){return this.F}getPodIndex(){return 0}ob(){return 0}eb(){return this.f}Va(){return this.a}getWrapperAdIds(){return[]}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}yb(){return this.videoEl}Vh(){return this.C}};
373
- J.prototype.getCustomAttributes=J.prototype.Vh;J.prototype.getVideoElement=J.prototype.yb;J.prototype.getWrapperCreativeIds=J.prototype.getWrapperCreativeIds;J.prototype.getWrapperAdSystems=J.prototype.getWrapperAdSystems;J.prototype.getWrapperAdIds=J.prototype.getWrapperAdIds;J.prototype.getSequenceLength=J.prototype.Va;J.prototype.getPositionInSequence=J.prototype.eb;J.prototype.getPodTimeOffset=J.prototype.ob;J.prototype.getPodIndex=J.prototype.getPodIndex;J.prototype.getPodType=J.prototype.Ca;
374
- J.prototype.getMediaBitrate=J.prototype.Ba;J.prototype.getMediaHeight=J.prototype.Ta;J.prototype.getMediaWidth=J.prototype.Ua;J.prototype.getMediaUrl=J.prototype.getMediaUrl;J.prototype.getClickThroughUrl=J.prototype.Ra;J.prototype.isBumper=J.prototype.zb;J.prototype.canSeek=J.prototype.canSeek;J.prototype.getSkipTimeOffset=J.prototype.getSkipTimeOffset;J.prototype.getPosition=J.prototype.getPosition;J.prototype.getDuration=J.prototype.getDuration;J.prototype.getTitle=J.prototype.getTitle;
375
- J.prototype.getAdvertiserName=J.prototype.getAdvertiserName;J.prototype.getAdSystem=J.prototype.getAdSystem;J.prototype.getApiFramework=J.prototype.getApiFramework;J.prototype.getSourceId=J.prototype.xb;J.prototype.getCreativeId=J.prototype.getCreativeId;J.prototype.getId=J.prototype.getId;J.prototype.getTechnology=J.prototype.fb;J.prototype.getAdManagerVersion=J.prototype.cb;J.prototype.getAdManagerName=J.prototype.bb;var Qt=class{constructor(a){this.a=a.map(b=>({cc:b.getSurface().getMedia().id,player:b,ae:!0,ready:Promise.resolve()}));this.g=new _.T("clpp.playlist.PlayerPool")}has(){return this.a.some(a=>a.ae)}get(){const a=this;return _.w(function*(){const b=a.a.find(c=>c.ae);if(!b)throw Error("No available players in the pool");b.ae=!1;yield b.ready;return b.player})}release(a){const b=this.a.find(c=>c.player===a);if(!b)return Promise.resolve();b.ae=!0;b.ready=new Promise(c=>{a.release().catch(d=>{this.g.error("Failed to unload player",
376
- d)}).then(c)});return b.ready}destroy(){const a=this;return _.w(function*(){yield Promise.all(a.a.map(b=>b.player.destroy()))})}};var Rt=class{};_.x("clpp.utils.BufferUtils",Rt);Rt.toArrayBuffer=li;Rt.toDataView=_.ki;Rt.toInt32Array=_.ji;Rt.toUint32Array=ii;Rt.toUint16Array=hi;Rt.toUint8Array=_.G;Rt.equal=fi;var oi=new _.T("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);
365
+ 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};_.tl=class extends Error{constructor(a,b){super(a);this.code=b}};_.H=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(){}};_.Tt=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 Ut;_.Vt=class{constructor(){this.a=new _.Tt}release(){_.ai(this)}on(a,b,c,d=!1){a=new Ut(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||($h(f),this.a.remove(b,f))}}};Ut=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 Wt=class{constructor(a,b,c,d){this.h=a;this.a=b;this.f=c;this.j=!!d}trigger(a){try{this.a.handleEvent?this.a.handleEvent(a):this.a.call(this.f,a)}catch(b){_.Dh("clpp","Uncaught exception in event handler for event '"+this.h+"'",b,b?b.message:null,b?b.stack:null)}}};var Xt=class{constructor(a){this.a=new _.Tt;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].trigger(a),b[c].j&&this.a.remove(a.type,b[c]),!a||!a.f);c++);}on(a,b,c){this.a.push(a,new Wt(a,b,c||this.f));return b}one(a,b,c){this.a.push(a,new Wt(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].a===b&&(d=this.a.remove(a,c[e])||d);return d}clear(){this.a.clear()}};_.Yt=class{constructor(){this.Ed=new Xt(this);this.Bd=[]}addEventListener(a,b){this.on(a,b)}removeEventListener(a,b){this.off(a,b)}on(a,b,c){return this.Ed.on(a,b,c)}one(a,b,c){return this.Ed.one(a,b,c)}off(a,b){return this.Ed.off(a,b)}forwardEventsTo(a){a&&(0<=this.Bd.indexOf(a)||this.Bd.push(a))}dispatchEvent(a){this.trigger(a);return a.defaultPrevented}stopForwardingEventsTo(a){a&&(a=this.Bd.indexOf(a),0<=a&&this.Bd.splice(a,1))}trigger(a){this.Ed.trigger(a);for(const b of this.Bd)b.dispatchEvent(a)}};
366
+ _.Yt.prototype.off=_.Yt.prototype.off;_.Yt.prototype.one=_.Yt.prototype.one;_.Yt.prototype.on=_.Yt.prototype.on;_.Yt.prototype.removeEventListener=_.Yt.prototype.removeEventListener;_.Yt.prototype.addEventListener=_.Yt.prototype.addEventListener;var Zt=class{load(){}j(){}A(){}resume(){}pause(){}jb(){}isPaused(){}skip(){}getVolume(){}getAdVolume(){}setVolume(){}h(){}setMuted(){}isMuted(){}qb(){}getPosition(){}o(){}w(){}};_.x("clpp.ads.IAdsManager",Zt);Zt.prototype.getPosition=Zt.prototype.getPosition;Zt.prototype.setVolume=Zt.prototype.setVolume;Zt.prototype.getVolume=Zt.prototype.getVolume;Zt.prototype.skip=Zt.prototype.skip;Zt.prototype.pause=Zt.prototype.pause;Zt.prototype.resume=Zt.prototype.resume;_.x("clpp.events.ERROR",_.Xd);_.x("clpp.events.LOADEDMETADATA",_.se);_.x("clpp.events.BUFFERING_ENDED",_.Oc);_.x("clpp.events.BUFFERING_STARTED",_.Pc);_.x("clpp.events.STATE_CHANGED",_.Rf);_.x("clpp.events.AUDIO_TRACK_CHANGED",_.Kc);_.x("clpp.events.TEXT_TRACK_CHANGED",_.bg);_.x("clpp.events.VIDEO_TRACK_CHANGED",_.Cg);_.x("clpp.events.BITRATE_CHANGED",_.Mc);_.x("clpp.events.TRACKS_ADDED",_.hg);_.x("clpp.events.LOAD_START",te);_.x("clpp.events.RELEASING",_.yf);_.x("clpp.events.RELEASED",xf);
367
+ _.x("clpp.events.DESTROYING","destroying");_.x("clpp.events.DESTROYED","destroyed");_.x("clpp.events.VIDEO_BUFFER_CHANGED",_.Bg);_.x("clpp.events.AUDIO_BUFFER_CHANGED",_.Jc);_.x("clpp.events.DOWNLOAD_TRACE","downloadtrace");_.x("clpp.events.DRM_SESSION_CREATED",Nd);_.x("clpp.events.DRM_SESSION_UPDATE",_.Qd);_.x("clpp.events.DRM_SESSION_PERSISTED",_.Pd);_.x("clpp.events.DRM_RENEWAL_STARTED",Md);_.x("clpp.events.DRM_EXPIRATION_UPDATE",_.Kd);_.x("clpp.events.DRM_LICENSE_REQUESTED",Ld);
368
+ _.x("clpp.events.AUTOPLAY_NOT_ALLOWED",_.Lc);_.x("clpp.events.PLAY",_.Xe);_.x("clpp.events.SEEKING",_.Jf);_.x("clpp.events.SEEKED",_.If);_.x("clpp.events.USER_SEEKING",_.ug);_.x("clpp.events.USER_SEEKED",_.qg);_.Fs={SEEKING:1,NO_DATA:2};_.x("clpp.events.BufferingReasons",_.Fs);_.x("clpp.events.ADS_TIMELINE_CHANGED",_.qc);_.x("clpp.events.AD_LOADED",_.dc);_.x("clpp.events.AD_BREAK_STARTED",_.Ub);_.x("clpp.events.AD_STARTED",_.mc);_.x("clpp.events.AD_BUFFERING",_.Wb);_.x("clpp.events.AD_PROGRESS",_.jc);
369
+ _.x("clpp.events.AD_FIRST_QUARTILE",_.Zb);_.x("clpp.events.AD_MIDPOINT",_.ec);_.x("clpp.events.AD_THIRD_QUARTILE",_.oc);_.x("clpp.events.AD_PAUSED",_.hc);_.x("clpp.events.AD_RESUMED",_.kc);_.x("clpp.events.AD_SKIPPED",_.lc);_.x("clpp.events.AD_CLICKED",_.Xb);_.x("clpp.events.AD_IMPRESSION",_.cc);_.x("clpp.events.AD_COMPLETED",_.Yb);_.x("clpp.events.AD_STOPPED",_.nc);_.x("clpp.events.AD_BREAK_STOPPED",_.Vb);_.x("clpp.events.AD_HLS_ASSET_LIST_REQUEST",$b);
370
+ _.x("clpp.events.AD_HLS_ASSET_LIST_RESPONSE",ac);_.x("clpp.events.AD_HLS_RESOLVED",bc);_.x("clpp.events.SIMID_CREATIVE_STARTED",_.Lf);_.x("clpp.events.SIMID_CREATIVE_STOPPED",_.Mf);_.x("clpp.events.CASTING_STARTED",_.Sc);_.x("clpp.events.CASTING_ENDED","castingended");_.x("clpp.events.CAST_STATUS_CHANGED",_.Tc);_.x("clpp.events.CAST_VISIBILITY_CHANGED",_.Uc);_.x("clpp.events.AIRPLAY_STATUS_CHANGED",_.tc);_.x("clpp.events.AIRPLAY_CASTING_STARTED",_.sc);_.x("clpp.events.AIRPLAY_CASTING_ENDED",_.rc);
371
+ _.x("clpp.events.TIMELINE_CUE_ADDED",_.cg);_.x("clpp.events.TIMELINE_CUE_ENTER",_.dg);_.x("clpp.events.TIMELINE_CUE_EXIT",_.eg);_.x("clpp.events.TIMELINE_CUES_CHANGED",_.fg);_.x("clpp.events.MPD_TYPE_CHANGED",_.Fe);_.x("clpp.events.LIVE_TURNED_STATIC",_.pe);_.x("clpp.events.VIMOND_RESPONSE",_.Dg);_.x("clpp.events.PLAYLIST_ITEM_CHANGED",_.jf);_.x("clpp.events.PLAYLIST_MODIFIED",_.kf);_.x("clpp.events.SC_PLAYLIST_TIMELINE_CHANGED",_.Gf);_.x("clpp.events.SC_PLAYLIST_ITEM_CHANGED",_.Ef);
372
+ _.x("clpp.events.SC_PLAYLIST_ENDED",_.Df);_.x("clpp.events.SC_PLAYLIST_LIVE_TURNED_STATIC",_.Ff);_.x("clpp.events.CDN_SWITCH_SUCCESS",_.Vc);_.x("clpp.events.ONLINE_STATUS_CHANGED",Pe);_.x("clpp.events.CMSD_EVENT","cmsd-event");_.x("clpp.events.YOSPACE_SESSION_STARTED",_.Wg);_.x("clpp.events.YOSPACE_SESSION_ENDED",_.Vg);_.x("clpp.events.CONTENT_STEERING_CHANGE",_.yd);_.x("clpp.events.CONTENT_STEERING_LOCATION_BAN_UPDATE",_.zd);var U=class{eb(){}fb(){}hb(){}getId(){}getCreativeId(){}zb(){}getApiFramework(){}getAdSystem(){}getAdvertiserName(){}getTitle(){}getDuration(){}getPosition(){}getSkipTimeOffset(){}Bb(){}Ra(){}getMediaUrl(){}Va(){}Ua(){}Ba(){}Ca(){}getPodIndex(){}pb(){}gb(){}Wa(){}getWrapperAdIds(){}getWrapperAdSystems(){}getWrapperCreativeIds(){}Ab(){}canSeek(){}};_.x("clpp.ads.IAd",U);U.prototype.canSeek=U.prototype.canSeek;U.prototype.getVideoElement=U.prototype.Ab;U.prototype.getWrapperCreativeIds=U.prototype.getWrapperCreativeIds;
373
+ U.prototype.getWrapperAdSystems=U.prototype.getWrapperAdSystems;U.prototype.getWrapperAdIds=U.prototype.getWrapperAdIds;U.prototype.getSequenceLength=U.prototype.Wa;U.prototype.getPositionInSequence=U.prototype.gb;U.prototype.getPodTimeOffset=U.prototype.pb;U.prototype.getPodIndex=U.prototype.getPodIndex;U.prototype.getPodType=U.prototype.Ca;U.prototype.getMediaBitrate=U.prototype.Ba;U.prototype.getMediaHeight=U.prototype.Ua;U.prototype.getMediaWidth=U.prototype.Va;U.prototype.getMediaUrl=U.prototype.getMediaUrl;
374
+ U.prototype.getClickThroughUrl=U.prototype.Ra;U.prototype.isBumper=U.prototype.Bb;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.getSourceId=U.prototype.zb;
375
+ U.prototype.getCreativeId=U.prototype.getCreativeId;U.prototype.getId=U.prototype.getId;U.prototype.getTechnology=U.prototype.hb;U.prototype.getAdManagerVersion=U.prototype.fb;U.prototype.getAdManagerName=U.prototype.eb;var J=class{constructor(a,b,c,d,e,f,g){this.o=this.l=this.j=!1;this.F=a;this.f=b;this.a=c;this.h=d;this.w=0;this.B=`${e}:${b}`;this.G=e;this.videoEl=null;this.A=f;this.C=g||null}eb(){return""}fb(){return""}hb(){return 2}getId(){return this.B}getCreativeId(){return""}zb(){return this.G}getApiFramework(){return null}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return""}getDuration(){return this.h}setPosition(a){this.w=a}getPosition(){return this.w}getSkipTimeOffset(){return-1}canSeek(){return this.A}Bb(){return!1}Ra(){return null}getMediaUrl(){return null}Va(){return 0}Ua(){return 0}Ba(){return 0}Ca(){return this.F}getPodIndex(){return 0}pb(){return 0}gb(){return this.f}Wa(){return this.a}getWrapperAdIds(){return[]}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}Ab(){return this.videoEl}fi(){return this.C}};
376
+ J.prototype.getCustomAttributes=J.prototype.fi;J.prototype.getVideoElement=J.prototype.Ab;J.prototype.getWrapperCreativeIds=J.prototype.getWrapperCreativeIds;J.prototype.getWrapperAdSystems=J.prototype.getWrapperAdSystems;J.prototype.getWrapperAdIds=J.prototype.getWrapperAdIds;J.prototype.getSequenceLength=J.prototype.Wa;J.prototype.getPositionInSequence=J.prototype.gb;J.prototype.getPodTimeOffset=J.prototype.pb;J.prototype.getPodIndex=J.prototype.getPodIndex;J.prototype.getPodType=J.prototype.Ca;
377
+ J.prototype.getMediaBitrate=J.prototype.Ba;J.prototype.getMediaHeight=J.prototype.Ua;J.prototype.getMediaWidth=J.prototype.Va;J.prototype.getMediaUrl=J.prototype.getMediaUrl;J.prototype.getClickThroughUrl=J.prototype.Ra;J.prototype.isBumper=J.prototype.Bb;J.prototype.canSeek=J.prototype.canSeek;J.prototype.getSkipTimeOffset=J.prototype.getSkipTimeOffset;J.prototype.getPosition=J.prototype.getPosition;J.prototype.getDuration=J.prototype.getDuration;J.prototype.getTitle=J.prototype.getTitle;
378
+ J.prototype.getAdvertiserName=J.prototype.getAdvertiserName;J.prototype.getAdSystem=J.prototype.getAdSystem;J.prototype.getApiFramework=J.prototype.getApiFramework;J.prototype.getSourceId=J.prototype.zb;J.prototype.getCreativeId=J.prototype.getCreativeId;J.prototype.getId=J.prototype.getId;J.prototype.getTechnology=J.prototype.hb;J.prototype.getAdManagerVersion=J.prototype.fb;J.prototype.getAdManagerName=J.prototype.eb;var $t=class{constructor(a){this.a=a.map(b=>({ic:b.getSurface().getMedia().id,player:b,le:!0,ready:Promise.resolve()}));this.g=new _.T("clpp.playlist.PlayerPool")}has(){return this.a.some(a=>a.le)}get(){const a=this;return _.w(function*(){const b=a.a.find(c=>c.le);if(!b)throw Error("No available players in the pool");b.le=!1;yield b.ready;return b.player})}release(a){const b=this.a.find(c=>c.player===a);if(!b)return Promise.resolve();b.le=!0;b.ready=new Promise(c=>{a.release().catch(d=>{this.g.error("Failed to unload player",
379
+ d)}).then(c)});return b.ready}destroy(){const a=this;return _.w(function*(){yield Promise.all(a.a.map(b=>b.player.destroy()))})}};var au=class{};_.x("clpp.utils.BufferUtils",au);au.toArrayBuffer=pi;au.toDataView=_.oi;au.toInt32Array=_.ni;au.toUint32Array=mi;au.toUint16Array=li;au.toUint8Array=_.G;au.equal=ji;var si=new _.T("clpp.utils.strings");_.x("clpp.utils.strings.fromUtf8",_.ri);_.x("clpp.utils.strings.fromBytesAutoDetect",_.ui);_.x("clpp.utils.strings.toUtf8",_.vi);_.x("clpp.utils.strings.toUtf16",_.wi);_.x("clpp.utils.strings.toByteArray",_.xi);_.x("clpp.utils.strings.startsWith",_.yi);_.x("clpp.utils.strings.endsWith",_.zi);_.x("clpp.utils.strings.bitrateToString",_.Ci);
377
380
  _.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)))});
378
- _.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");_.x("clpp.utils.dom.createHTMLElement",_.Ei);var St=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=Fi(this,a)}get(){return this.a}};_.Tt=class{constructor(a){this.f=a;this.a=null}la(a){return Hi(this,a,!1)}Fb(a){return Hi(this,a,!0)}stop(){this.a&&(this.a(),this.a=null)}};_.Li=class{constructor(a){this.f=a;this.a=null}Af(){this.stop();this.f();return this}la(a){this.stop();this.a=(new _.Tt(()=>{this.f()})).la(a);return this}Fb(a){this.stop();this.a=(new _.Tt(()=>{this.f()})).Fb(a);return this}stop(){this.a&&(this.a.stop(),this.a=null)}};_.x("clpp.utils.Timer",_.Li);_.Li.prototype.stop=_.Li.prototype.stop;_.Li.prototype.tickEvery=_.Li.prototype.Fb;_.Li.prototype.tickAfter=_.Li.prototype.la;_.Li.prototype.tickNow=_.Li.prototype.Af;var Ut=class{};_.x(od,Ut);Ut.getInfo=_.lj;
379
- var Ki=null,Ji=null,aj=new _.T(od),ej="android",dj="ios",jj="linux",fj="osx",gj="windows",hj="tizen",ij="webos",cj=_.lg,kj=_.lg,Vi={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,
381
+ _.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 Di=document.createElement("span");_.x("clpp.utils.dom.createHTMLElement",_.Ii);var bu=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=Ji(this,a)}get(){return this.a}};_.cu=class{constructor(a){this.f=a;this.a=null}la(a){return Li(this,a,!1)}Hb(a){return Li(this,a,!0)}stop(){this.a&&(this.a(),this.a=null)}};_.Pi=class{constructor(a){this.f=a;this.a=null}Nf(){this.stop();this.f();return this}la(a){this.stop();this.a=(new _.cu(()=>{this.f()})).la(a);return this}Hb(a){this.stop();this.a=(new _.cu(()=>{this.f()})).Hb(a);return this}stop(){this.a&&(this.a.stop(),this.a=null)}};_.x("clpp.utils.Timer",_.Pi);_.Pi.prototype.stop=_.Pi.prototype.stop;_.Pi.prototype.tickEvery=_.Pi.prototype.Hb;_.Pi.prototype.tickAfter=_.Pi.prototype.la;_.Pi.prototype.tickNow=_.Pi.prototype.Nf;var du=class{};_.x(od,du);du.getInfo=_.pj;
382
+ var Oi=null,Ni=null,ej=new _.T(od),ij="android",hj="ios",nj="linux",jj="osx",kj="windows",lj="tizen",mj="webos",gj=_.mg,oj=_.mg,Zi={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,
380
383
  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,
381
384
  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},
382
- 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 rj=class{constructor(a,b){this.g=new _.T("clpp.PlayerSurface");this.w=_.ch(Vt,b);this.f=new St;this.h=null;this.a=new St;this.l=Wt;Wt+=1;this.o=`clpp-video-${this.l}`;this.j=new _.Lt;if(null==a)throw new _.I(_.D,7,7102,"No Media element was provided");if(!(a instanceof Element||(a=document.getElementById(a),a)))throw new _.I(_.D,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
385
+ 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 vj=class{constructor(a,b){this.g=new _.T("clpp.PlayerSurface");this.w=_.hh(eu,b);this.f=new bu;this.h=null;this.a=new bu;this.l=fu;fu+=1;this.o=`clpp-video-${this.l}`;this.j=new _.Vt;if(null==a)throw new _.I(_.D,7,7102,"No Media element was provided");if(!(a instanceof Element||(a=document.getElementById(a),a)))throw new _.I(_.D,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
383
386
  HTMLMediaElement))throw new _.I(_.D,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 _.I(_.D,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,
384
- 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),_.Ci(c,f);c.style.cssText=a.style.cssText;a.removeAttribute(_.Vf);for(d of[_.Mg,_.be])f=a.getAttribute(d),f=parseInt(f,10),isNaN(f)||(c.style[d]=`${f}px`),_.Pi()||a.removeAttribute(d);c.appendChild(a);d=c}d&&(this.a.set(d),Gi(this.a,"clpp-container"),
385
- Gi(this.a,this.o),Gi(this.f,_.ad),Gi(this.f,"clpp-video"));b.webOSStartupPatch&&mj(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?_.Ci(a,bd):this.g.debug("No media element available that could be hidden")}showMediaElement(){const a=this.getMedia();a?a.classList.remove(bd):
386
- 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&&_.Ci(a,_.ad);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){_.Ci(a,bd)}show(a){a.classList.remove(bd)}release(){this.j.release()}};
387
- rj.prototype.removeElementFromContainer=rj.prototype.removeElementFromContainer;rj.prototype.addElementToContainer=rj.prototype.addElementToContainer;rj.prototype.getCastElement=rj.prototype.getCastElement;rj.prototype.getContainer=rj.prototype.getContainer;rj.prototype.getMedia=rj.prototype.getMedia;var Vt={disableContainer:!1,webOSStartupPatch:!1,crossorigin:"anonymous",containerEl:null},Wt=1;var Xt=class{constructor(a){this.ka=a;this.l=!!a.sideAdContainer;this.h=[];this.a=a.Ng;this.C=oj(a);this.A=[];const b=sj(this,this.C,this.ka.Fh);this.o=new Qt(b);this.f=null;this.w=!1;this.j=new Map;this.F=a.toggleVisible;this.g=new _.T("clpp.interstitial.MultiController");this.ga=this.B=!1;this.G=a.yi||(()=>{});tj(this).forEach(c=>uj(this,c,!1))}getCurrentItem(){return this.f}je(){return this.f?this.f.player:null}ng(){return Array.from(this.j.values())}Cd(){return 0<this.j.size}play(a){return Jj(this,
388
- a,_.We)}load(a){return Jj(this,a,_.pe)}release(){const a=this;return _.w(function*(){yield Promise.all([yield Qj(a),a.f?Gj(a,a.f):Promise.resolve()]);a.f=null;a.w=!1})}destroy(){const a=this;return _.w(function*(){a.g.info("Destroy");yield a.release();yield a.o.destroy();dk(a)})}isMuted(){return this.B}},ak="preload",Xj=_.te,zj="primary",yj="ad";var qk=[403,401];_.x("clpp.net.DEFAULT_FATAL_STATUS_CODES",qk);_.x("clpp.net.makeRequest",_.vk);_.uk=6;_.x("clpp.net.RequestType",{MANIFEST:1,SEGMENT:2,LICENSE:3,APP:4,TIMING:5,OTHER:_.uk,CONTENT_STEERING:7});var Yt=class extends _.Ot{constructor(a){super();this.ka=_.ch({Ei:.5},a);this.Ge=this.ga=!1;this.g=new _.T("clpp.interstitial.Player");this.f=a.player;this.f.setSeekInterceptor((b,c)=>{if(c)return!0;if(this.ga)return!1;if(c=Fk(this))return this.g.info("Seek ignored while binding interstitial",c.ea),!1;Gk(this,b);c=Ik(this);const d=Jk(this,b),e=Kk(this,b);if(c){if(d&&d!==c)return Nk(this,d,b),!1;if(e&&e!==c)return Ok(this,e,b),!1;if(b<c.startTime-this.ka.resolutionOffsetSec)return Lk(this,c),!0;if(b<
389
- c.startTime)return Sj(this.Y),this.g.info("Seek inside resolution area of",c.ea),!0;if(b<=c.endTime)return this.g.info("Seek into the scheduled interstitial",c.ea),Vj(this.Y),!1;if(c.Zf)return this.g.info("Jump over a scheduled interstitial",c.ea),Uj(this.Y),c.state=ik,!0;this.g.info("Jump over a scheduled interstitial triggering it",c.ea);Vj(this.Y);ck(this.Y,b,!0);return!1}return d?(Nk(this,d,b),!1):e&&!e.Hh?(Ok(this,e,b),!1):!0});this.Y=new Xt({Fh:this.ka.config,Ng:a.player,preloadMedia:!0,nb:a.nb,
390
- sideAdContainer:this.ka.sideAdContainer,onAudioDecision:this.ka.onAudioDecision,yi:()=>{this.g.info("Resume primary content")}});this.h=[];this.a=[];this.j=!1;Wk(this,a.player)}destroy(){const a=this;return _.w(function*(){Xk(a);a.a=[];a.j=!1;a.f.setSeekInterceptor(null);yield a.Y.destroy()})}Nb(){return this.j}setMuted(a){var b=this.Y;b.B=a;b.l?a?(b.a.setMuted(!0),Wj(b,!0)):(a=b.getCurrentItem(),xj(b,a,a&&a.Vb?yj:zj)):(b.a.setMuted(a),Wj(b,a))}isMuted(){return this.Y.isMuted()}setVolume(a){tj(this.Y).forEach(b=>
391
- {b.setVolume(a)})}isLive(){const a=this.Y.je();return a?a.isLive():null}},ik=0,Ek=1,ml=2,nl=3,Hk=4,vl=5,jk=6;var Qn=class{constructor(){this.a=null}load(){return Promise.resolve()}j(){const a=Yk(this.a);return a?(a.play(),!1):!0}B(a,b,c){const d=a.getConfiguration();a=Object.assign({},{config:d,player:a,nb:b},d.ads.hls||{},{Di:c});this.a=new Yt(a);gl(this.a)}setMuted(a){this.a&&this.a.setMuted(a)}isMuted(){return this.a?this.a.isMuted():!0}o(){return null!==Yk(this.a)}hb(){const a=Yk(this.a);a&&a.pause()}isPaused(){const a=Yk(this.a);return a?a.isPaused():!1}skip(){}getAdVolume(){const a=Yk(this.a);return a?
392
- a.getVolume()||0:0}h(a){this.a.setVolume(a)}getPosition(){const a=Yk(this.a);return a?a.getPosition():-1}A(){return!this.a.Nb()}w(){return this.a.destroy()}setVolume(a){this.h(a)}getVolume(){return this.getAdVolume()}pause(){this.hb()}resume(){this.j()}};Qn.prototype.resume=Qn.prototype.resume;Qn.prototype.pause=Qn.prototype.pause;Qn.prototype.getVolume=Qn.prototype.getVolume;Qn.prototype.setVolume=Qn.prototype.setVolume;Qn.prototype.getPosition=Qn.prototype.getPosition;Qn.prototype.skip=Qn.prototype.skip;var Zt=class{constructor(a){this.m=a;this.j=this.m.getNetworkEngine();this.a=new _.Lt;this.h=null;this.f=!0;Al(this)}release(){this.a.release();Bl(this);this.m=null}};_.$t=class{constructor(){this.a=[]}destroy(){const a=[];for(const b of this.a)b.V.catch(()=>{}),a.push(b.abort());this.a=[];return Promise.all(a)}};_.Gl.prototype.resolve=function(){};_.Gl.prototype.reject=function(){};var au;_.qm=class{constructor(a,b){{var c=[a];let f=Hl(...c);if(!f||f.protocol.includes("."))c=b?[a,b]:[a,location.href],c=(f=Hl(...c))?c:null}if(!c)throw new _.I(_.D,1,1011,{message:"The provided URL is invalid.",url:a,base:b});const [d,e]=c;this.a=new URL(d,e);this.f=a.startsWith("//")}toString(){const a=this.a.toString();return this.f?a.replace(au,""):a}};au=/^[A-Za-z]+:/;var Kl=class{constructor(){this.a=Il()}};var Xl=class{constructor(a){this.a=new Uint8Array(a||65536);this.f=0;this.h=new Kl}};var bu=class{constructor(a,b){b=void 0===b?2:b;this.a=new Uint8Array(a);this.h=b;this.f=0}};var Wl=class{constructor(a,b){a=void 0===a?1E6:a;b=void 0===b?!0:b;this.j=new bu(a);this.length=a;this.A=b;this.f=this.a=this.h=0;this.l=null;this.o=-1;this.w=new Kl}};var cu=class{};_.x("clpp.utils.Uint8ArrayUtils",cu);cu.toStandardBase64=_.Zl;cu.concat=_.em;cu.equal=_.dm;cu.toHex=_.cm;cu.fromHex=_.bm;cu.fromBase64=_.am;cu.toBase64Url=_.$l;_.Hs=class{constructor(a,b){this.V=a;this.B=b;this.a=!1}abort(){this.a=!0;return this.B()}};var mm=class extends _.Hs{constructor(a,b){super(new _.Gl,()=>Promise.resolve());this.C=a;this.h=null;this.w=this.V;this.f=-1;this.j=this.l=this.o=null;this.A=b||null;jm(this)}then(a,b){this.V=this.V.then(a,b);return this}catch(a){this.V=this.V.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(()=>{})}};_.Dn=class{constructor(){this.h=[];this.f=[];this.j=[];this.w=!1;this.o=new _.$t;this.a={};this.headers=new Map;this.l=0;this.A=null;this.a.data=gm;!window.fetch||!window.AbortController||_.Pi(6)||_.Si()&&68<_.lj().browserVersion.major?(this.a.http=Yl,this.a.https=Yl):(this.a.http=Vl,this.a.https=Vl)}Ui(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.h=[];this.f=[];this.j=[];return this.o.destroy()}Nf(a){this.h.push(a)}md(a){this.j.push(a)}Rg(a){this.h=
393
- this.h.filter(b=>b!==a)}ze(a){this.j=this.j.filter(b=>b!==a)}fetch(a){let b=void 0;1===a.type&&(b={objectType:du});return _.pm(this,a,b)}};_.x("clpp.net.NetworkEngine",_.Dn);_.Dn.prototype.fetch=_.Dn.prototype.fetch;_.Dn.prototype.removeResponseModifier=_.Dn.prototype.ze;_.Dn.prototype.removeRequestModifier=_.Dn.prototype.Rg;_.Dn.prototype.addResponseModifier=_.Dn.prototype.md;_.Dn.prototype.addRequestModifier=_.Dn.prototype.Nf;_.Dn.prototype.setRateLimit=_.Dn.prototype.Ui;var rm=[];var um=!!(performance&&performance.mark&&performance.measure),wm=new _.T("clpp.perf");_.x("clpp.version",_.ea);_.x("clpp.name",_.ra);var Cn=null;_.x("clpp.configure",a=>{Cn=a});_.tl="application/x-mpegurl";_.x("clpp.Type",{DASH:_.vc,HLS:_.tl,SMOOTH_STREAMING:_.Cc,MP4:_.zg,MP3:"audio/mp3"});_.x("clpp.TimelineCueType",{SCTE35:_.Gf,DASH_CALLBACK:_.Fe,HLS_DATERANGE:_.de,UNKNOWN:_.lg});_.x("clpp.SpeedUpMode",{DECODER:_.Cd,SEEK:"seek"});_.x("clpp.CodecSwitchingStrategy",{PREVENT:_.rf,SMOOTH:_.Nf});var zm=new Map,ym=1,Gm=2,Cm=3,Bm=4;_.gp=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;
394
- _.ui(this.path,"/")||(this.path="/"+this.path);this.f=b.search;this.h=b.hash}};_.x("clpp.utils.url.queryString",_.Nm);var Rm;_.K=_.Yf;_.eu=1/15;Rm={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/]};Rm[_.K]=[/^vtt$/,/^wvtt/,/^stpp/];var du="m";var fu=class{};_.x("clpp.utils.PlayerConfiguration",fu);fu.create=function(...a){return _.an(a,{Mi:!1})};fu.build=_.an;_.x("clpp.utils.media.detectType",cn);var fn=new _.T("clpp.sources");_.x("clpp.drm.WidevineRobustnessLevel",{SW_SECURE_CRYPTO:_.ob,SW_SECURE_DECODE:_.pb,HW_SECURE_CRYPTO:Ga,HW_SECURE_DECODE:Ha,HW_SECURE_ALL:Fa});_.x("clpp.drm.PlayreadyRobustnessLevel",{SL150:"150",SL2000:"2000",SL3000:"3000"});_.x("clpp.drm.KeySystem",{NONE:_.Ge,CLEAR_KEY:_.Qe,WIDEVINE:_.wd,PLAYREADY:_.ud,FAIRPLAY:_.sd,PRIMETIME:_.rd});_.hn={};_.x("clpp.drm.registerDrmEnvironment",_.jn);var on=class{constructor(a,b,c){this.h=a;this.f=b;JSON.parse(_.ni(_.am(a)));this.a=JSON.parse(_.ni(_.am(b)));this.j=c}};var mn={n:"vXdoJIQCz6sZ9pbduNukEHOR0H2dHlwuuBUAR5Ot7WLEYvav5mn63yxr6F6TIl8RHTFw2siXQhHblZH2Y89o8vhcZRFkYXo6h0igEVafu-n0w52UEcH8Cqzlb8Q7x03Qb8OcKLngSzDkwe5Y2Aix6I66RRVNLLssqyjp2n5tXs4JQmYdqY6hhpGhmBN84naeCTdcPpAYhCw8jqbTSNrJp5hjU4GVvOiUtoYCvdESV9xrOR7fPCFXhWfLtC3i1k1zVoIM7YW5qD0F676jhqkF-GmDuCHpRY2I2Cxui-ytYEVIM6_pylSIlmYLjARmv2jXz9aV_WvHLh6B8Yx0slNGCQ",e:"AQAB"},Wm="eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ1cmxzIjpbIjovL2Nhc3RsYWJzLmNvbSJdLCJ0eXBlIjoiV2ViIiwia2lkIjoxOTUwLCJpbHYiOmZhbHNlfQ.jzGGRcbFr_2QET-4tbMcpR5pSaj7eV7X2d1HWw_VKQpPg3zCwSZSDuqw225dIYyAYwLSiElbozbZPSArkBXOsoUm-KZRUPF4m7WG0T7Uza5G-QaQw57BbbfcSsooSpatC997kHKLMTjO71By9Olcu5ykN164nZpGQtZNzQjYag-bnUaMVI5vvhzjlvDihORQ9V_qRlEh0-mpoz6W0-36HGAbWIXWq0kxPh6inbovby-ZmFpqGrVjWOEFa55EARZXPNW9ERupW5xrrYHZdwwTpdRTY5IwEnobS85yTrLhK8Y2MV4jlQLTtQp372fKDsuU6q6_4XvmNq1SgAoKoaf41g";var Tn=class{constructor(a){this.f=a;this.a=null;this.g=new _.T("clpp.utils.LicenseKey")}},Bn="vod",An="live";var Fn=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",
387
+ 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),_.Gi(c,f);c.style.cssText=a.style.cssText;a.removeAttribute(_.Wf);for(d of[_.Ng,_.be])f=a.getAttribute(d),f=parseInt(f,10),isNaN(f)||(c.style[d]=`${f}px`),_.Ti()||a.removeAttribute(d);c.appendChild(a);d=c}d&&(this.a.set(d),Ki(this.a,"clpp-container"),
388
+ Ki(this.a,this.o),Ki(this.f,_.ad),Ki(this.f,"clpp-video"));b.webOSStartupPatch&&qj(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?_.Gi(a,bd):this.g.debug("No media element available that could be hidden")}showMediaElement(){const a=this.getMedia();a?a.classList.remove(bd):
389
+ 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&&_.Gi(a,_.ad);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){_.Gi(a,bd)}show(a){a.classList.remove(bd)}release(){this.j.release()}};
390
+ vj.prototype.removeElementFromContainer=vj.prototype.removeElementFromContainer;vj.prototype.addElementToContainer=vj.prototype.addElementToContainer;vj.prototype.getCastElement=vj.prototype.getCastElement;vj.prototype.getContainer=vj.prototype.getContainer;vj.prototype.getMedia=vj.prototype.getMedia;var eu={disableContainer:!1,webOSStartupPatch:!1,crossorigin:"anonymous",containerEl:null},fu=1;var gu=class{constructor(a){this.ka=a;this.l=!!a.sideAdContainer;this.h=[];this.a=a.Yg;this.C=uj(a);this.A=[];const b=wj(this,this.C,this.ka.Qh);this.o=new $t(b);this.f=null;this.w=!1;this.j=new Map;this.F=a.toggleVisible;this.g=new _.T("clpp.interstitial.MultiController");this.ga=this.B=!1;this.G=a.Ji||(()=>{});xj(this).forEach(c=>yj(this,c,!1))}getCurrentItem(){return this.f}we(){return this.f?this.f.player:null}zg(){return Array.from(this.j.values())}Md(){return 0<this.j.size}play(a){return Nj(this,
391
+ a,_.Xe)}load(a){return Nj(this,a,_.qe)}release(){const a=this;return _.w(function*(){yield Promise.all([yield Uj(a),a.f?Kj(a,a.f):Promise.resolve()]);a.f=null;a.w=!1})}destroy(){const a=this;return _.w(function*(){a.g.info("Destroy");yield a.release();yield a.o.destroy();hk(a)})}isMuted(){return this.B}},ek="preload",bk=_.ue,Dj="primary",Cj="ad";var uk=[403,401];_.x("clpp.net.DEFAULT_FATAL_STATUS_CODES",uk);_.x("clpp.net.makeRequest",_.zk);_.yk=6;_.x("clpp.net.RequestType",{MANIFEST:1,SEGMENT:2,LICENSE:3,APP:4,TIMING:5,OTHER:_.yk,CONTENT_STEERING:7});var hu=class extends _.Yt{constructor(a){super();this.ka=_.hh({Qi:.5},a);this.Te=this.ga=!1;this.g=new _.T("clpp.interstitial.Player");this.f=a.player;this.f.setSeekInterceptor((b,c)=>{if(c)return!0;if(this.ga)return!1;if(c=Jk(this))return this.g.info("Seek ignored while binding interstitial",c.ea),!1;Kk(this,b);c=Mk(this);const d=Nk(this,b),e=Ok(this,b);if(c){if(d&&d!==c)return Rk(this,d,b),!1;if(e&&e!==c)return Sk(this,e,b),!1;if(b<c.startTime-this.ka.resolutionOffsetSec)return Pk(this,c),!0;if(b<
392
+ c.startTime)return Wj(this.Y),this.g.info("Seek inside resolution area of",c.ea),!0;if(b<=c.endTime)return this.g.info("Seek into the scheduled interstitial",c.ea),Zj(this.Y),!1;if(c.kg)return this.g.info("Jump over a scheduled interstitial",c.ea),Yj(this.Y),c.state=mk,!0;this.g.info("Jump over a scheduled interstitial triggering it",c.ea);Zj(this.Y);gk(this.Y,b,!0);return!1}return d?(Rk(this,d,b),!1):e&&!e.Sh?(Sk(this,e,b),!1):!0});this.Y=new gu({Qh:this.ka.config,Yg:a.player,preloadMedia:!0,ob:a.ob,
393
+ sideAdContainer:this.ka.sideAdContainer,onAudioDecision:this.ka.onAudioDecision,Ji:()=>{this.g.info("Resume primary content")}});this.h=[];this.a=[];this.j=!1;$k(this,a.player)}destroy(){const a=this;return _.w(function*(){al(a);a.a=[];a.j=!1;a.f.setSeekInterceptor(null);yield a.Y.destroy()})}Qb(){return this.j}setMuted(a){var b=this.Y;b.B=a;b.l?a?(b.a.setMuted(!0),ak(b,!0)):(a=b.getCurrentItem(),Bj(b,a,a&&a.Yb?Cj:Dj)):(b.a.setMuted(a),ak(b,a))}isMuted(){return this.Y.isMuted()}setVolume(a){xj(this.Y).forEach(b=>
394
+ {b.setVolume(a)})}isLive(){const a=this.Y.we();return a?a.isLive():null}},mk=0,Ik=1,ql=2,rl=3,Lk=4,zl=5,nk=6;var Un=class{constructor(){this.a=null}load(){return Promise.resolve()}j(){const a=bl(this.a);return a?(a.play(),!1):!0}A(a,b,c){const d=a.getConfiguration();a=Object.assign({},{config:d,player:a,ob:b},d.ads.hls||{},{Pi:c});this.a=new hu(a);kl(this.a)}setMuted(a){this.a&&this.a.setMuted(a)}isMuted(){return this.a?this.a.isMuted():!0}qb(){return null!==bl(this.a)}jb(){const a=bl(this.a);a&&a.pause()}isPaused(){const a=bl(this.a);return a?a.isPaused():!1}skip(){}getAdVolume(){const a=bl(this.a);return a?
395
+ a.getVolume()||0:0}h(a){this.a.setVolume(a)}getPosition(){const a=bl(this.a);return a?a.getPosition():-1}w(){return!this.a.Qb()}o(){return this.a.destroy()}setVolume(a){this.h(a)}getVolume(){return this.getAdVolume()}pause(){this.jb()}resume(){this.j()}};Un.prototype.resume=Un.prototype.resume;Un.prototype.pause=Un.prototype.pause;Un.prototype.getVolume=Un.prototype.getVolume;Un.prototype.setVolume=Un.prototype.setVolume;Un.prototype.getPosition=Un.prototype.getPosition;Un.prototype.skip=Un.prototype.skip;var iu=class{constructor(a){this.m=a;this.j=this.m.getNetworkEngine();this.a=new _.Vt;this.h=null;this.f=!0;El(this)}release(){this.a.release();Fl(this);this.m=null}};_.ju=class{constructor(){this.a=[]}destroy(){const a=[];for(const b of this.a)b.V.catch(()=>{}),a.push(b.abort());this.a=[];return Promise.all(a)}};_.Kl.prototype.resolve=function(){};_.Kl.prototype.reject=function(){};var ku;_.um=class{constructor(a,b){{var c=[a];let f=Ll(...c);if(!f||f.protocol.includes("."))c=b?[a,b]:[a,location.href],c=(f=Ll(...c))?c:null}if(!c)throw new _.I(_.D,1,1011,{message:"The provided URL is invalid.",url:a,base:b});const [d,e]=c;this.a=new URL(d,e);this.f=a.startsWith("//")}toString(){const a=this.a.toString();return this.f?a.replace(ku,""):a}};ku=/^[A-Za-z]+:/;var Ol=class{constructor(){this.a=Ml()}};var am=class{constructor(a){this.a=new Uint8Array(a||65536);this.f=0;this.h=new Ol}};var lu=class{constructor(a,b){b=void 0===b?2:b;this.a=new Uint8Array(a);this.h=b;this.f=0}};var $l=class{constructor(a,b){a=void 0===a?1E6:a;b=void 0===b?!0:b;this.j=new lu(a);this.length=a;this.A=b;this.f=this.a=this.h=0;this.l=null;this.o=-1;this.w=new Ol}};var mu=class{};_.x("clpp.utils.Uint8ArrayUtils",mu);mu.toStandardBase64=_.cm;mu.concat=_.im;mu.equal=_.hm;mu.toHex=_.gm;mu.fromHex=_.fm;mu.fromBase64=_.em;mu.toBase64Url=_.dm;_.Rs=class{constructor(a,b){this.V=a;this.B=b;this.a=!1}abort(){this.a=!0;return this.B()}};var qm=class extends _.Rs{constructor(a,b){super(new _.Kl,()=>Promise.resolve());this.C=a;this.h=null;this.w=this.V;this.f=-1;this.j=this.l=this.o=null;this.A=b||null;nm(this)}then(a,b){this.V=this.V.then(a,b);return this}catch(a){this.V=this.V.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(()=>{})}};_.Hn=class{constructor(){this.h=[];this.f=[];this.j=[];this.w=!1;this.o=new _.ju;this.a={};this.headers=new Map;this.l=0;this.A=null;this.a.data=km;!window.fetch||!window.AbortController||_.Ti(6)||_.Wi()&&68<_.pj().browserVersion.major?(this.a.http=bm,this.a.https=bm):(this.a.http=Zl,this.a.https=Zl)}ej(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.h=[];this.f=[];this.j=[];return this.o.destroy()}Ue(a){this.h.push(a)}Sc(a){this.j.push(a)}Cf(a){this.h=
396
+ this.h.filter(b=>b!==a)}Xd(a){this.j=this.j.filter(b=>b!==a)}fetch(a){let b=void 0;1===a.type&&(b={objectType:nu});return _.tm(this,a,b)}};_.x("clpp.net.NetworkEngine",_.Hn);_.Hn.prototype.fetch=_.Hn.prototype.fetch;_.Hn.prototype.removeResponseModifier=_.Hn.prototype.Xd;_.Hn.prototype.removeRequestModifier=_.Hn.prototype.Cf;_.Hn.prototype.addResponseModifier=_.Hn.prototype.Sc;_.Hn.prototype.addRequestModifier=_.Hn.prototype.Ue;_.Hn.prototype.setRateLimit=_.Hn.prototype.ej;var vm=[];var ym=!!(performance&&performance.mark&&performance.measure),Am=new _.T("clpp.perf");_.x("clpp.version",_.ea);_.x("clpp.name",_.ra);var Gn=null;_.x("clpp.configure",a=>{Gn=a});_.xl="application/x-mpegurl";_.x("clpp.Type",{DASH:_.vc,HLS:_.xl,SMOOTH_STREAMING:_.Cc,MP4:_.Ag,MP3:"audio/mp3"});_.x("clpp.TimelineCueType",{SCTE35:_.Hf,DASH_CALLBACK:_.Ge,HLS_DATERANGE:_.de,UNKNOWN:_.mg});_.x("clpp.SpeedUpMode",{DECODER:_.Cd,SEEK:"seek"});_.x("clpp.CodecSwitchingStrategy",{PREVENT:_.sf,SMOOTH:_.Of});var Dm=new Map,Cm=1,Km=2,Gm=3,Fm=4;_.lp=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;
397
+ _.yi(this.path,"/")||(this.path="/"+this.path);this.f=b.search;this.h=b.hash}};_.x("clpp.utils.url.queryString",_.Rm);var Vm;_.K=_.Zf;_.ou=1/15;Vm={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/]};Vm[_.K]=[/^vtt$/,/^wvtt/,/^stpp/];var nu="m";var pu=class{};_.x("clpp.utils.PlayerConfiguration",pu);pu.create=function(...a){return _.en(a,{Yi:!1})};pu.build=_.en;_.x("clpp.utils.media.detectType",gn);var kn=new _.T("clpp.sources");_.x("clpp.drm.WidevineRobustnessLevel",{SW_SECURE_CRYPTO:_.ob,SW_SECURE_DECODE:_.pb,HW_SECURE_CRYPTO:Ha,HW_SECURE_DECODE:Ia,HW_SECURE_ALL:Ga});_.x("clpp.drm.PlayreadyRobustnessLevel",{SL150:"150",SL2000:"2000",SL3000:"3000"});_.x("clpp.drm.KeySystem",{NONE:_.He,CLEAR_KEY:_.Re,WIDEVINE:_.wd,PLAYREADY:_.ud,FAIRPLAY:_.sd,PRIMETIME:_.rd});_.mn={};_.x("clpp.drm.registerDrmEnvironment",_.nn);var sn=class{constructor(a,b,c){this.h=a;this.f=b;JSON.parse(_.ri(_.em(a)));this.a=JSON.parse(_.ri(_.em(b)));this.j=c}};var qn={n:"vXdoJIQCz6sZ9pbduNukEHOR0H2dHlwuuBUAR5Ot7WLEYvav5mn63yxr6F6TIl8RHTFw2siXQhHblZH2Y89o8vhcZRFkYXo6h0igEVafu-n0w52UEcH8Cqzlb8Q7x03Qb8OcKLngSzDkwe5Y2Aix6I66RRVNLLssqyjp2n5tXs4JQmYdqY6hhpGhmBN84naeCTdcPpAYhCw8jqbTSNrJp5hjU4GVvOiUtoYCvdESV9xrOR7fPCFXhWfLtC3i1k1zVoIM7YW5qD0F676jhqkF-GmDuCHpRY2I2Cxui-ytYEVIM6_pylSIlmYLjARmv2jXz9aV_WvHLh6B8Yx0slNGCQ",e:"AQAB"},$m="eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ1cmxzIjpbIjovL2Nhc3RsYWJzLmNvbSJdLCJ0eXBlIjoiV2ViIiwia2lkIjoxOTUwLCJpbHYiOmZhbHNlfQ.jzGGRcbFr_2QET-4tbMcpR5pSaj7eV7X2d1HWw_VKQpPg3zCwSZSDuqw225dIYyAYwLSiElbozbZPSArkBXOsoUm-KZRUPF4m7WG0T7Uza5G-QaQw57BbbfcSsooSpatC997kHKLMTjO71By9Olcu5ykN164nZpGQtZNzQjYag-bnUaMVI5vvhzjlvDihORQ9V_qRlEh0-mpoz6W0-36HGAbWIXWq0kxPh6inbovby-ZmFpqGrVjWOEFa55EARZXPNW9ERupW5xrrYHZdwwTpdRTY5IwEnobS85yTrLhK8Y2MV4jlQLTtQp372fKDsuU6q6_4XvmNq1SgAoKoaf41g";var Xn=class{constructor(a){this.f=a;this.a=null;this.g=new _.T("clpp.utils.LicenseKey")}},Fn="vod",En="live";var Jn=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",
395
398
  "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",
396
399
  "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",
397
400
  "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",
398
401
  "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",
399
- "vi"],["vol","vo"],["wel","cy"],["wln","wa"],["wol","wo"],["xho","xh"],["yid","yi"],["yor","yo"],["zha","za"],["zho","zh"],["zul","zu"]]);var no,Jn,Mn,Kn;no=class{constructor(a){this.m=a;this.f=a.getNetworkEngine();this.h=Nn(this);this.f.md(this.h);this.a=null}release(){this.a=null;this.f.ze(this.h)}};_.gu="maxSuggestedBitrateKbps";Jn={du:"duress",etp:_.Yd,mb:_.gu,rd:"responseDelay",rtt:"roundTripTime"};Mn={at:"availabilityTime",br:"encodedBitrateKbps",ht:"heldTime",n:"intermediaryIdentifier",nor:"nextObjectResponse",nrr:"nextRangeResponse",d:"objectDuration",ot:"objectType",su:"startup",st:"streamType",sf:"streamingFormat",v:vg};
400
- Kn=new _.T("clpp.net.CmsdManager");var S=class extends _.Ot{constructor(a,b,c){super();sm();this.g=new _.T("clpp.Player");this.g.info("SDK version: 6.31.1");if(!a)throw new _.I(_.D,7,7102);this.$=new _.Lt;this.f=this.C=b||_.Zm();this.l=null;void 0===this.f.license&&(this.f.license=Wm,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 _.I(_.D,7,7101,"No license provided in configuration!");this.j=
401
- new rj(a,c);this.F=this.A=this.a=this.H=null;this.I=new _.Dn;this.h=null;this.W=[];this.X=!0;this.K={};this.da=null;this.R=!0;this.S=this.N=!1;this.L=this.Qc=null;this.Ve=!1;this.ia=new Zt(this);this.B=null;this.on(_.Qf,()=>{this.getState()===_.qs&&(this.a?this.a.unload():Promise.resolve())});this.on(_.rc,()=>{this.Ve=!0});this.on(_.qc,()=>{this.Ve=!1});this.on(_.eg,()=>Sn(this));Un(this,this.f.license);this.j.getMedia()&&(a=this.j.getMedia(),a.hasAttribute("autoplay")&&(a.removeAttribute("autoplay"),
402
- this.g.debug("Removed autoplay attribute from video element. Auto play will be handled by configuration."),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 On)try{const e=d.create(this.f);e&&a.push(e)}catch(e){this.g.error("Error while creating player plugin",e)}Wn(this,a);this.M=_.na;Ph(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,
403
- b)}onError(a){if(null!==this.a)this.a.onError(a);else a=new _.H(_.Xd,{detail:a}),this.trigger(a)}wd(a){a=this.K[a];void 0===a&&(a=null);return a}getSurface(){return this.j}getConfiguration(){return _.dh(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=Zn(this);return this.l.finally(()=>{$n(this);this.g.debug("Player released");
404
- this.l=null})}destroy(){if(this.N)return this.g.debug("The player is already destroyed. No-op"),new Promise(a=>a());this.N=!0;return this.release().then(()=>{this.g.debug(za);this.trigger(new _.H("destroying"));return _.Vn(this,_.Le)}).then(()=>{this.a&&this.a.stopForwardingEventsTo(this);this.ud.clear();this.ia.release();if(this.a)return this.a.destroy()}).then(()=>this.I.destroy()).then(()=>{Sh(this);this.A=this.a=null;this.trigger(new _.H("destroyed"))})}load(a){const b=this;return _.w(function*(){try{_.vm(df);
405
- b.M=_.na;b.X=!0;const c=_.en(a),d=bn(a)?a:{};if(d.license)throw new _.I(_.D,7,7100,"License cannot be passed into the load method.");yield _.io(b,d,c);yield _.jo(b);yield _.lo(b);_.vm(cf);_.xm("player.load",df,cf)}catch(c){$n(b);if(b.l)throw b.g.info(Ma),new _.I(_.D,7,7E3);throw c;}})}preload(a){const b=this;return _.w(function*(){yield _.io(b,a);if(b.a){var c=b.a;c.preload?yield c.preload(b.f):b.g.warn(kb)}else b.g.warn(gb)})}use(a){(a=Th(a))&&a.playerConstructed(this)}remove(a){return(this.getState()<=
406
- _.xs||this.R)&&null!==Nh(a)?(Uh(a),this.S=!0):!1}play(){return this.a?this.h&&!this.h.j()?Promise.resolve():this.a.play():Promise.reject("No player initialized. You need to load content before calling play.")}pause(){return this.a?this.h&&this.h.o()?(this.h.hb(),Promise.resolve()):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 _.It}getState(){return this.a?
407
- this.a.getState():_.xs}getPeriods(){return this.a?this.a.getPeriods():[]}isEnded(){return this.a&&this.a.isEnded()||!1}isPaused(){return this.h&&this.h.o()?this.h.isPaused():this.a?this.a.isPaused():!1}getPosition(){return this.a?this.a.getPosition():0}seek(a){return this.getState()===_.qs?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?
408
- this.a.getSeekRange():{start:0,end:0}}yc(){const a=this.a;return a&&a.yc?a.yc():null}getVolume(){return this.a?this.a.getVolume():null}setVolume(a){this.h&&this.h.h(a);this.a&&this.a.setVolume(a)}getDuration(){return this.a?this.a.getDuration():-1}getAdsManager(){return this.h}namespace(){return this.a&&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.h&&
409
- this.h.setMuted(a);this.a&&this.a.setMuted(a)}getNetworkEngine(){return this.I}setNetworkEngine(a){this.I=a}getTextDisplayer(){return this.a&&this.a.getTextDisplayer()}isLive(){return!!this.a&&this.a.isLive()}getStats(){return this.a?this.a.getStats():null}rg(){return Object.freeze(this.da)}getLoadedSource(){return this.a&&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.Qc=
410
- a;fo(this)}setCdnErrorCallback(a){this.L=a;this.a&&this.a.setCdnErrorCallback(this.L)}};_.x("clpp.Player",S);S.registerPlugin=_.Pn;S.prototype.setCdnErrorCallback=S.prototype.setCdnErrorCallback;S.prototype.setDrmCustomDataModifier=S.prototype.setDrmCustomDataModifier;S.prototype.resetAbr=S.prototype.resetAbr;S.prototype.getTimelineCues=S.prototype.getTimelineCues;S.prototype.getLoadedSource=S.prototype.getLoadedSource;S.prototype.getSources=S.prototype.rg;S.prototype.getStats=S.prototype.getStats;
411
- S.prototype.isLive=S.prototype.isLive;S.prototype.getTextDisplayer=S.prototype.getTextDisplayer;S.prototype.setNetworkEngine=S.prototype.setNetworkEngine;S.prototype.getNetworkEngine=S.prototype.getNetworkEngine;S.prototype.setMuted=S.prototype.setMuted;S.prototype.isMuted=S.prototype.isMuted;S.prototype.setPlaybackRate=S.prototype.setPlaybackRate;S.prototype.getPlaybackRate=S.prototype.getPlaybackRate;S.prototype.namespace=S.prototype.namespace;S.prototype.getAdsManager=S.prototype.getAdsManager;
412
- S.prototype.getDuration=S.prototype.getDuration;S.prototype.setVolume=S.prototype.setVolume;S.prototype.getVolume=S.prototype.getVolume;S.prototype.getTimelineOffset=S.prototype.yc;S.prototype.getSeekRange=S.prototype.getSeekRange;S.prototype.getPresentationStartTime=S.prototype.getPresentationStartTime;S.prototype.seek=S.prototype.seek;S.prototype.getPosition=S.prototype.getPosition;S.prototype.isPaused=S.prototype.isPaused;S.prototype.isEnded=S.prototype.isEnded;S.prototype.getState=S.prototype.getState;
413
- S.prototype.getBufferInfo=S.prototype.getBufferInfo;S.prototype.getTrackManager=S.prototype.getTrackManager;S.prototype.pause=S.prototype.pause;S.prototype.play=S.prototype.play;S.prototype.remove=S.prototype.remove;S.prototype.use=S.prototype.use;S.prototype.load=S.prototype.load;S.prototype.destroy=S.prototype.destroy;S.prototype.release=S.prototype.release;S.prototype.getDrmInfo=S.prototype.getDrmInfo;S.prototype.getConfiguration=S.prototype.getConfiguration;S.prototype.getSurface=S.prototype.getSurface;
414
- S.prototype.getPlugin=S.prototype.wd;S.prototype.off=S.prototype.off;S.prototype.one=S.prototype.one;S.prototype.on=S.prototype.on;_.xs=0;_.qs=6;_.ws={IDLE:_.xs,PREPARING:1,BUFFERING:2,PLAYING:3,PAUSED:4,ENDED:5,ERROR:_.qs,UNSET:7};S.State=_.ws;var On=[];var hu=class{constructor(){this.Ec=null;this.f=[];this.h=[];this.Xa=new _.T(gd);this.a=null;this.j=!1}load(a){const b=this;return _.w(function*(){b.Ec?yield ro(b,c=>_.w(function*(){yield c.load(a)})):b.Xa.warn("No main player, cannot load.")})}Ri(a){this.j=a;this.Xa.info("Looping set to",a)}qh(a){this.f.push(a)}ph(a){if(this.Ec)this.Xa.warn("Main player already set.");else{this.Ec=a;var b=this.o.bind(this),c=this.w.bind(this),d=this.l.bind(this);a.on(_.Qf,b);a.on(_.fg,c);a.on(_.Wd,d);this.h.push(()=>
415
- {a.off(_.Qf,b);a.off(_.fg,c);a.on(_.Wd,d)})}}clear(){this.Ec=null;this.f=[];this.h.forEach(a=>a());this.h=[]}l(){const a=this;return _.w(function*(){a.j&&(a.Xa.info("Looping playback."),yield ro(a,b=>_.w(function*(){yield b.seek(0);yield b.play()})))})}o(a){this.a||(a=a.detail.currentState,3===a?(this.Xa.info("Mirroring playing."),so(this,b=>_.w(function*(){yield b.play()}))):[4,2,_.qs].includes(a)&&(this.Xa.info("Mirroring paused/buffering/error."),so(this,b=>{const c=this;return _.w(function*(){var d=
416
- Math.round(c.Ec.getPosition())-.1;yield b.seek(d);yield Ii(.2);d=b.getState();if(3===d||2===d)yield b.pause()})})))}w(){this.a||so(this,a=>{const b=this;return _.w(function*(){a.isPaused()&&(yield a.play());const c=b.Ec.getPosition();var d=a.getPosition();d=c-d;const e=Math.abs(d),f=a.getPlaybackRate();if(!(3!==a.getState()||.05>=e)){var g=Math.abs(d);g=Math.min(Math.max(1+(.05>=g?0:g/(1>g?6:3))*Math.sign(d),.2),5);5<=e?(a.setPlaybackRate(1),yield a.seek(c)):f===g?1!==g&&b.Xa.info(`Delta ${d.toFixed(1)} s.`):
417
- (1===g?b.Xa.info("Secondary caught up."):1>g?b.Xa.info("Secondary slowing down to catch up. "+`Rate: ${g.toFixed(1)}, delta: ${d.toFixed(1)} s`):1<g&&b.Xa.info("Secondary speeding up to catch up. "+`Rate: ${g.toFixed(1)}, delta: ${d.toFixed(1)} s`),a.setPlaybackRate(g))}})})}};_.x(gd,hu);hu.prototype.clear=hu.prototype.clear;hu.prototype.addMainPlayer=hu.prototype.ph;hu.prototype.addSecondaryPlayer=hu.prototype.qh;hu.prototype.setLoop=hu.prototype.Ri;hu.prototype.load=hu.prototype.load;var iu=class{constructor(a){this.m=a;this.l=a.getConfiguration().streaming.addMissingTimelineCues||!1;this.j=new _.Lt;this.f=new Set;this.a=new Set;this.h=null;this.g=new _.T("clpp.native.Metadata")}release(){this.j.release();this.a=new Set;this.f.clear();null!=this.h&&(clearInterval(this.h),this.h=null)}destroy(){const a=this;return _.w(function*(){a.release()})}getTimelineCues(){return Array.from(this.a.values()).sort((a,b)=>a.startTime-b.startTime)}};_.pu=class{constructor(a,b,c,d){d=void 0===d?_.ju:d;this.startTime=a;this.endTime=b;this.payload=c;this.payloadType=d;this.positionAlign=this.position=null;this.size=100;this.textAlign=_.ku;this.writingMode=_.lu;this.lineInterpretation=_.mu;this.line=null;this.lineAlign=_.nu;this.direction=ou;this.region=null;this.cssClassList=[];this.id=this.backgroundImage="";this.containerRows=null}Rc(a){return this.payload===a.payload&&this.startTime===a.startTime&&this.endTime===a.endTime&&this.payloadType===
418
- a.payloadType}};_.x("clpp.text.Cue",_.pu);_.pu.positionAlign={LEFT:_.me,RIGHT:_.ne,CENTER:_.Xc,AUTO:"auto"};_.ju=_.Yf;_.pu.payloadType={TEXT:_.ju,VTT_XML:_.Eg,TTML_XML:_.ig};_.ku=_.Xc;_.qu={LEFT:_.je,RIGHT:_.Bf,CENTER:_.ku,START:_.Pf,END:_.Vd};_.pu.textAlign=_.qu;var ou="ltr";_.pu.direction={HORIZONTAL_LEFT_TO_RIGHT:ou,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};_.lu="horizontal-tb";_.pu.writingMode={HORIZONTAL_TOP_TO_BOTTOM:_.lu,VERTICAL_LEFT_TO_RIGHT:_.wg,VERTICAL_RIGHT_TO_LEFT:_.xg};_.mu=0;
419
- _.pu.lineInterpretation={LINE_NUMBER:_.mu,PERCENTAGE:1};_.nu=_.Pf;_.ru={CENTER:_.Xc,START:_.nu,END:_.Vd};_.pu.lineAlign=_.ru;_.uu=class{constructor(){this.id="";this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0;this.height=this.width=100;this.viewportAnchorUnits=this.widthUnits=this.heightUnits=_.su;this.scroll=tu;this.cssClassList=[];this.writingMode=this.displayAlign=null}};_.x("clpp.text.CueRegion",_.uu);_.su=1;_.uu.units={PX:0,PERCENTAGE:_.su,LINES:2};var tu="";
420
- _.uu.scrollMode={NONE:tu,UP:"up"};_.uu.displayAlign={BEFORE:"flex-end",CENTER:_.Xc,AFTER:"flex-start"};_.uu.writingMode={HORIZONTAL_TOP_TO_BOTTOM:_.qd,VERTICAL_LEFT_TO_RIGHT:"row-reverse",VERTICAL_RIGHT_TO_LEFT:"row"};var vu=class{constructor(a){this.m=a;this.l=a.getTextDisplayer();this.f=this.h=null;this.a=new _.Lt;this.j=!1;this.g=new _.T("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,_.oc,b=>Ko(this,b)),this.a.on(this.f,Zc,()=>{{const b=this.f;for(let c=0;c<b.length;c++){const d=b[c];d.mode===_.Jf&&(d.mode=
421
- _.ce)}}}))}o(a){const b=new _.pu(a.startTime,a.endTime,a.text,_.Eg);if(_.jh(a.vertical))switch(a.vertical){case "lr":b.writingMode=_.wg;break;case "rl":b.writingMode=_.xg}_.kh(a.size)&&(b.size=a.size);if(_.jh(a.align))switch(a.align){case _.je:case _.Pf:b.textAlign=_.Pf;break;case _.Xc:b.textAlign=_.ku;break;case _.Bf:case _.Vd:b.textAlign=_.Vd}_.kh(a.position)&&(b.position=a.position);if(_.jh(a.positionAlign))switch(a.positionAlign){case _.me:b.positionAlign=_.me;break;case _.Xc:b.positionAlign=
422
- _.Xc;break;case _.ne:b.positionAlign=_.ne}_.kh(a.line)&&(b.line=a.line);if(_.jh(a.lineAlign))switch(a.lineAlign){case _.Pf:b.lineAlign=_.nu;break;case _.Xc:b.lineAlign=_.Xc;break;case _.Vd:b.lineAlign=_.Vd}typeof a.snapToLines===_.Nc&&(b.lineInterpretation=a.snapToLines?_.mu:1);return b}};var wu;wu={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av0?1/],text:[/^vtt$/,/^wvtt/,/^stpp/]};_.Er=(a,b)=>{const c=wu[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===_.K?"":null};_.xu={text:{mp4:_.yc,m4s:_.yc,m4i:_.yc,cmft:_.yc,vtt:_.Zf,ttml:_.Bc},video:{mp4:_.zg,m4s:_.zg,m4f:_.zg,m4i:_.zg,m4v:_.zg,cmfv:_.zg,ts:_.yg},audio:{mp4:_.Hc,m4s:_.Hc,m4f:_.Hc,m4i:_.Hc,m4a:_.Hc,cmfa:_.Hc,ts:_.yg,aac:_.Ec,ec3:_.Gc,ac3:_.Fc},image:{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"}};_.Hr=(a,b,c)=>a.map(d=>{d=_.Qm(d)||"";return d=(d=_.xu[b][d])?d:b===_.K?c&&"vtt"!==c?_.yc:_.Zf:null}).filter(Boolean)[0]||null;_.mr=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}hasAttribute(a){return null!=this.getAttribute(a)}};
423
- _.lr=class{constructor(a,b){this.name=a;this.value=b}};var yu=class{constructor(){this.a=this.f=null;this.g=new _.T("clpp.drm.csl")}release(){this.a=this.f=null}};var No={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,
402
+ "vi"],["vol","vo"],["wel","cy"],["wln","wa"],["wol","wo"],["xho","xh"],["yid","yi"],["yor","yo"],["zha","za"],["zho","zh"],["zul","zu"]]);var ro,Nn,Qn,On;ro=class{constructor(a){this.m=a;this.f=a.getNetworkEngine();this.h=Rn(this);this.f.Sc(this.h);this.a=null}release(){this.a=null;this.f.Xd(this.h)}};_.qu="maxSuggestedBitrateKbps";Nn={du:"duress",etp:_.Yd,mb:_.qu,rd:"responseDelay",rtt:"roundTripTime"};Qn={at:"availabilityTime",br:"encodedBitrateKbps",ht:"heldTime",n:"intermediaryIdentifier",nor:"nextObjectResponse",nrr:"nextRangeResponse",d:"objectDuration",ot:"objectType",su:"startup",st:"streamType",sf:"streamingFormat",v:wg};
403
+ On=new _.T("clpp.net.CmsdManager");var S=class extends _.Yt{constructor(a,b,c){super();wm();this.g=new _.T("clpp.Player");this.g.info("SDK version: 6.32.0-beta.2");if(!a)throw new _.I(_.D,7,7102);this.ca=new _.Vt;this.f=this.C=b||_.cn();this.l=null;void 0===this.f.license&&(this.f.license=$m,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 _.I(_.D,7,7101,"No license provided in configuration!");
404
+ this.j=new vj(a,c);this.F=this.A=this.a=this.H=null;this.I=new _.Hn;this.h=null;this.W=[];this.X=!0;this.K={};this.da=null;this.R=!0;this.S=this.P=!1;this.L=this.Yc=null;this.gf=!1;this.ia=new iu(this);this.B=null;this.on(_.Rf,()=>{this.getState()===_.As&&(this.a?this.a.unload():Promise.resolve())});this.on(_.sc,()=>{this.gf=!0});this.on(_.rc,()=>{this.gf=!1});this.on(_.fg,()=>Wn(this));Yn(this,this.f.license);this.j.getMedia()&&(a=this.j.getMedia(),a.hasAttribute("autoplay")&&(a.removeAttribute("autoplay"),
405
+ this.g.debug("Removed autoplay attribute from video element. Auto play will be handled by configuration."),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 Sn)try{const e=d.create(this.f);e&&a.push(e)}catch(e){this.g.error("Error while creating player plugin",e)}$n(this,a);this.M=_.na;Uh(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,
406
+ b)}onError(a){if(null!==this.a)this.a.onError(a);else a=new _.H(_.Xd,{detail:a}),this.trigger(a)}Gd(a){a=this.K[a];void 0===a&&(a=null);return a}getSurface(){return this.j}getConfiguration(){return _.ih(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=co(this);return this.l.finally(()=>{eo(this);this.g.debug("Player released");
407
+ this.l=null})}stop(){return this.release()}destroy(){if(this.P)return this.g.debug("The player is already destroyed. No-op"),new Promise(a=>a());this.P=!0;return this.release().then(()=>{this.g.debug(za);this.trigger(new _.H("destroying"));return _.Zn(this,_.Me)}).then(()=>{this.a&&this.a.stopForwardingEventsTo(this);this.Ed.clear();this.ia.release();if(this.a)return this.a.destroy()}).then(()=>this.I.destroy()).then(()=>{this.A=this.a=null;this.trigger(new _.H("destroyed"))})}open(a){const b=this;
408
+ return _.w(function*(){try{_.zm(ef);b.M=_.na;b.X=!0;const c=_.jn(a),d=fn(a)?a:{};if(d.license)throw new _.I(_.D,7,7100,"License cannot be passed into the open method.");yield _.mo(b,d,c);yield _.no(b);yield _.po(b);_.zm(df);_.Bm("player.open",ef,df)}catch(c){eo(b);if(b.l)throw b.g.info(Na),new _.I(_.D,7,7E3);throw c;}})}load(a){return this.open(a)}preload(a){const b=this;return _.w(function*(){yield _.mo(b,a);if(b.a){var c=b.a;c.preload?yield c.preload(b.f):b.g.warn(jb)}else b.g.warn(gb)})}use(a){(a=
409
+ Xh(a))&&a.playerConstructed(this)}remove(a){return(this.getState()<=_.Hs||this.R)&&null!==Sh(a)?(Yh(a),this.S=!0):!1}play(){return this.a?this.h&&!this.h.j()?Promise.resolve():this.a.play():Promise.reject("No player initialized. You need to load content before calling play.")}pause(){return this.a?this.h&&this.h.qb()?(this.h.jb(),Promise.resolve()):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?
410
+ this.a.getBufferInfo(a):new _.St}getState(){return this.a?this.a.getState():_.Hs}getPeriods(){return this.a?this.a.getPeriods():[]}isEnded(){return this.a&&this.a.isEnded()||!1}isPaused(){return this.h&&this.h.qb()?this.h.isPaused():this.a?this.a.isPaused():!1}getPosition(){return this.a?this.a.getPosition():0}setPosition(a){return this.getState()===_.As?Promise.reject("Cannot seek in current state."):this.a?this.a.seek(a):Promise.reject("delegate does not exist")}seek(a){return this.setPosition(a)}getPresentationStartTime(){return this.a?
411
+ this.a.getPresentationStartTime():null}getSeekRange(){return this.a?this.a.getSeekRange():{start:0,end:0}}Gc(){const a=this.a;return a&&a.Gc?a.Gc():null}getVolume(){return this.a?this.a.getVolume():null}setVolume(a){this.h&&this.h.h(a);this.a&&this.a.setVolume(a)}getDuration(){return this.a?this.a.getDuration():-1}getAdsManager(){return this.h}namespace(){return this.a&&this.a.namespace()||"Undefined"}qb(){return this.h?this.h.qb():!1}nc(){return this.a?this.a.getPlaybackRate():1}getPlaybackRate(){return this.nc()}ud(a,
412
+ b){this.a&&this.a.setPlaybackRate(a,b)}setPlaybackRate(a,b){this.ud(a,b)}isMuted(){return this.a?!!this.a.isMuted():!1}setMuted(a){this.h&&this.h.setMuted(a);this.a&&this.a.setMuted(a)}getNetworkEngine(){return this.I}setNetworkEngine(a){this.I=a}getTextDisplayer(){return this.a&&this.a.getTextDisplayer()}isLive(){return!!this.a&&this.a.isLive()}getStats(){return this.a?this.a.getStats():null}Cg(){return Object.freeze(this.da)}Sa(){return this.a&&this.a.getLoadedSource()}getLoadedSource(){return this.Sa()}getTimelineCues(){return this.a?
413
+ this.a.getTimelineCues():[]}getCueTimeline(){return this.a?this.a.getCueTimeline():null}resetAbr(){this.a&&this.a.resetAbr()}setDrmCustomDataModifier(a){this.Yc=a;jo(this)}setCdnErrorCallback(a){this.L=a;this.a&&this.a.setCdnErrorCallback(this.L)}};_.x("clpp.Player",S);S.registerPlugin=_.Tn;S.prototype.setCdnErrorCallback=S.prototype.setCdnErrorCallback;S.prototype.setDrmCustomDataModifier=S.prototype.setDrmCustomDataModifier;S.prototype.resetAbr=S.prototype.resetAbr;S.prototype.getTimelineCues=S.prototype.getTimelineCues;
414
+ S.prototype.getLoadedSource=S.prototype.getLoadedSource;S.prototype.getCurrentSource=S.prototype.Sa;S.prototype.getSources=S.prototype.Cg;S.prototype.getStats=S.prototype.getStats;S.prototype.isLive=S.prototype.isLive;S.prototype.getTextDisplayer=S.prototype.getTextDisplayer;S.prototype.setNetworkEngine=S.prototype.setNetworkEngine;S.prototype.getNetworkEngine=S.prototype.getNetworkEngine;S.prototype.setMuted=S.prototype.setMuted;S.prototype.isMuted=S.prototype.isMuted;
415
+ S.prototype.setPlaybackRate=S.prototype.setPlaybackRate;S.prototype.setRate=S.prototype.ud;S.prototype.getPlaybackRate=S.prototype.getPlaybackRate;S.prototype.getRate=S.prototype.nc;S.prototype.isPlayingAd=S.prototype.qb;S.prototype.namespace=S.prototype.namespace;S.prototype.getAdsManager=S.prototype.getAdsManager;S.prototype.getDuration=S.prototype.getDuration;S.prototype.setVolume=S.prototype.setVolume;S.prototype.getVolume=S.prototype.getVolume;S.prototype.getTimelineOffset=S.prototype.Gc;
416
+ S.prototype.getSeekRange=S.prototype.getSeekRange;S.prototype.getPresentationStartTime=S.prototype.getPresentationStartTime;S.prototype.seek=S.prototype.seek;S.prototype.setPosition=S.prototype.setPosition;S.prototype.getPosition=S.prototype.getPosition;S.prototype.isPaused=S.prototype.isPaused;S.prototype.isEnded=S.prototype.isEnded;S.prototype.getState=S.prototype.getState;S.prototype.getBufferInfo=S.prototype.getBufferInfo;S.prototype.getTrackManager=S.prototype.getTrackManager;
417
+ S.prototype.pause=S.prototype.pause;S.prototype.play=S.prototype.play;S.prototype.remove=S.prototype.remove;S.prototype.use=S.prototype.use;S.prototype.load=S.prototype.load;S.prototype.open=S.prototype.open;S.prototype.destroy=S.prototype.destroy;S.prototype.stop=S.prototype.stop;S.prototype.release=S.prototype.release;S.prototype.getDrmInfo=S.prototype.getDrmInfo;S.prototype.getConfiguration=S.prototype.getConfiguration;S.prototype.getSurface=S.prototype.getSurface;S.prototype.getPlugin=S.prototype.Gd;
418
+ S.prototype.off=S.prototype.off;S.prototype.one=S.prototype.one;S.prototype.on=S.prototype.on;_.Hs=0;_.As=6;_.Gs={IDLE:_.Hs,PREPARING:1,BUFFERING:2,PLAYING:3,PAUSED:4,ENDED:5,ERROR:_.As,UNSET:7};S.State=_.Gs;var Sn=[];var ru=class{constructor(){this.Mc=null;this.f=[];this.h=[];this.Ya=new _.T(gd);this.a=null;this.j=!1}load(a){const b=this;return _.w(function*(){b.Mc?yield vo(b,c=>_.w(function*(){yield c.open(a)})):b.Ya.warn("No main player, cannot load.")})}cj(a){this.j=a;this.Ya.info("Looping set to",a)}Ah(a){this.f.push(a)}zh(a){if(this.Mc)this.Ya.warn("Main player already set.");else{this.Mc=a;var b=this.o.bind(this),c=this.w.bind(this),d=this.l.bind(this);a.on(_.Rf,b);a.on(_.gg,c);a.on(_.Wd,d);this.h.push(()=>
419
+ {a.off(_.Rf,b);a.off(_.gg,c);a.on(_.Wd,d)})}}clear(){this.Mc=null;this.f=[];this.h.forEach(a=>a());this.h=[]}l(){const a=this;return _.w(function*(){a.j&&(a.Ya.info("Looping playback."),yield vo(a,b=>_.w(function*(){yield b.setPosition(0);yield b.play()})))})}o(a){this.a||(a=a.detail.currentState,3===a?(this.Ya.info("Mirroring playing."),wo(this,b=>_.w(function*(){yield b.play()}))):[4,2,_.As].includes(a)&&(this.Ya.info("Mirroring paused/buffering/error."),wo(this,b=>{const c=this;return _.w(function*(){var d=
420
+ Math.round(c.Mc.getPosition())-.1;yield b.setPosition(d);yield Mi(.2);d=b.getState();if(3===d||2===d)yield b.pause()})})))}w(){this.a||wo(this,a=>{const b=this;return _.w(function*(){a.isPaused()&&(yield a.play());const c=b.Mc.getPosition();var d=a.getPosition();d=c-d;const e=Math.abs(d),f=a.nc();if(!(3!==a.getState()||.05>=e)){var g=Math.abs(d);g=Math.min(Math.max(1+(.05>=g?0:g/(1>g?6:3))*Math.sign(d),.2),5);5<=e?(a.ud(1),yield a.setPosition(c)):f===g?1!==g&&b.Ya.info(`Delta ${d.toFixed(1)} s.`):
421
+ (1===g?b.Ya.info("Secondary caught up."):1>g?b.Ya.info("Secondary slowing down to catch up. "+`Rate: ${g.toFixed(1)}, delta: ${d.toFixed(1)} s`):1<g&&b.Ya.info("Secondary speeding up to catch up. "+`Rate: ${g.toFixed(1)}, delta: ${d.toFixed(1)} s`),a.ud(g))}})})}};_.x(gd,ru);ru.prototype.clear=ru.prototype.clear;ru.prototype.addMainPlayer=ru.prototype.zh;ru.prototype.addSecondaryPlayer=ru.prototype.Ah;ru.prototype.setLoop=ru.prototype.cj;ru.prototype.load=ru.prototype.load;var su=class{constructor(a){this.m=a;this.l=a.getConfiguration().streaming.addMissingTimelineCues||!1;this.j=new _.Vt;this.f=new Set;this.a=new Set;this.h=null;this.g=new _.T("clpp.native.Metadata")}release(){this.j.release();this.a=new Set;this.f.clear();null!=this.h&&(clearInterval(this.h),this.h=null)}destroy(){const a=this;return _.w(function*(){a.release()})}getTimelineCues(){return Array.from(this.a.values()).sort((a,b)=>a.startTime-b.startTime)}};_.zu=class{constructor(a,b,c,d){d=void 0===d?_.tu:d;this.startTime=a;this.endTime=b;this.payload=c;this.payloadType=d;this.positionAlign=this.position=null;this.size=100;this.textAlign=_.uu;this.writingMode=_.vu;this.lineInterpretation=_.wu;this.line=null;this.lineAlign=_.xu;this.direction=yu;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===
422
+ a.payloadType}};_.x("clpp.text.Cue",_.zu);_.zu.positionAlign={LEFT:_.ne,RIGHT:_.oe,CENTER:_.Xc,AUTO:"auto"};_.tu=_.Zf;_.zu.payloadType={TEXT:_.tu,VTT_XML:_.Fg,TTML_XML:_.jg};_.uu=_.Xc;_.Au={LEFT:_.ke,RIGHT:_.Cf,CENTER:_.uu,START:_.Qf,END:_.Vd};_.zu.textAlign=_.Au;var yu="ltr";_.zu.direction={HORIZONTAL_LEFT_TO_RIGHT:yu,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};_.vu="horizontal-tb";_.zu.writingMode={HORIZONTAL_TOP_TO_BOTTOM:_.vu,VERTICAL_LEFT_TO_RIGHT:_.xg,VERTICAL_RIGHT_TO_LEFT:_.yg};_.wu=0;
423
+ _.zu.lineInterpretation={LINE_NUMBER:_.wu,PERCENTAGE:1};_.xu=_.Qf;_.Bu={CENTER:_.Xc,START:_.xu,END:_.Vd};_.zu.lineAlign=_.Bu;_.Eu=class{constructor(){this.id="";this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0;this.height=this.width=100;this.viewportAnchorUnits=this.widthUnits=this.heightUnits=_.Cu;this.scroll=Du;this.cssClassList=[];this.writingMode=this.displayAlign=null}};_.x("clpp.text.CueRegion",_.Eu);_.Cu=1;_.Eu.units={PX:0,PERCENTAGE:_.Cu,LINES:2};var Du="";
424
+ _.Eu.scrollMode={NONE:Du,UP:"up"};_.Eu.displayAlign={BEFORE:"flex-end",CENTER:_.Xc,AFTER:"flex-start"};_.Eu.writingMode={HORIZONTAL_TOP_TO_BOTTOM:_.qd,VERTICAL_LEFT_TO_RIGHT:"row-reverse",VERTICAL_RIGHT_TO_LEFT:"row"};var Fu=class{constructor(a){this.m=a;this.l=a.getTextDisplayer();this.f=this.h=null;this.a=new _.Vt;this.j=!1;this.g=new _.T("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,_.pc,b=>Oo(this,b)),this.a.on(this.f,Zc,()=>{{const b=this.f;for(let c=0;c<b.length;c++){const d=b[c];d.mode===_.Kf&&(d.mode=
425
+ _.ce)}}}))}o(a){const b=new _.zu(a.startTime,a.endTime,a.text,_.Fg);if(_.oh(a.vertical))switch(a.vertical){case "lr":b.writingMode=_.xg;break;case "rl":b.writingMode=_.yg}_.ph(a.size)&&(b.size=a.size);if(_.oh(a.align))switch(a.align){case _.ke:case _.Qf:b.textAlign=_.Qf;break;case _.Xc:b.textAlign=_.uu;break;case _.Cf:case _.Vd:b.textAlign=_.Vd}_.ph(a.position)&&(b.position=a.position);if(_.oh(a.positionAlign))switch(a.positionAlign){case _.ne:b.positionAlign=_.ne;break;case _.Xc:b.positionAlign=
426
+ _.Xc;break;case _.oe:b.positionAlign=_.oe}_.ph(a.line)&&(b.line=a.line);if(_.oh(a.lineAlign))switch(a.lineAlign){case _.Qf:b.lineAlign=_.xu;break;case _.Xc:b.lineAlign=_.Xc;break;case _.Vd:b.lineAlign=_.Vd}typeof a.snapToLines===_.Nc&&(b.lineInterpretation=a.snapToLines?_.wu:1);return b}};var Gu;Gu={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av0?1/],text:[/^vtt$/,/^wvtt/,/^stpp/]};_.Or=(a,b)=>{const c=Gu[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===_.K?"":null};_.Hu={text:{mp4:_.wc,m4s:_.wc,m4i:_.wc,cmft:_.wc,vtt:_.$f,ttml:_.Bc},video:{mp4:_.Ag,m4s:_.Ag,m4f:_.Ag,m4i:_.Ag,m4v:_.Ag,cmfv:_.Ag,ts:_.zg},audio:{mp4:_.Hc,m4s:_.Hc,m4f:_.Hc,m4i:_.Hc,m4a:_.Hc,cmfa:_.Hc,ts:_.zg,aac:_.Ec,ec3:_.Gc,ac3:_.Fc},image:{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"}};_.Rr=(a,b,c)=>a.map(d=>{d=_.Um(d)||"";return d=(d=_.Hu[b][d])?d:b===_.K?c&&"vtt"!==c?_.wc:_.$f:null}).filter(Boolean)[0]||null;_.wr=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}hasAttribute(a){return null!=this.getAttribute(a)}};
427
+ _.vr=class{constructor(a,b){this.name=a;this.value=b}};var Iu=class{constructor(){this.h=this.a=this.f=null;this.g=new _.T("clpp.drm.csl")}release(){this.h=this.a=this.f=null}};_.So={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,
424
428
  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,
425
429
  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,
426
430
  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,
@@ -434,101 +438,100 @@ _.lr=class{constructor(a,b){this.name=a;this.value=b}};var yu=class{constructor(
434
438
  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,
435
439
  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,
436
440
  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,
437
- 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]};_.zu=class{constructor(a){this.I=a;this.f={}}ib(a,b){this.f[a]=b}};_.x("clpp.drm.DrmEnvironment",_.zu);_.zu.prototype.setDrmSystem=_.zu.prototype.ib;_.kp=class{constructor(a,b){b=void 0===b?!1:b;this.f=_.kh(a)?new DataView(new ArrayBuffer(a),0,a):a;this.a=0;this.h=b;this.buffer=this.f.buffer}getPosition(){return this.a}Sa(){return this.f.byteLength}seek(a){(0>a||a>=this.f.byteLength)&&_.Qo();this.a=a}};_.aq=class{constructor(a,b){this.f=a;this.h=void 0===b?!0:b;this.a=0}getPosition(){return this.a}Sa(){return this.f.byteLength}skip(a){this.a+a>this.f.byteLength&&_.To();this.a+=a}seek(a){if(0>a||a>=this.f.byteLength)throw _.To();this.a=a}};
438
- _.x("clpp.utils.dataview.DataViewReader",_.aq);_.ip=class{constructor(){this.h=[];this.f=[];this.a=!1;this.g=new _.T("clpp.mp4")}O(a,b){a=$o(a);this.h[a]=Au;this.f[a]=b;return this}fa(a,b){a=$o(a);this.h[a]=Bu;this.f[a]=b;return this}stop(){this.a=!0}parse(a,b){a=_.G(a);a=new _.aq(new DataView(a.buffer,a.byteOffset,a.byteLength),!1);for(this.a=!1;_.So(a)&&!this.a;)this.we(0,a,b)}we(a,b,c){const d=b.getPosition();let e=_.N(b);var f=_.N(b);let g=!1;this.g.debug("Parsing MP4 box",_.ap(f));switch(e){case 0:e=b.Sa()-d;break;case 1:e=_.Xo(b),g=!0}const h=
439
- this.f[f];if(h){let m=null;var k=null;this.h[f]===Bu&&(k=_.N(b),m=k>>>24,k&=16777215);f=b.getPosition()-d;var l=d+e;c&&l>b.Sa()&&(l=b.Sa());l-=b.getPosition();b=0<l?_.Zo(b,l):new Uint8Array(0);b=new _.aq(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.Sa()-b.getPosition()),b.skip(a)}};_.x("clpp.utils.Mp4Parser",_.ip);_.ip.typeToString=_.ap;
440
- _.ip.allData=_.dp;_.ip.sampleDescription=_.cp;_.ip.children=_.bp;_.ip.prototype.parseNext=_.ip.prototype.we;_.ip.prototype.parse=_.ip.prototype.parse;_.ip.prototype.stop=_.ip.prototype.stop;_.ip.prototype.fullBox=_.ip.prototype.fa;_.ip.prototype.box=_.ip.prototype.O;_.ip.headerSize=_.ep;var Au=0,Bu=1;var Cu=class{};_.x("clpp.utils.FairplayUtils",Cu);Cu.parseFairPlayResponse=_.np;Cu.formatFairPlayRequest=_.mp;Cu.createFairplayPayload=lp;Cu.extractContentId=_.hp;Cu.extractExtXKeyUri=fp;var Du=class{};_.x(id,Du);var tp=new _.T(id),Dp="PRODUCTION",Ep="STAGING",Fp="DEMO",Gp="TEST",Eu={PRODUCTION:Dp,STAGING:Ep,DEMO:Fp,TEST:Gp};Du.Environment=Eu;Du.WidevineCertificates={V1_PROD:"V1_PROD",V1_STAGING:"V1_STAGING",V2:"V2"};
441
- var pp="/license-proxy-widevine/cenc/",qp="/license-proxy-headerauth/drmtoday/RightsManager.asmx",rp="/license-server-fairplay/",Hp={"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",
442
- 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"},Fu=[Fa,Ha,Ga,_.pb,_.ob],Gu=[Fa,Ha,
443
- Ga,_.pb,_.ob],Hu=["3000","2000","150"],Iu=["2000","150"];
444
- for(const a of Object.keys(Eu)){let b=wa;a!==Dp&&(b+=`_${a}`);const c=new _.zu(b);let d=null;switch(a){case Dp:case Ep:case Fp:d=_.Oo("V2");break;case Gp:d=null}c.ib(_.wd,{licenseUrl:sp(_.wd,a),videoRobustness:Fu,audioRobustness:Gu,persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:d,modifiers:{licenseRequest:_.vp,licenseResponse:_.wp}});c.ib(_.sd,{licenseUrl:sp(_.sd,a),certificateUrl:op(a)+"/license-server-fairplay/cert/",modifiers:{licenseRequest:_.yp,licenseResponse:_.zp,
445
- extractContentId:_.Ap,certificateRequest:_.Bp}});c.ib(_.ud,{licenseUrl:sp(_.ud,a),videoRobustness:Hu,audioRobustness:Iu,modifiers:{licenseRequest:Cp}});_.jn(c)};_.Ju=class{constructor(a){this.f=a;this.a=void 0}value(){void 0===this.a&&(this.a=this.f());return this.a}};var Lu=class{constructor(){this.size=0;this.a=void 0;this.g=new _.T("clpp.drm.eme.MediaKeyStatusMap")}getStatus(){return this.a}forEach(a){this.a&&a(this.a,Ku.value())}get(a){if(this.has(a))return this.a}has(a){const b=Ku.value();return this.a&&fi(a,b)?!0:!1}entries(){}keys(){}values(){}},Ku=new _.Ju(()=>li(new Uint8Array([0])));var Lp=new _.Ju(()=>new Map([[HTMLMediaElement.HAVE_METADATA,_.re],[HTMLMediaElement.HAVE_CURRENT_DATA,_.qe],[HTMLMediaElement.HAVE_FUTURE_DATA,Qc],[HTMLMediaElement.HAVE_ENOUGH_DATA,Rc]]));var Nu=class{constructor(){this.j=this.w=null}l(a){this.w=a}h(a){const b=this.j;b&&b!==a&&Np(b,null);return(this.j=a)?Np(a,this.w):Promise.resolve()}o(){return this.j}a(a,b){_.xh("AppleEmeManager.requestMediaKeySystemAccess");try{const c=new Mu(a,b);return Promise.resolve(c)}catch(c){return Promise.reject(c)}}f(){return sq}},Mu=class{constructor(a,b){this.keySystem=a;if(a.startsWith(_.sd))for(var c of b){a:{a=c;if(a.persistentState===_.zf){a=null;break a}b={audioCapabilities:[],videoCapabilities:[],
446
- persistentState:_.Pe,distinctiveIdentifier:_.Pe,initDataTypes:a.initDataTypes,sessionTypes:[Xf],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),
447
- e=!0));d||(e=WebKitMediaKeys.isTypeSupported(this.keySystem,_.zg));a=e?b:null}if(a){this.a=a;return}}c=Error(Ab);c.name=bb;c.code=DOMException.NOT_SUPPORTED_ERR;throw c;}createMediaKeys(){const a=new Ou(this.keySystem);return Promise.resolve(a)}getConfiguration(){_.xh("AppleEmeManager.MediaKeySystemAccess.getConfiguration");return this.a}},Ou=class{constructor(a){this.f=null;this.h=new WebKitMediaKeys(a);this.a=new _.Lt;this.j=0;this.g=new _.T(kd);this.g.info("Created Media Keys for "+a)}createSession(a){a=
448
- void 0===a?Xf:a;this.g.debug("Creating Apple MediaKeys Session");if(a!==Xf)throw new TypeError("Session type "+a+ba);return new Pu(this.h,`__session_${this.j++}`)}setServerCertificate(){this.g.debug("AppleEmeManager.MediaKeys.setServerCertificate");return Promise.resolve(!1)}},Pu=class extends _.Ot{constructor(a,b){super();this.a=null;this.o=a;this.f=this.h=null;this.j=new _.Lt;this.sessionId=b;this.expiration=NaN;this.closed=new _.Gl;this.l=!1;this.keyStatuses=new Lu;this.g=new _.T(kd)}generateRequest(a,
449
- b){if(this.l)return Promise.reject(qb);this.g.debug("generateRequest");this.h=new _.Gl;try{const c=this.o.createSession(_.zg,_.G(b));this.a=c;this.sessionId=c.sessionId||this.sessionId||"";this.j.on(c,Kg,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 _.H(_.ze,{messageType:void 0===e||e===Rf?le:ke,message:li(d.message.buffer)});this.dispatchEvent(d)}});this.j.on(c,Ig,d=>{this.g.debug("onWebkitKeyAdded_",
450
- d);this.f&&(Op(this,"usable"),this.f.resolve(),this.f=null)});this.j.on(c,Jg,()=>{var d=this.keyStatuses.getStatus();if(this.a&&this.a&&this.a.error&&this.a.error.code===WebKitMediaKeyError.MEDIA_KEYERR_DOMAIN&&d===Rf)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),
451
- 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:Op(this,"output-not-allowed");break;default:Op(this,_.he)}});Op(this,Rf)}catch(c){this.h.reject(c)}return this.h}load(){this.g.debug(_.pe);return Promise.reject(Error("MediaKeySession.load not yet supported"))}update(a){if(this.l)return Promise.reject(qb);this.g.debug(mg);this.f=new _.Gl;try{this.a.update(_.G(a))}catch(b){this.f.reject(b)}return this.f}close(){if(this.l)return this.closed;
452
- this.g.info(`Closing Key Session ${this.sessionId}`);this.l=!0;try{this.a.close(),this.closed.resolve(),_.Xh(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"))}},Qu=class{a(){return sq}f(){return!!window.WebKitMediaKeys}create(){return new Nu}};var Ru=class{constructor(){this.j=null;this.g=new _.T("clpp.drm.eme.StandardEmeManager")}l(a){this.j=a}h(a){return this.j?this.j.setMediaKeys(a):Promise.reject(Ra)}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 Wq}},
453
- Su=class{a(){return Wq}f(){return!!(window.MediaKeys&&navigator.requestMediaKeySystemAccess&&window.MediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)}create(){return new Ru}};var Vu=class{constructor(){this.w=this.j=null;this.A="";HTMLMediaElement.prototype.webkitGenerateKeyRequest&&(this.A="webkit")}l(a){this.j=a}h(a){_.xh("WebkitEmeManager.setMediaKeys");if(!this.j)return Promise.reject(Ra);const b=this.w;b&&b!==a&&Rp(b,null);(this.w=a)&&Rp(a,this.j);return Promise.resolve()}o(){return this.w}a(a,b){_.xh("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=
454
- new Tu(this.A,c,a,b);return Promise.resolve(e)}catch(e){return Promise.reject(e)}}f(){return Uu}},Tu=class{constructor(a,b,c,d){this.h=a;this.a=this.keySystem=c;a=!1;c===_.Qe&&(this.a=Hg,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,this.a)&&
455
- (f.push(k),e=!0));h||(e=b.canPlayType(_.zg,this.a)||b.canPlayType("video/webm",this.a));g.persistentState!==_.zf||a||(e=!1);if(e){this.f=g;return}}b=Ab;if(c===_.Qe||c===_.wd)b="None of the requested configurations were supported.";c=Error(b);c.name=bb;c.code=DOMException.NOT_SUPPORTED_ERR;throw c;}createMediaKeys(){return Promise.resolve(new Wu(this.h,this.a))}getConfiguration(){return this.f}},Wu=class{constructor(a,b){this.h=a;this.o=b;this.a=null;this.f=new _.Lt;this.j=[];this.l=new Map}createSession(a=
456
- Xf){if(a!==Xf&&a!==_.Ue)throw new TypeError("Session type "+a+ba);if(!this.a)throw a=Error("Media element is missing."),a.name=Ja,a.code=DOMException.INVALID_STATE_ERR,a;this.a.src||(this.a.src="about:blank");a=new Xu(this.h,this.a,this.o,a);this.j.push(a);return a}setServerCertificate(){return Promise.resolve(!1)}},Xu=class extends _.Ot{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 _.Gl;this.keyStatuses=
457
- new Lu}ready(){_.xh("WebkitEmeManager.MediaKeySession.ready");Qp(this,"usable");this.a&&this.a.resolve();this.a=null}generateRequest(a,b){_.xh("WebkitEmeManager.MediaKeySession.generateRequest");return Tp(this,b,null)}load(a){_.xh(Gb);return this.l===_.Ue?Tp(this,null,a):Promise.reject(Error(Za))}update(a){_.xh(Gb);const b=new _.Gl;Up(this,b,a);return b}close(){_.xh("WebkitEmeManager.MediaKeySession.close");if(this.l!==_.Ue){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),
458
- this.closed;const a=Sp(this,"cancelKeyRequest");try{this.j[a](this.h,this.sessionId)}catch(b){}}this.closed.resolve();return this.closed}remove(){_.xh("WebkitEmeManager.MediaKeySession.remove");return this.l!==_.Ue?Promise.reject(Error(Za)):this.close()}},Yu=class{a(){return Uu}f(){return!(!HTMLMediaElement.prototype.webkitGenerateKeyRequest&&!HTMLMediaElement.prototype.generateKeyRequest)}create(){return new Vu}};var $u=class{l(){}h(a){_.xh("NopEmeManager.setMediaKeys");return null===a?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}o(){return null}a(){_.xh("NopEmeManager.requestMediaKeySystemAccess");return Promise.reject(Error("The key system specified is not supported."))}f(){return Zu}},av=class{a(){return Zu}f(){return!0}create(){return new $u}};var bv=class{};_.x(ld,bv);var Wp=new _.T(ld),Vp=[];Vp=[new Su,new Qu,new Yu,new av].filter(a=>a.f());var Wq="STANDARD",sq="APPLE",Uu="WEBKIT",Zu="NOP";bv.Apis={STANDARD:Wq,APPLE:sq,WEBKIT:Uu,NOP:Zu};_.cv=class{h(a,b){a=this.a(a,b);return 1!==a.length?null:a[0]}a(a,b){return Array.from(a.childNodes).filter(c=>c instanceof Element&&c.tagName===b)}getAttributeNS(a,b,c){return a.hasAttributeNS(b,c)?a.getAttributeNS(b,c):null}f(a){return Array.from(a.childNodes).every(b=>b.nodeType===Node.TEXT_NODE||b.nodeType===Node.CDATA_SECTION_NODE)?a.textContent.trim():null}j(a,b){const c=new DOMParser;let d=null;try{d=c.parseFromString(a,_.$f)}catch(e){}if(!d)return null;a=d.documentElement;return b&&a.tagName!==
459
- b||0<d.getElementsByTagName("parsererror").length?null:a}removeChild(a,b){a.removeChild(b)}};_.Sg=_.cv.prototype;_.Sg.Td=_.Ug(19);_.Sg.ye=_.Ug(17);_.Sg.oe=_.Ug(15);_.Sg.pe=_.Ug(13);_.Sg.xe=_.Ug(11);_.Sg.Mc=_.Ug(9);_.Sg.he=_.Ug(7);_.Sg.ba=_.Ug(5);_.Sg.wc=_.Ug(3);_.Sg.Tb=_.Ug(1);_.O=new _.cv;_.dv=new _.T("clpp.xml.Parser");_.Ym="dom";var Zp,ev,Yp;_.gq=[154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149];Zp=[237,239,139,169,121,214,74,206,163,200,39,220,213,29,33,237];ev=class{constructor(a,b,c){this.j=new Uint8Array(a);this.a=b;this.f=c}};Yp=class extends ev{};_.fq=class extends ev{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 Jq=class{constructor(a){this.f=[];this.h=[];this.a=[];8<=a.byteLength&&(new _.ip).fa("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=_.cm(_.Zo(a.reader,16)),c=[];if(0<a.version){var d=_.N(a.reader);for(let e=0;e<d;++e){const f=_.cm(_.Zo(a.reader,16));c.push(f)}}d=_.N(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});
460
- a.reader.getPosition()!==a.reader.Sa()&&_.C("Mismatch between box size and data size!")}}};var Eq,fv;
461
- _.Ds=class{constructor(a,b){this.D=a;this.kb=b;this.J=new Set;this.C=this.I=this.l=null;this.S=!1;this.a=null;this.K=fv;this.B=new _.Lt;this.M=new yu;this.h=new Map;this.L=[];this.H=new _.Gl;this.xa=0;this.f=null;this.w=c=>{this.A=!0;this.F=!1;this.H.reject(c);a.onError(c)};this.o=new Map;this.X=new Map;this.U=new _.Li(()=>vq(this));this.j=!1;this.da=new _.Gl;this.G=!1;this.W=[];this.ia=!1;this.R=0;this.g=new _.T("clpp.drm.DrmEngine");this.$=(new _.Li(()=>{wq(this)})).Fb(1);this.H.catch(()=>{});this.A=
462
- this.F=!1;this.N=null}destroy(){const a=this;return _.w(function*(){a.j?yield a.da:(a.j=!0,yield xq(a),a.da.resolve())})}keySystem(){return this.a?_.kq(this.a.keySystem):""}getDrmInfo(){return this.a}ab(a){const b=this;return _.w(function*(){b.G&&b.K===Eq||(!b.f.delayLicenseRequestUntilPlayed||b.C&&!b.C.paused||b.ia?yield Oq(b,a):b.W.push(a))})}Ma(a){const b=a.target;this.g.info("Key status changed for session",b.sessionId);const c=this.h.get(b);let d=!1;b.keyStatuses.forEach((e,f)=>{if(typeof f===
463
- _.Tf){var g=f;f=e;e=g}if(jq(this.a.keySystem)&&16===f.byteLength&&_.Ni()){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!==Rf&&(c.loaded=!0);c&&c.pb&&c.pb.resolve();"expired"===e&&(d=!0);f=_.G(f);let h=_.cm(f);"00"===h&&c&&c.keyId?h=c.keyId:this.a.keySystem.startsWith(_.sd)&&16!==f.byteLength&&(h=mi(f));(f=h||"")?this.g.info(`Key status for Key ID '${h}': ${e}`):this.g.info(`Key status global keys: ${e}`);
464
- this.o.set(f,e);c&&!c.keyId&&this.h.forEach((k,l)=>{l===b||k.keyId!==h||k.loaded||(k.loaded=!0)})});c&&c.loaded&&c.sb.forEach(e=>{this.o.get(e)===Rf&&(this.g.warn(`Key status for Key ID '${e}': 'output-restricted'`),this.o.set(e,_.Re))});for(a=0;a<this.a.initData.length;a++){const e=this.a.initData[a];e.keyId&&this.o.get(e.keyId)===Rf&&_.dm(e.initData,c.initData)&&(this.g.warn(`Key status for Key ID '${e.keyId}': 'output-restricted'`),this.o.set(e.keyId,_.Re))}a=b.expiration-Date.now();(0>a||d&&1E3>
465
- a)&&c&&!c.nc&&(this.g.debug("Session has expired",b.sessionId),(a=this.h.get(b))&&a.Oc&&a.Oc.stop(),this.h.delete(b),b.close().catch(()=>{}));Yq(this)&&(this.H.resolve(),1!==this.h.size||d?this.U.la(.5):vq(this))}};Eq=0;fv=3;_.gv=new _.T("clpp.hls.Utils");_.kr=class{constructor(a){this.f=a;this.a=0}};var qr;
466
- _.sr=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=[]}Rc(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&&bi(this.roles,
467
- a.roles)&&bi(this.accessibility,a.accessibility,or)}toString(){return`Track type: ${this.type} id: ${this.id}
468
- renditions size: ${this.renditions.length}`}};_.x("clpp.Track",_.sr);_.sr.prototype.toString=_.sr.prototype.toString;_.wr=class{constructor(a,b){this.track=b;this.id=a;this.originalId=this.codec=this.nd=this.bandwidth=this.height=this.width=null;this.a=!1}};_.x("clpp.Rendition",_.wr);_.Lr=1;_.R=_.t;_.Q=_.q;_.P=_.Yf;qr=_.Ae;_.hv={VIDEO:_.R,AUDIO:_.Q,TEXT:_.P,METADATA:qr};_.sr.Type=_.hv;var iv=class{constructor(a){this.f=a;this.g=new _.T("clpp.native.hls.HlsMetadataParser");this.a=Im(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 ur(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 yr(c,d,
469
- 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 Ar(d);e.Gc=f}catch(f){c.g.warn("Failed to parse metadata from HLS playlist.",f.message)}return e})}};_.Ir=[];_.V=class{Ke(){return!0}Nh(a){return this.getVideoTracks().find(b=>_.lh(b,a,a&&Object.keys(a)))}Jh(a){return this.getAudioTracks().find(b=>_.lh(b,a,a&&Object.keys(a)))}Lh(a){return this.sa().find(b=>_.lh(b,a,a&&Object.keys(a)))}Mh(a){return this.getVideoTracks().flatMap(b=>b.renditions).find(b=>_.lh(b,a,a&&Object.keys(a)))}Ih(a){return this.getAudioTracks().flatMap(b=>b.renditions).find(b=>_.lh(b,a,a&&Object.keys(a)))}Kh(a){return this.sa().flatMap(b=>b.renditions).find(b=>_.lh(b,a,a&&Object.keys(a)))}};
470
- _.x("clpp.TrackManager",_.V);_.V.prototype.isAbrEnabled=_.V.prototype.wa;_.V.prototype.addTextTrack=_.V.prototype.addTextTrack;_.V.prototype.findTextRendition=_.V.prototype.Kh;_.V.prototype.findAudioRendition=_.V.prototype.Ih;_.V.prototype.findVideoRendition=_.V.prototype.Mh;_.V.prototype.findTextTrack=_.V.prototype.Lh;_.V.prototype.findAudioTrack=_.V.prototype.Jh;_.V.prototype.findVideoTrack=_.V.prototype.Nh;_.V.prototype.setTextRendition=_.V.prototype.Db;_.V.prototype.setAudioRendition=_.V.prototype.Cb;
471
- _.V.prototype.setVideoRendition=_.V.prototype.qb;_.V.prototype.setTextTrack=_.V.prototype.Za;_.V.prototype.setAudioTrack=_.V.prototype.Aa;_.V.prototype.setVideoTrack=_.V.prototype.Eb;_.V.prototype.getTextTrack=_.V.prototype.va;_.V.prototype.getAudioTrack=_.V.prototype.ra;_.V.prototype.getVideoTrack=_.V.prototype.Ha;_.V.prototype.getLoadingTextRendition=_.V.prototype.Lb;_.V.prototype.getLoadingAudioRendition=_.V.prototype.Kb;_.V.prototype.getLoadingVideoRendition=_.V.prototype.vb;
472
- _.V.prototype.getTextRendition=_.V.prototype.Wa;_.V.prototype.getAudioRendition=_.V.prototype.Qa;_.V.prototype.getVideoRendition=_.V.prototype.ta;_.V.prototype.getTextTracks=_.V.prototype.sa;_.V.prototype.getAudioTracks=_.V.prototype.getAudioTracks;_.V.prototype.getVideoTracks=_.V.prototype.getVideoTracks;_.V.prototype.canSelectVideoTracks=_.V.prototype.Ke;var jv=class extends _.V{constructor(){super();this.g=new _.T("clpp.native.TrackManager");this.m=null;this.f=new _.Lt;this.h=[];this.H=0;this.o={};this.J=[];this.a=new Map;this.w=null;this.l=new Map;this.A=new Map;this.B=!0;this.N=this.C.bind(this,_.P);this.S=this.G.bind(this,_.P);this.R=this.F.bind(this,_.P);this.U=this.C.bind(this,_.R);this.X=this.G.bind(this,_.R);this.W=this.F.bind(this,_.R);this.K=this.C.bind(this,_.Q);this.M=this.G.bind(this,_.Q);this.L=this.F.bind(this,_.Q);this.j=null}Ke(){return!_.Yi()}C(a,
473
- b){const c=this;return _.w(function*(){if(b){var d=b.track;if(d){var e=a===_.Q,f=a===_.R,g=a===_.P,h=e||f,k=Mr(a,d),l=tr(a,k,d);e&&c.A.set(k,d);var m=Nr(d);if(g){if(d.kind===_.Ae)return;let n;void 0!==d.id?n=c.o[d.id]:n=Object.values(c.o).find(p=>Or(c,l,p,a));l.kind&&"captions"===l.kind&&(l.mimeType=_.uc);n&&(l.src=n.url,l.mimeType=n.mimeType)}else if(g=c.h.find(n=>n.type===a&&_.lh(n,l,["kind","label","language"]))){e?c.A.set(g.id,d):g.id=d.id;m&&(c.g.debug(`Setting native ${a} track active`),c.a.set(a,
474
- g));c.g.debug("Track from event seems to already exists, flipped native track to",d);return}try{l.renditions.push(new _.wr(l.id,l));c.h.push(l);const n=c.m.getConfiguration().safari;Qr(c,a,n)?yield Rr(c,l,n):Sr(c,a,n)&&(yield Tr(c,l,n));c.g.debug(a+" Track added",l);c.m.trigger(new _.H(_.gg));const p=Ur(c,a).length,u=b.target,v=!(!u||!u.length),y=u&&u.length||0;e=()=>{c.g.debug(`Setting native ${a} track active. `+`Native track active: ${m}. `+`Number of tracks: ${p}`,d);c.a.set(a,l)};m?e():1===p&&
475
- h&&(f?e():v&&1!==y||e())}catch(n){c.g.error("Error while converting track data",n)}}else c.g.warn(Xa)}else c.g.warn(Ua)})}G(a,b){if(b){var c=b.track;c?a===_.P&&c.kind!==_.Ae&&(b=this.h.find(d=>Or(this,d,c,a)))&&(this.h.splice(this.h.indexOf(b),1),(this.a.get(a)||null)===b&&(this.a.set(a,null),Vr(this)),this.g.debug(a+" Track removed, id: ",b.id)):this.g.warn(Xa)}else this.g.warn(Ua)}F(a,b){this.g.debug(a+" Track changed",b);a===_.P&&Vr(this);const c=Xr(this,a);if(c)for(let d=0;d<c.length;++d)if(Nr(c[d])){if(b=
476
- this.h.find(e=>Or(this,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===_.Q?this.m.trigger(new _.H(_.Kc)):a===_.P&&this.m.trigger(new _.H(_.ag));break}}initialize(a){this.m=a;this.j=new iv(a.getNetworkEngine())}load(){this.B=!1;var a=Wr(this,_.P);a&&(this.f.on(a,_.oc,this.N),this.f.on(a,yf,this.S),this.f.on(a,Zc,this.R));if(a=Wr(this,_.Q))this.f.on(a,_.oc,this.K),this.f.on(a,yf,this.M),this.f.on(a,Zc,this.L);if(a=Wr(this,_.R))this.f.on(a,
477
- _.oc,this.U),this.f.on(a,yf,this.X),this.f.on(a,Zc,this.W);this.f.one(this.m,Rc,this.I.bind(this))}release(){this.B=!0;this.h=[];this.o={};this.a.clear();this.l.clear();this.A.clear();this.f.release()}destroy(){this.release();this.m=null}getVideoTracks(){return Ur(this,_.R)}getAudioTracks(){return Ur(this,_.Q)}sa(){return Ur(this,_.P)}ta(){const a=this.a.get(_.R)||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]||
478
- null}Qa(){return Yr(this,_.Q)}Wa(){return Yr(this,_.P)}vb(){return Zr(this,_.R)}Kb(){return Zr(this,_.Q)}Lb(){return Zr(this,_.P)}Ha(){return this.a.get(_.R)||null}ra(){return this.a.get(_.Q)||null}va(){return this.a.get(_.P)||null}Eb(a){$r(this,_.R,a)}Aa(a){$r(this,_.Q,a)}Za(a){$r(this,_.P,a)}qb(a){$r(this,_.R,a&&a.track)}Cb(a){$r(this,_.Q,a&&a.track)}Db(a){$r(this,_.P,a&&a.track)}addTextTrack(a){const b=this;return _.w(function*(){if(a.mimeType.match(/text\/vtt/)){const c="External_"+`${b.H++}`;
479
- b.o[c]=a;as(b,a,c)}else yield bs(b,a)})}wa(){return 1>=this.getVideoTracks().flatMap(a=>a.renditions).length}I(){const a=this;return _.w(function*(){const b=a.m.getConfiguration();cs(a,_.Q,b.preferredAudioLanguage);if(!Xr(a,_.P).some(c=>Nr(c))){const c=Wr(a,_.P);yield new Promise(d=>{a.f.one(c,Zc,d);(new _.Li(d)).la(1)})}a.B||cs(a,_.P,b.preferredTextLanguage)})}};jv.prototype.isAbrEnabled=jv.prototype.wa;jv.prototype.addTextTrack=jv.prototype.addTextTrack;jv.prototype.setTextRendition=jv.prototype.Db;
480
- jv.prototype.setAudioRendition=jv.prototype.Cb;jv.prototype.setVideoRendition=jv.prototype.qb;jv.prototype.setTextTrack=jv.prototype.Za;jv.prototype.setAudioTrack=jv.prototype.Aa;jv.prototype.setVideoTrack=jv.prototype.Eb;jv.prototype.getTextTrack=jv.prototype.va;jv.prototype.getAudioTrack=jv.prototype.ra;jv.prototype.getVideoTrack=jv.prototype.Ha;jv.prototype.getLoadingTextRendition=jv.prototype.Lb;jv.prototype.getLoadingAudioRendition=jv.prototype.Kb;jv.prototype.getLoadingVideoRendition=jv.prototype.vb;
481
- jv.prototype.getTextRendition=jv.prototype.Wa;jv.prototype.getAudioRendition=jv.prototype.Qa;jv.prototype.getVideoRendition=jv.prototype.ta;jv.prototype.getTextTracks=jv.prototype.sa;jv.prototype.getAudioTracks=jv.prototype.getAudioTracks;jv.prototype.getVideoTracks=jv.prototype.getVideoTracks;jv.prototype.canSelectVideoTracks=jv.prototype.Ke;var ds=["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"];var kv=["abort",Qc,Rc,Sd,"emptied",Ud,_.Wd,_.Xd,"interruptbegin","interruptend",_.qe,_.re,se,"mozaudioavailable",_.Se,_.We,_.gf,_.tf,_.vf,_.Hf,_.If,Of,"suspend",_.fg,"volumechange",_.Fg,_.Gg,_.Af,Lg,Kg,Ig,Jg];_.lv=class extends _.Ot{constructor(a){super();this.log=new _.T(a);this.configuration=this.ia=_.Zm();this.ha=this.C=null;this.Dc=this.lf=!1;this.Mf=new _.T("clpp.video.events");this.Rb=null;this.Zc=-1;this.nh=this.kh.bind(this);this.Qb=new _.Dn;this.setNetworkEngine(this.Qb);this.L=new _.Lt;this.kf=this.Lc=this.Qc=this.N=null}init(a,b){this.configuration=this.ia=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 kv)this.L.on(a,
482
- c,this.nh,c!==_.Xd);this.Rb||(this.Rb=this.dh());this.Rb.initialize(this);this.C.showMediaElement()}release(){this.N&&(this.N.destroy(),this.N=null);return Promise.resolve()}destroy(){this.L.release();return this.Qb.release()}canPlay(a,b){return _.zh[this.namespace()].canPlay(a,b)}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.$a)}appendLoad(){return Promise.reject(_.$a)}seekWith(){return Promise.reject(_.$a)}detach(){return Promise.resolve()}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}play(){if(!this.ha)return Promise.reject("No sources specified yet. You need to load content before calling play.");
483
- 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||""};es(c)?(this.trigger(new _.H(_.Lc)),this.log.warn(_.ja)):c.name===ab&&this.log.warn('Unrecognized "NotAllowedError" on play(). '+`${b.name}: ${b.message}`);throw b;})}pause(){return this.ha?new Promise((a,b)=>{const c=this.getState();if(2!==c&&5!==c&&3!==c&&4!==c)b(new _.I(_.D,7,3201,"The player state does not allow pause."));
484
- else if(this.C.getMedia().pause(),3===this.getState())this.L.one(this,_.Qf,()=>{a()});else a()}):Promise.reject(new _.I(_.D,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.Qc=a}setCdnErrorCallback(a){this.Lc=a}Tc(){return this.Qc}getSurface(){return this.C}getBufferInfo(a){const b=this.getSurface().getMedia();
485
- return new _.It(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)?
486
- (this.log.info("Skip seek. Delta "+Math.abs(d)+" \x3c 0.1"),Promise.resolve()):new Promise((e,f)=>{const g=()=>{this.trigger(new _.H(_.tg));this.L.on(c,_.Hf,h);this.L.on(c,_.fg,h);this.L.on(c,_.tf,h);this.log.info("Seeking to "+a+". Delta "+d);this.Dc=this.lf=!0;c.currentTime=a},h=l=>{const m=this.getMediaPosition(),n=.1>=Math.abs(a-m);var p=.25<m-a;const u=c.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA,v=l.type===_.Hf,y=l.type===_.tf,A=l.type===_.fg,E=y&&u;p=v||n&&E||A&&p;this.log.debug("Checking seeking state after "+
487
- l.type+" event. Seek completed:",p,"Current Time:",m,"Target Time:",a,"Native Event:",v,"Time reached",n,"Timeupdate:",A,"Progress:",y,"ReadyState:",u,"Progress Ready:",E);p?(this.Dc=this.lf=!1,this.L.off(c,_.Hf,h),this.L.off(c,_.fg,h),this.L.off(c,_.tf,h),this.Lf(),this.trigger(new _.H(_.sg)),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,_.re,g)};this.getState()===_.xs?
488
- (this.log.debug("Player is in IDLE state. Postpone seek."),this.L.one(this,_.Qf,()=>{switch(this.getState()){case 2:case 3:case 4: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?_.kh(a)?0>a||1<a?this.log.warn(`Can not set volume to ${a}.
489
- 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===_.Nc&&(b.muted=a)}getDuration(){return this.getMediaDuration()}getMediaDuration(){return this.ha?this.C.getMedia().duration:-1}getTrackManager(){return this.Rb}getPlaybackRate(){const a=this.C.getMedia();return a&&a.playbackRate||
490
- 1}setPlaybackRate(a){const b=this.C.getMedia();void 0!==a&&b&&(b.playbackRate=a)}setSourceIndex(a){this.Zc=a}getSourceIndex(){return this.Zc}getLoadedSource(){return this.ha&&-1!==this.Zc?this.ha[this.Zc]:null}getPeriods(){return[]}getNetworkEngine(){return this.Qb}setNetworkEngine(a){this.Qb=a;lm(this.Qb,b=>{this.onError(b)})}setCmsdManager(a){this.kf=a}getTextDisplayer(){return this.N}getTimelineCues(){return[]}getCueTimeline(){return null}resetAbr(){}kh(a){var b=this.getSurface().getMedia();const c=
491
- this.getPosition();let d="Received Video Element Event: '"+a.type+"' with playhead at: "+c;if(a.type===_.fg||a.type===_.tf)this.Mf.debug(d);else{let e="";switch(a.type){case _.vf:e=`Rate: ${this.getPlaybackRate()}`;break;case Sd:e=`Duration: ${this.getDuration()}`;break;case "volumechange":e=`Volume: ${this.getVolume()} Muted: ${this.isMuted()}`;break;case _.We:case _.gf:case "suspend":case _.Fg:case Of:case _.If:case _.Hf:case _.fg:case _.tf:case Qc:case Rc:b=this.getBufferInfo().Pa(c);e=`State ${this.getSurface().getMedia().readyState} `+
492
- `Buffer: ${b}`;break;case _.Af:null!=b&&(e=`Size: ${b.videoWidth}x${b.videoHeight}`)}e&&(d+=". "+e);this.Mf.info(d)}a.type!==_.Xd&&this.trigger(new _.H(a.type,{detail:a}))}Lf(){}};_.fs=new Map;_.gs=new _.T("clpp.text");var mv=class{constructor(){this.a=null;this.f=[]}};var nv=class{constructor(){this.h=this.f=this.j=null;this.a=[]}};_.ov=class{constructor(){this.h=this.w=this.B=this.C=this.l=this.o=this.j=this.A=NaN;this.a=new mv;this.f=new nv}getStats(){return{width:this.A,height:this.j,streamBandwidth:this.w,decodedFrames:this.l,droppedFrames:this.o,corruptedFrames:this.C,estimatedBandwidth:this.h,loadLatency:this.B,playTime:ks(this.a,3),pauseTime:ks(this.a,4),bufferingTime:ks(this.a,2),stateHistory:ls(this.a),switchHistory:ms(this.f)}}};var pv=class{constructor(a){this.g=new _.T("clpp.StateManager");this.m=a;this.a=new _.Lt;this.f=_.xs;this.w=7;this.G=0;this.o=-1;this.J=this.l=this.H=this.A=0;this.h=this.ga=this.C=!1;this.F=0;this.j=null;this.I=0;this.K=_.Yi();this.B=!1;this.H=Date.now();rs(this)}getState(){return ts(this,"")}destroy(){this.g.debug("Stop watching for video events for "+this.m.namespace());this.a.release()}};var qv=class extends _.lv{constructor(){super(md);this.w=this.G=!1;this.l=this.A=this.o=this.a=this.j=null;this.h=new _.Lt;this.F=this.B=this.f=this.H=null}init(a,b){super.init(a,b);this.j=new pv(this);ps(this.j,_.xs)}namespace(){return md}unload(){const a=this;return _.w(function*(){if(a.ha){a.log.debug("Releasing player with source",a.ha);a.B&&(a.B.stop(),a.B=null);var b=a.getTrackManager();b&&b.release();a.A&&(a.A.destroy(),a.A=null);a.N&&(a.N.destroy(),a.N=null);a.l&&a.l.release();a.o&&(a.o.destroy(),
493
- a.o=null);_.Xh(a.h);a.f&&(a.f=new _.ov);a.F=null;a.ha=null;a.G=!1;a.a&&(a.a.removeAttribute("src"),a.a.load());if(a.w)throw new _.I(_.D,7,7E3);a.a&&(b=a.a,a.h.off(b,_.Xd),a.h.off(b,_.Af),a.a=null)}})}release(){return super.release().then(()=>this.unload()).then(()=>{this.j&&ps(this.j,_.xs)})}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();
494
- a&&a.destroy();this.l&&(this.l.destroy().catch(b=>{this.log.warn("Error while disposing metadata handler",b)}),this.l=null);this.j&&(this.j.destroy(),this.j=null);this.f=null})}getDrmInfo(){return this.o?this.o.getDrmInfo():null}getTrackManager(){return this.Rb}load(a){const b=this;return _.w(function*(){if(b.w)return Promise.reject(new _.I(_.D,7,7E3));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()/
495
- 1E3;b.f=new _.ov;b.h.on(b,_.Qf,()=>{b.f&&_.js(b.f.a,b.getState())});ps(b.j,1);b.ha=_.en(a);b.configuration=_.an([b.ia,a]);b.log.debug(_.Oa,b.configuration);b.log.debug(_.hb,b.ha);const d=_.is(b.configuration,[_.ee,"native"]);b.N=d.create(b);b.N.setTextVisibility(!0);b.configuration.enableHtmlCue&&_.Kh(_.Wf)&&!_.$i()&&(b.A=new vu(b),b.A.start(c));b.l?b.l.release():b.l=new iu(b);c.textTracks&&Jo(b.l,c.textTracks);b.getTrackManager().load();c.loop=!!b.configuration.loop;_.z(b.configuration.volume)||
496
- b.setVolume(b.configuration.volume);_.z(b.configuration.muted)||b.setMuted(b.configuration.muted);b.h.one(c,Qc,()=>{b.trigger(new _.H(_.gg))});null==b.configuration.startTime&&Js(b,c);_.Yi()&&Ks(b,c);try{Cs(b,c),yield Fs(b),yield Is(b).V}catch(e){b.G=!1,b.onError(e)}})}onError(a){this.G||(a.severity===_.D&&null!==this.j&&ps(this.j,_.qs),this.trigger(new _.H(_.Xd,{detail:a})))}dh(){return new jv}getState(){return null!==this.j?this.j.getState().currentState:7}getPresentationStartTime(){if(this.a&&
497
- this.a.getStartDate&&this.isLive()){const a=this.a.getStartDate();return isNaN(a.getTime())?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 _.ns();this.f&&_.js(this.f.a,this.getState());var a=this.a,b=this.f,c=a.videoHeight;
498
- b.A=a.videoWidth;b.j=c;a.getVideoPlaybackQuality&&(c=a.getVideoPlaybackQuality(),a=this.f,b=Number(c.totalVideoFrames),a.o=Number(c.droppedVideoFrames),a.l=b,this.f.C=Number(c.corruptedVideoFrames));if(a=this.getTrackManager())if(a=a.ta())a.bandwidth&&(this.f.w=a.bandwidth),a.nd&&(this.f.h=a.nd);return this.f.getStats()}getTimelineCues(){return this.l?this.l.getTimelineCues():[]}getCueTimeline(){return null}},rv=class{a(){return md}canPlay(a,b){a=a.type||"";const c=a===_.vc,d=a===_.Cc,e=a===_.tl;
499
- var f;_.Xi()||c||d||e&&!_.Yi()?f=0:f=""!==Mi().canPlayType(a)?e&&_.Yi()&&(window.ManagedMediaSource||window.MediaSource&&MediaSource.isTypeSupported)&&!b.streaming.preferNativeHlsOnSafari?1:2:0;return f}f(a){return a===_.na}create(){return new qv}};var sv=class extends S{constructor(a,b,c){super(a,b,c);a={manifest:{timeline:{version:2},keepTimelineLive:!0},streaming:{preferNativeHlsOnSafari:!1,enableLiveEdgeChasing:!1,startAtSegmentBoundary:!1}};this.C=_.ch(this.C,a);this.f=_.ch(this.f,a);this.G=0;this.o=[];this.U=!1;this.w=null;this.J=[]}open(a,b){const c=this;return _.w(function*(){if(c.w)throw new _.I(_.D,7,7008,`Cannot call open() while ${c.w}() is ongoing!`);if(0!==a)throw new _.I(_.D,7,7007,"The index parameter only supports the value of 0.");
500
- if(0===b.length)throw new _.I(_.D,7,7003,Wa);if(b.some(g=>!g.id||!g.source))throw new _.I(_.D,7,7100,"Some config is missing required properties `id` or `source`!");if((new Set(b.map(g=>g.id))).size!==b.length)throw new _.I(_.D,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 _.I(_.D,7,7100,"Unsupported `playlist.timeline` config value!");e=d.startTime;if(null!=e&&(typeof e!==_.r||0>e))throw new _.I(_.D,
501
- 7,7100,"Invalid `playlist.startTime` config value!");f=d.endTime;if(null!=f&&(typeof f!==_.r||0>f||null!=e&&f<=e))throw new _.I(_.D,7,7100,"Invalid `playlist.endTime` config value!");if("DVR"===d.content&&!f)throw new _.I(_.D,7,7100,"`playlist.endTime` config value is required for DVR content!");}try{Ls(c),c.w="open",yield Os(c,b),c.G=0,c.o=b,c.U=!0,Ps(c,b[0].playlist||{})}finally{c.w=null}})}oh(a){const b=this;return _.w(function*(){if(b.w)throw new _.I(_.D,7,7008,`Cannot call addItem() while ${b.w}() is ongoing!`);
502
- if(!b.U)throw new _.I(_.D,7,7008,"open() must be called before addItem()!");if(!a.id||!a.source)throw new _.I(_.D,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 _.I(_.D,7,7100,"A config with this `id` already exists in the playlist!");try{b.w="addItem",b.o.push(a),yield Qs(b,a)}finally{b.w=null}})}getCurrentItem(){return this.o[this.G]||null}getCurrentItemIndex(){return this.G}Yh(){return[...this.o]}yd(){return this.o.length}getTimeline(){return this.a?
503
- this.a.getTimeline():null}seekWith(a){return this.a?this.a.seekWith(a):Promise.resolve()}release(){this.o=[];this.G=0;this.U=!1;return super.release()}destroy(){Ls(this);return super.destroy()}setCdnErrorCallback(){throw new _.I(1,7,7009,"CDN switching is not supported!");}};_.x("clpp.playlist.ScPlaylist",sv);sv.prototype.setCdnErrorCallback=sv.prototype.setCdnErrorCallback;sv.prototype.destroy=sv.prototype.destroy;sv.prototype.release=sv.prototype.release;sv.prototype.seekWith=sv.prototype.seekWith;
504
- sv.prototype.getTimeline=sv.prototype.getTimeline;sv.prototype.getSize=sv.prototype.yd;sv.prototype.getPlaylist=sv.prototype.Yh;sv.prototype.getCurrentItemIndex=sv.prototype.getCurrentItemIndex;sv.prototype.getCurrentItem=sv.prototype.getCurrentItem;sv.prototype.addItem=sv.prototype.oh;sv.prototype.open=sv.prototype.open;var uv=class extends _.Ot{constructor(a){super();this.ka=_.ch({transition:_.Se,preloadMedia:!1},a);this.h=[];this.a=0;const b=Rs(a.anchorId,this.ka.config);this.o=new Qt(b);this.f=null;this.j=!1;this.l=new Map;this.w=a.toggleVisible;this.g=new _.T(nd);this.o.a.forEach(c=>Ss(this,c.player,!1))}Jb(){return this.f}je(){return this.f?this.f.player:null}mg(){return this.l.get(this.a+1)||null}og(){return this.l.get(this.a-1)||null}ng(){return[this.og(),this.mg()].filter(Boolean)}Pi(a){if(0<this.h.length)throw Error("Cannot re-set items in the playlist");
505
- this.g.info("Set items",a);this.h=a.map((b,c)=>({config:b,index:c,preloadPromise:Promise.resolve(),disposers:[]}))}Oi(a){if(0===this.h.length)throw Error(Va);if(0>a||a>this.h.length-1)throw Error("Index out of bounds");this.a=a}Cd(){return this.a<this.h.length-1}tg(){return 0<this.a}Bi(){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(Va);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})`),
506
- yield Vs(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,Zs(a)}}})}Kg(){const a=this;return _.w(function*(){if(a.j)a.g.warn("Cannot play next item while busy");else if(a.Cd()){a.j=!0;a.a+=1;a.g.info(`Next (index: ${a.a})`);var b=a.f;a.ka.transition===_.Se&&b.player.pause();dt(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 $s(a,c),a.g.info(`Next playing (index: ${a.a})`)}catch(d){throw a.g.error(`Next failed (index: ${a.a})`),
507
- d;}finally{a.j=!1,b&&(yield ct(a,b)),Zs(a)}}else a.g.warn("There are no more items in the playlist")})}Ci(){const a=this;return _.w(function*(){if(a.j)a.g.warn("Cannot play previous item while busy");else if(a.tg()){a.j=!0;--a.a;a.g.info(`Previous (index: ${a.a})`);var b=a.f;a.ka.transition===_.Se&&b.player.pause();dt(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 $s(a,c),a.g.info(`Previous playing (index: ${a.a})`)}catch(d){throw a.g.error(`Previous failed (index: ${a.a})`),
508
- d;}finally{a.j=!1,b&&(yield ct(a,b)),Zs(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([et(a),a.f?ct(a,a.f):Promise.resolve()]);yield ft(a)})}};_.x(nd,uv);uv.prototype.destroy=uv.prototype.destroy;uv.prototype.playPrev=uv.prototype.Ci;uv.prototype.playNext=uv.prototype.Kg;uv.prototype.playFirst=uv.prototype.Bi;uv.prototype.hasPrev=uv.prototype.tg;uv.prototype.hasNext=uv.prototype.Cd;
509
- uv.prototype.setIndex=uv.prototype.Oi;uv.prototype.setItems=uv.prototype.Pi;uv.prototype.getPreloading=uv.prototype.ng;uv.prototype.getPrev=uv.prototype.og;uv.prototype.getNext=uv.prototype.mg;uv.prototype.getCurrentPlayer=uv.prototype.je;uv.prototype.getCurrent=uv.prototype.Jb;var bt="preload",Ts=_.te;var gt=new Map;var xv=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]===_.Ec;if(!window.muxjs||!c&&!d)return!1;if(d)return _.ht(Ic);if(b)return _.ht(it(b,a));b=it(_.q,a);a=it(_.t,a);return _.ht(b)||_.ht(a)}isMuxed(a,b){return 1<this.demuxMimeTypes(a,b).size}demuxMimeTypes(a,
510
- b){const c=new Map;c.set(a,b);try{const d=_.Um(b),e=_.Vm(b).split(","),f=new Map,g=Sm(_.q,e),h=Sm(_.t,e);g&&f.set(_.q,this.convertCodecs(_.q,_.Tm(d,g)));h&&f.set(_.t,this.convertCodecs(_.t,_.Tm(d,h)));return f}catch(d){return c}}convertCodecs(a,b){return b.toLowerCase().split(";")[0]===_.Ec?Ic:"mp2t"===b.toLowerCase().split(";")[0].split("/")[1]?it(a,b):b}getOriginalMimeType(){return this.h}transmux(a){const b=[],c=[];let d=[],e=null;a=_.G(a);const f=h=>{d=h.captions;const k=new Uint8Array(h.data.byteLength+
511
- h.initSegment.byteLength);k.set(h.initSegment,0);k.set(h.data,h.initSegment.byteLength);h.type===vv?b.push(k):h.type===wv&&c.push(k)},g=()=>{e={video:_.em(...b),captions:d,audio:_.em(...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 _.I(_.D,3,3018);return e}},wv=_.q,vv=_.t;var yv=class{getCuePoints(){}Nb(){}Mb(){}};_.x("clpp.ads.IAdsTimeline",yv);yv.prototype.hasPostroll=yv.prototype.Mb;yv.prototype.hasPreroll=yv.prototype.Nb;yv.prototype.getCuePoints=yv.prototype.getCuePoints;_.zv=class{install(){}uninstall(){}beforeLoad(){}afterLoad(){}playerConstructed(){}playerDestroyed(){}};var Cv=class extends _.zu{constructor(a,b,c,d,e){super(Ia);this.l=a;this.j=b;this.h=c;this.a=d;this.o=e;this.g=new _.T(jd);_.xi(this.l)?this.g.warn(_.Ib):this.ib(_.wd,{licenseUrl:this.l,videoRobustness:[_.pb,void 0],audioRobustness:[_.ob,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.Md.bind(this)}});_.xi(this.j)?this.g.warn(_.fb):this.ib(_.ud,{licenseUrl:this.j,videoRobustness:["3000"],audioRobustness:["2000"],modifiers:{licenseRequest:this.Md.bind(this)}});
512
- _.xi(this.h)?this.g.warn(_.Da):_.xi(this.a)?this.g.warn(_.Ca):this.ib(_.sd,{licenseUrl:this.h,certificateUrl:this.a,modifiers:{licenseRequest:this.Fg.bind(this),licenseResponse:this.Gg.bind(this),certificateRequest:this.Md.bind(this),extractContentId:this.hg.bind(this)}})}Md(a,b){a=a.drm.customData.headers||{};for(const c of Object.keys(a))b.headers[c]=a[c]}hg(a,b){a=fp(b);switch(this.o){case Av:return a;case Bv:return(new _.gp(a)).a;default:throw Error("Unknown content ID strategy");}}Fg(a,b){b.headers[ta]=
513
- Dc;this.Md(a,b);a={spc:_.Zl(b.body)};b.body=_.ti(_.Nm(a,!0))}Gg(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=_.am(a).buffer}};_.x(jd,Cv);Cv.prototype.onFairPlayLicenseResponse=Cv.prototype.Gg;Cv.prototype.onFairPlayLicenseRequest=Cv.prototype.Fg;Cv.prototype.extractFairPlayContentId=Cv.prototype.hg;Cv.prototype.onLicenseRequest=Cv.prototype.Md;Cv.prototype.constructor=Cv.prototype.constructor;Cv.NAME=Ia;
514
- var Bv="hostname",Av="full-skd";Cv.FairPlayContentIdStrategy={HOSTNAME:Bv,FULL_SKD:Av};_.x("clpp.drm.HeaderDrmComponent",class extends _.zv{beforeLoad(a){a=a.getConfiguration();if(a.drm&&a.drm&&a.drm.env===Ia){a=a.drm.customData;if(!a)throw new _.I(_.D,7,7100,_.xd);a=new Cv(a.widevineLicenseUrl,a.playReadyLicenseUrl,a.fairPlayLicenseUrl,a.fairPlayCertificateUrl,a.fairPlayContentIdStrategy||Av);_.jn(a)}}uninstall(){delete _.hn.HeaderDrm}id(){return"headerdrm"}});var qt;_.Dv=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 Ev;_.Fv=class{constructor(){this.a=new Blob([Ev],{type:_.zg})}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 _.Gl;b=b.play();const d=(new _.Li(()=>{d.stop();c.resolve(a)})).la(.25);void 0!==b?b.then(()=>{d.stop();c.resolve(!0)}).catch(e=>{e&&e.message&&e.message===bb?(d.stop(),c.resolve(!0)):(d.stop(),c.resolve(!1))}):(d.stop(),c.resolve(!0));return c}};
515
- Ev=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,
441
+ 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]};_.Op=class{constructor(a){this.I=a;this.f={}}Ga(a,b){this.f[a]=b}};_.x("clpp.drm.DrmEnvironment",_.Op);_.Op.prototype.setDrmSystem=_.Op.prototype.Ga;_.pp=class{constructor(a,b){b=void 0===b?!1:b;this.f=_.ph(a)?new DataView(new ArrayBuffer(a),0,a):a;this.a=0;this.h=b;this.buffer=this.f.buffer}getPosition(){return this.a}Ta(){return this.f.byteLength}seek(a){(0>a||a>=this.f.byteLength)&&_.Vo();this.a=a}};_.kq=class{constructor(a,b){this.f=a;this.h=void 0===b?!0:b;this.a=0}getPosition(){return this.a}Ta(){return this.f.byteLength}skip(a){this.a+a>this.f.byteLength&&_.Yo();this.a+=a}seek(a){if(0>a||a>=this.f.byteLength)throw _.Yo();this.a=a}};
442
+ _.x("clpp.utils.dataview.DataViewReader",_.kq);_.np=class{constructor(){this.h=[];this.f=[];this.a=!1;this.g=new _.T("clpp.mp4")}N(a,b){a=ep(a);this.h[a]=Ju;this.f[a]=b;return this}fa(a,b){a=ep(a);this.h[a]=Ku;this.f[a]=b;return this}stop(){this.a=!0}parse(a,b){a=_.G(a);a=new _.kq(new DataView(a.buffer,a.byteOffset,a.byteLength),!1);for(this.a=!1;_.Xo(a)&&!this.a;)this.Ie(0,a,b)}Ie(a,b,c){const d=b.getPosition();let e=_.N(b);var f=_.N(b);let g=!1;this.g.debug("Parsing MP4 box",_.fp(f));switch(e){case 0:e=b.Ta()-d;break;case 1:e=_.bp(b),g=!0}const h=
443
+ this.f[f];if(h){let m=null;var k=null;this.h[f]===Ku&&(k=_.N(b),m=k>>>24,k&=16777215);f=b.getPosition()-d;var l=d+e;c&&l>b.Ta()&&(l=b.Ta());l-=b.getPosition();b=0<l?_.dp(b,l):new Uint8Array(0);b=new _.kq(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.Ta()-b.getPosition()),b.skip(a)}};_.x("clpp.utils.Mp4Parser",_.np);_.np.typeToString=_.fp;
444
+ _.np.allData=_.ip;_.np.sampleDescription=_.hp;_.np.children=_.gp;_.np.prototype.parseNext=_.np.prototype.Ie;_.np.prototype.parse=_.np.prototype.parse;_.np.prototype.stop=_.np.prototype.stop;_.np.prototype.fullBox=_.np.prototype.fa;_.np.prototype.box=_.np.prototype.N;_.np.headerSize=_.jp;var Ju=0,Ku=1;var Lu=class{};_.x("clpp.utils.FairplayUtils",Lu);Lu.parseFairPlayResponse=_.sp;Lu.formatFairPlayRequest=_.rp;Lu.createFairplayPayload=qp;Lu.extractContentId=_.mp;Lu.extractExtXKeyUri=kp;var Mu=class{};_.x(id,Mu);Mu.registerCustom=Qp;var Ap=new _.T(id),Kp="PRODUCTION",Lp="STAGING",Mp="DEMO",Np="TEST",Nu={PRODUCTION:Kp,STAGING:Lp,DEMO:Mp,TEST:Np};Mu.Environment=Nu;Mu.WidevineCertificates={V1_PROD:"V1_PROD",V1_STAGING:"V1_STAGING",V2:"V2"};
445
+ var wp="/license-proxy-widevine/cenc/",xp="/license-proxy-headerauth/drmtoday/RightsManager.asmx",yp="/license-server-fairplay/",Pp="/license-server-fairplay/cert/",Rp={"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)",
446
+ 41E3:"General Widevine Classic error",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"};
447
+ {const a=tp(),b=up();for(const c of Object.keys(Nu)){let d=wa;c!==Kp&&(d+=`_${c}`);const e=new _.Op(d);let f=null;switch(c){case Kp:case Lp:case Mp:f=_.To("V2");break;case Np:f=null}e.Ga(_.wd,{licenseUrl:zp(_.wd,c),videoRobustness:a.video,audioRobustness:a.audio,persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:f,modifiers:{licenseRequest:_.Cp,licenseResponse:_.Dp}});e.Ga(_.sd,{licenseUrl:zp(_.sd,c),certificateUrl:vp(c)+Pp,modifiers:{licenseRequest:_.Fp,licenseResponse:_.Gp,
448
+ extractContentId:_.Hp,certificateRequest:_.Ip}});e.Ga(_.ud,{licenseUrl:zp(_.ud,c),videoRobustness:b.video,audioRobustness:b.audio,modifiers:{licenseRequest:Jp}});_.nn(e)}}_.x("clpp.drm.registerCustomDrmToday",function(a,b,c){Qp(a,b,c)});_.Ou=class{constructor(a){this.f=a;this.a=void 0}value(){void 0===this.a&&(this.a=this.f());return this.a}};var Qu=class{constructor(){this.size=0;this.a=void 0;this.g=new _.T("clpp.drm.eme.MediaKeyStatusMap")}getStatus(){return this.a}forEach(a){this.a&&a(this.a,Pu.value())}get(a){if(this.has(a))return this.a}has(a){const b=Pu.value();return this.a&&ji(a,b)?!0:!1}entries(){}keys(){}values(){}},Pu=new _.Ou(()=>pi(new Uint8Array([0])));var Vp=new _.Ou(()=>new Map([[HTMLMediaElement.HAVE_METADATA,_.se],[HTMLMediaElement.HAVE_CURRENT_DATA,_.re],[HTMLMediaElement.HAVE_FUTURE_DATA,Qc],[HTMLMediaElement.HAVE_ENOUGH_DATA,Rc]]));var Su=class{constructor(){this.j=this.w=null}l(a){this.w=a}h(a){const b=this.j;b&&b!==a&&Xp(b,null);return(this.j=a)?Xp(a,this.w):Promise.resolve()}o(){return this.j}a(a,b){_.Ch("AppleEmeManager.requestMediaKeySystemAccess");try{const c=new Ru(a,b);return Promise.resolve(c)}catch(c){return Promise.reject(c)}}f(){return Cq}},Ru=class{constructor(a,b){this.keySystem=a;if(a.startsWith(_.sd))for(var c of b){a:{a=c;if(a.persistentState===_.Af){a=null;break a}b={audioCapabilities:[],videoCapabilities:[],
449
+ persistentState:_.Qe,distinctiveIdentifier:_.Qe,initDataTypes:a.initDataTypes,sessionTypes:[_.Yf],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),
450
+ e=!0));d||(e=WebKitMediaKeys.isTypeSupported(this.keySystem,_.Ag));a=e?b:null}if(a){this.a=a;return}}c=Error(Bb);c.name=cb;c.code=DOMException.NOT_SUPPORTED_ERR;throw c;}createMediaKeys(){const a=new Tu(this.keySystem);return Promise.resolve(a)}getConfiguration(){_.Ch("AppleEmeManager.MediaKeySystemAccess.getConfiguration");return this.a}},Tu=class{constructor(a){this.f=null;this.h=new WebKitMediaKeys(a);this.a=new _.Vt;this.j=0;this.g=new _.T(kd);this.g.info("Created Media Keys for "+a)}createSession(a){a=
451
+ void 0===a?_.Yf:a;this.g.debug("Creating Apple MediaKeys Session");if(a!==_.Yf)throw new TypeError("Session type "+a+ba);return new Uu(this.h,`__session_${this.j++}`)}setServerCertificate(){this.g.debug("AppleEmeManager.MediaKeys.setServerCertificate");return Promise.resolve(!1)}},Uu=class extends _.Yt{constructor(a,b){super();this.a=null;this.o=a;this.f=this.h=null;this.j=new _.Vt;this.sessionId=b;this.expiration=NaN;this.closed=new _.Kl;this.l=!1;this.keyStatuses=new Qu;this.g=new _.T(kd)}generateRequest(a,
452
+ b){if(this.l)return Promise.reject(qb);this.g.debug("generateRequest");this.h=new _.Kl;try{const c=this.o.createSession(_.Ag,_.G(b));this.a=c;this.sessionId=c.sessionId||this.sessionId||"";this.j.on(c,Lg,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 _.H(_.Ae,{messageType:void 0===e||e===Sf?me:le,message:pi(d.message.buffer)});this.dispatchEvent(d)}});this.j.on(c,Jg,d=>{this.g.debug("onWebkitKeyAdded_",
453
+ d);this.f&&(Yp(this,"usable"),this.f.resolve(),this.f=null)});this.j.on(c,Kg,()=>{var d=this.keyStatuses.getStatus();if(this.a&&this.a&&this.a.error&&this.a.error.code===WebKitMediaKeyError.MEDIA_KEYERR_DOMAIN&&d===Sf)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),
454
+ 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:Yp(this,"output-not-allowed");break;default:Yp(this,_.ie)}});Yp(this,Sf)}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(qb);this.g.debug(ng);this.f=new _.Kl;try{this.a.update(_.G(a))}catch(b){this.f.reject(b)}return this.f}close(){if(this.l)return this.closed;
455
+ this.g.info(`Closing Key Session ${this.sessionId}`);this.l=!0;try{this.a.close(),this.closed.resolve(),_.ai(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"))}},Vu=class{a(){return Cq}f(){return!!window.WebKitMediaKeys}create(){return new Su}};var Wu=class{constructor(){this.j=null;this.g=new _.T("clpp.drm.eme.StandardEmeManager")}l(a){this.j=a}h(a){return this.j?this.j.setMediaKeys(a):Promise.reject(Sa)}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 fr}},
456
+ Xu=class{a(){return fr}f(){return!!(window.MediaKeys&&navigator.requestMediaKeySystemAccess&&window.MediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)}create(){return new Wu}};var $u=class{constructor(){this.w=this.j=null;this.A="";HTMLMediaElement.prototype.webkitGenerateKeyRequest&&(this.A="webkit")}l(a){this.j=a}h(a){_.Ch("WebkitEmeManager.setMediaKeys");if(!this.j)return Promise.reject(Sa);const b=this.w;b&&b!==a&&aq(b,null);(this.w=a)&&aq(a,this.j);return Promise.resolve()}o(){return this.w}a(a,b){_.Ch("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=
457
+ new Yu(this.A,c,a,b);return Promise.resolve(e)}catch(e){return Promise.reject(e)}}f(){return Zu}},Yu=class{constructor(a,b,c,d){this.h=a;this.a=this.keySystem=c;a=!1;c===_.Re&&(this.a=Ig,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,this.a)&&
458
+ (f.push(k),e=!0));h||(e=b.canPlayType(_.Ag,this.a)||b.canPlayType("video/webm",this.a));g.persistentState!==_.Af||a||(e=!1);if(e){this.f=g;return}}b=Bb;if(c===_.Re||c===_.wd)b="None of the requested configurations were supported.";c=Error(b);c.name=cb;c.code=DOMException.NOT_SUPPORTED_ERR;throw c;}createMediaKeys(){return Promise.resolve(new av(this.h,this.a))}getConfiguration(){return this.f}},av=class{constructor(a,b){this.h=a;this.o=b;this.a=null;this.f=new _.Vt;this.j=[];this.l=new Map}createSession(a=
459
+ _.Yf){if(a!==_.Yf&&a!==_.Ve)throw new TypeError("Session type "+a+ba);if(!this.a)throw a=Error("Media element is missing."),a.name=Ka,a.code=DOMException.INVALID_STATE_ERR,a;this.a.src||(this.a.src="about:blank");a=new bv(this.h,this.a,this.o,a);this.j.push(a);return a}setServerCertificate(){return Promise.resolve(!1)}},bv=class extends _.Yt{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 _.Kl;this.keyStatuses=
460
+ new Qu}ready(){_.Ch("WebkitEmeManager.MediaKeySession.ready");$p(this,"usable");this.a&&this.a.resolve();this.a=null}generateRequest(a,b){_.Ch("WebkitEmeManager.MediaKeySession.generateRequest");return cq(this,b,null)}load(a){_.Ch(Hb);return this.l===_.Ve?cq(this,null,a):Promise.reject(Error($a))}update(a){_.Ch(Hb);const b=new _.Kl;dq(this,b,a);return b}close(){_.Ch("WebkitEmeManager.MediaKeySession.close");if(this.l!==_.Ve){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),
461
+ this.closed;const a=bq(this,"cancelKeyRequest");try{this.j[a](this.h,this.sessionId)}catch(b){}}this.closed.resolve();return this.closed}remove(){_.Ch("WebkitEmeManager.MediaKeySession.remove");return this.l!==_.Ve?Promise.reject(Error($a)):this.close()}},cv=class{a(){return Zu}f(){return!(!HTMLMediaElement.prototype.webkitGenerateKeyRequest&&!HTMLMediaElement.prototype.generateKeyRequest)}create(){return new $u}};var ev=class{l(){}h(a){_.Ch("NopEmeManager.setMediaKeys");return null===a?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}o(){return null}a(){_.Ch("NopEmeManager.requestMediaKeySystemAccess");return Promise.reject(Error("The key system specified is not supported."))}f(){return dv}},fv=class{a(){return dv}f(){return!0}create(){return new ev}};var gv=class{};_.x(ld,gv);var fq=new _.T(ld),eq=[];eq=[new Xu,new Vu,new cv,new fv].filter(a=>a.f());var fr="STANDARD",Cq="APPLE",Zu="WEBKIT",dv="NOP";gv.Apis={STANDARD:fr,APPLE:Cq,WEBKIT:Zu,NOP:dv};_.hv=class{h(a,b){a=this.a(a,b);return 1!==a.length?null:a[0]}a(a,b){return Array.from(a.childNodes).filter(c=>c instanceof Element&&c.tagName===b)}getAttributeNS(a,b,c){return a.hasAttributeNS(b,c)?a.getAttributeNS(b,c):null}f(a){return Array.from(a.childNodes).every(b=>b.nodeType===Node.TEXT_NODE||b.nodeType===Node.CDATA_SECTION_NODE)?a.textContent.trim():null}j(a,b){const c=new DOMParser;let d=null;try{d=c.parseFromString(a,_.ag)}catch(e){}if(!d)return null;a=d.documentElement;return b&&a.tagName!==
462
+ b||0<d.getElementsByTagName("parsererror").length?null:a}removeChild(a,b){a.removeChild(b)}};_.Xg=_.hv.prototype;_.Xg.be=_.Zg(19);_.Xg.Ke=_.Zg(17);_.Xg.ze=_.Zg(15);_.Xg.Ae=_.Zg(13);_.Xg.Je=_.Zg(11);_.Xg.Vc=_.Zg(9);_.Xg.ve=_.Zg(7);_.Xg.aa=_.Zg(5);_.Xg.Ec=_.Zg(3);_.Xg.Wb=_.Zg(1);_.O=new _.hv;_.iv=new _.T("clpp.xml.Parser");_.bn="dom";var iq,jv,hq;_.qq=[154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149];iq=[237,239,139,169,121,214,74,206,163,200,39,220,213,29,33,237];jv=class{constructor(a,b,c){this.j=new Uint8Array(a);this.a=b;this.f=c}};hq=class extends jv{};_.pq=class extends jv{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 Tq=class{constructor(a){this.f=[];this.h=[];this.a=[];8<=a.byteLength&&(new _.np).fa("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=_.gm(_.dp(a.reader,16)),c=[];if(0<a.version){var d=_.N(a.reader);for(let e=0;e<d;++e){const f=_.gm(_.dp(a.reader,16));c.push(f)}}d=_.N(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});
463
+ a.reader.getPosition()!==a.reader.Ta()&&_.B("Mismatch between box size and data size!")}}};var Oq,kv;
464
+ _.Ns=class{constructor(a,b){this.D=a;this.lb=b;this.J=new Set;this.C=this.I=this.l=null;this.S=!1;this.a=null;this.K=kv;this.B=new _.Vt;this.M=new Iu;this.h=new Map;this.L=[];this.H=new _.Kl;this.Aa=0;this.f=null;this.w=c=>{this.A=!0;this.F=!1;this.H.reject(c);a.onError(c)};this.o=new Map;this.X=new Map;this.U=new _.Pi(()=>Fq(this));this.j=!1;this.da=new _.Kl;this.G=!1;this.W=[];this.ia=!1;this.R=0;this.g=new _.T("clpp.drm.DrmEngine");this.ca=(new _.Pi(()=>{Gq(this)})).Hb(1);this.H.catch(()=>{});
465
+ this.A=this.F=!1;this.P=null}destroy(){const a=this;return _.w(function*(){a.j?yield a.da:(a.j=!0,yield Hq(a),a.da.resolve())})}keySystem(){return this.a?_.uq(this.a.keySystem):""}getDrmInfo(){return this.a}cb(a){const b=this;return _.w(function*(){b.G&&b.K===Oq||(!b.f.delayLicenseRequestUntilPlayed||b.C&&!b.C.paused||b.ia?yield Yq(b,a):b.W.push(a))})}Ma(a){const b=a.target;this.g.info("Key status changed for session",b.sessionId);const c=this.h.get(b);let d=!1;b.keyStatuses.forEach((e,f)=>{if(typeof f===
466
+ _.Uf){var g=f;f=e;e=g}if(tq(this.a.keySystem)&&16===f.byteLength&&_.Ri()){g=_.oi(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!==Sf&&(c.loaded=!0);c&&c.rb&&c.rb.resolve();"expired"===e&&(d=!0);f=_.G(f);let h=_.gm(f);"00"===h&&c&&c.keyId?h=c.keyId:this.a.keySystem.startsWith(_.sd)&&16!==f.byteLength&&(h=qi(f));(f=h||"")?this.g.info(`Key status for Key ID '${h}': ${e}`):this.g.info(`Key status global keys: ${e}`);
467
+ this.o.set(f,e);c&&!c.keyId&&this.h.forEach((k,l)=>{l===b||k.keyId!==h||k.loaded||(k.loaded=!0)})});c&&c.loaded&&c.vb.forEach(e=>{this.o.get(e)===Sf&&(this.g.warn(`Key status for Key ID '${e}': 'output-restricted'`),this.o.set(e,_.Se))});for(a=0;a<this.a.initData.length;a++){const e=this.a.initData[a];e.keyId&&this.o.get(e.keyId)===Sf&&_.hm(e.initData,c.initData)&&(this.g.warn(`Key status for Key ID '${e.keyId}': 'output-restricted'`),this.o.set(e.keyId,_.Se))}a=b.expiration-Date.now();(0>a||d&&1E3>
468
+ a)&&c&&!c.vc&&(this.g.debug("Session has expired",b.sessionId),(a=this.h.get(b))&&a.td&&a.td.stop(),this.h.delete(b),b.close().catch(()=>{}));hr(this)&&(this.H.resolve(),1!==this.h.size||d?this.U.la(.5):Fq(this))}};Oq=0;kv=3;_.lv=new _.T("clpp.hls.Utils");_.ur=class{constructor(a){this.f=a;this.a=0}};var Ar;
469
+ _.Cr=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&&fi(this.roles,
470
+ a.roles)&&fi(this.accessibility,a.accessibility,yr)}toString(){return`Track type: ${this.type} id: ${this.id}
471
+ renditions size: ${this.renditions.length}`}};_.x("clpp.Track",_.Cr);_.Cr.prototype.toString=_.Cr.prototype.toString;_.Gr=class{constructor(a,b){this.track=b;this.id=a;this.originalId=this.codec=this.wd=this.bandwidth=this.height=this.width=null;this.a=!1}};_.x("clpp.Rendition",_.Gr);_.Vr=1;_.R=_.t;_.Q=_.q;_.P=_.Zf;Ar=_.Be;_.mv={VIDEO:_.R,AUDIO:_.Q,TEXT:_.P,METADATA:Ar};_.Cr.Type=_.mv;var nv=class{constructor(a){this.f=a;this.g=new _.T("clpp.native.hls.HlsMetadataParser");this.a=Mm(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 Er(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 Ir(c,d,
472
+ 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 Kr(d);e.Oc=f}catch(f){c.g.warn("Failed to parse metadata from HLS playlist.",f.message)}return e})}};_.Sr=[];_.V=class{Ye(){return!0}Yh(a){return this.getVideoTracks().find(b=>_.qh(b,a,a&&Object.keys(a)))}Uh(a){return this.getAudioTracks().find(b=>_.qh(b,a,a&&Object.keys(a)))}Wh(a){return this.sa().find(b=>_.qh(b,a,a&&Object.keys(a)))}Xh(a){return this.getVideoTracks().flatMap(b=>b.renditions).find(b=>_.qh(b,a,a&&Object.keys(a)))}Th(a){return this.getAudioTracks().flatMap(b=>b.renditions).find(b=>_.qh(b,a,a&&Object.keys(a)))}Vh(a){return this.sa().flatMap(b=>b.renditions).find(b=>_.qh(b,a,a&&Object.keys(a)))}};
473
+ _.x("clpp.TrackManager",_.V);_.V.prototype.isAbrEnabled=_.V.prototype.va;_.V.prototype.addTextTrack=_.V.prototype.addTextTrack;_.V.prototype.findTextRendition=_.V.prototype.Vh;_.V.prototype.findAudioRendition=_.V.prototype.Th;_.V.prototype.findVideoRendition=_.V.prototype.Xh;_.V.prototype.findTextTrack=_.V.prototype.Wh;_.V.prototype.findAudioTrack=_.V.prototype.Uh;_.V.prototype.findVideoTrack=_.V.prototype.Yh;_.V.prototype.setTextRendition=_.V.prototype.Fb;_.V.prototype.setAudioRendition=_.V.prototype.Eb;
474
+ _.V.prototype.setVideoRendition=_.V.prototype.sb;_.V.prototype.setTextTrack=_.V.prototype.ab;_.V.prototype.setAudioTrack=_.V.prototype.za;_.V.prototype.setVideoTrack=_.V.prototype.Gb;_.V.prototype.getTextTrack=_.V.prototype.ua;_.V.prototype.getAudioTrack=_.V.prototype.ra;_.V.prototype.getVideoTrack=_.V.prototype.Ia;_.V.prototype.getLoadingTextRendition=_.V.prototype.Ob;_.V.prototype.getLoadingAudioRendition=_.V.prototype.Nb;_.V.prototype.getLoadingVideoRendition=_.V.prototype.xb;
475
+ _.V.prototype.getTextRendition=_.V.prototype.Xa;_.V.prototype.getAudioRendition=_.V.prototype.Qa;_.V.prototype.getVideoRendition=_.V.prototype.ta;_.V.prototype.getTextTracks=_.V.prototype.sa;_.V.prototype.getAudioTracks=_.V.prototype.getAudioTracks;_.V.prototype.getVideoTracks=_.V.prototype.getVideoTracks;_.V.prototype.canSelectVideoTracks=_.V.prototype.Ye;var ov=class extends _.V{constructor(){super();this.g=new _.T("clpp.native.TrackManager");this.m=null;this.f=new _.Vt;this.h=[];this.H=0;this.o={};this.J=[];this.a=new Map;this.w=null;this.l=new Map;this.A=new Map;this.B=!0;this.P=this.C.bind(this,_.P);this.S=this.G.bind(this,_.P);this.R=this.F.bind(this,_.P);this.U=this.C.bind(this,_.R);this.X=this.G.bind(this,_.R);this.W=this.F.bind(this,_.R);this.K=this.C.bind(this,_.Q);this.M=this.G.bind(this,_.Q);this.L=this.F.bind(this,_.Q);this.j=null}Ye(){return!_.bj()}C(a,
476
+ b){const c=this;return _.w(function*(){if(b){var d=b.track;if(d){var e=a===_.Q,f=a===_.R,g=a===_.P,h=e||f,k=Wr(a,d),l=Dr(a,k,d);e&&c.A.set(k,d);var m=Xr(d);if(g){if(d.kind===_.Be)return;let n;void 0!==d.id?n=c.o[d.id]:n=Object.values(c.o).find(p=>Yr(c,l,p,a));l.kind&&"captions"===l.kind&&(l.mimeType=_.uc);n&&(l.src=n.url,l.mimeType=n.mimeType)}else if(g=c.h.find(n=>n.type===a&&_.qh(n,l,["kind","label","language"]))){e?c.A.set(g.id,d):g.id=d.id;m&&(c.g.debug(`Setting native ${a} track active`),c.a.set(a,
477
+ g));c.g.debug("Track from event seems to already exists, flipped native track to",d);return}try{l.renditions.push(new _.Gr(l.id,l));c.h.push(l);const n=c.m.getConfiguration().safari;$r(c,a,n)?yield as(c,l,n):bs(c,a,n)&&(yield cs(c,l,n));c.g.debug(a+" Track added",l);c.m.trigger(new _.H(_.hg));const p=ds(c,a).length,u=b.target,v=!(!u||!u.length),y=u&&u.length||0;e=()=>{c.g.debug(`Setting native ${a} track active. `+`Native track active: ${m}. `+`Number of tracks: ${p}`,d);c.a.set(a,l)};m?e():1===p&&
478
+ h&&(f?e():v&&1!==y||e())}catch(n){c.g.error("Error while converting track data",n)}}else c.g.warn(Za)}else c.g.warn(Va)})}G(a,b){if(b){var c=b.track;c?a===_.P&&c.kind!==_.Be&&(b=this.h.find(d=>Yr(this,d,c,a)))&&(this.h.splice(this.h.indexOf(b),1),(this.a.get(a)||null)===b&&(this.a.set(a,null),es(this)),this.g.debug(a+" Track removed, id: ",b.id)):this.g.warn(Za)}else this.g.warn(Va)}F(a,b){this.g.debug(a+" Track changed",b);a===_.P&&es(this);const c=gs(this,a);if(c)for(let d=0;d<c.length;++d)if(Xr(c[d])){if(b=
479
+ this.h.find(e=>Yr(this,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===_.Q?this.m.trigger(new _.H(_.Kc)):a===_.P&&this.m.trigger(new _.H(_.bg));break}}initialize(a){this.m=a;this.j=new nv(a.getNetworkEngine())}load(){this.B=!1;var a=fs(this,_.P);a&&(this.f.on(a,_.pc,this.P),this.f.on(a,zf,this.S),this.f.on(a,Zc,this.R));if(a=fs(this,_.Q))this.f.on(a,_.pc,this.K),this.f.on(a,zf,this.M),this.f.on(a,Zc,this.L);if(a=fs(this,_.R))this.f.on(a,
480
+ _.pc,this.U),this.f.on(a,zf,this.X),this.f.on(a,Zc,this.W);this.f.one(this.m,Rc,this.I.bind(this))}release(){this.B=!0;this.h=[];this.o={};this.a.clear();this.l.clear();this.A.clear();this.f.release()}destroy(){this.release();this.m=null}getVideoTracks(){return ds(this,_.R)}getAudioTracks(){return ds(this,_.Q)}sa(){return ds(this,_.P)}ta(){const a=this.a.get(_.R)||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]||
481
+ null}Qa(){return hs(this,_.Q)}Xa(){return hs(this,_.P)}xb(){return is(this,_.R)}Nb(){return is(this,_.Q)}Ob(){return is(this,_.P)}Ia(){return this.a.get(_.R)||null}ra(){return this.a.get(_.Q)||null}ua(){return this.a.get(_.P)||null}Gb(a){js(this,_.R,a)}za(a){js(this,_.Q,a)}ab(a){js(this,_.P,a)}sb(a){js(this,_.R,a&&a.track)}Eb(a){js(this,_.Q,a&&a.track)}Fb(a){js(this,_.P,a&&a.track)}addTextTrack(a){const b=this;return _.w(function*(){if(a.mimeType.match(/text\/vtt/)){const c="External_"+`${b.H++}`;
482
+ b.o[c]=a;ks(b,a,c)}else yield ls(b,a)})}va(){return 1>=this.getVideoTracks().flatMap(a=>a.renditions).length}I(){const a=this;return _.w(function*(){const b=a.m.getConfiguration();ms(a,_.Q,b.preferredAudioLanguage);if(!gs(a,_.P).some(c=>Xr(c))){const c=fs(a,_.P);yield new Promise(d=>{a.f.one(c,Zc,d);(new _.Pi(d)).la(1)})}a.B||ms(a,_.P,b.preferredTextLanguage)})}};ov.prototype.isAbrEnabled=ov.prototype.va;ov.prototype.addTextTrack=ov.prototype.addTextTrack;ov.prototype.setTextRendition=ov.prototype.Fb;
483
+ ov.prototype.setAudioRendition=ov.prototype.Eb;ov.prototype.setVideoRendition=ov.prototype.sb;ov.prototype.setTextTrack=ov.prototype.ab;ov.prototype.setAudioTrack=ov.prototype.za;ov.prototype.setVideoTrack=ov.prototype.Gb;ov.prototype.getTextTrack=ov.prototype.ua;ov.prototype.getAudioTrack=ov.prototype.ra;ov.prototype.getVideoTrack=ov.prototype.Ia;ov.prototype.getLoadingTextRendition=ov.prototype.Ob;ov.prototype.getLoadingAudioRendition=ov.prototype.Nb;ov.prototype.getLoadingVideoRendition=ov.prototype.xb;
484
+ ov.prototype.getTextRendition=ov.prototype.Xa;ov.prototype.getAudioRendition=ov.prototype.Qa;ov.prototype.getVideoRendition=ov.prototype.ta;ov.prototype.getTextTracks=ov.prototype.sa;ov.prototype.getAudioTracks=ov.prototype.getAudioTracks;ov.prototype.getVideoTracks=ov.prototype.getVideoTracks;ov.prototype.canSelectVideoTracks=ov.prototype.Ye;var ns=["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"];var pv=["abort",Qc,Rc,Sd,"emptied",Ud,_.Wd,_.Xd,"interruptbegin","interruptend",_.re,_.se,te,"mozaudioavailable",_.Te,_.Xe,_.hf,_.uf,_.wf,_.If,_.Jf,Pf,"suspend",_.gg,"volumechange",_.Gg,_.Hg,_.Bf,Mg,Lg,Jg,Kg];_.qv=class extends _.Yt{constructor(a){super();this.log=new _.T(a);this.configuration=this.ia=_.cn();this.ha=this.C=null;this.Lc=this.zf=!1;this.Zf=new _.T("clpp.video.events");this.Ub=null;this.hd=-1;this.xh=this.uh.bind(this);this.Tb=new _.Hn;this.setNetworkEngine(this.Tb);this.L=new _.Vt;this.yf=this.Uc=this.Yc=this.P=null}init(a,b){this.configuration=this.ia=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 pv)this.L.on(a,
485
+ c,this.xh,c!==_.Xd);this.Ub||(this.Ub=this.nh());this.Ub.initialize(this);this.C.showMediaElement()}release(){this.P&&(this.P.destroy(),this.P=null);return Promise.resolve()}destroy(){this.L.release();return this.Tb.release()}canPlay(a,b){return _.Eh[this.namespace()].canPlay(a,b)}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.ab)}appendLoad(){return Promise.reject(_.ab)}seekWith(){return Promise.reject(_.ab)}detach(){return Promise.resolve()}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}play(){if(!this.ha)return Promise.reject("No sources specified yet. You need to load content before calling play.");
486
+ 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||""};os(c)?(this.trigger(new _.H(_.Lc)),this.log.warn(_.ka)):c.name===bb&&this.log.warn('Unrecognized "NotAllowedError" on play(). '+`${b.name}: ${b.message}`);throw b;})}pause(){return this.ha?new Promise((a,b)=>{const c=this.getState();if(2!==c&&5!==c&&3!==c&&4!==c)b(new _.I(_.D,7,3201,"The player state does not allow pause."));
487
+ else if(this.C.getMedia().pause(),3===this.getState())this.L.one(this,_.Rf,()=>{a()});else a()}):Promise.reject(new _.I(_.D,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.Yc=a}setCdnErrorCallback(a){this.Uc=a}bd(){return this.Yc}getSurface(){return this.C}getBufferInfo(a){const b=this.getSurface().getMedia();
488
+ return new _.St(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)?
489
+ (this.log.info("Skip seek. Delta "+Math.abs(d)+" \x3c 0.1"),Promise.resolve()):new Promise((e,f)=>{const g=()=>{this.trigger(new _.H(_.ug));this.L.on(c,_.If,h);this.L.on(c,_.gg,h);this.L.on(c,_.uf,h);this.log.info("Seeking to "+a+". Delta "+d);this.Lc=this.zf=!0;c.currentTime=a},h=l=>{const m=this.getMediaPosition(),n=.1>=Math.abs(a-m);var p=.25<m-a;const u=c.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA,v=l.type===_.If,y=l.type===_.uf,A=l.type===_.gg,E=y&&u;p=v||n&&E||A&&p;this.log.debug("Checking seeking state after "+
490
+ l.type+" event. Seek completed:",p,"Current Time:",m,"Target Time:",a,"Native Event:",v,"Time reached",n,"Timeupdate:",A,"Progress:",y,"ReadyState:",u,"Progress Ready:",E);p?(this.Lc=this.zf=!1,this.L.off(c,_.If,h),this.L.off(c,_.gg,h),this.L.off(c,_.uf,h),this.Yf(),this.trigger(new _.H(_.qg)),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()===_.Hs?
491
+ (this.log.debug("Player is in IDLE state. Postpone seek."),this.L.one(this,_.Rf,()=>{switch(this.getState()){case 2:case 3:case 4: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?_.ph(a)?0>a||1<a?this.log.warn(`Can not set volume to ${a}.
492
+ 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===_.Nc&&(b.muted=a)}getDuration(){return this.getMediaDuration()}getMediaDuration(){return this.ha?this.C.getMedia().duration:-1}getTrackManager(){return this.Ub}getPlaybackRate(){const a=this.C.getMedia();return a&&a.playbackRate||
493
+ 1}setPlaybackRate(a){const b=this.C.getMedia();void 0!==a&&b&&(b.playbackRate=a)}setSourceIndex(a){this.hd=a}getSourceIndex(){return this.hd}getLoadedSource(){return this.ha&&-1!==this.hd?this.ha[this.hd]:null}getPeriods(){return[]}getNetworkEngine(){return this.Tb}setNetworkEngine(a){this.Tb=a;pm(this.Tb,b=>{this.onError(b)})}setCmsdManager(a){this.yf=a}getTextDisplayer(){return this.P}getTimelineCues(){return[]}getCueTimeline(){return null}resetAbr(){}uh(a){var b=this.getSurface().getMedia();const c=
494
+ this.getPosition();let d="Received Video Element Event: '"+a.type+"' with playhead at: "+c;if(a.type===_.gg||a.type===_.uf)this.Zf.debug(d);else{let e="";switch(a.type){case _.wf:e=`Rate: ${this.getPlaybackRate()}`;break;case Sd:e=`Duration: ${this.getDuration()}`;break;case "volumechange":e=`Volume: ${this.getVolume()} Muted: ${this.isMuted()}`;break;case _.Xe:case _.hf:case "suspend":case _.Gg:case Pf:case _.Jf:case _.If:case _.gg:case _.uf:case Qc:case Rc:b=this.getBufferInfo().Pa(c);e=`State ${this.getSurface().getMedia().readyState} `+
495
+ `Buffer: ${b}`;break;case _.Bf:null!=b&&(e=`Size: ${b.videoWidth}x${b.videoHeight}`)}e&&(d+=". "+e);this.Zf.info(d)}a.type!==_.Xd&&this.trigger(new _.H(a.type,{detail:a}))}Yf(){}};_.ps=new Map;_.qs=new _.T("clpp.text");var rv=class{constructor(){this.a=null;this.f=[]}};var sv=class{constructor(){this.h=this.f=this.j=null;this.a=[]}};_.uv=class{constructor(){this.h=this.w=this.B=this.C=this.l=this.o=this.j=this.A=NaN;this.a=new rv;this.f=new sv}getStats(){return{width:this.A,height:this.j,streamBandwidth:this.w,decodedFrames:this.l,droppedFrames:this.o,corruptedFrames:this.C,estimatedBandwidth:this.h,loadLatency:this.B,playTime:us(this.a,3),pauseTime:us(this.a,4),bufferingTime:us(this.a,2),stateHistory:vs(this.a),switchHistory:ws(this.f)}}};var vv=class{constructor(a){this.g=new _.T("clpp.StateManager");this.m=a;this.a=new _.Vt;this.f=_.Hs;this.w=7;this.G=0;this.o=-1;this.J=this.l=this.H=this.A=0;this.h=this.ga=this.C=!1;this.F=0;this.j=null;this.I=0;this.K=_.bj();this.B=!1;this.H=Date.now();Bs(this)}getState(){return Ds(this,"")}destroy(){this.g.debug("Stop watching for video events for "+this.m.namespace());this.a.release()}};var wv=class extends _.qv{constructor(){super(md);this.w=this.G=!1;this.l=this.A=this.o=this.a=this.j=null;this.h=new _.Vt;this.F=this.B=this.f=this.H=null}init(a,b){super.init(a,b);this.j=new vv(this);zs(this.j,_.Hs)}namespace(){return md}unload(){const a=this;return _.w(function*(){if(a.ha){a.log.debug("Releasing player with source",a.ha);a.B&&(a.B.stop(),a.B=null);var b=a.getTrackManager();b&&b.release();a.A&&(a.A.destroy(),a.A=null);a.P&&(a.P.destroy(),a.P=null);a.l&&a.l.release();a.o&&(a.o.destroy(),
496
+ a.o=null);_.ai(a.h);a.f&&(a.f=new _.uv);a.F=null;a.ha=null;a.G=!1;a.a&&(a.a.removeAttribute("src"),a.a.load());if(a.w)throw new _.I(_.D,7,7E3);a.a&&(b=a.a,a.h.off(b,_.Xd),a.h.off(b,_.Bf),a.a=null)}})}release(){return super.release().then(()=>this.unload()).then(()=>{this.j&&zs(this.j,_.Hs)})}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();
497
+ a&&a.destroy();this.l&&(this.l.destroy().catch(b=>{this.log.warn("Error while disposing metadata handler",b)}),this.l=null);this.j&&(this.j.destroy(),this.j=null);this.f=null})}getDrmInfo(){return this.o?this.o.getDrmInfo():null}getTrackManager(){return this.Ub}load(a){const b=this;return _.w(function*(){if(b.w)return Promise.reject(new _.I(_.D,7,7E3));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()/
498
+ 1E3;b.f=new _.uv;b.h.on(b,_.Rf,()=>{b.f&&_.ts(b.f.a,b.getState())});zs(b.j,1);b.ha=_.jn(a);b.configuration=_.en([b.ia,a]);b.log.debug(_.Pa,b.configuration);b.log.debug(_.hb,b.ha);const d=_.ss(b.configuration,[_.ee,"native"]);b.P=d.create(b);b.P.setTextVisibility(!0);b.configuration.enableHtmlCue&&_.Ph(_.Xf)&&!_.dj()&&(b.A=new Fu(b),b.A.start(c));b.l?b.l.release():b.l=new su(b);c.textTracks&&No(b.l,c.textTracks);b.getTrackManager().load();c.loop=!!b.configuration.loop;_.z(b.configuration.volume)||
499
+ b.setVolume(b.configuration.volume);_.z(b.configuration.muted)||b.setMuted(b.configuration.muted);b.h.one(c,Qc,()=>{b.trigger(new _.H(_.hg))});null==b.configuration.startTime&&Ts(b,c);_.bj()&&Us(b,c);try{Ms(b,c),yield Ps(b),yield Ss(b).V}catch(e){b.G=!1,b.onError(e)}})}onError(a){this.G||(a.severity===_.D&&null!==this.j&&zs(this.j,_.As),this.trigger(new _.H(_.Xd,{detail:a})))}nh(){return new ov}getState(){return null!==this.j?this.j.getState().currentState:7}getPresentationStartTime(){if(this.a&&
500
+ this.a.getStartDate&&this.isLive()){const a=this.a.getStartDate();return isNaN(a.getTime())?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 _.xs();this.f&&_.ts(this.f.a,this.getState());var a=this.a,b=this.f,c=a.videoHeight;
501
+ b.A=a.videoWidth;b.j=c;a.getVideoPlaybackQuality&&(c=a.getVideoPlaybackQuality(),a=this.f,b=Number(c.totalVideoFrames),a.o=Number(c.droppedVideoFrames),a.l=b,this.f.C=Number(c.corruptedVideoFrames));if(a=this.getTrackManager())if(a=a.ta())a.bandwidth&&(this.f.w=a.bandwidth),a.wd&&(this.f.h=a.wd);return this.f.getStats()}getTimelineCues(){return this.l?this.l.getTimelineCues():[]}getCueTimeline(){return null}},xv=class{a(){return md}canPlay(a,b){a=a.type||"";const c=a===_.vc,d=a===_.Cc,e=a===_.xl;
502
+ var f;_.aj()||c||d||e&&!_.bj()?f=0:f=""!==Qi().canPlayType(a)?e&&_.bj()&&(window.ManagedMediaSource||window.MediaSource&&MediaSource.isTypeSupported)&&!b.streaming.preferNativeHlsOnSafari?1:2:0;return f}f(a){return a===_.na}create(){return new wv}};var yv=class extends S{constructor(a,b,c){super(a,b,c);a={manifest:{timeline:{version:2},keepTimelineLive:!0},streaming:{preferNativeHlsOnSafari:!1,enableLiveEdgeChasing:!1,startAtSegmentBoundary:!1}};this.C=_.hh(this.C,a);this.f=_.hh(this.f,a);this.G=0;this.o=[];this.U=!1;this.w=null;this.J=[]}Li(a,b){const c=this;return _.w(function*(){if(c.w)throw new _.I(_.D,7,7008,`Cannot call openPlaylist() while ${c.w}() is ongoing!`);if(0!==a)throw new _.I(_.D,7,7007,"The index parameter only supports the value of 0.");
503
+ if(0===b.length)throw new _.I(_.D,7,7003,Ya);if(b.some(g=>!g.id||!g.source))throw new _.I(_.D,7,7100,"Some config is missing required properties `id` or `source`!");if((new Set(b.map(g=>g.id))).size!==b.length)throw new _.I(_.D,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 _.I(_.D,7,7100,"Unsupported `playlist.timeline` config value!");e=d.startTime;if(null!=e&&(typeof e!==_.r||0>e))throw new _.I(_.D,
504
+ 7,7100,"Invalid `playlist.startTime` config value!");f=d.endTime;if(null!=f&&(typeof f!==_.r||0>f||null!=e&&f<=e))throw new _.I(_.D,7,7100,"Invalid `playlist.endTime` config value!");if("DVR"===d.content&&!f)throw new _.I(_.D,7,7100,"`playlist.endTime` config value is required for DVR content!");}try{Vs(c),c.w="openPlaylist",yield Ys(c,b),c.G=0,c.o=b,c.U=!0,Zs(c,b[0].playlist||{})}finally{c.w=null}})}yh(a){const b=this;return _.w(function*(){if(b.w)throw new _.I(_.D,7,7008,`Cannot call addItem() while ${b.w}() is ongoing!`);
505
+ if(!b.U)throw new _.I(_.D,7,7008,"openPlaylist() must be called before addItem()!");if(!a.id||!a.source)throw new _.I(_.D,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 _.I(_.D,7,7100,"A config with this `id` already exists in the playlist!");try{b.w="addItem",b.o.push(a),yield $s(b,a)}finally{b.w=null}})}getCurrentItem(){return this.o[this.G]||null}getCurrentItemIndex(){return this.G}ii(){return[...this.o]}Jd(){return this.o.length}getTimeline(){return this.a?
506
+ this.a.getTimeline():null}seekWith(a){return this.a?this.a.seekWith(a):Promise.resolve()}release(){this.o=[];this.G=0;this.U=!1;return super.release()}destroy(){Vs(this);return super.destroy()}setCdnErrorCallback(){throw new _.I(1,7,7009,"CDN switching is not supported!");}};_.x("clpp.playlist.ScPlaylist",yv);yv.prototype.setCdnErrorCallback=yv.prototype.setCdnErrorCallback;yv.prototype.destroy=yv.prototype.destroy;yv.prototype.release=yv.prototype.release;yv.prototype.seekWith=yv.prototype.seekWith;
507
+ yv.prototype.getTimeline=yv.prototype.getTimeline;yv.prototype.getSize=yv.prototype.Jd;yv.prototype.getPlaylist=yv.prototype.ii;yv.prototype.getCurrentItemIndex=yv.prototype.getCurrentItemIndex;yv.prototype.getCurrentItem=yv.prototype.getCurrentItem;yv.prototype.addItem=yv.prototype.yh;yv.prototype.openPlaylist=yv.prototype.Li;var zv=class extends _.Yt{constructor(a){super();this.ka=_.hh({transition:_.Te,preloadMedia:!1},a);this.h=[];this.a=0;const b=at(a.anchorId,this.ka.config);this.o=new $t(b);this.f=null;this.j=!1;this.l=new Map;this.w=a.toggleVisible;this.g=new _.T(nd);this.o.a.forEach(c=>bt(this,c.player,!1))}Mb(){return this.f}we(){return this.f?this.f.player:null}yg(){return this.l.get(this.a+1)||null}Ag(){return this.l.get(this.a-1)||null}zg(){return[this.Ag(),this.yg()].filter(Boolean)}aj(a){if(0<this.h.length)throw Error("Cannot re-set items in the playlist");
508
+ this.g.info("Set items",a);this.h=a.map((b,c)=>({config:b,index:c,preloadPromise:Promise.resolve(),disposers:[]}))}$i(a){if(0===this.h.length)throw Error(Wa);if(0>a||a>this.h.length-1)throw Error("Index out of bounds");this.a=a}Md(){return this.a<this.h.length-1}Eg(){return 0<this.a}Ni(){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(Wa);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})`),
509
+ yield et(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,it(a)}}})}Vg(){const a=this;return _.w(function*(){if(a.j)a.g.warn("Cannot play next item while busy");else if(a.Md()){a.j=!0;a.a+=1;a.g.info(`Next (index: ${a.a})`);var b=a.f;a.ka.transition===_.Te&&b.player.pause();nt(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 jt(a,c),a.g.info(`Next playing (index: ${a.a})`)}catch(d){throw a.g.error(`Next failed (index: ${a.a})`),
510
+ d;}finally{a.j=!1,b&&(yield mt(a,b)),it(a)}}else a.g.warn("There are no more items in the playlist")})}Oi(){const a=this;return _.w(function*(){if(a.j)a.g.warn("Cannot play previous item while busy");else if(a.Eg()){a.j=!0;--a.a;a.g.info(`Previous (index: ${a.a})`);var b=a.f;a.ka.transition===_.Te&&b.player.pause();nt(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 jt(a,c),a.g.info(`Previous playing (index: ${a.a})`)}catch(d){throw a.g.error(`Previous failed (index: ${a.a})`),
511
+ d;}finally{a.j=!1,b&&(yield mt(a,b)),it(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([ot(a),a.f?mt(a,a.f):Promise.resolve()]);yield pt(a)})}};_.x(nd,zv);zv.prototype.destroy=zv.prototype.destroy;zv.prototype.playPrev=zv.prototype.Oi;zv.prototype.playNext=zv.prototype.Vg;zv.prototype.playFirst=zv.prototype.Ni;zv.prototype.hasPrev=zv.prototype.Eg;zv.prototype.hasNext=zv.prototype.Md;
512
+ zv.prototype.setIndex=zv.prototype.$i;zv.prototype.setItems=zv.prototype.aj;zv.prototype.getPreloading=zv.prototype.zg;zv.prototype.getPrev=zv.prototype.Ag;zv.prototype.getNext=zv.prototype.yg;zv.prototype.getCurrentPlayer=zv.prototype.we;zv.prototype.getCurrent=zv.prototype.Mb;var lt="preload",ct=_.ue;var qt=new Map;var Cv=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]===_.Ec;if(!window.muxjs||!c&&!d)return!1;if(d)return _.rt(Ic);if(b)return _.rt(st(b,a));b=st(_.q,a);a=st(_.t,a);return _.rt(b)||_.rt(a)}isMuxed(a,b){return 1<this.demuxMimeTypes(a,b).size}demuxMimeTypes(a,
513
+ b){const c=new Map;c.set(a,b);try{const d=_.Ym(b),e=_.Zm(b).split(","),f=new Map,g=Wm(_.q,e),h=Wm(_.t,e);g&&f.set(_.q,this.convertCodecs(_.q,_.Xm(d,g)));h&&f.set(_.t,this.convertCodecs(_.t,_.Xm(d,h)));return f}catch(d){return c}}convertCodecs(a,b){return b.toLowerCase().split(";")[0]===_.Ec?Ic:"mp2t"===b.toLowerCase().split(";")[0].split("/")[1]?st(a,b):b}getOriginalMimeType(){return this.h}transmux(a){const b=[],c=[];let d=[],e=null;a=_.G(a);const f=h=>{d=h.captions;const k=new Uint8Array(h.data.byteLength+
514
+ h.initSegment.byteLength);k.set(h.initSegment,0);k.set(h.data,h.initSegment.byteLength);h.type===Av?b.push(k):h.type===Bv&&c.push(k)},g=()=>{e={video:_.im(...b),captions:d,audio:_.im(...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 _.I(_.D,3,3018);return e}},Bv=_.q,Av=_.t;var Dv=class{getCuePoints(){}Qb(){}Pb(){}};_.x("clpp.ads.IAdsTimeline",Dv);Dv.prototype.hasPostroll=Dv.prototype.Pb;Dv.prototype.hasPreroll=Dv.prototype.Qb;Dv.prototype.getCuePoints=Dv.prototype.getCuePoints;_.Ev=class{install(){}uninstall(){}beforeLoad(){}afterLoad(){}playerConstructed(){}};var Hv=class extends _.Op{constructor(a,b,c,d,e){super(Ja);this.l=a;this.j=b;this.h=c;this.a=d;this.o=e;this.g=new _.T(jd);_.Bi(this.l)?this.g.warn(_.Ib):this.Ga(_.wd,{licenseUrl:this.l,videoRobustness:[_.pb,void 0],audioRobustness:[_.ob,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.Ud.bind(this)}});_.Bi(this.j)?this.g.warn(_.fb):this.Ga(_.ud,{licenseUrl:this.j,videoRobustness:["3000"],audioRobustness:["2000"],modifiers:{licenseRequest:this.Ud.bind(this)}});
515
+ _.Bi(this.h)?this.g.warn(_.Ea):_.Bi(this.a)?this.g.warn(_.Da):this.Ga(_.sd,{licenseUrl:this.h,certificateUrl:this.a,modifiers:{licenseRequest:this.Qg.bind(this),licenseResponse:this.Rg.bind(this),certificateRequest:this.Ud.bind(this),extractContentId:this.tg.bind(this)}})}Ud(a,b){a=a.drm.customData.headers||{};for(const c of Object.keys(a))b.headers[c]=a[c]}tg(a,b){a=kp(b);switch(this.o){case Fv:return a;case Gv:return(new _.lp(a)).a;default:throw Error("Unknown content ID strategy");}}Qg(a,b){b.headers[ta]=
516
+ Dc;this.Ud(a,b);a={spc:_.cm(b.body)};b.body=_.xi(_.Rm(a,!0))}Rg(a,b){a=_.ri(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=_.em(a).buffer}};_.x(jd,Hv);Hv.prototype.onFairPlayLicenseResponse=Hv.prototype.Rg;Hv.prototype.onFairPlayLicenseRequest=Hv.prototype.Qg;Hv.prototype.extractFairPlayContentId=Hv.prototype.tg;Hv.prototype.onLicenseRequest=Hv.prototype.Ud;Hv.prototype.constructor=Hv.prototype.constructor;Hv.NAME=Ja;
517
+ var Gv="hostname",Fv="full-skd";Hv.FairPlayContentIdStrategy={HOSTNAME:Gv,FULL_SKD:Fv};_.x("clpp.drm.HeaderDrmComponent",class extends _.Ev{beforeLoad(a){a=a.getConfiguration();if(a.drm&&a.drm&&a.drm.env===Ja){a=a.drm.customData;if(!a)throw new _.I(_.D,7,7100,_.xd);a=new Hv(a.widevineLicenseUrl,a.playReadyLicenseUrl,a.fairPlayLicenseUrl,a.fairPlayCertificateUrl,a.fairPlayContentIdStrategy||Fv);_.nn(a)}}uninstall(){delete _.mn.HeaderDrm}id(){return"headerdrm"}});var At;_.Iv=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 Jv;_.Kv=class{constructor(){this.a=new Blob([Jv],{type:_.Ag})}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 _.Kl;b=b.play();const d=(new _.Pi(()=>{d.stop();c.resolve(a)})).la(.25);void 0!==b?b.then(()=>{d.stop();c.resolve(!0)}).catch(e=>{e&&e.message&&e.message===cb?(d.stop(),c.resolve(!0)):(d.stop(),c.resolve(!1))}):(d.stop(),c.resolve(!0));return c}};
518
+ Jv=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,
516
519
  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,
517
520
  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,
518
521
  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,
519
522
  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,
520
523
  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,
521
- 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]);_.tt={};_.Hv=class{constructor(a){a=a.getConfiguration();a=_.dh(a.textStyle||a.textstyle||{});this.K=typeof a.backgroundColor===_.Tf?a.backgroundColor:null;this.R=typeof a.windowColor===_.Tf?a.windowColor:null;this.M=typeof a.fontColor===_.Tf?a.fontColor:null;this.N=typeof a.fontFamily===_.Tf?a.fontFamily:null;this.I=typeof a.fontSize===_.Tf?a.fontSize:null;this.C=typeof a.fontSizePercent===_.r?a.fontSizePercent:null;this.H=typeof a.edgeColor===_.Tf?a.edgeColor:"rgba(0, 0, 0, 1)";this.w=null;typeof a.edgeType===
522
- _.Tf&&(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.N}setFontFamily(a){this.N=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?Gv:this.C}setFontSizePercent(a){this.C=a;this.h()}getEdgeColor(){return this.H}setEdgeColor(a){this.H=
523
- a;this.h()}getEdgeType(){return this.w}setEdgeType(a){this.w=a;this.h()}};_.Hv.prototype.setEdgeType=_.Hv.prototype.setEdgeType;_.Hv.prototype.getEdgeType=_.Hv.prototype.getEdgeType;_.Hv.prototype.setEdgeColor=_.Hv.prototype.setEdgeColor;_.Hv.prototype.getEdgeColor=_.Hv.prototype.getEdgeColor;_.Hv.prototype.setFontSizePercent=_.Hv.prototype.setFontSizePercent;_.Hv.prototype.getFontSizePercent=_.Hv.prototype.getFontSizePercent;_.Hv.prototype.setFontSize=_.Hv.prototype.setFontSize;
524
- _.Hv.prototype.getFontSize=_.Hv.prototype.getFontSize;_.Hv.prototype.setFontColor=_.Hv.prototype.setFontColor;_.Hv.prototype.getFontColor=_.Hv.prototype.getFontColor;_.Hv.prototype.setFontFamily=_.Hv.prototype.setFontFamily;_.Hv.prototype.getFontFamily=_.Hv.prototype.getFontFamily;_.Hv.prototype.setWindowColor=_.Hv.prototype.setWindowColor;_.Hv.prototype.getWindowColor=_.Hv.prototype.getWindowColor;_.Hv.prototype.setBackgroundColor=_.Hv.prototype.setBackgroundColor;
525
- _.Hv.prototype.getBackgroundColor=_.Hv.prototype.getBackgroundColor;var Gv=1/15;var Iv;
526
- _.Jv=class extends _.Hv{constructor(a){super(a);this.o=a.getSurface().getMedia();this.f=`clpp-video-${Iv++}`;this.j=document.createElement(_.Vf);this.l=this.A=!1;_.Ci(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":_.Bt(this)},b=
527
- 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()}};Iv=0;var Kv=class{a(){return!0}create(a){return new _.Jv(a)}};var Lv=class{constructor(a){this.f=a;this.a=null;this.g=new _.T("clpp.text.Mp4TextParser")}parseInit(a){let b;try{const c=_.vt(_.zc);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=_.vt(_.Ac);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=
528
- b;else throw new _.I(_.D,2,2011);}}parseMedia(a,b){if(!this.a)throw new _.I(_.D,2,2011);return this.a.parseMedia(a,b)}};_.tm(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=_.G(c);a=new Uint8Array(this,a,b-a);d.set(a);return c})});
529
- _.tm(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;$d in document||(Object.defineProperty(document,$d,{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement}}),Object.defineProperty(document,"fullscreenEnabled",
530
- {get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitSupportsFullscreen||document.webkitFullscreenEnabled}}));document.addEventListener("webkitfullscreenchange",jt);document.addEventListener("webkitfullscreenerror",jt);document.addEventListener("mozfullscreenchange",jt);document.addEventListener("mozfullscreenerror",jt);document.addEventListener("MSFullscreenChange",jt);document.addEventListener("MSFullscreenError",jt)}});
531
- _.tm(function(){_.xh("InputEvent.install");_.Oi("Trident/")&&HTMLInputElement.prototype.addEventListener!==rt&&(_.wh("Patching input event support on IE."),qt=HTMLInputElement.prototype.addEventListener,HTMLInputElement.prototype.addEventListener=rt)});_.tm(function(){navigator.languages||Object.defineProperty(navigator,"languages",{get:()=>navigator.language?[navigator.language]:["en"]})});_.tm(function(){_.xh("mathRound.install")});
532
- _.tm(function(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;a.requestPictureInPicture&&document.exitPictureInPicture||!a.webkitSupportsPresentationMode||(_.xh("PiPWebkit.install"),document.pictureInPictureEnabled=!0,document.pictureInPictureElement=null,a.requestPictureInPicture=lt,document.exitPictureInPicture=mt,document.addEventListener("webkitpresentationmodechanged",kt,!0))}});
533
- _.tm(function(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.getVideoPlaybackQuality&&"webkitDroppedFrameCount"in a&&(a.getVideoPlaybackQuality=nt)}});_.tm(function(){_.xh("VideoPlayPromise.install");if(window.HTMLMediaElement){const a=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){const b=a.apply(this);b&&b.catch(()=>{});return b}}});
534
- _.tm(function(){if(window.VTTCue)_.wh("Using native VTTCue.");else if(window.TextTrackCue){var a=TextTrackCue.length;if(3===a)_.wh(Cb),window.VTTCue=ot;else if(6===a)_.wh("Using VTTCue polyfill from 6 argument TextTrackCue."),window.VTTCue=pt;else{try{var b=!!ot(1,2,"")}catch(c){b=!1}b&&(_.wh(Cb),window.VTTCue=ot)}}else _.yh("VTTCue not available.")});_.Bh(new rv);_.ut(_.yc,Lv);_.hs("native",new Kv);Am(_.Ec,()=>new xv(_.Ec));Am(_.yg,()=>new xv(_.yg));_.Mv=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}Ub(){return this.f}Fd(){return this.h}Rc(a){return this.getId()===a.getId()&&this.Ub()===a.Ub()&&this.getDuration()===a.getDuration()&&this.Fd()===a.Fd()}};_.x("clpp.media.TimelineWindow",_.Mv);_.Mv.prototype.isDynamic=_.Mv.prototype.Fd;_.Mv.prototype.getStart=_.Mv.prototype.Ub;_.Mv.prototype.getId=_.Mv.prototype.getId;_.Mv.prototype.getDuration=_.Mv.prototype.getDuration;_.Nv=new _.T("clpp.media.TimestampParser");_.Ov=class{constructor(){this.a=[];this.f=-1;this.h=null}$h(a){return this.a[a]||null}ai(){return this.a.length}bi(){return this.a}lg(){return this.a[this.f]||null}Uh(){return this.f}};_.x("clpp.media.Timeline",_.Ov);_.Ov.prototype.getCurrentWindowIndex=_.Ov.prototype.Uh;_.Ov.prototype.getCurrentWindow=_.Ov.prototype.lg;_.Ov.prototype.getWindows=_.Ov.prototype.bi;_.Ov.prototype.getWindowCount=_.Ov.prototype.ai;_.Ov.prototype.getWindow=_.Ov.prototype.$h;_.Et={};_.Ft={};var xt="raised",yt="depressed",At="dropshadow",zt="uniform";_.x("clpp.text.EdgeType",{NONE:_.Ge,RAISED:xt,DEPRESSED:yt,DROP_SHADOW:At,UNIFORM:zt});_.Pv=class{onPlayerCreated(){}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;
524
+ 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]);_.Dt={};_.Mv=class{constructor(a){a=a.getConfiguration();a=_.ih(a.textStyle||a.textstyle||{});this.K=typeof a.backgroundColor===_.Uf?a.backgroundColor:null;this.R=typeof a.windowColor===_.Uf?a.windowColor:null;this.M=typeof a.fontColor===_.Uf?a.fontColor:null;this.P=typeof a.fontFamily===_.Uf?a.fontFamily:null;this.I=typeof a.fontSize===_.Uf?a.fontSize:null;this.C=typeof a.fontSizePercent===_.r?a.fontSizePercent:null;this.H=typeof a.edgeColor===_.Uf?a.edgeColor:"rgba(0, 0, 0, 1)";this.w=null;typeof a.edgeType===
525
+ _.Uf&&(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.P}setFontFamily(a){this.P=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?Lv:this.C}setFontSizePercent(a){this.C=a;this.h()}getEdgeColor(){return this.H}setEdgeColor(a){this.H=
526
+ a;this.h()}getEdgeType(){return this.w}setEdgeType(a){this.w=a;this.h()}};_.Mv.prototype.setEdgeType=_.Mv.prototype.setEdgeType;_.Mv.prototype.getEdgeType=_.Mv.prototype.getEdgeType;_.Mv.prototype.setEdgeColor=_.Mv.prototype.setEdgeColor;_.Mv.prototype.getEdgeColor=_.Mv.prototype.getEdgeColor;_.Mv.prototype.setFontSizePercent=_.Mv.prototype.setFontSizePercent;_.Mv.prototype.getFontSizePercent=_.Mv.prototype.getFontSizePercent;_.Mv.prototype.setFontSize=_.Mv.prototype.setFontSize;
527
+ _.Mv.prototype.getFontSize=_.Mv.prototype.getFontSize;_.Mv.prototype.setFontColor=_.Mv.prototype.setFontColor;_.Mv.prototype.getFontColor=_.Mv.prototype.getFontColor;_.Mv.prototype.setFontFamily=_.Mv.prototype.setFontFamily;_.Mv.prototype.getFontFamily=_.Mv.prototype.getFontFamily;_.Mv.prototype.setWindowColor=_.Mv.prototype.setWindowColor;_.Mv.prototype.getWindowColor=_.Mv.prototype.getWindowColor;_.Mv.prototype.setBackgroundColor=_.Mv.prototype.setBackgroundColor;
528
+ _.Mv.prototype.getBackgroundColor=_.Mv.prototype.getBackgroundColor;var Lv=1/15;var Nv;
529
+ _.Ov=class extends _.Mv{constructor(a){super(a);this.o=a.getSurface().getMedia();this.f=`clpp-video-${Nv++}`;this.j=document.createElement(_.Wf);this.l=this.A=!1;_.Gi(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":_.Lt(this)},b=
530
+ 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()}};Nv=0;var Pv=class{a(){return!0}create(a){return new _.Ov(a)}};var Qv=class{constructor(a){this.f=a;this.a=null;this.g=new _.T("clpp.text.Mp4TextParser")}parseInit(a){let b;try{const c=_.Ft(_.zc);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=_.Ft(_.Ac);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=
531
+ b;else throw new _.I(_.D,2,2011);}}parseMedia(a,b){if(!this.a)throw new _.I(_.D,2,2011);return this.a.parseMedia(a,b)}};_.xm(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=_.G(c);a=new Uint8Array(this,a,b-a);d.set(a);return c})});
532
+ _.xm(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;$d in document||(Object.defineProperty(document,$d,{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement}}),Object.defineProperty(document,"fullscreenEnabled",
533
+ {get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitSupportsFullscreen||document.webkitFullscreenEnabled}}));document.addEventListener("webkitfullscreenchange",tt);document.addEventListener("webkitfullscreenerror",tt);document.addEventListener("mozfullscreenchange",tt);document.addEventListener("mozfullscreenerror",tt);document.addEventListener("MSFullscreenChange",tt);document.addEventListener("MSFullscreenError",tt)}});
534
+ _.xm(function(){_.Ch("InputEvent.install");_.Si("Trident/")&&HTMLInputElement.prototype.addEventListener!==Bt&&(_.Bh("Patching input event support on IE."),At=HTMLInputElement.prototype.addEventListener,HTMLInputElement.prototype.addEventListener=Bt)});_.xm(function(){navigator.languages||Object.defineProperty(navigator,"languages",{get:()=>navigator.language?[navigator.language]:["en"]})});_.xm(function(){_.Ch("mathRound.install")});
535
+ _.xm(function(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;a.requestPictureInPicture&&document.exitPictureInPicture||!a.webkitSupportsPresentationMode||(_.Ch("PiPWebkit.install"),document.pictureInPictureEnabled=!0,document.pictureInPictureElement=null,a.requestPictureInPicture=vt,document.exitPictureInPicture=wt,document.addEventListener("webkitpresentationmodechanged",ut,!0))}});
536
+ _.xm(function(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.getVideoPlaybackQuality&&"webkitDroppedFrameCount"in a&&(a.getVideoPlaybackQuality=xt)}});_.xm(function(){_.Ch("VideoPlayPromise.install");if(window.HTMLMediaElement){const a=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){const b=a.apply(this);b&&b.catch(()=>{});return b}}});
537
+ _.xm(function(){if(window.VTTCue)_.Bh("Using native VTTCue.");else if(window.TextTrackCue){var a=TextTrackCue.length;if(3===a)_.Bh(Db),window.VTTCue=yt;else if(6===a)_.Bh("Using VTTCue polyfill from 6 argument TextTrackCue."),window.VTTCue=zt;else{try{var b=!!yt(1,2,"")}catch(c){b=!1}b&&(_.Bh(Db),window.VTTCue=yt)}}else _.Dh("VTTCue not available.")});_.Gh(new xv);_.Et(_.wc,Qv);_.rs("native",new Pv);Em(_.Ec,()=>new Cv(_.Ec));Em(_.zg,()=>new Cv(_.zg));_.Rv=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}Xb(){return this.f}Pd(){return this.h}Zc(a){return this.getId()===a.getId()&&this.Xb()===a.Xb()&&this.getDuration()===a.getDuration()&&this.Pd()===a.Pd()}};_.x("clpp.media.TimelineWindow",_.Rv);_.Rv.prototype.isDynamic=_.Rv.prototype.Pd;_.Rv.prototype.getStart=_.Rv.prototype.Xb;_.Rv.prototype.getId=_.Rv.prototype.getId;_.Rv.prototype.getDuration=_.Rv.prototype.getDuration;_.Sv=new _.T("clpp.media.TimestampParser");_.Tv=class{constructor(){this.a=[];this.f=-1;this.h=null}ki(a){return this.a[a]||null}li(){return this.a.length}mi(){return this.a}xg(){return this.a[this.f]||null}ei(){return this.f}};_.x("clpp.media.Timeline",_.Tv);_.Tv.prototype.getCurrentWindowIndex=_.Tv.prototype.ei;_.Tv.prototype.getCurrentWindow=_.Tv.prototype.xg;_.Tv.prototype.getWindows=_.Tv.prototype.mi;_.Tv.prototype.getWindowCount=_.Tv.prototype.li;_.Tv.prototype.getWindow=_.Tv.prototype.ki;_.Ot={};_.Pt={};var Ht="raised",It="depressed",Kt="dropshadow",Jt="uniform";_.x("clpp.text.EdgeType",{NONE:_.He,RAISED:Ht,DEPRESSED:It,DROP_SHADOW:Kt,UNIFORM:Jt});_.Uv=class{onPlayerCreated(){}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;