@viewlift/player-backup 2.0.291-backup → 2.0.293-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-19386762.js → autoNextVideo-b81a21a8.js} +1 -1
- package/cjs/bundle.css +434 -434
- package/cjs/{caption-settings-058ad013.js → caption-settings-5efc7591.js} +1 -1
- package/cjs/{captions-d98c49d6.js → captions-5f9611f1.js} +1 -1
- package/cjs/{features-2cdc4e39.js → features-fde1e6f4.js} +1 -1
- package/cjs/generic-bcc1b11d.js +1 -0
- package/cjs/{index-955b603e.js → index-1ce7c505.js} +1 -1
- package/cjs/{index-50e69a99.js → index-b6608461.js} +1 -1
- package/cjs/{index-81c8f4a1.js → index-d0ac4ff1.js} +1 -1
- package/cjs/{index-004fc85d.js → index-f07dd8f7.js} +1 -1
- package/cjs/index.js +1 -1
- package/cjs/{multicamv2-56120328.js → multicamv2-90e4f85d.js} +1 -1
- package/cjs/{multicamv2-1bdf2c52.js → multicamv2-d13f3799.js} +1 -1
- package/cjs/{nextEpisodeButton-290b490f.js → nextEpisodeButton-0e1f606e.js} +1 -1
- package/cjs/{playlist-7b61a3c6.js → playlist-5538ab33.js} +1 -1
- package/cjs/{renditions-6554142b.js → renditions-6f165ef5.js} +1 -1
- package/cjs/{resolution-c33a67fb.js → resolution-19103db5.js} +1 -1
- package/cjs/{series-20fe0127.js → series-197acb35.js} +1 -1
- package/cjs/{series-v2-5ccc7a93.js → series-v2-37b957c0.js} +1 -1
- package/cjs/{series-v2-4d05ebf8.js → series-v2-e09f82a1.js} +1 -1
- package/cjs/{settings-icon-1efd3e23.js → settings-icon-43534947.js} +1 -1
- package/cjs/{skin-ac3c64df.js → skin-0cd2cc19.js} +1 -1
- package/cjs/{skin-e0cf4554.js → skin-16ae23af.js} +1 -1
- package/cjs/{skin-c72adb59.js → skin-1d2ac9aa.js} +1 -1
- package/cjs/{skin-ba07e8dc.js → skin-79f1cf9f.js} +1 -1
- package/cjs/{skin-41b0c02d.js → skin-7be967ce.js} +1 -1
- package/cjs/{skin-12b4d86a.js → skin-a03263c8.js} +1 -1
- package/cjs/{skin-9d79794a.js → skin-a3da2429.js} +1 -1
- package/cjs/{skin-00029c75.js → skin-a74bc0a0.js} +1 -1
- package/cjs/{skin-c08b2d3f.js → skin-b86f2fb9.js} +1 -1
- package/cjs/{skin-1f5cd68e.js → skin-e9578396.js} +1 -1
- package/cjs/{videoSelector-95e64eba.js → videoSelector-71585863.js} +1 -1
- package/cjs/{videoSelector-ab05bccb.js → videoSelector-ee1c7a9f.js} +1 -1
- package/esm/{autoNextVideo-379bbdc2.js → autoNextVideo-de9c7cb3.js} +1 -1
- package/esm/bundle.css +434 -434
- package/esm/{caption-settings-a9b6581e.js → caption-settings-cfb1368b.js} +1 -1
- package/esm/{captions-9659ee8f.js → captions-89897207.js} +1 -1
- package/esm/{features-dbc6b07e.js → features-c5bf2798.js} +1 -1
- package/esm/generic-cc27a100.js +1 -0
- package/esm/{index-ac572236.js → index-a46fd1e5.js} +1 -1
- package/esm/{index-b62e0f74.js → index-bb7166ff.js} +1 -1
- package/esm/{index-8566dca0.js → index-ce7f6974.js} +1 -1
- package/esm/{index-ae4cf675.js → index-e6facfc7.js} +1 -1
- package/esm/index.js +1 -1
- package/esm/{multicamv2-de90d28f.js → multicamv2-9e6a345c.js} +1 -1
- package/esm/{multicamv2-a84ce8b3.js → multicamv2-b2a188e0.js} +1 -1
- package/esm/{nextEpisodeButton-bffd417f.js → nextEpisodeButton-a1156a17.js} +1 -1
- package/esm/{playlist-100ecdfe.js → playlist-87d6e4cb.js} +1 -1
- package/esm/{renditions-4eddc06a.js → renditions-ee4e8582.js} +1 -1
- package/esm/{resolution-46076e4a.js → resolution-879fc9c0.js} +1 -1
- package/esm/{series-8ef8fdfa.js → series-16e59934.js} +1 -1
- package/esm/{series-v2-76f5001b.js → series-v2-381f9c36.js} +1 -1
- package/esm/{series-v2-551f67e8.js → series-v2-5a7027ad.js} +1 -1
- package/esm/{settings-icon-60394554.js → settings-icon-851014b6.js} +1 -1
- package/esm/skin-0abde216.js +1 -0
- package/esm/{skin-4280c73d.js → skin-0bf419dd.js} +1 -1
- package/esm/{skin-f9ec12e3.js → skin-4d0b33c3.js} +1 -1
- package/esm/{skin-1c1aa7a5.js → skin-4fe01364.js} +1 -1
- package/esm/{skin-41718675.js → skin-5e8fcff1.js} +1 -1
- package/esm/{skin-80e062bd.js → skin-672a575a.js} +1 -1
- package/esm/{skin-dddf388c.js → skin-6bb0371a.js} +1 -1
- package/esm/{skin-e4073063.js → skin-9424e7c5.js} +1 -1
- package/esm/{skin-a6c3353b.js → skin-b866a867.js} +1 -1
- package/esm/{skin-fdbbacca.js → skin-e74d2dd9.js} +1 -1
- package/esm/{videoSelector-93246044.js → videoSelector-14a4414d.js} +1 -1
- package/esm/{videoSelector-13ae5477.js → videoSelector-563df963.js} +1 -1
- package/package.json +28 -25
- package/cjs/generic-5b90c727.js +0 -1
- package/esm/generic-b3643a73.js +0 -1
- package/esm/skin-e2592aa4.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/get";import n from"@babel/runtime/helpers/inherits";import i from"@babel/runtime/helpers/possibleConstructorReturn";import a from"@babel/runtime/helpers/getPrototypeOf";import l from"video.js";import{E as r,g as d}from"./icons-262bef63.js";import{M as s,a0 as c}from"./generic-
|
|
1
|
+
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/get";import n from"@babel/runtime/helpers/inherits";import i from"@babel/runtime/helpers/possibleConstructorReturn";import a from"@babel/runtime/helpers/getPrototypeOf";import l from"video.js";import{E as r,g as d}from"./icons-262bef63.js";import{M as s,a0 as c}from"./generic-cc27a100.js";import{m,j as u,s as v,k as p,l as h}from"./skin-0abde216.js";import{a as f,u as b}from"./autoNextVideo-de9c7cb3.js";import{g as y}from"./localisation-0bf399a1.js";import{r as g}from"./relatedVideosManager-8dd9aa24.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./browser-de5f6a74.js";import"md5";import"js-cookie";import"./captions-89897207.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/slicedToArray";import"@viewlift/comscore/index.js";import"./index-ce7f6974.js";function C(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(C=function(){return!!e})()}var N=l.getComponent("Component"),E=function(){n(I,N);var E,k,j=(E=I,k=C(),function(){var e,t=a(E);if(k){var o=a(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return i(this,e)});function I(t){var o,n,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,I),(i=j.call(this,t,a)).playerId=a.playerId,i.seriesData=a.sres,i.videos=a.related.content,i.cb=(null==a||null===(o=a.related)||void 0===o?void 0:o.cb)||null,i.autoNext=(null==a||null===(n=a.related)||void 0===n?void 0:n.autoNext)||!1,i.currentVideoData=a.res,i.initialiseStructure(),i.loadCSS(),i.autoNext&&(c(0),f({playerId:i.playerId,content:i.videos,cb:i.cb})),i._unsubRelated=g.subscribe(function(e){var t;i.videos=(null==e?void 0:e.content)||i.videos,i.cb=null!==(t=null==e?void 0:e.cb)&&void 0!==t?t:i.cb,b(i.videos),i._refreshList()}),i}return t(I,[{key:"_buildVideoItem",value:function(e){var t,o,n,i,a,r=this,d=l.dom.createEl("div",{className:"video -".concat(e)}),u=l.dom.createEl("div",{className:"recommended -".concat(e)});u.setAttribute("video-idx",e),u.onclick=function(){c(e+1);for(var t=l.dom.$$(".recommended"),o=0;o<t.length;o++)t[o].style.border="none";m(e),s(r.playerId,r.videos[e].id).then(function(e){r.cb&&r.cb(e)}).catch(function(e){r.cb&&r.cb(e)})};var v=document.createElement("img");v.className="related-thumbnail-image",v.src="".concat((null==this||null===(t=this.videos)||void 0===t||null===(o=t[e])||void 0===o?void 0:o.img)||(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.fallbackImage)),v.alt="No Thumbnail Available",u.append(v);var p=l.dom.createEl("div",{className:"info -".concat(e),innerHTML:"".concat((null==this||null===(a=this.videos[e])||void 0===a?void 0:a.title)||"")});return l.dom.appendContent(d,u),l.dom.appendContent(d,p),d}},{key:"_refreshList",value:function(){var e=this.el().querySelector(".video-container");if(e){l.dom.emptyEl(e);for(var t=0;t<this.videos.length;t++)l.dom.appendContent(e,this._buildVideoItem(t))}}},{key:"dispose",value:function(){this._unsubRelated&&this._unsubRelated(),function(e,t,n,i){var l=o(a(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof l?function(e){return l.apply(n,e)}:l}(I,"dispose",this,3)([])}},{key:"createEl",value:function(){var e=l.dom.createEl("div",{className:"video-selection vjs-control vjs-button"});e.style.position="unset";var t=l.dom.createEl("div",{className:"video-selector-icon",innerHTML:"".concat(r())});return l.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./videoSelector-8e258d45.js").then(function(e){var t=document.createElement("style");t.id="video-selection",t.append("".concat(e.default)),document.head.appendChild(t)})}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),o=l.dom.createEl("div",{className:"video-selection-container hidden"});l.dom.$(".video-selector-icon",this.el()).onclick=function(){var n;null!==(n=o.classList)&&void 0!==n&&n.contains("hidden")?(u(),o.classList.remove("hidden"),t.classList.add("open"),o.style.right="0px",v(e.playerId,o)):(o.classList.add("hidden"),t.classList.remove("open"),o.style.right="-350px")};var n=document.getElementById(this.playerId);if(n){var i=window.getComputedStyle(n,null).getPropertyValue("height");o.style.height="".concat(i),l.dom.appendContent(t,o),n.style.overflow="hidden",this.addFunctionality(o),p(this.playerId,o)}}},{key:"toggleOpenClose",value:function(){}},{key:"addFunctionality",value:function(e){var t=this,o=this.el(),n=l.dom.createEl("div",{className:"video-selector-head"}),i=l.dom.createEl("div",{className:"video-selector-cross-icon",innerHTML:"".concat(d())});i.onclick=function(){e.classList.add("hidden"),o.classList.remove("open"),e.style.right="-350px"};for(var a=l.dom.createEl("div",{className:"video-selector-title",innerHTML:y("relatedVideoTitle")||"Recommended"}),r=l.dom.createEl("div",{className:"video-selector-content"}),u=l.dom.createEl("div",{className:"video-container"}),v=function(e){var o,n,i,a,d,v=l.dom.createEl("div",{className:"video -".concat(e)}),p=l.dom.createEl("div",{className:"recommended -".concat(e)});p.setAttribute("video-idx",e),p.onclick=function(){c(e+1);for(var o=l.dom.$$(".recommended"),n=0;n<o.length;n++)o[n].style.border="none";m(e),s(t.playerId,t.videos[e].id).then(function(e){t.cb&&t.cb(e)}).catch(function(e){t.cb&&t.cb(e)})};var h=document.createElement("img");h.className="related-thumbnail-image",h.src="".concat((null==t||null===(o=t.videos)||void 0===o||null===(n=o[e])||void 0===n?void 0:n.img)||(null===(i=window)||void 0===i||null===(a=i.customData)||void 0===a?void 0:a.fallbackImage)),h.alt="No Thumbnail Available",p.append(h);var f=l.dom.createEl("div",{className:"info -".concat(e),innerHTML:"".concat((null==t||null===(d=t.videos[e])||void 0===d?void 0:d.title)||"")});l.dom.appendContent(v,p),l.dom.appendContent(v,f),l.dom.appendContent(u,v),l.dom.appendContent(r,u)},p=0;p<this.videos.length;p++)v(p);l.dom.appendContent(n,i),l.dom.appendContent(n,a),l.dom.appendContent(e,n),l.dom.appendContent(e,r),h(this.playerId,e)}}]),I}();export{E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/get";import n from"@babel/runtime/helpers/inherits";import i from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import a from"video.js";import{f as d,g as s}from"./icons-262bef63.js";import{M as r,a0 as c}from"./generic-
|
|
1
|
+
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/get";import n from"@babel/runtime/helpers/inherits";import i from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import a from"video.js";import{f as d,g as s}from"./icons-262bef63.js";import{M as r,a0 as c}from"./generic-cc27a100.js";import{i as m,j as u,s as v,k as p,h,l as b}from"./skin-0abde216.js";import{a as y,u as f}from"./autoNextVideo-de9c7cb3.js";import{g as C}from"./localisation-0bf399a1.js";import{r as g}from"./relatedVideosManager-8dd9aa24.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./browser-de5f6a74.js";import"md5";import"js-cookie";import"./captions-89897207.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/slicedToArray";import"@viewlift/comscore/index.js";import"./index-ce7f6974.js";function E(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(E=function(){return!!e})()}var I=a.getComponent("Component"),N=function(){n(j,I);var N,k,x=(N=j,k=E(),function(){var e,t=l(N);if(k){var o=l(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return i(this,e)});function j(t){var o,n,i,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,j),(i=x.call(this,t,l)).playerId=l.playerId,i.seriesData=l.sres,i.videos=l.related.content,i.cb=(null==l||null===(o=l.related)||void 0===o?void 0:o.cb)||null,i.autoNext=(null==l||null===(n=l.related)||void 0===n?void 0:n.autoNext)||!1,i.currentVideoData=l.res,i.initialiseStructure(),i.loadCSS(),i.autoNext&&(c(0),y({playerId:i.playerId,content:i.videos,cb:i.cb})),i._unsubRelated=g.subscribe(function(e){var t;i.videos=(null==e?void 0:e.content)||i.videos,i.cb=null!==(t=null==e?void 0:e.cb)&&void 0!==t?t:i.cb,f(i.videos),i._refreshList()}),i}return t(j,[{key:"_buildVideoItem",value:function(e){var t,o,n,i,l,d,s,r,c,u=this,v=a.dom.createEl("div",{className:"video -".concat(e)}),p=a.dom.createEl("div",{className:"recommended -".concat(e),ariaLabel:"".concat(this.videos[e].title),type:"button",tabIndex:-1});p.setAttribute("video-idx",e),p.onkeydown=function(t){"Enter"===t.key&&u.loadVideoAssetById(e)},p.onclick=function(){u.loadVideoAssetById(e)};var h=document.createElement("img");h.className="related-thumbnail-image",h.src="".concat(m(null==this||null===(t=this.videos)||void 0===t||null===(o=t[e])||void 0===o?void 0:o.img)||m(null===(n=window)||void 0===n||null===(i=n.app_data)||void 0===i||null===(l=i.appcmsMain)||void 0===l||null===(d=l.images)||void 0===d?void 0:d.placeholderCover)),h.alt="".concat((null==this||null===(s=this.videos[e])||void 0===s||null===(r=s.title)||void 0===r?void 0:r.trim().split(/\s+/).slice(0,2).join(" "))||""),p.append(h);var b=a.dom.createEl("div",{className:"info -".concat(e),innerHTML:"".concat((null==this||null===(c=this.videos[e])||void 0===c?void 0:c.title)||"")});return a.dom.appendContent(v,p),a.dom.appendContent(v,b),v}},{key:"_refreshList",value:function(){var e=this.el().querySelector(".video-container");if(e){a.dom.emptyEl(e);for(var t=0;t<this.videos.length;t++)a.dom.appendContent(e,this._buildVideoItem(t))}}},{key:"dispose",value:function(){this._unsubRelated&&this._unsubRelated(),function(e,t,n,i){var a=o(l(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof a?function(e){return a.apply(n,e)}:a}(j,"dispose",this,3)([])}},{key:"createEl",value:function(){var e=a.dom.createEl("div",{className:"video-selection vjs-control vjs-button"});e.style.position="unset";var t=a.dom.createEl("button",{className:"video-selector-icon",title:"video selector",innerHTML:"".concat(d())});return a.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./videoSelector-def99d5e.js").then(function(e){var t=document.createElement("style");t.id="video-selection",t.append("".concat(e.default)),document.head.appendChild(t)})}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),o=a.dom.createEl("div",{className:"video-selection-container hidden"});a.dom.$(".video-selector-icon",this.el()).onclick=function(){var n;e.handleTabIndexSelector(),null!==(n=o.classList)&&void 0!==n&&n.contains("hidden")?(u(),o.classList.remove("hidden"),t.classList.add("open"),v(e.playerId,o)):(o.classList.add("hidden"),t.classList.remove("open"))};var n=document.getElementById(this.playerId);if(n){var i=window.getComputedStyle(n,null).getPropertyValue("height");o.style.height="".concat(i),a.dom.appendContent(t,o),n.style.overflow="hidden",this.addFunctionality(o),p(this.playerId,o)}}},{key:"loadVideoAssetById",value:function(e){var t=this;c(e+1);for(var o=a.dom.$$(".recommended"),n=0;n<o.length;n++)o[n].style.border="none";h(e),r(this.playerId,this.videos[e].id).then(function(e){t.cb&&t.cb(e)}).catch(function(e){t.cb&&t.cb(e)})}},{key:"handleTabIndexSelector",value:function(){var e,t,o;null!==(e=document.getElementsByClassName("video-selector-cross-icon"))&&void 0!==e&&e[0]&&(document.getElementsByClassName("video-selector-cross-icon")[0].tabIndex=0);for(var n=document.getElementsByClassName("video-accessibility"),i=(null==n||null===(t=n[0])||void 0===t||null===(o=t.children)||void 0===o?void 0:o.length)||0,l=0;l<i;l++)document.getElementsByClassName("recommended -".concat(l))[0]&&(document.getElementsByClassName("recommended -".concat(l))[0].tabIndex=0)}},{key:"handleCloseTabIndex",value:function(){var e,t,o;null!==(e=document.getElementsByClassName("video-selector-cross-icon"))&&void 0!==e&&e[0]&&(document.getElementsByClassName("video-selector-cross-icon")[0].tabIndex=-1);for(var n=document.getElementsByClassName("video-accessibility"),i=(null==n||null===(t=n[0])||void 0===t||null===(o=t.children)||void 0===o?void 0:o.length)||0,l=0;l<i;l++)document.getElementsByClassName("recommended -".concat(l))&&(document.getElementsByClassName("recommended -".concat(l))[0].tabIndex=-1)}},{key:"addFunctionality",value:function(e){var t=this,o=this.el(),n=a.dom.createEl("div",{className:"video-selector-head"}),i=a.dom.createEl("div",{className:"video-selector-cross-icon",ariaLabel:"close video selector",tabIndex:-1,innerHTML:"".concat(s())});i.onkeydown=function(n){"Enter"===n.key&&(e.classList.add("hidden"),o.classList.remove("open"),t.handleCloseTabIndex())},i.onclick=function(){e.classList.add("hidden"),o.classList.remove("open"),t.handleCloseTabIndex()};for(var l=a.dom.createEl("div",{className:"video-selector-title",innerHTML:C("relatedVideoTitle")||"Recommended"}),d=a.dom.createEl("div",{className:"video-selector-content",tabIndex:-1}),r=a.dom.createEl("div",{className:"video-container video-accessibility"}),c=function(e){var o,n,i,l,s,c,u,v,p=a.dom.createEl("div",{className:"video -".concat(e)}),h=a.dom.createEl("div",{className:"recommended -".concat(e),ariaLabel:"".concat(t.videos[e].title),type:"button",tabIndex:-1});h.setAttribute("video-idx",e),h.onkeydown=function(o){"Enter"===o.key&&t.loadVideoAssetById(e)},h.onclick=function(){t.loadVideoAssetById(e)};var b=document.createElement("img");b.className="related-thumbnail-image",b.src="".concat(m(null==t||null===(o=t.videos)||void 0===o||null===(n=o[e])||void 0===n?void 0:n.img)||m(null===(i=window)||void 0===i||null===(l=i.app_data)||void 0===l||null===(s=l.appcmsMain)||void 0===s||null===(c=s.images)||void 0===c?void 0:c.placeholderCover)),b.alt="".concat((null==t||null===(u=t.videos[e])||void 0===u?void 0:u.title.trim().split(/\s+/).slice(0,2).join(" "))||""),h.append(b);var y=a.dom.createEl("div",{className:"info -".concat(e),innerHTML:"".concat((null==t||null===(v=t.videos[e])||void 0===v?void 0:v.title)||"")});a.dom.appendContent(p,h),a.dom.appendContent(p,y),a.dom.appendContent(r,p),a.dom.appendContent(d,r)},u=0;u<this.videos.length;u++)c(u);a.dom.appendContent(n,l),a.dom.appendContent(n,i),a.dom.appendContent(e,n),a.dom.appendContent(e,d),b(this.playerId,e)}}]),j}();export{N as default};
|
package/package.json
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
2
|
+
"name": "@viewlift/player-backup",
|
|
3
|
+
"version": "2.0.293-backup",
|
|
4
|
+
"main": "dist/bundle.cjs.js",
|
|
5
|
+
"types": "dist/@viewlift/player/esm/index.d.ts",
|
|
6
|
+
"amdName": "_playerCore",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"prepublishOnly": "release-assistant"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@silvermine/videojs-airplay": "^1.3.0",
|
|
12
|
+
"@silvermine/videojs-chromecast": "^1.4.1",
|
|
13
|
+
"@viewlift/sse": "^0.0.3",
|
|
14
|
+
"broadcast-channel": "^7.3.0",
|
|
15
|
+
"@viewlift/comscore": "^1.0.18",
|
|
16
|
+
"axios": "^1.2.3",
|
|
17
|
+
"md5": "^2.3.0",
|
|
18
|
+
"ima": "npm:videojs-ima@2.2.0",
|
|
19
|
+
"js-cookie": "^3.0.5",
|
|
20
|
+
"jwt-decode": "^4.0.0",
|
|
21
|
+
"video.js": "8.22.0",
|
|
22
|
+
"videojs-contrib-ads": "7.5.2",
|
|
23
|
+
"videojs-contrib-eme": "5.5.1",
|
|
24
|
+
"videojs-mux": "^4.21.7",
|
|
25
|
+
"videojs-contrib-quality-menu": "^1.0.3"
|
|
26
|
+
},
|
|
27
|
+
"overrides": {
|
|
28
|
+
"min-document": "^2.19.1"
|
|
29
|
+
}
|
|
27
30
|
}
|
package/cjs/generic-5b90c727.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/regenerator"),i=require("video.js"),r=require("axios"),o=require("./skin-e0cf4554.js"),a=require("./browser-3670a923.js"),l=require("md5"),s=require("js-cookie"),d=require("./captions-d98c49d6.js"),u=require("@babel/runtime/helpers/typeof"),c=require("@babel/runtime/helpers/toConsumableArray"),v=require("@babel/runtime/helpers/slicedToArray"),f=require("@viewlift/comscore/index.js"),p=require("@babel/runtime/helpers/classCallCheck"),m=require("@babel/runtime/helpers/createClass");function h(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function g(e,t){h("event",e,t)}var y={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 w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function T(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?w(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):w(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}var _,b=(_={},{setConfig:function(e){_=T(T({},_),e)},getConfig:function(){return _}});function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}var E="asset_not_found",S="geo_blocking_issue",k="entitlement_mismatch",A=[/geo[\s_-]?block/i,/geo[\s_-]?restrict/i,/geographic/i,/not available in your/i,/outside.*(?:region|country|territory)/i,/\bcountry\b/i,/\bterritory\b/i],O=[/entitlement/i,/not entitled/i,/subscription/i,/not subscribed/i,/access denied/i,/\bunauthorized\b/i,/\bforbidden\b/i,/\bpremium\b/i,/upgrade required/i],P=[/not found/i,/no content/i,/does not exist/i,/\bmissing\b/i],D=function(t,n,i){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=function(){var e,t,n,i,r=b.getConfig()||{};return(null==r?void 0:r.apiErrorCb)||(null==r?void 0:r.onApiError)||(null==r||null===(e=r.customData)||void 0===e?void 0:e.apiErrorCb)||(null==r||null===(t=r.customData)||void 0===t?void 0:t.onApiError)||(null==r||null===(n=r.customData)||void 0===n||null===(i=n.callbacks)||void 0===i?void 0:i.onApiError)||null}();if("function"==typeof a){var l=(null==n||null===(r=n.response)||void 0===r?void 0:r.status)||(null==n?void 0:n.status)||"unknown",s=function(e){var t,n,i,r,o;return(null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.errorMessage)||(null==e||null===(i=e.response)||void 0===i||null===(r=i.data)||void 0===r?void 0:r.message)||(null==e||null===(o=e.response)||void 0===o?void 0:o.statusText)||(null==e?void 0:e.message)||"unknown_error"}(n),d=function(e,t){var n=Number(e),i=String(t||"");return A.some(function(e){return e.test(i)})?S:O.some(function(e){return e.test(i)})?k:P.some(function(e){return e.test(i)})||404===n?E:451===n?S:k}(l,s),u=function(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?I(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):I(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}({errorcode:l,errormessage:s,errorcategory:i||d},o);t&&(u.apiPath=t);try{console.log("emitApiErrorEvent"),a(d,u)}catch(e){console.warn("[VLPlayer] apiError callback failed:",e)}}};function L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function C(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?L(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):L(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}var F={name:"@viewlift/player",version:"2.1.47",main:"dist/bundle.cjs.js",types:"dist/@viewlift/player/esm/index.d.ts",amdName:"_playerCore",scripts:{prepublishOnly:"release-assistant"},dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1","@viewlift/sse":"^0.0.3","broadcast-channel":"^7.3.0","@viewlift/comscore":"^1.0.18",axios:"^1.2.3",md5:"^2.3.0",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","jwt-decode":"^4.0.0","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=F.version;var x,j=function(){var e,t,n,i;return null!==(e=window)&&void 0!==e&&null!==(t=e.customData)&&void 0!==t&&t.overrideEntitlementBaseUrl?(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementBaseUrl)+"/video/status":M.get()+"".concat(null==y?void 0:y.getVideoDetails)},R=function(e,t){var n,i,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.overrideEntitlementResponse)return new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})});var a,l,s,d,u=j();return r({url:j(),params:C({id:e,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:o},null===(a=window)||void 0===a||null===(l=a.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:t,"Sdk-Version":F.version,"x-player-name":"videojs",adbTempToken:null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d?void 0:d.adbTempToken},withCredentials:!0}).catch(function(t){throw D(u,t,"content",{id:e}),t})},V=function(e,t){var n,i,o,a,l,s,d=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.overrideEntitlementResponse)return new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})});var u=M.get()+y.getLinearChannelDetails;return r({url:u,params:C(C(C(C(C({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:d},(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===(o=window)||void 0===o||null===(a=o.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:t,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO",adbTempToken:null===(l=window)||void 0===l||null===(s=l.customData)||void 0===s?void 0:s.adbTempToken}}).catch(function(t){throw D(u,t,"content",{id:null==e?void 0:e.id,channelId:null==e?void 0:e.channelId,programId:null==e?void 0:e.programId}),t})},N=function(){var e=t(n.mark(function e(t){var i;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ee();case 2:return i=e.sent,e.abrupt("return",r({url:M.get()+"".concat(null==y?void 0:y.saveWatchHistoryV2),method:"POST",headers:{Authorization:i},data:C({},t),params:C({},(null==t?void 0:t.profileId)&&{profileId:null==t?void 0:t.profileId})}).catch(function(e){throw D("saveWatchHistory",e,"content",{videoId:null==t?void 0:t.videoId,profileId:null==t?void 0:t.profileId}),e}));case 4:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),W=function(e,t){var n,i,o=window.contentType,a=M.get()+"".concat(null==y?void 0:y.getVideoInfoV2,"/").concat(o,"/").concat(e);return r({method:"GET",url:a,headers:{Authorization:t,"x-api-key":null===(n=window)||void 0===n||null===(i=n.watchHistory)||void 0===i?void 0:i.xApiKey},timeout:15e3}).catch(function(t){throw D(a,t,"content",{videoId:e,contentType:o}),t})},U=function(e){var t=e.videoId,n=M.get()+"".concat(null==y?void 0:y.getSeriesWatchHistoryV2,"/").concat(t);return r({method:"GET",url:n,headers:{Authorization:e.token},timeout:15e3}).catch(function(i){throw D(n,i,"content",{seriesId:t,videoId:null==e?void 0:e.videoId}),i})},M=(x=null==y?void 0:y.apiBaseUrl,{set:function(e){e&&(x=e)},get:function(){return x}}),B=function(e){var t=JSON.parse(atob(null==e?void 0:e.split(".")[1])),n=null==t?void 0:t.exp;if(new Date(1e3*n).getTime()<(new Date).getTime())return!0},H=null;function q(){return{set:function(e){e&&(H=e)},get:function(){return H}}}var G,z,Q,Y,K,X,J,$=function(){var e=t(n.mark(function e(){var t,i,o;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=q().get(),i=M.get(),e.prev=2,e.next=5,r({method:"GET",url:"".concat(i,"/identity/refresh/").concat(t)});case 5:return o=e.sent,e.abrupt("return",o);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)}}(),Z=null,ee=function(){var e=t(n.mark(function e(){var t;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=sessionStorage.getItem("vlp_token"))||!B(t)){e.next=6;break}return Z||(Z=$().then(function(e){var n,i,r=null==e||null===(n=e.data)||void 0===n?void 0:n.authorizationToken,o=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return r&&sessionStorage.setItem("vlp_token",r),o&&q().set(o),r||t}).catch(function(e){return console.error("Error fetching refresh token",e),t}).finally(function(){Z=null})),e.abrupt("return",Z);case 6:return e.abrupt("return",t);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),te=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},ne=(X=new Map,{set:function(e){var t,n=(null==e||null===(t=e.video)||void 0===t?void 0:t.id)||e||null;X.set(n,(X.get(n)||0)+1)},get:function(e){return X.get(e)},clear:function(){X.clear()}}),ie=function(e){z=e},re=function(){return z},oe=function(){return G},ae=function(e){Q=e},le=function(e){if(Y){var t=Y.get(e);ae(t+1)}},se=(J=0,{set:function(e){e>=0&&(J=e)},get:function(){return J}});function de(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function ue(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?de(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):de(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}var ce=0,ve=null,fe=function(){var e,t,n,i,r,o,a,l=re();return"linearchannel"==((null==l?void 0:l.contentType)||"video")?null==l||null===(e=l.linearchannel)||void 0===e||null===(t=e.channels)||void 0===t||null===(n=t.find(function(e){return(null==e?void 0:e.id)===(null==l?void 0:l.channelId)}))||void 0===n||null===(i=n.content)||void 0===i?void 0:i.id:(null==l||null===(r=l.video)||void 0===r||null===(o=r.gist)||void 0===o?void 0:o.id)||(null==l||null===(a=l.video)||void 0===a?void 0:a.id)||(null==l?void 0:l.id)};function pe(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function me(){return ve||window.sessionStorage.getItem("uid")}function he(){return ge.apply(this,arguments)}function ge(){return(ge=t(n.mark(function e(){var t,i;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ee();case 2:if(!(t=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ye(e){return e?String(e):""}window.initialise=function(e){window.sid=pe(),window.environment="production",window.platform="WEBSITE",window.failedToStartTimer=null,window.droppedStreamTimer=null,window.firstFrameFired=!1,streamFailures(e),buffering(e),ads(e),ping(e)},window.cleanupTimers=function(){clearInterval(window.bufferingTimer),clearInterval(window.ttFirstFrameTimer),clearTimeout(window.failedToStartTimer),clearTimeout(window.droppedStreamTimer),window.failedToStartTimer=null,window.droppedStreamTimer=null},window.fireStreamFailure=function(e){var t,n,i,r=o.getPlayer(),a=null!=r&&r.el_?Math.floor(r.currentTime()):0;window.cleanupTimers(),g(e,ue({pfm:window.platform,uid:me(),vid:fe(),videoPosition:a},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:e,videoPosition:a,isAdEvent:!1})},window.streamFailures=function(e){e.on("error",function(){var e=window.firstFrameFired?"DROPPED_STREAM":"FAILED_TO_START";window.fireStreamFailure(e)})},window.firstFrame=function(e,t,n){e.one("play",tryCatch(function(){var i,r,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),window.failedToStartTimer=setTimeout(function(){window.firstFrameFired||window.fireStreamFailure("FAILED_TO_START")},3e4),g("PLAY",ue({pfm:window.platform,uid:me(),vid:fe(),videoPosition:Math.floor(e.currentTime())},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(o=r.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),t&&t("started_video_playback",ue({"Video ID":fe(),watchTime:Math.floor(e.currentTime())},n))}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:(clearInterval(window.bufferingTimer),clearTimeout(window.droppedStreamTimer),window.droppedStreamTimer=null)},100),window.firstFrameFired&&(clearTimeout(window.droppedStreamTimer),window.droppedStreamTimer=setTimeout(function(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()&&window.fireStreamFailure("DROPPED_STREAM")},45e3)))}))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var r,o,a,l=e+.1;if(+l.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting")&&ce<4)ce++,g("BUFFERING",ue({pfm:window.platform,uid:me(),vid:fe(),videoPosition:t.el_&&Math.floor(t.currentTime())},null===(r=window)||void 0===r||null===(o=r.customData)||void 0===o||null===(a=o.beacon)||void 0===a?void 0:a.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return l}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),clearTimeout(window.failedToStartTimer),window.failedToStartTimer=null,window.firstFrameFired=!0,window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,g("FIRST_FRAME",ue({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:me(),vid:fe()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.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 t,n,i,r,o,a;g("AD_REQUEST",ue({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:me(),vid:fe(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),g("AD_IMPRESSION",ue({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:me(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:fe()},null===(r=window)||void 0===r||null===(o=r.customData)||void 0===o||null===(a=o.beacon)||void 0===a?void 0:a.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})})};var we=function(e,t,n){var i;fireEvent({eventName:"PING",videoPosition:t,isAdEvent:!1,duration:n,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:(null===(i=e.tech_)||void 0===i?void 0:i.vhs)&&window.getBitrate(e)})};window.fireExitPing=function(e){if(!window.isAdPlaying){var t=null!=e&&e.el_?Math.floor(e.currentTime()):0;t<=0||we(e,t,t)}},window.ping=function(e){var t=[];e.on("dispose",tryCatch(function(){console.log('Player DISPOSED >> "dispose" event fired >>> firing exit PING'),window.fireExitPing(e)})),e.on("timeupdate",function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(ce=0,t.push(n),we(e,n,30))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),r=0;r<i.length;r++){var o=i.start(r),a=i.end(r);if(Te(t,o,a)){var l=Math.round(n-a);if(isFinite(l))return l}}})()};var Te=function(e,t,n){return e>=t&&e<=n},_e=function(){var e,t=re(),n=(null==t?void 0:t.contentType)||"video";return(null==t||null===(e=t[n])||void 0===e?void 0:e.network)||null};window.fireEvent=function(){var e=t(n.mark(function e(t){var i,o,l,s,d,u,c,v,f,p,m,h,g,w,T,_,b,I,E,S,k;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!a.isBotUserAgent()){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,ee();case 4:return b=e.sent,I=te(b),E=null==I?void 0:I.site,S=null==I?void 0:I.siteId,e.t0=ue,e.t1=ue,e.t2=ue({aid:E,cid:S,pfm:window.platform},null===(i=window)||void 0===i||null===(o=i.customData)||void 0===o||null===(l=o.beacon)||void 0===l?void 0:l.params),e.t3={},e.t4=me(),e.t5=fe(),e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=null!==(s=t.videoPosition)&&void 0!==s?s:null,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:null,e.t17=!0===t.isAdEvent?ye(t.adPosition):"",e.next=28,he();case 28:e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=null!==(d=t.ttFirstFrame)&&void 0!==d?d:null,e.t23=null!==(u=t.bitrate)&&void 0!==u?u:null,e.t24=null!==(c=t.resHeight)&&void 0!==c?c:null,e.t25=null!==(v=t.resWidth)&&void 0!==v?v:null,e.t26=null!==(f=t.bufferHealth)&&void 0!==f?f:null,e.t27=null!==(p=_e())&&void 0!==p?p:null,e.t28=null!=E?E: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==t?void 0:t.duration)&&{duration:t.duration},e.t31=(0,e.t1)(e.t2,e.t3,e.t29,e.t30),e.t32=null===(m=window)||void 0===m||null===(h=m.customData)||void 0===h||null===(g=h.beacon)||void 0===g?void 0:g.params,e.t33=(0,e.t0)(e.t31,e.t32),k=[e.t33],r({url:(null===(w=window)||void 0===w||null===(T=w.customData)||void 0===T||null===(_=T.beacon)||void 0===_?void 0:_.url)||M.get()+y.getBeaconUrl,method:"post",headers:{Authorization:b},contentType:"application/x-www-form-urlencoded",dataType:"text",data:k}).catch(function(e){console.error(e)});case 46:case"end":return e.stop()}},e)}));return function(t){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 be=function(){var e=se.get();return e>=0?e+1:1},Ie=function(){var e,t,n,i=oe(),r=re(),o=null==r||null===(e=r.video)||void 0===e?void 0:e.id,a=se.get(),l=null==i||null===(t=i[a])||void 0===t||null===(n=t.episodes)||void 0===n?void 0:n.findIndex(function(e){return(null==e?void 0:e.id)===o});return l>=0?l+1:1};function Ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function Se(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?Ee(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ee(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}var ke=l,Ae=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},Oe=function(e){var t=Pe(e,"video.tags",[]),n=Pe(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map(function(e){return e.title}).join(","):n},Pe=function(e,t,n){for(var i=0,r=(t=t.split(".")).length;i<r;i++){var o;e=null===(o=e)||void 0===o?void 0:o[t[i]]}return e||n},De=function(){var e,t,n,i,r,a,l,d,u,c,v,f,p,m,h,g,y,w,T,_,b,I,E,S,k,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",O=arguments.length>1?arguments[1]:void 0,P=arguments.length>2?arguments[2]:void 0;if(null!==(e=window)&&void 0!==e&&null!==(t=e.customData)&&void 0!==t&&t.disableMacros)return A;var D=(null==P?void 0:P.siteName)||(null==P?void 0:P.site)||"",L=(null==P?void 0:P.contentType)||"video",C=(null==P||null===(n=P[L])||void 0===n?void 0:n.metadata)||(null==P||null===(i=P[L])||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.metadata),F=o.getPlayer(O);if(!A.includes("VIEWLIFT_"))return A;var x,j=window.getComputedStyle(document.getElementById(O),null),R=Math.trunc(j.getPropertyValue("height").slice(0,-2)),V=Math.trunc(j.getPropertyValue("width").slice(0,-2)),N="linearchannel"===L?null==P||null===(a=P.linearchannel)||void 0===a||null===(l=a.channels)||void 0===l||null===(d=l.find(function(e){return(null==e?void 0:e.id)===(null==P?void 0:P.channelId)}))||void 0===d||null===(u=d.content)||void 0===u?void 0:u.id:Pe(P,"video.gist.id",""),W="linearchannel"===L?null==P||null===(c=P.linearchannel)||void 0===c||null===(v=c.channels)||void 0===v||null===(f=v.find(function(e){return(null==e?void 0:e.id)===(null==P?void 0:P.channelId)}))||void 0===f?void 0:f.title:Pe(P,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),U=null,M=null;"function"==typeof window.__gpp&&(null===(x=window)||void 0===x||x.__gpp("ping",function(e){U=null==e?void 0:e.gppString,M=null==e?void 0:e.sectionList[0]}));var B=s.get("us_privacy")||s.get("usprivacy"),H=void 0!==B?B:"1YNN",q=null!==(p=null===(m=JSON.parse(localStorage.getItem("selectedMvpdProvider")||"{}"))||void 0===m?void 0:m.fwIdentifier)&&void 0!==p?p:null,G=Se(Se({},Le(C)),{},{VIEWLIFT_WIDTH:V,VIEWLIFT_HEIGHT:R,VIEWLIFT_SIZE:Ae(V,R),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===(h=window)||void 0===h?void 0:h.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:Pe(P,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:Pe(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:Pe(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==F||null===(g=F.options_)||void 0===g?void 0:g.autoplay)||1,VIEWLIFT_MUTE:(null==F||null===(y=F.options_)||void 0===y?void 0:y.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==D||"usanetwork"==D||"golfchannel"==D?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:Oe(P),VIEWLIFT_MEDIA_ID:N,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(Pe(P,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:N,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+Pe(P,"video.gist.permalink","")),VIEWLIFT_CONSENT:s.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:Pe(null===(w=window)||void 0===w||null===(T=w.app_data)||void 0===T||null===(_=T.site)||void 0===_?void 0:_.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_ROKU_AD_ID:"",VIEWLIFT_ROKU_AD_KEYS:"",VIEWLIFT_RDID:"",VIEWLIFT_GDPR:"spinco"==D||"usanetwork"==D||"golfchannel"==D?"":Pe(null===(b=window)||void 0===b||null===(I=b.app_data)||void 0===I||null===(E=I.site)||void 0===E?void 0:E.settings,"compliance.gdpr")?1:0,VIEWLIFT_US_PRIVACY:H,VIEWLIFT_TVE_PROVIDER:q?ke(q):"",VIEWLIFT_CONTENT_DURATION_MS:1e3*Pe(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:Pe(P,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:N,VIEWLIFT_CONTENT_TITLE:W,VIEWLIFT_CONTENT_SERIES_TITLE:Pe(P,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:Pe(P,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:Ie(),VIEWLIFT_SEASON_NUMBER:be(),VIEWLIFT_CONTENT_TAGS:Oe(P),VIEWLIFT_GPP_SID:M||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:U||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:"",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:""},null===(S=window)||void 0===S||null===(k=S.customData)||void 0===k?void 0:k.macros);for(var z in G){var Q=new RegExp(z,"g");A=A.replace(Q,G[z])}return A},Le=function(e){var t,n,i,r,o,l,s,d,u,c={},v=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){v.set(e.name,e.value)}));var f=(null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.subscription)||void 0===i?void 0:i.SVOD)||!1,p=(null===(r=window)||void 0===r||null===(o=r.customData)||void 0===o||null===(l=o.subscription)||void 0===l?void 0:l.TVE)||!1;return f||p?(a.isMobile()?f?c=Se(Se({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.dtc")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.dtc.csai")||""}):p&&(c=Se(Se({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.tve")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.tve.csai")||""})):f?c=Se(Se({},c),{},{VIEWLIFT_CSID:v.get("csid.web.dtc")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.dtc.csai")||""}):p&&(c=Se(Se({},c),{},{VIEWLIFT_CSID:v.get("csid.web.tve")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.tve.csai")||""})),f?c=Se(Se({},c),{},{VIEWLIFT_SFID:v.get("sfid.dtc")||v.get("sfid.web.dtc")||"",VIEWLIFT_SFID_CSAI:v.get(a.isMobile()?"sfid.mweb.dtc.csai":"sfid.web.dtc.csai")||""}):p&&(c=Se(Se({},c),{},{VIEWLIFT_SFID:v.get("sfid.tve")||v.get("sfid.web.tve")||"",VIEWLIFT_SFID_CSAI:v.get(a.isMobile()?"sfid.mweb.tve.csai":"sfid.web.tve.csai")||""})),c=a.isMobile()?Se(Se({},c),{},{VIEWLIFT_PROF:v.get("prof.mweb")||"",VIEWLIFT_PROF_CSAI:v.get("prof.mweb.csai")||""}):Se(Se({},c),{},{VIEWLIFT_PROF:v.get("prof.web")||"",VIEWLIFT_PROF_CSAI:v.get("prof.web.csai")||""})):(c=Se(Se({},c),{},{VIEWLIFT_SFID:v.get("sfid.dtc")||v.get("sfid.web.dtc")||"",VIEWLIFT_SFID_CSAI:v.get(a.isMobile()?"sfid.mweb.dtc.csai":"sfid.web.dtc.csai")||""}),c=a.isMobile()?Se(Se({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:v.get("prof.mweb")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.dtc.csai")||"",VIEWLIFT_PROF_CSAI:v.get("prof.mweb.csai")||""}):Se(Se({},c),{},{VIEWLIFT_CSID:v.get("csid.web.dtc")||"",VIEWLIFT_PROF:v.get("prof.web")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.dtc.csai")||"",VIEWLIFT_PROF_CSAI:v.get("prof.web.csai")||""})),c=Se(Se({},c),{},{VIEWLIFT_AFID:v.get("afid"),VIEWLIFT_NIELSEN_APP_ID:Pe(null===(s=window)||void 0===s||null===(d=s.app_data)||void 0===d||null===(u=d.appcmsMain)||void 0===u?void 0:u.analytics,"nielsen.id")||v.get("VIEWLIFT_NIELSEN_APP_ID")||"",VIEWLIFT_CHANNEL:v.get("VIEWLIFT_CHANNEL")||"",VIEWLIFT_GRACE_NOTE_ID:v.get("VIEWLIFT_GRACE_NOTE_ID")||"",VIEWLIFT_EXTERNAL_AD_ID:v.get("VIEWLIFT_EXTERNAL_AD_ID")||""})},Ce=function(e,t){var n,i,r,o,l,s,d,u,c,v,f,p,m,h=(null==e?void 0:e.contentType)||"video",g=null==e||null===(n=e[h])||void 0===n?void 0:n.drmEnabled,y=null==e||null===(i=e[h])||void 0===i||null===(r=i.streamingInfo)||void 0===r?void 0:r.videoAssets,w=null==e||null===(o=e[h])||void 0===o||null===(l=o.streamingInfo)||void 0===l?void 0:l.audioAssets,T=(null==e||null===(s=e[h])||void 0===s||null===(d=s.streamingInfo)||void 0===d||null===(u=d.videoAssets)||void 0===u?void 0:u.hls)||!1;null==e||null===(c=e[h])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var _=(null==e||null===(f=e[h])||void 0===f||null===(p=f.streamingInfo)||void 0===p||null===(m=p.videoAssets)||void 0===m?void 0:m.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=w&&w.hls)return xe(w);if(g){var b=je(y,t);return b.src=De(b.src,t,e),b}if("Safari"!==a.detectBrowser()&&_)return Fe(y);if(T){var I=xe(y);return I.src=De(I.src,t,e),I}if(null!=y&&y.mpeg){var E=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(y);return E.src=De(E.src,t,e),E}return null},Fe=function(e){var t=null==e?void 0:e.dash;return t?{src:t,type:"application/dash+xml"}:null},xe=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},je=function(e,t){var n=(null==e?void 0:e.drmProvider)||null,r=e.fairPlayCmaf||e.fairPlay,l=e.widevine,s=e.playReady,d=a.detectBrowser();if(o.getPlayer(t),"Safari"===d){var u=function(e){var t=e.url;return{src:t,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(t,n){var r={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};i.xhr(r,function(e,t,i){console.log(e),e&&n(e),n(null,new Uint8Array(i))})},getContentId:function(e,t){if(t){var n=t.indexOf("\0")+1;return t.slice(n)}},getLicense:function(t,n,r,o){var a={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:r,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};i.xhr(a,function(e,t,n){console.log(e),e&&o(e),o(null,n)})}}}}}(r);return Re(t),u}var c,v={src:l.url,type:"application/dash+xml"};return"caliente"==(null===(c=window)||void 0===c?void 0:c.siteName)?(Re(t),v.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==s?void 0:s.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==s?void 0:s.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==n?(v.keySystemOptions=[],v.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),v.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==s?void 0:s.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})):(v.keySystemOptions=[],v.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),v.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==s?void 0:s.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==s?void 0:s.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),v};var Re=function(e){var t=o.getPlayer(e);if("function"==typeof t.eme)try{t.eme(),"Safari"==a.detectBrowser()&&t.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},Ve=function(e,t){if(Promise.resolve().then(function(){return require("./error-26d5a3c3.js")}).then(function(e){var t=document.createElement("style");t.id="errorblock",t.append("".concat(e.default)),document.head.appendChild(t)}),document.getElementsByClassName("error-container")[0]){var n=document.getElementsByClassName("error-message")[0];n&&(n.innerHTML="".concat(t))}else{var i=document.getElementById(e);if(i){var r=document.createElement("div");r.className="error-container";var o=document.createElement("div");o.className="error-message",o.innerHTML="".concat(t),r.appendChild(o),i.append(r)}}},Ne=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var We=!1,Ue=function(e,t,n){var i=De(t,e,n),r=o.getPlayer(e);if(t&&window.google){if("function"!=typeof r.ima&&"object"!==u(r.ima))return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,t){var n,i,r,a=o.getPlayer(e);if(null!==a.el_){We=!0;var l={id:e,adTagUrl:"".concat(t),adLabel:"Your video will resume after this sponsor message"};a.ima.initializeAdDisplayContainer&&a.ima.initializeAdDisplayContainer(),We&&null!==a.el_&&("function"==typeof a.ima?a.ima(l):setTimeout(function(){a.ima.setContentWithAdTag(null,t,!0),a.ima.requestAds()},1e3));var s=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&s.hasAttribute("controls")&&s.removeAttribute("controls");var d="click",u=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(u=!0,d="touchend"),a.one(d,function(){u&&a.ima.initializeAdDisplayContainer()});var c=(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(r=i.ads)||void 0===r?void 0:r.adEventHandler)||null;a.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),a.one("ads-manager",function(e){var t=e.adsManager;t.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})}),t.addEventListener(google.ima.AdEvent.Type.LOADED,function(e){c&&c({status:"LOADED",msg:"Advertisement Loaded",data:e})})}),a.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,i)}};var Me,Be=(Me=!0,{enable:function(){Me=!0},disable:function(){Me=!1},get enabled(){return Me}}),He="ssai-breakStart",qe="ssai-adImpression",Ge="ssai-firstQuartile",ze="ssai-midpoint",Qe="ssai-thirdQuartile",Ye="ssai-complete",Ke="ssai-breakEnd",Xe={breakStart:He,impression:qe,firstQuartile:Ge,midpoint:ze,thirdQuartile:Qe,complete:Ye,breakEnd:Ke};function Je(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=o.getPlayer(e);if(!n)return console.error("[SSAI] Player instance not found"),{};var i=t.eventType,r=Xe[i];r&&n.trigger(r,t)}function $e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function Ze(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?$e(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):$e(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}var et,tt=(et={},{get:function(){return et},set:function(e){et=e}});function nt(e,t){var n,i,r,a,l,s,d,u,c,v,p,m,h,g,y,w,T,_,b,I,E,S=null==e?void 0:e.playerId,k=o.getPlayer(S);if(null!=e&&null!==(n=e.comscore)&&void 0!==n&&n.enable){var A=re(),O=(null==A||null===(i=A.video)||void 0===i?void 0:i.metadata)||[],P=(null==O?void 0:O.length)&&O.filter(function(e){return"advertisingGenre"===e.name});if(null!==(r=P)&&void 0!==r&&r.length){var D=P.map(function(e){return e.value});P=null==D?void 0:D.join(",")}f.destroyComscoreTag();var L,C,F,x=null===(a=window)||void 0===a?void 0:a.lcProgrammeDetails,j=Array.isArray(null==x?void 0:x.category)?null==x||null===(l=x.category)||void 0===l?void 0:l.join(","):(null==x?void 0:x.category)||null,R=Ze(Ze(Ze({},null==A?void 0:A.video),null==A?void 0:A.linearchannel),{},{siteName:(null==e||null===(s=e.comscore)||void 0===s?void 0:s.applicationName)||(null==e||null===(d=e.comscore)||void 0===d||null===(u=d.metadata)||void 0===u?void 0:u.siteName)||(null==A?void 0:A.site)||null,programId:(null==x?void 0:x.videotmsid)||null,programTitle:(null==x?void 0:x.lcProgrammeName)||null,episodeId:(null==x?void 0:x.videotmsid)||null,seasonNumber:(null==A||null===(c=A.video)||void 0===c||null===(v=c.series)||void 0===v?void 0:v.seasonNumber)||(null==x||null===(p=x.seriesDetails)||void 0===p?void 0:p.season)||null,episodeNumber:(null==A||null===(m=A.video)||void 0===m||null===(h=m.series)||void 0===h?void 0:h.episodeNumber)||(null==x||null===(g=x.seriesDetails)||void 0===g?void 0:g.episode)||null,episodeTitle:(null==x?void 0:x.lcSubTitle)||null,isCompleteEpisode:!!(null!=A&&null!==(y=A.video)&&void 0!==y&&y.series||null!=x&&null!==(w=x.seriesDetails)&&void 0!==w&&w.episode),genre:P||j,comscoreConfig:{implementationId:(null==e||null===(T=e.comscore)||void 0===T?void 0:T.implementationId)||null,projectId:(null==e||null===(_=e.comscore)||void 0===_?void 0:_.projectId)||null}}),V=null==e||null===(b=e.comscore)||void 0===b||null===(I=b.metadata)||void 0===I?void 0:I.contentType;if(null!=R&&null!==(E=R.streamingInfo)&&void 0!==E&&E.isLiveStream?R.contentType="Live":R.contentType=V||"LongFormOnDemand",null==R||!R.network){var N,W=(null==R?void 0:R.metadata)||[],U=null==W||null===(N=W.find(function(e){return"network"===e.name}))||void 0===N?void 0:N.value;R.network=U||null}null!=R&&R.network&&null!=R&&R.genre&&(R.customGenre="".concat(R.network,"_").concat((null==R?void 0:R.programTitle)||(L=R,null!=L&&L.series?null==L||null===(F=L.series)||void 0===F?void 0:F.title:null==L||null===(C=L.gist)||void 0===C?void 0:C.title),"_").concat(R.genre)),null!=x&&x.airDate&&(R.publishDate=x.airDate),null!=R&&R.runtime&&"function"==typeof k.duration&&(R.runtime=1e3*Math.ceil(k.duration()));var M=f.formulateComscorePayload(R,k);console.log("comscoreOptions player data",M),f.createComscoreStreamingTag(Ze({playerName:"Video.js"},M)),f.setComscorePlayerInstance(k)}}function it(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function rt(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?it(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):it(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function ot(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return at(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?at(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},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 o,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}function at(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}var lt,st=function(){var e="";return{set:function(t){t&&(e=t)},get:function(){return e}}}(),dt=(lt=null,{set:function(e){lt=e},get position(){return lt}});function ut(e,t){return ct.apply(this,arguments)}function ct(){return(ct=t(n.mark(function e(t,i){var r,a,l,s,d,u,c,f,p,m,h,g,y,w,T,_,b,I;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o.getPlayer(t),l=Ce(i,t),s=l.src,d=(null==i?void 0:i.contentType)||"video",null==i||null===(r=i[d])||void 0===r||null===(a=r.streamingInfo)||void 0===a||a.isLiveStream,u=s.replace("/dash/","/session/").replace("/master/","/session/"),u=De(u,t,i),c=ft(u),f=v(c,2),p=f[0],m=f[1],h=vt(m)||{},u=new URL(u.split("?")[0]),Object.keys(m).length>0&&Object.entries(m).forEach(function(e){var t=v(e,2),n=t[0],i=t[1];u.searchParams.set(n,i)}),e.prev=11,e.next=14,fetch(u,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(rt({adsParams:rt({},p)},h))});case 14:return g=e.sent,e.next=17,g.json();case 17:return y=e.sent,w="https://"+new URL(u).hostname,T=y.trackingUrl,_=y.manifestUrl,b=w+T,I=w+_,st.set(b),console.log("%c TRACKING URL","background: #bdf369; color: #000",b),l.src=I,e.abrupt("return",l);case 29:return e.prev=29,e.t0=e.catch(11),e.abrupt("return",l);case 32:case"end":return e.stop()}},e,null,[[11,29]])}))).apply(this,arguments)}function vt(e){var t;return Object.fromEntries(null==Object||null===(t=Object.entries(e))||void 0===t?void 0:t.map(function(e){var t=v(e,2),n=t[0],i=t[1];return[null==n?void 0:n.replace(/^aws\./,""),String(i)]}))||{}}function ft(e){var t={};if(!e.split("?")[1])return[{},{}];var n,i=new URL(e,window.location.origin),r=ot((null==i?void 0:i.searchParams)||[]);try{for(r.s();!(n=r.n()).done;){var o=v(n.value,2),a=o[0],l=o[1];t[decodeURIComponent(a)]=decodeURIComponent(l||"")}}catch(e){r.e(e)}finally{r.f()}for(var s={},d={},u=0,c=Object.entries(t);u<c.length;u++){var f=v(c[u],2),p=f[0],m=f[1];if(p.startsWith("ads."))s[p.replace(/^ads\./,"")]=m;else d[p]=m}return[s,d]}var pt,mt,ht,gt=new Map;function yt(e,t){return wt.apply(this,arguments)}function wt(){return wt=t(n.mark(function e(i,r){var a,l,s,d,u,v,f,p,m,h,g,y,w,T,_,b,I,E,S,k,A,O,P,D,L;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:L=function(e,t,n,r,a,l){var s,d,u=o.getPlayer(i);if(!u.seeking()){var c=t.startTimeInSeconds;t.durationInSeconds,e<P&&O.clear(),P=e;var v=(null==t||null===(s=t.ads)||void 0===s||null===(d=s[r])||void 0===d?void 0:d.adId)||c;Math.floor(u.currentTime());var f,p=ot(n);try{var m=function(){var n,o,s,d=f.value,c=d.eventType,p=d.beaconUrls,m=d.startTimeInSeconds,h=d.startTime,g=d.durationInSeconds,y=m||0,w=p,T=(null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o||null===(s=o.ads)||void 0===s?void 0:s.adEventHandler)||null,_="".concat(y,"_").concat(c),b=gt.get("pod-".concat(a))||[];if(console.warn(e,y,"map:",c,"condition1:",e>=y,"map:",gt),e>=y&&!b.includes(_)){b.push(_),gt.set("pod-".concat(a),b);try{D(c,t,w,u)}catch(e){console.error("Error when calling triggerAdBeacon:",e,c,t)}if("breakEnd"==c){var I=dt.position;dt.set(null),setTimeout(function(){null!=I&&(u.currentTime(I),l())},500)}if("function"==typeof T)try{var E,S={eventType:c,startTimeInSeconds:m,startTime:h,durationInSeconds:g,ad:null==t||null===(E=t.ads)||void 0===E?void 0:E[r],adIndex:r};T({adsData:S}),Je(i,S)}catch(e){console.error("Error when calling ads callback:",e)}var k=tt.get();if(k&&0!==Object.keys(k).length){var A=k.formulateComscoreAdPayload,P=k.startComscoreAdTracking,L=k.finishComscoreAdTracking,C=k.endComscoreAdTracking,F="".concat(y,"_").concat(v,"_").concat(c);if(!O.has(F))if(O.set(F,!0),"impression"===c){var x,j=st.get();P(A(rt(rt({},null==t||null===(x=t.ads)||void 0===x?void 0:x[r]),{},{trackingUrl:j})))}else"complete"===c?L():"breakEnd"===c&&C()}}};for(p.s();!(f=p.n()).done;)m()}catch(e){p.e(e)}finally{p.f()}}},D=function(e,t,n,i){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(i.currentTime())),"AD_POD:",t),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(i.currentTime())),"AD_POD:",t),null==n||n.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(t){console.warn("Beacon failed:",e,t)})})},A=function(e){var t=Math.floor(e/60),n=Math.floor(e%60);return"".concat(t,":").concat(n.toString().padStart(2,"0"))},gt.clear(),dt.set(r),m=st.get(),(h=o.getPlayer(i)).one("loadeddata",function(){m&&k(m)}),g=new Map,y=new Map,w=-1,T=(null===(a=document)||void 0===a||null===(l=a.getElementsByClassName("tvProviderImage"))||void 0===l?void 0:l[0])||null,_=(null==h||null===(s=h.controlBar)||void 0===s?void 0:s.getChild("videoSelector"))||null,b=(null==h||null===(d=h.controlBar)||void 0===d?void 0:d.getChild("seriesV2"))||null,I=(null==h||null===(u=h.el())||void 0===u||null===(v=u.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===v?void 0:v[0])||null,E=(null==h||null===(f=h.el())||void 0===f||null===(p=f.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===p?void 0:p[0])||null,S=function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==n?void 0:n.length))return c(i);var r=[],o=null==i?void 0:i.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),a=(null==o||null===(e=o.beaconUrls)||void 0===e?void 0:e.find(function(e){return e.includes("videoView")}))||null,l=(null==n?void 0:n.length)>1?null==n?void 0:n[(null==n?void 0:n.length)-1]:null==n?void 0:n[0],s=null==l||null===(t=l.trackingEvents)||void 0===t?void 0:t.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),d=(null==s?void 0:s.some(function(e){var t;return null==e||null===(t=e.beaconUrls)||void 0===t?void 0:t.some(function(e){return e.includes("videoView")})}))||!1;if(!d&&a){var u=null==s?void 0:s.map(function(e){return rt(rt({},e),{},{eventType:"videoView",beaconUrls:[a]})});null!=u&&u[0]&&r.push(null==u?void 0:u[0])}return r},k=function(){var e=t(n.mark(function e(t){var a,l,s,d,u,v,f,p,m,h,k,O,P,D,C,F,x,j,R,V,N,W,U,M;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return V=function(e){document.removeEventListener("pointermove",R),document.removeEventListener("pointerup",V),0===e.button&&x()},R=function(e){},j=function(){var e,t=h.currentTime(),n=null,i=ot(m);try{for(i.s();!(e=i.n()).done;){var r=e.value,o=r.startTimeInSeconds,a=r.durationInSeconds,l=(r.ads,Math.floor(o+a));t>=o&&t<=l&&(n=l,g.set(o,!0))}}catch(e){i.e(e)}finally{i.f()}null!==n&&(console.log("Seeking to end of the ad pod:",n),setTimeout(function(){h.currentTime(n+2.2)},100))},x=function(){var e,t=h.currentTime(),n=null,i=ot(m);try{for(i.s();!(e=i.n()).done;){var r=e.value,o=r.startTimeInSeconds,a=r.durationInSeconds,l=r.ads,s=Math.floor(o+a);(Array.isArray(l)&&(null==l?void 0:l.length)>0&&(t>s||t>o)&&!g.has(o)||t>=o&&t<=s)&&(n=o,g.set(o,!0),y.set(o,!0))}}catch(e){i.e(e)}finally{i.f()}null!==n&&(console.log("Seeking back to ad pod:",n),setTimeout(function(){h.currentTime(n+.4)},100))},u=!1,e.next=7,fetch(t);case 7:return v=e.sent,e.next=10,v.json();case 10:f=e.sent,p=f.avails,m=[],h=o.getPlayer(i),k=h.controlBar.progressControl,O=k.seekBar.el(),null===(a=document)||void 0===a||a.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),p.map(function(e,t){var n;0==t&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(n=e.ads)||void 0===n?void 0:n.length)>0&&(u=!0),m.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:S(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),!u&&r&&(h.currentTime(r),j()),null!=m&&m.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",m),window.adsQueueList=m,"function"==typeof(F=(null===(P=window)||void 0===P||null===(D=P.customData)||void 0===D||null===(C=D.ads)||void 0===C?void 0:C.onAdBreaksLoaded)||null)&&F(m)),console.log(m,"data"),m.forEach(function(e){var t=e.markerPositionInSeconds,n=e.ads,i=h.duration();if(!(t>i||Array.isArray(n)&&0==(null==n?void 0:n.length))){var r=t/i*100,o=document.createElement("div");o.className="vjs-seekbar-marker",o.style.left="".concat(r,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="2px",o.style.backgroundColor="#fecc09",o.style.left="".concat(r,"%"),o.style.pointerEvents="none",O.appendChild(o)}}),h._timeUpdateHandler&&h.off("timeupdate",h._timeUpdateHandler),h._timeUpdateHandler=o.throttle(function(){var e=h.currentTime();if(e!==w){w=e;for(var t=!1,n=function(){var n=m[i],r=n.startTimeInSeconds,o=n.durationInSeconds,a=n.ads,l=r+o;if(e>=r-1.2&&e<=l+1.2){var s;e>=r&&e<=l&&Array.isArray(a)&&(null==a?void 0:a.length)>0&&(t=!0),e>l&&g.set(r,!0),Be.disable(),T&&T.classList.add("vjs-hidden"),I&&(I.style.pointerEvents="none",I.classList.add("vjs-hidden")),E&&(E.style.pointerEvents="none",E.classList.add("vjs-hidden")),_&&(_.el().style.pointerEvents="none",_.el().classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),k.el().classList.add("hide-progress-bar");for(var d=e-r,u=0,v=0,f=0;f<a.length;f++){var p,h=null==a||null===(p=a[f])||void 0===p?void 0:p.durationInSeconds;if(d<u+h){v=f;break}u+=h}a[v];var w=Math.max(0,o-d),S=Math.round(w);N.style.display="block",M.textContent="".concat(v+1," of ").concat(a.length," • ").concat(A(S));var O=[];return null==a||a.forEach(function(e){var t=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});O.push.apply(O,c(t))}),(null==n||null===(s=n.podSlotImpressionBeacon)||void 0===s?void 0:s.length)>0&&O.push.apply(O,c(null==n?void 0:n.podSlotImpressionBeacon)),L(e,n,O,v,i,j),"break"}y.delete(r)},i=0;i<m.length;i++){if("break"===n())break}t||(N.style.display="none",k.el().classList.remove("hide-progress-bar"),_&&(_.el().style.pointerEvents="auto",_.el().classList.remove("vjs-hidden")),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),T&&T.classList.remove("vjs-hidden"),I&&(I.style.pointerEvents="auto",I.classList.remove("vjs-hidden")),E&&(E.style.pointerEvents="auto",E.classList.remove("vjs-hidden")),Be.enable())}},1e3),h.on("timeupdate",h._timeUpdateHandler),null===(l=document)||void 0===l||l.addEventListener("keydown",function(e){Be.enabled&&"ArrowRight"==e.key&&(x(),An(i,10),e.stopPropagation())}),k.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",R),document.addEventListener("pointerup",V))}),null===(s=document)||void 0===s||null===(d=s.querySelectorAll(".ssai-ad-container"))||void 0===d||d.forEach(function(e){return null==e?void 0:e.remove()}),(N=document.createElement("div")).className="ssai-ad-container",(W=document.createElement("div")).className="sponsored-adbox",(U=document.createElement("div")).className="sponsored-text",U.textContent="Sponsored Ad",W.append(U),(M=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",N.append(W),N.append(M),h.el().appendChild(N);case 44:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),O=new Map,P=-1;case 21:case"end":return e.stop()}},e)})),wt.apply(this,arguments)}function Tt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return _t(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_t(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},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 o,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}function _t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function bt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function It(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?bt(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):bt(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}var Et={},St=(null===(pt=window)||void 0===pt||null===(mt=pt.location)||void 0===mt||null===(ht=mt.search)||void 0===ht?void 0:ht.includes("debug=true"))||!1,kt=null;function At(e){return Ot.apply(this,arguments)}function Ot(){return Ot=t(n.mark(function e(i){var r,a,l,s,d,u,v,f,p,m,h,g,y,w,T,_,b,I,E,S,k,A,O,P,D,L,C;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:C=function(e,t,n,r,a){var l,s,d=o.getPlayer(i);if(!d.seeking()){var u=t.startTimeInSeconds;t.durationInSeconds;var c=(null==t||null===(l=t.ads)||void 0===l||null===(s=l[r])||void 0===s?void 0:s.adId)||u;Math.floor(d.currentTime());var v,f=Tt(n);try{for(f.s();!(v=f.n()).done;){var p,m,h,g=v.value,y=g.eventType,w=g.beaconUrls,T=g.startTimeInSeconds,_=g.startTime,b=g.durationInSeconds,I=(g.eventId,T||u),E=w,S=(null===(p=window)||void 0===p||null===(m=p.customData)||void 0===m||null===(h=m.ads)||void 0===h?void 0:h.adEventHandler)||null,k="".concat(c,"_").concat(y),A="pod-".concat(u);P.has(A)||P.set(A,new Set);var O=P.get(A);if(St&&console.warn(e,I,"map:",y,"condition1:",e>=I,"map:",P),e>=I&&e<=I+D&&!O.has(k)){O.add(k);try{L(y,t,E,d)}catch(e){console.error("Error when calling triggerAdBeacon:",e,y,t)}if("function"==typeof S)try{var C,F={eventType:y,startTimeInSeconds:T,startTime:_,durationInSeconds:b,ad:null==t||null===(C=t.ads)||void 0===C?void 0:C[r],adIndex:r};S({adsData:F}),Je(i,F)}catch(e){console.error("Error when calling ads callback:",e)}var x=tt.get();if(x&&0!==Object.keys(x).length){var j=x.formulateComscoreAdPayload,R=x.startComscoreAdTracking,V=x.finishComscoreAdTracking,N=x.endComscoreAdTracking;if("impression"===y){var W,U=st.get();R(j(It(It({},null==t||null===(W=t.ads)||void 0===W?void 0:W[r]),{},{trackingUrl:U})))}else"complete"===y?V():"breakEnd"===y&&N()}}}}catch(e){f.e(e)}finally{f.f()}}},L=function(e,t,n,i){var r,o,a;"breakEnd"===e&&(null===(r=Et)||void 0===r?void 0:r.currentAdIndex)+1!=(null===(o=Et)||void 0===o?void 0:o.totalAds)&&(null==t||null===(a=t.ads)||void 0===a?void 0:a.length)>0||(St&&console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(i.currentTime())),"AD_POD:",t),null==n||n.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(t){console.warn("Beacon failed:",e,t)})}))},h=function(){kt&&clearInterval(kt)},p=st.get(),(m=o.getPlayer(i)).one("loadeddata",function(){h(),kt=setInterval(function(){p&&!m.paused()&&O(p)},2e3)}),m.on("dispose",function(){h()}),g=new Map,y=new Map,w=-1,T=null,_=(null===(r=document)||void 0===r||null===(a=r.getElementsByClassName("tvProviderImage"))||void 0===a?void 0:a[0])||null,b=(null==m||null===(l=m.controlBar)||void 0===l?void 0:l.getChild("videoSelector"))||null,I=(null==m||null===(s=m.controlBar)||void 0===s?void 0:s.getChild("seriesV2"))||null,E=(null==m||null===(d=m.el())||void 0===d||null===(u=d.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===u?void 0:u[0])||null,S=(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,k=!1,A=function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==n?void 0:n.length))return c(i);var r=[],o=null==i?void 0:i.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),a=(null==o||null===(e=o.beaconUrls)||void 0===e?void 0:e.find(function(e){return e.includes("videoView")}))||null,l=(null==n?void 0:n.length)>1?null==n?void 0:n[(null==n?void 0:n.length)-1]:null==n?void 0:n[0],s=null==l||null===(t=l.trackingEvents)||void 0===t?void 0:t.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),d=(null==s?void 0:s.some(function(e){var t;return null==e||null===(t=e.beaconUrls)||void 0===t?void 0:t.some(function(e){return e.includes("videoView")})}))||!1;if(!d&&a){var u=null==s?void 0:s.map(function(e){return It(It({},e),{},{eventType:"videoView",beaconUrls:[a]})});null!=u&&u[0]&&r.push(null==u?void 0:u[0])}return r},O=function(){var e=t(n.mark(function e(t){var r,a,l,s,d,u,v,f,p,m,h,O;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=new URL(t),T&&s.searchParams.append("nextToken",T),e.next=4,fetch(s.toString(),{method:"GET"});case 4:return d=e.sent,e.next=7,d.json();case 7:u=e.sent,v=u.avails,f=u.nextToken||null,T=f,p=[],m=o.getPlayer(i),h=null==m||null===(r=m.controlBar)||void 0===r?void 0:r.progressControl,O=null==h||null===(a=h.seekBar)||void 0===a?void 0:a.el(),null===(l=document)||void 0===l||l.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),v.map(function(e,t){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:A(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),St&&console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",p),null!=p&&p.length&&(window.adsQueueList=p),p.forEach(function(e){var t=e.markerPositionInSeconds,n=e.ads,i=m.duration();if(!(t>i||Array.isArray(n)&&0==(null==n?void 0:n.length))){var r=t/i*100,o=document.createElement("div");o.className="vjs-seekbar-marker",o.style.left="".concat(r,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="2px",o.style.backgroundColor="#fecc09",o.style.left="".concat(r,"%"),o.style.pointerEvents="none",O.appendChild(o)}}),m._timeUpdateHandler&&m.off("timeupdate",null==m?void 0:m._timeUpdateHandler),m._timeUpdateHandler=o.throttle(function(){if(Pn(i)){var e=null==m?void 0:m.currentTime();if(e!==w){w=e;for(var t=function(){var t=p[n],i=t.startTimeInSeconds,r=t.durationInSeconds,o=t.ads,a=i+r;if(e>=i-1.2&&e<=a+1.2){var l;k=!!(e>=i&&e<=a&&Array.isArray(o)&&(null==o?void 0:o.length)>0),e>a&&g.set(i,!0),Be.disable(),_&&_.classList.add("vjs-hidden"),E&&(E.style.pointerEvents="none",E.classList.add("vjs-hidden")),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),I&&(I.el().style.pointerEvents="none",I.el().classList.add("vjs-hidden")),h.el().classList.add("hide-progress-bar");for(var s=e-i,d=0,u=0,v=0;v<o.length;v++){var f,m=null==o||null===(f=o[v])||void 0===f?void 0:f.durationInSeconds;if(s<d+m){u=v;break}d+=m}setTimeout(function(){Et.totalAds=null==o?void 0:o.length,Et.currentAdIndex=u},1e3);var w=[];return null==o||o.forEach(function(e){var t=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});w.push.apply(w,c(t))}),(null==t||null===(l=t.podSlotImpressionBeacon)||void 0===l?void 0:l.length)>0&&w.push.apply(w,c(null==t?void 0:t.podSlotImpressionBeacon)),C(e,t,w,u),"break"}y.delete(i)},n=0;n<p.length;n++){if("break"===t())break}k||(Et={},h.el().classList.remove("hide-progress-bar"),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),I&&(I.el().style.pointerEvents="auto",I.el().classList.remove("vjs-hidden")),_&&_.classList.remove("vjs-hidden"),E&&(E.style.pointerEvents="auto",E.classList.remove("vjs-hidden")),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),Be.enable())}}},1e3),m.on("timeupdate",m._timeUpdateHandler);case 23:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),P=new Map,D=2.5;case 22:case"end":return e.stop()}},e)})),Ot.apply(this,arguments)}var Pt=/(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;function Dt(e){return JSON.stringify((e||[]).map(function(e){return{availId:e.availId,startTimeInSeconds:e.startTimeInSeconds,durationInSeconds:e.durationInSeconds,ads:(e.ads||[]).map(function(e){return{adId:e.adId,startTimeInSeconds:e.startTimeInSeconds,durationInSeconds:e.durationInSeconds}})}}))}var Lt=function(){function e(t,n,i,r){p(this,e),this.video_=r,this.ad_=t,this.skipOffset_=function(e){if(!e)return null;var t=new RegExp(Pt.source,"g");t.lastIndex=0;var n=t.exec(e);if(!n)return null;var i=Number(n[1])||0,r=Number(n[2]),o=Number(n[3]),a=Number(n[6])||0;return r>59||o>59?null:a/1e3+o+60*r+3600*i}(null==t?void 0:t.skipOffset),this.adPosition_=n,this.totalAds_=i,this.isSkipped_=!1}return m(e,[{key:"isClientRendering",value:function(){return!1}},{key:"getDuration",value:function(){var e,t;return null!==(e=null===(t=this.ad_)||void 0===t?void 0:t.durationInSeconds)&&void 0!==e?e:0}},{key:"getRemainingTime",value:function(){var e,t,n,i,r,o;return(null!==(e=null===(t=this.ad_)||void 0===t?void 0:t.startTimeInSeconds)&&void 0!==e?e:0)+(null!==(n=null===(i=this.ad_)||void 0===i?void 0:i.durationInSeconds)&&void 0!==n?n:0)-(null!==(r=null===(o=this.video_)||void 0===o?void 0:o.currentTime)&&void 0!==r?r:0)}},{key:"isSkippable",value:function(){return"number"==typeof this.skipOffset_}},{key:"getTimeUntilSkippable",value:function(){if("number"!=typeof this.skipOffset_)return this.getRemainingTime();var e=this.getRemainingTime()+this.skipOffset_-this.getDuration();return Math.max(e,0)}},{key:"canSkipNow",value:function(){return 0===this.getTimeUntilSkippable()}},{key:"skip",value:function(){this.isSkipped_=!0,this.video_&&(this.video_.currentTime+=this.getRemainingTime())}},{key:"isLinear",value:function(){return!0}},{key:"getSequenceLength",value:function(){return this.totalAds_||1}},{key:"getPositionInSequence",value:function(){return this.adPosition_||1}},{key:"getTitle",value:function(){var e;return(null===(e=this.ad_)||void 0===e?void 0:e.adTitle)||""}},{key:"getVastAdId",value:function(){var e;return(null===(e=this.ad_)||void 0===e?void 0:e.vastAdId)||""}},{key:"getAdId",value:function(){var e;return(null===(e=this.ad_)||void 0===e?void 0:e.adId)||""}},{key:"getCreativeAdId",value:function(){var e;return(null===(e=this.ad_)||void 0===e?void 0:e.creativeId)||""}},{key:"getTimeOffset",value:function(){var e,t;return null!==(e=null===(t=this.ad_)||void 0===t?void 0:t.startTimeInSeconds)&&void 0!==e?e:0}},{key:"release",value:function(){this.ad_=null,this.adPosition_=null,this.totalAds_=null}},{key:"isSkipped",value:function(){return this.isSkipped_}}]),e}(),Ct="impression",Ft="start",xt="mute",jt="unmute",Rt="resume",Vt="pause",Nt="firstQuartile",Wt="midpoint",Ut="thirdQuartile",Mt="complete",Bt="skip",Ht="breakStart",qt="breakEnd",Gt="skipStateChanged",zt="ad_impression",Qt="ad_started",Yt="ad_muted",Kt="ad_volume_changed",Xt="ad_resumed",Jt="ad_paused",$t="ad_first_quartile",Zt="ad_midpoint",en="ad_third_quartile",tn="ad_complete",nn="ad_stopped",rn="ad_skipped",on="ad_skip_state_changed",an="ad_break_started",ln="ad_break_ended",sn="ads_loaded",dn="ad_cuepoints_changed";function un(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function cn(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?un(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):un(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function vn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return fn(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fn(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},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 o,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}function fn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}var pn="[Transmit]";function mn(e){var t,n,i;if(null==e)return{avails:[],nextToken:null,dashAvailabilityStartTime:null};var r=null!==(t=e.dashAvailabilityStartTime)&&void 0!==t?t:null,o=null!==(n=e.nextToken)&&void 0!==n?n:null,a=[];if(Array.isArray(e.avails))a=e.avails;else if(Array.isArray(e)){var l,s,d,u,c=e[0];if(c&&Array.isArray(c.avails))a=c.avails,r=null!==(l=null!==(s=r)&&void 0!==s?s:c.dashAvailabilityStartTime)&&void 0!==l?l:null,o=null!==(d=null!==(u=o)&&void 0!==u?u:c.nextToken)&&void 0!==d?d:null;else a=e}else if(Array.isArray(null==e||null===(i=e.data)||void 0===i?void 0:i.avails)){var v,f,p,m;a=e.data.avails,o=null!==(v=null!==(f=o)&&void 0!==f?f:e.data.nextToken)&&void 0!==v?v:null,r=null!==(p=null!==(m=r)&&void 0!==m?m:e.data.dashAvailabilityStartTime)&&void 0!==p?p:null}else Array.isArray(null==e?void 0:e.data)&&(a=e.data);return{avails:a,nextToken:o,dashAvailabilityStartTime:r}}var hn=function(){function e(t,n,i){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};p(this,e),this.video_=t,this.player_=n,this.onEvent_="function"==typeof i?i:function(){},this.dashManifestUrl_=o.dashManifestUrl||null,this.config_=null,this.trackingUrl_="",this.firstTrackingRequest_=!0,this.nextToken_=null,this.dashAvailabilityStartTime_=0,this.dashAvailabilityStartTimeResolved_=!1,this.pollIntervalMs_=2e3,this.pollId_=null,this.adBreaks_=[],this.ad_=null,this.transmitAd_=null,this.transmitAdBreak_=null,this.eventsSent_=new Set,this.firedBeacons_=new Set,this.adBreakListenersAttached_=!1,this.globalListeners_=[],this.adListeners_=[],this.videoTimeupdate_=null,this.lastMutedForAd_=null,this.onDispose_=function(){return r.release()},this.apiTimelineAbsolute_=!1}var i,r,o;return m(e,[{key:"configure",value:function(e){this.config_=e}},{key:"addTrackingUrl",value:function(e){this.trackingUrl_=e||"",this.onEvent_({type:sn,loadTime:0})}},{key:"getCuePoints",value:function(){var e,t=new Map,n=vn(this.adBreaks_);try{for(n.s();!(e=n.n()).done;){var i,r=vn(e.value.ads||[]);try{for(r.s();!(i=r.n()).done;){var o=i.value,a=o.startTimeInSeconds,l=a+o.durationInSeconds;if(isFinite(a)&&isFinite(l)&&!(l<=a)){var s="".concat(a.toFixed(1),"|").concat(l.toFixed(1));t.has(s)||t.set(s,{start:a,end:l})}}}catch(e){r.e(e)}finally{r.f()}}}catch(e){n.e(e)}finally{n.f()}return Array.from(t.values()).sort(function(e,t){return e.start-t.start})}},{key:"onManifestUpdated",value:function(){this.trackingUrl_&&(this.requestTrackingInfo_(this.firstTrackingRequest_),this.firstTrackingRequest_=!1,this.ensurePolling_())}},{key:"stop",value:function(){this.onEnded_(),this.detachAllListeners_(),this.eventsSent_.clear(),this.firedBeacons_.clear(),this.trackingUrl_="",this.firstTrackingRequest_=!0,this.nextToken_=null,this.dashAvailabilityStartTime_=0,this.dashAvailabilityStartTimeResolved_=!1,this.apiTimelineAbsolute_=!1,this.adBreaks_=[],this.adBreakListenersAttached_=!1,this.pollId_&&(clearInterval(this.pollId_),this.pollId_=null)}},{key:"release",value:function(){this.stop()}},{key:"ensurePolling_",value:function(){var e=this;this.pollId_||(this.pollId_=setInterval(function(){var t,n;e.trackingUrl_&&(null!==(t=e.player_)&&void 0!==t&&null!==(n=t.paused)&&void 0!==n&&n.call(t)||e.requestTrackingInfo_(!1))},this.pollIntervalMs_))}},{key:"requestTrackingInfo_",value:(o=t(n.mark(function e(t){var i,r,o,a,l,s,d,u,c,v,f,p,m,h,g,y,w;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,r=new Map,o=0,a=null;case 4:if(!(o<10)){e.next=25;break}return l=new URL(this.trackingUrl_),this.nextToken_&&l.searchParams.set("nextToken",this.nextToken_),e.next=9,fetch(l.toString(),{method:"GET"});case 9:return s=e.sent,e.next=12,s.json();case 12:d=e.sent,o++,(u=mn(d)).dashAvailabilityStartTime&&!a&&(a=u.dashAvailabilityStartTime),c=vn(u.avails);try{for(c.s();!(v=c.n()).done;)f=v.value,p=(null==f?void 0:f.availId)||"".concat(null==f?void 0:f.startTimeInSeconds),r.set(p,f)}catch(e){c.e(e)}finally{c.f()}if((m=u.nextToken||null)&&m!==this.nextToken_){e.next=22;break}return this.nextToken_=m,e.abrupt("break",25);case 22:this.nextToken_=m,e.next=4;break;case 25:if(h=Array.from(r.values()),this.updateApiTimelineAbsoluteFlag_(h),g=(null==h||null===(i=h[0])||void 0===i?void 0:i.startTimeInSeconds)||0,this.apiTimelineAbsolute_){e.next=33;break}return e.next=31,this.resolveDashAvailabilityStartTime_(a,g);case 31:e.next=35;break;case 33:this.dashAvailabilityStartTimeResolved_=!0,this.dashAvailabilityStartTime_=0;case 35:h.length?(y=this.normalizeAvails_(h),Dt(this.adBreaks_)!==Dt(y)&&(this.adBreaks_=y,w=this.getCuePoints(),this.onEvent_({type:dn,cuepoints:w}))):this.adBreaks_.length&&(this.onEvent_({type:dn,cuepoints:[]}),this.onEnded_(),this.adBreaks_=[]),t&&this.setupAdBreakListeners_(),e.next=42;break;case 39:e.prev=39,e.t0=e.catch(0),console.warn(pn,"tracking info fetch failed",e.t0);case 42:case"end":return e.stop()}},e,this,[[0,39]])})),function(e){return o.apply(this,arguments)})},{key:"updateApiTimelineAbsoluteFlag_",value:function(e){this.apiTimelineAbsolute_=!1;var t,n=1e6,i=vn(e||[]);try{for(i.s();!(t=i.n()).done;){var r,o=t.value;if((null!==(r=null==o?void 0:o.startTimeInSeconds)&&void 0!==r?r:0)>n)return void(this.apiTimelineAbsolute_=!0);var a,l=vn((null==o?void 0:o.ads)||[]);try{for(l.s();!(a=l.n()).done;){var s,d=a.value;if((null!==(s=null==d?void 0:d.startTimeInSeconds)&&void 0!==s?s:0)>n)return void(this.apiTimelineAbsolute_=!0)}}catch(e){l.e(e)}finally{l.f()}}}catch(e){i.e(e)}finally{i.f()}}},{key:"normalizeAvails_",value:function(e){var t=this,n=this.apiTimelineAbsolute_?0:this.dashAvailabilityStartTime_||0;return e.map(function(e){var i=t.resolveAbsoluteStart_(e,n,null);return cn(cn({},e),{},{startTimeInSeconds:i,ads:(e.ads||[]).map(function(r){return cn(cn({},r),{},{startTimeInSeconds:t.resolveAbsoluteStart_(r,n,e,i)})})})})}},{key:"resolveAbsoluteStart_",value:function(e,t,n,i){var r=null==e?void 0:e.adProgramDateTime;if(r){var o=new Date(r).getTime()/1e3;if(isFinite(o)&&o>0)return o}return null!=n&&n.adProgramDateTime&&"number"==typeof i?i+((e.startTimeInSeconds||0)-(n.startTimeInSeconds||0)):(e.startTimeInSeconds||0)+t}},{key:"resolveDashAvailabilityStartTime_",value:(r=t(n.mark(function e(t,i){var r,o;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.dashAvailabilityStartTimeResolved_){e.next=2;break}return e.abrupt("return");case 2:if(!t){e.next=8;break}if(r=new Date(t).getTime()/1e3,!(isFinite(r)&&r>0)){e.next=8;break}return this.dashAvailabilityStartTime_=r,this.dashAvailabilityStartTimeResolved_=!0,e.abrupt("return");case 8:if(!(i>0)){e.next=13;break}return e.next=11,this.fetchDashAvailabilityStartTimeFromMpd_();case 11:(o=e.sent)>0&&(this.dashAvailabilityStartTime_=o,this.dashAvailabilityStartTimeResolved_=!0);case 13:case"end":return e.stop()}},e,this)})),function(e,t){return r.apply(this,arguments)})},{key:"fetchDashAvailabilityStartTimeFromMpd_",value:(i=t(n.mark(function e(){var t,i,r,o,a,l;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,(i=this.dashManifestUrl_||this.getCurrentSourceUrl_())&&i.includes(".mpd")){e.next=4;break}return e.abrupt("return",0);case 4:return e.next=6,fetch(i);case 6:return r=e.sent,e.next=9,r.text();case 9:return o=e.sent,a=(new DOMParser).parseFromString(o,"application/xml"),l=null===(t=a.querySelector("MPD"))||void 0===t?void 0:t.getAttribute("availabilityStartTime"),e.abrupt("return",l?new Date(l).getTime()/1e3:0);case 15:return e.prev=15,e.t0=e.catch(0),console.warn(pn,"MPD availabilityStartTime parse failed",e.t0),e.abrupt("return",0);case 19:case"end":return e.stop()}},e,this,[[0,15]])})),function(){return i.apply(this,arguments)})},{key:"getCurrentSourceUrl_",value:function(){try{var e,t,n,i,r=(null===(e=this.player_)||void 0===e||null===(t=e.currentSrc)||void 0===t?void 0:t.call(e))||(null===(n=this.player_)||void 0===n||null===(i=n.src)||void 0===i?void 0:i.call(n));return"string"==typeof r?r:(null==r?void 0:r.src)||""}catch(e){return""}}},{key:"setupAdBreakListeners_",value:function(){var e=this;if(!this.adBreakListenersAttached_){this.adBreakListenersAttached_=!0,this.onTimeupdate_();this.attachGlobalListener_("timeupdate",function(){return e.onTimeupdate_()}),this.attachGlobalListener_("dispose",this.onDispose_),this.video_&&(this.videoTimeupdate_=function(){return e.onTimeupdate_()},this.video_.addEventListener("timeupdate",this.videoTimeupdate_))}}},{key:"isHlsSource_",value:function(){var e,t,n=this.getCurrentSourceUrl_().toLowerCase(),i=((null===(e=this.player_)||void 0===e||null===(t=e.currentType)||void 0===t?void 0:t.call(e))||"").toLowerCase();return n.includes(".m3u8")||"application/x-mpegurl"===i||"application/vnd.apple.mpegurl"===i}},{key:"isDashSource_",value:function(){var e,t,n=this.getCurrentSourceUrl_().toLowerCase();return"application/dash+xml"===((null===(e=this.player_)||void 0===e||null===(t=e.currentType)||void 0===t?void 0:t.call(e))||"").toLowerCase()||n.includes(".mpd")}},{key:"getDashMediaPlayerTimelineSeconds_",value:function(){try{var e,t,n=null===(e=this.player_)||void 0===e||null===(t=e.dash)||void 0===t?void 0:t.mediaPlayer;if(!n||"function"!=typeof n.time)return null;var i=n.time();return"number"==typeof i&&isFinite(i)&&i>1e6?i:null}catch(e){return null}}},{key:"getCurrentTime_",value:function(){var e,t,n,i=null!==(e=null===(t=this.video_)||void 0===t?void 0:t.currentTime)&&void 0!==e?e:0,r=a.detectBrowser();if(this.isHlsSource_()){var o,l,s=i,d=null===(o=this.player_)||void 0===o||null===(l=o.seekable)||void 0===l?void 0:l.call(o);return d&&d.length>0&&(s=d.end(d.length-1)),Date.now()/1e3-(s-i)}if(this.isDashSource_()){var u,c,v,f=this.getDashMediaPlayerTimelineSeconds_();if(null!=f)return f;var p=null===(u=this.player_)||void 0===u||null===(c=u.seekable)||void 0===c?void 0:c.call(u),m="function"==typeof(null===(v=this.player_)||void 0===v?void 0:v.currentTime)?this.player_.currentTime():i;if(p&&p.length>0){var h=p.start(0);if(h>1e6&&h+m>1e6)return h+m}if(this.apiTimelineAbsolute_&&(this.dashAvailabilityStartTime_||0)>1e9)return(this.dashAvailabilityStartTime_||0)+m}return"Safari"===r?i:"function"==typeof(null===(n=this.player_)||void 0===n?void 0:n.currentTime)?this.player_.currentTime():i}},{key:"onTimeupdate_",value:function(){if(this.ad_||this.adBreaks_.length){var e=this.getCurrentTime_();if(this.ad_){var t,n;this.sendInProgressEvents_(e,this.transmitAd_);var i=this.ad_.getDuration(),r=(null!==(t=null===(n=this.transmitAd_)||void 0===n?void 0:n.startTimeInSeconds)&&void 0!==t?t:0)+i,o=r-e;this.ad_.canSkipNow()&&o>0&&i>0&&this.sendTrackingEvent_(Gt),i>0&&e>=r&&this.onEnded_()}this.ad_||this.checkLinearAds_(e)}}},{key:"sendInProgressEvents_",value:function(e,t){if(t){var n=t.startTimeInSeconds+.25*t.durationInSeconds,i=t.startTimeInSeconds+.5*t.durationInSeconds,r=t.startTimeInSeconds+.75*t.durationInSeconds;e>=n&&!this.eventsSent_.has(Nt)&&(this.eventsSent_.add(Nt),this.sendTrackingEvent_(Nt)),e>=i&&!this.eventsSent_.has(Wt)&&(this.eventsSent_.add(Wt),this.sendTrackingEvent_(Wt)),e>=r&&!this.eventsSent_.has(Ut)&&(this.eventsSent_.add(Ut),this.sendTrackingEvent_(Ut))}}},{key:"flushPendingQuartiles_",value:function(){for(var e=0,t=[Nt,Wt,Ut];e<t.length;e++){var n=t[e];this.eventsSent_.has(n)||(this.eventsSent_.add(n),this.sendTrackingEvent_(n))}}},{key:"checkLinearAds_",value:function(e){var t,n=vn(this.adBreaks_);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(this.ad_)break;for(var r=i.ads||[],o=0;o<r.length;o++){var a=r[o],l=a.startTimeInSeconds,s=l+a.durationInSeconds;if(l<=e&&s>e){this.onEnded_(),this.transmitAdBreak_=i,this.transmitAd_=a,this.ad_=new Lt(a,o+1,r.length,this.video_),0===o&&this.sendTrackingEvent_(Ht),this.setupCurrentAdListeners_();break}}}}catch(e){n.e(e)}finally{n.f()}}},{key:"onEnded_",value:function(){this.ad_&&this.transmitAd_&&(this.ad_.isSkipped()||this.flushPendingQuartiles_(),this.removeCurrentAdListeners_(this.ad_.isSkipped()),this.ad_.getPositionInSequence()===this.ad_.getSequenceLength()&&this.sendTrackingEvent_(qt),this.ad_=null,this.transmitAd_=null,this.transmitAdBreak_=null)}},{key:"setupCurrentAdListeners_",value:function(){var e,t,n,i,r,o=this,a=!1;null!==(e=this.player_)&&void 0!==e&&null!==(t=e.paused)&&void 0!==t&&t.call(e)?a=!0:(this.sendTrackingEvent_(Ct),this.sendTrackingEvent_(Ft)),this.lastMutedForAd_=null!==(n=null===(i=this.player_)||void 0===i||null===(r=i.muted)||void 0===r?void 0:r.call(i))&&void 0!==n&&n,this.attachAdListener_("volumechange",function(){var e,t,n,i=null!==(e=null===(t=o.player_)||void 0===t||null===(n=t.muted)||void 0===n?void 0:n.call(t))&&void 0!==e&&e;i!==o.lastMutedForAd_&&(o.lastMutedForAd_=i,i?o.sendTrackingEvent_(xt):o.sendTrackingEvent_(jt))}),this.attachAdListener_("play",function(){a?(o.sendTrackingEvent_(Ct),o.sendTrackingEvent_(Ft),a=!1):o.sendTrackingEvent_(Rt)}),this.attachAdListener_("pause",function(){o.sendTrackingEvent_(Vt)})}},{key:"removeCurrentAdListeners_",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.sendTrackingEvent_(e?Bt:Mt),this.detachAdListeners_(),this.eventsSent_.clear()}},{key:"attachGlobalListener_",value:function(e,t){this.player_&&(this.player_.on(e,t),this.globalListeners_.push({event:e,handler:t}))}},{key:"attachAdListener_",value:function(e,t){this.player_&&(this.player_.on(e,t),this.adListeners_.push({event:e,handler:t}))}},{key:"detachAdListeners_",value:function(){var e,t=vn(this.adListeners_);try{for(t.s();!(e=t.n()).done;){var n,i,r=e.value,o=r.event,a=r.handler;null===(n=this.player_)||void 0===n||null===(i=n.off)||void 0===i||i.call(n,o,a)}}catch(e){t.e(e)}finally{t.f()}this.adListeners_=[]}},{key:"detachAllListeners_",value:function(){this.detachAdListeners_();var e,t=vn(this.globalListeners_);try{for(t.s();!(e=t.n()).done;){var n,i,r=e.value,o=r.event,a=r.handler;null===(n=this.player_)||void 0===n||null===(i=n.off)||void 0===i||i.call(n,o,a)}}catch(e){t.e(e)}finally{t.f()}this.globalListeners_=[],this.video_&&this.videoTimeupdate_&&(this.video_.removeEventListener("timeupdate",this.videoTimeupdate_),this.videoTimeupdate_=null)}},{key:"startComscoreForCurrentAd_",value:function(){try{var e=tt.get();if(!e||0===Object.keys(e).length)return;var t=e.formulateComscoreAdPayload,n=e.startComscoreAdTracking,i=st.get();n(t(cn(cn({},this.transmitAd_),{},{trackingUrl:i})))}catch(e){console.warn(pn,"comscore start failed",e)}}},{key:"sendTrackingEvent_",value:function(e){var t,n=this;if(this.transmitAd_&&this.transmitAdBreak_){var i=(this.transmitAd_.trackingEvents||[]).find(function(t){return t.eventType===e});if(i||(i=(this.transmitAdBreak_.adBreakTrackingEvents||[]).find(function(t){return t.eventType===e})),i&&(null===(t=this.config_)||void 0===t||!t.disableTrackingEvents)){var r,o,a,l=(null===(r=this.transmitAd_)||void 0===r?void 0:r.adId)||(null===(o=this.transmitAdBreak_)||void 0===o?void 0:o.availId)||"unknown",s=vn(i.beaconUrls||[]);try{var d=function(){var t=a.value;if(!t)return"continue";var i="".concat(l,"|").concat(e,"|").concat(t);if(n.firedBeacons_.has(i))return"continue";n.firedBeacons_.add(i),fetch(t,{mode:"no-cors"}).catch(function(e){console.warn(pn,"beacon failed",t,e)})};for(s.s();!(a=s.n()).done;)d()}catch(e){s.e(e)}finally{s.f()}}var u=tt.get(),c=u&&Object.keys(u).length?u:null;switch(e){case Ct:this.onEvent_({type:zt}),this.startComscoreForCurrentAd_();break;case Ft:this.onEvent_({type:Qt,ad:this.ad_});break;case xt:this.onEvent_({type:Yt});break;case jt:this.onEvent_({type:Kt});break;case Rt:this.onEvent_({type:Xt});break;case Vt:this.onEvent_({type:Jt});break;case Nt:this.onEvent_({type:$t});break;case Wt:this.onEvent_({type:Zt});break;case Ut:this.onEvent_({type:en});break;case Mt:this.onEvent_({type:tn}),this.onEvent_({type:nn}),null!=c&&c.finishComscoreAdTracking&&c.finishComscoreAdTracking();break;case Bt:this.onEvent_({type:rn}),this.onEvent_({type:nn});break;case Ht:this.onEvent_({type:an});break;case qt:this.onEvent_({type:ln}),null!=c&&c.endComscoreAdTracking&&c.endComscoreAdTracking();break;case Gt:this.onEvent_({type:on})}}else console.warn(pn,"sendTrackingEvent_ skipped — no active ad",{eventType:e})}}]),e}();function gn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function yn(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?gn(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):gn(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}var wn={dash:"tracking/initialize/dash",hls:"tracking/initialize/hls"};function Tn(e){if(null==e||!e.src)return null;var t=(e.type||"").toLowerCase(),n=String(e.src).toLowerCase();return"application/dash+xml"===t||n.includes(".mpd")?"dash":"application/x-mpegurl"===t||"application/vnd.apple.mpegurl"===t||n.includes(".m3u8")?"hls":null}function _n(e,t,n){return bn.apply(this,arguments)}function bn(){return(bn=t(n.mark(function e(t,i,r){var o,a,l,s,d,u,c,v,f,p,m;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=Tn(t)){e.next=3;break}return e.abrupt("return",t);case 3:return a=De(t.src,r,i),l=a.replace(o,wn[o]),console.log("[Transmit] session init →",l),e.prev=6,e.next=9,fetch(l,{method:"GET",redirect:"follow"});case 9:return s=e.sent,e.next=12,s.json();case 12:if(d=e.sent,console.log("[Transmit] session response",d),u="dash"===o?null==d?void 0:d.dashUrl:null==d?void 0:d.hlsUrl,c=null==d?void 0:d.trackingUrl,u&&c){e.next=18;break}return e.abrupt("return",t);case 18:return v=new URL(l),f=v.hostname,p="https://".concat(f).concat(u),m="https://".concat(f).concat(c),st.set(m),console.log("[Transmit] session ready",{manifestUrl:p,trackingUrl:m}),e.abrupt("return",yn(yn({},t),{},{src:p}));case 26:return e.prev=26,e.t0=e.catch(6),console.warn("[Transmit] session init failed",e.t0),e.abrupt("return",t);case 30:case"end":return e.stop()}},e,null,[[6,26]])}))).apply(this,arguments)}var In=null;function En(e,t){var n;if(In)return console.log("[Transmit] initializeTransmit skipped — manager already initialised"),In;var i=st.get();if(!i)return console.warn("[Transmit] initializeTransmit skipped — no tracking URL"),null;var r=o.getPlayer(e);if(!r)return console.warn("[Transmit] initializeTransmit skipped — no player"),null;var a=(null===(n=r.el())||void 0===n?void 0:n.querySelector("video"))||null,l=function(e){try{var t="function"==typeof(null==e?void 0:e.currentSrc)&&e.currentSrc()||"function"==typeof(null==e?void 0:e.src)&&e.src()||"";if("application/dash+xml"===("function"==typeof(null==e?void 0:e.currentType)&&e.currentType()||"")||String(t).includes(".mpd"))return t}catch(e){}return null}(r);return(In=new hn(a,r,function(e){var n,i;console.log("[Transmit] ad event",e);var r=null==t||null===(n=t.customData)||void 0===n||null===(i=n.ads)||void 0===i?void 0:i.adEventHandler;if("function"==typeof r)try{r(e)}catch(e){console.warn("[Transmit] adEventHandler threw",e)}},{dashManifestUrl:l})).configure({disableTrackingEvents:!1}),In.addTrackingUrl(i),In.onManifestUpdated(),In}function Sn(){In&&(In.release(),In=null)}function kn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}var An=function(e,t){var n=i(e),r=n.currentTime()+t;n.currentTime(r)},On=function(e,t){var n=i(e),r=n.currentTime(),o=r<=t?0:r-t;n.currentTime(o)},Pn=function(e){return!!i.getPlayer("".concat(e))},Dn=function(){var e=t(n.mark(function e(i,r){var l,s,d,u=arguments;return n.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,ee();case 3:return s=e.sent,d=o.getPlayer(i),e.abrupt("return",new Promise(function(e,o){V(r,s).then(function(){var o=t(n.mark(function t(o){var s,u,c,v,f,p,m,h,g,y,w;return n.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(Sn(),p=null==o?void 0:o.data,a.isBotUserAgent()||(window.sid=pe()),p.contentType="linearchannel",p.channelId=null==r?void 0:r.channelId,m=(null===(s=window.customData)||void 0===s?void 0:s.ads)||(null===(u=window)||void 0===u||null===(c=u.app_data)||void 0===c||null===(v=c.appcmsMain)||void 0===v?void 0:v.adsConfig)||{},h=!(null==p||null===(f=p.linearchannel)||void 0===f||!f.isSSAIEnabled),g=h&&"MEDIA_TAILOR"==(null==m?void 0:m.vodAdSticherProvider),y=h&&"TRANSMIT"==(null==m?void 0:m.liveAdSticherProvider)&&!(null==m||!m.liveAdClientSideTracking),w=Ce(p,i),!g){t.next=17;break}return t.next=13,ut(i,p);case 13:w=t.sent,l=!0,t.next=22;break;case 17:if(!y){t.next=22;break}return t.next=20,_n(w,p,i);case 20:w=t.sent,l=!0;case 22:ie(p),w&&l?(Fn(i,w),y?En(i,{customData:window.customData||{ads:m}}):g&&At(i),d.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:p})})):(tt.get()&&0!==Object.keys(tt.get()).length&&nt({playerId:i,comscore:{enable:!0}}),e({status:!0,msg:"Feed authenticated",response:p}));case 24:case"end":return t.stop()}},t)}));return function(e){return o.apply(this,arguments)}}()).catch(function(e){o({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),Ln=function(){var e=t(n.mark(function e(i,r,a){var l,s,u,c,v,f,p;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ee();case 2:return c=e.sent,console.log("load video"),(oe()||null)&&le(r),v=0,f=0,p=null,null!==(l=window)&&void 0!==l&&l.watchHistory&&null!==(s=window)&&void 0!==s&&null!==(u=s.watchHistory)&&void 0!==u&&u.enable&&W(r,c).then(function(e){var t,n,i,r,o,a,l,s,d;(null===(t=window)||void 0===t||null===(n=t.watchHistory)||void 0===n||!n.cb||null!==(i=window)&&void 0!==i&&null!==(r=i.watchHistory)&&void 0!==r&&r.isExternal||null===(o=window)||void 0===o||null===(a=o.watchHistory)||void 0===a||a.cb(null==e?void 0:e.data),v=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,(f=(null==e||null===(s=e.data)||void 0===s?void 0:s.watchedPercentage)||null)<95)&&(p=(null==e||null===(d=e.data)||void 0===d?void 0:d.watchedTime)||null)}).catch(function(){}),e.abrupt("return",new Promise(function(e,a){R(r,c).then(function(){var r=t(n.mark(function t(r){var l,s,u,c,m,h,g,y,w,T,_,b,I,E,S,k,A,O,P,D,L,C,F,x,j,R,V,N,W,U,M,B,H,q,G,z,Q,Y,K,X;return n.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(k=null==r?void 0:r.data,A=(null==k?void 0:k.contentType)||"video",O=(null===(l=window.customData)||void 0===l?void 0:l.ads)||(null===(s=window)||void 0===s||null===(u=s.app_data)||void 0===u||null===(c=u.appcmsMain)||void 0===c?void 0:c.adsConfig)||{},P=!(null==k||null===(m=k[A])||void 0===m||!m.isSSAIEnabled),D=P&&"MEDIA_TAILOR"==(null==O?void 0:O.vodAdSticherProvider),L=P&&"TRANSMIT"==(null==O?void 0:O.liveAdSticherProvider)&&!(null==O||!O.liveAdClientSideTracking),C=!(null==k||null===(h=k[A])||void 0===h||null===(g=h.streamingInfo)||void 0===g||!g.isLiveStream)||"linearchannel"===A,ie(r.data),(F=(null==k||null===(y=k.ads)||void 0===y||null===(w=y.preRoll)||void 0===w||null===(T=w.adTags)||void 0===T||null===(_=T.web)||void 0===_?void 0:_.active)&&(null==k||null===(b=k.ads)||void 0===b||null===(I=b.preRoll)||void 0===I||null===(E=I.adTags)||void 0===E||null===(S=E.web)||void 0===S?void 0:S.url))&&Ue(i,F,k),x=Ce(k,i),!D){t.next=17;break}return t.next=14,ut(i,k);case 14:x=t.sent,t.next=22;break;case 17:if(!L||!C){t.next=22;break}return Sn(),t.next=21,_n(x,k,i);case 21:x=t.sent;case 22:if(!x){t.next=37;break}if((null==k||null===(j=k.video)||void 0===j||null===(R=j.gist)||void 0===R?void 0:R.videoImageUrl)||null==k||null===(V=k.video)||void 0===V||null===(N=V.gist)||void 0===N||null===(W=N.imageGist)||void 0===W||W.r16x9,G=o.getPlayer(i)){t.next=28;break}return console.error("[VL][player-core] player not found for id=".concat(i),{player:G}),t.abrupt("return",a({status:!1,msg:"Player not found",response:{}}));case 28:Fn(i,x),L&&C?En(i,{customData:window.customData||{ads:O}}):D&&yt(i,p),G.on("loadstart",function(){C&&e({status:!0,msg:"Video Loaded",response:k})}),G.on("loadeddata",function(){Ne(),e({status:!0,msg:"Video Loaded",response:k})}),G.one("play",function(){!v||D||L&&C||f<95&&setTimeout(function(){G.currentTime(v)},0)}),G.one("error",function(){var e;a({status:!1,msg:(null==G||null===(e=G.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==k||null===(U=k.video)||void 0===U||null===(M=U.contentDetails)||void 0===M||null===(B=M.closedCaptions)||void 0===B?void 0:B.length)>0||(null==k||null===(H=k.video)||void 0===H||null===(q=H.closedCaptions)||void 0===q?void 0:q.length)>0?(X=(null==k||null===(Q=k.video)||void 0===Q||null===(Y=Q.contentDetails)||void 0===Y?void 0:Y.closedCaptions)||(null==k||null===(K=k.video)||void 0===K?void 0:K.closedCaptions),z=X.filter(function(e){return"VTT"===e.format}),d.addCaptions(i,z)):d.removeCaptions(i),t.next=39;break;case 37:Ve(i,"Incompatible Source, only hls,mp4,drm content is allowed"),a("Incompatible Source, only hls,mp4,drm content is allowed");case 39:case"end":return t.stop()}},t)}));return function(e){return r.apply(this,arguments)}}()).catch(function(e){xn(e,i,a,r)})}));case 11:case"end":return e.stop()}},e)}));return function(t,n,i){return e.apply(this,arguments)}}(),Cn=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},Fn=function(e,t){console.log("load video in core",t);var n=o.getPlayer(e);n&&n.src(t)},xn=function(t,n,i,r){var o,a,l,s,d,u,c=null==t||null===(o=t.response)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.errorCode,v=(null==t||null===(l=t.response)||void 0===l||null===(s=l.data)||void 0===s?void 0:s.errorMessage)||(null==t?void 0:t.message);Pn(n)&&Ve(n,(null===(d=window)||void 0===d?void 0:d.customErrors)&&(null===(u=window)||void 0===u?void 0:u.customErrors[c])||"".concat(v)),i&&i(function(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?kn(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):kn(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}({status:!1,response:t,msg:"".concat(v)},r&&{videoId:r}))};exports.authenticateLC=Dn,exports.baseUrlManager=M,exports.clearError=Ne,exports.comscoreInstanceManager=tt,exports.createIdxMapping=function(e){Y=new Map,e.map(function(e,t){Y.set(e.id,t)})},exports.createSeriesWatchMap=function(e,t){var n=new Map;U({videoId:e,token:t}).then(function(e){e.data.map(function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),K=n}).catch(function(e){return console.log(e)})},exports.disableControls=function(e){var t=document.getElementById(e),n=t.getElementsByClassName("vjs-control-bar")[0];n&&(n.style.visibility="hidden");var i=t.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var r=t.getElementsByClassName("vjs-fullscreen-control")[0];r&&(r.style.display="none")},exports.dispose=function(e){Sn();var t=o.getPlayer(e),n=(tt.get()||{}).destroyComscoreTag;if(Cn(),n&&n(),o.clearEventListeners(),window.onresize=null,t)t.dispose();else{var i=document.getElementById(e);i&&i.remove()}},exports.getCurrentSeries=oe,exports.getCurrentVideo=re,exports.getDecodedToken=te,exports.getEntitlementData=function(e,t,n,i){var o,a;return r({url:n,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==i?void 0:i.latitude,longitude:null==i?void 0:i.longitude},method:"GET",headers:{Authorization:t,adbTempToken:null===(o=window)||void 0===o||null===(a=o.customData)||void 0===a?void 0:a.adbTempToken},withCredentials:!0}).catch(function(t){throw D(n,t,"content",{id:e,url:n}),t})},exports.getEpisodeNumber=Ie,exports.getLinearChannelDetails=V,exports.getSGAIEnabledSource=ut,exports.getSeasonNumber=be,exports.getSeriesDetails=function(e,t){var n,i,o=te(t),a=(null==o?void 0:o.site)||null;if(null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.seriesData)return new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.seriesData})});var l=M.get()+"/v3/content/series/".concat(e);return r({url:l,params:{site:a},method:"GET",headers:{Authorization:t}}).catch(function(t){throw D(l,t,"content",{id:e}),t})},exports.getSeriesWatchHistory=U,exports.getSeriesWatchMap=function(){return K},exports.getSource=Ce,exports.getSsaiEvents=function(e){var t=o.getPlayer(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var n=function(e,n){var i=function(e,t){return n(t)};return t.on(e,i),function(){return t.off(e,i)}};return{adBreakStart:function(e){return n(He,e)},adImpression:function(e){return n(qe,e)},adFirstQuartile:function(e){return n(Ge,e)},adMidpoint:function(e){return n(ze,e)},adThirdQuartile:function(e){return n(Qe,e)},adComplete:function(e){return n(Ye,e)},adBreakEnd:function(e){return n(Ke,e)}}},exports.getToken=ee,exports.getTransmitEnabledSource=_n,exports.getUpdatedClusterSource=function(e,t){var n=e.src,i=e.type;if(!n||"string"!=typeof n||!n.includes(".com"))return{src:n,type:i};t=t.replace(/\/$/,"");var r=n.split(".com")[1]||"";return{src:r?"".concat(t).concat(r):n,type:i}},exports.getUserId=me,exports.getVideoDetails=R,exports.getVideoIdx=function(){return Q},exports.getVideoInfo=W,exports.handleError=Ve,exports.initialiseAdvertisement=Ue,exports.initialiseComscoreStreamingTracking=nt,exports.initialiseKeyboardEvents=function(e,t){var n,i,r,a=o.getPlayer(e),l=null==a||null===(n=a.controlBar)||void 0===n||null===(i=n.playToggle)||void 0===i?void 0:i.el_,s=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",function(n){var i,r,o,d,u,c,v,f,p;if(Be.enabled&&!n.metaKey&&!n.ctrlKey&&"input"!=n.target.localName&&"textarea"!=n.target.localName){var m=n.key,h=!0===t.liveVideo||!0===t.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(m)&&(n.preventDefault(),null==s||s.focus()),m){case" ":null==l||l.click();break;case"m":case"M":a.muted(!a.muted());break;case"f":case"F":null===(i=document.querySelector(".vjs-fullscreen-control"))||void 0===i||i.click();break;case"ArrowLeft":h&&!1===t.liveui||On(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(r=window)||void 0===r||null===(o=r.app_data)||void 0===o||null===(d=o.appcmsMain)||void 0===d||null===(u=d.adsConfig)||void 0===u?void 0:u.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;h||An(e,10)}}},!0)},exports.initializeTransmit=En,exports.initiateErrorHandling=xn,exports.inititateBeacon=function(e,t){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname&&!a.isBotUserAgent()){var n=b.getConfig();if(null==n||!n.disableBeacon){null!=t&&t.userId&&(ve=t.userId);var i=o.getPlayer(e);window.initialise(i,null==t?void 0:t.analyticsCb),window.firstFrame(i,null==t?void 0:t.analyticsCb,null==t?void 0:t.analyticsEventParams),i.on("loadedmetadata",function(){window.endFirstFrame(i)})}}},exports.isPaused=function(e){return i(e).paused()},exports.isPlayerInitialised=Pn,exports.isTokenExpired=B,exports.load=Ln,exports.loadVideo=Fn,exports.loadVideoInstantly=function(e,t,n){var i=o.getPlayer(e);return i.src(t),new Promise(function(e,t){var r=0;i.one("loadedmetadata",function(){clearTimeout(r),e({status:!0,msg:"video loaded"})}),i.one("loadstart",function(e){r=setTimeout(function(){t("FAILED: Took too long to load")},n)})})},exports.pause=function(e){i(e).pause()},exports.play=function(e){i(e).play()},exports.playerConfigManager=b,exports.refreshTokenManager=q,exports.rewind=On,exports.runGtag=function(e){window.dataLayer=window.dataLayer||[],h("js",new Date),h("config",e)},exports.saveWatchHistory=N,exports.seasonIdxManager=se,exports.setCurrentSeries=function(e){G=e},exports.setCurrentVideo=ie,exports.setUserId=function(e){e&&"undefined"!=typeof window&&window.sessionStorage&&window.sessionStorage.setItem("uid",e)},exports.setVideoIdx=ae,exports.setVideoIdxById=le,exports.setupAdvertisementMarkers=yt,exports.setupAdvertisementMarkersForLinear=At,exports.skip=An,exports.token_authentication_enabled=function(e){var t=!0,n=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return n&&!i&&(t=!1),t},exports.trackMap=gt,exports.trackingUrlManager=st,exports.videoReplayTracker=ne;
|