@viewlift/player-backup 2.0.295-backup → 2.0.296-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/bundle.css +849 -829
- package/cjs/{index-b639e99c.js → index-229dec72.js} +1 -1
- package/cjs/index.js +1 -1
- package/cjs/{skin-3a02681c.js → skin-8780e2a2.js} +1 -1
- package/esm/bundle.css +849 -829
- package/esm/components/chapters/markers.d.ts +6 -0
- package/esm/{index-8acba85e.js → index-2be4a3d8.js} +1 -1
- package/esm/index.js +1 -1
- package/esm/{skin-4d5df1a3.js → skin-f95bee67.js} +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-9fa3c0bb.js"),n=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/regenerator"),i=require("video.js"),o=require("@babel/runtime/helpers/classCallCheck"),l=require("@babel/runtime/helpers/createClass"),a=require("@babel/runtime/helpers/get"),u=require("@babel/runtime/helpers/inherits"),s=require("@babel/runtime/helpers/possibleConstructorReturn"),d=require("@babel/runtime/helpers/getPrototypeOf"),c=require("./util-0574b423.js"),v=require("./captions-676468fe.js"),f=require("./renditions-508e7f85.js"),p=require("./resolution-e6b8a4eb.js"),m=require("./skin-c6084619.js"),g=require("./browser-77c57718.js"),h=require("./localisation-56e0a999.js"),y=require("@babel/runtime/helpers/typeof");require("@viewlift/comscore/index.js");var b=require("@babel/runtime/helpers/toConsumableArray"),w=require("@babel/runtime/helpers/slicedToArray"),k=require("@viewlift/sse");function S(e,n,t,r){var i=a(d(1&r?e.prototype:e),n,t);return 2&r&&"function"==typeof i?function(e){return i.apply(t,e)}:i}function T(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(T=function(){return!!e})()}var E=i.getComponent("TextTrackSettings"),C=i.dom,I=[{value:"12",label:"12px"},{value:"14",label:"14px"},{value:"16",label:"16px"},{value:"18",label:"18px"},{value:"20",label:"20px"},{value:"24",label:"24px"},{value:"28",label:"28px"},{value:"32",label:"32px"}],P=I.map(function(e){return e.value}),D="16",O="vlp-caption-font-size-px",j="vlp-caption-font-size-style",x=".vjs-font-percent > select",N=function(e){return-1!==P.indexOf(e)?e:D},A=null;E?(A=function(){u(r,E);var e,n,t=(e=r,n=T(),function(){var t,r=d(e);if(n){var i=d(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return s(this,t)});function r(e,n){var i;return o(this,r),(i=t.call(this,e,n)).customUiReady_=!0,i.applyCustomFontSizeUI_(),i}return l(r,[{key:"applyCustomFontSizeUI_",value:function(){this.replaceFontSizeOptions_(),this.bindFontSizeChange_(),this.restoreCustomFontSize_()}},{key:"replaceFontSizeOptions_",value:function(){var e=this.$(x);if(e){for(;e.firstChild;)e.removeChild(e.firstChild);I.forEach(function(n){e.appendChild(C.createEl("option",{value:n.value,textContent:n.label}))}),e.value=D}}},{key:"bindFontSizeChange_",value:function(){var e=this,n=this.$(x);n&&this.on(n,"change",function(){return e.applyFontSize_(n.value)})}},{key:"applyFontSize_",value:function(e){var n=N(e);if("undefined"!=typeof document){var t=document.getElementById(j);t||((t=document.createElement("style")).id=j,document.head.appendChild(t)),t.textContent=[".vjs-text-track-cue,",".vjs-text-track-cue > div,",".vjs-text-track-display-ttml,",".vjs-text-track-display-ttml span,",".vjs-text-track-display-ttml div","{ font-size: ".concat(n,"px !important; line-height: normal !important; }")].join(" ")}}},{key:"restoreCustomFontSize_",value:function(){var e=null;try{e=window.localStorage.getItem(O)}catch(e){}var n=N(e),t=this.$(x);t&&(t.value=n),this.applyFontSize_(n)}},{key:"getValues",value:function(){var e=S(r,"getValues",this,3)([]);return e&&delete e.fontPercent,e||{}}},{key:"setDefaults",value:function(){if(S(r,"setDefaults",this,3)([]),this.customUiReady_){var e=this.$(x);e&&(e.value=D),this.applyFontSize_(D)}}},{key:"saveSettings",value:function(){if(S(r,"saveSettings",this,3)([]),this.options_&&this.options_.persistTextTrackSettings){var e=this.$(x);if(e)try{window.localStorage.setItem(O,N(e.value))}catch(e){}}}},{key:"handleLanguagechange",value:function(){S(r,"handleLanguagechange",this,3)([]),this.applyCustomFontSizeUI_()}}]),r}(),i.registerComponent("TextTrackSettings",A)):console.warn("[vlp] CustomTextTrackSettings: video.js TextTrackSettings is not registered; skipping override.");var M=function(e){return new Promise(function(n,t){if(R(e))t("".concat(e," is alread initialised"));else{var r=document.createElement("script");r.async=!0,r.src=e,r.onload=function(){n()},r.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(r)}})},R=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},_=function(e,n,t){var r=m.getPlayer(e);if(r)if(n>=0&&n<=100){r.muted()&&r.muted(!1);var i=parseFloat(n)/100;r.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},L=function(e){var n=m.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},B=function(){var e=t(r.mark(function e(n){var t,o,l,a,u;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=m.getPlayer(null==n?void 0:n.playerId),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=22;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return a=e.sent,e.prev=5,e.next=8,M("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,a.default(i),e.finish(13);case 16:(u=i.getTech("chromecast"))&&!u.prototype.seeking&&(u.prototype.seeking=function(){}),null!==(l=window)&&void 0!==l&&l.cast?null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=n&&n.chromecastReceiverId&&null!=n&&n.airplay&&"Safari"==g.detectBrowser()?null==o||o.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return e.stop()}},e,null,[[5,10,13,16]])}));return function(n){return e.apply(this,arguments)}}(),V=function(e,n){var t=m.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,r,o,l,a,u=this.el(),s=i.dom.getPointerPosition(u,n).x;i.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(o=r.framework)||void 0===o||null===(l=o.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(d),d&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),f=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=f*s,v.seek()}})};var U=function(){var e=t(r.mark(function e(){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),M("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then(function(){}).catch(function(e){return console.log(e)})]);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),F=function(){var n=t(r.mark(function n(){return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,import("@viewlift/comscore/index.js").then(function(n){e.comscoreInstanceManager.set(n)});case 2:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}(),q=function(){var e=t(r.mark(function e(){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then(function(e){i.getPlugin("eme")||i.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),H=function(){var e=t(r.mark(function e(){var n;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(i),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}},e,null,[[0,10]])}));return function(){return e.apply(this,arguments)}}(),z=function(){var e=t(r.mark(function e(){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then(function(){return require("./index-84cce26a.js")});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}},e,null,[[0,5]])}));return function(){return e.apply(this,arguments)}}(),G=function(){var e=t(r.mark(function e(){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then(function(){return require("./videojs-dash5.es-072614bc.js")});case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),K=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){M("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(i)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(i)})},loadAdsLibrary:U,loadEMELibrary:q,loadMuxPlugin:H,loadDvrSeekbar:z,loadContribDash:G,loadComscorePlugin:F});function W(e){return Y.apply(this,arguments)}function Y(){return(Y=t(r.mark(function e(n){var t;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,U();case 3:t&&"Safari"==g.detectBrowser()&&Promise.resolve().then(function(){return K}).then(function(e){e.importAirplay()});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function $(e){return J.apply(this,arguments)}function J(){return(J=t(r.mark(function e(n){var t,i,o,l,a,u,s,d,c,v;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return v=m.getPlayer(n.playerId),e.next=3,F();case 3:v.comscore({publisherId:null==n||null===(t=n.comscore)||void 0===t?void 0:t.publishedId,endpoint:null==n||null===(i=n.comscore)||void 0===i?void 0:i.endpoint,applicationName:(null==n||null===(o=n.comscore)||void 0===o?void 0:o.applicationName)||(null===(l=window)||void 0===l?void 0:l.siteName)||null,implementationId:null==n||null===(a=n.comscore)||void 0===a?void 0:a.implementationId,projectId:null==n||null===(u=n.comscore)||void 0===u?void 0:u.projectId,debug:(null==n||null===(s=n.comscore)||void 0===s?void 0:s.debug)||!1,persistentLabels:(null==n||null===(d=n.comscore)||void 0===d?void 0:d.persistentLabels)||{},metadata:(null==n||null===(c=n.comscore)||void 0===c?void 0:c.metadata)||{}});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function X(e,n){return Q.apply(this,arguments)}function Q(){return(Q=t(r.mark(function e(n,t){var i,o,l,a,u,s,d,c,v,f,p,m,h,y;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return v=(null==t?void 0:t.contentType)||"video",f=null==t||null===(i=t[v])||void 0===i?void 0:i.drmEnabled,null==t||null===(o=t[v])||void 0===o||null===(l=o.liveDetails)||void 0===l||l.isDvrEnabled,null==n||n.showPositiveSeekbar,p=(null==t||null===(a=t[v])||void 0===a||null===(u=a.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.dash)||null,m=(null==n||null===(d=n.comscore)||void 0===d?void 0:d.enable)||!1,h=!(null==n||null===(c=n.analytics)||void 0===c||!c.muxKey),e.prev=7,e.next=10,Promise.allSettled([f?"Safari"==g.detectBrowser()?q():"caliente"!=(null===(y=window)||void 0===y?void 0:y.siteName)?G():q():"Safari"!=g.detectBrowser()&&p?G():null,m?$(n):null,h?H():null,B(n)]);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(7),console.log("Error",e.t0);case 15:case"end":return e.stop()}},e,null,[[7,12]])}))).apply(this,arguments)}function Z(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function ee(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var ne=new Set,te=null,re=function(n,t,r,i){var o,l,a,u,s,d,c,v={},f=(null==n?void 0:n.contentType)||"video";v["c3.cm.id"]=(null===(o=n[f])||void 0===o?void 0:o.id)||"Null",v["c3.cm.contentType"]=de(n),v[null==r||null===(l=r.Constants)||void 0===l?void 0:l.IS_LIVE]=!(null==n||!n.linearchannel),v[null==r||null===(a=r.Constants)||void 0===a?void 0:a.STREAM_URL]=t.currentSrc(),v[null==r||null===(u=r.Constants)||void 0===u?void 0:u.VIEWER_ID]="undefined"===e.getUserId()?"NULL":e.getUserId(),v["c3.cm.categoryType"]=ae(n),v["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),v.DRMEnabled=(null===(s=n[f])||void 0===s?void 0:s.drmEnabled)||"None",v.DAIStream=null!==(d=n[f])&&void 0!==d&&null!==(c=d.gist)&&void 0!==c&&c.isSSAIEnabled?"YES":"NO",v[r.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=ue(n),v["c3.cm.genreList"]=oe(n),v["c3.cm.genre"]=ie(n),v["c3.cm.channel"]=le(n,i);var p=fe(e.getCurrentSeries(),n);return v=ee(ee({},v),p)},ie=function(e){var n,t,r,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(r=t.primaryCategory)||void 0===r?void 0:r.title)||"Null"},oe=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map(function(e){return null==e?void 0:e.title}).join(", ")||"Null"},le=function(e,n){var t,r,i=(null==e?void 0:e.contentType)||"video";return"video"===i?"VOD":(null===(r=((null==e||null===(t=e[i])||void 0===t?void 0:t.channels)||[]).find(function(e){return(null==e?void 0:e.id)===(null==n?void 0:n.channelId)}))||void 0===r?void 0:r.title)||"NULL"},ae=function(e){var n,t;return null!=e&&e.linearchannel?"Linear Channel":null!=e&&null!==(n=e.video)&&void 0!==n&&null!==(t=n.streamingInfo)&&void 0!==t&&t.isLiveStream?"Live Event":"VOD"},ue=function(e){var n,t,r=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[r])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},se=function(e,n){var t,r,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var o=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[o])||void 0===t||null===(r=t.gist)||void 0===r?void 0:r.title)||"Null";return"".concat(l)},de=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var ce,ve,fe=function(n,t){var r,i,o,l,a,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!n||!t||null!=t&&t.linearchannel)return u;var s=e.getSeasonNumber(),d=e.getEpisodeNumber();return u["c3.cm.seriesName"]=(null==t||null===(r=t.video)||void 0===r||null===(i=r.series)||void 0===i?void 0:i.title)||"Null",u["c3.cm.seasonNumber"]=(null==s?void 0:s.toString())||"Null",u["c3.cm.showTitle"]=(null==n||null===(o=n[s-1])||void 0===o||null===(l=o.episodes)||void 0===l||null===(a=l[d-1])||void 0===a?void 0:a.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},pe=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},me=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},ge=function(){var n=t(r.mark(function n(t,i){var o,l,a,u,s,d,c,v,f,p,g,h;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(o=(null==i?void 0:i.convivaConfig)||{},l=o.trackConvivaPlayerEvent,a=o.paymentHandler,u=o.tveProvider,s=o.enable,d=o.appName,v=(c=i||{}).token,f=c.epg,s){n.next=4;break}return n.abrupt("return");case 4:if(p=m.getPlayer(t),"function"==typeof(g=l)){n.next=8;break}return n.abrupt("return");case 8:return n.next=10,g("getConvivaObject");case 10:if(h=n.sent){n.next=13;break}return n.abrupt("return");case 13:p.ready(function(){var e=p.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var r=pe(t.keySystem);g("contentInfo",{DRMEnabled:r})}else g("contentInfo",{DRMEnabled:"None"})}),n||g("contentInfo",{DRMEnabled:"None"})}),p.on("loadstart",function(){var n,t;te&&te!==p.currentSrc()&&g("playbackEnded"),g("setPlayer",p),ne.clear(),te=p.currentSrc();var r=me(p.currentType()),o=e.getCurrentVideo(),l=re(o,p,h,f);l[null==h||null===(n=h.Constants)||void 0===n?void 0:n.PLAYER_NAME]=d||"WEB",l[null==h||null===(t=h.Constants)||void 0===t?void 0:t.ASSET_NAME]=se(o,i),l.authToken=v||"NULL",l.streamType=r,l.D2CType=a||"NONE",l.subscriberType=u?"MVPD":"FREE"!==a?"D2C":"FREE",l["c3.cm.affiliate"]=u||"NULL",he.setData(l),g("contentInfo",l)}),p.on("loadedmetadata",function(){var e,n=p.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),g("contentInfo",{screenResolution:e})}),p.on("play",function(){ne.has(p.currentSrc())||(ne.add(p.currentSrc()),g("playbackStarted",null))}),p.on("ended",function(){ne.has(p.currentSrc())&&ne.delete(p.currentSrc()),g("playbackEnded")}),p.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&g("initAdSensor",{player:p,adsLoader:null==e?void 0:e.adsLoader})}),p.on("dispose",function(){null==ne||ne.clear(),g("playbackEnded")});case 20:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}(),he=(ce={},{setData:function(e){ce=ee(ee({},ce),e)},getData:function(){return ce}}),ye=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then(function(){return require("./skin-c3708fa0.js")}).then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?Promise.resolve().then(function(){return require("./skin-f724b38f.js")}).then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?Promise.resolve().then(function(){return require("./skin-83da696f.js")}).then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?Promise.resolve().then(function(){return require("./skin-01f53e99.js")}).then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?Promise.resolve().then(function(){return require("./skin-55abd2ce.js")}).then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?Promise.resolve().then(function(){return require("./skin-9bf9775b.js")}).then(function(t){t.initialiseSkin(e,n)}):"news"==t?Promise.resolve().then(function(){return require("./skin-13f17735.js")}).then(function(t){t.initialiseSkin(e,n)}):"news_live"==t?Promise.resolve().then(function(){return require("./skin-a810173d.js")}).then(function(t){t.initialiseSkin(e,n)}):"mini"==t?Promise.resolve().then(function(){return require("./skin-29bb949b.js")}).then(function(t){t.initialiseSkin(e,n)}):"CN_NEWS"==t&&Promise.resolve().then(function(){return require("./skin-3a02681c.js")}).then(function(t){t.initialiseSkin(e,n)})};function be(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function we(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?be(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):be(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var ke=[],Se=0,Te=null;function Ee(){ve=null,ke=[],Se=0,Te=null}function Ce(t,r,i){var o,l,a,u,s,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==r||null===(o=r.watchHistory)||void 0===o||o.apiVersion;var c=null==r||null===(l=r.watchHistory)||void 0===l?void 0:l.profileId,v=Math.floor(t.currentTime()),f=Math.floor(t.duration());null==r||null===(a=r.watchHistory)||void 0===a||a.xapiKey;var p=(null==r||null===(u=r.video)||void 0===u?void 0:u.originalObjectId)||null,m=(null==r||null===(s=r.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,g=Math.floor(t.currentTime()),h=d?100:Math.floor(v/f*100),y={};m?function(t,r,i){var o=r?"watchhistory-data-".concat(r):"watchhistory-data-guest-".concat(i),l=Ie(o),a=(new Date).getTime(),u=e.getCurrentVideo(),s=(null==u?void 0:u.video)||{},d=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,t){return we(we({},e),{},n({},t,s[t]))},{}),c=l.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===ve});c<0?l.push(we(we({content:d},t),{},{addedDate:a,updateDate:a})):l[c]=we(we(we({},l[c]),t),{},{updateDate:a});localStorage.setItem("".concat(o),JSON.stringify(l))}(y={completed:d,watchedTime:g,watchedPercentage:h},c,r.siteOwner):(y=we(we({videoId:ve,watchedTime:g,watchedPercentage:h,doneWatching:d,profileId:c},Te&&{seriesId:Te}),p&&{originalObjectId:p}),e.saveWatchHistory(y).then(function(e){}).catch(function(e){})),Se=v+i}function Ie(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Pe(e,n,t){var r=Ie(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return r&&Array.isArray(r)&&(i=r.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),i}var De=!1,Oe=function(n,t){var r,i,o=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(r=n[o])||void 0===r||null===(i=r.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!De){var l=je(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),De=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function je(e,n,t){if(Array.isArray(e))return e.map(function(e){return je(e,n,t)});if(null!==e&&"object"===y(e)){var r={};return Object.keys(e).forEach(function(i){i===n&&void 0!==e[t]?r[i]=e[t]:i===t&&void 0!==e[n]?r[i]=e[n]:r[i]=je(e[i],n,t)}),r}return e}function xe(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return Ne(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ne(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,o=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw o}}}}function Ne(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function Ae(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Me(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ae(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ae(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Re=function(n,t,r,i){var o,l,a,u,s,d=i.res,c=i.sres,f=m.getPlayer(n),p=(null==d?void 0:d.contentType)||"video",h=(null==d||null===(o=d[p])||void 0===o?void 0:o.drmEnabled)||!1,b=!(null==d||null===(l=d[p])||void 0===l||null===(a=l.streamingInfo)||void 0===a||!a.isLiveStream)||"linearchannel"===p,w=(null==d||null===(u=d[p])||void 0===u||null===(s=u.liveDetails)||void 0===s?void 0:s.isDvrEnabled)||!1;e.setCurrentVideo(d),e.videoReplayTracker.set(d),f&&(f.on("loadstart",function(){b?r.resolve({status:!0,msg:"Video Loaded",response:d}):r.resolve(Me({status:!0,msg:"Player Initialised"},c?{seriesResponse:c,response:d}:{response:d}))}),f.on("loadeddata",function(){var r,i,o,l=v.getCaptions(n);if(null==l||l.map(function(e){return v.disableCaptions(n,e.id)}),w&&"Safari"===g.detectBrowser())try{var a;null==f||null===(a=f.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==f||!f.muted())&&_(n,sessionStorage.getItem("volume")||"100");var u=e.getCurrentVideo();if(e.initialiseComscoreStreamingTracking(t),e.clearError(),null!=t&&t.watchHistory&&null!=t&&null!==(r=t.watchHistory)&&void 0!==r&&r.enable&&(!t.isAnonymousUser||null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.saveOffline)){var s,c,p=Me(Me({},t),d);!function(e,n,t){var r,i,o;null!=n&&n.series&&null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable&&(Te=null==n||null===(i=n.series)||void 0===i?void 0:i.id),ke=[],Se=0,ve=t;var l=(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.interval)||30,a=m.getPlayer(e);a&&(a.on("dispose",Ee),a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());ke.includes(Se)||(e!=Se||e<l?e>Se&&(Se=e+l):(ke.push(e),Ce(a,n,l)))}}),a.one("ended",function(){Ce(a,n,l,!0)}))}(n,p,null==u||null===(s=u.video)||void 0===s||null===(c=s.gist)||void 0===c?void 0:c.id)}if(null!=t&&null!==(o=t.analytics)&&void 0!==o&&o.muxKey&&null!=f&&f.mux){var h,y,b,k,S,T,E=(null===(h=e.getCurrentVideo())||void 0===h?void 0:h.video)||(null==d?void 0:d.video),C=null==E?void 0:E.gist,I={env_key:null==t||null===(y=t.analytics)||void 0===y?void 0:y.muxKey,player_name:"vl-web-player",player_version:null===(b=window)||void 0===b?void 0:b.vl_player_version,video_id:null==C?void 0:C.id,video_title:null==C?void 0:C.title,video_series:null==E||null===(k=E.series)||void 0===k?void 0:k.title,video_stream_type:null!=E&&null!==(S=E.streamingInfo)&&void 0!==S&&S.isLiveStream?"live":"video",viewer_user_id:null==t||null===(T=t.analytics)||void 0===T?void 0:T.userId};f.mux({debug:!1,data:I})}}),f.textTracks().on("change",function(e){var n=this.tracks_.filter(function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0})[0];f.trigger("subtitlechanged",n)}),f.on("subtitlechanged",function(e,n){var t,r,i,o,l,a,u,s,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(i=r.framework)||void 0===i||null===(o=i.CastContext)||void 0===o||null===(l=o.getInstance())||void 0===l?void 0:l.S,p=null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(s=u.framework)||void 0===s||null===(d=s.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===f){var m,g=p.getMediaSession(),h=g.media.tracks.filter(function(e){return"TEXT"==e.type});m=n?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}}),f.tech_.on("retryplaylist",function(){b&&Oe(d,n)}),f.on("error",function(){var t,i;(console.log("ERROR",f.error(),f.error().code),4===f.error().code&&b)?Oe(d,n):(e.handleError(n,(null==f||null===(t=f.error())||void 0===t?void 0:t.message)||"Some error occured"),r.reject({status:!1,msg:(null==f||null===(i=f.error())||void 0===i?void 0:i.message)||"Some error occured",response:d}))}),f.one("play",function(){var n,r,i,o,l;if(null===(n=window)||void 0===n||null===(r=n.app_data)||void 0===r||null===(i=r.appcmsMain)||void 0===i||null===(o=i.adsConfig)||void 0===o||!o.vodAdClientSideTracking){if(null!=t&&null!==(l=t.series)&&void 0!==l&&l.enable){var a,u,s,d=null===(a=e.getCurrentVideo())||void 0===a||null===(u=a.video)||void 0===u||null===(s=u.gist)||void 0===s?void 0:s.id,c=e.getSeriesWatchMap(),v=(null==c?void 0:c.get(d))||{t:0,p:0},p=v.t,m=v.p;p&&m<95&&setTimeout(function(){f.currentTime(p)},0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout(function(){f.currentTime(null==t?void 0:t.watchHistoryResumeTime)},0);if(null!=f&&f.dvrSeekbar)try{f.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}}),f.on("volumechange",function(){var e=100*f.volume().toFixed(2);f.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),f.on("chromecastDisconnected",function(){if(b){f.currentSource();for(var e=f.textTracks(),n=e.length-1;n>=0;n--)f.removeRemoteTextTrack(e[n])}}),f.one("loadeddata",function(){var e,n=(null==f||null===(e=f.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort(function(e,n){var t=(e.language||e.language||"").toUpperCase(),r=(n.language||n.label||"").toUpperCase();return t<r?-1:t>r?1:0}),"object"==y(f.dash)){var t,r,i,o=null==f||null===(t=f.dash)||void 0===t||null===(r=t.mediaPlayer)||void 0===r?void 0:r.getTracksFor("audio"),l=null==o?void 0:o.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),a=xe(n);try{for(a.s();!(i=a.n()).done;){var u=i.value;if(l&&(null==u?void 0:u.id)=="dash-audio-".concat(l.index)){u.enabled=!0;break}}}catch(e){a.e(e)}finally{a.f()}}else{var s,d=xe(n);try{for(d.s();!(s=d.n()).done;){var c,v,p,m=s.value;if(("Chrome"==g.detectBrowser()||"Edge"==g.detectBrowser()&&(null!==(c=navigator)&&void 0!==c&&null!==(v=c.userAgent)&&void 0!==v&&v.includes("Macintosh")||!h))&&null!=m&&null!==(p=m.label)&&void 0!==p&&p.includes("5.1"))f.audioTracks().removeTrack(m);else{if("main"==m.kind){m.enabled=!0;break}m.enabled=!1}}}catch(e){d.e(e)}finally{d.f()}}}))};function _e(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Le(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_e(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_e(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Be=function(o,l,a,u){var s,d,c,f,p,h,y,b,w,k,S,T,E,C,I,P,D,O,j,x,N,A,M,R,_,L,B,U,F,q,H,z,G,K,W,Y,$,J,Q,Z=l.res,ee=void 0===Z?null:Z,ne=l.sres,te=void 0===ne?null:ne,re=null!=a&&a.chromecastReceiverId?["chromecast","html5"]:["html5"],ie=(null===(s=ee)||void 0===s?void 0:s.contentType)||"video",oe=m.impolicy16x9(null===(d=ee)||void 0===d||null===(c=d[ie])||void 0===c||null===(f=c.gist)||void 0===f?void 0:f.videoImageUrl)||m.impolicy16x9(null===(p=ee)||void 0===p||null===(h=p[ie])||void 0===h||null===(y=h.gist)||void 0===y||null===(b=y.imageGist)||void 0===b?void 0:b.r16x9),le=(null===(w=ee)||void 0===w||null===(k=w[ie])||void 0===k||null===(S=k.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,ae=!(null===(T=ee)||void 0===T||null===(E=T[ie])||void 0===E||null===(C=E.streamingInfo)||void 0===C||!C.isLiveStream)||"linearchannel"===ie,ue=(null===(I=ee)||void 0===I||null===(P=I.ads)||void 0===P||null===(D=P.preRoll)||void 0===D||null===(O=D.adTags)||void 0===O||null===(j=O.web)||void 0===j?void 0:j.active)&&(null===(x=ee)||void 0===x||null===(N=x.ads)||void 0===N||null===(A=N.preRoll)||void 0===A||null===(M=A.adTags)||void 0===M||null===(R=M.web)||void 0===R?void 0:R.url);ee=Le(Le({},ee),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var se=(null==a||null===(_=a.customData)||void 0===_?void 0:_.ads)||{},de=(null===(L=ee)||void 0===L||null===(B=L[ie])||void 0===B?void 0:B.isSSAIEnabled)&&"MEDIA_TAILOR"==(null==se?void 0:se.vodAdSticherProvider)||!1,ce=!(null===(U=ee)||void 0===U||null===(F=U[ie])||void 0===F||!F.isSSAIEnabled)&&"TRANSMIT"==(null==se?void 0:se.liveAdSticherProvider)&&!(null==se||!se.liveAdClientSideTracking),ve=(null==a?void 0:a.latency)||6,fe=(null==a?void 0:a.skin_settings)||{},pe=(J={enableSmoothSeeking:!0,controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==a?void 0:a.muted)||!1,autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==fe?void 0:fe.pictureInPictureToggle)||!1},playbackRates:null!=fe&&fe.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==a.skin,liveui:le},n(J,"autoplay",null==a?void 0:a.autoplay),n(J,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!ue),n(J,"loop",(null==a?void 0:a.loop)||!1),n(J,"audioPosterMode",null==a?void 0:a.audioPosterMode),n(J,"html5",Le(Le({dash:Le(Le(Le({},!i.browser.IS_SAFARI&&{useTTML:!0}),(null==a?void 0:a.debugConfig)&&(null==a||null===(q=a.debugConfig)||void 0===q?void 0:q.enable)&&{debug:!0,logLevel:null!=a&&null!==(H=a.debugConfig)&&void 0!==H&&H.logLevel?null==a||null===(z=a.debugConfig)||void 0===z?void 0:z.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:ve},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:Le({},"IE"==g.detectBrowser()&&{enableStallFix:!0,stallSeek:1}),abr:Le(Le(Le(Le({},(null==a?void 0:a.initialBandwidth)&&{initialBitrate:{audio:-1,video:(null==a?void 0:a.initialBandwidth)/1e3}}),(null==a?void 0:a.maxBitrate)&&{maxBitrate:{audio:-1,video:(null==a?void 0:a.maxBitrate)/1e3}}),(null==a?void 0:a.minBitrate)&&{minBitrate:{audio:-1,video:(null==a?void 0:a.minBitrate)/1e3}}),{},{rules:{throughputRule:{active:!0},bolaRule:{active:!1},insufficientBufferRule:{active:!1},switchHistoryRule:{active:!1},droppedFramesRule:{active:!1},abandonRequestsRule:{active:!1}},autoSwitchBitrate:{video:!0,audio:!0}})}}}),vhs:Le(Le(Le({},(null==a?void 0:a.initialBandwidth)&&{bandwidth:a.initialBandwidth}),{},{liveRangeSafeTimeDelta:ve,useDevicePixelRatio:!0,experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:null==a||!a.initialBandwidth},(null==a||null===(G=a.customData)||void 0===G?void 0:G.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null!==(K=null==a?void 0:a.enableLowInitialPlaylist)&&void 0!==K&&K}),debug:(null==a?void 0:a.debugConfig)&&(null==a||null===(W=a.debugConfig)||void 0===W?void 0:W.enable)||!1,nativeTextTracks:"Safari"==g.detectBrowser()},0==(null==a||null===(Y=a.customData)||void 0===Y?void 0:Y.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===($=a.customData)||void 0===$?void 0:$.nativeVideoTracks)&&{nativeVideoTracks:!1})),n(J,"poster",oe),n(J,"techOrder",re),n(J,"chromecast",{requestCustomDataFn:function(n){var t,r,i=m.getPlayer(o),l=((null==i?void 0:i.textTracksJson_)||i.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind}),u=function(e,n,t){var r,i,o,l,a,u,s,d,c,v,f=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){var m,g,h,y,b,w,k,S;p.isDrmEnabled=!0;var T=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,E=(null==T?void 0:T.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(h=g[0])||void 0===h||null===(y=h.options)||void 0===y?void 0:y.serverURL);p.licenseUrl=E;var C=(null==T?void 0:T.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(S=k.httpRequestHeaders)||void 0===S?void 0:S["X-AxDRM-Message"]);p.licenseToken=C}var I=(null==e||null===(r=e[f])||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.contentType)||"VIDEO";p.contentType=I;var P=null==e||null===(o=e[f])||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.runtime;p.duration=P;var D=null==e||null===(a=e[f])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;p.mediaTitle=D;var O=null==e||null===(s=e[f])||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.videoImageUrl;return p.mediaImage=O,p.subTitles=t,p.DVR=(null==e||null===(c=e[f])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(ee,n,l);return Le(Le({},u),{},{transmitTrackingUrl:e.trackingUrlManager.get()||null,convivaMetaData:Le({customerKey:(null==a||null===(t=a.convivaConfig)||void 0===t?void 0:t.customerKey)||null,debug:(null==a||null===(r=a.convivaConfig)||void 0===r?void 0:r.debug)||!1},he.getData())})},modifyLoadRequestFn:function(e){var n,t,r,i,l,a=m.getPlayer(o),u=(null==a?void 0:a.currentSource())||{};!(null===(n=ee)||void 0===n||null===(t=n[ie])||void 0===t||null===(r=t.streamingInfo)||void 0===r||null===(i=r.videoAssets)||void 0===i?void 0:i.is4K)&&1||null!=u&&u.src&&null!=u&&null!==(l=u.src)&&void 0!==l&&l.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),J);if(!i.getPlayers()[o]){null!=a&&a.debugConfig&&null!=a&&null!==(Q=a.debugConfig)&&void 0!==Q&&Q.enable&&i.log.level("debug");var me=i(o,pe,function(){var n=t(r.mark(function n(){var t,l,s,d,c,f,p,m,g,h,y,b,w,k,S,T,E,C,I,P;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(me),console.log(i.VERSION),console.log(i.getPlugins()),n.next=5,X(a,ee);case 5:if(b=null===(t=ee)||void 0===t||null===(l=t[ie])||void 0===l||null===(s=l.liveDetails)||void 0===s?void 0:s.startOverTime,ae&&u.resolve(Le({status:!0,msg:"Player Initialised"},te?{seriesResponse:te,response:ee}:{response:ee})),e.inititateBeacon(o,{analyticsCb:null==a?void 0:a.analyticsCb,analyticsEventParams:null==a?void 0:a.analyticsEventParams,userId:null==a?void 0:a.userId}),ge(o,a),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),le&&V(o,b),!ue||null!=a&&null!==(d=a.customData)&&void 0!==d&&d.disableAds||e.initialiseAdvertisement(o,ue,ee),w=e.getSource(ee,o),console.log(w),null!=a&&a.nearestClusterUrl&&(w=e.getUpdatedClusterSource(w,a.nearestClusterUrl)),!de){n.next=21;break}return n.next=18,e.getSGAIEnabledSource(o,ee);case 18:w=n.sent,n.next=25;break;case 21:if(!ce){n.next=25;break}return n.next=24,e.getTransmitEnabledSource(w,ee,o);case 24:w=n.sent;case 25:w?e.loadVideo(o,w):(u.reject({status:!1,msg:"Incompatible / Missing Source",response:ee}),e.handleError(o,"Incompatible / Missing Source")),((null===(c=ee)||void 0===c||null===(f=c[ie])||void 0===f||null===(p=f.contentDetails)||void 0===p||null===(m=p.closedCaptions)||void 0===m?void 0:m.length)>0||(null===(g=ee)||void 0===g||null===(h=g[ie])||void 0===h||null===(y=h.closedCaptions)||void 0===y?void 0:y.length)>0)&&(P=(null===(S=ee)||void 0===S||null===(T=S[ie])||void 0===T||null===(E=T.contentDetails)||void 0===E?void 0:E.closedCaptions)||(null===(C=ee)||void 0===C||null===(I=C[ie])||void 0===I?void 0:I.closedCaptions),k=P.filter(function(e){return"VTT"===e.format}),v.addCaptions(o,k)),null!=a&&a.disableControls?e.disableControls(o):ye(o,Le(Le(Le({},a),pe),{},{liveVideo:ae,isDvrEnabled:le,res:ee,sres:te})),Re(o,Le(Le(Le({},a),pe),{},{liveVideo:ae}),u,{res:ee,sres:te});case 29:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}())}};function Ve(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Ue(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ve(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Fe,qe=function(e,n){var t=n.resolve,r=n.reject,i=null==e?void 0:e.playerId,o=He(e);Be(i,{res:o},e,{resolve:t,reject:r})},He=function(n){var t,r,i,o,l,a,u,s,d,c,v,f,p,m=null==n?void 0:n.streamingInfo,g=null==n||null===(t=n.streamingInfo)||void 0===t?void 0:t.videoAssets,h=(null==n||null===(r=n.streamingInfo)||void 0===r?void 0:r.isDrmEnabled)||null,y=(null==n||null===(i=n.streamingInfo)||void 0===i||null===(o=i.ads)||void 0===o?void 0:o.url)||null,w=(null==n||null===(l=n.streamingInfo)||void 0===l?void 0:l.posterUrl)||null,k=(null==n||null===(a=n.streamingInfo)||void 0===a?void 0:a.subtitles)||[],S=(null==n||null===(u=n.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.drmProvider)||null,T=(null==n||null===(d=n.streamingInfo)||void 0===d?void 0:d.macroMap)||[],E=(null==n||null===(c=n.customData)||void 0===c||null===(v=c.ads)||void 0===v?void 0:v.isSSAIEnabled)||!1,C=null==n?void 0:n.token,I=e.getDecodedToken(C);null==I||I.site;var P=null==I?void 0:I.siteId,D=(null==n||null===(f=n.customData)||void 0===f||null===(p=f.comscore)||void 0===p?void 0:p.video)||null,O=Ue(Ue({id:"".concat(P,"_external")},!h&&{directPlaybackUrl:null==g?void 0:g.url}),{},{video:Ue(Ue(Ue(Ue(Ue({drmEnabled:h,streamingInfo:Ue(Ue({videoAssets:Ue(Ue({},S&&{drmProvider:S}),{},{widevine:null==g?void 0:g.widevine,fairPlay:null==g?void 0:g.fairPlay,playReady:null==g?void 0:g.playReady})},(null==m?void 0:m.isDvrEnabled)&&{isLiveStream:!0}),(null==D?void 0:D.isLiveStream)&&{isLiveStream:null==D?void 0:D.isLiveStream})},E&&{isSSAIEnabled:E}),{},{metadata:T,liveDetails:{isDvrEnabled:null==m?void 0:m.isDvrEnabled},gist:Ue(Ue(Ue({},w&&{videoImageUrl:w}),(null==D?void 0:D.videoId)&&{id:null==D?void 0:D.videoId}),(null==D?void 0:D.videoTitle)&&{title:null==D?void 0:D.videoTitle}),contentDetails:Ue({},(null==k?void 0:k.length)>0&&{closedCaptions:b(k)})},(null==D?void 0:D.runtime)&&{runtime:null==D?void 0:D.runtime}),(null==D?void 0:D.publishDate)&&{publishDate:null==D?void 0:D.publishDate}),(null==D?void 0:D.platform)&&{platform:null==D?void 0:D.platform}),(null==D?void 0:D.series)&&{series:null==D?void 0:D.series}),ads:{preRoll:{adTags:{web:Ue(Ue({},y&&{active:!0}),y&&{url:y})}}}});return D&&(null!=D&&D.isDvrEnabled&&(O.video.liveDetails=Ue(Ue({},O.video.liveDetails),{},{isDvrEnabled:null==D?void 0:D.isDvrEnabled})),null!=D&&D.metadata&&(O.video.metadata=[].concat(b(O.video.metadata),b(null==D?void 0:D.metadata)))),O},ze=null,Ge=function(e,n){(new Date).getMonth(),new Date(n).getMonth(),(new Date).getFullYear(),new Date(n).getFullYear();var t=Math.floor(e/6048e5),r=function(e,n){var t;return t=12*(n.getFullYear()-e.getFullYear()),t-=e.getMonth(),(t+=n.getMonth())<=0?0:t}(new Date,new Date(n)),i=r>0&&t>4?r:0,o=function(e,n){var t=new Date(n).getFullYear()-new Date(e).getFullYear(),r=new Date(n).getMonth()-new Date(e).getMonth();return new Date(n).getDay()-new Date(e).getDay()<0&&(r-=1),r<0&&(t-=1),t}(new Date,new Date(n));return[o>0&&i>0?o:0,i,t,Math.floor(e/864e5),Math.floor(e%864e5/36e5),Math.floor(e%36e5/6e4),Math.floor(e%6e4/1e3)]},Ke=function(e){var n,t=w(e,8),r=t[0],i=t[1],o=t[2],l=t[3],a=t[4],u=t[5],s=t[6],d=t[7];n=r>=1?" ".concat(r," Year"):i>=1?" ".concat(i," month"):o>=1?" ".concat(o," week"):l>=1?" ".concat(l," day"):a<24&&a>=12?" ".concat(a," hour"):a>0?"".concat(a," hours ").concat(u," minutes ").concat(s," seconds"):u>0?"".concat(u," minutes ").concat(s," seconds"):"".concat(s," seconds"),d.textContent="".concat(n)},We=(Fe={scheduleStartTimeMs:0,scheduleEndTimeMs:0},{get:function(){return Fe},set:function(e){Fe={scheduleStartTimeMs:null==e?void 0:e.startDateTime,scheduleEndTimeMs:null==e?void 0:e.endDateTime}}});function Ye(e,n,t,r){if(e){var i=function(){var e,i,l=null===(e=We.get())||void 0===e?void 0:e.scheduleStartTimeMs,a=null===(i=We.get())||void 0===i?void 0:i.scheduleEndTimeMs,u=Date.now();if(u-a>0){var s=document.getElementsByClassName("error-message")[0];return s&&(s.textContent=h.getLocalisation("eventEnded")||"Game has ended",r.textContent=""),clearInterval(o),void(null==t||t())}var d=l-u;if(d/1e3<=0)return clearInterval(o),null==n||n([0,0,0,0,0,0,0,r]),void(null==t||t());var c=Ge(d,l);null==n||n([].concat(b(c),[r]))};i();var o=setInterval(i,1e3);return o}}var $e=function(e,n,t){var r,i,o,l,a,u,s,d,c=null==n||null===(r=n.response)||void 0===r||null===(i=r.data)||void 0===i?void 0:i.errorCode,v=(null==n||null===(o=n.response)||void 0===o||null===(l=o.data)||void 0===l?void 0:l.errorMessage)||(null==n?void 0:n.message)||null;We.set({startDateTime:null==n||null===(a=n.response)||void 0===a||null===(u=a.data)||void 0===u?void 0:u.scheduleStartDate,endDateTime:null==n||null===(s=n.response)||void 0===s||null===(d=s.data)||void 0===d?void 0:d.scheduleEndDate}),function(e,n,t,r){var i,o,l=Date.now(),a=null===(i=We.get())||void 0===i?void 0:i.scheduleStartTimeMs,u=null===(o=We.get())||void 0===o?void 0:o.scheduleEndTimeMs,s=function(e,n,t,r){var i;e<0?i=h.getLocalisation("eventNotStarted")||r||"Game starts in":(n>0||"VIDEO_NOT_EXISTS"==t)&&(i=h.getLocalisation("eventEnded")||r||"Game has ended");return i||r}(l-a,l-u,n,t);if(document.getElementsByClassName("error-container")[0]){var d=document.getElementsByClassName("error-message")[0];d&&(d.textContent="".concat(s));var c=document.getElementsByClassName("error-timer-message")[0];c&&Ye(Math.abs(a),Ke,r,c)}else{var v=document.getElementById(e).parentElement;if(v){var f=document.createElement("div");f.className="error-container";var p=document.createElement("div");p.className="error-message";var m=document.createElement("div");m.className="error-timer-message",p.textContent="".concat(s),f.appendChild(p),f.appendChild(m),v.append(f),Ye(Math.abs(a),Ke,r,m)}}}(e,c,v,t)};function Je(n,t){var r=t.scheduleEndDate,i=t.scheduleStartDate;We.set({startDateTime:i,endDateTime:r}),ze&&clearInterval(ze),ze=setInterval(function(){var t,r=Date.now(),i=null===(t=We.get())||void 0===t?void 0:t.scheduleEndTimeMs;if(console.log("scheduleEndTimeMs",i),i&&r>i){var o;console.log("Game ended");var l=m.getPlayer(n);if(e.isPlayerInitialised(n)&&l){var a;l.dispose(),console.log("Player disposed");var u=null===(a=document.getElementsByClassName("vl-container"))||void 0===a?void 0:a[0],s=document.createElement("video");s.id=n,s.className="video-js",s.style.width="100%",s.style.height="100%",u&&u.appendChild(s)}var d=h.getLocalisation("eventEnded")||"Game has ended",c=null===(o=document.getElementsByClassName("error-container"))||void 0===o?void 0:o[0];if(c){var v=c.querySelector(".error-message");v&&(v.textContent=d)}else{var f=document.getElementById(n),p=null==f?void 0:f.parentElement;if(p){(c=document.createElement("div")).className="error-container";var g=document.createElement("div");g.className="error-message",g.textContent=d,c.appendChild(g),p.append(c)}}clearInterval(ze)}},1e3)}function Xe(e,n){return Qe.apply(this,arguments)}function Qe(){return(Qe=t(r.mark(function n(t,i){var o,l,a,u,s,d,c,v,f;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a=i.resolve,u=i.reject,s=null==t?void 0:t.videoId,d=null==t?void 0:t.playerId,c=!(null==t||!t.anonymousId),n.next=6,e.getToken();case 6:v=n.sent,f=!1===(null==t||null===(o=t.customData)||void 0===o||null===(l=o.ads)||void 0===l?void 0:l.isSSAIEnabled),e.getVideoDetails(s,v,f).then(function(n){var r,i,o,l,f,p,m,g,h,y;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(i=r.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType,e.setCurrentVideo(null==n?void 0:n.data);var b=null==n||null===(l=n.data)||void 0===l||null===(f=l.video)||void 0===f||null===(p=f.gist)||void 0===p?void 0:p.scheduleEndDate,w=null==n||null===(m=n.data)||void 0===m||null===(g=m.video)||void 0===g||null===(h=g.gist)||void 0===h?void 0:h.scheduleStartDate;Je(d,{scheduleEndDate:b,scheduleStartDate:w});var k,S=null==n?void 0:n.data;if(null!=t&&t.watchHistory&&null!=t&&null!==(y=t.watchHistory)&&void 0!==y&&y.enable&&!c)if((null===(k=t.watchHistory)||void 0===k?void 0:k.saveOffline)||!1){var T,E,C,I=Pe((null===(T=t.watchHistory)||void 0===T?void 0:T.profileId)||"",s,null==t?void 0:t.siteOwner);if(I&&I.length)t.watchHistoryResumeTime=(null===(E=I[0])||void 0===E?void 0:E.watchedTime)||null,t.watchedPercentage=(null===(C=I[0])||void 0===C?void 0:C.watchedPercentage)||null;S.contentType="video",Be(d,{res:S},t,{resolve:a,reject:u})}else e.getVideoInfo(s,v).then(function(e){var n,r,i,o,l,a;null!==(n=window)&&void 0!==n&&null!==(r=n.watchHistory)&&void 0!==r&&r.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),t.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,t.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,S.contentType="video"}).catch(function(e){var n,t,r,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(r=window)||void 0===r||null===(i=r.watchHistory)||void 0===i||i.cb(e))}).finally(function(){Be(d,{res:S},t,{resolve:a,reject:u})});else Be(d,{res:S},t,{resolve:a,reject:u})}).catch(function(n){var r,i,o=(null==t||null===(r=t.event)||void 0===r?void 0:r.showScheduleTimer)||!1,l=(null==t||null===(i=t.event)||void 0===i?void 0:i.onCountdownComplete)||null;o&&$e(d,n,l),e.initiateErrorHandling(n,d,u,s)});case 9:case"end":return n.stop()}},n)}))).apply(this,arguments)}function Ze(e,n){return en.apply(this,arguments)}function en(){return(en=t(r.mark(function n(t,i){var o,l,a,u,s,d,c,v;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a=i.resolve,u=i.reject,n.next=3,e.getToken();case 3:s=n.sent,d=null==t?void 0:t.playerId,c=null==t?void 0:t.epg,v=!1===(null==t||null===(o=t.customData)||void 0===o||null===(l=o.ads)||void 0===l?void 0:l.isSSAIEnabled),e.getLinearChannelDetails(c,s,v).then(function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==c?void 0:c.channelId,Be(d,{res:n},t,{resolve:a,reject:u})}).catch(function(n){e.initiateErrorHandling(n,d,u,videoId)});case 8:case"end":return n.stop()}},n)}))).apply(this,arguments)}function nn(e,n){return tn.apply(this,arguments)}function tn(){return(tn=t(r.mark(function n(t,i){var o,l,a,u,s,d,c;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return l=i.resolve,a=i.reject,n.next=3,e.getToken();case 3:u=n.sent,s=null==t?void 0:t.playerId,d=sessionStorage.getItem("season-idx")||0,e.seasonIdxManager.set(parseInt(d)),c=null==t||null===(o=t.series)||void 0===o?void 0:o.id,e.getSeriesDetails(c,u).then(function(n){var r,i,o,d=n.data,v=n.data.seasons;e.setCurrentSeries(v);var f=videoId||(null==v||null===(r=v[0])||void 0===r||null===(i=r.episodes)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.id);e.createSeriesWatchMap(c,u),e.getVideoDetails(f,u).then(function(n){var r,i,o;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(i=r.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType,e.setCurrentVideo(n.data),Be(s,{res:null==n?void 0:n.data,sres:d},t,{resolve:l,reject:a})}).catch(function(n){e.initiateErrorHandling(n,s,a,videoId)})}).catch(function(n){e.initiateErrorHandling(n,s,a)});case 9:case"end":return n.stop()}},n)}))).apply(this,arguments)}var rn,on=(rn=new Map,{set:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=Array.isArray(n)?n:[];return rn.set(e,t),t},get:function(e){return rn.get(e)||[]},remove:function(e){rn.delete(e)}});function ln(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function an(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return un(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?un(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,o=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw o}}}}function un(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var sn=function(e){var n=Date.parse(null==e?void 0:e.eventStartUtc),t=Number.isFinite(n)?n/1e3:0;return{start:t+(Number(null==e?void 0:e.startTime)||0),end:t+(Number(null==e?void 0:e.endTime)||0)}},dn=function(e){var n;try{var t,r,i=null==e||null===(t=e.liveTracker)||void 0===t||null===(r=t.seekableEnd)||void 0===r?void 0:r.call(t);if(Number.isFinite(i))return i}catch(e){}var o=null==e||null===(n=e.seekable)||void 0===n?void 0:n.call(e);return o&&o.length?o.end(o.length-1):NaN};function cn(e){var t=null,r=null,i="none",o=function(n){var o=m.getPlayer(e);if(!o)return null;if("pdt"===i&&null!=t)return r+(n-t);var l=dn(o);return Number.isFinite(l)?l-(Date.now()/1e3-n):null},l=function(){var n=m.getPlayer(e),t=n&&n.seekable();return t&&t.length?{start:t.start(0),end:t.end(t.length-1)}:{start:0,end:0}};return{refreshAnchor:function(){var n=m.getPlayer(e);if(n){var o=function(e){try{var n=e.tech(!0),t=n&&n.vhs,r=t&&t.playlists,i=r&&"function"==typeof r.media&&r.media();return i&&i.segments||null}catch(e){return null}}(n),l=n.currentTime()||0;if(o&&o.length){var a,u=null,s=1/0,d=an(o);try{for(d.s();!(a=d.n()).done;){var c=a.value;if(c&&"number"==typeof c.programDateTime&&"number"==typeof c.start&&Number.isFinite(c.start)){var v=Math.abs(c.start-l);v<s&&(s=v,u=c)}}}catch(e){d.e(e)}finally{d.f()}if(u)return t=u.programDateTime/1e3,r=u.start,void(i="pdt")}t=null,r=null,i="now"}},anchorInfo:function(){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ln(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ln(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}({anchorPdtSec:t,anchorPlayerT:r,source:i},l())},chapterToPlayerTime:function(e){return o(sn(e).start)},chapterStartPercent:function(e){return function(e){var n=l(),t=n.start,r=n.end;if(!(r>t))return null;var i=o(e);return null==i||i<t||i>r?null:(i-t)/(r-t)*100}(sn(e).start)},playerTimeToChapterIndex:function(n,o){var l=function(n){var o=m.getPlayer(e);if(!o)return null;if("pdt"===i&&null!=t)return t+(n-r);var l=dn(o);return Number.isFinite(l)?Date.now()/1e3-(l-n):null}(n);if(null==l)return-1;for(var a=-1,u=0;u<o.length;u++){var s=sn(o[u]),d=s.start,c=s.end,v=Math.max(c,d+.001);l>=d&&l<v&&(a=u)}return a},windowBounds:l}}function vn(e){return"livedvr"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).timeMode?cn(e):function(e){var n=function(e){return Number(null==e?void 0:e.startTime)||0},t=function(e){var t=Number(null==e?void 0:e.endTime);return Number.isFinite(t)?t:n(e)};return{chapterToPlayerTime:function(e){return n(e)},chapterStartPercent:function(t){var r=m.getPlayer(e),i=r&&r.duration();if(!Number.isFinite(i)||i<=0)return null;var o,l=n(t);return l<0||l>i?null:100*((o=l/i)<0?0:o>1?1:o)},playerTimeToChapterIndex:function(e,r){for(var i=-1,o=0;o<r.length;o++){var l=n(r[o]),a=Math.max(t(r[o]),l+.001);e>=l&&e<a&&(i=o)}return i},windowBounds:function(){var n=m.getPlayer(e),t=n&&n.duration();return{start:0,end:Number.isFinite(t)?t:0}},refreshAnchor:function(){},anchorInfo:function(){return{source:"vod"}}}}(e)}var fn="chapter-change",pn="chapter-click",mn="chapters-updated";function gn(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=m.getPlayer(e);r?r.trigger(n,t):console.error("[CHAPTERS] Player instance not found")}function hn(e){var n=m.getPlayer(e);if(!n)return console.error("[CHAPTERS] Player instance not found"),{};var t=function(e,t){var r=function(e,n){return t(n)};return n.on(e,r),function(){return n.off(e,r)}};return{onChapterChange:function(e){return t(fn,e)},onChapterClick:function(e){return t(pn,e)},onChaptersUpdated:function(e){return t(mn,e)}}}var yn="vjs-chapter-marker",bn="vjs-chapter-preview",wn=function(e){try{var n,t,r;return(null==e||null===(n=e.controlBar)||void 0===n||null===(t=n.progressControl)||void 0===t||null===(r=t.seekBar)||void 0===r?void 0:r.el())||null}catch(e){return null}};function kn(e,n){var t=n.store,r=n.mapper,o=n.chaptersConfig,l=void 0===o?{}:o,a=n.seek,u=m.getPlayer(e);if(!u)return{render:function(){},reposition:function(){},destroy:function(){}};var s=new Map,d=null,c=-1,v=function(){return!0===(null==l?void 0:l.enable)},f=function(n,t){var o=m.getPlayer(e),l=wn(o);if(l){var a=function(e){if(d&&d.isConnected)return d;(d=document.createElement("div")).className=bn;var n=document.createElement("div");n.className="vjs-chapter-preview__time";var t=document.createElement("div");t.className="vjs-chapter-preview__label",d.appendChild(n),d.appendChild(t);var r=document.createElement("span");return r.className="vjs-chapter-preview__pointer",d.appendChild(r),d._time=n,d._label=t,e.appendChild(d),d}(l);a._time.textContent=function(e){try{var n=r.chapterToPlayerTime(e);if(null==n||!Number.isFinite(n))return"";if("vod"===("function"==typeof r.anchorInfo?r.anchorInfo():{}).source)return i.formatTime(n,n);var t=(r.windowBounds()||{}).end;if(!Number.isFinite(t))return"";var o=Math.max(0,t-n);return"-".concat(i.formatTime(o,o))}catch(e){return""}}(n),a._label.textContent=(null==n?void 0:n.label)||"",a.style.left="".concat(t,"%"),a.classList.add("vjs-chapter-preview--visible")}},p=function(){d&&d.classList.remove("vjs-chapter-preview--visible")},g=function(n){var t=document.createElement("div");t.className=yn,t.dataset.segmentId=String(n.segmentId);var i=function(e){var n=null!=e&&e.icon?String(e.icon).trim():"";if(!n)return null;var t=document.createElement("span");if(t.className="vjs-chapter-marker__icon","<"===n.charAt(0)){var r=m.parseSvgString(n);r&&t.appendChild(r)}else{var i=document.createElement("img");i.src=n,i.alt="",t.appendChild(i)}return t}(n);return i&&t.appendChild(i),t.addEventListener("click",function(t){t.stopPropagation(),"function"==typeof a&&a(n.segmentId),gn(e,pn,{chapter:n})}),t.addEventListener("mouseenter",function(){var e=r.chapterStartPercent(n);null!=e&&f(n,e)}),t.addEventListener("mouseleave",p),t},h=function(){v()&&0!==s.size&&(r.refreshAnchor(),t.get(e).forEach(function(e){var n=s.get(String(e.segmentId));if(n){var t=r.chapterStartPercent(e);null==t?n.style.display="none":(n.style.display="",n.style.left="".concat(t,"%"))}}))},y=function(){var n=m.getPlayer(e);if(n){var i=t.get(e),o=r.playerTimeToChapterIndex(n.currentTime()||0,i);if(o!==c){c=o,s.forEach(function(e){return e.classList.remove("".concat(yn,"--active"))});var l=o>=0?i[o]:null;if(l){var a=s.get(String(l.segmentId));a&&a.classList.add("".concat(yn,"--active"))}gn(e,fn,{chapter:l})}}},b=m.throttle(function(){h(),y()},1e3),w=function(){h(),y()};u.on("timeupdate",b),u.on("seeked",w);var k=!1;try{u.liveTracker&&"function"==typeof u.liveTracker.on&&(u.liveTracker.on("liveedgechange",h),k=!0)}catch(e){}var S=null;(function(){try{return"function"==typeof r.anchorInfo&&"vod"!==r.anchorInfo().source}catch(e){return!1}})()&&(S=setInterval(h,500));return{render:function(){var n=m.getPlayer(e),i=wn(n);i&&(i.querySelectorAll(".".concat(yn)).forEach(function(e){return e.remove()}),s.clear(),c=-1,v()&&(r.refreshAnchor(),t.get(e).forEach(function(e){var n=g(e);i.appendChild(n),s.set(String(e.segmentId),n)}),h()))},reposition:h,destroy:function(){try{u.off("timeupdate",b),u.off("seeked",w),k&&u.liveTracker.off("liveedgechange",h)}catch(e){}S&&(clearInterval(S),S=null);var n=wn(m.getPlayer(e));n&&n.querySelectorAll(".".concat(yn,", .").concat(bn)).forEach(function(e){return e.remove()}),s.clear(),d=null}}}var Sn=new Map,Tn=function(e){try{var n,t,r;return!(null==e||null===(n=e.controlBar)||void 0===n||null===(t=n.progressControl)||void 0===t||null===(r=t.seekBar)||void 0===r||!r.el())}catch(e){return!1}},En=function(e){var n=Sn.get(e);if(n)return n;n={mapper:vn(e,{timeMode:"vod"}),markers:null,chaptersConfig:{},timeMode:"vod"},Sn.set(e,n);var t=m.getPlayer(e);return t&&t.on("dispose",function(){return jn(e)}),n},Cn=function(e){var n=Sn.get(e),t=function(e){var n=Sn.get(e);if(!n||n.markers)return(null==n?void 0:n.markers)||null;var t=m.getPlayer(e);return t&&Tn(t)?(n.markers=kn(e,{store:on,mapper:n.mapper,chaptersConfig:n.chaptersConfig,seek:function(n){return On(e,n)}}),n.markers):null}(e);t&&n&&t.render()};function In(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return En(e),on.set(e,n),Cn(e),gn(e,mn,{chapters:on.get(e)}),!0}function Pn(e){return on.get(e)}function Dn(e){on.set(e,[]);var n=Sn.get(e);return null!=n&&n.markers&&n.markers.render(),gn(e,mn,{chapters:[]}),!0}function On(e,n){var t=m.getPlayer(e),r=En(e);if(!t)return!1;var i=on.get(e).find(function(e){return e.segmentId===n});if(!i)return!1;r.mapper.refreshAnchor();var o=r.mapper.chapterToPlayerTime(i);if(null==o||!Number.isFinite(o))return!1;var l=r.mapper.windowBounds(),a=l.start,u=l.end;return Number.isFinite(a)&&Number.isFinite(u)&&u>a&&(o=Math.min(Math.max(o,a),u-.1)),t.currentTime(o),!0}function jn(e){var n=Sn.get(e);n&&(n.disposed=!0,n.markers&&n.markers.destroy()),Sn.delete(e),on.remove(e)}var xn,Nn=function(n){var t=n.site,r=n.sseBaseUrl,i=n.sseEndpoint,o=n.debug,l=void 0!==o&&o;return k.createSSETransport({site:t,sseBaseUrl:r,getToken:e.getToken,sseEndpoint:i,onOpen:function(e){var n=e.userId,t=e.endpoint;l&&console.log("SSE Connected:",n,t)},onMessage:function(n){var t,r,i,o,a,u,s,d,c,v;if(l&&console.log("SSE Message:",n),(null===(t=e.getCurrentVideo())||void 0===t||null===(r=t.video)||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.id)===(null==n||null===(o=n.payload)||void 0===o?void 0:o.id)&&"GAME_STATE_CHANGE"===(null==n?void 0:n.notificationType)){var f=1e3*(null==n||null===(a=n.payload)||void 0===a||null===(u=a.states)||void 0===u||null===(s=u.live)||void 0===s?void 0:s.startDateTime),p=1e3*(null==n||null===(d=n.payload)||void 0===d||null===(c=d.states)||void 0===c||null===(v=c.end)||void 0===v?void 0:v.endDateTime);f&&p&&(console.log("Setting schedule timer",f,p),We.set({startDateTime:f,endDateTime:p}))}},onReconnectAttempt:function(e){l&&console.log("Reconnect attempt:",e)},onHeartbeatTimeout:function(e){var n=e.elapsed;l&&console.warn("Heartbeat timeout after:",n)},onTokenInvalid:function(e){l&&console.error("Invalid token:",e),window.location.href="/login"},onError:function(e,n){l&&console.error("SSE Error:",e,n)},onClose:function(){l&&console.log("SSE Closed")}})},An=function(e){var n=e.enable,t=e.site,r=e.sseBaseUrl,i=e.sseEndpoint,o=e.debug;if(n){var l=Nn({site:t,sseBaseUrl:r,sseEndpoint:i,debug:void 0!==o&&o});return l._sseBaseUrl=r,l._site=t,l._sseEndpoint=i,l}};function Mn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Rn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mn(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}exports.VLPlayerCore=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:c.onTimeUpdate,getVideoDuration:c.getVideoDuration,onVideoEnded:c.onVideoEnded,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var i=t(r.mark(function t(i,o){var l,a,u,s,d,c,v,f,p,g,y,b,w,k,S,T,E,C,I,P,D,O,j,x,N,A,R,_,L,B,V,U;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.isPlayerInitialised(null==n?void 0:n.playerId)){t.next=3;break}return i({status:!0,msg:"Player already initialised",skipped:!0}),t.abrupt("return");case 3:if(I=(null==n?void 0:n.videoSourceUrl)||!1,P=null==n?void 0:n.asat,D=(null==n||null===(l=n.epg)||void 0===l?void 0:l.enable)||!1,O=null==n?void 0:n.videoId,j=(null==n||null===(a=n.series)||void 0===a?void 0:a.enable)||!1,x=(null==n?void 0:n.streamingInfo)||!1,window.videoId=O,N=null==n?void 0:n.token,!e.token_authentication_enabled(n)){t.next=18;break}if(sessionStorage.setItem("vlp_token",N),e.refreshTokenManager().set(null==n?void 0:n.refreshToken),N&&!e.isTokenExpired(N)){t.next=17;break}return o({status:!1,msg:"".concat(N?"Token is expired !":"Missing Authorization Token"),response:{token:N}}),t.abrupt("return");case 17:xn=JSON.parse(atob(N.split(".")[1]));case 18:return window.siteName=null===(u=xn)||void 0===u?void 0:u.site,window.siteId=null===(s=xn)||void 0===s?void 0:s.siteId,n.isAnonymousUser=!(null===(d=xn)||void 0===d||!d.anonymousId),n.siteOwner=(null===(c=xn)||void 0===c?void 0:c.site)||null,n.userId=(null===(v=xn)||void 0===v?void 0:v.userId)||null,e.setUserId((null===(f=xn)||void 0===f?void 0:f.userId)||(null===(p=xn)||void 0===p?void 0:p.anonymousId)||null),window.watchHistory=n.watchHistory||null,A=null==n?void 0:n.playerId,n.chromecastReceiverId=null!=n&&null!==(g=n.series)&&void 0!==g&&g.enable?null:null==n?void 0:n.chromecastReceiverId,R=(null==n||null===(y=n.analytics)||void 0===y?void 0:y.gaId)||null,(_=null==n?void 0:n.errors)&&(window.customErrors=_),window.customData=null==n?void 0:n.customData,h.setLocalisation(null==n||null===(b=n.customData)||void 0===b?void 0:b.localisation),e.baseUrlManager.set(n.apiBaseUrl),null!=n&&n.skin&&!m.isNotAValidSkin(n.skin)||(n.skin="VL_ONE"),e.playerConfigManager.setConfig(n),t.next=37,W(n);case 37:R&&M("https://www.googletagmanager.com/gtag/js?id=".concat(R)).then(function(){return e.runGtag(R)}).catch(function(e){}),(L=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(A)))&&L.addEventListener("contextmenu",function(e){return e.preventDefault()}),(B=An({enable:null==n||null===(k=n.sse)||void 0===k?void 0:k.enable,site:null==n||null===(S=n.sse)||void 0===S?void 0:S.siteName,sseBaseUrl:null==n||null===(T=n.sse)||void 0===T?void 0:T.sseBaseUrl,sseEndpoint:null==n||null===(E=n.sse)||void 0===E?void 0:E.sseEndpoint,debug:null==n||null===(C=n.sse)||void 0===C?void 0:C.debug}))&&!B.isConnectionActive()&&B.connect(),I?(U={directPlaybackUrl:I,id:V="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},P?e.getVideoDetails(V,N).then(function(e){var t=(null==e?void 0:e.data)||{};Be(A,{res:Rn(Rn({},t),U)},n,{resolve:i,reject:o})}).catch(function(n){e.initiateErrorHandling(n,A,o,V)}):Be(A,{res:U},n,{resolve:i,reject:o})):x?qe(n,{resolve:i,reject:o}):j?nn(n,{resolve:i,reject:o}):D?Ze(n,{resolve:i,reject:o}):Xe(n,{resolve:i,reject:o});case 43:case"end":return t.stop()}},t)}));return function(e,n){return i.apply(this,arguments)}}())},getRenditions:f.getRenditions,skip:e.skip,getPlayer:m.getPlayer,play:e.play,pause:e.pause,detectBrowser:g.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:c.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:v.enableCaptions,disableCaptions:v.disableCaptions,getCaptions:v.getCaptions,playSelectedResolution:p.playSelectedResolution,getSource:e.getSource,setVolume:_,getVolume:L,disableControls:e.disableControls,setPlaybackSpeed:c.setPlaybackSpeed,getEntitlementData:e.getEntitlementData,getSsaiEvents:e.getSsaiEvents,playerEvents:c.playerEvents,onReplay:c.onReplay,setChapters:In,getChapters:Pn,clearChapters:Dn,seekToChapter:On,getChapterEvents:hn}},exports.initChapters=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.chapters,r=void 0===t?[]:t,i=n.timeMode,o=void 0===i?"vod":i;n.res;var l=n.chaptersConfig,a=void 0===l?{}:l,u=m.getPlayer(e);if(!u)return!1;Array.isArray(r)&&r.length&&on.set(e,r);var s={mapper:vn(e,{timeMode:o}),markers:null,chaptersConfig:a||{},timeMode:o,disposed:!1};Sn.set(e,s);var d=function(){s.disposed||Cn(e)};return u.one("loadeddata",d),Tn(u)&&d(),u.on("dispose",function(){return jn(e)}),!0};
|
|
1
|
+
"use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-9fa3c0bb.js"),n=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/regenerator"),i=require("video.js"),o=require("@babel/runtime/helpers/classCallCheck"),l=require("@babel/runtime/helpers/createClass"),a=require("@babel/runtime/helpers/get"),u=require("@babel/runtime/helpers/inherits"),s=require("@babel/runtime/helpers/possibleConstructorReturn"),d=require("@babel/runtime/helpers/getPrototypeOf"),c=require("./util-0574b423.js"),v=require("./captions-676468fe.js"),f=require("./renditions-508e7f85.js"),p=require("./resolution-e6b8a4eb.js"),m=require("./skin-c6084619.js"),g=require("./browser-77c57718.js"),h=require("./localisation-56e0a999.js"),y=require("@babel/runtime/helpers/typeof");require("@viewlift/comscore/index.js");var b=require("@babel/runtime/helpers/toConsumableArray"),w=require("@babel/runtime/helpers/slicedToArray"),k=require("@viewlift/sse");function S(e,n,t,r){var i=a(d(1&r?e.prototype:e),n,t);return 2&r&&"function"==typeof i?function(e){return i.apply(t,e)}:i}function T(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(T=function(){return!!e})()}var E=i.getComponent("TextTrackSettings"),C=i.dom,I=[{value:"12",label:"12px"},{value:"14",label:"14px"},{value:"16",label:"16px"},{value:"18",label:"18px"},{value:"20",label:"20px"},{value:"24",label:"24px"},{value:"28",label:"28px"},{value:"32",label:"32px"}],P=I.map(function(e){return e.value}),D="16",O="vlp-caption-font-size-px",j="vlp-caption-font-size-style",x=".vjs-font-percent > select",A=function(e){return-1!==P.indexOf(e)?e:D},N=null;E?(N=function(){u(r,E);var e,n,t=(e=r,n=T(),function(){var t,r=d(e);if(n){var i=d(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return s(this,t)});function r(e,n){var i;return o(this,r),(i=t.call(this,e,n)).customUiReady_=!0,i.applyCustomFontSizeUI_(),i}return l(r,[{key:"applyCustomFontSizeUI_",value:function(){this.replaceFontSizeOptions_(),this.bindFontSizeChange_(),this.restoreCustomFontSize_()}},{key:"replaceFontSizeOptions_",value:function(){var e=this.$(x);if(e){for(;e.firstChild;)e.removeChild(e.firstChild);I.forEach(function(n){e.appendChild(C.createEl("option",{value:n.value,textContent:n.label}))}),e.value=D}}},{key:"bindFontSizeChange_",value:function(){var e=this,n=this.$(x);n&&this.on(n,"change",function(){return e.applyFontSize_(n.value)})}},{key:"applyFontSize_",value:function(e){var n=A(e);if("undefined"!=typeof document){var t=document.getElementById(j);t||((t=document.createElement("style")).id=j,document.head.appendChild(t)),t.textContent=[".vjs-text-track-cue,",".vjs-text-track-cue > div,",".vjs-text-track-display-ttml,",".vjs-text-track-display-ttml span,",".vjs-text-track-display-ttml div","{ font-size: ".concat(n,"px !important; line-height: normal !important; }")].join(" ")}}},{key:"restoreCustomFontSize_",value:function(){var e=null;try{e=window.localStorage.getItem(O)}catch(e){}var n=A(e),t=this.$(x);t&&(t.value=n),this.applyFontSize_(n)}},{key:"getValues",value:function(){var e=S(r,"getValues",this,3)([]);return e&&delete e.fontPercent,e||{}}},{key:"setDefaults",value:function(){if(S(r,"setDefaults",this,3)([]),this.customUiReady_){var e=this.$(x);e&&(e.value=D),this.applyFontSize_(D)}}},{key:"saveSettings",value:function(){if(S(r,"saveSettings",this,3)([]),this.options_&&this.options_.persistTextTrackSettings){var e=this.$(x);if(e)try{window.localStorage.setItem(O,A(e.value))}catch(e){}}}},{key:"handleLanguagechange",value:function(){S(r,"handleLanguagechange",this,3)([]),this.applyCustomFontSizeUI_()}}]),r}(),i.registerComponent("TextTrackSettings",N)):console.warn("[vlp] CustomTextTrackSettings: video.js TextTrackSettings is not registered; skipping override.");var M=function(e){return new Promise(function(n,t){if(R(e))t("".concat(e," is alread initialised"));else{var r=document.createElement("script");r.async=!0,r.src=e,r.onload=function(){n()},r.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(r)}})},R=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},_=function(e,n,t){var r=m.getPlayer(e);if(r)if(n>=0&&n<=100){r.muted()&&r.muted(!1);var i=parseFloat(n)/100;r.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},L=function(e){var n=m.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},B=function(){var e=t(r.mark(function e(n){var t,o,l,a,u;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=m.getPlayer(null==n?void 0:n.playerId),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=22;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return a=e.sent,e.prev=5,e.next=8,M("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,a.default(i),e.finish(13);case 16:(u=i.getTech("chromecast"))&&!u.prototype.seeking&&(u.prototype.seeking=function(){}),null!==(l=window)&&void 0!==l&&l.cast?null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=n&&n.chromecastReceiverId&&null!=n&&n.airplay&&"Safari"==g.detectBrowser()?null==o||o.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return e.stop()}},e,null,[[5,10,13,16]])}));return function(n){return e.apply(this,arguments)}}(),V=function(e,n){var t=m.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,r,o,l,a,u=this.el(),s=i.dom.getPointerPosition(u,n).x;i.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(o=r.framework)||void 0===o||null===(l=o.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(d),d&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),f=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=f*s,v.seek()}})};var U=function(){var e=t(r.mark(function e(){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),M("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then(function(){}).catch(function(e){return console.log(e)})]);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),F=function(){var n=t(r.mark(function n(){return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,import("@viewlift/comscore/index.js").then(function(n){e.comscoreInstanceManager.set(n)});case 2:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}(),q=function(){var e=t(r.mark(function e(){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then(function(e){i.getPlugin("eme")||i.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),H=function(){var e=t(r.mark(function e(){var n;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(i),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}},e,null,[[0,10]])}));return function(){return e.apply(this,arguments)}}(),z=function(){var e=t(r.mark(function e(){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then(function(){return require("./index-84cce26a.js")});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}},e,null,[[0,5]])}));return function(){return e.apply(this,arguments)}}(),G=function(){var e=t(r.mark(function e(){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then(function(){return require("./videojs-dash5.es-072614bc.js")});case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),W=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){M("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(i)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(i)})},loadAdsLibrary:U,loadEMELibrary:q,loadMuxPlugin:H,loadDvrSeekbar:z,loadContribDash:G,loadComscorePlugin:F});function K(e){return Y.apply(this,arguments)}function Y(){return(Y=t(r.mark(function e(n){var t;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,U();case 3:t&&"Safari"==g.detectBrowser()&&Promise.resolve().then(function(){return W}).then(function(e){e.importAirplay()});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function $(e){return J.apply(this,arguments)}function J(){return(J=t(r.mark(function e(n){var t,i,o,l,a,u,s,d,c,v;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return v=m.getPlayer(n.playerId),e.next=3,F();case 3:v.comscore({publisherId:null==n||null===(t=n.comscore)||void 0===t?void 0:t.publishedId,endpoint:null==n||null===(i=n.comscore)||void 0===i?void 0:i.endpoint,applicationName:(null==n||null===(o=n.comscore)||void 0===o?void 0:o.applicationName)||(null===(l=window)||void 0===l?void 0:l.siteName)||null,implementationId:null==n||null===(a=n.comscore)||void 0===a?void 0:a.implementationId,projectId:null==n||null===(u=n.comscore)||void 0===u?void 0:u.projectId,debug:(null==n||null===(s=n.comscore)||void 0===s?void 0:s.debug)||!1,persistentLabels:(null==n||null===(d=n.comscore)||void 0===d?void 0:d.persistentLabels)||{},metadata:(null==n||null===(c=n.comscore)||void 0===c?void 0:c.metadata)||{}});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function X(e,n){return Q.apply(this,arguments)}function Q(){return(Q=t(r.mark(function e(n,t){var i,o,l,a,u,s,d,c,v,f,p,m,h,y;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return v=(null==t?void 0:t.contentType)||"video",f=null==t||null===(i=t[v])||void 0===i?void 0:i.drmEnabled,null==t||null===(o=t[v])||void 0===o||null===(l=o.liveDetails)||void 0===l||l.isDvrEnabled,null==n||n.showPositiveSeekbar,p=(null==t||null===(a=t[v])||void 0===a||null===(u=a.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.dash)||null,m=(null==n||null===(d=n.comscore)||void 0===d?void 0:d.enable)||!1,h=!(null==n||null===(c=n.analytics)||void 0===c||!c.muxKey),e.prev=7,e.next=10,Promise.allSettled([f?"Safari"==g.detectBrowser()?q():"caliente"!=(null===(y=window)||void 0===y?void 0:y.siteName)?G():q():"Safari"!=g.detectBrowser()&&p?G():null,m?$(n):null,h?H():null,B(n)]);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(7),console.log("Error",e.t0);case 15:case"end":return e.stop()}},e,null,[[7,12]])}))).apply(this,arguments)}function Z(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function ee(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var ne=new Set,te=null,re=function(n,t,r,i){var o,l,a,u,s,d,c,v={},f=(null==n?void 0:n.contentType)||"video";v["c3.cm.id"]=(null===(o=n[f])||void 0===o?void 0:o.id)||"Null",v["c3.cm.contentType"]=de(n),v[null==r||null===(l=r.Constants)||void 0===l?void 0:l.IS_LIVE]=!(null==n||!n.linearchannel),v[null==r||null===(a=r.Constants)||void 0===a?void 0:a.STREAM_URL]=t.currentSrc(),v[null==r||null===(u=r.Constants)||void 0===u?void 0:u.VIEWER_ID]="undefined"===e.getUserId()?"NULL":e.getUserId(),v["c3.cm.categoryType"]=ae(n),v["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),v.DRMEnabled=(null===(s=n[f])||void 0===s?void 0:s.drmEnabled)||"None",v.DAIStream=null!==(d=n[f])&&void 0!==d&&null!==(c=d.gist)&&void 0!==c&&c.isSSAIEnabled?"YES":"NO",v[r.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=ue(n),v["c3.cm.genreList"]=oe(n),v["c3.cm.genre"]=ie(n),v["c3.cm.channel"]=le(n,i);var p=fe(e.getCurrentSeries(),n);return v=ee(ee({},v),p)},ie=function(e){var n,t,r,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(r=t.primaryCategory)||void 0===r?void 0:r.title)||"Null"},oe=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map(function(e){return null==e?void 0:e.title}).join(", ")||"Null"},le=function(e,n){var t,r,i=(null==e?void 0:e.contentType)||"video";return"video"===i?"VOD":(null===(r=((null==e||null===(t=e[i])||void 0===t?void 0:t.channels)||[]).find(function(e){return(null==e?void 0:e.id)===(null==n?void 0:n.channelId)}))||void 0===r?void 0:r.title)||"NULL"},ae=function(e){var n,t;return null!=e&&e.linearchannel?"Linear Channel":null!=e&&null!==(n=e.video)&&void 0!==n&&null!==(t=n.streamingInfo)&&void 0!==t&&t.isLiveStream?"Live Event":"VOD"},ue=function(e){var n,t,r=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[r])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},se=function(e,n){var t,r,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var o=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[o])||void 0===t||null===(r=t.gist)||void 0===r?void 0:r.title)||"Null";return"".concat(l)},de=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var ce,ve,fe=function(n,t){var r,i,o,l,a,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!n||!t||null!=t&&t.linearchannel)return u;var s=e.getSeasonNumber(),d=e.getEpisodeNumber();return u["c3.cm.seriesName"]=(null==t||null===(r=t.video)||void 0===r||null===(i=r.series)||void 0===i?void 0:i.title)||"Null",u["c3.cm.seasonNumber"]=(null==s?void 0:s.toString())||"Null",u["c3.cm.showTitle"]=(null==n||null===(o=n[s-1])||void 0===o||null===(l=o.episodes)||void 0===l||null===(a=l[d-1])||void 0===a?void 0:a.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},pe=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},me=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},ge=function(){var n=t(r.mark(function n(t,i){var o,l,a,u,s,d,c,v,f,p,g,h;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(o=(null==i?void 0:i.convivaConfig)||{},l=o.trackConvivaPlayerEvent,a=o.paymentHandler,u=o.tveProvider,s=o.enable,d=o.appName,v=(c=i||{}).token,f=c.epg,s){n.next=4;break}return n.abrupt("return");case 4:if(p=m.getPlayer(t),"function"==typeof(g=l)){n.next=8;break}return n.abrupt("return");case 8:return n.next=10,g("getConvivaObject");case 10:if(h=n.sent){n.next=13;break}return n.abrupt("return");case 13:p.ready(function(){var e=p.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var r=pe(t.keySystem);g("contentInfo",{DRMEnabled:r})}else g("contentInfo",{DRMEnabled:"None"})}),n||g("contentInfo",{DRMEnabled:"None"})}),p.on("loadstart",function(){var n,t;te&&te!==p.currentSrc()&&g("playbackEnded"),g("setPlayer",p),ne.clear(),te=p.currentSrc();var r=me(p.currentType()),o=e.getCurrentVideo(),l=re(o,p,h,f);l[null==h||null===(n=h.Constants)||void 0===n?void 0:n.PLAYER_NAME]=d||"WEB",l[null==h||null===(t=h.Constants)||void 0===t?void 0:t.ASSET_NAME]=se(o,i),l.authToken=v||"NULL",l.streamType=r,l.D2CType=a||"NONE",l.subscriberType=u?"MVPD":"FREE"!==a?"D2C":"FREE",l["c3.cm.affiliate"]=u||"NULL",he.setData(l),g("contentInfo",l)}),p.on("loadedmetadata",function(){var e,n=p.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),g("contentInfo",{screenResolution:e})}),p.on("play",function(){ne.has(p.currentSrc())||(ne.add(p.currentSrc()),g("playbackStarted",null))}),p.on("ended",function(){ne.has(p.currentSrc())&&ne.delete(p.currentSrc()),g("playbackEnded")}),p.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&g("initAdSensor",{player:p,adsLoader:null==e?void 0:e.adsLoader})}),p.on("dispose",function(){null==ne||ne.clear(),g("playbackEnded")});case 20:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}(),he=(ce={},{setData:function(e){ce=ee(ee({},ce),e)},getData:function(){return ce}}),ye=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then(function(){return require("./skin-c3708fa0.js")}).then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?Promise.resolve().then(function(){return require("./skin-f724b38f.js")}).then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?Promise.resolve().then(function(){return require("./skin-83da696f.js")}).then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?Promise.resolve().then(function(){return require("./skin-01f53e99.js")}).then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?Promise.resolve().then(function(){return require("./skin-55abd2ce.js")}).then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?Promise.resolve().then(function(){return require("./skin-9bf9775b.js")}).then(function(t){t.initialiseSkin(e,n)}):"news"==t?Promise.resolve().then(function(){return require("./skin-13f17735.js")}).then(function(t){t.initialiseSkin(e,n)}):"news_live"==t?Promise.resolve().then(function(){return require("./skin-a810173d.js")}).then(function(t){t.initialiseSkin(e,n)}):"mini"==t?Promise.resolve().then(function(){return require("./skin-29bb949b.js")}).then(function(t){t.initialiseSkin(e,n)}):"CN_NEWS"==t&&Promise.resolve().then(function(){return require("./skin-8780e2a2.js")}).then(function(t){t.initialiseSkin(e,n)})};function be(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function we(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?be(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):be(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var ke=[],Se=0,Te=null;function Ee(){ve=null,ke=[],Se=0,Te=null}function Ce(t,r,i){var o,l,a,u,s,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==r||null===(o=r.watchHistory)||void 0===o||o.apiVersion;var c=null==r||null===(l=r.watchHistory)||void 0===l?void 0:l.profileId,v=Math.floor(t.currentTime()),f=Math.floor(t.duration());null==r||null===(a=r.watchHistory)||void 0===a||a.xapiKey;var p=(null==r||null===(u=r.video)||void 0===u?void 0:u.originalObjectId)||null,m=(null==r||null===(s=r.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,g=Math.floor(t.currentTime()),h=d?100:Math.floor(v/f*100),y={};m?function(t,r,i){var o=r?"watchhistory-data-".concat(r):"watchhistory-data-guest-".concat(i),l=Ie(o),a=(new Date).getTime(),u=e.getCurrentVideo(),s=(null==u?void 0:u.video)||{},d=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,t){return we(we({},e),{},n({},t,s[t]))},{}),c=l.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===ve});c<0?l.push(we(we({content:d},t),{},{addedDate:a,updateDate:a})):l[c]=we(we(we({},l[c]),t),{},{updateDate:a});localStorage.setItem("".concat(o),JSON.stringify(l))}(y={completed:d,watchedTime:g,watchedPercentage:h},c,r.siteOwner):(y=we(we({videoId:ve,watchedTime:g,watchedPercentage:h,doneWatching:d,profileId:c},Te&&{seriesId:Te}),p&&{originalObjectId:p}),e.saveWatchHistory(y).then(function(e){}).catch(function(e){})),Se=v+i}function Ie(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Pe(e,n,t){var r=Ie(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return r&&Array.isArray(r)&&(i=r.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),i}var De=!1,Oe=function(n,t){var r,i,o=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(r=n[o])||void 0===r||null===(i=r.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!De){var l=je(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),De=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function je(e,n,t){if(Array.isArray(e))return e.map(function(e){return je(e,n,t)});if(null!==e&&"object"===y(e)){var r={};return Object.keys(e).forEach(function(i){i===n&&void 0!==e[t]?r[i]=e[t]:i===t&&void 0!==e[n]?r[i]=e[n]:r[i]=je(e[i],n,t)}),r}return e}function xe(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return Ae(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ae(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,o=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw o}}}}function Ae(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function Ne(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Me(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ne(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Re=function(n,t,r,i){var o,l,a,u,s,d=i.res,c=i.sres,f=m.getPlayer(n),p=(null==d?void 0:d.contentType)||"video",h=(null==d||null===(o=d[p])||void 0===o?void 0:o.drmEnabled)||!1,b=!(null==d||null===(l=d[p])||void 0===l||null===(a=l.streamingInfo)||void 0===a||!a.isLiveStream)||"linearchannel"===p,w=(null==d||null===(u=d[p])||void 0===u||null===(s=u.liveDetails)||void 0===s?void 0:s.isDvrEnabled)||!1;e.setCurrentVideo(d),e.videoReplayTracker.set(d),f&&(f.on("loadstart",function(){b?r.resolve({status:!0,msg:"Video Loaded",response:d}):r.resolve(Me({status:!0,msg:"Player Initialised"},c?{seriesResponse:c,response:d}:{response:d}))}),f.on("loadeddata",function(){var r,i,o,l=v.getCaptions(n);if(null==l||l.map(function(e){return v.disableCaptions(n,e.id)}),w&&"Safari"===g.detectBrowser())try{var a;null==f||null===(a=f.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==f||!f.muted())&&_(n,sessionStorage.getItem("volume")||"100");var u=e.getCurrentVideo();if(e.initialiseComscoreStreamingTracking(t),e.clearError(),null!=t&&t.watchHistory&&null!=t&&null!==(r=t.watchHistory)&&void 0!==r&&r.enable&&(!t.isAnonymousUser||null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.saveOffline)){var s,c,p=Me(Me({},t),d);!function(e,n,t){var r,i,o;null!=n&&n.series&&null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable&&(Te=null==n||null===(i=n.series)||void 0===i?void 0:i.id),ke=[],Se=0,ve=t;var l=(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.interval)||30,a=m.getPlayer(e);a&&(a.on("dispose",Ee),a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());ke.includes(Se)||(e!=Se||e<l?e>Se&&(Se=e+l):(ke.push(e),Ce(a,n,l)))}}),a.one("ended",function(){Ce(a,n,l,!0)}))}(n,p,null==u||null===(s=u.video)||void 0===s||null===(c=s.gist)||void 0===c?void 0:c.id)}if(null!=t&&null!==(o=t.analytics)&&void 0!==o&&o.muxKey&&null!=f&&f.mux){var h,y,b,k,S,T,E=(null===(h=e.getCurrentVideo())||void 0===h?void 0:h.video)||(null==d?void 0:d.video),C=null==E?void 0:E.gist,I={env_key:null==t||null===(y=t.analytics)||void 0===y?void 0:y.muxKey,player_name:"vl-web-player",player_version:null===(b=window)||void 0===b?void 0:b.vl_player_version,video_id:null==C?void 0:C.id,video_title:null==C?void 0:C.title,video_series:null==E||null===(k=E.series)||void 0===k?void 0:k.title,video_stream_type:null!=E&&null!==(S=E.streamingInfo)&&void 0!==S&&S.isLiveStream?"live":"video",viewer_user_id:null==t||null===(T=t.analytics)||void 0===T?void 0:T.userId};f.mux({debug:!1,data:I})}}),f.textTracks().on("change",function(e){var n=this.tracks_.filter(function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0})[0];f.trigger("subtitlechanged",n)}),f.on("subtitlechanged",function(e,n){var t,r,i,o,l,a,u,s,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(i=r.framework)||void 0===i||null===(o=i.CastContext)||void 0===o||null===(l=o.getInstance())||void 0===l?void 0:l.S,p=null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(s=u.framework)||void 0===s||null===(d=s.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===f){var m,g=p.getMediaSession(),h=g.media.tracks.filter(function(e){return"TEXT"==e.type});m=n?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}}),f.tech_.on("retryplaylist",function(){b&&Oe(d,n)}),f.on("error",function(){var t,i;(console.log("ERROR",f.error(),f.error().code),4===f.error().code&&b)?Oe(d,n):(e.handleError(n,(null==f||null===(t=f.error())||void 0===t?void 0:t.message)||"Some error occured"),r.reject({status:!1,msg:(null==f||null===(i=f.error())||void 0===i?void 0:i.message)||"Some error occured",response:d}))}),f.one("play",function(){var n,r,i,o,l;if(null===(n=window)||void 0===n||null===(r=n.app_data)||void 0===r||null===(i=r.appcmsMain)||void 0===i||null===(o=i.adsConfig)||void 0===o||!o.vodAdClientSideTracking){if(null!=t&&null!==(l=t.series)&&void 0!==l&&l.enable){var a,u,s,d=null===(a=e.getCurrentVideo())||void 0===a||null===(u=a.video)||void 0===u||null===(s=u.gist)||void 0===s?void 0:s.id,c=e.getSeriesWatchMap(),v=(null==c?void 0:c.get(d))||{t:0,p:0},p=v.t,m=v.p;p&&m<95&&setTimeout(function(){f.currentTime(p)},0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout(function(){f.currentTime(null==t?void 0:t.watchHistoryResumeTime)},0);if(null!=f&&f.dvrSeekbar)try{f.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}}),f.on("volumechange",function(){var e=100*f.volume().toFixed(2);f.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),f.on("chromecastDisconnected",function(){if(b){f.currentSource();for(var e=f.textTracks(),n=e.length-1;n>=0;n--)f.removeRemoteTextTrack(e[n])}}),f.one("loadeddata",function(){var e,n=(null==f||null===(e=f.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort(function(e,n){var t=(e.language||e.language||"").toUpperCase(),r=(n.language||n.label||"").toUpperCase();return t<r?-1:t>r?1:0}),"object"==y(f.dash)){var t,r,i,o=null==f||null===(t=f.dash)||void 0===t||null===(r=t.mediaPlayer)||void 0===r?void 0:r.getTracksFor("audio"),l=null==o?void 0:o.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),a=xe(n);try{for(a.s();!(i=a.n()).done;){var u=i.value;if(l&&(null==u?void 0:u.id)=="dash-audio-".concat(l.index)){u.enabled=!0;break}}}catch(e){a.e(e)}finally{a.f()}}else{var s,d=xe(n);try{for(d.s();!(s=d.n()).done;){var c,v,p,m=s.value;if(("Chrome"==g.detectBrowser()||"Edge"==g.detectBrowser()&&(null!==(c=navigator)&&void 0!==c&&null!==(v=c.userAgent)&&void 0!==v&&v.includes("Macintosh")||!h))&&null!=m&&null!==(p=m.label)&&void 0!==p&&p.includes("5.1"))f.audioTracks().removeTrack(m);else{if("main"==m.kind){m.enabled=!0;break}m.enabled=!1}}}catch(e){d.e(e)}finally{d.f()}}}))};function _e(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Le(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_e(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_e(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Be=function(o,l,a,u){var s,d,c,f,p,h,y,b,w,k,S,T,E,C,I,P,D,O,j,x,A,N,M,R,_,L,B,U,F,q,H,z,G,W,K,Y,$,J,Q,Z=l.res,ee=void 0===Z?null:Z,ne=l.sres,te=void 0===ne?null:ne,re=null!=a&&a.chromecastReceiverId?["chromecast","html5"]:["html5"],ie=(null===(s=ee)||void 0===s?void 0:s.contentType)||"video",oe=m.impolicy16x9(null===(d=ee)||void 0===d||null===(c=d[ie])||void 0===c||null===(f=c.gist)||void 0===f?void 0:f.videoImageUrl)||m.impolicy16x9(null===(p=ee)||void 0===p||null===(h=p[ie])||void 0===h||null===(y=h.gist)||void 0===y||null===(b=y.imageGist)||void 0===b?void 0:b.r16x9),le=(null===(w=ee)||void 0===w||null===(k=w[ie])||void 0===k||null===(S=k.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,ae=!(null===(T=ee)||void 0===T||null===(E=T[ie])||void 0===E||null===(C=E.streamingInfo)||void 0===C||!C.isLiveStream)||"linearchannel"===ie,ue=(null===(I=ee)||void 0===I||null===(P=I.ads)||void 0===P||null===(D=P.preRoll)||void 0===D||null===(O=D.adTags)||void 0===O||null===(j=O.web)||void 0===j?void 0:j.active)&&(null===(x=ee)||void 0===x||null===(A=x.ads)||void 0===A||null===(N=A.preRoll)||void 0===N||null===(M=N.adTags)||void 0===M||null===(R=M.web)||void 0===R?void 0:R.url);ee=Le(Le({},ee),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var se=(null==a||null===(_=a.customData)||void 0===_?void 0:_.ads)||{},de=(null===(L=ee)||void 0===L||null===(B=L[ie])||void 0===B?void 0:B.isSSAIEnabled)&&"MEDIA_TAILOR"==(null==se?void 0:se.vodAdSticherProvider)||!1,ce=!(null===(U=ee)||void 0===U||null===(F=U[ie])||void 0===F||!F.isSSAIEnabled)&&"TRANSMIT"==(null==se?void 0:se.liveAdSticherProvider)&&!(null==se||!se.liveAdClientSideTracking),ve=(null==a?void 0:a.latency)||6,fe=(null==a?void 0:a.skin_settings)||{},pe=(J={enableSmoothSeeking:!0,controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==a?void 0:a.muted)||!1,autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==fe?void 0:fe.pictureInPictureToggle)||!1},playbackRates:null!=fe&&fe.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==a.skin,liveui:le},n(J,"autoplay",null==a?void 0:a.autoplay),n(J,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!ue),n(J,"loop",(null==a?void 0:a.loop)||!1),n(J,"audioPosterMode",null==a?void 0:a.audioPosterMode),n(J,"html5",Le(Le({dash:Le(Le(Le({},!i.browser.IS_SAFARI&&{useTTML:!0}),(null==a?void 0:a.debugConfig)&&(null==a||null===(q=a.debugConfig)||void 0===q?void 0:q.enable)&&{debug:!0,logLevel:null!=a&&null!==(H=a.debugConfig)&&void 0!==H&&H.logLevel?null==a||null===(z=a.debugConfig)||void 0===z?void 0:z.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:ve},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:Le({},"IE"==g.detectBrowser()&&{enableStallFix:!0,stallSeek:1}),abr:Le(Le(Le(Le({},(null==a?void 0:a.initialBandwidth)&&{initialBitrate:{audio:-1,video:(null==a?void 0:a.initialBandwidth)/1e3}}),(null==a?void 0:a.maxBitrate)&&{maxBitrate:{audio:-1,video:(null==a?void 0:a.maxBitrate)/1e3}}),(null==a?void 0:a.minBitrate)&&{minBitrate:{audio:-1,video:(null==a?void 0:a.minBitrate)/1e3}}),{},{rules:{throughputRule:{active:!0},bolaRule:{active:!1},insufficientBufferRule:{active:!1},switchHistoryRule:{active:!1},droppedFramesRule:{active:!1},abandonRequestsRule:{active:!1}},autoSwitchBitrate:{video:!0,audio:!0}})}}}),vhs:Le(Le(Le({},(null==a?void 0:a.initialBandwidth)&&{bandwidth:a.initialBandwidth}),{},{liveRangeSafeTimeDelta:ve,useDevicePixelRatio:!0,experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:null==a||!a.initialBandwidth},(null==a||null===(G=a.customData)||void 0===G?void 0:G.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null!==(W=null==a?void 0:a.enableLowInitialPlaylist)&&void 0!==W&&W}),debug:(null==a?void 0:a.debugConfig)&&(null==a||null===(K=a.debugConfig)||void 0===K?void 0:K.enable)||!1,nativeTextTracks:"Safari"==g.detectBrowser()},0==(null==a||null===(Y=a.customData)||void 0===Y?void 0:Y.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===($=a.customData)||void 0===$?void 0:$.nativeVideoTracks)&&{nativeVideoTracks:!1})),n(J,"poster",oe),n(J,"techOrder",re),n(J,"chromecast",{requestCustomDataFn:function(n){var t,r,i=m.getPlayer(o),l=((null==i?void 0:i.textTracksJson_)||i.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind}),u=function(e,n,t){var r,i,o,l,a,u,s,d,c,v,f=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){var m,g,h,y,b,w,k,S;p.isDrmEnabled=!0;var T=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,E=(null==T?void 0:T.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(h=g[0])||void 0===h||null===(y=h.options)||void 0===y?void 0:y.serverURL);p.licenseUrl=E;var C=(null==T?void 0:T.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(S=k.httpRequestHeaders)||void 0===S?void 0:S["X-AxDRM-Message"]);p.licenseToken=C}var I=(null==e||null===(r=e[f])||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.contentType)||"VIDEO";p.contentType=I;var P=null==e||null===(o=e[f])||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.runtime;p.duration=P;var D=null==e||null===(a=e[f])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;p.mediaTitle=D;var O=null==e||null===(s=e[f])||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.videoImageUrl;return p.mediaImage=O,p.subTitles=t,p.DVR=(null==e||null===(c=e[f])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(ee,n,l);return Le(Le({},u),{},{transmitTrackingUrl:e.trackingUrlManager.get()||null,convivaMetaData:Le({customerKey:(null==a||null===(t=a.convivaConfig)||void 0===t?void 0:t.customerKey)||null,debug:(null==a||null===(r=a.convivaConfig)||void 0===r?void 0:r.debug)||!1},he.getData())})},modifyLoadRequestFn:function(e){var n,t,r,i,l,a=m.getPlayer(o),u=(null==a?void 0:a.currentSource())||{};!(null===(n=ee)||void 0===n||null===(t=n[ie])||void 0===t||null===(r=t.streamingInfo)||void 0===r||null===(i=r.videoAssets)||void 0===i?void 0:i.is4K)&&1||null!=u&&u.src&&null!=u&&null!==(l=u.src)&&void 0!==l&&l.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),J);if(!i.getPlayers()[o]){null!=a&&a.debugConfig&&null!=a&&null!==(Q=a.debugConfig)&&void 0!==Q&&Q.enable&&i.log.level("debug");var me=i(o,pe,function(){var n=t(r.mark(function n(){var t,l,s,d,c,f,p,m,g,h,y,b,w,k,S,T,E,C,I,P;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(me),console.log(i.VERSION),console.log(i.getPlugins()),n.next=5,X(a,ee);case 5:if(b=null===(t=ee)||void 0===t||null===(l=t[ie])||void 0===l||null===(s=l.liveDetails)||void 0===s?void 0:s.startOverTime,ae&&u.resolve(Le({status:!0,msg:"Player Initialised"},te?{seriesResponse:te,response:ee}:{response:ee})),e.inititateBeacon(o,{analyticsCb:null==a?void 0:a.analyticsCb,analyticsEventParams:null==a?void 0:a.analyticsEventParams,userId:null==a?void 0:a.userId}),ge(o,a),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),le&&V(o,b),!ue||null!=a&&null!==(d=a.customData)&&void 0!==d&&d.disableAds||e.initialiseAdvertisement(o,ue,ee),w=e.getSource(ee,o),console.log(w),null!=a&&a.nearestClusterUrl&&(w=e.getUpdatedClusterSource(w,a.nearestClusterUrl)),!de){n.next=21;break}return n.next=18,e.getSGAIEnabledSource(o,ee);case 18:w=n.sent,n.next=25;break;case 21:if(!ce){n.next=25;break}return n.next=24,e.getTransmitEnabledSource(w,ee,o);case 24:w=n.sent;case 25:w?e.loadVideo(o,w):(u.reject({status:!1,msg:"Incompatible / Missing Source",response:ee}),e.handleError(o,"Incompatible / Missing Source")),((null===(c=ee)||void 0===c||null===(f=c[ie])||void 0===f||null===(p=f.contentDetails)||void 0===p||null===(m=p.closedCaptions)||void 0===m?void 0:m.length)>0||(null===(g=ee)||void 0===g||null===(h=g[ie])||void 0===h||null===(y=h.closedCaptions)||void 0===y?void 0:y.length)>0)&&(P=(null===(S=ee)||void 0===S||null===(T=S[ie])||void 0===T||null===(E=T.contentDetails)||void 0===E?void 0:E.closedCaptions)||(null===(C=ee)||void 0===C||null===(I=C[ie])||void 0===I?void 0:I.closedCaptions),k=P.filter(function(e){return"VTT"===e.format}),v.addCaptions(o,k)),null!=a&&a.disableControls?e.disableControls(o):ye(o,Le(Le(Le({},a),pe),{},{liveVideo:ae,isDvrEnabled:le,res:ee,sres:te})),Re(o,Le(Le(Le({},a),pe),{},{liveVideo:ae}),u,{res:ee,sres:te});case 29:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}())}};function Ve(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Ue(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ve(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Fe,qe=function(e,n){var t=n.resolve,r=n.reject,i=null==e?void 0:e.playerId,o=He(e);Be(i,{res:o},e,{resolve:t,reject:r})},He=function(n){var t,r,i,o,l,a,u,s,d,c,v,f,p,m=null==n?void 0:n.streamingInfo,g=null==n||null===(t=n.streamingInfo)||void 0===t?void 0:t.videoAssets,h=(null==n||null===(r=n.streamingInfo)||void 0===r?void 0:r.isDrmEnabled)||null,y=(null==n||null===(i=n.streamingInfo)||void 0===i||null===(o=i.ads)||void 0===o?void 0:o.url)||null,w=(null==n||null===(l=n.streamingInfo)||void 0===l?void 0:l.posterUrl)||null,k=(null==n||null===(a=n.streamingInfo)||void 0===a?void 0:a.subtitles)||[],S=(null==n||null===(u=n.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.drmProvider)||null,T=(null==n||null===(d=n.streamingInfo)||void 0===d?void 0:d.macroMap)||[],E=(null==n||null===(c=n.customData)||void 0===c||null===(v=c.ads)||void 0===v?void 0:v.isSSAIEnabled)||!1,C=null==n?void 0:n.token,I=e.getDecodedToken(C);null==I||I.site;var P=null==I?void 0:I.siteId,D=(null==n||null===(f=n.customData)||void 0===f||null===(p=f.comscore)||void 0===p?void 0:p.video)||null,O=Ue(Ue({id:"".concat(P,"_external")},!h&&{directPlaybackUrl:null==g?void 0:g.url}),{},{video:Ue(Ue(Ue(Ue(Ue({drmEnabled:h,streamingInfo:Ue(Ue({videoAssets:Ue(Ue({},S&&{drmProvider:S}),{},{widevine:null==g?void 0:g.widevine,fairPlay:null==g?void 0:g.fairPlay,playReady:null==g?void 0:g.playReady})},(null==m?void 0:m.isDvrEnabled)&&{isLiveStream:!0}),(null==D?void 0:D.isLiveStream)&&{isLiveStream:null==D?void 0:D.isLiveStream})},E&&{isSSAIEnabled:E}),{},{metadata:T,liveDetails:{isDvrEnabled:null==m?void 0:m.isDvrEnabled},gist:Ue(Ue(Ue({},w&&{videoImageUrl:w}),(null==D?void 0:D.videoId)&&{id:null==D?void 0:D.videoId}),(null==D?void 0:D.videoTitle)&&{title:null==D?void 0:D.videoTitle}),contentDetails:Ue({},(null==k?void 0:k.length)>0&&{closedCaptions:b(k)})},(null==D?void 0:D.runtime)&&{runtime:null==D?void 0:D.runtime}),(null==D?void 0:D.publishDate)&&{publishDate:null==D?void 0:D.publishDate}),(null==D?void 0:D.platform)&&{platform:null==D?void 0:D.platform}),(null==D?void 0:D.series)&&{series:null==D?void 0:D.series}),ads:{preRoll:{adTags:{web:Ue(Ue({},y&&{active:!0}),y&&{url:y})}}}});return D&&(null!=D&&D.isDvrEnabled&&(O.video.liveDetails=Ue(Ue({},O.video.liveDetails),{},{isDvrEnabled:null==D?void 0:D.isDvrEnabled})),null!=D&&D.metadata&&(O.video.metadata=[].concat(b(O.video.metadata),b(null==D?void 0:D.metadata)))),O},ze=null,Ge=function(e,n){(new Date).getMonth(),new Date(n).getMonth(),(new Date).getFullYear(),new Date(n).getFullYear();var t=Math.floor(e/6048e5),r=function(e,n){var t;return t=12*(n.getFullYear()-e.getFullYear()),t-=e.getMonth(),(t+=n.getMonth())<=0?0:t}(new Date,new Date(n)),i=r>0&&t>4?r:0,o=function(e,n){var t=new Date(n).getFullYear()-new Date(e).getFullYear(),r=new Date(n).getMonth()-new Date(e).getMonth();return new Date(n).getDay()-new Date(e).getDay()<0&&(r-=1),r<0&&(t-=1),t}(new Date,new Date(n));return[o>0&&i>0?o:0,i,t,Math.floor(e/864e5),Math.floor(e%864e5/36e5),Math.floor(e%36e5/6e4),Math.floor(e%6e4/1e3)]},We=function(e){var n,t=w(e,8),r=t[0],i=t[1],o=t[2],l=t[3],a=t[4],u=t[5],s=t[6],d=t[7];n=r>=1?" ".concat(r," Year"):i>=1?" ".concat(i," month"):o>=1?" ".concat(o," week"):l>=1?" ".concat(l," day"):a<24&&a>=12?" ".concat(a," hour"):a>0?"".concat(a," hours ").concat(u," minutes ").concat(s," seconds"):u>0?"".concat(u," minutes ").concat(s," seconds"):"".concat(s," seconds"),d.textContent="".concat(n)},Ke=(Fe={scheduleStartTimeMs:0,scheduleEndTimeMs:0},{get:function(){return Fe},set:function(e){Fe={scheduleStartTimeMs:null==e?void 0:e.startDateTime,scheduleEndTimeMs:null==e?void 0:e.endDateTime}}});function Ye(e,n,t,r){if(e){var i=function(){var e,i,l=null===(e=Ke.get())||void 0===e?void 0:e.scheduleStartTimeMs,a=null===(i=Ke.get())||void 0===i?void 0:i.scheduleEndTimeMs,u=Date.now();if(u-a>0){var s=document.getElementsByClassName("error-message")[0];return s&&(s.textContent=h.getLocalisation("eventEnded")||"Game has ended",r.textContent=""),clearInterval(o),void(null==t||t())}var d=l-u;if(d/1e3<=0)return clearInterval(o),null==n||n([0,0,0,0,0,0,0,r]),void(null==t||t());var c=Ge(d,l);null==n||n([].concat(b(c),[r]))};i();var o=setInterval(i,1e3);return o}}var $e=function(e,n,t){var r,i,o,l,a,u,s,d,c=null==n||null===(r=n.response)||void 0===r||null===(i=r.data)||void 0===i?void 0:i.errorCode,v=(null==n||null===(o=n.response)||void 0===o||null===(l=o.data)||void 0===l?void 0:l.errorMessage)||(null==n?void 0:n.message)||null;Ke.set({startDateTime:null==n||null===(a=n.response)||void 0===a||null===(u=a.data)||void 0===u?void 0:u.scheduleStartDate,endDateTime:null==n||null===(s=n.response)||void 0===s||null===(d=s.data)||void 0===d?void 0:d.scheduleEndDate}),function(e,n,t,r){var i,o,l=Date.now(),a=null===(i=Ke.get())||void 0===i?void 0:i.scheduleStartTimeMs,u=null===(o=Ke.get())||void 0===o?void 0:o.scheduleEndTimeMs,s=function(e,n,t,r){var i;e<0?i=h.getLocalisation("eventNotStarted")||r||"Game starts in":(n>0||"VIDEO_NOT_EXISTS"==t)&&(i=h.getLocalisation("eventEnded")||r||"Game has ended");return i||r}(l-a,l-u,n,t);if(document.getElementsByClassName("error-container")[0]){var d=document.getElementsByClassName("error-message")[0];d&&(d.textContent="".concat(s));var c=document.getElementsByClassName("error-timer-message")[0];c&&Ye(Math.abs(a),We,r,c)}else{var v=document.getElementById(e).parentElement;if(v){var f=document.createElement("div");f.className="error-container";var p=document.createElement("div");p.className="error-message";var m=document.createElement("div");m.className="error-timer-message",p.textContent="".concat(s),f.appendChild(p),f.appendChild(m),v.append(f),Ye(Math.abs(a),We,r,m)}}}(e,c,v,t)};function Je(n,t){var r=t.scheduleEndDate,i=t.scheduleStartDate;Ke.set({startDateTime:i,endDateTime:r}),ze&&clearInterval(ze),ze=setInterval(function(){var t,r=Date.now(),i=null===(t=Ke.get())||void 0===t?void 0:t.scheduleEndTimeMs;if(console.log("scheduleEndTimeMs",i),i&&r>i){var o;console.log("Game ended");var l=m.getPlayer(n);if(e.isPlayerInitialised(n)&&l){var a;l.dispose(),console.log("Player disposed");var u=null===(a=document.getElementsByClassName("vl-container"))||void 0===a?void 0:a[0],s=document.createElement("video");s.id=n,s.className="video-js",s.style.width="100%",s.style.height="100%",u&&u.appendChild(s)}var d=h.getLocalisation("eventEnded")||"Game has ended",c=null===(o=document.getElementsByClassName("error-container"))||void 0===o?void 0:o[0];if(c){var v=c.querySelector(".error-message");v&&(v.textContent=d)}else{var f=document.getElementById(n),p=null==f?void 0:f.parentElement;if(p){(c=document.createElement("div")).className="error-container";var g=document.createElement("div");g.className="error-message",g.textContent=d,c.appendChild(g),p.append(c)}}clearInterval(ze)}},1e3)}function Xe(e,n){return Qe.apply(this,arguments)}function Qe(){return(Qe=t(r.mark(function n(t,i){var o,l,a,u,s,d,c,v,f;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a=i.resolve,u=i.reject,s=null==t?void 0:t.videoId,d=null==t?void 0:t.playerId,c=!(null==t||!t.anonymousId),n.next=6,e.getToken();case 6:v=n.sent,f=!1===(null==t||null===(o=t.customData)||void 0===o||null===(l=o.ads)||void 0===l?void 0:l.isSSAIEnabled),e.getVideoDetails(s,v,f).then(function(n){var r,i,o,l,f,p,m,g,h,y;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(i=r.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType,e.setCurrentVideo(null==n?void 0:n.data);var b=null==n||null===(l=n.data)||void 0===l||null===(f=l.video)||void 0===f||null===(p=f.gist)||void 0===p?void 0:p.scheduleEndDate,w=null==n||null===(m=n.data)||void 0===m||null===(g=m.video)||void 0===g||null===(h=g.gist)||void 0===h?void 0:h.scheduleStartDate;Je(d,{scheduleEndDate:b,scheduleStartDate:w});var k,S=null==n?void 0:n.data;if(null!=t&&t.watchHistory&&null!=t&&null!==(y=t.watchHistory)&&void 0!==y&&y.enable&&!c)if((null===(k=t.watchHistory)||void 0===k?void 0:k.saveOffline)||!1){var T,E,C,I=Pe((null===(T=t.watchHistory)||void 0===T?void 0:T.profileId)||"",s,null==t?void 0:t.siteOwner);if(I&&I.length)t.watchHistoryResumeTime=(null===(E=I[0])||void 0===E?void 0:E.watchedTime)||null,t.watchedPercentage=(null===(C=I[0])||void 0===C?void 0:C.watchedPercentage)||null;S.contentType="video",Be(d,{res:S},t,{resolve:a,reject:u})}else e.getVideoInfo(s,v).then(function(e){var n,r,i,o,l,a;null!==(n=window)&&void 0!==n&&null!==(r=n.watchHistory)&&void 0!==r&&r.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),t.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,t.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,S.contentType="video"}).catch(function(e){var n,t,r,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(r=window)||void 0===r||null===(i=r.watchHistory)||void 0===i||i.cb(e))}).finally(function(){Be(d,{res:S},t,{resolve:a,reject:u})});else Be(d,{res:S},t,{resolve:a,reject:u})}).catch(function(n){var r,i,o=(null==t||null===(r=t.event)||void 0===r?void 0:r.showScheduleTimer)||!1,l=(null==t||null===(i=t.event)||void 0===i?void 0:i.onCountdownComplete)||null;o&&$e(d,n,l),e.initiateErrorHandling(n,d,u,s)});case 9:case"end":return n.stop()}},n)}))).apply(this,arguments)}function Ze(e,n){return en.apply(this,arguments)}function en(){return(en=t(r.mark(function n(t,i){var o,l,a,u,s,d,c,v;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a=i.resolve,u=i.reject,n.next=3,e.getToken();case 3:s=n.sent,d=null==t?void 0:t.playerId,c=null==t?void 0:t.epg,v=!1===(null==t||null===(o=t.customData)||void 0===o||null===(l=o.ads)||void 0===l?void 0:l.isSSAIEnabled),e.getLinearChannelDetails(c,s,v).then(function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==c?void 0:c.channelId,Be(d,{res:n},t,{resolve:a,reject:u})}).catch(function(n){e.initiateErrorHandling(n,d,u,videoId)});case 8:case"end":return n.stop()}},n)}))).apply(this,arguments)}function nn(e,n){return tn.apply(this,arguments)}function tn(){return(tn=t(r.mark(function n(t,i){var o,l,a,u,s,d,c;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return l=i.resolve,a=i.reject,n.next=3,e.getToken();case 3:u=n.sent,s=null==t?void 0:t.playerId,d=sessionStorage.getItem("season-idx")||0,e.seasonIdxManager.set(parseInt(d)),c=null==t||null===(o=t.series)||void 0===o?void 0:o.id,e.getSeriesDetails(c,u).then(function(n){var r,i,o,d=n.data,v=n.data.seasons;e.setCurrentSeries(v);var f=videoId||(null==v||null===(r=v[0])||void 0===r||null===(i=r.episodes)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.id);e.createSeriesWatchMap(c,u),e.getVideoDetails(f,u).then(function(n){var r,i,o;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(i=r.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType,e.setCurrentVideo(n.data),Be(s,{res:null==n?void 0:n.data,sres:d},t,{resolve:l,reject:a})}).catch(function(n){e.initiateErrorHandling(n,s,a,videoId)})}).catch(function(n){e.initiateErrorHandling(n,s,a)});case 9:case"end":return n.stop()}},n)}))).apply(this,arguments)}var rn,on=(rn=new Map,{set:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=Array.isArray(n)?n:[];return rn.set(e,t),t},get:function(e){return rn.get(e)||[]},remove:function(e){rn.delete(e)}});function ln(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function an(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return un(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?un(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,o=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw o}}}}function un(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var sn=function(e){var n=Date.parse(null==e?void 0:e.eventStartUtc),t=Number.isFinite(n)?n/1e3:0;return{start:t+(Number(null==e?void 0:e.startTime)||0),end:t+(Number(null==e?void 0:e.endTime)||0)}},dn=function(e){var n;try{var t,r,i=null==e||null===(t=e.liveTracker)||void 0===t||null===(r=t.seekableEnd)||void 0===r?void 0:r.call(t);if(Number.isFinite(i))return i}catch(e){}var o=null==e||null===(n=e.seekable)||void 0===n?void 0:n.call(e);return o&&o.length?o.end(o.length-1):NaN};function cn(e){var t=null,r=null,i="none",o=function(n){var o=m.getPlayer(e);if(!o)return null;if("pdt"===i&&null!=t)return r+(n-t);var l=dn(o);return Number.isFinite(l)?l-(Date.now()/1e3-n):null},l=function(){var n=m.getPlayer(e),t=n&&n.seekable();return t&&t.length?{start:t.start(0),end:t.end(t.length-1)}:{start:0,end:0}};return{refreshAnchor:function(){var n=m.getPlayer(e);if(n){var o=function(e){try{var n=e.tech(!0),t=n&&n.vhs,r=t&&t.playlists,i=r&&"function"==typeof r.media&&r.media();return i&&i.segments||null}catch(e){return null}}(n),l=n.currentTime()||0;if(o&&o.length){var a,u=null,s=1/0,d=an(o);try{for(d.s();!(a=d.n()).done;){var c=a.value;if(c&&"number"==typeof c.programDateTime&&"number"==typeof c.start&&Number.isFinite(c.start)){var v=Math.abs(c.start-l);v<s&&(s=v,u=c)}}}catch(e){d.e(e)}finally{d.f()}if(u)return t=u.programDateTime/1e3,r=u.start,void(i="pdt")}t=null,r=null,i="now"}},anchorInfo:function(){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ln(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ln(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}({anchorPdtSec:t,anchorPlayerT:r,source:i},l())},chapterToPlayerTime:function(e){return o(sn(e).start)},chapterStartPercent:function(e){return function(e){var n=l(),t=n.start,r=n.end;if(!(r>t))return null;var i=o(e);return null==i||i<t||i>r?null:(i-t)/(r-t)*100}(sn(e).start)},playerTimeToChapterIndex:function(n,o){var l=function(n){var o=m.getPlayer(e);if(!o)return null;if("pdt"===i&&null!=t)return t+(n-r);var l=dn(o);return Number.isFinite(l)?Date.now()/1e3-(l-n):null}(n);if(null==l)return-1;for(var a=-1,u=0;u<o.length;u++){var s=sn(o[u]),d=s.start,c=s.end,v=Math.max(c,d+.001);l>=d&&l<v&&(a=u)}return a},windowBounds:l}}function vn(e){return"livedvr"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).timeMode?cn(e):function(e){var n=function(e){return Number(null==e?void 0:e.startTime)||0},t=function(e){var t=Number(null==e?void 0:e.endTime);return Number.isFinite(t)?t:n(e)};return{chapterToPlayerTime:function(e){return n(e)},chapterStartPercent:function(t){var r=m.getPlayer(e),i=r&&r.duration();if(!Number.isFinite(i)||i<=0)return null;var o,l=n(t);return l<0||l>i?null:100*((o=l/i)<0?0:o>1?1:o)},playerTimeToChapterIndex:function(e,r){for(var i=-1,o=0;o<r.length;o++){var l=n(r[o]),a=Math.max(t(r[o]),l+.001);e>=l&&e<a&&(i=o)}return i},windowBounds:function(){var n=m.getPlayer(e),t=n&&n.duration();return{start:0,end:Number.isFinite(t)?t:0}},refreshAnchor:function(){},anchorInfo:function(){return{source:"vod"}}}}(e)}var fn="chapter-change",pn="chapter-click",mn="chapters-updated";function gn(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=m.getPlayer(e);r?r.trigger(n,t):console.error("[CHAPTERS] Player instance not found")}function hn(e){var n=m.getPlayer(e);if(!n)return console.error("[CHAPTERS] Player instance not found"),{};var t=function(e,t){var r=function(e,n){return t(n)};return n.on(e,r),function(){return n.off(e,r)}};return{onChapterChange:function(e){return t(fn,e)},onChapterClick:function(e){return t(pn,e)},onChaptersUpdated:function(e){return t(mn,e)}}}var yn="vjs-chapter-marker",bn="vjs-chapter-preview",wn=function(e){try{var n,t,r;return(null==e||null===(n=e.controlBar)||void 0===n||null===(t=n.progressControl)||void 0===t||null===(r=t.seekBar)||void 0===r?void 0:r.el())||null}catch(e){return null}};function kn(e,n){var t=n.store,r=n.mapper,o=n.chaptersConfig,l=void 0===o?{}:o,a=n.seek,u=m.getPlayer(e);if(!u)return{render:function(){},reposition:function(){},destroy:function(){}};var s=new Map,d=null,c=-1,v=function(){return!0===(null==l?void 0:l.enable)},f=function(n,t){var o=m.getPlayer(e),l=wn(o);if(l){var a=function(e){if(d&&d.isConnected)return d;(d=document.createElement("div")).className=bn;var n=document.createElement("div");n.className="vjs-chapter-preview__time";var t=document.createElement("div");t.className="vjs-chapter-preview__label",d.appendChild(n),d.appendChild(t);var r=document.createElement("span");return r.className="vjs-chapter-preview__pointer",d.appendChild(r),d._time=n,d._label=t,d._pointer=r,e.appendChild(d),d}(l);a._time.textContent=function(e){try{var n=r.chapterToPlayerTime(e);if(null==n||!Number.isFinite(n))return"";if("vod"===("function"==typeof r.anchorInfo?r.anchorInfo():{}).source)return i.formatTime(n,n);var t=(r.windowBounds()||{}).end;if(!Number.isFinite(t))return"";var o=Math.max(0,t-n);return"-".concat(i.formatTime(o,o))}catch(e){return""}}(n),a._label.textContent=(null==n?void 0:n.label)||"",a.classList.add("vjs-chapter-preview--visible");var u="function"==typeof(null==o?void 0:o.el)?o.el():null;u&&u.classList.add("vlp-chapter-preview-open"),function(e,n,t,r){var i="function"==typeof(null==t?void 0:t.el)?t.el():null;if(i){var o=i.getBoundingClientRect(),l=n.getBoundingClientRect(),a=e.offsetWidth||300,u=a/2,s=l.left+r/100*l.width,d=o.left+8+u,c=o.right-8-u,v=s;c>=d&&(v=Math.min(Math.max(s,d),c));var f=v-u-l.left;if(e.style.left="".concat(f,"px"),e.style.transform="none",e._pointer){var p=Math.min(Math.max(s-(l.left+f),8),a-8);e._pointer.style.left="".concat(p,"px")}}else e.style.left="".concat(r,"%")}(a,l,o,t)}},p=function(){d&&d.classList.remove("vjs-chapter-preview--visible");var n=m.getPlayer(e),t="function"==typeof(null==n?void 0:n.el)?n.el():null;t&&t.classList.remove("vlp-chapter-preview-open")},g=function(n){var t=document.createElement("div");t.className=yn,t.dataset.segmentId=String(n.segmentId);var i=function(e){var n=null!=e&&e.icon?String(e.icon).trim():"";if(!n)return null;var t=document.createElement("span");if(t.className="vjs-chapter-marker__icon","<"===n.charAt(0)){var r=m.parseSvgString(n);r&&t.appendChild(r)}else{var i=document.createElement("img");i.src=n,i.alt="",t.appendChild(i)}return t}(n);return i&&t.appendChild(i),t.addEventListener("click",function(t){t.stopPropagation(),"function"==typeof a&&a(n.segmentId),gn(e,pn,{chapter:n})}),t.addEventListener("mouseenter",function(){var e=r.chapterStartPercent(n);null!=e&&f(n,e)}),t.addEventListener("mouseleave",p),t},h=function(){v()&&0!==s.size&&(r.refreshAnchor(),t.get(e).forEach(function(e){var n=s.get(String(e.segmentId));if(n){var t=r.chapterStartPercent(e);null==t?n.style.display="none":(n.style.display="",n.style.left="".concat(t,"%"))}}))},y=0,b=function(n){s.forEach(function(e){return e.classList.remove("".concat(yn,"--active"))});var r=t.get(e),i=n>=0?r[n]:null;if(i){var o=s.get(String(i.segmentId));o&&o.classList.add("".concat(yn,"--active"))}},w=function(){var n=m.getPlayer(e);if(n){var i=t.get(e),o=r.playerTimeToChapterIndex(n.currentTime()||0,i);-1===o&&Date.now()<y||o!==c&&(c=o,b(o),gn(e,fn,{chapter:o>=0?i[o]:null}))}},k=m.throttle(function(){h(),w()},1e3),S=function(){h(),w()};u.on("timeupdate",k),u.on("seeked",S);var T=!1;try{u.liveTracker&&"function"==typeof u.liveTracker.on&&(u.liveTracker.on("liveedgechange",h),T=!0)}catch(e){}var E=null;(function(){try{return"function"==typeof r.anchorInfo&&"vod"!==r.anchorInfo().source}catch(e){return!1}})()&&(E=setInterval(h,500));return{render:function(){var n=m.getPlayer(e),i=wn(n);i&&(i.querySelectorAll(".".concat(yn)).forEach(function(e){return e.remove()}),s.clear(),v()&&(r.refreshAnchor(),t.get(e).forEach(function(e){var n=g(e);i.appendChild(n),s.set(String(e.segmentId),n)}),h(),b(c),w()))},reposition:h,destroy:function(){try{u.off("timeupdate",k),u.off("seeked",S),T&&u.liveTracker.off("liveedgechange",h)}catch(e){}E&&(clearInterval(E),E=null);var n=wn(m.getPlayer(e));n&&n.querySelectorAll(".".concat(yn,", .").concat(bn)).forEach(function(e){return e.remove()}),s.clear(),d=null},setActiveBySegment:function(n){var r=t.get(e),i=r.findIndex(function(e){return String(e.segmentId)===String(n)});i<0||(y=Date.now()+1500,i!==c&&(c=i,b(i),gn(e,fn,{chapter:r[i]})))}}}var Sn=new Map,Tn=function(e){try{var n,t,r;return!(null==e||null===(n=e.controlBar)||void 0===n||null===(t=n.progressControl)||void 0===t||null===(r=t.seekBar)||void 0===r||!r.el())}catch(e){return!1}},En=function(e){var n=Sn.get(e);if(n)return n;n={mapper:vn(e,{timeMode:"vod"}),markers:null,chaptersConfig:{},timeMode:"vod"},Sn.set(e,n);var t=m.getPlayer(e);return t&&t.on("dispose",function(){return jn(e)}),n},Cn=function(e){var n=Sn.get(e),t=function(e){var n=Sn.get(e);if(!n||n.markers)return(null==n?void 0:n.markers)||null;var t=m.getPlayer(e);return t&&Tn(t)?(n.markers=kn(e,{store:on,mapper:n.mapper,chaptersConfig:n.chaptersConfig,seek:function(n){return On(e,n)}}),n.markers):null}(e);t&&n&&t.render()};function In(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return En(e),on.set(e,n),Cn(e),gn(e,mn,{chapters:on.get(e)}),!0}function Pn(e){return on.get(e)}function Dn(e){on.set(e,[]);var n=Sn.get(e);return null!=n&&n.markers&&n.markers.render(),gn(e,mn,{chapters:[]}),!0}function On(e,n){var t,r,i=m.getPlayer(e),o=En(e);if(!i)return!1;var l=on.get(e).find(function(e){return e.segmentId===n});if(!l)return!1;o.mapper.refreshAnchor();var a=o.mapper.chapterToPlayerTime(l);if(null==a||!Number.isFinite(a))return!1;var u=o.mapper.windowBounds(),s=u.start,d=u.end;return Number.isFinite(s)&&Number.isFinite(d)&&d>s&&(a=Math.min(Math.max(a,s),d-.1)),i.currentTime(a),null===(t=o.markers)||void 0===t||null===(r=t.setActiveBySegment)||void 0===r||r.call(t,n),!0}function jn(e){var n=Sn.get(e);n&&(n.disposed=!0,n.markers&&n.markers.destroy()),Sn.delete(e),on.remove(e)}var xn,An=function(n){var t=n.site,r=n.sseBaseUrl,i=n.sseEndpoint,o=n.debug,l=void 0!==o&&o;return k.createSSETransport({site:t,sseBaseUrl:r,getToken:e.getToken,sseEndpoint:i,onOpen:function(e){var n=e.userId,t=e.endpoint;l&&console.log("SSE Connected:",n,t)},onMessage:function(n){var t,r,i,o,a,u,s,d,c,v;if(l&&console.log("SSE Message:",n),(null===(t=e.getCurrentVideo())||void 0===t||null===(r=t.video)||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.id)===(null==n||null===(o=n.payload)||void 0===o?void 0:o.id)&&"GAME_STATE_CHANGE"===(null==n?void 0:n.notificationType)){var f=1e3*(null==n||null===(a=n.payload)||void 0===a||null===(u=a.states)||void 0===u||null===(s=u.live)||void 0===s?void 0:s.startDateTime),p=1e3*(null==n||null===(d=n.payload)||void 0===d||null===(c=d.states)||void 0===c||null===(v=c.end)||void 0===v?void 0:v.endDateTime);f&&p&&(console.log("Setting schedule timer",f,p),Ke.set({startDateTime:f,endDateTime:p}))}},onReconnectAttempt:function(e){l&&console.log("Reconnect attempt:",e)},onHeartbeatTimeout:function(e){var n=e.elapsed;l&&console.warn("Heartbeat timeout after:",n)},onTokenInvalid:function(e){l&&console.error("Invalid token:",e),window.location.href="/login"},onError:function(e,n){l&&console.error("SSE Error:",e,n)},onClose:function(){l&&console.log("SSE Closed")}})},Nn=function(e){var n=e.enable,t=e.site,r=e.sseBaseUrl,i=e.sseEndpoint,o=e.debug;if(n){var l=An({site:t,sseBaseUrl:r,sseEndpoint:i,debug:void 0!==o&&o});return l._sseBaseUrl=r,l._site=t,l._sseEndpoint=i,l}};function Mn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Rn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mn(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}exports.VLPlayerCore=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:c.onTimeUpdate,getVideoDuration:c.getVideoDuration,onVideoEnded:c.onVideoEnded,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var i=t(r.mark(function t(i,o){var l,a,u,s,d,c,v,f,p,g,y,b,w,k,S,T,E,C,I,P,D,O,j,x,A,N,R,_,L,B,V,U;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.isPlayerInitialised(null==n?void 0:n.playerId)){t.next=3;break}return i({status:!0,msg:"Player already initialised",skipped:!0}),t.abrupt("return");case 3:if(I=(null==n?void 0:n.videoSourceUrl)||!1,P=null==n?void 0:n.asat,D=(null==n||null===(l=n.epg)||void 0===l?void 0:l.enable)||!1,O=null==n?void 0:n.videoId,j=(null==n||null===(a=n.series)||void 0===a?void 0:a.enable)||!1,x=(null==n?void 0:n.streamingInfo)||!1,window.videoId=O,A=null==n?void 0:n.token,!e.token_authentication_enabled(n)){t.next=18;break}if(sessionStorage.setItem("vlp_token",A),e.refreshTokenManager().set(null==n?void 0:n.refreshToken),A&&!e.isTokenExpired(A)){t.next=17;break}return o({status:!1,msg:"".concat(A?"Token is expired !":"Missing Authorization Token"),response:{token:A}}),t.abrupt("return");case 17:xn=JSON.parse(atob(A.split(".")[1]));case 18:return window.siteName=null===(u=xn)||void 0===u?void 0:u.site,window.siteId=null===(s=xn)||void 0===s?void 0:s.siteId,n.isAnonymousUser=!(null===(d=xn)||void 0===d||!d.anonymousId),n.siteOwner=(null===(c=xn)||void 0===c?void 0:c.site)||null,n.userId=(null===(v=xn)||void 0===v?void 0:v.userId)||null,e.setUserId((null===(f=xn)||void 0===f?void 0:f.userId)||(null===(p=xn)||void 0===p?void 0:p.anonymousId)||null),window.watchHistory=n.watchHistory||null,N=null==n?void 0:n.playerId,n.chromecastReceiverId=null!=n&&null!==(g=n.series)&&void 0!==g&&g.enable?null:null==n?void 0:n.chromecastReceiverId,R=(null==n||null===(y=n.analytics)||void 0===y?void 0:y.gaId)||null,(_=null==n?void 0:n.errors)&&(window.customErrors=_),window.customData=null==n?void 0:n.customData,h.setLocalisation(null==n||null===(b=n.customData)||void 0===b?void 0:b.localisation),e.baseUrlManager.set(n.apiBaseUrl),null!=n&&n.skin&&!m.isNotAValidSkin(n.skin)||(n.skin="VL_ONE"),e.playerConfigManager.setConfig(n),t.next=37,K(n);case 37:R&&M("https://www.googletagmanager.com/gtag/js?id=".concat(R)).then(function(){return e.runGtag(R)}).catch(function(e){}),(L=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(N)))&&L.addEventListener("contextmenu",function(e){return e.preventDefault()}),(B=Nn({enable:null==n||null===(k=n.sse)||void 0===k?void 0:k.enable,site:null==n||null===(S=n.sse)||void 0===S?void 0:S.siteName,sseBaseUrl:null==n||null===(T=n.sse)||void 0===T?void 0:T.sseBaseUrl,sseEndpoint:null==n||null===(E=n.sse)||void 0===E?void 0:E.sseEndpoint,debug:null==n||null===(C=n.sse)||void 0===C?void 0:C.debug}))&&!B.isConnectionActive()&&B.connect(),I?(U={directPlaybackUrl:I,id:V="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},P?e.getVideoDetails(V,A).then(function(e){var t=(null==e?void 0:e.data)||{};Be(N,{res:Rn(Rn({},t),U)},n,{resolve:i,reject:o})}).catch(function(n){e.initiateErrorHandling(n,N,o,V)}):Be(N,{res:U},n,{resolve:i,reject:o})):x?qe(n,{resolve:i,reject:o}):j?nn(n,{resolve:i,reject:o}):D?Ze(n,{resolve:i,reject:o}):Xe(n,{resolve:i,reject:o});case 43:case"end":return t.stop()}},t)}));return function(e,n){return i.apply(this,arguments)}}())},getRenditions:f.getRenditions,skip:e.skip,getPlayer:m.getPlayer,play:e.play,pause:e.pause,detectBrowser:g.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:c.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:v.enableCaptions,disableCaptions:v.disableCaptions,getCaptions:v.getCaptions,playSelectedResolution:p.playSelectedResolution,getSource:e.getSource,setVolume:_,getVolume:L,disableControls:e.disableControls,setPlaybackSpeed:c.setPlaybackSpeed,getEntitlementData:e.getEntitlementData,getSsaiEvents:e.getSsaiEvents,playerEvents:c.playerEvents,onReplay:c.onReplay,setChapters:In,getChapters:Pn,clearChapters:Dn,seekToChapter:On,getChapterEvents:hn}},exports.initChapters=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.chapters,r=void 0===t?[]:t,i=n.timeMode,o=void 0===i?"vod":i;n.res;var l=n.chaptersConfig,a=void 0===l?{}:l,u=m.getPlayer(e);if(!u)return!1;Array.isArray(r)&&r.length&&on.set(e,r);var s=Sn.get(e);null!=s&&s.markers&&s.markers.destroy();var d={mapper:vn(e,{timeMode:o}),markers:null,chaptersConfig:a||{},timeMode:o,disposed:!1};Sn.set(e,d);var c=function(){d.disposed||Cn(e)};return u.one("loadeddata",c),Tn(u)&&c(),u.on("dispose",function(){return jn(e)}),!0};
|
package/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("video.js/dist/video-js.min.css"),require("./generic-9fa3c0bb.js"),require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("video.js");var e=require("./index-
|
|
1
|
+
"use strict";require("video.js/dist/video-js.min.css"),require("./generic-9fa3c0bb.js"),require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("video.js");var e=require("./index-229dec72.js");require("./util-0574b423.js"),require("./captions-676468fe.js"),require("./renditions-508e7f85.js"),require("./resolution-e6b8a4eb.js"),require("./skin-c6084619.js"),require("./browser-77c57718.js"),require("./localisation-56e0a999.js"),require("axios"),require("md5"),require("js-cookie"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/slicedToArray"),require("@viewlift/comscore/index.js"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/get"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("@viewlift/sse"),require("@babel/runtime/helpers/assertThisInitialized"),module.exports=e.VLPlayerCore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./skin-c6084619.js"),l=require("./index-b639e99c.js"),i=require("./generic-9fa3c0bb.js"),n=require("./features-fbfbfeaa.js"),r=require("./localisation-56e0a999.js");require("@babel/runtime/helpers/toConsumableArray"),require("video.js"),require("video.js/dist/video-js.min.css"),require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/get"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("./util-0574b423.js"),require("@babel/runtime/helpers/typeof"),require("./captions-676468fe.js"),require("./renditions-508e7f85.js"),require("./resolution-e6b8a4eb.js"),require("@babel/runtime/helpers/assertThisInitialized"),require("./browser-77c57718.js"),require("@viewlift/comscore/index.js"),require("@babel/runtime/helpers/slicedToArray"),require("@viewlift/sse"),require("axios"),require("md5"),require("js-cookie");var o='<svg xmlns="http://www.w3.org/2000/svg" style="display:none">\n <defs>\n <symbol id="vjs-icon-pause" viewBox="0 0 17 16">\n <path d="M6.00138 15.4894C6.02138 15.7494 5.82138 15.9694 5.56138 15.9894C5.54138 15.9894 5.52138 15.9894 5.50138 15.9894H2.50138C2.24138 16.0094 2.02138 15.8094 2.00138 15.5494C2.00138 15.5294 2.00138 15.5094 2.00138 15.4894V0.499411C1.98138 0.239411 2.18138 0.0194107 2.44138 -0.000589337C2.46138 -0.000589337 2.48138 -0.000589337 2.50138 -0.000589337H5.50138C5.76138 -0.0205893 5.98138 0.179411 6.00138 0.439411C6.00138 0.459411 6.00138 0.479411 6.00138 0.499411V15.4894ZM14.0014 0.509411C14.0214 0.249411 13.8214 0.0294105 13.5614 0.00941051C13.5414 0.00941051 13.5214 0.00941051 13.5014 0.00941051H10.5014C10.2414 -0.0105895 10.0214 0.189411 10.0014 0.449411C10.0014 0.469411 10.0014 0.489411 10.0014 0.509411V15.4994C9.98138 15.7594 10.1814 15.9794 10.4414 15.9994C10.4614 15.9994 10.4814 15.9994 10.5014 15.9994H13.5014C13.7614 16.0194 13.9814 15.8194 14.0014 15.5594C14.0014 15.5394 14.0014 15.5194 14.0014 15.4994V0.509411Z" fill="white"/>\n </symbol>\n <symbol id="vjs-icon-play" viewBox="0 0 17 16">\n <path d="M0.38279 15.9526C0.28279 16.0326 0.142791 16.0126 0.0527906 15.9126C0.0127906 15.8626 -0.00720943 15.8026 0.00279057 15.7326V0.262601C-0.0172094 0.132601 0.0727907 0.0226013 0.192791 0.00260128C0.262791 -0.00739872 0.32279 0.0126014 0.38279 0.0426014L15.8528 7.8126C16.0628 7.9226 16.0628 8.0926 15.8528 8.1926L0.38279 15.9526Z" fill="white"/>\n </symbol>\n <symbol id="vjs-icon-fullscreen" viewBox="0 0 24 24">\n <path d="M7 14H5V19H10V17H7V14ZM5 10H7V7H10V5H5V10ZM17 17H14V19H19V14H17V17ZM14 5V7H17V10H19V5H14Z" fill="white"/>\n </symbol>\n <symbol id="vjs-icon-fullscreen-back" viewBox="0 0 24 24">\n <path d="M10.92 13.49L10.08 18.5C10.04 18.77 9.84001 18.83 9.64001 18.64L8.20001 17.2L5.41001 19.99L3.99001 18.57L6.78001 15.78L5.34001 14.34C5.15001 14.15 5.21001 13.95 5.48001 13.9L10.49 13.06C10.67 13.01 10.85 13.12 10.9 13.3C10.94 13.37 10.94 13.43 10.92 13.49ZM17.21 8.21L20 5.42L18.58 4L15.79 6.79L14.35 5.35C14.16 5.16 13.96 5.22 13.91 5.49L13.07 10.5C13.02 10.68 13.13 10.86 13.31 10.91C13.36 10.93 13.43 10.93 13.48 10.91L18.49 10.07C18.76 10.03 18.82 9.83 18.63 9.63L17.21 8.21Z" fill="#EBEBEB"/>\n </symbol>\n <symbol id="vjs-icon-volume" viewBox="0 0 24 24">\n <path d="M3 9.00047V15.0005H7L12 20.0005V4.00047L7 9.00047H3ZM16.5 12.0005C16.5 10.2305 15.48 8.71047 14 7.97047V16.0205C15.48 15.2905 16.5 13.7705 16.5 12.0005ZM14 3.23047V5.29047C16.89 6.15047 19 8.83047 19 12.0005C19 15.1705 16.89 17.8505 14 18.7105V20.7705C18.01 19.8605 21 16.2805 21 12.0005C21 7.72047 18.01 4.14047 14 3.23047Z" fill="white"/>\n </symbol>\n <symbol id="vjs-icon-mute" viewBox="0 0 24 24">\n <path d="M11.65 4.28V19.72C11.65 20 11.48 20.08 11.27 19.89L5.86 15.09H2.9C2.62 15.09 2.38 14.86 2.38 14.57V9.43C2.38 9.15 2.61 8.91 2.9 8.91H5.86L11.27 4.11C11.48 3.92 11.65 3.99 11.65 4.28Z" fill="#EBEBEB"/>\n <path d="M19.0909 12.5238L21.2626 14.6955L19.8146 16.1436L17.6429 13.9718L15.4711 16.1436L14.0231 14.6955L16.1948 12.5238L14.0231 10.352L15.4711 8.904L17.6429 11.0757L19.8146 8.904L21.2626 10.352L19.0909 12.5238Z" fill="white"/>\n </symbol>\n <symbol id="vjs-icon-pip" viewBox="0 0 24 24">\n <path d="M19 7H11V13H19V7ZM21 3H3C1.9 3 1 3.9 1 5V19C1 20.1 1.9 20.98 3 20.98H21C22.1 20.98 23 20.1 23 19V5C23 3.9 22.1 3 21 3ZM21 19.01H3V4.98H21V19.01Z" fill="white"/>\n </symbol>\n <symbol id="vjs-icon-captions" viewBox="0 0 18 16">\n <path d="M16.5 1.5V14.5H1.5V1.5H16.5ZM16 0H2C0.89 0 0 0.9 0 2V14C0 15.1 0.89 16 2 16H16C17.1 16 18 15.1 18 14V2C18 0.9 17.1 0 16 0ZM8 7H6.5V6.5H4.5V9.5H6.5V9H8V10C8 10.55 7.55 11 7 11H4C3.45 11 3 10.55 3 10V6C3 5.45 3.45 5 4 5H7C7.55 5 8 5.45 8 6V7ZM15 7H13.5V6.5H11.5V9.5H13.5V9H15V10C15 10.55 14.55 11 14 11H11C10.45 11 10 10.55 10 10V6C10 5.45 10.45 5 11 5H14C14.55 5 15 5.45 15 6V7Z" fill="white"/>\n </symbol>\n </defs>\n</svg>',t='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M11.99 5V1L6.98999 6L11.99 11V7C15.3 7 17.99 9.69 17.99 13C17.99 16.31 15.3 19 11.99 19C8.67999 19 5.98999 16.31 5.98999 13H3.98999C3.98999 17.42 7.56999 21 11.99 21C16.41 21 19.99 17.42 19.99 13C19.99 8.58 16.41 5 11.99 5Z" fill="white"/>\n<path d="M10.89 16H10.04V12.74L9.03003 13.05V12.36L10.8 11.73H10.89V16Z" fill="white"/>\n<path d="M15.17 14.24C15.17 14.56 15.14 14.84 15.07 15.06C15 15.28 14.9 15.48 14.78 15.63C14.66 15.78 14.5 15.89 14.33 15.96C14.16 16.03 13.96 16.06 13.74 16.06C13.52 16.06 13.33 16.03 13.15 15.96C12.97 15.89 12.82 15.78 12.69 15.63C12.56 15.48 12.46 15.29 12.39 15.06C12.32 14.83 12.28 14.56 12.28 14.24V13.5C12.28 13.18 12.31 12.9 12.38 12.68C12.45 12.46 12.55 12.26 12.67 12.11C12.79 11.96 12.95 11.85 13.12 11.78C13.29 11.71 13.49 11.68 13.71 11.68C13.93 11.68 14.12 11.71 14.3 11.78C14.48 11.85 14.63 11.96 14.76 12.11C14.89 12.26 14.99 12.45 15.06 12.68C15.13 12.91 15.17 13.18 15.17 13.5V14.24ZM14.32 13.38C14.32 13.19 14.31 13.03 14.28 12.9C14.25 12.77 14.21 12.67 14.16 12.59C14.11 12.51 14.05 12.45 13.97 12.42C13.89 12.39 13.81 12.37 13.72 12.37C13.63 12.37 13.54 12.39 13.47 12.42C13.4 12.45 13.33 12.51 13.28 12.59C13.23 12.67 13.19 12.77 13.16 12.9C13.13 13.03 13.12 13.19 13.12 13.38V14.35C13.12 14.54 13.13 14.7 13.16 14.83C13.19 14.96 13.23 15.07 13.28 15.15C13.33 15.23 13.39 15.29 13.47 15.32C13.55 15.35 13.63 15.37 13.72 15.37C13.81 15.37 13.9 15.35 13.97 15.32C14.04 15.29 14.11 15.23 14.16 15.15C14.21 15.07 14.25 14.96 14.27 14.83C14.29 14.7 14.31 14.54 14.31 14.35V13.38H14.32Z" fill="white"/>\n</svg>';exports.initialiseSkin=function(u,a){e.getPlayer(u).addClass("skin_cn_news"),function(l,i){var n,t,u,a,s=e.getPlayer(l);if(!s)return;if(s.el().insertBefore(e.parseSvgString(o),null!==(n=s.el().firstChild)&&void 0!==n?n:null),null===(t=s.controlBar)||void 0===t||t.removeChild("VolumePanel"),null===(u=s.controlBar)||void 0===u||u.addChild("VolumePanel",{inline:!0},1),!(null!==(a=s.controlBar)&&void 0!==a&&a.getChild("PictureInPictureToggle"))){var v,c,d=null===(v=s.controlBar)||void 0===v?void 0:v.getChild("FullscreenToggle"),C=d?s.controlBar.children().indexOf(d):void 0;null===(c=s.controlBar)||void 0===c||c.addChild("PictureInPictureToggle",{},C)}(function(l){var i,n,r,o=(null==l||null===(i=l.controlBar)||void 0===i||null===(n=i.getChild("PlayToggle"))||void 0===n||null===(r=n.el())||void 0===r?void 0:r.firstChild)||null;if(!o)return;var t=e.injectSVG(o,l.paused()?"#vjs-icon-play":"#vjs-icon-pause");l.on("play",function(){return t.setAttributeNS(null,"href","#vjs-icon-pause")}),l.on("pause",function(){return t.setAttributeNS(null,"href","#vjs-icon-play")})})(s),function(l){var i,n,r=(null==l||null===(i=l.controlBar)||void 0===i||null===(n=i.getChild("VolumePanel"))||void 0===n?void 0:n.el())||null,o=null==r?void 0:r.querySelector(".vjs-mute-control .vjs-icon-placeholder");if(!o)return;var t=e.injectSVG(o,l.muted()?"#vjs-icon-mute":"#vjs-icon-volume");l.on("volumechange",function(){var e=l.muted()||0===l.volume();t.setAttributeNS(null,"href",e?"#vjs-icon-mute":"#vjs-icon-volume")})}(s),function(l){var i,n,r,o=(null==l||null===(i=l.controlBar)||void 0===i||null===(n=i.getChild("PictureInPictureToggle"))||void 0===n||null===(r=n.el())||void 0===r?void 0:r.querySelector(".vjs-icon-placeholder"))||null;if(!o)return;e.injectSVG(o,"#vjs-icon-pip")}(s),function(l){var i,n,r=(null==l||null===(i=l.controlBar)||void 0===i||null===(n=i.getChild("SubsCapsButton"))||void 0===n?void 0:n.el())||null,o=null==r?void 0:r.querySelector(".vjs-icon-placeholder");if(!o)return;e.injectSVG(o,"#vjs-icon-captions");var t=function(){for(var e=l.textTracks(),i=!1,n=0;n<e.length;n++){var o=e[n];if(("captions"===o.kind||"subtitles"===o.kind)&&"showing"===o.mode){i=!0;break}}r.classList.toggle("vjs-cc-on",i)};t(),l.textTracks().on("change",t)}(s),function(l){var i,n,r,o=(null==l||null===(i=l.controlBar)||void 0===i||null===(n=i.getChild("FullscreenToggle"))||void 0===n||null===(r=n.el())||void 0===r?void 0:r.firstChild)||null;if(!o)return;var t=e.injectSVG(o,"#vjs-icon-fullscreen");l.on("fullscreenchange",function(){null==t||t.setAttributeNS(null,"href",l.isFullscreen()?"#vjs-icon-fullscreen-back":"#vjs-icon-fullscreen")})}(s),function(e,l){var i,n=null==e||null===(i=e.controlBar)||void 0===i?void 0:i.getChild("SeekToLive");if(n){var o,t,u=n.el().querySelector(".vjs-seek-to-live-text"),a=r.getLocalisation("liveText")||"LIVE",s=r.getLocalisation("goLiveText")||"GO LIVE",v=function(){var l,i;u&&(u.textContent=null!==(l=e.liveTracker)&&void 0!==l&&null!==(i=l.atLiveEdge)&&void 0!==i&&i.call(l)?a:s)};v(),e.on("timeupdate",v),null===(o=e.liveTracker)||void 0===o||null===(t=o.on)||void 0===t||t.call(o,"liveedgechange",v),n.on("click",function(){if(e.paused())try{e.play()}catch(e){}})}if(null!=l&&l.liveVideo&&null!=l&&l.liveui&&e.liveTracker){var c=function(){return function(e){var l,i,n,r,o=null==e||null===(l=e.controlBar)||void 0===l||null===(i=l.remainingTimeDisplay)||void 0===i?void 0:i.el();if(!o)return;var t=o.querySelector(".vjs-remaining-time-display");null!==(n=e.liveTracker)&&void 0!==n&&null!==(r=n.atLiveEdge)&&void 0!==r&&r.call(n)?o.style.display="none":(o.style.display="flex",t&&(t.innerText=(u=function(e){var l=e.seekable();return l&&l.length>0?Math.max(0,l.end(0)-e.currentTime()):0}(e),a=Math.floor(u/3600),s=Math.floor(u%3600/60),v=Math.floor(u%60),c=function(e){return String(e).padStart(2,"0")},0===a?"".concat(c(s),":").concat(c(v)):"".concat(c(a),":").concat(c(s),":").concat(c(v)))));var u,a,s,v,c}(e)};e.liveTracker.on("liveedgechange",c),e.on("timeupdate",c)}}(s,i)}(u,a),function(r,o){var u,a,s,v,c,d,C=(null==o?void 0:o.liveVideo)||!1,h=(null==o||null===(u=o.res)||void 0===u?void 0:u.contentType)||"video",p=(null==o||null===(a=o.res)||void 0===a||null===(s=a[h])||void 0===s||null===(v=s.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,f=C&&p?"livedvr":"vod";(null!=o&&o.liveui||p)&&n.addRewindButton(r,"CN_NEWS",t);var g=i.playerConfigManager.getConfig();if(null!=g&&null!==(c=g.chaptersConfig)&&void 0!==c&&c.enable||null!=g&&null!==(d=g.chapters)&&void 0!==d&&d.length){var m;!function(l,i){var n,r=null===(n=e.getPlayer(l))||void 0===n?void 0:n.el();if(!r||!i)return;var o=function(e,l){null!=l&&""!==l&&r.style.setProperty(e,l)};o("--vl-chapter-color",i.markerColor),o("--vl-chapter-active",i.markerActiveColor),o("--vl-chapter-hover",i.markerHoverColor),o("--vl-chapter-size",null!=i.markerSize?"".concat(i.markerSize,"px"):null),o("--vl-chapter-opacity",null!=i.markerOpacity?String(i.markerOpacity):null),o("--vl-chapter-tooltip",i.tooltipColor)}(r,null==g||null===(m=g.chaptersConfig)||void 0===m?void 0:m.style),l.initChapters(r,{chapters:(null==g?void 0:g.chapters)||[],timeMode:f,res:null==o?void 0:o.res,chaptersConfig:(null==g?void 0:g.chaptersConfig)||{}})}}(u,a)};
|
|
1
|
+
"use strict";var e=require("./skin-c6084619.js"),l=require("./index-229dec72.js"),i=require("./generic-9fa3c0bb.js"),n=require("./features-fbfbfeaa.js"),r=require("./localisation-56e0a999.js");require("@babel/runtime/helpers/toConsumableArray"),require("video.js"),require("video.js/dist/video-js.min.css"),require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/get"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("./util-0574b423.js"),require("@babel/runtime/helpers/typeof"),require("./captions-676468fe.js"),require("./renditions-508e7f85.js"),require("./resolution-e6b8a4eb.js"),require("@babel/runtime/helpers/assertThisInitialized"),require("./browser-77c57718.js"),require("@viewlift/comscore/index.js"),require("@babel/runtime/helpers/slicedToArray"),require("@viewlift/sse"),require("axios"),require("md5"),require("js-cookie");var o='<svg xmlns="http://www.w3.org/2000/svg" style="display:none">\n <defs>\n <symbol id="vjs-icon-pause" viewBox="0 0 17 16">\n <path d="M6.00138 15.4894C6.02138 15.7494 5.82138 15.9694 5.56138 15.9894C5.54138 15.9894 5.52138 15.9894 5.50138 15.9894H2.50138C2.24138 16.0094 2.02138 15.8094 2.00138 15.5494C2.00138 15.5294 2.00138 15.5094 2.00138 15.4894V0.499411C1.98138 0.239411 2.18138 0.0194107 2.44138 -0.000589337C2.46138 -0.000589337 2.48138 -0.000589337 2.50138 -0.000589337H5.50138C5.76138 -0.0205893 5.98138 0.179411 6.00138 0.439411C6.00138 0.459411 6.00138 0.479411 6.00138 0.499411V15.4894ZM14.0014 0.509411C14.0214 0.249411 13.8214 0.0294105 13.5614 0.00941051C13.5414 0.00941051 13.5214 0.00941051 13.5014 0.00941051H10.5014C10.2414 -0.0105895 10.0214 0.189411 10.0014 0.449411C10.0014 0.469411 10.0014 0.489411 10.0014 0.509411V15.4994C9.98138 15.7594 10.1814 15.9794 10.4414 15.9994C10.4614 15.9994 10.4814 15.9994 10.5014 15.9994H13.5014C13.7614 16.0194 13.9814 15.8194 14.0014 15.5594C14.0014 15.5394 14.0014 15.5194 14.0014 15.4994V0.509411Z" fill="white"/>\n </symbol>\n <symbol id="vjs-icon-play" viewBox="0 0 17 16">\n <path d="M0.38279 15.9526C0.28279 16.0326 0.142791 16.0126 0.0527906 15.9126C0.0127906 15.8626 -0.00720943 15.8026 0.00279057 15.7326V0.262601C-0.0172094 0.132601 0.0727907 0.0226013 0.192791 0.00260128C0.262791 -0.00739872 0.32279 0.0126014 0.38279 0.0426014L15.8528 7.8126C16.0628 7.9226 16.0628 8.0926 15.8528 8.1926L0.38279 15.9526Z" fill="white"/>\n </symbol>\n <symbol id="vjs-icon-fullscreen" viewBox="0 0 24 24">\n <path d="M7 14H5V19H10V17H7V14ZM5 10H7V7H10V5H5V10ZM17 17H14V19H19V14H17V17ZM14 5V7H17V10H19V5H14Z" fill="white"/>\n </symbol>\n <symbol id="vjs-icon-fullscreen-back" viewBox="0 0 24 24">\n <path d="M10.92 13.49L10.08 18.5C10.04 18.77 9.84001 18.83 9.64001 18.64L8.20001 17.2L5.41001 19.99L3.99001 18.57L6.78001 15.78L5.34001 14.34C5.15001 14.15 5.21001 13.95 5.48001 13.9L10.49 13.06C10.67 13.01 10.85 13.12 10.9 13.3C10.94 13.37 10.94 13.43 10.92 13.49ZM17.21 8.21L20 5.42L18.58 4L15.79 6.79L14.35 5.35C14.16 5.16 13.96 5.22 13.91 5.49L13.07 10.5C13.02 10.68 13.13 10.86 13.31 10.91C13.36 10.93 13.43 10.93 13.48 10.91L18.49 10.07C18.76 10.03 18.82 9.83 18.63 9.63L17.21 8.21Z" fill="#EBEBEB"/>\n </symbol>\n <symbol id="vjs-icon-volume" viewBox="0 0 24 24">\n <path d="M3 9.00047V15.0005H7L12 20.0005V4.00047L7 9.00047H3ZM16.5 12.0005C16.5 10.2305 15.48 8.71047 14 7.97047V16.0205C15.48 15.2905 16.5 13.7705 16.5 12.0005ZM14 3.23047V5.29047C16.89 6.15047 19 8.83047 19 12.0005C19 15.1705 16.89 17.8505 14 18.7105V20.7705C18.01 19.8605 21 16.2805 21 12.0005C21 7.72047 18.01 4.14047 14 3.23047Z" fill="white"/>\n </symbol>\n <symbol id="vjs-icon-mute" viewBox="0 0 24 24">\n <path d="M11.65 4.28V19.72C11.65 20 11.48 20.08 11.27 19.89L5.86 15.09H2.9C2.62 15.09 2.38 14.86 2.38 14.57V9.43C2.38 9.15 2.61 8.91 2.9 8.91H5.86L11.27 4.11C11.48 3.92 11.65 3.99 11.65 4.28Z" fill="#EBEBEB"/>\n <path d="M19.0909 12.5238L21.2626 14.6955L19.8146 16.1436L17.6429 13.9718L15.4711 16.1436L14.0231 14.6955L16.1948 12.5238L14.0231 10.352L15.4711 8.904L17.6429 11.0757L19.8146 8.904L21.2626 10.352L19.0909 12.5238Z" fill="white"/>\n </symbol>\n <symbol id="vjs-icon-pip" viewBox="0 0 24 24">\n <path d="M19 7H11V13H19V7ZM21 3H3C1.9 3 1 3.9 1 5V19C1 20.1 1.9 20.98 3 20.98H21C22.1 20.98 23 20.1 23 19V5C23 3.9 22.1 3 21 3ZM21 19.01H3V4.98H21V19.01Z" fill="white"/>\n </symbol>\n <symbol id="vjs-icon-captions" viewBox="0 0 18 16">\n <path d="M16.5 1.5V14.5H1.5V1.5H16.5ZM16 0H2C0.89 0 0 0.9 0 2V14C0 15.1 0.89 16 2 16H16C17.1 16 18 15.1 18 14V2C18 0.9 17.1 0 16 0ZM8 7H6.5V6.5H4.5V9.5H6.5V9H8V10C8 10.55 7.55 11 7 11H4C3.45 11 3 10.55 3 10V6C3 5.45 3.45 5 4 5H7C7.55 5 8 5.45 8 6V7ZM15 7H13.5V6.5H11.5V9.5H13.5V9H15V10C15 10.55 14.55 11 14 11H11C10.45 11 10 10.55 10 10V6C10 5.45 10.45 5 11 5H14C14.55 5 15 5.45 15 6V7Z" fill="white"/>\n </symbol>\n </defs>\n</svg>',t='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M11.99 5V1L6.98999 6L11.99 11V7C15.3 7 17.99 9.69 17.99 13C17.99 16.31 15.3 19 11.99 19C8.67999 19 5.98999 16.31 5.98999 13H3.98999C3.98999 17.42 7.56999 21 11.99 21C16.41 21 19.99 17.42 19.99 13C19.99 8.58 16.41 5 11.99 5Z" fill="white"/>\n<path d="M10.89 16H10.04V12.74L9.03003 13.05V12.36L10.8 11.73H10.89V16Z" fill="white"/>\n<path d="M15.17 14.24C15.17 14.56 15.14 14.84 15.07 15.06C15 15.28 14.9 15.48 14.78 15.63C14.66 15.78 14.5 15.89 14.33 15.96C14.16 16.03 13.96 16.06 13.74 16.06C13.52 16.06 13.33 16.03 13.15 15.96C12.97 15.89 12.82 15.78 12.69 15.63C12.56 15.48 12.46 15.29 12.39 15.06C12.32 14.83 12.28 14.56 12.28 14.24V13.5C12.28 13.18 12.31 12.9 12.38 12.68C12.45 12.46 12.55 12.26 12.67 12.11C12.79 11.96 12.95 11.85 13.12 11.78C13.29 11.71 13.49 11.68 13.71 11.68C13.93 11.68 14.12 11.71 14.3 11.78C14.48 11.85 14.63 11.96 14.76 12.11C14.89 12.26 14.99 12.45 15.06 12.68C15.13 12.91 15.17 13.18 15.17 13.5V14.24ZM14.32 13.38C14.32 13.19 14.31 13.03 14.28 12.9C14.25 12.77 14.21 12.67 14.16 12.59C14.11 12.51 14.05 12.45 13.97 12.42C13.89 12.39 13.81 12.37 13.72 12.37C13.63 12.37 13.54 12.39 13.47 12.42C13.4 12.45 13.33 12.51 13.28 12.59C13.23 12.67 13.19 12.77 13.16 12.9C13.13 13.03 13.12 13.19 13.12 13.38V14.35C13.12 14.54 13.13 14.7 13.16 14.83C13.19 14.96 13.23 15.07 13.28 15.15C13.33 15.23 13.39 15.29 13.47 15.32C13.55 15.35 13.63 15.37 13.72 15.37C13.81 15.37 13.9 15.35 13.97 15.32C14.04 15.29 14.11 15.23 14.16 15.15C14.21 15.07 14.25 14.96 14.27 14.83C14.29 14.7 14.31 14.54 14.31 14.35V13.38H14.32Z" fill="white"/>\n</svg>';exports.initialiseSkin=function(u,a){e.getPlayer(u).addClass("skin_cn_news"),function(l,i){var n,t,u,a,s=e.getPlayer(l);if(!s)return;if(s.el().insertBefore(e.parseSvgString(o),null!==(n=s.el().firstChild)&&void 0!==n?n:null),null===(t=s.controlBar)||void 0===t||t.removeChild("VolumePanel"),null===(u=s.controlBar)||void 0===u||u.addChild("VolumePanel",{inline:!0},1),!(null!==(a=s.controlBar)&&void 0!==a&&a.getChild("PictureInPictureToggle"))){var v,c,d=null===(v=s.controlBar)||void 0===v?void 0:v.getChild("FullscreenToggle"),C=d?s.controlBar.children().indexOf(d):void 0;null===(c=s.controlBar)||void 0===c||c.addChild("PictureInPictureToggle",{},C)}(function(l){var i,n,r,o=(null==l||null===(i=l.controlBar)||void 0===i||null===(n=i.getChild("PlayToggle"))||void 0===n||null===(r=n.el())||void 0===r?void 0:r.firstChild)||null;if(!o)return;var t=e.injectSVG(o,l.paused()?"#vjs-icon-play":"#vjs-icon-pause");l.on("play",function(){return t.setAttributeNS(null,"href","#vjs-icon-pause")}),l.on("pause",function(){return t.setAttributeNS(null,"href","#vjs-icon-play")})})(s),function(l){var i,n,r=(null==l||null===(i=l.controlBar)||void 0===i||null===(n=i.getChild("VolumePanel"))||void 0===n?void 0:n.el())||null,o=null==r?void 0:r.querySelector(".vjs-mute-control .vjs-icon-placeholder");if(!o)return;var t=e.injectSVG(o,l.muted()?"#vjs-icon-mute":"#vjs-icon-volume");l.on("volumechange",function(){var e=l.muted()||0===l.volume();t.setAttributeNS(null,"href",e?"#vjs-icon-mute":"#vjs-icon-volume")})}(s),function(l){var i,n,r,o=(null==l||null===(i=l.controlBar)||void 0===i||null===(n=i.getChild("PictureInPictureToggle"))||void 0===n||null===(r=n.el())||void 0===r?void 0:r.querySelector(".vjs-icon-placeholder"))||null;if(!o)return;e.injectSVG(o,"#vjs-icon-pip")}(s),function(l){var i,n,r=(null==l||null===(i=l.controlBar)||void 0===i||null===(n=i.getChild("SubsCapsButton"))||void 0===n?void 0:n.el())||null,o=null==r?void 0:r.querySelector(".vjs-icon-placeholder");if(!o)return;e.injectSVG(o,"#vjs-icon-captions");var t=function(){for(var e=l.textTracks(),i=!1,n=0;n<e.length;n++){var o=e[n];if(("captions"===o.kind||"subtitles"===o.kind)&&"showing"===o.mode){i=!0;break}}r.classList.toggle("vjs-cc-on",i)};t(),l.textTracks().on("change",t)}(s),function(l){var i,n,r,o=(null==l||null===(i=l.controlBar)||void 0===i||null===(n=i.getChild("FullscreenToggle"))||void 0===n||null===(r=n.el())||void 0===r?void 0:r.firstChild)||null;if(!o)return;var t=e.injectSVG(o,"#vjs-icon-fullscreen");l.on("fullscreenchange",function(){null==t||t.setAttributeNS(null,"href",l.isFullscreen()?"#vjs-icon-fullscreen-back":"#vjs-icon-fullscreen")})}(s),function(e,l){var i,n=null==e||null===(i=e.controlBar)||void 0===i?void 0:i.getChild("SeekToLive");if(n){var o,t,u=n.el().querySelector(".vjs-seek-to-live-text"),a=r.getLocalisation("liveText")||"LIVE",s=r.getLocalisation("goLiveText")||"GO LIVE",v=function(){var l,i;u&&(u.textContent=null!==(l=e.liveTracker)&&void 0!==l&&null!==(i=l.atLiveEdge)&&void 0!==i&&i.call(l)?a:s)};v(),e.on("timeupdate",v),null===(o=e.liveTracker)||void 0===o||null===(t=o.on)||void 0===t||t.call(o,"liveedgechange",v),n.on("click",function(){if(e.paused())try{e.play()}catch(e){}})}if(null!=l&&l.liveVideo&&null!=l&&l.liveui&&e.liveTracker){var c=function(){return function(e){var l,i,n,r,o=null==e||null===(l=e.controlBar)||void 0===l||null===(i=l.remainingTimeDisplay)||void 0===i?void 0:i.el();if(!o)return;var t=o.querySelector(".vjs-remaining-time-display");null!==(n=e.liveTracker)&&void 0!==n&&null!==(r=n.atLiveEdge)&&void 0!==r&&r.call(n)?o.style.display="none":(o.style.display="flex",t&&(t.innerText=(u=function(e){var l=e.seekable();return l&&l.length>0?Math.max(0,l.end(0)-e.currentTime()):0}(e),a=Math.floor(u/3600),s=Math.floor(u%3600/60),v=Math.floor(u%60),c=function(e){return String(e).padStart(2,"0")},0===a?"".concat(c(s),":").concat(c(v)):"".concat(c(a),":").concat(c(s),":").concat(c(v)))));var u,a,s,v,c}(e)};e.liveTracker.on("liveedgechange",c),e.on("timeupdate",c)}}(s,i)}(u,a),function(r,o){var u,a,s,v,c,d,C=(null==o?void 0:o.liveVideo)||!1,h=(null==o||null===(u=o.res)||void 0===u?void 0:u.contentType)||"video",p=(null==o||null===(a=o.res)||void 0===a||null===(s=a[h])||void 0===s||null===(v=s.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,f=C&&p?"livedvr":"vod";(null!=o&&o.liveui||p)&&n.addRewindButton(r,"CN_NEWS",t);var g=i.playerConfigManager.getConfig();if(null!=g&&null!==(c=g.chaptersConfig)&&void 0!==c&&c.enable||null!=g&&null!==(d=g.chapters)&&void 0!==d&&d.length){var m;!function(l,i){var n,r=null===(n=e.getPlayer(l))||void 0===n?void 0:n.el();if(!r||!i)return;var o=function(e,l){null!=l&&""!==l&&r.style.setProperty(e,l)};o("--vl-chapter-color",i.markerColor),o("--vl-chapter-active",i.markerActiveColor),o("--vl-chapter-hover",i.markerHoverColor),o("--vl-chapter-size",null!=i.markerSize?"".concat(i.markerSize,"px"):null),o("--vl-chapter-opacity",null!=i.markerOpacity?String(i.markerOpacity):null),o("--vl-chapter-tooltip",i.tooltipColor)}(r,null==g||null===(m=g.chaptersConfig)||void 0===m?void 0:m.style),l.initChapters(r,{chapters:(null==g?void 0:g.chapters)||[],timeMode:f,res:null==o?void 0:o.res,chaptersConfig:(null==g?void 0:g.chaptersConfig)||{}})}}(u,a)};
|