@viewlift/player-backup 2.0.193-backup → 2.0.194-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 (49) hide show
  1. package/cjs/{autoNextVideo-cce269d2.js → autoNextVideo-f889c5e4.js} +1 -1
  2. package/cjs/bundle.css +4 -4
  3. package/cjs/{features-91349968.js → features-7de36d8e.js} +1 -1
  4. package/cjs/{generic-0eaa1549.js → generic-4e805f47.js} +1 -1
  5. package/cjs/{index-bc68523e.js → index-3eba5e9d.js} +1 -1
  6. package/cjs/{index-627b3aef.js → index-a6e8d62b.js} +1 -1
  7. package/cjs/index.js +1 -1
  8. package/cjs/{multicamv2-829f816a.js → multicamv2-405bf4cc.js} +1 -1
  9. package/cjs/{multicamv2-79b585e9.js → multicamv2-6b932105.js} +1 -1
  10. package/cjs/{nextEpisodeButton-7e8abba5.js → nextEpisodeButton-0d7c0b50.js} +1 -1
  11. package/cjs/{playlist-79ff4075.js → playlist-b4d03127.js} +1 -1
  12. package/cjs/{series-e5b53687.js → series-5b57f0e1.js} +1 -1
  13. package/cjs/{series-v2-29d23ef2.js → series-v2-c4aad8fe.js} +1 -1
  14. package/cjs/{series-v2-543dfc42.js → series-v2-f54282df.js} +1 -1
  15. package/cjs/{skin-b43b544d.js → skin-181e8f3a.js} +1 -1
  16. package/cjs/{skin-c9fb6c8e.js → skin-29cb99a0.js} +1 -1
  17. package/cjs/{skin-fd861e83.js → skin-2e106b57.js} +1 -1
  18. package/cjs/{skin-9ba54e62.js → skin-97d0589c.js} +1 -1
  19. package/cjs/{skin-0cf97fa5.js → skin-a5330043.js} +1 -1
  20. package/cjs/{skin-ecc0b03c.js → skin-ae0e0308.js} +1 -1
  21. package/cjs/{skin-1b963ebf.js → skin-b82eedaa.js} +1 -1
  22. package/cjs/{util-ef855bb7.js → util-fbcec4f7.js} +1 -1
  23. package/cjs/{videoSelector-09aa5abb.js → videoSelector-695cee4f.js} +1 -1
  24. package/cjs/{videoSelector-2809f330.js → videoSelector-ef562592.js} +1 -1
  25. package/esm/{autoNextVideo-a69d230f.js → autoNextVideo-ef11b0ee.js} +1 -1
  26. package/esm/bundle.css +4 -4
  27. package/esm/{features-f2408e3d.js → features-7f857062.js} +1 -1
  28. package/esm/{generic-e2bee7fc.js → generic-68a2c5e8.js} +1 -1
  29. package/esm/{index-081f8ff4.js → index-1a1a6355.js} +1 -1
  30. package/esm/{index-0b004e1e.js → index-80aa808a.js} +1 -1
  31. package/esm/index.js +1 -1
  32. package/esm/{multicamv2-6eb472e6.js → multicamv2-19ed63ed.js} +1 -1
  33. package/esm/{multicamv2-569ee122.js → multicamv2-1fd17944.js} +1 -1
  34. package/esm/{nextEpisodeButton-e346febc.js → nextEpisodeButton-04a12445.js} +1 -1
  35. package/esm/{playlist-0db6286c.js → playlist-a5e15053.js} +1 -1
  36. package/esm/{series-718f8ad1.js → series-0edfb400.js} +1 -1
  37. package/esm/{series-v2-ed983c79.js → series-v2-0395617b.js} +1 -1
  38. package/esm/{series-v2-fec5e927.js → series-v2-887711fb.js} +1 -1
  39. package/esm/{skin-cab50a11.js → skin-1259c481.js} +1 -1
  40. package/esm/{skin-e901ced2.js → skin-1876709c.js} +1 -1
  41. package/esm/{skin-486852f1.js → skin-1fbe0177.js} +1 -1
  42. package/esm/{skin-e0cce819.js → skin-502c1744.js} +1 -1
  43. package/esm/{skin-2fc8eb1a.js → skin-afa520d0.js} +1 -1
  44. package/esm/{skin-65203d16.js → skin-cb1d30e1.js} +1 -1
  45. package/esm/{skin-8c73adfb.js → skin-d4aa846b.js} +1 -1
  46. package/esm/{util-baff1ff0.js → util-39e5b091.js} +1 -1
  47. package/esm/{videoSelector-209947e4.js → videoSelector-022e5ca0.js} +1 -1
  48. package/esm/{videoSelector-cb5a45ca.js → videoSelector-4b4ea92a.js} +1 -1
  49. package/package.json +1 -1
