@viewlift/player-backup 2.0.73-smartTv → 2.0.74-smartTv

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 (215) hide show
  1. package/cjs/{autoNextVideo-1f49211b.js → autoNextVideo-b7e91ff3.js} +1 -1
  2. package/cjs/bundle.css +2 -2
  3. package/cjs/{features-43b5c4f0.js → features-6abeaa09.js} +1 -1
  4. package/cjs/{generic-eff9f2d5.js → generic-6bf3ba02.js} +1 -1
  5. package/cjs/{index-0243ab75.js → index-2ee2a39b.js} +1 -1
  6. package/cjs/{index-2414bf78.js → index-391dd643.js} +1 -1
  7. package/cjs/index.js +1 -1
  8. package/cjs/{multicamv2-4152c3fb.js → multicamv2-421ec910.js} +1 -1
  9. package/cjs/{multicamv2-97f57710.js → multicamv2-4fdb520e.js} +1 -1
  10. package/cjs/{nextEpisodeButton-2f8a5dcf.js → nextEpisodeButton-076f0135.js} +1 -1
  11. package/cjs/{playlist-261f3571.js → playlist-3861f880.js} +1 -1
  12. package/cjs/{series-50af9773.js → series-3e119ba2.js} +1 -1
  13. package/cjs/{series-v2-138050e8.js → series-v2-26d49c70.js} +1 -1
  14. package/cjs/{series-v2-07ce65b0.js → series-v2-88c9fe30.js} +1 -1
  15. package/cjs/{skin-62650b0f.js → skin-0131ea28.js} +1 -1
  16. package/cjs/{skin-88b9e5b1.js → skin-5192bd86.js} +1 -1
  17. package/cjs/{skin-c02dde27.js → skin-75c04f58.js} +1 -1
  18. package/cjs/{skin-3bdd38e0.js → skin-beebad4a.js} +1 -1
  19. package/cjs/{skin-b79a429d.js → skin-eaccb61e.js} +1 -1
  20. package/cjs/{skin-10e868b9.js → skin-ebf1c61b.js} +1 -1
  21. package/cjs/{skin-3117b6f1.js → skin-ff25c748.js} +1 -1
  22. package/cjs/{videoSelector-bccb16ce.js → videoSelector-5e111200.js} +1 -1
  23. package/cjs/{videoSelector-338918fc.js → videoSelector-6171c2a7.js} +1 -1
  24. package/esm/{autoNextVideo-3f83b349.js → autoNextVideo-69a951c0.js} +1 -1
  25. package/esm/bundle.css +2 -2
  26. package/esm/{features-b4c00ff4.js → features-9a994afb.js} +1 -1
  27. package/esm/{generic-d14a701a.js → generic-ecdd66bc.js} +1 -1
  28. package/esm/{index-2257f4dd.js → index-82c877d2.js} +1 -1
  29. package/esm/{index-7e56199c.js → index-962dee5d.js} +1 -1
  30. package/esm/index.js +1 -1
  31. package/esm/{multicamv2-d637c59b.js → multicamv2-623eca21.js} +1 -1
  32. package/esm/{multicamv2-0545a0ae.js → multicamv2-6b4b899a.js} +1 -1
  33. package/esm/{nextEpisodeButton-3bdc1a02.js → nextEpisodeButton-36ca385c.js} +1 -1
  34. package/esm/{playlist-15c1cf5a.js → playlist-854a1c2a.js} +1 -1
  35. package/esm/{series-dc5effb9.js → series-ef0753e5.js} +1 -1
  36. package/esm/{series-v2-9b928249.js → series-v2-6d69b4c4.js} +1 -1
  37. package/esm/{series-v2-6ab87b3b.js → series-v2-9cec905e.js} +1 -1
  38. package/esm/{skin-0816e9e9.js → skin-1ce04d9e.js} +1 -1
  39. package/esm/{skin-049e3470.js → skin-290e8407.js} +1 -1
  40. package/esm/{skin-6308bce9.js → skin-5f4514f0.js} +1 -1
  41. package/esm/{skin-4d7c7bee.js → skin-6c7025a3.js} +1 -1
  42. package/esm/{skin-374cfb40.js → skin-c82837a4.js} +1 -1
  43. package/esm/{skin-a9e96e66.js → skin-ea45bc48.js} +1 -1
  44. package/esm/{skin-1ef7495f.js → skin-f339b646.js} +1 -1
  45. package/esm/{videoSelector-5275b274.js → videoSelector-e8d8f5e5.js} +1 -1
  46. package/esm/{videoSelector-05c05c24.js → videoSelector-fec759ed.js} +1 -1
  47. package/package.json +1 -1
  48. package/cjs/autoNextVideo-50bf0bcb.js +0 -1
  49. package/cjs/autoNextVideo-836d16c3.js +0 -1
  50. package/cjs/autoNextVideo-fb6d3116.js +0 -1
  51. package/cjs/autoNextVideo-ff4a5872.js +0 -1
  52. package/cjs/features-48d14d21.js +0 -1
  53. package/cjs/features-9ff981d6.js +0 -1
  54. package/cjs/features-d5a19c52.js +0 -1
  55. package/cjs/features-e8393717.js +0 -1
  56. package/cjs/generic-270e0c0e.js +0 -1
  57. package/cjs/generic-9dbaac2c.js +0 -1
  58. package/cjs/generic-b8561129.js +0 -1
  59. package/cjs/generic-c3ef1a4c.js +0 -1
  60. package/cjs/index-1b366d64.js +0 -1
  61. package/cjs/index-27816143.js +0 -1
  62. package/cjs/index-4282d6c8.js +0 -1
  63. package/cjs/index-7d0e79b0.js +0 -1
  64. package/cjs/index-7deb8e51.js +0 -1
  65. package/cjs/index-952059d8.js +0 -1
  66. package/cjs/index-a5bc95df.js +0 -1
  67. package/cjs/index-f8f03b72.js +0 -1
  68. package/cjs/multicamv2-4a03ff7a.js +0 -1
  69. package/cjs/multicamv2-59658c00.js +0 -1
  70. package/cjs/multicamv2-733a4c98.js +0 -1
  71. package/cjs/multicamv2-afab5e59.js +0 -1
  72. package/cjs/multicamv2-b0297c16.js +0 -1
  73. package/cjs/multicamv2-e582b219.js +0 -1
  74. package/cjs/multicamv2-e60917aa.js +0 -1
  75. package/cjs/multicamv2-f25bdf97.js +0 -1
  76. package/cjs/nextEpisodeButton-458c85bb.js +0 -1
  77. package/cjs/nextEpisodeButton-b62010fa.js +0 -1
  78. package/cjs/nextEpisodeButton-db512765.js +0 -1
  79. package/cjs/nextEpisodeButton-dbbf6459.js +0 -1
  80. package/cjs/playlist-452d88c2.js +0 -1
  81. package/cjs/playlist-da8132ef.js +0 -1
  82. package/cjs/playlist-dc7fd81d.js +0 -1
  83. package/cjs/playlist-f6dc47d2.js +0 -1
  84. package/cjs/series-5379adf3.js +0 -1
  85. package/cjs/series-62cf13d7.js +0 -1
  86. package/cjs/series-f93fa395.js +0 -1
  87. package/cjs/series-fa977c7b.js +0 -1
  88. package/cjs/series-v2-1540a570.js +0 -1
  89. package/cjs/series-v2-26fac2cb.js +0 -1
  90. package/cjs/series-v2-446ef683.js +0 -1
  91. package/cjs/series-v2-5db6fcc5.js +0 -1
  92. package/cjs/series-v2-a0ce7016.js +0 -1
  93. package/cjs/series-v2-aeb231ee.js +0 -1
  94. package/cjs/series-v2-dbf8f5c5.js +0 -1
  95. package/cjs/series-v2-f1dbee5e.js +0 -1
  96. package/cjs/skin-02cc96c7.js +0 -1
  97. package/cjs/skin-0d2d9d9c.js +0 -1
  98. package/cjs/skin-11200134.js +0 -1
  99. package/cjs/skin-1fb711b8.js +0 -1
  100. package/cjs/skin-251297dc.js +0 -1
  101. package/cjs/skin-28e40e43.js +0 -1
  102. package/cjs/skin-389e200a.js +0 -1
  103. package/cjs/skin-3e832338.js +0 -1
  104. package/cjs/skin-408082dc.js +0 -1
  105. package/cjs/skin-4e3109f5.js +0 -1
  106. package/cjs/skin-5e026b9e.js +0 -1
  107. package/cjs/skin-5e6de97a.js +0 -1
  108. package/cjs/skin-66bb1abb.js +0 -1
  109. package/cjs/skin-71bb1a0a.js +0 -1
  110. package/cjs/skin-7cd44fdf.js +0 -1
  111. package/cjs/skin-7de5dd6b.js +0 -1
  112. package/cjs/skin-9319e6f5.js +0 -1
  113. package/cjs/skin-95078d13.js +0 -1
  114. package/cjs/skin-a4de7dc7.js +0 -1
  115. package/cjs/skin-a9258d0d.js +0 -1
  116. package/cjs/skin-c165b563.js +0 -1
  117. package/cjs/skin-d1c415fe.js +0 -1
  118. package/cjs/skin-d7cd2ac9.js +0 -1
  119. package/cjs/skin-db8f3b08.js +0 -1
  120. package/cjs/skin-e0505707.js +0 -1
  121. package/cjs/skin-eb1292bc.js +0 -1
  122. package/cjs/skin-f0dbcafa.js +0 -1
  123. package/cjs/skin-fc778d21.js +0 -1
  124. package/cjs/videoSelector-3ab7f937.js +0 -1
  125. package/cjs/videoSelector-913574c8.js +0 -1
  126. package/cjs/videoSelector-9dba4d4f.js +0 -1
  127. package/cjs/videoSelector-c371fba4.js +0 -1
  128. package/cjs/videoSelector-c8c41440.js +0 -1
  129. package/cjs/videoSelector-d6d0e1ae.js +0 -1
  130. package/cjs/videoSelector-e2c21c25.js +0 -1
  131. package/cjs/videoSelector-eea96e59.js +0 -1
  132. package/esm/autoNextVideo-63dbac74.js +0 -1
  133. package/esm/autoNextVideo-793707f8.js +0 -1
  134. package/esm/autoNextVideo-b51e19f4.js +0 -1
  135. package/esm/autoNextVideo-f6f0062e.js +0 -1
  136. package/esm/features-005cbf2c.js +0 -1
  137. package/esm/features-6746c29c.js +0 -1
  138. package/esm/features-cc91a503.js +0 -1
  139. package/esm/features-e7e14dda.js +0 -1
  140. package/esm/generic-0d71c851.js +0 -1
  141. package/esm/generic-258d34e7.js +0 -1
  142. package/esm/generic-817644b6.js +0 -1
  143. package/esm/generic-9a919ba4.js +0 -1
  144. package/esm/index-11827a9e.js +0 -1
  145. package/esm/index-5312b88e.js +0 -1
  146. package/esm/index-5c199c09.js +0 -1
  147. package/esm/index-6d959e99.js +0 -1
  148. package/esm/index-7b9ff142.js +0 -1
  149. package/esm/index-9327e721.js +0 -1
  150. package/esm/index-b559de16.js +0 -1
  151. package/esm/index-c0023a66.js +0 -1
  152. package/esm/multicamv2-1656a706.js +0 -1
  153. package/esm/multicamv2-170df815.js +0 -1
  154. package/esm/multicamv2-2b22eed0.js +0 -1
  155. package/esm/multicamv2-3cb2c96b.js +0 -1
  156. package/esm/multicamv2-469790c5.js +0 -1
  157. package/esm/multicamv2-7d0dc57f.js +0 -1
  158. package/esm/multicamv2-fa150bd7.js +0 -1
  159. package/esm/multicamv2-fe3eda2b.js +0 -1
  160. package/esm/nextEpisodeButton-4fe59bd5.js +0 -1
  161. package/esm/nextEpisodeButton-c6968fe4.js +0 -1
  162. package/esm/nextEpisodeButton-d18af0e3.js +0 -1
  163. package/esm/nextEpisodeButton-f3651707.js +0 -1
  164. package/esm/playlist-1fc22b9e.js +0 -1
  165. package/esm/playlist-2131b25d.js +0 -1
  166. package/esm/playlist-3e586e91.js +0 -1
  167. package/esm/playlist-4f7cdb85.js +0 -1
  168. package/esm/series-04163ae5.js +0 -1
  169. package/esm/series-093b9d99.js +0 -1
  170. package/esm/series-3d86f785.js +0 -1
  171. package/esm/series-e696078a.js +0 -1
  172. package/esm/series-v2-6beb4cc3.js +0 -1
  173. package/esm/series-v2-76fe35d9.js +0 -1
  174. package/esm/series-v2-7afbd3dc.js +0 -1
  175. package/esm/series-v2-7d2aef8f.js +0 -1
  176. package/esm/series-v2-837b160e.js +0 -1
  177. package/esm/series-v2-aeb7ed74.js +0 -1
  178. package/esm/series-v2-dea9bcde.js +0 -1
  179. package/esm/series-v2-e0e817a0.js +0 -1
  180. package/esm/skin-08b2a668.js +0 -1
  181. package/esm/skin-287d98f0.js +0 -1
  182. package/esm/skin-367d2640.js +0 -1
  183. package/esm/skin-3688bf2d.js +0 -1
  184. package/esm/skin-48246846.js +0 -1
  185. package/esm/skin-49eb5647.js +0 -1
  186. package/esm/skin-5a4f7dff.js +0 -1
  187. package/esm/skin-61d92027.js +0 -1
  188. package/esm/skin-6290413d.js +0 -1
  189. package/esm/skin-68d81ff0.js +0 -1
  190. package/esm/skin-6f7eb9bb.js +0 -1
  191. package/esm/skin-6fb58468.js +0 -1
  192. package/esm/skin-77856587.js +0 -1
  193. package/esm/skin-7d9a1801.js +0 -1
  194. package/esm/skin-7f756cf9.js +0 -1
  195. package/esm/skin-8563e89f.js +0 -1
  196. package/esm/skin-8892d0cc.js +0 -1
  197. package/esm/skin-9701a9b0.js +0 -1
  198. package/esm/skin-9b61d1eb.js +0 -1
  199. package/esm/skin-ad92ef73.js +0 -1
  200. package/esm/skin-b56ca7dd.js +0 -1
  201. package/esm/skin-b64164a9.js +0 -1
  202. package/esm/skin-c3287a11.js +0 -1
  203. package/esm/skin-c360d3a7.js +0 -1
  204. package/esm/skin-d5e0b3e0.js +0 -1
  205. package/esm/skin-dfd47b2e.js +0 -1
  206. package/esm/skin-ec925239.js +0 -1
  207. package/esm/skin-f2961805.js +0 -1
  208. package/esm/videoSelector-0e2a85dc.js +0 -1
  209. package/esm/videoSelector-16ae6e6d.js +0 -1
  210. package/esm/videoSelector-4230d7f6.js +0 -1
  211. package/esm/videoSelector-93165559.js +0 -1
  212. package/esm/videoSelector-ce7a4a33.js +0 -1
  213. package/esm/videoSelector-d4e66214.js +0 -1
  214. package/esm/videoSelector-e3a73107.js +0 -1
  215. package/esm/videoSelector-fc9959a8.js +0 -1
