@viewlift/player-backup 2.0.199-backup → 2.0.200-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.
- package/cjs/{autoNextVideo-6e29e59a.js → autoNextVideo-a10c4797.js} +1 -1
- package/cjs/bundle.css +832 -832
- package/cjs/{features-abe26ef4.js → features-5c9d7665.js} +1 -1
- package/cjs/generic-6b6ff7a7.js +1 -0
- package/cjs/{index-6399ed67.js → index-8fecb085.js} +1 -1
- package/cjs/{index-0b5fbaca.js → index-dfe6d734.js} +1 -1
- package/cjs/{index-a16fe490.js → index-f53862fe.js} +1 -1
- package/cjs/index.js +1 -1
- package/cjs/{multicamv2-00217a93.js → multicamv2-f27ecf0a.js} +1 -1
- package/cjs/{multicamv2-4072a0c2.js → multicamv2-f512d3fc.js} +1 -1
- package/cjs/{nextEpisodeButton-8b363f14.js → nextEpisodeButton-34a544d9.js} +1 -1
- package/cjs/{playlist-a7f104dc.js → playlist-f71a44b0.js} +1 -1
- package/cjs/{series-a02e9dd9.js → series-1659da52.js} +1 -1
- package/cjs/{series-v2-fe0d9e73.js → series-v2-317f07ec.js} +1 -1
- package/cjs/{series-v2-11990e5c.js → series-v2-d0ad1a65.js} +1 -1
- package/cjs/{skin-33bf00fa.js → skin-0d3ac32d.js} +1 -1
- package/cjs/{skin-296a9bde.js → skin-43f75fd5.js} +1 -1
- package/cjs/{skin-207d9d41.js → skin-a7db5cc3.js} +1 -1
- package/cjs/{skin-d3c717b0.js → skin-d1fd17f5.js} +1 -1
- package/cjs/{skin-8637eb47.js → skin-dcec0b88.js} +1 -1
- package/cjs/{skin-9d310bde.js → skin-e80fa829.js} +1 -1
- package/cjs/{skin-624fd6d7.js → skin-eca48b86.js} +1 -1
- package/cjs/{skin-20eff0f7.js → skin-ef24cd98.js} +1 -1
- package/cjs/{skin-898e9504.js → skin-f3fe196e.js} +1 -1
- package/cjs/{util-7c2a99c7.js → util-ac4cdcec.js} +1 -1
- package/cjs/{videoSelector-cee60d3b.js → videoSelector-6730a581.js} +1 -1
- package/cjs/{videoSelector-e7fb8b91.js → videoSelector-a7f86d3b.js} +1 -1
- package/esm/{autoNextVideo-15ea7a03.js → autoNextVideo-d65c3fbf.js} +1 -1
- package/esm/bundle.css +832 -832
- package/esm/{features-0d93cbe9.js → features-0fa9b0fa.js} +1 -1
- package/esm/generic-e9c5dc1a.js +1 -0
- package/esm/{index-a222d776.js → index-1539e2eb.js} +1 -1
- package/esm/{index-2ea768e5.js → index-4ca3b369.js} +1 -1
- package/esm/{index-e15f2d3e.js → index-b0c406e3.js} +1 -1
- package/esm/index.js +1 -1
- package/esm/{multicamv2-d87c0312.js → multicamv2-ee7df020.js} +1 -1
- package/esm/{multicamv2-82f86463.js → multicamv2-fe57bd1b.js} +1 -1
- package/esm/{nextEpisodeButton-a1f41584.js → nextEpisodeButton-358ce60a.js} +1 -1
- package/esm/{playlist-d6bee6ef.js → playlist-d162ca2c.js} +1 -1
- package/esm/{series-42022340.js → series-94696244.js} +1 -1
- package/esm/{series-v2-f5561e01.js → series-v2-554df39b.js} +1 -1
- package/esm/{series-v2-9ea6042b.js → series-v2-80d8fb79.js} +1 -1
- package/esm/{skin-4e18f35a.js → skin-026e23a0.js} +1 -1
- package/esm/{skin-9744a0d3.js → skin-02ed9ac3.js} +1 -1
- package/esm/{skin-666d6980.js → skin-06d132a7.js} +1 -1
- package/esm/{skin-c4d191e0.js → skin-9bc879d8.js} +1 -1
- package/esm/{skin-9f02bf7d.js → skin-aa258d30.js} +1 -1
- package/esm/{skin-ec60bb2b.js → skin-c39cc7a4.js} +1 -1
- package/esm/{skin-782d32ed.js → skin-d235a2ec.js} +1 -1
- package/esm/{skin-cf37c5d3.js → skin-e4e26727.js} +1 -1
- package/esm/{skin-1da01397.js → skin-e79cdff2.js} +1 -1
- package/esm/{util-f1ba608f.js → util-0d462277.js} +1 -1
- package/esm/{videoSelector-491d6638.js → videoSelector-3c5cfc2b.js} +1 -1
- package/esm/{videoSelector-7a846998.js → videoSelector-514837cc.js} +1 -1
- package/package.json +1 -1
- package/cjs/generic-97f0a1d3.js +0 -1
- package/esm/generic-505b51e9.js +0 -1
package/esm/generic-505b51e9.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import o from"video.js";import r from"axios";import{g as i}from"./player_instance-34118a5b.js";import l from"js-cookie";import{a,e as d,g as u,h as s,s as c,i as v,d as m}from"./currentVideoInfo-0b234e55.js";import{a as f,r as p}from"./captions-78bd2908.js";import g from"@babel/runtime/helpers/typeof";import{t as h,c as w}from"./skin-65765793.js";import I from"@babel/runtime/helpers/toConsumableArray";import y from"@babel/runtime/helpers/slicedToArray";import{destroyComscoreTag as E,formulateComscorePayload as T,createComscoreStreamingTag as b,setComscorePlayerInstance as S}from"@viewlift/comscore/index.js";function _(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function O(e){window.dataLayer=window.dataLayer||[],_("js",new Date),_("config",e)}function A(e,n){_("event",e,n)}var D={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"};function L(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function P(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?L(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):L(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var k={name:"@viewlift/player",version:"2.1.9",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.5",axios:"^1.2.3",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"},overrides:{"min-document":"^2.19.1"}};window.vl_player_version=k.version;var F,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==D?void 0:D.getVideoDetails)},R=function(e,n){var t,o,i,l,a,d,u=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})}):r({url:C(),params:P({id:e,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:u},null===(i=window)||void 0===i||null===(l=i.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":k.version,"x-player-name":"videojs",adbTempToken:null===(a=window)||void 0===a||null===(d=a.customData)||void 0===d?void 0:d.adbTempToken},withCredentials:!0})},j=function(e,n){var t,o,i,l,a,d,u=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})}):r({url:U.get()+D.getLinearChannelDetails,params:P(P(P(P(P({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:u},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(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",adbTempToken:null===(a=window)||void 0===a||null===(d=a.customData)||void 0===d?void 0:d.adbTempToken}})},N=function(e,n){var t,o,i=K(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}})},V=function(){var e=n(t.mark(function e(n){var o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z();case 2:return o=e.sent,e.abrupt("return",r({url:U.get()+"".concat(null==D?void 0:D.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:P({},n),params:P({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),W=function(e,n){var t,o,i=window.contentType;return r({method:"GET",url:U.get()+"".concat(null==D?void 0:D.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})},B=function(e){var n=e.videoId;return r({method:"GET",url:U.get()+"".concat(null==D?void 0:D.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},U=(F=null==D?void 0:D.apiBaseUrl,{set:function(e){e&&(F=e)},get:function(){return F}}),M=function(e,n,t,o){var i,l;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,adbTempToken:null===(i=window)||void 0===i||null===(l=i.customData)||void 0===l?void 0:l.adbTempToken},withCredentials:!0})},x=function(e){var n=JSON.parse(atob(null==e?void 0:e.split(".")[1])),t=null==n?void 0:n.exp;if(new Date(1e3*t).getTime()<(new Date).getTime())return!0},H=null;function G(){return{set:function(e){e&&(H=e)},get:function(){return H}}}var Q=function(){var e=n(t.mark(function e(){var n,o,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=G().get(),o=U.get(),e.prev=2,e.next=5,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)}}(),Y=null,z=function(){var e=n(t.mark(function e(){var n;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!x(n)){e.next=6;break}return Y||(Y=Q().then(function(e){var t,o,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&&G().set(i),r||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){Y=null})),e.abrupt("return",Y);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),q=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,o=null==e?void 0:e.asat;return t&&!o&&(n=!1),n},K=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))};function X(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function J(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?X(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):X(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var $=function(){var e,n,t,o,r,i,l,d=a();return"linearchannel"===((null==d?void 0:d.contentType)||"video")?null==d||null===(e=d.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find(function(e){return(null==e?void 0:e.id)===(null==d?void 0:d.channelId)}))||void 0===t||null===(o=t.content)||void 0===o?void 0:o.id:(null==d||null===(r=d.video)||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.id)||(null==d||null===(l=d.video)||void 0===l?void 0:l.id)||(null==d?void 0:d.id)};function Z(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return"".concat(e()).concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e()).concat(e()).concat(e())}function ee(){return ne.apply(this,arguments)}function ne(){return(ne=n(t.mark(function e(){var n,o,r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z();case 2:if(n=e.sent,o=K(n),!(r=null==o?void 0:o.userId)){e.next=9;break}return e.abrupt("return",r);case 9:return r=Z(),window.sessionStorage.setItem("uid",r),e.abrupt("return",r);case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}function te(){return oe.apply(this,arguments)}function oe(){return(oe=n(t.mark(function e(){var n,o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z();case 2:if(!(n=e.sent)){e.next=6;break}return o=JSON.parse(atob(n.split(".")[1])),e.abrupt("return",null!=o&&o.anonymousId?"guest-user":null==o?void 0:o.userId);case 6:return e.abrupt("return","guest-user");case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function re(e){return e?String(e):""}window.initialise=function(e){window.sid=Z(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var n=Math.floor(e.currentTime());e.on("error",function(){var t,o,r,i=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,A(i?"FAILED_TO_START":"DROPPED_STREAM",J({pfm:window.platform,uid:ee(),vid:$(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(r=o.beacon)||void 0===r?void 0:r.params)),fireEvent({eventName:n===i?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})},window.firstFrame=function(e,n){e.one("play",tryCatch(function(){var t,o,r;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),A("PLAY",J({pfm:window.platform,uid:ee(),vid:$(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(r=o.beacon)||void 0===r?void 0:r.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),n&&n("started_video_playback",{"Video ID":$(),watchTime:Math.floor(e.currentTime())})}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:clearInterval(window.bufferingTimer)},100))}))},window.handleBufferTimer=function(e,n){var t,o;if(n.el_){var r,i,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(o=t.className)&&void 0!==o&&o.includes("vjs-waiting")&&bufferingFireCount<4)bufferingFireCount++,A("BUFFERING",J({pfm:window.platform,uid:ee(),vid:$(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(r=window)||void 0===r||null===(i=r.customData)||void 0===i||null===(l=i.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var n,t,o;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,A("FIRST_FRAME",J({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ee(),vid:$()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})})},window.ads=function(e){e.on("adsready",function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,function(){var n,t,o,r,i,l;A("AD_REQUEST",J({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ee(),vid:$(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),A("AD_IMPRESSION",J({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ee(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:$()},null===(r=window)||void 0===r||null===(i=r.customData)||void 0===i||null===(l=i.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})},window.ping=function(e){var n=[];e.on("timeupdate",function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!n.includes(t)&&(bufferingFireCount=0,n.push(t),fireEvent({eventName:"PING",videoPosition:t,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var n=e.currentTime(),t=e.duration(),o=e.buffered(),r=0;r<o.length;r++){var i=o.start(r),l=o.end(r);if(ie(n,i,l)){var a=Math.round(t-l);if(isFinite(a))return a}}})()};var ie=function(e,n,t){return e>=n&&e<=t},le=function(){var e,n=a(),t=(null==n?void 0:n.contentType)||"video";return(null==n||null===(e=n[t])||void 0===e?void 0:e.network)||null};function ae(e,n){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var t=i(e);window.initialise(t,n),window.firstFrame(t,n),t.on("loadedmetadata",function(){window.endFirstFrame(t)})}}window.fireEvent=function(){var e=n(t.mark(function e(n){var o,i,l,a,d,u,s,c,v,m,f,p,g,h,w,I,y,E,T,b,S;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z();case 2:return y=e.sent,E=K(y),T=null==E?void 0:E.site,b=null==E?void 0:E.siteId,e.t0=J,e.t1=J,e.t2=J({aid:T,cid:b,pfm:window.platform},null===(o=window)||void 0===o||null===(i=o.customData)||void 0===i||null===(l=i.beacon)||void 0===l?void 0:l.params),e.t3={},e.t4=ee(),e.t5=$(),e.t6=n.url||document.location.href,e.t7=n.ref||document.referrer,e.t8=n.eventName,e.t9=null!==(a=n.videoPosition)&&void 0!==a?a:null,e.t10=window.environment,e.t11=n.dp1||"",e.t12=n.dp2||"",e.t13=n.dp3||"",e.t14=n.dp4||"",e.t15=n.dp5||"",e.t16=!0===n.isAdEvent?n.videoPosition:null,e.t17=!0===n.isAdEvent?re(n.adPosition):"",e.next=26,te();case 26:e.t18=e.sent,e.t19=n.playerType||"native",e.t20=n.mediaType||"VIDEO",e.t21=window.sid,e.t22=null!==(d=n.ttFirstFrame)&&void 0!==d?d:null,e.t23=null!==(u=n.bitrate)&&void 0!==u?u:null,e.t24=null!==(s=n.resHeight)&&void 0!==s?s:null,e.t25=null!==(c=n.resWidth)&&void 0!==c?c:null,e.t26=null!==(v=n.bufferHealth)&&void 0!==v?v:null,e.t27=null!==(m=le())&&void 0!==m?m:null,e.t28=null!=T?T:null,e.t29={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:null,resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26,networkname:e.t27,brandname:e.t28},e.t30=(null==n?void 0:n.duration)&&{duration:n.duration},e.t31=(0,e.t1)(e.t2,e.t3,e.t29,e.t30),e.t32=null===(f=window)||void 0===f||null===(p=f.customData)||void 0===p||null===(g=p.beacon)||void 0===g?void 0:g.params,e.t33=(0,e.t0)(e.t31,e.t32),S=[e.t33],r({url:(null===(h=window)||void 0===h||null===(w=h.customData)||void 0===w||null===(I=w.beacon)||void 0===I?void 0:I.url)||U.get()+D.getBeaconUrl,method:"post",headers:{Authorization:y},contentType:"application/x-www-form-urlencoded",dataType:"text",data:S}).catch(function(e){console.error(e)});case 44:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var de=function(){var e,n;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(n=e.userAgentData)||void 0===n?void 0:n.platform)?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"},ue=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},se=function(e,n){var t=new Map;B({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),s(t)}).catch(function(e){return console.log(e)})},ce=function(){var e=d.get();return e>=0?e+1:1},ve=function(){var e,n,t,o=u(),r=a(),i=null==r||null===(e=r.video)||void 0===e?void 0:e.id,l=d.get(),s=null==o||null===(n=o[l])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex(function(e){return(null==e?void 0:e.id)===i});return s>=0?s+1:1};function me(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?me(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):me(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var pe=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},ge=function(e){var n=he(e,"video.tags",[]),t=he(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},he=function(e,n,t){for(var o=0,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},we=function(){var n,t,o,r,a,d,u,s,c,v,m,f,p,g,h,w,I,y,E,T,b,S,_,O,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",D=arguments.length>1?arguments[1]:void 0,L=arguments.length>2?arguments[2]:void 0;if(null!==(n=window)&&void 0!==n&&null!==(t=n.customData)&&void 0!==t&&t.disableMacros)return A;var P=(null==L?void 0:L.siteName)||(null==L?void 0:L.site)||"",k=(null==L?void 0:L.contentType)||"video",F=(null==L||null===(o=L[k])||void 0===o?void 0:o.metadata)||(null==L||null===(r=L[k])||void 0===r||null===(a=r.gist)||void 0===a?void 0:a.metadata),C=i(D);if(!A.includes("VIEWLIFT_"))return A;var R,j=window.getComputedStyle(document.getElementById(D),null),N=Math.trunc(j.getPropertyValue("height").slice(0,-2)),V=Math.trunc(j.getPropertyValue("width").slice(0,-2)),W="linearchannel"===k?null==L||null===(d=L.linearchannel)||void 0===d||null===(u=d.channels)||void 0===u||null===(s=u.find(function(e){return(null==e?void 0:e.id)===(null==L?void 0:L.channelId)}))||void 0===s||null===(c=s.content)||void 0===c?void 0:c.id:he(L,"video.gist.id",""),B="linearchannel"===k?null==L||null===(v=L.linearchannel)||void 0===v||null===(m=v.channels)||void 0===m||null===(f=m.find(function(e){return(null==e?void 0:e.id)===(null==L?void 0:L.channelId)}))||void 0===f?void 0:f.title:he(L,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),U=null,M=null;"function"==typeof window.__gpp&&(null===(R=window)||void 0===R||R.__gpp("ping",function(e){U=null==e?void 0:e.gppString,M=null==e?void 0:e.sectionList[0]}));var x=fe(fe({},Ie(F)),{},(S={VIEWLIFT_WIDTH:V,VIEWLIFT_HEIGHT:N,VIEWLIFT_SIZE:pe(V,N),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(p=window)||void 0===p?void 0:p.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:he(L,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:he(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:he(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==C||null===(g=C.options_)||void 0===g?void 0:g.autoplay)||1,VIEWLIFT_MUTE:(null==C||null===(h=C.options_)||void 0===h?void 0:h.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==P||"usanetwork"==P?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:ge(L),VIEWLIFT_MEDIA_ID:W,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(he(L,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:W,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+he(L,"video.gist.permalink","")),VIEWLIFT_CONSENT:l.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:he(null===(w=window)||void 0===w||null===(I=w.app_data)||void 0===I||null===(y=I.site)||void 0===y?void 0:y.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_ROKU_AD_ID:"",VIEWLIFT_ROKU_AD_KEYS:"",VIEWLIFT_RDID:"",VIEWLIFT_GDPR:"spinco"==P||"usanetwork"==P?"":he(null===(E=window)||void 0===E||null===(T=E.app_data)||void 0===T||null===(b=T.site)||void 0===b?void 0:b.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*he(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:he(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:W,VIEWLIFT_CONTENT_TITLE:B,VIEWLIFT_CONTENT_SERIES_TITLE:he(L,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:he(L,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ve(),VIEWLIFT_SEASON_NUMBER:ce(),VIEWLIFT_CONTENT_TAGS:ge(L),VIEWLIFT_GPP_SID:M||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:U||"VIEWLIFT_GPP",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:"",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},e(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},Ie=function(e){var n,t,o,r,i,l,a={},d=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){d.set(e.name,e.value)}));var u=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.subscription)||void 0===o?void 0:o.SVOD)||!1,s=(null===(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 u||s?(ue()?u?a=fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||""}):s&&(a=fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.tve")||""})):u?a=fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||""}):s&&(a=fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.web.tve")||""})),u?a=fe(fe({},a),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||d.get("sfid.web.dtc")||""}):s&&(a=fe(fe({},a),{},{VIEWLIFT_SFID:d.get("sfid.tve")||d.get("sfid.web.tve")||""})),a=ue()?fe(fe({},a),{},{VIEWLIFT_PROF:d.get("prof.mweb")||""}):fe(fe({},a),{},{VIEWLIFT_PROF:d.get("prof.web")||""})):(a=fe(fe({},a),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||d.get("sfid.web.dtc")||""}),a=ue()?fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:d.get("prof.mweb")||""}):fe(fe({},a),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||"",VIEWLIFT_PROF:d.get("prof.web")||""})),a=fe(fe({},a),{},{VIEWLIFT_AFID:d.get("afid"),VIEWLIFT_NIELSEN_APP_ID:d.get("VIEWLIFT_NIELSEN_APP_ID")||"",VIEWLIFT_CHANNEL:d.get("VIEWLIFT_CHANNEL")||"",VIEWLIFT_GRACE_NOTE_ID:d.get("VIEWLIFT_GRACE_NOTE_ID")||""})},ye=function(e,n){var t,o,r,i,l,a,d,u,s,c,v,m,f,p=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[p])||void 0===t?void 0:t.drmEnabled,h=null==e||null===(o=e[p])||void 0===o||null===(r=o.streamingInfo)||void 0===r?void 0:r.videoAssets,w=null==e||null===(i=e[p])||void 0===i||null===(l=i.streamingInfo)||void 0===l?void 0:l.audioAssets,I=(null==e||null===(a=e[p])||void 0===a||null===(d=a.streamingInfo)||void 0===d||null===(u=d.videoAssets)||void 0===u?void 0:u.hls)||!1;null==e||null===(s=e[p])||void 0===s||null===(c=s.liveDetails)||void 0===c||c.isDvrEnabled;var y=(null==e||null===(v=e[p])||void 0===v||null===(m=v.streamingInfo)||void 0===m||null===(f=m.videoAssets)||void 0===f?void 0:f.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=w&&w.hls)return Te(w);if(g){var E=be(h,n);return E.src=we(E.src,n,e),E}if("Safari"!==de()&&y)return Ee(h);if(I){var T=Te(h);return T.src=we(T.src,n,e),T}if(null!=h&&h.mpeg){var b=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(h);return b.src=we(b.src,n,e),b}return null},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,d=de();if(i(n),"Safari"===d){var u=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var 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 Se(n),u}var s,c={src:l.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(Se(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 Se=function(e){var n=i(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==de()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},_e=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}},Oe=function(e,n){if(import("./error-2395864b.js").then(function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)}),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var o=document.getElementById(e);if(o){var 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)}}},Ae=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var De=!1,Le=function(e,n,t){var o=we(n,e,t),r=i(e);if(n&&window.google){if("function"!=typeof r.ima&&"object"!==g(r.ima))return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,n){var t,o,r,l=i(e);if(null!==l.el_){De=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),De&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,n,!0),l.ima.requestAds()},1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),l.one(u,function(){s&&l.ima.initializeAdDisplayContainer()});var c=(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(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_,d=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",function(t){var o,r,i,u,s,c,v,m,f;if(Fe.enabled&&!t.metaKey&&!t.ctrlKey&&"input"!=t.target.localName&&"textarea"!=t.target.localName){var p=t.key,g=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(p)&&(t.preventDefault(),null==d||d.focus()),p){case" ":null==a||a.click();break;case"m":case"M":l.muted(!l.muted());break;case"f":case"F":null===(o=document.querySelector(".vjs-fullscreen-control"))||void 0===o||o.click();break;case"ArrowLeft":g&&!1===n.liveui||An(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(r=window)||void 0===r||null===(i=r.app_data)||void 0===i||null===(u=i.appcmsMain)||void 0===u||null===(s=u.adsConfig)||void 0===s?void 0:s.vodAdSticherProvider)&&null!==(c=window)&&void 0!==c&&null!==(v=c.app_data)&&void 0!==v&&null!==(m=v.appcmsMain)&&void 0!==m&&null!==(f=m.adsConfig)&&void 0!==f&&f.vodAdClientSideTracking)return;g||On(e,10)}}},!0)}var ke,Fe=(ke=!0,{enable:function(){ke=!0},disable:function(){ke=!1},get enabled(){return ke}}),Ce="ssai-breakStart",Re="ssai-adImpression",je="ssai-firstQuartile",Ne="ssai-midpoint",Ve="ssai-thirdQuartile",We="ssai-complete",Be="ssai-breakEnd",Ue={breakStart:Ce,impression:Re,firstQuartile:je,midpoint:Ne,thirdQuartile:Ve,complete:We,breakEnd:Be};function Me(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=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 xe(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(Re,e)},adFirstQuartile:function(e){return t(je,e)},adMidpoint:function(e){return t(Ne,e)},adThirdQuartile:function(e){return t(Ve,e)},adComplete:function(e){return t(We,e)},adBreakEnd:function(e){return t(Be,e)}}}function He(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Ge(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?He(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):He(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var Qe,Ye=(Qe=null,{get:function(){return Qe},set:function(e){Qe=e}});function ze(e,n){var t,o,r,l,d,u,s,c,v,m,f,p,g=null==e?void 0:e.playerId,h=i(g),w=null==n?void 0:n.siteName;if(null!=e&&null!==(t=e.comscore)&&void 0!==t&&t.enable){var I=a(),y=(null==I||null===(o=I.video)||void 0===o?void 0:o.metadata)||[],_=(null==y?void 0:y.length)&&y.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,D,L,P=null===(l=window)||void 0===l?void 0:l.lcProgrammeDetails,k=Array.isArray(null==P?void 0:P.category)?null==P||null===(d=P.category)||void 0===d?void 0:d.join(","):(null==P?void 0:P.category)||null,F=Ge(Ge(Ge({},null==I?void 0:I.video),null==I?void 0:I.linearchannel),{},{siteName:w,programId:(null==P?void 0:P.videotmsid)||null,programTitle:(null==P?void 0:P.lcProgrammeName)||null,episodeId:(null==P?void 0:P.videotmsid)||null,seasonNumber:(null==P||null===(u=P.seriesDetails)||void 0===u?void 0:u.season)||null,episodeNumber:(null==P||null===(s=P.seriesDetails)||void 0===s?void 0:s.episode)||null,isCompleteEpisode:!!(null!=I&&null!==(c=I.video)&&void 0!==c&&c.series||null!=P&&null!==(v=P.seriesDetails)&&void 0!==v&&v.episode),genre:_||k,comscoreConfig:{implementationId:(null==e||null===(m=e.comscore)||void 0===m?void 0:m.implementationId)||null,projectId:(null==e||null===(f=e.comscore)||void 0===f?void 0:f.projectId)||null}});if(null!=F&&null!==(p=F.streamingInfo)&&void 0!==p&&p.isLiveStream&&(F.contentType="LIVE"),null==F||!F.network){var C,R=(null==F?void 0:F.metadata)||[],j=null==R||null===(C=R.find(function(e){return"network"===e.name}))||void 0===C?void 0:C.value;F.network=j||null}null!=F&&F.network&&null!=F&&F.genre&&(F.customGenre="".concat(F.network,"_").concat((null==F?void 0:F.programTitle)||(A=F,null!=A&&A.series?null==A||null===(L=A.series)||void 0===L?void 0:L.title:null==A||null===(D=A.gist)||void 0===D?void 0:D.title),"_").concat(F.genre)),null!=P&&P.airDate&&(F.publishDate=P.airDate);var N=T(F,h);console.log("comscoreOptions player data",N),b(Ge({playerName:"Video.js"},N)),S(h)}}function qe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Ke(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?qe(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):qe(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}function Xe(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return Je(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Je(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,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 Je(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}var $e,Ze=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),en=($e=null,{set:function(e){$e=e},get position(){return $e}});function nn(e,n){return tn.apply(this,arguments)}function tn(){return(tn=n(t.mark(function e(n,o){var r,l,a,d,u,s,c,v,m,f,p,g,h,w,I,E,T,b;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i(n),a=ye(o,n),d=a.src,u=(null==o?void 0:o.contentType)||"video",null==o||null===(r=o[u])||void 0===r||null===(l=r.streamingInfo)||void 0===l||l.isLiveStream,s=d.replace("/dash/","/session/").replace("/master/","/session/"),s=we(s,n,o),c=rn(s),v=y(c,2),m=v[0],f=v[1],p=on(f)||{},s=new URL(s.split("?")[0]),Object.keys(f).length>0&&Object.entries(f).forEach(function(e){var n=y(e,2),t=n[0],o=n[1];s.searchParams.set(t,o)}),e.prev=11,e.next=14,fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ke({adsParams:Ke({},m)},p))});case 14:return g=e.sent,e.next=17,g.json();case 17:return h=e.sent,w="https://"+new URL(s).hostname,I=h.trackingUrl,E=h.manifestUrl,T=w+I,b=w+E,Ze.set(T),console.log("%c TRACKING URL","background: #bdf369; color: #000",T),a.src=b,e.abrupt("return",a);case 29:return e.prev=29,e.t0=e.catch(11),e.abrupt("return",a);case 32:case"end":return e.stop()}},e,null,[[11,29]])}))).apply(this,arguments)}function on(e){var n;return Object.fromEntries(null==Object||null===(n=Object.entries(e))||void 0===n?void 0:n.map(function(e){var n=y(e,2),t=n[0],o=n[1];return[null==t?void 0:t.replace(/^aws\./,""),String(o)]}))||{}}function rn(e){var n={};if(!e.split("?")[1])return[{},{}];var t,o=new URL(e,window.location.origin),r=Xe((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 d={},u={},s=0,c=Object.entries(n);s<c.length;s++){var v=y(c[s],2),m=v[0],f=v[1];if(m.startsWith("ads."))d[m.replace(/^ads\./,"")]=f;else u[m]=f}return[d,u]}var ln,an,dn,un,sn=(ln=[],{setQueuePoints:function(e){console.log("%c Setting SGAI Queue Points ","background: #bdf369; color: #000",e),ln=Array.isArray(e)?I(e):ln},getQueuePoints:function(){return console.log("%c Getting SGAI Queue Points ","background: #bdf369; color: #000",ln),I(ln)}}),cn=new Map;function vn(e,n){return mn.apply(this,arguments)}function mn(){return mn=n(t.mark(function e(o,r){var l,a,d,u,s,c,v,m,f,p,g,w,y,E,T,b,S,_,O,A,D,L;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:L=function(e,n,t,r,l,a){var d=i(o);if(!d.seeking()){n.startTimeInSeconds,n.durationInSeconds,Math.floor(d.currentTime());var u,s=Xe(t);try{var c=function(){var t,i,s,c=u.value,v=c.eventType,m=c.beaconUrls,f=c.startTimeInSeconds,p=c.startTime,g=c.durationInSeconds,h=f||0,w=m,I=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(s=i.ads)||void 0===s?void 0:s.adEventHandler)||null,y="".concat(h,"_").concat(v),E=cn.get("pod-".concat(l))||[];if(console.warn(e,h,"map:",v,"condition1:",e>=h,"map:",cn),e>=h&&!E.includes(y)){E.push(y),cn.set("pod-".concat(l),E);try{D(v,n,w,d)}catch(e){console.error("Error when calling triggerAdBeacon:",e,v,n)}if("breakEnd"==v){var T=en.position;en.set(null),setTimeout(function(){null!=T&&(d.currentTime(T),a())},500)}if("function"==typeof I)try{var b,S={eventType:v,startTimeInSeconds:f,startTime:p,durationInSeconds:g,ad:null==n||null===(b=n.ads)||void 0===b?void 0:b[r],pod:n,adIndex:r};I({adsData:S}),Me(o,S)}catch(e){console.error("Error when calling ads callback:",e)}var _=Ye.get();if(_&&0!==Object.keys(_).length){var O=_.formulateComscoreAdPayload,A=_.startComscoreAdTracking,L=_.finishComscoreAdTracking,P=_.endComscoreAdTracking;if("impression"===v){var k,F=Ze.get();A(O(Ke(Ke({},null==n||null===(k=n.ads)||void 0===k?void 0:k[r]),{},{trackingUrl:F})))}else"complete"===v?L():"breakEnd"===v&&P()}}};for(s.s();!(u=s.n()).done;)c()}catch(e){s.e(e)}finally{s.f()}}},D=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"))},cn.clear(),en.set(r),f=Ze.get(),(p=i(o)).one("loadeddata",function(){f&&O(f)}),g=new Map,w=new Map,y=-1,E=(null===(l=document)||void 0===l||null===(a=l.getElementsByClassName("tvProviderImage"))||void 0===a?void 0:a[0])||null,T=(null==p||null===(d=p.controlBar)||void 0===d?void 0:d.getChild("videoSelector"))||null,b=(null==p||null===(u=p.controlBar)||void 0===u?void 0:u.getChild("seriesV2"))||null,S=(null==p||null===(s=p.el())||void 0===s||null===(c=s.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===c?void 0:c[0])||null,_=(null==p||null===(v=p.el())||void 0===v||null===(m=v.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===m?void 0:m[0])||null,O=function(){var e=n(t.mark(function e(n){var l,a,d,u,s,c,v,m,f,p,O,D,P,k,F,C,R,j,N,V,W,B,U,M;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return V=function(e){document.removeEventListener("pointermove",N),document.removeEventListener("pointerup",V),0===e.button&&R()},N=function(e){},j=function(){var e,n=p.currentTime(),t=null,o=Xe(f);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,g.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(){p.currentTime(t+2.2)},100))},R=function(){var e,n=p.currentTime(),t=null,o=Xe(f);try{for(o.s();!(e=o.n()).done;){var r=e.value,i=r.startTimeInSeconds,l=r.durationInSeconds,a=r.ads,d=Math.floor(i+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>d||n>i)&&!g.has(i)||n>=i&&n<=d)&&(t=i,g.set(i,!0),w.set(i,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout(function(){p.currentTime(t+.4)},100))},s=!1,e.next=7,fetch(n);case 7:return c=e.sent,e.next=10,c.json();case 10:v=e.sent,console.log("%c TRACKING URL RESPONSE ","background: #d9e7ff; color: #000",v),m=v.avails,f=[],p=i(o),O=p.controlBar.progressControl,D=O.seekBar.el(),null===(l=document)||void 0===l||l.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),m.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&&(s=!0),f.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])||[]})}),!s&&r&&(p.currentTime(r),j()),null!=f&&f.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",f),window.adsQueueList=f,"function"==typeof(C=(null===(P=window)||void 0===P||null===(k=P.customData)||void 0===k||null===(F=k.ads)||void 0===F?void 0:F.onAdBreaksLoaded)||null)&&(null==f?void 0:f.length)>0&&C(f)),console.log(f,"data"),f.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=p.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var 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",D.appendChild(i)}}),p._timeUpdateHandler&&p.off("timeupdate",p._timeUpdateHandler),p._timeUpdateHandler=h(function(){var e=p.currentTime();if(e!==y){y=e;for(var n=!1,t=function(){var t=f[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&&g.set(r,!0),Fe.disable(),E&&E.classList.add("vjs-hidden"),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),T&&(T.el().style.pointerEvents="none",T.el().classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),O.el().classList.add("hide-progress-bar");for(var d=e-r,u=0,s=0,c=0;c<l.length;c++){var v,m=null==l||null===(v=l[c])||void 0===v?void 0:v.durationInSeconds;if(d<u+m){s=c;break}u+=m}l[s];var p=Math.max(0,i-d),h=Math.round(p);W.style.display="block",M.textContent="".concat(s+1," of ").concat(l.length," • ").concat(A(h));var y=[];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)});y.push.apply(y,I(n))}),Array.isArray(l)&&0==(null==l?void 0:l.length)&&y.push(null==t?void 0:t.podSlotImpressionBeacon),L(e,t,y,s,o,j),"break"}w.delete(r)},o=0;o<f.length;o++){if("break"===t())break}n||(W.style.display="none",O.el().classList.remove("hide-progress-bar"),T&&(T.el().style.pointerEvents="auto",T.el().classList.remove("vjs-hidden")),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),E&&E.classList.remove("vjs-hidden"),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),Fe.enable())}},1e3),p.on("timeupdate",p._timeUpdateHandler),null===(a=document)||void 0===a||a.addEventListener("keydown",function(e){Fe.enabled&&"ArrowRight"==e.key&&(R(),On(o,10),e.stopPropagation())}),O.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",N),document.addEventListener("pointerup",V))}),null===(d=document)||void 0===d||null===(u=d.querySelectorAll(".ssai-ad-container"))||void 0===u||u.forEach(function(e){return null==e?void 0:e.remove()}),(W=document.createElement("div")).className="ssai-ad-container",(B=document.createElement("div")).className="sponsored-adbox",(U=document.createElement("div")).className="sponsored-text",U.textContent="Sponsored Ad",B.append(U),(M=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",W.append(B),W.append(M),p.el().appendChild(W);case 45:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}();case 18:case"end":return e.stop()}},e)})),mn.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 gn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function hn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?gn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):gn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var wn={},In=(null===(an=window)||void 0===an||null===(dn=an.location)||void 0===dn||null===(un=dn.search)||void 0===un?void 0:un.includes("debug=true"))||!1,yn=null;function En(e){return Tn.apply(this,arguments)}function Tn(){return Tn=n(t.mark(function e(o){var r,l,a,d,u,s,c,v,m,f,p,g,w,y,E,T,b,S,_,O,A,D,L,P,k,F,C;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:C=function(e,n,t,r,l){var a,d,u=null==n||null===(a=n.ads)||void 0===a||null===(d=a[r])||void 0===d?void 0:d.adId,s=i(o);if(!s.seeking()){var c=n.startTimeInSeconds;n.durationInSeconds,Math.floor(s.currentTime());var v,m=fn(t);try{for(m.s();!(v=m.n()).done;){var f,p,g,h=v.value,w=h.eventType,I=h.beaconUrls,y=h.startTimeInSeconds,E=h.startTime,T=h.durationInSeconds,b=(h.eventId,y||0),S=I,_=(null===(f=window)||void 0===f||null===(p=f.customData)||void 0===p||null===(g=p.ads)||void 0===g?void 0:g.adEventHandler)||null,O="".concat(u,"_").concat(w),A="pod-".concat(c);P.has(A)||P.set(A,new Set);var D=P.get(A);if(In&&console.warn(e,b,"map:",w,"condition1:",e>=b,"map:",P),e>=b&&e<=b+k&&!D.has(O)){D.add(O);try{F(w,n,S,s)}catch(e){console.error("Error when calling triggerAdBeacon:",e,w,n)}if("function"==typeof _)try{var L,C={eventType:w,startTimeInSeconds:y,startTime:E,durationInSeconds:T,ad:null==n||null===(L=n.ads)||void 0===L?void 0:L[r],pod:n,adIndex:r};_({adsData:C}),Me(o,C)}catch(e){console.error("Error when calling ads callback:",e)}}}}catch(e){m.e(e)}finally{m.f()}}},F=function(e,n,t,o){var r,i;"breakEnd"===e&&(null===(r=wn)||void 0===r?void 0:r.currentAdIndex)+1!=(null===(i=wn)||void 0===i?void 0:i.totalAds)||(In&&console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})}))},p=function(){yn&&clearInterval(yn)},m=Ze.get(),(f=i(o)).one("loadeddata",function(){p(),yn=setInterval(function(){m&&!f.paused()&&L(m)},2e3)}),f.on("dispose",function(){p()}),g=new Map,w=new Map,y=-1,E=null,T=(null===(r=document)||void 0===r||null===(l=r.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,b=(null==f||null===(a=f.controlBar)||void 0===a?void 0:a.getChild("videoSelector"))||null,S=(null==f||null===(d=f.controlBar)||void 0===d?void 0:d.getChild("seriesV2"))||null,_=(null==f||null===(u=f.el())||void 0===u||null===(s=u.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===s?void 0:s[0])||null,O=(null==f||null===(c=f.el())||void 0===c||null===(v=c.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===v?void 0:v[0])||null,A=!1,D=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return I(o);var 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],d=null==a||null===(n=a.trackingEvents)||void 0===n?void 0:n.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),u=(null==d?void 0:d.some(function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some(function(e){return e.includes("videoView")})}))||!1;if(!u&&l){var s=null==d?void 0:d.map(function(e){return hn(hn({},e),{},{eventType:"videoView",beaconUrls:[l]})});null!=s&&s[0]&&r.push(null==s?void 0:s[0])}return r},L=function(){var e=n(t.mark(function e(n){var r,l,a,d,u,s,c,v,m,f,p,L,P,k;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=new URL(n),E&&l.searchParams.append("nextToken",E),e.next=4,fetch(l.toString(),{method:"GET"});case 4:return a=e.sent,e.next=7,a.json();case 7:d=e.sent,u=d.avails,s=d.nextToken||null,E=s,c=[],v=i(o),m=v.controlBar.progressControl,f=m.seekBar.el(),null===(r=document)||void 0===r||r.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),u.map(function(e,n){c.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:D(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),In&&console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",c),null!=c&&c.length&&(window.adsQueueList=c,"function"==typeof(k=(null===(p=window)||void 0===p||null===(L=p.customData)||void 0===L||null===(P=L.ads)||void 0===P?void 0:P.onAdBreaksLoaded)||null)&&(null==c?void 0:c.length)>0&&k(c)),c.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=v.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var 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",f.appendChild(i)}}),v._timeUpdateHandler&&v.off("timeupdate",v._timeUpdateHandler),v._timeUpdateHandler=h(function(){var e=v.currentTime();if(e!==y){y=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&&g.set(o,!0),Fe.disable(),T&&T.classList.add("vjs-hidden"),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),O&&(O.style.pointerEvents="none",O.classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),S&&(S.el().style.pointerEvents="none",S.el().classList.add("vjs-hidden")),m.el().classList.add("hide-progress-bar");for(var d=e-o,u=0,s=0,v=0;v<i.length;v++){var f,p=null==i||null===(f=i[v])||void 0===f?void 0:f.durationInSeconds;if(d<u+p){s=v;break}u+=p}setTimeout(function(){wn.totalAds=null==i?void 0:i.length,wn.currentAdIndex=s},1e3);var h=[];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)});h.push.apply(h,I(n))}),(null==n||null===(a=n.podSlotImpressionBeacon)||void 0===a?void 0:a.length)>0&&h.push.apply(h,I(null==n?void 0:n.podSlotImpressionBeacon)),C(e,n,h,s),"break"}w.delete(o)},t=0;t<c.length;t++){if("break"===n())break}A||(wn={},m.el().classList.remove("hide-progress-bar"),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),S&&(S.el().style.pointerEvents="auto",S.el().classList.remove("vjs-hidden")),T&&T.classList.remove("vjs-hidden"),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),O&&(O.style.pointerEvents="auto",O.classList.remove("vjs-hidden")),Fe.enable())}},1e3),v.on("timeupdate",v._timeUpdateHandler);case 23:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),P=new Map,k=2.5;case 22:case"end":return e.stop()}},e)})),Tn.apply(this,arguments)}function bn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}var Sn=function(e){o(e).play()},_n=function(e){o(e).pause()},On=function(e,n){var t=o(e),r=t.currentTime()+n;t.currentTime(r)},An=function(e,n){var t=o(e),r=t.currentTime(),i=r<=n?0:r-n;t.currentTime(i)},Dn=function(e){return!!o.getPlayer("".concat(e))},Ln=function(e){return o(e).paused()},Pn=function(){var e=n(t.mark(function e(o,r){var l,a,d,u=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=u.length>2&&void 0!==u[2]&&u[2],e.next=3,z();case 3:return a=e.sent,d=i(o),e.abrupt("return",new Promise(function(e,i){var u=(null==r?void 0:r.programs)||[];null==r||delete r.programs,j(r,a).then(function(){var i=n(t.mark(function n(i){var a,s,v,f,p,g,h,w;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,h=(null==g||null===(a=g.linearchannel)||void 0===a?void 0:a.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(s=window)||void 0===s||null===(v=s.app_data)||void 0===v||null===(f=v.appcmsMain)||void 0===f||null===(p=f.adsConfig)||void 0===p?void 0:p.vodAdSticherProvider)||!1,w=ye(g,o),!h){n.next=11;break}return n.next=9,nn(o,g);case 9:w=n.sent,l=!0;case 11:c(g),m(u),sessionStorage.setItem("program_switched",!0),w&&l?(jn(o,w),h&&En(o),d.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)}}(),kn=function(){var e=n(t.mark(function e(o,r,l){var a,d,s,m,g,h,w;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z();case 2:return m=e.sent,(u()||null)&&v(r),g=0,h=0,w=null,null!==(a=window)&&void 0!==a&&a.watchHistory&&null!==(d=window)&&void 0!==d&&null!==(s=d.watchHistory)&&void 0!==s&&s.enable&&W(r,m).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,(h=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null)<95)&&(w=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedTime)||null)}).catch(function(e){var n,t,o,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){R(r,m).then(function(){var r=n(t.mark(function n(r){var a,d,u,s,v,m,I,y,E,T,b,S,_,O,A,D,L,P,k,F,C,R,j,N,V,W,B,U,M,x,H,G,Q,Y,z,q,K,X;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(D=null==r?void 0:r.data,L=(null==D?void 0:D.contentType)||"video",P=(null==D||null===(a=D[L])||void 0===a?void 0:a.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(d=window)||void 0===d||null===(u=d.app_data)||void 0===u||null===(s=u.appcmsMain)||void 0===s||null===(v=s.adsConfig)||void 0===v?void 0:v.vodAdSticherProvider)||!1,k=(null==D||null===(m=D.video)||void 0===m||null===(I=m.streamingInfo)||void 0===I?void 0:I.isLiveStream)||!1,c(r.data),(F=(null==D||null===(y=D.ads)||void 0===y||null===(E=y.preRoll)||void 0===E||null===(T=E.adTags)||void 0===T||null===(b=T.web)||void 0===b?void 0:b.active)&&(null==D||null===(S=D.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,F,D),C=ye(D,o),!P){n.next=12;break}return n.next=11,nn(o,D);case 11:C=n.sent;case 12:C?(G=(null==D||null===(R=D.video)||void 0===R||null===(j=R.gist)||void 0===j?void 0:j.videoImageUrl)||(null==D||null===(N=D.video)||void 0===N||null===(V=N.gist)||void 0===V||null===(W=V.imageGist)||void 0===W?void 0:W.r16x9),(Q=i(o)).poster(G),jn(o,C),P&&vn(o,w),Q.on("loadstart",function(){k&&e({status:!0,msg:"Video Loaded",response:D})}),Q.on("loadeddata",function(){Ae(),e({status:!0,msg:"Video Loaded",response:D})}),Q.one("play",function(){g&&!P&&h<95&&setTimeout(function(){Q.currentTime(g)},0)}),Q.one("error",function(){var e;l({status:!1,msg:(null==Q||null===(e=Q.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==D||null===(B=D.video)||void 0===B||null===(U=B.contentDetails)||void 0===U||null===(M=U.closedCaptions)||void 0===M?void 0:M.length)>0||(null==D||null===(x=D.video)||void 0===x||null===(H=x.closedCaptions)||void 0===H?void 0:H.length)>0?(X=(null==D||null===(z=D.video)||void 0===z||null===(q=z.contentDetails)||void 0===q?void 0:q.closedCaptions)||(null==D||null===(K=D.video)||void 0===K?void 0:K.closedCaptions),Y=X.filter(function(e){return"VTT"===e.format}),f(o,Y)):p(o)):(Oe(o,"Incompatible Source, only hls,mp4,drm content is allowed"),l("Incompatible Source, only hls,mp4,drm content is allowed"));case 13:case"end":return n.stop()}},n)}));return function(e){return r.apply(this,arguments)}}()).catch(function(e){Nn(e,o,l,r)})}));case 10:case"end":return e.stop()}},e)}));return function(n,t,o){return e.apply(this,arguments)}}(),Fn=function(e,n,t){var o=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=(Ye.get()||{}).destroyComscoreTag,t=i(e);if(Rn(),"function"==typeof n&&n(),w(),window.onresize=null,t)t.dispose();else{var o=document.getElementById(e);o&&o.remove()}},Rn=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},jn=function(e,n){var t=i(e);t&&t.src(n)},Nn=function(n,t,o,r){var i,l,a,d,u,s,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===(d=a.data)||void 0===d?void 0:d.errorMessage)||(null==n?void 0:n.message);Dn(t)&&Oe(t,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[c])||"".concat(v)),o&&o(function(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?bn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):bn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}({status:!1,response:n,msg:"".concat(v)},r&&{videoId:r}))},Vn=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var o=n.getElementsByClassName("vjs-big-play-button")[0];o&&(o.style.display="none");var r=n.getElementsByClassName("vjs-fullscreen-control")[0];r&&(r.style.display="none")},Wn=function(e){var n,t=i(e);return!(null!=t&&null!==(n=t.liveTracker)&&void 0!==n&&n.atLiveEdge())||null};export{Sn as A,_n as B,An as C,Dn as D,kn as E,Pn as F,Cn as G,M as H,sn as I,xe as J,Wn as K,U as L,q as M,G as N,x as O,O as P,cn as Q,Pe as R,ue as S,Ln as T,En as U,vn as V,B as W,ve as a,ce as b,Ye as c,de as d,ye as e,Ae as f,ee as g,Oe as h,ze as i,Vn as j,ae as k,jn as l,Le as m,_e as n,nn as o,K as p,R as q,W as r,V as s,Nn as t,z as u,j as v,N as w,se as x,Fn as y,On as z};
|