@castlabs/prestoplay 6.34.0 → 6.35.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/cjs/cl.adobe.js +3 -3
  2. package/cjs/cl.airplay.js +3 -3
  3. package/cjs/cl.broadpeak.js +18 -18
  4. package/cjs/cl.cast.js +125 -125
  5. package/cjs/cl.conviva.js +31 -31
  6. package/cjs/cl.core.js +579 -577
  7. package/cjs/cl.crypto.js +9 -9
  8. package/cjs/cl.dash.js +100 -100
  9. package/cjs/cl.freewheel.js +26 -26
  10. package/cjs/cl.hls.js +76 -76
  11. package/cjs/cl.hlssmpte.js +6 -6
  12. package/cjs/cl.htmlcue.js +30 -30
  13. package/cjs/cl.ima.js +25 -25
  14. package/cjs/cl.mediatailor.js +3 -3
  15. package/cjs/cl.mse.js +345 -345
  16. package/cjs/cl.muxdata.js +13 -13
  17. package/cjs/cl.onboard.js +4 -4
  18. package/cjs/cl.persistent.js +14 -14
  19. package/cjs/cl.playlist.js +5 -5
  20. package/cjs/cl.simid.js +16 -16
  21. package/cjs/cl.smooth.js +70 -70
  22. package/cjs/cl.thumbnails.js +25 -25
  23. package/cjs/cl.tizen.js +67 -67
  24. package/cjs/cl.ttml.js +29 -29
  25. package/cjs/cl.verimatrix.js +5 -5
  26. package/cjs/cl.vimond.js +8 -8
  27. package/cjs/cl.vr.js +19 -19
  28. package/cjs/cl.vtt.js +14 -14
  29. package/cjs/cl.yospace.js +3 -3
  30. package/cjs/cl.youbora.js +38 -38
  31. package/cl.adobe.js +3 -3
  32. package/cl.airplay.js +3 -3
  33. package/cl.broadpeak.js +14 -14
  34. package/cl.cast.js +97 -97
  35. package/cl.conviva.js +28 -27
  36. package/cl.core.js +463 -462
  37. package/cl.crypto.js +8 -8
  38. package/cl.dash.js +89 -89
  39. package/cl.freewheel.js +20 -20
  40. package/cl.hls.js +82 -82
  41. package/cl.hlssmpte.js +5 -5
  42. package/cl.htmlcue.js +26 -26
  43. package/cl.ima.js +19 -19
  44. package/cl.mediatailor.js +2 -2
  45. package/cl.mse.js +299 -299
  46. package/cl.muxdata.js +11 -11
  47. package/cl.onboard.js +5 -5
  48. package/cl.persistent.js +10 -10
  49. package/cl.playlist.js +5 -5
  50. package/cl.simid.js +14 -14
  51. package/cl.smooth.js +60 -60
  52. package/cl.thumbnails.js +17 -17
  53. package/cl.tizen.js +55 -55
  54. package/cl.ttml.js +22 -22
  55. package/cl.verimatrix.js +4 -4
  56. package/cl.vimond.js +7 -7
  57. package/cl.vr.js +14 -14
  58. package/cl.vtt.js +12 -12
  59. package/cl.yospace.js +3 -3
  60. package/cl.youbora.js +31 -31
  61. package/package.json +1 -1