@@ -1 +0,0 @@
1
- import e from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import t from"video.js";import i from"axios";import{g as o,c as r}from"./skin-8e2c5488.js";import{i as l,d as a}from"./browser-512cd55a.js";import d from"js-cookie";import{UAParser as u}from"ua-parser-js";import{a as s,r as c}from"./captions-7996e045.js";function v(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function m(e){window.dataLayer=window.dataLayer||[],v("js",new Date),v("config",e)}function f(e,n){v("event",e,n)}var I={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"},p={name:"@viewlift/player-backup",version:"2.0.70-smartTv",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","ua-parser-js":"^2.0.3","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"},browserslist:["chrome > 38, safari > 7"]};window.vl_player_version=p.version;var g,w=function(e,n){var t,o,r,l,a,d,u,s;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):i({url:null!==(a=window)&&void 0!==a&&null!==(d=a.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==I?void 0:I.getVideoDetails),params:Object.assign({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":p.version},withCredentials:!0})},E=function(e,n){var t,o,r,l;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):i({url:F.get()+I.getLinearChannelDetails,params:Object.assign({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===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},T=function(e,n){var t,o,r=U(n),l=(null==r?void 0:r.site)||null;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.seriesData?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.seriesData})}):i({url:F.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:n}})},h=function(){var t=e(n.mark(function e(t){var o;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B();case 2:return o=e.sent,e.abrupt("return",i({url:F.get()+"".concat(null==I?void 0:I.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:Object.assign({},t),params:Object.assign({},(null==t?void 0:t.profileId)&&{profileId:null==t?void 0:t.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(e){return t.apply(this,arguments)}}(),_=function(e,n){var t,o,r=window.contentType;return i({method:"GET",url:F.get()+"".concat(null==I?void 0:I.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(o=t.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},y=function(e){var n=e.videoId;return i({method:"GET",url:F.get()+"".concat(null==I?void 0:I.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},F=(g=null==I?void 0:I.apiBaseUrl,{set:function(e){e&&(g=e)},get:function(){return g}}),b=function(e,n,t,o){return i({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==o?void 0:o.latitude,longitude:null==o?void 0:o.longitude},method:"GET",headers:{Authorization:n},withCredentials:!0})},D=function(e){var n=JSON.parse(atob(null==e?void 0:e.split(".")[1])),t=null==n?void 0:n.exp;if(new Date(1e3*t).getTime()<(new Date).getTime())return!0},L=null;function R(){return{set:function(e){e&&(L=e)},get:function(){return L}}}var V,S,W,O,C,P,A=function(){var t=e(n.mark(function e(){var t,o,r;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=R().get(),o=F.get(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(t)});case 5:return r=e.sent,e.abrupt("return",r);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 t.apply(this,arguments)}}(),N=null,B=function(){var t=e(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"))||!D(t)){e.next=6;break}return N||(N=A().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(){N=null})),e.abrupt("return",N);case 6:return e.abrupt("return",t);case 7:case"end":return e.stop()}},e)}));return function(){return t.apply(this,arguments)}}(),x=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return t&&!i&&(n=!1),n},U=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},M=function(e){S=e},j=function(){return S},k=function(e){V=e},H=function(){return V},G=function(){return W},z=function(e){W=e},Y=function(){return C},X=function(e){O=new Map,e.map(function(e,n){O.set(e.id,n)})},q=function(e){if(O){var n=O.get(e);z(n+1)}},J=(P=0,{set:function(e){e>=0&&(P=e)},get:function(){return P}}),K=0,Q=function(){var e,n,t,i,o,r,l,a=j();return"linearchannel"==((null==a?void 0:a.contentType)||"video")?null==a||null===(e=a.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find(function(e){return(null==e?void 0:e.id)===(null==a?void 0:a.channelId)}))||void 0===t||null===(i=t.content)||void 0===i?void 0:i.id:(null==a||null===(o=a.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id)||(null==a||null===(l=a.video)||void 0===l?void 0:l.id)||(null==a?void 0:a.id)};function Z(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function $(){var e=window.sessionStorage.getItem("uid");return e||(e=Z(),window.sessionStorage.setItem("uid",e),e)}function ee(){return ne.apply(this,arguments)}function ne(){return(ne=e(n.mark(function e(){var t,i;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B();case 2:if(!(t=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function te(e){return e?String(e):""}window.initialise=function(e){window.sid=Z(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var n=Math.floor(e.currentTime());e.on("error",function(){var t,i,o,r=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,f(r?"FAILED_TO_START":"DROPPED_STREAM",Object.assign({pfm:window.platform,uid:$(),vid:Q(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:n===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})},window.firstFrame=function(e,n){e.one("play",tryCatch(function(){var t,i,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),f("PLAY",Object.assign({pfm:window.platform,uid:$(),vid:Q(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.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}),n&&n("started_video_playback",{"Video ID":Q(),watchTime:Math.floor(e.currentTime())})}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:clearInterval(window.bufferingTimer)},100))}))},window.handleBufferTimer=function(e,n){var t,i;if(n.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(i=t.className)&&void 0!==i&&i.includes("vjs-waiting")&&K<4)K++,f("BUFFERING",Object.assign({pfm:window.platform,uid:$(),vid:Q(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var n,t,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,f("FIRST_FRAME",Object.assign({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:$(),vid:Q()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.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 n,t,i,o,r,l;f("AD_REQUEST",Object.assign({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:$(),vid:Q(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.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}),f("AD_IMPRESSION",Object.assign({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:$(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:Q()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})},window.ping=function(e){var n=[];e.on("timeupdate",function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!n.includes(t)&&(K=0,n.push(t),fireEvent({eventName:"PING",videoPosition:t,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var n=e.currentTime(),t=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(ie(n,r,l)){var a=Math.round(t-l);if(isFinite(a))return a}}})()};var ie=function(e,n,t){return e>=n&&e<=t};function oe(e,n){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var t=o(e);window.initialise(t,n),window.firstFrame(t,n),t.on("loadedmetadata",function(){window.endFirstFrame(t)})}}window.fireEvent=function(){var t=e(n.mark(function e(t){var o,r,l,a,d,u,s,c,v,m,f,p,g,w,E,T,h,_,y,b;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B();case 2:return T=e.sent,h=U(T),_=null==h?void 0:h.site,y=null==h?void 0:h.siteId,e.t0=Object,e.t1={aid:_,cid:y,pfm:window.platform},e.t2=null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params,e.t3=$(),e.t4=Q(),e.t5=t.url||document.location.href,e.t6=t.ref||document.referrer,e.t7=t.eventName,e.t8=null!==(a=t.videoPosition)&&void 0!==a?a:null,e.t9=window.environment,e.t10=t.dp1||"",e.t11=t.dp2||"",e.t12=t.dp3||"",e.t13=t.dp4||"",e.t14=t.dp5||"",e.t15=!0===t.isAdEvent?t.videoPosition:null,e.t16=!0===t.isAdEvent?te(t.adPosition):"",e.next=25,ee();case 25:e.t17=e.sent,e.t18=t.playerType||"native",e.t19=t.mediaType||"VIDEO",e.t20=window.sid,e.t21=null!==(d=t.ttFirstFrame)&&void 0!==d?d:null,e.t22=null!==(u=t.bitrate)&&void 0!==u?u:null,e.t23=null!==(s=t.resHeight)&&void 0!==s?s:null,e.t24=null!==(c=t.resWidth)&&void 0!==c?c:null,e.t25=null!==(v=t.bufferHealth)&&void 0!==v?v:null,e.t26={uid:e.t3,vid:e.t4,url:e.t5,ref:e.t6,pa:e.t7,vpos:e.t8,environment:e.t9,dp1:e.t10,dp2:e.t11,dp3:e.t12,dp4:e.t13,dp5:e.t14,apos:e.t15,apod:e.t16,profid:e.t17,player:e.t18,media_type:e.t19,stream_id:e.t20,embedurl:"",ttfirstframe:e.t21,bitrate:e.t22,connectionspeed:null,resolutionheight:e.t23,resolutionwidth:e.t24,bufferhealth:e.t25},e.t27=(null==t?void 0:t.duration)&&{duration:t.duration},e.t28=null===(m=window)||void 0===m||null===(f=m.customData)||void 0===f||null===(p=f.beacon)||void 0===p?void 0:p.params,e.t29=e.t0.assign.call(e.t0,e.t1,e.t2,e.t26,e.t27,e.t28),b=[e.t29],i({url:(null===(g=window)||void 0===g||null===(w=g.customData)||void 0===w||null===(E=w.beacon)||void 0===E?void 0:E.url)||F.get()+I.getBeaconUrl,method:"post",headers:{Authorization:T},contentType:"application/x-www-form-urlencoded",dataType:"text",data:b}).catch(function(e){console.error(e)});case 40:case"end":return e.stop()}},e)}));return function(e){return t.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var re=function(e,n){var t=new Map;y({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),C=t}).catch(function(e){return console.log(e)})},le=function(){var e=J.get();return e>=0?e+1:1},ae=function(){var e,n,t,i=H(),o=j(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,l=J.get(),a=null==i||null===(n=i[l])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex(function(e){return(null==e?void 0:e.id)===r});return a>=0?a+1:1};window._deviceInfo=u(navigator.userAgent);var de=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},ue=function(e){var n=se(e,"video.tags",[]),t=se(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},se=function(e,n,t){for(var i=0,o=(n=n.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[n[i]]}return e||t},ce=function(){var e,n,t,i,r,l,a,u,s,c,v,m,f,I,p,g,w,E,T,h,_,y=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",F=arguments.length>1?arguments[1]:void 0,b=arguments.length>2?arguments[2]:void 0,D=(null==b?void 0:b.siteName)||"",L=(null==b?void 0:b.contentType)||"video",R=(null==b||null===(e=b[L])||void 0===e?void 0:e.metadata)||(null==b||null===(n=b[L])||void 0===n||null===(t=n.gist)||void 0===t?void 0:t.metadata),V=o(F);if(!y.includes("VIEWLIFT_"))return y;var S,W=window.getComputedStyle(document.getElementById(F),null),O=Math.trunc(W.getPropertyValue("height").slice(0,-2)),C=Math.trunc(W.getPropertyValue("width").slice(0,-2)),P="linearchannel"===L?null==b||null===(i=b.linearchannel)||void 0===i||null===(r=i.channels)||void 0===r||null===(l=r.find(function(e){return(null==e?void 0:e.id)===(null==b?void 0:b.channelId)}))||void 0===l||null===(a=l.content)||void 0===a?void 0:a.id:se(b,"video.gist.id",""),A="linearchannel"===L?null==b||null===(u=b.linearchannel)||void 0===u||null===(s=u.channels)||void 0===s||null===(c=s.find(function(e){return(null==e?void 0:e.id)===(null==b?void 0:b.channelId)}))||void 0===c?void 0:c.title:se(b,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),N=null,B=null;"function"==typeof window.__gpp&&(null===(S=window)||void 0===S||S.__gpp("ping",function(e){N=null==e?void 0:e.gppString,B=null==e?void 0:e.sectionList[0]}));var x=Object.assign({},ve(R),{VIEWLIFT_WIDTH:C,VIEWLIFT_HEIGHT:O,VIEWLIFT_SIZE:de(C,O),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===(v=window)||void 0===v?void 0:v.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:se(b,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:se(b,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:se(b,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==V||null===(m=V.options_)||void 0===m?void 0:m.autoplay)||1,VIEWLIFT_MUTE:(null==V||null===(f=V.options_)||void 0===f?void 0:f.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==D?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:ue(b),VIEWLIFT_MEDIA_ID:P,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(se(b,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:P,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+se(b,"video.gist.permalink","")),VIEWLIFT_CONSENT:d.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:se(null===(I=window)||void 0===I||null===(p=I.app_data)||void 0===p||null===(g=p.site)||void 0===g?void 0:g.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_GDPR:"spinco"==D?"":se(null===(w=window)||void 0===w||null===(E=w.app_data)||void 0===E||null===(T=E.site)||void 0===T?void 0:T.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*se(b,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:se(b,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:P,VIEWLIFT_CONTENT_TITLE:A,VIEWLIFT_CONTENT_SERIES_TITLE:se(b,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:se(b,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ae(),VIEWLIFT_SEASON_NUMBER:le(),VIEWLIFT_CONTENT_TAGS:ue(b),VIEWLIFT_GPP_SID:B||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:N||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},null===(h=window)||void 0===h||null===(_=h.customData)||void 0===_?void 0:_.macros);for(var U in x){var M=new RegExp(U,"g");y=y.replace(M,x[U])}return y},ve=function(e){var n,t,i,o,r,a,d;if(null!==(n=window)&&void 0!==n&&n.customData.isSmartTV)return me(u);var u={},s=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){s.set(e.name,e.value)}));var c=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.subscription)||void 0===o?void 0:o.SVOD)||!1,v=(null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a||null===(d=a.subscription)||void 0===d?void 0:d.TVE)||!1;return c||v?(l()?c?u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||""}):v&&(u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.mweb.tve")||""})):c?u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.web.dtc")||""}):v&&(u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.web.tve")||""})),c?u=Object.assign({},u,{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}):v&&(u=Object.assign({},u,{VIEWLIFT_SFID:s.get("sfid.tve")||s.get("sfid.web.tve")||""})),u=l()?Object.assign({},u,{VIEWLIFT_PROF:s.get("prof.mweb")||""}):Object.assign({},u,{VIEWLIFT_PROF:s.get("prof.web")||""})):(u=Object.assign({},u,{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}),u=l()?Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:s.get("prof.mweb")||""}):Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.web.dtc")||"",VIEWLIFT_PROF:s.get("prof.web")||""})),u=Object.assign({},u,{VIEWLIFT_AFID:s.get("afid")})},me=function(e){var n,t,i,o,r,l,a={},d=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){d.set(e.name,e.value)}));var u=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.subscription)||void 0===i?void 0:i.SVOD)||!1,s=(null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1;return(u||s)&&(s?(a=Object.assign({},a,{VIEWLIFT_SFID:d.get("sfid.tve")}),a="lgTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.lgtv.tve")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.viziotv.tve")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xfinity.tve")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xbox.tve")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.samsungtv.tve")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""})):(a=Object.assign({},a,{VIEWLIFT_SFID:d.get("sfid.dtc")}),a="lgTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.lgtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.viziotv.dtc")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xfinity.dtc")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xbox.dtc")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.samsungtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""}))),a},fe=function(e){var n=null;try{var t,i,o,r,l,a,d,u,s,c,v,m,f,I,p,g,w,E,T,h,_,y,F,b,D,L,R,V,S;if(null!==(t=window)&&void 0!==t&&t.customData.isSmartTV){if("samsungTv"==window.customData.device&&null!=e&&null!==(i=e.ads)&&void 0!==i&&null!==(o=i.preRoll)&&void 0!==o&&null!==(r=o.adTags)&&void 0!==r&&null!==(l=r.samsung_tv)&&void 0!==l&&l.active)n=null==e||null===(E=e.ads)||void 0===E||null===(T=E.preRoll)||void 0===T||null===(h=T.adTags)||void 0===h||null===(_=h.samsung_tv)||void 0===_?void 0:_.url;else if("lgTv"==window.customData.device&&null!=e&&null!==(a=e.ads)&&void 0!==a&&null!==(d=a.preRoll)&&void 0!==d&&null!==(u=d.adTags)&&void 0!==u&&null!==(s=u.lg_tv)&&void 0!==s&&s.active){var W,O,C,P;n=null==e||null===(W=e.ads)||void 0===W||null===(O=W.preRoll)||void 0===O||null===(C=O.adTags)||void 0===C||null===(P=C.lg_tv)||void 0===P?void 0:P.url}else if("vizioTv"==window.customData.device&&null!=e&&null!==(c=e.ads)&&void 0!==c&&null!==(v=c.preRoll)&&void 0!==v&&null!==(m=v.adTags)&&void 0!==m&&null!==(f=m.vizioTv)&&void 0!==f&&f.active){var A,N,B,x;n=null==e||null===(A=e.ads)||void 0===A||null===(N=A.preRoll)||void 0===N||null===(B=N.adTags)||void 0===B||null===(x=B.vizioTv)||void 0===x?void 0:x.url}else if("xbox"==window.customData.device&&null!=e&&null!==(I=e.ads)&&void 0!==I&&null!==(p=I.preRoll)&&void 0!==p&&null!==(g=p.adTags)&&void 0!==g&&null!==(w=g.xbox)&&void 0!==w&&w.active){var U,M,j,k;n=null==e||null===(U=e.ads)||void 0===U||null===(M=U.preRoll)||void 0===M||null===(j=M.adTags)||void 0===j||null===(k=j.xbox)||void 0===k?void 0:k.url}}else n=(null==e||null===(y=e.ads)||void 0===y||null===(F=y.preRoll)||void 0===F||null===(b=F.adTags)||void 0===b||null===(D=b.web)||void 0===D?void 0:D.active)&&(null==e||null===(L=e.ads)||void 0===L||null===(R=L.preRoll)||void 0===R||null===(V=R.adTags)||void 0===V||null===(S=V.web)||void 0===S?void 0:S.url)}catch(e){}return n},Ie=function(e,n){var t,i,o,r,l,d,u,s,c,v,m,f,I,p=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[p])||void 0===t?void 0:t.drmEnabled,w=null==e||null===(i=e[p])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,E=null==e||null===(r=e[p])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.audioAssets,T=(null==e||null===(d=e[p])||void 0===d||null===(u=d.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var h=(null==e||null===(m=e[p])||void 0===m||null===(f=m.streamingInfo)||void 0===f||null===(I=f.videoAssets)||void 0===I?void 0:I.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 ge(E);if(g){var _=we(w,n);return _.src=ce(_.src,n,e),_}if("Safari"!==a()&&h)return pe(w);if(T){var y=ge(w);return y.src=ce(y.src,n,e),y}if(null!=w&&w.mpeg){var F=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(w);return F.src=ce(F.src,n,e),F}return null},pe=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},ge=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},we=function(e,n){var i=e.fairPlayCmaf||e.fairPlay,r=e.widevine,l=e.playReady,d=a();if(o(n),"Safari"===d){var u=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,i){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};t.xhr(o,function(e,n,t){console.log(e),e&&i(e),i(null,new Uint8Array(t))})},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,i,o,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:o,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};t.xhr(l,function(e,n,t){console.log(e),e&&r(e),r(null,t)})}}}}}(i);return Ee(n),u}var s,c={src:r.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(Ee(n),c.keySystems={"com.widevine.alpha":{url:r.licenseUrl,licenseHeaders:{"X-AxDRM-Message":r.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:r.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":r.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var Ee=function(e){var n=o(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==a()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},Te=function(e,n){var t=e.src,i=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:i};n=n.replace(/\/$/,"");var o=t.split(".com")[1]||"";return{src:o?"".concat(n).concat(o):t,type:i}},he=function(e,n){if(import("./error-2395864b.js").then(function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)}),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var 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(n),o.appendChild(r),i.append(o)}}},_e=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var ye=!1,Fe=function(e,n,t){var i=ce(n,e,t),r=o(e);if(n&&window.google){if("function"!=typeof r.ima)return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,n){var t,i,r,l=o(e);if(null!==l.el_){ye=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),ye&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,n,!0),l.ima.requestAds()},1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),l.one(u,function(){s&&l.ima.initializeAdDisplayContainer()});var c=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(r=i.ads)||void 0===r?void 0:r.adEventHandler)||null;l.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),l.one("ads-manager",function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})})}),l.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,i)}},be=function(e){t(e).play()},De=function(e){t(e).pause()},Le=function(e,n){var i=t(e),o=i.currentTime()+n;i.currentTime(o)},Re=function(e,n){var i=t(e),o=i.currentTime(),r=o<=n?0:o-n;i.currentTime(r)},Ve=function(e){return!!t.getPlayer("".concat(e))},Se=function(e){return t(e).paused()},We=function(){var t=e(n.mark(function e(t,i){var r,l,a,d=arguments;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=d.length>2&&void 0!==d[2]&&d[2],e.next=3,B();case 3:return l=e.sent,a=o(t),e.abrupt("return",new Promise(function(e,n){E(i,l).then(function(n){var o=null==n?void 0:n.data;window.sid=Z(),o.contentType="linearchannel",o.channelId=null==i?void 0:i.channelId;var l=Ie(o,t);M(o),l&&r?(Ne(t,l),a.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:o})})):e({status:!0,msg:"Feed authenticated",response:o})}).catch(function(e){n({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(e,n){return t.apply(this,arguments)}}(),Oe=function(){var t=e(n.mark(function e(t,i){var r,l,a,d,u,v,m=arguments;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(d=m.length>2&&void 0!==m[2]?m[2]:null){e.next=5;break}return e.next=4,B();case 4:d=e.sent;case 5:return(H()||null)&&q(i),u=0,v=0,null!==(r=window)&&void 0!==r&&r.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(a=l.watchHistory)&&void 0!==a&&a.enable&&_(i,d).then(function(e){var n,t,i,o,r,l;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),u=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,v=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null}).catch(function(e){var n,t,i,o;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.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){w(i,d).then(function(i){var r,l,a=null==i?void 0:i.data,d=(null==a||null===(r=a.video)||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;M(i.data);var m=fe(a);m&&Fe(t,m,a);var f=Ie(a,t);if(f){var I,p,g,w,E,T,h,_,y,F,b,D,L,R,V=(null==a||null===(I=a.video)||void 0===I||null===(p=I.gist)||void 0===p?void 0:p.videoImageUrl)||(null==a||null===(g=a.video)||void 0===g||null===(w=g.gist)||void 0===w||null===(E=w.imageGist)||void 0===E?void 0:E.r16x9),S=o(t);if(S.poster(V),Ne(t,f),S.on("loadstart",function(){d&&e({status:!0,msg:"Video Loaded",response:a})}),S.on("loadeddata",function(){_e(),e({status:!0,msg:"Video Loaded",response:a})}),S.one("play",function(){u&&v<95&&setTimeout(function(){S.currentTime(u)},0)}),S.one("error",function(){var e;n({status:!1,msg:(null==S||null===(e=S.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==a||null===(T=a.video)||void 0===T||null===(h=T.contentDetails)||void 0===h||null===(_=h.closedCaptions)||void 0===_?void 0:_.length)>0||(null==a||null===(y=a.video)||void 0===y||null===(F=y.closedCaptions)||void 0===F?void 0:F.length)>0)b=((null==a||null===(D=a.video)||void 0===D||null===(L=D.contentDetails)||void 0===L?void 0:L.closedCaptions)||(null==a||null===(R=a.video)||void 0===R?void 0:R.closedCaptions)).filter(function(e){return"VTT"===e.format}),s(t,b);else c(t)}else he(t,"Incompatible Source, only hls,mp4,drm content is allowed"),n("Incompatible Source, only hls,mp4,drm content is allowed")}).catch(function(e){Be(e,t,n,i)})}));case 11:case"end":return e.stop()}},e)}));return function(e,n){return t.apply(this,arguments)}}(),Ce=function(e,n,t){var i=o(e);return i.src(n),new Promise(function(e,n){var o=0;i.one("loadedmetadata",function(){clearTimeout(o),e({status:!0,msg:"video loaded"})}),i.one("loadstart",function(e){o=setTimeout(function(){n("FAILED: Took too long to load")},t)})})},Pe=function(e){var n=o(e);if(Ae(),r(),window.onresize=null,n)n.dispose();else{var t=document.getElementById(e);t&&t.remove()}},Ae=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()},Ne=function(e,n){var t=o(e);t&&t.src(n)},Be=function(e,n,t,i){var o,r,l,a,d,u,s=null==e||null===(o=e.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.errorCode,c=(null==e||null===(l=e.response)||void 0===l||null===(a=l.data)||void 0===a?void 0:a.errorMessage)||(null==e?void 0:e.message);Ve(n)&&he(n,(null===(d=window)||void 0===d?void 0:d.customErrors)&&(null===(u=window)||void 0===u?void 0:u.customErrors[s])||"".concat(c)),t&&t(Object.assign({status:!1,response:e,msg:"".concat(c)},i&&{videoId:i}))},xe=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var i=n.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=n.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")};export{T as A,re as B,J as C,k as D,Ce as E,be as F,De as G,Se as H,Ve as I,Oe as J,We as K,Pe as L,b as M,F as N,x as O,R as P,D as Q,m as R,G as S,z as T,y as U,q as V,X as W,ae as a,H as b,le as c,j as d,Ie as e,M as f,$ as g,_e as h,he as i,Y as j,Le as k,Ne as l,ce as m,fe as n,xe as o,oe as p,Fe as q,Re as r,h as s,Te as t,U as u,w as v,_ as w,Be as x,B as y,E as z};
@@ -1 +0,0 @@
1
- import e from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import t from"video.js";import i from"axios";import{g as o,c as r}from"./skin-8e2c5488.js";import{i as l,d as a}from"./browser-512cd55a.js";import d from"js-cookie";import{UAParser as u}from"ua-parser-js";import{a as s,r as c}from"./captions-7996e045.js";function v(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function m(e){window.dataLayer=window.dataLayer||[],v("js",new Date),v("config",e)}function f(e,n){v("event",e,n)}var I={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"},p={name:"@viewlift/player-backup",version:"2.0.71-smartTv",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","ua-parser-js":"^2.0.3","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"},browserslist:["chrome > 38, safari > 7"]};window.vl_player_version=p.version;var g,w=function(e,n){var t,o,r,l,a,d,u,s;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):i({url:null!==(a=window)&&void 0!==a&&null!==(d=a.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==I?void 0:I.getVideoDetails),params:Object.assign({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":p.version},withCredentials:!0})},E=function(e,n){var t,o,r,l;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):i({url:F.get()+I.getLinearChannelDetails,params:Object.assign({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===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},T=function(e,n){var t,o,r=U(n),l=(null==r?void 0:r.site)||null;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.seriesData?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.seriesData})}):i({url:F.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:n}})},h=function(){var t=e(n.mark(function e(t){var o;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B();case 2:return o=e.sent,e.abrupt("return",i({url:F.get()+"".concat(null==I?void 0:I.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:Object.assign({},t),params:Object.assign({},(null==t?void 0:t.profileId)&&{profileId:null==t?void 0:t.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(e){return t.apply(this,arguments)}}(),_=function(e,n){var t,o,r=window.contentType;return i({method:"GET",url:F.get()+"".concat(null==I?void 0:I.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(o=t.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},y=function(e){var n=e.videoId;return i({method:"GET",url:F.get()+"".concat(null==I?void 0:I.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},F=(g=null==I?void 0:I.apiBaseUrl,{set:function(e){e&&(g=e)},get:function(){return g}}),b=function(e,n,t,o){return i({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==o?void 0:o.latitude,longitude:null==o?void 0:o.longitude},method:"GET",headers:{Authorization:n},withCredentials:!0})},D=function(e){var n=JSON.parse(atob(null==e?void 0:e.split(".")[1])),t=null==n?void 0:n.exp;if(new Date(1e3*t).getTime()<(new Date).getTime())return!0},L=null;function R(){return{set:function(e){e&&(L=e)},get:function(){return L}}}var V,S,W,O,C,P,A=function(){var t=e(n.mark(function e(){var t,o,r;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=R().get(),o=F.get(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(t)});case 5:return r=e.sent,e.abrupt("return",r);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 t.apply(this,arguments)}}(),N=null,B=function(){var t=e(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"))||!D(t)){e.next=6;break}return N||(N=A().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(){N=null})),e.abrupt("return",N);case 6:return e.abrupt("return",t);case 7:case"end":return e.stop()}},e)}));return function(){return t.apply(this,arguments)}}(),x=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return t&&!i&&(n=!1),n},U=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},M=function(e){S=e},j=function(){return S},k=function(e){V=e},H=function(){return V},G=function(){return W},z=function(e){W=e},Y=function(){return C},X=function(e){O=new Map,e.map(function(e,n){O.set(e.id,n)})},q=function(e){if(O){var n=O.get(e);z(n+1)}},J=(P=0,{set:function(e){e>=0&&(P=e)},get:function(){return P}}),K=0,Q=function(){var e,n,t,i,o,r,l,a=j();return"linearchannel"==((null==a?void 0:a.contentType)||"video")?null==a||null===(e=a.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find(function(e){return(null==e?void 0:e.id)===(null==a?void 0:a.channelId)}))||void 0===t||null===(i=t.content)||void 0===i?void 0:i.id:(null==a||null===(o=a.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id)||(null==a||null===(l=a.video)||void 0===l?void 0:l.id)||(null==a?void 0:a.id)};function Z(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function $(){var e=window.sessionStorage.getItem("uid");return e||(e=Z(),window.sessionStorage.setItem("uid",e),e)}function ee(){return ne.apply(this,arguments)}function ne(){return(ne=e(n.mark(function e(){var t,i;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B();case 2:if(!(t=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function te(e){return e?String(e):""}window.initialise=function(e){window.sid=Z(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var n=Math.floor(e.currentTime());e.on("error",function(){var t,i,o,r=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,f(r?"FAILED_TO_START":"DROPPED_STREAM",Object.assign({pfm:window.platform,uid:$(),vid:Q(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:n===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})},window.firstFrame=function(e,n){e.one("play",tryCatch(function(){var t,i,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),f("PLAY",Object.assign({pfm:window.platform,uid:$(),vid:Q(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.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}),n&&n("started_video_playback",{"Video ID":Q(),watchTime:Math.floor(e.currentTime())})}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:clearInterval(window.bufferingTimer)},100))}))},window.handleBufferTimer=function(e,n){var t,i;if(n.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(i=t.className)&&void 0!==i&&i.includes("vjs-waiting")&&K<4)K++,f("BUFFERING",Object.assign({pfm:window.platform,uid:$(),vid:Q(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var n,t,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,f("FIRST_FRAME",Object.assign({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:$(),vid:Q()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.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 n,t,i,o,r,l;f("AD_REQUEST",Object.assign({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:$(),vid:Q(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.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}),f("AD_IMPRESSION",Object.assign({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:$(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:Q()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})},window.ping=function(e){var n=[];e.on("timeupdate",function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!n.includes(t)&&(K=0,n.push(t),fireEvent({eventName:"PING",videoPosition:t,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var n=e.currentTime(),t=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(ie(n,r,l)){var a=Math.round(t-l);if(isFinite(a))return a}}})()};var ie=function(e,n,t){return e>=n&&e<=t};function oe(e,n){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var t=o(e);window.initialise(t,n),window.firstFrame(t,n),t.on("loadedmetadata",function(){window.endFirstFrame(t)})}}window.fireEvent=function(){var t=e(n.mark(function e(t){var o,r,l,a,d,u,s,c,v,m,f,p,g,w,E,T,h,_,y,b;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B();case 2:return T=e.sent,h=U(T),_=null==h?void 0:h.site,y=null==h?void 0:h.siteId,e.t0=Object,e.t1={aid:_,cid:y,pfm:window.platform},e.t2=null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params,e.t3=$(),e.t4=Q(),e.t5=t.url||document.location.href,e.t6=t.ref||document.referrer,e.t7=t.eventName,e.t8=null!==(a=t.videoPosition)&&void 0!==a?a:null,e.t9=window.environment,e.t10=t.dp1||"",e.t11=t.dp2||"",e.t12=t.dp3||"",e.t13=t.dp4||"",e.t14=t.dp5||"",e.t15=!0===t.isAdEvent?t.videoPosition:null,e.t16=!0===t.isAdEvent?te(t.adPosition):"",e.next=25,ee();case 25:e.t17=e.sent,e.t18=t.playerType||"native",e.t19=t.mediaType||"VIDEO",e.t20=window.sid,e.t21=null!==(d=t.ttFirstFrame)&&void 0!==d?d:null,e.t22=null!==(u=t.bitrate)&&void 0!==u?u:null,e.t23=null!==(s=t.resHeight)&&void 0!==s?s:null,e.t24=null!==(c=t.resWidth)&&void 0!==c?c:null,e.t25=null!==(v=t.bufferHealth)&&void 0!==v?v:null,e.t26={uid:e.t3,vid:e.t4,url:e.t5,ref:e.t6,pa:e.t7,vpos:e.t8,environment:e.t9,dp1:e.t10,dp2:e.t11,dp3:e.t12,dp4:e.t13,dp5:e.t14,apos:e.t15,apod:e.t16,profid:e.t17,player:e.t18,media_type:e.t19,stream_id:e.t20,embedurl:"",ttfirstframe:e.t21,bitrate:e.t22,connectionspeed:null,resolutionheight:e.t23,resolutionwidth:e.t24,bufferhealth:e.t25},e.t27=(null==t?void 0:t.duration)&&{duration:t.duration},e.t28=null===(m=window)||void 0===m||null===(f=m.customData)||void 0===f||null===(p=f.beacon)||void 0===p?void 0:p.params,e.t29=e.t0.assign.call(e.t0,e.t1,e.t2,e.t26,e.t27,e.t28),b=[e.t29],i({url:(null===(g=window)||void 0===g||null===(w=g.customData)||void 0===w||null===(E=w.beacon)||void 0===E?void 0:E.url)||F.get()+I.getBeaconUrl,method:"post",headers:{Authorization:T},contentType:"application/x-www-form-urlencoded",dataType:"text",data:b}).catch(function(e){console.error(e)});case 40:case"end":return e.stop()}},e)}));return function(e){return t.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var re=function(e,n){var t=new Map;y({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),C=t}).catch(function(e){return console.log(e)})},le=function(){var e=J.get();return e>=0?e+1:1},ae=function(){var e,n,t,i=H(),o=j(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,l=J.get(),a=null==i||null===(n=i[l])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex(function(e){return(null==e?void 0:e.id)===r});return a>=0?a+1:1};window._deviceInfo=u(navigator.userAgent);var de=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},ue=function(e){var n=se(e,"video.tags",[]),t=se(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},se=function(e,n,t){for(var i=0,o=(n=n.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[n[i]]}return e||t},ce=function(){var e,n,t,i,r,l,a,u,s,c,v,m,f,I,p,g,w,E,T,h,_,y=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",F=arguments.length>1?arguments[1]:void 0,b=arguments.length>2?arguments[2]:void 0,D=(null==b?void 0:b.siteName)||"",L=(null==b?void 0:b.contentType)||"video",R=(null==b||null===(e=b[L])||void 0===e?void 0:e.metadata)||(null==b||null===(n=b[L])||void 0===n||null===(t=n.gist)||void 0===t?void 0:t.metadata),V=o(F);if(!y.includes("VIEWLIFT_"))return y;var S,W=window.getComputedStyle(document.getElementById(F),null),O=Math.trunc(W.getPropertyValue("height").slice(0,-2)),C=Math.trunc(W.getPropertyValue("width").slice(0,-2)),P="linearchannel"===L?null==b||null===(i=b.linearchannel)||void 0===i||null===(r=i.channels)||void 0===r||null===(l=r.find(function(e){return(null==e?void 0:e.id)===(null==b?void 0:b.channelId)}))||void 0===l||null===(a=l.content)||void 0===a?void 0:a.id:se(b,"video.gist.id",""),A="linearchannel"===L?null==b||null===(u=b.linearchannel)||void 0===u||null===(s=u.channels)||void 0===s||null===(c=s.find(function(e){return(null==e?void 0:e.id)===(null==b?void 0:b.channelId)}))||void 0===c?void 0:c.title:se(b,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),N=null,B=null;"function"==typeof window.__gpp&&(null===(S=window)||void 0===S||S.__gpp("ping",function(e){N=null==e?void 0:e.gppString,B=null==e?void 0:e.sectionList[0]}));var x=Object.assign({},ve(R),{VIEWLIFT_WIDTH:C,VIEWLIFT_HEIGHT:O,VIEWLIFT_SIZE:de(C,O),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===(v=window)||void 0===v?void 0:v.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:se(b,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:se(b,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:se(b,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==V||null===(m=V.options_)||void 0===m?void 0:m.autoplay)||1,VIEWLIFT_MUTE:(null==V||null===(f=V.options_)||void 0===f?void 0:f.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==D?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:ue(b),VIEWLIFT_MEDIA_ID:P,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(se(b,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:P,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+se(b,"video.gist.permalink","")),VIEWLIFT_CONSENT:d.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:se(null===(I=window)||void 0===I||null===(p=I.app_data)||void 0===p||null===(g=p.site)||void 0===g?void 0:g.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_GDPR:"spinco"==D?"":se(null===(w=window)||void 0===w||null===(E=w.app_data)||void 0===E||null===(T=E.site)||void 0===T?void 0:T.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*se(b,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:se(b,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:P,VIEWLIFT_CONTENT_TITLE:A,VIEWLIFT_CONTENT_SERIES_TITLE:se(b,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:se(b,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ae(),VIEWLIFT_SEASON_NUMBER:le(),VIEWLIFT_CONTENT_TAGS:ue(b),VIEWLIFT_GPP_SID:B||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:N||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},null===(h=window)||void 0===h||null===(_=h.customData)||void 0===_?void 0:_.macros);for(var U in x){var M=new RegExp(U,"g");y=y.replace(M,x[U])}return y},ve=function(e){var n,t,i,o,r,a,d;if(null!==(n=window)&&void 0!==n&&n.customData.isSmartTV)return me(u);var u={},s=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){s.set(e.name,e.value)}));var c=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.subscription)||void 0===o?void 0:o.SVOD)||!1,v=(null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a||null===(d=a.subscription)||void 0===d?void 0:d.TVE)||!1;return c||v?(l()?c?u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||""}):v&&(u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.mweb.tve")||""})):c?u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.web.dtc")||""}):v&&(u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.web.tve")||""})),c?u=Object.assign({},u,{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}):v&&(u=Object.assign({},u,{VIEWLIFT_SFID:s.get("sfid.tve")||s.get("sfid.web.tve")||""})),u=l()?Object.assign({},u,{VIEWLIFT_PROF:s.get("prof.mweb")||""}):Object.assign({},u,{VIEWLIFT_PROF:s.get("prof.web")||""})):(u=Object.assign({},u,{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}),u=l()?Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:s.get("prof.mweb")||""}):Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.web.dtc")||"",VIEWLIFT_PROF:s.get("prof.web")||""})),u=Object.assign({},u,{VIEWLIFT_AFID:s.get("afid")})},me=function(e){var n,t,i,o,r,l,a={},d=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){d.set(e.name,e.value)}));var u=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.subscription)||void 0===i?void 0:i.SVOD)||!1,s=(null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1;return(u||s)&&(s?(a=Object.assign({},a,{VIEWLIFT_SFID:d.get("sfid.tve")}),a="lgTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.lgtv.tve")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.viziotv.tve")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xfinity.tve")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xbox.tve")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.samsungtv.tve")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""})):(a=Object.assign({},a,{VIEWLIFT_SFID:d.get("sfid.dtc")}),a="lgTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.lgtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.viziotv.dtc")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xfinity.dtc")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xbox.dtc")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.samsungtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""}))),a},fe=function(e){var n=null;try{var t,i,o,r,l,a,d,u,s,c,v,m,f,I,p,g,w,E,T,h,_,y,F,b,D,L,R,V,S;if(null!==(t=window)&&void 0!==t&&t.customData.isSmartTV){if("samsungTv"==window.customData.device&&null!=e&&null!==(i=e.ads)&&void 0!==i&&null!==(o=i.preRoll)&&void 0!==o&&null!==(r=o.adTags)&&void 0!==r&&null!==(l=r.samsung_tv)&&void 0!==l&&l.active)n=null==e||null===(E=e.ads)||void 0===E||null===(T=E.preRoll)||void 0===T||null===(h=T.adTags)||void 0===h||null===(_=h.samsung_tv)||void 0===_?void 0:_.url;else if("lgTv"==window.customData.device&&null!=e&&null!==(a=e.ads)&&void 0!==a&&null!==(d=a.preRoll)&&void 0!==d&&null!==(u=d.adTags)&&void 0!==u&&null!==(s=u.lg_tv)&&void 0!==s&&s.active){var W,O,C,P;n=null==e||null===(W=e.ads)||void 0===W||null===(O=W.preRoll)||void 0===O||null===(C=O.adTags)||void 0===C||null===(P=C.lg_tv)||void 0===P?void 0:P.url}else if("vizioTv"==window.customData.device&&null!=e&&null!==(c=e.ads)&&void 0!==c&&null!==(v=c.preRoll)&&void 0!==v&&null!==(m=v.adTags)&&void 0!==m&&null!==(f=m.vizioTv)&&void 0!==f&&f.active){var A,N,B,x;n=null==e||null===(A=e.ads)||void 0===A||null===(N=A.preRoll)||void 0===N||null===(B=N.adTags)||void 0===B||null===(x=B.vizioTv)||void 0===x?void 0:x.url}else if("xbox"==window.customData.device&&null!=e&&null!==(I=e.ads)&&void 0!==I&&null!==(p=I.preRoll)&&void 0!==p&&null!==(g=p.adTags)&&void 0!==g&&null!==(w=g.xbox)&&void 0!==w&&w.active){var U,M,j,k;n=null==e||null===(U=e.ads)||void 0===U||null===(M=U.preRoll)||void 0===M||null===(j=M.adTags)||void 0===j||null===(k=j.xbox)||void 0===k?void 0:k.url}}else n=(null==e||null===(y=e.ads)||void 0===y||null===(F=y.preRoll)||void 0===F||null===(b=F.adTags)||void 0===b||null===(D=b.web)||void 0===D?void 0:D.active)&&(null==e||null===(L=e.ads)||void 0===L||null===(R=L.preRoll)||void 0===R||null===(V=R.adTags)||void 0===V||null===(S=V.web)||void 0===S?void 0:S.url)}catch(e){}return n},Ie=function(e,n){var t,i,o,r,l,d,u,s,c,v,m,f,I,p=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[p])||void 0===t?void 0:t.drmEnabled,w=null==e||null===(i=e[p])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,E=null==e||null===(r=e[p])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.audioAssets,T=(null==e||null===(d=e[p])||void 0===d||null===(u=d.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var h=(null==e||null===(m=e[p])||void 0===m||null===(f=m.streamingInfo)||void 0===f||null===(I=f.videoAssets)||void 0===I?void 0:I.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 ge(E);if(g){var _=we(w,n);return _.src=ce(_.src,n,e),_}if("Safari"!==a()&&h)return pe(w);if(T){var y=ge(w);return y.src=ce(y.src,n,e),y}if(null!=w&&w.mpeg){var F=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(w);return F.src=ce(F.src,n,e),F}return null},pe=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},ge=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},we=function(e,n){var i=e.fairPlayCmaf||e.fairPlay,r=e.widevine,l=e.playReady,d=a();if(o(n),"Safari"===d){var u=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,i){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};t.xhr(o,function(e,n,t){console.log(e),e&&i(e),i(null,new Uint8Array(t))})},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,i,o,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:o,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};t.xhr(l,function(e,n,t){console.log(e),e&&r(e),r(null,t)})}}}}}(i);return Ee(n),u}var s,c={src:r.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(Ee(n),c.keySystems={"com.widevine.alpha":{url:r.licenseUrl,licenseHeaders:{"X-AxDRM-Message":r.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:r.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":r.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var Ee=function(e){var n=o(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==a()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},Te=function(e,n){var t=e.src,i=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:i};n=n.replace(/\/$/,"");var o=t.split(".com")[1]||"";return{src:o?"".concat(n).concat(o):t,type:i}},he=function(e,n){if(import("./error-2395864b.js").then(function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)}),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var 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(n),o.appendChild(r),i.append(o)}}},_e=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var ye=!1,Fe=function(e,n,t){var i=ce(n,e,t),r=o(e);if(n&&window.google){if("function"!=typeof r.ima)return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,n){var t,i,r,l=o(e);if(null!==l.el_){ye=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),ye&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,n,!0),l.ima.requestAds()},1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),l.one(u,function(){s&&l.ima.initializeAdDisplayContainer()});var c=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(r=i.ads)||void 0===r?void 0:r.adEventHandler)||null;l.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),l.one("ads-manager",function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})})}),l.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,i)}},be=function(e){t(e).play()},De=function(e){t(e).pause()},Le=function(e,n){var i=t(e),o=i.currentTime()+n;i.currentTime(o)},Re=function(e,n){var i=t(e),o=i.currentTime(),r=o<=n?0:o-n;i.currentTime(r)},Ve=function(e){return!!t.getPlayer("".concat(e))},Se=function(e){return t(e).paused()},We=function(){var t=e(n.mark(function e(t,i){var r,l,a,d=arguments;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=d.length>2&&void 0!==d[2]&&d[2],e.next=3,B();case 3:return l=e.sent,a=o(t),e.abrupt("return",new Promise(function(e,n){E(i,l).then(function(n){var o=null==n?void 0:n.data;window.sid=Z(),o.contentType="linearchannel",o.channelId=null==i?void 0:i.channelId;var l=Ie(o,t);M(o),l&&r?(Ne(t,l),a.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:o})})):e({status:!0,msg:"Feed authenticated",response:o})}).catch(function(e){n({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(e,n){return t.apply(this,arguments)}}(),Oe=function(){var t=e(n.mark(function e(t,i){var r,l,a,d,u,v,m=arguments;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(d=m.length>2&&void 0!==m[2]?m[2]:null){e.next=5;break}return e.next=4,B();case 4:d=e.sent;case 5:return(H()||null)&&q(i),u=0,v=0,null!==(r=window)&&void 0!==r&&r.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(a=l.watchHistory)&&void 0!==a&&a.enable&&_(i,d).then(function(e){var n,t,i,o,r,l;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),u=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,v=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null}).catch(function(e){var n,t,i,o;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.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){w(i,d).then(function(i){var r,l,a=null==i?void 0:i.data,d=(null==a||null===(r=a.video)||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;M(i.data);var m=fe(a);m&&Fe(t,m,a);var f=Ie(a,t);if(f){var I,p,g,w,E,T,h,_,y,F,b,D,L,R,V=(null==a||null===(I=a.video)||void 0===I||null===(p=I.gist)||void 0===p?void 0:p.videoImageUrl)||(null==a||null===(g=a.video)||void 0===g||null===(w=g.gist)||void 0===w||null===(E=w.imageGist)||void 0===E?void 0:E.r16x9),S=o(t);if(S.poster(V),Ne(t,f),S.on("loadstart",function(){d&&e({status:!0,msg:"Video Loaded",response:a})}),S.on("loadeddata",function(){_e(),e({status:!0,msg:"Video Loaded",response:a})}),S.one("play",function(){u&&v<95&&setTimeout(function(){S.currentTime(u)},0)}),S.one("error",function(){var e;n({status:!1,msg:(null==S||null===(e=S.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==a||null===(T=a.video)||void 0===T||null===(h=T.contentDetails)||void 0===h||null===(_=h.closedCaptions)||void 0===_?void 0:_.length)>0||(null==a||null===(y=a.video)||void 0===y||null===(F=y.closedCaptions)||void 0===F?void 0:F.length)>0)b=((null==a||null===(D=a.video)||void 0===D||null===(L=D.contentDetails)||void 0===L?void 0:L.closedCaptions)||(null==a||null===(R=a.video)||void 0===R?void 0:R.closedCaptions)).filter(function(e){return"VTT"===e.format}),s(t,b);else c(t)}else he(t,"Incompatible Source, only hls,mp4,drm content is allowed"),n("Incompatible Source, only hls,mp4,drm content is allowed")}).catch(function(e){Be(e,t,n,i)})}));case 11:case"end":return e.stop()}},e)}));return function(e,n){return t.apply(this,arguments)}}(),Ce=function(e,n,t){var i=o(e);return i.src(n),new Promise(function(e,n){var o=0;i.one("loadedmetadata",function(){clearTimeout(o),e({status:!0,msg:"video loaded"})}),i.one("loadstart",function(e){o=setTimeout(function(){n("FAILED: Took too long to load")},t)})})},Pe=function(e){var n=o(e);if(Ae(),r(),window.onresize=null,n)n.dispose();else{var t=document.getElementById(e);t&&t.remove()}},Ae=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()},Ne=function(e,n){var t=o(e);t&&t.src(n)},Be=function(e,n,t,i){var o,r,l,a,d,u,s=null==e||null===(o=e.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.errorCode,c=(null==e||null===(l=e.response)||void 0===l||null===(a=l.data)||void 0===a?void 0:a.errorMessage)||(null==e?void 0:e.message);Ve(n)&&he(n,(null===(d=window)||void 0===d?void 0:d.customErrors)&&(null===(u=window)||void 0===u?void 0:u.customErrors[s])||"".concat(c)),t&&t(Object.assign({status:!1,response:e,msg:"".concat(c)},i&&{videoId:i}))},xe=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var i=n.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=n.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")};export{T as A,re as B,J as C,k as D,Ce as E,be as F,De as G,Se as H,Ve as I,Oe as J,We as K,Pe as L,b as M,F as N,x as O,R as P,D as Q,m as R,G as S,z as T,y as U,q as V,X as W,ae as a,H as b,le as c,j as d,Ie as e,M as f,$ as g,_e as h,he as i,Y as j,Le as k,Ne as l,ce as m,fe as n,xe as o,oe as p,Fe as q,Re as r,h as s,Te as t,U as u,w as v,_ as w,Be as x,B as y,E as z};
@@ -1 +0,0 @@
1
- import e from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import t from"video.js";import i from"axios";import{g as o,c as r}from"./skin-8e2c5488.js";import{i as l,d as a}from"./browser-512cd55a.js";import d from"js-cookie";import{UAParser as u}from"ua-parser-js";import{a as s,r as c}from"./captions-7996e045.js";function v(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function m(e){window.dataLayer=window.dataLayer||[],v("js",new Date),v("config",e)}function f(e,n){v("event",e,n)}var I={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"},p={name:"@viewlift/player-backup",version:"2.0.73-smartTv",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","ua-parser-js":"^2.0.3","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"}};window.vl_player_version=p.version;var g,w=function(e,n){var t,o,r,l,a,d,u,s;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):i({url:null!==(a=window)&&void 0!==a&&null!==(d=a.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==I?void 0:I.getVideoDetails),params:Object.assign({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":p.version},withCredentials:!0})},E=function(e,n){var t,o,r,l;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):i({url:F.get()+I.getLinearChannelDetails,params:Object.assign({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===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},T=function(e,n){var t,o,r=U(n),l=(null==r?void 0:r.site)||null;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.seriesData?new Promise(function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.seriesData})}):i({url:F.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:n}})},h=function(){var t=e(n.mark(function e(t){var o;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B();case 2:return o=e.sent,e.abrupt("return",i({url:F.get()+"".concat(null==I?void 0:I.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:Object.assign({},t),params:Object.assign({},(null==t?void 0:t.profileId)&&{profileId:null==t?void 0:t.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(e){return t.apply(this,arguments)}}(),_=function(e,n){var t,o,r=window.contentType;return i({method:"GET",url:F.get()+"".concat(null==I?void 0:I.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(o=t.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},y=function(e){var n=e.videoId;return i({method:"GET",url:F.get()+"".concat(null==I?void 0:I.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},F=(g=null==I?void 0:I.apiBaseUrl,{set:function(e){e&&(g=e)},get:function(){return g}}),b=function(e,n,t,o){return i({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==o?void 0:o.latitude,longitude:null==o?void 0:o.longitude},method:"GET",headers:{Authorization:n},withCredentials:!0})},D=function(e){var n=JSON.parse(atob(null==e?void 0:e.split(".")[1])),t=null==n?void 0:n.exp;if(new Date(1e3*t).getTime()<(new Date).getTime())return!0},L=null;function R(){return{set:function(e){e&&(L=e)},get:function(){return L}}}var V,S,W,O,C,P,A=function(){var t=e(n.mark(function e(){var t,o,r;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=R().get(),o=F.get(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(t)});case 5:return r=e.sent,e.abrupt("return",r);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 t.apply(this,arguments)}}(),N=null,B=function(){var t=e(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"))||!D(t)){e.next=6;break}return N||(N=A().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(){N=null})),e.abrupt("return",N);case 6:return e.abrupt("return",t);case 7:case"end":return e.stop()}},e)}));return function(){return t.apply(this,arguments)}}(),x=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return t&&!i&&(n=!1),n},U=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},M=function(e){S=e},j=function(){return S},k=function(e){V=e},H=function(){return V},G=function(){return W},z=function(e){W=e},Y=function(){return C},X=function(e){O=new Map,e.map(function(e,n){O.set(e.id,n)})},q=function(e){if(O){var n=O.get(e);z(n+1)}},J=(P=0,{set:function(e){e>=0&&(P=e)},get:function(){return P}}),K=0,Q=function(){var e,n,t,i,o,r,l,a=j();return"linearchannel"==((null==a?void 0:a.contentType)||"video")?null==a||null===(e=a.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find(function(e){return(null==e?void 0:e.id)===(null==a?void 0:a.channelId)}))||void 0===t||null===(i=t.content)||void 0===i?void 0:i.id:(null==a||null===(o=a.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id)||(null==a||null===(l=a.video)||void 0===l?void 0:l.id)||(null==a?void 0:a.id)};function Z(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function $(){var e=window.sessionStorage.getItem("uid");return e||(e=Z(),window.sessionStorage.setItem("uid",e),e)}function ee(){return ne.apply(this,arguments)}function ne(){return(ne=e(n.mark(function e(){var t,i;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B();case 2:if(!(t=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function te(e){return e?String(e):""}window.initialise=function(e){window.sid=Z(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var n=Math.floor(e.currentTime());e.on("error",function(){var t,i,o,r=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,f(r?"FAILED_TO_START":"DROPPED_STREAM",Object.assign({pfm:window.platform,uid:$(),vid:Q(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:n===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})},window.firstFrame=function(e,n){e.one("play",tryCatch(function(){var t,i,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),f("PLAY",Object.assign({pfm:window.platform,uid:$(),vid:Q(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.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}),n&&n("started_video_playback",{"Video ID":Q(),watchTime:Math.floor(e.currentTime())})}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:clearInterval(window.bufferingTimer)},100))}))},window.handleBufferTimer=function(e,n){var t,i;if(n.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(i=t.className)&&void 0!==i&&i.includes("vjs-waiting")&&K<4)K++,f("BUFFERING",Object.assign({pfm:window.platform,uid:$(),vid:Q(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var n,t,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,f("FIRST_FRAME",Object.assign({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:$(),vid:Q()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.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 n,t,i,o,r,l;f("AD_REQUEST",Object.assign({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:$(),vid:Q(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.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}),f("AD_IMPRESSION",Object.assign({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:$(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:Q()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})},window.ping=function(e){var n=[];e.on("timeupdate",function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!n.includes(t)&&(K=0,n.push(t),fireEvent({eventName:"PING",videoPosition:t,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var n=e.currentTime(),t=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(ie(n,r,l)){var a=Math.round(t-l);if(isFinite(a))return a}}})()};var ie=function(e,n,t){return e>=n&&e<=t};function oe(e,n){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var t=o(e);window.initialise(t,n),window.firstFrame(t,n),t.on("loadedmetadata",function(){window.endFirstFrame(t)})}}window.fireEvent=function(){var t=e(n.mark(function e(t){var o,r,l,a,d,u,s,c,v,m,f,p,g,w,E,T,h,_,y,b;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B();case 2:return T=e.sent,h=U(T),_=null==h?void 0:h.site,y=null==h?void 0:h.siteId,e.t0=Object,e.t1={aid:_,cid:y,pfm:window.platform},e.t2=null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params,e.t3=$(),e.t4=Q(),e.t5=t.url||document.location.href,e.t6=t.ref||document.referrer,e.t7=t.eventName,e.t8=null!==(a=t.videoPosition)&&void 0!==a?a:null,e.t9=window.environment,e.t10=t.dp1||"",e.t11=t.dp2||"",e.t12=t.dp3||"",e.t13=t.dp4||"",e.t14=t.dp5||"",e.t15=!0===t.isAdEvent?t.videoPosition:null,e.t16=!0===t.isAdEvent?te(t.adPosition):"",e.next=25,ee();case 25:e.t17=e.sent,e.t18=t.playerType||"native",e.t19=t.mediaType||"VIDEO",e.t20=window.sid,e.t21=null!==(d=t.ttFirstFrame)&&void 0!==d?d:null,e.t22=null!==(u=t.bitrate)&&void 0!==u?u:null,e.t23=null!==(s=t.resHeight)&&void 0!==s?s:null,e.t24=null!==(c=t.resWidth)&&void 0!==c?c:null,e.t25=null!==(v=t.bufferHealth)&&void 0!==v?v:null,e.t26={uid:e.t3,vid:e.t4,url:e.t5,ref:e.t6,pa:e.t7,vpos:e.t8,environment:e.t9,dp1:e.t10,dp2:e.t11,dp3:e.t12,dp4:e.t13,dp5:e.t14,apos:e.t15,apod:e.t16,profid:e.t17,player:e.t18,media_type:e.t19,stream_id:e.t20,embedurl:"",ttfirstframe:e.t21,bitrate:e.t22,connectionspeed:null,resolutionheight:e.t23,resolutionwidth:e.t24,bufferhealth:e.t25},e.t27=(null==t?void 0:t.duration)&&{duration:t.duration},e.t28=null===(m=window)||void 0===m||null===(f=m.customData)||void 0===f||null===(p=f.beacon)||void 0===p?void 0:p.params,e.t29=e.t0.assign.call(e.t0,e.t1,e.t2,e.t26,e.t27,e.t28),b=[e.t29],i({url:(null===(g=window)||void 0===g||null===(w=g.customData)||void 0===w||null===(E=w.beacon)||void 0===E?void 0:E.url)||F.get()+I.getBeaconUrl,method:"post",headers:{Authorization:T},contentType:"application/x-www-form-urlencoded",dataType:"text",data:b}).catch(function(e){console.error(e)});case 40:case"end":return e.stop()}},e)}));return function(e){return t.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var re=function(e,n){var t=new Map;y({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),C=t}).catch(function(e){return console.log(e)})},le=function(){var e=J.get();return e>=0?e+1:1},ae=function(){var e,n,t,i=H(),o=j(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,l=J.get(),a=null==i||null===(n=i[l])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex(function(e){return(null==e?void 0:e.id)===r});return a>=0?a+1:1};window._deviceInfo=u(navigator.userAgent);var de=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},ue=function(e){var n=se(e,"video.tags",[]),t=se(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},se=function(e,n,t){for(var i=0,o=(n=n.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[n[i]]}return e||t},ce=function(){var e,n,t,i,r,l,a,u,s,c,v,m,f,I,p,g,w,E,T,h,_,y=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",F=arguments.length>1?arguments[1]:void 0,b=arguments.length>2?arguments[2]:void 0,D=(null==b?void 0:b.siteName)||"",L=(null==b?void 0:b.contentType)||"video",R=(null==b||null===(e=b[L])||void 0===e?void 0:e.metadata)||(null==b||null===(n=b[L])||void 0===n||null===(t=n.gist)||void 0===t?void 0:t.metadata),V=o(F);if(!y.includes("VIEWLIFT_"))return y;var S,W=window.getComputedStyle(document.getElementById(F),null),O=Math.trunc(W.getPropertyValue("height").slice(0,-2)),C=Math.trunc(W.getPropertyValue("width").slice(0,-2)),P="linearchannel"===L?null==b||null===(i=b.linearchannel)||void 0===i||null===(r=i.channels)||void 0===r||null===(l=r.find(function(e){return(null==e?void 0:e.id)===(null==b?void 0:b.channelId)}))||void 0===l||null===(a=l.content)||void 0===a?void 0:a.id:se(b,"video.gist.id",""),A="linearchannel"===L?null==b||null===(u=b.linearchannel)||void 0===u||null===(s=u.channels)||void 0===s||null===(c=s.find(function(e){return(null==e?void 0:e.id)===(null==b?void 0:b.channelId)}))||void 0===c?void 0:c.title:se(b,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),N=null,B=null;"function"==typeof window.__gpp&&(null===(S=window)||void 0===S||S.__gpp("ping",function(e){N=null==e?void 0:e.gppString,B=null==e?void 0:e.sectionList[0]}));var x=Object.assign({},ve(R),{VIEWLIFT_WIDTH:C,VIEWLIFT_HEIGHT:O,VIEWLIFT_SIZE:de(C,O),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===(v=window)||void 0===v?void 0:v.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:se(b,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:se(b,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:se(b,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==V||null===(m=V.options_)||void 0===m?void 0:m.autoplay)||1,VIEWLIFT_MUTE:(null==V||null===(f=V.options_)||void 0===f?void 0:f.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==D?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:ue(b),VIEWLIFT_MEDIA_ID:P,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(se(b,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:P,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+se(b,"video.gist.permalink","")),VIEWLIFT_CONSENT:d.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:se(null===(I=window)||void 0===I||null===(p=I.app_data)||void 0===p||null===(g=p.site)||void 0===g?void 0:g.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_GDPR:"spinco"==D?"":se(null===(w=window)||void 0===w||null===(E=w.app_data)||void 0===E||null===(T=E.site)||void 0===T?void 0:T.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*se(b,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:se(b,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:P,VIEWLIFT_CONTENT_TITLE:A,VIEWLIFT_CONTENT_SERIES_TITLE:se(b,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:se(b,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ae(),VIEWLIFT_SEASON_NUMBER:le(),VIEWLIFT_CONTENT_TAGS:ue(b),VIEWLIFT_GPP_SID:B||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:N||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},null===(h=window)||void 0===h||null===(_=h.customData)||void 0===_?void 0:_.macros);for(var U in x){var M=new RegExp(U,"g");y=y.replace(M,x[U])}return y},ve=function(e){var n,t,i,o,r,a,d;if(null!==(n=window)&&void 0!==n&&n.customData.isSmartTV)return me(u);var u={},s=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){s.set(e.name,e.value)}));var c=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.subscription)||void 0===o?void 0:o.SVOD)||!1,v=(null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a||null===(d=a.subscription)||void 0===d?void 0:d.TVE)||!1;return c||v?(l()?c?u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||""}):v&&(u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.mweb.tve")||""})):c?u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.web.dtc")||""}):v&&(u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.web.tve")||""})),c?u=Object.assign({},u,{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}):v&&(u=Object.assign({},u,{VIEWLIFT_SFID:s.get("sfid.tve")||s.get("sfid.web.tve")||""})),u=l()?Object.assign({},u,{VIEWLIFT_PROF:s.get("prof.mweb")||""}):Object.assign({},u,{VIEWLIFT_PROF:s.get("prof.web")||""})):(u=Object.assign({},u,{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}),u=l()?Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:s.get("prof.mweb")||""}):Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.web.dtc")||"",VIEWLIFT_PROF:s.get("prof.web")||""})),u=Object.assign({},u,{VIEWLIFT_AFID:s.get("afid")})},me=function(e){var n,t,i,o,r,l,a={},d=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){d.set(e.name,e.value)}));var u=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.subscription)||void 0===i?void 0:i.SVOD)||!1,s=(null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1;return(u||s)&&(s?(a=Object.assign({},a,{VIEWLIFT_SFID:d.get("sfid.tve")}),a="lgTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.lgtv.tve")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.viziotv.tve")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xfinity.tve")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xbox.tve")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.samsungtv.tve")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""})):(a=Object.assign({},a,{VIEWLIFT_SFID:d.get("sfid.dtc")}),a="lgTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.lgtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.viziotv.dtc")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xfinity.dtc")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xbox.dtc")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.samsungtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""}))),a},fe=function(e){var n=null;try{var t,i,o,r,l,a,d,u,s,c,v,m,f,I,p,g,w,E,T,h,_,y,F,b,D,L,R,V,S;if(null!==(t=window)&&void 0!==t&&t.customData.isSmartTV){if("samsungTv"==window.customData.device&&null!=e&&null!==(i=e.ads)&&void 0!==i&&null!==(o=i.preRoll)&&void 0!==o&&null!==(r=o.adTags)&&void 0!==r&&null!==(l=r.samsung_tv)&&void 0!==l&&l.active)n=null==e||null===(E=e.ads)||void 0===E||null===(T=E.preRoll)||void 0===T||null===(h=T.adTags)||void 0===h||null===(_=h.samsung_tv)||void 0===_?void 0:_.url;else if("lgTv"==window.customData.device&&null!=e&&null!==(a=e.ads)&&void 0!==a&&null!==(d=a.preRoll)&&void 0!==d&&null!==(u=d.adTags)&&void 0!==u&&null!==(s=u.lg_tv)&&void 0!==s&&s.active){var W,O,C,P;n=null==e||null===(W=e.ads)||void 0===W||null===(O=W.preRoll)||void 0===O||null===(C=O.adTags)||void 0===C||null===(P=C.lg_tv)||void 0===P?void 0:P.url}else if("vizioTv"==window.customData.device&&null!=e&&null!==(c=e.ads)&&void 0!==c&&null!==(v=c.preRoll)&&void 0!==v&&null!==(m=v.adTags)&&void 0!==m&&null!==(f=m.vizioTv)&&void 0!==f&&f.active){var A,N,B,x;n=null==e||null===(A=e.ads)||void 0===A||null===(N=A.preRoll)||void 0===N||null===(B=N.adTags)||void 0===B||null===(x=B.vizioTv)||void 0===x?void 0:x.url}else if("xbox"==window.customData.device&&null!=e&&null!==(I=e.ads)&&void 0!==I&&null!==(p=I.preRoll)&&void 0!==p&&null!==(g=p.adTags)&&void 0!==g&&null!==(w=g.xbox)&&void 0!==w&&w.active){var U,M,j,k;n=null==e||null===(U=e.ads)||void 0===U||null===(M=U.preRoll)||void 0===M||null===(j=M.adTags)||void 0===j||null===(k=j.xbox)||void 0===k?void 0:k.url}}else n=(null==e||null===(y=e.ads)||void 0===y||null===(F=y.preRoll)||void 0===F||null===(b=F.adTags)||void 0===b||null===(D=b.web)||void 0===D?void 0:D.active)&&(null==e||null===(L=e.ads)||void 0===L||null===(R=L.preRoll)||void 0===R||null===(V=R.adTags)||void 0===V||null===(S=V.web)||void 0===S?void 0:S.url)}catch(e){}return n},Ie=function(e,n){var t,i,o,r,l,d,u,s,c,v,m,f,I,p=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[p])||void 0===t?void 0:t.drmEnabled,w=null==e||null===(i=e[p])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,E=null==e||null===(r=e[p])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.audioAssets,T=(null==e||null===(d=e[p])||void 0===d||null===(u=d.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var h=(null==e||null===(m=e[p])||void 0===m||null===(f=m.streamingInfo)||void 0===f||null===(I=f.videoAssets)||void 0===I?void 0:I.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 ge(E);if(g){var _=we(w,n);return _.src=ce(_.src,n,e),_}if("Safari"!==a()&&h)return pe(w);if(T){var y=ge(w);return y.src=ce(y.src,n,e),y}if(null!=w&&w.mpeg){var F=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(w);return F.src=ce(F.src,n,e),F}return null},pe=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},ge=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},we=function(e,n){var i=e.fairPlayCmaf||e.fairPlay,r=e.widevine,l=e.playReady,d=a();if(o(n),"Safari"===d){var u=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,i){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};t.xhr(o,function(e,n,t){console.log(e),e&&i(e),i(null,new Uint8Array(t))})},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,i,o,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:o,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};t.xhr(l,function(e,n,t){console.log(e),e&&r(e),r(null,t)})}}}}}(i);return Ee(n),u}var s,c={src:r.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(Ee(n),c.keySystems={"com.widevine.alpha":{url:r.licenseUrl,licenseHeaders:{"X-AxDRM-Message":r.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:r.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":r.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var Ee=function(e){var n=o(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==a()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},Te=function(e,n){var t=e.src,i=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:i};n=n.replace(/\/$/,"");var o=t.split(".com")[1]||"";return{src:o?"".concat(n).concat(o):t,type:i}},he=function(e,n){if(import("./error-2395864b.js").then(function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)}),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var 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(n),o.appendChild(r),i.append(o)}}},_e=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var ye=!1,Fe=function(e,n,t){var i=ce(n,e,t),r=o(e);if(n&&window.google){if("function"!=typeof r.ima)return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,n){var t,i,r,l=o(e);if(null!==l.el_){ye=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),ye&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,n,!0),l.ima.requestAds()},1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),l.one(u,function(){s&&l.ima.initializeAdDisplayContainer()});var c=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(r=i.ads)||void 0===r?void 0:r.adEventHandler)||null;l.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),l.one("ads-manager",function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})})}),l.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,i)}},be=function(e){t(e).play()},De=function(e){t(e).pause()},Le=function(e,n){var i=t(e),o=i.currentTime()+n;i.currentTime(o)},Re=function(e,n){var i=t(e),o=i.currentTime(),r=o<=n?0:o-n;i.currentTime(r)},Ve=function(e){return!!t.getPlayer("".concat(e))},Se=function(e){return t(e).paused()},We=function(){var t=e(n.mark(function e(t,i){var r,l,a,d=arguments;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=d.length>2&&void 0!==d[2]&&d[2],e.next=3,B();case 3:return l=e.sent,a=o(t),e.abrupt("return",new Promise(function(e,n){E(i,l).then(function(n){var o=null==n?void 0:n.data;window.sid=Z(),o.contentType="linearchannel",o.channelId=null==i?void 0:i.channelId;var l=Ie(o,t);M(o),l&&r?(Ne(t,l),a.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:o})})):e({status:!0,msg:"Feed authenticated",response:o})}).catch(function(e){n({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(e,n){return t.apply(this,arguments)}}(),Oe=function(){var t=e(n.mark(function e(t,i){var r,l,a,d,u,v,m=arguments;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(d=m.length>2&&void 0!==m[2]?m[2]:null){e.next=5;break}return e.next=4,B();case 4:d=e.sent;case 5:return(H()||null)&&q(i),u=0,v=0,null!==(r=window)&&void 0!==r&&r.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(a=l.watchHistory)&&void 0!==a&&a.enable&&_(i,d).then(function(e){var n,t,i,o,r,l;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),u=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,v=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null}).catch(function(e){var n,t,i,o;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.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){w(i,d).then(function(i){var r,l,a=null==i?void 0:i.data,d=(null==a||null===(r=a.video)||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;M(i.data);var m=fe(a);m&&Fe(t,m,a);var f=Ie(a,t);if(f){var I,p,g,w,E,T,h,_,y,F,b,D,L,R,V=(null==a||null===(I=a.video)||void 0===I||null===(p=I.gist)||void 0===p?void 0:p.videoImageUrl)||(null==a||null===(g=a.video)||void 0===g||null===(w=g.gist)||void 0===w||null===(E=w.imageGist)||void 0===E?void 0:E.r16x9),S=o(t);if(S.poster(V),Ne(t,f),S.on("loadstart",function(){d&&e({status:!0,msg:"Video Loaded",response:a})}),S.on("loadeddata",function(){_e(),e({status:!0,msg:"Video Loaded",response:a})}),S.one("play",function(){u&&v<95&&setTimeout(function(){S.currentTime(u)},0)}),S.one("error",function(){var e;n({status:!1,msg:(null==S||null===(e=S.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==a||null===(T=a.video)||void 0===T||null===(h=T.contentDetails)||void 0===h||null===(_=h.closedCaptions)||void 0===_?void 0:_.length)>0||(null==a||null===(y=a.video)||void 0===y||null===(F=y.closedCaptions)||void 0===F?void 0:F.length)>0)b=((null==a||null===(D=a.video)||void 0===D||null===(L=D.contentDetails)||void 0===L?void 0:L.closedCaptions)||(null==a||null===(R=a.video)||void 0===R?void 0:R.closedCaptions)).filter(function(e){return"VTT"===e.format}),s(t,b);else c(t)}else he(t,"Incompatible Source, only hls,mp4,drm content is allowed"),n("Incompatible Source, only hls,mp4,drm content is allowed")}).catch(function(e){Be(e,t,n,i)})}));case 11:case"end":return e.stop()}},e)}));return function(e,n){return t.apply(this,arguments)}}(),Ce=function(e,n,t){var i=o(e);return i.src(n),new Promise(function(e,n){var o=0;i.one("loadedmetadata",function(){clearTimeout(o),e({status:!0,msg:"video loaded"})}),i.one("loadstart",function(e){o=setTimeout(function(){n("FAILED: Took too long to load")},t)})})},Pe=function(e){var n=o(e);if(Ae(),r(),window.onresize=null,n)n.dispose();else{var t=document.getElementById(e);t&&t.remove()}},Ae=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()},Ne=function(e,n){var t=o(e);t&&t.src(n)},Be=function(e,n,t,i){var o,r,l,a,d,u,s=null==e||null===(o=e.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.errorCode,c=(null==e||null===(l=e.response)||void 0===l||null===(a=l.data)||void 0===a?void 0:a.errorMessage)||(null==e?void 0:e.message);Ve(n)&&he(n,(null===(d=window)||void 0===d?void 0:d.customErrors)&&(null===(u=window)||void 0===u?void 0:u.customErrors[s])||"".concat(c)),t&&t(Object.assign({status:!1,response:e,msg:"".concat(c)},i&&{videoId:i}))},xe=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var i=n.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=n.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")};export{T as A,re as B,J as C,k as D,Ce as E,be as F,De as G,Se as H,Ve as I,Oe as J,We as K,Pe as L,b as M,F as N,x as O,R as P,D as Q,m as R,G as S,z as T,y as U,q as V,X as W,ae as a,H as b,le as c,j as d,Ie as e,M as f,$ as g,_e as h,he as i,Y as j,Le as k,Ne as l,ce as m,fe as n,xe as o,oe as p,Fe as q,Re as r,h as s,Te as t,U as u,w as v,_ as w,Be as x,B as y,E as z};
@@ -1 +0,0 @@
1
- import{g as e,t}from"./skin-8e2c5488.js";import{S as n,b as r,d as i}from"./generic-9a919ba4.js";import{s as a}from"./autoNextVideo-b51e19f4.js";import o 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,g=[],h=function(t,i){var a;if(null!=i&&null!==(a=i.series)&&void 0!==a&&a.enable){var o;g=[];var l=r();null==l||l.map(function(e){var t;return(t=g).push.apply(t,e.episodes)}),null==i||null===(o=i.series)||void 0===o||o.cb}else{var u,s;g=(null==i||null===(u=i.relatedVideos)||void 0===u?void 0:u.content)||[],null==i||null===(s=i.relatedVideos)||void 0===s||s.cb}var c=e(t);c.on("timeupdate",function(){var e,t,r=Math.floor(c.currentTime()),i=c.duration(),a=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-r<=10&&n()<=(null===(t=g)||void 0===t?void 0:t.length)-1?a&&(a.style.visibility="visible"):a&&(a.style.visibility="hidden")});var d,p=g.filter(function(e,t){return t==n()});if((null==p?void 0:p.length)>0)if(null!==(d=document.getElementsByClassName("next-ep-preview"))&&void 0!==d&&d[0]){var m,v,f,h,y,x,w,A,E,N,k,T;(null===(m=document.getElementsByClassName("next-ep-preview"))||void 0===m?void 0:m[0]).style.visibility="hidden";var C=null===(v=document.getElementsByClassName("next-ep-title"))||void 0===v?void 0:v[0],I=null===(f=document.getElementsByClassName("next-ep-img"))||void 0===f?void 0:f[0],L=null===(h=document.getElementsByClassName("next-ep-content"))||void 0===h?void 0:h[0],B=null===(y=p[0])||void 0===y?void 0:y.title;(null===(x=B)||void 0===x?void 0:x.length)>60&&(B=B.substr(0,60)+"..."),C.textContent="".concat(B),I.src=(null===(w=p[0])||void 0===w||null===(A=w.gist)||void 0===A||null===(E=A.imageGist)||void 0===E?void 0:E.r16x9)||(null==p||null===(N=p[0])||void 0===N?void 0:N.img)||(null===(k=window)||void 0===k||null===(T=k.customData)||void 0===T?void 0:T.fallbackImage),L.onclick=function(){return b(t)}}else{var j,M,S,R,P,O,$,X,D=document.createElement("div");D.className="next-ep-preview",D.style.visibility="hidden",document.getElementById(t).append(D);var _=document.createElement("div");_.className="next-ep-header",_.textContent="Next up";var F=null===(j=p[0])||void 0===j?void 0:j.title,U=document.createElement("img");U.className="next-ep-img",U.src=(null===(M=p[0])||void 0===M||null===(S=M.gist)||void 0===S||null===(R=S.imageGist)||void 0===R?void 0:R.r16x9)||(null==p||null===(P=p[0])||void 0===P?void 0:P.img)||(null===(O=window)||void 0===O||null===($=O.customData)||void 0===$?void 0:$.fallbackImage);var W=document.createElement("div");W.className="next-ep-title",(null===(X=F)||void 0===X?void 0:X.length)>60&&(F=F.substr(0,60)+"..."),W.textContent="".concat(F);var q=document.createElement("div");q.className="next-ep-content",q.append(U),q.append(W),q.onclick=function(){return b(t)},D.append(_),D.append(q)}},b=function(t,r){var i=e(t),o=Math.floor(i.currentTime());if(Math.floor(i.duration())!=o){i.pause(t);var l=n();a(l,t,g)}};p={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},m=function e(){var t,n,r,i,a;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(a in i=t[r])i.hasOwnProperty(a)&&("object"===o(i[a])?n[a]=e(n[a],i[a]):n[a]=i[a]);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,a,o,l,u,s,c;if(i=m({},p,e),o=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=o.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(r=document.createElement("div")).className="vjs-thumbnail-holder",a=document.createElement("img"),r.appendChild(a),a.src=i[0].src,a.className="vjs-thumbnail",m(a.style,i[0].style),a.style.left||a.style.right||(a.onload=function(){a.style.left=-a.naturalWidth/2+"px"}),u=o.duration(),o.on("durationchange",function(e){u=o.duration()}),o.on("loadedmetadata",function(e){u=o.duration()}),(l=o.controlBar.progressControl).el().appendChild(r),s=function(e){var t,n,o,s,c,d,p,g,h,b;for(n in o=0,h=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,p=((b=f(l.el()).getBoundingClientRect()).width||b.right)+h,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=f(l.el()).getBoundingClientRect().left+h,t=Math.floor((s-l.el().offsetLeft)/l.width()*u),i)t>n&&(o=Math.max(o,n));(c=i[o]).src&&a.src!=c.src&&(a.src=c.src),c.style&&a.style!=c.style&&m(a.style,c.style),s+(g=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}(a,c.width||i[0].width)/2)>p?s-=s+g-p:s<g&&(s=g),r.style.left=s+"px"},null!==(t=window)&&void 0!==t&&null!==(n=t.customData)&&void 0!==n&&n.isSmartTV){var d=function(){var e,t,n=0,u=(null===(e=l.el_.children[0].children[2])||void 0===e?void 0:e.offsetWidth)||5;u<65?u=5:u>=o.el().offsetWidth-180?u=o.el().offsetWidth-240:u-=58;var s=o.currentTime();for(t in i)s>t&&(n=Math.max(n,t));var c=i[n];c.uri&&""!=c.uri&&a.src!=c.uri?(a.src=c.uri,r.style.left=u+"px",a.style.opacity="1"):(r.style.left="-1000px",a.style.opacity="0")},g=null;l.el_.children[0].onfocus=function(){d(),g=setInterval(function(){d()},250)},l.el_.children[0].addEventListener("blur",function(){try{r.style.left="-1000px",a.style.opacity="0",g&&(clearInterval(g),g=null)}catch(e){}})}else l.on("mousemove",s),l.on("touchmove",s);function h(){document.removeEventListener("pointermove",s),document.removeEventListener("pointerup",h),c()}l.on("pointerdown",function(e){document.addEventListener("pointermove",s),document.addEventListener("pointerup",h)}),c=function(e){r.style.left="-1000px"},l.on("mouseout",c),l.on("touchcancel",c),l.on("touchend",c),o.on("userinactive",c)});var y="my-player";function x(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 w(){return(w=u(s.mark(function e(t){var n,r,i,a,o,l,u,c,p,m,v,f,g,h,b,y,x,w,A,E,N,k,T,C;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t._tiles){e.next=2;break}return e.abrupt("return",t._tiles);case 2:return e.prev=2,e.next=5,fetch(t.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return r=e.sent,e.next=11,createImageBitmap(r);case 11:for(i=e.sent,a=t.layout.split("x").map(Number),o=d(a,2),l=o[0],u=o[1],c=i.width/u,p=i.height/l,m=[],v=0;v<l;v++)for(f=0;f<u;f++)(g=document.createElement("canvas")).width=c,g.height=p,g.getContext("2d").drawImage(i,f*c,v*p,c,p,0,0,c,p),h=g.toDataURL("image/png"),m.push({uri:h,duration:t.duration}),t._tiles=m;return e.abrupt("return",m);case 20:for(e.prev=20,e.t0=e.catch(2),b=t.layout.split("x").map(Number),y=d(b,2),x=y[0],w=y[1],A=[],E=0;E<x*w;E++)A.push({uri:null===(N=window)||void 0===N||null===(k=N.app_data)||void 0===k||null===(T=k.appcmsMain)||void 0===T||null===(C=T.images)||void 0===C?void 0:C.placeholderCover,duration:t.duration});return e.abrupt("return",A);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function A(e,t){return E.apply(this,arguments)}function E(){return(E=u(s.mark(function e(t,n){var r,i;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return y=n,e.prev=1,e.next=4,fetch(t);case 4:return r=e.sent,e.next=7,r.text();case 7:return i=e.sent,e.abrupt("return",x(i));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}},e,null,[[1,11]])}))).apply(this,arguments)}function N(t,n,r){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),a=e(y);if(i&&a){var o=i.getBoundingClientRect(),l=(t.clientX-o.left)/o.width,u=function(e,t){var n,r;if(!t||0===t.length)return null;var i=0,a=t.length-1;for(;i<=a;){var o=Math.floor((i+a)/2),l=t[o];if(l===e)return l;l<e?i=o+1:a=o-1}var u=null!==(n=t[i])&&void 0!==n?n:1/0,s=null!==(r=t[a])&&void 0!==r?r:-1/0;return Math.abs(u-e)<Math.abs(s-e)?u:s}(Math.round(l*a.duration()),r),s=n[u];s&&!s.loading&&(s.loading=!0,function(e){return w.apply(this,arguments)}(s).then(function(e){var t=e[s.tileIndex],n=document.querySelector(".vjs-thumbnail-holder img");n&&t.uri&&(n.src=t.uri),s.loading=!1,s.src=t.uri}))}}function k(e){return T.apply(this,arguments)}function T(){return(T=u(s.mark(function e(n){var r,i,a,o;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r={},n.forEach(function(e,t){for(var n=e.layout.split("x").map(Number),i=d(n,2),a=i[0]*i[1],o=e.duration,l=0;l<a;l++){var u,s=Math.round((t*a+l)*o);r[s]=Object.assign({},e,{duration:e.duration,tileIndex:l,loading:!1,style:(u={left:"-60px",height:"85px",width:"130px"},c(u,"left","-60px"),c(u,"border","1px solid transparent"),c(u,"borderRadius","4px"),u)})}}),i=Object.keys(r).map(Number).sort(function(e,t){return e-t}),null==(a=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||a.addEventListener("mousemove",t(function(e){return N(e,r,i)},500)),null==(o=document.querySelector(".vjs-progress-control.vjs-control"))||o.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",t(function(e){return N(e,r,i)},500))}),e.abrupt("return",r);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var C=function(){var e=u(s.mark(function e(t,n){var r,i,a,o,l,u,c,p;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:i=e.sent,a=i.split("\n").map(function(e){return e.trim()}),o=[],l=null,u=0;case 10:if(!(u<(null==a?void 0:a.length))){e.next=27;break}if(!(c=a[u]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},p=c.split(":")[1]||"",p.split(",").forEach(function(e){var t=e.split("="),n=d(t,2),r=n[0],i=n[1];r&&i&&(l[r.trim().toLowerCase()]=i.trim())}),e.next=24;break;case 19:if(!c.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(c.includes("jpg")||c.includes("png")||c.includes("jpeg"))&&(l.uri=c.includes("http")?c:t+c,o.push(l),l=null);case 24:u++,e.next=10;break;case 27:return e.abrupt("return",o);case 28:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}();function I(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function L(e,t){return B.apply(this,arguments)}function B(){return(B=u(s.mark(function t(n,r){var a,o,l,u,c,p,m,v,f,g,h,b,x,w,A,E,N,k,T,C,L,B,S,R,P,O,$,X,D,_,F,U,W,q,G,V,z,H,Q,Y,J,K,Z,ee,te,ne,re,ie,ae,oe,le,ue,se,ce,de,pe,me,ve;return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return y=r,a=e(r),o=n.split("/"),l=o.findIndex(function(e){return"dash"===e.toLowerCase()}),u=I(-1!==l?o.slice(0,l+1).join("/"):new URL(n).origin),t.prev=5,t.next=8,fetch(n);case 8:return v=t.sent,t.next=11,v.text();case 11:f=t.sent,g=new DOMParser,h=g.parseFromString(f,"application/xml"),b=(null==a?void 0:a.duration())||(null===(c=i())||void 0===c||null===(p=c.video)||void 0===p?void 0:p.runtime),x=(null==h||null===(m=h.querySelector("MPD > BaseURL"))||void 0===m?void 0:m.textContent)||u+"/",w=h.getElementsByTagName("AdaptationSet"),A=0;case 18:if(!(A<w.length)){t.next=72;break}if(("image"!==(E=w[A]).getAttribute("contentType")||"image/png"!==E.getAttribute("mimeType"))&&"image/jpeg"!==E.getAttribute("mimeType")){t.next=69;break}if(k=E.getElementsByTagName("SegmentTemplate")[0],T=null===(N=k.getElementsByTagName("SegmentTimeline"))||void 0===N?void 0:N[0],!k||!T){t.next=48;break}if(B=T.getElementsByTagName("S"),S=parseInt(null===(C=B[0])||void 0===C?void 0:C.getAttribute("t")),R=parseInt(null===(L=B[0])||void 0===L?void 0:L.getAttribute("d")),P=E.getElementsByTagName("Representation")[0],O=P.getElementsByTagName("EssentialProperty")[0],$=O.getAttribute("value"),X=null==$?void 0:$.split("x"),D=d(X,2),_=D[0],F=D[1],!k){t.next=46;break}if(k.getAttribute("media"),U=k.getAttribute("timescale"),W=(U?R/U:R)/(_*F),q=P.getAttribute("id"),G=Math.round(b/W),V=Math.ceil(G/(_*F)),z=k.getAttribute("media"),parseInt(k.getAttribute("startNumber")),!isNaN(parseInt(V))){t.next=43;break}return t.abrupt("return");case 43:for(H=[],A=0;A<V;A++)Y="/"==(Q=z)[0]?new URL(u).origin:u+"/",H.push({duration:W,layout:$,uri:Y+Q.replace("$Time$",S+A*R).replace("$RepresentationID$",q)});return t.abrupt("return",H);case 46:t.next=69;break;case 48:if(J=E.getElementsByTagName("Representation")[0],K=J.getElementsByTagName("EssentialProperty")[0],Z=K.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=d(ee,2),ne=te[0],re=te[1],!k){t.next=69;break}if(k.getAttribute("media"),ie=k.getAttribute("duration"),ae=k.getAttribute("timescale"),oe=(ae?ie/ae:ie)/(ne*re),le=J.getAttribute("id"),ue=Math.round(b/oe),se=Math.ceil(ue/(ne*re)),ce=k.getAttribute("media"),de=parseInt(k.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){t.next=65;break}return t.abrupt("return");case 65:for(pe=[],me=j(ce),A=0;A<se;A++)ve=me?M(me,A+de):ce,pe.push({duration:oe,layout:Z,uri:x+ve.replace("$Number$",A+de).replace("$RepresentationID$",le)});return t.abrupt("return",pe);case 69:A++,t.next=18;break;case 72:return console.log("No trickplay segment found."),t.abrupt("return",null);case 76:t.prev=76,t.t0=t.catch(5),console.error("Error fetching or parsing MPD:",t.t0);case 79:case"end":return t.stop()}},t,null,[[5,76]])}))).apply(this,arguments)}function j(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function M(e,t){var n=e.match(/%0(\d+)d/);if(!n)return e;var r=parseInt(n[1],10),i=String(t).padStart(r,"0");return e.replace(/\$Number%0\d+d\$/,i)}function S(e){return R.apply(this,arguments)}function R(){return(R=u(s.mark(function t(n){var r,i,a,o,l,u,c,d,p,m,v,f,g,h,b,y;return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(u=e(n),c=u.currentSource(),d=c.src,d=null!==(r=d)&&void 0!==r&&r.includes("blob")?null===(i=window)||void 0===i||null===(a=i.player)||void 0===a?void 0:a.getSource():d,null===(o=d)||void 0===o||!o.includes("m3u8")){t.next=19;break}return t.next=6,A(d,n);case 6:if(!((null==(p=t.sent)?void 0:p.length)>0)){t.next=17;break}return m=(null==p?void 0:p[0])||null,v=m.uri,f=d.substring(0,d.lastIndexOf("/"))+"/",t.next=12,C(f,v);case 12:return g=t.sent,t.next=15,k(g);case 15:h=t.sent,u.thumbnails(h);case 17:t.next=28;break;case 19:if(null===(l=d)||void 0===l||!l.includes("mpd")){t.next=28;break}return t.next=22,L(d,n);case 22:if(!((null==(b=t.sent)?void 0:b.length)>0)){t.next=28;break}return t.next=26,k(b);case 26:y=t.sent,u.thumbnails(y);case 28:case"end":return t.stop()}},t)}))).apply(this,arguments)}function P(t,n){var r=e(t),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var a=document.createElement("div");a.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(i),o.alt="Provider Image",a.append(o),r.el().appendChild(a),r.on("useractive",function(){a.classList.remove("vjs-fade")}),r.on("userinactive",function(){r.paused()||a.classList.add("vjs-fade")}),r.on("fullscreenchange",function(){r.isFullscreen_?a.style.top="3.2rem":a.style.top="1rem"})}}export{h as a,P as b,S as i};
@@ -1 +0,0 @@
1
- import"video.js/dist/video-js.min.css";import{g as e,a as n,b as t,c as o,d as i,s as l,e as r,l as a,f as s,h as u,i as d,j as c,k as v,r as f,m as p,n as m,o as h,p as g,q as y,t as b,u as w,v as k,w as S,x as T,y as I,z as E,A as x,B as j,C as A,D as C,E as D,F as L,G as P,H as N,I as O,J as R,K as _,L as M,M as V,N as B,O as U,P as H,Q as F,R as G}from"./generic-9a919ba4.js";import K from"@babel/runtime/helpers/asyncToGenerator";import q from"@babel/runtime/regenerator";import z from"video.js";import{o as J,g as W,a as Q,b as X,s as Y,c as $}from"./util-389babb5.js";import{g as Z,d as ee,a as ne,e as te}from"./captions-7996e045.js";import{g as oe,t as ie,i as le,a as re}from"./skin-8e2c5488.js";import{g as ae}from"./renditions-65794079.js";import{playSelectedResolution as se}from"./resolution-ed00f17a.js";import{d as ue}from"./browser-512cd55a.js";import{s as de}from"./localisation-0bf399a1.js";import ce from"@babel/runtime/helpers/defineProperty";import ve from"@babel/runtime/helpers/typeof";import fe from"@babel/runtime/helpers/slicedToArray";var pe=function(e){return new Promise(function(n,t){if(me(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}})},me=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},he=function(e){var n,t=oe(e);return(null==t||null===(n=t.audioTracks())||void 0===n?void 0:n.tracks_)||[]||[]},ge=function(e,n){for(var t=oe(e).audioTracks().tracks_||[],o=0;o<t.length;o++){var i=t[o];i.id==n?i.enabled=!0:i.enabled=!1}},ye=function(e,n,t){var o=oe(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},be=function(e){var n=oe(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},we=function(){var e=K(q.mark(function e(n){var t,o,i,l,r;return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=oe(null==n?void 0:n.playerId),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=22;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return l=e.sent,e.prev=5,e.next=8,pe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,l.default(z),e.finish(13);case 16:(r=z.getTech("chromecast"))&&!r.prototype.seeking&&(r.prototype.seeking=function(){}),null!==(i=window)&&void 0!==i&&i.cast?null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=n&&n.airplay&&"Safari"==ue()?null==o||o.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return e.stop()}},e,null,[[5,10,13,16]])}));return function(n){return e.apply(this,arguments)}}(),ke=function(e,n){var t=oe(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,o,i,l,r,a=this.el(),s=z.dom.getPointerPosition(a,n).x;z.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S;if(console.log(u),u&&"CONNECTED"===d){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,c.seek()}})};var Se=function(){var e=K(q.mark(function e(){return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),pe("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)}}(),Te=function(){var e=K(q.mark(function e(){return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then(function(e){z.getPlugin("eme")||z.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Ie=function(){var e=K(q.mark(function e(){var n;return q.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(z),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)}}(),Ee=function(){var e=K(q.mark(function e(){return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-c4b6db11.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)}}(),xe=function(){var e=K(q.mark(function e(){return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs-dash5.es-17cb6067.js");case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),je=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){pe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(z)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(z)})},loadAdsLibrary:Se,loadEMELibrary:Te,loadMuxPlugin:Ie,loadDvrSeekbar:Ee,loadContribDash:xe});function Ae(e){return Ce.apply(this,arguments)}function Ce(){return(Ce=K(q.mark(function e(n){var t;return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,Se();case 3:t&&"Safari"==ue()&&Promise.resolve().then(function(){return je}).then(function(e){e.importAirplay()});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function De(e,n){return Le.apply(this,arguments)}function Le(){return(Le=K(q.mark(function e(n,t){var o,i,l,r,a,s,u,d,c,v;return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u=(null==t?void 0:t.contentType)||"video",d=null==t||null===(o=t[u])||void 0===o?void 0:o.drmEnabled,null==t||null===(i=t[u])||void 0===i||null===(l=i.liveDetails)||void 0===l||l.isDvrEnabled,null==n||n.showPositiveSeekbar,c=(null==t||null===(r=t[u])||void 0===r||null===(a=r.streamingInfo)||void 0===a||null===(s=a.videoAssets)||void 0===s?void 0:s.dash)||null,e.prev=5,e.next=8,Promise.allSettled([d?"Safari"==ue()?Te():"caliente"!=(null===(v=window)||void 0===v?void 0:v.siteName)?xe():Te():"Safari"!=ue()&&c?xe():null,we(n)]);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:case"end":return e.stop()}},e,null,[[5,10]])}))).apply(this,arguments)}var Pe=new Set,Ne=null,Oe=function(n,o,i){var l,r,a,s,u,d,c,v={},f=(null==n?void 0:n.contentType)||"video";v["c3.cm.id"]=(null===(l=n[f])||void 0===l?void 0:l.id)||"Null",v["c3.cm.contentType"]=He(n),v[null==i||null===(r=i.Constants)||void 0===r?void 0:r.IS_LIVE]=!(null==n||!n.linearchannel),v[null==i||null===(a=i.Constants)||void 0===a?void 0:a.STREAM_URL]=o.currentSrc(),v[null==i||null===(s=i.Constants)||void 0===s?void 0:s.VIEWER_ID]="undefined"===e()?"NULL":e(),v["c3.cm.categoryType"]=Ve(n),v["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),v.DRMEnabled=(null===(u=n[f])||void 0===u?void 0:u.drmEnabled)||"None",v.DAIStream=null!==(d=n[f])&&void 0!==d&&null!==(c=d.gist)&&void 0!==c&&c.isSSAIEnabled?"YES":"NO",v[i.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=Be(n),v["c3.cm.genreList"]=_e(n),v["c3.cm.genre"]=Re(n),v["c3.cm.channel"]=Me(n);var p=Ge(t(),n);return v=Object.assign({},v,p)},Re=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},_e=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"},Me=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null==e||null===(n=e[o])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"NULL"},Ve=function(e){return(null==e?void 0:e.contentType)||"null"},Be=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},Ue=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var l=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(t=e[l])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(r)},He=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var Fe,Ge=function(e,t){var i,l,r,a,s,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!t||null!=t&&t.linearchannel)return u;var d=o(),c=n();return u["c3.cm.seriesName"]=(null==t||null===(i=t.video)||void 0===i||null===(l=i.series)||void 0===l?void 0:l.title)||"Null",u["c3.cm.seasonNumber"]=(null==d?void 0:d.toString())||"Null",u["c3.cm.showTitle"]=(null==e||null===(r=e[d-1])||void 0===r||null===(a=r.episodes)||void 0===a||null===(s=a[c-1])||void 0===s?void 0:s.title)||"Null",u["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",u},Ke=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"}},qe=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},ze=function(){var e=K(q.mark(function e(n,t){var o,l,r,a,s,u,d,c,v,f;return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=(null==t?void 0:t.convivaConfig)||{},l=o.trackConvivaPlayerEvent,r=o.paymentHandler,a=o.tveProvider,s=o.enable,u=o.appName,d=(t||{}).token,s){e.next=4;break}return e.abrupt("return");case 4:if(c=oe(n),"function"==typeof(v=l)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,v("getConvivaObject");case 10:if(f=e.sent){e.next=13;break}return e.abrupt("return");case 13:c.ready(function(){var e=c.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=Ke(t.keySystem);v("contentInfo",{DRMEnabled:o})}else v("contentInfo",{DRMEnabled:"None"})}),n||v("contentInfo",{DRMEnabled:"None"})}),c.on("loadstart",function(){var e,n;Ne&&Ne!==c.currentSrc()&&v("playbackEnded"),v("setPlayer",c),Pe.clear(),Ne=c.currentSrc();var o=qe(c.currentType()),l=i(),s=Oe(l,c,f);s[null==f||null===(e=f.Constants)||void 0===e?void 0:e.PLAYER_NAME]=u||"WEB",s[null==f||null===(n=f.Constants)||void 0===n?void 0:n.ASSET_NAME]=Ue(l,t),s.authToken=d||"NULL",s.streamType=o,s.D2CType=r||"NONE",s.subscriberType=a||(r?"D2C":"FREE"),s["c3.cm.affiliate"]=a||"NULL",v("contentInfo",s)}),c.on("loadedmetadata",function(){var e,n=c.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),v("contentInfo",{screenResolution:e})}),c.on("play",function(){Pe.has(c.currentSrc())||(Pe.add(c.currentSrc()),v("playbackStarted",null))}),c.on("ended",function(){Pe.has(c.currentSrc())&&Pe.delete(c.currentSrc()),v("playbackEnded")}),c.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&v("initAdSensor",{player:c,adsLoader:null==e?void 0:e.adsLoader})}),c.on("dispose",function(){null==Pe||Pe.clear(),v("playbackEnded")});case 20:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),Je=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-6308bce9.js").then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?import("./skin-a9e96e66.js").then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?import("./skin-7d9a1801.js").then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?import("./skin-9701a9b0.js").then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?import("./skin-8892d0cc.js").then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?import("./skin-0816e9e9.js").then(function(t){t.initialiseSkin(e,n)}):"VL_SmartTV"==t&&import("./skin-c3287a11.js").then(function(t){t.initialiseSkin(e,n)})},We=[],Qe=0,Xe=null;function Ye(e,n,t){var o,r,a,s,u,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(o=n.watchHistory)||void 0===o||o.apiVersion;var c=null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.profileId,v=Math.floor(e.currentTime()),f=Math.floor(e.duration());null==n||null===(a=n.watchHistory)||void 0===a||a.xapiKey;var p=(null==n||null===(s=n.video)||void 0===s?void 0:s.originalObjectId)||null,m=(null==n||null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,h=Math.floor(e.currentTime()),g=d?100:Math.floor(v/f*100),y={};m?function(e,n,t){var o=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(t),l=$e(o),r=(new Date).getTime(),a=i(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,n){return Object.assign({},e,ce({},n,s[n]))},{}),d=l.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===Fe});d<0?l.push(Object.assign({content:u},e,{addedDate:r,updateDate:r})):l[d]=Object.assign({},l[d],e,{updateDate:r});localStorage.setItem("".concat(o),JSON.stringify(l))}(y={completed:d,watchedTime:h,watchedPercentage:g},c,n.siteOwner):(y=Object.assign({videoId:Fe,watchedTime:h,watchedPercentage:g,doneWatching:d,profileId:c},Xe&&{seriesId:Xe},p&&{originalObjectId:p}),l(y).then(function(e){}).catch(function(e){})),Qe=v+t}function $e(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Ze(e,n,t){var o=$e(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),i}var en=!1,nn=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!en){var l=tn(e,"videoAssets","secondaryVideoAssets"),s=r(l,n);return s&&a(n,s),en=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function tn(e,n,t){if(Array.isArray(e))return e.map(function(e){return tn(e,n,t)});if(null!==e&&"object"===ve(e)){var o={};return Object.keys(e).forEach(function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=tn(e[i],n,t)}),o}return e}function on(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return ln(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ln(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,r=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return r=e.done,e},e:function(e){a=!0,l=e},f:function(){try{r||null==t.return||t.return()}finally{if(a)throw l}}}}function ln(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}var rn=function(e,n,t,o){var l,r,a,v,f=o.res,p=o.sres,m=oe(e),h=(null==f?void 0:f.contentType)||"video",g=(null==f?void 0:f[h].drmEnabled)||!1,y=(null==f||null===(l=f[h])||void 0===l||null===(r=l.streamingInfo)||void 0===r?void 0:r.isLiveStream)||!1,b=(null==f||null===(a=f[h])||void 0===a||null===(v=a.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1;s(f),m&&(m.on("loadstart",function(){y?t.resolve({status:!0,msg:"Video Loaded",response:f}):t.resolve(Object.assign({status:!0,msg:"Player Initialised"},p?{seriesResponse:p,response:f}:{response:f}))}),m.on("loadeddata",function(){var t,o,l,r=Z(e);if(null==r||r.map(function(n){return ee(e,n.id)}),b&&"Safari"===ue())try{var a;null==m||null===(a=m.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==m||!m.muted())&&ye(e,sessionStorage.getItem("volume")||"100");var s=i();if(u(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(o=n.watchHistory)&&void 0!==o&&o.saveOffline)){var d,c,v=Object.assign({},n,f);!function(e,n,t){var o,i,l;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(Xe=null==n||null===(i=n.series)||void 0===i?void 0:i.id),We=[],Qe=0,Fe=t;var r=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,a=oe(e);a&&(a.on("timeupdate",function(){var e=Math.floor(a.currentTime());We.includes(Qe)||(e==Qe?(We.push(e),Ye(a,n,r)):e>Qe&&(Qe=e+r))}),a.one("ended",function(){Ye(a,n,r,!0)}))}(e,v,null==s||null===(d=s.video)||void 0===d||null===(c=d.gist)||void 0===c?void 0:c.id)}if(null!=n&&null!==(l=n.analytics)&&void 0!==l&&l.muxKey&&null!=m&&m.mux){var p,h,g,y,w,k,S=(null===(p=i())||void 0===p?void 0:p.video)||(null==f?void 0:f.video),T=null==S?void 0:S.gist,I={env_key:null==n||null===(h=n.analytics)||void 0===h?void 0:h.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==S||null===(y=S.series)||void 0===y?void 0:y.title,video_stream_type:null!=S&&null!==(w=S.streamingInfo)&&void 0!==w&&w.isLiveStream?"live":"video",viewer_user_id:null==n||null===(k=n.analytics)||void 0===k?void 0:k.userId};m.mux({debug:!1,data:I})}}),m.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];m.trigger("subtitlechanged",n)}),m.on("subtitlechanged",function(e,n){var t,o,i,l,r,a,s,u,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S,p=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(d=u.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===f){var m,h=p.getMediaSession(),g=h.media.tracks.filter(function(e){return"TEXT"==e.type});m=n?new chrome.cast.media.EditTracksInfoRequest([g[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),h.editTracksInfo(m)}}),m.tech_.on("retryplaylist",function(){y&&nn(f,e)}),m.on("error",function(){var n,o;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&y)?nn(f,e):(d(e,(null==m||null===(n=m.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==m||null===(o=m.error())||void 0===o?void 0:o.message)||"Some error occured",response:f}))}),m.one("play",function(){var e;if(null!=n&&null!==(e=n.series)&&void 0!==e&&e.enable){var t,o,l,r=null===(t=i())||void 0===t||null===(o=t.video)||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.id,a=c(),s=(null==a?void 0:a.get(r))||{t:0,p:0},u=s.t,d=s.p;u&&d<95&&setTimeout(function(){m.currentTime(u)},0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout(function(){m.currentTime(null==n?void 0:n.watchHistoryResumeTime)},0);if(null!=m&&m.dvrSeekbar)try{m.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}),m.on("volumechange",function(){var e=100*m.volume().toFixed(2);m.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),m.on("chromecastDisconnected",function(){if(y){m.currentSource();for(var e=m.textTracks(),n=e.length-1;n>=0;n--)m.removeRemoteTextTrack(e[n])}}),m.one("loadeddata",function(){var e,n=(null==m||null===(e=m.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if("object"==ve(m.dash)){var t,o,i,l=null==m||null===(t=m.dash)||void 0===t||null===(o=t.mediaPlayer)||void 0===o?void 0:o.getTracksFor("audio"),r=null==l?void 0:l.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),a=on(n);try{for(a.s();!(i=a.n()).done;){var s=i.value;if(r&&(null==s?void 0:s.id)=="dash-audio-".concat(r.index)){s.enabled=!0;break}}}catch(e){a.e(e)}finally{a.f()}}else{var u,d=on(n);try{for(d.s();!(u=d.n()).done;){var c,v,f,p=u.value;("Chrome"==ue()||"Edge"==ue()&&(null!==(c=navigator)&&void 0!==c&&null!==(v=c.userAgent)&&void 0!==v&&v.includes("Macintosh")||!g))&&null!=p&&null!==(f=p.label)&&void 0!==f&&f.includes("5.1")?m.audioTracks().removeTrack(p):"main"==p.kind?p.enabled=!0:p.enabled=!1}}catch(e){d.e(e)}finally{d.f()}}}))};function an(e,n){var t,o,i,l=oe(e),r=null==l||null===(t=l.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,a=document.getElementsByTagName("video")[0];null===(i=document)||void 0===i||i.addEventListener("keydown",function(t){var o;if(un.enabled&&"input"!=t.target.localName){var i=t.key,s=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(i)&&(t.preventDefault(),null==a||a.focus()),i){case" ":null==r||r.click();break;case"m":case"M":l.muted(!l.muted());break;case"f":case"F":null===(o=document.querySelector(".vjs-fullscreen-control"))||void 0===o||o.click();break;case"ArrowLeft":s&&!1===n.liveui||f(e,10);break;case"ArrowRight":s||v(e,10)}}},!0)}var sn,un=(sn=!0,{enable:function(){sn=!0},disable:function(){sn=!1},get enabled(){return sn}});function dn(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return cn(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?cn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,r=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return r=e.done,e},e:function(e){a=!0,l=e},f:function(){try{r||null==t.return||t.return()}finally{if(a)throw l}}}}function cn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}var vn,fn=(vn="",{set:function(e){e&&(vn=e)},get:function(){return vn}});function pn(e,n){return mn.apply(this,arguments)}function mn(){return(mn=K(q.mark(function e(n,t){var o,i,l,a,s,u,d,c,v,f,m,h,g,y;return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return oe(n),o=r(t,n),i=o.src,l=i.replace("/dash/","/session/").replace("master","session"),l=p(l,n,t),a=hn(l),s=fe(a,2),u=s[0],d=s[1],l=new URL(l.split("?")[0]),Object.keys(d).length>0&&Object.entries(d).forEach(function(e){var n=fe(e,2),t=n[0],o=n[1];l.searchParams.set(t,o)}),e.prev=8,e.next=11,fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adsParams:Object.assign({},u)})});case 11:return c=e.sent,e.next=14,c.json();case 14:return v=e.sent,f="https://"+new URL(l).hostname,m=v.trackingUrl,h=v.manifestUrl,g=f+m,y=f+h,fn.set(g),console.log("%c TRACKING URL","background: #bdf369; color: #000",g),o.src=y,e.abrupt("return",o);case 26:return e.prev=26,e.t0=e.catch(8),e.abrupt("return",o);case 29:case"end":return e.stop()}},e,null,[[8,26]])}))).apply(this,arguments)}function hn(e){var n={},t=e.split("?")[1];if(!t)return[{},{}];var o,i=dn(t.split("&"));try{for(i.s();!(o=i.n()).done;){var l=o.value.split("="),r=fe(l,2),a=r[0],s=r[1];n[decodeURIComponent(a)]=decodeURIComponent(s||"")}}catch(e){i.e(e)}finally{i.f()}for(var u={},d={},c=0,v=Object.entries(n);c<v.length;c++){var f=fe(v[c],2),p=f[0],m=f[1];if(p.startsWith("ads."))u[p.replace(/^ads\./,"")]=m;else d[p]=m}return[u,d]}function gn(e,n){return yn.apply(this,arguments)}function yn(){return yn=K(q.mark(function e(n,t){var o,i,l,r,a,s;return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:s=function(e,t,o,i,l){var s=oe(n);if(!s.seeking()){t.startTimeInSeconds,t.durationInSeconds,Math.floor(s.currentTime());var u,d=dn(o);try{for(d.s();!(u=d.n()).done;){var c,v,f,p=u.value,m=p.eventType,h=p.beaconUrls,g=p.startTimeInSeconds,y=p.startTime,b=p.durationInSeconds,w=g||0,k=h,S=(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(f=v.ads)||void 0===f?void 0:f.adEventHandler)||null,T="".concat(w,"_").concat(m),I=r.get("pod-".concat(l))||[];if(console.warn(e,w,"map:",m,"condition1:",e>=w,"map:",r),e>=w&&!I.includes(T)){I.push(T),r.set("pod-".concat(l),I);try{a(m,t,k,s)}catch(e){console.error("Error when calling triggerAdBeacon:",e,m,t)}if("function"==typeof S)try{var E;S({adsData:{eventType:m,startTimeInSeconds:g,startTime:y,durationInSeconds:b,ad:null==t||null===(E=t.ads)||void 0===E?void 0:E[i],adIndex:i}})}catch(e){console.error("Error when calling ads callback:",e)}}}}catch(e){d.e(e)}finally{d.f()}}},a=function(e,n,t,o){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})})},l=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},o=fn.get(),oe(n).one("loadeddata",function(){o&&i(o)}),i=function(){var e=K(q.mark(function e(t){var o,i,r,a,u,d,c,v,f,p,m,h,g,y,b,w,k,S,T,I,E,x,j;return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return T=function(e){document.removeEventListener("pointermove",S),document.removeEventListener("pointerup",T),0===e.button&&k()},S=function(e){},k=function(){var e,n=f.currentTime(),t=null,o=dn(v);try{for(o.s();!(e=o.n()).done;){var i=e.value,l=i.startTimeInSeconds,r=i.durationInSeconds,a=i.ads,s=Math.floor(l+r);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>s||n>l)&&!h.has(l)||n>=l&&n<=s)&&(t=l,h.set(l,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout(function(){f.currentTime(t+.4)},100))},e.next=5,fetch(t);case 5:return u=e.sent,e.next=8,u.json();case 8:d=e.sent,c=d.avails,v=[],f=oe(n),p=f.controlBar.progressControl,m=p.seekBar.el(),c.map(function(e){var n,t;v.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:(null==e||null===(n=e.adBreakTrackingEvents)||void 0===n||null===(t=n.filter(function(e){return"breakStart"==(null==e?void 0:e.eventType)}))||void 0===t?void 0:t[0])||[]})}),v.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=f.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var i=n/o*100,l=document.createElement("div");l.className="vjs-seekbar-marker",l.style.left="".concat(i,"%"),l.style.position="absolute",l.style.top="0",l.style.bottom="0",l.style.width="2px",l.style.backgroundColor="#fecc09",l.style.left="".concat(i,"%"),l.style.pointerEvents="none",m.appendChild(l)}}),h=new Map,g=-1,y=(null===(o=document)||void 0===o||null===(i=o.getElementsByClassName("tvProviderImage"))||void 0===i?void 0:i[0])||null,b=(null==f||null===(r=f.controlBar)||void 0===r?void 0:r.getChild("videoSelector"))||null,w=(null==f||null===(a=f.controlBar)||void 0===a?void 0:a.getChild("seriesV2"))||null,k(),f.on("timeupdate",ie(function(){var e=f.currentTime();if(e!==g){g=e;for(var n=!1,t=function(){var t=v[o],i=t.startTimeInSeconds,r=t.durationInSeconds,a=t.ads,u=i+r;if(e>=i-2.5&&e<=u+2.5){e<=u&&Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n=!0),e>u&&h.set(i,!0),un.disable(),y&&y.classList.add("vjs-hidden"),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),w&&(w.el().style.pointerEvents="none",w.el().classList.add("vjs-hidden")),p.el().style.visibility="hidden";for(var d=e-i,c=0,f=0,m=0;m<a.length;m++){var g,k=null==a||null===(g=a[m])||void 0===g?void 0:g.durationInSeconds;if(d<c+k){f=m;break}c+=k}var S=a[f],T=d-c,E=Math.max(0,(null==S?void 0:S.durationInSeconds)-T),x=Math.round(E);I.style.display="block",j.textContent="".concat(f+1," of ").concat(a.length," • ").concat(l(x));var A=[];return null==a||a.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});A.push.apply(A,n)}),Array.isArray(a)&&0==(null==a?void 0:a.length)&&A.push(null==t?void 0:t.podSlotImpressionBeacon),s(e,t,A,f,o),"break"}},o=0;o<v.length;o++){if("break"===t())break}n||(I.style.display="none",p.el().style.visibility="visible",b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),w&&(w.el().style.pointerEvents="auto",w.el().classList.remove("vjs-hidden")),y&&y.classList.remove("vjs-hidden"),un.enable())}},1e3)),p.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",S),document.addEventListener("pointerup",T))}),(I=document.createElement("div")).className="ssai-ad-container",(E=document.createElement("div")).className="sponsored-adbox",(x=document.createElement("div")).className="sponsored-text",x.textContent="Sponsored Ad",E.append(x),(j=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",I.append(E),I.append(j),f.el().appendChild(I);case 40:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),r=new Map;case 9:case"end":return e.stop()}},e)})),yn.apply(this,arguments)}var bn,wn=function(e,n,t,o){var i,l,s,u,c,v,f,p,w,k,S,T,I,E,x,j,A,C,D,L,P,N,O,R,_,M,V=n.res,B=void 0===V?null:V,U=n.sres,H=void 0===U?null:U,F=null!=t&&t.chromecastReceiverId?["chromecast","html5"]:["html5"],G=(null===(i=B)||void 0===i?void 0:i.contentType)||"video",J=le(null===(l=B)||void 0===l||null===(s=l[G])||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.videoImageUrl)||le(null===(c=B)||void 0===c||null===(v=c[G])||void 0===v||null===(f=v.gist)||void 0===f||null===(p=f.imageGist)||void 0===p?void 0:p.r16x9),W=(null===(w=B)||void 0===w||null===(k=w[G])||void 0===k||null===(S=k.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,Q=(null===(T=B)||void 0===T||null===(I=T[G])||void 0===I||null===(E=I.streamingInfo)||void 0===E?void 0:E.isLiveStream)||!1,X=m(B);B=Object.assign({},B,{audioAssetSource:null==t?void 0:t.audioAssetSource});var Y="MEDIA_TAILOR"==(null===(x=window)||void 0===x||null===(j=x.app_data)||void 0===j||null===(A=j.appcmsMain)||void 0===A||null===(C=A.adsConfig)||void 0===C?void 0:C.vodAdSticherProvider)||!1,$=(null==t?void 0:t.latency)||6,Z=(_={enableSmoothSeeking:!0,controls:0!=(null==t?void 0:t.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==t?void 0:t.muted)||!1,autoplay:(null==t?void 0:t.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!1},muteToggle:"multiplayer"==t.skin,liveui:W},ce(_,"autoplay",null==t?void 0:t.autoplay),ce(_,"normalizeAutoplay",(null==t?void 0:t.autoplay)&&!X),ce(_,"loop",(null==t?void 0:t.loop)||!1),ce(_,"audioPosterMode",null==t?void 0:t.audioPosterMode),ce(_,"html5",Object.assign({dash:Object.assign({},!z.browser.IS_SAFARI&&{useTTML:!0},(null==t?void 0:t.debugConfig)&&(null==t||null===(D=t.debugConfig)||void 0===D?void 0:D.enable)&&{debug:!0,logLevel:null!=t&&null!==(L=t.debugConfig)&&void 0!==L&&L.logLevel?null==t||null===(P=t.debugConfig)||void 0===P?void 0:P.logLevel:"DEBUG"},{updateSettings:{streaming:{delay:{liveDelay:$},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:Object.assign({},"IE"==ue()&&{enableStallFix:!0,stallSeek:1}),abr:{autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:Object.assign({liveRangeSafeTimeDelta:$,useDevicePixelRatio:!0,experimentalLLHLS:(null==t?void 0:t.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==t||null===(N=t.customData)||void 0===N?void 0:N.overrideNative)&&{overrideNative:!0},{enableLowInitialPlaylist:!0}),debug:!0,nativeTextTracks:"Safari"==ue()},0==(null==t||null===(O=t.customData)||void 0===O?void 0:O.nativeAudioTracks)&&{nativeAudioTracks:!1},0==(null==t||null===(R=t.customData)||void 0===R?void 0:R.nativeVideoTracks)&&{nativeVideoTracks:!1})),ce(_,"poster",J),ce(_,"techOrder",F),ce(_,"chromecast",{requestCustomDataFn:function(n){var t=oe(e),o=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind});return function(e,n,t){var o,i,l,r,a,s,u,d,c,v,f=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){var m,h,g,y,b,w,k,S;p.isDrmEnabled=!0;var T=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,I=(null==T?void 0:T.url)||(null==n||null===(h=n.keySystemOptions)||void 0===h||null===(g=h[0])||void 0===g||null===(y=g.options)||void 0===y?void 0:y.serverURL);p.licenseUrl=I;var E=(null==T?void 0:T.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(S=k.httpRequestHeaders)||void 0===S?void 0:S["X-AxDRM-Message"]);p.licenseToken=E}var x=(null==e||null===(o=e[f])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";p.contentType=x;var j=null==e||null===(l=e[f])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;p.duration=j;var A=null==e||null===(a=e[f])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;p.mediaTitle=A;var C=null==e||null===(u=e[f])||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return p.mediaImage=C,p.subTitles=t,p.DVR=(null==e||null===(c=e[f])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(B,n,o)},modifyLoadRequestFn:function(n){var t,o,i,l,r,a=oe(e),s=(null==a?void 0:a.currentSource())||{};!(null===(t=B)||void 0===t||null===(o=t[G])||void 0===o||null===(i=o.streamingInfo)||void 0===i||null===(l=i.videoAssets)||void 0===l?void 0:l.is4K)&&1||null!=s&&s.src&&null!=s&&null!==(r=s.src)&&void 0!==r&&r.includes(".m3u8")&&(n.media.hlsSegmentFormat="fmp4",n.media.hlsVideoSegmentFormat="fmp4");return n}}),_);if(!z.getPlayers()[e]){null!==(M=window)&&void 0!==M&&M.customData.isSmartTV&&(Z.spatialNavigation={enabled:!0,horizontalSeek:!0}),z.log.level("debug");var ee=z(e,Z,function(){var n=K(q.mark(function n(){var i,l,s,u,c,v,f,p,m,w,k,S,T,I,E,x,j,A,C,D,L;return q.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(ee),console.log(z.VERSION),console.log(z.getPlugins()),n.next=5,De(t,B);case 5:if(null!==(i=window)&&void 0!==i&&i.customData.isSmartTV&&ee.spatialNavigation.start(),T=null===(l=B)||void 0===l||null===(s=l[G])||void 0===s||null===(u=s.liveDetails)||void 0===u?void 0:u.startOverTime,Q&&o.resolve(Object.assign({status:!0,msg:"Player Initialised"},H?{seriesResponse:H,response:B}:{response:B})),g(e,null==t?void 0:t.analyticsCb),ze(e,t),/Android/i.test(navigator.userAgent)&&(z.options.vhs.overrideNative=!0),W&&ke(e,T),!X||null!=t&&null!==(c=t.customData)&&void 0!==c&&c.disableAds||y(e,X,B),I=r(B,e),console.log(I),null!=t&&t.nearestClusterUrl&&(I=b(I,t.nearestClusterUrl)),!Y){n.next=20;break}return n.next=19,pn(e,B);case 19:I=n.sent;case 20:I?a(e,I):(o.reject({status:!1,msg:"Incompatible / Missing Source",response:B}),d(e,"Incompatible / Missing Source")),((null===(v=B)||void 0===v||null===(f=v[G])||void 0===f||null===(p=f.contentDetails)||void 0===p||null===(m=p.closedCaptions)||void 0===m?void 0:m.length)>0||(null===(w=B)||void 0===w||null===(k=w[G])||void 0===k||null===(S=k.closedCaptions)||void 0===S?void 0:S.length)>0)&&(L=(null===(x=B)||void 0===x||null===(j=x[G])||void 0===j||null===(A=j.contentDetails)||void 0===A?void 0:A.closedCaptions)||(null===(C=B)||void 0===C||null===(D=C[G])||void 0===D?void 0:D.closedCaptions),E=L.filter(function(e){return"VTT"===e.format}),ne(e,E)),null!=t&&t.disableControls?h(e):Je(e,Object.assign({},t,Z,{liveVideo:Q,isDvrEnabled:W,res:B,sres:H})),rn(e,Object.assign({},t,Z,{liveVideo:Q}),o,{res:B,sres:H});case 24:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}())}},kn={spinco:"e8f2c1a7-5d94-4a1f-93ea-7c0b9186f1cd"},Sn=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,l=Tn(e);wn(i,{res:l},e,{resolve:t,reject:o})},Tn=function(e){var n,t,o=null==e?void 0:e.streamingInfo,i=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,l=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,r=null==e?void 0:e.token,a=w(r),s=null==a?void 0:a.site;return Object.assign({id:null==kn?void 0:kn[s]},!l&&{directPlaybackUrl:null==i?void 0:i.url},{video:{drmEnabled:l,streamingInfo:{videoAssets:{widevine:null==i?void 0:i.widevine,fairPlay:null==i?void 0:i.fairPlay,playReady:null==i?void 0:i.playReady}},liveDetails:{isDvrEnabled:null==o?void 0:o.isDvrEnabled}}})};function In(e,n){return En.apply(this,arguments)}function En(){return(En=K(q.mark(function e(n,t){var o,i,l,r,a,u;return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,i=t.reject,l=null==n?void 0:n.videoId,r=null==n?void 0:n.playerId,a=!(null==n||!n.anonymousId),e.next=6,I();case 6:u=e.sent,k(l,u).then(function(e){var t,d,c,v;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(d=t.video)||void 0===d||null===(c=d.gist)||void 0===c?void 0:c.contentType,s(null==e?void 0:e.data);var f,p=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(v=n.watchHistory)&&void 0!==v&&v.enable&&!a)if((null===(f=n.watchHistory)||void 0===f?void 0:f.saveOffline)||!1){var m,h,g,y=Ze((null===(m=n.watchHistory)||void 0===m?void 0:m.profileId)||"",l,null==n?void 0:n.siteOwner);if(y&&y.length)n.watchHistoryResumeTime=(null===(h=y[0])||void 0===h?void 0:h.watchedTime)||null,n.watchedPercentage=(null===(g=y[0])||void 0===g?void 0:g.watchedPercentage)||null;p.contentType="video",wn(r,{res:p},n,{resolve:o,reject:i})}else S(l,u).then(function(e){var t,o,i,l,r,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(l=i.watchHistory)||void 0===l||l.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,p.contentType="video"}).catch(function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))}).finally(function(){wn(r,{res:p},n,{resolve:o,reject:i})});else wn(r,{res:p},n,{resolve:o,reject:i})}).catch(function(e){T(e,r,i,l)});case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function xn(e,n){return jn.apply(this,arguments)}function jn(){return(jn=K(q.mark(function e(n,t){var o,i,l,r,a;return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,i=t.reject,e.next=3,I();case 3:l=e.sent,r=null==n?void 0:n.playerId,a=null==n?void 0:n.epg,E(a,l).then(function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==a?void 0:a.channelId,wn(r,{res:t},n,{resolve:o,reject:i})}).catch(function(e){T(e,r,i,videoId)});case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function An(e,n){return Cn.apply(this,arguments)}function Cn(){return(Cn=K(q.mark(function e(n,t){var o,i,l,r,a,u,d;return q.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.resolve,l=t.reject,e.next=3,I();case 3:r=e.sent,a=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,A.set(parseInt(u)),d=null==n||null===(o=n.series)||void 0===o?void 0:o.id,x(d,r).then(function(e){var t,o,u,c=e.data,v=e.data.seasons;C(v);var f=videoId||(null==v||null===(t=v[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(u=o[0])||void 0===u?void 0:u.id);j(d,r),k(f,r).then(function(e){var t,o,r;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.contentType,s(e.data),wn(a,{res:null==e?void 0:e.data,sres:c},n,{resolve:i,reject:l})}).catch(function(e){T(e,a,l,videoId)})}).catch(function(e){T(e,a,l)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Dn(){return{loadVideoInstantly:D,onTimeUpdate:J,getVideoDuration:W,getVideoCurrentTime:Q,onVideoEnded:X,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=K(q.mark(function n(t,o){var i,l,r,a,s,u,d,c,v,f,p,m,h,g,y,b,w,S,I,E,x,j,A;return q.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!O(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(p=(null==e?void 0:e.videoSourceUrl)||!1,m=null==e?void 0:e.asat,h=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,g=null==e?void 0:e.videoId,y=(null==e||null===(l=e.series)||void 0===l?void 0:l.enable)||!1,b=(null==e?void 0:e.streamingInfo)||!1,window.videoId=g,w=null==e?void 0:e.token,!U(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",w),H().set(null==e?void 0:e.refreshToken),w&&!F(w)){n.next=16;break}return o({status:!1,msg:"".concat(w?"Token is expired !":"Missing Authorization Token"),response:{token:w}}),n.abrupt("return");case 16:bn=JSON.parse(atob(w.split(".")[1]));case 17:return e.isAnonymousUser=!(null===(r=bn)||void 0===r||!r.anonymousId),e.siteOwner=(null===(a=bn)||void 0===a?void 0:a.site)||null,e.userId=(null===(s=bn)||void 0===s?void 0:s.userId)||null,window.sessionStorage.setItem("uid",null===(u=bn)||void 0===u?void 0:u.userId),window.watchHistory=e.watchHistory||null,S=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(d=e.series)&&void 0!==d&&d.enable?null:null==e?void 0:e.chromecastReceiverId,I=(null==e||null===(c=e.analytics)||void 0===c?void 0:c.gaId)||null,(E=null==e?void 0:e.errors)&&(window.customErrors=E),window.customData=null==e?void 0:e.customData,de(null==e||null===(v=e.customData)||void 0===v?void 0:v.localisation),B.set(e.apiBaseUrl),null!=e&&e.skin&&!re(e.skin)||(e.skin="VL_ONE"),n.next=33,Ae(e);case 33:I&&pe("https://www.googletagmanager.com/gtag/js?id=".concat(I)).then(function(){return G(I)}).catch(function(e){}),(x=null===(f=document)||void 0===f?void 0:f.getElementById("".concat(S)))&&x.addEventListener("contextmenu",function(e){return e.preventDefault()}),p?(A={directPlaybackUrl:p,id:j="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},m?k(j,w).then(function(n){var i=(null==n?void 0:n.data)||{};wn(S,{res:Object.assign({},i,A)},e,{resolve:t,reject:o})}).catch(function(e){T(e,S,o,j)}):wn(S,{res:A},e,{resolve:t,reject:o})):b?Sn(e,{resolve:t,reject:o}):y?An(e,{resolve:t,reject:o}):h?xn(e,{resolve:t,reject:o}):In(e,{resolve:t,reject:o});case 37:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:ae,skip:v,getPlayer:oe,play:L,pause:P,isPaused:N,detectBrowser:ue,rewind:f,loadVideo:a,seekToTimeStamp:Y,isPlayerInitialised:O,load:R,authenticateLC:_,dispose:M,enableCaptions:te,disableCaptions:ee,getCaptions:Z,getAudioTracks:he,enableAudioTrack:ge,playSelectedResolution:se,getSource:r,setVolume:ye,getVolume:be,disableControls:h,setPlaybackSpeed:$,getEntitlementData:V}}export{Dn as V,an as i,gn as s};
@@ -1 +0,0 @@
1
- import{g as e,t}from"./skin-8e2c5488.js";import{S as n,b as r,d as i}from"./generic-258d34e7.js";import{s as a}from"./autoNextVideo-793707f8.js";import o 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,g=[],h=function(t,i){var a;if(null!=i&&null!==(a=i.series)&&void 0!==a&&a.enable){var o;g=[];var l=r();null==l||l.map(function(e){var t;return(t=g).push.apply(t,e.episodes)}),null==i||null===(o=i.series)||void 0===o||o.cb}else{var u,s;g=(null==i||null===(u=i.relatedVideos)||void 0===u?void 0:u.content)||[],null==i||null===(s=i.relatedVideos)||void 0===s||s.cb}var c=e(t);c.on("timeupdate",function(){var e,t,r=Math.floor(c.currentTime()),i=c.duration(),a=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-r<=10&&n()<=(null===(t=g)||void 0===t?void 0:t.length)-1?a&&(a.style.visibility="visible"):a&&(a.style.visibility="hidden")});var d,p=g.filter(function(e,t){return t==n()});if((null==p?void 0:p.length)>0)if(null!==(d=document.getElementsByClassName("next-ep-preview"))&&void 0!==d&&d[0]){var m,v,f,h,y,x,w,A,E,N,k,T;(null===(m=document.getElementsByClassName("next-ep-preview"))||void 0===m?void 0:m[0]).style.visibility="hidden";var C=null===(v=document.getElementsByClassName("next-ep-title"))||void 0===v?void 0:v[0],I=null===(f=document.getElementsByClassName("next-ep-img"))||void 0===f?void 0:f[0],L=null===(h=document.getElementsByClassName("next-ep-content"))||void 0===h?void 0:h[0],B=null===(y=p[0])||void 0===y?void 0:y.title;(null===(x=B)||void 0===x?void 0:x.length)>60&&(B=B.substr(0,60)+"..."),C.textContent="".concat(B),I.src=(null===(w=p[0])||void 0===w||null===(A=w.gist)||void 0===A||null===(E=A.imageGist)||void 0===E?void 0:E.r16x9)||(null==p||null===(N=p[0])||void 0===N?void 0:N.img)||(null===(k=window)||void 0===k||null===(T=k.customData)||void 0===T?void 0:T.fallbackImage),L.onclick=function(){return b(t)}}else{var j,M,S,R,P,O,$,X,D=document.createElement("div");D.className="next-ep-preview",D.style.visibility="hidden",document.getElementById(t).append(D);var _=document.createElement("div");_.className="next-ep-header",_.textContent="Next up";var F=null===(j=p[0])||void 0===j?void 0:j.title,U=document.createElement("img");U.className="next-ep-img",U.src=(null===(M=p[0])||void 0===M||null===(S=M.gist)||void 0===S||null===(R=S.imageGist)||void 0===R?void 0:R.r16x9)||(null==p||null===(P=p[0])||void 0===P?void 0:P.img)||(null===(O=window)||void 0===O||null===($=O.customData)||void 0===$?void 0:$.fallbackImage);var W=document.createElement("div");W.className="next-ep-title",(null===(X=F)||void 0===X?void 0:X.length)>60&&(F=F.substr(0,60)+"..."),W.textContent="".concat(F);var q=document.createElement("div");q.className="next-ep-content",q.append(U),q.append(W),q.onclick=function(){return b(t)},D.append(_),D.append(q)}},b=function(t,r){var i=e(t),o=Math.floor(i.currentTime());if(Math.floor(i.duration())!=o){i.pause(t);var l=n();a(l,t,g)}};p={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},m=function e(){var t,n,r,i,a;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(a in i=t[r])i.hasOwnProperty(a)&&("object"===o(i[a])?n[a]=e(n[a],i[a]):n[a]=i[a]);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,a,o,l,u,s,c;if(i=m({},p,e),o=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=o.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(r=document.createElement("div")).className="vjs-thumbnail-holder",a=document.createElement("img"),r.appendChild(a),a.src=i[0].src,a.className="vjs-thumbnail",m(a.style,i[0].style),a.style.left||a.style.right||(a.onload=function(){a.style.left=-a.naturalWidth/2+"px"}),u=o.duration(),o.on("durationchange",function(e){u=o.duration()}),o.on("loadedmetadata",function(e){u=o.duration()}),(l=o.controlBar.progressControl).el().appendChild(r),s=function(e){var t,n,o,s,c,d,p,g,h,b;for(n in o=0,h=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,p=((b=f(l.el()).getBoundingClientRect()).width||b.right)+h,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=f(l.el()).getBoundingClientRect().left+h,t=Math.floor((s-l.el().offsetLeft)/l.width()*u),i)t>n&&(o=Math.max(o,n));(c=i[o]).src&&a.src!=c.src&&(a.src=c.src),c.style&&a.style!=c.style&&m(a.style,c.style),s+(g=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}(a,c.width||i[0].width)/2)>p?s-=s+g-p:s<g&&(s=g),r.style.left=s+"px"},null!==(t=window)&&void 0!==t&&null!==(n=t.customData)&&void 0!==n&&n.isSmartTV){var d=function(){var e,t,n=0,u=(null===(e=l.el_.children[0].children[2])||void 0===e?void 0:e.offsetWidth)||5;u<65?u=5:u>=o.el().offsetWidth-180?u=o.el().offsetWidth-240:u-=58;var s=o.currentTime();for(t in i)s>t&&(n=Math.max(n,t));var c=i[n];c.uri&&""!=c.uri&&a.src!=c.uri?(a.src=c.uri,r.style.left=u+"px",a.style.opacity="1"):(r.style.left="-1000px",a.style.opacity="0")},g=null;l.el_.children[0].onfocus=function(){d(),g=setInterval(function(){d()},250)},l.el_.children[0].addEventListener("blur",function(){try{r.style.left="-1000px",a.style.opacity="0",g&&(clearInterval(g),g=null)}catch(e){}})}else l.on("mousemove",s),l.on("touchmove",s);function h(){document.removeEventListener("pointermove",s),document.removeEventListener("pointerup",h),c()}l.on("pointerdown",function(e){document.addEventListener("pointermove",s),document.addEventListener("pointerup",h)}),c=function(e){r.style.left="-1000px"},l.on("mouseout",c),l.on("touchcancel",c),l.on("touchend",c),o.on("userinactive",c)});var y="my-player";function x(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 w(){return(w=u(s.mark(function e(t){var n,r,i,a,o,l,u,c,p,m,v,f,g,h,b,y,x,w,A,E,N,k,T,C;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t._tiles){e.next=2;break}return e.abrupt("return",t._tiles);case 2:return e.prev=2,e.next=5,fetch(t.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return r=e.sent,e.next=11,createImageBitmap(r);case 11:for(i=e.sent,a=t.layout.split("x").map(Number),o=d(a,2),l=o[0],u=o[1],c=i.width/u,p=i.height/l,m=[],v=0;v<l;v++)for(f=0;f<u;f++)(g=document.createElement("canvas")).width=c,g.height=p,g.getContext("2d").drawImage(i,f*c,v*p,c,p,0,0,c,p),h=g.toDataURL("image/png"),m.push({uri:h,duration:t.duration}),t._tiles=m;return e.abrupt("return",m);case 20:for(e.prev=20,e.t0=e.catch(2),b=t.layout.split("x").map(Number),y=d(b,2),x=y[0],w=y[1],A=[],E=0;E<x*w;E++)A.push({uri:null===(N=window)||void 0===N||null===(k=N.app_data)||void 0===k||null===(T=k.appcmsMain)||void 0===T||null===(C=T.images)||void 0===C?void 0:C.placeholderCover,duration:t.duration});return e.abrupt("return",A);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function A(e,t){return E.apply(this,arguments)}function E(){return(E=u(s.mark(function e(t,n){var r,i;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return y=n,e.prev=1,e.next=4,fetch(t);case 4:return r=e.sent,e.next=7,r.text();case 7:return i=e.sent,e.abrupt("return",x(i));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}},e,null,[[1,11]])}))).apply(this,arguments)}function N(t,n,r){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),a=e(y);if(i&&a){var o=i.getBoundingClientRect(),l=(t.clientX-o.left)/o.width,u=function(e,t){var n,r;if(!t||0===t.length)return null;var i=0,a=t.length-1;for(;i<=a;){var o=Math.floor((i+a)/2),l=t[o];if(l===e)return l;l<e?i=o+1:a=o-1}var u=null!==(n=t[i])&&void 0!==n?n:1/0,s=null!==(r=t[a])&&void 0!==r?r:-1/0;return Math.abs(u-e)<Math.abs(s-e)?u:s}(Math.round(l*a.duration()),r),s=n[u];s&&!s.loading&&(s.loading=!0,function(e){return w.apply(this,arguments)}(s).then(function(e){var t=e[s.tileIndex],n=document.querySelector(".vjs-thumbnail-holder img");n&&t.uri&&(n.src=t.uri),s.loading=!1,s.src=t.uri}))}}function k(e){return T.apply(this,arguments)}function T(){return(T=u(s.mark(function e(n){var r,i,a,o;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r={},n.forEach(function(e,t){for(var n=e.layout.split("x").map(Number),i=d(n,2),a=i[0]*i[1],o=e.duration,l=0;l<a;l++){var u,s=Math.round((t*a+l)*o);r[s]=Object.assign({},e,{duration:e.duration,tileIndex:l,loading:!1,style:(u={left:"-60px",height:"85px",width:"130px"},c(u,"left","-60px"),c(u,"border","1px solid transparent"),c(u,"borderRadius","4px"),u)})}}),i=Object.keys(r).map(Number).sort(function(e,t){return e-t}),null==(a=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||a.addEventListener("mousemove",t(function(e){return N(e,r,i)},500)),null==(o=document.querySelector(".vjs-progress-control.vjs-control"))||o.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",t(function(e){return N(e,r,i)},500))}),e.abrupt("return",r);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var C=function(){var e=u(s.mark(function e(t,n){var r,i,a,o,l,u,c,p;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:i=e.sent,a=i.split("\n").map(function(e){return e.trim()}),o=[],l=null,u=0;case 10:if(!(u<(null==a?void 0:a.length))){e.next=27;break}if(!(c=a[u]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},p=c.split(":")[1]||"",p.split(",").forEach(function(e){var t=e.split("="),n=d(t,2),r=n[0],i=n[1];r&&i&&(l[r.trim().toLowerCase()]=i.trim())}),e.next=24;break;case 19:if(!c.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(c.includes("jpg")||c.includes("png")||c.includes("jpeg"))&&(l.uri=c.includes("http")?c:t+c,o.push(l),l=null);case 24:u++,e.next=10;break;case 27:return e.abrupt("return",o);case 28:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}();function I(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function L(e,t){return B.apply(this,arguments)}function B(){return(B=u(s.mark(function t(n,r){var a,o,l,u,c,p,m,v,f,g,h,b,x,w,A,E,N,k,T,C,L,B,S,R,P,O,$,X,D,_,F,U,W,q,G,V,z,H,Q,Y,J,K,Z,ee,te,ne,re,ie,ae,oe,le,ue,se,ce,de,pe,me,ve;return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return y=r,a=e(r),o=n.split("/"),l=o.findIndex(function(e){return"dash"===e.toLowerCase()}),u=I(-1!==l?o.slice(0,l+1).join("/"):new URL(n).origin),t.prev=5,t.next=8,fetch(n);case 8:return v=t.sent,t.next=11,v.text();case 11:f=t.sent,g=new DOMParser,h=g.parseFromString(f,"application/xml"),b=(null==a?void 0:a.duration())||(null===(c=i())||void 0===c||null===(p=c.video)||void 0===p?void 0:p.runtime),x=(null==h||null===(m=h.querySelector("MPD > BaseURL"))||void 0===m?void 0:m.textContent)||u+"/",w=h.getElementsByTagName("AdaptationSet"),A=0;case 18:if(!(A<w.length)){t.next=72;break}if(("image"!==(E=w[A]).getAttribute("contentType")||"image/png"!==E.getAttribute("mimeType"))&&"image/jpeg"!==E.getAttribute("mimeType")){t.next=69;break}if(k=E.getElementsByTagName("SegmentTemplate")[0],T=null===(N=k.getElementsByTagName("SegmentTimeline"))||void 0===N?void 0:N[0],!k||!T){t.next=48;break}if(B=T.getElementsByTagName("S"),S=parseInt(null===(C=B[0])||void 0===C?void 0:C.getAttribute("t")),R=parseInt(null===(L=B[0])||void 0===L?void 0:L.getAttribute("d")),P=E.getElementsByTagName("Representation")[0],O=P.getElementsByTagName("EssentialProperty")[0],$=O.getAttribute("value"),X=null==$?void 0:$.split("x"),D=d(X,2),_=D[0],F=D[1],!k){t.next=46;break}if(k.getAttribute("media"),U=k.getAttribute("timescale"),W=(U?R/U:R)/(_*F),q=P.getAttribute("id"),G=Math.round(b/W),V=Math.ceil(G/(_*F)),z=k.getAttribute("media"),parseInt(k.getAttribute("startNumber")),!isNaN(parseInt(V))){t.next=43;break}return t.abrupt("return");case 43:for(H=[],A=0;A<V;A++)Y="/"==(Q=z)[0]?new URL(u).origin:u+"/",H.push({duration:W,layout:$,uri:Y+Q.replace("$Time$",S+A*R).replace("$RepresentationID$",q)});return t.abrupt("return",H);case 46:t.next=69;break;case 48:if(J=E.getElementsByTagName("Representation")[0],K=J.getElementsByTagName("EssentialProperty")[0],Z=K.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=d(ee,2),ne=te[0],re=te[1],!k){t.next=69;break}if(k.getAttribute("media"),ie=k.getAttribute("duration"),ae=k.getAttribute("timescale"),oe=(ae?ie/ae:ie)/(ne*re),le=J.getAttribute("id"),ue=Math.round(b/oe),se=Math.ceil(ue/(ne*re)),ce=k.getAttribute("media"),de=parseInt(k.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){t.next=65;break}return t.abrupt("return");case 65:for(pe=[],me=j(ce),A=0;A<se;A++)ve=me?M(me,A+de):ce,pe.push({duration:oe,layout:Z,uri:x+ve.replace("$Number$",A+de).replace("$RepresentationID$",le)});return t.abrupt("return",pe);case 69:A++,t.next=18;break;case 72:return console.log("No trickplay segment found."),t.abrupt("return",null);case 76:t.prev=76,t.t0=t.catch(5),console.error("Error fetching or parsing MPD:",t.t0);case 79:case"end":return t.stop()}},t,null,[[5,76]])}))).apply(this,arguments)}function j(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function M(e,t){var n=e.match(/%0(\d+)d/);if(!n)return e;var r=parseInt(n[1],10),i=String(t).padStart(r,"0");return e.replace(/\$Number%0\d+d\$/,i)}function S(e){return R.apply(this,arguments)}function R(){return(R=u(s.mark(function t(n){var r,i,a,o,l,u,c,d,p,m,v,f,g,h,b,y;return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(u=e(n),c=u.currentSource(),d=c.src,d=null!==(r=d)&&void 0!==r&&r.includes("blob")?null===(i=window)||void 0===i||null===(a=i.player)||void 0===a?void 0:a.getSource():d,null===(o=d)||void 0===o||!o.includes("m3u8")){t.next=19;break}return t.next=6,A(d,n);case 6:if(!((null==(p=t.sent)?void 0:p.length)>0)){t.next=17;break}return m=(null==p?void 0:p[0])||null,v=m.uri,f=d.substring(0,d.lastIndexOf("/"))+"/",t.next=12,C(f,v);case 12:return g=t.sent,t.next=15,k(g);case 15:h=t.sent,u.thumbnails(h);case 17:t.next=28;break;case 19:if(null===(l=d)||void 0===l||!l.includes("mpd")){t.next=28;break}return t.next=22,L(d,n);case 22:if(!((null==(b=t.sent)?void 0:b.length)>0)){t.next=28;break}return t.next=26,k(b);case 26:y=t.sent,u.thumbnails(y);case 28:case"end":return t.stop()}},t)}))).apply(this,arguments)}function P(t,n){var r=e(t),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var a=document.createElement("div");a.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(i),o.alt="Provider Image",a.append(o),r.el().appendChild(a),r.on("useractive",function(){a.classList.remove("vjs-fade")}),r.on("userinactive",function(){r.paused()||a.classList.add("vjs-fade")}),r.on("fullscreenchange",function(){r.isFullscreen_?a.style.top="3.2rem":a.style.top="1rem"})}}export{h as a,P as b,S as i};
@@ -1 +0,0 @@
1
- import{g as e,t}from"./skin-8e2c5488.js";import{S as n,b as r,d as i}from"./generic-d14a701a.js";import{s as a}from"./autoNextVideo-f6f0062e.js";import o 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,g=[],h=function(t,i){var a;if(null!=i&&null!==(a=i.series)&&void 0!==a&&a.enable){var o;g=[];var l=r();null==l||l.map(function(e){var t;return(t=g).push.apply(t,e.episodes)}),null==i||null===(o=i.series)||void 0===o||o.cb}else{var u,s;g=(null==i||null===(u=i.relatedVideos)||void 0===u?void 0:u.content)||[],null==i||null===(s=i.relatedVideos)||void 0===s||s.cb}var c=e(t);c.on("timeupdate",function(){var e,t,r=Math.floor(c.currentTime()),i=c.duration(),a=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-r<=10&&n()<=(null===(t=g)||void 0===t?void 0:t.length)-1?a&&(a.style.visibility="visible"):a&&(a.style.visibility="hidden")});var d,p=g.filter(function(e,t){return t==n()});if((null==p?void 0:p.length)>0)if(null!==(d=document.getElementsByClassName("next-ep-preview"))&&void 0!==d&&d[0]){var m,v,f,h,y,x,w,A,E,N,k,T;(null===(m=document.getElementsByClassName("next-ep-preview"))||void 0===m?void 0:m[0]).style.visibility="hidden";var C=null===(v=document.getElementsByClassName("next-ep-title"))||void 0===v?void 0:v[0],I=null===(f=document.getElementsByClassName("next-ep-img"))||void 0===f?void 0:f[0],L=null===(h=document.getElementsByClassName("next-ep-content"))||void 0===h?void 0:h[0],B=null===(y=p[0])||void 0===y?void 0:y.title;(null===(x=B)||void 0===x?void 0:x.length)>60&&(B=B.substr(0,60)+"..."),C.textContent="".concat(B),I.src=(null===(w=p[0])||void 0===w||null===(A=w.gist)||void 0===A||null===(E=A.imageGist)||void 0===E?void 0:E.r16x9)||(null==p||null===(N=p[0])||void 0===N?void 0:N.img)||(null===(k=window)||void 0===k||null===(T=k.customData)||void 0===T?void 0:T.fallbackImage),L.onclick=function(){return b(t)}}else{var j,M,S,R,P,O,$,X,D=document.createElement("div");D.className="next-ep-preview",D.style.visibility="hidden",document.getElementById(t).append(D);var _=document.createElement("div");_.className="next-ep-header",_.textContent="Next up";var F=null===(j=p[0])||void 0===j?void 0:j.title,U=document.createElement("img");U.className="next-ep-img",U.src=(null===(M=p[0])||void 0===M||null===(S=M.gist)||void 0===S||null===(R=S.imageGist)||void 0===R?void 0:R.r16x9)||(null==p||null===(P=p[0])||void 0===P?void 0:P.img)||(null===(O=window)||void 0===O||null===($=O.customData)||void 0===$?void 0:$.fallbackImage);var W=document.createElement("div");W.className="next-ep-title",(null===(X=F)||void 0===X?void 0:X.length)>60&&(F=F.substr(0,60)+"..."),W.textContent="".concat(F);var q=document.createElement("div");q.className="next-ep-content",q.append(U),q.append(W),q.onclick=function(){return b(t)},D.append(_),D.append(q)}},b=function(t,r){var i=e(t),o=Math.floor(i.currentTime());if(Math.floor(i.duration())!=o){i.pause(t);var l=n();a(l,t,g)}};p={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},m=function e(){var t,n,r,i,a;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(a in i=t[r])i.hasOwnProperty(a)&&("object"===o(i[a])?n[a]=e(n[a],i[a]):n[a]=i[a]);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,a,o,l,u,s,c;if(i=m({},p,e),o=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=o.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(r=document.createElement("div")).className="vjs-thumbnail-holder",a=document.createElement("img"),r.appendChild(a),a.src=i[0].src,a.className="vjs-thumbnail",m(a.style,i[0].style),a.style.left||a.style.right||(a.onload=function(){a.style.left=-a.naturalWidth/2+"px"}),u=o.duration(),o.on("durationchange",function(e){u=o.duration()}),o.on("loadedmetadata",function(e){u=o.duration()}),(l=o.controlBar.progressControl).el().appendChild(r),s=function(e){var t,n,o,s,c,d,p,g,h,b;for(n in o=0,h=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,p=((b=f(l.el()).getBoundingClientRect()).width||b.right)+h,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=f(l.el()).getBoundingClientRect().left+h,t=Math.floor((s-l.el().offsetLeft)/l.width()*u),i)t>n&&(o=Math.max(o,n));(c=i[o]).src&&a.src!=c.src&&(a.src=c.src),c.style&&a.style!=c.style&&m(a.style,c.style),s+(g=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}(a,c.width||i[0].width)/2)>p?s-=s+g-p:s<g&&(s=g),r.style.left=s+"px"},null!==(t=window)&&void 0!==t&&null!==(n=t.customData)&&void 0!==n&&n.isSmartTV){var d=function(){var e,t,n=0,u=(null===(e=l.el_.children[0].children[2])||void 0===e?void 0:e.offsetWidth)||5;u<65?u=5:u>=o.el().offsetWidth-180?u=o.el().offsetWidth-240:u-=58;var s=o.currentTime();for(t in i)s>t&&(n=Math.max(n,t));var c=i[n];c.uri&&""!=c.uri&&a.src!=c.uri?(a.src=c.uri,r.style.left=u+"px",a.style.opacity="1"):(r.style.left="-1000px",a.style.opacity="0")},g=null;l.el_.children[0].onfocus=function(){d(),g=setInterval(function(){d()},250)},l.el_.children[0].addEventListener("blur",function(){try{r.style.left="-1000px",a.style.opacity="0",g&&(clearInterval(g),g=null)}catch(e){}})}else l.on("mousemove",s),l.on("touchmove",s);function h(){document.removeEventListener("pointermove",s),document.removeEventListener("pointerup",h),c()}l.on("pointerdown",function(e){document.addEventListener("pointermove",s),document.addEventListener("pointerup",h)}),c=function(e){r.style.left="-1000px"},l.on("mouseout",c),l.on("touchcancel",c),l.on("touchend",c),o.on("userinactive",c)});var y="my-player";function x(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 w(){return(w=u(s.mark(function e(t){var n,r,i,a,o,l,u,c,p,m,v,f,g,h,b,y,x,w,A,E,N,k,T,C;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t._tiles){e.next=2;break}return e.abrupt("return",t._tiles);case 2:return e.prev=2,e.next=5,fetch(t.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return r=e.sent,e.next=11,createImageBitmap(r);case 11:for(i=e.sent,a=t.layout.split("x").map(Number),o=d(a,2),l=o[0],u=o[1],c=i.width/u,p=i.height/l,m=[],v=0;v<l;v++)for(f=0;f<u;f++)(g=document.createElement("canvas")).width=c,g.height=p,g.getContext("2d").drawImage(i,f*c,v*p,c,p,0,0,c,p),h=g.toDataURL("image/png"),m.push({uri:h,duration:t.duration}),t._tiles=m;return e.abrupt("return",m);case 20:for(e.prev=20,e.t0=e.catch(2),b=t.layout.split("x").map(Number),y=d(b,2),x=y[0],w=y[1],A=[],E=0;E<x*w;E++)A.push({uri:null===(N=window)||void 0===N||null===(k=N.app_data)||void 0===k||null===(T=k.appcmsMain)||void 0===T||null===(C=T.images)||void 0===C?void 0:C.placeholderCover,duration:t.duration});return e.abrupt("return",A);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function A(e,t){return E.apply(this,arguments)}function E(){return(E=u(s.mark(function e(t,n){var r,i;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return y=n,e.prev=1,e.next=4,fetch(t);case 4:return r=e.sent,e.next=7,r.text();case 7:return i=e.sent,e.abrupt("return",x(i));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}},e,null,[[1,11]])}))).apply(this,arguments)}function N(t,n,r){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),a=e(y);if(i&&a){var o=i.getBoundingClientRect(),l=(t.clientX-o.left)/o.width,u=function(e,t){var n,r;if(!t||0===t.length)return null;var i=0,a=t.length-1;for(;i<=a;){var o=Math.floor((i+a)/2),l=t[o];if(l===e)return l;l<e?i=o+1:a=o-1}var u=null!==(n=t[i])&&void 0!==n?n:1/0,s=null!==(r=t[a])&&void 0!==r?r:-1/0;return Math.abs(u-e)<Math.abs(s-e)?u:s}(Math.round(l*a.duration()),r),s=n[u];s&&!s.loading&&(s.loading=!0,function(e){return w.apply(this,arguments)}(s).then(function(e){var t=e[s.tileIndex],n=document.querySelector(".vjs-thumbnail-holder img");n&&t.uri&&(n.src=t.uri),s.loading=!1,s.src=t.uri}))}}function k(e){return T.apply(this,arguments)}function T(){return(T=u(s.mark(function e(n){var r,i,a,o;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r={},n.forEach(function(e,t){for(var n=e.layout.split("x").map(Number),i=d(n,2),a=i[0]*i[1],o=e.duration,l=0;l<a;l++){var u,s=Math.round((t*a+l)*o);r[s]=Object.assign({},e,{duration:e.duration,tileIndex:l,loading:!1,style:(u={left:"-60px",height:"85px",width:"130px"},c(u,"left","-60px"),c(u,"border","1px solid transparent"),c(u,"borderRadius","4px"),u)})}}),i=Object.keys(r).map(Number).sort(function(e,t){return e-t}),null==(a=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||a.addEventListener("mousemove",t(function(e){return N(e,r,i)},500)),null==(o=document.querySelector(".vjs-progress-control.vjs-control"))||o.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",t(function(e){return N(e,r,i)},500))}),e.abrupt("return",r);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var C=function(){var e=u(s.mark(function e(t,n){var r,i,a,o,l,u,c,p;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:i=e.sent,a=i.split("\n").map(function(e){return e.trim()}),o=[],l=null,u=0;case 10:if(!(u<(null==a?void 0:a.length))){e.next=27;break}if(!(c=a[u]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},p=c.split(":")[1]||"",p.split(",").forEach(function(e){var t=e.split("="),n=d(t,2),r=n[0],i=n[1];r&&i&&(l[r.trim().toLowerCase()]=i.trim())}),e.next=24;break;case 19:if(!c.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(c.includes("jpg")||c.includes("png")||c.includes("jpeg"))&&(l.uri=c.includes("http")?c:t+c,o.push(l),l=null);case 24:u++,e.next=10;break;case 27:return e.abrupt("return",o);case 28:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}();function I(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function L(e,t){return B.apply(this,arguments)}function B(){return(B=u(s.mark(function t(n,r){var a,o,l,u,c,p,m,v,f,g,h,b,x,w,A,E,N,k,T,C,L,B,S,R,P,O,$,X,D,_,F,U,W,q,G,V,z,H,Q,Y,J,K,Z,ee,te,ne,re,ie,ae,oe,le,ue,se,ce,de,pe,me,ve;return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return y=r,a=e(r),o=n.split("/"),l=o.findIndex(function(e){return"dash"===e.toLowerCase()}),u=I(-1!==l?o.slice(0,l+1).join("/"):new URL(n).origin),t.prev=5,t.next=8,fetch(n);case 8:return v=t.sent,t.next=11,v.text();case 11:f=t.sent,g=new DOMParser,h=g.parseFromString(f,"application/xml"),b=(null==a?void 0:a.duration())||(null===(c=i())||void 0===c||null===(p=c.video)||void 0===p?void 0:p.runtime),x=(null==h||null===(m=h.querySelector("MPD > BaseURL"))||void 0===m?void 0:m.textContent)||u+"/",w=h.getElementsByTagName("AdaptationSet"),A=0;case 18:if(!(A<w.length)){t.next=72;break}if(("image"!==(E=w[A]).getAttribute("contentType")||"image/png"!==E.getAttribute("mimeType"))&&"image/jpeg"!==E.getAttribute("mimeType")){t.next=69;break}if(k=E.getElementsByTagName("SegmentTemplate")[0],T=null===(N=k.getElementsByTagName("SegmentTimeline"))||void 0===N?void 0:N[0],!k||!T){t.next=48;break}if(B=T.getElementsByTagName("S"),S=parseInt(null===(C=B[0])||void 0===C?void 0:C.getAttribute("t")),R=parseInt(null===(L=B[0])||void 0===L?void 0:L.getAttribute("d")),P=E.getElementsByTagName("Representation")[0],O=P.getElementsByTagName("EssentialProperty")[0],$=O.getAttribute("value"),X=null==$?void 0:$.split("x"),D=d(X,2),_=D[0],F=D[1],!k){t.next=46;break}if(k.getAttribute("media"),U=k.getAttribute("timescale"),W=(U?R/U:R)/(_*F),q=P.getAttribute("id"),G=Math.round(b/W),V=Math.ceil(G/(_*F)),z=k.getAttribute("media"),parseInt(k.getAttribute("startNumber")),!isNaN(parseInt(V))){t.next=43;break}return t.abrupt("return");case 43:for(H=[],A=0;A<V;A++)Y="/"==(Q=z)[0]?new URL(u).origin:u+"/",H.push({duration:W,layout:$,uri:Y+Q.replace("$Time$",S+A*R).replace("$RepresentationID$",q)});return t.abrupt("return",H);case 46:t.next=69;break;case 48:if(J=E.getElementsByTagName("Representation")[0],K=J.getElementsByTagName("EssentialProperty")[0],Z=K.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=d(ee,2),ne=te[0],re=te[1],!k){t.next=69;break}if(k.getAttribute("media"),ie=k.getAttribute("duration"),ae=k.getAttribute("timescale"),oe=(ae?ie/ae:ie)/(ne*re),le=J.getAttribute("id"),ue=Math.round(b/oe),se=Math.ceil(ue/(ne*re)),ce=k.getAttribute("media"),de=parseInt(k.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){t.next=65;break}return t.abrupt("return");case 65:for(pe=[],me=j(ce),A=0;A<se;A++)ve=me?M(me,A+de):ce,pe.push({duration:oe,layout:Z,uri:x+ve.replace("$Number$",A+de).replace("$RepresentationID$",le)});return t.abrupt("return",pe);case 69:A++,t.next=18;break;case 72:return console.log("No trickplay segment found."),t.abrupt("return",null);case 76:t.prev=76,t.t0=t.catch(5),console.error("Error fetching or parsing MPD:",t.t0);case 79:case"end":return t.stop()}},t,null,[[5,76]])}))).apply(this,arguments)}function j(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function M(e,t){var n=e.match(/%0(\d+)d/);if(!n)return e;var r=parseInt(n[1],10),i=String(t).padStart(r,"0");return e.replace(/\$Number%0\d+d\$/,i)}function S(e){return R.apply(this,arguments)}function R(){return(R=u(s.mark(function t(n){var r,i,a,o,l,u,c,d,p,m,v,f,g,h,b,y;return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(u=e(n),c=u.currentSource(),d=c.src,d=null!==(r=d)&&void 0!==r&&r.includes("blob")?null===(i=window)||void 0===i||null===(a=i.player)||void 0===a?void 0:a.getSource():d,null===(o=d)||void 0===o||!o.includes("m3u8")){t.next=19;break}return t.next=6,A(d,n);case 6:if(!((null==(p=t.sent)?void 0:p.length)>0)){t.next=17;break}return m=(null==p?void 0:p[0])||null,v=m.uri,f=d.substring(0,d.lastIndexOf("/"))+"/",t.next=12,C(f,v);case 12:return g=t.sent,t.next=15,k(g);case 15:h=t.sent,u.thumbnails(h);case 17:t.next=28;break;case 19:if(null===(l=d)||void 0===l||!l.includes("mpd")){t.next=28;break}return t.next=22,L(d,n);case 22:if(!((null==(b=t.sent)?void 0:b.length)>0)){t.next=28;break}return t.next=26,k(b);case 26:y=t.sent,u.thumbnails(y);case 28:case"end":return t.stop()}},t)}))).apply(this,arguments)}function P(t,n){var r=e(t),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var a=document.createElement("div");a.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(i),o.alt="Provider Image",a.append(o),r.el().appendChild(a),r.on("useractive",function(){a.classList.remove("vjs-fade")}),r.on("userinactive",function(){r.paused()||a.classList.add("vjs-fade")}),r.on("fullscreenchange",function(){r.isFullscreen_?a.style.top="3.2rem":a.style.top="1rem"})}}export{h as a,P as b,S as i};