@viewlift/player-backup 2.0.241-backup → 2.0.243-backup

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 (57) hide show
  1. package/cjs/{autoNextVideo-7f16164c.js → autoNextVideo-34d5bfff.js} +1 -1
  2. package/cjs/bundle.css +999 -999
  3. package/cjs/{features-44b8a90b.js → features-713288be.js} +1 -1
  4. package/cjs/generic-3dec4e29.js +1 -0
  5. package/cjs/{index-cae0151c.js → index-2cd2820c.js} +1 -1
  6. package/cjs/{index-da9488ba.js → index-316419d1.js} +1 -1
  7. package/cjs/{index-306542d1.js → index-80599385.js} +1 -1
  8. package/cjs/index.js +1 -1
  9. package/cjs/{multicamv2-b698f6ba.js → multicamv2-2fdc45a2.js} +1 -1
  10. package/cjs/{multicamv2-ce4415df.js → multicamv2-ff4a9ce9.js} +1 -1
  11. package/cjs/{nextEpisodeButton-04ddeaf0.js → nextEpisodeButton-89431f38.js} +1 -1
  12. package/cjs/{playlist-e5ac9f9e.js → playlist-07a703ff.js} +1 -1
  13. package/cjs/{series-46f1eb1a.js → series-f308634c.js} +1 -1
  14. package/cjs/{series-v2-493096ca.js → series-v2-50625842.js} +1 -1
  15. package/cjs/{series-v2-30b4c175.js → series-v2-82f80fb1.js} +1 -1
  16. package/cjs/{skin-140e356d.js → skin-489d1b11.js} +1 -1
  17. package/cjs/{skin-3157e8f7.js → skin-65dc497e.js} +1 -1
  18. package/cjs/{skin-d2c5f153.js → skin-864b08d1.js} +1 -1
  19. package/cjs/{skin-c8d5b348.js → skin-8721cf2f.js} +1 -1
  20. package/cjs/{skin-77a80f2b.js → skin-877d44f4.js} +1 -1
  21. package/cjs/{skin-be71be04.js → skin-9b50070d.js} +1 -1
  22. package/cjs/{skin-7e6afef9.js → skin-a41f515c.js} +1 -1
  23. package/cjs/{skin-d1d31338.js → skin-ada9e090.js} +1 -1
  24. package/cjs/{skin-f0f852fd.js → skin-d230db0f.js} +1 -1
  25. package/cjs/{util-a0a1fe3d.js → util-d17e0a43.js} +1 -1
  26. package/cjs/{videoSelector-57bb8148.js → videoSelector-11206443.js} +1 -1
  27. package/cjs/{videoSelector-97256b71.js → videoSelector-a6ffa2ad.js} +1 -1
  28. package/esm/{autoNextVideo-780b39c1.js → autoNextVideo-10833d14.js} +1 -1
  29. package/esm/bundle.css +999 -999
  30. package/esm/{features-03b82c68.js → features-bd974ef1.js} +1 -1
  31. package/esm/generic-cab4cba0.js +1 -0
  32. package/esm/{index-eeb8e410.js → index-02294ca3.js} +1 -1
  33. package/esm/{index-51647446.js → index-23b9dfb4.js} +1 -1
  34. package/esm/{index-c3d1f8c9.js → index-ef3bbe81.js} +1 -1
  35. package/esm/index.js +1 -1
  36. package/esm/{multicamv2-1ae4ccc1.js → multicamv2-28f5d0a2.js} +1 -1
  37. package/esm/{multicamv2-402ed25d.js → multicamv2-e251ab1b.js} +1 -1
  38. package/esm/{nextEpisodeButton-596dfaaf.js → nextEpisodeButton-44f1ba55.js} +1 -1
  39. package/esm/{playlist-3308feca.js → playlist-3134720c.js} +1 -1
  40. package/esm/{series-d3123564.js → series-42cacd14.js} +1 -1
  41. package/esm/{series-v2-e9beb242.js → series-v2-f7f421aa.js} +1 -1
  42. package/esm/{series-v2-ebf85da7.js → series-v2-fca0c115.js} +1 -1
  43. package/esm/{skin-627c7279.js → skin-0cf7db04.js} +1 -1
  44. package/esm/{skin-bb171a22.js → skin-144bb018.js} +1 -1
  45. package/esm/{skin-42546070.js → skin-20540ac1.js} +1 -1
  46. package/esm/{skin-a2636fa8.js → skin-453d57ce.js} +1 -1
  47. package/esm/{skin-0f50a6fe.js → skin-4b5cdee1.js} +1 -1
  48. package/esm/{skin-a99899c7.js → skin-6ea84e49.js} +1 -1
  49. package/esm/{skin-c7763cef.js → skin-8d57b8d5.js} +1 -1
  50. package/esm/{skin-f3829590.js → skin-b62e373b.js} +1 -1
  51. package/esm/{skin-c9216fbe.js → skin-fefd11d4.js} +1 -1
  52. package/esm/{util-bd381a06.js → util-55f86fb6.js} +1 -1
  53. package/esm/{videoSelector-0f129080.js → videoSelector-04ed35af.js} +1 -1
  54. package/esm/{videoSelector-4a4ca12d.js → videoSelector-8e18b08f.js} +1 -1
  55. package/package.json +2 -2
  56. package/cjs/generic-cd7bfeec.js +0 -1
  57. package/esm/generic-191f638a.js +0 -1