package/cl.cast.js CHANGED
@@ -1,103 +1,103 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var fV="Cannot seek during ads playout.",gV="Cannot switch track",hV="Media session does not exist.",iV="No receivers available",jV="QUEUE_ITEM_CHANGED",kV="Reset ABR functionality not available on cast.",lV="SDK not yet ready",mV="Sender is destroyed.",nV="clpp.cast.CastProxy",oV="clpp.cast.Player",pV="clpp.cast.Receiver",qV="urn:x-cast:castlabs",rV="urn:x-cast:castlabs:int",sV="urn:x-cast:com.google.cast.media",tV="volume control is not supported",uV=function(a){return _.v(function*(){yield _.$r(a,
2
- _.He);yield _.$r(a,_.Ge)})},vV=function(a){return JSON.stringify(a,(b,c)=>{if("license"!==b&&typeof c!==_.Wd){if(c instanceof Event){b={};for(const d in c){const e=c[d];typeof e===_.Ce?"detail"===d&&(b[d]=e):d in Event||(b[d]=e)}return b}return typeof c===_.r?isNaN(c)?"NaN":isFinite(c)?c:0>c?"-Infinity":"Infinity":c}})},wV=function(a){if(typeof a!==_.Of)return a;try{return JSON.parse(a,(b,c)=>"NaN"===c?NaN:"-Infinity"===c?-Infinity:"Infinity"===c?Infinity:c)}catch(b){return a}},xV=function(a,b){const c=
3
- new Set(b);return Object.keys(a).reduce((d,e)=>{c.has(e)&&(d[e]=a[e]);return d},{})},yV=function(a,b,c,d){return _.v(function*(){if(b.includes(a.mimeType))return a;var e=null;let f=null,g=null;for(var h=0;h<b.length&&!f;)g=b[h++],f=_.Nl(d,a.mimeType,g);f&&g&&(h=_.ek(a.url),(h=yield c.fetch(h).V)&&h.data&&(e=f.a(_.E(h.data)),e={url:URL.createObjectURL(new Blob([e])),kind:a.kind,language:a.language,label:a.label,mimeType:g}));return e})},zV=function(a,b){let c,d;if(window.chrome&&chrome.cast&&chrome.cast.media)c=
4
- chrome.cast.media.HlsSegmentFormat,d=chrome.cast.media.HlsVideoSegmentFormat;else if(window.cast&&cast.framework&&cast.framework.messages)c=cast.framework.messages.HlsSegmentFormat,d=cast.framework.messages.HlsVideoSegmentFormat;else return;switch(a){case _.qg:return d.FMP4;case _.pg:return b===_.N?d.MPEG2_TS:c.TS;case _.Dc:return c.AAC;case _.Ec:return c.AC3;case _.Fc:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.Gc:return c.FMP4}},BV=function(a){a=void 0===a?AV:a;var b=cast.framework.messages||
5
- chrome.cast.media;if(!b)throw new _.J(1,8,8001);const c=b.MetadataType,d=b.GenericMediaMetadata,e=b.MovieMediaMetadata,f=b.TvShowMediaMetadata,g=b.MusicTrackMediaMetadata,h=b.PhotoMediaMetadata;b=b.AudiobookChapterMediaMetadata;switch(a){case c.MOVIE:return new e;case c.TV_SHOW:return new f;case c.MUSIC_TRACK:return new g;case c.PHOTO:return new h;case c.AUDIOBOOK_CHAPTER:return new b;default:return new d}},CV=function(){return Math.round(1E3*Math.random())},DV=function(a,b){return a.h.filter(c=>
6
- c.type===b)},FV=function(a,b){const c=EV(a);return DV(a,b).find(d=>c.includes(d.id))||null},HV=function(a,b,c){const d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.L){const e=a.ua();e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,()=>{a.f[b]=null;GV(a,b)},e=>{a.f[b]=null;a.g.debug(gV,e)})}else b===_.L&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,()=>{GV(a,b)},e=>{a.g.debug(gV,e)}))},EV=function(a){a=a.a?a.a.a:null;return(a?
7
- a.activeTrackIds||[]:[]).map(b=>b.toString())},GV=function(a,b){b===_.M?a.a.trigger(new _.H(_.Jc)):b===_.L&&a.a.trigger(new _.H(_.Vf))},MV=function(a){if(a){for(const b of IV)JV(b);KV=!0;for(const b of LV)b()}},JV=function(a){if(!a.f&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&cast.framework&&cast.framework.CastContext&&a.S.length){a.o=new cast.framework.RemotePlayer;var b=new cast.framework.RemotePlayerController(a.o);a.F.on(b,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,
8
- a.Aa.bind(a));a.F.on(b,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,a.Jb.bind(a));a.f=!0;a.L.resolve();a.w.Ef();b=cast.framework.CastContext.getInstance();var c=new cast.framework.CastOptions;c.receiverApplicationId=a.S;c.autoJoinPolicy=chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED;b.setOptions(c);b.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.M);b.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.da);NV&&a.w.la(.02)}},OV=function(a){return _.v(function*(){a.F.release();
9
- IV.delete(a);if(a.f){a.f=!1;var b=cast.framework.CastContext.getInstance();b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.M);b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.da)}b=[];a.h&&(b.push(a.h.destroy()),a.h=null);a.l&&(b.push(a.l.destroy()),a.l=null);yield Promise.all(b);a.A=!1;a.w&&(a.w.stop(),a.w=null);a.R=null;a.Z=null})},PV=function(a){return _.v(function*(){a.ya()||(yield cast.framework.CastContext.getInstance().requestSession())})},
10
- RV=function(a,b,c){c=void 0===c?0:c;return _.v(function*(){var d=a.h.ua();d&&d.language&&(a.j.preferredTextLanguage=d.language);(d=a.h.ra())&&d.language&&(a.j.preferredAudioLanguage=d.language);yield QV(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),mf:a.getPresentationStartTime(),autoplay:b,Fa:a.j})})},QV=function(a,b){return _.v(function*(){if(a.f){var c=chrome.cast.media.StreamType;yield PV(a);if(b){var d=cast.framework.CastContext.getInstance().getCurrentSession(),e=new chrome.cast.media.MediaInfo(b.source.url,
11
- b.source.type);e.streamType=b.isLive?c.LIVE:c.BUFFERED;c=b.audioMimeType;e.hlsVideoSegmentFormat=zV(b.videoMimeType,_.N);e.hlsSegmentFormat=zV(c,_.M);b.Fa&&(a.J&&(c=yield Promise.resolve(a.J(b.Fa)))&&(b.Fa=c),a.j=b.Fa,a.C=_.bp(a.j),a.B=a.C.findIndex(k=>k.url===b.source.url),b.Fa.remoteTextTracks&&(c=yield Promise.all(b.Fa.remoteTextTracks.map(a.cb.bind(a))),e.tracks=c.filter(k=>k),b.Fa.remoteTextTracks=void 0),delete b.Fa.autoplay,b.Fa.startTime=null,e.customData={playerConfiguration:vV(b.Fa)});c=
12
- a.Lb()||{};var f=SV(c.metadataType),g;typeof b.mf===_.r&&(g={metadataType:f,sectionStartAbsoluteTime:b.mf});var h;b.source.name&&(h={metadataType:f,title:b.source.name});c=TV(c);if(g=UV(Object.assign({},g,h,c)))e.metadata=g;e=new chrome.cast.media.LoadRequest(e);(g=b.queueData)&&g.items&&0<g.items.length&&(h=new chrome.cast.media.QueueData,h.items=g.items,h.startIndex=g.startIndex,e.queueData=h);typeof b.autoplay===_.Mc&&(e.autoplay=b.autoplay);typeof b.currentTime===_.r&&(e.currentTime=b.currentTime);
13
- yield d.loadMedia(e);null!=b.Fa.muted&&a.setMuted(b.Fa.muted);null!=b.Fa.volume&&a.setVolume(b.Fa.volume)}}})},UV=function(a){if(!a)return null;a:{var b=a.metadataType;const c=Object.entries(VV);for(const d of c){const [e,f]=d;if(f===b){b=e;break a}}b=null}if(!b)return null;b=BV(VV[b]);return Object.assign(b,a)},SV=function(a){var b=void 0===b?AV:b;return Object.values(VV).includes(a)?a:b},TV=function(a){const b={};for(const c in a)void 0!==a[c]&&(b[c]=a[c]);return b},XV=function(a,b){WV(a,b.getMediaSession());
14
- b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.W);b.addMessageListener(qV,a.P);b.addMessageListener(rV,a.U)},YV=function(a){const b=a.getPosition();a.a&&a.a.media?(a=a.a.media.startAbsoluteTime,a=typeof a!==_.r?null:a):a=null;a=null===a?null:a+b;return null===a?b:a},WV=function(a,b){a.a=b;a.a&&(a.l&&a.l.init(),a.trigger(new _.H(_.le)))},aW=function(a){return new ZV(a.h,()=>{a.trigger(new _.H(_.Sc))},(b,c)=>{{const d=a.f.getConfiguration();d.source=c.source;d.autoplay=!1;d.startTime=
15
- c.currentTime?Math.max(c.currentTime-1,0):null;d.ima&&d.startTime&&(d.ima.playAdsAfterTime=d.startTime);c.Tf&&(d.preferredAudioLanguage=c.Tf);c.Zg&&(d.preferredTextLanguage=c.Zg);_.Yr(a.f,null);a.trigger(new _.H("castingended"));a.j(b,d)}},()=>$V(a))},$V=function(a){return _.v(function*(){a.trigger(new _.H(_.Rc));if(a.f.a!==a.a&&a.a){var b=null!=a.f.Sa();yield a.f.release();_.Yr(a.f,a.a);b&&(_.hs(a.f),(b=a.f.getAdsManager())&&(yield b.load()))}})},bW=function(a){a.trigger(new _.H(_.ef))},dW=function(a){cW(a);
16
- const b=Math.min(a.a.Fd().length-1,a.a.getPosition()+1);a.a.setPosition(b)},cW=function(a){a.j||(a.a.on(_.df,a.o),a.j=!0)},eW=function(a){return a.map(b=>{const c={};c.media={contentId:b.configuration.source};c.customData={skippable:!1!==b.skippable};return c})},iW=function(a,b,c){return _.v(function*(){var d=b.adTagUrl;if(d)try{fW=!1;const e=_.ek(d),f=yield c.fetch(e).V;if(f&&f.data){const g=_.vi(f.data),h=(new DOMParser).parseFromString(g,_.Uf);if(h.getElementsByTagName("vmap:VMAP").length)gW.warn("VMAP detected."),
17
- a.vmapAdsRequest=hW(g);else if(h.getElementsByTagName("VAST").length){gW.warn("VAST detected.");{d=g;const k=new cast.framework.messages.BreakClip("bc1");k.vastAdsRequest=hW(d);const l=new cast.framework.messages.Break("b1",[k.id],0);a.breakClips=[k];a.breaks=[l]}}else gW.warn("Unsupported schema."),fW=!0}}catch(e){gW.warn("Failed to fetch an ad",e),fW=!0}})},hW=function(a){const b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},jW=function(a,b){b=new _.J(1,10,10003,{errorType:b});
18
- a.m.onError(b)},kW=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},mW=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;(c=lW(a,c))&&(d={ad:c});a.m.trigger(new _.H(b,d))}},lW=function(a,b){let c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){let d=null,e=null,f;typeof b.breakClipId===_.Of&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.Of&&(e=a.a.getBreakById(b.breakId),!e&&d&&(e=a.a.getBreaks().find(g=>
19
- g.breakClipIds.includes(d.id))||null),e&&(f=a.a.getBreaks().filter(g=>0<=g.position).sort((g,h)=>g.position-h.position).findIndex(g=>g===e)));c=new Y(d,e,b.index,b.total,f)}return c},nW=function(){return[cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,cast.framework.events.EventType.TIMED_METADATA_CHANGED,cast.framework.events.EventType.TIMED_METADATA_ENTER,cast.framework.events.EventType.TIMED_METADATA_EXIT]},oW=function(a){const b=a.dashTimedMetadata;let c=_.ig;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.hg)?
20
- _.bj:_.fg,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b?b.eventElement:null}},pW=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},rW=function(a){a.a=pW().getTextTracksManager();const b=a.a.getTracks();a.j=qW(_.L,b)},qW=function(a,b){const c=[];for(const d of b)b=new _.ml(d.trackId.toString(),a),b.roles=d.roles||[],b.kind=d.subtype||null,b.language=d.language||null,b.originalLanguage=d.language||null,b.label=
21
- d.name||null,b.src=d.trackContentId||null,b.mimeType=d.trackContentType||null,d.customData&&(b.mimeType=d.customData.mimeType||b.mimeType,b.src=d.customData.url||b.src),b.renditions.push(new _.ql(b.id,b)),c.push(b);return c},sW=function(a,b,c,d){c=_.kj(c).filter(g=>g);var e=!1;let f=[];b===_.M?f=a.getAudioTracks():b===_.L&&(f=a.sa());if(c=c.find(g=>{const h=_.Tj(g);return f.some(k=>{k=_.Tj(k.language||"");return _.Uj(h,k)})})){const g=_.Tj(c);c=f.filter(h=>{h=_.Tj(h.language||"");return _.Uj(g,h)});
22
- f=c.length?c:f;e=e||!!c.length}_.Ei(d)&&(c=f.filter(g=>g.roles.includes(d)),f=c.length?c:f,e=e||!!c.length);e&&f[0]&&(e=f[0],a.g.info("Will select track",e),b===_.M?a.za(e):b===_.L&&a.ab(e))},tW=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},wW=function(a,b){var c=()=>{b.protectionSystem=cast.framework.ContentProtection.NONE;b.licenseUrl=void 0;b.licenseRequestHandler=void 0;b.licenseHandler=void 0};if(a&&a.drm){var d=a.drm,e=_.ok(d);if(e){var f=[_.rd];_.bp(a)[0].type!==
23
- _.Bc&&f.unshift(_.td);d.preferredDrmSystem===_.rd&&f.reverse();for(var g,h;f.length&&!h;)g=f.shift(),h=e.Ma[g];h?(c=g===_.td?cast.framework.ContentProtection.WIDEVINE:g===_.rd?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=c,b.licenseUrl=h.licenseUrl,c={ldlDelay:0,customData:{}},uW(b,h,a,c),vW(b,h,a,c)):c()}else c()}else c()},xW=function(a,b){b=Object.assign({},a.shakaConfig,b);return Object.assign({},a,{shakaConfig:b})},uW=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=
24
- e=>{const f=_.ek({method:_.bb,uris:[e.url]});e.headers&&(f.headers=e.headers);f.body=e.content;f.allowCrossSiteCredentials=e.withCredentials;b.modifiers.licenseRequest(c,f,d);e.url=f.uris[0];e.headers=f.headers;e.content=f.body;e.withCredentials=f.allowCrossSiteCredentials}:a.licenseRequestHandler=void 0},vW=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=(e,f)=>_.v(function*(){const g=_.ik(Object.assign({},f.headers),e.buffer,200,"");yield b.modifiers.licenseResponse(c,g,d);return _.E(g.data)}):
25
- a.licenseHandler=void 0},AW=function(){return yW||(yW=new zW)},BW=function(){return cast.framework.CastReceiverContext.getInstance()},CW=function(){const a=BW().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null},DW=function(a,b){const c=BW().getPlayerManager().getMediaInformation();c?(b?c.metadata=b:delete c.metadata,a=!0,a=void 0===a?!1:a,BW().getPlayerManager().setMediaInformation(c,a)):a.g.warn("No mediaInformation is present. Skipping metadata update.")},FW=function(a,
26
- b){a.g.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat;a=BW();var {hlsVideoSegmentFormat:d}=BW().getPlayerManager().getMediaInformation()||{};c=d===c.FMP4?_.qg:_.pg;b=b.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");b=b.split(/\n+/m);d=[];let e=0;for(;e<b.length;){const f=b[e].trim();if(b[e].startsWith("#EXT-X-STREAM-INF")){const g=EW(f,_.qa),h=EW(f,_.ib);let [k,l]=[];h&&([k,l]=h.split("x").map(m=>+m));if(!a.canDisplayType(c,g,k,l)){e+=2;continue}}d.push(f);++e}return d.join("\n")},
27
- EW=function(a,b){let c;b+="\x3d";let d=a.indexOf(b);0<=d&&(c=a.substring(d+b.length),c.startsWith('"')?(c=c.substring(1),c=c.substring(0,c.indexOf('"'))):(d=c.indexOf(","),0<=d&&(c=c.substring(0,d))));return c},GW=function(a){for(const b of a)a={},b.customData&&_.$g(b.customData)&&(a=b.customData),b.roles&&(a.roles=b.roles),b.audioTrackInfo&&(a.audioTrackInfo=b.audioTrackInfo),_.$g(a)&&(b.customData=a)},HW=function(a){_.v(function*(){yield a.l.L;a.a=a.l.o;a.B.on(a.a.controller,cast.framework.RemotePlayerEventType.ANY_CHANGE,
28
- a.C.bind(a))})},IW=function(a,b,c){let d=null;c&&(d={ad:c});a.l.trigger(new _.H(b,d))},JW=function(a){if(!a.a||!a.a.mediaInfo)return null;var b=a.a.mediaInfo.breaks;const c=a.a.mediaInfo.breakClips,d=a.a.isPlayingBreak,e=a.a.breakId,f=a.a.currentBreakClipNumber,g=a.a.numberBreakClips,h=a.a.breakClipId;if(!(b&&c&&null!=e&&null!=f&&null!=g&&null!=h&&d))return null;const k=b.find(l=>l.id===e)||null;a=0;k&&(a=0>=k.position?k.position:b.filter(l=>0<=l.position).sort((l,m)=>l.position-m.position).findIndex(l=>
29
- l===k));b=c.find(l=>l.id===h)||null;return new Y(b,k,f,g,a)},KW,AV=0,VV={GENERIC:AV,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5},LW="addMissingTimelineCues alwaysStreamText bufferBehind bufferingGoal durationBackoff gapDetectionThreshold ignoreTextStreamFailures lowLatencyMode rebufferingGoal retryParameters safeSeekOffset stallEnabled stallSkip stallThreshold startAtSegmentBoundary".split(" "),MW="bandwidthDowngradeTarget bandwidthUpgradeTarget defaultBandwidthEstimate enabled initialRestrictions restrictions switchInterval".split(" ");var NW=class{constructor(a,b){this.log=new _.S(b);this.player=a;this.l=null;this.o=this.h=0;this.j=2;this.C=Date.now();this.B=-1}release(){this.a(0)}destroy(){this.l=this.player=null;return Promise.resolve()}getState(){return this.h}onError(a){a.severity===_.C&&this.a(3)}a(a){if(a!==this.h)if(3===this.h&&0!==a)this.log.debug("Player is in ERROR state and can not switch to",a);else{var b=Date.now();this.o=this.h;this.h=a;6===this.h?(this.B=b,this.player.trigger(new _.H(_.Oc,{detail:{bufferedTimeMS:-1,
30
- reason:this.j}}))):6===this.o&&this.player.trigger(new _.H(_.Nc,{detail:{bufferedTimeMS:b-this.B,reason:this.j}}));a={currentState:this.h,previousState:this.o,timeSinceLastStateChangeMS:b-this.C};this.C=b;this.l&&_.Vo(this.l,this.h);this.player.trigger(new _.H(_.bf,{detail:a}))}}};var OW=class extends NW{constructor(a){super(a,"clpp.cast.SenderStateManager");this.w=this.f=null;this.A=this.dc.bind(this)}init(){const a=this.player,b=a.a;b&&(this.f&&this.f.removeUpdateListener(this.A),this.f=b,this.f.addUpdateListener(this.A),this.w=a.o)}destroy(){const a=this,b=()=>Object.getPrototypeOf(Object.getPrototypeOf(this)).destroy;return _.v(function*(){a.f&&(a.f.removeUpdateListener(a.A),a.f=null);yield b().call(a)})}a(a){const b=this.player.o;b&&b.isPlayingBreak||super.a(a)}dc(){if(this.f&&
31
- this.w&&!this.w.isPlayingBreak)switch(this.f.playerState){case chrome.cast.media.PlayerState.IDLE:switch(this.f.idleReason){case chrome.cast.media.IdleReason.FINISHED:this.a(11);break;case chrome.cast.media.IdleReason.ERROR:this.a(3);break;default:this.a(0)}break;case chrome.cast.media.PlayerState.PLAYING:this.a(8);break;case chrome.cast.media.PlayerState.PAUSED:this.a(10);break;case chrome.cast.media.PlayerState.BUFFERING:this.a(6)}}};var PW=class extends _.U{constructor(){super();this.g=new _.S("clpp.cast.SenderTrackManager");this.a=null;this.h=[];this.f={}}initialize(a){this.a=a}release(){this.h=[];this.f={}}load(){this.release();var a=this.a.a;a&&(a=a.media)&&(this.h=(a=a.tracks)?a.map(b=>{switch(b.type){case chrome.cast.media.TrackType.VIDEO:var c=_.N;break;case chrome.cast.media.TrackType.AUDIO:c=_.M;break;case chrome.cast.media.TrackType.TEXT:c=_.L}c=new _.ml(b.trackId.toString(),c);c.kind=b.subtype;c.language=b.language;
32
- c.label=b.name;c.src=b.trackContentId;c.mimeType=b.trackContentType;if(b.customData){c.src=b.customData.url||c.src;c.mimeType=b.customData.mimeType||c.mimeType;const d=b.customData.roles;d&&(c.roles=d);if(b=b.customData.audioTrackInfo)void 0!==b.numAudioChannels&&(c.channelsCount=b.numAudioChannels),void 0!==b.spatialAudio&&(c.spatialAudio=b.spatialAudio)}c.renditions.push(new _.ql(c.id,c));return c}):[],this.a.trigger(new _.H(_.ag)))}destroy(){this.a=null}getVideoTracks(){return DV(this,_.N)}getAudioTracks(){return DV(this,
33
- _.M)}sa(){return DV(this,_.L)}ta(){const a=this.Ia();return a?a.renditions[0]:null}Qa(){const a=this.ra();return a?a.renditions[0]:null}Xa(){const a=this.ua();return a?a.renditions[0]:null}wb(){return this.f[_.N]||null}Nb(){return this.f[_.M]||null}Ob(){return this.f[_.L]||null}Ia(){return FV(this,_.N)}ra(){return FV(this,_.M)}ua(){return FV(this,_.L)}Fb(a){HV(this,_.N,a)}za(a){HV(this,_.M,a)}ab(a){HV(this,_.L,a)}rb(a){this.Fb(a&&a.track)}Db(a){this.za(a&&a.track)}Eb(a){this.ab(a&&a.track)}addTextTrack(){return _.v(function*(){})}va(){return!0}};
34
- PW.prototype.isAbrEnabled=PW.prototype.va;PW.prototype.addTextTrack=PW.prototype.addTextTrack;PW.prototype.setTextRendition=PW.prototype.Eb;PW.prototype.setAudioRendition=PW.prototype.Db;PW.prototype.setVideoRendition=PW.prototype.rb;PW.prototype.setTextTrack=PW.prototype.ab;PW.prototype.setAudioTrack=PW.prototype.za;PW.prototype.setVideoTrack=PW.prototype.Fb;PW.prototype.getTextTrack=PW.prototype.ua;PW.prototype.getAudioTrack=PW.prototype.ra;PW.prototype.getVideoTrack=PW.prototype.Ia;
35
- PW.prototype.getLoadingTextRendition=PW.prototype.Ob;PW.prototype.getLoadingAudioRendition=PW.prototype.Nb;PW.prototype.getLoadingVideoRendition=PW.prototype.wb;PW.prototype.getTextRendition=PW.prototype.Xa;PW.prototype.getAudioRendition=PW.prototype.Qa;PW.prototype.getVideoRendition=PW.prototype.ta;PW.prototype.getTextTracks=PW.prototype.sa;PW.prototype.getAudioTracks=PW.prototype.getAudioTracks;PW.prototype.getVideoTracks=PW.prototype.getVideoTracks;var ZV=class extends _.Cu{constructor(a,b,c,d){super();this.g=new _.S(_.gd);this.S=a;this.w=new _.Jh(b);this.R=c;this.Z=d;this.j=this.G=_.rm();this.C=[];this.B=0;this.I=new _.Jr;this.a=null;this.f=!1;this.L=new _.wk;this.A=!1;this.ca="";this.ja=1E6;this.h=new PW;this.h.initialize(this);this.l=new OW(this);this.F=new _.Ut;this.H=null;this.K=new Set;this.M=this.eb.bind(this);this.da=this.Ub.bind(this);this.W=this.Hb.bind(this);this.P=this.Ib.bind(this);this.U=this.lb.bind(this);this.o=this.J=null;window.cast||
36
- Object.defineProperty(window,"cast",{get:()=>window.cast_,set:e=>{window.cast_=e;window.setTimeout(()=>{MV(!0)},0)}});JV(this);IV.add(this)}init(a,b){this.j=this.G=b}unload(){return this.f?new Promise((a,b)=>{this.h&&this.h.release();this.a&&!this.a.idleReason||a();this.a.stop(null,a,b)}):Promise.resolve()}release(){return this.f?this.unload().then(()=>{this.l&&this.l.release()}):Promise.resolve()}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.Ya)}appendLoad(){return Promise.reject(_.Ya)}seekWith(){return Promise.reject(_.Ya)}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}destroy(){return _.v(function*(){})}Xd(a){this.J=
37
- a}ed(){return this.f}ya(){return this.A}We(){return this.ca}sendMessage(a,b){const c=this;return _.v(function*(){if(c.f){var d=cast.framework.CastContext.getInstance().getCurrentSession();if(d)try{yield d.sendMessage(a,b)}catch(f){var e=new _.J(1,8,8E3,{detailedErrorCode:f})}else e=new _.J(1,8,8004,void 0);if(e)c.onError(e)}})}cast(){const a=this;return _.v(function*(){if(!a.ed())throw a.g.warn(lV),new _.J(1,8,8001,void 0);if(!NV)throw a.g.warn(iV),new _.J(1,8,8002,void 0);if(a.ya())throw a.g.warn("Already casting"),
38
- new _.J(1,8,8003,void 0);try{yield PV(a)}catch(b){const c={};b instanceof chrome.cast.Error?(c.detailedErrorCode=b.code,c.details=b.details,c.reason=b.description):c.detailedErrorCode=b;throw new _.J(1,8,8E3,c);}})}oe(){this.f&&this.ya()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)}addMessageListener(a){typeof a===_.Wd&&this.K.add(a)}removeMessageListener(a){typeof a===_.Wd&&this.K.delete(a)}play(){return this.f?this.isEnded()?RV(this,!0):new Promise((a,b)=>{if(!this.a)return b(hV);
39
- this.a.play(null,a,b)}):Promise.resolve()}pause(){return this.f?new Promise((a,b)=>{this.isEnded()&&a();if(!this.a)return b(hV);this.a.pause(null,a,b)}):Promise.resolve()}isPaused(){return this.f?!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED:!1}isEnded(){return this.f?11===this.getState():!1}seek(a){return this.f?this.isEnded()?RV(this,!1,a):new Promise((b,c)=>{this.a||c(hV);this.o.isPlayingBreak&&c(fV);const d=new chrome.cast.media.SeekRequest;d.currentTime=a;this.trigger(new _.H(_.kg));
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var hV="Cannot seek during ads playout.",iV="Cannot switch track",jV="Media session does not exist.",kV="No receivers available",lV="QUEUE_ITEM_CHANGED",mV="Reset ABR functionality not available on cast.",nV="SDK not yet ready",oV="Sender is destroyed.",pV="clpp.cast.CastProxy",qV="clpp.cast.Player",rV="clpp.cast.Receiver",sV="urn:x-cast:castlabs",tV="urn:x-cast:castlabs:int",uV="urn:x-cast:com.google.cast.media",vV="volume control is not supported",wV=function(a){return _.v(function*(){yield _.as(a,
2
+ _.He);yield _.as(a,_.Ge)})},xV=function(a){return JSON.stringify(a,(b,c)=>{if("license"!==b&&typeof c!==_.Wd){if(c instanceof Event){b={};for(const d in c){const e=c[d];typeof e===_.Ce?"detail"===d&&(b[d]=e):d in Event||(b[d]=e)}return b}return typeof c===_.r?isNaN(c)?"NaN":isFinite(c)?c:0>c?"-Infinity":"Infinity":c}})},yV=function(a){if(typeof a!==_.Of)return a;try{return JSON.parse(a,(b,c)=>"NaN"===c?NaN:"-Infinity"===c?-Infinity:"Infinity"===c?Infinity:c)}catch(b){return a}},zV=function(a,b){const c=
3
+ new Set(b);return Object.keys(a).reduce((d,e)=>{c.has(e)&&(d[e]=a[e]);return d},{})},AV=function(a,b,c,d){return _.v(function*(){if(b.includes(a.mimeType))return a;var e=null;let f=null,g=null;for(var h=0;h<b.length&&!f;)g=b[h++],f=_.Ol(d,a.mimeType,g);f&&g&&(h=_.fk(a.url),(h=yield c.fetch(h).V)&&h.data&&(e=f.a(_.E(h.data)),e={url:URL.createObjectURL(new Blob([e])),kind:a.kind,language:a.language,label:a.label,mimeType:g}));return e})},BV=function(a,b){let c,d;if(window.chrome&&chrome.cast&&chrome.cast.media)c=
4
+ chrome.cast.media.HlsSegmentFormat,d=chrome.cast.media.HlsVideoSegmentFormat;else if(window.cast&&cast.framework&&cast.framework.messages)c=cast.framework.messages.HlsSegmentFormat,d=cast.framework.messages.HlsVideoSegmentFormat;else return;switch(a){case _.qg:return d.FMP4;case _.pg:return b===_.N?d.MPEG2_TS:c.TS;case _.Dc:return c.AAC;case _.Ec:return c.AC3;case _.Fc:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.Gc:return c.FMP4}},DV=function(a){a=void 0===a?CV:a;var b=cast.framework.messages||
5
+ chrome.cast.media;if(!b)throw new _.J(1,8,8001);const c=b.MetadataType,d=b.GenericMediaMetadata,e=b.MovieMediaMetadata,f=b.TvShowMediaMetadata,g=b.MusicTrackMediaMetadata,h=b.PhotoMediaMetadata;b=b.AudiobookChapterMediaMetadata;switch(a){case c.MOVIE:return new e;case c.TV_SHOW:return new f;case c.MUSIC_TRACK:return new g;case c.PHOTO:return new h;case c.AUDIOBOOK_CHAPTER:return new b;default:return new d}},EV=function(){return Math.round(1E3*Math.random())},FV=function(a,b){return a.h.filter(c=>
6
+ c.type===b)},HV=function(a,b){const c=GV(a);return FV(a,b).find(d=>c.includes(d.id))||null},JV=function(a,b,c){const d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.L){const e=a.ua();e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,()=>{a.f[b]=null;IV(a,b)},e=>{a.f[b]=null;a.g.debug(iV,e)})}else b===_.L&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,()=>{IV(a,b)},e=>{a.g.debug(iV,e)}))},GV=function(a){a=a.a?a.a.a:null;return(a?
7
+ a.activeTrackIds||[]:[]).map(b=>b.toString())},IV=function(a,b){b===_.M?a.a.trigger(new _.H(_.Jc)):b===_.L&&a.a.trigger(new _.H(_.Vf))},OV=function(a){if(a){for(const b of KV)LV(b);MV=!0;for(const b of NV)b()}},LV=function(a){if(!a.f&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&cast.framework&&cast.framework.CastContext&&a.S.length){a.o=new cast.framework.RemotePlayer;var b=new cast.framework.RemotePlayerController(a.o);a.F.on(b,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,
8
+ a.Aa.bind(a));a.F.on(b,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,a.Kb.bind(a));a.f=!0;a.L.resolve();a.w.Ef();b=cast.framework.CastContext.getInstance();var c=new cast.framework.CastOptions;c.receiverApplicationId=a.S;c.autoJoinPolicy=chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED;b.setOptions(c);b.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.M);b.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.da);PV&&a.w.la(.02)}},QV=function(a){return _.v(function*(){a.F.release();
9
+ KV.delete(a);if(a.f){a.f=!1;var b=cast.framework.CastContext.getInstance();b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.M);b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.da)}b=[];a.h&&(b.push(a.h.destroy()),a.h=null);a.l&&(b.push(a.l.destroy()),a.l=null);yield Promise.all(b);a.A=!1;a.w&&(a.w.stop(),a.w=null);a.R=null;a.Z=null})},RV=function(a){return _.v(function*(){a.ya()||(yield cast.framework.CastContext.getInstance().requestSession())})},
10
+ TV=function(a,b,c){c=void 0===c?0:c;return _.v(function*(){var d=a.h.ua();d&&d.language&&(a.j.preferredTextLanguage=d.language);(d=a.h.ra())&&d.language&&(a.j.preferredAudioLanguage=d.language);yield SV(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),mf:a.getPresentationStartTime(),autoplay:b,Ga:a.j})})},SV=function(a,b){return _.v(function*(){if(a.f){var c=chrome.cast.media.StreamType;yield RV(a);if(b){var d=cast.framework.CastContext.getInstance().getCurrentSession(),e=new chrome.cast.media.MediaInfo(b.source.url,
11
+ b.source.type);e.streamType=b.isLive?c.LIVE:c.BUFFERED;c=b.audioMimeType;e.hlsVideoSegmentFormat=BV(b.videoMimeType,_.N);e.hlsSegmentFormat=BV(c,_.M);b.Ga&&(a.J&&(c=yield Promise.resolve(a.J(b.Ga)))&&(b.Ga=c),a.j=b.Ga,a.C=_.cp(a.j),a.B=a.C.findIndex(k=>k.url===b.source.url),b.Ga.remoteTextTracks&&(c=yield Promise.all(b.Ga.remoteTextTracks.map(a.eb.bind(a))),e.tracks=c.filter(k=>k),b.Ga.remoteTextTracks=void 0),delete b.Ga.autoplay,b.Ga.startTime=null,e.customData={playerConfiguration:xV(b.Ga)});c=
12
+ a.Mb()||{};var f=UV(c.metadataType),g;typeof b.mf===_.r&&(g={metadataType:f,sectionStartAbsoluteTime:b.mf});var h;b.source.name&&(h={metadataType:f,title:b.source.name});c=VV(c);if(g=WV(Object.assign({},g,h,c)))e.metadata=g;e=new chrome.cast.media.LoadRequest(e);(g=b.queueData)&&g.items&&0<g.items.length&&(h=new chrome.cast.media.QueueData,h.items=g.items,h.startIndex=g.startIndex,e.queueData=h);typeof b.autoplay===_.Mc&&(e.autoplay=b.autoplay);typeof b.currentTime===_.r&&(e.currentTime=b.currentTime);
13
+ yield d.loadMedia(e);null!=b.Ga.muted&&a.setMuted(b.Ga.muted);null!=b.Ga.volume&&a.setVolume(b.Ga.volume)}}})},WV=function(a){if(!a)return null;a:{var b=a.metadataType;const c=Object.entries(XV);for(const d of c){const [e,f]=d;if(f===b){b=e;break a}}b=null}if(!b)return null;b=DV(XV[b]);return Object.assign(b,a)},UV=function(a){var b=void 0===b?CV:b;return Object.values(XV).includes(a)?a:b},VV=function(a){const b={};for(const c in a)void 0!==a[c]&&(b[c]=a[c]);return b},ZV=function(a,b){YV(a,b.getMediaSession());
14
+ b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.W);b.addMessageListener(sV,a.P);b.addMessageListener(tV,a.U)},$V=function(a){const b=a.getPosition();a.a&&a.a.media?(a=a.a.media.startAbsoluteTime,a=typeof a!==_.r?null:a):a=null;a=null===a?null:a+b;return null===a?b:a},YV=function(a,b){a.a=b;a.a&&(a.l&&a.l.init(),a.trigger(new _.H(_.le)))},cW=function(a){return new aW(a.h,()=>{a.trigger(new _.H(_.Sc))},(b,c)=>{{const d=a.f.getConfiguration();d.source=c.source;d.autoplay=!1;d.startTime=
15
+ c.currentTime?Math.max(c.currentTime-1,0):null;d.ima&&d.startTime&&(d.ima.playAdsAfterTime=d.startTime);c.Tf&&(d.preferredAudioLanguage=c.Tf);c.Zg&&(d.preferredTextLanguage=c.Zg);_.Zr(a.f,null);a.trigger(new _.H("castingended"));a.j(b,d)}},()=>bW(a))},bW=function(a){return _.v(function*(){a.trigger(new _.H(_.Rc));if(a.f.a!==a.a&&a.a){var b=null!=a.f.Ua();yield a.f.release();_.Zr(a.f,a.a);b&&(_.is(a.f),(b=a.f.getAdsManager())&&(yield b.load()))}})},dW=function(a){a.trigger(new _.H(_.ef))},fW=function(a){eW(a);
16
+ const b=Math.min(a.a.Fd().length-1,a.a.getPosition()+1);a.a.setPosition(b)},eW=function(a){a.j||(a.a.on(_.df,a.o),a.j=!0)},gW=function(a){return a.map(b=>{const c={};c.media={contentId:b.configuration.source};c.customData={skippable:!1!==b.skippable};return c})},kW=function(a,b,c){return _.v(function*(){var d=b.adTagUrl;if(d)try{hW=!1;const e=_.fk(d),f=yield c.fetch(e).V;if(f&&f.data){const g=_.wi(f.data),h=(new DOMParser).parseFromString(g,_.Uf);if(h.getElementsByTagName("vmap:VMAP").length)iW.warn("VMAP detected."),
17
+ a.vmapAdsRequest=jW(g);else if(h.getElementsByTagName("VAST").length){iW.warn("VAST detected.");{d=g;const k=new cast.framework.messages.BreakClip("bc1");k.vastAdsRequest=jW(d);const l=new cast.framework.messages.Break("b1",[k.id],0);a.breakClips=[k];a.breaks=[l]}}else iW.warn("Unsupported schema."),hW=!0}}catch(e){iW.warn("Failed to fetch an ad",e),hW=!0}})},jW=function(a){const b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},lW=function(a,b){b=new _.J(1,10,10003,{errorType:b});
18
+ a.m.onError(b)},mW=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},oW=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;(c=nW(a,c))&&(d={ad:c});a.m.trigger(new _.H(b,d))}},nW=function(a,b){let c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){let d=null,e=null,f;typeof b.breakClipId===_.Of&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.Of&&(e=a.a.getBreakById(b.breakId),!e&&d&&(e=a.a.getBreaks().find(g=>
19
+ g.breakClipIds.includes(d.id))||null),e&&(f=a.a.getBreaks().filter(g=>0<=g.position).sort((g,h)=>g.position-h.position).findIndex(g=>g===e)));c=new Y(d,e,b.index,b.total,f)}return c},pW=function(){return[cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,cast.framework.events.EventType.TIMED_METADATA_CHANGED,cast.framework.events.EventType.TIMED_METADATA_ENTER,cast.framework.events.EventType.TIMED_METADATA_EXIT]},qW=function(a){const b=a.dashTimedMetadata;let c=_.ig;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.hg)?
20
+ _.cj:_.fg,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b?b.eventElement:null}},rW=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},tW=function(a){a.a=rW().getTextTracksManager();const b=a.a.getTracks();a.j=sW(_.L,b)},sW=function(a,b){const c=[];for(const d of b)b=new _.nl(d.trackId.toString(),a),b.roles=d.roles||[],b.kind=d.subtype||null,b.language=d.language||null,b.originalLanguage=d.language||null,b.label=
21
+ d.name||null,b.src=d.trackContentId||null,b.mimeType=d.trackContentType||null,d.customData&&(b.mimeType=d.customData.mimeType||b.mimeType,b.src=d.customData.url||b.src),b.renditions.push(new _.rl(b.id,b)),c.push(b);return c},uW=function(a,b,c,d){c=_.lj(c).filter(g=>g);var e=!1;let f=[];b===_.M?f=a.getAudioTracks():b===_.L&&(f=a.sa());if(c=c.find(g=>{const h=_.Uj(g);return f.some(k=>{k=_.Uj(k.language||"");return _.Vj(h,k)})})){const g=_.Uj(c);c=f.filter(h=>{h=_.Uj(h.language||"");return _.Vj(g,h)});
22
+ f=c.length?c:f;e=e||!!c.length}_.Fi(d)&&(c=f.filter(g=>g.roles.includes(d)),f=c.length?c:f,e=e||!!c.length);e&&f[0]&&(e=f[0],a.g.info("Will select track",e),b===_.M?a.za(e):b===_.L&&a.bb(e))},vW=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},yW=function(a,b){var c=()=>{b.protectionSystem=cast.framework.ContentProtection.NONE;b.licenseUrl=void 0;b.licenseRequestHandler=void 0;b.licenseHandler=void 0};if(a&&a.drm){var d=a.drm,e=_.pk(d);if(e){var f=[_.rd];_.cp(a)[0].type!==
23
+ _.Bc&&f.unshift(_.td);d.preferredDrmSystem===_.rd&&f.reverse();for(var g,h;f.length&&!h;)g=f.shift(),h=e.Oa[g];h?(c=g===_.td?cast.framework.ContentProtection.WIDEVINE:g===_.rd?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=c,b.licenseUrl=h.licenseUrl,c={ldlDelay:0,customData:{}},wW(b,h,a,c),xW(b,h,a,c)):c()}else c()}else c()},zW=function(a,b){b=Object.assign({},a.shakaConfig,b);return Object.assign({},a,{shakaConfig:b})},wW=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=
24
+ e=>{const f=_.fk({method:_.bb,uris:[e.url]});e.headers&&(f.headers=e.headers);f.body=e.content;f.allowCrossSiteCredentials=e.withCredentials;b.modifiers.licenseRequest(c,f,d);e.url=f.uris[0];e.headers=f.headers;e.content=f.body;e.withCredentials=f.allowCrossSiteCredentials}:a.licenseRequestHandler=void 0},xW=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=(e,f)=>_.v(function*(){const g=_.jk(Object.assign({},f.headers),e.buffer,200,"");yield b.modifiers.licenseResponse(c,g,d);return _.E(g.data)}):
25
+ a.licenseHandler=void 0},CW=function(){return AW||(AW=new BW)},DW=function(){return cast.framework.CastReceiverContext.getInstance()},EW=function(){const a=DW().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null},FW=function(a,b){const c=DW().getPlayerManager().getMediaInformation();c?(b?c.metadata=b:delete c.metadata,a=!0,a=void 0===a?!1:a,DW().getPlayerManager().setMediaInformation(c,a)):a.g.warn("No mediaInformation is present. Skipping metadata update.")},HW=function(a,
26
+ b){a.g.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat;a=DW();var {hlsVideoSegmentFormat:d}=DW().getPlayerManager().getMediaInformation()||{};c=d===c.FMP4?_.qg:_.pg;b=b.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");b=b.split(/\n+/m);d=[];let e=0;for(;e<b.length;){const f=b[e].trim();if(b[e].startsWith("#EXT-X-STREAM-INF")){const g=GW(f,_.qa),h=GW(f,_.ib);let [k,l]=[];h&&([k,l]=h.split("x").map(m=>+m));if(!a.canDisplayType(c,g,k,l)){e+=2;continue}}d.push(f);++e}return d.join("\n")},
27
+ GW=function(a,b){let c;b+="\x3d";let d=a.indexOf(b);0<=d&&(c=a.substring(d+b.length),c.startsWith('"')?(c=c.substring(1),c=c.substring(0,c.indexOf('"'))):(d=c.indexOf(","),0<=d&&(c=c.substring(0,d))));return c},IW=function(a){for(const b of a)a={},b.customData&&_.$g(b.customData)&&(a=b.customData),b.roles&&(a.roles=b.roles),b.audioTrackInfo&&(a.audioTrackInfo=b.audioTrackInfo),_.$g(a)&&(b.customData=a)},JW=function(a){_.v(function*(){yield a.l.L;a.a=a.l.o;a.B.on(a.a.controller,cast.framework.RemotePlayerEventType.ANY_CHANGE,
28
+ a.C.bind(a))})},KW=function(a,b,c){let d=null;c&&(d={ad:c});a.l.trigger(new _.H(b,d))},LW=function(a){if(!a.a||!a.a.mediaInfo)return null;var b=a.a.mediaInfo.breaks;const c=a.a.mediaInfo.breakClips,d=a.a.isPlayingBreak,e=a.a.breakId,f=a.a.currentBreakClipNumber,g=a.a.numberBreakClips,h=a.a.breakClipId;if(!(b&&c&&null!=e&&null!=f&&null!=g&&null!=h&&d))return null;const k=b.find(l=>l.id===e)||null;a=0;k&&(a=0>=k.position?k.position:b.filter(l=>0<=l.position).sort((l,m)=>l.position-m.position).findIndex(l=>
29
+ l===k));b=c.find(l=>l.id===h)||null;return new Y(b,k,f,g,a)},MW,CV=0,XV={GENERIC:CV,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5},NW="addMissingTimelineCues alwaysStreamText bufferBehind bufferingGoal durationBackoff gapDetectionThreshold ignoreTextStreamFailures lowLatencyMode rebufferingGoal retryParameters safeSeekOffset stallEnabled stallSkip stallThreshold startAtSegmentBoundary".split(" "),OW="bandwidthDowngradeTarget bandwidthUpgradeTarget defaultBandwidthEstimate enabled initialRestrictions restrictions switchInterval".split(" ");var PW=class{constructor(a,b){this.log=new _.S(b);this.player=a;this.l=null;this.o=this.h=0;this.j=2;this.C=Date.now();this.B=-1}release(){this.a(0)}destroy(){this.l=this.player=null;return Promise.resolve()}getState(){return this.h}onError(a){a.severity===_.C&&this.a(3)}a(a){if(a!==this.h)if(3===this.h&&0!==a)this.log.debug("Player is in ERROR state and can not switch to",a);else{var b=Date.now();this.o=this.h;this.h=a;6===this.h?(this.B=b,this.player.trigger(new _.H(_.Oc,{detail:{bufferedTimeMS:-1,
30
+ reason:this.j}}))):6===this.o&&this.player.trigger(new _.H(_.Nc,{detail:{bufferedTimeMS:b-this.B,reason:this.j}}));a={currentState:this.h,previousState:this.o,timeSinceLastStateChangeMS:b-this.C};this.C=b;this.l&&_.Wo(this.l,this.h);this.player.trigger(new _.H(_.bf,{detail:a}))}}};var QW=class extends PW{constructor(a){super(a,"clpp.cast.SenderStateManager");this.w=this.f=null;this.A=this.ec.bind(this)}init(){const a=this.player,b=a.a;b&&(this.f&&this.f.removeUpdateListener(this.A),this.f=b,this.f.addUpdateListener(this.A),this.w=a.o)}destroy(){const a=this,b=()=>Object.getPrototypeOf(Object.getPrototypeOf(this)).destroy;return _.v(function*(){a.f&&(a.f.removeUpdateListener(a.A),a.f=null);yield b().call(a)})}a(a){const b=this.player.o;b&&b.isPlayingBreak||super.a(a)}ec(){if(this.f&&
31
+ this.w&&!this.w.isPlayingBreak)switch(this.f.playerState){case chrome.cast.media.PlayerState.IDLE:switch(this.f.idleReason){case chrome.cast.media.IdleReason.FINISHED:this.a(11);break;case chrome.cast.media.IdleReason.ERROR:this.a(3);break;default:this.a(0)}break;case chrome.cast.media.PlayerState.PLAYING:this.a(8);break;case chrome.cast.media.PlayerState.PAUSED:this.a(10);break;case chrome.cast.media.PlayerState.BUFFERING:this.a(6)}}};var RW=class extends _.U{constructor(){super();this.g=new _.S("clpp.cast.SenderTrackManager");this.a=null;this.h=[];this.f={}}initialize(a){this.a=a}release(){this.h=[];this.f={}}load(){this.release();var a=this.a.a;a&&(a=a.media)&&(this.h=(a=a.tracks)?a.map(b=>{switch(b.type){case chrome.cast.media.TrackType.VIDEO:var c=_.N;break;case chrome.cast.media.TrackType.AUDIO:c=_.M;break;case chrome.cast.media.TrackType.TEXT:c=_.L}c=new _.nl(b.trackId.toString(),c);c.kind=b.subtype;c.language=b.language;
32
+ c.label=b.name;c.src=b.trackContentId;c.mimeType=b.trackContentType;if(b.customData){c.src=b.customData.url||c.src;c.mimeType=b.customData.mimeType||c.mimeType;const d=b.customData.roles;d&&(c.roles=d);if(b=b.customData.audioTrackInfo)void 0!==b.numAudioChannels&&(c.channelsCount=b.numAudioChannels),void 0!==b.spatialAudio&&(c.spatialAudio=b.spatialAudio)}c.renditions.push(new _.rl(c.id,c));return c}):[],this.a.trigger(new _.H(_.ag)))}destroy(){this.a=null}getVideoTracks(){return FV(this,_.N)}getAudioTracks(){return FV(this,
33
+ _.M)}sa(){return FV(this,_.L)}ta(){const a=this.Ja();return a?a.renditions[0]:null}Sa(){const a=this.ra();return a?a.renditions[0]:null}Za(){const a=this.ua();return a?a.renditions[0]:null}wb(){return this.f[_.N]||null}Ob(){return this.f[_.M]||null}Pb(){return this.f[_.L]||null}Ja(){return HV(this,_.N)}ra(){return HV(this,_.M)}ua(){return HV(this,_.L)}Gb(a){JV(this,_.N,a)}za(a){JV(this,_.M,a)}bb(a){JV(this,_.L,a)}rb(a){this.Gb(a&&a.track)}Eb(a){this.za(a&&a.track)}Fb(a){this.bb(a&&a.track)}addTextTrack(){return _.v(function*(){})}va(){return!0}};
34
+ RW.prototype.isAbrEnabled=RW.prototype.va;RW.prototype.addTextTrack=RW.prototype.addTextTrack;RW.prototype.setTextRendition=RW.prototype.Fb;RW.prototype.setAudioRendition=RW.prototype.Eb;RW.prototype.setVideoRendition=RW.prototype.rb;RW.prototype.setTextTrack=RW.prototype.bb;RW.prototype.setAudioTrack=RW.prototype.za;RW.prototype.setVideoTrack=RW.prototype.Gb;RW.prototype.getTextTrack=RW.prototype.ua;RW.prototype.getAudioTrack=RW.prototype.ra;RW.prototype.getVideoTrack=RW.prototype.Ja;
35
+ RW.prototype.getLoadingTextRendition=RW.prototype.Pb;RW.prototype.getLoadingAudioRendition=RW.prototype.Ob;RW.prototype.getLoadingVideoRendition=RW.prototype.wb;RW.prototype.getTextRendition=RW.prototype.Za;RW.prototype.getAudioRendition=RW.prototype.Sa;RW.prototype.getVideoRendition=RW.prototype.ta;RW.prototype.getTextTracks=RW.prototype.sa;RW.prototype.getAudioTracks=RW.prototype.getAudioTracks;RW.prototype.getVideoTracks=RW.prototype.getVideoTracks;var aW=class extends _.Du{constructor(a,b,c,d){super();this.g=new _.S(_.gd);this.S=a;this.w=new _.Kh(b);this.R=c;this.Z=d;this.j=this.G=_.sm();this.C=[];this.B=0;this.I=new _.Kr;this.a=null;this.f=!1;this.L=new _.xk;this.A=!1;this.ca="";this.ja=1E6;this.h=new RW;this.h.initialize(this);this.l=new QW(this);this.F=new _.Ut;this.H=null;this.K=new Set;this.M=this.fb.bind(this);this.da=this.Vb.bind(this);this.W=this.Ib.bind(this);this.P=this.Jb.bind(this);this.U=this.nb.bind(this);this.o=this.J=null;window.cast||
36
+ Object.defineProperty(window,"cast",{get:()=>window.cast_,set:e=>{window.cast_=e;window.setTimeout(()=>{OV(!0)},0)}});LV(this);KV.add(this)}init(a,b){this.j=this.G=b}unload(){return this.f?new Promise((a,b)=>{this.h&&this.h.release();this.a&&!this.a.idleReason||a();this.a.stop(null,a,b)}):Promise.resolve()}release(){return this.f?this.unload().then(()=>{this.l&&this.l.release()}):Promise.resolve()}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.Ya)}appendLoad(){return Promise.reject(_.Ya)}seekWith(){return Promise.reject(_.Ya)}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}destroy(){return _.v(function*(){})}Xd(a){this.J=
37
+ a}ed(){return this.f}ya(){return this.A}We(){return this.ca}sendMessage(a,b){const c=this;return _.v(function*(){if(c.f){var d=cast.framework.CastContext.getInstance().getCurrentSession();if(d)try{yield d.sendMessage(a,b)}catch(f){var e=new _.J(1,8,8E3,{detailedErrorCode:f})}else e=new _.J(1,8,8004,void 0);if(e)c.onError(e)}})}cast(){const a=this;return _.v(function*(){if(!a.ed())throw a.g.warn(nV),new _.J(1,8,8001,void 0);if(!PV)throw a.g.warn(kV),new _.J(1,8,8002,void 0);if(a.ya())throw a.g.warn("Already casting"),
38
+ new _.J(1,8,8003,void 0);try{yield RV(a)}catch(b){const c={};b instanceof chrome.cast.Error?(c.detailedErrorCode=b.code,c.details=b.details,c.reason=b.description):c.detailedErrorCode=b;throw new _.J(1,8,8E3,c);}})}oe(){this.f&&this.ya()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)}addMessageListener(a){typeof a===_.Wd&&this.K.add(a)}removeMessageListener(a){typeof a===_.Wd&&this.K.delete(a)}play(){return this.f?this.isEnded()?TV(this,!0):new Promise((a,b)=>{if(!this.a)return b(jV);
39
+ this.a.play(null,a,b)}):Promise.resolve()}pause(){return this.f?new Promise((a,b)=>{this.isEnded()&&a();if(!this.a)return b(jV);this.a.pause(null,a,b)}):Promise.resolve()}isPaused(){return this.f?!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED:!1}isEnded(){return this.f?11===this.getState():!1}seek(a){return this.f?this.isEnded()?TV(this,!1,a):new Promise((b,c)=>{this.a||c(jV);this.o.isPlayingBreak&&c(hV);const d=new chrome.cast.media.SeekRequest;d.currentTime=a;this.trigger(new _.H(_.kg));
40
40
  this.a.seek(d,()=>{this.trigger(new _.H(_.jg));b()},c)}):Promise.resolve()}getPosition(){return this.f?this.getMediaPosition():0}getMediaPosition(){return this.f?this.a&&this.a.getEstimatedTime()||0:0}getDuration(){return this.f?this.getMediaDuration():0}getMediaDuration(){if(!this.f)return 0;if(!this.a||!this.a.media)return-1;const a=this.a.media.duration;return typeof a!==_.r?-1:-1===a?Infinity:a}setDrmCustomDataModifier(){}setCdnErrorCallback(){}detach(){}getPlaybackRate(){return this.f?this.a&&
41
- this.a.playbackRate||0:0}setPlaybackRate(a){this.f&&this.a&&0<a&&this.sendMessage(sV,{type:"SET_PLAYBACK_RATE",requestId:CV(),mediaSessionId:this.a.mediaSessionId,playbackRate:a})}getVolume(){return this.f?this.a&&this.a.volume.level:0}setVolume(a){this.f&&this.a&&0<=a&&1>=a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(a)),this.a.setVolume(a))}isMuted(){return this.f?this.a&&this.a.volume.muted:!1}setMuted(a){this.f&&this.a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(void 0,
41
+ this.a.playbackRate||0:0}setPlaybackRate(a){this.f&&this.a&&0<a&&this.sendMessage(uV,{type:"SET_PLAYBACK_RATE",requestId:EV(),mediaSessionId:this.a.mediaSessionId,playbackRate:a})}getVolume(){return this.f?this.a&&this.a.volume.level:0}setVolume(a){this.f&&this.a&&0<=a&&1>=a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(a)),this.a.setVolume(a))}isMuted(){return this.f?this.a&&this.a.volume.muted:!1}setMuted(a){this.f&&this.a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(void 0,
42
42
  a)),this.a.setVolume(a))}getPresentationStartTime(){if(!this.f)return 0;if(!this.a||!this.a.media||!this.a.media.metadata)return null;const a=this.a.media.metadata.sectionStartAbsoluteTime;return typeof a!==_.r?null:1E-8===a?0:a}getSeekRange(){if(!this.f)return{start:0,end:0};let a={start:0,end:this.getDuration()};if(this.isLive()){const b=this.a.getEstimatedLiveSeekableRange();b&&typeof b.start===_.r&&typeof b.end===_.r&&(a={start:b.start,end:b.end})}return a}getState(){return this.f?this.l?this.l.getState():
43
- 0:0}getStats(){return this.f?this.a&&this.a.customData&&this.a.customData.stats?wV(this.a.customData.stats):_.Zo():_.Zo()}isLive(){return this.f?Infinity===this.getDuration():!1}load(a){const b=this;return _.v(function*(){if(b.ed())if(NV){b.C=_.bp(a);b.j=_.tm([b.G,a]);var c=b.C[b.B];yield QV(b,{source:c,isLive:c.isLive,autoplay:b.j.autoplay,Fa:b.j,videoMimeType:c.videoMimeType,audioMimeType:c.audioMimeType})}else b.g.warn(iV);else b.g.warn(lV)})}getBufferInfo(){return new _.zu}getTrackManager(){return this.h}getConfiguration(){return this.j}getSurface(){return null}setNetworkEngine(a){this.I=
44
- a}getNetworkEngine(){return this.I}getSourceIndex(){return this.B}setSourceIndex(a){this.B=a}setCmsdManager(){}getLoadedSource(){return this.C[this.B]}getPeriods(){return[]}getDrmInfo(){return null}getTimelineCues(){return[]}getCueTimeline(){return null}resetAbr(){this.g.warn(kV)}onError(a){if(a&&(this.trigger(new _.H(_.Sd,{detail:a})),this.l))this.l.onError(a)}namespace(){return _.gd}canPlay(){return this.ed()?2:0}Lb(){return this.H}fc(a){this.H=UV(a)}Se(){this.H=null}zf(a){if(this.f){var b=this.Lb()||
45
- {};a={metadataType:SV(b.metadataType),title:a};this.fc(Object.assign({},b,a))}}xf(a){if(this.f){var b=this.Lb()||{},c=SV(b.metadataType);a=new chrome.cast.Image(a);this.fc(Object.assign({},b,{metadataType:c,images:[a]}))}}wf(a){if(this.f){var b=this.Lb()||{};this.fc(Object.assign({},b,{metadataType:3,artist:a}))}}yf(a){if(this.f){var b=this.Lb()||{};a={metadataType:SV(b.metadataType),releaseDate:a};this.fc(Object.assign({},b,a))}}eb(a){const b=cast.framework.CastContext.getInstance(),c=a.castState===
46
- cast.framework.CastState.CONNECTED;NV=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.ca=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.w.Ef()}Ub(a){this.g.debug(`state: ${a.sessionState}, details:`,a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;XV(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.ya()||(this.A=!0,XV(this,a.session),this.Z());break;case cast.framework.SessionState.SESSION_ENDED:if(this.ya()&&
47
- this.a){const d=this.a.media;var b=this.h.ra(),c=this.h.ua();b=b&&b.language||void 0;c=c&&c.language||void 0;this.R(this.getState(),{source:{url:d.contentId,type:d.contentType,isLive:this.isLive()},currentTime:YV(this),Zg:c,Tf:b})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.W);a.session.removeMessageListener(qV,this.P);a.session.removeMessageListener(rV,this.U);this.A=!1;this.a=null}}Hb(a){this.g.debug("New media session",a.mediaSession);WV(this,a.mediaSession)}Jb(a){a.value&&
48
- a.value.tracks&&this.h&&this.h.load()}Ib(a,b){const c=wV(b);this.K.forEach(d=>d(c))}lb(a,b){a=wV(b);"event"===a.type&&a.name===_.ug&&this.trigger(new _.H(_.Tc,{visible:!!a.visible}))}Aa(){this.trigger(new _.H(_.$f))}cb(a){const b=this;return _.v(function*(){let c=null;const d=yield yV(a,[_.Tf,_.Ac],b.I,b.j);d&&(c=new chrome.cast.media.Track(b.ja++,chrome.cast.media.TrackType.TEXT),c.language=d.language,c.name=d.label||null,c.trackContentId=d.url,c.trackContentType=d.mimeType,c.customData={mimeType:a.mimeType,
49
- url:a.url});return c})}getTextDisplayer(){return null}},NV=!1,IV=new Set,KV=!1,LV=[];window.__onGCastApiAvailable=MV;_.w("clpp.cast.onReady",function(a){KV?a():LV.push(a)});var QW=class extends _.Cu{constructor(a,b,c){super();this.f=a;this.h=b;this.j=this.l;typeof c===_.Wd&&(this.j=(d,e)=>c(_.Uo(d),e));this.a=aW(this);this.g=new _.S(nV);this.forwardEventsTo(this.f)}destroy(){const a=this;return _.v(function*(){a.a&&(yield OV(a.a),a.a=null);a.stopForwardingEventsTo(a.f)})}l(a,b){11!==a&&0!==a&&(delete b.license,this.f.open(b))}Qc(){return!!this.a&&this.a.ed()&&NV}ya(){return!!this.a&&this.a.ya()}We(){return this.a?this.a.We():""}Xd(a){this.a&&this.a.Xd(a)}cast(a,b){const c=
50
- this;return _.v(function*(){if(c.a)try{if(yield c.a.cast(),c.a){{let e=null;const f=c.f.Sa();if(f){const g=c.f.getTrackManager(),h=g.getVideoTracks()[0];let k,l;h&&h.mimeType&&(k=h.mimeType);const m=c.f.getConfiguration(),n=g.ra();n&&(n.mimeType&&(l=n.mimeType),n.language&&(m.preferredAudioLanguage=n.language),n.roles.length&&(m.preferredAudioRole=n.roles[0]));const p=g.ua();p&&(p.language&&(m.preferredTextLanguage=p.language),p.roles.length&&(m.preferredTextRole=p.roles[0]));const u=f&&typeof f.isLive===
51
- _.Mc?f.isLive:c.f.isLive();e={source:f,isLive:u,autoplay:!c.f.isPaused(),currentTime:Math.max(c.f.getPosition()-1,0),mf:c.f.getPresentationStartTime(),videoMimeType:k,audioMimeType:l,Fa:m}}var d=e}b&&d&&(d.queueData={items:b.items,startIndex:b.startIndex});yield $V(c);c.a&&(d&&(d.autoplay=!c.f.isPaused()),a?yield c.f.open(a):c.a.a||(yield QV(c.a,d)))}}catch(e){c.g.error("Error while trying to cast",e),d=new _.H(_.Sd,{detail:e}),c.trigger(d)}})}oe(){this.a&&this.a.oe()}Eh(a){const b=this;return _.v(function*(){a!==
52
- b.h&&(b.h=a,b.a&&(yield OV(b.a)),b.a=aW(b))})}sendMessage(a){const b=this;return _.v(function*(){b.a?yield b.a.sendMessage(qV,a):b.g.warn(mV)})}Qg(){const a=this;return _.v(function*(){yield a.a.sendMessage(sV,{type:"QUEUE_NEXT",requestId:CV(),mediaSessionId:a.a.a.mediaSessionId})})}Rg(){const a=this;return _.v(function*(){yield a.a.sendMessage(sV,{type:"QUEUE_PREV",requestId:CV(),mediaSessionId:a.a.a.mediaSessionId})})}Pg(a){const b=this;return _.v(function*(){yield b.a.sendMessage(sV,{type:"QUEUE_INSERT",
53
- requestId:CV(),mediaSessionId:b.a.a.mediaSessionId,items:a})})}addMessageListener(a){this.a?this.a.addMessageListener(a):this.g.warn(mV)}removeMessageListener(a){this.a?this.a.removeMessageListener(a):this.g.warn(mV)}Lb(){return this.a&&this.a.Lb()}fc(a){this.a&&this.a.fc(a)}Se(){this.a&&this.a.Se()}zf(a){this.a&&this.a.zf(a)}xf(a){this.a&&this.a.xf(a)}wf(a){this.a&&this.a.wf(a)}yf(a){this.a&&this.a.yf(a)}};_.w(nV,QW);QW.prototype.setContentReleaseDate=QW.prototype.yf;
54
- QW.prototype.setContentArtist=QW.prototype.wf;QW.prototype.setContentImage=QW.prototype.xf;QW.prototype.setContentTitle=QW.prototype.zf;QW.prototype.clearContentMetadata=QW.prototype.Se;QW.prototype.setContentMetadata=QW.prototype.fc;QW.prototype.getContentMetadata=QW.prototype.Lb;QW.prototype.removeMessageListener=QW.prototype.removeMessageListener;QW.prototype.addMessageListener=QW.prototype.addMessageListener;QW.prototype.queueAddItems=QW.prototype.Pg;QW.prototype.queuePreviousItem=QW.prototype.Rg;
55
- QW.prototype.queueNextItem=QW.prototype.Qg;QW.prototype.sendMessage=QW.prototype.sendMessage;QW.prototype.changeReceiverId=QW.prototype.Eh;QW.prototype.forceDisconnect=QW.prototype.oe;QW.prototype.cast=QW.prototype.cast;QW.prototype.setPlayerConfigInterceptor=QW.prototype.Xd;QW.prototype.getReceiverName=QW.prototype.We;QW.prototype.isCasting=QW.prototype.ya;QW.prototype.canCast=QW.prototype.Qc;QW.prototype.destroy=QW.prototype.destroy;var RW=class extends NW{constructor(a){super(a,"clpp.cast.StateManager");this.I=this.S.bind(this);this.H=this.R.bind(this);this.A=this.ca.bind(this);this.w=this.Z.bind(this);this.K=this.W.bind(this);this.J=this.U.bind(this);this.L=this.ja.bind(this);this.G=this.da.bind(this);this.F=this.P.bind(this);this.f=this.M.bind(this)}init(){const a=cast.framework.events.EventType,b=cast.framework.CastReceiverContext.getInstance().getPlayerManager();b.addEventListener(a.PLAYING,this.I);b.addEventListener(a.PAUSE,
43
+ 0:0}getStats(){return this.f?this.a&&this.a.customData&&this.a.customData.stats?yV(this.a.customData.stats):_.$o():_.$o()}isLive(){return this.f?Infinity===this.getDuration():!1}load(a){const b=this;return _.v(function*(){if(b.ed())if(PV){b.C=_.cp(a);b.j=_.um([b.G,a]);var c=b.C[b.B];yield SV(b,{source:c,isLive:c.isLive,autoplay:b.j.autoplay,Ga:b.j,videoMimeType:c.videoMimeType,audioMimeType:c.audioMimeType})}else b.g.warn(kV);else b.g.warn(nV)})}getBufferInfo(){return new _.Au}getTrackManager(){return this.h}getConfiguration(){return this.j}getSurface(){return null}setNetworkEngine(a){this.I=
44
+ a}getNetworkEngine(){return this.I}getSourceIndex(){return this.B}setSourceIndex(a){this.B=a}setCmsdManager(){}getLoadedSource(){return this.C[this.B]}getPeriods(){return[]}getDrmInfo(){return null}getTimelineCues(){return[]}getCueTimeline(){return null}resetAbr(){this.g.warn(mV)}onError(a){if(a&&(this.trigger(new _.H(_.Sd,{detail:a})),this.l))this.l.onError(a)}namespace(){return _.gd}canPlay(){return this.ed()?2:0}Mb(){return this.H}gc(a){this.H=WV(a)}Se(){this.H=null}zf(a){if(this.f){var b=this.Mb()||
45
+ {};a={metadataType:UV(b.metadataType),title:a};this.gc(Object.assign({},b,a))}}xf(a){if(this.f){var b=this.Mb()||{},c=UV(b.metadataType);a=new chrome.cast.Image(a);this.gc(Object.assign({},b,{metadataType:c,images:[a]}))}}wf(a){if(this.f){var b=this.Mb()||{};this.gc(Object.assign({},b,{metadataType:3,artist:a}))}}yf(a){if(this.f){var b=this.Mb()||{};a={metadataType:UV(b.metadataType),releaseDate:a};this.gc(Object.assign({},b,a))}}fb(a){const b=cast.framework.CastContext.getInstance(),c=a.castState===
46
+ cast.framework.CastState.CONNECTED;PV=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.ca=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.w.Ef()}Vb(a){this.g.debug(`state: ${a.sessionState}, details:`,a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;ZV(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.ya()||(this.A=!0,ZV(this,a.session),this.Z());break;case cast.framework.SessionState.SESSION_ENDED:if(this.ya()&&
47
+ this.a){const d=this.a.media;var b=this.h.ra(),c=this.h.ua();b=b&&b.language||void 0;c=c&&c.language||void 0;this.R(this.getState(),{source:{url:d.contentId,type:d.contentType,isLive:this.isLive()},currentTime:$V(this),Zg:c,Tf:b})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.W);a.session.removeMessageListener(sV,this.P);a.session.removeMessageListener(tV,this.U);this.A=!1;this.a=null}}Ib(a){this.g.debug("New media session",a.mediaSession);YV(this,a.mediaSession)}Kb(a){a.value&&
48
+ a.value.tracks&&this.h&&this.h.load()}Jb(a,b){const c=yV(b);this.K.forEach(d=>d(c))}nb(a,b){a=yV(b);"event"===a.type&&a.name===_.ug&&this.trigger(new _.H(_.Tc,{visible:!!a.visible}))}Aa(){this.trigger(new _.H(_.$f))}eb(a){const b=this;return _.v(function*(){let c=null;const d=yield AV(a,[_.Tf,_.Ac],b.I,b.j);d&&(c=new chrome.cast.media.Track(b.ja++,chrome.cast.media.TrackType.TEXT),c.language=d.language,c.name=d.label||null,c.trackContentId=d.url,c.trackContentType=d.mimeType,c.customData={mimeType:a.mimeType,
49
+ url:a.url});return c})}getTextDisplayer(){return null}},PV=!1,KV=new Set,MV=!1,NV=[];window.__onGCastApiAvailable=OV;_.w("clpp.cast.onReady",function(a){MV?a():NV.push(a)});var SW=class extends _.Du{constructor(a,b,c){super();this.f=a;this.h=b;this.j=this.l;typeof c===_.Wd&&(this.j=(d,e)=>c(_.Vo(d),e));this.a=cW(this);this.g=new _.S(pV);this.forwardEventsTo(this.f)}destroy(){const a=this;return _.v(function*(){a.a&&(yield QV(a.a),a.a=null);a.stopForwardingEventsTo(a.f)})}l(a,b){11!==a&&0!==a&&(delete b.license,this.f.open(b))}Qc(){return!!this.a&&this.a.ed()&&PV}ya(){return!!this.a&&this.a.ya()}We(){return this.a?this.a.We():""}Xd(a){this.a&&this.a.Xd(a)}cast(a,b){const c=
50
+ this;return _.v(function*(){if(c.a)try{if(yield c.a.cast(),c.a){{let e=null;const f=c.f.Ua();if(f){const g=c.f.getTrackManager(),h=g.getVideoTracks()[0];let k,l;h&&h.mimeType&&(k=h.mimeType);const m=c.f.getConfiguration(),n=g.ra();n&&(n.mimeType&&(l=n.mimeType),n.language&&(m.preferredAudioLanguage=n.language),n.roles.length&&(m.preferredAudioRole=n.roles[0]));const p=g.ua();p&&(p.language&&(m.preferredTextLanguage=p.language),p.roles.length&&(m.preferredTextRole=p.roles[0]));const u=f&&typeof f.isLive===
51
+ _.Mc?f.isLive:c.f.isLive();e={source:f,isLive:u,autoplay:!c.f.isPaused(),currentTime:Math.max(c.f.getPosition()-1,0),mf:c.f.getPresentationStartTime(),videoMimeType:k,audioMimeType:l,Ga:m}}var d=e}b&&d&&(d.queueData={items:b.items,startIndex:b.startIndex});yield bW(c);c.a&&(d&&(d.autoplay=!c.f.isPaused()),a?yield c.f.open(a):c.a.a||(yield SV(c.a,d)))}}catch(e){c.g.error("Error while trying to cast",e),d=new _.H(_.Sd,{detail:e}),c.trigger(d)}})}oe(){this.a&&this.a.oe()}Eh(a){const b=this;return _.v(function*(){a!==
52
+ b.h&&(b.h=a,b.a&&(yield QV(b.a)),b.a=cW(b))})}sendMessage(a){const b=this;return _.v(function*(){b.a?yield b.a.sendMessage(sV,a):b.g.warn(oV)})}Qg(){const a=this;return _.v(function*(){yield a.a.sendMessage(uV,{type:"QUEUE_NEXT",requestId:EV(),mediaSessionId:a.a.a.mediaSessionId})})}Rg(){const a=this;return _.v(function*(){yield a.a.sendMessage(uV,{type:"QUEUE_PREV",requestId:EV(),mediaSessionId:a.a.a.mediaSessionId})})}Pg(a){const b=this;return _.v(function*(){yield b.a.sendMessage(uV,{type:"QUEUE_INSERT",
53
+ requestId:EV(),mediaSessionId:b.a.a.mediaSessionId,items:a})})}addMessageListener(a){this.a?this.a.addMessageListener(a):this.g.warn(oV)}removeMessageListener(a){this.a?this.a.removeMessageListener(a):this.g.warn(oV)}Mb(){return this.a&&this.a.Mb()}gc(a){this.a&&this.a.gc(a)}Se(){this.a&&this.a.Se()}zf(a){this.a&&this.a.zf(a)}xf(a){this.a&&this.a.xf(a)}wf(a){this.a&&this.a.wf(a)}yf(a){this.a&&this.a.yf(a)}};_.w(pV,SW);SW.prototype.setContentReleaseDate=SW.prototype.yf;
54
+ SW.prototype.setContentArtist=SW.prototype.wf;SW.prototype.setContentImage=SW.prototype.xf;SW.prototype.setContentTitle=SW.prototype.zf;SW.prototype.clearContentMetadata=SW.prototype.Se;SW.prototype.setContentMetadata=SW.prototype.gc;SW.prototype.getContentMetadata=SW.prototype.Mb;SW.prototype.removeMessageListener=SW.prototype.removeMessageListener;SW.prototype.addMessageListener=SW.prototype.addMessageListener;SW.prototype.queueAddItems=SW.prototype.Pg;SW.prototype.queuePreviousItem=SW.prototype.Rg;
55
+ SW.prototype.queueNextItem=SW.prototype.Qg;SW.prototype.sendMessage=SW.prototype.sendMessage;SW.prototype.changeReceiverId=SW.prototype.Eh;SW.prototype.forceDisconnect=SW.prototype.oe;SW.prototype.cast=SW.prototype.cast;SW.prototype.setPlayerConfigInterceptor=SW.prototype.Xd;SW.prototype.getReceiverName=SW.prototype.We;SW.prototype.isCasting=SW.prototype.ya;SW.prototype.canCast=SW.prototype.Qc;SW.prototype.destroy=SW.prototype.destroy;var TW=class extends PW{constructor(a){super(a,"clpp.cast.StateManager");this.I=this.S.bind(this);this.H=this.R.bind(this);this.A=this.ca.bind(this);this.w=this.Z.bind(this);this.K=this.W.bind(this);this.J=this.U.bind(this);this.L=this.ja.bind(this);this.G=this.da.bind(this);this.F=this.P.bind(this);this.f=this.M.bind(this)}init(){const a=cast.framework.events.EventType,b=cast.framework.CastReceiverContext.getInstance().getPlayerManager();b.addEventListener(a.PLAYING,this.I);b.addEventListener(a.PAUSE,
56
56
  this.H);b.addEventListener(a.MEDIA_FINISHED,this.A);b.addEventListener(a.BUFFERING,this.w);b.addEventListener(a.SEEKING,this.K);b.addEventListener(a.SEEKED,this.J);b.addEventListener(a.STALLED,this.L);b.addEventListener(a.PLAYER_LOADING,this.G);b.addEventListener(a.ERROR,this.F);b.addEventListener(a.BITRATE_CHANGED,this.f)}destroy(){const a=this,b=()=>Object.getPrototypeOf(Object.getPrototypeOf(this)).destroy;return _.v(function*(){const c=cast.framework.events.EventType,d=cast.framework.CastReceiverContext.getInstance().getPlayerManager();
57
57
  d.removeEventListener(c.PLAYING,a.I);d.removeEventListener(c.PAUSE,a.H);d.removeEventListener(c.MEDIA_FINISHED,a.A);d.removeEventListener(c.BUFFERING,a.w);d.removeEventListener(c.SEEKING,a.K);d.removeEventListener(c.SEEKED,a.J);d.removeEventListener(c.STALLED,a.L);d.removeEventListener(c.PLAYER_LOADING,a.G);d.removeEventListener(c.ERROR,a.F);d.removeEventListener(c.BITRATE_CHANGED,a.f);yield b().call(a)})}S(){this.player.trigger(new _.H(_.Re));this.a(8)}R(){this.a(10)}ca(){this.a(11)}Z(a){a.isBuffering?
58
- this.a(6):(a=this.player.isPaused()?10:8,this.a(a))}W(){this.j=1;this.player.trigger(new _.H(_.kg))}U(){this.player.trigger(new _.H(_.jg))}ja(){this.j=2}da(){this.a(2)}M(a){const b=this.player.getStats();this.player.trigger(new _.H(_.Lc,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))}P(a){a=new _.J(_.C,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.H(_.Sd,{detail:a}));this.a(3)}};var SW=class extends _.Cu{constructor(a=[],b=0){super();this.a=a.slice();this.f=b}Fd(){return this.a}getPosition(){return this.f}Mb(){return this.a[this.f]||null}tg(){return this.a[this.f+1]||null}setPosition(a){0>a||a>=this.a.length||(this.f=a,this.trigger(new _.H(_.df,{item:this.Mb()})))}append(a){this.a.push(a);bW(this)}xg(a,b){0>b||b>this.a.length||(this.a.splice(b,0,a),bW(this))}remove(a){0>a||a>=this.a.length||a===this.f||(this.a.splice(a,1),this.f>a&&this.f--,bW(this))}clear(){this.a=[];this.f=
59
- 0;bW(this)}};var TW=class extends _.Cu{constructor(a,b,c){c=void 0===c?()=>Promise.resolve():c;super();this.m=a;this.a=b;this.w=c;this.j=this.f=this.h=!1;this.o=()=>{const d=this;return _.v(function*(){if(!d.f){var e=d.a.Mb();if(e){d.f=!0;try{yield d.w(e),yield d.m.open(Object.assign({},e.configuration,{autoplay:!0}))}catch(f){throw f;}finally{d.f=!1}}}})};this.l=()=>{dW(this)}}start(){this.h||this.f||(this.h=!0,this.m.on(_.Rd,this.l),cW(this),this.a.setPosition(this.a.getPosition()))}next(){const a=this.a.Mb();
60
- a&&!1===a.skippable||dW(this)}Ud(){var a=this.a.Mb();a&&!1===a.skippable||(cW(this),a=Math.max(0,this.a.getPosition()-1),this.a.setPosition(a))}cd(a){const b=this;return _.v(function*(){b.a.setPosition(a)})}stop(){this.h=!1;this.m.off(_.Rd,this.l);this.a.off(_.df,this.o);this.j=!1}};var UW=class{constructor(a,b,c){this.player=a;this.Sb=new SW(c);this.pd=new TW({open:this.player.open.bind(this.player),off:this.player.off.bind(this.player),on:this.player.on.bind(this.player)},this.Sb,()=>_.v(function*(){}));this.a=new QW(this.player,b,(d,e)=>{const f=this;return _.v(function*(){const g=f.Sb.getPosition();f.pd.cd(g);e.autoplay=!0;delete e.license;yield f.player.open(e);typeof e.currentTime===_.r&&(yield f.player.setPosition(Math.max(e.currentTime-1,0)));f.player.play()})});this.f=
61
- d=>{d&&d.type===jV&&typeof d.index===_.r&&this.Sb.setPosition(d.index)};this.a.addMessageListener(this.f)}zi(a){return this.Sb.on(_.df,a)}Ai(a){return this.Sb.on(_.ef,a)}wi(a){return this.player.on(_.Sc,a)}Qc(){return this.a.Qc()}ai(){return this.Sb.Fd()}ya(){return this.a.ya()}append(a){const b=this;return _.v(function*(){b.Sb.append(a);b.a.ya()&&(yield b.a.Pg(eW([a])))})}Vh(){return this.Sb.getPosition()}start(){this.pd.start()}play(){this.player.play()}pause(){this.player.pause()}destroy(){this.pd.stop();
62
- this.a.removeMessageListener(this.f);this.a.destroy();this.player.release()}fj(){const a=this;return _.v(function*(){if(a.a.ya())a.a.oe();else{a.pd.stop();var b=eW(a.Sb.Fd()),c=a.Sb.getPosition();yield a.a.cast(void 0,{items:b,startIndex:c})}})}next(){const a=this;return _.v(function*(){a.a.ya()?yield a.a.Qg():yield a.pd.next()})}Ud(){const a=this;return _.v(function*(){a.a.ya()?yield a.a.Rg():yield a.pd.Ud()})}};_.w("clpp.cast.playlist.CastPlaylist",UW);UW.prototype.previous=UW.prototype.Ud;
63
- UW.prototype.next=UW.prototype.next;UW.prototype.toggleCast=UW.prototype.fj;UW.prototype.destroy=UW.prototype.destroy;UW.prototype.pause=UW.prototype.pause;UW.prototype.play=UW.prototype.play;UW.prototype.start=UW.prototype.start;UW.prototype.getCurrentIndex=UW.prototype.Vh;UW.prototype.append=UW.prototype.append;UW.prototype.isCasting=UW.prototype.ya;UW.prototype.getPlaylistItems=UW.prototype.ai;UW.prototype.canCast=UW.prototype.Qc;UW.prototype.onCastStatusChanged=UW.prototype.wi;
64
- UW.prototype.onPlaylistModified=UW.prototype.Ai;UW.prototype.onPlaylistItemChange=UW.prototype.zi;var Y=class{constructor(a,b,c,d,e){this.a=a;this.f=b;this.l=typeof c===_.r?c:1;this.h=typeof d===_.r?d:1;this.j=typeof e===_.r?e:0}fb(){return"Google Cast Framework"}gb(){return cast.framework.VERSION}ib(){return 0}getId(){return this.a.id}getCreativeId(){return""}yb(){return""}getApiFramework(){return null}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return this.a.title||""}getDuration(){return this.a.duration||0}getPosition(){return 0}getSkipTimeOffset(){return this.a.whenSkippable||
65
- 0}Ab(){return!1}Ra(){return this.a.clickThroughUrl||null}getMediaUrl(){return this.a.contentUrl||this.a.contentId||null}Va(){return 0}Ua(){return 0}Ba(){return 0}Ca(){switch(this.ob()){case 0:return 0;case -1:return _.Mj;default:return _.Pj}}getPodIndex(){return this.j}ob(){return this.f.position}hb(){return this.l}Wa(){return this.h}getWrapperAdIds(){return[]}canSeek(){return!1}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}zb(){return null}};Y.prototype.getVideoElement=Y.prototype.zb;
66
- Y.prototype.getWrapperCreativeIds=Y.prototype.getWrapperCreativeIds;Y.prototype.getWrapperAdSystems=Y.prototype.getWrapperAdSystems;Y.prototype.canSeek=Y.prototype.canSeek;Y.prototype.getWrapperAdIds=Y.prototype.getWrapperAdIds;Y.prototype.getSequenceLength=Y.prototype.Wa;Y.prototype.getPositionInSequence=Y.prototype.hb;Y.prototype.getPodTimeOffset=Y.prototype.ob;Y.prototype.getPodIndex=Y.prototype.getPodIndex;Y.prototype.getPodType=Y.prototype.Ca;Y.prototype.getMediaBitrate=Y.prototype.Ba;
67
- Y.prototype.getMediaHeight=Y.prototype.Ua;Y.prototype.getMediaWidth=Y.prototype.Va;Y.prototype.getMediaUrl=Y.prototype.getMediaUrl;Y.prototype.getClickThroughUrl=Y.prototype.Ra;Y.prototype.isBumper=Y.prototype.Ab;Y.prototype.getSkipTimeOffset=Y.prototype.getSkipTimeOffset;Y.prototype.getPosition=Y.prototype.getPosition;Y.prototype.getDuration=Y.prototype.getDuration;Y.prototype.getTitle=Y.prototype.getTitle;Y.prototype.getAdvertiserName=Y.prototype.getAdvertiserName;Y.prototype.getAdSystem=Y.prototype.getAdSystem;
68
- Y.prototype.getApiFramework=Y.prototype.getApiFramework;Y.prototype.getSourceId=Y.prototype.yb;Y.prototype.getCreativeId=Y.prototype.getCreativeId;Y.prototype.getId=Y.prototype.getId;Y.prototype.getTechnology=Y.prototype.ib;Y.prototype.getAdManagerVersion=Y.prototype.gb;Y.prototype.getAdManagerName=Y.prototype.fb;var VW=class{constructor(a){this.a=a}getCuePoints(){return this.a.map(a=>a.position)}Qb(){return!!this.a.find(a=>0===a.position)}Pb(){return!!this.a.find(a=>-1===a.position)}};VW.prototype.hasPostroll=VW.prototype.Pb;VW.prototype.hasPreroll=VW.prototype.Qb;VW.prototype.getCuePoints=VW.prototype.getCuePoints;var WW=class{constructor(a){this.m=a;this.a=null;this.B=this.C.bind(this);this.l=[cast.framework.events.EventType.PLAYER_LOADING,cast.framework.events.EventType.BREAK_CLIP_LOADING,cast.framework.events.EventType.BREAK_STARTED,cast.framework.events.EventType.BREAK_ENDED,cast.framework.events.EventType.BREAK_CLIP_STARTED,cast.framework.events.EventType.BREAK_CLIP_ENDED,cast.framework.events.EventType.PLAYING,cast.framework.events.EventType.PAUSE,cast.framework.events.EventType.BUFFERING];this.f=!1;
69
- kW().addEventListener(this.l,this.B)}load(){const a=this;return _.v(function*(){fW&&(fW=!1,jW(a,0))})}j(){return!0}A(){}Ja(){-1!==this.getPosition()&&kW().pause()}skip(){}getAdVolume(){gW.warn(tV);return 0}h(){gW.warn(tV)}setMuted(){}isMuted(){return!1}pb(){return-1!==this.getPosition()}isPaused(){return this.f}getPosition(){const a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.r?a:-1}w(){return!0}o(){const a=this;return _.v(function*(){kW().removeEventListener(a.l,a.B)})}setVolume(a){this.h(a)}getVolume(){return this.getAdVolume()}pause(){this.Ja()}resume(){this.j()}C(a){const b=
70
- cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=kW().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.m.trigger(new _.H(_.oc,{adsTimeline:new VW(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:mW(this,_.bc,a);break;case cast.framework.events.EventType.BREAK_STARTED:mW(this,_.Sb,a);break;case cast.framework.events.EventType.BREAK_ENDED:mW(this,_.Tb,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:mW(this,
71
- _.kc,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(mW(this,_.ic,a),mW(this,_.lc,a)):a.endedReason===b.STOPPED?mW(this,_.lc,a):a.endedReason===b.END_OF_STREAM?(mW(this,_.Wb,a),mW(this,_.lc,a)):a.endedReason===b.ERROR&&jW(this,1);break;case cast.framework.events.EventType.PLAYING:this.f=!1;mW(this,_.fc,a);break;case cast.framework.events.EventType.PAUSE:this.f=!0;mW(this,_.dc,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?mW(this,_.Ub,
72
- a):(this.f=!1,mW(this,_.fc,a))}}};WW.prototype.resume=WW.prototype.resume;WW.prototype.pause=WW.prototype.pause;WW.prototype.getVolume=WW.prototype.getVolume;WW.prototype.setVolume=WW.prototype.setVolume;WW.prototype.getPosition=WW.prototype.getPosition;WW.prototype.skip=WW.prototype.skip;var fW=!1,gW=new _.S("clpp.cast.ads.AdsManager");var XW=class{constructor(a){this.a=a;this.f=this.h.bind(this)}init(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(nW(),this.f)}release(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(nW(),this.f)}getTimelineCues(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(a=>oW(a))}h(a){if(a instanceof cast.framework.events.TimedMetadataEvent){var b=null;switch(a.type){case cast.framework.events.EventType.TIMED_METADATA_CHANGED:b=
73
- _.Wf;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.Xf;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.Yf}b&&this.a(new _.H(b,{detail:oW(a.timedMetadataInfo)}))}else for(b of this.getTimelineCues())this.a(new _.H(_.Wf,{detail:b}))}};var YW=class extends _.U{constructor(){super();this.g=new _.S("clpp.cast.TrackManager");this.m=null;this.o=1E9;this.h=[];this.j=[];this.l=this.w.bind(this);this.a=this.f=null}initialize(a){this.m=a;pW().addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)}release(){this.h=[];this.j=[];this.a=this.f=null}load(){}destroy(){this.m=null;pW().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)}getVideoTracks(){return[]}getAudioTracks(){return this.h}sa(){return this.j}ta(){return null}Qa(){const a=
74
- this.ra();return a&&a.renditions[0]}Xa(){const a=this.ua();return a&&a.renditions[0]}wb(){return null}Nb(){return null}Ob(){return null}Ia(){return null}ra(){let a=null;if(this.f){let b=this.f.getActiveId();typeof b===_.r&&(b=b.toString(),a=this.getAudioTracks().find(c=>c.id===b)||null)}return a}ua(){let a=null;if(this.a){let b=this.a.getActiveIds()[0];typeof b===_.r&&(b=b.toString(),a=this.sa().find(c=>c.id===b)||null)}return a}Fb(){this.g.warn("Video tracks unavailable on Cast")}za(a){a&&this.f&&
75
- this.f.setActiveById(+a.id)}ab(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))}rb(){this.g.warn("Video renditions unavailable on Cast")}Db(a){this.za(a&&a.track)}Eb(a){this.ab(a&&a.track)}addTextTrack(a){const b=this;return _.v(function*(){var c=b.m.getConfiguration();if((c=yield yV(a,Object.values(cast.framework.messages.CaptionMimeType),b.m.getNetworkEngine(),c))&&b.a){const d=new cast.framework.messages.Track(b.o++,cast.framework.messages.TrackType.TEXT);d.isInband=!1;d.language=
76
- c.language;d.name=c.label;d.subtype=c.kind;d.trackContentId=c.url;d.trackContentType=c.mimeType;d.customData={mimeType:a.mimeType,url:a.url};try{b.a.addTracks([d]),rW(b)}catch(e){throw b.g.warn("failed on track",a),e;}}})}va(){return!0}w(){this.f=pW().getAudioTracksManager();var a=this.f.getTracks();this.h=qW(_.M,a);rW(this);a=this.m.getConfiguration();sW(this,_.M,a.preferredAudioLanguage,a.preferredAudioRole);sW(this,_.L,a.preferredTextLanguage,a.preferredTextRole)}};YW.prototype.isAbrEnabled=YW.prototype.va;
77
- YW.prototype.addTextTrack=YW.prototype.addTextTrack;YW.prototype.setTextRendition=YW.prototype.Eb;YW.prototype.setAudioRendition=YW.prototype.Db;YW.prototype.setVideoRendition=YW.prototype.rb;YW.prototype.setTextTrack=YW.prototype.ab;YW.prototype.setAudioTrack=YW.prototype.za;YW.prototype.setVideoTrack=YW.prototype.Fb;YW.prototype.getTextTrack=YW.prototype.ua;YW.prototype.getAudioTrack=YW.prototype.ra;YW.prototype.getVideoTrack=YW.prototype.Ia;YW.prototype.getLoadingTextRendition=YW.prototype.Ob;
78
- YW.prototype.getLoadingAudioRendition=YW.prototype.Nb;YW.prototype.getLoadingVideoRendition=YW.prototype.wb;YW.prototype.getTextRendition=YW.prototype.Xa;YW.prototype.getAudioRendition=YW.prototype.Qa;YW.prototype.getVideoRendition=YW.prototype.ta;YW.prototype.getTextTracks=YW.prototype.sa;YW.prototype.getAudioTracks=YW.prototype.getAudioTracks;YW.prototype.getVideoTracks=YW.prototype.getVideoTracks;var ZW=class extends _.Cu{constructor(){super();this.g=new _.S(oV);this.h=this.w=_.rm();this.A=null;this.l=-1;this.F=new _.Jr;this.f=this.o=this.j=this.a=this.B=null;this.C=!1}init(a,b){this.B=a;b&&(this.h=this.w=b);a=tW();a.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.H.bind(this));a.setMediaPlaybackInfoHandler(this.G.bind(this));this.a=new RW(this);this.a.init();this.j=new YW;this.j.initialize(this);this.o=new XW(c=>this.trigger(c));this.o.init()}unload(){const a=
79
- cast.framework.messages.PlayerState,b=tW();b.getPlayerState()!==a.IDLE&&b.stop();this.j&&this.j.release();this.o&&this.o.release();this.f=null;return Promise.resolve()}release(){return this.unload().then(()=>{this.a&&this.a.release()})}destroy(){const a=this;return _.v(function*(){a.B=null;a.w=_.rm();a.h=a.w;a.l=-1;a.A=null;a.a&&(yield a.a.destroy(),a.a=null);a.j&&(a.j.destroy(),a.j=null)})}play(){tW().play();return Promise.resolve()}pause(){tW().pause();return Promise.resolve()}isPaused(){return tW().getPlayerState()===
80
- cast.framework.messages.PlayerState.PAUSED}isEnded(){return tW().getPlayerState()===cast.framework.messages.PlayerState.IDLE}seek(a){const b=tW();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(fV);b.seek(a);return Promise.resolve()}getPosition(){return this.getMediaPosition()}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}getMediaPosition(){return tW().getCurrentTimeSec()}getDuration(){return this.getMediaDuration()}getMediaDuration(){const a=
81
- tW().getDurationSec();return typeof a===_.r?-1===a?Infinity:a:-1}getPlaybackRate(){return tW().getPlaybackRate()}setPlaybackRate(a){if(0<a){const b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;tW().sendLocalMediaRequest(b)}}getVolume(){this.g.warn(tV);return null}setVolume(){this.g.warn(tV)}setMuted(){this.g.warn(tV)}isMuted(){this.g.warn(tV);return!1}getLoadedSource(){const a=tW().getMediaInformation();if(a){var b=tW().getPlaybackConfig();b=!!b&&b.protectionSystem!==cast.framework.ContentProtection.NONE;
82
- var c=this.A&&-1!==this.l?this.A[this.l]:null;c=c?c.name:void 0;!c&&a.metadata&&(c=a.metadata.title);return{url:a.contentId,type:a.contentType,drmProtected:b,name:c}}return null}getDrmInfo(){return null}getPresentationStartTime(){return tW().getStartAbsoluteTime()}getSeekRange(){let a={start:0,end:this.getDuration()};if(this.isLive()){const b=tW().getLiveSeekableRange();b&&typeof b.start===_.r&&typeof b.end===_.r&&(a={start:b.start,end:b.end})}return a}getState(){return this.a?this.a.getState():0}getStats(){var a=
83
- _.Zo();if(this.f){a=tW().getStats();this.f.h=a.estimatedBandwidth||NaN;this.f.w=a.streamBandwidth||NaN;var b=this.f,c=a.height||NaN;b.A=a.width||NaN;b.j=c;b=this.f;c=typeof a.decodedFrames===_.r?a.decodedFrames:NaN;b.o=typeof a.droppedFrames===_.r?a.droppedFrames:NaN;b.l=c;a=this.f.getStats()}return a}isLive(){return Infinity===this.getDuration()}load(a){const b=this;return _.v(function*(){b.f=new _.kv;b.a.l=b.f.a;b.A=_.bp(a);b.h=_.tm([b.w,a]);if(b.C)b.C=!1;else{var c=b.A[b.l],d=new cast.framework.messages.LoadRequestData;
84
- d.autoplay=b.h.autoplay;typeof b.h.startTime===_.r&&(d.currentTime=b.h.startTime);c.type&&(d.media.contentType=c.type);d.media.contentId=c.url;d.media.customData={playerConfiguration:vV(b.h),local:!0};yield tW().load(d)}})}getBufferInfo(){this.g.warn(_.ra);return new _.zu}getTrackManager(){return this.j}getConfiguration(){return this.h}getSurface(){return this.B}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.Ya)}appendLoad(){return Promise.reject(_.Ya)}seekWith(){return Promise.reject(_.Ya)}setNetworkEngine(a){this.F=
85
- a}setCmsdManager(){}getNetworkEngine(){return this.F}getSourceIndex(){return this.l}setSourceIndex(a){this.l=a}getPeriods(){return[]}namespace(){return oV}getTimelineCues(){return this.o&&this.o.getTimelineCues()||[]}getCueTimeline(){return null}resetAbr(){this.g.warn(kV)}onError(a){a=new _.H(_.Sd,{detail:a});this.trigger(a)}canPlay(){return _.Xh()?2:0}H(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=vV(this.getStats());var b=tW(),c=a.media||b.getMediaInformation();b=
86
- b.getStartAbsoluteTime();c&&typeof b===_.r&&c.startAbsoluteTime!==b&&(this.g.info("Syncing startAbsoluteTime."+`Old value: ${c.startAbsoluteTime}, `+`new value: ${b}`),c.startAbsoluteTime=b,a=Object.assign({},a,{media:c}));{c=cast.framework.messages.StreamType;b=a.media;var d=!!b;const e=this.isLive(),f=d&&!b.metadata,g=!!a.liveSeekableRange;if(d&&g&&(!e||e&&f)){d=tW().getStartAbsoluteTime();if(typeof d===_.r){b.startAbsoluteTime=d;let h;f?h=new cast.framework.messages.GenericMediaMetadata:h=b.metadata;
87
- h.sectionStartAbsoluteTime=d;b.metadata=h}b.streamType=c.LIVE;a=Object.assign({},a,{media:b})}}return a}G(a,b){var c=null;a.media.customData&&(c=wV(a.media.customData.playerConfiguration));var d=null;var e=null;a.media.customData&&(d=wV(a.media.customData["com.castlabs.reactnative.PlayerConfiguration"]),e=wV(a.media.customData.playerConfiguration));a=(a=d&&d.LiveConfiguration)?0===a.liveEdgeLatencyMs:!1;d=!(!d||!d.lowLatencyMode);b=(e=null!=e&&e.lowLatencyMode||a||d)?xW(b,{streaming:{lowLatencyMode:!0}}):
88
- b;if(!c)return b;e=c.chromecast||null;a=c.abr||null;d=b;a&&typeof a.defaultBandwidthEstimate===_.r?d.initialBandwidth=a.defaultBandwidthEstimate:d.initialBandwidth=void 0;wW(c,b);a={};d=c.streaming||null;e&&e.useSenderStreamingConfig&&d&&(a.streaming=xV(d,LW));c=c.abr||null;e&&e.useSenderAbrConfig&&c&&(a.abr=xV(c,MW));_.$g(a)&&(b=xW(b,a));return b}getTextDisplayer(){return null}setDrmCustomDataModifier(){}setCdnErrorCallback(){}detach(){}};var zW=class{constructor(){this.a=!1;this.g=new _.S(pV);this.f=this.m=null;this.w=new Set;this.C=this.K.bind(this);this.B=this.F.bind(this);this.o=null;this.l=new _.Ut;this.j=this.h=this.A=null}init(a){a&&(this.f=new ZW,_.Yr(a,this.f),this.m=a,this.l.on(window,"unload",()=>{const b=this;return _.v(function*(){b.m&&0!==b.m.getPlayerState()&&(yield uV(b.m))})}))}start(a){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var b=BW(),c=BW().getPlayerManager(),d=new cast.framework.CastReceiverOptions;
89
- a&&null!=a.useShakaForHls&&(d.useShakaForHls=a.useShakaForHls);d.customNamespaces={};d.customNamespaces[qV]=cast.framework.system.MessageType.JSON;d.customNamespaces[rV]=cast.framework.system.MessageType.JSON;a=new cast.framework.PlaybackConfig;a.manifestHandler=this.I.bind(this);a.shakaConfig={streaming:{ignoreTextStreamFailures:!0}};a.enableSmoothLiveRefresh=!0;d.playbackConfig=a;if(a=this.m&&this.m.getSurface().getMedia())d.mediaElement=a;d.disableIdleTimeout=!0;d.maxInactivity=Infinity;this.h&&
58
+ this.a(6):(a=this.player.isPaused()?10:8,this.a(a))}W(){this.j=1;this.player.trigger(new _.H(_.kg))}U(){this.player.trigger(new _.H(_.jg))}ja(){this.j=2}da(){this.a(2)}M(a){const b=this.player.getStats();this.player.trigger(new _.H(_.Lc,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))}P(a){a=new _.J(_.C,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.H(_.Sd,{detail:a}));this.a(3)}};var UW=class extends _.Du{constructor(a=[],b=0){super();this.a=a.slice();this.f=b}Fd(){return this.a}getPosition(){return this.f}Nb(){return this.a[this.f]||null}tg(){return this.a[this.f+1]||null}setPosition(a){0>a||a>=this.a.length||(this.f=a,this.trigger(new _.H(_.df,{item:this.Nb()})))}append(a){this.a.push(a);dW(this)}xg(a,b){0>b||b>this.a.length||(this.a.splice(b,0,a),dW(this))}remove(a){0>a||a>=this.a.length||a===this.f||(this.a.splice(a,1),this.f>a&&this.f--,dW(this))}clear(){this.a=[];this.f=
59
+ 0;dW(this)}};var VW=class extends _.Du{constructor(a,b,c){c=void 0===c?()=>Promise.resolve():c;super();this.m=a;this.a=b;this.w=c;this.j=this.f=this.h=!1;this.o=()=>{const d=this;return _.v(function*(){if(!d.f){var e=d.a.Nb();if(e){d.f=!0;try{yield d.w(e),yield d.m.open(Object.assign({},e.configuration,{autoplay:!0}))}catch(f){throw f;}finally{d.f=!1}}}})};this.l=()=>{fW(this)}}start(){this.h||this.f||(this.h=!0,this.m.on(_.Rd,this.l),eW(this),this.a.setPosition(this.a.getPosition()))}next(){const a=this.a.Nb();
60
+ a&&!1===a.skippable||fW(this)}Ud(){var a=this.a.Nb();a&&!1===a.skippable||(eW(this),a=Math.max(0,this.a.getPosition()-1),this.a.setPosition(a))}cd(a){const b=this;return _.v(function*(){b.a.setPosition(a)})}stop(){this.h=!1;this.m.off(_.Rd,this.l);this.a.off(_.df,this.o);this.j=!1}};var WW=class{constructor(a,b,c){this.player=a;this.Tb=new UW(c);this.pd=new VW({open:this.player.open.bind(this.player),off:this.player.off.bind(this.player),on:this.player.on.bind(this.player)},this.Tb,()=>_.v(function*(){}));this.a=new SW(this.player,b,(d,e)=>{const f=this;return _.v(function*(){const g=f.Tb.getPosition();f.pd.cd(g);e.autoplay=!0;delete e.license;yield f.player.open(e);typeof e.currentTime===_.r&&(yield f.player.setPosition(Math.max(e.currentTime-1,0)));f.player.play()})});this.f=
61
+ d=>{d&&d.type===lV&&typeof d.index===_.r&&this.Tb.setPosition(d.index)};this.a.addMessageListener(this.f)}zi(a){return this.Tb.on(_.df,a)}Ai(a){return this.Tb.on(_.ef,a)}wi(a){return this.player.on(_.Sc,a)}Qc(){return this.a.Qc()}ai(){return this.Tb.Fd()}ya(){return this.a.ya()}append(a){const b=this;return _.v(function*(){b.Tb.append(a);b.a.ya()&&(yield b.a.Pg(gW([a])))})}Vh(){return this.Tb.getPosition()}start(){this.pd.start()}play(){this.player.play()}pause(){this.player.pause()}destroy(){this.pd.stop();
62
+ this.a.removeMessageListener(this.f);this.a.destroy();this.player.release()}fj(){const a=this;return _.v(function*(){if(a.a.ya())a.a.oe();else{a.pd.stop();var b=gW(a.Tb.Fd()),c=a.Tb.getPosition();yield a.a.cast(void 0,{items:b,startIndex:c})}})}next(){const a=this;return _.v(function*(){a.a.ya()?yield a.a.Qg():yield a.pd.next()})}Ud(){const a=this;return _.v(function*(){a.a.ya()?yield a.a.Rg():yield a.pd.Ud()})}};_.w("clpp.cast.playlist.CastPlaylist",WW);WW.prototype.previous=WW.prototype.Ud;
63
+ WW.prototype.next=WW.prototype.next;WW.prototype.toggleCast=WW.prototype.fj;WW.prototype.destroy=WW.prototype.destroy;WW.prototype.pause=WW.prototype.pause;WW.prototype.play=WW.prototype.play;WW.prototype.start=WW.prototype.start;WW.prototype.getCurrentIndex=WW.prototype.Vh;WW.prototype.append=WW.prototype.append;WW.prototype.isCasting=WW.prototype.ya;WW.prototype.getPlaylistItems=WW.prototype.ai;WW.prototype.canCast=WW.prototype.Qc;WW.prototype.onCastStatusChanged=WW.prototype.wi;
64
+ WW.prototype.onPlaylistModified=WW.prototype.Ai;WW.prototype.onPlaylistItemChange=WW.prototype.zi;var Y=class{constructor(a,b,c,d,e){this.a=a;this.f=b;this.l=typeof c===_.r?c:1;this.h=typeof d===_.r?d:1;this.j=typeof e===_.r?e:0}gb(){return"Google Cast Framework"}hb(){return cast.framework.VERSION}jb(){return 0}getId(){return this.a.id}getCreativeId(){return""}yb(){return""}getApiFramework(){return null}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return this.a.title||""}getDuration(){return this.a.duration||0}getPosition(){return 0}getSkipTimeOffset(){return this.a.whenSkippable||
65
+ 0}Bb(){return!1}Ta(){return this.a.clickThroughUrl||null}getMediaUrl(){return this.a.contentUrl||this.a.contentId||null}Xa(){return 0}Wa(){return 0}Ba(){return 0}Ca(){switch(this.pb()){case 0:return 0;case -1:return _.Nj;default:return _.Qj}}getPodIndex(){return this.j}pb(){return this.f.position}ib(){return this.l}Ya(){return this.h}getWrapperAdIds(){return[]}canSeek(){return!1}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}zb(){return null}};Y.prototype.getVideoElement=Y.prototype.zb;
66
+ Y.prototype.getWrapperCreativeIds=Y.prototype.getWrapperCreativeIds;Y.prototype.getWrapperAdSystems=Y.prototype.getWrapperAdSystems;Y.prototype.canSeek=Y.prototype.canSeek;Y.prototype.getWrapperAdIds=Y.prototype.getWrapperAdIds;Y.prototype.getSequenceLength=Y.prototype.Ya;Y.prototype.getPositionInSequence=Y.prototype.ib;Y.prototype.getPodTimeOffset=Y.prototype.pb;Y.prototype.getPodIndex=Y.prototype.getPodIndex;Y.prototype.getPodType=Y.prototype.Ca;Y.prototype.getMediaBitrate=Y.prototype.Ba;
67
+ Y.prototype.getMediaHeight=Y.prototype.Wa;Y.prototype.getMediaWidth=Y.prototype.Xa;Y.prototype.getMediaUrl=Y.prototype.getMediaUrl;Y.prototype.getClickThroughUrl=Y.prototype.Ta;Y.prototype.isBumper=Y.prototype.Bb;Y.prototype.getSkipTimeOffset=Y.prototype.getSkipTimeOffset;Y.prototype.getPosition=Y.prototype.getPosition;Y.prototype.getDuration=Y.prototype.getDuration;Y.prototype.getTitle=Y.prototype.getTitle;Y.prototype.getAdvertiserName=Y.prototype.getAdvertiserName;Y.prototype.getAdSystem=Y.prototype.getAdSystem;
68
+ Y.prototype.getApiFramework=Y.prototype.getApiFramework;Y.prototype.getSourceId=Y.prototype.yb;Y.prototype.getCreativeId=Y.prototype.getCreativeId;Y.prototype.getId=Y.prototype.getId;Y.prototype.getTechnology=Y.prototype.jb;Y.prototype.getAdManagerVersion=Y.prototype.hb;Y.prototype.getAdManagerName=Y.prototype.gb;var XW=class{constructor(a){this.a=a}getCuePoints(){return this.a.map(a=>a.position)}Qb(){return!!this.a.find(a=>0===a.position)}Ab(){return!!this.a.find(a=>-1===a.position)}};XW.prototype.hasPostroll=XW.prototype.Ab;XW.prototype.hasPreroll=XW.prototype.Qb;XW.prototype.getCuePoints=XW.prototype.getCuePoints;var YW=class{constructor(a){this.m=a;this.a=null;this.B=this.C.bind(this);this.l=[cast.framework.events.EventType.PLAYER_LOADING,cast.framework.events.EventType.BREAK_CLIP_LOADING,cast.framework.events.EventType.BREAK_STARTED,cast.framework.events.EventType.BREAK_ENDED,cast.framework.events.EventType.BREAK_CLIP_STARTED,cast.framework.events.EventType.BREAK_CLIP_ENDED,cast.framework.events.EventType.PLAYING,cast.framework.events.EventType.PAUSE,cast.framework.events.EventType.BUFFERING];this.f=!1;
69
+ mW().addEventListener(this.l,this.B)}load(){const a=this;return _.v(function*(){hW&&(hW=!1,lW(a,0))})}j(){return!0}A(){}La(){-1!==this.getPosition()&&mW().pause()}skip(){}getAdVolume(){iW.warn(vV);return 0}h(){iW.warn(vV)}setMuted(){}isMuted(){return!1}Ka(){return-1!==this.getPosition()}isPaused(){return this.f}getPosition(){const a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.r?a:-1}w(){return!0}o(){const a=this;return _.v(function*(){mW().removeEventListener(a.l,a.B)})}setVolume(a){this.h(a)}getVolume(){return this.getAdVolume()}pause(){this.La()}resume(){this.j()}C(a){const b=
70
+ cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=mW().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.m.trigger(new _.H(_.oc,{adsTimeline:new XW(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:oW(this,_.bc,a);break;case cast.framework.events.EventType.BREAK_STARTED:oW(this,_.Sb,a);break;case cast.framework.events.EventType.BREAK_ENDED:oW(this,_.Tb,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:oW(this,
71
+ _.jc,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(oW(this,_.gc,a),oW(this,_.lc,a)):a.endedReason===b.STOPPED?oW(this,_.lc,a):a.endedReason===b.END_OF_STREAM?(oW(this,_.Wb,a),oW(this,_.lc,a)):a.endedReason===b.ERROR&&lW(this,1);break;case cast.framework.events.EventType.PLAYING:this.f=!1;oW(this,_.fc,a);break;case cast.framework.events.EventType.PAUSE:this.f=!0;oW(this,_.dc,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?oW(this,_.Ub,
72
+ a):(this.f=!1,oW(this,_.fc,a))}}};YW.prototype.resume=YW.prototype.resume;YW.prototype.pause=YW.prototype.pause;YW.prototype.getVolume=YW.prototype.getVolume;YW.prototype.setVolume=YW.prototype.setVolume;YW.prototype.getPosition=YW.prototype.getPosition;YW.prototype.skip=YW.prototype.skip;var hW=!1,iW=new _.S("clpp.cast.ads.AdsManager");var ZW=class{constructor(a){this.a=a;this.f=this.h.bind(this)}init(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(pW(),this.f)}release(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(pW(),this.f)}getTimelineCues(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(a=>qW(a))}h(a){if(a instanceof cast.framework.events.TimedMetadataEvent){var b=null;switch(a.type){case cast.framework.events.EventType.TIMED_METADATA_CHANGED:b=
73
+ _.Wf;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.Xf;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.Yf}b&&this.a(new _.H(b,{detail:qW(a.timedMetadataInfo)}))}else for(b of this.getTimelineCues())this.a(new _.H(_.Wf,{detail:b}))}};var $W=class extends _.U{constructor(){super();this.g=new _.S("clpp.cast.TrackManager");this.m=null;this.o=1E9;this.h=[];this.j=[];this.l=this.w.bind(this);this.a=this.f=null}initialize(a){this.m=a;rW().addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)}release(){this.h=[];this.j=[];this.a=this.f=null}load(){}destroy(){this.m=null;rW().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)}getVideoTracks(){return[]}getAudioTracks(){return this.h}sa(){return this.j}ta(){return null}Sa(){const a=
74
+ this.ra();return a&&a.renditions[0]}Za(){const a=this.ua();return a&&a.renditions[0]}wb(){return null}Ob(){return null}Pb(){return null}Ja(){return null}ra(){let a=null;if(this.f){let b=this.f.getActiveId();typeof b===_.r&&(b=b.toString(),a=this.getAudioTracks().find(c=>c.id===b)||null)}return a}ua(){let a=null;if(this.a){let b=this.a.getActiveIds()[0];typeof b===_.r&&(b=b.toString(),a=this.sa().find(c=>c.id===b)||null)}return a}Gb(){this.g.warn("Video tracks unavailable on Cast")}za(a){a&&this.f&&
75
+ this.f.setActiveById(+a.id)}bb(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))}rb(){this.g.warn("Video renditions unavailable on Cast")}Eb(a){this.za(a&&a.track)}Fb(a){this.bb(a&&a.track)}addTextTrack(a){const b=this;return _.v(function*(){var c=b.m.getConfiguration();if((c=yield AV(a,Object.values(cast.framework.messages.CaptionMimeType),b.m.getNetworkEngine(),c))&&b.a){const d=new cast.framework.messages.Track(b.o++,cast.framework.messages.TrackType.TEXT);d.isInband=!1;d.language=
76
+ c.language;d.name=c.label;d.subtype=c.kind;d.trackContentId=c.url;d.trackContentType=c.mimeType;d.customData={mimeType:a.mimeType,url:a.url};try{b.a.addTracks([d]),tW(b)}catch(e){throw b.g.warn("failed on track",a),e;}}})}va(){return!0}w(){this.f=rW().getAudioTracksManager();var a=this.f.getTracks();this.h=sW(_.M,a);tW(this);a=this.m.getConfiguration();uW(this,_.M,a.preferredAudioLanguage,a.preferredAudioRole);uW(this,_.L,a.preferredTextLanguage,a.preferredTextRole)}};$W.prototype.isAbrEnabled=$W.prototype.va;
77
+ $W.prototype.addTextTrack=$W.prototype.addTextTrack;$W.prototype.setTextRendition=$W.prototype.Fb;$W.prototype.setAudioRendition=$W.prototype.Eb;$W.prototype.setVideoRendition=$W.prototype.rb;$W.prototype.setTextTrack=$W.prototype.bb;$W.prototype.setAudioTrack=$W.prototype.za;$W.prototype.setVideoTrack=$W.prototype.Gb;$W.prototype.getTextTrack=$W.prototype.ua;$W.prototype.getAudioTrack=$W.prototype.ra;$W.prototype.getVideoTrack=$W.prototype.Ja;$W.prototype.getLoadingTextRendition=$W.prototype.Pb;
78
+ $W.prototype.getLoadingAudioRendition=$W.prototype.Ob;$W.prototype.getLoadingVideoRendition=$W.prototype.wb;$W.prototype.getTextRendition=$W.prototype.Za;$W.prototype.getAudioRendition=$W.prototype.Sa;$W.prototype.getVideoRendition=$W.prototype.ta;$W.prototype.getTextTracks=$W.prototype.sa;$W.prototype.getAudioTracks=$W.prototype.getAudioTracks;$W.prototype.getVideoTracks=$W.prototype.getVideoTracks;var aX=class extends _.Du{constructor(){super();this.g=new _.S(qV);this.h=this.w=_.sm();this.A=null;this.l=-1;this.F=new _.Kr;this.f=this.o=this.j=this.a=this.B=null;this.C=!1}init(a,b){this.B=a;b&&(this.h=this.w=b);a=vW();a.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.H.bind(this));a.setMediaPlaybackInfoHandler(this.G.bind(this));this.a=new TW(this);this.a.init();this.j=new $W;this.j.initialize(this);this.o=new ZW(c=>this.trigger(c));this.o.init()}unload(){const a=
79
+ cast.framework.messages.PlayerState,b=vW();b.getPlayerState()!==a.IDLE&&b.stop();this.j&&this.j.release();this.o&&this.o.release();this.f=null;return Promise.resolve()}release(){return this.unload().then(()=>{this.a&&this.a.release()})}destroy(){const a=this;return _.v(function*(){a.B=null;a.w=_.sm();a.h=a.w;a.l=-1;a.A=null;a.a&&(yield a.a.destroy(),a.a=null);a.j&&(a.j.destroy(),a.j=null)})}play(){vW().play();return Promise.resolve()}pause(){vW().pause();return Promise.resolve()}isPaused(){return vW().getPlayerState()===
80
+ cast.framework.messages.PlayerState.PAUSED}isEnded(){return vW().getPlayerState()===cast.framework.messages.PlayerState.IDLE}seek(a){const b=vW();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(hV);b.seek(a);return Promise.resolve()}getPosition(){return this.getMediaPosition()}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}getMediaPosition(){return vW().getCurrentTimeSec()}getDuration(){return this.getMediaDuration()}getMediaDuration(){const a=
81
+ vW().getDurationSec();return typeof a===_.r?-1===a?Infinity:a:-1}getPlaybackRate(){return vW().getPlaybackRate()}setPlaybackRate(a){if(0<a){const b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;vW().sendLocalMediaRequest(b)}}getVolume(){this.g.warn(vV);return null}setVolume(){this.g.warn(vV)}setMuted(){this.g.warn(vV)}isMuted(){this.g.warn(vV);return!1}getLoadedSource(){const a=vW().getMediaInformation();if(a){var b=vW().getPlaybackConfig();b=!!b&&b.protectionSystem!==cast.framework.ContentProtection.NONE;
82
+ var c=this.A&&-1!==this.l?this.A[this.l]:null;c=c?c.name:void 0;!c&&a.metadata&&(c=a.metadata.title);return{url:a.contentId,type:a.contentType,drmProtected:b,name:c}}return null}getDrmInfo(){return null}getPresentationStartTime(){return vW().getStartAbsoluteTime()}getSeekRange(){let a={start:0,end:this.getDuration()};if(this.isLive()){const b=vW().getLiveSeekableRange();b&&typeof b.start===_.r&&typeof b.end===_.r&&(a={start:b.start,end:b.end})}return a}getState(){return this.a?this.a.getState():0}getStats(){var a=
83
+ _.$o();if(this.f){a=vW().getStats();this.f.h=a.estimatedBandwidth||NaN;this.f.w=a.streamBandwidth||NaN;var b=this.f,c=a.height||NaN;b.A=a.width||NaN;b.j=c;b=this.f;c=typeof a.decodedFrames===_.r?a.decodedFrames:NaN;b.o=typeof a.droppedFrames===_.r?a.droppedFrames:NaN;b.l=c;a=this.f.getStats()}return a}isLive(){return Infinity===this.getDuration()}load(a){const b=this;return _.v(function*(){b.f=new _.lv;b.a.l=b.f.a;b.A=_.cp(a);b.h=_.um([b.w,a]);if(b.C)b.C=!1;else{var c=b.A[b.l],d=new cast.framework.messages.LoadRequestData;
84
+ d.autoplay=b.h.autoplay;typeof b.h.startTime===_.r&&(d.currentTime=b.h.startTime);c.type&&(d.media.contentType=c.type);d.media.contentId=c.url;d.media.customData={playerConfiguration:xV(b.h),local:!0};yield vW().load(d)}})}getBufferInfo(){this.g.warn(_.ra);return new _.Au}getTrackManager(){return this.j}getConfiguration(){return this.h}getSurface(){return this.B}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.Ya)}appendLoad(){return Promise.reject(_.Ya)}seekWith(){return Promise.reject(_.Ya)}setNetworkEngine(a){this.F=
85
+ a}setCmsdManager(){}getNetworkEngine(){return this.F}getSourceIndex(){return this.l}setSourceIndex(a){this.l=a}getPeriods(){return[]}namespace(){return qV}getTimelineCues(){return this.o&&this.o.getTimelineCues()||[]}getCueTimeline(){return null}resetAbr(){this.g.warn(mV)}onError(a){a=new _.H(_.Sd,{detail:a});this.trigger(a)}canPlay(){return _.Yh()?2:0}H(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=xV(this.getStats());var b=vW(),c=a.media||b.getMediaInformation();b=
86
+ b.getStartAbsoluteTime();c&&typeof b===_.r&&c.startAbsoluteTime!==b&&(this.g.info("Syncing startAbsoluteTime."+`Old value: ${c.startAbsoluteTime}, `+`new value: ${b}`),c.startAbsoluteTime=b,a=Object.assign({},a,{media:c}));{c=cast.framework.messages.StreamType;b=a.media;var d=!!b;const e=this.isLive(),f=d&&!b.metadata,g=!!a.liveSeekableRange;if(d&&g&&(!e||e&&f)){d=vW().getStartAbsoluteTime();if(typeof d===_.r){b.startAbsoluteTime=d;let h;f?h=new cast.framework.messages.GenericMediaMetadata:h=b.metadata;
87
+ h.sectionStartAbsoluteTime=d;b.metadata=h}b.streamType=c.LIVE;a=Object.assign({},a,{media:b})}}return a}G(a,b){var c=null;a.media.customData&&(c=yV(a.media.customData.playerConfiguration));var d=null;var e=null;a.media.customData&&(d=yV(a.media.customData["com.castlabs.reactnative.PlayerConfiguration"]),e=yV(a.media.customData.playerConfiguration));a=(a=d&&d.LiveConfiguration)?0===a.liveEdgeLatencyMs:!1;d=!(!d||!d.lowLatencyMode);b=(e=null!=e&&e.lowLatencyMode||a||d)?zW(b,{streaming:{lowLatencyMode:!0}}):
88
+ b;if(!c)return b;e=c.chromecast||null;a=c.abr||null;d=b;a&&typeof a.defaultBandwidthEstimate===_.r?d.initialBandwidth=a.defaultBandwidthEstimate:d.initialBandwidth=void 0;yW(c,b);a={};d=c.streaming||null;e&&e.useSenderStreamingConfig&&d&&(a.streaming=zV(d,NW));c=c.abr||null;e&&e.useSenderAbrConfig&&c&&(a.abr=zV(c,OW));_.$g(a)&&(b=zW(b,a));return b}getTextDisplayer(){return null}setDrmCustomDataModifier(){}setCdnErrorCallback(){}detach(){}};var BW=class{constructor(){this.a=!1;this.g=new _.S(rV);this.f=this.m=null;this.w=new Set;this.C=this.K.bind(this);this.B=this.F.bind(this);this.o=null;this.l=new _.Ut;this.j=this.h=this.A=null}init(a){a&&(this.f=new aX,_.Zr(a,this.f),this.m=a,this.l.on(window,"unload",()=>{const b=this;return _.v(function*(){b.m&&0!==b.m.getPlayerState()&&(yield wV(b.m))})}))}start(a){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var b=DW(),c=DW().getPlayerManager(),d=new cast.framework.CastReceiverOptions;
89
+ a&&null!=a.useShakaForHls&&(d.useShakaForHls=a.useShakaForHls);d.customNamespaces={};d.customNamespaces[sV]=cast.framework.system.MessageType.JSON;d.customNamespaces[tV]=cast.framework.system.MessageType.JSON;a=new cast.framework.PlaybackConfig;a.manifestHandler=this.I.bind(this);a.shakaConfig={streaming:{ignoreTextStreamFailures:!0}};a.enableSmoothLiveRefresh=!0;d.playbackConfig=a;if(a=this.m&&this.m.getSurface().getMedia())d.mediaElement=a;d.disableIdleTimeout=!0;d.maxInactivity=Infinity;this.h&&
90
90
  (d.queue=this.h);c.setMessageInterceptor(cast.framework.messages.MessageType.QUEUE_UPDATE,e=>{this.g.info("QUEUE_UPDATE message received",e);var f=this.getQueueManager();if(!f)return e;f=f.getCurrentItem();return f?(f=f.customData)&&!1===f.skippable?null:e:e});c.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.H.bind(this));c.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.J.bind(this));c.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,
