@viewlift/player-backup 1.0.167-backup → 1.0.168-backup

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/cjs/bundle.css +4 -4
  2. package/cjs/index.js +1 -1
  3. package/esm/{autoNextVideo-d84f6aba.js → autoNextVideo-12394cdf.js} +1 -1
  4. package/esm/bundle.css +4 -4
  5. package/esm/{features-d9401691.js → features-dc22eda2.js} +1 -1
  6. package/esm/{generic-4c43a94b.js → generic-d124edfc.js} +1 -1
  7. package/esm/{index-07ef3817.js → index-08ddf166.js} +1 -1
  8. package/esm/index.js +1 -1
  9. package/esm/{keyboardShortcuts-cfdbf3b9.js → keyboardShortcuts-8bb85a01.js} +1 -1
  10. package/esm/{multicamv2-18bf6f1a.js → multicamv2-08d4acf9.js} +1 -1
  11. package/esm/{multicamv2-d5fc76da.js → multicamv2-e6a0e531.js} +1 -1
  12. package/esm/{nextEpisodeButton-f84ca95e.js → nextEpisodeButton-cbea8588.js} +1 -1
  13. package/esm/{playlist-ac64e4e7.js → playlist-12093fe6.js} +1 -1
  14. package/esm/{series-68d00891.js → series-de2bcf34.js} +1 -1
  15. package/esm/{series-v2-a0799a86.js → series-v2-83709ee8.js} +1 -1
  16. package/esm/{series-v2-97947ec9.js → series-v2-b20f5533.js} +1 -1
  17. package/esm/{skin-6b668dbc.js → skin-0795ef1f.js} +1 -1
  18. package/esm/{skin-f7160fdb.js → skin-82f7aedc.js} +1 -1
  19. package/esm/{skin-d3aae505.js → skin-902b958f.js} +1 -1
  20. package/esm/{skin-842d8d4f.js → skin-c365cec9.js} +1 -1
  21. package/esm/{skin-96fd066b.js → skin-cfc53537.js} +1 -1
  22. package/esm/{skin-b1a6b7e1.js → skin-de1d8699.js} +1 -1
  23. package/esm/{videoSelector-bdd9c4e6.js → videoSelector-9eab2fd1.js} +1 -1
  24. package/esm/{videoSelector-ea2ddd7f.js → videoSelector-be51e523.js} +1 -1
  25. package/package.json +1 -1
package/cjs/bundle.css CHANGED
@@ -1,8 +1,6 @@
1
1
 
2
2
 
3
3
 
4
-
5
-
6
4
  .video-js.skin_vlone .vjs-control-bar .vjs-progress-control.vjs-control {
7
5
  height: 0.7em;
8
6
  position: absolute;
@@ -143,6 +141,8 @@
143
141
  }
144
142
 
145
143
 
144
+
145
+
146
146
  /* CSS for videojs-dvr-seekbar */
147
147
 
