@viewlift/player-backup 2.0.377-backup → 2.0.379-backup

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/cjs/{autoNextVideo-970d7952.js → autoNextVideo-38f45ca1.js} +1 -1
  2. package/cjs/bundle.css +1157 -1140
  3. package/cjs/caption-settings-af7b30a4.js +1 -0
  4. package/cjs/captions-8b889384.js +1 -0
  5. package/cjs/{features-911c3816.js → features-8beda29d.js} +1 -1
  6. package/cjs/generic-0b925a19.js +1 -0
  7. package/cjs/index-22c077d0.js +1 -0
  8. package/cjs/{index-6133b444.js → index-517acf72.js} +1 -1
  9. package/cjs/{index-aa64a6c0.js → index-93ac04ff.js} +1 -1
  10. package/cjs/{index-50f15aa6.js → index-f64ef24d.js} +1 -1
  11. package/cjs/index.js +1 -1
  12. package/cjs/localisation-da6f64c6.js +1 -0
  13. package/cjs/{multicamv2-e88d0dc2.js → multicamv2-2123cc15.js} +1 -1
  14. package/cjs/{multicamv2-f17375d7.js → multicamv2-41a918f4.js} +1 -1
  15. package/cjs/{nextEpisodeButton-551faeb3.js → nextEpisodeButton-c68c6da4.js} +1 -1
  16. package/cjs/{playlist-f0a6659a.js → playlist-8d5202b4.js} +1 -1
  17. package/cjs/resolution-ac7705e6.js +1 -0
  18. package/cjs/{series-47045f7e.js → series-b3b39dd7.js} +1 -1
  19. package/cjs/{series-v2-cf79269e.js → series-v2-3baa5caa.js} +1 -1
  20. package/cjs/{series-v2-5ce609b4.js → series-v2-f31465e3.js} +1 -1
  21. package/cjs/settings-icon-7a519942.js +1 -0
  22. package/cjs/{skin-425c1322.js → skin-6b4fd720.js} +1 -1
  23. package/cjs/{skin-dbff0922.js → skin-8d797b1e.js} +1 -1
  24. package/cjs/{skin-f7c4ead4.js → skin-90c06edf.js} +1 -1
  25. package/cjs/{skin-ebab1e3f.js → skin-a3530077.js} +1 -1
  26. package/cjs/skin-aef6f952.js +1 -0
  27. package/cjs/{skin-237f8d4f.js → skin-d6a48901.js} +1 -1
  28. package/cjs/{skin-c49d50b6.js → skin-e03a88b8.js} +1 -1
  29. package/cjs/{skin-a9a5a925.js → skin-ed4decab.js} +1 -1
  30. package/cjs/{skin-dc3525c7.js → skin-f0bbb76d.js} +1 -1
  31. package/cjs/{skin-3a43f138.js → skin-f8994d41.js} +1 -1
  32. package/cjs/{videoSelector-f4eb61cd.js → videoSelector-1399cc18.js} +1 -1
  33. package/cjs/{videoSelector-607de014.js → videoSelector-2bc8977c.js} +1 -1
  34. package/esm/{autoNextVideo-c9d22cb4.js → autoNextVideo-7dc4b5f9.js} +1 -1
  35. package/esm/bundle.css +1157 -1140
  36. package/esm/caption-settings-cf49bb1b.js +1 -0
  37. package/esm/captions-f011a7d4.js +1 -0
  38. package/esm/{features-8b0d92d7.js → features-048cb801.js} +1 -1
  39. package/esm/generic-759b1422.js +1 -0
  40. package/esm/{index-9f2bf24a.js → index-07f963db.js} +1 -1
  41. package/esm/{index-cef05213.js → index-1577b990.js} +1 -1
  42. package/esm/index-1a5d906c.js +1 -0
  43. package/esm/{index-3addf20e.js → index-3bae4958.js} +1 -1
  44. package/esm/index.js +1 -1
  45. package/esm/localisation-2f1ee38c.js +1 -0
  46. package/esm/{multicamv2-1e925995.js → multicamv2-220833f5.js} +1 -1
  47. package/esm/{multicamv2-1bd7f8c5.js → multicamv2-bd4bf0f5.js} +1 -1
  48. package/esm/{nextEpisodeButton-f1a025e4.js → nextEpisodeButton-ca0a2b98.js} +1 -1
  49. package/esm/{playlist-2012e5ef.js → playlist-2d49901b.js} +1 -1
  50. package/esm/resolution-d9d21f0e.js +1 -0
  51. package/esm/{series-8f854466.js → series-637f67ff.js} +1 -1
  52. package/esm/{series-v2-f28041a6.js → series-v2-7caace2c.js} +1 -1
  53. package/esm/{series-v2-4ada8ab6.js → series-v2-899b6955.js} +1 -1
  54. package/esm/settings-icon-abd55c1e.js +1 -0
  55. package/esm/{skin-85e8dcbb.js → skin-0e9bc166.js} +1 -1
  56. package/esm/{skin-74348872.js → skin-28192217.js} +1 -1
  57. package/esm/{skin-66b334cd.js → skin-2cb9e01a.js} +1 -1
  58. package/esm/{skin-d6417c01.js → skin-2d7f1782.js} +1 -1
  59. package/esm/{skin-7bdb21cf.js → skin-318448f4.js} +1 -1
  60. package/esm/skin-44cb0a24.js +1 -0
  61. package/esm/{skin-30a7f835.js → skin-77259d09.js} +1 -1
  62. package/esm/{skin-c16b40b9.js → skin-7d2af43a.js} +1 -1
  63. package/esm/{skin-30a90635.js → skin-9d2dad58.js} +1 -1
  64. package/esm/{skin-f0b7e11c.js → skin-bcb995db.js} +1 -1
  65. package/esm/src/core/captions.d.ts +10 -0
  66. package/esm/src/helpers/localisation.d.ts +1 -0
  67. package/esm/src/utilities/qualityLabels.d.ts +1 -0
  68. package/esm/{videoSelector-435aa016.js → videoSelector-01d26572.js} +1 -1
  69. package/esm/{videoSelector-48a4e382.js → videoSelector-21c88bd3.js} +1 -1
  70. package/package.json +1 -1
  71. package/cjs/caption-settings-e803e4a6.js +0 -1
  72. package/cjs/captions-abd87121.js +0 -1
  73. package/cjs/generic-118f7ebd.js +0 -1
  74. package/cjs/index-c52abe27.js +0 -1
  75. package/cjs/localisation-56e0a999.js +0 -1
  76. package/cjs/resolution-7b5483dd.js +0 -1
  77. package/cjs/settings-icon-b4612153.js +0 -1
  78. package/cjs/skin-b11e1757.js +0 -1
  79. package/esm/caption-settings-404c4774.js +0 -1
  80. package/esm/captions-8c8e9f2b.js +0 -1
  81. package/esm/generic-6871d7d1.js +0 -1
  82. package/esm/index-18292507.js +0 -1
  83. package/esm/localisation-0bf399a1.js +0 -1
  84. package/esm/resolution-847a299c.js +0 -1
  85. package/esm/settings-icon-c188c46d.js +0 -1
  86. package/esm/skin-be4ea9e2.js +0 -1
  87. package/esm/src/features/dvrStartOver/helpers.test.d.ts +0 -1
  88. package/esm/src/features/dvrStartOver/index.test.d.ts +0 -1
  89. package/esm/src/helpers/playerControlEvents.test.d.ts +0 -1
  90. package/esm/src/utilities/beacon.test.d.ts +0 -1