91
- this.C);c.addEventListener(cast.framework.events.EventType.MEDIA_STATUS,this.G.bind(this));b.start(d);b.addCustomMessageListener(qV,this.B);this.l.on(document,_.ug,()=>{var e={type:"event",name:_.ug,visible:!document.hidden};BW().sendCustomMessage(rV,void 0,e)})}}stop(){if(this.a){this.a=!1;this.l.release();const a=BW();BW().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.C);a.removeCustomMessageListener(qV,this.B);a.stop();this.j=this.h=this.m=this.f=
92
- null}}Xd(a){this.o=a}Vi(a){this.A=a}on(a,b){BW().addEventListener(a,b)}off(a,b){BW().removeEventListener(a,b)}addMessageListener(a){typeof a===_.Wd&&this.w.add(a)}removeMessageListener(a){typeof a===_.Wd&&this.w.delete(a)}sendMessage(a,b){BW().sendCustomMessage(qV,b,a)}ed(){return this.a}$e(){return this.a}Lb(){return CW()}fc(a){DW(this,a)}mj(a){const b=CW();let c=null;a?c=Object.assign({},b,a):c=b;DW(this,c)}Xi(a){this.h=a;this.j=null}getQueueManager(){return BW().getPlayerManager().getQueueManager()}G(){var a=
93
- this.getQueueManager();a&&(a=a.getCurrentItemIndex(),this.j!==a&&(this.j=a,BW().sendCustomMessage(qV,void 0,{type:jV,index:a})))}I(a){a=a.trim();if(a.startsWith("#EXTM3U"))return FW(this,a);try{var b=(new DOMParser).parseFromString(a,_.Uf)}catch(k){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.g.debug("Detected DASH, parsing");b=BW();c=a.getElementsByTagName("Period");for(var d=c.length-1;0<=d;--d){var e=c[d].getElementsByTagName(_.ha);for(var f=e.length-1;0<=f;--f){var g=e[f].getAttribute("contentType");
91
+ this.C);c.addEventListener(cast.framework.events.EventType.MEDIA_STATUS,this.G.bind(this));b.start(d);b.addCustomMessageListener(sV,this.B);this.l.on(document,_.ug,()=>{var e={type:"event",name:_.ug,visible:!document.hidden};DW().sendCustomMessage(tV,void 0,e)})}}stop(){if(this.a){this.a=!1;this.l.release();const a=DW();DW().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.C);a.removeCustomMessageListener(sV,this.B);a.stop();this.j=this.h=this.m=this.f=
92
+ null}}Xd(a){this.o=a}Vi(a){this.A=a}on(a,b){DW().addEventListener(a,b)}off(a,b){DW().removeEventListener(a,b)}addMessageListener(a){typeof a===_.Wd&&this.w.add(a)}removeMessageListener(a){typeof a===_.Wd&&this.w.delete(a)}sendMessage(a,b){DW().sendCustomMessage(sV,b,a)}ed(){return this.a}$e(){return this.a}Mb(){return EW()}gc(a){FW(this,a)}mj(a){const b=EW();let c=null;a?c=Object.assign({},b,a):c=b;FW(this,c)}Xi(a){this.h=a;this.j=null}getQueueManager(){return DW().getPlayerManager().getQueueManager()}G(){var a=
93
+ this.getQueueManager();a&&(a=a.getCurrentItemIndex(),this.j!==a&&(this.j=a,DW().sendCustomMessage(sV,void 0,{type:lV,index:a})))}I(a){a=a.trim();if(a.startsWith("#EXTM3U"))return HW(this,a);try{var b=(new DOMParser).parseFromString(a,_.Uf)}catch(k){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.g.debug("Detected DASH, parsing");b=DW();c=a.getElementsByTagName("Period");for(var d=c.length-1;0<=d;--d){var e=c[d].getElementsByTagName(_.ha);for(var f=e.length-1;0<=f;--f){var g=e[f].getAttribute("contentType");
94
94
  if(g===_.t||g===_.q){g=e[f].getAttribute(_.se);var h=e[f].getElementsByTagName(_.kb);for(let k=h.length-1;0<=k;--k){const l=h[k].getAttribute(_.se)||g,m=h[k].getAttribute(_.md);let n=h[k].getAttribute(_.Gg)||void 0,p=h[k].getAttribute(_.Xd)||void 0;void 0!==n&&(n=+n);void 0!==p&&(p=+p);b.canDisplayType(l,m,n,p)||e[f].removeChild(h[k])}e[f].getElementsByTagName(_.kb).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.ha).length||a.removeChild(c[d])}return a=(new XMLSerializer).serializeToString(a)}if(c=
95
- b.getElementsByTagName(_.qb)[0]){a=c;this.g.debug("Detected Smooth, parsing");b=BW();c=a.getElementsByTagName("StreamIndex");for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.t){e=c[d].getElementsByTagName(_.hb);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.Pa)||void 0,h=e[f].getAttribute(_.Oa)||void 0,void 0!==g&&(g=+g),void 0!==h&&(h=+h),b.canDisplayType(_.qg,void 0,g,h)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.hb).length||a.removeChild(c[d])}a=(new XMLSerializer).serializeToString(a)}return a}H(a){const b=
96
- this;return _.v(function*(){let c=a;var d;c.media.customData&&(d=wV(c.media.customData.playerConfiguration));if(b.m&&d){b.o&&(d=(yield Promise.resolve(b.o(d)))||d);d.ima&&(yield iW(c.media,d.ima,b.m.getNetworkEngine()));typeof d.startTime===_.r&&d.startTime!==c.currentTime?c.currentTime=d.startTime:d.startTime=c.currentTime||null;c.media.customData.local||(b.f.C=!0,yield _.js(b.m,d),yield _.ks(b.m),d=b.m.Sa(),c.media.contentId=d.url,c.media.contentType=d.type,d.videoMimeType&&(c.media.hlsVideoSegmentFormat=
97
- zV(d.videoMimeType,_.N)),d.audioMimeType&&(c.media.hlsSegmentFormat=zV(d.audioMimeType,_.M)));const e=c.media.metadata;e&&typeof e.sectionStartAbsoluteTime===_.r&&(d=e.sectionStartAbsoluteTime,e.sectionStartAbsoluteTime=0===d?1E-8:d);void 0===c.autoplay&&(c.autoplay=b.m.getConfiguration().autoplay)}b.A&&(d=yield Promise.resolve(b.A(c)))&&(c=d);return c})}J(a){var b=a.media;b&&b.tracks&&b.tracks.length&&GW(b.tracks);if((b=a.items)&&b.length)for(const c of b)(b=c&&c.media)&&b.tracks&&b.tracks.length&&
98
- GW(b.tracks);return a}K(a){if(this.m&&(!a.media.customData||!a.media.customData.local)){var b=BW().getPlayerManager(),c=b.getLiveSeekableRange();if(c){a=c.start;c=c.end;var d=this.m.getConfiguration().startTime;typeof a!==_.r||typeof c!==_.r||typeof d!==_.r||d>=a&&d<=c||(b=b.getMediaTimeForAbsoluteTime(d),typeof b===_.r&&b>=a&&b<=c&&this.m.setPosition(b))}_.ms(this.m)}}F(a){this.w.forEach(b=>b(a.data))}};_.w(pV,zW);zW.prototype.getQueueManager=zW.prototype.getQueueManager;zW.prototype.setQueue=zW.prototype.Xi;
99
- zW.prototype.updateContentMetadata=zW.prototype.mj;zW.prototype.setContentMetadata=zW.prototype.fc;zW.prototype.getContentMetadata=zW.prototype.Lb;zW.prototype.isApiReady=zW.prototype.ed;zW.prototype.sendMessage=zW.prototype.sendMessage;zW.prototype.removeMessageListener=zW.prototype.removeMessageListener;zW.prototype.addMessageListener=zW.prototype.addMessageListener;zW.prototype.off=zW.prototype.off;zW.prototype.on=zW.prototype.on;zW.prototype.setLoadRequestDataInterceptor=zW.prototype.Vi;
100
- zW.prototype.setPlayerConfigInterceptor=zW.prototype.Xd;zW.prototype.stop=zW.prototype.stop;zW.prototype.start=zW.prototype.start;zW.prototype.init=zW.prototype.init;zW.getInstance=AW;var yW=null;var $W=class{constructor(a){this.l=a;this.a=null;this.B=new _.Ut;this.f=null;HW(this)}load(){return _.v(function*(){})}j(){return!0}A(){}Ja(){this.a&&this.a.isPlayingBreak&&!this.a.isPaused&&this.a.controller.playOrPause()}skip(){const a=this.l.a;a&&this.l.sendMessage(sV,{type:"SKIP_AD",requestId:CV(),mediaSessionId:a.mediaSessionId})}getAdVolume(){return this.l.getVolume()||0}h(a){this.l.setVolume(a)}setMuted(a){this.l.setMuted(a)}isMuted(){return!!this.l.isMuted()}pb(){return this.a?this.a.isPlayingBreak:
101
- !1}isPaused(){return this.a&&this.a.isPlayingBreak?this.a.isPaused:!1}getPosition(){let a=-1;var b=this.l.a;b&&(b=b.getEstimatedBreakClipTime(),typeof b===_.r&&(a=b));return a}w(){return!0}o(){const a=this;return _.v(function*(){a.B.release()})}setVolume(a){this.h(a)}getVolume(){return this.getAdVolume()}pause(){this.Ja()}resume(){this.j()}C(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.l.trigger(new _.H(_.oc,{adsTimeline:new VW(a.breaks)})));break;case "isPlayingBreak":a.value?
102
- IW(this,_.Sb):(IW(this,_.Wb,this.f),IW(this,_.lc,this.f),this.f=null,IW(this,_.Tb));break;case "isPaused":this.f&&(a.value?IW(this,_.dc):IW(this,_.fc));break;case "breakClipId":this.f&&(a=this.a.breakClipId,this.f.getId()!==a&&null!=a&&(IW(this,_.Wb,this.f),IW(this,_.lc,this.f),this.f=JW(this),IW(this,_.kc,this.f)));break;default:this.f||(this.f=JW(this))&&IW(this,_.kc,this.f)}}};$W.prototype.resume=$W.prototype.resume;$W.prototype.pause=$W.prototype.pause;$W.prototype.getVolume=$W.prototype.getVolume;
103
- $W.prototype.setVolume=$W.prototype.setVolume;$W.prototype.getPosition=$W.prototype.getPosition;$W.prototype.skip=$W.prototype.skip;var aX=class{name(){return"clpp.cast.ads.SenderAdsManagerFactory"}a(a,b){return a.namespace()!==_.gd?!1:!(!b||!b.ima)}create(a){return new $W(a.a)}};var bX=class{name(){return"clpp.cast.ads.AdsManagerFactory"}a(a,b){return AW().$e()?!(!b||!b.ima):!1}create(a){return new WW(a)}};_.w("clpp.cast.createCastQueue",function(){KW=class extends cast.framework.QueueBase{initialize(a){let b=a.queueData;b||(b=new cast.framework.messages.QueueData,b.name="queue",b.description="queue",b.items=[{media:a.media}],b.startTime=a.currentTime);return b}};return new KW});_.pp(new aX);_.pp(new bX);};f.call(g, window);
95
+ b.getElementsByTagName(_.qb)[0]){a=c;this.g.debug("Detected Smooth, parsing");b=DW();c=a.getElementsByTagName("StreamIndex");for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.t){e=c[d].getElementsByTagName(_.hb);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.Pa)||void 0,h=e[f].getAttribute(_.Oa)||void 0,void 0!==g&&(g=+g),void 0!==h&&(h=+h),b.canDisplayType(_.qg,void 0,g,h)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.hb).length||a.removeChild(c[d])}a=(new XMLSerializer).serializeToString(a)}return a}H(a){const b=
96
+ this;return _.v(function*(){let c=a;var d;c.media.customData&&(d=yV(c.media.customData.playerConfiguration));if(b.m&&d){b.o&&(d=(yield Promise.resolve(b.o(d)))||d);d.ima&&(yield kW(c.media,d.ima,b.m.getNetworkEngine()));typeof d.startTime===_.r&&d.startTime!==c.currentTime?c.currentTime=d.startTime:d.startTime=c.currentTime||null;c.media.customData.local||(b.f.C=!0,yield _.ks(b.m,d),yield _.ls(b.m),d=b.m.Ua(),c.media.contentId=d.url,c.media.contentType=d.type,d.videoMimeType&&(c.media.hlsVideoSegmentFormat=
97
+ BV(d.videoMimeType,_.N)),d.audioMimeType&&(c.media.hlsSegmentFormat=BV(d.audioMimeType,_.M)));const e=c.media.metadata;e&&typeof e.sectionStartAbsoluteTime===_.r&&(d=e.sectionStartAbsoluteTime,e.sectionStartAbsoluteTime=0===d?1E-8:d);void 0===c.autoplay&&(c.autoplay=b.m.getConfiguration().autoplay)}b.A&&(d=yield Promise.resolve(b.A(c)))&&(c=d);return c})}J(a){var b=a.media;b&&b.tracks&&b.tracks.length&&IW(b.tracks);if((b=a.items)&&b.length)for(const c of b)(b=c&&c.media)&&b.tracks&&b.tracks.length&&
98
+ IW(b.tracks);return a}K(a){if(this.m&&(!a.media.customData||!a.media.customData.local)){var b=DW().getPlayerManager(),c=b.getLiveSeekableRange();if(c){a=c.start;c=c.end;var d=this.m.getConfiguration().startTime;typeof a!==_.r||typeof c!==_.r||typeof d!==_.r||d>=a&&d<=c||(b=b.getMediaTimeForAbsoluteTime(d),typeof b===_.r&&b>=a&&b<=c&&this.m.setPosition(b))}_.ns(this.m)}}F(a){this.w.forEach(b=>b(a.data))}};_.w(rV,BW);BW.prototype.getQueueManager=BW.prototype.getQueueManager;BW.prototype.setQueue=BW.prototype.Xi;
99
+ BW.prototype.updateContentMetadata=BW.prototype.mj;BW.prototype.setContentMetadata=BW.prototype.gc;BW.prototype.getContentMetadata=BW.prototype.Mb;BW.prototype.isApiReady=BW.prototype.ed;BW.prototype.sendMessage=BW.prototype.sendMessage;BW.prototype.removeMessageListener=BW.prototype.removeMessageListener;BW.prototype.addMessageListener=BW.prototype.addMessageListener;BW.prototype.off=BW.prototype.off;BW.prototype.on=BW.prototype.on;BW.prototype.setLoadRequestDataInterceptor=BW.prototype.Vi;
100
+ BW.prototype.setPlayerConfigInterceptor=BW.prototype.Xd;BW.prototype.stop=BW.prototype.stop;BW.prototype.start=BW.prototype.start;BW.prototype.init=BW.prototype.init;BW.getInstance=CW;var AW=null;var bX=class{constructor(a){this.l=a;this.a=null;this.B=new _.Ut;this.f=null;JW(this)}load(){return _.v(function*(){})}j(){return!0}A(){}La(){this.a&&this.a.isPlayingBreak&&!this.a.isPaused&&this.a.controller.playOrPause()}skip(){const a=this.l.a;a&&this.l.sendMessage(uV,{type:"SKIP_AD",requestId:EV(),mediaSessionId:a.mediaSessionId})}getAdVolume(){return this.l.getVolume()||0}h(a){this.l.setVolume(a)}setMuted(a){this.l.setMuted(a)}isMuted(){return!!this.l.isMuted()}Ka(){return this.a?this.a.isPlayingBreak:
101
+ !1}isPaused(){return this.a&&this.a.isPlayingBreak?this.a.isPaused:!1}getPosition(){let a=-1;var b=this.l.a;b&&(b=b.getEstimatedBreakClipTime(),typeof b===_.r&&(a=b));return a}w(){return!0}o(){const a=this;return _.v(function*(){a.B.release()})}setVolume(a){this.h(a)}getVolume(){return this.getAdVolume()}pause(){this.La()}resume(){this.j()}C(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.l.trigger(new _.H(_.oc,{adsTimeline:new XW(a.breaks)})));break;case "isPlayingBreak":a.value?
102
+ KW(this,_.Sb):(KW(this,_.Wb,this.f),KW(this,_.lc,this.f),this.f=null,KW(this,_.Tb));break;case "isPaused":this.f&&(a.value?KW(this,_.dc):KW(this,_.fc));break;case "breakClipId":this.f&&(a=this.a.breakClipId,this.f.getId()!==a&&null!=a&&(KW(this,_.Wb,this.f),KW(this,_.lc,this.f),this.f=LW(this),KW(this,_.jc,this.f)));break;default:this.f||(this.f=LW(this))&&KW(this,_.jc,this.f)}}};bX.prototype.resume=bX.prototype.resume;bX.prototype.pause=bX.prototype.pause;bX.prototype.getVolume=bX.prototype.getVolume;
103
+ bX.prototype.setVolume=bX.prototype.setVolume;bX.prototype.getPosition=bX.prototype.getPosition;bX.prototype.skip=bX.prototype.skip;var cX=class{name(){return"clpp.cast.ads.SenderAdsManagerFactory"}a(a,b){return a.namespace()!==_.gd?!1:!(!b||!b.ima)}create(a){return new bX(a.a)}};var dX=class{name(){return"clpp.cast.ads.AdsManagerFactory"}a(a,b){return CW().$e()?!(!b||!b.ima):!1}create(a){return new YW(a)}};_.w("clpp.cast.createCastQueue",function(){MW=class extends cast.framework.QueueBase{initialize(a){let b=a.queueData;b||(b=new cast.framework.messages.QueueData,b.name="queue",b.description="queue",b.items=[{media:a.media}],b.startTime=a.currentTime);return b}};return new MW});_.qp(new cX);_.qp(new dX);};f.call(g, window);