148
148
  .video-js.vjs-dvr-seekbar {
@@ -315,6 +315,8 @@
315
315
 
316
316
 
317
317
 
318
+
319
+
318
320
  .video-js .multicamera-parent.default{
319
321
  height: 345px;
320
322
  position: absolute;
@@ -397,8 +399,6 @@
397
399
 
398
400
 
399
401
 
400
-
401
-
402
402
  /* nextep */
403
403
  .next-ep-preview{
404
404
  position: absolute;
package/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-61978e4d.js"),n=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/regenerator"),o=require("video.js"),i=require("./util-197a4f7c.js"),l=require("./captions-37b81672.js"),a=require("./renditions-fd408798.js"),s=require("./resolution-c59e995e.js"),u=require("./skin-aef573bd.js"),c=require("./browser-77c57718.js"),d=require("./localisation-56e0a999.js"),v=require("@babel/runtime/helpers/typeof");require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf");var p,f=function(e){return new Promise((function(n,t){if(m(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)}}))},m=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},y=function(e,n,t){var r=u.getPlayer(e);if(r)if(n>=0&&n<=100){r.muted()&&r.muted(!1);var o=parseFloat(n)/100;r.volume(o),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,"'")})},g=function(e){var n=u.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function h(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 w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var b=[],k=0,O=null;function P(t,r,o){var i,l,a,s,u,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==r||null===(i=r.watchHistory)||void 0===i||i.apiVersion;var d=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 m=(null==r||null===(s=r.video)||void 0===s?void 0:s.originalObjectId)||null,y=(null==r||null===(u=r.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,g=Math.floor(t.currentTime()),h=c?100:Math.floor(v/f*100),b={};y?function(t,r,o){var i=r?"watchhistory-data-".concat(r):"watchhistory-data-guest-".concat(o),l=S(i),a=(new Date).getTime(),s=e.getCurrentVideo(),u=(null==s?void 0:s.video)||{},c=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,t){return w(w({},e),{},n({},t,u[t]))}),{}),d=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===p}));d<0?l.push(w(w({content:c},t),{},{addedDate:a,updateDate:a})):l[d]=w(w(w({},l[d]),t),{},{updateDate:a});localStorage.setItem("".concat(i),JSON.stringify(l))}(b={completed:c,watchedTime:g,watchedPercentage:h},d,r.siteOwner):(b=w(w({videoId:p,watchedTime:g,watchedPercentage:h,doneWatching:c,profileId:d},O&&{seriesId:O}),m&&{originalObjectId:m}),e.saveWatchHistory(b).then((function(e){})).catch((function(e){}))),k=v+o}function S(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function j(e,n,t){var r=S(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),o=[];return r&&Array.isArray(r)&&(o=r.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),o}var T=function(){var e=t(r.mark((function e(n){var t,i,l,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=u.getPlayer(null==n?void 0:n.playerId),console.log(n),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=21;break}return e.next=5,import("@silvermine/videojs-chromecast");case 5:return a=e.sent,e.prev=6,e.next=9,f("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),console.log("Error",e.t0);case 14:return e.prev=14,a.default(o),e.finish(14);case 17:null!==(l=window)&&void 0!==l&&l.cast?null==i||i.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==i||i.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=n&&n.airplay&&"Safari"==c.detectBrowser()?null==i||i.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return e.stop()}}),e,null,[[6,11,14,17]])})));return function(n){return e.apply(this,arguments)}}(),I=function(e,n){var t=u.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,r,i,l,a,s=this.el(),u=o.dom.getPointerPosition(s,n).x;o.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var c=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(i=r.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(c),c&&"CONNECTED"===d){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),p=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=p*u,v.seek()}}))};var E=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"),f("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)}}(),x=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,import("videojs-contrib-eme").then((function(e){o.getPlugin("eme")||o.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),C=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(o),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)}}(),D=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-54c6c570.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)}}(),R=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){f("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(o)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(o)}))},loadAdsLibrary:E,loadEMELibrary:x,loadMuxPlugin:C,loadDvrSeekbar:D});function V(e){return N.apply(this,arguments)}function N(){return(N=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,E();case 3:t&&"Safari"==c.detectBrowser()&&Promise.resolve().then((function(){return R})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function A(e,n){return L.apply(this,arguments)}function L(){return L=t(r.mark((function e(n,t){var o,i,l,a,s,u,c;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(null==t?void 0:t.contentType)||"video",s=null==t||null===(o=t[a])||void 0===o?void 0:o.drmEnabled,u=(null==t||null===(i=t[a])||void 0===i||null===(l=i.liveDetails)||void 0===l?void 0:l.isDvrEnabled)||!1,e.prev=3,e.next=6,Promise.allSettled([s?x():null,T(n),null!=n&&null!==(c=n.analytics)&&void 0!==c&&c.muxKey?C():null,u&&showPositiveSeekbar?D():null]);case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(3),console.log("Error",e.t0);case 11:case"end":return e.stop()}}),e,null,[[3,8]])}))),L.apply(this,arguments)}function _(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 q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var H=new Set,M=null,U=function(n,t,r){var o,i,l,a,s,u,c,d,v,p={},f=(null==n?void 0:n.contentType)||"video";p[null==r||null===(o=r.Constants)||void 0===o?void 0:o.ASSET_NAME]=K(n),p["c3.cm.id"]=(null===(i=n[f])||void 0===i?void 0:i.id)||"Null",p["c3.cm.contentType"]=J(n),p[null==r||null===(l=r.Constants)||void 0===l?void 0:l.IS_LIVE]=!(null==n||!n.linearchannel),p[null==r||null===(a=r.Constants)||void 0===a?void 0:a.STREAM_URL]=t.currentSrc(),p[null==r||null===(s=r.Constants)||void 0===s?void 0:s.VIEWER_ID]="undefined"===e.getUserId()?"NULL":e.getUserId(),p["c3.cm.categoryType"]=z(n),p[null==r||null===(u=r.Constants)||void 0===u?void 0:u.PLAYER_NAME]="VL_WEB_PLAYER",p["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"}}(),p.DRMEnabled=(null===(c=n[f])||void 0===c?void 0:c.drmEnabled)||"None",p.DAIStream=null!==(d=n[f])&&void 0!==d&&null!==(v=d.gist)&&void 0!==v&&v.isSSAIEnabled?"YES":"NO",p[r.Constants.DEFAULT_RESOURCE]="AKAMAI",p["c3.cm.brand"]="NULL",p.CDVREnabled=G(n),p["c3.cm.genreList"]=F(n),p["c3.cm.genre"]=B(n),p["c3.cm.channel"]=W(n);var m=X(e.getCurrentSeries(),n);return p=q(q({},p),m)},B=function(e){var n,t,r,o=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[o])||void 0===n||null===(t=n.gist)||void 0===t||null===(r=t.primaryCategory)||void 0===r?void 0:r.title)||"Null"},F=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"},W=function(e){var n,t,r=(null==e?void 0:e.contentType)||"video";return"video"===r?"NULL":(null==e||null===(n=e[r])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"Null"},z=function(e){return null!=e&&e.linearchannel?"Linear":null!=e&&e.video&&(null==e||null===(n=e.video)||void 0===n||null===(t=n.categories)||void 0===t||null===(r=t[0])||void 0===r?void 0:r.title)||"Null";var n,t,r},G=function(e){var n,t,r=(null==e?void 0:e.contentType)||"video",o=(null==e||null===(n=e[r])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return o?"YES":"NO"},K=function(e){var n,t,r,o,i=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t?void 0:t.title)||"Null",a=(null==e||null===(r=e[i])||void 0===r||null===(o=r.gist)||void 0===o?void 0:o.id)||"Null";return"[".concat(a,"] ").concat(l)},J=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var X=function(n,t){var r,o,i,l,a,s={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!n||!t||null!=t&&t.linearchannel)return s;var u=e.getSeasonNumber(),c=e.getEpisodeNumber();return s["c3.cm.seriesName"]=(null==t||null===(r=t.video)||void 0===r||null===(o=r.series)||void 0===o?void 0:o.title)||"Null",s["c3.cm.seasonNumber"]=(null==u?void 0:u.toString())||"Null",s["c3.cm.showTitle"]=(null==n||null===(i=n[u-1])||void 0===i||null===(l=i.episodes)||void 0===l||null===(a=l[c-1])||void 0===a?void 0:a.title)||"Null",s["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",s},Y=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"}},Q=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Z=function(){var n=t(r.mark((function n(t,o){var i,l,a,s,c,d,v,p,f;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i=(null==o?void 0:o.convivaConfig)||{},l=i.trackConvivaPlayerEvent,a=i.paymentHandler,s=i.tveProvider,c=i.enable,d=(o||{}).token,c){n.next=4;break}return n.abrupt("return");case 4:if(v=u.getPlayer(t),"function"==typeof(p=l)){n.next=8;break}return n.abrupt("return");case 8:return n.next=10,p("getConvivaObject");case 10:if(f=n.sent){n.next=13;break}return n.abrupt("return");case 13:v.ready((function(){var e=v.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var r=Y(t.keySystem);p("contentInfo",{DRMEnabled:r})}else p("contentInfo",{DRMEnabled:"None"})})),n||p("contentInfo",{DRMEnabled:"None"})})),v.on("loadstart",(function(){M&&M!==v.currentSrc()&&p("playbackEnded"),p("setPlayer",v),H.clear(),M=v.currentSrc();var n=Q(v.currentType()),t=e.getCurrentVideo(),r=U(t,v,f);r.authToken=d||"NULL",r.streamType=n,r.D2CType=a||"NONE",r.subscriberType=s||(a?"D2C":"FREE"),r["c3.cm.affiliate"]=s||"NULL",p("contentInfo",r)})),v.on("loadedmetadata",(function(){var e,n=v.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),p("contentInfo",{screenResolution:e})})),v.on("play",(function(){H.has(v.currentSrc())||(H.add(v.currentSrc()),p("playbackStarted",null))})),v.on("ended",(function(){H.has(v.currentSrc())&&H.delete(v.currentSrc()),p("playbackEnded")})),v.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&p("initAdSensor",{player:v,adsLoader:null==e?void 0:e.adsLoader})})),v.on("dispose",(function(){null==H||H.clear(),p("playbackEnded")}));case 20:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}(),$=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-99078201.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-cd9dc93e.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-337e2fe5.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-bce101a3.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-7e7c4ce1.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&Promise.resolve().then((function(){return require("./skin-8eb170ef.js")})).then((function(t){t.initialiseSkin(e,n)}))},ee=!1,ne=function(n,t){var r,o,i=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(r=n[i])||void 0===r||null===(o=r.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!ee){var l=te(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),ee=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function te(e,n,t){if(Array.isArray(e))return e.map((function(e){return te(e,n,t)}));if(null!==e&&"object"===v(e)){var r={};return Object.keys(e).forEach((function(o){o===n&&void 0!==e[t]?r[o]=e[t]:o===t&&void 0!==e[n]?r[o]=e[n]:r[o]=te(e[o],n,t)})),r}return e}function re(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 oe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?re(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):re(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var ie=function(n,t,r,o){var i,l,a=o.res,s=o.sres,c=u.getPlayer(n),d=(null==a?void 0:a.contentType)||"video",v=(null==a||null===(i=a[d])||void 0===i||null===(l=i.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;e.setCurrentVideo(a),c&&(c.on("loadstart",(function(){v?r.resolve({status:!0,msg:"Video Loaded",response:a}):r.resolve(oe({status:!0,msg:"Player Initialised"},s?{seriesResponse:s,response:a}:{response:a}))})),c.on("loadeddata",(function(){var r,o,i;(null==c||!c.muted())&&y(n,sessionStorage.getItem("volume")||"100");var l=e.getCurrentVideo();if(e.clearError(),null!=t&&t.watchHistory&&null!=t&&null!==(r=t.watchHistory)&&void 0!==r&&r.enable&&(!t.isAnonymousUser||null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.saveOffline)){var s,d,v=oe(oe({},t),a);!function(e,n,t){var r,o,i;null!=n&&n.series&&null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable&&(O=null==n||null===(o=n.series)||void 0===o?void 0:o.id),b=[],k=0,p=t;var l=(null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.interval)||30,a=u.getPlayer(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());b.includes(k)||(e==k?(b.push(e),P(a,n,l)):e>k&&(k=e+l))})),a.one("ended",(function(){P(a,n,l,!0)})))}(n,v,null==l||null===(s=l.video)||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.id)}if(null!=t&&null!==(i=t.analytics)&&void 0!==i&&i.muxKey&&null!=c&&c.mux){var f,m,g,h,w,S,j=(null===(f=e.getCurrentVideo())||void 0===f?void 0:f.video)||(null==a?void 0:a.video),T=null==j?void 0:j.gist,I={env_key:null==t||null===(m=t.analytics)||void 0===m?void 0:m.muxKey,player_name:"vl-web-player",player_version:null===(g=window)||void 0===g?void 0:g.vl_player_version,video_id:null==T?void 0:T.id,video_title:null==T?void 0:T.title,video_series:null==j||null===(h=j.series)||void 0===h?void 0:h.title,video_stream_type:null!=j&&null!==(w=j.streamingInfo)&&void 0!==w&&w.isLiveStream?"live":"video",viewer_user_id:null==t||null===(S=t.analytics)||void 0===S?void 0:S.userId};c.mux({debug:!1,data:I})}})),c.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];c.trigger("subtitlechanged",n)})),c.on("subtitlechanged",(function(e,n){var t,r,o,i,l,a,s,u,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(o=r.framework)||void 0===o||null===(i=o.CastContext)||void 0===i||null===(l=i.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(c=u.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===p){var m,y=f.getMediaSession(),g=y.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([g[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),y.editTracksInfo(m)}})),c.tech_.on("retryplaylist",(function(){v&&ne(a,n)})),c.on("error",(function(){var t,o;(console.log("ERROR",c.error(),c.error().code),4===c.error().code&&v)?ne(a,n):(e.handleError(n,(null==c||null===(t=c.error())||void 0===t?void 0:t.message)||"Some error occured"),r.reject({status:!1,msg:(null==c||null===(o=c.error())||void 0===o?void 0:o.message)||"Some error occured",response:a}))})),c.one("play",(function(){var n;if(null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable){var r,o,i,l=null===(r=e.getCurrentVideo())||void 0===r||null===(o=r.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.id,a=e.getSeriesWatchMap(),s=(null==a?void 0:a.get(l))||{t:0,p:0},u=s.t,d=s.p;u&&d<95&&setTimeout((function(){c.currentTime(u)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){c.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0);if(null!=c&&c.dvrSeekbar)try{c.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}})),c.on("volumechange",(function(){var e=100*c.volume().toFixed(2);c.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),c.on("chromecastDisconnected",(function(){if(v){c.currentSource();for(var e=c.textTracks(),n=e.length-1;n>=0;n--)c.removeRemoteTextTrack(e[n])}})))};function le(e){return ae.apply(this,arguments)}function ae(){return(ae=t(r.mark((function e(n){var t,o,i,l,a,s,u,c,d,v,p,m;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f("https://cdn.dashjs.org/latest/dash.all.min.js");case 2:i=this.el().querySelector("video")||this.el(),l=window.player=null===(t=window.dashjs)||void 0===t?void 0:t.MediaPlayer().create(),a=(null==n?void 0:n.keySystems)&&(null==n||null===(o=n.keySystems)||void 0===o?void 0:o["com.widevine.alpha"]),l&&i?(l.initialize(i,n.src,!0),a&&(d=null===(s=n.keySystems["com.widevine.alpha"])||void 0===s?void 0:s.url,v=null===(u=n.keySystems["com.microsoft.playready"])||void 0===u?void 0:u.url,p=null===(c=n.keySystems["com.widevine.alpha"])||void 0===c?void 0:c.licenseHeaders["X-AxDRM-Message"],m={"com.widevine.alpha":{serverURL:d,httpRequestHeaders:{"X-AxDRM-Message":p}},"com.microsoft.playready":{serverURL:v,httpRequestHeaders:{"X-AxDRM-Message":p}}},l.setProtectionData(m))):console.error("Cannot initialise dash player");case 6:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function se(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?se(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):se(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var ce,de=function(i,a,s,d){var v,p,f,m,y,g,h,w,b,k,O,P,S,j,T,E,x,C,D,R,V,N,L,_,q,H,M,U,B=a.res,F=void 0===B?null:B,W=a.sres,z=void 0===W?null:W,G=null!=s&&s.chromecastReceiverId?["chromecast","html5"]:["html5"],K=(null===(v=F)||void 0===v?void 0:v.contentType)||"video",J=u.impolicy16x9(null===(p=F)||void 0===p||null===(f=p[K])||void 0===f||null===(m=f.gist)||void 0===m?void 0:m.videoImageUrl)||u.impolicy16x9(null===(y=F)||void 0===y||null===(g=y[K])||void 0===g||null===(h=g.gist)||void 0===h||null===(w=h.imageGist)||void 0===w?void 0:w.r16x9),X=(null===(b=F)||void 0===b||null===(k=b[K])||void 0===k||null===(O=k.liveDetails)||void 0===O?void 0:O.isDvrEnabled)||!1,Y=(null===(P=F)||void 0===P||null===(S=P[K])||void 0===S||null===(j=S.streamingInfo)||void 0===j?void 0:j.isLiveStreafm)||!1,Q=(null===(T=F)||void 0===T||null===(E=T.ads)||void 0===E||null===(x=E.preRoll)||void 0===x||null===(C=x.adTags)||void 0===C||null===(D=C.web)||void 0===D?void 0:D.active)&&(null===(R=F)||void 0===R||null===(V=R.ads)||void 0===V||null===(N=V.preRoll)||void 0===N||null===(L=N.adTags)||void 0===L||null===(_=L.web)||void 0===_?void 0:_.url);F=ue(ue({},F),{},{audioAssetSource:null==s?void 0:s.audioAssetSource});var ee=(U={enableSmoothSeeking:!0,controls:0!=(null==s?void 0:s.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==s?void 0:s.muted)||!1,autoplay:(null==s?void 0:s.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!1},muteToggle:"multiplayer"==s.skin,liveui:X},n(U,"autoplay",null==s?void 0:s.autoplay),n(U,"normalizeAutoplay",(null==s?void 0:s.autoplay)&&!Q),n(U,"loop",(null==s?void 0:s.loop)||!1),n(U,"audioPosterMode",null==s?void 0:s.audioPosterMode),n(U,"html5",ue(ue({vhs:ue(ue({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==s?void 0:s.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==s||null===(q=s.customData)||void 0===q?void 0:q.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0}),nativeTextTracks:!0},0==(null==s||null===(H=s.customData)||void 0===H?void 0:H.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==s||null===(M=s.customData)||void 0===M?void 0:M.nativeVideoTracks)&&{nativeVideoTracks:!1})),n(U,"poster",J),n(U,"techOrder",G),n(U,"chromecast",{requestCustomDataFn:function(e){var n=getPlayer(i),t=((null==n?void 0:n.textTracksJson_)||n.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,n,t){var r,o,i,l,a,s,u,c,d,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m;f.isDrmEnabled=!0;var y=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,g=null==y?void 0:y.url;f.licenseUrl=g;var h=null==y?void 0:y.licenseHeaders["X-AxDRM-Message"];f.licenseToken=h}var w=(null==e||null===(r=e[p])||void 0===r||null===(o=r.gist)||void 0===o?void 0:o.contentType)||"VIDEO";f.contentType=w;var b=null==e||null===(i=e[p])||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.runtime;f.duration=b;var k=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=k;var O=null==e||null===(u=e[p])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return f.mediaImage=O,f.subTitles=t,f.DVR=(null==e||null===(d=e[p])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(F,e,t)}}),U);if(!o.getPlayers()[i])var ne=o(i,ee,function(){var n=t(r.mark((function n(){var t,a,u,v,p,f,m,y,g,h,w,b,k,O,P,S,j,T;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(ne),console.log(o.VERSION),console.log(o.getPlugins()),n.next=5,A(s,F);case 5:Y&&d.resolve(ue({status:!0,msg:"Player Initialised"},z?{seriesResponse:z,response:F}:{response:F})),e.inititateBeacon(i,null==s?void 0:s.analyticsCb),Z(i,s),/Android/i.test(navigator.userAgent)&&(o.options.vhs.overrideNative=!0),X&&I(i,startOverTime),!Q||null!=s&&null!==(t=s.customData)&&void 0!==t&&t.disableAds||e.initialiseAdvertisement(i,Q,F),w=e.getSource(F,i),console.log(w),null!=s&&s.nearestClusterUrl&&(w=e.getUpdatedClusterSource(w,s.nearestClusterUrl)),"Chrome"==c.detectBrowser()&&(null===(a=F)||void 0===a||null===(u=a.video)||void 0===u?void 0:u.isSSAIEnabled)?le.call(this,w):w?e.loadVideo(i,w):(d.reject({status:!1,msg:"Incompatible / Missing Source",response:F}),e.handleError(i,"Incompatible / Missing Source")),((null===(v=F)||void 0===v||null===(p=v[K])||void 0===p||null===(f=p.contentDetails)||void 0===f||null===(m=f.closedCaptions)||void 0===m?void 0:m.length)>0||(null===(y=F)||void 0===y||null===(g=y[K])||void 0===g||null===(h=g.closedCaptions)||void 0===h?void 0:h.length)>0)&&(T=(null===(k=F)||void 0===k||null===(O=k[K])||void 0===O||null===(P=O.contentDetails)||void 0===P?void 0:P.closedCaptions)||(null===(S=F)||void 0===S||null===(j=S[K])||void 0===j?void 0:j.closedCaptions),b=T.filter((function(e){return"VTT"===e.format})),l.addCaptions(i,b)),null!=s&&s.disableControls?e.disableControls(i):$(i,ue(ue(ue({},s),ee),{},{liveVideo:Y,isDvrEnabled:X,res:F,sres:z})),ie(i,ue(ue(ue({},s),ee),{},{liveVideo:Y}),d,{res:F,sres:z});case 19:case"end":return n.stop()}}),n,this)})));return function(){return n.apply(this,arguments)}}())};function ve(e,n){return pe.apply(this,arguments)}function pe(){return(pe=t(r.mark((function n(t,o){var i,l,a,s,u,c;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=o.resolve,l=o.reject,a=null==t?void 0:t.videoId,s=null==t?void 0:t.playerId,u=!(null==t||!t.anonymousId),n.next=6,e.getToken();case 6:c=n.sent,e.getVideoDetails(a,c).then((function(n){var r,o,d,v;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(o=r.video)||void 0===o||null===(d=o.gist)||void 0===d?void 0:d.contentType,e.setCurrentVideo(null==n?void 0:n.data);var p,f=null==n?void 0:n.data;if(null!=t&&t.watchHistory&&null!=t&&null!==(v=t.watchHistory)&&void 0!==v&&v.enable&&!u)if((null===(p=t.watchHistory)||void 0===p?void 0:p.saveOffline)||!1){var m,y,g,h=j((null===(m=t.watchHistory)||void 0===m?void 0:m.profileId)||"",a,null==t?void 0:t.siteOwner);if(h&&h.length)t.watchHistoryResumeTime=(null===(y=h[0])||void 0===y?void 0:y.watchedTime)||null,t.watchedPercentage=(null===(g=h[0])||void 0===g?void 0:g.watchedPercentage)||null;f.contentType="video",de(s,{res:f},t,{resolve:i,reject:l})}else e.getVideoInfo(a,c).then((function(e){var n,r,o,i,l,a;null!==(n=window)&&void 0!==n&&null!==(r=n.watchHistory)&&void 0!==r&&r.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.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,f.contentType="video"})).catch((function(e){var n,t,r,o;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(r=window)||void 0===r||null===(o=r.watchHistory)||void 0===o||o.cb(e))})).finally((function(){de(s,{res:f},t,{resolve:i,reject:l})}));else de(s,{res:f},t,{resolve:i,reject:l})})).catch((function(n){e.initiateErrorHandling(n,s,l,a)}));case 8:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function fe(e,n){return me.apply(this,arguments)}function me(){return(me=t(r.mark((function n(t,o){var i,l,a,s,u;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=o.resolve,l=o.reject,n.next=3,e.getToken();case 3:a=n.sent,s=null==t?void 0:t.playerId,u=null==t?void 0:t.epg,e.getLinearChannelDetails(u,a).then((function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==u?void 0:u.channelId,de(s,{res:n},t,{resolve:i,reject:l})})).catch((function(n){e.initiateErrorHandling(n,s,l,videoId)}));case 7:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function ye(e,n){return ge.apply(this,arguments)}function ge(){return(ge=t(r.mark((function n(t,o){var i,l,a,s,u,c,d;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return l=o.resolve,a=o.reject,n.next=3,e.getToken();case 3:s=n.sent,u=null==t?void 0:t.playerId,c=sessionStorage.getItem("season-idx")||0,seasonIdxManager.set(parseInt(c)),d=null==t||null===(i=t.series)||void 0===i?void 0:i.id,e.getSeriesDetails(d,s).then((function(n){var r,o,i,c=n.data,v=n.data.seasons;e.setCurrentSeries(v);var p=videoId||(null==v||null===(r=v[0])||void 0===r||null===(o=r.episodes)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.id);e.createSeriesWatchMap(d,s),e.getVideoDetails(p,s).then((function(n){var r,o,i;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(o=r.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,e.setCurrentVideo(n.data),de(u,{res:null==n?void 0:n.data,sres:c},t,{resolve:l,reject:a})})).catch((function(n){e.initiateErrorHandling(n,u,a,videoId)}))})).catch((function(n){e.initiateErrorHandling(n,u,a)}));case 9:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function he(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?he(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):he(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}module.exports=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:i.onTimeUpdate,getVideoDuration:i.getVideoDuration,onVideoEnded:i.onVideoEnded,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),console.log("%c Handlers added ","background: #bdf369; color: #000"),new Promise(function(){var o=t(r.mark((function t(o,i){var l,a,s,c,v,p,m,y,g,h,w,b,k,O,P,S,j,T,I,E,x,C;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.isPlayerInitialised(null==n?void 0:n.playerId)){t.next=2;break}return t.abrupt("return");case 2:if(w=(null==n?void 0:n.videoSourceUrl)||!1,b=null==n?void 0:n.asat,k=(null==n||null===(l=n.epg)||void 0===l?void 0:l.enable)||!1,O=null==n?void 0:n.videoId,P=(null==n||null===(a=n.series)||void 0===a?void 0:a.enable)||!1,window.videoId=O,S=null==n?void 0:n.token,!e.token_authentication_enabled(n)){t.next=16;break}if(sessionStorage.setItem("vlp_token",S),e.refreshTokenManager().set(null==n?void 0:n.refreshToken),S&&!e.isTokenExpired(S)){t.next=15;break}return i({status:!1,msg:"".concat(S?"Token is expired !":"Missing Authorization Token"),response:{token:S}}),t.abrupt("return");case 15:ce=JSON.parse(atob(S.split(".")[1]));case 16:n.isAnonymousUser=!(null===(s=ce)||void 0===s||!s.anonymousId),n.siteOwner=(null===(c=ce)||void 0===c?void 0:c.site)||null,n.userId=(null===(v=ce)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(p=ce)||void 0===p?void 0:p.userId),window.watchHistory=n.watchHistory||null,j=null==n?void 0:n.playerId,n.chromecastReceiverId=null!=n&&null!==(m=n.series)&&void 0!==m&&m.enable?null:null==n?void 0:n.chromecastReceiverId,T=(null==n||null===(y=n.analytics)||void 0===y?void 0:y.gaId)||null,(I=null==n?void 0:n.errors)&&(window.customErrors=I),window.customData=null==n?void 0:n.customData,d.setLocalisation(null==n||null===(g=n.customData)||void 0===g?void 0:g.localisation),e.baseUrlManager.set(n.apiBaseUrl),null!=n&&n.skin&&!u.isNotAValidSkin(n.skin)||(n.skin="VL_ONE"),V(n),T&&f("https://www.googletagmanager.com/gtag/js?id=".concat(T)).then((function(){return e.runGtag(T)})).catch((function(e){})),(E=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(j)))&&E.addEventListener("contextmenu",(function(e){return e.preventDefault()})),w?(C={directPlaybackUrl:w,id:x="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},b?e.getVideoDetails(x,S).then((function(e){de(j,{res:we(we({},e),C)},n,{resolve:o,reject:i})})).catch((function(n){e.initiateErrorHandling(n,j,i,x)})):de(j,{res:C},n,{resolve:o,reject:i})):P?ye(n,{resolve:o,reject:i}):k?fe(n,{resolve:o,reject:i}):ve(n,{resolve:o,reject:i});case 35:case"end":return t.stop()}}),t)})));return function(e,n){return o.apply(this,arguments)}}())},getRenditions:a.getRenditions,skip:e.skip,getPlayer:u.getPlayer,play:e.play,pause:e.pause,detectBrowser:c.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:i.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:l.enableCaptions,disableCaptions:l.disableCaptions,getCaptions:l.getCaptions,playSelectedResolution:s.playSelectedResolution,getSource:e.getSource,setVolume:y,getVolume:g,disableControls:e.disableControls,setPlaybackSpeed:i.setPlaybackSpeed,getEntitlementData:e.getEntitlementData}};
1
+ "use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-61978e4d.js"),n=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/regenerator"),o=require("video.js"),i=require("./util-197a4f7c.js"),l=require("./captions-37b81672.js"),a=require("./renditions-fd408798.js"),s=require("./resolution-c59e995e.js"),u=require("./skin-aef573bd.js"),c=require("./browser-77c57718.js"),d=require("./localisation-56e0a999.js"),v=require("@babel/runtime/helpers/typeof");require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf");var p,f=function(e){return new Promise((function(n,t){if(m(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)}}))},m=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},y=function(e,n,t){var r=u.getPlayer(e);if(r)if(n>=0&&n<=100){r.muted()&&r.muted(!1);var o=parseFloat(n)/100;r.volume(o),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,"'")})},g=function(e){var n=u.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function h(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 w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var b=[],k=0,O=null;function P(t,r,o){var i,l,a,s,u,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==r||null===(i=r.watchHistory)||void 0===i||i.apiVersion;var d=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 m=(null==r||null===(s=r.video)||void 0===s?void 0:s.originalObjectId)||null,y=(null==r||null===(u=r.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,g=Math.floor(t.currentTime()),h=c?100:Math.floor(v/f*100),b={};y?function(t,r,o){var i=r?"watchhistory-data-".concat(r):"watchhistory-data-guest-".concat(o),l=S(i),a=(new Date).getTime(),s=e.getCurrentVideo(),u=(null==s?void 0:s.video)||{},c=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,t){return w(w({},e),{},n({},t,u[t]))}),{}),d=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===p}));d<0?l.push(w(w({content:c},t),{},{addedDate:a,updateDate:a})):l[d]=w(w(w({},l[d]),t),{},{updateDate:a});localStorage.setItem("".concat(i),JSON.stringify(l))}(b={completed:c,watchedTime:g,watchedPercentage:h},d,r.siteOwner):(b=w(w({videoId:p,watchedTime:g,watchedPercentage:h,doneWatching:c,profileId:d},O&&{seriesId:O}),m&&{originalObjectId:m}),e.saveWatchHistory(b).then((function(e){})).catch((function(e){}))),k=v+o}function S(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function j(e,n,t){var r=S(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),o=[];return r&&Array.isArray(r)&&(o=r.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),o}var T=function(){var e=t(r.mark((function e(n){var t,i,l,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=u.getPlayer(null==n?void 0:n.playerId),console.log(n),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=21;break}return e.next=5,import("@silvermine/videojs-chromecast");case 5:return a=e.sent,e.prev=6,e.next=9,f("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),console.log("Error",e.t0);case 14:return e.prev=14,a.default(o),e.finish(14);case 17:null!==(l=window)&&void 0!==l&&l.cast?null==i||i.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==i||i.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=n&&n.airplay&&"Safari"==c.detectBrowser()?null==i||i.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return e.stop()}}),e,null,[[6,11,14,17]])})));return function(n){return e.apply(this,arguments)}}(),I=function(e,n){var t=u.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,r,i,l,a,s=this.el(),u=o.dom.getPointerPosition(s,n).x;o.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var c=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(i=r.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(c),c&&"CONNECTED"===d){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),p=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=p*u,v.seek()}}))};var E=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"),f("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)}}(),x=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,import("videojs-contrib-eme").then((function(e){o.getPlugin("eme")||o.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),C=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(o),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)}}(),D=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-54c6c570.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)}}(),R=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){f("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(o)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(o)}))},loadAdsLibrary:E,loadEMELibrary:x,loadMuxPlugin:C,loadDvrSeekbar:D});function V(e){return N.apply(this,arguments)}function N(){return(N=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,E();case 3:t&&"Safari"==c.detectBrowser()&&Promise.resolve().then((function(){return R})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function A(e,n){return L.apply(this,arguments)}function L(){return L=t(r.mark((function e(n,t){var o,i,l,a,s,u,c;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(null==t?void 0:t.contentType)||"video",s=null==t||null===(o=t[a])||void 0===o?void 0:o.drmEnabled,u=(null==t||null===(i=t[a])||void 0===i||null===(l=i.liveDetails)||void 0===l?void 0:l.isDvrEnabled)||!1,e.prev=3,e.next=6,Promise.allSettled([s?x():null,T(n),null!=n&&null!==(c=n.analytics)&&void 0!==c&&c.muxKey?C():null,u&&showPositiveSeekbar?D():null]);case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(3),console.log("Error",e.t0);case 11:case"end":return e.stop()}}),e,null,[[3,8]])}))),L.apply(this,arguments)}function _(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 q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var H=new Set,M=null,U=function(n,t,r){var o,i,l,a,s,u,c,d,v,p={},f=(null==n?void 0:n.contentType)||"video";p[null==r||null===(o=r.Constants)||void 0===o?void 0:o.ASSET_NAME]=K(n),p["c3.cm.id"]=(null===(i=n[f])||void 0===i?void 0:i.id)||"Null",p["c3.cm.contentType"]=J(n),p[null==r||null===(l=r.Constants)||void 0===l?void 0:l.IS_LIVE]=!(null==n||!n.linearchannel),p[null==r||null===(a=r.Constants)||void 0===a?void 0:a.STREAM_URL]=t.currentSrc(),p[null==r||null===(s=r.Constants)||void 0===s?void 0:s.VIEWER_ID]="undefined"===e.getUserId()?"NULL":e.getUserId(),p["c3.cm.categoryType"]=z(n),p[null==r||null===(u=r.Constants)||void 0===u?void 0:u.PLAYER_NAME]="VL_WEB_PLAYER",p["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"}}(),p.DRMEnabled=(null===(c=n[f])||void 0===c?void 0:c.drmEnabled)||"None",p.DAIStream=null!==(d=n[f])&&void 0!==d&&null!==(v=d.gist)&&void 0!==v&&v.isSSAIEnabled?"YES":"NO",p[r.Constants.DEFAULT_RESOURCE]="AKAMAI",p["c3.cm.brand"]="NULL",p.CDVREnabled=G(n),p["c3.cm.genreList"]=F(n),p["c3.cm.genre"]=B(n),p["c3.cm.channel"]=W(n);var m=X(e.getCurrentSeries(),n);return p=q(q({},p),m)},B=function(e){var n,t,r,o=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[o])||void 0===n||null===(t=n.gist)||void 0===t||null===(r=t.primaryCategory)||void 0===r?void 0:r.title)||"Null"},F=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"},W=function(e){var n,t,r=(null==e?void 0:e.contentType)||"video";return"video"===r?"NULL":(null==e||null===(n=e[r])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"Null"},z=function(e){return null!=e&&e.linearchannel?"Linear":null!=e&&e.video&&(null==e||null===(n=e.video)||void 0===n||null===(t=n.categories)||void 0===t||null===(r=t[0])||void 0===r?void 0:r.title)||"Null";var n,t,r},G=function(e){var n,t,r=(null==e?void 0:e.contentType)||"video",o=(null==e||null===(n=e[r])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return o?"YES":"NO"},K=function(e){var n,t,r,o,i=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t?void 0:t.title)||"Null",a=(null==e||null===(r=e[i])||void 0===r||null===(o=r.gist)||void 0===o?void 0:o.id)||"Null";return"[".concat(a,"] ").concat(l)},J=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var X=function(n,t){var r,o,i,l,a,s={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!n||!t||null!=t&&t.linearchannel)return s;var u=e.getSeasonNumber(),c=e.getEpisodeNumber();return s["c3.cm.seriesName"]=(null==t||null===(r=t.video)||void 0===r||null===(o=r.series)||void 0===o?void 0:o.title)||"Null",s["c3.cm.seasonNumber"]=(null==u?void 0:u.toString())||"Null",s["c3.cm.showTitle"]=(null==n||null===(i=n[u-1])||void 0===i||null===(l=i.episodes)||void 0===l||null===(a=l[c-1])||void 0===a?void 0:a.title)||"Null",s["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",s},Y=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"}},Q=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Z=function(){var n=t(r.mark((function n(t,o){var i,l,a,s,c,d,v,p,f;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i=(null==o?void 0:o.convivaConfig)||{},l=i.trackConvivaPlayerEvent,a=i.paymentHandler,s=i.tveProvider,c=i.enable,d=(o||{}).token,c){n.next=4;break}return n.abrupt("return");case 4:if(v=u.getPlayer(t),"function"==typeof(p=l)){n.next=8;break}return n.abrupt("return");case 8:return n.next=10,p("getConvivaObject");case 10:if(f=n.sent){n.next=13;break}return n.abrupt("return");case 13:v.ready((function(){var e=v.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var r=Y(t.keySystem);p("contentInfo",{DRMEnabled:r})}else p("contentInfo",{DRMEnabled:"None"})})),n||p("contentInfo",{DRMEnabled:"None"})})),v.on("loadstart",(function(){M&&M!==v.currentSrc()&&p("playbackEnded"),p("setPlayer",v),H.clear(),M=v.currentSrc();var n=Q(v.currentType()),t=e.getCurrentVideo(),r=U(t,v,f);r.authToken=d||"NULL",r.streamType=n,r.D2CType=a||"NONE",r.subscriberType=s||(a?"D2C":"FREE"),r["c3.cm.affiliate"]=s||"NULL",p("contentInfo",r)})),v.on("loadedmetadata",(function(){var e,n=v.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),p("contentInfo",{screenResolution:e})})),v.on("play",(function(){H.has(v.currentSrc())||(H.add(v.currentSrc()),p("playbackStarted",null))})),v.on("ended",(function(){H.has(v.currentSrc())&&H.delete(v.currentSrc()),p("playbackEnded")})),v.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&p("initAdSensor",{player:v,adsLoader:null==e?void 0:e.adsLoader})})),v.on("dispose",(function(){null==H||H.clear(),p("playbackEnded")}));case 20:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}(),$=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-99078201.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-cd9dc93e.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-337e2fe5.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-bce101a3.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-7e7c4ce1.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&Promise.resolve().then((function(){return require("./skin-8eb170ef.js")})).then((function(t){t.initialiseSkin(e,n)}))},ee=!1,ne=function(n,t){var r,o,i=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(r=n[i])||void 0===r||null===(o=r.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!ee){var l=te(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),ee=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function te(e,n,t){if(Array.isArray(e))return e.map((function(e){return te(e,n,t)}));if(null!==e&&"object"===v(e)){var r={};return Object.keys(e).forEach((function(o){o===n&&void 0!==e[t]?r[o]=e[t]:o===t&&void 0!==e[n]?r[o]=e[n]:r[o]=te(e[o],n,t)})),r}return e}function re(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 oe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?re(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):re(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var ie=function(n,t,r,o){var i,l,a=o.res,s=o.sres,c=u.getPlayer(n),d=(null==a?void 0:a.contentType)||"video",v=(null==a||null===(i=a[d])||void 0===i||null===(l=i.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;e.setCurrentVideo(a),c&&(c.on("loadstart",(function(){v?r.resolve({status:!0,msg:"Video Loaded",response:a}):r.resolve(oe({status:!0,msg:"Player Initialised"},s?{seriesResponse:s,response:a}:{response:a}))})),c.on("loadeddata",(function(){var r,o,i;(null==c||!c.muted())&&y(n,sessionStorage.getItem("volume")||"100");var l=e.getCurrentVideo();if(e.clearError(),null!=t&&t.watchHistory&&null!=t&&null!==(r=t.watchHistory)&&void 0!==r&&r.enable&&(!t.isAnonymousUser||null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.saveOffline)){var s,d,v=oe(oe({},t),a);!function(e,n,t){var r,o,i;null!=n&&n.series&&null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable&&(O=null==n||null===(o=n.series)||void 0===o?void 0:o.id),b=[],k=0,p=t;var l=(null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.interval)||30,a=u.getPlayer(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());b.includes(k)||(e==k?(b.push(e),P(a,n,l)):e>k&&(k=e+l))})),a.one("ended",(function(){P(a,n,l,!0)})))}(n,v,null==l||null===(s=l.video)||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.id)}if(null!=t&&null!==(i=t.analytics)&&void 0!==i&&i.muxKey&&null!=c&&c.mux){var f,m,g,h,w,S,j=(null===(f=e.getCurrentVideo())||void 0===f?void 0:f.video)||(null==a?void 0:a.video),T=null==j?void 0:j.gist,I={env_key:null==t||null===(m=t.analytics)||void 0===m?void 0:m.muxKey,player_name:"vl-web-player",player_version:null===(g=window)||void 0===g?void 0:g.vl_player_version,video_id:null==T?void 0:T.id,video_title:null==T?void 0:T.title,video_series:null==j||null===(h=j.series)||void 0===h?void 0:h.title,video_stream_type:null!=j&&null!==(w=j.streamingInfo)&&void 0!==w&&w.isLiveStream?"live":"video",viewer_user_id:null==t||null===(S=t.analytics)||void 0===S?void 0:S.userId};c.mux({debug:!1,data:I})}})),c.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];c.trigger("subtitlechanged",n)})),c.on("subtitlechanged",(function(e,n){var t,r,o,i,l,a,s,u,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(o=r.framework)||void 0===o||null===(i=o.CastContext)||void 0===i||null===(l=i.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(c=u.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===p){var m,y=f.getMediaSession(),g=y.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([g[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),y.editTracksInfo(m)}})),c.tech_.on("retryplaylist",(function(){v&&ne(a,n)})),c.on("error",(function(){var t,o;(console.log("ERROR",c.error(),c.error().code),4===c.error().code&&v)?ne(a,n):(e.handleError(n,(null==c||null===(t=c.error())||void 0===t?void 0:t.message)||"Some error occured"),r.reject({status:!1,msg:(null==c||null===(o=c.error())||void 0===o?void 0:o.message)||"Some error occured",response:a}))})),c.one("play",(function(){var n;if(null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable){var r,o,i,l=null===(r=e.getCurrentVideo())||void 0===r||null===(o=r.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.id,a=e.getSeriesWatchMap(),s=(null==a?void 0:a.get(l))||{t:0,p:0},u=s.t,d=s.p;u&&d<95&&setTimeout((function(){c.currentTime(u)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){c.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0);if(null!=c&&c.dvrSeekbar)try{c.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}})),c.on("volumechange",(function(){var e=100*c.volume().toFixed(2);c.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),c.on("chromecastDisconnected",(function(){if(v){c.currentSource();for(var e=c.textTracks(),n=e.length-1;n>=0;n--)c.removeRemoteTextTrack(e[n])}})))};function le(e){return ae.apply(this,arguments)}function ae(){return(ae=t(r.mark((function e(n){var t,o,i,l,a,s,u,c,d,v,p,m;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f("https://cdn.dashjs.org/latest/dash.all.min.js");case 2:i=this.el().querySelector("video")||this.el(),l=window.player=null===(t=window.dashjs)||void 0===t?void 0:t.MediaPlayer().create(),a=(null==n?void 0:n.keySystems)&&(null==n||null===(o=n.keySystems)||void 0===o?void 0:o["com.widevine.alpha"]),l&&i?(l.initialize(i,n.src,!0),a&&(d=null===(s=n.keySystems["com.widevine.alpha"])||void 0===s?void 0:s.url,v=null===(u=n.keySystems["com.microsoft.playready"])||void 0===u?void 0:u.url,p=null===(c=n.keySystems["com.widevine.alpha"])||void 0===c?void 0:c.licenseHeaders["X-AxDRM-Message"],m={"com.widevine.alpha":{serverURL:d,httpRequestHeaders:{"X-AxDRM-Message":p}},"com.microsoft.playready":{serverURL:v,httpRequestHeaders:{"X-AxDRM-Message":p}}},l.setProtectionData(m))):console.error("Cannot initialise dash player");case 6:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function se(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?se(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):se(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var ce,de=function(i,a,s,d){var v,p,f,m,y,g,h,w,b,k,O,P,S,j,T,E,x,C,D,R,V,N,L,_,q,H,M,U,B=a.res,F=void 0===B?null:B,W=a.sres,z=void 0===W?null:W,G=null!=s&&s.chromecastReceiverId?["chromecast","html5"]:["html5"],K=(null===(v=F)||void 0===v?void 0:v.contentType)||"video",J=u.impolicy16x9(null===(p=F)||void 0===p||null===(f=p[K])||void 0===f||null===(m=f.gist)||void 0===m?void 0:m.videoImageUrl)||u.impolicy16x9(null===(y=F)||void 0===y||null===(g=y[K])||void 0===g||null===(h=g.gist)||void 0===h||null===(w=h.imageGist)||void 0===w?void 0:w.r16x9),X=(null===(b=F)||void 0===b||null===(k=b[K])||void 0===k||null===(O=k.liveDetails)||void 0===O?void 0:O.isDvrEnabled)||!1,Y=(null===(P=F)||void 0===P||null===(S=P[K])||void 0===S||null===(j=S.streamingInfo)||void 0===j?void 0:j.isLiveStreafm)||!1,Q=(null===(T=F)||void 0===T||null===(E=T.ads)||void 0===E||null===(x=E.preRoll)||void 0===x||null===(C=x.adTags)||void 0===C||null===(D=C.web)||void 0===D?void 0:D.active)&&(null===(R=F)||void 0===R||null===(V=R.ads)||void 0===V||null===(N=V.preRoll)||void 0===N||null===(L=N.adTags)||void 0===L||null===(_=L.web)||void 0===_?void 0:_.url);F=ue(ue({},F),{},{audioAssetSource:null==s?void 0:s.audioAssetSource});var ee=(U={enableSmoothSeeking:!0,controls:0!=(null==s?void 0:s.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==s?void 0:s.muted)||!1,autoplay:(null==s?void 0:s.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!1},muteToggle:"multiplayer"==s.skin,liveui:X},n(U,"autoplay",null==s?void 0:s.autoplay),n(U,"normalizeAutoplay",(null==s?void 0:s.autoplay)&&!Q),n(U,"loop",(null==s?void 0:s.loop)||!1),n(U,"audioPosterMode",null==s?void 0:s.audioPosterMode),n(U,"html5",ue(ue({vhs:ue(ue({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==s?void 0:s.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==s||null===(q=s.customData)||void 0===q?void 0:q.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0}),nativeTextTracks:!0},0==(null==s||null===(H=s.customData)||void 0===H?void 0:H.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==s||null===(M=s.customData)||void 0===M?void 0:M.nativeVideoTracks)&&{nativeVideoTracks:!1})),n(U,"poster",J),n(U,"techOrder",G),n(U,"chromecast",{requestCustomDataFn:function(e){var n=getPlayer(i),t=((null==n?void 0:n.textTracksJson_)||n.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,n,t){var r,o,i,l,a,s,u,c,d,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m;f.isDrmEnabled=!0;var y=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,g=null==y?void 0:y.url;f.licenseUrl=g;var h=null==y?void 0:y.licenseHeaders["X-AxDRM-Message"];f.licenseToken=h}var w=(null==e||null===(r=e[p])||void 0===r||null===(o=r.gist)||void 0===o?void 0:o.contentType)||"VIDEO";f.contentType=w;var b=null==e||null===(i=e[p])||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.runtime;f.duration=b;var k=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=k;var O=null==e||null===(u=e[p])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return f.mediaImage=O,f.subTitles=t,f.DVR=(null==e||null===(d=e[p])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(F,e,t)}}),U);if(!o.getPlayers()[i])var ne=o(i,ee,function(){var n=t(r.mark((function n(){var t,a,u,v,p,f,m,y,g,h,w,b,k,O,P,S,j,T;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(ne),console.log(o.VERSION),console.log(o.getPlugins()),n.next=5,A(s,F);case 5:Y&&d.resolve(ue({status:!0,msg:"Player Initialised"},z?{seriesResponse:z,response:F}:{response:F})),e.inititateBeacon(i,null==s?void 0:s.analyticsCb),Z(i,s),/Android/i.test(navigator.userAgent)&&(o.options.vhs.overrideNative=!0),X&&I(i,startOverTime),!Q||null!=s&&null!==(t=s.customData)&&void 0!==t&&t.disableAds||e.initialiseAdvertisement(i,Q,F),w=e.getSource(F,i),console.log(w),null!=s&&s.nearestClusterUrl&&(w=e.getUpdatedClusterSource(w,s.nearestClusterUrl)),"Chrome"==c.detectBrowser()&&(null===(a=F)||void 0===a||null===(u=a.video)||void 0===u?void 0:u.isSSAIEnabled)?le.call(this,w):w?e.loadVideo(i,w):(d.reject({status:!1,msg:"Incompatible / Missing Source",response:F}),e.handleError(i,"Incompatible / Missing Source")),((null===(v=F)||void 0===v||null===(p=v[K])||void 0===p||null===(f=p.contentDetails)||void 0===f||null===(m=f.closedCaptions)||void 0===m?void 0:m.length)>0||(null===(y=F)||void 0===y||null===(g=y[K])||void 0===g||null===(h=g.closedCaptions)||void 0===h?void 0:h.length)>0)&&(T=(null===(k=F)||void 0===k||null===(O=k[K])||void 0===O||null===(P=O.contentDetails)||void 0===P?void 0:P.closedCaptions)||(null===(S=F)||void 0===S||null===(j=S[K])||void 0===j?void 0:j.closedCaptions),b=T.filter((function(e){return"VTT"===e.format})),l.addCaptions(i,b)),null!=s&&s.disableControls?e.disableControls(i):$(i,ue(ue(ue({},s),ee),{},{liveVideo:Y,isDvrEnabled:X,res:F,sres:z})),ie(i,ue(ue(ue({},s),ee),{},{liveVideo:Y}),d,{res:F,sres:z});case 19:case"end":return n.stop()}}),n,this)})));return function(){return n.apply(this,arguments)}}())};function ve(e,n){return pe.apply(this,arguments)}function pe(){return(pe=t(r.mark((function n(t,o){var i,l,a,s,u,c;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=o.resolve,l=o.reject,a=null==t?void 0:t.videoId,s=null==t?void 0:t.playerId,u=!(null==t||!t.anonymousId),n.next=6,e.getToken();case 6:c=n.sent,e.getVideoDetails(a,c).then((function(n){var r,o,d,v;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(o=r.video)||void 0===o||null===(d=o.gist)||void 0===d?void 0:d.contentType,e.setCurrentVideo(null==n?void 0:n.data);var p,f=null==n?void 0:n.data;if(null!=t&&t.watchHistory&&null!=t&&null!==(v=t.watchHistory)&&void 0!==v&&v.enable&&!u)if((null===(p=t.watchHistory)||void 0===p?void 0:p.saveOffline)||!1){var m,y,g,h=j((null===(m=t.watchHistory)||void 0===m?void 0:m.profileId)||"",a,null==t?void 0:t.siteOwner);if(h&&h.length)t.watchHistoryResumeTime=(null===(y=h[0])||void 0===y?void 0:y.watchedTime)||null,t.watchedPercentage=(null===(g=h[0])||void 0===g?void 0:g.watchedPercentage)||null;f.contentType="video",de(s,{res:f},t,{resolve:i,reject:l})}else e.getVideoInfo(a,c).then((function(e){var n,r,o,i,l,a;null!==(n=window)&&void 0!==n&&null!==(r=n.watchHistory)&&void 0!==r&&r.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.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,f.contentType="video"})).catch((function(e){var n,t,r,o;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(r=window)||void 0===r||null===(o=r.watchHistory)||void 0===o||o.cb(e))})).finally((function(){de(s,{res:f},t,{resolve:i,reject:l})}));else de(s,{res:f},t,{resolve:i,reject:l})})).catch((function(n){e.initiateErrorHandling(n,s,l,a)}));case 8:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function fe(e,n){return me.apply(this,arguments)}function me(){return(me=t(r.mark((function n(t,o){var i,l,a,s,u;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=o.resolve,l=o.reject,n.next=3,e.getToken();case 3:a=n.sent,s=null==t?void 0:t.playerId,u=null==t?void 0:t.epg,e.getLinearChannelDetails(u,a).then((function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==u?void 0:u.channelId,de(s,{res:n},t,{resolve:i,reject:l})})).catch((function(n){e.initiateErrorHandling(n,s,l,videoId)}));case 7:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function ye(e,n){return ge.apply(this,arguments)}function ge(){return(ge=t(r.mark((function n(t,o){var i,l,a,s,u,c,d;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return l=o.resolve,a=o.reject,n.next=3,e.getToken();case 3:s=n.sent,u=null==t?void 0:t.playerId,c=sessionStorage.getItem("season-idx")||0,e.seasonIdxManager.set(parseInt(c)),d=null==t||null===(i=t.series)||void 0===i?void 0:i.id,e.getSeriesDetails(d,s).then((function(n){var r,o,i,c=n.data,v=n.data.seasons;e.setCurrentSeries(v);var p=videoId||(null==v||null===(r=v[0])||void 0===r||null===(o=r.episodes)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.id);e.createSeriesWatchMap(d,s),e.getVideoDetails(p,s).then((function(n){var r,o,i;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(o=r.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,e.setCurrentVideo(n.data),de(u,{res:null==n?void 0:n.data,sres:c},t,{resolve:l,reject:a})})).catch((function(n){e.initiateErrorHandling(n,u,a,videoId)}))})).catch((function(n){e.initiateErrorHandling(n,u,a)}));case 9:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function he(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?he(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):he(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}module.exports=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:i.onTimeUpdate,getVideoDuration:i.getVideoDuration,onVideoEnded:i.onVideoEnded,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),console.log("%c Handlers added ","background: #bdf369; color: #000"),new Promise(function(){var o=t(r.mark((function t(o,i){var l,a,s,c,v,p,m,y,g,h,w,b,k,O,P,S,j,T,I,E,x,C;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.isPlayerInitialised(null==n?void 0:n.playerId)){t.next=2;break}return t.abrupt("return");case 2:if(w=(null==n?void 0:n.videoSourceUrl)||!1,b=null==n?void 0:n.asat,k=(null==n||null===(l=n.epg)||void 0===l?void 0:l.enable)||!1,O=null==n?void 0:n.videoId,P=(null==n||null===(a=n.series)||void 0===a?void 0:a.enable)||!1,window.videoId=O,S=null==n?void 0:n.token,!e.token_authentication_enabled(n)){t.next=16;break}if(sessionStorage.setItem("vlp_token",S),e.refreshTokenManager().set(null==n?void 0:n.refreshToken),S&&!e.isTokenExpired(S)){t.next=15;break}return i({status:!1,msg:"".concat(S?"Token is expired !":"Missing Authorization Token"),response:{token:S}}),t.abrupt("return");case 15:ce=JSON.parse(atob(S.split(".")[1]));case 16:n.isAnonymousUser=!(null===(s=ce)||void 0===s||!s.anonymousId),n.siteOwner=(null===(c=ce)||void 0===c?void 0:c.site)||null,n.userId=(null===(v=ce)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(p=ce)||void 0===p?void 0:p.userId),window.watchHistory=n.watchHistory||null,j=null==n?void 0:n.playerId,n.chromecastReceiverId=null!=n&&null!==(m=n.series)&&void 0!==m&&m.enable?null:null==n?void 0:n.chromecastReceiverId,T=(null==n||null===(y=n.analytics)||void 0===y?void 0:y.gaId)||null,(I=null==n?void 0:n.errors)&&(window.customErrors=I),window.customData=null==n?void 0:n.customData,d.setLocalisation(null==n||null===(g=n.customData)||void 0===g?void 0:g.localisation),e.baseUrlManager.set(n.apiBaseUrl),null!=n&&n.skin&&!u.isNotAValidSkin(n.skin)||(n.skin="VL_ONE"),V(n),T&&f("https://www.googletagmanager.com/gtag/js?id=".concat(T)).then((function(){return e.runGtag(T)})).catch((function(e){})),(E=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(j)))&&E.addEventListener("contextmenu",(function(e){return e.preventDefault()})),w?(C={directPlaybackUrl:w,id:x="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},b?e.getVideoDetails(x,S).then((function(e){de(j,{res:we(we({},e),C)},n,{resolve:o,reject:i})})).catch((function(n){e.initiateErrorHandling(n,j,i,x)})):de(j,{res:C},n,{resolve:o,reject:i})):P?ye(n,{resolve:o,reject:i}):k?fe(n,{resolve:o,reject:i}):ve(n,{resolve:o,reject:i});case 35:case"end":return t.stop()}}),t)})));return function(e,n){return o.apply(this,arguments)}}())},getRenditions:a.getRenditions,skip:e.skip,getPlayer:u.getPlayer,play:e.play,pause:e.pause,detectBrowser:c.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:i.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:l.enableCaptions,disableCaptions:l.disableCaptions,getCaptions:l.getCaptions,playSelectedResolution:s.playSelectedResolution,getSource:e.getSource,setVolume:y,getVolume:g,disableControls:e.disableControls,setPlaybackSpeed:i.setPlaybackSpeed,getEntitlementData:e.getEntitlementData}};
@@ -1 +1 @@
1
- import{E as n,f as t,O as i,N as o,P as e}from"./generic-4c43a94b.js";import{a}from"./util-435845ca.js";import{g as c,h as s}from"./skin-612c987b.js";var u,r=0,f=0,l=function(l){clearTimeout(r);var h=null==l?void 0:l.content;u=null==l?void 0:l.cb;var v=l.playerId;a(v,(function(){var a=c(v);0!==(null==a?void 0:a.currentTime())&&((f=o())>h.length-1||(e(f+1),n(v,h[f].id).then((function(n){s(f,v),t(n.response),f++,d(n)})).catch((function(n){d(n),s(f,v),f++,r=setTimeout((function(){i(v)&&m(f,v,h)}),5e3)}))))}))},m=function t(i,o,a,c){f=i,i>a.length-1||(e(f+1),n(o,a[i].id).then((function(n){s(f,o),f++,d(n)})).catch((function(n){d(n),setTimeout((function(){s(f,o),f++,t(f,o,a)}),5e3)})))},d=function(n){u&&u(n)};export{l as a,m as s};
1
+ import{F as n,f as t,P as i,O as o,Q as e}from"./generic-d124edfc.js";import{a}from"./util-435845ca.js";import{g as c,h as s}from"./skin-612c987b.js";var u,r=0,f=0,l=function(l){clearTimeout(r);var h=null==l?void 0:l.content;u=null==l?void 0:l.cb;var v=l.playerId;a(v,(function(){var a=c(v);0!==(null==a?void 0:a.currentTime())&&((f=o())>h.length-1||(e(f+1),n(v,h[f].id).then((function(n){s(f,v),t(n.response),f++,d(n)})).catch((function(n){d(n),s(f,v),f++,r=setTimeout((function(){i(v)&&m(f,v,h)}),5e3)}))))}))},m=function t(i,o,a,c){f=i,i>a.length-1||(e(f+1),n(o,a[i].id).then((function(n){s(f,o),f++,d(n)})).catch((function(n){d(n),setTimeout((function(){s(f,o),f++,t(f,o,a)}),5e3)})))},d=function(n){u&&u(n)};export{l as a,m as s};
package/esm/bundle.css CHANGED
@@ -1,8 +1,6 @@
1
1
 
2
2
 
3
3
 
4
-
5
-
6
4
  .video-js.skin_vlone .vjs-control-bar .vjs-progress-control.vjs-control {
7
5
  height: 0.7em;
8
6
  position: absolute;
@@ -143,6 +141,8 @@
143
141
  }
144
142
 
145
143
 
144
+
145
+
146
146
  /* CSS for videojs-dvr-seekbar */
147
147
 
148
148
  .video-js.vjs-dvr-seekbar {
@@ -315,6 +315,8 @@
315
315
 
316
316
 
317
317
 
318
+
319
+
318
320
  .video-js .multicamera-parent.default{
319
321
  height: 345px;
320
322
  position: absolute;
@@ -397,8 +399,6 @@
397
399
 
398
400
 
399
401
 
400
-
401
-
402
402
  /* nextep */
403
403
  .next-ep-preview{
404
404
  position: absolute;
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import i from"video.js";import{C as a,z as s}from"./generic-4c43a94b.js";import{g as c}from"./renditions-16e1a2db.js";import{g as d,p as u}from"./skin-612c987b.js";import{g as p}from"./localisation-0bf399a1.js";function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?m(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function f(e){var t=v();return function(){var n,r=l(e);if(t){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}var g=function(e){var o=function(e){r(i,e);var o=f(i);function i(e,n){var r;t(this,i);var l=(r=o.call(this,e,n)).el_;return l.classList.add("vjs-slowmo-button"),l.textContent=p("slowMoText")||"Slow Mo",r}return n(i,[{key:"handleClick",value:function(){1==l.playbackRate()?(l.playbackRate(.5),this.el().style.background="darkgray"):(l.playbackRate(1),this.el().style.background="none")}}]),i}(i.getComponent("Button"));i.registerComponent("MyButton",o);var l=i(e);l.getChild("controlBar").addChild("myButton",{},2)},C=function(e,o,l){var s=function(o){r(s,o);var i=f(s);function s(e,n){var r;t(this,s);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-rewind-button");var a=u(l);return o.append(a),r}return n(s,[{key:"handleClick",value:function(){a(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},y=function(e,o,l){var a=function(o){r(a,o);var i=f(a);function a(e,n){var r;t(this,a);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-skip-button");var s=u(l);return o.append(s),r}return n(a,[{key:"handleClick",value:function(){s(e,10)}}]),a}(i.getComponent("Button"));i.registerComponent("MyButton",a),i(e).getChild("controlBar").addChild("myButton",{},1)},B=function(e,t,n){import("./resolution-a5e1082b.js").then((function(r){var o=r.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=d(e),a=c(e);(null==a?void 0:a.length)>0&&(i.registerComponent("resolutionModule",o),l.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:n,renditions:a},l.controlBar.children().length-4))}))},b=function(e,t,n){import("./nextEpisodeButton-f84ca95e.js").then((function(r){var o=r.default,l=d(n);i.registerComponent("nextEpisodeButtonModule",o),l.getChild("controlBar").addChild("nextEpisodeButtonModule",{playerId:n,sres:e,res:t},l.controlBar.children().length-5)}))},j=function(e,t,n){import("./series-68d00891.js").then((function(r){var o=r.seriesModule,l=d(e);i.registerComponent("seriesModule",o),l.getChild("controlBar").addChild("seriesModule",{playerId:e,seriesData:t},l.controlBar.children().length-4);for(var a=document.querySelectorAll(".season-title-sdk"),s=function(e){a[e].addEventListener("click",(function(){t[e]&&r.handleSeasonChange(t[e],e,l,n)}))},c=0;c<a.length;c++)s(c)}))},k=function(e,t){import("./videoSelector-ea2ddd7f.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))},S=function(e,t){import("./caption-settings-6b429691.js").then((function(n){var r,o,l,a,s=n.default,c=d(e);i.registerComponent("captionSelector",s),null===(r=document)||void 0===r||null===(o=r.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("caption-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),c&&c.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},c.controlBar.children().length-3)}))},E=function(e,t){import("./settings-icon-364df3cf.js").then((function(n){var r,o,l,a,s=n.default,c=d(e);i.registerComponent("settingsSelector",s),null===(r=document)||void 0===r||null===(o=r.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("settings-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),c&&c.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},c.controlBar.children().length-3)}))},O=function(e,t){import("./playlist-ac64e4e7.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("playlistSelector",r),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)}))},I=function(e,t){import("./series-v2-a0799a86.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)}))},w=function(e,t){import("./multicamv2-18bf6f1a.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))},M=function(e,t){var n=d(e).el(),r=i.dom.createEl("div",{className:"output-overlay",innerHTML:'<iframe frameBorder="0" src='.concat(t,"></iframe>")});n.append(r)},P=function(e){var t=d(e).el(),n=0,r=d(e);r.addChild("fullscreenToggle");var o=function(){var e,n=null==t||null===(e=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===e?void 0:e[0];n&&n.click()};r.el().addEventListener("dblclick",o),window._multiplayer_dbClickHandler=o;r.el().addEventListener("touchend",(function(){var e=(new Date).getTime(),r=e-n;if(r<300&&r>0){var o,l=null==t||null===(o=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===o?void 0:o[0];l&&l.click()}n=e})),window._multiplayer_dbTapHandler=o},L=function(e,t){import("./videoSelector-bdd9c4e6.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))},N=function(e,t){import("./series-v2-97947ec9.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)}))},_=function(e,t){import("./multicamv2-d5fc76da.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))};export{B as a,j as b,b as c,y as d,C as e,E as f,S as g,M as h,g as i,L as j,_ as k,O as l,N as m,P as n,k as o,I as p,w as q};
1
+ import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import i from"video.js";import{D as a,A as s}from"./generic-d124edfc.js";import{g as c}from"./renditions-16e1a2db.js";import{g as d,p as u}from"./skin-612c987b.js";import{g as p}from"./localisation-0bf399a1.js";function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?m(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function f(e){var t=v();return function(){var n,r=l(e);if(t){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}var g=function(e){var o=function(e){r(i,e);var o=f(i);function i(e,n){var r;t(this,i);var l=(r=o.call(this,e,n)).el_;return l.classList.add("vjs-slowmo-button"),l.textContent=p("slowMoText")||"Slow Mo",r}return n(i,[{key:"handleClick",value:function(){1==l.playbackRate()?(l.playbackRate(.5),this.el().style.background="darkgray"):(l.playbackRate(1),this.el().style.background="none")}}]),i}(i.getComponent("Button"));i.registerComponent("MyButton",o);var l=i(e);l.getChild("controlBar").addChild("myButton",{},2)},C=function(e,o,l){var s=function(o){r(s,o);var i=f(s);function s(e,n){var r;t(this,s);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-rewind-button");var a=u(l);return o.append(a),r}return n(s,[{key:"handleClick",value:function(){a(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},y=function(e,o,l){var a=function(o){r(a,o);var i=f(a);function a(e,n){var r;t(this,a);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-skip-button");var s=u(l);return o.append(s),r}return n(a,[{key:"handleClick",value:function(){s(e,10)}}]),a}(i.getComponent("Button"));i.registerComponent("MyButton",a),i(e).getChild("controlBar").addChild("myButton",{},1)},B=function(e,t,n){import("./resolution-a5e1082b.js").then((function(r){var o=r.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=d(e),a=c(e);(null==a?void 0:a.length)>0&&(i.registerComponent("resolutionModule",o),l.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:n,renditions:a},l.controlBar.children().length-4))}))},b=function(e,t,n){import("./nextEpisodeButton-cbea8588.js").then((function(r){var o=r.default,l=d(n);i.registerComponent("nextEpisodeButtonModule",o),l.getChild("controlBar").addChild("nextEpisodeButtonModule",{playerId:n,sres:e,res:t},l.controlBar.children().length-5)}))},j=function(e,t,n){import("./series-de2bcf34.js").then((function(r){var o=r.seriesModule,l=d(e);i.registerComponent("seriesModule",o),l.getChild("controlBar").addChild("seriesModule",{playerId:e,seriesData:t},l.controlBar.children().length-4);for(var a=document.querySelectorAll(".season-title-sdk"),s=function(e){a[e].addEventListener("click",(function(){t[e]&&r.handleSeasonChange(t[e],e,l,n)}))},c=0;c<a.length;c++)s(c)}))},k=function(e,t){import("./videoSelector-be51e523.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))},S=function(e,t){import("./caption-settings-6b429691.js").then((function(n){var r,o,l,a,s=n.default,c=d(e);i.registerComponent("captionSelector",s),null===(r=document)||void 0===r||null===(o=r.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("caption-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),c&&c.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},c.controlBar.children().length-3)}))},E=function(e,t){import("./settings-icon-364df3cf.js").then((function(n){var r,o,l,a,s=n.default,c=d(e);i.registerComponent("settingsSelector",s),null===(r=document)||void 0===r||null===(o=r.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("settings-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),c&&c.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},c.controlBar.children().length-3)}))},O=function(e,t){import("./playlist-12093fe6.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("playlistSelector",r),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)}))},I=function(e,t){import("./series-v2-83709ee8.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)}))},w=function(e,t){import("./multicamv2-08d4acf9.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))},M=function(e,t){var n=d(e).el(),r=i.dom.createEl("div",{className:"output-overlay",innerHTML:'<iframe frameBorder="0" src='.concat(t,"></iframe>")});n.append(r)},P=function(e){var t=d(e).el(),n=0,r=d(e);r.addChild("fullscreenToggle");var o=function(){var e,n=null==t||null===(e=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===e?void 0:e[0];n&&n.click()};r.el().addEventListener("dblclick",o),window._multiplayer_dbClickHandler=o;r.el().addEventListener("touchend",(function(){var e=(new Date).getTime(),r=e-n;if(r<300&&r>0){var o,l=null==t||null===(o=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===o?void 0:o[0];l&&l.click()}n=e})),window._multiplayer_dbTapHandler=o},D=function(e,t){import("./videoSelector-9eab2fd1.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))},L=function(e,t){import("./series-v2-b20f5533.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)}))},N=function(e,t){import("./multicamv2-e6a0e531.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))};export{B as a,j as b,b as c,y as d,C as e,E as f,S as g,M as h,g as i,D as j,N as k,O as l,L as m,P as n,k as o,I as p,w as q};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import i from"video.js";import o from"axios";import{g as r,c as a}from"./skin-612c987b.js";import{i as l,d}from"./browser-d4613b36.js";import u from"js-cookie";import s from"ua-parser-js";import{a as c,r as v}from"./captions-59c404fa.js";function m(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function f(e){window.dataLayer=window.dataLayer||[],m("js",new Date),m("config",e)}function p(e,t){m("event",e,t)}var w={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel"};function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function g(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?I(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):I(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var E={name:"@viewlift/player8",version:"1.0.110",main:"dist/bundle.cjs.js",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1",axios:"^1.2.3",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","video.js":"^8.21.1","videojs-contrib-ads":"^7.5.2","videojs-contrib-eme":"^5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"}};window.vl_player_version=E.version;var T,h=function(e,t){var n,i,r,a,l,d,u,s;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise((function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})})):o({url:null!==(l=window)&&void 0!==l&&null!==(d=l.customData)&&void 0!==d&&d.overrideEntitlementBaseUrl?(null===(u=window)||void 0===u||null===(s=u.customData)||void 0===s?void 0:s.overrideEntitlementBaseUrl)+"/video/status":F.get()+"".concat(null==w?void 0:w.getVideoDetails),params:g({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:t,"Sdk-Version":E.version},withCredentials:!0})},y=function(e,t){var n,i,r,a;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise((function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})})):o({url:F.get()+w.getLinearChannelDetails,params:g(g(g(g(g({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web"},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:t}})},b=function(e,t){var n,i,r=x(t),a=(null==r?void 0:r.site)||null;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.seriesData?new Promise((function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.seriesData})})):o({url:F.get()+"/v3/content/series/".concat(e),params:{site:a},method:"GET",headers:{Authorization:t}})},_=function(){var e=t(n.mark((function e(t){var i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:return i=e.sent,e.abrupt("return",o({url:F.get()+"".concat(null==w?void 0:w.saveWatchHistoryV2),method:"POST",headers:{Authorization:i},data:g({},t),params:g({},(null==t?void 0:t.profileId)&&{profileId:null==t?void 0:t.profileId})}));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),D=function(e,t){var n,i,r=window.contentType;return o({method:"GET",url:F.get()+"".concat(null==w?void 0:w.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:t,"x-api-key":null===(n=window)||void 0===n||null===(i=n.watchHistory)||void 0===i?void 0:i.xApiKey},timeout:15e3})},O=function(e){var t=e.videoId;return o({method:"GET",url:F.get()+"".concat(null==w?void 0:w.getSeriesWatchHistoryV2,"/").concat(t),headers:{Authorization:e.token},timeout:15e3})},F=(T=null==w?void 0:w.apiBaseUrl,{set:function(e){e&&(T=e)},get:function(){return T}}),S=function(e,t,n){return o({url:n,params:{id:e,deviceType:"web_browser",contentConsumption:"web"},method:"GET",headers:{Authorization:t},withCredentials:!0})},L=function(e){var t=JSON.parse(atob(null==e?void 0:e.split(".")[1])),n=null==t?void 0:t.exp;if(new Date(1e3*n).getTime()<(new Date).getTime())return!0},P=null;function R(){return{set:function(e){e&&(P=e)},get:function(){return P}}}var V,A,W,C,N,j,B=function(){var e=t(n.mark((function e(){var t,i,o;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=R().get(),i=F.get(),e.prev=2,e.next=5,axios({method:"GET",url:"".concat(i,"/identity/refresh/").concat(t)});case 5:return o=e.sent,e.abrupt("return",o);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),M=null,U=function(){var e=t(n.mark((function e(){var t;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=sessionStorage.getItem("vlp_token"))||!L(t)){e.next=6;break}return M||(M=B().then((function(e){var n,i,o=null==e||null===(n=e.data)||void 0===n?void 0:n.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&R().set(r),o||t})).catch((function(e){return console.error("Error fetching refresh token",e),t})).finally((function(){M=null}))),e.abrupt("return",M);case 6:return e.abrupt("return",t);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),k=function(e){var t=!0,n=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return n&&!i&&(t=!1),t},x=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},H=function(e){A=e},G=function(){return A},z=function(e){V=e},Y=function(){return V},J=function(){return W},K=function(e){W=e},Q=function(){return N},X=function(e){C=new Map,e.map((function(e,t){C.set(e.id,t)}))},q=function(e){if(C){var t=C.get(e);K(t+1)}},Z=(j=0,{set:function(e){e>=0&&(j=e)},get:function(){return j}});function $(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ee(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?$(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):$(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var te=function(){var e,t,n,i,o,r,a,l=G();return"linearchannel"==((null==l?void 0:l.contentType)||"video")?null==l||null===(e=l.linearchannel)||void 0===e||null===(t=e.channels)||void 0===t||null===(n=t.find((function(e){return(null==e?void 0:e.id)===(null==l?void 0:l.channelId)})))||void 0===n||null===(i=n.content)||void 0===i?void 0:i.id:(null==l||null===(o=l.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id)||(null==l||null===(a=l.video)||void 0===a?void 0:a.id)};function ne(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function ie(){var e=window.sessionStorage.getItem("uid");return e||(e=ne(),window.sessionStorage.setItem("uid",e),e)}function oe(){return re.apply(this,arguments)}function re(){return(re=t(n.mark((function e(){var t,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:if(!(t=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}window.initialise=function(e){window.sid=ne(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",(function(){var n,i,o,r=Math.floor(e.currentTime());p(r?"FAILED_TO_START":"DROPPED_STREAM",ee({pfm:window.platform,uid:ie(),vid:te(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e,t){e.one("play",tryCatch((function(){var n,i,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),p("PLAY",ee({pfm:window.platform,uid:ie(),vid:te(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),t&&t("Video Start",{"Video ID":te(),watchTime:Math.floor(e.currentTime())})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,a,l=e+.1;if(+l.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting"))p("BUFFERING",ee({pfm:window.platform,uid:ie(),vid:te(),videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return l}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,p("FIRST_FRAME",ee({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ie(),vid:te()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,n,i,o,r,a;p("AD_REQUEST",ee({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ie(),vid:te(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),p("AD_IMPRESSION",ee({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ie(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:te()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),a=i.end(o);if(ae(t,r,a)){var l=Math.round(n-a);if(isFinite(l))return l}}}))()};var ae=function(e,t,n){return e>=t&&e<=n};function le(e,t){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var n=r(e);window.initialise(n,t),window.firstFrame(n,t),n.on("loadedmetadata",(function(){window.endFirstFrame(n)}))}}window.fireEvent=function(){var e=t(n.mark((function e(t){var i,r,a,l,d,u,s,c,v,m,f,p,w,I;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:return m=e.sent,f=x(m),p=null==f?void 0:f.site,w=null==f?void 0:f.siteId,e.t0=ee,e.t1=ee,e.t2=ee({aid:p,cid:w,pfm:window.platform},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=ie(),e.t5=te(),e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(n=t.adPosition)?String(n):"":"",e.next=26,oe();case 26:e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(l=window)||void 0===l||null===(d=l.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),I=[e.t31],o({url:(null===(s=window)||void 0===s||null===(c=s.customData)||void 0===c||null===(v=c.beacon)||void 0===v?void 0:v.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:m},contentType:"application/x-www-form-urlencoded",dataType:"text",data:I}).catch((function(e){console.error(e)}));case 42:case"end":return e.stop()}var n}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var de=function(e,t){var n=new Map;O({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),N=n})).catch((function(e){return console.log(e)}))},ue=function(){var e=Z.get();return e>=0?e+1:1},se=function(){var e,t,n,i=Y(),o=G(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,a=Z.get(),l=null==i||null===(t=i[a])||void 0===t||null===(n=t.episodes)||void 0===n?void 0:n.findIndex((function(e){return(null==e?void 0:e.id)===r}));return l>=0?l+1:1};function ce(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ve(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ce(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ce(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}window._deviceInfo=s(navigator.userAgent);var me=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},fe=function(e){var t=pe(e,"video.tags",[]),n=pe(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map((function(e){return e.title})).join(","):n},pe=function(e,t,n){for(var i=0,o=(t=t.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[t[i]]}return e||n},we=function(){var e,t,n,i,o,a,l,d,s,c,v,m,f,p,w,I,g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",E=arguments.length>1?arguments[1]:void 0,T=arguments.length>2?arguments[2]:void 0,h=(null==T?void 0:T.contentType)||"video",y=null==T||null===(e=T[h])||void 0===e?void 0:e.metadata,b=r(E);if(!g.includes("VIEWLIFT_"))return g;var _=window.getComputedStyle(document.getElementById(E),null),D=Math.trunc(_.getPropertyValue("height").slice(0,-2)),O=Math.trunc(_.getPropertyValue("width").slice(0,-2)),F="linearchannel"===h?null==T||null===(t=T.linearchannel)||void 0===t||null===(n=t.channels)||void 0===n||null===(i=n.find((function(e){return(null==e?void 0:e.id)===(null==T?void 0:T.channelId)})))||void 0===i||null===(o=i.content)||void 0===o?void 0:o.id:pe(T,"video.gist.id",""),S=ve(ve({},Ie(y)),{},{VIEWLIFT_WIDTH:O,VIEWLIFT_HEIGHT:D,VIEWLIFT_SIZE:me(O,D),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(a=window)||void 0===a?void 0:a.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:pe(T,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:pe(T,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:pe(T,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==b||null===(l=b.options_)||void 0===l?void 0:l.autoplay)||1,VIEWLIFT_MUTE:(null==b||null===(d=b.options_)||void 0===d?void 0:d.autoplay)||0,VIEWLIFT_DEVICE_ID:localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"WEB_BROWSER",VIEWLIFT_KEYWORDS:fe(T),VIEWLIFT_MEDIA_ID:F,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(pe(T,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:F,VIEWLIFT_VIDEO_URL:encodeURI(window.location.host+pe(T,"video.gist.permalink","")),VIEWLIFT_CONSENT:u.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:pe(null===(s=window)||void 0===s||null===(c=s.app_data)||void 0===c||null===(v=c.site)||void 0===v?void 0:v.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR:pe(null===(m=window)||void 0===m||null===(f=m.app_data)||void 0===f||null===(p=f.site)||void 0===p?void 0:p.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*pe(T,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:pe(T,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:F,VIEWLIFT_CONTENT_TITLE:pe(T,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),VIEWLIFT_CONTENT_SERIES_TITLE:pe(T,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:pe(T,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:se(),VIEWLIFT_SEASON_NUMBER:ue(),VIEWLIFT_CONTENT_TAGS:fe(T)},null===(w=window)||void 0===w||null===(I=w.customData)||void 0===I?void 0:I.macros);for(var L in S){var P=new RegExp(L,"g");g=g.replace(P,S[L])}return g},Ie=function(e){var t,n,i,o,r,a,d={},u=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map((function(e){u.set(e.name,e.value)})));var s=(null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.subscription)||void 0===i?void 0:i.SVOD)||!1,c=(null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(a=r.subscription)||void 0===a?void 0:a.TVE)||!1;return s||c?(l()?s?d=ve(ve({},d),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||""}):c&&(d=ve(ve({},d),{},{VIEWLIFT_CSID:u.get("csid.mweb.tve")||""})):s?d=ve(ve({},d),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||""}):c&&(d=ve(ve({},d),{},{VIEWLIFT_CSID:u.get("csid.web.tve")||""})),s?d=ve(ve({},d),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||""}):c&&(d=ve(ve({},d),{},{VIEWLIFT_SFID:u.get("sfid.tve")||""})),d=l()?ve(ve({},d),{},{VIEWLIFT_PROF:u.get("prof.mweb")||""}):ve(ve({},d),{},{VIEWLIFT_PROF:u.get("prof.web")||""})):(d=ve(ve({},d),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||""}),d=l()?ve(ve({},d),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:u.get("prof.mweb")||""}):ve(ve({},d),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||"",VIEWLIFT_PROF:u.get("prof.web")||""})),d},ge=function(e,t){var n,i,o,r,a,l,u,s,c,v,m,f,p,w=(null==e?void 0:e.contentType)||"video",I=null==e||null===(n=e[w])||void 0===n?void 0:n.drmEnabled,g=null==e||null===(i=e[w])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,E=null==e||null===(r=e[w])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.audioAssets,T=(null==e||null===(l=e[w])||void 0===l||null===(u=l.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(c=e[w])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var h=(null==e||null===(m=e[w])||void 0===m||null===(f=m.streamingInfo)||void 0===f||null===(p=f.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return Te(E);if(I){var y=he(g,t);return y.src=we(y.src,t,e),y}if("Safari"!==d()&&h)return Ee(g);if(T){var b=Te(g);return b.src=we(b.src,t,e),b}if(null!=g&&g.mpeg){var _=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(g);return _.src=we(_.src,t,e),_}return null},Ee=function(e){var t=null==e?void 0:e.dash;return t?{src:t,type:"application/dash+xml"}:null},Te=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},he=function(e,t){var n=e.fairPlay,o=e.widevine,a=e.playReady,l=d();if(r(t),"Safari"===l){var u=function(e){var t=e.url;return{src:t,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(t,n){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};i.xhr(o,(function(e,t,i){console.log(e),e&&n(e),n(null,new Uint8Array(i))}))},getContentId:function(e,t){if(t){var n=t.indexOf("\0")+1;return t.slice(n)}},getLicense:function(t,n,o,r){var a={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:o,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};i.xhr(a,(function(e,t,n){console.log(e),e&&r(e),r(null,n)}))}}}}}(n);return ye(t),u}var s={src:o.url,type:"application/dash+xml"};return ye(t),s.keySystems={"com.widevine.alpha":{url:o.licenseUrl,licenseHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}},s};var ye=function(e){var t=r(e);if("function"==typeof t.eme)try{t.eme(),"Safari"==d()&&t.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},be=function(e,t){var n=e.src,i=e.type;if(!n||"string"!=typeof n||!n.includes(".com"))return{src:n,type:i};t=t.replace(/\/$/,"");var o=n.split(".com")[1]||"";return{src:o?"".concat(t).concat(o):n,type:i}},_e=function(e,t){if(import("./error-2395864b.js").then((function(e){var t=document.createElement("style");t.id="errorblock",t.append("".concat(e.default)),document.head.appendChild(t)})),document.getElementsByClassName("error-container")[0]){var n=document.getElementsByClassName("error-message")[0];n&&(n.innerHTML="".concat(t))}else{var i=document.getElementById(e);if(i){var o=document.createElement("div");o.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(t),o.appendChild(r),i.append(o)}}},De=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var Oe=!1,Fe=function(e,t,n){var i=we(t,e,n),o=r(e);if(t&&window.google){if("function"!=typeof o.ima)return;o.ima.initializeAdDisplayContainer&&o.ima.initializeAdDisplayContainer(),function(e,t){var n,i,o,a=r(e);if(null!==a.el_){Oe=!0;var l={id:e,adTagUrl:"".concat(t),adLabel:"Your video will resume after this sponsor message"};a.ima.initializeAdDisplayContainer&&a.ima.initializeAdDisplayContainer(),Oe&&null!==a.el_&&("function"==typeof a.ima?a.ima(l):setTimeout((function(){a.ima.setContentWithAdTag(null,t,!0),a.ima.requestAds()}),1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),a.one(u,(function(){s&&a.ima.initializeAdDisplayContainer()}));var c=(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.ads)||void 0===o?void 0:o.adEventHandler)||null;a.one("ads-ad-started",(function(){c&&c({status:"STARTED",msg:"Advertisement Started"})})),a.one("ads-manager",(function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,(function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})}))})),a.on("adserror",(function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})}))}}(e,i)}};function Se(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}var Le=function(e){i(e).play()},Pe=function(e){i(e).pause()},Re=function(e,t){var n=i(e),o=n.currentTime()+t;n.currentTime(o)},Ve=function(e,t){var n=i(e),o=n.currentTime(),r=o<=t?0:o-t;n.currentTime(r)},Ae=function(e){return!!i.getPlayer("".concat(e))},We=function(e){return i(e).paused()},Ce=function(){var e=t(n.mark((function e(t,i){var o,a,l,d=arguments;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=d.length>2&&void 0!==d[2]&&d[2],e.next=3,U();case 3:return a=e.sent,l=r(t),e.abrupt("return",new Promise((function(e,n){y(i,a).then((function(n){var r=null==n?void 0:n.data;window.sid=ne(),r.contentType="linearchannel",r.channelId=null==i?void 0:i.channelId;var a=ge(r,t);H(r),a&&o?(Ue(t,a),l.on("loadstart",(function(){e({status:!0,msg:"Feed authenticated and loaded",response:r})}))):e({status:!0,msg:"Feed authenticated",response:r})})).catch((function(e){n({status:!1,msg:"Cannot load feed",response:e})}))})));case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Ne=function(){var e=t(n.mark((function e(t,i,o){var a,l,d,u,s,m;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:return u=e.sent,(Y()||null)&&q(i),s=0,m=0,null!==(a=window)&&void 0!==a&&a.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(d=l.watchHistory)&&void 0!==d&&d.enable&&D(i,u).then((function(e){var t,n,i,o,r,a;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),s=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,m=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null})).catch((function(e){var t,n,i,o;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(e))})),e.abrupt("return",new Promise((function(e,n){h(i,u).then((function(i){var o,a,l,d,u,f,p,w,I,g,E=null==i?void 0:i.data,T=(null==E||null===(o=E.video)||void 0===o||null===(a=o.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1;H(i.data);var h=(null==E||null===(l=E.ads)||void 0===l||null===(d=l.preRoll)||void 0===d||null===(u=d.adTags)||void 0===u||null===(f=u.web)||void 0===f?void 0:f.active)&&(null==E||null===(p=E.ads)||void 0===p||null===(w=p.preRoll)||void 0===w||null===(I=w.adTags)||void 0===I||null===(g=I.web)||void 0===g?void 0:g.url);h&&Fe(t,h,E);var y=ge(E,t);if(y){var b,_,D,O,F,S,L,P,R,V,A,W,C,N,j=(null==E||null===(b=E.video)||void 0===b||null===(_=b.gist)||void 0===_?void 0:_.videoImageUrl)||(null==E||null===(D=E.video)||void 0===D||null===(O=D.gist)||void 0===O||null===(F=O.imageGist)||void 0===F?void 0:F.r16x9),B=r(t);if(B.poster(j),Ue(t,y),B.on("loadstart",(function(){T&&e({status:!0,msg:"Video Loaded",response:E})})),B.on("loadeddata",(function(){De(),e({status:!0,msg:"Video Loaded",response:E})})),B.one("play",(function(){s&&m<95&&setTimeout((function(){B.currentTime(s)}),0)})),B.one("error",(function(){var e;n({status:!1,msg:(null==B||null===(e=B.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==E||null===(S=E.video)||void 0===S||null===(L=S.contentDetails)||void 0===L||null===(P=L.closedCaptions)||void 0===P?void 0:P.length)>0||(null==E||null===(R=E.video)||void 0===R||null===(V=R.closedCaptions)||void 0===V?void 0:V.length)>0)A=((null==E||null===(W=E.video)||void 0===W||null===(C=W.contentDetails)||void 0===C?void 0:C.closedCaptions)||(null==E||null===(N=E.video)||void 0===N?void 0:N.closedCaptions)).filter((function(e){return"VTT"===e.format})),c(t,A);else v(t)}else _e(t,"Incompatible Source, only hls,mp4,drm content is allowed"),n("Incompatible Source, only hls,mp4,drm content is allowed")})).catch((function(e){ke(e,t,n,i)}))})));case 9:case"end":return e.stop()}}),e)})));return function(t,n,i){return e.apply(this,arguments)}}(),je=function(e,t,n){var i=r(e);return i.src(t),new Promise((function(e,t){var o=0;i.one("loadedmetadata",(function(){clearTimeout(o),e({status:!0,msg:"video loaded"})})),i.one("loadstart",(function(e){o=setTimeout((function(){t("FAILED: Took too long to load")}),n)}))}))},Be=function(e){var t=r(e);if(Me(),a(),window.onresize=null,t)t.dispose();else{var n=document.getElementById(e);n&&n.remove()}},Me=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},Ue=function(e,t){var n=r(e);n&&n.src(t)},ke=function(t,n,i,o){var r,a,l,d,u,s,c=null==t||null===(r=t.response)||void 0===r||null===(a=r.data)||void 0===a?void 0:a.errorCode,v=(null==t||null===(l=t.response)||void 0===l||null===(d=l.data)||void 0===d?void 0:d.errorMessage)||(null==t?void 0:t.message);Ae(n)&&_e(n,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[c])||"".concat(v)),i&&i(function(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?Se(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Se(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({status:!1,response:t,msg:"".concat(v)},o&&{videoId:o}))},xe=function(e){var t=document.getElementById(e),n=t.getElementsByClassName("vjs-control-bar")[0];n&&(n.style.visibility="hidden");var i=t.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=t.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")};export{Le as A,Pe as B,Ve as C,Ae as D,Ne as E,Ce as F,Be as G,S as H,F as I,f as J,k as K,R as L,L as M,J as N,We as O,K as P,O as Q,X as R,q as S,Z as T,ie as a,se as b,Y as c,ue as d,ge as e,H as f,G as g,De as h,_e as i,Q as j,le as k,Ue as l,Fe as m,be as n,xe as o,h as p,D as q,ke as r,_ as s,U as t,y as u,b as v,de as w,z as x,je as y,Re as z};
1
+ import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import i from"video.js";import o from"axios";import{g as r,c as a}from"./skin-612c987b.js";import{i as l,d}from"./browser-d4613b36.js";import u from"js-cookie";import s from"ua-parser-js";import{a as c,r as v}from"./captions-59c404fa.js";function m(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function f(e){window.dataLayer=window.dataLayer||[],m("js",new Date),m("config",e)}function p(e,t){m("event",e,t)}var w={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel"};function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function g(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?I(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):I(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var E={name:"@viewlift/player8",version:"1.0.110",main:"dist/bundle.cjs.js",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1",axios:"^1.2.3",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","video.js":"^8.21.1","videojs-contrib-ads":"^7.5.2","videojs-contrib-eme":"^5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"}};window.vl_player_version=E.version;var T,h=function(e,t){var n,i,r,a,l,d,u,s;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise((function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})})):o({url:null!==(l=window)&&void 0!==l&&null!==(d=l.customData)&&void 0!==d&&d.overrideEntitlementBaseUrl?(null===(u=window)||void 0===u||null===(s=u.customData)||void 0===s?void 0:s.overrideEntitlementBaseUrl)+"/video/status":F.get()+"".concat(null==w?void 0:w.getVideoDetails),params:g({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:t,"Sdk-Version":E.version},withCredentials:!0})},y=function(e,t){var n,i,r,a;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise((function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})})):o({url:F.get()+w.getLinearChannelDetails,params:g(g(g(g(g({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web"},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:t}})},b=function(e,t){var n,i,r=x(t),a=(null==r?void 0:r.site)||null;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.seriesData?new Promise((function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.seriesData})})):o({url:F.get()+"/v3/content/series/".concat(e),params:{site:a},method:"GET",headers:{Authorization:t}})},_=function(){var e=t(n.mark((function e(t){var i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:return i=e.sent,e.abrupt("return",o({url:F.get()+"".concat(null==w?void 0:w.saveWatchHistoryV2),method:"POST",headers:{Authorization:i},data:g({},t),params:g({},(null==t?void 0:t.profileId)&&{profileId:null==t?void 0:t.profileId})}));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),D=function(e,t){var n,i,r=window.contentType;return o({method:"GET",url:F.get()+"".concat(null==w?void 0:w.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:t,"x-api-key":null===(n=window)||void 0===n||null===(i=n.watchHistory)||void 0===i?void 0:i.xApiKey},timeout:15e3})},O=function(e){var t=e.videoId;return o({method:"GET",url:F.get()+"".concat(null==w?void 0:w.getSeriesWatchHistoryV2,"/").concat(t),headers:{Authorization:e.token},timeout:15e3})},F=(T=null==w?void 0:w.apiBaseUrl,{set:function(e){e&&(T=e)},get:function(){return T}}),S=function(e,t,n){return o({url:n,params:{id:e,deviceType:"web_browser",contentConsumption:"web"},method:"GET",headers:{Authorization:t},withCredentials:!0})},L=function(e){var t=JSON.parse(atob(null==e?void 0:e.split(".")[1])),n=null==t?void 0:t.exp;if(new Date(1e3*n).getTime()<(new Date).getTime())return!0},P=null;function R(){return{set:function(e){e&&(P=e)},get:function(){return P}}}var V,A,W,C,N,j,B=function(){var e=t(n.mark((function e(){var t,i,o;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=R().get(),i=F.get(),e.prev=2,e.next=5,axios({method:"GET",url:"".concat(i,"/identity/refresh/").concat(t)});case 5:return o=e.sent,e.abrupt("return",o);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),M=null,U=function(){var e=t(n.mark((function e(){var t;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=sessionStorage.getItem("vlp_token"))||!L(t)){e.next=6;break}return M||(M=B().then((function(e){var n,i,o=null==e||null===(n=e.data)||void 0===n?void 0:n.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&R().set(r),o||t})).catch((function(e){return console.error("Error fetching refresh token",e),t})).finally((function(){M=null}))),e.abrupt("return",M);case 6:return e.abrupt("return",t);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),k=function(e){var t=!0,n=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return n&&!i&&(t=!1),t},x=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},H=function(e){A=e},G=function(){return A},z=function(e){V=e},Y=function(){return V},J=function(){return W},K=function(e){W=e},Q=function(){return N},X=function(e){C=new Map,e.map((function(e,t){C.set(e.id,t)}))},q=function(e){if(C){var t=C.get(e);K(t+1)}},Z=(j=0,{set:function(e){e>=0&&(j=e)},get:function(){return j}});function $(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ee(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?$(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):$(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var te=function(){var e,t,n,i,o,r,a,l=G();return"linearchannel"==((null==l?void 0:l.contentType)||"video")?null==l||null===(e=l.linearchannel)||void 0===e||null===(t=e.channels)||void 0===t||null===(n=t.find((function(e){return(null==e?void 0:e.id)===(null==l?void 0:l.channelId)})))||void 0===n||null===(i=n.content)||void 0===i?void 0:i.id:(null==l||null===(o=l.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id)||(null==l||null===(a=l.video)||void 0===a?void 0:a.id)};function ne(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function ie(){var e=window.sessionStorage.getItem("uid");return e||(e=ne(),window.sessionStorage.setItem("uid",e),e)}function oe(){return re.apply(this,arguments)}function re(){return(re=t(n.mark((function e(){var t,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:if(!(t=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}window.initialise=function(e){window.sid=ne(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",(function(){var n,i,o,r=Math.floor(e.currentTime());p(r?"FAILED_TO_START":"DROPPED_STREAM",ee({pfm:window.platform,uid:ie(),vid:te(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e,t){e.one("play",tryCatch((function(){var n,i,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),p("PLAY",ee({pfm:window.platform,uid:ie(),vid:te(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),t&&t("Video Start",{"Video ID":te(),watchTime:Math.floor(e.currentTime())})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,a,l=e+.1;if(+l.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting"))p("BUFFERING",ee({pfm:window.platform,uid:ie(),vid:te(),videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return l}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,p("FIRST_FRAME",ee({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ie(),vid:te()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,n,i,o,r,a;p("AD_REQUEST",ee({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ie(),vid:te(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),p("AD_IMPRESSION",ee({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ie(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:te()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),a=i.end(o);if(ae(t,r,a)){var l=Math.round(n-a);if(isFinite(l))return l}}}))()};var ae=function(e,t,n){return e>=t&&e<=n};function le(e,t){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var n=r(e);window.initialise(n,t),window.firstFrame(n,t),n.on("loadedmetadata",(function(){window.endFirstFrame(n)}))}}window.fireEvent=function(){var e=t(n.mark((function e(t){var i,r,a,l,d,u,s,c,v,m,f,p,w,I;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:return m=e.sent,f=x(m),p=null==f?void 0:f.site,w=null==f?void 0:f.siteId,e.t0=ee,e.t1=ee,e.t2=ee({aid:p,cid:w,pfm:window.platform},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=ie(),e.t5=te(),e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(n=t.adPosition)?String(n):"":"",e.next=26,oe();case 26:e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(l=window)||void 0===l||null===(d=l.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),I=[e.t31],o({url:(null===(s=window)||void 0===s||null===(c=s.customData)||void 0===c||null===(v=c.beacon)||void 0===v?void 0:v.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:m},contentType:"application/x-www-form-urlencoded",dataType:"text",data:I}).catch((function(e){console.error(e)}));case 42:case"end":return e.stop()}var n}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var de=function(e,t){var n=new Map;O({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),N=n})).catch((function(e){return console.log(e)}))},ue=function(){var e=Z.get();return e>=0?e+1:1},se=function(){var e,t,n,i=Y(),o=G(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,a=Z.get(),l=null==i||null===(t=i[a])||void 0===t||null===(n=t.episodes)||void 0===n?void 0:n.findIndex((function(e){return(null==e?void 0:e.id)===r}));return l>=0?l+1:1};function ce(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ve(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ce(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ce(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}window._deviceInfo=s(navigator.userAgent);var me=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},fe=function(e){var t=pe(e,"video.tags",[]),n=pe(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map((function(e){return e.title})).join(","):n},pe=function(e,t,n){for(var i=0,o=(t=t.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[t[i]]}return e||n},we=function(){var e,t,n,i,o,a,l,d,s,c,v,m,f,p,w,I,g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",E=arguments.length>1?arguments[1]:void 0,T=arguments.length>2?arguments[2]:void 0,h=(null==T?void 0:T.contentType)||"video",y=null==T||null===(e=T[h])||void 0===e?void 0:e.metadata,b=r(E);if(!g.includes("VIEWLIFT_"))return g;var _=window.getComputedStyle(document.getElementById(E),null),D=Math.trunc(_.getPropertyValue("height").slice(0,-2)),O=Math.trunc(_.getPropertyValue("width").slice(0,-2)),F="linearchannel"===h?null==T||null===(t=T.linearchannel)||void 0===t||null===(n=t.channels)||void 0===n||null===(i=n.find((function(e){return(null==e?void 0:e.id)===(null==T?void 0:T.channelId)})))||void 0===i||null===(o=i.content)||void 0===o?void 0:o.id:pe(T,"video.gist.id",""),S=ve(ve({},Ie(y)),{},{VIEWLIFT_WIDTH:O,VIEWLIFT_HEIGHT:D,VIEWLIFT_SIZE:me(O,D),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(a=window)||void 0===a?void 0:a.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:pe(T,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:pe(T,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:pe(T,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==b||null===(l=b.options_)||void 0===l?void 0:l.autoplay)||1,VIEWLIFT_MUTE:(null==b||null===(d=b.options_)||void 0===d?void 0:d.autoplay)||0,VIEWLIFT_DEVICE_ID:localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"WEB_BROWSER",VIEWLIFT_KEYWORDS:fe(T),VIEWLIFT_MEDIA_ID:F,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(pe(T,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:F,VIEWLIFT_VIDEO_URL:encodeURI(window.location.host+pe(T,"video.gist.permalink","")),VIEWLIFT_CONSENT:u.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:pe(null===(s=window)||void 0===s||null===(c=s.app_data)||void 0===c||null===(v=c.site)||void 0===v?void 0:v.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR:pe(null===(m=window)||void 0===m||null===(f=m.app_data)||void 0===f||null===(p=f.site)||void 0===p?void 0:p.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*pe(T,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:pe(T,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:F,VIEWLIFT_CONTENT_TITLE:pe(T,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),VIEWLIFT_CONTENT_SERIES_TITLE:pe(T,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:pe(T,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:se(),VIEWLIFT_SEASON_NUMBER:ue(),VIEWLIFT_CONTENT_TAGS:fe(T)},null===(w=window)||void 0===w||null===(I=w.customData)||void 0===I?void 0:I.macros);for(var L in S){var P=new RegExp(L,"g");g=g.replace(P,S[L])}return g},Ie=function(e){var t,n,i,o,r,a,d={},u=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map((function(e){u.set(e.name,e.value)})));var s=(null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.subscription)||void 0===i?void 0:i.SVOD)||!1,c=(null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(a=r.subscription)||void 0===a?void 0:a.TVE)||!1;return s||c?(l()?s?d=ve(ve({},d),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||""}):c&&(d=ve(ve({},d),{},{VIEWLIFT_CSID:u.get("csid.mweb.tve")||""})):s?d=ve(ve({},d),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||""}):c&&(d=ve(ve({},d),{},{VIEWLIFT_CSID:u.get("csid.web.tve")||""})),s?d=ve(ve({},d),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||""}):c&&(d=ve(ve({},d),{},{VIEWLIFT_SFID:u.get("sfid.tve")||""})),d=l()?ve(ve({},d),{},{VIEWLIFT_PROF:u.get("prof.mweb")||""}):ve(ve({},d),{},{VIEWLIFT_PROF:u.get("prof.web")||""})):(d=ve(ve({},d),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||""}),d=l()?ve(ve({},d),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:u.get("prof.mweb")||""}):ve(ve({},d),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||"",VIEWLIFT_PROF:u.get("prof.web")||""})),d},ge=function(e,t){var n,i,o,r,a,l,u,s,c,v,m,f,p,w=(null==e?void 0:e.contentType)||"video",I=null==e||null===(n=e[w])||void 0===n?void 0:n.drmEnabled,g=null==e||null===(i=e[w])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,E=null==e||null===(r=e[w])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.audioAssets,T=(null==e||null===(l=e[w])||void 0===l||null===(u=l.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(c=e[w])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var h=(null==e||null===(m=e[w])||void 0===m||null===(f=m.streamingInfo)||void 0===f||null===(p=f.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return Te(E);if(I){var y=he(g,t);return y.src=we(y.src,t,e),y}if("Safari"!==d()&&h)return Ee(g);if(T){var b=Te(g);return b.src=we(b.src,t,e),b}if(null!=g&&g.mpeg){var _=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(g);return _.src=we(_.src,t,e),_}return null},Ee=function(e){var t=null==e?void 0:e.dash;return t?{src:t,type:"application/dash+xml"}:null},Te=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},he=function(e,t){var n=e.fairPlay,o=e.widevine,a=e.playReady,l=d();if(r(t),"Safari"===l){var u=function(e){var t=e.url;return{src:t,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(t,n){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};i.xhr(o,(function(e,t,i){console.log(e),e&&n(e),n(null,new Uint8Array(i))}))},getContentId:function(e,t){if(t){var n=t.indexOf("\0")+1;return t.slice(n)}},getLicense:function(t,n,o,r){var a={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:o,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};i.xhr(a,(function(e,t,n){console.log(e),e&&r(e),r(null,n)}))}}}}}(n);return ye(t),u}var s={src:o.url,type:"application/dash+xml"};return ye(t),s.keySystems={"com.widevine.alpha":{url:o.licenseUrl,licenseHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}},s};var ye=function(e){var t=r(e);if("function"==typeof t.eme)try{t.eme(),"Safari"==d()&&t.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},be=function(e,t){var n=e.src,i=e.type;if(!n||"string"!=typeof n||!n.includes(".com"))return{src:n,type:i};t=t.replace(/\/$/,"");var o=n.split(".com")[1]||"";return{src:o?"".concat(t).concat(o):n,type:i}},_e=function(e,t){if(import("./error-2395864b.js").then((function(e){var t=document.createElement("style");t.id="errorblock",t.append("".concat(e.default)),document.head.appendChild(t)})),document.getElementsByClassName("error-container")[0]){var n=document.getElementsByClassName("error-message")[0];n&&(n.innerHTML="".concat(t))}else{var i=document.getElementById(e);if(i){var o=document.createElement("div");o.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(t),o.appendChild(r),i.append(o)}}},De=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var Oe=!1,Fe=function(e,t,n){var i=we(t,e,n),o=r(e);if(t&&window.google){if("function"!=typeof o.ima)return;o.ima.initializeAdDisplayContainer&&o.ima.initializeAdDisplayContainer(),function(e,t){var n,i,o,a=r(e);if(null!==a.el_){Oe=!0;var l={id:e,adTagUrl:"".concat(t),adLabel:"Your video will resume after this sponsor message"};a.ima.initializeAdDisplayContainer&&a.ima.initializeAdDisplayContainer(),Oe&&null!==a.el_&&("function"==typeof a.ima?a.ima(l):setTimeout((function(){a.ima.setContentWithAdTag(null,t,!0),a.ima.requestAds()}),1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),a.one(u,(function(){s&&a.ima.initializeAdDisplayContainer()}));var c=(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.ads)||void 0===o?void 0:o.adEventHandler)||null;a.one("ads-ad-started",(function(){c&&c({status:"STARTED",msg:"Advertisement Started"})})),a.one("ads-manager",(function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,(function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})}))})),a.on("adserror",(function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})}))}}(e,i)}};function Se(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}var Le=function(e){i(e).play()},Pe=function(e){i(e).pause()},Re=function(e,t){var n=i(e),o=n.currentTime()+t;n.currentTime(o)},Ve=function(e,t){var n=i(e),o=n.currentTime(),r=o<=t?0:o-t;n.currentTime(r)},Ae=function(e){return!!i.getPlayer("".concat(e))},We=function(e){return i(e).paused()},Ce=function(){var e=t(n.mark((function e(t,i){var o,a,l,d=arguments;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=d.length>2&&void 0!==d[2]&&d[2],e.next=3,U();case 3:return a=e.sent,l=r(t),e.abrupt("return",new Promise((function(e,n){y(i,a).then((function(n){var r=null==n?void 0:n.data;window.sid=ne(),r.contentType="linearchannel",r.channelId=null==i?void 0:i.channelId;var a=ge(r,t);H(r),a&&o?(Ue(t,a),l.on("loadstart",(function(){e({status:!0,msg:"Feed authenticated and loaded",response:r})}))):e({status:!0,msg:"Feed authenticated",response:r})})).catch((function(e){n({status:!1,msg:"Cannot load feed",response:e})}))})));case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Ne=function(){var e=t(n.mark((function e(t,i,o){var a,l,d,u,s,m;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,U();case 2:return u=e.sent,(Y()||null)&&q(i),s=0,m=0,null!==(a=window)&&void 0!==a&&a.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(d=l.watchHistory)&&void 0!==d&&d.enable&&D(i,u).then((function(e){var t,n,i,o,r,a;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),s=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,m=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null})).catch((function(e){var t,n,i,o;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(e))})),e.abrupt("return",new Promise((function(e,n){h(i,u).then((function(i){var o,a,l,d,u,f,p,w,I,g,E=null==i?void 0:i.data,T=(null==E||null===(o=E.video)||void 0===o||null===(a=o.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1;H(i.data);var h=(null==E||null===(l=E.ads)||void 0===l||null===(d=l.preRoll)||void 0===d||null===(u=d.adTags)||void 0===u||null===(f=u.web)||void 0===f?void 0:f.active)&&(null==E||null===(p=E.ads)||void 0===p||null===(w=p.preRoll)||void 0===w||null===(I=w.adTags)||void 0===I||null===(g=I.web)||void 0===g?void 0:g.url);h&&Fe(t,h,E);var y=ge(E,t);if(y){var b,_,D,O,F,S,L,P,R,V,A,W,C,N,j=(null==E||null===(b=E.video)||void 0===b||null===(_=b.gist)||void 0===_?void 0:_.videoImageUrl)||(null==E||null===(D=E.video)||void 0===D||null===(O=D.gist)||void 0===O||null===(F=O.imageGist)||void 0===F?void 0:F.r16x9),B=r(t);if(B.poster(j),Ue(t,y),B.on("loadstart",(function(){T&&e({status:!0,msg:"Video Loaded",response:E})})),B.on("loadeddata",(function(){De(),e({status:!0,msg:"Video Loaded",response:E})})),B.one("play",(function(){s&&m<95&&setTimeout((function(){B.currentTime(s)}),0)})),B.one("error",(function(){var e;n({status:!1,msg:(null==B||null===(e=B.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==E||null===(S=E.video)||void 0===S||null===(L=S.contentDetails)||void 0===L||null===(P=L.closedCaptions)||void 0===P?void 0:P.length)>0||(null==E||null===(R=E.video)||void 0===R||null===(V=R.closedCaptions)||void 0===V?void 0:V.length)>0)A=((null==E||null===(W=E.video)||void 0===W||null===(C=W.contentDetails)||void 0===C?void 0:C.closedCaptions)||(null==E||null===(N=E.video)||void 0===N?void 0:N.closedCaptions)).filter((function(e){return"VTT"===e.format})),c(t,A);else v(t)}else _e(t,"Incompatible Source, only hls,mp4,drm content is allowed"),n("Incompatible Source, only hls,mp4,drm content is allowed")})).catch((function(e){ke(e,t,n,i)}))})));case 9:case"end":return e.stop()}}),e)})));return function(t,n,i){return e.apply(this,arguments)}}(),je=function(e,t,n){var i=r(e);return i.src(t),new Promise((function(e,t){var o=0;i.one("loadedmetadata",(function(){clearTimeout(o),e({status:!0,msg:"video loaded"})})),i.one("loadstart",(function(e){o=setTimeout((function(){t("FAILED: Took too long to load")}),n)}))}))},Be=function(e){var t=r(e);if(Me(),a(),window.onresize=null,t)t.dispose();else{var n=document.getElementById(e);n&&n.remove()}},Me=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},Ue=function(e,t){var n=r(e);n&&n.src(t)},ke=function(t,n,i,o){var r,a,l,d,u,s,c=null==t||null===(r=t.response)||void 0===r||null===(a=r.data)||void 0===a?void 0:a.errorCode,v=(null==t||null===(l=t.response)||void 0===l||null===(d=l.data)||void 0===d?void 0:d.errorMessage)||(null==t?void 0:t.message);Ae(n)&&_e(n,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[c])||"".concat(v)),i&&i(function(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?Se(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Se(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({status:!1,response:t,msg:"".concat(v)},o&&{videoId:o}))},xe=function(e){var t=document.getElementById(e),n=t.getElementsByClassName("vjs-control-bar")[0];n&&(n.style.visibility="hidden");var i=t.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=t.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")};export{Re as A,Le as B,Pe as C,Ve as D,Ae as E,Ne as F,Ce as G,Be as H,S as I,F as J,f as K,k as L,R as M,L as N,J as O,We as P,K as Q,O as R,X as S,q as T,ie as a,se as b,Y as c,ue as d,ge as e,H as f,G as g,De as h,_e as i,Q as j,le as k,Ue as l,Fe as m,be as n,xe as o,h as p,D as q,ke as r,_ as s,U as t,y as u,b as v,de as w,Z as x,z as y,je as z};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/toConsumableArray";import{g as t}from"./skin-612c987b.js";import{N as n,c as r,g as i}from"./generic-4c43a94b.js";import{s as o}from"./autoNextVideo-d84f6aba.js";import a from"@babel/runtime/helpers/typeof";import l from"video.js";import u from"@babel/runtime/helpers/asyncToGenerator";import s from"@babel/runtime/regenerator";import c from"@babel/runtime/helpers/defineProperty";import d from"@babel/runtime/helpers/slicedToArray";var p,m,v,f,h=[],g=function(i,o){var a;if(null!=o&&null!==(a=o.series)&&void 0!==a&&a.enable){var l;h=[];var u=r();null==u||u.map((function(t){var n;return(n=h).push.apply(n,e(t.episodes))})),null==o||null===(l=o.series)||void 0===l||l.cb}else{var s,c;h=(null==o||null===(s=o.relatedVideos)||void 0===s?void 0:s.content)||[],null==o||null===(c=o.relatedVideos)||void 0===c||c.cb}var d=t(i);d.on("timeupdate",(function(){var e,t,r=Math.floor(d.currentTime()),i=d.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-r<=10&&n()<=(null===(t=h)||void 0===t?void 0:t.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}));var p,m=h.filter((function(e,t){return t==n()}));if((null==m?void 0:m.length)>0)if(null!==(p=document.getElementsByClassName("next-ep-preview"))&&void 0!==p&&p[0]){var v,f,g,y,b,w,E,C,N,k,T,A;(null===(v=document.getElementsByClassName("next-ep-preview"))||void 0===v?void 0:v[0]).style.visibility="hidden";var L=null===(f=document.getElementsByClassName("next-ep-title"))||void 0===f?void 0:f[0],B=null===(g=document.getElementsByClassName("next-ep-img"))||void 0===g?void 0:g[0],I=null===(y=document.getElementsByClassName("next-ep-content"))||void 0===y?void 0:y[0],M=null===(b=m[0])||void 0===b?void 0:b.title;(null===(w=M)||void 0===w?void 0:w.length)>60&&(M=M.substr(0,60)+"..."),L.textContent="".concat(M),B.src=(null===(E=m[0])||void 0===E||null===(C=E.gist)||void 0===C||null===(N=C.imageGist)||void 0===N?void 0:N.r16x9)||(null==m||null===(k=m[0])||void 0===k?void 0:k.img)||(null===(T=window)||void 0===T||null===(A=T.customData)||void 0===A?void 0:A.fallbackImage),I.onclick=function(){return x(i)}}else{var P,j,O,S,R,X,D,F,U=document.createElement("div");U.className="next-ep-preview",U.style.visibility="hidden",document.getElementById(i).append(U);var G=document.createElement("div");G.className="next-ep-header",G.textContent="Next up";var $=null===(P=m[0])||void 0===P?void 0:P.title,V=document.createElement("img");V.className="next-ep-img",V.src=(null===(j=m[0])||void 0===j||null===(O=j.gist)||void 0===O||null===(S=O.imageGist)||void 0===S?void 0:S.r16x9)||(null==m||null===(R=m[0])||void 0===R?void 0:R.img)||(null===(X=window)||void 0===X||null===(D=X.customData)||void 0===D?void 0:D.fallbackImage);var W=document.createElement("div");W.className="next-ep-title",(null===(F=$)||void 0===F?void 0:F.length)>60&&($=$.substr(0,60)+"..."),W.textContent="".concat($);var _=document.createElement("div");_.className="next-ep-content",_.append(V),_.append(W),_.onclick=function(){return x(i)},U.append(G),U.append(_)}},x=function(e,r){var i=t(e),a=Math.floor(i.currentTime());if(Math.floor(i.duration())!=a){i.pause(e);var l=n();o(l,e,h)}};function y(e){var t=e.split("\n"),n=[];return t.forEach((function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach((function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))})),n.push(r)}})),n}function b(e){return w.apply(this,arguments)}function w(){return(w=u(s.mark((function e(t){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var n=new Image;n.src=t.uri,n.crossOrigin="Anonymous";var r=[],i=t.layout.split("x"),o=d(i,2),a=o[0],l=o[1];n.onload=function(){var i=document.createElement("canvas");i.width=n.width,i.height=n.height,i.getContext("2d").drawImage(n,0,0,i.width,i.height);for(var o=i.width/l,u=i.height/a,s=0;s<a;s++)for(var c=0;c<l;c++){var d=document.createElement("canvas");d.width=o,d.height=u,d.getContext("2d").drawImage(i,c*o,s*u,o,u,0,0,o,u);var p=d.toDataURL("image/png");r.push({uri:p,duration:t.duration})}e(r)},n.onerror=function(n){var r,i,o,a;e([{duration:t.duration,uri:"".concat(null===(r=window)||void 0===r||null===(i=r.app_data)||void 0===i||null===(o=i.appcmsMain)||void 0===o||null===(a=o.images)||void 0===a?void 0:a.placeholderCover)}])}})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function E(e){return C.apply(this,arguments)}function C(){return(C=u(s.mark((function e(t){var n,r;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t);case 3:return n=e.sent,e.next=6,n.text();case 6:return r=e.sent,e.abrupt("return",y(r));case 10:e.prev=10,e.t0=e.catch(0),console.error("Error fetching the M3U8 manifest:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function N(e){return k.apply(this,arguments)}function k(){return(k=u(s.mark((function e(t){var n,r;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map((function(e){return b(e)})));case 2:return n=e.sent.flat(),r={},n.map((function(e,t){var n,i=e.duration;r[i*t]={src:e.uri,style:(n={left:"-60px",height:"85px",width:"130px"},c(n,"left","-60px"),c(n,"border","1px solid transparent"),c(n,"borderRadius","4px"),n)}})),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}p={0:{src:"example-thumbnail.png"}},m=function e(){var t,n,r,i,o;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(o in i=t[r])i.hasOwnProperty(o)&&("object"===a(i[o])?n[o]=e(n[o],i[o]):n[o]=i[o]);return n},v=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},f=function e(t){return"HTML"!==t.nodeName&&"static"===v(t)("position")?e(t.offsetParent):t},l.registerPlugin("thumbnails",(function(e){var t,n,r,i,o,a,l,u;function s(){document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",s),u()}n=m({},p,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",r=document.createElement("img"),t.appendChild(r),r.src=n[0].src,r.className="vjs-thumbnail",m(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),a=i.duration(),i.on("durationchange",(function(e){a=i.duration()})),i.on("loadedmetadata",(function(e){a=i.duration()})),(o=i.controlBar.progressControl).el().appendChild(t),l=function(e){var i,l,u,s,c,d,p,h,g,x;for(l in u=0,g=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,p=((x=f(o.el()).getBoundingClientRect()).width||x.right)+g,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=f(o.el()).getBoundingClientRect().left+g,i=Math.floor((s-o.el().offsetLeft)/o.width()*a),n)i>l&&(u=Math.max(u,l));(c=n[u]).src&&r.src!=c.src&&(r.src=c.src),c.style&&r.style!=c.style&&m(r.style,c.style),s+(h=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=v(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(r,c.width||n[0].width)/2)>p?s-=s+h-p:s<h&&(s=h),t.style.left=s+"px"},o.on("mousemove",l),o.on("touchmove",l),o.on("pointerdown",(function(e){console.log(e),document.addEventListener("pointermove",l),document.addEventListener("pointerup",s)})),u=function(e){t.style.left="-1000px"},o.on("mouseout",u),o.on("touchcancel",u),o.on("touchend",u),i.on("userinactive",u)}));var T=function(){var e=u(s.mark((function e(t,n){var r,i,o,a;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5:return i=e.sent,o=i.split("\n"),a=[],o.forEach((function(e,n){e=e.trim();var r={resolution:null,duration:null,uri:null,layout:null};n>0&&o[n-1].includes("#EXT-X-TILES")&&(o[n-1]=o[n-1].split(","),r.uri=t+e,o[n-1].forEach((function(e){(e.includes(":")?e.split(":")[1]:e).split(",").forEach((function(e){var t=e.split("="),n=d(t,2),i=n[0],o=n[1];i=i.toLowerCase(),r[i]=o}))})),a.push(r))})),e.abrupt("return",a);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function A(e){return L.apply(this,arguments)}function L(){return(L=u(s.mark((function e(t){var n,r,o,a,l,u,c,p,m,v,f,h,g,x,y,b,w,E,C,N,k,T,A,L,B,I,M,P,j,O;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.split("/").slice(0,t.split("/").indexOf("dash")+1).join("/")||t,e.prev=1,e.next=4,fetch(t);case 4:return u=e.sent,e.next=7,u.text();case 7:c=e.sent,p=new DOMParser,m=p.parseFromString(c,"application/xml"),v=null===(r=i())||void 0===r||null===(o=r.video)||void 0===o?void 0:o.runtime,f=(null==m||null===(a=m.getElementsByTagName("BaseURL"))||void 0===a||null===(l=a[0])||void 0===l?void 0:l.textContent)||n,h=m.getElementsByTagName("AdaptationSet"),g=0;case 14:if(!(g<h.length)){e.next=38;break}if(("image"!==(x=h[g]).getAttribute("contentType")||"image/png"!==x.getAttribute("mimeType"))&&"image/jpeg"!==x.getAttribute("mimeType")){e.next=35;break}if(y=x.getElementsByTagName("SegmentTemplate")[0],b=x.getElementsByTagName("Representation")[0],w=b.getElementsByTagName("EssentialProperty")[0],E=w.getAttribute("value"),C=null==E?void 0:E.split("x"),N=d(C,2),k=N[0],T=N[1],!y){e.next=35;break}for(y.getAttribute("media"),A=y.getAttribute("duration"),L=y.getAttribute("timescale"),B=A/(L||A/(k*T)),I=b.getAttribute("id"),M=Math.round(v/B),P=Math.ceil(M/k*T),j=y.getAttribute("media"),O=[],g=0;g<P;g++)O.push({duration:B,layout:E,uri:f+j.replace("$Number$",g).replace("$RepresentationID$",I)});return e.abrupt("return",O);case 35:g++,e.next=14;break;case 38:return console.log("No trickplay segment found."),e.abrupt("return",null);case 42:e.prev=42,e.t0=e.catch(1),console.error("Error fetching or parsing MPD:",e.t0);case 45:case"end":return e.stop()}}),e,null,[[1,42]])})))).apply(this,arguments)}function B(e){return I.apply(this,arguments)}function I(){return(I=u(s.mark((function e(n){var r,i,o,a,l,u,c,d,p,m,v,f,h,g,x,y;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=t(n),c=u.currentSource(),d=c.src,d=null!==(r=d)&&void 0!==r&&r.includes("blob")?null===(i=window)||void 0===i||null===(o=i.player)||void 0===o?void 0:o.getSource():d,null===(a=d)||void 0===a||!a.includes("m3u8")){e.next=19;break}return e.next=6,E(d);case 6:if(!((null==(p=e.sent)?void 0:p.length)>0)){e.next=17;break}return m=(null==p?void 0:p[0])||null,v=m.uri,f=d.substring(0,d.lastIndexOf("/"))+"/",e.next=12,T(f,v);case 12:return h=e.sent,e.next=15,N(h);case 15:g=e.sent,u.thumbnails(g);case 17:e.next=28;break;case 19:if(null===(l=d)||void 0===l||!l.includes("mpd")){e.next=28;break}return e.next=22,A(d);case 22:if(!((null==(x=e.sent)?void 0:x.length)>0)){e.next=28;break}return e.next=26,N(x);case 26:y=e.sent,u.thumbnails(y);case 28:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function M(e,n){var r=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var o=document.createElement("div");o.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(i),a.alt="Provider Image",o.append(a),r.el().appendChild(o),r.on("useractive",(function(){o.classList.remove("vjs-fade")})),r.on("userinactive",(function(){r.paused()||o.classList.add("vjs-fade")})),r.on("fullscreenchange",(function(){r.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}}export{g as a,M as b,B as i};
1
+ import e from"@babel/runtime/helpers/toConsumableArray";import{g as t}from"./skin-612c987b.js";import{O as n,c as r,g as i}from"./generic-d124edfc.js";import{s as o}from"./autoNextVideo-12394cdf.js";import a from"@babel/runtime/helpers/typeof";import l from"video.js";import u from"@babel/runtime/helpers/asyncToGenerator";import s from"@babel/runtime/regenerator";import c from"@babel/runtime/helpers/defineProperty";import d from"@babel/runtime/helpers/slicedToArray";var p,m,v,f,h=[],g=function(i,o){var a;if(null!=o&&null!==(a=o.series)&&void 0!==a&&a.enable){var l;h=[];var u=r();null==u||u.map((function(t){var n;return(n=h).push.apply(n,e(t.episodes))})),null==o||null===(l=o.series)||void 0===l||l.cb}else{var s,c;h=(null==o||null===(s=o.relatedVideos)||void 0===s?void 0:s.content)||[],null==o||null===(c=o.relatedVideos)||void 0===c||c.cb}var d=t(i);d.on("timeupdate",(function(){var e,t,r=Math.floor(d.currentTime()),i=d.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-r<=10&&n()<=(null===(t=h)||void 0===t?void 0:t.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}));var p,m=h.filter((function(e,t){return t==n()}));if((null==m?void 0:m.length)>0)if(null!==(p=document.getElementsByClassName("next-ep-preview"))&&void 0!==p&&p[0]){var v,f,g,y,b,w,E,C,N,k,T,A;(null===(v=document.getElementsByClassName("next-ep-preview"))||void 0===v?void 0:v[0]).style.visibility="hidden";var L=null===(f=document.getElementsByClassName("next-ep-title"))||void 0===f?void 0:f[0],B=null===(g=document.getElementsByClassName("next-ep-img"))||void 0===g?void 0:g[0],I=null===(y=document.getElementsByClassName("next-ep-content"))||void 0===y?void 0:y[0],M=null===(b=m[0])||void 0===b?void 0:b.title;(null===(w=M)||void 0===w?void 0:w.length)>60&&(M=M.substr(0,60)+"..."),L.textContent="".concat(M),B.src=(null===(E=m[0])||void 0===E||null===(C=E.gist)||void 0===C||null===(N=C.imageGist)||void 0===N?void 0:N.r16x9)||(null==m||null===(k=m[0])||void 0===k?void 0:k.img)||(null===(T=window)||void 0===T||null===(A=T.customData)||void 0===A?void 0:A.fallbackImage),I.onclick=function(){return x(i)}}else{var O,P,j,S,R,X,D,F,U=document.createElement("div");U.className="next-ep-preview",U.style.visibility="hidden",document.getElementById(i).append(U);var G=document.createElement("div");G.className="next-ep-header",G.textContent="Next up";var $=null===(O=m[0])||void 0===O?void 0:O.title,V=document.createElement("img");V.className="next-ep-img",V.src=(null===(P=m[0])||void 0===P||null===(j=P.gist)||void 0===j||null===(S=j.imageGist)||void 0===S?void 0:S.r16x9)||(null==m||null===(R=m[0])||void 0===R?void 0:R.img)||(null===(X=window)||void 0===X||null===(D=X.customData)||void 0===D?void 0:D.fallbackImage);var W=document.createElement("div");W.className="next-ep-title",(null===(F=$)||void 0===F?void 0:F.length)>60&&($=$.substr(0,60)+"..."),W.textContent="".concat($);var _=document.createElement("div");_.className="next-ep-content",_.append(V),_.append(W),_.onclick=function(){return x(i)},U.append(G),U.append(_)}},x=function(e,r){var i=t(e),a=Math.floor(i.currentTime());if(Math.floor(i.duration())!=a){i.pause(e);var l=n();o(l,e,h)}};function y(e){var t=e.split("\n"),n=[];return t.forEach((function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach((function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))})),n.push(r)}})),n}function b(e){return w.apply(this,arguments)}function w(){return(w=u(s.mark((function e(t){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var n=new Image;n.src=t.uri,n.crossOrigin="Anonymous";var r=[],i=t.layout.split("x"),o=d(i,2),a=o[0],l=o[1];n.onload=function(){var i=document.createElement("canvas");i.width=n.width,i.height=n.height,i.getContext("2d").drawImage(n,0,0,i.width,i.height);for(var o=i.width/l,u=i.height/a,s=0;s<a;s++)for(var c=0;c<l;c++){var d=document.createElement("canvas");d.width=o,d.height=u,d.getContext("2d").drawImage(i,c*o,s*u,o,u,0,0,o,u);var p=d.toDataURL("image/png");r.push({uri:p,duration:t.duration})}e(r)},n.onerror=function(n){var r,i,o,a;e([{duration:t.duration,uri:"".concat(null===(r=window)||void 0===r||null===(i=r.app_data)||void 0===i||null===(o=i.appcmsMain)||void 0===o||null===(a=o.images)||void 0===a?void 0:a.placeholderCover)}])}})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function E(e){return C.apply(this,arguments)}function C(){return(C=u(s.mark((function e(t){var n,r;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t);case 3:return n=e.sent,e.next=6,n.text();case 6:return r=e.sent,e.abrupt("return",y(r));case 10:e.prev=10,e.t0=e.catch(0),console.error("Error fetching the M3U8 manifest:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function N(e){return k.apply(this,arguments)}function k(){return(k=u(s.mark((function e(t){var n,r;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map((function(e){return b(e)})));case 2:return n=e.sent.flat(),r={},n.map((function(e,t){var n,i=e.duration;r[i*t]={src:e.uri,style:(n={left:"-60px",height:"85px",width:"130px"},c(n,"left","-60px"),c(n,"border","1px solid transparent"),c(n,"borderRadius","4px"),n)}})),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}p={0:{src:"example-thumbnail.png"}},m=function e(){var t,n,r,i,o;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(o in i=t[r])i.hasOwnProperty(o)&&("object"===a(i[o])?n[o]=e(n[o],i[o]):n[o]=i[o]);return n},v=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},f=function e(t){return"HTML"!==t.nodeName&&"static"===v(t)("position")?e(t.offsetParent):t},l.registerPlugin("thumbnails",(function(e){var t,n,r,i,o,a,l,u;function s(){document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",s),u()}n=m({},p,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",r=document.createElement("img"),t.appendChild(r),r.src=n[0].src,r.className="vjs-thumbnail",m(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),a=i.duration(),i.on("durationchange",(function(e){a=i.duration()})),i.on("loadedmetadata",(function(e){a=i.duration()})),(o=i.controlBar.progressControl).el().appendChild(t),l=function(e){var i,l,u,s,c,d,p,h,g,x;for(l in u=0,g=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,p=((x=f(o.el()).getBoundingClientRect()).width||x.right)+g,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=f(o.el()).getBoundingClientRect().left+g,i=Math.floor((s-o.el().offsetLeft)/o.width()*a),n)i>l&&(u=Math.max(u,l));(c=n[u]).src&&r.src!=c.src&&(r.src=c.src),c.style&&r.style!=c.style&&m(r.style,c.style),s+(h=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=v(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(r,c.width||n[0].width)/2)>p?s-=s+h-p:s<h&&(s=h),t.style.left=s+"px"},o.on("mousemove",l),o.on("touchmove",l),o.on("pointerdown",(function(e){console.log(e),document.addEventListener("pointermove",l),document.addEventListener("pointerup",s)})),u=function(e){t.style.left="-1000px"},o.on("mouseout",u),o.on("touchcancel",u),o.on("touchend",u),i.on("userinactive",u)}));var T=function(){var e=u(s.mark((function e(t,n){var r,i,o,a;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5:return i=e.sent,o=i.split("\n"),a=[],o.forEach((function(e,n){e=e.trim();var r={resolution:null,duration:null,uri:null,layout:null};n>0&&o[n-1].includes("#EXT-X-TILES")&&(o[n-1]=o[n-1].split(","),r.uri=t+e,o[n-1].forEach((function(e){(e.includes(":")?e.split(":")[1]:e).split(",").forEach((function(e){var t=e.split("="),n=d(t,2),i=n[0],o=n[1];i=i.toLowerCase(),r[i]=o}))})),a.push(r))})),e.abrupt("return",a);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function A(e){return L.apply(this,arguments)}function L(){return(L=u(s.mark((function e(t){var n,r,o,a,l,u,c,p,m,v,f,h,g,x,y,b,w,E,C,N,k,T,A,L,B,I,M,O,P,j;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.split("/").slice(0,t.split("/").indexOf("dash")+1).join("/")||t,e.prev=1,e.next=4,fetch(t);case 4:return u=e.sent,e.next=7,u.text();case 7:c=e.sent,p=new DOMParser,m=p.parseFromString(c,"application/xml"),v=null===(r=i())||void 0===r||null===(o=r.video)||void 0===o?void 0:o.runtime,f=(null==m||null===(a=m.getElementsByTagName("BaseURL"))||void 0===a||null===(l=a[0])||void 0===l?void 0:l.textContent)||n,h=m.getElementsByTagName("AdaptationSet"),g=0;case 14:if(!(g<h.length)){e.next=38;break}if(("image"!==(x=h[g]).getAttribute("contentType")||"image/png"!==x.getAttribute("mimeType"))&&"image/jpeg"!==x.getAttribute("mimeType")){e.next=35;break}if(y=x.getElementsByTagName("SegmentTemplate")[0],b=x.getElementsByTagName("Representation")[0],w=b.getElementsByTagName("EssentialProperty")[0],E=w.getAttribute("value"),C=null==E?void 0:E.split("x"),N=d(C,2),k=N[0],T=N[1],!y){e.next=35;break}for(y.getAttribute("media"),A=y.getAttribute("duration"),L=y.getAttribute("timescale"),B=A/(L||A/(k*T)),I=b.getAttribute("id"),M=Math.round(v/B),O=Math.ceil(M/k*T),P=y.getAttribute("media"),j=[],g=0;g<O;g++)j.push({duration:B,layout:E,uri:f+P.replace("$Number$",g).replace("$RepresentationID$",I)});return e.abrupt("return",j);case 35:g++,e.next=14;break;case 38:return console.log("No trickplay segment found."),e.abrupt("return",null);case 42:e.prev=42,e.t0=e.catch(1),console.error("Error fetching or parsing MPD:",e.t0);case 45:case"end":return e.stop()}}),e,null,[[1,42]])})))).apply(this,arguments)}function B(e){return I.apply(this,arguments)}function I(){return(I=u(s.mark((function e(n){var r,i,o,a,l,u,c,d,p,m,v,f,h,g,x,y;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=t(n),c=u.currentSource(),d=c.src,d=null!==(r=d)&&void 0!==r&&r.includes("blob")?null===(i=window)||void 0===i||null===(o=i.player)||void 0===o?void 0:o.getSource():d,null===(a=d)||void 0===a||!a.includes("m3u8")){e.next=19;break}return e.next=6,E(d);case 6:if(!((null==(p=e.sent)?void 0:p.length)>0)){e.next=17;break}return m=(null==p?void 0:p[0])||null,v=m.uri,f=d.substring(0,d.lastIndexOf("/"))+"/",e.next=12,T(f,v);case 12:return h=e.sent,e.next=15,N(h);case 15:g=e.sent,u.thumbnails(g);case 17:e.next=28;break;case 19:if(null===(l=d)||void 0===l||!l.includes("mpd")){e.next=28;break}return e.next=22,A(d);case 22:if(!((null==(x=e.sent)?void 0:x.length)>0)){e.next=28;break}return e.next=26,N(x);case 26:y=e.sent,u.thumbnails(y);case 28:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function M(e,n){var r=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var o=document.createElement("div");o.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(i),a.alt="Provider Image",o.append(a),r.el().appendChild(o),r.on("useractive",(function(){o.classList.remove("vjs-fade")})),r.on("userinactive",(function(){r.paused()||o.classList.add("vjs-fade")})),r.on("fullscreenchange",(function(){r.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}}export{g as a,M as b,B as i};