@@ -1 +0,0 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import o from"video.js";import i from"axios";import{g as r}from"./player_instance-34118a5b.js";import l from"js-cookie";import{a,e as d,g as u,h as s,s as c,i as v,d as f}from"./currentVideoInfo-0b234e55.js";import{a as m,r as p}from"./captions-78bd2908.js";import g from"@babel/runtime/helpers/typeof";import{t as h,c as w}from"./skin-65765793.js";import I from"@babel/runtime/helpers/toConsumableArray";import E from"@babel/runtime/helpers/slicedToArray";import{destroyComscoreTag as y,formulateComscorePayload as T,createComscoreStreamingTag as b,setComscorePlayerInstance as _}from"@viewlift/comscore/index.js";function S(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function O(e){window.dataLayer=window.dataLayer||[],S("js",new Date),S("config",e)}function A(e,n){S("event",e,n)}var D={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"};function L(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function P(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?L(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):L(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var k={name:"@viewlift/player",version:"2.1.19",main:"dist/bundle.cjs.js",types:"dist/@viewlift/player/esm/index.d.ts",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1","@viewlift/comscore":"^1.0.2",axios:"^1.2.3",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"},overrides:{"min-document":"^2.19.1"}};window.vl_player_version=k.version;var F,R=function(){var e,n,t,o;return null!==(e=window)&&void 0!==e&&null!==(n=e.customData)&&void 0!==n&&n.overrideEntitlementBaseUrl?(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementBaseUrl)+"/video/status":U.get()+"".concat(null==D?void 0:D.getVideoDetails)},C=function(e,n){var t,o,r,l,a,d,u=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})}):i({url:R(),params:P({id:e,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:u},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":k.version,"x-player-name":"videojs",adbTempToken:null===(a=window)||void 0===a||null===(d=a.customData)||void 0===d?void 0:d.adbTempToken},withCredentials:!0})},j=function(e,n){var t,o,r,l,a,d,u=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})}):i({url:U.get()+D.getLinearChannelDetails,params:P(P(P(P(P({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:u},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO",adbTempToken:null===(a=window)||void 0===a||null===(d=a.customData)||void 0===d?void 0:d.adbTempToken}})},N=function(e,n){var t,o,r=K(n),l=(null==r?void 0:r.site)||null;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.seriesData?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.seriesData})}):i({url:U.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:n}})},V=function(){var e=n(t.mark(function e(n){var o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z();case 2:return o=e.sent,e.abrupt("return",i({url:U.get()+"".concat(null==D?void 0:D.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:P({},n),params:P({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),W=function(e,n){var t,o,r=window.contentType;return i({method:"GET",url:U.get()+"".concat(null==D?void 0:D.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(o=t.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},B=function(e){var n=e.videoId;return i({method:"GET",url:U.get()+"".concat(null==D?void 0:D.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},U=(F=null==D?void 0:D.apiBaseUrl,{set:function(e){e&&(F=e)},get:function(){return F}}),M=function(e,n,t,o){var r,l;return i({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==o?void 0:o.latitude,longitude:null==o?void 0:o.longitude},method:"GET",headers:{Authorization:n,adbTempToken:null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.adbTempToken},withCredentials:!0})},x=function(e){var n=JSON.parse(atob(null==e?void 0:e.split(".")[1])),t=null==n?void 0:n.exp;if(new Date(1e3*t).getTime()<(new Date).getTime())return!0},H=null;function G(){return{set:function(e){e&&(H=e)},get:function(){return H}}}var Q=function(){var e=n(t.mark(function e(){var n,o,r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=G().get(),o=U.get(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}},e,null,[[2,9]])}));return function(){return e.apply(this,arguments)}}(),Y=null,z=function(){var e=n(t.mark(function e(){var n;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!x(n)){e.next=6;break}return Y||(Y=Q().then(function(e){var t,o,i=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return i&&sessionStorage.setItem("vlp_token",i),r&&G().set(r),i||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){Y=null})),e.abrupt("return",Y);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),q=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,o=null==e?void 0:e.asat;return t&&!o&&(n=!1),n},K=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))};function X(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function J(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?X(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):X(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var $=function(){var e,n,t,o,i,r,l,d=a();return"linearchannel"===((null==d?void 0:d.contentType)||"video")?null==d||null===(e=d.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find(function(e){return(null==e?void 0:e.id)===(null==d?void 0:d.channelId)}))||void 0===t||null===(o=t.content)||void 0===o?void 0:o.id:(null==d||null===(i=d.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id)||(null==d||null===(l=d.video)||void 0===l?void 0:l.id)||(null==d?void 0:d.id)};function Z(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return"".concat(e()).concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e()).concat(e()).concat(e())}function ee(){return ne.apply(this,arguments)}function ne(){return(ne=n(t.mark(function e(){var n,o,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z();case 2:if(n=e.sent,o=K(n),!(i=null==o?void 0:o.userId)){e.next=9;break}return e.abrupt("return",i);case 9:return i=Z(),window.sessionStorage.setItem("uid",i),e.abrupt("return",i);case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}function te(){return oe.apply(this,arguments)}function oe(){return(oe=n(t.mark(function e(){var n,o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z();case 2:if(!(n=e.sent)){e.next=6;break}return o=JSON.parse(atob(n.split(".")[1])),e.abrupt("return",null!=o&&o.anonymousId?"guest-user":null==o?void 0:o.userId);case 6:return e.abrupt("return","guest-user");case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ie(e){return e?String(e):""}window.initialise=function(e){window.sid=Z(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var n=Math.floor(e.currentTime());e.on("error",function(){var t,o,i,r=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,A(r?"FAILED_TO_START":"DROPPED_STREAM",J({pfm:window.platform,uid:ee(),vid:$(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(i=o.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:n===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})},window.firstFrame=function(e,n){e.one("play",tryCatch(function(){var t,o,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),A("PLAY",J({pfm:window.platform,uid:ee(),vid:$(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(i=o.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),n&&n("started_video_playback",{"Video ID":$(),watchTime:Math.floor(e.currentTime())})}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:clearInterval(window.bufferingTimer)},100))}))},window.handleBufferTimer=function(e,n){var t,o;if(n.el_){var i,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(o=t.className)&&void 0!==o&&o.includes("vjs-waiting")&&bufferingFireCount<4)bufferingFireCount++,A("BUFFERING",J({pfm:window.platform,uid:ee(),vid:$(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var n,t,o;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,A("FIRST_FRAME",J({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ee(),vid:$()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})})},window.ads=function(e){e.on("adsready",function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,function(){var n,t,o,i,r,l;A("AD_REQUEST",J({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ee(),vid:$(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),A("AD_IMPRESSION",J({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ee(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:$()},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})},window.ping=function(e){var n=[];e.on("timeupdate",function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!n.includes(t)&&(bufferingFireCount=0,n.push(t),fireEvent({eventName:"PING",videoPosition:t,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var n=e.currentTime(),t=e.duration(),o=e.buffered(),i=0;i<o.length;i++){var r=o.start(i),l=o.end(i);if(re(n,r,l)){var a=Math.round(t-l);if(isFinite(a))return a}}})()};var re=function(e,n,t){return e>=n&&e<=t},le=function(){var e,n=a(),t=(null==n?void 0:n.contentType)||"video";return(null==n||null===(e=n[t])||void 0===e?void 0:e.network)||null};function ae(e,n){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var t=r(e);window.initialise(t,n),window.firstFrame(t,n),t.on("loadedmetadata",function(){window.endFirstFrame(t)})}}window.fireEvent=function(){var e=n(t.mark(function e(n){var o,r,l,a,d,u,s,c,v,f,m,p,g,h,w,I,E,y,T,b,_;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z();case 2:return E=e.sent,y=K(E),T=null==y?void 0:y.site,b=null==y?void 0:y.siteId,e.t0=J,e.t1=J,e.t2=J({aid:T,cid:b,pfm:window.platform},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params),e.t3={},e.next=12,ee();case 12:return e.t4=e.sent,e.t5=$(),e.t6=n.url||document.location.href,e.t7=n.ref||document.referrer,e.t8=n.eventName,e.t9=null!==(a=n.videoPosition)&&void 0!==a?a:null,e.t10=window.environment,e.t11=n.dp1||"",e.t12=n.dp2||"",e.t13=n.dp3||"",e.t14=n.dp4||"",e.t15=n.dp5||"",e.t16=!0===n.isAdEvent?n.videoPosition:null,e.t17=!0===n.isAdEvent?ie(n.adPosition):"",e.next=28,te();case 28:e.t18=e.sent,e.t19=n.playerType||"native",e.t20=n.mediaType||"VIDEO",e.t21=window.sid,e.t22=null!==(d=n.ttFirstFrame)&&void 0!==d?d:null,e.t23=null!==(u=n.bitrate)&&void 0!==u?u:null,e.t24=null!==(s=n.resHeight)&&void 0!==s?s:null,e.t25=null!==(c=n.resWidth)&&void 0!==c?c:null,e.t26=null!==(v=n.bufferHealth)&&void 0!==v?v:null,e.t27=null!==(f=le())&&void 0!==f?f:null,e.t28=null!=T?T:null,e.t29={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:null,resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26,networkname:e.t27,brandname:e.t28},e.t30=(null==n?void 0:n.duration)&&{duration:n.duration},e.t31=(0,e.t1)(e.t2,e.t3,e.t29,e.t30),e.t32=null===(m=window)||void 0===m||null===(p=m.customData)||void 0===p||null===(g=p.beacon)||void 0===g?void 0:g.params,e.t33=(0,e.t0)(e.t31,e.t32),_=[e.t33],i({url:(null===(h=window)||void 0===h||null===(w=h.customData)||void 0===w||null===(I=w.beacon)||void 0===I?void 0:I.url)||U.get()+D.getBeaconUrl,method:"post",headers:{Authorization:E},contentType:"application/x-www-form-urlencoded",dataType:"text",data:_}).catch(function(e){console.error(e)});case 46:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var de=function(){var e,n;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(n=e.userAgentData)||void 0===n?void 0:n.platform)?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"},ue=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},se=function(e,n){var t=new Map;B({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),s(t)}).catch(function(e){return console.log(e)})},ce=function(){var e=d.get();return e>=0?e+1:1},ve=function(){var e,n,t,o=u(),i=a(),r=null==i||null===(e=i.video)||void 0===e?void 0:e.id,l=d.get(),s=null==o||null===(n=o[l])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex(function(e){return(null==e?void 0:e.id)===r});return s>=0?s+1:1};function fe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function me(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?fe(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):fe(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var pe=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},ge=function(e){var n=he(e,"video.tags",[]),t=he(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},he=function(e,n,t){for(var o=0,i=(n=n.split(".")).length;o<i;o++){var r;e=null===(r=e)||void 0===r?void 0:r[n[o]]}return e||t},we=function(){var n,t,o,i,a,d,u,s,c,v,f,m,p,g,h,w,I,E,y,T,b,_,S,O,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",D=arguments.length>1?arguments[1]:void 0,L=arguments.length>2?arguments[2]:void 0;if(null!==(n=window)&&void 0!==n&&null!==(t=n.customData)&&void 0!==t&&t.disableMacros)return A;var P=(null==L?void 0:L.siteName)||(null==L?void 0:L.site)||"",k=(null==L?void 0:L.contentType)||"video",F=(null==L||null===(o=L[k])||void 0===o?void 0:o.metadata)||(null==L||null===(i=L[k])||void 0===i||null===(a=i.gist)||void 0===a?void 0:a.metadata),R=r(D);if(!A.includes("VIEWLIFT_"))return A;var C,j=window.getComputedStyle(document.getElementById(D),null),N=Math.trunc(j.getPropertyValue("height").slice(0,-2)),V=Math.trunc(j.getPropertyValue("width").slice(0,-2)),W="linearchannel"===k?null==L||null===(d=L.linearchannel)||void 0===d||null===(u=d.channels)||void 0===u||null===(s=u.find(function(e){return(null==e?void 0:e.id)===(null==L?void 0:L.channelId)}))||void 0===s||null===(c=s.content)||void 0===c?void 0:c.id:he(L,"video.gist.id",""),B="linearchannel"===k?null==L||null===(v=L.linearchannel)||void 0===v||null===(f=v.channels)||void 0===f||null===(m=f.find(function(e){return(null==e?void 0:e.id)===(null==L?void 0:L.channelId)}))||void 0===m?void 0:m.title:he(L,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),U=null,M=null;"function"==typeof window.__gpp&&(null===(C=window)||void 0===C||C.__gpp("ping",function(e){U=null==e?void 0:e.gppString,M=null==e?void 0:e.sectionList[0]}));var x=me(me({},Ie(F)),{},(_={VIEWLIFT_WIDTH:V,VIEWLIFT_HEIGHT:N,VIEWLIFT_SIZE:pe(V,N),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(p=window)||void 0===p?void 0:p.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:he(L,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:he(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:he(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==R||null===(g=R.options_)||void 0===g?void 0:g.autoplay)||1,VIEWLIFT_MUTE:(null==R||null===(h=R.options_)||void 0===h?void 0:h.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==P||"usanetwork"==P?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:ge(L),VIEWLIFT_MEDIA_ID:W,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(he(L,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:W,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+he(L,"video.gist.permalink","")),VIEWLIFT_CONSENT:l.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:he(null===(w=window)||void 0===w||null===(I=w.app_data)||void 0===I||null===(E=I.site)||void 0===E?void 0:E.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_ROKU_AD_ID:"",VIEWLIFT_ROKU_AD_KEYS:"",VIEWLIFT_RDID:"",VIEWLIFT_GDPR:"spinco"==P||"usanetwork"==P?"":he(null===(y=window)||void 0===y||null===(T=y.app_data)||void 0===T||null===(b=T.site)||void 0===b?void 0:b.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*he(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:he(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:W,VIEWLIFT_CONTENT_TITLE:B,VIEWLIFT_CONTENT_SERIES_TITLE:he(L,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:he(L,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ve(),VIEWLIFT_SEASON_NUMBER:ce(),VIEWLIFT_CONTENT_TAGS:ge(L),VIEWLIFT_GPP_SID:M||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:U||"VIEWLIFT_GPP",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:"",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},e(_,"VIEWLIFT_LAT",""),e(_,"VIEWLIFT_APP_BUNDLE",""),e(_,"VIEWLIFT_ATT_CONSENT",""),_),null===(S=window)||void 0===S||null===(O=S.customData)||void 0===O?void 0:O.macros);for(var H in x){var G=new RegExp(H,"g");A=A.replace(G,x[H])}return A},Ie=function(e){var n,t,o,i,r,l,a={},d=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){d.set(e.name,e.value)}));var u=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.subscription)||void 0===o?void 0:o.SVOD)||!1,s=(null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1;return u||s?(ue()?u?a=me(me({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||""}):s&&(a=me(me({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.tve")||""})):u?a=me(me({},a),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||""}):s&&(a=me(me({},a),{},{VIEWLIFT_CSID:d.get("csid.web.tve")||""})),u?a=me(me({},a),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||d.get("sfid.web.dtc")||""}):s&&(a=me(me({},a),{},{VIEWLIFT_SFID:d.get("sfid.tve")||d.get("sfid.web.tve")||""})),a=ue()?me(me({},a),{},{VIEWLIFT_PROF:d.get("prof.mweb")||""}):me(me({},a),{},{VIEWLIFT_PROF:d.get("prof.web")||""})):(a=me(me({},a),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||d.get("sfid.web.dtc")||""}),a=ue()?me(me({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:d.get("prof.mweb")||""}):me(me({},a),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||"",VIEWLIFT_PROF:d.get("prof.web")||""})),a=me(me({},a),{},{VIEWLIFT_AFID:d.get("afid"),VIEWLIFT_NIELSEN_APP_ID:d.get("VIEWLIFT_NIELSEN_APP_ID")||"",VIEWLIFT_CHANNEL:d.get("VIEWLIFT_CHANNEL")||"",VIEWLIFT_GRACE_NOTE_ID:d.get("VIEWLIFT_GRACE_NOTE_ID")||"",VIEWLIFT_EXTERNAL_AD_ID:d.get("VIEWLIFT_EXTERNAL_AD_ID")||""})},Ee=function(e,n){var t,o,i,r,l,a,d,u,s,c,v,f,m,p=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[p])||void 0===t?void 0:t.drmEnabled,h=null==e||null===(o=e[p])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.videoAssets,w=null==e||null===(r=e[p])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.audioAssets,I=(null==e||null===(a=e[p])||void 0===a||null===(d=a.streamingInfo)||void 0===d||null===(u=d.videoAssets)||void 0===u?void 0:u.hls)||!1;null==e||null===(s=e[p])||void 0===s||null===(c=s.liveDetails)||void 0===c||c.isDvrEnabled;var E=(null==e||null===(v=e[p])||void 0===v||null===(f=v.streamingInfo)||void 0===f||null===(m=f.videoAssets)||void 0===m?void 0:m.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=w&&w.hls)return Te(w);if(g){var y=be(h,n);return y.src=we(y.src,n,e),y}if("Safari"!==de()&&E)return ye(h);if(I){var T=Te(h);return T.src=we(T.src,n,e),T}if(null!=h&&h.mpeg){var b=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(h);return b.src=we(b.src,n,e),b}return null},ye=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},Te=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},be=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,i=e.fairPlayCmaf||e.fairPlay,l=e.widevine,a=e.playReady,d=de();if(r(n),"Safari"===d){var u=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var i={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(i,function(e,n,o){console.log(e),e&&t(e),t(null,new Uint8Array(o))})},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,i,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:i,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(l,function(e,n,t){console.log(e),e&&r(e),r(null,t)})}}}}}(i);return _e(n),u}var s,c={src:l.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(_e(n),c.keySystems={"com.widevine.alpha":{url:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:null==a?void 0:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==a?void 0:a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==a?void 0:a.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==a?void 0:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==a?void 0:a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var _e=function(e){var n=r(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==de()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},Se=function(e,n){var t=e.src,o=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:o};n=n.replace(/\/$/,"");var i=t.split(".com")[1]||"";return{src:i?"".concat(n).concat(i):t,type:o}},Oe=function(e,n){if(import("./error-2395864b.js").then(function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)}),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var o=document.getElementById(e);if(o){var i=document.createElement("div");i.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(n),i.appendChild(r),o.append(i)}}},Ae=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var De=!1,Le=function(e,n,t){var o=we(n,e,t),i=r(e);if(n&&window.google){if("function"!=typeof i.ima&&"object"!==g(i.ima))return;i.ima.initializeAdDisplayContainer&&i.ima.initializeAdDisplayContainer(),function(e,n){var t,o,i,l=r(e);if(null!==l.el_){De=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),De&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,n,!0),l.ima.requestAds()},1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),l.one(u,function(){s&&l.ima.initializeAdDisplayContainer()});var c=(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.adEventHandler)||null;l.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),l.one("ads-manager",function(e){var n=e.adsManager;n.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})}),n.addEventListener(google.ima.AdEvent.Type.LOADED,function(e){c&&c({status:"LOADED",msg:"Advertisement Loaded",data:e})})}),l.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,o)}};function Pe(e,n){var t,o,i,l=r(e),a=null==l||null===(t=l.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,d=document.getElementsByTagName("video")[0];null===(i=document)||void 0===i||i.addEventListener("keydown",function(t){var o,i,r,u,s,c,v,f,m;if(Fe.enabled&&!t.metaKey&&!t.ctrlKey&&"input"!=t.target.localName&&"textarea"!=t.target.localName){var p=t.key,g=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(p)&&(t.preventDefault(),null==d||d.focus()),p){case" ":null==a||a.click();break;case"m":case"M":l.muted(!l.muted());break;case"f":case"F":null===(o=document.querySelector(".vjs-fullscreen-control"))||void 0===o||o.click();break;case"ArrowLeft":g&&!1===n.liveui||An(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(i=window)||void 0===i||null===(r=i.app_data)||void 0===r||null===(u=r.appcmsMain)||void 0===u||null===(s=u.adsConfig)||void 0===s?void 0:s.vodAdSticherProvider)&&null!==(c=window)&&void 0!==c&&null!==(v=c.app_data)&&void 0!==v&&null!==(f=v.appcmsMain)&&void 0!==f&&null!==(m=f.adsConfig)&&void 0!==m&&m.vodAdClientSideTracking)return;g||On(e,10)}}},!0)}var ke,Fe=(ke=!0,{enable:function(){ke=!0},disable:function(){ke=!1},get enabled(){return ke}}),Re="ssai-breakStart",Ce="ssai-adImpression",je="ssai-firstQuartile",Ne="ssai-midpoint",Ve="ssai-thirdQuartile",We="ssai-complete",Be="ssai-breakEnd",Ue={breakStart:Re,impression:Ce,firstQuartile:je,midpoint:Ne,thirdQuartile:Ve,complete:We,breakEnd:Be};function Me(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var o=n.eventType,i=Ue[o];i&&t.trigger(i,n)}function xe(e){var n=r(e);if(!n)return console.error("[SSAI] Player instance not found"),{};var t=function(e,t){var o=function(e,n){return t(n)};return n.on(e,o),function(){return n.off(e,o)}};return{adBreakStart:function(e){return t(Re,e)},adImpression:function(e){return t(Ce,e)},adFirstQuartile:function(e){return t(je,e)},adMidpoint:function(e){return t(Ne,e)},adThirdQuartile:function(e){return t(Ve,e)},adComplete:function(e){return t(We,e)},adBreakEnd:function(e){return t(Be,e)}}}function He(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Ge(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?He(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):He(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var Qe,Ye=(Qe=null,{get:function(){return Qe},set:function(e){Qe=e}});function ze(e,n){var t,o,i,l,d,u,s,c,v,f,m,p,g=null==e?void 0:e.playerId,h=r(g);if(null!=e&&null!==(t=e.comscore)&&void 0!==t&&t.enable){var w=a(),I=(null==w||null===(o=w.video)||void 0===o?void 0:o.metadata)||[],E=(null==I?void 0:I.length)&&I.filter(function(e){return"advertisingGenre"===e.name});if(null!==(i=E)&&void 0!==i&&i.length){var S=E.map(function(e){return e.value});E=null==S?void 0:S.join(",")}y();var O,A,D,L=null===(l=window)||void 0===l?void 0:l.lcProgrammeDetails,P=Array.isArray(null==L?void 0:L.category)?null==L||null===(d=L.category)||void 0===d?void 0:d.join(","):(null==L?void 0:L.category)||null,k=Ge(Ge(Ge({},null==w?void 0:w.video),null==w?void 0:w.linearchannel),{},{programId:(null==L?void 0:L.videotmsid)||null,programTitle:(null==L?void 0:L.lcProgrammeName)||null,episodeId:(null==L?void 0:L.videotmsid)||null,seasonNumber:(null==L||null===(u=L.seriesDetails)||void 0===u?void 0:u.season)||null,episodeNumber:(null==L||null===(s=L.seriesDetails)||void 0===s?void 0:s.episode)||null,episodeTitle:(null==L?void 0:L.lcSubTitle)||null,isCompleteEpisode:!!(null!=w&&null!==(c=w.video)&&void 0!==c&&c.series||null!=L&&null!==(v=L.seriesDetails)&&void 0!==v&&v.episode),genre:E||P,comscoreConfig:{implementationId:(null==e||null===(f=e.comscore)||void 0===f?void 0:f.implementationId)||null,projectId:(null==e||null===(m=e.comscore)||void 0===m?void 0:m.projectId)||null}});if(null!=k&&null!==(p=k.streamingInfo)&&void 0!==p&&p.isLiveStream?k.contentType="LIVE":k.contentType="LONG_FORM_ON_DEMAND",null==k||!k.network){var F,R=(null==k?void 0:k.metadata)||[],C=null==R||null===(F=R.find(function(e){return"network"===e.name}))||void 0===F?void 0:F.value;k.network=C||null}k.siteName=null==k?void 0:k.network,null!=k&&k.network&&null!=k&&k.genre&&(k.customGenre="".concat(k.network,"_").concat((null==k?void 0:k.programTitle)||(O=k,null!=O&&O.series?null==O||null===(D=O.series)||void 0===D?void 0:D.title:null==O||null===(A=O.gist)||void 0===A?void 0:A.title),"_").concat(k.genre)),null!=L&&L.airDate&&(k.publishDate=L.airDate);var j=T(k,h);console.log("comscoreOptions player data",j),b(Ge({playerName:"Video.js"},j)),_(h)}}function qe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Ke(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?qe(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):qe(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}function Xe(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return Je(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Je(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,r=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw r}}}}function Je(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}var $e,Ze=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),en=($e=null,{set:function(e){$e=e},get position(){return $e}});function nn(e,n){return tn.apply(this,arguments)}function tn(){return(tn=n(t.mark(function e(n,o){var i,l,a,d,u,s,c,v,f,m,p,g,h,w,I,y,T,b;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r(n),a=Ee(o,n),d=a.src,u=(null==o?void 0:o.contentType)||"video",null==o||null===(i=o[u])||void 0===i||null===(l=i.streamingInfo)||void 0===l||l.isLiveStream,s=d.replace("/dash/","/session/").replace("/master/","/session/"),s=we(s,n,o),c=rn(s),v=E(c,2),f=v[0],m=v[1],p=on(m)||{},s=new URL(s.split("?")[0]),Object.keys(m).length>0&&Object.entries(m).forEach(function(e){var n=E(e,2),t=n[0],o=n[1];s.searchParams.set(t,o)}),e.prev=11,e.next=14,fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ke({adsParams:Ke({},f)},p))});case 14:return g=e.sent,e.next=17,g.json();case 17:return h=e.sent,w="https://"+new URL(s).hostname,I=h.trackingUrl,y=h.manifestUrl,T=w+I,b=w+y,Ze.set(T),console.log("%c TRACKING URL","background: #bdf369; color: #000",T),a.src=b,e.abrupt("return",a);case 29:return e.prev=29,e.t0=e.catch(11),e.abrupt("return",a);case 32:case"end":return e.stop()}},e,null,[[11,29]])}))).apply(this,arguments)}function on(e){var n;return Object.fromEntries(null==Object||null===(n=Object.entries(e))||void 0===n?void 0:n.map(function(e){var n=E(e,2),t=n[0],o=n[1];return[null==t?void 0:t.replace(/^aws\./,""),String(o)]}))||{}}function rn(e){var n={};if(!e.split("?")[1])return[{},{}];var t,o=new URL(e,window.location.origin),i=Xe((null==o?void 0:o.searchParams)||[]);try{for(i.s();!(t=i.n()).done;){var r=E(t.value,2),l=r[0],a=r[1];n[decodeURIComponent(l)]=decodeURIComponent(a||"")}}catch(e){i.e(e)}finally{i.f()}for(var d={},u={},s=0,c=Object.entries(n);s<c.length;s++){var v=E(c[s],2),f=v[0],m=v[1];if(f.startsWith("ads."))d[f.replace(/^ads\./,"")]=m;else u[f]=m}return[d,u]}var ln,an,dn,un,sn=(ln=[],{setQueuePoints:function(e){console.log("%c Setting SGAI Queue Points ","background: #bdf369; color: #000",e),ln=Array.isArray(e)?I(e):ln},getQueuePoints:function(){return console.log("%c Getting SGAI Queue Points ","background: #bdf369; color: #000",ln),I(ln)}}),cn=new Map;function vn(e,n){return fn.apply(this,arguments)}function fn(){return fn=n(t.mark(function e(o,i){var l,a,d,u,s,c,v,f,m,p,g,w,E,y,T,b,_,S,O,A,D,L,P,k;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:k=function(e,n,t,i,l,a){var d,u,s=r(o);if(!s.seeking()){var c=n.startTimeInSeconds;n.durationInSeconds;var v=(null==n||null===(d=n.ads)||void 0===d||null===(u=d[i])||void 0===u?void 0:u.adId)||c;Math.floor(s.currentTime());var f,m=Xe(t);try{var p=function(){var t,r,l,d=f.value,u=d.eventType,m=d.beaconUrls,p=d.startTimeInSeconds,g=d.startTime,h=d.durationInSeconds,w=p||c,I=m,E=(null===(t=window)||void 0===t||null===(r=t.customData)||void 0===r||null===(l=r.ads)||void 0===l?void 0:l.adEventHandler)||null,y="".concat(v,"_").concat(u),T="pod-".concat(c);cn.has(T)||cn.set(T,new Set);var b=cn.get(T);if(console.warn(e,w,"map:",u,"condition1:",e>=w,"map:",cn),e>=w&&e<=w+L){if(!b.has(y)){b.add(y);try{P(u,n,I,s)}catch(e){console.error("Error when calling triggerAdBeacon:",e,u,n)}if("breakEnd"==u){var _=en.position;en.set(null),setTimeout(function(){null!=_&&(s.currentTime(_),a())},500)}if("function"==typeof E)try{var S,O={eventType:u,startTimeInSeconds:p,startTime:g,durationInSeconds:h,ad:null==n||null===(S=n.ads)||void 0===S?void 0:S[i],pod:n,adIndex:i};E({adsData:O}),Me(o,O)}catch(e){console.error("Error when calling ads callback:",e)}}var A=Ye.get();if(A&&0!==Object.keys(A).length){var D=A.formulateComscoreAdPayload,k=A.startComscoreAdTracking,F=A.finishComscoreAdTracking,R=A.endComscoreAdTracking;if("impression"===u){var C,j=Ze.get();k(D(Ke(Ke({},null==n||null===(C=n.ads)||void 0===C?void 0:C[i]),{},{trackingUrl:j})))}else"complete"===u?F():"breakEnd"===u&&R()}}};for(m.s();!(f=m.n()).done;)p()}catch(e){m.e(e)}finally{m.f()}}},P=function(e,n,t,o){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})})},D=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},cn.clear(),en.set(i),m=Ze.get(),(p=r(o)).one("loadeddata",function(){m&&A(m)}),g=new Map,w=new Map,E=-1,y=(null===(l=document)||void 0===l||null===(a=l.getElementsByClassName("tvProviderImage"))||void 0===a?void 0:a[0])||null,T=(null==p||null===(d=p.controlBar)||void 0===d?void 0:d.getChild("videoSelector"))||null,b=(null==p||null===(u=p.controlBar)||void 0===u?void 0:u.getChild("seriesV2"))||null,_=(null==p||null===(s=p.el())||void 0===s||null===(c=s.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===c?void 0:c[0])||null,S=(null==p||null===(v=p.el())||void 0===v||null===(f=v.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===f?void 0:f[0])||null,O=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return I(o);var i=[],r=null==o?void 0:o.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),l=(null==r||null===(e=r.beaconUrls)||void 0===e?void 0:e.find(function(e){return e.includes("videoView")}))||null,a=(null==t?void 0:t.length)>1?null==t?void 0:t[(null==t?void 0:t.length)-1]:null==t?void 0:t[0],d=null==a||null===(n=a.trackingEvents)||void 0===n?void 0:n.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),u=(null==d?void 0:d.some(function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some(function(e){return e.includes("videoView")})}))||!1;if(!u&&l){var s=null==d?void 0:d.map(function(e){return Ke(Ke({},e),{},{eventType:"videoView",beaconUrls:[l]})});null!=s&&s[0]&&i.push(null==s?void 0:s[0])}return i},A=function(){var e=n(t.mark(function e(n){var l,a,d,u,s,c,v,f,m,p,A,L,P,F,R,C,j,N,V,W,B,U,M,x;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return W=function(e){document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",W),0===e.button&&j()},V=function(e){},N=function(){var e,n=p.currentTime(),t=null,o=Xe(m);try{for(o.s();!(e=o.n()).done;){var i=e.value,r=i.startTimeInSeconds,l=i.durationInSeconds,a=(i.ads,Math.floor(r+l));n>=r&&n<=a&&(t=a,g.set(r,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout(function(){p.currentTime(t+2.2)},100))},j=function(){var e,n=p.currentTime(),t=null,o=Xe(m);try{for(o.s();!(e=o.n()).done;){var i=e.value,r=i.startTimeInSeconds,l=i.durationInSeconds,a=i.ads,d=Math.floor(r+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>d||n>r)&&!g.has(r)||n>=r&&n<=d)&&(t=r,g.set(r,!0),w.set(r,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout(function(){p.currentTime(t-.4)},100))},s=!1,e.next=7,fetch(n);case 7:return c=e.sent,e.next=10,c.json();case 10:v=e.sent,console.log("%c TRACKING URL RESPONSE ","background: #d9e7ff; color: #000",v),f=v.avails,m=[],p=r(o),A=p.controlBar.progressControl,L=A.seekBar.el(),null===(l=document)||void 0===l||l.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),f.map(function(e,n){var t;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(s=!0),m.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:O(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),!s&&i&&(p.currentTime(i),N()),null!=m&&m.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",m),window.adsQueueList=m,"function"==typeof(C=(null===(P=window)||void 0===P||null===(F=P.customData)||void 0===F||null===(R=F.ads)||void 0===R?void 0:R.onAdBreaksLoaded)||null)&&(null==m?void 0:m.length)>0&&C(m)),console.log(m,"data"),m.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=p.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var i=n/o*100,r=document.createElement("div");r.className="vjs-seekbar-marker",r.style.left="".concat(i,"%"),r.style.position="absolute",r.style.top="0",r.style.bottom="0",r.style.width="2px",r.style.backgroundColor="#fecc09",r.style.left="".concat(i,"%"),r.style.pointerEvents="none",L.appendChild(r)}}),p._timeUpdateHandler&&p.off("timeupdate",p._timeUpdateHandler),p._timeUpdateHandler=h(function(){var e=p.currentTime();if(e!==E){E=e;for(var n=!1,t=function(){var t=m[o],i=t.startTimeInSeconds,r=t.durationInSeconds,l=t.ads,a=i+r;if(e>=i-4&&e<=a+4){var d;e>=i&&e<=a&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n=!0),e>a&&g.set(i,!0),Fe.disable(),y&&y.classList.add("vjs-hidden"),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),T&&(T.el().style.pointerEvents="none",T.el().classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),A.el().classList.add("hide-progress-bar");for(var u=e-i,s=0,c=0,v=0;v<l.length;v++){var f,p=null==l||null===(f=l[v])||void 0===f?void 0:f.durationInSeconds;if(u<s+p){c=v;break}s+=p}l[c];var h=Math.max(0,r-u),E=Math.round(h);B.style.display="block",x.textContent="".concat(c+1," of ").concat(l.length," • ").concat(D(E));var O=[];return null==l||l.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});O.push.apply(O,I(n))}),(null==t||null===(d=t.podSlotImpressionBeacon)||void 0===d?void 0:d.length)>0&&O.push.apply(O,I(null==t?void 0:t.podSlotImpressionBeacon)),k(e,t,O,c,0,N),"break"}w.delete(i)},o=0;o<m.length;o++){if("break"===t())break}n||(B.style.display="none",A.el().classList.remove("hide-progress-bar"),T&&(T.el().style.pointerEvents="auto",T.el().classList.remove("vjs-hidden")),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),y&&y.classList.remove("vjs-hidden"),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),Fe.enable())}},1e3),p.on("timeupdate",p._timeUpdateHandler),null===(a=document)||void 0===a||a.addEventListener("keydown",function(e){Fe.enabled&&"ArrowRight"==e.key&&(j(),On(o,10),e.stopPropagation())}),A.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",V),document.addEventListener("pointerup",W))}),null===(d=document)||void 0===d||null===(u=d.querySelectorAll(".ssai-ad-container"))||void 0===u||u.forEach(function(e){return null==e?void 0:e.remove()}),(B=document.createElement("div")).className="ssai-ad-container",(U=document.createElement("div")).className="sponsored-adbox",(M=document.createElement("div")).className="sponsored-text",M.textContent="Sponsored Ad",U.append(M),(x=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",B.append(U),B.append(x),p.el().appendChild(B);case 45:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),L=3.5;case 19:case"end":return e.stop()}},e)})),fn.apply(this,arguments)}function mn(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return pn(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?pn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,r=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw r}}}}function pn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function gn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function hn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?gn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):gn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var wn={},In=(null===(an=window)||void 0===an||null===(dn=an.location)||void 0===dn||null===(un=dn.search)||void 0===un?void 0:un.includes("debug=true"))||!1,En=null;function yn(e){return Tn.apply(this,arguments)}function Tn(){return Tn=n(t.mark(function e(o){var i,l,a,d,u,s,c,v,f,m,p,g,w,E,y,T,b,_,S,O,A,D,L,P,k,F,R;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:R=function(e,n,t,i,l){var a,d,u=r(o);if(!u.seeking()){var s=n.startTimeInSeconds;n.durationInSeconds;var c=(null==n||null===(a=n.ads)||void 0===a||null===(d=a[i])||void 0===d?void 0:d.adId)||s;Math.floor(u.currentTime());var v,f=mn(t);try{for(f.s();!(v=f.n()).done;){var m,p,g,h=v.value,w=h.eventType,I=h.beaconUrls,E=h.startTimeInSeconds,y=h.startTime,T=h.durationInSeconds,b=(h.eventId,E||s),_=I,S=(null===(m=window)||void 0===m||null===(p=m.customData)||void 0===p||null===(g=p.ads)||void 0===g?void 0:g.adEventHandler)||null,O="".concat(c,"_").concat(w),A="pod-".concat(s);P.has(A)||P.set(A,new Set);var D=P.get(A);if(In&&console.warn(e,b,"map:",w,"condition1:",e>=b,"map:",P),e>=b&&e<=b+k&&!D.has(O)){D.add(O);try{F(w,n,_,u)}catch(e){console.error("Error when calling triggerAdBeacon:",e,w,n)}if("function"==typeof S)try{var L,R={eventType:w,startTimeInSeconds:E,startTime:y,durationInSeconds:T,ad:null==n||null===(L=n.ads)||void 0===L?void 0:L[i],pod:n,adIndex:i};S({adsData:R}),Me(o,R)}catch(e){console.error("Error when calling ads callback:",e)}}}}catch(e){f.e(e)}finally{f.f()}}},F=function(e,n,t,o){var i,r,l;"breakEnd"===e&&(null===(i=wn)||void 0===i?void 0:i.currentAdIndex)+1!=(null===(r=wn)||void 0===r?void 0:r.totalAds)&&(null==n||null===(l=n.ads)||void 0===l?void 0:l.length)>0||(In&&console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})}))},p=function(){En&&clearInterval(En)},f=Ze.get(),(m=r(o)).one("loadeddata",function(){p(),En=setInterval(function(){f&&!m.paused()&&L(f)},2e3)}),m.on("dispose",function(){p()}),g=new Map,w=new Map,E=-1,y=null,T=(null===(i=document)||void 0===i||null===(l=i.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,b=(null==m||null===(a=m.controlBar)||void 0===a?void 0:a.getChild("videoSelector"))||null,_=(null==m||null===(d=m.controlBar)||void 0===d?void 0:d.getChild("seriesV2"))||null,S=(null==m||null===(u=m.el())||void 0===u||null===(s=u.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===s?void 0:s[0])||null,O=(null==m||null===(c=m.el())||void 0===c||null===(v=c.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===v?void 0:v[0])||null,A=!1,D=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return I(o);var i=[],r=null==o?void 0:o.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),l=(null==r||null===(e=r.beaconUrls)||void 0===e?void 0:e.find(function(e){return e.includes("videoView")}))||null,a=(null==t?void 0:t.length)>1?null==t?void 0:t[(null==t?void 0:t.length)-1]:null==t?void 0:t[0],d=null==a||null===(n=a.trackingEvents)||void 0===n?void 0:n.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),u=(null==d?void 0:d.some(function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some(function(e){return e.includes("videoView")})}))||!1;if(!u&&l){var s=null==d?void 0:d.map(function(e){return hn(hn({},e),{},{eventType:"videoView",beaconUrls:[l]})});null!=s&&s[0]&&i.push(null==s?void 0:s[0])}return i},L=function(){var e=n(t.mark(function e(n){var i,l,a,d,u,s,c,v,f,m,p,L,P,k;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=new URL(n),y&&l.searchParams.append("nextToken",y),e.next=4,fetch(l.toString(),{method:"GET"});case 4:return a=e.sent,e.next=7,a.json();case 7:d=e.sent,u=d.avails,s=d.nextToken||null,y=s,c=[],v=r(o),f=v.controlBar.progressControl,m=f.seekBar.el(),null===(i=document)||void 0===i||i.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),u.map(function(e,n){c.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:D(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),In&&console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",c),null!=c&&c.length&&(window.adsQueueList=c,"function"==typeof(k=(null===(p=window)||void 0===p||null===(L=p.customData)||void 0===L||null===(P=L.ads)||void 0===P?void 0:P.onAdBreaksLoaded)||null)&&(null==c?void 0:c.length)>0&&k(c)),c.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=v.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var i=n/o*100,r=document.createElement("div");r.className="vjs-seekbar-marker",r.style.left="".concat(i,"%"),r.style.position="absolute",r.style.top="0",r.style.bottom="0",r.style.width="2px",r.style.backgroundColor="#fecc09",r.style.left="".concat(i,"%"),r.style.pointerEvents="none",m.appendChild(r)}}),v._timeUpdateHandler&&v.off("timeupdate",v._timeUpdateHandler),v._timeUpdateHandler=h(function(){var e=v.currentTime();if(e!==E){E=e;for(var n=function(){var n=c[t],o=n.startTimeInSeconds,i=n.durationInSeconds,r=n.ads,l=o+i;if(e>=o-1.2&&e<=l+1.2){var a;A=!!(e>=o&&e<=l&&Array.isArray(r)&&(null==r?void 0:r.length)>0),e>l&&g.set(o,!0),Fe.disable(),T&&T.classList.add("vjs-hidden"),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),O&&(O.style.pointerEvents="none",O.classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),_&&(_.el().style.pointerEvents="none",_.el().classList.add("vjs-hidden")),f.el().classList.add("hide-progress-bar");for(var d=e-o,u=0,s=0,v=0;v<r.length;v++){var m,p=null==r||null===(m=r[v])||void 0===m?void 0:m.durationInSeconds;if(d<u+p){s=v;break}u+=p}setTimeout(function(){wn.totalAds=null==r?void 0:r.length,wn.currentAdIndex=s},1e3);var h=[];return null==r||r.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});h.push.apply(h,I(n))}),(null==n||null===(a=n.podSlotImpressionBeacon)||void 0===a?void 0:a.length)>0&&h.push.apply(h,I(null==n?void 0:n.podSlotImpressionBeacon)),R(e,n,h,s),"break"}w.delete(o)},t=0;t<c.length;t++){if("break"===n())break}A||(wn={},f.el().classList.remove("hide-progress-bar"),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),_&&(_.el().style.pointerEvents="auto",_.el().classList.remove("vjs-hidden")),T&&T.classList.remove("vjs-hidden"),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),O&&(O.style.pointerEvents="auto",O.classList.remove("vjs-hidden")),Fe.enable())}},1e3),v.on("timeupdate",v._timeUpdateHandler);case 23:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),P=new Map,k=2.5;case 22:case"end":return e.stop()}},e)})),Tn.apply(this,arguments)}function bn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}var _n=function(e){o(e).play()},Sn=function(e){o(e).pause()},On=function(e,n){var t=o(e),i=t.currentTime()+n;t.currentTime(i)},An=function(e,n){var t=o(e),i=t.currentTime(),r=i<=n?0:i-n;t.currentTime(r)},Dn=function(e){return!!o.getPlayer("".concat(e))},Ln=function(e){return o(e).paused()},Pn=function(){var e=n(t.mark(function e(o,i){var l,a,d,u=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=u.length>2&&void 0!==u[2]&&u[2],e.next=3,z();case 3:return a=e.sent,d=r(o),e.abrupt("return",new Promise(function(e,r){var u=(null==i?void 0:i.programs)||[];null==i||delete i.programs,j(i,a).then(function(){var r=n(t.mark(function n(r){var a,s,v,m,p,g,h,w;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(a=null==r?void 0:r.data,window.sid=Z(),a.contentType="linearchannel",a.channelId=null==i?void 0:i.channelId,c(a),f(u),!l){n.next=16;break}if(h=(null==a||null===(s=a.linearchannel)||void 0===s?void 0:s.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(v=window)||void 0===v||null===(m=v.app_data)||void 0===m||null===(p=m.appcmsMain)||void 0===p||null===(g=p.adsConfig)||void 0===g?void 0:g.vodAdSticherProvider)||!1,w=Ee(a,o),!h){n.next=13;break}return n.next=12,nn(o,a);case 12:w=n.sent;case 13:w&&(jn(o,w),h&&yn(o),d.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:a})})),n.next=17;break;case 16:e({status:!0,msg:"Feed authenticated",response:a});case 17:case"end":return n.stop()}},n)}));return function(e){return r.apply(this,arguments)}}()).catch(function(e){r({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),kn=function(){var e=n(t.mark(function e(o,i,l){var a,d,s,f,g,h,w;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z();case 2:return f=e.sent,(u()||null)&&v(i),g=0,h=0,w=null,null!==(a=window)&&void 0!==a&&a.watchHistory&&null!==(d=window)&&void 0!==d&&null!==(s=d.watchHistory)&&void 0!==s&&s.enable&&W(i,f).then(function(e){var n,t,o,i,r,l,a;(null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),g=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,(h=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null)<95)&&(w=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedTime)||null)}).catch(function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))}),e.abrupt("return",new Promise(function(e,l){C(i,f).then(function(){var i=n(t.mark(function n(i){var a,d,u,s,v,f,I,E,y,T,b,_,S,O,A,D,L,P,k,F,R,C,j,N,V,W,B,U,M,x,H,G,Q,Y,z,q,K,X;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(D=null==i?void 0:i.data,L=(null==D?void 0:D.contentType)||"video",P=(null==D||null===(a=D[L])||void 0===a?void 0:a.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(d=window)||void 0===d||null===(u=d.app_data)||void 0===u||null===(s=u.appcmsMain)||void 0===s||null===(v=s.adsConfig)||void 0===v?void 0:v.vodAdSticherProvider)||!1,k=(null==D||null===(f=D.video)||void 0===f||null===(I=f.streamingInfo)||void 0===I?void 0:I.isLiveStream)||!1,c(i.data),(F=(null==D||null===(E=D.ads)||void 0===E||null===(y=E.preRoll)||void 0===y||null===(T=y.adTags)||void 0===T||null===(b=T.web)||void 0===b?void 0:b.active)&&(null==D||null===(_=D.ads)||void 0===_||null===(S=_.preRoll)||void 0===S||null===(O=S.adTags)||void 0===O||null===(A=O.web)||void 0===A?void 0:A.url))&&Le(o,F,D),R=Ee(D,o),!P){n.next=12;break}return n.next=11,nn(o,D);case 11:R=n.sent;case 12:R?(G=(null==D||null===(C=D.video)||void 0===C||null===(j=C.gist)||void 0===j?void 0:j.videoImageUrl)||(null==D||null===(N=D.video)||void 0===N||null===(V=N.gist)||void 0===V||null===(W=V.imageGist)||void 0===W?void 0:W.r16x9),(Q=r(o)).poster(G),jn(o,R),P&&vn(o,w),Q.on("loadstart",function(){k&&e({status:!0,msg:"Video Loaded",response:D})}),Q.on("loadeddata",function(){Ae(),e({status:!0,msg:"Video Loaded",response:D})}),Q.one("play",function(){g&&!P&&h<95&&setTimeout(function(){Q.currentTime(g)},0)}),Q.one("error",function(){var e;l({status:!1,msg:(null==Q||null===(e=Q.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==D||null===(B=D.video)||void 0===B||null===(U=B.contentDetails)||void 0===U||null===(M=U.closedCaptions)||void 0===M?void 0:M.length)>0||(null==D||null===(x=D.video)||void 0===x||null===(H=x.closedCaptions)||void 0===H?void 0:H.length)>0?(X=(null==D||null===(z=D.video)||void 0===z||null===(q=z.contentDetails)||void 0===q?void 0:q.closedCaptions)||(null==D||null===(K=D.video)||void 0===K?void 0:K.closedCaptions),Y=X.filter(function(e){return"VTT"===e.format}),m(o,Y)):p(o)):(Oe(o,"Incompatible Source, only hls,mp4,drm content is allowed"),l("Incompatible Source, only hls,mp4,drm content is allowed"));case 13:case"end":return n.stop()}},n)}));return function(e){return i.apply(this,arguments)}}()).catch(function(e){Nn(e,o,l,i)})}));case 10:case"end":return e.stop()}},e)}));return function(n,t,o){return e.apply(this,arguments)}}(),Fn=function(e,n,t){var o=r(e);return o.src(n),new Promise(function(e,n){var i=0;o.one("loadedmetadata",function(){clearTimeout(i),e({status:!0,msg:"video loaded"})}),o.one("loadstart",function(e){i=setTimeout(function(){n("FAILED: Took too long to load")},t)})})},Rn=function(e){var n=(Ye.get()||{}).destroyComscoreTag,t=r(e);if(Cn(),"function"==typeof n&&n(),w(),window.onresize=null,t)t.dispose();else{var o=document.getElementById(e);o&&o.remove()}},Cn=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},jn=function(e,n){var t=r(e);t&&t.src(n)},Nn=function(n,t,o,i){var r,l,a,d,u,s,c=null==n||null===(r=n.response)||void 0===r||null===(l=r.data)||void 0===l?void 0:l.errorCode,v=(null==n||null===(a=n.response)||void 0===a||null===(d=a.data)||void 0===d?void 0:d.errorMessage)||(null==n?void 0:n.message);Dn(t)&&Oe(t,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[c])||"".concat(v)),o&&o(function(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?bn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):bn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}({status:!1,response:n,msg:"".concat(v)},i&&{videoId:i}))},Vn=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var o=n.getElementsByClassName("vjs-big-play-button")[0];o&&(o.style.display="none");var i=n.getElementsByClassName("vjs-fullscreen-control")[0];i&&(i.style.display="none")},Wn=function(e){var n,t=r(e);return!(null!=t&&null!==(n=t.liveTracker)&&void 0!==n&&n.atLiveEdge())||null};export{_n as A,Sn as B,An as C,Dn as D,kn as E,Pn as F,Rn as G,M as H,sn as I,xe as J,Wn as K,U as L,q as M,G as N,x as O,O as P,cn as Q,Pe as R,ue as S,Ln as T,yn as U,vn as V,B as W,ve as a,ce as b,Ye as c,de as d,Ee as e,Ae as f,ee as g,Oe as h,ze as i,Vn as j,ae as k,jn as l,Le as m,Se as n,nn as o,K as p,C as q,W as r,V as s,Nn as t,z as u,j as v,N as w,se as x,Fn as y,On as z};