@@ -1 +1 @@
1
- "use strict";require("./index-6133b444.js");var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),r=require("./skin-55634dc6.js"),n=require("@babel/runtime/helpers/defineProperty"),i=require("@babel/runtime/helpers/slicedToArray"),a=require("./generic-118f7ebd.js");function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var s="my-player";function l(e){var t=e.split("\n"),r=[];return t.forEach((function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),n={resolution:null,uri:null};t.forEach((function(e){e.includes("RESOLUTION")&&(n.resolution=e.split("=")[1]),e.includes("URI")&&(n.uri=e.split("=")[1].replace(/"/g,""))})),r.push(n)}})),r}function c(){return(c=e(t.mark((function e(r){var n,a,u,o,s,l,c,p,d,f,m,b,g,v,h,x,y,k,w,E,j,N,T,A;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r._tiles){e.next=2;break}return e.abrupt("return",r._tiles);case 2:return e.prev=2,e.next=5,fetch(r.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return a=e.sent,e.next=11,createImageBitmap(a);case 11:for(u=e.sent,o=r.layout.split("x").map(Number),s=i(o,2),l=s[0],c=s[1],p=u.width/c,d=u.height/l,f=[],m=0;m<l;m++)for(b=0;b<c;b++)(g=document.createElement("canvas")).width=p,g.height=d,g.getContext("2d").drawImage(u,b*p,m*d,p,d,0,0,p,d),v=g.toDataURL("image/png"),f.push({uri:v,duration:r.duration}),r._tiles=f;return e.abrupt("return",f);case 20:for(e.prev=20,e.t0=e.catch(2),h=r.layout.split("x").map(Number),x=i(h,2),y=x[0],k=x[1],w=[],E=0;E<y*k;E++)w.push({uri:null===(j=window)||void 0===j||null===(N=j.app_data)||void 0===N||null===(T=N.appcmsMain)||void 0===T||null===(A=T.images)||void 0===A?void 0:A.placeholderCover,duration:r.duration});return e.abrupt("return",w);case 26:case"end":return e.stop()}}),e,null,[[2,20]])})))).apply(this,arguments)}function p(e,t){return d.apply(this,arguments)}function d(){return(d=e(t.mark((function e(r,n){var i,a;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n,e.prev=1,e.next=4,fetch(r);case 4:return i=e.sent,e.next=7,i.text();case 7:return a=e.sent,e.abrupt("return",l(a));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 f(e,t,n){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),a=r.getPlayer(s);if(i&&a){var u=i.getBoundingClientRect(),o=(e.clientX-u.left)/u.width,l=function(e,t){var r,n;if(!t||0===t.length)return null;var i=0,a=t.length-1;for(;i<=a;){var u=Math.floor((i+a)/2),o=t[u];if(o===e)return o;o<e?i=u+1:a=u-1}var s=null!==(r=t[i])&&void 0!==r?r:1/0,l=null!==(n=t[a])&&void 0!==n?n:-1/0;return Math.abs(s-e)<Math.abs(l-e)?s:l}(Math.round(o*a.duration()),n),p=t[l];p&&!p.loading&&(p.loading=!0,function(e){return c.apply(this,arguments)}(p).then((function(e){var t=e[p.tileIndex],r=document.querySelector(".vjs-thumbnail-holder img");r&&t.uri&&(r.src=t.uri),p.loading=!1,p.src=t.uri})))}}function m(e){return b.apply(this,arguments)}function b(){return(b=e(t.mark((function e(a){var u,s,l,c;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u={},a.forEach((function(e,t){for(var r=e.layout.split("x").map(Number),a=i(r,2),s=a[0]*a[1],l=e.duration,c=0;c<s;c++){var p,d=Math.round((t*s+c)*l);u[d]=o(o({},e),{},{duration:e.duration,tileIndex:c,loading:!1,style:(p={left:"-60px",height:"85px",width:"130px"},n(p,"left","-60px"),n(p,"border","1px solid transparent"),n(p,"borderRadius","4px"),p)})}})),s=Object.keys(u).map(Number).sort((function(e,t){return e-t})),null==(l=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||l.addEventListener("mousemove",r.throttle((function(e){return f(e,u,s)}),500)),null==(c=document.querySelector(".vjs-progress-control.vjs-control"))||c.addEventListener("pointerdown",(function(e){document.addEventListener("pointermove",r.throttle((function(e){return f(e,u,s)}),500))})),e.abrupt("return",u);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var g=function(){var r=e(t.mark((function e(r,n){var a,u,o,s,l,c,p,d;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(r+n);case 2:return a=e.sent,e.next=5,a.text();case 5:u=e.sent,o=u.split("\n").map((function(e){return e.trim()})),s=[],l=null,c=0;case 10:if(!(c<(null==o?void 0:o.length))){e.next=27;break}if(!(p=o[c]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},d=p.split(":")[1]||"",d.split(",").forEach((function(e){var t=e.split("="),r=i(t,2),n=r[0],a=r[1];n&&a&&(l[n.trim().toLowerCase()]=a.trim())})),e.next=24;break;case 19:if(!p.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(p.includes("jpg")||p.includes("png")||p.includes("jpeg"))&&(l.uri=p.includes("http")?p:r+p,s.push(l),l=null);case 24:c++,e.next=10;break;case 27:return e.abrupt("return",s);case 28:case"end":return e.stop()}}),e)})));return function(e,t){return r.apply(this,arguments)}}();function v(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function h(e,t){return x.apply(this,arguments)}function x(){return(x=e(t.mark((function e(n,u){var o,l,c,p,d,f,m,b,g,h,x,k,w,E,j,N,T,A,O,I,S,P,M,R,q,$,B,L,D,C,U,X,_,F,W,z,G,K,V,H,J,Q,Y,Z,ee,te,re,ne,ie,ae,ue,oe,se,le,ce,pe,de,fe;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=u,o=r.getPlayer(u),l=n.split("/"),c=l.findIndex((function(e){return"dash"===e.toLowerCase()})),p=v(-1!==c?l.slice(0,c+1).join("/"):new URL(n).origin),e.prev=5,e.next=8,fetch(n);case 8:return b=e.sent,e.next=11,b.text();case 11:g=e.sent,h=new DOMParser,x=h.parseFromString(g,"application/xml"),k=(null==o?void 0:o.duration())||(null===(d=a.getCurrentVideo())||void 0===d||null===(f=d.video)||void 0===f?void 0:f.runtime),w=(null==x||null===(m=x.querySelector("MPD > BaseURL"))||void 0===m?void 0:m.textContent)||p+"/",E=x.getElementsByTagName("AdaptationSet"),j=0;case 18:if(!(j<E.length)){e.next=72;break}if(("image"!==(N=E[j]).getAttribute("contentType")||"image/png"!==N.getAttribute("mimeType"))&&"image/jpeg"!==N.getAttribute("mimeType")){e.next=69;break}if(A=N.getElementsByTagName("SegmentTemplate")[0],O=null===(T=A.getElementsByTagName("SegmentTimeline"))||void 0===T?void 0:T[0],!A||!O){e.next=48;break}if(P=O.getElementsByTagName("S"),M=parseInt(null===(I=P[0])||void 0===I?void 0:I.getAttribute("t")),R=parseInt(null===(S=P[0])||void 0===S?void 0:S.getAttribute("d")),q=N.getElementsByTagName("Representation")[0],$=q.getElementsByTagName("EssentialProperty")[0],B=$.getAttribute("value"),L=null==B?void 0:B.split("x"),D=i(L,2),C=D[0],U=D[1],!A){e.next=46;break}if(A.getAttribute("media"),X=A.getAttribute("timescale"),_=(X?R/X:R)/(C*U),F=q.getAttribute("id"),W=Math.round(k/_),z=Math.ceil(W/(C*U)),G=A.getAttribute("media"),parseInt(A.getAttribute("startNumber")),!isNaN(parseInt(z))){e.next=43;break}return e.abrupt("return");case 43:for(K=[],j=0;j<z;j++)H="/"==(V=G)[0]?new URL(p).origin:p+"/",K.push({duration:_,layout:B,uri:H+V.replace("$Time$",M+j*R).replace("$RepresentationID$",F)});return e.abrupt("return",K);case 46:e.next=69;break;case 48:if(J=N.getElementsByTagName("Representation")[0],Q=J.getElementsByTagName("EssentialProperty")[0],Y=Q.getAttribute("value"),Z=null==Y?void 0:Y.split("x"),ee=i(Z,2),te=ee[0],re=ee[1],!A){e.next=69;break}if(A.getAttribute("media"),ne=A.getAttribute("duration"),ie=A.getAttribute("timescale"),ae=(ie?ne/ie:ne)/(te*re),ue=J.getAttribute("id"),oe=Math.round(k/ae),se=Math.ceil(oe/(te*re)),le=A.getAttribute("media"),ce=parseInt(A.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){e.next=65;break}return e.abrupt("return");case 65:for(pe=[],t=void 0,t=le.match(/Thumbnail_\$Number%0\d+d\$\.\w+/),de=t?t[0]:null,j=0;j<se;j++)fe=de?y(de,j+ce):le,pe.push({duration:ae,layout:Y,uri:w+fe.replace("$Number$",j+ce).replace("$RepresentationID$",ue)});return e.abrupt("return",pe);case 69:j++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}var t}),e,null,[[5,76]])})))).apply(this,arguments)}function y(e,t){var r=e.match(/%0(\d+)d/);if(!r)return e;var n=parseInt(r[1],10),i=String(t).padStart(n,"0");return e.replace(/\$Number%0\d+d\$/,i)}function k(){return(k=e(t.mark((function e(n){var i,a,u,o,s,l,c,d,f,b,v,x,y,k,w;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=r.getPlayer(n),l=s.currentSource(),c=l.src,c=null!==(i=c)&&void 0!==i&&i.includes("blob")?null==s||null===(a=s.getSource)||void 0===a?void 0:a.call(s):c,null===(u=c)||void 0===u||!u.includes("m3u8")){e.next=19;break}return e.next=6,p(c,n);case 6:if(!((null==(d=e.sent)?void 0:d.length)>0)){e.next=17;break}return f=(null==d?void 0:d[0])||null,b=f.uri,v=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,g(v,b);case 12:return x=e.sent,e.next=15,m(x);case 15:y=e.sent,s.thumbnails(y);case 17:e.next=28;break;case 19:if(null===(o=c)||void 0===o||!o.includes("mpd")){e.next=28;break}return e.next=22,h(c,n);case 22:if(!((null==(k=e.sent)?void 0:k.length)>0)){e.next=28;break}return e.next=26,m(k);case 26:w=e.sent,s.thumbnails(w);case 28:case"end":return e.stop()}}),e)})))).apply(this,arguments)}exports.initiateTrickplay=function(e){return k.apply(this,arguments)};
1
+ "use strict";require("./index-517acf72.js");var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),r=require("./skin-55634dc6.js"),n=require("@babel/runtime/helpers/defineProperty"),i=require("@babel/runtime/helpers/slicedToArray"),a=require("./generic-0b925a19.js");function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var s="my-player";function l(e){var t=e.split("\n"),r=[];return t.forEach((function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),n={resolution:null,uri:null};t.forEach((function(e){e.includes("RESOLUTION")&&(n.resolution=e.split("=")[1]),e.includes("URI")&&(n.uri=e.split("=")[1].replace(/"/g,""))})),r.push(n)}})),r}function c(){return(c=e(t.mark((function e(r){var n,a,u,o,s,l,c,p,d,f,m,b,g,v,h,x,y,k,w,E,j,N,T,A;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r._tiles){e.next=2;break}return e.abrupt("return",r._tiles);case 2:return e.prev=2,e.next=5,fetch(r.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return a=e.sent,e.next=11,createImageBitmap(a);case 11:for(u=e.sent,o=r.layout.split("x").map(Number),s=i(o,2),l=s[0],c=s[1],p=u.width/c,d=u.height/l,f=[],m=0;m<l;m++)for(b=0;b<c;b++)(g=document.createElement("canvas")).width=p,g.height=d,g.getContext("2d").drawImage(u,b*p,m*d,p,d,0,0,p,d),v=g.toDataURL("image/png"),f.push({uri:v,duration:r.duration}),r._tiles=f;return e.abrupt("return",f);case 20:for(e.prev=20,e.t0=e.catch(2),h=r.layout.split("x").map(Number),x=i(h,2),y=x[0],k=x[1],w=[],E=0;E<y*k;E++)w.push({uri:null===(j=window)||void 0===j||null===(N=j.app_data)||void 0===N||null===(T=N.appcmsMain)||void 0===T||null===(A=T.images)||void 0===A?void 0:A.placeholderCover,duration:r.duration});return e.abrupt("return",w);case 26:case"end":return e.stop()}}),e,null,[[2,20]])})))).apply(this,arguments)}function p(e,t){return d.apply(this,arguments)}function d(){return(d=e(t.mark((function e(r,n){var i,a;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n,e.prev=1,e.next=4,fetch(r);case 4:return i=e.sent,e.next=7,i.text();case 7:return a=e.sent,e.abrupt("return",l(a));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 f(e,t,n){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),a=r.getPlayer(s);if(i&&a){var u=i.getBoundingClientRect(),o=(e.clientX-u.left)/u.width,l=function(e,t){var r,n;if(!t||0===t.length)return null;var i=0,a=t.length-1;for(;i<=a;){var u=Math.floor((i+a)/2),o=t[u];if(o===e)return o;o<e?i=u+1:a=u-1}var s=null!==(r=t[i])&&void 0!==r?r:1/0,l=null!==(n=t[a])&&void 0!==n?n:-1/0;return Math.abs(s-e)<Math.abs(l-e)?s:l}(Math.round(o*a.duration()),n),p=t[l];p&&!p.loading&&(p.loading=!0,function(e){return c.apply(this,arguments)}(p).then((function(e){var t=e[p.tileIndex],r=document.querySelector(".vjs-thumbnail-holder img");r&&t.uri&&(r.src=t.uri),p.loading=!1,p.src=t.uri})))}}function m(e){return b.apply(this,arguments)}function b(){return(b=e(t.mark((function e(a){var u,s,l,c;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u={},a.forEach((function(e,t){for(var r=e.layout.split("x").map(Number),a=i(r,2),s=a[0]*a[1],l=e.duration,c=0;c<s;c++){var p,d=Math.round((t*s+c)*l);u[d]=o(o({},e),{},{duration:e.duration,tileIndex:c,loading:!1,style:(p={left:"-60px",height:"85px",width:"130px"},n(p,"left","-60px"),n(p,"border","1px solid transparent"),n(p,"borderRadius","4px"),p)})}})),s=Object.keys(u).map(Number).sort((function(e,t){return e-t})),null==(l=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||l.addEventListener("mousemove",r.throttle((function(e){return f(e,u,s)}),500)),null==(c=document.querySelector(".vjs-progress-control.vjs-control"))||c.addEventListener("pointerdown",(function(e){document.addEventListener("pointermove",r.throttle((function(e){return f(e,u,s)}),500))})),e.abrupt("return",u);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var g=function(){var r=e(t.mark((function e(r,n){var a,u,o,s,l,c,p,d;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(r+n);case 2:return a=e.sent,e.next=5,a.text();case 5:u=e.sent,o=u.split("\n").map((function(e){return e.trim()})),s=[],l=null,c=0;case 10:if(!(c<(null==o?void 0:o.length))){e.next=27;break}if(!(p=o[c]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},d=p.split(":")[1]||"",d.split(",").forEach((function(e){var t=e.split("="),r=i(t,2),n=r[0],a=r[1];n&&a&&(l[n.trim().toLowerCase()]=a.trim())})),e.next=24;break;case 19:if(!p.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(p.includes("jpg")||p.includes("png")||p.includes("jpeg"))&&(l.uri=p.includes("http")?p:r+p,s.push(l),l=null);case 24:c++,e.next=10;break;case 27:return e.abrupt("return",s);case 28:case"end":return e.stop()}}),e)})));return function(e,t){return r.apply(this,arguments)}}();function v(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function h(e,t){return x.apply(this,arguments)}function x(){return(x=e(t.mark((function e(n,u){var o,l,c,p,d,f,m,b,g,h,x,k,w,E,j,N,T,A,O,I,S,P,M,R,q,$,B,L,D,C,U,X,_,F,W,z,G,K,V,H,J,Q,Y,Z,ee,te,re,ne,ie,ae,ue,oe,se,le,ce,pe,de,fe;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=u,o=r.getPlayer(u),l=n.split("/"),c=l.findIndex((function(e){return"dash"===e.toLowerCase()})),p=v(-1!==c?l.slice(0,c+1).join("/"):new URL(n).origin),e.prev=5,e.next=8,fetch(n);case 8:return b=e.sent,e.next=11,b.text();case 11:g=e.sent,h=new DOMParser,x=h.parseFromString(g,"application/xml"),k=(null==o?void 0:o.duration())||(null===(d=a.getCurrentVideo())||void 0===d||null===(f=d.video)||void 0===f?void 0:f.runtime),w=(null==x||null===(m=x.querySelector("MPD > BaseURL"))||void 0===m?void 0:m.textContent)||p+"/",E=x.getElementsByTagName("AdaptationSet"),j=0;case 18:if(!(j<E.length)){e.next=72;break}if(("image"!==(N=E[j]).getAttribute("contentType")||"image/png"!==N.getAttribute("mimeType"))&&"image/jpeg"!==N.getAttribute("mimeType")){e.next=69;break}if(A=N.getElementsByTagName("SegmentTemplate")[0],O=null===(T=A.getElementsByTagName("SegmentTimeline"))||void 0===T?void 0:T[0],!A||!O){e.next=48;break}if(P=O.getElementsByTagName("S"),M=parseInt(null===(I=P[0])||void 0===I?void 0:I.getAttribute("t")),R=parseInt(null===(S=P[0])||void 0===S?void 0:S.getAttribute("d")),q=N.getElementsByTagName("Representation")[0],$=q.getElementsByTagName("EssentialProperty")[0],B=$.getAttribute("value"),L=null==B?void 0:B.split("x"),D=i(L,2),C=D[0],U=D[1],!A){e.next=46;break}if(A.getAttribute("media"),X=A.getAttribute("timescale"),_=(X?R/X:R)/(C*U),F=q.getAttribute("id"),W=Math.round(k/_),z=Math.ceil(W/(C*U)),G=A.getAttribute("media"),parseInt(A.getAttribute("startNumber")),!isNaN(parseInt(z))){e.next=43;break}return e.abrupt("return");case 43:for(K=[],j=0;j<z;j++)H="/"==(V=G)[0]?new URL(p).origin:p+"/",K.push({duration:_,layout:B,uri:H+V.replace("$Time$",M+j*R).replace("$RepresentationID$",F)});return e.abrupt("return",K);case 46:e.next=69;break;case 48:if(J=N.getElementsByTagName("Representation")[0],Q=J.getElementsByTagName("EssentialProperty")[0],Y=Q.getAttribute("value"),Z=null==Y?void 0:Y.split("x"),ee=i(Z,2),te=ee[0],re=ee[1],!A){e.next=69;break}if(A.getAttribute("media"),ne=A.getAttribute("duration"),ie=A.getAttribute("timescale"),ae=(ie?ne/ie:ne)/(te*re),ue=J.getAttribute("id"),oe=Math.round(k/ae),se=Math.ceil(oe/(te*re)),le=A.getAttribute("media"),ce=parseInt(A.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){e.next=65;break}return e.abrupt("return");case 65:for(pe=[],t=void 0,t=le.match(/Thumbnail_\$Number%0\d+d\$\.\w+/),de=t?t[0]:null,j=0;j<se;j++)fe=de?y(de,j+ce):le,pe.push({duration:ae,layout:Y,uri:w+fe.replace("$Number$",j+ce).replace("$RepresentationID$",ue)});return e.abrupt("return",pe);case 69:j++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}var t}),e,null,[[5,76]])})))).apply(this,arguments)}function y(e,t){var r=e.match(/%0(\d+)d/);if(!r)return e;var n=parseInt(r[1],10),i=String(t).padStart(n,"0");return e.replace(/\$Number%0\d+d\$/,i)}function k(){return(k=e(t.mark((function e(n){var i,a,u,o,s,l,c,d,f,b,v,x,y,k,w;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=r.getPlayer(n),l=s.currentSource(),c=l.src,c=null!==(i=c)&&void 0!==i&&i.includes("blob")?null==s||null===(a=s.getSource)||void 0===a?void 0:a.call(s):c,null===(u=c)||void 0===u||!u.includes("m3u8")){e.next=19;break}return e.next=6,p(c,n);case 6:if(!((null==(d=e.sent)?void 0:d.length)>0)){e.next=17;break}return f=(null==d?void 0:d[0])||null,b=f.uri,v=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,g(v,b);case 12:return x=e.sent,e.next=15,m(x);case 15:y=e.sent,s.thumbnails(y);case 17:e.next=28;break;case 19:if(null===(o=c)||void 0===o||!o.includes("mpd")){e.next=28;break}return e.next=22,h(c,n);case 22:if(!((null==(k=e.sent)?void 0:k.length)>0)){e.next=28;break}return e.next=26,m(k);case 26:w=e.sent,s.thumbnails(w);case 28:case"end":return e.stop()}}),e)})))).apply(this,arguments)}exports.initiateTrickplay=function(e){return k.apply(this,arguments)};
package/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/defineProperty"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),r=require("video.js"),i=require("@babel/runtime/helpers/classCallCheck"),o=require("@babel/runtime/helpers/createClass"),l=require("@babel/runtime/helpers/get"),a=require("@babel/runtime/helpers/inherits"),u=require("@babel/runtime/helpers/possibleConstructorReturn"),s=require("@babel/runtime/helpers/getPrototypeOf"),c=require("./generic-118f7ebd.js"),d=require("./index-aa64a6c0.js"),v=require("./captions-abd87121.js"),f=require("./renditions-05a85e06.js"),p=require("./resolution-7b5483dd.js"),m=require("./skin-55634dc6.js"),g=require("./browser-3670a923.js"),h=require("./localisation-56e0a999.js"),y=require("@babel/runtime/helpers/typeof"),b=require("./manager-77ddd30c.js"),w=require("./playerControlEvents-db923a5c.js");require("@viewlift/comscore/index.js");var k=require("@babel/runtime/helpers/toConsumableArray"),S=require("@babel/runtime/helpers/toArray"),C=require("@viewlift/sse"),E=require("./relatedVideosManager-44ec6d59.js");function T(e,n,t,r){var i=l(s(1&r?e.prototype:e),n,t);return 2&r&&"function"==typeof i?function(e){return i.apply(t,e)}:i}function D(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(D=function(){return!!e})()}require("axios"),require("md5"),require("js-cookie"),require("@babel/runtime/helpers/slicedToArray"),require("@babel/runtime/helpers/objectWithoutProperties"),require("@babel/runtime/helpers/assertThisInitialized");var O=r.getComponent("TextTrackSettings"),P=r.dom,x=[{value:"0.50",label:"50%"},{value:"0.75",label:"75%"},{value:"1.00",label:"100%"},{value:"1.25",label:"125%"},{value:"1.50",label:"150%"},{value:"1.75",label:"175%"},{value:"2.00",label:"200%"},{value:"3.00",label:"300%"},{value:"4.00",label:"400%"}],j=x.map((function(e){return e.value})),I="1.00",_=".vjs-font-percent > select",A="vlp-caption-font-size-style",L="#FFF",R="1",B="#000",M="1",N="#000",V="0",U="proportionalSansSerif",q="#222",H="#ccc",F={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'},z=function(e,n){var t=parseFloat(e);return isNaN(t)?n:t},G=function(e,n){var t;if(e&&4===e.length)t=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(!e||7!==e.length)return e;t=e.slice(1)}return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+n+")"},W=null;function K(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(K=function(){return!!e})()}O?(W=function(){a(r,O);var e,n,t=(e=r,n=D(),function(){var t,r=s(e);if(n){var i=s(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return u(this,t)});function r(e,n){var o;return i(this,r),(o=t.call(this,e,n)).customReady_=!0,o.customUiReady_=!0,o.triggerEl_=null,o.applyCustomFontSizeUI_(),o}return o(r,[{key:"conditionalFocus_",value:function(){this.triggerEl_=this.getCaptionsTrigger_(),this.previouslyActiveEl_=null,this.focus()}},{key:"conditionalBlur_",value:function(){this.previouslyActiveEl_=null;var e=this.player_;e&&"function"==typeof e.userActive&&e.userActive(!0);var n=this.triggerEl_||this.getCaptionsTrigger_();this.triggerEl_=null;var t=function(){n&&"function"==typeof n.focus&&n.focus()};"undefined"!=typeof window&&"function"==typeof window.setTimeout?window.setTimeout(t,0):t()}},{key:"getCaptionsTrigger_",value:function(){var e=this.player_&&this.player_.controlBar;return e&&(e.subsCapsButton||e.captionsButton||e.subtitlesButton)||null}},{key:"applyCustomFontSizeUI_",value:function(){var e=this;this.replaceFontSizeOptions_(),this.bindCaptionStyleChange_(),this.on(this.player_,["playerresize","fullscreenchange"],(function(){return e.applyDashCaptionStyles_()})),this.applyDashCaptionStyles_()}},{key:"replaceFontSizeOptions_",value:function(){var e=this.$(_);if(e){for(var n=e.value;e.firstChild;)e.removeChild(e.firstChild);x.forEach((function(n){e.appendChild(P.createEl("option",{value:n.value,textContent:n.label}))})),e.value=-1!==j.indexOf(n)?n:I}}},{key:"bindCaptionStyleChange_",value:function(){for(var e=this,n=this.$$("select"),t=0;t<n.length;t++)this.on(n[t],"change",(function(){return e.applyDashCaptionStyles_()}))}},{key:"selectedMultiplier_",value:function(){var e=this.$(_),n=e&&-1!==j.indexOf(e.value)?e.value:I;return parseFloat(n)}},{key:"styleEl_",value:function(){if("undefined"==typeof document)return null;var e=document.getElementById(A);return e||((e=document.createElement("style")).id=A,document.head.appendChild(e)),e}},{key:"applyDashCaptionStyles_",value:function(){if(this.customReady_){var e;try{e="function"==typeof this.getValues&&this.getValues()||{}}catch(e){return}var n=this.styleEl_(),t=this.player_&&this.player_.el();if(n&&t){var r=[];(e.color&&e.color!==L||e.textOpacity&&e.textOpacity!==R)&&r.push("color: "+G(e.color||L,z(e.textOpacity,1))+" !important");var i=function(e){switch(e){case"dropshadow":return"2px 2px 3px ".concat(q,", 2px 2px 4px ").concat(q,", 2px 2px 5px ").concat(q);case"raised":return"1px 1px ".concat(q,", 2px 2px ").concat(q,", 3px 3px ").concat(q);case"depressed":return"1px 1px ".concat(H,", 0 1px ").concat(H,", -1px -1px ").concat(q,", 0 -1px ").concat(q);case"uniform":return"0 0 4px ".concat(q,", 0 0 4px ").concat(q,", 0 0 4px ").concat(q,", 0 0 4px ").concat(q);default:return""}}(e.edgeStyle);i&&r.push("text-shadow: "+i+" !important"),"small-caps"===e.fontFamily?(r.push("font-family: "+F[U]+" !important"),r.push("font-variant: small-caps !important")):e.fontFamily&&e.fontFamily!==U&&F[e.fontFamily]?(r.push("font-family: "+F[e.fontFamily]+" !important"),r.push("font-variant: normal !important")):r.push("font-variant: normal !important");var o=this.selectedMultiplier_(),l="function"==typeof this.player_.currentHeight&&this.player_.currentHeight()||t.offsetHeight||0;if(1!==o&&l){var a=Math.round(.05*l*o*100)/100;r.push("font-size: "+a+"px !important"),r.push("line-height: normal !important")}var u=e.backgroundColor&&e.backgroundColor!==B||e.backgroundOpacity&&e.backgroundOpacity!==M?"background-color: "+G(e.backgroundColor||B,z(e.backgroundOpacity,1))+" !important":"",s=e.windowColor&&e.windowColor!==N||e.windowOpacity&&e.windowOpacity!==V?"background-color: "+G(e.windowColor||N,z(e.windowOpacity,0))+" !important":"",c=[];r.length&&c.push(".vjs-text-track-display-ttml div,.vjs-text-track-display-ttml span,.vjs-text-track-display-ttml p{"+r.join(";")+"}"),s&&c.push(".vjs-text-track-display-ttml p{"+s+"}"),u&&c.push(".vjs-text-track-display-ttml span{"+u+"}"),n.textContent=c.join("")}}}},{key:"setDefaults",value:function(){if(T(r,"setDefaults",this,3)([]),this.applyDashCaptionStyles_(),"function"==typeof Event)for(var e=this.$$("select"),n=0;n<e.length;n++)e[n].dispatchEvent(new Event("change",{bubbles:!0}))}},{key:"handleLanguagechange",value:function(){T(r,"handleLanguagechange",this,3)([]),this.replaceFontSizeOptions_(),this.bindCaptionStyleChange_(),this.applyDashCaptionStyles_()}},{key:"close",value:function(){var e=this.opened_;T(r,"close",this,3)([]),e&&this.focusCaptionsButton_()}},{key:"focusCaptionsButton_",value:function(){var e=this.player_&&this.player_.controlBar;if(e){var n=e.getChild("SubsCapsButton")||e.getChild("CaptionsButton")||e.getChild("SubtitlesButton");n&&"function"==typeof n.focus&&n.focus()}}}]),r}(),r.registerComponent("TextTrackSettings",W)):console.warn("[vlp] CustomTextTrackSettings: video.js TextTrackSettings is not registered; skipping override.");var Y=r.getComponent("SubsCapsButton"),$=null;Y?($=function(){a(r,Y);var e,n,t=(e=r,n=K(),function(){var t,r=s(e);if(n){var i=s(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return u(this,t)});function r(){return i(this,r),t.apply(this,arguments)}return o(r,[{key:"pressButton",value:function(){!function(e,n,t,r){var i=l(s(1&r?e.prototype:e),n,t);return 2&r&&"function"==typeof i?function(e){return i.apply(t,e)}:i}(r,"pressButton",this,3)([]),this.buttonPressed_&&this.focusFirstVisibleItem_()}},{key:"focusFirstVisibleItem_",value:function(){if(this.menu&&this.menu.el_&&this.menu.el_.contains(document.activeElement)){var e=this.menu.children().slice();e.length&&e[0].hasClass("vjs-menu-title")&&e.shift();for(var n=0;n<e.length&&e[n].hasClass("vjs-texttrack-settings");)n++;n>0&&n<e.length&&this.menu.focus(n)}}}]),r}(),r.registerComponent("SubsCapsButton",$)):console.warn("[vlp] CustomSubsCapsButton: video.js SubsCapsButton is not registered; skipping override.");var J=function(e){return new Promise((function(n,t){if(X(e))t("".concat(e," is alread initialised"));else{var r=document.createElement("script");r.async=!0,r.src=e,r.onload=function(){n()},r.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(r)}}))},X=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},Q=function(e,n,t){var r=m.getPlayer(e);if(r)if(n>=0&&n<=100){r.muted()&&r.muted(!1);var i=parseFloat(n)/100;r.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},Z=function(e){var n=m.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},ee=function(){var e=n(t.mark((function e(n){var i,o,l,a,u;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=m.getPlayer(null==n?void 0:n.playerId),null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable||null==n||!n.chromecastReceiverId){e.next=22;break}return e.next=4,Promise.resolve().then((function(){return require("./index-774736bd.js")})).then((function(e){return e.index}));case 4:return a=e.sent,e.prev=5,e.next=8,J("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,a.default(r),e.finish(13);case 16:(u=r.getTech("chromecast"))&&!u.prototype.seeking&&(u.prototype.seeking=function(){}),null!==(l=window)&&void 0!==l&&l.cast?null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=n&&n.chromecastReceiverId&&null!=n&&n.airplay&&"Safari"==g.detectBrowser()?null==o||o.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return e.stop()}}),e,null,[[5,10,13,16]])})));return function(n){return e.apply(this,arguments)}}(),ne=function(e,n){var t=m.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,i,o,l,a,u=this.el(),s=r.dom.getPointerPosition(u,n).x;r.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var c=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=null===(t=window)||void 0===t||null===(i=t.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(l=o.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(c),c&&"CONNECTED"===d){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),f=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=f*s,v.seek()}}))};var te=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),J("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)}}(),re=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("@viewlift/comscore/index.js").then((function(e){c.comscoreInstanceManager.set(e)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ie=function(){var e=n(t.mark((function e(){return t.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){r.getPlugin("eme")||r.registerPlugin("eme",e.default)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),oe=function(){var e=n(t.mark((function e(){var n;return t.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(r),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)}}(),le=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then((function(){return require("./index-de9db53d.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)}}(),ae=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then((function(){return require("./videojs-dash5.es-0f92604f.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)}}(),ue=Object.freeze({__proto__:null,importChromecast:function(){Promise.resolve().then((function(){return require("./index-774736bd.js")})).then((function(e){return e.index})).then((function(e){J("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(r)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){Promise.resolve().then((function(){return require("./index-f3365b73.js")})).then((function(e){return e.index})).then((function(e){e.default(r)}))},loadAdsLibrary:te,loadEMELibrary:ie,loadMuxPlugin:oe,loadDvrSeekbar:le,loadContribDash:ae,loadComscorePlugin:re});function se(e){return ce.apply(this,arguments)}function ce(){return(ce=n(t.mark((function e(n){var r;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(null==n?void 0:n.airplay)||!1,e.next=3,te();case 3:r&&"Safari"==g.detectBrowser()&&Promise.resolve().then((function(){return ue})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function de(e){return ve.apply(this,arguments)}function ve(){return(ve=n(t.mark((function e(n){var r,i,o,l,a,u,s,c,d,v;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v=m.getPlayer(n.playerId),e.next=3,re();case 3:v.comscore({publisherId:null==n||null===(r=n.comscore)||void 0===r?void 0:r.publishedId,endpoint:null==n||null===(i=n.comscore)||void 0===i?void 0:i.endpoint,applicationName:(null==n||null===(o=n.comscore)||void 0===o?void 0:o.applicationName)||(null===(l=window)||void 0===l?void 0:l.siteName)||null,implementationId:null==n||null===(a=n.comscore)||void 0===a?void 0:a.implementationId,projectId:null==n||null===(u=n.comscore)||void 0===u?void 0:u.projectId,debug:(null==n||null===(s=n.comscore)||void 0===s?void 0:s.debug)||!1,persistentLabels:(null==n||null===(c=n.comscore)||void 0===c?void 0:c.persistentLabels)||{},metadata:(null==n||null===(d=n.comscore)||void 0===d?void 0:d.metadata)||{}});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function fe(e,n){return pe.apply(this,arguments)}function pe(){return(pe=n(t.mark((function e(n,r){var i,o,l,a,u,s,c,d,v,f,p,m,h,y;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v=(null==r?void 0:r.contentType)||"video",f=null==r||null===(i=r[v])||void 0===i?void 0:i.drmEnabled,null==r||null===(o=r[v])||void 0===o||null===(l=o.liveDetails)||void 0===l||l.isDvrEnabled,null==n||n.showPositiveSeekbar,p=(null==r||null===(a=r[v])||void 0===a||null===(u=a.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.dash)||null,m=(null==n||null===(c=n.comscore)||void 0===c?void 0:c.enable)||!1,h=!(null==n||null===(d=n.analytics)||void 0===d||!d.muxKey),e.prev=7,e.next=10,Promise.allSettled([f?"Safari"==g.detectBrowser()?ie():"caliente"!=(null===(y=window)||void 0===y?void 0:y.siteName)?ae():ie():"Safari"!=g.detectBrowser()&&p?ae():null,m?de(n):null,h?oe():null,ee(n)]);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(7),console.log("Error",e.t0);case 15:case"end":return e.stop()}}),e,null,[[7,12]])})))).apply(this,arguments)}function me(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function ge(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?me(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):me(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}var he=new Set,ye=null,be=function(e,n,t,r){var i,o,l,a,u,s,d,v,f={},p=(null==e?void 0:e.contentType)||"video";f["c3.cm.id"]=(null===(i=e[p])||void 0===i?void 0:i.id)||"Null",f["c3.cm.contentType"]=De(e),f[null==t||null===(o=t.Constants)||void 0===o?void 0:o.IS_LIVE]=!(null==e||!e.linearchannel),f[null==t||null===(l=t.Constants)||void 0===l?void 0:l.STREAM_URL]=n.currentSrc();var m=(null===(a=b.playerConfigManager.getConfig())||void 0===a?void 0:a.userId)||c.getUserId();f[null==t||null===(u=t.Constants)||void 0===u?void 0:u.VIEWER_ID]="undefined"===m?"NULL":m,f["c3.cm.categoryType"]=Ce(e),f["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"}}(),f.DRMEnabled=(null===(s=e[p])||void 0===s?void 0:s.drmEnabled)||"None",f.DAIStream=null!==(d=e[p])&&void 0!==d&&null!==(v=d.gist)&&void 0!==v&&v.isSSAIEnabled?"YES":"NO",f[t.Constants.DEFAULT_RESOURCE]="AKAMAI",f["c3.cm.brand"]="NULL",f.CDVREnabled=Ee(e),f["c3.cm.genreList"]=ke(e),f["c3.cm.genre"]=we(e),f["c3.cm.channel"]=Se(e,r);var g=Pe(c.getCurrentSeries(),e);return f=ge(ge({},f),g)},we=function(e){var n,t,r,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(r=t.primaryCategory)||void 0===r?void 0:r.title)||"Null"},ke=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"},Se=function(e,n){var t,r,i=(null==e?void 0:e.contentType)||"video";return"video"===i?"VOD":(null===(r=((null==e||null===(t=e[i])||void 0===t?void 0:t.channels)||[]).find((function(e){return(null==e?void 0:e.id)===(null==n?void 0:n.channelId)})))||void 0===r?void 0:r.title)||"NULL"},Ce=function(e){var n,t;return null!=e&&e.linearchannel?"Linear Channel":null!=e&&null!==(n=e.video)&&void 0!==n&&null!==(t=n.streamingInfo)&&void 0!==t&&t.isLiveStream?"Live Event":"VOD"},Ee=function(e){var n,t,r=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[r])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},Te=function(e,n){var t,r,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var o=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[o])||void 0===t||null===(r=t.gist)||void 0===r?void 0:r.title)||"Null";return"".concat(l)},De=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var Oe,Pe=function(e,n){var t,r,i,o,l,a={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return a;var u=c.getSeasonNumber(),s=c.getEpisodeNumber();return a["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(r=t.series)||void 0===r?void 0:r.title)||"Null",a["c3.cm.seasonNumber"]=(null==u?void 0:u.toString())||"Null",a["c3.cm.showTitle"]=(null==e||null===(i=e[u-1])||void 0===i||null===(o=i.episodes)||void 0===o||null===(l=o[s-1])||void 0===l?void 0:l.title)||"Null",a["c3.cm.episodeNumber"]=(null==s?void 0:s.toString())||"Null",a},xe=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"}},je=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Ie=function(){var e=n(t.mark((function e(n,r){var i,o,l,a,u,s,d,v,f,p,g,h;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.convivaConfig)||{},o=i.trackConvivaPlayerEvent,l=i.paymentHandler,a=i.tveProvider,u=i.enable,s=i.appName,v=(d=r||{}).token,f=d.epg,u){e.next=4;break}return e.abrupt("return");case 4:if(p=m.getPlayer(n),"function"==typeof(g=o)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,g("getConvivaObject");case 10:if(h=e.sent){e.next=13;break}return e.abrupt("return");case 13:p.ready((function(){var e=p.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var r=xe(t.keySystem);g("contentInfo",{DRMEnabled:r})}else g("contentInfo",{DRMEnabled:"None"})})),n||g("contentInfo",{DRMEnabled:"None"})})),p.on("loadstart",(function(){var e,n;ye&&ye!==p.currentSrc()&&g("playbackEnded"),g("setPlayer",p),he.clear(),ye=p.currentSrc();var t=je(p.currentType()),i=c.getCurrentVideo(),o=be(i,p,h,f);o[null==h||null===(e=h.Constants)||void 0===e?void 0:e.PLAYER_NAME]=s||"WEB",o[null==h||null===(n=h.Constants)||void 0===n?void 0:n.ASSET_NAME]=Te(i,r),o.authToken=v||"NULL",o.streamType=t,o.D2CType=l||"NONE",o.subscriberType=a?"MVPD":"FREE"!==l?"D2C":"FREE",o["c3.cm.affiliate"]=a||"NULL",_e.setData(o),g("contentInfo",o)})),p.on("loadedmetadata",(function(){var e,n=p.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),g("contentInfo",{screenResolution:e})})),p.on("play",(function(){he.has(p.currentSrc())||(he.add(p.currentSrc()),g("playbackStarted",null))})),p.on("ended",(function(){he.has(p.currentSrc())&&he.delete(p.currentSrc()),g("playbackEnded")})),p.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&g("initAdSensor",{player:p,adsLoader:null==e?void 0:e.adsLoader})})),p.on("dispose",(function(){null==he||he.clear(),g("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),_e=(Oe={},{setData:function(e){Oe=ge(ge({},Oe),e)},getData:function(){return Oe}}),Ae=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-ebab1e3f.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-dc3525c7.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-3a43f138.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-a9a5a925.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-237f8d4f.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t?Promise.resolve().then((function(){return require("./skin-b11e1757.js")})).then((function(t){t.initialiseSkin(e,n)})):"news"==t?Promise.resolve().then((function(){return require("./skin-f7c4ead4.js")})).then((function(t){t.initialiseSkin(e,n)})):"news_live"==t?Promise.resolve().then((function(){return require("./skin-425c1322.js")})).then((function(t){t.initialiseSkin(e,n)})):"mini"==t?Promise.resolve().then((function(){return require("./skin-dbff0922.js")})).then((function(t){t.initialiseSkin(e,n)})):"CN_NEWS"==t&&Promise.resolve().then((function(){return require("./skin-c49d50b6.js")})).then((function(t){t.initialiseSkin(e,n)}))};function Le(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}var Re,Be=["offsetSeconds","offsetLabel"],Me=function(n){if(!n||"object"!==y(n))return n;if(!Be.some((function(e){return e in n})))return n;var t=function(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Le(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Le(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}({},n);return Be.forEach((function(e){return delete t[e]})),t},Ne=function(e){try{if(!e)return null;e.refreshAnchor();var n="function"==typeof e.anchorInfo?e.anchorInfo():{};if("vod"===n.source)return{live:!1,source:"vod"};var t=("function"==typeof e.displayBounds?e.displayBounds():e.windowBounds())||{},r=t.start,i=t.end;if(!(Number.isFinite(r)&&i>r))return null;var o=null!=n.anchorPdtSec&&null!=n.anchorPlayerT;return{live:!0,source:n.source,windowEnd:i,anchorT:o?n.anchorPlayerT:null,anchorUtc:o?n.anchorPdtSec:null,nowSec:Date.now()/1e3}}catch(e){return null}},Ve=function(e,n){try{return Ue(e,n)}catch(e){return null}},Ue=function(e,n){if(!e)return null;var t=c.chapterUtcBounds(n).start;if(!Number.isFinite(t))return null;if(!e.live)return{seconds:t,live:!1};var r=null!=e.anchorUtc?e.anchorT+(t-e.anchorUtc):e.windowEnd-(e.nowSec-t);return Number.isFinite(r)?{seconds:Math.max(0,e.windowEnd-r),live:!0}:null},qe=function(e){if(!e||!Number.isFinite(e.seconds))return"";var n=r.formatTime(e.seconds,e.seconds);return e.live?"-".concat(n):n},He=(Re=new Map,{set:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=Array.isArray(n)?n.map(Me):[];return Re.set(e,t),t},get:function(e){return Re.get(e)||[]},remove:function(e){Re.delete(e)}}),Fe="chapter-change",ze="chapter-click",Ge="chapters-updated";function We(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=m.getPlayer(e);r?r.trigger(n,t):console.error("[CHAPTERS] Player instance not found")}function Ke(e){var n=m.getPlayer(e);if(!n)return console.error("[CHAPTERS] Player instance not found"),{};var t=function(e,t){var r=function(e,n){return t(n)};return n.on(e,r),function(){return n.off(e,r)}};return{onChapterChange:function(e){return t(Fe,e)},onChapterClick:function(e){return t(ze,e)},onChaptersUpdated:function(e){return t(Ge,e)}}}var Ye="vjs-chapter-marker",$e="vjs-chapter-preview",Je=function(e){try{var n,t,r;return(null==e||null===(n=e.controlBar)||void 0===n||null===(t=n.progressControl)||void 0===t||null===(r=t.seekBar)||void 0===r?void 0:r.el())||null}catch(e){return null}};function Xe(e,n){var t=n.store,r=n.mapper,i=n.chaptersConfig,o=void 0===i?{}:i,l=n.seek,a=m.getPlayer(e);if(!a)return{render:function(){},reposition:function(){},destroy:function(){}};var u=new Map,s=null,c=-1,d=null,v=function(){return!0===(null==o?void 0:o.enable)},f=function(e){try{return r.chapterStartPercent(e)}catch(e){return null}},p=function(n,t,i){var o=m.getPlayer(e),l=Je(o);if(l){var a=function(e){if(s&&s.isConnected)return s;(s=document.createElement("div")).className=$e;var n=document.createElement("div");n.className="vjs-chapter-preview__time";var t=document.createElement("div");t.className="vjs-chapter-preview__label",s.appendChild(n),s.appendChild(t);var r=document.createElement("span");return r.className="vjs-chapter-preview__pointer",s.appendChild(r),s._time=n,s._label=t,s._pointer=r,e.appendChild(s),s}(l);a._time.textContent=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ne(r);return qe(Ve(n,e))}(n,i),a._label.textContent=(null==n?void 0:n.label)||"",a.classList.add("vjs-chapter-preview--visible");var u="function"==typeof(null==o?void 0:o.el)?o.el():null;u&&u.classList.add("vlp-chapter-preview-open"),function(e,n,t,r){var i="function"==typeof(null==t?void 0:t.el)?t.el():null;if(i){var o=i.getBoundingClientRect(),l=n.getBoundingClientRect(),a=e.offsetWidth||300,u=a/2,s=l.left+r/100*l.width,c=o.left+8+u,d=o.right-8-u,v=s;d>=c&&(v=Math.min(Math.max(s,c),d));var f=v-u-l.left;if(e.style.left="".concat(f,"px"),e.style.transform="none",e._pointer){var p=Math.min(Math.max(s-(l.left+f),8),a-8);e._pointer.style.left="".concat(p,"px")}}else e.style.left="".concat(r,"%")}(a,l,o,t)}},g=function(){d=null,s&&s.classList.remove("vjs-chapter-preview--visible");var n=m.getPlayer(e),t="function"==typeof(null==n?void 0:n.el)?n.el():null;t&&t.classList.remove("vlp-chapter-preview-open")},h=function(e){if(d&&s&&s.classList.contains("vjs-chapter-preview--visible")){var n=f(d);null!=n?p(d,n,e):g()}},y=function(n){var r=document.createElement("div");r.className=Ye,r.dataset.segmentId=String(n.segmentId);var i=function(e){var n=null!=e&&e.icon?String(e.icon).trim():"";if(!n)return null;var t=document.createElement("span");if(t.className="vjs-chapter-marker__icon","<"===n.charAt(0)){var r=m.parseSvgString(n);r&&t.appendChild(r)}else{var i=document.createElement("img");i.src=n,i.alt="",t.appendChild(i)}return t}(n);i&&r.appendChild(i);var o=function(r){if("touchstart"===r.type)r.preventDefault();else if("mousedown"===r.type&&0!==r.button)return;r.stopPropagation(),"function"==typeof l&&l(n.segmentId);var i=t.get(e).indexOf(n);We(e,ze,{chapter:n,index:i,position:i>=0?i+1:void 0})};return r.addEventListener("mousedown",o),r.addEventListener("touchstart",o),r.setAttribute("role","button"),r.setAttribute("tabindex","0"),null!=n&&n.label&&r.setAttribute("aria-label",String(n.label)),r.addEventListener("keydown",(function(e){"Enter"!==e.key&&" "!==e.key&&"Spacebar"!==e.key||e.repeat||(e.preventDefault(),o(e))})),r.addEventListener("mouseenter",(function(){var e=f(n);null!=e&&(d=n,p(n,e))})),r.addEventListener("mouseleave",g),r},b=function(n){v()&&0!==u.size&&(n||r.refreshAnchor(),t.get(e).forEach((function(e){var n=u.get(String(e.segmentId));if(n){var t=f(e);null==t?n.style.display="none":(n.style.display="",n.style.left="".concat(t,"%"))}})))},w=0,k=function(n){u.forEach((function(e){return e.classList.remove("".concat(Ye,"--active"))}));var r=t.get(e),i=n>=0?r[n]:null;if(i){var o=u.get(String(i.segmentId));o&&o.classList.add("".concat(Ye,"--active"))}},S=function(){var n=m.getPlayer(e);if(n){var i=t.get(e),o=r.playerTimeToChapterIndex(n.currentTime()||0,i);-1===o&&Date.now()<w||o!==c&&(c=o,k(o),We(e,Fe,{chapter:o>=0?i[o]:null}))}},C=m.throttle((function(){var e=Ne(r);b(!0),h(e),S()}),1e3),E=function(){var e=Ne(r);b(!0),h(e),S()},T=function(){Ne(r),b(!0)};a.on("timeupdate",C),a.on("seeked",E);var D=!1;try{a.liveTracker&&"function"==typeof a.liveTracker.on&&(a.liveTracker.on("liveedgechange",T),D=!0)}catch(e){}var O=null;(function(){try{return"function"==typeof r.anchorInfo&&"vod"!==r.anchorInfo().source}catch(e){return!1}})()&&(O=setInterval((function(){var e=Ne(r);b(!0),h(e)}),500));return{render:function(){var n=m.getPlayer(e),i=Je(n);i&&(g(),i.querySelectorAll(".".concat(Ye)).forEach((function(e){return e.remove()})),u.clear(),v()&&(r.refreshAnchor(),t.get(e).forEach((function(e){var n=y(e);i.appendChild(n),u.set(String(e.segmentId),n)})),b(!0),k(c),S()))},reposition:b,destroy:function(){try{a.off("timeupdate",C),a.off("seeked",E),D&&a.liveTracker.off("liveedgechange",T)}catch(e){}O&&(clearInterval(O),O=null);var n=Je(m.getPlayer(e));n&&n.querySelectorAll(".".concat(Ye,", .").concat($e)).forEach((function(e){return e.remove()})),u.clear(),s=null,d=null},setActiveBySegment:function(n){var r=t.get(e),i=r.findIndex((function(e){return String(e.segmentId)===String(n)}));i<0||(w=Date.now()+1500,i!==c&&(c=i,k(i),We(e,Fe,{chapter:r[i]})))}}}function Qe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function Ze(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qe(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Qe(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}var en=new Map,nn=function(e){var n=e.live,t=e.dvr;return function(e){return Array.isArray(e)&&e.some((function(e){return e&&e.eventStartUtc}))}(e.chapters)||n&&t?"livedvr":"vod"},tn=function(e){try{var n,t,r;return!(null==e||null===(n=e.controlBar)||void 0===n||null===(t=n.progressControl)||void 0===t||null===(r=t.seekBar)||void 0===r||!r.el())}catch(e){return!1}},rn=function(e){var n=en.get(e);if(n)return n;n={mapper:c.createTimelineMapper(e,{timeMode:"vod"}),markers:null,chaptersConfig:{enable:!0},timeMode:"vod",live:!1,dvr:!1,disposed:!1},en.set(e,n);var t=m.getPlayer(e);return t&&(t.on("dispose",(function(){return cn(e)})),t.one("loadeddata",(function(){n.disposed||on(e)}))),n},on=function(e){var n=en.get(e),t=function(e){var n=en.get(e);if(!n||n.markers)return(null==n?void 0:n.markers)||null;var t=m.getPlayer(e);return t&&tn(t)?(n.markers=Xe(e,{store:He,mapper:n.mapper,chaptersConfig:n.chaptersConfig,seek:function(n){return sn(e,n)}}),n.markers):null}(e);t&&n&&t.render()};function ln(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=rn(e);He.set(e,n);var r=nn({live:t.live,dvr:t.dvr,chapters:n});return r!==t.timeMode&&(t.timeMode=r,t.mapper=c.createTimelineMapper(e,{timeMode:r}),t.markers&&(t.markers.destroy(),t.markers=null)),on(e),We(e,Ge,{chapters:He.get(e)}),!0}function an(e){var n=He.get(e),t=en.get(e);if(!t||!n.length)return n;var r=Ne(t.mapper);try{return n.map((function(e){var n=Ve(r,e);return Ze(Ze({},e),{},{offsetSeconds:n?n.seconds:null,offsetLabel:qe(n)})}))}catch(e){return n}}function un(e){He.set(e,[]);var n=en.get(e);return null!=n&&n.markers&&n.markers.render(),We(e,Ge,{chapters:[]}),!0}function sn(e,n){var t,r,i=m.getPlayer(e),o=rn(e);if(!i)return!1;var l=He.get(e).find((function(e){return e.segmentId===n}));if(!l)return!1;o.mapper.refreshAnchor();var a=o.mapper.chapterToPlayerTime(l);if(null==a||!Number.isFinite(a))return!1;var u=o.mapper.windowBounds(),s=u.start,c=u.end;return Number.isFinite(s)&&Number.isFinite(c)&&c>s&&(a=Math.min(Math.max(a,s),c-.1)),i.currentTime(a),null===(t=o.markers)||void 0===t||null===(r=t.setActiveBySegment)||void 0===r||r.call(t,n),!0}function cn(e){var n=en.get(e);n&&(n.disposed=!0,n.markers&&n.markers.destroy()),en.delete(e),He.remove(e)}function dn(e){var n,t,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=b.playerConfigManager.getConfig();(null!=o&&null!==(n=o.chaptersConfig)&&void 0!==n&&n.enable||null!=o&&null!==(t=o.chapters)&&void 0!==t&&t.length)&&(function(e,n){var t,r=null===(t=m.getPlayer(e))||void 0===t?void 0:t.el();if(r&&n){var i=function(e,n){null!=n&&""!==n&&r.style.setProperty(e,n)};i("--vl-chapter-color",n.markerColor),i("--vl-chapter-active",n.markerActiveColor),i("--vl-chapter-hover",n.markerHoverColor),i("--vl-chapter-size",null!=n.markerSize?"".concat(n.markerSize,"px"):null),i("--vl-chapter-opacity",null!=n.markerOpacity?String(n.markerOpacity):null),i("--vl-chapter-tooltip",n.tooltipColor)}}(e,null==o||null===(r=o.chaptersConfig)||void 0===r?void 0:r.style),function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.chapters,r=void 0===t?[]:t,i=n.live,o=void 0!==i&&i,l=n.dvr,a=void 0!==l&&l;n.res;var u=n.chaptersConfig,s=void 0===u?{}:u,d=m.getPlayer(e);if(!d)return!1;Array.isArray(r)&&He.set(e,r);var v=nn({live:o,dvr:a,chapters:r}),f=en.get(e);null!=f&&f.markers&&f.markers.destroy();var p={mapper:c.createTimelineMapper(e,{timeMode:v}),markers:null,chaptersConfig:s||{},timeMode:v,live:o,dvr:a,disposed:!1};en.set(e,p);var g=function(){p.disposed||on(e)};d.one("loadeddata",g),tn(d)&&g(),d.on("dispose",(function(){return cn(e)}))}(e,{chapters:(null==o?void 0:o.chapters)||[],live:(null==i?void 0:i.liveVideo)||!1,dvr:(null==i?void 0:i.isDvrEnabled)||!1,res:null==i?void 0:i.res,chaptersConfig:(null==o?void 0:o.chaptersConfig)||{}}))}var vn=!1,fn=function(e,n){var t,r,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(r=t.streamingInfo)||void 0===r?void 0:r.secondaryVideoAssets)||null)&&!vn){var o=pn(e,"videoAssets","secondaryVideoAssets"),l=c.getSource(o,n);return l&&c.loadVideo(n,l),vn=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function pn(e,n,t){if(Array.isArray(e))return e.map((function(e){return pn(e,n,t)}));if(null!==e&&"object"===y(e)){var r={};return Object.keys(e).forEach((function(i){i===n&&void 0!==e[t]?r[i]=e[t]:i===t&&void 0!==e[n]?r[i]=e[n]:r[i]=pn(e[i],n,t)})),r}return e}function mn(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 gn(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)?gn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,o=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw o}}}}function gn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function hn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function yn(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hn(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):hn(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}var bn,wn=function(e,n,t,r){var i,o,l,a,u,s=r.res,d=r.sres,f=m.getPlayer(e),p=(null==s?void 0:s.contentType)||"video",h=(null==s||null===(i=s[p])||void 0===i?void 0:i.drmEnabled)||!1,b=!(null==s||null===(o=s[p])||void 0===o||null===(l=o.streamingInfo)||void 0===l||!l.isLiveStream)||"linearchannel"===p,k=(null==s||null===(a=s[p])||void 0===a||null===(u=a.liveDetails)||void 0===u?void 0:u.isDvrEnabled)||!1;c.setCurrentVideo(s),c.videoReplayTracker.set(s),f&&(w.initPlayerControlEvents(e,{liveVideo:b,isDvrEnabled:k}),f.on("loadstart",(function(){b?t.resolve({status:!0,msg:"Video Loaded",response:s}):t.resolve(yn({status:!0,msg:"Player Initialised"},d?{seriesResponse:d,response:s}:{response:s}))})),f.on("loadeddata",(function(){var t,r,i,o,l=v.getCaptions(e);if(null==l||l.map((function(n){return v.disableCaptions(e,n.id)})),k&&"Safari"===g.detectBrowser())try{var a;null==f||null===(a=f.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==f||!f.muted())&&Q(e,sessionStorage.getItem("volume")||"100"),w.resyncControlState(e);var u=c.getCurrentVideo();if(c.initialiseComscoreStreamingTracking(n),c.clearError(),null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.isExternal){var d=yn(yn({},n),s);c.initiateWatchHistoryHandlingExternal(f,d)}else if(null!=n&&n.watchHistory&&null!=n&&null!==(r=n.watchHistory)&&void 0!==r&&r.enable&&(!n.isAnonymousUser||null!=n&&null!==(i=n.watchHistory)&&void 0!==i&&i.saveOffline)){var p,m,h=yn(yn({},n),s);c.initiateWatchHistoryHandling(e,h,null==u||null===(p=u.video)||void 0===p||null===(m=p.gist)||void 0===m?void 0:m.id)}if(null!=n&&null!==(o=n.analytics)&&void 0!==o&&o.muxKey&&null!=f&&f.mux){var y,b,S,C,E,T,D=(null===(y=c.getCurrentVideo())||void 0===y?void 0:y.video)||(null==s?void 0:s.video),O=null==D?void 0:D.gist,P={env_key:null==n||null===(b=n.analytics)||void 0===b?void 0:b.muxKey,player_name:"vl-web-player",player_version:null===(S=window)||void 0===S?void 0:S.vl_player_version,video_id:null==O?void 0:O.id,video_title:null==O?void 0:O.title,video_series:null==D||null===(C=D.series)||void 0===C?void 0:C.title,video_stream_type:null!=D&&null!==(E=D.streamingInfo)&&void 0!==E&&E.isLiveStream?"live":"video",viewer_user_id:null==n||null===(T=n.analytics)||void 0===T?void 0:T.userId};f.mux({debug:!1,data:P})}})),f.textTracks().on("change",(function(n){var t=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];v.syncTtmlDisplay(e),f.trigger("subtitlechanged",t)})),f.tech_.on("retryplaylist",(function(){b&&fn(s,e)})),f.on("error",(function(){var n,r;(console.log("ERROR",f.error(),f.error().code),4===f.error().code&&b)?fn(s,e):(c.handleError(e,(null==f||null===(n=f.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==f||null===(r=f.error())||void 0===r?void 0:r.message)||"Some error occured",response:s}))})),f.one("play",(function(){var e,t,r,i,o;if(null===(e=window)||void 0===e||null===(t=e.app_data)||void 0===t||null===(r=t.appcmsMain)||void 0===r||null===(i=r.adsConfig)||void 0===i||!i.vodAdClientSideTracking){if(null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable){var l,a,u,s=null===(l=c.getCurrentVideo())||void 0===l||null===(a=l.video)||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.id,d=c.getSeriesWatchMap(),v=(null==d?void 0:d.get(s))||{t:0,p:0},p=v.t,m=v.p;p&&m<95&&c.seekToResumeTime(f,p)}else{var g,h,y,b,w,k,S,C=null!==(g=null==n?void 0:n.watchHistoryResumeTime)&&void 0!==g?g:null==n||null===(h=n.watchHistory)||void 0===h?void 0:h.watchedTime,E=null!==(y=null!==(b=null==n?void 0:n.watchedPercentage)&&void 0!==b?b:null==n||null===(w=n.watchHistory)||void 0===w?void 0:w.watchedPercentage)&&void 0!==y?y:0,T=null!==(k=null==n||null===(S=n.watchHistory)||void 0===S?void 0:S.completionThreshold)&&void 0!==k?k:95;C&&E<T&&c.seekToResumeTime(f,C)}if(null!=f&&f.dvrSeekbar)try{f.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}})),f.on("volumechange",(function(){var e=100*f.volume().toFixed(2);f.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),f.on("chromecastDisconnected",(function(){if(b){f.currentSource();for(var n=f.textTracks(),t=n.length-1;t>=0;t--)f.removeRemoteTextTrack(n[t])}var r=f.textTracks(),i=function(){return v.removeDuplicateCaptions(e)};i(),r.addEventListener("addtrack",i),setTimeout((function(){return r.removeEventListener("addtrack",i)}),15e3)})),f.one("loadeddata",(function(){var e,n=(null==f||null===(e=f.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort((function(e,n){var t=(e.language||e.language||"").toUpperCase(),r=(n.language||n.label||"").toUpperCase();return t<r?-1:t>r?1:0})),"object"==y(f.dash)){var t,r,i,o=null==f||null===(t=f.dash)||void 0===t||null===(r=t.mediaPlayer)||void 0===r?void 0:r.getTracksFor("audio"),l=null==o?void 0:o.find((function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")})),a=mn(n);try{for(a.s();!(i=a.n()).done;){var u=i.value;if(l&&(null==u?void 0:u.id)=="dash-audio-".concat(l.index)){u.enabled=!0;break}}}catch(e){a.e(e)}finally{a.f()}}else{var s,c=[],d=mn(n);try{for(d.s();!(s=d.n()).done;){var v,p,m,b=s.value;("Chrome"==g.detectBrowser()||"Edge"==g.detectBrowser()&&(null!==(v=navigator)&&void 0!==v&&null!==(p=v.userAgent)&&void 0!==p&&p.includes("Macintosh")||!h))&&null!=b&&null!==(m=b.label)&&void 0!==m&&m.includes("5.1")?f.audioTracks().removeTrack(b):c.push(b)}}catch(e){d.e(e)}finally{d.f()}for(var w=c.find((function(e){return"main"===e.kind})),k=w||c.find((function(e){return e.enabled}))||c[0],S=0,C=c;S<C.length;S++){var E=C[S];E.enabled=E===k}}})))},kn=(null===(bn=r.time)||void 0===bn?void 0:bn.createTimeRanges)||r.createTimeRanges;function Sn(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.scheduleStartDate,r=n.startOverTime;if(e&&(t||r)){var i,o=t?(i=t)>1e12?i/1e3:i:null,l=r>0?r:null,a=e.seekable.bind(e);e.seekable=function(){var e=a();if(!e||!e.length)return e;var n=e.start(0),t=e.end(e.length-1),r=Date.now()/1e3,i=1/0;if(null!=o&&(i=Math.min(i,r-o)),null!=l&&(i=Math.min(i,l)),!isFinite(i))return e;var u=i<=0?t:Math.max(n,t-i);return kn(u,t)};e.on("seeking",(function(){var n=e.seekable();if(n&&n.length){var t=n.start(0);e.currentTime()<t-.5&&e.currentTime(t)}}))}}function Cn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function En(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Cn(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Cn(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}var Tn="urn:x-cast:com.viewlift.player.caf",Dn={eng:"en",spa:"es",esp:"es",cast:"es",fre:"fr",fra:"fr",ger:"de",deu:"de",por:"pt",ita:"it",dut:"nl",nld:"nl",chi:"zh",zho:"zh",cmn:"zh",yue:"zh",jpn:"ja",kor:"ko",ara:"ar",hin:"hi",rus:"ru",heb:"he",iw:"he",ind:"id",in:"id",fil:"tl",tgl:"tl",vie:"vi",tha:"th",tur:"tr",pol:"pl",swe:"sv",nor:"no",nob:"no",nb:"no",dan:"da",fin:"fi",gre:"el",ell:"el",cze:"cs",ces:"cs",ukr:"uk",rum:"ro",ron:"ro",hun:"hu",ben:"bn",tam:"ta",tel:"te",mal:"ml",kan:"kn",mar:"mr",pan:"pa",guj:"gu",urd:"ur"},On=["und","mul","zxx"];function Pn(){try{return"true"===new URLSearchParams(window.location.search).get("castdebug")}catch(e){return!1}}function xn(){var e;Pn()&&(e=console).log.apply(e,arguments)}function jn(){var e;Pn()&&(e=console).warn.apply(e,arguments)}function In(e){if(!e)return"";var n=String(e).trim().toLowerCase().replace(/_/g,"-").split("@")[0].split(".")[0].split("-").filter(Boolean),t=S(n),r=t[0],i=t.slice(1);return r?[Dn[r]||r].concat(k(i)).join("-"):""}function _n(e){return In(e).split("-")[0]}function An(e){var n=_n(e);return!!n&&!On.includes(n)}function Ln(e,n){return An(e)&&An(n)&&_n(e)===_n(n)}function Rn(e){return e?String(e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").trim().toLowerCase():""}function Bn(e,n){return!!e&&!!n&&Rn(e)===Rn(n)}function Mn(e){return(null==e?void 0:e.language)||(null==e?void 0:e.lang)||""}function Nn(e){return e?{language:Mn(e)||void 0,label:e.label||void 0,roles:["captions"===e.kind?"caption":"subtitle"],forced:!!e.forced}:null}function Vn(e){return e?{language:Mn(e)||void 0,label:e.label||void 0}:null}function Un(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(!n||!e.length)return null;for(var t=0,r=[function(e){return t=Mn(e),r=n.language,An(t)&&An(r)&&In(t)===In(r);var t,r},function(e){return Ln(Mn(e),n.language)},function(e){return Bn(e.label,n.label)}];t<r.length;t++){var i=r[t],o=e.filter(i);if(1===o.length)return o[0];if(o.length>1)return qn(o,n)}return null}function qn(e,n){var t=n.roles||[];return e.find((function(e){var n;return null===(n=e.roles)||void 0===n?void 0:n.some((function(e){return t.includes(e)}))}))||e[0]}var Hn={textTracks:[],audioTracks:[],activeCaption:null,activeAudio:null};function Fn(e,n){if(!n)return null;var t=Un(e,n);return null!=(null==t?void 0:t.id)?{id:t.id}:n}function zn(e,n,t){if(!n)return!t;if(!t)return!1;var r=Un(e,t);return r&&null!=n.id?r.id===n.id:!!Ln(Mn(n),t.language)&&(!n.label||!t.label||Bn(n.label,t.label))}function Gn(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=function(){var e,n,t,r,i,o,l=null===(e=window)||void 0===e||null===(n=e.cast)||void 0===n?void 0:n.framework,a=null==l||null===(t=l.CastContext)||void 0===t||null===(r=t.getInstance)||void 0===r?void 0:r.call(t),u=null==a||null===(i=a.getCurrentSession)||void 0===i?void 0:i.call(a);return u&&"function"==typeof u.sendMessage?null!=l&&l.CastState&&(null===(o=a.getCastState)||void 0===o?void 0:o.call(a))!==l.CastState.CONNECTED?null:u:null}();if(t){var r=En(En({type:"COMMAND",source:"sender",command:e},n),{},{ts:Date.now()});xn("[Cast] ->",e,n);try{Promise.resolve(t.sendMessage(Tn,r)).catch((function(n){return jn("[Cast] command failed",e,(null==n?void 0:n.message)||n)}))}catch(n){jn("[Cast] command failed",e,(null==n?void 0:n.message)||n)}}}var Wn=function(){return Gn("play")},Kn=function(){return Gn("pause")},Yn=function(e){return Gn("seek",{currentTime:e})},$n=function(e){return Gn("setPlaybackRate",{rate:e})},Jn=function(e,n){return Gn("setVolume",{volume:e,muted:n})},Xn=function(e){zn(Hn.textTracks,Hn.activeCaption,e)||Gn("setCaption",{track:Fn(Hn.textTracks,e)})},Qn=function(e){e&&(zn(Hn.audioTracks,Hn.activeAudio,e)||Gn("setAudio",{track:Fn(Hn.audioTracks,e)}))};function Zn(e){return e?e.tracks_||Array.from(e):[]}function et(e){var n;return Zn(null===(n=e.textTracks)||void 0===n?void 0:n.call(e)).filter((function(e){return"captions"===e.kind||"subtitles"===e.kind}))}function nt(e){return"function"==typeof e.audioTracks?Zn(e.audioTracks()):[]}function tt(e){return et(e).find((function(e){return"showing"===e.mode}))||null}function rt(e){return nt(e).find((function(e){return e.enabled}))||null}function it(e,n){var t=et(e),r=n?Un(t,n):null;n&&!r||t.forEach((function(e){e.mode=e===r?"showing":"disabled"}))}var ot=null;var lt=null;function at(e,n){if("STATE"===n.type)return Hn.textTracks=n.textTracks||[],Hn.audioTracks=n.audioTracks||[],Hn.activeCaption=n.activeCaption||null,Hn.activeAudio=n.activeAudio||null,void function(){if(lt&&(Hn.textTracks.length||Hn.audioTracks.length)){var e=lt,n=e.caption,t=e.audio;lt=null,Xn(n),Qn(t)}}();if("LOG_STATUS"===n.type&&xn("[Cast] <- LOG_STATUS",n.type,n),"EVENT"===n.type)switch(xn("[Cast] <-",n.event,n),n.event){case"CaptionChanged":Hn.activeCaption=n.activeCaption||null,it(e,Hn.activeCaption);break;case"AudioChanged":Hn.activeAudio=n.activeAudio||null,function(e,n){var t=n&&Un(nt(e),n);t&&!t.enabled&&(t.enabled=!0)}(e,Hn.activeAudio);break;case"TracksChanged":Hn.textTracks=[],Hn.audioTracks=[];break;case"TrackUnresolved":jn("[Cast] receiver could not resolve track",n.kind,n.requested)}}var ut=!1;function st(e){!function(e){var n,t,r,i,o,l,a=null===(n=window)||void 0===n||null===(t=n.cast)||void 0===t?void 0:t.framework,u=null==a||null===(r=a.CastContext)||void 0===r||null===(i=r.getInstance)||void 0===i?void 0:i.call(r);if(u){var s=function(n){n&&!n.__vlCastListening&&(n.__vlCastListening=!0,n.addMessageListener(Tn,(function(n,t){try{var r="string"==typeof t?JSON.parse(t):t;"receiver"===(null==r?void 0:r.source)&&at(e,r)}catch(e){jn("[Cast] could not handle receiver message",(null==e?void 0:e.message)||e,t)}})))};s(null===(o=u.getCurrentSession)||void 0===o?void 0:o.call(u)),!ut&&null!=a&&null!==(l=a.CastContextEventType)&&void 0!==l&&l.SESSION_STATE_CHANGED&&(ut=!0,u.addEventListener(a.CastContextEventType.SESSION_STATE_CHANGED,(function(){var e;return s(null===(e=u.getCurrentSession)||void 0===e?void 0:e.call(u))})))}}(e),e.addClass("vl-casting");var n=tt(e);n&&(ot=Nn(n));var t=function(){return it(e,ot)};e.one("loadeddata",(function(){return setTimeout(t,0)})),setTimeout(t,1500),function(e){var n=Nn(tt(e))||ot,t=Vn(rt(e));xn("[Cast] syncing selected tracks",lt={caption:n,audio:t}),Gn("setCaption",{track:Fn(Hn.textTracks,n)}),t&&Gn("setAudio",{track:Fn(Hn.audioTracks,t)})}(e)}function ct(e){var n;if(e&&!e.__vlCastSyncBound){e.__vlCastSyncBound=!0,e.on("chromecastConnected",(function(){return st(e)})),e.on("chromecastDisconnected",(function(){e.removeClass("vl-casting"),Hn.textTracks=[],Hn.audioTracks=[],Hn.activeCaption=null,Hn.activeAudio=null,lt=null}));var t=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:150,t=null;return function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];clearTimeout(t),t=setTimeout((function(){return e.apply(void 0,i)}),n)}}((function(){return Jn(e.volume(),e.muted())}));e.on("play",(function(){return Wn()})),e.on("pause",(function(){return Kn()})),e.on("seeked",(function(){return Yn(e.currentTime())})),e.on("volumechange",t),e.on("ratechange",(function(){return $n(e.playbackRate())})),e.on("texttrackchange",(function(){var n=Nn(tt(e));n&&(ot=n),Xn(n)}));var r="function"==typeof e.audioTracks?e.audioTracks():null;null==r||null===(n=r.addEventListener)||void 0===n||n.call(r,"change",(function(){return Qn(Vn(rt(e)))}))}}function dt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function vt(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?dt(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):dt(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}function ft(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 pt(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)?pt(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,o=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw o}}}}function pt(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var mt={debug:5,info:4,warn:3,error:2,fatal:1,none:0,off:0,DEBUG:5,INFO:4,WARN:3,ERROR:2,FATAL:1,NONE:0,OFF:0},gt=function(e){var n;if(e){var t=function(){var n,t="function"==typeof e.currentWidth&&e.currentWidth()||(null===(n=e.el())||void 0===n?void 0:n.clientWidth)||0;e.toggleClass("vlp-hide-pip",t<=500&&function(){var n,t=null===(n=e.textTracks)||void 0===n?void 0:n.call(e);if(!t)return!1;for(var r=0;r<t.length;r++){var i,o=null===(i=t[r])||void 0===i?void 0:i.kind;if("captions"===o||"subtitles"===o)return!0}return!1}())};t(),e.on("playerresize",t),e.on("fullscreenchange",t);var r=null===(n=e.textTracks)||void 0===n?void 0:n.call(e);null!=r&&r.addEventListener&&(r.addEventListener("addtrack",t),r.addEventListener("removetrack",t),e.on("dispose",(function(){r.removeEventListener("addtrack",t),r.removeEventListener("removetrack",t)})))}};function ht(e,n,t){var r=b.playerConfigManager.getConfig()||{};c.emitApiErrorEvent(e,{status:t,message:"DRM ".concat(n," request failed")},"playback",{requestKind:n,videoId:null==r?void 0:r.videoId})}function yt(e){try{if(null!=e&&e.__vlLicenseUrl)return e.__vlLicenseUrl;var n=null==e?void 0:e.keySystems;if(n)for(var t=0,r=Object.keys(n);t<r.length;t++){var i=n[r[t]];if("string"==typeof i)return i;if(null!=i&&i.url)return i.url;if(null!=i&&i.licenseUri)return i.licenseUri}var o=null==e?void 0:e.keySystemOptions;if(Array.isArray(o)){var l,a=ft(o);try{for(a.s();!(l=a.n()).done;){var u,s,c,d=l.value,v=(null==d||null===(u=d.options)||void 0===u?void 0:u.serverURL)||(null==d||null===(s=d.options)||void 0===s?void 0:s.licenseUri)||(null==d||null===(c=d.options)||void 0===c?void 0:c.url);if(v)return v}}catch(e){a.e(e)}finally{a.f()}}}catch(e){}return""}function bt(e){if(null!=e&&e.__vlDrmLicenseUrl)return e.__vlDrmLicenseUrl;try{return yt("function"==typeof e.currentSource?e.currentSource():null)}catch(e){return""}}function wt(e,n){n&&!n.__vlDrmDashHooksInstalled&&(n.__vlDrmDashHooksInstalled=!0,"function"==typeof n.addResponseInterceptor&&n.addResponseInterceptor((function(e){try{var n=(null==e?void 0:e.request)||{},t=(null==e?void 0:e.url)||(null==n?void 0:n.url)||"",r=c.classifyRequestKind(t,(null==n?void 0:n.type)||(null==e?void 0:e.type));if(c.isDrmRequestKind(r)){var i=c.extractStatusCode(e,null);c.isHttpOk(i)||ht(t,r,i)}}catch(e){}return Promise.resolve(e)})),"function"==typeof n.registerLicenseRequestFilter&&n.registerLicenseRequestFilter((function(e){try{null!=e&&e.url&&(n.__vlLastLicenseUrl=e.url)}catch(e){}return Promise.resolve()})),"function"==typeof n.on&&n.on("public_licenseRequestComplete",(function(t){try{var r,i,o,l;if(null==t||!t.error)return;var a=null!==(r=null==t||null===(i=t.error)||void 0===i||null===(o=i.data)||void 0===o?void 0:o.responseCode)&&void 0!==r?r:c.extractStatusCode(null,t.error);ht((null==t||null===(l=t.data)||void 0===l?void 0:l.url)||n.__vlLastLicenseUrl||bt(e)||"","license",a)}catch(e){}})))}var kt=!1,St=null,Ct=new Set;function Et(e){if(e&&!e.__vlDrmDashRegistered){e.__vlDrmDashRegistered=!0,Ct.add(e),e.__vlDrmDashEnabled=!0;var n=function(){e.__vlDrmDashRegistered&&(e.__vlDrmDashRegistered=!1,e.__vlDrmDashEnabled=!1,Ct.delete(e),function(){if(kt&&!(Ct.size>0)){var e=null==r?void 0:r.Html5DashJS;e&&"function"==typeof e.removeHook&&"function"==typeof St&&e.removeHook("beforeinitialize",St),kt=!1,St=null}}())};"function"==typeof e.one?e.one("dispose",n):"function"==typeof e.on&&e.on("dispose",n)}}function Tt(e){if(e){Et(e),function(){if(!kt){var e=null==r?void 0:r.Html5DashJS;e&&"function"==typeof e.hook&&(St=function(e,n){null!=e&&e.__vlDrmDashEnabled&&wt(e,n)},kt=!0,e.hook("beforeinitialize",St))}}(),function(e){e&&!e.__vlEmeDrmErrorInstalled&&(e.__vlEmeDrmErrorInstalled=!0,e.on("error",(function(){try{var n,t="function"==typeof e.error?e.error():null;if(!t||!c.isDrmError(t))return;if(null!=e&&null!==(n=e.dash)&&void 0!==n&&n.mediaPlayer)return;ht(bt(e),"license",null)}catch(e){}})))}(e);var n=function(){var n;!function(e){var n,t,r=null==e||null===(n=e.tech_)||void 0===n||null===(t=n.vhs)||void 0===t?void 0:t.xhr;r&&"function"==typeof r.onResponse&&!e.__vlDrmVhsHooksInstalled&&(e.__vlDrmVhsHooksInstalled=!0,r.onResponse((function(e,n,t){try{var r=function(e){return(null==e?void 0:e.uri)||(null==e?void 0:e.url)||(null==e?void 0:e.src)||""}(e),i=c.classifyRequestKind(r,null==e?void 0:e.type);if(!c.isDrmRequestKind(i))return;var o=c.extractStatusCode(t,n);c.isHttpOk(o)&&!n||ht(r,i,o)}catch(e){}})))}(e),wt(e,null==e||null===(n=e.dash)||void 0===n?void 0:n.mediaPlayer)};n(),e.on("xhr-hooks-ready",n),e.on("loadstart",(function(){setTimeout(n,0)}))}}var Dt=function(i,o,l,a){var u,s,d,f,p,h,b,w,k,S,C,E,T,D,O,P,x,j,I,_,A,L,R,B,M,N,V,U,q,H,F,z,G,W,K,Y,$,J,X=o.res,Q=void 0===X?null:X,Z=o.sres,ee=void 0===Z?null:Z,te=function(){try{var e,n,t=new URLSearchParams((null===(e=window)||void 0===e||null===(n=e.location)||void 0===n?void 0:n.search)||""),r=t.get("loglevel")||null;return{playerDebug:"true"===t.get("playerdebug"),logLevel:r,dashLogLevel:null!=r&&null!=mt[r]?mt[r]:5}}catch(e){return{playerDebug:!1,logLevel:null,dashLogLevel:5}}}(),re=te.playerDebug,ie=te.logLevel,oe=te.dashLogLevel;re&&(console.log("[PLAYER DEBUG] config:",l),console.log("[PLAYER DEBUG] entitlement (res):",Q),ee&&console.log("[PLAYER DEBUG] series response (sres):",ee));var le=null!=l&&l.chromecastReceiverId?["chromecast","html5"]:["html5"],ae=(null===(u=Q)||void 0===u?void 0:u.contentType)||"video",ue=m.impolicy16x9(null===(s=Q)||void 0===s||null===(d=s[ae])||void 0===d||null===(f=d.gist)||void 0===f?void 0:f.videoImageUrl)||m.impolicy16x9(null===(p=Q)||void 0===p||null===(h=p[ae])||void 0===h||null===(b=h.gist)||void 0===b||null===(w=b.imageGist)||void 0===w?void 0:w.r16x9),se=(null===(k=Q)||void 0===k||null===(S=k[ae])||void 0===S||null===(C=S.liveDetails)||void 0===C?void 0:C.isDvrEnabled)||!1,ce=!(null===(E=Q)||void 0===E||null===(T=E[ae])||void 0===T||null===(D=T.streamingInfo)||void 0===D||!D.isLiveStream)||"linearchannel"===ae,de=(null===(O=Q)||void 0===O||null===(P=O.ads)||void 0===P||null===(x=P.preRoll)||void 0===x||null===(j=x.adTags)||void 0===j||null===(I=j.web)||void 0===I?void 0:I.active)&&(null===(_=Q)||void 0===_||null===(A=_.ads)||void 0===A||null===(L=A.preRoll)||void 0===L||null===(R=L.adTags)||void 0===R||null===(B=R.web)||void 0===B?void 0:B.url);Q=vt(vt({},Q),{},{audioAssetSource:null==l?void 0:l.audioAssetSource});var ve=(null==l||null===(M=l.customData)||void 0===M?void 0:M.ads)||{},pe=(null===(N=Q)||void 0===N||null===(V=N[ae])||void 0===V?void 0:V.isSSAIEnabled)&&"MEDIA_TAILOR"==(null==ve?void 0:ve.vodAdSticherProvider)||!1,me=!(null===(U=Q)||void 0===U||null===(q=U[ae])||void 0===q||!q.isSSAIEnabled)&&"TRANSMIT"==(null==ve?void 0:ve.liveAdSticherProvider)&&!(null==ve||!ve.liveAdClientSideTracking),ge=(null==l?void 0:l.latency)||6,he=(null==l?void 0:l.skin_settings)||{},ye=($={enableSmoothSeeking:!0,controls:0!=(null==l?void 0:l.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==l?void 0:l.muted)||!1,autoplay:(null==l?void 0:l.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==he?void 0:he.pictureInPictureToggle)||!1},playbackRates:null!=he&&he.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==l.skin,liveui:se},e($,"autoplay",null==l?void 0:l.autoplay),e($,"normalizeAutoplay",(null==l?void 0:l.autoplay)&&!de),e($,"loop",(null==l?void 0:l.loop)||!1),e($,"audioPosterMode",null==l?void 0:l.audioPosterMode),e($,"html5",vt(vt({dash:vt(vt({},!r.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:vt(vt({},((null==l?void 0:l.debugConfig)&&(null==l||null===(H=l.debugConfig)||void 0===H?void 0:H.enable)||re)&&{debug:{logLevel:oe}}),{},{streaming:{parseInbandPrft:!0,delay:{liveDelay:ge},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:vt({},"IE"==g.detectBrowser()&&{enableStallFix:!0,stallSeek:1}),abr:vt(vt(vt(vt({},(null==l?void 0:l.initialBandwidth)&&{initialBitrate:{audio:-1,video:(null==l?void 0:l.initialBandwidth)/1e3}}),(null==l?void 0:l.maxBitrate)&&{maxBitrate:{audio:-1,video:(null==l?void 0:l.maxBitrate)/1e3}}),(null==l?void 0:l.minBitrate)&&{minBitrate:{audio:-1,video:(null==l?void 0:l.minBitrate)/1e3}}),{},{rules:{throughputRule:{active:!0},bolaRule:{active:!1},insufficientBufferRule:{active:!1},switchHistoryRule:{active:!1},droppedFramesRule:{active:!1},abandonRequestsRule:{active:!1}},autoSwitchBitrate:{video:!0,audio:!0}})}})}),vhs:vt(vt(vt({},(null==l?void 0:l.initialBandwidth)&&{bandwidth:l.initialBandwidth}),{},{liveRangeSafeTimeDelta:ge,useDevicePixelRatio:!0,experimentalLLHLS:(null==l?void 0:l.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:null==l||!l.initialBandwidth},(null==l||null===(F=l.customData)||void 0===F?void 0:F.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null!==(z=null==l?void 0:l.enableLowInitialPlaylist)&&void 0!==z&&z},((null==l?void 0:l.debugConfig)&&(null==l||null===(G=l.debugConfig)||void 0===G?void 0:G.enable)||re)&&{debug:!0}),debug:(null==l?void 0:l.debugConfig)&&(null==l||null===(W=l.debugConfig)||void 0===W?void 0:W.enable)||re||!1,nativeTextTracks:"Safari"==g.detectBrowser()},0==(null==l||null===(K=l.customData)||void 0===K?void 0:K.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==l||null===(Y=l.customData)||void 0===Y?void 0:Y.nativeVideoTracks)&&{nativeVideoTracks:!1})),e($,"poster",ue),e($,"techOrder",le),e($,"chromecast",{requestCustomDataFn:function(e){var n,t,r=m.getPlayer(i),o=((null==r?void 0:r.textTracksJson_)||r.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind})),a=function(e,n,t){var r,i,o,l,a,u,s,c,d,v,f=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){var m,g,h,b,w,k,S,C;p.isDrmEnabled=!0;var E=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,T=(null==E?void 0:E.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(h=g[0])||void 0===h||null===(b=h.options)||void 0===b?void 0:b.serverURL);p.licenseUrl=T;var D=(null==E?void 0:E.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(w=n.keySystemOptions)||void 0===w||null===(k=w[0])||void 0===k||null===(S=k.options)||void 0===S||null===(C=S.httpRequestHeaders)||void 0===C?void 0:C["X-AxDRM-Message"]);p.licenseToken=D}var O=(null==e||null===(r=e[f])||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.contentType)||"VIDEO";p.contentType=O;var P=null==e||null===(o=e[f])||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.runtime;p.duration=P;var x=null==e||null===(a=e[f])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;p.mediaTitle=x;var j,I,_=null==e||null===(s=e[f])||void 0===s||null===(c=s.gist)||void 0===c?void 0:c.videoImageUrl;return p.mediaImage=_,p.subTitles=t,p.DVR=(null==e||null===(d=e[f])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,void 0!==("undefined"==typeof window?"undefined":y(window))&&(p.siteId=(null===(j=window)||void 0===j?void 0:j.siteId)||null,p.userId=(null===(I=window)||void 0===I?void 0:I.sessionStorage)&&window.sessionStorage.getItem("uid")||null),console.log(p),p}(Q,e,o),u=o.find((function(e){return"showing"===e.mode}))||null;return ot=Nn(u),vt(vt({},a),{},{activeCaption:{enabled:!!u,language:(null==u?void 0:u.language)||(null==u?void 0:u.lang)||null,label:(null==u?void 0:u.label)||null},transmitTrackingUrl:c.trackingUrlManager.get()||null,convivaMetaData:vt({customerKey:(null==l||null===(n=l.convivaConfig)||void 0===n?void 0:n.customerKey)||null,debug:(null==l||null===(t=l.convivaConfig)||void 0===t?void 0:t.debug)||!1},_e.getData())})},modifyLoadRequestFn:function(e){var n,t,r,o,l,a=m.getPlayer(i),u=(null==a?void 0:a.currentSource())||{};!(null===(n=Q)||void 0===n||null===(t=n[ae])||void 0===t||null===(r=t.streamingInfo)||void 0===r||null===(o=r.videoAssets)||void 0===o?void 0:o.is4K)&&1||null!=u&&u.src&&null!=u&&null!==(l=u.src)&&void 0!==l&&l.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),$);if(!r.getPlayers()[i]){(null!=l&&l.debugConfig&&null!=l&&null!==(J=l.debugConfig)&&void 0!==J&&J.enable||re)&&r.log.level(ie||"debug");var be=r(i,ye,function(){var e=n(t.mark((function e(){var n,o,u,s,d,f,p,m,g,h,y,b,w,k,S,C,E,T,D,O,P,x,j,I,_,A;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Tt(be),gt(be),console.log(be),console.log(r.VERSION),console.log(r.getPlugins()),e.next=7,fe(l,Q);case 7:if(null!=l&&l.debugConfig&&null!=l&&null!==(n=l.debugConfig)&&void 0!==n&&n.enable||re){try{r.log.level(ie||"debug")}catch(e){}(C=function(){try{var e,n,t;null==be||null===(e=be.dash)||void 0===e||null===(n=e.mediaPlayer)||void 0===n||null===(t=n.updateSettings)||void 0===t||t.call(n,{debug:{logLevel:oe}})}catch(e){}})(),be.one("loadedmetadata",C)}if(E=null===(o=Q)||void 0===o||null===(u=o[ae])||void 0===u||null===(s=u.liveDetails)||void 0===s?void 0:s.startOverTime,null!=l&&l.disableControls||dn(i,{liveVideo:ce,isDvrEnabled:se,res:Q}),ce&&a.resolve(vt({status:!0,msg:"Player Initialised"},ee?{seriesResponse:ee,response:Q}:{response:Q})),c.inititateBeacon(i,{content:Q,analyticsCb:null==l?void 0:l.analyticsCb,analyticsEventParams:null==l?void 0:l.analyticsEventParams,userId:null==l?void 0:l.userId}),Ie(i,l),ct(be),/Android/i.test(navigator.userAgent)&&(r.options.vhs.overrideNative=!0),se&&ne(i,E),!de||null!=l&&null!==(d=l.customData)&&void 0!==d&&d.disableAds||c.initialiseAdvertisement(i,de,Q),null!=l&&l.disableControls||c.initDvrStartOver(i,{config:l,content:Q,liveVideo:ce,isDvrEnabled:se}),T=c.getSource(Q,i),console.log(T),re&&(console.log("[PLAYER DEBUG] source:",T),console.log("[PLAYER DEBUG] videojs options:",ye)),null!=l&&l.nearestClusterUrl&&(T=c.getUpdatedClusterSource(T,l.nearestClusterUrl)),!pe){e.next=28;break}return e.next=25,c.getSGAIEnabledSource(i,Q);case 25:T=e.sent,e.next=32;break;case 28:if(!me){e.next=32;break}return e.next=31,c.getTransmitEnabledSource(T,Q,i);case 31:T=e.sent;case 32:be&&(be.__vlDrmLicenseUrl=yt(T)),T?c.loadVideo(i,T):(a.reject({status:!1,msg:"Incompatible / Missing Source",response:Q}),c.handleError(i,"Incompatible / Missing Source")),D=null===(f=Q)||void 0===f||null===(p=f[ae])||void 0===p||null===(m=p.gist)||void 0===m?void 0:m.scheduleStartDate,ce&&se&&(D||E)&&Sn(be,{scheduleStartDate:D,startOverTime:E}),((null===(g=Q)||void 0===g||null===(h=g[ae])||void 0===h||null===(y=h.contentDetails)||void 0===y||null===(b=y.closedCaptions)||void 0===b?void 0:b.length)>0||(null===(w=Q)||void 0===w||null===(k=w[ae])||void 0===k||null===(S=k.closedCaptions)||void 0===S?void 0:S.length)>0)&&(A=(null===(P=Q)||void 0===P||null===(x=P[ae])||void 0===x||null===(j=x.contentDetails)||void 0===j?void 0:j.closedCaptions)||(null===(I=Q)||void 0===I||null===(_=I[ae])||void 0===_?void 0:_.closedCaptions),O=A.filter((function(e){return"VTT"===e.format})),v.addCaptions(i,O)),null!=l&&l.disableControls?c.disableControls(i):Ae(i,vt(vt(vt({},l),ye),{},{liveVideo:ce,isDvrEnabled:se,res:Q,sres:ee})),wn(i,vt(vt(vt({},l),ye),{},{liveVideo:ce}),a,{res:Q,sres:ee});case 39:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())}};function Ot(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function Pt(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ot(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Ot(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}var xt=function(e,n){var t=n.resolve,r=n.reject,i=null==e?void 0:e.playerId,o=jt(e);Dt(i,{res:o},e,{resolve:t,reject:r})},jt=function(e){var n,t,r,i,o,l,a,u,s,d,v,f,p,m,g,h=null==e?void 0:e.streamingInfo,y=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,b=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,w=(null==e||null===(r=e.streamingInfo)||void 0===r||null===(i=r.ads)||void 0===i?void 0:i.url)||null,S=(null==e||null===(o=e.streamingInfo)||void 0===o?void 0:o.posterUrl)||null,C=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.subtitles)||[],E=(null==e||null===(a=e.streamingInfo)||void 0===a||null===(u=a.videoAssets)||void 0===u?void 0:u.drmProvider)||null,T=(null==e||null===(s=e.streamingInfo)||void 0===s?void 0:s.macroMap)||[],D=(null==e||null===(d=e.customData)||void 0===d||null===(v=d.ads)||void 0===v?void 0:v.isSSAIEnabled)||!1,O=(null==e||null===(f=e.streamingInfo)||void 0===f?void 0:f.scheduleStartDate)||null,P=(null==e||null===(p=e.streamingInfo)||void 0===p?void 0:p.startOverTime)||null,x=null==e?void 0:e.token,j=c.getDecodedToken(x);null==j||j.site;var I=null==j?void 0:j.siteId,_=(null==e||null===(m=e.customData)||void 0===m||null===(g=m.comscore)||void 0===g?void 0:g.video)||null,A=Pt(Pt({id:I?"".concat(I,"_external"):"external"},!b&&{directPlaybackUrl:null==y?void 0:y.url}),{},{video:Pt(Pt(Pt(Pt(Pt({drmEnabled:b,streamingInfo:Pt(Pt({videoAssets:Pt(Pt({},E&&{drmProvider:E}),{},{widevine:null==y?void 0:y.widevine,fairPlay:null==y?void 0:y.fairPlay,playReady:null==y?void 0:y.playReady})},(null==h?void 0:h.isDvrEnabled)&&{isLiveStream:!0}),(null==_?void 0:_.isLiveStream)&&{isLiveStream:null==_?void 0:_.isLiveStream})},D&&{isSSAIEnabled:D}),{},{metadata:T,liveDetails:Pt({isDvrEnabled:null==h?void 0:h.isDvrEnabled},P&&{startOverTime:P}),gist:Pt(Pt(Pt(Pt({},S&&{videoImageUrl:S}),O&&{scheduleStartDate:O}),(null==_?void 0:_.videoId)&&{id:null==_?void 0:_.videoId}),(null==_?void 0:_.videoTitle)&&{title:null==_?void 0:_.videoTitle}),contentDetails:Pt({},(null==C?void 0:C.length)>0&&{closedCaptions:k(C)})},(null==_?void 0:_.runtime)&&{runtime:null==_?void 0:_.runtime}),(null==_?void 0:_.publishDate)&&{publishDate:null==_?void 0:_.publishDate}),(null==_?void 0:_.platform)&&{platform:null==_?void 0:_.platform}),(null==_?void 0:_.series)&&{series:null==_?void 0:_.series}),ads:{preRoll:{adTags:{web:Pt(Pt({},w&&{active:!0}),w&&{url:w})}}}});return _&&(null!=_&&_.isDvrEnabled&&(A.video.liveDetails=Pt(Pt({},A.video.liveDetails),{},{isDvrEnabled:null==_?void 0:_.isDvrEnabled})),null!=_&&_.metadata&&(A.video.metadata=[].concat(k(A.video.metadata),k(null==_?void 0:_.metadata)))),A},It=function(){try{var e,n,t=new URLSearchParams((null===(e=window)||void 0===e||null===(n=e.location)||void 0===n?void 0:n.search)||"");return t.has("ssaiDisable")?t.get("ssaiDisable"):null}catch(e){return null}};function _t(e,n){return At.apply(this,arguments)}function At(){return(At=n(t.mark((function e(n,r){var i,o,l,a,u,s,v,f,p,m;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=r.resolve,a=r.reject,u=null==n?void 0:n.videoId,s=null==n?void 0:n.playerId,v=!(null==n||!n.anonymousId),e.next=6,c.getToken();case 6:f=e.sent,p=!1===(null==n||null===(i=n.customData)||void 0===i||null===(o=i.ads)||void 0===o?void 0:o.isSSAIEnabled),null!==(m=It())&&(p="true"===m),c.getVideoDetails(u,f,p).then((function(e){var t,r,i,o,p,m,g,h,y,b,w;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(r=t.video)||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.contentType,c.setCurrentVideo(null==e?void 0:e.data);var k=null==e||null===(o=e.data)||void 0===o||null===(p=o.video)||void 0===p||null===(m=p.gist)||void 0===m?void 0:m.scheduleEndDate,S=null==e||null===(g=e.data)||void 0===g||null===(h=g.video)||void 0===h||null===(y=h.gist)||void 0===y?void 0:y.scheduleStartDate;d.handlePlayerMessage(s,{scheduleEndDate:k,scheduleStartDate:S});var C=null==e?void 0:e.data;if(null!=n&&null!==(b=n.watchHistory)&&void 0!==b&&b.isExternal)C.contentType="video",Dt(s,{res:C},n,{resolve:l,reject:a});else if(null!=n&&n.watchHistory&&null!=n&&null!==(w=n.watchHistory)&&void 0!==w&&w.enable&&!v){var E;if((null===(E=n.watchHistory)||void 0===E?void 0:E.saveOffline)||!1){var T,D,O,P=(null===(T=n.watchHistory)||void 0===T?void 0:T.profileId)||"",x=c.getWatchHistoryByIdFromStorage(P,u,null==n?void 0:n.siteOwner);if(x&&x.length)n.watchHistoryResumeTime=(null===(D=x[0])||void 0===D?void 0:D.watchedTime)||null,n.watchedPercentage=(null===(O=x[0])||void 0===O?void 0:O.watchedPercentage)||null;C.contentType="video",Dt(s,{res:C},n,{resolve:l,reject:a})}else c.getVideoInfo(u,f).then((function(e){var t,r,i,o,l,a;null!==(t=window)&&void 0!==t&&null!==(r=t.watchHistory)&&void 0!==r&&r.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,C.contentType="video"})).catch((function(){})).finally((function(){Dt(s,{res:C},n,{resolve:l,reject:a})}))}else Dt(s,{res:C},n,{resolve:l,reject:a})})).catch((function(e){var t,r,i=(null==n||null===(t=n.event)||void 0===t?void 0:t.showScheduleTimer)||!1,o=(null==n||null===(r=n.event)||void 0===r?void 0:r.onCountdownComplete)||null;i&&d.handleCountdownTimer(s,e,o),c.initiateErrorHandling(e,s,a,u)}));case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Lt(e,n){return Rt.apply(this,arguments)}function Rt(){return(Rt=n(t.mark((function e(n,r){var i,o,l,a,u,s,d,v;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=r.resolve,a=r.reject,e.next=3,c.getToken();case 3:u=e.sent,s=null==n?void 0:n.playerId,d=null==n?void 0:n.epg,v=!1===(null==n||null===(i=n.customData)||void 0===i||null===(o=i.ads)||void 0===o?void 0:o.isSSAIEnabled),c.getLinearChannelDetails(d,u,v).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==d?void 0:d.channelId,c.setCurrentVideo(t),Dt(s,{res:t},n,{resolve:l,reject:a})})).catch((function(e){c.initiateErrorHandling(e,s,a,videoId)}));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Bt(e,n){return Mt.apply(this,arguments)}function Mt(){return(Mt=n(t.mark((function e(n,r){var i,o,l,a,u,s,d;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.resolve,l=r.reject,e.next=3,c.getToken();case 3:a=e.sent,u=null==n?void 0:n.playerId,s=sessionStorage.getItem("season-idx")||0,c.seasonIdxManager.set(parseInt(s)),d=null==n||null===(i=n.series)||void 0===i?void 0:i.id,c.getSeriesDetails(d,a).then((function(e){var t,r,i,s=e.data,v=e.data.seasons;c.setCurrentSeries(v);var f=videoId||(null==v||null===(t=v[0])||void 0===t||null===(r=t.episodes)||void 0===r||null===(i=r[0])||void 0===i?void 0:i.id);c.createSeriesWatchMap(d,a),c.getVideoDetails(f,a).then((function(e){var t,r,i;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(r=t.video)||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.contentType,c.setCurrentVideo(e.data),Dt(u,{res:null==e?void 0:e.data,sres:s},n,{resolve:o,reject:l})})).catch((function(e){c.initiateErrorHandling(e,u,l,videoId)}))})).catch((function(e){c.initiateErrorHandling(e,u,l)}));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Nt,Vt=function(e){var n=e.site,t=e.sseBaseUrl,r=e.sseEndpoint,i=e.debug,o=void 0!==i&&i;return C.createSSETransport({site:n,sseBaseUrl:t,getToken:c.getToken,sseEndpoint:r,onOpen:function(e){var n=e.userId,t=e.endpoint;o&&console.log("SSE Connected:",n,t)},onMessage:function(e){var n,t,r,i,l,a,u,s,v,f;if(o&&console.log("SSE Message:",e),(null===(n=c.getCurrentVideo())||void 0===n||null===(t=n.video)||void 0===t||null===(r=t.gist)||void 0===r?void 0:r.id)===(null==e||null===(i=e.payload)||void 0===i?void 0:i.id)&&"GAME_STATE_CHANGE"===(null==e?void 0:e.notificationType)){var p=1e3*(null==e||null===(l=e.payload)||void 0===l||null===(a=l.states)||void 0===a||null===(u=a.live)||void 0===u?void 0:u.startDateTime),m=1e3*(null==e||null===(s=e.payload)||void 0===s||null===(v=s.states)||void 0===v||null===(f=v.end)||void 0===f?void 0:f.endDateTime);p&&m&&(console.log("Setting schedule timer",p,m),d.scheduleTimerInstanceManager.set({startDateTime:p,endDateTime:m}))}},onReconnectAttempt:function(e){o&&console.log("Reconnect attempt:",e)},onHeartbeatTimeout:function(e){var n=e.elapsed;o&&console.warn("Heartbeat timeout after:",n)},onTokenInvalid:function(e){o&&console.error("Invalid token:",e),window.location.href="/login"},onError:function(e,n){o&&console.error("SSE Error:",e,n)},onClose:function(){o&&console.log("SSE Closed")}})},Ut=function(e){var n=e.enable,t=e.site,r=e.sseBaseUrl,i=e.sseEndpoint,o=e.debug;if(n){var l=Vt({site:t,sseBaseUrl:r,sseEndpoint:i,debug:void 0!==o&&o});return l._sseBaseUrl=r,l._site=t,l._sseEndpoint=i,l}};function qt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function Ht(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qt(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):qt(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}module.exports=function(){return{loadVideoInstantly:c.loadVideoInstantly,onTimeUpdate:d.onTimeUpdate,getVideoDuration:d.getVideoDuration,onVideoEnded:d.onVideoEnded,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var r=n(t.mark((function n(r,i){var o,l,a,u,s,d,v,f,p,g,y,w,k,S,C,T,D,O,P,x,j,I,_,A,L,R,B,M,N,V,U,q;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!c.isPlayerInitialised(null==e?void 0:e.playerId)){n.next=3;break}return r({status:!0,msg:"Player already initialised",skipped:!0}),n.abrupt("return");case 3:if(P=(null==e?void 0:e.videoSourceUrl)||!1,x=null==e?void 0:e.asat,j=(null==e||null===(o=e.epg)||void 0===o?void 0:o.enable)||!1,I=null==e?void 0:e.videoId,_=(null==e||null===(l=e.series)||void 0===l?void 0:l.enable)||!1,A=(null==e?void 0:e.streamingInfo)||!1,window.videoId=I,L=null==e?void 0:e.token,!c.token_authentication_enabled(e)){n.next=18;break}if(sessionStorage.setItem("vlp_token",L),c.refreshTokenManager().set(null==e?void 0:e.refreshToken),L&&!c.isTokenExpired(L)){n.next=17;break}return i({status:!1,msg:"".concat(L?"Token is expired !":"Missing Authorization Token"),response:{token:L}}),n.abrupt("return");case 17:Nt=JSON.parse(atob(L.split(".")[1]));case 18:return window.siteName=null===(a=Nt)||void 0===a?void 0:a.site,window.siteId=null===(u=Nt)||void 0===u?void 0:u.siteId,e.isAnonymousUser=!(null===(s=Nt)||void 0===s||!s.anonymousId),e.siteOwner=(null===(d=Nt)||void 0===d?void 0:d.site)||null,e.userId=(null===(v=Nt)||void 0===v?void 0:v.userId)||null,c.setUserId((null===(f=Nt)||void 0===f?void 0:f.userId)||(null===(p=Nt)||void 0===p?void 0:p.anonymousId)||null),window.watchHistory=e.watchHistory||null,R=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(g=e.series)&&void 0!==g&&g.enable?null:null==e?void 0:e.chromecastReceiverId,B=(null==e||null===(y=e.analytics)||void 0===y?void 0:y.gaId)||null,(M=null==e?void 0:e.errors)&&(window.customErrors=M),window.customData=null==e?void 0:e.customData,h.setLocalisation(null==e||null===(w=e.customData)||void 0===w?void 0:w.localisation),c.baseUrlManager.set(e.apiBaseUrl),null!=e&&e.skin&&!m.isNotAValidSkin(e.skin)||(e.skin="VL_ONE"),b.playerConfigManager.setConfig(e),E.relatedVideosManager.reset(),E.relatedVideosManager.set(null==e?void 0:e.relatedVideos),n.next=39,se(e);case 39:B&&J("https://www.googletagmanager.com/gtag/js?id=".concat(B)).then((function(){return c.runGtag(B)})).catch((function(e){})),(N=null===(k=document)||void 0===k?void 0:k.getElementById("".concat(R)))&&N.addEventListener("contextmenu",(function(e){return e.preventDefault()})),(V=Ut({enable:null==e||null===(S=e.sse)||void 0===S?void 0:S.enable,site:null==e||null===(C=e.sse)||void 0===C?void 0:C.siteName,sseBaseUrl:null==e||null===(T=e.sse)||void 0===T?void 0:T.sseBaseUrl,sseEndpoint:null==e||null===(D=e.sse)||void 0===D?void 0:D.sseEndpoint,debug:null==e||null===(O=e.sse)||void 0===O?void 0:O.debug}))&&!V.isConnectionActive()&&V.connect(),P?(q={directPlaybackUrl:P,id:U="c09576ca-8202-4e8e-ba1e-06d1ab0ce063",video:{liveDetails:{isDvrEnabled:!(null==e||!e.isDvr)}}},x?c.getVideoDetails(U,L).then((function(n){var t,o=(null==n?void 0:n.data)||{},l=Ht(Ht(Ht({},o),q),{},{video:Ht(Ht({},null==o?void 0:o.video),{},{liveDetails:Ht(Ht({},null==o||null===(t=o.video)||void 0===t?void 0:t.liveDetails),{},{isDvrEnabled:!(null==e||!e.isDvr)})})});Dt(R,{res:l},e,{resolve:r,reject:i})})).catch((function(e){c.initiateErrorHandling(e,R,i,U)})):Dt(R,{res:Ht(Ht({},q),{},{video:{liveDetails:{isDvrEnabled:!(null==e||!e.isDvr)}}})},e,{resolve:r,reject:i})):A?xt(e,{resolve:r,reject:i}):_?Bt(e,{resolve:r,reject:i}):j?Lt(e,{resolve:r,reject:i}):_t(e,{resolve:r,reject:i});case 45:case"end":return n.stop()}}),n)})));return function(e,n){return r.apply(this,arguments)}}())},getRenditions:f.getRenditions,skip:c.skip,getPlayer:m.getPlayer,play:c.play,pause:c.pause,detectBrowser:g.detectBrowser,rewind:c.rewind,loadVideo:c.loadVideo,seekToTimeStamp:d.seekToTimeStamp,isPlayerInitialised:c.isPlayerInitialised,load:c.load,authenticateLC:c.authenticateLC,dispose:c.dispose,enableCaptions:v.enableCaptions,disableCaptions:v.disableCaptions,getCaptions:v.getCaptions,playSelectedResolution:p.playSelectedResolution,getSource:c.getSource,setVolume:Q,getVolume:Z,disableControls:c.disableControls,setPlaybackSpeed:d.setPlaybackSpeed,getEntitlementData:c.getEntitlementData,getSsaiEvents:c.getSsaiEvents,getPlayerControlEvents:w.getPlayerControlEvents,playerEvents:d.playerEvents,onReplay:d.onReplay,relatedVideosManager:E.relatedVideosManager,setChapters:ln,getChapters:an,clearChapters:un,seekToChapter:sn,getChapterEvents:Ke,onWatchInVerticalView:d.onWatchInVerticalView,fireBeaconEvent:c.fireBeaconEvent,getDvrManager:c.getDvrManager}};
1
+ "use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/defineProperty"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),r=require("video.js"),i=require("@babel/runtime/helpers/classCallCheck"),o=require("@babel/runtime/helpers/createClass"),l=require("@babel/runtime/helpers/get"),a=require("@babel/runtime/helpers/inherits"),u=require("@babel/runtime/helpers/possibleConstructorReturn"),s=require("@babel/runtime/helpers/getPrototypeOf"),c=require("./generic-0b925a19.js"),d=require("./index-93ac04ff.js"),v=require("./captions-8b889384.js"),f=require("./renditions-05a85e06.js"),p=require("./resolution-ac7705e6.js"),m=require("./skin-55634dc6.js"),g=require("./browser-3670a923.js"),h=require("./localisation-da6f64c6.js"),y=require("@babel/runtime/helpers/typeof"),b=require("./manager-77ddd30c.js"),w=require("./playerControlEvents-db923a5c.js");require("@viewlift/comscore/index.js");var k=require("@babel/runtime/helpers/toConsumableArray"),S=require("@babel/runtime/helpers/toArray"),C=require("@viewlift/sse"),E=require("./relatedVideosManager-44ec6d59.js");function T(e,n,t,r){var i=l(s(1&r?e.prototype:e),n,t);return 2&r&&"function"==typeof i?function(e){return i.apply(t,e)}:i}function D(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(D=function(){return!!e})()}require("axios"),require("md5"),require("js-cookie"),require("@babel/runtime/helpers/slicedToArray"),require("@babel/runtime/helpers/objectWithoutProperties"),require("@babel/runtime/helpers/assertThisInitialized");var O=r.getComponent("TextTrackSettings"),P=r.dom,x=[{value:"0.50",label:"50%"},{value:"0.75",label:"75%"},{value:"1.00",label:"100%"},{value:"1.25",label:"125%"},{value:"1.50",label:"150%"},{value:"1.75",label:"175%"},{value:"2.00",label:"200%"},{value:"3.00",label:"300%"},{value:"4.00",label:"400%"}],j=x.map((function(e){return e.value})),I="1.00",_=".vjs-font-percent > select",A="vlp-caption-font-size-style",L="#FFF",R="1",B="#000",M="1",N="#000",V="0",U="proportionalSansSerif",q="#222",H="#ccc",F={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'},z=function(e,n){var t=parseFloat(e);return isNaN(t)?n:t},G=function(e,n){var t;if(e&&4===e.length)t=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(!e||7!==e.length)return e;t=e.slice(1)}return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+n+")"},W=null;function K(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(K=function(){return!!e})()}O?(W=function(){a(r,O);var e,n,t=(e=r,n=D(),function(){var t,r=s(e);if(n){var i=s(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return u(this,t)});function r(e,n){var o;return i(this,r),(o=t.call(this,e,n)).customReady_=!0,o.customUiReady_=!0,o.triggerEl_=null,o.applyCustomFontSizeUI_(),o}return o(r,[{key:"conditionalFocus_",value:function(){this.triggerEl_=this.getCaptionsTrigger_(),this.previouslyActiveEl_=null,this.focus()}},{key:"conditionalBlur_",value:function(){this.previouslyActiveEl_=null;var e=this.player_;e&&"function"==typeof e.userActive&&e.userActive(!0);var n=this.triggerEl_||this.getCaptionsTrigger_();this.triggerEl_=null;var t=function(){n&&"function"==typeof n.focus&&n.focus()};"undefined"!=typeof window&&"function"==typeof window.setTimeout?window.setTimeout(t,0):t()}},{key:"getCaptionsTrigger_",value:function(){var e=this.player_&&this.player_.controlBar;return e&&(e.subsCapsButton||e.captionsButton||e.subtitlesButton)||null}},{key:"applyCustomFontSizeUI_",value:function(){var e=this;this.replaceFontSizeOptions_(),this.bindCaptionStyleChange_(),this.on(this.player_,["playerresize","fullscreenchange"],(function(){return e.applyDashCaptionStyles_()})),this.applyDashCaptionStyles_()}},{key:"replaceFontSizeOptions_",value:function(){var e=this.$(_);if(e){for(var n=e.value;e.firstChild;)e.removeChild(e.firstChild);x.forEach((function(n){e.appendChild(P.createEl("option",{value:n.value,textContent:n.label}))})),e.value=-1!==j.indexOf(n)?n:I}}},{key:"bindCaptionStyleChange_",value:function(){for(var e=this,n=this.$$("select"),t=0;t<n.length;t++)this.on(n[t],"change",(function(){return e.applyDashCaptionStyles_()}))}},{key:"selectedMultiplier_",value:function(){var e=this.$(_),n=e&&-1!==j.indexOf(e.value)?e.value:I;return parseFloat(n)}},{key:"styleEl_",value:function(){if("undefined"==typeof document)return null;var e=document.getElementById(A);return e||((e=document.createElement("style")).id=A,document.head.appendChild(e)),e}},{key:"applyDashCaptionStyles_",value:function(){if(this.customReady_){var e;try{e="function"==typeof this.getValues&&this.getValues()||{}}catch(e){return}var n=this.styleEl_(),t=this.player_&&this.player_.el();if(n&&t){var r=[];(e.color&&e.color!==L||e.textOpacity&&e.textOpacity!==R)&&r.push("color: "+G(e.color||L,z(e.textOpacity,1))+" !important");var i=function(e){switch(e){case"dropshadow":return"2px 2px 3px ".concat(q,", 2px 2px 4px ").concat(q,", 2px 2px 5px ").concat(q);case"raised":return"1px 1px ".concat(q,", 2px 2px ").concat(q,", 3px 3px ").concat(q);case"depressed":return"1px 1px ".concat(H,", 0 1px ").concat(H,", -1px -1px ").concat(q,", 0 -1px ").concat(q);case"uniform":return"0 0 4px ".concat(q,", 0 0 4px ").concat(q,", 0 0 4px ").concat(q,", 0 0 4px ").concat(q);default:return""}}(e.edgeStyle);i&&r.push("text-shadow: "+i+" !important"),"small-caps"===e.fontFamily?(r.push("font-family: "+F[U]+" !important"),r.push("font-variant: small-caps !important")):e.fontFamily&&e.fontFamily!==U&&F[e.fontFamily]?(r.push("font-family: "+F[e.fontFamily]+" !important"),r.push("font-variant: normal !important")):r.push("font-variant: normal !important");var o=this.selectedMultiplier_(),l="function"==typeof this.player_.currentHeight&&this.player_.currentHeight()||t.offsetHeight||0;if(1!==o&&l){var a=Math.round(.05*l*o*100)/100;r.push("font-size: "+a+"px !important"),r.push("line-height: normal !important")}var u=e.backgroundColor&&e.backgroundColor!==B||e.backgroundOpacity&&e.backgroundOpacity!==M?"background-color: "+G(e.backgroundColor||B,z(e.backgroundOpacity,1))+" !important":"",s=e.windowColor&&e.windowColor!==N||e.windowOpacity&&e.windowOpacity!==V?"background-color: "+G(e.windowColor||N,z(e.windowOpacity,0))+" !important":"",c=[];r.length&&c.push(".vjs-text-track-display-ttml div,.vjs-text-track-display-ttml span,.vjs-text-track-display-ttml p{"+r.join(";")+"}"),s&&c.push(".vjs-text-track-display-ttml p{"+s+"}"),u&&c.push(".vjs-text-track-display-ttml span{"+u+"}"),n.textContent=c.join("")}}}},{key:"setDefaults",value:function(){if(T(r,"setDefaults",this,3)([]),this.applyDashCaptionStyles_(),"function"==typeof Event)for(var e=this.$$("select"),n=0;n<e.length;n++)e[n].dispatchEvent(new Event("change",{bubbles:!0}))}},{key:"handleLanguagechange",value:function(){T(r,"handleLanguagechange",this,3)([]),this.replaceFontSizeOptions_(),this.bindCaptionStyleChange_(),this.applyDashCaptionStyles_()}},{key:"close",value:function(){var e=this.opened_;T(r,"close",this,3)([]),e&&this.focusCaptionsButton_()}},{key:"focusCaptionsButton_",value:function(){var e=this.player_&&this.player_.controlBar;if(e){var n=e.getChild("SubsCapsButton")||e.getChild("CaptionsButton")||e.getChild("SubtitlesButton");n&&"function"==typeof n.focus&&n.focus()}}}]),r}(),r.registerComponent("TextTrackSettings",W)):console.warn("[vlp] CustomTextTrackSettings: video.js TextTrackSettings is not registered; skipping override.");var Y=r.getComponent("SubsCapsButton"),$=null;Y?($=function(){a(r,Y);var e,n,t=(e=r,n=K(),function(){var t,r=s(e);if(n){var i=s(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return u(this,t)});function r(){return i(this,r),t.apply(this,arguments)}return o(r,[{key:"pressButton",value:function(){!function(e,n,t,r){var i=l(s(1&r?e.prototype:e),n,t);return 2&r&&"function"==typeof i?function(e){return i.apply(t,e)}:i}(r,"pressButton",this,3)([]),this.buttonPressed_&&this.focusFirstVisibleItem_()}},{key:"focusFirstVisibleItem_",value:function(){if(this.menu&&this.menu.el_&&this.menu.el_.contains(document.activeElement)){var e=this.menu.children().slice();e.length&&e[0].hasClass("vjs-menu-title")&&e.shift();for(var n=0;n<e.length&&e[n].hasClass("vjs-texttrack-settings");)n++;n>0&&n<e.length&&this.menu.focus(n)}}}]),r}(),r.registerComponent("SubsCapsButton",$)):console.warn("[vlp] CustomSubsCapsButton: video.js SubsCapsButton is not registered; skipping override.");var J=function(e){return new Promise((function(n,t){if(X(e))t("".concat(e," is alread initialised"));else{var r=document.createElement("script");r.async=!0,r.src=e,r.onload=function(){n()},r.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(r)}}))},X=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},Q=function(e,n,t){var r=m.getPlayer(e);if(r)if(n>=0&&n<=100){r.muted()&&r.muted(!1);var i=parseFloat(n)/100;r.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},Z=function(e){var n=m.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},ee=function(){var e=n(t.mark((function e(n){var i,o,l,a,u;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=m.getPlayer(null==n?void 0:n.playerId),null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable||null==n||!n.chromecastReceiverId){e.next=22;break}return e.next=4,Promise.resolve().then((function(){return require("./index-774736bd.js")})).then((function(e){return e.index}));case 4:return a=e.sent,e.prev=5,e.next=8,J("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,a.default(r),e.finish(13);case 16:(u=r.getTech("chromecast"))&&!u.prototype.seeking&&(u.prototype.seeking=function(){}),null!==(l=window)&&void 0!==l&&l.cast?null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=n&&n.chromecastReceiverId&&null!=n&&n.airplay&&"Safari"==g.detectBrowser()?null==o||o.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return e.stop()}}),e,null,[[5,10,13,16]])})));return function(n){return e.apply(this,arguments)}}(),ne=function(e,n){var t=m.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,i,o,l,a,u=this.el(),s=r.dom.getPointerPosition(u,n).x;r.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var c=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=null===(t=window)||void 0===t||null===(i=t.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(l=o.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(c),c&&"CONNECTED"===d){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),f=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=f*s,v.seek()}}))};var te=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),J("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)}}(),re=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("@viewlift/comscore/index.js").then((function(e){c.comscoreInstanceManager.set(e)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ie=function(){var e=n(t.mark((function e(){return t.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){r.getPlugin("eme")||r.registerPlugin("eme",e.default)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),oe=function(){var e=n(t.mark((function e(){var n;return t.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(r),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)}}(),le=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then((function(){return require("./index-de9db53d.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)}}(),ae=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then((function(){return require("./videojs-dash5.es-0f92604f.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)}}(),ue=Object.freeze({__proto__:null,importChromecast:function(){Promise.resolve().then((function(){return require("./index-774736bd.js")})).then((function(e){return e.index})).then((function(e){J("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(r)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){Promise.resolve().then((function(){return require("./index-f3365b73.js")})).then((function(e){return e.index})).then((function(e){e.default(r)}))},loadAdsLibrary:te,loadEMELibrary:ie,loadMuxPlugin:oe,loadDvrSeekbar:le,loadContribDash:ae,loadComscorePlugin:re});function se(e){return ce.apply(this,arguments)}function ce(){return(ce=n(t.mark((function e(n){var r;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(null==n?void 0:n.airplay)||!1,e.next=3,te();case 3:r&&"Safari"==g.detectBrowser()&&Promise.resolve().then((function(){return ue})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function de(e){return ve.apply(this,arguments)}function ve(){return(ve=n(t.mark((function e(n){var r,i,o,l,a,u,s,c,d,v;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v=m.getPlayer(n.playerId),e.next=3,re();case 3:v.comscore({publisherId:null==n||null===(r=n.comscore)||void 0===r?void 0:r.publishedId,endpoint:null==n||null===(i=n.comscore)||void 0===i?void 0:i.endpoint,applicationName:(null==n||null===(o=n.comscore)||void 0===o?void 0:o.applicationName)||(null===(l=window)||void 0===l?void 0:l.siteName)||null,implementationId:null==n||null===(a=n.comscore)||void 0===a?void 0:a.implementationId,projectId:null==n||null===(u=n.comscore)||void 0===u?void 0:u.projectId,debug:(null==n||null===(s=n.comscore)||void 0===s?void 0:s.debug)||!1,persistentLabels:(null==n||null===(c=n.comscore)||void 0===c?void 0:c.persistentLabels)||{},metadata:(null==n||null===(d=n.comscore)||void 0===d?void 0:d.metadata)||{}});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function fe(e,n){return pe.apply(this,arguments)}function pe(){return(pe=n(t.mark((function e(n,r){var i,o,l,a,u,s,c,d,v,f,p,m,h,y;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v=(null==r?void 0:r.contentType)||"video",f=null==r||null===(i=r[v])||void 0===i?void 0:i.drmEnabled,null==r||null===(o=r[v])||void 0===o||null===(l=o.liveDetails)||void 0===l||l.isDvrEnabled,null==n||n.showPositiveSeekbar,p=(null==r||null===(a=r[v])||void 0===a||null===(u=a.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.dash)||null,m=(null==n||null===(c=n.comscore)||void 0===c?void 0:c.enable)||!1,h=!(null==n||null===(d=n.analytics)||void 0===d||!d.muxKey),e.prev=7,e.next=10,Promise.allSettled([f?"Safari"==g.detectBrowser()?ie():"caliente"!=(null===(y=window)||void 0===y?void 0:y.siteName)?ae():ie():"Safari"!=g.detectBrowser()&&p?ae():null,m?de(n):null,h?oe():null,ee(n)]);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(7),console.log("Error",e.t0);case 15:case"end":return e.stop()}}),e,null,[[7,12]])})))).apply(this,arguments)}function me(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function ge(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?me(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):me(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}var he=new Set,ye=null,be=function(e,n,t,r){var i,o,l,a,u,s,d,v,f={},p=(null==e?void 0:e.contentType)||"video";f["c3.cm.id"]=(null===(i=e[p])||void 0===i?void 0:i.id)||"Null",f["c3.cm.contentType"]=De(e),f[null==t||null===(o=t.Constants)||void 0===o?void 0:o.IS_LIVE]=!(null==e||!e.linearchannel),f[null==t||null===(l=t.Constants)||void 0===l?void 0:l.STREAM_URL]=n.currentSrc();var m=(null===(a=b.playerConfigManager.getConfig())||void 0===a?void 0:a.userId)||c.getUserId();f[null==t||null===(u=t.Constants)||void 0===u?void 0:u.VIEWER_ID]="undefined"===m?"NULL":m,f["c3.cm.categoryType"]=Ce(e),f["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"}}(),f.DRMEnabled=(null===(s=e[p])||void 0===s?void 0:s.drmEnabled)||"None",f.DAIStream=null!==(d=e[p])&&void 0!==d&&null!==(v=d.gist)&&void 0!==v&&v.isSSAIEnabled?"YES":"NO",f[t.Constants.DEFAULT_RESOURCE]="AKAMAI",f["c3.cm.brand"]="NULL",f.CDVREnabled=Ee(e),f["c3.cm.genreList"]=ke(e),f["c3.cm.genre"]=we(e),f["c3.cm.channel"]=Se(e,r);var g=Pe(c.getCurrentSeries(),e);return f=ge(ge({},f),g)},we=function(e){var n,t,r,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(r=t.primaryCategory)||void 0===r?void 0:r.title)||"Null"},ke=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"},Se=function(e,n){var t,r,i=(null==e?void 0:e.contentType)||"video";return"video"===i?"VOD":(null===(r=((null==e||null===(t=e[i])||void 0===t?void 0:t.channels)||[]).find((function(e){return(null==e?void 0:e.id)===(null==n?void 0:n.channelId)})))||void 0===r?void 0:r.title)||"NULL"},Ce=function(e){var n,t;return null!=e&&e.linearchannel?"Linear Channel":null!=e&&null!==(n=e.video)&&void 0!==n&&null!==(t=n.streamingInfo)&&void 0!==t&&t.isLiveStream?"Live Event":"VOD"},Ee=function(e){var n,t,r=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[r])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},Te=function(e,n){var t,r,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var o=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[o])||void 0===t||null===(r=t.gist)||void 0===r?void 0:r.title)||"Null";return"".concat(l)},De=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var Oe,Pe=function(e,n){var t,r,i,o,l,a={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return a;var u=c.getSeasonNumber(),s=c.getEpisodeNumber();return a["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(r=t.series)||void 0===r?void 0:r.title)||"Null",a["c3.cm.seasonNumber"]=(null==u?void 0:u.toString())||"Null",a["c3.cm.showTitle"]=(null==e||null===(i=e[u-1])||void 0===i||null===(o=i.episodes)||void 0===o||null===(l=o[s-1])||void 0===l?void 0:l.title)||"Null",a["c3.cm.episodeNumber"]=(null==s?void 0:s.toString())||"Null",a},xe=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"}},je=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Ie=function(){var e=n(t.mark((function e(n,r){var i,o,l,a,u,s,d,v,f,p,g,h;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.convivaConfig)||{},o=i.trackConvivaPlayerEvent,l=i.paymentHandler,a=i.tveProvider,u=i.enable,s=i.appName,v=(d=r||{}).token,f=d.epg,u){e.next=4;break}return e.abrupt("return");case 4:if(p=m.getPlayer(n),"function"==typeof(g=o)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,g("getConvivaObject");case 10:if(h=e.sent){e.next=13;break}return e.abrupt("return");case 13:p.ready((function(){var e=p.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var r=xe(t.keySystem);g("contentInfo",{DRMEnabled:r})}else g("contentInfo",{DRMEnabled:"None"})})),n||g("contentInfo",{DRMEnabled:"None"})})),p.on("loadstart",(function(){var e,n;ye&&ye!==p.currentSrc()&&g("playbackEnded"),g("setPlayer",p),he.clear(),ye=p.currentSrc();var t=je(p.currentType()),i=c.getCurrentVideo(),o=be(i,p,h,f);o[null==h||null===(e=h.Constants)||void 0===e?void 0:e.PLAYER_NAME]=s||"WEB",o[null==h||null===(n=h.Constants)||void 0===n?void 0:n.ASSET_NAME]=Te(i,r),o.authToken=v||"NULL",o.streamType=t,o.D2CType=l||"NONE",o.subscriberType=a?"MVPD":"FREE"!==l?"D2C":"FREE",o["c3.cm.affiliate"]=a||"NULL",_e.setData(o),g("contentInfo",o)})),p.on("loadedmetadata",(function(){var e,n=p.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),g("contentInfo",{screenResolution:e})})),p.on("play",(function(){he.has(p.currentSrc())||(he.add(p.currentSrc()),g("playbackStarted",null))})),p.on("ended",(function(){he.has(p.currentSrc())&&he.delete(p.currentSrc()),g("playbackEnded")})),p.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&g("initAdSensor",{player:p,adsLoader:null==e?void 0:e.adsLoader})})),p.on("dispose",(function(){null==he||he.clear(),g("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),_e=(Oe={},{setData:function(e){Oe=ge(ge({},Oe),e)},getData:function(){return Oe}}),Ae=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-a3530077.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-f0bbb76d.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-f8994d41.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-ed4decab.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-d6a48901.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t?Promise.resolve().then((function(){return require("./skin-aef6f952.js")})).then((function(t){t.initialiseSkin(e,n)})):"news"==t?Promise.resolve().then((function(){return require("./skin-90c06edf.js")})).then((function(t){t.initialiseSkin(e,n)})):"news_live"==t?Promise.resolve().then((function(){return require("./skin-6b4fd720.js")})).then((function(t){t.initialiseSkin(e,n)})):"mini"==t?Promise.resolve().then((function(){return require("./skin-8d797b1e.js")})).then((function(t){t.initialiseSkin(e,n)})):"CN_NEWS"==t&&Promise.resolve().then((function(){return require("./skin-e03a88b8.js")})).then((function(t){t.initialiseSkin(e,n)}))};function Le(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}var Re,Be=["offsetSeconds","offsetLabel"],Me=function(n){if(!n||"object"!==y(n))return n;if(!Be.some((function(e){return e in n})))return n;var t=function(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Le(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Le(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}({},n);return Be.forEach((function(e){return delete t[e]})),t},Ne=function(e){try{if(!e)return null;e.refreshAnchor();var n="function"==typeof e.anchorInfo?e.anchorInfo():{};if("vod"===n.source)return{live:!1,source:"vod"};var t=("function"==typeof e.displayBounds?e.displayBounds():e.windowBounds())||{},r=t.start,i=t.end;if(!(Number.isFinite(r)&&i>r))return null;var o=null!=n.anchorPdtSec&&null!=n.anchorPlayerT;return{live:!0,source:n.source,windowEnd:i,anchorT:o?n.anchorPlayerT:null,anchorUtc:o?n.anchorPdtSec:null,nowSec:Date.now()/1e3}}catch(e){return null}},Ve=function(e,n){try{return Ue(e,n)}catch(e){return null}},Ue=function(e,n){if(!e)return null;var t=c.chapterUtcBounds(n).start;if(!Number.isFinite(t))return null;if(!e.live)return{seconds:t,live:!1};var r=null!=e.anchorUtc?e.anchorT+(t-e.anchorUtc):e.windowEnd-(e.nowSec-t);return Number.isFinite(r)?{seconds:Math.max(0,e.windowEnd-r),live:!0}:null},qe=function(e){if(!e||!Number.isFinite(e.seconds))return"";var n=r.formatTime(e.seconds,e.seconds);return e.live?"-".concat(n):n},He=(Re=new Map,{set:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=Array.isArray(n)?n.map(Me):[];return Re.set(e,t),t},get:function(e){return Re.get(e)||[]},remove:function(e){Re.delete(e)}}),Fe="chapter-change",ze="chapter-click",Ge="chapters-updated";function We(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=m.getPlayer(e);r?r.trigger(n,t):console.error("[CHAPTERS] Player instance not found")}function Ke(e){var n=m.getPlayer(e);if(!n)return console.error("[CHAPTERS] Player instance not found"),{};var t=function(e,t){var r=function(e,n){return t(n)};return n.on(e,r),function(){return n.off(e,r)}};return{onChapterChange:function(e){return t(Fe,e)},onChapterClick:function(e){return t(ze,e)},onChaptersUpdated:function(e){return t(Ge,e)}}}var Ye="vjs-chapter-marker",$e="vjs-chapter-preview",Je=function(e){try{var n,t,r;return(null==e||null===(n=e.controlBar)||void 0===n||null===(t=n.progressControl)||void 0===t||null===(r=t.seekBar)||void 0===r?void 0:r.el())||null}catch(e){return null}};function Xe(e,n){var t=n.store,r=n.mapper,i=n.chaptersConfig,o=void 0===i?{}:i,l=n.seek,a=m.getPlayer(e);if(!a)return{render:function(){},reposition:function(){},destroy:function(){}};var u=new Map,s=null,c=-1,d=null,v=function(){return!0===(null==o?void 0:o.enable)},f=function(e){try{return r.chapterStartPercent(e)}catch(e){return null}},p=function(n,t,i){var o=m.getPlayer(e),l=Je(o);if(l){var a=function(e){if(s&&s.isConnected)return s;(s=document.createElement("div")).className=$e;var n=document.createElement("div");n.className="vjs-chapter-preview__time";var t=document.createElement("div");t.className="vjs-chapter-preview__label",s.appendChild(n),s.appendChild(t);var r=document.createElement("span");return r.className="vjs-chapter-preview__pointer",s.appendChild(r),s._time=n,s._label=t,s._pointer=r,e.appendChild(s),s}(l);a._time.textContent=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ne(r);return qe(Ve(n,e))}(n,i),a._label.textContent=(null==n?void 0:n.label)||"",a.classList.add("vjs-chapter-preview--visible");var u="function"==typeof(null==o?void 0:o.el)?o.el():null;u&&u.classList.add("vlp-chapter-preview-open"),function(e,n,t,r){var i="function"==typeof(null==t?void 0:t.el)?t.el():null;if(i){var o=i.getBoundingClientRect(),l=n.getBoundingClientRect(),a=e.offsetWidth||300,u=a/2,s=l.left+r/100*l.width,c=o.left+8+u,d=o.right-8-u,v=s;d>=c&&(v=Math.min(Math.max(s,c),d));var f=v-u-l.left;if(e.style.left="".concat(f,"px"),e.style.transform="none",e._pointer){var p=Math.min(Math.max(s-(l.left+f),8),a-8);e._pointer.style.left="".concat(p,"px")}}else e.style.left="".concat(r,"%")}(a,l,o,t)}},g=function(){d=null,s&&s.classList.remove("vjs-chapter-preview--visible");var n=m.getPlayer(e),t="function"==typeof(null==n?void 0:n.el)?n.el():null;t&&t.classList.remove("vlp-chapter-preview-open")},h=function(e){if(d&&s&&s.classList.contains("vjs-chapter-preview--visible")){var n=f(d);null!=n?p(d,n,e):g()}},y=function(n){var r=document.createElement("div");r.className=Ye,r.dataset.segmentId=String(n.segmentId);var i=function(e){var n=null!=e&&e.icon?String(e.icon).trim():"";if(!n)return null;var t=document.createElement("span");if(t.className="vjs-chapter-marker__icon","<"===n.charAt(0)){var r=m.parseSvgString(n);r&&t.appendChild(r)}else{var i=document.createElement("img");i.src=n,i.alt="",t.appendChild(i)}return t}(n);i&&r.appendChild(i);var o=function(r){if("touchstart"===r.type)r.preventDefault();else if("mousedown"===r.type&&0!==r.button)return;r.stopPropagation(),"function"==typeof l&&l(n.segmentId);var i=t.get(e).indexOf(n);We(e,ze,{chapter:n,index:i,position:i>=0?i+1:void 0})};return r.addEventListener("mousedown",o),r.addEventListener("touchstart",o),r.setAttribute("role","button"),r.setAttribute("tabindex","0"),null!=n&&n.label&&r.setAttribute("aria-label",String(n.label)),r.addEventListener("keydown",(function(e){"Enter"!==e.key&&" "!==e.key&&"Spacebar"!==e.key||e.repeat||(e.preventDefault(),o(e))})),r.addEventListener("mouseenter",(function(){var e=f(n);null!=e&&(d=n,p(n,e))})),r.addEventListener("mouseleave",g),r},b=function(n){v()&&0!==u.size&&(n||r.refreshAnchor(),t.get(e).forEach((function(e){var n=u.get(String(e.segmentId));if(n){var t=f(e);null==t?n.style.display="none":(n.style.display="",n.style.left="".concat(t,"%"))}})))},w=0,k=function(n){u.forEach((function(e){return e.classList.remove("".concat(Ye,"--active"))}));var r=t.get(e),i=n>=0?r[n]:null;if(i){var o=u.get(String(i.segmentId));o&&o.classList.add("".concat(Ye,"--active"))}},S=function(){var n=m.getPlayer(e);if(n){var i=t.get(e),o=r.playerTimeToChapterIndex(n.currentTime()||0,i);-1===o&&Date.now()<w||o!==c&&(c=o,k(o),We(e,Fe,{chapter:o>=0?i[o]:null}))}},C=m.throttle((function(){var e=Ne(r);b(!0),h(e),S()}),1e3),E=function(){var e=Ne(r);b(!0),h(e),S()},T=function(){Ne(r),b(!0)};a.on("timeupdate",C),a.on("seeked",E);var D=!1;try{a.liveTracker&&"function"==typeof a.liveTracker.on&&(a.liveTracker.on("liveedgechange",T),D=!0)}catch(e){}var O=null;(function(){try{return"function"==typeof r.anchorInfo&&"vod"!==r.anchorInfo().source}catch(e){return!1}})()&&(O=setInterval((function(){var e=Ne(r);b(!0),h(e)}),500));return{render:function(){var n=m.getPlayer(e),i=Je(n);i&&(g(),i.querySelectorAll(".".concat(Ye)).forEach((function(e){return e.remove()})),u.clear(),v()&&(r.refreshAnchor(),t.get(e).forEach((function(e){var n=y(e);i.appendChild(n),u.set(String(e.segmentId),n)})),b(!0),k(c),S()))},reposition:b,destroy:function(){try{a.off("timeupdate",C),a.off("seeked",E),D&&a.liveTracker.off("liveedgechange",T)}catch(e){}O&&(clearInterval(O),O=null);var n=Je(m.getPlayer(e));n&&n.querySelectorAll(".".concat(Ye,", .").concat($e)).forEach((function(e){return e.remove()})),u.clear(),s=null,d=null},setActiveBySegment:function(n){var r=t.get(e),i=r.findIndex((function(e){return String(e.segmentId)===String(n)}));i<0||(w=Date.now()+1500,i!==c&&(c=i,k(i),We(e,Fe,{chapter:r[i]})))}}}function Qe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function Ze(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qe(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Qe(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}var en=new Map,nn=function(e){var n=e.live,t=e.dvr;return function(e){return Array.isArray(e)&&e.some((function(e){return e&&e.eventStartUtc}))}(e.chapters)||n&&t?"livedvr":"vod"},tn=function(e){try{var n,t,r;return!(null==e||null===(n=e.controlBar)||void 0===n||null===(t=n.progressControl)||void 0===t||null===(r=t.seekBar)||void 0===r||!r.el())}catch(e){return!1}},rn=function(e){var n=en.get(e);if(n)return n;n={mapper:c.createTimelineMapper(e,{timeMode:"vod"}),markers:null,chaptersConfig:{enable:!0},timeMode:"vod",live:!1,dvr:!1,disposed:!1},en.set(e,n);var t=m.getPlayer(e);return t&&(t.on("dispose",(function(){return cn(e)})),t.one("loadeddata",(function(){n.disposed||on(e)}))),n},on=function(e){var n=en.get(e),t=function(e){var n=en.get(e);if(!n||n.markers)return(null==n?void 0:n.markers)||null;var t=m.getPlayer(e);return t&&tn(t)?(n.markers=Xe(e,{store:He,mapper:n.mapper,chaptersConfig:n.chaptersConfig,seek:function(n){return sn(e,n)}}),n.markers):null}(e);t&&n&&t.render()};function ln(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=rn(e);He.set(e,n);var r=nn({live:t.live,dvr:t.dvr,chapters:n});return r!==t.timeMode&&(t.timeMode=r,t.mapper=c.createTimelineMapper(e,{timeMode:r}),t.markers&&(t.markers.destroy(),t.markers=null)),on(e),We(e,Ge,{chapters:He.get(e)}),!0}function an(e){var n=He.get(e),t=en.get(e);if(!t||!n.length)return n;var r=Ne(t.mapper);try{return n.map((function(e){var n=Ve(r,e);return Ze(Ze({},e),{},{offsetSeconds:n?n.seconds:null,offsetLabel:qe(n)})}))}catch(e){return n}}function un(e){He.set(e,[]);var n=en.get(e);return null!=n&&n.markers&&n.markers.render(),We(e,Ge,{chapters:[]}),!0}function sn(e,n){var t,r,i=m.getPlayer(e),o=rn(e);if(!i)return!1;var l=He.get(e).find((function(e){return e.segmentId===n}));if(!l)return!1;o.mapper.refreshAnchor();var a=o.mapper.chapterToPlayerTime(l);if(null==a||!Number.isFinite(a))return!1;var u=o.mapper.windowBounds(),s=u.start,c=u.end;return Number.isFinite(s)&&Number.isFinite(c)&&c>s&&(a=Math.min(Math.max(a,s),c-.1)),i.currentTime(a),null===(t=o.markers)||void 0===t||null===(r=t.setActiveBySegment)||void 0===r||r.call(t,n),!0}function cn(e){var n=en.get(e);n&&(n.disposed=!0,n.markers&&n.markers.destroy()),en.delete(e),He.remove(e)}function dn(e){var n,t,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=b.playerConfigManager.getConfig();(null!=o&&null!==(n=o.chaptersConfig)&&void 0!==n&&n.enable||null!=o&&null!==(t=o.chapters)&&void 0!==t&&t.length)&&(function(e,n){var t,r=null===(t=m.getPlayer(e))||void 0===t?void 0:t.el();if(r&&n){var i=function(e,n){null!=n&&""!==n&&r.style.setProperty(e,n)};i("--vl-chapter-color",n.markerColor),i("--vl-chapter-active",n.markerActiveColor),i("--vl-chapter-hover",n.markerHoverColor),i("--vl-chapter-size",null!=n.markerSize?"".concat(n.markerSize,"px"):null),i("--vl-chapter-opacity",null!=n.markerOpacity?String(n.markerOpacity):null),i("--vl-chapter-tooltip",n.tooltipColor)}}(e,null==o||null===(r=o.chaptersConfig)||void 0===r?void 0:r.style),function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.chapters,r=void 0===t?[]:t,i=n.live,o=void 0!==i&&i,l=n.dvr,a=void 0!==l&&l;n.res;var u=n.chaptersConfig,s=void 0===u?{}:u,d=m.getPlayer(e);if(!d)return!1;Array.isArray(r)&&He.set(e,r);var v=nn({live:o,dvr:a,chapters:r}),f=en.get(e);null!=f&&f.markers&&f.markers.destroy();var p={mapper:c.createTimelineMapper(e,{timeMode:v}),markers:null,chaptersConfig:s||{},timeMode:v,live:o,dvr:a,disposed:!1};en.set(e,p);var g=function(){p.disposed||on(e)};d.one("loadeddata",g),tn(d)&&g(),d.on("dispose",(function(){return cn(e)}))}(e,{chapters:(null==o?void 0:o.chapters)||[],live:(null==i?void 0:i.liveVideo)||!1,dvr:(null==i?void 0:i.isDvrEnabled)||!1,res:null==i?void 0:i.res,chaptersConfig:(null==o?void 0:o.chaptersConfig)||{}}))}var vn=!1,fn=function(e,n){var t,r,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(r=t.streamingInfo)||void 0===r?void 0:r.secondaryVideoAssets)||null)&&!vn){var o=pn(e,"videoAssets","secondaryVideoAssets"),l=c.getSource(o,n);return l&&c.loadVideo(n,l),vn=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function pn(e,n,t){if(Array.isArray(e))return e.map((function(e){return pn(e,n,t)}));if(null!==e&&"object"===y(e)){var r={};return Object.keys(e).forEach((function(i){i===n&&void 0!==e[t]?r[i]=e[t]:i===t&&void 0!==e[n]?r[i]=e[n]:r[i]=pn(e[i],n,t)})),r}return e}function mn(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 gn(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)?gn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,o=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw o}}}}function gn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function hn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function yn(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hn(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):hn(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}var bn,wn=function(e,n,t,r){var i,o,l,a,u,s=r.res,d=r.sres,f=m.getPlayer(e),p=(null==s?void 0:s.contentType)||"video",h=(null==s||null===(i=s[p])||void 0===i?void 0:i.drmEnabled)||!1,b=!(null==s||null===(o=s[p])||void 0===o||null===(l=o.streamingInfo)||void 0===l||!l.isLiveStream)||"linearchannel"===p,k=(null==s||null===(a=s[p])||void 0===a||null===(u=a.liveDetails)||void 0===u?void 0:u.isDvrEnabled)||!1;c.setCurrentVideo(s),c.videoReplayTracker.set(s),f&&(w.initPlayerControlEvents(e,{liveVideo:b,isDvrEnabled:k}),f.on("loadstart",(function(){b?t.resolve({status:!0,msg:"Video Loaded",response:s}):t.resolve(yn({status:!0,msg:"Player Initialised"},d?{seriesResponse:d,response:s}:{response:s}))})),f.on("loadeddata",(function(){var t,r,i,o,l=v.getCaptions(e);if(null==l||l.map((function(n){return v.disableCaptions(e,n.id)})),k&&"Safari"===g.detectBrowser())try{var a;null==f||null===(a=f.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==f||!f.muted())&&Q(e,sessionStorage.getItem("volume")||"100"),w.resyncControlState(e);var u=c.getCurrentVideo();if(c.initialiseComscoreStreamingTracking(n),c.clearError(),null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.isExternal){var d=yn(yn({},n),s);c.initiateWatchHistoryHandlingExternal(f,d)}else if(null!=n&&n.watchHistory&&null!=n&&null!==(r=n.watchHistory)&&void 0!==r&&r.enable&&(!n.isAnonymousUser||null!=n&&null!==(i=n.watchHistory)&&void 0!==i&&i.saveOffline)){var p,m,h=yn(yn({},n),s);c.initiateWatchHistoryHandling(e,h,null==u||null===(p=u.video)||void 0===p||null===(m=p.gist)||void 0===m?void 0:m.id)}if(null!=n&&null!==(o=n.analytics)&&void 0!==o&&o.muxKey&&null!=f&&f.mux){var y,b,S,C,E,T,D=(null===(y=c.getCurrentVideo())||void 0===y?void 0:y.video)||(null==s?void 0:s.video),O=null==D?void 0:D.gist,P={env_key:null==n||null===(b=n.analytics)||void 0===b?void 0:b.muxKey,player_name:"vl-web-player",player_version:null===(S=window)||void 0===S?void 0:S.vl_player_version,video_id:null==O?void 0:O.id,video_title:null==O?void 0:O.title,video_series:null==D||null===(C=D.series)||void 0===C?void 0:C.title,video_stream_type:null!=D&&null!==(E=D.streamingInfo)&&void 0!==E&&E.isLiveStream?"live":"video",viewer_user_id:null==n||null===(T=n.analytics)||void 0===T?void 0:T.userId};f.mux({debug:!1,data:P})}})),f.textTracks().on("change",(function(n){var t=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];v.syncTtmlDisplay(e),f.trigger("subtitlechanged",t)})),f.tech_.on("retryplaylist",(function(){b&&fn(s,e)})),f.on("error",(function(){var n,r;(console.log("ERROR",f.error(),f.error().code),4===f.error().code&&b)?fn(s,e):(c.handleError(e,(null==f||null===(n=f.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==f||null===(r=f.error())||void 0===r?void 0:r.message)||"Some error occured",response:s}))})),f.one("play",(function(){var e,t,r,i,o;if(null===(e=window)||void 0===e||null===(t=e.app_data)||void 0===t||null===(r=t.appcmsMain)||void 0===r||null===(i=r.adsConfig)||void 0===i||!i.vodAdClientSideTracking){if(null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable){var l,a,u,s=null===(l=c.getCurrentVideo())||void 0===l||null===(a=l.video)||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.id,d=c.getSeriesWatchMap(),v=(null==d?void 0:d.get(s))||{t:0,p:0},p=v.t,m=v.p;p&&m<95&&c.seekToResumeTime(f,p)}else{var g,h,y,b,w,k,S,C=null!==(g=null==n?void 0:n.watchHistoryResumeTime)&&void 0!==g?g:null==n||null===(h=n.watchHistory)||void 0===h?void 0:h.watchedTime,E=null!==(y=null!==(b=null==n?void 0:n.watchedPercentage)&&void 0!==b?b:null==n||null===(w=n.watchHistory)||void 0===w?void 0:w.watchedPercentage)&&void 0!==y?y:0,T=null!==(k=null==n||null===(S=n.watchHistory)||void 0===S?void 0:S.completionThreshold)&&void 0!==k?k:95;C&&E<T&&c.seekToResumeTime(f,C)}if(null!=f&&f.dvrSeekbar)try{f.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}})),f.on("volumechange",(function(){var e=100*f.volume().toFixed(2);f.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),f.on("chromecastDisconnected",(function(){if(b){f.currentSource();for(var n=f.textTracks(),t=n.length-1;t>=0;t--)f.removeRemoteTextTrack(n[t])}var r=f.textTracks(),i=function(){return v.removeDuplicateCaptions(e)};i(),r.addEventListener("addtrack",i),setTimeout((function(){return r.removeEventListener("addtrack",i)}),15e3)})),f.one("loadeddata",(function(){var e,n=(null==f||null===(e=f.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort((function(e,n){var t=(e.language||e.language||"").toUpperCase(),r=(n.language||n.label||"").toUpperCase();return t<r?-1:t>r?1:0})),"object"==y(f.dash)){var t,r,i,o=null==f||null===(t=f.dash)||void 0===t||null===(r=t.mediaPlayer)||void 0===r?void 0:r.getTracksFor("audio"),l=null==o?void 0:o.find((function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")})),a=mn(n);try{for(a.s();!(i=a.n()).done;){var u=i.value;if(l&&(null==u?void 0:u.id)=="dash-audio-".concat(l.index)){u.enabled=!0;break}}}catch(e){a.e(e)}finally{a.f()}}else{var s,c=[],d=mn(n);try{for(d.s();!(s=d.n()).done;){var v,p,m,b=s.value;("Chrome"==g.detectBrowser()||"Edge"==g.detectBrowser()&&(null!==(v=navigator)&&void 0!==v&&null!==(p=v.userAgent)&&void 0!==p&&p.includes("Macintosh")||!h))&&null!=b&&null!==(m=b.label)&&void 0!==m&&m.includes("5.1")?f.audioTracks().removeTrack(b):c.push(b)}}catch(e){d.e(e)}finally{d.f()}for(var w=c.find((function(e){return"main"===e.kind})),k=w||c.find((function(e){return e.enabled}))||c[0],S=0,C=c;S<C.length;S++){var E=C[S];E.enabled=E===k}}})))},kn=(null===(bn=r.time)||void 0===bn?void 0:bn.createTimeRanges)||r.createTimeRanges;function Sn(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.scheduleStartDate,r=n.startOverTime;if(e&&(t||r)){var i,o=t?(i=t)>1e12?i/1e3:i:null,l=r>0?r:null,a=e.seekable.bind(e);e.seekable=function(){var e=a();if(!e||!e.length)return e;var n=e.start(0),t=e.end(e.length-1),r=Date.now()/1e3,i=1/0;if(null!=o&&(i=Math.min(i,r-o)),null!=l&&(i=Math.min(i,l)),!isFinite(i))return e;var u=i<=0?t:Math.max(n,t-i);return kn(u,t)};e.on("seeking",(function(){var n=e.seekable();if(n&&n.length){var t=n.start(0);e.currentTime()<t-.5&&e.currentTime(t)}}))}}function Cn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function En(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Cn(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Cn(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}var Tn="urn:x-cast:com.viewlift.player.caf",Dn={eng:"en",spa:"es",esp:"es",cast:"es",fre:"fr",fra:"fr",ger:"de",deu:"de",por:"pt",ita:"it",dut:"nl",nld:"nl",chi:"zh",zho:"zh",cmn:"zh",yue:"zh",jpn:"ja",kor:"ko",ara:"ar",hin:"hi",rus:"ru",heb:"he",iw:"he",ind:"id",in:"id",fil:"tl",tgl:"tl",vie:"vi",tha:"th",tur:"tr",pol:"pl",swe:"sv",nor:"no",nob:"no",nb:"no",dan:"da",fin:"fi",gre:"el",ell:"el",cze:"cs",ces:"cs",ukr:"uk",rum:"ro",ron:"ro",hun:"hu",ben:"bn",tam:"ta",tel:"te",mal:"ml",kan:"kn",mar:"mr",pan:"pa",guj:"gu",urd:"ur"},On=["und","mul","zxx"];function Pn(){try{return"true"===new URLSearchParams(window.location.search).get("castdebug")}catch(e){return!1}}function xn(){var e;Pn()&&(e=console).log.apply(e,arguments)}function jn(){var e;Pn()&&(e=console).warn.apply(e,arguments)}function In(e){if(!e)return"";var n=String(e).trim().toLowerCase().replace(/_/g,"-").split("@")[0].split(".")[0].split("-").filter(Boolean),t=S(n),r=t[0],i=t.slice(1);return r?[Dn[r]||r].concat(k(i)).join("-"):""}function _n(e){return In(e).split("-")[0]}function An(e){var n=_n(e);return!!n&&!On.includes(n)}function Ln(e,n){return An(e)&&An(n)&&_n(e)===_n(n)}function Rn(e){return e?String(e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").trim().toLowerCase():""}function Bn(e,n){return!!e&&!!n&&Rn(e)===Rn(n)}function Mn(e){return(null==e?void 0:e.language)||(null==e?void 0:e.lang)||""}function Nn(e){return e?{language:Mn(e)||void 0,label:e.label||void 0,roles:["captions"===e.kind?"caption":"subtitle"],forced:!!e.forced}:null}function Vn(e){return e?{language:Mn(e)||void 0,label:e.label||void 0}:null}function Un(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(!n||!e.length)return null;for(var t=0,r=[function(e){return t=Mn(e),r=n.language,An(t)&&An(r)&&In(t)===In(r);var t,r},function(e){return Ln(Mn(e),n.language)},function(e){return Bn(e.label,n.label)}];t<r.length;t++){var i=r[t],o=e.filter(i);if(1===o.length)return o[0];if(o.length>1)return qn(o,n)}return null}function qn(e,n){var t=n.roles||[];return e.find((function(e){var n;return null===(n=e.roles)||void 0===n?void 0:n.some((function(e){return t.includes(e)}))}))||e[0]}var Hn={textTracks:[],audioTracks:[],activeCaption:null,activeAudio:null};function Fn(e,n){if(!n)return null;var t=Un(e,n);return null!=(null==t?void 0:t.id)?{id:t.id}:n}function zn(e,n,t){if(!n)return!t;if(!t)return!1;var r=Un(e,t);return r&&null!=n.id?r.id===n.id:!!Ln(Mn(n),t.language)&&(!n.label||!t.label||Bn(n.label,t.label))}function Gn(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=function(){var e,n,t,r,i,o,l=null===(e=window)||void 0===e||null===(n=e.cast)||void 0===n?void 0:n.framework,a=null==l||null===(t=l.CastContext)||void 0===t||null===(r=t.getInstance)||void 0===r?void 0:r.call(t),u=null==a||null===(i=a.getCurrentSession)||void 0===i?void 0:i.call(a);return u&&"function"==typeof u.sendMessage?null!=l&&l.CastState&&(null===(o=a.getCastState)||void 0===o?void 0:o.call(a))!==l.CastState.CONNECTED?null:u:null}();if(t){var r=En(En({type:"COMMAND",source:"sender",command:e},n),{},{ts:Date.now()});xn("[Cast] ->",e,n);try{Promise.resolve(t.sendMessage(Tn,r)).catch((function(n){return jn("[Cast] command failed",e,(null==n?void 0:n.message)||n)}))}catch(n){jn("[Cast] command failed",e,(null==n?void 0:n.message)||n)}}}var Wn=function(){return Gn("play")},Kn=function(){return Gn("pause")},Yn=function(e){return Gn("seek",{currentTime:e})},$n=function(e){return Gn("setPlaybackRate",{rate:e})},Jn=function(e,n){return Gn("setVolume",{volume:e,muted:n})},Xn=function(e){zn(Hn.textTracks,Hn.activeCaption,e)||Gn("setCaption",{track:Fn(Hn.textTracks,e)})},Qn=function(e){e&&(zn(Hn.audioTracks,Hn.activeAudio,e)||Gn("setAudio",{track:Fn(Hn.audioTracks,e)}))};function Zn(e){return e?e.tracks_||Array.from(e):[]}function et(e){var n;return Zn(null===(n=e.textTracks)||void 0===n?void 0:n.call(e)).filter((function(e){return"captions"===e.kind||"subtitles"===e.kind}))}function nt(e){return"function"==typeof e.audioTracks?Zn(e.audioTracks()):[]}function tt(e){return et(e).find((function(e){return"showing"===e.mode}))||null}function rt(e){return nt(e).find((function(e){return e.enabled}))||null}function it(e,n){var t=et(e),r=n?Un(t,n):null;n&&!r||t.forEach((function(e){e.mode=e===r?"showing":"disabled"}))}var ot=null;var lt=null;function at(e,n){if("STATE"===n.type)return Hn.textTracks=n.textTracks||[],Hn.audioTracks=n.audioTracks||[],Hn.activeCaption=n.activeCaption||null,Hn.activeAudio=n.activeAudio||null,void function(){if(lt&&(Hn.textTracks.length||Hn.audioTracks.length)){var e=lt,n=e.caption,t=e.audio;lt=null,Xn(n),Qn(t)}}();if("LOG_STATUS"===n.type&&xn("[Cast] <- LOG_STATUS",n.type,n),"EVENT"===n.type)switch(xn("[Cast] <-",n.event,n),n.event){case"CaptionChanged":Hn.activeCaption=n.activeCaption||null,it(e,Hn.activeCaption);break;case"AudioChanged":Hn.activeAudio=n.activeAudio||null,function(e,n){var t=n&&Un(nt(e),n);t&&!t.enabled&&(t.enabled=!0)}(e,Hn.activeAudio);break;case"TracksChanged":Hn.textTracks=[],Hn.audioTracks=[];break;case"TrackUnresolved":jn("[Cast] receiver could not resolve track",n.kind,n.requested)}}var ut=!1;function st(e){!function(e){var n,t,r,i,o,l,a=null===(n=window)||void 0===n||null===(t=n.cast)||void 0===t?void 0:t.framework,u=null==a||null===(r=a.CastContext)||void 0===r||null===(i=r.getInstance)||void 0===i?void 0:i.call(r);if(u){var s=function(n){n&&!n.__vlCastListening&&(n.__vlCastListening=!0,n.addMessageListener(Tn,(function(n,t){try{var r="string"==typeof t?JSON.parse(t):t;"receiver"===(null==r?void 0:r.source)&&at(e,r)}catch(e){jn("[Cast] could not handle receiver message",(null==e?void 0:e.message)||e,t)}})))};s(null===(o=u.getCurrentSession)||void 0===o?void 0:o.call(u)),!ut&&null!=a&&null!==(l=a.CastContextEventType)&&void 0!==l&&l.SESSION_STATE_CHANGED&&(ut=!0,u.addEventListener(a.CastContextEventType.SESSION_STATE_CHANGED,(function(){var e;return s(null===(e=u.getCurrentSession)||void 0===e?void 0:e.call(u))})))}}(e),e.addClass("vl-casting");var n=tt(e);n&&(ot=Nn(n));var t=function(){return it(e,ot)};e.one("loadeddata",(function(){return setTimeout(t,0)})),setTimeout(t,1500),function(e){var n=Nn(tt(e))||ot,t=Vn(rt(e));xn("[Cast] syncing selected tracks",lt={caption:n,audio:t}),Gn("setCaption",{track:Fn(Hn.textTracks,n)}),t&&Gn("setAudio",{track:Fn(Hn.audioTracks,t)})}(e)}function ct(e){var n;if(e&&!e.__vlCastSyncBound){e.__vlCastSyncBound=!0,e.on("chromecastConnected",(function(){return st(e)})),e.on("chromecastDisconnected",(function(){e.removeClass("vl-casting"),Hn.textTracks=[],Hn.audioTracks=[],Hn.activeCaption=null,Hn.activeAudio=null,lt=null}));var t=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:150,t=null;return function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];clearTimeout(t),t=setTimeout((function(){return e.apply(void 0,i)}),n)}}((function(){return Jn(e.volume(),e.muted())}));e.on("play",(function(){return Wn()})),e.on("pause",(function(){return Kn()})),e.on("seeked",(function(){return Yn(e.currentTime())})),e.on("volumechange",t),e.on("ratechange",(function(){return $n(e.playbackRate())})),e.on("texttrackchange",(function(){var n=Nn(tt(e));n&&(ot=n),Xn(n)}));var r="function"==typeof e.audioTracks?e.audioTracks():null;null==r||null===(n=r.addEventListener)||void 0===n||n.call(r,"change",(function(){return Qn(Vn(rt(e)))}))}}function dt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function vt(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?dt(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):dt(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}function ft(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 pt(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)?pt(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,o=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw o}}}}function pt(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var mt={debug:5,info:4,warn:3,error:2,fatal:1,none:0,off:0,DEBUG:5,INFO:4,WARN:3,ERROR:2,FATAL:1,NONE:0,OFF:0},gt=function(e){var n;if(e){var t=function(){var n,t="function"==typeof e.currentWidth&&e.currentWidth()||(null===(n=e.el())||void 0===n?void 0:n.clientWidth)||0;e.toggleClass("vlp-hide-pip",t<=500&&function(){var n,t=null===(n=e.textTracks)||void 0===n?void 0:n.call(e);if(!t)return!1;for(var r=0;r<t.length;r++){var i,o=null===(i=t[r])||void 0===i?void 0:i.kind;if("captions"===o||"subtitles"===o)return!0}return!1}())};t(),e.on("playerresize",t),e.on("fullscreenchange",t);var r=null===(n=e.textTracks)||void 0===n?void 0:n.call(e);null!=r&&r.addEventListener&&(r.addEventListener("addtrack",t),r.addEventListener("removetrack",t),e.on("dispose",(function(){r.removeEventListener("addtrack",t),r.removeEventListener("removetrack",t)})))}};function ht(e,n,t){var r=b.playerConfigManager.getConfig()||{};c.emitApiErrorEvent(e,{status:t,message:"DRM ".concat(n," request failed")},"playback",{requestKind:n,videoId:null==r?void 0:r.videoId})}function yt(e){try{if(null!=e&&e.__vlLicenseUrl)return e.__vlLicenseUrl;var n=null==e?void 0:e.keySystems;if(n)for(var t=0,r=Object.keys(n);t<r.length;t++){var i=n[r[t]];if("string"==typeof i)return i;if(null!=i&&i.url)return i.url;if(null!=i&&i.licenseUri)return i.licenseUri}var o=null==e?void 0:e.keySystemOptions;if(Array.isArray(o)){var l,a=ft(o);try{for(a.s();!(l=a.n()).done;){var u,s,c,d=l.value,v=(null==d||null===(u=d.options)||void 0===u?void 0:u.serverURL)||(null==d||null===(s=d.options)||void 0===s?void 0:s.licenseUri)||(null==d||null===(c=d.options)||void 0===c?void 0:c.url);if(v)return v}}catch(e){a.e(e)}finally{a.f()}}}catch(e){}return""}function bt(e){if(null!=e&&e.__vlDrmLicenseUrl)return e.__vlDrmLicenseUrl;try{return yt("function"==typeof e.currentSource?e.currentSource():null)}catch(e){return""}}function wt(e,n){n&&!n.__vlDrmDashHooksInstalled&&(n.__vlDrmDashHooksInstalled=!0,"function"==typeof n.addResponseInterceptor&&n.addResponseInterceptor((function(e){try{var n=(null==e?void 0:e.request)||{},t=(null==e?void 0:e.url)||(null==n?void 0:n.url)||"",r=c.classifyRequestKind(t,(null==n?void 0:n.type)||(null==e?void 0:e.type));if(c.isDrmRequestKind(r)){var i=c.extractStatusCode(e,null);c.isHttpOk(i)||ht(t,r,i)}}catch(e){}return Promise.resolve(e)})),"function"==typeof n.registerLicenseRequestFilter&&n.registerLicenseRequestFilter((function(e){try{null!=e&&e.url&&(n.__vlLastLicenseUrl=e.url)}catch(e){}return Promise.resolve()})),"function"==typeof n.on&&n.on("public_licenseRequestComplete",(function(t){try{var r,i,o,l;if(null==t||!t.error)return;var a=null!==(r=null==t||null===(i=t.error)||void 0===i||null===(o=i.data)||void 0===o?void 0:o.responseCode)&&void 0!==r?r:c.extractStatusCode(null,t.error);ht((null==t||null===(l=t.data)||void 0===l?void 0:l.url)||n.__vlLastLicenseUrl||bt(e)||"","license",a)}catch(e){}})))}var kt=!1,St=null,Ct=new Set;function Et(e){if(e&&!e.__vlDrmDashRegistered){e.__vlDrmDashRegistered=!0,Ct.add(e),e.__vlDrmDashEnabled=!0;var n=function(){e.__vlDrmDashRegistered&&(e.__vlDrmDashRegistered=!1,e.__vlDrmDashEnabled=!1,Ct.delete(e),function(){if(kt&&!(Ct.size>0)){var e=null==r?void 0:r.Html5DashJS;e&&"function"==typeof e.removeHook&&"function"==typeof St&&e.removeHook("beforeinitialize",St),kt=!1,St=null}}())};"function"==typeof e.one?e.one("dispose",n):"function"==typeof e.on&&e.on("dispose",n)}}function Tt(e){if(e){Et(e),function(){if(!kt){var e=null==r?void 0:r.Html5DashJS;e&&"function"==typeof e.hook&&(St=function(e,n){null!=e&&e.__vlDrmDashEnabled&&wt(e,n)},kt=!0,e.hook("beforeinitialize",St))}}(),function(e){e&&!e.__vlEmeDrmErrorInstalled&&(e.__vlEmeDrmErrorInstalled=!0,e.on("error",(function(){try{var n,t="function"==typeof e.error?e.error():null;if(!t||!c.isDrmError(t))return;if(null!=e&&null!==(n=e.dash)&&void 0!==n&&n.mediaPlayer)return;ht(bt(e),"license",null)}catch(e){}})))}(e);var n=function(){var n;!function(e){var n,t,r=null==e||null===(n=e.tech_)||void 0===n||null===(t=n.vhs)||void 0===t?void 0:t.xhr;r&&"function"==typeof r.onResponse&&!e.__vlDrmVhsHooksInstalled&&(e.__vlDrmVhsHooksInstalled=!0,r.onResponse((function(e,n,t){try{var r=function(e){return(null==e?void 0:e.uri)||(null==e?void 0:e.url)||(null==e?void 0:e.src)||""}(e),i=c.classifyRequestKind(r,null==e?void 0:e.type);if(!c.isDrmRequestKind(i))return;var o=c.extractStatusCode(t,n);c.isHttpOk(o)&&!n||ht(r,i,o)}catch(e){}})))}(e),wt(e,null==e||null===(n=e.dash)||void 0===n?void 0:n.mediaPlayer)};n(),e.on("xhr-hooks-ready",n),e.on("loadstart",(function(){setTimeout(n,0)}))}}var Dt=function(i,o,l,a){var u,s,d,f,p,h,b,w,k,S,C,E,T,D,O,P,x,j,I,_,A,L,R,B,M,N,V,U,q,H,F,z,G,W,K,Y,$,J,X=o.res,Q=void 0===X?null:X,Z=o.sres,ee=void 0===Z?null:Z,te=function(){try{var e,n,t=new URLSearchParams((null===(e=window)||void 0===e||null===(n=e.location)||void 0===n?void 0:n.search)||""),r=t.get("loglevel")||null;return{playerDebug:"true"===t.get("playerdebug"),logLevel:r,dashLogLevel:null!=r&&null!=mt[r]?mt[r]:5}}catch(e){return{playerDebug:!1,logLevel:null,dashLogLevel:5}}}(),re=te.playerDebug,ie=te.logLevel,oe=te.dashLogLevel;re&&(console.log("[PLAYER DEBUG] config:",l),console.log("[PLAYER DEBUG] entitlement (res):",Q),ee&&console.log("[PLAYER DEBUG] series response (sres):",ee));var le=null!=l&&l.chromecastReceiverId?["chromecast","html5"]:["html5"],ae=(null===(u=Q)||void 0===u?void 0:u.contentType)||"video",ue=m.impolicy16x9(null===(s=Q)||void 0===s||null===(d=s[ae])||void 0===d||null===(f=d.gist)||void 0===f?void 0:f.videoImageUrl)||m.impolicy16x9(null===(p=Q)||void 0===p||null===(h=p[ae])||void 0===h||null===(b=h.gist)||void 0===b||null===(w=b.imageGist)||void 0===w?void 0:w.r16x9),se=(null===(k=Q)||void 0===k||null===(S=k[ae])||void 0===S||null===(C=S.liveDetails)||void 0===C?void 0:C.isDvrEnabled)||!1,ce=!(null===(E=Q)||void 0===E||null===(T=E[ae])||void 0===T||null===(D=T.streamingInfo)||void 0===D||!D.isLiveStream)||"linearchannel"===ae,de=(null===(O=Q)||void 0===O||null===(P=O.ads)||void 0===P||null===(x=P.preRoll)||void 0===x||null===(j=x.adTags)||void 0===j||null===(I=j.web)||void 0===I?void 0:I.active)&&(null===(_=Q)||void 0===_||null===(A=_.ads)||void 0===A||null===(L=A.preRoll)||void 0===L||null===(R=L.adTags)||void 0===R||null===(B=R.web)||void 0===B?void 0:B.url);Q=vt(vt({},Q),{},{audioAssetSource:null==l?void 0:l.audioAssetSource});var ve=(null==l||null===(M=l.customData)||void 0===M?void 0:M.ads)||{},pe=(null===(N=Q)||void 0===N||null===(V=N[ae])||void 0===V?void 0:V.isSSAIEnabled)&&"MEDIA_TAILOR"==(null==ve?void 0:ve.vodAdSticherProvider)||!1,me=!(null===(U=Q)||void 0===U||null===(q=U[ae])||void 0===q||!q.isSSAIEnabled)&&"TRANSMIT"==(null==ve?void 0:ve.liveAdSticherProvider)&&!(null==ve||!ve.liveAdClientSideTracking),ge=(null==l?void 0:l.latency)||6,he=(null==l?void 0:l.skin_settings)||{},ye=($={enableSmoothSeeking:!0,controls:0!=(null==l?void 0:l.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==l?void 0:l.muted)||!1,autoplay:(null==l?void 0:l.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==he?void 0:he.pictureInPictureToggle)||!1},playbackRates:null!=he&&he.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==l.skin,liveui:se},e($,"autoplay",null==l?void 0:l.autoplay),e($,"normalizeAutoplay",(null==l?void 0:l.autoplay)&&!de),e($,"loop",(null==l?void 0:l.loop)||!1),e($,"audioPosterMode",null==l?void 0:l.audioPosterMode),e($,"html5",vt(vt({dash:vt(vt({},!r.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:vt(vt({},((null==l?void 0:l.debugConfig)&&(null==l||null===(H=l.debugConfig)||void 0===H?void 0:H.enable)||re)&&{debug:{logLevel:oe}}),{},{streaming:{parseInbandPrft:!0,delay:{liveDelay:ge},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:vt({},"IE"==g.detectBrowser()&&{enableStallFix:!0,stallSeek:1}),abr:vt(vt(vt(vt({},(null==l?void 0:l.initialBandwidth)&&{initialBitrate:{audio:-1,video:(null==l?void 0:l.initialBandwidth)/1e3}}),(null==l?void 0:l.maxBitrate)&&{maxBitrate:{audio:-1,video:(null==l?void 0:l.maxBitrate)/1e3}}),(null==l?void 0:l.minBitrate)&&{minBitrate:{audio:-1,video:(null==l?void 0:l.minBitrate)/1e3}}),{},{rules:{throughputRule:{active:!0},bolaRule:{active:!1},insufficientBufferRule:{active:!1},switchHistoryRule:{active:!1},droppedFramesRule:{active:!1},abandonRequestsRule:{active:!1}},autoSwitchBitrate:{video:!0,audio:!0}})}})}),vhs:vt(vt(vt({},(null==l?void 0:l.initialBandwidth)&&{bandwidth:l.initialBandwidth}),{},{liveRangeSafeTimeDelta:ge,useDevicePixelRatio:!0,experimentalLLHLS:(null==l?void 0:l.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:null==l||!l.initialBandwidth},(null==l||null===(F=l.customData)||void 0===F?void 0:F.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null!==(z=null==l?void 0:l.enableLowInitialPlaylist)&&void 0!==z&&z},((null==l?void 0:l.debugConfig)&&(null==l||null===(G=l.debugConfig)||void 0===G?void 0:G.enable)||re)&&{debug:!0}),debug:(null==l?void 0:l.debugConfig)&&(null==l||null===(W=l.debugConfig)||void 0===W?void 0:W.enable)||re||!1,nativeTextTracks:"Safari"==g.detectBrowser()},0==(null==l||null===(K=l.customData)||void 0===K?void 0:K.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==l||null===(Y=l.customData)||void 0===Y?void 0:Y.nativeVideoTracks)&&{nativeVideoTracks:!1})),e($,"poster",ue),e($,"techOrder",le),e($,"chromecast",{requestCustomDataFn:function(e){var n,t,r=m.getPlayer(i),o=((null==r?void 0:r.textTracksJson_)||r.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind})),a=function(e,n,t){var r,i,o,l,a,u,s,c,d,v,f=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){var m,g,h,b,w,k,S,C;p.isDrmEnabled=!0;var E=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,T=(null==E?void 0:E.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(h=g[0])||void 0===h||null===(b=h.options)||void 0===b?void 0:b.serverURL);p.licenseUrl=T;var D=(null==E?void 0:E.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(w=n.keySystemOptions)||void 0===w||null===(k=w[0])||void 0===k||null===(S=k.options)||void 0===S||null===(C=S.httpRequestHeaders)||void 0===C?void 0:C["X-AxDRM-Message"]);p.licenseToken=D}var O=(null==e||null===(r=e[f])||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.contentType)||"VIDEO";p.contentType=O;var P=null==e||null===(o=e[f])||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.runtime;p.duration=P;var x=null==e||null===(a=e[f])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;p.mediaTitle=x;var j,I,_=null==e||null===(s=e[f])||void 0===s||null===(c=s.gist)||void 0===c?void 0:c.videoImageUrl;return p.mediaImage=_,p.subTitles=t,p.DVR=(null==e||null===(d=e[f])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,void 0!==("undefined"==typeof window?"undefined":y(window))&&(p.siteId=(null===(j=window)||void 0===j?void 0:j.siteId)||null,p.userId=(null===(I=window)||void 0===I?void 0:I.sessionStorage)&&window.sessionStorage.getItem("uid")||null),console.log(p),p}(Q,e,o),u=o.find((function(e){return"showing"===e.mode}))||null;return ot=Nn(u),vt(vt({},a),{},{activeCaption:{enabled:!!u,language:(null==u?void 0:u.language)||(null==u?void 0:u.lang)||null,label:(null==u?void 0:u.label)||null},transmitTrackingUrl:c.trackingUrlManager.get()||null,convivaMetaData:vt({customerKey:(null==l||null===(n=l.convivaConfig)||void 0===n?void 0:n.customerKey)||null,debug:(null==l||null===(t=l.convivaConfig)||void 0===t?void 0:t.debug)||!1},_e.getData())})},modifyLoadRequestFn:function(e){var n,t,r,o,l,a=m.getPlayer(i),u=(null==a?void 0:a.currentSource())||{};!(null===(n=Q)||void 0===n||null===(t=n[ae])||void 0===t||null===(r=t.streamingInfo)||void 0===r||null===(o=r.videoAssets)||void 0===o?void 0:o.is4K)&&1||null!=u&&u.src&&null!=u&&null!==(l=u.src)&&void 0!==l&&l.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),$);if(!r.getPlayers()[i]){(null!=l&&l.debugConfig&&null!=l&&null!==(J=l.debugConfig)&&void 0!==J&&J.enable||re)&&r.log.level(ie||"debug");var be=r(i,ye,function(){var e=n(t.mark((function e(){var n,o,u,s,d,f,p,m,g,h,y,b,w,k,S,C,E,T,D,O,P,x,j,I,_,A;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Tt(be),gt(be),console.log(be),console.log(r.VERSION),console.log(r.getPlugins()),e.next=7,fe(l,Q);case 7:if(null!=l&&l.debugConfig&&null!=l&&null!==(n=l.debugConfig)&&void 0!==n&&n.enable||re){try{r.log.level(ie||"debug")}catch(e){}(C=function(){try{var e,n,t;null==be||null===(e=be.dash)||void 0===e||null===(n=e.mediaPlayer)||void 0===n||null===(t=n.updateSettings)||void 0===t||t.call(n,{debug:{logLevel:oe}})}catch(e){}})(),be.one("loadedmetadata",C)}if(E=null===(o=Q)||void 0===o||null===(u=o[ae])||void 0===u||null===(s=u.liveDetails)||void 0===s?void 0:s.startOverTime,null!=l&&l.disableControls||dn(i,{liveVideo:ce,isDvrEnabled:se,res:Q}),ce&&a.resolve(vt({status:!0,msg:"Player Initialised"},ee?{seriesResponse:ee,response:Q}:{response:Q})),c.inititateBeacon(i,{content:Q,analyticsCb:null==l?void 0:l.analyticsCb,analyticsEventParams:null==l?void 0:l.analyticsEventParams,userId:null==l?void 0:l.userId}),Ie(i,l),ct(be),/Android/i.test(navigator.userAgent)&&(r.options.vhs.overrideNative=!0),se&&ne(i,E),!de||null!=l&&null!==(d=l.customData)&&void 0!==d&&d.disableAds||c.initialiseAdvertisement(i,de,Q),null!=l&&l.disableControls||c.initDvrStartOver(i,{config:l,content:Q,liveVideo:ce,isDvrEnabled:se}),T=c.getSource(Q,i),console.log(T),re&&(console.log("[PLAYER DEBUG] source:",T),console.log("[PLAYER DEBUG] videojs options:",ye)),null!=l&&l.nearestClusterUrl&&(T=c.getUpdatedClusterSource(T,l.nearestClusterUrl)),!pe){e.next=28;break}return e.next=25,c.getSGAIEnabledSource(i,Q);case 25:T=e.sent,e.next=32;break;case 28:if(!me){e.next=32;break}return e.next=31,c.getTransmitEnabledSource(T,Q,i);case 31:T=e.sent;case 32:be&&(be.__vlDrmLicenseUrl=yt(T)),T?c.loadVideo(i,T):(a.reject({status:!1,msg:"Incompatible / Missing Source",response:Q}),c.handleError(i,"Incompatible / Missing Source")),D=null===(f=Q)||void 0===f||null===(p=f[ae])||void 0===p||null===(m=p.gist)||void 0===m?void 0:m.scheduleStartDate,ce&&se&&(D||E)&&Sn(be,{scheduleStartDate:D,startOverTime:E}),((null===(g=Q)||void 0===g||null===(h=g[ae])||void 0===h||null===(y=h.contentDetails)||void 0===y||null===(b=y.closedCaptions)||void 0===b?void 0:b.length)>0||(null===(w=Q)||void 0===w||null===(k=w[ae])||void 0===k||null===(S=k.closedCaptions)||void 0===S?void 0:S.length)>0)&&(A=(null===(P=Q)||void 0===P||null===(x=P[ae])||void 0===x||null===(j=x.contentDetails)||void 0===j?void 0:j.closedCaptions)||(null===(I=Q)||void 0===I||null===(_=I[ae])||void 0===_?void 0:_.closedCaptions),O=A.filter((function(e){return"VTT"===e.format})),v.addCaptions(i,O)),null!=l&&l.disableControls?c.disableControls(i):Ae(i,vt(vt(vt({},l),ye),{},{liveVideo:ce,isDvrEnabled:se,res:Q,sres:ee})),wn(i,vt(vt(vt({},l),ye),{},{liveVideo:ce}),a,{res:Q,sres:ee});case 39:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())}};function Ot(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function Pt(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ot(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Ot(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}var xt=function(e,n){var t=n.resolve,r=n.reject,i=null==e?void 0:e.playerId,o=jt(e);Dt(i,{res:o},e,{resolve:t,reject:r})},jt=function(e){var n,t,r,i,o,l,a,u,s,d,v,f,p,m,g,h=null==e?void 0:e.streamingInfo,y=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,b=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,w=(null==e||null===(r=e.streamingInfo)||void 0===r||null===(i=r.ads)||void 0===i?void 0:i.url)||null,S=(null==e||null===(o=e.streamingInfo)||void 0===o?void 0:o.posterUrl)||null,C=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.subtitles)||[],E=(null==e||null===(a=e.streamingInfo)||void 0===a||null===(u=a.videoAssets)||void 0===u?void 0:u.drmProvider)||null,T=(null==e||null===(s=e.streamingInfo)||void 0===s?void 0:s.macroMap)||[],D=(null==e||null===(d=e.customData)||void 0===d||null===(v=d.ads)||void 0===v?void 0:v.isSSAIEnabled)||!1,O=(null==e||null===(f=e.streamingInfo)||void 0===f?void 0:f.scheduleStartDate)||null,P=(null==e||null===(p=e.streamingInfo)||void 0===p?void 0:p.startOverTime)||null,x=null==e?void 0:e.token,j=c.getDecodedToken(x);null==j||j.site;var I=null==j?void 0:j.siteId,_=(null==e||null===(m=e.customData)||void 0===m||null===(g=m.comscore)||void 0===g?void 0:g.video)||null,A=Pt(Pt({id:I?"".concat(I,"_external"):"external"},!b&&{directPlaybackUrl:null==y?void 0:y.url}),{},{video:Pt(Pt(Pt(Pt(Pt({drmEnabled:b,streamingInfo:Pt(Pt({videoAssets:Pt(Pt({},E&&{drmProvider:E}),{},{widevine:null==y?void 0:y.widevine,fairPlay:null==y?void 0:y.fairPlay,playReady:null==y?void 0:y.playReady})},(null==h?void 0:h.isDvrEnabled)&&{isLiveStream:!0}),(null==_?void 0:_.isLiveStream)&&{isLiveStream:null==_?void 0:_.isLiveStream})},D&&{isSSAIEnabled:D}),{},{metadata:T,liveDetails:Pt({isDvrEnabled:null==h?void 0:h.isDvrEnabled},P&&{startOverTime:P}),gist:Pt(Pt(Pt(Pt({},S&&{videoImageUrl:S}),O&&{scheduleStartDate:O}),(null==_?void 0:_.videoId)&&{id:null==_?void 0:_.videoId}),(null==_?void 0:_.videoTitle)&&{title:null==_?void 0:_.videoTitle}),contentDetails:Pt({},(null==C?void 0:C.length)>0&&{closedCaptions:k(C)})},(null==_?void 0:_.runtime)&&{runtime:null==_?void 0:_.runtime}),(null==_?void 0:_.publishDate)&&{publishDate:null==_?void 0:_.publishDate}),(null==_?void 0:_.platform)&&{platform:null==_?void 0:_.platform}),(null==_?void 0:_.series)&&{series:null==_?void 0:_.series}),ads:{preRoll:{adTags:{web:Pt(Pt({},w&&{active:!0}),w&&{url:w})}}}});return _&&(null!=_&&_.isDvrEnabled&&(A.video.liveDetails=Pt(Pt({},A.video.liveDetails),{},{isDvrEnabled:null==_?void 0:_.isDvrEnabled})),null!=_&&_.metadata&&(A.video.metadata=[].concat(k(A.video.metadata),k(null==_?void 0:_.metadata)))),A},It=function(){try{var e,n,t=new URLSearchParams((null===(e=window)||void 0===e||null===(n=e.location)||void 0===n?void 0:n.search)||"");return t.has("ssaiDisable")?t.get("ssaiDisable"):null}catch(e){return null}};function _t(e,n){return At.apply(this,arguments)}function At(){return(At=n(t.mark((function e(n,r){var i,o,l,a,u,s,v,f,p,m;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=r.resolve,a=r.reject,u=null==n?void 0:n.videoId,s=null==n?void 0:n.playerId,v=!(null==n||!n.anonymousId),e.next=6,c.getToken();case 6:f=e.sent,p=!1===(null==n||null===(i=n.customData)||void 0===i||null===(o=i.ads)||void 0===o?void 0:o.isSSAIEnabled),null!==(m=It())&&(p="true"===m),c.getVideoDetails(u,f,p).then((function(e){var t,r,i,o,p,m,g,h,y,b,w;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(r=t.video)||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.contentType,c.setCurrentVideo(null==e?void 0:e.data);var k=null==e||null===(o=e.data)||void 0===o||null===(p=o.video)||void 0===p||null===(m=p.gist)||void 0===m?void 0:m.scheduleEndDate,S=null==e||null===(g=e.data)||void 0===g||null===(h=g.video)||void 0===h||null===(y=h.gist)||void 0===y?void 0:y.scheduleStartDate;d.handlePlayerMessage(s,{scheduleEndDate:k,scheduleStartDate:S});var C=null==e?void 0:e.data;if(null!=n&&null!==(b=n.watchHistory)&&void 0!==b&&b.isExternal)C.contentType="video",Dt(s,{res:C},n,{resolve:l,reject:a});else if(null!=n&&n.watchHistory&&null!=n&&null!==(w=n.watchHistory)&&void 0!==w&&w.enable&&!v){var E;if((null===(E=n.watchHistory)||void 0===E?void 0:E.saveOffline)||!1){var T,D,O,P=(null===(T=n.watchHistory)||void 0===T?void 0:T.profileId)||"",x=c.getWatchHistoryByIdFromStorage(P,u,null==n?void 0:n.siteOwner);if(x&&x.length)n.watchHistoryResumeTime=(null===(D=x[0])||void 0===D?void 0:D.watchedTime)||null,n.watchedPercentage=(null===(O=x[0])||void 0===O?void 0:O.watchedPercentage)||null;C.contentType="video",Dt(s,{res:C},n,{resolve:l,reject:a})}else c.getVideoInfo(u,f).then((function(e){var t,r,i,o,l,a;null!==(t=window)&&void 0!==t&&null!==(r=t.watchHistory)&&void 0!==r&&r.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,C.contentType="video"})).catch((function(){})).finally((function(){Dt(s,{res:C},n,{resolve:l,reject:a})}))}else Dt(s,{res:C},n,{resolve:l,reject:a})})).catch((function(e){var t,r,i=(null==n||null===(t=n.event)||void 0===t?void 0:t.showScheduleTimer)||!1,o=(null==n||null===(r=n.event)||void 0===r?void 0:r.onCountdownComplete)||null;i&&d.handleCountdownTimer(s,e,o),c.initiateErrorHandling(e,s,a,u)}));case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Lt(e,n){return Rt.apply(this,arguments)}function Rt(){return(Rt=n(t.mark((function e(n,r){var i,o,l,a,u,s,d,v;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=r.resolve,a=r.reject,e.next=3,c.getToken();case 3:u=e.sent,s=null==n?void 0:n.playerId,d=null==n?void 0:n.epg,v=!1===(null==n||null===(i=n.customData)||void 0===i||null===(o=i.ads)||void 0===o?void 0:o.isSSAIEnabled),c.getLinearChannelDetails(d,u,v).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==d?void 0:d.channelId,c.setCurrentVideo(t),Dt(s,{res:t},n,{resolve:l,reject:a})})).catch((function(e){c.initiateErrorHandling(e,s,a,videoId)}));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Bt(e,n){return Mt.apply(this,arguments)}function Mt(){return(Mt=n(t.mark((function e(n,r){var i,o,l,a,u,s,d;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.resolve,l=r.reject,e.next=3,c.getToken();case 3:a=e.sent,u=null==n?void 0:n.playerId,s=sessionStorage.getItem("season-idx")||0,c.seasonIdxManager.set(parseInt(s)),d=null==n||null===(i=n.series)||void 0===i?void 0:i.id,c.getSeriesDetails(d,a).then((function(e){var t,r,i,s=e.data,v=e.data.seasons;c.setCurrentSeries(v);var f=videoId||(null==v||null===(t=v[0])||void 0===t||null===(r=t.episodes)||void 0===r||null===(i=r[0])||void 0===i?void 0:i.id);c.createSeriesWatchMap(d,a),c.getVideoDetails(f,a).then((function(e){var t,r,i;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(r=t.video)||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.contentType,c.setCurrentVideo(e.data),Dt(u,{res:null==e?void 0:e.data,sres:s},n,{resolve:o,reject:l})})).catch((function(e){c.initiateErrorHandling(e,u,l,videoId)}))})).catch((function(e){c.initiateErrorHandling(e,u,l)}));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Nt,Vt=function(e){var n=e.site,t=e.sseBaseUrl,r=e.sseEndpoint,i=e.debug,o=void 0!==i&&i;return C.createSSETransport({site:n,sseBaseUrl:t,getToken:c.getToken,sseEndpoint:r,onOpen:function(e){var n=e.userId,t=e.endpoint;o&&console.log("SSE Connected:",n,t)},onMessage:function(e){var n,t,r,i,l,a,u,s,v,f;if(o&&console.log("SSE Message:",e),(null===(n=c.getCurrentVideo())||void 0===n||null===(t=n.video)||void 0===t||null===(r=t.gist)||void 0===r?void 0:r.id)===(null==e||null===(i=e.payload)||void 0===i?void 0:i.id)&&"GAME_STATE_CHANGE"===(null==e?void 0:e.notificationType)){var p=1e3*(null==e||null===(l=e.payload)||void 0===l||null===(a=l.states)||void 0===a||null===(u=a.live)||void 0===u?void 0:u.startDateTime),m=1e3*(null==e||null===(s=e.payload)||void 0===s||null===(v=s.states)||void 0===v||null===(f=v.end)||void 0===f?void 0:f.endDateTime);p&&m&&(console.log("Setting schedule timer",p,m),d.scheduleTimerInstanceManager.set({startDateTime:p,endDateTime:m}))}},onReconnectAttempt:function(e){o&&console.log("Reconnect attempt:",e)},onHeartbeatTimeout:function(e){var n=e.elapsed;o&&console.warn("Heartbeat timeout after:",n)},onTokenInvalid:function(e){o&&console.error("Invalid token:",e),window.location.href="/login"},onError:function(e,n){o&&console.error("SSE Error:",e,n)},onClose:function(){o&&console.log("SSE Closed")}})},Ut=function(e){var n=e.enable,t=e.site,r=e.sseBaseUrl,i=e.sseEndpoint,o=e.debug;if(n){var l=Vt({site:t,sseBaseUrl:r,sseEndpoint:i,debug:void 0!==o&&o});return l._sseBaseUrl=r,l._site=t,l._sseEndpoint=i,l}};function qt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function Ht(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qt(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):qt(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}module.exports=function(){return{loadVideoInstantly:c.loadVideoInstantly,onTimeUpdate:d.onTimeUpdate,getVideoDuration:d.getVideoDuration,onVideoEnded:d.onVideoEnded,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var r=n(t.mark((function n(r,i){var o,l,a,u,s,d,v,f,p,g,y,w,k,S,C,T,D,O,P,x,j,I,_,A,L,R,B,M,N,V,U;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!c.isPlayerInitialised(null==e?void 0:e.playerId)){n.next=3;break}return r({status:!0,msg:"Player already initialised",skipped:!0}),n.abrupt("return");case 3:if(O=(null==e?void 0:e.videoSourceUrl)||!1,P=null==e?void 0:e.asat,x=(null==e||null===(o=e.epg)||void 0===o?void 0:o.enable)||!1,j=null==e?void 0:e.videoId,I=(null==e||null===(l=e.series)||void 0===l?void 0:l.enable)||!1,_=(null==e?void 0:e.streamingInfo)||!1,window.videoId=j,A=null==e?void 0:e.token,!c.token_authentication_enabled(e)){n.next=18;break}if(sessionStorage.setItem("vlp_token",A),c.refreshTokenManager().set(null==e?void 0:e.refreshToken),A&&!c.isTokenExpired(A)){n.next=17;break}return i({status:!1,msg:"".concat(A?"Token is expired !":"Missing Authorization Token"),response:{token:A}}),n.abrupt("return");case 17:Nt=JSON.parse(atob(A.split(".")[1]));case 18:return window.siteName=null===(a=Nt)||void 0===a?void 0:a.site,window.siteId=null===(u=Nt)||void 0===u?void 0:u.siteId,e.isAnonymousUser=!(null===(s=Nt)||void 0===s||!s.anonymousId),e.siteOwner=(null===(d=Nt)||void 0===d?void 0:d.site)||null,e.userId=(null===(v=Nt)||void 0===v?void 0:v.userId)||null,c.setUserId((null===(f=Nt)||void 0===f?void 0:f.userId)||(null===(p=Nt)||void 0===p?void 0:p.anonymousId)||null),window.watchHistory=e.watchHistory||null,L=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(g=e.series)&&void 0!==g&&g.enable?null:null==e?void 0:e.chromecastReceiverId,R=(null==e||null===(y=e.analytics)||void 0===y?void 0:y.gaId)||null,(B=null==e?void 0:e.errors)&&(window.customErrors=B),window.customData=null==e?void 0:e.customData,h.setLocalisation(h.resolveLocalisation(e)),c.baseUrlManager.set(e.apiBaseUrl),null!=e&&e.skin&&!m.isNotAValidSkin(e.skin)||(e.skin="VL_ONE"),b.playerConfigManager.setConfig(e),E.relatedVideosManager.reset(),E.relatedVideosManager.set(null==e?void 0:e.relatedVideos),n.next=39,se(e);case 39:R&&J("https://www.googletagmanager.com/gtag/js?id=".concat(R)).then((function(){return c.runGtag(R)})).catch((function(e){})),(M=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(L)))&&M.addEventListener("contextmenu",(function(e){return e.preventDefault()})),(N=Ut({enable:null==e||null===(k=e.sse)||void 0===k?void 0:k.enable,site:null==e||null===(S=e.sse)||void 0===S?void 0:S.siteName,sseBaseUrl:null==e||null===(C=e.sse)||void 0===C?void 0:C.sseBaseUrl,sseEndpoint:null==e||null===(T=e.sse)||void 0===T?void 0:T.sseEndpoint,debug:null==e||null===(D=e.sse)||void 0===D?void 0:D.debug}))&&!N.isConnectionActive()&&N.connect(),O?(U={directPlaybackUrl:O,id:V="c09576ca-8202-4e8e-ba1e-06d1ab0ce063",video:{liveDetails:{isDvrEnabled:!(null==e||!e.isDvr)}}},P?c.getVideoDetails(V,A).then((function(n){var t,o=(null==n?void 0:n.data)||{},l=Ht(Ht(Ht({},o),U),{},{video:Ht(Ht({},null==o?void 0:o.video),{},{liveDetails:Ht(Ht({},null==o||null===(t=o.video)||void 0===t?void 0:t.liveDetails),{},{isDvrEnabled:!(null==e||!e.isDvr)})})});Dt(L,{res:l},e,{resolve:r,reject:i})})).catch((function(e){c.initiateErrorHandling(e,L,i,V)})):Dt(L,{res:Ht(Ht({},U),{},{video:{liveDetails:{isDvrEnabled:!(null==e||!e.isDvr)}}})},e,{resolve:r,reject:i})):_?xt(e,{resolve:r,reject:i}):I?Bt(e,{resolve:r,reject:i}):x?Lt(e,{resolve:r,reject:i}):_t(e,{resolve:r,reject:i});case 45:case"end":return n.stop()}}),n)})));return function(e,n){return r.apply(this,arguments)}}())},getRenditions:f.getRenditions,skip:c.skip,getPlayer:m.getPlayer,play:c.play,pause:c.pause,detectBrowser:g.detectBrowser,rewind:c.rewind,loadVideo:c.loadVideo,seekToTimeStamp:d.seekToTimeStamp,isPlayerInitialised:c.isPlayerInitialised,load:c.load,authenticateLC:c.authenticateLC,dispose:c.dispose,enableCaptions:v.enableCaptions,disableCaptions:v.disableCaptions,getCaptions:v.getCaptions,playSelectedResolution:p.playSelectedResolution,getSource:c.getSource,setVolume:Q,getVolume:Z,disableControls:c.disableControls,setPlaybackSpeed:d.setPlaybackSpeed,getEntitlementData:c.getEntitlementData,getSsaiEvents:c.getSsaiEvents,getPlayerControlEvents:w.getPlayerControlEvents,playerEvents:d.playerEvents,onReplay:d.onReplay,relatedVideosManager:E.relatedVideosManager,setChapters:ln,getChapters:an,clearChapters:un,seekToChapter:sn,getChapterEvents:Ke,onWatchInVerticalView:d.onWatchInVerticalView,fireBeaconEvent:c.fireBeaconEvent,getDvrManager:c.getDvrManager}};
@@ -0,0 +1 @@
1
+ "use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/typeof");function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function o(t){for(var o=1;o<arguments.length;o++){var n=null!=arguments[o]?arguments[o]:{};o%2?r(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var n={},i=!1,a=function(e){return!!e&&"object"===t(e)&&!Array.isArray(e)};exports.getLocalisation=function(e){var t;return(null===(t=n)||void 0===t?void 0:t[e])||""},exports.resolveLocalisation=function(e){var t,r=a(null==e?void 0:e.localisation)?e.localisation:{},n=a(null==e||null===(t=e.customData)||void 0===t?void 0:t.localisation)?e.customData.localisation:null;return n&&!i&&(i=!0,console.warn("[player] `customData.localisation` is deprecated and will be removed in a future version. Use the root-level `localisation` config instead.")),o(o({},n||{}),r)},exports.setLocalisation=function(e){a(e)&&(n=e)};
@@ -1 +1 @@
1
- "use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/inherits"),n=require("@babel/runtime/helpers/possibleConstructorReturn"),a=require("@babel/runtime/helpers/getPrototypeOf"),s=require("video.js"),i=require("./icons-437e83c9.js"),o=require("./generic-118f7ebd.js"),l=require("./skin-55634dc6.js");function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("./manager-77ddd30c.js"),require("./browser-3670a923.js"),require("md5"),require("js-cookie"),require("./captions-abd87121.js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/typeof"),require("./playerControlEvents-db923a5c.js"),require("@babel/runtime/helpers/slicedToArray"),require("@viewlift/comscore/index.js"),require("@babel/runtime/helpers/objectWithoutProperties");var d=s.getComponent("Component"),u=function(){r(h,d);var u,m,p=(u=h,m=c(),function(){var e,t=a(u);if(m){var r=a(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return n(this,e)});function h(t){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,h),(r=p.call(this,t,n)).playerId=n.playerId,r.seriesData=n.sres,r.streams=n.streams,r.currentVideoData=n.res,r.initialiseStructure(),r.loadCSS(),r}return t(h,[{key:"createEl",value:function(){var e=s.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=s.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(i.BroadcastIcon())});return s.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then((function(){return require("./multicamv2-7a86b517.js")})).then((function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this.el(),t=s.dom.createEl("div",{className:"stream-container hidden"});s.dom.$(".stream-selector-icon",this.el()).onclick=function(){var r;null!==(r=t.classList)&&void 0!==r&&r.contains("hidden")?(l.closeOpenDrawers(),t.classList.remove("hidden"),e.classList.add("open"),t.style.right="0px"):(t.classList.add("hidden"),e.classList.remove("open"),t.style.right="-350px")};var r=document.getElementById(this.playerId);if(r){var n=window.getComputedStyle(r,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(n,"px"),r.style.overflow="hidden",s.dom.appendContent(e,t),this.addFunctionality(t)}}},{key:"addFunctionality",value:function(e){var t=this,r=this.el(),n=s.dom.createEl("div",{className:"stream-selector-head"}),a=s.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(i.crossIconSvg())});a.onclick=function(){e.classList.add("hidden"),r.classList.remove("open"),e.style.right="-350px"};for(var c=s.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),d=s.dom.createEl("div",{className:"stream-selector-content"}),u=s.dom.createEl("div",{className:"stream-tray"}),m=function(e){var r,n=s.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(i.SelectedStream())});0==e&&(n.classList.add("selected"),n.style.border="4px solid #D2393B"),n.onclick=function(){for(var r=s.dom.$$(".stream"),a=0;a<r.length;a++)r[a].style.border="none",r[a].classList.remove("selected");n.classList.add("selected"),n.style.border="4px solid #D2393B",o.load(t.playerId,t.streams[e].id).then((function(e){o.play(t.playerId),console.log(e)})).catch((function(e){console.log(e)}))},n.style.backgroundImage="url(".concat(t.streams[e].img,")");var a=document.createElement("img");a.className="stream-thumbnail-image",a.src="".concat(null==t||null===(r=t.streams[e])||void 0===r?void 0:r.img),a.alt="No Thumbnail Available",n.append(a),s.dom.appendContent(u,n),s.dom.appendContent(d,u)},p=0;p<this.streams.length;p++)m(p);s.dom.appendContent(n,a),s.dom.appendContent(n,c),s.dom.appendContent(e,n),s.dom.appendContent(e,d),l.getPlayer(this.playerId).on("fullscreenchange",(function(){var r=window.getComputedStyle(document.getElementById(t.playerId),null).getPropertyValue("height").slice(0,-2);e.style.height="".concat(r,"px")}))}}]),h}();exports.default=u;
1
+ "use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/inherits"),n=require("@babel/runtime/helpers/possibleConstructorReturn"),a=require("@babel/runtime/helpers/getPrototypeOf"),s=require("video.js"),i=require("./icons-437e83c9.js"),o=require("./generic-0b925a19.js"),l=require("./skin-55634dc6.js");function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("./manager-77ddd30c.js"),require("./browser-3670a923.js"),require("md5"),require("js-cookie"),require("./captions-8b889384.js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/slicedToArray"),require("@babel/runtime/helpers/typeof"),require("./playerControlEvents-db923a5c.js"),require("@viewlift/comscore/index.js"),require("@babel/runtime/helpers/objectWithoutProperties");var d=s.getComponent("Component"),u=function(){r(h,d);var u,m,p=(u=h,m=c(),function(){var e,t=a(u);if(m){var r=a(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return n(this,e)});function h(t){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,h),(r=p.call(this,t,n)).playerId=n.playerId,r.seriesData=n.sres,r.streams=n.streams,r.currentVideoData=n.res,r.initialiseStructure(),r.loadCSS(),r}return t(h,[{key:"createEl",value:function(){var e=s.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=s.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(i.BroadcastIcon())});return s.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then((function(){return require("./multicamv2-7a86b517.js")})).then((function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this.el(),t=s.dom.createEl("div",{className:"stream-container hidden"});s.dom.$(".stream-selector-icon",this.el()).onclick=function(){var r;null!==(r=t.classList)&&void 0!==r&&r.contains("hidden")?(l.closeOpenDrawers(),t.classList.remove("hidden"),e.classList.add("open"),t.style.right="0px"):(t.classList.add("hidden"),e.classList.remove("open"),t.style.right="-350px")};var r=document.getElementById(this.playerId);if(r){var n=window.getComputedStyle(r,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(n,"px"),r.style.overflow="hidden",s.dom.appendContent(e,t),this.addFunctionality(t)}}},{key:"addFunctionality",value:function(e){var t=this,r=this.el(),n=s.dom.createEl("div",{className:"stream-selector-head"}),a=s.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(i.crossIconSvg())});a.onclick=function(){e.classList.add("hidden"),r.classList.remove("open"),e.style.right="-350px"};for(var c=s.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),d=s.dom.createEl("div",{className:"stream-selector-content"}),u=s.dom.createEl("div",{className:"stream-tray"}),m=function(e){var r,n=s.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(i.SelectedStream())});0==e&&(n.classList.add("selected"),n.style.border="4px solid #D2393B"),n.onclick=function(){for(var r=s.dom.$$(".stream"),a=0;a<r.length;a++)r[a].style.border="none",r[a].classList.remove("selected");n.classList.add("selected"),n.style.border="4px solid #D2393B",o.load(t.playerId,t.streams[e].id).then((function(e){o.play(t.playerId),console.log(e)})).catch((function(e){console.log(e)}))},n.style.backgroundImage="url(".concat(t.streams[e].img,")");var a=document.createElement("img");a.className="stream-thumbnail-image",a.src="".concat(null==t||null===(r=t.streams[e])||void 0===r?void 0:r.img),a.alt="No Thumbnail Available",n.append(a),s.dom.appendContent(u,n),s.dom.appendContent(d,u)},p=0;p<this.streams.length;p++)m(p);s.dom.appendContent(n,a),s.dom.appendContent(n,c),s.dom.appendContent(e,n),s.dom.appendContent(e,d),l.getPlayer(this.playerId).on("fullscreenchange",(function(){var r=window.getComputedStyle(document.getElementById(t.playerId),null).getPropertyValue("height").slice(0,-2);e.style.height="".concat(r,"px")}))}}]),h}();exports.default=u;
@@ -1 +1 @@
1
- "use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/inherits"),a=require("@babel/runtime/helpers/possibleConstructorReturn"),n=require("@babel/runtime/helpers/getPrototypeOf"),s=require("video.js"),i=require("./icons-437e83c9.js"),o=require("./generic-118f7ebd.js"),l=require("./skin-55634dc6.js");function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("./manager-77ddd30c.js"),require("./browser-3670a923.js"),require("md5"),require("js-cookie"),require("./captions-abd87121.js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/typeof"),require("./playerControlEvents-db923a5c.js"),require("@babel/runtime/helpers/slicedToArray"),require("@viewlift/comscore/index.js"),require("@babel/runtime/helpers/objectWithoutProperties");var d=s.getComponent("Component"),u=function(){r(v,d);var u,m,p=(u=v,m=c(),function(){var e,t=n(u);if(m){var r=n(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return a(this,e)});function v(t){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,v),(r=p.call(this,t,a)).playerId=a.playerId,r.seriesData=a.sres,r.streams=a.streams,r.currentVideoData=a.res,r.initialiseStructure(),r.loadCSS(),r}return t(v,[{key:"createEl",value:function(){var e=s.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=s.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(i.BroadcastIcon())});return s.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then((function(){return require("./multicamv2-1efdbdb9.js")})).then((function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),r=s.dom.createEl("div",{className:"stream-container hidden"});s.dom.$(".stream-selector-icon",this.el()).onclick=function(){var a;null!==(a=r.classList)&&void 0!==a&&a.contains("hidden")?(l.closeOpenDrawers(),r.classList.remove("hidden"),t.classList.add("open"),l.setUpdatedElHeight(e.playerId,r)):(r.classList.add("hidden"),t.classList.remove("open"))};var a=document.getElementById(this.playerId);if(a){var n=window.getComputedStyle(a,null).getPropertyValue("height").slice(0,-2);r.style.height="".concat(n,"px"),a.style.overflow="hidden",s.dom.appendContent(t,r),this.addFunctionality(r)}}},{key:"addFunctionality",value:function(e){var t=this,r=this.el(),a=s.dom.createEl("div",{className:"stream-selector-head"}),n=s.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(i.crossIconSvg())});n.onclick=function(){e.classList.add("hidden"),r.classList.remove("open")};for(var c=s.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),d=s.dom.createEl("div",{className:"stream-selector-content"}),u=s.dom.createEl("div",{className:"stream-tray"}),m=function(e){var r,a,n,l=s.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(i.SelectedStream())});0==e&&(l.classList.add("selected"),l.style.border="2px solid #D2393B"),l.onclick=function(){for(var r=s.dom.$$(".stream"),a=0;a<r.length;a++)r[a].style.border="none",r[a].classList.remove("selected");l.classList.add("selected"),l.style.border="2px solid #D2393B",o.load(t.playerId,t.streams[e].id).then((function(e){o.play(t.playerId),console.log(e)})).catch((function(e){console.log(e)}))},l.style.backgroundImage="url(".concat(t.streams[e].img,")");var c=document.createElement("img");c.className="stream-thumbnail-image",c.src="".concat((null==t||null===(r=t.streams[e])||void 0===r?void 0:r.img)||(null===(a=window)||void 0===a||null===(n=a.customData)||void 0===n?void 0:n.fallbackImage)),l.append(c),s.dom.appendContent(u,l),s.dom.appendContent(d,u)},p=0;p<this.streams.length;p++)m(p);s.dom.appendContent(a,n),s.dom.appendContent(a,c),s.dom.appendContent(e,a),s.dom.appendContent(e,d),l.handleDrawerResizing(this.playerId,e)}}]),v}();exports.default=u;
1
+ "use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/inherits"),a=require("@babel/runtime/helpers/possibleConstructorReturn"),n=require("@babel/runtime/helpers/getPrototypeOf"),s=require("video.js"),i=require("./icons-437e83c9.js"),o=require("./generic-0b925a19.js"),l=require("./skin-55634dc6.js");function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("./manager-77ddd30c.js"),require("./browser-3670a923.js"),require("md5"),require("js-cookie"),require("./captions-8b889384.js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/slicedToArray"),require("@babel/runtime/helpers/typeof"),require("./playerControlEvents-db923a5c.js"),require("@viewlift/comscore/index.js"),require("@babel/runtime/helpers/objectWithoutProperties");var d=s.getComponent("Component"),u=function(){r(v,d);var u,m,p=(u=v,m=c(),function(){var e,t=n(u);if(m){var r=n(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return a(this,e)});function v(t){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,v),(r=p.call(this,t,a)).playerId=a.playerId,r.seriesData=a.sres,r.streams=a.streams,r.currentVideoData=a.res,r.initialiseStructure(),r.loadCSS(),r}return t(v,[{key:"createEl",value:function(){var e=s.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=s.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(i.BroadcastIcon())});return s.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then((function(){return require("./multicamv2-1efdbdb9.js")})).then((function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),r=s.dom.createEl("div",{className:"stream-container hidden"});s.dom.$(".stream-selector-icon",this.el()).onclick=function(){var a;null!==(a=r.classList)&&void 0!==a&&a.contains("hidden")?(l.closeOpenDrawers(),r.classList.remove("hidden"),t.classList.add("open"),l.setUpdatedElHeight(e.playerId,r)):(r.classList.add("hidden"),t.classList.remove("open"))};var a=document.getElementById(this.playerId);if(a){var n=window.getComputedStyle(a,null).getPropertyValue("height").slice(0,-2);r.style.height="".concat(n,"px"),a.style.overflow="hidden",s.dom.appendContent(t,r),this.addFunctionality(r)}}},{key:"addFunctionality",value:function(e){var t=this,r=this.el(),a=s.dom.createEl("div",{className:"stream-selector-head"}),n=s.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(i.crossIconSvg())});n.onclick=function(){e.classList.add("hidden"),r.classList.remove("open")};for(var c=s.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),d=s.dom.createEl("div",{className:"stream-selector-content"}),u=s.dom.createEl("div",{className:"stream-tray"}),m=function(e){var r,a,n,l=s.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(i.SelectedStream())});0==e&&(l.classList.add("selected"),l.style.border="2px solid #D2393B"),l.onclick=function(){for(var r=s.dom.$$(".stream"),a=0;a<r.length;a++)r[a].style.border="none",r[a].classList.remove("selected");l.classList.add("selected"),l.style.border="2px solid #D2393B",o.load(t.playerId,t.streams[e].id).then((function(e){o.play(t.playerId),console.log(e)})).catch((function(e){console.log(e)}))},l.style.backgroundImage="url(".concat(t.streams[e].img,")");var c=document.createElement("img");c.className="stream-thumbnail-image",c.src="".concat((null==t||null===(r=t.streams[e])||void 0===r?void 0:r.img)||(null===(a=window)||void 0===a||null===(n=a.customData)||void 0===n?void 0:n.fallbackImage)),l.append(c),s.dom.appendContent(u,l),s.dom.appendContent(d,u)},p=0;p<this.streams.length;p++)m(p);s.dom.appendContent(a,n),s.dom.appendContent(a,c),s.dom.appendContent(e,a),s.dom.appendContent(e,d),l.handleDrawerResizing(this.playerId,e)}}]),v}();exports.default=u;