@@ -1 +1 @@
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 r from"axios";import{g as i}from"./player_instance-34118a5b.js";import l from"js-cookie";import{a,e as u,g as s,h as d,s as c,i as v,d as f}from"./currentVideoInfo-a8a254c2.js";import{a as p,r as m}from"./captions-f507e8ee.js";import{t as g,c as I}from"./skin-d5091b86.js";import h from"@babel/runtime/helpers/toConsumableArray";import y from"@babel/runtime/helpers/slicedToArray";import{destroyComscoreTag as E,formulateComscorePayload as T,createComscoreStreamingTag as b,setComscorePlayerInstance as w}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 _(e){window.dataLayer=window.dataLayer||[],S("js",new Date),S("config",e)}function O(e,n){S("event",e,n)}var A={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 D={name:"@viewlift/player",version:"2.0.61",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":"^0.0.4",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"}};window.vl_player_version=D.version;var k,C=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==A?void 0:A.getVideoDetails)},j=function(e,n){var t,o,i,l;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})})):r({url:C(),params:P({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(i=window)||void 0===i||null===(l=i.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":D.version,"x-player-name":"videojs"},withCredentials:!0})},R=function(e,n){var t,o,i,l;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})})):r({url:U.get()+A.getLinearChannelDetails,params:P(P(P(P(P({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web"},(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===(i=window)||void 0===i||null===(l=i.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},V=function(e,n){var t,o,i=q(n),l=(null==i?void 0:i.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})})):r({url:U.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:n}})},N=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,Y();case 2:return o=e.sent,e.abrupt("return",r({url:U.get()+"".concat(null==A?void 0:A.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)}}(),F=function(e,n){var t,o,i=window.contentType;return r({method:"GET",url:U.get()+"".concat(null==A?void 0:A.getVideoInfoV2,"/").concat(i,"/").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})},W=function(e){var n=e.videoId;return r({method:"GET",url:U.get()+"".concat(null==A?void 0:A.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},U=(k=null==A?void 0:A.apiBaseUrl,{set:function(e){e&&(k=e)},get:function(){return k}}),B=function(e,n,t,o){return r({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},withCredentials:!0})},M=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},x=null;function H(){return{set:function(e){e&&(x=e)},get:function(){return x}}}var G=function(){var e=n(t.mark((function e(){var n,o,i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=H().get(),o=U.get(),e.prev=2,e.next=5,r({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return i=e.sent,e.abrupt("return",i);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)}}(),Q=null,Y=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"))||!M(n)){e.next=6;break}return Q||(Q=G().then((function(e){var t,o,r=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,i=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return r&&sessionStorage.setItem("vlp_token",r),i&&H().set(i),r||n})).catch((function(e){return console.error("Error fetching refresh token",e),n})).finally((function(){Q=null}))),e.abrupt("return",Q);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),z=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},q=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))};function K(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 X(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?K(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):K(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var J=100,$=function(){var e,n,t,o,r,i,l,u=a();return"linearchannel"===((null==u?void 0:u.contentType)||"video")?null==u||null===(e=u.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==u?void 0:u.channelId)})))||void 0===t||null===(o=t.content)||void 0===o?void 0:o.id:(null==u||null===(r=u.video)||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.id)||(null==u||null===(l=u.video)||void 0===l?void 0:l.id)||(null==u?void 0:u.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(){var e=window.sessionStorage.getItem("uid");return e||(e=Z(),window.sessionStorage.setItem("uid",e),e)}function ne(){return te.apply(this,arguments)}function te(){return(te=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,Y();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 oe(e){return e?String(e):""}var re=function(e){return function(){try{return e.apply(void 0,arguments)}catch(e){return console.error(e),null}}};function ie(e,o){var l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=Z(),s="production",d="WEBSITE",c=null,v=0,f=null,p=0,m=0,g=!1,I=[],h=i(e);if(h){var y=function(){var e,n,t,o;return Math.round((null==h||null===(e=h.tech_)||void 0===e||null===(n=e.vhs)||void 0===n||null===(t=n.selectPlaylist())||void 0===t||null===(o=t.attributes)||void 0===o?void 0:o.BANDWIDTH)/1e3)},E=re((function(){for(var e=h.currentTime(),n=h.buffered(),t=0;t<n.length;t++){var o=n.start(t),r=n.end(t);if(e>=o&&e<=r)return Math.round(r-e)}return 0})),T=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},b=function(){var e=n(t.mark((function e(n){var o,i,a,c,v,f,p,m,g,I,h,y;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Y();case 2:return I=e.sent,h=q(I),e.t0=X,e.t1=X,e.t2=null==h?void 0:h.site,e.t3=null==h?void 0:h.siteId,e.t4=d,e.t5=ee(),e.t6=$(),e.t7=n.url||document.location.href,e.t8=n.ref||document.referrer,e.t9=n.eventName,e.t10=null!==(o=n.videoPosition)&&void 0!==o?o:null,e.t11=s,e.t12=n.dp1||"",e.t13=n.dp2||"",e.t14=n.dp3||"",e.t15=n.dp4||"",e.t16=n.dp5||"",e.t17=n.isAdEvent?n.videoPosition:null,e.t18=n.isAdEvent?oe(n.adPosition):"",e.next=25,ne();case 25:e.t19=e.sent,e.t20=n.playerType||"videojs",e.t21=n.mediaType||"VIDEO",e.t22=u,e.t23=null!==(i=n.ttFirstFrame)&&void 0!==i?i:null,e.t24=null!==(a=n.bitrate)&&void 0!==a?a:null,e.t25=null!==(c=n.resHeight)&&void 0!==c?c:null,e.t26=null!==(v=n.resWidth)&&void 0!==v?v:null,e.t27=null!==(f=n.bufferHealth)&&void 0!==f?f:null,e.t28=null!==(p=T())&&void 0!==p?p:null,e.t29=siteName,e.t30={aid:e.t2,cid:e.t3,pfm:e.t4,uid:e.t5,vid:e.t6,url:e.t7,ref:e.t8,pa:e.t9,vpos:e.t10,environment:e.t11,dp1:e.t12,dp2:e.t13,dp3:e.t14,dp4:e.t15,dp5:e.t16,apos:e.t17,apod:e.t18,profid:e.t19,player:e.t20,media_type:e.t21,stream_id:e.t22,embedurl:"",ttfirstframe:e.t23,bitrate:e.t24,connectionspeed:null,resolutionheight:e.t25,resolutionwidth:e.t26,bufferhealth:e.t27,networkname:e.t28,brandname:e.t29},e.t31=(null==n?void 0:n.duration)&&{duration:n.duration},e.t32=(0,e.t1)(e.t30,e.t31),e.t33=null==l||null===(m=l.beacon)||void 0===m?void 0:m.params,e.t34=(0,e.t0)(e.t32,e.t33),y=[e.t34],r({url:(null==l||null===(g=l.beacon)||void 0===g?void 0:g.url)||U.get()+A.getBeaconUrl,method:"post",headers:{Authorization:I},contentType:"application/x-www-form-urlencoded",dataType:"text",data:y}).catch((function(e){return console.error(e)}));case 43:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),w=function(e){if(!h.paused()&&h.readyState()>2)return clearInterval(c),clearInterval(f),e;var n,t=e+.1;return+t.toFixed(2)>=5&&m<4&&g?(m++,O("BUFFERING",X({pfm:d,uid:ee(),vid:$(),videoPosition:Math.floor(h.currentTime)},null==l||null===(n=l.beacon)||void 0===n?void 0:n.params)),b({eventName:"BUFFERING",videoPosition:Math.floor(h.currentTime),isAdEvent:!1}),0):t},S=function(){var e=Math.floor(h.currentTime);h.on("error",(function(){var n,t=Math.floor(h.currentTime);clearInterval(c);var o=e===t?"FAILED_TO_START":"DROPPED_STREAM";O(o,X({pfm:d,uid:ee(),vid:$(),videoPosition:t},null==l||null===(n=l.beacon)||void 0===n?void 0:n.params)),b({eventName:o,videoPosition:t,isAdEvent:!1})}))},_=function(){var e=re((function(){var e;v=0,f=setInterval((function(){v=w(v)}),J),O("PLAY",X({pfm:d,uid:ee(),vid:$(),videoPosition:Math.floor(h.currentTime)},null==l||null===(e=l.beacon)||void 0===e?void 0:e.params)),b({eventName:"PLAY",videoPosition:Math.floor(h.currentTime),isAdEvent:!1}),o&&o("started_video_playback",{"Video ID":$(),watchTime:Math.floor(h.currentTime)})}));h.one("play",e)},L=function(){h.one("timeupdate",(function(){var e;clearInterval(f),clearInterval(c),p=v||0,O("FIRST_FRAME",X({pfm:d,uid:ee(),vid:$(),videoPosition:Math.floor(h.currentTime),ttFirstFrame:v,bufferHealth:E()},null==l||null===(e=l.beacon)||void 0===e?void 0:e.params)),b({eventName:"FIRST_FRAME",videoPosition:Math.floor(h.currentTime),isAdEvent:!1,ttFirstFrame:v,bufferHealth:E()}),g=!0,v=0}))},P=function(){var e=!1;h.on("waiting",re((function(){g&&(e=!0,clearInterval(c),c=setInterval((function(){e&&!h.paused()?p=w(p):clearInterval(c)}),J))}))),h.on("playing",re((function(){e=!1,clearInterval(c)})))},D=function(){var e=function(e){var n,t,o,r=X({videoPosition:Math.floor(h.currentTime),isAdEvent:!0,bufferHealth:E(),pfm:d,uid:ee(),vid:$(),resHeight:(null===(n=videoElement)||void 0===n?void 0:n.videoHeight)||null,resWidth:(null===(t=videoElement)||void 0===t?void 0:t.videoWidth)||null},null==l||null===(o=l.beacon)||void 0===o?void 0:o.params);O(e,X({},r)),b(X({eventName:e,adPosition:1},r))};h.on("adstart",(function(){e("AD_REQUEST"),e("AD_IMPRESSION")})),h.on("adskip",(function(){v=0})),h.on("adend",(function(){v=0}))},k=function(){h.on("timeupdate",(function(){var e=Math.floor(h.currentTime());if(e>=30&&e%30==0&&!I.includes(e)){var n,t=null===(n=h.el().getElementsByTagName("video"))||void 0===n?void 0:n[0];m=0,I.push(e),b({eventName:"PING",videoPosition:e,isAdEvent:!1,duration:30,resHeight:(null==t?void 0:t.videoHeight)||null,resWidth:(null==t?void 0:t.videoWidth)||null,bufferHealth:E(),bitrate:y()})}}))};S(),P(),D(),k(),_(),h.on("loadeddata",L)}else console.error("Videojs: Player instance not found.")}function le(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"localhost"!==location.hostname&&"127.0.0.1"!==location.hostname&&ie(e,n,t)}var ae=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;W({videoId:e,token:n}).then((function(e){e.data.map((function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),d(t)})).catch((function(e){return console.log(e)}))},de=function(){var e=u.get();return e>=0?e+1:1},ce=function(){var e,n,t,o=s(),r=a(),i=null==r||null===(e=r.video)||void 0===e?void 0:e.id,l=u.get(),d=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)===i}));return d>=0?d+1:1};function ve(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 fe(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ve(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):ve(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"},me=function(e){var n=ge(e,"video.tags",[]),t=ge(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map((function(e){return e.title})).join(","):t},ge=function(e,n,t){for(var o=0,r=(n=n.split(".")).length;o<r;o++){var i;e=null===(i=e)||void 0===i?void 0:i[n[o]]}return e||t},Ie=function(){var n,t,o,r,a,u,s,d,c,v,f,p,m,g,I,h,y,E,T,b,w,S,_,O,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",L=arguments.length>1?arguments[1]:void 0,P=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 D=(null==P?void 0:P.siteName)||"",k=(null==P?void 0:P.contentType)||"video",C=(null==P||null===(o=P[k])||void 0===o?void 0:o.metadata)||(null==P||null===(r=P[k])||void 0===r||null===(a=r.gist)||void 0===a?void 0:a.metadata),j=i(L);if(!A.includes("VIEWLIFT_"))return A;var R,V=window.getComputedStyle(document.getElementById(L),null),N=Math.trunc(V.getPropertyValue("height").slice(0,-2)),F=Math.trunc(V.getPropertyValue("width").slice(0,-2)),W="linearchannel"===k?null==P||null===(u=P.linearchannel)||void 0===u||null===(s=u.channels)||void 0===s||null===(d=s.find((function(e){return(null==e?void 0:e.id)===(null==P?void 0:P.channelId)})))||void 0===d||null===(c=d.content)||void 0===c?void 0:c.id:ge(P,"video.gist.id",""),U="linearchannel"===k?null==P||null===(v=P.linearchannel)||void 0===v||null===(f=v.channels)||void 0===f||null===(p=f.find((function(e){return(null==e?void 0:e.id)===(null==P?void 0:P.channelId)})))||void 0===p?void 0:p.title:ge(P,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),B=null,M=null;"function"==typeof window.__gpp&&(null===(R=window)||void 0===R||R.__gpp("ping",(function(e){B=null==e?void 0:e.gppString,M=null==e?void 0:e.sectionList[0]})));var x=fe(fe({},he(C)),{},(S={VIEWLIFT_WIDTH:F,VIEWLIFT_HEIGHT:N,VIEWLIFT_SIZE:pe(F,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===(m=window)||void 0===m?void 0:m.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:ge(P,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:ge(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:ge(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==j||null===(g=j.options_)||void 0===g?void 0:g.autoplay)||1,VIEWLIFT_MUTE:(null==j||null===(I=j.options_)||void 0===I?void 0:I.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==D||"usanetwork"==D?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:me(P),VIEWLIFT_MEDIA_ID:W,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(ge(P,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:W,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+ge(P,"video.gist.permalink","")),VIEWLIFT_CONSENT:l.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:ge(null===(h=window)||void 0===h||null===(y=h.app_data)||void 0===y||null===(E=y.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"==D||"usanetwork"==D?"":ge(null===(T=window)||void 0===T||null===(b=T.app_data)||void 0===b||null===(w=b.site)||void 0===w?void 0:w.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*ge(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:ge(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:W,VIEWLIFT_CONTENT_TITLE:U,VIEWLIFT_CONTENT_SERIES_TITLE:ge(P,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:ge(P,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ce(),VIEWLIFT_SEASON_NUMBER:de(),VIEWLIFT_CONTENT_TAGS:me(P),VIEWLIFT_GPP_SID:M||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:B||"VIEWLIFT_GPP",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:"",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},e(S,"VIEWLIFT_LAT",""),e(S,"VIEWLIFT_APP_BUNDLE",""),e(S,"VIEWLIFT_ATT_CONSENT",""),S),null===(_=window)||void 0===_||null===(O=_.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},he=function(e){var n,t,o,r,i,l,a={},u=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map((function(e){u.set(e.name,e.value)})));var s=(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,d=(null===(r=window)||void 0===r||null===(i=r.customData)||void 0===i||null===(l=i.subscription)||void 0===l?void 0:l.TVE)||!1;return s||d?(ue()?s?a=fe(fe({},a),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||""}):d&&(a=fe(fe({},a),{},{VIEWLIFT_CSID:u.get("csid.mweb.tve")||""})):s?a=fe(fe({},a),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||""}):d&&(a=fe(fe({},a),{},{VIEWLIFT_CSID:u.get("csid.web.tve")||""})),s?a=fe(fe({},a),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||u.get("sfid.web.dtc")||""}):d&&(a=fe(fe({},a),{},{VIEWLIFT_SFID:u.get("sfid.tve")||u.get("sfid.web.tve")||""})),a=ue()?fe(fe({},a),{},{VIEWLIFT_PROF:u.get("prof.mweb")||""}):fe(fe({},a),{},{VIEWLIFT_PROF:u.get("prof.web")||""})):(a=fe(fe({},a),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||u.get("sfid.web.dtc")||""}),a=ue()?fe(fe({},a),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:u.get("prof.mweb")||""}):fe(fe({},a),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||"",VIEWLIFT_PROF:u.get("prof.web")||""})),a=fe(fe({},a),{},{VIEWLIFT_AFID:u.get("afid"),VIEWLIFT_NIELSEN_APP_ID:u.get("VIEWLIFT_NIELSEN_APP_ID")||"VIEWLIFT_NIELSEN_APP_ID",VIEWLIFT_CHANNEL:u.get("VIEWLIFT_CHANNEL")||"VIEWLIFT_CHANNEL",VIEWLIFT_GRACE_NOTE_ID:u.get("VIEWLIFT_GRACE_NOTE_ID")||"VIEWLIFT_GRACE_NOTE_ID"})},ye=function(e,n){var t,o,r,i,l,a,u,s,d,c,v,f,p,m=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[m])||void 0===t?void 0:t.drmEnabled,I=null==e||null===(o=e[m])||void 0===o||null===(r=o.streamingInfo)||void 0===r?void 0:r.videoAssets,h=null==e||null===(i=e[m])||void 0===i||null===(l=i.streamingInfo)||void 0===l?void 0:l.audioAssets,y=(null==e||null===(a=e[m])||void 0===a||null===(u=a.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(d=e[m])||void 0===d||null===(c=d.liveDetails)||void 0===c||c.isDvrEnabled;var E=(null==e||null===(v=e[m])||void 0===v||null===(f=v.streamingInfo)||void 0===f||null===(p=f.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=h&&h.hls)return Te(h);if(g){var T=be(I,n);return T.src=Ie(T.src,n,e),T}if("Safari"!==ae()&&E)return Ee(I);if(y){var b=Te(I);return b.src=Ie(b.src,n,e),b}if(null!=I&&I.mpeg){var w=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(I);return w.src=Ie(w.src,n,e),w}return null},Ee=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,r=e.fairPlayCmaf||e.fairPlay,l=e.widevine,a=e.playReady,u=ae();if(i(n),"Safari"===u){var s=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var r={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(r,(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,r,i){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:r,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(l,(function(e,n,t){console.log(e),e&&i(e),i(null,t)}))}}}}}(r);return we(n),s}var d,c={src:l.url,type:"application/dash+xml"};return"caliente"==(null===(d=window)||void 0===d?void 0:d.siteName)?(we(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 we=function(e){var n=i(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==ae()&&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 r=t.split(".com")[1]||"";return{src:r?"".concat(n).concat(r):t,type:o}},_e=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 r=document.createElement("div");r.className="error-container";var i=document.createElement("div");i.className="error-message",i.innerHTML="".concat(n),r.appendChild(i),o.append(r)}}},Oe=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var Ae=!1,Le=function(e,n,t){var o=Ie(n,e,t),r=i(e);if(n&&window.google){if("function"!=typeof r.ima)return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,n){var t,o,r,l=i(e);if(null!==l.el_){Ae=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),Ae&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout((function(){l.ima.setContentWithAdTag(null,n,!0),l.ima.requestAds()}),1e3));var u=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&u.hasAttribute("controls")&&u.removeAttribute("controls");var s="click",d=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(d=!0,s="touchend"),l.one(s,(function(){d&&l.ima.initializeAdDisplayContainer()}));var c=(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(r=o.ads)||void 0===r?void 0:r.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,r,l=i(e),a=null==l||null===(t=l.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,u=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",(function(t){var o,r,i,s,d,c,v,f,p;if(ke.enabled&&"input"!=t.target.localName){var m=t.key,g=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(m)&&(t.preventDefault(),null==u||u.focus()),m){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||On(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(r=window)||void 0===r||null===(i=r.app_data)||void 0===i||null===(s=i.appcmsMain)||void 0===s||null===(d=s.adsConfig)||void 0===d?void 0:d.vodAdSticherProvider)&&null!==(c=window)&&void 0!==c&&null!==(v=c.app_data)&&void 0!==v&&null!==(f=v.appcmsMain)&&void 0!==f&&null!==(p=f.adsConfig)&&void 0!==p&&p.vodAdClientSideTracking)return;g||_n(e,10)}}}),!0)}var De,ke=(De=!0,{enable:function(){De=!0},disable:function(){De=!1},get enabled(){return De}}),Ce="ssai-breakStart",je="ssai-adImpression",Re="ssai-firstQuartile",Ve="ssai-midpoint",Ne="ssai-thirdQuartile",Fe="ssai-complete",We="ssai-breakEnd",Ue={breakStart:Ce,impression:je,firstQuartile:Re,midpoint:Ve,thirdQuartile:Ne,complete:Fe,breakEnd:We};function Be(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=i(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var o=n.eventType,r=Ue[o];r&&t.trigger(r,n)}function Me(e){var n=i(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(Ce,e)},adImpression:function(e){return t(je,e)},adFirstQuartile:function(e){return t(Re,e)},adMidpoint:function(e){return t(Ve,e)},adThirdQuartile:function(e){return t(Ne,e)},adComplete:function(e){return t(Fe,e)},adBreakEnd:function(e){return t(We,e)}}}function xe(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 He(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?xe(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):xe(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Ge,Qe=(Ge=null,{get:function(){return Ge},set:function(e){Ge=e}});function Ye(e,n){var t,o,r,l,u,s,d,c,v,f,p,m,g=null==e?void 0:e.playerId,I=i(g),h=null==n?void 0:n.siteName;if(null!=e&&null!==(t=e.comscore)&&void 0!==t&&t.enable){var y=a(),S=(null==y||null===(o=y.video)||void 0===o?void 0:o.metadata)||[],_=(null==S?void 0:S.length)&&S.filter((function(e){return"advertisingGenre"===e.name}));if(null!==(r=_)&&void 0!==r&&r.length){var O=_.map((function(e){return e.value}));_=null==O?void 0:O.join(",")}E();var A,L,P,D=null===(l=window)||void 0===l?void 0:l.lcProgrammeDetails,k=Array.isArray(null==D?void 0:D.category)?null==D||null===(u=D.category)||void 0===u?void 0:u.join(","):(null==D?void 0:D.category)||null,C=He(He(He({},null==y?void 0:y.video),null==y?void 0:y.linearchannel),{},{siteName:h,programId:(null==D?void 0:D.videotmsid)||null,programTitle:(null==D?void 0:D.lcProgrammeName)||null,episodeId:(null==D?void 0:D.videotmsid)||null,seasonNumber:(null==D||null===(s=D.seriesDetails)||void 0===s?void 0:s.season)||null,episodeNumber:(null==D||null===(d=D.seriesDetails)||void 0===d?void 0:d.episode)||null,isCompleteEpisode:!!(null!=y&&null!==(c=y.video)&&void 0!==c&&c.series||null!=D&&null!==(v=D.seriesDetails)&&void 0!==v&&v.episode),genre:_||k,comscoreConfig:{implementationId:(null==e||null===(f=e.comscore)||void 0===f?void 0:f.implementationId)||null,projectId:(null==e||null===(p=e.comscore)||void 0===p?void 0:p.projectId)||null}});if(null!=C&&null!==(m=C.streamingInfo)&&void 0!==m&&m.isLiveStream&&(C.contentType="LIVE"),null==C||!C.network){var j,R=(null==C?void 0:C.metadata)||[],V=null==R||null===(j=R.find((function(e){return"network"===e.name})))||void 0===j?void 0:j.value;C.network=V||null}null!=C&&C.network&&null!=C&&C.genre&&(C.customGenre="".concat(C.network,"_").concat((null==C?void 0:C.programTitle)||(A=C,null!=A&&A.series?null==A||null===(P=A.series)||void 0===P?void 0:P.title:null==A||null===(L=A.gist)||void 0===L?void 0:L.title),"_").concat(C.genre)),null!=D&&D.airDate&&(C.publishDate=D.airDate);var N=T(C,I);console.log("comscoreOptions player data",N),b(He({playerName:"Video.js"},N)),w(I)}}function ze(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 qe(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ze(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):ze(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}function Ke(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 Xe(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)?Xe(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}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 i,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,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function Xe(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 Je,$e=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),Ze=(Je=null,{set:function(e){Je=e},get position(){return Je}});function en(e,n){return nn.apply(this,arguments)}function nn(){return(nn=n(t.mark((function e(n,o){var r,l,a,u,s,d,c,v,f,p,m,g,I,h,E,T,b,w;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i(n),a=ye(o,n),u=a.src,s=(null==o?void 0:o.contentType)||"video",null==o||null===(r=o[s])||void 0===r||null===(l=r.streamingInfo)||void 0===l||l.isLiveStream,d=u.replace("/dash/","/session/").replace("/master/","/session/"),d=Ie(d,n,o),c=on(d),v=y(c,2),f=v[0],p=v[1],m=tn(p)||{},d=new URL(d.split("?")[0]),Object.keys(p).length>0&&Object.entries(p).forEach((function(e){var n=y(e,2),t=n[0],o=n[1];d.searchParams.set(t,o)})),e.prev=11,e.next=14,fetch(d,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(qe({adsParams:qe({},f)},m))});case 14:return g=e.sent,e.next=17,g.json();case 17:return I=e.sent,h="https://"+new URL(d).hostname,E=I.trackingUrl,T=I.manifestUrl,b=h+E,w=h+T,$e.set(b),console.log("%c TRACKING URL","background: #bdf369; color: #000",b),a.src=w,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 tn(e){var n;return Object.fromEntries(null==Object||null===(n=Object.entries(e))||void 0===n?void 0:n.map((function(e){var n=y(e,2),t=n[0],o=n[1];return[null==t?void 0:t.replace(/^aws\./,""),String(o)]})))||{}}function on(e){var n={};if(!e.split("?")[1])return[{},{}];var t,o=new URL(e,window.location.origin),r=Ke((null==o?void 0:o.searchParams)||[]);try{for(r.s();!(t=r.n()).done;){var i=y(t.value,2),l=i[0],a=i[1];n[decodeURIComponent(l)]=decodeURIComponent(a||"")}}catch(e){r.e(e)}finally{r.f()}for(var u={},s={},d=0,c=Object.entries(n);d<c.length;d++){var v=y(c[d],2),f=v[0],p=v[1];if(f.startsWith("ads."))u[f.replace(/^ads\./,"")]=p;else s[f]=p}return[u,s]}var rn,ln,an,un,sn=(rn=[],{setQueuePoints:function(e){console.log("%c Setting SGAI Queue Points ","background: #bdf369; color: #000",e),rn=Array.isArray(e)?h(e):rn},getQueuePoints:function(){return console.log("%c Getting SGAI Queue Points ","background: #bdf369; color: #000",rn),h(rn)}}),dn=new Map;function cn(e,n){return vn.apply(this,arguments)}function vn(){return vn=n(t.mark((function e(o,r){var l,a,u,s,d,c,v,f,p,m,I,y,E,T,b,w,S,_,O,A,L,P;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:P=function(e,n,t,r,l,a){var u=i(o);if(!u.seeking()){n.startTimeInSeconds,n.durationInSeconds,Math.floor(u.currentTime());var s,d=Ke(t);try{var c=function(){var t,i,d,c=s.value,v=c.eventType,f=c.beaconUrls,p=c.startTimeInSeconds,m=c.startTime,g=c.durationInSeconds,I=p||0,h=f,y=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(d=i.ads)||void 0===d?void 0:d.adEventHandler)||null,E="".concat(I,"_").concat(v),T=dn.get("pod-".concat(l))||[];if(console.warn(e,I,"map:",v,"condition1:",e>=I,"map:",dn),e>=I&&!T.includes(E)){T.push(E),dn.set("pod-".concat(l),T);try{L(v,n,h,u)}catch(e){console.error("Error when calling triggerAdBeacon:",e,v,n)}if("breakEnd"==v){var b=Ze.position;Ze.set(null),setTimeout((function(){null!=b&&(u.currentTime(b),a())}),500)}if("function"==typeof y)try{var w,S={eventType:v,startTimeInSeconds:p,startTime:m,durationInSeconds:g,ad:null==n||null===(w=n.ads)||void 0===w?void 0:w[r],adIndex:r};y({adsData:S}),Be(o,S)}catch(e){console.error("Error when calling ads callback:",e)}var _=Qe.get();if(_){var O=_||{},A=O.formulateComscoreAdPayload,P=O.startComscoreAdTracking,D=O.finishComscoreAdTracking,k=O.endComscoreAdTracking;if("impression"===v){var C,j=$e.get();P(A(qe(qe({},null==n||null===(C=n.ads)||void 0===C?void 0:C[r]),{},{trackingUrl:j})))}else"complete"===v?D():"breakEnd"===v&&k()}}};for(d.s();!(s=d.n()).done;)c()}catch(e){d.e(e)}finally{d.f()}}},L=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)}))}))},A=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},dn.clear(),Ze.set(r),p=$e.get(),(m=i(o)).one("loadeddata",(function(){p&&O(p)})),I=new Map,y=new Map,E=-1,T=(null===(l=document)||void 0===l||null===(a=l.getElementsByClassName("tvProviderImage"))||void 0===a?void 0:a[0])||null,b=(null==m||null===(u=m.controlBar)||void 0===u?void 0:u.getChild("videoSelector"))||null,w=(null==m||null===(s=m.controlBar)||void 0===s?void 0:s.getChild("seriesV2"))||null,S=(null==m||null===(d=m.el())||void 0===d||null===(c=d.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===c?void 0:c[0])||null,_=(null==m||null===(v=m.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.mark((function e(n){var l,a,u,s,d,c,v,f,p,m,O,L,D,k,C,j,R,V,N,F;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return j=function(e){document.removeEventListener("pointermove",C),document.removeEventListener("pointerup",j),0===e.button&&D()},C=function(e){},k=function(){var e,n=m.currentTime(),t=null,o=Ke(p);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=(r.ads,Math.floor(i+l));n>=i&&n<=a&&(t=a,I.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout((function(){m.currentTime(t+2.2)}),100))},D=function(){var e,n=m.currentTime(),t=null,o=Ke(p);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=r.ads,u=Math.floor(i+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>u||n>i)&&!I.has(i)||n>=i&&n<=u)&&(t=i,I.set(i,!0),y.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout((function(){m.currentTime(t+.4)}),100))},d=!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,p=[],m=i(o),O=m.controlBar.progressControl,L=O.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,o,r;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(d=!0),p.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:(null==e||null===(o=e.adBreakTrackingEvents)||void 0===o||null===(r=o.filter((function(e){return"breakStart"==(null==e?void 0:e.eventType)})))||void 0===r?void 0:r[0])||[]})})),!d&&r&&(m.currentTime(r),k()),null!=p&&p.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",p),window.adsQueueList=p),console.log(p,"data"),p.forEach((function(e){var n=e.markerPositionInSeconds,t=e.ads,o=m.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",L.appendChild(i)}})),m._timeUpdateHandler&&m.off("timeupdate",m._timeUpdateHandler),m._timeUpdateHandler=g((function(){var e=m.currentTime();if(e!==E){E=e;for(var n=!1,t=function(){var t=p[o],r=t.startTimeInSeconds,i=t.durationInSeconds,l=t.ads,a=r+i;if(e>=r-1.2&&e<=a+1.2){e>=r&&e<=a&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n=!0),e>a&&I.set(r,!0),ke.disable(),T&&T.classList.add("vjs-hidden"),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),w&&(w.el().style.pointerEvents="none",w.el().classList.add("vjs-hidden")),O.el().classList.add("hide-progress-bar");for(var u=e-r,s=0,d=0,c=0;c<l.length;c++){var v,f=null==l||null===(v=l[c])||void 0===v?void 0:v.durationInSeconds;if(u<s+f){d=c;break}s+=f}l[d];var m=Math.max(0,i-u),g=Math.round(m);R.style.display="block",F.textContent="".concat(d+1," of ").concat(l.length," • ").concat(A(g));var E=[];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)}));E.push.apply(E,h(n))})),Array.isArray(l)&&0==(null==l?void 0:l.length)&&E.push(null==t?void 0:t.podSlotImpressionBeacon),P(e,t,E,d,o,k),"break"}y.delete(r)},o=0;o<p.length;o++){if("break"===t())break}n||(R.style.display="none",O.el().classList.remove("hide-progress-bar"),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),w&&(w.el().style.pointerEvents="auto",w.el().classList.remove("vjs-hidden")),T&&T.classList.remove("vjs-hidden"),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),ke.enable())}}),1e3),m.on("timeupdate",m._timeUpdateHandler),null===(a=document)||void 0===a||a.addEventListener("keydown",(function(e){ke.enabled&&"ArrowRight"==e.key&&(D(),_n(o,10),e.stopPropagation())})),O.el().addEventListener("pointerdown",(function(e){0===e.button&&(document.addEventListener("pointermove",C),document.addEventListener("pointerup",j))})),null===(u=document)||void 0===u||null===(s=u.querySelectorAll(".ssai-ad-container"))||void 0===s||s.forEach((function(e){return null==e?void 0:e.remove()})),(R=document.createElement("div")).className="ssai-ad-container",(V=document.createElement("div")).className="sponsored-adbox",(N=document.createElement("div")).className="sponsored-text",N.textContent="Sponsored Ad",V.append(N),(F=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",R.append(V),R.append(F),m.el().appendChild(R);case 45:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();case 18:case"end":return e.stop()}}),e)}))),vn.apply(this,arguments)}function fn(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,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}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 i,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,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}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 mn(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 gn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?mn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):mn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var In={},hn=(null===(ln=window)||void 0===ln||null===(an=ln.location)||void 0===an||null===(un=an.search)||void 0===un?void 0:un.includes("debug=true"))||!1,yn=null;function En(e){return Tn.apply(this,arguments)}function Tn(){return Tn=n(t.mark((function e(o){var r,l,a,u,s,d,c,v,f,p,m,I,y,E,T,b,w,S,_,O,A,L,P,D,k,C,j;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:j=function(e,n,t,r,l){var a=i(o);if(!a.seeking()){var u=n.startTimeInSeconds;n.durationInSeconds,Math.floor(a.currentTime());var s,d=fn(t);try{for(d.s();!(s=d.n()).done;){var c,v,f,p=s.value,m=p.eventType,g=p.beaconUrls,I=p.startTimeInSeconds,h=p.startTime,y=p.durationInSeconds,E=p.eventId,T=I||0,b=g,w=(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(f=v.ads)||void 0===f?void 0:f.adEventHandler)||null,S="".concat(E,"_").concat(m),_="pod-".concat(u);D.has(_)||D.set(_,new Set);var O=D.get(_);if(hn&&console.warn(e,T,"map:",m,"condition1:",e>=T,"map:",D),e>=T&&e<=T+k&&!O.has(S)){O.add(S);try{C(m,n,b,a)}catch(e){console.error("Error when calling triggerAdBeacon:",e,m,n)}if("function"==typeof w)try{var A,L={eventType:m,startTimeInSeconds:I,startTime:h,durationInSeconds:y,ad:null==n||null===(A=n.ads)||void 0===A?void 0:A[r],adIndex:r};w({adsData:L}),Be(o,L)}catch(e){console.error("Error when calling ads callback:",e)}}}}catch(e){d.e(e)}finally{d.f()}}},C=function(e,n,t,o){var r,i;"breakEnd"===e&&(null===(r=In)||void 0===r?void 0:r.currentAdIndex)+1!=(null===(i=In)||void 0===i?void 0:i.totalAds)||(hn&&(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)}))})))},m=function(){yn&&clearInterval(yn)},f=$e.get(),(p=i(o)).one("loadeddata",(function(){m(),yn=setInterval((function(){f&&!p.paused()&&P(f)}),2e3)})),p.on("dispose",(function(){m()})),I=new Map,y=new Map,E=-1,T=null,b=(null===(r=document)||void 0===r||null===(l=r.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,w=(null==p||null===(a=p.controlBar)||void 0===a?void 0:a.getChild("videoSelector"))||null,S=(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===(d=s.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===d?void 0:d[0])||null,O=(null==p||null===(c=p.el())||void 0===c||null===(v=c.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===v?void 0:v[0])||null,A=!1,L=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 h(o);var r=[],i=null==o?void 0:o.find((function(e){return"breakEnd"===(null==e?void 0:e.eventType)})),l=(null==i||null===(e=i.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],u=null==a||null===(n=a.trackingEvents)||void 0===n?void 0:n.filter((function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)})),s=(null==u?void 0:u.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(!s&&l){var d=null==u?void 0:u.map((function(e){return gn(gn({},e),{},{eventType:"videoView",beaconUrls:[l]})}));null!=d&&d[0]&&r.push(null==d?void 0:d[0])}return r},P=function(){var e=n(t.mark((function e(n){var r,l,a,u,s,d,c,v,f,p;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=new URL(n),T&&l.searchParams.append("nextToken",T),e.next=4,fetch(l.toString(),{method:"GET"});case 4:return a=e.sent,e.next=7,a.json();case 7:u=e.sent,s=u.avails,d=u.nextToken||null,T=d,c=[],v=i(o),f=v.controlBar.progressControl,p=f.seekBar.el(),null===(r=document)||void 0===r||r.querySelectorAll(".vjs-seekbar-marker").forEach((function(e){return null==e?void 0:e.remove()})),s.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:L(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})})),hn&&console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",c),null!=c&&c.length&&(window.adsQueueList=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 r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",p.appendChild(i)}})),v._timeUpdateHandler&&v.off("timeupdate",v._timeUpdateHandler),v._timeUpdateHandler=g((function(){var e=v.currentTime();if(e!==E){E=e;for(var n=function(){var n=c[t],o=n.startTimeInSeconds,r=n.durationInSeconds,i=n.ads,l=o+r;if(e>=o-1.2&&e<=l+1.2){var a;A=!!(e>=o&&e<=l&&Array.isArray(i)&&(null==i?void 0:i.length)>0),e>l&&I.set(o,!0),ke.disable(),b&&b.classList.add("vjs-hidden"),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),O&&(O.style.pointerEvents="none",O.classList.add("vjs-hidden")),w&&(w.el().style.pointerEvents="none",w.el().classList.add("vjs-hidden")),S&&(S.el().style.pointerEvents="none",S.el().classList.add("vjs-hidden")),f.el().classList.add("hide-progress-bar");for(var u=e-o,s=0,d=0,v=0;v<i.length;v++){var p,m=null==i||null===(p=i[v])||void 0===p?void 0:p.durationInSeconds;if(u<s+m){d=v;break}s+=m}setTimeout((function(){In.totalAds=null==i?void 0:i.length,In.currentAdIndex=d}),1e3);var g=[];return null==i||i.forEach((function(e){var n=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)}));g.push.apply(g,h(n))})),(null==n||null===(a=n.podSlotImpressionBeacon)||void 0===a?void 0:a.length)>0&&g.push.apply(g,h(null==n?void 0:n.podSlotImpressionBeacon)),j(e,n,g,d),"break"}y.delete(o)},t=0;t<c.length;t++){if("break"===n())break}A||(In={},f.el().classList.remove("hide-progress-bar"),w&&(w.el().style.pointerEvents="auto",w.el().classList.remove("vjs-hidden")),S&&(S.el().style.pointerEvents="auto",S.el().classList.remove("vjs-hidden")),b&&b.classList.remove("vjs-hidden"),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),O&&(O.style.pointerEvents="auto",O.classList.remove("vjs-hidden")),ke.enable())}}),1e3),v.on("timeupdate",v._timeUpdateHandler);case 23:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),D=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 wn=function(e){o(e).play()},Sn=function(e){o(e).pause()},_n=function(e,n){var t=o(e),r=t.currentTime()+n;t.currentTime(r)},On=function(e,n){var t=o(e),r=t.currentTime(),i=r<=n?0:r-n;t.currentTime(i)},An=function(e){return!!o.getPlayer("".concat(e))},Ln=function(e){return o(e).paused()},Pn=function(){var e=n(t.mark((function e(o,r){var l,a,u,s=arguments;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=s.length>2&&void 0!==s[2]&&s[2],e.next=3,Y();case 3:return a=e.sent,u=i(o),e.abrupt("return",new Promise((function(e,i){var s=(null==r?void 0:r.programs)||[];null==r||delete r.programs,R(r,a).then(function(){var i=n(t.mark((function n(i){var a,d,v,p,m,g,I,h;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(g=null==i?void 0:i.data,window.sid=Z(),g.contentType="linearchannel",g.channelId=null==r?void 0:r.channelId,I=(null==g||null===(a=g.linearchannel)||void 0===a?void 0:a.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(d=window)||void 0===d||null===(v=d.app_data)||void 0===v||null===(p=v.appcmsMain)||void 0===p||null===(m=p.adsConfig)||void 0===m?void 0:m.vodAdSticherProvider)||!1,h=ye(g,o),!I){n.next=11;break}return n.next=9,en(o,g);case 9:h=n.sent,l=!0;case 11:c(g),f(s),sessionStorage.setItem("program_switched",!0),h&&l?(Rn(o,h),I&&En(o),u.on("loadstart",(function(){e({status:!0,msg:"Feed authenticated and loaded",response:g})}))):e({status:!0,msg:"Feed authenticated",response:g});case 15:case"end":return n.stop()}}),n)})));return function(e){return i.apply(this,arguments)}}()).catch((function(e){i({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)}}(),Dn=function(){var e=n(t.mark((function e(o,r,l){var a,u,d,f,g,I,h;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Y();case 2:return f=e.sent,(s()||null)&&v(r),g=0,I=0,h=null,null!==(a=window)&&void 0!==a&&a.watchHistory&&null!==(u=window)&&void 0!==u&&null!==(d=u.watchHistory)&&void 0!==d&&d.enable&&F(r,f).then((function(e){var n,t,o,r,i,l,a;(null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),g=(null==e||null===(i=e.data)||void 0===i?void 0:i.watchedTime)||null,(I=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null)<95)&&(h=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedTime)||null)})).catch((function(e){var n,t,o,r;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(e))})),e.abrupt("return",new Promise((function(e,l){j(r,f).then(function(){var r=n(t.mark((function n(r){var a,u,s,d,v,f,y,E,T,b,w,S,_,O,A,L,P,D,k,C,j,R,V,N,F,W,U,B,M,x,H,G,Q,Y,z,q,K,X;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(L=null==r?void 0:r.data,P=(null==L?void 0:L.contentType)||"video",D=(null==L||null===(a=L[P])||void 0===a?void 0:a.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(u=window)||void 0===u||null===(s=u.app_data)||void 0===s||null===(d=s.appcmsMain)||void 0===d||null===(v=d.adsConfig)||void 0===v?void 0:v.vodAdSticherProvider)||!1,k=(null==L||null===(f=L.video)||void 0===f||null===(y=f.streamingInfo)||void 0===y?void 0:y.isLiveStream)||!1,c(r.data),(C=(null==L||null===(E=L.ads)||void 0===E||null===(T=E.preRoll)||void 0===T||null===(b=T.adTags)||void 0===b||null===(w=b.web)||void 0===w?void 0:w.active)&&(null==L||null===(S=L.ads)||void 0===S||null===(_=S.preRoll)||void 0===_||null===(O=_.adTags)||void 0===O||null===(A=O.web)||void 0===A?void 0:A.url))&&Le(o,C,L),j=ye(L,o),!D){n.next=12;break}return n.next=11,en(o,L);case 11:j=n.sent;case 12:j?(G=(null==L||null===(R=L.video)||void 0===R||null===(V=R.gist)||void 0===V?void 0:V.videoImageUrl)||(null==L||null===(N=L.video)||void 0===N||null===(F=N.gist)||void 0===F||null===(W=F.imageGist)||void 0===W?void 0:W.r16x9),(Q=i(o)).poster(G),Rn(o,j),D&&cn(o,h),Q.on("loadstart",(function(){k&&e({status:!0,msg:"Video Loaded",response:L})})),Q.on("loadeddata",(function(){Oe(),e({status:!0,msg:"Video Loaded",response:L})})),Q.one("play",(function(){g&&!D&&I<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==L||null===(U=L.video)||void 0===U||null===(B=U.contentDetails)||void 0===B||null===(M=B.closedCaptions)||void 0===M?void 0:M.length)>0||(null==L||null===(x=L.video)||void 0===x||null===(H=x.closedCaptions)||void 0===H?void 0:H.length)>0?(X=(null==L||null===(z=L.video)||void 0===z||null===(q=z.contentDetails)||void 0===q?void 0:q.closedCaptions)||(null==L||null===(K=L.video)||void 0===K?void 0:K.closedCaptions),Y=X.filter((function(e){return"VTT"===e.format})),p(o,Y)):m(o)):(_e(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 r.apply(this,arguments)}}()).catch((function(e){Vn(e,o,l,r)}))})));case 10:case"end":return e.stop()}}),e)})));return function(n,t,o){return e.apply(this,arguments)}}(),kn=function(e,n,t){var o=i(e);return o.src(n),new Promise((function(e,n){var r=0;o.one("loadedmetadata",(function(){clearTimeout(r),e({status:!0,msg:"video loaded"})})),o.one("loadstart",(function(e){r=setTimeout((function(){n("FAILED: Took too long to load")}),t)}))}))},Cn=function(e){var n=(Qe.get()||{}).destroyComscoreTag,t=i(e);if(jn(),"function"==typeof n&&n(),I(),window.onresize=null,t)t.dispose();else{var o=document.getElementById(e);o&&o.remove()}},jn=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()},Rn=function(e,n){var t=i(e);t&&t.src(n)},Vn=function(n,t,o,r){var i,l,a,u,s,d,c=null==n||null===(i=n.response)||void 0===i||null===(l=i.data)||void 0===l?void 0:l.errorCode,v=(null==n||null===(a=n.response)||void 0===a||null===(u=a.data)||void 0===u?void 0:u.errorMessage)||(null==n?void 0:n.message);An(t)&&_e(t,(null===(s=window)||void 0===s?void 0:s.customErrors)&&(null===(d=window)||void 0===d?void 0:d.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)},r&&{videoId:r}))},Nn=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 r=n.getElementsByClassName("vjs-fullscreen-control")[0];r&&(r.style.display="none")},Fn=function(e){var n,t=i(e);return!(null!=t&&null!==(n=t.liveTracker)&&void 0!==n&&n.atLiveEdge())||null};export{wn as A,Sn as B,On as C,An as D,Dn as E,Pn as F,Cn as G,B as H,sn as I,Me as J,Fn as K,U as L,z as M,H as N,M as O,_ as P,dn as Q,Pe as R,ue as S,Ln as T,En as U,cn as V,W,ce as a,de as b,Qe as c,ae as d,ye as e,Oe as f,ee as g,_e as h,Ye as i,Nn as j,le as k,Rn as l,Le as m,Se as n,en as o,q as p,j as q,F as r,N as s,Vn as t,Y as u,R as v,V as w,se as x,kn as y,_n as z};
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 r from"axios";import{g as i}from"./player_instance-34118a5b.js";import l from"js-cookie";import{a,e as u,g as s,h as d,s as c,i as v,d as f}from"./currentVideoInfo-a8a254c2.js";import{a as p,r as m}from"./captions-f507e8ee.js";import{t as g,c as I}from"./skin-d5091b86.js";import h from"@babel/runtime/helpers/toConsumableArray";import y from"@babel/runtime/helpers/slicedToArray";import{destroyComscoreTag as E,formulateComscorePayload as T,createComscoreStreamingTag as b,setComscorePlayerInstance as w}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 _(e){window.dataLayer=window.dataLayer||[],S("js",new Date),S("config",e)}function O(e,n){S("event",e,n)}var A={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 D={name:"@viewlift/player",version:"2.0.61",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":"^0.0.4",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"}};window.vl_player_version=D.version;var k,C=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==A?void 0:A.getVideoDetails)},j=function(e,n){var t,o,i,l;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})})):r({url:C(),params:P({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(i=window)||void 0===i||null===(l=i.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":D.version,"x-player-name":"videojs"},withCredentials:!0})},R=function(e,n){var t,o,i,l;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})})):r({url:U.get()+A.getLinearChannelDetails,params:P(P(P(P(P({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web"},(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===(i=window)||void 0===i||null===(l=i.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},V=function(e,n){var t,o,i=q(n),l=(null==i?void 0:i.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})})):r({url:U.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:n}})},N=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,Y();case 2:return o=e.sent,e.abrupt("return",r({url:U.get()+"".concat(null==A?void 0:A.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)}}(),F=function(e,n){var t,o,i=window.contentType;return r({method:"GET",url:U.get()+"".concat(null==A?void 0:A.getVideoInfoV2,"/").concat(i,"/").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})},W=function(e){var n=e.videoId;return r({method:"GET",url:U.get()+"".concat(null==A?void 0:A.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},U=(k=null==A?void 0:A.apiBaseUrl,{set:function(e){e&&(k=e)},get:function(){return k}}),B=function(e,n,t,o){return r({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},withCredentials:!0})},M=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},x=null;function H(){return{set:function(e){e&&(x=e)},get:function(){return x}}}var G=function(){var e=n(t.mark((function e(){var n,o,i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=H().get(),o=U.get(),e.prev=2,e.next=5,r({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return i=e.sent,e.abrupt("return",i);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)}}(),Q=null,Y=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"))||!M(n)){e.next=6;break}return Q||(Q=G().then((function(e){var t,o,r=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,i=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return r&&sessionStorage.setItem("vlp_token",r),i&&H().set(i),r||n})).catch((function(e){return console.error("Error fetching refresh token",e),n})).finally((function(){Q=null}))),e.abrupt("return",Q);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),z=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},q=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))};function K(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 X(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?K(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):K(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var J=100,$=function(){var e,n,t,o,r,i,l,u=a();return"linearchannel"===((null==u?void 0:u.contentType)||"video")?null==u||null===(e=u.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==u?void 0:u.channelId)})))||void 0===t||null===(o=t.content)||void 0===o?void 0:o.id:(null==u||null===(r=u.video)||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.id)||(null==u||null===(l=u.video)||void 0===l?void 0:l.id)||(null==u?void 0:u.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(){var e=window.sessionStorage.getItem("uid");return e||(e=Z(),window.sessionStorage.setItem("uid",e),e)}function ne(){return te.apply(this,arguments)}function te(){return(te=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,Y();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 oe(e){return e?String(e):""}var re=function(e){return function(){try{return e.apply(void 0,arguments)}catch(e){return console.error(e),null}}};function ie(e,o){var l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=Z(),s="production",d="WEBSITE",c=null,v=0,f=null,p=0,m=0,g=!1,I=[],h=i(e);if(h){var y=function(){var e,n,t,o;return Math.round((null==h||null===(e=h.tech_)||void 0===e||null===(n=e.vhs)||void 0===n||null===(t=n.selectPlaylist())||void 0===t||null===(o=t.attributes)||void 0===o?void 0:o.BANDWIDTH)/1e3)},E=re((function(){for(var e=h.currentTime(),n=h.buffered(),t=0;t<n.length;t++){var o=n.start(t),r=n.end(t);if(e>=o&&e<=r)return Math.round(r-e)}return 0})),T=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},b=function(){var e=n(t.mark((function e(n){var o,i,a,c,v,f,p,m,g,I,h,y;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Y();case 2:return I=e.sent,h=q(I),e.t0=X,e.t1=X,e.t2=null==h?void 0:h.site,e.t3=null==h?void 0:h.siteId,e.t4=d,e.t5=ee(),e.t6=$(),e.t7=n.url||document.location.href,e.t8=n.ref||document.referrer,e.t9=n.eventName,e.t10=null!==(o=n.videoPosition)&&void 0!==o?o:null,e.t11=s,e.t12=n.dp1||"",e.t13=n.dp2||"",e.t14=n.dp3||"",e.t15=n.dp4||"",e.t16=n.dp5||"",e.t17=n.isAdEvent?n.videoPosition:null,e.t18=n.isAdEvent?oe(n.adPosition):"",e.next=25,ne();case 25:e.t19=e.sent,e.t20=n.playerType||"videojs",e.t21=n.mediaType||"VIDEO",e.t22=u,e.t23=null!==(i=n.ttFirstFrame)&&void 0!==i?i:null,e.t24=null!==(a=n.bitrate)&&void 0!==a?a:null,e.t25=null!==(c=n.resHeight)&&void 0!==c?c:null,e.t26=null!==(v=n.resWidth)&&void 0!==v?v:null,e.t27=null!==(f=n.bufferHealth)&&void 0!==f?f:null,e.t28=null!==(p=T())&&void 0!==p?p:null,e.t29=siteName,e.t30={aid:e.t2,cid:e.t3,pfm:e.t4,uid:e.t5,vid:e.t6,url:e.t7,ref:e.t8,pa:e.t9,vpos:e.t10,environment:e.t11,dp1:e.t12,dp2:e.t13,dp3:e.t14,dp4:e.t15,dp5:e.t16,apos:e.t17,apod:e.t18,profid:e.t19,player:e.t20,media_type:e.t21,stream_id:e.t22,embedurl:"",ttfirstframe:e.t23,bitrate:e.t24,connectionspeed:null,resolutionheight:e.t25,resolutionwidth:e.t26,bufferhealth:e.t27,networkname:e.t28,brandname:e.t29},e.t31=(null==n?void 0:n.duration)&&{duration:n.duration},e.t32=(0,e.t1)(e.t30,e.t31),e.t33=null==l||null===(m=l.beacon)||void 0===m?void 0:m.params,e.t34=(0,e.t0)(e.t32,e.t33),y=[e.t34],r({url:(null==l||null===(g=l.beacon)||void 0===g?void 0:g.url)||U.get()+A.getBeaconUrl,method:"post",headers:{Authorization:I},contentType:"application/x-www-form-urlencoded",dataType:"text",data:y}).catch((function(e){return console.error(e)}));case 43:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),w=function(e){if(!h.paused()&&h.readyState()>2)return clearInterval(c),clearInterval(f),e;var n,t=e+.1;return+t.toFixed(2)>=5&&m<4&&g?(m++,O("BUFFERING",X({pfm:d,uid:ee(),vid:$(),videoPosition:Math.floor(h.currentTime)},null==l||null===(n=l.beacon)||void 0===n?void 0:n.params)),b({eventName:"BUFFERING",videoPosition:Math.floor(h.currentTime),isAdEvent:!1}),0):t},S=function(){var e=Math.floor(h.currentTime);h.on("error",(function(){var n,t=Math.floor(h.currentTime);clearInterval(c);var o=e===t?"FAILED_TO_START":"DROPPED_STREAM";O(o,X({pfm:d,uid:ee(),vid:$(),videoPosition:t},null==l||null===(n=l.beacon)||void 0===n?void 0:n.params)),b({eventName:o,videoPosition:t,isAdEvent:!1})}))},_=function(){var e=re((function(){var e;v=0,f=setInterval((function(){v=w(v)}),J),O("PLAY",X({pfm:d,uid:ee(),vid:$(),videoPosition:Math.floor(h.currentTime)},null==l||null===(e=l.beacon)||void 0===e?void 0:e.params)),b({eventName:"PLAY",videoPosition:Math.floor(h.currentTime),isAdEvent:!1}),o&&o("started_video_playback",{"Video ID":$(),watchTime:Math.floor(h.currentTime)})}));h.one("play",e)},L=function(){h.one("timeupdate",(function(){var e;clearInterval(f),clearInterval(c),p=v||0,O("FIRST_FRAME",X({pfm:d,uid:ee(),vid:$(),videoPosition:Math.floor(h.currentTime),ttFirstFrame:v,bufferHealth:E()},null==l||null===(e=l.beacon)||void 0===e?void 0:e.params)),b({eventName:"FIRST_FRAME",videoPosition:Math.floor(h.currentTime),isAdEvent:!1,ttFirstFrame:v,bufferHealth:E()}),g=!0,v=0}))},P=function(){var e=!1;h.on("waiting",re((function(){g&&(e=!0,clearInterval(c),c=setInterval((function(){e&&!h.paused()?p=w(p):clearInterval(c)}),J))}))),h.on("playing",re((function(){e=!1,clearInterval(c)})))},D=function(){var e=function(e){var n,t,o,r=X({videoPosition:Math.floor(h.currentTime),isAdEvent:!0,bufferHealth:E(),pfm:d,uid:ee(),vid:$(),resHeight:(null===(n=videoElement)||void 0===n?void 0:n.videoHeight)||null,resWidth:(null===(t=videoElement)||void 0===t?void 0:t.videoWidth)||null},null==l||null===(o=l.beacon)||void 0===o?void 0:o.params);O(e,X({},r)),b(X({eventName:e,adPosition:1},r))};h.on("adstart",(function(){e("AD_REQUEST"),e("AD_IMPRESSION")})),h.on("adskip",(function(){v=0})),h.on("adend",(function(){v=0}))},k=function(){h.on("timeupdate",(function(){var e=Math.floor(h.currentTime());if(e>=30&&e%30==0&&!I.includes(e)){var n,t=null===(n=h.el().getElementsByTagName("video"))||void 0===n?void 0:n[0];m=0,I.push(e),b({eventName:"PING",videoPosition:e,isAdEvent:!1,duration:30,resHeight:(null==t?void 0:t.videoHeight)||null,resWidth:(null==t?void 0:t.videoWidth)||null,bufferHealth:E(),bitrate:y()})}}))};S(),P(),D(),k(),_(),h.on("loadeddata",L)}else console.error("Videojs: Player instance not found.")}function le(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"localhost"!==location.hostname&&"127.0.0.1"!==location.hostname&&ie(e,n,t)}var ae=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;W({videoId:e,token:n}).then((function(e){e.data.map((function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),d(t)})).catch((function(e){return console.log(e)}))},de=function(){var e=u.get();return e>=0?e+1:1},ce=function(){var e,n,t,o=s(),r=a(),i=null==r||null===(e=r.video)||void 0===e?void 0:e.id,l=u.get(),d=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)===i}));return d>=0?d+1:1};function ve(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 fe(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ve(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):ve(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"},me=function(e){var n=ge(e,"video.tags",[]),t=ge(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map((function(e){return e.title})).join(","):t},ge=function(e,n,t){for(var o=0,r=(n=n.split(".")).length;o<r;o++){var i;e=null===(i=e)||void 0===i?void 0:i[n[o]]}return e||t},Ie=function(){var n,t,o,r,a,u,s,d,c,v,f,p,m,g,I,h,y,E,T,b,w,S,_,O,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",L=arguments.length>1?arguments[1]:void 0,P=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 D=(null==P?void 0:P.siteName)||"",k=(null==P?void 0:P.contentType)||"video",C=(null==P||null===(o=P[k])||void 0===o?void 0:o.metadata)||(null==P||null===(r=P[k])||void 0===r||null===(a=r.gist)||void 0===a?void 0:a.metadata),j=i(L);if(!A.includes("VIEWLIFT_"))return A;var R,V=window.getComputedStyle(document.getElementById(L),null),N=Math.trunc(V.getPropertyValue("height").slice(0,-2)),F=Math.trunc(V.getPropertyValue("width").slice(0,-2)),W="linearchannel"===k?null==P||null===(u=P.linearchannel)||void 0===u||null===(s=u.channels)||void 0===s||null===(d=s.find((function(e){return(null==e?void 0:e.id)===(null==P?void 0:P.channelId)})))||void 0===d||null===(c=d.content)||void 0===c?void 0:c.id:ge(P,"video.gist.id",""),U="linearchannel"===k?null==P||null===(v=P.linearchannel)||void 0===v||null===(f=v.channels)||void 0===f||null===(p=f.find((function(e){return(null==e?void 0:e.id)===(null==P?void 0:P.channelId)})))||void 0===p?void 0:p.title:ge(P,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),B=null,M=null;"function"==typeof window.__gpp&&(null===(R=window)||void 0===R||R.__gpp("ping",(function(e){B=null==e?void 0:e.gppString,M=null==e?void 0:e.sectionList[0]})));var x=fe(fe({},he(C)),{},(S={VIEWLIFT_WIDTH:F,VIEWLIFT_HEIGHT:N,VIEWLIFT_SIZE:pe(F,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===(m=window)||void 0===m?void 0:m.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:ge(P,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:ge(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:ge(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==j||null===(g=j.options_)||void 0===g?void 0:g.autoplay)||1,VIEWLIFT_MUTE:(null==j||null===(I=j.options_)||void 0===I?void 0:I.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==D||"usanetwork"==D?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:me(P),VIEWLIFT_MEDIA_ID:W,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(ge(P,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:W,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+ge(P,"video.gist.permalink","")),VIEWLIFT_CONSENT:l.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:ge(null===(h=window)||void 0===h||null===(y=h.app_data)||void 0===y||null===(E=y.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"==D||"usanetwork"==D?"":ge(null===(T=window)||void 0===T||null===(b=T.app_data)||void 0===b||null===(w=b.site)||void 0===w?void 0:w.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*ge(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:ge(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:W,VIEWLIFT_CONTENT_TITLE:U,VIEWLIFT_CONTENT_SERIES_TITLE:ge(P,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:ge(P,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ce(),VIEWLIFT_SEASON_NUMBER:de(),VIEWLIFT_CONTENT_TAGS:me(P),VIEWLIFT_GPP_SID:M||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:B||"VIEWLIFT_GPP",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:"",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},e(S,"VIEWLIFT_LAT",""),e(S,"VIEWLIFT_APP_BUNDLE",""),e(S,"VIEWLIFT_ATT_CONSENT",""),S),null===(_=window)||void 0===_||null===(O=_.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},he=function(e){var n,t,o,r,i,l,a={},u=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map((function(e){u.set(e.name,e.value)})));var s=(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,d=(null===(r=window)||void 0===r||null===(i=r.customData)||void 0===i||null===(l=i.subscription)||void 0===l?void 0:l.TVE)||!1;return s||d?(ue()?s?a=fe(fe({},a),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||""}):d&&(a=fe(fe({},a),{},{VIEWLIFT_CSID:u.get("csid.mweb.tve")||""})):s?a=fe(fe({},a),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||""}):d&&(a=fe(fe({},a),{},{VIEWLIFT_CSID:u.get("csid.web.tve")||""})),s?a=fe(fe({},a),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||u.get("sfid.web.dtc")||""}):d&&(a=fe(fe({},a),{},{VIEWLIFT_SFID:u.get("sfid.tve")||u.get("sfid.web.tve")||""})),a=ue()?fe(fe({},a),{},{VIEWLIFT_PROF:u.get("prof.mweb")||""}):fe(fe({},a),{},{VIEWLIFT_PROF:u.get("prof.web")||""})):(a=fe(fe({},a),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||u.get("sfid.web.dtc")||""}),a=ue()?fe(fe({},a),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:u.get("prof.mweb")||""}):fe(fe({},a),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||"",VIEWLIFT_PROF:u.get("prof.web")||""})),a=fe(fe({},a),{},{VIEWLIFT_AFID:u.get("afid"),VIEWLIFT_NIELSEN_APP_ID:u.get("VIEWLIFT_NIELSEN_APP_ID")||"VIEWLIFT_NIELSEN_APP_ID",VIEWLIFT_CHANNEL:u.get("VIEWLIFT_CHANNEL")||"VIEWLIFT_CHANNEL",VIEWLIFT_GRACE_NOTE_ID:u.get("VIEWLIFT_GRACE_NOTE_ID")||"VIEWLIFT_GRACE_NOTE_ID"})},ye=function(e,n){var t,o,r,i,l,a,u,s,d,c,v,f,p,m=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[m])||void 0===t?void 0:t.drmEnabled,I=null==e||null===(o=e[m])||void 0===o||null===(r=o.streamingInfo)||void 0===r?void 0:r.videoAssets,h=null==e||null===(i=e[m])||void 0===i||null===(l=i.streamingInfo)||void 0===l?void 0:l.audioAssets,y=(null==e||null===(a=e[m])||void 0===a||null===(u=a.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(d=e[m])||void 0===d||null===(c=d.liveDetails)||void 0===c||c.isDvrEnabled;var E=(null==e||null===(v=e[m])||void 0===v||null===(f=v.streamingInfo)||void 0===f||null===(p=f.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=h&&h.hls)return Te(h);if(g){var T=be(I,n);return T.src=Ie(T.src,n,e),T}if("Safari"!==ae()&&E)return Ee(I);if(y){var b=Te(I);return b.src=Ie(b.src,n,e),b}if(null!=I&&I.mpeg){var w=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(I);return w.src=Ie(w.src,n,e),w}return null},Ee=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,r=e.fairPlayCmaf||e.fairPlay,l=e.widevine,a=e.playReady,u=ae();if(i(n),"Safari"===u){var s=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var r={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(r,(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,r,i){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:r,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(l,(function(e,n,t){console.log(e),e&&i(e),i(null,t)}))}}}}}(r);return we(n),s}var d,c={src:l.url,type:"application/dash+xml"};return"caliente"==(null===(d=window)||void 0===d?void 0:d.siteName)?(we(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 we=function(e){var n=i(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==ae()&&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 r=t.split(".com")[1]||"";return{src:r?"".concat(n).concat(r):t,type:o}},_e=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 r=document.createElement("div");r.className="error-container";var i=document.createElement("div");i.className="error-message",i.innerHTML="".concat(n),r.appendChild(i),o.append(r)}}},Oe=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var Ae=!1,Le=function(e,n,t){var o=Ie(n,e,t),r=i(e);if(n&&window.google){if("function"!=typeof r.ima)return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,n){var t,o,r,l=i(e);if(null!==l.el_){Ae=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),Ae&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout((function(){l.ima.setContentWithAdTag(null,n,!0),l.ima.requestAds()}),1e3));var u=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&u.hasAttribute("controls")&&u.removeAttribute("controls");var s="click",d=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(d=!0,s="touchend"),l.one(s,(function(){d&&l.ima.initializeAdDisplayContainer()}));var c=(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(r=o.ads)||void 0===r?void 0:r.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,r,l=i(e),a=null==l||null===(t=l.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,u=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",(function(t){var o,r,i,s,d,c,v,f,p;if(ke.enabled&&"input"!=t.target.localName){var m=t.key,g=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(m)&&(t.preventDefault(),null==u||u.focus()),m){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||On(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(r=window)||void 0===r||null===(i=r.app_data)||void 0===i||null===(s=i.appcmsMain)||void 0===s||null===(d=s.adsConfig)||void 0===d?void 0:d.vodAdSticherProvider)&&null!==(c=window)&&void 0!==c&&null!==(v=c.app_data)&&void 0!==v&&null!==(f=v.appcmsMain)&&void 0!==f&&null!==(p=f.adsConfig)&&void 0!==p&&p.vodAdClientSideTracking)return;g||_n(e,10)}}}),!0)}var De,ke=(De=!0,{enable:function(){De=!0},disable:function(){De=!1},get enabled(){return De}}),Ce="ssai-breakStart",je="ssai-adImpression",Re="ssai-firstQuartile",Ve="ssai-midpoint",Ne="ssai-thirdQuartile",Fe="ssai-complete",We="ssai-breakEnd",Ue={breakStart:Ce,impression:je,firstQuartile:Re,midpoint:Ve,thirdQuartile:Ne,complete:Fe,breakEnd:We};function Be(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=i(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var o=n.eventType,r=Ue[o];r&&t.trigger(r,n)}function Me(e){var n=i(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(Ce,e)},adImpression:function(e){return t(je,e)},adFirstQuartile:function(e){return t(Re,e)},adMidpoint:function(e){return t(Ve,e)},adThirdQuartile:function(e){return t(Ne,e)},adComplete:function(e){return t(Fe,e)},adBreakEnd:function(e){return t(We,e)}}}function xe(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 He(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?xe(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):xe(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Ge,Qe=(Ge=null,{get:function(){return Ge},set:function(e){Ge=e}});function Ye(e,n){var t,o,r,l,u,s,d,c,v,f,p,m,g=null==e?void 0:e.playerId,I=i(g),h=null==n?void 0:n.siteName;if(null!=e&&null!==(t=e.comscore)&&void 0!==t&&t.enable){var y=a(),S=(null==y||null===(o=y.video)||void 0===o?void 0:o.metadata)||[],_=(null==S?void 0:S.length)&&S.filter((function(e){return"advertisingGenre"===e.name}));if(null!==(r=_)&&void 0!==r&&r.length){var O=_.map((function(e){return e.value}));_=null==O?void 0:O.join(",")}E();var A,L,P,D=null===(l=window)||void 0===l?void 0:l.lcProgrammeDetails,k=Array.isArray(null==D?void 0:D.category)?null==D||null===(u=D.category)||void 0===u?void 0:u.join(","):(null==D?void 0:D.category)||null,C=He(He(He({},null==y?void 0:y.video),null==y?void 0:y.linearchannel),{},{siteName:h,programId:(null==D?void 0:D.videotmsid)||null,programTitle:(null==D?void 0:D.lcProgrammeName)||null,episodeId:(null==D?void 0:D.videotmsid)||null,seasonNumber:(null==D||null===(s=D.seriesDetails)||void 0===s?void 0:s.season)||null,episodeNumber:(null==D||null===(d=D.seriesDetails)||void 0===d?void 0:d.episode)||null,isCompleteEpisode:!!(null!=y&&null!==(c=y.video)&&void 0!==c&&c.series||null!=D&&null!==(v=D.seriesDetails)&&void 0!==v&&v.episode),genre:_||k,comscoreConfig:{implementationId:(null==e||null===(f=e.comscore)||void 0===f?void 0:f.implementationId)||null,projectId:(null==e||null===(p=e.comscore)||void 0===p?void 0:p.projectId)||null}});if(null!=C&&null!==(m=C.streamingInfo)&&void 0!==m&&m.isLiveStream&&(C.contentType="LIVE"),null==C||!C.network){var j,R=(null==C?void 0:C.metadata)||[],V=null==R||null===(j=R.find((function(e){return"network"===e.name})))||void 0===j?void 0:j.value;C.network=V||null}null!=C&&C.network&&null!=C&&C.genre&&(C.customGenre="".concat(C.network,"_").concat((null==C?void 0:C.programTitle)||(A=C,null!=A&&A.series?null==A||null===(P=A.series)||void 0===P?void 0:P.title:null==A||null===(L=A.gist)||void 0===L?void 0:L.title),"_").concat(C.genre)),null!=D&&D.airDate&&(C.publishDate=D.airDate);var N=T(C,I);console.log("comscoreOptions player data",N),b(He({playerName:"Video.js"},N)),w(I)}}function ze(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 qe(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ze(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):ze(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}function Ke(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 Xe(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)?Xe(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}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 i,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,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function Xe(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 Je,$e=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),Ze=(Je=null,{set:function(e){Je=e},get position(){return Je}});function en(e,n){return nn.apply(this,arguments)}function nn(){return(nn=n(t.mark((function e(n,o){var r,l,a,u,s,d,c,v,f,p,m,g,I,h,E,T,b,w;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i(n),a=ye(o,n),u=a.src,s=(null==o?void 0:o.contentType)||"video",null==o||null===(r=o[s])||void 0===r||null===(l=r.streamingInfo)||void 0===l||l.isLiveStream,d=u.replace("/dash/","/session/").replace("/master/","/session/"),d=Ie(d,n,o),c=on(d),v=y(c,2),f=v[0],p=v[1],m=tn(p)||{},d=new URL(d.split("?")[0]),Object.keys(p).length>0&&Object.entries(p).forEach((function(e){var n=y(e,2),t=n[0],o=n[1];d.searchParams.set(t,o)})),e.prev=11,e.next=14,fetch(d,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(qe({adsParams:qe({},f)},m))});case 14:return g=e.sent,e.next=17,g.json();case 17:return I=e.sent,h="https://"+new URL(d).hostname,E=I.trackingUrl,T=I.manifestUrl,b=h+E,w=h+T,$e.set(b),console.log("%c TRACKING URL","background: #bdf369; color: #000",b),a.src=w,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 tn(e){var n;return Object.fromEntries(null==Object||null===(n=Object.entries(e))||void 0===n?void 0:n.map((function(e){var n=y(e,2),t=n[0],o=n[1];return[null==t?void 0:t.replace(/^aws\./,""),String(o)]})))||{}}function on(e){var n={};if(!e.split("?")[1])return[{},{}];var t,o=new URL(e,window.location.origin),r=Ke((null==o?void 0:o.searchParams)||[]);try{for(r.s();!(t=r.n()).done;){var i=y(t.value,2),l=i[0],a=i[1];n[decodeURIComponent(l)]=decodeURIComponent(a||"")}}catch(e){r.e(e)}finally{r.f()}for(var u={},s={},d=0,c=Object.entries(n);d<c.length;d++){var v=y(c[d],2),f=v[0],p=v[1];if(f.startsWith("ads."))u[f.replace(/^ads\./,"")]=p;else s[f]=p}return[u,s]}var rn,ln,an,un,sn=(rn=[],{setQueuePoints:function(e){console.log("%c Setting SGAI Queue Points ","background: #bdf369; color: #000",e),rn=Array.isArray(e)?h(e):rn},getQueuePoints:function(){return console.log("%c Getting SGAI Queue Points ","background: #bdf369; color: #000",rn),h(rn)}}),dn=new Map;function cn(e,n){return vn.apply(this,arguments)}function vn(){return vn=n(t.mark((function e(o,r){var l,a,u,s,d,c,v,f,p,m,I,y,E,T,b,w,S,_,O,A,L,P;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:P=function(e,n,t,r,l,a){var u=i(o);if(!u.seeking()){n.startTimeInSeconds,n.durationInSeconds,Math.floor(u.currentTime());var s,d=Ke(t);try{var c=function(){var t,i,d,c=s.value,v=c.eventType,f=c.beaconUrls,p=c.startTimeInSeconds,m=c.startTime,g=c.durationInSeconds,I=p||0,h=f,y=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(d=i.ads)||void 0===d?void 0:d.adEventHandler)||null,E="".concat(I,"_").concat(v),T=dn.get("pod-".concat(l))||[];if(console.warn(e,I,"map:",v,"condition1:",e>=I,"map:",dn),e>=I&&!T.includes(E)){T.push(E),dn.set("pod-".concat(l),T);try{L(v,n,h,u)}catch(e){console.error("Error when calling triggerAdBeacon:",e,v,n)}if("breakEnd"==v){var b=Ze.position;Ze.set(null),setTimeout((function(){null!=b&&(u.currentTime(b),a())}),500)}if("function"==typeof y)try{var w,S={eventType:v,startTimeInSeconds:p,startTime:m,durationInSeconds:g,ad:null==n||null===(w=n.ads)||void 0===w?void 0:w[r],adIndex:r};y({adsData:S}),Be(o,S)}catch(e){console.error("Error when calling ads callback:",e)}var _=Qe.get();if(_){var O=_||{},A=O.formulateComscoreAdPayload,P=O.startComscoreAdTracking,D=O.finishComscoreAdTracking,k=O.endComscoreAdTracking;if("impression"===v){var C,j=$e.get();P(A(qe(qe({},null==n||null===(C=n.ads)||void 0===C?void 0:C[r]),{},{trackingUrl:j})))}else"complete"===v?D():"breakEnd"===v&&k()}}};for(d.s();!(s=d.n()).done;)c()}catch(e){d.e(e)}finally{d.f()}}},L=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)}))}))},A=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},dn.clear(),Ze.set(r),p=$e.get(),(m=i(o)).one("loadeddata",(function(){p&&O(p)})),I=new Map,y=new Map,E=-1,T=(null===(l=document)||void 0===l||null===(a=l.getElementsByClassName("tvProviderImage"))||void 0===a?void 0:a[0])||null,b=(null==m||null===(u=m.controlBar)||void 0===u?void 0:u.getChild("videoSelector"))||null,w=(null==m||null===(s=m.controlBar)||void 0===s?void 0:s.getChild("seriesV2"))||null,S=(null==m||null===(d=m.el())||void 0===d||null===(c=d.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===c?void 0:c[0])||null,_=(null==m||null===(v=m.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.mark((function e(n){var l,a,u,s,d,c,v,f,p,m,O,L,D,k,C,j,R,V,N,F;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return j=function(e){document.removeEventListener("pointermove",C),document.removeEventListener("pointerup",j),0===e.button&&D()},C=function(e){},k=function(){var e,n=m.currentTime(),t=null,o=Ke(p);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=(r.ads,Math.floor(i+l));n>=i&&n<=a&&(t=a,I.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout((function(){m.currentTime(t+2.2)}),100))},D=function(){var e,n=m.currentTime(),t=null,o=Ke(p);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=r.ads,u=Math.floor(i+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>u||n>i)&&!I.has(i)||n>=i&&n<=u)&&(t=i,I.set(i,!0),y.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout((function(){m.currentTime(t+.4)}),100))},d=!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,p=[],m=i(o),O=m.controlBar.progressControl,L=O.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,o,r;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(d=!0),p.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:(null==e||null===(o=e.adBreakTrackingEvents)||void 0===o||null===(r=o.filter((function(e){return"breakStart"==(null==e?void 0:e.eventType)})))||void 0===r?void 0:r[0])||[]})})),!d&&r&&(m.currentTime(r),k()),null!=p&&p.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",p),window.adsQueueList=p),console.log(p,"data"),p.forEach((function(e){var n=e.markerPositionInSeconds,t=e.ads,o=m.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",L.appendChild(i)}})),m._timeUpdateHandler&&m.off("timeupdate",m._timeUpdateHandler),m._timeUpdateHandler=g((function(){var e=m.currentTime();if(e!==E){E=e;for(var n=!1,t=function(){var t=p[o],r=t.startTimeInSeconds,i=t.durationInSeconds,l=t.ads,a=r+i;if(e>=r-1.2&&e<=a+1.2){e>=r&&e<=a&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n=!0),e>a&&I.set(r,!0),ke.disable(),T&&T.classList.add("vjs-hidden"),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),w&&(w.el().style.pointerEvents="none",w.el().classList.add("vjs-hidden")),O.el().classList.add("hide-progress-bar");for(var u=e-r,s=0,d=0,c=0;c<l.length;c++){var v,f=null==l||null===(v=l[c])||void 0===v?void 0:v.durationInSeconds;if(u<s+f){d=c;break}s+=f}l[d];var m=Math.max(0,i-u),g=Math.round(m);R.style.display="block",F.textContent="".concat(d+1," of ").concat(l.length," • ").concat(A(g));var E=[];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)}));E.push.apply(E,h(n))})),Array.isArray(l)&&0==(null==l?void 0:l.length)&&E.push(null==t?void 0:t.podSlotImpressionBeacon),P(e,t,E,d,o,k),"break"}y.delete(r)},o=0;o<p.length;o++){if("break"===t())break}n||(R.style.display="none",O.el().classList.remove("hide-progress-bar"),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),w&&(w.el().style.pointerEvents="auto",w.el().classList.remove("vjs-hidden")),T&&T.classList.remove("vjs-hidden"),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),ke.enable())}}),1e3),m.on("timeupdate",m._timeUpdateHandler),null===(a=document)||void 0===a||a.addEventListener("keydown",(function(e){ke.enabled&&"ArrowRight"==e.key&&(D(),_n(o,10),e.stopPropagation())})),O.el().addEventListener("pointerdown",(function(e){0===e.button&&(document.addEventListener("pointermove",C),document.addEventListener("pointerup",j))})),null===(u=document)||void 0===u||null===(s=u.querySelectorAll(".ssai-ad-container"))||void 0===s||s.forEach((function(e){return null==e?void 0:e.remove()})),(R=document.createElement("div")).className="ssai-ad-container",(V=document.createElement("div")).className="sponsored-adbox",(N=document.createElement("div")).className="sponsored-text",N.textContent="Sponsored Ad",V.append(N),(F=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",R.append(V),R.append(F),m.el().appendChild(R);case 45:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();case 18:case"end":return e.stop()}}),e)}))),vn.apply(this,arguments)}function fn(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,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}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 i,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,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}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 mn(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 gn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?mn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):mn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var In={},hn=(null===(ln=window)||void 0===ln||null===(an=ln.location)||void 0===an||null===(un=an.search)||void 0===un?void 0:un.includes("debug=true"))||!1,yn=null;function En(e){return Tn.apply(this,arguments)}function Tn(){return Tn=n(t.mark((function e(o){var r,l,a,u,s,d,c,v,f,p,m,I,y,E,T,b,w,S,_,O,A,L,P,D,k,C,j;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:j=function(e,n,t,r,l){var a,u,s=null==n||null===(a=n.ads)||void 0===a||null===(u=a[r])||void 0===u?void 0:u.adId,d=i(o);if(!d.seeking()){var c=n.startTimeInSeconds;n.durationInSeconds,Math.floor(d.currentTime());var v,f=fn(t);try{for(f.s();!(v=f.n()).done;){var p,m,g,I=v.value,h=I.eventType,y=I.beaconUrls,E=I.startTimeInSeconds,T=I.startTime,b=I.durationInSeconds,w=(I.eventId,E||0),S=y,_=(null===(p=window)||void 0===p||null===(m=p.customData)||void 0===m||null===(g=m.ads)||void 0===g?void 0:g.adEventHandler)||null,O="".concat(s,"_").concat(h),A="pod-".concat(c);D.has(A)||D.set(A,new Set);var L=D.get(A);if(hn&&console.warn(e,w,"map:",h,"condition1:",e>=w,"map:",D),e>=w&&e<=w+k&&!L.has(O)){L.add(O);try{C(h,n,S,d)}catch(e){console.error("Error when calling triggerAdBeacon:",e,h,n)}if("function"==typeof _)try{var P,j={eventType:h,startTimeInSeconds:E,startTime:T,durationInSeconds:b,ad:null==n||null===(P=n.ads)||void 0===P?void 0:P[r],adIndex:r};_({adsData:j}),Be(o,j)}catch(e){console.error("Error when calling ads callback:",e)}}}}catch(e){f.e(e)}finally{f.f()}}},C=function(e,n,t,o){var r,i;"breakEnd"===e&&(null===(r=In)||void 0===r?void 0:r.currentAdIndex)+1!=(null===(i=In)||void 0===i?void 0:i.totalAds)||(hn&&(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)}))})))},m=function(){yn&&clearInterval(yn)},f=$e.get(),(p=i(o)).one("loadeddata",(function(){m(),yn=setInterval((function(){f&&!p.paused()&&P(f)}),2e3)})),p.on("dispose",(function(){m()})),I=new Map,y=new Map,E=-1,T=null,b=(null===(r=document)||void 0===r||null===(l=r.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,w=(null==p||null===(a=p.controlBar)||void 0===a?void 0:a.getChild("videoSelector"))||null,S=(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===(d=s.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===d?void 0:d[0])||null,O=(null==p||null===(c=p.el())||void 0===c||null===(v=c.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===v?void 0:v[0])||null,A=!1,L=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 h(o);var r=[],i=null==o?void 0:o.find((function(e){return"breakEnd"===(null==e?void 0:e.eventType)})),l=(null==i||null===(e=i.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],u=null==a||null===(n=a.trackingEvents)||void 0===n?void 0:n.filter((function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)})),s=(null==u?void 0:u.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(!s&&l){var d=null==u?void 0:u.map((function(e){return gn(gn({},e),{},{eventType:"videoView",beaconUrls:[l]})}));null!=d&&d[0]&&r.push(null==d?void 0:d[0])}return r},P=function(){var e=n(t.mark((function e(n){var r,l,a,u,s,d,c,v,f,p;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=new URL(n),T&&l.searchParams.append("nextToken",T),e.next=4,fetch(l.toString(),{method:"GET"});case 4:return a=e.sent,e.next=7,a.json();case 7:u=e.sent,s=u.avails,d=u.nextToken||null,T=d,c=[],v=i(o),f=v.controlBar.progressControl,p=f.seekBar.el(),null===(r=document)||void 0===r||r.querySelectorAll(".vjs-seekbar-marker").forEach((function(e){return null==e?void 0:e.remove()})),s.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:L(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})})),hn&&console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",c),null!=c&&c.length&&(window.adsQueueList=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 r=n/o*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(r,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(r,"%"),i.style.pointerEvents="none",p.appendChild(i)}})),v._timeUpdateHandler&&v.off("timeupdate",v._timeUpdateHandler),v._timeUpdateHandler=g((function(){var e=v.currentTime();if(e!==E){E=e;for(var n=function(){var n=c[t],o=n.startTimeInSeconds,r=n.durationInSeconds,i=n.ads,l=o+r;if(e>=o-1.2&&e<=l+1.2){var a;A=!!(e>=o&&e<=l&&Array.isArray(i)&&(null==i?void 0:i.length)>0),e>l&&I.set(o,!0),ke.disable(),b&&b.classList.add("vjs-hidden"),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),O&&(O.style.pointerEvents="none",O.classList.add("vjs-hidden")),w&&(w.el().style.pointerEvents="none",w.el().classList.add("vjs-hidden")),S&&(S.el().style.pointerEvents="none",S.el().classList.add("vjs-hidden")),f.el().classList.add("hide-progress-bar");for(var u=e-o,s=0,d=0,v=0;v<i.length;v++){var p,m=null==i||null===(p=i[v])||void 0===p?void 0:p.durationInSeconds;if(u<s+m){d=v;break}s+=m}setTimeout((function(){In.totalAds=null==i?void 0:i.length,In.currentAdIndex=d}),1e3);var g=[];return null==i||i.forEach((function(e){var n=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)}));g.push.apply(g,h(n))})),(null==n||null===(a=n.podSlotImpressionBeacon)||void 0===a?void 0:a.length)>0&&g.push.apply(g,h(null==n?void 0:n.podSlotImpressionBeacon)),j(e,n,g,d),"break"}y.delete(o)},t=0;t<c.length;t++){if("break"===n())break}A||(In={},f.el().classList.remove("hide-progress-bar"),w&&(w.el().style.pointerEvents="auto",w.el().classList.remove("vjs-hidden")),S&&(S.el().style.pointerEvents="auto",S.el().classList.remove("vjs-hidden")),b&&b.classList.remove("vjs-hidden"),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),O&&(O.style.pointerEvents="auto",O.classList.remove("vjs-hidden")),ke.enable())}}),1e3),v.on("timeupdate",v._timeUpdateHandler);case 23:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),D=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 wn=function(e){o(e).play()},Sn=function(e){o(e).pause()},_n=function(e,n){var t=o(e),r=t.currentTime()+n;t.currentTime(r)},On=function(e,n){var t=o(e),r=t.currentTime(),i=r<=n?0:r-n;t.currentTime(i)},An=function(e){return!!o.getPlayer("".concat(e))},Ln=function(e){return o(e).paused()},Pn=function(){var e=n(t.mark((function e(o,r){var l,a,u,s=arguments;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=s.length>2&&void 0!==s[2]&&s[2],e.next=3,Y();case 3:return a=e.sent,u=i(o),e.abrupt("return",new Promise((function(e,i){var s=(null==r?void 0:r.programs)||[];null==r||delete r.programs,R(r,a).then(function(){var i=n(t.mark((function n(i){var a,d,v,p,m,g,I,h;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(g=null==i?void 0:i.data,window.sid=Z(),g.contentType="linearchannel",g.channelId=null==r?void 0:r.channelId,I=(null==g||null===(a=g.linearchannel)||void 0===a?void 0:a.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(d=window)||void 0===d||null===(v=d.app_data)||void 0===v||null===(p=v.appcmsMain)||void 0===p||null===(m=p.adsConfig)||void 0===m?void 0:m.vodAdSticherProvider)||!1,h=ye(g,o),!I){n.next=11;break}return n.next=9,en(o,g);case 9:h=n.sent,l=!0;case 11:c(g),f(s),sessionStorage.setItem("program_switched",!0),h&&l?(Rn(o,h),I&&En(o),u.on("loadstart",(function(){e({status:!0,msg:"Feed authenticated and loaded",response:g})}))):e({status:!0,msg:"Feed authenticated",response:g});case 15:case"end":return n.stop()}}),n)})));return function(e){return i.apply(this,arguments)}}()).catch((function(e){i({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)}}(),Dn=function(){var e=n(t.mark((function e(o,r,l){var a,u,d,f,g,I,h;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Y();case 2:return f=e.sent,(s()||null)&&v(r),g=0,I=0,h=null,null!==(a=window)&&void 0!==a&&a.watchHistory&&null!==(u=window)&&void 0!==u&&null!==(d=u.watchHistory)&&void 0!==d&&d.enable&&F(r,f).then((function(e){var n,t,o,r,i,l,a;(null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),g=(null==e||null===(i=e.data)||void 0===i?void 0:i.watchedTime)||null,(I=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null)<95)&&(h=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedTime)||null)})).catch((function(e){var n,t,o,r;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(e))})),e.abrupt("return",new Promise((function(e,l){j(r,f).then(function(){var r=n(t.mark((function n(r){var a,u,s,d,v,f,y,E,T,b,w,S,_,O,A,L,P,D,k,C,j,R,V,N,F,W,U,B,M,x,H,G,Q,Y,z,q,K,X;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(L=null==r?void 0:r.data,P=(null==L?void 0:L.contentType)||"video",D=(null==L||null===(a=L[P])||void 0===a?void 0:a.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(u=window)||void 0===u||null===(s=u.app_data)||void 0===s||null===(d=s.appcmsMain)||void 0===d||null===(v=d.adsConfig)||void 0===v?void 0:v.vodAdSticherProvider)||!1,k=(null==L||null===(f=L.video)||void 0===f||null===(y=f.streamingInfo)||void 0===y?void 0:y.isLiveStream)||!1,c(r.data),(C=(null==L||null===(E=L.ads)||void 0===E||null===(T=E.preRoll)||void 0===T||null===(b=T.adTags)||void 0===b||null===(w=b.web)||void 0===w?void 0:w.active)&&(null==L||null===(S=L.ads)||void 0===S||null===(_=S.preRoll)||void 0===_||null===(O=_.adTags)||void 0===O||null===(A=O.web)||void 0===A?void 0:A.url))&&Le(o,C,L),j=ye(L,o),!D){n.next=12;break}return n.next=11,en(o,L);case 11:j=n.sent;case 12:j?(G=(null==L||null===(R=L.video)||void 0===R||null===(V=R.gist)||void 0===V?void 0:V.videoImageUrl)||(null==L||null===(N=L.video)||void 0===N||null===(F=N.gist)||void 0===F||null===(W=F.imageGist)||void 0===W?void 0:W.r16x9),(Q=i(o)).poster(G),Rn(o,j),D&&cn(o,h),Q.on("loadstart",(function(){k&&e({status:!0,msg:"Video Loaded",response:L})})),Q.on("loadeddata",(function(){Oe(),e({status:!0,msg:"Video Loaded",response:L})})),Q.one("play",(function(){g&&!D&&I<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==L||null===(U=L.video)||void 0===U||null===(B=U.contentDetails)||void 0===B||null===(M=B.closedCaptions)||void 0===M?void 0:M.length)>0||(null==L||null===(x=L.video)||void 0===x||null===(H=x.closedCaptions)||void 0===H?void 0:H.length)>0?(X=(null==L||null===(z=L.video)||void 0===z||null===(q=z.contentDetails)||void 0===q?void 0:q.closedCaptions)||(null==L||null===(K=L.video)||void 0===K?void 0:K.closedCaptions),Y=X.filter((function(e){return"VTT"===e.format})),p(o,Y)):m(o)):(_e(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 r.apply(this,arguments)}}()).catch((function(e){Vn(e,o,l,r)}))})));case 10:case"end":return e.stop()}}),e)})));return function(n,t,o){return e.apply(this,arguments)}}(),kn=function(e,n,t){var o=i(e);return o.src(n),new Promise((function(e,n){var r=0;o.one("loadedmetadata",(function(){clearTimeout(r),e({status:!0,msg:"video loaded"})})),o.one("loadstart",(function(e){r=setTimeout((function(){n("FAILED: Took too long to load")}),t)}))}))},Cn=function(e){var n=(Qe.get()||{}).destroyComscoreTag,t=i(e);if(jn(),"function"==typeof n&&n(),I(),window.onresize=null,t)t.dispose();else{var o=document.getElementById(e);o&&o.remove()}},jn=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()},Rn=function(e,n){var t=i(e);t&&t.src(n)},Vn=function(n,t,o,r){var i,l,a,u,s,d,c=null==n||null===(i=n.response)||void 0===i||null===(l=i.data)||void 0===l?void 0:l.errorCode,v=(null==n||null===(a=n.response)||void 0===a||null===(u=a.data)||void 0===u?void 0:u.errorMessage)||(null==n?void 0:n.message);An(t)&&_e(t,(null===(s=window)||void 0===s?void 0:s.customErrors)&&(null===(d=window)||void 0===d?void 0:d.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)},r&&{videoId:r}))},Nn=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 r=n.getElementsByClassName("vjs-fullscreen-control")[0];r&&(r.style.display="none")},Fn=function(e){var n,t=i(e);return!(null!=t&&null!==(n=t.liveTracker)&&void 0!==n&&n.atLiveEdge())||null};export{wn as A,Sn as B,On as C,An as D,Dn as E,Pn as F,Cn as G,B as H,sn as I,Me as J,Fn as K,U as L,z as M,H as N,M as O,_ as P,dn as Q,Pe as R,ue as S,Ln as T,En as U,cn as V,W,ce as a,de as b,Qe as c,ae as d,ye as e,Oe as f,ee as g,_e as h,Ye as i,Nn as j,le as k,Rn as l,Le as m,Se as n,en as o,q as p,j as q,F as r,N as s,Vn as t,Y as u,R as v,V as w,se as x,kn as y,_n as z};